@acorex-platform/module-report-management-client 1.0.2 → 2.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/fesm2022/{acorex-platform-module-report-management-client-acorex-platform-module-report-management-client-eSjEqt5D.mjs → acorex-platform-module-report-management-client-acorex-platform-module-report-management-client-DKnaOM7_.mjs} +36 -53
  2. package/fesm2022/acorex-platform-module-report-management-client-acorex-platform-module-report-management-client-DKnaOM7_.mjs.map +1 -0
  3. package/fesm2022/acorex-platform-module-report-management-client-contracts-entities-report-category.mjs +0 -14
  4. package/fesm2022/acorex-platform-module-report-management-client-contracts-entities-report-category.mjs.map +1 -1
  5. package/fesm2022/acorex-platform-module-report-management-client-contracts-entities-report-generation-request.mjs +2 -16
  6. package/fesm2022/acorex-platform-module-report-management-client-contracts-entities-report-generation-request.mjs.map +1 -1
  7. package/fesm2022/acorex-platform-module-report-management-client-contracts-entities-report.mjs +179 -25
  8. package/fesm2022/acorex-platform-module-report-management-client-contracts-entities-report.mjs.map +1 -1
  9. package/fesm2022/{acorex-platform-module-report-management-client-contracts-entity-catalog-acorex-platform-module-report-management-client-contracts-entity-catalog-CboBAIna.mjs → acorex-platform-module-report-management-client-contracts-entity-catalog-acorex-platform-module-report-management-client-contracts-entity-catalog-CSABQXeE.mjs} +4 -20
  10. package/fesm2022/acorex-platform-module-report-management-client-contracts-entity-catalog-acorex-platform-module-report-management-client-contracts-entity-catalog-CSABQXeE.mjs.map +1 -0
  11. package/fesm2022/{acorex-platform-module-report-management-client-contracts-entity-catalog-report-category.entity-BQFdNXAm.mjs → acorex-platform-module-report-management-client-contracts-entity-catalog-report-category.entity-GPDKYKW_.mjs} +2 -2
  12. package/fesm2022/{acorex-platform-module-report-management-client-contracts-entity-catalog-report-category.entity-BQFdNXAm.mjs.map → acorex-platform-module-report-management-client-contracts-entity-catalog-report-category.entity-GPDKYKW_.mjs.map} +1 -1
  13. package/fesm2022/{acorex-platform-module-report-management-client-contracts-entity-catalog-report-generation-request.entity-D381cWLE.mjs → acorex-platform-module-report-management-client-contracts-entity-catalog-report-generation-request.entity-B3cCnjKO.mjs} +4 -4
  14. package/fesm2022/acorex-platform-module-report-management-client-contracts-entity-catalog-report-generation-request.entity-B3cCnjKO.mjs.map +1 -0
  15. package/fesm2022/acorex-platform-module-report-management-client-contracts-entity-catalog-report.entity-B_BWJu1a.mjs +292 -0
  16. package/fesm2022/acorex-platform-module-report-management-client-contracts-entity-catalog-report.entity-B_BWJu1a.mjs.map +1 -0
  17. package/fesm2022/acorex-platform-module-report-management-client-contracts-entity-catalog.mjs +1 -1
  18. package/fesm2022/acorex-platform-module-report-management-client-contracts.mjs +1866 -25
  19. package/fesm2022/acorex-platform-module-report-management-client-contracts.mjs.map +1 -1
  20. package/fesm2022/{acorex-platform-module-report-management-client-entity-reports-page-component.provider-CaxletoS.mjs → acorex-platform-module-report-management-client-entity-reports-page-component.provider-BqgxvuLq.mjs} +3 -3
  21. package/fesm2022/{acorex-platform-module-report-management-client-entity-reports-page-component.provider-CaxletoS.mjs.map → acorex-platform-module-report-management-client-entity-reports-page-component.provider-BqgxvuLq.mjs.map} +1 -1
  22. package/fesm2022/{acorex-platform-module-report-management-client-entity-reports-page.component-CK5bCQhm.mjs → acorex-platform-module-report-management-client-entity-reports-page.component-D9AfxSeN.mjs} +2 -2
  23. package/fesm2022/{acorex-platform-module-report-management-client-entity-reports-page.component-CK5bCQhm.mjs.map → acorex-platform-module-report-management-client-entity-reports-page.component-D9AfxSeN.mjs.map} +1 -1
  24. package/fesm2022/acorex-platform-module-report-management-client-local-entities.mjs +0 -2
  25. package/fesm2022/acorex-platform-module-report-management-client-local-entities.mjs.map +1 -1
  26. package/fesm2022/acorex-platform-module-report-management-client-report-definition-access.service-DUpwky68.mjs +67 -0
  27. package/fesm2022/acorex-platform-module-report-management-client-report-definition-access.service-DUpwky68.mjs.map +1 -0
  28. package/fesm2022/acorex-platform-module-report-management-client-report-filter-page.component-C8XSGSdz.mjs +255 -0
  29. package/fesm2022/acorex-platform-module-report-management-client-report-filter-page.component-C8XSGSdz.mjs.map +1 -0
  30. package/fesm2022/acorex-platform-module-report-management-client-report-layout-page-component.provider-BfBckWsh.mjs +28 -0
  31. package/fesm2022/acorex-platform-module-report-management-client-report-layout-page-component.provider-BfBckWsh.mjs.map +1 -0
  32. package/fesm2022/acorex-platform-module-report-management-client-report-layout-page.component-DFmdGIY9.mjs +876 -0
  33. package/fesm2022/acorex-platform-module-report-management-client-report-layout-page.component-DFmdGIY9.mjs.map +1 -0
  34. package/fesm2022/{acorex-platform-module-report-management-client-report-layout-switcher.util-C3OVIaEz.mjs → acorex-platform-module-report-management-client-report-layout-switcher.util-DRG-8RcA.mjs} +258 -41
  35. package/fesm2022/acorex-platform-module-report-management-client-report-layout-switcher.util-DRG-8RcA.mjs.map +1 -0
  36. package/fesm2022/{acorex-platform-module-report-management-client-report-popup-viewer.component-CKE8NG5T.mjs → acorex-platform-module-report-management-client-report-popup-viewer.component-BVI1z7F3.mjs} +6 -6
  37. package/fesm2022/{acorex-platform-module-report-management-client-report-popup-viewer.component-CKE8NG5T.mjs.map → acorex-platform-module-report-management-client-report-popup-viewer.component-BVI1z7F3.mjs.map} +1 -1
  38. package/fesm2022/{acorex-platform-module-report-management-client-report-viewer-page.component-CPlbhBa_.mjs → acorex-platform-module-report-management-client-report-viewer-page.component-CPHO4vlQ.mjs} +84 -26
  39. package/fesm2022/acorex-platform-module-report-management-client-report-viewer-page.component-CPHO4vlQ.mjs.map +1 -0
  40. package/fesm2022/acorex-platform-module-report-management-client.mjs +1 -1
  41. package/i18n/en-AU/report-management.json +260 -35
  42. package/i18n/en-US/report-management.json +260 -35
  43. package/i18n/fa-IR/report-management.json +260 -35
  44. package/package.json +2 -9
  45. package/types/acorex-platform-module-report-management-client-contracts.d.ts +395 -109
  46. package/types/acorex-platform-module-report-management-client.d.ts +5 -5
  47. package/fesm2022/acorex-platform-module-report-management-client-acorex-platform-module-report-management-client-eSjEqt5D.mjs.map +0 -1
  48. package/fesm2022/acorex-platform-module-report-management-client-contracts-entities-query-snapshot-policy.mjs +0 -157
  49. package/fesm2022/acorex-platform-module-report-management-client-contracts-entities-query-snapshot-policy.mjs.map +0 -1
  50. package/fesm2022/acorex-platform-module-report-management-client-contracts-entities-query-snapshot.mjs +0 -197
  51. package/fesm2022/acorex-platform-module-report-management-client-contracts-entities-query-snapshot.mjs.map +0 -1
  52. package/fesm2022/acorex-platform-module-report-management-client-contracts-entity-catalog-acorex-platform-module-report-management-client-contracts-entity-catalog-CboBAIna.mjs.map +0 -1
  53. package/fesm2022/acorex-platform-module-report-management-client-contracts-entity-catalog-query-snapshot-policy.entity-BUY06Dz0.mjs +0 -97
  54. package/fesm2022/acorex-platform-module-report-management-client-contracts-entity-catalog-query-snapshot-policy.entity-BUY06Dz0.mjs.map +0 -1
  55. package/fesm2022/acorex-platform-module-report-management-client-contracts-entity-catalog-query-snapshot.entity-CnnX3xZt.mjs +0 -137
  56. package/fesm2022/acorex-platform-module-report-management-client-contracts-entity-catalog-query-snapshot.entity-CnnX3xZt.mjs.map +0 -1
  57. package/fesm2022/acorex-platform-module-report-management-client-contracts-entity-catalog-report-generation-request.entity-D381cWLE.mjs.map +0 -1
  58. package/fesm2022/acorex-platform-module-report-management-client-contracts-entity-catalog-report.entity-Bwui0M8X.mjs +0 -124
  59. package/fesm2022/acorex-platform-module-report-management-client-contracts-entity-catalog-report.entity-Bwui0M8X.mjs.map +0 -1
  60. package/fesm2022/acorex-platform-module-report-management-client-report-layout-switcher.util-C3OVIaEz.mjs.map +0 -1
  61. package/fesm2022/acorex-platform-module-report-management-client-report-viewer-page.component-CPlbhBa_.mjs.map +0 -1
  62. package/types/acorex-platform-module-report-management-client-contracts-entities-query-snapshot-policy.d.ts +0 -5
  63. package/types/acorex-platform-module-report-management-client-contracts-entities-query-snapshot.d.ts +0 -5
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-report-management-client-contracts.mjs","sources":["../../../../libs/modules/report-management/contracts/src/commands.keys.ts","../../../../libs/modules/report-management/contracts/src/features.keys.ts","../../../../libs/modules/report-management/contracts/src/menu.keys.ts","../../../../libs/modules/report-management/contracts/src/permission.keys.ts","../../../../libs/modules/report-management/contracts/src/settings.keys.ts","../../../../libs/modules/report-management/contracts/src/root-config.ts","../../../../libs/modules/report-management/contracts/src/manifest.ts","../../../../libs/modules/report-management/contracts/src/report.types.ts","../../../../libs/modules/report-management/contracts/src/report-generation.types.ts","../../../../libs/modules/report-management/contracts/src/runtime.keys.ts","../../../../libs/modules/report-management/contracts/src/entities/query-snapshot-policy/query-snapshot-policy.types.ts","../../../../libs/modules/report-management/contracts/src/entities/query-snapshot/query-snapshot.types.ts","../../../../libs/modules/report-management/contracts/src/index.ts","../../../../libs/modules/report-management/contracts/src/acorex-platform-module-report-management-client-contracts.ts"],"sourcesContent":["//#region ---- Report management command keys ----\n\nexport const AXMReportManagementCommandKeys = {\n RecalculateQuerySnapshots: 'ReportManagement:RecalculateQuerySnapshots',\n RefreshQuerySnapshots: 'ReportManagement:RefreshQuerySnapshots',\n ReportGeneration: {\n Create: 'ReportManagement:ReportGeneration:Create',\n Execute: 'ReportManagement:ReportGeneration:Execute',\n ReleaseInlineWatch: 'ReportManagement:ReportGeneration:ReleaseInlineWatch',\n },\n} as const;\n\nexport const AXM_RECALCULATE_QUERY_SNAPSHOTS_COMMAND_KEY =\n AXMReportManagementCommandKeys.RecalculateQuerySnapshots;\n\nexport const AXM_REFRESH_QUERY_SNAPSHOTS_COMMAND_KEY =\n AXMReportManagementCommandKeys.RefreshQuerySnapshots;\n\n//#endregion\n","export const AXPReportManagementFeatureKeys = {\n ReportBuilder: 'ReportManagement:Feature:ReportBuilder',\n SavedReports: 'ReportManagement:Feature:SavedReports',\n ScheduledReports: 'ReportManagement:Feature:ScheduledReports',\n BackgroundReports: 'ReportManagement:Feature:BackgroundReports',\n} as const;\n\n","export const AXPReportManagementMenuKeys = {\n Root: 'report-management:menu',\n Reports: 'report-management:menu:reports',\n Categories: 'report-management:menu:categories',\n DataSets: 'report-management:menu:data-sets',\n} as const;\n\n","/**\n * Insights & Reporting capabilities used by this module.\n * Domain capability keys for this module. Root groups live in `AXPCommonPermissionGroupKeys` (common contracts).\n */\nexport const AXPInsightsReportingPermissionKeys = {\n Access: 'InsightsReporting:Permission:Access',\n MaintainReports: 'InsightsReporting:Permission:MaintainReports',\n MaintainData: 'InsightsReporting:Permission:MaintainData',\n ViewActivityInsight: 'InsightsReporting:Permission:ViewActivityInsight',\n ManageActivityInsight: 'InsightsReporting:Permission:ManageActivityInsight',\n Setup: 'InsightsReporting:Permission:Setup',\n} as const;\n\n/**\n * @deprecated Prefer {@link AXPInsightsReportingPermissionKeys}.\n * Legacy nested shape kept so existing imports compile during migration.\n */\nexport const AXMPermissionsKeys = {\n ReportManagement: {\n Management: AXPInsightsReportingPermissionKeys.MaintainReports,\n Report: {\n Management: AXPInsightsReportingPermissionKeys.MaintainReports,\n View: AXPInsightsReportingPermissionKeys.MaintainReports,\n Create: AXPInsightsReportingPermissionKeys.MaintainReports,\n Update: AXPInsightsReportingPermissionKeys.MaintainReports,\n Delete: AXPInsightsReportingPermissionKeys.MaintainReports,\n },\n Category: {\n Management: AXPInsightsReportingPermissionKeys.Setup,\n View: AXPInsightsReportingPermissionKeys.Setup,\n Create: AXPInsightsReportingPermissionKeys.Setup,\n Update: AXPInsightsReportingPermissionKeys.Setup,\n Delete: AXPInsightsReportingPermissionKeys.Setup,\n },\n },\n} as const;\n","//#region ----- Report management settings -----\n\nimport type { AXPReportGenerationDedupePolicy } from './report.types';\n\nexport enum AXPReportManagementSettings {\n GenerationDedupePolicy = 'ReportManagement:Setting:Generation.Dedupe.Policy',\n GenerationDedupeCooldownMinutes = 'ReportManagement:Setting:Generation.Dedupe.CooldownMinutes',\n GenerationMaxConcurrentPerUser = 'ReportManagement:Setting:Generation.MaxConcurrentPerUser',\n}\n\nexport const AXP_REPORT_MANAGEMENT_GENERATION_SETTING_DEFAULTS = {\n [AXPReportManagementSettings.GenerationDedupePolicy]: 'in-flight' as AXPReportGenerationDedupePolicy,\n [AXPReportManagementSettings.GenerationDedupeCooldownMinutes]: 0,\n [AXPReportManagementSettings.GenerationMaxConcurrentPerUser]: 3,\n} as const;\n\n//#endregion\n","const config = {\n i18n: 'report-management',\n module: 'ReportManagement',\n};\n\nexport const RootConfig = {\n config,\n module: {\n route: 'report-management',\n name: config.module,\n title: `@${config.i18n}:module.title`,\n icon: 'fa-light fa-chart-bar',\n },\n entities: {\n dataSet: {\n name: 'DataSet',\n title: `t(\"dataSet\", { scope: \"${config.i18n}\" })`,\n titlePlural: `t(\"dataSetPlural\", { scope: \"${config.i18n}\" })`,\n icon: 'fa-light fa-default',\n },\n category: {\n name: 'ReportCategory',\n fullName: `${config.module}.ReportCategory`,\n title: `@${config.i18n}:reports.entities.category.title`,\n titlePlural: `@${config.i18n}:reports.entities.category.plural`,\n icon: 'fa-light fa-folder',\n },\n report: {\n name: 'Report',\n fullName: `${config.module}.Report`,\n title: `@${config.i18n}:reports.entities.report.title`,\n titlePlural: `@${config.i18n}:reports.entities.report.plural`,\n icon: 'fa-light fa-file-chart-pie',\n },\n querySnapshotPolicy: {\n name: 'QuerySnapshotPolicy',\n fullName: `${config.module}.QuerySnapshotPolicy`,\n title: `@${config.i18n}:query-snapshots.entities.policy.title`,\n titlePlural: `@${config.i18n}:query-snapshots.entities.policy.plural`,\n icon: 'fa-light fa-sliders',\n },\n querySnapshot: {\n name: 'QuerySnapshot',\n fullName: `${config.module}.QuerySnapshot`,\n title: `@${config.i18n}:query-snapshots.entities.snapshot.title`,\n titlePlural: `@${config.i18n}:query-snapshots.entities.snapshot.plural`,\n icon: 'fa-light fa-camera',\n },\n reportGenerationRequest: {\n name: 'ReportGenerationRequest',\n fullName: `${config.module}.ReportGenerationRequest`,\n title: `@${config.i18n}:report-generation.entities.request.title`,\n titlePlural: `@${config.i18n}:report-generation.entities.request.plural`,\n icon: 'fa-light fa-file-export',\n },\n },\n} as const;\n","//#region ---- Imports ----\n\nimport { AXPModuleManifest } from '@acorex-platform/framework-shared/core';\nimport { RootConfig } from './root-config';\n\n//#endregion\n\n//#region ---- Manifest Definition ----\n\n/**\n * Report Management Module Manifest.\n * Defines module metadata, features, and provider references.\n */\nexport const ReportManagementManifest: AXPModuleManifest = {\n name: RootConfig.module.name,\n version: '1.0.0',\n title: RootConfig.module.title,\n icon: RootConfig.module.icon,\n i18n: RootConfig.config.i18n,\n type: 'platform',\n domain: 'data',\n required : true,\n\n // Module dependencies (optional)\n};\n\n//#endregion\n\n","//#region ---- Imports ----\n\nimport { AXPWidgetColumnNode } from '@acorex-platform/framework-shared/widget-core';\nimport { AXPQuerySort } from '@acorex-platform/framework-shared/entity';\nimport { AXPActionMenuItem, AXPCategoryEntity, AXPExportOptions, AXPFilterClause, AXPSystemActionType, type AXPMultiLanguageString, type AXPWidgetNode } from '@acorex-platform/framework-shared/core';\n\n//#endregion\n\n//#region ---- Core Report Types and Interfaces ----\n\nexport type AXPReportLayoutType = 'table' | 'chart' | 'cards' | 'custom' | 'pdf';\n\n/**\n * Report Category - Extends AXPCategoryEntity for consistency and performance\n *\n * Inherited properties from AXPCategoryEntity:\n * - id: string - Unique identifier\n * - title: string - Display name\n * - description?: string - Category description\n * - parentId?: string - Parent category ID\n * - childrenCount: number - Direct child categories count (enables lazy loading)\n * - itemsCount?: number - Direct reports count (replaces hasReport boolean)\n * - totalChildrenCount?: number - Total nested categories (optional, for analytics)\n * - totalItemsCount?: number - Total reports in tree (optional, for analytics)\n *\n * Performance benefits:\n * - Lazy loading support (childrenCount > 0 shows expand icon)\n * - Report count display (itemsCount shows \"5 reports\" badge)\n * - Efficient queries (no need to query to know if expandable)\n */\nexport interface AXPReportCategory extends AXPCategoryEntity {\n // No additional properties needed - all inherited from AXPCategoryEntity\n // Use: childrenCount instead of hasChild\n // Use: itemsCount instead of hasReport\n}\n\n/** How an entity-bound report is surfaced on the host entity UI. */\nexport type AXPReportEntityDisplay = 'action' | 'page' | 'popup';\n\n/**\n * Parameter value on an entity binding:\n * - field path / expression string (e.g. `id`)\n * - `'today'` → local calendar day `{ from, to }`\n * - explicit `{ from, to }` date range\n */\nexport type AXPReportEntityParameterValue = string | { from: string; to: string };\n\n/** Binds a report to a host entity type for Reports page discovery. */\nexport interface AXPReportEntityBinding {\n /** Fully qualified entity type, e.g. `SecurityManagement.User`. */\n entity: string;\n /** Optional list title (i18n key or plain text). Falls back to report title. */\n title?: string;\n /** Optional list description (i18n key or plain text). Falls back to report description. */\n description?: string;\n layoutId?: string;\n /**\n * Where to surface the report. Defaults to `['page']` (Reports side-menu page).\n * `action` / `popup` are retained for data compatibility but are not contributed as entity Actions.\n */\n display?: AXPReportEntityDisplay | AXPReportEntityDisplay[];\n /**\n * Map report parameter path → entity field / expression / date token.\n * Example: `{ userId: 'id', dateRange: 'today' }`\n */\n parameters?: Record<string, AXPReportEntityParameterValue>;\n order?: number;\n}\n\nexport interface AXPReportDefinition {\n id: string;\n title: AXPMultiLanguageString;\n description?: AXPMultiLanguageString;\n categoryIds: string[];\n parameterGroups: AXPReportParameterGroup[];\n permissions?: string[];\n layouts: AXPReportLayoutDefinition[]; // Changed to support multiple layouts\n defaultLayoutId: string; // Which layout to show by default\n /** Optional host-entity bindings for the entity `reports` plugin. */\n entities?: AXPReportEntityBinding[];\n /** Background / choose / interactive generation options. Omitted = interactive. */\n generation?: AXPReportGenerationOptions;\n}\n\nexport type AXPReportGenerationMode = 'interactive' | 'background' | 'choose';\n\nexport type AXPReportArtifactKind = 'viewer' | 'pdf' | 'excel' | 'csv';\n\nexport type AXPReportFreezeLayouts = 'current' | 'all';\n\nexport type AXPReportGenerationDedupePolicy =\n | 'none'\n | 'in-flight'\n | 'in-flight-or-cooldown';\n\nexport interface AXPReportGenerationDedupeOptions {\n /** Omitted → inherit platform `ReportManagement:Setting:Generation.Dedupe.Policy`. */\n policy?: AXPReportGenerationDedupePolicy;\n /** Omitted → inherit platform `ReportManagement:Setting:Generation.Dedupe.CooldownMinutes`. */\n cooldownMs?: number;\n}\n\nexport interface AXPReportGenerationOptions {\n /** Omitted = interactive (today’s viewer). */\n mode?: AXPReportGenerationMode;\n /** Default `['viewer']` when mode is background or choose. */\n formats?: AXPReportArtifactKind[];\n executionTimeoutMs?: number;\n /** Default 30. Used to set `expiresAt` when the run finishes. */\n retentionDays?: number;\n /** Default `'all'` query layouts. `'current'` freezes only the layout the user ran. */\n freezeLayouts?: AXPReportFreezeLayouts;\n /** Default true. Store layout/title/parameter snapshot in the viewer freeze file. */\n pinDefinition?: boolean;\n /** Demo/local only. Worker waits this long after marking the run running. */\n simulateDelayMs?: number;\n /** Omitted → dedupe behavior comes from platform settings. */\n dedupe?: AXPReportGenerationDedupeOptions;\n /**\n * When true (default for background/choose), completed jobs stay in the footer tray until dismissed.\n * Set false to remove from tray as soon as the job completes.\n */\n keepInTray?: boolean;\n}\n\nexport type AXPReportLayoutAction = AXPActionMenuItem & {\n priority: 'primary' | 'secondary';\n};\n\n/**\n * Layout Definition - Associates a layout with metadata\n */\nexport interface AXPReportLayoutDefinition {\n id: string; // Unique identifier for this layout\n title: AXPMultiLanguageString; // Display name (e.g., \"Table View\", \"Chart View\")\n description?: AXPMultiLanguageString; // Optional description\n icon?: string; // Icon for layout switcher UI\n layout: AXPReportLayout; // The actual layout configuration\n dataSource?: AXPReportDataSource; // Optional layout-specific dataSource (overrides report-level)\n isDefault?: boolean; // Alternative to defaultLayoutId\n actions?: AXPReportLayoutAction[];\n export?: AXPExportOptions;\n}\n\nexport interface AXPReportParameterGroup {\n name: string;\n title: AXPMultiLanguageString;\n description?: AXPMultiLanguageString;\n parameters: AXPReportParameter[];\n}\n\nexport interface AXPReportParameter {\n path: string;\n title: AXPMultiLanguageString;\n description?: AXPMultiLanguageString;\n /**\n * Boolean or expression (e.g. `{{ permission.check(\"…\") }}` / `{{ feature.check(\"…\") }}`).\n * Omitted / `true` means visible. Evaluated by the Report Viewer layout renderer.\n */\n visible?: boolean | string;\n widget: AXPWidgetNode;\n}\n\n//#endregion\n\n//#region ---- Data Source Types ----\n\nexport type AXPReportDataSource =\n | AXPQueryDataSource\n | AXPCustomDataSource\n | AXPAggregatedDataSource\n | AXPTransformedDataSource;\n\n/**\n * Query Data Source - Used for executing predefined queries (AXPQuery)\n */\nexport interface AXPQueryDataSource {\n type: 'query';\n name: string; // The registered query name, e.g., 'getProductList'\n description?: string;\n\n inputs?: AXPReportParameterBinding[]; // Maps report parameters to query inputs\n sortFields?: AXPQuerySort[]; // Default sorting applied by the backend\n pagination?: boolean; // Enables paging in result set\n}\n\n/**\n * Custom Data Source - Used for fetching data from custom providers like REST APIs or external services\n */\nexport interface AXPCustomDataSource {\n type: 'custom';\n provider: string; // Example: 'http://api/report' or 'custom:MyHandler'\n description?: string;\n\n inputs?: AXPReportParameterBinding[]; // Maps report parameters to payload\n options?: { [key: string]: any }; // Additional options for the custom handler\n}\n\n/**\n * Parameter Binding - Maps report-level parameters to actual query/command input structure\n */\nexport interface AXPReportParameterBinding {\n parameterKey: string; // Report parameter key, e.g., 'startDate'\n bindTo: string; // Input key in the query/command payload, e.g., 'filters.from'\n}\n\n/**\n * Aggregated Data Source - Used for pre-aggregated data optimized for charts\n */\nexport interface AXPAggregatedDataSource {\n type: 'aggregated';\n baseQuery: string; // Base query to aggregate from\n description?: string;\n\n groupBy: string[]; // Fields to group by\n aggregations: AXPAggregation[]; // Aggregation operations\n inputs?: AXPReportParameterBinding[];\n}\n\n/**\n * Transformed Data Source - Applies transformations to existing data sources\n */\nexport interface AXPTransformedDataSource {\n type: 'transformed';\n baseDataSource: AXPReportDataSource; // Source to transform\n description?: string;\n\n transformations: AXPDataTransformation[]; // List of transformations\n inputs?: AXPReportParameterBinding[];\n}\n\n/**\n * Aggregation operation for aggregated data sources\n */\nexport interface AXPAggregation {\n field: string;\n operation: 'sum' | 'avg' | 'count' | 'min' | 'max' | 'distinct';\n alias?: string; // Output field name\n}\n\n/**\n * Data transformation operation\n */\nexport interface AXPDataTransformation {\n type: 'filter' | 'sort' | 'group' | 'pivot' | 'format';\n config: Record<string, any>; // Transformation-specific configuration\n}\n\n//#endregion\n\n//#region ---- Group By & Drill Down ----\n\n/**\n * Drill-down target for a grouped report row.\n * When reportId is omitted, the current report is used.\n */\nexport interface AXPReportDrillDownConfig {\n reportId?: string;\n layoutId?: string;\n title?: string;\n parameters?: Record<string, string>;\n}\n\n/**\n * Declares how a summary report is grouped and which detail view opens on drill-down.\n * Multiple definitions allow alternative drill paths (e.g. by brand vs by category).\n */\nexport interface AXPReportGroupByDefinition {\n fields: string[];\n displayField?: string;\n /** When true (default), `displayField` renders as a link instead of a row command column. */\n linkDisplay?: boolean;\n title?: string;\n default?: boolean;\n priority?: 'primary' | 'secondary';\n drillDown: AXPReportDrillDownConfig;\n}\n\n//#endregion\n\n//#region ---- Layout Types ----\n\nexport type AXPReportLayout = AXPReportTableLayout | AXPReportChartLayout | AXPReportPdfLayout;\n\n/**\n * Table Layout - Displays data in tabular format\n */\n\nexport interface AXPReportTableLayoutRowAction extends AXPActionMenuItem {\n priority: 'primary' | 'secondary';\n type: AXPSystemActionType | string;\n default?: boolean;\n}\n\nexport interface AXPReportTableLayout {\n type: 'table';\n columns: AXPReportColumn[];\n actions?: AXPReportTableLayoutRowAction[];\n options?: AXPTableOptions;\n groupBy?: AXPReportGroupByDefinition[];\n conditionalFormatting?: AXPConditionalFormatRule[];\n summary?: AXPReportSummaryOptions[];\n header?: AXPReportHeaderFooter;\n footer?: AXPReportHeaderFooter;\n}\n\nexport interface AXPTableOptions {\n pagination?: boolean;\n stickyHeader?: boolean;\n stripedRows?: boolean;\n sorting?: AXPQuerySort[];\n selectable?: {\n mode: 'single' | 'multiple' | 'none';\n };\n}\n\n/**\n * Chart Layout - Displays data in various chart formats\n */\nexport interface AXPReportChartLayout {\n type: 'chart';\n options: AXPReportChartOptions;\n header?: AXPReportHeaderFooter;\n footer?: AXPReportHeaderFooter;\n}\n\nexport interface AXPReportChartOptions {\n chartType: 'bar' | 'line' | 'pie' | 'doughnut' | 'area' | 'scatter' | 'radar' | 'mixed';\n dataMapping: AXPChartDataMapping;\n styling?: AXPChartStyling;\n interactivity?: AXPChartInteractivity;\n}\n\n/**\n * Chart Data Mapping Configuration\n */\nexport interface AXPChartDataMapping {\n // Core fields\n xField: string; // X-axis data field\n yFields: string | string[]; // Y-axis data field(s) for multiple series\n\n // Grouping and categorization\n groupBy?: string; // Group data by this field\n seriesField?: string; // Field to create multiple series\n\n // Special fields for specific chart types\n sizeField?: string; // For bubble charts\n colorField?: string; // For gradient/conditional coloring\n labelField?: string; // Custom label field\n\n // Data aggregation\n aggregation?: {\n method: 'sum' | 'avg' | 'count' | 'min' | 'max';\n field: string;\n };\n}\n\n/**\n * Chart Visual Styling Configuration\n */\nexport interface AXPChartStyling {\n // Theme and colors\n colorScheme?: 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'custom';\n /** Palette applied by series index when `seriesColors` is not set. */\n customColors?: string[];\n /**\n * Per-series fill colors keyed by chart category id/label\n * (e.g. Online → success, Away → warning, Busy → danger).\n */\n seriesColors?: Record<string, string>;\n\n // Chart appearance\n gridLines?: boolean;\n legend?: {\n show: boolean;\n position: 'top' | 'bottom' | 'left' | 'right';\n };\n\n // Axes configuration\n xAxis?: AXPChartAxisConfig;\n yAxis?: AXPChartAxisConfig;\n\n // Animation\n animation?: {\n enabled: boolean;\n duration?: number;\n };\n\n // Chart-specific styling\n chartSpecific?: {\n // Bar chart options\n bar?: {\n orientation: 'vertical' | 'horizontal';\n mode: 'grouped' | 'stacked';\n barWidth?: number;\n };\n\n // Line chart options\n line?: {\n style: 'straight' | 'curved' | 'stepped';\n showPoints?: boolean;\n tension?: number;\n };\n\n // Area chart options\n area?: {\n mode: 'normal' | 'stacked' | 'percentage';\n opacity?: number;\n };\n\n // Pie/Doughnut options\n pie?: {\n startAngle?: number;\n innerRadius?: number; // For doughnut charts\n showLabels?: boolean;\n };\n };\n}\n\n/**\n * Chart Axis Configuration\n */\nexport interface AXPChartAxisConfig {\n title?: string;\n show?: boolean;\n type?: 'linear' | 'logarithmic' | 'datetime' | 'category';\n min?: number | string;\n max?: number | string;\n format?: string;\n gridLines?: boolean;\n tickInterval?: number;\n}\n\n/**\n * Chart Interactivity Configuration\n */\nexport interface AXPChartInteractivity {\n // Zoom and pan\n zoom?: {\n enabled: boolean;\n mode?: 'x' | 'y' | 'xy';\n };\n\n // Tooltips\n tooltips?: {\n enabled: boolean;\n format?: string;\n showOnHover?: boolean;\n };\n\n // Click events\n onClick?: {\n enabled: boolean;\n action?: 'drill-down' | 'filter' | 'custom';\n };\n\n // Selection\n selection?: {\n enabled: boolean;\n mode?: 'single' | 'multiple';\n };\n\n // Export\n export?: {\n enabled: boolean;\n formats?: ('png' | 'jpg' | 'pdf' | 'svg')[];\n };\n}\n\n/**\n * PDF Layout - Displays PDF documents\n */\nexport interface AXPReportPdfLayout {\n type: 'pdf';\n options?: AXPReportPdfOptions;\n header?: AXPReportHeaderFooter;\n footer?: AXPReportHeaderFooter;\n}\n\n/**\n * PDF Layout Options\n */\nexport interface AXPReportPdfOptions {\n showDownloadButton?: boolean;\n showPrintButton?: boolean;\n showZoomControls?: boolean;\n showFullscreenButton?: boolean;\n defaultZoom?: number; // Percentage (e.g., 100, 150, 200)\n height?: string; // CSS height (e.g., '100%', '600px')\n}\n\n//#region ---- Shared Models ----\n\nexport interface AXPReportColumn {\n field: string;\n title?: string;\n /**\n * Boolean or expression (e.g. `{{ permission.check(\"…\") }}`).\n * Omitted / `true` means visible. Evaluated when building the table view.\n */\n visible?: boolean | string;\n width?: number | 'auto';\n align?: 'left' | 'center' | 'right';\n /** When true, column header supports interactive sort (opt-in). */\n sortable?: boolean;\n /** Pin column to the start or end of the table (definition-only). */\n pin?: 'start' | 'end';\n widget?: AXPWidgetColumnNode;\n /**\n * Optional cell interactivity. When omitted, group-by `displayField` columns\n * can still render as drill links automatically in report table view.\n */\n interactivity?: AXPReportColumnInteractivity;\n}\n\n/**\n * Column cell interaction — link triggers a command with the current row as context.\n * Platform widgets may mirror this via column `options.displayAs: 'link'` in the future.\n */\nexport interface AXPReportColumnInteractivity {\n type: 'link';\n command: {\n name: string;\n options?: Record<string, unknown>;\n };\n}\n\n/** Server-computed report footer totals keyed by column field. */\nexport type AXPReportTableSummaryResult = Record<string, number | null>;\n\nexport interface AXPReportSummaryOptions {\n field: string;\n operation: 'sum' | 'avg' | 'count' | 'min' | 'max';\n displayIn: 'groupFooter' | 'reportFooter';\n}\n\nexport interface AXPConditionalFormatRule {\n field: string;\n condition: '>' | '<' | '=' | '!=' | 'contains';\n value: any;\n style: {\n color?: string;\n backgroundColor?: string;\n fontWeight?: 'normal' | 'bold';\n };\n}\n\nexport interface AXPReportHeaderFooter {\n title?: string;\n logoUrl?: string;\n showDate?: boolean;\n showParameters?: boolean;\n customHtml?: string;\n}\n\n/**\n * Layout switcher options for UI components\n */\nexport interface AXPLayoutSwitcherOption {\n id: string;\n title: AXPMultiLanguageString;\n icon?: string;\n type: AXPReportLayoutType;\n}\n\n/**\n * Runtime layout selection state\n */\nexport interface AXPReportLayoutState {\n reportId: string;\n activeLayoutId: string;\n availableLayouts: AXPLayoutSwitcherOption[];\n}\n\n//#endregion\n","//#region ----- Imports -----\n\nimport type { AXPMultiLanguageString, AXPRuntimeQueryResult } from '@acorex-platform/framework-shared/core';\nimport type { AXPEntityModel } from '@acorex-platform/framework-shared/entity';\nimport type {\n AXPReportArtifactKind,\n AXPReportLayoutDefinition,\n} from './report.types';\n\n//#endregion\n\n//#region ----- Types -----\n\nexport type AXPReportGenerationStatus = 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';\n\nexport type AXPReportGenerationTrigger = 'manual' | 'schedule' | 'export';\n\nexport interface AXPReportGenerationArtifact {\n kind: AXPReportArtifactKind;\n fileId?: string;\n contentType?: string;\n fileName?: string;\n rowCount?: number;\n byteLength?: number;\n lastError?: string;\n}\n\nexport const REPORT_GENERATION_NOTIFICATION_DEFINITION_KEY = 'ReportManagement:ReportGeneration';\n\nexport const REPORT_GENERATION_OPEN_FROZEN_COMMAND = 'ReportManagement.Report:OpenViewer';\n\n/** In-app inbox correlation id for a completed report generation run. */\nexport function buildReportGenerationNotificationCorrelationId(runId: string): string {\n const normalized = runId.trim();\n return normalized ? `report-generation:${normalized}` : 'report-generation:';\n}\n\nexport interface AXMReportGenerationRequest extends AXPEntityModel<string> {\n reportId: string;\n layoutId?: string;\n layoutIds?: string[];\n parameters?: Record<string, unknown>;\n formats: AXPReportArtifactKind[];\n trigger: AXPReportGenerationTrigger;\n status: AXPReportGenerationStatus;\n requestedBy?: string;\n jobId?: string;\n scheduleId?: string;\n scheduledOccurrence?: string;\n startedAt?: string;\n completedAt?: string;\n durationMs?: number;\n lastError?: string;\n expiresAt?: string;\n sourceRequestId?: string;\n /** When true, skip in-app notification because the report viewer is watching this run inline. */\n suppressNotificationOnComplete?: boolean;\n artifacts: AXPReportGenerationArtifact[];\n}\n\nexport interface AXPReportViewerFreeze {\n version: 1;\n reportId: string;\n generatedAt: string;\n parameters: Record<string, unknown>;\n definition?: {\n title: AXPMultiLanguageString;\n defaultLayoutId: string;\n layouts: AXPReportLayoutDefinition[];\n };\n dataSources: Array<{\n layoutId: string;\n queryName: string;\n result: AXPRuntimeQueryResult;\n }>;\n}\n\nexport interface AXPReportGenerationCreateInput {\n reportId: string;\n layoutId?: string;\n layoutIds?: string[];\n parameters?: Record<string, unknown>;\n formats?: AXPReportArtifactKind[];\n trigger?: AXPReportGenerationTrigger;\n sourceRequestId?: string;\n scheduleId?: string;\n scheduledOccurrence?: string;\n /** Set when the report viewer will poll and show the result inline. */\n suppressNotificationOnComplete?: boolean;\n}\n\nexport interface AXPReportGenerationReleaseInlineWatchInput {\n id: string;\n}\n\nexport interface AXPReportGenerationCreateResult {\n id: string;\n jobId?: string;\n status: AXPReportGenerationStatus;\n /** True when an existing run was returned instead of creating a new row. */\n deduplicated?: boolean;\n}\n\nexport interface AXPReportGenerationExecuteInput {\n reportRequestId: string;\n}\n\nexport interface AXPReportGenerationExecuteResult {\n reportRequestId: string;\n fileIds: string[];\n rowCount?: number;\n}\n\nexport interface AXPReportGenerationGetInput {\n id: string;\n}\n\nexport interface AXPReportGenerationGetViewerFreezeInput {\n id: string;\n}\n\nexport interface AXPReportGenerationListMineInput {\n skip?: number;\n take?: number;\n}\n\n//#endregion\n","//#region ---- Report management runtime keys ----\n\nexport const AXMReportManagementQueryKeys = {\n Category: {\n ListRoot: 'ReportManagement:Category:ListRoot',\n GetById: 'ReportManagement:Category:GetById',\n },\n Report: {\n GetDefinition: 'ReportManagement:Report:GetDefinition',\n },\n ReportGeneration: {\n Get: 'ReportManagement:ReportGeneration:Get',\n ListMine: 'ReportManagement:ReportGeneration:ListMine',\n GetViewerFreeze: 'ReportManagement:ReportGeneration:GetViewerFreeze',\n },\n} as const;\n\n//#endregion\n","//#region ----- Imports -----\n\nimport type { AXPEntityModel } from '@acorex-platform/framework-shared/entity';\n\n//#endregion\n\n//#region ----- Types -----\n\nexport type AXMQuerySnapshotTriggerOperation = 'create' | 'update' | 'delete';\n\nexport interface AXMQuerySnapshotPolicyTriggers {\n entities: string[];\n operations: AXMQuerySnapshotTriggerOperation[];\n debounceMs: number;\n}\n\nexport interface AXMQuerySnapshotPolicyEntityModel extends AXPEntityModel<string> {\n queryName: string;\n enabled: boolean;\n schedule: string;\n staleAfterMs: number;\n triggers: AXMQuerySnapshotPolicyTriggers;\n}\n\n//#endregion\n","//#region ----- Imports -----\n\nimport type { AXPRuntimeCollectionData } from '@acorex-platform/framework-shared/core';\nimport type { AXPEntityModel } from '@acorex-platform/framework-shared/entity';\n\n//#endregion\n\n//#region ----- Types -----\n\nexport type AXMQuerySnapshotStatus = 'ready' | 'stale' | 'failed';\n\nexport type AXMQuerySnapshotPayload =\n | { success: true; kind: 'value'; data: unknown }\n | { success: true; kind: 'object'; data: unknown }\n | { success: true; kind: 'collection'; data: AXPRuntimeCollectionData };\n\nexport interface AXMQuerySnapshotEntityModel extends AXPEntityModel<string> {\n key: string;\n status: AXMQuerySnapshotStatus;\n calculatedAt: string;\n durationMs: number;\n lastError?: string;\n payload: AXMQuerySnapshotPayload;\n}\n\nexport interface AXMRecalculateQuerySnapshotsInput {\n tenantId?: string;\n applicationId?: string;\n queryKeys?: string[];\n /** When true, a full run ignores catch-up skips (manual refresh all). */\n force?: boolean;\n}\n\nexport interface AXMRefreshQuerySnapshotsInput {\n queryKeys?: string[];\n}\n\n//#endregion\n","//#region ---- Contracts barrel ----\n\nexport * from './commands.keys';\nexport * from './features.keys';\nexport * from './menu.keys';\nexport * from './permission.keys';\nexport * from './settings.keys';\n\nexport * from './root-config';\nexport * from './manifest';\nexport * from './report.types';\nexport * from './report-generation.types';\nexport * from './runtime.keys';\n\n//#endregion\n\nexport * from './entities';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAA;AAEO,MAAM,8BAA8B,GAAG;AAC5C,IAAA,yBAAyB,EAAE,4CAA4C;AACvE,IAAA,qBAAqB,EAAE,wCAAwC;AAC/D,IAAA,gBAAgB,EAAE;AAChB,QAAA,MAAM,EAAE,0CAA0C;AAClD,QAAA,OAAO,EAAE,2CAA2C;AACpD,QAAA,kBAAkB,EAAE,sDAAsD;AAC3E,KAAA;;AAGI,MAAM,2CAA2C,GACtD,8BAA8B,CAAC;AAE1B,MAAM,uCAAuC,GAClD,8BAA8B,CAAC;AAEjC;;AClBO,MAAM,8BAA8B,GAAG;AAC5C,IAAA,aAAa,EAAE,wCAAwC;AACvD,IAAA,YAAY,EAAE,uCAAuC;AACrD,IAAA,gBAAgB,EAAE,2CAA2C;AAC7D,IAAA,iBAAiB,EAAE,4CAA4C;;;ACJ1D,MAAM,2BAA2B,GAAG;AACvC,IAAA,IAAI,EAAE,wBAAwB;AAC9B,IAAA,OAAO,EAAE,gCAAgC;AACzC,IAAA,UAAU,EAAE,mCAAmC;AAC/C,IAAA,QAAQ,EAAE,kCAAkC;;;ACJ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AA,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI;AAC5B,IAAA,OAAO,EAAE,OAAO;AAChB,IAAA,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,KAAK;AAC9B,IAAA,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI;AAC5B,IAAA,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI;AAC5B,IAAA,IAAI,EAAE,UAAU;AAChB,IAAA,MAAM,EAAE,MAAM;AACd,IAAA,QAAQ,EAAG,IAAI;;;AAKjB;;AC1BA;AA8jBA;;AC9jBA;AA2BO,MAAM,6CAA6C,GAAG;AAEtD,MAAM,qCAAqC,GAAG;AAErD;AACM,SAAU,8CAA8C,CAAC,KAAa,EAAA;AAC1E,IAAA,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE;IAC/B,OAAO,UAAU,GAAG,CAAA,kBAAA,EAAqB,UAAU,CAAA,CAAE,GAAG,oBAAoB;AAC9E;AA2FA;;AC9HA;AAEO,MAAM,4BAA4B,GAAG;AAC1C,IAAA,QAAQ,EAAE;AACR,QAAA,QAAQ,EAAE,oCAAoC;AAC9C,QAAA,OAAO,EAAE,mCAAmC;AAC7C,KAAA;AACD,IAAA,MAAM,EAAE;AACN,QAAA,aAAa,EAAE,uCAAuC;AACvD,KAAA;AACD,IAAA,gBAAgB,EAAE;AAChB,QAAA,GAAG,EAAE,uCAAuC;AAC5C,QAAA,QAAQ,EAAE,4CAA4C;AACtD,QAAA,eAAe,EAAE,mDAAmD;AACrE,KAAA;;AAGH;;ACjBA;AAwBA;;ACxBA;AAqCA;;ACrCA;;ACAA;;AAEG;;"}
1
+ {"version":3,"file":"acorex-platform-module-report-management-client-contracts.mjs","sources":["../../../../libs/modules/report-management/contracts/src/commands.keys.ts","../../../../libs/modules/report-management/contracts/src/features.keys.ts","../../../../libs/modules/report-management/contracts/src/menu.keys.ts","../../../../libs/modules/report-management/contracts/src/permission.keys.ts","../../../../libs/modules/report-management/contracts/src/settings.keys.ts","../../../../libs/modules/report-management/contracts/src/root-config.ts","../../../../libs/modules/report-management/contracts/src/manifest.ts","../../../../libs/modules/report-management/contracts/src/report-filter-form.util.ts","../../../../libs/modules/report-management/contracts/src/report-generation.types.ts","../../../../libs/modules/report-management/contracts/src/report-interchange.projection.ts","../../../../libs/modules/report-management/contracts/src/report-interchange.snapshot.ts","../../../../libs/modules/report-management/contracts/src/report-interchange.types.ts","../../../../libs/modules/report-management/contracts/src/report-layout-field-schema.ts","../../../../libs/modules/report-management/contracts/src/report-layout-form.util.ts","../../../../libs/modules/report-management/contracts/src/report-layout-json-sections.ts","../../../../libs/modules/report-management/contracts/src/report-layout-starter.ts","../../../../libs/modules/report-management/contracts/src/report-layout-sections.mapper.ts","../../../../libs/modules/report-management/contracts/src/report-layout.presets.ts","../../../../libs/modules/report-management/contracts/src/report-parameter-binding.util.ts","../../../../libs/modules/report-management/contracts/src/report.types.ts","../../../../libs/modules/report-management/contracts/src/runtime.keys.ts","../../../../libs/modules/report-management/contracts/src/query-cache-targets.ts","../../../../libs/modules/report-management/contracts/src/index.ts","../../../../libs/modules/report-management/contracts/src/acorex-platform-module-report-management-client-contracts.ts"],"sourcesContent":["//#region ---- Report management command keys ----\n\nexport const AXMReportManagementCommandKeys = {\n ReportGeneration: {\n Create: 'ReportManagement:ReportGeneration:Create',\n Execute: 'ReportManagement:ReportGeneration:Execute',\n ReleaseInlineWatch: 'ReportManagement:ReportGeneration:ReleaseInlineWatch',\n },\n Export: {\n Run: 'ReportManagement:Export:Run',\n ListTemplates: 'ReportManagement:Export:ListTemplates',\n Clone: 'ReportManagement:Export:Clone',\n Save: 'ReportManagement:Export:Save',\n },\n} as const;\n\n\n\n//#endregion\n","export const AXPReportManagementFeatureKeys = {\n ReportBuilder: 'ReportManagement:Feature:ReportBuilder',\n SavedReports: 'ReportManagement:Feature:SavedReports',\n ScheduledReports: 'ReportManagement:Feature:ScheduledReports',\n BackgroundReports: 'ReportManagement:Feature:BackgroundReports',\n} as const;\n\n","export const AXPReportManagementMenuKeys = {\n Root: 'report-management:menu',\n Reports: 'report-management:menu:reports',\n Categories: 'report-management:menu:categories',\n DataSets: 'report-management:menu:data-sets',\n} as const;\n\n","/**\n * Insights & Reporting capabilities used by this module.\n * Domain capability keys for this module. Root groups live in `AXPCommonPermissionGroupKeys` (common contracts).\n */\nexport const AXPInsightsReportingPermissionKeys = {\n Access: 'InsightsReporting:Permission:Access',\n MaintainReports: 'InsightsReporting:Permission:MaintainReports',\n MaintainData: 'InsightsReporting:Permission:MaintainData',\n ViewActivityInsight: 'InsightsReporting:Permission:ViewActivityInsight',\n ManageActivityInsight: 'InsightsReporting:Permission:ManageActivityInsight',\n Setup: 'InsightsReporting:Permission:Setup',\n} as const;\n\n/**\n * @deprecated Prefer {@link AXPInsightsReportingPermissionKeys}.\n * Legacy nested shape kept so existing imports compile during migration.\n */\nexport const AXMPermissionsKeys = {\n ReportManagement: {\n Management: AXPInsightsReportingPermissionKeys.MaintainReports,\n Report: {\n Management: AXPInsightsReportingPermissionKeys.MaintainReports,\n View: AXPInsightsReportingPermissionKeys.MaintainReports,\n Create: AXPInsightsReportingPermissionKeys.MaintainReports,\n Update: AXPInsightsReportingPermissionKeys.MaintainReports,\n Delete: AXPInsightsReportingPermissionKeys.MaintainReports,\n },\n Category: {\n Management: AXPInsightsReportingPermissionKeys.Setup,\n View: AXPInsightsReportingPermissionKeys.Setup,\n Create: AXPInsightsReportingPermissionKeys.Setup,\n Update: AXPInsightsReportingPermissionKeys.Setup,\n Delete: AXPInsightsReportingPermissionKeys.Setup,\n },\n },\n} as const;\n","//#region ----- Report management settings -----\n\nimport type { AXPReportGenerationDedupePolicy } from './report.types';\n\nexport enum AXPReportManagementSettings {\n GenerationDedupePolicy = 'ReportManagement:Setting:Generation.Dedupe.Policy',\n GenerationDedupeCooldownMinutes = 'ReportManagement:Setting:Generation.Dedupe.CooldownMinutes',\n GenerationMaxConcurrentPerUser = 'ReportManagement:Setting:Generation.MaxConcurrentPerUser',\n}\n\nexport const AXP_REPORT_MANAGEMENT_GENERATION_SETTING_DEFAULTS = {\n [AXPReportManagementSettings.GenerationDedupePolicy]: 'in-flight' as AXPReportGenerationDedupePolicy,\n [AXPReportManagementSettings.GenerationDedupeCooldownMinutes]: 0,\n [AXPReportManagementSettings.GenerationMaxConcurrentPerUser]: 3,\n} as const;\n\n//#endregion\n","const config = {\n i18n: 'report-management',\n module: 'ReportManagement',\n};\n\nexport const RootConfig = {\n config,\n module: {\n route: 'report-management',\n name: config.module,\n title: `@${config.i18n}:module.title`,\n icon: 'fa-light fa-chart-bar',\n },\n entities: {\n dataSet: {\n name: 'DataSet',\n title: `t(\"dataSet\", { scope: \"${config.i18n}\" })`,\n titlePlural: `t(\"dataSetPlural\", { scope: \"${config.i18n}\" })`,\n icon: 'fa-light fa-default',\n },\n category: {\n name: 'ReportCategory',\n fullName: `${config.module}.ReportCategory`,\n title: `@${config.i18n}:reports.entities.category.title`,\n titlePlural: `@${config.i18n}:reports.entities.category.plural`,\n icon: 'fa-light fa-folder',\n },\n report: {\n name: 'Report',\n fullName: `${config.module}.Report`,\n title: `@${config.i18n}:reports.entities.report.title`,\n titlePlural: `@${config.i18n}:reports.entities.report.plural`,\n icon: 'fa-light fa-file-chart-pie',\n },\n reportGenerationRequest: {\n name: 'ReportGenerationRequest',\n fullName: `${config.module}.ReportGenerationRequest`,\n title: `@${config.i18n}:report-generation.entities.request.title`,\n titlePlural: `@${config.i18n}:report-generation.entities.request.plural`,\n icon: 'fa-light fa-file-export',\n },\n },\n} as const;\n","//#region ---- Imports ----\n\nimport { AXPModuleManifest } from '@acorex-platform/framework-shared/core';\nimport { RootConfig } from './root-config';\n\n//#endregion\n\n//#region ---- Manifest Definition ----\n\n/**\n * Report Management Module Manifest.\n * Defines module metadata, features, and provider references.\n */\nexport const ReportManagementManifest: AXPModuleManifest = {\n name: RootConfig.module.name,\n version: '1.0.0',\n title: RootConfig.module.title,\n icon: RootConfig.module.icon,\n i18n: RootConfig.config.i18n,\n type: 'platform',\n domain: 'data',\n required : true,\n\n // Module dependencies (optional)\n};\n\n//#endregion\n\n","import type { AXPMultiLanguageString, AXPWidgetNode } from '@acorex-platform/framework-shared/core';\nimport type { AXMMetaDataBuilderValue } from '@acorex-platform/module-data-management-client/contracts';\nimport type { AXPReportParameter, AXPReportParameterGroup } from './report.types';\n\n//#region ---- Types ----\n\n/**\n * What the filter tab edits: the report filters as metadata sections and fields.\n * It is a view of `parameterGroups`, so nothing else is stored.\n */\nexport interface ReportFilterFormModel {\n metaDataList: AXMMetaDataBuilderValue;\n}\n\ntype MetaDataGroup = AXMMetaDataBuilderValue['groups'][number];\ntype MetaDataField = MetaDataGroup['fields'][number];\n\n/** The widget keys that travel inside the metadata field `interface`. The rest is kept in the field configuration. */\ninterface StoredInterface {\n type?: string;\n options?: Record<string, unknown>;\n defaultValue?: unknown;\n triggers?: AXPWidgetNode['triggers'];\n}\n\n//#endregion\n\n//#region ---- Constants ----\n\nconst DEFAULT_WIDGET_TYPE = 'text-editor';\nconst INTERFACE_KEYS = new Set(['type', 'options', 'defaultValue', 'triggers', 'path', 'name']);\n\n//#endregion\n\n//#region ---- Parameter groups to metadata ----\n\n/** Every parameter group becomes a metadata section and every parameter a field, in stored order. */\nexport function readReportFilterForm(\n report: { parameterGroups?: AXPReportParameterGroup[] } | null | undefined,\n): ReportFilterFormModel {\n const groups = (report?.parameterGroups ?? []).map((group, groupIndex): MetaDataGroup => ({\n name: group.name,\n title: group.title,\n ...(isBlank(group.description) ? {} : { description: group.description }),\n order: groupIndex,\n fields: (group.parameters ?? []).map((parameter, fieldIndex) => parameterToField(parameter, fieldIndex)),\n }));\n return { metaDataList: { groups } };\n}\n\nfunction parameterToField(parameter: AXPReportParameter, order: number): MetaDataField {\n const widget = parameter.widget ?? { type: DEFAULT_WIDGET_TYPE };\n const stored: StoredInterface = {\n type: widget.type || DEFAULT_WIDGET_TYPE,\n options: { ...(widget.options ?? {}) },\n ...(widget.defaultValue !== undefined ? { defaultValue: widget.defaultValue } : {}),\n ...(widget.triggers !== undefined ? { triggers: widget.triggers } : {}),\n };\n const extras = Object.fromEntries(Object.entries(widget).filter(([key]) => !INTERFACE_KEYS.has(key)));\n const configuration: Record<string, unknown> = {};\n if (parameter.visible !== undefined) {\n configuration['visible'] = parameter.visible;\n }\n if (Object.keys(extras).length > 0) {\n configuration['widget'] = extras;\n }\n return {\n id: parameter.path,\n name: parameter.path,\n title: parameter.title,\n ...(isBlank(parameter.description) ? {} : { description: parameter.description }),\n interface: JSON.stringify(stored),\n ...(Object.keys(configuration).length > 0 ? { configuration } : {}),\n order,\n };\n}\n\n//#endregion\n\n//#region ---- Metadata to parameter groups ----\n\n/** Writes the metadata sections back as `parameterGroups`, the only filter structure the report uses. */\nexport function applyReportFilterForm(form: ReportFilterFormModel | null | undefined): {\n parameterGroups: AXPReportParameterGroup[];\n} {\n const groups = [...(form?.metaDataList?.groups ?? [])].sort((left, right) => (left.order ?? 0) - (right.order ?? 0));\n return {\n parameterGroups: groups.map((group): AXPReportParameterGroup => {\n const fields = [...(group.fields ?? [])].sort((left, right) => (left.order ?? 0) - (right.order ?? 0));\n return {\n name: group.name,\n title: textOr(group.title, group.name),\n ...(isBlank(group.description) ? {} : { description: group.description }),\n parameters: fields.flatMap((field) => fieldToParameter(field)),\n };\n }),\n };\n}\n\nfunction fieldToParameter(field: MetaDataField): AXPReportParameter[] {\n const path = typeof field?.name === 'string' ? field.name.trim() : '';\n // A field that is not named yet cannot be a filter: the viewer keys its values by path.\n if (!path) {\n return [];\n }\n const configuration = (field.configuration ?? {}) as Record<string, unknown>;\n const visible = configuration['visible'];\n return [\n {\n path,\n title: textOr(field.title, path),\n ...(isBlank(field.description) ? {} : { description: field.description }),\n ...(typeof visible === 'boolean' || typeof visible === 'string' ? { visible } : {}),\n widget: interfaceToWidget(field.interface, configuration['widget']),\n },\n ];\n}\n\nfunction interfaceToWidget(value: unknown, extras: unknown): AXPWidgetNode {\n const stored = parseInterface(value);\n const widget: AXPWidgetNode = {\n ...(isRecord(extras) ? extras : {}),\n type: typeof stored.type === 'string' && stored.type.trim() ? stored.type.trim() : DEFAULT_WIDGET_TYPE,\n options: { ...(stored.options ?? {}) },\n };\n if (stored.defaultValue !== undefined) {\n widget.defaultValue = stored.defaultValue;\n }\n if (stored.triggers !== undefined) {\n widget.triggers = stored.triggers;\n }\n return widget;\n}\n\n/** The builder stores the picked widget as a JSON string (or an object) of `{ type, options, defaultValue }`. */\nfunction parseInterface(value: unknown): StoredInterface {\n if (typeof value === 'string') {\n try {\n const parsed: unknown = JSON.parse(value || '{}');\n return isRecord(parsed) ? (parsed as StoredInterface) : {};\n } catch {\n // A plain widget name (not JSON) is the widget type itself.\n return value.trim() ? { type: value.trim() } : {};\n }\n }\n return isRecord(value) ? (value as StoredInterface) : {};\n}\n\n//#endregion\n\n//#region ---- Compare and pick ----\n\n/** Two forms are the same when they store the same filters. Field ids and order numbers do not count. */\nexport function sameReportFilterForm(left: ReportFilterFormModel, right: ReportFilterFormModel): boolean {\n return JSON.stringify(applyReportFilterForm(left)) === JSON.stringify(applyReportFilterForm(right));\n}\n\nexport function pickReportFilterForm(value: Record<string, unknown>, fallback: ReportFilterFormModel): ReportFilterFormModel {\n const list = value['metaDataList'];\n return isRecord(list) && Array.isArray(list['groups']) ? { metaDataList: list as unknown as AXMMetaDataBuilderValue } : fallback;\n}\n\n//#endregion\n\n//#region ---- Helpers ----\n\n/** The value when it has any text, otherwise the fallback. Typed so callers get a definite string / locale map. */\nfunction textOr(value: unknown, fallback: string): AXPMultiLanguageString {\n return value !== undefined && !isBlank(value) ? (value as AXPMultiLanguageString) : fallback;\n}\n\nfunction isBlank(value: unknown): boolean {\n if (value == null) {\n return true;\n }\n if (typeof value === 'string') {\n return value.trim() === '';\n }\n if (typeof value === 'object') {\n return !Object.values(value as Record<string, unknown>).some((item) => typeof item === 'string' && item.trim() !== '');\n }\n return false;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return value != null && typeof value === 'object' && !Array.isArray(value);\n}\n\n//#endregion\n","//#region ----- Imports -----\n\nimport type { AXPMultiLanguageString, AXPRuntimeQueryResult } from '@acorex-platform/framework-shared/core';\nimport type { AXPEntityModel } from '@acorex-platform/framework-shared/entity';\nimport type {\n AXPReportArtifactKind,\n AXPReportLayoutDefinition,\n} from './report.types';\n\n//#endregion\n\n//#region ----- Types -----\n\nexport type AXPReportGenerationStatus = 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';\n\nexport type AXPReportGenerationTrigger = 'manual' | 'schedule' | 'export';\n\nexport interface AXPReportGenerationArtifact {\n kind: AXPReportArtifactKind;\n fileId?: string;\n contentType?: string;\n fileName?: string;\n rowCount?: number;\n byteLength?: number;\n lastError?: string;\n}\n\nexport const REPORT_GENERATION_NOTIFICATION_DEFINITION_KEY = 'ReportManagement:ReportGeneration';\n\nexport const REPORT_GENERATION_OPEN_FROZEN_COMMAND = 'ReportManagement.Report:OpenViewer';\n\n/** In-app inbox correlation id for a completed report generation run. */\nexport function buildReportGenerationNotificationCorrelationId(runId: string): string {\n const normalized = runId.trim();\n return normalized ? `report-generation:${normalized}` : 'report-generation:';\n}\n\nexport interface AXMReportGenerationRequest extends AXPEntityModel<string> {\n reportId: string;\n layoutId?: string;\n layoutIds?: string[];\n parameters?: Record<string, unknown>;\n formats: AXPReportArtifactKind[];\n trigger: AXPReportGenerationTrigger;\n status: AXPReportGenerationStatus;\n requestedBy?: string;\n jobId?: string;\n scheduleId?: string;\n scheduledOccurrence?: string;\n startedAt?: string;\n completedAt?: string;\n durationMs?: number;\n lastError?: string;\n expiresAt?: string;\n sourceRequestId?: string;\n /** When true, skip in-app notification because the report viewer is watching this run inline. */\n suppressNotificationOnComplete?: boolean;\n artifacts: AXPReportGenerationArtifact[];\n}\n\nexport interface AXPReportViewerFreeze {\n version: 1;\n reportId: string;\n generatedAt: string;\n parameters: Record<string, unknown>;\n definition?: {\n title: AXPMultiLanguageString;\n defaultLayoutId: string;\n layouts: AXPReportLayoutDefinition[];\n };\n dataSources: Array<{\n layoutId: string;\n queryName: string;\n result: AXPRuntimeQueryResult;\n }>;\n}\n\nexport interface AXPReportGenerationCreateInput {\n reportId: string;\n layoutId?: string;\n layoutIds?: string[];\n parameters?: Record<string, unknown>;\n formats?: AXPReportArtifactKind[];\n trigger?: AXPReportGenerationTrigger;\n sourceRequestId?: string;\n scheduleId?: string;\n scheduledOccurrence?: string;\n /** Set when the report viewer will poll and show the result inline. */\n suppressNotificationOnComplete?: boolean;\n}\n\nexport interface AXPReportGenerationReleaseInlineWatchInput {\n id: string;\n}\n\nexport interface AXPReportGenerationCreateResult {\n id: string;\n jobId?: string;\n status: AXPReportGenerationStatus;\n /** True when an existing run was returned instead of creating a new row. */\n deduplicated?: boolean;\n}\n\nexport interface AXPReportGenerationExecuteInput {\n reportRequestId: string;\n}\n\nexport interface AXPReportGenerationExecuteResult {\n reportRequestId: string;\n fileIds: string[];\n rowCount?: number;\n}\n\nexport interface AXPReportGenerationGetInput {\n id: string;\n}\n\nexport interface AXPReportGenerationGetViewerFreezeInput {\n id: string;\n}\n\nexport interface AXPReportGenerationListMineInput {\n skip?: number;\n take?: number;\n}\n\n//#endregion\n","import {\n INTERCHANGE_EXTERNAL_SOURCE_KIND,\n INTERCHANGE_REPORT_ADAPTER_KIND,\n INTERCHANGE_VIRTUAL_REPORT_EXPORT_KEY_PREFIX,\n interchangeDefinitionScopeRank,\n type InterchangeCloneContext,\n type InterchangeExportDefinition,\n type InterchangeFieldMap,\n type InterchangeFormat,\n} from '@acorex-platform/framework-shared/interchange';\nimport { resolveMultiLanguageString } from '@acorex-platform/framework-shared/core';\nimport type {\n AXPReportColumn,\n AXPReportDefinition,\n AXPReportLayoutAction,\n AXPReportLayoutDefinition,\n AXPReportTableLayout,\n} from './report.types';\n\nfunction resolveReportColumnTitle(column: AXPReportColumn, locale = 'en-US'): string {\n const title = resolveMultiLanguageString(column.title, locale).trim();\n return title || column.field;\n}\n\n//#region ----- Virtual report export projection -----\n\nexport function virtualReportExportKey(reportId: string): string {\n return `${INTERCHANGE_VIRTUAL_REPORT_EXPORT_KEY_PREFIX}${reportId}:default-table`;\n}\n\n/**\n * Binding stored on the interchange request. Rows are not included:\n * the export job reads the report query itself.\n */\nexport function reportExportSourceBinding(input: {\n reportId: string;\n layoutId?: string;\n parameters?: Record<string, unknown>;\n}): Record<string, unknown> {\n const layoutId = input.layoutId?.trim();\n return {\n reportId: input.reportId,\n ...(layoutId ? { layoutId } : {}),\n parameters: input.parameters ?? {},\n };\n}\n\nexport function resolveReportExportTableLayout(\n report: Pick<AXPReportDefinition, 'layouts' | 'defaultLayoutId'>,\n layoutId?: string,\n): AXPReportLayoutDefinition | undefined {\n const requested = layoutId?.trim();\n if (requested) {\n const match = report.layouts.find((layout) => layout.id === requested);\n if (match?.layout?.type === 'table') {\n return match;\n }\n }\n return findDefaultReportTableLayout(report);\n}\n\nexport function findDefaultReportTableLayout(\n report: Pick<AXPReportDefinition, 'layouts' | 'defaultLayoutId'>,\n): AXPReportLayoutDefinition | undefined {\n const defaultLayout =\n report.layouts.find((layout) => layout.id === report.defaultLayoutId) ??\n report.layouts.find((layout) => layout.isDefault) ??\n report.layouts[0];\n if (defaultLayout?.layout?.type === 'table') {\n return defaultLayout;\n }\n return report.layouts.find((layout) => layout.layout?.type === 'table');\n}\n\nexport function visibleDefaultTableColumns(\n report: Pick<AXPReportDefinition, 'layouts' | 'defaultLayoutId'>,\n): AXPReportColumn[] {\n const layout = findDefaultReportTableLayout(report);\n const table = layout?.layout as AXPReportTableLayout | undefined;\n if (table?.type !== 'table' || !Array.isArray(table.columns)) {\n return [];\n }\n return table.columns.filter((column) => column.visible !== false);\n}\n\nexport function projectReportDefaultTableExportDefinition(\n report: AXPReportDefinition,\n format: InterchangeFormat = 'excel',\n): InterchangeExportDefinition {\n const columns = visibleDefaultTableColumns(report);\n const fields: InterchangeFieldMap[] = columns.map((column) => ({\n path: column.field,\n column: resolveReportColumnTitle(column),\n }));\n if (fields.length === 0) {\n fields.push({ path: 'id', column: 'id' });\n }\n const key = virtualReportExportKey(report.id);\n const tableLayout = findDefaultReportTableLayout(report);\n const sheetName = tableLayout?.export?.excel?.sheetName || 'Report';\n return {\n id: key,\n key,\n title: report.title,\n format,\n formatOptions: {\n excel: {\n sheetNames: { ReportResult: sheetName },\n includeHeaders: true,\n freezeHeader: tableLayout?.export?.excel?.freezeHeader,\n autoFitColumns: tableLayout?.export?.excel?.autoFitColumns !== false,\n },\n csv: {\n delimiter: tableLayout?.export?.csv?.delimiter,\n includeHeaders: tableLayout?.export?.csv?.includeHeaders !== false,\n quoteValues: tableLayout?.export?.csv?.quoteValues !== false,\n },\n pdf: reportTablePdfFormatOptions(tableLayout),\n },\n source: {\n type: INTERCHANGE_EXTERNAL_SOURCE_KIND,\n adapter: INTERCHANGE_REPORT_ADAPTER_KIND,\n binding: { reportId: report.id },\n },\n graph: {\n entity: 'ReportResult',\n fields,\n },\n stateInfo: { isSystem: true, isImmutable: true },\n scopeInfo: {},\n };\n}\n\nconst REPORT_PDF_PAGE_SIZES = ['A4', 'Letter', 'Legal'] as const;\n\n/**\n * Table PDF options for the interchange renderer.\n * Page size stays inside the document-output set; A3 is omitted so the PDF defaults apply.\n */\nfunction reportTablePdfFormatOptions(\n tableLayout: AXPReportLayoutDefinition | undefined,\n): NonNullable<InterchangeExportDefinition['formatOptions']>['pdf'] {\n const pdf = tableLayout?.export?.pdf;\n const pageSize = REPORT_PDF_PAGE_SIZES.find((size) => size === pdf?.pageSize);\n const orientation =\n pdf?.orientation === 'portrait' || pdf?.orientation === 'landscape' ? pdf.orientation : undefined;\n return {\n layout: 'table',\n includeHeaders: true,\n showTitle: true,\n ...(pageSize ? { pageSize } : {}),\n ...(orientation ? { orientation } : {}),\n };\n}\n\n/**\n * Interchange export actions for a table layout.\n * PDF is queued like Excel and CSV; the selected document-output provider renders the file.\n */\nexport function reportTableInterchangeExportActions(\n layoutDefinition: AXPReportLayoutDefinition,\n): AXPReportLayoutAction[] {\n if (layoutDefinition.layout?.type !== 'table') {\n return [];\n }\n const actions: AXPReportLayoutAction[] = [];\n if (layoutDefinition.export?.excel?.enabled !== false) {\n actions.push({\n name: 'export-report-excel',\n title: '@report-management:report-viewer.actions.export-excel.title',\n icon: 'fa-light fa-file-excel',\n command: { name: 'export-report', options: { format: 'excel' } },\n priority: 'secondary',\n });\n }\n if (layoutDefinition.export?.csv?.enabled !== false) {\n actions.push({\n name: 'export-report-csv',\n title: '@report-management:report-viewer.actions.export-csv.title',\n icon: 'fa-light fa-file-csv',\n command: { name: 'export-report', options: { format: 'csv' } },\n priority: 'secondary',\n });\n }\n if (layoutDefinition.export?.pdf?.enabled !== false) {\n actions.push({\n name: 'export-report-pdf',\n title: '@report-management:report-viewer.actions.export-pdf.title',\n icon: 'fa-light fa-file-pdf',\n command: { name: 'export-report', options: { format: 'pdf' } },\n priority: 'secondary',\n });\n }\n return actions;\n}\n\nexport function overlayReportExportTemplates(\n virtual: InterchangeExportDefinition,\n stored: InterchangeExportDefinition[],\n scope: InterchangeCloneContext,\n): InterchangeExportDefinition[] {\n const defaultKey = virtual.key;\n const bySlot = new Map<string, InterchangeExportDefinition>();\n bySlot.set(defaultKey, virtual);\n for (const definition of stored) {\n const slotKey = definition.key === defaultKey ? defaultKey : definition.key || definition.id || defaultKey;\n const current = bySlot.get(slotKey);\n if (\n !current ||\n interchangeDefinitionScopeRank(definition.scopeInfo, scope) >=\n interchangeDefinitionScopeRank(current.scopeInfo, scope)\n ) {\n bySlot.set(slotKey, definition);\n }\n }\n const defaultDefinition = bySlot.get(defaultKey)!;\n bySlot.delete(defaultKey);\n return [defaultDefinition, ...bySlot.values()];\n}\n\n//#endregion\n","//#region ----- Report export snapshot -----\n\nexport interface ReportExportSnapshot {\n items: Record<string, unknown>[];\n parameters: Record<string, unknown>;\n frozen: boolean;\n}\n\nfunction parameterFingerprint(parameters: Record<string, unknown> | undefined): string {\n try {\n return JSON.stringify(parameters ?? {});\n } catch {\n return '';\n }\n}\n\nexport function resolveCurrentReportExportSnapshot(input: {\n snapshot: ReportExportSnapshot | null;\n frozen: boolean;\n freezeItems?: Record<string, unknown>[];\n freezeParameters?: Record<string, unknown>;\n liveParameters?: Record<string, unknown>;\n}): ReportExportSnapshot | null {\n if (input.frozen) {\n if (input.freezeItems?.length) {\n return {\n items: input.freezeItems,\n parameters: { ...(input.freezeParameters ?? {}) },\n frozen: true,\n };\n }\n return input.snapshot?.frozen ? input.snapshot : null;\n }\n if (!input.snapshot || input.snapshot.frozen) {\n return null;\n }\n if (parameterFingerprint(input.snapshot.parameters) !== parameterFingerprint(input.liveParameters)) {\n return null;\n }\n return input.snapshot;\n}\n\n//#endregion\n","import type {\n InterchangeExportDefinition,\n InterchangeFormat,\n} from '@acorex-platform/framework-shared/interchange';\n\nexport type { InterchangeExportDefinition };\n//#region ----- Report interchange run contracts -----\n\nexport interface AXPReportInterchangeExportInput {\n reportId: string;\n format?: InterchangeFormat;\n templateId?: string;\n /** Table layout whose query the background job reads. */\n layoutId?: string;\n /** Report filter context. The job converts this; the client does not send rows. */\n parameters?: Record<string, unknown>;\n locale?: string;\n}\n\nexport interface AXPReportInterchangeExportResult {\n id: string;\n jobId: string;\n status: 'queued';\n templateId: string;\n virtual: boolean;\n}\n\nexport interface AXPReportInterchangeListTemplatesInput {\n reportId: string;\n}\n\nexport interface AXPReportInterchangeListTemplatesResult {\n items: InterchangeExportDefinition[];\n}\n\nexport interface AXPReportInterchangeCloneTemplateInput {\n reportId: string;\n templateId?: string;\n format?: InterchangeFormat;\n title?: string;\n}\n\nexport interface AXPReportInterchangeSaveTemplateInput {\n reportId: string;\n definition: InterchangeExportDefinition;\n}\n\nexport interface AXPReportInterchangeTemplateMutationResult {\n definition: InterchangeExportDefinition;\n}\n\n//#endregion\n","//#region ---- Field kinds ----\n\n/**\n * Editor the layout page uses for one stored JSON property.\n * The kind comes from the property name and the value that is stored, never from a fixed form.\n */\nexport type ReportLayoutFieldKind =\n | 'toggle'\n | 'number'\n | 'text'\n | 'multiline'\n | 'locale-text'\n | 'color'\n | 'icon'\n | 'select'\n | 'tags'\n /** Name of a registered query (`PlatformManagement.QueryDefinition`). */\n | 'query'\n /** One field of the rows the view's query returns. */\n | 'column'\n /** Several fields of the rows the view's query returns. */\n | 'column-list'\n /** One filter of the report (a `parameterGroups` path). */\n | 'parameter'\n /** Another report definition. */\n | 'report'\n /** A Stimulsoft template. */\n | 'template'\n /** Name of a registered command. */\n | 'command'\n | 'group'\n | 'list'\n | 'json';\n\n/** One editable property found in a stored layout section. */\nexport interface ReportLayoutFieldSchema {\n /** Property name as stored. */\n key: string;\n /**\n * Context path from the section container (`layout.options.chartType`).\n * Inside the rows of a `list` the path starts again at the row.\n */\n path: string;\n /** Property names from the section root, without row indexes. Used for enum lookup and locks. */\n trail: string;\n kind: ReportLayoutFieldKind;\n /** Allowed values when `kind` is `select`. */\n options?: readonly string[];\n /** Shown but not editable. Changing it would move the view to another tab or break its shape. */\n locked?: boolean;\n /** Children of a `group`, or the merged row template of a `list`. */\n fields?: ReportLayoutFieldSchema[];\n}\n\n//#endregion\n\n//#region ---- Enum and lock rules ----\n\nconst MAX_DEPTH = 8;\nconst TEXT_LENGTH_MULTILINE = 120;\nconst LOCALE_KEY = /^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/;\nconst HEX_OR_FUNCTION_COLOR = /^(?:#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})|(?:rgb|hsl)a?\\([^)]+\\))$/i;\nconst UNSAFE_PATH_KEY = /[.[\\]]/;\n\nconst SUMMARY_OPERATIONS = ['sum', 'avg', 'count', 'min', 'max'] as const;\n\n/** First rule whose pattern matches the end of the key trail decides the choices. */\nconst ENUM_RULES: readonly { pattern: RegExp; values: readonly string[] }[] = [\n { pattern: /(?:^|\\.)chartType$/, values: ['bar', 'line', 'pie', 'doughnut', 'area', 'scatter', 'radar', 'mixed'] },\n { pattern: /colorScheme$/, values: ['default', 'primary', 'success', 'warning', 'danger', 'custom'] },\n { pattern: /legend\\.position$/, values: ['top', 'bottom', 'left', 'right'] },\n { pattern: /bar\\.orientation$/, values: ['vertical', 'horizontal'] },\n { pattern: /bar\\.mode$/, values: ['grouped', 'stacked'] },\n { pattern: /line\\.style$/, values: ['straight', 'curved', 'stepped'] },\n { pattern: /area\\.mode$/, values: ['normal', 'stacked', 'percentage'] },\n { pattern: /(?:xAxis|yAxis)\\.type$/, values: ['linear', 'logarithmic', 'datetime', 'category'] },\n { pattern: /zoom\\.mode$/, values: ['x', 'y', 'xy'] },\n { pattern: /onClick\\.action$/, values: ['drill-down', 'filter', 'custom'] },\n { pattern: /selectable\\.mode$/, values: ['single', 'multiple', 'none'] },\n { pattern: /selection\\.mode$/, values: ['single', 'multiple'] },\n { pattern: /transformations\\.type$/, values: ['filter', 'sort', 'group', 'pivot', 'format'] },\n { pattern: /aggregation\\.method$/, values: SUMMARY_OPERATIONS },\n { pattern: /(?:^|\\.)operation$/, values: [...SUMMARY_OPERATIONS, 'distinct'] },\n { pattern: /(?:^|\\.)displayIn$/, values: ['groupFooter', 'reportFooter'] },\n { pattern: /(?:^|\\.)condition$/, values: ['>', '<', '=', '!=', 'contains'] },\n { pattern: /(?:^|\\.)fontWeight$/, values: ['normal', 'bold'] },\n { pattern: /columns\\.align$/, values: ['left', 'center', 'right'] },\n { pattern: /columns\\.pin$/, values: ['start', 'end'] },\n { pattern: /(?:^|\\.)priority$/, values: ['primary', 'secondary'] },\n { pattern: /(?:^|\\.)dir$/, values: ['asc', 'desc'] },\n { pattern: /pdf\\.pageSize$/, values: ['A4', 'A3', 'Letter', 'Legal'] },\n { pattern: /pdf\\.orientation$/, values: ['portrait', 'landscape'] },\n { pattern: /(?:^|\\.)numberFormat$/, values: ['auto', 'currency', 'percent', 'decimal'] },\n { pattern: /csv\\.delimiter$/, values: [',', ';', '\\t'] },\n { pattern: /csv\\.encoding$/, values: ['utf-8', 'utf-16', 'iso-8859-1'] },\n];\n\n/**\n * Properties that hold the name of something that already exists, so a picker fits better than free text.\n * First rule whose pattern matches the key trail decides the kind.\n */\nconst REFERENCE_RULES: readonly { pattern: RegExp; kind: ReportLayoutFieldKind }[] = [\n { pattern: /(?:^|\\.)(?:dataSource|baseDataSource)\\.name$/, kind: 'query' },\n { pattern: /^dataSource\\.baseQuery$/, kind: 'query' },\n { pattern: /(?:^|\\.)command\\.name$/, kind: 'command' },\n { pattern: /^layout\\.groupBy\\.drillDown\\.reportId$/, kind: 'report' },\n { pattern: /^layout\\.stimulsoftTemplateId$/, kind: 'template' },\n { pattern: /^layout\\.columns\\.field$/, kind: 'column' },\n {\n pattern: /^layout\\.options\\.dataMapping\\.(?:xField|yFields|groupBy|seriesField|sizeField|colorField|labelField|aggregation\\.field)$/,\n kind: 'column',\n },\n { pattern: /^layout\\.groupBy\\.displayField$/, kind: 'column' },\n { pattern: /^layout\\.(?:conditionalFormatting|summary)\\.field$/, kind: 'column' },\n { pattern: /^layout\\.options\\.hierarchy\\.(?:parentField|keyField)$/, kind: 'column' },\n { pattern: /^layout\\.options\\.sorting\\.name$/, kind: 'column' },\n { pattern: /^dataSource\\.sortFields\\.name$/, kind: 'column' },\n { pattern: /^dataSource\\.aggregations\\.field$/, kind: 'column' },\n { pattern: /^dataSource\\.inputs\\.parameterKey$/, kind: 'parameter' },\n];\n\n/** Lists of plain names that are fields of the query rows. */\nconst COLUMN_LIST_TRAILS: ReadonlySet<string> = new Set([\n 'layout.options.dataMapping.yFields',\n 'layout.groupBy.fields',\n 'dataSource.groupBy',\n]);\n\n/** Kinds that name a field of the query rows. The page offers the columns of the chosen query. */\nexport function isReportLayoutColumnKind(kind: ReportLayoutFieldKind): boolean {\n return kind === 'column' || kind === 'column-list';\n}\n\n/** Properties the page may show but must not change. */\nconst LOCKED_TRAILS: ReadonlySet<string> = new Set(['layout.type', 'dataSource.type', 'layout.options.chartType']);\n\n//#endregion\n\n//#region ---- Label keys ----\n\n/** Property names that have a translation under `layout-editor.fields`. Others fall back to their own name. */\nexport const REPORT_LAYOUT_FIELD_LABEL_KEYS: ReadonlySet<string> = new Set([\n 'actions', 'aggregation', 'aggregations', 'align', 'alias', 'animation', 'area', 'autoFitColumns',\n 'backgroundColor', 'bar', 'barWidth', 'baseDataSource', 'baseQuery', 'bindTo', 'chartSpecific', 'chartType',\n 'color', 'colorField', 'colorScheme', 'columns', 'command', 'compression', 'condition', 'conditionalFormatting',\n 'config', 'csv', 'customColors', 'customCssUrl', 'customHtml', 'dataMapping', 'dataSource', 'default',\n 'defaultZoom', 'delimiter', 'description', 'dir', 'disabled', 'displayField', 'displayIn', 'drillDown',\n 'duration', 'embedImages', 'enabled', 'encoding', 'excel', 'export', 'exportHiddenColumns', 'field', 'fields',\n 'fileNameTemplate', 'font', 'fontSize', 'fontWeight', 'footer', 'footerEnabled', 'format', 'formats',\n 'freezeHeader', 'gridLines', 'groupBy', 'header', 'headerColor', 'headerEnabled', 'height', 'hierarchy', 'icon',\n 'includeFilters', 'includeFooter', 'includeHeader', 'includeHeaders', 'inputs', 'interactivity', 'innerRadius',\n 'keyField', 'labelField', 'layout', 'layoutId', 'legend', 'line', 'linkDisplay', 'logoUrl', 'margin', 'max',\n 'method', 'min', 'mode', 'name', 'numberFormat', 'onClick', 'opacity', 'operation', 'options', 'orientation',\n 'pageSize', 'pagination', 'parameterKey', 'parameters', 'parentField', 'path', 'pdf', 'pie', 'pin', 'position',\n 'print', 'priority', 'provider', 'quoteValues', 'reportId', 'selectable', 'selection', 'seriesColors',\n 'seriesField', 'sheetName', 'show', 'showDate', 'showDownloadButton', 'showFullscreenButton', 'showLabels',\n 'showOnHover', 'showPageBreaks', 'showPageNumbers', 'showParameters', 'showPoints', 'showPrintButton',\n 'showZoomControls', 'sizeField', 'sortFields', 'sortable', 'sorting', 'startAngle', 'stickyHeader',\n 'stimulsoftDataSourceName', 'stimulsoftTemplateId', 'stripedRows', 'style', 'summary', 'summaryRowEnabled',\n 'tension', 'tickInterval', 'title', 'tooltips', 'transformations', 'type', 'value', 'visible',\n 'watermarkOpacity', 'watermarkText', 'width', 'widget', 'xAxis', 'xField', 'yAxis', 'yFields', 'zoom',\n]);\n\n/** `defaultZoom` → `default-zoom`, the segment used in translation keys. */\nexport function reportLayoutFieldKebabKey(key: string): string {\n return key.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\n}\n\n/** `defaultZoom` → `Default Zoom`, shown when no translation exists for the property. */\nexport function reportLayoutFieldFallbackLabel(key: string): string {\n const spaced = key.replace(/([a-z0-9])([A-Z])/g, '$1 $2').replace(/[-_]+/g, ' ').trim();\n return spaced.replace(/\\b[a-z]/g, (letter) => letter.toUpperCase());\n}\n\n//#endregion\n\n//#region ---- Inference ----\n\n/**\n * Reads every non-empty property of the stored sections and chooses an editor for it.\n * Null, empty strings that carry no type hint and empty containers are skipped:\n * nothing can be inferred from them, and the stored data keeps them untouched.\n */\nexport function inferReportLayoutFields(sections: Record<string, unknown> | null | undefined): ReportLayoutFieldSchema[] {\n return inferObjectFields(sections ?? {}, '', '', 0);\n}\n\nfunction inferObjectFields(\n value: Record<string, unknown>,\n pathPrefix: string,\n trailPrefix: string,\n depth: number,\n): ReportLayoutFieldSchema[] {\n const fields: ReportLayoutFieldSchema[] = [];\n for (const [key, item] of Object.entries(value)) {\n if (UNSAFE_PATH_KEY.test(key)) {\n continue;\n }\n const path = pathPrefix ? `${pathPrefix}.${key}` : key;\n const trail = trailPrefix ? `${trailPrefix}.${key}` : key;\n const field = inferField(key, path, trail, item, depth);\n if (field) {\n fields.push(field);\n }\n }\n return fields;\n}\n\nfunction inferField(key: string, path: string, trail: string, value: unknown, depth: number): ReportLayoutFieldSchema | null {\n const base = { key, path, trail };\n const locked = LOCKED_TRAILS.has(trail) ? { locked: true } : {};\n\n if (typeof value === 'boolean') {\n return { ...base, kind: 'toggle', ...locked };\n }\n if (typeof value === 'number') {\n return { ...base, kind: 'number', ...locked };\n }\n if (typeof value === 'string') {\n return { ...base, ...inferStringKind(key, trail, value), ...locked };\n }\n if (Array.isArray(value)) {\n return inferArrayField(base, value, depth);\n }\n if (isRecord(value)) {\n return inferRecordField(base, value, depth);\n }\n return null;\n}\n\nfunction inferStringKind(key: string, trail: string, value: string): Pick<ReportLayoutFieldSchema, 'kind' | 'options'> {\n const choices = enumValues(trail);\n if (choices && choices.includes(value)) {\n return { kind: 'select', options: choices };\n }\n const reference = REFERENCE_RULES.find((rule) => rule.pattern.test(trail));\n if (reference) {\n return { kind: reference.kind };\n }\n if (key === 'icon' && /^fa[-\\s]/.test(value)) {\n return { kind: 'icon' };\n }\n if (HEX_OR_FUNCTION_COLOR.test(value.trim())) {\n return { kind: 'color' };\n }\n if (value.includes('\\n') || value.length > TEXT_LENGTH_MULTILINE || key === 'customHtml') {\n return { kind: 'multiline' };\n }\n return { kind: 'text' };\n}\n\nfunction inferArrayField(\n base: Pick<ReportLayoutFieldSchema, 'key' | 'path' | 'trail'>,\n value: unknown[],\n depth: number,\n): ReportLayoutFieldSchema | null {\n const items = value.filter((item) => item != null);\n if (items.length === 0) {\n return null;\n }\n if (items.every((item) => typeof item === 'string')) {\n return { ...base, kind: COLUMN_LIST_TRAILS.has(base.trail) ? 'column-list' : 'tags' };\n }\n if (items.every(isRecord) && depth < MAX_DEPTH) {\n const fields = inferObjectFields(mergeSamples(items as Record<string, unknown>[]), '', base.trail, depth + 1);\n return fields.length > 0 ? { ...base, kind: 'list', fields } : { ...base, kind: 'json' };\n }\n return { ...base, kind: 'json' };\n}\n\nfunction inferRecordField(\n base: Pick<ReportLayoutFieldSchema, 'key' | 'path' | 'trail'>,\n value: Record<string, unknown>,\n depth: number,\n): ReportLayoutFieldSchema | null {\n const keys = Object.keys(value);\n if (keys.length === 0) {\n return null;\n }\n if (isLocaleTextMap(value)) {\n return { ...base, kind: 'locale-text' };\n }\n if (depth >= MAX_DEPTH) {\n return { ...base, kind: 'json' };\n }\n const fields = inferObjectFields(value, base.path, base.trail, depth + 1);\n return fields.length > 0 ? { ...base, kind: 'group', fields } : { ...base, kind: 'json' };\n}\n\n/**\n * Rows of a list may each carry different optional keys.\n * One sample row holds the first value found for every key, so the row template covers all of them.\n */\nfunction mergeSamples(rows: Record<string, unknown>[]): Record<string, unknown> {\n const merged: Record<string, unknown> = {};\n const keys = new Set(rows.flatMap((row) => Object.keys(row)));\n for (const key of keys) {\n const values = rows.map((row) => row[key]).filter((item) => item != null);\n if (values.length === 0) {\n continue;\n }\n if (values.every(isRecord)) {\n merged[key] = mergeSamples(values as Record<string, unknown>[]);\n continue;\n }\n const arrays = values.filter((item): item is unknown[] => Array.isArray(item) && item.length > 0);\n merged[key] = arrays.length > 0 ? arrays[0] : values[0];\n }\n return merged;\n}\n\n/** Query the view reads its rows from, or an empty string while none is chosen. */\nexport function reportLayoutQueryName(sections: Record<string, unknown> | null | undefined): string {\n const dataSource = sections?.['dataSource'];\n if (!isRecord(dataSource) || dataSource['type'] !== 'query') {\n return '';\n }\n const name = dataSource['name'];\n return typeof name === 'string' ? name.trim() : '';\n}\n\n/**\n * Field names already stored on column properties.\n * A picker must keep offering them even when the query catalog does not list them.\n */\nexport function reportLayoutStoredColumns(\n sections: Record<string, unknown> | null | undefined,\n fields: readonly ReportLayoutFieldSchema[],\n): string[] {\n const found = new Set<string>();\n collectStored(sections ?? {}, fields, found, isReportLayoutColumnKind);\n return [...found];\n}\n\n/**\n * Filter names already stored on the filter mapping.\n * A picker must keep offering them even after the filter was removed from the report.\n */\nexport function reportLayoutStoredParameters(\n sections: Record<string, unknown> | null | undefined,\n fields: readonly ReportLayoutFieldSchema[],\n): string[] {\n const found = new Set<string>();\n collectStored(sections ?? {}, fields, found, (kind) => kind === 'parameter');\n return [...found];\n}\n\nfunction collectStored(\n container: Record<string, unknown>,\n fields: readonly ReportLayoutFieldSchema[],\n found: Set<string>,\n matches: (kind: ReportLayoutFieldKind) => boolean,\n): void {\n for (const field of fields) {\n const value = container[field.key];\n if (matches(field.kind)) {\n for (const item of Array.isArray(value) ? value : [value]) {\n if (typeof item === 'string' && item.trim()) {\n found.add(item);\n }\n }\n } else if (field.kind === 'group' && isRecord(value)) {\n collectStored(value, field.fields ?? [], found, matches);\n } else if (field.kind === 'list' && Array.isArray(value)) {\n for (const row of value) {\n if (isRecord(row)) {\n collectStored(row, field.fields ?? [], found, matches);\n }\n }\n }\n }\n}\n\nfunction enumValues(trail: string): readonly string[] | null {\n return ENUM_RULES.find((rule) => rule.pattern.test(trail))?.values ?? null;\n}\n\nfunction isLocaleTextMap(value: Record<string, unknown>): boolean {\n const entries = Object.entries(value);\n return entries.length > 0 && entries.every(([locale, text]) => LOCALE_KEY.test(locale) && (text == null || typeof text === 'string'));\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return value != null && typeof value === 'object' && !Array.isArray(value);\n}\n\n//#endregion\n","import type { AXPMultiLanguageString } from '@acorex-platform/framework-shared/core';\nimport type { AXPReportLayoutPreset } from './report-layout.presets';\nimport type {\n AXPReportColumn,\n AXPReportDataSource,\n AXPReportDefinition,\n AXPReportHeaderFooter,\n AXPReportLayout,\n AXPReportLayoutDefinition,\n AXPReportPdfLayout,\n AXPReportSummaryOptions,\n AXPReportTableLayout,\n AXPQueryDataSource,\n} from './report.types';\nimport type { AXPExportOptions } from '@acorex-platform/framework-shared/core';\n\n//#region ---- Form model ----\n\nexport interface ReportLayoutColumnForm {\n field: string;\n title: string;\n visible?: boolean;\n sortable?: boolean;\n align?: string;\n width?: string;\n widgetType?: string;\n widgetFormat?: string;\n decimals?: string;\n}\n\nexport interface ReportLayoutSummaryForm {\n field: string;\n operation: string;\n displayIn: string;\n}\n\n/** Maps one report filter onto an input of this view's data source. */\nexport interface ReportLayoutInputForm {\n parameterKey: string;\n bindTo: string;\n}\n\n/** Values edited on one static layout tab. */\nexport interface ReportLayoutFormModel {\n enabled: boolean;\n title: AXPMultiLanguageString;\n description: AXPMultiLanguageString;\n isDefault: boolean;\n queryName: string;\n showQuery: boolean;\n dataSourceType: string;\n dataSourceDescription: string;\n queryInputs: ReportLayoutInputForm[];\n pagination: boolean;\n stickyHeader: boolean;\n stripedRows: boolean;\n columns: ReportLayoutColumnForm[];\n summaries: ReportLayoutSummaryForm[];\n xField: string;\n yFields: string;\n groupBy: string;\n showDownloadButton: boolean;\n showPrintButton: boolean;\n showZoomControls: boolean;\n showFullscreenButton: boolean;\n defaultZoom: number;\n headerTitle: string;\n headerShowDate: boolean;\n footerShowDate: boolean;\n fileNameTemplate: string;\n pdfExportEnabled: boolean;\n excelExportEnabled: boolean;\n excelSheetName: string;\n csvExportEnabled: boolean;\n}\n\nexport interface ApplyReportLayoutFormResult {\n layouts: AXPReportLayoutDefinition[];\n defaultLayoutId: string;\n}\n\n//#endregion\n\n//#region ---- Read ----\n\nexport function readReportLayoutForm(\n report: Pick<AXPReportDefinition, 'layouts' | 'defaultLayoutId'> | null | undefined,\n preset: AXPReportLayoutPreset,\n): ReportLayoutFormModel {\n const layouts = report?.layouts ?? [];\n const current = layouts.find((layout) => layoutMatchesPreset(layout, preset));\n const table = current?.layout?.type === 'table' ? current.layout : undefined;\n const chart = current?.layout?.type === 'chart' ? current.layout : undefined;\n const pdf = current?.layout?.type === 'pdf' ? current.layout : undefined;\n const query = current?.dataSource?.type === 'query' ? current.dataSource : undefined;\n\n return {\n enabled: current != null,\n title: displayTitle(current?.title, preset),\n description: current?.description ?? '',\n isDefault: current != null\n ? current.id === report?.defaultLayoutId || current.isDefault === true\n : layouts.length === 0,\n queryName: query?.name ?? '',\n showQuery: current?.dataSource == null || current.dataSource.type === 'query',\n dataSourceType: current?.dataSource?.type ?? 'query',\n dataSourceDescription: current?.dataSource?.description ?? '',\n queryInputs: (query?.inputs ?? []).map((input) => ({\n parameterKey: input.parameterKey,\n bindTo: input.bindTo,\n })),\n pagination: table?.options?.pagination !== false,\n stickyHeader: table?.options?.stickyHeader !== false,\n stripedRows: table?.options?.stripedRows !== false,\n columns: (table?.columns ?? []).map(readColumn),\n summaries: (table?.summary ?? []).map((summary) => ({\n field: summary.field,\n operation: summary.operation,\n displayIn: summary.displayIn,\n })),\n xField: chart?.options?.dataMapping?.xField ?? '',\n yFields: formatYFields(chart?.options?.dataMapping?.yFields),\n groupBy: chart?.options?.dataMapping?.groupBy ?? '',\n showDownloadButton: pdf?.options?.showDownloadButton !== false,\n showPrintButton: pdf?.options?.showPrintButton !== false,\n showZoomControls: pdf?.options?.showZoomControls !== false,\n showFullscreenButton: pdf?.options?.showFullscreenButton !== false,\n defaultZoom: pdf?.options?.defaultZoom ?? 100,\n headerTitle: headerTitle(current?.layout),\n headerShowDate: current?.layout?.header?.showDate === true,\n footerShowDate: current?.layout?.footer?.showDate === true,\n fileNameTemplate: current?.export?.fileNameTemplate ?? '',\n pdfExportEnabled: current?.export?.pdf?.enabled === true,\n excelExportEnabled: current?.export?.excel?.enabled === true,\n excelSheetName: current?.export?.excel?.sheetName ?? '',\n csvExportEnabled: current?.export?.csv?.enabled === true,\n };\n}\n\n//#endregion\n\n//#region ---- Apply ----\n\nexport function applyReportLayoutForm(\n report: Pick<AXPReportDefinition, 'layouts' | 'defaultLayoutId'>,\n preset: AXPReportLayoutPreset,\n form: ReportLayoutFormModel,\n createId: () => string = () => crypto.randomUUID(),\n): ApplyReportLayoutFormResult {\n const layouts = report.layouts ?? [];\n let replaced = false;\n let savedId = '';\n const next: AXPReportLayoutDefinition[] = [];\n\n for (const layout of layouts) {\n if (!layoutMatchesPreset(layout, preset)) {\n next.push(layout);\n continue;\n }\n if (!form.enabled || replaced) {\n continue;\n }\n const saved = buildLayout(layout, preset, form, layout.id);\n savedId = saved.id;\n next.push(saved);\n replaced = true;\n }\n\n if (form.enabled && !replaced) {\n const saved = buildLayout(undefined, preset, form, createId());\n savedId = saved.id;\n next.push(saved);\n }\n\n const defaultLayoutId = resolveDefaultLayoutId(\n report.defaultLayoutId,\n savedId,\n form.enabled,\n form.isDefault,\n next,\n );\n\n return {\n layouts: next.map((layout) => ({ ...layout, isDefault: layout.id === defaultLayoutId })),\n defaultLayoutId,\n };\n}\n\nexport function sameReportLayoutForm(left: ReportLayoutFormModel, right: ReportLayoutFormModel): boolean {\n return (\n left.enabled === right.enabled &&\n left.isDefault === right.isDefault &&\n left.showQuery === right.showQuery &&\n left.queryName.trim() === right.queryName.trim() &&\n left.dataSourceType === right.dataSourceType &&\n left.dataSourceDescription.trim() === right.dataSourceDescription.trim() &&\n sameInputs(left.queryInputs, right.queryInputs) &&\n left.pagination === right.pagination &&\n left.stickyHeader === right.stickyHeader &&\n left.stripedRows === right.stripedRows &&\n left.xField.trim() === right.xField.trim() &&\n left.yFields.trim() === right.yFields.trim() &&\n left.groupBy.trim() === right.groupBy.trim() &&\n left.showDownloadButton === right.showDownloadButton &&\n left.showPrintButton === right.showPrintButton &&\n left.showZoomControls === right.showZoomControls &&\n left.showFullscreenButton === right.showFullscreenButton &&\n left.defaultZoom === right.defaultZoom &&\n left.headerTitle.trim() === right.headerTitle.trim() &&\n left.headerShowDate === right.headerShowDate &&\n left.footerShowDate === right.footerShowDate &&\n left.fileNameTemplate.trim() === right.fileNameTemplate.trim() &&\n left.pdfExportEnabled === right.pdfExportEnabled &&\n left.excelExportEnabled === right.excelExportEnabled &&\n left.excelSheetName.trim() === right.excelSheetName.trim() &&\n left.csvExportEnabled === right.csvExportEnabled &&\n sameText(left.title, right.title) &&\n sameText(left.description, right.description) &&\n sameColumns(left.columns, right.columns) &&\n sameSummaries(left.summaries, right.summaries)\n );\n}\n\n/** Keeps the known form fields when a widget container echoes a wider context object. */\nexport function pickReportLayoutForm(value: Record<string, unknown>, fallback: ReportLayoutFormModel): ReportLayoutFormModel {\n return {\n enabled: typeof value['enabled'] === 'boolean' ? value['enabled'] : fallback.enabled,\n title: isText(value['title']) ? value['title'] : fallback.title,\n description: isText(value['description']) ? value['description'] : fallback.description,\n isDefault: typeof value['isDefault'] === 'boolean' ? value['isDefault'] : fallback.isDefault,\n queryName: typeof value['queryName'] === 'string' ? value['queryName'] : fallback.queryName,\n showQuery: fallback.showQuery,\n dataSourceType: typeof value['dataSourceType'] === 'string' ? value['dataSourceType'] : fallback.dataSourceType,\n dataSourceDescription: typeof value['dataSourceDescription'] === 'string' ? value['dataSourceDescription'] : fallback.dataSourceDescription,\n queryInputs: Array.isArray(value['queryInputs']) ? normalizeInputs(value['queryInputs']) : fallback.queryInputs,\n pagination: typeof value['pagination'] === 'boolean' ? value['pagination'] : fallback.pagination,\n stickyHeader: typeof value['stickyHeader'] === 'boolean' ? value['stickyHeader'] : fallback.stickyHeader,\n stripedRows: typeof value['stripedRows'] === 'boolean' ? value['stripedRows'] : fallback.stripedRows,\n columns: Array.isArray(value['columns']) ? normalizeColumns(value['columns']) : fallback.columns,\n summaries: Array.isArray(value['summaries']) ? normalizeSummaries(value['summaries']) : fallback.summaries,\n xField: typeof value['xField'] === 'string' ? value['xField'] : fallback.xField,\n yFields: typeof value['yFields'] === 'string' ? value['yFields'] : fallback.yFields,\n groupBy: typeof value['groupBy'] === 'string' ? value['groupBy'] : fallback.groupBy,\n showDownloadButton: typeof value['showDownloadButton'] === 'boolean' ? value['showDownloadButton'] : fallback.showDownloadButton,\n showPrintButton: typeof value['showPrintButton'] === 'boolean' ? value['showPrintButton'] : fallback.showPrintButton,\n showZoomControls: typeof value['showZoomControls'] === 'boolean' ? value['showZoomControls'] : fallback.showZoomControls,\n showFullscreenButton: typeof value['showFullscreenButton'] === 'boolean' ? value['showFullscreenButton'] : fallback.showFullscreenButton,\n defaultZoom: typeof value['defaultZoom'] === 'number' ? value['defaultZoom'] : fallback.defaultZoom,\n headerTitle: typeof value['headerTitle'] === 'string' ? value['headerTitle'] : fallback.headerTitle,\n headerShowDate: typeof value['headerShowDate'] === 'boolean' ? value['headerShowDate'] : fallback.headerShowDate,\n footerShowDate: typeof value['footerShowDate'] === 'boolean' ? value['footerShowDate'] : fallback.footerShowDate,\n fileNameTemplate: typeof value['fileNameTemplate'] === 'string' ? value['fileNameTemplate'] : fallback.fileNameTemplate,\n pdfExportEnabled: typeof value['pdfExportEnabled'] === 'boolean' ? value['pdfExportEnabled'] : fallback.pdfExportEnabled,\n excelExportEnabled: typeof value['excelExportEnabled'] === 'boolean' ? value['excelExportEnabled'] : fallback.excelExportEnabled,\n excelSheetName: typeof value['excelSheetName'] === 'string' ? value['excelSheetName'] : fallback.excelSheetName,\n csvExportEnabled: typeof value['csvExportEnabled'] === 'boolean' ? value['csvExportEnabled'] : fallback.csvExportEnabled,\n };\n}\n\n//#endregion\n\n//#region ---- Matching and mapping ----\n\nexport function layoutMatchesPreset(layout: AXPReportLayoutDefinition, preset: AXPReportLayoutPreset): boolean {\n if (layout.layout?.type !== preset.layoutType) {\n return false;\n }\n if (preset.layoutType !== 'chart') {\n return true;\n }\n return layout.layout.type === 'chart' && layout.layout.options?.chartType === preset.chartType;\n}\n\nfunction buildLayout(\n existing: AXPReportLayoutDefinition | undefined,\n preset: AXPReportLayoutPreset,\n form: ReportLayoutFormModel,\n id: string,\n): AXPReportLayoutDefinition {\n const layout: AXPReportLayoutDefinition = {\n ...existing,\n id,\n title: storedTitle(form.title, preset),\n icon: preset.icon,\n layout: buildLayoutBody(existing?.layout, preset, form),\n };\n const description = storedOptionalText(form.description);\n if (description == null) {\n delete layout.description;\n } else {\n layout.description = description;\n }\n const dataSource = buildDataSource(existing?.dataSource, preset, form);\n if (dataSource == null) {\n delete layout.dataSource;\n } else {\n layout.dataSource = dataSource;\n }\n const exportOptions = buildExport(existing?.export, form);\n if (exportOptions == null) {\n delete layout.export;\n } else {\n layout.export = exportOptions;\n }\n return layout;\n}\n\nfunction buildLayoutBody(\n existing: AXPReportLayout | undefined,\n preset: AXPReportLayoutPreset,\n form: ReportLayoutFormModel,\n): AXPReportLayout {\n if (preset.layoutType === 'table') {\n const table = existing?.type === 'table' ? existing : undefined;\n const summary = mergeSummaries(form.summaries);\n const body: AXPReportTableLayout = {\n ...table,\n type: 'table',\n columns: mergeColumns(table?.columns, form.columns),\n options: {\n ...table?.options,\n pagination: form.pagination,\n stickyHeader: form.stickyHeader,\n stripedRows: form.stripedRows,\n },\n };\n if (summary.length > 0) {\n body.summary = summary;\n } else {\n delete body.summary;\n }\n return body;\n }\n\n if (preset.layoutType === 'chart') {\n const chart = existing?.type === 'chart' ? existing : undefined;\n return {\n ...chart,\n type: 'chart',\n options: {\n ...chart?.options,\n chartType: preset.chartType ?? 'bar',\n dataMapping: chartMapping(chart?.options?.dataMapping, form),\n },\n };\n }\n\n const pdf = existing?.type === 'pdf' ? existing : undefined;\n const header = buildHeaderFooter(pdf?.header, form.headerTitle, form.headerShowDate);\n const footer = buildHeaderFooter(pdf?.footer, '', form.footerShowDate);\n const body: AXPReportPdfLayout = {\n ...pdf,\n type: 'pdf',\n options: {\n ...pdf?.options,\n showDownloadButton: form.showDownloadButton,\n showPrintButton: form.showPrintButton,\n showZoomControls: form.showZoomControls,\n showFullscreenButton: form.showFullscreenButton,\n defaultZoom: form.defaultZoom,\n },\n };\n if (header) {\n body.header = header;\n } else {\n delete body.header;\n }\n if (footer) {\n body.footer = footer;\n } else {\n delete body.footer;\n }\n return body;\n}\n\nfunction buildDataSource(\n existing: AXPReportDataSource | undefined,\n preset: AXPReportLayoutPreset,\n form: ReportLayoutFormModel,\n): AXPReportDataSource | undefined {\n const requested = form.dataSourceType.trim() || existing?.type || 'query';\n if (requested !== 'query') {\n if (existing?.type !== requested) {\n return existing;\n }\n const kept = { ...existing };\n const description = form.dataSourceDescription.trim();\n if (description) {\n kept.description = description;\n } else {\n delete kept.description;\n }\n return kept;\n }\n const name = form.queryName.trim();\n if (!name) {\n return undefined;\n }\n const query: AXPQueryDataSource = existing?.type === 'query'\n ? { ...existing, type: 'query', name }\n : { type: 'query', name };\n const description = form.dataSourceDescription.trim();\n if (description) {\n query.description = description;\n } else {\n delete query.description;\n }\n const inputs = form.queryInputs\n .map((input) => ({ parameterKey: input.parameterKey.trim(), bindTo: input.bindTo.trim() }))\n .filter((input) => input.parameterKey.length > 0 && input.bindTo.length > 0);\n if (inputs.length > 0) {\n query.inputs = inputs;\n } else {\n delete query.inputs;\n }\n if (preset.layoutType === 'table') {\n query.pagination = form.pagination;\n }\n return query;\n}\n\nfunction mergeColumns(existing: AXPReportColumn[] | undefined, rows: ReportLayoutColumnForm[]): AXPReportColumn[] {\n const previous = new Map((existing ?? []).map((column) => [column.field, column]));\n return rows\n .map((row) => ({ ...row, field: row.field.trim(), title: row.title.trim() }))\n .filter((row) => row.field.length > 0)\n .map((row) => {\n const prior = previous.get(row.field);\n const column: AXPReportColumn = {\n ...prior,\n field: row.field,\n title: row.title || prior?.title || row.field,\n visible: row.visible ?? prior?.visible ?? true,\n };\n if (row.sortable !== undefined) {\n column.sortable = row.sortable;\n }\n if (row.align !== undefined) {\n const align = row.align.trim();\n if (align === 'left' || align === 'center' || align === 'right') {\n column.align = align;\n } else {\n delete column.align;\n }\n }\n if (row.width !== undefined) {\n const width = parseWidth(row.width);\n if (width == null) {\n delete column.width;\n } else {\n column.width = width;\n }\n }\n if (row.widgetType !== undefined) {\n const widget = buildColumnWidget(row, row.field);\n if (widget == null) {\n delete column.widget;\n } else {\n column.widget = widget;\n }\n }\n return column;\n });\n}\n\nfunction resolveDefaultLayoutId(\n currentDefault: string | undefined,\n savedId: string,\n enabled: boolean,\n isDefault: boolean,\n layouts: AXPReportLayoutDefinition[],\n): string {\n if (!enabled) {\n if (currentDefault && layouts.some((layout) => layout.id === currentDefault)) {\n return currentDefault;\n }\n return layouts[0]?.id ?? '';\n }\n if (isDefault || layouts.length === 1 || !currentDefault) {\n return savedId;\n }\n if (currentDefault === savedId && !isDefault) {\n return layouts.find((layout) => layout.id !== savedId)?.id ?? savedId;\n }\n if (!layouts.some((layout) => layout.id === currentDefault)) {\n return savedId;\n }\n return currentDefault;\n}\n\nfunction displayTitle(title: AXPMultiLanguageString | undefined, preset: AXPReportLayoutPreset): AXPMultiLanguageString {\n if (title == null || title === preset.title || isBlankText(title)) {\n return '';\n }\n return title;\n}\n\nfunction storedTitle(title: AXPMultiLanguageString, preset: AXPReportLayoutPreset): AXPMultiLanguageString {\n return isBlankText(title) ? preset.title : title;\n}\n\nfunction storedOptionalText(value: AXPMultiLanguageString): AXPMultiLanguageString | undefined {\n return isBlankText(value) ? undefined : value;\n}\n\nfunction formatYFields(value: string | string[] | undefined): string {\n return Array.isArray(value) ? value.join(', ') : value ?? '';\n}\n\nfunction parseYFields(value: string): string | string[] {\n const parts = value.split(',').map((part) => part.trim()).filter((part) => part.length > 0);\n if (parts.length <= 1) {\n return parts[0] ?? '';\n }\n return parts;\n}\n\nfunction normalizeInputs(value: unknown[]): ReportLayoutInputForm[] {\n return value.flatMap((row) => {\n if (row == null || typeof row !== 'object') {\n return [];\n }\n const record = row as Record<string, unknown>;\n return [{\n parameterKey: typeof record['parameterKey'] === 'string' ? record['parameterKey'] : '',\n bindTo: typeof record['bindTo'] === 'string' ? record['bindTo'] : '',\n }];\n });\n}\n\nfunction sameInputs(left: ReportLayoutInputForm[], right: ReportLayoutInputForm[]): boolean {\n return left.length === right.length && left.every((input, index) => {\n const other = right[index];\n return input.parameterKey.trim() === other?.parameterKey.trim() && input.bindTo.trim() === other?.bindTo.trim();\n });\n}\n\nfunction normalizeSummaries(value: unknown[]): ReportLayoutSummaryForm[] {\n return value.flatMap((row) => {\n if (row == null || typeof row !== 'object') {\n return [];\n }\n const record = row as Record<string, unknown>;\n return [{\n field: typeof record['field'] === 'string' ? record['field'] : '',\n operation: typeof record['operation'] === 'string' ? record['operation'] : '',\n displayIn: typeof record['displayIn'] === 'string' ? record['displayIn'] : '',\n }];\n });\n}\n\nfunction normalizeColumns(value: unknown[]): ReportLayoutColumnForm[] {\n return value.flatMap((row) => {\n if (row == null || typeof row !== 'object') {\n return [];\n }\n const record = row as Record<string, unknown>;\n return [{\n field: typeof record['field'] === 'string' ? record['field'] : '',\n title: typeof record['title'] === 'string' ? record['title'] : '',\n visible: typeof record['visible'] === 'boolean' ? record['visible'] : true,\n sortable: record['sortable'] === true,\n align: typeof record['align'] === 'string' ? record['align'] : '',\n width: typeof record['width'] === 'string' || typeof record['width'] === 'number' ? String(record['width']) : '',\n widgetType: typeof record['widgetType'] === 'string' ? record['widgetType'] : '',\n widgetFormat: typeof record['widgetFormat'] === 'string' ? record['widgetFormat'] : '',\n decimals: typeof record['decimals'] === 'string' || typeof record['decimals'] === 'number' ? String(record['decimals']) : '',\n }];\n });\n}\n\nfunction isText(value: unknown): value is AXPMultiLanguageString {\n if (typeof value === 'string') {\n return true;\n }\n if (value == null || typeof value !== 'object' || Array.isArray(value)) {\n return false;\n }\n return Object.values(value).every((item) => typeof item === 'string');\n}\n\nfunction isBlankText(value: AXPMultiLanguageString | undefined): boolean {\n if (value == null) {\n return true;\n }\n if (typeof value === 'string') {\n return value.trim().length === 0;\n }\n return Object.values(value).every((item) => item.trim().length === 0);\n}\n\nfunction sameText(left: AXPMultiLanguageString, right: AXPMultiLanguageString): boolean {\n if (isBlankText(left) && isBlankText(right)) {\n return true;\n }\n if (typeof left === 'string' || typeof right === 'string') {\n return left === right;\n }\n const keys = new Set([...Object.keys(left), ...Object.keys(right)]);\n for (const key of keys) {\n if ((left[key] ?? '').trim() !== (right[key] ?? '').trim()) {\n return false;\n }\n }\n return true;\n}\n\nfunction sameColumns(left: ReportLayoutColumnForm[], right: ReportLayoutColumnForm[]): boolean {\n const a = left.map(normalizeColumnIdentity);\n const b = right.map(normalizeColumnIdentity);\n if (a.length !== b.length) {\n return false;\n }\n return a.every((row, index) => JSON.stringify(row) === JSON.stringify(b[index]));\n}\n\nfunction normalizeColumnIdentity(row: ReportLayoutColumnForm): ReportLayoutColumnForm {\n return {\n field: row.field.trim(),\n title: row.title.trim(),\n visible: row.visible !== false,\n sortable: row.sortable === true,\n align: row.align?.trim() ?? '',\n width: row.width?.trim() ?? '',\n widgetType: row.widgetType?.trim() ?? '',\n widgetFormat: row.widgetFormat?.trim() ?? '',\n decimals: row.decimals?.trim() ?? '',\n };\n}\n\nfunction sameSummaries(left: ReportLayoutSummaryForm[], right: ReportLayoutSummaryForm[]): boolean {\n const normalize = (rows: ReportLayoutSummaryForm[]) =>\n rows.map((row) => ({\n field: row.field.trim(),\n operation: row.operation.trim(),\n displayIn: row.displayIn.trim(),\n }));\n return JSON.stringify(normalize(left)) === JSON.stringify(normalize(right));\n}\n\nfunction readColumn(column: AXPReportColumn): ReportLayoutColumnForm {\n const widget = column.widget;\n const options = widget?.options ?? {};\n return {\n field: column.field,\n title: column.title ?? '',\n visible: column.visible !== false,\n sortable: column.sortable === true,\n align: column.align ?? '',\n width: column.width == null ? '' : String(column.width),\n widgetType: widget?.type ?? '',\n widgetFormat: typeof options['format'] === 'string' ? options['format'] : '',\n decimals: options['decimals'] == null ? '' : String(options['decimals']),\n };\n}\n\nfunction headerTitle(layout: AXPReportLayout | undefined): string {\n const title = layout?.header?.title;\n return typeof title === 'string' ? title : '';\n}\n\nfunction chartMapping(\n existing: { xField: string; yFields: string | string[]; groupBy?: string } | undefined,\n form: ReportLayoutFormModel,\n) {\n const mapping = {\n ...existing,\n xField: form.xField.trim(),\n yFields: parseYFields(form.yFields),\n };\n const groupBy = form.groupBy.trim();\n if (groupBy) {\n mapping.groupBy = groupBy;\n } else {\n delete mapping.groupBy;\n }\n return mapping;\n}\n\nfunction buildHeaderFooter(\n existing: AXPReportHeaderFooter | undefined,\n title: string,\n showDate: boolean,\n): AXPReportHeaderFooter | undefined {\n const next: AXPReportHeaderFooter = { ...existing, showDate };\n const trimmed = title.trim();\n if (trimmed) {\n next.title = trimmed;\n } else {\n delete next.title;\n }\n const hasContent = Boolean(next.title || next.logoUrl || next.showDate || next.showParameters || next.customHtml);\n return hasContent ? next : undefined;\n}\n\nfunction buildExport(existing: AXPExportOptions | undefined, form: ReportLayoutFormModel): AXPExportOptions | undefined {\n const fileNameTemplate = form.fileNameTemplate.trim();\n const sheetName = form.excelSheetName.trim();\n const touched = Boolean(\n fileNameTemplate ||\n sheetName ||\n form.pdfExportEnabled ||\n form.excelExportEnabled ||\n form.csvExportEnabled ||\n existing,\n );\n if (!touched) {\n return undefined;\n }\n return {\n ...existing,\n ...(fileNameTemplate ? { fileNameTemplate } : {}),\n pdf: { ...existing?.pdf, enabled: form.pdfExportEnabled },\n excel: {\n ...existing?.excel,\n enabled: form.excelExportEnabled,\n ...(sheetName ? { sheetName } : {}),\n },\n csv: { ...existing?.csv, enabled: form.csvExportEnabled },\n };\n}\n\nfunction mergeSummaries(rows: ReportLayoutSummaryForm[]): AXPReportSummaryOptions[] {\n return rows.flatMap((row) => {\n const field = row.field.trim();\n const operation = row.operation.trim();\n const displayIn = row.displayIn.trim();\n if (!field || !isSummaryOperation(operation) || !isSummaryDisplay(displayIn)) {\n return [];\n }\n return [{ field, operation, displayIn }];\n });\n}\n\nfunction isSummaryOperation(value: string): value is AXPReportSummaryOptions['operation'] {\n return value === 'sum' || value === 'avg' || value === 'count' || value === 'min' || value === 'max';\n}\n\nfunction isSummaryDisplay(value: string): value is AXPReportSummaryOptions['displayIn'] {\n return value === 'groupFooter' || value === 'reportFooter';\n}\n\nfunction parseWidth(value: string | undefined): number | 'auto' | undefined {\n const trimmed = value?.trim() ?? '';\n if (!trimmed) {\n return undefined;\n }\n if (trimmed === 'auto') {\n return 'auto';\n }\n const width = Number(trimmed);\n return Number.isFinite(width) ? width : undefined;\n}\n\nfunction buildColumnWidget(row: ReportLayoutColumnForm, field: string): AXPReportColumn['widget'] {\n const type = row.widgetType?.trim() ?? '';\n if (!type) {\n return undefined;\n }\n const options: Record<string, unknown> = {};\n const format = row.widgetFormat?.trim() ?? '';\n if (format) {\n options['format'] = format;\n }\n const decimals = row.decimals?.trim() ?? '';\n if (decimals && Number.isFinite(Number(decimals))) {\n options['decimals'] = Number(decimals);\n }\n return { type, path: field, options };\n}\n\n//#endregion\n","import { layoutMatchesPreset } from './report-layout-form.util';\nimport type { AXPReportLayoutPreset } from './report-layout.presets';\nimport type { AXPReportLayoutDefinition } from './report.types';\n\n//#region ---- Layout JSON sections ----\n\n/** One stored JSON object on a report layout, shown as its own field. */\nexport interface ReportLayoutJsonSection {\n name: 'layout' | 'dataSource' | 'actions' | 'export';\n labelKey: 'layout' | 'data-source' | 'actions' | 'export';\n value: unknown;\n}\n\n/**\n * The definition stores each view as JSON objects, not as the few switches on the page.\n * Returns only the objects that are actually present on the matching layout.\n */\nexport function reportLayoutJsonSections(\n report: { layouts?: AXPReportLayoutDefinition[] } | null | undefined,\n preset: AXPReportLayoutPreset,\n): ReportLayoutJsonSection[] {\n const current = (report?.layouts ?? []).find((layout) => layoutMatchesPreset(layout, preset));\n if (!current) {\n return [];\n }\n\n const sections: ReportLayoutJsonSection[] = [];\n pushSection(sections, 'layout', 'layout', current.layout);\n pushSection(sections, 'dataSource', 'data-source', current.dataSource);\n pushSection(sections, 'actions', 'actions', current.actions);\n pushSection(sections, 'export', 'export', current.export);\n return sections;\n}\n\nfunction pushSection(\n sections: ReportLayoutJsonSection[],\n name: ReportLayoutJsonSection['name'],\n labelKey: ReportLayoutJsonSection['labelKey'],\n value: unknown,\n): void {\n if (!hasJsonContent(value)) {\n return;\n }\n sections.push({ name, labelKey, value });\n}\n\nfunction hasJsonContent(value: unknown): boolean {\n if (Array.isArray(value)) {\n return value.length > 0;\n }\n if (value != null && typeof value === 'object') {\n return Object.keys(value).length > 0;\n }\n return false;\n}\n\n//#endregion\n","import type { AXPReportLayoutPreset } from './report-layout.presets';\n\n//#region ---- Types ----\n\n/** Stored objects of one view, keyed by section name. Same shape the layout page edits. */\ntype StarterSections = Record<string, unknown>;\n\n//#endregion\n\n//#region ---- Starter shape ----\n\n/** `inputs` maps report filters to fields of the query rows. It is one sample row, never stored as is. */\nconst QUERY_DATA_SOURCE = { type: 'query', name: '', description: '', inputs: [{ parameterKey: '', bindTo: '' }] };\n\nconst EXPORT_OPTIONS = {\n fileNameTemplate: '',\n pdf: { enabled: false },\n excel: { enabled: false, sheetName: '' },\n csv: { enabled: false },\n};\n\n/**\n * The keys a view needs, with one sample value per key so the page can choose an editor for it.\n * A list holds one sample row. The sample only gives the row its fields; it is never stored.\n */\nexport function reportLayoutStarterShape(preset: AXPReportLayoutPreset): StarterSections {\n if (preset.layoutType === 'table') {\n return {\n layout: {\n type: 'table',\n columns: [{ field: '', title: '', visible: true, sortable: false, align: 'left' }],\n options: { pagination: true, stickyHeader: true, stripedRows: true },\n },\n dataSource: { ...QUERY_DATA_SOURCE },\n export: cloneJson(EXPORT_OPTIONS),\n };\n }\n if (preset.layoutType === 'chart') {\n return {\n layout: {\n type: 'chart',\n options: {\n chartType: preset.chartType ?? 'bar',\n dataMapping: { xField: '', yFields: [''], groupBy: '', seriesField: '', labelField: '' },\n },\n },\n dataSource: { ...QUERY_DATA_SOURCE },\n export: cloneJson(EXPORT_OPTIONS),\n };\n }\n return {\n layout: {\n type: 'pdf',\n options: {\n showDownloadButton: true,\n showPrintButton: true,\n showZoomControls: true,\n showFullscreenButton: true,\n defaultZoom: 100,\n height: '',\n },\n header: { title: '', showDate: false },\n footer: { showDate: false },\n },\n dataSource: { ...QUERY_DATA_SOURCE },\n export: cloneJson(EXPORT_OPTIONS),\n };\n}\n\n//#endregion\n\n//#region ---- Starter values ----\n\n/**\n * Values a view that is not stored yet starts with.\n * Fixed keys (`type`, `chartType`) and switches that default to on are filled. Everything else is blank,\n * lists are empty and `false` switches stay unset, so nothing is stored until the user enters it.\n */\nexport function reportLayoutStarterValues(preset: AXPReportLayoutPreset): StarterSections {\n return blankOut(reportLayoutStarterShape(preset)) as StarterSections;\n}\n\nfunction blankOut(value: unknown): unknown {\n if (Array.isArray(value)) {\n return [];\n }\n if (value != null && typeof value === 'object') {\n const result: Record<string, unknown> = {};\n for (const [key, item] of Object.entries(value)) {\n if (item === false) {\n continue;\n }\n result[key] = blankOut(item);\n }\n return result;\n }\n return value;\n}\n\nfunction cloneJson<T>(value: T): T {\n return JSON.parse(JSON.stringify(value)) as T;\n}\n\n//#endregion\n","import { layoutMatchesPreset } from './report-layout-form.util';\nimport { inferReportLayoutFields, reportLayoutQueryName, type ReportLayoutFieldSchema } from './report-layout-field-schema';\nimport { reportLayoutJsonSections } from './report-layout-json-sections';\nimport { reportLayoutStarterShape, reportLayoutStarterValues } from './report-layout-starter';\nimport type { AXPReportLayoutPreset } from './report-layout.presets';\nimport type { AXPReportLayoutAction, AXPReportLayoutDefinition } from './report.types';\n\n//#region ---- Types ----\n\n/** The stored objects of one view, keyed by section name. This is what the page edits. */\nexport type ReportLayoutSectionsModel = Record<string, unknown>;\n\n//#endregion\n\n//#region ---- Server to UI ----\n\n/**\n * Copies the stored objects of one view for the editing page.\n * The widgets write into this copy, so the loaded report definition is never touched.\n * A view that is not stored yet starts from the keys it needs, so it can be defined from scratch.\n */\nexport function readReportLayoutSections(\n report: Parameters<typeof reportLayoutJsonSections>[0],\n preset: AXPReportLayoutPreset,\n): ReportLayoutSectionsModel {\n const sections: ReportLayoutSectionsModel = {};\n for (const section of reportLayoutJsonSections(report, preset)) {\n sections[section.name] = cloneStoredJson(section.value);\n }\n return Object.keys(sections).length > 0 ? sections : (reportLayoutStarterValues(preset) as ReportLayoutSectionsModel);\n}\n\n/**\n * Maps every report filter to the field of the view's query that has the same name.\n * Filters the view already maps are left as they are, so a choice made on the page always wins.\n * Returns the given sections untouched when the view has no query or nothing needs mapping.\n */\nexport function autoMapReportLayoutInputs(\n sections: ReportLayoutSectionsModel,\n parameterKeys: readonly string[],\n columns: readonly string[],\n): ReportLayoutSectionsModel {\n const dataSource = sections['dataSource'];\n if (!isRecord(dataSource) || reportLayoutQueryName(sections) === '') {\n return sections;\n }\n const stored = Array.isArray(dataSource['inputs']) ? (dataSource['inputs'] as unknown[]) : [];\n const mapped = new Set(stored.filter(isRecord).map((row) => row['parameterKey']));\n const available = new Set(columns);\n const added = [...new Set(parameterKeys)]\n .filter((key) => key !== '' && available.has(key) && !mapped.has(key))\n .map((key) => ({ parameterKey: key, bindTo: key }));\n if (added.length === 0) {\n return sections;\n }\n return { ...sections, dataSource: { ...dataSource, inputs: [...stored, ...added] } };\n}\n\n/**\n * Editors for one view: every stored property, plus the keys the view needs that are not stored yet.\n * The page and the cleaning below must use the same schema.\n */\nexport function reportLayoutFieldSchema(\n baseline: ReportLayoutSectionsModel,\n preset?: AXPReportLayoutPreset,\n): ReportLayoutFieldSchema[] {\n return inferReportLayoutFields(preset ? addMissingKeys(baseline, reportLayoutStarterShape(preset)) : baseline);\n}\n\n//#endregion\n\n//#region ---- UI to server ----\n\n/**\n * Turns edited section values back into the shape the server stores.\n * Only the properties the page can edit are normalised; every other stored key travels through as it was.\n * `baseline` is the section copy the page started from. It decides which properties are editable.\n */\nexport function cleanReportLayoutSections(\n baseline: ReportLayoutSectionsModel,\n edited: ReportLayoutSectionsModel | null | undefined,\n preset?: AXPReportLayoutPreset,\n): ReportLayoutSectionsModel {\n const result = cloneStoredJson(edited ?? {}) as ReportLayoutSectionsModel;\n for (const field of reportLayoutFieldSchema(baseline, preset)) {\n cleanField(result, field);\n }\n return result;\n}\n\n/** True when the edited sections differ from the baseline once both are normalised. */\nexport function reportLayoutSectionsChanged(\n baseline: ReportLayoutSectionsModel,\n edited: ReportLayoutSectionsModel | null | undefined,\n preset?: AXPReportLayoutPreset,\n): boolean {\n return !sameJson(\n cleanReportLayoutSections(baseline, baseline, preset),\n cleanReportLayoutSections(baseline, edited, preset),\n );\n}\n\n/**\n * Writes the edited sections onto the layout of this preset.\n * A section is written when the view already stored it or the user entered something in it.\n * The layout `type` and chart type stay the ones the tab stands for.\n */\nexport function applyReportLayoutSections(\n layouts: AXPReportLayoutDefinition[],\n preset: AXPReportLayoutPreset,\n baseline: ReportLayoutSectionsModel,\n edited: ReportLayoutSectionsModel | null | undefined,\n): AXPReportLayoutDefinition[] {\n const cleaned = cleanReportLayoutSections(baseline, edited, preset);\n return layouts.map((layout) => {\n if (!layoutMatchesPreset(layout, preset)) {\n return layout;\n }\n const next: AXPReportLayoutDefinition = { ...layout };\n if (isRecord(cleaned['layout'])) {\n next.layout = fixedLayout(cleaned['layout'], layout, preset);\n }\n if (shouldWrite(baseline, cleaned, 'dataSource')) {\n assignOrRemove(next, 'dataSource', usableDataSource(cleaned['dataSource']));\n }\n if (shouldWrite(baseline, cleaned, 'actions')) {\n assignOrRemove(next, 'actions', cleaned['actions'] as AXPReportLayoutAction[] | undefined);\n }\n if (shouldWrite(baseline, cleaned, 'export')) {\n assignOrRemove(next, 'export', cleaned['export'] as AXPReportLayoutDefinition['export']);\n }\n return next;\n });\n}\n\nfunction shouldWrite(baseline: ReportLayoutSectionsModel, cleaned: ReportLayoutSectionsModel, name: string): boolean {\n return name in baseline || hasContent(cleaned[name]);\n}\n\n/** The tab decides the layout type and chart type, so editing the sections cannot move the view elsewhere. */\nfunction fixedLayout(\n edited: Record<string, unknown>,\n stored: AXPReportLayoutDefinition,\n preset: AXPReportLayoutPreset,\n): AXPReportLayoutDefinition['layout'] {\n const layout: Record<string, unknown> = { ...edited, type: stored.layout.type };\n if (preset.layoutType === 'chart') {\n layout['options'] = { ...(isRecord(layout['options']) ? layout['options'] : {}), chartType: preset.chartType ?? 'bar' };\n }\n return layout as unknown as AXPReportLayoutDefinition['layout'];\n}\n\n/** A query data source without a query name is not a data source yet. */\nfunction usableDataSource(value: unknown): AXPReportLayoutDefinition['dataSource'] {\n if (!isRecord(value)) {\n return undefined;\n }\n if (value['type'] === 'query' && typeof value['name'] !== 'string') {\n return undefined;\n }\n return value as unknown as AXPReportLayoutDefinition['dataSource'];\n}\n\n//#endregion\n\n//#region ---- Starter keys ----\n\n/**\n * Copy of the stored sections with the keys a view needs added where they are missing.\n * Used for editor inference only. A record whose `type` differs from the starter's is left alone.\n */\nfunction addMissingKeys(stored: ReportLayoutSectionsModel, shape: Record<string, unknown>): ReportLayoutSectionsModel {\n const result = cloneStoredJson(stored);\n mergeShape(result, shape);\n return result;\n}\n\nfunction mergeShape(target: Record<string, unknown>, shape: Record<string, unknown>): void {\n for (const [key, sample] of Object.entries(shape)) {\n const current = target[key];\n if (current == null) {\n target[key] = cloneStoredJson(sample);\n } else if (isRecord(current) && isRecord(sample)) {\n if (!hasOtherType(current, sample)) {\n mergeShape(current, sample);\n }\n } else if (Array.isArray(current) && Array.isArray(sample)) {\n mergeSampleItems(target, key, current, sample);\n }\n }\n}\n\nfunction mergeSampleItems(target: Record<string, unknown>, key: string, current: unknown[], sample: unknown[]): void {\n if (current.length === 0) {\n target[key] = cloneStoredJson(sample);\n return;\n }\n if (current.every(isRecord) && sample.every(isRecord)) {\n target[key] = [...current, ...cloneStoredJson(sample)];\n }\n}\n\nfunction hasOtherType(current: Record<string, unknown>, sample: Record<string, unknown>): boolean {\n return typeof current['type'] === 'string' && typeof sample['type'] === 'string' && current['type'] !== sample['type'];\n}\n\n//#endregion\n\n//#region ---- Field cleaning ----\n\nfunction cleanField(container: Record<string, unknown>, field: ReportLayoutFieldSchema): void {\n const value = container[field.key];\n switch (field.kind) {\n case 'group':\n cleanGroup(container, field, value);\n return;\n case 'list':\n cleanList(container, field, value);\n return;\n case 'toggle':\n assignOrDelete(container, field.key, typeof value === 'boolean' ? value : value == null ? undefined : Boolean(value));\n return;\n case 'number':\n assignOrDelete(container, field.key, toNumber(value));\n return;\n case 'tags':\n case 'column-list':\n cleanTags(container, field.key, value);\n return;\n case 'locale-text':\n cleanLocaleText(container, field.key, value);\n return;\n case 'json':\n return;\n default:\n assignOrDelete(container, field.key, toText(value));\n }\n}\n\nfunction cleanGroup(container: Record<string, unknown>, field: ReportLayoutFieldSchema, value: unknown): void {\n if (!isRecord(value)) {\n delete container[field.key];\n return;\n }\n for (const child of field.fields ?? []) {\n cleanField(value, child);\n }\n if (Object.keys(value).length === 0) {\n delete container[field.key];\n }\n}\n\nfunction cleanList(container: Record<string, unknown>, field: ReportLayoutFieldSchema, value: unknown): void {\n if (!Array.isArray(value)) {\n delete container[field.key];\n return;\n }\n const children = field.fields ?? [];\n const rowsHaveId = children.some((child) => child.key === 'id');\n const rows = value.filter(isRecord);\n for (const row of rows) {\n for (const child of children) {\n cleanField(row, child);\n }\n // The repeater stamps an `id` on every row it adds. Keep it only when the stored rows carry one.\n if (!rowsHaveId) {\n delete row['id'];\n }\n }\n const kept = rows.filter((row) => Object.keys(row).length > 0);\n assignOrDelete(container, field.key, kept.length > 0 ? kept : undefined);\n}\n\nfunction cleanTags(container: Record<string, unknown>, key: string, value: unknown): void {\n if (!Array.isArray(value)) {\n delete container[key];\n return;\n }\n // A multi select may hand back its rows (`{ id }`). The server stores the bare values.\n const bare = value.map((tag) => (isRecord(tag) && 'id' in tag ? tag['id'] : tag));\n const tags = bare.filter((tag) => (typeof tag === 'string' ? tag.trim().length > 0 : tag != null));\n assignOrDelete(container, key, tags.length > 0 ? tags : undefined);\n}\n\nfunction cleanLocaleText(container: Record<string, unknown>, key: string, value: unknown): void {\n if (isRecord(value)) {\n const entries = Object.entries(value).filter(([, text]) => typeof text === 'string' && text.trim().length > 0);\n assignOrDelete(container, key, entries.length > 0 ? Object.fromEntries(entries) : undefined);\n return;\n }\n assignOrDelete(container, key, toText(value));\n}\n\n//#endregion\n\n//#region ---- Value helpers ----\n\n/** A select widget may hand back its row (`{ id }`). The server stores the bare value. */\nfunction toText(value: unknown): string | undefined {\n const raw = isRecord(value) && 'id' in value ? value['id'] : value;\n if (raw == null) {\n return undefined;\n }\n const text = typeof raw === 'string' ? raw : typeof raw === 'number' ? String(raw) : undefined;\n return text != null && text.trim().length > 0 ? text : undefined;\n}\n\nfunction toNumber(value: unknown): number | undefined {\n if (typeof value === 'number') {\n return Number.isFinite(value) ? value : undefined;\n }\n if (typeof value === 'string' && value.trim().length > 0) {\n const parsed = Number(value);\n return Number.isFinite(parsed) ? parsed : undefined;\n }\n return undefined;\n}\n\nfunction assignOrDelete(container: Record<string, unknown>, key: string, value: unknown): void {\n if (value === undefined) {\n delete container[key];\n return;\n }\n container[key] = value;\n}\n\nfunction assignOrRemove<K extends 'dataSource' | 'actions' | 'export'>(\n layout: AXPReportLayoutDefinition,\n key: K,\n value: AXPReportLayoutDefinition[K],\n): void {\n if (hasContent(value)) {\n layout[key] = value;\n return;\n }\n delete layout[key];\n}\n\nfunction hasContent(value: unknown): boolean {\n if (Array.isArray(value)) {\n return value.length > 0;\n }\n return isRecord(value) && Object.keys(value).length > 0;\n}\n\n/** Report definitions are plain JSON, so a JSON round trip is a faithful deep copy. */\nfunction cloneStoredJson<T>(value: T): T {\n return value === undefined ? value : (JSON.parse(JSON.stringify(value)) as T);\n}\n\n/** Deep equality for stored JSON. Key order does not matter, array order does. */\nfunction sameJson(left: unknown, right: unknown): boolean {\n if (Array.isArray(left) || Array.isArray(right)) {\n return (\n Array.isArray(left) &&\n Array.isArray(right) &&\n left.length === right.length &&\n left.every((item, index) => sameJson(item, right[index]))\n );\n }\n if (isRecord(left) && isRecord(right)) {\n const keys = new Set([...Object.keys(left), ...Object.keys(right)]);\n return [...keys].every((key) => sameJson(left[key], right[key]));\n }\n return left === right;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return value != null && typeof value === 'object' && !Array.isArray(value);\n}\n\n//#endregion\n","import type { AXPReportChartOptions } from './report.types';\n\n//#region ---- Static report layout slots ----\n\n/**\n * One viewer layout the definition page can turn on.\n * Chart slots stay separate because the viewer tells them apart by chart type and icon.\n */\nexport interface AXPReportLayoutPreset {\n key: 'table' | 'bar' | 'line' | 'doughnut' | 'pie' | 'pdf';\n componentKey: string;\n title: string;\n description: string;\n icon: string;\n order: number;\n layoutType: 'table' | 'chart' | 'pdf';\n chartType?: AXPReportChartOptions['chartType'];\n}\n\nexport const AXP_REPORT_LAYOUT_PRESETS: readonly AXPReportLayoutPreset[] = [\n {\n key: 'table',\n componentKey: 'report-definition-layout-table',\n title: '@report-management:report-viewer.layouts.table.title',\n description: '@report-management:reports.entities.report.layout-editor.page-description',\n icon: 'fa-light fa-table',\n order: 10,\n layoutType: 'table',\n },\n {\n key: 'bar',\n componentKey: 'report-definition-layout-bar',\n title: '@report-management:report-viewer.layouts.bar-chart.title',\n description: '@report-management:reports.entities.report.layout-editor.page-description',\n icon: 'fa-light fa-chart-bar',\n order: 20,\n layoutType: 'chart',\n chartType: 'bar',\n },\n {\n key: 'line',\n componentKey: 'report-definition-layout-line',\n title: '@report-management:report-viewer.layouts.line-chart.title',\n description: '@report-management:reports.entities.report.layout-editor.page-description',\n icon: 'fa-light fa-chart-line',\n order: 30,\n layoutType: 'chart',\n chartType: 'line',\n },\n {\n key: 'doughnut',\n componentKey: 'report-definition-layout-doughnut',\n title: '@report-management:report-viewer.layouts.doughnut-chart.title',\n description: '@report-management:reports.entities.report.layout-editor.page-description',\n icon: 'fa-light fa-chart-pie',\n order: 40,\n layoutType: 'chart',\n chartType: 'doughnut',\n },\n {\n key: 'pie',\n componentKey: 'report-definition-layout-pie',\n title: '@report-management:report-viewer.layouts.pie-chart.title',\n description: '@report-management:reports.entities.report.layout-editor.page-description',\n icon: 'fa-light fa-chart-pie',\n order: 50,\n layoutType: 'chart',\n chartType: 'pie',\n },\n {\n key: 'pdf',\n componentKey: 'report-definition-layout-pdf',\n title: '@report-management:report-viewer.layouts.pdf.title',\n description: '@report-management:reports.entities.report.layout-editor.page-description',\n icon: 'fa-light fa-file-pdf',\n order: 60,\n layoutType: 'pdf',\n },\n];\n\nexport function reportLayoutPresetByKey(key: string | undefined): AXPReportLayoutPreset | undefined {\n if (!key) {\n return undefined;\n }\n return AXP_REPORT_LAYOUT_PRESETS.find((preset) => preset.key === key);\n}\n\n//#endregion\n","import type { AXPFilterClause } from '@acorex-platform/framework-shared/core';\nimport type { AXPReportParameterBinding } from './report.types';\n\n//#region ---- Filter mapping ----\n\n/**\n * Applies the filter mapping of a view's data source to the conditions built from the report filters.\n * A condition on a filter that the view maps to a query field runs on that field instead.\n * Filters without a mapping keep their own name, which is the field of the query rows with the same name.\n */\nexport function applyReportParameterBindings(\n clause: AXPFilterClause,\n inputs: readonly AXPReportParameterBinding[] | null | undefined,\n): AXPFilterClause {\n const targets = new Map<string, string>();\n for (const input of inputs ?? []) {\n const parameterKey = typeof input?.parameterKey === 'string' ? input.parameterKey.trim() : '';\n const bindTo = typeof input?.bindTo === 'string' ? input.bindTo.trim() : '';\n if (parameterKey && bindTo && parameterKey !== bindTo) {\n targets.set(parameterKey, bindTo);\n }\n }\n return targets.size === 0 ? clause : remap(clause, targets);\n}\n\nfunction remap(clause: AXPFilterClause, targets: ReadonlyMap<string, string>): AXPFilterClause {\n if (Array.isArray(clause.filters)) {\n return { ...clause, filters: clause.filters.map((child) => remap(child, targets)) };\n }\n const target = typeof clause.field === 'string' ? targets.get(clause.field) : undefined;\n return target ? { ...clause, field: target } : clause;\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXPWidgetColumnNode } from '@acorex-platform/framework-shared/widget-core';\nimport { AXPQuerySort } from '@acorex-platform/framework-shared/entity';\nimport { AXPActionMenuItem, AXPCategoryEntity, AXPExportOptions, AXPFilterClause, AXPFilterDefinition, AXPSystemActionType, type AXPMultiLanguageString, type AXPWidgetNode } from '@acorex-platform/framework-shared/core';\n\n//#endregion\n\n//#region ---- Core Report Types and Interfaces ----\n\nexport type AXPReportLayoutType = 'table' | 'chart' | 'cards' | 'custom' | 'pdf';\n\n/**\n * Report Category - Extends AXPCategoryEntity for consistency and performance\n *\n * Inherited properties from AXPCategoryEntity:\n * - id: string - Unique identifier\n * - title: string - Display name\n * - description?: string - Category description\n * - parentId?: string - Parent category ID\n * - childrenCount: number - Direct child categories count (enables lazy loading)\n * - itemsCount?: number - Direct reports count (replaces hasReport boolean)\n * - totalChildrenCount?: number - Total nested categories (optional, for analytics)\n * - totalItemsCount?: number - Total reports in tree (optional, for analytics)\n *\n * Performance benefits:\n * - Lazy loading support (childrenCount > 0 shows expand icon)\n * - Report count display (itemsCount shows \"5 reports\" badge)\n * - Efficient queries (no need to query to know if expandable)\n */\nexport interface AXPReportCategory extends AXPCategoryEntity {\n // No additional properties needed - all inherited from AXPCategoryEntity\n // Use: childrenCount instead of hasChild\n // Use: itemsCount instead of hasReport\n}\n\n/** How an entity-bound report is surfaced on the host entity UI. */\nexport type AXPReportEntityDisplay = 'action' | 'page' | 'popup';\n\n/**\n * Parameter value on an entity binding:\n * - field path / expression string (e.g. `id`)\n * - `'today'` → local calendar day `{ from, to }`\n * - explicit `{ from, to }` date range\n */\nexport type AXPReportEntityParameterValue = string | { from: string; to: string };\n\n/** Binds a report to a host entity type for Reports page discovery. */\nexport interface AXPReportEntityBinding {\n /** Fully qualified entity type, e.g. `SecurityManagement.User`. */\n entity: string;\n /** Optional list title (i18n key or plain text). Falls back to report title. */\n title?: string;\n /** Optional list description (i18n key or plain text). Falls back to report description. */\n description?: string;\n layoutId?: string;\n /**\n * Where to surface the report. Defaults to `['page']` (Reports side-menu page).\n * `action` / `popup` are retained for data compatibility but are not contributed as entity Actions.\n */\n display?: AXPReportEntityDisplay | AXPReportEntityDisplay[];\n /**\n * Map report parameter path → entity field / expression / date token.\n * Example: `{ userId: 'id', dateRange: 'today' }`\n */\n parameters?: Record<string, AXPReportEntityParameterValue>;\n order?: number;\n}\n\n/** Query-builder value stored on a report definition. The where tree is the filter. */\nexport interface ReportFilterQuery {\n dataSource?: string;\n columns: string[];\n where: AXPFilterDefinition;\n sort: Array<{ field: string; dir: 'asc' | 'desc' }>;\n groupBy: string[];\n aggregates: unknown[];\n}\n\nexport interface AXPReportDefinition {\n id: string;\n title: AXPMultiLanguageString;\n description?: AXPMultiLanguageString;\n categoryIds: string[];\n parameterGroups: AXPReportParameterGroup[];\n /** Query-builder where-clause authored on the report definition filter page. */\n filterQuery?: ReportFilterQuery;\n permissions?: string[];\n layouts: AXPReportLayoutDefinition[]; // Changed to support multiple layouts\n defaultLayoutId: string; // Which layout to show by default\n /** Optional host-entity bindings for the entity `reports` plugin. */\n entities?: AXPReportEntityBinding[];\n /** Background / choose / interactive generation options. Omitted = interactive. */\n generation?: AXPReportGenerationOptions;\n}\n\nexport type AXPReportGenerationMode = 'interactive' | 'background' | 'choose';\n\nexport type AXPReportArtifactKind = 'viewer' | 'pdf' | 'excel' | 'csv';\n\nexport type AXPReportFreezeLayouts = 'current' | 'all';\n\nexport type AXPReportGenerationDedupePolicy =\n | 'none'\n | 'in-flight'\n | 'in-flight-or-cooldown';\n\nexport interface AXPReportGenerationDedupeOptions {\n /** Omitted → inherit platform `ReportManagement:Setting:Generation.Dedupe.Policy`. */\n policy?: AXPReportGenerationDedupePolicy;\n /** Omitted → inherit platform `ReportManagement:Setting:Generation.Dedupe.CooldownMinutes`. */\n cooldownMs?: number;\n}\n\nexport interface AXPReportGenerationOptions {\n /** Omitted = interactive (today’s viewer). */\n mode?: AXPReportGenerationMode;\n /** Default `['viewer']` when mode is background or choose. */\n formats?: AXPReportArtifactKind[];\n executionTimeoutMs?: number;\n /** Default 30. Used to set `expiresAt` when the run finishes. */\n retentionDays?: number;\n /** Default `'all'` query layouts. `'current'` freezes only the layout the user ran. */\n freezeLayouts?: AXPReportFreezeLayouts;\n /** Default true. Store layout/title/parameter snapshot in the viewer freeze file. */\n pinDefinition?: boolean;\n /** Demo/local only. Worker waits this long after marking the run running. */\n simulateDelayMs?: number;\n /** Omitted → dedupe behavior comes from platform settings. */\n dedupe?: AXPReportGenerationDedupeOptions;\n /**\n * When true (default for background/choose), completed jobs stay in the footer tray until dismissed.\n * Set false to remove from tray as soon as the job completes.\n */\n keepInTray?: boolean;\n}\n\nexport type AXPReportLayoutAction = AXPActionMenuItem & {\n priority: 'primary' | 'secondary';\n};\n\n/**\n * Layout Definition - Associates a layout with metadata\n */\nexport interface AXPReportLayoutDefinition {\n id: string; // Unique identifier for this layout\n title: AXPMultiLanguageString; // Display name (e.g., \"Table View\", \"Chart View\")\n description?: AXPMultiLanguageString; // Optional description\n icon?: string; // Icon for layout switcher UI\n layout: AXPReportLayout; // The actual layout configuration\n dataSource?: AXPReportDataSource; // Optional layout-specific dataSource (overrides report-level)\n isDefault?: boolean; // Alternative to defaultLayoutId\n actions?: AXPReportLayoutAction[];\n export?: AXPExportOptions;\n}\n\nexport interface AXPReportParameterGroup {\n name: string;\n title: AXPMultiLanguageString;\n description?: AXPMultiLanguageString;\n parameters: AXPReportParameter[];\n}\n\nexport interface AXPReportParameter {\n path: string;\n title: AXPMultiLanguageString;\n description?: AXPMultiLanguageString;\n /**\n * Boolean or expression (e.g. `{{ permission.check(\"…\") }}` / `{{ feature.check(\"…\") }}`).\n * Omitted / `true` means visible. Evaluated by the Report Viewer layout renderer.\n */\n visible?: boolean | string;\n widget: AXPWidgetNode;\n}\n\n//#endregion\n\n//#region ---- Data Source Types ----\n\nexport type AXPReportDataSource =\n | AXPQueryDataSource\n | AXPCustomDataSource\n | AXPAggregatedDataSource\n | AXPTransformedDataSource;\n\n/**\n * Query Data Source - Used for executing predefined queries (AXPQuery)\n */\nexport interface AXPQueryDataSource {\n type: 'query';\n name: string; // The registered query name, e.g., 'getProductList'\n description?: string;\n\n inputs?: AXPReportParameterBinding[]; // Maps report parameters to query inputs\n sortFields?: AXPQuerySort[]; // Default sorting applied by the backend\n pagination?: boolean; // Enables paging in result set\n}\n\n/**\n * Custom Data Source - Used for fetching data from custom providers like REST APIs or external services\n */\nexport interface AXPCustomDataSource {\n type: 'custom';\n provider: string; // Example: 'http://api/report' or 'custom:MyHandler'\n description?: string;\n\n inputs?: AXPReportParameterBinding[]; // Maps report parameters to payload\n options?: { [key: string]: any }; // Additional options for the custom handler\n}\n\n/**\n * Parameter Binding - Maps report-level parameters to actual query/command input structure\n */\nexport interface AXPReportParameterBinding {\n parameterKey: string; // Report parameter key, e.g., 'startDate'\n bindTo: string; // Input key in the query/command payload, e.g., 'filters.from'\n}\n\n/**\n * Aggregated Data Source - Used for pre-aggregated data optimized for charts\n */\nexport interface AXPAggregatedDataSource {\n type: 'aggregated';\n baseQuery: string; // Base query to aggregate from\n description?: string;\n\n groupBy: string[]; // Fields to group by\n aggregations: AXPAggregation[]; // Aggregation operations\n inputs?: AXPReportParameterBinding[];\n}\n\n/**\n * Transformed Data Source - Applies transformations to existing data sources\n */\nexport interface AXPTransformedDataSource {\n type: 'transformed';\n baseDataSource: AXPReportDataSource; // Source to transform\n description?: string;\n\n transformations: AXPDataTransformation[]; // List of transformations\n inputs?: AXPReportParameterBinding[];\n}\n\n/**\n * Aggregation operation for aggregated data sources\n */\nexport interface AXPAggregation {\n field: string;\n operation: 'sum' | 'avg' | 'count' | 'min' | 'max' | 'distinct';\n alias?: string; // Output field name\n}\n\n/**\n * Data transformation operation\n */\nexport interface AXPDataTransformation {\n type: 'filter' | 'sort' | 'group' | 'pivot' | 'format';\n config: Record<string, any>; // Transformation-specific configuration\n}\n\n//#endregion\n\n//#region ---- Group By & Drill Down ----\n\n/**\n * Drill-down target for a grouped report row.\n * When reportId is omitted, the current report is used.\n */\nexport interface AXPReportDrillDownConfig {\n reportId?: string;\n layoutId?: string;\n title?: string;\n parameters?: Record<string, string>;\n}\n\n/**\n * Declares how a summary report is grouped and which detail view opens on drill-down.\n * Multiple definitions allow alternative drill paths (e.g. by brand vs by category).\n */\nexport interface AXPReportGroupByDefinition {\n fields: string[];\n displayField?: string;\n /** When true (default), `displayField` renders as a link instead of a row command column. */\n linkDisplay?: boolean;\n title?: string;\n default?: boolean;\n priority?: 'primary' | 'secondary';\n drillDown: AXPReportDrillDownConfig;\n}\n\n//#endregion\n\n//#region ---- Layout Types ----\n\nexport type AXPReportLayout = AXPReportTableLayout | AXPReportChartLayout | AXPReportPdfLayout;\n\n/**\n * Table Layout - Displays data in tabular format\n */\n\nexport interface AXPReportTableLayoutRowAction extends AXPActionMenuItem {\n priority: 'primary' | 'secondary';\n type: AXPSystemActionType | string;\n default?: boolean;\n}\n\nexport interface AXPReportTableLayout {\n type: 'table';\n columns: AXPReportColumn[];\n actions?: AXPReportTableLayoutRowAction[];\n options?: AXPTableOptions;\n groupBy?: AXPReportGroupByDefinition[];\n conditionalFormatting?: AXPConditionalFormatRule[];\n summary?: AXPReportSummaryOptions[];\n header?: AXPReportHeaderFooter;\n footer?: AXPReportHeaderFooter;\n}\n\n/** Result-grid hierarchy. Omitted reports stay a flat table. */\nexport interface AXPReportTableHierarchy {\n /** Row field that points at the parent row, for example `parentId`. */\n parentField: string;\n /** Row field used as the node id. Defaults to `id`. */\n keyField?: string;\n}\n\nexport interface AXPTableOptions {\n pagination?: boolean;\n stickyHeader?: boolean;\n stripedRows?: boolean;\n sorting?: AXPQuerySort[];\n selectable?: {\n mode: 'single' | 'multiple' | 'none';\n };\n /**\n * When set, the result grid expands rows whose `parentField` links them.\n * Rows with an empty parent are the roots. Other reports leave this unset.\n */\n hierarchy?: AXPReportTableHierarchy;\n}\n\n/**\n * Chart Layout - Displays data in various chart formats\n */\nexport interface AXPReportChartLayout {\n type: 'chart';\n options: AXPReportChartOptions;\n header?: AXPReportHeaderFooter;\n footer?: AXPReportHeaderFooter;\n}\n\nexport interface AXPReportChartOptions {\n chartType: 'bar' | 'line' | 'pie' | 'doughnut' | 'area' | 'scatter' | 'radar' | 'mixed';\n dataMapping: AXPChartDataMapping;\n styling?: AXPChartStyling;\n interactivity?: AXPChartInteractivity;\n}\n\n/**\n * Chart Data Mapping Configuration\n */\nexport interface AXPChartDataMapping {\n // Core fields\n xField: string; // X-axis data field\n yFields: string | string[]; // Y-axis data field(s) for multiple series\n\n // Grouping and categorization\n groupBy?: string; // Group data by this field\n seriesField?: string; // Field to create multiple series\n\n // Special fields for specific chart types\n sizeField?: string; // For bubble charts\n colorField?: string; // For gradient/conditional coloring\n labelField?: string; // Custom label field\n\n // Data aggregation\n aggregation?: {\n method: 'sum' | 'avg' | 'count' | 'min' | 'max';\n field: string;\n };\n}\n\n/**\n * Chart Visual Styling Configuration\n */\nexport interface AXPChartStyling {\n // Theme and colors\n colorScheme?: 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'custom';\n /** Palette applied by series index when `seriesColors` is not set. */\n customColors?: string[];\n /**\n * Per-series fill colors keyed by chart category id/label\n * (e.g. Online → success, Away → warning, Busy → danger).\n */\n seriesColors?: Record<string, string>;\n\n // Chart appearance\n gridLines?: boolean;\n legend?: {\n show: boolean;\n position: 'top' | 'bottom' | 'left' | 'right';\n };\n\n // Axes configuration\n xAxis?: AXPChartAxisConfig;\n yAxis?: AXPChartAxisConfig;\n\n // Animation\n animation?: {\n enabled: boolean;\n duration?: number;\n };\n\n // Chart-specific styling\n chartSpecific?: {\n // Bar chart options\n bar?: {\n orientation: 'vertical' | 'horizontal';\n mode: 'grouped' | 'stacked';\n barWidth?: number;\n };\n\n // Line chart options\n line?: {\n style: 'straight' | 'curved' | 'stepped';\n showPoints?: boolean;\n tension?: number;\n };\n\n // Area chart options\n area?: {\n mode: 'normal' | 'stacked' | 'percentage';\n opacity?: number;\n };\n\n // Pie/Doughnut options\n pie?: {\n startAngle?: number;\n innerRadius?: number; // For doughnut charts\n showLabels?: boolean;\n };\n };\n}\n\n/**\n * Chart Axis Configuration\n */\nexport interface AXPChartAxisConfig {\n title?: string;\n show?: boolean;\n type?: 'linear' | 'logarithmic' | 'datetime' | 'category';\n min?: number | string;\n max?: number | string;\n format?: string;\n gridLines?: boolean;\n tickInterval?: number;\n}\n\n/**\n * Chart Interactivity Configuration\n */\nexport interface AXPChartInteractivity {\n // Zoom and pan\n zoom?: {\n enabled: boolean;\n mode?: 'x' | 'y' | 'xy';\n };\n\n // Tooltips\n tooltips?: {\n enabled: boolean;\n format?: string;\n showOnHover?: boolean;\n };\n\n // Click events\n onClick?: {\n enabled: boolean;\n action?: 'drill-down' | 'filter' | 'custom';\n };\n\n // Selection\n selection?: {\n enabled: boolean;\n mode?: 'single' | 'multiple';\n };\n\n // Export\n export?: {\n enabled: boolean;\n formats?: ('png' | 'jpg' | 'pdf' | 'svg')[];\n };\n}\n\n/**\n * PDF Layout - Displays PDF documents\n */\nexport interface AXPReportPdfLayout {\n type: 'pdf';\n options?: AXPReportPdfOptions;\n header?: AXPReportHeaderFooter;\n footer?: AXPReportHeaderFooter;\n /** DocumentOutput.StimulsoftTemplate row designed for this layout. */\n stimulsoftTemplateId?: string;\n /** Dictionary data source the designer bound, filled with this layout's query rows at view time. */\n stimulsoftDataSourceName?: string;\n}\n\n/**\n * PDF Layout Options\n */\nexport interface AXPReportPdfOptions {\n showDownloadButton?: boolean;\n showPrintButton?: boolean;\n showZoomControls?: boolean;\n showFullscreenButton?: boolean;\n defaultZoom?: number; // Percentage (e.g., 100, 150, 200)\n height?: string; // CSS height (e.g., '100%', '600px')\n}\n\n//#region ---- Shared Models ----\n\nexport interface AXPReportColumn {\n field: string;\n title?: string;\n /**\n * Boolean or expression (e.g. `{{ permission.check(\"…\") }}`).\n * Omitted / `true` means visible. Evaluated when building the table view.\n */\n visible?: boolean | string;\n width?: number | 'auto';\n align?: 'left' | 'center' | 'right';\n /** When true, column header supports interactive sort (opt-in). */\n sortable?: boolean;\n /** Pin column to the start or end of the table (definition-only). */\n pin?: 'start' | 'end';\n widget?: AXPWidgetColumnNode;\n /**\n * Optional cell interactivity. When omitted, group-by `displayField` columns\n * can still render as drill links automatically in report table view.\n */\n interactivity?: AXPReportColumnInteractivity;\n}\n\n/**\n * Column cell interaction — link triggers a command with the current row as context.\n * Platform widgets may mirror this via column `options.displayAs: 'link'` in the future.\n */\nexport interface AXPReportColumnInteractivity {\n type: 'link';\n command: {\n name: string;\n options?: Record<string, unknown>;\n };\n}\n\n/** Server-computed report footer totals keyed by column field. */\nexport type AXPReportTableSummaryResult = Record<string, number | null>;\n\nexport interface AXPReportSummaryOptions {\n field: string;\n operation: 'sum' | 'avg' | 'count' | 'min' | 'max';\n displayIn: 'groupFooter' | 'reportFooter';\n}\n\nexport interface AXPConditionalFormatRule {\n field: string;\n condition: '>' | '<' | '=' | '!=' | 'contains';\n value: any;\n style: {\n color?: string;\n backgroundColor?: string;\n fontWeight?: 'normal' | 'bold';\n };\n}\n\nexport interface AXPReportHeaderFooter {\n title?: string;\n logoUrl?: string;\n showDate?: boolean;\n showParameters?: boolean;\n customHtml?: string;\n}\n\n/**\n * Layout switcher options for UI components\n */\nexport interface AXPLayoutSwitcherOption {\n id: string;\n title: AXPMultiLanguageString;\n icon?: string;\n type: AXPReportLayoutType;\n}\n\n/**\n * Runtime layout selection state\n */\nexport interface AXPReportLayoutState {\n reportId: string;\n activeLayoutId: string;\n availableLayouts: AXPLayoutSwitcherOption[];\n}\n\n//#endregion\n","//#region ---- Report management runtime keys ----\n\nexport const AXMReportManagementQueryKeys = {\n Category: {\n ListRoot: 'ReportManagement:Category:ListRoot',\n GetById: 'ReportManagement:Category:GetById',\n },\n Report: {\n GetDefinition: 'ReportManagement:Report:GetDefinition',\n },\n ReportGeneration: {\n Get: 'ReportManagement:ReportGeneration:Get',\n ListMine: 'ReportManagement:ReportGeneration:ListMine',\n GetViewerFreeze: 'ReportManagement:ReportGeneration:GetViewerFreeze',\n },\n} as const;\n\n//#endregion\n","import { axpRegisterDataExecutionCapabilities } from '@acorex-platform/framework-shared/runtime';\n\n/** Trusted dependencies for coded reports, not administrator execution policies. */\nexport const AXP_REPORT_QUERY_TARGETS = [\n ['HumanCapitalManagement:Reports:GetHeadcountByDepartment', 'HumanCapitalManagement.Employee', false],\n ['HumanCapitalManagement:Reports:GetLeaveUsageByType', 'HumanCapitalManagement.LeaveRequest', false],\n ['ProjectManagement:Reports:GetProjectsByStatus', 'ProjectManagement.Project', false],\n ['TenantManagement:Dashboard:ActiveUsersKpi', 'TenantManagement.TenantUser', false],\n ['HumanCapitalManagement:Dashboard:EmployeesKpi', 'HumanCapitalManagement.Employee', false],\n ['TaskManagement:Dashboard:OpenTasksKpi', 'TaskManagement.Task', false],\n ['ProjectManagement:Dashboard:ActiveProjectsKpi', 'ProjectManagement.Project', false],\n ['WorkplaceSafetyManagement:Dashboard:OpenHazardsKpi', 'WorkplaceSafetyManagement.Hazard', false],\n ['DocumentManagement:Dashboard:DocumentsKpi', 'DocumentManagement.Document', false],\n ['WorkflowManagement:Dashboard:WorkflowDefinitionsKpi', 'WorkflowManagement.WorkflowDefinition', false],\n ['SubscriptionManagement:Dashboard:SubscriptionKpi', 'SubscriptionManagement.Subscription', false],\n ['WorkplaceSafetyManagement:Dashboard:HighRisksKpi', 'WorkplaceSafetyManagement.HazardRisk', false],\n ['WorkplaceSafetyManagement:Dashboard:ActiveSafetyPlansKpi', 'WorkplaceSafetyManagement.SafetyPlan', false],\n ['WorkplaceSafetyManagement:Dashboard:Take5ChecklistsKpi', 'WorkplaceSafetyManagement.SafetyPlan', false],\n ['WorkplaceSafetyManagement:Dashboard:Take5CompletedKpi', 'WorkplaceSafetyManagement.SafetyPlan', false],\n ['AssessmentManagement:Dashboard:OverdueAssessmentsKpi', 'AssessmentManagement.AssessmentCase', true],\n ['AssessmentManagement:Dashboard:PendingAssessmentsKpi', 'AssessmentManagement.AssessmentCase', false],\n ['AssessmentManagement:Dashboard:MyAssessmentsKpi', 'AssessmentManagement.AssessmentCase', false],\n ['TaskManagement:Dashboard:OverdueTasksKpi', 'TaskManagement.Task', true],\n ['TaskManagement:Dashboard:MyOpenTasksKpi', 'TaskManagement.Task', false],\n ['LearningManagement:Dashboard:TrainingDueKpi', 'LearningManagement.Enrollment', true],\n ['PlatformManagement:Dashboard:OnlineUsersKpi', 'PlatformManagement.UserPresenceSegment', false],\n ['PlatformManagement:Dashboard:TodayLoggedInUsersKpi', 'SecurityManagement.DeviceSessions', true],\n ['WorkflowManagement:Dashboard:RunningInstancesKpi', 'WorkflowManagement.WorkflowInstance', false],\n ['WorkflowManagement:Dashboard:FaultedInstancesKpi', 'WorkflowManagement.WorkflowInstance', false],\n ['WorkflowManagement:Dashboard:AwaitingActionInstancesKpi', 'WorkflowManagement.WorkflowInstance', false],\n] as const;\n\nconst KPI_CACHE_FIELDS = [\n 'title',\n 'titleBadgeText',\n 'titleBadgeTone',\n 'value',\n 'valuePrefix',\n 'valueSuffix',\n 'format',\n 'icon',\n 'iconTone',\n 'trendValue',\n 'trendLabel',\n 'trendStatus',\n 'subtitle',\n 'segments',\n 'details',\n 'targetValue',\n 'progressValue',\n 'progressPercent',\n];\n\nexport const AXP_DASHBOARD_ADDITIONAL_KPI_TARGETS = [\n ['TenantManagement:Dashboard:TmApplicationUsersKpi', ['TenantManagement.TenantUserAppAccess']],\n ['WorkflowManagement:Dashboard:StartedTodayInstancesKpi', ['WorkflowManagement.WorkflowInstance']],\n ['WorkflowManagement:Dashboard:CompletedTodayInstancesKpi', ['WorkflowManagement.WorkflowInstance']],\n ['WorkflowManagement:Dashboard:AvgRunningAgeHoursKpi', ['WorkflowManagement.WorkflowInstance']],\n] as const;\n\nfor (const [key, entity] of AXP_REPORT_QUERY_TARGETS)\n axpRegisterDataExecutionCapabilities({\n targetKind: 'Query',\n targetKey: key,\n revision: 'report-result-contract-v3',\n operations: ['read'],\n dataDependencies: key === 'PlatformManagement:Dashboard:OnlineUsersKpi' ? [entity, 'TenantManagement.TenantUser'] : [entity],\n ...(key.includes(':Dashboard:') ? { clientCache: { storageKinds: ['indexed-db' as const], allowedFields: KPI_CACHE_FIELDS, maxItems: 10000, maxBytes: 5 * 1024 * 1024, maxAgeMs: 5400000, allowOfflineRead: true } } : {}),\n serverCache: { supported: true, scope: 'session', maxRowsPerEntry: 10_000, maxEntryBytes: 5 * 1024 * 1024, maxAgeMs: 5_400_000 },\n });\n\n/** Public chart result contracts, including every entity consulted by the handler. */\nexport const AXP_DASHBOARD_CHART_TARGETS = [\n ['AssessmentManagement:Dashboard:AssessmentsWeekLine', ['AssessmentManagement.AssessmentSession'], 'series'],\n ['BackgroundJobManagement:Dashboard:JobsByStatusBar', ['BackgroundJobManagement.BackgroundJob'], 'items'],\n ['BackgroundJobManagement:Dashboard:JobSchedulesByStatusBar', ['BackgroundJobManagement.BackgroundJobSchedule'], 'items'],\n ['CommunicationManagement:Dashboard:DeliveryStatusDonut', ['CommunicationManagement.CommunicationDeliveries'], 'items'],\n ['HealthCore:Dashboard:HealthEventsTrendLine', ['HealthCore.HealthEvent'], 'series'],\n ['IntegrationManagement:Dashboard:IntegrationsDonut', ['IntegrationManagement.IntegrationConnection'], 'items'],\n ['LearningManagement:Dashboard:TrainingComplianceGauge', ['LearningManagement.Enrollment'], 'value'],\n ['LearningManagement:Dashboard:TrainingStatusDonut', ['LearningManagement.Enrollment'], 'items'],\n ['OrganizationManagement:Dashboard:TeamsBar', ['OrganizationManagement.Team'], 'items'],\n ['PlatformManagement:Dashboard:TodayOnlineByHourLine', ['PlatformManagement.UserPresenceSegment'], 'series'],\n ['ProjectManagement:Dashboard:ProjectsByStatusBar', ['ProjectManagement.Project'], 'items'],\n ['ProjectManagement:Dashboard:ProjectsTasksCountBar', ['ProjectManagement.Project', 'TaskManagement.Task'], 'items'],\n ['ProjectManagement:Dashboard:CustomersProjectsCountBar', ['ProjectManagement.Project', 'CustomerManagement.Customer', 'BusinessCore.Party'], 'items'],\n ['TaskManagement:Dashboard:TaskStatusDonut', ['TaskManagement.Task'], 'items'],\n ['TenantManagement:Dashboard:UsersByRoleDonut', ['TenantManagement.TenantUser', 'SecurityManagement.Role'], 'items'],\n ['WorkflowManagement:Dashboard:WorkflowsByStatusBar', ['WorkflowManagement.WorkflowDefinition'], 'items'],\n ['WorkflowManagement:Dashboard:InstancesBySubStatusDonut', ['WorkflowManagement.WorkflowInstance'], 'items'],\n ['WorkflowManagement:Dashboard:InstancesByDefinitionBar', ['WorkflowManagement.WorkflowInstance', 'WorkflowManagement.WorkflowDefinition'], 'items'],\n ['WorkflowManagement:Dashboard:InstancesThroughputLine', ['WorkflowManagement.WorkflowInstance'], 'series'],\n ['WorkflowManagement:Dashboard:InstancesByCurrentActivityBar', ['WorkflowManagement.WorkflowInstance', 'WorkflowManagement.WorkflowDefinition'], 'items'],\n ['WorkflowManagement:Dashboard:InstancesFaultHeatmap', ['WorkflowManagement.WorkflowInstance'], 'items'],\n ['WorkplaceSafetyManagement:Dashboard:HazardsByCategoryDonut', ['WorkplaceSafetyManagement.Hazard'], 'items'],\n ['WorkplaceSafetyManagement:Dashboard:RisksByRatingBar', ['WorkplaceSafetyManagement.HazardRisk'], 'items'],\n ['WorkplaceSafetyManagement:Dashboard:PlansByTypeBar', ['WorkplaceSafetyManagement.SafetyPlan'], 'items'],\n ['WorkplaceSafetyManagement:Dashboard:HazardsByStatusBar', ['WorkplaceSafetyManagement.Hazard'], 'items'],\n ['WorkplaceSafetyManagement:Dashboard:PpeCoverageDonut', ['WorkplaceSafetyManagement.Hazard', 'WorkplaceSafetyManagement.HazardPpeRule'], 'items'],\n] as const;\n\nfor (const [key, dependencies, field] of AXP_DASHBOARD_CHART_TARGETS) {\n axpRegisterDataExecutionCapabilities({\n targetKind: 'Query',\n targetKey: key,\n revision: 'dashboard-chart-cache-v2',\n operations: ['read'],\n dataDependencies: [...dependencies],\n clientCache: { storageKinds: ['indexed-db'], allowedFields: [field], maxItems: 10000, maxBytes: 5 * 1024 * 1024, maxAgeMs: 86400000, allowOfflineRead: true },\n serverCache: { supported: true, scope: 'session', maxRowsPerEntry: 10000, maxEntryBytes: 5 * 1024 * 1024, maxAgeMs: 86400000 },\n });\n}\n\nfor (const [key, dependencies] of AXP_DASHBOARD_ADDITIONAL_KPI_TARGETS) {\n axpRegisterDataExecutionCapabilities({\n targetKind: 'Query',\n targetKey: key,\n revision: 'dashboard-kpi-cache-v2',\n operations: ['read'],\n dataDependencies: [...dependencies],\n clientCache: { storageKinds: ['indexed-db'], allowedFields: KPI_CACHE_FIELDS, maxItems: 10000, maxBytes: 5 * 1024 * 1024, maxAgeMs: 86400000, allowOfflineRead: true },\n serverCache: { supported: true, scope: 'session', maxRowsPerEntry: 10000, maxEntryBytes: 5 * 1024 * 1024, maxAgeMs: 86400000 },\n });\n}\n","//#region ---- Contracts barrel ----\n\nexport * from './commands.keys';\nexport * from './features.keys';\nexport * from './menu.keys';\nexport * from './permission.keys';\nexport * from './settings.keys';\n\nexport * from './manifest';\nexport * from './report-filter-form.util';\nexport * from './report-generation.types';\nexport * from './report-interchange.projection';\nexport * from './report-interchange.snapshot';\nexport * from './report-interchange.types';\nexport * from './report-layout-field-schema';\nexport * from './report-layout-form.util';\nexport * from './report-layout-json-sections';\nexport * from './report-layout-sections.mapper';\nexport * from './report-layout-starter';\nexport * from './report-layout.presets';\nexport * from './report-parameter-binding.util';\nexport * from './report.types';\nexport * from './root-config';\nexport * from './runtime.keys';\n\n//#endregion\n\nexport * from './entities';\n\nexport * from './query-cache-targets';\n","/**\n * Generated bundle index. Do not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