{"version":3,"file":"c8y-ngx-components-feature-toggles.mjs","sources":["../../feature-toggles/index.ts","../../feature-toggles/c8y-ngx-components-feature-toggles.ts"],"sourcesContent":["import { inject, Provider } from '@angular/core';\nimport {\n  AppStateService,\n  hookNavigator,\n  hookRoute,\n  NavigatorNode,\n  ViewContext\n} from '@c8y/ngx-components';\nimport { gettext } from '@c8y/ngx-components/gettext';\n\nconst featureTogglePath = 'feature-toggles' as const;\n\nexport const featureToggleProviders: Provider[] = [\n  hookNavigator(\n    new NavigatorNode({\n      path: featureTogglePath,\n      label: gettext('Feature toggles'),\n      icon: 'toggle-on',\n      parent: 'Settings'\n    })\n  ),\n  hookRoute({\n    path: featureTogglePath,\n    context: ViewContext.Tenant,\n    loadChildren: () => import('@c8y/ngx-components/feature-toggles/list').then(m => m.childRoutes),\n    icon: 'toggle-on',\n    label: gettext('Feature toggles'),\n    canActivate: [\n      () => {\n        return inject(AppStateService).currentTenant.value?.name === 'management';\n      }\n    ]\n  }),\n  hookRoute({\n    path: featureTogglePath,\n    loadChildren: () => import('@c8y/ngx-components/feature-toggles/list').then(m => m.childRoutes)\n  })\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAUA,MAAM,iBAAiB,GAAG,iBAA0B;AAE7C,MAAM,sBAAsB,GAAe;IAChD,aAAa,CACX,IAAI,aAAa,CAAC;AAChB,QAAA,IAAI,EAAE,iBAAiB;AACvB,QAAA,KAAK,EAAE,OAAO,CAAC,iBAAiB,CAAC;AACjC,QAAA,IAAI,EAAE,WAAW;AACjB,QAAA,MAAM,EAAE;AACT,KAAA,CAAC,CACH;AACD,IAAA,SAAS,CAAC;AACR,QAAA,IAAI,EAAE,iBAAiB;QACvB,OAAO,EAAE,WAAW,CAAC,MAAM;AAC3B,QAAA,YAAY,EAAE,MAAM,OAAO,0CAA0C,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;AAC/F,QAAA,IAAI,EAAE,WAAW;AACjB,QAAA,KAAK,EAAE,OAAO,CAAC,iBAAiB,CAAC;AACjC,QAAA,WAAW,EAAE;AACX,YAAA,MAAK;AACH,gBAAA,OAAO,MAAM,CAAC,eAAe,CAAC,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,KAAK,YAAY;YAC3E;AACD;KACF,CAAC;AACF,IAAA,SAAS,CAAC;AACR,QAAA,IAAI,EAAE,iBAAiB;AACvB,QAAA,YAAY,EAAE,MAAM,OAAO,0CAA0C,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW;KAC/F;;;ACpCH;;AAEG;;;;"}