@oicl/openbridge-webcomponents 2.0.0-next.96 → 2.0.0-next.98
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.
- package/bundle/openbridge-webcomponents.bundle.js +39 -124
- package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
- package/custom-elements.json +343 -142
- package/dist/ar/poi/poi.d.ts +4 -2
- package/dist/ar/poi/poi.d.ts.map +1 -1
- package/dist/ar/poi/poi.js.map +1 -1
- package/dist/ar/poi-layer/poi-layer.d.ts +1 -0
- package/dist/ar/poi-layer/poi-layer.d.ts.map +1 -1
- package/dist/ar/poi-layer/poi-layer.js.map +1 -1
- package/dist/ar/poi-object/poi-object-aton.d.ts +1 -0
- package/dist/ar/poi-object/poi-object-aton.d.ts.map +1 -1
- package/dist/ar/poi-object/poi-object-aton.js.map +1 -1
- package/dist/automation/automation-badge/automation-badge.d.ts +2 -0
- package/dist/automation/automation-badge/automation-badge.d.ts.map +1 -1
- package/dist/automation/automation-badge/automation-badge.js.map +1 -1
- package/dist/automation/automation-button/automation-button.d.ts +9 -0
- package/dist/automation/automation-button/automation-button.d.ts.map +1 -1
- package/dist/automation/automation-button/automation-button.js.map +1 -1
- package/dist/automation/automation-input-modal/automation-input-modal.d.ts +4 -0
- package/dist/automation/automation-input-modal/automation-input-modal.d.ts.map +1 -1
- package/dist/automation/automation-input-modal/automation-input-modal.js.map +1 -1
- package/dist/automation/automation-tank/automation-tank.css.js +8 -87
- package/dist/automation/automation-tank/automation-tank.css.js.map +1 -1
- package/dist/automation/automation-tank/automation-tank.d.ts +13 -33
- package/dist/automation/automation-tank/automation-tank.d.ts.map +1 -1
- package/dist/automation/automation-tank/automation-tank.js +12 -28
- package/dist/automation/automation-tank/automation-tank.js.map +1 -1
- package/dist/building-blocks/alert-list/alert-list.d.ts +4 -0
- package/dist/building-blocks/alert-list/alert-list.d.ts.map +1 -1
- package/dist/building-blocks/alert-list/alert-list.js.map +1 -1
- package/dist/building-blocks/bar-horizontal/bar-horizontal.d.ts +2 -0
- package/dist/building-blocks/bar-horizontal/bar-horizontal.d.ts.map +1 -1
- package/dist/building-blocks/bar-horizontal/bar-horizontal.js.map +1 -1
- package/dist/building-blocks/bar-vertical/bar-vertical.d.ts +2 -0
- package/dist/building-blocks/bar-vertical/bar-vertical.d.ts.map +1 -1
- package/dist/building-blocks/bar-vertical/bar-vertical.js.map +1 -1
- package/dist/components/advice-floating-item/advice-floating-item.d.ts +2 -4
- package/dist/components/advice-floating-item/advice-floating-item.d.ts.map +1 -1
- package/dist/components/advice-floating-item/advice-floating-item.js.map +1 -1
- package/dist/components/advice-message-item/advice-message-item.d.ts +6 -19
- package/dist/components/advice-message-item/advice-message-item.d.ts.map +1 -1
- package/dist/components/advice-message-item/advice-message-item.js.map +1 -1
- package/dist/components/alert-floating-item/alert-floating-item.d.ts +12 -0
- package/dist/components/alert-floating-item/alert-floating-item.d.ts.map +1 -1
- package/dist/components/alert-floating-item/alert-floating-item.js.map +1 -1
- package/dist/components/alert-menu/alert-menu.d.ts +6 -20
- package/dist/components/alert-menu/alert-menu.d.ts.map +1 -1
- package/dist/components/alert-menu/alert-menu.js.map +1 -1
- package/dist/components/alert-menu-item/alert-menu-item.d.ts +4 -0
- package/dist/components/alert-menu-item/alert-menu-item.d.ts.map +1 -1
- package/dist/components/alert-menu-item/alert-menu-item.js.map +1 -1
- package/dist/components/chat-message/chat-message.d.ts +3 -0
- package/dist/components/chat-message/chat-message.d.ts.map +1 -1
- package/dist/components/chat-message/chat-message.js.map +1 -1
- package/dist/components/elevated-card-radio/elevated-card-radio.d.ts +2 -6
- package/dist/components/elevated-card-radio/elevated-card-radio.d.ts.map +1 -1
- package/dist/components/elevated-card-radio/elevated-card-radio.js.map +1 -1
- package/dist/components/keyboard-numeric/keyboard-numeric.d.ts +6 -0
- package/dist/components/keyboard-numeric/keyboard-numeric.d.ts.map +1 -1
- package/dist/components/keyboard-numeric/keyboard-numeric.js.map +1 -1
- package/dist/components/notification-floating-item/notification-floating-item.d.ts +2 -4
- package/dist/components/notification-floating-item/notification-floating-item.d.ts.map +1 -1
- package/dist/components/notification-floating-item/notification-floating-item.js.map +1 -1
- package/dist/components/sequence-card/sequence-card.d.ts +9 -0
- package/dist/components/sequence-card/sequence-card.d.ts.map +1 -1
- package/dist/components/sequence-card/sequence-card.js.map +1 -1
- package/dist/components/sequence-item/sequence-item.d.ts +5 -0
- package/dist/components/sequence-item/sequence-item.d.ts.map +1 -1
- package/dist/components/sequence-item/sequence-item.js.map +1 -1
- package/dist/components/sequence-modal/sequence-modal.d.ts +4 -0
- package/dist/components/sequence-modal/sequence-modal.d.ts.map +1 -1
- package/dist/components/sequence-modal/sequence-modal.js.map +1 -1
- package/dist/components/sequence-step/sequence-step.d.ts.map +1 -1
- package/dist/components/sequence-step/sequence-step.js.map +1 -1
- package/dist/components/slider-double/slider-double.d.ts +4 -8
- package/dist/components/slider-double/slider-double.d.ts.map +1 -1
- package/dist/components/slider-double/slider-double.js.map +1 -1
- package/dist/components/status-indicator/status-indicator.d.ts +1 -0
- package/dist/components/status-indicator/status-indicator.d.ts.map +1 -1
- package/dist/components/status-indicator/status-indicator.js.map +1 -1
- package/dist/components/system-menu/system-menu.d.ts +2 -0
- package/dist/components/system-menu/system-menu.d.ts.map +1 -1
- package/dist/components/system-menu/system-menu.js.map +1 -1
- package/dist/components/table-header-item/table-header-item.d.ts +2 -0
- package/dist/components/table-header-item/table-header-item.d.ts.map +1 -1
- package/dist/components/table-header-item/table-header-item.js.map +1 -1
- package/dist/components/tag/tag.d.ts +1 -0
- package/dist/components/tag/tag.d.ts.map +1 -1
- package/dist/components/tag/tag.js.map +1 -1
- package/dist/components/toggletip/toggletip.d.ts +4 -4
- package/dist/components/toggletip/toggletip.js.map +1 -1
- package/dist/components/user-menu/user-menu.d.ts +1 -0
- package/dist/components/user-menu/user-menu.d.ts.map +1 -1
- package/dist/components/user-menu/user-menu.js.map +1 -1
- package/dist/integration-systems/integration-app-bar/integration-app-bar.d.ts +1 -0
- package/dist/integration-systems/integration-app-bar/integration-app-bar.d.ts.map +1 -1
- package/dist/integration-systems/integration-app-bar/integration-app-bar.js.map +1 -1
- package/dist/integration-systems/integration-bar/integration-bar.d.ts +0 -1
- package/dist/integration-systems/integration-bar/integration-bar.d.ts.map +1 -1
- package/dist/integration-systems/integration-bar/integration-bar.js.map +1 -1
- package/dist/integration-systems/integration-bar-dropdown/integration-bar-dropdown.d.ts +9 -9
- package/dist/integration-systems/integration-bar-dropdown/integration-bar-dropdown.js.map +1 -1
- package/dist/integration-systems/integration-fleet-button/integration-fleet-button.d.ts +1 -0
- package/dist/integration-systems/integration-fleet-button/integration-fleet-button.d.ts.map +1 -1
- package/dist/integration-systems/integration-fleet-button/integration-fleet-button.js.map +1 -1
- package/dist/integration-systems/integration-tabs/integration-tabs.d.ts +1 -0
- package/dist/integration-systems/integration-tabs/integration-tabs.d.ts.map +1 -1
- package/dist/integration-systems/integration-tabs/integration-tabs.js.map +1 -1
- package/dist/navigation-instruments/compass-sector/compass-sector.d.ts +0 -1
- package/dist/navigation-instruments/compass-sector/compass-sector.d.ts.map +1 -1
- package/dist/navigation-instruments/compass-sector/compass-sector.js.map +1 -1
- package/dist/navigation-instruments/watch/tickmark.d.ts.map +1 -1
- package/dist/navigation-instruments/watch/tickmark.js +17 -7
- package/dist/navigation-instruments/watch/tickmark.js.map +1 -1
- package/dist/navigation-instruments/watch/watch.d.ts.map +1 -1
- package/dist/navigation-instruments/watch/watch.js +2 -2
- package/dist/navigation-instruments/watch/watch.js.map +1 -1
- package/dist/navigation-instruments/wind-propulsion/wind-propulsion.d.ts +0 -1
- package/dist/navigation-instruments/wind-propulsion/wind-propulsion.d.ts.map +1 -1
- package/dist/navigation-instruments/wind-propulsion/wind-propulsion.js.map +1 -1
- package/dist/pages/alert-detail-page/alert-detail-page.d.ts.map +1 -1
- package/dist/pages/alert-detail-page/alert-detail-page.js.map +1 -1
- package/package.json +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"automation-tank.js","sources":["../../../src/automation/automation-tank/automation-tank.ts"],"sourcesContent":["import {\n HTMLTemplateResult,\n LitElement,\n html,\n nothing,\n svg,\n unsafeCSS,\n} from 'lit';\nimport {property, state} from 'lit/decorators.js';\nimport compentStyle from './automation-tank.css?inline';\nimport {LineMedium} from '../index.js';\nimport '../automation-badge/automation-badge.js';\nimport {ObcAutomationBadgeType} from '../automation-badge/automation-badge.js';\nimport {\n AutomationButtonBadgeAlert,\n AutomationButtonBadgeCommandLocked,\n AutomationButtonBadgeControl,\n AutomationButtonBadgeInterlock,\n} from '../automation-button/abstract-automation-button.js';\n\nimport '../../icons/icon-chevron-double-up-google.js';\nimport '../../icons/icon-chevron-up-google.js';\nimport '../../icons/icon-chevron-double-down-google.js';\nimport '../../icons/icon-chevron-down-google.js';\nimport '../../icons/icon-off.js';\nimport '../../icons/icon-tank.js';\nimport '../../icons/icon-energy-battery.js';\nimport '../../navigation-instruments/gauge-trend/gauge-trend.js';\nimport '../../building-blocks/bar-vertical/bar-vertical.js';\nimport '../../components/alert-frame/alert-frame.js';\nimport {Priority} from '../../navigation-instruments/types.js';\nimport {\n ObcAlertFrameThickness,\n ObcAlertFrameType,\n} from '../../components/alert-frame/alert-frame.js';\nimport {AlertType} from '../../types.js';\nimport type {ChartLineDataItem} from '../../building-blocks/chart-line/chart-line-base.js';\nimport type {LinearAdvice} from '../../building-blocks/instrument-linear/advice.js';\nimport {\n AdvicePosition,\n ExternalScaleSide,\n FillMode,\n} from '../../building-blocks/external-scale/external-scale.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {customElement} from '../../decorator.js';\n\nexport enum TankTrend {\n fastRising = 'fast-rising',\n rising = 'rising',\n stable = 'stable',\n falling = 'falling',\n fastFalling = 'fast-falling',\n closed = 'closed',\n}\n\nexport enum TankType {\n generic = 'generic',\n atmospheric = 'atmospheric',\n pressurized = 'pressurized',\n battery = 'battery',\n}\n\nexport enum TankOrientation {\n vertical = 'vertical',\n horizontal = 'horizontal',\n}\n\n/**\n * Host positioning model.\n *\n * - `point`: the host has fixed default dimensions (per\n * orientation and compact / static variant) and a P&ID anchor — the\n * visual content is shifted with `translateX(-50%)` and (in non-compact)\n * `top: -20px` so the tank's top-center aligns with the host's top-left\n * placement coordinate. Use this when dropping the tank onto a P&ID\n * canvas at a pipe-grid coordinate.\n * - `button` (default): the host fills its parent container (100% × 100%) with no\n * anchor offset. Use this when embedding the tank inside a sized layout\n * slot — the parent controls the footprint and the tank renders\n * responsively inside it, just like a regular button. Compact / static\n * inner layout still applies; only the host box is changed.\n */\nexport enum TankPositioning {\n point = 'point',\n button = 'button',\n}\n\nexport enum TankChartMode {\n /** Static fill bar driven by `value` / `max` (default, backward compatible). */\n bar = 'bar',\n /** Embedded `obc-gauge-trend` line/area chart, no side bar. */\n graph = 'graph',\n /** Embedded `obc-gauge-trend` line/area chart with a side bar. */\n graphAndBar = 'graph-and-bar',\n}\n\n/**\n * A single detail row rendered in the tank's `readout` rich list (below the\n * main percent / value block, separated by a divider). Each row is rendered\n * as `<label>` on the left and `<value><degree?><percent?><unit>` on the\n * right, all on a single line.\n */\nexport interface TankReadoutItem {\n /** Left-aligned label text (e.g. `Temperature`). */\n label: string;\n /** Numeric value, formatted with the tank's `percentFractionDigits`. */\n value: number;\n /** Append a `°` glyph directly after the value with no gap. */\n hasDegree?: boolean;\n /** Append a `%` glyph directly after the value with no gap. */\n hasPercentage?: boolean;\n /** Unit text (e.g. `C`, `Pa`, `m/s`). Rendered after the value/glyph. */\n unit: string;\n}\n\n/**\n *\n *\n * @slot badges - Custom badges to be displayed in the badge area.\n * @slot tag - Text or element for the tank's tag/label.\n * @slot readout - Replaces the entire readout content block.\n * @slot max-value - Content for the capacity value.\n * @slot unit - Content for the unit of measurement.\n * @slot current-value - Content for the current level value.\n * @slot rich - Content for additional detail rows.\n * @slot alert-icon - Custom icon for the alert frame.\n * @slot alert-label - Label for the alert frame.\n * @slot alert-timer - Timer for the alert frame.\n * @beta\n */\n@customElement('obc-automation-tank')\nexport class ObcAutomationTank extends LitElement {\n @property({type: String}) medium: LineMedium = LineMedium.water;\n @property({type: Number}) value: number = 0;\n @property({type: Number}) max: number = 100;\n @property({type: String}) trend: TankTrend = TankTrend.stable;\n @property({type: String, reflect: true}) type: TankType = TankType.generic;\n @property({type: String, reflect: true}) orientation: TankOrientation =\n TankOrientation.vertical;\n @property({type: Boolean, reflect: true}) compact: boolean = false;\n /**\n * Host positioning model — see `TankPositioning` for details. Defaults to\n * `button` (host fills parent container, 100% × 100%, no anchor offset).\n * Set to `point` for the legacy P&ID canvas mode (fixed default dimensions\n * + top-center anchor offset).\n */\n @property({type: String, reflect: true}) positioning: TankPositioning =\n TankPositioning.button;\n /**\n * Static (display-only) variant. Always rendered at the compact size; the\n * inner chart/bar is hidden, the bordered area is filled with\n * `--container-section-color`, and the readout is centered inside the frame.\n * Tag is rendered below the bordered area; badges (when slotted) sit above\n * the frame inside the halo and shrink the frame just like in compact mode.\n * Overrides `compact` (a static tank is always compact-sized).\n *\n * Static tanks render as a non-interactive `<div role=\"img\">` (not a\n * `<button>`), so they are not in the tab order and do not announce as\n * activatable controls.\n */\n @property({type: Boolean, reflect: true}) static: boolean = false;\n /** Enables the activated background color, used to indicate that the tank is activated/selected. */\n @property({type: Boolean}) activated: boolean = false;\n @property({type: String}) tag: string = '';\n\n /**\n * Chart cell rendering mode.\n * - `bar`: static fill bar driven by `value`/`max` (default).\n * - `graph`: embedded `obc-gauge-trend` line/area chart.\n * - `graphAndBar`: embedded `obc-gauge-trend` with an integrated side bar.\n */\n @property({type: String, reflect: true, attribute: 'chart-mode'})\n chartMode: TankChartMode = TankChartMode.bar;\n\n /** Time-series data points for the embedded gauge-trend (graph modes only). */\n @property({type: Array, attribute: false})\n chartData: ChartLineDataItem[] = [];\n\n /** Priority hint forwarded to child charts (regular | enhanced). */\n @property({type: String}) priority: Priority = Priority.regular;\n\n /**\n * Advice overlays. Forwarded to the embedded `obc-gauge-trend` in\n * `graph` / `graph-and-bar` modes, or rendered as pills over the static\n * bar in `bar` mode.\n */\n @property({type: Array, attribute: false})\n advice: LinearAdvice[] = [];\n\n /** Show advice overlays (works in all `chartMode` variants). */\n @property({type: Boolean}) hasAdvice = false;\n\n /**\n * Overlay a 32×32 decorative icon (currently `<obi-tank>`) centered on the\n * chart cell. Works in all three `chartMode` variants (bar, graph,\n * graph-and-bar) and in both orientations. The icon is rendered above the\n * bar/graph in a fixed CSS layer (does not scale with the SVG meet\n * transform) and is silhouetted with a `--border-silhouette-color` halo so\n * it stays legible on any underlying fill. The icon size scales with the\n * ambient `obc-component-size-*` class on an ancestor via the design token\n * `--automation-components-tanks-graphs-graph-icon-size` (32 → 48 → 64 → 64\n * for regular → medium → large → xl).\n *\n * TODO(future): replace the hard-coded `<obi-tank>` with a `slot=\"graph-icon\"`\n * so consumers can pass any `<obi-*>` icon. The current API ships the\n * smallest viable surface; the slot can be added without breaking the\n * boolean property.\n */\n @property({type: Boolean, attribute: false}) hasGraphIcon = false;\n\n /**\n * Show an `<obc-alert-frame>` overlay around the bordered tank area (the\n * `.halo` wrapper). Mirrors the API of `obc-automation-button`: same six\n * properties, same three slots (`alert-icon`, `alert-label`, `alert-timer`).\n * The ring overlays `.halo` only, so the tag and readout that sit outside\n * the halo in compact / static layouts remain unaffected.\n */\n @property({type: Boolean}) alert: boolean = false;\n @property({type: String}) alertFrameType: ObcAlertFrameType =\n ObcAlertFrameType.SmallSideFlip;\n @property({type: String}) alertFrameThickness: ObcAlertFrameThickness =\n ObcAlertFrameThickness.Small;\n @property({type: String}) alertFrameStatus: AlertType = AlertType.Alarm;\n @property({type: Boolean, attribute: false}) showAlertCategoryIcon: boolean =\n true;\n @property({type: Boolean}) showAlertIcon: boolean = false;\n\n /**\n * Show the trend chevron / off icon next to the percent readout. Default\n * `true` preserves existing behavior. Set to `false` to hide the trend\n * indicator in both compact and non-compact readouts — useful when the\n * trend is not meaningful for a given tank, or when the consumer wants\n * to keep the readout compact. Has no effect in `static` mode, which\n * renders the tank's capacity (`max` + `unit`) instead of a percent and\n * intentionally omits the trend indicator (a static tank represents\n * \"device present, current state unknown\"). `attribute: false` per the\n * repo's positive-default-true boolean convention.\n */\n @property({type: Boolean, attribute: false}) showTrendSymbol: boolean = true;\n\n /**\n * Number of fraction digits used to format the percent readout in the\n * non-compact (regular) layout. Defaults to `0` (integer percent). The\n * compact layout always renders integer percent to keep its fixed-width\n * footprint stable. The static layout renders capacity (`max` + `unit`)\n * rather than percent, so this property has no effect there — pass a\n * pre-formatted value through the `max-value` slot if fractional\n * precision is needed (see the `WithFractionDigits` story).\n */\n @property({type: Number}) percentFractionDigits: number = 0;\n\n /**\n * Rich detail rows shown below the main percent/value block in the regular\n * (non-compact, non-static) layout, separated by a divider. When empty (the\n * default), nothing is rendered — neither the divider nor the list. In\n * vertical orientation the chart cell shrinks to make room; in horizontal\n * orientation the readout column already has reserved whitespace so the\n * chart is unaffected.\n *\n * Values are formatted using `percentFractionDigits`. Consumers that need\n * full control over the markup can replace the entire fallback by slotting\n * arbitrary content into `slot=\"rich\"` (note: this is a different name from\n * the existing `slot=\"readout\"` which replaces the whole readout block).\n */\n @property({type: Array, attribute: false}) readout: TankReadoutItem[] = [];\n\n /**\n * Enum-driven badges rendered inside the `badges` cell. Mirrors the API\n * introduced for `ObcAbstractAutomationButton` in PR #839 (#829). When set\n * to a non-`None` value, an `<obc-automation-badge>` of the corresponding\n * type is rendered as fallback content for the `badges` slot. Any content\n * the consumer slots into `badges` overrides these defaults, preserving\n * backward compatibility with the existing slot-based API.\n *\n * Render order (left → right): control, alert, interlock, commandLocked —\n * matching the positional convention used by `ObcAbstractAutomationButton`\n * (top-left, top-right, bottom-left, bottom-right) read row-by-row.\n */\n @property({type: String}) badgeControl: AutomationButtonBadgeControl =\n AutomationButtonBadgeControl.None;\n @property({type: String}) badgeAlert: AutomationButtonBadgeAlert =\n AutomationButtonBadgeAlert.None;\n @property({type: String}) badgeInterlock: AutomationButtonBadgeInterlock =\n AutomationButtonBadgeInterlock.None;\n @property({type: String})\n badgeCommandLocked: AutomationButtonBadgeCommandLocked =\n AutomationButtonBadgeCommandLocked.None;\n\n @state() private _cellWidth = 0;\n @state() private _cellHeight = 0;\n /**\n * Tracks whether the `badges` and `tag` slots have assigned content. Used\n * in compact/static mode to collapse empty cells to 0px so the tank-frame\n * can absorb the freed space (per spec: \"if there are no badges it would\n * grow upward; if there are no readout or tags it would grow downward\").\n * Non-compact (regular) layout keeps its grid-based reserved rows.\n */\n @state() private _hasBadges = false;\n @state() private _hasTagSlot = false;\n private _chartResizeObserver?: ResizeObserver;\n private _observedCell?: Element;\n\n private get isCompact(): boolean {\n return this.compact || this.static;\n }\n\n private _badgeAlertType(): ObcAutomationBadgeType | null {\n switch (this.badgeAlert) {\n case AutomationButtonBadgeAlert.Silence:\n return ObcAutomationBadgeType.AlertSilenced;\n case AutomationButtonBadgeAlert.Caution:\n return ObcAutomationBadgeType.Caution;\n case AutomationButtonBadgeAlert.Warning:\n return ObcAutomationBadgeType.Warning;\n case AutomationButtonBadgeAlert.Alarm:\n return ObcAutomationBadgeType.Alarm;\n case AutomationButtonBadgeAlert.LevelCritical:\n return ObcAutomationBadgeType.LevelCritical;\n case AutomationButtonBadgeAlert.LevelHigh:\n return ObcAutomationBadgeType.LevelHigh;\n case AutomationButtonBadgeAlert.LevelMedium:\n return ObcAutomationBadgeType.LevelMedium;\n case AutomationButtonBadgeAlert.LevelLow:\n return ObcAutomationBadgeType.LevelLow;\n case AutomationButtonBadgeAlert.LevelDiagnostic:\n return ObcAutomationBadgeType.LevelDiagnostic;\n default:\n return null;\n }\n }\n\n private _badgeControlType(): ObcAutomationBadgeType | null {\n switch (this.badgeControl) {\n case AutomationButtonBadgeControl.Local:\n return ObcAutomationBadgeType.Local;\n case AutomationButtonBadgeControl.LocalOnly:\n return ObcAutomationBadgeType.LocalOnly;\n case AutomationButtonBadgeControl.Manual:\n return ObcAutomationBadgeType.Manual;\n case AutomationButtonBadgeControl.ManualOnly:\n return ObcAutomationBadgeType.ManualOnly;\n case AutomationButtonBadgeControl.Auto:\n return ObcAutomationBadgeType.Auto;\n default:\n return null;\n }\n }\n\n private _badgeInterlockType(): ObcAutomationBadgeType | null {\n switch (this.badgeInterlock) {\n case AutomationButtonBadgeInterlock.Interlock:\n return ObcAutomationBadgeType.Interlock;\n case AutomationButtonBadgeInterlock.InterlockInhibit:\n return ObcAutomationBadgeType.InterlockInhibit;\n default:\n return null;\n }\n }\n\n private _badgeCommandLockedType(): ObcAutomationBadgeType | null {\n if (\n this.badgeCommandLocked ===\n AutomationButtonBadgeCommandLocked.CommandLocked\n ) {\n return ObcAutomationBadgeType.CommandLocked;\n }\n return null;\n }\n\n private get _usesGaugeTrend(): boolean {\n return (\n this.chartMode === TankChartMode.graph ||\n this.chartMode === TankChartMode.graphAndBar\n );\n }\n\n private _onBadgesSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement;\n this._hasBadges = slot\n .assignedNodes({flatten: true})\n .some(\n (n) =>\n n.nodeType === Node.ELEMENT_NODE ||\n (n.nodeType === Node.TEXT_NODE && !!n.textContent?.trim())\n );\n }\n\n private _onTagSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement;\n this._hasTagSlot = slot\n .assignedNodes({flatten: true})\n .some(\n (n) =>\n n.nodeType === Node.ELEMENT_NODE ||\n (n.nodeType === Node.TEXT_NODE && !!n.textContent?.trim())\n );\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this._chartResizeObserver?.disconnect();\n this._chartResizeObserver = undefined;\n this._observedCell = undefined;\n }\n\n protected override updated(\n changed: Map<string | number | symbol, unknown>\n ): void {\n super.updated(changed);\n // No imperative forwarding here — child components receive `priority`\n // via template property bindings (`.priority=${this.priority}`). Rely on\n // their reactive `updated()` logic (e.g. `ObcGaugeTrend._updateBarVerticalProperties()`)\n // to propagate palette changes internally.\n // The chart cell DOM element is recreated when chartMode toggles between\n // bar and graph modes (different class/contents), and may also appear/\n // disappear with static/compact. Re-attach the observer to the current\n // .bar-container instance.\n this._syncChartResizeObserver();\n }\n\n private _syncChartResizeObserver(): void {\n // Observe the bar-container in BOTH bar mode and graph modes — the bar\n // mode now renders an SVG `obc-bar-vertical` / `-horizontal` that needs\n // measured pixel dimensions for its viewBox and barThickness.\n const cell = this.renderRoot.querySelector('.bar-container');\n if (!cell) {\n if (this._chartResizeObserver) {\n this._chartResizeObserver.disconnect();\n this._observedCell = undefined;\n }\n return;\n }\n if (cell === this._observedCell) return;\n\n if (!this._chartResizeObserver) {\n this._chartResizeObserver = new ResizeObserver((entries) => {\n const entry = entries[0];\n if (!entry) return;\n const w = Math.round(entry.contentRect.width);\n const h = Math.round(entry.contentRect.height);\n if (w !== this._cellWidth) this._cellWidth = w;\n if (h !== this._cellHeight) this._cellHeight = h;\n });\n } else {\n this._chartResizeObserver.disconnect();\n }\n this._chartResizeObserver.observe(cell);\n this._observedCell = cell;\n }\n\n trendIcon(): HTMLTemplateResult | typeof nothing {\n if (this.trend === TankTrend.fastRising) {\n return html`<obi-chevron-double-up-google\n class=\"trend-icon\"\n ></obi-chevron-double-up-google>`;\n } else if (this.trend === TankTrend.rising) {\n return html`<obi-chevron-up-google\n class=\"trend-icon\"\n ></obi-chevron-up-google>`;\n } else if (this.trend === TankTrend.fastFalling) {\n return html`<obi-chevron-double-down-google\n class=\"trend-icon\"\n ></obi-chevron-double-down-google>`;\n } else if (this.trend === TankTrend.falling) {\n return html`<obi-chevron-down-google\n class=\"trend-icon\"\n ></obi-chevron-down-google>`;\n } else if (this.trend === TankTrend.closed) {\n return html`<obi-off class=\"trend-icon\"></obi-off>`;\n } else {\n // stable: render no icon\n return nothing;\n }\n }\n\n /**\n * Atmospheric cap, 3-piece (corner-start / stretchable middle arc / corner-end).\n * Each piece draws its own fill (closed) and stroke (open) so adjacent pieces\n * abut without a visible vertical seam line. Coordinates are derived from the\n * Figma 248x14 path; corners stay 12px wide while the middle arc stretches.\n * Position (start vs end) and orientation flipping are handled in CSS.\n *\n * Horizontal orientation reuses the same path data but rotates each piece\n * via an inner `<g transform=\"translate(0 H) rotate(-90)\">`, mapping the\n * source coord (x, y) to (y, H - x). The viewBox is swapped accordingly:\n * corner: 12x14 -> 14x12 (H=12)\n * middle: 224x14 -> 14x224 (H=224)\n * Cap-end (right side in horizontal) is mirrored via CSS scaleX(-1).\n */\n private renderAtmosphericCap(side: 'start' | 'end'): HTMLTemplateResult {\n const isHorizontal = this.orientation === TankOrientation.horizontal;\n\n // Path data. Two variants — regular (14px tall, 12px corners) and compact\n // (10px tall, 7px corners). Curve Y-values are proportionally scaled from\n // the original 18/12-tall Figma reference so the corner curves stay\n // continuous at the new thickness.\n // Horizontal orientation reuses the same vertical path data inside an\n // inner `<g transform=\"translate(0 H) rotate(-90)\">`; the SVG viewBox is\n // swapped accordingly. Cap-end is mirrored via CSS scaleY/scaleX(-1).\n let cornerStartFill: string;\n let cornerStartStroke: string;\n let midFill: string;\n let midStroke: string;\n let cornerEndFill: string;\n let cornerEndStroke: string;\n let cornerW: number;\n let capH: number;\n let midW: number;\n\n if (this.isCompact) {\n cornerW = 7;\n capH = 10;\n midW = 149;\n cornerStartFill =\n 'M 6.374 4.8214 C 6.138 4.8429, 6.005 4.8543, 5.83 4.8771 C 2.937 5.2557, 0.669 7.0957, 0.51 9.1936 C 0.5 9.3214, 0.5 9.4357, 0.5 9.6429 L 0.5 10 L 6.374 10 Z';\n cornerStartStroke =\n 'M 6.374 4.8214 C 6.138 4.8429, 6.005 4.8543, 5.83 4.8771 C 2.937 5.2557, 0.669 7.0957, 0.51 9.1936 C 0.5 9.3214, 0.5 9.4357, 0.5 9.6429 L 0.5 10';\n midFill =\n 'M 0 4.8214 C 10.97 3.8214, 37.83 1.7857, 74.626 1.7857 C 111.42 1.7857, 138.28 3.8214, 149.252 4.8214 L 149.252 10 L 0 10 Z';\n midStroke =\n 'M 0 4.8214 C 10.97 3.8214, 37.83 1.7857, 74.626 1.7857 C 111.42 1.7857, 138.28 3.8214, 149.252 4.8214';\n cornerEndFill =\n 'M 0 4.8214 C 0.236 4.8429, 0.369 4.8543, 0.544 4.8771 C 3.437 5.2557, 5.705 7.0957, 5.864 9.1936 C 5.874 9.3214, 5.874 9.4357, 5.874 9.6429 L 5.874 10 L 0 10 Z';\n cornerEndStroke =\n 'M 0 4.8214 C 0.236 4.8429, 0.369 4.8543, 0.544 4.8771 C 3.437 5.2557, 5.705 7.0957, 5.864 9.1936 C 5.874 9.3214, 5.874 9.4357, 5.874 9.6429 L 5.874 10';\n } else {\n cornerW = 12;\n capH = 14;\n midW = 224;\n cornerStartFill =\n 'M 12 6.5837 C 6.346 6.7737, 5.176 6.8744, 4.168 7.2537 C 2.6445 7.8272, 1.418 8.8983, 0.8613 10.1415 C 0.493 10.9641, 0.5 11.9099, 0.5 13.6111 L 0.5 14 L 12 14 Z';\n // Stroke draws the curve + outer vertical edge only. The seam with\n // `.middle` (y = capH) is painted by a 1px CSS `border-top` on\n // `.tank-frame.type-atmospheric:not(.compact) .middle` so it pixel-\n // snaps identically to the pressurized cap's CSS border. Drawing it\n // as an SVG stroke here would render thinner / blurrier due to\n // sub-pixel anti-aliasing.\n cornerStartStroke =\n 'M 12 6.5837 C 6.346 6.7737, 5.176 6.8744, 4.168 7.2537 C 2.6445 7.8272, 1.418 8.8983, 0.8613 10.1415 C 0.493 10.9641, 0.5 11.9099, 0.5 13.6111 L 0.5 14';\n midFill =\n 'M 0 6.5837 C 16 5.1124, 56 1.9444, 112 1.9444 C 168 1.9444, 208 5.1124, 224 6.5837 L 224 14 L 0 14 Z';\n midStroke =\n 'M 0 6.5837 C 16 5.1124, 56 1.9444, 112 1.9444 C 168 1.9444, 208 5.1124, 224 6.5837';\n cornerEndFill =\n 'M 0 6.5837 C 5.654 6.7737, 6.824 6.8744, 7.832 7.2537 C 9.3555 7.8272, 10.582 8.8983, 11.1387 10.1415 C 11.507 10.9641, 11.5 11.9099, 11.5 13.6111 L 11.5 14 L 0 14 Z';\n cornerEndStroke =\n 'M 0 6.5837 C 5.654 6.7737, 6.824 6.8744, 7.832 7.2537 C 9.3555 7.8272, 10.582 8.8983, 11.1387 10.1415 C 11.507 10.9641, 11.5 11.9099, 11.5 13.6111 L 11.5 14';\n }\n\n if (isHorizontal) {\n // Rotate vertical paths -90deg into a `capH`-wide column. Source coord\n // (x, y) maps to (y, cornerW - x) for corners and (y, midW - x) for mid.\n return html`\n <div class=\"cap cap-atmospheric cap-${side}\">\n <svg\n class=\"cap-corner cap-corner-start\"\n viewBox=\"0 0 ${capH} ${cornerW}\"\n preserveAspectRatio=\"xMidYMax meet\"\n aria-hidden=\"true\"\n >\n ${svg`\n <g transform=\"translate(0 ${cornerW}) rotate(-90)\">\n <path class=\"cap-fill\" d=\"${cornerStartFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" d=\"${cornerStartStroke}\" />\n </g>\n `}\n </svg>\n <svg\n class=\"cap-mid\"\n viewBox=\"0 0 ${capH} ${midW}\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n >\n ${svg`\n <g transform=\"translate(0 ${midW}) rotate(-90)\">\n <path class=\"cap-fill\" d=\"${midFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" vector-effect=\"non-scaling-stroke\" d=\"${midStroke}\" />\n </g>\n `}\n </svg>\n <svg\n class=\"cap-corner cap-corner-end\"\n viewBox=\"0 0 ${capH} ${cornerW}\"\n preserveAspectRatio=\"xMidYMin meet\"\n aria-hidden=\"true\"\n >\n ${svg`\n <g transform=\"translate(0 ${cornerW}) rotate(-90)\">\n <path class=\"cap-fill\" d=\"${cornerEndFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" d=\"${cornerEndStroke}\" />\n </g>\n `}\n </svg>\n </div>\n `;\n }\n\n return html`\n <div class=\"cap cap-atmospheric cap-${side}\">\n <svg\n class=\"cap-corner cap-corner-start\"\n viewBox=\"0 0 ${cornerW} ${capH}\"\n preserveAspectRatio=\"xMaxYMid meet\"\n aria-hidden=\"true\"\n >\n ${svg`\n <path class=\"cap-fill\" d=\"${cornerStartFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" d=\"${cornerStartStroke}\" />\n `}\n </svg>\n <svg\n class=\"cap-mid\"\n viewBox=\"0 0 ${midW} ${capH}\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n >\n ${svg`\n <path class=\"cap-fill\" d=\"${midFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" vector-effect=\"non-scaling-stroke\" d=\"${midStroke}\" />\n `}\n </svg>\n <svg\n class=\"cap-corner cap-corner-end\"\n viewBox=\"0 0 ${cornerW} ${capH}\"\n preserveAspectRatio=\"xMinYMid meet\"\n aria-hidden=\"true\"\n >\n ${svg`\n <path class=\"cap-fill\" d=\"${cornerEndFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" d=\"${cornerEndStroke}\" />\n `}\n </svg>\n </div>\n `;\n }\n\n private renderCap(side: 'start' | 'end'): HTMLTemplateResult | null {\n if (this.type === TankType.generic) return null;\n if (this.type === TankType.battery && side === 'end') return null;\n if (this.type === TankType.atmospheric) {\n return this.renderAtmosphericCap(side);\n }\n if (this.type === TankType.pressurized) {\n return html`<div class=\"cap cap-pressurized cap-${side}\"></div>`;\n }\n // battery, start only\n return html`<div class=\"cap cap-battery cap-${side}\"></div>`;\n }\n\n override render() {\n const safeMax = this.max > 0 ? this.max : 1;\n const percent = Math.max(0, Math.min(100, (this.value / safeMax) * 100));\n const isCompact = this.isCompact;\n\n // In compact/static the `.halo` is a fixed-size column flex container\n // that holds badges + tank-frame + (compact only) readout + tag. To let\n // the tank-frame absorb the freed space when adjacent cells are empty,\n // we collapse the empty cells with the `hidden` attribute (see CSS).\n // In non-compact mode cells live inside the inner `.grid` and always\n // reserve their min-content rows — unchanged from previous behavior.\n const controlBadge = this._badgeControlType();\n const alertBadge = this._badgeAlertType();\n const interlockBadge = this._badgeInterlockType();\n const commandLockedBadge = this._badgeCommandLockedType();\n const hasEnumBadges =\n controlBadge !== null ||\n alertBadge !== null ||\n interlockBadge !== null ||\n commandLockedBadge !== null;\n\n const badgesHidden = isCompact && !this._hasBadges && !hasEnumBadges;\n const tagHidden = isCompact && !this._hasTagSlot && !this.tag;\n\n const badgesCell = html`\n <div class=\"badges\" ?hidden=${badgesHidden}>\n <slot name=\"badges\" @slotchange=${this._onBadgesSlotChange}>\n ${controlBadge\n ? html`<obc-automation-badge\n .type=${controlBadge}\n ></obc-automation-badge>`\n : nothing}\n ${alertBadge\n ? html`<obc-automation-badge\n .type=${alertBadge}\n ></obc-automation-badge>`\n : nothing}\n ${interlockBadge\n ? html`<obc-automation-badge\n .type=${interlockBadge}\n ></obc-automation-badge>`\n : nothing}\n ${commandLockedBadge\n ? html`<obc-automation-badge\n .type=${commandLockedBadge}\n ></obc-automation-badge>`\n : nothing}\n </slot>\n </div>\n `;\n const tagCell = html`\n <div class=\"tag\" ?hidden=${tagHidden}>\n <slot name=\"tag\" @slotchange=${this._onTagSlotChange}>${this.tag}</slot>\n </div>\n `;\n // Static mode intentionally renders the tank's capacity (max + unit)\n // instead of a percent reading: a static tank represents \"device is\n // present, current state unknown\", so a percent value would be\n // misleading. The trend icon is omitted for the same reason. Consumers\n // who need a custom label can still override the whole cell via the\n // `readout` slot, or supply formatted text through the existing\n // `max-value` / `unit` slots (no new API).\n const readoutCell = this.static\n ? html`\n <div class=\"readout readout-compact readout-static\">\n <slot name=\"readout\">\n <slot name=\"max-value\">${this.max.toFixed(0)}</slot>\n <slot name=\"unit\">m<sup>3</sup></slot>\n </slot>\n </div>\n `\n : isCompact\n ? html`\n <div class=\"readout readout-compact\">\n <slot name=\"readout\">\n ${this.showTrendSymbol ? this.trendIcon() : null}\n <span class=\"percent\"\n >${percent.toFixed(0)}<span class=\"percent-symbol\"\n >%</span\n ></span\n >\n </slot>\n </div>\n `\n : html`\n <div class=\"readout\">\n <slot name=\"readout\">\n <div class=\"header\">\n ${this.showTrendSymbol ? this.trendIcon() : null}\n <div class=\"percent\">\n ${percent.toFixed(this.percentFractionDigits)}<span\n class=\"percent-symbol\"\n >%</span\n >\n </div>\n </div>\n <div class=\"value\">\n <div class=\"current\">\n <slot name=\"current-value\" class=\"current-value\"\n >${this.value.toFixed(0)}</slot\n ><span class=\"divider\">/</span>\n </div>\n <div class=\"max\">\n <slot class=\"max-value\" name=\"max-value\"\n >${this.max.toFixed(0)}</slot\n >\n <slot class=\"unit\" name=\"unit\">m<sup>3</sup></slot>\n </div>\n </div>\n <slot name=\"rich\">\n ${this.readout.length > 0\n ? html`\n <div class=\"rich-divider\"></div>\n <div class=\"rich\">\n ${this.readout.map(\n (row) => html`\n <div class=\"rich-row\">\n <span class=\"rich-label\">${row.label}</span>\n <span class=\"rich-value\"\n >${row.value.toFixed(\n this.percentFractionDigits\n )}</span\n >\n <span class=\"rich-suffix\"\n >${row.hasDegree\n ? html`<span class=\"rich-glyph\">°</span>`\n : nothing}${row.hasPercentage\n ? html`<span class=\"rich-glyph\">%</span>`\n : nothing}<span class=\"rich-unit\"\n >${row.unit}</span\n ></span\n >\n </div>\n `\n )}\n </div>\n `\n : nothing}\n </slot>\n </slot>\n </div>\n `;\n // Decorative icon overlay (centered on the chart cell). Two stacked\n // icon elements: the back layer paints an inherited SVG `stroke` halo\n // (the icon's paths use `fill=\"currentColor\"`, and SVG `stroke` is\n // inherited across the icon's shadow DOM); the front layer paints the\n // colored fill via the `color` property. This mirrors the established\n // silhouette pattern used by `obc-automation-button` (back-layer slot\n // with stroke, front-layer slot with fill).\n //\n // The icon variant follows `type`: battery tanks show an energy-battery\n // icon, all other types show the generic tank icon.\n const graphIconClasses = classMap({\n 'graph-icon': true,\n 'priority-enhanced': this.priority === Priority.enhanced,\n });\n const graphIconOverlay =\n this.type === TankType.battery\n ? html`\n <div class=${graphIconClasses} aria-hidden=\"true\">\n <obi-energy-battery\n class=\"graph-icon-stroke\"\n ></obi-energy-battery>\n <obi-energy-battery class=\"graph-icon-fill\"></obi-energy-battery>\n </div>\n `\n : html`\n <div class=${graphIconClasses} aria-hidden=\"true\">\n <obi-tank class=\"graph-icon-stroke\"></obi-tank>\n <obi-tank class=\"graph-icon-fill\"></obi-tank>\n </div>\n `;\n // Alert-frame overlay. Mirrors the `obc-automation-button` pattern\n // exactly so consumer API is identical. Placed inside `.halo` so the\n // ring hugs only the bordered tank area; `belowHalo` (tag / readout) is\n // unaffected. `.halo` is `position: relative` (see CSS) to anchor the\n // absolutely-positioned alert-frame.\n const alertFrameOverlay = this.alert\n ? html`<obc-alert-frame\n class=\"alert-frame\"\n .type=${this.alertFrameType}\n .thickness=${this.alertFrameThickness}\n .status=${this.alertFrameStatus}\n .showAlertCategoryIcon=${this.showAlertCategoryIcon}\n .showIcon=${this.showAlertIcon}\n >\n <span slot=\"icon\"><slot name=\"alert-icon\"></slot></span>\n <span slot=\"label\"><slot name=\"alert-label\"></slot></span>\n <span slot=\"timer\"><slot name=\"alert-timer\"></slot></span>\n </obc-alert-frame>`\n : null;\n let chartCell: HTMLTemplateResult;\n if (this._usesGaugeTrend) {\n // Forward the measured cell size as the gauge-trend's width/height,\n // which it interprets as an aspect-ratio reference. Its internal\n // ResizeObserver then picks up its own wrapper's clientWidth (= cell\n // width, since we set style width:100%) and computes height from the\n // aspect ratio — so the chart matches the cell exactly. We delay\n // rendering until both dimensions are measured to avoid a divide-by-\n // zero in the aspect-ratio math on first paint.\n const hasSize = this._cellWidth > 0 && this._cellHeight > 0;\n chartCell = html`\n <div class=\"bar-container chart-cell\">\n ${hasSize\n ? html`<obc-gauge-trend\n .data=${this.chartData}\n .minValue=${0}\n .maxValue=${safeMax}\n .value=${this.value}\n .hasBar=${this.chartMode === TankChartMode.graphAndBar}\n .hasScale=${false}\n .hasLabelPadding=${false}\n .chartFill=${true}\n .hasAdvice=${this.hasAdvice}\n .advice=${this.advice}\n .width=${this._cellWidth}\n .height=${this._cellHeight}\n style=\"width: 100%; height: 100%;\"\n .priority=${this.priority}\n ></obc-gauge-trend>`\n : null}\n ${this.hasGraphIcon ? graphIconOverlay : null}\n </div>\n `;\n } else {\n // Bar mode: render the shared SVG bar (`obc-bar-vertical` /\n // `-horizontal`) — the same renderer used by gauge-trend's side bar —\n // so advice overlays work the same way across all three chart modes.\n //\n // TODO(refactor): once `obc-gauge-trend` supports a bar-only layout at\n // this size (no chart-line area), migrate this branch to gauge-trend\n // too so all three chart modes share a single implementation.\n //\n // TODO(theming): the bar fill currently uses the standard instrument\n // palette (`--instrument-regular-tertiary-color` for tint mode). The\n // legacy CSS bar used per-medium colors (e.g. `--automation-medium-fuel`).\n // Extend `external-scale.ts` (and the bar-vertical/-horizontal wrappers)\n // to accept a medium / fuel color so the tank can restore its\n // per-`medium` coloring through the shared renderer.\n const hasSize = this._cellWidth > 0 && this._cellHeight > 0;\n // The inner bar always renders vertically, regardless of the tank's\n // outer `orientation`. Only the tank's outer wrapper flips; its inner\n // chart cell stays portrait. This matches gauge-trend behavior.\n //\n // Match gauge-trend's proportional sizing so advice pills (and other\n // fixed-pixel SVG primitives) render at the same on-screen size in\n // every chart mode. We mirror gauge-trend's defaults exactly:\n // `fixedAspectRatio=true` + `scaleReferenceSize=384`. The bar SVG is\n // then built in a 384-unit-tall viewBox and shrunk into the cell via\n // `xMidYMid meet`, giving on-screen scale = cellHeight / 384.\n //\n // Because the meet transform scales the viewBox uniformly, we must\n // also size `barThickness` in viewBox units (not cell pixels) so the\n // bar still fills the cell width after scaling. We pick the viewBox\n // cross-axis size so width-fit and height-fit ratios match exactly\n // (no horizontal gutters): viewBoxCross = cellWidth * 384 / cellHeight.\n const SCALE_REFERENCE_SIZE = 384;\n const adviceReserveVb = this.hasAdvice ? 16 : 0;\n const safeCellHeight = Math.max(1, this._cellHeight);\n const viewBoxCross =\n (this._cellWidth * SCALE_REFERENCE_SIZE) / safeCellHeight;\n const barThickness = Math.max(0, viewBoxCross - adviceReserveVb);\n // `tint` is locked in for tank bar mode: it draws a fill from 0 to\n // value plus a small marker at the value position, which mirrors the\n // legacy CSS bar's \"fill + top border at value\" visual idiom.\n const barWrapper = html`<obc-bar-vertical\n .minValue=${0}\n .maxValue=${safeMax}\n .value=${this.value}\n .height=${this._cellHeight}\n .fixedAspectRatio=${true}\n .scaleReferenceSize=${SCALE_REFERENCE_SIZE}\n .paddingTop=${0}\n .paddingBottom=${0}\n .side=${ExternalScaleSide.right}\n .hasBar=${true}\n .hasScale=${false}\n .showLabels=${false}\n .barThickness=${barThickness}\n .fillMode=${FillMode.tint}\n .instrumentMode=${true}\n .borderRadius=${2}\n .advices=${this.hasAdvice ? this.advice : []}\n .advicePosition=${AdvicePosition.inner}\n style=\"width: 100%; height: 100%;\"\n .priority=${this.priority}\n ></obc-bar-vertical>`;\n chartCell = html`\n <div class=\"bar-container bar-cell\">\n ${hasSize ? barWrapper : null}\n ${this.hasGraphIcon ? graphIconOverlay : null}\n </div>\n `;\n }\n\n const frameClasses = classMap({\n 'tank-frame': true,\n [`type-${this.type}`]: true,\n [`orientation-${this.orientation}`]: true,\n [this.medium]: true,\n compact: isCompact,\n static: this.static,\n });\n\n let middleContents: HTMLTemplateResult;\n if (this.static) {\n middleContents = html`<div class=\"static-readout\">${readoutCell}</div>`;\n } else if (this.compact) {\n middleContents = chartCell;\n } else {\n middleContents = html`<div class=\"grid\">\n ${tagCell}${badgesCell}${readoutCell}${chartCell}\n </div>`;\n }\n\n const tankFrame = html`\n <div class=${frameClasses}>\n ${this.renderCap('start')}\n <div class=\"middle\">${middleContents}</div>\n ${this.renderCap('end')}\n </div>\n `;\n\n // Whole component is one interactive element. The halo (flat-mixin\n // border/background that appears on hover/pressed/focus) is painted on\n // the inner `.halo` wrapper via `visibleWrapperClass`, so the surround\n // hugs only the bordered area:\n // - non-compact: just the tank-frame (grid inside it carries badges,\n // readout, tag).\n // - compact: fixed-size column flex — badges, tank-frame (flex-grow),\n // readout, tag. Empty cells (badges/tag) collapse via `?hidden`\n // above so the tank-frame absorbs the freed space.\n // - static: same as compact but no separate readout cell (the readout\n // is centered INSIDE the tank-frame via `static-readout`).\n //\n // The alert-frame overlay is the last child of `.halo` so the ring\n // overlays every cell (and any cell-collapse mechanics work uniformly).\n let haloContents: HTMLTemplateResult;\n if (this.static) {\n haloContents = html`${badgesCell}${tankFrame}${tagCell}`;\n } else if (this.compact) {\n haloContents = html`${badgesCell}${tankFrame}${readoutCell}${tagCell}`;\n } else {\n haloContents = tankFrame;\n }\n const halo = html`\n <div class=\"halo\">${haloContents}${alertFrameOverlay}</div>\n `;\n\n // The `activated` class goes on the interactive `.root` so the shared\n // `flat` style mixin paints the activated background/border on `.halo`\n // (its `visibleWrapperClass`), same as the mixin's hover/pressed states.\n const rootClasses = classMap({root: true, activated: this.activated});\n\n // `aria-live=\"polite\"` + `aria-atomic=\"true\"` on the root so the\n // slotted alert label (and any state change of the alert frame) is\n // announced once when `alert` flips on. Always present — an empty live\n // region is harmless and avoids screen-reader re-registration races.\n // TODO(a11y): the rest of the automation component family still lacks\n // this live-region announcement; consolidate when alert support is\n // factored into a shared mixin.\n return html`\n ${this.static\n ? html`<div\n class=${rootClasses}\n role=\"img\"\n aria-label=${this.tag || 'Tank'}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n ${halo}\n </div>`\n : html`<button\n class=${rootClasses}\n type=\"button\"\n aria-label=${this.tag || 'Tank'}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n ${halo}\n </button>`}\n `;\n }\n\n static override styles = unsafeCSS(compentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-automation-tank': ObcAutomationTank;\n }\n}\n"],"names":["TankTrend","TankType","TankOrientation","TankPositioning","TankChartMode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CO,IAAK,8BAAAA,eAAL;AACLA,aAAA,YAAA,IAAa;AACbA,aAAA,QAAA,IAAS;AACTA,aAAA,QAAA,IAAS;AACTA,aAAA,SAAA,IAAU;AACVA,aAAA,aAAA,IAAc;AACdA,aAAA,QAAA,IAAS;AANC,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AASL,IAAK,6BAAAC,cA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AAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAtHb,kBAsHe,WAAA,yBAAA,CAAA;AAeiB,gBAAA;AAAA,EAA1C,SAAS,EAAC,MAAM,OAAO,WAAW,OAAM;AAAA,GArI9B,kBAqIgC,WAAA,WAAA,CAAA;AAcjB,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAnJb,kBAmJe,WAAA,gBAAA,CAAA;AAEA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GArJb,kBAqJe,WAAA,cAAA,CAAA;AAEA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAvJb,kBAuJe,WAAA,kBAAA,CAAA;AAG1B,gBAAA;AAAA,EADC,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAzJb,kBA0JX,WAAA,sBAAA,CAAA;AAGiB,gBAAA;AAAA,EAAhB,MAAA;AAAM,GA7JI,kBA6JM,WAAA,cAAA,CAAA;AACA,gBAAA;AAAA,EAAhB,MAAA;AAAM,GA9JI,kBA8JM,WAAA,eAAA,CAAA;AAQA,gBAAA;AAAA,EAAhB,MAAA;AAAM,GAtKI,kBAsKM,WAAA,cAAA,CAAA;AACA,gBAAA;AAAA,EAAhB,MAAA;AAAM,GAvKI,kBAuKM,WAAA,eAAA,CAAA;AAvKN,oBAAN,gBAAA;AAAA,EADN,cAAc,qBAAqB;AAAA,GACvB,iBAAA;"}
|
|
1
|
+
{"version":3,"file":"automation-tank.js","sources":["../../../src/automation/automation-tank/automation-tank.ts"],"sourcesContent":["import {\n HTMLTemplateResult,\n LitElement,\n html,\n nothing,\n svg,\n unsafeCSS,\n} from 'lit';\nimport {property, state} from 'lit/decorators.js';\nimport compentStyle from './automation-tank.css?inline';\nimport {LineMedium} from '../index.js';\nimport '../automation-badge/automation-badge.js';\nimport {ObcAutomationBadgeType} from '../automation-badge/automation-badge.js';\nimport {\n AutomationButtonBadgeAlert,\n AutomationButtonBadgeCommandLocked,\n AutomationButtonBadgeControl,\n AutomationButtonBadgeInterlock,\n} from '../automation-button/abstract-automation-button.js';\n\nimport '../../icons/icon-chevron-double-up-google.js';\nimport '../../icons/icon-chevron-up-google.js';\nimport '../../icons/icon-chevron-double-down-google.js';\nimport '../../icons/icon-chevron-down-google.js';\nimport '../../icons/icon-off.js';\nimport '../../icons/icon-tank.js';\nimport '../../icons/icon-energy-battery.js';\nimport '../../navigation-instruments/gauge-trend/gauge-trend.js';\nimport '../../building-blocks/bar-vertical/bar-vertical.js';\nimport '../../components/alert-frame/alert-frame.js';\nimport {Priority} from '../../navigation-instruments/types.js';\nimport {\n ObcAlertFrameThickness,\n ObcAlertFrameType,\n} from '../../components/alert-frame/alert-frame.js';\nimport {AlertType} from '../../types.js';\nimport type {ChartLineDataItem} from '../../building-blocks/chart-line/chart-line-base.js';\nimport type {LinearAdvice} from '../../building-blocks/instrument-linear/advice.js';\nimport {\n AdvicePosition,\n ExternalScaleSide,\n FillMode,\n} from '../../building-blocks/external-scale/external-scale.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {customElement} from '../../decorator.js';\n\nexport enum TankTrend {\n fastRising = 'fast-rising',\n rising = 'rising',\n stable = 'stable',\n falling = 'falling',\n fastFalling = 'fast-falling',\n closed = 'closed',\n}\n\nexport enum TankType {\n generic = 'generic',\n atmospheric = 'atmospheric',\n pressurized = 'pressurized',\n battery = 'battery',\n}\n\nexport enum TankOrientation {\n vertical = 'vertical',\n horizontal = 'horizontal',\n}\n\n/**\n * Host positioning model.\n *\n * - `point`: the host has fixed default dimensions (per\n * orientation and compact / static variant) and a P&ID anchor — the\n * visual content is shifted with `translateX(-50%)` and (in non-compact)\n * `top: -20px` so the tank's top-center aligns with the host's top-left\n * placement coordinate. Use this when dropping the tank onto a P&ID\n * canvas at a pipe-grid coordinate.\n * - `button` (default): the host fills its parent container (100% × 100%) with no\n * anchor offset. Use this when embedding the tank inside a sized layout\n * slot — the parent controls the footprint and the tank renders\n * responsively inside it, just like a regular button. Compact / static\n * inner layout still applies; only the host box is changed.\n */\nexport enum TankPositioning {\n point = 'point',\n button = 'button',\n}\n\nexport enum TankChartMode {\n /** Static fill bar driven by `value` / `max` (default, backward compatible). */\n bar = 'bar',\n /** Embedded `obc-gauge-trend` line/area chart, no side bar. */\n graph = 'graph',\n /** Embedded `obc-gauge-trend` line/area chart with a side bar. */\n graphAndBar = 'graph-and-bar',\n}\n\n/**\n *\n *\n * @slot badges - Custom badges to be displayed in the badge area.\n * @slot tag - Text or element for the tank's tag/label.\n * @slot readout - Replaces the entire readout content block.\n * @slot max-value - Content for the capacity value.\n * @slot unit - Content for the unit of measurement.\n * @slot current-value - Content for the current level value.\n * @slot rich - Detail rows below the main readout, shown in the regular\n * (non-compact, non-static) layout. Slot an `<obc-readout-list>` of\n * `<obc-readout-list-item>` rows — it owns the row typography and cross-row\n * column alignment; the tank renders a divider above it automatically when\n * the slot is filled.\n * @slot alert-icon - Custom icon for the alert frame.\n * @slot alert-label - Label for the alert frame.\n * @slot alert-timer - Timer for the alert frame.\n * @beta\n */\n@customElement('obc-automation-tank')\nexport class ObcAutomationTank extends LitElement {\n @property({type: String}) medium: LineMedium = LineMedium.water;\n @property({type: Number}) value: number = 0;\n @property({type: Number}) max: number = 100;\n @property({type: String}) trend: TankTrend = TankTrend.stable;\n @property({type: String, reflect: true}) type: TankType = TankType.generic;\n @property({type: String, reflect: true}) orientation: TankOrientation =\n TankOrientation.vertical;\n @property({type: Boolean, reflect: true}) compact: boolean = false;\n /**\n * Host positioning model — see `TankPositioning` for details. Defaults to\n * `button` (host fills parent container, 100% × 100%, no anchor offset).\n * Set to `point` for the legacy P&ID canvas mode (fixed default dimensions\n * + top-center anchor offset).\n */\n @property({type: String, reflect: true}) positioning: TankPositioning =\n TankPositioning.button;\n /**\n * Static (display-only) variant. Always rendered at the compact size; the\n * inner chart/bar is hidden, the bordered area is filled with\n * `--container-section-color`, and the readout is centered inside the frame.\n * Tag is rendered below the bordered area; badges (when slotted) sit above\n * the frame inside the halo and shrink the frame just like in compact mode.\n * Overrides `compact` (a static tank is always compact-sized).\n *\n * Static tanks render as a non-interactive `<div role=\"img\">` (not a\n * `<button>`), so they are not in the tab order and do not announce as\n * activatable controls.\n */\n @property({type: Boolean, reflect: true}) static: boolean = false;\n /** Enables the activated background color, used to indicate that the tank is activated/selected. */\n @property({type: Boolean}) activated: boolean = false;\n @property({type: String}) tag: string = '';\n\n /**\n * Chart cell rendering mode.\n * - `bar`: static fill bar driven by `value`/`max` (default).\n * - `graph`: embedded `obc-gauge-trend` line/area chart.\n * - `graphAndBar`: embedded `obc-gauge-trend` with an integrated side bar.\n */\n @property({type: String, reflect: true, attribute: 'chart-mode'})\n chartMode: TankChartMode = TankChartMode.bar;\n\n /** Time-series data points for the embedded gauge-trend (graph modes only). */\n @property({type: Array, attribute: false})\n chartData: ChartLineDataItem[] = [];\n\n /** Priority hint forwarded to child charts (regular | enhanced). */\n @property({type: String}) priority: Priority = Priority.regular;\n\n /**\n * Advice overlays. Forwarded to the embedded `obc-gauge-trend` in\n * `graph` / `graph-and-bar` modes, or rendered as pills over the static\n * bar in `bar` mode.\n */\n @property({type: Array, attribute: false})\n advice: LinearAdvice[] = [];\n\n /** Show advice overlays (works in all `chartMode` variants). */\n @property({type: Boolean}) hasAdvice = false;\n\n /**\n * Overlay a 32×32 decorative icon (currently `<obi-tank>`) centered on the\n * chart cell. Works in all three `chartMode` variants (bar, graph,\n * graph-and-bar) and in both orientations. The icon is rendered above the\n * bar/graph in a fixed CSS layer (does not scale with the SVG meet\n * transform) and is silhouetted with a `--border-silhouette-color` halo so\n * it stays legible on any underlying fill. The icon size scales with the\n * ambient `obc-component-size-*` class on an ancestor via the design token\n * `--automation-components-tanks-graphs-graph-icon-size` (32 → 48 → 64 → 64\n * for regular → medium → large → xl).\n *\n * TODO(future): replace the hard-coded `<obi-tank>` with a `slot=\"graph-icon\"`\n * so consumers can pass any `<obi-*>` icon. The current API ships the\n * smallest viable surface; the slot can be added without breaking the\n * boolean property.\n */\n @property({type: Boolean, attribute: false}) hasGraphIcon = false;\n\n /**\n * Show an `<obc-alert-frame>` overlay around the bordered tank area (the\n * `.halo` wrapper). Mirrors the API of `obc-automation-button`: same six\n * properties, same three slots (`alert-icon`, `alert-label`, `alert-timer`).\n * The ring overlays `.halo` only, so the tag and readout that sit outside\n * the halo in compact / static layouts remain unaffected.\n */\n @property({type: Boolean}) alert: boolean = false;\n @property({type: String}) alertFrameType: ObcAlertFrameType =\n ObcAlertFrameType.SmallSideFlip;\n @property({type: String}) alertFrameThickness: ObcAlertFrameThickness =\n ObcAlertFrameThickness.Small;\n @property({type: String}) alertFrameStatus: AlertType = AlertType.Alarm;\n @property({type: Boolean, attribute: false}) showAlertCategoryIcon: boolean =\n true;\n @property({type: Boolean}) showAlertIcon: boolean = false;\n\n /**\n * Show the trend chevron / off icon next to the percent readout. Default\n * `true` preserves existing behavior. Set to `false` to hide the trend\n * indicator in both compact and non-compact readouts — useful when the\n * trend is not meaningful for a given tank, or when the consumer wants\n * to keep the readout compact. Has no effect in `static` mode, which\n * renders the tank's capacity (`max` + `unit`) instead of a percent and\n * intentionally omits the trend indicator (a static tank represents\n * \"device present, current state unknown\"). `attribute: false` per the\n * repo's positive-default-true boolean convention.\n */\n @property({type: Boolean, attribute: false}) showTrendSymbol: boolean = true;\n\n /**\n * Number of fraction digits used to format the percent readout in the\n * non-compact (regular) layout. Defaults to `0` (integer percent). The\n * compact layout always renders integer percent to keep its fixed-width\n * footprint stable. The static layout renders capacity (`max` + `unit`)\n * rather than percent, so this property has no effect there — pass a\n * pre-formatted value through the `max-value` slot if fractional\n * precision is needed (see the `WithFractionDigits` story).\n */\n @property({type: Number}) percentFractionDigits: number = 0;\n\n /**\n * Enum-driven badges rendered inside the `badges` cell. Mirrors the API\n * introduced for `ObcAbstractAutomationButton` in PR #839 (#829). When set\n * to a non-`None` value, an `<obc-automation-badge>` of the corresponding\n * type is rendered as fallback content for the `badges` slot. Any content\n * the consumer slots into `badges` overrides these defaults, preserving\n * backward compatibility with the existing slot-based API.\n *\n * Render order (left → right): control, alert, interlock, commandLocked —\n * matching the positional convention used by `ObcAbstractAutomationButton`\n * (top-left, top-right, bottom-left, bottom-right) read row-by-row.\n */\n @property({type: String}) badgeControl: AutomationButtonBadgeControl =\n AutomationButtonBadgeControl.None;\n @property({type: String}) badgeAlert: AutomationButtonBadgeAlert =\n AutomationButtonBadgeAlert.None;\n @property({type: String}) badgeInterlock: AutomationButtonBadgeInterlock =\n AutomationButtonBadgeInterlock.None;\n @property({type: String})\n badgeCommandLocked: AutomationButtonBadgeCommandLocked =\n AutomationButtonBadgeCommandLocked.None;\n\n @state() private _cellWidth = 0;\n @state() private _cellHeight = 0;\n /**\n * Tracks whether the `badges` and `tag` slots have assigned content. Used\n * in compact/static mode to collapse empty cells to 0px so the tank-frame\n * can absorb the freed space (per spec: \"if there are no badges it would\n * grow upward; if there are no readout or tags it would grow downward\").\n * Non-compact (regular) layout keeps its grid-based reserved rows.\n */\n @state() private _hasBadges = false;\n @state() private _hasTagSlot = false;\n /**\n * Tracks whether the `rich` slot has assigned content, so the regular\n * (non-compact) layout only draws the rich divider when a consumer has\n * slotted detail rows (canonically an `<obc-readout-list>`). Mirrors\n * `_hasBadges` / `_hasTagSlot`.\n */\n @state() private _hasRichSlot = false;\n private _chartResizeObserver?: ResizeObserver;\n private _observedCell?: Element;\n\n private get isCompact(): boolean {\n return this.compact || this.static;\n }\n\n private _badgeAlertType(): ObcAutomationBadgeType | null {\n switch (this.badgeAlert) {\n case AutomationButtonBadgeAlert.Silence:\n return ObcAutomationBadgeType.AlertSilenced;\n case AutomationButtonBadgeAlert.Caution:\n return ObcAutomationBadgeType.Caution;\n case AutomationButtonBadgeAlert.Warning:\n return ObcAutomationBadgeType.Warning;\n case AutomationButtonBadgeAlert.Alarm:\n return ObcAutomationBadgeType.Alarm;\n case AutomationButtonBadgeAlert.LevelCritical:\n return ObcAutomationBadgeType.LevelCritical;\n case AutomationButtonBadgeAlert.LevelHigh:\n return ObcAutomationBadgeType.LevelHigh;\n case AutomationButtonBadgeAlert.LevelMedium:\n return ObcAutomationBadgeType.LevelMedium;\n case AutomationButtonBadgeAlert.LevelLow:\n return ObcAutomationBadgeType.LevelLow;\n case AutomationButtonBadgeAlert.LevelDiagnostic:\n return ObcAutomationBadgeType.LevelDiagnostic;\n default:\n return null;\n }\n }\n\n private _badgeControlType(): ObcAutomationBadgeType | null {\n switch (this.badgeControl) {\n case AutomationButtonBadgeControl.Local:\n return ObcAutomationBadgeType.Local;\n case AutomationButtonBadgeControl.LocalOnly:\n return ObcAutomationBadgeType.LocalOnly;\n case AutomationButtonBadgeControl.Manual:\n return ObcAutomationBadgeType.Manual;\n case AutomationButtonBadgeControl.ManualOnly:\n return ObcAutomationBadgeType.ManualOnly;\n case AutomationButtonBadgeControl.Auto:\n return ObcAutomationBadgeType.Auto;\n default:\n return null;\n }\n }\n\n private _badgeInterlockType(): ObcAutomationBadgeType | null {\n switch (this.badgeInterlock) {\n case AutomationButtonBadgeInterlock.Interlock:\n return ObcAutomationBadgeType.Interlock;\n case AutomationButtonBadgeInterlock.InterlockInhibit:\n return ObcAutomationBadgeType.InterlockInhibit;\n default:\n return null;\n }\n }\n\n private _badgeCommandLockedType(): ObcAutomationBadgeType | null {\n if (\n this.badgeCommandLocked ===\n AutomationButtonBadgeCommandLocked.CommandLocked\n ) {\n return ObcAutomationBadgeType.CommandLocked;\n }\n return null;\n }\n\n private get _usesGaugeTrend(): boolean {\n return (\n this.chartMode === TankChartMode.graph ||\n this.chartMode === TankChartMode.graphAndBar\n );\n }\n\n private _onBadgesSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement;\n this._hasBadges = slot\n .assignedNodes({flatten: true})\n .some(\n (n) =>\n n.nodeType === Node.ELEMENT_NODE ||\n (n.nodeType === Node.TEXT_NODE && !!n.textContent?.trim())\n );\n }\n\n private _onTagSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement;\n this._hasTagSlot = slot\n .assignedNodes({flatten: true})\n .some(\n (n) =>\n n.nodeType === Node.ELEMENT_NODE ||\n (n.nodeType === Node.TEXT_NODE && !!n.textContent?.trim())\n );\n }\n\n private _onRichSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement;\n this._hasRichSlot = slot\n .assignedNodes({flatten: true})\n .some(\n (n) =>\n n.nodeType === Node.ELEMENT_NODE ||\n (n.nodeType === Node.TEXT_NODE && !!n.textContent?.trim())\n );\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this._chartResizeObserver?.disconnect();\n this._chartResizeObserver = undefined;\n this._observedCell = undefined;\n }\n\n protected override updated(\n changed: Map<string | number | symbol, unknown>\n ): void {\n super.updated(changed);\n // No imperative forwarding here — child components receive `priority`\n // via template property bindings (`.priority=${this.priority}`). Rely on\n // their reactive `updated()` logic (e.g. `ObcGaugeTrend._updateBarVerticalProperties()`)\n // to propagate palette changes internally.\n // The chart cell DOM element is recreated when chartMode toggles between\n // bar and graph modes (different class/contents), and may also appear/\n // disappear with static/compact. Re-attach the observer to the current\n // .bar-container instance.\n this._syncChartResizeObserver();\n }\n\n private _syncChartResizeObserver(): void {\n // Observe the bar-container in BOTH bar mode and graph modes — the bar\n // mode now renders an SVG `obc-bar-vertical` / `-horizontal` that needs\n // measured pixel dimensions for its viewBox and barThickness.\n const cell = this.renderRoot.querySelector('.bar-container');\n if (!cell) {\n if (this._chartResizeObserver) {\n this._chartResizeObserver.disconnect();\n this._observedCell = undefined;\n }\n return;\n }\n if (cell === this._observedCell) return;\n\n if (!this._chartResizeObserver) {\n this._chartResizeObserver = new ResizeObserver((entries) => {\n const entry = entries[0];\n if (!entry) return;\n const w = Math.round(entry.contentRect.width);\n const h = Math.round(entry.contentRect.height);\n if (w !== this._cellWidth) this._cellWidth = w;\n if (h !== this._cellHeight) this._cellHeight = h;\n });\n } else {\n this._chartResizeObserver.disconnect();\n }\n this._chartResizeObserver.observe(cell);\n this._observedCell = cell;\n }\n\n trendIcon(): HTMLTemplateResult | typeof nothing {\n if (this.trend === TankTrend.fastRising) {\n return html`<obi-chevron-double-up-google\n class=\"trend-icon\"\n ></obi-chevron-double-up-google>`;\n } else if (this.trend === TankTrend.rising) {\n return html`<obi-chevron-up-google\n class=\"trend-icon\"\n ></obi-chevron-up-google>`;\n } else if (this.trend === TankTrend.fastFalling) {\n return html`<obi-chevron-double-down-google\n class=\"trend-icon\"\n ></obi-chevron-double-down-google>`;\n } else if (this.trend === TankTrend.falling) {\n return html`<obi-chevron-down-google\n class=\"trend-icon\"\n ></obi-chevron-down-google>`;\n } else if (this.trend === TankTrend.closed) {\n return html`<obi-off class=\"trend-icon\"></obi-off>`;\n } else {\n // stable: render no icon\n return nothing;\n }\n }\n\n /**\n * Atmospheric cap, 3-piece (corner-start / stretchable middle arc / corner-end).\n * Each piece draws its own fill (closed) and stroke (open) so adjacent pieces\n * abut without a visible vertical seam line. Coordinates are derived from the\n * Figma 248x14 path; corners stay 12px wide while the middle arc stretches.\n * Position (start vs end) and orientation flipping are handled in CSS.\n *\n * Horizontal orientation reuses the same path data but rotates each piece\n * via an inner `<g transform=\"translate(0 H) rotate(-90)\">`, mapping the\n * source coord (x, y) to (y, H - x). The viewBox is swapped accordingly:\n * corner: 12x14 -> 14x12 (H=12)\n * middle: 224x14 -> 14x224 (H=224)\n * Cap-end (right side in horizontal) is mirrored via CSS scaleX(-1).\n */\n private renderAtmosphericCap(side: 'start' | 'end'): HTMLTemplateResult {\n const isHorizontal = this.orientation === TankOrientation.horizontal;\n\n // Path data. Two variants — regular (14px tall, 12px corners) and compact\n // (10px tall, 7px corners). Curve Y-values are proportionally scaled from\n // the original 18/12-tall Figma reference so the corner curves stay\n // continuous at the new thickness.\n // Horizontal orientation reuses the same vertical path data inside an\n // inner `<g transform=\"translate(0 H) rotate(-90)\">`; the SVG viewBox is\n // swapped accordingly. Cap-end is mirrored via CSS scaleY/scaleX(-1).\n let cornerStartFill: string;\n let cornerStartStroke: string;\n let midFill: string;\n let midStroke: string;\n let cornerEndFill: string;\n let cornerEndStroke: string;\n let cornerW: number;\n let capH: number;\n let midW: number;\n\n if (this.isCompact) {\n cornerW = 7;\n capH = 10;\n midW = 149;\n cornerStartFill =\n 'M 6.374 4.8214 C 6.138 4.8429, 6.005 4.8543, 5.83 4.8771 C 2.937 5.2557, 0.669 7.0957, 0.51 9.1936 C 0.5 9.3214, 0.5 9.4357, 0.5 9.6429 L 0.5 10 L 6.374 10 Z';\n cornerStartStroke =\n 'M 6.374 4.8214 C 6.138 4.8429, 6.005 4.8543, 5.83 4.8771 C 2.937 5.2557, 0.669 7.0957, 0.51 9.1936 C 0.5 9.3214, 0.5 9.4357, 0.5 9.6429 L 0.5 10';\n midFill =\n 'M 0 4.8214 C 10.97 3.8214, 37.83 1.7857, 74.626 1.7857 C 111.42 1.7857, 138.28 3.8214, 149.252 4.8214 L 149.252 10 L 0 10 Z';\n midStroke =\n 'M 0 4.8214 C 10.97 3.8214, 37.83 1.7857, 74.626 1.7857 C 111.42 1.7857, 138.28 3.8214, 149.252 4.8214';\n cornerEndFill =\n 'M 0 4.8214 C 0.236 4.8429, 0.369 4.8543, 0.544 4.8771 C 3.437 5.2557, 5.705 7.0957, 5.864 9.1936 C 5.874 9.3214, 5.874 9.4357, 5.874 9.6429 L 5.874 10 L 0 10 Z';\n cornerEndStroke =\n 'M 0 4.8214 C 0.236 4.8429, 0.369 4.8543, 0.544 4.8771 C 3.437 5.2557, 5.705 7.0957, 5.864 9.1936 C 5.874 9.3214, 5.874 9.4357, 5.874 9.6429 L 5.874 10';\n } else {\n cornerW = 12;\n capH = 14;\n midW = 224;\n cornerStartFill =\n 'M 12 6.5837 C 6.346 6.7737, 5.176 6.8744, 4.168 7.2537 C 2.6445 7.8272, 1.418 8.8983, 0.8613 10.1415 C 0.493 10.9641, 0.5 11.9099, 0.5 13.6111 L 0.5 14 L 12 14 Z';\n // Stroke draws the curve + outer vertical edge only. The seam with\n // `.middle` (y = capH) is painted by a 1px CSS `border-top` on\n // `.tank-frame.type-atmospheric:not(.compact) .middle` so it pixel-\n // snaps identically to the pressurized cap's CSS border. Drawing it\n // as an SVG stroke here would render thinner / blurrier due to\n // sub-pixel anti-aliasing.\n cornerStartStroke =\n 'M 12 6.5837 C 6.346 6.7737, 5.176 6.8744, 4.168 7.2537 C 2.6445 7.8272, 1.418 8.8983, 0.8613 10.1415 C 0.493 10.9641, 0.5 11.9099, 0.5 13.6111 L 0.5 14';\n midFill =\n 'M 0 6.5837 C 16 5.1124, 56 1.9444, 112 1.9444 C 168 1.9444, 208 5.1124, 224 6.5837 L 224 14 L 0 14 Z';\n midStroke =\n 'M 0 6.5837 C 16 5.1124, 56 1.9444, 112 1.9444 C 168 1.9444, 208 5.1124, 224 6.5837';\n cornerEndFill =\n 'M 0 6.5837 C 5.654 6.7737, 6.824 6.8744, 7.832 7.2537 C 9.3555 7.8272, 10.582 8.8983, 11.1387 10.1415 C 11.507 10.9641, 11.5 11.9099, 11.5 13.6111 L 11.5 14 L 0 14 Z';\n cornerEndStroke =\n 'M 0 6.5837 C 5.654 6.7737, 6.824 6.8744, 7.832 7.2537 C 9.3555 7.8272, 10.582 8.8983, 11.1387 10.1415 C 11.507 10.9641, 11.5 11.9099, 11.5 13.6111 L 11.5 14';\n }\n\n if (isHorizontal) {\n // Rotate vertical paths -90deg into a `capH`-wide column. Source coord\n // (x, y) maps to (y, cornerW - x) for corners and (y, midW - x) for mid.\n return html`\n <div class=\"cap cap-atmospheric cap-${side}\">\n <svg\n class=\"cap-corner cap-corner-start\"\n viewBox=\"0 0 ${capH} ${cornerW}\"\n preserveAspectRatio=\"xMidYMax meet\"\n aria-hidden=\"true\"\n >\n ${svg`\n <g transform=\"translate(0 ${cornerW}) rotate(-90)\">\n <path class=\"cap-fill\" d=\"${cornerStartFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" d=\"${cornerStartStroke}\" />\n </g>\n `}\n </svg>\n <svg\n class=\"cap-mid\"\n viewBox=\"0 0 ${capH} ${midW}\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n >\n ${svg`\n <g transform=\"translate(0 ${midW}) rotate(-90)\">\n <path class=\"cap-fill\" d=\"${midFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" vector-effect=\"non-scaling-stroke\" d=\"${midStroke}\" />\n </g>\n `}\n </svg>\n <svg\n class=\"cap-corner cap-corner-end\"\n viewBox=\"0 0 ${capH} ${cornerW}\"\n preserveAspectRatio=\"xMidYMin meet\"\n aria-hidden=\"true\"\n >\n ${svg`\n <g transform=\"translate(0 ${cornerW}) rotate(-90)\">\n <path class=\"cap-fill\" d=\"${cornerEndFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" d=\"${cornerEndStroke}\" />\n </g>\n `}\n </svg>\n </div>\n `;\n }\n\n return html`\n <div class=\"cap cap-atmospheric cap-${side}\">\n <svg\n class=\"cap-corner cap-corner-start\"\n viewBox=\"0 0 ${cornerW} ${capH}\"\n preserveAspectRatio=\"xMaxYMid meet\"\n aria-hidden=\"true\"\n >\n ${svg`\n <path class=\"cap-fill\" d=\"${cornerStartFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" d=\"${cornerStartStroke}\" />\n `}\n </svg>\n <svg\n class=\"cap-mid\"\n viewBox=\"0 0 ${midW} ${capH}\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n >\n ${svg`\n <path class=\"cap-fill\" d=\"${midFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" vector-effect=\"non-scaling-stroke\" d=\"${midStroke}\" />\n `}\n </svg>\n <svg\n class=\"cap-corner cap-corner-end\"\n viewBox=\"0 0 ${cornerW} ${capH}\"\n preserveAspectRatio=\"xMinYMid meet\"\n aria-hidden=\"true\"\n >\n ${svg`\n <path class=\"cap-fill\" d=\"${cornerEndFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" d=\"${cornerEndStroke}\" />\n `}\n </svg>\n </div>\n `;\n }\n\n private renderCap(side: 'start' | 'end'): HTMLTemplateResult | null {\n if (this.type === TankType.generic) return null;\n if (this.type === TankType.battery && side === 'end') return null;\n if (this.type === TankType.atmospheric) {\n return this.renderAtmosphericCap(side);\n }\n if (this.type === TankType.pressurized) {\n return html`<div class=\"cap cap-pressurized cap-${side}\"></div>`;\n }\n // battery, start only\n return html`<div class=\"cap cap-battery cap-${side}\"></div>`;\n }\n\n override render() {\n const safeMax = this.max > 0 ? this.max : 1;\n const percent = Math.max(0, Math.min(100, (this.value / safeMax) * 100));\n const isCompact = this.isCompact;\n\n // In compact/static the `.halo` is a fixed-size column flex container\n // that holds badges + tank-frame + (compact only) readout + tag. To let\n // the tank-frame absorb the freed space when adjacent cells are empty,\n // we collapse the empty cells with the `hidden` attribute (see CSS).\n // In non-compact mode cells live inside the inner `.grid` and always\n // reserve their min-content rows — unchanged from previous behavior.\n const controlBadge = this._badgeControlType();\n const alertBadge = this._badgeAlertType();\n const interlockBadge = this._badgeInterlockType();\n const commandLockedBadge = this._badgeCommandLockedType();\n const hasEnumBadges =\n controlBadge !== null ||\n alertBadge !== null ||\n interlockBadge !== null ||\n commandLockedBadge !== null;\n\n const badgesHidden = isCompact && !this._hasBadges && !hasEnumBadges;\n const tagHidden = isCompact && !this._hasTagSlot && !this.tag;\n\n const badgesCell = html`\n <div class=\"badges\" ?hidden=${badgesHidden}>\n <slot name=\"badges\" @slotchange=${this._onBadgesSlotChange}>\n ${controlBadge\n ? html`<obc-automation-badge\n .type=${controlBadge}\n ></obc-automation-badge>`\n : nothing}\n ${alertBadge\n ? html`<obc-automation-badge\n .type=${alertBadge}\n ></obc-automation-badge>`\n : nothing}\n ${interlockBadge\n ? html`<obc-automation-badge\n .type=${interlockBadge}\n ></obc-automation-badge>`\n : nothing}\n ${commandLockedBadge\n ? html`<obc-automation-badge\n .type=${commandLockedBadge}\n ></obc-automation-badge>`\n : nothing}\n </slot>\n </div>\n `;\n const tagCell = html`\n <div class=\"tag\" ?hidden=${tagHidden}>\n <slot name=\"tag\" @slotchange=${this._onTagSlotChange}>${this.tag}</slot>\n </div>\n `;\n // Static mode intentionally renders the tank's capacity (max + unit)\n // instead of a percent reading: a static tank represents \"device is\n // present, current state unknown\", so a percent value would be\n // misleading. The trend icon is omitted for the same reason. Consumers\n // who need a custom label can still override the whole cell via the\n // `readout` slot, or supply formatted text through the existing\n // `max-value` / `unit` slots (no new API).\n const readoutCell = this.static\n ? html`\n <div class=\"readout readout-compact readout-static\">\n <slot name=\"readout\">\n <slot name=\"max-value\">${this.max.toFixed(0)}</slot>\n <slot name=\"unit\">m<sup>3</sup></slot>\n </slot>\n </div>\n `\n : isCompact\n ? html`\n <div class=\"readout readout-compact\">\n <slot name=\"readout\">\n ${this.showTrendSymbol ? this.trendIcon() : null}\n <span class=\"percent\"\n >${percent.toFixed(0)}<span class=\"percent-symbol\"\n >%</span\n ></span\n >\n </slot>\n </div>\n `\n : html`\n <div class=\"readout\">\n <slot name=\"readout\">\n <div class=\"header\">\n ${this.showTrendSymbol ? this.trendIcon() : null}\n <div class=\"percent\">\n ${percent.toFixed(this.percentFractionDigits)}<span\n class=\"percent-symbol\"\n >%</span\n >\n </div>\n </div>\n <div class=\"value\">\n <div class=\"current\">\n <slot name=\"current-value\" class=\"current-value\"\n >${this.value.toFixed(0)}</slot\n ><span class=\"divider\">/</span>\n </div>\n <div class=\"max\">\n <slot class=\"max-value\" name=\"max-value\"\n >${this.max.toFixed(0)}</slot\n >\n <slot class=\"unit\" name=\"unit\">m<sup>3</sup></slot>\n </div>\n </div>\n <div class=\"rich-divider\" ?hidden=${!this._hasRichSlot}></div>\n <slot name=\"rich\" @slotchange=${this._onRichSlotChange}></slot>\n </slot>\n </div>\n `;\n // Decorative icon overlay (centered on the chart cell). Two stacked\n // icon elements: the back layer paints an inherited SVG `stroke` halo\n // (the icon's paths use `fill=\"currentColor\"`, and SVG `stroke` is\n // inherited across the icon's shadow DOM); the front layer paints the\n // colored fill via the `color` property. This mirrors the established\n // silhouette pattern used by `obc-automation-button` (back-layer slot\n // with stroke, front-layer slot with fill).\n //\n // The icon variant follows `type`: battery tanks show an energy-battery\n // icon, all other types show the generic tank icon.\n const graphIconClasses = classMap({\n 'graph-icon': true,\n 'priority-enhanced': this.priority === Priority.enhanced,\n });\n const graphIconOverlay =\n this.type === TankType.battery\n ? html`\n <div class=${graphIconClasses} aria-hidden=\"true\">\n <obi-energy-battery\n class=\"graph-icon-stroke\"\n ></obi-energy-battery>\n <obi-energy-battery class=\"graph-icon-fill\"></obi-energy-battery>\n </div>\n `\n : html`\n <div class=${graphIconClasses} aria-hidden=\"true\">\n <obi-tank class=\"graph-icon-stroke\"></obi-tank>\n <obi-tank class=\"graph-icon-fill\"></obi-tank>\n </div>\n `;\n // Alert-frame overlay. Mirrors the `obc-automation-button` pattern\n // exactly so consumer API is identical. Placed inside `.halo` so the\n // ring hugs only the bordered tank area; `belowHalo` (tag / readout) is\n // unaffected. `.halo` is `position: relative` (see CSS) to anchor the\n // absolutely-positioned alert-frame.\n const alertFrameOverlay = this.alert\n ? html`<obc-alert-frame\n class=\"alert-frame\"\n .type=${this.alertFrameType}\n .thickness=${this.alertFrameThickness}\n .status=${this.alertFrameStatus}\n .showAlertCategoryIcon=${this.showAlertCategoryIcon}\n .showIcon=${this.showAlertIcon}\n >\n <span slot=\"icon\"><slot name=\"alert-icon\"></slot></span>\n <span slot=\"label\"><slot name=\"alert-label\"></slot></span>\n <span slot=\"timer\"><slot name=\"alert-timer\"></slot></span>\n </obc-alert-frame>`\n : null;\n let chartCell: HTMLTemplateResult;\n if (this._usesGaugeTrend) {\n // Forward the measured cell size as the gauge-trend's width/height,\n // which it interprets as an aspect-ratio reference. Its internal\n // ResizeObserver then picks up its own wrapper's clientWidth (= cell\n // width, since we set style width:100%) and computes height from the\n // aspect ratio — so the chart matches the cell exactly. We delay\n // rendering until both dimensions are measured to avoid a divide-by-\n // zero in the aspect-ratio math on first paint.\n const hasSize = this._cellWidth > 0 && this._cellHeight > 0;\n chartCell = html`\n <div class=\"bar-container chart-cell\">\n ${hasSize\n ? html`<obc-gauge-trend\n .data=${this.chartData}\n .minValue=${0}\n .maxValue=${safeMax}\n .value=${this.value}\n .hasBar=${this.chartMode === TankChartMode.graphAndBar}\n .hasScale=${false}\n .hasLabelPadding=${false}\n .chartFill=${true}\n .hasAdvice=${this.hasAdvice}\n .advice=${this.advice}\n .width=${this._cellWidth}\n .height=${this._cellHeight}\n style=\"width: 100%; height: 100%;\"\n .priority=${this.priority}\n ></obc-gauge-trend>`\n : null}\n ${this.hasGraphIcon ? graphIconOverlay : null}\n </div>\n `;\n } else {\n // Bar mode: render the shared SVG bar (`obc-bar-vertical` /\n // `-horizontal`) — the same renderer used by gauge-trend's side bar —\n // so advice overlays work the same way across all three chart modes.\n //\n // TODO(refactor): once `obc-gauge-trend` supports a bar-only layout at\n // this size (no chart-line area), migrate this branch to gauge-trend\n // too so all three chart modes share a single implementation.\n //\n // TODO(theming): the bar fill currently uses the standard instrument\n // palette (`--instrument-regular-tertiary-color` for tint mode). The\n // legacy CSS bar used per-medium colors (e.g. `--automation-medium-fuel`).\n // Extend `external-scale.ts` (and the bar-vertical/-horizontal wrappers)\n // to accept a medium / fuel color so the tank can restore its\n // per-`medium` coloring through the shared renderer.\n const hasSize = this._cellWidth > 0 && this._cellHeight > 0;\n // The inner bar always renders vertically, regardless of the tank's\n // outer `orientation`. Only the tank's outer wrapper flips; its inner\n // chart cell stays portrait. This matches gauge-trend behavior.\n //\n // Match gauge-trend's proportional sizing so advice pills (and other\n // fixed-pixel SVG primitives) render at the same on-screen size in\n // every chart mode. We mirror gauge-trend's defaults exactly:\n // `fixedAspectRatio=true` + `scaleReferenceSize=384`. The bar SVG is\n // then built in a 384-unit-tall viewBox and shrunk into the cell via\n // `xMidYMid meet`, giving on-screen scale = cellHeight / 384.\n //\n // Because the meet transform scales the viewBox uniformly, we must\n // also size `barThickness` in viewBox units (not cell pixels) so the\n // bar still fills the cell width after scaling. We pick the viewBox\n // cross-axis size so width-fit and height-fit ratios match exactly\n // (no horizontal gutters): viewBoxCross = cellWidth * 384 / cellHeight.\n const SCALE_REFERENCE_SIZE = 384;\n const adviceReserveVb = this.hasAdvice ? 16 : 0;\n const safeCellHeight = Math.max(1, this._cellHeight);\n const viewBoxCross =\n (this._cellWidth * SCALE_REFERENCE_SIZE) / safeCellHeight;\n const barThickness = Math.max(0, viewBoxCross - adviceReserveVb);\n // `tint` is locked in for tank bar mode: it draws a fill from 0 to\n // value plus a small marker at the value position, which mirrors the\n // legacy CSS bar's \"fill + top border at value\" visual idiom.\n const barWrapper = html`<obc-bar-vertical\n .minValue=${0}\n .maxValue=${safeMax}\n .value=${this.value}\n .height=${this._cellHeight}\n .fixedAspectRatio=${true}\n .scaleReferenceSize=${SCALE_REFERENCE_SIZE}\n .paddingTop=${0}\n .paddingBottom=${0}\n .side=${ExternalScaleSide.right}\n .hasBar=${true}\n .hasScale=${false}\n .showLabels=${false}\n .barThickness=${barThickness}\n .fillMode=${FillMode.tint}\n .instrumentMode=${true}\n .borderRadius=${2}\n .advices=${this.hasAdvice ? this.advice : []}\n .advicePosition=${AdvicePosition.inner}\n style=\"width: 100%; height: 100%;\"\n .priority=${this.priority}\n ></obc-bar-vertical>`;\n chartCell = html`\n <div class=\"bar-container bar-cell\">\n ${hasSize ? barWrapper : null}\n ${this.hasGraphIcon ? graphIconOverlay : null}\n </div>\n `;\n }\n\n const frameClasses = classMap({\n 'tank-frame': true,\n [`type-${this.type}`]: true,\n [`orientation-${this.orientation}`]: true,\n [this.medium]: true,\n compact: isCompact,\n static: this.static,\n });\n\n let middleContents: HTMLTemplateResult;\n if (this.static) {\n middleContents = html`<div class=\"static-readout\">${readoutCell}</div>`;\n } else if (this.compact) {\n middleContents = chartCell;\n } else {\n middleContents = html`<div class=\"grid\">\n ${tagCell}${badgesCell}${readoutCell}${chartCell}\n </div>`;\n }\n\n const tankFrame = html`\n <div class=${frameClasses}>\n ${this.renderCap('start')}\n <div class=\"middle\">${middleContents}</div>\n ${this.renderCap('end')}\n </div>\n `;\n\n // Whole component is one interactive element. The halo (flat-mixin\n // border/background that appears on hover/pressed/focus) is painted on\n // the inner `.halo` wrapper via `visibleWrapperClass`, so the surround\n // hugs only the bordered area:\n // - non-compact: just the tank-frame (grid inside it carries badges,\n // readout, tag).\n // - compact: fixed-size column flex — badges, tank-frame (flex-grow),\n // readout, tag. Empty cells (badges/tag) collapse via `?hidden`\n // above so the tank-frame absorbs the freed space.\n // - static: same as compact but no separate readout cell (the readout\n // is centered INSIDE the tank-frame via `static-readout`).\n //\n // The alert-frame overlay is the last child of `.halo` so the ring\n // overlays every cell (and any cell-collapse mechanics work uniformly).\n let haloContents: HTMLTemplateResult;\n if (this.static) {\n haloContents = html`${badgesCell}${tankFrame}${tagCell}`;\n } else if (this.compact) {\n haloContents = html`${badgesCell}${tankFrame}${readoutCell}${tagCell}`;\n } else {\n haloContents = tankFrame;\n }\n const halo = html`\n <div class=\"halo\">${haloContents}${alertFrameOverlay}</div>\n `;\n\n // The `activated` class goes on the interactive `.root` so the shared\n // `flat` style mixin paints the activated background/border on `.halo`\n // (its `visibleWrapperClass`), same as the mixin's hover/pressed states.\n const rootClasses = classMap({root: true, activated: this.activated});\n\n // `aria-live=\"polite\"` + `aria-atomic=\"true\"` on the root so the\n // slotted alert label (and any state change of the alert frame) is\n // announced once when `alert` flips on. Always present — an empty live\n // region is harmless and avoids screen-reader re-registration races.\n // TODO(a11y): the rest of the automation component family still lacks\n // this live-region announcement; consolidate when alert support is\n // factored into a shared mixin.\n return html`\n ${this.static\n ? html`<div\n class=${rootClasses}\n role=\"img\"\n aria-label=${this.tag || 'Tank'}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n ${halo}\n </div>`\n : html`<button\n class=${rootClasses}\n type=\"button\"\n aria-label=${this.tag || 'Tank'}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n ${halo}\n </button>`}\n `;\n }\n\n static override styles = unsafeCSS(compentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-automation-tank': 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bar.js';
|
|
3
3
|
/**
|
|
4
|
+
* @slot - Default slot for the alert list items.
|
|
5
|
+
* @slot empty-icon - Icon shown when the list is empty.
|
|
6
|
+
* @slot empty-title - Title shown when the list is empty.
|
|
7
|
+
* @slot empty-description - Description shown when the list is empty.
|
|
4
8
|
* @stable
|
|
5
9
|
*/
|
|
6
10
|
export declare class ObcAlertList extends LitElement {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert-list.d.ts","sourceRoot":"","sources":["../../../src/building-blocks/alert-list/alert-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,cAAc,EAA2B,MAAM,KAAK,CAAC;AAIzE,OAAO,yCAAyC,CAAC;AAIjD
|
|
1
|
+
{"version":3,"file":"alert-list.d.ts","sourceRoot":"","sources":["../../../src/building-blocks/alert-list/alert-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,cAAc,EAA2B,MAAM,KAAK,CAAC;AAIzE,OAAO,yCAAyC,CAAC;AAIjD;;;;;;GAMG;AACH,qBACa,YAAa,SAAQ,UAAU;IACZ,MAAM,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,OAAO,CAC7D;IAEP,OAAO,CAAC,aAAa,CAAuC;IAC5D,OAAO,CAAC,gBAAgB,CAAiC;IACzD,OAAO,CAAC,oBAAoB,CAAqC;IACjE,OAAO,CAAC,gBAAgB,CAAS;IACxB,MAAM,UAAS;IAGxB,OAAO,CAAC,UAAU,CAAiB;IAGnC,OAAO,CAAC,SAAS,CAAgB;IAExB,YAAY;IAKZ,iBAAiB;IAcjB,oBAAoB;cAWV,UAAU,CAAC,kBAAkB,EAAE,cAAc,GAAG,IAAI;IAOvE,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,mBAAmB;IAuB3B,OAAO,CAAC,qBAAqB;IAoB7B,OAAO,CAAC,gBAAgB;IAKxB,OAAO,CAAC,oBAAoB;IAiDrB,kBAAkB,IAAI;QAAC,OAAO,EAAE,WAAW,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,EAAE;IA4B3D,MAAM;IAmBf,OAAgB,MAAM,0BAA2B;CAClD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,YAAY,CAAC;KAChC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert-list.js","sources":["../../../src/building-blocks/alert-list/alert-list.ts"],"sourcesContent":["import {LitElement, PropertyValues, html, nothing, unsafeCSS} from 'lit';\nimport {queryAssignedElements, query, property, state} from 'lit/decorators.js';\nimport {customElement} from '../../decorator.js';\nimport compentStyle from './alert-list.css?inline';\nimport '../../components/scrollbar/scrollbar.js';\nimport {ObcScrollbar} from '../../components/scrollbar/scrollbar.js';\nimport {ObcAlertMenuItem} from '../../components/alert-menu-item/alert-menu-item.js';\n\n/**\n * @stable\n */\n@customElement('obc-alert-list')\nexport class ObcAlertList extends LitElement {\n @property({attribute: false}) filter: (item: HTMLElement) => boolean = () =>\n true;\n\n private oldElementTop: Map<HTMLElement, number> = new Map();\n private mutationObserver: MutationObserver | null = null;\n private intersectionObserver: IntersectionObserver | null = null;\n private hasRenderedPanel = false;\n @state() _empty = false;\n\n @queryAssignedElements({flatten: true})\n private alertItems!: HTMLElement[];\n\n @query('#scrollbar', true)\n private scrollbar!: ObcScrollbar;\n\n override firstUpdated() {\n this.updateEmpty();\n this.setupMutationObserver();\n }\n\n override connectedCallback() {\n super.connectedCallback();\n const intersectionObserver = new IntersectionObserver((entries) => {\n // If intersectionRatio is 0, the target is out of view\n if (entries[0].intersectionRatio === 0) {\n this.hasRenderedPanel = false;\n }\n });\n intersectionObserver.observe(this);\n this.intersectionObserver = intersectionObserver;\n\n this.setupMutationObserver();\n }\n\n override disconnectedCallback() {\n if (this.mutationObserver) {\n this.mutationObserver.disconnect();\n this.mutationObserver = null;\n }\n if (this.intersectionObserver) {\n this.intersectionObserver.disconnect();\n this.intersectionObserver = null;\n }\n }\n\n protected override willUpdate(_changedProperties: PropertyValues): void {\n if (_changedProperties.has('filter')) {\n this.updateEmpty();\n this.updateOldElementTop();\n }\n }\n\n private updateEmpty() {\n this._empty = this.getAlertItems().length === 0;\n }\n\n private getAlertItems() {\n return this.alertItems.filter(this.filter);\n }\n\n private updateOldElementTop() {\n const elements = this.getAlertItems();\n if (elements.length === 0) {\n return;\n }\n\n // Get the top of the element,\n // the element may be in an animation\n // we therefor sum the height of each element\n const firstElement = elements[0];\n const firstElementRect = firstElement.getBoundingClientRect();\n let top = firstElementRect.top;\n this.oldElementTop.clear();\n elements.forEach((element) => {\n const elementRect = element.getBoundingClientRect();\n if (elementRect.height === 0) {\n return;\n }\n this.oldElementTop.set(element, top);\n top += elementRect.height;\n });\n }\n\n private setupMutationObserver() {\n if (this.mutationObserver) {\n // Make a new observer to avoid memory leaks\n this.mutationObserver.disconnect();\n this.mutationObserver = null;\n }\n this.mutationObserver = new MutationObserver(() => {\n this.handleElementsChange();\n });\n\n const slotElements = this.alertItems;\n slotElements.forEach((element) => {\n // Earlier observed elements are just updated, and not registered twice.\n this.mutationObserver?.observe(element, {\n attributes: true,\n attributeFilter: ['status', 'shelved'],\n });\n });\n }\n\n private handleSlotChange() {\n this.handleElementsChange();\n this.setupMutationObserver();\n }\n\n private handleElementsChange() {\n // Take records to ensure the observer is not triggered again\n this.mutationObserver?.takeRecords();\n if (!this.checkVisibility()) {\n return;\n }\n\n this.updateEmpty();\n const elements = this.getAlertItems();\n // Animate the elements to their new positions\n const oldElementTop: Map<HTMLElement, number> = new Map(this.oldElementTop);\n\n requestAnimationFrame(() => {\n this.updateOldElementTop();\n let hasNewElements = false;\n elements.forEach((element) => {\n const elementRect = element.getBoundingClientRect();\n const oldTop = oldElementTop.get(element);\n if (oldTop === undefined) {\n // New element\n (element as ObcAlertMenuItem).animateIntro = this.hasRenderedPanel;\n hasNewElements = true;\n setTimeout(() => {\n (element as ObcAlertMenuItem).animateIntro = false;\n }, 101);\n return;\n }\n const diff = oldTop - elementRect.top;\n if (diff === 0) return;\n element.style.transform = `translateY(${diff}px)`;\n element.style.transition = 'none';\n\n // Force a reflow to ensure the animation is applied\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n element.offsetHeight;\n\n // Remove the transition after the animation is complete\n element.style.transition = 'transform 100ms ease-in-out';\n element.style.transform = 'translateY(0px)';\n });\n this.hasRenderedPanel = true;\n if (hasNewElements) {\n setTimeout(() => {\n this.updateOldElementTop();\n }, 101);\n }\n });\n }\n\n public getVisibleElements(): {element: HTMLElement; index: number}[] {\n // Get all slotted elements in the visible tab's scrollbar\n\n const scrollbarRect = this.scrollbar.getBoundingClientRect();\n const slottedElements = this.getAlertItems();\n\n // Filter for only visible elements that are within the scrollbar viewport\n return slottedElements\n .map((element, index) => ({element, index}))\n .filter(({element}) => {\n const style = window.getComputedStyle(element);\n if (style.display === 'none' || style.visibility === 'hidden') {\n return false;\n }\n\n // Check if the element is within the scrollbar's viewport\n const elementRect = element.getBoundingClientRect();\n\n // Check if element overlaps with scrollbar viewport\n const isVisible = !(\n elementRect.top < scrollbarRect.top ||\n elementRect.bottom > scrollbarRect.bottom\n );\n\n return isVisible;\n });\n }\n\n override render() {\n return html` <obc-scrollbar class=\"alert-list\" id=\"scrollbar\">\n <slot @slotchange=${this.handleSlotChange}></slot>\n ${this._empty\n ? html` <div class=\"empty-list\">\n <div class=\"icon\">\n <slot name=\"empty-icon\"></slot>\n </div>\n <div class=\"empty-title\">\n <slot name=\"empty-title\"></slot>\n </div>\n <div class=\"empty-description\">\n <slot name=\"empty-description\"></slot>\n </div>\n </div>`\n : nothing}\n </obc-scrollbar>`;\n }\n\n static override styles = unsafeCSS(compentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-alert-list': ObcAlertList;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAYO,IAAM,eAAN,cAA2B,WAAW;AAAA,EAAtC,cAAA;A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BAAA;AAAA,EADN,cAAc,gBAAgB;AAAA,GAClB,YAAA;"}
|
|
1
|
+
{"version":3,"file":"alert-list.js","sources":["../../../src/building-blocks/alert-list/alert-list.ts"],"sourcesContent":["import {LitElement, PropertyValues, html, nothing, unsafeCSS} from 'lit';\nimport {queryAssignedElements, query, property, state} from 'lit/decorators.js';\nimport {customElement} from '../../decorator.js';\nimport compentStyle from './alert-list.css?inline';\nimport '../../components/scrollbar/scrollbar.js';\nimport {ObcScrollbar} from '../../components/scrollbar/scrollbar.js';\nimport {ObcAlertMenuItem} from '../../components/alert-menu-item/alert-menu-item.js';\n\n/**\n * @slot - Default slot for the alert list items.\n * @slot empty-icon - Icon shown when the list is empty.\n * @slot empty-title - Title shown when the list is empty.\n * @slot empty-description - Description shown when the list is empty.\n * @stable\n */\n@customElement('obc-alert-list')\nexport class ObcAlertList extends LitElement {\n @property({attribute: false}) filter: (item: HTMLElement) => boolean = () =>\n true;\n\n private oldElementTop: Map<HTMLElement, number> = new Map();\n private mutationObserver: MutationObserver | null = null;\n private intersectionObserver: IntersectionObserver | null = null;\n private hasRenderedPanel = false;\n @state() _empty = false;\n\n @queryAssignedElements({flatten: true})\n private alertItems!: HTMLElement[];\n\n @query('#scrollbar', true)\n private scrollbar!: ObcScrollbar;\n\n override firstUpdated() {\n this.updateEmpty();\n this.setupMutationObserver();\n }\n\n override connectedCallback() {\n super.connectedCallback();\n const intersectionObserver = new IntersectionObserver((entries) => {\n // If intersectionRatio is 0, the target is out of view\n if (entries[0].intersectionRatio === 0) {\n this.hasRenderedPanel = false;\n }\n });\n intersectionObserver.observe(this);\n this.intersectionObserver = intersectionObserver;\n\n this.setupMutationObserver();\n }\n\n override disconnectedCallback() {\n if (this.mutationObserver) {\n this.mutationObserver.disconnect();\n this.mutationObserver = null;\n }\n if (this.intersectionObserver) {\n this.intersectionObserver.disconnect();\n this.intersectionObserver = null;\n }\n }\n\n protected override willUpdate(_changedProperties: PropertyValues): void {\n if (_changedProperties.has('filter')) {\n this.updateEmpty();\n this.updateOldElementTop();\n }\n }\n\n private updateEmpty() {\n this._empty = this.getAlertItems().length === 0;\n }\n\n private getAlertItems() {\n return this.alertItems.filter(this.filter);\n }\n\n private updateOldElementTop() {\n const elements = this.getAlertItems();\n if (elements.length === 0) {\n return;\n }\n\n // Get the top of the element,\n // the element may be in an animation\n // we therefor sum the height of each element\n const firstElement = elements[0];\n const firstElementRect = firstElement.getBoundingClientRect();\n let top = firstElementRect.top;\n this.oldElementTop.clear();\n elements.forEach((element) => {\n const elementRect = element.getBoundingClientRect();\n if (elementRect.height === 0) {\n return;\n }\n this.oldElementTop.set(element, top);\n top += elementRect.height;\n });\n }\n\n private setupMutationObserver() {\n if (this.mutationObserver) {\n // Make a new observer to avoid memory leaks\n this.mutationObserver.disconnect();\n this.mutationObserver = null;\n }\n this.mutationObserver = new MutationObserver(() => {\n this.handleElementsChange();\n });\n\n const slotElements = this.alertItems;\n slotElements.forEach((element) => {\n // Earlier observed elements are just updated, and not registered twice.\n this.mutationObserver?.observe(element, {\n attributes: true,\n attributeFilter: ['status', 'shelved'],\n });\n });\n }\n\n private handleSlotChange() {\n this.handleElementsChange();\n this.setupMutationObserver();\n }\n\n private handleElementsChange() {\n // Take records to ensure the observer is not triggered again\n this.mutationObserver?.takeRecords();\n if (!this.checkVisibility()) {\n return;\n }\n\n this.updateEmpty();\n const elements = this.getAlertItems();\n // Animate the elements to their new positions\n const oldElementTop: Map<HTMLElement, number> = new Map(this.oldElementTop);\n\n requestAnimationFrame(() => {\n this.updateOldElementTop();\n let hasNewElements = false;\n elements.forEach((element) => {\n const elementRect = element.getBoundingClientRect();\n const oldTop = oldElementTop.get(element);\n if (oldTop === undefined) {\n // New element\n (element as ObcAlertMenuItem).animateIntro = this.hasRenderedPanel;\n hasNewElements = true;\n setTimeout(() => {\n (element as ObcAlertMenuItem).animateIntro = false;\n }, 101);\n return;\n }\n const diff = oldTop - elementRect.top;\n if (diff === 0) return;\n element.style.transform = `translateY(${diff}px)`;\n element.style.transition = 'none';\n\n // Force a reflow to ensure the animation is applied\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n element.offsetHeight;\n\n // Remove the transition after the animation is complete\n element.style.transition = 'transform 100ms ease-in-out';\n element.style.transform = 'translateY(0px)';\n });\n this.hasRenderedPanel = true;\n if (hasNewElements) {\n setTimeout(() => {\n this.updateOldElementTop();\n }, 101);\n }\n });\n }\n\n public getVisibleElements(): {element: HTMLElement; index: number}[] {\n // Get all slotted elements in the visible tab's scrollbar\n\n const scrollbarRect = this.scrollbar.getBoundingClientRect();\n const slottedElements = this.getAlertItems();\n\n // Filter for only visible elements that are within the scrollbar viewport\n return slottedElements\n .map((element, index) => ({element, index}))\n .filter(({element}) => {\n const style = window.getComputedStyle(element);\n if (style.display === 'none' || style.visibility === 'hidden') {\n return false;\n }\n\n // Check if the element is within the scrollbar's viewport\n const elementRect = element.getBoundingClientRect();\n\n // Check if element overlaps with scrollbar viewport\n const isVisible = !(\n elementRect.top < scrollbarRect.top ||\n elementRect.bottom > scrollbarRect.bottom\n );\n\n return isVisible;\n });\n }\n\n override render() {\n return html` <obc-scrollbar class=\"alert-list\" id=\"scrollbar\">\n <slot @slotchange=${this.handleSlotChange}></slot>\n ${this._empty\n ? html` <div class=\"empty-list\">\n <div class=\"icon\">\n <slot name=\"empty-icon\"></slot>\n </div>\n <div class=\"empty-title\">\n <slot name=\"empty-title\"></slot>\n </div>\n <div class=\"empty-description\">\n <slot name=\"empty-description\"></slot>\n </div>\n </div>`\n : nothing}\n </obc-scrollbar>`;\n }\n\n static override styles = unsafeCSS(compentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-alert-list': ObcAlertList;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAgBO,IAAM,eAAN,cAA2B,WAAW;AAAA,EAAtC,cAAA;AAAA,UAAA,GAAA,SAAA;AACyB,SAAA,SAAyC,MACrE;AAEF,SAAQ,oCAA8C,IAAA;AACtD,SAAQ,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izontal_base: (new (...args: any[]) => import('../../svgh
|
|
|
20
20
|
* Set `priority` to `Priority.enhanced` to use the blue/enhanced color palette
|
|
21
21
|
* for bar fill and setpoint instead of the default gray/regular palette
|
|
22
22
|
* (default: `Priority.regular`).
|
|
23
|
+
*
|
|
24
|
+
* @fires scale-dimensions-changed {CustomEvent} Fired when the scale's computed layout thickness changes; a parent chart listens for this to reserve space for the scale. Bubbles and is composed.
|
|
23
25
|
* @beta
|
|
24
26
|
*/
|
|
25
27
|
export declare class ObcBarHorizontal extends ObcBarHorizontal_base {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bar-horizontal.d.ts","sourceRoot":"","sources":["../../../src/building-blocks/bar-horizontal/bar-horizontal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAO,MAAM,KAAK,CAAC;AAErC,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,KAAK,CAAC;AAIxC,OAAO,EACL,eAAe,EACf,UAAU,EACV,oBAAoB,EACpB,QAAQ,EACT,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,gCAAgC,CAAC;AAKjE,OAAO,EAUL,SAAS,EACT,QAAQ,EACR,cAAc,EACd,iBAAiB,EAEjB,iBAAiB,EAClB,MAAM,qCAAqC,CAAC;AAI7C,OAAO,EACL,SAAS,EACT,QAAQ,EACR,cAAc,EACd,UAAU,EACV,oBAAoB,EACpB,eAAe,EACf,QAAQ,EACR,iBAAiB,EACjB,iBAAiB,GAClB,CAAC;;AAEF
|
|
1
|
+
{"version":3,"file":"bar-horizontal.d.ts","sourceRoot":"","sources":["../../../src/building-blocks/bar-horizontal/bar-horizontal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAO,MAAM,KAAK,CAAC;AAErC,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,KAAK,CAAC;AAIxC,OAAO,EACL,eAAe,EACf,UAAU,EACV,oBAAoB,EACpB,QAAQ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AM,CAAC;IACb,UAAU,qBAAqB;QAC7B,oBAAoB,EAAE,gBAAgB,CAAC;KACxC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bar-horizontal.js","sources":["../../../src/building-blocks/bar-horizontal/bar-horizontal.ts"],"sourcesContent":["import {LitElement, html} from 'lit';\nimport {property, state} from 'lit/decorators.js';\nimport type {PropertyValues} from 'lit';\nimport {customElement} from '../../decorator.js';\nimport {ResizeController} from '@lit-labs/observers/resize-controller.js';\nimport {CHART_DIMENSIONS} from '../../charthelpers/constants.js';\nimport {\n InstrumentState,\n FrameStyle,\n BorderRadiusPosition,\n Priority,\n} from '../../navigation-instruments/types.js';\nimport type {LinearAdvice} from '../instrument-linear/advice.js';\nimport type {\n ExternalScaleAdvice,\n ExternalScaleConfig,\n} from '../external-scale/external-scale.js';\nimport {\n computeExternalScaleViewBox,\n computeFixedAspectRatioScale,\n computeExternalScaleLayout,\n renderExternalScale,\n toExternalScaleLayoutConfig,\n computeScaleDimensionsForReport,\n computeExternalScaleEffectiveBarThickness,\n readExternalScaleBorderRadiusPx,\n startExternalScaleBorderRadiusObserver,\n ScaleType,\n FillMode,\n AdvicePosition,\n BarContainerStyle,\n ExternalScaleOrientation,\n ExternalScaleSide,\n} from '../external-scale/external-scale.js';\nimport {SetpointMixin} from '../../svghelpers/setpoint-mixin.js';\n\n// Re-export shared enums for convenience\nexport {\n ScaleType,\n FillMode,\n AdvicePosition,\n FrameStyle,\n BorderRadiusPosition,\n InstrumentState,\n Priority,\n BarContainerStyle,\n ExternalScaleSide,\n};\n\n/**\n * Horizontal SVG bar + external scale.\n *\n * This is a thin web-component wrapper around the pure SVG building-block renderer in `external-scale.ts`.\n *\n * It sets up the outer `<svg>`/`viewBox` for a horizontal scale and delegates rendering/layout to:\n * - `computeExternalScaleLayout(...)`\n * - `renderExternalScale(config)`\n *\n * For renderer documentation see: **Building Blocks/External Scale**.\n *\n * For more test cases (Auto at-setpoint detection, Manual at-setpoint control, Deadband tuning and Zero snap behavior) see: **Bars and Graphs/Bar Vertical**.\n *\n * Set `priority` to `Priority.enhanced` to use the blue/enhanced color palette\n * for bar fill and setpoint instead of the default gray/regular palette\n * (default: `Priority.regular`).\n * @beta\n */\n@customElement('obc-bar-horizontal')\nexport class ObcBarHorizontal extends SetpointMixin(LitElement, {\n defaultDeadband: 1,\n}) {\n /** Minimum scale value (manual mode) */\n @property({type: Number}) minValue = 0;\n /** Maximum scale value (manual mode) */\n @property({type: Number}) maxValue = 100;\n\n /**\n * Total width in pixels (including padding bands)\n * @availableWhen fixedAspectRatio==false\n */\n @property({type: Number}) width = 320;\n\n /** Padding left of the drawing area */\n @property({type: Number}) paddingLeft: number =\n CHART_DIMENSIONS.CANVAS_PADDING;\n\n /** Padding right of the drawing area */\n @property({type: Number}) paddingRight: number =\n CHART_DIMENSIONS.CANVAS_PADDING;\n\n /** Which side this scale lives on */\n @property({type: String}) side: ExternalScaleSide = ExternalScaleSide.bottom;\n\n /**\n * When true, freezes all internal calculations and scales the entire component\n * proportionally (like CSS transform:scale), except label font-size remains constant.\n * When false (default), dimensions react to component properties.\n */\n @property({type: Boolean})\n fixedAspectRatio = false;\n\n /**\n * Reference size for proportional scaling when fixedAspectRatio is true.\n * At this width, the scale renders at native 1:1 (matches Figma design).\n * Above this width, the scale grows proportionally; below, it shrinks.\n * @default 384\n * @availableWhen fixedAspectRatio==true\n */\n @property({type: Number})\n scaleReferenceSize = 384;\n\n @state()\n private _scale = 1;\n\n // ResizeController automatically subscribes/unsubscribes based on component lifecycle\n // @ts-expect-error - Controller is used for side effects, not accessed directly\n private _resizeController = new ResizeController(this, {\n callback: (entries) => {\n if (!this.fixedAspectRatio) return;\n\n const entry = entries[0];\n if (!entry) return;\n\n // Use the centralized function that computes scale based on reference size\n // For horizontal scales, compare container width to reference size\n const containerMainAxisSize = entry.contentRect.width;\n\n this._scale = computeFixedAspectRatioScale({\n orientation: ExternalScaleOrientation.horizontal,\n containerMainAxisSize,\n scaleReferenceSize: this.scaleReferenceSize,\n });\n\n // console.debug(`[bar-horizontal] ResizeController:`, {\n // fixedAspectRatio: this.fixedAspectRatio,\n // containerWidth: containerMainAxisSize,\n // scaleReferenceSize: this.scaleReferenceSize,\n // computedScale: this._scale,\n // width: this.width,\n // });\n\n // Report scaled dimensions to parent chart\n this.reportDimensions();\n },\n });\n\n // Bands (thickness)\n /** Show scale tickmarks */\n @property({type: Boolean, attribute: false}) hasScale = true;\n @property({type: Boolean, attribute: false}) showLabels = true;\n /** Show bar */\n @property({type: Boolean}) hasBar = false;\n /** Show background behind the scale tickmarks. */\n @property({type: Boolean})\n scaleBackground = false;\n /**\n * Bar container background style.\n * When undefined, defaults based on scaleBackground.\n * Set explicitly to override: 'primary' (lighter) or 'secondary' (gray).\n * @availableWhen hasBar==true\n */\n @property({type: String})\n barContainerStyle?: BarContainerStyle = undefined;\n /**\n * Bar/fill thickness in pixels\n * @availableWhen hasBar==true\n */\n @property({type: Number}) barThickness = 24;\n /**\n * Tickmark band thickness in pixels.\n * @availableWhen hasScale==true\n */\n @property({type: Number}) tickThickness = 24;\n /**\n * Label band thickness in pixels.\n * @availableWhen showLabels==true\n */\n @property({type: Number}) labelThickness = 60;\n\n // Tick configuration\n /**\n * Array of values for main tickmarks. When undefined, no main tickmarks shown.\n * When empty array [], defaults to [minValue, 0, maxValue].\n * @availableWhen hasScale==true\n */\n @property({type: Array, attribute: false}) mainTickmarks?: number[] = [];\n /**\n * Interval for primary (longest) tickmarks with labels (minimum 1).\n * When undefined, no primary tickmarks are shown.\n * @availableWhen hasScale==true || showLabels==true\n */\n @property({type: Number}) primaryTickmarkInterval?: number = undefined;\n /**\n * Interval for secondary (medium) tickmarks (minimum 1).\n * When undefined, no secondary tickmarks are shown.\n * @availableWhen hasScale==true\n */\n @property({type: Number}) secondaryTickmarkInterval?: number = undefined;\n /**\n * Interval for tertiary (shortest) tickmarks (minimum 1).\n * When undefined, no tertiary tickmarks are shown.\n * @availableWhen hasScale==true\n */\n @property({type: Number}) tertiaryTickmarkInterval?: number = undefined;\n /** Scale display mode: regular or condensed (shorter ticks) */\n @property({type: String}) scaleType: ScaleType = ScaleType.regular;\n /**\n * Frame style: regular (4px gap for all), flat (main tickmarks touch edge), framed, or instrument\n * @availableWhen hasScale==true && mainTickmarks!=undefined\n */\n @property({type: String}) frameStyle: FrameStyle = FrameStyle.regular;\n /**\n * Border radius position based on component layout\n * @availableWhen hasBar==true\n */\n @property({type: String})\n borderRadiusPosition?: BorderRadiusPosition = undefined;\n\n /**\n * When true, the component is used inside an instrument (e.g., gauge-trend).\n * In this mode, only label font size responds to .obc-component-size-* CSS classes.\n * Border radius and bar thickness use explicit values or defaults, not CSS variables.\n * @default false\n */\n @property({type: Boolean})\n instrumentMode = false;\n\n /**\n * Explicit border radius value in pixels.\n * When instrumentMode=true, this value is used directly (defaults to 8px for regular, 4px for condensed).\n * When instrumentMode=false, this is ignored and border radius is read from CSS variable.\n * @availableWhen instrumentMode==true\n */\n @property({type: Number})\n borderRadius?: number = undefined;\n\n @state()\n private _computedBorderRadius?: number;\n\n private _borderRadiusObserver?: MutationObserver;\n\n // @ts-expect-error - Controller is used for side effects, not accessed directly\n private _borderRadiusResizeController = new ResizeController(this, {\n callback: () => {\n // Skip CSS variable reading in instrument mode\n if (!this.instrumentMode) {\n this._refreshBorderRadiusFromCssVar();\n }\n },\n });\n\n // Values\n /** Color priority: enhanced uses blue instrument colors for bar fill and setpoint */\n @property({type: String}) priority: Priority = Priority.regular;\n /**\n * Fill visualization mode: fill or tint\n * @availableWhen hasBar==true && value!=undefined\n */\n @property({type: String}) fillMode: FillMode = FillMode.fill;\n /**\n * Minimum fill value for tint mode (defaults to 0)\n * @availableWhen hasBar==true && value!=undefined\n */\n @property({type: Number}) fillMin?: number = undefined;\n /**\n * Maximum fill value for tint mode (defaults to value)\n * @availableWhen hasBar==true && value!=undefined\n */\n @property({type: Number}) fillMax?: number = undefined;\n /** Current value (bar fill level) */\n @property({type: Number}) value?: number = undefined;\n\n /** Instrument state (affects colors and some marker behavior) */\n @property({type: String}) state: InstrumentState = InstrumentState.active;\n\n // Advice\n /**\n * Advice overlay positioning: center (in bar), inner (covers minor ticks), outer (no overlap)\n * @availableWhen hasBar==true && advices!=undefined\n */\n @property({type: String}) advicePosition: AdvicePosition =\n AdvicePosition.inner;\n /**\n * Advice/alert overlays with state and positioning.\n * When undefined or empty, no advice shown.\n */\n @property({type: Array, attribute: false}) advices?: LinearAdvice[] = [];\n\n /**\n * When true, displays a dot indicator at the current value position.\n * The dot is rendered in the scale band, touching its inner edge (towards the chart).\n * This provides an alternative to bar fill for highlighting the current value.\n * @default false\n */\n @property({type: Boolean}) highlightCurrentValue = false;\n\n override render() {\n // When fixedAspectRatio is true, use scaleReferenceSize for the viewBox length.\n // This makes the SVG render at the \"design reference size\" and then scale\n // proportionally to fit the actual container via preserveAspectRatio=\"xMidYMid meet\".\n // The _scale CSS variable counter-scales text labels to maintain constant visual size.\n const effectiveLength = this.fixedAspectRatio\n ? this.scaleReferenceSize\n : this.width;\n\n // The parent chart component (chart-line-base) calculates and passes the correct\n // viewBox padding values when fixedAspectRatioScaling is enabled. The padding is\n // pre-scaled to: basePadding * scaleReferenceSize / referenceWidth\n // This ensures the visual padding matches the chart's Canvas padding at any aspect ratio.\n\n // console.debug(`[bar-horizontal] render:`, {\n // fixedAspectRatio: this.fixedAspectRatio,\n // width: this.width,\n // scaleReferenceSize: this.scaleReferenceSize,\n // effectiveLength,\n // scale: this._scale,\n // paddingLeft: this.paddingLeft,\n // paddingRight: this.paddingRight,\n // });\n\n const config: ExternalScaleConfig = {\n orientation: ExternalScaleOrientation.horizontal,\n side: this.side,\n length: effectiveLength,\n paddingStart: this.paddingLeft,\n paddingEnd: this.paddingRight,\n minValue: this.minValue,\n maxValue: this.maxValue,\n hasScale: this.hasScale,\n labels: this.showLabels,\n hasBar: this.hasBar,\n scaleBackground: this.scaleBackground,\n barContainerStyle: this.barContainerStyle,\n barThickness: this.barThickness,\n tickThickness: this.tickThickness,\n labelThickness: this.labelThickness,\n borderRadius: this._getEffectiveBorderRadius(),\n mainTickmarks: this.mainTickmarks,\n primaryTickmarkInterval: this.primaryTickmarkInterval,\n secondaryTickmarkInterval: this.secondaryTickmarkInterval,\n tertiaryTickmarkInterval: this.tertiaryTickmarkInterval,\n scaleType: this.scaleType,\n frameStyle: this.frameStyle,\n borderRadiusPosition: this.borderRadiusPosition,\n priority: this.priority,\n setpointOverride: this.setpointOverride,\n fillMode: this.fillMode,\n fillMin: this.fillMin,\n fillMax: this.fillMax,\n value: this.value,\n setpoint: this.setpoint,\n newSetpoint: this.newSetpoint,\n atSetpoint: this.atSetpoint,\n autoAtSetpoint: this.autoAtSetpoint,\n autoAtSetpointDeadband: this.autoAtSetpointDeadband,\n setpointAtZeroDeadband: this.setpointAtZeroDeadband,\n animateSetpoint: this.animateSetpoint,\n departingNewSetpoint: this.departingNewSetpoint,\n state: this.state,\n touching: this.touching,\n advicePosition: this.advicePosition,\n advices: this.advices as ExternalScaleAdvice[],\n fixedAspectRatio: this.fixedAspectRatio,\n instrumentMode: this.instrumentMode,\n highlightCurrentValue: this.highlightCurrentValue,\n };\n\n const layout = computeExternalScaleLayout(\n toExternalScaleLayoutConfig(config)\n );\n\n const parts = renderExternalScale(config);\n\n const viewBox = computeExternalScaleViewBox(\n {orientation: config.orientation, length: effectiveLength},\n layout\n );\n const preserveAspectRatio = this.fixedAspectRatio\n ? 'xMidYMid meet'\n : 'none';\n\n return html`\n <svg\n width=${this.fixedAspectRatio ? '100%' : `${this.width}px`}\n height=${this.fixedAspectRatio ? '100%' : `${viewBox.height}px`}\n viewBox=\"${viewBox.x} ${viewBox.y} ${viewBox.width} ${viewBox.height}\"\n preserveAspectRatio=\"${preserveAspectRatio}\"\n style=\"--scale: ${this.fixedAspectRatio ? this._scale : 1};\"\n part=\"svg\"\n >\n ${parts.barContainer} ${parts.barFill} ${parts.scaleBackground}\n ${parts.tickmarks} ${parts.labels} ${parts.adviceOverlays}\n ${parts.currentValueDot} ${parts.setpoint}\n </svg>\n `;\n }\n\n override updated(changed: PropertyValues) {\n super.updated(changed);\n\n if (changed.has('scaleType')) {\n this._refreshBorderRadiusFromCssVar();\n }\n\n // Update host styles when fixedAspectRatio changes\n if (changed.has('fixedAspectRatio')) {\n if (this.fixedAspectRatio) {\n this._applyFixedAspectRatioStyles();\n // Force initial scale calculation based on current size\n this._updateScaleFromCurrentSize();\n } else {\n this._removeFixedAspectRatioStyles();\n this._scale = 1;\n }\n }\n\n // Also recalculate scale when scaleReferenceSize changes\n if (changed.has('scaleReferenceSize') && this.fixedAspectRatio) {\n this._updateScaleFromCurrentSize();\n }\n\n // Report dimensions to parent chart when layout-affecting properties change.\n // In fixedAspectRatio mode, resize events also trigger reportDimensions() via ResizeController.\n // In regular mode, we report on every update to keep parent chart in sync.\n // Layout-affecting properties change the computed thickness and must notify the parent\n // even in fixedAspectRatio mode to keep chart padding accurate.\n const layoutChanged =\n changed.has('side') ||\n changed.has('showLabels') ||\n changed.has('hasScale') ||\n changed.has('hasBar') ||\n changed.has('barThickness') ||\n changed.has('tickThickness') ||\n changed.has('labelThickness') ||\n changed.has('scaleType') ||\n changed.has('borderRadiusPosition') ||\n changed.has('borderRadius') ||\n changed.has('advices') ||\n changed.has('advicePosition');\n\n if (!this.fixedAspectRatio || layoutChanged) {\n this.reportDimensions();\n }\n }\n\n /**\n * Report scale dimensions to parent chart component.\n * When fixedAspectRatio=true, reports the actual visual (scaled) thickness\n * so the chart can correctly reserve space for the scale.\n * When fixedAspectRatio=false, reports the base/unscaled thickness.\n */\n private reportDimensions() {\n const effectiveBarThickness = computeExternalScaleEffectiveBarThickness({\n hasBar: this.hasBar,\n barThickness: this.barThickness,\n borderRadius: this._getEffectiveBorderRadius(),\n scaleType: this.scaleType,\n });\n\n // Use scaleReferenceSize for layout calculation when in fixedAspectRatio mode\n // This ensures consistent layout dimensions based on the design reference size\n const effectiveLength = this.fixedAspectRatio\n ? this.scaleReferenceSize\n : this.width;\n\n const baseDimensions = computeScaleDimensionsForReport({\n orientation: ExternalScaleOrientation.horizontal,\n side: this.side,\n hasBar: this.hasBar,\n hasScale: this.hasScale,\n labels: this.showLabels,\n barThickness: effectiveBarThickness,\n tickThickness: this.tickThickness,\n labelThickness: this.labelThickness,\n length: effectiveLength,\n scaleType: this.scaleType,\n advicePosition: this.advicePosition,\n hasAdvice: !!this.advices && this.advices.length > 0,\n });\n\n // When fixedAspectRatio=true, the SVG scales proportionally via preserveAspectRatio=\"meet\".\n // The visual thickness = baseThickness × scale, where scale = containerSize / scaleReferenceSize.\n // Report the actual visual thickness so the chart can reserve the correct space.\n const dimensions = this.fixedAspectRatio\n ? {\n ...baseDimensions,\n thickness: Math.round(baseDimensions.thickness * this._scale),\n }\n : baseDimensions;\n\n // console.debug(`[bar-horizontal] reportDimensions:`, {\n // fixedAspectRatio: this.fixedAspectRatio,\n // side: dimensions.side,\n // thickness: dimensions.thickness,\n // scale: this._scale,\n // width: this.width,\n // scaleReferenceSize: this.scaleReferenceSize,\n // effectiveLength,\n // hasBar: this.hasBar,\n // hasScale: this.hasScale,\n // showLabels: this.showLabels,\n // barThickness: this.barThickness,\n // tickThickness: this.tickThickness,\n // labelThickness: this.labelThickness,\n // });\n\n this.dispatchEvent(\n new CustomEvent('scale-dimensions-changed', {\n detail: dimensions,\n bubbles: true,\n composed: true,\n })\n );\n }\n\n protected override createRenderRoot() {\n return this;\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n // Only read from CSS variable and observe changes when not in instrument mode\n if (!this.instrumentMode) {\n this._refreshBorderRadiusFromCssVar();\n this._startBorderRadiusObserver();\n }\n\n // Ensure the element fills its container when in fixedAspectRatio mode\n // Custom elements are display:inline by default, which doesn't work for percentage-based sizing\n if (this.fixedAspectRatio) {\n this._applyFixedAspectRatioStyles();\n }\n }\n\n override disconnectedCallback(): void {\n this._borderRadiusObserver?.disconnect();\n this._borderRadiusObserver = undefined;\n super.disconnectedCallback();\n }\n\n private _startBorderRadiusObserver(): void {\n this._borderRadiusObserver?.disconnect();\n\n this._borderRadiusObserver = startExternalScaleBorderRadiusObserver(\n this,\n () => this._refreshBorderRadiusFromCssVar()\n );\n }\n\n /**\n * Apply CSS styles needed for fixedAspectRatio mode.\n * Custom elements are display:inline by default, which doesn't work with percentage-based sizing.\n * We need display:block and width:100% to fill the slot container.\n */\n private _applyFixedAspectRatioStyles(): void {\n this.style.display = 'block';\n this.style.width = '100%';\n this.style.height = 'auto';\n }\n\n /**\n * Remove fixed aspect ratio styles when switching back to pixel mode.\n */\n private _removeFixedAspectRatioStyles(): void {\n this.style.display = '';\n this.style.width = '';\n this.style.height = '';\n }\n\n /**\n * Calculate scale based on current element size.\n * Called when fixedAspectRatio is enabled or scaleReferenceSize changes.\n */\n private _updateScaleFromCurrentSize(): void {\n // Use requestAnimationFrame to ensure layout is complete\n requestAnimationFrame(() => {\n const containerWidth = this.clientWidth;\n if (containerWidth > 0) {\n this._scale = computeFixedAspectRatioScale({\n orientation: ExternalScaleOrientation.horizontal,\n containerMainAxisSize: containerWidth,\n scaleReferenceSize: this.scaleReferenceSize,\n });\n this.requestUpdate();\n // Report updated dimensions to parent (matches pattern in ResizeController and _refreshBorderRadiusFromCssVar)\n this.reportDimensions();\n }\n });\n }\n\n private _refreshBorderRadiusFromCssVar(): void {\n // Skip CSS variable reading in instrument mode\n if (this.instrumentMode) return;\n\n const next = readExternalScaleBorderRadiusPx(this, this.scaleType);\n\n if (this._computedBorderRadius !== next) {\n this._computedBorderRadius = next;\n }\n\n // In fixed-aspect-ratio mode, recompute scale when border radius changes\n // (border radius affects effective bar thickness and therefore viewBox)\n if (this.fixedAspectRatio) {\n const rect = this.getBoundingClientRect();\n if (rect.width > 0) {\n this._scale = computeFixedAspectRatioScale({\n orientation: ExternalScaleOrientation.horizontal,\n containerMainAxisSize: rect.width,\n scaleReferenceSize: this.scaleReferenceSize,\n });\n // Report updated dimensions\n this.reportDimensions();\n }\n }\n }\n\n /**\n * Get the effective border radius to use.\n * In instrument mode: use explicit borderRadius prop or default based on scaleType.\n * In normal mode: use CSS variable computed value.\n */\n private _getEffectiveBorderRadius(): number {\n if (this.instrumentMode) {\n // In instrument mode, use explicit value or default\n if (this.borderRadius !== undefined) {\n return this.borderRadius;\n }\n // Default: 8px for regular, 4px for condensed\n return this.scaleType === ScaleType.condensed ? 4 : 8;\n }\n // Normal mode: use CSS variable computed value\n return (\n this._computedBorderRadius ??\n (this.scaleType === ScaleType.condensed ? 4 : 8)\n );\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-bar-horizontal': ObcBarHorizontal;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAoEO,IAAM,mBAAN,cAA+B,cAAc,YAAY;AAAA,EAC9D,iBAAiB;AACnB,CAAC,EAAE;AAAA,EAFI,cAAA;AAAA,UAAA,GAAA,SAAA;AAIqB,SAAA,WAAW;AAEX,SAAA,WAAW;AAMX,SAAA,QAAQ;AAGR,SAAA,cACxB,iBAAiB;AAGO,SAAA,eACxB,iBAAiB;AAGO,SAAA,OAA0B,kBAAkB;AAQtE,SAAA,mBAAmB;AAUnB,SAAA,qBAAqB;AAGrB,SAAQ,SAAS;AAIjB,SAAQ,oBAAoB,IAAI,iBAAiB,MAAM;AAAA,MACrD,UAAU,CAAC,YAAY;AACrB,YAAI,CAAC,KAAK,iBAAkB;AAE5B,cAAM,QAAQ,QAAQ,CAAC;AACvB,YAAI,CAAC,MAAO;AAIZ,cAAM,wBAAwB,MAAM,YAAY;AAEhD,aAAK,SAAS,6BAA6B;AAAA,UACzC,aAAa,yBAAyB;AAAA,UACtC;AAAA,UACA,oBAAoB,KAAK;AAAA,QAAA,CAC1B;AAWD,aAAK,iBAAA;AAAA,MACP;AAAA,IAAA,CACD;AAI4C,SAAA,WAAW;AACX,SAAA,aAAa;AAE/B,SAAA,SAAS;AAGpC,SAAA,kBAAkB;AAQlB,SAAA,oBAAwC;AAKd,SAAA,eAAe;AAKf,SAAA,gBAAgB;AA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AA,YAAA,CAAA;AAKA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GA9Lb,iBA8Le,WAAA,YAAA,CAAA;AAKA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAnMb,iBAmMe,WAAA,WAAA,CAAA;AAKA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAxMb,iBAwMe,WAAA,WAAA,CAAA;AAEA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GA1Mb,iBA0Me,WAAA,SAAA,CAAA;AAGA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GA7Mb,iBA6Me,WAAA,SAAA,CAAA;AAOA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GApNb,iBAoNe,WAAA,kBAAA,CAAA;AAMiB,gBAAA;AAAA,EAA1C,SAAS,EAAC,MAAM,OAAO,WAAW,OAAM;AAAA,GA1N9B,iBA0NgC,WAAA,WAAA,CAAA;AAQhB,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,QAAA,CAAQ;AAAA,GAlOd,iBAkOgB,WAAA,yBAAA,CAAA;AAlOhB,mBAAN,gBAAA;AAAA,EADN,cAAc,oBAAoB;AAAA,GACtB,gBAAA;"}
|
|
1
|
+
{"version":3,"file":"bar-horizontal.js","sources":["../../../src/building-blocks/bar-horizontal/bar-horizontal.ts"],"sourcesContent":["import {LitElement, html} from 'lit';\nimport {property, state} from 'lit/decorators.js';\nimport type {PropertyValues} from 'lit';\nimport {customElement} from '../../decorator.js';\nimport {ResizeController} from '@lit-labs/observers/resize-controller.js';\nimport {CHART_DIMENSIONS} from '../../charthelpers/constants.js';\nimport {\n InstrumentState,\n FrameStyle,\n BorderRadiusPosition,\n Priority,\n} from '../../navigation-instruments/types.js';\nimport type {LinearAdvice} from '../instrument-linear/advice.js';\nimport type {\n ExternalScaleAdvice,\n ExternalScaleConfig,\n} from '../external-scale/external-scale.js';\nimport {\n computeExternalScaleViewBox,\n computeFixedAspectRatioScale,\n computeExternalScaleLayout,\n renderExternalScale,\n toExternalScaleLayoutConfig,\n computeScaleDimensionsForReport,\n computeExternalScaleEffectiveBarThickness,\n readExternalScaleBorderRadiusPx,\n startExternalScaleBorderRadiusObserver,\n ScaleType,\n FillMode,\n AdvicePosition,\n BarContainerStyle,\n ExternalScaleOrientation,\n ExternalScaleSide,\n} from '../external-scale/external-scale.js';\nimport {SetpointMixin} from '../../svghelpers/setpoint-mixin.js';\n\n// Re-export shared enums for convenience\nexport {\n ScaleType,\n FillMode,\n AdvicePosition,\n FrameStyle,\n BorderRadiusPosition,\n InstrumentState,\n Priority,\n BarContainerStyle,\n ExternalScaleSide,\n};\n\n/**\n * Horizontal SVG bar + external scale.\n *\n * This is a thin web-component wrapper around the pure SVG building-block renderer in `external-scale.ts`.\n *\n * It sets up the outer `<svg>`/`viewBox` for a horizontal scale and delegates rendering/layout to:\n * - `computeExternalScaleLayout(...)`\n * - `renderExternalScale(config)`\n *\n * For renderer documentation see: **Building Blocks/External Scale**.\n *\n * For more test cases (Auto at-setpoint detection, Manual at-setpoint control, Deadband tuning and Zero snap behavior) see: **Bars and Graphs/Bar Vertical**.\n *\n * Set `priority` to `Priority.enhanced` to use the blue/enhanced color palette\n * for bar fill and setpoint instead of the default gray/regular palette\n * (default: `Priority.regular`).\n *\n * @fires scale-dimensions-changed {CustomEvent} Fired when the scale's computed layout thickness changes; a parent chart listens for this to reserve space for the scale. Bubbles and is composed.\n * @beta\n */\n@customElement('obc-bar-horizontal')\nexport class ObcBarHorizontal extends SetpointMixin(LitElement, {\n defaultDeadband: 1,\n}) {\n /** Minimum scale value (manual mode) */\n @property({type: Number}) minValue = 0;\n /** Maximum scale value (manual mode) */\n @property({type: Number}) maxValue = 100;\n\n /**\n * Total width in pixels (including padding bands)\n * @availableWhen fixedAspectRatio==false\n */\n @property({type: Number}) width = 320;\n\n /** Padding left of the drawing area */\n @property({type: Number}) paddingLeft: number =\n CHART_DIMENSIONS.CANVAS_PADDING;\n\n /** Padding right of the drawing area */\n @property({type: Number}) paddingRight: number =\n CHART_DIMENSIONS.CANVAS_PADDING;\n\n /** Which side this scale lives on */\n @property({type: String}) side: ExternalScaleSide = ExternalScaleSide.bottom;\n\n /**\n * When true, freezes all internal calculations and scales the entire component\n * proportionally (like CSS transform:scale), except label font-size remains constant.\n * When false (default), dimensions react to component properties.\n */\n @property({type: Boolean})\n fixedAspectRatio = false;\n\n /**\n * Reference size for proportional scaling when fixedAspectRatio is true.\n * At this width, the scale renders at native 1:1 (matches Figma design).\n * Above this width, the scale grows proportionally; below, it shrinks.\n * @default 384\n * @availableWhen fixedAspectRatio==true\n */\n @property({type: Number})\n scaleReferenceSize = 384;\n\n @state()\n private _scale = 1;\n\n // ResizeController automatically subscribes/unsubscribes based on component lifecycle\n // @ts-expect-error - Controller is used for side effects, not accessed directly\n private _resizeController = new ResizeController(this, {\n callback: (entries) => {\n if (!this.fixedAspectRatio) return;\n\n const entry = entries[0];\n if (!entry) return;\n\n // Use the centralized function that computes scale based on reference size\n // For horizontal scales, compare container width to reference size\n const containerMainAxisSize = entry.contentRect.width;\n\n this._scale = computeFixedAspectRatioScale({\n orientation: ExternalScaleOrientation.horizontal,\n containerMainAxisSize,\n scaleReferenceSize: this.scaleReferenceSize,\n });\n\n // console.debug(`[bar-horizontal] ResizeController:`, {\n // fixedAspectRatio: this.fixedAspectRatio,\n // containerWidth: containerMainAxisSize,\n // scaleReferenceSize: this.scaleReferenceSize,\n // computedScale: this._scale,\n // width: this.width,\n // });\n\n // Report scaled dimensions to parent chart\n this.reportDimensions();\n },\n });\n\n // Bands (thickness)\n /** Show scale tickmarks */\n @property({type: Boolean, attribute: false}) hasScale = true;\n @property({type: Boolean, attribute: false}) showLabels = true;\n /** Show bar */\n @property({type: Boolean}) hasBar = false;\n /** Show background behind the scale tickmarks. */\n @property({type: Boolean})\n scaleBackground = false;\n /**\n * Bar container background style.\n * When undefined, defaults based on scaleBackground.\n * Set explicitly to override: 'primary' (lighter) or 'secondary' (gray).\n * @availableWhen hasBar==true\n */\n @property({type: String})\n barContainerStyle?: BarContainerStyle = undefined;\n /**\n * Bar/fill thickness in pixels\n * @availableWhen hasBar==true\n */\n @property({type: Number}) barThickness = 24;\n /**\n * Tickmark band thickness in pixels.\n * @availableWhen hasScale==true\n */\n @property({type: Number}) tickThickness = 24;\n /**\n * Label band thickness in pixels.\n * @availableWhen showLabels==true\n */\n @property({type: Number}) labelThickness = 60;\n\n // Tick configuration\n /**\n * Array of values for main tickmarks. When undefined, no main tickmarks shown.\n * When empty array [], defaults to [minValue, 0, maxValue].\n * @availableWhen hasScale==true\n */\n @property({type: Array, attribute: false}) mainTickmarks?: number[] = [];\n /**\n * Interval for primary (longest) tickmarks with labels (minimum 1).\n * When undefined, no primary tickmarks are shown.\n * @availableWhen hasScale==true || showLabels==true\n */\n @property({type: Number}) primaryTickmarkInterval?: number = undefined;\n /**\n * Interval for secondary (medium) tickmarks (minimum 1).\n * When undefined, no secondary tickmarks are shown.\n * @availableWhen hasScale==true\n */\n @property({type: Number}) secondaryTickmarkInterval?: number = undefined;\n /**\n * Interval for tertiary (shortest) tickmarks (minimum 1).\n * When undefined, no tertiary tickmarks are shown.\n * @availableWhen hasScale==true\n */\n @property({type: Number}) tertiaryTickmarkInterval?: number = undefined;\n /** Scale display mode: regular or condensed (shorter ticks) */\n @property({type: String}) scaleType: ScaleType = ScaleType.regular;\n /**\n * Frame style: regular (4px gap for all), flat (main tickmarks touch edge), framed, or instrument\n * @availableWhen hasScale==true && mainTickmarks!=undefined\n */\n @property({type: String}) frameStyle: FrameStyle = FrameStyle.regular;\n /**\n * Border radius position based on component layout\n * @availableWhen hasBar==true\n */\n @property({type: String})\n borderRadiusPosition?: BorderRadiusPosition = undefined;\n\n /**\n * When true, the component is used inside an instrument (e.g., gauge-trend).\n * In this mode, only label font size responds to .obc-component-size-* CSS classes.\n * Border radius and bar thickness use explicit values or defaults, not CSS variables.\n * @default false\n */\n @property({type: Boolean})\n instrumentMode = false;\n\n /**\n * Explicit border radius value in pixels.\n * When instrumentMode=true, this value is used directly (defaults to 8px for regular, 4px for condensed).\n * When instrumentMode=false, this is ignored and border radius is read from CSS variable.\n * @availableWhen instrumentMode==true\n */\n @property({type: Number})\n borderRadius?: number = undefined;\n\n @state()\n private _computedBorderRadius?: number;\n\n private _borderRadiusObserver?: MutationObserver;\n\n // @ts-expect-error - Controller is used for side effects, not accessed directly\n private _borderRadiusResizeController = new ResizeController(this, {\n callback: () => {\n // Skip CSS variable reading in instrument mode\n if (!this.instrumentMode) {\n this._refreshBorderRadiusFromCssVar();\n }\n },\n });\n\n // Values\n /** Color priority: enhanced uses blue instrument colors for bar fill and setpoint */\n @property({type: String}) priority: Priority = Priority.regular;\n /**\n * Fill visualization mode: fill or tint\n * @availableWhen hasBar==true && value!=undefined\n */\n @property({type: String}) fillMode: FillMode = FillMode.fill;\n /**\n * Minimum fill value for tint mode (defaults to 0)\n * @availableWhen hasBar==true && value!=undefined\n */\n @property({type: Number}) fillMin?: number = undefined;\n /**\n * Maximum fill value for tint mode (defaults to value)\n * @availableWhen hasBar==true && value!=undefined\n */\n @property({type: Number}) fillMax?: number = undefined;\n /** Current value (bar fill level) */\n @property({type: Number}) value?: number = undefined;\n\n /** Instrument state (affects colors and some marker behavior) */\n @property({type: String}) state: InstrumentState = InstrumentState.active;\n\n // Advice\n /**\n * Advice overlay positioning: center (in bar), inner (covers minor ticks), outer (no overlap)\n * @availableWhen hasBar==true && advices!=undefined\n */\n @property({type: String}) advicePosition: AdvicePosition =\n AdvicePosition.inner;\n /**\n * Advice/alert overlays with state and positioning.\n * When undefined or empty, no advice shown.\n */\n @property({type: Array, attribute: false}) advices?: LinearAdvice[] = [];\n\n /**\n * When true, displays a dot indicator at the current value position.\n * The dot is rendered in the scale band, touching its inner edge (towards the chart).\n * This provides an alternative to bar fill for highlighting the current value.\n * @default false\n */\n @property({type: Boolean}) highlightCurrentValue = false;\n\n override render() {\n // When fixedAspectRatio is true, use scaleReferenceSize for the viewBox length.\n // This makes the SVG render at the \"design reference size\" and then scale\n // proportionally to fit the actual container via preserveAspectRatio=\"xMidYMid meet\".\n // The _scale CSS variable counter-scales text labels to maintain constant visual size.\n const effectiveLength = this.fixedAspectRatio\n ? this.scaleReferenceSize\n : this.width;\n\n // The parent chart component (chart-line-base) calculates and passes the correct\n // viewBox padding values when fixedAspectRatioScaling is enabled. The padding is\n // pre-scaled to: basePadding * scaleReferenceSize / referenceWidth\n // This ensures the visual padding matches the chart's Canvas padding at any aspect ratio.\n\n // console.debug(`[bar-horizontal] render:`, {\n // fixedAspectRatio: this.fixedAspectRatio,\n // width: this.width,\n // scaleReferenceSize: this.scaleReferenceSize,\n // effectiveLength,\n // scale: this._scale,\n // paddingLeft: this.paddingLeft,\n // paddingRight: this.paddingRight,\n // });\n\n const config: ExternalScaleConfig = {\n orientation: ExternalScaleOrientation.horizontal,\n side: this.side,\n length: effectiveLength,\n paddingStart: this.paddingLeft,\n paddingEnd: this.paddingRight,\n minValue: this.minValue,\n maxValue: this.maxValue,\n hasScale: this.hasScale,\n labels: this.showLabels,\n hasBar: this.hasBar,\n scaleBackground: this.scaleBackground,\n barContainerStyle: this.barContainerStyle,\n barThickness: this.barThickness,\n tickThickness: this.tickThickness,\n labelThickness: this.labelThickness,\n borderRadius: this._getEffectiveBorderRadius(),\n mainTickmarks: this.mainTickmarks,\n primaryTickmarkInterval: this.primaryTickmarkInterval,\n secondaryTickmarkInterval: this.secondaryTickmarkInterval,\n tertiaryTickmarkInterval: this.tertiaryTickmarkInterval,\n scaleType: this.scaleType,\n frameStyle: this.frameStyle,\n borderRadiusPosition: this.borderRadiusPosition,\n priority: this.priority,\n setpointOverride: this.setpointOverride,\n fillMode: this.fillMode,\n fillMin: this.fillMin,\n fillMax: this.fillMax,\n value: this.value,\n setpoint: this.setpoint,\n newSetpoint: this.newSetpoint,\n atSetpoint: this.atSetpoint,\n autoAtSetpoint: this.autoAtSetpoint,\n autoAtSetpointDeadband: this.autoAtSetpointDeadband,\n setpointAtZeroDeadband: this.setpointAtZeroDeadband,\n animateSetpoint: this.animateSetpoint,\n departingNewSetpoint: this.departingNewSetpoint,\n state: this.state,\n touching: this.touching,\n advicePosition: this.advicePosition,\n advices: this.advices as ExternalScaleAdvice[],\n fixedAspectRatio: this.fixedAspectRatio,\n instrumentMode: this.instrumentMode,\n highlightCurrentValue: this.highlightCurrentValue,\n };\n\n const layout = computeExternalScaleLayout(\n toExternalScaleLayoutConfig(config)\n );\n\n const parts = renderExternalScale(config);\n\n const viewBox = computeExternalScaleViewBox(\n {orientation: config.orientation, length: effectiveLength},\n layout\n );\n const preserveAspectRatio = this.fixedAspectRatio\n ? 'xMidYMid meet'\n : 'none';\n\n return html`\n <svg\n width=${this.fixedAspectRatio ? '100%' : `${this.width}px`}\n height=${this.fixedAspectRatio ? '100%' : `${viewBox.height}px`}\n viewBox=\"${viewBox.x} ${viewBox.y} ${viewBox.width} ${viewBox.height}\"\n preserveAspectRatio=\"${preserveAspectRatio}\"\n style=\"--scale: ${this.fixedAspectRatio ? this._scale : 1};\"\n part=\"svg\"\n >\n ${parts.barContainer} ${parts.barFill} ${parts.scaleBackground}\n ${parts.tickmarks} ${parts.labels} ${parts.adviceOverlays}\n ${parts.currentValueDot} ${parts.setpoint}\n </svg>\n `;\n }\n\n override updated(changed: PropertyValues) {\n super.updated(changed);\n\n if (changed.has('scaleType')) {\n this._refreshBorderRadiusFromCssVar();\n }\n\n // Update host styles when fixedAspectRatio changes\n if (changed.has('fixedAspectRatio')) {\n if (this.fixedAspectRatio) {\n this._applyFixedAspectRatioStyles();\n // Force initial scale calculation based on current size\n this._updateScaleFromCurrentSize();\n } else {\n this._removeFixedAspectRatioStyles();\n this._scale = 1;\n }\n }\n\n // Also recalculate scale when scaleReferenceSize changes\n if (changed.has('scaleReferenceSize') && this.fixedAspectRatio) {\n this._updateScaleFromCurrentSize();\n }\n\n // Report dimensions to parent chart when layout-affecting properties change.\n // In fixedAspectRatio mode, resize events also trigger reportDimensions() via ResizeController.\n // In regular mode, we report on every update to keep parent chart in sync.\n // Layout-affecting properties change the computed thickness and must notify the parent\n // even in fixedAspectRatio mode to keep chart padding accurate.\n const layoutChanged =\n changed.has('side') ||\n changed.has('showLabels') ||\n changed.has('hasScale') ||\n changed.has('hasBar') ||\n changed.has('barThickness') ||\n changed.has('tickThickness') ||\n changed.has('labelThickness') ||\n changed.has('scaleType') ||\n changed.has('borderRadiusPosition') ||\n changed.has('borderRadius') ||\n changed.has('advices') ||\n changed.has('advicePosition');\n\n if (!this.fixedAspectRatio || layoutChanged) {\n this.reportDimensions();\n }\n }\n\n /**\n * Report scale dimensions to parent chart component.\n * When fixedAspectRatio=true, reports the actual visual (scaled) thickness\n * so the chart can correctly reserve space for the scale.\n * When fixedAspectRatio=false, reports the base/unscaled thickness.\n */\n private reportDimensions() {\n const effectiveBarThickness = computeExternalScaleEffectiveBarThickness({\n hasBar: this.hasBar,\n barThickness: this.barThickness,\n borderRadius: this._getEffectiveBorderRadius(),\n scaleType: this.scaleType,\n });\n\n // Use scaleReferenceSize for layout calculation when in fixedAspectRatio mode\n // This ensures consistent layout dimensions based on the design reference size\n const effectiveLength = this.fixedAspectRatio\n ? this.scaleReferenceSize\n : this.width;\n\n const baseDimensions = computeScaleDimensionsForReport({\n orientation: ExternalScaleOrientation.horizontal,\n side: this.side,\n hasBar: this.hasBar,\n hasScale: this.hasScale,\n labels: this.showLabels,\n barThickness: effectiveBarThickness,\n tickThickness: this.tickThickness,\n labelThickness: this.labelThickness,\n length: effectiveLength,\n scaleType: this.scaleType,\n advicePosition: this.advicePosition,\n hasAdvice: !!this.advices && this.advices.length > 0,\n });\n\n // When fixedAspectRatio=true, the SVG scales proportionally via preserveAspectRatio=\"meet\".\n // The visual thickness = baseThickness × scale, where scale = containerSize / scaleReferenceSize.\n // Report the actual visual thickness so the chart can reserve the correct space.\n const dimensions = this.fixedAspectRatio\n ? {\n ...baseDimensions,\n thickness: Math.round(baseDimensions.thickness * this._scale),\n }\n : baseDimensions;\n\n // console.debug(`[bar-horizontal] reportDimensions:`, {\n // fixedAspectRatio: this.fixedAspectRatio,\n // side: dimensions.side,\n // thickness: dimensions.thickness,\n // scale: this._scale,\n // width: this.width,\n // scaleReferenceSize: this.scaleReferenceSize,\n // effectiveLength,\n // hasBar: this.hasBar,\n // hasScale: this.hasScale,\n // showLabels: this.showLabels,\n // barThickness: this.barThickness,\n // tickThickness: this.tickThickness,\n // labelThickness: this.labelThickness,\n // });\n\n this.dispatchEvent(\n new CustomEvent('scale-dimensions-changed', {\n detail: dimensions,\n bubbles: true,\n composed: true,\n })\n );\n }\n\n protected override createRenderRoot() {\n return this;\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n // Only read from CSS variable and observe changes when not in instrument mode\n if (!this.instrumentMode) {\n this._refreshBorderRadiusFromCssVar();\n this._startBorderRadiusObserver();\n }\n\n // Ensure the element fills its container when in fixedAspectRatio mode\n // Custom elements are display:inline by default, which doesn't work for percentage-based sizing\n if (this.fixedAspectRatio) {\n this._applyFixedAspectRatioStyles();\n }\n }\n\n override disconnectedCallback(): void {\n this._borderRadiusObserver?.disconnect();\n this._borderRadiusObserver = undefined;\n super.disconnectedCallback();\n }\n\n private _startBorderRadiusObserver(): void {\n this._borderRadiusObserver?.disconnect();\n\n this._borderRadiusObserver = startExternalScaleBorderRadiusObserver(\n this,\n () => this._refreshBorderRadiusFromCssVar()\n );\n }\n\n /**\n * Apply CSS styles needed for fixedAspectRatio mode.\n * Custom elements are display:inline by default, which doesn't work with percentage-based sizing.\n * We need display:block and width:100% to fill the slot container.\n */\n private _applyFixedAspectRatioStyles(): void {\n this.style.display = 'block';\n this.style.width = '100%';\n this.style.height = 'auto';\n }\n\n /**\n * Remove fixed aspect ratio styles when switching back to pixel mode.\n */\n private _removeFixedAspectRatioStyles(): void {\n this.style.display = '';\n this.style.width = '';\n this.style.height = '';\n }\n\n /**\n * Calculate scale based on current element size.\n * Called when fixedAspectRatio is enabled or scaleReferenceSize changes.\n */\n private _updateScaleFromCurrentSize(): void {\n // Use requestAnimationFrame to ensure layout is complete\n requestAnimationFrame(() => {\n const containerWidth = this.clientWidth;\n if (containerWidth > 0) {\n this._scale = computeFixedAspectRatioScale({\n orientation: ExternalScaleOrientation.horizontal,\n containerMainAxisSize: containerWidth,\n scaleReferenceSize: this.scaleReferenceSize,\n });\n this.requestUpdate();\n // Report updated dimensions to parent (matches pattern in ResizeController and _refreshBorderRadiusFromCssVar)\n this.reportDimensions();\n }\n });\n }\n\n private _refreshBorderRadiusFromCssVar(): void {\n // Skip CSS variable reading in instrument mode\n if (this.instrumentMode) return;\n\n const next = readExternalScaleBorderRadiusPx(this, this.scaleType);\n\n if (this._computedBorderRadius !== next) {\n this._computedBorderRadius = next;\n }\n\n // In fixed-aspect-ratio mode, recompute scale when border radius changes\n // (border radius affects effective bar thickness and therefore viewBox)\n if (this.fixedAspectRatio) {\n const rect = this.getBoundingClientRect();\n if (rect.width > 0) {\n this._scale = computeFixedAspectRatioScale({\n orientation: ExternalScaleOrientation.horizontal,\n containerMainAxisSize: rect.width,\n scaleReferenceSize: this.scaleReferenceSize,\n });\n // Report updated dimensions\n this.reportDimensions();\n }\n }\n }\n\n /**\n * Get the effective border radius to use.\n * In instrument mode: use explicit borderRadius prop or default based on scaleType.\n * In normal mode: use CSS variable computed value.\n */\n private _getEffectiveBorderRadius(): number {\n if (this.instrumentMode) {\n // In instrument mode, use explicit value or default\n if (this.borderRadius !== undefined) {\n return this.borderRadius;\n }\n // Default: 8px for regular, 4px for condensed\n return this.scaleType === ScaleType.condensed ? 4 : 8;\n }\n // Normal mode: use CSS variable computed value\n return (\n this._computedBorderRadius ??\n (this.scaleType === ScaleType.condensed ? 4 : 8)\n );\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-bar-horizontal': ObcBarHorizontal;\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GA1Mb,iBA0Me,WAAA,SAAA,CAAA;AAGA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GA7Mb,iBA6Me,WAAA,SAAA,CAAA;AAOA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GApNb,iBAoNe,WAAA,kBAAA,CAAA;AAMiB,gBAAA;AAAA,EAA1C,SAAS,EAAC,MAAM,OAAO,WAAW,OAAM;AAAA,GA1N9B,iBA0NgC,WAAA,WAAA,CAAA;AAQhB,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,QAAA,CAAQ;AAAA,GAlOd,iBAkOgB,WAAA,yBAAA,CAAA;AAlOhB,mBAAN,gBAAA;AAAA,EADN,cAAc,oBAAoB;AAAA,GACtB,gBAAA;"}
|
|
@@ -18,6 +18,8 @@ declare const ObcBarVertical_base: (new (...args: any[]) => import('../../svghel
|
|
|
18
18
|
* Set `priority` to `Priority.enhanced` to use the blue/enhanced color palette
|
|
19
19
|
* for bar fill and setpoint instead of the default gray/regular palette
|
|
20
20
|
* (default: `Priority.regular`).
|
|
21
|
+
*
|
|
22
|
+
* @fires scale-dimensions-changed {CustomEvent} Fired when the scale's computed layout thickness changes; a parent chart listens for this to reserve space for the scale. Bubbles and is composed.
|
|
21
23
|
* @beta
|
|
22
24
|
*/
|
|
23
25
|
export declare class ObcBarVertical extends ObcBarVertical_base {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bar-vertical.d.ts","sourceRoot":"","sources":["../../../src/building-blocks/bar-vertical/bar-vertical.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAO,MAAM,KAAK,CAAC;AAErC,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,KAAK,CAAC;AAIxC,OAAO,EACL,eAAe,EACf,UAAU,EACV,oBAAoB,EACpB,QAAQ,EACT,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,gCAAgC,CAAC;AAKjE,OAAO,EAUL,SAAS,EACT,QAAQ,EACR,cAAc,EACd,iBAAiB,EAEjB,iBAAiB,EAClB,MAAM,qCAAqC,CAAC;AAI7C,OAAO,EACL,SAAS,EACT,QAAQ,EACR,cAAc,EACd,UAAU,EACV,oBAAoB,EACpB,eAAe,EACf,QAAQ,EACR,iBAAiB,EACjB,iBAAiB,GAClB,CAAC;;AAEF
|
|
1
|
+
{"version":3,"file":"bar-vertical.d.ts","sourceRoot":"","sources":["../../../src/building-blocks/bar-vertical/bar-vertical.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAO,MAAM,KAAK,CAAC;AAErC,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,KAAK,CAAC;AAIxC,OAAO,EACL,eAAe,EACf,UAAU,EACV,oBAAoB,EACpB,QAAQ,EACT,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,gCAAgC,CAAC;AAKjE,OAAO,EAUL,SAAS,EACT,QAAQ,EACR,cAAc,EACd,iBAAiB,EAEjB,iBAAiB,EAClB,MAAM,qCAAqC,CAAC;AAI7C,OAAO,EACL,SAAS,EACT,QAAQ,EACR,cAAc,EACd,UAAU,EACV,oBAAoB,EACpB,eAAe,EACf,QAAQ,EACR,iBAAiB,EACjB,iBAAiB,GAClB,CAAC;;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,qBACa,cAAe,SAAQ,mBAElC;IACA,wCAAwC;IACd,QAAQ,SAAK;IACvC,wCAAwC;IACd,QAAQ,SAAO;IAEzC,uDAAuD;IAC7B,MAAM,SAAO;IAEvC,qCAAqC;IACX,UAAU,EAAE,MAAM,CACV;IAElC,qCAAqC;IACX,aAAa,EAAE,MAAM,CACb;IAElC,qCAAqC;IACX,IAAI,EAAE,iBAAiB,CAA2B;IAE5E;;;;OAIG;IAEH,gBAAgB,UAAS;IAEzB;;;;;;OAMG;IAEH,kBAAkB,SAAO;IAGzB,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