const isWhatsappLoaded = () =>
    document["querySelector"]("#pane-side") ? !![] : ![],
  isWebpackLoaded = () =>
    "function" === typeof webpackJsonp ||
    window["webpackChunkwhatsapp_web_client"] ||
    window["require"],
  getWhatsappVersion = () =>
    window?.["Debug"]?.["VERSION"]
      ? window["Debug"]["VERSION"]
      : "Not\x20Found!",
  sleep = (o) => new Promise((m) => setTimeout(m, o));
(console["logSuccess"] = (o) =>
  console["log"](
    "%c" + o,
    "color:\x20lightGreen;\x20font-weight:\x20bold;\x20font-size:\x2014px;"
  )),
  (console["logError"] = (o) =>
    console["log"]("%c" + o, "color:\x20red;\x20font-weight:\x20bold;")),
  (console["logWarn"] = (o) =>
    console["log"]("%c" + o, "color:\x20orange;\x20font-weight:\x20bold;"));
const initStore = function (o = !![]) {
    const m = {
      ESPxF: function (E) {
        return E();
      },
      XNdLE: function (E) {
        return E();
      },
    };
    return o ? m["ESPxF"](initStoreOld) : m["XNdLE"](initStoreNew);
  },
  initStoreOld = function () {
    const o = {
        sALFy: function (E, z) {
          return E(z);
        },
        Sxqmv: function (E, z) {
          return E == z;
        },
        AjGCF: "string",
        BTFOb: "object",
        PcVss: function (E, z) {
          return E == z;
        },
        KkLFi: function (E, z) {
          return E != z;
        },
        OqJMA: "function",
        hdTak: function (E, z) {
          return E + z;
        },
        vSzAM: "\x20was\x20passed",
        XbxHy: "WAWebChatCollection",
        Ntscb: "WAWebContactCollection",
        PMKTQ: "WAWebMsgCollection",
        SqJvs: "WAWebBusinessProfileCollection",
        TbBGp: "WAWebGroupMetadataCollection",
        csYhS: "WAWebSendTextMsgChatAction",
        rozdB: function (E, z) {
          return E(z);
        },
        oKYVz: "WAWebAttachMediaCollection",
        wnoQX: "WAWebWid",
        ANWId: "WAWebWamEnumMediaPickerOriginType",
        GDvJB: "old_method_1",
        sqClt: "sendTextMsgToChat",
        PURXk: "createWid",
        UYqSj: "Cmd",
        WbkMh: "sendChatStateComposing",
        TeMxJ: "getUserid",
        waJnH: "findChat",
        AtWOs: "MEDIA_PICKER_ORIGIN_TYPE",
        pVJcb: "old_method_2",
        HCOIK: function (E) {
          return E();
        },
        iNMYO: function (E, z) {
          return E(z);
        },
        dvgrV: function (E, z) {
          return E + z;
        },
        AsFkR: "InjectJS\x20::\x20initStoreOld\x20::\x20Error\x20::\x20",
      },
      m = function () {
        const E = {
          WQCNx: function (z, b) {
            return o["sALFy"](z, b);
          },
          JiViB: function (z, b) {
            return o["Sxqmv"](z, b);
          },
          GfrEQ: o["AjGCF"],
          XCASa: o["BTFOb"],
          GFOgU: function (z, b) {
            return o["Sxqmv"](z, b);
          },
          rGtyb: function (z, b) {
            return o["PcVss"](z, b);
          },
          NReXS: function (z, b) {
            return o["KkLFi"](z, b);
          },
          mzqWB: o["OqJMA"],
          TpDWD: function (z, b) {
            return o["hdTak"](z, b);
          },
          ZMSdM:
            "findModule\x20can\x20only\x20find\x20via\x20string\x20and\x20function,\x20",
          KOWco: o["vSzAM"],
        };
        return (
          (m["mID"] = Math["random"]()["toString"](0x24)["substring"](0x7)),
          (m["mObj"] = {}),
          (window["webpackChunkbuild"] ||
            window["webpackChunkwhatsapp_web_client"])["push"]([
            [m["mID"]],
            {},
            function (z) {
              const b = {
                vQtNI: function (C, X) {
                  return E["WQCNx"](C, X);
                },
              };
              Object["keys"](z["m"])["forEach"](function (C) {
                m["mObj"][C] = b["vQtNI"](z, C);
              });
            },
          ]),
          {
            modules: m["mObj"],
            constructors: m["cArr"],
            findModule: function (z) {
              let b = [];
              return (
                Object["keys"](m["mObj"])["forEach"](function (C) {
                  let X = m["mObj"][C];
                  if (void 0x0 !== X) {
                    if (E["JiViB"](E["GfrEQ"], typeof z)) {
                      if (E["XCASa"] == typeof X["default"]) {
                        for (let P in X["default"])
                          E["GFOgU"](P, z) && b["push"](X);
                      }
                      for (let B in X) E["rGtyb"](B, z) && b["push"](X);
                    } else {
                      if (E["NReXS"](E["mzqWB"], typeof z))
                        throw new TypeError(
                          E["TpDWD"](E["ZMSdM"], typeof z) + E["KOWco"]
                        );
                      z(X) && b["push"](X);
                    }
                  }
                }),
                b
              );
            },
            get: function (z) {
              return m["mObj"][z];
            },
          }
        );
      };
    return new Promise((E, z) => {
      try {
        if (window["require"] && window["importDefault"]) {
          const b = (X) => window["require"](X),
            C = (X) => window["importDefault"](X);
          (window["Store"] = {
            Chat: o["sALFy"](b, o["XbxHy"])?.["ChatCollection"],
            Contact: b(o["Ntscb"])?.["ContactCollection"],
            Msg: b(o["PMKTQ"])?.["MsgCollection"],
            MsgKey: o["sALFy"](C, "WAWebMsgKey"),
            BusinessProfile: o["sALFy"](b, o["SqJvs"])?.[
              "BusinessProfileCollection"
            ],
            GroupMetadata: o["sALFy"](C, o["TbBGp"]),
            TextMsgChatAction: o["sALFy"](b, o["csYhS"]),
            MediaCollection: o["rozdB"](C, o["oKYVz"]),
            UserConstructor: o["rozdB"](C, o["wnoQX"]),
            EnumTypes: o["rozdB"](b, o["ANWId"]),
          }),
            window["Store"] && (window["Store"]["InitType"] = o["GDvJB"]);
        } else {
          let X = m();
          (window["Store"] = Object["assign"](
            {},
            X["findModule"]((P) => P["default"] && P["default"]["Chat"])[0x0]?.[
              "default"
            ] || {}
          )),
            (window["Store"]["MediaCollection"] = X["findModule"](
              (P) =>
                P["default"] &&
                P["default"]["prototype"]?.["processAttachments"]
            )[0x0]?.["default"]),
            (window["Store"]["UserConstructor"] = X["findModule"](
              (P) =>
                P["default"] &&
                P["default"]["prototype"]?.["isServer"] &&
                P["default"]["prototype"]?.["isUser"]
            )[0x0]?.["default"]),
            (window["Store"]["TextMsgChatAction"] = X["findModule"](
              o["sqClt"]
            )[0x0]),
            (window["Store"]["WidFactory"] = X["findModule"](o["PURXk"])[0x0]),
            (window["Store"]["Cmd"] = X["findModule"](o["UYqSj"])[0x0]?.[
              "Cmd"
            ]),
            (window["Store"]["ChatState"] = X["findModule"](o["WbkMh"])[0x0]),
            (window["Store"]["ContactMethods"] = X["findModule"](
              o["TeMxJ"]
            )[0x0]),
            (window["Store"]["ChatHelper"] = X["findModule"](o["waJnH"])[0x0]),
            (window["Store"]["EnumTypes"] = X["findModule"](o["AtWOs"])[0x0]),
            (window["Store"]["MenuClasses"] = X["findModule"]((P) =>
              P?.["default"]?.["menu"] && P?.["default"]?.["item"]
                ? P["default"]
                : null
            )[0x0]?.["default"]),
            window["Store"] && (window["Store"]["InitType"] = o["pVJcb"]);
        }
        window["Store"]?.["Chat"]?.["modelClass"]?.["prototype"] &&
          (window["Store"]["Chat"]["modelClass"]["prototype"]["sendMessage"] =
            function (P) {
              window["Store"]["TextMsgChatAction"]["sendTextMsgToChat"](
                this,
                ...arguments
              );
            }),
          window["Store"]?.["Chat"] &&
            !window["Store"]["Chat"]["_find"] &&
            ((window["Store"]["Chat"]["_findAndParse"] =
              window["Store"]["BusinessProfile"]?.["_findAndParse"]),
            (window["Store"]["Chat"]["_find"] =
              window["Store"]["BusinessProfile"]?.["_find"])),
          o["HCOIK"](E);
      } catch (P) {
        o["iNMYO"](z, o["dvgrV"](o["AsFkR"], P));
      }
    });
  },
  initStoreNew = function () {
    const F = {
        jllxG: function (Q, W) {
          return Q(W);
        },
        zdChN: function (Q, W) {
          return Q != W;
        },
        tfoYR: function (Q, W) {
          return Q >= W;
        },
        vlAZh: function (Q, W) {
          return Q(W);
        },
        oYmvC: function (Q, W) {
          return Q(W);
        },
        vkpoJ: "new_method",
        SvDLA: function (Q, W) {
          return Q + W;
        },
        RIXYt: "InjectJS\x20::\x20initStoreNew\x20::\x20Error\x20::\x20",
        IdKkL: "MediaCollection",
        utMzx: "WAWebAttachMediaCollection",
        NRGxS: "Archive",
        eKRfv: "WAWebSetArchiveChatAction",
        XLFhd: "Block",
        vyqpe: "ChatUtil",
        tTuEq: "WAWebGroupInviteJob",
        fQEeT: "WAWebCreateGroupAction",
        gjXSM: "State",
        Nfzfd: "WAWebSocketModel",
        Gxqad: "_Presence",
        RWFiO: "WapDelete",
        vqIiJ: "WAWebChatDeleteBridge",
        tCced: "WapQuery",
        SBBJV: "UserConstructor",
        hZyuM: "SendTextMsgToChat",
        BbgzB: "WAWebSendTextMsgChatAction",
        aRqvs: "WAWebUpdateUnreadChatAction",
        iyZHJ: "sendDelete",
        NOavh: "WAWebDeleteChatAction",
        CpeZz: "WAWebSendMsgChatAction",
        MxgRU: "Catalog",
        BeRqF: "WAWebCatalogCollection",
        lVuNE: "MsgKey",
        OyBFK: "WAWebMsgKey",
        iJPTd: "WAWebE2EProtoUtils",
        IIoof: "WAWebProtobufsE2E.pb",
        lDLhE: "WAWebContactStatusBridge",
        OMkXk: "ChatStates",
        jhavn: "GroupActions",
        uCHZL: "WAWebExitGroupAction",
        VWlka: "Participants",
        rYluq: "WidFactory",
        dznFt: "Sticker",
        nTOsO: "WAWebStickerPackCollection",
        rQhSK: "UploadUtils",
        wnOsq: "WAWebUploadManager",
      },
      u = {};
    (u["id"] = F["IdKkL"]),
      (u["module"] = F["utMzx"]),
      (u["conditions"] = (Q) =>
        Q["default"] &&
        Q["default"]["prototype"] &&
        (Q["default"]["prototype"]["processFiles"] !== undefined ||
          Q["default"]["prototype"]["processAttachments"] !== undefined)
          ? Q["default"]
          : null);
    const p = {};
    (p["id"] = F["NRGxS"]),
      (p["module"] = F["eKRfv"]),
      (p["conditions"] = (Q) => (Q["setArchive"] ? Q : null));
    const T = {};
    (T["id"] = F["XLFhd"]),
      (T["module"] = "WAWebBlockContactUtils"),
      (T["conditions"] = (Q) =>
        Q["blockContact"] && Q["unblockContact"] ? Q : null);
    const S = {};
    (S["id"] = F["vyqpe"]),
      (S["module"] = "WAWebSendClearChatAction"),
      (S["conditions"] = (Q) => (Q["sendClear"] ? Q : null));
    const h = {};
    (h["id"] = "GroupInvite"),
      (h["module"] = F["tTuEq"]),
      (h["conditions"] = (Q) => (Q["queryGroupInviteCode"] ? Q : null));
    const V = {};
    (V["id"] = "Wap"),
      (V["module"] = F["fQEeT"]),
      (V["conditions"] = (Q) => (Q["createGroup"] ? Q : null));
    const D = {};
    (D["id"] = F["gjXSM"]),
      (D["module"] = F["Nfzfd"]),
      (D["conditions"] = (Q) => (Q["STATE"] && Q["STREAM"] ? Q : null));
    const N = {};
    (N["id"] = F["Gxqad"]),
      (N["module"] = "WAWebContactPresenceBridge"),
      (N["conditions"] = (Q) =>
        Q["setPresenceAvailable"] && Q["setPresenceUnavailable"] ? Q : null);
    const U = {};
    (U["id"] = F["RWFiO"]),
      (U["module"] = F["vqIiJ"]),
      (U["conditions"] = (Q) =>
        Q["sendConversationDelete"] &&
        Q["sendConversationDelete"]["length"] == 0x2
          ? Q
          : null);
    const a = {};
    (a["id"] = F["tCced"]),
      (a["module"] = "WAWebQueryExistsJob"),
      (a["conditions"] = (Q) =>
        Q["queryExist"]
          ? Q
          : Q["default"] && Q["default"]["queryExist"]
          ? Q["default"]
          : null);
    const f = {};
    (f["id"] = F["SBBJV"]),
      (f["module"] = "WAWebWid"),
      (f["conditions"] = (Q) =>
        Q["default"] &&
        Q["default"]["prototype"] &&
        Q["default"]["prototype"]["isServer"] &&
        Q["default"]["prototype"]["isUser"]
          ? Q["default"]
          : null);
    const L = {};
    (L["id"] = F["hZyuM"]),
      (L["module"] = F["BbgzB"]),
      (L["resolver"] = (Q) => Q["sendTextMsgToChat"]);
    const n = {};
    (n["id"] = "ReadSeen"),
      (n["module"] = F["aRqvs"]),
      (n["conditions"] = (Q) => (Q["sendSeen"] ? Q : null));
    const Z = {};
    (Z["id"] = F["iyZHJ"]),
      (Z["module"] = F["NOavh"]),
      (Z["conditions"] = (Q) => (Q["sendDelete"] ? Q["sendDelete"] : null));
    const Y = {};
    (Y["id"] = "addAndSendMsgToChat"),
      (Y["module"] = F["CpeZz"]),
      (Y["conditions"] = (Q) =>
        Q["addAndSendMsgToChat"] ? Q["addAndSendMsgToChat"] : null);
    const j = {};
    (j["id"] = F["MxgRU"]),
      (j["module"] = F["BeRqF"]),
      (j["conditions"] = (Q) => (Q["Catalog"] ? Q["Catalog"] : null));
    let s = [
      u,
      p,
      T,
      S,
      h,
      V,
      D,
      N,
      U,
      a,
      f,
      L,
      n,
      Z,
      Y,
      j,
      {
        id: F["lVuNE"],
        module: F["OyBFK"],
        conditions: (Q) =>
          Q["default"] &&
          Q["default"]["toString"] &&
          Q["default"]
            ["toString"]()
            ["includes"]("MsgKey\x20error:\x20obj\x20is\x20null/undefined")
            ? Q["default"]
            : null,
      },
      {
        id: "Parser",
        module: F["iJPTd"],
        conditions: (Q) =>
          Q["convertToTextWithoutSpecialEmojis"] ? Q["default"] : null,
      },
      {
        id: "Builders",
        module: F["IIoof"],
        conditions: (Q) =>
          Q["TemplateMessage"] && Q["HydratedFourRowTemplate"] ? Q : null,
      },
      {
        id: "Me",
        module: "WAWebUserPrefsMeUser",
        conditions: (Q) => (Q["PLATFORMS"] && Q["Conn"] ? Q["default"] : null),
      },
      {
        id: "MyStatus",
        module: F["lDLhE"],
        conditions: (Q) => (Q["getStatus"] && Q["setMyStatus"] ? Q : null),
      },
      {
        id: F["OMkXk"],
        module: "WAWebChatStateBridge",
        conditions: (Q) =>
          Q["sendChatStatePaused"] &&
          Q["sendChatStateRecording"] &&
          Q["sendChatStateComposing"]
            ? Q
            : null,
      },
      {
        id: F["jhavn"],
        module: F["uCHZL"],
        conditions: (Q) =>
          Q["sendExitGroup"] && Q["localExitGroup"] ? Q : null,
      },
      {
        id: F["VWlka"],
        module: "WAWebGroupsParticipantsApi",
        conditions: (Q) =>
          Q["addParticipants"] &&
          Q["removeParticipants"] &&
          Q["promoteParticipants"] &&
          Q["demoteParticipants"]
            ? Q
            : null,
      },
      {
        id: F["rYluq"],
        module: "WAWebWidFactory",
        conditions: (Q) =>
          Q["isWidlike"] && Q["createWid"] && Q["createWidFromWidLike"]
            ? Q
            : null,
      },
      {
        id: F["dznFt"],
        module: F["nTOsO"],
        resolver: (Q) => Q["StickerPackCollection"],
        conditions: (Q) =>
          Q["default"] && Q["default"]["Sticker"]
            ? Q["default"]["Sticker"]
            : null,
      },
      {
        id: F["rQhSK"],
        module: F["wnOsq"],
        conditions: (Q) =>
          Q["default"] && Q["default"]["encryptAndUpload"]
            ? Q["default"]
            : null,
      },
    ];
    return new Promise((Q, W) => {
      const M = {
        HYqOr: function (t, y) {
          return F["jllxG"](t, y);
        },
        ZhgaX: function (t, r) {
          return F["zdChN"](t, r);
        },
        HURaX: function (t, r) {
          return F["tfoYR"](t, r);
        },
        ynmUm: function (t, y) {
          return F["jllxG"](t, y);
        },
        lVxGc: function (t, y) {
          return F["vlAZh"](t, y);
        },
        JGsbs: function (t, y) {
          return F["jllxG"](t, y);
        },
      };
      try {
        const t = (r) => require("__debug")["modulesMap"][r] || ![],
          y = (r) => {
            const x = M["HYqOr"](t, r);
            if (!x) return ![];
            return (
              M["ZhgaX"](x["dependencies"], null) &&
              M["HURaX"](x["depPosition"], x["dependencies"]["length"])
            );
          };
        s["map"]((r) => {
          const x = r["module"];
          if (!x) return;
          if (!M["ynmUm"](t, x)) return;
          if (M["lVxGc"](y, x)) {
            let I = M["JGsbs"](require, x);
            r["foundedModule"] = I;
          }
        }),
          (window["Store"] = {
            ...{ ...F["oYmvC"](require, "WAWebCollections") },
            ...(window["Store"] || {}),
          }),
          s["forEach"]((r) => {
            r["foundedModule"] &&
              (window["Store"][r["id"]] = r["resolver"]
                ? r["resolver"](r["foundedModule"])
                : r["foundedModule"]);
          }),
          window["Store"]["Chat"] &&
            (window["Store"]["Chat"]["modelClass"]["prototype"]["sendMessage"] =
              function (r) {
                window["Store"]["SendTextMsgToChat"](this, ...arguments);
              }),
          window["Store"] && (window["Store"]["InitType"] = F["vkpoJ"]),
          Q();
      } catch (r) {
        W(F["SvDLA"](F["RIXYt"], r));
      }
    });
  },
  initPrimes = function () {
    const m = {
        ZFCnZ: function (z, b) {
          return z & b;
        },
        SXJok: function (z, b) {
          return z & b;
        },
        tGSwh: function (z, b) {
          return z & b;
        },
        CyMlA: "statusMute",
        iyLOC: "disappearingModeDuration",
        CxZvL: "disappearingModeSettingTimestamp",
        COTbe: function (z, b) {
          return z !== b;
        },
        GdTDs: "forcedBusinessUpdateFromServer",
        EwSEF: "privacyMode",
        zzXXh: function (z, b) {
          return z !== b;
        },
        OkLqk: "sectionHeader",
        gyxVU: "verifiedLevel",
        HXrbp: function (z, b) {
          return z === b;
        },
        NdcOm: function (z, b) {
          return z == b;
        },
        gjruI: "object",
        WSJwK: function (z, b) {
          return z !== b;
        },
        QzcoX: function (z, b) {
          return z(b);
        },
        YYmUD: function (z, b) {
          return z && b;
        },
        cgpah: function (z, b) {
          return z !== b;
        },
        pizyL: "string",
        KHkqv: function (z, b) {
          return z - b;
        },
        HTBOD: function (z, b) {
          return z >= b;
        },
        klchC: function (z, b) {
          return z != b;
        },
        OvTKC: function (z, b) {
          return z(b);
        },
        DYcsq: function (z, b) {
          return z > b;
        },
        GuFVD: function (z) {
          return z();
        },
        Tlqxl: function (z, b) {
          return z !== b;
        },
        fgBFJ: function (z, b) {
          return z(b);
        },
      },
      E = {};
    (E["lastRead"] = {}),
      (window["PRIMES"] = E),
      (window["PRIMES"]["_serializeRawObject"] = (z) => {
        if (z) {
          let b = {};
          z = z["toJSON"] ? z["toJSON"]() : { ...z };
          for (let C in z)
            if (
              m["ZFCnZ"](
                m["ZFCnZ"](
                  m["ZFCnZ"](
                    m["SXJok"](
                      m["tGSwh"](
                        m["ZFCnZ"](m["CyMlA"] !== C, m["iyLOC"] !== C),
                        m["CxZvL"] !== C
                      ),
                      m["COTbe"](m["GdTDs"], C)
                    ),
                    m["COTbe"](m["EwSEF"], C)
                  ),
                  m["zzXXh"](m["OkLqk"], C)
                ),
                m["COTbe"](m["gyxVU"], C)
              )
            ) {
              if (m["HXrbp"]("id", C)) {
                b[C] = { ...z[C] };
                continue;
              }
              if (
                m["NdcOm"](m["gjruI"], typeof z[C]) &&
                !Array["isArray"](z[C])
              ) {
                b[C] = window["PRIMES"]["_serializeRawObject"](z[C]);
                continue;
              }
              if (Array["isArray"](z[C])) {
                b[C] = z[C]["map"]((X) =>
                  "object" == typeof X
                    ? window["PRIMES"]["_serializeRawObject"](X)
                    : X
                );
                continue;
              }
              b[C] = z[C];
            }
          return b;
        }
        return {};
      }),
      (window["PRIMES"]["_serializeContactObject"] = (z) => {
        return z == null
          ? null
          : Object["assign"](window["PRIMES"]["_serializeRawObject"](z), {
              formattedName: z["formattedName"],
              displayName: z["displayName"],
              isMe: z["isMe"],
              isMyContact: z["isMyContact"],
              isPSA: z["isPSA"],
              isUser: z["isUser"],
              isVerified: z["isVerified"],
              isWAContact: z["isWAContact"],
            });
      }),
      (window["PRIMES"]["getGroupMetadata"] = async function (z, b) {
        let C = window["Store"]["GroupMetadata"]["get"](z);
        return (
          m["COTbe"](void 0x0, C) &&
            C["stale"] &&
            (await window["Store"]["GroupMetadata"]["update"](z)),
          m["WSJwK"](void 0x0, b) && b(C),
          C
        );
      }),
      (window["PRIMES"]["sendAttachment"] = function (z, b, C, X) {
        return new Promise((P, B) => {
          let k = Store["Chat"]["get"](b);
          var J = new Store["MediaCollection"](k);
          const c = {};
          (c["file"] = z),
            J["processAttachments"]([c, 0x1], k, k)["then"](() => {
              var g = J["_models"][0x0];
              const K = {};
              (K["quotedMsg"] = ![]),
                (K["isCaptionByUser"] = !![]),
                (K["type"] = J["_models"][0x0]["type"]);
              let A = K;
              /\S/["test"](C) && (A["caption"] = C), g["sendToChat"](k, A), P();
            });
        });
      }),
      (window["PRIMES"]["getMyContacts"] = function (z) {
        const b = window["Store"]["Contact"]
          ["filter"]((C) => C["isAddressBookContact"] === 0x1)
          ["map"]((C) => PRIMES["_serializeContactObject"](C));
        if (z) z(b);
        return b;
      }),
      (window["PRIMES"]["getMyUnsavedContacts"] = function (z) {
        const b = window["Store"]["Contact"]
          ["filter"](
            (C) =>
              C?.["__x_id"]?.["server"] === "c.us" &&
              C?.["isAddressBookContact"] === 0x0 &&
              C?.["isBusiness"] !== !![]
          )
          ["map"]((C) => ({
            user: C["id"]["user"],
            pushname: C["pushname"] || "Unknown",
          }));
        if (z) m["QzcoX"](z, b);
        return b;
      }),
      (window["PRIMES"]["getAllContacts"] = function (z) {
        const b = {
            tvgqo: "c.us",
            WlUPZ: function (X, P) {
              return X === P;
            },
            fiqTM: function (X, P) {
              return m["zzXXh"](X, P);
            },
            gjSca: function (X, P) {
              return m["YYmUD"](X, P);
            },
          },
          C = window["Store"]["Contact"]["filter"]((X) => {
            const P = X?.["__x_id"]?.["server"] === b["tvgqo"],
              B = b["WlUPZ"](X?.["isAddressBookContact"], 0x1),
              k = b["fiqTM"](X?.["isBusiness"], !![]);
            return b["gjSca"](P, B) && k;
          });
        if (m["cgpah"](z, undefined)) m["QzcoX"](z, C);
        return C;
      }),
      (window["PRIMES"]["getAllGroups"] = function (z) {
        const b = window["Store"]["Chat"]["filter"]((C) => C["isGroup"]);
        if (z) m["QzcoX"](z, b);
        return b;
      }),
      (window["PRIMES"]["getChat"] = function (z, b) {
        z = m["NdcOm"](typeof z, m["pizyL"]) ? z : z["_serialized"];
        const C = window["Store"]["Chat"]["get"](z);
        C["sendMessage"] = C["sendMessage"]
          ? C["sendMessage"]
          : function () {
              return window["Store"]["sendMessage"]["apply"](this, arguments);
            };
        if (m["zzXXh"](b, undefined)) m["QzcoX"](b, C);
        return C;
      }),
      (window["PRIMES"]["sendMessage"] = function (z, b, C) {
        const X = {
          iWFmN: function (B, k) {
            return m["KHkqv"](B, k);
          },
          uDkHU: function (B, k) {
            return m["HTBOD"](B, k);
          },
          PHipz: function (B, k) {
            return m["klchC"](B, k);
          },
          fVTAe: function (B, k) {
            return m["OvTKC"](B, k);
          },
          Bdigl: function (B, k) {
            return m["DYcsq"](B, k);
          },
          qwsol: function (B, k) {
            return B(k);
          },
          hJXEX: function (B) {
            return m["GuFVD"](B);
          },
        };
        var P = PRIMES["getChat"](z);
        if (m["Tlqxl"](P, undefined)) {
          if (C !== undefined)
            P["sendMessage"](b)["then"](function () {
              var B = 0x0;
              function k() {
                for (
                  let J = X["iWFmN"](P["msgs"]["models"]["length"], 0x1);
                  X["uDkHU"](J, 0x0);
                  J--
                ) {
                  let c = P["msgs"]["models"][J];
                  if (!c["senderObj"]["isMe"] || X["PHipz"](c["body"], b))
                    continue;
                  return X["fVTAe"](C, PRIMES["_serializeMessageObj"](c)), !![];
                }
                B += 0x1;
                if (X["Bdigl"](B, 0x1e)) {
                  X["qwsol"](C, !![]);
                  return;
                }
                X["qwsol"](sleep, 0x1f4)["then"](k);
              }
              X["hJXEX"](k);
            });
          else return P["sendMessage"](b), !![];
        } else {
          if (C !== undefined) m["fgBFJ"](C, ![]);
          return ![];
        }
      });
  };
var initStoreInterval = null,
  initStoreRetryCount = 0x0;
const initMain = function (o = !![]) {
  const m = {
    EcUHH: function (E, z) {
      return E + z;
    },
    gBSmC: "InjectJS\x20::\x20initMain\x20-\x20Error\x20::\x20",
    xrDbC: function (E, z) {
      return E(z);
    },
    mqFQA: function (E) {
      return E();
    },
    TETpr: function (E, z) {
      return E(z);
    },
    TadzY: "Webpack",
    NvVOp: function (E, z) {
      return E == z;
    },
    IPpwo:
      "InjectJS\x20::\x20initMain\x20-\x20Reload\x20::\x20useOldMethod\x20=\x20true",
    NZQfG: function (E, z) {
      return E(z);
    },
    QYJuo: function (E, z, b) {
      return E(z, b);
    },
  };
  m["xrDbC"](clearInterval, initStoreInterval),
    (initStoreRetryCount = 0x0),
    (initStoreInterval = m["QYJuo"](
      setInterval,
      () => {
        const E = {
          kknaG: function (z) {
            return z();
          },
          Pjkuy: function (z, b) {
            return m["xrDbC"](z, b);
          },
        };
        if (m["mqFQA"](isWhatsappLoaded) && m["mqFQA"](isWebpackLoaded))
          m["TETpr"](initStore, o)
            ["then"](() => {
              E["kknaG"](initPrimes);
              if (window["Store"] && window["PRIMES"])
                console["logSuccess"](
                  "InjectJS\x20::\x20initMain\x20-\x20Success\x20::\x20useOldMethod\x20=\x20" +
                    o
                ),
                  E["Pjkuy"](clearInterval, initStoreInterval);
              else {
                initStoreRetryCount++;
                const z = window["PRIMES"] ? "Store" : "PRIMES";
                console["logError"](
                  "InjectJS\x20::\x20initMain\x20-\x20Error\x20::\x20" +
                    z +
                    "\x20is\x20not\x20initialized!\x20::\x20useOldMethod\x20=\x20" +
                    o
                );
              }
            })
            ["catch"]((z) => {
              initStoreRetryCount++,
                console["logError"](m["EcUHH"](m["gBSmC"], z));
            });
        else {
          const z = isWhatsappLoaded() ? m["TadzY"] : "Whatsapp";
          console["logWarn"](
            "InjectJS\x20::\x20initMain\x20-\x20Warn\x20::\x20" +
              z +
              "\x20is\x20not\x20loaded\x20yet."
          );
        }
        !o &&
          m["NvVOp"](initStoreRetryCount, 0x5) &&
          (console["logWarn"](m["IPpwo"]), m["NZQfG"](initMain, !![]));
      },
      0x3e8
    ));
};
initMain(![]);
const base64toFile = async (m, E) => {
  const z = {
    Sgbmu: function (J, c) {
      return J(c);
    },
  };
  let b = m["split"](","),
    C = b[0x0]["match"](/:(.*?);/)[0x1],
    X = z["Sgbmu"](atob, b[0x1]),
    P = X["length"],
    B = new Uint8Array(P);
  while (P--) {
    B[P] = X["charCodeAt"](P);
  }
  const k = {};
  return (k["type"] = C), new File([B], E, k);
};
window["addEventListener"]("PRIMES::init", function (o) {
  const m = o["detail"]["useOldMethod"];
  initMain(m);
}),
  window["addEventListener"]("PRIMES::send-attachments", function (o) {
    const m = {
        MnBdR: function (X, P, B) {
          return X(P, B);
        },
        ZFYZO: function (X, P) {
          return X + P;
        },
        GuPLj: "@c.us",
      },
      E = o["detail"]["attachments"];
    let z = o["detail"]["caption"];
    const b = o["detail"]["number"],
      C = m["ZFYZO"](b, m["GuPLj"]);
    E["forEach"](async (X, P) => {
      const B = await JSON["parse"](X["data"]),
        k = await m["MnBdR"](base64toFile, B, X["name"]);
      await window["PRIMES"]["sendAttachment"](k, C, z[P]);
    });
  }),
  window["addEventListener"]("PRIMES::send-message", async function (C) {
    const X = {};
    (X["aGPCI"] = function (B, k) {
      return B + k;
    }),
      (X["gUuOs"] = "send_message");
    const P = X;
    try {
      const B = C["detail"]["number"],
        k = C["detail"]["message"],
        J = P["aGPCI"](B, "@c.us");
      await window["PRIMES"]["sendMessage"](J, k);
      const c = {};
      c["chatId"] = J;
      const g = {};
      (g["type"] = P["gUuOs"]),
        (g["payload"] = c),
        window["postMessage"](g, "*");
    } catch (K) {
      console["error"](K);
      const A = {};
      (A["chatId"] = chatId), (A["error"] = K);
      const H = {};
      (H["type"] = P["gUuOs"]),
        (H["payload"] = A),
        window["postMessage"](H, "*");
    }
  }),
  window["addEventListener"](
    "PRIMES::send-message-to-group",
    async function (X) {
      const P = {};
      P["HlqQn"] = "send_message_to_group";
      const B = P;
      try {
        const k = X["detail"]["group_id"],
          J = X["detail"]["message"],
          c = {};
        c["_serialized"] = X["detail"]["group_id"];
        const g = c;
        await window["PRIMES"]["sendMessage"](g, J);
        const K = {};
        K["groupId"] = k;
        const A = {};
        (A["type"] = B["HlqQn"]),
          (A["payload"] = K),
          window["postMessage"](A, "*");
      } catch (H) {
        console["error"](H);
        const F = {};
        (F["groupId"] = groupId), (F["error"] = H);
        const u = {};
        (u["type"] = B["HlqQn"]),
          (u["payload"] = F),
          window["postMessage"](u, "*");
      }
    }
  ),
  window["addEventListener"]("PRIMES::send-attachments-to-group", function (o) {
    const m = {
        xVonu: function (C, X, P) {
          return C(X, P);
        },
      },
      E = o["detail"]["attachments"];
    let z = o["detail"]["caption"];
    const b = o["detail"]["groupId"];
    E["forEach"](async (C, X) => {
      const P = await JSON["parse"](C["data"]),
        B = await m["xVonu"](base64toFile, P, C["name"]);
      await window["PRIMES"]["sendAttachment"](B, b, z[X]);
    });
  }),
  window["addEventListener"]("PRIMES::export-group", function (o) {
    const m = {
      YZklx: "Name",
      lljUk: "data:text/csv;charset=utf-8,",
      bicDS: function (z, b) {
        return z(b);
      },
      RXPIB: "href",
      fHWVn: ".csv",
    };
    let E = o["detail"]["groupId"];
    PRIMES["getGroupMetadata"](E)["then"]((z) => {
      let b = Object["values"](z["participants"]["_index"]),
        C = z["__x_subject"],
        X = [];
      b["forEach"]((J) => {
        let c =
            J["__x_contact"]["__x_name"] ||
            J["__x_contact"]["__x_pushname"] ||
            J["__x_contact"]["__x_shortName"],
          g = J["__x_contact"]["__x_id"]["user"],
          K = "+" + g;
        X["push"]([c, K]);
      }),
        X["sort"](),
        X["unshift"]([m["YZklx"], "Number"]);
      let P = m["lljUk"] + X["map"]((J) => J["join"](","))["join"]("\x0a"),
        B = m["bicDS"](encodeURI, P),
        k = document["createElement"]("a");
      k["setAttribute"](m["RXPIB"], B),
        k["setAttribute"]("download", C + m["fHWVn"]),
        document["body"]["appendChild"](k),
        k["click"]();
    });
  }),
  window["addEventListener"](
    "PRIMES::export-unsaved-contacts",
    async function (E) {
      const z = {};
      (z["RYNIH"] = "Advance"),
        (z["einZn"] = function (K, A) {
          return K < A;
        }),
        (z["JVrBg"] = function (K, A) {
          return K + A;
        }),
        (z["vQGhP"] = "Unknown"),
        (z["ZRjAt"] = "Numbers"),
        (z["ozbpr"] = "Name"),
        (z["Bnxjh"] = function (K, A) {
          return K == A;
        }),
        (z["tVsnO"] = "Expired"),
        (z["PRafD"] =
          "To\x20download\x20all\x20contacts\x20please\x20buy\x20Advance\x20Premium"),
        (z["YtxZi"] = "text/csv;charset=utf-8;"),
        (z["KpdxS"] = "href"),
        (z["xHZSM"] = "Advanced_All_Unsaved_Chats_Export.csv");
      const b = z;
      let C = E["detail"]["type"],
        X = [],
        P = await PRIMES["getMyUnsavedContacts"](),
        B = C == b["RYNIH"] ? P["length"] : 0xa;
      for (let K = 0x0; b["einZn"](K, B); K++) {
        let A = b["JVrBg"]("+", P[K]["user"]),
          H = P[K]["pushname"] || b["vQGhP"];
        X["push"]([A, H]);
      }
      X["unshift"]([b["ZRjAt"], b["ozbpr"]]);
      if (b["Bnxjh"](C, b["tVsnO"])) {
        for (let F = 0x0; b["einZn"](F, 0x3); F++) X["push"]([]);
        X["push"]([b["PRafD"]]);
      }
      let k = X["map"]((u) => u["join"](","))["join"]("\x0a");
      const J = {};
      J["type"] = b["YtxZi"];
      let c = new Blob([k], J),
        g = document["createElement"]("a");
      g["setAttribute"](b["KpdxS"], URL["createObjectURL"](c)),
        g["setAttribute"]("download", b["xHZSM"]),
        document["body"]["appendChild"](g),
        g["click"](),
        document["body"]["removeChild"](g);
    }
  );
const getAllGroups = async function () {
  const E = {};
  E["Ecbpz"] = "get_all_groups";
  const z = E;
  let b = await PRIMES["getAllGroups"]();
  const C = b["map"]((P) => {
      const B = {};
      return (
        (B["id"] = P["attributes"]["id"]),
        (B["name"] = P["attributes"]["formattedTitle"]),
        B
      );
    }),
    X = {};
  return (
    (X["type"] = z["Ecbpz"]),
    (X["payload"] = C),
    window["postMessage"](X, "*"),
    C
  );
};
window["addEventListener"]("PRIMES::get-all-groups", getAllGroups);
const getAllContacts = async function () {
  let m = await PRIMES["getAllContacts"]();
  const E = m["map"]((b) => {
      const C = {};
      return (
        (C["id"] = b["attributes"]["id"]),
        (C["name"] = b["attributes"]["name"]),
        C
      );
    }),
    z = {};
  return (
    (z["type"] = "get_all_contacts"),
    (z["payload"] = E),
    window["postMessage"](z, "*"),
    E
  );
};
window["addEventListener"]("PRIMES::get-all-contacts", getAllContacts);
const getInitStoreType = function () {
    const E = {};
    E["rFFcQ"] = "get_init_store_type";
    const z = E;
    let b = window?.["Store"]?.["InitType"];
    const C = {};
    return (
      (C["type"] = z["rFFcQ"]),
      (C["payload"] = b),
      window["postMessage"](C, "*"),
      b
    );
  },
  checkInjectLoaded = function () {
    const o = {
        YYOGn: function (E) {
          return E();
        },
        oxbNl: function (E, z) {
          return E(z);
        },
        hLeeH: function (E) {
          return E();
        },
        CviTC: function (E) {
          return E();
        },
        sVerZ: function (E) {
          return E();
        },
      },
      m = setInterval(() => {
        if (
          o["YYOGn"](isWhatsappLoaded) &&
          window["Store"] &&
          window["PRIMES"]
        ) {
          const E = "0|2|3|1|4"["split"]("|");
          let z = 0x0;
          while (!![]) {
            switch (E[z++]) {
              case "0":
                o["oxbNl"](clearInterval, m);
                continue;
              case "1":
                o["hLeeH"](getAllContacts);
                continue;
              case "2":
                console["logSuccess"](
                  "InjectJS\x20::\x20Whatsapp\x20Version\x20::\x20" +
                    o["CviTC"](getWhatsappVersion)
                );
                continue;
              case "3":
                o["YYOGn"](getAllGroups);
                continue;
              case "4":
                o["sVerZ"](getInitStoreType);
                continue;
            }
            break;
          }
        }
      }, 0x3e8);
  };
checkInjectLoaded();
