<?php
namespace Claromentis\Stat;

$GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"] ?: array()) + array("_1b3f8a7666f8f0299eddcf86f50eb" . "8ea" => base64_decode("L2ludHJh" . "bmV0L3N0" . "YXQv"), "_0a805be8325cdf843079f" . "5f3b899dbc8" => base64_decode("YWRtaW4ucGFuZWx" . "z"), "_0995370913cd4" . "4391d39fdba6ce" . "206c0" => base64_decode("bG9jYWxpemF0aW9uLmRvbWFpbl9mcm9tX2ZpbGV" . "zX2ZhY3Rvcnk="), "n" . "a" . "m" . "e" => base64_decode("bmFtZQ" . "=="), "u" . "r" . "l" => base64_decode("d" . "X" . "J" . "s"), "_6118943532d5745f7e2e610" . "f98024e2f" => base64_decode("bWVudS5" . "hcHAuc3" . "RhdA=="), "_fc9d7314a9d" . "9958d8fa0a40" . "3ba8ff197" => base64_decode("Z2V0X2Ns" . "YXNz"), "_9c6e376470b711d8a29a8c4302" . "aaad22" => base64_decode("c3RhdC5wbHVnaW5fY29udGVudF9" . "wcm92aWRlcg=="), "_aad576a27d4270db" . "0bcce79b5b765b54" => base64_decode("aWNv" . "bg=="), "_12dc001a9ad" . "5eec9b02198f" . "903676641" => base64_decode("bG9jYWxpemF" . "0aW9uLmRvbW" . "Fpbi4="), "_f8995e07ad4c5ef9bf" . "6bbc26cd0892ed" => base64_decode("c3RhdC5wbHVna" . "W4="), "_b848e46a9a0a" . "ac02daa4786f3" . "ebf61ca" => base64_decode("bWVudS5hcHBsaWNhdGlvb" . "nM="), "typ" . "e" => base64_decode("dHl" . "wZQ" . "=="), "_0b1fbf262faa743f1fcbb355e" . "6b7bbb0" => base64_decode("L2ludHJhbmV" . "0L3N0YXQvYW" . "RtaW4ucGhw"), "st" . "at" => base64_decode("c3R" . "hdA" . "=="));
use Claromentis\Core\Http\StatusCode;
use Claromentis\Core\Icon;
use Claromentis\Core\Localization\Lmsg;
use Pimple\Container;
use Pimple\ServiceProviderInterface;
use Silex\Api\EventListenerProviderInterface;
use StatLogger;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\TerminateEvent;
use Symfony\Component\HttpKernel\KernelEvents;




class StatApplication implements ServiceProviderInterface, EventListenerProviderInterface
{
    public const NAME = 'stat';
    public const APPLICATION_SVG_URL = '/interface_default/stat/assets/images/statistics-icon.svg';
    
    
    
    
    
    
    
    
    
    public function register(Container $app)
    {
        $app[$GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_f8995e07ad4c5ef9bf6bbc" . "26cd0892ed"]] = function ($app) {
            return new StatPluginProvider($app);
        };
        $app[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_9c6e376470b711d8a29a8c4302aaad" . "22"]] = function ($app) {
            return new StatPluginContentProvider($app[$GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["_f8995e07ad4c5ef9bf6bbc26cd08" . "92ed"]]);
        };
        $app[$GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_b848e46a9a0a" . "ac02daa4786f3" . "ebf61ca"]] = $app->extend($GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_b848e46a9a0aac02daa4786" . "f3ebf61ca"], function ($_38dc3c4573d1bf70268680af788c25d2) use($app) {
            
            
            $lmsg = $app[Lmsg::class];
            $_38dc3c4573d1bf70268680af788c25d2[$GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["st" . "at"]] = [$GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["n" . "a" . "m" . "e"] => $lmsg($GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_6118943532d5745f7e2e610f9802" . "4e2f"]), $GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["u" . "r" . "l"] => $GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_1b3f8a7666f8f02" . "99eddcf86f50eb8e" . "a"], $GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_aad576a27d4270db0bcce" . "79b5b765b54"] => [$GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["typ" . "e"] => Icon\Types::SVG, $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["u" . "r" . "l"] => self::APPLICATION_SVG_URL]];
            return $_38dc3c4573d1bf70268680af788c25d2;
        });
        $app[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_0a805be8325cdf843079f5f3b899" . "dbc8"]] = $app->extend($GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_0a805be8325cdf843079f5f3b899d" . "bc8"], function ($_1f335c62fbed8a6b314f9ecb4b3b3977) use($app) {
            
            
            $lmsg = $app[Lmsg::class];
            $_1f335c62fbed8a6b314f9ecb4b3b3977[$GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["s" . "t" . "a" . "t"]] = [$GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["nam" . "e"] => $lmsg($GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_6118943532d5745f" . "7e2e610f98024e2f"]), $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["ur" . "l"] => $GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_0b1fbf262faa743f1fcbb355e6b7b" . "bb0"], $GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["_aad576a27d4270db0" . "bcce79b5b765b54"] => [$GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["typ" . "e"] => Icon\Types::SVG, $GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["ur" . "l"] => self::APPLICATION_SVG_URL]];
            return $_1f335c62fbed8a6b314f9ecb4b3b3977;
        });
        $app[$GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_12dc001a9ad5" . "eec9b02198f90" . "3676641"] . self::NAME] = function ($app) {
            return $app[$GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_0995370913cd44391d39fdba6ce2" . "06c0"]](self::NAME);
        };
        
        
        $app[StatPluginContentProvider::class] = $GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_9c6e376470b711d8a29a8c4302aaa" . "d22"];
        $app[StatPluginProvider::class] = $GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_f8995e07ad4c5ef9bf" . "6bbc26cd0892ed"];
    }
    public function subscribe(Container $app, EventDispatcherInterface $dispatcher)
    {
        
        
        $dispatcher->addListener(KernelEvents::TERMINATE, function (TerminateEvent $event) {
            $response = $event->getResponse();
            if ($response->getStatusCode() !== StatusCode::OK) {
                return;
            }
            
            
            
            if ($GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_fc9d7314a9d9958d8fa0a403ba8" . "ff197"]($response) === Response::class) {
                StatLogger::LogPageVisit();
            }
        });
    }
}