<?php
namespace Claromentis\Menu\Infobar;

$GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"] = (@$GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"] ?: array()) + array("ur" . "l" => base64_decode("dX" . "Js"), "_5e30c4717ced36cff9e93e19a5c576" . "cc" => base64_decode("aXNfc3R" . "yaW5n"), "t" . "y" . "p" . "e" => base64_decode("dHl" . "wZQ" . "=="), "_35ed77ccccaf3a" . "056dcf16acae33b" . "be0" => base64_decode("Y2" . "xh" . "c3" . "M="));
use Claromentis\Core\Icon;
use Claromentis\Core\Icon\IconFactory;
use Claromentis\Core\Icon\IconInterface;
class MenuItemFactory
{
    public const DEFAULT_APP_ICON_URL = MenuItemApplication::DEFAULT_APP_ICON_URL;
    private IconFactory $iconFactory;
    public function __construct(IconFactory $iconFactory)
    {
        $this->iconFactory = $iconFactory;
    }
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    public function createApplication(string $_804150bb24b8f0ebcc9d2f995b7dc305, string $title, string $url, int $menu = InfobarMenuType::APPLICATIONS, bool $_cb3f1fcff8b93b4b750668c9e4157d3c = false, bool $_fd02c7e3d45300b40c3d9698e7b27faf = false, ?int $id = null, ?int $_b10738fc3d0ad3749dcc6ba41d7d616d = null, ?array $_ba5c52e046c89bf348117edd64933320 = null) : MenuItemApplication
    {
        $_aad576a27d4270db0bcce79b5b765b54 = $this->createIconFromArray($_ba5c52e046c89bf348117edd64933320);
        if ($_aad576a27d4270db0bcce79b5b765b54 === null) {
            $_aad576a27d4270db0bcce79b5b765b54 = $this->createDefaultApplicationIcon();
        }
        $_f44467aacb8a4520c7382769d24aa422 = new MenuItemApplication($_804150bb24b8f0ebcc9d2f995b7dc305, $title, $url, $menu, $_cb3f1fcff8b93b4b750668c9e4157d3c, $_fd02c7e3d45300b40c3d9698e7b27faf);
        $_f44467aacb8a4520c7382769d24aa422->setId($id);
        $_f44467aacb8a4520c7382769d24aa422->setDisplayOrder($_b10738fc3d0ad3749dcc6ba41d7d616d);
        $_f44467aacb8a4520c7382769d24aa422->setIcon($_aad576a27d4270db0bcce79b5b765b54);
        return $_f44467aacb8a4520c7382769d24aa422;
    }
    
    
    
    
    
    
    
    
    
    public function createDivider(int $menu, ?int $id = null, ?int $_b10738fc3d0ad3749dcc6ba41d7d616d = null) : MenuItemDivider
    {
        $_954f14aba204c4076de6dae38c5624c5 = new MenuItemDivider($menu);
        $_954f14aba204c4076de6dae38c5624c5->setId($id);
        $_954f14aba204c4076de6dae38c5624c5->setDisplayOrder($_b10738fc3d0ad3749dcc6ba41d7d616d);
        return $_954f14aba204c4076de6dae38c5624c5;
    }
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    public function createLink(string $title, string $url, int $menu, bool $_cb3f1fcff8b93b4b750668c9e4157d3c = false, bool $_fd02c7e3d45300b40c3d9698e7b27faf = false, ?int $id = null, ?int $_b10738fc3d0ad3749dcc6ba41d7d616d = null, ?array $_ba5c52e046c89bf348117edd64933320 = null) : MenuItemLink
    {
        $_aad576a27d4270db0bcce79b5b765b54 = $this->createIconFromArray($_ba5c52e046c89bf348117edd64933320);
        $_7aa4f84623e5672a3e88ceb3ff2f2ac2 = new MenuItemLink($title, $url, $menu, $_cb3f1fcff8b93b4b750668c9e4157d3c, $_fd02c7e3d45300b40c3d9698e7b27faf);
        $_7aa4f84623e5672a3e88ceb3ff2f2ac2->setId($id);
        $_7aa4f84623e5672a3e88ceb3ff2f2ac2->setDisplayOrder($_b10738fc3d0ad3749dcc6ba41d7d616d);
        $_7aa4f84623e5672a3e88ceb3ff2f2ac2->setIcon($_aad576a27d4270db0bcce79b5b765b54);
        return $_7aa4f84623e5672a3e88ceb3ff2f2ac2;
    }
    public function createDefaultApplicationIcon() : IconInterface
    {
        return $this->iconFactory->createSvg(self::DEFAULT_APP_ICON_URL);
    }
    
    
    
    
    
    
    
    
    
    private function createIconFromArray(?array $_ba5c52e046c89bf348117edd64933320) : ?IconInterface
    {
        if (isset($_ba5c52e046c89bf348117edd64933320[$GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["t" . "y" . "p" . "e"]]) && $_ba5c52e046c89bf348117edd64933320[$GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["typ" . "e"]] === Icon\Types::SVG && isset($_ba5c52e046c89bf348117edd64933320[$GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["ur" . "l"]]) && $GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_5e30c4717ced36cff9e93e19a" . "5c576cc"]($_ba5c52e046c89bf348117edd64933320[$GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["u" . "r" . "l"]])) {
            return $this->iconFactory->createSvg($_ba5c52e046c89bf348117edd64933320[$GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["ur" . "l"]]);
        } elseif (isset($_ba5c52e046c89bf348117edd64933320[$GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["t" . "y" . "p" . "e"]]) && $_ba5c52e046c89bf348117edd64933320[$GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["t" . "y" . "p" . "e"]] === Icon\Types::GLYPHICON && isset($_ba5c52e046c89bf348117edd64933320[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_35ed77ccccaf3a056dcf16ac" . "ae33bbe0"]]) && $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_5e30c4717ced36cff9e93e19a5c57" . "6cc"]($_ba5c52e046c89bf348117edd64933320[$GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_35ed77ccccaf3a056dcf" . "16acae33bbe0"]])) {
            return $this->iconFactory->createGlyphicon($_ba5c52e046c89bf348117edd64933320[$GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_35ed77cccca" . "f3a056dcf16a" . "cae33bbe0"]]);
        } else {
            return null;
        }
    }
}