@oicl/openbridge-webcomponents 2.0.0-next.45 → 2.0.0-next.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/bundle/openbridge-webcomponents.bundle.js +14869 -14889
  2. package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
  3. package/custom-elements.json +74 -81
  4. package/dist/components/badge/badge.css.js +15 -15
  5. package/dist/navigation-instruments/compass/compass.d.ts +3 -3
  6. package/dist/navigation-instruments/compass/compass.d.ts.map +1 -1
  7. package/dist/navigation-instruments/compass/compass.js +3 -3
  8. package/dist/navigation-instruments/compass/compass.js.map +1 -1
  9. package/dist/navigation-instruments/compass-indicator/compass-indicator.d.ts +12 -0
  10. package/dist/navigation-instruments/compass-indicator/compass-indicator.d.ts.map +1 -1
  11. package/dist/navigation-instruments/compass-indicator/compass-indicator.js +9 -1
  12. package/dist/navigation-instruments/compass-indicator/compass-indicator.js.map +1 -1
  13. package/dist/navigation-instruments/velocity-projection-plot/velocity-projection-plot.d.ts +4 -4
  14. package/dist/navigation-instruments/velocity-projection-plot/velocity-projection-plot.d.ts.map +1 -1
  15. package/dist/navigation-instruments/velocity-projection-plot/velocity-projection-plot.js +15 -14
  16. package/dist/navigation-instruments/velocity-projection-plot/velocity-projection-plot.js.map +1 -1
  17. package/dist/navigation-instruments/watch/environment.d.ts +39 -1
  18. package/dist/navigation-instruments/watch/environment.d.ts.map +1 -1
  19. package/dist/navigation-instruments/watch/environment.js +71 -88
  20. package/dist/navigation-instruments/watch/environment.js.map +1 -1
  21. package/dist/navigation-instruments/watch/watch.d.ts +1 -1
  22. package/dist/navigation-instruments/watch/watch.d.ts.map +1 -1
  23. package/dist/navigation-instruments/watch/watch.js +4 -4
  24. package/dist/navigation-instruments/watch/watch.js.map +1 -1
  25. package/dist/navigation-instruments/wind/wind.d.ts +1 -1
  26. package/dist/navigation-instruments/wind/wind.d.ts.map +1 -1
  27. package/dist/navigation-instruments/wind/wind.js +3 -3
  28. package/dist/navigation-instruments/wind/wind.js.map +1 -1
  29. package/dist/navigation-instruments/wind-indicator/wind-indicator.d.ts +63 -9
  30. package/dist/navigation-instruments/wind-indicator/wind-indicator.d.ts.map +1 -1
  31. package/dist/navigation-instruments/wind-indicator/wind-indicator.js +57 -1995
  32. package/dist/navigation-instruments/wind-indicator/wind-indicator.js.map +1 -1
  33. package/dist/navigation-instruments/wind-propulsion/wind-propulsion.d.ts +1 -1
  34. package/dist/navigation-instruments/wind-propulsion/wind-propulsion.d.ts.map +1 -1
  35. package/dist/navigation-instruments/wind-propulsion/wind-propulsion.js +4 -4
  36. package/dist/navigation-instruments/wind-propulsion/wind-propulsion.js.map +1 -1
  37. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"compass.js","sources":["../../../src/navigation-instruments/compass/compass.ts"],"sourcesContent":["import {LitElement, PropertyValues, css, html} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport '../watch/watch.js';\nimport {Tickmark, TickmarkType} from '../watch/tickmark.js';\nimport {arrow, ArrowStyle} from './arrow.js';\nimport {AdviceState, AngleAdvice, AngleAdviceRaw} from '../watch/advice.js';\nimport {ResizeController} from '@lit-labs/observers/resize-controller.js';\nimport {\n VesselImage,\n VesselImageSize,\n WatchCircleType,\n RotType,\n RotPosition,\n} from '../watch/watch.js';\nimport {SetpointBundle} from '../../svghelpers/setpoint-bundle.js';\nimport {ROT_ZERO_DEADBAND_DEG} from '../rate-of-turn/rot-renderer.js';\nimport {customElement} from '../../decorator.js';\nimport {InstrumentState, Priority} from '../types.js';\nexport {RotType};\n\nexport enum CompassDirection {\n NorthUp = 'northUp',\n HeadingUp = 'headingUp',\n CourseUp = 'courseUp',\n}\n\nexport enum CompassPriorityElement {\n hdg = 'hdg',\n cog = 'cog',\n rot = 'rot',\n wind = 'wind',\n current = 'current',\n}\n\n/**\n * `<obc-compass>` – Full-featured compass with HDG/COG arrows, rate-of-turn indicator, and environmental overlays.\n *\n * Renders a circular compass instrument that displays heading (HDG) and\n * course-over-ground (COG) as rotating arrows over a triple-ring watch face.\n * It supports wind and current indicators, a vessel silhouette, heading\n * setpoint with auto at-setpoint detection, advice zones, and a rate-of-turn\n * (ROT) dot indicator. The compass can be oriented north-up, heading-up, or\n * course-up.\n *\n * ## Features\n *\n * - **Direction modes**: `northUp` (default), `headingUp`, or `courseUp`\n * via the `direction` property.\n * - **HDG / COG arrows**: Two styled arrows overlay the watch face,\n * rotating independently.\n * - **Heading setpoint**: Optional setpoint marker with auto at-setpoint\n * detection via `headingSetpoint`, `atHeadingSetpoint`, and deadband\n * tuning properties.\n * - **Advice zones**: Pass `headingAdvices` to render caution/alert arcs;\n * triggered state is derived from whether the current heading falls\n * inside the advice range.\n * - **Rate of turn**: Animated ROT indicator driven by\n * `rateOfTurnDegreesPerMinute` (deg/min, the maritime / AIS convention).\n * Supports spinning dots (`rotType=\"dots\"`) — the dot animation is\n * amplified by `rotDotAnimationFactor` so small physical values still\n * read at a glance — and a banana-shaped arc bar (`rotType=\"bar\"`)\n * showing the HDG→COG span. Bar extent is driven by the physical value\n * only (gain is not applied). Position on the outer scale ring or inner\n * circle via `rotPosition`.\n * - **Environmental overlays**: Wind speed/direction and current\n * speed/direction indicators on the watch face.\n * - **Vessel image**: Configurable vessel silhouette centered on the\n * compass, rotating with heading.\n * - **Color priority**: Set `priority` to `Priority.enhanced` to use the\n * blue/enhanced color palette instead of the default gray/regular palette\n * (default: `Priority.regular`).\n *\n * ## Usage Guidelines\n *\n * - Set `heading` and `courseOverGround` to the current sensor values\n * in degrees.\n * - Use `direction` to control the compass orientation mode.\n * - Use `headingSetpoint` to show a target heading marker.\n * - Pass `headingAdvices` as an array of `AngleAdvice` objects for\n * caution/alert zones.\n * - Set `windSpeed` / `windFromDirection` and `currentSpeed` /\n * `currentFromDirection` to display environmental indicators.\n *\n * ## Example\n *\n * ```html\n * <obc-compass\n * heading=\"45\"\n * courseOverGround=\"50\"\n * direction=\"northUp\"\n * headingSetpoint=\"90\"\n * priority=\"regular\"\n * vesselImage=\"genericTop\"\n * ></obc-compass>\n * ```\n *\n * @property {number} heading - The current heading of the vessel in degrees.\n * @property {number} courseOverGround - The current course over ground in degrees.\n * @property {number | null} headingSetpoint - The set point for the heading in degrees.\n * @property {boolean} atHeadingSetpoint - Indicates if the vessel is at the heading set point.\n * @property {boolean} autoAtHeadingSetpoint - Enables automatic at heading set point calculation.\n * @property {number} autoAtHeadingSetpointDeadband - The deadband for the heading set point in degrees.\n * @property {boolean} touching - Indicates if the compass is being touched.\n * @property {Array<AngleAdvice>} headingAdvices - An array of angle advices for the compass.\n * @property {number | null} windSpeed - The wind speed in beaufort scale number.\n * @property {number | null} windFromDirection - The direction the wind is coming from in degrees.\n * @property {number | null} currentSpeed - The current speed, number of arrows.\n * @property {number | null} currentFromDirection - The direction the current is coming from in degrees.\n * @property {VesselImage} vesselImage - The image of the vessel.\n * @property {number|undefined} rateOfTurnDegreesPerMinute - Measured rate of turn in degrees per minute (the AIS / ITU-R M.1371 convention). Sign controls direction (positive = starboard / clockwise). Drives both the bar extent and the dot animation.\n * @property {number} rotDotAnimationFactor - Visual amplification for the dot animation only. Default `18` (≈1 rpm at 20°/min).\n * @property {number} rotationsPerMinute - **Deprecated.** Use `rateOfTurnDegreesPerMinute` instead. Kept as a backward-compatible fallback when `rateOfTurnDegreesPerMinute` is `undefined`.\n * @property {RotType} rotType - ROT display mode: `'dots'` (spinning dots, default) or `'bar'` (arc bar from HDG to COG).\n * @property {RotPosition} rotPosition - ROT track position: `'innerCircle'` (default) or `'scale'` (on the outer ring).\n * @property {Priority} priority - Color priority: `Priority.enhanced` uses the blue/enhanced color palette, `Priority.regular` (default) uses the standard palette.\n *\n * @ignition-base-height: 512px\n * @ignition-base-width: 512px\n */\n@customElement('obc-compass')\nexport class ObcCompass extends LitElement {\n @property({type: Number}) heading = 0;\n @property({type: Number}) courseOverGround = 0;\n\n @property({type: Number}) headingSetpoint: number | null = null;\n @property({type: Number}) newHeadingSetpoint: number | undefined;\n @property({type: Boolean}) atHeadingSetpoint: boolean = false;\n @property({type: Number}) headingSetpointAtZeroDeadband: number = 0.5;\n @property({type: Boolean}) headingSetpointOverride: boolean = false;\n @property({type: Boolean, attribute: false}) autoAtHeadingSetpoint: boolean =\n true;\n @property({type: Number}) autoAtHeadingSetpointDeadband: number = 2;\n @property({type: Boolean}) animateSetpoint: boolean = false;\n @property({type: Boolean}) touching: boolean = false;\n @property({type: Array, attribute: false}) headingAdvices: AngleAdvice[] = [];\n @property({type: Number}) windSpeed: number | null = null;\n @property({type: Number}) windFromDirection: number | null = null;\n @property({type: Number}) currentSpeed: number | null = null;\n @property({type: Number}) currentFromDirection: number | null = null;\n @property({type: String}) vesselImage: VesselImage = VesselImage.genericTop;\n /**\n * Measured rate of turn in degrees per minute (positive = starboard).\n * Drives both the bar extent and (after multiplication by\n * `rotDotAnimationFactor`) the spinning dot animation.\n * When `undefined`, falls back to the deprecated `rotationsPerMinute`.\n */\n @property({type: Number}) rateOfTurnDegreesPerMinute: number | undefined;\n /**\n * Visual amplification applied only to the spinning dot animation\n * (not to the bar extent). Default `18` keeps the legacy visual feel\n * (≈1 rpm at 20°/min).\n */\n @property({type: Number}) rotDotAnimationFactor: number = 18;\n /**\n * @deprecated Use `rateOfTurnDegreesPerMinute` (and optionally\n * `rotDotAnimationFactor`) instead. Takes effect only when\n * `rateOfTurnDegreesPerMinute` is `undefined`.\n */\n @property({type: Number}) rotationsPerMinute: number = 1;\n @property({type: String}) rotType: RotType = RotType.dots;\n @property({type: String}) rotPosition: RotPosition = RotPosition.innerCircle;\n /**\n * Bar-extent reference value in **degrees per minute**. The bar fills the\n * full ±`rotArcExtent` arc when the measured ROT equals ±`rotMaxValue`.\n * Default `60` aligns with ES-TRIN 2025/1 Art. 3.02.\n *\n * Note: prior to the introduction of `rateOfTurnDegreesPerMinute` this\n * property was interpreted in rotations per minute. The unit changed when\n * the physical ROT API was introduced.\n */\n @property({type: Number}) rotMaxValue: number = 60;\n @property({type: Number}) rotArcExtent: number = 60;\n @property({type: Boolean}) rotPortStarboard: boolean = false;\n @property({type: Number}) rotAtZeroDeadband: number = ROT_ZERO_DEADBAND_DEG;\n @property({type: String}) direction: CompassDirection =\n CompassDirection.NorthUp;\n @property({type: String}) state: InstrumentState = InstrumentState.active;\n @property({type: String}) priority: Priority = Priority.regular;\n @property({type: Array, attribute: false})\n priorityElements: CompassPriorityElement[] = [CompassPriorityElement.hdg];\n /** Show compass NSEW labels and north arrow. */\n @property({type: Boolean}) showLabels: boolean = false;\n /** When true, labels and north arrow are placed inside the outer ring. */\n @property({type: Boolean}) tickmarksInside: boolean = false;\n\n private _headingSp = new SetpointBundle({\n angularWraparound: true,\n onAnimationEnd: () => this.requestUpdate(),\n });\n\n override willUpdate(changed: PropertyValues): void {\n super.willUpdate(changed);\n this._headingSp.sync({\n setpoint: this.headingSetpoint ?? undefined,\n newSetpoint: this.newHeadingSetpoint,\n atSetpoint: this.atHeadingSetpoint,\n touching: this.touching,\n autoAtSetpoint: this.autoAtHeadingSetpoint,\n autoAtSetpointDeadband: this.autoAtHeadingSetpointDeadband,\n setpointAtZeroDeadband: this.headingSetpointAtZeroDeadband,\n setpointOverride: this.headingSetpointOverride,\n animateSetpoint: this.animateSetpoint,\n });\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this._headingSp.dispose();\n }\n\n // @ts-expect-error TS6133: The controller ensures that the render\n // function is called on resize of the element\n private _resizeController = new ResizeController(this, {});\n\n /**\n * Resolved rate of turn in degrees per minute, used to compute the bar\n * extent. Prefers the new physical API; falls back to the deprecated\n * `rotationsPerMinute` so existing consumers keep their visuals during\n * the deprecation window.\n */\n private get _effectiveRotDegPerMin(): number {\n return this.rateOfTurnDegreesPerMinute ?? this.rotationsPerMinute;\n }\n\n private getPadding() {\n const size = Math.min(this.clientHeight, this.clientWidth);\n const deltaWidth = 512 - size;\n const steps = deltaWidth / 128;\n let deltaPadding;\n if (deltaWidth > 0) {\n deltaPadding = steps * 48;\n } else {\n deltaPadding = steps * 6;\n }\n\n return 72 + deltaPadding;\n }\n\n private get angleAdviceRaw(): AngleAdviceRaw[] {\n return this.headingAdvices.map(({minAngle, maxAngle, hinted, type}) => {\n const state =\n this.heading >= minAngle && this.heading <= maxAngle\n ? AdviceState.triggered\n : hinted\n ? AdviceState.hinted\n : AdviceState.regular;\n return {minAngle, maxAngle, type, state};\n });\n }\n\n private priorityFor(element: CompassPriorityElement): Priority {\n const selected = Array.isArray(this.priorityElements)\n ? this.priorityElements\n : [];\n return selected.includes(element) ? this.priority : Priority.regular;\n }\n\n private colorFor(element: CompassPriorityElement): string | undefined {\n return this.priorityFor(element) === Priority.enhanced\n ? 'var(--instrument-enhanced-secondary-color)'\n : undefined;\n }\n\n private getRotation(): number | undefined {\n if (this.direction === CompassDirection.NorthUp) {\n return undefined;\n } else if (this.direction === CompassDirection.HeadingUp) {\n return -this.heading;\n } else if (this.direction === CompassDirection.CourseUp) {\n return -this.courseOverGround;\n }\n return undefined;\n }\n\n override render() {\n const tickmarks: Tickmark[] = [\n {angle: 0, type: TickmarkType.main},\n {angle: 90, type: TickmarkType.main},\n {angle: 180, type: TickmarkType.main},\n {angle: 270, type: TickmarkType.main},\n ];\n\n const padding = this.getPadding();\n const width = (176 + padding) * 2;\n const viewBox = `-${width / 2} -${width / 2} ${width} ${width}`;\n\n return html`\n <div class=\"container\">\n <obc-watch\n .touching=${this.touching}\n .padding=${padding}\n .advices=${this.angleAdviceRaw}\n .tickmarks=${tickmarks}\n .state=${this.state}\n .watchCircleType=${WatchCircleType.triple}\n .showLabels=${this.showLabels}\n .tickmarksInside=${this.tickmarksInside}\n .crosshairEnabled=${true}\n .northArrow=${true}\n .angleSetpoint=${this.headingSetpoint ?? undefined}\n .newAngleSetpoint=${this.newHeadingSetpoint}\n .atAngleSetpoint=${this._headingSp.computeAtSetpoint(this.heading)}\n .angleSetpointAtZeroDeadband=${this.headingSetpointAtZeroDeadband}\n .setpointOverride=${this.headingSetpointOverride}\n .priority=${this.priority}\n .animateSetpoint=${this.animateSetpoint}\n .vessels=${[\n {\n size: VesselImageSize.medium,\n vesselImage: this.vesselImage,\n transform: `rotate(${this.heading}deg)`,\n },\n ]}\n .wind=${this.windSpeed}\n .windFromDirectionDeg=${this.windFromDirection}\n .windColor=${this.colorFor(CompassPriorityElement.wind)}\n .current=${this.currentSpeed}\n .currentFromDirectionDeg=${this.currentFromDirection}\n .currentColor=${this.colorFor(CompassPriorityElement.current)}\n .rotation=${this.getRotation()}\n .rotType=${this.rotType}\n .rotPosition=${this.rotPosition}\n .rotStartAngle=${this.heading + (this.getRotation() ?? 0)}\n .rotEndAngle=${this.heading +\n (this._effectiveRotDegPerMin / (this.rotMaxValue || 1)) *\n this.rotArcExtent +\n (this.getRotation() ?? 0)}\n .rotPriority=${this.priorityFor(CompassPriorityElement.rot)}\n .rotPortStarboard=${this.rotPortStarboard}\n .rotAtZeroDeadband=${this.rotAtZeroDeadband}\n .rateOfTurnDegreesPerMinute=${this.rateOfTurnDegreesPerMinute}\n .rotDotAnimationFactor=${this.rotDotAnimationFactor}\n .rotationsPerMinute=${this.rotationsPerMinute}\n >\n </obc-watch>\n <svg viewBox=\"${viewBox}\">\n ${arrow(\n ArrowStyle.HDG,\n this.heading + (this.getRotation() ?? 0),\n this.priorityFor(CompassPriorityElement.hdg)\n )}\n ${arrow(\n ArrowStyle.COG,\n this.courseOverGround + (this.getRotation() ?? 0),\n this.priorityFor(CompassPriorityElement.cog)\n )}\n </svg>\n </div>\n `;\n }\n\n static override styles = css`\n * {\n box-sizing: border-box;\n }\n\n .container {\n position: relative;\n width: 100%;\n height: 100%;\n }\n\n .container > * {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n\n :host {\n display: block;\n width: 100%;\n height: 100%;\n }\n `;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-compass': ObcCompass;\n }\n}\n"],"names":["CompassDirection","CompassPriorityElement"],"mappings":";;;;;;;;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qDe,WAAA,qBAAA,CAAA;AACA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAtDb,WAsDe,WAAA,aAAA,CAAA;AAEA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAxDb,WAwDe,WAAA,SAAA,CAAA;AACA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAzDb,WAyDe,WAAA,YAAA,CAAA;AAE1B,gBAAA;AAAA,EADC,SAAS,EAAC,MAAM,OAAO,WAAW,OAAM;AAAA,GA1D9B,WA2DX,WAAA,oBAAA,CAAA;AAE2B,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,QAAA,CAAQ;AAAA,GA7Dd,WA6DgB,WAAA,cAAA,CAAA;AAEA,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,QAAA,CAAQ;AAAA,GA/Dd,WA+DgB,WAAA,mBAAA,CAAA;AA/DhB,aAAN,gBAAA;AAAA,EADN,cAAc,aAAa;AAAA,GACf,UAAA;"}
1
+ {"version":3,"file":"compass.js","sources":["../../../src/navigation-instruments/compass/compass.ts"],"sourcesContent":["import {LitElement, PropertyValues, css, html} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport '../watch/watch.js';\nimport {Tickmark, TickmarkType} from '../watch/tickmark.js';\nimport {arrow, ArrowStyle} from './arrow.js';\nimport {AdviceState, AngleAdvice, AngleAdviceRaw} from '../watch/advice.js';\nimport {ResizeController} from '@lit-labs/observers/resize-controller.js';\nimport {\n VesselImage,\n VesselImageSize,\n WatchCircleType,\n RotType,\n RotPosition,\n} from '../watch/watch.js';\nimport {SetpointBundle} from '../../svghelpers/setpoint-bundle.js';\nimport {ROT_ZERO_DEADBAND_DEG} from '../rate-of-turn/rot-renderer.js';\nimport {customElement} from '../../decorator.js';\nimport {InstrumentState, Priority} from '../types.js';\nexport {RotType};\n\nexport enum CompassDirection {\n NorthUp = 'northUp',\n HeadingUp = 'headingUp',\n CourseUp = 'courseUp',\n}\n\nexport enum CompassPriorityElement {\n hdg = 'hdg',\n cog = 'cog',\n rot = 'rot',\n wind = 'wind',\n current = 'current',\n}\n\n/**\n * `<obc-compass>` – Full-featured compass with HDG/COG arrows, rate-of-turn indicator, and environmental overlays.\n *\n * Renders a circular compass instrument that displays heading (HDG) and\n * course-over-ground (COG) as rotating arrows over a triple-ring watch face.\n * It supports wind and current indicators, a vessel silhouette, heading\n * setpoint with auto at-setpoint detection, advice zones, and a rate-of-turn\n * (ROT) dot indicator. The compass can be oriented north-up, heading-up, or\n * course-up.\n *\n * ## Features\n *\n * - **Direction modes**: `northUp` (default), `headingUp`, or `courseUp`\n * via the `direction` property.\n * - **HDG / COG arrows**: Two styled arrows overlay the watch face,\n * rotating independently.\n * - **Heading setpoint**: Optional setpoint marker with auto at-setpoint\n * detection via `headingSetpoint`, `atHeadingSetpoint`, and deadband\n * tuning properties.\n * - **Advice zones**: Pass `headingAdvices` to render caution/alert arcs;\n * triggered state is derived from whether the current heading falls\n * inside the advice range.\n * - **Rate of turn**: Animated ROT indicator driven by\n * `rateOfTurnDegreesPerMinute` (deg/min, the maritime / AIS convention).\n * Supports spinning dots (`rotType=\"dots\"`) — the dot animation is\n * amplified by `rotDotAnimationFactor` so small physical values still\n * read at a glance — and a banana-shaped arc bar (`rotType=\"bar\"`)\n * showing the HDG→COG span. Bar extent is driven by the physical value\n * only (gain is not applied). Position on the outer scale ring or inner\n * circle via `rotPosition`.\n * - **Environmental overlays**: Wind speed/direction and current\n * speed/direction indicators on the watch face.\n * - **Vessel image**: Configurable vessel silhouette centered on the\n * compass, rotating with heading.\n * - **Color priority**: Set `priority` to `Priority.enhanced` to use the\n * blue/enhanced color palette instead of the default gray/regular palette\n * (default: `Priority.regular`).\n *\n * ## Usage Guidelines\n *\n * - Set `heading` and `courseOverGround` to the current sensor values\n * in degrees.\n * - Use `direction` to control the compass orientation mode.\n * - Use `headingSetpoint` to show a target heading marker.\n * - Pass `headingAdvices` as an array of `AngleAdvice` objects for\n * caution/alert zones.\n * - Set `currentWindSpeedKnots` / `windFromDirection` and `currentSpeed` /\n * `currentFromDirection` to display environmental indicators.\n *\n * ## Example\n *\n * ```html\n * <obc-compass\n * heading=\"45\"\n * courseOverGround=\"50\"\n * direction=\"northUp\"\n * headingSetpoint=\"90\"\n * priority=\"regular\"\n * vesselImage=\"genericTop\"\n * ></obc-compass>\n * ```\n *\n * @property {number} heading - The current heading of the vessel in degrees.\n * @property {number} courseOverGround - The current course over ground in degrees.\n * @property {number | null} headingSetpoint - The set point for the heading in degrees.\n * @property {boolean} atHeadingSetpoint - Indicates if the vessel is at the heading set point.\n * @property {boolean} autoAtHeadingSetpoint - Enables automatic at heading set point calculation.\n * @property {number} autoAtHeadingSetpointDeadband - The deadband for the heading set point in degrees.\n * @property {boolean} touching - Indicates if the compass is being touched.\n * @property {Array<AngleAdvice>} headingAdvices - An array of angle advices for the compass.\n * @property {number | null} currentWindSpeedKnots - The wind speed in knots.\n * @property {number | null} windFromDirection - The direction the wind is coming from in degrees.\n * @property {number | null} currentSpeed - The current speed, number of arrows.\n * @property {number | null} currentFromDirection - The direction the current is coming from in degrees.\n * @property {VesselImage} vesselImage - The image of the vessel.\n * @property {number|undefined} rateOfTurnDegreesPerMinute - Measured rate of turn in degrees per minute (the AIS / ITU-R M.1371 convention). Sign controls direction (positive = starboard / clockwise). Drives both the bar extent and the dot animation.\n * @property {number} rotDotAnimationFactor - Visual amplification for the dot animation only. Default `18` (≈1 rpm at 20°/min).\n * @property {number} rotationsPerMinute - **Deprecated.** Use `rateOfTurnDegreesPerMinute` instead. Kept as a backward-compatible fallback when `rateOfTurnDegreesPerMinute` is `undefined`.\n * @property {RotType} rotType - ROT display mode: `'dots'` (spinning dots, default) or `'bar'` (arc bar from HDG to COG).\n * @property {RotPosition} rotPosition - ROT track position: `'innerCircle'` (default) or `'scale'` (on the outer ring).\n * @property {Priority} priority - Color priority: `Priority.enhanced` uses the blue/enhanced color palette, `Priority.regular` (default) uses the standard palette.\n *\n * @ignition-base-height: 512px\n * @ignition-base-width: 512px\n */\n@customElement('obc-compass')\nexport class ObcCompass extends LitElement {\n @property({type: Number}) heading = 0;\n @property({type: Number}) courseOverGround = 0;\n\n @property({type: Number}) headingSetpoint: number | null = null;\n @property({type: Number}) newHeadingSetpoint: number | undefined;\n @property({type: Boolean}) atHeadingSetpoint: boolean = false;\n @property({type: Number}) headingSetpointAtZeroDeadband: number = 0.5;\n @property({type: Boolean}) headingSetpointOverride: boolean = false;\n @property({type: Boolean, attribute: false}) autoAtHeadingSetpoint: boolean =\n true;\n @property({type: Number}) autoAtHeadingSetpointDeadband: number = 2;\n @property({type: Boolean}) animateSetpoint: boolean = false;\n @property({type: Boolean}) touching: boolean = false;\n @property({type: Array, attribute: false}) headingAdvices: AngleAdvice[] = [];\n @property({type: Number}) currentWindSpeedKnots: number | null = null;\n @property({type: Number}) windFromDirection: number | null = null;\n @property({type: Number}) currentSpeed: number | null = null;\n @property({type: Number}) currentFromDirection: number | null = null;\n @property({type: String}) vesselImage: VesselImage = VesselImage.genericTop;\n /**\n * Measured rate of turn in degrees per minute (positive = starboard).\n * Drives both the bar extent and (after multiplication by\n * `rotDotAnimationFactor`) the spinning dot animation.\n * When `undefined`, falls back to the deprecated `rotationsPerMinute`.\n */\n @property({type: Number}) rateOfTurnDegreesPerMinute: number | undefined;\n /**\n * Visual amplification applied only to the spinning dot animation\n * (not to the bar extent). Default `18` keeps the legacy visual feel\n * (≈1 rpm at 20°/min).\n */\n @property({type: Number}) rotDotAnimationFactor: number = 18;\n /**\n * @deprecated Use `rateOfTurnDegreesPerMinute` (and optionally\n * `rotDotAnimationFactor`) instead. Takes effect only when\n * `rateOfTurnDegreesPerMinute` is `undefined`.\n */\n @property({type: Number}) rotationsPerMinute: number = 1;\n @property({type: String}) rotType: RotType = RotType.dots;\n @property({type: String}) rotPosition: RotPosition = RotPosition.innerCircle;\n /**\n * Bar-extent reference value in **degrees per minute**. The bar fills the\n * full ±`rotArcExtent` arc when the measured ROT equals ±`rotMaxValue`.\n * Default `60` aligns with ES-TRIN 2025/1 Art. 3.02.\n *\n * Note: prior to the introduction of `rateOfTurnDegreesPerMinute` this\n * property was interpreted in rotations per minute. The unit changed when\n * the physical ROT API was introduced.\n */\n @property({type: Number}) rotMaxValue: number = 60;\n @property({type: Number}) rotArcExtent: number = 60;\n @property({type: Boolean}) rotPortStarboard: boolean = false;\n @property({type: Number}) rotAtZeroDeadband: number = ROT_ZERO_DEADBAND_DEG;\n @property({type: String}) direction: CompassDirection =\n CompassDirection.NorthUp;\n @property({type: String}) state: InstrumentState = InstrumentState.active;\n @property({type: String}) priority: Priority = Priority.regular;\n @property({type: Array, attribute: false})\n priorityElements: CompassPriorityElement[] = [CompassPriorityElement.hdg];\n /** Show compass NSEW labels and north arrow. */\n @property({type: Boolean}) showLabels: boolean = false;\n /** When true, labels and north arrow are placed inside the outer ring. */\n @property({type: Boolean}) tickmarksInside: boolean = false;\n\n private _headingSp = new SetpointBundle({\n angularWraparound: true,\n onAnimationEnd: () => this.requestUpdate(),\n });\n\n override willUpdate(changed: PropertyValues): void {\n super.willUpdate(changed);\n this._headingSp.sync({\n setpoint: this.headingSetpoint ?? undefined,\n newSetpoint: this.newHeadingSetpoint,\n atSetpoint: this.atHeadingSetpoint,\n touching: this.touching,\n autoAtSetpoint: this.autoAtHeadingSetpoint,\n autoAtSetpointDeadband: this.autoAtHeadingSetpointDeadband,\n setpointAtZeroDeadband: this.headingSetpointAtZeroDeadband,\n setpointOverride: this.headingSetpointOverride,\n animateSetpoint: this.animateSetpoint,\n });\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this._headingSp.dispose();\n }\n\n // @ts-expect-error TS6133: The controller ensures that the render\n // function is called on resize of the element\n private _resizeController = new ResizeController(this, {});\n\n /**\n * Resolved rate of turn in degrees per minute, used to compute the bar\n * extent. Prefers the new physical API; falls back to the deprecated\n * `rotationsPerMinute` so existing consumers keep their visuals during\n * the deprecation window.\n */\n private get _effectiveRotDegPerMin(): number {\n return this.rateOfTurnDegreesPerMinute ?? this.rotationsPerMinute;\n }\n\n private getPadding() {\n const size = Math.min(this.clientHeight, this.clientWidth);\n const deltaWidth = 512 - size;\n const steps = deltaWidth / 128;\n let deltaPadding;\n if (deltaWidth > 0) {\n deltaPadding = steps * 48;\n } else {\n deltaPadding = steps * 6;\n }\n\n return 72 + deltaPadding;\n }\n\n private get angleAdviceRaw(): AngleAdviceRaw[] {\n return this.headingAdvices.map(({minAngle, maxAngle, hinted, type}) => {\n const state =\n this.heading >= minAngle && this.heading <= maxAngle\n ? AdviceState.triggered\n : hinted\n ? AdviceState.hinted\n : AdviceState.regular;\n return {minAngle, maxAngle, type, state};\n });\n }\n\n private priorityFor(element: CompassPriorityElement): Priority {\n const selected = Array.isArray(this.priorityElements)\n ? this.priorityElements\n : [];\n return selected.includes(element) ? this.priority : Priority.regular;\n }\n\n private colorFor(element: CompassPriorityElement): string | undefined {\n return this.priorityFor(element) === Priority.enhanced\n ? 'var(--instrument-enhanced-secondary-color)'\n : undefined;\n }\n\n private getRotation(): number | undefined {\n if (this.direction === CompassDirection.NorthUp) {\n return undefined;\n } else if (this.direction === CompassDirection.HeadingUp) {\n return -this.heading;\n } else if (this.direction === CompassDirection.CourseUp) {\n return -this.courseOverGround;\n }\n return undefined;\n }\n\n override render() {\n const tickmarks: Tickmark[] = [\n {angle: 0, type: TickmarkType.main},\n {angle: 90, type: TickmarkType.main},\n {angle: 180, type: TickmarkType.main},\n {angle: 270, type: TickmarkType.main},\n ];\n\n const padding = this.getPadding();\n const width = (176 + padding) * 2;\n const viewBox = `-${width / 2} -${width / 2} ${width} ${width}`;\n\n return html`\n <div class=\"container\">\n <obc-watch\n .touching=${this.touching}\n .padding=${padding}\n .advices=${this.angleAdviceRaw}\n .tickmarks=${tickmarks}\n .state=${this.state}\n .watchCircleType=${WatchCircleType.triple}\n .showLabels=${this.showLabels}\n .tickmarksInside=${this.tickmarksInside}\n .crosshairEnabled=${true}\n .northArrow=${true}\n .angleSetpoint=${this.headingSetpoint ?? undefined}\n .newAngleSetpoint=${this.newHeadingSetpoint}\n .atAngleSetpoint=${this._headingSp.computeAtSetpoint(this.heading)}\n .angleSetpointAtZeroDeadband=${this.headingSetpointAtZeroDeadband}\n .setpointOverride=${this.headingSetpointOverride}\n .priority=${this.priority}\n .animateSetpoint=${this.animateSetpoint}\n .vessels=${[\n {\n size: VesselImageSize.medium,\n vesselImage: this.vesselImage,\n transform: `rotate(${this.heading}deg)`,\n },\n ]}\n .windKnots=${this.currentWindSpeedKnots}\n .windFromDirectionDeg=${this.windFromDirection}\n .windColor=${this.colorFor(CompassPriorityElement.wind)}\n .current=${this.currentSpeed}\n .currentFromDirectionDeg=${this.currentFromDirection}\n .currentColor=${this.colorFor(CompassPriorityElement.current)}\n .rotation=${this.getRotation()}\n .rotType=${this.rotType}\n .rotPosition=${this.rotPosition}\n .rotStartAngle=${this.heading + (this.getRotation() ?? 0)}\n .rotEndAngle=${this.heading +\n (this._effectiveRotDegPerMin / (this.rotMaxValue || 1)) *\n this.rotArcExtent +\n (this.getRotation() ?? 0)}\n .rotPriority=${this.priorityFor(CompassPriorityElement.rot)}\n .rotPortStarboard=${this.rotPortStarboard}\n .rotAtZeroDeadband=${this.rotAtZeroDeadband}\n .rateOfTurnDegreesPerMinute=${this.rateOfTurnDegreesPerMinute}\n .rotDotAnimationFactor=${this.rotDotAnimationFactor}\n .rotationsPerMinute=${this.rotationsPerMinute}\n >\n </obc-watch>\n <svg viewBox=\"${viewBox}\">\n ${arrow(\n ArrowStyle.HDG,\n this.heading + (this.getRotation() ?? 0),\n this.priorityFor(CompassPriorityElement.hdg)\n )}\n ${arrow(\n ArrowStyle.COG,\n this.courseOverGround + (this.getRotation() ?? 0),\n this.priorityFor(CompassPriorityElement.cog)\n )}\n </svg>\n </div>\n `;\n }\n\n static override styles = css`\n * {\n box-sizing: border-box;\n }\n\n .container {\n position: relative;\n width: 100%;\n height: 100%;\n }\n\n .container > * {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n\n :host {\n display: block;\n width: 100%;\n height: 100%;\n }\n `;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-compass': ObcCompass;\n }\n}\n"],"names":["CompassDirection","CompassPriorityElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAoBO,IAAK,qCAAAA,sBAAL;AACLA,oBAAA,SAAA,IAAU;AACVA,oBAAA,WAAA,IAAY;AACZA,oBAAA,UAAA,IAAW;AAHD,SAAAA;AAAA,GAAA,oBAAA,CAAA,CAAA;AAML,IAAK,2CAAAC,4BAAL;AACLA,0BAAA,KAAA,IAAM;AACNA,0BAAA,KAAA,IAAM;AACNA,0BAAA,KAAA,IAAM;AACNA,0BAAA,MAAA,IAAO;AACPA,0BAAA,SAAA,IAAU;AALA,SAAAA;AAAA,GAAA,0BAAA,CAAA,CAAA;AA8FL,IAAM,aAAN,cAAyB,WAAW;AAAA,EAApC,cAAA;AAAA,UAAA,GAAA,SAAA;AACqB,SAAA,UAAU;AACV,SAAA,mBAAmB;AAEnB,SAAA,kBAAiC;AAEhC,SAAA,oBAA6B;AAC9B,SAAA,gCAAwC;AACvC,SAAA,0BAAmC;AACjB,SAAA,wBAC3C;AACwB,SAAA,gCAAwC;AACvC,SAAA,kBAA2B;AAC3B,SAAA,WAAoB;AACJ,SAAA,iBAAgC,CAAA;AACjD,SAAA,wBAAuC;AACvC,SAAA,oBAAmC;AACnC,SAAA,eAA8B;AAC9B,SAAA,uBAAsC;AACtC,SAAA,cAA2B,YAAY;AAavC,SAAA,wBAAgC;AAMhC,SAAA,qBAA6B;AAC7B,SAAA,UAAmB,QAAQ;AAC3B,SAAA,cAA2B,YAAY;AAUvC,SAAA,cAAsB;AACtB,SAAA,eAAuB;AACtB,SAAA,mBAA4B;AAC7B,SAAA,oBAA4B;AAC5B,SAAA,YACxB;AACwB,SAAA,QAAyB,gBAAgB;AACzC,SAAA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,MAAM,OAAA,CAAO;AAAA,GAnDb,WAmDe,WAAA,gBAAA,CAAA;AACC,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,QAAA,CAAQ;AAAA,GApDd,WAoDgB,WAAA,oBAAA,CAAA;AACD,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GArDb,WAqDe,WAAA,qBAAA,CAAA;AACA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAtDb,WAsDe,WAAA,aAAA,CAAA;AAEA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAxDb,WAwDe,WAAA,SAAA,CAAA;AACA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAzDb,WAyDe,WAAA,YAAA,CAAA;AAE1B,gBAAA;AAAA,EADC,SAAS,EAAC,MAAM,OAAO,WAAW,OAAM;AAAA,GA1D9B,WA2DX,WAAA,oBAAA,CAAA;AAE2B,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,QAAA,CAAQ;AAAA,GA7Dd,WA6DgB,WAAA,cAAA,CAAA;AAEA,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,QAAA,CAAQ;AAAA,GA/Dd,WA+DgB,WAAA,mBAAA,CAAA;AA/DhB,aAAN,gBAAA;AAAA,EADN,cAAc,aAAa;AAAA,GACf,UAAA;"}
@@ -20,6 +20,7 @@ export declare enum CompassIndicatorDirection {
20
20
  * - **Types**: `regular` shows the circular compass indicator; `labeled` shows a framed indicator with a single cardinal label.
21
21
  * - **Directions**: `heading`, `course`, and `north` each use their own visual symbol.
22
22
  * - **Angle-driven output**: `angle` rotates the active symbol and drives the derived label in labeled mode.
23
+ * - **Orientation**: `northUp` keeps the compass face fixed north-up and rotates the arrow; when `false` the face rotates and the arrow stays pointing up (heading-up / course-up).
23
24
  *
24
25
  * ## Usage Guidelines
25
26
  *
@@ -28,12 +29,23 @@ export declare enum CompassIndicatorDirection {
28
29
  * - Use `direction="north"` for the north marker / bearing-style indicator.
29
30
  * - Switch `type` to `labeled` when the indicator should also communicate the
30
31
  * nearest cardinal direction as text.
32
+ * - Set `northUp` to `false` to render a heading-up / course-up presentation
33
+ * where the arrow stays vertical and the compass face rotates instead.
31
34
  */
32
35
  export declare class ObcCompassIndicator extends LitElement {
33
36
  private idBase;
34
37
  angle: number;
35
38
  type: CompassIndicatorType;
36
39
  direction: CompassIndicatorDirection;
40
+ /**
41
+ * When `true` (default) the compass face stays north-up and the arrow
42
+ * rotates by `angle`. When `false` the arrow stays pointing up and the
43
+ * compass face rotates instead (heading-up / course-up presentation).
44
+ *
45
+ * Declared with `attribute: false` because the default is `true`; set it
46
+ * via the JavaScript property (or framework binding) to opt out.
47
+ */
48
+ northUp: boolean;
37
49
  private get normalizedAngle();
38
50
  private get cardinalLabel();
39
51
  private get cardinalLabelPrimary();
@@ -1 +1 @@
1
- {"version":3,"file":"compass-indicator.d.ts","sourceRoot":"","sources":["../../../src/navigation-instruments/compass-indicator/compass-indicator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAuB,MAAM,KAAK,CAAC;AAkBrD,oBAAY,oBAAoB;IAC9B,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AAED,oBAAY,yBAAyB;IACnC,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,KAAK,UAAU;CAChB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBACa,mBAAoB,SAAQ,UAAU;IACjD,OAAO,CAAC,MAAM,CAAiE;IAG/E,KAAK,SAAK;IAGV,IAAI,EAAE,oBAAoB,CAAgC;IAG1D,SAAS,EAAE,yBAAyB,CAAqC;IAEzE,OAAO,KAAK,eAAe,GAE1B;IAED,OAAO,KAAK,aAAa,GAIxB;IAED,OAAO,KAAK,oBAAoB,GAI/B;IAED,OAAO,CAAC,WAAW;IA6BnB,OAAO,CAAC,iBAAiB;IAoEzB,OAAO,CAAC,oBAAoB;IAmB5B,OAAO,CAAC,wBAAwB;IA4DhC,OAAO,CAAC,sBAAsB;IAwD9B,OAAO,CAAC,oBAAoB;IA6DnB,MAAM;IAcf,OAAgB,MAAM,0BAA6B;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,uBAAuB,EAAE,mBAAmB,CAAC;KAC9C;CACF"}
1
+ {"version":3,"file":"compass-indicator.d.ts","sourceRoot":"","sources":["../../../src/navigation-instruments/compass-indicator/compass-indicator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAuB,MAAM,KAAK,CAAC;AAkBrD,oBAAY,oBAAoB;IAC9B,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AAED,oBAAY,yBAAyB;IACnC,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,KAAK,UAAU;CAChB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBACa,mBAAoB,SAAQ,UAAU;IACjD,OAAO,CAAC,MAAM,CAAiE;IAG/E,KAAK,SAAK;IAGV,IAAI,EAAE,oBAAoB,CAAgC;IAG1D,SAAS,EAAE,yBAAyB,CAAqC;IAEzE;;;;;;;OAOG;IAEH,OAAO,EAAE,OAAO,CAAQ;IAExB,OAAO,KAAK,eAAe,GAE1B;IAED,OAAO,KAAK,aAAa,GAIxB;IAED,OAAO,KAAK,oBAAoB,GAI/B;IAED,OAAO,CAAC,WAAW;IA6BnB,OAAO,CAAC,iBAAiB;IAoEzB,OAAO,CAAC,oBAAoB;IAmB5B,OAAO,CAAC,wBAAwB;IA4DhC,OAAO,CAAC,sBAAsB;IAwD9B,OAAO,CAAC,oBAAoB;IA6DnB,MAAM;IAkBf,OAAgB,MAAM,0BAA6B;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,uBAAuB,EAAE,mBAAmB,CAAC;KAC9C;CACF"}
@@ -38,6 +38,7 @@ let ObcCompassIndicator = class extends LitElement {
38
38
  this.angle = 0;
39
39
  this.type = "regular";
40
40
  this.direction = "heading";
41
+ this.northUp = true;
41
42
  }
42
43
  get normalizedAngle() {
43
44
  return normalizeAngle(this.angle);
@@ -318,7 +319,11 @@ let ObcCompassIndicator = class extends LitElement {
318
319
  if (this.type === "labeled") {
319
320
  return this.renderLabeledIndicator(this.direction);
320
321
  }
321
- return this.renderRoundIndicator(this.direction, 0, -this.normalizedAngle);
322
+ return this.renderRoundIndicator(
323
+ this.direction,
324
+ this.northUp ? this.normalizedAngle : 0,
325
+ this.northUp ? 0 : -this.normalizedAngle
326
+ );
322
327
  }
323
328
  };
324
329
  ObcCompassIndicator.styles = unsafeCSS(componentStyle);
@@ -331,6 +336,9 @@ __decorateClass([
331
336
  __decorateClass([
332
337
  property({ type: String })
333
338
  ], ObcCompassIndicator.prototype, "direction", 2);
339
+ __decorateClass([
340
+ property({ type: Boolean, attribute: false })
341
+ ], ObcCompassIndicator.prototype, "northUp", 2);
334
342
  ObcCompassIndicator = __decorateClass([
335
343
  customElement("obc-compass-indicator")
336
344
  ], ObcCompassIndicator);
@@ -1 +1 @@
1
- {"version":3,"file":"compass-indicator.js","sources":["../../../src/navigation-instruments/compass-indicator/compass-indicator.ts"],"sourcesContent":["import {LitElement, html, svg, unsafeCSS} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport componentStyle from './compass-indicator.css?inline';\nimport {customElement} from '../../decorator.js';\n\nconst HEADING_ARROW_PATH =\n 'M23.1426 11.978C23.5519 11.2972 24.6131 11.3458 24.9297 12.1235L32.3877 30.4536L32.4336 30.5796C32.8455 31.8831 31.3809 32.9849 30.209 32.2808V32.2798L24 28.5835L17.79 32.2798L17.791 32.2808C16.5815 33.0075 15.0606 31.8106 15.6123 30.4536L23.0703 12.1235L23.1426 11.978Z';\nconst LABELED_HEADING_ARROW_PATH =\n 'M7.68919 1.5401C7.80154 1.26398 8.19911 1.26398 8.31146 1.5401L13.2832 13.7598C13.5226 14.3482 12.8616 14.8972 12.3115 14.5667L8.00033 11.9997L3.68917 14.5667C3.13908 14.8972 2.478 14.3482 2.71743 13.7598L7.68919 1.5401Z';\nconst COURSE_ARROW_PATH =\n 'M23.1426 11.978C23.5519 11.2972 24.6131 11.3458 24.9297 12.1235L32.3877 30.4536L32.4336 30.5796C32.8455 31.8831 31.3809 32.9849 30.209 32.2808V32.2798L24 28.5835L17.79 32.2798L17.791 32.2808C16.5815 33.0075 15.0606 31.8106 15.6123 30.4536L23.0703 12.1235L23.1426 11.978ZM20.0889 27.4087L23.7451 25.2388L24 25.0864L24.2549 25.2388L27.9102 27.4087L24 17.7974L20.0889 27.4087Z';\nconst CARDINAL_LABELS_8_WAY = ['N', 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW'];\nconst CARDINAL_LABELS_CARDINAL = ['N', 'E', 'S', 'W'];\n\nfunction normalizeAngle(angle: number): number {\n return ((angle % 360) + 360) % 360;\n}\n\nexport enum CompassIndicatorType {\n Regular = 'regular',\n Labeled = 'labeled',\n}\n\nexport enum CompassIndicatorDirection {\n Heading = 'heading',\n Course = 'course',\n North = 'north',\n}\n\n/**\n * `<obc-compass-indicator>` – A compact compass direction indicator with heading, course, and north variants.\n *\n * Renders a 48 x 48 directional indicator that can switch between a circular\n * compass face and labeled compact readouts. Use it when you need a small\n * directional cue next to a numeric readout or inside dense instrument layouts.\n *\n * ## Features\n *\n * - **Types**: `regular` shows the circular compass indicator; `labeled` shows a framed indicator with a single cardinal label.\n * - **Directions**: `heading`, `course`, and `north` each use their own visual symbol.\n * - **Angle-driven output**: `angle` rotates the active symbol and drives the derived label in labeled mode.\n *\n * ## Usage Guidelines\n *\n * - Use `direction=\"heading\"` for the filled heading arrow variant.\n * - Use `direction=\"course\"` for the outlined course arrow variant.\n * - Use `direction=\"north\"` for the north marker / bearing-style indicator.\n * - Switch `type` to `labeled` when the indicator should also communicate the\n * nearest cardinal direction as text.\n */\n@customElement('obc-compass-indicator')\nexport class ObcCompassIndicator extends LitElement {\n private idBase = `compass-indicator-${Math.random().toString(36).slice(2, 9)}`;\n\n @property({type: Number})\n angle = 0;\n\n @property({type: String})\n type: CompassIndicatorType = CompassIndicatorType.Regular;\n\n @property({type: String})\n direction: CompassIndicatorDirection = CompassIndicatorDirection.Heading;\n\n private get normalizedAngle(): number {\n return normalizeAngle(this.angle);\n }\n\n private get cardinalLabel(): string {\n const index =\n Math.round(this.normalizedAngle / 45) % CARDINAL_LABELS_8_WAY.length;\n return CARDINAL_LABELS_8_WAY[index];\n }\n\n private get cardinalLabelPrimary(): string {\n const index =\n Math.round(this.normalizedAngle / 90) % CARDINAL_LABELS_CARDINAL.length;\n return CARDINAL_LABELS_CARDINAL[index];\n }\n\n private renderArrow(\n direction: string,\n options?: {\n rotation?: number;\n translateY?: number;\n scale?: number;\n }\n ) {\n const {rotation = 0, translateY = 0, scale = 1} = options ?? {};\n const d =\n direction === CompassIndicatorDirection.Course\n ? COURSE_ARROW_PATH\n : HEADING_ARROW_PATH;\n\n return svg`\n <g transform=\"translate(0 ${translateY})\">\n <g transform=\"rotate(${rotation}, 24, 24)\">\n <g transform=\"translate(24 24) scale(${scale}) translate(-24 -24)\">\n <path\n d=\"${d}\"\n fill=\"var(--instrument-enhanced-secondary-color)\"\n stroke=\"var(--border-silhouette-color)\"\n />\n </g>\n </g>\n </g>\n `;\n }\n\n private renderCompassFace(rotation: number, showNorthMarker = true) {\n const ringMaskId = `${this.idBase}-ring-mask`;\n const crosshairMaskId = `${this.idBase}-crosshair-mask`;\n\n return svg`\n ${\n showNorthMarker\n ? svg`\n <path\n transform=\"rotate(${rotation}, 24, 24)\"\n d=\"M23.5929 1.56961L19.5645 7.20938C19.3281 7.54031 19.5646 8 19.9713 8L28.0281 8C28.4348 8 28.6714 7.54031 28.435 7.20938L24.4066 1.56961C24.2072 1.29044 23.7923 1.29044 23.5929 1.56961Z\"\n fill=\"var(--instrument-tick-mark-tertiary-color)\"\n />\n `\n : null\n }\n <circle\n cx=\"24\"\n cy=\"24\"\n r=\"18\"\n fill=\"var(--instrument-frame-primary-color)\"\n stroke=\"var(--instrument-frame-tertiary-color)\"\n />\n <mask\n id=\"${ringMaskId}\"\n style=\"mask-type: alpha\"\n maskUnits=\"userSpaceOnUse\"\n x=\"0\"\n y=\"0\"\n width=\"48\"\n height=\"48\"\n >\n <path\n d=\"M24 8C32.8366 8 40 15.1634 40 24C40 32.8366 32.8366 40 24 40C15.1634 40 8 32.8366 8 24C8 15.1634 15.1634 8 24 8ZM24 10C16.268 10 10 16.268 10 24C10 31.732 16.268 38 24 38C31.732 38 38 31.732 38 24C38 16.268 31.732 10 24 10Z\"\n fill=\"var(--instrument-frame-primary-color)\"\n />\n </mask>\n <g mask=\"url(#${ringMaskId})\">\n <path\n d=\"M24 0V24M24 24L19.8324 0.364611M24 24L15.7915 1.44736M24 24L12 3.21539M24 24L8.5731 5.61493M24 24L5.61494 8.5731M24 24L3.21539 12M24 24L1.44738 15.7915M24 24L0.364617 19.8324M24 24H0M24 24L0.364611 28.1676M24 24L1.44739 32.2085M24 24L3.21539 36M24 24L5.61493 39.4269M24 24L8.5731 42.3851M24 24L12 44.7846M24 24L15.7915 46.5526M24 24L19.8324 47.6354M24 24V48M24 24L28.1676 47.6354M24 24L32.2085 46.5526M24 24L36 44.7846M24 24L39.4269 42.3851M24 24L42.3851 39.4269M24 24L44.7846 36M24 24L46.5526 32.2085M24 24L47.6354 28.1676M24 24H48M24 24L47.6354 19.8325M24 24L46.5526 15.7915M24 24L44.7846 12M24 24L42.3851 8.57313M24 24L39.4269 5.61497M24 24L36 3.21539M24 24L32.2085 1.44741M24 24L28.1676 0.364646\"\n stroke=\"var(--instrument-frame-tertiary-color)\"\n />\n </g>\n <mask\n id=\"${crosshairMaskId}\"\n style=\"mask-type: alpha\"\n maskUnits=\"userSpaceOnUse\"\n x=\"-14\"\n y=\"-14\"\n width=\"76\"\n height=\"76\"\n >\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M24 42C33.9411 42 42 33.9411 42 24C42 14.0589 33.9411 6 24 6C14.0589 6 6 14.0589 6 24C6 33.9411 14.0589 42 24 42ZM24 36C30.6274 36 36 30.6274 36 24C36 17.3726 30.6274 12 24 12C17.3726 12 12 17.3726 12 24C12 30.6274 17.3726 36 24 36Z\"\n fill=\"var(--instrument-frame-primary-color)\"\n />\n </mask>\n <g mask=\"url(#${crosshairMaskId})\">\n <path\n d=\"M24 0V24M24 24H0M24 24V48M24 24H48\"\n stroke=\"var(--instrument-frame-tertiary-color)\"\n />\n </g>\n `;\n }\n\n private renderRoundIndicator(\n direction: string,\n arrowRotation: number,\n faceRotation: number\n ) {\n return html`\n <svg\n width=\"48\"\n height=\"48\"\n viewBox=\"0 0 48 48\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n ${this.renderCompassFace(faceRotation)}\n ${this.renderArrow(direction, {rotation: arrowRotation})}\n </svg>\n `;\n }\n\n private renderRegularNorthNeedle() {\n const tailClipId = `${this.idBase}-regular-north-tail-clip`;\n\n return svg`\n <g transform=\"rotate(${this.normalizedAngle - 315}, 24, 24)\">\n <g transform=\"translate(-5 -5)\">\n <svg\n x=\"14.5\"\n y=\"14.5\"\n width=\"19\"\n height=\"19\"\n viewBox=\"0 0 19 19\"\n overflow=\"visible\"\n >\n <g clip-path=\"url(#${tailClipId})\">\n <path\n d=\"M11.8398 17.0537L2.80041 3.49458C2.49725 3.03984 3.03904 2.49804 3.49379 2.80121L17.0529 11.8406C17.9318 12.4265 18.6859 13.1806 19.2717 14.0594L28.3112 27.6186C28.6143 28.0733 28.0726 28.6151 27.6178 28.312L14.0587 19.2725C13.1798 18.6867 12.4257 17.9326 11.8398 17.0537Z\"\n fill=\"var(--instrument-enhanced-secondary-color)\"\n stroke=\"var(--instrument-enhanced-secondary-color)\"\n />\n </g>\n <defs>\n <clipPath id=\"${tailClipId}\">\n <rect\n width=\"8\"\n height=\"18\"\n fill=\"white\"\n transform=\"translate(0 5.65723) rotate(-45)\"\n />\n </clipPath>\n </defs>\n </svg>\n <svg\n x=\"15.5\"\n y=\"15.5\"\n width=\"17\"\n height=\"17\"\n viewBox=\"0 0 17 17\"\n overflow=\"visible\"\n >\n <path\n d=\"M9.63184 14.8448L0.592403 1.2856C0.28924 0.830852 0.831036 0.289059 1.28578 0.592223L14.8449 9.63166C15.7238 10.2175 16.4779 10.9716 17.0637 11.8505L26.1032 25.4096C26.4063 25.8644 25.8645 26.4062 25.4098 26.103L11.8506 17.0636C10.9718 16.4777 10.2177 15.7236 9.63184 14.8448Z\"\n fill=\"none\"\n stroke=\"var(--instrument-enhanced-secondary-color)\"\n stroke-width=\"1.5\"\n />\n </svg>\n </g>\n <circle\n cx=\"24\"\n cy=\"24\"\n r=\"3\"\n fill=\"var(--instrument-frame-primary-color)\"\n stroke=\"var(--instrument-enhanced-secondary-color)\"\n stroke-width=\"2\"\n />\n </g>\n `;\n }\n\n private renderLabeledIndicator(direction: string) {\n const label = this.cardinalLabelPrimary;\n const isHeading = direction === CompassIndicatorDirection.Heading;\n\n return html`\n <svg\n width=\"48\"\n height=\"48\"\n viewBox=\"0 0 48 48\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <rect\n x=\"8\"\n y=\"8\"\n width=\"32\"\n height=\"32\"\n rx=\"4\"\n fill=\"var(--instrument-frame-primary-color)\"\n stroke=\"var(--instrument-frame-tertiary-color)\"\n />\n <text\n x=\"24\"\n y=\"11\"\n fill=\"var(--instrument-tick-mark-label-secondary-color)\"\n font-family=\"var(--global-typography-font-family)\"\n font-size=\"var(--global-typography-instrument-tick-mark-active-font-size)\"\n font-style=\"normal\"\n font-weight=\"var(--global-typography-instrument-tick-mark-active-font-weight)\"\n line-height=\"var(--global-typography-instrument-tick-mark-active-line-height)\"\n text-anchor=\"middle\"\n dominant-baseline=\"text-before-edge\"\n style=\"font-feature-settings: 'ss04' on;\"\n >\n ${label}\n </text>\n <g\n transform=\"translate(24 32) rotate(${this\n .normalizedAngle}) translate(-8 -8)\"\n >\n <path\n d=\"${LABELED_HEADING_ARROW_PATH}\"\n fill=\"${isHeading\n ? 'var(--instrument-enhanced-secondary-color)'\n : 'none'}\"\n stroke=\"${isHeading\n ? 'none'\n : 'var(--instrument-enhanced-secondary-color)'}\"\n stroke-width=\"${isHeading ? '0' : '1'}\"\n stroke-linejoin=\"round\"\n />\n </g>\n </svg>\n `;\n }\n\n private renderNorthIndicator(labeled: boolean) {\n const label = this.cardinalLabel;\n\n if (!labeled) {\n return html`\n <svg\n width=\"48\"\n height=\"48\"\n viewBox=\"0 0 48 48\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n ${this.renderCompassFace(0, false)} ${this.renderRegularNorthNeedle()}\n </svg>\n `;\n }\n\n return html`\n <svg\n width=\"48\"\n height=\"48\"\n viewBox=\"0 0 48 48\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle\n cx=\"24\"\n cy=\"24\"\n r=\"18\"\n fill=\"var(--instrument-frame-primary-color)\"\n stroke=\"var(--instrument-frame-tertiary-color)\"\n />\n <path d=\"M24 6.5V14\" stroke=\"var(--instrument-frame-tertiary-color)\" />\n <path d=\"M24 34V41.5\" stroke=\"var(--instrument-frame-tertiary-color)\" />\n <path d=\"M6.5 24H14\" stroke=\"var(--instrument-frame-tertiary-color)\" />\n <path d=\"M34 24H41.5\" stroke=\"var(--instrument-frame-tertiary-color)\" />\n ${this.renderRegularNorthNeedle()}\n <circle\n cx=\"24\"\n cy=\"24\"\n r=\"12\"\n fill=\"var(--instrument-frame-primary-color)\"\n stroke=\"var(--instrument-frame-tertiary-color)\"\n />\n <text\n x=\"24\"\n y=\"25\"\n fill=\"var(--element-neutral-color)\"\n font-family=\"var(--font-family-main)\"\n font-size=\"var(--global-typography-ui-label-active-font-size)\"\n font-weight=\"var(--global-typography-ui-label-active-font-weight)\"\n line-height=\"var(--global-typography-ui-label-active-line-height)\"\n text-anchor=\"middle\"\n dominant-baseline=\"middle\"\n >\n ${label}\n </text>\n </svg>\n `;\n }\n\n override render() {\n if (this.direction === CompassIndicatorDirection.North) {\n return this.renderNorthIndicator(\n this.type === CompassIndicatorType.Labeled\n );\n }\n\n if (this.type === CompassIndicatorType.Labeled) {\n return this.renderLabeledIndicator(this.direction);\n }\n\n return this.renderRoundIndicator(this.direction, 0, -this.normalizedAngle);\n }\n\n static override styles = unsafeCSS(componentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-compass-indicator': ObcCompassIndicator;\n }\n}\n"],"names":["CompassIndicatorType","CompassIndicatorDirection"],"mappings":";;;;;;;;;;;;;;AAKA,MAAM,qBACJ;AACF,MAAM,6BACJ;AACF,MAAM,oBACJ;AACF,MAAM,wBAAwB,CAAC,KAAK,MAAM,KAAK,MAAM,KAAK,MAAM,KAAK,IAAI;AACzE,MAAM,2BAA2B,CAAC,KAAK,KAAK,KAAK,GAAG;AAEpD,SAAS,eAAe,OAAuB;AAC7C,UAAS,QAAQ,MAAO,OAAO;AACjC;AAEO,IAAK,yCAAAA,0BAAL;AACLA,wBAAA,SAAA,IAAU;AACVA,wBAAA,SAAA,IAAU;AAFA,SAAAA;AAAA,GAAA,wBAAA,CAAA,CAAA;AAKL,IAAK,8CAAAC,+BAAL;AACLA,6BAAA,SAAA,IAAU;AACVA,6BAAA,QAAA,IAAS;AACTA,6BAAA,OAAA,IAAQ;AAHE,SAAAA;AAAA,GAAA,6BAAA,CAAA,CAAA;AA4BL,IAAM,sBAAN,cAAkC,WAAW;AAAA,EAA7C,cAAA;AAAA,UAAA,GAAA,SAAA;AACL,SAAQ,SAAS,qBAAqB,KAAK,OAAA,EAAS,SAAS,EAAE,EAAE,MAAM,GAAG,CAAC,CAAC;AAG5E,SAAA,QAAQ;AAGR,SAAA,OAA6B;AAG7B,SAAA,YAAuC;AAAA,EAAA;AAAA,EAEvC,IAAY,kBAA0B;AACpC,WAAO,eAAe,KAAK,KAAK;AAAA,EAClC;AAAA,EAEA,IAAY,gBAAwB;AACl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;AAAA;AAAA,IAG3E;AAEA,WAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAmBD,KAAK,0BAA0B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAmB7B,KAAK;AAAA;AAAA;AAAA;AAAA,EAIf;AAAA,EAES,SAAS;AAChB,QAAI,KAAK,cAAc,SAAiC;AACtD,aAAO,KAAK;AAAA,QACV,KAAK,SAAS;AAAA;AAAA,MAAA;AAAA,IAElB;AAEA,QAAI,KAAK,SAAS,WAA8B;AAC9C,aAAO,KAAK,uBAAuB,KAAK,SAAS;AAAA,IACnD;AAEA,WAAO,KAAK,qBAAqB,KAAK,WAAW,GAAG,CAAC,KAAK,eAAe;AAAA,EAC3E;AAGF;AAhVa,oBA+UK,SAAS,UAAU,cAAc;AA3UjD,gBAAA;AAAA,EADC,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAHb,oBAIX,WAAA,SAAA,CAAA;AAGA,gBAAA;AAAA,EADC,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GANb,oBAOX,WAAA,QAAA,CAAA;AAGA,gBAAA;AAAA,EADC,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GATb,oBAUX,WAAA,aAAA,CAAA;AAVW,sBAAN,gBAAA;AAAA,EADN,cAAc,uBAAuB;AAAA,GACzB,mBAAA;"}
1
+ {"version":3,"file":"compass-indicator.js","sources":["../../../src/navigation-instruments/compass-indicator/compass-indicator.ts"],"sourcesContent":["import {LitElement, html, svg, unsafeCSS} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport componentStyle from './compass-indicator.css?inline';\nimport {customElement} from '../../decorator.js';\n\nconst HEADING_ARROW_PATH =\n 'M23.1426 11.978C23.5519 11.2972 24.6131 11.3458 24.9297 12.1235L32.3877 30.4536L32.4336 30.5796C32.8455 31.8831 31.3809 32.9849 30.209 32.2808V32.2798L24 28.5835L17.79 32.2798L17.791 32.2808C16.5815 33.0075 15.0606 31.8106 15.6123 30.4536L23.0703 12.1235L23.1426 11.978Z';\nconst LABELED_HEADING_ARROW_PATH =\n 'M7.68919 1.5401C7.80154 1.26398 8.19911 1.26398 8.31146 1.5401L13.2832 13.7598C13.5226 14.3482 12.8616 14.8972 12.3115 14.5667L8.00033 11.9997L3.68917 14.5667C3.13908 14.8972 2.478 14.3482 2.71743 13.7598L7.68919 1.5401Z';\nconst COURSE_ARROW_PATH =\n 'M23.1426 11.978C23.5519 11.2972 24.6131 11.3458 24.9297 12.1235L32.3877 30.4536L32.4336 30.5796C32.8455 31.8831 31.3809 32.9849 30.209 32.2808V32.2798L24 28.5835L17.79 32.2798L17.791 32.2808C16.5815 33.0075 15.0606 31.8106 15.6123 30.4536L23.0703 12.1235L23.1426 11.978ZM20.0889 27.4087L23.7451 25.2388L24 25.0864L24.2549 25.2388L27.9102 27.4087L24 17.7974L20.0889 27.4087Z';\nconst CARDINAL_LABELS_8_WAY = ['N', 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW'];\nconst CARDINAL_LABELS_CARDINAL = ['N', 'E', 'S', 'W'];\n\nfunction normalizeAngle(angle: number): number {\n return ((angle % 360) + 360) % 360;\n}\n\nexport enum CompassIndicatorType {\n Regular = 'regular',\n Labeled = 'labeled',\n}\n\nexport enum CompassIndicatorDirection {\n Heading = 'heading',\n Course = 'course',\n North = 'north',\n}\n\n/**\n * `<obc-compass-indicator>` – A compact compass direction indicator with heading, course, and north variants.\n *\n * Renders a 48 x 48 directional indicator that can switch between a circular\n * compass face and labeled compact readouts. Use it when you need a small\n * directional cue next to a numeric readout or inside dense instrument layouts.\n *\n * ## Features\n *\n * - **Types**: `regular` shows the circular compass indicator; `labeled` shows a framed indicator with a single cardinal label.\n * - **Directions**: `heading`, `course`, and `north` each use their own visual symbol.\n * - **Angle-driven output**: `angle` rotates the active symbol and drives the derived label in labeled mode.\n * - **Orientation**: `northUp` keeps the compass face fixed north-up and rotates the arrow; when `false` the face rotates and the arrow stays pointing up (heading-up / course-up).\n *\n * ## Usage Guidelines\n *\n * - Use `direction=\"heading\"` for the filled heading arrow variant.\n * - Use `direction=\"course\"` for the outlined course arrow variant.\n * - Use `direction=\"north\"` for the north marker / bearing-style indicator.\n * - Switch `type` to `labeled` when the indicator should also communicate the\n * nearest cardinal direction as text.\n * - Set `northUp` to `false` to render a heading-up / course-up presentation\n * where the arrow stays vertical and the compass face rotates instead.\n */\n@customElement('obc-compass-indicator')\nexport class ObcCompassIndicator extends LitElement {\n private idBase = `compass-indicator-${Math.random().toString(36).slice(2, 9)}`;\n\n @property({type: Number})\n angle = 0;\n\n @property({type: String})\n type: CompassIndicatorType = CompassIndicatorType.Regular;\n\n @property({type: String})\n direction: CompassIndicatorDirection = CompassIndicatorDirection.Heading;\n\n /**\n * When `true` (default) the compass face stays north-up and the arrow\n * rotates by `angle`. When `false` the arrow stays pointing up and the\n * compass face rotates instead (heading-up / course-up presentation).\n *\n * Declared with `attribute: false` because the default is `true`; set it\n * via the JavaScript property (or framework binding) to opt out.\n */\n @property({type: Boolean, attribute: false})\n northUp: boolean = true;\n\n private get normalizedAngle(): number {\n return normalizeAngle(this.angle);\n }\n\n private get cardinalLabel(): string {\n const index =\n Math.round(this.normalizedAngle / 45) % CARDINAL_LABELS_8_WAY.length;\n return CARDINAL_LABELS_8_WAY[index];\n }\n\n private get cardinalLabelPrimary(): string {\n const index =\n Math.round(this.normalizedAngle / 90) % CARDINAL_LABELS_CARDINAL.length;\n return CARDINAL_LABELS_CARDINAL[index];\n }\n\n private renderArrow(\n direction: string,\n options?: {\n rotation?: number;\n translateY?: number;\n scale?: number;\n }\n ) {\n const {rotation = 0, translateY = 0, scale = 1} = options ?? {};\n const d =\n direction === CompassIndicatorDirection.Course\n ? COURSE_ARROW_PATH\n : HEADING_ARROW_PATH;\n\n return svg`\n <g transform=\"translate(0 ${translateY})\">\n <g transform=\"rotate(${rotation}, 24, 24)\">\n <g transform=\"translate(24 24) scale(${scale}) translate(-24 -24)\">\n <path\n d=\"${d}\"\n fill=\"var(--instrument-enhanced-secondary-color)\"\n stroke=\"var(--border-silhouette-color)\"\n />\n </g>\n </g>\n </g>\n `;\n }\n\n private renderCompassFace(rotation: number, showNorthMarker = true) {\n const ringMaskId = `${this.idBase}-ring-mask`;\n const crosshairMaskId = `${this.idBase}-crosshair-mask`;\n\n return svg`\n ${\n showNorthMarker\n ? svg`\n <path\n transform=\"rotate(${rotation}, 24, 24)\"\n d=\"M23.5929 1.56961L19.5645 7.20938C19.3281 7.54031 19.5646 8 19.9713 8L28.0281 8C28.4348 8 28.6714 7.54031 28.435 7.20938L24.4066 1.56961C24.2072 1.29044 23.7923 1.29044 23.5929 1.56961Z\"\n fill=\"var(--instrument-tick-mark-tertiary-color)\"\n />\n `\n : null\n }\n <circle\n cx=\"24\"\n cy=\"24\"\n r=\"18\"\n fill=\"var(--instrument-frame-primary-color)\"\n stroke=\"var(--instrument-frame-tertiary-color)\"\n />\n <mask\n id=\"${ringMaskId}\"\n style=\"mask-type: alpha\"\n maskUnits=\"userSpaceOnUse\"\n x=\"0\"\n y=\"0\"\n width=\"48\"\n height=\"48\"\n >\n <path\n d=\"M24 8C32.8366 8 40 15.1634 40 24C40 32.8366 32.8366 40 24 40C15.1634 40 8 32.8366 8 24C8 15.1634 15.1634 8 24 8ZM24 10C16.268 10 10 16.268 10 24C10 31.732 16.268 38 24 38C31.732 38 38 31.732 38 24C38 16.268 31.732 10 24 10Z\"\n fill=\"var(--instrument-frame-primary-color)\"\n />\n </mask>\n <g mask=\"url(#${ringMaskId})\">\n <path\n d=\"M24 0V24M24 24L19.8324 0.364611M24 24L15.7915 1.44736M24 24L12 3.21539M24 24L8.5731 5.61493M24 24L5.61494 8.5731M24 24L3.21539 12M24 24L1.44738 15.7915M24 24L0.364617 19.8324M24 24H0M24 24L0.364611 28.1676M24 24L1.44739 32.2085M24 24L3.21539 36M24 24L5.61493 39.4269M24 24L8.5731 42.3851M24 24L12 44.7846M24 24L15.7915 46.5526M24 24L19.8324 47.6354M24 24V48M24 24L28.1676 47.6354M24 24L32.2085 46.5526M24 24L36 44.7846M24 24L39.4269 42.3851M24 24L42.3851 39.4269M24 24L44.7846 36M24 24L46.5526 32.2085M24 24L47.6354 28.1676M24 24H48M24 24L47.6354 19.8325M24 24L46.5526 15.7915M24 24L44.7846 12M24 24L42.3851 8.57313M24 24L39.4269 5.61497M24 24L36 3.21539M24 24L32.2085 1.44741M24 24L28.1676 0.364646\"\n stroke=\"var(--instrument-frame-tertiary-color)\"\n />\n </g>\n <mask\n id=\"${crosshairMaskId}\"\n style=\"mask-type: alpha\"\n maskUnits=\"userSpaceOnUse\"\n x=\"-14\"\n y=\"-14\"\n width=\"76\"\n height=\"76\"\n >\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M24 42C33.9411 42 42 33.9411 42 24C42 14.0589 33.9411 6 24 6C14.0589 6 6 14.0589 6 24C6 33.9411 14.0589 42 24 42ZM24 36C30.6274 36 36 30.6274 36 24C36 17.3726 30.6274 12 24 12C17.3726 12 12 17.3726 12 24C12 30.6274 17.3726 36 24 36Z\"\n fill=\"var(--instrument-frame-primary-color)\"\n />\n </mask>\n <g mask=\"url(#${crosshairMaskId})\">\n <path\n d=\"M24 0V24M24 24H0M24 24V48M24 24H48\"\n stroke=\"var(--instrument-frame-tertiary-color)\"\n />\n </g>\n `;\n }\n\n private renderRoundIndicator(\n direction: string,\n arrowRotation: number,\n faceRotation: number\n ) {\n return html`\n <svg\n width=\"48\"\n height=\"48\"\n viewBox=\"0 0 48 48\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n ${this.renderCompassFace(faceRotation)}\n ${this.renderArrow(direction, {rotation: arrowRotation})}\n </svg>\n `;\n }\n\n private renderRegularNorthNeedle() {\n const tailClipId = `${this.idBase}-regular-north-tail-clip`;\n\n return svg`\n <g transform=\"rotate(${this.normalizedAngle - 315}, 24, 24)\">\n <g transform=\"translate(-5 -5)\">\n <svg\n x=\"14.5\"\n y=\"14.5\"\n width=\"19\"\n height=\"19\"\n viewBox=\"0 0 19 19\"\n overflow=\"visible\"\n >\n <g clip-path=\"url(#${tailClipId})\">\n <path\n d=\"M11.8398 17.0537L2.80041 3.49458C2.49725 3.03984 3.03904 2.49804 3.49379 2.80121L17.0529 11.8406C17.9318 12.4265 18.6859 13.1806 19.2717 14.0594L28.3112 27.6186C28.6143 28.0733 28.0726 28.6151 27.6178 28.312L14.0587 19.2725C13.1798 18.6867 12.4257 17.9326 11.8398 17.0537Z\"\n fill=\"var(--instrument-enhanced-secondary-color)\"\n stroke=\"var(--instrument-enhanced-secondary-color)\"\n />\n </g>\n <defs>\n <clipPath id=\"${tailClipId}\">\n <rect\n width=\"8\"\n height=\"18\"\n fill=\"white\"\n transform=\"translate(0 5.65723) rotate(-45)\"\n />\n </clipPath>\n </defs>\n </svg>\n <svg\n x=\"15.5\"\n y=\"15.5\"\n width=\"17\"\n height=\"17\"\n viewBox=\"0 0 17 17\"\n overflow=\"visible\"\n >\n <path\n d=\"M9.63184 14.8448L0.592403 1.2856C0.28924 0.830852 0.831036 0.289059 1.28578 0.592223L14.8449 9.63166C15.7238 10.2175 16.4779 10.9716 17.0637 11.8505L26.1032 25.4096C26.4063 25.8644 25.8645 26.4062 25.4098 26.103L11.8506 17.0636C10.9718 16.4777 10.2177 15.7236 9.63184 14.8448Z\"\n fill=\"none\"\n stroke=\"var(--instrument-enhanced-secondary-color)\"\n stroke-width=\"1.5\"\n />\n </svg>\n </g>\n <circle\n cx=\"24\"\n cy=\"24\"\n r=\"3\"\n fill=\"var(--instrument-frame-primary-color)\"\n stroke=\"var(--instrument-enhanced-secondary-color)\"\n stroke-width=\"2\"\n />\n </g>\n `;\n }\n\n private renderLabeledIndicator(direction: string) {\n const label = this.cardinalLabelPrimary;\n const isHeading = direction === CompassIndicatorDirection.Heading;\n\n return html`\n <svg\n width=\"48\"\n height=\"48\"\n viewBox=\"0 0 48 48\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <rect\n x=\"8\"\n y=\"8\"\n width=\"32\"\n height=\"32\"\n rx=\"4\"\n fill=\"var(--instrument-frame-primary-color)\"\n stroke=\"var(--instrument-frame-tertiary-color)\"\n />\n <text\n x=\"24\"\n y=\"11\"\n fill=\"var(--instrument-tick-mark-label-secondary-color)\"\n font-family=\"var(--global-typography-font-family)\"\n font-size=\"var(--global-typography-instrument-tick-mark-active-font-size)\"\n font-style=\"normal\"\n font-weight=\"var(--global-typography-instrument-tick-mark-active-font-weight)\"\n line-height=\"var(--global-typography-instrument-tick-mark-active-line-height)\"\n text-anchor=\"middle\"\n dominant-baseline=\"text-before-edge\"\n style=\"font-feature-settings: 'ss04' on;\"\n >\n ${label}\n </text>\n <g\n transform=\"translate(24 32) rotate(${this\n .normalizedAngle}) translate(-8 -8)\"\n >\n <path\n d=\"${LABELED_HEADING_ARROW_PATH}\"\n fill=\"${isHeading\n ? 'var(--instrument-enhanced-secondary-color)'\n : 'none'}\"\n stroke=\"${isHeading\n ? 'none'\n : 'var(--instrument-enhanced-secondary-color)'}\"\n stroke-width=\"${isHeading ? '0' : '1'}\"\n stroke-linejoin=\"round\"\n />\n </g>\n </svg>\n `;\n }\n\n private renderNorthIndicator(labeled: boolean) {\n const label = this.cardinalLabel;\n\n if (!labeled) {\n return html`\n <svg\n width=\"48\"\n height=\"48\"\n viewBox=\"0 0 48 48\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n ${this.renderCompassFace(0, false)} ${this.renderRegularNorthNeedle()}\n </svg>\n `;\n }\n\n return html`\n <svg\n width=\"48\"\n height=\"48\"\n viewBox=\"0 0 48 48\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle\n cx=\"24\"\n cy=\"24\"\n r=\"18\"\n fill=\"var(--instrument-frame-primary-color)\"\n stroke=\"var(--instrument-frame-tertiary-color)\"\n />\n <path d=\"M24 6.5V14\" stroke=\"var(--instrument-frame-tertiary-color)\" />\n <path d=\"M24 34V41.5\" stroke=\"var(--instrument-frame-tertiary-color)\" />\n <path d=\"M6.5 24H14\" stroke=\"var(--instrument-frame-tertiary-color)\" />\n <path d=\"M34 24H41.5\" stroke=\"var(--instrument-frame-tertiary-color)\" />\n ${this.renderRegularNorthNeedle()}\n <circle\n cx=\"24\"\n cy=\"24\"\n r=\"12\"\n fill=\"var(--instrument-frame-primary-color)\"\n stroke=\"var(--instrument-frame-tertiary-color)\"\n />\n <text\n x=\"24\"\n y=\"25\"\n fill=\"var(--element-neutral-color)\"\n font-family=\"var(--font-family-main)\"\n font-size=\"var(--global-typography-ui-label-active-font-size)\"\n font-weight=\"var(--global-typography-ui-label-active-font-weight)\"\n line-height=\"var(--global-typography-ui-label-active-line-height)\"\n text-anchor=\"middle\"\n dominant-baseline=\"middle\"\n >\n ${label}\n </text>\n </svg>\n `;\n }\n\n override render() {\n if (this.direction === CompassIndicatorDirection.North) {\n return this.renderNorthIndicator(\n this.type === CompassIndicatorType.Labeled\n );\n }\n\n if (this.type === CompassIndicatorType.Labeled) {\n return this.renderLabeledIndicator(this.direction);\n }\n\n return this.renderRoundIndicator(\n this.direction,\n this.northUp ? this.normalizedAngle : 0,\n this.northUp ? 0 : -this.normalizedAngle\n );\n }\n\n static override styles = unsafeCSS(componentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-compass-indicator': ObcCompassIndicator;\n }\n}\n"],"names":["CompassIndicatorType","CompassIndicatorDirection"],"mappings":";;;;;;;;;;;;;;AAKA,MAAM,qBACJ;AACF,MAAM,6BACJ;AACF,MAAM,oBACJ;AACF,MAAM,wBAAwB,CAAC,KAAK,MAAM,KAAK,MAAM,KAAK,MAAM,KAAK,IAAI;AACzE,MAAM,2BAA2B,CAAC,KAAK,KAAK,KAAK,G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,WAAO,KAAK;AAAA,MACV,KAAK;AAAA,MACL,KAAK,UAAU,KAAK,kBAAkB;AAAA,MACtC,KAAK,UAAU,IAAI,CAAC,KAAK;AAAA,IAAA;AAAA,EAE7B;AAGF;AA/Va,oBA8VK,SAAS,UAAU,cAAc;AA1VjD,gBAAA;AAAA,EADC,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAHb,oBAIX,WAAA,SAAA,CAAA;AAGA,gBAAA;AAAA,EADC,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GANb,oBAOX,WAAA,QAAA,CAAA;AAGA,gBAAA;AAAA,EADC,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GATb,oBAUX,WAAA,aAAA,CAAA;AAWA,gBAAA;AAAA,EADC,SAAS,EAAC,MAAM,SAAS,WAAW,OAAM;AAAA,GApBhC,oBAqBX,WAAA,WAAA,CAAA;AArBW,sBAAN,gBAAA;AAAA,EADN,cAAc,uBAAuB;AAAA,GACzB,mBAAA;"}
@@ -9,10 +9,10 @@ export interface VelocityProjectionDatapoint {
9
9
  }
10
10
  export declare class ObcVelocityProjectionPlot extends LitElement {
11
11
  dataPoints: VelocityProjectionDatapoint[];
12
- instantWindDirectionDeg: number | null;
13
- instantWindSpeedNumber: number | null;
14
- instantCurrentDirectionDeg: number | null;
15
- instantCurrentSpeedNumber: number | null;
12
+ currentWindFromDirection: number | null;
13
+ currentWindSpeedKnots: number | null;
14
+ currentFromDirection: number | null;
15
+ currentSpeedKnots: number | null;
16
16
  vesselImage: VesselImage;
17
17
  render(): import('lit-html').TemplateResult<1>;
18
18
  private isSelected;
@@ -1 +1 @@
1
- {"version":3,"file":"velocity-projection-plot.d.ts","sourceRoot":"","sources":["../../../src/navigation-instruments/velocity-projection-plot/velocity-projection-plot.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAMX,MAAM,KAAK,CAAC;AAGb,OAAO,mBAAmB,CAAC;AAC3B,OAAO,EAAC,WAAW,EAAkB,MAAM,mBAAmB,CAAC;AAG/D,MAAM,WAAW,2BAA2B;IAC1C,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,4BAA4B,EAAE,MAAM,CAAC;IACrC,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,qBACa,yBAA0B,SAAQ,UAAU;IAEvD,UAAU,EAAE,2BAA2B,EAAE,CAAM;IAE/C,uBAAuB,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE9C,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE7C,0BAA0B,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEjD,yBAAyB,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEhD,WAAW,EAAE,WAAW,CAA4B;IAC3C,MAAM;IA4Bf,OAAO,CAAC,UAAU;IASlB,OAAO,CAAC,KAAK;IAoBb,OAAO,CAAC,eAAe;IAiEvB,OAAgB,MAAM,0BAA2B;CAClD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,8BAA8B,EAAE,yBAAyB,CAAC;KAC3D;CACF"}
1
+ {"version":3,"file":"velocity-projection-plot.d.ts","sourceRoot":"","sources":["../../../src/navigation-instruments/velocity-projection-plot/velocity-projection-plot.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAMX,MAAM,KAAK,CAAC;AAGb,OAAO,mBAAmB,CAAC;AAC3B,OAAO,EAAC,WAAW,EAAkB,MAAM,mBAAmB,CAAC;AAG/D,MAAM,WAAW,2BAA2B;IAC1C,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,4BAA4B,EAAE,MAAM,CAAC;IACrC,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,qBACa,yBAA0B,SAAQ,UAAU;IAEvD,UAAU,EAAE,2BAA2B,EAAE,CAAM;IAE/C,wBAAwB,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE/C,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE5C,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE3C,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAQ;IAExC,WAAW,EAAE,WAAW,CAA4B;IAC3C,MAAM;IAgCf,OAAO,CAAC,UAAU;IASlB,OAAO,CAAC,KAAK;IAoBb,OAAO,CAAC,eAAe;IAiEvB,OAAgB,MAAM,0BAA2B;CAClD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,8BAA8B,EAAE,yBAAyB,CAAC;KAC3D;CACF"}
@@ -18,15 +18,16 @@ let ObcVelocityProjectionPlot = class extends LitElement {
18
18
  constructor() {
19
19
  super(...arguments);
20
20
  this.dataPoints = [];
21
- this.instantWindDirectionDeg = null;
22
- this.instantWindSpeedNumber = null;
23
- this.instantCurrentDirectionDeg = null;
24
- this.instantCurrentSpeedNumber = null;
21
+ this.currentWindFromDirection = null;
22
+ this.currentWindSpeedKnots = null;
23
+ this.currentFromDirection = null;
24
+ this.currentSpeedKnots = null;
25
25
  this.vesselImage = VesselImage.cargoWindTop;
26
26
  }
27
27
  render() {
28
28
  const width = 320;
29
29
  const viewBox = `-${width / 2} -${width / 2} ${width} ${width}`;
30
+ const currentLevel = this.currentSpeedKnots == null ? null : Math.max(0, Math.min(4, Math.round(this.currentSpeedKnots)));
30
31
  return html`
31
32
  <div class="container">
32
33
  <obc-watch
@@ -39,10 +40,10 @@ let ObcVelocityProjectionPlot = class extends LitElement {
39
40
  transform: ""
40
41
  }
41
42
  ]}
42
- .windFromDirectionDeg=${this.instantWindDirectionDeg}
43
- .wind=${this.instantWindSpeedNumber}
44
- .currentFromDirectionDeg=${this.instantCurrentDirectionDeg}
45
- .current=${this.instantCurrentSpeedNumber}
43
+ .windFromDirectionDeg=${this.currentWindFromDirection}
44
+ .windKnots=${this.currentWindSpeedKnots}
45
+ .currentFromDirectionDeg=${this.currentFromDirection}
46
+ .current=${currentLevel}
46
47
  .padding=${70}
47
48
  >
48
49
  </obc-watch>
@@ -51,8 +52,8 @@ let ObcVelocityProjectionPlot = class extends LitElement {
51
52
  `;
52
53
  }
53
54
  isSelected(dp) {
54
- if (this.instantWindDirectionDeg != null) {
55
- return dp.startAngleDeg <= this.instantWindDirectionDeg && dp.endAngleDeg >= this.instantWindDirectionDeg;
55
+ if (this.currentWindFromDirection != null) {
56
+ return dp.startAngleDeg <= this.currentWindFromDirection && dp.endAngleDeg >= this.currentWindFromDirection;
56
57
  }
57
58
  return true;
58
59
  }
@@ -123,16 +124,16 @@ __decorateClass([
123
124
  ], ObcVelocityProjectionPlot.prototype, "dataPoints", 2);
124
125
  __decorateClass([
125
126
  property({ type: Number })
126
- ], ObcVelocityProjectionPlot.prototype, "instantWindDirectionDeg", 2);
127
+ ], ObcVelocityProjectionPlot.prototype, "currentWindFromDirection", 2);
127
128
  __decorateClass([
128
129
  property({ type: Number })
129
- ], ObcVelocityProjectionPlot.prototype, "instantWindSpeedNumber", 2);
130
+ ], ObcVelocityProjectionPlot.prototype, "currentWindSpeedKnots", 2);
130
131
  __decorateClass([
131
132
  property({ type: Number })
132
- ], ObcVelocityProjectionPlot.prototype, "instantCurrentDirectionDeg", 2);
133
+ ], ObcVelocityProjectionPlot.prototype, "currentFromDirection", 2);
133
134
  __decorateClass([
134
135
  property({ type: Number })
135
- ], ObcVelocityProjectionPlot.prototype, "instantCurrentSpeedNumber", 2);
136
+ ], ObcVelocityProjectionPlot.prototype, "currentSpeedKnots", 2);
136
137
  __decorateClass([
137
138
  property({ type: String })
138
139
  ], ObcVelocityProjectionPlot.prototype, "vesselImage", 2);
@@ -1 +1 @@
1
- {"version":3,"file":"velocity-projection-plot.js","sources":["../../../src/navigation-instruments/velocity-projection-plot/velocity-projection-plot.ts"],"sourcesContent":["import {\n LitElement,\n SVGTemplateResult,\n html,\n nothing,\n svg,\n unsafeCSS,\n} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport compentStyle from './velocity-projection-plot.css?inline';\nimport '../watch/watch.js';\nimport {VesselImage, VesselImageSize} from '../watch/watch.js';\nimport {customElement} from '../../decorator.js';\n\nexport interface VelocityProjectionDatapoint {\n startAngleDeg: number;\n endAngleDeg: number;\n ratioWindEnergyOrExcessSpeed: number; // If the ratio is below 1, the value is the ratio of wind energy, if it is above 1, the value is the ratio of excess speed\n ratioTotalEnergy: number;\n}\n\n@customElement('obc-velocity-projection-plot')\nexport class ObcVelocityProjectionPlot extends LitElement {\n @property({type: Array, attribute: false})\n dataPoints: VelocityProjectionDatapoint[] = [];\n @property({type: Number})\n instantWindDirectionDeg: number | null = null;\n @property({type: Number})\n instantWindSpeedNumber: number | null = null;\n @property({type: Number})\n instantCurrentDirectionDeg: number | null = null;\n @property({type: Number})\n instantCurrentSpeedNumber: number | null = null;\n @property({type: String})\n vesselImage: VesselImage = VesselImage.cargoWindTop;\n override render() {\n const width = 320;\n const viewBox = `-${width / 2} -${width / 2} ${width} ${width}`;\n\n return html`\n <div class=\"container\">\n <obc-watch\n crosshairEnabled\n northArrow\n .vessels=${[\n {\n size: VesselImageSize.small,\n vesselImage: this.vesselImage,\n transform: '',\n },\n ]}\n .windFromDirectionDeg=${this.instantWindDirectionDeg}\n .wind=${this.instantWindSpeedNumber}\n .currentFromDirectionDeg=${this.instantCurrentDirectionDeg}\n .current=${this.instantCurrentSpeedNumber}\n .padding=${70}\n >\n </obc-watch>\n <svg viewBox=\"${viewBox}\">${this.renderPlotLines()}</svg>\n </div>\n `;\n }\n\n private isSelected(dp: VelocityProjectionDatapoint): boolean {\n if (this.instantWindDirectionDeg != null) {\n return (\n dp.startAngleDeg <= this.instantWindDirectionDeg &&\n dp.endAngleDeg >= this.instantWindDirectionDeg\n );\n }\n return true;\n }\n private color(dp: VelocityProjectionDatapoint): {\n totalEnergy: string;\n windEnergy: string;\n speed: string;\n } {\n if (this.isSelected(dp)) {\n return {\n totalEnergy: 'var(--instrument-frame-tertiary-color)',\n windEnergy: 'var(--instrument-enhanced-tertiary-color)',\n speed: 'var(--instrument-enhanced-secondary-color)',\n };\n } else {\n return {\n totalEnergy: 'var(--instrument-frame-primary-color)',\n windEnergy: 'var(--instrument-frame-secondary-color)',\n speed: 'var(--instrument-frame-secondary-color)',\n };\n }\n }\n\n private renderPlotLines(): SVGTemplateResult {\n const innerRadius = 65 / 2;\n\n const dataPoints = this.dataPoints;\n const maxLength = Math.max(\n ...dataPoints.map(\n (dp) => dp.ratioWindEnergyOrExcessSpeed * dp.ratioTotalEnergy\n ),\n ...dataPoints.map((dp) => dp.ratioTotalEnergy)\n );\n\n const elements = dataPoints.map((dp) => {\n const startAngle = (dp.startAngleDeg * Math.PI) / 180 - Math.PI / 2;\n const endAngle = (dp.endAngleDeg * Math.PI) / 180 - Math.PI / 2;\n\n const c = this.color(dp);\n\n const totalEnergyRadius =\n (100 - innerRadius) * (dp.ratioTotalEnergy / maxLength) + innerRadius;\n const windEnergyOrExcessSpeedRadius =\n (totalEnergyRadius - innerRadius) * dp.ratioWindEnergyOrExcessSpeed +\n innerRadius;\n\n const innerArchPath = `M ${Math.cos(endAngle) * innerRadius} ${Math.sin(endAngle) * innerRadius} A ${innerRadius} ${innerRadius} 0 0 0 ${Math.cos(startAngle) * innerRadius} ${Math.sin(startAngle) * innerRadius}`;\n\n const totalEnergyArchPath = `${Math.cos(startAngle) * totalEnergyRadius} ${Math.sin(startAngle) * totalEnergyRadius} A ${totalEnergyRadius} ${totalEnergyRadius} 0 0 1 ${Math.cos(endAngle) * totalEnergyRadius} ${Math.sin(endAngle) * totalEnergyRadius}`;\n\n const windEnergyOrExcessSpeedArchPath = `${Math.cos(startAngle) * windEnergyOrExcessSpeedRadius} ${Math.sin(startAngle) * windEnergyOrExcessSpeedRadius} A ${windEnergyOrExcessSpeedRadius} ${windEnergyOrExcessSpeedRadius} 1 0 1 ${Math.cos(endAngle) * windEnergyOrExcessSpeedRadius} ${Math.sin(endAngle) * windEnergyOrExcessSpeedRadius}`;\n\n const windEnergyOrExcessSpeedArchPathReverse = `${Math.cos(endAngle) * windEnergyOrExcessSpeedRadius} ${Math.sin(endAngle) * windEnergyOrExcessSpeedRadius} A ${windEnergyOrExcessSpeedRadius} ${windEnergyOrExcessSpeedRadius} 1 0 0 ${Math.cos(startAngle) * windEnergyOrExcessSpeedRadius} ${Math.sin(startAngle) * windEnergyOrExcessSpeedRadius}`;\n const windEnergyPie = svg`<path d=\"${innerArchPath} L ${windEnergyOrExcessSpeedArchPath} Z\" fill=${c.windEnergy} stroke=${c.windEnergy} stroke-width=\"1\" />`;\n const windEnergyArch = svg`<path d=\"M${windEnergyOrExcessSpeedArchPath}\" fill=\"none\" stroke=${c.windEnergy} stroke-width=\"1\" />`;\n const totalEnergyArch = svg`\n <path d=\"M${totalEnergyArchPath}\" fill=\"none\" stroke=\"var(--border-silhouette-color)\" stroke-width=\"2\" />\n <path d=\"M${totalEnergyArchPath}\" fill=\"none\" stroke=\"var(--element-inactive-color)\" stroke-width=\"1\" />\n `;\n\n const totalEneryPie = svg`<path d=\"${innerArchPath} L ${totalEnergyArchPath} Z\" fill=${c.totalEnergy}/>`;\n\n const speedPie =\n dp.ratioWindEnergyOrExcessSpeed > 1\n ? svg`<path d=\"M${totalEnergyArchPath} L ${windEnergyOrExcessSpeedArchPathReverse} Z\" fill=${c.speed}/>`\n : nothing;\n\n const maxRadius =\n Math.max(totalEnergyRadius, windEnergyOrExcessSpeedRadius) + 0.5;\n const minRadius = innerRadius - 0.5;\n const startLine = svg`<line x1=\"${Math.cos(startAngle) * minRadius}\" y1=\"${Math.sin(startAngle) * minRadius}\" x2=\"${Math.cos(startAngle) * maxRadius}\" y2=\"${Math.sin(startAngle) * maxRadius}\" stroke=\"var(--border-silhouette-color)\" stroke-width=\"1\" />`;\n const endLine = svg`<line x1=\"${Math.cos(endAngle) * minRadius}\" y1=\"${Math.sin(endAngle) * minRadius}\" x2=\"${Math.cos(endAngle) * maxRadius}\" y2=\"${Math.sin(endAngle) * maxRadius}\" stroke=\"var(--border-silhouette-color)\" stroke-width=\"1\" />`;\n return svg`<g>\n ${totalEneryPie}\n ${windEnergyPie}\n ${speedPie}\n ${totalEnergyArch}\n ${windEnergyArch}\n ${startLine}\n ${endLine}\n </g>`;\n });\n\n return svg`<g>\n ${elements}\n </g>`;\n }\n\n static override styles = unsafeCSS(compentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-velocity-projection-plot': ObcVelocityProjectionPlot;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAsBO,IAAM,4BAAN,cAAwC,WAAW;AAAA,EAAnD,cAAA;AAAA,UAAA,GAAA,SAAA;AAEL,SAAA,aAA4C,CAAA;AAE5C,SAAA,0BAAyC;AAEzC,SAAA,yBAAwC;AAExC,SAAA,6BAA4C;AAE5C,SAAA,4BAA2C;AAE3C,SAAA,cAA2B,YAAY;AAAA,EAAA;AAAA,EAC9B,SAAS;AAChB,UAAM,QAAQ;AACd,UAAM,UAAU,IAAI,QAAQ,CAAC,KAAK,QAAQ,CAAC,IAAI,KAAK,IAAI,KAAK;AAE7D,WAAO;AAAA;AAAA;AAAA;AAAA;AAAA,qBAKU;AAAA,MACT;AAAA,QACE,MAAM,gBAAgB;AAAA,QACtB,aAAa,KAAK;AAAA,QAClB,WAAW;AAAA,MAAA;AAAA,IACb,CACD;AAAA,kCACuB,KAAK,uBAAuB;AAAA,kBAC5C,KAAK,sBAAsB;AAAA,qCACR,KAAK,0BAA0B;AAAA,qBAC/C,KAAK,yBAAyB;AAAA,qBAC9B,EAAE;AAAA;AAAA;AAAA,wBAGC,OAAO,KAAK,KAAK,gBAAA,CAAiB;AAAA;AAAA;AAAA,EAGxD;AAAA,EAEQ,WAAW,IAA0C;AAC3D,QAAI,KAAK,2BAA2B,MAAM;AACxC,aACE,GAAG,iBAAiB,KAAK,2BACzB,GAAG,eAAe,KAAK;AAAA,IAE3B;AACA,WAAO;AAAA,EACT;AAAA,EACQ,MAAM,IAIZ;AACA,QAAI,KAAK,WAAW,EAAE,GAAG;AACvB,a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O;AAAA;AAAA,IAEb,CAAC;AAED,WAAO;AAAA,UACD,QAAQ;AAAA;AAAA,EAEhB;AAGF;AAxIa,0BAuIK,SAAS,UAAU,YAAY;AArI/C,gBAAA;AAAA,EADC,SAAS,EAAC,MAAM,OAAO,WAAW,OAAM;AAAA,GAD9B,0BAEX,WAAA,cAAA,CAAA;AAEA,gBAAA;AAAA,EADC,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAHb,0BAIX,WAAA,2BAAA,CAAA;AAEA,gBAAA;AAAA,EADC,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GALb,0BAMX,WAAA,0BAAA,CAAA;AAEA,gBAAA;AAAA,EADC,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAPb,0BAQX,WAAA,8BAAA,CAAA;AAEA,gBAAA;AAAA,EADC,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GATb,0BAUX,WAAA,6BAAA,CAAA;AAEA,gBAAA;AAAA,EADC,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAXb,0BAYX,WAAA,eAAA,CAAA;AAZW,4BAAN,gBAAA;AAAA,EADN,cAAc,8BAA8B;AAAA,GAChC,yBAAA;"}
1
+ {"version":3,"file":"velocity-projection-plot.js","sources":["../../../src/navigation-instruments/velocity-projection-plot/velocity-projection-plot.ts"],"sourcesContent":["import {\n LitElement,\n SVGTemplateResult,\n html,\n nothing,\n svg,\n unsafeCSS,\n} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport compentStyle from './velocity-projection-plot.css?inline';\nimport '../watch/watch.js';\nimport {VesselImage, VesselImageSize} from '../watch/watch.js';\nimport {customElement} from '../../decorator.js';\n\nexport interface VelocityProjectionDatapoint {\n startAngleDeg: number;\n endAngleDeg: number;\n ratioWindEnergyOrExcessSpeed: number; // If the ratio is below 1, the value is the ratio of wind energy, if it is above 1, the value is the ratio of excess speed\n ratioTotalEnergy: number;\n}\n\n@customElement('obc-velocity-projection-plot')\nexport class ObcVelocityProjectionPlot extends LitElement {\n @property({type: Array, attribute: false})\n dataPoints: VelocityProjectionDatapoint[] = [];\n @property({type: Number})\n currentWindFromDirection: number | null = null;\n @property({type: Number})\n currentWindSpeedKnots: number | null = null;\n @property({type: Number})\n currentFromDirection: number | null = null;\n @property({type: Number})\n currentSpeedKnots: number | null = null;\n @property({type: String})\n vesselImage: VesselImage = VesselImage.cargoWindTop;\n override render() {\n const width = 320;\n const viewBox = `-${width / 2} -${width / 2} ${width} ${width}`;\n const currentLevel =\n this.currentSpeedKnots == null\n ? null\n : Math.max(0, Math.min(4, Math.round(this.currentSpeedKnots)));\n\n return html`\n <div class=\"container\">\n <obc-watch\n crosshairEnabled\n northArrow\n .vessels=${[\n {\n size: VesselImageSize.small,\n vesselImage: this.vesselImage,\n transform: '',\n },\n ]}\n .windFromDirectionDeg=${this.currentWindFromDirection}\n .windKnots=${this.currentWindSpeedKnots}\n .currentFromDirectionDeg=${this.currentFromDirection}\n .current=${currentLevel}\n .padding=${70}\n >\n </obc-watch>\n <svg viewBox=\"${viewBox}\">${this.renderPlotLines()}</svg>\n </div>\n `;\n }\n\n private isSelected(dp: VelocityProjectionDatapoint): boolean {\n if (this.currentWindFromDirection != null) {\n return (\n dp.startAngleDeg <= this.currentWindFromDirection &&\n dp.endAngleDeg >= this.currentWindFromDirection\n );\n }\n return true;\n }\n private color(dp: VelocityProjectionDatapoint): {\n totalEnergy: string;\n windEnergy: string;\n speed: string;\n } {\n if (this.isSelected(dp)) {\n return {\n totalEnergy: 'var(--instrument-frame-tertiary-color)',\n windEnergy: 'var(--instrument-enhanced-tertiary-color)',\n speed: 'var(--instrument-enhanced-secondary-color)',\n };\n } else {\n return {\n totalEnergy: 'var(--instrument-frame-primary-color)',\n windEnergy: 'var(--instrument-frame-secondary-color)',\n speed: 'var(--instrument-frame-secondary-color)',\n };\n }\n }\n\n private renderPlotLines(): SVGTemplateResult {\n const innerRadius = 65 / 2;\n\n const dataPoints = this.dataPoints;\n const maxLength = Math.max(\n ...dataPoints.map(\n (dp) => dp.ratioWindEnergyOrExcessSpeed * dp.ratioTotalEnergy\n ),\n ...dataPoints.map((dp) => dp.ratioTotalEnergy)\n );\n\n const elements = dataPoints.map((dp) => {\n const startAngle = (dp.startAngleDeg * Math.PI) / 180 - Math.PI / 2;\n const endAngle = (dp.endAngleDeg * Math.PI) / 180 - Math.PI / 2;\n\n const c = this.color(dp);\n\n const totalEnergyRadius =\n (100 - innerRadius) * (dp.ratioTotalEnergy / maxLength) + innerRadius;\n const windEnergyOrExcessSpeedRadius =\n (totalEnergyRadius - innerRadius) * dp.ratioWindEnergyOrExcessSpeed +\n innerRadius;\n\n const innerArchPath = `M ${Math.cos(endAngle) * innerRadius} ${Math.sin(endAngle) * innerRadius} A ${innerRadius} ${innerRadius} 0 0 0 ${Math.cos(startAngle) * innerRadius} ${Math.sin(startAngle) * innerRadius}`;\n\n const totalEnergyArchPath = `${Math.cos(startAngle) * totalEnergyRadius} ${Math.sin(startAngle) * totalEnergyRadius} A ${totalEnergyRadius} ${totalEnergyRadius} 0 0 1 ${Math.cos(endAngle) * totalEnergyRadius} ${Math.sin(endAngle) * totalEnergyRadius}`;\n\n const windEnergyOrExcessSpeedArchPath = `${Math.cos(startAngle) * windEnergyOrExcessSpeedRadius} ${Math.sin(startAngle) * windEnergyOrExcessSpeedRadius} A ${windEnergyOrExcessSpeedRadius} ${windEnergyOrExcessSpeedRadius} 1 0 1 ${Math.cos(endAngle) * windEnergyOrExcessSpeedRadius} ${Math.sin(endAngle) * windEnergyOrExcessSpeedRadius}`;\n\n const windEnergyOrExcessSpeedArchPathReverse = `${Math.cos(endAngle) * windEnergyOrExcessSpeedRadius} ${Math.sin(endAngle) * windEnergyOrExcessSpeedRadius} A ${windEnergyOrExcessSpeedRadius} ${windEnergyOrExcessSpeedRadius} 1 0 0 ${Math.cos(startAngle) * windEnergyOrExcessSpeedRadius} ${Math.sin(startAngle) * windEnergyOrExcessSpeedRadius}`;\n const windEnergyPie = svg`<path d=\"${innerArchPath} L ${windEnergyOrExcessSpeedArchPath} Z\" fill=${c.windEnergy} stroke=${c.windEnergy} stroke-width=\"1\" />`;\n const windEnergyArch = svg`<path d=\"M${windEnergyOrExcessSpeedArchPath}\" fill=\"none\" stroke=${c.windEnergy} stroke-width=\"1\" />`;\n const totalEnergyArch = svg`\n <path d=\"M${totalEnergyArchPath}\" fill=\"none\" stroke=\"var(--border-silhouette-color)\" stroke-width=\"2\" />\n <path d=\"M${totalEnergyArchPath}\" fill=\"none\" stroke=\"var(--element-inactive-color)\" stroke-width=\"1\" />\n `;\n\n const totalEneryPie = svg`<path d=\"${innerArchPath} L ${totalEnergyArchPath} Z\" fill=${c.totalEnergy}/>`;\n\n const speedPie =\n dp.ratioWindEnergyOrExcessSpeed > 1\n ? svg`<path d=\"M${totalEnergyArchPath} L ${windEnergyOrExcessSpeedArchPathReverse} Z\" fill=${c.speed}/>`\n : nothing;\n\n const maxRadius =\n Math.max(totalEnergyRadius, windEnergyOrExcessSpeedRadius) + 0.5;\n const minRadius = innerRadius - 0.5;\n const startLine = svg`<line x1=\"${Math.cos(startAngle) * minRadius}\" y1=\"${Math.sin(startAngle) * minRadius}\" x2=\"${Math.cos(startAngle) * maxRadius}\" y2=\"${Math.sin(startAngle) * maxRadius}\" stroke=\"var(--border-silhouette-color)\" stroke-width=\"1\" />`;\n const endLine = svg`<line x1=\"${Math.cos(endAngle) * minRadius}\" y1=\"${Math.sin(endAngle) * minRadius}\" x2=\"${Math.cos(endAngle) * maxRadius}\" y2=\"${Math.sin(endAngle) * maxRadius}\" stroke=\"var(--border-silhouette-color)\" stroke-width=\"1\" />`;\n return svg`<g>\n ${totalEneryPie}\n ${windEnergyPie}\n ${speedPie}\n ${totalEnergyArch}\n ${windEnergyArch}\n ${startLine}\n ${endLine}\n </g>`;\n });\n\n return svg`<g>\n ${elements}\n </g>`;\n }\n\n static override styles = unsafeCSS(compentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-velocity-projection-plot':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AAA;AAAA,EADC,SAAS,EAAC,MAAM,OAAO,WAAW,OAAM;AAAA,GAD9B,0BAEX,WAAA,cAAA,CAAA;AAEA,gBAAA;AAAA,EADC,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAHb,0BAIX,WAAA,4BAAA,CAAA;AAEA,gBAAA;AAAA,EADC,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GALb,0BAMX,WAAA,yBAAA,CAAA;AAEA,gBAAA;AAAA,EADC,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAPb,0BAQX,WAAA,wBAAA,CAAA;AAEA,gBAAA;AAAA,EADC,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GATb,0BAUX,WAAA,qBAAA,CAAA;AAEA,gBAAA;AAAA,EADC,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAXb,0BAYX,WAAA,eAAA,CAAA;AAZW,4BAAN,gBAAA;AAAA,EADN,cAAc,8BAA8B;AAAA,GAChC,yBAAA;"}
@@ -1,6 +1,44 @@
1
1
  import { SVGTemplateResult } from 'lit';
2
+ import '../../icons/icon-wind-true-1.js';
3
+ import '../../icons/icon-wind-true-2.js';
4
+ import '../../icons/icon-wind-true-3.js';
5
+ import '../../icons/icon-wind-true-4.js';
6
+ import '../../icons/icon-wind-true-5.js';
7
+ import '../../icons/icon-wind-true-6.js';
8
+ import '../../icons/icon-wind-true-7.js';
9
+ import '../../icons/icon-wind-true-8.js';
10
+ import '../../icons/icon-wind-true-9.js';
11
+ import '../../icons/icon-wind-true-10.js';
12
+ import '../../icons/icon-wind-true-11.js';
13
+ import '../../icons/icon-wind-true-12.js';
14
+ import '../../icons/icon-wind-true-13.js';
15
+ import '../../icons/icon-wind-true-14.js';
16
+ /**
17
+ * Maps a wind speed in **knots** to a wind-barb icon index in `[1, 14]`.
18
+ *
19
+ * Implements the designer-confirmed "Option C" mapping: speeds round to
20
+ * the nearest 5-knot bucket (with two sub-pennant buckets for calm and
21
+ * near-calm conditions):
22
+ *
23
+ * | Knots range | Icon | Glyph |
24
+ * | ----------- | ---- | -------------------- |
25
+ * | `[0, 0.5)` | 1 | calm |
26
+ * | `[0.5, 2.5)`| 2 | shaft only |
27
+ * | `[2.5, 7.5)`| 3 | shaft + ½ barb |
28
+ * | `[7.5, 12.5)`| 4 | shaft + 1 full barb |
29
+ * | …5-kn steps…| … | … |
30
+ * | `[42.5, 47.5)`| 11 | shaft + 4 full + ½ |
31
+ * | `[47.5, 55)`| 12 | pennant (50 kn) |
32
+ * | `[55, 65)` | 13 | pennant + 1 full barb |
33
+ * | `[65, ∞)` | 14 | pennant + 2 full barbs |
34
+ *
35
+ * The 55 / 65 / 100-knot buckets currently collapse to the nearest
36
+ * available icon; dedicated glyphs are tracked for a follow-up icon
37
+ * refresh. Non-finite / null / undefined inputs fall back to icon 1.
38
+ */
39
+ export declare function windKnotsToIconIndex(knots: number | null | undefined): number;
2
40
  export declare function renderWind(options: {
3
- wind: number;
41
+ windKnots: number;
4
42
  fromDirectionDeg: number;
5
43
  radius: number;
6
44
  color?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../../src/navigation-instruments/watch/environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,iBAAiB,EAAC,MAAM,KAAK,CAAC;AAG3C,wBAAgB,UAAU,CAAC,OAAO,EAAE;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,iBAAiB,CAOpB;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,iBAAiB,CAOpB;AAiBD,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CA6G7D,CAAC"}
1
+ {"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../../src/navigation-instruments/watch/environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,iBAAiB,EAAC,MAAM,KAAK,CAAC;AAE3C,OAAO,iCAAiC,CAAC;AACzC,OAAO,iCAAiC,CAAC;AACzC,OAAO,iCAAiC,CAAC;AACzC,OAAO,iCAAiC,CAAC;AACzC,OAAO,iCAAiC,CAAC;AACzC,OAAO,iCAAiC,CAAC;AACzC,OAAO,iCAAiC,CAAC;AACzC,OAAO,iCAAiC,CAAC;AACzC,OAAO,iCAAiC,CAAC;AACzC,OAAO,kCAAkC,CAAC;AAC1C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,kCAAkC,CAAC;AAgD1C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAiB7E;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,iBAAiB,CAkBpB;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,iBAAiB,CAOpB;AAiBD,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CA6B7D,CAAC"}