<?php
namespace Components\Data\Live;

use Components\Data\Contracts\ConfigStoreProvider;

class LiveConfigStoreProvider implements ConfigStoreProvider
{
    protected LiveLegacyConfigStoreProvider $legacy;
    protected LiveBeezUIConfigStoreProvider $beezui;

    public function __construct()
    {
        $this->legacy = new LiveLegacyConfigStoreProvider();
        $this->beezui = new LiveBeezUIConfigStoreProvider();
    }

    public function getAllConfigs(): array
    {
        return $this->legacy->getAllConfigs();
    }

    public function getModuleConfig(string $module): array
    {
        return $this->legacy->getModuleConfig($module);
    }

    public function setModuleConfig(string $module, array $values, bool $processOnlyGivenFields = false): void
    {
        $this->legacy->setModuleConfig($module, $values, $processOnlyGivenFields);
    }

    public function getAllStatuses(): array
    {
        return $this->legacy->getAllStatuses();
    }

    public function isModuleOn(string $module): bool
    {
        return $this->legacy->isModuleOn($module);
    }

    public function setModuleStatus(string $module, bool $on): void
    {
        $this->legacy->setModuleStatus($module, $on);
    }

    public function getUiOpenMap(): array
    {
        return $this->beezui->getUiOpenMap();
    }

    public function setUiOpenState(string $module, bool $open): void
    {
        $this->beezui->setUiOpenState($module, $open);
    }

    public function getDismissedNotifications(): array
    {
        return $this->beezui->getDismissedNotifications();
    }

    public function setNotificationDismissed(string $id, bool $dismissed): void
    {
        $this->beezui->setNotificationDismissed($id, $dismissed);
    }

    public function listKeys(string $module): array
    {
        return $this->legacy->listKeys($module);
    }

    public function isConfigured(string $module): bool
    {
        return $this->beezui->isConfigured($module);
    }

    public function setConfigured(string $module): void
    {
        $this->beezui->setConfigured($module);
    }

    public function clearConfigured(string $module): void
    {
        $this->beezui->clearConfigured($module);
    }

    public function getNewsletterUiState(): array
    {
        return $this->beezui->getNewsletterUiState();
    }

    public function setNewsletterUiState(array $patch): void
    {
        $this->beezui->setNewsletterUiState($patch);
    }
}
