<?php
namespace Claromentis\Console\Events;

$GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"] = (@$GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"] ?: array()) + array("_524a9aff7db045ab" . "3de862d553a9c90a" => base64_decode("RG9Qcm" . "9ncmVz" . "cw=="), "_7bcdfd1254" . "0318f956c42" . "d9d627403ed" => base64_decode("Q2R" . "uQm" . "Vna" . "W4="), "_7cdb85d8" . "37287cc28" . "98a181286" . "63e6c1" => base64_decode("Y2RuX2Vu" . "ZA=="), "_48716664ff1" . "a8cdd6cccfc9" . "613c645fe" => base64_decode("bW" . "F4"), "_4b75dcc9a37fa8" . "f1f41bd883e9116" . "2a7" => base64_decode("Q2RuR" . "W5k"), "_73115ee8f369" . "adc89a6525978" . "197c094" => base64_decode("ZGF0Y" . "V9lbm" . "Q="), "_c3193c9edf55f07581c41c31ab168" . "148" => base64_decode("RGJC" . "ZWdp" . "bg=="), "_1e3e938444e012338c4" . "4c371cab7cc3b" => base64_decode("R2V0RGF0YVByb2" . "dyZXNz"), "_c05e8a75" . "853f6ef32" . "45cd003e2" . "436868" => base64_decode("ZGJfY" . "mVnaW" . "4="), "_4d707fab93bebb00bbe69e81" . "59697c90" => base64_decode(""), "_97c8b6f00dcb" . "aa32e80e66044" . "c92c5b6" => base64_decode("R2V0Q2Ru" . "UHJvZ3Jl" . "c3M="), "_65e744b83dac" . "5daa893eb3dd9" . "29c6535" => base64_decode("R2V0VGFibGVzUHJvZ3Jlc" . "3M="), "_d5ae3fd936b081e" . "62092948acad1866" . "e" => base64_decode("RGF0Y" . "UJlZ2" . "lu"), "_8e9198a37af" . "2aef09ab6f4d" . "09e63b99e" => base64_decode("ZGF0YV9iZ" . "Wdpbg=="), "_0dbda6cea18b95524b696deee84f" . "cad1" => base64_decode("RGJFbm" . "Q="), "_6d53e68114" . "530ed797271" . "3c62b800bfd" => base64_decode("ZGJfZW5" . "k"), "_5e723961a29019" . "72976f37c6ab7ec" . "f98" => base64_decode("RGF" . "0YU" . "VuZ" . "A=="), "_97803a8b7cef7cbb" . "3598a2cb58a4853c" => base64_decode("Y2RuX2JlZ2l" . "u"));
use Claromentis\Admin\Sysadmin\Events\DataExportUpdateEvent;
use Claromentis\Admin\Sysadmin\UseCase\AbstractImportExport;
use Claromentis\Admin\Sysadmin\UseCase\DataExport;
use Claromentis\Core\Event\EventSubscriberInterface;
use Symfony\Component\Console\Helper\ProgressBar;
use Symfony\Component\Console\Style\SymfonyStyle;
class DataExportSubscriber implements EventSubscriberInterface
{
    
    
    
    
    protected $io;
    protected $progress_callback = null;
    protected $progress_method;
    protected $progress_message = '';
    protected $scale = 1;
    protected $size = 1;
    
    
    
    
    protected $progress_bar;
    protected $messages = ['db_begin' => 'Exporting Database...', 'db_end' => 'Database exported', 'data_begin' => 'Exporting data directory...', 'data_end' => 'Data directory exported', 'cdn_begin' => 'Exporting CDN files...', 'cdn_end' => 'CDN files exported'];
    public function __construct(SymfonyStyle $_864a669886d8589b69da46fc523ffd71)
    {
        $this->io = $_864a669886d8589b69da46fc523ffd71;
    }
    
    
    
    
    public function setMessages(array $_fab5a2188c706d282c3aea92f0ccbd01) : void
    {
        $this->messages = $_fab5a2188c706d282c3aea92f0ccbd01;
    }
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    public static function getSubscribedEvents()
    {
        return [AbstractImportExport::DB_START_EVENT => $GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_c3193c9edf55f07" . "581c41c31ab16814" . "8"], AbstractImportExport::DB_END_EVENT => $GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_0dbda6cea18b95524b696de" . "ee84fcad1"], AbstractImportExport::DATA_START_EVENT => $GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_d5ae3fd936b081e62092948ac" . "ad1866e"], AbstractImportExport::DATA_END_EVENT => $GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_5e723961a290197" . "2976f37c6ab7ecf9" . "8"], AbstractImportExport::CDN_START_EVENT => $GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_7bcdfd125403" . "18f956c42d9d6" . "27403ed"], AbstractImportExport::CDN_END_EVENT => $GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_4b75dcc9a37fa8f1f41bd883e911" . "62a7"], AbstractImportExport::UPDATE_EVENT => $GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_524a9aff7db045ab3de862d553a" . "9c90a"]];
    }
    public function DbBegin(DataExportUpdateEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        $_7fb3df533b7949de8374b1cf6d5394ad = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getProgressTracker();
        $this->GenericBegin(1, $this->messages[$GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_c05e8a75853f6ef3245c" . "d003e2436868"]], $_7fb3df533b7949de8374b1cf6d5394ad->GetTablesSize(), $GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_65e744b83dac5daa893eb3" . "dd929c6535"]);
    }
    public function DbEnd(DataExportUpdateEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        $this->GenericEnd($this->messages[$GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_6d53e68114530ed7972713c62" . "b800bfd"]]);
    }
    public function DataBegin(DataExportUpdateEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        $_7fb3df533b7949de8374b1cf6d5394ad = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getProgressTracker();
        $this->GenericBegin(1000000, $this->messages[$GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_8e9198a37af2" . "aef09ab6f4d09" . "e63b99e"]], $_7fb3df533b7949de8374b1cf6d5394ad->GetDataSize(), $GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_1e3e938444e012338c44c371" . "cab7cc3b"]);
    }
    public function DataEnd(DataExportUpdateEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        $this->GenericEnd($this->messages[$GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["_73115ee8f369adc89a652597819" . "7c094"]]);
    }
    public function CdnBegin(DataExportUpdateEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        $_7fb3df533b7949de8374b1cf6d5394ad = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getProgressTracker();
        $this->GenericBegin(1000000, $this->messages[$GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_97803a8" . "b7cef7cb" . "b3598a2c" . "b58a4853" . "c"]], $_7fb3df533b7949de8374b1cf6d5394ad->GetCdnSize(), $GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_97c8b6f" . "00dcbaa3" . "2e80e660" . "44c92c5b" . "6"]);
    }
    public function CdnEnd(DataExportUpdateEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        $this->GenericEnd($this->messages[$GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_7cdb85d837287cc28" . "98a18128663e6c1"]]);
    }
    public function DoProgress(DataExportUpdateEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        if (isset($this->progress_method)) {
            $_7fb3df533b7949de8374b1cf6d5394ad = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getProgressTracker();
            $_5f42d55f4c50c2ac2c3e7b1234a36729 = [$_7fb3df533b7949de8374b1cf6d5394ad, $this->progress_method]();
            $this->progress_bar->setProgress((int) ($_5f42d55f4c50c2ac2c3e7b1234a36729 / $this->scale));
        }
    }
    protected function GenericBegin(int $_22ec5ebc4f009f2eab827fc0adf28b8f, string $_e05e0022a2e5ad344b9c4a0d3f64e1a5, float $_be00ff7d4d52251ef742a5c1d7e92be9, string $_b76f867b404b9e82319b2671531d369b)
    {
        $this->scale = $_22ec5ebc4f009f2eab827fc0adf28b8f;
        $this->size = $GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_48716664ff1a8cd" . "d6cccfc9613c645f" . "e"]((int) ($_be00ff7d4d52251ef742a5c1d7e92be9 / $_22ec5ebc4f009f2eab827fc0adf28b8f), 1);
        $this->io->writeln($GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_4d707fab93bebb00bbe" . "69e8159697c90"]);
        $this->io->writeln($_e05e0022a2e5ad344b9c4a0d3f64e1a5);
        $this->progress_bar = new ProgressBar($this->io, $this->size);
        $this->progress_method = $_b76f867b404b9e82319b2671531d369b;
    }
    protected function GenericEnd(string $_e05e0022a2e5ad344b9c4a0d3f64e1a5)
    {
        $this->progress_method = null;
        $this->progress_bar->setProgress($this->size);
        $this->progress_bar->finish();
        $this->io->writeln($GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_4d707fab93bebb00bbe69e8159697" . "c90"]);
        $this->io->writeln($_e05e0022a2e5ad344b9c4a0d3f64e1a5);
    }
}