import { AXMEntityCrudServiceImpl, entityMasterCrudActions, entityMasterRecordActions, AXPEntityService, AXP_ENTITY_CONFIG_TOKEN, AXP_ENTITY_DEFINITION_LOADER } from '@acorex/platform/layout/entity';
import * as i0 from '@angular/core';
import { Injectable, NgModule, inject, Injector } from '@angular/core';
import { CommonModule } from '@angular/common';
import { AXPSessionService, AXPAuthGuard } from '@acorex/platform/auth';
import { createAllQueryView, AXPEntityQueryType, AXP_SETTING_DEFINITION_PROVIDER, AXP_MENU_PROVIDER, AXP_HOME_PAGES } from '@acorex/platform/common';
import { ROUTES } from '@angular/router';
import { AXDataSource } from '@acorex/cdk/common';
import { AXPWidgetsCatalog } from '@acorex/platform/layout/widget-core';
import { AXPWidgetsList } from '@acorex/modules/common';
import { firstValueFrom } from 'rxjs';
import { AXP_DATASOURCE_DEFINITION_PROVIDER } from '@acorex/platform/core';

const config = {
    i18n: 'organization-management',
    module: 'OrganizationManagement',
};
const RootConfig = {
    config,
    module: {
        route: 'organization-management',
        name: config.module,
        title: `t('module-name', {scope:"${config.i18n}"})`,
        icon: 'fa-light fa-sitemap',
    },
    entities: {
        responsibility: {
            name: 'Responsibility',
            title: `t("responsibility", { scope: "${config.i18n}" })`,
            source: `${config.module}.Responsibility`,
            icon: 'fa-light fa-tasks',
        },
        role: {
            name: 'Role',
            title: `t("role.individual-title",{scope:"${config.i18n}"})`,
            source: `${config.module}.Role`,
            icon: 'fa-light fa-user-tie',
        },
        company: {
            name: 'Company',
            source: `${config.module}.Company`,
            title: `t("company.individual-title", {scope:"${config.i18n}"})`,
            icon: 'fa-light fa-building',
        },
        team: {
            name: 'Team',
            source: `${config.module}.Team`,
            title: `t("team.individual-title",{scope:"${config.i18n}"})`,
            icon: 'fa-light fa-people-group',
        },
        position: {
            name: 'Position',
            source: `${config.module}.Position`,
            title: `t("position.individual-title",{scope:"${config.i18n}"})`,
            icon: 'fa-light fa-briefcase',
        },
        businessUnitType: {
            name: 'BusinessUnitType',
            source: `${config.module}.BusinessUnitType`,
            title: `t("business-unit-type.individual-title",{scope:"${config.i18n}"})`,
            icon: 'fa-light fa-tag',
        },
        businessUnit: {
            name: 'BusinessUnit',
            source: `${config.module}.BusinessUnit`,
            title: `t("business-unit.individual-title",{scope:"${config.i18n}"})`,
            icon: 'fa-light fa-sitemap',
        },
        structure: {
            name: 'ChartStructure',
            source: `${config.module}.ChartStructure`,
            title: `t("chart-configuration.page-title",{scope:"${config.i18n}"})`,
            menu: {
                title: `t("chart-configuration.menu-title",{scope:"${config.i18n}"})`,
            },
            icon: 'fa-light fa-gear',
        },
        chart: {
            name: 'Chart',
            source: `${config.module}.Chart`,
            title: `t("chart.page-title",{scope:"${config.i18n}"})`,
            menu: {
                title: `t("chart.menu-title",{scope:"${config.i18n}"})`,
            },
            icon: 'fa-light fa-chart-diagram',
        },
    },
};

class AXMOrganizationManagementChartEntityService extends AXMEntityCrudServiceImpl {
}
class AXMOrganizationManagementChartEntityServiceImpl extends AXMOrganizationManagementChartEntityService {
    constructor() {
        super(`${RootConfig.module.name}.${RootConfig.entities.chart.name}`);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementChartEntityServiceImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementChartEntityServiceImpl }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementChartEntityServiceImpl, decorators: [{
            type: Injectable
        }], ctorParameters: () => [] });

class AXMOrganizationManagementChartEntityModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementChartEntityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementChartEntityModule }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementChartEntityModule, providers: [
            {
                provide: AXMOrganizationManagementChartEntityService,
                useClass: AXMOrganizationManagementChartEntityServiceImpl,
            },
        ] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementChartEntityModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [],
                    exports: [],
                    declarations: [],
                    providers: [
                        {
                            provide: AXMOrganizationManagementChartEntityService,
                            useClass: AXMOrganizationManagementChartEntityServiceImpl,
                        },
                    ],
                }]
        }] });

class AXMOrganizationManagementCompanyEntityService extends AXMEntityCrudServiceImpl {
}
class AXMOrganizationManagementCompanyEntityServiceImpl extends AXMOrganizationManagementCompanyEntityService {
    constructor() {
        super(`${RootConfig.module.name}.${RootConfig.entities.company.name}`);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementCompanyEntityServiceImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementCompanyEntityServiceImpl }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementCompanyEntityServiceImpl, decorators: [{
            type: Injectable
        }], ctorParameters: () => [] });

class AXMOrganizationManagementCompanyEntityModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementCompanyEntityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementCompanyEntityModule }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementCompanyEntityModule, providers: [
            {
                provide: AXMOrganizationManagementCompanyEntityService,
                useClass: AXMOrganizationManagementCompanyEntityServiceImpl,
            },
        ] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementCompanyEntityModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [],
                    exports: [],
                    declarations: [],
                    providers: [
                        {
                            provide: AXMOrganizationManagementCompanyEntityService,
                            useClass: AXMOrganizationManagementCompanyEntityServiceImpl,
                        },
                    ],
                }]
        }] });

class AXMOrganizationManagementPositionEntityService extends AXMEntityCrudServiceImpl {
}
class AXMOrganizationManagementPositionEntityServiceImpl extends AXMOrganizationManagementPositionEntityService {
    constructor() {
        super(`${RootConfig.module.name}.${RootConfig.entities.position.name}`);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementPositionEntityServiceImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementPositionEntityServiceImpl }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementPositionEntityServiceImpl, decorators: [{
            type: Injectable
        }], ctorParameters: () => [] });

class AXMOrganizationManagementPositionEntityModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementPositionEntityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementPositionEntityModule }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementPositionEntityModule, providers: [
            {
                provide: AXMOrganizationManagementPositionEntityService,
                useClass: AXMOrganizationManagementPositionEntityServiceImpl,
            },
        ] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementPositionEntityModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [],
                    exports: [],
                    declarations: [],
                    providers: [
                        {
                            provide: AXMOrganizationManagementPositionEntityService,
                            useClass: AXMOrganizationManagementPositionEntityServiceImpl,
                        },
                    ],
                }]
        }] });

class AXMOrganizationManagementRoleEntityService extends AXMEntityCrudServiceImpl {
}
class AXMOrganizationManagementRoleEntityServiceImpl extends AXMOrganizationManagementRoleEntityService {
    constructor() {
        super(`${RootConfig.module.name}.${RootConfig.entities.role.name}`);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementRoleEntityServiceImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementRoleEntityServiceImpl }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementRoleEntityServiceImpl, decorators: [{
            type: Injectable
        }], ctorParameters: () => [] });

class AXMOrganizationManagementRoleEntityModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementRoleEntityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementRoleEntityModule }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementRoleEntityModule, providers: [
            {
                provide: AXMOrganizationManagementRoleEntityService,
                useClass: AXMOrganizationManagementRoleEntityServiceImpl,
            },
        ] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementRoleEntityModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [],
                    exports: [],
                    declarations: [],
                    providers: [
                        {
                            provide: AXMOrganizationManagementRoleEntityService,
                            useClass: AXMOrganizationManagementRoleEntityServiceImpl,
                        },
                    ],
                }]
        }] });

class AXMOrganizationManagementTeamEntityService extends AXMEntityCrudServiceImpl {
}
class AXMOrganizationManagementTeamEntityServiceImpl extends AXMOrganizationManagementTeamEntityService {
    constructor() {
        super(`${RootConfig.module.name}.${RootConfig.entities.team.name}`);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementTeamEntityServiceImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementTeamEntityServiceImpl }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementTeamEntityServiceImpl, decorators: [{
            type: Injectable
        }], ctorParameters: () => [] });

class AXMOrganizationManagementTeamEntityModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementTeamEntityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementTeamEntityModule }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementTeamEntityModule, providers: [
            {
                provide: AXMOrganizationManagementTeamEntityService,
                useClass: AXMOrganizationManagementTeamEntityServiceImpl,
            },
        ] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementTeamEntityModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [],
                    exports: [],
                    declarations: [],
                    providers: [
                        {
                            provide: AXMOrganizationManagementTeamEntityService,
                            useClass: AXMOrganizationManagementTeamEntityServiceImpl,
                        },
                    ],
                }]
        }] });

class AXMOrganizationManagementBusinessUnitTypeEntityService extends AXMEntityCrudServiceImpl {
}
class AXMOrganizationManagementBusinessUnitTypeEntityServiceImpl extends AXMOrganizationManagementBusinessUnitTypeEntityService {
    constructor() {
        super(`${RootConfig.module.name}.${RootConfig.entities.businessUnitType.name}`);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementBusinessUnitTypeEntityServiceImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementBusinessUnitTypeEntityServiceImpl }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementBusinessUnitTypeEntityServiceImpl, decorators: [{
            type: Injectable
        }], ctorParameters: () => [] });

class AXMOrganizationManagementBusinessUnitTypeEntityModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementBusinessUnitTypeEntityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementBusinessUnitTypeEntityModule }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementBusinessUnitTypeEntityModule, providers: [
            {
                provide: AXMOrganizationManagementBusinessUnitTypeEntityService,
                useClass: AXMOrganizationManagementBusinessUnitTypeEntityServiceImpl,
            },
        ] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementBusinessUnitTypeEntityModule, decorators: [{
            type: NgModule,
            args: [{
                    providers: [
                        {
                            provide: AXMOrganizationManagementBusinessUnitTypeEntityService,
                            useClass: AXMOrganizationManagementBusinessUnitTypeEntityServiceImpl,
                        },
                    ],
                }]
        }] });

class AXMOrganizationManagementBusinessUnitEntityService extends AXMEntityCrudServiceImpl {
}
class AXMOrganizationManagementBusinessUnitEntityServiceImpl extends AXMOrganizationManagementBusinessUnitEntityService {
    constructor() {
        super(`${RootConfig.module.name}.${RootConfig.entities.businessUnit.name}`);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementBusinessUnitEntityServiceImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementBusinessUnitEntityServiceImpl }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementBusinessUnitEntityServiceImpl, decorators: [{
            type: Injectable
        }], ctorParameters: () => [] });

class AXMOrganizationManagementBusinessUnitEntityModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementBusinessUnitEntityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementBusinessUnitEntityModule }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementBusinessUnitEntityModule, providers: [
            {
                provide: AXMOrganizationManagementBusinessUnitEntityService,
                useClass: AXMOrganizationManagementBusinessUnitEntityServiceImpl,
            },
        ] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementBusinessUnitEntityModule, decorators: [{
            type: NgModule,
            args: [{
                    providers: [
                        {
                            provide: AXMOrganizationManagementBusinessUnitEntityService,
                            useClass: AXMOrganizationManagementBusinessUnitEntityServiceImpl,
                        },
                    ],
                }]
        }] });

class AXMOrganizationManagementResponsibilityEntityService extends AXMEntityCrudServiceImpl {
}
class AXMOrganizationManagementResponsibilityEntityServiceImpl extends AXMOrganizationManagementResponsibilityEntityService {
    constructor() {
        super(`${RootConfig.module.name}.${RootConfig.entities.responsibility.name}`);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementResponsibilityEntityServiceImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementResponsibilityEntityServiceImpl }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementResponsibilityEntityServiceImpl, decorators: [{
            type: Injectable
        }], ctorParameters: () => [] });

class AXMOrganizationManagementResponsibilityEntityModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementResponsibilityEntityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementResponsibilityEntityModule, imports: [CommonModule] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementResponsibilityEntityModule, providers: [
            {
                provide: AXMOrganizationManagementResponsibilityEntityService,
                useClass: AXMOrganizationManagementResponsibilityEntityServiceImpl,
            },
        ], imports: [CommonModule] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementResponsibilityEntityModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [],
                    imports: [CommonModule],
                    exports: [],
                    providers: [
                        {
                            provide: AXMOrganizationManagementResponsibilityEntityService,
                            useClass: AXMOrganizationManagementResponsibilityEntityServiceImpl,
                        },
                    ],
                }]
        }] });

var AXMOrgChartNodeType;
(function (AXMOrgChartNodeType) {
    AXMOrgChartNodeType["Company"] = "Company";
    AXMOrgChartNodeType["Country"] = "Country";
    AXMOrgChartNodeType["State"] = "State";
    AXMOrgChartNodeType["City"] = "City";
    AXMOrgChartNodeType["Division"] = "Division";
    AXMOrgChartNodeType["Department"] = "Department";
    AXMOrgChartNodeType["Branch"] = "Branch";
    AXMOrgChartNodeType["Position"] = "Position";
    AXMOrgChartNodeType["Employee"] = "Employee";
})(AXMOrgChartNodeType || (AXMOrgChartNodeType = {}));
// Minimal high-level categories for rendering/legend only
var AXMOrgChartCategory;
(function (AXMOrgChartCategory) {
    AXMOrgChartCategory["Company"] = "Company";
    AXMOrgChartCategory["Location"] = "Location";
    AXMOrgChartCategory["BusinessUnit"] = "BusinessUnit";
    AXMOrgChartCategory["Position"] = "Position";
    AXMOrgChartCategory["Employee"] = "Employee";
})(AXMOrgChartCategory || (AXMOrgChartCategory = {}));

class AXMOrganizationModuleEntityProvider {
    constructor() {
        this.injector = inject(Injector);
    }
    preload() {
        const module = RootConfig.module.name;
        return Array.from(Object.values(RootConfig.entities)).map((entity) => ({
            module: module,
            entity: entity.name,
        }));
    }
    async get(moduleName, entityName) {
        if (moduleName == RootConfig.module.name) {
            switch (entityName) {
                case RootConfig.entities.company.name:
                    return (await import('./acorex-modules-organization-management-company.entity-DqHYCbO8.mjs')).factory(this.injector);
                case RootConfig.entities.businessUnitType.name:
                    return (await Promise.resolve().then(function () { return businessUnitType_entity; })).factory(this.injector);
                case RootConfig.entities.businessUnit.name:
                    return (await Promise.resolve().then(function () { return businessUnit_entity; })).factory(this.injector);
                case RootConfig.entities.position.name:
                    return (await import('./acorex-modules-organization-management-position.entity-CcDgYX1A.mjs')).factory(this.injector);
                case RootConfig.entities.chart.name:
                    return (await import('./acorex-modules-organization-management-chart.entity-DUurUVX-.mjs')).factory(this.injector);
                case RootConfig.entities.team.name:
                    return (await import('./acorex-modules-organization-management-team.entity-p0nXmOOD.mjs')).factory(this.injector);
                case RootConfig.entities.role.name:
                    return (await import('./acorex-modules-organization-management-role.entity-Dp7i6gqU.mjs')).factory(this.injector);
                case RootConfig.entities.responsibility.name:
                    return (await import('./acorex-modules-organization-management-responsibility.entity-BNYJCYxF.mjs')).factory(this.injector);
            }
        }
        return null;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationModuleEntityProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationModuleEntityProvider }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationModuleEntityProvider, decorators: [{
            type: Injectable
        }] });

async function factory$1(injector) {
    const dataService = injector.get(AXMOrganizationManagementBusinessUnitEntityService);
    const i18n = RootConfig.config.i18n;
    const entityName = 'business-unit';
    const entityDef = {
        module: RootConfig.module.name,
        name: RootConfig.entities.businessUnit.name,
        title: '@organization-management:business-unit.individual-title',
        icon: 'fa-light fa-building-columns',
        parentKey: 'parentId',
        formats: {
            individual: '@organization-management:business-unit.individual-title',
            plural: '@organization-management:business-unit.plural-title',
            searchResult: { title: '{{ title }}', description: RootConfig.module.title },
        },
        plugins: [
            {
                name: 'computed-property',
                options: {
                    fields: [
                        {
                            name: 'manager',
                            title: '@general:terms.people.manager',
                            value: 'Static Manager Name',
                            group: { id: 'basic-info' },
                            showAs: { type: AXPWidgetsCatalog.text },
                        },
                    ],
                },
            },
        ],
        groups: [
            { id: 'basic-info', title: '@general:terms.interface.basic-info' },
            { id: 'relationInfo', title: '@organization-management:business-unit.relation-info' },
            { id: 'geographicInfo', title: '@location-management:location.geographic-details' },
        ],
        properties: [
            { name: 'id', title: 'ID', groupId: 'basic-info', schema: { dataType: 'uuid', hidden: true, nullable: false, readonly: true, unique: { enabled: true } } },
            { name: 'title', title: '@general:terms.common.title', groupId: 'basic-info', schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text } }, validations: [{ rule: 'required' }] },
            { name: 'description', title: '@general:terms.common.description', groupId: 'basic-info', schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.largeText } } },
            { name: 'typeId', title: '@general:terms.common.type', groupId: 'relationInfo', schema: { dataType: 'string', interface: { type: AXPWidgetsList.Editors.LookupBox, options: { entity: `${RootConfig.module.name}.BusinessUnitType`, textField: 'title', valueField: 'id', look: 'select', expose: [{ source: 'id', target: 'type.id' }, { source: 'code', target: 'type.code' }, { source: 'title', target: 'type.title' }, { source: 'isLocationBased', target: 'type.isLocationBased' }] } } }, validations: [{ rule: 'required' }] },
            { name: 'parentId', title: '@general:terms.classification.parent', groupId: 'relationInfo', schema: { dataType: 'string', interface: { type: AXPWidgetsList.Editors.LookupBox, options: { entity: `${RootConfig.module.name}.BusinessUnit`, textField: 'title', valueField: 'id', look: 'select', expose: [{ source: 'id', target: 'parent.id' }, { source: 'title', target: 'parent.title' }] } } } },
            { name: 'positionIds', title: '@general:terms.positions', groupId: 'relationInfo', schema: { dataType: 'string', interface: { type: AXPWidgetsList.Editors.LookupBox, options: { entity: `${RootConfig.module.name}.${RootConfig.entities.position.name}`, textField: 'title', valueField: 'id', look: 'select', multiple: true, expose: [{ source: 'id', target: 'positions.{id}' }, { source: 'title', target: 'positions.{title}' }] } } } },
            { name: 'countryId', title: '@location-management:location.country', groupId: 'geographicInfo', schema: { dataType: 'string', interface: { type: AXPWidgetsList.Editors.LookupBox, options: { entity: `LocationManagement.GeographicRegion`, textField: 'title', valueField: 'id', look: 'select', expose: [{ source: 'id', target: 'country.id' }, { source: 'title', target: 'country.title' }] } } } },
            { name: 'stateId', title: '@location-management:location.state', groupId: 'geographicInfo', schema: { dataType: 'string', interface: { type: AXPWidgetsList.Editors.LookupBox, options: { entity: `LocationManagement.GeographicRegion`, textField: 'title', valueField: 'id', look: 'select', expose: [{ source: 'id', target: 'state.id' }, { source: 'title', target: 'state.title' }], filter: { logic: 'and', filters: [{ field: 'parentId', operator: { type: 'equal' }, value: '{{ context.eval("countryId") }}' }, { field: 'type.code', operator: { type: 'equal' }, value: 'state' }] } }, triggers: [{ event: "{{ events.context('countryId') }}", action: `{{ widget.refresh() }}` }] } } },
            { name: 'cityId', title: '@location-management:location.city', groupId: 'geographicInfo', schema: { dataType: 'string', interface: { type: AXPWidgetsList.Editors.LookupBox, options: { entity: `LocationManagement.GeographicRegion`, textField: 'title', valueField: 'id', look: 'select', expose: [{ source: 'id', target: 'city.id' }, { source: 'title', target: 'city.title' }], filter: { logic: 'and', filters: [{ field: 'parentId', operator: { type: 'equal' }, value: '{{ context.eval("stateId") }}' }, { field: 'type.code', operator: { type: 'equal' }, value: 'city' }] } }, triggers: [{ event: "{{ events.context('stateId') }}", action: `{{ widget.refresh() }}` }] } } },
        ],
        columns: [
            { name: 'title' },
            { name: 'typeId', options: { dataPath: 'type.title' } },
            { name: 'countryId', options: { dataPath: 'country.title' } },
            { name: 'cityId', options: { dataPath: 'city.title' } },
            { name: 'stateId', options: { dataPath: 'state.title' } },
            { name: 'positionIds', options: { dataPath: 'positions.{title}' } },
        ],
        commands: {
            create: { execute: async (data) => ({ id: await dataService.insertOne(data) }) },
            delete: { execute: async (id) => await dataService.deleteOne(id) },
            update: { execute: async (data) => await dataService.updateOne(data.id, data) },
        },
        queries: {
            byKey: { execute: async (id) => await dataService.getOne(id), type: AXPEntityQueryType.Single },
            list: { execute: async (e) => await dataService.query(e), type: AXPEntityQueryType.List },
        },
        interfaces: {
            master: {
                create: {
                    sections: [
                        { id: 'basic-info' },
                        { id: 'relationInfo' },
                        { id: 'geographicInfo' },
                    ],
                    properties: [
                        { name: 'title', layout: { positions: { lg: { colSpan: 6 } } } },
                        { name: 'description', layout: { positions: { lg: { colSpan: 12 } } } },
                        { name: 'typeId', layout: { positions: { lg: { colSpan: 6 } } } },
                        { name: 'parentId', layout: { positions: { lg: { colSpan: 6 } } } },
                        { name: 'countryId', layout: { positions: { lg: { colSpan: 4 } } } },
                        { name: 'stateId', layout: { positions: { lg: { colSpan: 4 } } } },
                        { name: 'cityId', layout: { positions: { lg: { colSpan: 4 } } } },
                    ],
                },
                update: {
                    sections: [
                        { id: 'basic-info' },
                        { id: 'relationInfo' },
                        { id: 'geographicInfo' },
                    ],
                    properties: [
                        { name: 'title', layout: { positions: { lg: { colSpan: 6 } } } },
                        { name: 'description', layout: { positions: { lg: { colSpan: 12 } } } },
                        { name: 'typeId', layout: { positions: { lg: { colSpan: 6 } } } },
                        { name: 'parentId', layout: { positions: { lg: { colSpan: 6 } } } },
                        { name: 'countryId', layout: { positions: { lg: { colSpan: 4 } } } },
                        { name: 'stateId', layout: { positions: { lg: { colSpan: 4 } } } },
                        { name: 'cityId', layout: { positions: { lg: { colSpan: 4 } } } },
                    ],
                },
                single: {
                    title: '{{title}}',
                    sections: [
                        { id: 'basic-info' },
                        { id: 'relationInfo' },
                        { id: 'geographicInfo' },
                    ],
                    properties: [
                        { name: 'title', layout: { positions: { lg: { colSpan: 6 } } } },
                        { name: 'description', layout: { positions: { lg: { colSpan: 12 } } } },
                        { name: 'typeId', layout: { positions: { lg: { colSpan: 6 } } } },
                        { name: 'parentId', layout: { positions: { lg: { colSpan: 6 } } } },
                        { name: 'countryId', layout: { positions: { lg: { colSpan: 4 } } } },
                        { name: 'stateId', layout: { positions: { lg: { colSpan: 4 } } } },
                        { name: 'cityId', layout: { positions: { lg: { colSpan: 4 } } } },
                    ],
                    actions: [...entityMasterRecordActions()],
                },
                list: { actions: [...entityMasterCrudActions()], views: [createAllQueryView({ sorts: [{ name: 'title', dir: 'asc' }] })] },
            },
        },
    };
    return entityDef;
}

var businessUnit_entity = /*#__PURE__*/Object.freeze({
    __proto__: null,
    factory: factory$1
});

class AXMDepartmentDataSourceDefinition {
    constructor() {
        this.departmentService = inject(AXMOrganizationManagementBusinessUnitEntityService);
    }
    items() {
        return Promise.resolve([
            {
                name: 'departments',
                title: 'Departments',
                source: () => {
                    return new AXDataSource({
                        key: 'id',
                        load: async (_) => {
                            try {
                                const res = await this.departmentService.query();
                                return {
                                    items: res.items.map((item) => ({
                                        ...item,
                                    })),
                                    total: res.total,
                                };
                            }
                            catch (e) {
                                console.log(e);
                                throw e;
                            }
                        },
                        byKey: async (key) => {
                            return await this.departmentService.getOne(key);
                        },
                        pageSize: 100,
                    });
                },
                columns: [
                    {
                        name: 'id',
                        title: 'ID',
                        datatype: 'uuid',
                        type: AXPWidgetsCatalog.text,
                    },
                    {
                        name: 'title',
                        title: `Title`,
                        datatype: 'string',
                        type: AXPWidgetsCatalog.text,
                    },
                ],
                filters: [
                    {
                        field: 'title',
                        title: 'Title',
                        operator: {
                            type: 'equal',
                        },
                        widget: {
                            type: AXPWidgetsCatalog.text,
                        },
                        filterType: {
                            advance: true,
                            inline: true,
                        },
                    },
                ],
                textField: {
                    name: 'title',
                    title: 'Title',
                },
                valueField: {
                    name: 'id',
                    title: 'ID',
                },
            },
        ]);
    }
}

class AXMDivisionDataSourceDefinition {
    constructor() {
        this.divisionService = inject(AXMOrganizationManagementBusinessUnitEntityService);
    }
    items() {
        return Promise.resolve([
            {
                name: 'divisions',
                title: 'Divisions',
                source: () => {
                    return new AXDataSource({
                        key: 'id',
                        load: async (_) => {
                            try {
                                const res = await this.divisionService.query();
                                return {
                                    items: res.items.map((item) => ({
                                        ...item,
                                    })),
                                    total: res.total,
                                };
                            }
                            catch (e) {
                                console.log(e);
                                throw e;
                            }
                        },
                        byKey: async (key) => {
                            return await this.divisionService.getOne(key);
                        },
                        pageSize: 100,
                    });
                },
                columns: [
                    {
                        name: 'id',
                        title: 'ID',
                        datatype: 'uuid',
                        type: AXPWidgetsCatalog.text,
                    },
                    {
                        name: 'title',
                        title: 'Title',
                        datatype: 'string',
                        type: AXPWidgetsCatalog.text,
                    },
                    {
                        name: 'description',
                        title: 'Description',
                        datatype: 'string',
                        type: AXPWidgetsCatalog.text,
                    },
                ],
                filters: [
                    {
                        field: 'title',
                        title: 'Title',
                        operator: {
                            type: 'equal',
                        },
                        widget: {
                            type: AXPWidgetsCatalog.text,
                        },
                        filterType: {
                            advance: true,
                            inline: true,
                        },
                    },
                ],
                textField: {
                    name: 'title',
                    title: 'Title',
                },
                valueField: {
                    name: 'id',
                    title: 'ID',
                },
            },
        ]);
    }
}

class AXMRoleDataSourceDefinition {
    constructor() {
        this.roleService = inject(AXMOrganizationManagementRoleEntityService);
    }
    items() {
        return Promise.resolve([
            {
                name: 'roles',
                title: 'Roles',
                source: () => {
                    return new AXDataSource({
                        key: 'id',
                        load: async (_) => {
                            try {
                                const res = await this.roleService.query();
                                return {
                                    items: res.items.map((item) => ({
                                        ...item,
                                    })),
                                    total: res.total,
                                };
                            }
                            catch (e) {
                                console.log(e);
                                throw e;
                            }
                        },
                        byKey: async (key) => {
                            return await this.roleService.getOne(key);
                        },
                        pageSize: 100,
                    });
                },
                columns: [
                    {
                        name: 'id',
                        title: 'ID',
                        datatype: 'uuid',
                        type: AXPWidgetsCatalog.text,
                    },
                    {
                        name: 'title',
                        title: 'Title',
                        datatype: 'string',
                        type: AXPWidgetsCatalog.text,
                    },
                    {
                        name: 'description',
                        title: 'Description',
                        datatype: 'string',
                        type: AXPWidgetsCatalog.text,
                    },
                ],
                filters: [
                    {
                        field: 'title',
                        title: 'Title',
                        operator: {
                            type: 'equal',
                        },
                        widget: {
                            type: AXPWidgetsCatalog.text,
                        },
                        filterType: {
                            advance: true,
                            inline: true,
                        },
                    },
                ],
                textField: {
                    name: 'title',
                    title: 'Title',
                },
                valueField: {
                    name: 'id',
                    title: 'ID',
                },
            },
        ]);
    }
}

class AXMTeamDataSourceDefinition {
    constructor() {
        this.teamService = inject(AXMOrganizationManagementTeamEntityService);
    }
    items() {
        return Promise.resolve([
            {
                name: 'teams',
                title: 'Teams',
                source: () => {
                    return new AXDataSource({
                        key: 'id',
                        load: async (_) => {
                            try {
                                const res = await this.teamService.query();
                                return {
                                    items: res.items.map((item) => ({
                                        ...item,
                                    })),
                                    total: res.total,
                                };
                            }
                            catch (e) {
                                console.log(e);
                                throw e;
                            }
                        },
                        byKey: async (key) => {
                            return await this.teamService.getOne(key);
                        },
                        pageSize: 100,
                    });
                },
                columns: [
                    {
                        name: 'id',
                        title: 'ID',
                        datatype: 'uuid',
                        type: AXPWidgetsCatalog.text,
                    },
                    {
                        name: 'title',
                        title: 'Title',
                        datatype: 'string',
                        type: AXPWidgetsCatalog.text,
                    },
                    {
                        name: 'description',
                        title: 'Description',
                        datatype: 'string',
                        type: AXPWidgetsCatalog.text,
                    },
                ],
                filters: [
                    {
                        field: 'title',
                        title: 'Title',
                        operator: {
                            type: 'equal',
                        },
                        widget: {
                            type: AXPWidgetsCatalog.text,
                        },
                        filterType: {
                            advance: true,
                            inline: true,
                        },
                    },
                ],
                textField: {
                    name: 'title',
                    title: 'Title',
                },
                valueField: {
                    name: 'id',
                    title: 'ID',
                },
            },
        ]);
    }
}

class AXMPositionDataSourceDefinition {
    constructor() {
        this.positionService = inject(AXMOrganizationManagementPositionEntityService);
    }
    items() {
        return Promise.resolve([
            {
                name: 'positions',
                title: 'Positions',
                source: () => {
                    return new AXDataSource({
                        key: 'id',
                        load: async (_) => {
                            try {
                                const res = await this.positionService.query();
                                return {
                                    items: res.items.map((item) => ({
                                        ...item,
                                    })),
                                    total: res.total,
                                };
                            }
                            catch (e) {
                                console.log(e);
                                throw e;
                            }
                        },
                        byKey: async (key) => {
                            return await this.positionService.getOne(key);
                        },
                        pageSize: 100,
                    });
                },
                columns: [
                    {
                        name: 'id',
                        title: 'ID',
                        datatype: 'uuid',
                        type: AXPWidgetsCatalog.text,
                    },
                    {
                        name: 'title',
                        title: 'Title',
                        datatype: 'string',
                        type: AXPWidgetsCatalog.text,
                    },
                    {
                        name: 'description',
                        title: 'Description',
                        datatype: 'string',
                        type: AXPWidgetsCatalog.text,
                    },
                ],
                filters: [
                    {
                        field: 'title',
                        title: 'Title',
                        operator: {
                            type: 'equal',
                        },
                        widget: {
                            type: AXPWidgetsCatalog.text,
                        },
                        filterType: {
                            advance: true,
                            inline: true,
                        },
                    },
                ],
                textField: {
                    name: 'title',
                    title: 'Title',
                },
                valueField: {
                    name: 'id',
                    title: 'ID',
                },
            },
        ]);
    }
}

const AXPOrganizationManagementMenuKeys = {
    Root: 'organization-management:menu',
    Teams: 'organization-management:menu:teams',
    Positions: 'organization-management:menu:positions',
    Roles: 'organization-management:menu:roles',
    Responsibilities: 'organization-management:menu:responsibilities',
    BusinessUnits: 'organization-management:menu:business-units',
    BusinessUnitTypes: 'organization-management:menu:business-unit-types',
    OrganizationChart: 'organization-management:page:chart',
};

class AXMMenuProvider {
    constructor() {
        this.entityService = inject(AXPEntityService);
        this.sessionService = inject(AXPSessionService);
    }
    async provide(context) {
        const isAuthorized = await firstValueFrom(this.sessionService.isAuthorized$);
        if (!isAuthorized) {
            return;
        }
        const scope = RootConfig.config.i18n;
        const module = RootConfig.module;
        context.addItems([
            {
                name: AXPOrganizationManagementMenuKeys.Root,
                priority: 9000,
                text: `@${scope}:root-menu`,
                icon: module.icon,
                data: {
                    requiredPermission: 'admin',
                },
                children: [
                    {
                        name: AXPOrganizationManagementMenuKeys.Teams,
                        text: `@${scope}:team.plural-title`,
                        path: this.entityService.createPath(module.name, RootConfig.entities.team.name),
                        priority: 10,
                        icon: RootConfig.entities.team.icon,
                    },
                    {
                        name: AXPOrganizationManagementMenuKeys.Positions,
                        text: `@${scope}:position.plural-title`,
                        path: this.entityService.createPath(module.name, RootConfig.entities.position.name),
                        priority: 15,
                        icon: RootConfig.entities.position.icon,
                    },
                    {
                        name: AXPOrganizationManagementMenuKeys.Roles,
                        text: `@${scope}:role.plural-title`,
                        path: this.entityService.createPath(module.name, RootConfig.entities.role.name),
                        priority: 20,
                        icon: RootConfig.entities.role.icon,
                    },
                    {
                        name: AXPOrganizationManagementMenuKeys.Responsibilities,
                        text: `@${scope}:responsibility.plural-title`,
                        path: this.entityService.createPath(module.name, RootConfig.entities.responsibility.name),
                        priority: 25,
                        icon: RootConfig.entities.responsibility.icon,
                    },
                    {
                        name: 'organization-management:menu:divider-1',
                        text: '',
                        type: 'break',
                        priority: 30,
                    },
                    {
                        name: AXPOrganizationManagementMenuKeys.BusinessUnits,
                        text: `@${scope}:business-unit.plural-title`,
                        path: this.entityService.createPath(module.name, RootConfig.entities.businessUnit.name),
                        priority: 35,
                        icon: RootConfig.entities.businessUnit.icon,
                    },
                    {
                        name: AXPOrganizationManagementMenuKeys.BusinessUnitTypes,
                        text: `@${scope}:business-unit-type.plural-title`,
                        path: this.entityService.createPath(module.name, RootConfig.entities.businessUnitType.name),
                        priority: 40,
                        icon: RootConfig.entities.businessUnitType.icon,
                    },
                    {
                        name: 'organization-management:menu:divider-2',
                        text: '',
                        type: 'break',
                        priority: 45,
                    },
                    {
                        name: AXPOrganizationManagementMenuKeys.OrganizationChart,
                        text: RootConfig.entities.chart.menu.title,
                        path: `${this.sessionService.application?.name}/organization/chart`,
                        priority: 50,
                        icon: RootConfig.entities.chart.icon,
                    },
                ],
            },
        ]);
    }
}

async function factory(injector) {
    const dataService = injector.get(AXMOrganizationManagementBusinessUnitTypeEntityService);
    const i18n = RootConfig.config.i18n;
    const entityName = 'business-unit-type';
    const entityDef = {
        module: RootConfig.module.name,
        name: RootConfig.entities.businessUnitType.name,
        title: '@organization-management:business-unit-type.individual-title',
        icon: 'fa-light fa-tags',
        formats: {
            individual: '@organization-management:business-unit-type.individual-title',
            plural: '@organization-management:business-unit-type.plural-title',
            searchResult: { title: '{{ title }}', description: RootConfig.module.title },
        },
        groups: [
            { id: 'basic-info', title: '@general:terms.interface.basic-info' },
        ],
        properties: [
            { name: 'id', title: 'ID', groupId: 'basic-info', schema: { dataType: 'uuid', hidden: true, nullable: false, readonly: true, unique: { enabled: true } } },
            { name: 'title', title: '@general:terms.common.title', groupId: 'basic-info', schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text } }, validations: [{ rule: 'required' }] },
            { name: 'code', title: '@general:terms.common.code', groupId: 'basic-info', schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text } }, validations: [{ rule: 'required' }] },
            { name: 'isLocationBased', title: '@organization-management:business-unit-type.is-location-based', groupId: 'basic-info', schema: { dataType: 'boolean', interface: { type: AXPWidgetsCatalog.toggle }, defaultValue: false } },
        ],
        columns: [
            { name: 'title' },
            { name: 'code' },
            { name: 'isLocationBased' },
        ],
        commands: {
            create: { execute: async (data) => ({ id: await dataService.insertOne(data) }) },
            delete: { execute: async (id) => await dataService.deleteOne(id) },
            update: { execute: async (data) => await dataService.updateOne(data.id, data) },
        },
        queries: {
            byKey: { execute: async (id) => await dataService.getOne(id), type: AXPEntityQueryType.Single },
            list: { execute: async (e) => await dataService.query(e), type: AXPEntityQueryType.List },
        },
        interfaces: {
            master: {
                create: {
                    sections: [{ id: 'basic-info' }],
                    properties: [
                        { name: 'title', layout: { positions: { lg: { colSpan: 6 } } } },
                        { name: 'code', layout: { positions: { lg: { colSpan: 6 } } } },
                        { name: 'isLocationBased', layout: { positions: { lg: { colSpan: 12 } } } },
                    ],
                },
                update: {
                    sections: [{ id: 'basic-info' }],
                    properties: [
                        { name: 'title', layout: { positions: { lg: { colSpan: 6 } } } },
                        { name: 'code', layout: { positions: { lg: { colSpan: 6 } } } },
                        { name: 'isLocationBased', layout: { positions: { lg: { colSpan: 12 } } } },
                    ],
                },
                single: {
                    title: '{{title}}',
                    sections: [{ id: 'basic-info' }],
                    properties: [
                        { name: 'title', layout: { positions: { lg: { colSpan: 6 } } } },
                        { name: 'code', layout: { positions: { lg: { colSpan: 6 } } } },
                        { name: 'isLocationBased', layout: { positions: { lg: { colSpan: 12 } } } },
                    ],
                    actions: [...entityMasterRecordActions()],
                },
                list: { actions: [...entityMasterCrudActions()], views: [createAllQueryView({ sorts: [{ name: 'title', dir: 'asc' }] })] },
            },
        },
    };
    return entityDef;
}

var businessUnitType_entity = /*#__PURE__*/Object.freeze({
    __proto__: null,
    factory: factory
});

function routesFacory() {
    const config = inject(AXP_ENTITY_CONFIG_TOKEN);
    const routes = [
        {
            loadComponent: () => {
                return config.viewers.root();
            },
            path: ':app/organization',
            canActivate: [AXPAuthGuard],
            children: [
                {
                    path: 'chart',
                    loadComponent: () => import('./acorex-modules-organization-management-org-chart.page-CD9kyK0Z.mjs').then((c) => c.AXMOrgChartPage),
                },
            ],
        },
    ];
    return routes;
}
function routesFactory() {
    const config = inject(AXP_ENTITY_CONFIG_TOKEN);
    return {
        path: ':app/organization',
        loadComponent: () => {
            return config.viewers.root();
        },
        children: [
            {
                path: 'chart',
                loadComponent: () => import('./acorex-modules-organization-management-org-chart.page-CD9kyK0Z.mjs').then((c) => c.AXMOrgChartPage),
            },
        ],
    };
}
class AXMOrganizationManagementModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementModule, imports: [CommonModule,
            AXMOrganizationManagementResponsibilityEntityModule,
            AXMOrganizationManagementRoleEntityModule,
            AXMOrganizationManagementTeamEntityModule,
            AXMOrganizationManagementCompanyEntityModule,
            AXMOrganizationManagementPositionEntityModule,
            AXMOrganizationManagementChartEntityModule,
            AXMOrganizationManagementBusinessUnitEntityModule,
            AXMOrganizationManagementBusinessUnitTypeEntityModule] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementModule, providers: [
            {
                provide: AXP_ENTITY_DEFINITION_LOADER,
                useClass: AXMOrganizationModuleEntityProvider,
                multi: true,
            },
            {
                provide: AXP_SETTING_DEFINITION_PROVIDER,
                useFactory: async () => {
                    const injector = inject(Injector);
                    const provider = (await import('./acorex-modules-organization-management-settings.provider-CYCe7NZ-.mjs')).AXMSettingProvider;
                    return new provider(injector);
                },
                multi: true,
            },
            {
                provide: AXP_MENU_PROVIDER,
                useClass: AXMMenuProvider,
                multi: true,
            },
            {
                provide: ROUTES,
                multi: true,
                useFactory: routesFacory,
            },
            {
                provide: AXP_HOME_PAGES,
                multi: true,
                useFactory: () => [
                    {
                        key: 'organization-chart',
                        title: 'Organization Chart',
                        route: routesFactory(),
                    },
                ],
            },
            {
                provide: AXP_DATASOURCE_DEFINITION_PROVIDER,
                useClass: AXMDepartmentDataSourceDefinition,
                multi: true,
            },
            {
                provide: AXP_DATASOURCE_DEFINITION_PROVIDER,
                useClass: AXMDivisionDataSourceDefinition,
                multi: true,
            },
            {
                provide: AXP_DATASOURCE_DEFINITION_PROVIDER,
                useClass: AXMRoleDataSourceDefinition,
                multi: true,
            },
            {
                provide: AXP_DATASOURCE_DEFINITION_PROVIDER,
                useClass: AXMTeamDataSourceDefinition,
                multi: true,
            },
            {
                provide: AXP_DATASOURCE_DEFINITION_PROVIDER,
                useClass: AXMPositionDataSourceDefinition,
                multi: true,
            },
        ], imports: [CommonModule,
            AXMOrganizationManagementResponsibilityEntityModule,
            AXMOrganizationManagementRoleEntityModule,
            AXMOrganizationManagementTeamEntityModule,
            AXMOrganizationManagementCompanyEntityModule,
            AXMOrganizationManagementPositionEntityModule,
            AXMOrganizationManagementChartEntityModule,
            AXMOrganizationManagementBusinessUnitEntityModule,
            AXMOrganizationManagementBusinessUnitTypeEntityModule] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMOrganizationManagementModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [
                        CommonModule,
                        AXMOrganizationManagementResponsibilityEntityModule,
                        AXMOrganizationManagementRoleEntityModule,
                        AXMOrganizationManagementTeamEntityModule,
                        AXMOrganizationManagementCompanyEntityModule,
                        AXMOrganizationManagementPositionEntityModule,
                        AXMOrganizationManagementChartEntityModule,
                        AXMOrganizationManagementBusinessUnitEntityModule,
                        AXMOrganizationManagementBusinessUnitTypeEntityModule,
                    ],
                    providers: [
                        {
                            provide: AXP_ENTITY_DEFINITION_LOADER,
                            useClass: AXMOrganizationModuleEntityProvider,
                            multi: true,
                        },
                        {
                            provide: AXP_SETTING_DEFINITION_PROVIDER,
                            useFactory: async () => {
                                const injector = inject(Injector);
                                const provider = (await import('./acorex-modules-organization-management-settings.provider-CYCe7NZ-.mjs')).AXMSettingProvider;
                                return new provider(injector);
                            },
                            multi: true,
                        },
                        {
                            provide: AXP_MENU_PROVIDER,
                            useClass: AXMMenuProvider,
                            multi: true,
                        },
                        {
                            provide: ROUTES,
                            multi: true,
                            useFactory: routesFacory,
                        },
                        {
                            provide: AXP_HOME_PAGES,
                            multi: true,
                            useFactory: () => [
                                {
                                    key: 'organization-chart',
                                    title: 'Organization Chart',
                                    route: routesFactory(),
                                },
                            ],
                        },
                        {
                            provide: AXP_DATASOURCE_DEFINITION_PROVIDER,
                            useClass: AXMDepartmentDataSourceDefinition,
                            multi: true,
                        },
                        {
                            provide: AXP_DATASOURCE_DEFINITION_PROVIDER,
                            useClass: AXMDivisionDataSourceDefinition,
                            multi: true,
                        },
                        {
                            provide: AXP_DATASOURCE_DEFINITION_PROVIDER,
                            useClass: AXMRoleDataSourceDefinition,
                            multi: true,
                        },
                        {
                            provide: AXP_DATASOURCE_DEFINITION_PROVIDER,
                            useClass: AXMTeamDataSourceDefinition,
                            multi: true,
                        },
                        {
                            provide: AXP_DATASOURCE_DEFINITION_PROVIDER,
                            useClass: AXMPositionDataSourceDefinition,
                            multi: true,
                        },
                    ],
                }]
        }] });

/**
 * Generated bundle index. Do not edit.
 */

export { AXMOrgChartCategory, AXMOrgChartNodeType, AXMOrganizationManagementBusinessUnitEntityModule, AXMOrganizationManagementBusinessUnitEntityService, AXMOrganizationManagementBusinessUnitEntityServiceImpl, AXMOrganizationManagementBusinessUnitTypeEntityModule, AXMOrganizationManagementBusinessUnitTypeEntityService, AXMOrganizationManagementBusinessUnitTypeEntityServiceImpl, AXMOrganizationManagementChartEntityModule, AXMOrganizationManagementChartEntityService, AXMOrganizationManagementChartEntityServiceImpl, AXMOrganizationManagementCompanyEntityModule, AXMOrganizationManagementCompanyEntityService, AXMOrganizationManagementCompanyEntityServiceImpl, AXMOrganizationManagementModule, AXMOrganizationManagementPositionEntityModule, AXMOrganizationManagementPositionEntityService, AXMOrganizationManagementPositionEntityServiceImpl, AXMOrganizationManagementResponsibilityEntityModule, AXMOrganizationManagementResponsibilityEntityService, AXMOrganizationManagementResponsibilityEntityServiceImpl, AXMOrganizationManagementRoleEntityModule, AXMOrganizationManagementRoleEntityService, AXMOrganizationManagementRoleEntityServiceImpl, AXMOrganizationManagementTeamEntityModule, AXMOrganizationManagementTeamEntityService, AXMOrganizationManagementTeamEntityServiceImpl, RootConfig };
//# sourceMappingURL=acorex-modules-organization-management.mjs.map
