<?php
namespace Claromentis\Search\Suggestions;

$GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"] = (@$GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"] ?: array()) + array("_7f628626d" . "d1d55c71b1" . "fc0932ffd1" . "d2c" => base64_decode("aXNfYXJ" . "yYXk="), "_f73dab606630b388645c" . "4f7d3fbb13bb" => base64_decode("YXJyYXlfbWVyZ2U" . "="), "_49c6565477ee9f822b499a53e6d29" . "95f" => base64_decode("YXJyYXlfa2V5X2V" . "4aXN0cw=="), "_ab1e14183ebb02378ed53" . "35a96a4288d" => base64_decode("Y2ZnX3NlYXJ" . "jaF9wbHVnaW" . "5z"));
use ErrorHandler;









class PluginLoader extends ErrorHandler
{
    
    
    
    
    
    
    protected static $valid_applications = array('documents' => 'Claromentis\\Search\\Suggestions\\SearchResource\\Document', 'publish' => 'Claromentis\\Search\\Suggestions\\SearchResource\\Publish', 'news' => 'Claromentis\\Search\\Suggestions\\SearchResource\\News', 'people' => 'Claromentis\\Search\\Suggestions\\SearchResource\\People', 'forum' => 'Claromentis\\Search\\Suggestions\\SearchResource\\Forum');
    
    
    
    
    
    
    
    
    
    
    
    
    
    public static function GetPluginByUrl($url)
    {
        $plugins = static::GetPlugins();
        foreach ($plugins as $_6a02aaefc5f2925e469e5aca3990865a => $_327c87139880ba8bc0fa0b9a7e24a44d) {
            if ($_327c87139880ba8bc0fa0b9a7e24a44d::IsSupportedUrl($url)) {
                $_daf0ea4a4657bd95111bb4f0079b9cff = new $_327c87139880ba8bc0fa0b9a7e24a44d();
                return [$_daf0ea4a4657bd95111bb4f0079b9cff, $_6a02aaefc5f2925e469e5aca3990865a];
            }
        }
        return [null, null];
    }
    
    
    
    
    
    
    
    
    
    public static function PluginFactory($_f44467aacb8a4520c7382769d24aa422)
    {
        $plugins = static::GetPlugins();
        if ($GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_49c6565477" . "ee9f822b499" . "a53e6d2995f"]($_f44467aacb8a4520c7382769d24aa422, $plugins)) {
            return new $plugins[$_f44467aacb8a4520c7382769d24aa422]();
        } else {
            return null;
        }
    }
    
    
    
    
    
    
    
    private static function GetPlugins()
    {
        global $g_application;
        $_ab1e14183ebb02378ed5335a96a4288d = $g_application->config->get($GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["_ab1e14183" . "ebb02378ed" . "5335a96a42" . "88d"]);
        if ($GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_7f62862" . "6dd1d55c" . "71b1fc09" . "32ffd1d2" . "c"]($_ab1e14183ebb02378ed5335a96a4288d)) {
            $plugins = $GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_f73dab606630b388645c4" . "f7d3fbb13bb"](self::$valid_applications, $_ab1e14183ebb02378ed5335a96a4288d);
        } else {
            $plugins = self::$valid_applications;
        }
        return $plugins;
    }
}