<?php
namespace Claromentis\Core\Ai\Tools;

$GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"] ?: array()) + array("_0c519e721cc3079fbb252fbd60fd" . "7904" => base64_decode("dG" . "lt" . "ZQ" . "=="), "_688e8aa058a03eb9e9769da7" . "19316557" => base64_decode("WS1t" . "LWQg" . "SDpp" . "OnM="), "_600b2f640f54132db595b" . "b60f15e0676" => base64_decode("WS1tLWQ" . "="), "_730c8fb144637eb321e79f0605f79" . "b4a" => base64_decode("CgktIEN1cnJlbnQgVW5peCBUaW1lc3RhbXA6IA=" . "="), "_7292a62b64774bf" . "aa76bdb9c5f6026f" . "f" => base64_decode("LgoJSWYgYSB1c2VyIGRvZXNuJ3QgcHJv" . "dmlkZSBhIHN0YXJ0IGRhdGUgb3IgZW5k" . "IGRhdGUsIGdyYWIgZXZlbnRzIGZvciB0" . "aGlzIHdlZWsu"), "_294579c234bf400" . "23d4525f0f32b7cc" . "a" => base64_decode("VGhlIGVuZCBvZiB0aGUgZGF0ZSByYW5nZSAoVW5p" . "eCB0aW1lc3RhbXAsIFVUQyku"), "_8baf6ac4d" . "c0b89cfa6a" . "5abea49db1" . "f56" => base64_decode("VGhlIGJlZ2lubmluZyBvZiB0aGUgZGF0ZSByYW5nZSAoVW5peC" . "B0aW1lc3RhbXAsIFVUQyku"), "_e258c5dc522b65a06457" . "11c5089a8e9c" => base64_decode("aXRlbX" . "M="), "_a92c6398f0b00d" . "eb3ab06f71879f7" . "545" => base64_decode("c3Rhcn" . "REYXRl"), "_da0554e7f6694" . "2dcfb6ce9b5613" . "1f140" => base64_decode("Y2FsZW5kYX" . "I="), "_f53ea64d" . "23c54c316" . "bfd8fc86a" . "6635c7" => base64_decode("CgoJVXNlIHRoaXMgd2hlbmV2ZXIgYSB1c2VyIGFza3MgYWJvdXQgdGhlaXIgc2NoZWR1bGUsIHVwY29taW5nIG1lZXRpbmdzLCBvciBjb21wYW55I" . "GhvbGlkYXlzLgoJSWYgYSB1c2VyIGFza3MgZm9yICJ0b2RheSIsIHVzZSB0aGUgcmFuZ2UgZnJvbSB0aGUgc3RhcnQgdG8gdGhlIGVuZCBvZiA="), "_f26a578" . "35a79e37" . "dde9c180" . "d23863a6" . "1" => base64_decode("CVVzZSB0aGlzIHRvb2wgdG8gcmV0cmlldmUgZXZlbnRzIGZyb20gdGhlIHVzZXIncyBwZXJzb25hbCBhbmQgY29tcGFueS13aWRlIGNhbGVuZGFycy4KCUl0IHJldHVybnMgYWxsIGV2ZW50cyB0aGUgdXNlciBoYXMgcGVybWlzc2lvbiB0byB2aWV3IHdpdGhpbiBhIHNwZWNpZmljIGRhdGUgcmFuZ" . "2UuCgoJQ1JJVElDQUwgQ09OVEVYVDoKCS0gVG9kYXkncyBEYXRlOiA="), "_aaabebe7ea4dcd" . "24a8e6b36cfe511" . "422" => base64_decode("VVR" . "D"), "_9e0a9446602" . "a728eddf64b2" . "3af901ea0" => base64_decode("ZW5kRGF0" . "ZQ=="));
use Claromentis\Calendar\Format\EventFormatter;
use Claromentis\Core\Ai\AiParameterType;
use Claromentis\Core\Security\SecurityContext;
use Claromentis\Core\Services;
use Date;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
class AiCalendarTool implements AiToolInterface
{
    private EventFormatter $eventFormatter;
    private SecurityContext $context;
    private SessionInterface $session;
    public function __construct(EventFormatter $_d972de905a99bbc1a92c54b3669721fd, SecurityContext $context, SessionInterface $session)
    {
        $this->eventFormatter = $_d972de905a99bbc1a92c54b3669721fd;
        $this->context = $context;
        $this->session = $session;
    }
    public function getName() : string
    {
        return $GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_da0554e7f66942dcfb6ce9b5" . "6131f140"];
    }
    public function getDescription() : string
    {
        $_d230962d9a57dc6ba2b774d9ba3bb81e = $GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_0c519e721" . "cc3079fbb2" . "52fbd60fd7" . "904"]();
        $_5109895e3895ae9217ef168ea501d540 = (new Date())->format($GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_600b2f640f54132db595bb60f1" . "5e0676"]);
        return $GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_f26a57835a79e" . "37dde9c180d238" . "63a61"] . $_5109895e3895ae9217ef168ea501d540 . $GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_730c8fb144637eb" . "321e79f0605f79b4" . "a"] . $_d230962d9a57dc6ba2b774d9ba3bb81e . $GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_f53ea64d23c54c316bfd8fc86a66" . "35c7"] . $_5109895e3895ae9217ef168ea501d540 . $GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_7292a62b64774bfaa76" . "bdb9c5f6026ff"];
    }
    public function execute(array $args) : array
    {
        $_a92c6398f0b00deb3ab06f71879f7545 = $args[$GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_a92c6398f0b00deb3ab06f71879" . "f7545"]] ?? null;
        $_9e0a9446602a728eddf64b23af901ea0 = $args[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_9e0a9446602a728eddf64b" . "23af901ea0"]] ?? null;
        if (!$_a92c6398f0b00deb3ab06f71879f7545 || !$_9e0a9446602a728eddf64b23af901ea0) {
            return [];
        }
        $_8db463fd8f9544f55010b1bff82e94e0 = new Date($_a92c6398f0b00deb3ab06f71879f7545, new \DateTimeZone($GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_aaabebe7ea4dcd24a8e6b3" . "6cfe511422"]));
        $_ae6873e9422266b5de41a2f3ce905828 = new Date($_9e0a9446602a728eddf64b23af901ea0, new \DateTimeZone($GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_aaabebe7ea4dcd24a8e6b3" . "6cfe511422"]));
        $_ccd9e402149a4aff4a20de187781aa41 = new Date($_8db463fd8f9544f55010b1bff82e94e0->format($GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_688e8aa0" . "58a03eb9e" . "9769da719" . "316557"]));
        $_ef3a72fcbe857b2afe45cb9d8cafb253 = new Date($_ae6873e9422266b5de41a2f3ce905828->format($GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["_688e8aa058a0" . "3eb9e9769da71" . "9316557"]));
        
        
        $_00ab16f2e73c61c756f79df3d6248d77 = Services::I()->{$GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_da0554e7f66942dcfb6ce" . "9b56131f140"]};
        $_6a1345c96c7a9979e3216247935fd6b5 = $_00ab16f2e73c61c756f79df3d6248d77->GetEventsInSessionCalendars($_ccd9e402149a4aff4a20de187781aa41, $_ef3a72fcbe857b2afe45cb9d8cafb253, $this->session);
        $_cf2fc9dc06b97e9dba337d5a2c54fe58 = $_00ab16f2e73c61c756f79df3d6248d77->GetCalendars();
        $_e258c5dc522b65a0645711c5089a8e9c = $this->eventFormatter->FormatEvents($_6a1345c96c7a9979e3216247935fd6b5, $_cf2fc9dc06b97e9dba337d5a2c54fe58, $this->context->GetUserId());
        return [$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_e258c5dc522b65a06457" . "11c5089a8e9c"] => $_e258c5dc522b65a0645711c5089a8e9c];
    }
    public function getSchema() : AiToolSchemaBuilder
    {
        return AiToolSchemaBuilder::create()->add($GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_a92c6398f0b00deb3ab06f71879" . "f7545"], AiParameterType::INTEGER, function (AiParameterDefinition $_c0c7604e8f38a81e52a6dff0e7e70d31) {
            $_c0c7604e8f38a81e52a6dff0e7e70d31->description($GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_8baf6ac4dc0b89cfa6a5abe" . "a49db1f56"]);
            $_c0c7604e8f38a81e52a6dff0e7e70d31->required(true);
        })->add($GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_9e0a9446602a72" . "8eddf64b23af901" . "ea0"], AiParameterType::INTEGER, function (AiParameterDefinition $_c0c7604e8f38a81e52a6dff0e7e70d31) {
            $_c0c7604e8f38a81e52a6dff0e7e70d31->description($GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_294579c234bf40023d4525" . "f0f32b7cca"]);
            $_c0c7604e8f38a81e52a6dff0e7e70d31->required(true);
        });
    }
}