<?php
namespace Claromentis\Pages\Stat;

$GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"] = (@$GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"] ?: array()) + array("_0c5123aa744f69bbc0e8b3ea2f" . "6e847d" => base64_decode("bG1" . "zZw" . "=="), "_5a8b1c5e7f1cc4976c0" . "a2b564211cc54" => base64_decode("cGFnZXMvc3RhdC9tYWluLmh0bW" . "w="), "_46ebe283f" . "49f1244961" . "72f97bfe53" . "b50" => base64_decode("cGFnZXMuc3RhdF9wbHVnaW4uYXZlcmFnZV92aWV3cw=" . "="), "_b92b5ed2edaf18b8e" . "ec721c1422e34ee" => base64_decode("cm91b" . "mQ="), "_81639498a0f" . "836244c7c48f" . "a513a9247" => base64_decode("cGFnZXMuc3RhdF9wbHVnaW" . "4ubmFtZQ=="), "_e0fa173dc2c2bd2ab21f703726682c" . "f1" => base64_decode("dmlld19h" . "c19ob21l"), "_4d707fab93bebb00bbe6" . "9e8159697c90" => base64_decode(""), "_f3c01efbec4e342" . "80b394d427cacd62" . "c" => base64_decode("dmlld3NfY2hhc" . "nQuYm9keV9odG" . "1s"), "_fb97865c9584c8026ea64aebe0463" . "065" => base64_decode("dmlld" . "19wYW" . "dl"), "_2ecaaccc5f23b789" . "d2931cf60db90d27" => base64_decode("cGFnZV" . "90aXRs" . "ZS5ib2" . "R5"), "_98401753167b015e6e59db2336" . "1984f9" => base64_decode("Z2x5cGhpY29ucy1wYWdlc" . "w=="), "_385f193fda5" . "19d3ef5a7609" . "8f12cf7eb" => base64_decode("cGFnZXMu" . "c3RhdF9w" . "bHVnaW4u" . "dmlld3M="), "_3f05c7e033d" . "5fa5883b27e9" . "248e3ab53" => base64_decode("cG" . "Fn" . "ZX" . "M="), "_a36772b93f40b35110e" . "9897980b47ce8" => base64_decode("cGFnZXMuc3RhdF" . "9wbHVnaW4ucGFn" . "ZV90aXRsZQ=="), "_7f628626dd1d55c71b1fc0932ffd" . "1d2c" => base64_decode("aXNfY" . "XJyYX" . "k="), "_7713666c10f1566e673d0e8106c" . "d8c0a" => base64_decode("ZGF0YV90eXBlX2Jsb2NrX3Zpc2libGUudmlz" . "aWJsZQ=="), "_9b6310dc649a866c978c8" . "4b9ed2f81d5" => base64_decode("cGFnZXMuc3RhdF9wbHVnaW4uc2VyaWVzLn" . "BhZ2Vfdmlld3NfdG9vbHRpcA=="));
use Claromentis\Stat\StatProviderInterface;
use Claromentis\Stat\StatReporter;
use Claromentis\Stat\StatDiagramDrawer;
use Claromentis\Pages\Perm;
use Claromentis\Core\DAL;
use Date;
class PagesStatContentProvider implements StatProviderInterface
{
    
    
    
    
    const MODULE_IDENTIFIER = 'pages';
    
    
    
    
    private $db;
    
    
    
    
    private $stat_repository;
    
    
    
    
    private $stat_reporter;
    
    
    
    
    
    public function __construct(DAL\Db $_e87574de8e606d438c70d60ffb96ef44, PagesStatRepositoryPages $_e51b1f098b64b6c7e8aecf08e1cc8539)
    {
        $this->db = $_e87574de8e606d438c70d60ffb96ef44;
        $this->stat_repository = $_e51b1f098b64b6c7e8aecf08e1cc8539;
    }
    
    
    
    
    
    
    public function GetStatCollectorData() : array
    {
        return [self::MODULE_IDENTIFIER, [[Perm::AGGREGATION_PAGES_PAGE, $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_e0fa173dc2c2bd2ab21f7" . "03726682cf1"], false], [Perm::AGGREGATION_PAGES_PAGE, $GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_fb97865c9584c8026ea64ae" . "be0463065"], false]]];
    }
    
    
    
    
    
    
    public function SetStatReporter(StatReporter $_d4f24b545ad4fb92429634be0606909a)
    {
        $this->stat_reporter = $_d4f24b545ad4fb92429634be0606909a;
    }
    
    
    
    
    
    
    public function GetName() : string
    {
        return $GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_0c5123aa744f69bbc0e8b3ea2f6e847" . "d"]($GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_81639498a0f836244c7c4" . "8fa513a9247"]);
    }
    
    
    
    
    
    
    public function GetIconClass() : string
    {
        return $GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_98401753167b015e6e59db" . "23361984f9"];
    }
    
    
    
    
    
    
    public function GetChartType() : string
    {
        return self::MODULE_IDENTIFIER;
    }
    
    
    
    
    
    
    public function GetSeries() : array
    {
        return $this->stat_repository->GetSiteSeries($this->stat_reporter);
    }
    
    
    
    
    
    
    public function GetSeriesTooltips() : array
    {
        $_e3fd03c315298aef158f684d5fe47ca5 = [];
        foreach ($this->GetSeries() as $_0ea4e32b57963ac0cb3057e03e9aef64 => $name) {
            $_e3fd03c315298aef158f684d5fe47ca5[$_0ea4e32b57963ac0cb3057e03e9aef64] = $GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_9b6310dc649a86" . "6c978c84b9ed2f8" . "1d5"];
        }
        return $_e3fd03c315298aef158f684d5fe47ca5;
    }
    
    
    
    
    
    
    
    
    public function GetSeriesData(int $_d9ba6ca3b609d7f857c96b65791617e3) : array
    {
        
        
        $_23a9b425f65f6a53e91c7f695f8f29e6 = $this->stat_repository->GetSiteSeriesData($this->stat_reporter);
        return $_23a9b425f65f6a53e91c7f695f8f29e6[$_d9ba6ca3b609d7f857c96b65791617e3];
    }
    
    
    
    
    
    
    
    public function GetAllSeriesTotalCount() : int
    {
        $_f4eafa5f493306ffdb51a688b21dd507 = 0;
        if (!empty($this->stat_reporter)) {
            $_f4eafa5f493306ffdb51a688b21dd507 = $this->stat_reporter->GetViewsCount(Perm::AGGREGATION_PAGES_PAGE);
        }
        return $_f4eafa5f493306ffdb51a688b21dd507;
    }
    
    
    
    
    
    
    
    public function GetAllSeriesTotalCountText() : string
    {
        return $GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_0c5123aa744f69bbc0e8b" . "3ea2f6e847d"]($GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_385f193fda519d3e" . "f5a76098f12cf7eb"], $this->GetAllSeriesTotalCount());
    }
    
    
    
    
    
    
    
    public function GetAllSeriesDailyAverageCount() : float
    {
        $_f4eafa5f493306ffdb51a688b21dd507 = $this->GetAllSeriesTotalCount();
        $_34535e92155a643211db196780a5a677 = $GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_b92b5ed2edaf18b8eec721" . "c1422e34ee"]($_f4eafa5f493306ffdb51a688b21dd507 / $this->stat_reporter->GetDays(), 2);
        return $_34535e92155a643211db196780a5a677;
    }
    
    
    
    
    
    
    
    public function GetAllSeriesDailyAverageCountText() : string
    {
        return $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_0c5123aa744f69bbc0e8b" . "3ea2f6e847d"]($GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_46ebe283f49f124496172f97bfe" . "53b50"], $this->GetAllSeriesDailyAverageCount());
    }
    
    
    
    
    
    
    public function GetPageTitle() : string
    {
        return $GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_0c5123aa744f69bb" . "c0e8b3ea2f6e847d"]($GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_a36772b93f40b35110e" . "9897980b47ce8"]);
    }
    
    
    
    
    
    
    public function GetTemplateFilename() : string
    {
        return $GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_5a8b1c5e7f1cc4976c0a2b564" . "211cc54"];
    }
    
    
    
    
    
    
    
    
    public function GetTemplateArgs(Date $_1e491d70b7c6ff2f5e7e1fa21ad956f3, Date $_c955d13b8651b08fd00aa43169d63ea1) : array
    {
        $args = [];
        $args[$GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_2ecaacc" . "c5f23b78" . "9d2931cf" . "60db90d2" . "7"]] = $this->GetPageTitle();
        $args[$GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_7713666c10f1566e673d" . "0e8106cd8c0a"]] = false;
        
        
        $_c450cc95bd5060532f9a9f40c745adcb = new StatDiagramDrawer();
        $_c450cc95bd5060532f9a9f40c745adcb->SetSize(-1, 250);
        $_c450cc95bd5060532f9a9f40c745adcb->SetTitle($GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_4d707fab93bebb00bbe69e815969" . "7c90"]);
        $_d9ba6ca3b609d7f857c96b65791617e3 = $this->GetSeries();
        $_e3fd03c315298aef158f684d5fe47ca5 = $this->GetSeriesTooltips();
        foreach ($_d9ba6ca3b609d7f857c96b65791617e3 as $_1e2228816f84bbc72921dc2769308b8d => $_0e810c22030b207c1cda2619859f6aeb) {
            $_c450cc95bd5060532f9a9f40c745adcb->AddData($this->GetSeriesData($_1e2228816f84bbc72921dc2769308b8d), $GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_7f628626dd1d55" . "c71b1fc0932ffd1" . "d2c"]($_e3fd03c315298aef158f684d5fe47ca5) && !empty($_e3fd03c315298aef158f684d5fe47ca5) ? $_e3fd03c315298aef158f684d5fe47ca5[$_1e2228816f84bbc72921dc2769308b8d] : $GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_4d707fab9" . "3bebb00bbe" . "69e8159697" . "c90"], $_0e810c22030b207c1cda2619859f6aeb);
        }
        $args[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_f3c01efbec4e34280b394" . "d427cacd62c"]] = $_c450cc95bd5060532f9a9f40c745adcb->Draw();
        
        
        $_c2746b6f6ffb5c666ae214e60e11a456 = new PagesStatReportPages($this->db, $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_3f05c7e033d5fa5883b27e9248" . "e3ab53"]);
        $_c2746b6f6ffb5c666ae214e60e11a456->SetDatesFilter($_1e491d70b7c6ff2f5e7e1fa21ad956f3, $_c955d13b8651b08fd00aa43169d63ea1);
        $_c2746b6f6ffb5c666ae214e60e11a456->Init();
        $_c2746b6f6ffb5c666ae214e60e11a456->DrawHtml();
        $args += $_c2746b6f6ffb5c666ae214e60e11a456->GetArgs();
        return $args;
    }
}