import { transformFormValuesToEntityPermissionPolicies } from "./transformFormValuesToEntityPermissionPolicies";
/**
 * @private
 * Transforms an IHubChannelEditor object to a partial IHubChannel object
 * @param editor an IHubChannelEditor object
 * @returns a partial IHubChannel object
 */
export function transformEditorToEntity(editor) {
    // combine permissions
    const permissionValues = [
        ...editor.publicConfigs,
        ...editor.orgConfigs,
        ...editor.groupConfigs,
        ...editor.userConfigs,
    ];
    return {
        name: editor.name,
        blockWords: editor.blockWords.split(",").map((val) => val.trim()),
        allowAsAnonymous: editor.allowAsAnonymous,
        permissions: transformFormValuesToEntityPermissionPolicies(permissionValues),
    };
}
//# sourceMappingURL=transformEditorToEntity.js.map