<?php
namespace Claromentis\Quiz\Subscriber;

$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"] = (@$GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"] ?: array()) + array("_f4b6f84d3555d4e24ef3fc" . "bc296b1961" => base64_decode("T25TdXJ2ZXlBZG1pblBlc" . "m1pc3Npb25zU2F2ZQ=="), "_b3ee1ca1d7e4" . "bff63ae777968" . "483325d" => base64_decode("cG9sbA" . "=="), "_38d8693b4b1a" . "2d382e9a28ede" . "628ab61" => base64_decode("cXVpei5zdXJ2ZXkuYWRtaW5fcGVybWlzc2lvbn" . "Mub25fc2F2ZQ=="), "_c9d07e643fc63b4e8346006b6b11d" . "789" => base64_decode("T25RdWl6RGVsZX" . "Rl"), "surve" . "y" => base64_decode("c3Vyd" . "mV5"), "_b0eaaa9541f479b4891f61611" . "17437b9" => base64_decode("cXVldWVfZnVsbF" . "9yZWluZGV4"), "_42dadeffedf6e783" . "f89c3d71656adc80" => base64_decode("cXVpei5hZG1pbl9wZXJtaXNza" . "W9ucy5vbl9zYXZl"), "_3d60fe0385cf" . "d6c3f7c1ecd89" . "f2f5b63" => base64_decode("c3VydmV5Lm9uX2R" . "lbGV0ZQ=="), "_ca4c14044f" . "002c5bb6b36" . "944fcad9690" => base64_decode("T25Qb2xsRGVs" . "ZXRl"), "_5d96fe1de62e" . "6cc059ec052ba" . "7c84583" => base64_decode("cXVp" . "ei5v" . "bl9z" . "YXZl"), "_1dacdff1f790483950271" . "b5c10c97593" => base64_decode("T25TdXJ2ZXlTYX" . "Zl"), "_510eb36bc573b" . "a6bbaa2d59085a" . "1b0b0" => base64_decode("cXVpe" . "i5vbl" . "9kZWx" . "ldGU="), "_8c62e1409cd25fc6c8b1" . "0307d0726475" => base64_decode("c3VydmV5Lm9u" . "X3NhdmU="), "_8e7f4b5c8440c0a24fb1b632ee" . "e28538" => base64_decode("YWN0aW9" . "u"), "qu" . "iz" => base64_decode("cXVpe" . "g=="), "_1090605af78837f737d262b" . "cae18163b" => base64_decode("T25RdWl6U2F2" . "ZQ=="), "_e11bb6148a62a829b2911ff479" . "99e778" => base64_decode("aXNOZ" . "Xc="), "_9b6323aacb40daeb5bfadd835683a" . "c2e" => base64_decode("cG9sb" . "C5vbl" . "9zYXZ" . "l"), "_53e359b98863365b9" . "d442006f757295e" => base64_decode("T25Qb2xsU2F2" . "ZQ=="), "_be108e971d79117db577" . "3d8687b0de86" => base64_decode("T25BZG1pblBlcm1pc3Npb25zU2F" . "2ZQ=="), "_22367005300b6c0219f03a0" . "fbcf33e5c" => base64_decode("T25TdXJ2ZX" . "lEZWxldGU="), "_b532389cc975e273" . "cb389930bf8b2807" => base64_decode("cG9sb" . "C5vbl" . "9kZWx" . "ldGU="));
use Claromentis\Core\Event\GenericEvent;
use Claromentis\Quiz\Model\Poll;
use Claromentis\Quiz\Model\Quiz;
use Claromentis\Quiz\Model\Survey;
use Claromentis\Quiz\Repository\QuizRepository;
use Claromentis\Quiz\Search\Indexing\PollIndexing;
use Claromentis\Quiz\Search\Indexing\QuizIndexing;
use Claromentis\Quiz\Search\Indexing\SurveyIndexing;
use Claromentis\Search\Indexing\IndexingInstruction;
use Claromentis\Search\Indexing\IndexingQueue;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;




class SearchSubscriber implements EventSubscriberInterface
{
    
    
    
    
    protected $repository;
    
    
    
    
    
    
    public function __construct(QuizRepository $_8652ba33e6ffeba02459fa9cbb320851)
    {
        $this->repository = $_8652ba33e6ffeba02459fa9cbb320851;
    }
    
    
    
    
    public static function getSubscribedEvents()
    {
        return [
            $GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_5d96fe1" . "de62e6cc" . "059ec052" . "ba7c8458" . "3"] => $GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_1090605af78837f73" . "7d262bcae18163b"],
            $GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_510eb36bc573ba6bbaa2d59085a1b0b" . "0"] => $GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_c9d07e643fc63b4e83460" . "06b6b11d789"],
            
            
            $GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_42dadeffedf6e783f8" . "9c3d71656adc80"] => $GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_be108e971d79117d" . "b5773d8687b0de86"],
            $GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_8c62e1409cd25fc6c8b10" . "307d0726475"] => $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_1dacdff1f790483950271b5c1" . "0c97593"],
            $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_3d60fe0385cfd6c3f7c1ec" . "d89f2f5b63"] => $GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_22367005300b6c0219f03a" . "0fbcf33e5c"],
            $GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_9b6323aacb" . "40daeb5bfad" . "d835683ac2e"] => $GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_53e359b98863" . "365b9d442006f" . "757295e"],
            $GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_b532389cc975e273cb389930bf" . "8b2807"] => $GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_ca4c14044f002c5bb" . "6b36944fcad9690"],
            $GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_38d8693b4b1a2d382e9a28ede628a" . "b61"] => $GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_f4b6f84d3555d4e24ef3fcbc296" . "b1961"],
        ];
    }
    
    
    
    
    
    
    public function OnQuizSave(GenericEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        if (!$_e62ca7bbb93b52cafc82da1c2aefe9ec->hasArgument($GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["q" . "u" . "i" . "z"])) {
            return;
        }
        
        
        
        
        $quiz = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getArgument($GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["qu" . "iz"]);
        $_231341bedbbeea0ba9fa8da63ef63dc1 = $_e62ca7bbb93b52cafc82da1c2aefe9ec->hasArgument($GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_e11bb6148a62a829b2911f" . "f47999e778"]) ? (bool) $_e62ca7bbb93b52cafc82da1c2aefe9ec->getArgument($GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_e11bb6148a62a829b291" . "1ff47999e778"]) : false;
        if ($_231341bedbbeea0ba9fa8da63ef63dc1) {
            IndexingQueue::Index(QuizIndexing::TYPE_NAME, $quiz->id);
        } else {
            IndexingQueue::Reindex(QuizIndexing::TYPE_NAME, $quiz->id);
        }
    }
    
    
    
    
    
    
    public function OnQuizDelete(GenericEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        if (!$_e62ca7bbb93b52cafc82da1c2aefe9ec->hasArgument($GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["q" . "u" . "i" . "z"])) {
            return;
        }
        
        
        
        
        $quiz = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getArgument($GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["qui" . "z"]);
        IndexingQueue::DeleteIndex(QuizIndexing::TYPE_NAME, $quiz->id);
    }
    
    
    
    
    public function OnAdminPermissionsSave()
    {
        $_8c5f17e2e918145535955f8a633b6c7b = new IndexingInstruction(QuizIndexing::TYPE_NAME, 0, 0, IndexingInstruction::SPECIAL, array($GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_8e7f4b5c8440c0a24f" . "b1b632eee28538"] => $GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_b0eaaa9541f479b4891" . "f6161117437b9"]));
        IndexingQueue::AddInstruction($_8c5f17e2e918145535955f8a633b6c7b);
    }
    public function OnPollSave(GenericEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        if (!$_e62ca7bbb93b52cafc82da1c2aefe9ec->hasArgument($GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_b3ee1ca1d7e4bff63ae77796" . "8483325d"])) {
            return;
        }
        
        
        
        
        $_b3ee1ca1d7e4bff63ae777968483325d = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getArgument($GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_b3ee1ca1d7e4bf" . "f63ae7779684833" . "25d"]);
        $_231341bedbbeea0ba9fa8da63ef63dc1 = $_e62ca7bbb93b52cafc82da1c2aefe9ec->hasArgument($GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_e11bb6148a62a829b2911ff4" . "7999e778"]) ? (bool) $_e62ca7bbb93b52cafc82da1c2aefe9ec->getArgument($GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_e11bb6148a62a829b2911" . "ff47999e778"]) : false;
        if ($_231341bedbbeea0ba9fa8da63ef63dc1) {
            IndexingQueue::Index(PollIndexing::TYPE_NAME, $_b3ee1ca1d7e4bff63ae777968483325d->id);
        } else {
            IndexingQueue::Reindex(PollIndexing::TYPE_NAME, $_b3ee1ca1d7e4bff63ae777968483325d->id);
        }
    }
    
    
    
    
    
    public function OnSurveySave(GenericEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        if (!$_e62ca7bbb93b52cafc82da1c2aefe9ec->hasArgument($GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["sur" . "vey"])) {
            return;
        }
        
        
        $survey = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getArgument($GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["su" . "rv" . "ey"]);
        $_231341bedbbeea0ba9fa8da63ef63dc1 = $_e62ca7bbb93b52cafc82da1c2aefe9ec->hasArgument($GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_e11bb6148a62a829b2" . "911ff47999e778"]) ? (bool) $_e62ca7bbb93b52cafc82da1c2aefe9ec->getArgument($GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_e11bb6148a62a829b2911ff47999e" . "778"]) : false;
        if ($_231341bedbbeea0ba9fa8da63ef63dc1) {
            IndexingQueue::Index(SurveyIndexing::TYPE_NAME, $survey->id);
        } else {
            IndexingQueue::Reindex(SurveyIndexing::TYPE_NAME, $survey->id);
        }
    }
    
    
    
    
    
    
    public function OnSurveyDelete(GenericEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        if (!$_e62ca7bbb93b52cafc82da1c2aefe9ec->hasArgument($GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["su" . "rv" . "ey"])) {
            return;
        }
        
        
        $survey = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getArgument($GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["su" . "rv" . "ey"]);
        IndexingQueue::DeleteIndex(SurveyIndexing::TYPE_NAME, $survey->id);
    }
    
    
    
    
    public function OnSurveyAdminPermissionsSave()
    {
        $_8c5f17e2e918145535955f8a633b6c7b = new IndexingInstruction(PollIndexing::TYPE_NAME, 0, 0, IndexingInstruction::SPECIAL, [$GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_8e7f4b5c8440c0a24fb1b632eee" . "28538"] => $GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_b0eaaa9541f479b489" . "1f6161117437b9"]]);
        IndexingQueue::AddInstruction($_8c5f17e2e918145535955f8a633b6c7b);
        $_8c5f17e2e918145535955f8a633b6c7b = new IndexingInstruction(SurveyIndexing::TYPE_NAME, 0, 0, IndexingInstruction::SPECIAL, [$GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_8e7f4b5c8440c0a24" . "fb1b632eee28538"] => $GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_b0eaaa9541f479b" . "4891f6161117437b" . "9"]]);
        IndexingQueue::AddInstruction($_8c5f17e2e918145535955f8a633b6c7b);
    }
    
    
    
    
    
    
    public function OnPollDelete(GenericEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        if (!$_e62ca7bbb93b52cafc82da1c2aefe9ec->hasArgument($GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_b3ee1ca1" . "d7e4bff63" . "ae7779684" . "83325d"])) {
            return;
        }
        
        
        $_b3ee1ca1d7e4bff63ae777968483325d = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getArgument($GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_b3ee1ca1d7e4bff" . "63ae777968483325" . "d"]);
        IndexingQueue::DeleteIndex(SurveyIndexing::TYPE_NAME, $_b3ee1ca1d7e4bff63ae777968483325d->id);
    }
}