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

$GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"] ?: array()) + array("_b1a3fa0c63e64bbaeaee" . "5297d4d7715f" => base64_decode("ZGF0YS9haS9tb2R1bGVzLw=" . "="), "_969f86ee5d83b38875e46c" . "a1ba755446" => base64_decode("Lmpzb2" . "4="), "_7681c2a2b7e1bdf69" . "c23c6cd64114ad3" => base64_decode("anNvb" . "l9kZW" . "NvZGU" . "="), "_d2c06c4cf8a9682c75" . "6442538657aa7e" => base64_decode("cHJvbXB0cw=" . "="), "_7aefd48" . "2de7885f" . "4293c292" . "6df28c23" . "5" => base64_decode("anNvbl9lbmNvZ" . "GU="));
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["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_7aefd482" . "de7885f42" . "93c2926df" . "28c235"]($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["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["_d2c06c4cf8a9682c756" . "442538657aa7e"] => []];
            }
            return $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_7681c2a2b7e1bdf" . "69c23c6cd64114ad" . "3"]($data, true);
        } catch (Throwable $_fe441aa3ef350bfb1a1a1ad8520dd530) {
            return [$GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_d2c06c4cf8a9682c756442538" . "657aa7e"] => []];
        }
    }
    
    
    
    
    
    
    
    private function getPath(string $module) : string
    {
        return $GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_b1a3fa0c63e64bbaeaee5297d4d7715" . "f"] . $module . $GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_969f86ee5d83b38875e4" . "6ca1ba755446"];
    }
}