<?php

use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;

/* @bundles/CoreBundle/IpLookup/AbstractLookup.php */
class __TwigTemplate_b17d06b321188f34d8da1bd63fb50946 extends Template
{
    private $source;
    private $macros = [];

    public function __construct(Environment $env)
    {
        parent::__construct($env);

        $this->source = $this->getSourceContext();

        $this->parent = false;

        $this->blocks = [
        ];
    }

    protected function doDisplay(array $context, array $blocks = [])
    {
        $macros = $this->macros;
        // line 1
        echo "<?php

namespace Mautic\\CoreBundle\\IpLookup;

use GuzzleHttp\\Client;
use Psr\\Log\\LoggerInterface;

abstract class AbstractLookup
{
    public \$city         = '';
    public \$region       = '';
    public \$zipcode      = '';
    public \$country      = '';
    public \$latitude     = '';
    public \$longitude    = '';
    public \$isp          = '';
    public \$organization = '';
    public \$timezone     = '';
    public \$extra        = '';

    protected ?Client \$client;

    /**
     * @var string IP Address
     */
    protected \$ip;

    /**
     * Authorization for lookup service.
     */
    protected \$auth;

    protected ?string \$cacheDir;
    protected ?LoggerInterface \$logger;

    /**
     * @var mixed
     */
    protected \$config;

    /**
     * Return attribution HTML displayed in the configuration UI.
     *
     * @return string
     */
    abstract public function getAttribution();

    /**
     * Executes the lookup of the IP address.
     */
    abstract protected function lookup();

    /**
     * AbstractLookup constructor.
     *
     * @param null \$auth
     * @param null \$ipLookupConfig
     * @param null \$cacheDir
     */
    public function __construct(\$auth = null, \$ipLookupConfig = null, \$cacheDir = null, ?LoggerInterface \$logger = null, ?Client \$client = null)
    {
        \$this->cacheDir  = \$cacheDir;
        \$this->logger    = \$logger;
        \$this->auth      = \$auth;
        \$this->config    = \$ipLookupConfig;
        \$this->client    = \$client;
    }

    /**
     * @param \$ip
     *
     * @return \$this
     */
    public function setIpAddress(\$ip)
    {
        \$this->ip = \$ip;

        // Fetch details from the service
        \$this->lookup();

        return \$this;
    }

    /**
     * Return details of the IP address lookup.
     *
     * @return array
     */
    public function getDetails()
    {
        return [
            'city'         => \$this->city,
            'region'       => \$this->region,
            'zipcode'      => \$this->zipcode,
            'country'      => \$this->country,
            'latitude'     => \$this->latitude,
            'longitude'    => \$this->longitude,
            'isp'          => \$this->isp,
            'organization' => \$this->organization,
            'timezone'     => \$this->timezone,
            'extra'        => \$this->extra,
        ];
    }
}
";
    }

    public function getTemplateName()
    {
        return "@bundles/CoreBundle/IpLookup/AbstractLookup.php";
    }

    public function getDebugInfo()
    {
        return array (  37 => 1,);
    }

    public function getSourceContext()
    {
        return new Source("", "@bundles/CoreBundle/IpLookup/AbstractLookup.php", "/var/www/mautic/app/bundles/CoreBundle/IpLookup/AbstractLookup.php");
    }
}
