<?php
/**
 * @package embed-sharepoint-onedrive-documents
 * @author miniOrange
 * @link https://plugins.miniorange.com
 */


namespace MoSharePointObjectSync\API;

use MoSharePointObjectSync\Wrappers\pluginConstants;
use MoSharePointObjectSync\Wrappers\sharepointWrapper;
use MoSharePointObjectSync\Wrappers\wpWrapper;
class Azure
{
    private static $obj;
    private $endpoints;
    private $config;
    private $scope = "\150\x74\x74\160\163\72\x2f\x2f\147\x72\x61\x70\x68\56\155\x69\x63\x72\x6f\163\x6f\x66\x74\x2e\143\x6f\x6d\57\56\144\145\146\141\x75\x6c\164";
    private $access_token;
    private $handler;
    private function __construct($QC)
    {
        $this->config = $QC;
        $this->handler = Authorization::getController();
    }
    public static function getClient($QC)
    {
        if (isset(self::$obj)) {
            goto my;
        }
        self::$obj = new Azure($QC);
        self::$obj->setEndpoints();
        my:
        return self::$obj;
    }
    private function setEndpoints()
    {
        $this->endpoints["\147\162\x61\160\150\137\165\163\145\x72\163"] = "\150\164\164\x70\x73\x3a\x2f\57\x67\162\141\160\x68\56\155\151\143\162\157\x73\x6f\146\x74\x2e\143\x6f\155\x2f\x62\x65\x74\141\x2f\165\x73\x65\162\163\57\x3f\x24\163\x65\154\x65\x63\164\75\165\x73\x65\162\x50\x72\x69\x6e\143\x69\160\141\154\x4e\141\x6d\x65\x2c\151\144";
        if ("\163\165\x63\x63\145\163\163" == get_option("\164\x65\x73\x74\x5f\143\157\x6e\156\x65\x63\x74\151\x6f\x6e\x5f\x6d\x61\156\x75\141\x6c\137\163\164\x61\164\165\163")) {
            goto JH;
        }
        $OJ = "\x70\145\x72\163\x6f\156\x61\154" === $this->config["\x63\x6f\x6e\x6e\145\143\164\x6f\x72"] ? "\x61\160\x69\56\x6f\156\145\144\162\x69\x76\145\x2e\x63\x6f\155" : "\147\162\x61\160\150\x2e\x6d\151\x63\x72\x6f\x73\x6f\146\164\56\143\x6f\x6d";
        goto OW;
        JH:
        $OJ = "\x67\162\x61\x70\150\56\x6d\151\143\x72\157\163\x6f\x66\164\x2e\x63\157\x6d";
        OW:
        $OF = isset($this->config["\x74\145\x6e\141\x6e\164\x5f\151\x64"]) ? $this->config["\x74\x65\156\x61\x6e\x74\x5f\x69\x64"] : '';
        $this->endpoints["\x74\x6f\x6b\x65\x6e"] = "\150\164\x74\x70\163\72\x2f\x2f\154\x6f\x67\151\x6e\56\155\x69\143\162\157\x73\x6f\x66\164\157\x6e\x6c\x69\x6e\x65\x2e\x63\157\x6d\57" . $OF . "\x2f\x6f\141\165\x74\150\x32\x2f\x76\x32\56\60\57\164\157\x6b\145\x6e";
        $this->endpoints["\163\160\163\x5f\x63\x6f\x6d\x6d\x6f\x6e\x5f\164\157\x6b\x65\x6e"] = "\x68\164\164\160\x73\72\x2f\x2f\x6c\157\x67\x69\156\56\155\x69\x63\162\x6f\x73\157\x66\164\x6f\x6e\x6c\x69\156\x65\56\x63\x6f\155\57\x63\157\x6d\155\x6f\x6e\x2f\x6f\141\165\x74\x68\62\x2f\x76\62\x2e\60\x2f\x74\157\153\x65\156";
        $this->endpoints["\x73\x69\164\145\x73"] = "\x68\x74\x74\x70\x73\x3a\57\x2f" . $OJ . "\57\166\61\x2e\x30\57\x73\151\x74\x65\x73\77\x73\x65\141\x72\x63\x68\75\x2a\46\x24\163\145\x6c\x65\143\164\x3d\x69\144\54\x64\151\163\160\154\141\171\116\141\x6d\x65\54\154\141\x73\x74\x4d\157\144\151\146\151\x65\144\104\141\164\x65\124\x69\155\x65\x2c\x77\145\x62\x55\162\x6c";
        $this->endpoints["\x64\x65\x66\x61\x75\154\164\137\163\151\164\145"] = "\x68\x74\164\160\x73\72\57\57" . $OJ . "\x2f\x76\x31\x2e\60\x2f\x73\x69\x74\x65\x2f\162\157\157\x74\77\x73\x65\x61\162\143\150\75\52\x26\x24\163\145\154\145\143\x74\x3d\151\x64\x2c\144\x69\x73\160\x6c\141\171\116\141\x6d\x65\x2c\154\141\163\164\x4d\x6f\144\x69\x66\x69\145\144\x44\x61\164\x65\124\151\155\x65\54\167\x65\142\x55\x72\154";
        $this->endpoints["\x64\145\x66\141\x75\154\x74\137\144\162\x69\166\145"] = "\x68\x74\x74\160\x73\x3a\57\57" . $OJ . "\57\166\x31\56\x30\57\x73\x69\164\x65\x73\57\45\163\57\144\x72\151\x76\145";
        $this->endpoints["\x66\x6f\154\144\x65\162\137\151\x74\x65\155\163\x5f\x62\171\x5f\160\141\x74\x68"] = "\x68\164\164\x70\163\72\x2f\x2f" . $OJ . "\57\x76\x31\56\60\x25\163\57\143\x68\151\x6c\144\x72\145\156";
        $this->endpoints["\144\x6f\x77\x6e\154\157\x61\x64\137\x75\162\x6c"] = "\150\164\164\x70\x73\x3a\57\x2f" . $OJ . "\57\166\61\x2e\x30\57\x64\x72\151\166\x65\x73\57\45\163\57\151\164\x65\155\x73\57\45\163";
        $this->endpoints["\x64\162\x69\x76\x65\163"] = "\x68\x74\x74\160\x73\x3a\x2f\x2f" . $OJ . "\x2f\x76\x31\x2e\x30\x2f\x73\151\164\x65\x73\x2f\x25\163\57\x64\x72\x69\166\145\163";
        $this->endpoints["\144\157\143\163"] = "\150\164\x74\x70\x73\x3a\57\57" . $OJ . "\57\166\61\56\60\57\144\x72\151\x76\145\x73\57\x25\163\x2f\x72\x6f\x6f\x74\x2f\x63\x68\151\x6c\144\162\x65\x6e";
        $this->endpoints["\146\157\154\x64\145\162\x5f\151\x74\145\155\x73"] = "\x68\x74\x74\160\163\72\57\x2f" . $OJ . "\57\x76\x31\x2e\60\x2f\x64\162\x69\166\145\163\57\45\163\x2f\x69\x74\x65\x6d\163\x2f\45\x73\57\x63\x68\x69\154\144\162\145\156";
        $this->endpoints["\146\151\154\145\137\164\150\x75\x6d\142\x6e\141\x69\x6c\163"] = "\150\x74\x74\160\163\x3a\x2f\x2f" . $OJ . "\57\166\61\x2e\x30\57\144\162\151\x76\145\x73\x2f\x25\x73\57\151\164\x65\155\x73\57\45\163\x2f\164\x68\165\x6d\142\156\x61\151\154\163";
        $this->endpoints["\x66\151\154\145\x5f\x70\x72\x65\166\x69\x65\167"] = "\x68\164\164\160\163\72\x2f\x2f" . $OJ . "\x2f\x76\61\56\60\x2f\144\162\x69\166\145\x73\57\x25\163\x2f\x69\x74\145\155\163\x2f\45\163\x2f\x70\162\145\x76\151\145\167";
        $this->endpoints["\x73\x65\x61\162\143\150\x5f\144\162\x69\166\145\x69\x74\x65\155\163"] = "\x68\164\x74\x70\x73\x3a\x2f\57\147\x72\141\160\x68\x2e\x6d\151\143\x72\157\x73\157\x66\x74\x2e\x63\x6f\x6d\57\x76\61\56\60\57\144\162\x69\166\145\x73\57\45\x73\57\162\x6f\157\164\57\163\145\141\x72\x63\150\x28\x71\75\x27\45\163\47\51";
        $this->endpoints["\x73\x65\141\162\x63\x68\x5f\x66\x6f\154\x64\x65\162\151\x74\145\155\163"] = "\150\x74\164\160\163\x3a\x2f\57\147\x72\141\x70\x68\x2e\x6d\151\143\x72\x6f\163\157\146\x74\x2e\x63\157\155\57\166\61\x2e\60\x2f\x64\x72\151\166\145\x73\57\45\163\57\151\164\145\x6d\163\x2f\x25\163\57\163\x65\141\x72\x63\x68\50\x71\75\47\x25\x73\47\51";
        $this->endpoints["\163\x65\141\162\143\150\x5f\160\x65\x72\x73\157\x6e\141\154\137\x64\162\151\166\145"] = "\x68\164\x74\160\163\72\57\x2f\141\160\x69\56\157\x6e\x65\x64\162\151\166\145\56\143\x6f\155\x2f\166\61\x2e\60\x2f\144\x72\x69\166\145\x2f\162\157\157\164\x2f\x76\151\x65\167\x2e\163\x65\141\x72\143\x68\77\x71\75\x25\163\46\44\163\145\x6c\145\143\164\75\x6e\x61\x6d\x65\54\163\x69\172\x65\x2c\x77\145\142\x55\162\154\x2c\100\143\x6f\x6e\164\145\156\164\56\144\x6f\167\x6e\x6c\157\x61\x64\125\162\154\x2c\x6c\141\163\164\115\157\144\x69\x66\151\x65\x64\x44\141\x74\145\x54\151\x6d\145\x2c\151\144\46\44\x66\x69\x6c\164\x65\162\75\143\157\156\x74\x61\151\156\163\50\x6e\x61\x6d\145\x2c\x20\47\45\x73\47\x29";
        $this->endpoints["\x73\145\141\x72\143\150\137\x70\x65\x72\163\157\156\141\154\137\146\x6f\x6c\x64\145\162"] = "\x68\x74\164\x70\x73\72\57\57\141\160\151\56\157\x6e\x65\144\x72\151\x76\145\x2e\143\x6f\155\57\166\x31\56\60\x2f\144\162\x69\166\145\163\x2f\x25\x73\57\151\164\x65\155\x73\57\45\x73\57\166\x69\145\x77\x2e\x73\x65\x61\162\x63\x68\77\161\75\x25\x73\x26\44\x73\x65\x6c\x65\143\164\75\x6e\x61\x6d\x65\54\x73\x69\172\145\54\x77\145\x62\125\162\154\x2c\100\x63\x6f\156\x74\145\156\x74\56\144\x6f\x77\x6e\x6c\157\x61\x64\x55\x72\154\54\154\x61\x73\164\115\x6f\x64\151\146\151\x65\144\104\x61\164\x65\124\151\155\x65\54\x69\x64\46\x24\146\151\x6c\164\x65\162\x3d\x63\157\156\164\141\x69\x6e\x73\50\156\x61\155\x65\x2c\x20\47\45\163\x27\51";
        $this->endpoints["\x75\160\x6c\x6f\141\144\x5f\151\164\x65\155\163"] = "\150\x74\x74\160\163\x3a\57\x2f" . $OJ . "\x2f\x76\61\56\x30\x2f\144\x72\151\x76\145\163\x2f\45\x73\x2f\x69\x74\x65\155\x73\x2f\45\163\x3a\x2f\x25\163\72\57\143\x72\x65\141\164\x65\125\160\154\x6f\141\x64\x53\145\163\x73\x69\157\156";
        $this->endpoints["\x64\157\x77\x6e\154\x6f\x61\144\137\151\x74\x65\x6d\163"] = "\x68\x74\164\x70\x73\72\57\x2f" . $OJ . "\57\166\61\x2e\x30\57\x64\x72\151\166\x65\x73\57\45\x73\x2f\x69\164\x65\x6d\163\x2f\45\163\x2f\x63\157\156\x74\x65\156\164";
        $this->endpoints["\146\151\154\x65\137\x69\164\x65\x6d"] = "\150\x74\164\x70\163\x3a\57\x2f" . $OJ . "\x2f\x76\61\x2e\60\x2f\x64\x72\x69\x76\145\x73\x2f\x25\x73\57\151\164\x65\x6d\x73\57\45\x73";
        $this->endpoints["\146\x69\154\x65\137\x70\162\145\x76\x69\x65\x77\137\x6f\x6e\x65\144\x72\151\x76\145"] = "\150\164\x74\160\x73\x3a\57\57" . $OJ . "\57\x76\x31\56\60\57\144\x72\151\166\x65\x73\x2f\x25\163\x2f\x69\x74\145\x6d\x73\57\x25\x73\x2f\143\x6f\156\164\x65\x6e\x74\77\x66\x6f\x72\x6d\x61\x74\75\x25\x73";
        $this->endpoints["\x6c\151\x73\164\163"] = "\x68\x74\x74\160\163\x3a\x2f\x2f" . $OJ . "\57\166\61\x2e\60\57\x73\151\164\x65\163\57\x25\163\57\x6c\151\x73\x74\163";
        $this->endpoints["\154\x69\163\164\x5f\151\164\x65\155\x73"] = "\150\x74\164\x70\x73\x3a\57\57" . $OJ . "\57\166\x31\56\x30\x2f\163\151\x74\145\163\x2f\45\x73\x2f\x6c\x69\163\164\163\57\x25\x73\x3f\145\170\x70\141\x6e\144\75\143\x6f\154\165\x6d\156\163\54\151\164\x65\155\163\x28\x65\170\x70\141\156\x64\x3d\x66\151\x65\154\x64\163\x29";
        $this->endpoints["\x6d\145"] = "\x68\164\x74\160\x73\72\x2f\x2f\147\x72\141\x70\x68\56\155\x69\x63\162\157\163\157\x66\x74\x2e\143\x6f\x6d\57\166\x31\x2e\x30\57\x6d\x65";
        $this->endpoints["\x6f\x6e\x65\x64\x72\151\166\x65\163"] = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\147\162\x61\x70\x68\56\x6d\x69\x63\x72\x6f\x73\157\x66\x74\x2e\143\x6f\155\x2f\166\61\56\x30\57\155\x65\x2f\x64\x72\x69\166\145\x73";
        $this->endpoints["\x73\x70\x73\x5f\x70\x65\162\163\157\156\x61\x6c\137\x6f\156\x65\x64\x72\x69\166\145"] = "\150\164\x74\x70\x73\x3a\57\x2f\154\x6f\147\151\x6e\x2e\x6c\151\166\x65\x2e\x63\x6f\x6d\x2f\x6f\141\165\x74\x68\62\x30\x5f\x74\x6f\x6b\x65\156\x2e\163\162\146";
        $this->endpoints["\x70\x65\162\x73\157\x6e\141\x6c\137\144\x72\x69\x76\x65\163"] = "\x68\x74\164\x70\x73\x3a\57\x2f" . $OJ . "\57\166\x31\56\x30\x2f\144\x72\x69\166\145\163";
    }
    public function mo_sps_send_access_token($FJ)
    {
        if ("\141\165\164\x6f" === $this->config["\x74\171\160\x65"]) {
            goto KQ;
        }
        $Rz = $this->handler->mo_sps_get_access_token_using_client_credentials($this->endpoints, $this->config, $this->scope);
        goto et;
        KQ:
        $Rz = $this->handler->mo_sps_get_access_token_using_authorization_code($this->endpoints, $this->config, $this->scope, $FJ);
        et:
        if (!$Rz["\x73\164\141\164\x75\163"]) {
            goto vV;
        }
        if ($FJ) {
            goto OP;
        }
        $this->access_token = $Rz["\144\141\164\141"]["\141\x63\x63\145\163\163\x5f\164\x6f\x6b\145\x6e"];
        goto cZ;
        OP:
        return $Rz;
        cZ:
        vV:
        if (!$this->access_token) {
            goto im;
        }
        return $this->access_token;
        im:
    }
    public function mo_sps_process_tokens_for_auto_connection()
    {
        $Rz = $this->mo_sps_send_access_token(true);
        if (!empty($Rz)) {
            goto DU;
        }
        return $this->config;
        DU:
        if (!$Rz["\163\164\x61\x74\x75\x73"]) {
            goto H3;
        }
        if (!isset($Rz["\x64\141\164\x61"]["\162\145\x66\x72\145\163\x68\x5f\164\x6f\153\145\x6e"])) {
            goto G9;
        }
        $this->config["\162\x65\146\x72\x65\x73\x68\137\164\x6f\153\145\x6e"] = $Rz["\144\141\x74\x61"]["\x72\x65\x66\x72\145\163\150\x5f\x74\157\153\x65\156"];
        G9:
        if ("\x70\145\x72\x73\157\x6e\x61\x6c" === $this->config["\143\157\156\x6e\x65\143\164\x6f\162"]) {
            goto RA;
        }
        if (isset($Rz["\144\x61\x74\141"]["\141\143\143\145\163\x73\x5f\164\157\153\x65\156"])) {
            goto i4;
        }
        if (isset($Rz["\144\x61\x74\141"])) {
            goto H0;
        }
        goto Vz;
        i4:
        $this->access_token = $Rz["\x64\x61\x74\x61"]["\x61\143\x63\145\x73\x73\x5f\x74\x6f\x6b\x65\x6e"];
        goto Vz;
        H0:
        $this->access_token = $Rz["\144\141\164\x61"];
        Vz:
        $Sj = explode("\x2e", $this->access_token);
        $sG = isset($Sj[1]) ? $Sj[1] : '';
        $Pt = json_decode(base64_decode(str_replace("\137", "\x2f", str_replace("\x2d", "\x2b", $sG))), true);
        update_option("\x6d\x6f\x5f\163\x70\163\137\165\163\x65\x72\x5f\165\x70\x6e\x5f\x61\165\x74\157\155\141\164\x69\143\x5f\x63\x6f\x6e\156\145\x63\x74\x69\x6f\156", $Pt["\165\160\156"]);
        $OD = isset($Pt["\147\x69\x76\145\156\137\x6e\141\x6d\x65"]) ? $Pt["\147\151\166\145\156\137\156\x61\155\145"] : '';
        $yQ = isset($Pt["\146\x61\x6d\151\154\171\x5f\x6e\x61\x6d\145"]) ? $Pt["\x66\x61\x6d\x69\x6c\171\137\156\x61\155\x65"] : '';
        $c_ = $OD . "\40" . $yQ;
        update_option("\155\x6f\x5f\163\160\x73\137\165\163\x65\162\137\x6e\x61\155\x65\137\x61\165\164\x6f\155\141\x74\x69\x63\x5f\x63\157\156\156\x65\143\164\151\157\156", $c_);
        $this->config["\x75\x70\x6e"] = isset($Pt["\x75\x70\156"]) ? $Pt["\165\x70\156"] : '';
        goto vA;
        RA:
        if (!isset($Rz["\x64\x61\164\141"]["\x69\x64\137\x74\157\x6b\145\x6e"])) {
            goto sr;
        }
        $Pt = json_decode(base64_decode(str_replace("\x5f", "\57", str_replace("\55", "\x2b", explode("\56", $Rz["\x64\x61\x74\x61"]["\x69\x64\137\164\157\153\145\156"])[1]))), true);
        update_option("\155\x6f\137\x73\x70\x73\x5f\165\x73\145\x72\137\x65\x6d\141\x69\x6c\x5f\x61\165\x74\157\x6d\141\x74\151\143\x5f\143\x6f\156\x6e\145\143\164\x69\157\156", $Pt["\x65\x6d\x61\151\154"]);
        $this->config["\x75\x70\x6e"] = isset($Pt["\145\155\x61\x69\154"]) ? $Pt["\145\155\141\x69\x6c"] : '';
        sr:
        vA:
        H3:
        return $this->config;
    }
    public function mo_sps_get_all_site_news()
    {
        $dv = explode($this->config["\x61\x64\x6d\x69\x6e\x5f\x75\162\x69"], $this->config["\163\x70\163\x5f\x72\x65\x6c\x61\x74\x69\166\x65\137\x75\x72\151"]);
        if (empty($dv) || empty($dv[1])) {
            goto s3;
        }
        $dv = trailingslashit($dv[1] . '');
        goto PV;
        s3:
        $dv = '';
        PV:
        $K2 = "\150\x74\x74\160\163\x3a\x2f\x2f" . wpWrapper::mo_sps_get_domain_from_url($this->config["\163\160\163\x5f\162\145\154\141\164\x69\x76\x65\137\x75\162\x69"]) . "\x20\57\40\137\141\160\x69\x20\57\40\167\145\x62\40\57\x20\154\151\x73\164\163\x20\x2f\x20\147\x65\164\102\171\124\x69\164\x6c\145\x28\40\x27\123\x69\x74\x65\40\x50\x61\147\145\163\47\40\x29\40\x2f\x20\x69\164\145\155\163\x20\x2f\x20";
        $this->access_token = sanitize_text_field($this->handler->mo_sps_get_access_token_using_client_credentials($this->endpoints, $this->config, $this->scope));
        $rZ = array("\101\165\164\150\157\162\151\x7a\x61\164\151\x6f\x6e" => "\102\x65\x61\162\x65\162\40" . $this->access_token, "\x41\x63\143\145\160\164" => "\141\x70\x70\154\151\x63\x61\164\151\x6f\x6e\57\152\163\x6f\156\73\40\x6f\144\x61\x74\x61\x3d\x76\x65\x72\142\x6f\x73\x65");
        $wK = $this->handler->mo_sps_get_request($K2, $rZ);
        return $wK;
    }
    public function mo_sps_get_all_site_events()
    {
        $dv = explode($this->config["\141\144\x6d\x69\x6e\137\x75\162\151"], $this->config["\x73\160\163\x5f\x72\145\154\x61\x74\151\166\x65\x5f\x75\x72\151"]);
        if (empty($dv) || empty($dv[1])) {
            goto Nd;
        }
        $dv = trailingslashit($dv[1] . '');
        goto ct;
        Nd:
        $dv = '';
        ct:
        $Ev = "\x68\x74\164\160\x73\72\x2f\57" . wpWrapper::mo_sps_get_domain_from_url($this->config["\163\160\163\137\162\x65\x6c\141\164\x69\166\145\137\165\x72\x69"]) . "\40\57\x20\x5f\141\160\151\x20\57\x20\x77\145\x62\x20\57\x20\x6c\151\163\164\x73\x20\x2f\40\x67\145\x74\x42\x79\124\151\x74\154\x65\50\40\47\105\x76\x65\156\x74\163\47\x20\x29\40\x2f\x20\x69\164\x65\x6d\x73";
        $this->access_token = sanitize_text_field($this->handler->mo_sps_get_access_token_using_client_credentials($this->endpoints, $this->config, $this->scope));
        $rZ = array("\x41\x75\x74\x68\157\x72\x69\x7a\x61\164\151\x6f\156" => "\x42\x65\x61\162\x65\162\x20" . $this->access_token, "\101\143\143\145\x70\x74" => "\141\160\160\x6c\151\x63\141\164\151\x6f\156\57\x6a\x73\x6f\x6e\73\40\157\144\x61\x74\x61\x3d\x76\145\162\142\157\x73\145");
        $wK = $this->handler->mo_sps_get_request($Ev, $rZ);
        return $wK;
    }
    public function mo_sps_get_banerurl_for_an_artcile($cb)
    {
        $this->access_token = sanitize_text_field($this->handler->mo_sps_get_access_token_using_client_credentials($this->endpoints, $this->config, $this->scope));
        $rZ = array("\101\x75\x74\x68\x6f\x72\151\172\141\164\x69\x6f\x6e" => "\102\145\x61\x72\x65\x72\40" . $this->access_token);
        $wK = $this->handler->mo_sps_get_media_request($cb, $rZ);
        return $wK;
    }
    public function mo_sps_get_specific_user_detail()
    {
        $dv = explode($this->config["\x61\144\155\151\x6e\137\x75\162\x69"], $this->config["\163\160\x73\x5f\x72\145\154\141\x74\x69\166\x65\137\165\x72\x69"]);
        if (empty($dv) || empty($dv[1])) {
            goto Ot;
        }
        $dv = trailingslashit($dv[1] . '');
        goto LP;
        Ot:
        $dv = '';
        LP:
        $wh = "\150\164\164\x70\163\x3a\57\x2f" . wpWrapper::mo_sps_get_domain_from_url($this->config["\x73\160\x73\137\162\145\x6c\141\164\x69\x76\x65\137\165\x72\151"]) . "\40\57\40\137\141\x70\151\x20\x2f\x20\167\x65\142\x20\x2f\x20\x47\x65\164\x46\x6f\x6c\x64\145\162\x42\x79\123\x65\x72\166\145\162\122\x65\154\141\x74\151\x76\145\125\x72\154\x28\40\x27\57" . $dv . "\47\x20\51\x20\x2f\40\x3f\x20\44\145\170\x70\x61\156\144\40\x3d\x20\106\x6f\x6c\x64\145\162\163\x2c\x46\151\154\145\x73";
        $this->access_token = sanitize_text_field($this->handler->mo_sps_get_access_token_using_client_credentials($this->endpoints, $this->config, $this->scope));
        $rZ = array("\x41\x75\x74\150\157\162\x69\x7a\x61\x74\x69\157\156" => "\x42\x65\141\162\145\x72\x20" . $this->access_token, "\101\143\143\x65\160\x74" => "\x61\x70\x70\154\x69\143\x61\164\151\157\x6e\x2f\x6a\x73\x6f\156\73\40\x6f\144\x61\164\x61\x3d\166\145\x72\x62\x6f\163\145");
        $wK = $this->handler->mo_sps_get_request($wh, $rZ);
        return $wK;
    }
    public function mo_sps_sync_doc_media_lib()
    {
        $oW = $this->mo_sps_get_new_access_token();
        if ($oW) {
            goto vX;
        }
        return $this->access_token;
        vX:
        $S5 = wpWrapper::mo_sps_get_option("\x6d\x6f\137\163\x70\x73\137\x67\145\x74\137\x73\145\x6c\145\143\164\145\x64\137\144\162\151\x76\x65");
        $S5 = !empty($S5["\x64\x72\151\x76\145\137\151\x64"]) ? $S5["\x64\x72\151\166\x65\x5f\151\144"] : '';
        $rZ = array("\x41\x75\x74\150\157\162\x69\x7a\141\x74\x69\157\156" => "\102\145\x61\x72\x65\162\x20" . $oW, "\x43\157\156\x74\145\156\164\55\x74\x79\160\145" => "\141\160\x70\x6c\x69\143\x61\x74\x69\x6f\156\57\152\x73\157\156");
        $Rz = $this->handler->mo_sps_get_media_request(sprintf($this->endpoints["\144\x6f\x63\163"], $S5), $rZ);
        $Rz = json_decode($Rz["\x64\141\164\141"], true);
        $V7 = $Rz["\x76\x61\x6c\165\x65"];
        foreach ($V7 as $TC) {
            if (isset($TC["\146\157\154\x64\145\x72"])) {
                goto nX;
            }
            if (isset($TC["\146\151\x6c\x65"])) {
                goto sh;
            }
            goto Sx;
            nX:
            wp_schedule_single_event(time(), "\x6d\x6f\137\163\x70\163\x5f\x66\x6f\154\x64\145\162\137\163\x79\156\x63\x5f\x61\143\164\151\157\x6e", array("\x66\x6f\x6c\x64\145\162\x5f\x69\144" => $TC["\151\144"]));
            goto Sx;
            sh:
            $Lf = wp_upload_dir();
            $qC = $Lf["\160\x61\x74\x68"];
            $dT = $Lf["\x75\x72\x6c"];
            $ok = $TC["\156\x61\x6d\x65"];
            $D0 = pathinfo($TC["\x6e\x61\155\145"], PATHINFO_EXTENSION);
            $mJ = basename($TC["\156\141\155\x65"], "\56" . $D0);
            $j9 = pluginConstants::MIME_TYPES;
            $LG = admin_url("\x61\144\155\151\x6e\x2d\x61\x6a\141\x78\56\x70\x68\x70") . "\77\x61\143\x74\x69\157\156\x3d\155\157\137\163\x70\x73\x5f\144\x6f\x77\156\154\157\141\x64\137\146\151\x6c\x65\46\146\x69\154\145\137\151\x64\x3d" . $TC["\x69\x64"] . "\x26\144\162\151\x76\x65\x5f\151\144\75" . $TC["\x70\141\x72\x65\156\164\x52\145\146\x65\162\x65\x6e\x63\x65"]["\x64\162\151\166\145\x49\144"];
            $cq = $qC . "\x2f" . $ok;
            $Xy = $this->mo_sps_post_exists_already($TC["\x69\x64"]);
            if ($Xy) {
                goto oN;
            }
            $this->mp_sps_insert_in_media_library($dT, $ok, $mJ, $j9, $D0, $LG, $cq, $TC["\151\x64"]);
            goto jr;
            oN:
            $TQ = get_post_thumbnail_id($Xy);
            $mM = array("\160\x6f\163\164\137\164\x69\164\x6c\x65" => $mJ, "\x70\x6f\x73\164\137\163\164\x61\164\x75\163" => "\151\156\x68\145\x72\151\164", "\160\157\163\x74\x5f\x6d\151\155\x65\137\x74\x79\x70\145" => isset($j9[strtolower($D0)]) ? $j9[strtolower($D0)] : '', "\155\x65\x74\141\137\x69\156\x70\x75\164" => array("\x6d\157\137\x73\x70\x73\137\146\151\154\x65\137\x75\x72\154" => $LG, "\155\x6f\x5f\x73\160\163\137\146\151\154\x65\137\151\x64" => $TC["\151\144"]));
            $bU = get_attached_file($Xy);
            $g8 = pathinfo($bU);
            $V_ = $g8["\144\151\x72\156\x61\x6d\x65"] . "\57" . $TC["\156\141\155\x65"];
            update_attached_file($Xy, $V_);
            update_post_meta($Xy, "\x5f\167\x70\x5f\x61\164\164\x61\143\x68\155\145\156\x74\x5f\146\x69\154\145\x5f\165\x72\154\163", $LG);
            $An = array("\x49\x44" => $Xy, "\160\157\163\x74\x5f\x74\151\164\x6c\145" => $mJ, "\x70\157\163\164\137\x73\164\x61\164\165\163" => "\x69\x6e\x68\145\162\x69\164", "\x70\x6f\x73\x74\x5f\155\151\x6d\x65\x5f\x74\x79\x70\145" => $j9[strtolower($D0)]);
            wp_update_post($An);
            update_post_meta($Xy, "\137\167\x70\x5f\141\x74\164\x61\143\x68\x6d\x65\156\x74\x5f\146\151\x6c\x65\137\165\162\x6c\163", $LG);
            foreach ($mM["\x6d\x65\164\141\137\x69\156\x70\165\x74"] as $JH => $Ox) {
                update_post_meta($Xy, $JH, $Ox);
                mb:
            }
            jt:
            jr:
            Sx:
            F8:
        }
        rk:
    }
    public function mo_sps_sync_folder_files_in_media($Vb)
    {
        $oW = $this->mo_sps_get_new_access_token();
        if ($oW) {
            goto ft;
        }
        return $this->access_token;
        ft:
        $S5 = wpWrapper::mo_sps_get_option("\155\x6f\137\163\x70\163\137\147\x65\164\x5f\x73\145\x6c\145\143\164\145\144\x5f\144\x72\x69\x76\145");
        $S5 = !empty($S5["\144\162\x69\x76\x65\x5f\x69\144"]) ? $S5["\x64\162\151\166\x65\x5f\x69\x64"] : '';
        $rZ = array("\101\x75\164\150\157\162\x69\x7a\x61\x74\x69\x6f\x6e" => "\x42\x65\x61\x72\145\x72\x20" . $oW, "\x43\157\156\x74\x65\x6e\164\x2d\164\x79\x70\x65" => "\141\x70\x70\154\x69\143\141\164\x69\x6f\156\57\152\163\157\156");
        $Rz = $this->handler->mo_sps_get_media_request(sprintf($this->endpoints["\146\157\154\144\x65\x72\137\151\x74\145\x6d\163"], $S5, $Vb), $rZ);
        $Rz = json_decode($Rz["\144\x61\x74\141"], true);
        $V7 = $Rz["\166\141\154\165\x65"];
        foreach ($V7 as $TC) {
            if (isset($TC["\146\157\x6c\144\x65\x72"]) && isset($TC["\146\157\x6c\x64\145\x72"]["\x63\x68\151\154\144\103\157\x75\x6e\x74"]) && $TC["\x66\157\154\x64\x65\x72"]["\x63\150\x69\154\x64\103\x6f\x75\x6e\164"]) {
                goto J5;
            }
            if (isset($TC["\146\x69\x6c\145"])) {
                goto N0;
            }
            goto CY;
            J5:
            wp_schedule_single_event(time(), "\x6d\157\x5f\x73\x70\x73\137\146\157\x6c\144\145\162\137\x73\171\156\143\x5f\x61\143\x74\x69\x6f\156", array("\x66\x6f\154\x64\145\162\137\x69\x64" => $TC["\x69\x64"]));
            goto CY;
            N0:
            $Lf = wp_upload_dir();
            $qC = $Lf["\160\x61\164\150"];
            $dT = $Lf["\x75\162\154"];
            $ok = $TC["\156\x61\x6d\145"];
            $D0 = pathinfo($TC["\156\x61\155\x65"], PATHINFO_EXTENSION);
            $mJ = basename($TC["\156\141\155\x65"], "\x2e" . $D0);
            $j9 = pluginConstants::MIME_TYPES;
            $LG = admin_url("\x61\x64\x6d\x69\156\55\141\152\141\170\56\x70\x68\x70") . "\x3f\x61\x63\164\151\x6f\156\75\155\x6f\x5f\163\160\163\137\144\x6f\x77\x6e\154\x6f\x61\x64\x5f\146\151\x6c\x65\46\x66\x69\x6c\x65\x5f\151\x64\x3d" . $TC["\151\144"] . "\46\x64\162\151\166\145\x5f\151\144\75" . $TC["\x70\141\x72\x65\x6e\164\122\145\x66\145\162\145\156\x63\x65"]["\144\x72\151\166\145\x49\x64"];
            $cq = $qC . "\57" . $ok;
            $Xy = $this->mo_sps_post_exists_already($TC["\x69\x64"]);
            if ($Xy) {
                goto RX;
            }
            $this->mp_sps_insert_in_media_library($dT, $ok, $mJ, $j9, $D0, $LG, $cq, $TC["\151\x64"]);
            goto Ke;
            RX:
            $TQ = get_post_thumbnail_id($Xy);
            $mM = array("\160\157\x73\x74\x5f\x74\x69\164\x6c\x65" => $mJ, "\160\x6f\163\164\x5f\x73\x74\141\164\x75\x73" => "\x69\156\x68\x65\x72\151\164", "\x70\157\163\x74\x5f\155\151\x6d\145\137\x74\171\160\145" => isset($j9[strtolower($D0)]) ? $j9[strtolower($D0)] : '', "\x6d\145\164\x61\137\x69\156\x70\165\164" => array("\155\157\137\x73\160\x73\x5f\x66\151\154\145\x5f\165\x72\x6c" => $LG, "\155\x6f\x5f\163\160\163\137\146\x69\x6c\x65\137\151\x64" => $TC["\x69\x64"]));
            $bU = get_attached_file($Xy);
            $g8 = pathinfo($bU);
            $V_ = $g8["\x64\151\x72\156\141\155\x65"] . "\x2f" . $TC["\156\141\155\x65"];
            update_attached_file($Xy, $V_);
            update_post_meta($Xy, "\x5f\167\160\137\x61\164\164\x61\143\x68\x6d\145\156\x74\x5f\x66\x69\154\x65\137\x75\162\154\x73", $LG);
            $An = array("\x49\x44" => $Xy, "\x70\157\x73\164\137\164\x69\164\x6c\145" => $mJ, "\x70\157\x73\x74\137\163\x74\x61\x74\165\x73" => "\x69\156\150\145\x72\x69\x74", "\160\x6f\163\x74\137\x6d\151\x6d\x65\137\164\171\160\145" => $j9[strtolower($D0)]);
            wp_update_post($An);
            update_post_meta($Xy, "\137\x77\x70\137\x61\x74\x74\141\x63\150\155\x65\x6e\x74\137\146\151\x6c\x65\x5f\x75\x72\x6c\x73", $LG);
            foreach ($mM["\x6d\x65\x74\x61\137\x69\156\x70\x75\164"] as $JH => $Ox) {
                update_post_meta($Xy, $JH, $Ox);
                c6:
            }
            tG:
            Ke:
            CY:
            Hf:
        }
        zo:
    }
    public function mp_sps_insert_in_media_library($dT, $ok, $mJ, $j9, $D0, $LG, $cq, $v1)
    {
        $TQ = wp_insert_attachment(array("\x67\165\151\144" => $dT . "\x2f" . $ok, "\x70\x6f\x73\x74\x5f\164\x69\164\154\x65" => $mJ, "\x70\157\163\164\x5f\163\164\141\164\165\163" => "\x69\x6e\x68\145\162\151\x74", "\x70\157\x73\164\x5f\155\151\x6d\145\137\x74\171\160\145" => isset($j9[strtolower($D0)]) ? $j9[strtolower($D0)] : '', "\155\145\x74\x61\137\151\156\x70\165\164" => array("\x6d\x6f\137\163\160\x73\x5f\x66\x69\154\145\x5f\x75\x72\x6c" => $LG, "\x6d\x6f\x5f\163\160\163\137\x66\x69\x6c\145\137\151\144" => $v1)), $cq);
        update_post_meta($TQ, "\137\x77\160\x5f\x61\x74\x74\141\143\150\155\145\156\164\x5f\x66\151\x6c\x65\137\x75\162\x6c\163", $LG);
        return $TQ;
    }
    public function mo_sps_post_exists_already($Ox)
    {
        $JH = "\155\x6f\137\x73\160\163\137\x66\x69\x6c\145\x5f\x69\x64";
        $rZ = array("\x70\157\x73\164\x5f\164\x79\x70\145" => "\141\164\164\141\143\x68\x6d\x65\x6e\164", "\155\x65\164\141\x5f\x6b\x65\171" => $JH, "\155\x65\x74\x61\137\x76\141\154\x75\145" => $Ox, "\160\157\163\x74\x73\137\160\145\x72\x5f\160\141\147\x65" => 1);
        $pF = get_posts($rZ);
        if (!empty($pF)) {
            goto v4;
        }
        return false;
        goto E3;
        v4:
        $Xy = $pF[0]->ID;
        return $Xy;
        E3:
    }
    public function mo_sps_get_new_access_token()
    {
        $oW = wpWrapper::mo_sps_get_option(pluginConstants::MOPKEWSFATT);
        if (!($oW && isset($oW["\x65\x78\160\x69\162\x79"]) && isset($oW["\x63\x75\162\x72\x65\156\x74\137\164\x69\x6d\145"]) && $oW["\x65\170\x70\151\x72\171"] > time() - $oW["\143\165\162\x72\x65\156\x74\x5f\x74\151\155\145"])) {
            goto e3;
        }
        return $oW["\x64\x61\164\141"];
        e3:
        if ("\155\141\156\165\x61\x6c" === $this->config["\x74\x79\x70\145"]) {
            goto up;
        }
        $Rz = $this->handler->mo_sps_get_access_token_using_authorization_code($this->endpoints, $this->config, $this->scope);
        goto l7;
        up:
        $Rz = $this->handler->mo_sps_get_access_token_using_client_credentials($this->endpoints, $this->config, $this->scope);
        l7:
        $this->access_token = $Rz;
        if (!$Rz["\163\164\x61\x74\x75\x73"]) {
            goto q4;
        }
        $m4 = array("\144\141\x74\141" => $this->access_token["\144\141\x74\141"]["\141\x63\x63\x65\163\163\x5f\164\x6f\153\145\x6e"], "\145\170\160\151\162\x79" => $this->access_token["\x64\141\164\141"]["\x65\170\160\151\x72\x79"], "\x63\165\x72\162\x65\156\164\137\x74\151\155\145" => time());
        wpWrapper::mo_sps_set_option(pluginConstants::MOPKEWSFATT, $m4);
        $rZ = array("\x41\x75\x74\x68\157\x72\x69\x7a\141\x74\x69\157\156" => "\x42\x65\x61\x72\145\162\40" . $this->access_token["\x64\x61\164\x61"]["\x61\143\x63\145\x73\163\x5f\x74\x6f\x6b\x65\x6e"]);
        return $this->access_token["\144\x61\164\x61"]["\141\x63\x63\x65\163\x73\137\x74\x6f\x6b\x65\x6e"];
        q4:
        return false;
    }
    public function mo_sps_get_file_download_url($v1, $hn)
    {
        $oW = $this->mo_sps_get_new_access_token();
        if ($oW) {
            goto QR;
        }
        return $this->access_token;
        QR:
        $rZ = array("\101\x75\164\x68\x6f\162\x69\172\x61\x74\x69\157\x6e" => "\x42\x65\141\x72\145\x72\x20" . $oW);
        $Rz = $this->handler->mo_sps_get_request(sprintf($this->endpoints["\x66\x69\154\x65\x5f\x69\x74\145\155"], $hn, $v1), $rZ);
        $KY = array();
        if (!$Rz["\x73\164\141\x74\x75\x73"]) {
            goto Xw;
        }
        $Rz = $Rz["\144\141\x74\x61"];
        $KY["\x64\157\x77\156\x6c\157\x61\144\x5f\165\162\x6c"] = isset($Rz["\100\x6d\x69\143\x72\157\163\x6f\x66\x74\56\x67\162\141\x70\x68\56\144\x6f\x77\x6e\x6c\157\x61\x64\x55\x72\154"]) ? $Rz["\100\155\x69\x63\x72\157\163\x6f\x66\x74\56\147\x72\x61\x70\150\56\x64\157\x77\x6e\x6c\157\x61\x64\x55\x72\154"] : (isset($Rz["\x40\143\x6f\156\164\145\x6e\164\x2e\x64\x6f\x77\156\x6c\157\141\144\x55\162\x6c"]) ? $Rz["\100\x63\157\156\x74\x65\x6e\164\56\144\157\x77\156\154\157\141\x64\x55\x72\x6c"] : '');
        $KY["\146\x69\154\145\137\x74\171\160\145"] = $Rz["\146\x69\154\145"]["\155\x69\x6d\x65\124\171\x70\x65"];
        $KY["\156\x61\155\145"] = $Rz["\156\141\x6d\145"];
        $KY["\163\151\172\145"] = $Rz["\x73\151\172\145"];
        Xw:
        return $KY;
    }
    public function mo_sps_preview_for_onedrive_files($v1, $hn, $KB)
    {
        $oW = $this->mo_sps_get_new_access_token();
        if ($oW) {
            goto fG;
        }
        return $this->access_token;
        fG:
        $rZ = array("\101\x75\164\x68\157\162\x69\172\x61\x74\x69\157\x6e" => "\x42\x65\141\162\145\x72\40" . $oW);
        $Rz = $this->handler->mo_sps_get_media_request_response(sprintf($this->endpoints["\x66\151\x6c\x65\x5f\160\162\x65\x76\151\x65\x77\x5f\157\156\x65\144\162\151\x76\145"], $hn, $v1, $KB), $rZ);
        return $Rz;
    }
    public function mo_sps_get_all_sites()
    {
        $oW = $this->mo_sps_get_new_access_token();
        $KZ = wpWrapper::mo_sps_get_option(pluginConstants::APP_CONFIG);
        if ($oW) {
            goto mn;
        }
        return $this->access_token;
        mn:
        $rZ = array("\x41\165\164\150\x6f\x72\151\172\x61\x74\x69\157\x6e" => "\102\145\141\x72\145\x72\x20" . $oW);
        if (!empty($KZ["\x73\x69\x74\x65\x5f\x75\x72\x6c"]) && "\155\x61\156\165\x61\x6c" === $this->config["\x74\171\160\145"]) {
            goto GK;
        }
        $Cn = $this->endpoints["\163\x69\x74\145\163"];
        goto Bh;
        GK:
        $Cn = $KZ["\x73\x69\x74\145\137\165\x72\x6c"];
        $aQ = parse_url($Cn);
        $Yj = explode("\57", $aQ["\x68\157\x73\164"]);
        if (isset($aQ["\x70\141\x74\150"])) {
            goto bL;
        }
        $y9 = "\150\164\x74\160\163\72\x2f\57\x67\162\141\x70\x68\x2e\155\151\x63\162\157\163\157\146\164\x2e\x63\157\x6d\57\x76\61\56\x30\x2f\163\x69\164\x65\163\x2f" . $aQ["\150\x6f\163\x74"] . "\x3a\77\163\145\141\x72\143\x68\75\52\x26\44\x73\145\154\145\143\164\75\151\144\x2c\144\x69\163\160\154\x61\171\x4e\x61\155\x65\54\x77\x65\142\125\x72\x6c\54\x6c\x61\x73\x74\x4d\x6f\144\x69\146\x69\145\144\104\141\164\145\x54\151\x6d\x65";
        goto VQ;
        bL:
        $y9 = "\150\164\164\160\x73\72\57\x2f\x67\x72\x61\x70\150\56\155\151\x63\x72\157\x73\157\146\164\56\143\157\x6d\x2f\166\61\56\x30\57\x73\151\x74\145\163\57" . $aQ["\x68\157\x73\x74"] . "\72" . $aQ["\x70\x61\164\150"] . "\77\163\145\x61\x72\143\150\x3d\52\x26\44\x73\x65\154\x65\x63\x74\75\151\x64\54\x64\x69\x73\160\154\141\x79\116\141\x6d\x65\x2c\167\145\x62\x55\x72\154\x2c\x6c\141\x73\x74\115\157\144\x69\146\151\145\144\104\x61\164\x65\x54\151\155\x65";
        VQ:
        $Cn = $y9;
        Bh:
        $Rz = $this->handler->mo_sps_get_request($Cn, $rZ);
        return $Rz;
    }
    public function mo_sps_get_all_drives($k_)
    {
        $oW = $this->mo_sps_get_new_access_token();
        if ($oW) {
            goto bl;
        }
        return $this->access_token;
        bl:
        $rZ = array("\x41\x75\x74\x68\157\162\x69\172\141\164\151\157\156" => "\102\x65\141\x72\x65\162\40" . $oW);
        $Rz = $this->handler->mo_sps_get_request(sprintf($this->endpoints["\144\162\151\166\x65\163"], $k_), $rZ);
        return $Rz;
    }
    public function mo_sps_get_personal_onedrives()
    {
        $oW = $this->mo_sps_get_new_access_token();
        if ($oW) {
            goto HR;
        }
        return $this->access_token;
        HR:
        $rZ = array("\x41\x75\164\x68\157\x72\x69\172\141\x74\x69\x6f\x6e" => "\x42\145\x61\x72\145\162\x20" . $oW);
        $Rz = $this->handler->mo_sps_get_request(sprintf($this->endpoints["\160\145\162\x73\157\x6e\x61\x6c\x5f\144\162\x69\x76\x65\x73"]), $rZ);
        return $Rz;
    }
    public function mo_sps_get_all_lists($k_)
    {
        $oW = $this->mo_sps_get_new_access_token();
        if ($oW) {
            goto iz;
        }
        return $this->access_token;
        iz:
        $rZ = array("\x41\x75\x74\x68\157\x72\151\172\141\164\x69\157\156" => "\102\145\x61\x72\x65\x72\x20" . $oW);
        $Rz = $this->handler->mo_sps_get_request(sprintf($this->endpoints["\154\x69\163\164\163"], $k_), $rZ);
        return $Rz;
    }
    public function mo_sps_get_all_personal_drives($Ry)
    {
        $oW = $this->mo_sps_get_new_access_token();
        if ($oW) {
            goto Ky;
        }
        return $this->access_token;
        Ky:
        $rZ = array("\x41\165\164\x68\x6f\x72\151\x7a\141\164\151\157\156" => "\x42\145\x61\162\145\x72\40" . $oW);
        $Rz = $this->handler->mo_sps_get_request(sprintf($this->endpoints["\160\x65\162\x73\157\156\141\x6c\137\144\162\151\x76\145\x73"], $Ry), $rZ);
        return $Rz;
    }
    public function mo_sps_get_all_docs($hn)
    {
        $oW = $this->mo_sps_get_new_access_token();
        if ($oW) {
            goto cL;
        }
        return $this->access_token;
        cL:
        $rZ = array("\x41\165\164\150\x6f\162\151\172\x61\164\x69\x6f\156" => "\x42\x65\x61\162\x65\x72\40" . $oW);
        $Rz = $this->handler->mo_sps_get_request(sprintf($this->endpoints["\x64\x6f\143\163"], $hn), $rZ);
        return $Rz;
    }
    public function mo_sps_get_all_list_items($k_, $hn)
    {
        $oW = $this->mo_sps_get_new_access_token();
        if ($oW) {
            goto xo;
        }
        return $this->access_token;
        xo:
        $rZ = array("\101\x75\164\150\x6f\x72\x69\172\x61\164\151\157\156" => "\x42\x65\141\x72\145\x72\40" . $oW);
        $Rz = $this->handler->mo_sps_get_request(sprintf($this->endpoints["\154\151\163\x74\x5f\x69\x74\x65\155\x73"], $k_, $hn), $rZ);
        return $Rz;
    }
    public function mo_sps_get_all_folder_items($hn, $Vb)
    {
        $oW = $this->mo_sps_get_new_access_token();
        if ($oW) {
            goto Ue;
        }
        return $this->access_token;
        Ue:
        $rZ = array("\x41\165\164\x68\x6f\162\x69\172\141\x74\x69\x6f\x6e" => "\102\x65\141\x72\x65\162\40" . $oW);
        $Rz = $this->handler->mo_sps_get_request(sprintf($this->endpoints["\x66\x6f\154\x64\145\162\137\x69\x74\x65\x6d\163"], $hn, $Vb), $rZ);
        return $Rz;
    }
    public function mo_sps_get_file_thumbnails($hn, $v1)
    {
        $oW = $this->mo_sps_get_new_access_token();
        if ($oW) {
            goto gg;
        }
        return $this->access_token;
        gg:
        $rZ = array("\x41\165\164\x68\x6f\162\151\x7a\x61\x74\151\x6f\156" => "\102\145\141\x72\x65\162\40" . $oW);
        $Rz = $this->handler->mo_sps_get_request(sprintf($this->endpoints["\146\151\154\x65\x5f\x74\x68\165\155\x62\x6e\141\151\x6c\x73"], $hn, $v1), $rZ);
        return $Rz;
    }
    public function mo_sps_get_file_details($hn, $v1)
    {
        $oW = $this->mo_sps_get_new_access_token();
        if ($oW) {
            goto Qm;
        }
        return $this->access_token;
        Qm:
        $rZ = array("\x41\165\164\150\157\x72\x69\x7a\141\164\x69\157\156" => "\102\145\x61\162\145\x72\x20" . $oW);
        $Rz = $this->handler->mo_sps_get_request(sprintf($this->endpoints["\146\151\154\145\x5f\x69\164\x65\x6d"], $hn, $v1), $rZ, array());
        return $Rz;
    }
    public function mo_sps_get_file_preview($hn, $v1)
    {
        $oW = $this->mo_sps_get_new_access_token();
        if ($oW) {
            goto Cd;
        }
        return $this->access_token;
        Cd:
        $rZ = array("\101\165\164\x68\x6f\162\x69\172\141\x74\x69\x6f\x6e" => "\x42\145\141\162\145\x72\40" . $oW);
        $Rz = $this->handler->mo_sps_post_request(sprintf($this->endpoints["\146\151\154\145\137\160\162\145\x76\151\x65\167"], $hn, $v1), $rZ, array());
        return $Rz;
    }
    public function mo_sps_get_download_content($hn, $v1)
    {
        $oW = $this->mo_sps_get_new_access_token();
        if ($oW) {
            goto wM;
        }
        return $this->access_token;
        wM:
        $rZ = array("\x41\x75\x74\150\x6f\162\151\x7a\x61\164\151\x6f\x6e" => "\102\x65\141\x72\x65\162\x20" . $oW);
        $Rz = $this->handler->mo_sps_get_request_for_url(sprintf($this->endpoints["\x64\157\x77\x6e\x6c\157\x61\144\137\151\164\x65\x6d\163"], $hn, $v1), $rZ);
        return $Rz;
    }
    public function mo_sps_search_through_drive_items($hn, $Vb, $MF)
    {
        $oW = $this->mo_sps_get_new_access_token();
        if ($oW) {
            goto B5;
        }
        return $this->access_token;
        B5:
        $rZ = array("\x41\x75\x74\x68\157\162\151\x7a\x61\164\151\x6f\x6e" => "\102\145\x61\162\145\x72\x20" . $oW);
        if ('' === $Vb) {
            goto sM;
        }
        if ("\x70\145\162\163\x6f\156\x61\154" === $this->config["\143\x6f\x6e\156\x65\143\164\x6f\162"]) {
            goto cm;
        }
        $Rz = $this->handler->mo_sps_get_request(sprintf($this->endpoints["\163\x65\141\162\x63\150\x5f\146\x6f\x6c\144\x65\162\151\164\145\x6d\x73"], $hn, $Vb, $MF), $rZ);
        goto q6;
        cm:
        $Rz = $this->handler->mo_sps_get_request(sprintf($this->endpoints["\163\x65\x61\162\x63\150\137\x66\157\154\144\145\162\x69\164\x65\x6d\163"], $hn, $Vb, $MF, $MF), $rZ);
        q6:
        $Rz = $this->handler->mo_sps_get_request(sprintf($this->endpoints["\x73\x65\x61\162\143\150\x5f\146\157\154\x64\145\162\x69\x74\x65\155\163"], $hn, $Vb, $MF), $rZ);
        goto EE;
        sM:
        if ("\160\x65\162\163\157\156\x61\x6c" === $this->config["\x63\x6f\156\x6e\x65\x63\164\157\162"]) {
            goto P0;
        }
        $Rz = $this->handler->mo_sps_get_request(sprintf($this->endpoints["\163\x65\141\162\x63\x68\137\144\162\x69\166\x65\x69\x74\145\155\163"], $hn, $MF), $rZ);
        goto TP;
        P0:
        $Rz = $this->handler->mo_sps_get_request(sprintf($this->endpoints["\163\x65\141\x72\143\150\x5f\160\x65\x72\163\x6f\x6e\141\x6c\x5f\144\162\x69\166\145"], $MF, $MF), $rZ);
        TP:
        EE:
        return $Rz;
    }
    public function mo_sps_get_upload_session($hn, $Vb, $ok)
    {
        $oW = $this->mo_sps_get_new_access_token();
        if ($oW) {
            goto iS;
        }
        return $this->access_token;
        iS:
        $rZ = array("\x41\x75\x74\150\157\x72\151\x7a\141\x74\x69\157\x6e" => "\102\145\x61\162\x65\x72\x20" . $oW, "\103\x6f\x6e\164\145\x6e\x74\55\124\171\x70\x65" => "\x61\x70\x70\154\151\x63\x61\x74\151\157\x6e\57\x78\55\167\x77\167\55\146\157\x72\x6d\x2d\x75\162\154\145\x6e\x63\157\x64\145\144");
        $Vb = $Vb == '' ? "\x72\157\x6f\164" : $Vb;
        $Rz = $this->handler->mo_sps_post_request(sprintf($this->endpoints["\165\160\154\157\x61\144\x5f\x69\x74\145\x6d\163"], $hn, $Vb, $ok), $rZ, '');
        return $Rz;
    }
    public function mo_sps_get_onedrives()
    {
        $oW = $this->mo_sps_get_new_access_token();
        if ($oW) {
            goto Nc;
        }
        return $this->access_token;
        Nc:
        $rZ = array("\101\x75\x74\x68\157\162\151\x7a\x61\x74\x69\157\x6e" => "\102\x65\x61\162\145\162\x20" . $oW);
        $Rz = $this->handler->mo_sps_get_request(sprintf($this->endpoints["\x6f\156\x65\x64\x72\x69\166\145\163"]), $rZ);
        return $Rz;
    }
    public function mo_sps_get_my_user()
    {
        $oW = $this->mo_sps_get_new_access_token();
        if ($oW) {
            goto LI;
        }
        return $this->access_token;
        LI:
        $rZ = array("\x41\165\164\x68\157\162\x69\x7a\141\164\151\x6f\x6e" => "\102\x65\x61\162\x65\x72\x20" . $oW);
        $Rz = $this->handler->mo_sps_get_request(sprintf($this->endpoints["\x6d\x65"]), $rZ);
        return $Rz;
    }
}
