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

$GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"] ?: array()) + array("_7681c2a2b7e1b" . "df69c23c6cd641" . "14ad3" => base64_decode("anNvbl9kZWNvZGU" . "="), "_d2c06c4c" . "f8a9682c7" . "564425386" . "57aa7e" => base64_decode("cHJv" . "bXB0" . "cw=="), "_b1a3fa0c63e64bbaeaee5" . "297d4d7715f" => base64_decode("ZGF0YS9haS9" . "tb2R1bGVzLw" . "=="), "_7aefd482de7885f4293c2926df28c" . "235" => base64_decode("anNvbl9l" . "bmNvZGU="), "_969f86ee" . "5d83b3887" . "5e46ca1ba" . "755446" => base64_decode("Lmpzb" . "24="));
use Claromentis\Core\Filesystem\FilesystemInterface;
use Throwable;
class CustomPromptRepository
{
    public const MAX_INSTRUCTIONS = 40;
    private FilesystemInterface $filesystem;
    
    
    
    
    
    
    public function __construct(FilesystemInterface $_33eb931581b031fdb2a1937880fb89cd)
    {
        $this->filesystem = $_33eb931581b031fdb2a1937880fb89cd;
    }
    
    
    
    
    
    
    
    
    public function save(string $module, array $data) : void
    {
        $_82a65eef3d03e3f61aac05df4e052c1f = $this->getPath($module);
        $data = $GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_7aefd482de7885f4293c2926" . "df28c235"]($data);
        if ($this->filesystem->Exists($_82a65eef3d03e3f61aac05df4e052c1f)) {
            $this->filesystem->Update($_82a65eef3d03e3f61aac05df4e052c1f, $data);
        } else {
            $this->filesystem->Write($_82a65eef3d03e3f61aac05df4e052c1f, $data);
        }
    }
    
    
    
    
    
    
    
    public function get(string $module) : array
    {
        try {
            $data = $this->filesystem->Read($this->getPath($module));
            if (empty($data)) {
                return [$GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_d2c06c4cf8a968" . "2c756442538657a" . "a7e"] => []];
            }
            return $GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_7681c2a2b7e1bd" . "f69c23c6cd64114" . "ad3"]($data, true);
        } catch (Throwable $_fe441aa3ef350bfb1a1a1ad8520dd530) {
            return [$GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_d2c06c4cf8a96" . "82c75644253865" . "7aa7e"] => []];
        }
    }
    
    
    
    
    
    
    
    private function getPath(string $module) : string
    {
        return $GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_b1a3fa0c63e64bb" . "aeaee5297d4d7715" . "f"] . $module . $GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_969f86ee5d83b38" . "875e46ca1ba75544" . "6"];
    }
}