<?php
namespace Claromentis\Core\Filesystem;

$GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"] ?: array()) + array("_f5ad9467044ee987f4107020fa" . "e2b92c" => base64_decode("bG9jYWxfZ" . "nM="), "_70979d287fa2c98d21" . "aa07834c259a52" => base64_decode("c3RydG9sb3" . "dlcg=="), "da" . "ta" => base64_decode("ZGF0" . "YQ=="), "_f365d394f839fddd4250d517" . "ee1ca5ea" => base64_decode("cHVibG" . "lj"), "_3debae79caaecf54bcb80157968" . "cd8c8" => base64_decode("ZGF0YV9" . "mcw=="), "_5d12fbd7bb86f9fced74c3523d44" . "298b" => base64_decode("Q0xBUk9fRlNf" . "UEFUSFM="), "_87daa84e346f6420a3f342" . "6e05d16a7b" => base64_decode("Lw=" . "="), "defau" . "lt" => base64_decode("ZGVmYX" . "VsdA=="), "_4d707fab93be" . "bb00bbe69e815" . "9697c90" => base64_decode(""), "_6c5696f4a432763c1c5" . "d62a48e35444e" => base64_decode("bG9jYWw" . "="), "_028a4f2789" . "aff049f5d72" . "f9d625a0c88" => base64_decode("cHVibG" . "ljX2Zz"));
use Claromentis\Core\Config\Config;
use League\Flysystem\AdapterInterface;




class SubdirectoryFactory
{
    
    
    
    
    
    
    protected FilesystemInterface $filesystem;
    
    
    
    
    
    
    protected ?array $paths;
    
    
    
    
    
    
    protected array $data_fs = [];
    
    
    
    
    
    
    protected array $local_fs = [];
    
    
    
    
    
    
    protected array $public_fs = [];
    
    
    
    
    
    
    
    public function __construct(Config $config, FilesystemInterface $_33eb931581b031fdb2a1937880fb89cd)
    {
        $this->filesystem = $_33eb931581b031fdb2a1937880fb89cd;
        $this->paths = $config[$GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_5d12fbd7bb" . "86f9fced74c" . "3523d44298b"]];
    }
    
    
    
    
    
    
    
    public function GetData(string $module = "") : FilesystemInterface
    {
        return $this->GetGeneric($module, $GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["_3debae79caaecf54bcb" . "80157968cd8c8"], $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["da" . "ta"], AdapterInterface::VISIBILITY_PRIVATE);
    }
    
    
    
    
    
    
    
    public function GetLocal(string $module = "") : FilesystemInterface
    {
        return $this->GetGeneric($module, $GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_f5ad9467044ee987f410702" . "0fae2b92c"], $GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_6c5696f4a4" . "32763c1c5d6" . "2a48e35444e"], AdapterInterface::VISIBILITY_PRIVATE);
    }
    
    
    
    
    
    
    
    
    
    
    
    public function GetPublic(string $module = "") : FilesystemInterface
    {
        return $this->GetGeneric($module, $GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_028a4f2789aff049f" . "5d72f9d625a0c88"], $GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_f365d394f8" . "39fddd4250d" . "517ee1ca5ea"], AdapterInterface::VISIBILITY_PUBLIC);
    }
    
    
    
    
    
    
    
    
    
    
    protected function GetGeneric(string $module, string $_c241f11ec2591cc626823468234ffaf4, string $type, string $_e46a1b6a2fd927d616377ae17620d766) : FilesystemInterface
    {
        if ($module === $GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_4d707fab" . "93bebb00b" . "be69e8159" . "697c90"]) {
            $module = $GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["defau" . "lt"];
        }
        $module = $GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_70979d287fa2c98d21aa07834c259" . "a52"]($module);
        if (!isset($this->{$_c241f11ec2591cc626823468234ffaf4}[$module])) {
            $path = $this->paths[$module][$type] ?? $this->paths[$GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["def" . "aul" . "t"]][$type];
            if ($module !== $GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["defaul" . "t"]) {
                $path .= $GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_87daa84e34" . "6f6420a3f34" . "26e05d16a7b"] . $module;
            }
            $this->{$_c241f11ec2591cc626823468234ffaf4}[$module] = new SubdirectoryFilesystem($this->filesystem, $path, $_e46a1b6a2fd927d616377ae17620d766);
        }
        return $this->{$_c241f11ec2591cc626823468234ffaf4}[$module];
    }
}