@opentui/core 0.5.9 → 0.5.11

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 (42) hide show
  1. package/README.md +2 -0
  2. package/audio.d.ts +6 -1
  3. package/{chunk-bun-b0662dgp.js → chunk-bun-37s3zwb6.js} +1216 -1038
  4. package/{chunk-bun-b0662dgp.js.map → chunk-bun-37s3zwb6.js.map} +7 -7
  5. package/{chunk-bun-jxfx3h5k.js → chunk-bun-bwjmgnxw.js} +773 -621
  6. package/chunk-bun-bwjmgnxw.js.map +32 -0
  7. package/{chunk-node-dcyj0dm5.js → chunk-node-54dhb2fr.js} +773 -621
  8. package/chunk-node-54dhb2fr.js.map +32 -0
  9. package/{chunk-node-zcz10bhr.js → chunk-node-70eg2nhg.js} +1223 -1042
  10. package/chunk-node-70eg2nhg.js.map +63 -0
  11. package/image.d.ts +25 -1
  12. package/index.bun.js +1642 -1374
  13. package/index.bun.js.map +8 -8
  14. package/index.node.js +1642 -1374
  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/package.json +13 -9
  21. package/parser.worker.js +7 -10
  22. package/parser.worker.js.map +2 -2
  23. package/renderables/Code.d.ts +6 -0
  24. package/renderables/Diff.d.ts +1 -2
  25. package/renderables/Markdown.d.ts +6 -0
  26. package/renderables/TextBufferRenderable.d.ts +2 -0
  27. package/renderer.d.ts +23 -2
  28. package/testing.bun.js +23 -23
  29. package/testing.bun.js.map +2 -2
  30. package/testing.js +23 -23
  31. package/testing.js.map +2 -2
  32. package/text-buffer-view.d.ts +1 -0
  33. package/types.d.ts +1 -0
  34. package/yoga.bun.js +187 -187
  35. package/yoga.bun.js.map +1 -1
  36. package/yoga.js +187 -187
  37. package/yoga.js.map +1 -1
  38. package/zig-structs.d.ts +8 -1
  39. package/zig.d.ts +15 -1
  40. package/chunk-bun-jxfx3h5k.js.map +0 -32
  41. package/chunk-node-dcyj0dm5.js.map +0 -32
  42. package/chunk-node-zcz10bhr.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());
@@ -8493,14 +8497,14 @@ function setGlobalWorkerMessageHandler(handler) {
8493
8497
  }
8494
8498
 
8495
8499
  // src/lib/tree-sitter/client.ts
8496
- registerEnvVar({
8500
+ registerEnvVar2({
8497
8501
  name: "OTUI_TREE_SITTER_WORKER_PATH",
8498
8502
  description: "Path to the TreeSitter worker entry script",
8499
8503
  type: "string",
8500
8504
  default: ""
8501
8505
  });
8502
8506
  var DEFAULT_PARSER_OVERRIDES = [];
8503
- function addDefaultParsers(parsers) {
8507
+ function addDefaultParsers2(parsers) {
8504
8508
  for (const parser of parsers) {
8505
8509
  DEFAULT_PARSER_OVERRIDES = [
8506
8510
  ...DEFAULT_PARSER_OVERRIDES.filter((existingParser) => existingParser.filetype !== parser.filetype),
@@ -8510,7 +8514,7 @@ function addDefaultParsers(parsers) {
8510
8514
  }
8511
8515
  var isUrl = (path) => path.startsWith("http://") || path.startsWith("https://");
8512
8516
 
8513
- class TreeSitterClient extends EventEmitter2 {
8517
+ class TreeSitterClient2 extends EventEmitter2 {
8514
8518
  initialized = false;
8515
8519
  worker;
8516
8520
  buffers = new Map;
@@ -8618,8 +8622,8 @@ class TreeSitterClient extends EventEmitter2 {
8618
8622
  if (this.options.workerPath) {
8619
8623
  return this.options.workerPath;
8620
8624
  }
8621
- if (env.OTUI_TREE_SITTER_WORKER_PATH) {
8622
- return env.OTUI_TREE_SITTER_WORKER_PATH;
8625
+ if (env2.OTUI_TREE_SITTER_WORKER_PATH) {
8626
+ return env2.OTUI_TREE_SITTER_WORKER_PATH;
8623
8627
  }
8624
8628
  if (typeof OTUI_TREE_SITTER_WORKER_PATH !== "undefined") {
8625
8629
  return OTUI_TREE_SITTER_WORKER_PATH;
@@ -8704,7 +8708,7 @@ class TreeSitterClient extends EventEmitter2 {
8704
8708
  async initializeClient(generation, worker) {
8705
8709
  const treeSitterWasmPath = await resolveTreeSitterWasm();
8706
8710
  this.assertCurrentInitialization(generation, worker);
8707
- await new Promise((resolve3, reject) => {
8711
+ await new Promise((resolve, reject) => {
8708
8712
  const timeoutMs = this.options.initTimeout ?? 1e4;
8709
8713
  const timeoutId = setTimeout(() => {
8710
8714
  const error = new Error("Worker initialization timed out");
@@ -8712,7 +8716,7 @@ class TreeSitterClient extends EventEmitter2 {
8712
8716
  this.initializeResolvers = undefined;
8713
8717
  reject(error);
8714
8718
  }, timeoutMs);
8715
- this.initializeResolvers = { resolve: resolve3, reject, timeoutId };
8719
+ this.initializeResolvers = { resolve, reject, timeoutId };
8716
8720
  this.sendWorkerMessage({
8717
8721
  type: "INIT",
8718
8722
  dataPath: this.options.dataPath,
@@ -8729,7 +8733,7 @@ class TreeSitterClient extends EventEmitter2 {
8729
8733
  this.assertCurrentInitialization(generation, worker);
8730
8734
  const overriddenFiletypes = new Set(DEFAULT_PARSER_OVERRIDES.map((parser) => parser.filetype));
8731
8735
  for (const parser of [
8732
- ...defaultParsers.filter((parser2) => !overriddenFiletypes.has(parser2.filetype)),
8736
+ ...defaultParsers.filter((parser) => !overriddenFiletypes.has(parser.filetype)),
8733
8737
  ...DEFAULT_PARSER_OVERRIDES
8734
8738
  ]) {
8735
8739
  worker.postMessage({ type: "ADD_FILETYPE_PARSER", filetypeParser: this.resolveFiletypeParser(parser) });
@@ -8763,8 +8767,8 @@ class TreeSitterClient extends EventEmitter2 {
8763
8767
  }
8764
8768
  async getPerformance() {
8765
8769
  const messageId = `performance_${this.messageIdCounter++}`;
8766
- return new Promise((resolve3, reject) => {
8767
- this.messageCallbacks.set(messageId, { resolve: resolve3, reject });
8770
+ return new Promise((resolve, reject) => {
8771
+ this.messageCallbacks.set(messageId, { resolve, reject });
8768
8772
  try {
8769
8773
  this.sendWorkerMessage({ type: "GET_PERFORMANCE", messageId });
8770
8774
  } catch (error) {
@@ -8782,8 +8786,8 @@ class TreeSitterClient extends EventEmitter2 {
8782
8786
  }
8783
8787
  }
8784
8788
  const messageId = `oneshot_${this.messageIdCounter++}`;
8785
- return new Promise((resolve3, reject) => {
8786
- this.messageCallbacks.set(messageId, { resolve: resolve3, reject });
8789
+ return new Promise((resolve, reject) => {
8790
+ this.messageCallbacks.set(messageId, { resolve, reject });
8787
8791
  try {
8788
8792
  this.sendWorkerMessage({
8789
8793
  type: "ONESHOT_HIGHLIGHT",
@@ -8906,8 +8910,8 @@ class TreeSitterClient extends EventEmitter2 {
8906
8910
  }
8907
8911
  async preloadParser(filetype) {
8908
8912
  const messageId = `has_parser_${this.messageIdCounter++}`;
8909
- const response = await new Promise((resolve3, reject) => {
8910
- this.messageCallbacks.set(messageId, { resolve: resolve3, reject });
8913
+ const response = await new Promise((resolve, reject) => {
8914
+ this.messageCallbacks.set(messageId, { resolve, reject });
8911
8915
  try {
8912
8916
  this.sendWorkerMessage({
8913
8917
  type: "PRELOAD_PARSER",
@@ -8939,8 +8943,8 @@ class TreeSitterClient extends EventEmitter2 {
8939
8943
  }
8940
8944
  this.buffers.set(id, { id, content, filetype, version, hasParser: false });
8941
8945
  const messageId = `init_${this.messageIdCounter++}`;
8942
- const response = await new Promise((resolve3, reject) => {
8943
- this.messageCallbacks.set(messageId, { resolve: resolve3, reject });
8946
+ const response = await new Promise((resolve, reject) => {
8947
+ this.messageCallbacks.set(messageId, { resolve, reject });
8944
8948
  try {
8945
8949
  this.sendWorkerMessage({
8946
8950
  type: "INITIALIZE_PARSER",
@@ -9001,9 +9005,9 @@ class TreeSitterClient extends EventEmitter2 {
9001
9005
  this.editQueues.delete(bufferId);
9002
9006
  }
9003
9007
  if (this.worker) {
9004
- await new Promise((resolve3, reject) => {
9008
+ await new Promise((resolve, reject) => {
9005
9009
  const messageId = `dispose_${bufferId}`;
9006
- this.messageCallbacks.set(messageId, { resolve: resolve3, reject });
9010
+ this.messageCallbacks.set(messageId, { resolve, reject });
9007
9011
  try {
9008
9012
  this.sendWorkerMessage({
9009
9013
  type: "DISPOSE_BUFFER",
@@ -9012,13 +9016,13 @@ class TreeSitterClient extends EventEmitter2 {
9012
9016
  } catch (error) {
9013
9017
  console.error("Error disposing buffer", error);
9014
9018
  this.messageCallbacks.delete(messageId);
9015
- resolve3(false);
9019
+ resolve(false);
9016
9020
  }
9017
9021
  setTimeout(() => {
9018
9022
  if (this.messageCallbacks.has(messageId)) {
9019
9023
  this.messageCallbacks.delete(messageId);
9020
9024
  console.warn({ bufferId }, "Timed out waiting for buffer to be disposed");
9021
- resolve3(false);
9025
+ resolve(false);
9022
9026
  }
9023
9027
  }, 3000);
9024
9028
  });
@@ -9031,8 +9035,8 @@ class TreeSitterClient extends EventEmitter2 {
9031
9035
  }
9032
9036
  let resolveDestroy;
9033
9037
  let rejectDestroy;
9034
- const destroyPromise = new Promise((resolve3, reject) => {
9035
- resolveDestroy = resolve3;
9038
+ const destroyPromise = new Promise((resolve, reject) => {
9039
+ resolveDestroy = resolve;
9036
9040
  rejectDestroy = reject;
9037
9041
  });
9038
9042
  this.destroyPromise = destroyPromise;
@@ -9097,13 +9101,13 @@ class TreeSitterClient extends EventEmitter2 {
9097
9101
  this.options.dataPath = dataPath;
9098
9102
  if (this.initialized && this.worker) {
9099
9103
  const messageId = `update_datapath_${this.messageIdCounter++}`;
9100
- return new Promise((resolve3, reject) => {
9104
+ return new Promise((resolve, reject) => {
9101
9105
  this.messageCallbacks.set(messageId, {
9102
9106
  resolve: (response) => {
9103
9107
  if (response.error) {
9104
9108
  reject(new Error(response.error));
9105
9109
  } else {
9106
- resolve3();
9110
+ resolve();
9107
9111
  }
9108
9112
  },
9109
9113
  reject
@@ -9126,13 +9130,13 @@ class TreeSitterClient extends EventEmitter2 {
9126
9130
  throw new Error("Cannot clear cache: client is not initialized");
9127
9131
  }
9128
9132
  const messageId = `clear_cache_${this.messageIdCounter++}`;
9129
- return new Promise((resolve3, reject) => {
9133
+ return new Promise((resolve, reject) => {
9130
9134
  this.messageCallbacks.set(messageId, {
9131
9135
  resolve: (response) => {
9132
9136
  if (response.error) {
9133
9137
  reject(new Error(response.error));
9134
9138
  } else {
9135
- resolve3();
9139
+ resolve();
9136
9140
  }
9137
9141
  },
9138
9142
  reject
@@ -9204,20 +9208,20 @@ function isValidDirectoryName(name) {
9204
9208
  }
9205
9209
 
9206
9210
  // src/lib/data-paths.ts
9207
- registerEnvVar({
9211
+ registerEnvVar2({
9208
9212
  name: "XDG_CONFIG_HOME",
9209
9213
  description: "Base directory for user-specific configuration files",
9210
9214
  type: "string",
9211
9215
  default: ""
9212
9216
  });
9213
- registerEnvVar({
9217
+ registerEnvVar2({
9214
9218
  name: "XDG_DATA_HOME",
9215
9219
  description: "Base directory for user-specific data files",
9216
9220
  type: "string",
9217
9221
  default: ""
9218
9222
  });
9219
9223
 
9220
- class DataPathsManager extends EventEmitter3 {
9224
+ class DataPathsManager2 extends EventEmitter3 {
9221
9225
  _appName;
9222
9226
  _globalConfigPath;
9223
9227
  _globalConfigFile;
@@ -9246,7 +9250,7 @@ class DataPathsManager extends EventEmitter3 {
9246
9250
  get globalConfigPath() {
9247
9251
  if (this._globalConfigPath === undefined) {
9248
9252
  const homeDir = os.homedir();
9249
- const xdgConfigHome = env.XDG_CONFIG_HOME;
9253
+ const xdgConfigHome = env2.XDG_CONFIG_HOME;
9250
9254
  const baseConfigDir = xdgConfigHome || path.join(homeDir, ".config");
9251
9255
  this._globalConfigPath = path.join(baseConfigDir, this._appName);
9252
9256
  }
@@ -9267,7 +9271,7 @@ class DataPathsManager extends EventEmitter3 {
9267
9271
  get globalDataPath() {
9268
9272
  if (this._globalDataPath === undefined) {
9269
9273
  const homeDir = os.homedir();
9270
- const xdgDataHome = env.XDG_DATA_HOME;
9274
+ const xdgDataHome = env2.XDG_DATA_HOME;
9271
9275
  const baseDataDir = xdgDataHome || path.join(homeDir, ".local/share");
9272
9276
  this._globalDataPath = path.join(baseDataDir, this._appName);
9273
9277
  }
@@ -9282,12 +9286,12 @@ class DataPathsManager extends EventEmitter3 {
9282
9286
  };
9283
9287
  }
9284
9288
  }
9285
- function getDataPaths() {
9286
- return singleton("data-paths-opentui", () => new DataPathsManager);
9289
+ function getDataPaths2() {
9290
+ return singleton("data-paths-opentui", () => new DataPathsManager2);
9287
9291
  }
9288
9292
  // src/lib/tree-sitter/resolve-ft.ts
9289
9293
  import path2 from "path";
9290
- var extensionToFiletype = new Map([
9294
+ var extensionToFiletype2 = new Map([
9291
9295
  ["astro", "astro"],
9292
9296
  ["bash", "bash"],
9293
9297
  ["c", "c"],
@@ -9385,7 +9389,7 @@ var extensionToFiletype = new Map([
9385
9389
  ["java", "java"],
9386
9390
  ["css", "css"]
9387
9391
  ]);
9388
- var basenameToFiletype = new Map([
9392
+ var basenameToFiletype2 = new Map([
9389
9393
  [".bash_aliases", "bash"],
9390
9394
  [".bash_logout", "bash"],
9391
9395
  [".bash_profile", "bash"],
@@ -9423,43 +9427,43 @@ function getBasename(value) {
9423
9427
  const normalizedValue = value.trim().replaceAll("\\", "/");
9424
9428
  if (!normalizedValue)
9425
9429
  return;
9426
- const basename2 = path2.posix.basename(normalizedValue).toLowerCase();
9427
- return basename2 || undefined;
9430
+ const basename = path2.posix.basename(normalizedValue).toLowerCase();
9431
+ return basename || undefined;
9428
9432
  }
9429
- function extToFiletype(extension) {
9433
+ function extToFiletype2(extension) {
9430
9434
  const normalizedExtension = normalizeFiletypeToken(extension);
9431
9435
  if (!normalizedExtension)
9432
9436
  return;
9433
- return extensionToFiletype.get(normalizedExtension);
9437
+ return extensionToFiletype2.get(normalizedExtension);
9434
9438
  }
9435
- function pathToFiletype(path3) {
9436
- if (typeof path3 !== "string")
9439
+ function pathToFiletype2(path) {
9440
+ if (typeof path !== "string")
9437
9441
  return;
9438
- const basename2 = getBasename(path3);
9439
- if (!basename2)
9442
+ const basename = getBasename(path);
9443
+ if (!basename)
9440
9444
  return;
9441
- const basenameFiletype = basenameToFiletype.get(basename2);
9445
+ const basenameFiletype = basenameToFiletype2.get(basename);
9442
9446
  if (basenameFiletype) {
9443
9447
  return basenameFiletype;
9444
9448
  }
9445
- const lastDot = basename2.lastIndexOf(".");
9446
- if (lastDot === -1 || lastDot === basename2.length - 1) {
9449
+ const lastDot = basename.lastIndexOf(".");
9450
+ if (lastDot === -1 || lastDot === basename.length - 1) {
9447
9451
  return;
9448
9452
  }
9449
- const extension = basename2.substring(lastDot + 1);
9450
- return extToFiletype(extension);
9453
+ const extension = basename.substring(lastDot + 1);
9454
+ return extToFiletype2(extension);
9451
9455
  }
9452
- function infoStringToFiletype(infoString) {
9456
+ function infoStringToFiletype2(infoString) {
9453
9457
  if (typeof infoString !== "string")
9454
9458
  return;
9455
9459
  const token = infoString.trim().split(/\s+/, 1)[0];
9456
- const directBasenameMatch = basenameToFiletype.get(token.toLowerCase());
9460
+ const directBasenameMatch = basenameToFiletype2.get(token.toLowerCase());
9457
9461
  if (directBasenameMatch)
9458
9462
  return directBasenameMatch;
9459
9463
  const normalizedToken = normalizeFiletypeToken(token);
9460
9464
  if (!normalizedToken)
9461
9465
  return;
9462
- return basenameToFiletype.get(normalizedToken) ?? pathToFiletype(normalizedToken) ?? extToFiletype(normalizedToken) ?? normalizedToken;
9466
+ return basenameToFiletype2.get(normalizedToken) ?? pathToFiletype2(normalizedToken) ?? extToFiletype2(normalizedToken) ?? normalizedToken;
9463
9467
  }
9464
9468
 
9465
9469
  // src/lib/tree-sitter/index.ts
@@ -9468,17 +9472,17 @@ var TREE_SITTER_CLIENT_LISTENER_STATE_KEY = "tree-sitter-client-listener-state";
9468
9472
  function getTreeSitterClientListenerState() {
9469
9473
  return singleton(TREE_SITTER_CLIENT_LISTENER_STATE_KEY, () => ({}));
9470
9474
  }
9471
- function getTreeSitterClient() {
9475
+ function getTreeSitterClient2() {
9472
9476
  const existingClient = getSingleton(TREE_SITTER_CLIENT_KEY);
9473
9477
  if (existingClient) {
9474
9478
  return existingClient;
9475
9479
  }
9476
- const dataPathsManager = getDataPaths();
9480
+ const dataPathsManager = getDataPaths2();
9477
9481
  const defaultOptions = {
9478
9482
  dataPath: dataPathsManager.globalDataPath
9479
9483
  };
9480
9484
  return singleton(TREE_SITTER_CLIENT_KEY, () => {
9481
- const client2 = new TreeSitterClient(defaultOptions);
9485
+ const client2 = new TreeSitterClient2(defaultOptions);
9482
9486
  const listenerState = getTreeSitterClientListenerState();
9483
9487
  const handlePathsChanged = (paths) => {
9484
9488
  client2.setDataPath(paths.globalDataPath).catch((error) => {
@@ -9500,7 +9504,7 @@ function getTreeSitterClient() {
9500
9504
  return client2;
9501
9505
  });
9502
9506
  }
9503
- async function destroyTreeSitterClient() {
9507
+ async function destroyTreeSitterClient2() {
9504
9508
  const client2 = getSingleton(TREE_SITTER_CLIENT_KEY);
9505
9509
  if (!client2) {
9506
9510
  const listenerState = getSingleton(TREE_SITTER_CLIENT_LISTENER_STATE_KEY);
@@ -9554,7 +9558,7 @@ class ExtmarksHistory {
9554
9558
  }
9555
9559
 
9556
9560
  // src/lib/extmarks.ts
9557
- class ExtmarksController {
9561
+ class ExtmarksController2 {
9558
9562
  editBuffer;
9559
9563
  editorView;
9560
9564
  extmarks = new Map;
@@ -9761,11 +9765,11 @@ class ExtmarksController {
9761
9765
  if (virtualExtmark && currentOffset === virtualExtmark.end) {
9762
9766
  const startCursor = this.offsetToPosition(virtualExtmark.start);
9763
9767
  const endCursor = this.offsetToPosition(virtualExtmark.end);
9764
- const deleteOffset2 = virtualExtmark.start;
9765
- const deleteLength2 = virtualExtmark.end - virtualExtmark.start;
9768
+ const deleteOffset = virtualExtmark.start;
9769
+ const deleteLength = virtualExtmark.end - virtualExtmark.start;
9766
9770
  this.deleteExtmarkById(virtualExtmark.id);
9767
9771
  this.originalDeleteRange(startCursor.row, startCursor.col, endCursor.row, endCursor.col);
9768
- this.adjustExtmarksAfterDeletion(deleteOffset2, deleteLength2);
9772
+ this.adjustExtmarksAfterDeletion(deleteOffset, deleteLength);
9769
9773
  this.updateHighlights();
9770
9774
  return;
9771
9775
  }
@@ -9794,10 +9798,10 @@ class ExtmarksController {
9794
9798
  const startCursor = this.offsetToPosition(virtualExtmark.start);
9795
9799
  const endCursor = this.offsetToPosition(virtualExtmark.end);
9796
9800
  const deleteOffset = virtualExtmark.start;
9797
- const deleteLength2 = virtualExtmark.end - virtualExtmark.start;
9801
+ const deleteLength = virtualExtmark.end - virtualExtmark.start;
9798
9802
  this.deleteExtmarkById(virtualExtmark.id);
9799
9803
  this.originalDeleteRange(startCursor.row, startCursor.col, endCursor.row, endCursor.col);
9800
- this.adjustExtmarksAfterDeletion(deleteOffset, deleteLength2);
9804
+ this.adjustExtmarksAfterDeletion(deleteOffset, deleteLength);
9801
9805
  this.updateHighlights();
9802
9806
  return;
9803
9807
  }
@@ -10043,13 +10047,13 @@ class ExtmarksController {
10043
10047
  j++;
10044
10048
  }
10045
10049
  const chunk = text.substring(i, j);
10046
- const chunkWidth = stringWidth2(chunk);
10050
+ const chunkWidth = stringWidth(chunk);
10047
10051
  if (displayWidthSoFar + chunkWidth < offset) {
10048
10052
  displayWidthSoFar += chunkWidth;
10049
10053
  i = j;
10050
10054
  } else {
10051
10055
  for (let k = i;k < j && displayWidthSoFar < offset; k++) {
10052
- const charWidth = stringWidth2(text[k]);
10056
+ const charWidth = stringWidth(text[k]);
10053
10057
  displayWidthSoFar += charWidth;
10054
10058
  }
10055
10059
  break;
@@ -10232,12 +10236,12 @@ class ExtmarksController {
10232
10236
  this.destroyed = true;
10233
10237
  }
10234
10238
  }
10235
- function createExtmarksController(editBuffer, editorView) {
10236
- return new ExtmarksController(editBuffer, editorView);
10239
+ function createExtmarksController2(editBuffer, editorView) {
10240
+ return new ExtmarksController2(editBuffer, editorView);
10237
10241
  }
10238
10242
  // src/lib/terminal-palette.ts
10239
- var SYSTEM_CLOCK2 = new SystemClock;
10240
- registerEnvVar({
10243
+ var SYSTEM_CLOCK2 = new SystemClock2;
10244
+ registerEnvVar2({
10241
10245
  name: "OTUI_PALETTE_IDLE_TIMEOUT_MS",
10242
10246
  description: "Milliseconds of silence after palette queries before using fallback colors.",
10243
10247
  type: "number",
@@ -10262,7 +10266,7 @@ function wrapForTmux(osc) {
10262
10266
  return `\x1BPtmux;${escaped}\x1B\\`;
10263
10267
  }
10264
10268
 
10265
- class TerminalPalette {
10269
+ class TerminalPalette2 {
10266
10270
  stdin;
10267
10271
  stdout;
10268
10272
  writeFn;
@@ -10355,7 +10359,7 @@ class TerminalPalette {
10355
10359
  const out = this.stdout;
10356
10360
  if (!out.isTTY || !this.stdin.isTTY)
10357
10361
  return false;
10358
- return new Promise((resolve3) => {
10362
+ return new Promise((resolve) => {
10359
10363
  const session = this.createQuerySession();
10360
10364
  let buffer = "";
10361
10365
  let settled = false;
@@ -10364,7 +10368,7 @@ class TerminalPalette {
10364
10368
  return;
10365
10369
  settled = true;
10366
10370
  session.cleanup();
10367
- resolve3(supported);
10371
+ resolve(supported);
10368
10372
  };
10369
10373
  const onData = (chunk) => {
10370
10374
  buffer += chunk.toString();
@@ -10380,14 +10384,14 @@ class TerminalPalette {
10380
10384
  this.writeOsc("\x1B]4;0;?\x07", true);
10381
10385
  });
10382
10386
  }
10383
- async queryPalette(indices, timeoutMs = 1200, idleTimeoutMs = env.OTUI_PALETTE_IDLE_TIMEOUT_MS) {
10387
+ async queryPalette(indices, timeoutMs = 1200, idleTimeoutMs = env2.OTUI_PALETTE_IDLE_TIMEOUT_MS) {
10384
10388
  const out = this.stdout;
10385
10389
  const results = new Map;
10386
10390
  indices.forEach((i) => results.set(i, null));
10387
10391
  if (!out.isTTY || !this.stdin.isTTY) {
10388
10392
  return results;
10389
10393
  }
10390
- return new Promise((resolve3) => {
10394
+ return new Promise((resolve) => {
10391
10395
  const session = this.createQuerySession();
10392
10396
  let buffer = "";
10393
10397
  let idleTimer = null;
@@ -10397,7 +10401,7 @@ class TerminalPalette {
10397
10401
  return;
10398
10402
  settled = true;
10399
10403
  session.cleanup();
10400
- resolve3(results);
10404
+ resolve(results);
10401
10405
  };
10402
10406
  const onData = (chunk) => {
10403
10407
  buffer += chunk.toString();
@@ -10423,7 +10427,7 @@ class TerminalPalette {
10423
10427
  idleTimer = session.resetTimer(idleTimer, finish, idleTimeoutMs);
10424
10428
  });
10425
10429
  }
10426
- async querySpecialColors(timeoutMs = 1200, idleTimeoutMs = env.OTUI_PALETTE_IDLE_TIMEOUT_MS) {
10430
+ async querySpecialColors(timeoutMs = 1200, idleTimeoutMs = env2.OTUI_PALETTE_IDLE_TIMEOUT_MS) {
10427
10431
  const out = this.stdout;
10428
10432
  const results = {
10429
10433
  10: null,
@@ -10440,7 +10444,7 @@ class TerminalPalette {
10440
10444
  if (!out.isTTY || !this.stdin.isTTY) {
10441
10445
  return results;
10442
10446
  }
10443
- return new Promise((resolve3) => {
10447
+ return new Promise((resolve) => {
10444
10448
  const session = this.createQuerySession();
10445
10449
  let buffer = "";
10446
10450
  let idleTimer = null;
@@ -10450,7 +10454,7 @@ class TerminalPalette {
10450
10454
  return;
10451
10455
  settled = true;
10452
10456
  session.cleanup();
10453
- resolve3(results);
10457
+ resolve(results);
10454
10458
  };
10455
10459
  const onData = (chunk) => {
10456
10460
  buffer += chunk.toString();
@@ -10498,7 +10502,7 @@ class TerminalPalette {
10498
10502
  };
10499
10503
  }
10500
10504
  const indicesToQuery = [...Array(size).keys()];
10501
- const idleTimeout = env.OTUI_PALETTE_IDLE_TIMEOUT_MS;
10505
+ const idleTimeout = env2.OTUI_PALETTE_IDLE_TIMEOUT_MS;
10502
10506
  const [paletteResults, specialColors] = await Promise.all([
10503
10507
  this.queryPalette(indicesToQuery, timeout, idleTimeout),
10504
10508
  this.querySpecialColors(timeout, idleTimeout)
@@ -10517,34 +10521,34 @@ class TerminalPalette {
10517
10521
  };
10518
10522
  }
10519
10523
  }
10520
- function createTerminalPalette(options) {
10521
- return new TerminalPalette(options);
10524
+ function createTerminalPalette2(options) {
10525
+ return new TerminalPalette2(options);
10522
10526
  }
10523
- var DEFAULT_FOREGROUND_FALLBACK = RGBA.fromInts(...DEFAULT_FOREGROUND_RGB);
10524
- var DEFAULT_BACKGROUND_FALLBACK = RGBA.fromInts(...DEFAULT_BACKGROUND_RGB);
10527
+ var DEFAULT_FOREGROUND_FALLBACK = RGBA2.fromInts(...DEFAULT_FOREGROUND_RGB2);
10528
+ var DEFAULT_BACKGROUND_FALLBACK = RGBA2.fromInts(...DEFAULT_BACKGROUND_RGB2);
10525
10529
  var fallbackAnsi256Palette = null;
10526
10530
  function getFallbackAnsi256Palette() {
10527
10531
  if (!fallbackAnsi256Palette) {
10528
10532
  fallbackAnsi256Palette = Array.from({ length: 256 }, (_, index) => {
10529
- const [r, g, b] = ansi256IndexToRgb(index);
10530
- return RGBA.fromInts(r, g, b);
10533
+ const [r, g, b] = ansi256IndexToRgb2(index);
10534
+ return RGBA2.fromInts(r, g, b);
10531
10535
  });
10532
10536
  }
10533
10537
  return fallbackAnsi256Palette;
10534
10538
  }
10535
- function normalizeTerminalPalette(colors) {
10539
+ function normalizeTerminalPalette2(colors) {
10536
10540
  const fallbackPalette = getFallbackAnsi256Palette();
10537
10541
  return {
10538
10542
  palette: Array.from({ length: 256 }, (_, index) => {
10539
10543
  const detected = colors?.palette[index];
10540
- return detected ? RGBA.fromHex(detected) : RGBA.clone(fallbackPalette[index]);
10544
+ return detected ? RGBA2.fromHex(detected) : RGBA2.clone(fallbackPalette[index]);
10541
10545
  }),
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)
10546
+ defaultForeground: colors?.defaultForeground ? RGBA2.fromHex(colors.defaultForeground) : RGBA2.clone(DEFAULT_FOREGROUND_FALLBACK),
10547
+ defaultBackground: colors?.defaultBackground ? RGBA2.fromHex(colors.defaultBackground) : RGBA2.clone(DEFAULT_BACKGROUND_FALLBACK)
10544
10548
  };
10545
10549
  }
10546
- function buildTerminalPaletteSignature(colors) {
10547
- const normalized = normalizeTerminalPalette(colors);
10550
+ function buildTerminalPaletteSignature2(colors) {
10551
+ const normalized = normalizeTerminalPalette2(colors);
10548
10552
  const paletteSignature = normalized.palette.map((color) => color.toInts().join(",")).join(";");
10549
10553
  return [
10550
10554
  paletteSignature,
@@ -10554,10 +10558,10 @@ function buildTerminalPaletteSignature(colors) {
10554
10558
  }
10555
10559
  // src/lib/paste.ts
10556
10560
  var PASTE_TEXT_DECODER = new TextDecoder;
10557
- function decodePasteBytes(bytes) {
10561
+ function decodePasteBytes2(bytes) {
10558
10562
  return PASTE_TEXT_DECODER.decode(bytes);
10559
10563
  }
10560
- function stripAnsiSequences(text) {
10564
+ function stripAnsiSequences2(text) {
10561
10565
  return stripANSI(text);
10562
10566
  }
10563
10567
  // src/lib/host-clipboard.internal.ts
@@ -10656,8 +10660,8 @@ var validateClipboardText = (text, maxWriteBytes) => {
10656
10660
  var createActiveOperation = (callerSignal) => {
10657
10661
  const controller = new AbortController;
10658
10662
  let settle = () => {};
10659
- const settled = new Promise((resolve3) => {
10660
- settle = resolve3;
10663
+ const settled = new Promise((resolve) => {
10664
+ settle = resolve;
10661
10665
  });
10662
10666
  if (callerSignal) {
10663
10667
  callerSignal.addEventListener("abort", () => controller.abort(callerSignal.reason), {
@@ -10684,7 +10688,7 @@ var runTrackedOperation = (active, callerSignal, operation) => {
10684
10688
  };
10685
10689
  var createHostClipboardWithBackend = (options, createBackend) => {
10686
10690
  const config = normalizeOptions(options);
10687
- const backend2 = createBackend(config);
10691
+ const backend = createBackend(config);
10688
10692
  const active = new Set;
10689
10693
  let disposed = false;
10690
10694
  let disposePromise;
@@ -10704,7 +10708,7 @@ var createHostClipboardWithBackend = (options, createBackend) => {
10704
10708
  if (config.timeoutMs === 0)
10705
10709
  return Promise.resolve({ status: "timed-out" });
10706
10710
  return runTrackedOperation(active, readOptions.signal, async (signal) => {
10707
- const result = await backend2.read({
10711
+ const result = await backend.read({
10708
10712
  preferredTypes,
10709
10713
  selection,
10710
10714
  maxBytes: config.maxReadBytes,
@@ -10730,7 +10734,7 @@ var createHostClipboardWithBackend = (options, createBackend) => {
10730
10734
  return Promise.resolve({ status: "cancelled" });
10731
10735
  if (config.timeoutMs === 0)
10732
10736
  return Promise.resolve({ status: "timed-out" });
10733
- return runTrackedOperation(active, operationOptions.signal, (signal) => backend2.writeText(text, { selection, timeoutMs: config.timeoutMs, signal }));
10737
+ return runTrackedOperation(active, operationOptions.signal, (signal) => backend.writeText(text, { selection, timeoutMs: config.timeoutMs, signal }));
10734
10738
  } catch (error) {
10735
10739
  return Promise.reject(error);
10736
10740
  }
@@ -10743,7 +10747,7 @@ var createHostClipboardWithBackend = (options, createBackend) => {
10743
10747
  return Promise.resolve({ status: "cancelled" });
10744
10748
  if (config.timeoutMs === 0)
10745
10749
  return Promise.resolve({ status: "timed-out" });
10746
- return runTrackedOperation(active, operationOptions.signal, (signal) => backend2.clear({ selection, timeoutMs: config.timeoutMs, signal }));
10750
+ return runTrackedOperation(active, operationOptions.signal, (signal) => backend.clear({ selection, timeoutMs: config.timeoutMs, signal }));
10747
10751
  } catch (error) {
10748
10752
  return Promise.reject(error);
10749
10753
  }
@@ -10756,7 +10760,7 @@ var createHostClipboardWithBackend = (options, createBackend) => {
10756
10760
  operation.controller.abort();
10757
10761
  disposePromise = (async () => {
10758
10762
  await Promise.all([...active].map((operation) => operation.settled));
10759
- await backend2.dispose();
10763
+ await backend.dispose();
10760
10764
  })();
10761
10765
  return disposePromise;
10762
10766
  }
@@ -10787,7 +10791,7 @@ var encodeReadRequest = (preferredTypes) => {
10787
10791
  };
10788
10792
  var startFailure = (status) => ({
10789
10793
  status: "failed",
10790
- error: new Error(`Native clipboard operation failed to start (${NativeClipboardStartStatus[status]})`)
10794
+ error: new Error(`Native clipboard operation failed to start (${NativeClipboardStartStatus2[status]})`)
10791
10795
  });
10792
10796
 
10793
10797
  class NativeClipboardBackend {
@@ -10804,7 +10808,7 @@ class NativeClipboardBackend {
10804
10808
  constructor(maxImagePixels, maxConversionBytes, maxConcurrentOperations, maxProviderTransfers, waylandSeat) {
10805
10809
  this.maxImagePixels = maxImagePixels;
10806
10810
  this.maxConversionBytes = maxConversionBytes;
10807
- this.library = resolveRenderLib();
10811
+ this.library = resolveRenderLib2();
10808
10812
  const service = this.library.clipboardServiceCreate(maxConcurrentOperations, maxProviderTransfers, waylandSeat);
10809
10813
  if (!service)
10810
10814
  throw new Error("Failed to create native clipboard service");
@@ -10836,8 +10840,8 @@ class NativeClipboardBackend {
10836
10840
  if (started.status !== 0 /* Ok */ || !started.operation) {
10837
10841
  return Promise.resolve(startFailure(started.status));
10838
10842
  }
10839
- return new Promise((resolve3, reject) => {
10840
- const operation = { handle: started.operation, kind, signal, resolve: resolve3, reject };
10843
+ return new Promise((resolve, reject) => {
10844
+ const operation = { handle: started.operation, kind, signal, resolve, reject };
10841
10845
  this.pending.set(operation.handle, operation);
10842
10846
  signal.addEventListener("abort", () => this.requestCancel(operation), { once: true });
10843
10847
  this.ensureScheduled();
@@ -10910,14 +10914,14 @@ class NativeClipboardBackend {
10910
10914
  try {
10911
10915
  this.library.clipboardOperationCancel(operation.handle);
10912
10916
  } catch {}
10913
- const status2 = this.library.clipboardOperationPoll(operation.handle);
10914
- if (status2 === 0 /* Pending */) {
10917
+ const status = this.library.clipboardOperationPoll(operation.handle);
10918
+ if (status === 0 /* Pending */) {
10915
10919
  this.rotate(operation);
10916
10920
  continue;
10917
10921
  }
10918
10922
  this.providerActive = true;
10919
- const destroyed2 = this.library.clipboardOperationDestroy(operation.handle);
10920
- if (destroyed2 === 1 /* NotReady */) {
10923
+ const destroyed = this.library.clipboardOperationDestroy(operation.handle);
10924
+ if (destroyed === 1 /* NotReady */) {
10921
10925
  this.rotate(operation);
10922
10926
  continue;
10923
10927
  }
@@ -10982,7 +10986,7 @@ class NativeClipboardBackend {
10982
10986
  invalidResult(kind, status) {
10983
10987
  return {
10984
10988
  status: "failed",
10985
- error: new Error(`Native clipboard ${kind} returned inapplicable status ${NativeClipboardOperationStatus[status]}`)
10989
+ error: new Error(`Native clipboard ${kind} returned inapplicable status ${NativeClipboardOperationStatus2[status]}`)
10986
10990
  };
10987
10991
  }
10988
10992
  readRepresentation(handle) {
@@ -11014,7 +11018,7 @@ class NativeClipboardBackend {
11014
11018
  this.clearPollTimer();
11015
11019
  let status = this.library.clipboardServiceBeginShutdown(this.service);
11016
11020
  while (status === 0 /* Pending */) {
11017
- await new Promise((resolve3) => setTimeout(resolve3, SHUTDOWN_POLL_INTERVAL_MS));
11021
+ await new Promise((resolve) => setTimeout(resolve, SHUTDOWN_POLL_INTERVAL_MS));
11018
11022
  status = this.library.clipboardServicePollShutdown(this.service);
11019
11023
  }
11020
11024
  if (status !== 1 /* Ready */)
@@ -11038,13 +11042,13 @@ var validateSelection = (selection) => {
11038
11042
  }
11039
11043
  return normalized;
11040
11044
  };
11041
- var createHostClipboard = (options = {}) => createHostClipboardWithBackend(options, createNativeHostClipboardBackend);
11045
+ var createHostClipboard2 = (options = {}) => createHostClipboardWithBackend(options, createNativeHostClipboardBackend);
11042
11046
  var validateDestination = (destination) => {
11043
11047
  if (destination !== "terminal-only" && destination !== "host-only" && destination !== "best-available" && destination !== "all-available") {
11044
11048
  throw new TypeError("destination is not a supported clipboard policy");
11045
11049
  }
11046
11050
  };
11047
- var createClipboard = ({ host, terminal }) => {
11051
+ var createClipboard2 = ({ host, terminal }) => {
11048
11052
  const active = new Set;
11049
11053
  let disposed = false;
11050
11054
  let disposePromise;
@@ -11066,8 +11070,8 @@ var createClipboard = ({ host, terminal }) => {
11066
11070
  return { host: { status: "not-attempted" }, terminal: terminalOperation() };
11067
11071
  }
11068
11072
  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 };
11073
+ const terminalResult = !signal.aborted && (hostResult.status === "unsupported" || hostResult.status === "failed") ? terminalOperation() : NOT_ATTEMPTED_TERMINAL;
11074
+ return { host: hostResult, terminal: terminalResult };
11071
11075
  }
11072
11076
  const hostPromise = canUseRemoteHost(options) ? hostOperation() : Promise.resolve({ status: "not-attempted" });
11073
11077
  const terminalResult = terminalOperation();
@@ -11129,14 +11133,14 @@ var createClipboard = ({ host, terminal }) => {
11129
11133
  }
11130
11134
  };
11131
11135
  };
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) => {
11136
+ var ClipboardTarget2;
11137
+ ((ClipboardTarget) => {
11138
+ ClipboardTarget[ClipboardTarget["Clipboard"] = 0] = "Clipboard";
11139
+ ClipboardTarget[ClipboardTarget["Primary"] = 1] = "Primary";
11140
+ ClipboardTarget[ClipboardTarget["Select"] = 2] = "Select";
11141
+ ClipboardTarget[ClipboardTarget["Secondary"] = 3] = "Secondary";
11142
+ })(ClipboardTarget2 ||= {});
11143
+ var createRendererClipboardAdapter2 = (renderer) => {
11140
11144
  const targetFor = (selection) => selection === "primary" ? 1 /* Primary */ : 0 /* Clipboard */;
11141
11145
  const capability = () => renderer.capabilities?.osc52_support ?? "unknown";
11142
11146
  return {
@@ -11164,7 +11168,7 @@ var createRendererClipboardAdapter = (renderer) => {
11164
11168
  };
11165
11169
  };
11166
11170
 
11167
- class Clipboard {
11171
+ class Clipboard2 {
11168
11172
  lib;
11169
11173
  rendererPtr;
11170
11174
  constructor(lib, rendererPtr) {
@@ -11191,44 +11195,163 @@ class Clipboard {
11191
11195
  }
11192
11196
  // src/lib/detect-links.ts
11193
11197
  var URL_SCOPES = ["markup.link.url", "string.special.url"];
11194
- function detectLinks(chunks, context) {
11198
+ var HTTP_URL_PREFIX = /https?:\/\//i;
11199
+ var BARE_URL = /https?:\/\/[^\s<>"`]+/gi;
11200
+ function normalizeMarkdownLinkTarget(destination) {
11201
+ return destination.replace(/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g, "$1");
11202
+ }
11203
+ function detectLinks2(chunks, context) {
11195
11204
  const content = context.content;
11196
11205
  const highlights = context.highlights;
11206
+ const hasBareUrl = HTTP_URL_PREFIX.test(content);
11207
+ if (!hasBareUrl && !highlights.some(([, , group]) => URL_SCOPES.includes(group)))
11208
+ return chunks;
11197
11209
  const ranges = [];
11210
+ const rawRanges = [];
11211
+ const labels = new Map;
11212
+ const concealedDelimiters = new Map;
11198
11213
  for (let i = 0;i < highlights.length; i++) {
11199
- const [start, end, group] = highlights[i];
11214
+ const [start, end, group, meta] = highlights[i];
11215
+ if (group === "conceal" && meta?.conceal === "" && /^[*_~]+$/.test(content.slice(start, end))) {
11216
+ concealedDelimiters.set(end, start);
11217
+ }
11218
+ if (group === "markup.raw" || group.startsWith("markup.raw.")) {
11219
+ rawRanges.push({ start, end });
11220
+ }
11221
+ if (group === "markup.link.label") {
11222
+ const existing = labels.get(end);
11223
+ if (!existing || start < existing.start)
11224
+ labels.set(end, { start, end });
11225
+ }
11200
11226
  if (!URL_SCOPES.includes(group))
11201
11227
  continue;
11202
11228
  const url = content.slice(start, end);
11229
+ if (!url)
11230
+ continue;
11203
11231
  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;
11232
+ }
11233
+ const highlightedCount = ranges.length;
11234
+ for (let index = 0;index < highlightedCount; index++) {
11235
+ const range = ranges[index];
11236
+ let labelEnd = range.start;
11237
+ if (content[labelEnd - 1] === "<")
11238
+ labelEnd--;
11239
+ while (labelEnd > 0 && /\s/.test(content[labelEnd - 1]))
11240
+ labelEnd--;
11241
+ if (content[labelEnd - 1] !== "(" || content[labelEnd - 2] !== "]")
11242
+ continue;
11243
+ const label = labels.get(labelEnd - 2);
11244
+ if (!label)
11245
+ continue;
11246
+ range.url = normalizeMarkdownLinkTarget(range.url);
11247
+ ranges.push({ ...label, url: range.url, label: true });
11248
+ }
11249
+ if (hasBareUrl) {
11250
+ rawRanges.sort((a, b) => a.start - b.start || b.end - a.end);
11251
+ ranges.sort((a, b) => a.start - b.start || b.end - a.end);
11252
+ let rawIndex = 0;
11253
+ let highlightedIndex = 0;
11254
+ for (const match of content.matchAll(BARE_URL)) {
11255
+ const start = match.index;
11256
+ let url = match[0];
11257
+ let openParens = 0;
11258
+ let closeParens = 0;
11259
+ for (const character of url) {
11260
+ if (character === "(")
11261
+ openParens++;
11262
+ if (character === ")")
11263
+ closeParens++;
11209
11264
  }
11210
- if (!prev.startsWith("markup.link"))
11211
- break;
11265
+ while (url.length > 0) {
11266
+ const delimiterStart = concealedDelimiters.get(start + url.length);
11267
+ if (delimiterStart !== undefined && delimiterStart >= start) {
11268
+ url = url.slice(0, delimiterStart - start);
11269
+ continue;
11270
+ }
11271
+ const last = url[url.length - 1];
11272
+ if (last === ")" && closeParens > openParens) {
11273
+ closeParens--;
11274
+ } else if (!".,!?;:]}'".includes(last)) {
11275
+ break;
11276
+ }
11277
+ url = url.slice(0, -1);
11278
+ }
11279
+ const end = start + url.length;
11280
+ if (!url)
11281
+ continue;
11282
+ while (rawIndex < rawRanges.length && rawRanges[rawIndex].end <= start)
11283
+ rawIndex++;
11284
+ if (rawIndex < rawRanges.length && rawRanges[rawIndex].start < end)
11285
+ continue;
11286
+ while (highlightedIndex < ranges.length && ranges[highlightedIndex].end <= start)
11287
+ highlightedIndex++;
11288
+ if (highlightedIndex < ranges.length && ranges[highlightedIndex].start < end)
11289
+ continue;
11290
+ ranges.push({ start, end, url });
11212
11291
  }
11213
11292
  }
11214
11293
  if (ranges.length === 0)
11215
11294
  return chunks;
11295
+ ranges.sort((a, b) => a.start - b.start || b.end - a.end || Number(b.label ?? false) - Number(a.label ?? false));
11296
+ const linkedChunks = [];
11216
11297
  let contentPos = 0;
11217
- for (const chunk of chunks) {
11218
- if (chunk.text.length <= 1)
11298
+ let rangeIndex = 0;
11299
+ for (let index = 0;index < chunks.length; index++) {
11300
+ const chunk = chunks[index];
11301
+ if (!chunk.text || chunk.link) {
11302
+ linkedChunks.push(chunk);
11219
11303
  continue;
11220
- const idx = content.indexOf(chunk.text, contentPos);
11221
- if (idx < 0)
11304
+ }
11305
+ const providedRange = context.sourceRanges?.[index];
11306
+ const start = providedRange?.start ?? content.indexOf(chunk.text, contentPos);
11307
+ if (start < 0) {
11308
+ linkedChunks.push(chunk);
11222
11309
  continue;
11223
- for (const range of ranges) {
11224
- if (idx < range.end && idx + chunk.text.length > range.start) {
11310
+ }
11311
+ const end = providedRange?.end ?? start + chunk.text.length;
11312
+ contentPos = end;
11313
+ while (rangeIndex < ranges.length && ranges[rangeIndex].end <= start)
11314
+ rangeIndex++;
11315
+ if (content.slice(start, end) !== chunk.text) {
11316
+ const range = ranges[rangeIndex];
11317
+ if (range?.label && range.start < end)
11225
11318
  chunk.link = { url: range.url };
11319
+ linkedChunks.push(chunk);
11320
+ continue;
11321
+ }
11322
+ let position = start;
11323
+ for (;rangeIndex < ranges.length; rangeIndex++) {
11324
+ const range = ranges[rangeIndex];
11325
+ if (range.end <= position)
11326
+ continue;
11327
+ if (range.start >= end)
11226
11328
  break;
11329
+ const linkStart = Math.max(position, range.start);
11330
+ const linkEnd = Math.min(end, range.end);
11331
+ if (linkStart > position) {
11332
+ linkedChunks.push({ ...chunk, text: chunk.text.slice(position - start, linkStart - start) });
11227
11333
  }
11334
+ if (linkStart === start && linkEnd === end) {
11335
+ chunk.link = { url: range.url };
11336
+ linkedChunks.push(chunk);
11337
+ } else {
11338
+ linkedChunks.push({
11339
+ ...chunk,
11340
+ text: chunk.text.slice(linkStart - start, linkEnd - start),
11341
+ link: { url: range.url }
11342
+ });
11343
+ }
11344
+ position = linkEnd;
11345
+ if (position === end)
11346
+ break;
11347
+ }
11348
+ if (position === start) {
11349
+ linkedChunks.push(chunk);
11350
+ } else if (position < end) {
11351
+ linkedChunks.push({ ...chunk, text: chunk.text.slice(position - start) });
11228
11352
  }
11229
- contentPos = idx + chunk.text.length;
11230
11353
  }
11231
- return chunks;
11354
+ return linkedChunks;
11232
11355
  }
11233
11356
  // src/buffer.ts
11234
11357
  function requireInteger(value, name, min, max) {
@@ -11236,18 +11359,18 @@ function requireInteger(value, name, min, max) {
11236
11359
  throw new RangeError(`${name} must be an integer from ${min} to ${max}`);
11237
11360
  }
11238
11361
  }
11239
- function packDrawOptions(border2, shouldFill, titleAlignment, bottomTitleAlignment) {
11362
+ function packDrawOptions(border, shouldFill, titleAlignment, bottomTitleAlignment) {
11240
11363
  let packed = 0;
11241
- if (border2 === true) {
11364
+ if (border === true) {
11242
11365
  packed |= 15;
11243
- } else if (Array.isArray(border2)) {
11244
- if (border2.includes("top"))
11366
+ } else if (Array.isArray(border)) {
11367
+ if (border.includes("top"))
11245
11368
  packed |= 8;
11246
- if (border2.includes("right"))
11369
+ if (border.includes("right"))
11247
11370
  packed |= 4;
11248
- if (border2.includes("bottom"))
11371
+ if (border.includes("bottom"))
11249
11372
  packed |= 2;
11250
- if (border2.includes("left"))
11373
+ if (border.includes("left"))
11251
11374
  packed |= 1;
11252
11375
  }
11253
11376
  if (shouldFill) {
@@ -11265,7 +11388,7 @@ function packDrawOptions(border2, shouldFill, titleAlignment, bottomTitleAlignme
11265
11388
  return packed;
11266
11389
  }
11267
11390
 
11268
- class OptimizedBuffer {
11391
+ class OptimizedBuffer2 {
11269
11392
  static fbIdCounter = 0;
11270
11393
  id;
11271
11394
  lib;
@@ -11304,17 +11427,17 @@ class OptimizedBuffer {
11304
11427
  this.ensureRawBufferViews();
11305
11428
  return this._rawBuffers;
11306
11429
  }
11307
- constructor(lib, ptr2, width, height, options) {
11308
- this.id = options.id || `fb_${OptimizedBuffer.fbIdCounter++}`;
11430
+ constructor(lib, ptr, width, height, options) {
11431
+ this.id = options.id || `fb_${OptimizedBuffer2.fbIdCounter++}`;
11309
11432
  this.lib = lib;
11310
11433
  this.respectAlpha = options.respectAlpha || false;
11311
11434
  this._width = width;
11312
11435
  this._height = height;
11313
11436
  this._widthMethod = options.widthMethod || "unicode";
11314
- this.bufferPtr = ptr2;
11437
+ this.bufferPtr = ptr;
11315
11438
  }
11316
11439
  static create(width, height, widthMethod, options = {}) {
11317
- const lib = resolveRenderLib();
11440
+ const lib = resolveRenderLib2();
11318
11441
  const respectAlpha = options.respectAlpha || false;
11319
11442
  const id = options.id && options.id.trim() !== "" ? options.id : "unnamed buffer";
11320
11443
  const buffer = lib.createOptimizedBuffer(width, height, widthMethod, respectAlpha, id);
@@ -11347,7 +11470,7 @@ class OptimizedBuffer {
11347
11470
  }
11348
11471
  getSpanLines() {
11349
11472
  this.guard();
11350
- const { char, fg: fg2, bg: bg2, attributes } = this.buffers;
11473
+ const { char, fg, bg, attributes } = this.buffers;
11351
11474
  const lines = [];
11352
11475
  const CHAR_FLAG_CONTINUATION = 3221225472 | 0;
11353
11476
  const CHAR_FLAG_MASK = 3221225472 | 0;
@@ -11362,8 +11485,8 @@ class OptimizedBuffer {
11362
11485
  for (let x = 0;x < this._width; x++) {
11363
11486
  const i = y * this._width + x;
11364
11487
  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));
11488
+ const cellFg = RGBA2.fromArray(fg.slice(i * 4, i * 4 + 4));
11489
+ const cellBg = RGBA2.fromArray(bg.slice(i * 4, i * 4 + 4));
11367
11490
  const cellAttrs = attributes[i] & 255;
11368
11491
  const isContinuation = (cp & CHAR_FLAG_MASK) === CHAR_FLAG_CONTINUATION;
11369
11492
  const cellChar = isContinuation ? "" : lineChars[charIdx++] ?? " ";
@@ -11390,38 +11513,38 @@ class OptimizedBuffer {
11390
11513
  }
11391
11514
  return lines;
11392
11515
  }
11393
- clear(bg2 = RGBA.fromValues(0, 0, 0, 1)) {
11516
+ clear(bg = RGBA2.fromValues(0, 0, 0, 1)) {
11394
11517
  this.guard();
11395
- this.lib.bufferClear(this.bufferPtr, bg2);
11518
+ this.lib.bufferClear(this.bufferPtr, bg);
11396
11519
  }
11397
- setCell(x, y, char, fg2, bg2, attributes = 0) {
11520
+ setCell(x, y, char, fg, bg, attributes = 0) {
11398
11521
  this.guard();
11399
- this.lib.bufferSetCell(this.bufferPtr, x, y, char, fg2, bg2, attributes);
11522
+ this.lib.bufferSetCell(this.bufferPtr, x, y, char, fg, bg, attributes);
11400
11523
  }
11401
- setCellWithAlphaBlending(x, y, char, fg2, bg2, attributes = 0) {
11524
+ setCellWithAlphaBlending(x, y, char, fg, bg, attributes = 0) {
11402
11525
  this.guard();
11403
- this.lib.bufferSetCellWithAlphaBlending(this.bufferPtr, x, y, char, fg2, bg2, attributes);
11526
+ this.lib.bufferSetCellWithAlphaBlending(this.bufferPtr, x, y, char, fg, bg, attributes);
11404
11527
  }
11405
- drawText(text, x, y, fg2, bg2, attributes = 0, selection2) {
11528
+ drawText(text, x, y, fg, bg, attributes = 0, selection) {
11406
11529
  this.guard();
11407
- if (!selection2) {
11408
- this.lib.bufferDrawText(this.bufferPtr, text, x, y, fg2, bg2, attributes);
11530
+ if (!selection) {
11531
+ this.lib.bufferDrawText(this.bufferPtr, text, x, y, fg, bg, attributes);
11409
11532
  return;
11410
11533
  }
11411
- const { start, end } = selection2;
11534
+ const { start, end } = selection;
11412
11535
  let selectionBg;
11413
11536
  let selectionFg;
11414
- if (selection2.bgColor) {
11415
- selectionBg = selection2.bgColor;
11416
- selectionFg = selection2.fgColor || fg2;
11537
+ if (selection.bgColor) {
11538
+ selectionBg = selection.bgColor;
11539
+ selectionFg = selection.fgColor || fg;
11417
11540
  } 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;
11541
+ const defaultBg = bg || RGBA2.fromValues(0, 0, 0, 0);
11542
+ selectionFg = defaultBg.a > 0 ? defaultBg : RGBA2.fromValues(0, 0, 0, 1);
11543
+ selectionBg = fg;
11421
11544
  }
11422
11545
  if (start > 0) {
11423
11546
  const beforeText = text.slice(0, start);
11424
- this.lib.bufferDrawText(this.bufferPtr, beforeText, x, y, fg2, bg2, attributes);
11547
+ this.lib.bufferDrawText(this.bufferPtr, beforeText, x, y, fg, bg, attributes);
11425
11548
  }
11426
11549
  if (end > start) {
11427
11550
  const selectedText = text.slice(start, end);
@@ -11429,12 +11552,12 @@ class OptimizedBuffer {
11429
11552
  }
11430
11553
  if (end < text.length) {
11431
11554
  const afterText = text.slice(end);
11432
- this.lib.bufferDrawText(this.bufferPtr, afterText, x + end, y, fg2, bg2, attributes);
11555
+ this.lib.bufferDrawText(this.bufferPtr, afterText, x + end, y, fg, bg, attributes);
11433
11556
  }
11434
11557
  }
11435
- fillRect(x, y, width, height, bg2) {
11558
+ fillRect(x, y, width, height, bg) {
11436
11559
  this.guard();
11437
- this.lib.bufferFillRect(this.bufferPtr, x, y, width, height, bg2);
11560
+ this.lib.bufferFillRect(this.bufferPtr, x, y, width, height, bg);
11438
11561
  }
11439
11562
  colorMatrix(matrix, cellMask, strength = 1, target = 3 /* Both */) {
11440
11563
  this.guard();
@@ -11495,13 +11618,13 @@ class OptimizedBuffer {
11495
11618
  this.guard();
11496
11619
  this.lib.bufferDrawPackedBuffer(this.bufferPtr, typeof data === "number" || typeof data === "bigint" ? toPointer(data) : data, dataLen, posX, posY, terminalWidthCells, terminalHeightCells);
11497
11620
  }
11498
- drawGrayscaleBuffer(posX, posY, intensities, srcWidth, srcHeight, fg2 = null, bg2 = null) {
11621
+ drawGrayscaleBuffer(posX, posY, intensities, srcWidth, srcHeight, fg = null, bg = null) {
11499
11622
  this.guard();
11500
- this.lib.bufferDrawGrayscaleBuffer(this.bufferPtr, posX, posY, intensities, srcWidth, srcHeight, fg2, bg2);
11623
+ this.lib.bufferDrawGrayscaleBuffer(this.bufferPtr, posX, posY, intensities, srcWidth, srcHeight, fg, bg);
11501
11624
  }
11502
- drawGrayscaleBufferSupersampled(posX, posY, intensities, srcWidth, srcHeight, fg2 = null, bg2 = null) {
11625
+ drawGrayscaleBufferSupersampled(posX, posY, intensities, srcWidth, srcHeight, fg = null, bg = null) {
11503
11626
  this.guard();
11504
- this.lib.bufferDrawGrayscaleBufferSupersampled(this.bufferPtr, posX, posY, intensities, srcWidth, srcHeight, fg2, bg2);
11627
+ this.lib.bufferDrawGrayscaleBufferSupersampled(this.bufferPtr, posX, posY, intensities, srcWidth, srcHeight, fg, bg);
11505
11628
  }
11506
11629
  resize(width, height) {
11507
11630
  this.guard();
@@ -11514,8 +11637,8 @@ class OptimizedBuffer {
11514
11637
  }
11515
11638
  drawBox(options) {
11516
11639
  this.guard();
11517
- const style = parseBorderStyle(options.borderStyle, "single");
11518
- const borderChars = options.customBorderChars ?? BorderCharArrays[style];
11640
+ const style = parseBorderStyle2(options.borderStyle, "single");
11641
+ const borderChars = options.customBorderChars ?? BorderCharArrays2[style];
11519
11642
  const packedOptions = packDrawOptions(options.border, options.shouldFill ?? false, options.titleAlignment || "left", options.bottomTitleAlignment || "left");
11520
11643
  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
11644
  }
@@ -11564,14 +11687,14 @@ class OptimizedBuffer {
11564
11687
  drawOuter: options.drawOuter
11565
11688
  });
11566
11689
  }
11567
- drawChar(char, x, y, fg2, bg2, attributes = 0) {
11690
+ drawChar(char, x, y, fg, bg, attributes = 0) {
11568
11691
  this.guard();
11569
- this.lib.bufferDrawChar(this.bufferPtr, char, x, y, fg2, bg2, attributes);
11692
+ this.lib.bufferDrawChar(this.bufferPtr, char, x, y, fg, bg, attributes);
11570
11693
  }
11571
11694
  }
11572
11695
 
11573
11696
  // src/text-buffer.ts
11574
- class TextBuffer {
11697
+ class TextBuffer2 {
11575
11698
  lib;
11576
11699
  bufferPtr;
11577
11700
  _length = 0;
@@ -11581,12 +11704,12 @@ class TextBuffer {
11581
11704
  _textBytes;
11582
11705
  _memId;
11583
11706
  _appendedChunks = [];
11584
- constructor(lib, ptr2) {
11707
+ constructor(lib, ptr) {
11585
11708
  this.lib = lib;
11586
- this.bufferPtr = ptr2;
11709
+ this.bufferPtr = ptr;
11587
11710
  }
11588
11711
  static create(widthMethod) {
11589
- const lib = resolveRenderLib();
11712
+ const lib = resolveRenderLib2();
11590
11713
  return lib.createTextBuffer(widthMethod);
11591
11714
  }
11592
11715
  guard() {
@@ -11614,11 +11737,11 @@ class TextBuffer {
11614
11737
  this._length = this.lib.textBufferGetLength(this.bufferPtr);
11615
11738
  this._byteSize = this.lib.textBufferGetByteSize(this.bufferPtr);
11616
11739
  }
11617
- loadFile(path3) {
11740
+ loadFile(path) {
11618
11741
  this.guard();
11619
- const success = this.lib.textBufferLoadFile(this.bufferPtr, path3);
11742
+ const success = this.lib.textBufferLoadFile(this.bufferPtr, path);
11620
11743
  if (!success) {
11621
- throw new Error(`Failed to load file: ${path3}`);
11744
+ throw new Error(`Failed to load file: ${path}`);
11622
11745
  }
11623
11746
  this._length = this.lib.textBufferGetLength(this.bufferPtr);
11624
11747
  this._byteSize = this.lib.textBufferGetByteSize(this.bufferPtr);
@@ -11630,13 +11753,13 @@ class TextBuffer {
11630
11753
  this._length = this.lib.textBufferGetLength(this.bufferPtr);
11631
11754
  this._byteSize = this.lib.textBufferGetByteSize(this.bufferPtr);
11632
11755
  }
11633
- setDefaultFg(fg2) {
11756
+ setDefaultFg(fg) {
11634
11757
  this.guard();
11635
- this.lib.textBufferSetDefaultFg(this.bufferPtr, fg2);
11758
+ this.lib.textBufferSetDefaultFg(this.bufferPtr, fg);
11636
11759
  }
11637
- setDefaultBg(bg2) {
11760
+ setDefaultBg(bg) {
11638
11761
  this.guard();
11639
- this.lib.textBufferSetDefaultBg(this.bufferPtr, bg2);
11762
+ this.lib.textBufferSetDefaultBg(this.bufferPtr, bg);
11640
11763
  }
11641
11764
  setDefaultAttributes(attributes) {
11642
11765
  this.guard();
@@ -11785,11 +11908,11 @@ async function loadBackend2() {
11785
11908
  function importModule(specifier) {
11786
11909
  return import(specifier).then((module) => module.default ?? module);
11787
11910
  }
11788
- function createBunBackend2(bun2) {
11911
+ function createBunBackend2(bun) {
11789
11912
  return {
11790
- ptr: bun2.ptr,
11913
+ ptr: bun.ptr,
11791
11914
  toArrayBuffer(pointer, offset, length) {
11792
- return bun2.toArrayBuffer(toBunPointer2(pointer), offset, length);
11915
+ return bun.toArrayBuffer(toBunPointer2(pointer), offset, length);
11793
11916
  }
11794
11917
  };
11795
11918
  }
@@ -11892,7 +12015,7 @@ function enumTypeError(value) {
11892
12015
  throw new TypeError(`Invalid enum value: ${value}`);
11893
12016
  }
11894
12017
  function defineEnum(mapping, base = "u32") {
11895
- const reverse2 = Object.fromEntries(Object.entries(mapping).map(([k, v]) => [v, k]));
12018
+ const reverse = Object.fromEntries(Object.entries(mapping).map(([k, v]) => [v, k]));
11896
12019
  return {
11897
12020
  __type: "enum",
11898
12021
  type: base,
@@ -11900,7 +12023,7 @@ function defineEnum(mapping, base = "u32") {
11900
12023
  return typeof value === "number" ? value : mapping[value] ?? enumTypeError(String(value));
11901
12024
  },
11902
12025
  from(value) {
11903
- return reverse2[value] ?? enumTypeError(String(value));
12026
+ return reverse[value] ?? enumTypeError(String(value));
11904
12027
  },
11905
12028
  enum: mapping
11906
12029
  };
@@ -13051,7 +13174,7 @@ function defineStruct(fields, structDefOptions) {
13051
13174
 
13052
13175
  // src/zig-structs.ts
13053
13176
  var rgbaPackTransform = (rgba) => rgba?.buffer ?? null;
13054
- var rgbaUnpackTransform = (ptr3) => ptr3 ? RGBA.fromArray(new Uint16Array(toArrayBuffer(ptr3, 0, 8))) : undefined;
13177
+ var rgbaUnpackTransform = (ptr) => ptr ? RGBA2.fromArray(new Uint16Array(toArrayBuffer(ptr, 0, 8))) : undefined;
13055
13178
  var StyledChunkStruct = defineStruct([
13056
13179
  ["text", "char*"],
13057
13180
  ["text_len", "u64", { lengthOf: "text" }],
@@ -13078,8 +13201,8 @@ var StyledChunkStruct = defineStruct([
13078
13201
  ["link_len", "u64", { lengthOf: "link" }]
13079
13202
  ], {
13080
13203
  mapValue: (chunk) => {
13081
- const normalizedFg = normalizeColorValue(chunk.fg ?? null);
13082
- const normalizedBg = normalizeColorValue(chunk.bg ?? null);
13204
+ const normalizedFg = normalizeColorValue2(chunk.fg ?? null);
13205
+ const normalizedBg = normalizeColorValue2(chunk.bg ?? null);
13083
13206
  if (!chunk.link || typeof chunk.link === "string") {
13084
13207
  return {
13085
13208
  ...chunk,
@@ -13300,11 +13423,12 @@ var ReserveInfoStruct = defineStruct([
13300
13423
  len: value.len
13301
13424
  })
13302
13425
  });
13303
- var NativeAudioStreamFormat = {
13426
+ var NativeAudioStreamFormat2 = {
13304
13427
  Mp3: 1,
13305
- Flac: 2
13428
+ Flac: 2,
13429
+ Pcm: 3
13306
13430
  };
13307
- var NativeAudioStreamState = {
13431
+ var NativeAudioStreamState2 = {
13308
13432
  Initializing: 0,
13309
13433
  Buffering: 1,
13310
13434
  Playing: 2,
@@ -13322,7 +13446,7 @@ var NativeAudioStreamStateNames = [
13322
13446
  "disposed",
13323
13447
  "reconnecting"
13324
13448
  ];
13325
- var NativeAudioStreamCloseReason = {
13449
+ var NativeAudioStreamCloseReason2 = {
13326
13450
  PreserveNativeTerminal: 0,
13327
13451
  TransportError: 1,
13328
13452
  Disposed: 2
@@ -13362,7 +13486,9 @@ var AudioStreamCreateOptionsStruct = defineStruct([
13362
13486
  ["pan", "f32"],
13363
13487
  ["groupId", "u32"],
13364
13488
  ["maxProbeBytes", "u32"],
13365
- ["format", "u32"]
13489
+ ["format", "u32"],
13490
+ ["sampleRate", "u32", { default: 0 }],
13491
+ ["channels", "u32", { default: 0 }]
13366
13492
  ]);
13367
13493
  var AudioStreamStatsStruct = defineStruct([
13368
13494
  ["bytesReceived", "u64"],
@@ -13396,64 +13522,69 @@ var AudioStatsStruct = defineStruct([
13396
13522
  ]);
13397
13523
 
13398
13524
  // src/zig.ts
13399
- var NativeAudioStreamState2 = NativeAudioStreamState;
13400
- var NativeAudioStreamCloseReason2 = NativeAudioStreamCloseReason;
13401
- var NativeAudioStreamFormat2 = NativeAudioStreamFormat;
13402
- registerEnvVar({
13525
+ var NativeAudioStreamState3 = NativeAudioStreamState2;
13526
+ var NativeAudioStreamCloseReason3 = NativeAudioStreamCloseReason2;
13527
+ var NativeAudioStreamFormat3 = NativeAudioStreamFormat2;
13528
+ var MAX_LINK_URL_BYTES2 = 512;
13529
+ function allocFFIStruct(structDefinition) {
13530
+ const storage = allocStruct(structDefinition);
13531
+ return { ...storage, ffiView: new Uint8Array(storage.buffer) };
13532
+ }
13533
+ registerEnvVar2({
13403
13534
  name: "OPENTUI_LIBC",
13404
13535
  description: "Select Linux native libc package. Supported values: glibc, musl.",
13405
13536
  type: "string",
13406
13537
  default: ""
13407
13538
  });
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 ||= {});
13539
+ var NativeClipboardOperationStatus2;
13540
+ ((NativeClipboardOperationStatus) => {
13541
+ NativeClipboardOperationStatus[NativeClipboardOperationStatus["Pending"] = 0] = "Pending";
13542
+ NativeClipboardOperationStatus[NativeClipboardOperationStatus["Read"] = 1] = "Read";
13543
+ NativeClipboardOperationStatus[NativeClipboardOperationStatus["Empty"] = 2] = "Empty";
13544
+ NativeClipboardOperationStatus[NativeClipboardOperationStatus["Written"] = 3] = "Written";
13545
+ NativeClipboardOperationStatus[NativeClipboardOperationStatus["Cleared"] = 4] = "Cleared";
13546
+ NativeClipboardOperationStatus[NativeClipboardOperationStatus["Unsupported"] = 5] = "Unsupported";
13547
+ NativeClipboardOperationStatus[NativeClipboardOperationStatus["Cancelled"] = 6] = "Cancelled";
13548
+ NativeClipboardOperationStatus[NativeClipboardOperationStatus["TimedOut"] = 7] = "TimedOut";
13549
+ NativeClipboardOperationStatus[NativeClipboardOperationStatus["LimitExceeded"] = 8] = "LimitExceeded";
13550
+ NativeClipboardOperationStatus[NativeClipboardOperationStatus["Failed"] = 9] = "Failed";
13551
+ NativeClipboardOperationStatus[NativeClipboardOperationStatus["InvalidHandle"] = 10] = "InvalidHandle";
13552
+ })(NativeClipboardOperationStatus2 ||= {});
13553
+ var NativeClipboardStartStatus2;
13554
+ ((NativeClipboardStartStatus) => {
13555
+ NativeClipboardStartStatus[NativeClipboardStartStatus["Ok"] = 0] = "Ok";
13556
+ NativeClipboardStartStatus[NativeClipboardStartStatus["InvalidService"] = 1] = "InvalidService";
13557
+ NativeClipboardStartStatus[NativeClipboardStartStatus["ShuttingDown"] = 2] = "ShuttingDown";
13558
+ NativeClipboardStartStatus[NativeClipboardStartStatus["LimitExceeded"] = 3] = "LimitExceeded";
13559
+ NativeClipboardStartStatus[NativeClipboardStartStatus["InvalidArgument"] = 4] = "InvalidArgument";
13560
+ NativeClipboardStartStatus[NativeClipboardStartStatus["OutOfMemory"] = 5] = "OutOfMemory";
13561
+ })(NativeClipboardStartStatus2 ||= {});
13562
+ var NativeClipboardCancelStatus2;
13563
+ ((NativeClipboardCancelStatus) => {
13564
+ NativeClipboardCancelStatus[NativeClipboardCancelStatus["Requested"] = 0] = "Requested";
13565
+ NativeClipboardCancelStatus[NativeClipboardCancelStatus["AlreadyTerminal"] = 1] = "AlreadyTerminal";
13566
+ NativeClipboardCancelStatus[NativeClipboardCancelStatus["InvalidHandle"] = 2] = "InvalidHandle";
13567
+ })(NativeClipboardCancelStatus2 ||= {});
13568
+ var NativeClipboardCopyStatus2;
13569
+ ((NativeClipboardCopyStatus) => {
13570
+ NativeClipboardCopyStatus[NativeClipboardCopyStatus["Ok"] = 0] = "Ok";
13571
+ NativeClipboardCopyStatus[NativeClipboardCopyStatus["BufferTooSmall"] = 1] = "BufferTooSmall";
13572
+ NativeClipboardCopyStatus[NativeClipboardCopyStatus["InvalidHandle"] = 2] = "InvalidHandle";
13573
+ NativeClipboardCopyStatus[NativeClipboardCopyStatus["InvalidState"] = 3] = "InvalidState";
13574
+ NativeClipboardCopyStatus[NativeClipboardCopyStatus["InvalidArgument"] = 4] = "InvalidArgument";
13575
+ })(NativeClipboardCopyStatus2 ||= {});
13576
+ var NativeClipboardDestroyStatus2;
13577
+ ((NativeClipboardDestroyStatus) => {
13578
+ NativeClipboardDestroyStatus[NativeClipboardDestroyStatus["Destroyed"] = 0] = "Destroyed";
13579
+ NativeClipboardDestroyStatus[NativeClipboardDestroyStatus["NotReady"] = 1] = "NotReady";
13580
+ NativeClipboardDestroyStatus[NativeClipboardDestroyStatus["InvalidHandle"] = 2] = "InvalidHandle";
13581
+ })(NativeClipboardDestroyStatus2 ||= {});
13582
+ var NativeClipboardShutdownStatus2;
13583
+ ((NativeClipboardShutdownStatus) => {
13584
+ NativeClipboardShutdownStatus[NativeClipboardShutdownStatus["Pending"] = 0] = "Pending";
13585
+ NativeClipboardShutdownStatus[NativeClipboardShutdownStatus["Ready"] = 1] = "Ready";
13586
+ NativeClipboardShutdownStatus[NativeClipboardShutdownStatus["InvalidHandle"] = 2] = "InvalidHandle";
13587
+ })(NativeClipboardShutdownStatus2 ||= {});
13457
13588
  var targetLibPath;
13458
13589
  var targetLibError;
13459
13590
  try {
@@ -13467,43 +13598,43 @@ try {
13467
13598
  } catch (error) {
13468
13599
  targetLibError = error instanceof Error ? error : new Error(String(error));
13469
13600
  }
13470
- registerEnvVar({
13601
+ registerEnvVar2({
13471
13602
  name: "OTUI_DEBUG_FFI",
13472
13603
  description: "Enable debug logging for the FFI bindings.",
13473
13604
  type: "boolean",
13474
13605
  default: false
13475
13606
  });
13476
- registerEnvVar({
13607
+ registerEnvVar2({
13477
13608
  name: "OTUI_TRACE_FFI",
13478
13609
  description: "Enable tracing for the FFI bindings.",
13479
13610
  type: "boolean",
13480
13611
  default: false
13481
13612
  });
13482
- registerEnvVar({
13613
+ registerEnvVar2({
13483
13614
  name: "OPENTUI_FORCE_WCWIDTH",
13484
13615
  description: "Use wcwidth for character width calculations when the variable is present",
13485
13616
  type: "string",
13486
13617
  required: false
13487
13618
  });
13488
- registerEnvVar({
13619
+ registerEnvVar2({
13489
13620
  name: "OPENTUI_FORCE_UNICODE",
13490
13621
  description: "Force Mode 2026 Unicode support when the variable is present",
13491
13622
  type: "string",
13492
13623
  required: false
13493
13624
  });
13494
- registerEnvVar({
13625
+ registerEnvVar2({
13495
13626
  name: "OPENTUI_GRAPHICS",
13496
13627
  description: "Control Kitty and Sixel graphics detection with the exact value true, 1, false, or 0",
13497
13628
  type: "string",
13498
13629
  required: false
13499
13630
  });
13500
- registerEnvVar({
13631
+ registerEnvVar2({
13501
13632
  name: "OPENTUI_IMAGE_PROTOCOL",
13502
13633
  description: "Override image rendering protocol: auto, kitty, sixel, or blocks",
13503
13634
  type: "string",
13504
13635
  default: "auto"
13505
13636
  });
13506
- registerEnvVar({
13637
+ registerEnvVar2({
13507
13638
  name: "OPENTUI_FORCE_NOZWJ",
13508
13639
  description: "Use no_zwj width mode when the variable is present",
13509
13640
  type: "string",
@@ -13671,11 +13802,11 @@ function getOpenTUILib(libPath) {
13671
13802
  returns: "i32"
13672
13803
  },
13673
13804
  embeddedTerminalCursor: {
13674
- args: ["u32", "ptr"],
13805
+ args: ["u32", "buffer"],
13675
13806
  returns: "i32"
13676
13807
  },
13677
13808
  embeddedTerminalEncodeKey: {
13678
- args: ["u32", "ptr", "ptr", "u32", "ptr", "u32", "ptr", "u32", "ptr"],
13809
+ args: ["u32", "buffer", "ptr", "u32", "ptr", "u32", "ptr", "u32", "ptr"],
13679
13810
  returns: "i32"
13680
13811
  },
13681
13812
  embeddedTerminalEncodeMouse: {
@@ -14015,7 +14146,7 @@ function getOpenTUILib(libPath) {
14015
14146
  returns: "void"
14016
14147
  },
14017
14148
  bufferDrawImage: {
14018
- args: ["u32", "u32", "ptr"],
14149
+ args: ["u32", "u32", "buffer"],
14019
14150
  returns: "u8"
14020
14151
  },
14021
14152
  bufferDrawPackedBuffer: {
@@ -14031,7 +14162,7 @@ function getOpenTUILib(libPath) {
14031
14162
  returns: "void"
14032
14163
  },
14033
14164
  bufferDrawGrid: {
14034
- args: ["u32", "buffer", "buffer", "buffer", "buffer", "u32", "buffer", "u32", "ptr"],
14165
+ args: ["u32", "buffer", "buffer", "buffer", "buffer", "u32", "buffer", "u32", "buffer"],
14035
14166
  returns: "void"
14036
14167
  },
14037
14168
  bufferDrawBox: {
@@ -14398,7 +14529,7 @@ function getOpenTUILib(libPath) {
14398
14529
  returns: "void"
14399
14530
  },
14400
14531
  textBufferViewMeasureForDimensions: {
14401
- args: ["u32", "u32", "u32", "ptr"],
14532
+ args: ["u32", "u32", "u32", "buffer"],
14402
14533
  returns: "bool"
14403
14534
  },
14404
14535
  bufferDrawTextBufferView: {
@@ -14546,7 +14677,7 @@ function getOpenTUILib(libPath) {
14546
14677
  returns: "void"
14547
14678
  },
14548
14679
  editBufferGetCursorPosition: {
14549
- args: ["u32", "ptr"],
14680
+ args: ["u32", "buffer"],
14550
14681
  returns: "void"
14551
14682
  },
14552
14683
  editBufferGetId: {
@@ -14590,19 +14721,19 @@ function getOpenTUILib(libPath) {
14590
14721
  returns: "void"
14591
14722
  },
14592
14723
  editBufferGetNextWordBoundary: {
14593
- args: ["u32", "ptr"],
14724
+ args: ["u32", "buffer"],
14594
14725
  returns: "void"
14595
14726
  },
14596
14727
  editBufferGetPrevWordBoundary: {
14597
- args: ["u32", "ptr"],
14728
+ args: ["u32", "buffer"],
14598
14729
  returns: "void"
14599
14730
  },
14600
14731
  editBufferGetEOL: {
14601
- args: ["u32", "ptr"],
14732
+ args: ["u32", "buffer"],
14602
14733
  returns: "void"
14603
14734
  },
14604
14735
  editBufferOffsetToPosition: {
14605
- args: ["u32", "u32", "ptr"],
14736
+ args: ["u32", "u32", "buffer"],
14606
14737
  returns: "bool"
14607
14738
  },
14608
14739
  editBufferPositionToOffset: {
@@ -14678,7 +14809,7 @@ function getOpenTUILib(libPath) {
14678
14809
  returns: "u32"
14679
14810
  },
14680
14811
  editorViewGetVisualCursor: {
14681
- args: ["u32", "ptr"],
14812
+ args: ["u32", "buffer"],
14682
14813
  returns: "void"
14683
14814
  },
14684
14815
  editorViewMoveUpVisual: {
@@ -14698,23 +14829,23 @@ function getOpenTUILib(libPath) {
14698
14829
  returns: "void"
14699
14830
  },
14700
14831
  editorViewGetNextWordBoundary: {
14701
- args: ["u32", "ptr"],
14832
+ args: ["u32", "buffer"],
14702
14833
  returns: "void"
14703
14834
  },
14704
14835
  editorViewGetPrevWordBoundary: {
14705
- args: ["u32", "ptr"],
14836
+ args: ["u32", "buffer"],
14706
14837
  returns: "void"
14707
14838
  },
14708
14839
  editorViewGetEOL: {
14709
- args: ["u32", "ptr"],
14840
+ args: ["u32", "buffer"],
14710
14841
  returns: "void"
14711
14842
  },
14712
14843
  editorViewGetVisualSOL: {
14713
- args: ["u32", "ptr"],
14844
+ args: ["u32", "buffer"],
14714
14845
  returns: "void"
14715
14846
  },
14716
14847
  editorViewGetVisualEOL: {
14717
- args: ["u32", "ptr"],
14848
+ args: ["u32", "buffer"],
14718
14849
  returns: "void"
14719
14850
  },
14720
14851
  editorViewGotoVisualLineEnd: {
@@ -14771,6 +14902,8 @@ function getOpenTUILib(libPath) {
14771
14902
  imageTestFailIccProfileCopyAllocationOnce: { args: [], returns: "void" },
14772
14903
  imageDecode: { args: ["ptr", "u32", "buffer"], returns: "u32" },
14773
14904
  imageCreateFromRgba: { args: ["ptr", "u64", "u32", "u32", "u32", "buffer"], returns: "u32" },
14905
+ imageCreateFromPixels: { args: ["buffer", "u64", "u32", "u32", "u32", "u32", "u32", "buffer"], returns: "u32" },
14906
+ imageUpdatePixels: { args: ["u32", "buffer", "u64", "u32", "u32", "u32"], returns: "u32" },
14774
14907
  imageDestroy: { args: ["u32"], returns: "void" },
14775
14908
  imageRetain: { args: ["u32", "buffer"], returns: "u32" },
14776
14909
  imageGetInfo: { args: ["u32", "ptr"], returns: "u32" },
@@ -14792,6 +14925,11 @@ function getOpenTUILib(libPath) {
14792
14925
  args: ["u32", "ptr", "u32"],
14793
14926
  returns: "void"
14794
14927
  },
14928
+ setKittyImageTransport: { args: ["u32", "u32"], returns: "u32" },
14929
+ getKittyImageTransport: { args: ["u32", "buffer"], returns: "void" },
14930
+ pollKittyImageTransport: { args: ["u32"], returns: "u32" },
14931
+ cancelKittyImageTransport: { args: ["u32", "u32"], returns: "void" },
14932
+ processKittyImageReply: { args: ["u32", "buffer", "u32"], returns: "u32" },
14795
14933
  encodeUnicode: {
14796
14934
  args: ["ptr", "u32", "ptr", "ptr", "u8"],
14797
14935
  returns: "bool"
@@ -15093,7 +15231,7 @@ function getOpenTUILib(libPath) {
15093
15231
  returns: "i32"
15094
15232
  },
15095
15233
  audioCreateStream: {
15096
- args: ["u32", "ptr", "ptr"],
15234
+ args: ["u32", "buffer", "buffer"],
15097
15235
  returns: "i32"
15098
15236
  },
15099
15237
  audioWriteStream: {
@@ -15121,11 +15259,11 @@ function getOpenTUILib(libPath) {
15121
15259
  returns: "i32"
15122
15260
  },
15123
15261
  audioGetStreamStats: {
15124
- args: ["u32", "u32", "ptr"],
15262
+ args: ["u32", "u32", "buffer"],
15125
15263
  returns: "i32"
15126
15264
  },
15127
15265
  audioCloseStream: {
15128
- args: ["u32", "u32", "u32", "ptr"],
15266
+ args: ["u32", "u32", "u32", "buffer"],
15129
15267
  returns: "i32"
15130
15268
  },
15131
15269
  audioLoad: {
@@ -15225,7 +15363,7 @@ function getOpenTUILib(libPath) {
15225
15363
  returns: "void"
15226
15364
  }
15227
15365
  });
15228
- if (env.OTUI_DEBUG_FFI || env.OTUI_TRACE_FFI) {
15366
+ if (env2.OTUI_DEBUG_FFI || env2.OTUI_TRACE_FFI) {
15229
15367
  return {
15230
15368
  ...rawSymbols,
15231
15369
  symbols: convertToDebugSymbols(rawSymbols.symbols)
@@ -15237,7 +15375,7 @@ function convertToDebugSymbols(symbols) {
15237
15375
  if (!globalTraceSymbols) {
15238
15376
  globalTraceSymbols = {};
15239
15377
  }
15240
- if (env.OTUI_DEBUG_FFI && !globalFFILogPath) {
15378
+ if (env2.OTUI_DEBUG_FFI && !globalFFILogPath) {
15241
15379
  const now = new Date;
15242
15380
  const timestamp = now.toISOString().replace(/[:.]/g, "-").replace(/T/, "_").split("Z")[0];
15243
15381
  globalFFILogPath = `ffi_otui_debug_${timestamp}.log`;
@@ -15247,7 +15385,7 @@ function convertToDebugSymbols(symbols) {
15247
15385
  Object.entries(symbols).forEach(([key, value]) => {
15248
15386
  debugSymbols[key] = value;
15249
15387
  });
15250
- if (env.OTUI_DEBUG_FFI && globalFFILogPath) {
15388
+ if (env2.OTUI_DEBUG_FFI && globalFFILogPath) {
15251
15389
  const logPath = globalFFILogPath;
15252
15390
  const writeSync = (msg) => {
15253
15391
  writeFileSync(logPath, msg + `
@@ -15264,7 +15402,7 @@ function convertToDebugSymbols(symbols) {
15264
15402
  }
15265
15403
  });
15266
15404
  }
15267
- if (env.OTUI_TRACE_FFI) {
15405
+ if (env2.OTUI_TRACE_FFI) {
15268
15406
  hasTracing = true;
15269
15407
  Object.entries(symbols).forEach(([key, value]) => {
15270
15408
  if (typeof value === "function") {
@@ -15282,7 +15420,7 @@ function convertToDebugSymbols(symbols) {
15282
15420
  }
15283
15421
  });
15284
15422
  }
15285
- if ((env.OTUI_DEBUG_FFI || env.OTUI_TRACE_FFI) && !exitHandlerRegistered) {
15423
+ if ((env2.OTUI_DEBUG_FFI || env2.OTUI_TRACE_FFI) && !exitHandlerRegistered) {
15286
15424
  exitHandlerRegistered = true;
15287
15425
  process.on("exit", () => {
15288
15426
  if (globalTraceSymbols) {
@@ -15293,7 +15431,7 @@ function convertToDebugSymbols(symbols) {
15293
15431
  }
15294
15432
  const sortedTimings = [...timings].sort((a, b) => a - b);
15295
15433
  const count = sortedTimings.length;
15296
- const total = sortedTimings.reduce((acc, t2) => acc + t2, 0);
15434
+ const total = sortedTimings.reduce((acc, t) => acc + t, 0);
15297
15435
  const average = total / count;
15298
15436
  const min = sortedTimings[0];
15299
15437
  const max = sortedTimings[count - 1];
@@ -15368,13 +15506,13 @@ function convertToDebugSymbols(symbols) {
15368
15506
  return debugSymbols;
15369
15507
  }
15370
15508
  var LogLevel2;
15371
- ((LogLevel3) => {
15372
- LogLevel3[LogLevel3["Error"] = 0] = "Error";
15373
- LogLevel3[LogLevel3["Warn"] = 1] = "Warn";
15374
- LogLevel3[LogLevel3["Info"] = 2] = "Info";
15375
- LogLevel3[LogLevel3["Debug"] = 3] = "Debug";
15509
+ ((LogLevel) => {
15510
+ LogLevel[LogLevel["Error"] = 0] = "Error";
15511
+ LogLevel[LogLevel["Warn"] = 1] = "Warn";
15512
+ LogLevel[LogLevel["Info"] = 2] = "Info";
15513
+ LogLevel[LogLevel["Debug"] = 3] = "Debug";
15376
15514
  })(LogLevel2 ||= {});
15377
- var NativeMeasureTargetKind = {
15515
+ var NativeMeasureTargetKind2 = {
15378
15516
  None: 0,
15379
15517
  TextBufferView: 1,
15380
15518
  EditorView: 2
@@ -15386,11 +15524,11 @@ class FFIRenderLib {
15386
15524
  yogaLayout = new Float32Array(6);
15387
15525
  ffiStructStorage = {
15388
15526
  logicalCursor: {
15389
- ...allocStruct(LogicalCursorStruct),
15527
+ ...allocFFIStruct(LogicalCursorStruct),
15390
15528
  result: { row: 0, col: 0, offset: 0 }
15391
15529
  },
15392
15530
  visualCursor: {
15393
- ...allocStruct(VisualCursorStruct),
15531
+ ...allocFFIStruct(VisualCursorStruct),
15394
15532
  result: {
15395
15533
  visualRow: 0,
15396
15534
  visualCol: 0,
@@ -15400,13 +15538,13 @@ class FFIRenderLib {
15400
15538
  }
15401
15539
  },
15402
15540
  measureResult: {
15403
- ...allocStruct(MeasureResultStruct),
15541
+ ...allocFFIStruct(MeasureResultStruct),
15404
15542
  result: { lineCount: 0, widthColsMax: 0 }
15405
15543
  },
15406
- embeddedTerminalCursor: allocStruct(EmbeddedTerminalCursorStruct),
15407
- embeddedTerminalKeyOptions: allocStruct(EmbeddedTerminalKeyOptionsStruct),
15544
+ embeddedTerminalCursor: allocFFIStruct(EmbeddedTerminalCursorStruct),
15545
+ embeddedTerminalKeyOptions: allocFFIStruct(EmbeddedTerminalKeyOptionsStruct),
15408
15546
  audioStreamStats: {
15409
- ...allocStruct(AudioStreamStatsStruct),
15547
+ ...allocFFIStruct(AudioStreamStatsStruct),
15410
15548
  result: {
15411
15549
  bytesReceived: 0n,
15412
15550
  framesDecoded: 0n,
@@ -15421,8 +15559,8 @@ class FFIRenderLib {
15421
15559
  readyGeneration: 0
15422
15560
  }
15423
15561
  },
15424
- imageDrawOptions: allocStruct(ImageDrawOptionsStruct),
15425
- gridDrawOptions: allocStruct(GridDrawOptionsStruct)
15562
+ imageDrawOptions: allocFFIStruct(ImageDrawOptionsStruct),
15563
+ gridDrawOptions: allocFFIStruct(GridDrawOptionsStruct)
15426
15564
  };
15427
15565
  disposed = false;
15428
15566
  clipboardServices = new Set;
@@ -15485,7 +15623,7 @@ class FFIRenderLib {
15485
15623
  }
15486
15624
  embeddedTerminalGetSelectedText(handle) {
15487
15625
  const required = new Uint32Array(1);
15488
- const read = (output2) => this.opentui.symbols.embeddedTerminalGetSelectedText(handle, viewOrNull(output2), output2.byteLength, required);
15626
+ const read = (output) => this.opentui.symbols.embeddedTerminalGetSelectedText(handle, viewOrNull(output), output.byteLength, required);
15489
15627
  const initial = new Uint8Array(256);
15490
15628
  const status = read(initial);
15491
15629
  if (status >= 0)
@@ -15501,7 +15639,7 @@ class FFIRenderLib {
15501
15639
  }
15502
15640
  embeddedTerminalCursor(handle) {
15503
15641
  const storage = this.ffiStructStorage.embeddedTerminalCursor;
15504
- embeddedTerminalResult(this.opentui.symbols.embeddedTerminalCursor(handle, storage.buffer), "cursor query");
15642
+ embeddedTerminalResult(this.opentui.symbols.embeddedTerminalCursor(handle, storage.ffiView), "cursor query");
15505
15643
  const result = EmbeddedTerminalCursorStruct.unpack(storage.buffer);
15506
15644
  return {
15507
15645
  x: result.x,
@@ -15529,7 +15667,7 @@ class FFIRenderLib {
15529
15667
  const text = key.text ? this.encoder.encode(key.text) : new Uint8Array;
15530
15668
  const textLength = toSafeFFIU32Length(text.byteLength, "Embedded terminal key text length");
15531
15669
  const required = new Uint32Array(1);
15532
- const encode = (output2) => this.opentui.symbols.embeddedTerminalEncodeKey(handle, options.buffer, keyCodeLength === 0 ? null : keyCode, keyCodeLength, textLength === 0 ? null : text, textLength, output2, output2.byteLength, required);
15670
+ const encode = (output) => this.opentui.symbols.embeddedTerminalEncodeKey(handle, options.ffiView, keyCodeLength === 0 ? null : keyCode, keyCodeLength, textLength === 0 ? null : text, textLength, output, output.byteLength, required);
15533
15671
  const initial = new Uint8Array(Math.max(64, textLength));
15534
15672
  const status = encode(initial);
15535
15673
  if (status >= 0)
@@ -15791,7 +15929,7 @@ class FFIRenderLib {
15791
15929
  const width = this.opentui.symbols.getBufferWidth(bufferPtr);
15792
15930
  const height = this.opentui.symbols.getBufferHeight(bufferPtr);
15793
15931
  const widthMethod = widthMethodFromCode(this.opentui.symbols.getBufferWidthMethod(bufferPtr));
15794
- return new OptimizedBuffer(this, bufferPtr, width, height, { id: "next buffer", widthMethod });
15932
+ return new OptimizedBuffer2(this, bufferPtr, width, height, { id: "next buffer", widthMethod });
15795
15933
  }
15796
15934
  getCurrentBuffer(renderer) {
15797
15935
  const bufferPtr = this.opentui.symbols.getCurrentBuffer(renderer);
@@ -15801,7 +15939,7 @@ class FFIRenderLib {
15801
15939
  const width = this.opentui.symbols.getBufferWidth(bufferPtr);
15802
15940
  const height = this.opentui.symbols.getBufferHeight(bufferPtr);
15803
15941
  const widthMethod = widthMethodFromCode(this.opentui.symbols.getBufferWidthMethod(bufferPtr));
15804
- return new OptimizedBuffer(this, bufferPtr, width, height, { id: "current buffer", widthMethod });
15942
+ return new OptimizedBuffer2(this, bufferPtr, width, height, { id: "current buffer", widthMethod });
15805
15943
  }
15806
15944
  rendererSetPaletteState(renderer, palette, defaultForeground, defaultBackground, paletteEpoch) {
15807
15945
  const paletteBuffer = new Uint16Array(palette.length * 4);
@@ -15811,32 +15949,32 @@ class FFIRenderLib {
15811
15949
  this.opentui.symbols.rendererSetPaletteState(renderer, paletteBuffer, palette.length, rgbaBuffer(defaultForeground), rgbaBuffer(defaultBackground), paletteEpoch >>> 0);
15812
15950
  }
15813
15951
  bufferGetCharPtr(buffer) {
15814
- const ptr3 = this.opentui.symbols.bufferGetCharPtr(buffer);
15815
- if (!ptr3) {
15952
+ const ptr = this.opentui.symbols.bufferGetCharPtr(buffer);
15953
+ if (!ptr) {
15816
15954
  throw new Error("Failed to get char pointer");
15817
15955
  }
15818
- return ptr3;
15956
+ return ptr;
15819
15957
  }
15820
15958
  bufferGetFgPtr(buffer) {
15821
- const ptr3 = this.opentui.symbols.bufferGetFgPtr(buffer);
15822
- if (!ptr3) {
15959
+ const ptr = this.opentui.symbols.bufferGetFgPtr(buffer);
15960
+ if (!ptr) {
15823
15961
  throw new Error("Failed to get fg pointer");
15824
15962
  }
15825
- return ptr3;
15963
+ return ptr;
15826
15964
  }
15827
15965
  bufferGetBgPtr(buffer) {
15828
- const ptr3 = this.opentui.symbols.bufferGetBgPtr(buffer);
15829
- if (!ptr3) {
15966
+ const ptr = this.opentui.symbols.bufferGetBgPtr(buffer);
15967
+ if (!ptr) {
15830
15968
  throw new Error("Failed to get bg pointer");
15831
15969
  }
15832
- return ptr3;
15970
+ return ptr;
15833
15971
  }
15834
15972
  bufferGetAttributesPtr(buffer) {
15835
- const ptr3 = this.opentui.symbols.bufferGetAttributesPtr(buffer);
15836
- if (!ptr3) {
15973
+ const ptr = this.opentui.symbols.bufferGetAttributesPtr(buffer);
15974
+ if (!ptr) {
15837
15975
  throw new Error("Failed to get attributes pointer");
15838
15976
  }
15839
- return ptr3;
15977
+ return ptr;
15840
15978
  }
15841
15979
  bufferGetRespectAlpha(buffer) {
15842
15980
  return this.opentui.symbols.bufferGetRespectAlpha(buffer);
@@ -15867,25 +16005,25 @@ class FFIRenderLib {
15867
16005
  }
15868
16006
  bufferDrawText(buffer, text, x, y, color, bgColor, attributes) {
15869
16007
  const textBytes = this.encoder.encode(text);
15870
- const bg2 = optionalRgbaBuffer(bgColor);
15871
- const fg2 = rgbaBuffer(color);
15872
- this.opentui.symbols.bufferDrawText(buffer, viewOrNull(textBytes), textBytes.byteLength, x, y, fg2, bg2, attributes ?? 0);
16008
+ const bg = optionalRgbaBuffer(bgColor);
16009
+ const fg = rgbaBuffer(color);
16010
+ this.opentui.symbols.bufferDrawText(buffer, viewOrNull(textBytes), textBytes.byteLength, x, y, fg, bg, attributes ?? 0);
15873
16011
  }
15874
16012
  bufferSetCellWithAlphaBlending(buffer, x, y, char, color, bgColor, attributes) {
15875
16013
  const charPtr = char.codePointAt(0) ?? " ".codePointAt(0);
15876
- const bg2 = rgbaBuffer(bgColor);
15877
- const fg2 = rgbaBuffer(color);
15878
- this.opentui.symbols.bufferSetCellWithAlphaBlending(buffer, x, y, charPtr, fg2, bg2, attributes ?? 0);
16014
+ const bg = rgbaBuffer(bgColor);
16015
+ const fg = rgbaBuffer(color);
16016
+ this.opentui.symbols.bufferSetCellWithAlphaBlending(buffer, x, y, charPtr, fg, bg, attributes ?? 0);
15879
16017
  }
15880
16018
  bufferSetCell(buffer, x, y, char, color, bgColor, attributes) {
15881
16019
  const charPtr = char.codePointAt(0) ?? " ".codePointAt(0);
15882
- const bg2 = rgbaBuffer(bgColor);
15883
- const fg2 = rgbaBuffer(color);
15884
- this.opentui.symbols.bufferSetCell(buffer, x, y, charPtr, fg2, bg2, attributes ?? 0);
16020
+ const bg = rgbaBuffer(bgColor);
16021
+ const fg = rgbaBuffer(color);
16022
+ this.opentui.symbols.bufferSetCell(buffer, x, y, charPtr, fg, bg, attributes ?? 0);
15885
16023
  }
15886
16024
  bufferFillRect(buffer, x, y, width, height, color) {
15887
- const bg2 = rgbaBuffer(color);
15888
- this.opentui.symbols.bufferFillRect(buffer, x, y, width, height, bg2);
16025
+ const bg = rgbaBuffer(color);
16026
+ this.opentui.symbols.bufferFillRect(buffer, x, y, width, height, bg);
15889
16027
  }
15890
16028
  bufferColorMatrix(buffer, matrix, cellMask, cellMaskCount, strength, target) {
15891
16029
  this.opentui.symbols.bufferColorMatrix(buffer, matrix, cellMask, cellMaskCount, strength, target);
@@ -15913,20 +16051,20 @@ class FFIRenderLib {
15913
16051
  sourceHeight,
15914
16052
  protocol: protocolId
15915
16053
  }, storage.view, 0);
15916
- return Boolean(this.opentui.symbols.bufferDrawImage(buffer, image, storage.buffer));
16054
+ return Boolean(this.opentui.symbols.bufferDrawImage(buffer, image, storage.ffiView));
15917
16055
  }
15918
16056
  bufferDrawPackedBuffer(buffer, data, dataLen, posX, posY, terminalWidthCells, terminalHeightCells) {
15919
16057
  this.opentui.symbols.bufferDrawPackedBuffer(buffer, data, dataLen, posX, posY, terminalWidthCells, terminalHeightCells);
15920
16058
  }
15921
- bufferDrawGrayscaleBuffer(buffer, posX, posY, intensities, srcWidth, srcHeight, fg2, bg2) {
15922
- this.opentui.symbols.bufferDrawGrayscaleBuffer(buffer, posX, posY, intensities, srcWidth, srcHeight, optionalRgbaBuffer(fg2), optionalRgbaBuffer(bg2));
16059
+ bufferDrawGrayscaleBuffer(buffer, posX, posY, intensities, srcWidth, srcHeight, fg, bg) {
16060
+ this.opentui.symbols.bufferDrawGrayscaleBuffer(buffer, posX, posY, intensities, srcWidth, srcHeight, optionalRgbaBuffer(fg), optionalRgbaBuffer(bg));
15923
16061
  }
15924
- bufferDrawGrayscaleBufferSupersampled(buffer, posX, posY, intensities, srcWidth, srcHeight, fg2, bg2) {
15925
- this.opentui.symbols.bufferDrawGrayscaleBufferSupersampled(buffer, posX, posY, intensities, srcWidth, srcHeight, optionalRgbaBuffer(fg2), optionalRgbaBuffer(bg2));
16062
+ bufferDrawGrayscaleBufferSupersampled(buffer, posX, posY, intensities, srcWidth, srcHeight, fg, bg) {
16063
+ this.opentui.symbols.bufferDrawGrayscaleBufferSupersampled(buffer, posX, posY, intensities, srcWidth, srcHeight, optionalRgbaBuffer(fg), optionalRgbaBuffer(bg));
15926
16064
  }
15927
16065
  bufferDrawGrid(buffer, borderChars, borderFg, borderBg, columnOffsets, columnCount, rowOffsets, rowCount, options) {
15928
16066
  GridDrawOptionsStruct.packInto({ drawInner: options.drawInner, drawOuter: options.drawOuter }, this.ffiStructStorage.gridDrawOptions.view, 0);
15929
- this.opentui.symbols.bufferDrawGrid(buffer, borderChars, rgbaBuffer(borderFg), rgbaBuffer(borderBg), columnOffsets, columnCount, rowOffsets, rowCount, this.ffiStructStorage.gridDrawOptions.buffer);
16067
+ this.opentui.symbols.bufferDrawGrid(buffer, borderChars, rgbaBuffer(borderFg), rgbaBuffer(borderBg), columnOffsets, columnCount, rowOffsets, rowCount, this.ffiStructStorage.gridDrawOptions.ffiView);
15930
16068
  }
15931
16069
  bufferDrawBox(buffer, x, y, width, height, borderChars, packedOptions, borderColor, backgroundColor, titleColor, title, bottomTitle) {
15932
16070
  const titleBytes = title ? this.encoder.encode(title) : null;
@@ -15944,7 +16082,7 @@ class FFIRenderLib {
15944
16082
  const urlBytes = this.encoder.encode(url);
15945
16083
  return this.opentui.symbols.linkAlloc(viewOrNull(urlBytes), urlBytes.byteLength);
15946
16084
  }
15947
- linkGetUrl(linkId, maxLen = 512) {
16085
+ linkGetUrl(linkId, maxLen = MAX_LINK_URL_BYTES2) {
15948
16086
  const outBuffer = new Uint8Array(maxLen);
15949
16087
  const actualLen = this.opentui.symbols.linkGetUrl(linkId, viewOrNull(outBuffer), maxLen);
15950
16088
  return this.decoder.decode(outBuffer.slice(0, actualLen));
@@ -15974,7 +16112,7 @@ class FFIRenderLib {
15974
16112
  visible: struct.visible,
15975
16113
  style: CURSOR_ID_TO_STYLE[struct.style] ?? "block",
15976
16114
  blinking: struct.blinking,
15977
- color: RGBA.fromValues(struct.r, struct.g, struct.b, struct.a)
16115
+ color: RGBA2.fromValues(struct.r, struct.g, struct.b, struct.a)
15978
16116
  };
15979
16117
  }
15980
16118
  setCursorStyleOptions(renderer, options) {
@@ -15997,8 +16135,8 @@ class FFIRenderLib {
15997
16135
  repaintSplitFooter(renderer, pinnedRenderOffset, force) {
15998
16136
  return this.unpackRenderOperationResult(this.opentui.symbols.repaintSplitFooter(renderer, pinnedRenderOffset, ffiBool(force)));
15999
16137
  }
16000
- commitSplitFooterSnapshot(renderer, snapshot, rowColumns, startOnNewLine, trailingNewline, pinnedRenderOffset, force, beginFrame = true, finalizeFrame = true) {
16001
- const flags = ffiBool(startOnNewLine) | ffiBool(trailingNewline) << 1 | ffiBool(force) << 2 | ffiBool(beginFrame) << 3 | ffiBool(finalizeFrame) << 4;
16138
+ commitSplitFooterSnapshot(renderer, snapshot, rowColumns, startOnNewLine, trailingNewline, pinnedRenderOffset, force, beginFrame = true, finalizeFrame = true, controlOutput = false) {
16139
+ const flags = ffiBool(startOnNewLine) | ffiBool(trailingNewline) << 1 | ffiBool(force) << 2 | ffiBool(beginFrame) << 3 | ffiBool(finalizeFrame) << 4 | ffiBool(controlOutput) << 5;
16002
16140
  return this.unpackRenderOperationResult(this.opentui.symbols.commitSplitFooterSnapshot(renderer, snapshot.ptr, rowColumns, flags, pinnedRenderOffset));
16003
16141
  }
16004
16142
  createOptimizedBuffer(width, height, widthMethod, respectAlpha = false, id) {
@@ -16011,7 +16149,7 @@ class FFIRenderLib {
16011
16149
  if (!bufferPtr) {
16012
16150
  throw new Error(`Failed to create optimized buffer: ${width}x${height}`);
16013
16151
  }
16014
- return new OptimizedBuffer(this, bufferPtr, width, height, { respectAlpha, id, widthMethod });
16152
+ return new OptimizedBuffer2(this, bufferPtr, width, height, { respectAlpha, id, widthMethod });
16015
16153
  }
16016
16154
  destroyOptimizedBuffer(bufferPtr) {
16017
16155
  this.opentui.symbols.destroyOptimizedBuffer(bufferPtr);
@@ -16079,19 +16217,19 @@ class FFIRenderLib {
16079
16217
  operation: output[0] === 0 ? null : output[0]
16080
16218
  };
16081
16219
  }
16082
- clipboardReadOperationStart(service, request, selection2, maxBytes, maxImagePixels, maxConversionBytes, timeoutMs) {
16220
+ clipboardReadOperationStart(service, request, selection, maxBytes, maxImagePixels, maxConversionBytes, timeoutMs) {
16083
16221
  const output = new Uint32Array(1);
16084
- 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);
16222
+ 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);
16085
16223
  return this.clipboardStartResult(status, output);
16086
16224
  }
16087
- clipboardWriteOperationStart(service, textUtf8, selection2, timeoutMs) {
16225
+ clipboardWriteOperationStart(service, textUtf8, selection, timeoutMs) {
16088
16226
  const output = new Uint32Array(1);
16089
- const status = this.opentui.symbols.clipboardWriteOperationStart(service, textUtf8, toSafeFFIU32Length(textUtf8.byteLength, "clipboard write text"), selection2, toSafeFFIU32Length(timeoutMs, "clipboard write timeout"), output);
16227
+ const status = this.opentui.symbols.clipboardWriteOperationStart(service, textUtf8, toSafeFFIU32Length(textUtf8.byteLength, "clipboard write text"), selection, toSafeFFIU32Length(timeoutMs, "clipboard write timeout"), output);
16090
16228
  return this.clipboardStartResult(status, output);
16091
16229
  }
16092
- clipboardClearOperationStart(service, selection2, timeoutMs) {
16230
+ clipboardClearOperationStart(service, selection, timeoutMs) {
16093
16231
  const output = new Uint32Array(1);
16094
- const status = this.opentui.symbols.clipboardClearOperationStart(service, selection2, toSafeFFIU32Length(timeoutMs, "clipboard clear timeout"), output);
16232
+ const status = this.opentui.symbols.clipboardClearOperationStart(service, selection, toSafeFFIU32Length(timeoutMs, "clipboard clear timeout"), output);
16095
16233
  return this.clipboardStartResult(status, output);
16096
16234
  }
16097
16235
  clipboardOperationPoll(operation) {
@@ -16348,8 +16486,8 @@ class FFIRenderLib {
16348
16486
  yogaNodeStyleGetFloat(node, kind) {
16349
16487
  return this.opentui.symbols.yogaNodeStyleGetFloat(node, kind);
16350
16488
  }
16351
- yogaNodeStyleSetBorder(node, edge, border2) {
16352
- this.opentui.symbols.yogaNodeStyleSetBorder(node, edge, border2);
16489
+ yogaNodeStyleSetBorder(node, edge, border) {
16490
+ this.opentui.symbols.yogaNodeStyleSetBorder(node, edge, border);
16353
16491
  }
16354
16492
  yogaNodeStyleGetBorder(node, edge) {
16355
16493
  return this.opentui.symbols.yogaNodeStyleGetBorder(node, edge);
@@ -16401,7 +16539,7 @@ class FFIRenderLib {
16401
16539
  if (!bufferPtr) {
16402
16540
  throw new Error(`Failed to create TextBuffer`);
16403
16541
  }
16404
- return new TextBuffer(this, bufferPtr);
16542
+ return new TextBuffer2(this, bufferPtr);
16405
16543
  }
16406
16544
  destroyTextBuffer(buffer) {
16407
16545
  this.opentui.symbols.destroyTextBuffer(buffer);
@@ -16418,12 +16556,12 @@ class FFIRenderLib {
16418
16556
  textBufferClear(buffer) {
16419
16557
  this.opentui.symbols.textBufferClear(buffer);
16420
16558
  }
16421
- textBufferSetDefaultFg(buffer, fg2) {
16422
- const fgBuffer = optionalRgbaBuffer(fg2);
16559
+ textBufferSetDefaultFg(buffer, fg) {
16560
+ const fgBuffer = optionalRgbaBuffer(fg);
16423
16561
  this.opentui.symbols.textBufferSetDefaultFg(buffer, fgBuffer);
16424
16562
  }
16425
- textBufferSetDefaultBg(buffer, bg2) {
16426
- const bgBuffer = optionalRgbaBuffer(bg2);
16563
+ textBufferSetDefaultBg(buffer, bg) {
16564
+ const bgBuffer = optionalRgbaBuffer(bg);
16427
16565
  this.opentui.symbols.textBufferSetDefaultBg(buffer, bgBuffer);
16428
16566
  }
16429
16567
  textBufferSetDefaultAttributes(buffer, attributes) {
@@ -16461,8 +16599,8 @@ class FFIRenderLib {
16461
16599
  textBufferAppendFromMemId(buffer, memId) {
16462
16600
  this.opentui.symbols.textBufferAppendFromMemId(buffer, memId);
16463
16601
  }
16464
- textBufferLoadFile(buffer, path3) {
16465
- const pathBytes = this.encoder.encode(path3);
16602
+ textBufferLoadFile(buffer, path) {
16603
+ const pathBytes = this.encoder.encode(path);
16466
16604
  return this.opentui.symbols.textBufferLoadFile(buffer, viewOrNull(pathBytes), pathBytes.byteLength);
16467
16605
  }
16468
16606
  textBufferSetStyledText(buffer, chunks) {
@@ -16516,39 +16654,39 @@ class FFIRenderLib {
16516
16654
  this.opentui.symbols.destroyTextBufferView(view);
16517
16655
  }
16518
16656
  textBufferViewSetSelection(view, start, end, bgColor, fgColor) {
16519
- const bg2 = optionalRgbaBuffer(bgColor);
16520
- const fg2 = optionalRgbaBuffer(fgColor);
16521
- this.opentui.symbols.textBufferViewSetSelection(view, start, end, bg2, fg2);
16657
+ const bg = optionalRgbaBuffer(bgColor);
16658
+ const fg = optionalRgbaBuffer(fgColor);
16659
+ this.opentui.symbols.textBufferViewSetSelection(view, start, end, bg, fg);
16522
16660
  }
16523
16661
  textBufferViewResetSelection(view) {
16524
16662
  this.opentui.symbols.textBufferViewResetSelection(view);
16525
16663
  }
16526
16664
  textBufferViewGetSelection(view) {
16527
16665
  const packedInfo = this.textBufferViewGetSelectionInfo(view);
16528
- if (packedInfo === 0xffff_ffff_ffff_ffffn) {
16666
+ if (packedInfo === 0xffffffffffffffffn) {
16529
16667
  return null;
16530
16668
  }
16531
16669
  const start = Number(packedInfo >> 32n);
16532
- const end = Number(packedInfo & 0xffff_ffffn);
16670
+ const end = Number(packedInfo & 0xffffffffn);
16533
16671
  return { start, end };
16534
16672
  }
16535
16673
  textBufferViewGetSelectionInfo(view) {
16536
16674
  return this.opentui.symbols.textBufferViewGetSelectionInfo(view);
16537
16675
  }
16538
16676
  textBufferViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor, behavior) {
16539
- const bg2 = optionalRgbaBuffer(bgColor);
16540
- const fg2 = optionalRgbaBuffer(fgColor);
16541
- return Boolean(this.opentui.symbols.textBufferViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2, selectionBehaviorByte(behavior)));
16677
+ const bg = optionalRgbaBuffer(bgColor);
16678
+ const fg = optionalRgbaBuffer(fgColor);
16679
+ return Boolean(this.opentui.symbols.textBufferViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bg, fg, selectionBehaviorByte(behavior)));
16542
16680
  }
16543
16681
  textBufferViewUpdateSelection(view, end, bgColor, fgColor) {
16544
- const bg2 = optionalRgbaBuffer(bgColor);
16545
- const fg2 = optionalRgbaBuffer(fgColor);
16546
- this.opentui.symbols.textBufferViewUpdateSelection(view, end, bg2, fg2);
16682
+ const bg = optionalRgbaBuffer(bgColor);
16683
+ const fg = optionalRgbaBuffer(fgColor);
16684
+ this.opentui.symbols.textBufferViewUpdateSelection(view, end, bg, fg);
16547
16685
  }
16548
16686
  textBufferViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor, behavior) {
16549
- const bg2 = optionalRgbaBuffer(bgColor);
16550
- const fg2 = optionalRgbaBuffer(fgColor);
16551
- return Boolean(this.opentui.symbols.textBufferViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2, selectionBehaviorByte(behavior)));
16687
+ const bg = optionalRgbaBuffer(bgColor);
16688
+ const fg = optionalRgbaBuffer(fgColor);
16689
+ return Boolean(this.opentui.symbols.textBufferViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bg, fg, selectionBehaviorByte(behavior)));
16552
16690
  }
16553
16691
  textBufferViewResetLocalSelection(view) {
16554
16692
  this.opentui.symbols.textBufferViewResetLocalSelection(view);
@@ -16608,6 +16746,20 @@ class FFIRenderLib {
16608
16746
  textBufferViewGetVirtualLineCount(view) {
16609
16747
  return this.opentui.symbols.textBufferViewGetVirtualLineCount(view);
16610
16748
  }
16749
+ textBufferViewGetLineSources(view, startLine, lineCount) {
16750
+ toSafeFFIU32Length(startLine, "visual row start");
16751
+ toSafeFFIU32Length(lineCount, "visual row count");
16752
+ if (lineCount === 0)
16753
+ return [];
16754
+ const outBuffer = new ArrayBuffer(LineInfoStruct.size);
16755
+ this.textBufferViewGetLogicalLineInfoDirect(view, outBuffer);
16756
+ const data = new DataView(outBuffer);
16757
+ const sources = LineInfoStruct.arrayFields.get("sources");
16758
+ const count = Math.max(0, Math.min(lineCount, data.getUint32(sources.lengthOffset, true) - startLine));
16759
+ if (count === 0)
16760
+ return [];
16761
+ return Array.from(new Uint32Array(toArrayBuffer(toPointer(data.getBigUint64(sources.arrayOffset, true)), startLine * 4, count * 4)));
16762
+ }
16611
16763
  textBufferViewGetLineInfoDirect(view, outBuffer) {
16612
16764
  this.opentui.symbols.textBufferViewGetLineInfoDirect(view, outBuffer);
16613
16765
  }
@@ -16647,7 +16799,7 @@ class FFIRenderLib {
16647
16799
  }
16648
16800
  textBufferViewMeasureForDimensions(view, width, height) {
16649
16801
  const storage = this.ffiStructStorage.measureResult;
16650
- const success = this.opentui.symbols.textBufferViewMeasureForDimensions(view, width, height, storage.buffer);
16802
+ const success = this.opentui.symbols.textBufferViewMeasureForDimensions(view, width, height, storage.ffiView);
16651
16803
  if (!success)
16652
16804
  return null;
16653
16805
  const result = MeasureResultStruct.unpackInto(storage.view, storage.result);
@@ -16877,7 +17029,7 @@ class FFIRenderLib {
16877
17029
  }
16878
17030
  editBufferGetCursorPosition(buffer) {
16879
17031
  const storage = this.ffiStructStorage.logicalCursor;
16880
- this.opentui.symbols.editBufferGetCursorPosition(buffer, storage.buffer);
17032
+ this.opentui.symbols.editBufferGetCursorPosition(buffer, storage.ffiView);
16881
17033
  const cursor = LogicalCursorStruct.unpackInto(storage.view, storage.result);
16882
17034
  return { row: cursor.row, col: cursor.col, offset: cursor.offset };
16883
17035
  }
@@ -16927,25 +17079,25 @@ class FFIRenderLib {
16927
17079
  }
16928
17080
  editBufferGetNextWordBoundary(buffer) {
16929
17081
  const storage = this.ffiStructStorage.logicalCursor;
16930
- this.opentui.symbols.editBufferGetNextWordBoundary(buffer, storage.buffer);
17082
+ this.opentui.symbols.editBufferGetNextWordBoundary(buffer, storage.ffiView);
16931
17083
  const cursor = LogicalCursorStruct.unpackInto(storage.view, storage.result);
16932
17084
  return { row: cursor.row, col: cursor.col, offset: cursor.offset };
16933
17085
  }
16934
17086
  editBufferGetPrevWordBoundary(buffer) {
16935
17087
  const storage = this.ffiStructStorage.logicalCursor;
16936
- this.opentui.symbols.editBufferGetPrevWordBoundary(buffer, storage.buffer);
17088
+ this.opentui.symbols.editBufferGetPrevWordBoundary(buffer, storage.ffiView);
16937
17089
  const cursor = LogicalCursorStruct.unpackInto(storage.view, storage.result);
16938
17090
  return { row: cursor.row, col: cursor.col, offset: cursor.offset };
16939
17091
  }
16940
17092
  editBufferGetEOL(buffer) {
16941
17093
  const storage = this.ffiStructStorage.logicalCursor;
16942
- this.opentui.symbols.editBufferGetEOL(buffer, storage.buffer);
17094
+ this.opentui.symbols.editBufferGetEOL(buffer, storage.ffiView);
16943
17095
  const cursor = LogicalCursorStruct.unpackInto(storage.view, storage.result);
16944
17096
  return { row: cursor.row, col: cursor.col, offset: cursor.offset };
16945
17097
  }
16946
17098
  editBufferOffsetToPosition(buffer, offset) {
16947
17099
  const storage = this.ffiStructStorage.logicalCursor;
16948
- const success = this.opentui.symbols.editBufferOffsetToPosition(buffer, offset, storage.buffer);
17100
+ const success = this.opentui.symbols.editBufferOffsetToPosition(buffer, offset, storage.ffiView);
16949
17101
  if (!success)
16950
17102
  return null;
16951
17103
  const cursor = LogicalCursorStruct.unpackInto(storage.view, storage.result);
@@ -16974,36 +17126,36 @@ class FFIRenderLib {
16974
17126
  return usesBunFFI ? outBuffer.slice(0, len) : trimNodeFFIOutputBytes(outBuffer, len);
16975
17127
  }
16976
17128
  editorViewSetSelection(view, start, end, bgColor, fgColor) {
16977
- const bg2 = optionalRgbaBuffer(bgColor);
16978
- const fg2 = optionalRgbaBuffer(fgColor);
16979
- this.opentui.symbols.editorViewSetSelection(view, start, end, bg2, fg2);
17129
+ const bg = optionalRgbaBuffer(bgColor);
17130
+ const fg = optionalRgbaBuffer(fgColor);
17131
+ this.opentui.symbols.editorViewSetSelection(view, start, end, bg, fg);
16980
17132
  }
16981
17133
  editorViewResetSelection(view) {
16982
17134
  this.opentui.symbols.editorViewResetSelection(view);
16983
17135
  }
16984
17136
  editorViewGetSelection(view) {
16985
17137
  const packedInfo = this.opentui.symbols.editorViewGetSelection(view);
16986
- if (packedInfo === 0xffff_ffff_ffff_ffffn) {
17138
+ if (packedInfo === 0xffffffffffffffffn) {
16987
17139
  return null;
16988
17140
  }
16989
17141
  const start = Number(packedInfo >> 32n);
16990
- const end = Number(packedInfo & 0xffff_ffffn);
17142
+ const end = Number(packedInfo & 0xffffffffn);
16991
17143
  return { start, end };
16992
17144
  }
16993
17145
  editorViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor, updateCursor, followCursor, behavior) {
16994
- const bg2 = optionalRgbaBuffer(bgColor);
16995
- const fg2 = optionalRgbaBuffer(fgColor);
16996
- return Boolean(this.opentui.symbols.editorViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2, editorLocalSelectionFlags(updateCursor, followCursor, behavior)));
17146
+ const bg = optionalRgbaBuffer(bgColor);
17147
+ const fg = optionalRgbaBuffer(fgColor);
17148
+ return Boolean(this.opentui.symbols.editorViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bg, fg, editorLocalSelectionFlags(updateCursor, followCursor, behavior)));
16997
17149
  }
16998
17150
  editorViewUpdateSelection(view, end, bgColor, fgColor) {
16999
- const bg2 = optionalRgbaBuffer(bgColor);
17000
- const fg2 = optionalRgbaBuffer(fgColor);
17001
- this.opentui.symbols.editorViewUpdateSelection(view, end, bg2, fg2);
17151
+ const bg = optionalRgbaBuffer(bgColor);
17152
+ const fg = optionalRgbaBuffer(fgColor);
17153
+ this.opentui.symbols.editorViewUpdateSelection(view, end, bg, fg);
17002
17154
  }
17003
17155
  editorViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor, updateCursor, followCursor, behavior) {
17004
- const bg2 = optionalRgbaBuffer(bgColor);
17005
- const fg2 = optionalRgbaBuffer(fgColor);
17006
- return Boolean(this.opentui.symbols.editorViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2, editorLocalSelectionFlags(updateCursor, followCursor, behavior)));
17156
+ const bg = optionalRgbaBuffer(bgColor);
17157
+ const fg = optionalRgbaBuffer(fgColor);
17158
+ return Boolean(this.opentui.symbols.editorViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bg, fg, editorLocalSelectionFlags(updateCursor, followCursor, behavior)));
17007
17159
  }
17008
17160
  editorViewResetLocalSelection(view) {
17009
17161
  this.opentui.symbols.editorViewResetLocalSelection(view);
@@ -17015,14 +17167,14 @@ class FFIRenderLib {
17015
17167
  this.opentui.symbols.editorViewSetSelectionOccupancy(view, occupancy === "boundary" ? 1 : 0);
17016
17168
  }
17017
17169
  editorViewSetSelectionInclusive(view, start, end, bgColor, fgColor) {
17018
- const bg2 = optionalRgbaBuffer(bgColor);
17019
- const fg2 = optionalRgbaBuffer(fgColor);
17020
- this.opentui.symbols.editorViewSetSelectionInclusive(view, start, end, bg2, fg2);
17170
+ const bg = optionalRgbaBuffer(bgColor);
17171
+ const fg = optionalRgbaBuffer(fgColor);
17172
+ this.opentui.symbols.editorViewSetSelectionInclusive(view, start, end, bg, fg);
17021
17173
  }
17022
17174
  editorViewSetSelectionColors(view, bgColor, fgColor) {
17023
- const bg2 = optionalRgbaBuffer(bgColor);
17024
- const fg2 = optionalRgbaBuffer(fgColor);
17025
- this.opentui.symbols.editorViewSetSelectionColors(view, bg2, fg2);
17175
+ const bg = optionalRgbaBuffer(bgColor);
17176
+ const fg = optionalRgbaBuffer(fgColor);
17177
+ this.opentui.symbols.editorViewSetSelectionColors(view, bg, fg);
17026
17178
  }
17027
17179
  editorViewGetSelectedTextBytes(view, maxLength) {
17028
17180
  const outBuffer = new Uint8Array(maxLength);
@@ -17048,7 +17200,7 @@ class FFIRenderLib {
17048
17200
  }
17049
17201
  editorViewGetVisualCursor(view) {
17050
17202
  const storage = this.ffiStructStorage.visualCursor;
17051
- this.opentui.symbols.editorViewGetVisualCursor(view, storage.buffer);
17203
+ this.opentui.symbols.editorViewGetVisualCursor(view, storage.ffiView);
17052
17204
  const cursor = VisualCursorStruct.unpackInto(storage.view, storage.result);
17053
17205
  return { ...cursor };
17054
17206
  }
@@ -17066,31 +17218,31 @@ class FFIRenderLib {
17066
17218
  }
17067
17219
  editorViewGetNextWordBoundary(view) {
17068
17220
  const storage = this.ffiStructStorage.visualCursor;
17069
- this.opentui.symbols.editorViewGetNextWordBoundary(view, storage.buffer);
17221
+ this.opentui.symbols.editorViewGetNextWordBoundary(view, storage.ffiView);
17070
17222
  const cursor = VisualCursorStruct.unpackInto(storage.view, storage.result);
17071
17223
  return { ...cursor };
17072
17224
  }
17073
17225
  editorViewGetPrevWordBoundary(view) {
17074
17226
  const storage = this.ffiStructStorage.visualCursor;
17075
- this.opentui.symbols.editorViewGetPrevWordBoundary(view, storage.buffer);
17227
+ this.opentui.symbols.editorViewGetPrevWordBoundary(view, storage.ffiView);
17076
17228
  const cursor = VisualCursorStruct.unpackInto(storage.view, storage.result);
17077
17229
  return { ...cursor };
17078
17230
  }
17079
17231
  editorViewGetEOL(view) {
17080
17232
  const storage = this.ffiStructStorage.visualCursor;
17081
- this.opentui.symbols.editorViewGetEOL(view, storage.buffer);
17233
+ this.opentui.symbols.editorViewGetEOL(view, storage.ffiView);
17082
17234
  const cursor = VisualCursorStruct.unpackInto(storage.view, storage.result);
17083
17235
  return { ...cursor };
17084
17236
  }
17085
17237
  editorViewGetVisualSOL(view) {
17086
17238
  const storage = this.ffiStructStorage.visualCursor;
17087
- this.opentui.symbols.editorViewGetVisualSOL(view, storage.buffer);
17239
+ this.opentui.symbols.editorViewGetVisualSOL(view, storage.ffiView);
17088
17240
  const cursor = VisualCursorStruct.unpackInto(storage.view, storage.result);
17089
17241
  return { ...cursor };
17090
17242
  }
17091
17243
  editorViewGetVisualEOL(view) {
17092
17244
  const storage = this.ffiStructStorage.visualCursor;
17093
- this.opentui.symbols.editorViewGetVisualEOL(view, storage.buffer);
17245
+ this.opentui.symbols.editorViewGetVisualEOL(view, storage.ffiView);
17094
17246
  const cursor = VisualCursorStruct.unpackInto(storage.view, storage.result);
17095
17247
  return { ...cursor };
17096
17248
  }
@@ -17155,6 +17307,24 @@ class FFIRenderLib {
17155
17307
  const responseBytes = this.encoder.encode(response);
17156
17308
  this.opentui.symbols.processCapabilityResponse(renderer, viewOrNull(responseBytes), responseBytes.byteLength);
17157
17309
  }
17310
+ setKittyImageTransport(renderer, mode) {
17311
+ return this.opentui.symbols.setKittyImageTransport(renderer, mode) !== 0;
17312
+ }
17313
+ getKittyImageTransport(renderer) {
17314
+ const status = new Uint32Array(6);
17315
+ this.opentui.symbols.getKittyImageTransport(renderer, status);
17316
+ return status;
17317
+ }
17318
+ pollKittyImageTransport(renderer) {
17319
+ return this.opentui.symbols.pollKittyImageTransport(renderer) !== 0;
17320
+ }
17321
+ cancelKittyImageTransport(renderer, failed) {
17322
+ this.opentui.symbols.cancelKittyImageTransport(renderer, failed ? 1 : 0);
17323
+ }
17324
+ processKittyImageReply(renderer, response) {
17325
+ const bytes = this.encoder.encode(response);
17326
+ return this.opentui.symbols.processKittyImageReply(renderer, bytes, bytes.byteLength);
17327
+ }
17158
17328
  encodeUnicode(text, widthMethod) {
17159
17329
  const textBytes = this.encoder.encode(text);
17160
17330
  const outPtrBuffer = new ArrayBuffer(8);
@@ -17178,8 +17348,8 @@ class FFIRenderLib {
17178
17348
  freeUnicode(encoded) {
17179
17349
  this.opentui.symbols.freeUnicode(encoded.ptr, encoded.data.length);
17180
17350
  }
17181
- bufferDrawChar(buffer, char, x, y, fg2, bg2, attributes = 0) {
17182
- this.opentui.symbols.bufferDrawChar(buffer, char, x, y, rgbaBuffer(fg2), rgbaBuffer(bg2), attributes);
17351
+ bufferDrawChar(buffer, char, x, y, fg, bg, attributes = 0) {
17352
+ this.opentui.symbols.bufferDrawChar(buffer, char, x, y, rgbaBuffer(fg), rgbaBuffer(bg), attributes);
17183
17353
  }
17184
17354
  createAudioEngine(options) {
17185
17355
  const optionsBuffer = options == null ? null : AudioCreateOptionsStruct.pack(options);
@@ -17296,15 +17466,15 @@ class FFIRenderLib {
17296
17466
  return this.opentui.symbols.audioStop(engine);
17297
17467
  }
17298
17468
  audioCreateStream(engine, options) {
17299
- if (!isFFIU32(options.groupId) || options.format !== NativeAudioStreamFormat2.Mp3 && options.format !== NativeAudioStreamFormat2.Flac) {
17469
+ if (!isFFIU32(options.groupId) || !isFFIU32(options.sampleRate ?? 0) || !isFFIU32(options.channels ?? 0) || !Object.values(NativeAudioStreamFormat3).includes(options.format)) {
17300
17470
  return { status: -1, streamId: null };
17301
17471
  }
17302
- const optionsBuffer = AudioStreamCreateOptionsStruct.pack(options);
17303
- const outBuffer = new ArrayBuffer(4);
17472
+ const optionsBuffer = new Uint8Array(AudioStreamCreateOptionsStruct.pack(options));
17473
+ const outBuffer = new Uint32Array(1);
17304
17474
  const status = this.opentui.symbols.audioCreateStream(engine, optionsBuffer, outBuffer);
17305
17475
  if (status !== 0)
17306
17476
  return { status, streamId: null };
17307
- return { status, streamId: new Uint32Array(outBuffer)[0] ?? null };
17477
+ return { status, streamId: outBuffer[0] ?? null };
17308
17478
  }
17309
17479
  audioWriteStream(engine, streamId, data) {
17310
17480
  const dataLength = toSafeFFIU32Length(data.byteLength, "Audio stream data length");
@@ -17329,7 +17499,7 @@ class FFIRenderLib {
17329
17499
  }
17330
17500
  audioGetStreamStats(engine, streamId) {
17331
17501
  const storage = this.ffiStructStorage.audioStreamStats;
17332
- const status = this.opentui.symbols.audioGetStreamStats(engine, streamId, storage.buffer);
17502
+ const status = this.opentui.symbols.audioGetStreamStats(engine, streamId, storage.ffiView);
17333
17503
  if (status !== 0)
17334
17504
  return null;
17335
17505
  const stats = AudioStreamStatsStruct.unpackInto(storage.view, storage.result);
@@ -17337,7 +17507,7 @@ class FFIRenderLib {
17337
17507
  }
17338
17508
  audioCloseStream(engine, streamId, reason) {
17339
17509
  const storage = this.ffiStructStorage.audioStreamStats;
17340
- const status = this.opentui.symbols.audioCloseStream(engine, streamId, reason, storage.buffer);
17510
+ const status = this.opentui.symbols.audioCloseStream(engine, streamId, reason, storage.ffiView);
17341
17511
  if (status !== 0)
17342
17512
  return { status, stats: null };
17343
17513
  const stats = AudioStreamStatsStruct.unpackInto(storage.view, storage.result);
@@ -17501,10 +17671,10 @@ class FFIRenderLib {
17501
17671
  destroySyntaxStyle(style) {
17502
17672
  this.opentui.symbols.destroySyntaxStyle(style);
17503
17673
  }
17504
- syntaxStyleRegister(style, name, fg2, bg2, attributes) {
17674
+ syntaxStyleRegister(style, name, fg, bg, attributes) {
17505
17675
  const nameBytes = this.encoder.encode(name);
17506
- const fgBuffer = optionalRgbaBuffer(fg2);
17507
- const bgBuffer = optionalRgbaBuffer(bg2);
17676
+ const fgBuffer = optionalRgbaBuffer(fg);
17677
+ const bgBuffer = optionalRgbaBuffer(bg);
17508
17678
  return this.opentui.symbols.syntaxStyleRegister(style, viewOrNull(nameBytes), nameBytes.byteLength, fgBuffer, bgBuffer, attributes);
17509
17679
  }
17510
17680
  syntaxStyleResolveByName(style, name) {
@@ -17534,6 +17704,14 @@ class FFIRenderLib {
17534
17704
  const status = this.opentui.symbols.imageCreateFromRgba(pixels.byteLength === 0 ? null : pixels, BigInt(pixels.byteLength), width, height, stride, output);
17535
17705
  return this.imageHandleResult(status, output);
17536
17706
  }
17707
+ imageCreateFromPixels(pixels, width, height, stride, format, alpha) {
17708
+ const output = new Uint32Array(1);
17709
+ const status = this.opentui.symbols.imageCreateFromPixels(pixels, BigInt(pixels.byteLength), width, height, stride, format, alpha, output);
17710
+ return this.imageHandleResult(status, output);
17711
+ }
17712
+ imageUpdatePixels(image, pixels, stride, format, alpha) {
17713
+ return this.opentui.symbols.imageUpdatePixels(image, pixels, BigInt(pixels.byteLength), stride, format, alpha);
17714
+ }
17537
17715
  imageDestroy(image) {
17538
17716
  this.opentui.symbols.imageDestroy(image);
17539
17717
  }
@@ -17625,7 +17803,7 @@ class FFIRenderLib {
17625
17803
  var opentuiLibPath;
17626
17804
  var opentuiLib;
17627
17805
  var renderLibResolved = false;
17628
- function setRenderLibPath(libPath) {
17806
+ function setRenderLibPath2(libPath) {
17629
17807
  if (opentuiLibPath !== libPath) {
17630
17808
  if (renderLibResolved) {
17631
17809
  throw new Error("setRenderLibPath() must be called before resolveRenderLib()");
@@ -17637,7 +17815,7 @@ function setRenderLibPath(libPath) {
17637
17815
  opentuiLib = undefined;
17638
17816
  }
17639
17817
  }
17640
- function resolveRenderLib() {
17818
+ function resolveRenderLib2() {
17641
17819
  if (!opentuiLib) {
17642
17820
  try {
17643
17821
  opentuiLib = new FFIRenderLib(opentuiLibPath);
@@ -17653,204 +17831,204 @@ try {
17653
17831
  } catch (error) {}
17654
17832
 
17655
17833
  // src/yoga.ts
17656
- var Align;
17657
- ((Align2) => {
17658
- Align2[Align2["Auto"] = 0] = "Auto";
17659
- Align2[Align2["FlexStart"] = 1] = "FlexStart";
17660
- Align2[Align2["Center"] = 2] = "Center";
17661
- Align2[Align2["FlexEnd"] = 3] = "FlexEnd";
17662
- Align2[Align2["Stretch"] = 4] = "Stretch";
17663
- Align2[Align2["Baseline"] = 5] = "Baseline";
17664
- Align2[Align2["SpaceBetween"] = 6] = "SpaceBetween";
17665
- Align2[Align2["SpaceAround"] = 7] = "SpaceAround";
17666
- Align2[Align2["SpaceEvenly"] = 8] = "SpaceEvenly";
17667
- })(Align ||= {});
17668
- var BoxSizing;
17669
- ((BoxSizing2) => {
17670
- BoxSizing2[BoxSizing2["BorderBox"] = 0] = "BorderBox";
17671
- BoxSizing2[BoxSizing2["ContentBox"] = 1] = "ContentBox";
17672
- })(BoxSizing ||= {});
17673
- var Dimension;
17674
- ((Dimension2) => {
17675
- Dimension2[Dimension2["Width"] = 0] = "Width";
17676
- Dimension2[Dimension2["Height"] = 1] = "Height";
17677
- })(Dimension ||= {});
17678
- var Direction;
17679
- ((Direction2) => {
17680
- Direction2[Direction2["Inherit"] = 0] = "Inherit";
17681
- Direction2[Direction2["LTR"] = 1] = "LTR";
17682
- Direction2[Direction2["RTL"] = 2] = "RTL";
17683
- })(Direction ||= {});
17684
- var Display;
17685
- ((Display2) => {
17686
- Display2[Display2["Flex"] = 0] = "Flex";
17687
- Display2[Display2["None"] = 1] = "None";
17688
- Display2[Display2["Contents"] = 2] = "Contents";
17689
- })(Display ||= {});
17690
- var Edge;
17691
- ((Edge2) => {
17692
- Edge2[Edge2["Left"] = 0] = "Left";
17693
- Edge2[Edge2["Top"] = 1] = "Top";
17694
- Edge2[Edge2["Right"] = 2] = "Right";
17695
- Edge2[Edge2["Bottom"] = 3] = "Bottom";
17696
- Edge2[Edge2["Start"] = 4] = "Start";
17697
- Edge2[Edge2["End"] = 5] = "End";
17698
- Edge2[Edge2["Horizontal"] = 6] = "Horizontal";
17699
- Edge2[Edge2["Vertical"] = 7] = "Vertical";
17700
- Edge2[Edge2["All"] = 8] = "All";
17701
- })(Edge ||= {});
17702
- var Errata;
17703
- ((Errata2) => {
17704
- Errata2[Errata2["None"] = 0] = "None";
17705
- Errata2[Errata2["StretchFlexBasis"] = 1] = "StretchFlexBasis";
17706
- Errata2[Errata2["AbsolutePositionWithoutInsetsExcludesPadding"] = 2] = "AbsolutePositionWithoutInsetsExcludesPadding";
17707
- Errata2[Errata2["AbsolutePercentAgainstInnerSize"] = 4] = "AbsolutePercentAgainstInnerSize";
17708
- Errata2[Errata2["All"] = 2147483647] = "All";
17709
- Errata2[Errata2["Classic"] = 2147483646] = "Classic";
17710
- })(Errata ||= {});
17711
- var ExperimentalFeature;
17712
- ((ExperimentalFeature2) => {
17713
- ExperimentalFeature2[ExperimentalFeature2["WebFlexBasis"] = 0] = "WebFlexBasis";
17714
- })(ExperimentalFeature ||= {});
17715
- var FlexDirection;
17716
- ((FlexDirection2) => {
17717
- FlexDirection2[FlexDirection2["Column"] = 0] = "Column";
17718
- FlexDirection2[FlexDirection2["ColumnReverse"] = 1] = "ColumnReverse";
17719
- FlexDirection2[FlexDirection2["Row"] = 2] = "Row";
17720
- FlexDirection2[FlexDirection2["RowReverse"] = 3] = "RowReverse";
17721
- })(FlexDirection ||= {});
17722
- var Gutter;
17723
- ((Gutter2) => {
17724
- Gutter2[Gutter2["Column"] = 0] = "Column";
17725
- Gutter2[Gutter2["Row"] = 1] = "Row";
17726
- Gutter2[Gutter2["All"] = 2] = "All";
17727
- })(Gutter ||= {});
17728
- var Justify;
17729
- ((Justify2) => {
17730
- Justify2[Justify2["FlexStart"] = 0] = "FlexStart";
17731
- Justify2[Justify2["Center"] = 1] = "Center";
17732
- Justify2[Justify2["FlexEnd"] = 2] = "FlexEnd";
17733
- Justify2[Justify2["SpaceBetween"] = 3] = "SpaceBetween";
17734
- Justify2[Justify2["SpaceAround"] = 4] = "SpaceAround";
17735
- Justify2[Justify2["SpaceEvenly"] = 5] = "SpaceEvenly";
17736
- })(Justify ||= {});
17737
- var LogLevel;
17738
- ((LogLevel3) => {
17739
- LogLevel3[LogLevel3["Error"] = 0] = "Error";
17740
- LogLevel3[LogLevel3["Warn"] = 1] = "Warn";
17741
- LogLevel3[LogLevel3["Info"] = 2] = "Info";
17742
- LogLevel3[LogLevel3["Debug"] = 3] = "Debug";
17743
- LogLevel3[LogLevel3["Verbose"] = 4] = "Verbose";
17744
- LogLevel3[LogLevel3["Fatal"] = 5] = "Fatal";
17745
- })(LogLevel ||= {});
17746
- var MeasureMode;
17747
- ((MeasureMode2) => {
17748
- MeasureMode2[MeasureMode2["Undefined"] = 0] = "Undefined";
17749
- MeasureMode2[MeasureMode2["Exactly"] = 1] = "Exactly";
17750
- MeasureMode2[MeasureMode2["AtMost"] = 2] = "AtMost";
17751
- })(MeasureMode ||= {});
17752
- var NodeType;
17753
- ((NodeType2) => {
17754
- NodeType2[NodeType2["Default"] = 0] = "Default";
17755
- NodeType2[NodeType2["Text"] = 1] = "Text";
17756
- })(NodeType ||= {});
17757
- var Overflow;
17758
- ((Overflow2) => {
17759
- Overflow2[Overflow2["Visible"] = 0] = "Visible";
17760
- Overflow2[Overflow2["Hidden"] = 1] = "Hidden";
17761
- Overflow2[Overflow2["Scroll"] = 2] = "Scroll";
17762
- })(Overflow ||= {});
17763
- var PositionType;
17764
- ((PositionType2) => {
17765
- PositionType2[PositionType2["Static"] = 0] = "Static";
17766
- PositionType2[PositionType2["Relative"] = 1] = "Relative";
17767
- PositionType2[PositionType2["Absolute"] = 2] = "Absolute";
17768
- })(PositionType ||= {});
17769
- var Unit;
17770
- ((Unit2) => {
17771
- Unit2[Unit2["Undefined"] = 0] = "Undefined";
17772
- Unit2[Unit2["Point"] = 1] = "Point";
17773
- Unit2[Unit2["Percent"] = 2] = "Percent";
17774
- Unit2[Unit2["Auto"] = 3] = "Auto";
17775
- })(Unit ||= {});
17776
- var Wrap;
17834
+ var Align2;
17835
+ ((Align) => {
17836
+ Align[Align["Auto"] = 0] = "Auto";
17837
+ Align[Align["FlexStart"] = 1] = "FlexStart";
17838
+ Align[Align["Center"] = 2] = "Center";
17839
+ Align[Align["FlexEnd"] = 3] = "FlexEnd";
17840
+ Align[Align["Stretch"] = 4] = "Stretch";
17841
+ Align[Align["Baseline"] = 5] = "Baseline";
17842
+ Align[Align["SpaceBetween"] = 6] = "SpaceBetween";
17843
+ Align[Align["SpaceAround"] = 7] = "SpaceAround";
17844
+ Align[Align["SpaceEvenly"] = 8] = "SpaceEvenly";
17845
+ })(Align2 ||= {});
17846
+ var BoxSizing2;
17847
+ ((BoxSizing) => {
17848
+ BoxSizing[BoxSizing["BorderBox"] = 0] = "BorderBox";
17849
+ BoxSizing[BoxSizing["ContentBox"] = 1] = "ContentBox";
17850
+ })(BoxSizing2 ||= {});
17851
+ var Dimension2;
17852
+ ((Dimension) => {
17853
+ Dimension[Dimension["Width"] = 0] = "Width";
17854
+ Dimension[Dimension["Height"] = 1] = "Height";
17855
+ })(Dimension2 ||= {});
17856
+ var Direction2;
17857
+ ((Direction) => {
17858
+ Direction[Direction["Inherit"] = 0] = "Inherit";
17859
+ Direction[Direction["LTR"] = 1] = "LTR";
17860
+ Direction[Direction["RTL"] = 2] = "RTL";
17861
+ })(Direction2 ||= {});
17862
+ var Display2;
17863
+ ((Display) => {
17864
+ Display[Display["Flex"] = 0] = "Flex";
17865
+ Display[Display["None"] = 1] = "None";
17866
+ Display[Display["Contents"] = 2] = "Contents";
17867
+ })(Display2 ||= {});
17868
+ var Edge2;
17869
+ ((Edge) => {
17870
+ Edge[Edge["Left"] = 0] = "Left";
17871
+ Edge[Edge["Top"] = 1] = "Top";
17872
+ Edge[Edge["Right"] = 2] = "Right";
17873
+ Edge[Edge["Bottom"] = 3] = "Bottom";
17874
+ Edge[Edge["Start"] = 4] = "Start";
17875
+ Edge[Edge["End"] = 5] = "End";
17876
+ Edge[Edge["Horizontal"] = 6] = "Horizontal";
17877
+ Edge[Edge["Vertical"] = 7] = "Vertical";
17878
+ Edge[Edge["All"] = 8] = "All";
17879
+ })(Edge2 ||= {});
17880
+ var Errata2;
17881
+ ((Errata) => {
17882
+ Errata[Errata["None"] = 0] = "None";
17883
+ Errata[Errata["StretchFlexBasis"] = 1] = "StretchFlexBasis";
17884
+ Errata[Errata["AbsolutePositionWithoutInsetsExcludesPadding"] = 2] = "AbsolutePositionWithoutInsetsExcludesPadding";
17885
+ Errata[Errata["AbsolutePercentAgainstInnerSize"] = 4] = "AbsolutePercentAgainstInnerSize";
17886
+ Errata[Errata["All"] = 2147483647] = "All";
17887
+ Errata[Errata["Classic"] = 2147483646] = "Classic";
17888
+ })(Errata2 ||= {});
17889
+ var ExperimentalFeature2;
17890
+ ((ExperimentalFeature) => {
17891
+ ExperimentalFeature[ExperimentalFeature["WebFlexBasis"] = 0] = "WebFlexBasis";
17892
+ })(ExperimentalFeature2 ||= {});
17893
+ var FlexDirection2;
17894
+ ((FlexDirection) => {
17895
+ FlexDirection[FlexDirection["Column"] = 0] = "Column";
17896
+ FlexDirection[FlexDirection["ColumnReverse"] = 1] = "ColumnReverse";
17897
+ FlexDirection[FlexDirection["Row"] = 2] = "Row";
17898
+ FlexDirection[FlexDirection["RowReverse"] = 3] = "RowReverse";
17899
+ })(FlexDirection2 ||= {});
17900
+ var Gutter2;
17901
+ ((Gutter) => {
17902
+ Gutter[Gutter["Column"] = 0] = "Column";
17903
+ Gutter[Gutter["Row"] = 1] = "Row";
17904
+ Gutter[Gutter["All"] = 2] = "All";
17905
+ })(Gutter2 ||= {});
17906
+ var Justify2;
17907
+ ((Justify) => {
17908
+ Justify[Justify["FlexStart"] = 0] = "FlexStart";
17909
+ Justify[Justify["Center"] = 1] = "Center";
17910
+ Justify[Justify["FlexEnd"] = 2] = "FlexEnd";
17911
+ Justify[Justify["SpaceBetween"] = 3] = "SpaceBetween";
17912
+ Justify[Justify["SpaceAround"] = 4] = "SpaceAround";
17913
+ Justify[Justify["SpaceEvenly"] = 5] = "SpaceEvenly";
17914
+ })(Justify2 ||= {});
17915
+ var LogLevel3;
17916
+ ((LogLevel) => {
17917
+ LogLevel[LogLevel["Error"] = 0] = "Error";
17918
+ LogLevel[LogLevel["Warn"] = 1] = "Warn";
17919
+ LogLevel[LogLevel["Info"] = 2] = "Info";
17920
+ LogLevel[LogLevel["Debug"] = 3] = "Debug";
17921
+ LogLevel[LogLevel["Verbose"] = 4] = "Verbose";
17922
+ LogLevel[LogLevel["Fatal"] = 5] = "Fatal";
17923
+ })(LogLevel3 ||= {});
17924
+ var MeasureMode2;
17925
+ ((MeasureMode) => {
17926
+ MeasureMode[MeasureMode["Undefined"] = 0] = "Undefined";
17927
+ MeasureMode[MeasureMode["Exactly"] = 1] = "Exactly";
17928
+ MeasureMode[MeasureMode["AtMost"] = 2] = "AtMost";
17929
+ })(MeasureMode2 ||= {});
17930
+ var NodeType2;
17931
+ ((NodeType) => {
17932
+ NodeType[NodeType["Default"] = 0] = "Default";
17933
+ NodeType[NodeType["Text"] = 1] = "Text";
17934
+ })(NodeType2 ||= {});
17935
+ var Overflow2;
17936
+ ((Overflow) => {
17937
+ Overflow[Overflow["Visible"] = 0] = "Visible";
17938
+ Overflow[Overflow["Hidden"] = 1] = "Hidden";
17939
+ Overflow[Overflow["Scroll"] = 2] = "Scroll";
17940
+ })(Overflow2 ||= {});
17941
+ var PositionType2;
17942
+ ((PositionType) => {
17943
+ PositionType[PositionType["Static"] = 0] = "Static";
17944
+ PositionType[PositionType["Relative"] = 1] = "Relative";
17945
+ PositionType[PositionType["Absolute"] = 2] = "Absolute";
17946
+ })(PositionType2 ||= {});
17947
+ var Unit2;
17948
+ ((Unit) => {
17949
+ Unit[Unit["Undefined"] = 0] = "Undefined";
17950
+ Unit[Unit["Point"] = 1] = "Point";
17951
+ Unit[Unit["Percent"] = 2] = "Percent";
17952
+ Unit[Unit["Auto"] = 3] = "Auto";
17953
+ })(Unit2 ||= {});
17954
+ var Wrap2;
17777
17955
  ((_Wrap) => {
17778
17956
  _Wrap[_Wrap["NoWrap"] = 0] = "NoWrap";
17779
17957
  _Wrap[_Wrap["Wrap"] = 1] = "Wrap";
17780
17958
  _Wrap[_Wrap["WrapReverse"] = 2] = "WrapReverse";
17781
- })(Wrap ||= {});
17782
- var ALIGN_AUTO = 0 /* Auto */;
17783
- var ALIGN_FLEX_START = 1 /* FlexStart */;
17784
- var ALIGN_CENTER = 2 /* Center */;
17785
- var ALIGN_FLEX_END = 3 /* FlexEnd */;
17786
- var ALIGN_STRETCH = 4 /* Stretch */;
17787
- var ALIGN_BASELINE = 5 /* Baseline */;
17788
- var ALIGN_SPACE_BETWEEN = 6 /* SpaceBetween */;
17789
- var ALIGN_SPACE_AROUND = 7 /* SpaceAround */;
17790
- var ALIGN_SPACE_EVENLY = 8 /* SpaceEvenly */;
17791
- var BOX_SIZING_BORDER_BOX = 0 /* BorderBox */;
17792
- var BOX_SIZING_CONTENT_BOX = 1 /* ContentBox */;
17793
- var DIMENSION_WIDTH = 0 /* Width */;
17794
- var DIMENSION_HEIGHT = 1 /* Height */;
17795
- var DIRECTION_INHERIT = 0 /* Inherit */;
17796
- var DIRECTION_LTR = 1 /* LTR */;
17797
- var DIRECTION_RTL = 2 /* RTL */;
17798
- var DISPLAY_FLEX = 0 /* Flex */;
17799
- var DISPLAY_NONE = 1 /* None */;
17800
- var DISPLAY_CONTENTS = 2 /* Contents */;
17801
- var EDGE_LEFT = 0 /* Left */;
17802
- var EDGE_TOP = 1 /* Top */;
17803
- var EDGE_RIGHT = 2 /* Right */;
17804
- var EDGE_BOTTOM = 3 /* Bottom */;
17805
- var EDGE_START = 4 /* Start */;
17806
- var EDGE_END = 5 /* End */;
17807
- var EDGE_HORIZONTAL = 6 /* Horizontal */;
17808
- var EDGE_VERTICAL = 7 /* Vertical */;
17809
- var EDGE_ALL = 8 /* All */;
17810
- var ERRATA_NONE = 0 /* None */;
17811
- var ERRATA_STRETCH_FLEX_BASIS = 1 /* StretchFlexBasis */;
17812
- var ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING = 2 /* AbsolutePositionWithoutInsetsExcludesPadding */;
17813
- var ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE = 4 /* AbsolutePercentAgainstInnerSize */;
17814
- var ERRATA_ALL = 2147483647 /* All */;
17815
- var ERRATA_CLASSIC = 2147483646 /* Classic */;
17816
- var EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS = 0 /* WebFlexBasis */;
17817
- var FLEX_DIRECTION_COLUMN = 0 /* Column */;
17818
- var FLEX_DIRECTION_COLUMN_REVERSE = 1 /* ColumnReverse */;
17819
- var FLEX_DIRECTION_ROW = 2 /* Row */;
17820
- var FLEX_DIRECTION_ROW_REVERSE = 3 /* RowReverse */;
17821
- var GUTTER_COLUMN = 0 /* Column */;
17822
- var GUTTER_ROW = 1 /* Row */;
17823
- var GUTTER_ALL = 2 /* All */;
17824
- var JUSTIFY_FLEX_START = 0 /* FlexStart */;
17825
- var JUSTIFY_CENTER = 1 /* Center */;
17826
- var JUSTIFY_FLEX_END = 2 /* FlexEnd */;
17827
- var JUSTIFY_SPACE_BETWEEN = 3 /* SpaceBetween */;
17828
- var JUSTIFY_SPACE_AROUND = 4 /* SpaceAround */;
17829
- var JUSTIFY_SPACE_EVENLY = 5 /* SpaceEvenly */;
17830
- var LOG_LEVEL_ERROR = 0 /* Error */;
17831
- var LOG_LEVEL_WARN = 1 /* Warn */;
17832
- var LOG_LEVEL_INFO = 2 /* Info */;
17833
- var LOG_LEVEL_DEBUG = 3 /* Debug */;
17834
- var LOG_LEVEL_VERBOSE = 4 /* Verbose */;
17835
- var LOG_LEVEL_FATAL = 5 /* Fatal */;
17836
- var MEASURE_MODE_UNDEFINED = 0 /* Undefined */;
17837
- var MEASURE_MODE_EXACTLY = 1 /* Exactly */;
17838
- var MEASURE_MODE_AT_MOST = 2 /* AtMost */;
17839
- var NODE_TYPE_DEFAULT = 0 /* Default */;
17840
- var NODE_TYPE_TEXT = 1 /* Text */;
17841
- var OVERFLOW_VISIBLE = 0 /* Visible */;
17842
- var OVERFLOW_HIDDEN = 1 /* Hidden */;
17843
- var OVERFLOW_SCROLL = 2 /* Scroll */;
17844
- var POSITION_TYPE_STATIC = 0 /* Static */;
17845
- var POSITION_TYPE_RELATIVE = 1 /* Relative */;
17846
- var POSITION_TYPE_ABSOLUTE = 2 /* Absolute */;
17847
- var UNIT_UNDEFINED = 0 /* Undefined */;
17848
- var UNIT_POINT = 1 /* Point */;
17849
- var UNIT_PERCENT = 2 /* Percent */;
17850
- var UNIT_AUTO = 3 /* Auto */;
17851
- var WRAP_NO_WRAP = 0 /* NoWrap */;
17852
- var WRAP_WRAP = 1 /* Wrap */;
17853
- var WRAP_WRAP_REVERSE = 2 /* WrapReverse */;
17959
+ })(Wrap2 ||= {});
17960
+ var ALIGN_AUTO2 = 0 /* Auto */;
17961
+ var ALIGN_FLEX_START2 = 1 /* FlexStart */;
17962
+ var ALIGN_CENTER2 = 2 /* Center */;
17963
+ var ALIGN_FLEX_END2 = 3 /* FlexEnd */;
17964
+ var ALIGN_STRETCH2 = 4 /* Stretch */;
17965
+ var ALIGN_BASELINE2 = 5 /* Baseline */;
17966
+ var ALIGN_SPACE_BETWEEN2 = 6 /* SpaceBetween */;
17967
+ var ALIGN_SPACE_AROUND2 = 7 /* SpaceAround */;
17968
+ var ALIGN_SPACE_EVENLY2 = 8 /* SpaceEvenly */;
17969
+ var BOX_SIZING_BORDER_BOX2 = 0 /* BorderBox */;
17970
+ var BOX_SIZING_CONTENT_BOX2 = 1 /* ContentBox */;
17971
+ var DIMENSION_WIDTH2 = 0 /* Width */;
17972
+ var DIMENSION_HEIGHT2 = 1 /* Height */;
17973
+ var DIRECTION_INHERIT2 = 0 /* Inherit */;
17974
+ var DIRECTION_LTR2 = 1 /* LTR */;
17975
+ var DIRECTION_RTL2 = 2 /* RTL */;
17976
+ var DISPLAY_FLEX2 = 0 /* Flex */;
17977
+ var DISPLAY_NONE2 = 1 /* None */;
17978
+ var DISPLAY_CONTENTS2 = 2 /* Contents */;
17979
+ var EDGE_LEFT2 = 0 /* Left */;
17980
+ var EDGE_TOP2 = 1 /* Top */;
17981
+ var EDGE_RIGHT2 = 2 /* Right */;
17982
+ var EDGE_BOTTOM2 = 3 /* Bottom */;
17983
+ var EDGE_START2 = 4 /* Start */;
17984
+ var EDGE_END2 = 5 /* End */;
17985
+ var EDGE_HORIZONTAL2 = 6 /* Horizontal */;
17986
+ var EDGE_VERTICAL2 = 7 /* Vertical */;
17987
+ var EDGE_ALL2 = 8 /* All */;
17988
+ var ERRATA_NONE2 = 0 /* None */;
17989
+ var ERRATA_STRETCH_FLEX_BASIS2 = 1 /* StretchFlexBasis */;
17990
+ var ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING2 = 2 /* AbsolutePositionWithoutInsetsExcludesPadding */;
17991
+ var ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE2 = 4 /* AbsolutePercentAgainstInnerSize */;
17992
+ var ERRATA_ALL2 = 2147483647 /* All */;
17993
+ var ERRATA_CLASSIC2 = 2147483646 /* Classic */;
17994
+ var EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS2 = 0 /* WebFlexBasis */;
17995
+ var FLEX_DIRECTION_COLUMN2 = 0 /* Column */;
17996
+ var FLEX_DIRECTION_COLUMN_REVERSE2 = 1 /* ColumnReverse */;
17997
+ var FLEX_DIRECTION_ROW2 = 2 /* Row */;
17998
+ var FLEX_DIRECTION_ROW_REVERSE2 = 3 /* RowReverse */;
17999
+ var GUTTER_COLUMN2 = 0 /* Column */;
18000
+ var GUTTER_ROW2 = 1 /* Row */;
18001
+ var GUTTER_ALL2 = 2 /* All */;
18002
+ var JUSTIFY_FLEX_START2 = 0 /* FlexStart */;
18003
+ var JUSTIFY_CENTER2 = 1 /* Center */;
18004
+ var JUSTIFY_FLEX_END2 = 2 /* FlexEnd */;
18005
+ var JUSTIFY_SPACE_BETWEEN2 = 3 /* SpaceBetween */;
18006
+ var JUSTIFY_SPACE_AROUND2 = 4 /* SpaceAround */;
18007
+ var JUSTIFY_SPACE_EVENLY2 = 5 /* SpaceEvenly */;
18008
+ var LOG_LEVEL_ERROR2 = 0 /* Error */;
18009
+ var LOG_LEVEL_WARN2 = 1 /* Warn */;
18010
+ var LOG_LEVEL_INFO2 = 2 /* Info */;
18011
+ var LOG_LEVEL_DEBUG2 = 3 /* Debug */;
18012
+ var LOG_LEVEL_VERBOSE2 = 4 /* Verbose */;
18013
+ var LOG_LEVEL_FATAL2 = 5 /* Fatal */;
18014
+ var MEASURE_MODE_UNDEFINED2 = 0 /* Undefined */;
18015
+ var MEASURE_MODE_EXACTLY2 = 1 /* Exactly */;
18016
+ var MEASURE_MODE_AT_MOST2 = 2 /* AtMost */;
18017
+ var NODE_TYPE_DEFAULT2 = 0 /* Default */;
18018
+ var NODE_TYPE_TEXT2 = 1 /* Text */;
18019
+ var OVERFLOW_VISIBLE2 = 0 /* Visible */;
18020
+ var OVERFLOW_HIDDEN2 = 1 /* Hidden */;
18021
+ var OVERFLOW_SCROLL2 = 2 /* Scroll */;
18022
+ var POSITION_TYPE_STATIC2 = 0 /* Static */;
18023
+ var POSITION_TYPE_RELATIVE2 = 1 /* Relative */;
18024
+ var POSITION_TYPE_ABSOLUTE2 = 2 /* Absolute */;
18025
+ var UNIT_UNDEFINED2 = 0 /* Undefined */;
18026
+ var UNIT_POINT2 = 1 /* Point */;
18027
+ var UNIT_PERCENT2 = 2 /* Percent */;
18028
+ var UNIT_AUTO2 = 3 /* Auto */;
18029
+ var WRAP_NO_WRAP2 = 0 /* NoWrap */;
18030
+ var WRAP_WRAP2 = 1 /* Wrap */;
18031
+ var WRAP_WRAP_REVERSE2 = 2 /* WrapReverse */;
17854
18032
  var YogaEnumKind = {
17855
18033
  Direction: 0,
17856
18034
  FlexDirection: 1,
@@ -17897,7 +18075,7 @@ var measureCallbackLib = null;
17897
18075
  var dirtiedCallback = null;
17898
18076
  var dirtiedCallbackLib = null;
17899
18077
  function lib() {
17900
- return resolveRenderLib();
18078
+ return resolveRenderLib2();
17901
18079
  }
17902
18080
  function ensureMeasureCallback() {
17903
18081
  const renderLib = lib();
@@ -17975,14 +18153,14 @@ function normalizeLayoutInput(value) {
17975
18153
  return value === undefined || value === "auto" ? NaN : value;
17976
18154
  }
17977
18155
 
17978
- class Config {
18156
+ class Config2 {
17979
18157
  ptr;
17980
18158
  freed = false;
17981
- constructor(ptr3) {
17982
- this.ptr = ptr3;
18159
+ constructor(ptr) {
18160
+ this.ptr = ptr;
17983
18161
  }
17984
18162
  static create() {
17985
- return new Config(lib().yogaConfigCreate());
18163
+ return new Config2(lib().yogaConfigCreate());
17986
18164
  }
17987
18165
  static destroy(config) {
17988
18166
  config.free();
@@ -18035,33 +18213,33 @@ class Config {
18035
18213
  }
18036
18214
  }
18037
18215
 
18038
- class Node {
18216
+ class Node2 {
18039
18217
  ptr;
18040
18218
  freed = false;
18041
- constructor(ptr3) {
18042
- this.ptr = ptr3;
18043
- nodeRegistry.set(ptr3, this);
18219
+ constructor(ptr) {
18220
+ this.ptr = ptr;
18221
+ nodeRegistry.set(ptr, this);
18044
18222
  }
18045
18223
  static create(config) {
18046
- return Node.fromPointer(config ? lib().yogaNodeCreateWithConfig(config.ptr) : lib().yogaNodeCreate());
18224
+ return Node2.fromPointer(config ? lib().yogaNodeCreateWithConfig(config.ptr) : lib().yogaNodeCreate());
18047
18225
  }
18048
18226
  static createForOpenTUI() {
18049
- return Node.fromPointer(lib().yogaNodeCreateForOpenTUI());
18227
+ return Node2.fromPointer(lib().yogaNodeCreateForOpenTUI());
18050
18228
  }
18051
18229
  static createDefault() {
18052
- return Node.create();
18230
+ return Node2.create();
18053
18231
  }
18054
18232
  static createWithConfig(config) {
18055
- return Node.create(config);
18233
+ return Node2.create(config);
18056
18234
  }
18057
18235
  static destroy(node) {
18058
18236
  node.free();
18059
18237
  }
18060
- static fromPointer(ptr3) {
18061
- const existing = nodeRegistry.get(ptr3);
18238
+ static fromPointer(ptr) {
18239
+ const existing = nodeRegistry.get(ptr);
18062
18240
  if (existing)
18063
18241
  return existing;
18064
- return new Node(ptr3);
18242
+ return new Node2(ptr);
18065
18243
  }
18066
18244
  isFreed() {
18067
18245
  return this.freed;
@@ -18117,7 +18295,7 @@ class Node {
18117
18295
  if (this.freed)
18118
18296
  return null;
18119
18297
  const child = lib().yogaNodeGetChild(this.ptr, index);
18120
- return child ? Node.fromPointer(child) : null;
18298
+ return child ? Node2.fromPointer(child) : null;
18121
18299
  }
18122
18300
  getChildCount() {
18123
18301
  if (this.freed)
@@ -18128,7 +18306,7 @@ class Node {
18128
18306
  if (this.freed)
18129
18307
  return null;
18130
18308
  const parent = lib().yogaNodeGetParent(this.ptr);
18131
- return parent ? Node.fromPointer(parent) : null;
18309
+ return parent ? Node2.fromPointer(parent) : null;
18132
18310
  }
18133
18311
  calculateLayout(width, height, direction = 1 /* LTR */) {
18134
18312
  if (this.freed)
@@ -18397,10 +18575,10 @@ class Node {
18397
18575
  getGap(gutter) {
18398
18576
  return this.getValue(YogaValueKind.Gap, gutter);
18399
18577
  }
18400
- setBorder(edge, border2) {
18578
+ setBorder(edge, border) {
18401
18579
  if (this.freed)
18402
18580
  return;
18403
- lib().yogaNodeStyleSetBorder(this.ptr, edge, border2 ?? NaN);
18581
+ lib().yogaNodeStyleSetBorder(this.ptr, edge, border ?? NaN);
18404
18582
  }
18405
18583
  getBorder(edge) {
18406
18584
  if (this.freed)
@@ -18513,102 +18691,102 @@ class Node {
18513
18691
  }
18514
18692
  }
18515
18693
  var Yoga = {
18516
- Config,
18517
- Node,
18518
- Align,
18519
- BoxSizing,
18520
- Dimension,
18521
- Direction,
18522
- Display,
18523
- Edge,
18524
- Errata,
18525
- ExperimentalFeature,
18526
- FlexDirection,
18527
- Gutter,
18528
- Justify,
18529
- LogLevel,
18530
- MeasureMode,
18531
- NodeType,
18532
- Overflow,
18533
- PositionType,
18534
- Unit,
18535
- Wrap,
18536
- ALIGN_AUTO,
18537
- ALIGN_FLEX_START,
18538
- ALIGN_CENTER,
18539
- ALIGN_FLEX_END,
18540
- ALIGN_STRETCH,
18541
- ALIGN_BASELINE,
18542
- ALIGN_SPACE_BETWEEN,
18543
- ALIGN_SPACE_AROUND,
18544
- ALIGN_SPACE_EVENLY,
18545
- BOX_SIZING_BORDER_BOX,
18546
- BOX_SIZING_CONTENT_BOX,
18547
- DIMENSION_WIDTH,
18548
- DIMENSION_HEIGHT,
18549
- DIRECTION_INHERIT,
18550
- DIRECTION_LTR,
18551
- DIRECTION_RTL,
18552
- DISPLAY_FLEX,
18553
- DISPLAY_NONE,
18554
- DISPLAY_CONTENTS,
18555
- EDGE_LEFT,
18556
- EDGE_TOP,
18557
- EDGE_RIGHT,
18558
- EDGE_BOTTOM,
18559
- EDGE_START,
18560
- EDGE_END,
18561
- EDGE_HORIZONTAL,
18562
- EDGE_VERTICAL,
18563
- EDGE_ALL,
18564
- ERRATA_NONE,
18565
- ERRATA_STRETCH_FLEX_BASIS,
18566
- ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING,
18567
- ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE,
18568
- ERRATA_ALL,
18569
- ERRATA_CLASSIC,
18570
- EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS,
18571
- FLEX_DIRECTION_COLUMN,
18572
- FLEX_DIRECTION_COLUMN_REVERSE,
18573
- FLEX_DIRECTION_ROW,
18574
- FLEX_DIRECTION_ROW_REVERSE,
18575
- GUTTER_COLUMN,
18576
- GUTTER_ROW,
18577
- GUTTER_ALL,
18578
- JUSTIFY_FLEX_START,
18579
- JUSTIFY_CENTER,
18580
- JUSTIFY_FLEX_END,
18581
- JUSTIFY_SPACE_BETWEEN,
18582
- JUSTIFY_SPACE_AROUND,
18583
- JUSTIFY_SPACE_EVENLY,
18584
- LOG_LEVEL_ERROR,
18585
- LOG_LEVEL_WARN,
18586
- LOG_LEVEL_INFO,
18587
- LOG_LEVEL_DEBUG,
18588
- LOG_LEVEL_VERBOSE,
18589
- LOG_LEVEL_FATAL,
18590
- MEASURE_MODE_UNDEFINED,
18591
- MEASURE_MODE_EXACTLY,
18592
- MEASURE_MODE_AT_MOST,
18593
- NODE_TYPE_DEFAULT,
18594
- NODE_TYPE_TEXT,
18595
- OVERFLOW_VISIBLE,
18596
- OVERFLOW_HIDDEN,
18597
- OVERFLOW_SCROLL,
18598
- POSITION_TYPE_STATIC,
18599
- POSITION_TYPE_RELATIVE,
18600
- POSITION_TYPE_ABSOLUTE,
18601
- UNIT_UNDEFINED,
18602
- UNIT_POINT,
18603
- UNIT_PERCENT,
18604
- UNIT_AUTO,
18605
- WRAP_NO_WRAP,
18606
- WRAP_WRAP,
18607
- WRAP_WRAP_REVERSE
18694
+ Config: Config2,
18695
+ Node: Node2,
18696
+ Align: Align2,
18697
+ BoxSizing: BoxSizing2,
18698
+ Dimension: Dimension2,
18699
+ Direction: Direction2,
18700
+ Display: Display2,
18701
+ Edge: Edge2,
18702
+ Errata: Errata2,
18703
+ ExperimentalFeature: ExperimentalFeature2,
18704
+ FlexDirection: FlexDirection2,
18705
+ Gutter: Gutter2,
18706
+ Justify: Justify2,
18707
+ LogLevel: LogLevel3,
18708
+ MeasureMode: MeasureMode2,
18709
+ NodeType: NodeType2,
18710
+ Overflow: Overflow2,
18711
+ PositionType: PositionType2,
18712
+ Unit: Unit2,
18713
+ Wrap: Wrap2,
18714
+ ALIGN_AUTO: ALIGN_AUTO2,
18715
+ ALIGN_FLEX_START: ALIGN_FLEX_START2,
18716
+ ALIGN_CENTER: ALIGN_CENTER2,
18717
+ ALIGN_FLEX_END: ALIGN_FLEX_END2,
18718
+ ALIGN_STRETCH: ALIGN_STRETCH2,
18719
+ ALIGN_BASELINE: ALIGN_BASELINE2,
18720
+ ALIGN_SPACE_BETWEEN: ALIGN_SPACE_BETWEEN2,
18721
+ ALIGN_SPACE_AROUND: ALIGN_SPACE_AROUND2,
18722
+ ALIGN_SPACE_EVENLY: ALIGN_SPACE_EVENLY2,
18723
+ BOX_SIZING_BORDER_BOX: BOX_SIZING_BORDER_BOX2,
18724
+ BOX_SIZING_CONTENT_BOX: BOX_SIZING_CONTENT_BOX2,
18725
+ DIMENSION_WIDTH: DIMENSION_WIDTH2,
18726
+ DIMENSION_HEIGHT: DIMENSION_HEIGHT2,
18727
+ DIRECTION_INHERIT: DIRECTION_INHERIT2,
18728
+ DIRECTION_LTR: DIRECTION_LTR2,
18729
+ DIRECTION_RTL: DIRECTION_RTL2,
18730
+ DISPLAY_FLEX: DISPLAY_FLEX2,
18731
+ DISPLAY_NONE: DISPLAY_NONE2,
18732
+ DISPLAY_CONTENTS: DISPLAY_CONTENTS2,
18733
+ EDGE_LEFT: EDGE_LEFT2,
18734
+ EDGE_TOP: EDGE_TOP2,
18735
+ EDGE_RIGHT: EDGE_RIGHT2,
18736
+ EDGE_BOTTOM: EDGE_BOTTOM2,
18737
+ EDGE_START: EDGE_START2,
18738
+ EDGE_END: EDGE_END2,
18739
+ EDGE_HORIZONTAL: EDGE_HORIZONTAL2,
18740
+ EDGE_VERTICAL: EDGE_VERTICAL2,
18741
+ EDGE_ALL: EDGE_ALL2,
18742
+ ERRATA_NONE: ERRATA_NONE2,
18743
+ ERRATA_STRETCH_FLEX_BASIS: ERRATA_STRETCH_FLEX_BASIS2,
18744
+ ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING: ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING2,
18745
+ ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE: ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE2,
18746
+ ERRATA_ALL: ERRATA_ALL2,
18747
+ ERRATA_CLASSIC: ERRATA_CLASSIC2,
18748
+ EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS: EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS2,
18749
+ FLEX_DIRECTION_COLUMN: FLEX_DIRECTION_COLUMN2,
18750
+ FLEX_DIRECTION_COLUMN_REVERSE: FLEX_DIRECTION_COLUMN_REVERSE2,
18751
+ FLEX_DIRECTION_ROW: FLEX_DIRECTION_ROW2,
18752
+ FLEX_DIRECTION_ROW_REVERSE: FLEX_DIRECTION_ROW_REVERSE2,
18753
+ GUTTER_COLUMN: GUTTER_COLUMN2,
18754
+ GUTTER_ROW: GUTTER_ROW2,
18755
+ GUTTER_ALL: GUTTER_ALL2,
18756
+ JUSTIFY_FLEX_START: JUSTIFY_FLEX_START2,
18757
+ JUSTIFY_CENTER: JUSTIFY_CENTER2,
18758
+ JUSTIFY_FLEX_END: JUSTIFY_FLEX_END2,
18759
+ JUSTIFY_SPACE_BETWEEN: JUSTIFY_SPACE_BETWEEN2,
18760
+ JUSTIFY_SPACE_AROUND: JUSTIFY_SPACE_AROUND2,
18761
+ JUSTIFY_SPACE_EVENLY: JUSTIFY_SPACE_EVENLY2,
18762
+ LOG_LEVEL_ERROR: LOG_LEVEL_ERROR2,
18763
+ LOG_LEVEL_WARN: LOG_LEVEL_WARN2,
18764
+ LOG_LEVEL_INFO: LOG_LEVEL_INFO2,
18765
+ LOG_LEVEL_DEBUG: LOG_LEVEL_DEBUG2,
18766
+ LOG_LEVEL_VERBOSE: LOG_LEVEL_VERBOSE2,
18767
+ LOG_LEVEL_FATAL: LOG_LEVEL_FATAL2,
18768
+ MEASURE_MODE_UNDEFINED: MEASURE_MODE_UNDEFINED2,
18769
+ MEASURE_MODE_EXACTLY: MEASURE_MODE_EXACTLY2,
18770
+ MEASURE_MODE_AT_MOST: MEASURE_MODE_AT_MOST2,
18771
+ NODE_TYPE_DEFAULT: NODE_TYPE_DEFAULT2,
18772
+ NODE_TYPE_TEXT: NODE_TYPE_TEXT2,
18773
+ OVERFLOW_VISIBLE: OVERFLOW_VISIBLE2,
18774
+ OVERFLOW_HIDDEN: OVERFLOW_HIDDEN2,
18775
+ OVERFLOW_SCROLL: OVERFLOW_SCROLL2,
18776
+ POSITION_TYPE_STATIC: POSITION_TYPE_STATIC2,
18777
+ POSITION_TYPE_RELATIVE: POSITION_TYPE_RELATIVE2,
18778
+ POSITION_TYPE_ABSOLUTE: POSITION_TYPE_ABSOLUTE2,
18779
+ UNIT_UNDEFINED: UNIT_UNDEFINED2,
18780
+ UNIT_POINT: UNIT_POINT2,
18781
+ UNIT_PERCENT: UNIT_PERCENT2,
18782
+ UNIT_AUTO: UNIT_AUTO2,
18783
+ WRAP_NO_WRAP: WRAP_NO_WRAP2,
18784
+ WRAP_WRAP: WRAP_WRAP2,
18785
+ WRAP_WRAP_REVERSE: WRAP_WRAP_REVERSE2
18608
18786
  };
18609
18787
  var yoga_default = Yoga;
18610
18788
 
18611
- 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 };
18789
+ 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 };
18612
18790
 
18613
- //# debugId=A1152A2EED56A71564756E2164756E21
18614
- //# sourceMappingURL=chunk-bun-b0662dgp.js.map
18791
+ //# debugId=C2AA7ABE4C3E076964756E2164756E21
18792
+ //# sourceMappingURL=chunk-bun-37s3zwb6.js.map