@aintela/bi 0.2.2 → 0.2.4

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 (55) hide show
  1. package/README.md +32 -1
  2. package/dist/ChartCardDefaultsContext-BDRsVljO.js +34 -0
  3. package/dist/ChartCardDefaultsContext-BDRsVljO.js.map +1 -0
  4. package/dist/{ScriptDashboardViewerVertical-CuwnxisJ.js → ScriptDashboardViewerVertical-CHIPRLen.js} +3 -3
  5. package/dist/{ScriptDashboardViewerVertical-CuwnxisJ.js.map → ScriptDashboardViewerVertical-CHIPRLen.js.map} +1 -1
  6. package/dist/{biModuleSurface--gLAiZ9Z.js → biModuleSurface-BYtgLreK.js} +7 -7
  7. package/dist/{biModuleSurface--gLAiZ9Z.js.map → biModuleSurface-BYtgLreK.js.map} +1 -1
  8. package/dist/cards.js +1 -1
  9. package/dist/composer/index.d.ts +3 -1
  10. package/dist/composer/view/ComposerView.d.ts +20 -1
  11. package/dist/composer/view/SessionVisualizationsPanel.d.ts +19 -0
  12. package/dist/composer.js +73 -71
  13. package/dist/data/ChartCardDefaultsContext.d.ts +9 -0
  14. package/dist/data.js +1 -1
  15. package/dist/{index-DeiweWw8.js → index-9LcZjCK0.js} +54 -50
  16. package/dist/index-9LcZjCK0.js.map +1 -0
  17. package/dist/{index-K50t61iI.js → index-CfKuT0vQ.js} +2 -2
  18. package/dist/index-CfKuT0vQ.js.map +1 -0
  19. package/dist/index-DOfnLVhs.js +3853 -0
  20. package/dist/index-DOfnLVhs.js.map +1 -0
  21. package/dist/{index-DOpx0R4Y.js → index-Dy6hwDjs.js} +2 -2
  22. package/dist/index-Dy6hwDjs.js.map +1 -0
  23. package/dist/index-ZBNoVc5M.js +210 -0
  24. package/dist/index-ZBNoVc5M.js.map +1 -0
  25. package/dist/index-zN3LPF6u.js +97 -0
  26. package/dist/index-zN3LPF6u.js.map +1 -0
  27. package/dist/index.js +123 -117
  28. package/dist/inline/Chart.d.ts +0 -9
  29. package/dist/inline/Metric.d.ts +0 -2
  30. package/dist/inline/MetricGroup.d.ts +1 -1
  31. package/dist/inline.js +1 -1
  32. package/dist/runtime/index.d.ts +2 -0
  33. package/dist/runtime/sessionVisualizations.d.ts +61 -0
  34. package/dist/runtime/version.d.ts +1 -1
  35. package/dist/runtime.js +16 -11
  36. package/dist/runtime.js.map +1 -1
  37. package/dist/style.css +1 -1
  38. package/dist/theme.js +1 -1
  39. package/dist/version-CbZiTInp.js +122 -0
  40. package/dist/version-CbZiTInp.js.map +1 -0
  41. package/dist/viewer.js +1 -1
  42. package/package.json +1 -1
  43. package/dist/ChartCardDefaultsContext-Cl5T25H0.js +0 -32
  44. package/dist/ChartCardDefaultsContext-Cl5T25H0.js.map +0 -1
  45. package/dist/index-BYc79sSy.js +0 -131
  46. package/dist/index-BYc79sSy.js.map +0 -1
  47. package/dist/index-D7Oo_dC-.js +0 -94
  48. package/dist/index-D7Oo_dC-.js.map +0 -1
  49. package/dist/index-DOpx0R4Y.js.map +0 -1
  50. package/dist/index-DULVx84u.js +0 -3630
  51. package/dist/index-DULVx84u.js.map +0 -1
  52. package/dist/index-DeiweWw8.js.map +0 -1
  53. package/dist/index-K50t61iI.js.map +0 -1
  54. package/dist/version-BpSiNdYv.js +0 -84
  55. package/dist/version-BpSiNdYv.js.map +0 -1
package/README.md CHANGED
@@ -218,7 +218,7 @@ the "Abrir" picker body on `DashboardPad` (`renderDashboardPicker`); Markdown fo
218
218
 
219
219
  | export | what it is | key props |
220
220
  |---|---|---|
221
- | `ComposerView` | splash → execution layout, drafts, guided tour | `chatPane` (required), `sessionId`, `routeSessionId`, `renderProgressPanel`, `progressStrip`, `onBeforeSend`, `resolveGuideElement`, `suggestions`, `templates`, `recentSessions`, `onSelectSession`, `onSearchAllSessions`, `onDashboardNameChange`, `datasetControls`, `renderDescription`, `sidePanelWidth` |
221
+ | `ComposerView` | splash → execution layout, drafts, guided tour | `chatPane` (required), `sessionId`, `routeSessionId`, `renderProgressPanel`, `progressStrip`, `onBeforeSend`, `resolveGuideElement`, `suggestions`, `templates`, `recentSessions`, `onSelectSession`, `onSearchAllSessions`, `onDashboardNameChange`, `datasetControls`, `renderDescription`, `sidePanelWidth`, `sidePanel` |
222
222
  | `DashboardPad` | the V1 pad: toolbar (Sketch/Dashboard, ToolBox, Novo/Salvar/Atualizar/Abrir/Compose) + sketch or viewer | `sessionId`, `dashboardId`, `turnOpen`, `onCompose`, `onChange`, `onBack`, `renderDashboardPicker`, `showDebug`, `headerExtra`, `renderDescription` |
223
223
  | `DashboardPadSketch` | the grid of `CardSketch` cells + filter chips (ref: `DashboardPadHandle` = `addGenericCell` / `addTypedCell` / `handleAddFilter`) | `hideInternalHeader`, `hideFiltersInSketch`, `zoomLevel`, `onAddCard`, `headerExtra`, `renderDescription` |
224
224
  | `CardSketch` (alias `CardScketch`), `FilterSketch`, `TitleSketch` (aliases `TextSketh`, `TitleSkath`), `ToolBox`, `HoverButton`, `ClonedComponent` | the pad's pieces | |
@@ -226,12 +226,43 @@ the "Abrir" picker body on `DashboardPad` (`renderDashboardPicker`); Markdown fo
226
226
  | `DatasetParameterizationControls` | admin block: "DataSet Dinâmico" toggle + default dataset + agent picker | `orientation`, `datasets`, `defaultTemplateDataset`, `agents`, `agentId`, `recommendedAgentId`, `onAgentChange` |
227
227
  | `DrawablePrompt` | `PromptV2` with the sketch in its `topSlot` (rail + pad, the sketch chips, the queued-changes chip) | `onCreateSketch`, `onBeforeSend`, `sketchExpanded`, `onSketchExpandedChange`, `seedDraft`, `compact`, `zoomLevel`, `datasetControls` |
228
228
  | `EntryEmptyState`, `SpotlightOverlay`, `DashboardSidePanel`, `DashboardPin` | the splash, the tour, the two dashboard surfaces | `suggestions`/`templates`/`onSearchAllSessions`; `steps`/`resolveElement`; `width`/`defaultCollapsed` |
229
+ | `SessionVisualizationsPanel` | side panel listing the session's charts/KPIs that have scrolled OUT of the transcript | `width`, `title`, `footerAction`, `headerActions` |
229
230
  | `CardTypeIconsProvider` / `useCardTypeIcons` | swap the pad's icons (`category` / `specificType` / `filterType` maps; MUI defaults) | |
230
231
 
231
232
  Data that used to be hardcoded is now a default you can replace: `defaultComposerSuggestions` (`{ label, prompt }[]`),
232
233
  `defaultComposerTemplates` (+ `seedFromTemplate`, `TEMPLATE_KIND_TO_SKETCH`), `CARD_TYPE_CATALOG`, `FILTER_TYPE_CATALOG` —
233
234
  all Portuguese travel-BI text.
234
235
 
236
+ ### The side panel is a SLOT
237
+
238
+ `ComposerView`'s `sidePanel` prop takes a node, or a function of `{ hasDashboard, turnOpen }`. Omit it and you get
239
+ `DashboardSidePanel`, which is what every host had before the prop existed; pass `null` for no panel at all.
240
+
241
+ It is a slot rather than a `'dashboard' | 'visualizations'` enum on purpose. **A host changing its layout or its
242
+ colours must not need a change in here** — an enum makes every new panel a release of this package, which is the
243
+ coupling that rule exists to avoid. The same reasoning is why `SessionVisualizationsPanel` reads a PUBLIC hook: a
244
+ host that wants a different panel writes one against `useSessionVisualizations()` and never forks this file.
245
+
246
+ ### Session visualizations (`@aintela/bi/runtime`)
247
+
248
+ What the conversation has DRAWN, and which of it is currently on screen. The rule the panel implements: the charts
249
+ live in the chat, and the panel lists only the ones that have scrolled out of view — listing all of them would be a
250
+ second copy of the transcript, listing none would leave the column empty.
251
+
252
+ | export | what it is |
253
+ |---|---|
254
+ | `SessionVisualizationsProvider` | holds the registry for one conversation. Mount it around the transcript AND whatever reads the list |
255
+ | `VisualizationFrame` | wraps one drawn thing: registers it, stamps `data-viz="<callId>"`, watches its own intersection with the scroller. Adds no styling of its own |
256
+ | `useSessionVisualizations()` | `{ items, offscreen, scrollTo(id), setScroller(el) }` |
257
+
258
+ `createBiUiTools` already wraps `present_chart`, `present_metric`, `present_metric_group` and `present_iframe` in a
259
+ frame, with the chart's own image as the panel's thumbnail. Outside a provider every piece is inert and the frame
260
+ renders its child unchanged, so a host that does not want the feature sees no difference.
261
+
262
+ `ComposerView` finds the transcript's scroller inside the `chatPane` you gave it and publishes it, so the
263
+ composer needs no wiring beyond the provider. A flash is drawn by the host: the frame sets `data-viz-focus` for
264
+ two seconds and styling it is a CSS rule, not a prop.
265
+
235
266
  ### Store — `ComposerProvider`, `useComposer()`
236
267
 
237
268
  `ComposerProvider` creates one zustand store (`createComposerStore`) per mount; `useComposer(selector)` subscribes,
@@ -0,0 +1,34 @@
1
+ var f = Object.defineProperty;
2
+ var e = (t, r) => f(t, "name", { value: r, configurable: !0 });
3
+ import { jsx as C } from "react/jsx-runtime";
4
+ import { createContext as l, useRef as x, useMemo as i, useContext as m } from "react";
5
+ const o = l({});
6
+ function h() {
7
+ return m(o);
8
+ }
9
+ e(h, "useChartCardDefaults");
10
+ const p = /* @__PURE__ */ e(({
11
+ palette: t,
12
+ monoShadePerCategory: r,
13
+ rotateBasePerChart: s,
14
+ gridColor: u,
15
+ children: a
16
+ }) => {
17
+ const n = x(0), c = i(
18
+ () => ({
19
+ palette: t,
20
+ monoShadePerCategory: r,
21
+ rotateBasePerChart: s,
22
+ gridColor: u,
23
+ allocateChartSlot: /* @__PURE__ */ e(() => n.current++, "allocateChartSlot")
24
+ }),
25
+ [t, r, s, u]
26
+ );
27
+ return /* @__PURE__ */ C(o.Provider, { value: c, children: a });
28
+ }, "ChartCardDefaultsProvider");
29
+ export {
30
+ o as C,
31
+ p as a,
32
+ h as u
33
+ };
34
+ //# sourceMappingURL=ChartCardDefaultsContext-BDRsVljO.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChartCardDefaultsContext-BDRsVljO.js","sources":["../src/data/ChartCardDefaultsContext.tsx"],"sourcesContent":["import React, { createContext, useContext, useMemo, useRef } from 'react';\n\n/**\n * Chart defaults — a host (or a dashboard viewer) can override the series\n * palette for a subtree and turn on \"mono-shade per category\" so single-series\n * bar charts use shades of one hue instead of the categorical palette.\n *\n * `palette` is the per-dashboard override; when absent, charts read\n * `theme.palette.bi.series` (see `useBiPalette`).\n */\nexport interface ChartCardDefaults {\n /** Replaces `theme.palette.bi.series` for series and pie / donut slice colours. */\n palette?: readonly string[];\n /**\n * When true, single-series bar charts colour each *category* (data row)\n * with a different opacity of the base series colour.\n */\n monoShadePerCategory?: boolean;\n /**\n * When true, each ChartCard mounted under the provider gets a different\n * primer colour from the palette in round-robin mount order.\n */\n rotateBasePerChart?: boolean;\n /**\n * Gridline colour for every chart under the provider. Without it a chart\n * derives one from `text.primary` at 12%, which is right on a neutral\n * canvas and too heavy on a warm one — and the alternative was the\n * per-card `gridColor` prop, i.e. a host repeating one decision on every\n * card of every dashboard.\n */\n gridColor?: string;\n /**\n * Internal: provider-supplied counter used by ChartCard to claim a slot\n * index on first mount. Use `ChartCardDefaultsProvider` rather than\n * setting this directly.\n */\n allocateChartSlot?: () => number;\n}\n\nexport const ChartCardDefaultsContext = createContext<ChartCardDefaults>({});\n\nexport function useChartCardDefaults(): ChartCardDefaults {\n return useContext(ChartCardDefaultsContext);\n}\n\nexport interface ChartCardDefaultsProviderProps {\n palette?: readonly string[];\n monoShadePerCategory?: boolean;\n rotateBasePerChart?: boolean;\n gridColor?: string;\n children: React.ReactNode;\n}\n\n/**\n * Wraps a subtree in a `ChartCardDefaultsContext`. Keeps a monotonically\n * increasing counter across child ChartCard mounts so each captures a stable\n * slot index on first render (not reset on parent re-renders).\n */\nexport const ChartCardDefaultsProvider: React.FC<ChartCardDefaultsProviderProps> = ({\n palette,\n monoShadePerCategory,\n rotateBasePerChart,\n gridColor,\n children,\n}) => {\n const counterRef = useRef(0);\n const value = useMemo<ChartCardDefaults>(\n () => ({\n palette,\n monoShadePerCategory,\n rotateBasePerChart,\n gridColor,\n allocateChartSlot: () => counterRef.current++,\n }),\n [palette, monoShadePerCategory, rotateBasePerChart, gridColor],\n );\n return <ChartCardDefaultsContext.Provider value={value}>{children}</ChartCardDefaultsContext.Provider>;\n};\n"],"names":["ChartCardDefaultsContext","createContext","useChartCardDefaults","useContext","__name","ChartCardDefaultsProvider","palette","monoShadePerCategory","rotateBasePerChart","gridColor","children","counterRef","useRef","value","useMemo","jsx"],"mappings":";;;;AAuCO,MAAMA,IAA2BC,EAAiC,CAAA,CAAE;AAEpE,SAASC,IAA0C;AACtD,SAAOC,EAAWH,CAAwB;AAC9C;AAFgBI,EAAAF,GAAA;AAiBT,MAAMG,IAAsE,gBAAAD,EAAA,CAAC;AAAA,EAChF,SAAAE;AAAA,EACA,sBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AACJ,MAAM;AACF,QAAMC,IAAaC,EAAO,CAAC,GACrBC,IAAQC;AAAA,IACV,OAAO;AAAA,MACH,SAAAR;AAAA,MACA,sBAAAC;AAAA,MACA,oBAAAC;AAAA,MACA,WAAAC;AAAA,MACA,mBAAmB,gBAAAL,EAAA,MAAMO,EAAW,WAAjB;AAAA,IAAiB;AAAA,IAExC,CAACL,GAASC,GAAsBC,GAAoBC,CAAS;AAAA,EAAA;AAEjE,SAAO,gBAAAM,EAACf,EAAyB,UAAzB,EAAkC,OAAAa,GAAe,UAAAH,EAAA,CAAS;AACtE,GAnBmF;"}
@@ -10,7 +10,7 @@ import * as je from "@mui/material/styles";
10
10
  import { alpha as Ne } from "@mui/material/styles";
11
11
  import { G as De, e as Ae } from "./GridLayout-1gWuIKeZ.js";
12
12
  import { a as Se } from "./DashboardParametersContext-Clv--79U.js";
13
- import { a as Ge } from "./ChartCardDefaultsContext-Cl5T25H0.js";
13
+ import { a as Ge } from "./ChartCardDefaultsContext-BDRsVljO.js";
14
14
  import { isSubAgentTerminalStatus as ve } from "@aintela/chat/models";
15
15
  import { a as $e } from "./BiClientProvider-CWJochvi.js";
16
16
  import * as _e from "react-dom";
@@ -52,7 +52,7 @@ async function ke() {
52
52
  import("@mui/material"),
53
53
  import("@mui/icons-material"),
54
54
  import("recharts")
55
- ]), { getBiModuleSurface: a } = await import("./biModuleSurface--gLAiZ9Z.js"), i = a(), d = {
55
+ ]), { getBiModuleSurface: a } = await import("./biModuleSurface-BYtgLreK.js"), i = a(), d = {
56
56
  react: Te,
57
57
  "react/jsx-runtime": Ee,
58
58
  "react-dom": _e,
@@ -710,4 +710,4 @@ export {
710
710
  vt as s,
711
711
  Pe as u
712
712
  };
713
- //# sourceMappingURL=ScriptDashboardViewerVertical-CuwnxisJ.js.map
713
+ //# sourceMappingURL=ScriptDashboardViewerVertical-CHIPRLen.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ScriptDashboardViewerVertical-CuwnxisJ.js","sources":["../src/viewer/cardMetadata.ts","../src/runtime/loadDashboardBundle.ts","../src/viewer/useDashboardBundle.ts","../src/viewer/ScriptDashboardViewer.tsx","../src/viewer/ScriptDashboardViewerVertical.tsx"],"sourcesContent":["import type { GridCardColor } from '../grid/GridCard';\nimport type { DashboardCardDefinition } from '../runtime/IDashboardDefinition';\nimport type { CardCategory, CardSpecificType, Dashboard } from './models';\n\n/** Card category → GridCard accent variant. */\nexport const CATEGORY_PREFIXES: Record<CardCategory, GridCardColor> = {\n Generic: 'custom',\n Métrica: 'kpi',\n Tabela: 'table',\n Gráfico: 'chart',\n Mapa: 'iframe',\n Árvore: 'chart',\n Medidor: 'chart',\n};\n\n/**\n * Per-card metadata: the sketch (`dashboard.cards[i]`) overrides the bundle's\n * hardcoded title / specificType / category; the bundle's values are the\n * fallback.\n */\nexport function resolveCardMetadata(\n card: DashboardCardDefinition,\n dashboard: Dashboard | undefined,\n): { title: string | undefined; specificType: CardSpecificType | undefined; category: CardCategory | undefined } {\n const related = dashboard?.cards?.find((i) => i.i === card.key) ?? null;\n const title = related?.name !== card.title ? related?.name : card.title;\n const specificType = (related?.specificType !== card.specificType ? related?.specificType : card.specificType) as CardSpecificType | undefined;\n const category = (related?.category !== card.category ? related?.category : card.category) as CardCategory | undefined;\n return { title, specificType, category };\n}\n","// Static imports stay to what every host already has (React, Emotion,\n// @mui/material/styles, dayjs). The heavy namespaces — @mui/material,\n// @mui/icons-material, recharts — are dynamic imports so a host bundler\n// code-splits them into chunks fetched only when a dashboard bundle actually\n// resolves a `require('@mui/material')` at runtime.\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport * as ReactDOMClient from 'react-dom/client';\nimport * as jsxRuntime from 'react/jsx-runtime';\nimport * as EmotionReact from '@emotion/react';\nimport * as EmotionStyled from '@emotion/styled';\nimport * as dayjs from 'dayjs';\nimport * as MuiMaterialStyles from '@mui/material/styles';\n\nimport type { BiClient } from '../client';\nimport type { DashboardCardDefinition, IDashboardDefinition } from './IDashboardDefinition';\n// NOT a static import, deliberately. `biModuleSurface` does `import * as Viewer from '../viewer'`, the\n// viewer's `useDashboardBundle` imports `instantiateDashboardBundle` from THIS file, and this file needs\n// the surface — a real cycle. Unbundled ESM tolerates it, because a namespace object is materialised\n// lazily; the BUNDLE does not. Rollup put the whole loop in one chunk and built the viewer's frozen\n// namespace eagerly, so importing `@aintela/bi`, `/runtime`, `/viewer` or `/composer` from the published\n// package threw `ReferenceError: Cannot access '_e' before initialization` before a single line of app\n// code ran. The surface is only needed inside `getHostModules`, which is already async, so deferring the\n// import to call time breaks the static cycle and costs nothing. Keep it dynamic.\n\n// ── Host-module map ────────────────────────────────────────────────────\n// `require(spec)` inside a CJS bundle resolves against this map. The BI\n// specifiers are seeded by `registerBiModules({ specifiers })` — the same\n// strings the live-TSX `__scope` registry uses — so a bundle compiled against\n// `@aintela/bi` (or a legacy `@envision/ui-library`) finds the same object.\nconst registeredSpecifiers = new Set<string>();\nlet extraHostModules: Record<string, unknown> = {};\nlet hostModulesCache: Record<string, unknown> | null = null;\n\n/** Called by `registerBiModules`. Invalidates the resolved map so the next bundle load rebuilds it. */\nexport function seedHostModules(specifiers: string[], extra?: Record<string, unknown>): void {\n for (const s of specifiers) registeredSpecifiers.add(s);\n if (extra) extraHostModules = { ...extraHostModules, ...extra };\n hostModulesCache = null;\n}\n\n/** Specifiers `registerBiModules` has seeded so far (test/diagnostic seam). */\nexport function getRegisteredSpecifiers(): string[] {\n return [...registeredSpecifiers];\n}\n\nexport async function getHostModules(): Promise<Record<string, unknown>> {\n if (hostModulesCache) return hostModulesCache;\n\n const [MuiMaterial, MuiIconsMaterial, Recharts] = await Promise.all([\n import('@mui/material'),\n import('@mui/icons-material'),\n import('recharts'),\n ]);\n\n const { getBiModuleSurface } = await import('./biModuleSurface');\n const surface = getBiModuleSurface();\n const map: Record<string, unknown> = {\n react: React,\n 'react/jsx-runtime': jsxRuntime,\n 'react-dom': ReactDOM,\n 'react-dom/client': ReactDOMClient,\n '@mui/material': MuiMaterial,\n '@mui/icons-material': MuiIconsMaterial,\n '@mui/material/styles': MuiMaterialStyles,\n '@emotion/react': EmotionReact,\n '@emotion/styled': EmotionStyled,\n recharts: Recharts,\n dayjs,\n ...extraHostModules,\n };\n for (const spec of registeredSpecifiers) map[spec] = surface;\n\n hostModulesCache = map;\n return map;\n}\n\n// ── Compiled-bundle cache (bounded LRU) ────────────────────────────────\n// The expensive step is the `new Function(code)` compile. Keyed by\n// `${sessionId}::${scriptName}` with a content hash so identical bytes reuse\n// the compiled module and regenerated bytes (same filename) recompile.\nconst MAX_CACHED_BUNDLES = 6;\ninterface CompiledBundleEntry { hash: string; module: unknown }\nconst compiledBundleCache = new Map<string, CompiledBundleEntry>();\n\n/** FNV-1a 32-bit + length. Not cryptographic; only detects a changed bundle. */\nexport function hashBundleCode(code: string): string {\n let h = 0x811c9dc5;\n for (let i = 0; i < code.length; i++) {\n h ^= code.charCodeAt(i);\n h = Math.imul(h, 0x01000193);\n }\n return `${(h >>> 0).toString(36)}:${code.length}`;\n}\n\n/** Test seam. */\nexport function clearBundleCaches(): void {\n compiledBundleCache.clear();\n hostModulesCache = null;\n}\n\n/**\n * Evaluates CJS bundle code against the host-module map and returns its\n * default export (or the whole `exports` object). Exposed so a host with its\n * own transport can skip `loadDashboardBundle`.\n */\nexport async function evaluateDashboardBundle(code: string, cacheKey?: string): Promise<unknown> {\n const HOST_MODULES = await getHostModules();\n\n const hash = hashBundleCode(code);\n if (cacheKey) {\n const cached = compiledBundleCache.get(cacheKey);\n if (cached && cached.hash === hash) {\n compiledBundleCache.delete(cacheKey);\n compiledBundleCache.set(cacheKey, cached);\n return cached.module;\n }\n }\n\n const moduleShim = { exports: {} as Record<string, unknown> };\n const requireShim = (name: string) => {\n const mod = HOST_MODULES[name];\n if (mod !== undefined) return mod;\n // Subpath imports (e.g. `@mui/icons-material/ArrowDownward`) resolve to\n // the named export of the matching host module.\n for (const [key, hostMod] of Object.entries(HOST_MODULES)) {\n if (name.startsWith(key + '/') && hostMod && typeof hostMod === 'object') {\n const exported = (hostMod as Record<string, unknown>)[name.slice(key.length + 1)];\n if (exported !== undefined) return { default: exported, __esModule: true };\n }\n }\n throw new Error(`Dashboard bundle requires unknown module: \"${name}\". Register it with registerBiModules({ specifiers | extraHostModules }).`);\n };\n\n new Function('require', 'module', 'exports', code)(requireShim, moduleShim, moduleShim.exports);\n\n const moduleExport = moduleShim.exports.default ?? moduleShim.exports;\n\n if (cacheKey) {\n compiledBundleCache.delete(cacheKey);\n compiledBundleCache.set(cacheKey, { hash, module: moduleExport });\n if (compiledBundleCache.size > MAX_CACHED_BUNDLES) {\n const oldestKey = compiledBundleCache.keys().next().value;\n if (oldestKey !== undefined) compiledBundleCache.delete(oldestKey);\n }\n }\n return moduleExport;\n}\n\n/**\n * Fetches a CJS dashboard bundle through the client and executes it in a\n * sandboxed scope with the host's React and this library.\n *\n * @returns the bundle's default export (typically a class implementing `IDashboardDefinition`)\n */\nexport async function loadDashboardBundle(client: BiClient, sessionId: string, dashboardId: string): Promise<unknown> {\n const [code] = await Promise.all([client.fetchDashboardBundle(sessionId, dashboardId), getHostModules()]);\n return evaluateDashboardBundle(code, `${sessionId}::${dashboardId}`);\n}\n\nexport interface DashboardBundleResult {\n instance: IDashboardDefinition;\n cards: DashboardCardDefinition[];\n style: React.ReactNode;\n}\n\n/** Loads a bundle, instantiates the class it exports, returns cards + style node. */\nexport async function instantiateDashboardBundle(client: BiClient, sessionId: string, scriptFileName: string): Promise<DashboardBundleResult> {\n const DashboardClass = (await loadDashboardBundle(client, sessionId, scriptFileName)) as new () => IDashboardDefinition;\n const instance = new DashboardClass();\n return {\n instance,\n cards: [...instance.getCardsList()],\n style: instance.getDashboardStyle(),\n };\n}\n","// Shared data-loading machinery for ScriptDashboardViewer and\n// ScriptDashboardViewerVertical — HEADLESS: no router, no app store, no\n// scheduling service. It reads a dashboard model (passed in or fetched by id\n// through the BiClient), instantiates the JS bundle, builds the filter\n// components, drives the parameters, and optionally polls a sub-agent while\n// it generates the dashboard. Layout / chrome belong to the viewers.\n\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport type { MutableRefObject, ReactNode, Dispatch, SetStateAction } from 'react';\nimport type { LayoutItem } from 'react-grid-layout';\nimport type { SubAgentDto } from '@aintela/chat/models';\nimport { isSubAgentTerminalStatus } from '@aintela/chat/models';\n\nimport { useBiClientOptional, type BiClient } from '../client';\nimport { instantiateDashboardBundle } from '../runtime/loadDashboardBundle';\nimport type { DashboardCardDefinition } from '../runtime/IDashboardDefinition';\nimport { createFilterComponent } from '../filters/filterFactory';\nimport { useContainerRectangle } from '../cards/useContainerRectangle';\nimport type { Dashboard } from './models';\n\nexport interface DashboardWaitingOptions {\n /** Id of the SubAgent currently generating this dashboard. */\n subAgentId: string;\n /**\n * Chat session the sub-agent runs in. Falls back to\n * `dashboard.originalSessionId` (undefined while the dashboard is still\n * being generated — pass it explicitly for the waiting case).\n */\n sessionId?: string;\n /** Polling interval in ms while the sub-agent is running. Minimum / default 10000. */\n pollIntervalMs?: number;\n}\n\nexport interface UseDashboardBundleOptions {\n /** Defaults to the ambient `BiClientProvider`. */\n client?: BiClient;\n dashboardId?: string;\n parameters?: Record<string, string | string[]>;\n dashboard?: Dashboard;\n dashboardWaiting?: DashboardWaitingOptions;\n /**\n * Re-instantiation trigger: bump ONLY when the bundle CODE is (re)generated,\n * loaded or explicitly refreshed. Not for per-edit layout commits — the\n * agent-emitted JS only changes on a rebuild, and the server derives the\n * filename from the dashboard NAME so `jsFileName` cannot signal one.\n */\n codeGeneration?: number;\n onDashloadLoaded?: (dashboard: Dashboard) => void;\n onFiltersChanged?: (filters: Record<string, unknown>) => void;\n /** Keep `isResizable` on layout items (read-only viewers leave it false). */\n editable?: boolean;\n /** Print / read-only preview (was the `?printPreview=true` URL flag). */\n isPrintPreview?: boolean;\n}\n\nexport interface DashboardBundleSnackbarState {\n open: boolean;\n message: string;\n severity: 'success' | 'error';\n}\n\nexport interface DashboardBundleResult {\n dashboard: Dashboard | undefined;\n cards: DashboardCardDefinition[] | null;\n style: ReactNode | null;\n loading: boolean;\n error: string | null;\n setError: (e: string | null) => void;\n\n filters: ReactNode;\n filterOptions: { onChange: (key: string, value: string | string[]) => void; parameters: Record<string, string | string[]>; readonly: boolean };\n stateParameters: Record<string, string | string[]>;\n handleParameterChange: (key: string, value: string | string[]) => void;\n\n containerRef: MutableRefObject<HTMLDivElement | null>;\n containerWidth: number;\n rawLayoutDefinition: LayoutItem[] | undefined;\n layoutDefinition: LayoutItem[] | undefined;\n\n effectiveDashboardId: string | undefined;\n isPrintPreview: boolean;\n\n snackbar: DashboardBundleSnackbarState;\n setSnackbar: Dispatch<SetStateAction<DashboardBundleSnackbarState>>;\n\n subAgentStatus: SubAgentDto | null;\n isSubAgentTracked: boolean;\n subAgentDone: boolean;\n subAgentFailed: boolean;\n}\n\nexport function useDashboardBundle(options: UseDashboardBundleOptions): DashboardBundleResult {\n const ambientClient = useBiClientOptional();\n const resolvedClient = options.client ?? ambientClient;\n if (!resolvedClient) {\n throw new Error('[@aintela/bi] useDashboardBundle needs a BiClient: pass `client` or mount <BiClientProvider>.');\n }\n const client: BiClient = resolvedClient;\n\n // `props.dashboard ?? localDashboard` is the canonical read; never mirror the prop into state.\n const [localDashboard, setLocalDashboard] = useState<Dashboard | undefined>(options.dashboard);\n const dashboard = options.dashboard ?? localDashboard;\n\n // Latest host callbacks in refs so inline lambdas do not re-run the effects.\n const onDashLoadedRef = useRef(options.onDashloadLoaded);\n onDashLoadedRef.current = options.onDashloadLoaded;\n const onFiltersChangedRef = useRef(options.onFiltersChanged);\n onFiltersChangedRef.current = options.onFiltersChanged;\n\n const [cards, setCards] = useState<DashboardCardDefinition[] | null>(null);\n const [style, setStyle] = useState<ReactNode | null>(null);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n const isPrintPreview = options.isPrintPreview ?? false;\n const [stateParameters, setStateParameters] = useState<Record<string, string | string[]>>(options.parameters ?? {});\n\n const handleParameterChange = useCallback((key: string, value: string | string[]) => {\n setStateParameters((prev) => {\n if (!value || (Array.isArray(value) && value.length === 0)) {\n const { [key]: _removed, ...rest } = prev;\n return rest;\n }\n const next = { ...prev, [key]: value };\n onFiltersChangedRef.current?.(next);\n return next;\n });\n }, []);\n\n // Host-supplied parameters are the authoritative external source. Memoised\n // structurally so a fresh object per render does not re-fire the merge.\n const optionsParametersKey = JSON.stringify(options.parameters ?? {});\n const reportParameters = useMemo<Record<string, string | string[]>>(\n () => ({ ...(options.parameters ?? {}) }),\n [optionsParametersKey],\n );\n\n // Defined on the very first render so filter components mounted with a\n // sync `dashboard` prop have a real onChange from their first mount.\n const filterOptions = useMemo(\n () => ({ onChange: handleParameterChange, parameters: reportParameters, readonly: isPrintPreview }),\n [reportParameters, isPrintPreview, handleParameterChange],\n );\n\n useEffect(() => {\n setStateParameters((prev) => ({ ...prev, ...reportParameters }));\n }, [reportParameters]);\n\n const effectiveDashboardId = options.dashboardId ?? dashboard?.id;\n\n // Container width — re-measured when the dashboard arrives, because the\n // spinner branch does not mount the element that owns `containerRef`.\n const containerRef = useRef<HTMLDivElement | null>(null);\n const [containerWidth] = useContainerRectangle(containerRef, 0, 0, `${effectiveDashboardId}-${dashboard?.id ?? 'pending'}`);\n\n const [snackbar, setSnackbar] = useState<DashboardBundleSnackbarState>({ open: false, message: '', severity: 'success' });\n\n // Sub-agent polling (only when the host opts in).\n const [subAgentStatus, setSubAgentStatus] = useState<SubAgentDto | null>(null);\n const waitingSubAgentId = options.dashboardWaiting?.subAgentId;\n const isSubAgentTracked = Boolean(waitingSubAgentId);\n const subAgentDone = !isSubAgentTracked || isSubAgentTerminalStatus(subAgentStatus?.status);\n const subAgentFailed = subAgentStatus?.status === 'Failed' || subAgentStatus?.status === 'Cancelled';\n const pollSessionId = options.dashboardWaiting?.sessionId ?? dashboard?.originalSessionId ?? undefined;\n const pollIntervalMs = options.dashboardWaiting?.pollIntervalMs;\n\n useEffect(() => {\n if (!isSubAgentTracked || !waitingSubAgentId || !pollSessionId) {\n setSubAgentStatus(null);\n return;\n }\n const intervalMs = Math.max(pollIntervalMs ?? 0, 10000);\n let cancelled = false;\n let timeoutHandle: ReturnType<typeof setTimeout> | null = null;\n\n const poll = async () => {\n try {\n const status = await client.getSubAgentStatus<SubAgentDto>(pollSessionId, waitingSubAgentId);\n if (cancelled) return;\n setSubAgentStatus(status);\n if (status && isSubAgentTerminalStatus(status.status)) return;\n } catch (err) {\n if (cancelled) return;\n console.error('Failed to poll sub-agent status:', err);\n }\n if (!cancelled) timeoutHandle = setTimeout(poll, intervalMs);\n };\n\n poll();\n return () => {\n cancelled = true;\n if (timeoutHandle) clearTimeout(timeoutHandle);\n };\n }, [isSubAgentTracked, waitingSubAgentId, pollSessionId, pollIntervalMs, client]);\n\n // Metadata fetch (when no `dashboard` prop).\n useEffect(() => {\n let cancelled = false;\n async function loadMetadata() {\n if (options.dashboard) return;\n if (!effectiveDashboardId) return;\n try {\n const dash = await client.getDashboard<Dashboard>(effectiveDashboardId);\n if (cancelled) return;\n setLocalDashboard(dash);\n onDashLoadedRef.current?.(dash);\n } catch (err) {\n if (!cancelled) setError(err instanceof Error ? err.message : 'Failed to load dashboard');\n }\n }\n loadMetadata();\n return () => {\n cancelled = true;\n };\n }, [effectiveDashboardId, options.dashboard, client]);\n\n // Bundle instantiation — depends on the bundle IDENTITY fields only, not\n // the whole `dashboard` object, so layout-only edits do not re-instantiate.\n const codeGeneration = options.codeGeneration;\n const dashboardIdField = dashboard?.id;\n const dashboardJsFileName = dashboard?.jsFileName;\n const dashboardSessionId = dashboard?.originalSessionId;\n useEffect(() => {\n let cancelled = false;\n async function loadBundle() {\n if (isSubAgentTracked && !subAgentDone) return;\n if (isSubAgentTracked && subAgentFailed) {\n setLoading(false);\n setError(subAgentStatus?.error ?? 'A geração do dashboard falhou.');\n return;\n }\n if (!effectiveDashboardId && !dashboardIdField) return;\n if (dashboardIdField !== undefined && !dashboardSessionId) {\n console.error('Dashboard has no originalSessionId');\n setError('Dashboard has no originalSessionId');\n return;\n }\n\n setError(null);\n setLoading(true);\n try {\n const scriptName = dashboardJsFileName ?? `${dashboardIdField ?? effectiveDashboardId}.js`;\n if (!dashboardSessionId) return;\n const result = await instantiateDashboardBundle(client, dashboardSessionId, scriptName);\n if (cancelled) return;\n setCards(result.cards);\n setStyle(result.style);\n } catch (err) {\n if (!cancelled) {\n console.error(err instanceof Error ? err.message : 'Failed to load dashboard');\n setError(err instanceof Error ? err.message : 'Failed to load dashboard');\n }\n } finally {\n if (!cancelled) setLoading(false);\n }\n }\n loadBundle();\n return () => {\n cancelled = true;\n };\n // `subAgentStatus?.error` is intentionally omitted — only read behind `subAgentFailed`.\n }, [effectiveDashboardId, dashboardIdField, dashboardJsFileName, dashboardSessionId, isSubAgentTracked, subAgentDone, subAgentFailed, codeGeneration, client]);\n\n const filters = useMemo<ReactNode>(() => {\n if (!dashboard) return null;\n return dashboard.filters?.map((f) => createFilterComponent(dashboard.id!, f, filterOptions));\n }, [dashboard, filterOptions]);\n\n // Layout — memoised against the `dashboard.cards` REFERENCE, so\n // `<GridLayout layouts>` keeps a stable identity across unrelated renders\n // (RGL otherwise fills default {w:1,h:1} placeholders on the second pass).\n const editable = options.editable ?? false;\n const rawLayoutDefinition = useMemo<LayoutItem[] | undefined>(() => {\n if (!dashboard?.cards) return undefined;\n return [...dashboard.cards] as LayoutItem[];\n }, [dashboard?.cards]);\n const layoutDefinition = useMemo<LayoutItem[] | undefined>(() => {\n if (!rawLayoutDefinition) return undefined;\n return rawLayoutDefinition.map((item) => ({ ...item, isResizable: editable, isDraggable: true }));\n }, [rawLayoutDefinition, editable]);\n\n return {\n dashboard,\n cards,\n style,\n loading,\n error,\n setError,\n filters,\n filterOptions,\n stateParameters,\n handleParameterChange,\n containerRef,\n containerWidth,\n rawLayoutDefinition,\n layoutDefinition,\n effectiveDashboardId,\n isPrintPreview,\n snackbar,\n setSnackbar,\n subAgentStatus,\n isSubAgentTracked,\n subAgentDone,\n subAgentFailed,\n };\n}\n","import React, { useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport { CloseOutlined, ImportExportOutlined, RebaseEdit, Schedule as ScheduleIcon } from '@mui/icons-material';\nimport { Stack, Box, CircularProgress, Typography, IconButton, Alert, Button, Slider, Snackbar, LinearProgress, useTheme } from '@mui/material';\nimport { alpha } from '@mui/material/styles';\nimport type { SubAgentDto } from '@aintela/chat/models';\nimport type { Layout, LayoutItem } from 'react-grid-layout';\nimport type { SvgIconComponent } from '@mui/icons-material';\n\nimport { GridCard } from '../grid/GridCard';\nimport { GridLayout } from '../grid/GridLayout';\nimport { DashboardParametersProvider } from '../hooks/DashboardParametersContext';\nimport { ChartCardDefaultsProvider } from '../data/ChartCardDefaultsContext';\nimport type { BiClient } from '../client';\nimport type { Dashboard, CardSpecificType } from './models';\nimport { CATEGORY_PREFIXES, resolveCardMetadata } from './cardMetadata';\nimport { useDashboardBundle, type DashboardWaitingOptions } from './useDashboardBundle';\n\nexport type { DashboardWaitingOptions };\n\nexport interface ScriptDashboardExportArgs {\n dashboard: Dashboard;\n /** Current filter values, as the cards see them. */\n parameters: Record<string, string | string[]>;\n datasetOverride?: string;\n}\n\nexport interface ScriptDashboardHeaderRenderArgs {\n name?: string;\n iconName?: string;\n /** Already-built filter elements ready to drop into the host's chrome. */\n filters: React.ReactNode | null;\n hasFilters: boolean;\n /** Trigger the host's PDF export (`onExportPdf`), or `undefined` when none was given. */\n onExportPdf?: () => void;\n /** Open the host's schedule UI (`onSchedule`), or `undefined`. */\n onSchedule?: () => void;\n /** Navigate to the host's editor (`onEdit`), or `undefined`. */\n onEdit?: () => void;\n exporting: boolean;\n readonly: boolean;\n canEdit: boolean;\n canSchedule: boolean;\n dashboard: Dashboard | null;\n /** The host's dataset control (`datasetOverrideControl` prop), `null` unless admin + parameterised. */\n datasetOverrideControl: React.ReactNode | null;\n}\n\nexport interface ScriptDashboardViewerProps {\n /** Defaults to the ambient `BiClientProvider`. */\n client?: BiClient;\n dashboardId?: string;\n parameters?: Record<string, string | string[]>;\n height?: number | string;\n dragLocked?: boolean;\n /** Provide the dashboard document directly instead of fetching it. */\n dashboard?: Dashboard;\n /** When true, layout items are resizable and `onLayoutCommit` receives user edits. */\n editable?: boolean;\n /** Render the classic title row + buttons + filters bar instead of the compact filters-only bar. */\n useClassicHeader?: boolean;\n onDashloadLoaded?: (dashboard: Dashboard) => void;\n onFiltersChanged?: (filters: Record<string, unknown>) => void;\n /** Replace the built-in header with a host-rendered bar. Receives the built filters + handlers. */\n headerRender?: (args: ScriptDashboardHeaderRenderArgs) => React.ReactNode;\n /** Show the \"waiting for generation\" overlay and poll the sub-agent. */\n dashboardWaiting?: DashboardWaitingOptions;\n /** Data-refresh tick → cards refetch with `noCache`. Does NOT re-instantiate the bundle. */\n llmRenderCount?: number;\n /** Bundle re-instantiation trigger — bump only on real code (re)generation. */\n codeGeneration?: number;\n /** Print / read-only preview (was the `?printPreview=true` URL flag). */\n isPrintPreview?: boolean;\n\n // ── Host callbacks (the legacy viewer called the PDF endpoint, the\n // scheduling service and the composer store itself; now the host does).\n /** Export the dashboard (e.g. call your PDF endpoint). The viewer tracks the `exporting` state around it. */\n onExportPdf?: (args: ScriptDashboardExportArgs) => Promise<void> | void;\n /** Open your scheduling UI. */\n onSchedule?: () => void;\n scheduleLabel?: string;\n /** Navigate to your editor. */\n onEdit?: () => void;\n /** User finished a resize / drag (never fired on prop syncs). */\n onLayoutCommit?: (layout: Layout, oldItem: LayoutItem, newItem: LayoutItem) => void;\n /** Admin-only runtime dataset override threaded into every data fetch. */\n datasetOverride?: string;\n /** Whether the viewer is shown to an admin (gates `datasetOverrideControl`). */\n isAdmin?: boolean;\n /** A ready-to-render dataset picker the host owns; shown when `isAdmin` and the dashboard is parameterised. */\n datasetOverrideControl?: React.ReactNode;\n /** Icon for a card's header, by its specific type. Default: no icon. */\n resolveCardIcon?: (specificType: CardSpecificType) => string | SvgIconComponent | undefined;\n /** Series palette for every chart in this dashboard (defaults to `theme.palette.bi.series`). */\n chartPalette?: readonly string[];\n /** Show the floating zoom slider (default true outside print preview). */\n showZoomControl?: boolean;\n}\n\nconst SubAgentWaitingOverlay: React.FC<{ subAgent: SubAgentDto | null }> = ({ subAgent }) => {\n const theme = useTheme();\n const todoList = subAgent?.todoList;\n const items = todoList?.items ?? [];\n const completedCount = items.filter((i) => i.status === 'Completed').length;\n const totalCount = items.length;\n\n const rawPercent = todoList?.percentComplete;\n const fraction = typeof rawPercent === 'number' && Number.isFinite(rawPercent) ? rawPercent : totalCount > 0 ? completedCount / totalCount : 0;\n const percent = Math.max(0, Math.min(100, fraction * 100));\n const hasProgress = totalCount > 0 || percent > 0;\n\n return (\n <Box\n sx={{\n position: 'relative',\n width: '100%',\n zIndex: 1500,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n gap: 2,\n px: 4,\n minHeight: '300px',\n backgroundColor: alpha(theme.palette.background.default, 0.85),\n backdropFilter: 'blur(2px)',\n }}\n >\n <Stack spacing={2} alignItems=\"center\" sx={{ width: '100%', maxWidth: 480 }}>\n <Typography variant=\"h6\" sx={{ color: 'text.primary', textAlign: 'center' }}>\n Aguardando a geração do dashboard\n </Typography>\n {subAgent?.name && (\n <Typography variant=\"body2\" sx={{ color: 'text.secondary', textAlign: 'center' }}>\n {subAgent.name}\n </Typography>\n )}\n <Box sx={{ width: '100%' }}>\n <LinearProgress variant={hasProgress ? 'determinate' : 'indeterminate'} value={hasProgress ? percent : undefined} sx={{ height: 10, borderRadius: 5 }} />\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ mt: 1 }}>\n <Typography variant=\"caption\" sx={{ color: 'text.secondary' }}>\n {totalCount > 0 ? `${completedCount} de ${totalCount} tarefas` : 'Inicializando...'}\n </Typography>\n <Typography variant=\"caption\" sx={{ color: 'text.primary', fontWeight: 600 }}>\n {`${percent.toFixed(1)}%`}\n </Typography>\n </Stack>\n </Box>\n </Stack>\n </Box>\n );\n};\n\n// Smooths the loading → dashboard hand-off: keeps both layers mounted while the\n// wrapper's inline height animates from the pre-content height to the\n// dashboard's, cross-fading the two.\ntype DashboardBodyPhase = 'pre' | 'arriving' | 'final';\nconst DASHBOARD_BODY_TRANSITION_MS = 520;\n\nconst DashboardBodyTransition: React.FC<{ showPre: boolean; preContent: React.ReactNode; finalContent: React.ReactNode }> = ({ showPre, preContent, finalContent }) => {\n const [phase, setPhase] = useState<DashboardBodyPhase>(() => (showPre ? 'pre' : 'final'));\n const wrapperRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n\n useLayoutEffect(() => {\n if (phase === 'pre' && !showPre) {\n const wrapper = wrapperRef.current;\n const H1 = wrapper?.offsetHeight ?? 0;\n if (wrapper && H1 > 0) wrapper.style.height = `${H1}px`;\n setPhase('arriving');\n } else if (phase !== 'pre' && showPre) {\n const wrapper = wrapperRef.current;\n if (wrapper) {\n wrapper.style.height = '';\n wrapper.style.transition = '';\n }\n setPhase('pre');\n }\n }, [phase, showPre]);\n\n useLayoutEffect(() => {\n if (phase !== 'arriving') return;\n const wrapper = wrapperRef.current;\n const content = contentRef.current;\n if (!wrapper || !content) return;\n const H2 = content.offsetHeight;\n void wrapper.offsetHeight;\n wrapper.style.transition = `height ${DASHBOARD_BODY_TRANSITION_MS}ms cubic-bezier(0.16, 1, 0.3, 1)`;\n wrapper.style.height = `${H2}px`;\n const t = window.setTimeout(() => {\n const w = wrapperRef.current;\n if (w) {\n w.style.height = '';\n w.style.transition = '';\n }\n setPhase('final');\n }, DASHBOARD_BODY_TRANSITION_MS + 40);\n return () => window.clearTimeout(t);\n }, [phase]);\n\n return (\n <Box\n ref={wrapperRef}\n sx={{\n position: 'relative',\n overflow: phase === 'final' ? 'auto' : 'hidden',\n width: '100%',\n flex: 1,\n minHeight: 0,\n '@keyframes dashboardArriveGrow': {\n '0%': { opacity: 0, transform: 'scale(0.97)' },\n '100%': { opacity: 1, transform: 'scale(1)' },\n },\n }}\n >\n {(phase === 'pre' || phase === 'arriving') && (\n <div\n key=\"pre-layer\"\n style={{\n position: phase === 'arriving' ? 'absolute' : 'relative',\n top: 0,\n left: 0,\n right: 0,\n opacity: phase === 'arriving' ? 0 : 1,\n transition: phase === 'arriving' ? 'opacity 360ms ease-out' : 'none',\n pointerEvents: phase === 'arriving' ? 'none' : 'auto',\n width: '100%',\n }}\n >\n {preContent}\n </div>\n )}\n {(phase === 'arriving' || phase === 'final') && (\n <Box\n key=\"content-layer\"\n ref={contentRef}\n sx={{\n width: '100%',\n animation: phase === 'arriving' ? `dashboardArriveGrow ${DASHBOARD_BODY_TRANSITION_MS}ms 60ms cubic-bezier(0.16, 1, 0.3, 1) both` : 'none',\n '@media (prefers-reduced-motion: reduce)': { animation: 'none' },\n }}\n >\n {finalContent}\n </Box>\n )}\n </Box>\n );\n};\n\nexport const ScriptDashboardViewer: React.FC<ScriptDashboardViewerProps> = (props) => {\n const useClassicHeader = props.useClassicHeader ?? false;\n const editable = props.editable ?? false;\n\n const bundle = useDashboardBundle({\n client: props.client,\n dashboardId: props.dashboardId,\n parameters: props.parameters,\n dashboard: props.dashboard,\n dashboardWaiting: props.dashboardWaiting,\n codeGeneration: props.codeGeneration,\n onDashloadLoaded: props.onDashloadLoaded,\n onFiltersChanged: props.onFiltersChanged,\n editable,\n isPrintPreview: props.isPrintPreview,\n });\n\n const {\n dashboard, cards, style, loading, error, setError, filters, filterOptions, stateParameters,\n containerRef, containerWidth, layoutDefinition, effectiveDashboardId, isPrintPreview,\n snackbar, setSnackbar, subAgentStatus, isSubAgentTracked, subAgentDone,\n } = bundle;\n\n const [exporting, setExporting] = useState(false);\n const [zoomLevel, setZoomLevel] = useState<number>(1.03);\n\n const isDashboardParameterized = dashboard?.isDatasetParameterized ?? false;\n const datasetOverrideControl = useMemo<React.ReactNode | null>(() => {\n if (isPrintPreview || !props.isAdmin || !isDashboardParameterized) return null;\n return props.datasetOverrideControl ?? null;\n }, [isPrintPreview, props.isAdmin, isDashboardParameterized, props.datasetOverrideControl]);\n\n const exportPdf = props.onExportPdf\n ? async () => {\n if (!dashboard) return;\n setExporting(true);\n try {\n await props.onExportPdf!({ dashboard, parameters: stateParameters, datasetOverride: props.datasetOverride });\n } catch (err) {\n setError(err instanceof Error ? err.message : 'PDF export failed');\n } finally {\n setExporting(false);\n }\n }\n : undefined;\n\n const canEdit = !!props.onEdit;\n const canSchedule = !!props.onSchedule && !filterOptions.readonly;\n\n const header = props.headerRender ? (\n props.headerRender({\n name: dashboard?.name,\n iconName: dashboard?.muiIconName,\n dashboard: dashboard ?? null,\n filters: filters ?? null,\n hasFilters: (dashboard?.filters?.length ?? 0) > 0,\n onExportPdf: exportPdf,\n onSchedule: props.onSchedule,\n onEdit: props.onEdit,\n exporting,\n readonly: !!filterOptions.readonly,\n canEdit,\n canSchedule,\n datasetOverrideControl,\n })\n ) : !useClassicHeader ? (\n (dashboard?.filters?.length ?? 0) > 0 ? (\n <Stack direction=\"row\" gap={2} sx={{ flexWrap: 'wrap', minWidth: '100%', px: 1.25, py: 1, justifyContent: 'flex-end', alignItems: 'flex-start' }}>\n {filters}\n </Stack>\n ) : null\n ) : (\n <>\n <Stack direction=\"row\" gap={0} sx={{ padding: '5px', marginLeft: '10px', display: 'inline-flex', color: 'text.secondary', alignItems: 'center', marginBottom: '10px', minWidth: '100%' }}>\n <Box sx={{ display: 'inline-flex', flexWrap: 'wrap', minWidth: '100%', alignItems: 'center' }}>\n <Box sx={{ display: 'inline-flex', width: '50%', alignItems: 'center', gap: 1 }}>\n <span className=\"material-icons\" style={{ maxWidth: '24px' }}>{dashboard?.muiIconName ?? 'dashboard'}</span>\n <Typography component=\"h2\" variant=\"h6\" sx={{ m: 0, color: 'text.primary' }}>{dashboard?.name ?? ''}</Typography>\n {datasetOverrideControl}\n </Box>\n <Stack direction=\"row\" gap={3} sx={{ width: '50%', display: 'inline-flex', pr: 2, justifyContent: 'right', alignItems: 'center' }}>\n {canEdit && (\n <Button onClick={props.onEdit} size=\"small\" disabled={exporting} variant=\"outlined\" sx={{ maxWidth: '200px', p: 1 }}>\n <Stack direction=\"row\" gap={0.5} alignItems=\"center\">\n <Typography variant=\"body2\">Edit</Typography>\n <RebaseEdit fontSize=\"small\" sx={{ ml: 1 }} />\n </Stack>\n </Button>\n )}\n {!filterOptions.readonly && (\n <>\n {canSchedule && (\n <Button onClick={props.onSchedule} size=\"small\" variant=\"outlined\" sx={{ maxHeight: '45px', maxWidth: '200px', p: 1 }}>\n <Stack direction=\"row\" gap={0.5} alignItems=\"center\" sx={{ maxHeight: '30px' }}>\n <Typography variant=\"body2\">{props.scheduleLabel ?? 'Agendar'}</Typography>\n <ScheduleIcon sx={{ ml: 1, fontSize: '16px' }} fontSize=\"small\" />\n </Stack>\n </Button>\n )}\n {exportPdf && (\n <Button onClick={exportPdf} size=\"small\" disabled={exporting} variant=\"outlined\" sx={{ maxHeight: '45px', maxWidth: '200px', p: 1 }}>\n <Stack direction=\"row\" gap={0.5} alignItems=\"center\" sx={{ maxHeight: '30px' }}>\n <Typography variant=\"body2\">{exporting ? 'Gerando PDF...' : 'Exportar PDF'}</Typography>\n {exporting ? <CircularProgress size={16} sx={{ ml: 1 }} /> : <ImportExportOutlined sx={{ ml: 1, fontSize: '16px' }} fontSize=\"small\" />}\n </Stack>\n </Button>\n )}\n </>\n )}\n </Stack>\n </Box>\n </Stack>\n\n {(dashboard?.filters?.length ?? 0) > 0 && (\n <Stack\n direction=\"row\"\n gap={2}\n sx={{\n flexWrap: 'wrap',\n width: '100%',\n paddingTop: filterOptions.readonly ? '10px' : '20px',\n paddingBottom: '10px',\n paddingRight: '10px',\n justifyContent: 'flex-end',\n alignItems: 'flex-start',\n backgroundColor: 'action.hover',\n }}\n >\n {filters}\n </Stack>\n )}\n </>\n );\n\n // User-driven boundaries only (RGL's resize-stop / drag-stop). A null\n // old/new item means RGL's internal sync, not a gesture — skip it.\n const commitUserLayoutEdit = (layout: Layout, oldItem: LayoutItem | null, newItem: LayoutItem | null): void => {\n if (!editable) return;\n if (!oldItem || !newItem) return;\n props.onLayoutCommit?.(layout, oldItem, newItem);\n };\n\n const cardsNode = useMemo(() => {\n if (!cards) return undefined;\n const cardViewType = dashboard?.layoutType ?? 'Boxed';\n return cards.map((card) => {\n const { title, specificType, category } = resolveCardMetadata(card, dashboard);\n return (\n <GridCard\n dragLocked={props.dragLocked ?? false}\n viewType={cardViewType}\n key={card.key}\n zoomLevel={1}\n header={{ title: title ?? '', icon: specificType ? props.resolveCardIcon?.(specificType) : undefined }}\n color={CATEGORY_PREFIXES[category ?? 'Generic']}\n >\n {card.element}\n </GridCard>\n );\n });\n }, [cards, dashboard, props.dragLocked, props.resolveCardIcon]);\n\n if (!dashboard && effectiveDashboardId) {\n return (\n <Box sx={{ display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', width: '100%', gap: 2 }}>\n <CircularProgress />\n <Typography color=\"text.secondary\">Loading dashboard...</Typography>\n </Box>\n );\n }\n if (!dashboard) return null;\n\n const showZoom = (props.showZoomControl ?? true) && !isPrintPreview;\n\n return (\n <ChartCardDefaultsProvider palette={props.chartPalette} rotateBasePerChart>\n <DashboardParametersProvider\n values={{\n dashboardId: dashboard.id ?? effectiveDashboardId ?? '',\n parameters: stateParameters,\n refreshTick: props.llmRenderCount ?? 0,\n datasetOverride: props.datasetOverride,\n }}\n >\n <Stack\n ref={(ref) => {\n containerRef.current = !containerRef.current && ref ? ref : containerRef.current;\n }}\n className=\"bi-dashboard-viewer\"\n sx={{\n height: isPrintPreview ? '100vh' : props.height ?? '100%',\n minHeight: '300px',\n display: 'inline-flex',\n backgroundColor: 'background.default',\n color: 'text.primary',\n overflow: 'hidden',\n width: '100%',\n maxWidth: isPrintPreview ? '1000px' : '100%',\n '& .grid-card::after': { borderRight: 'none', borderBottom: 'none' },\n '& .cardDragHandle': { display: 'none' },\n }}\n >\n <div style={{ position: 'relative', padding: 0, width: '100%', left: -3, height: '100%', maxHeight: '100%', display: 'flex', flexDirection: 'column', alignItems: 'flex-start' }}>\n {showZoom && (\n <Box\n sx={{\n position: 'absolute',\n left: '8px',\n bottom: '50px',\n zIndex: 1000,\n display: 'inline-flex',\n alignItems: 'center',\n gap: 1,\n px: 1.25,\n py: 0.75,\n borderRadius: 999,\n backgroundColor: 'background.paper',\n border: '1px solid',\n borderColor: 'divider',\n boxShadow: 4,\n minWidth: 180,\n }}\n >\n <Typography variant=\"caption\" sx={{ color: 'text.secondary', textTransform: 'uppercase', letterSpacing: 0.6, fontWeight: 500 }}>\n Zoom\n </Typography>\n <Slider\n value={zoomLevel}\n onChange={(_event, value) => setZoomLevel(value as number)}\n min={0.3}\n max={2}\n step={0.01}\n sx={{ flex: 1, minWidth: 80, color: 'primary.main', height: 3, py: '12px !important', '& .MuiSlider-thumb': { width: 12, height: 12, boxShadow: 'none' }, '& .MuiSlider-rail': { opacity: 0.25 } }}\n />\n <Typography variant=\"caption\" sx={{ color: 'text.primary', fontFamily: 'monospace', minWidth: 32, textAlign: 'right', fontVariantNumeric: 'tabular-nums' }}>\n {Math.round(zoomLevel * 100)}%\n </Typography>\n </Box>\n )}\n\n {header && (\n <Stack direction=\"row\" gap={0} sx={{ display: 'inline-flex', minWidth: '100%', flexWrap: 'wrap', alignItems: 'flex-start', mt: 1, flexShrink: 0 }}>\n {header}\n </Stack>\n )}\n\n {error && (\n <Box sx={{ p: 1, position: 'relative', width: '100%' }}>\n <IconButton size=\"small\" onClick={() => setError(null)} sx={{ position: 'absolute', right: 10, top: 10 }}>\n <CloseOutlined fontSize=\"small\" />\n </IconButton>\n <Alert severity=\"error\">\n <Typography variant=\"subtitle1\" fontWeight=\"bold\">Dashboard load failed</Typography>\n <Typography variant=\"body2\">{error}</Typography>\n </Alert>\n </Box>\n )}\n\n <DashboardBodyTransition\n showPre={(isSubAgentTracked && !subAgentDone) || loading || containerWidth === 0 || !layoutDefinition || !cardsNode}\n preContent={\n isSubAgentTracked && !subAgentDone ? (\n <SubAgentWaitingOverlay subAgent={subAgentStatus} />\n ) : loading ? (\n <Box sx={{ display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', minHeight: 300, width: '100%', gap: 2 }}>\n <CircularProgress />\n <Typography color=\"text.secondary\">Loading dashboard...</Typography>\n </Box>\n ) : null\n }\n finalContent={\n <div id=\"renderedDashboard\" style={{ paddingTop: 2, alignContent: 'center', minHeight: '100vh', overflow: 'auto', width: '100%' }}>\n <GridLayout\n rowAwareResize={{ defaultOn: true }}\n config={{ rows: [] }}\n cols={{ lg: 10, md: 8, sm: 4, xs: 4, xxs: 4 }}\n breakpoints={{ lg: 920, md: 600, sm: 400, xs: 400, xxs: 0 }}\n zoomLevel={zoomLevel}\n responsive={false}\n rowHeight={isPrintPreview ? 18 : 20}\n dragLocked={props.dragLocked ?? false}\n rowMultiplier={1}\n maxRows={200}\n onResizeStop={commitUserLayoutEdit}\n onDragStop={commitUserLayoutEdit}\n manualWidth={containerWidth}\n layouts={layoutDefinition}\n >\n {cardsNode}\n </GridLayout>\n {style}\n </div>\n }\n />\n </div>\n\n <Snackbar open={snackbar.open} autoHideDuration={4000} onClose={() => setSnackbar((prev) => ({ ...prev, open: false }))} anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }}>\n <Alert onClose={() => setSnackbar((prev) => ({ ...prev, open: false }))} severity={snackbar.severity} variant=\"filled\">\n {snackbar.message}\n </Alert>\n </Snackbar>\n </Stack>\n </DashboardParametersProvider>\n </ChartCardDefaultsProvider>\n );\n};\n\nexport default ScriptDashboardViewer;\n","// Vertical dashboard viewer: stacks cards in a portrait column instead of a\n// grid (a collapsed side panel). Data loading is shared via useDashboardBundle;\n// this file owns only the layout (no header, no zoom pill).\nimport React, { useMemo } from 'react';\nimport { CloseOutlined } from '@mui/icons-material';\nimport type { SvgIconComponent } from '@mui/icons-material';\nimport { Stack, Box, CircularProgress, Typography, IconButton, Alert, Snackbar } from '@mui/material';\nimport { GridCard } from '../grid/GridCard';\nimport { DashboardParametersProvider } from '../hooks/DashboardParametersContext';\nimport type { BiClient } from '../client';\nimport type { Dashboard, CardSpecificType } from './models';\nimport { resolveCardMetadata } from './cardMetadata';\nimport { useDashboardBundle, type DashboardWaitingOptions } from './useDashboardBundle';\n\nexport interface ScriptDashboardViewerVerticalProps {\n client?: BiClient;\n dashboardId?: string;\n parameters?: Record<string, string | string[]>;\n height?: number | string;\n dashboard?: Dashboard;\n onDashloadLoaded?: (dashboard: Dashboard) => void;\n onFiltersChanged?: (filters: Record<string, unknown>) => void;\n dashboardWaiting?: DashboardWaitingOptions;\n /** Data-refresh tick → `refreshTick` (cards refetch). Does NOT re-instantiate the bundle. */\n llmRenderCount?: number;\n /** Bundle re-instantiation trigger — bump only on real code (re)generation. */\n codeGeneration?: number;\n isPrintPreview?: boolean;\n datasetOverride?: string;\n resolveCardIcon?: (specificType: CardSpecificType) => string | SvgIconComponent | undefined;\n}\n\nexport const ScriptDashboardViewerVertical: React.FC<ScriptDashboardViewerVerticalProps> = (props) => {\n const bundle = useDashboardBundle({\n client: props.client,\n dashboardId: props.dashboardId,\n parameters: props.parameters,\n dashboard: props.dashboard,\n dashboardWaiting: props.dashboardWaiting,\n codeGeneration: props.codeGeneration,\n onDashloadLoaded: props.onDashloadLoaded,\n onFiltersChanged: props.onFiltersChanged,\n isPrintPreview: props.isPrintPreview,\n });\n\n const { dashboard, cards, loading, error, setError, stateParameters, containerRef, containerWidth, layoutDefinition, effectiveDashboardId, isPrintPreview, snackbar, setSnackbar } = bundle;\n\n // Fixed-height cards (160px metric/gauge, 250px otherwise), slightly zoomed\n // to fit the narrow column, hairline divider when the layout is `Naked`.\n const cardsNode = useMemo(() => {\n if (!cards) return undefined;\n const cardViewType = dashboard?.layoutType ?? 'Boxed';\n return cards.map((card) => {\n const { title, specificType } = resolveCardMetadata(card, dashboard);\n const isMetric = specificType === 'MetricComparison' || specificType === 'Gauge' || specificType == undefined;\n return (\n <Box\n key={card.key}\n sx={{\n height: isMetric ? '160px' : '250px',\n maxWidth: '100%',\n mx: 0.5,\n borderBottom: dashboard?.layoutType === 'Naked' ? '1px solid' : 'unset',\n borderColor: 'divider',\n }}\n >\n <GridCard dragLocked noBorder viewType={cardViewType} zoomLevel={isMetric ? 0.9 : 0.7} header={{ title: title ?? '', icon: specificType ? props.resolveCardIcon?.(specificType) : undefined }}>\n {card.element}\n </GridCard>\n </Box>\n );\n });\n }, [cards, dashboard, props.resolveCardIcon]);\n\n if (!dashboard && effectiveDashboardId) {\n return (\n <Box sx={{ display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', width: '100%', gap: 2 }}>\n <CircularProgress />\n <Typography color=\"text.secondary\">Loading dashboard...</Typography>\n </Box>\n );\n }\n if (!dashboard) return null;\n\n return (\n <Stack\n ref={(ref) => {\n containerRef.current = !containerRef.current && ref ? ref : containerRef.current;\n }}\n className=\"bi-dashboard-viewer-vertical\"\n sx={{\n height: isPrintPreview ? '100vh' : props.height ?? 'unset',\n display: 'inline-flex',\n backgroundColor: 'background.default',\n color: 'text.primary',\n minHeight: '300px',\n overflow: 'auto',\n width: '100%',\n maxWidth: isPrintPreview ? '1000px' : '100%',\n '& .grid-card::after': { borderRight: 'none', borderBottom: 'none' },\n '& .cardDragHandle': { display: 'none' },\n }}\n >\n <div style={{ position: 'relative', width: '100%', height: '100%', maxHeight: '100%', display: 'flex', flexDirection: 'column', alignItems: 'flex-start' }}>\n {loading && (\n <Box sx={{ display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', width: '100%', gap: 2 }}>\n <CircularProgress />\n <Typography color=\"text.secondary\">Loading dashboard...</Typography>\n </Box>\n )}\n\n {error && (\n <Box sx={{ p: 1, position: 'relative', width: '100%' }}>\n <IconButton size=\"small\" onClick={() => setError(null)} sx={{ position: 'absolute', right: 10, top: 10 }}>\n <CloseOutlined fontSize=\"small\" />\n </IconButton>\n <Alert severity=\"error\">\n <Typography variant=\"subtitle1\" fontWeight=\"bold\">Dashboard load failed</Typography>\n <Typography variant=\"body2\">{error}</Typography>\n </Alert>\n </Box>\n )}\n\n {!loading && containerWidth !== 0 && layoutDefinition && cardsNode && (\n <DashboardParametersProvider\n values={{\n dashboardId: dashboard.id ?? effectiveDashboardId ?? '',\n parameters: stateParameters ?? {},\n refreshTick: props.llmRenderCount ?? 0,\n datasetOverride: props.datasetOverride,\n }}\n >\n <Stack sx={{ width: '100%' }} gap={1}>\n {cardsNode}\n </Stack>\n </DashboardParametersProvider>\n )}\n <Box sx={{ minHeight: '70px', minWidth: '100%' }} />\n </div>\n\n <Snackbar open={snackbar.open} autoHideDuration={4000} onClose={() => setSnackbar((prev) => ({ ...prev, open: false }))} anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }}>\n <Alert onClose={() => setSnackbar((prev) => ({ ...prev, open: false }))} severity={snackbar.severity} variant=\"filled\">\n {snackbar.message}\n </Alert>\n </Snackbar>\n </Stack>\n );\n};\n\nexport default ScriptDashboardViewerVertical;\n"],"names":["CATEGORY_PREFIXES","resolveCardMetadata","card","dashboard","related","_a","i","title","specificType","category","__name","registeredSpecifiers","extraHostModules","hostModulesCache","seedHostModules","specifiers","extra","s","getRegisteredSpecifiers","getHostModules","MuiMaterial","MuiIconsMaterial","Recharts","getBiModuleSurface","surface","map","React","jsxRuntime","ReactDOM","ReactDOMClient","MuiMaterialStyles","EmotionReact","EmotionStyled","dayjs","spec","MAX_CACHED_BUNDLES","compiledBundleCache","hashBundleCode","code","h","clearBundleCaches","evaluateDashboardBundle","cacheKey","HOST_MODULES","hash","cached","moduleShim","requireShim","name","mod","key","hostMod","exported","moduleExport","oldestKey","loadDashboardBundle","client","sessionId","dashboardId","instantiateDashboardBundle","scriptFileName","DashboardClass","instance","useDashboardBundle","options","ambientClient","useBiClientOptional","resolvedClient","localDashboard","setLocalDashboard","useState","onDashLoadedRef","useRef","onFiltersChangedRef","cards","setCards","style","setStyle","loading","setLoading","error","setError","isPrintPreview","stateParameters","setStateParameters","handleParameterChange","useCallback","value","prev","_removed","rest","next","optionsParametersKey","reportParameters","useMemo","filterOptions","useEffect","effectiveDashboardId","containerRef","containerWidth","useContainerRectangle","snackbar","setSnackbar","subAgentStatus","setSubAgentStatus","waitingSubAgentId","isSubAgentTracked","subAgentDone","isSubAgentTerminalStatus","subAgentFailed","pollSessionId","_b","pollIntervalMs","_c","intervalMs","cancelled","timeoutHandle","poll","status","err","loadMetadata","dash","codeGeneration","dashboardIdField","dashboardJsFileName","dashboardSessionId","loadBundle","scriptName","result","filters","f","createFilterComponent","editable","rawLayoutDefinition","layoutDefinition","item","SubAgentWaitingOverlay","subAgent","theme","useTheme","todoList","items","completedCount","totalCount","rawPercent","fraction","percent","hasProgress","jsx","Box","alpha","jsxs","Stack","Typography","LinearProgress","DASHBOARD_BODY_TRANSITION_MS","DashboardBodyTransition","showPre","preContent","finalContent","phase","setPhase","wrapperRef","contentRef","useLayoutEffect","wrapper","H1","content","H2","t","w","ScriptDashboardViewer","props","useClassicHeader","bundle","exporting","setExporting","zoomLevel","setZoomLevel","isDashboardParameterized","datasetOverrideControl","exportPdf","canEdit","canSchedule","header","Fragment","Button","RebaseEdit","ScheduleIcon","CircularProgress","ImportExportOutlined","commitUserLayoutEdit","layout","oldItem","newItem","cardsNode","cardViewType","GridCard","showZoom","ChartCardDefaultsProvider","DashboardParametersProvider","ref","Slider","_event","IconButton","CloseOutlined","Alert","GridLayout","Snackbar","ScriptDashboardViewerVertical","isMetric"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAKO,MAAMA,KAAyD;AAAA,EAClE,SAAS;AAAA,EACT,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,SAAS;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A;AAAA,UAGR,gBAAA/C,EAACC,KAAI,IAAI,EAAE,WAAW,QAAQ,UAAU,SAAO,CAAG;AAAA,QAAA,GACtD;AAAA,QAEA,gBAAAD,EAAC4D,MAAS,MAAM3G,EAAS,MAAM,kBAAkB,KAAM,SAAS,gBAAA3F,EAAA,MAAM4F,EAAY,CAACd,OAAU,EAAE,GAAGA,GAAM,MAAM,KAAQ,GAAtD,YAAyD,cAAc,EAAE,UAAU,UAAU,YAAY,SAAA,GACrK,4BAACsH,IAAA,EAAM,SAAS,gBAAApM,EAAA,MAAM4F,EAAY,CAACd,OAAU,EAAE,GAAGA,GAAM,MAAM,GAAA,EAAQ,GAAtD,YAAyD,UAAUa,EAAS,UAAU,SAAQ,UACzG,UAAAA,EAAS,QAAA,CACd,EAAA,CACJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,IA9De;AAiE3B,GAnH2F;"}
1
+ {"version":3,"file":"ScriptDashboardViewerVertical-CHIPRLen.js","sources":["../src/viewer/cardMetadata.ts","../src/runtime/loadDashboardBundle.ts","../src/viewer/useDashboardBundle.ts","../src/viewer/ScriptDashboardViewer.tsx","../src/viewer/ScriptDashboardViewerVertical.tsx"],"sourcesContent":["import type { GridCardColor } from '../grid/GridCard';\nimport type { DashboardCardDefinition } from '../runtime/IDashboardDefinition';\nimport type { CardCategory, CardSpecificType, Dashboard } from './models';\n\n/** Card category → GridCard accent variant. */\nexport const CATEGORY_PREFIXES: Record<CardCategory, GridCardColor> = {\n Generic: 'custom',\n Métrica: 'kpi',\n Tabela: 'table',\n Gráfico: 'chart',\n Mapa: 'iframe',\n Árvore: 'chart',\n Medidor: 'chart',\n};\n\n/**\n * Per-card metadata: the sketch (`dashboard.cards[i]`) overrides the bundle's\n * hardcoded title / specificType / category; the bundle's values are the\n * fallback.\n */\nexport function resolveCardMetadata(\n card: DashboardCardDefinition,\n dashboard: Dashboard | undefined,\n): { title: string | undefined; specificType: CardSpecificType | undefined; category: CardCategory | undefined } {\n const related = dashboard?.cards?.find((i) => i.i === card.key) ?? null;\n const title = related?.name !== card.title ? related?.name : card.title;\n const specificType = (related?.specificType !== card.specificType ? related?.specificType : card.specificType) as CardSpecificType | undefined;\n const category = (related?.category !== card.category ? related?.category : card.category) as CardCategory | undefined;\n return { title, specificType, category };\n}\n","// Static imports stay to what every host already has (React, Emotion,\n// @mui/material/styles, dayjs). The heavy namespaces — @mui/material,\n// @mui/icons-material, recharts — are dynamic imports so a host bundler\n// code-splits them into chunks fetched only when a dashboard bundle actually\n// resolves a `require('@mui/material')` at runtime.\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport * as ReactDOMClient from 'react-dom/client';\nimport * as jsxRuntime from 'react/jsx-runtime';\nimport * as EmotionReact from '@emotion/react';\nimport * as EmotionStyled from '@emotion/styled';\nimport * as dayjs from 'dayjs';\nimport * as MuiMaterialStyles from '@mui/material/styles';\n\nimport type { BiClient } from '../client';\nimport type { DashboardCardDefinition, IDashboardDefinition } from './IDashboardDefinition';\n// NOT a static import, deliberately. `biModuleSurface` does `import * as Viewer from '../viewer'`, the\n// viewer's `useDashboardBundle` imports `instantiateDashboardBundle` from THIS file, and this file needs\n// the surface — a real cycle. Unbundled ESM tolerates it, because a namespace object is materialised\n// lazily; the BUNDLE does not. Rollup put the whole loop in one chunk and built the viewer's frozen\n// namespace eagerly, so importing `@aintela/bi`, `/runtime`, `/viewer` or `/composer` from the published\n// package threw `ReferenceError: Cannot access '_e' before initialization` before a single line of app\n// code ran. The surface is only needed inside `getHostModules`, which is already async, so deferring the\n// import to call time breaks the static cycle and costs nothing. Keep it dynamic.\n\n// ── Host-module map ────────────────────────────────────────────────────\n// `require(spec)` inside a CJS bundle resolves against this map. The BI\n// specifiers are seeded by `registerBiModules({ specifiers })` — the same\n// strings the live-TSX `__scope` registry uses — so a bundle compiled against\n// `@aintela/bi` (or a legacy `@envision/ui-library`) finds the same object.\nconst registeredSpecifiers = new Set<string>();\nlet extraHostModules: Record<string, unknown> = {};\nlet hostModulesCache: Record<string, unknown> | null = null;\n\n/** Called by `registerBiModules`. Invalidates the resolved map so the next bundle load rebuilds it. */\nexport function seedHostModules(specifiers: string[], extra?: Record<string, unknown>): void {\n for (const s of specifiers) registeredSpecifiers.add(s);\n if (extra) extraHostModules = { ...extraHostModules, ...extra };\n hostModulesCache = null;\n}\n\n/** Specifiers `registerBiModules` has seeded so far (test/diagnostic seam). */\nexport function getRegisteredSpecifiers(): string[] {\n return [...registeredSpecifiers];\n}\n\nexport async function getHostModules(): Promise<Record<string, unknown>> {\n if (hostModulesCache) return hostModulesCache;\n\n const [MuiMaterial, MuiIconsMaterial, Recharts] = await Promise.all([\n import('@mui/material'),\n import('@mui/icons-material'),\n import('recharts'),\n ]);\n\n const { getBiModuleSurface } = await import('./biModuleSurface');\n const surface = getBiModuleSurface();\n const map: Record<string, unknown> = {\n react: React,\n 'react/jsx-runtime': jsxRuntime,\n 'react-dom': ReactDOM,\n 'react-dom/client': ReactDOMClient,\n '@mui/material': MuiMaterial,\n '@mui/icons-material': MuiIconsMaterial,\n '@mui/material/styles': MuiMaterialStyles,\n '@emotion/react': EmotionReact,\n '@emotion/styled': EmotionStyled,\n recharts: Recharts,\n dayjs,\n ...extraHostModules,\n };\n for (const spec of registeredSpecifiers) map[spec] = surface;\n\n hostModulesCache = map;\n return map;\n}\n\n// ── Compiled-bundle cache (bounded LRU) ────────────────────────────────\n// The expensive step is the `new Function(code)` compile. Keyed by\n// `${sessionId}::${scriptName}` with a content hash so identical bytes reuse\n// the compiled module and regenerated bytes (same filename) recompile.\nconst MAX_CACHED_BUNDLES = 6;\ninterface CompiledBundleEntry { hash: string; module: unknown }\nconst compiledBundleCache = new Map<string, CompiledBundleEntry>();\n\n/** FNV-1a 32-bit + length. Not cryptographic; only detects a changed bundle. */\nexport function hashBundleCode(code: string): string {\n let h = 0x811c9dc5;\n for (let i = 0; i < code.length; i++) {\n h ^= code.charCodeAt(i);\n h = Math.imul(h, 0x01000193);\n }\n return `${(h >>> 0).toString(36)}:${code.length}`;\n}\n\n/** Test seam. */\nexport function clearBundleCaches(): void {\n compiledBundleCache.clear();\n hostModulesCache = null;\n}\n\n/**\n * Evaluates CJS bundle code against the host-module map and returns its\n * default export (or the whole `exports` object). Exposed so a host with its\n * own transport can skip `loadDashboardBundle`.\n */\nexport async function evaluateDashboardBundle(code: string, cacheKey?: string): Promise<unknown> {\n const HOST_MODULES = await getHostModules();\n\n const hash = hashBundleCode(code);\n if (cacheKey) {\n const cached = compiledBundleCache.get(cacheKey);\n if (cached && cached.hash === hash) {\n compiledBundleCache.delete(cacheKey);\n compiledBundleCache.set(cacheKey, cached);\n return cached.module;\n }\n }\n\n const moduleShim = { exports: {} as Record<string, unknown> };\n const requireShim = (name: string) => {\n const mod = HOST_MODULES[name];\n if (mod !== undefined) return mod;\n // Subpath imports (e.g. `@mui/icons-material/ArrowDownward`) resolve to\n // the named export of the matching host module.\n for (const [key, hostMod] of Object.entries(HOST_MODULES)) {\n if (name.startsWith(key + '/') && hostMod && typeof hostMod === 'object') {\n const exported = (hostMod as Record<string, unknown>)[name.slice(key.length + 1)];\n if (exported !== undefined) return { default: exported, __esModule: true };\n }\n }\n throw new Error(`Dashboard bundle requires unknown module: \"${name}\". Register it with registerBiModules({ specifiers | extraHostModules }).`);\n };\n\n new Function('require', 'module', 'exports', code)(requireShim, moduleShim, moduleShim.exports);\n\n const moduleExport = moduleShim.exports.default ?? moduleShim.exports;\n\n if (cacheKey) {\n compiledBundleCache.delete(cacheKey);\n compiledBundleCache.set(cacheKey, { hash, module: moduleExport });\n if (compiledBundleCache.size > MAX_CACHED_BUNDLES) {\n const oldestKey = compiledBundleCache.keys().next().value;\n if (oldestKey !== undefined) compiledBundleCache.delete(oldestKey);\n }\n }\n return moduleExport;\n}\n\n/**\n * Fetches a CJS dashboard bundle through the client and executes it in a\n * sandboxed scope with the host's React and this library.\n *\n * @returns the bundle's default export (typically a class implementing `IDashboardDefinition`)\n */\nexport async function loadDashboardBundle(client: BiClient, sessionId: string, dashboardId: string): Promise<unknown> {\n const [code] = await Promise.all([client.fetchDashboardBundle(sessionId, dashboardId), getHostModules()]);\n return evaluateDashboardBundle(code, `${sessionId}::${dashboardId}`);\n}\n\nexport interface DashboardBundleResult {\n instance: IDashboardDefinition;\n cards: DashboardCardDefinition[];\n style: React.ReactNode;\n}\n\n/** Loads a bundle, instantiates the class it exports, returns cards + style node. */\nexport async function instantiateDashboardBundle(client: BiClient, sessionId: string, scriptFileName: string): Promise<DashboardBundleResult> {\n const DashboardClass = (await loadDashboardBundle(client, sessionId, scriptFileName)) as new () => IDashboardDefinition;\n const instance = new DashboardClass();\n return {\n instance,\n cards: [...instance.getCardsList()],\n style: instance.getDashboardStyle(),\n };\n}\n","// Shared data-loading machinery for ScriptDashboardViewer and\n// ScriptDashboardViewerVertical — HEADLESS: no router, no app store, no\n// scheduling service. It reads a dashboard model (passed in or fetched by id\n// through the BiClient), instantiates the JS bundle, builds the filter\n// components, drives the parameters, and optionally polls a sub-agent while\n// it generates the dashboard. Layout / chrome belong to the viewers.\n\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport type { MutableRefObject, ReactNode, Dispatch, SetStateAction } from 'react';\nimport type { LayoutItem } from 'react-grid-layout';\nimport type { SubAgentDto } from '@aintela/chat/models';\nimport { isSubAgentTerminalStatus } from '@aintela/chat/models';\n\nimport { useBiClientOptional, type BiClient } from '../client';\nimport { instantiateDashboardBundle } from '../runtime/loadDashboardBundle';\nimport type { DashboardCardDefinition } from '../runtime/IDashboardDefinition';\nimport { createFilterComponent } from '../filters/filterFactory';\nimport { useContainerRectangle } from '../cards/useContainerRectangle';\nimport type { Dashboard } from './models';\n\nexport interface DashboardWaitingOptions {\n /** Id of the SubAgent currently generating this dashboard. */\n subAgentId: string;\n /**\n * Chat session the sub-agent runs in. Falls back to\n * `dashboard.originalSessionId` (undefined while the dashboard is still\n * being generated — pass it explicitly for the waiting case).\n */\n sessionId?: string;\n /** Polling interval in ms while the sub-agent is running. Minimum / default 10000. */\n pollIntervalMs?: number;\n}\n\nexport interface UseDashboardBundleOptions {\n /** Defaults to the ambient `BiClientProvider`. */\n client?: BiClient;\n dashboardId?: string;\n parameters?: Record<string, string | string[]>;\n dashboard?: Dashboard;\n dashboardWaiting?: DashboardWaitingOptions;\n /**\n * Re-instantiation trigger: bump ONLY when the bundle CODE is (re)generated,\n * loaded or explicitly refreshed. Not for per-edit layout commits — the\n * agent-emitted JS only changes on a rebuild, and the server derives the\n * filename from the dashboard NAME so `jsFileName` cannot signal one.\n */\n codeGeneration?: number;\n onDashloadLoaded?: (dashboard: Dashboard) => void;\n onFiltersChanged?: (filters: Record<string, unknown>) => void;\n /** Keep `isResizable` on layout items (read-only viewers leave it false). */\n editable?: boolean;\n /** Print / read-only preview (was the `?printPreview=true` URL flag). */\n isPrintPreview?: boolean;\n}\n\nexport interface DashboardBundleSnackbarState {\n open: boolean;\n message: string;\n severity: 'success' | 'error';\n}\n\nexport interface DashboardBundleResult {\n dashboard: Dashboard | undefined;\n cards: DashboardCardDefinition[] | null;\n style: ReactNode | null;\n loading: boolean;\n error: string | null;\n setError: (e: string | null) => void;\n\n filters: ReactNode;\n filterOptions: { onChange: (key: string, value: string | string[]) => void; parameters: Record<string, string | string[]>; readonly: boolean };\n stateParameters: Record<string, string | string[]>;\n handleParameterChange: (key: string, value: string | string[]) => void;\n\n containerRef: MutableRefObject<HTMLDivElement | null>;\n containerWidth: number;\n rawLayoutDefinition: LayoutItem[] | undefined;\n layoutDefinition: LayoutItem[] | undefined;\n\n effectiveDashboardId: string | undefined;\n isPrintPreview: boolean;\n\n snackbar: DashboardBundleSnackbarState;\n setSnackbar: Dispatch<SetStateAction<DashboardBundleSnackbarState>>;\n\n subAgentStatus: SubAgentDto | null;\n isSubAgentTracked: boolean;\n subAgentDone: boolean;\n subAgentFailed: boolean;\n}\n\nexport function useDashboardBundle(options: UseDashboardBundleOptions): DashboardBundleResult {\n const ambientClient = useBiClientOptional();\n const resolvedClient = options.client ?? ambientClient;\n if (!resolvedClient) {\n throw new Error('[@aintela/bi] useDashboardBundle needs a BiClient: pass `client` or mount <BiClientProvider>.');\n }\n const client: BiClient = resolvedClient;\n\n // `props.dashboard ?? localDashboard` is the canonical read; never mirror the prop into state.\n const [localDashboard, setLocalDashboard] = useState<Dashboard | undefined>(options.dashboard);\n const dashboard = options.dashboard ?? localDashboard;\n\n // Latest host callbacks in refs so inline lambdas do not re-run the effects.\n const onDashLoadedRef = useRef(options.onDashloadLoaded);\n onDashLoadedRef.current = options.onDashloadLoaded;\n const onFiltersChangedRef = useRef(options.onFiltersChanged);\n onFiltersChangedRef.current = options.onFiltersChanged;\n\n const [cards, setCards] = useState<DashboardCardDefinition[] | null>(null);\n const [style, setStyle] = useState<ReactNode | null>(null);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n const isPrintPreview = options.isPrintPreview ?? false;\n const [stateParameters, setStateParameters] = useState<Record<string, string | string[]>>(options.parameters ?? {});\n\n const handleParameterChange = useCallback((key: string, value: string | string[]) => {\n setStateParameters((prev) => {\n if (!value || (Array.isArray(value) && value.length === 0)) {\n const { [key]: _removed, ...rest } = prev;\n return rest;\n }\n const next = { ...prev, [key]: value };\n onFiltersChangedRef.current?.(next);\n return next;\n });\n }, []);\n\n // Host-supplied parameters are the authoritative external source. Memoised\n // structurally so a fresh object per render does not re-fire the merge.\n const optionsParametersKey = JSON.stringify(options.parameters ?? {});\n const reportParameters = useMemo<Record<string, string | string[]>>(\n () => ({ ...(options.parameters ?? {}) }),\n [optionsParametersKey],\n );\n\n // Defined on the very first render so filter components mounted with a\n // sync `dashboard` prop have a real onChange from their first mount.\n const filterOptions = useMemo(\n () => ({ onChange: handleParameterChange, parameters: reportParameters, readonly: isPrintPreview }),\n [reportParameters, isPrintPreview, handleParameterChange],\n );\n\n useEffect(() => {\n setStateParameters((prev) => ({ ...prev, ...reportParameters }));\n }, [reportParameters]);\n\n const effectiveDashboardId = options.dashboardId ?? dashboard?.id;\n\n // Container width — re-measured when the dashboard arrives, because the\n // spinner branch does not mount the element that owns `containerRef`.\n const containerRef = useRef<HTMLDivElement | null>(null);\n const [containerWidth] = useContainerRectangle(containerRef, 0, 0, `${effectiveDashboardId}-${dashboard?.id ?? 'pending'}`);\n\n const [snackbar, setSnackbar] = useState<DashboardBundleSnackbarState>({ open: false, message: '', severity: 'success' });\n\n // Sub-agent polling (only when the host opts in).\n const [subAgentStatus, setSubAgentStatus] = useState<SubAgentDto | null>(null);\n const waitingSubAgentId = options.dashboardWaiting?.subAgentId;\n const isSubAgentTracked = Boolean(waitingSubAgentId);\n const subAgentDone = !isSubAgentTracked || isSubAgentTerminalStatus(subAgentStatus?.status);\n const subAgentFailed = subAgentStatus?.status === 'Failed' || subAgentStatus?.status === 'Cancelled';\n const pollSessionId = options.dashboardWaiting?.sessionId ?? dashboard?.originalSessionId ?? undefined;\n const pollIntervalMs = options.dashboardWaiting?.pollIntervalMs;\n\n useEffect(() => {\n if (!isSubAgentTracked || !waitingSubAgentId || !pollSessionId) {\n setSubAgentStatus(null);\n return;\n }\n const intervalMs = Math.max(pollIntervalMs ?? 0, 10000);\n let cancelled = false;\n let timeoutHandle: ReturnType<typeof setTimeout> | null = null;\n\n const poll = async () => {\n try {\n const status = await client.getSubAgentStatus<SubAgentDto>(pollSessionId, waitingSubAgentId);\n if (cancelled) return;\n setSubAgentStatus(status);\n if (status && isSubAgentTerminalStatus(status.status)) return;\n } catch (err) {\n if (cancelled) return;\n console.error('Failed to poll sub-agent status:', err);\n }\n if (!cancelled) timeoutHandle = setTimeout(poll, intervalMs);\n };\n\n poll();\n return () => {\n cancelled = true;\n if (timeoutHandle) clearTimeout(timeoutHandle);\n };\n }, [isSubAgentTracked, waitingSubAgentId, pollSessionId, pollIntervalMs, client]);\n\n // Metadata fetch (when no `dashboard` prop).\n useEffect(() => {\n let cancelled = false;\n async function loadMetadata() {\n if (options.dashboard) return;\n if (!effectiveDashboardId) return;\n try {\n const dash = await client.getDashboard<Dashboard>(effectiveDashboardId);\n if (cancelled) return;\n setLocalDashboard(dash);\n onDashLoadedRef.current?.(dash);\n } catch (err) {\n if (!cancelled) setError(err instanceof Error ? err.message : 'Failed to load dashboard');\n }\n }\n loadMetadata();\n return () => {\n cancelled = true;\n };\n }, [effectiveDashboardId, options.dashboard, client]);\n\n // Bundle instantiation — depends on the bundle IDENTITY fields only, not\n // the whole `dashboard` object, so layout-only edits do not re-instantiate.\n const codeGeneration = options.codeGeneration;\n const dashboardIdField = dashboard?.id;\n const dashboardJsFileName = dashboard?.jsFileName;\n const dashboardSessionId = dashboard?.originalSessionId;\n useEffect(() => {\n let cancelled = false;\n async function loadBundle() {\n if (isSubAgentTracked && !subAgentDone) return;\n if (isSubAgentTracked && subAgentFailed) {\n setLoading(false);\n setError(subAgentStatus?.error ?? 'A geração do dashboard falhou.');\n return;\n }\n if (!effectiveDashboardId && !dashboardIdField) return;\n if (dashboardIdField !== undefined && !dashboardSessionId) {\n console.error('Dashboard has no originalSessionId');\n setError('Dashboard has no originalSessionId');\n return;\n }\n\n setError(null);\n setLoading(true);\n try {\n const scriptName = dashboardJsFileName ?? `${dashboardIdField ?? effectiveDashboardId}.js`;\n if (!dashboardSessionId) return;\n const result = await instantiateDashboardBundle(client, dashboardSessionId, scriptName);\n if (cancelled) return;\n setCards(result.cards);\n setStyle(result.style);\n } catch (err) {\n if (!cancelled) {\n console.error(err instanceof Error ? err.message : 'Failed to load dashboard');\n setError(err instanceof Error ? err.message : 'Failed to load dashboard');\n }\n } finally {\n if (!cancelled) setLoading(false);\n }\n }\n loadBundle();\n return () => {\n cancelled = true;\n };\n // `subAgentStatus?.error` is intentionally omitted — only read behind `subAgentFailed`.\n }, [effectiveDashboardId, dashboardIdField, dashboardJsFileName, dashboardSessionId, isSubAgentTracked, subAgentDone, subAgentFailed, codeGeneration, client]);\n\n const filters = useMemo<ReactNode>(() => {\n if (!dashboard) return null;\n return dashboard.filters?.map((f) => createFilterComponent(dashboard.id!, f, filterOptions));\n }, [dashboard, filterOptions]);\n\n // Layout — memoised against the `dashboard.cards` REFERENCE, so\n // `<GridLayout layouts>` keeps a stable identity across unrelated renders\n // (RGL otherwise fills default {w:1,h:1} placeholders on the second pass).\n const editable = options.editable ?? false;\n const rawLayoutDefinition = useMemo<LayoutItem[] | undefined>(() => {\n if (!dashboard?.cards) return undefined;\n return [...dashboard.cards] as LayoutItem[];\n }, [dashboard?.cards]);\n const layoutDefinition = useMemo<LayoutItem[] | undefined>(() => {\n if (!rawLayoutDefinition) return undefined;\n return rawLayoutDefinition.map((item) => ({ ...item, isResizable: editable, isDraggable: true }));\n }, [rawLayoutDefinition, editable]);\n\n return {\n dashboard,\n cards,\n style,\n loading,\n error,\n setError,\n filters,\n filterOptions,\n stateParameters,\n handleParameterChange,\n containerRef,\n containerWidth,\n rawLayoutDefinition,\n layoutDefinition,\n effectiveDashboardId,\n isPrintPreview,\n snackbar,\n setSnackbar,\n subAgentStatus,\n isSubAgentTracked,\n subAgentDone,\n subAgentFailed,\n };\n}\n","import React, { useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport { CloseOutlined, ImportExportOutlined, RebaseEdit, Schedule as ScheduleIcon } from '@mui/icons-material';\nimport { Stack, Box, CircularProgress, Typography, IconButton, Alert, Button, Slider, Snackbar, LinearProgress, useTheme } from '@mui/material';\nimport { alpha } from '@mui/material/styles';\nimport type { SubAgentDto } from '@aintela/chat/models';\nimport type { Layout, LayoutItem } from 'react-grid-layout';\nimport type { SvgIconComponent } from '@mui/icons-material';\n\nimport { GridCard } from '../grid/GridCard';\nimport { GridLayout } from '../grid/GridLayout';\nimport { DashboardParametersProvider } from '../hooks/DashboardParametersContext';\nimport { ChartCardDefaultsProvider } from '../data/ChartCardDefaultsContext';\nimport type { BiClient } from '../client';\nimport type { Dashboard, CardSpecificType } from './models';\nimport { CATEGORY_PREFIXES, resolveCardMetadata } from './cardMetadata';\nimport { useDashboardBundle, type DashboardWaitingOptions } from './useDashboardBundle';\n\nexport type { DashboardWaitingOptions };\n\nexport interface ScriptDashboardExportArgs {\n dashboard: Dashboard;\n /** Current filter values, as the cards see them. */\n parameters: Record<string, string | string[]>;\n datasetOverride?: string;\n}\n\nexport interface ScriptDashboardHeaderRenderArgs {\n name?: string;\n iconName?: string;\n /** Already-built filter elements ready to drop into the host's chrome. */\n filters: React.ReactNode | null;\n hasFilters: boolean;\n /** Trigger the host's PDF export (`onExportPdf`), or `undefined` when none was given. */\n onExportPdf?: () => void;\n /** Open the host's schedule UI (`onSchedule`), or `undefined`. */\n onSchedule?: () => void;\n /** Navigate to the host's editor (`onEdit`), or `undefined`. */\n onEdit?: () => void;\n exporting: boolean;\n readonly: boolean;\n canEdit: boolean;\n canSchedule: boolean;\n dashboard: Dashboard | null;\n /** The host's dataset control (`datasetOverrideControl` prop), `null` unless admin + parameterised. */\n datasetOverrideControl: React.ReactNode | null;\n}\n\nexport interface ScriptDashboardViewerProps {\n /** Defaults to the ambient `BiClientProvider`. */\n client?: BiClient;\n dashboardId?: string;\n parameters?: Record<string, string | string[]>;\n height?: number | string;\n dragLocked?: boolean;\n /** Provide the dashboard document directly instead of fetching it. */\n dashboard?: Dashboard;\n /** When true, layout items are resizable and `onLayoutCommit` receives user edits. */\n editable?: boolean;\n /** Render the classic title row + buttons + filters bar instead of the compact filters-only bar. */\n useClassicHeader?: boolean;\n onDashloadLoaded?: (dashboard: Dashboard) => void;\n onFiltersChanged?: (filters: Record<string, unknown>) => void;\n /** Replace the built-in header with a host-rendered bar. Receives the built filters + handlers. */\n headerRender?: (args: ScriptDashboardHeaderRenderArgs) => React.ReactNode;\n /** Show the \"waiting for generation\" overlay and poll the sub-agent. */\n dashboardWaiting?: DashboardWaitingOptions;\n /** Data-refresh tick → cards refetch with `noCache`. Does NOT re-instantiate the bundle. */\n llmRenderCount?: number;\n /** Bundle re-instantiation trigger — bump only on real code (re)generation. */\n codeGeneration?: number;\n /** Print / read-only preview (was the `?printPreview=true` URL flag). */\n isPrintPreview?: boolean;\n\n // ── Host callbacks (the legacy viewer called the PDF endpoint, the\n // scheduling service and the composer store itself; now the host does).\n /** Export the dashboard (e.g. call your PDF endpoint). The viewer tracks the `exporting` state around it. */\n onExportPdf?: (args: ScriptDashboardExportArgs) => Promise<void> | void;\n /** Open your scheduling UI. */\n onSchedule?: () => void;\n scheduleLabel?: string;\n /** Navigate to your editor. */\n onEdit?: () => void;\n /** User finished a resize / drag (never fired on prop syncs). */\n onLayoutCommit?: (layout: Layout, oldItem: LayoutItem, newItem: LayoutItem) => void;\n /** Admin-only runtime dataset override threaded into every data fetch. */\n datasetOverride?: string;\n /** Whether the viewer is shown to an admin (gates `datasetOverrideControl`). */\n isAdmin?: boolean;\n /** A ready-to-render dataset picker the host owns; shown when `isAdmin` and the dashboard is parameterised. */\n datasetOverrideControl?: React.ReactNode;\n /** Icon for a card's header, by its specific type. Default: no icon. */\n resolveCardIcon?: (specificType: CardSpecificType) => string | SvgIconComponent | undefined;\n /** Series palette for every chart in this dashboard (defaults to `theme.palette.bi.series`). */\n chartPalette?: readonly string[];\n /** Show the floating zoom slider (default true outside print preview). */\n showZoomControl?: boolean;\n}\n\nconst SubAgentWaitingOverlay: React.FC<{ subAgent: SubAgentDto | null }> = ({ subAgent }) => {\n const theme = useTheme();\n const todoList = subAgent?.todoList;\n const items = todoList?.items ?? [];\n const completedCount = items.filter((i) => i.status === 'Completed').length;\n const totalCount = items.length;\n\n const rawPercent = todoList?.percentComplete;\n const fraction = typeof rawPercent === 'number' && Number.isFinite(rawPercent) ? rawPercent : totalCount > 0 ? completedCount / totalCount : 0;\n const percent = Math.max(0, Math.min(100, fraction * 100));\n const hasProgress = totalCount > 0 || percent > 0;\n\n return (\n <Box\n sx={{\n position: 'relative',\n width: '100%',\n zIndex: 1500,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n gap: 2,\n px: 4,\n minHeight: '300px',\n backgroundColor: alpha(theme.palette.background.default, 0.85),\n backdropFilter: 'blur(2px)',\n }}\n >\n <Stack spacing={2} alignItems=\"center\" sx={{ width: '100%', maxWidth: 480 }}>\n <Typography variant=\"h6\" sx={{ color: 'text.primary', textAlign: 'center' }}>\n Aguardando a geração do dashboard\n </Typography>\n {subAgent?.name && (\n <Typography variant=\"body2\" sx={{ color: 'text.secondary', textAlign: 'center' }}>\n {subAgent.name}\n </Typography>\n )}\n <Box sx={{ width: '100%' }}>\n <LinearProgress variant={hasProgress ? 'determinate' : 'indeterminate'} value={hasProgress ? percent : undefined} sx={{ height: 10, borderRadius: 5 }} />\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ mt: 1 }}>\n <Typography variant=\"caption\" sx={{ color: 'text.secondary' }}>\n {totalCount > 0 ? `${completedCount} de ${totalCount} tarefas` : 'Inicializando...'}\n </Typography>\n <Typography variant=\"caption\" sx={{ color: 'text.primary', fontWeight: 600 }}>\n {`${percent.toFixed(1)}%`}\n </Typography>\n </Stack>\n </Box>\n </Stack>\n </Box>\n );\n};\n\n// Smooths the loading → dashboard hand-off: keeps both layers mounted while the\n// wrapper's inline height animates from the pre-content height to the\n// dashboard's, cross-fading the two.\ntype DashboardBodyPhase = 'pre' | 'arriving' | 'final';\nconst DASHBOARD_BODY_TRANSITION_MS = 520;\n\nconst DashboardBodyTransition: React.FC<{ showPre: boolean; preContent: React.ReactNode; finalContent: React.ReactNode }> = ({ showPre, preContent, finalContent }) => {\n const [phase, setPhase] = useState<DashboardBodyPhase>(() => (showPre ? 'pre' : 'final'));\n const wrapperRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n\n useLayoutEffect(() => {\n if (phase === 'pre' && !showPre) {\n const wrapper = wrapperRef.current;\n const H1 = wrapper?.offsetHeight ?? 0;\n if (wrapper && H1 > 0) wrapper.style.height = `${H1}px`;\n setPhase('arriving');\n } else if (phase !== 'pre' && showPre) {\n const wrapper = wrapperRef.current;\n if (wrapper) {\n wrapper.style.height = '';\n wrapper.style.transition = '';\n }\n setPhase('pre');\n }\n }, [phase, showPre]);\n\n useLayoutEffect(() => {\n if (phase !== 'arriving') return;\n const wrapper = wrapperRef.current;\n const content = contentRef.current;\n if (!wrapper || !content) return;\n const H2 = content.offsetHeight;\n void wrapper.offsetHeight;\n wrapper.style.transition = `height ${DASHBOARD_BODY_TRANSITION_MS}ms cubic-bezier(0.16, 1, 0.3, 1)`;\n wrapper.style.height = `${H2}px`;\n const t = window.setTimeout(() => {\n const w = wrapperRef.current;\n if (w) {\n w.style.height = '';\n w.style.transition = '';\n }\n setPhase('final');\n }, DASHBOARD_BODY_TRANSITION_MS + 40);\n return () => window.clearTimeout(t);\n }, [phase]);\n\n return (\n <Box\n ref={wrapperRef}\n sx={{\n position: 'relative',\n overflow: phase === 'final' ? 'auto' : 'hidden',\n width: '100%',\n flex: 1,\n minHeight: 0,\n '@keyframes dashboardArriveGrow': {\n '0%': { opacity: 0, transform: 'scale(0.97)' },\n '100%': { opacity: 1, transform: 'scale(1)' },\n },\n }}\n >\n {(phase === 'pre' || phase === 'arriving') && (\n <div\n key=\"pre-layer\"\n style={{\n position: phase === 'arriving' ? 'absolute' : 'relative',\n top: 0,\n left: 0,\n right: 0,\n opacity: phase === 'arriving' ? 0 : 1,\n transition: phase === 'arriving' ? 'opacity 360ms ease-out' : 'none',\n pointerEvents: phase === 'arriving' ? 'none' : 'auto',\n width: '100%',\n }}\n >\n {preContent}\n </div>\n )}\n {(phase === 'arriving' || phase === 'final') && (\n <Box\n key=\"content-layer\"\n ref={contentRef}\n sx={{\n width: '100%',\n animation: phase === 'arriving' ? `dashboardArriveGrow ${DASHBOARD_BODY_TRANSITION_MS}ms 60ms cubic-bezier(0.16, 1, 0.3, 1) both` : 'none',\n '@media (prefers-reduced-motion: reduce)': { animation: 'none' },\n }}\n >\n {finalContent}\n </Box>\n )}\n </Box>\n );\n};\n\nexport const ScriptDashboardViewer: React.FC<ScriptDashboardViewerProps> = (props) => {\n const useClassicHeader = props.useClassicHeader ?? false;\n const editable = props.editable ?? false;\n\n const bundle = useDashboardBundle({\n client: props.client,\n dashboardId: props.dashboardId,\n parameters: props.parameters,\n dashboard: props.dashboard,\n dashboardWaiting: props.dashboardWaiting,\n codeGeneration: props.codeGeneration,\n onDashloadLoaded: props.onDashloadLoaded,\n onFiltersChanged: props.onFiltersChanged,\n editable,\n isPrintPreview: props.isPrintPreview,\n });\n\n const {\n dashboard, cards, style, loading, error, setError, filters, filterOptions, stateParameters,\n containerRef, containerWidth, layoutDefinition, effectiveDashboardId, isPrintPreview,\n snackbar, setSnackbar, subAgentStatus, isSubAgentTracked, subAgentDone,\n } = bundle;\n\n const [exporting, setExporting] = useState(false);\n const [zoomLevel, setZoomLevel] = useState<number>(1.03);\n\n const isDashboardParameterized = dashboard?.isDatasetParameterized ?? false;\n const datasetOverrideControl = useMemo<React.ReactNode | null>(() => {\n if (isPrintPreview || !props.isAdmin || !isDashboardParameterized) return null;\n return props.datasetOverrideControl ?? null;\n }, [isPrintPreview, props.isAdmin, isDashboardParameterized, props.datasetOverrideControl]);\n\n const exportPdf = props.onExportPdf\n ? async () => {\n if (!dashboard) return;\n setExporting(true);\n try {\n await props.onExportPdf!({ dashboard, parameters: stateParameters, datasetOverride: props.datasetOverride });\n } catch (err) {\n setError(err instanceof Error ? err.message : 'PDF export failed');\n } finally {\n setExporting(false);\n }\n }\n : undefined;\n\n const canEdit = !!props.onEdit;\n const canSchedule = !!props.onSchedule && !filterOptions.readonly;\n\n const header = props.headerRender ? (\n props.headerRender({\n name: dashboard?.name,\n iconName: dashboard?.muiIconName,\n dashboard: dashboard ?? null,\n filters: filters ?? null,\n hasFilters: (dashboard?.filters?.length ?? 0) > 0,\n onExportPdf: exportPdf,\n onSchedule: props.onSchedule,\n onEdit: props.onEdit,\n exporting,\n readonly: !!filterOptions.readonly,\n canEdit,\n canSchedule,\n datasetOverrideControl,\n })\n ) : !useClassicHeader ? (\n (dashboard?.filters?.length ?? 0) > 0 ? (\n <Stack direction=\"row\" gap={2} sx={{ flexWrap: 'wrap', minWidth: '100%', px: 1.25, py: 1, justifyContent: 'flex-end', alignItems: 'flex-start' }}>\n {filters}\n </Stack>\n ) : null\n ) : (\n <>\n <Stack direction=\"row\" gap={0} sx={{ padding: '5px', marginLeft: '10px', display: 'inline-flex', color: 'text.secondary', alignItems: 'center', marginBottom: '10px', minWidth: '100%' }}>\n <Box sx={{ display: 'inline-flex', flexWrap: 'wrap', minWidth: '100%', alignItems: 'center' }}>\n <Box sx={{ display: 'inline-flex', width: '50%', alignItems: 'center', gap: 1 }}>\n <span className=\"material-icons\" style={{ maxWidth: '24px' }}>{dashboard?.muiIconName ?? 'dashboard'}</span>\n <Typography component=\"h2\" variant=\"h6\" sx={{ m: 0, color: 'text.primary' }}>{dashboard?.name ?? ''}</Typography>\n {datasetOverrideControl}\n </Box>\n <Stack direction=\"row\" gap={3} sx={{ width: '50%', display: 'inline-flex', pr: 2, justifyContent: 'right', alignItems: 'center' }}>\n {canEdit && (\n <Button onClick={props.onEdit} size=\"small\" disabled={exporting} variant=\"outlined\" sx={{ maxWidth: '200px', p: 1 }}>\n <Stack direction=\"row\" gap={0.5} alignItems=\"center\">\n <Typography variant=\"body2\">Edit</Typography>\n <RebaseEdit fontSize=\"small\" sx={{ ml: 1 }} />\n </Stack>\n </Button>\n )}\n {!filterOptions.readonly && (\n <>\n {canSchedule && (\n <Button onClick={props.onSchedule} size=\"small\" variant=\"outlined\" sx={{ maxHeight: '45px', maxWidth: '200px', p: 1 }}>\n <Stack direction=\"row\" gap={0.5} alignItems=\"center\" sx={{ maxHeight: '30px' }}>\n <Typography variant=\"body2\">{props.scheduleLabel ?? 'Agendar'}</Typography>\n <ScheduleIcon sx={{ ml: 1, fontSize: '16px' }} fontSize=\"small\" />\n </Stack>\n </Button>\n )}\n {exportPdf && (\n <Button onClick={exportPdf} size=\"small\" disabled={exporting} variant=\"outlined\" sx={{ maxHeight: '45px', maxWidth: '200px', p: 1 }}>\n <Stack direction=\"row\" gap={0.5} alignItems=\"center\" sx={{ maxHeight: '30px' }}>\n <Typography variant=\"body2\">{exporting ? 'Gerando PDF...' : 'Exportar PDF'}</Typography>\n {exporting ? <CircularProgress size={16} sx={{ ml: 1 }} /> : <ImportExportOutlined sx={{ ml: 1, fontSize: '16px' }} fontSize=\"small\" />}\n </Stack>\n </Button>\n )}\n </>\n )}\n </Stack>\n </Box>\n </Stack>\n\n {(dashboard?.filters?.length ?? 0) > 0 && (\n <Stack\n direction=\"row\"\n gap={2}\n sx={{\n flexWrap: 'wrap',\n width: '100%',\n paddingTop: filterOptions.readonly ? '10px' : '20px',\n paddingBottom: '10px',\n paddingRight: '10px',\n justifyContent: 'flex-end',\n alignItems: 'flex-start',\n backgroundColor: 'action.hover',\n }}\n >\n {filters}\n </Stack>\n )}\n </>\n );\n\n // User-driven boundaries only (RGL's resize-stop / drag-stop). A null\n // old/new item means RGL's internal sync, not a gesture — skip it.\n const commitUserLayoutEdit = (layout: Layout, oldItem: LayoutItem | null, newItem: LayoutItem | null): void => {\n if (!editable) return;\n if (!oldItem || !newItem) return;\n props.onLayoutCommit?.(layout, oldItem, newItem);\n };\n\n const cardsNode = useMemo(() => {\n if (!cards) return undefined;\n const cardViewType = dashboard?.layoutType ?? 'Boxed';\n return cards.map((card) => {\n const { title, specificType, category } = resolveCardMetadata(card, dashboard);\n return (\n <GridCard\n dragLocked={props.dragLocked ?? false}\n viewType={cardViewType}\n key={card.key}\n zoomLevel={1}\n header={{ title: title ?? '', icon: specificType ? props.resolveCardIcon?.(specificType) : undefined }}\n color={CATEGORY_PREFIXES[category ?? 'Generic']}\n >\n {card.element}\n </GridCard>\n );\n });\n }, [cards, dashboard, props.dragLocked, props.resolveCardIcon]);\n\n if (!dashboard && effectiveDashboardId) {\n return (\n <Box sx={{ display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', width: '100%', gap: 2 }}>\n <CircularProgress />\n <Typography color=\"text.secondary\">Loading dashboard...</Typography>\n </Box>\n );\n }\n if (!dashboard) return null;\n\n const showZoom = (props.showZoomControl ?? true) && !isPrintPreview;\n\n return (\n <ChartCardDefaultsProvider palette={props.chartPalette} rotateBasePerChart>\n <DashboardParametersProvider\n values={{\n dashboardId: dashboard.id ?? effectiveDashboardId ?? '',\n parameters: stateParameters,\n refreshTick: props.llmRenderCount ?? 0,\n datasetOverride: props.datasetOverride,\n }}\n >\n <Stack\n ref={(ref) => {\n containerRef.current = !containerRef.current && ref ? ref : containerRef.current;\n }}\n className=\"bi-dashboard-viewer\"\n sx={{\n height: isPrintPreview ? '100vh' : props.height ?? '100%',\n minHeight: '300px',\n display: 'inline-flex',\n backgroundColor: 'background.default',\n color: 'text.primary',\n overflow: 'hidden',\n width: '100%',\n maxWidth: isPrintPreview ? '1000px' : '100%',\n '& .grid-card::after': { borderRight: 'none', borderBottom: 'none' },\n '& .cardDragHandle': { display: 'none' },\n }}\n >\n <div style={{ position: 'relative', padding: 0, width: '100%', left: -3, height: '100%', maxHeight: '100%', display: 'flex', flexDirection: 'column', alignItems: 'flex-start' }}>\n {showZoom && (\n <Box\n sx={{\n position: 'absolute',\n left: '8px',\n bottom: '50px',\n zIndex: 1000,\n display: 'inline-flex',\n alignItems: 'center',\n gap: 1,\n px: 1.25,\n py: 0.75,\n borderRadius: 999,\n backgroundColor: 'background.paper',\n border: '1px solid',\n borderColor: 'divider',\n boxShadow: 4,\n minWidth: 180,\n }}\n >\n <Typography variant=\"caption\" sx={{ color: 'text.secondary', textTransform: 'uppercase', letterSpacing: 0.6, fontWeight: 500 }}>\n Zoom\n </Typography>\n <Slider\n value={zoomLevel}\n onChange={(_event, value) => setZoomLevel(value as number)}\n min={0.3}\n max={2}\n step={0.01}\n sx={{ flex: 1, minWidth: 80, color: 'primary.main', height: 3, py: '12px !important', '& .MuiSlider-thumb': { width: 12, height: 12, boxShadow: 'none' }, '& .MuiSlider-rail': { opacity: 0.25 } }}\n />\n <Typography variant=\"caption\" sx={{ color: 'text.primary', fontFamily: 'monospace', minWidth: 32, textAlign: 'right', fontVariantNumeric: 'tabular-nums' }}>\n {Math.round(zoomLevel * 100)}%\n </Typography>\n </Box>\n )}\n\n {header && (\n <Stack direction=\"row\" gap={0} sx={{ display: 'inline-flex', minWidth: '100%', flexWrap: 'wrap', alignItems: 'flex-start', mt: 1, flexShrink: 0 }}>\n {header}\n </Stack>\n )}\n\n {error && (\n <Box sx={{ p: 1, position: 'relative', width: '100%' }}>\n <IconButton size=\"small\" onClick={() => setError(null)} sx={{ position: 'absolute', right: 10, top: 10 }}>\n <CloseOutlined fontSize=\"small\" />\n </IconButton>\n <Alert severity=\"error\">\n <Typography variant=\"subtitle1\" fontWeight=\"bold\">Dashboard load failed</Typography>\n <Typography variant=\"body2\">{error}</Typography>\n </Alert>\n </Box>\n )}\n\n <DashboardBodyTransition\n showPre={(isSubAgentTracked && !subAgentDone) || loading || containerWidth === 0 || !layoutDefinition || !cardsNode}\n preContent={\n isSubAgentTracked && !subAgentDone ? (\n <SubAgentWaitingOverlay subAgent={subAgentStatus} />\n ) : loading ? (\n <Box sx={{ display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', minHeight: 300, width: '100%', gap: 2 }}>\n <CircularProgress />\n <Typography color=\"text.secondary\">Loading dashboard...</Typography>\n </Box>\n ) : null\n }\n finalContent={\n <div id=\"renderedDashboard\" style={{ paddingTop: 2, alignContent: 'center', minHeight: '100vh', overflow: 'auto', width: '100%' }}>\n <GridLayout\n rowAwareResize={{ defaultOn: true }}\n config={{ rows: [] }}\n cols={{ lg: 10, md: 8, sm: 4, xs: 4, xxs: 4 }}\n breakpoints={{ lg: 920, md: 600, sm: 400, xs: 400, xxs: 0 }}\n zoomLevel={zoomLevel}\n responsive={false}\n rowHeight={isPrintPreview ? 18 : 20}\n dragLocked={props.dragLocked ?? false}\n rowMultiplier={1}\n maxRows={200}\n onResizeStop={commitUserLayoutEdit}\n onDragStop={commitUserLayoutEdit}\n manualWidth={containerWidth}\n layouts={layoutDefinition}\n >\n {cardsNode}\n </GridLayout>\n {style}\n </div>\n }\n />\n </div>\n\n <Snackbar open={snackbar.open} autoHideDuration={4000} onClose={() => setSnackbar((prev) => ({ ...prev, open: false }))} anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }}>\n <Alert onClose={() => setSnackbar((prev) => ({ ...prev, open: false }))} severity={snackbar.severity} variant=\"filled\">\n {snackbar.message}\n </Alert>\n </Snackbar>\n </Stack>\n </DashboardParametersProvider>\n </ChartCardDefaultsProvider>\n );\n};\n\nexport default ScriptDashboardViewer;\n","// Vertical dashboard viewer: stacks cards in a portrait column instead of a\n// grid (a collapsed side panel). Data loading is shared via useDashboardBundle;\n// this file owns only the layout (no header, no zoom pill).\nimport React, { useMemo } from 'react';\nimport { CloseOutlined } from '@mui/icons-material';\nimport type { SvgIconComponent } from '@mui/icons-material';\nimport { Stack, Box, CircularProgress, Typography, IconButton, Alert, Snackbar } from '@mui/material';\nimport { GridCard } from '../grid/GridCard';\nimport { DashboardParametersProvider } from '../hooks/DashboardParametersContext';\nimport type { BiClient } from '../client';\nimport type { Dashboard, CardSpecificType } from './models';\nimport { resolveCardMetadata } from './cardMetadata';\nimport { useDashboardBundle, type DashboardWaitingOptions } from './useDashboardBundle';\n\nexport interface ScriptDashboardViewerVerticalProps {\n client?: BiClient;\n dashboardId?: string;\n parameters?: Record<string, string | string[]>;\n height?: number | string;\n dashboard?: Dashboard;\n onDashloadLoaded?: (dashboard: Dashboard) => void;\n onFiltersChanged?: (filters: Record<string, unknown>) => void;\n dashboardWaiting?: DashboardWaitingOptions;\n /** Data-refresh tick → `refreshTick` (cards refetch). Does NOT re-instantiate the bundle. */\n llmRenderCount?: number;\n /** Bundle re-instantiation trigger — bump only on real code (re)generation. */\n codeGeneration?: number;\n isPrintPreview?: boolean;\n datasetOverride?: string;\n resolveCardIcon?: (specificType: CardSpecificType) => string | SvgIconComponent | undefined;\n}\n\nexport const ScriptDashboardViewerVertical: React.FC<ScriptDashboardViewerVerticalProps> = (props) => {\n const bundle = useDashboardBundle({\n client: props.client,\n dashboardId: props.dashboardId,\n parameters: props.parameters,\n dashboard: props.dashboard,\n dashboardWaiting: props.dashboardWaiting,\n codeGeneration: props.codeGeneration,\n onDashloadLoaded: props.onDashloadLoaded,\n onFiltersChanged: props.onFiltersChanged,\n isPrintPreview: props.isPrintPreview,\n });\n\n const { dashboard, cards, loading, error, setError, stateParameters, containerRef, containerWidth, layoutDefinition, effectiveDashboardId, isPrintPreview, snackbar, setSnackbar } = bundle;\n\n // Fixed-height cards (160px metric/gauge, 250px otherwise), slightly zoomed\n // to fit the narrow column, hairline divider when the layout is `Naked`.\n const cardsNode = useMemo(() => {\n if (!cards) return undefined;\n const cardViewType = dashboard?.layoutType ?? 'Boxed';\n return cards.map((card) => {\n const { title, specificType } = resolveCardMetadata(card, dashboard);\n const isMetric = specificType === 'MetricComparison' || specificType === 'Gauge' || specificType == undefined;\n return (\n <Box\n key={card.key}\n sx={{\n height: isMetric ? '160px' : '250px',\n maxWidth: '100%',\n mx: 0.5,\n borderBottom: dashboard?.layoutType === 'Naked' ? '1px solid' : 'unset',\n borderColor: 'divider',\n }}\n >\n <GridCard dragLocked noBorder viewType={cardViewType} zoomLevel={isMetric ? 0.9 : 0.7} header={{ title: title ?? '', icon: specificType ? props.resolveCardIcon?.(specificType) : undefined }}>\n {card.element}\n </GridCard>\n </Box>\n );\n });\n }, [cards, dashboard, props.resolveCardIcon]);\n\n if (!dashboard && effectiveDashboardId) {\n return (\n <Box sx={{ display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', width: '100%', gap: 2 }}>\n <CircularProgress />\n <Typography color=\"text.secondary\">Loading dashboard...</Typography>\n </Box>\n );\n }\n if (!dashboard) return null;\n\n return (\n <Stack\n ref={(ref) => {\n containerRef.current = !containerRef.current && ref ? ref : containerRef.current;\n }}\n className=\"bi-dashboard-viewer-vertical\"\n sx={{\n height: isPrintPreview ? '100vh' : props.height ?? 'unset',\n display: 'inline-flex',\n backgroundColor: 'background.default',\n color: 'text.primary',\n minHeight: '300px',\n overflow: 'auto',\n width: '100%',\n maxWidth: isPrintPreview ? '1000px' : '100%',\n '& .grid-card::after': { borderRight: 'none', borderBottom: 'none' },\n '& .cardDragHandle': { display: 'none' },\n }}\n >\n <div style={{ position: 'relative', width: '100%', height: '100%', maxHeight: '100%', display: 'flex', flexDirection: 'column', alignItems: 'flex-start' }}>\n {loading && (\n <Box sx={{ display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', width: '100%', gap: 2 }}>\n <CircularProgress />\n <Typography color=\"text.secondary\">Loading dashboard...</Typography>\n </Box>\n )}\n\n {error && (\n <Box sx={{ p: 1, position: 'relative', width: '100%' }}>\n <IconButton size=\"small\" onClick={() => setError(null)} sx={{ position: 'absolute', right: 10, top: 10 }}>\n <CloseOutlined fontSize=\"small\" />\n </IconButton>\n <Alert severity=\"error\">\n <Typography variant=\"subtitle1\" fontWeight=\"bold\">Dashboard load failed</Typography>\n <Typography variant=\"body2\">{error}</Typography>\n </Alert>\n </Box>\n )}\n\n {!loading && containerWidth !== 0 && layoutDefinition && cardsNode && (\n <DashboardParametersProvider\n values={{\n dashboardId: dashboard.id ?? effectiveDashboardId ?? '',\n parameters: stateParameters ?? {},\n refreshTick: props.llmRenderCount ?? 0,\n datasetOverride: props.datasetOverride,\n }}\n >\n <Stack sx={{ width: '100%' }} gap={1}>\n {cardsNode}\n </Stack>\n </DashboardParametersProvider>\n )}\n <Box sx={{ minHeight: '70px', minWidth: '100%' }} />\n </div>\n\n <Snackbar open={snackbar.open} autoHideDuration={4000} onClose={() => setSnackbar((prev) => ({ ...prev, open: false }))} anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }}>\n <Alert onClose={() => setSnackbar((prev) => ({ ...prev, open: false }))} severity={snackbar.severity} variant=\"filled\">\n {snackbar.message}\n </Alert>\n </Snackbar>\n </Stack>\n );\n};\n\nexport default ScriptDashboardViewerVertical;\n"],"names":["CATEGORY_PREFIXES","resolveCardMetadata","card","dashboard","related","_a","i","title","specificType","category","__name","registeredSpecifiers","extraHostModules","hostModulesCache","seedHostModules","specifiers","extra","s","getRegisteredSpecifiers","getHostModules","MuiMaterial","MuiIconsMaterial","Recharts","getBiModuleSurface","surface","map","React","jsxRuntime","ReactDOM","ReactDOMClient","MuiMaterialStyles","EmotionReact","EmotionStyled","dayjs","spec","MAX_CACHED_BUNDLES","compiledBundleCache","hashBundleCode","code","h","clearBundleCaches","evaluateDashboardBundle","cacheKey","HOST_MODULES","hash","cached","moduleShim","requireShim","name","mod","key","hostMod","exported","moduleExport","oldestKey","loadDashboardBundle","client","sessionId","dashboardId","instantiateDashboardBundle","scriptFileName","DashboardClass","instance","useDashboardBundle","options","ambientClient","useBiClientOptional","resolvedClient","localDashboard","setLocalDashboard","useState","onDashLoadedRef","useRef","onFiltersChangedRef","cards","setCards","style","setStyle","loading","setLoading","error","setError","isPrintPreview","stateParameters","setStateParameters","handleParameterChange","useCallback","value","prev","_removed","rest","next","optionsParametersKey","reportParameters","useMemo","filterOptions","useEffect","effectiveDashboardId","containerRef","containerWidth","useContainerRectangle","snackbar","setSnackbar","subAgentStatus","setSubAgentStatus","waitingSubAgentId","isSubAgentTracked","subAgentDone","isSubAgentTerminalStatus","subAgentFailed","pollSessionId","_b","pollIntervalMs","_c","intervalMs","cancelled","timeoutHandle","poll","status","err","loadMetadata","dash","codeGeneration","dashboardIdField","dashboardJsFileName","dashboardSessionId","loadBundle","scriptName","result","filters","f","createFilterComponent","editable","rawLayoutDefinition","layoutDefinition","item","SubAgentWaitingOverlay","subAgent","theme","useTheme","todoList","items","completedCount","totalCount","rawPercent","fraction","percent","hasProgress","jsx","Box","alpha","jsxs","Stack","Typography","LinearProgress","DASHBOARD_BODY_TRANSITION_MS","DashboardBodyTransition","showPre","preContent","finalContent","phase","setPhase","wrapperRef","contentRef","useLayoutEffect","wrapper","H1","content","H2","t","w","ScriptDashboardViewer","props","useClassicHeader","bundle","exporting","setExporting","zoomLevel","setZoomLevel","isDashboardParameterized","datasetOverrideControl","exportPdf","canEdit","canSchedule","header","Fragment","Button","RebaseEdit","ScheduleIcon","CircularProgress","ImportExportOutlined","commitUserLayoutEdit","layout","oldItem","newItem","cardsNode","cardViewType","GridCard","showZoom","ChartCardDefaultsProvider","DashboardParametersProvider","ref","Slider","_event","IconButton","CloseOutlined","Alert","GridLayout","Snackbar","ScriptDashboardViewerVertical","isMetric"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAKO,MAAMA,KAAyD;AAAA,EAClE,SAAS;AAAA,EACT,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,SAAS;AACb;AAOO,SAASC,GACZC,GACAC,GAC6G;;AAC7G,QAAMC,MAAUC,IAAAF,KAAA,gBAAAA,EAAW,UAAX,gBAAAE,EAAkB,KAAK,CAACC,MAAMA,EAAE,MAAMJ,EAAK,SAAQ,MAC7DK,KAAQH,KAAA,gBAAAA,EAAS,UAASF,EAAK,QAAQE,KAAA,gBAAAA,EAAS,OAAOF,EAAK,OAC5DM,KAAgBJ,KAAA,gBAAAA,EAAS,kBAAiBF,EAAK,eAAeE,KAAA,gBAAAA,EAAS,eAAeF,EAAK,cAC3FO,KAAYL,KAAA,gBAAAA,EAAS,cAAaF,EAAK,WAAWE,KAAA,gBAAAA,EAAS,WAAWF,EAAK;AACjF,SAAO,EAAE,OAAAK,GAAO,cAAAC,GAAc,UAAAC,EAAA;AAClC;AATgBC,EAAAT,IAAA;ACUhB,MAAMU,yBAA2B,IAAA;AACjC,IAAIC,KAA4C,CAAA,GAC5CC,KAAmD;AAGhD,SAASC,GAAgBC,GAAsBC,GAAuC;AACzF,aAAWC,KAAKF,EAAY,CAAAJ,GAAqB,IAAIM,CAAC;AACtD,EAAID,MAAOJ,KAAmB,EAAE,GAAGA,IAAkB,GAAGI,EAAA,IACxDH,KAAmB;AACvB;AAJgBH,EAAAI,IAAA;AAOT,SAASI,KAAoC;AAChD,SAAO,CAAC,GAAGP,EAAoB;AACnC;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B6D,KACrD,gBAAA/C;AAAA,YAACoD;AAAA,YAAA;AAAA,cACG,QAAQ;AAAA,gBACJ,aAAarM,EAAU,MAAM8F,KAAwB;AAAA,gBACrD,YAAYd,KAAmB,CAAA;AAAA,gBAC/B,aAAayF,EAAM,kBAAkB;AAAA,gBACrC,iBAAiBA,EAAM;AAAA,cAAA;AAAA,cAG3B,UAAA,gBAAAxB,EAACI,KAAM,IAAI,EAAE,OAAO,OAAA,GAAU,KAAK,GAC9B,UAAA2C,EAAA,CACL;AAAA,YAAA;AAAA,UAAA;AAAA,UAGR,gBAAA/C,EAACC,KAAI,IAAI,EAAE,WAAW,QAAQ,UAAU,SAAO,CAAG;AAAA,QAAA,GACtD;AAAA,QAEA,gBAAAD,EAAC4D,MAAS,MAAM3G,EAAS,MAAM,kBAAkB,KAAM,SAAS,gBAAA3F,EAAA,MAAM4F,EAAY,CAACd,OAAU,EAAE,GAAGA,GAAM,MAAM,KAAQ,GAAtD,YAAyD,cAAc,EAAE,UAAU,UAAU,YAAY,SAAA,GACrK,4BAACsH,IAAA,EAAM,SAAS,gBAAApM,EAAA,MAAM4F,EAAY,CAACd,OAAU,EAAE,GAAGA,GAAM,MAAM,GAAA,EAAQ,GAAtD,YAAyD,UAAUa,EAAS,UAAU,SAAQ,UACzG,UAAAA,EAAS,QAAA,CACd,EAAA,CACJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,IA9De;AAiE3B,GAnH2F;"}
@@ -1,15 +1,15 @@
1
1
  var i = Object.defineProperty;
2
2
  var o = (m, t) => i(m, "name", { value: t, configurable: !0 });
3
- import { D as a } from "./index-DOpx0R4Y.js";
4
- import { b as e } from "./index-BYc79sSy.js";
5
- import { p as s } from "./index-DeiweWw8.js";
3
+ import { D as a } from "./index-Dy6hwDjs.js";
4
+ import { b as e } from "./index-ZBNoVc5M.js";
5
+ import { p as s } from "./index-9LcZjCK0.js";
6
6
  import { G as f } from "./index-BzUugG0A.js";
7
7
  import { H as p } from "./index-D3OoOPjl.js";
8
8
  import { F as n } from "./index-BRx4bRbe.js";
9
- import { T as l } from "./index-D7Oo_dC-.js";
9
+ import { T as l } from "./index-zN3LPF6u.js";
10
10
  import { C as u } from "./index-CZbCaXMC.js";
11
- import { V as c } from "./index-K50t61iI.js";
12
- import { aA as d } from "./index-DULVx84u.js";
11
+ import { V as c } from "./index-CfKuT0vQ.js";
12
+ import { aG as d } from "./index-DOfnLVhs.js";
13
13
  let r = null;
14
14
  function w() {
15
15
  return r || (r = {
@@ -31,4 +31,4 @@ o(w, "getBiModuleSurface");
31
31
  export {
32
32
  w as getBiModuleSurface
33
33
  };
34
- //# sourceMappingURL=biModuleSurface--gLAiZ9Z.js.map
34
+ //# sourceMappingURL=biModuleSurface-BYtgLreK.js.map