postboy-tui 1.3.4 → 1.3.6

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 (2) hide show
  1. package/dist/cli.js +873 -205
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -67534,7 +67534,7 @@ var useFocusManager = () => {
67534
67534
  };
67535
67535
  var use_focus_manager_default = useFocusManager;
67536
67536
  // src/ui/app/ui.tsx
67537
- var import_react31 = __toESM(require_react(), 1);
67537
+ var import_react33 = __toESM(require_react(), 1);
67538
67538
 
67539
67539
  // src/utils/history.ts
67540
67540
  import { promises as fs2 } from "fs";
@@ -67831,27 +67831,31 @@ var Spinner = ({ theme }) => {
67831
67831
  // src/ui/app/components/Formfield.tsx
67832
67832
  var import_react24 = __toESM(require_react(), 1);
67833
67833
  var jsx_dev_runtime2 = __toESM(require_jsx_dev_runtime(), 1);
67834
- var FormField = ({ label, value, onChange, placeholder, theme, suggestions = [], onFocusChange }) => {
67835
- const { isFocused } = use_focus_default();
67836
- import_react24.useEffect(() => {
67837
- onFocusChange?.(isFocused);
67838
- }, [isFocused, onFocusChange]);
67834
+ var InputDialog = ({ label, value, onChange, onClose, theme, suggestions = [] }) => {
67835
+ const [localValue, setLocalValue] = import_react24.useState(value);
67839
67836
  const [showSuggestions, setShowSuggestions] = import_react24.useState(false);
67840
67837
  const [filteredSuggestions, setFilteredSuggestions] = import_react24.useState([]);
67841
67838
  const [highlightedIndex, setHighlightedIndex] = import_react24.useState(0);
67842
67839
  import_react24.useEffect(() => {
67843
- if (isFocused && suggestions.length > 0 && value) {
67844
- const filtered = suggestions.filter((s) => s.toLowerCase().startsWith(value.toLowerCase()));
67840
+ if (suggestions.length > 0 && localValue) {
67841
+ const filtered = suggestions.filter((s) => s.toLowerCase().startsWith(localValue.toLowerCase()));
67845
67842
  setFilteredSuggestions(filtered);
67846
67843
  setShowSuggestions(filtered.length > 0);
67847
67844
  setHighlightedIndex(0);
67848
67845
  } else {
67849
67846
  setShowSuggestions(false);
67850
67847
  }
67851
- }, [value, isFocused, suggestions]);
67848
+ }, [localValue, suggestions]);
67852
67849
  use_input_default((input, key) => {
67853
- if (!isFocused)
67850
+ if (key.escape) {
67851
+ onClose();
67852
+ return;
67853
+ }
67854
+ if (key.return && !showSuggestions) {
67855
+ onChange(localValue);
67856
+ onClose();
67854
67857
  return;
67858
+ }
67855
67859
  if (showSuggestions && (key.upArrow || key.downArrow)) {
67856
67860
  setHighlightedIndex((idx) => {
67857
67861
  if (key.upArrow)
@@ -67864,88 +67868,411 @@ var FormField = ({ label, value, onChange, placeholder, theme, suggestions = [],
67864
67868
  }
67865
67869
  if (showSuggestions && (key.return || key.tab)) {
67866
67870
  if (filteredSuggestions.length > 0 && typeof filteredSuggestions[highlightedIndex] === "string") {
67867
- onChange(filteredSuggestions[highlightedIndex]);
67871
+ setLocalValue(filteredSuggestions[highlightedIndex]);
67868
67872
  setShowSuggestions(false);
67869
67873
  }
67870
67874
  return;
67871
67875
  }
67872
67876
  if (key.backspace || key.delete) {
67873
- onChange(value.slice(0, -1));
67877
+ setLocalValue((v) => v.slice(0, -1));
67874
67878
  return;
67875
67879
  }
67876
67880
  if (!key.upArrow && !key.downArrow && !key.leftArrow && !key.rightArrow && !key.return && !key.tab) {
67877
- onChange(value + input);
67881
+ setLocalValue((v) => v + input);
67878
67882
  }
67879
- }, { isActive: isFocused });
67883
+ });
67880
67884
  return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Box_default, {
67881
67885
  flexDirection: "column",
67886
+ borderStyle: "double",
67887
+ borderColor: theme.accent,
67888
+ padding: 1,
67889
+ marginY: 1,
67882
67890
  children: [
67883
67891
  /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Box_default, {
67892
+ marginBottom: 1,
67884
67893
  children: [
67885
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Box_default, {
67886
- width: 8,
67887
- children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67888
- color: isFocused ? theme.accent : theme.muted,
67889
- children: [
67890
- label,
67891
- ":"
67892
- ]
67893
- }, undefined, true, undefined, this)
67894
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67895
+ color: theme.accent,
67896
+ bold: true,
67897
+ children: [
67898
+ "Edit ",
67899
+ label
67900
+ ]
67901
+ }, undefined, true, undefined, this),
67902
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67903
+ color: theme.muted,
67904
+ children: " (Enter to save, Esc to cancel)"
67905
+ }, undefined, false, undefined, this)
67906
+ ]
67907
+ }, undefined, true, undefined, this),
67908
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Box_default, {
67909
+ borderStyle: "round",
67910
+ borderColor: theme.primary,
67911
+ paddingX: 1,
67912
+ children: [
67913
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67914
+ color: theme.white,
67915
+ children: localValue
67894
67916
  }, undefined, false, undefined, this),
67895
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Box_default, {
67896
- borderStyle: "round",
67897
- borderColor: isFocused ? theme.primary : theme.muted,
67898
- paddingX: 1,
67899
- flexGrow: 1,
67900
- children: value ? /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67901
- color: isFocused ? theme.white : theme.primary,
67902
- children: value
67903
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67904
- color: theme.muted,
67905
- children: placeholder
67906
- }, undefined, false, undefined, this)
67917
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67918
+ color: theme.accent,
67919
+ children: "▌"
67907
67920
  }, undefined, false, undefined, this)
67908
67921
  ]
67909
67922
  }, undefined, true, undefined, this),
67910
67923
  showSuggestions && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Box_default, {
67911
67924
  flexDirection: "column",
67912
- marginLeft: 8,
67925
+ marginTop: 1,
67913
67926
  borderStyle: "round",
67914
67927
  borderColor: theme.muted,
67915
67928
  children: filteredSuggestions.filter((s) => typeof s === "string" && s.trim().length > 0).map((s, idx) => /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Box_default, {
67916
67929
  children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67917
- color: idx === highlightedIndex ? theme.white : theme.primary,
67918
- children: typeof s === "string" ? s : "[invalid]"
67919
- }, undefined, false, undefined, this)
67930
+ color: idx === highlightedIndex ? theme.accent : theme.primary,
67931
+ children: [
67932
+ idx === highlightedIndex ? "▸ " : " ",
67933
+ typeof s === "string" ? s : "[invalid]"
67934
+ ]
67935
+ }, undefined, true, undefined, this)
67920
67936
  }, s || idx, false, undefined, this))
67921
67937
  }, undefined, false, undefined, this)
67922
67938
  ]
67923
67939
  }, undefined, true, undefined, this);
67924
67940
  };
67941
+ var FormField = ({ label, value, onChange, placeholder, theme, suggestions = [], onFocusChange }) => {
67942
+ const { isFocused } = use_focus_default();
67943
+ const [showDialog, setShowDialog] = import_react24.useState(false);
67944
+ import_react24.useEffect(() => {
67945
+ onFocusChange?.(isFocused || showDialog);
67946
+ }, [isFocused, showDialog, onFocusChange]);
67947
+ use_input_default((_, key) => {
67948
+ if (isFocused && key.return && !showDialog) {
67949
+ setShowDialog(true);
67950
+ }
67951
+ }, { isActive: isFocused && !showDialog });
67952
+ const handleDialogClose = () => {
67953
+ setShowDialog(false);
67954
+ };
67955
+ const handleDialogSave = (newValue) => {
67956
+ onChange(newValue);
67957
+ };
67958
+ if (showDialog) {
67959
+ return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(InputDialog, {
67960
+ label,
67961
+ value,
67962
+ onChange: handleDialogSave,
67963
+ onClose: handleDialogClose,
67964
+ theme,
67965
+ suggestions
67966
+ }, undefined, false, undefined, this);
67967
+ }
67968
+ return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Box_default, {
67969
+ flexDirection: "column",
67970
+ children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Box_default, {
67971
+ children: [
67972
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Box_default, {
67973
+ width: 8,
67974
+ children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67975
+ color: isFocused ? theme.accent : theme.muted,
67976
+ children: [
67977
+ label,
67978
+ ":"
67979
+ ]
67980
+ }, undefined, true, undefined, this)
67981
+ }, undefined, false, undefined, this),
67982
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Box_default, {
67983
+ borderStyle: "round",
67984
+ borderColor: isFocused ? theme.primary : theme.muted,
67985
+ paddingX: 1,
67986
+ flexGrow: 1,
67987
+ children: [
67988
+ value ? /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67989
+ color: isFocused ? theme.white : theme.primary,
67990
+ children: value
67991
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67992
+ color: theme.muted,
67993
+ children: placeholder
67994
+ }, undefined, false, undefined, this),
67995
+ isFocused && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67996
+ color: theme.muted,
67997
+ children: " (Press Enter to edit)"
67998
+ }, undefined, false, undefined, this)
67999
+ ]
68000
+ }, undefined, true, undefined, this)
68001
+ ]
68002
+ }, undefined, true, undefined, this)
68003
+ }, undefined, false, undefined, this);
68004
+ };
67925
68005
 
67926
- // src/ui/app/components/tabcomps.tsx
68006
+ // src/ui/app/components/keyvaluefield.tsx
68007
+ var import_react25 = __toESM(require_react(), 1);
67927
68008
  var jsx_dev_runtime3 = __toESM(require_jsx_dev_runtime(), 1);
68009
+ var KeyValueDialog = ({ label, pairs, onSave, onClose, theme }) => {
68010
+ const [localPairs, setLocalPairs] = import_react25.useState(pairs.length > 0 ? pairs : [{ key: "", value: "" }]);
68011
+ const [activeField, setActiveField] = import_react25.useState("key");
68012
+ const [activeRow, setActiveRow] = import_react25.useState(0);
68013
+ use_input_default((input, key) => {
68014
+ if (key.escape) {
68015
+ onClose();
68016
+ return;
68017
+ }
68018
+ if (key.ctrl && key.return) {
68019
+ onSave(localPairs.filter((p) => p.key.trim() !== ""));
68020
+ onClose();
68021
+ return;
68022
+ }
68023
+ if (key.tab) {
68024
+ if (activeField === "key") {
68025
+ setActiveField("value");
68026
+ } else {
68027
+ setActiveField("key");
68028
+ if (activeRow < localPairs.length - 1) {
68029
+ setActiveRow((r) => r + 1);
68030
+ }
68031
+ }
68032
+ return;
68033
+ }
68034
+ if (key.upArrow) {
68035
+ if (activeRow > 0)
68036
+ setActiveRow((r) => r - 1);
68037
+ return;
68038
+ }
68039
+ if (key.downArrow) {
68040
+ if (activeRow < localPairs.length - 1)
68041
+ setActiveRow((r) => r + 1);
68042
+ return;
68043
+ }
68044
+ if (key.return) {
68045
+ setLocalPairs((p) => [...p, { key: "", value: "" }]);
68046
+ setActiveRow(localPairs.length);
68047
+ setActiveField("key");
68048
+ return;
68049
+ }
68050
+ if (key.backspace || key.delete) {
68051
+ setLocalPairs((p) => {
68052
+ const newPairs = [...p];
68053
+ const current = newPairs[activeRow];
68054
+ if (!current)
68055
+ return newPairs;
68056
+ if (activeField === "key") {
68057
+ if (current.key === "" && newPairs.length > 1) {
68058
+ newPairs.splice(activeRow, 1);
68059
+ setActiveRow(Math.max(0, activeRow - 1));
68060
+ } else {
68061
+ newPairs[activeRow] = { key: current.key.slice(0, -1), value: current.value };
68062
+ }
68063
+ } else {
68064
+ newPairs[activeRow] = { key: current.key, value: current.value.slice(0, -1) };
68065
+ }
68066
+ return newPairs;
68067
+ });
68068
+ return;
68069
+ }
68070
+ if (!key.upArrow && !key.downArrow && !key.leftArrow && !key.rightArrow && !key.return && !key.tab) {
68071
+ setLocalPairs((p) => {
68072
+ const newPairs = [...p];
68073
+ const current = newPairs[activeRow];
68074
+ if (!current)
68075
+ return newPairs;
68076
+ if (activeField === "key") {
68077
+ newPairs[activeRow] = { key: current.key + input, value: current.value };
68078
+ } else {
68079
+ newPairs[activeRow] = { key: current.key, value: current.value + input };
68080
+ }
68081
+ return newPairs;
68082
+ });
68083
+ }
68084
+ });
68085
+ return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
68086
+ flexDirection: "column",
68087
+ borderStyle: "double",
68088
+ borderColor: theme.accent,
68089
+ padding: 1,
68090
+ marginY: 1,
68091
+ children: [
68092
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
68093
+ marginBottom: 1,
68094
+ children: [
68095
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
68096
+ color: theme.accent,
68097
+ bold: true,
68098
+ children: [
68099
+ "Edit ",
68100
+ label
68101
+ ]
68102
+ }, undefined, true, undefined, this),
68103
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
68104
+ color: theme.muted,
68105
+ children: " (Tab: switch field, Enter: new row, Ctrl+Enter: save, Esc: cancel)"
68106
+ }, undefined, false, undefined, this)
68107
+ ]
68108
+ }, undefined, true, undefined, this),
68109
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
68110
+ flexDirection: "column",
68111
+ gap: 1,
68112
+ children: localPairs.map((pair, idx) => /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
68113
+ gap: 1,
68114
+ children: [
68115
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
68116
+ width: 4,
68117
+ children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
68118
+ color: theme.muted,
68119
+ children: [
68120
+ idx + 1,
68121
+ "."
68122
+ ]
68123
+ }, undefined, true, undefined, this)
68124
+ }, undefined, false, undefined, this),
68125
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
68126
+ borderStyle: "round",
68127
+ borderColor: idx === activeRow && activeField === "key" ? theme.accent : theme.muted,
68128
+ paddingX: 1,
68129
+ width: "40%",
68130
+ children: [
68131
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
68132
+ color: theme.muted,
68133
+ children: "Key: "
68134
+ }, undefined, false, undefined, this),
68135
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
68136
+ color: idx === activeRow && activeField === "key" ? theme.white : theme.primary,
68137
+ children: pair.key
68138
+ }, undefined, false, undefined, this),
68139
+ idx === activeRow && activeField === "key" && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
68140
+ color: theme.accent,
68141
+ children: "▌"
68142
+ }, undefined, false, undefined, this)
68143
+ ]
68144
+ }, undefined, true, undefined, this),
68145
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
68146
+ borderStyle: "round",
68147
+ borderColor: idx === activeRow && activeField === "value" ? theme.accent : theme.muted,
68148
+ paddingX: 1,
68149
+ flexGrow: 1,
68150
+ children: [
68151
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
68152
+ color: theme.muted,
68153
+ children: "Value: "
68154
+ }, undefined, false, undefined, this),
68155
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
68156
+ color: idx === activeRow && activeField === "value" ? theme.white : theme.primary,
68157
+ children: pair.value
68158
+ }, undefined, false, undefined, this),
68159
+ idx === activeRow && activeField === "value" && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
68160
+ color: theme.accent,
68161
+ children: "▌"
68162
+ }, undefined, false, undefined, this)
68163
+ ]
68164
+ }, undefined, true, undefined, this)
68165
+ ]
68166
+ }, idx, true, undefined, this))
68167
+ }, undefined, false, undefined, this)
68168
+ ]
68169
+ }, undefined, true, undefined, this);
68170
+ };
68171
+ var KeyValueField = ({ label, value, onChange, placeholder, theme, onFocusChange }) => {
68172
+ const { isFocused } = use_focus_default();
68173
+ const [showDialog, setShowDialog] = import_react25.useState(false);
68174
+ import_react25.useEffect(() => {
68175
+ onFocusChange?.(isFocused || showDialog);
68176
+ }, [isFocused, showDialog, onFocusChange]);
68177
+ const parseJsonToPairs = (json) => {
68178
+ try {
68179
+ const obj = JSON.parse(json || "{}");
68180
+ return Object.entries(obj).map(([key, val]) => ({ key, value: String(val) }));
68181
+ } catch {
68182
+ return [];
68183
+ }
68184
+ };
68185
+ const pairsToJson = (pairs2) => {
68186
+ const obj = {};
68187
+ pairs2.forEach((p) => {
68188
+ if (p.key.trim())
68189
+ obj[p.key] = p.value;
68190
+ });
68191
+ return Object.keys(obj).length > 0 ? JSON.stringify(obj) : "";
68192
+ };
68193
+ use_input_default((_, key) => {
68194
+ if (isFocused && key.return && !showDialog) {
68195
+ setShowDialog(true);
68196
+ }
68197
+ }, { isActive: isFocused && !showDialog });
68198
+ const handleDialogClose = () => {
68199
+ setShowDialog(false);
68200
+ };
68201
+ const handleDialogSave = (pairs2) => {
68202
+ onChange(pairsToJson(pairs2));
68203
+ };
68204
+ const pairs = parseJsonToPairs(value);
68205
+ const displayValue = pairs.length > 0 ? pairs.map((p) => `${p.key}: ${p.value}`).join(", ") : "";
68206
+ if (showDialog) {
68207
+ return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(KeyValueDialog, {
68208
+ label,
68209
+ pairs,
68210
+ onSave: handleDialogSave,
68211
+ onClose: handleDialogClose,
68212
+ theme
68213
+ }, undefined, false, undefined, this);
68214
+ }
68215
+ return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
68216
+ flexDirection: "column",
68217
+ children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
68218
+ children: [
68219
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
68220
+ width: 8,
68221
+ children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
68222
+ color: isFocused ? theme.accent : theme.muted,
68223
+ children: [
68224
+ label,
68225
+ ":"
68226
+ ]
68227
+ }, undefined, true, undefined, this)
68228
+ }, undefined, false, undefined, this),
68229
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
68230
+ borderStyle: "round",
68231
+ borderColor: isFocused ? theme.primary : theme.muted,
68232
+ paddingX: 1,
68233
+ flexGrow: 1,
68234
+ children: [
68235
+ displayValue ? /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
68236
+ color: isFocused ? theme.white : theme.primary,
68237
+ children: displayValue
68238
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
68239
+ color: theme.muted,
68240
+ children: placeholder
68241
+ }, undefined, false, undefined, this),
68242
+ isFocused && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
68243
+ color: theme.muted,
68244
+ children: " (Press Enter to edit)"
68245
+ }, undefined, false, undefined, this)
68246
+ ]
68247
+ }, undefined, true, undefined, this)
68248
+ ]
68249
+ }, undefined, true, undefined, this)
68250
+ }, undefined, false, undefined, this);
68251
+ };
68252
+
68253
+ // src/ui/app/components/tabcomps.tsx
68254
+ var jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1);
67928
68255
  var TabItem = ({ name, label, isActive, onChange, theme }) => {
67929
68256
  const { isFocused } = use_focus_default();
67930
68257
  use_input_default((_, key) => {
67931
68258
  if (isFocused && key.return)
67932
68259
  onChange(name);
67933
68260
  });
67934
- return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
68261
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
67935
68262
  borderStyle: "round",
67936
68263
  borderTopColor: "grey",
67937
68264
  borderColor: isActive ? theme.colors.accent : isFocused ? theme.colors.primary : "transparent",
67938
68265
  paddingX: 1,
67939
68266
  marginRight: 1,
67940
- children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
68267
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
67941
68268
  color: isActive ? theme.colors.accent : isFocused ? theme.colors.primary : theme.colors.white,
67942
68269
  bold: isActive || isFocused,
67943
68270
  children: label
67944
68271
  }, undefined, false, undefined, this)
67945
68272
  }, undefined, false, undefined, this);
67946
68273
  };
67947
- var Tabs = ({ tabs, activeTab, onChange, theme }) => /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
67948
- children: tabs.map((tab2) => /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(TabItem, {
68274
+ var Tabs = ({ tabs, activeTab, onChange, theme }) => /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
68275
+ children: tabs.map((tab2) => /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(TabItem, {
67949
68276
  ...tab2,
67950
68277
  isActive: activeTab === tab2.name,
67951
68278
  onChange,
@@ -67954,7 +68281,7 @@ var Tabs = ({ tabs, activeTab, onChange, theme }) => /* @__PURE__ */ jsx_dev_run
67954
68281
  }, undefined, false, undefined, this);
67955
68282
 
67956
68283
  // src/ui/app/components/historylist.tsx
67957
- var import_react25 = __toESM(require_react(), 1);
68284
+ var import_react26 = __toESM(require_react(), 1);
67958
68285
 
67959
68286
  // src/utils/colors.ts
67960
68287
  var getStatusColor = (status, theme) => {
@@ -67968,7 +68295,7 @@ var getStatusColor = (status, theme) => {
67968
68295
  };
67969
68296
 
67970
68297
  // src/ui/app/components/historylist.tsx
67971
- var jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1);
68298
+ var jsx_dev_runtime5 = __toESM(require_jsx_dev_runtime(), 1);
67972
68299
  var HistoryListItem = ({ item, isSelected, theme }) => {
67973
68300
  const shortenUrl = (url) => {
67974
68301
  try {
@@ -67980,43 +68307,43 @@ var HistoryListItem = ({ item, isSelected, theme }) => {
67980
68307
  }
67981
68308
  };
67982
68309
  const statusColor = item.responseStatus ? getStatusColor(item.responseStatus.toString(), theme) : theme.colors.muted;
67983
- return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
68310
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
67984
68311
  paddingX: 1,
67985
68312
  borderColor: isSelected ? theme.colors.accent : "transparent",
67986
- children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
68313
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
67987
68314
  flexDirection: "column",
67988
68315
  children: [
67989
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
68316
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
67990
68317
  children: [
67991
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
68318
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
67992
68319
  marginRight: 1,
67993
68320
  width: 5,
67994
- children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
68321
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
67995
68322
  color: statusColor,
67996
68323
  bold: isSelected,
67997
68324
  children: String(item.responseStatus || "---").padStart(3, " ")
67998
68325
  }, undefined, false, undefined, this)
67999
68326
  }, undefined, false, undefined, this),
68000
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
68327
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
68001
68328
  width: 7,
68002
- children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
68329
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
68003
68330
  color: isSelected ? theme.colors.accent : theme.colors.primary,
68004
68331
  bold: isSelected,
68005
68332
  children: item.method.padEnd(7)
68006
68333
  }, undefined, false, undefined, this)
68007
68334
  }, undefined, false, undefined, this),
68008
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
68335
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
68009
68336
  flexGrow: 1,
68010
- children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
68337
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
68011
68338
  color: isSelected ? theme.colors.white : theme.colors.muted,
68012
68339
  children: shortenUrl(item.url)
68013
68340
  }, undefined, false, undefined, this)
68014
68341
  }, undefined, false, undefined, this)
68015
68342
  ]
68016
68343
  }, undefined, true, undefined, this),
68017
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
68344
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
68018
68345
  paddingLeft: 13,
68019
- children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
68346
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
68020
68347
  color: theme.colors.muted,
68021
68348
  dimColor: !isSelected,
68022
68349
  children: [
@@ -68033,9 +68360,9 @@ var HistoryList = ({ history, onItemClick, theme }) => {
68033
68360
  const { stdout } = use_stdout_default();
68034
68361
  const { isFocused } = use_focus_default();
68035
68362
  const { focusNext } = use_focus_manager_default();
68036
- const [selectedIndex, setSelectedIndex] = import_react25.useState(0);
68037
- const [scrollPosition, setScrollPosition] = import_react25.useState(0);
68038
- const listRef = import_react25.useRef(null);
68363
+ const [selectedIndex, setSelectedIndex] = import_react26.useState(0);
68364
+ const [scrollPosition, setScrollPosition] = import_react26.useState(0);
68365
+ const listRef = import_react26.useRef(null);
68039
68366
  const maxHeight = stdout.rows - 8;
68040
68367
  use_input_default((_, key) => {
68041
68368
  if (key.upArrow) {
@@ -68057,20 +68384,20 @@ var HistoryList = ({ history, onItemClick, theme }) => {
68057
68384
  setScrollPosition((prev) => Math.min(history.length - maxHeight, prev + maxHeight));
68058
68385
  }
68059
68386
  }, { isActive: isFocused });
68060
- import_react25.useEffect(() => {
68387
+ import_react26.useEffect(() => {
68061
68388
  if (selectedIndex < scrollPosition) {
68062
68389
  setScrollPosition(selectedIndex);
68063
68390
  } else if (selectedIndex >= scrollPosition + maxHeight) {
68064
68391
  setScrollPosition(selectedIndex - maxHeight + 1);
68065
68392
  }
68066
68393
  }, [selectedIndex, maxHeight, scrollPosition]);
68067
- return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
68394
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
68068
68395
  flexDirection: "column",
68069
68396
  flexGrow: 1,
68070
- children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
68397
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
68071
68398
  flexDirection: "column",
68072
68399
  ref: listRef,
68073
- children: history.slice(scrollPosition, scrollPosition + maxHeight).map((item, index) => /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(HistoryListItem, {
68400
+ children: history.slice(scrollPosition, scrollPosition + maxHeight).map((item, index) => /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(HistoryListItem, {
68074
68401
  item,
68075
68402
  isSelected: isFocused && selectedIndex === scrollPosition + index,
68076
68403
  theme
@@ -68080,31 +68407,31 @@ var HistoryList = ({ history, onItemClick, theme }) => {
68080
68407
  };
68081
68408
 
68082
68409
  // src/ui/app/components/footer.tsx
68083
- var import_react26 = __toESM(require_react(), 1);
68084
- var jsx_dev_runtime5 = __toESM(require_jsx_dev_runtime(), 1);
68085
- var Footer = import_react26.default.memo(({ theme }) => {
68086
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
68410
+ var import_react27 = __toESM(require_react(), 1);
68411
+ var jsx_dev_runtime6 = __toESM(require_jsx_dev_runtime(), 1);
68412
+ var Footer = import_react27.default.memo(({ theme }) => {
68413
+ return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Box_default, {
68087
68414
  borderStyle: "round",
68088
68415
  borderTopColor: theme.muted,
68089
68416
  marginTop: 1,
68090
68417
  paddingX: 1,
68091
- children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
68418
+ children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
68092
68419
  color: theme.cool,
68093
68420
  children: [
68094
68421
  "╰─ \uD83D\uDE80 ",
68095
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
68422
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
68096
68423
  color: theme.primary,
68097
68424
  children: "PostBoy"
68098
68425
  }, undefined, false, undefined, this),
68099
- " — [Q] Quit | [Ctrl+Enter] Send | [Ctrl+L/H] Switch Tabs | [T] Theme Menu | [Tab] Navigate"
68426
+ " — [Q] Quit | [Ctrl+Enter] Send | [Ctrl+L/H] Switch Tabs | [T] Theme | [E] Export | [Tab] Navigate"
68100
68427
  ]
68101
68428
  }, undefined, true, undefined, this)
68102
68429
  }, undefined, false, undefined, this);
68103
68430
  });
68104
68431
 
68105
68432
  // src/ui/app/components/themeselector.tsx
68106
- var import_react27 = __toESM(require_react(), 1);
68107
- var jsx_dev_runtime6 = __toESM(require_jsx_dev_runtime(), 1);
68433
+ var import_react28 = __toESM(require_react(), 1);
68434
+ var jsx_dev_runtime7 = __toESM(require_jsx_dev_runtime(), 1);
68108
68435
  var getIndex = (theme) => {
68109
68436
  let index = 0;
68110
68437
  switch (theme) {
@@ -68144,9 +68471,9 @@ var getIndex = (theme) => {
68144
68471
  return index;
68145
68472
  };
68146
68473
  var ThemeSelector = ({ onThemeChange, theme }) => {
68147
- const [selectedIndex, setSelectedIndex] = import_react27.useState(getIndex(theme.name));
68474
+ const [selectedIndex, setSelectedIndex] = import_react28.useState(getIndex(theme.name));
68148
68475
  const themeNames = Object.keys(themes);
68149
- import_react27.useEffect(() => {
68476
+ import_react28.useEffect(() => {
68150
68477
  const currentThemeIndex = themeNames.findIndex((name) => {
68151
68478
  const themeColors = themes[name].colors;
68152
68479
  return Object.entries(themeColors).every(([key, value]) => theme[key] === value);
@@ -68171,7 +68498,7 @@ var ThemeSelector = ({ onThemeChange, theme }) => {
68171
68498
  }
68172
68499
  }
68173
68500
  }, { isActive: true });
68174
- return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Box_default, {
68501
+ return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Box_default, {
68175
68502
  flexDirection: "column",
68176
68503
  padding: 1,
68177
68504
  borderStyle: "round",
@@ -68179,17 +68506,17 @@ var ThemeSelector = ({ onThemeChange, theme }) => {
68179
68506
  width: "50%",
68180
68507
  alignSelf: "center",
68181
68508
  children: [
68182
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Box_default, {
68509
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Box_default, {
68183
68510
  marginBottom: 1,
68184
- children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
68511
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
68185
68512
  color: theme.colors.primary,
68186
68513
  bold: true,
68187
68514
  children: "Theme Menu (↑/↓ to change, Esc to close)"
68188
68515
  }, undefined, false, undefined, this)
68189
68516
  }, undefined, false, undefined, this),
68190
- themeNames.map((name, idx) => /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Box_default, {
68517
+ themeNames.map((name, idx) => /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Box_default, {
68191
68518
  paddingX: 1,
68192
- children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
68519
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
68193
68520
  color: idx === selectedIndex ? theme.colors.accent : theme.colors.muted,
68194
68521
  children: [
68195
68522
  idx === selectedIndex ? "▶ " : " ",
@@ -68202,20 +68529,20 @@ var ThemeSelector = ({ onThemeChange, theme }) => {
68202
68529
  };
68203
68530
 
68204
68531
  // src/ui/app/components/scrollablebox.tsx
68205
- var import_react28 = __toESM(require_react(), 1);
68206
- var jsx_dev_runtime7 = __toESM(require_jsx_dev_runtime(), 1);
68532
+ var import_react29 = __toESM(require_react(), 1);
68533
+ var jsx_dev_runtime8 = __toESM(require_jsx_dev_runtime(), 1);
68207
68534
  var ScrollableBox = ({ children }) => {
68208
68535
  const { stdout } = use_stdout_default();
68209
- const [scrollPosition, setScrollPosition] = import_react28.useState(0);
68536
+ const [scrollPosition, setScrollPosition] = import_react29.useState(0);
68210
68537
  const maxHeight = stdout.rows - 10;
68211
- const [contentHeight, setContentHeight] = import_react28.useState(0);
68538
+ const [contentHeight, setContentHeight] = import_react29.useState(0);
68212
68539
  use_input_default((_, key) => {
68213
68540
  if (key.pageUp)
68214
68541
  setScrollPosition((prev) => Math.max(0, prev - maxHeight));
68215
68542
  if (key.pageDown)
68216
68543
  setScrollPosition((prev) => Math.min(contentHeight - maxHeight, prev + maxHeight));
68217
68544
  });
68218
- import_react28.useEffect(() => {
68545
+ import_react29.useEffect(() => {
68219
68546
  const estimateHeight = (node) => {
68220
68547
  if (!node)
68221
68548
  return 0;
@@ -68224,29 +68551,29 @@ var ScrollableBox = ({ children }) => {
68224
68551
  `).length;
68225
68552
  if (Array.isArray(node))
68226
68553
  return node.reduce((acc, child) => acc + estimateHeight(child), 0);
68227
- if (import_react28.default.isValidElement(node))
68554
+ if (import_react29.default.isValidElement(node))
68228
68555
  return estimateHeight(node.props.children);
68229
68556
  return 1;
68230
68557
  };
68231
68558
  setContentHeight(estimateHeight(children));
68232
68559
  }, [children]);
68233
- return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Box_default, {
68560
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
68234
68561
  flexDirection: "column",
68235
68562
  overflow: "hidden",
68236
68563
  flexGrow: 1,
68237
68564
  children: [
68238
- /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Box_default, {
68565
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
68239
68566
  flexGrow: 1,
68240
68567
  flexDirection: "column",
68241
- children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Box_default, {
68568
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
68242
68569
  marginTop: -scrollPosition,
68243
68570
  flexDirection: "column",
68244
- children: import_react28.default.Children.map(children, (child) => import_react28.default.isValidElement(child) ? import_react28.default.cloneElement(child) : child)
68571
+ children: import_react29.default.Children.map(children, (child) => import_react29.default.isValidElement(child) ? import_react29.default.cloneElement(child) : child)
68245
68572
  }, undefined, false, undefined, this)
68246
68573
  }, undefined, false, undefined, this),
68247
- contentHeight > maxHeight && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Box_default, {
68574
+ contentHeight > maxHeight && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
68248
68575
  justifyContent: "center",
68249
- children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
68576
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
68250
68577
  color: "gray",
68251
68578
  children: `Scroll (PgUp/PgDn) ${scrollPosition + 1}-${Math.min(scrollPosition + maxHeight, contentHeight)}/${contentHeight}`
68252
68579
  }, undefined, false, undefined, this)
@@ -68256,13 +68583,13 @@ var ScrollableBox = ({ children }) => {
68256
68583
  };
68257
68584
 
68258
68585
  // src/ui/app/components/syntaxhighlighter.tsx
68259
- var import_react29 = __toESM(require_react(), 1);
68260
- var jsx_dev_runtime8 = __toESM(require_jsx_dev_runtime(), 1);
68261
- var JsonSyntaxHighlight = import_react29.default.memo(({ jsonString, theme }) => {
68586
+ var import_react30 = __toESM(require_react(), 1);
68587
+ var jsx_dev_runtime9 = __toESM(require_jsx_dev_runtime(), 1);
68588
+ var JsonSyntaxHighlight = import_react30.default.memo(({ jsonString, theme }) => {
68262
68589
  try {
68263
68590
  const json = JSON.parse(jsonString);
68264
68591
  const prettyJson = JSON.stringify(json, null, 2);
68265
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
68592
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
68266
68593
  flexDirection: "column",
68267
68594
  children: prettyJson.split(`
68268
68595
  `).map((line, i) => {
@@ -68275,37 +68602,37 @@ var JsonSyntaxHighlight = import_react29.default.memo(({ jsonString, theme }) =>
68275
68602
  const hasComma2 = (keyMatch[2] || "").endsWith(",");
68276
68603
  let valueNode;
68277
68604
  if (valueString.startsWith('"')) {
68278
- valueNode = /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
68605
+ valueNode = /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
68279
68606
  color: theme.colors.success,
68280
68607
  children: valueString
68281
68608
  }, undefined, false, undefined, this);
68282
68609
  } else if (valueString === "true" || valueString === "false") {
68283
- valueNode = /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
68610
+ valueNode = /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
68284
68611
  color: theme.colors.accent,
68285
68612
  children: valueString
68286
68613
  }, undefined, false, undefined, this);
68287
68614
  } else if (valueString === "null") {
68288
- valueNode = /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
68615
+ valueNode = /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
68289
68616
  color: theme.colors.muted,
68290
68617
  children: valueString
68291
68618
  }, undefined, false, undefined, this);
68292
68619
  } else if (["{", "["].includes(valueString)) {
68293
- valueNode = /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
68620
+ valueNode = /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
68294
68621
  color: theme.colors.muted,
68295
68622
  children: valueString
68296
68623
  }, undefined, false, undefined, this);
68297
68624
  } else {
68298
- valueNode = /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
68625
+ valueNode = /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
68299
68626
  color: theme.colors.secondary,
68300
68627
  children: valueString
68301
68628
  }, undefined, false, undefined, this);
68302
68629
  }
68303
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
68630
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
68304
68631
  children: [
68305
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
68632
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
68306
68633
  children: indent
68307
68634
  }, undefined, false, undefined, this),
68308
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
68635
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
68309
68636
  color: theme.colors.primary,
68310
68637
  children: [
68311
68638
  '"',
@@ -68313,11 +68640,11 @@ var JsonSyntaxHighlight = import_react29.default.memo(({ jsonString, theme }) =>
68313
68640
  '"'
68314
68641
  ]
68315
68642
  }, undefined, true, undefined, this),
68316
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
68643
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
68317
68644
  children: ": "
68318
68645
  }, undefined, false, undefined, this),
68319
68646
  valueNode,
68320
- hasComma2 && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
68647
+ hasComma2 && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
68321
68648
  children: ","
68322
68649
  }, undefined, false, undefined, this)
68323
68650
  ]
@@ -68336,16 +68663,16 @@ var JsonSyntaxHighlight = import_react29.default.memo(({ jsonString, theme }) =>
68336
68663
  color = "muted";
68337
68664
  else if (!isNaN(Number(value)))
68338
68665
  color = "secondary";
68339
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
68666
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
68340
68667
  children: [
68341
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
68668
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
68342
68669
  children: indent
68343
68670
  }, undefined, false, undefined, this),
68344
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
68671
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
68345
68672
  color: theme.colors[color],
68346
68673
  children: value
68347
68674
  }, undefined, false, undefined, this),
68348
- hasComma && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
68675
+ hasComma && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
68349
68676
  children: ","
68350
68677
  }, undefined, false, undefined, this)
68351
68678
  ]
@@ -68353,7 +68680,7 @@ var JsonSyntaxHighlight = import_react29.default.memo(({ jsonString, theme }) =>
68353
68680
  })
68354
68681
  }, undefined, false, undefined, this);
68355
68682
  } catch (e) {
68356
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
68683
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
68357
68684
  color: theme.colors.error,
68358
68685
  children: jsonString
68359
68686
  }, undefined, false, undefined, this);
@@ -68361,26 +68688,26 @@ var JsonSyntaxHighlight = import_react29.default.memo(({ jsonString, theme }) =>
68361
68688
  });
68362
68689
 
68363
68690
  // src/ui/app/components/responsepanel.tsx
68364
- var import_react30 = __toESM(require_react(), 1);
68365
- var jsx_dev_runtime9 = __toESM(require_jsx_dev_runtime(), 1);
68366
- var ResponsePanel = import_react30.default.memo(({ response, theme }) => {
68367
- const [activeTab, setActiveTab] = import_react30.useState("body");
68691
+ var import_react31 = __toESM(require_react(), 1);
68692
+ var jsx_dev_runtime10 = __toESM(require_jsx_dev_runtime(), 1);
68693
+ var ResponsePanel = import_react31.default.memo(({ response, theme }) => {
68694
+ const [activeTab, setActiveTab] = import_react31.useState("body");
68368
68695
  const tabs = [{ name: "headers", label: "Headers" }, { name: "body", label: "Body" }];
68369
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
68696
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
68370
68697
  flexDirection: "column",
68371
68698
  flexGrow: 1,
68372
68699
  children: [
68373
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
68700
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
68374
68701
  marginBottom: 1,
68375
68702
  children: [
68376
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
68703
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
68377
68704
  width: 8,
68378
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
68705
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
68379
68706
  color: theme.colors.primary,
68380
68707
  children: "STATUS:"
68381
68708
  }, undefined, false, undefined, this)
68382
68709
  }, undefined, false, undefined, this),
68383
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
68710
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
68384
68711
  color: getStatusColor(response.status, theme),
68385
68712
  bold: true,
68386
68713
  children: [
@@ -68391,30 +68718,30 @@ var ResponsePanel = import_react30.default.memo(({ response, theme }) => {
68391
68718
  }, undefined, true, undefined, this)
68392
68719
  ]
68393
68720
  }, undefined, true, undefined, this),
68394
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Tabs, {
68721
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Tabs, {
68395
68722
  tabs,
68396
68723
  activeTab,
68397
68724
  onChange: setActiveTab,
68398
68725
  theme
68399
68726
  }, undefined, false, undefined, this),
68400
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
68727
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
68401
68728
  marginTop: 1,
68402
68729
  flexGrow: 1,
68403
68730
  children: [
68404
- activeTab === "headers" && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ScrollableBox, {
68405
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
68731
+ activeTab === "headers" && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ScrollableBox, {
68732
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
68406
68733
  flexDirection: "column",
68407
- children: Object.entries(JSON.parse(response.headers || "{}")).map(([key, value]) => /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
68734
+ children: Object.entries(JSON.parse(response.headers || "{}")).map(([key, value]) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
68408
68735
  children: [
68409
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
68736
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
68410
68737
  color: theme.colors.accent,
68411
68738
  children: key
68412
68739
  }, undefined, false, undefined, this),
68413
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
68740
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
68414
68741
  color: theme.colors.muted,
68415
68742
  children: ": "
68416
68743
  }, undefined, false, undefined, this),
68417
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
68744
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
68418
68745
  color: theme.colors.success,
68419
68746
  children: String(value)
68420
68747
  }, undefined, false, undefined, this)
@@ -68422,11 +68749,11 @@ var ResponsePanel = import_react30.default.memo(({ response, theme }) => {
68422
68749
  }, key, true, undefined, this))
68423
68750
  }, undefined, false, undefined, this)
68424
68751
  }, undefined, false, undefined, this),
68425
- activeTab === "body" && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ScrollableBox, {
68426
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
68752
+ activeTab === "body" && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ScrollableBox, {
68753
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
68427
68754
  flexDirection: "column",
68428
68755
  flexGrow: 1,
68429
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(JsonSyntaxHighlight, {
68756
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(JsonSyntaxHighlight, {
68430
68757
  jsonString: response.body,
68431
68758
  theme
68432
68759
  }, undefined, false, undefined, this)
@@ -68438,6 +68765,332 @@ var ResponsePanel = import_react30.default.memo(({ response, theme }) => {
68438
68765
  }, undefined, true, undefined, this);
68439
68766
  });
68440
68767
 
68768
+ // src/ui/app/components/exportdialog.tsx
68769
+ var import_react32 = __toESM(require_react(), 1);
68770
+
68771
+ // src/utils/export.ts
68772
+ import { writeFile, mkdir } from "fs";
68773
+ import { spawn } from "child_process";
68774
+ import { promisify } from "util";
68775
+ import { dirname } from "path";
68776
+ var writeFileAsync = promisify(writeFile);
68777
+ var mkdirAsync = promisify(mkdir);
68778
+ var toCurl = (request) => {
68779
+ const parts = ["curl"];
68780
+ parts.push(`-X ${request.method}`);
68781
+ parts.push(`'${request.url}'`);
68782
+ try {
68783
+ const headers = JSON.parse(request.headers || "{}");
68784
+ Object.entries(headers).forEach(([key, value]) => {
68785
+ parts.push(`-H '${key}: ${value}'`);
68786
+ });
68787
+ } catch {}
68788
+ if (request.body && request.method !== "GET") {
68789
+ parts.push(`-d '${request.body}'`);
68790
+ }
68791
+ return parts.join(" \\\n ");
68792
+ };
68793
+ var toFetch = (request) => {
68794
+ const options = {
68795
+ method: request.method
68796
+ };
68797
+ try {
68798
+ const headers = JSON.parse(request.headers || "{}");
68799
+ if (Object.keys(headers).length > 0) {
68800
+ options.headers = headers;
68801
+ }
68802
+ } catch {}
68803
+ if (request.body && request.method !== "GET") {
68804
+ options.body = request.body;
68805
+ }
68806
+ const optionsStr = JSON.stringify(options, null, 2);
68807
+ return `fetch('${request.url}', ${optionsStr})
68808
+ .then(response => response.json())
68809
+ .then(data => console.log(data))
68810
+ .catch(error => console.error('Error:', error));`;
68811
+ };
68812
+ var copyToClipboard = async (text) => {
68813
+ return new Promise((resolve) => {
68814
+ const platform2 = process.platform;
68815
+ const clipboardCmds = platform2 === "darwin" ? [{ cmd: "pbcopy", args: [] }] : platform2 === "win32" ? [{ cmd: "clip", args: [] }] : [
68816
+ { cmd: "wl-copy", args: [] },
68817
+ { cmd: "xclip", args: ["-selection", "clipboard"] },
68818
+ { cmd: "xsel", args: ["--clipboard", "--input"] }
68819
+ ];
68820
+ const tryClipboard = (index) => {
68821
+ if (index >= clipboardCmds.length) {
68822
+ resolve(false);
68823
+ return;
68824
+ }
68825
+ const item = clipboardCmds[index];
68826
+ try {
68827
+ const proc = spawn(item.cmd, item.args, { stdio: ["pipe", "ignore", "ignore"] });
68828
+ proc.stdin.write(text);
68829
+ proc.stdin.end();
68830
+ proc.on("close", (code) => {
68831
+ if (code === 0) {
68832
+ resolve(true);
68833
+ } else {
68834
+ tryClipboard(index + 1);
68835
+ }
68836
+ });
68837
+ proc.on("error", () => tryClipboard(index + 1));
68838
+ } catch {
68839
+ tryClipboard(index + 1);
68840
+ }
68841
+ };
68842
+ tryClipboard(0);
68843
+ });
68844
+ };
68845
+ var saveToFile = async (content, filePath) => {
68846
+ try {
68847
+ const dir = dirname(filePath);
68848
+ await mkdirAsync(dir, { recursive: true });
68849
+ await writeFileAsync(filePath, content, "utf-8");
68850
+ return true;
68851
+ } catch {
68852
+ return false;
68853
+ }
68854
+ };
68855
+
68856
+ // src/ui/app/components/exportdialog.tsx
68857
+ var jsx_dev_runtime11 = __toESM(require_jsx_dev_runtime(), 1);
68858
+ var EXPORT_DIR = `${process.env.HOME}/.postboy/exports`;
68859
+ var ExportDialog = ({ request, onClose, theme }) => {
68860
+ const [format, setFormat] = import_react32.useState("curl");
68861
+ const [action, setAction] = import_react32.useState("copy");
68862
+ const [showSavePrompt, setShowSavePrompt] = import_react32.useState(false);
68863
+ const [filePath, setFilePath] = import_react32.useState("");
68864
+ const [message, setMessage] = import_react32.useState("");
68865
+ const [activeField, setActiveField] = import_react32.useState("format");
68866
+ const getExportContent = () => {
68867
+ return format === "curl" ? toCurl(request) : toFetch(request);
68868
+ };
68869
+ const handleExport = async () => {
68870
+ const content = getExportContent();
68871
+ if (action === "copy") {
68872
+ const success = await copyToClipboard(content);
68873
+ setMessage(success ? "Copied to clipboard!" : "Failed to copy. Try saving to file.");
68874
+ setTimeout(onClose, 1500);
68875
+ } else {
68876
+ setShowSavePrompt(true);
68877
+ setActiveField("path");
68878
+ }
68879
+ };
68880
+ const handleSave = async () => {
68881
+ if (!filePath.trim()) {
68882
+ setMessage("Please enter a file path");
68883
+ return;
68884
+ }
68885
+ const content = getExportContent();
68886
+ const ext = format === "curl" ? ".sh" : ".js";
68887
+ const fileName = filePath.endsWith(ext) ? filePath : filePath + ext;
68888
+ const finalPath = `${EXPORT_DIR}/${fileName}`;
68889
+ const success = await saveToFile(content, finalPath);
68890
+ setMessage(success ? `✓ File saved to:
68891
+ ${finalPath}` : "Failed to save file");
68892
+ setTimeout(onClose, 3000);
68893
+ };
68894
+ use_input_default((input, key) => {
68895
+ if (key.escape) {
68896
+ if (showSavePrompt) {
68897
+ setShowSavePrompt(false);
68898
+ setActiveField("action");
68899
+ } else {
68900
+ onClose();
68901
+ }
68902
+ return;
68903
+ }
68904
+ if (showSavePrompt) {
68905
+ if (key.return) {
68906
+ handleSave();
68907
+ return;
68908
+ }
68909
+ if (key.backspace || key.delete) {
68910
+ setFilePath((p) => p.slice(0, -1));
68911
+ return;
68912
+ }
68913
+ if (!key.upArrow && !key.downArrow && !key.leftArrow && !key.rightArrow && !key.tab) {
68914
+ setFilePath((p) => p + input);
68915
+ }
68916
+ return;
68917
+ }
68918
+ if (key.tab) {
68919
+ setActiveField((f) => f === "format" ? "action" : "format");
68920
+ return;
68921
+ }
68922
+ if (key.return) {
68923
+ handleExport();
68924
+ return;
68925
+ }
68926
+ if (activeField === "format") {
68927
+ if (key.leftArrow || key.rightArrow || input === "h" || input === "l") {
68928
+ setFormat((f) => f === "curl" ? "fetch" : "curl");
68929
+ }
68930
+ } else if (activeField === "action") {
68931
+ if (key.leftArrow || key.rightArrow || input === "h" || input === "l") {
68932
+ setAction((a) => a === "copy" ? "save" : "copy");
68933
+ }
68934
+ }
68935
+ });
68936
+ const preview = getExportContent();
68937
+ return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
68938
+ flexDirection: "column",
68939
+ borderStyle: "double",
68940
+ borderColor: theme.accent,
68941
+ padding: 1,
68942
+ children: [
68943
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
68944
+ marginBottom: 1,
68945
+ children: [
68946
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
68947
+ color: theme.accent,
68948
+ bold: true,
68949
+ children: "Export Request"
68950
+ }, undefined, false, undefined, this),
68951
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
68952
+ color: theme.muted,
68953
+ children: " (Tab: switch, ←→: select, Enter: confirm, Esc: cancel)"
68954
+ }, undefined, false, undefined, this)
68955
+ ]
68956
+ }, undefined, true, undefined, this),
68957
+ message ? /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
68958
+ padding: 1,
68959
+ flexDirection: "column",
68960
+ borderStyle: "round",
68961
+ borderColor: theme.success,
68962
+ children: message.split(`
68963
+ `).map((line, i) => /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
68964
+ color: theme.success,
68965
+ bold: true,
68966
+ children: line
68967
+ }, i, false, undefined, this))
68968
+ }, undefined, false, undefined, this) : showSavePrompt ? /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
68969
+ flexDirection: "column",
68970
+ gap: 1,
68971
+ children: [
68972
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
68973
+ children: [
68974
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
68975
+ color: theme.primary,
68976
+ children: "File path: "
68977
+ }, undefined, false, undefined, this),
68978
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
68979
+ borderStyle: "round",
68980
+ borderColor: theme.accent,
68981
+ paddingX: 1,
68982
+ flexGrow: 1,
68983
+ children: [
68984
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
68985
+ color: theme.white,
68986
+ children: filePath
68987
+ }, undefined, false, undefined, this),
68988
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
68989
+ color: theme.accent,
68990
+ children: "▌"
68991
+ }, undefined, false, undefined, this)
68992
+ ]
68993
+ }, undefined, true, undefined, this)
68994
+ ]
68995
+ }, undefined, true, undefined, this),
68996
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
68997
+ color: theme.muted,
68998
+ children: [
68999
+ "Extension .",
69000
+ format === "curl" ? "sh" : "js",
69001
+ " will be added if not specified"
69002
+ ]
69003
+ }, undefined, true, undefined, this)
69004
+ ]
69005
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
69006
+ flexDirection: "column",
69007
+ gap: 1,
69008
+ children: [
69009
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
69010
+ gap: 2,
69011
+ children: [
69012
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
69013
+ color: theme.primary,
69014
+ children: "Format: "
69015
+ }, undefined, false, undefined, this),
69016
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
69017
+ borderStyle: "round",
69018
+ borderColor: activeField === "format" && format === "curl" ? theme.accent : theme.muted,
69019
+ paddingX: 1,
69020
+ children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
69021
+ color: format === "curl" ? theme.accent : theme.muted,
69022
+ bold: format === "curl",
69023
+ children: "cURL"
69024
+ }, undefined, false, undefined, this)
69025
+ }, undefined, false, undefined, this),
69026
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
69027
+ borderStyle: "round",
69028
+ borderColor: activeField === "format" && format === "fetch" ? theme.accent : theme.muted,
69029
+ paddingX: 1,
69030
+ children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
69031
+ color: format === "fetch" ? theme.accent : theme.muted,
69032
+ bold: format === "fetch",
69033
+ children: "Fetch"
69034
+ }, undefined, false, undefined, this)
69035
+ }, undefined, false, undefined, this)
69036
+ ]
69037
+ }, undefined, true, undefined, this),
69038
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
69039
+ gap: 2,
69040
+ children: [
69041
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
69042
+ color: theme.primary,
69043
+ children: "Action: "
69044
+ }, undefined, false, undefined, this),
69045
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
69046
+ borderStyle: "round",
69047
+ borderColor: activeField === "action" && action === "copy" ? theme.accent : theme.muted,
69048
+ paddingX: 1,
69049
+ children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
69050
+ color: action === "copy" ? theme.accent : theme.muted,
69051
+ bold: action === "copy",
69052
+ children: "Copy to Clipboard"
69053
+ }, undefined, false, undefined, this)
69054
+ }, undefined, false, undefined, this),
69055
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
69056
+ borderStyle: "round",
69057
+ borderColor: activeField === "action" && action === "save" ? theme.accent : theme.muted,
69058
+ paddingX: 1,
69059
+ children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
69060
+ color: action === "save" ? theme.accent : theme.muted,
69061
+ bold: action === "save",
69062
+ children: "Save to File"
69063
+ }, undefined, false, undefined, this)
69064
+ }, undefined, false, undefined, this)
69065
+ ]
69066
+ }, undefined, true, undefined, this),
69067
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
69068
+ flexDirection: "column",
69069
+ marginTop: 1,
69070
+ children: [
69071
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
69072
+ color: theme.primary,
69073
+ children: "Preview:"
69074
+ }, undefined, false, undefined, this),
69075
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
69076
+ borderStyle: "round",
69077
+ borderColor: theme.muted,
69078
+ padding: 1,
69079
+ flexDirection: "column",
69080
+ children: preview.split(`
69081
+ `).map((line, i) => /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
69082
+ color: theme.white,
69083
+ children: line
69084
+ }, i, false, undefined, this))
69085
+ }, undefined, false, undefined, this)
69086
+ ]
69087
+ }, undefined, true, undefined, this)
69088
+ ]
69089
+ }, undefined, true, undefined, this)
69090
+ ]
69091
+ }, undefined, true, undefined, this);
69092
+ };
69093
+
68441
69094
  // src/utils/themeManager.ts
68442
69095
  import { promises as fs3 } from "fs";
68443
69096
  import path2 from "path";
@@ -68541,21 +69194,21 @@ class ThemeManager {
68541
69194
  var themeManager = new ThemeManager;
68542
69195
 
68543
69196
  // src/ui/app/ui.tsx
68544
- var jsx_dev_runtime10 = __toESM(require_jsx_dev_runtime(), 1);
69197
+ var jsx_dev_runtime12 = __toESM(require_jsx_dev_runtime(), 1);
68545
69198
  var SendButton = ({ onPress, loading, theme }) => {
68546
69199
  const { isFocused } = use_focus_default();
68547
69200
  use_input_default((_, key) => {
68548
69201
  if (isFocused && key.return)
68549
69202
  onPress();
68550
69203
  });
68551
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
69204
+ return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68552
69205
  borderStyle: "round",
68553
69206
  paddingX: 2,
68554
69207
  borderTopDimColor: true,
68555
69208
  borderColor: isFocused ? theme.accent : theme.primary,
68556
- children: loading ? /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Spinner, {
69209
+ children: loading ? /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Spinner, {
68557
69210
  theme
68558
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
69211
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
68559
69212
  bold: true,
68560
69213
  color: isFocused ? theme.accent : theme.white,
68561
69214
  children: "\uD83D\uDE80 Send"
@@ -68563,12 +69216,12 @@ var SendButton = ({ onPress, loading, theme }) => {
68563
69216
  }, undefined, false, undefined, this);
68564
69217
  };
68565
69218
  var HTTP_METHODS = ["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS", "HEAD"];
68566
- var RequestPanel = import_react31.default.memo(({ request, onMethodChange, onUrlChange, onHeadersChange, onBodyChange, onSend, loading, theme, historyUrls = [], onInputFocus }) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
69219
+ var RequestPanel = import_react33.default.memo(({ request, onMethodChange, onUrlChange, onHeadersChange, onBodyChange, onSend, loading, theme, historyUrls = [], onInputFocus }) => /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68567
69220
  flexDirection: "column",
68568
69221
  gap: 1,
68569
69222
  flexGrow: 1,
68570
69223
  children: [
68571
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(FormField, {
69224
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(FormField, {
68572
69225
  label: "Method",
68573
69226
  value: request.method,
68574
69227
  onChange: onMethodChange,
@@ -68577,7 +69230,7 @@ var RequestPanel = import_react31.default.memo(({ request, onMethodChange, onUrl
68577
69230
  suggestions: HTTP_METHODS,
68578
69231
  onFocusChange: onInputFocus
68579
69232
  }, undefined, false, undefined, this),
68580
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(FormField, {
69233
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(FormField, {
68581
69234
  label: "URL",
68582
69235
  value: request.url,
68583
69236
  onChange: onUrlChange,
@@ -68586,26 +69239,26 @@ var RequestPanel = import_react31.default.memo(({ request, onMethodChange, onUrl
68586
69239
  suggestions: historyUrls,
68587
69240
  onFocusChange: onInputFocus
68588
69241
  }, undefined, false, undefined, this),
68589
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(FormField, {
69242
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(KeyValueField, {
68590
69243
  label: "Headers",
68591
69244
  value: request.headers,
68592
69245
  onChange: onHeadersChange,
68593
- placeholder: '{ "key": "value" }',
69246
+ placeholder: "Press Enter to add headers",
68594
69247
  theme,
68595
69248
  onFocusChange: onInputFocus
68596
69249
  }, undefined, false, undefined, this),
68597
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(FormField, {
69250
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(KeyValueField, {
68598
69251
  label: "Body",
68599
69252
  value: request.body,
68600
69253
  onChange: onBodyChange,
68601
- placeholder: '{ "key": "value" }',
69254
+ placeholder: "Press Enter to add body",
68602
69255
  theme,
68603
69256
  onFocusChange: onInputFocus
68604
69257
  }, undefined, false, undefined, this),
68605
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
69258
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68606
69259
  marginTop: 1,
68607
69260
  justifyContent: "center",
68608
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(SendButton, {
69261
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(SendButton, {
68609
69262
  onPress: onSend,
68610
69263
  loading,
68611
69264
  theme
@@ -68614,27 +69267,27 @@ var RequestPanel = import_react31.default.memo(({ request, onMethodChange, onUrl
68614
69267
  ]
68615
69268
  }, undefined, true, undefined, this));
68616
69269
  var UI = () => {
68617
- const [theme, setTheme] = import_react31.useState(themes.catppuccin);
69270
+ const [theme, setTheme] = import_react33.useState(themes.catppuccin);
68618
69271
  const { exit } = use_app_default();
68619
- const [activeTab, setActiveTab] = import_react31.useState("request");
68620
- const [request, setRequest] = import_react31.useState({ method: "GET", url: "", headers: "", body: "" });
68621
- const [response, setResponse] = import_react31.useState({ statustext: "", status: "", headers: "", body: "", error: "" });
68622
- const [history, setHistory] = import_react31.useState([]);
68623
- const [loading, setLoading] = import_react31.useState(false);
68624
- const requestRef = import_react31.useRef(request);
69272
+ const [activeTab, setActiveTab] = import_react33.useState("request");
69273
+ const [request, setRequest] = import_react33.useState({ method: "GET", url: "", headers: "", body: "" });
69274
+ const [response, setResponse] = import_react33.useState({ statustext: "", status: "", headers: "", body: "", error: "" });
69275
+ const [history, setHistory] = import_react33.useState([]);
69276
+ const [loading, setLoading] = import_react33.useState(false);
69277
+ const requestRef = import_react33.useRef(request);
68625
69278
  requestRef.current = request;
68626
- import_react31.useEffect(() => {
69279
+ import_react33.useEffect(() => {
68627
69280
  const loadHistory = async () => setHistory((await historyManager.loadHistory()).entries);
68628
69281
  loadHistory();
68629
69282
  }, []);
68630
- import_react31.useEffect(() => {
69283
+ import_react33.useEffect(() => {
68631
69284
  const loadTheme = async () => {
68632
69285
  const loadedTheme = await themeManager.loadCurrTheme();
68633
69286
  setTheme(loadedTheme);
68634
69287
  };
68635
69288
  loadTheme();
68636
69289
  }, []);
68637
- const handleSend = import_react31.useCallback(async () => {
69290
+ const handleSend = import_react33.useCallback(async () => {
68638
69291
  setLoading(true);
68639
69292
  const startTime = Date.now();
68640
69293
  const currentRequest = requestRef.current;
@@ -68675,7 +69328,7 @@ var UI = () => {
68675
69328
  themeManager.ChangeTheme(theme2);
68676
69329
  setTheme(theme2);
68677
69330
  };
68678
- const handleHistoryClick = import_react31.useCallback((item) => {
69331
+ const handleHistoryClick = import_react33.useCallback((item) => {
68679
69332
  setRequest({
68680
69333
  method: item.method,
68681
69334
  url: item.url,
@@ -68686,10 +69339,11 @@ var UI = () => {
68686
69339
  }, []);
68687
69340
  const tabs = [{ name: "request", label: "Request" }, { name: "response", label: "Response" }];
68688
69341
  const activeIndex = tabs.findIndex((t) => t.name === activeTab);
68689
- const [showThemeSelector, setShowThemeSelector] = import_react31.useState(false);
68690
- const [inputFocused, setInputFocused] = import_react31.useState(false);
69342
+ const [showThemeSelector, setShowThemeSelector] = import_react33.useState(false);
69343
+ const [showExportDialog, setShowExportDialog] = import_react33.useState(false);
69344
+ const [inputFocused, setInputFocused] = import_react33.useState(false);
68691
69345
  use_input_default((input, key) => {
68692
- if (input === "q")
69346
+ if (input === "q" && !showExportDialog)
68693
69347
  exit();
68694
69348
  if (key.ctrl && key.return)
68695
69349
  handleSend();
@@ -68699,87 +69353,101 @@ var UI = () => {
68699
69353
  setActiveTab(tabs[(activeIndex - 1 + tabs.length) % tabs.length]?.name ?? "request");
68700
69354
  if (key.escape && showThemeSelector)
68701
69355
  setShowThemeSelector(false);
68702
- if ((input === "t" || input === "T") && !key.ctrl && !key.meta && !inputFocused)
69356
+ if (key.escape && showExportDialog)
69357
+ setShowExportDialog(false);
69358
+ if ((input === "t" || input === "T") && !key.ctrl && !key.meta && !inputFocused && !showExportDialog)
68703
69359
  setShowThemeSelector((prev) => !prev);
68704
- }, { isActive: true });
68705
- const onMethodChange = import_react31.useCallback((method) => setRequest((r) => ({ ...r, method })), []);
68706
- const onUrlChange = import_react31.useCallback((url) => setRequest((r) => ({ ...r, url })), []);
68707
- const onHeadersChange = import_react31.useCallback((headers) => setRequest((r) => ({ ...r, headers })), []);
68708
- const onBodyChange = import_react31.useCallback((body) => setRequest((r) => ({ ...r, body })), []);
69360
+ if ((input === "e" || input === "E") && !key.ctrl && !key.meta && !inputFocused && !showThemeSelector)
69361
+ setShowExportDialog((prev) => !prev);
69362
+ }, { isActive: !showExportDialog });
69363
+ const onMethodChange = import_react33.useCallback((method) => setRequest((r) => ({ ...r, method })), []);
69364
+ const onUrlChange = import_react33.useCallback((url) => setRequest((r) => ({ ...r, url })), []);
69365
+ const onHeadersChange = import_react33.useCallback((headers) => setRequest((r) => ({ ...r, headers })), []);
69366
+ const onBodyChange = import_react33.useCallback((body) => setRequest((r) => ({ ...r, body })), []);
68709
69367
  const historyUrls = Array.from(new Set(history.map((h) => h.url))).filter(Boolean);
68710
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
69368
+ return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68711
69369
  padding: 1,
68712
69370
  flexDirection: "column",
68713
69371
  flexGrow: 1,
68714
69372
  children: [
68715
- showThemeSelector && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
69373
+ showThemeSelector && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68716
69374
  flexDirection: "row",
68717
69375
  justifyContent: "center",
68718
69376
  marginBottom: 1,
68719
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemeSelector, {
69377
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemeSelector, {
68720
69378
  theme,
68721
69379
  onThemeChange: (themeName) => {
68722
69380
  handleThemeChange(themes[themeName]);
68723
69381
  }
68724
69382
  }, undefined, false, undefined, this)
68725
69383
  }, undefined, false, undefined, this),
68726
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
69384
+ showExportDialog && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
69385
+ flexDirection: "row",
69386
+ justifyContent: "center",
69387
+ marginBottom: 1,
69388
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ExportDialog, {
69389
+ request,
69390
+ onClose: () => setShowExportDialog(false),
69391
+ theme: theme.colors
69392
+ }, undefined, false, undefined, this)
69393
+ }, undefined, false, undefined, this),
69394
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68727
69395
  alignSelf: "center",
68728
69396
  marginBottom: 1,
68729
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
69397
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
68730
69398
  color: theme.colors.accent,
68731
69399
  bold: true,
68732
69400
  children: `┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓`
68733
69401
  }, undefined, false, undefined, this)
68734
69402
  }, undefined, false, undefined, this),
68735
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
69403
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68736
69404
  alignSelf: "center",
68737
69405
  marginBottom: 1,
68738
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
69406
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
68739
69407
  color: theme.colors.primary,
68740
69408
  bold: true,
68741
69409
  children: `┃ \uD83D\uDEF0️ Welcome to PostBoy — The Modern Terminal API Client ┃`
68742
69410
  }, undefined, false, undefined, this)
68743
69411
  }, undefined, false, undefined, this),
68744
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
69412
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68745
69413
  alignSelf: "center",
68746
69414
  marginBottom: 1,
68747
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
69415
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
68748
69416
  color: theme.colors.accent,
68749
69417
  bold: true,
68750
69418
  children: `┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛`
68751
69419
  }, undefined, false, undefined, this)
68752
69420
  }, undefined, false, undefined, this),
68753
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
69421
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68754
69422
  flexGrow: 1,
68755
69423
  children: [
68756
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
69424
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68757
69425
  width: "40%",
68758
69426
  borderColor: theme.colors.muted,
68759
69427
  flexDirection: "column",
68760
69428
  marginRight: 1,
68761
69429
  children: [
68762
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
69430
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68763
69431
  alignSelf: "center",
68764
69432
  marginBottom: 1,
68765
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
69433
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
68766
69434
  color: theme.colors.accent,
68767
69435
  bold: true,
68768
69436
  children: `┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓`
68769
69437
  }, undefined, false, undefined, this)
68770
69438
  }, undefined, false, undefined, this),
68771
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
69439
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68772
69440
  borderTopColor: "grey",
68773
69441
  borderColor: theme.colors.secondary,
68774
69442
  paddingX: 1,
68775
69443
  alignSelf: "center",
68776
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
69444
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
68777
69445
  color: theme.colors.accent,
68778
69446
  bold: true,
68779
69447
  children: "\uD83D\uDCDC History"
68780
69448
  }, undefined, false, undefined, this)
68781
69449
  }, undefined, false, undefined, this),
68782
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
69450
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68783
69451
  flexDirection: "column",
68784
69452
  flexGrow: 1,
68785
69453
  borderRightColor: "grey",
@@ -68788,22 +69456,22 @@ var UI = () => {
68788
69456
  borderLeft: false,
68789
69457
  borderBottom: false,
68790
69458
  paddingY: 1,
68791
- children: history.length === 0 ? /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
69459
+ children: history.length === 0 ? /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68792
69460
  padding: 1,
68793
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
69461
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
68794
69462
  color: theme.colors.muted,
68795
69463
  children: "No requests yet..."
68796
69464
  }, undefined, false, undefined, this)
68797
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(HistoryList, {
69465
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(HistoryList, {
68798
69466
  history,
68799
69467
  onItemClick: handleHistoryClick,
68800
69468
  theme
68801
69469
  }, undefined, false, undefined, this)
68802
69470
  }, undefined, false, undefined, this),
68803
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
69471
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68804
69472
  alignSelf: "center",
68805
69473
  marginBottom: 1,
68806
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
69474
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
68807
69475
  color: theme.colors.accent,
68808
69476
  bold: true,
68809
69477
  children: `┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛`
@@ -68811,36 +69479,36 @@ var UI = () => {
68811
69479
  }, undefined, false, undefined, this)
68812
69480
  ]
68813
69481
  }, undefined, true, undefined, this),
68814
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
69482
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68815
69483
  width: "60%",
68816
69484
  borderColor: theme.colors.muted,
68817
69485
  padding: 1,
68818
69486
  flexDirection: "column",
68819
69487
  children: [
68820
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
69488
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68821
69489
  alignSelf: "center",
68822
69490
  marginBottom: 1,
68823
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
69491
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
68824
69492
  color: theme.colors.accent,
68825
69493
  bold: true,
68826
69494
  children: `┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓`
68827
69495
  }, undefined, false, undefined, this)
68828
69496
  }, undefined, false, undefined, this),
68829
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Tabs, {
69497
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Tabs, {
68830
69498
  tabs,
68831
69499
  activeTab,
68832
69500
  onChange: setActiveTab,
68833
69501
  theme
68834
69502
  }, undefined, false, undefined, this),
68835
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
69503
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68836
69504
  marginTop: 1,
68837
69505
  flexDirection: "column",
68838
69506
  flexGrow: 1,
68839
69507
  children: [
68840
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
69508
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68841
69509
  display: activeTab === "request" ? "flex" : "none",
68842
69510
  flexGrow: 1,
68843
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(RequestPanel, {
69511
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(RequestPanel, {
68844
69512
  request,
68845
69513
  onMethodChange,
68846
69514
  onUrlChange,
@@ -68853,20 +69521,20 @@ var UI = () => {
68853
69521
  onInputFocus: setInputFocused
68854
69522
  }, undefined, false, undefined, this)
68855
69523
  }, undefined, false, undefined, this),
68856
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
69524
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68857
69525
  display: activeTab === "response" ? "flex" : "none",
68858
69526
  flexGrow: 1,
68859
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ResponsePanel, {
69527
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ResponsePanel, {
68860
69528
  response,
68861
69529
  theme
68862
69530
  }, undefined, false, undefined, this)
68863
69531
  }, undefined, false, undefined, this)
68864
69532
  ]
68865
69533
  }, undefined, true, undefined, this),
68866
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
69534
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68867
69535
  alignSelf: "center",
68868
69536
  marginBottom: 1,
68869
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
69537
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
68870
69538
  color: theme.colors.accent,
68871
69539
  bold: true,
68872
69540
  children: `┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛`
@@ -68876,7 +69544,7 @@ var UI = () => {
68876
69544
  }, undefined, true, undefined, this)
68877
69545
  ]
68878
69546
  }, undefined, true, undefined, this),
68879
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Footer, {
69547
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Footer, {
68880
69548
  theme: theme.colors
68881
69549
  }, undefined, false, undefined, this)
68882
69550
  ]
@@ -68885,14 +69553,14 @@ var UI = () => {
68885
69553
  var ui_default = UI;
68886
69554
 
68887
69555
  // src/ui/app/app.tsx
68888
- var jsx_dev_runtime11 = __toESM(require_jsx_dev_runtime(), 1);
69556
+ var jsx_dev_runtime13 = __toESM(require_jsx_dev_runtime(), 1);
68889
69557
  function App2() {
68890
- return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ui_default, {}, undefined, false, undefined, this);
69558
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ui_default, {}, undefined, false, undefined, this);
68891
69559
  }
68892
69560
 
68893
69561
  // src/commands/ui.tsx
68894
69562
  var import_chalk5 = __toESM(require_source(), 1);
68895
- var jsx_dev_runtime12 = __toESM(require_jsx_dev_runtime(), 1);
69563
+ var jsx_dev_runtime14 = __toESM(require_jsx_dev_runtime(), 1);
68896
69564
  var UIWrapper = () => {
68897
69565
  const { exit } = use_app_default();
68898
69566
  use_input_default((input) => {
@@ -68900,18 +69568,18 @@ var UIWrapper = () => {
68900
69568
  exit();
68901
69569
  }
68902
69570
  });
68903
- return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
69571
+ return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
68904
69572
  flexDirection: "column",
68905
69573
  children: [
68906
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
69574
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
68907
69575
  children: import_chalk5.default.cyanBright(`PostBoy \uD83D\uDC8C`)
68908
69576
  }, undefined, false, undefined, this),
68909
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(App2, {}, undefined, false, undefined, this)
69577
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(App2, {}, undefined, false, undefined, this)
68910
69578
  ]
68911
69579
  }, undefined, true, undefined, this);
68912
69580
  };
68913
69581
  var uiCommand = () => {
68914
- render_default(/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(UIWrapper, {}, undefined, false, undefined, this));
69582
+ render_default(/* @__PURE__ */ jsx_dev_runtime14.jsxDEV(UIWrapper, {}, undefined, false, undefined, this));
68915
69583
  };
68916
69584
 
68917
69585
  // src/commands/test.ts
@@ -69080,7 +69748,7 @@ async function mockApis() {
69080
69748
 
69081
69749
  // src/index.ts
69082
69750
  var program2 = new Command;
69083
- program2.version("1.3.4").description(import_chalk8.default.yellow("PostBoy CLI - Test your APIs with ease"));
69751
+ program2.version("1.3.6").description(import_chalk8.default.yellow("PostBoy CLI - Test your APIs with ease"));
69084
69752
  program2.command("run").description("Run a test API request").action(testCommand);
69085
69753
  program2.command("mock-list").description("List the mock API servers").action(mockApis);
69086
69754
  program2.command("ui").description("UI for PostBoy").action(uiCommand);