@opentui/core 0.5.10 → 0.5.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +2 -0
  2. package/audio.d.ts +6 -1
  3. package/{chunk-bun-9gqvxy8c.js → chunk-bun-8f4q4e2m.js} +1234 -1039
  4. package/{chunk-bun-9gqvxy8c.js.map → chunk-bun-8f4q4e2m.js.map} +8 -8
  5. package/{chunk-bun-bb3k0yt8.js → chunk-bun-91mz470w.js} +680 -585
  6. package/chunk-bun-91mz470w.js.map +32 -0
  7. package/{chunk-node-f647ts9q.js → chunk-node-1zjyxy5y.js} +1241 -1043
  8. package/chunk-node-1zjyxy5y.js.map +63 -0
  9. package/{chunk-node-6bg8r2m7.js → chunk-node-fyb4fckk.js} +680 -585
  10. package/chunk-node-fyb4fckk.js.map +32 -0
  11. package/editor-view.d.ts +1 -0
  12. package/index.bun.js +1603 -1377
  13. package/index.bun.js.map +8 -8
  14. package/index.node.js +1603 -1377
  15. package/index.node.js.map +8 -8
  16. package/lib/detect-links.d.ts +5 -0
  17. package/lib/tree-sitter/update-assets.js +4 -4
  18. package/lib/tree-sitter/update-assets.js.map +2 -2
  19. package/lib/tree-sitter-styled-text.d.ts +4 -0
  20. package/node-assets.js +6 -2
  21. package/node-assets.js.map +3 -3
  22. package/package.json +13 -9
  23. package/parser.worker.js +7 -12
  24. package/parser.worker.js.map +3 -3
  25. package/renderables/Code.d.ts +6 -0
  26. package/renderables/Diff.d.ts +1 -2
  27. package/renderables/EmbeddedTerminal.d.ts +4 -0
  28. package/renderables/Markdown.d.ts +6 -0
  29. package/renderables/TextBufferRenderable.d.ts +7 -0
  30. package/renderables/TextTable.d.ts +2 -0
  31. package/renderer.d.ts +2 -0
  32. package/runtime-plugin.js +15 -4
  33. package/runtime-plugin.js.map +1 -1
  34. package/testing.bun.js +23 -23
  35. package/testing.bun.js.map +2 -2
  36. package/testing.js +23 -23
  37. package/testing.js.map +2 -2
  38. package/text-buffer-view.d.ts +2 -0
  39. package/types.d.ts +2 -1
  40. package/yoga.bun.js +187 -187
  41. package/yoga.bun.js.map +1 -1
  42. package/yoga.js +187 -187
  43. package/yoga.js.map +1 -1
  44. package/zig-structs.d.ts +8 -1
  45. package/zig.d.ts +6 -0
  46. package/chunk-bun-bb3k0yt8.js.map +0 -32
  47. package/chunk-node-6bg8r2m7.js.map +0 -32
  48. package/chunk-node-f647ts9q.js.map +0 -63
@@ -13,104 +13,103 @@ var __export = (target, all) => {
13
13
  set: __exportSetter.bind(all, name)
14
14
  });
15
15
  };
16
- var __require = import.meta.require;
17
16
 
18
17
  // src/yoga.ts
19
18
  var exports_yoga = {};
20
19
  __export(exports_yoga, {
21
- default: () => yoga_default,
22
- Wrap: () => Wrap,
23
- WRAP_WRAP_REVERSE: () => WRAP_WRAP_REVERSE,
24
- WRAP_WRAP: () => WRAP_WRAP,
25
- WRAP_NO_WRAP: () => WRAP_NO_WRAP,
26
- Unit: () => Unit,
27
- UNIT_UNDEFINED: () => UNIT_UNDEFINED,
28
- UNIT_POINT: () => UNIT_POINT,
29
- UNIT_PERCENT: () => UNIT_PERCENT,
30
- UNIT_AUTO: () => UNIT_AUTO,
31
- PositionType: () => PositionType,
32
- POSITION_TYPE_STATIC: () => POSITION_TYPE_STATIC,
33
- POSITION_TYPE_RELATIVE: () => POSITION_TYPE_RELATIVE,
34
- POSITION_TYPE_ABSOLUTE: () => POSITION_TYPE_ABSOLUTE,
35
- Overflow: () => Overflow,
36
- OVERFLOW_VISIBLE: () => OVERFLOW_VISIBLE,
37
- OVERFLOW_SCROLL: () => OVERFLOW_SCROLL,
38
- OVERFLOW_HIDDEN: () => OVERFLOW_HIDDEN,
39
- NodeType: () => NodeType,
40
- Node: () => Node,
41
- NODE_TYPE_TEXT: () => NODE_TYPE_TEXT,
42
- NODE_TYPE_DEFAULT: () => NODE_TYPE_DEFAULT,
43
- MeasureMode: () => MeasureMode,
44
- MEASURE_MODE_UNDEFINED: () => MEASURE_MODE_UNDEFINED,
45
- MEASURE_MODE_EXACTLY: () => MEASURE_MODE_EXACTLY,
46
- MEASURE_MODE_AT_MOST: () => MEASURE_MODE_AT_MOST,
47
- LogLevel: () => LogLevel,
48
- LOG_LEVEL_WARN: () => LOG_LEVEL_WARN,
49
- LOG_LEVEL_VERBOSE: () => LOG_LEVEL_VERBOSE,
50
- LOG_LEVEL_INFO: () => LOG_LEVEL_INFO,
51
- LOG_LEVEL_FATAL: () => LOG_LEVEL_FATAL,
52
- LOG_LEVEL_ERROR: () => LOG_LEVEL_ERROR,
53
- LOG_LEVEL_DEBUG: () => LOG_LEVEL_DEBUG,
54
- Justify: () => Justify,
55
- JUSTIFY_SPACE_EVENLY: () => JUSTIFY_SPACE_EVENLY,
56
- JUSTIFY_SPACE_BETWEEN: () => JUSTIFY_SPACE_BETWEEN,
57
- JUSTIFY_SPACE_AROUND: () => JUSTIFY_SPACE_AROUND,
58
- JUSTIFY_FLEX_START: () => JUSTIFY_FLEX_START,
59
- JUSTIFY_FLEX_END: () => JUSTIFY_FLEX_END,
60
- JUSTIFY_CENTER: () => JUSTIFY_CENTER,
61
- Gutter: () => Gutter,
62
- GUTTER_ROW: () => GUTTER_ROW,
63
- GUTTER_COLUMN: () => GUTTER_COLUMN,
64
- GUTTER_ALL: () => GUTTER_ALL,
65
- FlexDirection: () => FlexDirection,
66
- FLEX_DIRECTION_ROW_REVERSE: () => FLEX_DIRECTION_ROW_REVERSE,
67
- FLEX_DIRECTION_ROW: () => FLEX_DIRECTION_ROW,
68
- FLEX_DIRECTION_COLUMN_REVERSE: () => FLEX_DIRECTION_COLUMN_REVERSE,
69
- FLEX_DIRECTION_COLUMN: () => FLEX_DIRECTION_COLUMN,
70
- ExperimentalFeature: () => ExperimentalFeature,
71
- Errata: () => Errata,
72
- Edge: () => Edge,
73
- EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS: () => EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS,
74
- ERRATA_STRETCH_FLEX_BASIS: () => ERRATA_STRETCH_FLEX_BASIS,
75
- ERRATA_NONE: () => ERRATA_NONE,
76
- ERRATA_CLASSIC: () => ERRATA_CLASSIC,
77
- ERRATA_ALL: () => ERRATA_ALL,
78
- ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING: () => ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING,
79
- ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE: () => ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE,
80
- EDGE_VERTICAL: () => EDGE_VERTICAL,
81
- EDGE_TOP: () => EDGE_TOP,
82
- EDGE_START: () => EDGE_START,
83
- EDGE_RIGHT: () => EDGE_RIGHT,
84
- EDGE_LEFT: () => EDGE_LEFT,
85
- EDGE_HORIZONTAL: () => EDGE_HORIZONTAL,
86
- EDGE_END: () => EDGE_END,
87
- EDGE_BOTTOM: () => EDGE_BOTTOM,
88
- EDGE_ALL: () => EDGE_ALL,
89
- Display: () => Display,
90
- Direction: () => Direction,
91
- Dimension: () => Dimension,
92
- DISPLAY_NONE: () => DISPLAY_NONE,
93
- DISPLAY_FLEX: () => DISPLAY_FLEX,
94
- DISPLAY_CONTENTS: () => DISPLAY_CONTENTS,
95
- DIRECTION_RTL: () => DIRECTION_RTL,
96
- DIRECTION_LTR: () => DIRECTION_LTR,
97
- DIRECTION_INHERIT: () => DIRECTION_INHERIT,
98
- DIMENSION_WIDTH: () => DIMENSION_WIDTH,
99
- DIMENSION_HEIGHT: () => DIMENSION_HEIGHT,
100
- Config: () => Config,
101
- BoxSizing: () => BoxSizing,
102
- BOX_SIZING_CONTENT_BOX: () => BOX_SIZING_CONTENT_BOX,
103
- BOX_SIZING_BORDER_BOX: () => BOX_SIZING_BORDER_BOX,
104
- Align: () => Align,
105
- ALIGN_STRETCH: () => ALIGN_STRETCH,
106
- ALIGN_SPACE_EVENLY: () => ALIGN_SPACE_EVENLY,
107
- ALIGN_SPACE_BETWEEN: () => ALIGN_SPACE_BETWEEN,
108
- ALIGN_SPACE_AROUND: () => ALIGN_SPACE_AROUND,
109
- ALIGN_FLEX_START: () => ALIGN_FLEX_START,
110
- ALIGN_FLEX_END: () => ALIGN_FLEX_END,
111
- ALIGN_CENTER: () => ALIGN_CENTER,
112
- ALIGN_BASELINE: () => ALIGN_BASELINE,
113
- ALIGN_AUTO: () => ALIGN_AUTO
20
+ ALIGN_AUTO: () => ALIGN_AUTO2,
21
+ ALIGN_BASELINE: () => ALIGN_BASELINE2,
22
+ ALIGN_CENTER: () => ALIGN_CENTER2,
23
+ ALIGN_FLEX_END: () => ALIGN_FLEX_END2,
24
+ ALIGN_FLEX_START: () => ALIGN_FLEX_START2,
25
+ ALIGN_SPACE_AROUND: () => ALIGN_SPACE_AROUND2,
26
+ ALIGN_SPACE_BETWEEN: () => ALIGN_SPACE_BETWEEN2,
27
+ ALIGN_SPACE_EVENLY: () => ALIGN_SPACE_EVENLY2,
28
+ ALIGN_STRETCH: () => ALIGN_STRETCH2,
29
+ Align: () => Align2,
30
+ BOX_SIZING_BORDER_BOX: () => BOX_SIZING_BORDER_BOX2,
31
+ BOX_SIZING_CONTENT_BOX: () => BOX_SIZING_CONTENT_BOX2,
32
+ BoxSizing: () => BoxSizing2,
33
+ Config: () => Config2,
34
+ DIMENSION_HEIGHT: () => DIMENSION_HEIGHT2,
35
+ DIMENSION_WIDTH: () => DIMENSION_WIDTH2,
36
+ DIRECTION_INHERIT: () => DIRECTION_INHERIT2,
37
+ DIRECTION_LTR: () => DIRECTION_LTR2,
38
+ DIRECTION_RTL: () => DIRECTION_RTL2,
39
+ DISPLAY_CONTENTS: () => DISPLAY_CONTENTS2,
40
+ DISPLAY_FLEX: () => DISPLAY_FLEX2,
41
+ DISPLAY_NONE: () => DISPLAY_NONE2,
42
+ Dimension: () => Dimension2,
43
+ Direction: () => Direction2,
44
+ Display: () => Display2,
45
+ EDGE_ALL: () => EDGE_ALL2,
46
+ EDGE_BOTTOM: () => EDGE_BOTTOM2,
47
+ EDGE_END: () => EDGE_END2,
48
+ EDGE_HORIZONTAL: () => EDGE_HORIZONTAL2,
49
+ EDGE_LEFT: () => EDGE_LEFT2,
50
+ EDGE_RIGHT: () => EDGE_RIGHT2,
51
+ EDGE_START: () => EDGE_START2,
52
+ EDGE_TOP: () => EDGE_TOP2,
53
+ EDGE_VERTICAL: () => EDGE_VERTICAL2,
54
+ ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE: () => ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE2,
55
+ ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING: () => ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING2,
56
+ ERRATA_ALL: () => ERRATA_ALL2,
57
+ ERRATA_CLASSIC: () => ERRATA_CLASSIC2,
58
+ ERRATA_NONE: () => ERRATA_NONE2,
59
+ ERRATA_STRETCH_FLEX_BASIS: () => ERRATA_STRETCH_FLEX_BASIS2,
60
+ EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS: () => EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS2,
61
+ Edge: () => Edge2,
62
+ Errata: () => Errata2,
63
+ ExperimentalFeature: () => ExperimentalFeature2,
64
+ FLEX_DIRECTION_COLUMN: () => FLEX_DIRECTION_COLUMN2,
65
+ FLEX_DIRECTION_COLUMN_REVERSE: () => FLEX_DIRECTION_COLUMN_REVERSE2,
66
+ FLEX_DIRECTION_ROW: () => FLEX_DIRECTION_ROW2,
67
+ FLEX_DIRECTION_ROW_REVERSE: () => FLEX_DIRECTION_ROW_REVERSE2,
68
+ FlexDirection: () => FlexDirection2,
69
+ GUTTER_ALL: () => GUTTER_ALL2,
70
+ GUTTER_COLUMN: () => GUTTER_COLUMN2,
71
+ GUTTER_ROW: () => GUTTER_ROW2,
72
+ Gutter: () => Gutter2,
73
+ JUSTIFY_CENTER: () => JUSTIFY_CENTER2,
74
+ JUSTIFY_FLEX_END: () => JUSTIFY_FLEX_END2,
75
+ JUSTIFY_FLEX_START: () => JUSTIFY_FLEX_START2,
76
+ JUSTIFY_SPACE_AROUND: () => JUSTIFY_SPACE_AROUND2,
77
+ JUSTIFY_SPACE_BETWEEN: () => JUSTIFY_SPACE_BETWEEN2,
78
+ JUSTIFY_SPACE_EVENLY: () => JUSTIFY_SPACE_EVENLY2,
79
+ Justify: () => Justify2,
80
+ LOG_LEVEL_DEBUG: () => LOG_LEVEL_DEBUG2,
81
+ LOG_LEVEL_ERROR: () => LOG_LEVEL_ERROR2,
82
+ LOG_LEVEL_FATAL: () => LOG_LEVEL_FATAL2,
83
+ LOG_LEVEL_INFO: () => LOG_LEVEL_INFO2,
84
+ LOG_LEVEL_VERBOSE: () => LOG_LEVEL_VERBOSE2,
85
+ LOG_LEVEL_WARN: () => LOG_LEVEL_WARN2,
86
+ LogLevel: () => LogLevel3,
87
+ MEASURE_MODE_AT_MOST: () => MEASURE_MODE_AT_MOST2,
88
+ MEASURE_MODE_EXACTLY: () => MEASURE_MODE_EXACTLY2,
89
+ MEASURE_MODE_UNDEFINED: () => MEASURE_MODE_UNDEFINED2,
90
+ MeasureMode: () => MeasureMode2,
91
+ NODE_TYPE_DEFAULT: () => NODE_TYPE_DEFAULT2,
92
+ NODE_TYPE_TEXT: () => NODE_TYPE_TEXT2,
93
+ Node: () => Node2,
94
+ NodeType: () => NodeType2,
95
+ OVERFLOW_HIDDEN: () => OVERFLOW_HIDDEN2,
96
+ OVERFLOW_SCROLL: () => OVERFLOW_SCROLL2,
97
+ OVERFLOW_VISIBLE: () => OVERFLOW_VISIBLE2,
98
+ Overflow: () => Overflow2,
99
+ POSITION_TYPE_ABSOLUTE: () => POSITION_TYPE_ABSOLUTE2,
100
+ POSITION_TYPE_RELATIVE: () => POSITION_TYPE_RELATIVE2,
101
+ POSITION_TYPE_STATIC: () => POSITION_TYPE_STATIC2,
102
+ PositionType: () => PositionType2,
103
+ UNIT_AUTO: () => UNIT_AUTO2,
104
+ UNIT_PERCENT: () => UNIT_PERCENT2,
105
+ UNIT_POINT: () => UNIT_POINT2,
106
+ UNIT_UNDEFINED: () => UNIT_UNDEFINED2,
107
+ Unit: () => Unit2,
108
+ WRAP_NO_WRAP: () => WRAP_NO_WRAP2,
109
+ WRAP_WRAP: () => WRAP_WRAP2,
110
+ WRAP_WRAP_REVERSE: () => WRAP_WRAP_REVERSE2,
111
+ Wrap: () => Wrap2,
112
+ default: () => yoga_default
114
113
  });
115
114
 
116
115
  // src/platform/ffi.ts
@@ -664,7 +663,7 @@ var emoji_regex_default = () => {
664
663
  // ../../node_modules/.bun/string-width@7.2.0/node_modules/string-width/index.js
665
664
  var segmenter = new Intl.Segmenter;
666
665
  var defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
667
- function stringWidth(string, options = {}) {
666
+ function stringWidth2(string, options = {}) {
668
667
  if (typeof string !== "string" || string.length === 0) {
669
668
  return 0;
670
669
  }
@@ -735,16 +734,16 @@ function destroySingleton(key) {
735
734
  }
736
735
 
737
736
  // src/lib/env.ts
738
- var envRegistry = singleton("env-registry", () => ({}));
739
- function registerEnvVar(config) {
740
- const existing = envRegistry[config.name];
737
+ var envRegistry2 = singleton("env-registry", () => ({}));
738
+ function registerEnvVar2(config) {
739
+ const existing = envRegistry2[config.name];
741
740
  if (existing) {
742
741
  if (existing.description !== config.description || existing.type !== config.type || existing.default !== config.default || existing.required !== config.required) {
743
742
  throw new Error(`Environment variable "${config.name}" is already registered with different configuration. ` + `Existing: ${JSON.stringify(existing)}, New: ${JSON.stringify(config)}`);
744
743
  }
745
744
  return;
746
745
  }
747
- envRegistry[config.name] = config;
746
+ envRegistry2[config.name] = config;
748
747
  }
749
748
  function normalizeBoolean(value) {
750
749
  const lowerValue = value.toLowerCase();
@@ -782,11 +781,11 @@ class EnvStore {
782
781
  if (this.parsedValues.has(key)) {
783
782
  return this.parsedValues.get(key);
784
783
  }
785
- if (!(key in envRegistry)) {
784
+ if (!(key in envRegistry2)) {
786
785
  throw new Error(`Environment variable ${key} is not registered.`);
787
786
  }
788
787
  try {
789
- const value = parseEnvValue(envRegistry[key]);
788
+ const value = parseEnvValue(envRegistry2[key]);
790
789
  this.parsedValues.set(key, value);
791
790
  return value;
792
791
  } catch (error) {
@@ -794,18 +793,18 @@ class EnvStore {
794
793
  }
795
794
  }
796
795
  has(key) {
797
- return key in envRegistry;
796
+ return key in envRegistry2;
798
797
  }
799
798
  clearCache() {
800
799
  this.parsedValues.clear();
801
800
  }
802
801
  }
803
802
  var envStore = singleton("env-store", () => new EnvStore);
804
- function clearEnvCache() {
803
+ function clearEnvCache2() {
805
804
  envStore.clearCache();
806
805
  }
807
- function generateEnvMarkdown() {
808
- const configs = Object.values(envRegistry);
806
+ function generateEnvMarkdown2() {
807
+ const configs = Object.values(envRegistry2);
809
808
  if (configs.length === 0) {
810
809
  return `# Environment Variables
811
810
 
@@ -840,8 +839,8 @@ No environment variables registered.
840
839
  }
841
840
  return markdown;
842
841
  }
843
- function generateEnvColored() {
844
- const configs = Object.values(envRegistry);
842
+ function generateEnvColored2() {
843
+ const configs = Object.values(envRegistry2);
845
844
  if (configs.length === 0) {
846
845
  return `\x1B[1;36mEnvironment Variables\x1B[0m
847
846
 
@@ -874,7 +873,7 @@ No environment variables registered.
874
873
  }
875
874
  return output;
876
875
  }
877
- var env = new Proxy({}, {
876
+ var env2 = new Proxy({}, {
878
877
  get(target, prop) {
879
878
  if (typeof prop !== "string") {
880
879
  return;
@@ -885,7 +884,7 @@ var env = new Proxy({}, {
885
884
  return envStore.has(prop);
886
885
  },
887
886
  ownKeys() {
888
- return Object.keys(envRegistry);
887
+ return Object.keys(envRegistry2);
889
888
  },
890
889
  getOwnPropertyDescriptor(target, prop) {
891
890
  if (envStore.has(prop)) {
@@ -900,7 +899,7 @@ var env = new Proxy({}, {
900
899
  });
901
900
 
902
901
  // src/platform/assets.ts
903
- registerEnvVar({
902
+ registerEnvVar2({
904
903
  name: "OTUI_ASSET_ROOT",
905
904
  description: "Absolute directory containing relocatable OpenTUI runtime assets",
906
905
  type: "string",
@@ -947,10 +946,10 @@ function validateAssetKey(key) {
947
946
  var TEXT_ENCODER = new TextEncoder;
948
947
  var bun = globalThis.Bun;
949
948
  var sleep = bun?.sleep ?? standardSleep;
950
- var stringWidth2 = bun?.stringWidth ?? stringWidth;
949
+ var stringWidth = bun?.stringWidth ?? stringWidth2;
951
950
  var stripANSI = bun?.stripANSI ?? stripAnsi;
952
951
  var writeFile = bun?.write ?? writeFilePortable;
953
- async function resolveBundledFilePath(key, loadBundledFile, fallbackPath, metaUrl, options = {}) {
952
+ async function resolveBundledFilePath2(key, loadBundledFile, fallbackPath, metaUrl, options = {}) {
954
953
  if (options.useAssetRoot ?? true) {
955
954
  const configuredPath = resolveAssetRootPath(key);
956
955
  if (configuredPath !== undefined) {
@@ -1009,7 +1008,7 @@ function extractBundledImportSpecifier(loadBundledFile) {
1009
1008
  }
1010
1009
  function standardSleep(msOrDate) {
1011
1010
  const ms = msOrDate instanceof Date ? msOrDate.getTime() - Date.now() : msOrDate;
1012
- return new Promise((resolve2) => setTimeout(resolve2, ms));
1011
+ return new Promise((resolve) => setTimeout(resolve, ms));
1013
1012
  }
1014
1013
  async function writeFilePortable(destination, data, options) {
1015
1014
  const destinationPath = destination instanceof URL ? fileURLToPath3(destination) : destination;
@@ -1026,8 +1025,8 @@ import { existsSync as existsSync3, writeFileSync } from "fs";
1026
1025
  import { EventEmitter as EventEmitter4 } from "events";
1027
1026
 
1028
1027
  // src/lib/RGBA.ts
1029
- var DEFAULT_FOREGROUND_RGB = [255, 255, 255];
1030
- var DEFAULT_BACKGROUND_RGB = [0, 0, 0];
1028
+ var DEFAULT_FOREGROUND_RGB2 = [255, 255, 255];
1029
+ var DEFAULT_BACKGROUND_RGB2 = [0, 0, 0];
1031
1030
  var INTENT_RGB = 0;
1032
1031
  var INTENT_INDEXED = 1;
1033
1032
  var INTENT_DEFAULT = 2;
@@ -1068,17 +1067,17 @@ function packRGBA8(r, g, b, a, meta) {
1068
1067
  ]);
1069
1068
  }
1070
1069
  function rgbaForAnsi256Index(index) {
1071
- const [r, g, b] = ansi256IndexToRgb(index);
1072
- return RGBA.fromInts(r, g, b);
1070
+ const [r, g, b] = ansi256IndexToRgb2(index);
1071
+ return RGBA2.fromInts(r, g, b);
1073
1072
  }
1074
- function normalizeIndexedColorIndex(index) {
1073
+ function normalizeIndexedColorIndex2(index) {
1075
1074
  if (!Number.isInteger(index) || index < 0 || index > 255) {
1076
1075
  throw new RangeError(`Indexed color must be an integer in the range 0..255, got ${index}`);
1077
1076
  }
1078
1077
  return index;
1079
1078
  }
1080
- function ansi256IndexToRgb(index) {
1081
- const normalizedIndex = normalizeIndexedColorIndex(index);
1079
+ function ansi256IndexToRgb2(index) {
1080
+ const normalizedIndex = normalizeIndexedColorIndex2(index);
1082
1081
  if (normalizedIndex < ANSI16_RGB.length) {
1083
1082
  return ANSI16_RGB[normalizedIndex];
1084
1083
  }
@@ -1093,42 +1092,42 @@ function ansi256IndexToRgb(index) {
1093
1092
  return [value, value, value];
1094
1093
  }
1095
1094
 
1096
- class RGBA {
1095
+ class RGBA2 {
1097
1096
  buffer;
1098
1097
  constructor(buffer) {
1099
1098
  this.buffer = new Uint16Array(4);
1100
1099
  this.buffer.set(buffer.subarray(0, 4));
1101
1100
  }
1102
1101
  static fromArray(array) {
1103
- return new RGBA(array);
1102
+ return new RGBA2(array);
1104
1103
  }
1105
1104
  static fromValues(r, g, b, a = 1) {
1106
- return new RGBA(packRGBA8(toU8(r), toU8(g), toU8(b), toU8(a), packMeta(INTENT_RGB)));
1105
+ return new RGBA2(packRGBA8(toU8(r), toU8(g), toU8(b), toU8(a), packMeta(INTENT_RGB)));
1107
1106
  }
1108
1107
  static clone(rgba) {
1109
- return new RGBA(rgba.buffer);
1108
+ return new RGBA2(rgba.buffer);
1110
1109
  }
1111
1110
  static fromInts(r, g, b, a = 255) {
1112
- return new RGBA(packRGBA8(r, g, b, a, packMeta(INTENT_RGB)));
1111
+ return new RGBA2(packRGBA8(r, g, b, a, packMeta(INTENT_RGB)));
1113
1112
  }
1114
1113
  static fromHex(hex) {
1115
- return hexToRgb(hex);
1114
+ return hexToRgb2(hex);
1116
1115
  }
1117
1116
  static fromIndex(index, snapshot) {
1118
- const normalized = normalizeIndexedColorIndex(index);
1119
- const rgba = snapshot ? parseColor(snapshot) : rgbaForAnsi256Index(normalized);
1117
+ const normalized = normalizeIndexedColorIndex2(index);
1118
+ const rgba = snapshot ? parseColor2(snapshot) : rgbaForAnsi256Index(normalized);
1120
1119
  const [r, g, b, a] = rgba.toInts();
1121
- return new RGBA(packRGBA8(r, g, b, a, packMeta(INTENT_INDEXED, normalized)));
1120
+ return new RGBA2(packRGBA8(r, g, b, a, packMeta(INTENT_INDEXED, normalized)));
1122
1121
  }
1123
1122
  static defaultForeground(snapshot) {
1124
- const rgba = snapshot ? parseColor(snapshot) : RGBA.fromInts(...DEFAULT_FOREGROUND_RGB);
1123
+ const rgba = snapshot ? parseColor2(snapshot) : RGBA2.fromInts(...DEFAULT_FOREGROUND_RGB2);
1125
1124
  const [r, g, b, a] = rgba.toInts();
1126
- return new RGBA(packRGBA8(r, g, b, a, packMeta(INTENT_DEFAULT)));
1125
+ return new RGBA2(packRGBA8(r, g, b, a, packMeta(INTENT_DEFAULT)));
1127
1126
  }
1128
1127
  static defaultBackground(snapshot) {
1129
- const rgba = snapshot ? parseColor(snapshot) : RGBA.fromInts(...DEFAULT_BACKGROUND_RGB);
1128
+ const rgba = snapshot ? parseColor2(snapshot) : RGBA2.fromInts(...DEFAULT_BACKGROUND_RGB2);
1130
1129
  const [r, g, b, a] = rgba.toInts();
1131
- return new RGBA(packRGBA8(r, g, b, a, packMeta(INTENT_DEFAULT)));
1130
+ return new RGBA2(packRGBA8(r, g, b, a, packMeta(INTENT_DEFAULT)));
1132
1131
  }
1133
1132
  toInts() {
1134
1133
  return [this.buffer[0] & 255, this.buffer[1] & 255, this.buffer[2] & 255, this.buffer[3] & 255];
@@ -1185,12 +1184,12 @@ class RGBA {
1185
1184
  return this.buffer[0] === other.buffer[0] && this.buffer[1] === other.buffer[1] && this.buffer[2] === other.buffer[2] && this.buffer[3] === other.buffer[3];
1186
1185
  }
1187
1186
  }
1188
- function normalizeColorValue(value) {
1187
+ function normalizeColorValue2(value) {
1189
1188
  if (value == null)
1190
1189
  return null;
1191
- return { rgba: parseColor(value) };
1190
+ return { rgba: parseColor2(value) };
1192
1191
  }
1193
- function hexToRgb(hex) {
1192
+ function hexToRgb2(hex) {
1194
1193
  hex = hex.replace(/^#/, "");
1195
1194
  if (hex.length === 3) {
1196
1195
  hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
@@ -1199,20 +1198,20 @@ function hexToRgb(hex) {
1199
1198
  }
1200
1199
  if (!/^[0-9A-Fa-f]{6}$/.test(hex) && !/^[0-9A-Fa-f]{8}$/.test(hex)) {
1201
1200
  console.warn(`Invalid hex color: ${hex}, defaulting to magenta`);
1202
- return RGBA.fromValues(1, 0, 1, 1);
1201
+ return RGBA2.fromValues(1, 0, 1, 1);
1203
1202
  }
1204
1203
  const r = parseInt(hex.substring(0, 2), 16);
1205
1204
  const g = parseInt(hex.substring(2, 4), 16);
1206
1205
  const b = parseInt(hex.substring(4, 6), 16);
1207
1206
  const a = hex.length === 8 ? parseInt(hex.substring(6, 8), 16) : 255;
1208
- return RGBA.fromInts(r, g, b, a);
1207
+ return RGBA2.fromInts(r, g, b, a);
1209
1208
  }
1210
- function rgbToHex(rgb) {
1209
+ function rgbToHex2(rgb) {
1211
1210
  const [r, g, b, a] = rgb.toInts();
1212
1211
  const components = a === 255 ? [r, g, b] : [r, g, b, a];
1213
1212
  return "#" + components.map((x) => x.toString(16).padStart(2, "0")).join("");
1214
1213
  }
1215
- function hsvToRgb(h, s, v) {
1214
+ function hsvToRgb2(h, s, v) {
1216
1215
  let r = 0, g = 0, b = 0;
1217
1216
  const i = Math.floor(h / 60) % 6;
1218
1217
  const f = h / 60 - Math.floor(h / 60);
@@ -1251,7 +1250,7 @@ function hsvToRgb(h, s, v) {
1251
1250
  b = q;
1252
1251
  break;
1253
1252
  }
1254
- return RGBA.fromValues(r, g, b, 1);
1253
+ return RGBA2.fromValues(r, g, b, 1);
1255
1254
  }
1256
1255
  var CSS_COLOR_NAMES = {
1257
1256
  black: "#000000",
@@ -1283,27 +1282,27 @@ var CSS_COLOR_NAMES = {
1283
1282
  brightmagenta: "#FF66FF",
1284
1283
  brightwhite: "#FFFFFF"
1285
1284
  };
1286
- function parseColor(color) {
1285
+ function parseColor2(color) {
1287
1286
  if (typeof color === "string") {
1288
1287
  const lowerColor = color.toLowerCase();
1289
1288
  if (lowerColor === "transparent") {
1290
- return RGBA.fromValues(0, 0, 0, 0);
1289
+ return RGBA2.fromValues(0, 0, 0, 0);
1291
1290
  }
1292
1291
  if (CSS_COLOR_NAMES[lowerColor]) {
1293
- return hexToRgb(CSS_COLOR_NAMES[lowerColor]);
1292
+ return hexToRgb2(CSS_COLOR_NAMES[lowerColor]);
1294
1293
  }
1295
- return hexToRgb(color);
1294
+ return hexToRgb2(color);
1296
1295
  }
1297
1296
  return color;
1298
1297
  }
1299
1298
 
1300
1299
  // src/lib/border.ts
1301
1300
  var VALID_BORDER_STYLES = ["single", "double", "rounded", "heavy"];
1302
- function isValidBorderStyle(value) {
1301
+ function isValidBorderStyle2(value) {
1303
1302
  return typeof value === "string" && VALID_BORDER_STYLES.includes(value);
1304
1303
  }
1305
- function parseBorderStyle(value, fallback = "single") {
1306
- if (isValidBorderStyle(value)) {
1304
+ function parseBorderStyle2(value, fallback = "single") {
1305
+ if (isValidBorderStyle2(value)) {
1307
1306
  return value;
1308
1307
  }
1309
1308
  if (value !== undefined && value !== null) {
@@ -1311,7 +1310,7 @@ function parseBorderStyle(value, fallback = "single") {
1311
1310
  }
1312
1311
  return fallback;
1313
1312
  }
1314
- var BorderChars = {
1313
+ var BorderChars2 = {
1315
1314
  single: {
1316
1315
  topLeft: "\u250C",
1317
1316
  topRight: "\u2510",
@@ -1365,7 +1364,7 @@ var BorderChars = {
1365
1364
  cross: "\u254B"
1366
1365
  }
1367
1366
  };
1368
- function getBorderFromSides(sides) {
1367
+ function getBorderFromSides2(sides) {
1369
1368
  const result = [];
1370
1369
  if (sides.top)
1371
1370
  result.push("top");
@@ -1377,7 +1376,7 @@ function getBorderFromSides(sides) {
1377
1376
  result.push("left");
1378
1377
  return result.length > 0 ? result : false;
1379
1378
  }
1380
- function getBorderSides(border) {
1379
+ function getBorderSides2(border) {
1381
1380
  return border === true ? { top: true, right: true, bottom: true, left: true } : Array.isArray(border) ? {
1382
1381
  top: border.includes("top"),
1383
1382
  right: border.includes("right"),
@@ -1385,7 +1384,7 @@ function getBorderSides(border) {
1385
1384
  left: border.includes("left")
1386
1385
  } : { top: false, right: false, bottom: false, left: false };
1387
1386
  }
1388
- function borderCharsToArray(chars) {
1387
+ function borderCharsToArray2(chars) {
1389
1388
  const array = new Uint32Array(11);
1390
1389
  array[0] = chars.topLeft.codePointAt(0);
1391
1390
  array[1] = chars.topRight.codePointAt(0);
@@ -1400,16 +1399,16 @@ function borderCharsToArray(chars) {
1400
1399
  array[10] = chars.cross.codePointAt(0);
1401
1400
  return array;
1402
1401
  }
1403
- var BorderCharArrays = {
1404
- single: borderCharsToArray(BorderChars.single),
1405
- double: borderCharsToArray(BorderChars.double),
1406
- rounded: borderCharsToArray(BorderChars.rounded),
1407
- heavy: borderCharsToArray(BorderChars.heavy)
1402
+ var BorderCharArrays2 = {
1403
+ single: borderCharsToArray2(BorderChars2.single),
1404
+ double: borderCharsToArray2(BorderChars2.double),
1405
+ rounded: borderCharsToArray2(BorderChars2.rounded),
1406
+ heavy: borderCharsToArray2(BorderChars2.heavy)
1408
1407
  };
1409
1408
  // src/lib/KeyHandler.ts
1410
1409
  import { EventEmitter } from "events";
1411
1410
 
1412
- class KeyEvent {
1411
+ class KeyEvent2 {
1413
1412
  name;
1414
1413
  ctrl;
1415
1414
  meta;
@@ -1462,7 +1461,7 @@ class KeyEvent {
1462
1461
  }
1463
1462
  }
1464
1463
 
1465
- class PasteEvent {
1464
+ class PasteEvent2 {
1466
1465
  type = "paste";
1467
1466
  bytes;
1468
1467
  metadata;
@@ -1486,18 +1485,18 @@ class PasteEvent {
1486
1485
  }
1487
1486
  }
1488
1487
 
1489
- class KeyHandler extends EventEmitter {
1488
+ class KeyHandler2 extends EventEmitter {
1490
1489
  processParsedKey(parsedKey) {
1491
1490
  try {
1492
1491
  switch (parsedKey.eventType) {
1493
1492
  case "press":
1494
- this.emit("keypress", new KeyEvent(parsedKey));
1493
+ this.emit("keypress", new KeyEvent2(parsedKey));
1495
1494
  break;
1496
1495
  case "release":
1497
- this.emit("keyrelease", new KeyEvent(parsedKey));
1496
+ this.emit("keyrelease", new KeyEvent2(parsedKey));
1498
1497
  break;
1499
1498
  default:
1500
- this.emit("keypress", new KeyEvent(parsedKey));
1499
+ this.emit("keypress", new KeyEvent2(parsedKey));
1501
1500
  break;
1502
1501
  }
1503
1502
  } catch (error) {
@@ -1508,14 +1507,14 @@ class KeyHandler extends EventEmitter {
1508
1507
  }
1509
1508
  processPaste(bytes, metadata) {
1510
1509
  try {
1511
- this.emit("paste", new PasteEvent(bytes, metadata));
1510
+ this.emit("paste", new PasteEvent2(bytes, metadata));
1512
1511
  } catch (error) {
1513
1512
  console.error(`[KeyHandler] Error processing paste:`, error);
1514
1513
  }
1515
1514
  }
1516
1515
  }
1517
1516
 
1518
- class InternalKeyHandler extends KeyHandler {
1517
+ class InternalKeyHandler2 extends KeyHandler2 {
1519
1518
  renderableHandlers = new Map;
1520
1519
  emit(event, ...args) {
1521
1520
  return this.emitWithPriority(event, ...args);
@@ -4295,7 +4294,7 @@ var pallet_default = {
4295
4294
  };
4296
4295
 
4297
4296
  // src/lib/ascii.font.ts
4298
- var fonts = {
4297
+ var fonts2 = {
4299
4298
  tiny: tiny_default,
4300
4299
  block: block_default,
4301
4300
  shade: shade_default,
@@ -4333,7 +4332,7 @@ function parseColorTags(text) {
4333
4332
  }
4334
4333
  function getParsedFont(fontKey) {
4335
4334
  if (!parsedFonts[fontKey]) {
4336
- const fontDef = fonts[fontKey];
4335
+ const fontDef = fonts2[fontKey];
4337
4336
  const parsedChars = {};
4338
4337
  for (const [char, lines] of Object.entries(fontDef.chars)) {
4339
4338
  parsedChars[char] = lines.map((line) => parseColorTags(line));
@@ -4346,7 +4345,7 @@ function getParsedFont(fontKey) {
4346
4345
  }
4347
4346
  return parsedFonts[fontKey];
4348
4347
  }
4349
- function measureText({ text, font = "tiny" }) {
4348
+ function measureText2({ text, font = "tiny" }) {
4350
4349
  const fontDef = getParsedFont(font);
4351
4350
  if (!fontDef) {
4352
4351
  console.warn(`Font '${font}' not found`);
@@ -4385,7 +4384,7 @@ function measureText({ text, font = "tiny" }) {
4385
4384
  height: fontDef.lines
4386
4385
  };
4387
4386
  }
4388
- function getCharacterPositions(text, font = "tiny") {
4387
+ function getCharacterPositions2(text, font = "tiny") {
4389
4388
  const fontDef = getParsedFont(font);
4390
4389
  if (!fontDef) {
4391
4390
  return [0];
@@ -4418,8 +4417,8 @@ function getCharacterPositions(text, font = "tiny") {
4418
4417
  }
4419
4418
  return positions;
4420
4419
  }
4421
- function coordinateToCharacterIndex(x, text, font = "tiny") {
4422
- const positions = getCharacterPositions(text, font);
4420
+ function coordinateToCharacterIndex2(x, text, font = "tiny") {
4421
+ const positions = getCharacterPositions2(text, font);
4423
4422
  if (x < 0) {
4424
4423
  return 0;
4425
4424
  }
@@ -4436,12 +4435,12 @@ function coordinateToCharacterIndex(x, text, font = "tiny") {
4436
4435
  }
4437
4436
  return 0;
4438
4437
  }
4439
- function renderFontToFrameBuffer(buffer, {
4438
+ function renderFontToFrameBuffer2(buffer, {
4440
4439
  text,
4441
4440
  x = 0,
4442
4441
  y = 0,
4443
- color = [RGBA.fromInts(255, 255, 255, 255)],
4444
- backgroundColor = RGBA.fromInts(0, 0, 0, 255),
4442
+ color = [RGBA2.fromInts(255, 255, 255, 255)],
4443
+ backgroundColor = RGBA2.fromInts(0, 0, 0, 255),
4445
4444
  font = "tiny"
4446
4445
  }) {
4447
4446
  const width = buffer.width;
@@ -4497,7 +4496,7 @@ function renderFontToFrameBuffer(buffer, {
4497
4496
  if (renderX >= 0 && renderX < width) {
4498
4497
  const fontChar = segment.text[charIdx];
4499
4498
  if (fontChar !== " ") {
4500
- buffer.setCellWithAlphaBlending(renderX, renderY, fontChar, parseColor(segmentColor), parseColor(backgroundColor));
4499
+ buffer.setCellWithAlphaBlending(renderX, renderY, fontChar, parseColor2(segmentColor), parseColor2(backgroundColor));
4501
4500
  }
4502
4501
  }
4503
4502
  }
@@ -4516,7 +4515,7 @@ function renderFontToFrameBuffer(buffer, {
4516
4515
  };
4517
4516
  }
4518
4517
  // src/types.ts
4519
- var TextAttributes = {
4518
+ var TextAttributes2 = {
4520
4519
  NONE: 0,
4521
4520
  BOLD: 1 << 0,
4522
4521
  DIM: 1 << 1,
@@ -4527,27 +4526,27 @@ var TextAttributes = {
4527
4526
  HIDDEN: 1 << 6,
4528
4527
  STRIKETHROUGH: 1 << 7
4529
4528
  };
4530
- var ATTRIBUTE_BASE_BITS = 8;
4531
- var ATTRIBUTE_BASE_MASK = 255;
4532
- function getBaseAttributes(attr) {
4533
- return attr & ATTRIBUTE_BASE_MASK;
4534
- }
4535
- var DebugOverlayCorner;
4536
- ((DebugOverlayCorner2) => {
4537
- DebugOverlayCorner2[DebugOverlayCorner2["topLeft"] = 0] = "topLeft";
4538
- DebugOverlayCorner2[DebugOverlayCorner2["topRight"] = 1] = "topRight";
4539
- DebugOverlayCorner2[DebugOverlayCorner2["bottomLeft"] = 2] = "bottomLeft";
4540
- DebugOverlayCorner2[DebugOverlayCorner2["bottomRight"] = 3] = "bottomRight";
4541
- })(DebugOverlayCorner ||= {});
4542
- var TargetChannel;
4543
- ((TargetChannel2) => {
4544
- TargetChannel2[TargetChannel2["FG"] = 1] = "FG";
4545
- TargetChannel2[TargetChannel2["BG"] = 2] = "BG";
4546
- TargetChannel2[TargetChannel2["Both"] = 3] = "Both";
4547
- })(TargetChannel ||= {});
4529
+ var ATTRIBUTE_BASE_BITS2 = 8;
4530
+ var ATTRIBUTE_BASE_MASK2 = 255;
4531
+ function getBaseAttributes2(attr) {
4532
+ return attr & ATTRIBUTE_BASE_MASK2;
4533
+ }
4534
+ var DebugOverlayCorner2;
4535
+ ((DebugOverlayCorner) => {
4536
+ DebugOverlayCorner[DebugOverlayCorner["topLeft"] = 0] = "topLeft";
4537
+ DebugOverlayCorner[DebugOverlayCorner["topRight"] = 1] = "topRight";
4538
+ DebugOverlayCorner[DebugOverlayCorner["bottomLeft"] = 2] = "bottomLeft";
4539
+ DebugOverlayCorner[DebugOverlayCorner["bottomRight"] = 3] = "bottomRight";
4540
+ })(DebugOverlayCorner2 ||= {});
4541
+ var TargetChannel2;
4542
+ ((TargetChannel) => {
4543
+ TargetChannel[TargetChannel["FG"] = 1] = "FG";
4544
+ TargetChannel[TargetChannel["BG"] = 2] = "BG";
4545
+ TargetChannel[TargetChannel["Both"] = 3] = "Both";
4546
+ })(TargetChannel2 ||= {});
4548
4547
 
4549
4548
  // src/utils.ts
4550
- function createTextAttributes({
4549
+ function createTextAttributes2({
4551
4550
  bold = false,
4552
4551
  italic = false,
4553
4552
  underline = false,
@@ -4558,37 +4557,37 @@ function createTextAttributes({
4558
4557
  hidden = false,
4559
4558
  strikethrough = false
4560
4559
  } = {}) {
4561
- let attributes = TextAttributes.NONE;
4560
+ let attributes = TextAttributes2.NONE;
4562
4561
  if (bold)
4563
- attributes |= TextAttributes.BOLD;
4562
+ attributes |= TextAttributes2.BOLD;
4564
4563
  if (italic)
4565
- attributes |= TextAttributes.ITALIC;
4564
+ attributes |= TextAttributes2.ITALIC;
4566
4565
  if (underline)
4567
- attributes |= TextAttributes.UNDERLINE;
4566
+ attributes |= TextAttributes2.UNDERLINE;
4568
4567
  if (dim)
4569
- attributes |= TextAttributes.DIM;
4568
+ attributes |= TextAttributes2.DIM;
4570
4569
  if (blink)
4571
- attributes |= TextAttributes.BLINK;
4570
+ attributes |= TextAttributes2.BLINK;
4572
4571
  if (inverse || reverse)
4573
- attributes |= TextAttributes.INVERSE;
4572
+ attributes |= TextAttributes2.INVERSE;
4574
4573
  if (hidden)
4575
- attributes |= TextAttributes.HIDDEN;
4574
+ attributes |= TextAttributes2.HIDDEN;
4576
4575
  if (strikethrough)
4577
- attributes |= TextAttributes.STRIKETHROUGH;
4576
+ attributes |= TextAttributes2.STRIKETHROUGH;
4578
4577
  return attributes;
4579
4578
  }
4580
- var ATTRIBUTE_BASE_MASK2 = 255;
4579
+ var ATTRIBUTE_BASE_MASK = 255;
4581
4580
  var LINK_ID_SHIFT = 8;
4582
4581
  var LINK_ID_PAYLOAD_MASK = 16777215;
4583
- function attributesWithLink(baseAttributes, linkId) {
4584
- const base = baseAttributes & ATTRIBUTE_BASE_MASK2;
4582
+ function attributesWithLink2(baseAttributes, linkId) {
4583
+ const base = baseAttributes & ATTRIBUTE_BASE_MASK;
4585
4584
  const linkBits = (linkId & LINK_ID_PAYLOAD_MASK) << LINK_ID_SHIFT;
4586
4585
  return base | linkBits;
4587
4586
  }
4588
- function getLinkId(attributes) {
4587
+ function getLinkId2(attributes) {
4589
4588
  return attributes >>> LINK_ID_SHIFT & LINK_ID_PAYLOAD_MASK;
4590
4589
  }
4591
- function visualizeRenderableTree(renderable, maxDepth = 10) {
4590
+ function visualizeRenderableTree2(renderable, maxDepth = 10) {
4592
4591
  function buildTreeLines(node, prefix = "", parentPrefix = "", isLastChild = true, depth = 0) {
4593
4592
  if (depth >= maxDepth) {
4594
4593
  return [`${prefix}${node.id} ... (max depth reached)`];
@@ -4616,30 +4615,30 @@ function visualizeRenderableTree(renderable, maxDepth = 10) {
4616
4615
 
4617
4616
  // src/lib/styled-text.ts
4618
4617
  var BrandedStyledText = Symbol.for("@opentui/core/StyledText");
4619
- function isStyledText(obj) {
4618
+ function isStyledText2(obj) {
4620
4619
  return obj && obj[BrandedStyledText];
4621
4620
  }
4622
4621
 
4623
- class StyledText {
4622
+ class StyledText2 {
4624
4623
  [BrandedStyledText] = true;
4625
4624
  chunks;
4626
4625
  constructor(chunks) {
4627
4626
  this.chunks = chunks;
4628
4627
  }
4629
4628
  }
4630
- function stringToStyledText(content) {
4629
+ function stringToStyledText2(content) {
4631
4630
  const chunk = {
4632
4631
  __isChunk: true,
4633
4632
  text: content
4634
4633
  };
4635
- return new StyledText([chunk]);
4634
+ return new StyledText2([chunk]);
4636
4635
  }
4637
4636
  function applyStyle(input, style) {
4638
4637
  if (typeof input === "object" && "__isChunk" in input) {
4639
4638
  const existingChunk = input;
4640
- const fg = style.fg ? parseColor(style.fg) : existingChunk.fg;
4641
- const bg = style.bg ? parseColor(style.bg) : existingChunk.bg;
4642
- const newAttrs = createTextAttributes(style);
4639
+ const fg = style.fg ? parseColor2(style.fg) : existingChunk.fg;
4640
+ const bg = style.bg ? parseColor2(style.bg) : existingChunk.bg;
4641
+ const newAttrs = createTextAttributes2(style);
4643
4642
  const mergedAttrs = existingChunk.attributes ? existingChunk.attributes | newAttrs : newAttrs;
4644
4643
  return {
4645
4644
  __isChunk: true,
@@ -4651,9 +4650,9 @@ function applyStyle(input, style) {
4651
4650
  };
4652
4651
  } else {
4653
4652
  const plainTextStr = String(input);
4654
- const fg = style.fg ? parseColor(style.fg) : undefined;
4655
- const bg = style.bg ? parseColor(style.bg) : undefined;
4656
- const attributes = createTextAttributes(style);
4653
+ const fg = style.fg ? parseColor2(style.fg) : undefined;
4654
+ const bg = style.bg ? parseColor2(style.bg) : undefined;
4655
+ const attributes = createTextAttributes2(style);
4657
4656
  return {
4658
4657
  __isChunk: true,
4659
4658
  text: plainTextStr,
@@ -4663,40 +4662,40 @@ function applyStyle(input, style) {
4663
4662
  };
4664
4663
  }
4665
4664
  }
4666
- var black = (input) => applyStyle(input, { fg: "black" });
4667
- var red = (input) => applyStyle(input, { fg: "red" });
4668
- var green = (input) => applyStyle(input, { fg: "green" });
4669
- var yellow = (input) => applyStyle(input, { fg: "yellow" });
4670
- var blue = (input) => applyStyle(input, { fg: "blue" });
4671
- var magenta = (input) => applyStyle(input, { fg: "magenta" });
4672
- var cyan = (input) => applyStyle(input, { fg: "cyan" });
4673
- var white = (input) => applyStyle(input, { fg: "white" });
4674
- var brightBlack = (input) => applyStyle(input, { fg: "brightBlack" });
4675
- var brightRed = (input) => applyStyle(input, { fg: "brightRed" });
4676
- var brightGreen = (input) => applyStyle(input, { fg: "brightGreen" });
4677
- var brightYellow = (input) => applyStyle(input, { fg: "brightYellow" });
4678
- var brightBlue = (input) => applyStyle(input, { fg: "brightBlue" });
4679
- var brightMagenta = (input) => applyStyle(input, { fg: "brightMagenta" });
4680
- var brightCyan = (input) => applyStyle(input, { fg: "brightCyan" });
4681
- var brightWhite = (input) => applyStyle(input, { fg: "brightWhite" });
4682
- var bgBlack = (input) => applyStyle(input, { bg: "black" });
4683
- var bgRed = (input) => applyStyle(input, { bg: "red" });
4684
- var bgGreen = (input) => applyStyle(input, { bg: "green" });
4685
- var bgYellow = (input) => applyStyle(input, { bg: "yellow" });
4686
- var bgBlue = (input) => applyStyle(input, { bg: "blue" });
4687
- var bgMagenta = (input) => applyStyle(input, { bg: "magenta" });
4688
- var bgCyan = (input) => applyStyle(input, { bg: "cyan" });
4689
- var bgWhite = (input) => applyStyle(input, { bg: "white" });
4690
- var bold = (input) => applyStyle(input, { bold: true });
4691
- var italic = (input) => applyStyle(input, { italic: true });
4692
- var underline = (input) => applyStyle(input, { underline: true });
4693
- var strikethrough = (input) => applyStyle(input, { strikethrough: true });
4694
- var dim = (input) => applyStyle(input, { dim: true });
4695
- var reverse = (input) => applyStyle(input, { reverse: true });
4696
- var blink = (input) => applyStyle(input, { blink: true });
4697
- var fg = (color) => (input) => applyStyle(input, { fg: color });
4698
- var bg = (color) => (input) => applyStyle(input, { bg: color });
4699
- var link = (url) => (input) => {
4665
+ var black2 = (input) => applyStyle(input, { fg: "black" });
4666
+ var red2 = (input) => applyStyle(input, { fg: "red" });
4667
+ var green2 = (input) => applyStyle(input, { fg: "green" });
4668
+ var yellow2 = (input) => applyStyle(input, { fg: "yellow" });
4669
+ var blue2 = (input) => applyStyle(input, { fg: "blue" });
4670
+ var magenta2 = (input) => applyStyle(input, { fg: "magenta" });
4671
+ var cyan2 = (input) => applyStyle(input, { fg: "cyan" });
4672
+ var white2 = (input) => applyStyle(input, { fg: "white" });
4673
+ var brightBlack2 = (input) => applyStyle(input, { fg: "brightBlack" });
4674
+ var brightRed2 = (input) => applyStyle(input, { fg: "brightRed" });
4675
+ var brightGreen2 = (input) => applyStyle(input, { fg: "brightGreen" });
4676
+ var brightYellow2 = (input) => applyStyle(input, { fg: "brightYellow" });
4677
+ var brightBlue2 = (input) => applyStyle(input, { fg: "brightBlue" });
4678
+ var brightMagenta2 = (input) => applyStyle(input, { fg: "brightMagenta" });
4679
+ var brightCyan2 = (input) => applyStyle(input, { fg: "brightCyan" });
4680
+ var brightWhite2 = (input) => applyStyle(input, { fg: "brightWhite" });
4681
+ var bgBlack2 = (input) => applyStyle(input, { bg: "black" });
4682
+ var bgRed2 = (input) => applyStyle(input, { bg: "red" });
4683
+ var bgGreen2 = (input) => applyStyle(input, { bg: "green" });
4684
+ var bgYellow2 = (input) => applyStyle(input, { bg: "yellow" });
4685
+ var bgBlue2 = (input) => applyStyle(input, { bg: "blue" });
4686
+ var bgMagenta2 = (input) => applyStyle(input, { bg: "magenta" });
4687
+ var bgCyan2 = (input) => applyStyle(input, { bg: "cyan" });
4688
+ var bgWhite2 = (input) => applyStyle(input, { bg: "white" });
4689
+ var bold2 = (input) => applyStyle(input, { bold: true });
4690
+ var italic2 = (input) => applyStyle(input, { italic: true });
4691
+ var underline2 = (input) => applyStyle(input, { underline: true });
4692
+ var strikethrough2 = (input) => applyStyle(input, { strikethrough: true });
4693
+ var dim2 = (input) => applyStyle(input, { dim: true });
4694
+ var reverse2 = (input) => applyStyle(input, { reverse: true });
4695
+ var blink2 = (input) => applyStyle(input, { blink: true });
4696
+ var fg2 = (color) => (input) => applyStyle(input, { fg: color });
4697
+ var bg2 = (color) => (input) => applyStyle(input, { bg: color });
4698
+ var link2 = (url) => (input) => {
4700
4699
  const chunk = typeof input === "object" && "__isChunk" in input ? input : {
4701
4700
  __isChunk: true,
4702
4701
  text: String(input)
@@ -4706,7 +4705,7 @@ var link = (url) => (input) => {
4706
4705
  link: { url }
4707
4706
  };
4708
4707
  };
4709
- function t(strings, ...values) {
4708
+ function t2(strings, ...values) {
4710
4709
  const chunks = [];
4711
4710
  for (let i = 0;i < strings.length; i++) {
4712
4711
  const raw = strings[i];
@@ -4729,7 +4728,7 @@ function t(strings, ...values) {
4729
4728
  });
4730
4729
  }
4731
4730
  }
4732
- return new StyledText(chunks);
4731
+ return new StyledText2(chunks);
4733
4732
  }
4734
4733
 
4735
4734
  // src/lib/hast-styled-text.ts
@@ -4759,12 +4758,12 @@ function hastToTextChunks(node, syntaxStyle, parentStyles = []) {
4759
4758
  }
4760
4759
  return chunks;
4761
4760
  }
4762
- function hastToStyledText(hast, syntaxStyle) {
4761
+ function hastToStyledText2(hast, syntaxStyle) {
4763
4762
  const chunks = hastToTextChunks(hast, syntaxStyle);
4764
- return new StyledText(chunks);
4763
+ return new StyledText2(chunks);
4765
4764
  }
4766
4765
  // src/lib/clock.ts
4767
- class SystemClock {
4766
+ class SystemClock2 {
4768
4767
  now() {
4769
4768
  if (!globalThis.performance || typeof globalThis.performance.now !== "function") {
4770
4769
  throw new Error("SystemClock requires globalThis.performance.now()");
@@ -5269,9 +5268,9 @@ var keyName = {
5269
5268
  "[8^": "end",
5270
5269
  "[Z": "tab"
5271
5270
  };
5272
- var nonAlphanumericKeys = [...Object.values(keyName), "backspace"];
5273
- var terminalNamedSingleStrokeKeys = [
5274
- ...new Set(["return", "linefeed", "tab", "escape", "space", ...nonAlphanumericKeys, ...kittyNamedSingleStrokeKeys])
5271
+ var nonAlphanumericKeys2 = [...Object.values(keyName), "backspace"];
5272
+ var terminalNamedSingleStrokeKeys2 = [
5273
+ ...new Set(["return", "linefeed", "tab", "escape", "space", ...nonAlphanumericKeys2, ...kittyNamedSingleStrokeKeys])
5275
5274
  ];
5276
5275
  var isShiftKey = (code) => {
5277
5276
  return ["[a", "[b", "[c", "[d", "[e", "[2$", "[3$", "[5$", "[6$", "[7$", "[8$", "[Z"].includes(code);
@@ -5311,7 +5310,7 @@ var ss3NumpadPrintable = {
5311
5310
  OX: "="
5312
5311
  };
5313
5312
  var modifyOtherKeysRe = /^\x1b\[27;(\d+);(\d+)~$/;
5314
- var parseKeypress = (s = "", options = {}) => {
5313
+ var parseKeypress2 = (s = "", options = {}) => {
5315
5314
  let parts;
5316
5315
  if (Buffer2.isBuffer(s)) {
5317
5316
  if (s[0] > 127 && s[1] === undefined) {
@@ -5501,14 +5500,14 @@ var parseKeypress = (s = "", options = {}) => {
5501
5500
  return key;
5502
5501
  };
5503
5502
  // src/lib/scroll-acceleration.ts
5504
- class LinearScrollAccel {
5503
+ class LinearScrollAccel2 {
5505
5504
  tick(_now) {
5506
5505
  return 1;
5507
5506
  }
5508
5507
  reset() {}
5509
5508
  }
5510
5509
 
5511
- class MacOSScrollAccel {
5510
+ class MacOSScrollAccel2 {
5512
5511
  opts;
5513
5512
  lastTickTime = 0;
5514
5513
  velocityHistory = [];
@@ -5549,7 +5548,7 @@ class MacOSScrollAccel {
5549
5548
  }
5550
5549
  }
5551
5550
  // src/lib/yoga.options.ts
5552
- function parseAlign(value) {
5551
+ function parseAlign2(value) {
5553
5552
  if (value == null) {
5554
5553
  return 0 /* Auto */;
5555
5554
  }
@@ -5576,7 +5575,7 @@ function parseAlign(value) {
5576
5575
  return 0 /* Auto */;
5577
5576
  }
5578
5577
  }
5579
- function parseAlignItems(value) {
5578
+ function parseAlignItems2(value) {
5580
5579
  if (value == null) {
5581
5580
  return 4 /* Stretch */;
5582
5581
  }
@@ -5603,7 +5602,7 @@ function parseAlignItems(value) {
5603
5602
  return 4 /* Stretch */;
5604
5603
  }
5605
5604
  }
5606
- function parseBoxSizing(value) {
5605
+ function parseBoxSizing2(value) {
5607
5606
  if (value == null) {
5608
5607
  return 0 /* BorderBox */;
5609
5608
  }
@@ -5616,7 +5615,7 @@ function parseBoxSizing(value) {
5616
5615
  return 0 /* BorderBox */;
5617
5616
  }
5618
5617
  }
5619
- function parseDimension(value) {
5618
+ function parseDimension2(value) {
5620
5619
  if (value == null) {
5621
5620
  return 0 /* Width */;
5622
5621
  }
@@ -5629,7 +5628,7 @@ function parseDimension(value) {
5629
5628
  return 0 /* Width */;
5630
5629
  }
5631
5630
  }
5632
- function parseDirection(value) {
5631
+ function parseDirection2(value) {
5633
5632
  if (value == null) {
5634
5633
  return 1 /* LTR */;
5635
5634
  }
@@ -5644,7 +5643,7 @@ function parseDirection(value) {
5644
5643
  return 1 /* LTR */;
5645
5644
  }
5646
5645
  }
5647
- function parseDisplay(value) {
5646
+ function parseDisplay2(value) {
5648
5647
  if (value == null) {
5649
5648
  return 0 /* Flex */;
5650
5649
  }
@@ -5659,7 +5658,7 @@ function parseDisplay(value) {
5659
5658
  return 0 /* Flex */;
5660
5659
  }
5661
5660
  }
5662
- function parseEdge(value) {
5661
+ function parseEdge2(value) {
5663
5662
  if (value == null) {
5664
5663
  return 8 /* All */;
5665
5664
  }
@@ -5686,7 +5685,7 @@ function parseEdge(value) {
5686
5685
  return 8 /* All */;
5687
5686
  }
5688
5687
  }
5689
- function parseFlexDirection(value) {
5688
+ function parseFlexDirection2(value) {
5690
5689
  if (value == null) {
5691
5690
  return 0 /* Column */;
5692
5691
  }
@@ -5703,7 +5702,7 @@ function parseFlexDirection(value) {
5703
5702
  return 0 /* Column */;
5704
5703
  }
5705
5704
  }
5706
- function parseGutter(value) {
5705
+ function parseGutter2(value) {
5707
5706
  if (value == null) {
5708
5707
  return 2 /* All */;
5709
5708
  }
@@ -5718,7 +5717,7 @@ function parseGutter(value) {
5718
5717
  return 2 /* All */;
5719
5718
  }
5720
5719
  }
5721
- function parseJustify(value) {
5720
+ function parseJustify2(value) {
5722
5721
  if (value == null) {
5723
5722
  return 0 /* FlexStart */;
5724
5723
  }
@@ -5739,7 +5738,7 @@ function parseJustify(value) {
5739
5738
  return 0 /* FlexStart */;
5740
5739
  }
5741
5740
  }
5742
- function parseLogLevel(value) {
5741
+ function parseLogLevel2(value) {
5743
5742
  if (value == null) {
5744
5743
  return 2 /* Info */;
5745
5744
  }
@@ -5760,7 +5759,7 @@ function parseLogLevel(value) {
5760
5759
  return 2 /* Info */;
5761
5760
  }
5762
5761
  }
5763
- function parseMeasureMode(value) {
5762
+ function parseMeasureMode2(value) {
5764
5763
  if (value == null) {
5765
5764
  return 0 /* Undefined */;
5766
5765
  }
@@ -5775,7 +5774,7 @@ function parseMeasureMode(value) {
5775
5774
  return 0 /* Undefined */;
5776
5775
  }
5777
5776
  }
5778
- function parseOverflow(value) {
5777
+ function parseOverflow2(value) {
5779
5778
  if (value == null) {
5780
5779
  return 0 /* Visible */;
5781
5780
  }
@@ -5790,7 +5789,7 @@ function parseOverflow(value) {
5790
5789
  return 0 /* Visible */;
5791
5790
  }
5792
5791
  }
5793
- function parsePositionType(value) {
5792
+ function parsePositionType2(value) {
5794
5793
  if (value == null) {
5795
5794
  return 1 /* Relative */;
5796
5795
  }
@@ -5805,7 +5804,7 @@ function parsePositionType(value) {
5805
5804
  return 0 /* Static */;
5806
5805
  }
5807
5806
  }
5808
- function parseUnit(value) {
5807
+ function parseUnit2(value) {
5809
5808
  if (value == null) {
5810
5809
  return 1 /* Point */;
5811
5810
  }
@@ -5822,7 +5821,7 @@ function parseUnit(value) {
5822
5821
  return 1 /* Point */;
5823
5822
  }
5824
5823
  }
5825
- function parseWrap(value) {
5824
+ function parseWrap2(value) {
5826
5825
  if (value == null) {
5827
5826
  return 0 /* NoWrap */;
5828
5827
  }
@@ -5838,7 +5837,7 @@ function parseWrap(value) {
5838
5837
  }
5839
5838
  }
5840
5839
  // src/lib/parse.mouse.ts
5841
- class MouseParser {
5840
+ class MouseParser2 {
5842
5841
  mouseButtonsPressed = new Set;
5843
5842
  static SCROLL_DIRECTIONS = {
5844
5843
  0: "up",
@@ -5936,7 +5935,7 @@ class MouseParser {
5936
5935
  decodeSgrEvent(rawButtonCode, wireX, wireY, pressRelease) {
5937
5936
  const button = rawButtonCode & 3;
5938
5937
  const isScroll = (rawButtonCode & 64) !== 0;
5939
- const scrollDirection = !isScroll ? undefined : MouseParser.SCROLL_DIRECTIONS[button];
5938
+ const scrollDirection = !isScroll ? undefined : MouseParser2.SCROLL_DIRECTIONS[button];
5940
5939
  const isMotion = (rawButtonCode & 32) !== 0;
5941
5940
  const modifiers = {
5942
5941
  shift: (rawButtonCode & 4) !== 0,
@@ -5981,7 +5980,7 @@ class MouseParser {
5981
5980
  const button = buttonByte & 3;
5982
5981
  const isScroll = (buttonByte & 64) !== 0;
5983
5982
  const isMotion = (buttonByte & 32) !== 0;
5984
- const scrollDirection = !isScroll ? undefined : MouseParser.SCROLL_DIRECTIONS[button];
5983
+ const scrollDirection = !isScroll ? undefined : MouseParser2.SCROLL_DIRECTIONS[button];
5985
5984
  const modifiers = {
5986
5985
  shift: (buttonByte & 4) !== 0,
5987
5986
  alt: (buttonByte & 8) !== 0,
@@ -6032,7 +6031,7 @@ class SelectionAnchor {
6032
6031
  }
6033
6032
  }
6034
6033
 
6035
- class Selection {
6034
+ class Selection2 {
6036
6035
  _anchor;
6037
6036
  _focus;
6038
6037
  _selectedRenderables = [];
@@ -6126,7 +6125,7 @@ class Selection {
6126
6125
  `);
6127
6126
  }
6128
6127
  }
6129
- function convertGlobalToLocalSelection(globalSelection, localX, localY) {
6128
+ function convertGlobalToLocalSelection2(globalSelection, localX, localY) {
6130
6129
  if (!globalSelection?.isActive) {
6131
6130
  return null;
6132
6131
  }
@@ -6140,7 +6139,7 @@ function convertGlobalToLocalSelection(globalSelection, localX, localY) {
6140
6139
  };
6141
6140
  }
6142
6141
 
6143
- class ASCIIFontSelectionHelper {
6142
+ class ASCIIFontSelectionHelper2 {
6144
6143
  getText;
6145
6144
  getFont;
6146
6145
  localSelection = null;
@@ -6160,7 +6159,7 @@ class ASCIIFontSelectionHelper {
6160
6159
  }
6161
6160
  const text = this.getText();
6162
6161
  const font = this.getFont();
6163
- const charIndex = coordinateToCharacterIndex(localX, text, font);
6162
+ const charIndex = coordinateToCharacterIndex2(localX, text, font);
6164
6163
  return charIndex >= 0 && charIndex <= text.length;
6165
6164
  }
6166
6165
  onLocalSelectionChanged(localSelection, width, height) {
@@ -6171,7 +6170,7 @@ class ASCIIFontSelectionHelper {
6171
6170
  }
6172
6171
  const text = this.getText();
6173
6172
  const font = this.getFont();
6174
- const positions = getCharacterPositions(text, font);
6173
+ const positions = getCharacterPositions2(text, font);
6175
6174
  const minY = Math.min(localSelection.anchorY, localSelection.focusY);
6176
6175
  const maxY = Math.max(localSelection.anchorY, localSelection.focusY);
6177
6176
  if (maxY < 0 || minY > height - 1) {
@@ -6225,7 +6224,7 @@ var DEFAULT_PROTOCOL_CONTEXT = {
6225
6224
  startupCursorCprActive: false
6226
6225
  };
6227
6226
  var RXVT_DOLLAR_CSI_RE = /^\x1b\[\d+\$$/;
6228
- var SYSTEM_CLOCK = new SystemClock;
6227
+ var SYSTEM_CLOCK = new SystemClock2;
6229
6228
 
6230
6229
  class ByteQueue {
6231
6230
  buf;
@@ -6423,8 +6422,8 @@ function canStillBePixelResolution(state) {
6423
6422
  function canStillBePixelResolutionPrefix(bytes) {
6424
6423
  const fixedPrefix = [ESC, 91, 52, 59];
6425
6424
  const fixedLength = Math.min(bytes.length, fixedPrefix.length);
6426
- for (let index2 = 0;index2 < fixedLength; index2 += 1) {
6427
- if (bytes[index2] !== fixedPrefix[index2])
6425
+ for (let index = 0;index < fixedLength; index += 1) {
6426
+ if (bytes[index] !== fixedPrefix[index])
6428
6427
  return false;
6429
6428
  }
6430
6429
  if (bytes.length <= fixedPrefix.length)
@@ -6553,7 +6552,7 @@ function joinPasteBytes(parts, totalLength) {
6553
6552
  return bytes;
6554
6553
  }
6555
6554
 
6556
- class StdinParser {
6555
+ class StdinParser2 {
6557
6556
  pending = new ByteQueue(INITIAL_PENDING_CAPACITY);
6558
6557
  events = [];
6559
6558
  timeoutMs;
@@ -6561,7 +6560,7 @@ class StdinParser {
6561
6560
  armTimeouts;
6562
6561
  onTimeoutFlush;
6563
6562
  useKittyKeyboard;
6564
- mouseParser = new MouseParser;
6563
+ mouseParser = new MouseParser2;
6565
6564
  clock;
6566
6565
  protocolContext;
6567
6566
  timeoutId = null;
@@ -7529,7 +7528,7 @@ class StdinParser {
7529
7528
  }
7530
7529
  }
7531
7530
  emitKeyOrResponse(protocol, raw) {
7532
- const parsed = parseKeypress(raw, { useKittyKeyboard: this.useKittyKeyboard });
7531
+ const parsed = parseKeypress2(raw, { useKittyKeyboard: this.useKittyKeyboard });
7533
7532
  if (parsed) {
7534
7533
  this.events.push({
7535
7534
  type: "key",
@@ -7558,7 +7557,7 @@ class StdinParser {
7558
7557
  });
7559
7558
  }
7560
7559
  emitLegacyHighByte(byte) {
7561
- const parsed = parseKeypress(Buffer3.from([byte]), { useKittyKeyboard: this.useKittyKeyboard });
7560
+ const parsed = parseKeypress2(Buffer3.from([byte]), { useKittyKeyboard: this.useKittyKeyboard });
7562
7561
  if (parsed) {
7563
7562
  this.events.push({
7564
7563
  type: "key",
@@ -7709,7 +7708,7 @@ class StdinParser {
7709
7708
  }
7710
7709
  }
7711
7710
  // src/lib/tree-sitter-styled-text.ts
7712
- registerEnvVar({ name: "OTUI_TS_STYLE_WARN", default: false, description: "Enable warnings for missing syntax styles" });
7711
+ registerEnvVar2({ name: "OTUI_TS_STYLE_WARN", default: false, description: "Enable warnings for missing syntax styles" });
7713
7712
  function getSpecificity(group) {
7714
7713
  return group.split(".").length;
7715
7714
  }
@@ -7719,8 +7718,9 @@ function shouldSuppressInInjection(group, meta) {
7719
7718
  }
7720
7719
  return group === "markup.raw.block";
7721
7720
  }
7722
- function treeSitterToTextChunks(content, highlights, syntaxStyle, options) {
7721
+ function treeSitterToTextChunks2(content, highlights, syntaxStyle, options) {
7723
7722
  const chunks = [];
7723
+ const ranges = options?.ranges;
7724
7724
  const defaultStyle = syntaxStyle.getStyle("default");
7725
7725
  const concealEnabled = options?.enabled ?? true;
7726
7726
  const baseStyle = options?.baseHighlight ? syntaxStyle.getStyle(options.baseHighlight) : undefined;
@@ -7770,13 +7770,14 @@ function treeSitterToTextChunks(content, highlights, syntaxStyle, options) {
7770
7770
  text: replacementText,
7771
7771
  fg: defaultStyle?.fg,
7772
7772
  bg: defaultStyle?.bg,
7773
- attributes: defaultStyle ? createTextAttributes({
7773
+ attributes: defaultStyle ? createTextAttributes2({
7774
7774
  bold: defaultStyle.bold,
7775
7775
  italic: defaultStyle.italic,
7776
7776
  underline: defaultStyle.underline,
7777
7777
  dim: defaultStyle.dim
7778
7778
  }) : 0
7779
7779
  });
7780
+ ranges?.push({ start: currentOffset, end: boundary.offset });
7780
7781
  }
7781
7782
  } else {
7782
7783
  const insideInjectionContainer = injectionContainerRanges.some((range) => currentOffset >= range.start && currentOffset < range.end);
@@ -7816,11 +7817,11 @@ function treeSitterToTextChunks(content, highlights, syntaxStyle, options) {
7816
7817
  } else {
7817
7818
  if (group.includes(".")) {
7818
7819
  const baseName = group.split(".")[0];
7819
- if (env.OTUI_TS_STYLE_WARN) {
7820
+ if (env2.OTUI_TS_STYLE_WARN) {
7820
7821
  console.warn(`Syntax style not found for group "${group}" or base scope "${baseName}", using default style`);
7821
7822
  }
7822
7823
  } else {
7823
- if (env.OTUI_TS_STYLE_WARN) {
7824
+ if (env2.OTUI_TS_STYLE_WARN) {
7824
7825
  console.warn(`Syntax style not found for group "${group}", using default style`);
7825
7826
  }
7826
7827
  }
@@ -7832,13 +7833,14 @@ function treeSitterToTextChunks(content, highlights, syntaxStyle, options) {
7832
7833
  text: segmentText,
7833
7834
  fg: finalStyle?.fg,
7834
7835
  bg: finalStyle?.bg,
7835
- attributes: finalStyle ? createTextAttributes({
7836
+ attributes: finalStyle ? createTextAttributes2({
7836
7837
  bold: finalStyle.bold,
7837
7838
  italic: finalStyle.italic,
7838
7839
  underline: finalStyle.underline,
7839
7840
  dim: finalStyle.dim
7840
7841
  }) : 0
7841
7842
  });
7843
+ ranges?.push({ start: currentOffset, end: boundary.offset });
7842
7844
  }
7843
7845
  } else if (currentOffset < boundary.offset) {
7844
7846
  const text = content.slice(currentOffset, boundary.offset);
@@ -7848,13 +7850,14 @@ function treeSitterToTextChunks(content, highlights, syntaxStyle, options) {
7848
7850
  text,
7849
7851
  fg: style?.fg,
7850
7852
  bg: style?.bg,
7851
- attributes: style ? createTextAttributes({
7853
+ attributes: style ? createTextAttributes2({
7852
7854
  bold: style.bold,
7853
7855
  italic: style.italic,
7854
7856
  underline: style.underline,
7855
7857
  dim: style.dim
7856
7858
  }) : 0
7857
7859
  });
7860
+ ranges?.push({ start: currentOffset, end: boundary.offset });
7858
7861
  }
7859
7862
  if (boundary.type === "start") {
7860
7863
  activeHighlights.add(boundary.highlightIndex);
@@ -7894,24 +7897,25 @@ function treeSitterToTextChunks(content, highlights, syntaxStyle, options) {
7894
7897
  text,
7895
7898
  fg: style?.fg,
7896
7899
  bg: style?.bg,
7897
- attributes: style ? createTextAttributes({
7900
+ attributes: style ? createTextAttributes2({
7898
7901
  bold: style.bold,
7899
7902
  italic: style.italic,
7900
7903
  underline: style.underline,
7901
7904
  dim: style.dim
7902
7905
  }) : 0
7903
7906
  });
7907
+ ranges?.push({ start: currentOffset, end: content.length });
7904
7908
  }
7905
7909
  return chunks;
7906
7910
  }
7907
- async function treeSitterToStyledText(content, filetype, syntaxStyle, client, options) {
7911
+ async function treeSitterToStyledText2(content, filetype, syntaxStyle, client, options) {
7908
7912
  const result = await client.highlightOnce(content, filetype);
7909
7913
  if (result.highlights && result.highlights.length > 0 || options?.baseHighlight) {
7910
- const chunks = treeSitterToTextChunks(content, result.highlights ?? [], syntaxStyle, {
7914
+ const chunks = treeSitterToTextChunks2(content, result.highlights ?? [], syntaxStyle, {
7911
7915
  enabled: options?.conceal?.enabled ?? true,
7912
7916
  baseHighlight: options?.baseHighlight
7913
7917
  });
7914
- return new StyledText(chunks);
7918
+ return new StyledText2(chunks);
7915
7919
  } else {
7916
7920
  const defaultStyle = syntaxStyle.mergeStyles("default");
7917
7921
  const chunks = [
@@ -7923,7 +7927,7 @@ async function treeSitterToStyledText(content, filetype, syntaxStyle, client, op
7923
7927
  attributes: defaultStyle.attributes
7924
7928
  }
7925
7929
  ];
7926
- return new StyledText(chunks);
7930
+ return new StyledText2(chunks);
7927
7931
  }
7928
7932
  }
7929
7933
  // src/lib/tree-sitter/client.ts
@@ -7942,13 +7946,13 @@ class DebounceController {
7942
7946
  }
7943
7947
  debounce(id, ms, fn) {
7944
7948
  const scopeMap = TIMERS_MAP.get(this.scopeId);
7945
- return new Promise((resolve2, reject) => {
7949
+ return new Promise((resolve, reject) => {
7946
7950
  if (scopeMap.has(id)) {
7947
7951
  clearTimeout(scopeMap.get(id));
7948
7952
  }
7949
7953
  const timerId = setTimeout(() => {
7950
7954
  try {
7951
- resolve2(fn());
7955
+ resolve(fn());
7952
7956
  } catch (error) {
7953
7957
  reject(error);
7954
7958
  }
@@ -8052,7 +8056,7 @@ function resolveBundledDefaultParserAsset(relativePath, fallbackPath) {
8052
8056
  if (!loadBundledFile) {
8053
8057
  throw new Error(`Unknown OpenTUI default parser asset: ${JSON.stringify(relativePath)}`);
8054
8058
  }
8055
- return resolveBundledFilePath(`@opentui/core/${relativePath}`, loadBundledFile, fallbackPath, import.meta.url);
8059
+ return resolveBundledFilePath2(`@opentui/core/${relativePath}`, loadBundledFile, fallbackPath, import.meta.url);
8056
8060
  }
8057
8061
 
8058
8062
  // src/node-asset-target.ts
@@ -8096,7 +8100,7 @@ function getCurrentNodeAssetTarget() {
8096
8100
  var CORE_ASSET_PREFIX = "@opentui/core/";
8097
8101
  var PARSER_WORKER_ASSET_KEY = `${CORE_ASSET_PREFIX}parser.worker.js`;
8098
8102
  var TREE_SITTER_WASM_ASSET_KEY = "web-tree-sitter/tree-sitter.wasm";
8099
- var bundledTreeSitterWorkerPath = await resolveBundledFilePath(PARSER_WORKER_ASSET_KEY, () => import("@opentui/core/parser.worker", { with: { type: "file" } }), new URL("../lib/tree-sitter/parser.worker.js", import.meta.url), import.meta.url, { useAssetRoot: false });
8103
+ var bundledTreeSitterWorkerPath = await resolveBundledFilePath2(PARSER_WORKER_ASSET_KEY, () => import("@opentui/core/parser.worker", { with: { type: "file" } }), new URL("../lib/tree-sitter/parser.worker.js", import.meta.url), import.meta.url, { useAssetRoot: false });
8100
8104
  function resolveDefaultParserAsset(relativePath, fallbackPath) {
8101
8105
  return resolveBundledDefaultParserAsset(relativePath, fallbackPath);
8102
8106
  }
@@ -8104,7 +8108,7 @@ function resolveDefaultTreeSitterWorkerPath(_fallbackPath) {
8104
8108
  return resolveAssetPath(PARSER_WORKER_ASSET_KEY, bundledTreeSitterWorkerPath);
8105
8109
  }
8106
8110
  function resolveTreeSitterWasm() {
8107
- return resolveBundledFilePath(TREE_SITTER_WASM_ASSET_KEY, () => import("web-tree-sitter/tree-sitter.wasm", { with: { type: "wasm" } }), () => import.meta.resolve(TREE_SITTER_WASM_ASSET_KEY), import.meta.url);
8111
+ return resolveBundledFilePath2(TREE_SITTER_WASM_ASSET_KEY, () => import("web-tree-sitter/tree-sitter.wasm", { with: { type: "wasm" } }), () => import.meta.resolve(TREE_SITTER_WASM_ASSET_KEY), import.meta.url);
8108
8112
  }
8109
8113
  async function resolveNativeLibraryPath() {
8110
8114
  const asset = getNativeAssetDescriptor(getCurrentNodeAssetTarget());
@@ -8315,11 +8319,9 @@ function createNodeWorkerConstructor(node) {
8315
8319
  return this.terminationPromise;
8316
8320
  }
8317
8321
  this.worker.off("message", this.handleMessage);
8318
- this.worker.off("error", this.handleError);
8319
8322
  const termination = this.worker.terminate().catch((error) => {
8320
8323
  this.terminationPromise = undefined;
8321
8324
  this.worker.on("message", this.handleMessage);
8322
- this.worker.on("error", this.handleError);
8323
8325
  throw error;
8324
8326
  });
8325
8327
  this.terminationPromise = termination;
@@ -8493,14 +8495,14 @@ function setGlobalWorkerMessageHandler(handler) {
8493
8495
  }
8494
8496
 
8495
8497
  // src/lib/tree-sitter/client.ts
8496
- registerEnvVar({
8498
+ registerEnvVar2({
8497
8499
  name: "OTUI_TREE_SITTER_WORKER_PATH",
8498
8500
  description: "Path to the TreeSitter worker entry script",
8499
8501
  type: "string",
8500
8502
  default: ""
8501
8503
  });
8502
8504
  var DEFAULT_PARSER_OVERRIDES = [];
8503
- function addDefaultParsers(parsers) {
8505
+ function addDefaultParsers2(parsers) {
8504
8506
  for (const parser of parsers) {
8505
8507
  DEFAULT_PARSER_OVERRIDES = [
8506
8508
  ...DEFAULT_PARSER_OVERRIDES.filter((existingParser) => existingParser.filetype !== parser.filetype),
@@ -8510,7 +8512,7 @@ function addDefaultParsers(parsers) {
8510
8512
  }
8511
8513
  var isUrl = (path) => path.startsWith("http://") || path.startsWith("https://");
8512
8514
 
8513
- class TreeSitterClient extends EventEmitter2 {
8515
+ class TreeSitterClient2 extends EventEmitter2 {
8514
8516
  initialized = false;
8515
8517
  worker;
8516
8518
  buffers = new Map;
@@ -8618,8 +8620,8 @@ class TreeSitterClient extends EventEmitter2 {
8618
8620
  if (this.options.workerPath) {
8619
8621
  return this.options.workerPath;
8620
8622
  }
8621
- if (env.OTUI_TREE_SITTER_WORKER_PATH) {
8622
- return env.OTUI_TREE_SITTER_WORKER_PATH;
8623
+ if (env2.OTUI_TREE_SITTER_WORKER_PATH) {
8624
+ return env2.OTUI_TREE_SITTER_WORKER_PATH;
8623
8625
  }
8624
8626
  if (typeof OTUI_TREE_SITTER_WORKER_PATH !== "undefined") {
8625
8627
  return OTUI_TREE_SITTER_WORKER_PATH;
@@ -8704,7 +8706,7 @@ class TreeSitterClient extends EventEmitter2 {
8704
8706
  async initializeClient(generation, worker) {
8705
8707
  const treeSitterWasmPath = await resolveTreeSitterWasm();
8706
8708
  this.assertCurrentInitialization(generation, worker);
8707
- await new Promise((resolve3, reject) => {
8709
+ await new Promise((resolve, reject) => {
8708
8710
  const timeoutMs = this.options.initTimeout ?? 1e4;
8709
8711
  const timeoutId = setTimeout(() => {
8710
8712
  const error = new Error("Worker initialization timed out");
@@ -8712,7 +8714,7 @@ class TreeSitterClient extends EventEmitter2 {
8712
8714
  this.initializeResolvers = undefined;
8713
8715
  reject(error);
8714
8716
  }, timeoutMs);
8715
- this.initializeResolvers = { resolve: resolve3, reject, timeoutId };
8717
+ this.initializeResolvers = { resolve, reject, timeoutId };
8716
8718
  this.sendWorkerMessage({
8717
8719
  type: "INIT",
8718
8720
  dataPath: this.options.dataPath,
@@ -8729,7 +8731,7 @@ class TreeSitterClient extends EventEmitter2 {
8729
8731
  this.assertCurrentInitialization(generation, worker);
8730
8732
  const overriddenFiletypes = new Set(DEFAULT_PARSER_OVERRIDES.map((parser) => parser.filetype));
8731
8733
  for (const parser of [
8732
- ...defaultParsers.filter((parser2) => !overriddenFiletypes.has(parser2.filetype)),
8734
+ ...defaultParsers.filter((parser) => !overriddenFiletypes.has(parser.filetype)),
8733
8735
  ...DEFAULT_PARSER_OVERRIDES
8734
8736
  ]) {
8735
8737
  worker.postMessage({ type: "ADD_FILETYPE_PARSER", filetypeParser: this.resolveFiletypeParser(parser) });
@@ -8763,8 +8765,8 @@ class TreeSitterClient extends EventEmitter2 {
8763
8765
  }
8764
8766
  async getPerformance() {
8765
8767
  const messageId = `performance_${this.messageIdCounter++}`;
8766
- return new Promise((resolve3, reject) => {
8767
- this.messageCallbacks.set(messageId, { resolve: resolve3, reject });
8768
+ return new Promise((resolve, reject) => {
8769
+ this.messageCallbacks.set(messageId, { resolve, reject });
8768
8770
  try {
8769
8771
  this.sendWorkerMessage({ type: "GET_PERFORMANCE", messageId });
8770
8772
  } catch (error) {
@@ -8782,8 +8784,8 @@ class TreeSitterClient extends EventEmitter2 {
8782
8784
  }
8783
8785
  }
8784
8786
  const messageId = `oneshot_${this.messageIdCounter++}`;
8785
- return new Promise((resolve3, reject) => {
8786
- this.messageCallbacks.set(messageId, { resolve: resolve3, reject });
8787
+ return new Promise((resolve, reject) => {
8788
+ this.messageCallbacks.set(messageId, { resolve, reject });
8787
8789
  try {
8788
8790
  this.sendWorkerMessage({
8789
8791
  type: "ONESHOT_HIGHLIGHT",
@@ -8906,8 +8908,8 @@ class TreeSitterClient extends EventEmitter2 {
8906
8908
  }
8907
8909
  async preloadParser(filetype) {
8908
8910
  const messageId = `has_parser_${this.messageIdCounter++}`;
8909
- const response = await new Promise((resolve3, reject) => {
8910
- this.messageCallbacks.set(messageId, { resolve: resolve3, reject });
8911
+ const response = await new Promise((resolve, reject) => {
8912
+ this.messageCallbacks.set(messageId, { resolve, reject });
8911
8913
  try {
8912
8914
  this.sendWorkerMessage({
8913
8915
  type: "PRELOAD_PARSER",
@@ -8939,8 +8941,8 @@ class TreeSitterClient extends EventEmitter2 {
8939
8941
  }
8940
8942
  this.buffers.set(id, { id, content, filetype, version, hasParser: false });
8941
8943
  const messageId = `init_${this.messageIdCounter++}`;
8942
- const response = await new Promise((resolve3, reject) => {
8943
- this.messageCallbacks.set(messageId, { resolve: resolve3, reject });
8944
+ const response = await new Promise((resolve, reject) => {
8945
+ this.messageCallbacks.set(messageId, { resolve, reject });
8944
8946
  try {
8945
8947
  this.sendWorkerMessage({
8946
8948
  type: "INITIALIZE_PARSER",
@@ -9001,9 +9003,9 @@ class TreeSitterClient extends EventEmitter2 {
9001
9003
  this.editQueues.delete(bufferId);
9002
9004
  }
9003
9005
  if (this.worker) {
9004
- await new Promise((resolve3, reject) => {
9006
+ await new Promise((resolve, reject) => {
9005
9007
  const messageId = `dispose_${bufferId}`;
9006
- this.messageCallbacks.set(messageId, { resolve: resolve3, reject });
9008
+ this.messageCallbacks.set(messageId, { resolve, reject });
9007
9009
  try {
9008
9010
  this.sendWorkerMessage({
9009
9011
  type: "DISPOSE_BUFFER",
@@ -9012,13 +9014,13 @@ class TreeSitterClient extends EventEmitter2 {
9012
9014
  } catch (error) {
9013
9015
  console.error("Error disposing buffer", error);
9014
9016
  this.messageCallbacks.delete(messageId);
9015
- resolve3(false);
9017
+ resolve(false);
9016
9018
  }
9017
9019
  setTimeout(() => {
9018
9020
  if (this.messageCallbacks.has(messageId)) {
9019
9021
  this.messageCallbacks.delete(messageId);
9020
9022
  console.warn({ bufferId }, "Timed out waiting for buffer to be disposed");
9021
- resolve3(false);
9023
+ resolve(false);
9022
9024
  }
9023
9025
  }, 3000);
9024
9026
  });
@@ -9031,8 +9033,8 @@ class TreeSitterClient extends EventEmitter2 {
9031
9033
  }
9032
9034
  let resolveDestroy;
9033
9035
  let rejectDestroy;
9034
- const destroyPromise = new Promise((resolve3, reject) => {
9035
- resolveDestroy = resolve3;
9036
+ const destroyPromise = new Promise((resolve, reject) => {
9037
+ resolveDestroy = resolve;
9036
9038
  rejectDestroy = reject;
9037
9039
  });
9038
9040
  this.destroyPromise = destroyPromise;
@@ -9097,13 +9099,13 @@ class TreeSitterClient extends EventEmitter2 {
9097
9099
  this.options.dataPath = dataPath;
9098
9100
  if (this.initialized && this.worker) {
9099
9101
  const messageId = `update_datapath_${this.messageIdCounter++}`;
9100
- return new Promise((resolve3, reject) => {
9102
+ return new Promise((resolve, reject) => {
9101
9103
  this.messageCallbacks.set(messageId, {
9102
9104
  resolve: (response) => {
9103
9105
  if (response.error) {
9104
9106
  reject(new Error(response.error));
9105
9107
  } else {
9106
- resolve3();
9108
+ resolve();
9107
9109
  }
9108
9110
  },
9109
9111
  reject
@@ -9126,13 +9128,13 @@ class TreeSitterClient extends EventEmitter2 {
9126
9128
  throw new Error("Cannot clear cache: client is not initialized");
9127
9129
  }
9128
9130
  const messageId = `clear_cache_${this.messageIdCounter++}`;
9129
- return new Promise((resolve3, reject) => {
9131
+ return new Promise((resolve, reject) => {
9130
9132
  this.messageCallbacks.set(messageId, {
9131
9133
  resolve: (response) => {
9132
9134
  if (response.error) {
9133
9135
  reject(new Error(response.error));
9134
9136
  } else {
9135
- resolve3();
9137
+ resolve();
9136
9138
  }
9137
9139
  },
9138
9140
  reject
@@ -9204,20 +9206,20 @@ function isValidDirectoryName(name) {
9204
9206
  }
9205
9207
 
9206
9208
  // src/lib/data-paths.ts
9207
- registerEnvVar({
9209
+ registerEnvVar2({
9208
9210
  name: "XDG_CONFIG_HOME",
9209
9211
  description: "Base directory for user-specific configuration files",
9210
9212
  type: "string",
9211
9213
  default: ""
9212
9214
  });
9213
- registerEnvVar({
9215
+ registerEnvVar2({
9214
9216
  name: "XDG_DATA_HOME",
9215
9217
  description: "Base directory for user-specific data files",
9216
9218
  type: "string",
9217
9219
  default: ""
9218
9220
  });
9219
9221
 
9220
- class DataPathsManager extends EventEmitter3 {
9222
+ class DataPathsManager2 extends EventEmitter3 {
9221
9223
  _appName;
9222
9224
  _globalConfigPath;
9223
9225
  _globalConfigFile;
@@ -9246,7 +9248,7 @@ class DataPathsManager extends EventEmitter3 {
9246
9248
  get globalConfigPath() {
9247
9249
  if (this._globalConfigPath === undefined) {
9248
9250
  const homeDir = os.homedir();
9249
- const xdgConfigHome = env.XDG_CONFIG_HOME;
9251
+ const xdgConfigHome = env2.XDG_CONFIG_HOME;
9250
9252
  const baseConfigDir = xdgConfigHome || path.join(homeDir, ".config");
9251
9253
  this._globalConfigPath = path.join(baseConfigDir, this._appName);
9252
9254
  }
@@ -9267,7 +9269,7 @@ class DataPathsManager extends EventEmitter3 {
9267
9269
  get globalDataPath() {
9268
9270
  if (this._globalDataPath === undefined) {
9269
9271
  const homeDir = os.homedir();
9270
- const xdgDataHome = env.XDG_DATA_HOME;
9272
+ const xdgDataHome = env2.XDG_DATA_HOME;
9271
9273
  const baseDataDir = xdgDataHome || path.join(homeDir, ".local/share");
9272
9274
  this._globalDataPath = path.join(baseDataDir, this._appName);
9273
9275
  }
@@ -9282,12 +9284,12 @@ class DataPathsManager extends EventEmitter3 {
9282
9284
  };
9283
9285
  }
9284
9286
  }
9285
- function getDataPaths() {
9286
- return singleton("data-paths-opentui", () => new DataPathsManager);
9287
+ function getDataPaths2() {
9288
+ return singleton("data-paths-opentui", () => new DataPathsManager2);
9287
9289
  }
9288
9290
  // src/lib/tree-sitter/resolve-ft.ts
9289
9291
  import path2 from "path";
9290
- var extensionToFiletype = new Map([
9292
+ var extensionToFiletype2 = new Map([
9291
9293
  ["astro", "astro"],
9292
9294
  ["bash", "bash"],
9293
9295
  ["c", "c"],
@@ -9385,7 +9387,7 @@ var extensionToFiletype = new Map([
9385
9387
  ["java", "java"],
9386
9388
  ["css", "css"]
9387
9389
  ]);
9388
- var basenameToFiletype = new Map([
9390
+ var basenameToFiletype2 = new Map([
9389
9391
  [".bash_aliases", "bash"],
9390
9392
  [".bash_logout", "bash"],
9391
9393
  [".bash_profile", "bash"],
@@ -9423,43 +9425,43 @@ function getBasename(value) {
9423
9425
  const normalizedValue = value.trim().replaceAll("\\", "/");
9424
9426
  if (!normalizedValue)
9425
9427
  return;
9426
- const basename2 = path2.posix.basename(normalizedValue).toLowerCase();
9427
- return basename2 || undefined;
9428
+ const basename = path2.posix.basename(normalizedValue).toLowerCase();
9429
+ return basename || undefined;
9428
9430
  }
9429
- function extToFiletype(extension) {
9431
+ function extToFiletype2(extension) {
9430
9432
  const normalizedExtension = normalizeFiletypeToken(extension);
9431
9433
  if (!normalizedExtension)
9432
9434
  return;
9433
- return extensionToFiletype.get(normalizedExtension);
9435
+ return extensionToFiletype2.get(normalizedExtension);
9434
9436
  }
9435
- function pathToFiletype(path3) {
9436
- if (typeof path3 !== "string")
9437
+ function pathToFiletype2(path) {
9438
+ if (typeof path !== "string")
9437
9439
  return;
9438
- const basename2 = getBasename(path3);
9439
- if (!basename2)
9440
+ const basename = getBasename(path);
9441
+ if (!basename)
9440
9442
  return;
9441
- const basenameFiletype = basenameToFiletype.get(basename2);
9443
+ const basenameFiletype = basenameToFiletype2.get(basename);
9442
9444
  if (basenameFiletype) {
9443
9445
  return basenameFiletype;
9444
9446
  }
9445
- const lastDot = basename2.lastIndexOf(".");
9446
- if (lastDot === -1 || lastDot === basename2.length - 1) {
9447
+ const lastDot = basename.lastIndexOf(".");
9448
+ if (lastDot === -1 || lastDot === basename.length - 1) {
9447
9449
  return;
9448
9450
  }
9449
- const extension = basename2.substring(lastDot + 1);
9450
- return extToFiletype(extension);
9451
+ const extension = basename.substring(lastDot + 1);
9452
+ return extToFiletype2(extension);
9451
9453
  }
9452
- function infoStringToFiletype(infoString) {
9454
+ function infoStringToFiletype2(infoString) {
9453
9455
  if (typeof infoString !== "string")
9454
9456
  return;
9455
9457
  const token = infoString.trim().split(/\s+/, 1)[0];
9456
- const directBasenameMatch = basenameToFiletype.get(token.toLowerCase());
9458
+ const directBasenameMatch = basenameToFiletype2.get(token.toLowerCase());
9457
9459
  if (directBasenameMatch)
9458
9460
  return directBasenameMatch;
9459
9461
  const normalizedToken = normalizeFiletypeToken(token);
9460
9462
  if (!normalizedToken)
9461
9463
  return;
9462
- return basenameToFiletype.get(normalizedToken) ?? pathToFiletype(normalizedToken) ?? extToFiletype(normalizedToken) ?? normalizedToken;
9464
+ return basenameToFiletype2.get(normalizedToken) ?? pathToFiletype2(normalizedToken) ?? extToFiletype2(normalizedToken) ?? normalizedToken;
9463
9465
  }
9464
9466
 
9465
9467
  // src/lib/tree-sitter/index.ts
@@ -9468,17 +9470,17 @@ var TREE_SITTER_CLIENT_LISTENER_STATE_KEY = "tree-sitter-client-listener-state";
9468
9470
  function getTreeSitterClientListenerState() {
9469
9471
  return singleton(TREE_SITTER_CLIENT_LISTENER_STATE_KEY, () => ({}));
9470
9472
  }
9471
- function getTreeSitterClient() {
9473
+ function getTreeSitterClient2() {
9472
9474
  const existingClient = getSingleton(TREE_SITTER_CLIENT_KEY);
9473
9475
  if (existingClient) {
9474
9476
  return existingClient;
9475
9477
  }
9476
- const dataPathsManager = getDataPaths();
9478
+ const dataPathsManager = getDataPaths2();
9477
9479
  const defaultOptions = {
9478
9480
  dataPath: dataPathsManager.globalDataPath
9479
9481
  };
9480
9482
  return singleton(TREE_SITTER_CLIENT_KEY, () => {
9481
- const client2 = new TreeSitterClient(defaultOptions);
9483
+ const client2 = new TreeSitterClient2(defaultOptions);
9482
9484
  const listenerState = getTreeSitterClientListenerState();
9483
9485
  const handlePathsChanged = (paths) => {
9484
9486
  client2.setDataPath(paths.globalDataPath).catch((error) => {
@@ -9500,7 +9502,7 @@ function getTreeSitterClient() {
9500
9502
  return client2;
9501
9503
  });
9502
9504
  }
9503
- async function destroyTreeSitterClient() {
9505
+ async function destroyTreeSitterClient2() {
9504
9506
  const client2 = getSingleton(TREE_SITTER_CLIENT_KEY);
9505
9507
  if (!client2) {
9506
9508
  const listenerState = getSingleton(TREE_SITTER_CLIENT_LISTENER_STATE_KEY);
@@ -9554,7 +9556,7 @@ class ExtmarksHistory {
9554
9556
  }
9555
9557
 
9556
9558
  // src/lib/extmarks.ts
9557
- class ExtmarksController {
9559
+ class ExtmarksController2 {
9558
9560
  editBuffer;
9559
9561
  editorView;
9560
9562
  extmarks = new Map;
@@ -9761,11 +9763,11 @@ class ExtmarksController {
9761
9763
  if (virtualExtmark && currentOffset === virtualExtmark.end) {
9762
9764
  const startCursor = this.offsetToPosition(virtualExtmark.start);
9763
9765
  const endCursor = this.offsetToPosition(virtualExtmark.end);
9764
- const deleteOffset2 = virtualExtmark.start;
9765
- const deleteLength2 = virtualExtmark.end - virtualExtmark.start;
9766
+ const deleteOffset = virtualExtmark.start;
9767
+ const deleteLength = virtualExtmark.end - virtualExtmark.start;
9766
9768
  this.deleteExtmarkById(virtualExtmark.id);
9767
9769
  this.originalDeleteRange(startCursor.row, startCursor.col, endCursor.row, endCursor.col);
9768
- this.adjustExtmarksAfterDeletion(deleteOffset2, deleteLength2);
9770
+ this.adjustExtmarksAfterDeletion(deleteOffset, deleteLength);
9769
9771
  this.updateHighlights();
9770
9772
  return;
9771
9773
  }
@@ -9794,10 +9796,10 @@ class ExtmarksController {
9794
9796
  const startCursor = this.offsetToPosition(virtualExtmark.start);
9795
9797
  const endCursor = this.offsetToPosition(virtualExtmark.end);
9796
9798
  const deleteOffset = virtualExtmark.start;
9797
- const deleteLength2 = virtualExtmark.end - virtualExtmark.start;
9799
+ const deleteLength = virtualExtmark.end - virtualExtmark.start;
9798
9800
  this.deleteExtmarkById(virtualExtmark.id);
9799
9801
  this.originalDeleteRange(startCursor.row, startCursor.col, endCursor.row, endCursor.col);
9800
- this.adjustExtmarksAfterDeletion(deleteOffset, deleteLength2);
9802
+ this.adjustExtmarksAfterDeletion(deleteOffset, deleteLength);
9801
9803
  this.updateHighlights();
9802
9804
  return;
9803
9805
  }
@@ -10043,13 +10045,13 @@ class ExtmarksController {
10043
10045
  j++;
10044
10046
  }
10045
10047
  const chunk = text.substring(i, j);
10046
- const chunkWidth = stringWidth2(chunk);
10048
+ const chunkWidth = stringWidth(chunk);
10047
10049
  if (displayWidthSoFar + chunkWidth < offset) {
10048
10050
  displayWidthSoFar += chunkWidth;
10049
10051
  i = j;
10050
10052
  } else {
10051
10053
  for (let k = i;k < j && displayWidthSoFar < offset; k++) {
10052
- const charWidth = stringWidth2(text[k]);
10054
+ const charWidth = stringWidth(text[k]);
10053
10055
  displayWidthSoFar += charWidth;
10054
10056
  }
10055
10057
  break;
@@ -10232,12 +10234,12 @@ class ExtmarksController {
10232
10234
  this.destroyed = true;
10233
10235
  }
10234
10236
  }
10235
- function createExtmarksController(editBuffer, editorView) {
10236
- return new ExtmarksController(editBuffer, editorView);
10237
+ function createExtmarksController2(editBuffer, editorView) {
10238
+ return new ExtmarksController2(editBuffer, editorView);
10237
10239
  }
10238
10240
  // src/lib/terminal-palette.ts
10239
- var SYSTEM_CLOCK2 = new SystemClock;
10240
- registerEnvVar({
10241
+ var SYSTEM_CLOCK2 = new SystemClock2;
10242
+ registerEnvVar2({
10241
10243
  name: "OTUI_PALETTE_IDLE_TIMEOUT_MS",
10242
10244
  description: "Milliseconds of silence after palette queries before using fallback colors.",
10243
10245
  type: "number",
@@ -10262,7 +10264,7 @@ function wrapForTmux(osc) {
10262
10264
  return `\x1BPtmux;${escaped}\x1B\\`;
10263
10265
  }
10264
10266
 
10265
- class TerminalPalette {
10267
+ class TerminalPalette2 {
10266
10268
  stdin;
10267
10269
  stdout;
10268
10270
  writeFn;
@@ -10355,7 +10357,7 @@ class TerminalPalette {
10355
10357
  const out = this.stdout;
10356
10358
  if (!out.isTTY || !this.stdin.isTTY)
10357
10359
  return false;
10358
- return new Promise((resolve3) => {
10360
+ return new Promise((resolve) => {
10359
10361
  const session = this.createQuerySession();
10360
10362
  let buffer = "";
10361
10363
  let settled = false;
@@ -10364,7 +10366,7 @@ class TerminalPalette {
10364
10366
  return;
10365
10367
  settled = true;
10366
10368
  session.cleanup();
10367
- resolve3(supported);
10369
+ resolve(supported);
10368
10370
  };
10369
10371
  const onData = (chunk) => {
10370
10372
  buffer += chunk.toString();
@@ -10380,14 +10382,14 @@ class TerminalPalette {
10380
10382
  this.writeOsc("\x1B]4;0;?\x07", true);
10381
10383
  });
10382
10384
  }
10383
- async queryPalette(indices, timeoutMs = 1200, idleTimeoutMs = env.OTUI_PALETTE_IDLE_TIMEOUT_MS) {
10385
+ async queryPalette(indices, timeoutMs = 1200, idleTimeoutMs = env2.OTUI_PALETTE_IDLE_TIMEOUT_MS) {
10384
10386
  const out = this.stdout;
10385
10387
  const results = new Map;
10386
10388
  indices.forEach((i) => results.set(i, null));
10387
10389
  if (!out.isTTY || !this.stdin.isTTY) {
10388
10390
  return results;
10389
10391
  }
10390
- return new Promise((resolve3) => {
10392
+ return new Promise((resolve) => {
10391
10393
  const session = this.createQuerySession();
10392
10394
  let buffer = "";
10393
10395
  let idleTimer = null;
@@ -10397,7 +10399,7 @@ class TerminalPalette {
10397
10399
  return;
10398
10400
  settled = true;
10399
10401
  session.cleanup();
10400
- resolve3(results);
10402
+ resolve(results);
10401
10403
  };
10402
10404
  const onData = (chunk) => {
10403
10405
  buffer += chunk.toString();
@@ -10423,7 +10425,7 @@ class TerminalPalette {
10423
10425
  idleTimer = session.resetTimer(idleTimer, finish, idleTimeoutMs);
10424
10426
  });
10425
10427
  }
10426
- async querySpecialColors(timeoutMs = 1200, idleTimeoutMs = env.OTUI_PALETTE_IDLE_TIMEOUT_MS) {
10428
+ async querySpecialColors(timeoutMs = 1200, idleTimeoutMs = env2.OTUI_PALETTE_IDLE_TIMEOUT_MS) {
10427
10429
  const out = this.stdout;
10428
10430
  const results = {
10429
10431
  10: null,
@@ -10440,7 +10442,7 @@ class TerminalPalette {
10440
10442
  if (!out.isTTY || !this.stdin.isTTY) {
10441
10443
  return results;
10442
10444
  }
10443
- return new Promise((resolve3) => {
10445
+ return new Promise((resolve) => {
10444
10446
  const session = this.createQuerySession();
10445
10447
  let buffer = "";
10446
10448
  let idleTimer = null;
@@ -10450,7 +10452,7 @@ class TerminalPalette {
10450
10452
  return;
10451
10453
  settled = true;
10452
10454
  session.cleanup();
10453
- resolve3(results);
10455
+ resolve(results);
10454
10456
  };
10455
10457
  const onData = (chunk) => {
10456
10458
  buffer += chunk.toString();
@@ -10498,7 +10500,7 @@ class TerminalPalette {
10498
10500
  };
10499
10501
  }
10500
10502
  const indicesToQuery = [...Array(size).keys()];
10501
- const idleTimeout = env.OTUI_PALETTE_IDLE_TIMEOUT_MS;
10503
+ const idleTimeout = env2.OTUI_PALETTE_IDLE_TIMEOUT_MS;
10502
10504
  const [paletteResults, specialColors] = await Promise.all([
10503
10505
  this.queryPalette(indicesToQuery, timeout, idleTimeout),
10504
10506
  this.querySpecialColors(timeout, idleTimeout)
@@ -10517,34 +10519,34 @@ class TerminalPalette {
10517
10519
  };
10518
10520
  }
10519
10521
  }
10520
- function createTerminalPalette(options) {
10521
- return new TerminalPalette(options);
10522
+ function createTerminalPalette2(options) {
10523
+ return new TerminalPalette2(options);
10522
10524
  }
10523
- var DEFAULT_FOREGROUND_FALLBACK = RGBA.fromInts(...DEFAULT_FOREGROUND_RGB);
10524
- var DEFAULT_BACKGROUND_FALLBACK = RGBA.fromInts(...DEFAULT_BACKGROUND_RGB);
10525
+ var DEFAULT_FOREGROUND_FALLBACK = RGBA2.fromInts(...DEFAULT_FOREGROUND_RGB2);
10526
+ var DEFAULT_BACKGROUND_FALLBACK = RGBA2.fromInts(...DEFAULT_BACKGROUND_RGB2);
10525
10527
  var fallbackAnsi256Palette = null;
10526
10528
  function getFallbackAnsi256Palette() {
10527
10529
  if (!fallbackAnsi256Palette) {
10528
10530
  fallbackAnsi256Palette = Array.from({ length: 256 }, (_, index) => {
10529
- const [r, g, b] = ansi256IndexToRgb(index);
10530
- return RGBA.fromInts(r, g, b);
10531
+ const [r, g, b] = ansi256IndexToRgb2(index);
10532
+ return RGBA2.fromInts(r, g, b);
10531
10533
  });
10532
10534
  }
10533
10535
  return fallbackAnsi256Palette;
10534
10536
  }
10535
- function normalizeTerminalPalette(colors) {
10537
+ function normalizeTerminalPalette2(colors) {
10536
10538
  const fallbackPalette = getFallbackAnsi256Palette();
10537
10539
  return {
10538
10540
  palette: Array.from({ length: 256 }, (_, index) => {
10539
10541
  const detected = colors?.palette[index];
10540
- return detected ? RGBA.fromHex(detected) : RGBA.clone(fallbackPalette[index]);
10542
+ return detected ? RGBA2.fromHex(detected) : RGBA2.clone(fallbackPalette[index]);
10541
10543
  }),
10542
- defaultForeground: colors?.defaultForeground ? RGBA.fromHex(colors.defaultForeground) : RGBA.clone(DEFAULT_FOREGROUND_FALLBACK),
10543
- defaultBackground: colors?.defaultBackground ? RGBA.fromHex(colors.defaultBackground) : RGBA.clone(DEFAULT_BACKGROUND_FALLBACK)
10544
+ defaultForeground: colors?.defaultForeground ? RGBA2.fromHex(colors.defaultForeground) : RGBA2.clone(DEFAULT_FOREGROUND_FALLBACK),
10545
+ defaultBackground: colors?.defaultBackground ? RGBA2.fromHex(colors.defaultBackground) : RGBA2.clone(DEFAULT_BACKGROUND_FALLBACK)
10544
10546
  };
10545
10547
  }
10546
- function buildTerminalPaletteSignature(colors) {
10547
- const normalized = normalizeTerminalPalette(colors);
10548
+ function buildTerminalPaletteSignature2(colors) {
10549
+ const normalized = normalizeTerminalPalette2(colors);
10548
10550
  const paletteSignature = normalized.palette.map((color) => color.toInts().join(",")).join(";");
10549
10551
  return [
10550
10552
  paletteSignature,
@@ -10554,10 +10556,10 @@ function buildTerminalPaletteSignature(colors) {
10554
10556
  }
10555
10557
  // src/lib/paste.ts
10556
10558
  var PASTE_TEXT_DECODER = new TextDecoder;
10557
- function decodePasteBytes(bytes) {
10559
+ function decodePasteBytes2(bytes) {
10558
10560
  return PASTE_TEXT_DECODER.decode(bytes);
10559
10561
  }
10560
- function stripAnsiSequences(text) {
10562
+ function stripAnsiSequences2(text) {
10561
10563
  return stripANSI(text);
10562
10564
  }
10563
10565
  // src/lib/host-clipboard.internal.ts
@@ -10656,8 +10658,8 @@ var validateClipboardText = (text, maxWriteBytes) => {
10656
10658
  var createActiveOperation = (callerSignal) => {
10657
10659
  const controller = new AbortController;
10658
10660
  let settle = () => {};
10659
- const settled = new Promise((resolve3) => {
10660
- settle = resolve3;
10661
+ const settled = new Promise((resolve) => {
10662
+ settle = resolve;
10661
10663
  });
10662
10664
  if (callerSignal) {
10663
10665
  callerSignal.addEventListener("abort", () => controller.abort(callerSignal.reason), {
@@ -10684,7 +10686,7 @@ var runTrackedOperation = (active, callerSignal, operation) => {
10684
10686
  };
10685
10687
  var createHostClipboardWithBackend = (options, createBackend) => {
10686
10688
  const config = normalizeOptions(options);
10687
- const backend2 = createBackend(config);
10689
+ const backend = createBackend(config);
10688
10690
  const active = new Set;
10689
10691
  let disposed = false;
10690
10692
  let disposePromise;
@@ -10704,7 +10706,7 @@ var createHostClipboardWithBackend = (options, createBackend) => {
10704
10706
  if (config.timeoutMs === 0)
10705
10707
  return Promise.resolve({ status: "timed-out" });
10706
10708
  return runTrackedOperation(active, readOptions.signal, async (signal) => {
10707
- const result = await backend2.read({
10709
+ const result = await backend.read({
10708
10710
  preferredTypes,
10709
10711
  selection,
10710
10712
  maxBytes: config.maxReadBytes,
@@ -10730,7 +10732,7 @@ var createHostClipboardWithBackend = (options, createBackend) => {
10730
10732
  return Promise.resolve({ status: "cancelled" });
10731
10733
  if (config.timeoutMs === 0)
10732
10734
  return Promise.resolve({ status: "timed-out" });
10733
- return runTrackedOperation(active, operationOptions.signal, (signal) => backend2.writeText(text, { selection, timeoutMs: config.timeoutMs, signal }));
10735
+ return runTrackedOperation(active, operationOptions.signal, (signal) => backend.writeText(text, { selection, timeoutMs: config.timeoutMs, signal }));
10734
10736
  } catch (error) {
10735
10737
  return Promise.reject(error);
10736
10738
  }
@@ -10743,7 +10745,7 @@ var createHostClipboardWithBackend = (options, createBackend) => {
10743
10745
  return Promise.resolve({ status: "cancelled" });
10744
10746
  if (config.timeoutMs === 0)
10745
10747
  return Promise.resolve({ status: "timed-out" });
10746
- return runTrackedOperation(active, operationOptions.signal, (signal) => backend2.clear({ selection, timeoutMs: config.timeoutMs, signal }));
10748
+ return runTrackedOperation(active, operationOptions.signal, (signal) => backend.clear({ selection, timeoutMs: config.timeoutMs, signal }));
10747
10749
  } catch (error) {
10748
10750
  return Promise.reject(error);
10749
10751
  }
@@ -10756,7 +10758,7 @@ var createHostClipboardWithBackend = (options, createBackend) => {
10756
10758
  operation.controller.abort();
10757
10759
  disposePromise = (async () => {
10758
10760
  await Promise.all([...active].map((operation) => operation.settled));
10759
- await backend2.dispose();
10761
+ await backend.dispose();
10760
10762
  })();
10761
10763
  return disposePromise;
10762
10764
  }
@@ -10787,7 +10789,7 @@ var encodeReadRequest = (preferredTypes) => {
10787
10789
  };
10788
10790
  var startFailure = (status) => ({
10789
10791
  status: "failed",
10790
- error: new Error(`Native clipboard operation failed to start (${NativeClipboardStartStatus[status]})`)
10792
+ error: new Error(`Native clipboard operation failed to start (${NativeClipboardStartStatus2[status]})`)
10791
10793
  });
10792
10794
 
10793
10795
  class NativeClipboardBackend {
@@ -10804,7 +10806,7 @@ class NativeClipboardBackend {
10804
10806
  constructor(maxImagePixels, maxConversionBytes, maxConcurrentOperations, maxProviderTransfers, waylandSeat) {
10805
10807
  this.maxImagePixels = maxImagePixels;
10806
10808
  this.maxConversionBytes = maxConversionBytes;
10807
- this.library = resolveRenderLib();
10809
+ this.library = resolveRenderLib2();
10808
10810
  const service = this.library.clipboardServiceCreate(maxConcurrentOperations, maxProviderTransfers, waylandSeat);
10809
10811
  if (!service)
10810
10812
  throw new Error("Failed to create native clipboard service");
@@ -10836,8 +10838,8 @@ class NativeClipboardBackend {
10836
10838
  if (started.status !== 0 /* Ok */ || !started.operation) {
10837
10839
  return Promise.resolve(startFailure(started.status));
10838
10840
  }
10839
- return new Promise((resolve3, reject) => {
10840
- const operation = { handle: started.operation, kind, signal, resolve: resolve3, reject };
10841
+ return new Promise((resolve, reject) => {
10842
+ const operation = { handle: started.operation, kind, signal, resolve, reject };
10841
10843
  this.pending.set(operation.handle, operation);
10842
10844
  signal.addEventListener("abort", () => this.requestCancel(operation), { once: true });
10843
10845
  this.ensureScheduled();
@@ -10910,14 +10912,14 @@ class NativeClipboardBackend {
10910
10912
  try {
10911
10913
  this.library.clipboardOperationCancel(operation.handle);
10912
10914
  } catch {}
10913
- const status2 = this.library.clipboardOperationPoll(operation.handle);
10914
- if (status2 === 0 /* Pending */) {
10915
+ const status = this.library.clipboardOperationPoll(operation.handle);
10916
+ if (status === 0 /* Pending */) {
10915
10917
  this.rotate(operation);
10916
10918
  continue;
10917
10919
  }
10918
10920
  this.providerActive = true;
10919
- const destroyed2 = this.library.clipboardOperationDestroy(operation.handle);
10920
- if (destroyed2 === 1 /* NotReady */) {
10921
+ const destroyed = this.library.clipboardOperationDestroy(operation.handle);
10922
+ if (destroyed === 1 /* NotReady */) {
10921
10923
  this.rotate(operation);
10922
10924
  continue;
10923
10925
  }
@@ -10982,7 +10984,7 @@ class NativeClipboardBackend {
10982
10984
  invalidResult(kind, status) {
10983
10985
  return {
10984
10986
  status: "failed",
10985
- error: new Error(`Native clipboard ${kind} returned inapplicable status ${NativeClipboardOperationStatus[status]}`)
10987
+ error: new Error(`Native clipboard ${kind} returned inapplicable status ${NativeClipboardOperationStatus2[status]}`)
10986
10988
  };
10987
10989
  }
10988
10990
  readRepresentation(handle) {
@@ -11014,7 +11016,7 @@ class NativeClipboardBackend {
11014
11016
  this.clearPollTimer();
11015
11017
  let status = this.library.clipboardServiceBeginShutdown(this.service);
11016
11018
  while (status === 0 /* Pending */) {
11017
- await new Promise((resolve3) => setTimeout(resolve3, SHUTDOWN_POLL_INTERVAL_MS));
11019
+ await new Promise((resolve) => setTimeout(resolve, SHUTDOWN_POLL_INTERVAL_MS));
11018
11020
  status = this.library.clipboardServicePollShutdown(this.service);
11019
11021
  }
11020
11022
  if (status !== 1 /* Ready */)
@@ -11038,13 +11040,13 @@ var validateSelection = (selection) => {
11038
11040
  }
11039
11041
  return normalized;
11040
11042
  };
11041
- var createHostClipboard = (options = {}) => createHostClipboardWithBackend(options, createNativeHostClipboardBackend);
11043
+ var createHostClipboard2 = (options = {}) => createHostClipboardWithBackend(options, createNativeHostClipboardBackend);
11042
11044
  var validateDestination = (destination) => {
11043
11045
  if (destination !== "terminal-only" && destination !== "host-only" && destination !== "best-available" && destination !== "all-available") {
11044
11046
  throw new TypeError("destination is not a supported clipboard policy");
11045
11047
  }
11046
11048
  };
11047
- var createClipboard = ({ host, terminal }) => {
11049
+ var createClipboard2 = ({ host, terminal }) => {
11048
11050
  const active = new Set;
11049
11051
  let disposed = false;
11050
11052
  let disposePromise;
@@ -11066,8 +11068,8 @@ var createClipboard = ({ host, terminal }) => {
11066
11068
  return { host: { status: "not-attempted" }, terminal: terminalOperation() };
11067
11069
  }
11068
11070
  const hostResult = await hostOperation();
11069
- const terminalResult2 = !signal.aborted && (hostResult.status === "unsupported" || hostResult.status === "failed") ? terminalOperation() : NOT_ATTEMPTED_TERMINAL;
11070
- return { host: hostResult, terminal: terminalResult2 };
11071
+ const terminalResult = !signal.aborted && (hostResult.status === "unsupported" || hostResult.status === "failed") ? terminalOperation() : NOT_ATTEMPTED_TERMINAL;
11072
+ return { host: hostResult, terminal: terminalResult };
11071
11073
  }
11072
11074
  const hostPromise = canUseRemoteHost(options) ? hostOperation() : Promise.resolve({ status: "not-attempted" });
11073
11075
  const terminalResult = terminalOperation();
@@ -11129,14 +11131,14 @@ var createClipboard = ({ host, terminal }) => {
11129
11131
  }
11130
11132
  };
11131
11133
  };
11132
- var ClipboardTarget;
11133
- ((ClipboardTarget2) => {
11134
- ClipboardTarget2[ClipboardTarget2["Clipboard"] = 0] = "Clipboard";
11135
- ClipboardTarget2[ClipboardTarget2["Primary"] = 1] = "Primary";
11136
- ClipboardTarget2[ClipboardTarget2["Select"] = 2] = "Select";
11137
- ClipboardTarget2[ClipboardTarget2["Secondary"] = 3] = "Secondary";
11138
- })(ClipboardTarget ||= {});
11139
- var createRendererClipboardAdapter = (renderer) => {
11134
+ var ClipboardTarget2;
11135
+ ((ClipboardTarget) => {
11136
+ ClipboardTarget[ClipboardTarget["Clipboard"] = 0] = "Clipboard";
11137
+ ClipboardTarget[ClipboardTarget["Primary"] = 1] = "Primary";
11138
+ ClipboardTarget[ClipboardTarget["Select"] = 2] = "Select";
11139
+ ClipboardTarget[ClipboardTarget["Secondary"] = 3] = "Secondary";
11140
+ })(ClipboardTarget2 ||= {});
11141
+ var createRendererClipboardAdapter2 = (renderer) => {
11140
11142
  const targetFor = (selection) => selection === "primary" ? 1 /* Primary */ : 0 /* Clipboard */;
11141
11143
  const capability = () => renderer.capabilities?.osc52_support ?? "unknown";
11142
11144
  return {
@@ -11164,7 +11166,7 @@ var createRendererClipboardAdapter = (renderer) => {
11164
11166
  };
11165
11167
  };
11166
11168
 
11167
- class Clipboard {
11169
+ class Clipboard2 {
11168
11170
  lib;
11169
11171
  rendererPtr;
11170
11172
  constructor(lib, rendererPtr) {
@@ -11191,44 +11193,163 @@ class Clipboard {
11191
11193
  }
11192
11194
  // src/lib/detect-links.ts
11193
11195
  var URL_SCOPES = ["markup.link.url", "string.special.url"];
11194
- function detectLinks(chunks, context) {
11196
+ var HTTP_URL_PREFIX = /https?:\/\//i;
11197
+ var BARE_URL = /https?:\/\/[^\s<>"`]+/gi;
11198
+ function normalizeMarkdownLinkTarget(destination) {
11199
+ return destination.replace(/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g, "$1");
11200
+ }
11201
+ function detectLinks2(chunks, context) {
11195
11202
  const content = context.content;
11196
11203
  const highlights = context.highlights;
11204
+ const hasBareUrl = HTTP_URL_PREFIX.test(content);
11205
+ if (!hasBareUrl && !highlights.some(([, , group]) => URL_SCOPES.includes(group)))
11206
+ return chunks;
11197
11207
  const ranges = [];
11208
+ const rawRanges = [];
11209
+ const labels = new Map;
11210
+ const concealedDelimiters = new Map;
11198
11211
  for (let i = 0;i < highlights.length; i++) {
11199
- const [start, end, group] = highlights[i];
11212
+ const [start, end, group, meta] = highlights[i];
11213
+ if (group === "conceal" && meta?.conceal === "" && /^[*_~]+$/.test(content.slice(start, end))) {
11214
+ concealedDelimiters.set(end, start);
11215
+ }
11216
+ if (group === "markup.raw" || group.startsWith("markup.raw.")) {
11217
+ rawRanges.push({ start, end });
11218
+ }
11219
+ if (group === "markup.link.label") {
11220
+ const existing = labels.get(end);
11221
+ if (!existing || start < existing.start)
11222
+ labels.set(end, { start, end });
11223
+ }
11200
11224
  if (!URL_SCOPES.includes(group))
11201
11225
  continue;
11202
11226
  const url = content.slice(start, end);
11227
+ if (!url)
11228
+ continue;
11203
11229
  ranges.push({ start, end, url });
11204
- for (let j = i - 1;j >= 0; j--) {
11205
- const [labelStart, labelEnd, prev] = highlights[j];
11206
- if (prev === "markup.link.label") {
11207
- ranges.push({ start: labelStart, end: labelEnd, url });
11208
- break;
11230
+ }
11231
+ const highlightedCount = ranges.length;
11232
+ for (let index = 0;index < highlightedCount; index++) {
11233
+ const range = ranges[index];
11234
+ let labelEnd = range.start;
11235
+ if (content[labelEnd - 1] === "<")
11236
+ labelEnd--;
11237
+ while (labelEnd > 0 && /\s/.test(content[labelEnd - 1]))
11238
+ labelEnd--;
11239
+ if (content[labelEnd - 1] !== "(" || content[labelEnd - 2] !== "]")
11240
+ continue;
11241
+ const label = labels.get(labelEnd - 2);
11242
+ if (!label)
11243
+ continue;
11244
+ range.url = normalizeMarkdownLinkTarget(range.url);
11245
+ ranges.push({ ...label, url: range.url, label: true });
11246
+ }
11247
+ if (hasBareUrl) {
11248
+ rawRanges.sort((a, b) => a.start - b.start || b.end - a.end);
11249
+ ranges.sort((a, b) => a.start - b.start || b.end - a.end);
11250
+ let rawIndex = 0;
11251
+ let highlightedIndex = 0;
11252
+ for (const match of content.matchAll(BARE_URL)) {
11253
+ const start = match.index;
11254
+ let url = match[0];
11255
+ let openParens = 0;
11256
+ let closeParens = 0;
11257
+ for (const character of url) {
11258
+ if (character === "(")
11259
+ openParens++;
11260
+ if (character === ")")
11261
+ closeParens++;
11209
11262
  }
11210
- if (!prev.startsWith("markup.link"))
11211
- break;
11263
+ while (url.length > 0) {
11264
+ const delimiterStart = concealedDelimiters.get(start + url.length);
11265
+ if (delimiterStart !== undefined && delimiterStart >= start) {
11266
+ url = url.slice(0, delimiterStart - start);
11267
+ continue;
11268
+ }
11269
+ const last = url[url.length - 1];
11270
+ if (last === ")" && closeParens > openParens) {
11271
+ closeParens--;
11272
+ } else if (!".,!?;:]}'".includes(last)) {
11273
+ break;
11274
+ }
11275
+ url = url.slice(0, -1);
11276
+ }
11277
+ const end = start + url.length;
11278
+ if (!url)
11279
+ continue;
11280
+ while (rawIndex < rawRanges.length && rawRanges[rawIndex].end <= start)
11281
+ rawIndex++;
11282
+ if (rawIndex < rawRanges.length && rawRanges[rawIndex].start < end)
11283
+ continue;
11284
+ while (highlightedIndex < ranges.length && ranges[highlightedIndex].end <= start)
11285
+ highlightedIndex++;
11286
+ if (highlightedIndex < ranges.length && ranges[highlightedIndex].start < end)
11287
+ continue;
11288
+ ranges.push({ start, end, url });
11212
11289
  }
11213
11290
  }
11214
11291
  if (ranges.length === 0)
11215
11292
  return chunks;
11293
+ ranges.sort((a, b) => a.start - b.start || b.end - a.end || Number(b.label ?? false) - Number(a.label ?? false));
11294
+ const linkedChunks = [];
11216
11295
  let contentPos = 0;
11217
- for (const chunk of chunks) {
11218
- if (chunk.text.length <= 1)
11296
+ let rangeIndex = 0;
11297
+ for (let index = 0;index < chunks.length; index++) {
11298
+ const chunk = chunks[index];
11299
+ if (!chunk.text || chunk.link) {
11300
+ linkedChunks.push(chunk);
11219
11301
  continue;
11220
- const idx = content.indexOf(chunk.text, contentPos);
11221
- if (idx < 0)
11302
+ }
11303
+ const providedRange = context.sourceRanges?.[index];
11304
+ const start = providedRange?.start ?? content.indexOf(chunk.text, contentPos);
11305
+ if (start < 0) {
11306
+ linkedChunks.push(chunk);
11222
11307
  continue;
11223
- for (const range of ranges) {
11224
- if (idx < range.end && idx + chunk.text.length > range.start) {
11308
+ }
11309
+ const end = providedRange?.end ?? start + chunk.text.length;
11310
+ contentPos = end;
11311
+ while (rangeIndex < ranges.length && ranges[rangeIndex].end <= start)
11312
+ rangeIndex++;
11313
+ if (content.slice(start, end) !== chunk.text) {
11314
+ const range = ranges[rangeIndex];
11315
+ if (range?.label && range.start < end)
11225
11316
  chunk.link = { url: range.url };
11317
+ linkedChunks.push(chunk);
11318
+ continue;
11319
+ }
11320
+ let position = start;
11321
+ for (;rangeIndex < ranges.length; rangeIndex++) {
11322
+ const range = ranges[rangeIndex];
11323
+ if (range.end <= position)
11324
+ continue;
11325
+ if (range.start >= end)
11226
11326
  break;
11327
+ const linkStart = Math.max(position, range.start);
11328
+ const linkEnd = Math.min(end, range.end);
11329
+ if (linkStart > position) {
11330
+ linkedChunks.push({ ...chunk, text: chunk.text.slice(position - start, linkStart - start) });
11227
11331
  }
11332
+ if (linkStart === start && linkEnd === end) {
11333
+ chunk.link = { url: range.url };
11334
+ linkedChunks.push(chunk);
11335
+ } else {
11336
+ linkedChunks.push({
11337
+ ...chunk,
11338
+ text: chunk.text.slice(linkStart - start, linkEnd - start),
11339
+ link: { url: range.url }
11340
+ });
11341
+ }
11342
+ position = linkEnd;
11343
+ if (position === end)
11344
+ break;
11345
+ }
11346
+ if (position === start) {
11347
+ linkedChunks.push(chunk);
11348
+ } else if (position < end) {
11349
+ linkedChunks.push({ ...chunk, text: chunk.text.slice(position - start) });
11228
11350
  }
11229
- contentPos = idx + chunk.text.length;
11230
11351
  }
11231
- return chunks;
11352
+ return linkedChunks;
11232
11353
  }
11233
11354
  // src/buffer.ts
11234
11355
  function requireInteger(value, name, min, max) {
@@ -11236,18 +11357,18 @@ function requireInteger(value, name, min, max) {
11236
11357
  throw new RangeError(`${name} must be an integer from ${min} to ${max}`);
11237
11358
  }
11238
11359
  }
11239
- function packDrawOptions(border2, shouldFill, titleAlignment, bottomTitleAlignment) {
11360
+ function packDrawOptions(border, shouldFill, titleAlignment, bottomTitleAlignment) {
11240
11361
  let packed = 0;
11241
- if (border2 === true) {
11362
+ if (border === true) {
11242
11363
  packed |= 15;
11243
- } else if (Array.isArray(border2)) {
11244
- if (border2.includes("top"))
11364
+ } else if (Array.isArray(border)) {
11365
+ if (border.includes("top"))
11245
11366
  packed |= 8;
11246
- if (border2.includes("right"))
11367
+ if (border.includes("right"))
11247
11368
  packed |= 4;
11248
- if (border2.includes("bottom"))
11369
+ if (border.includes("bottom"))
11249
11370
  packed |= 2;
11250
- if (border2.includes("left"))
11371
+ if (border.includes("left"))
11251
11372
  packed |= 1;
11252
11373
  }
11253
11374
  if (shouldFill) {
@@ -11265,7 +11386,7 @@ function packDrawOptions(border2, shouldFill, titleAlignment, bottomTitleAlignme
11265
11386
  return packed;
11266
11387
  }
11267
11388
 
11268
- class OptimizedBuffer {
11389
+ class OptimizedBuffer2 {
11269
11390
  static fbIdCounter = 0;
11270
11391
  id;
11271
11392
  lib;
@@ -11304,17 +11425,17 @@ class OptimizedBuffer {
11304
11425
  this.ensureRawBufferViews();
11305
11426
  return this._rawBuffers;
11306
11427
  }
11307
- constructor(lib, ptr2, width, height, options) {
11308
- this.id = options.id || `fb_${OptimizedBuffer.fbIdCounter++}`;
11428
+ constructor(lib, ptr, width, height, options) {
11429
+ this.id = options.id || `fb_${OptimizedBuffer2.fbIdCounter++}`;
11309
11430
  this.lib = lib;
11310
11431
  this.respectAlpha = options.respectAlpha || false;
11311
11432
  this._width = width;
11312
11433
  this._height = height;
11313
11434
  this._widthMethod = options.widthMethod || "unicode";
11314
- this.bufferPtr = ptr2;
11435
+ this.bufferPtr = ptr;
11315
11436
  }
11316
11437
  static create(width, height, widthMethod, options = {}) {
11317
- const lib = resolveRenderLib();
11438
+ const lib = resolveRenderLib2();
11318
11439
  const respectAlpha = options.respectAlpha || false;
11319
11440
  const id = options.id && options.id.trim() !== "" ? options.id : "unnamed buffer";
11320
11441
  const buffer = lib.createOptimizedBuffer(width, height, widthMethod, respectAlpha, id);
@@ -11347,7 +11468,7 @@ class OptimizedBuffer {
11347
11468
  }
11348
11469
  getSpanLines() {
11349
11470
  this.guard();
11350
- const { char, fg: fg2, bg: bg2, attributes } = this.buffers;
11471
+ const { char, fg, bg, attributes } = this.buffers;
11351
11472
  const lines = [];
11352
11473
  const CHAR_FLAG_CONTINUATION = 3221225472 | 0;
11353
11474
  const CHAR_FLAG_MASK = 3221225472 | 0;
@@ -11362,8 +11483,8 @@ class OptimizedBuffer {
11362
11483
  for (let x = 0;x < this._width; x++) {
11363
11484
  const i = y * this._width + x;
11364
11485
  const cp = char[i];
11365
- const cellFg = RGBA.fromArray(fg2.slice(i * 4, i * 4 + 4));
11366
- const cellBg = RGBA.fromArray(bg2.slice(i * 4, i * 4 + 4));
11486
+ const cellFg = RGBA2.fromArray(fg.slice(i * 4, i * 4 + 4));
11487
+ const cellBg = RGBA2.fromArray(bg.slice(i * 4, i * 4 + 4));
11367
11488
  const cellAttrs = attributes[i] & 255;
11368
11489
  const isContinuation = (cp & CHAR_FLAG_MASK) === CHAR_FLAG_CONTINUATION;
11369
11490
  const cellChar = isContinuation ? "" : lineChars[charIdx++] ?? " ";
@@ -11390,38 +11511,38 @@ class OptimizedBuffer {
11390
11511
  }
11391
11512
  return lines;
11392
11513
  }
11393
- clear(bg2 = RGBA.fromValues(0, 0, 0, 1)) {
11514
+ clear(bg = RGBA2.fromValues(0, 0, 0, 1)) {
11394
11515
  this.guard();
11395
- this.lib.bufferClear(this.bufferPtr, bg2);
11516
+ this.lib.bufferClear(this.bufferPtr, bg);
11396
11517
  }
11397
- setCell(x, y, char, fg2, bg2, attributes = 0) {
11518
+ setCell(x, y, char, fg, bg, attributes = 0) {
11398
11519
  this.guard();
11399
- this.lib.bufferSetCell(this.bufferPtr, x, y, char, fg2, bg2, attributes);
11520
+ this.lib.bufferSetCell(this.bufferPtr, x, y, char, fg, bg, attributes);
11400
11521
  }
11401
- setCellWithAlphaBlending(x, y, char, fg2, bg2, attributes = 0) {
11522
+ setCellWithAlphaBlending(x, y, char, fg, bg, attributes = 0) {
11402
11523
  this.guard();
11403
- this.lib.bufferSetCellWithAlphaBlending(this.bufferPtr, x, y, char, fg2, bg2, attributes);
11524
+ this.lib.bufferSetCellWithAlphaBlending(this.bufferPtr, x, y, char, fg, bg, attributes);
11404
11525
  }
11405
- drawText(text, x, y, fg2, bg2, attributes = 0, selection2) {
11526
+ drawText(text, x, y, fg, bg, attributes = 0, selection) {
11406
11527
  this.guard();
11407
- if (!selection2) {
11408
- this.lib.bufferDrawText(this.bufferPtr, text, x, y, fg2, bg2, attributes);
11528
+ if (!selection) {
11529
+ this.lib.bufferDrawText(this.bufferPtr, text, x, y, fg, bg, attributes);
11409
11530
  return;
11410
11531
  }
11411
- const { start, end } = selection2;
11532
+ const { start, end } = selection;
11412
11533
  let selectionBg;
11413
11534
  let selectionFg;
11414
- if (selection2.bgColor) {
11415
- selectionBg = selection2.bgColor;
11416
- selectionFg = selection2.fgColor || fg2;
11535
+ if (selection.bgColor) {
11536
+ selectionBg = selection.bgColor;
11537
+ selectionFg = selection.fgColor || fg;
11417
11538
  } else {
11418
- const defaultBg = bg2 || RGBA.fromValues(0, 0, 0, 0);
11419
- selectionFg = defaultBg.a > 0 ? defaultBg : RGBA.fromValues(0, 0, 0, 1);
11420
- selectionBg = fg2;
11539
+ const defaultBg = bg || RGBA2.fromValues(0, 0, 0, 0);
11540
+ selectionFg = defaultBg.a > 0 ? defaultBg : RGBA2.fromValues(0, 0, 0, 1);
11541
+ selectionBg = fg;
11421
11542
  }
11422
11543
  if (start > 0) {
11423
11544
  const beforeText = text.slice(0, start);
11424
- this.lib.bufferDrawText(this.bufferPtr, beforeText, x, y, fg2, bg2, attributes);
11545
+ this.lib.bufferDrawText(this.bufferPtr, beforeText, x, y, fg, bg, attributes);
11425
11546
  }
11426
11547
  if (end > start) {
11427
11548
  const selectedText = text.slice(start, end);
@@ -11429,12 +11550,12 @@ class OptimizedBuffer {
11429
11550
  }
11430
11551
  if (end < text.length) {
11431
11552
  const afterText = text.slice(end);
11432
- this.lib.bufferDrawText(this.bufferPtr, afterText, x + end, y, fg2, bg2, attributes);
11553
+ this.lib.bufferDrawText(this.bufferPtr, afterText, x + end, y, fg, bg, attributes);
11433
11554
  }
11434
11555
  }
11435
- fillRect(x, y, width, height, bg2) {
11556
+ fillRect(x, y, width, height, bg) {
11436
11557
  this.guard();
11437
- this.lib.bufferFillRect(this.bufferPtr, x, y, width, height, bg2);
11558
+ this.lib.bufferFillRect(this.bufferPtr, x, y, width, height, bg);
11438
11559
  }
11439
11560
  colorMatrix(matrix, cellMask, strength = 1, target = 3 /* Both */) {
11440
11561
  this.guard();
@@ -11495,13 +11616,13 @@ class OptimizedBuffer {
11495
11616
  this.guard();
11496
11617
  this.lib.bufferDrawPackedBuffer(this.bufferPtr, typeof data === "number" || typeof data === "bigint" ? toPointer(data) : data, dataLen, posX, posY, terminalWidthCells, terminalHeightCells);
11497
11618
  }
11498
- drawGrayscaleBuffer(posX, posY, intensities, srcWidth, srcHeight, fg2 = null, bg2 = null) {
11619
+ drawGrayscaleBuffer(posX, posY, intensities, srcWidth, srcHeight, fg = null, bg = null) {
11499
11620
  this.guard();
11500
- this.lib.bufferDrawGrayscaleBuffer(this.bufferPtr, posX, posY, intensities, srcWidth, srcHeight, fg2, bg2);
11621
+ this.lib.bufferDrawGrayscaleBuffer(this.bufferPtr, posX, posY, intensities, srcWidth, srcHeight, fg, bg);
11501
11622
  }
11502
- drawGrayscaleBufferSupersampled(posX, posY, intensities, srcWidth, srcHeight, fg2 = null, bg2 = null) {
11623
+ drawGrayscaleBufferSupersampled(posX, posY, intensities, srcWidth, srcHeight, fg = null, bg = null) {
11503
11624
  this.guard();
11504
- this.lib.bufferDrawGrayscaleBufferSupersampled(this.bufferPtr, posX, posY, intensities, srcWidth, srcHeight, fg2, bg2);
11625
+ this.lib.bufferDrawGrayscaleBufferSupersampled(this.bufferPtr, posX, posY, intensities, srcWidth, srcHeight, fg, bg);
11505
11626
  }
11506
11627
  resize(width, height) {
11507
11628
  this.guard();
@@ -11514,8 +11635,8 @@ class OptimizedBuffer {
11514
11635
  }
11515
11636
  drawBox(options) {
11516
11637
  this.guard();
11517
- const style = parseBorderStyle(options.borderStyle, "single");
11518
- const borderChars = options.customBorderChars ?? BorderCharArrays[style];
11638
+ const style = parseBorderStyle2(options.borderStyle, "single");
11639
+ const borderChars = options.customBorderChars ?? BorderCharArrays2[style];
11519
11640
  const packedOptions = packDrawOptions(options.border, options.shouldFill ?? false, options.titleAlignment || "left", options.bottomTitleAlignment || "left");
11520
11641
  this.lib.bufferDrawBox(this.bufferPtr, options.x, options.y, options.width, options.height, borderChars, packedOptions, options.borderColor, options.backgroundColor, options.titleColor ?? options.borderColor, options.title ?? null, options.bottomTitle ?? null);
11521
11642
  }
@@ -11564,14 +11685,14 @@ class OptimizedBuffer {
11564
11685
  drawOuter: options.drawOuter
11565
11686
  });
11566
11687
  }
11567
- drawChar(char, x, y, fg2, bg2, attributes = 0) {
11688
+ drawChar(char, x, y, fg, bg, attributes = 0) {
11568
11689
  this.guard();
11569
- this.lib.bufferDrawChar(this.bufferPtr, char, x, y, fg2, bg2, attributes);
11690
+ this.lib.bufferDrawChar(this.bufferPtr, char, x, y, fg, bg, attributes);
11570
11691
  }
11571
11692
  }
11572
11693
 
11573
11694
  // src/text-buffer.ts
11574
- class TextBuffer {
11695
+ class TextBuffer2 {
11575
11696
  lib;
11576
11697
  bufferPtr;
11577
11698
  _length = 0;
@@ -11581,12 +11702,12 @@ class TextBuffer {
11581
11702
  _textBytes;
11582
11703
  _memId;
11583
11704
  _appendedChunks = [];
11584
- constructor(lib, ptr2) {
11705
+ constructor(lib, ptr) {
11585
11706
  this.lib = lib;
11586
- this.bufferPtr = ptr2;
11707
+ this.bufferPtr = ptr;
11587
11708
  }
11588
11709
  static create(widthMethod) {
11589
- const lib = resolveRenderLib();
11710
+ const lib = resolveRenderLib2();
11590
11711
  return lib.createTextBuffer(widthMethod);
11591
11712
  }
11592
11713
  guard() {
@@ -11614,11 +11735,11 @@ class TextBuffer {
11614
11735
  this._length = this.lib.textBufferGetLength(this.bufferPtr);
11615
11736
  this._byteSize = this.lib.textBufferGetByteSize(this.bufferPtr);
11616
11737
  }
11617
- loadFile(path3) {
11738
+ loadFile(path) {
11618
11739
  this.guard();
11619
- const success = this.lib.textBufferLoadFile(this.bufferPtr, path3);
11740
+ const success = this.lib.textBufferLoadFile(this.bufferPtr, path);
11620
11741
  if (!success) {
11621
- throw new Error(`Failed to load file: ${path3}`);
11742
+ throw new Error(`Failed to load file: ${path}`);
11622
11743
  }
11623
11744
  this._length = this.lib.textBufferGetLength(this.bufferPtr);
11624
11745
  this._byteSize = this.lib.textBufferGetByteSize(this.bufferPtr);
@@ -11630,13 +11751,13 @@ class TextBuffer {
11630
11751
  this._length = this.lib.textBufferGetLength(this.bufferPtr);
11631
11752
  this._byteSize = this.lib.textBufferGetByteSize(this.bufferPtr);
11632
11753
  }
11633
- setDefaultFg(fg2) {
11754
+ setDefaultFg(fg) {
11634
11755
  this.guard();
11635
- this.lib.textBufferSetDefaultFg(this.bufferPtr, fg2);
11756
+ this.lib.textBufferSetDefaultFg(this.bufferPtr, fg);
11636
11757
  }
11637
- setDefaultBg(bg2) {
11758
+ setDefaultBg(bg) {
11638
11759
  this.guard();
11639
- this.lib.textBufferSetDefaultBg(this.bufferPtr, bg2);
11760
+ this.lib.textBufferSetDefaultBg(this.bufferPtr, bg);
11640
11761
  }
11641
11762
  setDefaultAttributes(attributes) {
11642
11763
  this.guard();
@@ -11785,11 +11906,11 @@ async function loadBackend2() {
11785
11906
  function importModule(specifier) {
11786
11907
  return import(specifier).then((module) => module.default ?? module);
11787
11908
  }
11788
- function createBunBackend2(bun2) {
11909
+ function createBunBackend2(bun) {
11789
11910
  return {
11790
- ptr: bun2.ptr,
11911
+ ptr: bun.ptr,
11791
11912
  toArrayBuffer(pointer, offset, length) {
11792
- return bun2.toArrayBuffer(toBunPointer2(pointer), offset, length);
11913
+ return bun.toArrayBuffer(toBunPointer2(pointer), offset, length);
11793
11914
  }
11794
11915
  };
11795
11916
  }
@@ -11892,7 +12013,7 @@ function enumTypeError(value) {
11892
12013
  throw new TypeError(`Invalid enum value: ${value}`);
11893
12014
  }
11894
12015
  function defineEnum(mapping, base = "u32") {
11895
- const reverse2 = Object.fromEntries(Object.entries(mapping).map(([k, v]) => [v, k]));
12016
+ const reverse = Object.fromEntries(Object.entries(mapping).map(([k, v]) => [v, k]));
11896
12017
  return {
11897
12018
  __type: "enum",
11898
12019
  type: base,
@@ -11900,7 +12021,7 @@ function defineEnum(mapping, base = "u32") {
11900
12021
  return typeof value === "number" ? value : mapping[value] ?? enumTypeError(String(value));
11901
12022
  },
11902
12023
  from(value) {
11903
- return reverse2[value] ?? enumTypeError(String(value));
12024
+ return reverse[value] ?? enumTypeError(String(value));
11904
12025
  },
11905
12026
  enum: mapping
11906
12027
  };
@@ -13051,7 +13172,7 @@ function defineStruct(fields, structDefOptions) {
13051
13172
 
13052
13173
  // src/zig-structs.ts
13053
13174
  var rgbaPackTransform = (rgba) => rgba?.buffer ?? null;
13054
- var rgbaUnpackTransform = (ptr3) => ptr3 ? RGBA.fromArray(new Uint16Array(toArrayBuffer(ptr3, 0, 8))) : undefined;
13175
+ var rgbaUnpackTransform = (ptr) => ptr ? RGBA2.fromArray(new Uint16Array(toArrayBuffer(ptr, 0, 8))) : undefined;
13055
13176
  var StyledChunkStruct = defineStruct([
13056
13177
  ["text", "char*"],
13057
13178
  ["text_len", "u64", { lengthOf: "text" }],
@@ -13078,8 +13199,8 @@ var StyledChunkStruct = defineStruct([
13078
13199
  ["link_len", "u64", { lengthOf: "link" }]
13079
13200
  ], {
13080
13201
  mapValue: (chunk) => {
13081
- const normalizedFg = normalizeColorValue(chunk.fg ?? null);
13082
- const normalizedBg = normalizeColorValue(chunk.bg ?? null);
13202
+ const normalizedFg = normalizeColorValue2(chunk.fg ?? null);
13203
+ const normalizedBg = normalizeColorValue2(chunk.bg ?? null);
13083
13204
  if (!chunk.link || typeof chunk.link === "string") {
13084
13205
  return {
13085
13206
  ...chunk,
@@ -13300,11 +13421,12 @@ var ReserveInfoStruct = defineStruct([
13300
13421
  len: value.len
13301
13422
  })
13302
13423
  });
13303
- var NativeAudioStreamFormat = {
13424
+ var NativeAudioStreamFormat2 = {
13304
13425
  Mp3: 1,
13305
- Flac: 2
13426
+ Flac: 2,
13427
+ Pcm: 3
13306
13428
  };
13307
- var NativeAudioStreamState = {
13429
+ var NativeAudioStreamState2 = {
13308
13430
  Initializing: 0,
13309
13431
  Buffering: 1,
13310
13432
  Playing: 2,
@@ -13322,7 +13444,7 @@ var NativeAudioStreamStateNames = [
13322
13444
  "disposed",
13323
13445
  "reconnecting"
13324
13446
  ];
13325
- var NativeAudioStreamCloseReason = {
13447
+ var NativeAudioStreamCloseReason2 = {
13326
13448
  PreserveNativeTerminal: 0,
13327
13449
  TransportError: 1,
13328
13450
  Disposed: 2
@@ -13362,7 +13484,9 @@ var AudioStreamCreateOptionsStruct = defineStruct([
13362
13484
  ["pan", "f32"],
13363
13485
  ["groupId", "u32"],
13364
13486
  ["maxProbeBytes", "u32"],
13365
- ["format", "u32"]
13487
+ ["format", "u32"],
13488
+ ["sampleRate", "u32", { default: 0 }],
13489
+ ["channels", "u32", { default: 0 }]
13366
13490
  ]);
13367
13491
  var AudioStreamStatsStruct = defineStruct([
13368
13492
  ["bytesReceived", "u64"],
@@ -13396,64 +13520,69 @@ var AudioStatsStruct = defineStruct([
13396
13520
  ]);
13397
13521
 
13398
13522
  // src/zig.ts
13399
- var NativeAudioStreamState2 = NativeAudioStreamState;
13400
- var NativeAudioStreamCloseReason2 = NativeAudioStreamCloseReason;
13401
- var NativeAudioStreamFormat2 = NativeAudioStreamFormat;
13402
- registerEnvVar({
13523
+ var NativeAudioStreamState3 = NativeAudioStreamState2;
13524
+ var NativeAudioStreamCloseReason3 = NativeAudioStreamCloseReason2;
13525
+ var NativeAudioStreamFormat3 = NativeAudioStreamFormat2;
13526
+ var MAX_LINK_URL_BYTES2 = 512;
13527
+ function allocFFIStruct(structDefinition) {
13528
+ const storage = allocStruct(structDefinition);
13529
+ return { ...storage, ffiView: new Uint8Array(storage.buffer) };
13530
+ }
13531
+ registerEnvVar2({
13403
13532
  name: "OPENTUI_LIBC",
13404
13533
  description: "Select Linux native libc package. Supported values: glibc, musl.",
13405
13534
  type: "string",
13406
13535
  default: ""
13407
13536
  });
13408
- var NativeClipboardOperationStatus;
13409
- ((NativeClipboardOperationStatus2) => {
13410
- NativeClipboardOperationStatus2[NativeClipboardOperationStatus2["Pending"] = 0] = "Pending";
13411
- NativeClipboardOperationStatus2[NativeClipboardOperationStatus2["Read"] = 1] = "Read";
13412
- NativeClipboardOperationStatus2[NativeClipboardOperationStatus2["Empty"] = 2] = "Empty";
13413
- NativeClipboardOperationStatus2[NativeClipboardOperationStatus2["Written"] = 3] = "Written";
13414
- NativeClipboardOperationStatus2[NativeClipboardOperationStatus2["Cleared"] = 4] = "Cleared";
13415
- NativeClipboardOperationStatus2[NativeClipboardOperationStatus2["Unsupported"] = 5] = "Unsupported";
13416
- NativeClipboardOperationStatus2[NativeClipboardOperationStatus2["Cancelled"] = 6] = "Cancelled";
13417
- NativeClipboardOperationStatus2[NativeClipboardOperationStatus2["TimedOut"] = 7] = "TimedOut";
13418
- NativeClipboardOperationStatus2[NativeClipboardOperationStatus2["LimitExceeded"] = 8] = "LimitExceeded";
13419
- NativeClipboardOperationStatus2[NativeClipboardOperationStatus2["Failed"] = 9] = "Failed";
13420
- NativeClipboardOperationStatus2[NativeClipboardOperationStatus2["InvalidHandle"] = 10] = "InvalidHandle";
13421
- })(NativeClipboardOperationStatus ||= {});
13422
- var NativeClipboardStartStatus;
13423
- ((NativeClipboardStartStatus2) => {
13424
- NativeClipboardStartStatus2[NativeClipboardStartStatus2["Ok"] = 0] = "Ok";
13425
- NativeClipboardStartStatus2[NativeClipboardStartStatus2["InvalidService"] = 1] = "InvalidService";
13426
- NativeClipboardStartStatus2[NativeClipboardStartStatus2["ShuttingDown"] = 2] = "ShuttingDown";
13427
- NativeClipboardStartStatus2[NativeClipboardStartStatus2["LimitExceeded"] = 3] = "LimitExceeded";
13428
- NativeClipboardStartStatus2[NativeClipboardStartStatus2["InvalidArgument"] = 4] = "InvalidArgument";
13429
- NativeClipboardStartStatus2[NativeClipboardStartStatus2["OutOfMemory"] = 5] = "OutOfMemory";
13430
- })(NativeClipboardStartStatus ||= {});
13431
- var NativeClipboardCancelStatus;
13432
- ((NativeClipboardCancelStatus2) => {
13433
- NativeClipboardCancelStatus2[NativeClipboardCancelStatus2["Requested"] = 0] = "Requested";
13434
- NativeClipboardCancelStatus2[NativeClipboardCancelStatus2["AlreadyTerminal"] = 1] = "AlreadyTerminal";
13435
- NativeClipboardCancelStatus2[NativeClipboardCancelStatus2["InvalidHandle"] = 2] = "InvalidHandle";
13436
- })(NativeClipboardCancelStatus ||= {});
13437
- var NativeClipboardCopyStatus;
13438
- ((NativeClipboardCopyStatus2) => {
13439
- NativeClipboardCopyStatus2[NativeClipboardCopyStatus2["Ok"] = 0] = "Ok";
13440
- NativeClipboardCopyStatus2[NativeClipboardCopyStatus2["BufferTooSmall"] = 1] = "BufferTooSmall";
13441
- NativeClipboardCopyStatus2[NativeClipboardCopyStatus2["InvalidHandle"] = 2] = "InvalidHandle";
13442
- NativeClipboardCopyStatus2[NativeClipboardCopyStatus2["InvalidState"] = 3] = "InvalidState";
13443
- NativeClipboardCopyStatus2[NativeClipboardCopyStatus2["InvalidArgument"] = 4] = "InvalidArgument";
13444
- })(NativeClipboardCopyStatus ||= {});
13445
- var NativeClipboardDestroyStatus;
13446
- ((NativeClipboardDestroyStatus2) => {
13447
- NativeClipboardDestroyStatus2[NativeClipboardDestroyStatus2["Destroyed"] = 0] = "Destroyed";
13448
- NativeClipboardDestroyStatus2[NativeClipboardDestroyStatus2["NotReady"] = 1] = "NotReady";
13449
- NativeClipboardDestroyStatus2[NativeClipboardDestroyStatus2["InvalidHandle"] = 2] = "InvalidHandle";
13450
- })(NativeClipboardDestroyStatus ||= {});
13451
- var NativeClipboardShutdownStatus;
13452
- ((NativeClipboardShutdownStatus2) => {
13453
- NativeClipboardShutdownStatus2[NativeClipboardShutdownStatus2["Pending"] = 0] = "Pending";
13454
- NativeClipboardShutdownStatus2[NativeClipboardShutdownStatus2["Ready"] = 1] = "Ready";
13455
- NativeClipboardShutdownStatus2[NativeClipboardShutdownStatus2["InvalidHandle"] = 2] = "InvalidHandle";
13456
- })(NativeClipboardShutdownStatus ||= {});
13537
+ var NativeClipboardOperationStatus2;
13538
+ ((NativeClipboardOperationStatus) => {
13539
+ NativeClipboardOperationStatus[NativeClipboardOperationStatus["Pending"] = 0] = "Pending";
13540
+ NativeClipboardOperationStatus[NativeClipboardOperationStatus["Read"] = 1] = "Read";
13541
+ NativeClipboardOperationStatus[NativeClipboardOperationStatus["Empty"] = 2] = "Empty";
13542
+ NativeClipboardOperationStatus[NativeClipboardOperationStatus["Written"] = 3] = "Written";
13543
+ NativeClipboardOperationStatus[NativeClipboardOperationStatus["Cleared"] = 4] = "Cleared";
13544
+ NativeClipboardOperationStatus[NativeClipboardOperationStatus["Unsupported"] = 5] = "Unsupported";
13545
+ NativeClipboardOperationStatus[NativeClipboardOperationStatus["Cancelled"] = 6] = "Cancelled";
13546
+ NativeClipboardOperationStatus[NativeClipboardOperationStatus["TimedOut"] = 7] = "TimedOut";
13547
+ NativeClipboardOperationStatus[NativeClipboardOperationStatus["LimitExceeded"] = 8] = "LimitExceeded";
13548
+ NativeClipboardOperationStatus[NativeClipboardOperationStatus["Failed"] = 9] = "Failed";
13549
+ NativeClipboardOperationStatus[NativeClipboardOperationStatus["InvalidHandle"] = 10] = "InvalidHandle";
13550
+ })(NativeClipboardOperationStatus2 ||= {});
13551
+ var NativeClipboardStartStatus2;
13552
+ ((NativeClipboardStartStatus) => {
13553
+ NativeClipboardStartStatus[NativeClipboardStartStatus["Ok"] = 0] = "Ok";
13554
+ NativeClipboardStartStatus[NativeClipboardStartStatus["InvalidService"] = 1] = "InvalidService";
13555
+ NativeClipboardStartStatus[NativeClipboardStartStatus["ShuttingDown"] = 2] = "ShuttingDown";
13556
+ NativeClipboardStartStatus[NativeClipboardStartStatus["LimitExceeded"] = 3] = "LimitExceeded";
13557
+ NativeClipboardStartStatus[NativeClipboardStartStatus["InvalidArgument"] = 4] = "InvalidArgument";
13558
+ NativeClipboardStartStatus[NativeClipboardStartStatus["OutOfMemory"] = 5] = "OutOfMemory";
13559
+ })(NativeClipboardStartStatus2 ||= {});
13560
+ var NativeClipboardCancelStatus2;
13561
+ ((NativeClipboardCancelStatus) => {
13562
+ NativeClipboardCancelStatus[NativeClipboardCancelStatus["Requested"] = 0] = "Requested";
13563
+ NativeClipboardCancelStatus[NativeClipboardCancelStatus["AlreadyTerminal"] = 1] = "AlreadyTerminal";
13564
+ NativeClipboardCancelStatus[NativeClipboardCancelStatus["InvalidHandle"] = 2] = "InvalidHandle";
13565
+ })(NativeClipboardCancelStatus2 ||= {});
13566
+ var NativeClipboardCopyStatus2;
13567
+ ((NativeClipboardCopyStatus) => {
13568
+ NativeClipboardCopyStatus[NativeClipboardCopyStatus["Ok"] = 0] = "Ok";
13569
+ NativeClipboardCopyStatus[NativeClipboardCopyStatus["BufferTooSmall"] = 1] = "BufferTooSmall";
13570
+ NativeClipboardCopyStatus[NativeClipboardCopyStatus["InvalidHandle"] = 2] = "InvalidHandle";
13571
+ NativeClipboardCopyStatus[NativeClipboardCopyStatus["InvalidState"] = 3] = "InvalidState";
13572
+ NativeClipboardCopyStatus[NativeClipboardCopyStatus["InvalidArgument"] = 4] = "InvalidArgument";
13573
+ })(NativeClipboardCopyStatus2 ||= {});
13574
+ var NativeClipboardDestroyStatus2;
13575
+ ((NativeClipboardDestroyStatus) => {
13576
+ NativeClipboardDestroyStatus[NativeClipboardDestroyStatus["Destroyed"] = 0] = "Destroyed";
13577
+ NativeClipboardDestroyStatus[NativeClipboardDestroyStatus["NotReady"] = 1] = "NotReady";
13578
+ NativeClipboardDestroyStatus[NativeClipboardDestroyStatus["InvalidHandle"] = 2] = "InvalidHandle";
13579
+ })(NativeClipboardDestroyStatus2 ||= {});
13580
+ var NativeClipboardShutdownStatus2;
13581
+ ((NativeClipboardShutdownStatus) => {
13582
+ NativeClipboardShutdownStatus[NativeClipboardShutdownStatus["Pending"] = 0] = "Pending";
13583
+ NativeClipboardShutdownStatus[NativeClipboardShutdownStatus["Ready"] = 1] = "Ready";
13584
+ NativeClipboardShutdownStatus[NativeClipboardShutdownStatus["InvalidHandle"] = 2] = "InvalidHandle";
13585
+ })(NativeClipboardShutdownStatus2 ||= {});
13457
13586
  var targetLibPath;
13458
13587
  var targetLibError;
13459
13588
  try {
@@ -13467,43 +13596,43 @@ try {
13467
13596
  } catch (error) {
13468
13597
  targetLibError = error instanceof Error ? error : new Error(String(error));
13469
13598
  }
13470
- registerEnvVar({
13599
+ registerEnvVar2({
13471
13600
  name: "OTUI_DEBUG_FFI",
13472
13601
  description: "Enable debug logging for the FFI bindings.",
13473
13602
  type: "boolean",
13474
13603
  default: false
13475
13604
  });
13476
- registerEnvVar({
13605
+ registerEnvVar2({
13477
13606
  name: "OTUI_TRACE_FFI",
13478
13607
  description: "Enable tracing for the FFI bindings.",
13479
13608
  type: "boolean",
13480
13609
  default: false
13481
13610
  });
13482
- registerEnvVar({
13611
+ registerEnvVar2({
13483
13612
  name: "OPENTUI_FORCE_WCWIDTH",
13484
13613
  description: "Use wcwidth for character width calculations when the variable is present",
13485
13614
  type: "string",
13486
13615
  required: false
13487
13616
  });
13488
- registerEnvVar({
13617
+ registerEnvVar2({
13489
13618
  name: "OPENTUI_FORCE_UNICODE",
13490
13619
  description: "Force Mode 2026 Unicode support when the variable is present",
13491
13620
  type: "string",
13492
13621
  required: false
13493
13622
  });
13494
- registerEnvVar({
13623
+ registerEnvVar2({
13495
13624
  name: "OPENTUI_GRAPHICS",
13496
13625
  description: "Control Kitty and Sixel graphics detection with the exact value true, 1, false, or 0",
13497
13626
  type: "string",
13498
13627
  required: false
13499
13628
  });
13500
- registerEnvVar({
13629
+ registerEnvVar2({
13501
13630
  name: "OPENTUI_IMAGE_PROTOCOL",
13502
13631
  description: "Override image rendering protocol: auto, kitty, sixel, or blocks",
13503
13632
  type: "string",
13504
13633
  default: "auto"
13505
13634
  });
13506
- registerEnvVar({
13635
+ registerEnvVar2({
13507
13636
  name: "OPENTUI_FORCE_NOZWJ",
13508
13637
  description: "Use no_zwj width mode when the variable is present",
13509
13638
  type: "string",
@@ -13511,7 +13640,44 @@ registerEnvVar({
13511
13640
  });
13512
13641
  var CURSOR_STYLE_TO_ID = { block: 0, line: 1, underline: 2, default: 3 };
13513
13642
  var CURSOR_ID_TO_STYLE = ["block", "line", "underline", "default"];
13514
- var MOUSE_STYLE_TO_ID = { default: 0, pointer: 1, text: 2, crosshair: 3, move: 4, "not-allowed": 5 };
13643
+ var MOUSE_STYLE_TO_ID = {
13644
+ auto: 0,
13645
+ default: 1,
13646
+ none: 2,
13647
+ "context-menu": 3,
13648
+ help: 4,
13649
+ pointer: 5,
13650
+ progress: 6,
13651
+ wait: 7,
13652
+ cell: 8,
13653
+ crosshair: 9,
13654
+ text: 10,
13655
+ "vertical-text": 11,
13656
+ alias: 12,
13657
+ copy: 13,
13658
+ move: 14,
13659
+ "no-drop": 15,
13660
+ "not-allowed": 16,
13661
+ grab: 17,
13662
+ grabbing: 18,
13663
+ "all-scroll": 19,
13664
+ "col-resize": 20,
13665
+ "row-resize": 21,
13666
+ "n-resize": 22,
13667
+ "e-resize": 23,
13668
+ "s-resize": 24,
13669
+ "w-resize": 25,
13670
+ "ne-resize": 26,
13671
+ "nw-resize": 27,
13672
+ "se-resize": 28,
13673
+ "sw-resize": 29,
13674
+ "ew-resize": 30,
13675
+ "ns-resize": 31,
13676
+ "nesw-resize": 32,
13677
+ "nwse-resize": 33,
13678
+ "zoom-in": 34,
13679
+ "zoom-out": 35
13680
+ };
13515
13681
  var MAX_FFI_U32 = 4294967295;
13516
13682
  var globalTraceSymbols = null;
13517
13683
  var globalFFILogPath = null;
@@ -13650,6 +13816,10 @@ function getOpenTUILib(libPath) {
13650
13816
  args: ["u32"],
13651
13817
  returns: "i32"
13652
13818
  },
13819
+ embeddedTerminalSetTransparentBackground: {
13820
+ args: ["u32", "u8"],
13821
+ returns: "i32"
13822
+ },
13653
13823
  embeddedTerminalScroll: {
13654
13824
  args: ["u32", "i32"],
13655
13825
  returns: "i32"
@@ -13671,11 +13841,11 @@ function getOpenTUILib(libPath) {
13671
13841
  returns: "i32"
13672
13842
  },
13673
13843
  embeddedTerminalCursor: {
13674
- args: ["u32", "ptr"],
13844
+ args: ["u32", "buffer"],
13675
13845
  returns: "i32"
13676
13846
  },
13677
13847
  embeddedTerminalEncodeKey: {
13678
- args: ["u32", "ptr", "ptr", "u32", "ptr", "u32", "ptr", "u32", "ptr"],
13848
+ args: ["u32", "buffer", "ptr", "u32", "ptr", "u32", "ptr", "u32", "ptr"],
13679
13849
  returns: "i32"
13680
13850
  },
13681
13851
  embeddedTerminalEncodeMouse: {
@@ -14015,7 +14185,7 @@ function getOpenTUILib(libPath) {
14015
14185
  returns: "void"
14016
14186
  },
14017
14187
  bufferDrawImage: {
14018
- args: ["u32", "u32", "ptr"],
14188
+ args: ["u32", "u32", "buffer"],
14019
14189
  returns: "u8"
14020
14190
  },
14021
14191
  bufferDrawPackedBuffer: {
@@ -14031,7 +14201,7 @@ function getOpenTUILib(libPath) {
14031
14201
  returns: "void"
14032
14202
  },
14033
14203
  bufferDrawGrid: {
14034
- args: ["u32", "buffer", "buffer", "buffer", "buffer", "u32", "buffer", "u32", "ptr"],
14204
+ args: ["u32", "buffer", "buffer", "buffer", "buffer", "u32", "buffer", "u32", "buffer"],
14035
14205
  returns: "void"
14036
14206
  },
14037
14207
  bufferDrawBox: {
@@ -14353,6 +14523,10 @@ function getOpenTUILib(libPath) {
14353
14523
  args: ["u32", "u8"],
14354
14524
  returns: "void"
14355
14525
  },
14526
+ textBufferViewSetTextAlign: {
14527
+ args: ["u32", "u8"],
14528
+ returns: "void"
14529
+ },
14356
14530
  textBufferViewSetFirstLineOffset: {
14357
14531
  args: ["u32", "u32"],
14358
14532
  returns: "void"
@@ -14398,7 +14572,7 @@ function getOpenTUILib(libPath) {
14398
14572
  returns: "void"
14399
14573
  },
14400
14574
  textBufferViewMeasureForDimensions: {
14401
- args: ["u32", "u32", "u32", "ptr"],
14575
+ args: ["u32", "u32", "u32", "buffer"],
14402
14576
  returns: "bool"
14403
14577
  },
14404
14578
  bufferDrawTextBufferView: {
@@ -14546,7 +14720,7 @@ function getOpenTUILib(libPath) {
14546
14720
  returns: "void"
14547
14721
  },
14548
14722
  editBufferGetCursorPosition: {
14549
- args: ["u32", "ptr"],
14723
+ args: ["u32", "buffer"],
14550
14724
  returns: "void"
14551
14725
  },
14552
14726
  editBufferGetId: {
@@ -14590,19 +14764,19 @@ function getOpenTUILib(libPath) {
14590
14764
  returns: "void"
14591
14765
  },
14592
14766
  editBufferGetNextWordBoundary: {
14593
- args: ["u32", "ptr"],
14767
+ args: ["u32", "buffer"],
14594
14768
  returns: "void"
14595
14769
  },
14596
14770
  editBufferGetPrevWordBoundary: {
14597
- args: ["u32", "ptr"],
14771
+ args: ["u32", "buffer"],
14598
14772
  returns: "void"
14599
14773
  },
14600
14774
  editBufferGetEOL: {
14601
- args: ["u32", "ptr"],
14775
+ args: ["u32", "buffer"],
14602
14776
  returns: "void"
14603
14777
  },
14604
14778
  editBufferOffsetToPosition: {
14605
- args: ["u32", "u32", "ptr"],
14779
+ args: ["u32", "u32", "buffer"],
14606
14780
  returns: "bool"
14607
14781
  },
14608
14782
  editBufferPositionToOffset: {
@@ -14678,7 +14852,7 @@ function getOpenTUILib(libPath) {
14678
14852
  returns: "u32"
14679
14853
  },
14680
14854
  editorViewGetVisualCursor: {
14681
- args: ["u32", "ptr"],
14855
+ args: ["u32", "buffer"],
14682
14856
  returns: "void"
14683
14857
  },
14684
14858
  editorViewMoveUpVisual: {
@@ -14698,23 +14872,23 @@ function getOpenTUILib(libPath) {
14698
14872
  returns: "void"
14699
14873
  },
14700
14874
  editorViewGetNextWordBoundary: {
14701
- args: ["u32", "ptr"],
14875
+ args: ["u32", "buffer"],
14702
14876
  returns: "void"
14703
14877
  },
14704
14878
  editorViewGetPrevWordBoundary: {
14705
- args: ["u32", "ptr"],
14879
+ args: ["u32", "buffer"],
14706
14880
  returns: "void"
14707
14881
  },
14708
14882
  editorViewGetEOL: {
14709
- args: ["u32", "ptr"],
14883
+ args: ["u32", "buffer"],
14710
14884
  returns: "void"
14711
14885
  },
14712
14886
  editorViewGetVisualSOL: {
14713
- args: ["u32", "ptr"],
14887
+ args: ["u32", "buffer"],
14714
14888
  returns: "void"
14715
14889
  },
14716
14890
  editorViewGetVisualEOL: {
14717
- args: ["u32", "ptr"],
14891
+ args: ["u32", "buffer"],
14718
14892
  returns: "void"
14719
14893
  },
14720
14894
  editorViewGotoVisualLineEnd: {
@@ -15100,7 +15274,7 @@ function getOpenTUILib(libPath) {
15100
15274
  returns: "i32"
15101
15275
  },
15102
15276
  audioCreateStream: {
15103
- args: ["u32", "ptr", "ptr"],
15277
+ args: ["u32", "buffer", "buffer"],
15104
15278
  returns: "i32"
15105
15279
  },
15106
15280
  audioWriteStream: {
@@ -15128,11 +15302,11 @@ function getOpenTUILib(libPath) {
15128
15302
  returns: "i32"
15129
15303
  },
15130
15304
  audioGetStreamStats: {
15131
- args: ["u32", "u32", "ptr"],
15305
+ args: ["u32", "u32", "buffer"],
15132
15306
  returns: "i32"
15133
15307
  },
15134
15308
  audioCloseStream: {
15135
- args: ["u32", "u32", "u32", "ptr"],
15309
+ args: ["u32", "u32", "u32", "buffer"],
15136
15310
  returns: "i32"
15137
15311
  },
15138
15312
  audioLoad: {
@@ -15232,7 +15406,7 @@ function getOpenTUILib(libPath) {
15232
15406
  returns: "void"
15233
15407
  }
15234
15408
  });
15235
- if (env.OTUI_DEBUG_FFI || env.OTUI_TRACE_FFI) {
15409
+ if (env2.OTUI_DEBUG_FFI || env2.OTUI_TRACE_FFI) {
15236
15410
  return {
15237
15411
  ...rawSymbols,
15238
15412
  symbols: convertToDebugSymbols(rawSymbols.symbols)
@@ -15244,7 +15418,7 @@ function convertToDebugSymbols(symbols) {
15244
15418
  if (!globalTraceSymbols) {
15245
15419
  globalTraceSymbols = {};
15246
15420
  }
15247
- if (env.OTUI_DEBUG_FFI && !globalFFILogPath) {
15421
+ if (env2.OTUI_DEBUG_FFI && !globalFFILogPath) {
15248
15422
  const now = new Date;
15249
15423
  const timestamp = now.toISOString().replace(/[:.]/g, "-").replace(/T/, "_").split("Z")[0];
15250
15424
  globalFFILogPath = `ffi_otui_debug_${timestamp}.log`;
@@ -15254,7 +15428,7 @@ function convertToDebugSymbols(symbols) {
15254
15428
  Object.entries(symbols).forEach(([key, value]) => {
15255
15429
  debugSymbols[key] = value;
15256
15430
  });
15257
- if (env.OTUI_DEBUG_FFI && globalFFILogPath) {
15431
+ if (env2.OTUI_DEBUG_FFI && globalFFILogPath) {
15258
15432
  const logPath = globalFFILogPath;
15259
15433
  const writeSync = (msg) => {
15260
15434
  writeFileSync(logPath, msg + `
@@ -15271,7 +15445,7 @@ function convertToDebugSymbols(symbols) {
15271
15445
  }
15272
15446
  });
15273
15447
  }
15274
- if (env.OTUI_TRACE_FFI) {
15448
+ if (env2.OTUI_TRACE_FFI) {
15275
15449
  hasTracing = true;
15276
15450
  Object.entries(symbols).forEach(([key, value]) => {
15277
15451
  if (typeof value === "function") {
@@ -15289,7 +15463,7 @@ function convertToDebugSymbols(symbols) {
15289
15463
  }
15290
15464
  });
15291
15465
  }
15292
- if ((env.OTUI_DEBUG_FFI || env.OTUI_TRACE_FFI) && !exitHandlerRegistered) {
15466
+ if ((env2.OTUI_DEBUG_FFI || env2.OTUI_TRACE_FFI) && !exitHandlerRegistered) {
15293
15467
  exitHandlerRegistered = true;
15294
15468
  process.on("exit", () => {
15295
15469
  if (globalTraceSymbols) {
@@ -15300,7 +15474,7 @@ function convertToDebugSymbols(symbols) {
15300
15474
  }
15301
15475
  const sortedTimings = [...timings].sort((a, b) => a - b);
15302
15476
  const count = sortedTimings.length;
15303
- const total = sortedTimings.reduce((acc, t2) => acc + t2, 0);
15477
+ const total = sortedTimings.reduce((acc, t) => acc + t, 0);
15304
15478
  const average = total / count;
15305
15479
  const min = sortedTimings[0];
15306
15480
  const max = sortedTimings[count - 1];
@@ -15375,13 +15549,13 @@ function convertToDebugSymbols(symbols) {
15375
15549
  return debugSymbols;
15376
15550
  }
15377
15551
  var LogLevel2;
15378
- ((LogLevel3) => {
15379
- LogLevel3[LogLevel3["Error"] = 0] = "Error";
15380
- LogLevel3[LogLevel3["Warn"] = 1] = "Warn";
15381
- LogLevel3[LogLevel3["Info"] = 2] = "Info";
15382
- LogLevel3[LogLevel3["Debug"] = 3] = "Debug";
15552
+ ((LogLevel) => {
15553
+ LogLevel[LogLevel["Error"] = 0] = "Error";
15554
+ LogLevel[LogLevel["Warn"] = 1] = "Warn";
15555
+ LogLevel[LogLevel["Info"] = 2] = "Info";
15556
+ LogLevel[LogLevel["Debug"] = 3] = "Debug";
15383
15557
  })(LogLevel2 ||= {});
15384
- var NativeMeasureTargetKind = {
15558
+ var NativeMeasureTargetKind2 = {
15385
15559
  None: 0,
15386
15560
  TextBufferView: 1,
15387
15561
  EditorView: 2
@@ -15393,11 +15567,11 @@ class FFIRenderLib {
15393
15567
  yogaLayout = new Float32Array(6);
15394
15568
  ffiStructStorage = {
15395
15569
  logicalCursor: {
15396
- ...allocStruct(LogicalCursorStruct),
15570
+ ...allocFFIStruct(LogicalCursorStruct),
15397
15571
  result: { row: 0, col: 0, offset: 0 }
15398
15572
  },
15399
15573
  visualCursor: {
15400
- ...allocStruct(VisualCursorStruct),
15574
+ ...allocFFIStruct(VisualCursorStruct),
15401
15575
  result: {
15402
15576
  visualRow: 0,
15403
15577
  visualCol: 0,
@@ -15407,13 +15581,13 @@ class FFIRenderLib {
15407
15581
  }
15408
15582
  },
15409
15583
  measureResult: {
15410
- ...allocStruct(MeasureResultStruct),
15584
+ ...allocFFIStruct(MeasureResultStruct),
15411
15585
  result: { lineCount: 0, widthColsMax: 0 }
15412
15586
  },
15413
- embeddedTerminalCursor: allocStruct(EmbeddedTerminalCursorStruct),
15414
- embeddedTerminalKeyOptions: allocStruct(EmbeddedTerminalKeyOptionsStruct),
15587
+ embeddedTerminalCursor: allocFFIStruct(EmbeddedTerminalCursorStruct),
15588
+ embeddedTerminalKeyOptions: allocFFIStruct(EmbeddedTerminalKeyOptionsStruct),
15415
15589
  audioStreamStats: {
15416
- ...allocStruct(AudioStreamStatsStruct),
15590
+ ...allocFFIStruct(AudioStreamStatsStruct),
15417
15591
  result: {
15418
15592
  bytesReceived: 0n,
15419
15593
  framesDecoded: 0n,
@@ -15428,8 +15602,8 @@ class FFIRenderLib {
15428
15602
  readyGeneration: 0
15429
15603
  }
15430
15604
  },
15431
- imageDrawOptions: allocStruct(ImageDrawOptionsStruct),
15432
- gridDrawOptions: allocStruct(GridDrawOptionsStruct)
15605
+ imageDrawOptions: allocFFIStruct(ImageDrawOptionsStruct),
15606
+ gridDrawOptions: allocFFIStruct(GridDrawOptionsStruct)
15433
15607
  };
15434
15608
  disposed = false;
15435
15609
  clipboardServices = new Set;
@@ -15481,6 +15655,9 @@ class FFIRenderLib {
15481
15655
  embeddedTerminalInvalidate(handle) {
15482
15656
  embeddedTerminalResult(this.opentui.symbols.embeddedTerminalInvalidate(handle), "invalidation");
15483
15657
  }
15658
+ embeddedTerminalSetTransparentBackground(handle, transparent) {
15659
+ embeddedTerminalResult(this.opentui.symbols.embeddedTerminalSetTransparentBackground(handle, transparent ? 1 : 0), "transparent background update");
15660
+ }
15484
15661
  embeddedTerminalScroll(handle, delta) {
15485
15662
  embeddedTerminalResult(this.opentui.symbols.embeddedTerminalScroll(handle, embeddedTerminalI32(delta, "scroll delta")), "scroll");
15486
15663
  }
@@ -15492,7 +15669,7 @@ class FFIRenderLib {
15492
15669
  }
15493
15670
  embeddedTerminalGetSelectedText(handle) {
15494
15671
  const required = new Uint32Array(1);
15495
- const read = (output2) => this.opentui.symbols.embeddedTerminalGetSelectedText(handle, viewOrNull(output2), output2.byteLength, required);
15672
+ const read = (output) => this.opentui.symbols.embeddedTerminalGetSelectedText(handle, viewOrNull(output), output.byteLength, required);
15496
15673
  const initial = new Uint8Array(256);
15497
15674
  const status = read(initial);
15498
15675
  if (status >= 0)
@@ -15508,7 +15685,7 @@ class FFIRenderLib {
15508
15685
  }
15509
15686
  embeddedTerminalCursor(handle) {
15510
15687
  const storage = this.ffiStructStorage.embeddedTerminalCursor;
15511
- embeddedTerminalResult(this.opentui.symbols.embeddedTerminalCursor(handle, storage.buffer), "cursor query");
15688
+ embeddedTerminalResult(this.opentui.symbols.embeddedTerminalCursor(handle, storage.ffiView), "cursor query");
15512
15689
  const result = EmbeddedTerminalCursorStruct.unpack(storage.buffer);
15513
15690
  return {
15514
15691
  x: result.x,
@@ -15536,7 +15713,7 @@ class FFIRenderLib {
15536
15713
  const text = key.text ? this.encoder.encode(key.text) : new Uint8Array;
15537
15714
  const textLength = toSafeFFIU32Length(text.byteLength, "Embedded terminal key text length");
15538
15715
  const required = new Uint32Array(1);
15539
- const encode = (output2) => this.opentui.symbols.embeddedTerminalEncodeKey(handle, options.buffer, keyCodeLength === 0 ? null : keyCode, keyCodeLength, textLength === 0 ? null : text, textLength, output2, output2.byteLength, required);
15716
+ const encode = (output) => this.opentui.symbols.embeddedTerminalEncodeKey(handle, options.ffiView, keyCodeLength === 0 ? null : keyCode, keyCodeLength, textLength === 0 ? null : text, textLength, output, output.byteLength, required);
15540
15717
  const initial = new Uint8Array(Math.max(64, textLength));
15541
15718
  const status = encode(initial);
15542
15719
  if (status >= 0)
@@ -15798,7 +15975,7 @@ class FFIRenderLib {
15798
15975
  const width = this.opentui.symbols.getBufferWidth(bufferPtr);
15799
15976
  const height = this.opentui.symbols.getBufferHeight(bufferPtr);
15800
15977
  const widthMethod = widthMethodFromCode(this.opentui.symbols.getBufferWidthMethod(bufferPtr));
15801
- return new OptimizedBuffer(this, bufferPtr, width, height, { id: "next buffer", widthMethod });
15978
+ return new OptimizedBuffer2(this, bufferPtr, width, height, { id: "next buffer", widthMethod });
15802
15979
  }
15803
15980
  getCurrentBuffer(renderer) {
15804
15981
  const bufferPtr = this.opentui.symbols.getCurrentBuffer(renderer);
@@ -15808,7 +15985,7 @@ class FFIRenderLib {
15808
15985
  const width = this.opentui.symbols.getBufferWidth(bufferPtr);
15809
15986
  const height = this.opentui.symbols.getBufferHeight(bufferPtr);
15810
15987
  const widthMethod = widthMethodFromCode(this.opentui.symbols.getBufferWidthMethod(bufferPtr));
15811
- return new OptimizedBuffer(this, bufferPtr, width, height, { id: "current buffer", widthMethod });
15988
+ return new OptimizedBuffer2(this, bufferPtr, width, height, { id: "current buffer", widthMethod });
15812
15989
  }
15813
15990
  rendererSetPaletteState(renderer, palette, defaultForeground, defaultBackground, paletteEpoch) {
15814
15991
  const paletteBuffer = new Uint16Array(palette.length * 4);
@@ -15818,32 +15995,32 @@ class FFIRenderLib {
15818
15995
  this.opentui.symbols.rendererSetPaletteState(renderer, paletteBuffer, palette.length, rgbaBuffer(defaultForeground), rgbaBuffer(defaultBackground), paletteEpoch >>> 0);
15819
15996
  }
15820
15997
  bufferGetCharPtr(buffer) {
15821
- const ptr3 = this.opentui.symbols.bufferGetCharPtr(buffer);
15822
- if (!ptr3) {
15998
+ const ptr = this.opentui.symbols.bufferGetCharPtr(buffer);
15999
+ if (!ptr) {
15823
16000
  throw new Error("Failed to get char pointer");
15824
16001
  }
15825
- return ptr3;
16002
+ return ptr;
15826
16003
  }
15827
16004
  bufferGetFgPtr(buffer) {
15828
- const ptr3 = this.opentui.symbols.bufferGetFgPtr(buffer);
15829
- if (!ptr3) {
16005
+ const ptr = this.opentui.symbols.bufferGetFgPtr(buffer);
16006
+ if (!ptr) {
15830
16007
  throw new Error("Failed to get fg pointer");
15831
16008
  }
15832
- return ptr3;
16009
+ return ptr;
15833
16010
  }
15834
16011
  bufferGetBgPtr(buffer) {
15835
- const ptr3 = this.opentui.symbols.bufferGetBgPtr(buffer);
15836
- if (!ptr3) {
16012
+ const ptr = this.opentui.symbols.bufferGetBgPtr(buffer);
16013
+ if (!ptr) {
15837
16014
  throw new Error("Failed to get bg pointer");
15838
16015
  }
15839
- return ptr3;
16016
+ return ptr;
15840
16017
  }
15841
16018
  bufferGetAttributesPtr(buffer) {
15842
- const ptr3 = this.opentui.symbols.bufferGetAttributesPtr(buffer);
15843
- if (!ptr3) {
16019
+ const ptr = this.opentui.symbols.bufferGetAttributesPtr(buffer);
16020
+ if (!ptr) {
15844
16021
  throw new Error("Failed to get attributes pointer");
15845
16022
  }
15846
- return ptr3;
16023
+ return ptr;
15847
16024
  }
15848
16025
  bufferGetRespectAlpha(buffer) {
15849
16026
  return this.opentui.symbols.bufferGetRespectAlpha(buffer);
@@ -15874,25 +16051,25 @@ class FFIRenderLib {
15874
16051
  }
15875
16052
  bufferDrawText(buffer, text, x, y, color, bgColor, attributes) {
15876
16053
  const textBytes = this.encoder.encode(text);
15877
- const bg2 = optionalRgbaBuffer(bgColor);
15878
- const fg2 = rgbaBuffer(color);
15879
- this.opentui.symbols.bufferDrawText(buffer, viewOrNull(textBytes), textBytes.byteLength, x, y, fg2, bg2, attributes ?? 0);
16054
+ const bg = optionalRgbaBuffer(bgColor);
16055
+ const fg = rgbaBuffer(color);
16056
+ this.opentui.symbols.bufferDrawText(buffer, viewOrNull(textBytes), textBytes.byteLength, x, y, fg, bg, attributes ?? 0);
15880
16057
  }
15881
16058
  bufferSetCellWithAlphaBlending(buffer, x, y, char, color, bgColor, attributes) {
15882
16059
  const charPtr = char.codePointAt(0) ?? " ".codePointAt(0);
15883
- const bg2 = rgbaBuffer(bgColor);
15884
- const fg2 = rgbaBuffer(color);
15885
- this.opentui.symbols.bufferSetCellWithAlphaBlending(buffer, x, y, charPtr, fg2, bg2, attributes ?? 0);
16060
+ const bg = rgbaBuffer(bgColor);
16061
+ const fg = rgbaBuffer(color);
16062
+ this.opentui.symbols.bufferSetCellWithAlphaBlending(buffer, x, y, charPtr, fg, bg, attributes ?? 0);
15886
16063
  }
15887
16064
  bufferSetCell(buffer, x, y, char, color, bgColor, attributes) {
15888
16065
  const charPtr = char.codePointAt(0) ?? " ".codePointAt(0);
15889
- const bg2 = rgbaBuffer(bgColor);
15890
- const fg2 = rgbaBuffer(color);
15891
- this.opentui.symbols.bufferSetCell(buffer, x, y, charPtr, fg2, bg2, attributes ?? 0);
16066
+ const bg = rgbaBuffer(bgColor);
16067
+ const fg = rgbaBuffer(color);
16068
+ this.opentui.symbols.bufferSetCell(buffer, x, y, charPtr, fg, bg, attributes ?? 0);
15892
16069
  }
15893
16070
  bufferFillRect(buffer, x, y, width, height, color) {
15894
- const bg2 = rgbaBuffer(color);
15895
- this.opentui.symbols.bufferFillRect(buffer, x, y, width, height, bg2);
16071
+ const bg = rgbaBuffer(color);
16072
+ this.opentui.symbols.bufferFillRect(buffer, x, y, width, height, bg);
15896
16073
  }
15897
16074
  bufferColorMatrix(buffer, matrix, cellMask, cellMaskCount, strength, target) {
15898
16075
  this.opentui.symbols.bufferColorMatrix(buffer, matrix, cellMask, cellMaskCount, strength, target);
@@ -15920,20 +16097,20 @@ class FFIRenderLib {
15920
16097
  sourceHeight,
15921
16098
  protocol: protocolId
15922
16099
  }, storage.view, 0);
15923
- return Boolean(this.opentui.symbols.bufferDrawImage(buffer, image, storage.buffer));
16100
+ return Boolean(this.opentui.symbols.bufferDrawImage(buffer, image, storage.ffiView));
15924
16101
  }
15925
16102
  bufferDrawPackedBuffer(buffer, data, dataLen, posX, posY, terminalWidthCells, terminalHeightCells) {
15926
16103
  this.opentui.symbols.bufferDrawPackedBuffer(buffer, data, dataLen, posX, posY, terminalWidthCells, terminalHeightCells);
15927
16104
  }
15928
- bufferDrawGrayscaleBuffer(buffer, posX, posY, intensities, srcWidth, srcHeight, fg2, bg2) {
15929
- this.opentui.symbols.bufferDrawGrayscaleBuffer(buffer, posX, posY, intensities, srcWidth, srcHeight, optionalRgbaBuffer(fg2), optionalRgbaBuffer(bg2));
16105
+ bufferDrawGrayscaleBuffer(buffer, posX, posY, intensities, srcWidth, srcHeight, fg, bg) {
16106
+ this.opentui.symbols.bufferDrawGrayscaleBuffer(buffer, posX, posY, intensities, srcWidth, srcHeight, optionalRgbaBuffer(fg), optionalRgbaBuffer(bg));
15930
16107
  }
15931
- bufferDrawGrayscaleBufferSupersampled(buffer, posX, posY, intensities, srcWidth, srcHeight, fg2, bg2) {
15932
- this.opentui.symbols.bufferDrawGrayscaleBufferSupersampled(buffer, posX, posY, intensities, srcWidth, srcHeight, optionalRgbaBuffer(fg2), optionalRgbaBuffer(bg2));
16108
+ bufferDrawGrayscaleBufferSupersampled(buffer, posX, posY, intensities, srcWidth, srcHeight, fg, bg) {
16109
+ this.opentui.symbols.bufferDrawGrayscaleBufferSupersampled(buffer, posX, posY, intensities, srcWidth, srcHeight, optionalRgbaBuffer(fg), optionalRgbaBuffer(bg));
15933
16110
  }
15934
16111
  bufferDrawGrid(buffer, borderChars, borderFg, borderBg, columnOffsets, columnCount, rowOffsets, rowCount, options) {
15935
16112
  GridDrawOptionsStruct.packInto({ drawInner: options.drawInner, drawOuter: options.drawOuter }, this.ffiStructStorage.gridDrawOptions.view, 0);
15936
- this.opentui.symbols.bufferDrawGrid(buffer, borderChars, rgbaBuffer(borderFg), rgbaBuffer(borderBg), columnOffsets, columnCount, rowOffsets, rowCount, this.ffiStructStorage.gridDrawOptions.buffer);
16113
+ this.opentui.symbols.bufferDrawGrid(buffer, borderChars, rgbaBuffer(borderFg), rgbaBuffer(borderBg), columnOffsets, columnCount, rowOffsets, rowCount, this.ffiStructStorage.gridDrawOptions.ffiView);
15937
16114
  }
15938
16115
  bufferDrawBox(buffer, x, y, width, height, borderChars, packedOptions, borderColor, backgroundColor, titleColor, title, bottomTitle) {
15939
16116
  const titleBytes = title ? this.encoder.encode(title) : null;
@@ -15951,7 +16128,7 @@ class FFIRenderLib {
15951
16128
  const urlBytes = this.encoder.encode(url);
15952
16129
  return this.opentui.symbols.linkAlloc(viewOrNull(urlBytes), urlBytes.byteLength);
15953
16130
  }
15954
- linkGetUrl(linkId, maxLen = 512) {
16131
+ linkGetUrl(linkId, maxLen = MAX_LINK_URL_BYTES2) {
15955
16132
  const outBuffer = new Uint8Array(maxLen);
15956
16133
  const actualLen = this.opentui.symbols.linkGetUrl(linkId, viewOrNull(outBuffer), maxLen);
15957
16134
  return this.decoder.decode(outBuffer.slice(0, actualLen));
@@ -15981,7 +16158,7 @@ class FFIRenderLib {
15981
16158
  visible: struct.visible,
15982
16159
  style: CURSOR_ID_TO_STYLE[struct.style] ?? "block",
15983
16160
  blinking: struct.blinking,
15984
- color: RGBA.fromValues(struct.r, struct.g, struct.b, struct.a)
16161
+ color: RGBA2.fromValues(struct.r, struct.g, struct.b, struct.a)
15985
16162
  };
15986
16163
  }
15987
16164
  setCursorStyleOptions(renderer, options) {
@@ -16018,7 +16195,7 @@ class FFIRenderLib {
16018
16195
  if (!bufferPtr) {
16019
16196
  throw new Error(`Failed to create optimized buffer: ${width}x${height}`);
16020
16197
  }
16021
- return new OptimizedBuffer(this, bufferPtr, width, height, { respectAlpha, id, widthMethod });
16198
+ return new OptimizedBuffer2(this, bufferPtr, width, height, { respectAlpha, id, widthMethod });
16022
16199
  }
16023
16200
  destroyOptimizedBuffer(bufferPtr) {
16024
16201
  this.opentui.symbols.destroyOptimizedBuffer(bufferPtr);
@@ -16086,19 +16263,19 @@ class FFIRenderLib {
16086
16263
  operation: output[0] === 0 ? null : output[0]
16087
16264
  };
16088
16265
  }
16089
- clipboardReadOperationStart(service, request, selection2, maxBytes, maxImagePixels, maxConversionBytes, timeoutMs) {
16266
+ clipboardReadOperationStart(service, request, selection, maxBytes, maxImagePixels, maxConversionBytes, timeoutMs) {
16090
16267
  const output = new Uint32Array(1);
16091
- const status = this.opentui.symbols.clipboardReadOperationStart(service, request, toSafeFFIU32Length(request.byteLength, "clipboard read request"), selection2, toSafeFFIU32Length(maxBytes, "clipboard read byte limit"), toSafeFFIU32Length(maxImagePixels, "clipboard image pixel limit"), toSafeFFIU32Length(maxConversionBytes, "clipboard conversion byte limit"), toSafeFFIU32Length(timeoutMs, "clipboard read timeout"), output);
16268
+ const status = this.opentui.symbols.clipboardReadOperationStart(service, request, toSafeFFIU32Length(request.byteLength, "clipboard read request"), selection, toSafeFFIU32Length(maxBytes, "clipboard read byte limit"), toSafeFFIU32Length(maxImagePixels, "clipboard image pixel limit"), toSafeFFIU32Length(maxConversionBytes, "clipboard conversion byte limit"), toSafeFFIU32Length(timeoutMs, "clipboard read timeout"), output);
16092
16269
  return this.clipboardStartResult(status, output);
16093
16270
  }
16094
- clipboardWriteOperationStart(service, textUtf8, selection2, timeoutMs) {
16271
+ clipboardWriteOperationStart(service, textUtf8, selection, timeoutMs) {
16095
16272
  const output = new Uint32Array(1);
16096
- const status = this.opentui.symbols.clipboardWriteOperationStart(service, textUtf8, toSafeFFIU32Length(textUtf8.byteLength, "clipboard write text"), selection2, toSafeFFIU32Length(timeoutMs, "clipboard write timeout"), output);
16273
+ const status = this.opentui.symbols.clipboardWriteOperationStart(service, textUtf8, toSafeFFIU32Length(textUtf8.byteLength, "clipboard write text"), selection, toSafeFFIU32Length(timeoutMs, "clipboard write timeout"), output);
16097
16274
  return this.clipboardStartResult(status, output);
16098
16275
  }
16099
- clipboardClearOperationStart(service, selection2, timeoutMs) {
16276
+ clipboardClearOperationStart(service, selection, timeoutMs) {
16100
16277
  const output = new Uint32Array(1);
16101
- const status = this.opentui.symbols.clipboardClearOperationStart(service, selection2, toSafeFFIU32Length(timeoutMs, "clipboard clear timeout"), output);
16278
+ const status = this.opentui.symbols.clipboardClearOperationStart(service, selection, toSafeFFIU32Length(timeoutMs, "clipboard clear timeout"), output);
16102
16279
  return this.clipboardStartResult(status, output);
16103
16280
  }
16104
16281
  clipboardOperationPoll(operation) {
@@ -16355,8 +16532,8 @@ class FFIRenderLib {
16355
16532
  yogaNodeStyleGetFloat(node, kind) {
16356
16533
  return this.opentui.symbols.yogaNodeStyleGetFloat(node, kind);
16357
16534
  }
16358
- yogaNodeStyleSetBorder(node, edge, border2) {
16359
- this.opentui.symbols.yogaNodeStyleSetBorder(node, edge, border2);
16535
+ yogaNodeStyleSetBorder(node, edge, border) {
16536
+ this.opentui.symbols.yogaNodeStyleSetBorder(node, edge, border);
16360
16537
  }
16361
16538
  yogaNodeStyleGetBorder(node, edge) {
16362
16539
  return this.opentui.symbols.yogaNodeStyleGetBorder(node, edge);
@@ -16408,7 +16585,7 @@ class FFIRenderLib {
16408
16585
  if (!bufferPtr) {
16409
16586
  throw new Error(`Failed to create TextBuffer`);
16410
16587
  }
16411
- return new TextBuffer(this, bufferPtr);
16588
+ return new TextBuffer2(this, bufferPtr);
16412
16589
  }
16413
16590
  destroyTextBuffer(buffer) {
16414
16591
  this.opentui.symbols.destroyTextBuffer(buffer);
@@ -16425,12 +16602,12 @@ class FFIRenderLib {
16425
16602
  textBufferClear(buffer) {
16426
16603
  this.opentui.symbols.textBufferClear(buffer);
16427
16604
  }
16428
- textBufferSetDefaultFg(buffer, fg2) {
16429
- const fgBuffer = optionalRgbaBuffer(fg2);
16605
+ textBufferSetDefaultFg(buffer, fg) {
16606
+ const fgBuffer = optionalRgbaBuffer(fg);
16430
16607
  this.opentui.symbols.textBufferSetDefaultFg(buffer, fgBuffer);
16431
16608
  }
16432
- textBufferSetDefaultBg(buffer, bg2) {
16433
- const bgBuffer = optionalRgbaBuffer(bg2);
16609
+ textBufferSetDefaultBg(buffer, bg) {
16610
+ const bgBuffer = optionalRgbaBuffer(bg);
16434
16611
  this.opentui.symbols.textBufferSetDefaultBg(buffer, bgBuffer);
16435
16612
  }
16436
16613
  textBufferSetDefaultAttributes(buffer, attributes) {
@@ -16468,8 +16645,8 @@ class FFIRenderLib {
16468
16645
  textBufferAppendFromMemId(buffer, memId) {
16469
16646
  this.opentui.symbols.textBufferAppendFromMemId(buffer, memId);
16470
16647
  }
16471
- textBufferLoadFile(buffer, path3) {
16472
- const pathBytes = this.encoder.encode(path3);
16648
+ textBufferLoadFile(buffer, path) {
16649
+ const pathBytes = this.encoder.encode(path);
16473
16650
  return this.opentui.symbols.textBufferLoadFile(buffer, viewOrNull(pathBytes), pathBytes.byteLength);
16474
16651
  }
16475
16652
  textBufferSetStyledText(buffer, chunks) {
@@ -16523,39 +16700,39 @@ class FFIRenderLib {
16523
16700
  this.opentui.symbols.destroyTextBufferView(view);
16524
16701
  }
16525
16702
  textBufferViewSetSelection(view, start, end, bgColor, fgColor) {
16526
- const bg2 = optionalRgbaBuffer(bgColor);
16527
- const fg2 = optionalRgbaBuffer(fgColor);
16528
- this.opentui.symbols.textBufferViewSetSelection(view, start, end, bg2, fg2);
16703
+ const bg = optionalRgbaBuffer(bgColor);
16704
+ const fg = optionalRgbaBuffer(fgColor);
16705
+ this.opentui.symbols.textBufferViewSetSelection(view, start, end, bg, fg);
16529
16706
  }
16530
16707
  textBufferViewResetSelection(view) {
16531
16708
  this.opentui.symbols.textBufferViewResetSelection(view);
16532
16709
  }
16533
16710
  textBufferViewGetSelection(view) {
16534
16711
  const packedInfo = this.textBufferViewGetSelectionInfo(view);
16535
- if (packedInfo === 0xffff_ffff_ffff_ffffn) {
16712
+ if (packedInfo === 0xffffffffffffffffn) {
16536
16713
  return null;
16537
16714
  }
16538
16715
  const start = Number(packedInfo >> 32n);
16539
- const end = Number(packedInfo & 0xffff_ffffn);
16716
+ const end = Number(packedInfo & 0xffffffffn);
16540
16717
  return { start, end };
16541
16718
  }
16542
16719
  textBufferViewGetSelectionInfo(view) {
16543
16720
  return this.opentui.symbols.textBufferViewGetSelectionInfo(view);
16544
16721
  }
16545
16722
  textBufferViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor, behavior) {
16546
- const bg2 = optionalRgbaBuffer(bgColor);
16547
- const fg2 = optionalRgbaBuffer(fgColor);
16548
- return Boolean(this.opentui.symbols.textBufferViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2, selectionBehaviorByte(behavior)));
16723
+ const bg = optionalRgbaBuffer(bgColor);
16724
+ const fg = optionalRgbaBuffer(fgColor);
16725
+ return Boolean(this.opentui.symbols.textBufferViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bg, fg, selectionBehaviorByte(behavior)));
16549
16726
  }
16550
16727
  textBufferViewUpdateSelection(view, end, bgColor, fgColor) {
16551
- const bg2 = optionalRgbaBuffer(bgColor);
16552
- const fg2 = optionalRgbaBuffer(fgColor);
16553
- this.opentui.symbols.textBufferViewUpdateSelection(view, end, bg2, fg2);
16728
+ const bg = optionalRgbaBuffer(bgColor);
16729
+ const fg = optionalRgbaBuffer(fgColor);
16730
+ this.opentui.symbols.textBufferViewUpdateSelection(view, end, bg, fg);
16554
16731
  }
16555
16732
  textBufferViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor, behavior) {
16556
- const bg2 = optionalRgbaBuffer(bgColor);
16557
- const fg2 = optionalRgbaBuffer(fgColor);
16558
- return Boolean(this.opentui.symbols.textBufferViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2, selectionBehaviorByte(behavior)));
16733
+ const bg = optionalRgbaBuffer(bgColor);
16734
+ const fg = optionalRgbaBuffer(fgColor);
16735
+ return Boolean(this.opentui.symbols.textBufferViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bg, fg, selectionBehaviorByte(behavior)));
16559
16736
  }
16560
16737
  textBufferViewResetLocalSelection(view) {
16561
16738
  this.opentui.symbols.textBufferViewResetLocalSelection(view);
@@ -16573,6 +16750,10 @@ class FFIRenderLib {
16573
16750
  const modeValue = mode === "none" ? 0 : mode === "char" ? 1 : 2;
16574
16751
  this.opentui.symbols.textBufferViewSetWrapMode(view, modeValue);
16575
16752
  }
16753
+ textBufferViewSetTextAlign(view, alignment) {
16754
+ const alignValue = alignment === "left" ? 0 : alignment === "center" ? 1 : 2;
16755
+ this.opentui.symbols.textBufferViewSetTextAlign(view, alignValue);
16756
+ }
16576
16757
  textBufferViewSetFirstLineOffset(view, offset) {
16577
16758
  this.opentui.symbols.textBufferViewSetFirstLineOffset(view, offset);
16578
16759
  }
@@ -16615,6 +16796,20 @@ class FFIRenderLib {
16615
16796
  textBufferViewGetVirtualLineCount(view) {
16616
16797
  return this.opentui.symbols.textBufferViewGetVirtualLineCount(view);
16617
16798
  }
16799
+ textBufferViewGetLineSources(view, startLine, lineCount) {
16800
+ toSafeFFIU32Length(startLine, "visual row start");
16801
+ toSafeFFIU32Length(lineCount, "visual row count");
16802
+ if (lineCount === 0)
16803
+ return [];
16804
+ const outBuffer = new ArrayBuffer(LineInfoStruct.size);
16805
+ this.textBufferViewGetLogicalLineInfoDirect(view, outBuffer);
16806
+ const data = new DataView(outBuffer);
16807
+ const sources = LineInfoStruct.arrayFields.get("sources");
16808
+ const count = Math.max(0, Math.min(lineCount, data.getUint32(sources.lengthOffset, true) - startLine));
16809
+ if (count === 0)
16810
+ return [];
16811
+ return Array.from(new Uint32Array(toArrayBuffer(toPointer(data.getBigUint64(sources.arrayOffset, true)), startLine * 4, count * 4)));
16812
+ }
16618
16813
  textBufferViewGetLineInfoDirect(view, outBuffer) {
16619
16814
  this.opentui.symbols.textBufferViewGetLineInfoDirect(view, outBuffer);
16620
16815
  }
@@ -16654,7 +16849,7 @@ class FFIRenderLib {
16654
16849
  }
16655
16850
  textBufferViewMeasureForDimensions(view, width, height) {
16656
16851
  const storage = this.ffiStructStorage.measureResult;
16657
- const success = this.opentui.symbols.textBufferViewMeasureForDimensions(view, width, height, storage.buffer);
16852
+ const success = this.opentui.symbols.textBufferViewMeasureForDimensions(view, width, height, storage.ffiView);
16658
16853
  if (!success)
16659
16854
  return null;
16660
16855
  const result = MeasureResultStruct.unpackInto(storage.view, storage.result);
@@ -16884,7 +17079,7 @@ class FFIRenderLib {
16884
17079
  }
16885
17080
  editBufferGetCursorPosition(buffer) {
16886
17081
  const storage = this.ffiStructStorage.logicalCursor;
16887
- this.opentui.symbols.editBufferGetCursorPosition(buffer, storage.buffer);
17082
+ this.opentui.symbols.editBufferGetCursorPosition(buffer, storage.ffiView);
16888
17083
  const cursor = LogicalCursorStruct.unpackInto(storage.view, storage.result);
16889
17084
  return { row: cursor.row, col: cursor.col, offset: cursor.offset };
16890
17085
  }
@@ -16934,25 +17129,25 @@ class FFIRenderLib {
16934
17129
  }
16935
17130
  editBufferGetNextWordBoundary(buffer) {
16936
17131
  const storage = this.ffiStructStorage.logicalCursor;
16937
- this.opentui.symbols.editBufferGetNextWordBoundary(buffer, storage.buffer);
17132
+ this.opentui.symbols.editBufferGetNextWordBoundary(buffer, storage.ffiView);
16938
17133
  const cursor = LogicalCursorStruct.unpackInto(storage.view, storage.result);
16939
17134
  return { row: cursor.row, col: cursor.col, offset: cursor.offset };
16940
17135
  }
16941
17136
  editBufferGetPrevWordBoundary(buffer) {
16942
17137
  const storage = this.ffiStructStorage.logicalCursor;
16943
- this.opentui.symbols.editBufferGetPrevWordBoundary(buffer, storage.buffer);
17138
+ this.opentui.symbols.editBufferGetPrevWordBoundary(buffer, storage.ffiView);
16944
17139
  const cursor = LogicalCursorStruct.unpackInto(storage.view, storage.result);
16945
17140
  return { row: cursor.row, col: cursor.col, offset: cursor.offset };
16946
17141
  }
16947
17142
  editBufferGetEOL(buffer) {
16948
17143
  const storage = this.ffiStructStorage.logicalCursor;
16949
- this.opentui.symbols.editBufferGetEOL(buffer, storage.buffer);
17144
+ this.opentui.symbols.editBufferGetEOL(buffer, storage.ffiView);
16950
17145
  const cursor = LogicalCursorStruct.unpackInto(storage.view, storage.result);
16951
17146
  return { row: cursor.row, col: cursor.col, offset: cursor.offset };
16952
17147
  }
16953
17148
  editBufferOffsetToPosition(buffer, offset) {
16954
17149
  const storage = this.ffiStructStorage.logicalCursor;
16955
- const success = this.opentui.symbols.editBufferOffsetToPosition(buffer, offset, storage.buffer);
17150
+ const success = this.opentui.symbols.editBufferOffsetToPosition(buffer, offset, storage.ffiView);
16956
17151
  if (!success)
16957
17152
  return null;
16958
17153
  const cursor = LogicalCursorStruct.unpackInto(storage.view, storage.result);
@@ -16981,36 +17176,36 @@ class FFIRenderLib {
16981
17176
  return usesBunFFI ? outBuffer.slice(0, len) : trimNodeFFIOutputBytes(outBuffer, len);
16982
17177
  }
16983
17178
  editorViewSetSelection(view, start, end, bgColor, fgColor) {
16984
- const bg2 = optionalRgbaBuffer(bgColor);
16985
- const fg2 = optionalRgbaBuffer(fgColor);
16986
- this.opentui.symbols.editorViewSetSelection(view, start, end, bg2, fg2);
17179
+ const bg = optionalRgbaBuffer(bgColor);
17180
+ const fg = optionalRgbaBuffer(fgColor);
17181
+ this.opentui.symbols.editorViewSetSelection(view, start, end, bg, fg);
16987
17182
  }
16988
17183
  editorViewResetSelection(view) {
16989
17184
  this.opentui.symbols.editorViewResetSelection(view);
16990
17185
  }
16991
17186
  editorViewGetSelection(view) {
16992
17187
  const packedInfo = this.opentui.symbols.editorViewGetSelection(view);
16993
- if (packedInfo === 0xffff_ffff_ffff_ffffn) {
17188
+ if (packedInfo === 0xffffffffffffffffn) {
16994
17189
  return null;
16995
17190
  }
16996
17191
  const start = Number(packedInfo >> 32n);
16997
- const end = Number(packedInfo & 0xffff_ffffn);
17192
+ const end = Number(packedInfo & 0xffffffffn);
16998
17193
  return { start, end };
16999
17194
  }
17000
17195
  editorViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor, updateCursor, followCursor, behavior) {
17001
- const bg2 = optionalRgbaBuffer(bgColor);
17002
- const fg2 = optionalRgbaBuffer(fgColor);
17003
- return Boolean(this.opentui.symbols.editorViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2, editorLocalSelectionFlags(updateCursor, followCursor, behavior)));
17196
+ const bg = optionalRgbaBuffer(bgColor);
17197
+ const fg = optionalRgbaBuffer(fgColor);
17198
+ return Boolean(this.opentui.symbols.editorViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bg, fg, editorLocalSelectionFlags(updateCursor, followCursor, behavior)));
17004
17199
  }
17005
17200
  editorViewUpdateSelection(view, end, bgColor, fgColor) {
17006
- const bg2 = optionalRgbaBuffer(bgColor);
17007
- const fg2 = optionalRgbaBuffer(fgColor);
17008
- this.opentui.symbols.editorViewUpdateSelection(view, end, bg2, fg2);
17201
+ const bg = optionalRgbaBuffer(bgColor);
17202
+ const fg = optionalRgbaBuffer(fgColor);
17203
+ this.opentui.symbols.editorViewUpdateSelection(view, end, bg, fg);
17009
17204
  }
17010
17205
  editorViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor, updateCursor, followCursor, behavior) {
17011
- const bg2 = optionalRgbaBuffer(bgColor);
17012
- const fg2 = optionalRgbaBuffer(fgColor);
17013
- return Boolean(this.opentui.symbols.editorViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2, editorLocalSelectionFlags(updateCursor, followCursor, behavior)));
17206
+ const bg = optionalRgbaBuffer(bgColor);
17207
+ const fg = optionalRgbaBuffer(fgColor);
17208
+ return Boolean(this.opentui.symbols.editorViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bg, fg, editorLocalSelectionFlags(updateCursor, followCursor, behavior)));
17014
17209
  }
17015
17210
  editorViewResetLocalSelection(view) {
17016
17211
  this.opentui.symbols.editorViewResetLocalSelection(view);
@@ -17022,14 +17217,14 @@ class FFIRenderLib {
17022
17217
  this.opentui.symbols.editorViewSetSelectionOccupancy(view, occupancy === "boundary" ? 1 : 0);
17023
17218
  }
17024
17219
  editorViewSetSelectionInclusive(view, start, end, bgColor, fgColor) {
17025
- const bg2 = optionalRgbaBuffer(bgColor);
17026
- const fg2 = optionalRgbaBuffer(fgColor);
17027
- this.opentui.symbols.editorViewSetSelectionInclusive(view, start, end, bg2, fg2);
17220
+ const bg = optionalRgbaBuffer(bgColor);
17221
+ const fg = optionalRgbaBuffer(fgColor);
17222
+ this.opentui.symbols.editorViewSetSelectionInclusive(view, start, end, bg, fg);
17028
17223
  }
17029
17224
  editorViewSetSelectionColors(view, bgColor, fgColor) {
17030
- const bg2 = optionalRgbaBuffer(bgColor);
17031
- const fg2 = optionalRgbaBuffer(fgColor);
17032
- this.opentui.symbols.editorViewSetSelectionColors(view, bg2, fg2);
17225
+ const bg = optionalRgbaBuffer(bgColor);
17226
+ const fg = optionalRgbaBuffer(fgColor);
17227
+ this.opentui.symbols.editorViewSetSelectionColors(view, bg, fg);
17033
17228
  }
17034
17229
  editorViewGetSelectedTextBytes(view, maxLength) {
17035
17230
  const outBuffer = new Uint8Array(maxLength);
@@ -17055,7 +17250,7 @@ class FFIRenderLib {
17055
17250
  }
17056
17251
  editorViewGetVisualCursor(view) {
17057
17252
  const storage = this.ffiStructStorage.visualCursor;
17058
- this.opentui.symbols.editorViewGetVisualCursor(view, storage.buffer);
17253
+ this.opentui.symbols.editorViewGetVisualCursor(view, storage.ffiView);
17059
17254
  const cursor = VisualCursorStruct.unpackInto(storage.view, storage.result);
17060
17255
  return { ...cursor };
17061
17256
  }
@@ -17073,31 +17268,31 @@ class FFIRenderLib {
17073
17268
  }
17074
17269
  editorViewGetNextWordBoundary(view) {
17075
17270
  const storage = this.ffiStructStorage.visualCursor;
17076
- this.opentui.symbols.editorViewGetNextWordBoundary(view, storage.buffer);
17271
+ this.opentui.symbols.editorViewGetNextWordBoundary(view, storage.ffiView);
17077
17272
  const cursor = VisualCursorStruct.unpackInto(storage.view, storage.result);
17078
17273
  return { ...cursor };
17079
17274
  }
17080
17275
  editorViewGetPrevWordBoundary(view) {
17081
17276
  const storage = this.ffiStructStorage.visualCursor;
17082
- this.opentui.symbols.editorViewGetPrevWordBoundary(view, storage.buffer);
17277
+ this.opentui.symbols.editorViewGetPrevWordBoundary(view, storage.ffiView);
17083
17278
  const cursor = VisualCursorStruct.unpackInto(storage.view, storage.result);
17084
17279
  return { ...cursor };
17085
17280
  }
17086
17281
  editorViewGetEOL(view) {
17087
17282
  const storage = this.ffiStructStorage.visualCursor;
17088
- this.opentui.symbols.editorViewGetEOL(view, storage.buffer);
17283
+ this.opentui.symbols.editorViewGetEOL(view, storage.ffiView);
17089
17284
  const cursor = VisualCursorStruct.unpackInto(storage.view, storage.result);
17090
17285
  return { ...cursor };
17091
17286
  }
17092
17287
  editorViewGetVisualSOL(view) {
17093
17288
  const storage = this.ffiStructStorage.visualCursor;
17094
- this.opentui.symbols.editorViewGetVisualSOL(view, storage.buffer);
17289
+ this.opentui.symbols.editorViewGetVisualSOL(view, storage.ffiView);
17095
17290
  const cursor = VisualCursorStruct.unpackInto(storage.view, storage.result);
17096
17291
  return { ...cursor };
17097
17292
  }
17098
17293
  editorViewGetVisualEOL(view) {
17099
17294
  const storage = this.ffiStructStorage.visualCursor;
17100
- this.opentui.symbols.editorViewGetVisualEOL(view, storage.buffer);
17295
+ this.opentui.symbols.editorViewGetVisualEOL(view, storage.ffiView);
17101
17296
  const cursor = VisualCursorStruct.unpackInto(storage.view, storage.result);
17102
17297
  return { ...cursor };
17103
17298
  }
@@ -17203,8 +17398,8 @@ class FFIRenderLib {
17203
17398
  freeUnicode(encoded) {
17204
17399
  this.opentui.symbols.freeUnicode(encoded.ptr, encoded.data.length);
17205
17400
  }
17206
- bufferDrawChar(buffer, char, x, y, fg2, bg2, attributes = 0) {
17207
- this.opentui.symbols.bufferDrawChar(buffer, char, x, y, rgbaBuffer(fg2), rgbaBuffer(bg2), attributes);
17401
+ bufferDrawChar(buffer, char, x, y, fg, bg, attributes = 0) {
17402
+ this.opentui.symbols.bufferDrawChar(buffer, char, x, y, rgbaBuffer(fg), rgbaBuffer(bg), attributes);
17208
17403
  }
17209
17404
  createAudioEngine(options) {
17210
17405
  const optionsBuffer = options == null ? null : AudioCreateOptionsStruct.pack(options);
@@ -17321,15 +17516,15 @@ class FFIRenderLib {
17321
17516
  return this.opentui.symbols.audioStop(engine);
17322
17517
  }
17323
17518
  audioCreateStream(engine, options) {
17324
- if (!isFFIU32(options.groupId) || options.format !== NativeAudioStreamFormat2.Mp3 && options.format !== NativeAudioStreamFormat2.Flac) {
17519
+ if (!isFFIU32(options.groupId) || !isFFIU32(options.sampleRate ?? 0) || !isFFIU32(options.channels ?? 0) || !Object.values(NativeAudioStreamFormat3).includes(options.format)) {
17325
17520
  return { status: -1, streamId: null };
17326
17521
  }
17327
- const optionsBuffer = AudioStreamCreateOptionsStruct.pack(options);
17328
- const outBuffer = new ArrayBuffer(4);
17522
+ const optionsBuffer = new Uint8Array(AudioStreamCreateOptionsStruct.pack(options));
17523
+ const outBuffer = new Uint32Array(1);
17329
17524
  const status = this.opentui.symbols.audioCreateStream(engine, optionsBuffer, outBuffer);
17330
17525
  if (status !== 0)
17331
17526
  return { status, streamId: null };
17332
- return { status, streamId: new Uint32Array(outBuffer)[0] ?? null };
17527
+ return { status, streamId: outBuffer[0] ?? null };
17333
17528
  }
17334
17529
  audioWriteStream(engine, streamId, data) {
17335
17530
  const dataLength = toSafeFFIU32Length(data.byteLength, "Audio stream data length");
@@ -17354,7 +17549,7 @@ class FFIRenderLib {
17354
17549
  }
17355
17550
  audioGetStreamStats(engine, streamId) {
17356
17551
  const storage = this.ffiStructStorage.audioStreamStats;
17357
- const status = this.opentui.symbols.audioGetStreamStats(engine, streamId, storage.buffer);
17552
+ const status = this.opentui.symbols.audioGetStreamStats(engine, streamId, storage.ffiView);
17358
17553
  if (status !== 0)
17359
17554
  return null;
17360
17555
  const stats = AudioStreamStatsStruct.unpackInto(storage.view, storage.result);
@@ -17362,7 +17557,7 @@ class FFIRenderLib {
17362
17557
  }
17363
17558
  audioCloseStream(engine, streamId, reason) {
17364
17559
  const storage = this.ffiStructStorage.audioStreamStats;
17365
- const status = this.opentui.symbols.audioCloseStream(engine, streamId, reason, storage.buffer);
17560
+ const status = this.opentui.symbols.audioCloseStream(engine, streamId, reason, storage.ffiView);
17366
17561
  if (status !== 0)
17367
17562
  return { status, stats: null };
17368
17563
  const stats = AudioStreamStatsStruct.unpackInto(storage.view, storage.result);
@@ -17526,10 +17721,10 @@ class FFIRenderLib {
17526
17721
  destroySyntaxStyle(style) {
17527
17722
  this.opentui.symbols.destroySyntaxStyle(style);
17528
17723
  }
17529
- syntaxStyleRegister(style, name, fg2, bg2, attributes) {
17724
+ syntaxStyleRegister(style, name, fg, bg, attributes) {
17530
17725
  const nameBytes = this.encoder.encode(name);
17531
- const fgBuffer = optionalRgbaBuffer(fg2);
17532
- const bgBuffer = optionalRgbaBuffer(bg2);
17726
+ const fgBuffer = optionalRgbaBuffer(fg);
17727
+ const bgBuffer = optionalRgbaBuffer(bg);
17533
17728
  return this.opentui.symbols.syntaxStyleRegister(style, viewOrNull(nameBytes), nameBytes.byteLength, fgBuffer, bgBuffer, attributes);
17534
17729
  }
17535
17730
  syntaxStyleResolveByName(style, name) {
@@ -17658,7 +17853,7 @@ class FFIRenderLib {
17658
17853
  var opentuiLibPath;
17659
17854
  var opentuiLib;
17660
17855
  var renderLibResolved = false;
17661
- function setRenderLibPath(libPath) {
17856
+ function setRenderLibPath2(libPath) {
17662
17857
  if (opentuiLibPath !== libPath) {
17663
17858
  if (renderLibResolved) {
17664
17859
  throw new Error("setRenderLibPath() must be called before resolveRenderLib()");
@@ -17670,7 +17865,7 @@ function setRenderLibPath(libPath) {
17670
17865
  opentuiLib = undefined;
17671
17866
  }
17672
17867
  }
17673
- function resolveRenderLib() {
17868
+ function resolveRenderLib2() {
17674
17869
  if (!opentuiLib) {
17675
17870
  try {
17676
17871
  opentuiLib = new FFIRenderLib(opentuiLibPath);
@@ -17686,204 +17881,204 @@ try {
17686
17881
  } catch (error) {}
17687
17882
 
17688
17883
  // src/yoga.ts
17689
- var Align;
17690
- ((Align2) => {
17691
- Align2[Align2["Auto"] = 0] = "Auto";
17692
- Align2[Align2["FlexStart"] = 1] = "FlexStart";
17693
- Align2[Align2["Center"] = 2] = "Center";
17694
- Align2[Align2["FlexEnd"] = 3] = "FlexEnd";
17695
- Align2[Align2["Stretch"] = 4] = "Stretch";
17696
- Align2[Align2["Baseline"] = 5] = "Baseline";
17697
- Align2[Align2["SpaceBetween"] = 6] = "SpaceBetween";
17698
- Align2[Align2["SpaceAround"] = 7] = "SpaceAround";
17699
- Align2[Align2["SpaceEvenly"] = 8] = "SpaceEvenly";
17700
- })(Align ||= {});
17701
- var BoxSizing;
17702
- ((BoxSizing2) => {
17703
- BoxSizing2[BoxSizing2["BorderBox"] = 0] = "BorderBox";
17704
- BoxSizing2[BoxSizing2["ContentBox"] = 1] = "ContentBox";
17705
- })(BoxSizing ||= {});
17706
- var Dimension;
17707
- ((Dimension2) => {
17708
- Dimension2[Dimension2["Width"] = 0] = "Width";
17709
- Dimension2[Dimension2["Height"] = 1] = "Height";
17710
- })(Dimension ||= {});
17711
- var Direction;
17712
- ((Direction2) => {
17713
- Direction2[Direction2["Inherit"] = 0] = "Inherit";
17714
- Direction2[Direction2["LTR"] = 1] = "LTR";
17715
- Direction2[Direction2["RTL"] = 2] = "RTL";
17716
- })(Direction ||= {});
17717
- var Display;
17718
- ((Display2) => {
17719
- Display2[Display2["Flex"] = 0] = "Flex";
17720
- Display2[Display2["None"] = 1] = "None";
17721
- Display2[Display2["Contents"] = 2] = "Contents";
17722
- })(Display ||= {});
17723
- var Edge;
17724
- ((Edge2) => {
17725
- Edge2[Edge2["Left"] = 0] = "Left";
17726
- Edge2[Edge2["Top"] = 1] = "Top";
17727
- Edge2[Edge2["Right"] = 2] = "Right";
17728
- Edge2[Edge2["Bottom"] = 3] = "Bottom";
17729
- Edge2[Edge2["Start"] = 4] = "Start";
17730
- Edge2[Edge2["End"] = 5] = "End";
17731
- Edge2[Edge2["Horizontal"] = 6] = "Horizontal";
17732
- Edge2[Edge2["Vertical"] = 7] = "Vertical";
17733
- Edge2[Edge2["All"] = 8] = "All";
17734
- })(Edge ||= {});
17735
- var Errata;
17736
- ((Errata2) => {
17737
- Errata2[Errata2["None"] = 0] = "None";
17738
- Errata2[Errata2["StretchFlexBasis"] = 1] = "StretchFlexBasis";
17739
- Errata2[Errata2["AbsolutePositionWithoutInsetsExcludesPadding"] = 2] = "AbsolutePositionWithoutInsetsExcludesPadding";
17740
- Errata2[Errata2["AbsolutePercentAgainstInnerSize"] = 4] = "AbsolutePercentAgainstInnerSize";
17741
- Errata2[Errata2["All"] = 2147483647] = "All";
17742
- Errata2[Errata2["Classic"] = 2147483646] = "Classic";
17743
- })(Errata ||= {});
17744
- var ExperimentalFeature;
17745
- ((ExperimentalFeature2) => {
17746
- ExperimentalFeature2[ExperimentalFeature2["WebFlexBasis"] = 0] = "WebFlexBasis";
17747
- })(ExperimentalFeature ||= {});
17748
- var FlexDirection;
17749
- ((FlexDirection2) => {
17750
- FlexDirection2[FlexDirection2["Column"] = 0] = "Column";
17751
- FlexDirection2[FlexDirection2["ColumnReverse"] = 1] = "ColumnReverse";
17752
- FlexDirection2[FlexDirection2["Row"] = 2] = "Row";
17753
- FlexDirection2[FlexDirection2["RowReverse"] = 3] = "RowReverse";
17754
- })(FlexDirection ||= {});
17755
- var Gutter;
17756
- ((Gutter2) => {
17757
- Gutter2[Gutter2["Column"] = 0] = "Column";
17758
- Gutter2[Gutter2["Row"] = 1] = "Row";
17759
- Gutter2[Gutter2["All"] = 2] = "All";
17760
- })(Gutter ||= {});
17761
- var Justify;
17762
- ((Justify2) => {
17763
- Justify2[Justify2["FlexStart"] = 0] = "FlexStart";
17764
- Justify2[Justify2["Center"] = 1] = "Center";
17765
- Justify2[Justify2["FlexEnd"] = 2] = "FlexEnd";
17766
- Justify2[Justify2["SpaceBetween"] = 3] = "SpaceBetween";
17767
- Justify2[Justify2["SpaceAround"] = 4] = "SpaceAround";
17768
- Justify2[Justify2["SpaceEvenly"] = 5] = "SpaceEvenly";
17769
- })(Justify ||= {});
17770
- var LogLevel;
17771
- ((LogLevel3) => {
17772
- LogLevel3[LogLevel3["Error"] = 0] = "Error";
17773
- LogLevel3[LogLevel3["Warn"] = 1] = "Warn";
17774
- LogLevel3[LogLevel3["Info"] = 2] = "Info";
17775
- LogLevel3[LogLevel3["Debug"] = 3] = "Debug";
17776
- LogLevel3[LogLevel3["Verbose"] = 4] = "Verbose";
17777
- LogLevel3[LogLevel3["Fatal"] = 5] = "Fatal";
17778
- })(LogLevel ||= {});
17779
- var MeasureMode;
17780
- ((MeasureMode2) => {
17781
- MeasureMode2[MeasureMode2["Undefined"] = 0] = "Undefined";
17782
- MeasureMode2[MeasureMode2["Exactly"] = 1] = "Exactly";
17783
- MeasureMode2[MeasureMode2["AtMost"] = 2] = "AtMost";
17784
- })(MeasureMode ||= {});
17785
- var NodeType;
17786
- ((NodeType2) => {
17787
- NodeType2[NodeType2["Default"] = 0] = "Default";
17788
- NodeType2[NodeType2["Text"] = 1] = "Text";
17789
- })(NodeType ||= {});
17790
- var Overflow;
17791
- ((Overflow2) => {
17792
- Overflow2[Overflow2["Visible"] = 0] = "Visible";
17793
- Overflow2[Overflow2["Hidden"] = 1] = "Hidden";
17794
- Overflow2[Overflow2["Scroll"] = 2] = "Scroll";
17795
- })(Overflow ||= {});
17796
- var PositionType;
17797
- ((PositionType2) => {
17798
- PositionType2[PositionType2["Static"] = 0] = "Static";
17799
- PositionType2[PositionType2["Relative"] = 1] = "Relative";
17800
- PositionType2[PositionType2["Absolute"] = 2] = "Absolute";
17801
- })(PositionType ||= {});
17802
- var Unit;
17803
- ((Unit2) => {
17804
- Unit2[Unit2["Undefined"] = 0] = "Undefined";
17805
- Unit2[Unit2["Point"] = 1] = "Point";
17806
- Unit2[Unit2["Percent"] = 2] = "Percent";
17807
- Unit2[Unit2["Auto"] = 3] = "Auto";
17808
- })(Unit ||= {});
17809
- var Wrap;
17884
+ var Align2;
17885
+ ((Align) => {
17886
+ Align[Align["Auto"] = 0] = "Auto";
17887
+ Align[Align["FlexStart"] = 1] = "FlexStart";
17888
+ Align[Align["Center"] = 2] = "Center";
17889
+ Align[Align["FlexEnd"] = 3] = "FlexEnd";
17890
+ Align[Align["Stretch"] = 4] = "Stretch";
17891
+ Align[Align["Baseline"] = 5] = "Baseline";
17892
+ Align[Align["SpaceBetween"] = 6] = "SpaceBetween";
17893
+ Align[Align["SpaceAround"] = 7] = "SpaceAround";
17894
+ Align[Align["SpaceEvenly"] = 8] = "SpaceEvenly";
17895
+ })(Align2 ||= {});
17896
+ var BoxSizing2;
17897
+ ((BoxSizing) => {
17898
+ BoxSizing[BoxSizing["BorderBox"] = 0] = "BorderBox";
17899
+ BoxSizing[BoxSizing["ContentBox"] = 1] = "ContentBox";
17900
+ })(BoxSizing2 ||= {});
17901
+ var Dimension2;
17902
+ ((Dimension) => {
17903
+ Dimension[Dimension["Width"] = 0] = "Width";
17904
+ Dimension[Dimension["Height"] = 1] = "Height";
17905
+ })(Dimension2 ||= {});
17906
+ var Direction2;
17907
+ ((Direction) => {
17908
+ Direction[Direction["Inherit"] = 0] = "Inherit";
17909
+ Direction[Direction["LTR"] = 1] = "LTR";
17910
+ Direction[Direction["RTL"] = 2] = "RTL";
17911
+ })(Direction2 ||= {});
17912
+ var Display2;
17913
+ ((Display) => {
17914
+ Display[Display["Flex"] = 0] = "Flex";
17915
+ Display[Display["None"] = 1] = "None";
17916
+ Display[Display["Contents"] = 2] = "Contents";
17917
+ })(Display2 ||= {});
17918
+ var Edge2;
17919
+ ((Edge) => {
17920
+ Edge[Edge["Left"] = 0] = "Left";
17921
+ Edge[Edge["Top"] = 1] = "Top";
17922
+ Edge[Edge["Right"] = 2] = "Right";
17923
+ Edge[Edge["Bottom"] = 3] = "Bottom";
17924
+ Edge[Edge["Start"] = 4] = "Start";
17925
+ Edge[Edge["End"] = 5] = "End";
17926
+ Edge[Edge["Horizontal"] = 6] = "Horizontal";
17927
+ Edge[Edge["Vertical"] = 7] = "Vertical";
17928
+ Edge[Edge["All"] = 8] = "All";
17929
+ })(Edge2 ||= {});
17930
+ var Errata2;
17931
+ ((Errata) => {
17932
+ Errata[Errata["None"] = 0] = "None";
17933
+ Errata[Errata["StretchFlexBasis"] = 1] = "StretchFlexBasis";
17934
+ Errata[Errata["AbsolutePositionWithoutInsetsExcludesPadding"] = 2] = "AbsolutePositionWithoutInsetsExcludesPadding";
17935
+ Errata[Errata["AbsolutePercentAgainstInnerSize"] = 4] = "AbsolutePercentAgainstInnerSize";
17936
+ Errata[Errata["All"] = 2147483647] = "All";
17937
+ Errata[Errata["Classic"] = 2147483646] = "Classic";
17938
+ })(Errata2 ||= {});
17939
+ var ExperimentalFeature2;
17940
+ ((ExperimentalFeature) => {
17941
+ ExperimentalFeature[ExperimentalFeature["WebFlexBasis"] = 0] = "WebFlexBasis";
17942
+ })(ExperimentalFeature2 ||= {});
17943
+ var FlexDirection2;
17944
+ ((FlexDirection) => {
17945
+ FlexDirection[FlexDirection["Column"] = 0] = "Column";
17946
+ FlexDirection[FlexDirection["ColumnReverse"] = 1] = "ColumnReverse";
17947
+ FlexDirection[FlexDirection["Row"] = 2] = "Row";
17948
+ FlexDirection[FlexDirection["RowReverse"] = 3] = "RowReverse";
17949
+ })(FlexDirection2 ||= {});
17950
+ var Gutter2;
17951
+ ((Gutter) => {
17952
+ Gutter[Gutter["Column"] = 0] = "Column";
17953
+ Gutter[Gutter["Row"] = 1] = "Row";
17954
+ Gutter[Gutter["All"] = 2] = "All";
17955
+ })(Gutter2 ||= {});
17956
+ var Justify2;
17957
+ ((Justify) => {
17958
+ Justify[Justify["FlexStart"] = 0] = "FlexStart";
17959
+ Justify[Justify["Center"] = 1] = "Center";
17960
+ Justify[Justify["FlexEnd"] = 2] = "FlexEnd";
17961
+ Justify[Justify["SpaceBetween"] = 3] = "SpaceBetween";
17962
+ Justify[Justify["SpaceAround"] = 4] = "SpaceAround";
17963
+ Justify[Justify["SpaceEvenly"] = 5] = "SpaceEvenly";
17964
+ })(Justify2 ||= {});
17965
+ var LogLevel3;
17966
+ ((LogLevel) => {
17967
+ LogLevel[LogLevel["Error"] = 0] = "Error";
17968
+ LogLevel[LogLevel["Warn"] = 1] = "Warn";
17969
+ LogLevel[LogLevel["Info"] = 2] = "Info";
17970
+ LogLevel[LogLevel["Debug"] = 3] = "Debug";
17971
+ LogLevel[LogLevel["Verbose"] = 4] = "Verbose";
17972
+ LogLevel[LogLevel["Fatal"] = 5] = "Fatal";
17973
+ })(LogLevel3 ||= {});
17974
+ var MeasureMode2;
17975
+ ((MeasureMode) => {
17976
+ MeasureMode[MeasureMode["Undefined"] = 0] = "Undefined";
17977
+ MeasureMode[MeasureMode["Exactly"] = 1] = "Exactly";
17978
+ MeasureMode[MeasureMode["AtMost"] = 2] = "AtMost";
17979
+ })(MeasureMode2 ||= {});
17980
+ var NodeType2;
17981
+ ((NodeType) => {
17982
+ NodeType[NodeType["Default"] = 0] = "Default";
17983
+ NodeType[NodeType["Text"] = 1] = "Text";
17984
+ })(NodeType2 ||= {});
17985
+ var Overflow2;
17986
+ ((Overflow) => {
17987
+ Overflow[Overflow["Visible"] = 0] = "Visible";
17988
+ Overflow[Overflow["Hidden"] = 1] = "Hidden";
17989
+ Overflow[Overflow["Scroll"] = 2] = "Scroll";
17990
+ })(Overflow2 ||= {});
17991
+ var PositionType2;
17992
+ ((PositionType) => {
17993
+ PositionType[PositionType["Static"] = 0] = "Static";
17994
+ PositionType[PositionType["Relative"] = 1] = "Relative";
17995
+ PositionType[PositionType["Absolute"] = 2] = "Absolute";
17996
+ })(PositionType2 ||= {});
17997
+ var Unit2;
17998
+ ((Unit) => {
17999
+ Unit[Unit["Undefined"] = 0] = "Undefined";
18000
+ Unit[Unit["Point"] = 1] = "Point";
18001
+ Unit[Unit["Percent"] = 2] = "Percent";
18002
+ Unit[Unit["Auto"] = 3] = "Auto";
18003
+ })(Unit2 ||= {});
18004
+ var Wrap2;
17810
18005
  ((_Wrap) => {
17811
18006
  _Wrap[_Wrap["NoWrap"] = 0] = "NoWrap";
17812
18007
  _Wrap[_Wrap["Wrap"] = 1] = "Wrap";
17813
18008
  _Wrap[_Wrap["WrapReverse"] = 2] = "WrapReverse";
17814
- })(Wrap ||= {});
17815
- var ALIGN_AUTO = 0 /* Auto */;
17816
- var ALIGN_FLEX_START = 1 /* FlexStart */;
17817
- var ALIGN_CENTER = 2 /* Center */;
17818
- var ALIGN_FLEX_END = 3 /* FlexEnd */;
17819
- var ALIGN_STRETCH = 4 /* Stretch */;
17820
- var ALIGN_BASELINE = 5 /* Baseline */;
17821
- var ALIGN_SPACE_BETWEEN = 6 /* SpaceBetween */;
17822
- var ALIGN_SPACE_AROUND = 7 /* SpaceAround */;
17823
- var ALIGN_SPACE_EVENLY = 8 /* SpaceEvenly */;
17824
- var BOX_SIZING_BORDER_BOX = 0 /* BorderBox */;
17825
- var BOX_SIZING_CONTENT_BOX = 1 /* ContentBox */;
17826
- var DIMENSION_WIDTH = 0 /* Width */;
17827
- var DIMENSION_HEIGHT = 1 /* Height */;
17828
- var DIRECTION_INHERIT = 0 /* Inherit */;
17829
- var DIRECTION_LTR = 1 /* LTR */;
17830
- var DIRECTION_RTL = 2 /* RTL */;
17831
- var DISPLAY_FLEX = 0 /* Flex */;
17832
- var DISPLAY_NONE = 1 /* None */;
17833
- var DISPLAY_CONTENTS = 2 /* Contents */;
17834
- var EDGE_LEFT = 0 /* Left */;
17835
- var EDGE_TOP = 1 /* Top */;
17836
- var EDGE_RIGHT = 2 /* Right */;
17837
- var EDGE_BOTTOM = 3 /* Bottom */;
17838
- var EDGE_START = 4 /* Start */;
17839
- var EDGE_END = 5 /* End */;
17840
- var EDGE_HORIZONTAL = 6 /* Horizontal */;
17841
- var EDGE_VERTICAL = 7 /* Vertical */;
17842
- var EDGE_ALL = 8 /* All */;
17843
- var ERRATA_NONE = 0 /* None */;
17844
- var ERRATA_STRETCH_FLEX_BASIS = 1 /* StretchFlexBasis */;
17845
- var ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING = 2 /* AbsolutePositionWithoutInsetsExcludesPadding */;
17846
- var ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE = 4 /* AbsolutePercentAgainstInnerSize */;
17847
- var ERRATA_ALL = 2147483647 /* All */;
17848
- var ERRATA_CLASSIC = 2147483646 /* Classic */;
17849
- var EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS = 0 /* WebFlexBasis */;
17850
- var FLEX_DIRECTION_COLUMN = 0 /* Column */;
17851
- var FLEX_DIRECTION_COLUMN_REVERSE = 1 /* ColumnReverse */;
17852
- var FLEX_DIRECTION_ROW = 2 /* Row */;
17853
- var FLEX_DIRECTION_ROW_REVERSE = 3 /* RowReverse */;
17854
- var GUTTER_COLUMN = 0 /* Column */;
17855
- var GUTTER_ROW = 1 /* Row */;
17856
- var GUTTER_ALL = 2 /* All */;
17857
- var JUSTIFY_FLEX_START = 0 /* FlexStart */;
17858
- var JUSTIFY_CENTER = 1 /* Center */;
17859
- var JUSTIFY_FLEX_END = 2 /* FlexEnd */;
17860
- var JUSTIFY_SPACE_BETWEEN = 3 /* SpaceBetween */;
17861
- var JUSTIFY_SPACE_AROUND = 4 /* SpaceAround */;
17862
- var JUSTIFY_SPACE_EVENLY = 5 /* SpaceEvenly */;
17863
- var LOG_LEVEL_ERROR = 0 /* Error */;
17864
- var LOG_LEVEL_WARN = 1 /* Warn */;
17865
- var LOG_LEVEL_INFO = 2 /* Info */;
17866
- var LOG_LEVEL_DEBUG = 3 /* Debug */;
17867
- var LOG_LEVEL_VERBOSE = 4 /* Verbose */;
17868
- var LOG_LEVEL_FATAL = 5 /* Fatal */;
17869
- var MEASURE_MODE_UNDEFINED = 0 /* Undefined */;
17870
- var MEASURE_MODE_EXACTLY = 1 /* Exactly */;
17871
- var MEASURE_MODE_AT_MOST = 2 /* AtMost */;
17872
- var NODE_TYPE_DEFAULT = 0 /* Default */;
17873
- var NODE_TYPE_TEXT = 1 /* Text */;
17874
- var OVERFLOW_VISIBLE = 0 /* Visible */;
17875
- var OVERFLOW_HIDDEN = 1 /* Hidden */;
17876
- var OVERFLOW_SCROLL = 2 /* Scroll */;
17877
- var POSITION_TYPE_STATIC = 0 /* Static */;
17878
- var POSITION_TYPE_RELATIVE = 1 /* Relative */;
17879
- var POSITION_TYPE_ABSOLUTE = 2 /* Absolute */;
17880
- var UNIT_UNDEFINED = 0 /* Undefined */;
17881
- var UNIT_POINT = 1 /* Point */;
17882
- var UNIT_PERCENT = 2 /* Percent */;
17883
- var UNIT_AUTO = 3 /* Auto */;
17884
- var WRAP_NO_WRAP = 0 /* NoWrap */;
17885
- var WRAP_WRAP = 1 /* Wrap */;
17886
- var WRAP_WRAP_REVERSE = 2 /* WrapReverse */;
18009
+ })(Wrap2 ||= {});
18010
+ var ALIGN_AUTO2 = 0 /* Auto */;
18011
+ var ALIGN_FLEX_START2 = 1 /* FlexStart */;
18012
+ var ALIGN_CENTER2 = 2 /* Center */;
18013
+ var ALIGN_FLEX_END2 = 3 /* FlexEnd */;
18014
+ var ALIGN_STRETCH2 = 4 /* Stretch */;
18015
+ var ALIGN_BASELINE2 = 5 /* Baseline */;
18016
+ var ALIGN_SPACE_BETWEEN2 = 6 /* SpaceBetween */;
18017
+ var ALIGN_SPACE_AROUND2 = 7 /* SpaceAround */;
18018
+ var ALIGN_SPACE_EVENLY2 = 8 /* SpaceEvenly */;
18019
+ var BOX_SIZING_BORDER_BOX2 = 0 /* BorderBox */;
18020
+ var BOX_SIZING_CONTENT_BOX2 = 1 /* ContentBox */;
18021
+ var DIMENSION_WIDTH2 = 0 /* Width */;
18022
+ var DIMENSION_HEIGHT2 = 1 /* Height */;
18023
+ var DIRECTION_INHERIT2 = 0 /* Inherit */;
18024
+ var DIRECTION_LTR2 = 1 /* LTR */;
18025
+ var DIRECTION_RTL2 = 2 /* RTL */;
18026
+ var DISPLAY_FLEX2 = 0 /* Flex */;
18027
+ var DISPLAY_NONE2 = 1 /* None */;
18028
+ var DISPLAY_CONTENTS2 = 2 /* Contents */;
18029
+ var EDGE_LEFT2 = 0 /* Left */;
18030
+ var EDGE_TOP2 = 1 /* Top */;
18031
+ var EDGE_RIGHT2 = 2 /* Right */;
18032
+ var EDGE_BOTTOM2 = 3 /* Bottom */;
18033
+ var EDGE_START2 = 4 /* Start */;
18034
+ var EDGE_END2 = 5 /* End */;
18035
+ var EDGE_HORIZONTAL2 = 6 /* Horizontal */;
18036
+ var EDGE_VERTICAL2 = 7 /* Vertical */;
18037
+ var EDGE_ALL2 = 8 /* All */;
18038
+ var ERRATA_NONE2 = 0 /* None */;
18039
+ var ERRATA_STRETCH_FLEX_BASIS2 = 1 /* StretchFlexBasis */;
18040
+ var ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING2 = 2 /* AbsolutePositionWithoutInsetsExcludesPadding */;
18041
+ var ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE2 = 4 /* AbsolutePercentAgainstInnerSize */;
18042
+ var ERRATA_ALL2 = 2147483647 /* All */;
18043
+ var ERRATA_CLASSIC2 = 2147483646 /* Classic */;
18044
+ var EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS2 = 0 /* WebFlexBasis */;
18045
+ var FLEX_DIRECTION_COLUMN2 = 0 /* Column */;
18046
+ var FLEX_DIRECTION_COLUMN_REVERSE2 = 1 /* ColumnReverse */;
18047
+ var FLEX_DIRECTION_ROW2 = 2 /* Row */;
18048
+ var FLEX_DIRECTION_ROW_REVERSE2 = 3 /* RowReverse */;
18049
+ var GUTTER_COLUMN2 = 0 /* Column */;
18050
+ var GUTTER_ROW2 = 1 /* Row */;
18051
+ var GUTTER_ALL2 = 2 /* All */;
18052
+ var JUSTIFY_FLEX_START2 = 0 /* FlexStart */;
18053
+ var JUSTIFY_CENTER2 = 1 /* Center */;
18054
+ var JUSTIFY_FLEX_END2 = 2 /* FlexEnd */;
18055
+ var JUSTIFY_SPACE_BETWEEN2 = 3 /* SpaceBetween */;
18056
+ var JUSTIFY_SPACE_AROUND2 = 4 /* SpaceAround */;
18057
+ var JUSTIFY_SPACE_EVENLY2 = 5 /* SpaceEvenly */;
18058
+ var LOG_LEVEL_ERROR2 = 0 /* Error */;
18059
+ var LOG_LEVEL_WARN2 = 1 /* Warn */;
18060
+ var LOG_LEVEL_INFO2 = 2 /* Info */;
18061
+ var LOG_LEVEL_DEBUG2 = 3 /* Debug */;
18062
+ var LOG_LEVEL_VERBOSE2 = 4 /* Verbose */;
18063
+ var LOG_LEVEL_FATAL2 = 5 /* Fatal */;
18064
+ var MEASURE_MODE_UNDEFINED2 = 0 /* Undefined */;
18065
+ var MEASURE_MODE_EXACTLY2 = 1 /* Exactly */;
18066
+ var MEASURE_MODE_AT_MOST2 = 2 /* AtMost */;
18067
+ var NODE_TYPE_DEFAULT2 = 0 /* Default */;
18068
+ var NODE_TYPE_TEXT2 = 1 /* Text */;
18069
+ var OVERFLOW_VISIBLE2 = 0 /* Visible */;
18070
+ var OVERFLOW_HIDDEN2 = 1 /* Hidden */;
18071
+ var OVERFLOW_SCROLL2 = 2 /* Scroll */;
18072
+ var POSITION_TYPE_STATIC2 = 0 /* Static */;
18073
+ var POSITION_TYPE_RELATIVE2 = 1 /* Relative */;
18074
+ var POSITION_TYPE_ABSOLUTE2 = 2 /* Absolute */;
18075
+ var UNIT_UNDEFINED2 = 0 /* Undefined */;
18076
+ var UNIT_POINT2 = 1 /* Point */;
18077
+ var UNIT_PERCENT2 = 2 /* Percent */;
18078
+ var UNIT_AUTO2 = 3 /* Auto */;
18079
+ var WRAP_NO_WRAP2 = 0 /* NoWrap */;
18080
+ var WRAP_WRAP2 = 1 /* Wrap */;
18081
+ var WRAP_WRAP_REVERSE2 = 2 /* WrapReverse */;
17887
18082
  var YogaEnumKind = {
17888
18083
  Direction: 0,
17889
18084
  FlexDirection: 1,
@@ -17930,7 +18125,7 @@ var measureCallbackLib = null;
17930
18125
  var dirtiedCallback = null;
17931
18126
  var dirtiedCallbackLib = null;
17932
18127
  function lib() {
17933
- return resolveRenderLib();
18128
+ return resolveRenderLib2();
17934
18129
  }
17935
18130
  function ensureMeasureCallback() {
17936
18131
  const renderLib = lib();
@@ -18008,14 +18203,14 @@ function normalizeLayoutInput(value) {
18008
18203
  return value === undefined || value === "auto" ? NaN : value;
18009
18204
  }
18010
18205
 
18011
- class Config {
18206
+ class Config2 {
18012
18207
  ptr;
18013
18208
  freed = false;
18014
- constructor(ptr3) {
18015
- this.ptr = ptr3;
18209
+ constructor(ptr) {
18210
+ this.ptr = ptr;
18016
18211
  }
18017
18212
  static create() {
18018
- return new Config(lib().yogaConfigCreate());
18213
+ return new Config2(lib().yogaConfigCreate());
18019
18214
  }
18020
18215
  static destroy(config) {
18021
18216
  config.free();
@@ -18068,33 +18263,33 @@ class Config {
18068
18263
  }
18069
18264
  }
18070
18265
 
18071
- class Node {
18266
+ class Node2 {
18072
18267
  ptr;
18073
18268
  freed = false;
18074
- constructor(ptr3) {
18075
- this.ptr = ptr3;
18076
- nodeRegistry.set(ptr3, this);
18269
+ constructor(ptr) {
18270
+ this.ptr = ptr;
18271
+ nodeRegistry.set(ptr, this);
18077
18272
  }
18078
18273
  static create(config) {
18079
- return Node.fromPointer(config ? lib().yogaNodeCreateWithConfig(config.ptr) : lib().yogaNodeCreate());
18274
+ return Node2.fromPointer(config ? lib().yogaNodeCreateWithConfig(config.ptr) : lib().yogaNodeCreate());
18080
18275
  }
18081
18276
  static createForOpenTUI() {
18082
- return Node.fromPointer(lib().yogaNodeCreateForOpenTUI());
18277
+ return Node2.fromPointer(lib().yogaNodeCreateForOpenTUI());
18083
18278
  }
18084
18279
  static createDefault() {
18085
- return Node.create();
18280
+ return Node2.create();
18086
18281
  }
18087
18282
  static createWithConfig(config) {
18088
- return Node.create(config);
18283
+ return Node2.create(config);
18089
18284
  }
18090
18285
  static destroy(node) {
18091
18286
  node.free();
18092
18287
  }
18093
- static fromPointer(ptr3) {
18094
- const existing = nodeRegistry.get(ptr3);
18288
+ static fromPointer(ptr) {
18289
+ const existing = nodeRegistry.get(ptr);
18095
18290
  if (existing)
18096
18291
  return existing;
18097
- return new Node(ptr3);
18292
+ return new Node2(ptr);
18098
18293
  }
18099
18294
  isFreed() {
18100
18295
  return this.freed;
@@ -18150,7 +18345,7 @@ class Node {
18150
18345
  if (this.freed)
18151
18346
  return null;
18152
18347
  const child = lib().yogaNodeGetChild(this.ptr, index);
18153
- return child ? Node.fromPointer(child) : null;
18348
+ return child ? Node2.fromPointer(child) : null;
18154
18349
  }
18155
18350
  getChildCount() {
18156
18351
  if (this.freed)
@@ -18161,7 +18356,7 @@ class Node {
18161
18356
  if (this.freed)
18162
18357
  return null;
18163
18358
  const parent = lib().yogaNodeGetParent(this.ptr);
18164
- return parent ? Node.fromPointer(parent) : null;
18359
+ return parent ? Node2.fromPointer(parent) : null;
18165
18360
  }
18166
18361
  calculateLayout(width, height, direction = 1 /* LTR */) {
18167
18362
  if (this.freed)
@@ -18430,10 +18625,10 @@ class Node {
18430
18625
  getGap(gutter) {
18431
18626
  return this.getValue(YogaValueKind.Gap, gutter);
18432
18627
  }
18433
- setBorder(edge, border2) {
18628
+ setBorder(edge, border) {
18434
18629
  if (this.freed)
18435
18630
  return;
18436
- lib().yogaNodeStyleSetBorder(this.ptr, edge, border2 ?? NaN);
18631
+ lib().yogaNodeStyleSetBorder(this.ptr, edge, border ?? NaN);
18437
18632
  }
18438
18633
  getBorder(edge) {
18439
18634
  if (this.freed)
@@ -18546,102 +18741,102 @@ class Node {
18546
18741
  }
18547
18742
  }
18548
18743
  var Yoga = {
18549
- Config,
18550
- Node,
18551
- Align,
18552
- BoxSizing,
18553
- Dimension,
18554
- Direction,
18555
- Display,
18556
- Edge,
18557
- Errata,
18558
- ExperimentalFeature,
18559
- FlexDirection,
18560
- Gutter,
18561
- Justify,
18562
- LogLevel,
18563
- MeasureMode,
18564
- NodeType,
18565
- Overflow,
18566
- PositionType,
18567
- Unit,
18568
- Wrap,
18569
- ALIGN_AUTO,
18570
- ALIGN_FLEX_START,
18571
- ALIGN_CENTER,
18572
- ALIGN_FLEX_END,
18573
- ALIGN_STRETCH,
18574
- ALIGN_BASELINE,
18575
- ALIGN_SPACE_BETWEEN,
18576
- ALIGN_SPACE_AROUND,
18577
- ALIGN_SPACE_EVENLY,
18578
- BOX_SIZING_BORDER_BOX,
18579
- BOX_SIZING_CONTENT_BOX,
18580
- DIMENSION_WIDTH,
18581
- DIMENSION_HEIGHT,
18582
- DIRECTION_INHERIT,
18583
- DIRECTION_LTR,
18584
- DIRECTION_RTL,
18585
- DISPLAY_FLEX,
18586
- DISPLAY_NONE,
18587
- DISPLAY_CONTENTS,
18588
- EDGE_LEFT,
18589
- EDGE_TOP,
18590
- EDGE_RIGHT,
18591
- EDGE_BOTTOM,
18592
- EDGE_START,
18593
- EDGE_END,
18594
- EDGE_HORIZONTAL,
18595
- EDGE_VERTICAL,
18596
- EDGE_ALL,
18597
- ERRATA_NONE,
18598
- ERRATA_STRETCH_FLEX_BASIS,
18599
- ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING,
18600
- ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE,
18601
- ERRATA_ALL,
18602
- ERRATA_CLASSIC,
18603
- EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS,
18604
- FLEX_DIRECTION_COLUMN,
18605
- FLEX_DIRECTION_COLUMN_REVERSE,
18606
- FLEX_DIRECTION_ROW,
18607
- FLEX_DIRECTION_ROW_REVERSE,
18608
- GUTTER_COLUMN,
18609
- GUTTER_ROW,
18610
- GUTTER_ALL,
18611
- JUSTIFY_FLEX_START,
18612
- JUSTIFY_CENTER,
18613
- JUSTIFY_FLEX_END,
18614
- JUSTIFY_SPACE_BETWEEN,
18615
- JUSTIFY_SPACE_AROUND,
18616
- JUSTIFY_SPACE_EVENLY,
18617
- LOG_LEVEL_ERROR,
18618
- LOG_LEVEL_WARN,
18619
- LOG_LEVEL_INFO,
18620
- LOG_LEVEL_DEBUG,
18621
- LOG_LEVEL_VERBOSE,
18622
- LOG_LEVEL_FATAL,
18623
- MEASURE_MODE_UNDEFINED,
18624
- MEASURE_MODE_EXACTLY,
18625
- MEASURE_MODE_AT_MOST,
18626
- NODE_TYPE_DEFAULT,
18627
- NODE_TYPE_TEXT,
18628
- OVERFLOW_VISIBLE,
18629
- OVERFLOW_HIDDEN,
18630
- OVERFLOW_SCROLL,
18631
- POSITION_TYPE_STATIC,
18632
- POSITION_TYPE_RELATIVE,
18633
- POSITION_TYPE_ABSOLUTE,
18634
- UNIT_UNDEFINED,
18635
- UNIT_POINT,
18636
- UNIT_PERCENT,
18637
- UNIT_AUTO,
18638
- WRAP_NO_WRAP,
18639
- WRAP_WRAP,
18640
- WRAP_WRAP_REVERSE
18744
+ Config: Config2,
18745
+ Node: Node2,
18746
+ Align: Align2,
18747
+ BoxSizing: BoxSizing2,
18748
+ Dimension: Dimension2,
18749
+ Direction: Direction2,
18750
+ Display: Display2,
18751
+ Edge: Edge2,
18752
+ Errata: Errata2,
18753
+ ExperimentalFeature: ExperimentalFeature2,
18754
+ FlexDirection: FlexDirection2,
18755
+ Gutter: Gutter2,
18756
+ Justify: Justify2,
18757
+ LogLevel: LogLevel3,
18758
+ MeasureMode: MeasureMode2,
18759
+ NodeType: NodeType2,
18760
+ Overflow: Overflow2,
18761
+ PositionType: PositionType2,
18762
+ Unit: Unit2,
18763
+ Wrap: Wrap2,
18764
+ ALIGN_AUTO: ALIGN_AUTO2,
18765
+ ALIGN_FLEX_START: ALIGN_FLEX_START2,
18766
+ ALIGN_CENTER: ALIGN_CENTER2,
18767
+ ALIGN_FLEX_END: ALIGN_FLEX_END2,
18768
+ ALIGN_STRETCH: ALIGN_STRETCH2,
18769
+ ALIGN_BASELINE: ALIGN_BASELINE2,
18770
+ ALIGN_SPACE_BETWEEN: ALIGN_SPACE_BETWEEN2,
18771
+ ALIGN_SPACE_AROUND: ALIGN_SPACE_AROUND2,
18772
+ ALIGN_SPACE_EVENLY: ALIGN_SPACE_EVENLY2,
18773
+ BOX_SIZING_BORDER_BOX: BOX_SIZING_BORDER_BOX2,
18774
+ BOX_SIZING_CONTENT_BOX: BOX_SIZING_CONTENT_BOX2,
18775
+ DIMENSION_WIDTH: DIMENSION_WIDTH2,
18776
+ DIMENSION_HEIGHT: DIMENSION_HEIGHT2,
18777
+ DIRECTION_INHERIT: DIRECTION_INHERIT2,
18778
+ DIRECTION_LTR: DIRECTION_LTR2,
18779
+ DIRECTION_RTL: DIRECTION_RTL2,
18780
+ DISPLAY_FLEX: DISPLAY_FLEX2,
18781
+ DISPLAY_NONE: DISPLAY_NONE2,
18782
+ DISPLAY_CONTENTS: DISPLAY_CONTENTS2,
18783
+ EDGE_LEFT: EDGE_LEFT2,
18784
+ EDGE_TOP: EDGE_TOP2,
18785
+ EDGE_RIGHT: EDGE_RIGHT2,
18786
+ EDGE_BOTTOM: EDGE_BOTTOM2,
18787
+ EDGE_START: EDGE_START2,
18788
+ EDGE_END: EDGE_END2,
18789
+ EDGE_HORIZONTAL: EDGE_HORIZONTAL2,
18790
+ EDGE_VERTICAL: EDGE_VERTICAL2,
18791
+ EDGE_ALL: EDGE_ALL2,
18792
+ ERRATA_NONE: ERRATA_NONE2,
18793
+ ERRATA_STRETCH_FLEX_BASIS: ERRATA_STRETCH_FLEX_BASIS2,
18794
+ ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING: ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING2,
18795
+ ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE: ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE2,
18796
+ ERRATA_ALL: ERRATA_ALL2,
18797
+ ERRATA_CLASSIC: ERRATA_CLASSIC2,
18798
+ EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS: EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS2,
18799
+ FLEX_DIRECTION_COLUMN: FLEX_DIRECTION_COLUMN2,
18800
+ FLEX_DIRECTION_COLUMN_REVERSE: FLEX_DIRECTION_COLUMN_REVERSE2,
18801
+ FLEX_DIRECTION_ROW: FLEX_DIRECTION_ROW2,
18802
+ FLEX_DIRECTION_ROW_REVERSE: FLEX_DIRECTION_ROW_REVERSE2,
18803
+ GUTTER_COLUMN: GUTTER_COLUMN2,
18804
+ GUTTER_ROW: GUTTER_ROW2,
18805
+ GUTTER_ALL: GUTTER_ALL2,
18806
+ JUSTIFY_FLEX_START: JUSTIFY_FLEX_START2,
18807
+ JUSTIFY_CENTER: JUSTIFY_CENTER2,
18808
+ JUSTIFY_FLEX_END: JUSTIFY_FLEX_END2,
18809
+ JUSTIFY_SPACE_BETWEEN: JUSTIFY_SPACE_BETWEEN2,
18810
+ JUSTIFY_SPACE_AROUND: JUSTIFY_SPACE_AROUND2,
18811
+ JUSTIFY_SPACE_EVENLY: JUSTIFY_SPACE_EVENLY2,
18812
+ LOG_LEVEL_ERROR: LOG_LEVEL_ERROR2,
18813
+ LOG_LEVEL_WARN: LOG_LEVEL_WARN2,
18814
+ LOG_LEVEL_INFO: LOG_LEVEL_INFO2,
18815
+ LOG_LEVEL_DEBUG: LOG_LEVEL_DEBUG2,
18816
+ LOG_LEVEL_VERBOSE: LOG_LEVEL_VERBOSE2,
18817
+ LOG_LEVEL_FATAL: LOG_LEVEL_FATAL2,
18818
+ MEASURE_MODE_UNDEFINED: MEASURE_MODE_UNDEFINED2,
18819
+ MEASURE_MODE_EXACTLY: MEASURE_MODE_EXACTLY2,
18820
+ MEASURE_MODE_AT_MOST: MEASURE_MODE_AT_MOST2,
18821
+ NODE_TYPE_DEFAULT: NODE_TYPE_DEFAULT2,
18822
+ NODE_TYPE_TEXT: NODE_TYPE_TEXT2,
18823
+ OVERFLOW_VISIBLE: OVERFLOW_VISIBLE2,
18824
+ OVERFLOW_HIDDEN: OVERFLOW_HIDDEN2,
18825
+ OVERFLOW_SCROLL: OVERFLOW_SCROLL2,
18826
+ POSITION_TYPE_STATIC: POSITION_TYPE_STATIC2,
18827
+ POSITION_TYPE_RELATIVE: POSITION_TYPE_RELATIVE2,
18828
+ POSITION_TYPE_ABSOLUTE: POSITION_TYPE_ABSOLUTE2,
18829
+ UNIT_UNDEFINED: UNIT_UNDEFINED2,
18830
+ UNIT_POINT: UNIT_POINT2,
18831
+ UNIT_PERCENT: UNIT_PERCENT2,
18832
+ UNIT_AUTO: UNIT_AUTO2,
18833
+ WRAP_NO_WRAP: WRAP_NO_WRAP2,
18834
+ WRAP_WRAP: WRAP_WRAP2,
18835
+ WRAP_WRAP_REVERSE: WRAP_WRAP_REVERSE2
18641
18836
  };
18642
18837
  var yoga_default = Yoga;
18643
18838
 
18644
- export { toArrayBuffer, singleton, envRegistry, registerEnvVar, clearEnvCache, generateEnvMarkdown, generateEnvColored, env, sleep, stringWidth2 as stringWidth, resolveBundledFilePath, DEFAULT_FOREGROUND_RGB, DEFAULT_BACKGROUND_RGB, normalizeIndexedColorIndex, ansi256IndexToRgb, RGBA, normalizeColorValue, hexToRgb, rgbToHex, hsvToRgb, parseColor, isValidBorderStyle, parseBorderStyle, BorderChars, getBorderFromSides, getBorderSides, borderCharsToArray, BorderCharArrays, KeyEvent, PasteEvent, KeyHandler, InternalKeyHandler, fonts, measureText, getCharacterPositions, coordinateToCharacterIndex, renderFontToFrameBuffer, TextAttributes, ATTRIBUTE_BASE_BITS, ATTRIBUTE_BASE_MASK, getBaseAttributes, DebugOverlayCorner, TargetChannel, createTextAttributes, attributesWithLink, getLinkId, visualizeRenderableTree, isStyledText, StyledText, stringToStyledText, black, red, green, yellow, blue, magenta, cyan, white, brightBlack, brightRed, brightGreen, brightYellow, brightBlue, brightMagenta, brightCyan, brightWhite, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bold, italic, underline, strikethrough, dim, reverse, blink, fg, bg, link, t, hastToStyledText, SystemClock, nonAlphanumericKeys, terminalNamedSingleStrokeKeys, parseKeypress, LinearScrollAccel, MacOSScrollAccel, parseAlign, parseAlignItems, parseBoxSizing, parseDimension, parseDirection, parseDisplay, parseEdge, parseFlexDirection, parseGutter, parseJustify, parseLogLevel, parseMeasureMode, parseOverflow, parsePositionType, parseUnit, parseWrap, MouseParser, Selection, convertGlobalToLocalSelection, ASCIIFontSelectionHelper, StdinParser, treeSitterToTextChunks, treeSitterToStyledText, addDefaultParsers, TreeSitterClient, DataPathsManager, getDataPaths, extensionToFiletype, basenameToFiletype, extToFiletype, pathToFiletype, infoStringToFiletype, getTreeSitterClient, destroyTreeSitterClient, ExtmarksController, createExtmarksController, TerminalPalette, createTerminalPalette, normalizeTerminalPalette, buildTerminalPaletteSignature, decodePasteBytes, stripAnsiSequences, createHostClipboard, createClipboard, ClipboardTarget, createRendererClipboardAdapter, Clipboard, detectLinks, OptimizedBuffer, TextBuffer, SpanInfoStruct, NativeAudioStreamFormat, NativeAudioStreamState, NativeAudioStreamStateNames, NativeAudioStreamCloseReason, NativeAudioStreamState2 as NativeAudioStreamState1, NativeAudioStreamCloseReason2 as NativeAudioStreamCloseReason1, NativeAudioStreamFormat2 as NativeAudioStreamFormat1, NativeClipboardOperationStatus, NativeClipboardStartStatus, NativeClipboardCancelStatus, NativeClipboardCopyStatus, NativeClipboardDestroyStatus, NativeClipboardShutdownStatus, LogLevel2 as LogLevel, NativeMeasureTargetKind, setRenderLibPath, resolveRenderLib, Align, BoxSizing, Dimension, Direction, Display, Edge, Errata, ExperimentalFeature, FlexDirection, Gutter, Justify, LogLevel as LogLevel1, MeasureMode, NodeType, Overflow, PositionType, Unit, Wrap, ALIGN_AUTO, ALIGN_FLEX_START, ALIGN_CENTER, ALIGN_FLEX_END, ALIGN_STRETCH, ALIGN_BASELINE, ALIGN_SPACE_BETWEEN, ALIGN_SPACE_AROUND, ALIGN_SPACE_EVENLY, BOX_SIZING_BORDER_BOX, BOX_SIZING_CONTENT_BOX, DIMENSION_WIDTH, DIMENSION_HEIGHT, DIRECTION_INHERIT, DIRECTION_LTR, DIRECTION_RTL, DISPLAY_FLEX, DISPLAY_NONE, DISPLAY_CONTENTS, EDGE_LEFT, EDGE_TOP, EDGE_RIGHT, EDGE_BOTTOM, EDGE_START, EDGE_END, EDGE_HORIZONTAL, EDGE_VERTICAL, EDGE_ALL, ERRATA_NONE, ERRATA_STRETCH_FLEX_BASIS, ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING, ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE, ERRATA_ALL, ERRATA_CLASSIC, EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS, FLEX_DIRECTION_COLUMN, FLEX_DIRECTION_COLUMN_REVERSE, FLEX_DIRECTION_ROW, FLEX_DIRECTION_ROW_REVERSE, GUTTER_COLUMN, GUTTER_ROW, GUTTER_ALL, JUSTIFY_FLEX_START, JUSTIFY_CENTER, JUSTIFY_FLEX_END, JUSTIFY_SPACE_BETWEEN, JUSTIFY_SPACE_AROUND, JUSTIFY_SPACE_EVENLY, LOG_LEVEL_ERROR, LOG_LEVEL_WARN, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, LOG_LEVEL_VERBOSE, LOG_LEVEL_FATAL, MEASURE_MODE_UNDEFINED, MEASURE_MODE_EXACTLY, MEASURE_MODE_AT_MOST, NODE_TYPE_DEFAULT, NODE_TYPE_TEXT, OVERFLOW_VISIBLE, OVERFLOW_HIDDEN, OVERFLOW_SCROLL, POSITION_TYPE_STATIC, POSITION_TYPE_RELATIVE, POSITION_TYPE_ABSOLUTE, UNIT_UNDEFINED, UNIT_POINT, UNIT_PERCENT, UNIT_AUTO, WRAP_NO_WRAP, WRAP_WRAP, WRAP_WRAP_REVERSE, Config, Node, exports_yoga, yoga_default };
18839
+ export { toArrayBuffer, singleton, envRegistry2, registerEnvVar2, clearEnvCache2, generateEnvMarkdown2, generateEnvColored2, env2, sleep, stringWidth, resolveBundledFilePath2, DEFAULT_FOREGROUND_RGB2, DEFAULT_BACKGROUND_RGB2, normalizeIndexedColorIndex2, ansi256IndexToRgb2, RGBA2, normalizeColorValue2, hexToRgb2, rgbToHex2, hsvToRgb2, parseColor2, isValidBorderStyle2, parseBorderStyle2, BorderChars2, getBorderFromSides2, getBorderSides2, borderCharsToArray2, BorderCharArrays2, KeyEvent2, PasteEvent2, KeyHandler2, InternalKeyHandler2, fonts2, measureText2, getCharacterPositions2, coordinateToCharacterIndex2, renderFontToFrameBuffer2, TextAttributes2, ATTRIBUTE_BASE_BITS2, ATTRIBUTE_BASE_MASK2, getBaseAttributes2, DebugOverlayCorner2, TargetChannel2, createTextAttributes2, attributesWithLink2, getLinkId2, visualizeRenderableTree2, isStyledText2, StyledText2, stringToStyledText2, black2, red2, green2, yellow2, blue2, magenta2, cyan2, white2, brightBlack2, brightRed2, brightGreen2, brightYellow2, brightBlue2, brightMagenta2, brightCyan2, brightWhite2, bgBlack2, bgRed2, bgGreen2, bgYellow2, bgBlue2, bgMagenta2, bgCyan2, bgWhite2, bold2, italic2, underline2, strikethrough2, dim2, reverse2, blink2, fg2, bg2, link2, t2, hastToStyledText2, SystemClock2, nonAlphanumericKeys2, terminalNamedSingleStrokeKeys2, parseKeypress2, LinearScrollAccel2, MacOSScrollAccel2, parseAlign2, parseAlignItems2, parseBoxSizing2, parseDimension2, parseDirection2, parseDisplay2, parseEdge2, parseFlexDirection2, parseGutter2, parseJustify2, parseLogLevel2, parseMeasureMode2, parseOverflow2, parsePositionType2, parseUnit2, parseWrap2, MouseParser2, Selection2, convertGlobalToLocalSelection2, ASCIIFontSelectionHelper2, StdinParser2, addDefaultParsers2, TreeSitterClient2, treeSitterToTextChunks2, treeSitterToStyledText2, DataPathsManager2, getDataPaths2, extensionToFiletype2, basenameToFiletype2, extToFiletype2, pathToFiletype2, infoStringToFiletype2, getTreeSitterClient2, destroyTreeSitterClient2, ExtmarksController2, createExtmarksController2, TerminalPalette2, createTerminalPalette2, normalizeTerminalPalette2, buildTerminalPaletteSignature2, decodePasteBytes2, stripAnsiSequences2, createHostClipboard2, createClipboard2, ClipboardTarget2, createRendererClipboardAdapter2, Clipboard2, normalizeMarkdownLinkTarget, detectLinks2, OptimizedBuffer2, TextBuffer2, SpanInfoStruct, NativeAudioStreamFormat2, NativeAudioStreamState2, NativeAudioStreamStateNames, NativeAudioStreamCloseReason2, NativeAudioStreamState3, NativeAudioStreamCloseReason3, NativeAudioStreamFormat3, MAX_LINK_URL_BYTES2, NativeClipboardOperationStatus2, NativeClipboardStartStatus2, NativeClipboardCancelStatus2, NativeClipboardCopyStatus2, NativeClipboardDestroyStatus2, NativeClipboardShutdownStatus2, LogLevel2, NativeMeasureTargetKind2, setRenderLibPath2, resolveRenderLib2, Align2, BoxSizing2, Dimension2, Direction2, Display2, Edge2, Errata2, ExperimentalFeature2, FlexDirection2, Gutter2, Justify2, LogLevel3, MeasureMode2, NodeType2, Overflow2, PositionType2, Unit2, Wrap2, ALIGN_AUTO2, ALIGN_FLEX_START2, ALIGN_CENTER2, ALIGN_FLEX_END2, ALIGN_STRETCH2, ALIGN_BASELINE2, ALIGN_SPACE_BETWEEN2, ALIGN_SPACE_AROUND2, ALIGN_SPACE_EVENLY2, BOX_SIZING_BORDER_BOX2, BOX_SIZING_CONTENT_BOX2, DIMENSION_WIDTH2, DIMENSION_HEIGHT2, DIRECTION_INHERIT2, DIRECTION_LTR2, DIRECTION_RTL2, DISPLAY_FLEX2, DISPLAY_NONE2, DISPLAY_CONTENTS2, EDGE_LEFT2, EDGE_TOP2, EDGE_RIGHT2, EDGE_BOTTOM2, EDGE_START2, EDGE_END2, EDGE_HORIZONTAL2, EDGE_VERTICAL2, EDGE_ALL2, ERRATA_NONE2, ERRATA_STRETCH_FLEX_BASIS2, ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING2, ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE2, ERRATA_ALL2, ERRATA_CLASSIC2, EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS2, FLEX_DIRECTION_COLUMN2, FLEX_DIRECTION_COLUMN_REVERSE2, FLEX_DIRECTION_ROW2, FLEX_DIRECTION_ROW_REVERSE2, GUTTER_COLUMN2, GUTTER_ROW2, GUTTER_ALL2, JUSTIFY_FLEX_START2, JUSTIFY_CENTER2, JUSTIFY_FLEX_END2, JUSTIFY_SPACE_BETWEEN2, JUSTIFY_SPACE_AROUND2, JUSTIFY_SPACE_EVENLY2, LOG_LEVEL_ERROR2, LOG_LEVEL_WARN2, LOG_LEVEL_INFO2, LOG_LEVEL_DEBUG2, LOG_LEVEL_VERBOSE2, LOG_LEVEL_FATAL2, MEASURE_MODE_UNDEFINED2, MEASURE_MODE_EXACTLY2, MEASURE_MODE_AT_MOST2, NODE_TYPE_DEFAULT2, NODE_TYPE_TEXT2, OVERFLOW_VISIBLE2, OVERFLOW_HIDDEN2, OVERFLOW_SCROLL2, POSITION_TYPE_STATIC2, POSITION_TYPE_RELATIVE2, POSITION_TYPE_ABSOLUTE2, UNIT_UNDEFINED2, UNIT_POINT2, UNIT_PERCENT2, UNIT_AUTO2, WRAP_NO_WRAP2, WRAP_WRAP2, WRAP_WRAP_REVERSE2, Config2, Node2, exports_yoga, yoga_default };
18645
18840
 
18646
- //# debugId=48207211452E894064756E2164756E21
18647
- //# sourceMappingURL=chunk-bun-9gqvxy8c.js.map
18841
+ //# debugId=1D4925856A3AFEEC64756E2164756E21
18842
+ //# sourceMappingURL=chunk-bun-8f4q4e2m.js.map