flight-indicators 1.2.1 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -7,8 +7,8 @@ var DEFAULT_ANIMATION_MS = 300;
7
7
  var clamp = (value, min, max) => Math.min(max, Math.max(min, value));
8
8
  var finite = (value, fallback = 0) => typeof value === "number" && Number.isFinite(value) ? value : fallback;
9
9
  var round = (n) => Math.round(n * 100) / 100;
10
- function polar(r, deg, cx = CENTER, cy = CENTER) {
11
- const a = deg * Math.PI / 180;
10
+ function polar(r, deg2, cx = CENTER, cy = CENTER) {
11
+ const a = deg2 * Math.PI / 180;
12
12
  return [round(cx + r * Math.sin(a)), round(cy - r * Math.cos(a))];
13
13
  }
14
14
  function arcPath(r, startDeg, endDeg) {
@@ -18,9 +18,9 @@ function arcPath(r, startDeg, endDeg) {
18
18
  const sweep = endDeg >= startDeg ? 1 : 0;
19
19
  return `M ${x1} ${y1} A ${r} ${r} 0 ${largeArc} ${sweep} ${x2} ${y2}`;
20
20
  }
21
- function tickPath(r1, r2, deg) {
22
- const [x1, y1] = polar(r1, deg);
23
- const [x2, y2] = polar(r2, deg);
21
+ function tickPath(r1, r2, deg2) {
22
+ const [x1, y1] = polar(r1, deg2);
23
+ const [x2, y2] = polar(r2, deg2);
24
24
  return `M ${x1} ${y1} L ${x2} ${y2}`;
25
25
  }
26
26
  function range(start, end, step) {
@@ -54,6 +54,47 @@ function useSvgId(prefix) {
54
54
 
55
55
  // src/components/Instrument.tsx
56
56
  import { jsx, jsxs } from "react/jsx-runtime";
57
+ var KNOB_PLACES = {
58
+ "bottom-left": [46, 354, 30],
59
+ "bottom-right": [354, 354, 30],
60
+ bottom: [CENTER, 376, 17]
61
+ };
62
+ function Knob({ id, label: label2, position, angle = 0, animationDuration = DEFAULT_ANIMATION_MS }) {
63
+ const [cx, cy, r] = KNOB_PLACES[position];
64
+ const display2 = useContinuousAngle(angle);
65
+ const step = 360 / 28;
66
+ return /* @__PURE__ */ jsxs("g", { "data-testid": `knob-${id}`, children: [
67
+ /* @__PURE__ */ jsx("circle", { cx, cy: cy + 2, r: r + 2, fill: "#000", opacity: "0.55" }),
68
+ /* @__PURE__ */ jsxs("g", { "data-testid": `knob-${id}-rim`, style: motionStyle(`rotate(${display2}deg)`, animationDuration, cx, cy), children: [
69
+ /* @__PURE__ */ jsx("circle", { cx, cy, r, fill: "#2e2e2e", stroke: "#000", strokeWidth: "2" }),
70
+ /* @__PURE__ */ jsx("g", { stroke: "#111", strokeWidth: r > 20 ? 3 : 2, children: range(0, 360 - step, step).map((a) => {
71
+ const rad = a * Math.PI / 180;
72
+ return /* @__PURE__ */ jsx(
73
+ "path",
74
+ {
75
+ d: `M ${cx + (r - 5) * Math.sin(rad)} ${cy - (r - 5) * Math.cos(rad)} L ${cx + r * Math.sin(rad)} ${cy - r * Math.cos(rad)}`
76
+ },
77
+ a
78
+ );
79
+ }) }),
80
+ /* @__PURE__ */ jsx("path", { d: `M ${cx} ${cy - r + 1} v ${r * 0.22}`, stroke: "#ddd", strokeWidth: "2", strokeLinecap: "round" })
81
+ ] }),
82
+ /* @__PURE__ */ jsx("circle", { cx, cy, r: r * 0.72, fill: "#1f1f1f", stroke: "#cfcfcf", strokeWidth: r > 20 ? 2 : 1.5 }),
83
+ label2 && /* @__PURE__ */ jsx(
84
+ "text",
85
+ {
86
+ x: cx,
87
+ y: cy,
88
+ fill: "#eee",
89
+ fontSize: Math.min(13, r * 1.15 / Math.max(1, label2.length * 0.6)),
90
+ fontWeight: "bold",
91
+ textAnchor: "middle",
92
+ dominantBaseline: "central",
93
+ children: label2
94
+ }
95
+ )
96
+ ] });
97
+ }
57
98
  var SCREWS = [
58
99
  [32, 32],
59
100
  [368, 32],
@@ -63,6 +104,9 @@ var SCREWS = [
63
104
  function InstrumentFrame({
64
105
  size = 200,
65
106
  showBox = true,
107
+ showKnobs = true,
108
+ knobs,
109
+ animationDuration,
66
110
  className,
67
111
  style,
68
112
  title,
@@ -98,7 +142,8 @@ function InstrumentFrame({
98
142
  ] }),
99
143
  /* @__PURE__ */ jsx("circle", { cx: CENTER, cy: CENTER, r: "196", fill: `url(#${bezelId})` }),
100
144
  /* @__PURE__ */ jsx("circle", { cx: CENTER, cy: CENTER, r: "182", fill: "#111", stroke: "#000", strokeWidth: "4" }),
101
- children
145
+ children,
146
+ showKnobs && knobs?.map((k) => /* @__PURE__ */ jsx(Knob, { ...k, animationDuration }, k.id))
102
147
  ]
103
148
  }
104
149
  );
@@ -131,6 +176,7 @@ function AttitudeIndicator({ roll = 0, pitch = 0, pitchLimit = 40, ...props }) {
131
176
  {
132
177
  ...props,
133
178
  label: `Attitude indicator: pitch ${Math.round(safePitch)}\xB0, roll ${Math.round(safeRoll)}\xB0`,
179
+ knobs: [{ id: "adjust", position: "bottom" }],
134
180
  children: [
135
181
  /* @__PURE__ */ jsx2("defs", { children: /* @__PURE__ */ jsx2("clipPath", { id: clipId, children: /* @__PURE__ */ jsx2("circle", { cx: CENTER, cy: CENTER, r: FACE_R }) }) }),
136
182
  /* @__PURE__ */ jsxs2("g", { clipPath: `url(#${clipId})`, children: [
@@ -158,9 +204,9 @@ function AttitudeIndicator({ roll = 0, pitch = 0, pitchLimit = 40, ...props }) {
158
204
  ]
159
205
  }
160
206
  ),
161
- /* @__PURE__ */ jsx2("g", { stroke: "#fff", strokeWidth: "4", strokeLinecap: "round", children: ROLL_MARKS.flatMap(([deg, len]) => [
162
- /* @__PURE__ */ jsx2("path", { d: tickPath(FACE_R - 2, FACE_R - 2 - len, -deg) }, `l${deg}`),
163
- /* @__PURE__ */ jsx2("path", { d: tickPath(FACE_R - 2, FACE_R - 2 - len, deg) }, `r${deg}`)
207
+ /* @__PURE__ */ jsx2("g", { stroke: "#fff", strokeWidth: "4", strokeLinecap: "round", children: ROLL_MARKS.flatMap(([deg2, len]) => [
208
+ /* @__PURE__ */ jsx2("path", { d: tickPath(FACE_R - 2, FACE_R - 2 - len, -deg2) }, `l${deg2}`),
209
+ /* @__PURE__ */ jsx2("path", { d: tickPath(FACE_R - 2, FACE_R - 2 - len, deg2) }, `r${deg2}`)
164
210
  ]) }),
165
211
  /* @__PURE__ */ jsx2("path", { d: `M ${CENTER} ${CENTER - 158} l -10 -18 h 20 z`, fill: "#fff" }),
166
212
  /* @__PURE__ */ jsx2("g", { "data-testid": "attitude-roll-pointer", style: motionStyle(`rotate(${-displayRoll}deg)`, duration), children: /* @__PURE__ */ jsx2("path", { d: `M ${CENTER} ${CENTER - 156} l -10 18 h 20 z`, fill: "#ffb000" }) })
@@ -183,41 +229,49 @@ function HeadingIndicator({ heading = 0, ...props }) {
183
229
  const safeHeading = finite(heading);
184
230
  const normalised = (Math.round(safeHeading) % 360 + 360) % 360;
185
231
  const displayHeading = useContinuousAngle(safeHeading);
186
- return /* @__PURE__ */ jsxs3(InstrumentFrame, { ...props, label: `Heading indicator: ${String(normalised).padStart(3, "0")}\xB0`, children: [
187
- /* @__PURE__ */ jsxs3("g", { "data-testid": "heading-card", style: motionStyle(`rotate(${-displayHeading}deg)`, duration), children: [
188
- /* @__PURE__ */ jsx3("g", { stroke: "#fff", strokeLinecap: "round", children: range(0, 355, 5).map((a) => /* @__PURE__ */ jsx3("path", { d: tickPath(176, a % 10 === 0 ? 152 : 164, a), strokeWidth: a % 10 === 0 ? 3 : 2 }, a)) }),
189
- range(0, 330, 30).map((a) => {
190
- const [x, y] = polar(132, a);
191
- const label2 = CARDINALS[a] ?? String(a / 10);
192
- return /* @__PURE__ */ jsx3(
193
- "text",
232
+ return /* @__PURE__ */ jsxs3(
233
+ InstrumentFrame,
234
+ {
235
+ ...props,
236
+ label: `Heading indicator: ${String(normalised).padStart(3, "0")}\xB0`,
237
+ knobs: [{ id: "set", label: "PUSH", position: "bottom-left", angle: safeHeading }],
238
+ children: [
239
+ /* @__PURE__ */ jsxs3("g", { "data-testid": "heading-card", style: motionStyle(`rotate(${-displayHeading}deg)`, duration), children: [
240
+ /* @__PURE__ */ jsx3("g", { stroke: "#fff", strokeLinecap: "round", children: range(0, 355, 5).map((a) => /* @__PURE__ */ jsx3("path", { d: tickPath(176, a % 10 === 0 ? 152 : 164, a), strokeWidth: a % 10 === 0 ? 3 : 2 }, a)) }),
241
+ range(0, 330, 30).map((a) => {
242
+ const [x, y] = polar(132, a);
243
+ const label2 = CARDINALS[a] ?? String(a / 10);
244
+ return /* @__PURE__ */ jsx3(
245
+ "text",
246
+ {
247
+ x,
248
+ y,
249
+ transform: `rotate(${a} ${x} ${y})`,
250
+ fill: a % 90 === 0 ? "#ffb000" : "#fff",
251
+ fontSize: a % 90 === 0 ? 30 : 26,
252
+ fontWeight: "bold",
253
+ textAnchor: "middle",
254
+ dominantBaseline: "central",
255
+ children: label2
256
+ },
257
+ a
258
+ );
259
+ })
260
+ ] }),
261
+ /* @__PURE__ */ jsx3("g", { stroke: "#ffb000", strokeWidth: "4", strokeLinecap: "round", children: [45, 135, 225, 315].map((a) => /* @__PURE__ */ jsx3("path", { d: tickPath(192, 178, a) }, a)) }),
262
+ /* @__PURE__ */ jsx3("path", { d: `M ${CENTER} ${CENTER - 150} l -9 -26 h 18 z`, fill: "#ffb000" }),
263
+ /* @__PURE__ */ jsx3(
264
+ "path",
194
265
  {
195
- x,
196
- y,
197
- transform: `rotate(${a} ${x} ${y})`,
198
- fill: a % 90 === 0 ? "#ffb000" : "#fff",
199
- fontSize: a % 90 === 0 ? 30 : 26,
200
- fontWeight: "bold",
201
- textAnchor: "middle",
202
- dominantBaseline: "central",
203
- children: label2
204
- },
205
- a
206
- );
207
- })
208
- ] }),
209
- /* @__PURE__ */ jsx3("g", { stroke: "#ffb000", strokeWidth: "4", strokeLinecap: "round", children: [45, 135, 225, 315].map((a) => /* @__PURE__ */ jsx3("path", { d: tickPath(192, 178, a) }, a)) }),
210
- /* @__PURE__ */ jsx3("path", { d: `M ${CENTER} ${CENTER - 150} l -9 -26 h 18 z`, fill: "#ffb000" }),
211
- /* @__PURE__ */ jsx3(
212
- "path",
213
- {
214
- d: "M200 135 c6 0 8 8 8 16 v30 l52 18 v12 l-52 -8 v34 l18 12 v10 l-26 -6 l-26 6 v-10 l18 -12 v-34 l-52 8 v-12 l52 -18 v-30 c0 -8 2 -16 8 -16 z",
215
- fill: "#ffb000",
216
- stroke: "#000",
217
- strokeWidth: "2"
218
- }
219
- )
220
- ] });
266
+ d: "M200 135 c6 0 8 8 8 16 v30 l52 18 v12 l-52 -8 v34 l18 12 v10 l-26 -6 l-26 6 v-10 l18 -12 v-34 l-52 8 v-12 l52 -18 v-30 c0 -8 2 -16 8 -16 z",
267
+ fill: "#ffb000",
268
+ stroke: "#000",
269
+ strokeWidth: "2"
270
+ }
271
+ )
272
+ ]
273
+ }
274
+ );
221
275
  }
222
276
 
223
277
  // src/components/Airspeed.tsx
@@ -266,25 +320,33 @@ function Altimeter({ altitude = 0, pressure, pressureUnit = "hPa", ...props }) {
266
320
  const alt = finite(altitude);
267
321
  const qnh = finite(pressure, STANDARD[pressureUnit]);
268
322
  const qnhText = pressureUnit === "inHg" ? qnh.toFixed(2) : Math.round(qnh).toString();
269
- return /* @__PURE__ */ jsxs5(InstrumentFrame, { ...props, label: `Altimeter: ${Math.round(alt)} feet, ${qnhText} ${pressureUnit}`, children: [
270
- /* @__PURE__ */ jsx5("g", { stroke: "#fff", strokeLinecap: "round", children: range(0, 49, 1).map((i) => /* @__PURE__ */ jsx5("path", { d: tickPath(178, i % 5 === 0 ? 150 : 164, i * 7.2), strokeWidth: i % 5 === 0 ? 4 : 2 }, i)) }),
271
- range(0, 9, 1).map((n) => {
272
- const [x, y] = polar(126, n * 36);
273
- return /* @__PURE__ */ jsx5("text", { x, y, fill: "#fff", fontSize: "32", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: n }, n);
274
- }),
275
- /* @__PURE__ */ jsx5("text", { x: CENTER, y: CENTER - 58, fill: "#ccc", fontSize: "16", textAnchor: "middle", children: "ALT" }),
276
- /* @__PURE__ */ jsx5("text", { x: CENTER, y: CENTER - 40, fill: "#ccc", fontSize: "12", textAnchor: "middle", children: "100 FEET" }),
277
- /* @__PURE__ */ jsx5("rect", { x: CENTER + 30, y: CENTER - 16, width: "74", height: "32", rx: "4", fill: "#000", stroke: "#666", strokeWidth: "2" }),
278
- /* @__PURE__ */ jsx5("text", { "data-testid": "altimeter-pressure", x: CENTER + 67, y: CENTER + 1, fill: "#fff", fontSize: "20", fontFamily: "monospace", textAnchor: "middle", dominantBaseline: "central", children: qnhText }),
279
- /* @__PURE__ */ jsx5("text", { x: CENTER + 67, y: CENTER + 30, fill: "#ccc", fontSize: "12", textAnchor: "middle", children: pressureUnit }),
280
- /* @__PURE__ */ jsxs5("g", { "data-testid": "altimeter-10000", style: motionStyle(`rotate(${alt / 1e5 * 360}deg)`, duration), children: [
281
- /* @__PURE__ */ jsx5("path", { d: `M ${CENTER} ${CENTER} L ${CENTER} ${CENTER - 150}`, stroke: "#fff", strokeWidth: "3" }),
282
- /* @__PURE__ */ jsx5("path", { d: `M ${CENTER} ${CENTER - 178} l -10 22 h 20 z`, fill: "#fff" })
283
- ] }),
284
- /* @__PURE__ */ jsx5("g", { "data-testid": "altimeter-1000", style: motionStyle(`rotate(${alt / 1e4 * 360}deg)`, duration), children: /* @__PURE__ */ jsx5("path", { d: `M ${CENTER - 9} ${CENTER + 14} L ${CENTER - 12} ${CENTER - 70} L ${CENTER} ${CENTER - 100} L ${CENTER + 12} ${CENTER - 70} L ${CENTER + 9} ${CENTER + 14} Z`, fill: "#fff", stroke: "#000", strokeWidth: "1.5" }) }),
285
- /* @__PURE__ */ jsx5("g", { "data-testid": "altimeter-100", style: motionStyle(`rotate(${alt / 1e3 * 360}deg)`, duration), children: /* @__PURE__ */ jsx5("path", { d: `M ${CENTER - 5} ${CENTER + 30} L ${CENTER - 4} ${CENTER - 140} L ${CENTER} ${CENTER - 168} L ${CENTER + 4} ${CENTER - 140} L ${CENTER + 5} ${CENTER + 30} Z`, fill: "#fff", stroke: "#000", strokeWidth: "1.5" }) }),
286
- /* @__PURE__ */ jsx5(Hub, {})
287
- ] });
323
+ return /* @__PURE__ */ jsxs5(
324
+ InstrumentFrame,
325
+ {
326
+ ...props,
327
+ label: `Altimeter: ${Math.round(alt)} feet, ${qnhText} ${pressureUnit}`,
328
+ knobs: [{ id: "baro", label: "BARO", position: "bottom-left", angle: Math.round((qnh - STANDARD[pressureUnit]) * (pressureUnit === "inHg" ? 3e4 : 1e3)) / 100 }],
329
+ children: [
330
+ /* @__PURE__ */ jsx5("g", { stroke: "#fff", strokeLinecap: "round", children: range(0, 49, 1).map((i) => /* @__PURE__ */ jsx5("path", { d: tickPath(178, i % 5 === 0 ? 150 : 164, i * 7.2), strokeWidth: i % 5 === 0 ? 4 : 2 }, i)) }),
331
+ range(0, 9, 1).map((n) => {
332
+ const [x, y] = polar(126, n * 36);
333
+ return /* @__PURE__ */ jsx5("text", { x, y, fill: "#fff", fontSize: "32", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: n }, n);
334
+ }),
335
+ /* @__PURE__ */ jsx5("text", { x: CENTER, y: CENTER - 58, fill: "#ccc", fontSize: "16", textAnchor: "middle", children: "ALT" }),
336
+ /* @__PURE__ */ jsx5("text", { x: CENTER, y: CENTER - 40, fill: "#ccc", fontSize: "12", textAnchor: "middle", children: "100 FEET" }),
337
+ /* @__PURE__ */ jsx5("rect", { x: CENTER + 30, y: CENTER - 16, width: "74", height: "32", rx: "4", fill: "#000", stroke: "#666", strokeWidth: "2" }),
338
+ /* @__PURE__ */ jsx5("text", { "data-testid": "altimeter-pressure", x: CENTER + 67, y: CENTER + 1, fill: "#fff", fontSize: "20", fontFamily: "monospace", textAnchor: "middle", dominantBaseline: "central", children: qnhText }),
339
+ /* @__PURE__ */ jsx5("text", { x: CENTER + 67, y: CENTER + 30, fill: "#ccc", fontSize: "12", textAnchor: "middle", children: pressureUnit }),
340
+ /* @__PURE__ */ jsxs5("g", { "data-testid": "altimeter-10000", style: motionStyle(`rotate(${alt / 1e5 * 360}deg)`, duration), children: [
341
+ /* @__PURE__ */ jsx5("path", { d: `M ${CENTER} ${CENTER} L ${CENTER} ${CENTER - 150}`, stroke: "#fff", strokeWidth: "3" }),
342
+ /* @__PURE__ */ jsx5("path", { d: `M ${CENTER} ${CENTER - 178} l -10 22 h 20 z`, fill: "#fff" })
343
+ ] }),
344
+ /* @__PURE__ */ jsx5("g", { "data-testid": "altimeter-1000", style: motionStyle(`rotate(${alt / 1e4 * 360}deg)`, duration), children: /* @__PURE__ */ jsx5("path", { d: `M ${CENTER - 9} ${CENTER + 14} L ${CENTER - 12} ${CENTER - 70} L ${CENTER} ${CENTER - 100} L ${CENTER + 12} ${CENTER - 70} L ${CENTER + 9} ${CENTER + 14} Z`, fill: "#fff", stroke: "#000", strokeWidth: "1.5" }) }),
345
+ /* @__PURE__ */ jsx5("g", { "data-testid": "altimeter-100", style: motionStyle(`rotate(${alt / 1e3 * 360}deg)`, duration), children: /* @__PURE__ */ jsx5("path", { d: `M ${CENTER - 5} ${CENTER + 30} L ${CENTER - 4} ${CENTER - 140} L ${CENTER} ${CENTER - 168} L ${CENTER + 4} ${CENTER - 140} L ${CENTER + 5} ${CENTER + 30} Z`, fill: "#fff", stroke: "#000", strokeWidth: "1.5" }) }),
346
+ /* @__PURE__ */ jsx5(Hub, {})
347
+ ]
348
+ }
349
+ );
288
350
  }
289
351
 
290
352
  // src/components/VerticalSpeed.tsx
@@ -328,8 +390,8 @@ var TUBE_CY = 40;
328
390
  var TUBE_R = 240;
329
391
  var TUBE_SPAN = 16;
330
392
  var BALL_TRAVEL = 13;
331
- function tubePoint(deg) {
332
- const a = deg * Math.PI / 180;
393
+ function tubePoint(deg2) {
394
+ const a = deg2 * Math.PI / 180;
333
395
  return [CENTER + TUBE_R * Math.sin(a), TUBE_CY + TUBE_R * Math.cos(a)];
334
396
  }
335
397
  function TurnCoordinator({ turnRate = 0, slip = 0, ...props }) {
@@ -380,7 +442,7 @@ var MIRROR = { L: "R", C: "C", R: "L" };
380
442
  var WIND = "#3cc8ff";
381
443
  var AMBER = "#ffb000";
382
444
  var GREEN = "#3ddc84";
383
- var norm = (deg) => (deg % 360 + 360) % 360;
445
+ var norm = (deg2) => (deg2 % 360 + 360) % 360;
384
446
  function designator(heading) {
385
447
  const n = Math.round(norm(heading) / 10) % 36;
386
448
  return String(n === 0 ? 36 : n).padStart(2, "0");
@@ -573,7 +635,7 @@ var SWING_LENGTH = 165;
573
635
  var SWING_DOT_RADIUS = 156;
574
636
  var SWING_DEG_PER_DOT = 7.5;
575
637
  var SWING_FULL_SCALE_DEG = SWING_DEG_PER_DOT * 5;
576
- var norm2 = (deg) => (deg % 360 + 360) % 360;
638
+ var norm2 = (deg2) => (deg2 % 360 + 360) % 360;
577
639
  var signedDiff = (a, b) => ((a - b) % 360 + 540) % 360 - 180;
578
640
  function vorDeviation(course, radial) {
579
641
  const d = signedDiff(radial, course);
@@ -612,7 +674,7 @@ function VorIndicator({ course = 0, radial, deviation, toFrom, signal = true, ne
612
674
  const needleAngle = -(dev / FULL_SCALE_DEG) * SWING_FULL_SCALE_DEG;
613
675
  const devText = Math.abs(dev) < 0.05 ? "centred" : `${Math.abs(dev).toFixed(1)}\xB0 ${dev > 0 ? "right" : "left"}`;
614
676
  const label2 = signal ? `VOR indicator: course ${courseText}\xB0, needle ${devText}, ${flag === "OFF" ? "no TO/FROM indication" : flag}` : `VOR indicator: course ${courseText}\xB0, no signal`;
615
- return /* @__PURE__ */ jsxs9(InstrumentFrame, { ...props, label: label2, children: [
677
+ return /* @__PURE__ */ jsxs9(InstrumentFrame, { ...props, label: label2, knobs: [{ id: "obs", label: "OBS", position: "bottom-left", angle: crs }], children: [
616
678
  /* @__PURE__ */ jsxs9("g", { "data-testid": "vor-card", style: motionStyle(`rotate(${-displayCourse}deg)`, duration), children: [
617
679
  /* @__PURE__ */ jsx9("g", { stroke: "#fff", strokeLinecap: "round", children: range(0, 355, 5).map((a) => /* @__PURE__ */ jsx9("path", { d: tickPath(176, a % 10 === 0 ? 152 : 164, a), strokeWidth: a % 10 === 0 ? 3 : 2 }, a)) }),
618
680
  range(0, 330, 30).map((a) => {
@@ -743,16 +805,327 @@ function VorIndicator({ course = 0, radial, deviation, toFrom, signal = true, ne
743
805
  ] });
744
806
  }
745
807
 
746
- // src/components/AdfIndicator.tsx
747
- import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
808
+ // src/components/IlsIndicator.tsx
809
+ import { Fragment as Fragment3, jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
748
810
  var CARDINALS4 = { 0: "N", 90: "E", 180: "S", 270: "W" };
811
+ var YELLOW = "#d8e03a";
812
+ var FLAG = "#d9814f";
813
+ var SCALE_GREY = "#2c2c2c";
814
+ var DOT_SPACING2 = 18;
815
+ var FULL_SCALE_PX2 = DOT_SPACING2 * 5;
816
+ var LOC_PIVOT_Y = CENTER + 108;
817
+ var GS_PIVOT_X = CENTER - 108;
818
+ var SWING_LENGTH2 = 260;
819
+ var FLAG_OFFSET = 108;
820
+ var NEEDLE_CLIP_R = 150;
821
+ var SCALE_HALF = 112;
822
+ var GS_PARK_PX = -120;
823
+ var norm3 = (deg2) => (deg2 % 360 + 360) % 360;
824
+ var round2 = (n) => Math.round(n * 100) / 100 + 0;
825
+ var deg = (rad) => round2(rad * 180 / Math.PI);
826
+ function FlagWindow({ x, y, axis, visible, testId }) {
827
+ const [w, h] = axis === "h" ? [52, 24] : [24, 52];
828
+ const arrow = axis === "h" ? `M ${x - 18} ${y} H ${x + 18} M ${x - 12} ${y - 6} L ${x - 18} ${y} L ${x - 12} ${y + 6} M ${x + 12} ${y - 6} L ${x + 18} ${y} L ${x + 12} ${y + 6}` : `M ${x} ${y - 18} V ${y + 18} M ${x - 6} ${y - 12} L ${x} ${y - 18} L ${x + 6} ${y - 12} M ${x - 6} ${y + 12} L ${x} ${y + 18} L ${x + 6} ${y + 12}`;
829
+ return /* @__PURE__ */ jsxs10("g", { children: [
830
+ /* @__PURE__ */ jsx10("rect", { x: x - w / 2 - 3, y: y - h / 2 - 3, width: w + 6, height: h + 6, rx: "3", fill: "#050505", stroke: "#444", strokeWidth: "1.5" }),
831
+ /* @__PURE__ */ jsxs10("g", { "data-testid": testId, opacity: visible ? 1 : 0, style: { transition: "opacity 200ms ease-out" }, children: [
832
+ /* @__PURE__ */ jsx10("rect", { x: x - w / 2, y: y - h / 2, width: w, height: h, rx: "2", fill: FLAG }),
833
+ /* @__PURE__ */ jsx10("path", { d: arrow, stroke: "#1a1a1a", strokeWidth: "3", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" })
834
+ ] })
835
+ ] });
836
+ }
837
+ function NeedleLine({ d }) {
838
+ return /* @__PURE__ */ jsxs10(Fragment3, { children: [
839
+ /* @__PURE__ */ jsx10("path", { d, stroke: "#000", strokeWidth: "7", strokeLinecap: "round" }),
840
+ /* @__PURE__ */ jsx10("path", { d, stroke: "#eee", strokeWidth: "4", strokeLinecap: "round" })
841
+ ] });
842
+ }
843
+ function IlsIndicator({
844
+ course = 0,
845
+ radial,
846
+ deviation,
847
+ fullScale = 10,
848
+ toFrom,
849
+ signal = true,
850
+ glideslope,
851
+ glideslopeFullScale = 0.7,
852
+ glideslopeSignal,
853
+ needles = "slide",
854
+ ...props
855
+ }) {
856
+ const duration = props.animationDuration ?? DEFAULT_ANIMATION_MS;
857
+ const crs = finite(course);
858
+ const computed = typeof radial === "number" && Number.isFinite(radial) ? vorDeviation(crs, radial) : void 0;
859
+ const locScale = finite(fullScale, 10) > 0 ? finite(fullScale, 10) : 10;
860
+ const gsScale = finite(glideslopeFullScale, 0.7) > 0 ? finite(glideslopeFullScale, 0.7) : 0.7;
861
+ const dev = signal ? clamp(finite(deviation, computed?.deviation ?? 0), -locScale, locScale) : 0;
862
+ const flag = !signal ? "OFF" : toFrom ?? computed?.toFrom ?? "OFF";
863
+ const hasGs = glideslopeSignal ?? (typeof glideslope === "number" && Number.isFinite(glideslope));
864
+ const gs = hasGs ? clamp(finite(glideslope), -gsScale, gsScale) : 0;
865
+ const swing = needles === "swing";
866
+ const locX = round2(dev / locScale * FULL_SCALE_PX2);
867
+ const gsY = hasGs ? round2(-(gs / gsScale) * FULL_SCALE_PX2) : swing ? GS_PARK_PX : 0;
868
+ const locAngle = deg(Math.atan2(locX, LOC_PIVOT_Y - CENTER));
869
+ const gsAngle = deg(Math.atan2(gsY, CENTER - GS_PIVOT_X));
870
+ const displayCourse = useContinuousAngle(crs);
871
+ const courseText = String(Math.round(norm3(crs)) || 360).padStart(3, "0");
872
+ const devText = Math.abs(dev) < 0.05 ? "centred" : `${Math.abs(dev).toFixed(1)}\xB0 ${dev > 0 ? "right" : "left"}`;
873
+ const gsText = !hasGs ? "glideslope off" : Math.abs(gs) < 5e-3 ? "glideslope centred" : `glideslope ${Math.abs(gs).toFixed(2)}\xB0 ${gs > 0 ? "up" : "down"}`;
874
+ const label2 = signal ? `ILS indicator: course ${courseText}\xB0, course needle ${devText}, ${gsText}, ${flag === "OFF" ? "no TO/FROM indication" : flag}` : `ILS indicator: course ${courseText}\xB0, no NAV signal, ${gsText}`;
875
+ const clipId = useSvgId("fi-ils-clip");
876
+ const dots = range(1, 5, 1).flatMap((i) => [-i, i]);
877
+ return /* @__PURE__ */ jsxs10(InstrumentFrame, { ...props, label: label2, knobs: [{ id: "obs", label: "OBS", position: "bottom-left", angle: crs }], children: [
878
+ /* @__PURE__ */ jsxs10("g", { "data-testid": "ils-card", style: motionStyle(`rotate(${-displayCourse}deg)`, duration), children: [
879
+ /* @__PURE__ */ jsx10("g", { stroke: "#eee", strokeLinecap: "butt", children: range(0, 355, 5).map((a) => /* @__PURE__ */ jsx10("path", { d: tickPath(170, a % 10 === 0 ? 154 : 162, a), strokeWidth: a % 10 === 0 ? 4 : 2.5 }, a)) }),
880
+ range(0, 330, 30).map((a) => {
881
+ const [x, y] = polar(136, a);
882
+ return /* @__PURE__ */ jsx10(
883
+ "text",
884
+ {
885
+ x,
886
+ y,
887
+ transform: `rotate(${a} ${x} ${y})`,
888
+ fill: "#ddd",
889
+ fontSize: a % 90 === 0 ? 26 : 22,
890
+ fontWeight: "bold",
891
+ textAnchor: "middle",
892
+ dominantBaseline: "central",
893
+ children: CARDINALS4[a] ?? String(a / 10)
894
+ },
895
+ a
896
+ );
897
+ })
898
+ ] }),
899
+ /* @__PURE__ */ jsx10("path", { d: `M ${CENTER} ${CENTER - 151} l -11 -19 h 22 z`, fill: YELLOW, stroke: "#000", strokeWidth: "1" }),
900
+ /* @__PURE__ */ jsx10("path", { d: `M ${CENTER} ${CENTER + 151} l -8 13 h 16 z`, fill: YELLOW, stroke: "#000", strokeWidth: "1" }),
901
+ /* @__PURE__ */ jsxs10("g", { fontSize: "13", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: [
902
+ /* @__PURE__ */ jsx10("rect", { x: CENTER + 34, y: CENTER - 86, width: "40", height: "22", rx: "2", fill: "#050505", stroke: "#333" }),
903
+ /* @__PURE__ */ jsx10("text", { "data-testid": "ils-to", x: CENTER + 54, y: CENTER - 75, fill: "#eee", opacity: flag === "TO" ? 1 : 0, style: { transition: "opacity 200ms ease-out" }, children: "TO" }),
904
+ /* @__PURE__ */ jsx10("rect", { x: CENTER - 74, y: CENTER + 64, width: "40", height: "22", rx: "2", fill: "#050505", stroke: "#333" }),
905
+ /* @__PURE__ */ jsx10("text", { "data-testid": "ils-from", x: CENTER - 54, y: CENTER + 75, fill: "#eee", opacity: flag === "FROM" ? 1 : 0, style: { transition: "opacity 200ms ease-out" }, children: "FR" })
906
+ ] }),
907
+ swing ? /* @__PURE__ */ jsxs10(Fragment3, { children: [
908
+ /* @__PURE__ */ jsx10("rect", { x: CENTER - SCALE_HALF, y: CENTER - 9, width: SCALE_HALF * 2, height: "18", rx: "3", fill: SCALE_GREY }),
909
+ /* @__PURE__ */ jsx10("rect", { x: CENTER - 9, y: CENTER - SCALE_HALF, width: "18", height: SCALE_HALF * 2, rx: "3", fill: SCALE_GREY }),
910
+ /* @__PURE__ */ jsxs10("g", { fill: "#eee", stroke: "#eee", children: [
911
+ dots.map((i) => /* @__PURE__ */ jsxs10("g", { children: [
912
+ /* @__PURE__ */ jsx10("circle", { cx: CENTER + i * DOT_SPACING2, cy: CENTER, r: "4", stroke: "none" }),
913
+ /* @__PURE__ */ jsx10("path", { d: `M ${CENTER + i * DOT_SPACING2} ${CENTER - 8} V ${CENTER + 8}`, strokeWidth: "1.5" })
914
+ ] }, i)),
915
+ range(-5, 5, 0.5).filter((i) => i !== 0).map((i) => /* @__PURE__ */ jsx10("path", { d: `M ${CENTER - (i % 1 ? 4 : 7)} ${CENTER + i * DOT_SPACING2} h ${i % 1 ? 8 : 14}`, strokeWidth: "2" }, i))
916
+ ] })
917
+ ] }) : /* @__PURE__ */ jsxs10(Fragment3, { children: [
918
+ /* @__PURE__ */ jsx10("rect", { x: CENTER - SCALE_HALF, y: CENTER - 9, width: SCALE_HALF * 2, height: "18", rx: "3", fill: SCALE_GREY }),
919
+ /* @__PURE__ */ jsx10("rect", { x: CENTER - 9, y: CENTER - SCALE_HALF, width: "18", height: SCALE_HALF * 2, rx: "3", fill: SCALE_GREY }),
920
+ /* @__PURE__ */ jsx10("g", { stroke: "#eee", strokeWidth: "2", children: range(-5, 5, 0.5).filter((i) => i !== 0).map((i) => {
921
+ const half = i % 1 ? 4 : 7;
922
+ return /* @__PURE__ */ jsxs10("g", { children: [
923
+ /* @__PURE__ */ jsx10("path", { d: `M ${CENTER + i * DOT_SPACING2} ${CENTER - half} v ${half * 2}` }),
924
+ /* @__PURE__ */ jsx10("path", { d: `M ${CENTER - half} ${CENTER + i * DOT_SPACING2} h ${half * 2}` })
925
+ ] }, i);
926
+ }) })
927
+ ] }),
928
+ /* @__PURE__ */ jsx10("circle", { cx: CENTER, cy: CENTER, r: "16", fill: "none", stroke: "#000", strokeWidth: "7" }),
929
+ /* @__PURE__ */ jsx10("circle", { cx: CENTER, cy: CENTER, r: "16", fill: "none", stroke: "#eee", strokeWidth: "4" }),
930
+ /* @__PURE__ */ jsx10("clipPath", { id: clipId, children: /* @__PURE__ */ jsx10("circle", { cx: CENTER, cy: CENTER, r: NEEDLE_CLIP_R }) }),
931
+ swing ? /* @__PURE__ */ jsxs10("g", { clipPath: `url(#${clipId})`, children: [
932
+ /* @__PURE__ */ jsx10("g", { "data-testid": "ils-gs-needle", style: motionStyle(`rotate(${gsAngle}deg)`, duration, GS_PIVOT_X, CENTER), children: /* @__PURE__ */ jsx10(NeedleLine, { d: `M ${GS_PIVOT_X} ${CENTER} H ${GS_PIVOT_X + SWING_LENGTH2}` }) }),
933
+ /* @__PURE__ */ jsx10("g", { "data-testid": "ils-loc-needle", style: motionStyle(`rotate(${locAngle}deg)`, duration, CENTER, LOC_PIVOT_Y), children: /* @__PURE__ */ jsx10(NeedleLine, { d: `M ${CENTER} ${LOC_PIVOT_Y} V ${LOC_PIVOT_Y - SWING_LENGTH2}` }) })
934
+ ] }) : /* @__PURE__ */ jsxs10(Fragment3, { children: [
935
+ /* @__PURE__ */ jsx10("g", { "data-testid": "ils-gs-needle", style: motionStyle(`translate(0px, ${gsY}px)`, duration), children: /* @__PURE__ */ jsx10(NeedleLine, { d: `M ${CENTER - 104} ${CENTER} H ${CENTER + 104}` }) }),
936
+ /* @__PURE__ */ jsx10("g", { "data-testid": "ils-loc-needle", style: motionStyle(`translate(${locX}px, 0px)`, duration), children: /* @__PURE__ */ jsx10(NeedleLine, { d: `M ${CENTER} ${CENTER - 104} V ${CENTER + 104}` }) })
937
+ ] }),
938
+ /* @__PURE__ */ jsx10(FlagWindow, { x: CENTER, y: CENTER + FLAG_OFFSET, axis: "h", visible: !signal, testId: "ils-nav-flag" }),
939
+ /* @__PURE__ */ jsx10(FlagWindow, { x: CENTER + FLAG_OFFSET, y: CENTER, axis: "v", visible: !hasGs, testId: "ils-gs-flag" }),
940
+ swing && /* @__PURE__ */ jsx10("circle", { cx: GS_PIVOT_X, cy: CENTER, r: "7", fill: "#1a1a1a", stroke: "#555", strokeWidth: "2" })
941
+ ] });
942
+ }
943
+
944
+ // src/components/HsiIndicator.tsx
945
+ import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
946
+ var CARDINALS5 = { 0: "N", 90: "E", 180: "S", 270: "W" };
749
947
  var AMBER3 = "#ffb000";
948
+ var COURSE = "#e6d930";
949
+ var BUG = "#ff7a1a";
950
+ var FLAG2 = "#e0342a";
951
+ var DOT_SPACING3 = 36;
952
+ var FULL_SCALE_PX3 = DOT_SPACING3 * 2;
953
+ var BAR_HALF = 58;
954
+ var GS_X = 108;
955
+ var GS_DOT_SPACING = 24;
956
+ var GS_FULL_SCALE_PX = GS_DOT_SPACING * 2;
957
+ var norm4 = (deg2) => (deg2 % 360 + 360) % 360;
958
+ var round22 = (n) => Math.round(n * 100) / 100 + 0;
959
+ var pad3 = (deg2) => String(Math.round(norm4(deg2)) % 360 || 360).padStart(3, "0");
960
+ function WarningFlag({ x, y, text, visible, testId, vertical }) {
961
+ const [w, h] = vertical ? [20, 46] : [44, 20];
962
+ return /* @__PURE__ */ jsxs11("g", { "data-testid": testId, opacity: visible ? 1 : 0, style: { transition: "opacity 200ms ease-out" }, children: [
963
+ /* @__PURE__ */ jsx11("rect", { x: x - w / 2, y: y - h / 2, width: w, height: h, rx: "2", fill: FLAG2, stroke: "#000", strokeWidth: "1.5" }),
964
+ vertical ? text.split("").map((c, i) => /* @__PURE__ */ jsx11("text", { x, y: y + (i - (text.length - 1) / 2) * 15, fill: "#111", fontSize: "14", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: c }, i)) : /* @__PURE__ */ jsx11("text", { x, y, fill: "#111", fontSize: "14", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: text })
965
+ ] });
966
+ }
967
+ function GlideslopeScale({ side, y, visible, duration }) {
968
+ const x = CENTER + side * GS_X;
969
+ return /* @__PURE__ */ jsxs11("g", { children: [
970
+ /* @__PURE__ */ jsx11("g", { fill: "none", stroke: "#eee", strokeWidth: "2", children: [-2, -1, 1, 2].map((i) => /* @__PURE__ */ jsx11("circle", { cx: x, cy: CENTER + i * GS_DOT_SPACING, r: "4.5" }, i)) }),
971
+ /* @__PURE__ */ jsx11("path", { d: `M ${x - 7} ${CENTER} h 14`, stroke: "#eee", strokeWidth: "3", strokeLinecap: "round" }),
972
+ /* @__PURE__ */ jsx11(
973
+ "g",
974
+ {
975
+ "data-testid": side > 0 ? "hsi-gs-pointer" : "hsi-gs-pointer-left",
976
+ opacity: visible ? 1 : 0,
977
+ style: { ...motionStyle(`translate(0px, ${y}px)`, duration), transition: duration > 0 ? `transform ${duration}ms ease-out, opacity 200ms ease-out` : "opacity 200ms ease-out" },
978
+ children: /* @__PURE__ */ jsx11("path", { d: `M ${x - side * 7} ${CENTER} l ${side * 15} -9 v 18 z`, fill: "#3ddc84", stroke: "#000", strokeWidth: "1.5", strokeLinejoin: "round" })
979
+ }
980
+ )
981
+ ] });
982
+ }
983
+ function HsiIndicator({
984
+ heading = 0,
985
+ headingBug,
986
+ course = 0,
987
+ radial,
988
+ deviation,
989
+ fullScale = 10,
990
+ toFrom,
991
+ signal = true,
992
+ glideslope,
993
+ glideslopeFullScale = 0.7,
994
+ glideslopeSignal,
995
+ ...props
996
+ }) {
997
+ const duration = props.animationDuration ?? DEFAULT_ANIMATION_MS;
998
+ const hdg = finite(heading);
999
+ const crs = finite(course);
1000
+ const hasBug = typeof headingBug === "number" && Number.isFinite(headingBug);
1001
+ const bug = hasBug ? headingBug : 0;
1002
+ const computed = typeof radial === "number" && Number.isFinite(radial) ? vorDeviation(crs, radial) : void 0;
1003
+ const locScale = finite(fullScale, 10) > 0 ? finite(fullScale, 10) : 10;
1004
+ const gsScale = finite(glideslopeFullScale, 0.7) > 0 ? finite(glideslopeFullScale, 0.7) : 0.7;
1005
+ const dev = signal ? clamp(finite(deviation, computed?.deviation ?? 0), -locScale, locScale) : 0;
1006
+ const flag = !signal ? "OFF" : toFrom ?? computed?.toFrom ?? "OFF";
1007
+ const hasGs = glideslopeSignal ?? (typeof glideslope === "number" && Number.isFinite(glideslope));
1008
+ const gs = hasGs ? clamp(finite(glideslope), -gsScale, gsScale) : 0;
1009
+ const barX = round22(dev / locScale * FULL_SCALE_PX3);
1010
+ const gsY = round22(-(gs / gsScale) * GS_FULL_SCALE_PX);
1011
+ const displayHeading = useContinuousAngle(hdg);
1012
+ const displayCourse = useContinuousAngle(crs);
1013
+ const displayBug = useContinuousAngle(bug);
1014
+ const devText = Math.abs(dev) < 0.05 ? "centred" : `${Math.abs(dev).toFixed(1)}\xB0 ${dev > 0 ? "right" : "left"}`;
1015
+ const gsText = !hasGs ? "glideslope off" : Math.abs(gs) < 5e-3 ? "glideslope centred" : `glideslope ${Math.abs(gs).toFixed(2)}\xB0 ${gs > 0 ? "up" : "down"}`;
1016
+ const navText = signal ? `course bar ${devText}, ${flag === "OFF" ? "no TO/FROM indication" : flag}` : "no NAV signal";
1017
+ const label2 = `HSI: heading ${pad3(hdg)}\xB0, course ${pad3(crs)}\xB0, ${navText}, ${gsText}${hasBug ? `, heading bug ${pad3(bug)}\xB0` : ""}`;
1018
+ return /* @__PURE__ */ jsxs11(
1019
+ InstrumentFrame,
1020
+ {
1021
+ ...props,
1022
+ label: label2,
1023
+ knobs: [
1024
+ { id: "crs", label: "CRS", position: "bottom-left", angle: crs },
1025
+ { id: "hdg", label: "HDG", position: "bottom-right", angle: bug }
1026
+ ],
1027
+ children: [
1028
+ /* @__PURE__ */ jsxs11("g", { "data-testid": "hsi-card", style: motionStyle(`rotate(${-displayHeading}deg)`, duration), children: [
1029
+ /* @__PURE__ */ jsx11("g", { stroke: "#eee", strokeLinecap: "butt", children: range(0, 355, 5).map((a) => /* @__PURE__ */ jsx11("path", { d: tickPath(172, a % 10 === 0 ? 154 : 163, a), strokeWidth: a % 10 === 0 ? 3.5 : 2 }, a)) }),
1030
+ range(0, 330, 30).map((a) => {
1031
+ const [x, y] = polar(138, a);
1032
+ return /* @__PURE__ */ jsx11(
1033
+ "text",
1034
+ {
1035
+ x,
1036
+ y,
1037
+ transform: `rotate(${a} ${x} ${y})`,
1038
+ fill: "#eee",
1039
+ fontSize: a % 90 === 0 ? 24 : 21,
1040
+ fontWeight: "bold",
1041
+ textAnchor: "middle",
1042
+ dominantBaseline: "central",
1043
+ children: CARDINALS5[a] ?? String(a / 10)
1044
+ },
1045
+ a
1046
+ );
1047
+ }),
1048
+ /* @__PURE__ */ jsx11("g", { "data-testid": "hsi-heading-bug", opacity: hasBug ? 1 : 0, style: motionStyle(`rotate(${displayBug}deg)`, duration), children: /* @__PURE__ */ jsx11(
1049
+ "path",
1050
+ {
1051
+ d: `M ${CENTER - 13} ${CENTER - 182} h 26 v 20 h -7 l -6 -8 l -6 8 h -7 z`,
1052
+ fill: BUG,
1053
+ stroke: "#000",
1054
+ strokeWidth: "1.5",
1055
+ strokeLinejoin: "round"
1056
+ }
1057
+ ) }),
1058
+ /* @__PURE__ */ jsxs11("g", { "data-testid": "hsi-course", style: motionStyle(`rotate(${displayCourse}deg)`, duration), children: [
1059
+ /* @__PURE__ */ jsx11("g", { fill: "none", stroke: "#eee", strokeWidth: "2.5", children: [-2, -1, 1, 2].map((i) => /* @__PURE__ */ jsx11("circle", { cx: CENTER + i * DOT_SPACING3, cy: CENTER, r: "6" }, i)) }),
1060
+ /* @__PURE__ */ jsx11(
1061
+ "path",
1062
+ {
1063
+ d: `M ${CENTER} ${CENTER - 126} l 13 24 h -8 v 40 h -10 v -40 h -8 z`,
1064
+ fill: COURSE,
1065
+ stroke: "#000",
1066
+ strokeWidth: "1.5",
1067
+ strokeLinejoin: "round"
1068
+ }
1069
+ ),
1070
+ /* @__PURE__ */ jsx11("rect", { x: CENTER - 5, y: CENTER + 62, width: "10", height: "58", fill: COURSE, stroke: "#000", strokeWidth: "1.5" }),
1071
+ /* @__PURE__ */ jsx11("g", { "data-testid": "hsi-cdi", style: motionStyle(`translate(${barX}px, 0px)`, duration), children: /* @__PURE__ */ jsx11("rect", { x: CENTER - 5, y: CENTER - BAR_HALF, width: "10", height: BAR_HALF * 2, fill: COURSE, stroke: "#000", strokeWidth: "1.5" }) }),
1072
+ /* @__PURE__ */ jsx11(
1073
+ "path",
1074
+ {
1075
+ "data-testid": "hsi-to",
1076
+ d: `M ${CENTER + 26} ${CENTER - 58} l 11 18 h -22 z`,
1077
+ fill: "#eee",
1078
+ stroke: "#000",
1079
+ strokeWidth: "1.5",
1080
+ opacity: flag === "TO" ? 1 : 0,
1081
+ style: { transition: "opacity 200ms ease-out" }
1082
+ }
1083
+ ),
1084
+ /* @__PURE__ */ jsx11(
1085
+ "path",
1086
+ {
1087
+ "data-testid": "hsi-from",
1088
+ d: `M ${CENTER + 26} ${CENTER + 58} l 11 -18 h -22 z`,
1089
+ fill: "#eee",
1090
+ stroke: "#000",
1091
+ strokeWidth: "1.5",
1092
+ opacity: flag === "FROM" ? 1 : 0,
1093
+ style: { transition: "opacity 200ms ease-out" }
1094
+ }
1095
+ )
1096
+ ] })
1097
+ ] }),
1098
+ /* @__PURE__ */ jsx11("g", { stroke: AMBER3, strokeWidth: "4", strokeLinecap: "round", children: [45, 135, 225, 315].map((a) => /* @__PURE__ */ jsx11("path", { d: tickPath(192, 180, a) }, a)) }),
1099
+ /* @__PURE__ */ jsx11("path", { d: `M ${CENTER} ${CENTER - 156} l -9 -24 h 18 z`, fill: AMBER3, stroke: "#000", strokeWidth: "1" }),
1100
+ /* @__PURE__ */ jsx11(
1101
+ "path",
1102
+ {
1103
+ d: `M ${CENTER} ${CENTER - 30} c 4 0 5 5 5 10 v 14 l 25 9 v 7 l -25 -3 v 16 l 10 6 v 6 l -15 -3 l -15 3 v -6 l 10 -6 v -16 l -25 3 v -7 l 25 -9 v -14 c 0 -5 1 -10 5 -10 z`,
1104
+ fill: AMBER3,
1105
+ stroke: "#000",
1106
+ strokeWidth: "1.5",
1107
+ strokeLinejoin: "round"
1108
+ }
1109
+ ),
1110
+ /* @__PURE__ */ jsx11(GlideslopeScale, { side: -1, y: gsY, visible: hasGs, duration }),
1111
+ /* @__PURE__ */ jsx11(GlideslopeScale, { side: 1, y: gsY, visible: hasGs, duration }),
1112
+ /* @__PURE__ */ jsx11(WarningFlag, { x: CENTER + GS_X, y: CENTER, text: "GS", visible: !hasGs, testId: "hsi-gs-flag", vertical: true }),
1113
+ /* @__PURE__ */ jsx11(WarningFlag, { x: CENTER - 62, y: CENTER - 84, text: "NAV", visible: !signal, testId: "hsi-nav-flag" })
1114
+ ]
1115
+ }
1116
+ );
1117
+ }
1118
+
1119
+ // src/components/AdfIndicator.tsx
1120
+ import { jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
1121
+ var CARDINALS6 = { 0: "N", 90: "E", 180: "S", 270: "W" };
1122
+ var AMBER4 = "#ffb000";
750
1123
  var NEEDLE = "#ffe14d";
751
1124
  var PARKED_DEG = 90;
752
- var norm3 = (deg) => (deg % 360 + 360) % 360;
753
- var pad3 = (deg) => String(Math.round(norm3(deg)) % 360).padStart(3, "0");
1125
+ var norm5 = (deg2) => (deg2 % 360 + 360) % 360;
1126
+ var pad32 = (deg2) => String(Math.round(norm5(deg2)) % 360).padStart(3, "0");
754
1127
  function relativeBearing(heading, bearingToStation) {
755
- return norm3(finite(bearingToStation) - finite(heading));
1128
+ return norm5(finite(bearingToStation) - finite(heading));
756
1129
  }
757
1130
  function AdfIndicator({ bearing = 0, heading = 0, signal = true, ...props }) {
758
1131
  const duration = props.animationDuration ?? DEFAULT_ANIMATION_MS;
@@ -760,41 +1133,41 @@ function AdfIndicator({ bearing = 0, heading = 0, signal = true, ...props }) {
760
1133
  const hdg = finite(heading);
761
1134
  const displayCard = useContinuousAngle(hdg);
762
1135
  const displayNeedle = useContinuousAngle(signal ? rel : PARKED_DEG);
763
- const label2 = signal ? `ADF indicator: station ${pad3(rel)}\xB0 relative, bearing ${pad3(rel + hdg)}\xB0 to station` : "ADF indicator: no signal";
764
- return /* @__PURE__ */ jsxs10(InstrumentFrame, { ...props, label: label2, children: [
765
- /* @__PURE__ */ jsxs10("g", { "data-testid": "adf-card", style: motionStyle(`rotate(${-displayCard}deg)`, duration), children: [
766
- /* @__PURE__ */ jsx10("g", { stroke: "#fff", strokeLinecap: "round", children: range(0, 355, 5).map((a) => /* @__PURE__ */ jsx10("path", { d: tickPath(176, a % 10 === 0 ? 152 : 164, a), strokeWidth: a % 10 === 0 ? 3 : 2 }, a)) }),
1136
+ const label2 = signal ? `ADF indicator: station ${pad32(rel)}\xB0 relative, bearing ${pad32(rel + hdg)}\xB0 to station` : "ADF indicator: no signal";
1137
+ return /* @__PURE__ */ jsxs12(InstrumentFrame, { ...props, label: label2, knobs: [{ id: "hdg", label: "HDG", position: "bottom-left", angle: hdg }], children: [
1138
+ /* @__PURE__ */ jsxs12("g", { "data-testid": "adf-card", style: motionStyle(`rotate(${-displayCard}deg)`, duration), children: [
1139
+ /* @__PURE__ */ jsx12("g", { stroke: "#fff", strokeLinecap: "round", children: range(0, 355, 5).map((a) => /* @__PURE__ */ jsx12("path", { d: tickPath(176, a % 10 === 0 ? 152 : 164, a), strokeWidth: a % 10 === 0 ? 3 : 2 }, a)) }),
767
1140
  range(0, 330, 30).map((a) => {
768
1141
  const [x, y] = polar(132, a);
769
- return /* @__PURE__ */ jsx10(
1142
+ return /* @__PURE__ */ jsx12(
770
1143
  "text",
771
1144
  {
772
1145
  x,
773
1146
  y,
774
1147
  transform: `rotate(${a} ${x} ${y})`,
775
- fill: a % 90 === 0 ? AMBER3 : "#fff",
1148
+ fill: a % 90 === 0 ? AMBER4 : "#fff",
776
1149
  fontSize: a % 90 === 0 ? 28 : 24,
777
1150
  fontWeight: "bold",
778
1151
  textAnchor: "middle",
779
1152
  dominantBaseline: "central",
780
- children: CARDINALS4[a] ?? String(a / 10)
1153
+ children: CARDINALS6[a] ?? String(a / 10)
781
1154
  },
782
1155
  a
783
1156
  );
784
1157
  })
785
1158
  ] }),
786
- /* @__PURE__ */ jsx10("path", { d: `M ${CENTER} ${CENTER - 150} l -10 -28 h 20 z`, fill: AMBER3, stroke: "#000", strokeWidth: "1.5" }),
787
- /* @__PURE__ */ jsx10("g", { stroke: AMBER3, strokeWidth: "4", strokeLinecap: "round", children: [45, 90, 135, 180, 225, 270, 315].map((a) => /* @__PURE__ */ jsx10("path", { d: tickPath(192, 178, a) }, a)) }),
788
- /* @__PURE__ */ jsxs10("g", { stroke: AMBER3, strokeWidth: "2", strokeLinecap: "round", opacity: "0.7", children: [
789
- /* @__PURE__ */ jsx10("path", { d: `M ${CENTER - 26} ${CENTER} H ${CENTER + 26}` }),
790
- /* @__PURE__ */ jsx10("path", { d: `M ${CENTER} ${CENTER - 26} V ${CENTER + 14}` })
1159
+ /* @__PURE__ */ jsx12("path", { d: `M ${CENTER} ${CENTER - 150} l -10 -28 h 20 z`, fill: AMBER4, stroke: "#000", strokeWidth: "1.5" }),
1160
+ /* @__PURE__ */ jsx12("g", { stroke: AMBER4, strokeWidth: "4", strokeLinecap: "round", children: [45, 90, 135, 180, 225, 270, 315].map((a) => /* @__PURE__ */ jsx12("path", { d: tickPath(192, 178, a) }, a)) }),
1161
+ /* @__PURE__ */ jsxs12("g", { stroke: AMBER4, strokeWidth: "2", strokeLinecap: "round", opacity: "0.7", children: [
1162
+ /* @__PURE__ */ jsx12("path", { d: `M ${CENTER - 26} ${CENTER} H ${CENTER + 26}` }),
1163
+ /* @__PURE__ */ jsx12("path", { d: `M ${CENTER} ${CENTER - 26} V ${CENTER + 14}` })
791
1164
  ] }),
792
- /* @__PURE__ */ jsx10("text", { x: CENTER, y: CENTER + 62, fill: "#ccc", fontSize: "15", fontWeight: "bold", letterSpacing: "2", textAnchor: "middle", dominantBaseline: "central", children: "ADF" }),
793
- /* @__PURE__ */ jsxs10("g", { "data-testid": "adf-flag", opacity: signal ? 0 : 1, style: { transition: "opacity 200ms ease-out" }, children: [
794
- /* @__PURE__ */ jsx10("rect", { x: CENTER - 28, y: CENTER - 76, width: "56", height: "24", rx: "3", fill: "#d42626", stroke: "#000", strokeWidth: "1.5" }),
795
- /* @__PURE__ */ jsx10("text", { x: CENTER, y: CENTER - 63, fill: "#fff", fontSize: "15", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: "ADF" })
1165
+ /* @__PURE__ */ jsx12("text", { x: CENTER, y: CENTER + 62, fill: "#ccc", fontSize: "15", fontWeight: "bold", letterSpacing: "2", textAnchor: "middle", dominantBaseline: "central", children: "ADF" }),
1166
+ /* @__PURE__ */ jsxs12("g", { "data-testid": "adf-flag", opacity: signal ? 0 : 1, style: { transition: "opacity 200ms ease-out" }, children: [
1167
+ /* @__PURE__ */ jsx12("rect", { x: CENTER - 28, y: CENTER - 76, width: "56", height: "24", rx: "3", fill: "#d42626", stroke: "#000", strokeWidth: "1.5" }),
1168
+ /* @__PURE__ */ jsx12("text", { x: CENTER, y: CENTER - 63, fill: "#fff", fontSize: "15", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: "ADF" })
796
1169
  ] }),
797
- /* @__PURE__ */ jsx10("g", { "data-testid": "adf-needle", style: motionStyle(`rotate(${displayNeedle}deg)`, duration), children: /* @__PURE__ */ jsx10(
1170
+ /* @__PURE__ */ jsx12("g", { "data-testid": "adf-needle", style: motionStyle(`rotate(${displayNeedle}deg)`, duration), children: /* @__PURE__ */ jsx12(
798
1171
  "path",
799
1172
  {
800
1173
  d: `M ${CENTER} ${CENTER - 146} l -13 30 h 9 V ${CENTER + 140} h 8 V ${CENTER - 116} h 9 z`,
@@ -804,12 +1177,12 @@ function AdfIndicator({ bearing = 0, heading = 0, signal = true, ...props }) {
804
1177
  strokeLinejoin: "round"
805
1178
  }
806
1179
  ) }),
807
- /* @__PURE__ */ jsx10(Hub, { r: 10 })
1180
+ /* @__PURE__ */ jsx12(Hub, { r: 10 })
808
1181
  ] });
809
1182
  }
810
1183
 
811
1184
  // src/components/RadioPanel.tsx
812
- import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
1185
+ import { jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
813
1186
  var SIDE = 252;
814
1187
  var ORIGIN = CENTER - SIDE / 2;
815
1188
  var ROW_H = 60;
@@ -826,9 +1199,9 @@ var formatAdf = (khz) => usable(khz) ? Number.isInteger(khz) ? String(khz) : khz
826
1199
  var formatDme = (nm) => usable(nm) ? nm < 99.95 ? nm.toFixed(1) : nm.toFixed(0) : "--.-";
827
1200
  function Display({ x, y, width, value, color, testId, unit }) {
828
1201
  const h = ROW_H - 16;
829
- return /* @__PURE__ */ jsxs11("g", { children: [
830
- /* @__PURE__ */ jsx11("rect", { x, y: y + 8, width, height: h, rx: "5", fill: "#1a0d00", stroke: "#3a2a14", strokeWidth: "1.5" }),
831
- /* @__PURE__ */ jsx11(
1202
+ return /* @__PURE__ */ jsxs13("g", { children: [
1203
+ /* @__PURE__ */ jsx13("rect", { x, y: y + 8, width, height: h, rx: "5", fill: "#1a0d00", stroke: "#3a2a14", strokeWidth: "1.5" }),
1204
+ /* @__PURE__ */ jsx13(
832
1205
  "text",
833
1206
  {
834
1207
  "data-testid": testId,
@@ -843,18 +1216,18 @@ function Display({ x, y, width, value, color, testId, unit }) {
843
1216
  children: value
844
1217
  }
845
1218
  ),
846
- unit && /* @__PURE__ */ jsx11("text", { x: x + width - 10, y: y + ROW_H / 2 + 5, fill: "#9aa4b1", fontSize: "13", fontWeight: "bold", textAnchor: "end", dominantBaseline: "central", children: unit })
1219
+ unit && /* @__PURE__ */ jsx13("text", { x: x + width - 10, y: y + ROW_H / 2 + 5, fill: "#9aa4b1", fontSize: "13", fontWeight: "bold", textAnchor: "end", dominantBaseline: "central", children: unit })
847
1220
  ] });
848
1221
  }
849
1222
  function Swap({ y }) {
850
1223
  const cy = y + ROW_H / 2;
851
- return /* @__PURE__ */ jsxs11("g", { stroke: "#9aa4b1", strokeWidth: "1.8", fill: "none", strokeLinecap: "round", strokeLinejoin: "round", children: [
852
- /* @__PURE__ */ jsx11("path", { d: `M ${SWAP_X - 7} ${cy - 4} H ${SWAP_X + 7} m -4 -3 l 4 3 l -4 3` }),
853
- /* @__PURE__ */ jsx11("path", { d: `M ${SWAP_X + 7} ${cy + 4} H ${SWAP_X - 7} m 4 -3 l -4 3 l 4 3` })
1224
+ return /* @__PURE__ */ jsxs13("g", { stroke: "#9aa4b1", strokeWidth: "1.8", fill: "none", strokeLinecap: "round", strokeLinejoin: "round", children: [
1225
+ /* @__PURE__ */ jsx13("path", { d: `M ${SWAP_X - 7} ${cy - 4} H ${SWAP_X + 7} m -4 -3 l 4 3 l -4 3` }),
1226
+ /* @__PURE__ */ jsx13("path", { d: `M ${SWAP_X + 7} ${cy + 4} H ${SWAP_X - 7} m 4 -3 l -4 3 l 4 3` })
854
1227
  ] });
855
1228
  }
856
1229
  function RowLabel({ y, children }) {
857
- return /* @__PURE__ */ jsx11("text", { x: LABEL_X, y: y + ROW_H / 2 + 1, fill: "#ccc", fontSize: "14", fontWeight: "bold", letterSpacing: "1", dominantBaseline: "central", children });
1230
+ return /* @__PURE__ */ jsx13("text", { x: LABEL_X, y: y + ROW_H / 2 + 1, fill: "#ccc", fontSize: "14", fontWeight: "bold", letterSpacing: "1", dominantBaseline: "central", children });
858
1231
  }
859
1232
  function RadioPanel({ nav, adf, dme, color = "#ff9a2e", ...props }) {
860
1233
  const rows = [
@@ -864,29 +1237,29 @@ function RadioPanel({ nav, adf, dme, color = "#ff9a2e", ...props }) {
864
1237
  const dmeText = formatDme(dme);
865
1238
  const dmeY = FIRST_ROW + 2 * (ROW_H + ROW_GAP);
866
1239
  const label2 = "Radio panel: " + rows.map((r) => `${r.name} ${r.tuned ? `${r.active} ${r.unit}` : "not tuned"}`).join(", ") + `, DME ${usable(dme) ? `${dmeText} NM` : "no distance"}`;
867
- return /* @__PURE__ */ jsxs11(InstrumentFrame, { ...props, label: label2, children: [
868
- /* @__PURE__ */ jsx11("rect", { x: ORIGIN, y: ORIGIN, width: SIDE, height: SIDE, rx: "10", fill: "#1c1f24", stroke: "#3a3f47", strokeWidth: "2" }),
869
- /* @__PURE__ */ jsxs11("g", { fill: "#9aa4b1", fontSize: "11", fontWeight: "bold", letterSpacing: "1.5", textAnchor: "middle", dominantBaseline: "central", children: [
870
- /* @__PURE__ */ jsx11("text", { x: ACTIVE_X + DISPLAY_W / 2, y: ORIGIN + 22, children: "ACTIVE" }),
871
- /* @__PURE__ */ jsx11("text", { x: STANDBY_X + DISPLAY_W / 2, y: ORIGIN + 22, children: "STBY" })
1240
+ return /* @__PURE__ */ jsxs13(InstrumentFrame, { ...props, label: label2, children: [
1241
+ /* @__PURE__ */ jsx13("rect", { x: ORIGIN, y: ORIGIN, width: SIDE, height: SIDE, rx: "10", fill: "#1c1f24", stroke: "#3a3f47", strokeWidth: "2" }),
1242
+ /* @__PURE__ */ jsxs13("g", { fill: "#9aa4b1", fontSize: "11", fontWeight: "bold", letterSpacing: "1.5", textAnchor: "middle", dominantBaseline: "central", children: [
1243
+ /* @__PURE__ */ jsx13("text", { x: ACTIVE_X + DISPLAY_W / 2, y: ORIGIN + 22, children: "ACTIVE" }),
1244
+ /* @__PURE__ */ jsx13("text", { x: STANDBY_X + DISPLAY_W / 2, y: ORIGIN + 22, children: "STBY" })
872
1245
  ] }),
873
1246
  rows.map((r, i) => {
874
1247
  const y = FIRST_ROW + i * (ROW_H + ROW_GAP);
875
- return /* @__PURE__ */ jsxs11("g", { children: [
876
- /* @__PURE__ */ jsx11(RowLabel, { y, children: r.name }),
877
- /* @__PURE__ */ jsx11(Display, { x: ACTIVE_X, y, width: DISPLAY_W, value: r.active, color, testId: `radio-${r.key}-active` }),
878
- /* @__PURE__ */ jsx11(Swap, { y }),
879
- /* @__PURE__ */ jsx11(Display, { x: STANDBY_X, y, width: DISPLAY_W, value: r.standby, color, testId: `radio-${r.key}-standby` })
1248
+ return /* @__PURE__ */ jsxs13("g", { children: [
1249
+ /* @__PURE__ */ jsx13(RowLabel, { y, children: r.name }),
1250
+ /* @__PURE__ */ jsx13(Display, { x: ACTIVE_X, y, width: DISPLAY_W, value: r.active, color, testId: `radio-${r.key}-active` }),
1251
+ /* @__PURE__ */ jsx13(Swap, { y }),
1252
+ /* @__PURE__ */ jsx13(Display, { x: STANDBY_X, y, width: DISPLAY_W, value: r.standby, color, testId: `radio-${r.key}-standby` })
880
1253
  ] }, r.key);
881
1254
  }),
882
- /* @__PURE__ */ jsx11(RowLabel, { y: dmeY, children: "DME" }),
883
- /* @__PURE__ */ jsx11(Display, { x: ACTIVE_X, y: dmeY, width: STANDBY_X + DISPLAY_W - ACTIVE_X, value: dmeText, color, testId: "radio-dme", unit: "NM" })
1255
+ /* @__PURE__ */ jsx13(RowLabel, { y: dmeY, children: "DME" }),
1256
+ /* @__PURE__ */ jsx13(Display, { x: ACTIVE_X, y: dmeY, width: STANDBY_X + DISPLAY_W - ACTIVE_X, value: dmeText, color, testId: "radio-dme", unit: "NM" })
884
1257
  ] });
885
1258
  }
886
1259
 
887
1260
  // src/components/RadioStack.tsx
888
1261
  import { useState } from "react";
889
- import { Fragment as Fragment3, jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
1262
+ import { Fragment as Fragment4, jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
890
1263
  var parseNav = (text) => {
891
1264
  const mhz = Math.round(Number.parseFloat(text.replace(",", ".")) * 100) / 100;
892
1265
  return mhz >= 108 && mhz <= 117.95 ? mhz : void 0;
@@ -919,9 +1292,9 @@ var display = {
919
1292
  var label = { display: "flex", flexDirection: "column", justifyContent: "center", color: LABEL, fontWeight: "bold", letterSpacing: "0.06em", lineHeight: 1.15 };
920
1293
  var ident = { color: "#3cc8ff", fontSize: "0.72em", fontFamily: MONO, minHeight: "1.15em" };
921
1294
  function SwapIcon() {
922
- return /* @__PURE__ */ jsxs12("svg", { viewBox: "0 0 16 16", width: "1em", height: "1em", "aria-hidden": "true", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round", children: [
923
- /* @__PURE__ */ jsx12("path", { d: "M2 5.5 H14 M11 2.5 l3 3 l-3 3" }),
924
- /* @__PURE__ */ jsx12("path", { d: "M14 10.5 H2 M5 7.5 l-3 3 l3 3" })
1295
+ return /* @__PURE__ */ jsxs14("svg", { viewBox: "0 0 16 16", width: "1em", height: "1em", "aria-hidden": "true", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round", children: [
1296
+ /* @__PURE__ */ jsx14("path", { d: "M2 5.5 H14 M11 2.5 l3 3 l-3 3" }),
1297
+ /* @__PURE__ */ jsx14("path", { d: "M14 10.5 H2 M5 7.5 l-3 3 l3 3" })
925
1298
  ] });
926
1299
  }
927
1300
  function Receiver({ name, unit, value, ident: station, color, format, parse, onChange }) {
@@ -955,13 +1328,13 @@ function Receiver({ name, unit, value, ident: station, color, format, parse, onC
955
1328
  if (text && standby === void 0 || standby === value.standby) return;
956
1329
  onChange({ active: value.active, standby });
957
1330
  };
958
- return /* @__PURE__ */ jsxs12(Fragment3, { children: [
959
- /* @__PURE__ */ jsxs12("div", { style: label, children: [
960
- /* @__PURE__ */ jsx12("span", { children: name }),
961
- /* @__PURE__ */ jsx12("span", { "data-testid": `radio-stack-${key}-ident`, style: ident, children: station ?? "" })
1331
+ return /* @__PURE__ */ jsxs14(Fragment4, { children: [
1332
+ /* @__PURE__ */ jsxs14("div", { style: label, children: [
1333
+ /* @__PURE__ */ jsx14("span", { children: name }),
1334
+ /* @__PURE__ */ jsx14("span", { "data-testid": `radio-stack-${key}-ident`, style: ident, children: station ?? "" })
962
1335
  ] }),
963
- /* @__PURE__ */ jsx12("div", { "data-testid": `radio-stack-${key}-active`, "aria-label": `${name} active frequency`, style: { ...display, color }, children: format(value.active) }),
964
- /* @__PURE__ */ jsx12(
1336
+ /* @__PURE__ */ jsx14("div", { "data-testid": `radio-stack-${key}-active`, "aria-label": `${name} active frequency`, style: { ...display, color }, children: format(value.active) }),
1337
+ /* @__PURE__ */ jsx14(
965
1338
  "button",
966
1339
  {
967
1340
  type: "button",
@@ -969,10 +1342,10 @@ function Receiver({ name, unit, value, ident: station, color, format, parse, onC
969
1342
  "aria-label": `Swap ${name} active and standby`,
970
1343
  title: "Swap active and standby",
971
1344
  style: { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "2em", padding: 0, margin: 0, border: "0.08em solid #555", borderRadius: "0.3em", background: "#3a3a3a", color: "#ddd", font: "inherit", fontSize: "1.2em", cursor: "pointer" },
972
- children: /* @__PURE__ */ jsx12(SwapIcon, {})
1345
+ children: /* @__PURE__ */ jsx14(SwapIcon, {})
973
1346
  }
974
1347
  ),
975
- /* @__PURE__ */ jsx12(
1348
+ /* @__PURE__ */ jsx14(
976
1349
  "input",
977
1350
  {
978
1351
  type: "text",
@@ -1034,7 +1407,7 @@ function RadioStack({
1034
1407
  const heading = { color: MUTED, fontSize: "0.72em", fontWeight: "bold", letterSpacing: "0.12em", textAlign: "center" };
1035
1408
  return (
1036
1409
  // The outer box is a size container so every inner measurement can follow the width.
1037
- /* @__PURE__ */ jsx12("div", { className, style: { display: "inline-block", width, maxWidth: "100%", verticalAlign: "top", containerType: "inline-size", ...style }, children: /* @__PURE__ */ jsxs12(
1410
+ /* @__PURE__ */ jsx14("div", { className, style: { display: "inline-block", width, maxWidth: "100%", verticalAlign: "top", containerType: "inline-size", ...style }, children: /* @__PURE__ */ jsxs14(
1038
1411
  "div",
1039
1412
  {
1040
1413
  role: "group",
@@ -1057,20 +1430,20 @@ function RadioStack({
1057
1430
  userSelect: "none"
1058
1431
  },
1059
1432
  children: [
1060
- SCREWS2.map((position, i) => /* @__PURE__ */ jsxs12("svg", { viewBox: "-14 -14 28 28", "aria-hidden": "true", style: { position: "absolute", width: "0.75em", height: "0.75em", ...position }, children: [
1061
- /* @__PURE__ */ jsx12("circle", { r: "12", fill: "#3a3a3a", stroke: "#111", strokeWidth: "2" }),
1062
- /* @__PURE__ */ jsx12("path", { d: "M -8 3 L 8 -3", stroke: "#111", strokeWidth: "3" })
1433
+ SCREWS2.map((position, i) => /* @__PURE__ */ jsxs14("svg", { viewBox: "-14 -14 28 28", "aria-hidden": "true", style: { position: "absolute", width: "0.75em", height: "0.75em", ...position }, children: [
1434
+ /* @__PURE__ */ jsx14("circle", { r: "12", fill: "#3a3a3a", stroke: "#111", strokeWidth: "2" }),
1435
+ /* @__PURE__ */ jsx14("path", { d: "M -8 3 L 8 -3", stroke: "#111", strokeWidth: "3" })
1063
1436
  ] }, i)),
1064
- /* @__PURE__ */ jsx12("span", {}),
1065
- /* @__PURE__ */ jsx12("span", { style: heading, children: "ACTIVE" }),
1066
- /* @__PURE__ */ jsx12("span", {}),
1067
- /* @__PURE__ */ jsx12("span", { style: heading, children: "STBY" }),
1068
- /* @__PURE__ */ jsx12(Receiver, { name: "NAV", unit: "MHz", value: nav ?? innerNav, ident: navIdent, color, format: formatNav, parse: parseNav, onChange: changeNav }),
1069
- /* @__PURE__ */ jsx12(Receiver, { name: "ADF", unit: "kHz", value: adf ?? innerAdf, ident: adfIdent, color, format: formatAdf, parse: parseAdf, onChange: changeAdf }),
1070
- /* @__PURE__ */ jsx12("div", { style: label, children: "DME" }),
1071
- /* @__PURE__ */ jsxs12("div", { "aria-label": "DME distance", style: { ...display, gridColumn: "span 3", display: "flex", alignItems: "baseline", justifyContent: "flex-end", gap: "0.4em", padding: "0 0.5em", color }, children: [
1072
- /* @__PURE__ */ jsx12("span", { "data-testid": "radio-stack-dme", children: formatDme(dme) }),
1073
- /* @__PURE__ */ jsx12("span", { style: { color: MUTED, fontFamily: "'Helvetica Neue', Arial, sans-serif", fontSize: "0.5em" }, children: "NM" })
1437
+ /* @__PURE__ */ jsx14("span", {}),
1438
+ /* @__PURE__ */ jsx14("span", { style: heading, children: "ACTIVE" }),
1439
+ /* @__PURE__ */ jsx14("span", {}),
1440
+ /* @__PURE__ */ jsx14("span", { style: heading, children: "STBY" }),
1441
+ /* @__PURE__ */ jsx14(Receiver, { name: "NAV", unit: "MHz", value: nav ?? innerNav, ident: navIdent, color, format: formatNav, parse: parseNav, onChange: changeNav }),
1442
+ /* @__PURE__ */ jsx14(Receiver, { name: "ADF", unit: "kHz", value: adf ?? innerAdf, ident: adfIdent, color, format: formatAdf, parse: parseAdf, onChange: changeAdf }),
1443
+ /* @__PURE__ */ jsx14("div", { style: label, children: "DME" }),
1444
+ /* @__PURE__ */ jsxs14("div", { "aria-label": "DME distance", style: { ...display, gridColumn: "span 3", display: "flex", alignItems: "baseline", justifyContent: "flex-end", gap: "0.4em", padding: "0 0.5em", color }, children: [
1445
+ /* @__PURE__ */ jsx14("span", { "data-testid": "radio-stack-dme", children: formatDme(dme) }),
1446
+ /* @__PURE__ */ jsx14("span", { style: { color: MUTED, fontFamily: "'Helvetica Neue', Arial, sans-serif", fontSize: "0.5em" }, children: "NM" })
1074
1447
  ] })
1075
1448
  ]
1076
1449
  }
@@ -1079,7 +1452,7 @@ function RadioStack({
1079
1452
  }
1080
1453
 
1081
1454
  // src/components/DataPanel.tsx
1082
- import { jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
1455
+ import { jsx as jsx15, jsxs as jsxs15 } from "react/jsx-runtime";
1083
1456
  var MAX_FIELDS = 6;
1084
1457
  var SIDE2 = 252;
1085
1458
  var PAD = 8;
@@ -1099,9 +1472,9 @@ function DataPanel({ fields = [], heading, ...props }) {
1099
1472
  const cellH = (SIDE2 - PAD * 2 - GAP * (rows - 1)) / rows;
1100
1473
  const valueSize = VALUE_SIZE[rows] ?? 27;
1101
1474
  const label2 = `${heading ?? "Data panel"}: ` + (shown.length ? shown.map((f) => `${f.name} ${formatValue(f)}${f.unit ? ` ${f.unit}` : ""}`).join(", ") : "no data");
1102
- return /* @__PURE__ */ jsxs13(InstrumentFrame, { ...props, label: label2, children: [
1103
- heading && /* @__PURE__ */ jsx13("text", { x: CENTER, y: ORIGIN2 - 14, fill: "#ccc", fontSize: "13", fontWeight: "bold", letterSpacing: "2", textAnchor: "middle", dominantBaseline: "central", children: heading.toUpperCase() }),
1104
- /* @__PURE__ */ jsx13("rect", { x: ORIGIN2, y: ORIGIN2, width: SIDE2, height: SIDE2, rx: "10", fill: "#1c1f24", stroke: "#3a3f47", strokeWidth: "2" }),
1475
+ return /* @__PURE__ */ jsxs15(InstrumentFrame, { ...props, label: label2, children: [
1476
+ heading && /* @__PURE__ */ jsx15("text", { x: CENTER, y: ORIGIN2 - 14, fill: "#ccc", fontSize: "13", fontWeight: "bold", letterSpacing: "2", textAnchor: "middle", dominantBaseline: "central", children: heading.toUpperCase() }),
1477
+ /* @__PURE__ */ jsx15("rect", { x: ORIGIN2, y: ORIGIN2, width: SIDE2, height: SIDE2, rx: "10", fill: "#1c1f24", stroke: "#3a3f47", strokeWidth: "2" }),
1105
1478
  shown.map((f, i) => {
1106
1479
  const col = i % cols;
1107
1480
  const row = Math.floor(i / cols);
@@ -1109,10 +1482,10 @@ function DataPanel({ fields = [], heading, ...props }) {
1109
1482
  const y = ORIGIN2 + PAD + row * (cellH + GAP);
1110
1483
  const value = formatValue(f);
1111
1484
  const fit = Math.min(valueSize, (cellW - 16) / (0.62 * Math.max(1, value.length)));
1112
- return /* @__PURE__ */ jsxs13("g", { "data-testid": `data-field-${i}`, children: [
1113
- /* @__PURE__ */ jsx13("rect", { x, y, width: cellW, height: cellH, rx: "6", fill: "#000", stroke: "#262a30", strokeWidth: "1" }),
1114
- /* @__PURE__ */ jsx13("text", { x: x + 8, y: y + 12, fill: "#9aa4b1", fontSize: "12", fontWeight: "bold", letterSpacing: "1", dominantBaseline: "central", children: f.name.toUpperCase() }),
1115
- /* @__PURE__ */ jsx13(
1485
+ return /* @__PURE__ */ jsxs15("g", { "data-testid": `data-field-${i}`, children: [
1486
+ /* @__PURE__ */ jsx15("rect", { x, y, width: cellW, height: cellH, rx: "6", fill: "#000", stroke: "#262a30", strokeWidth: "1" }),
1487
+ /* @__PURE__ */ jsx15("text", { x: x + 8, y: y + 12, fill: "#9aa4b1", fontSize: "12", fontWeight: "bold", letterSpacing: "1", dominantBaseline: "central", children: f.name.toUpperCase() }),
1488
+ /* @__PURE__ */ jsx15(
1116
1489
  "text",
1117
1490
  {
1118
1491
  "data-testid": `data-value-${i}`,
@@ -1127,14 +1500,14 @@ function DataPanel({ fields = [], heading, ...props }) {
1127
1500
  children: value
1128
1501
  }
1129
1502
  ),
1130
- f.unit && /* @__PURE__ */ jsx13("text", { x: x + cellW - 8, y: y + cellH - 12, fill: "#9aa4b1", fontSize: "12", textAnchor: "end", dominantBaseline: "central", children: f.unit })
1503
+ f.unit && /* @__PURE__ */ jsx15("text", { x: x + cellW - 8, y: y + cellH - 12, fill: "#9aa4b1", fontSize: "12", textAnchor: "end", dominantBaseline: "central", children: f.unit })
1131
1504
  ] }, i);
1132
1505
  })
1133
1506
  ] });
1134
1507
  }
1135
1508
 
1136
1509
  // src/components/FuelIndicator.tsx
1137
- import { jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
1510
+ import { jsx as jsx16, jsxs as jsxs16 } from "react/jsx-runtime";
1138
1511
  var MAX_TANKS = 4;
1139
1512
  var GREEN2 = "#2ee05a";
1140
1513
  var RED = "#ff3b3b";
@@ -1177,16 +1550,16 @@ function FuelIndicator({
1177
1550
  return { name: t.name, qty, cap, fraction, full, isLow, text: full ? "FULL" : qty.toFixed(places) };
1178
1551
  });
1179
1552
  const title = `${label2}: ` + (readings.length ? readings.map((r) => `${r.name} ${r.full ? "full" : `${r.text} of ${r.cap.toFixed(places)} ${unit}`}${r.isLow ? " (low)" : ""}`).join(", ") : "no tanks");
1180
- return /* @__PURE__ */ jsxs14(InstrumentFrame, { ...props, label: title, children: [
1181
- /* @__PURE__ */ jsx14("rect", { x: ORIGIN3, y: ORIGIN3, width: SIDE3, height: SIDE3, rx: "10", fill: "#000", stroke: "#3a3f47", strokeWidth: "2" }),
1553
+ return /* @__PURE__ */ jsxs16(InstrumentFrame, { ...props, label: title, children: [
1554
+ /* @__PURE__ */ jsx16("rect", { x: ORIGIN3, y: ORIGIN3, width: SIDE3, height: SIDE3, rx: "10", fill: "#000", stroke: "#3a3f47", strokeWidth: "2" }),
1182
1555
  readings.map((r, i) => {
1183
1556
  const cx = INNER_LEFT + colW * (i + 0.5);
1184
1557
  const color = r.isLow ? RED : GREEN2;
1185
1558
  const tickX = cx - barW / 2 - 14;
1186
- return /* @__PURE__ */ jsxs14("g", { "data-testid": `fuel-tank-${i}`, children: [
1187
- i > 0 && /* @__PURE__ */ jsx14("path", { d: `M ${INNER_LEFT + colW * i} ${ORIGIN3 + 10} V ${FOOTER_Y}`, stroke: "#555", strokeWidth: "1.5" }),
1188
- /* @__PURE__ */ jsx14("text", { x: cx, y: ORIGIN3 + 22, fill: "#fff", fontSize: Math.min(17, colW / 5), fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: r.name.toUpperCase() }),
1189
- /* @__PURE__ */ jsx14("g", { strokeWidth: "2.5", strokeLinecap: "round", children: [0, 0.25, 0.5, 0.75, 1].map((f) => /* @__PURE__ */ jsx14(
1559
+ return /* @__PURE__ */ jsxs16("g", { "data-testid": `fuel-tank-${i}`, children: [
1560
+ i > 0 && /* @__PURE__ */ jsx16("path", { d: `M ${INNER_LEFT + colW * i} ${ORIGIN3 + 10} V ${FOOTER_Y}`, stroke: "#555", strokeWidth: "1.5" }),
1561
+ /* @__PURE__ */ jsx16("text", { x: cx, y: ORIGIN3 + 22, fill: "#fff", fontSize: Math.min(17, colW / 5), fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: r.name.toUpperCase() }),
1562
+ /* @__PURE__ */ jsx16("g", { strokeWidth: "2.5", strokeLinecap: "round", children: [0, 0.25, 0.5, 0.75, 1].map((f) => /* @__PURE__ */ jsx16(
1190
1563
  "path",
1191
1564
  {
1192
1565
  d: `M ${tickX - 7} ${BAR_BOTTOM - f * BAR_H} h 7`,
@@ -1194,9 +1567,9 @@ function FuelIndicator({
1194
1567
  },
1195
1568
  f
1196
1569
  )) }),
1197
- /* @__PURE__ */ jsx14("rect", { x: cx - barW / 2, y: BAR_TOP, width: barW, height: BAR_H, fill: "#15181c" }),
1198
- /* @__PURE__ */ jsx14("g", { "data-testid": `fuel-bar-${i}`, style: motionStyle(`scaleY(${r.fraction})`, duration, cx, BAR_BOTTOM), children: /* @__PURE__ */ jsx14("rect", { x: cx - barW / 2, y: BAR_TOP, width: barW, height: BAR_H, fill: color }) }),
1199
- /* @__PURE__ */ jsx14(
1570
+ /* @__PURE__ */ jsx16("rect", { x: cx - barW / 2, y: BAR_TOP, width: barW, height: BAR_H, fill: "#15181c" }),
1571
+ /* @__PURE__ */ jsx16("g", { "data-testid": `fuel-bar-${i}`, style: motionStyle(`scaleY(${r.fraction})`, duration, cx, BAR_BOTTOM), children: /* @__PURE__ */ jsx16("rect", { x: cx - barW / 2, y: BAR_TOP, width: barW, height: BAR_H, fill: color }) }),
1572
+ /* @__PURE__ */ jsx16(
1200
1573
  "text",
1201
1574
  {
1202
1575
  "data-testid": `fuel-value-${i}`,
@@ -1211,29 +1584,29 @@ function FuelIndicator({
1211
1584
  children: r.text
1212
1585
  }
1213
1586
  ),
1214
- /* @__PURE__ */ jsx14("text", { x: cx, y: BAR_BOTTOM + 44, fill: "#fff", fontSize: "13", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: unit })
1587
+ /* @__PURE__ */ jsx16("text", { x: cx, y: BAR_BOTTOM + 44, fill: "#fff", fontSize: "13", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: unit })
1215
1588
  ] }, i);
1216
1589
  }),
1217
- /* @__PURE__ */ jsx14("path", { d: `M ${ORIGIN3 + 8} ${FOOTER_Y} H ${ORIGIN3 + SIDE3 - 8}`, stroke: "#555", strokeWidth: "1.5" }),
1218
- /* @__PURE__ */ jsx14("text", { x: CENTER, y: FOOTER_Y + 19, fill: "#fff", fontSize: "24", fontWeight: "bold", letterSpacing: "2", textAnchor: "middle", dominantBaseline: "central", children: label2.toUpperCase() })
1590
+ /* @__PURE__ */ jsx16("path", { d: `M ${ORIGIN3 + 8} ${FOOTER_Y} H ${ORIGIN3 + SIDE3 - 8}`, stroke: "#555", strokeWidth: "1.5" }),
1591
+ /* @__PURE__ */ jsx16("text", { x: CENTER, y: FOOTER_Y + 19, fill: "#fff", fontSize: "24", fontWeight: "bold", letterSpacing: "2", textAnchor: "middle", dominantBaseline: "central", children: label2.toUpperCase() })
1219
1592
  ] });
1220
1593
  }
1221
1594
 
1222
1595
  // src/components/EngineIndicator.tsx
1223
- import { jsx as jsx15, jsxs as jsxs15 } from "react/jsx-runtime";
1596
+ import { jsx as jsx17, jsxs as jsxs17 } from "react/jsx-runtime";
1224
1597
  var MAX_CYLINDERS = 6;
1225
1598
  var MAX_BAR_GAUGES = 4;
1226
1599
  var GREEN3 = "#5fe04a";
1227
- var YELLOW = "#ffd400";
1600
+ var YELLOW2 = "#ffd400";
1228
1601
  var RED2 = "#ff3030";
1229
1602
  var BLUE = "#4fb7e8";
1230
1603
  var LABEL2 = "#b9c8e6";
1231
1604
  var LINE = "#8a8f99";
1232
- var round2 = (n) => Math.round(n * 100) / 100;
1605
+ var round23 = (n) => Math.round(n * 100) / 100;
1233
1606
  var DIAL_R = 182;
1234
1607
  function chord(y, inset = 8) {
1235
1608
  const half = Math.sqrt(Math.max(0, DIAL_R * DIAL_R - (y - CENTER) ** 2)) - inset;
1236
- return `M ${round2(CENTER - half)} ${y} H ${round2(CENTER + half)}`;
1609
+ return `M ${round23(CENTER - half)} ${y} H ${round23(CENTER + half)}`;
1237
1610
  }
1238
1611
  var DEFAULT_MANIFOLD = { min: 10, max: 35, green: [15, 29], yellow: [29, 31], high: 31, unit: "IN", decimals: 1 };
1239
1612
  var DEFAULT_RPM = { min: 0, max: 3e3, green: [800, 2500], yellow: [2500, 2700], high: 2700, decimals: 0 };
@@ -1259,7 +1632,7 @@ function resolve(g, defaults = {}) {
1259
1632
  min,
1260
1633
  max,
1261
1634
  fraction,
1262
- color: inRed ? RED2 : inYellow ? YELLOW : "#fff",
1635
+ color: inRed ? RED2 : inYellow ? YELLOW2 : "#fff",
1263
1636
  text: value.toFixed(decimals),
1264
1637
  unit: g.unit ?? defaults.unit,
1265
1638
  green: g.green ?? defaults.green,
@@ -1278,22 +1651,22 @@ function arcAt(cx, cy, r, a0, a1) {
1278
1651
  }
1279
1652
  function ArcGauge({ cx, label: label2, g, duration, testId }) {
1280
1653
  const span = g.max - g.min;
1281
- const angle = (v) => round2(-ARC_SWEEP + 2 * ARC_SWEEP * clamp((v - g.min) / span, 0, 1));
1282
- const band = (from, to, color) => /* @__PURE__ */ jsx15("path", { d: arcAt(cx, ARC_Y, ARC_R, angle(from), angle(to)), stroke: color, strokeWidth: "6", fill: "none" });
1654
+ const angle = (v) => round23(-ARC_SWEEP + 2 * ARC_SWEEP * clamp((v - g.min) / span, 0, 1));
1655
+ const band = (from, to, color) => /* @__PURE__ */ jsx17("path", { d: arcAt(cx, ARC_Y, ARC_R, angle(from), angle(to)), stroke: color, strokeWidth: "6", fill: "none" });
1283
1656
  const [tipX, tipY] = polar(ARC_R - 4, 0, cx, ARC_Y);
1284
1657
  const [lx, ly] = polar(ARC_R - 16, -7, cx, ARC_Y);
1285
1658
  const [rx, ry] = polar(ARC_R - 16, 7, cx, ARC_Y);
1286
- return /* @__PURE__ */ jsxs15("g", { children: [
1287
- /* @__PURE__ */ jsx15("path", { d: arcAt(cx, ARC_Y, ARC_R, -ARC_SWEEP, ARC_SWEEP), stroke: "#fff", strokeWidth: "1.5", fill: "none" }),
1659
+ return /* @__PURE__ */ jsxs17("g", { children: [
1660
+ /* @__PURE__ */ jsx17("path", { d: arcAt(cx, ARC_Y, ARC_R, -ARC_SWEEP, ARC_SWEEP), stroke: "#fff", strokeWidth: "1.5", fill: "none" }),
1288
1661
  g.green && band(g.green[0], g.green[1], GREEN3),
1289
- g.yellow && band(g.yellow[0], g.yellow[1], YELLOW),
1662
+ g.yellow && band(g.yellow[0], g.yellow[1], YELLOW2),
1290
1663
  g.low !== void 0 && band(g.min, g.low, RED2),
1291
1664
  g.high !== void 0 && band(g.high, g.max, RED2),
1292
- /* @__PURE__ */ jsx15("g", { "data-testid": testId, style: motionStyle(`rotate(${angle(g.value)}deg)`, duration, cx, ARC_Y), children: /* @__PURE__ */ jsx15("path", { d: `M ${tipX} ${tipY} L ${lx} ${ly} L ${rx} ${ry} Z`, fill: "#fff", stroke: "#000", strokeWidth: "1" }) }),
1293
- /* @__PURE__ */ jsx15("text", { x: cx, y: ARC_Y - 20, fill: LABEL2, fontSize: "14", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: label2 }),
1294
- /* @__PURE__ */ jsxs15("text", { x: cx, y: ARC_Y + 4, fill: g.color, fontSize: "28", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: [
1665
+ /* @__PURE__ */ jsx17("g", { "data-testid": testId, style: motionStyle(`rotate(${angle(g.value)}deg)`, duration, cx, ARC_Y), children: /* @__PURE__ */ jsx17("path", { d: `M ${tipX} ${tipY} L ${lx} ${ly} L ${rx} ${ry} Z`, fill: "#fff", stroke: "#000", strokeWidth: "1" }) }),
1666
+ /* @__PURE__ */ jsx17("text", { x: cx, y: ARC_Y - 20, fill: LABEL2, fontSize: "14", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: label2 }),
1667
+ /* @__PURE__ */ jsxs17("text", { x: cx, y: ARC_Y + 4, fill: g.color, fontSize: "28", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: [
1295
1668
  g.text,
1296
- g.unit && /* @__PURE__ */ jsx15("tspan", { fontSize: "11", dx: "2", children: g.unit })
1669
+ g.unit && /* @__PURE__ */ jsx17("tspan", { fontSize: "11", dx: "2", children: g.unit })
1297
1670
  ] })
1298
1671
  ] });
1299
1672
  }
@@ -1303,28 +1676,28 @@ var BAR_ROW_H = 39;
1303
1676
  var BAR_TOP2 = 137;
1304
1677
  function BarGauge({ top, g, label: label2, duration, testId }) {
1305
1678
  const y = top + 14;
1306
- const at = (v) => round2(BAR_X0 + (BAR_X1 - BAR_X0) * clamp((v - g.min) / (g.max - g.min), 0, 1));
1307
- const seg = (from, to, color, w = 7) => /* @__PURE__ */ jsx15("path", { d: `M ${at(from)} ${y} H ${at(to)}`, stroke: color, strokeWidth: w });
1308
- return /* @__PURE__ */ jsxs15("g", { children: [
1309
- /* @__PURE__ */ jsx15("path", { d: `M ${BAR_X0} ${y} H ${BAR_X1}`, stroke: "#fff", strokeWidth: "2" }),
1310
- /* @__PURE__ */ jsx15("path", { d: `M ${BAR_X0} ${y - 4} v 8 M ${BAR_X1} ${y - 4} v 8`, stroke: "#fff", strokeWidth: "2" }),
1679
+ const at = (v) => round23(BAR_X0 + (BAR_X1 - BAR_X0) * clamp((v - g.min) / (g.max - g.min), 0, 1));
1680
+ const seg = (from, to, color, w = 7) => /* @__PURE__ */ jsx17("path", { d: `M ${at(from)} ${y} H ${at(to)}`, stroke: color, strokeWidth: w });
1681
+ return /* @__PURE__ */ jsxs17("g", { children: [
1682
+ /* @__PURE__ */ jsx17("path", { d: `M ${BAR_X0} ${y} H ${BAR_X1}`, stroke: "#fff", strokeWidth: "2" }),
1683
+ /* @__PURE__ */ jsx17("path", { d: `M ${BAR_X0} ${y - 4} v 8 M ${BAR_X1} ${y - 4} v 8`, stroke: "#fff", strokeWidth: "2" }),
1311
1684
  g.green && seg(g.green[0], g.green[1], GREEN3),
1312
- g.yellow && seg(g.yellow[0], g.yellow[1], YELLOW),
1685
+ g.yellow && seg(g.yellow[0], g.yellow[1], YELLOW2),
1313
1686
  g.low !== void 0 && seg(g.min, g.low, RED2),
1314
1687
  g.high !== void 0 && seg(g.high, g.max, RED2),
1315
- /* @__PURE__ */ jsx15("g", { "data-testid": testId, style: motionStyle(`translate(${round2(at(g.value) - BAR_X0)}px, 0px)`, duration), children: /* @__PURE__ */ jsx15("path", { d: `M ${BAR_X0} ${y - 3} l -5 -9 h 10 z`, fill: "#fff", stroke: "#000", strokeWidth: "1" }) }),
1316
- /* @__PURE__ */ jsx15("text", { x: BAR_X0, y: top + 31, fill: LABEL2, fontSize: "13", fontWeight: "bold", dominantBaseline: "central", children: label2 }),
1317
- /* @__PURE__ */ jsx15("text", { x: 350, y: top + 15, fill: g.color, fontSize: "20", fontWeight: "bold", textAnchor: "end", dominantBaseline: "central", children: g.text }),
1318
- g.unit && /* @__PURE__ */ jsx15("text", { x: 350, y: top + 31, fill: LABEL2, fontSize: "10", fontWeight: "bold", textAnchor: "end", dominantBaseline: "central", children: g.unit })
1688
+ /* @__PURE__ */ jsx17("g", { "data-testid": testId, style: motionStyle(`translate(${round23(at(g.value) - BAR_X0)}px, 0px)`, duration), children: /* @__PURE__ */ jsx17("path", { d: `M ${BAR_X0} ${y - 3} l -5 -9 h 10 z`, fill: "#fff", stroke: "#000", strokeWidth: "1" }) }),
1689
+ /* @__PURE__ */ jsx17("text", { x: BAR_X0, y: top + 31, fill: LABEL2, fontSize: "13", fontWeight: "bold", dominantBaseline: "central", children: label2 }),
1690
+ /* @__PURE__ */ jsx17("text", { x: 350, y: top + 15, fill: g.color, fontSize: "20", fontWeight: "bold", textAnchor: "end", dominantBaseline: "central", children: g.text }),
1691
+ g.unit && /* @__PURE__ */ jsx17("text", { x: 350, y: top + 31, fill: LABEL2, fontSize: "10", fontWeight: "bold", textAnchor: "end", dominantBaseline: "central", children: g.unit })
1319
1692
  ] });
1320
1693
  }
1321
1694
  function Tank({ x, fraction, duration, testId }) {
1322
1695
  const top = 304;
1323
1696
  const h = 40;
1324
- return /* @__PURE__ */ jsxs15("g", { children: [
1325
- /* @__PURE__ */ jsx15("rect", { x: x - 7, y: top, width: "14", height: h, rx: "3", fill: "#000", stroke: "#fff", strokeWidth: "1.5" }),
1326
- /* @__PURE__ */ jsx15("g", { "data-testid": testId, style: motionStyle(`scaleY(${fraction})`, duration, x, top + h - 2), children: /* @__PURE__ */ jsx15("rect", { x: x - 5.5, y: top + 2, width: "11", height: h - 4, fill: BLUE }) }),
1327
- /* @__PURE__ */ jsx15("rect", { x: x - 5.5, y: top + h - 5, width: "11", height: "3", fill: RED2 })
1697
+ return /* @__PURE__ */ jsxs17("g", { children: [
1698
+ /* @__PURE__ */ jsx17("rect", { x: x - 7, y: top, width: "14", height: h, rx: "3", fill: "#000", stroke: "#fff", strokeWidth: "1.5" }),
1699
+ /* @__PURE__ */ jsx17("g", { "data-testid": testId, style: motionStyle(`scaleY(${fraction})`, duration, x, top + h - 2), children: /* @__PURE__ */ jsx17("rect", { x: x - 5.5, y: top + 2, width: "11", height: h - 4, fill: BLUE }) }),
1700
+ /* @__PURE__ */ jsx17("rect", { x: x - 5.5, y: top + h - 5, width: "11", height: "3", fill: RED2 })
1328
1701
  ] });
1329
1702
  }
1330
1703
  var hottest = (values) => {
@@ -1392,81 +1765,81 @@ function EngineIndicator({
1392
1765
  fuelLeft !== void 0 || fuelRight !== void 0 ? `fuel ${fmt(fuelLeft)}/${fmt(fuelRight)} ${fuelUnit}` : null,
1393
1766
  volts !== void 0 ? `${fmt(volts, 1)} V` : null
1394
1767
  ].filter(Boolean).join(", ");
1395
- return /* @__PURE__ */ jsxs15(InstrumentFrame, { ...props, label: label2, children: [
1396
- power !== void 0 && /* @__PURE__ */ jsxs15("text", { x: CENTER, y: 44, fill: "#fff", fontSize: "18", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: [
1397
- /* @__PURE__ */ jsxs15("tspan", { fill: LABEL2, fontSize: "11", children: [
1768
+ return /* @__PURE__ */ jsxs17(InstrumentFrame, { ...props, label: label2, children: [
1769
+ power !== void 0 && /* @__PURE__ */ jsxs17("text", { x: CENTER, y: 44, fill: "#fff", fontSize: "18", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: [
1770
+ /* @__PURE__ */ jsxs17("tspan", { fill: LABEL2, fontSize: "11", children: [
1398
1771
  "POWER",
1399
1772
  " "
1400
1773
  ] }),
1401
1774
  fmt(power),
1402
- /* @__PURE__ */ jsx15("tspan", { fontSize: "11", children: "%" })
1775
+ /* @__PURE__ */ jsx17("tspan", { fontSize: "11", children: "%" })
1403
1776
  ] }),
1404
- /* @__PURE__ */ jsx15(ArcGauge, { cx: 118, label: "MAN", g: man, duration, testId: "engine-man" }),
1405
- /* @__PURE__ */ jsx15(ArcGauge, { cx: 282, label: "RPM", g: speed, duration, testId: "engine-rpm" }),
1406
- /* @__PURE__ */ jsxs15("g", { stroke: LINE, strokeWidth: "1.5", children: [
1407
- /* @__PURE__ */ jsx15("path", { d: chord(133) }),
1408
- /* @__PURE__ */ jsx15("path", { d: "M 200 133 V 298" }),
1409
- /* @__PURE__ */ jsx15("path", { d: chord(298) }),
1410
- /* @__PURE__ */ jsx15("path", { d: "M 136 298 V 348 M 264 298 V 348" })
1777
+ /* @__PURE__ */ jsx17(ArcGauge, { cx: 118, label: "MAN", g: man, duration, testId: "engine-man" }),
1778
+ /* @__PURE__ */ jsx17(ArcGauge, { cx: 282, label: "RPM", g: speed, duration, testId: "engine-rpm" }),
1779
+ /* @__PURE__ */ jsxs17("g", { stroke: LINE, strokeWidth: "1.5", children: [
1780
+ /* @__PURE__ */ jsx17("path", { d: chord(133) }),
1781
+ /* @__PURE__ */ jsx17("path", { d: "M 200 133 V 298" }),
1782
+ /* @__PURE__ */ jsx17("path", { d: chord(298) }),
1783
+ /* @__PURE__ */ jsx17("path", { d: "M 136 298 V 348 M 264 298 V 348" })
1411
1784
  ] }),
1412
- /* @__PURE__ */ jsx15("g", { fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: readouts.map((r) => /* @__PURE__ */ jsxs15("g", { children: [
1413
- /* @__PURE__ */ jsxs15("text", { x: r.x, y: 144, fill: LABEL2, fontSize: "13", children: [
1785
+ /* @__PURE__ */ jsx17("g", { fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: readouts.map((r) => /* @__PURE__ */ jsxs17("g", { children: [
1786
+ /* @__PURE__ */ jsxs17("text", { x: r.x, y: 144, fill: LABEL2, fontSize: "13", children: [
1414
1787
  r.name,
1415
- /* @__PURE__ */ jsx15("tspan", { fontSize: "9", children: temperatureUnit })
1788
+ /* @__PURE__ */ jsx17("tspan", { fontSize: "9", children: temperatureUnit })
1416
1789
  ] }),
1417
- /* @__PURE__ */ jsx15("text", { "data-testid": `engine-${r.name.toLowerCase()}`, x: r.x, y: 165, fill: r.color, fontSize: "22", children: fmt(r.value) })
1790
+ /* @__PURE__ */ jsx17("text", { "data-testid": `engine-${r.name.toLowerCase()}`, x: r.x, y: 165, fill: r.color, fontSize: "22", children: fmt(r.value) })
1418
1791
  ] }, r.name)) }),
1419
- /* @__PURE__ */ jsx15("path", { d: "M 40 178 H 190", stroke: LINE, strokeWidth: "1" }),
1420
- columns > 0 && /* @__PURE__ */ jsxs15("g", { children: [
1421
- /* @__PURE__ */ jsx15("path", { d: `M ${chartX0} ${limitY} H ${chartX1}`, stroke: RED2, strokeWidth: "1.5", strokeDasharray: "5 4" }),
1422
- /* @__PURE__ */ jsx15("text", { x: chartX0 - 4, y: limitY, fill: "#fff", fontSize: "10", fontWeight: "bold", textAnchor: "end", dominantBaseline: "central", children: "CHT" }),
1792
+ /* @__PURE__ */ jsx17("path", { d: "M 40 178 H 190", stroke: LINE, strokeWidth: "1" }),
1793
+ columns > 0 && /* @__PURE__ */ jsxs17("g", { children: [
1794
+ /* @__PURE__ */ jsx17("path", { d: `M ${chartX0} ${limitY} H ${chartX1}`, stroke: RED2, strokeWidth: "1.5", strokeDasharray: "5 4" }),
1795
+ /* @__PURE__ */ jsx17("text", { x: chartX0 - 4, y: limitY, fill: "#fff", fontSize: "10", fontWeight: "bold", textAnchor: "end", dominantBaseline: "central", children: "CHT" }),
1423
1796
  Array.from({ length: cylinders }, (_, i) => {
1424
1797
  const x0 = chartX0 + colW * i;
1425
1798
  const mid = x0 + colW / 2;
1426
1799
  const c = chtValues[i];
1427
1800
  const e = egtValues[i];
1428
- return /* @__PURE__ */ jsxs15("g", { children: [
1429
- c !== void 0 && /* @__PURE__ */ jsx15("g", { "data-testid": `engine-cht-${i}`, style: motionStyle(`scaleY(${chtFrac(c)})`, duration, mid, chartBase), children: /* @__PURE__ */ jsx15("rect", { x: mid - barW - 1, y: chartBase - chartH, width: barW, height: chartH, fill: GREEN3 }) }),
1430
- e !== void 0 && /* @__PURE__ */ jsx15("g", { "data-testid": `engine-egt-${i}`, style: motionStyle(`scaleY(${egtFrac(e)})`, duration, mid, chartBase), children: /* @__PURE__ */ jsx15("rect", { x: mid + 1, y: chartBase - chartH, width: barW, height: chartH, fill: BLUE }) }),
1431
- /* @__PURE__ */ jsx15("text", { x: mid, y: 294, fill: "#fff", fontSize: "12", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: i + 1 })
1801
+ return /* @__PURE__ */ jsxs17("g", { children: [
1802
+ c !== void 0 && /* @__PURE__ */ jsx17("g", { "data-testid": `engine-cht-${i}`, style: motionStyle(`scaleY(${chtFrac(c)})`, duration, mid, chartBase), children: /* @__PURE__ */ jsx17("rect", { x: mid - barW - 1, y: chartBase - chartH, width: barW, height: chartH, fill: GREEN3 }) }),
1803
+ e !== void 0 && /* @__PURE__ */ jsx17("g", { "data-testid": `engine-egt-${i}`, style: motionStyle(`scaleY(${egtFrac(e)})`, duration, mid, chartBase), children: /* @__PURE__ */ jsx17("rect", { x: mid + 1, y: chartBase - chartH, width: barW, height: chartH, fill: BLUE }) }),
1804
+ /* @__PURE__ */ jsx17("text", { x: mid, y: 294, fill: "#fff", fontSize: "12", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: i + 1 })
1432
1805
  ] }, i);
1433
1806
  }),
1434
- hasTit && /* @__PURE__ */ jsxs15("g", { children: [
1435
- /* @__PURE__ */ jsx15("g", { "data-testid": "engine-tit-bar", style: motionStyle(`scaleY(${egtFrac(tit)})`, duration, chartX1 - colW / 2, chartBase), children: /* @__PURE__ */ jsx15("rect", { x: chartX1 - colW / 2 - barW / 2, y: chartBase - chartH, width: barW, height: chartH, fill: "#fff" }) }),
1436
- /* @__PURE__ */ jsx15("text", { x: chartX1 - colW / 2, y: 294, fill: "#fff", fontSize: "12", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: "T" })
1807
+ hasTit && /* @__PURE__ */ jsxs17("g", { children: [
1808
+ /* @__PURE__ */ jsx17("g", { "data-testid": "engine-tit-bar", style: motionStyle(`scaleY(${egtFrac(tit)})`, duration, chartX1 - colW / 2, chartBase), children: /* @__PURE__ */ jsx17("rect", { x: chartX1 - colW / 2 - barW / 2, y: chartBase - chartH, width: barW, height: chartH, fill: "#fff" }) }),
1809
+ /* @__PURE__ */ jsx17("text", { x: chartX1 - colW / 2, y: 294, fill: "#fff", fontSize: "12", fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: "T" })
1437
1810
  ] })
1438
1811
  ] }),
1439
- bars.map((b, i) => /* @__PURE__ */ jsxs15("g", { children: [
1440
- i > 0 && /* @__PURE__ */ jsx15("path", { d: `M 206 ${BAR_TOP2 + BAR_ROW_H * i - 2} H 352`, stroke: LINE, strokeWidth: "1" }),
1441
- /* @__PURE__ */ jsx15(BarGauge, { top: BAR_TOP2 + BAR_ROW_H * i, g: b.g, label: b.label, duration, testId: `engine-bar-${i}` })
1812
+ bars.map((b, i) => /* @__PURE__ */ jsxs17("g", { children: [
1813
+ i > 0 && /* @__PURE__ */ jsx17("path", { d: `M 206 ${BAR_TOP2 + BAR_ROW_H * i - 2} H 352`, stroke: LINE, strokeWidth: "1" }),
1814
+ /* @__PURE__ */ jsx17(BarGauge, { top: BAR_TOP2 + BAR_ROW_H * i, g: b.g, label: b.label, duration, testId: `engine-bar-${i}` })
1442
1815
  ] }, b.label)),
1443
- /* @__PURE__ */ jsxs15("g", { fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: [
1444
- /* @__PURE__ */ jsxs15("text", { "data-testid": "engine-amps", x: 104, y: 318, fill: "#fff", fontSize: "20", children: [
1816
+ /* @__PURE__ */ jsxs17("g", { fontWeight: "bold", textAnchor: "middle", dominantBaseline: "central", children: [
1817
+ /* @__PURE__ */ jsxs17("text", { "data-testid": "engine-amps", x: 104, y: 318, fill: "#fff", fontSize: "20", children: [
1445
1818
  fmt(amps),
1446
- /* @__PURE__ */ jsx15("tspan", { fontSize: "11", dx: "2", children: "A" })
1819
+ /* @__PURE__ */ jsx17("tspan", { fontSize: "11", dx: "2", children: "A" })
1447
1820
  ] }),
1448
- /* @__PURE__ */ jsx15("text", { x: 104, y: 338, fill: LABEL2, fontSize: "13", children: "ALT" }),
1449
- /* @__PURE__ */ jsx15(Tank, { x: 152, fraction: left / cap, duration, testId: "engine-fuel-left" }),
1450
- /* @__PURE__ */ jsx15(Tank, { x: 248, fraction: right / cap, duration, testId: "engine-fuel-right" }),
1451
- /* @__PURE__ */ jsxs15("text", { "data-testid": "engine-fuel", x: 200, y: 316, fill: "#fff", fontSize: "20", children: [
1821
+ /* @__PURE__ */ jsx17("text", { x: 104, y: 338, fill: LABEL2, fontSize: "13", children: "ALT" }),
1822
+ /* @__PURE__ */ jsx17(Tank, { x: 152, fraction: left / cap, duration, testId: "engine-fuel-left" }),
1823
+ /* @__PURE__ */ jsx17(Tank, { x: 248, fraction: right / cap, duration, testId: "engine-fuel-right" }),
1824
+ /* @__PURE__ */ jsxs17("text", { "data-testid": "engine-fuel", x: 200, y: 316, fill: "#fff", fontSize: "20", children: [
1452
1825
  fmt(left),
1453
- /* @__PURE__ */ jsx15("tspan", { dx: "14", children: fmt(right) })
1826
+ /* @__PURE__ */ jsx17("tspan", { dx: "14", children: fmt(right) })
1454
1827
  ] }),
1455
- /* @__PURE__ */ jsx15("text", { x: 200, y: 335, fill: LABEL2, fontSize: "13", children: "Fuel" }),
1456
- /* @__PURE__ */ jsx15("text", { x: 200, y: 348, fill: LABEL2, fontSize: "9", children: fuelUnit }),
1457
- /* @__PURE__ */ jsxs15("text", { "data-testid": "engine-volts", x: 296, y: 318, fill: "#fff", fontSize: "20", children: [
1828
+ /* @__PURE__ */ jsx17("text", { x: 200, y: 335, fill: LABEL2, fontSize: "13", children: "Fuel" }),
1829
+ /* @__PURE__ */ jsx17("text", { x: 200, y: 348, fill: LABEL2, fontSize: "9", children: fuelUnit }),
1830
+ /* @__PURE__ */ jsxs17("text", { "data-testid": "engine-volts", x: 296, y: 318, fill: "#fff", fontSize: "20", children: [
1458
1831
  fmt(volts, 1),
1459
- /* @__PURE__ */ jsx15("tspan", { fontSize: "11", dx: "2", children: "V" })
1832
+ /* @__PURE__ */ jsx17("tspan", { fontSize: "11", dx: "2", children: "V" })
1460
1833
  ] }),
1461
- /* @__PURE__ */ jsx15("text", { x: 296, y: 338, fill: LABEL2, fontSize: "13", children: "BATT" })
1834
+ /* @__PURE__ */ jsx17("text", { x: 296, y: 338, fill: LABEL2, fontSize: "13", children: "BATT" })
1462
1835
  ] })
1463
1836
  ] });
1464
1837
  }
1465
1838
 
1466
1839
  // src/components/FlapIndicator.tsx
1467
- import { jsx as jsx16, jsxs as jsxs16 } from "react/jsx-runtime";
1840
+ import { jsx as jsx18, jsxs as jsxs18 } from "react/jsx-runtime";
1468
1841
  var GREEN4 = "#3ddc3d";
1469
- var YELLOW2 = "#ffd400";
1842
+ var YELLOW3 = "#ffd400";
1470
1843
  var ORANGE = "#ff8a00";
1471
1844
  var RED3 = "#ff2a2a";
1472
1845
  var BAR_X = 226;
@@ -1476,7 +1849,7 @@ var BAR_BOTTOM2 = 302;
1476
1849
  var BAR_H2 = BAR_BOTTOM2 - BAR_TOP3;
1477
1850
  function segmentColor(fraction) {
1478
1851
  if (fraction < 0.25) return GREEN4;
1479
- if (fraction < 0.5) return YELLOW2;
1852
+ if (fraction < 0.5) return YELLOW3;
1480
1853
  if (fraction < 0.75) return ORANGE;
1481
1854
  return RED3;
1482
1855
  }
@@ -1497,18 +1870,18 @@ function FlapIndicator({
1497
1870
  const count = Math.max(1, Math.floor(finite(segments, 20)));
1498
1871
  const lit = Math.round(fraction * count);
1499
1872
  const scale = (detents ?? Array.from({ length: Math.floor(full / 10) + 1 }, (_, i) => i * 10)).filter((d) => d >= 0 && d <= full);
1500
- const yAt = (deg) => Math.round((BAR_TOP3 + deg / full * BAR_H2) * 100) / 100;
1873
+ const yAt = (deg2) => Math.round((BAR_TOP3 + deg2 / full * BAR_H2) * 100) / 100;
1501
1874
  const limit = (speedLimits ?? []).filter((l) => Number.isFinite(l.flaps) && Number.isFinite(l.speed) && l.flaps <= position).sort((a, b) => b.flaps - a.flaps)[0];
1502
1875
  const ias = finite(airspeed, NaN);
1503
1876
  const overspeed = limit !== void 0 && !Number.isNaN(ias) && ias > limit.speed;
1504
1877
  const segH = BAR_H2 / count;
1505
1878
  const title = `${label2}: ${Math.round(position)}\xB0 of ${Math.round(full)}\xB0` + (limit ? `, max ${Math.round(limit.speed)} knots${overspeed ? " (overspeed)" : ""}` : "");
1506
- return /* @__PURE__ */ jsxs16(InstrumentFrame, { ...props, label: title, children: [
1507
- /* @__PURE__ */ jsx16("rect", { x: BAR_X - BAR_W / 2 - 4, y: BAR_TOP3 - 4, width: BAR_W + 8, height: BAR_H2 + 8, rx: "4", fill: "#000", stroke: "#333", strokeWidth: "1.5" }),
1879
+ return /* @__PURE__ */ jsxs18(InstrumentFrame, { ...props, label: title, children: [
1880
+ /* @__PURE__ */ jsx18("rect", { x: BAR_X - BAR_W / 2 - 4, y: BAR_TOP3 - 4, width: BAR_W + 8, height: BAR_H2 + 8, rx: "4", fill: "#000", stroke: "#333", strokeWidth: "1.5" }),
1508
1881
  Array.from({ length: count }, (_, i) => {
1509
1882
  const y = BAR_TOP3 + i * segH;
1510
1883
  const on = i < lit;
1511
- return /* @__PURE__ */ jsx16(
1884
+ return /* @__PURE__ */ jsx18(
1512
1885
  "rect",
1513
1886
  {
1514
1887
  "data-testid": `flap-segment-${i}`,
@@ -1525,26 +1898,26 @@ function FlapIndicator({
1525
1898
  i
1526
1899
  );
1527
1900
  }),
1528
- /* @__PURE__ */ jsx16("g", { fill: "#fff", fontSize: "18", fontWeight: "bold", dominantBaseline: "central", children: scale.map((d) => /* @__PURE__ */ jsxs16("g", { children: [
1529
- /* @__PURE__ */ jsx16("path", { d: `M ${BAR_X + BAR_W / 2 + 8} ${yAt(d)} h 8`, stroke: "#fff", strokeWidth: "2" }),
1530
- /* @__PURE__ */ jsx16("text", { x: BAR_X + BAR_W / 2 + 22, y: yAt(d), children: d })
1901
+ /* @__PURE__ */ jsx18("g", { fill: "#fff", fontSize: "18", fontWeight: "bold", dominantBaseline: "central", children: scale.map((d) => /* @__PURE__ */ jsxs18("g", { children: [
1902
+ /* @__PURE__ */ jsx18("path", { d: `M ${BAR_X + BAR_W / 2 + 8} ${yAt(d)} h 8`, stroke: "#fff", strokeWidth: "2" }),
1903
+ /* @__PURE__ */ jsx18("text", { x: BAR_X + BAR_W / 2 + 22, y: yAt(d), children: d })
1531
1904
  ] }, d)) }),
1532
- /* @__PURE__ */ jsx16("g", { "data-testid": "flap-pointer", style: motionStyle(`translate(0px, ${yAt(position) - BAR_TOP3}px)`, duration), children: /* @__PURE__ */ jsx16("path", { d: `M ${BAR_X - BAR_W / 2 - 8} ${BAR_TOP3} l -14 -8 v 16 z`, fill: "#fff", stroke: "#000", strokeWidth: "1" }) }),
1533
- limit && /* @__PURE__ */ jsxs16("g", { textAnchor: "middle", dominantBaseline: "central", fill: overspeed ? RED3 : "#fff", children: [
1534
- /* @__PURE__ */ jsxs16("text", { "data-testid": "flap-speed", x: 118, y: 176, fontSize: "36", fontWeight: "bold", children: [
1905
+ /* @__PURE__ */ jsx18("g", { "data-testid": "flap-pointer", style: motionStyle(`translate(0px, ${yAt(position) - BAR_TOP3}px)`, duration), children: /* @__PURE__ */ jsx18("path", { d: `M ${BAR_X - BAR_W / 2 - 8} ${BAR_TOP3} l -14 -8 v 16 z`, fill: "#fff", stroke: "#000", strokeWidth: "1" }) }),
1906
+ limit && /* @__PURE__ */ jsxs18("g", { textAnchor: "middle", dominantBaseline: "central", fill: overspeed ? RED3 : "#fff", children: [
1907
+ /* @__PURE__ */ jsxs18("text", { "data-testid": "flap-speed", x: 118, y: 176, fontSize: "36", fontWeight: "bold", children: [
1535
1908
  Math.round(limit.speed),
1536
- /* @__PURE__ */ jsx16("tspan", { fontSize: "13", dx: "3", children: "KTS" })
1909
+ /* @__PURE__ */ jsx18("tspan", { fontSize: "13", dx: "3", children: "KTS" })
1537
1910
  ] }),
1538
- /* @__PURE__ */ jsx16("text", { x: 118, y: 212, fontSize: "13", fontWeight: "bold", fill: "#bbb", letterSpacing: "2", children: "MAX" })
1911
+ /* @__PURE__ */ jsx18("text", { x: 118, y: 212, fontSize: "13", fontWeight: "bold", fill: "#bbb", letterSpacing: "2", children: "MAX" })
1539
1912
  ] }),
1540
- /* @__PURE__ */ jsx16("text", { x: CENTER, y: 345, fill: "#ccc", fontSize: "16", textAnchor: "middle", children: label2.toUpperCase() })
1913
+ /* @__PURE__ */ jsx18("text", { x: CENTER, y: 345, fill: "#ccc", fontSize: "16", textAnchor: "middle", children: label2.toUpperCase() })
1541
1914
  ] });
1542
1915
  }
1543
1916
 
1544
1917
  // src/components/AoaIndicator.tsx
1545
- import { Fragment as Fragment4, jsx as jsx17, jsxs as jsxs17 } from "react/jsx-runtime";
1918
+ import { Fragment as Fragment5, jsx as jsx19, jsxs as jsxs19 } from "react/jsx-runtime";
1546
1919
  var GREEN5 = "#3ddc3d";
1547
- var AMBER4 = "#ffb000";
1920
+ var AMBER5 = "#ffb000";
1548
1921
  var RED4 = "#ff2a2a";
1549
1922
  var UNLIT_OPACITY = 0.15;
1550
1923
  var ROWS = [
@@ -1553,10 +1926,10 @@ var ROWS = [
1553
1926
  { shape: "bar", color: GREEN5, y: 256 },
1554
1927
  { shape: "bar", color: GREEN5, y: 234 },
1555
1928
  { shape: "donut", color: GREEN5, y: 208 },
1556
- { shape: "bar", color: AMBER4, y: 182 },
1557
- { shape: "split", color: AMBER4, y: 160 },
1558
- { shape: "chevron", color: AMBER4, y: 125 },
1559
- { shape: "chevron", color: AMBER4, y: 103 },
1929
+ { shape: "bar", color: AMBER5, y: 182 },
1930
+ { shape: "split", color: AMBER5, y: 160 },
1931
+ { shape: "chevron", color: AMBER5, y: 125 },
1932
+ { shape: "chevron", color: AMBER5, y: 103 },
1560
1933
  { shape: "chevron", color: RED4, y: 74 },
1561
1934
  { shape: "chevron", color: RED4, y: 52 }
1562
1935
  ];
@@ -1570,20 +1943,20 @@ function RowShape({ shape, y }) {
1570
1943
  const r = CENTER + HALF;
1571
1944
  switch (shape) {
1572
1945
  case "bar":
1573
- return /* @__PURE__ */ jsx17("rect", { x: l, y: y - BAR_H3 / 2, width: HALF * 2, height: BAR_H3, rx: "2" });
1946
+ return /* @__PURE__ */ jsx19("rect", { x: l, y: y - BAR_H3 / 2, width: HALF * 2, height: BAR_H3, rx: "2" });
1574
1947
  case "split":
1575
- return /* @__PURE__ */ jsxs17(Fragment4, { children: [
1576
- /* @__PURE__ */ jsx17("rect", { x: l, y: y - BAR_H3 / 2, width: 50, height: BAR_H3, rx: "2" }),
1577
- /* @__PURE__ */ jsx17("rect", { x: r - 50, y: y - BAR_H3 / 2, width: 50, height: BAR_H3, rx: "2" })
1948
+ return /* @__PURE__ */ jsxs19(Fragment5, { children: [
1949
+ /* @__PURE__ */ jsx19("rect", { x: l, y: y - BAR_H3 / 2, width: 50, height: BAR_H3, rx: "2" }),
1950
+ /* @__PURE__ */ jsx19("rect", { x: r - 50, y: y - BAR_H3 / 2, width: 50, height: BAR_H3, rx: "2" })
1578
1951
  ] });
1579
1952
  case "donut":
1580
- return /* @__PURE__ */ jsxs17(Fragment4, { children: [
1581
- /* @__PURE__ */ jsx17("rect", { x: l, y: y - BAR_H3 / 2, width: HALF - 24, height: BAR_H3, rx: "2" }),
1582
- /* @__PURE__ */ jsx17("rect", { x: CENTER + 24, y: y - BAR_H3 / 2, width: HALF - 24, height: BAR_H3, rx: "2" }),
1583
- /* @__PURE__ */ jsx17("circle", { cx: CENTER, cy: y, r: 13, fill: "none", strokeWidth: "7" })
1953
+ return /* @__PURE__ */ jsxs19(Fragment5, { children: [
1954
+ /* @__PURE__ */ jsx19("rect", { x: l, y: y - BAR_H3 / 2, width: HALF - 24, height: BAR_H3, rx: "2" }),
1955
+ /* @__PURE__ */ jsx19("rect", { x: CENTER + 24, y: y - BAR_H3 / 2, width: HALF - 24, height: BAR_H3, rx: "2" }),
1956
+ /* @__PURE__ */ jsx19("circle", { cx: CENTER, cy: y, r: 13, fill: "none", strokeWidth: "7" })
1584
1957
  ] });
1585
1958
  case "chevron":
1586
- return /* @__PURE__ */ jsx17("path", { d: `M ${l} ${y} L ${CENTER} ${y + CHEVRON_DEPTH} L ${r} ${y}`, fill: "none", strokeWidth: "11", strokeLinejoin: "miter" });
1959
+ return /* @__PURE__ */ jsx19("path", { d: `M ${l} ${y} L ${CENTER} ${y + CHEVRON_DEPTH} L ${r} ${y}`, fill: "none", strokeWidth: "11", strokeLinejoin: "miter" });
1587
1960
  }
1588
1961
  }
1589
1962
  function AoaIndicator({ aoa = 0, min = 0, optimum, max = 20, showValue = false, label: label2 = "AOA", ...props }) {
@@ -1597,11 +1970,11 @@ function AoaIndicator({ aoa = 0, min = 0, optimum, max = 20, showValue = false,
1597
1970
  const reading = Number.isNaN(value) ? "---" : `${value.toFixed(1)}\xB0`;
1598
1971
  const state = stall ? " (stall warning)" : lit > DONUT + 1 ? " (high)" : lit === DONUT + 1 ? " (optimum)" : "";
1599
1972
  const title = `${label2}: ${reading}${Number.isNaN(value) ? "" : state}`;
1600
- return /* @__PURE__ */ jsxs17(InstrumentFrame, { ...props, label: title, children: [
1601
- /* @__PURE__ */ jsx17("rect", { x: CENTER - HALF - 10, y: 40, width: (HALF + 10) * 2, height: 278, rx: "10", fill: "#000", stroke: "#333", strokeWidth: "1.5" }),
1973
+ return /* @__PURE__ */ jsxs19(InstrumentFrame, { ...props, label: title, children: [
1974
+ /* @__PURE__ */ jsx19("rect", { x: CENTER - HALF - 10, y: 40, width: (HALF + 10) * 2, height: 278, rx: "10", fill: "#000", stroke: "#333", strokeWidth: "1.5" }),
1602
1975
  ROWS.map((row, i) => {
1603
1976
  const on = i < lit;
1604
- return /* @__PURE__ */ jsxs17(
1977
+ return /* @__PURE__ */ jsxs19(
1605
1978
  "g",
1606
1979
  {
1607
1980
  "data-testid": `aoa-row-${i}`,
@@ -1612,15 +1985,15 @@ function AoaIndicator({ aoa = 0, min = 0, optimum, max = 20, showValue = false,
1612
1985
  opacity: on ? 1 : UNLIT_OPACITY,
1613
1986
  style: { transition: "opacity 150ms ease-out" },
1614
1987
  children: [
1615
- /* @__PURE__ */ jsx17(RowShape, { shape: row.shape, y: row.y }),
1616
- on && stall && row.shape === "chevron" && /* @__PURE__ */ jsx17("animate", { attributeName: "opacity", values: "1;0.25;1", dur: "0.6s", repeatCount: "indefinite" })
1988
+ /* @__PURE__ */ jsx19(RowShape, { shape: row.shape, y: row.y }),
1989
+ on && stall && row.shape === "chevron" && /* @__PURE__ */ jsx19("animate", { attributeName: "opacity", values: "1;0.25;1", dur: "0.6s", repeatCount: "indefinite" })
1617
1990
  ]
1618
1991
  },
1619
1992
  i
1620
1993
  );
1621
1994
  }),
1622
- showValue && /* @__PURE__ */ jsx17("text", { "data-testid": "aoa-value", x: CENTER, y: 340, fill: "#fff", fontSize: "18", fontWeight: "bold", textAnchor: "middle", children: reading }),
1623
- /* @__PURE__ */ jsx17("text", { x: CENTER, y: showValue ? 362 : 345, fill: "#ccc", fontSize: "16", textAnchor: "middle", children: label2.toUpperCase() })
1995
+ showValue && /* @__PURE__ */ jsx19("text", { "data-testid": "aoa-value", x: CENTER, y: 340, fill: "#fff", fontSize: "18", fontWeight: "bold", textAnchor: "middle", children: reading }),
1996
+ /* @__PURE__ */ jsx19("text", { x: CENTER, y: showValue ? 362 : 345, fill: "#ccc", fontSize: "16", textAnchor: "middle", children: label2.toUpperCase() })
1624
1997
  ] });
1625
1998
  }
1626
1999
  export {
@@ -1637,6 +2010,8 @@ export {
1637
2010
  FlapIndicator,
1638
2011
  FuelIndicator,
1639
2012
  HeadingIndicator,
2013
+ HsiIndicator,
2014
+ IlsIndicator,
1640
2015
  MAX_BAR_GAUGES,
1641
2016
  MAX_CYLINDERS,
1642
2017
  MAX_FIELDS,