import { connectConfig } from "@powerhousedao/connect/config";
import { debugNodeOptions, defaultDriveOptions, defaultNodeOptions, } from "@powerhousedao/design-system/connect";
// Enables debug options for the drive
const connectDebug = localStorage.getItem("CONNECT_DEBUG") === "true";
const DriveSections = [
    { sharingType: "PUBLIC", label: "Public Drives" },
    { sharingType: "CLOUD", label: "Secure Cloud Drives" },
    { sharingType: "LOCAL", label: "My Local Drives" },
];
const getSectionConfig = (sharingType) => {
    return connectConfig.drives.sections[sharingType];
};
export function getDriveNodeOptions(sharingType) {
    const options = [...defaultDriveOptions];
    if (connectConfig.drives.sections[sharingType].allowDelete) {
        options.push("DELETE");
    }
    if (connectDebug) {
        options.push(...debugNodeOptions);
    }
    return options;
}
export function getFileNodeOptions() {
    const options = [...defaultNodeOptions];
    if (connectDebug) {
        options.push(...debugNodeOptions);
    }
    return options;
}
export function getFolderNodeOptions() {
    const options = [...defaultNodeOptions];
    if (connectDebug) {
        options.push(...debugNodeOptions);
    }
    return options;
}
export function getNodeOptions() {
    return {
        LOCAL: {
            DRIVE: getDriveNodeOptions("LOCAL"),
            FOLDER: getFolderNodeOptions(),
            FILE: getFileNodeOptions(),
        },
        CLOUD: {
            DRIVE: getDriveNodeOptions("CLOUD"),
            FOLDER: getFolderNodeOptions(),
            FILE: getFileNodeOptions(),
        },
        PUBLIC: {
            DRIVE: getDriveNodeOptions("PUBLIC"),
            FOLDER: getFolderNodeOptions(),
            FILE: getFileNodeOptions(),
        },
    };
}
export const driveSections = DriveSections.filter((section) => getSectionConfig(section.sharingType).enabled).map((section) => {
    const sectionConfig = getSectionConfig(section.sharingType);
    return {
        ...section,
        disableAddDrives: !sectionConfig.allowAdd,
    };
});
//# sourceMappingURL=drive-sections.js.map