@w6w/embed 0.2.21 → 0.2.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/forms.mjs CHANGED
@@ -1,58 +1,45 @@
1
1
  "use client";
2
- import { C as He, a as Ye } from "./CreateFunctionModal-DScxp_LN.js";
3
- import { jsxs as a, jsx as e, Fragment as ne } from "react/jsx-runtime";
2
+ import { C as Je, a as He } from "./CreateFunctionModal-DScxp_LN.js";
3
+ import { jsxs as a, jsx as t, Fragment as ne } from "react/jsx-runtime";
4
4
  import { ApiError as L } from "@w6w/sdk";
5
- import { EmptyState as U, DataTable as T, Copyable as se, EditButton as A, DeleteButton as O, useEnterSubmit as V, BudgetMeter as re } from "@w6w/ui";
5
+ import { EmptyState as P, DataTable as U, EditButton as T, DeleteButton as A, useEnterSubmit as V, BudgetMeter as se } from "@w6w/ui";
6
6
  import { useState as m } from "react";
7
- import { C as W, a as oe, M as R } from "./ConfirmModal-Pv2-A_3U.js";
7
+ import { C as O, a as re, M as R } from "./ConfirmModal-Pv2-A_3U.js";
8
8
  import { u as ae } from "./project-context-Tvp-La7A.js";
9
- import { i as de, d as ce, b as ue, h as me, f as he, c as ge, u as ve, g as be } from "./vault-BSEWhMYC.js";
10
- import { M as Ge } from "./ModelRoutesManager-1Ac5wcas.js";
11
- import { F as pe, D as fe, C as ye, I as Ne, E as Ce } from "./models-bAayQPJ_.js";
12
- const Se = ["string", "number", "boolean", "json"];
13
- function q(t) {
14
- if (t.type === "boolean" || t.type === "number" || t.type === "string") return String(t.value);
15
- const n = JSON.stringify(t.value);
9
+ import { i as oe, d as de, b as ce, h as ue, f as me, c as he, u as ge, g as ve } from "./vault-BSEWhMYC.js";
10
+ import { M as ze } from "./ModelRoutesManager-BUw_sm-M.js";
11
+ import { F as be, D as pe, C as fe, I as ye, E as Ne } from "./models-bAayQPJ_.js";
12
+ const Ce = ["string", "number", "boolean", "json"];
13
+ function Z(e) {
14
+ if (e.type === "boolean" || e.type === "number" || e.type === "string") return String(e.value);
15
+ const n = JSON.stringify(e.value);
16
16
  return n.length > 80 ? `${n.slice(0, 80)}…` : n;
17
17
  }
18
- function Fe(t) {
19
- var k;
20
- const n = t.slots, l = ae(t.project), [h, i] = m(null), [f, o] = m(null), g = de(l ?? void 0, l != null), b = ce(), y = l != null, p = () => {
18
+ function We(e) {
19
+ var w;
20
+ const n = e.slots, l = ae(e.project), [h, i] = m(null), [f, o] = m(null), g = oe(l ?? void 0, l != null), b = de(), y = l != null, p = () => {
21
21
  l != null && i({ mode: "create" });
22
22
  }, N = (n == null ? void 0 : n.header) === void 0 ? /* @__PURE__ */ a("div", { children: [
23
- /* @__PURE__ */ e("h3", { children: "Variables" }),
23
+ /* @__PURE__ */ t("h3", { children: "Variables" }),
24
24
  /* @__PURE__ */ a("p", { className: "muted small", children: [
25
25
  "User-defined typed values addressable by name. Plaintext — use ",
26
- /* @__PURE__ */ e("strong", { children: "Secrets" }),
26
+ /* @__PURE__ */ t("strong", { children: "Secrets" }),
27
27
  " ",
28
28
  "for sensitive values."
29
29
  ] })
30
- ] }) : n.header, C = n == null ? void 0 : n.actions, S = C === void 0 ? /* @__PURE__ */ e("button", { type: "button", className: "btn", disabled: !y, onClick: p, children: "+ Add variable" }) : typeof C == "function" ? C({ openCreate: p, canCreate: y }) : C, s = (n == null ? void 0 : n.empty) === void 0 ? /* @__PURE__ */ e(U, { testId: "vars-manager-empty", children: "No variables yet." }) : n.empty, u = [
30
+ ] }) : n.header, C = n == null ? void 0 : n.actions, S = C === void 0 ? /* @__PURE__ */ t("button", { type: "button", className: "btn", disabled: !y, onClick: p, children: "+ Add variable" }) : typeof C == "function" ? C({ openCreate: p, canCreate: y }) : C, s = (n == null ? void 0 : n.empty) === void 0 ? /* @__PURE__ */ t(P, { testId: "vars-manager-empty", children: "No variables yet." }) : n.empty, c = [
31
31
  {
32
32
  key: "name",
33
33
  header: "Variable",
34
- render: (c) => /* @__PURE__ */ a("div", { className: "list-main", style: { maxWidth: 0, minWidth: "100%" }, children: [
35
- /* @__PURE__ */ e("strong", { className: "list-name", title: c.name, children: c.name }),
34
+ render: (u) => /* @__PURE__ */ a("div", { className: "list-main", style: { maxWidth: 0, minWidth: "100%" }, children: [
35
+ /* @__PURE__ */ t("strong", { className: "list-name", title: u.name, children: u.name }),
36
36
  " ",
37
- /* @__PURE__ */ e("span", { className: "tag", children: c.type }),
38
- /* @__PURE__ */ a("div", { className: "muted small list-preview", title: q(c), children: [
39
- /* @__PURE__ */ e(se, { value: q(c), readOnly: !0, children: /* @__PURE__ */ e(
40
- "code",
41
- {
42
- style: {
43
- overflowWrap: "anywhere",
44
- display: "block",
45
- minWidth: 0,
46
- overflow: "hidden",
47
- textOverflow: "ellipsis",
48
- flex: 1
49
- },
50
- children: q(c)
51
- }
52
- ) }),
53
- c.description && /* @__PURE__ */ a(ne, { children: [
37
+ /* @__PURE__ */ t("span", { className: "tag", children: u.type }),
38
+ /* @__PURE__ */ a("div", { className: "muted small list-preview", title: Z(u), children: [
39
+ Z(u),
40
+ u.description && /* @__PURE__ */ a(ne, { children: [
54
41
  " · ",
55
- c.description
42
+ u.description
56
43
  ] })
57
44
  ] })
58
45
  ] })
@@ -61,41 +48,49 @@ function Fe(t) {
61
48
  key: "actions",
62
49
  header: "",
63
50
  align: "right",
51
+ // Shrink to the buttons: the name cell's `maxWidth: 0` would otherwise split the width evenly.
52
+ width: "1%",
64
53
  link: !1,
65
- render: (c) => /* @__PURE__ */ a("div", { style: { display: "flex", gap: "var(--w6w-sp-1-5)" }, children: [
66
- /* @__PURE__ */ e(oe, { resource: { kind: "var", name: c.name } }),
67
- /* @__PURE__ */ e(
68
- A,
54
+ render: (u) => /* @__PURE__ */ a("div", { style: { display: "flex", gap: "var(--w6w-sp-1-5)", whiteSpace: "nowrap" }, children: [
55
+ /* @__PURE__ */ t(re, { resource: { kind: "var", name: u.name } }),
56
+ /* @__PURE__ */ t(
57
+ T,
69
58
  {
70
59
  label: "Edit",
71
- onClick: () => i({ mode: "edit", v: c }),
72
- "data-testid": `var-edit-${c.id}`
60
+ onClick: () => i({ mode: "edit", v: u }),
61
+ "data-testid": `var-edit-${u.id}`
73
62
  }
74
63
  ),
75
- /* @__PURE__ */ e(
76
- O,
64
+ /* @__PURE__ */ t(
65
+ A,
77
66
  {
78
67
  label: "Delete",
79
- onClick: () => o(c),
68
+ onClick: () => o(u),
80
69
  disabled: b.isPending,
81
- "data-testid": `var-delete-${c.id}`
70
+ "data-testid": `var-delete-${u.id}`
82
71
  }
83
72
  )
84
73
  ] })
85
74
  }
86
75
  ];
87
- return /* @__PURE__ */ e("div", { className: "w6w-embed-root", children: /* @__PURE__ */ a("section", { className: "section", children: [
76
+ return /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */ a("section", { className: "section", children: [
88
77
  (N != null || S != null) && /* @__PURE__ */ a("div", { className: "section-head", children: [
89
78
  N,
90
79
  S
91
80
  ] }),
92
- /* @__PURE__ */ a("div", { className: "card", children: [
93
- g.isLoading && /* @__PURE__ */ e("p", { className: "muted", children: "Loading…" }),
94
- ((k = g.data) == null ? void 0 : k.length) === 0 && s,
95
- g.data != null && g.data.length > 0 && /* @__PURE__ */ e(T, { columns: u, rows: g.data, rowKey: (c) => c.id })
96
- ] }),
97
- h && l != null && /* @__PURE__ */ e(
98
- ke,
81
+ g.isLoading && /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }),
82
+ ((w = g.data) == null ? void 0 : w.length) === 0 && s,
83
+ g.data != null && g.data.length > 0 && /* @__PURE__ */ t(
84
+ U,
85
+ {
86
+ className: "w6w-data-table-rows",
87
+ columns: c,
88
+ rows: g.data,
89
+ rowKey: (u) => u.id
90
+ }
91
+ ),
92
+ h && l != null && /* @__PURE__ */ t(
93
+ Se,
99
94
  {
100
95
  project: l,
101
96
  initial: h.mode === "edit" ? h.v : void 0,
@@ -103,8 +98,8 @@ function Fe(t) {
103
98
  onSaved: () => i(null)
104
99
  }
105
100
  ),
106
- f && l != null && /* @__PURE__ */ e(
107
- W,
101
+ f && l != null && /* @__PURE__ */ t(
102
+ O,
108
103
  {
109
104
  title: "Delete variable",
110
105
  message: `Delete the variable "${f.name}"? This cannot be undone.`,
@@ -117,9 +112,9 @@ function Fe(t) {
117
112
  )
118
113
  ] }) });
119
114
  }
120
- function ke(t) {
121
- var M, v, E;
122
- const n = !!t.initial, [l, h] = m(((M = t.initial) == null ? void 0 : M.name) ?? ""), [i, f] = m(((v = t.initial) == null ? void 0 : v.type) ?? "string"), [o, g] = m(() => t.initial ? t.initial.type === "string" ? String(t.initial.value ?? "") : JSON.stringify(t.initial.value, null, 2) : ""), [b, y] = m(((E = t.initial) == null ? void 0 : E.description) ?? ""), [p, N] = m(null);
115
+ function Se(e) {
116
+ var k, v, E;
117
+ const n = !!e.initial, [l, h] = m(((k = e.initial) == null ? void 0 : k.name) ?? ""), [i, f] = m(((v = e.initial) == null ? void 0 : v.type) ?? "string"), [o, g] = m(() => e.initial ? e.initial.type === "string" ? String(e.initial.value ?? "") : JSON.stringify(e.initial.value, null, 2) : ""), [b, y] = m(((E = e.initial) == null ? void 0 : E.description) ?? ""), [p, N] = m(null);
123
118
  function C() {
124
119
  if (i === "string") return { ok: !0, value: o };
125
120
  if (i === "boolean")
@@ -134,45 +129,45 @@ function ke(t) {
134
129
  return { ok: !1, error: `Invalid JSON: ${d.message}` };
135
130
  }
136
131
  }
137
- const S = ue(), s = me(), u = S.isPending || s.isPending;
138
- function k() {
132
+ const S = ce(), s = ue(), c = S.isPending || s.isPending;
133
+ function w() {
139
134
  const d = C();
140
135
  if (!d.ok) {
141
136
  N(d.error);
142
137
  return;
143
138
  }
144
139
  N(null);
145
- const x = {
146
- onSuccess: () => t.onSaved(),
147
- onError: (w) => N((w instanceof L, w.message))
140
+ const D = {
141
+ onSuccess: () => e.onSaved(),
142
+ onError: (M) => N((M instanceof L, M.message))
148
143
  };
149
- if (t.initial) {
144
+ if (e.initial) {
150
145
  s.mutate(
151
146
  {
152
- id: t.initial.id,
147
+ id: e.initial.id,
153
148
  patch: { type: i, value: d.value, description: b },
154
- project: t.project
149
+ project: e.project
155
150
  },
156
- x
151
+ D
157
152
  );
158
153
  return;
159
154
  }
160
155
  S.mutate(
161
- { input: { name: l, type: i, value: d.value, description: b }, project: t.project },
162
- x
156
+ { input: { name: l, type: i, value: d.value, description: b }, project: e.project },
157
+ D
163
158
  );
164
159
  }
165
- const c = V(k, { enabled: !!l && !u });
160
+ const u = V(w, { enabled: !!l && !c });
166
161
  return /* @__PURE__ */ a(
167
162
  R,
168
163
  {
169
- title: t.initial ? `Edit ${t.initial.name}` : "Add variable",
170
- onClose: t.onClose,
164
+ title: e.initial ? `Edit ${e.initial.name}` : "Add variable",
165
+ onClose: e.onClose,
171
166
  children: [
172
167
  /* @__PURE__ */ a("div", { className: "modal-body", children: [
173
168
  /* @__PURE__ */ a("label", { className: "field", children: [
174
- /* @__PURE__ */ e("span", { children: "Name" }),
175
- /* @__PURE__ */ e(
169
+ /* @__PURE__ */ t("span", { children: "Name" }),
170
+ /* @__PURE__ */ t(
176
171
  "input",
177
172
  {
178
173
  type: "text",
@@ -181,21 +176,21 @@ function ke(t) {
181
176
  onChange: (d) => h(d.target.value),
182
177
  placeholder: "e.g. api_base_url",
183
178
  maxLength: 64,
184
- ...c
179
+ ...u
185
180
  }
186
181
  ),
187
- !n && /* @__PURE__ */ e("span", { className: "hint", children: "Letters, digits, and underscores. Must start with a letter or underscore. Case-sensitive." })
182
+ !n && /* @__PURE__ */ t("span", { className: "hint", children: "Letters, digits, and underscores. Must start with a letter or underscore. Case-sensitive." })
188
183
  ] }),
189
184
  /* @__PURE__ */ a("label", { className: "field", children: [
190
- /* @__PURE__ */ e("span", { children: "Type" }),
191
- /* @__PURE__ */ e("select", { value: i, onChange: (d) => f(d.target.value), children: Se.map((d) => /* @__PURE__ */ e("option", { value: d, children: d }, d)) })
185
+ /* @__PURE__ */ t("span", { children: "Type" }),
186
+ /* @__PURE__ */ t("select", { value: i, onChange: (d) => f(d.target.value), children: Ce.map((d) => /* @__PURE__ */ t("option", { value: d, children: d }, d)) })
192
187
  ] }),
193
188
  /* @__PURE__ */ a("label", { className: "field", htmlFor: "var-value", children: [
194
- /* @__PURE__ */ e("span", { children: "Value" }),
189
+ /* @__PURE__ */ t("span", { children: "Value" }),
195
190
  i === "boolean" ? /* @__PURE__ */ a("select", { id: "var-value", value: o || "true", onChange: (d) => g(d.target.value), children: [
196
- /* @__PURE__ */ e("option", { value: "true", children: "true" }),
197
- /* @__PURE__ */ e("option", { value: "false", children: "false" })
198
- ] }) : i === "number" ? /* @__PURE__ */ e(
191
+ /* @__PURE__ */ t("option", { value: "true", children: "true" }),
192
+ /* @__PURE__ */ t("option", { value: "false", children: "false" })
193
+ ] }) : i === "number" ? /* @__PURE__ */ t(
199
194
  "input",
200
195
  {
201
196
  id: "var-value",
@@ -203,9 +198,9 @@ function ke(t) {
203
198
  value: o,
204
199
  onChange: (d) => g(d.target.value),
205
200
  placeholder: "0",
206
- ...c
201
+ ...u
207
202
  }
208
- ) : i === "json" ? /* @__PURE__ */ e(
203
+ ) : i === "json" ? /* @__PURE__ */ t(
209
204
  "textarea",
210
205
  {
211
206
  id: "var-value",
@@ -215,7 +210,7 @@ function ke(t) {
215
210
  onChange: (d) => g(d.target.value),
216
211
  placeholder: '{"key": "value"}'
217
212
  }
218
- ) : /* @__PURE__ */ e(
213
+ ) : /* @__PURE__ */ t(
219
214
  "input",
220
215
  {
221
216
  id: "var-value",
@@ -223,53 +218,53 @@ function ke(t) {
223
218
  value: o,
224
219
  onChange: (d) => g(d.target.value),
225
220
  placeholder: "",
226
- ...c
221
+ ...u
227
222
  }
228
223
  )
229
224
  ] }),
230
225
  /* @__PURE__ */ a("label", { className: "field", children: [
231
- /* @__PURE__ */ e("span", { children: "Description" }),
232
- /* @__PURE__ */ e(
226
+ /* @__PURE__ */ t("span", { children: "Description" }),
227
+ /* @__PURE__ */ t(
233
228
  "input",
234
229
  {
235
230
  type: "text",
236
231
  value: b,
237
232
  onChange: (d) => y(d.target.value),
238
233
  placeholder: "Optional",
239
- ...c
234
+ ...u
240
235
  }
241
236
  )
242
237
  ] }),
243
- p && /* @__PURE__ */ e("div", { className: "result error", children: p })
238
+ p && /* @__PURE__ */ t("div", { className: "result error", children: p })
244
239
  ] }),
245
240
  /* @__PURE__ */ a("div", { className: "modal-actions", children: [
246
- /* @__PURE__ */ e("button", { type: "button", className: "btn ghost", onClick: t.onClose, children: "Cancel" }),
247
- /* @__PURE__ */ e("button", { type: "button", className: "btn", disabled: !l || u, onClick: k, children: u ? "Saving…" : n ? "Save changes" : "Save variable" })
241
+ /* @__PURE__ */ t("button", { type: "button", className: "btn ghost", onClick: e.onClose, children: "Cancel" }),
242
+ /* @__PURE__ */ t("button", { type: "button", className: "btn", disabled: !l || c, onClick: w, children: c ? "Saving…" : n ? "Save changes" : "Save variable" })
248
243
  ] })
249
244
  ]
250
245
  }
251
246
  );
252
247
  }
253
- function Ke(t) {
248
+ function Fe(e) {
254
249
  var s;
255
- const n = t.slots, [l, h] = m(null), [i, f] = m(null), o = he(), g = ge(), b = () => h({ mode: "create" }), y = (n == null ? void 0 : n.header) === void 0 ? /* @__PURE__ */ a("div", { children: [
256
- /* @__PURE__ */ e("h3", { children: "Secrets" }),
257
- /* @__PURE__ */ e("p", { className: "muted small", children: "Secrets addressable by name. Stored encrypted at rest and never returned from the server — to change a secret, overwrite it." })
258
- ] }) : n.header, p = n == null ? void 0 : n.actions, N = p === void 0 ? /* @__PURE__ */ e("button", { type: "button", className: "btn", onClick: b, children: "+ Add secret" }) : typeof p == "function" ? p({ openCreate: b, canCreate: !0 }) : p, C = (n == null ? void 0 : n.empty) === void 0 ? /* @__PURE__ */ e(U, { testId: "secrets-manager-empty", children: "No secrets yet." }) : n.empty, S = [
250
+ const n = e.slots, [l, h] = m(null), [i, f] = m(null), o = me(), g = he(), b = () => h({ mode: "create" }), y = (n == null ? void 0 : n.header) === void 0 ? /* @__PURE__ */ a("div", { children: [
251
+ /* @__PURE__ */ t("h3", { children: "Secrets" }),
252
+ /* @__PURE__ */ t("p", { className: "muted small", children: "Secrets addressable by name. Stored encrypted at rest and never returned from the server — to change a secret, overwrite it." })
253
+ ] }) : n.header, p = n == null ? void 0 : n.actions, N = p === void 0 ? /* @__PURE__ */ t("button", { type: "button", className: "btn", onClick: b, children: "+ Add secret" }) : typeof p == "function" ? p({ openCreate: b, canCreate: !0 }) : p, C = (n == null ? void 0 : n.empty) === void 0 ? /* @__PURE__ */ t(P, { testId: "secrets-manager-empty", children: "No secrets yet." }) : n.empty, S = [
259
254
  {
260
255
  key: "name",
261
256
  header: "Secret",
262
- render: (u) => /* @__PURE__ */ a("div", { className: "list-main", style: { maxWidth: 0, minWidth: "100%" }, children: [
263
- /* @__PURE__ */ e("strong", { className: "list-name", title: u.name, children: u.name }),
257
+ render: (c) => /* @__PURE__ */ a("div", { className: "list-main", style: { maxWidth: 0, minWidth: "100%" }, children: [
258
+ /* @__PURE__ */ t("strong", { className: "list-name", title: c.name, children: c.name }),
264
259
  " ",
265
- /* @__PURE__ */ e("code", { className: "muted small", children: "••••••••" }),
260
+ /* @__PURE__ */ t("code", { className: "muted small", children: "••••••••" }),
266
261
  /* @__PURE__ */ a("div", { className: "muted small list-preview", children: [
267
- u.description && /* @__PURE__ */ a(ne, { children: [
268
- u.description,
262
+ c.description && /* @__PURE__ */ a(ne, { children: [
263
+ c.description,
269
264
  " · "
270
265
  ] }),
271
266
  "updated ",
272
- new Date(u.updatedAt).toLocaleString()
267
+ new Date(c.updatedAt).toLocaleString()
273
268
  ] })
274
269
  ] })
275
270
  },
@@ -277,48 +272,56 @@ function Ke(t) {
277
272
  key: "actions",
278
273
  header: "",
279
274
  align: "right",
275
+ // Shrink to the buttons: the name cell's `maxWidth: 0` would otherwise split the width evenly.
276
+ width: "1%",
280
277
  link: !1,
281
- render: (u) => /* @__PURE__ */ a("div", { style: { display: "flex", gap: "var(--w6w-sp-1-5)" }, children: [
282
- /* @__PURE__ */ e(
283
- A,
278
+ render: (c) => /* @__PURE__ */ a("div", { style: { display: "flex", gap: "var(--w6w-sp-1-5)", whiteSpace: "nowrap" }, children: [
279
+ /* @__PURE__ */ t(
280
+ T,
284
281
  {
285
282
  label: "Rotate",
286
- onClick: () => h({ mode: "edit", s: u }),
287
- "data-testid": `secret-rotate-${u.id}`
283
+ onClick: () => h({ mode: "edit", s: c }),
284
+ "data-testid": `secret-rotate-${c.id}`
288
285
  }
289
286
  ),
290
- /* @__PURE__ */ e(
291
- O,
287
+ /* @__PURE__ */ t(
288
+ A,
292
289
  {
293
290
  label: "Delete",
294
- onClick: () => f(u),
291
+ onClick: () => f(c),
295
292
  disabled: g.isPending,
296
- "data-testid": `secret-delete-${u.id}`
293
+ "data-testid": `secret-delete-${c.id}`
297
294
  }
298
295
  )
299
296
  ] })
300
297
  }
301
298
  ];
302
- return /* @__PURE__ */ e("div", { className: "w6w-embed-root", children: /* @__PURE__ */ a("section", { className: "section", children: [
299
+ return /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */ a("section", { className: "section", children: [
303
300
  (y != null || N != null) && /* @__PURE__ */ a("div", { className: "section-head", children: [
304
301
  y,
305
302
  N
306
303
  ] }),
307
- /* @__PURE__ */ a("div", { className: "card", children: [
308
- o.isLoading && /* @__PURE__ */ e("p", { className: "muted", children: "Loading…" }),
309
- ((s = o.data) == null ? void 0 : s.length) === 0 && C,
310
- o.data != null && o.data.length > 0 && /* @__PURE__ */ e(T, { columns: S, rows: o.data, rowKey: (u) => u.id })
311
- ] }),
312
- l && /* @__PURE__ */ e(
313
- Me,
304
+ o.isLoading && /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }),
305
+ ((s = o.data) == null ? void 0 : s.length) === 0 && C,
306
+ o.data != null && o.data.length > 0 && /* @__PURE__ */ t(
307
+ U,
308
+ {
309
+ className: "w6w-data-table-rows",
310
+ columns: S,
311
+ rows: o.data,
312
+ rowKey: (c) => c.id
313
+ }
314
+ ),
315
+ l && /* @__PURE__ */ t(
316
+ we,
314
317
  {
315
318
  initial: l.mode === "edit" ? l.s : void 0,
316
319
  onClose: () => h(null),
317
320
  onSaved: () => h(null)
318
321
  }
319
322
  ),
320
- i && /* @__PURE__ */ e(
321
- W,
323
+ i && /* @__PURE__ */ t(
324
+ O,
322
325
  {
323
326
  title: "Delete secret",
324
327
  message: `Delete the secret "${i.name}"? This cannot be undone.`,
@@ -331,15 +334,15 @@ function Ke(t) {
331
334
  )
332
335
  ] }) });
333
336
  }
334
- function Me(t) {
335
- var k, c, M;
336
- const n = !!t.initial, [l, h] = m(((k = t.initial) == null ? void 0 : k.name) ?? ""), [i, f] = m(""), [o, g] = m(((c = t.initial) == null ? void 0 : c.description) ?? ""), [b, y] = m(null), p = ve(), N = be(((M = t.initial) == null ? void 0 : M.id) ?? ""), C = n ? N : p, S = !!l && (n || !!i) && !C.isPending;
337
+ function we(e) {
338
+ var w, u, k;
339
+ const n = !!e.initial, [l, h] = m(((w = e.initial) == null ? void 0 : w.name) ?? ""), [i, f] = m(""), [o, g] = m(((u = e.initial) == null ? void 0 : u.description) ?? ""), [b, y] = m(null), p = ge(), N = ve(((k = e.initial) == null ? void 0 : k.id) ?? ""), C = n ? N : p, S = !!l && (n || !!i) && !C.isPending;
337
340
  function s() {
338
341
  if (y(null), n) {
339
342
  N.mutate(
340
343
  { value: i === "" ? void 0 : i, description: o },
341
344
  {
342
- onSuccess: () => t.onSaved(),
345
+ onSuccess: () => e.onSaved(),
343
346
  onError: (v) => y((v instanceof L, v.message))
344
347
  }
345
348
  );
@@ -352,22 +355,22 @@ function Me(t) {
352
355
  p.mutate(
353
356
  { name: l, value: i, description: o },
354
357
  {
355
- onSuccess: () => t.onSaved(),
358
+ onSuccess: () => e.onSaved(),
356
359
  onError: (v) => y((v instanceof L, v.message))
357
360
  }
358
361
  );
359
362
  }
360
- const u = V(s, { enabled: S });
363
+ const c = V(s, { enabled: S });
361
364
  return /* @__PURE__ */ a(
362
365
  R,
363
366
  {
364
- title: t.initial ? `Rotate ${t.initial.name}` : "Add secret",
365
- onClose: t.onClose,
367
+ title: e.initial ? `Rotate ${e.initial.name}` : "Add secret",
368
+ onClose: e.onClose,
366
369
  children: [
367
370
  /* @__PURE__ */ a("div", { className: "modal-body", children: [
368
371
  /* @__PURE__ */ a("label", { className: "field", children: [
369
- /* @__PURE__ */ e("span", { children: "Name" }),
370
- /* @__PURE__ */ e(
372
+ /* @__PURE__ */ t("span", { children: "Name" }),
373
+ /* @__PURE__ */ t(
371
374
  "input",
372
375
  {
373
376
  type: "text",
@@ -376,14 +379,14 @@ function Me(t) {
376
379
  onChange: (v) => h(v.target.value),
377
380
  placeholder: "e.g. openai_api_key",
378
381
  maxLength: 64,
379
- ...u
382
+ ...c
380
383
  }
381
384
  ),
382
- !n && /* @__PURE__ */ e("span", { className: "hint", children: "Letters, digits, and underscores. Must start with a letter or underscore. Case-sensitive." })
385
+ !n && /* @__PURE__ */ t("span", { className: "hint", children: "Letters, digits, and underscores. Must start with a letter or underscore. Case-sensitive." })
383
386
  ] }),
384
387
  /* @__PURE__ */ a("label", { className: "field", children: [
385
- /* @__PURE__ */ e("span", { children: n ? "New value" : "Value" }),
386
- /* @__PURE__ */ e(
388
+ /* @__PURE__ */ t("span", { children: n ? "New value" : "Value" }),
389
+ /* @__PURE__ */ t(
387
390
  "textarea",
388
391
  {
389
392
  className: "code",
@@ -395,83 +398,83 @@ function Me(t) {
395
398
  spellCheck: !1
396
399
  }
397
400
  ),
398
- /* @__PURE__ */ e("span", { className: "hint", children: "Stored encrypted at rest. Once saved, it is not readable through the UI." })
401
+ /* @__PURE__ */ t("span", { className: "hint", children: "Stored encrypted at rest. Once saved, it is not readable through the UI." })
399
402
  ] }),
400
403
  /* @__PURE__ */ a("label", { className: "field", children: [
401
- /* @__PURE__ */ e("span", { children: "Description" }),
402
- /* @__PURE__ */ e(
404
+ /* @__PURE__ */ t("span", { children: "Description" }),
405
+ /* @__PURE__ */ t(
403
406
  "input",
404
407
  {
405
408
  type: "text",
406
409
  value: o,
407
410
  onChange: (v) => g(v.target.value),
408
411
  placeholder: "Optional",
409
- ...u
412
+ ...c
410
413
  }
411
414
  )
412
415
  ] }),
413
- b && /* @__PURE__ */ e("div", { className: "result error", children: b })
416
+ b && /* @__PURE__ */ t("div", { className: "result error", children: b })
414
417
  ] }),
415
418
  /* @__PURE__ */ a("div", { className: "modal-actions", children: [
416
- /* @__PURE__ */ e("button", { type: "button", className: "btn ghost", onClick: t.onClose, children: "Cancel" }),
417
- /* @__PURE__ */ e("button", { type: "button", className: "btn", disabled: !S, onClick: s, children: C.isPending ? "Saving…" : n ? "Save changes" : "Save secret" })
419
+ /* @__PURE__ */ t("button", { type: "button", className: "btn ghost", onClick: e.onClose, children: "Cancel" }),
420
+ /* @__PURE__ */ t("button", { type: "button", className: "btn", disabled: !S, onClick: s, children: C.isPending ? "Saving…" : n ? "Save changes" : "Save secret" })
418
421
  ] })
419
422
  ]
420
423
  }
421
424
  );
422
425
  }
423
- const we = {
426
+ const ke = {
424
427
  costMinor: "Cost",
425
428
  tokens: "Tokens",
426
429
  requests: "Requests"
427
- }, Ee = ["block", "warn"], ee = ["tenant", "account", "project", "route", "connection"], xe = {
430
+ }, Me = ["block", "warn"], ee = ["tenant", "account", "project", "route", "connection"], Ee = {
428
431
  tenant: "Tenant",
429
432
  account: "Account",
430
433
  project: "Project",
431
434
  route: "Model route",
432
435
  connection: "Connection"
433
- }, De = (t) => t === "route" || t === "connection", te = ["day", "month"];
434
- function P(t) {
435
- return String(t).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
436
+ }, De = (e) => e === "route" || e === "connection", te = ["day", "month"];
437
+ function B(e) {
438
+ return String(e).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
436
439
  }
437
- function je(t, n) {
438
- return t === "costMinor" ? (l) => `${n} ${(l / 100).toFixed(2)}` : P;
440
+ function je(e, n) {
441
+ return e === "costMinor" ? (l) => `${n} ${(l / 100).toFixed(2)}` : B;
439
442
  }
440
- function $e(t) {
441
- return t.costMinor != null ? "costMinor" : t.tokens != null ? "tokens" : t.requests != null ? "requests" : null;
443
+ function xe(e) {
444
+ return e.costMinor != null ? "costMinor" : e.tokens != null ? "tokens" : e.requests != null ? "requests" : null;
442
445
  }
443
- function Ie(t) {
444
- return t.costMinor == null ? null : `${t.currency ?? "USD"} ${(t.costMinor / 100).toFixed(2)}`;
446
+ function $e(e) {
447
+ return e.costMinor == null ? null : `${e.currency ?? "USD"} ${(e.costMinor / 100).toFixed(2)}`;
445
448
  }
446
- function Le(t) {
449
+ function Ie(e) {
447
450
  const n = [];
448
- t.requests != null && n.push(`${P(t.requests)} requests`), t.tokens != null && n.push(`${P(t.tokens)} tokens`);
449
- const l = Ie(t);
451
+ e.requests != null && n.push(`${B(e.requests)} requests`), e.tokens != null && n.push(`${B(e.tokens)} tokens`);
452
+ const l = $e(e);
450
453
  return l != null && n.push(l), n.length === 0 ? "no limit" : n.join(" · ");
451
454
  }
452
- function I(t) {
453
- return t.scopeId == null ? `this ${t.scopeKind}` : `${t.scopeKind} ${t.scopeId}`;
455
+ function I(e) {
456
+ return e.scopeId == null ? `this ${e.scopeKind}` : `${e.scopeKind} ${e.scopeId}`;
454
457
  }
455
- function le(t) {
456
- return t instanceof L || t instanceof Error ? t.message : String(t);
458
+ function le(e) {
459
+ return e instanceof L || e instanceof Error ? e.message : String(e);
457
460
  }
458
- function B(t) {
459
- const n = t.trim();
461
+ function q(e) {
462
+ const n = e.trim();
460
463
  if (n === "") return null;
461
464
  const l = Number(n);
462
465
  return Number.isFinite(l) ? l : null;
463
466
  }
464
- function Qe(t) {
467
+ function Ke(e) {
465
468
  var S;
466
- const n = ae(t.projectId), [l, h] = m(null), [i, f] = m(null), [o, g] = m(null), b = pe(n ?? void 0), y = fe(), p = b.data ?? [], N = n != null, C = [
469
+ const n = ae(e.projectId), [l, h] = m(null), [i, f] = m(null), [o, g] = m(null), b = be(n ?? void 0), y = pe(), p = b.data ?? [], N = n != null, C = [
467
470
  {
468
471
  key: "scope",
469
472
  header: "Scope",
470
473
  render: (s) => /* @__PURE__ */ a("div", { className: "list-main", style: { maxWidth: 0, minWidth: "100%" }, children: [
471
- /* @__PURE__ */ e("strong", { className: "list-name", title: I(s), children: s.scopeKind }),
474
+ /* @__PURE__ */ t("strong", { className: "list-name", title: I(s), children: s.scopeKind }),
472
475
  " ",
473
- /* @__PURE__ */ e("span", { className: s.onBreach === "warn" ? "tag warn" : "tag", children: s.onBreach }),
474
- /* @__PURE__ */ e("div", { className: "muted small list-preview", title: I(s), children: s.scopeId == null ? `the whole ${s.scopeKind}` : s.scopeId })
476
+ /* @__PURE__ */ t("span", { className: s.onBreach === "warn" ? "tag warn" : "tag", children: s.onBreach }),
477
+ /* @__PURE__ */ t("div", { className: "muted small list-preview", title: I(s), children: s.scopeId == null ? `the whole ${s.scopeKind}` : s.scopeId })
475
478
  ] })
476
479
  },
477
480
  {
@@ -482,13 +485,13 @@ function Qe(t) {
482
485
  {
483
486
  key: "limits",
484
487
  header: "Limit",
485
- render: (s) => /* @__PURE__ */ e("span", { className: "muted small", children: Le(s.limits) })
488
+ render: (s) => /* @__PURE__ */ t("span", { className: "muted small", children: Ie(s.limits) })
486
489
  },
487
490
  {
488
491
  key: "usage",
489
492
  header: "Used",
490
493
  // Rows only exist once the project-scoped query ran, so `project` is set here.
491
- render: (s) => n == null ? null : /* @__PURE__ */ e(qe, { budget: s, projectId: n })
494
+ render: (s) => n == null ? null : /* @__PURE__ */ t(Le, { budget: s, projectId: n })
492
495
  },
493
496
  {
494
497
  key: "actions",
@@ -496,16 +499,16 @@ function Qe(t) {
496
499
  align: "right",
497
500
  link: !1,
498
501
  render: (s) => /* @__PURE__ */ a("div", { style: { display: "flex", gap: "var(--w6w-sp-1-5)" }, children: [
499
- /* @__PURE__ */ e(
500
- A,
502
+ /* @__PURE__ */ t(
503
+ T,
501
504
  {
502
505
  label: "Edit",
503
506
  onClick: () => h({ budget: s }),
504
507
  "data-testid": `model-budget-edit-${s.id}`
505
508
  }
506
509
  ),
507
- /* @__PURE__ */ e(
508
- O,
510
+ /* @__PURE__ */ t(
511
+ A,
509
512
  {
510
513
  label: "Delete",
511
514
  onClick: () => f(s),
@@ -516,13 +519,13 @@ function Qe(t) {
516
519
  ] })
517
520
  }
518
521
  ];
519
- return /* @__PURE__ */ e("div", { className: "w6w-embed-root", children: /* @__PURE__ */ a("section", { className: "section", children: [
522
+ return /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */ a("section", { className: "section", children: [
520
523
  /* @__PURE__ */ a("div", { className: "section-head", children: [
521
524
  /* @__PURE__ */ a("div", { children: [
522
- /* @__PURE__ */ e("h3", { children: "Model budgets" }),
523
- /* @__PURE__ */ e("p", { className: "muted small", children: "Caps on what a tenant, account, project, route or connection may spend. A breached budget either warns or blocks the call, per its own setting." })
525
+ /* @__PURE__ */ t("h3", { children: "Model budgets" }),
526
+ /* @__PURE__ */ t("p", { className: "muted small", children: "Caps on what a tenant, account, project, route or connection may spend. A breached budget either warns or blocks the call, per its own setting." })
524
527
  ] }),
525
- /* @__PURE__ */ e(
528
+ /* @__PURE__ */ t(
526
529
  "button",
527
530
  {
528
531
  type: "button",
@@ -534,12 +537,12 @@ function Qe(t) {
534
537
  }
535
538
  )
536
539
  ] }),
537
- o && /* @__PURE__ */ e("div", { className: "result error", role: "alert", "data-testid": "model-budget-delete-error", children: o }),
538
- /* @__PURE__ */ a("div", { className: "card", children: [
539
- b.isLoading && /* @__PURE__ */ e("p", { className: "muted", children: "Loading…" }),
540
- ((S = b.data) == null ? void 0 : S.length) === 0 && /* @__PURE__ */ e(U, { testId: "model-budgets-empty", children: "No model budgets yet. Add one to cap spend or request volume." }),
541
- p.length > 0 && /* @__PURE__ */ e(
542
- T,
540
+ o && /* @__PURE__ */ t("div", { className: "result error", role: "alert", "data-testid": "model-budget-delete-error", children: o }),
541
+ /* @__PURE__ */ a("div", { children: [
542
+ b.isLoading && /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }),
543
+ ((S = b.data) == null ? void 0 : S.length) === 0 && /* @__PURE__ */ t(P, { testId: "model-budgets-empty", children: "No model budgets yet. Add one to cap spend or request volume." }),
544
+ p.length > 0 && /* @__PURE__ */ t(
545
+ U,
543
546
  {
544
547
  columns: C,
545
548
  rows: p,
@@ -548,8 +551,8 @@ function Qe(t) {
548
551
  }
549
552
  )
550
553
  ] }),
551
- l != null && n != null && /* @__PURE__ */ e(
552
- Be,
554
+ l != null && n != null && /* @__PURE__ */ t(
555
+ qe,
553
556
  {
554
557
  project: n,
555
558
  initial: l.budget,
@@ -557,8 +560,8 @@ function Qe(t) {
557
560
  onSaved: () => h(null)
558
561
  }
559
562
  ),
560
- i != null && n != null && /* @__PURE__ */ e(
561
- W,
563
+ i != null && n != null && /* @__PURE__ */ t(
564
+ O,
562
565
  {
563
566
  title: "Delete model budget",
564
567
  message: `Delete the budget on ${I(i)}? Calls stop being capped by it immediately.`,
@@ -568,8 +571,8 @@ function Qe(t) {
568
571
  g(null), y.mutate(
569
572
  { project: n, id: s.id },
570
573
  {
571
- onError: (u) => g(
572
- `Could not delete the budget on ${I(s)}: ${le(u)}`
574
+ onError: (c) => g(
575
+ `Could not delete the budget on ${I(s)}: ${le(c)}`
573
576
  )
574
577
  }
575
578
  ), f(null);
@@ -579,79 +582,79 @@ function Qe(t) {
579
582
  )
580
583
  ] }) });
581
584
  }
582
- function qe(t) {
583
- const n = Ce(t.budget.id, t.projectId);
584
- if (n.isLoading) return /* @__PURE__ */ e("span", { className: "muted small", children: "Loading…" });
585
+ function Le(e) {
586
+ const n = Ne(e.budget.id, e.projectId);
587
+ if (n.isLoading) return /* @__PURE__ */ t("span", { className: "muted small", children: "Loading…" });
585
588
  const l = n.data;
586
- if (l == null) return /* @__PURE__ */ e("span", { className: "muted small", children: "—" });
587
- const h = l.limits ?? t.budget.limits, i = $e(h);
588
- return i == null ? /* @__PURE__ */ e("span", { className: "muted small", children: "no limit" }) : /* @__PURE__ */ e(
589
- re,
589
+ if (l == null) return /* @__PURE__ */ t("span", { className: "muted small", children: "—" });
590
+ const h = l.limits ?? e.budget.limits, i = xe(h);
591
+ return i == null ? /* @__PURE__ */ t("span", { className: "muted small", children: "no limit" }) : /* @__PURE__ */ t(
592
+ se,
590
593
  {
591
- label: we[i],
594
+ label: ke[i],
592
595
  used: l.used[i],
593
596
  limit: h[i] ?? 0,
594
597
  reserved: l.reserved[i],
595
598
  format: je(i, h.currency ?? "USD"),
596
- testId: `model-budget-meter-${t.budget.id}`
599
+ testId: `model-budget-meter-${e.budget.id}`
597
600
  }
598
601
  );
599
602
  }
600
- function Be(t) {
601
- var Q, _, J, H, Y, z, G, X;
602
- const n = !!t.initial, [l, h] = m(((Q = t.initial) == null ? void 0 : Q.scopeKind) ?? "project"), [i, f] = m(((_ = t.initial) == null ? void 0 : _.scopeId) ?? ""), [o, g] = m(((J = t.initial) == null ? void 0 : J.window) ?? "day"), [b, y] = m(
603
- ((H = t.initial) == null ? void 0 : H.limits.requests) != null ? String(t.initial.limits.requests) : ""
603
+ function qe(e) {
604
+ var K, Q, _, J, H, Y, z, G;
605
+ const n = !!e.initial, [l, h] = m(((K = e.initial) == null ? void 0 : K.scopeKind) ?? "project"), [i, f] = m(((Q = e.initial) == null ? void 0 : Q.scopeId) ?? ""), [o, g] = m(((_ = e.initial) == null ? void 0 : _.window) ?? "day"), [b, y] = m(
606
+ ((J = e.initial) == null ? void 0 : J.limits.requests) != null ? String(e.initial.limits.requests) : ""
604
607
  ), [p, N] = m(
605
- ((Y = t.initial) == null ? void 0 : Y.limits.tokens) != null ? String(t.initial.limits.tokens) : ""
608
+ ((H = e.initial) == null ? void 0 : H.limits.tokens) != null ? String(e.initial.limits.tokens) : ""
606
609
  ), [C, S] = m(
607
- ((z = t.initial) == null ? void 0 : z.limits.costMinor) != null ? String(t.initial.limits.costMinor / 100) : ""
608
- ), [s, u] = m(((G = t.initial) == null ? void 0 : G.limits.currency) ?? ""), [k, c] = m(((X = t.initial) == null ? void 0 : X.onBreach) ?? "warn"), [M, v] = m(null), E = ye(), d = Ne(), x = E.isPending || d.isPending, w = De(l), F = !!l && !!o && (!w || n || i.trim() !== "") && !x;
610
+ ((Y = e.initial) == null ? void 0 : Y.limits.costMinor) != null ? String(e.initial.limits.costMinor / 100) : ""
611
+ ), [s, c] = m(((z = e.initial) == null ? void 0 : z.limits.currency) ?? ""), [w, u] = m(((G = e.initial) == null ? void 0 : G.onBreach) ?? "warn"), [k, v] = m(null), E = fe(), d = ye(), D = E.isPending || d.isPending, M = De(l), W = !!l && !!o && (!M || n || i.trim() !== "") && !D;
609
612
  function ie() {
610
- const r = {}, j = B(b);
611
- j != null && (r.requests = j);
612
- const $ = B(p);
613
+ const r = {}, x = q(b);
614
+ x != null && (r.requests = x);
615
+ const $ = q(p);
613
616
  $ != null && (r.tokens = $);
614
- const Z = B(C);
615
- return Z != null && (r.costMinor = Math.round(Z * 100)), r.costMinor != null && s.trim() !== "" && (r.currency = s.trim()), Object.keys(r).length === 0 ? null : r;
617
+ const X = q(C);
618
+ return X != null && (r.costMinor = Math.round(X * 100)), r.costMinor != null && s.trim() !== "" && (r.currency = s.trim()), Object.keys(r).length === 0 ? null : r;
616
619
  }
617
- function K() {
620
+ function F() {
618
621
  const r = ie();
619
622
  if (r == null) {
620
623
  v("Set at least one limit: requests, tokens or cost.");
621
624
  return;
622
625
  }
623
626
  v(null);
624
- const j = {
625
- onSuccess: () => t.onSaved(),
627
+ const x = {
628
+ onSuccess: () => e.onSaved(),
626
629
  onError: ($) => v(le($))
627
630
  };
628
- if (t.initial) {
631
+ if (e.initial) {
629
632
  d.mutate(
630
- { project: t.project, id: t.initial.id, patch: { window: o, limits: r, onBreach: k } },
631
- j
633
+ { project: e.project, id: e.initial.id, patch: { window: o, limits: r, onBreach: w } },
634
+ x
632
635
  );
633
636
  return;
634
637
  }
635
638
  E.mutate(
636
639
  {
637
- project: t.project,
640
+ project: e.project,
638
641
  input: {
639
642
  scopeKind: l,
640
643
  // Only route/connection budgets carry a scope id; the server refuses one elsewhere.
641
- ...w ? { scopeId: i.trim() } : {},
644
+ ...M ? { scopeId: i.trim() } : {},
642
645
  window: o,
643
646
  limits: r,
644
- onBreach: k
647
+ onBreach: w
645
648
  }
646
649
  },
647
- j
650
+ x
648
651
  );
649
652
  }
650
- const D = V(K, { enabled: F });
651
- return /* @__PURE__ */ a(R, { title: t.initial ? "Edit model budget" : "Add model budget", onClose: t.onClose, children: [
653
+ const j = V(F, { enabled: W });
654
+ return /* @__PURE__ */ a(R, { title: e.initial ? "Edit model budget" : "Add model budget", onClose: e.onClose, children: [
652
655
  /* @__PURE__ */ a("div", { className: "modal-body", children: [
653
656
  /* @__PURE__ */ a("label", { className: "field", children: [
654
- /* @__PURE__ */ e("span", { children: "Scope" }),
657
+ /* @__PURE__ */ t("span", { children: "Scope" }),
655
658
  /* @__PURE__ */ a(
656
659
  "select",
657
660
  {
@@ -660,19 +663,19 @@ function Be(t) {
660
663
  onChange: (r) => h(r.target.value),
661
664
  "data-testid": "model-budget-scope-kind",
662
665
  children: [
663
- !ee.includes(l) && /* @__PURE__ */ e("option", { value: l, children: l }),
664
- ee.map((r) => /* @__PURE__ */ e("option", { value: r, children: xe[r] }, r))
666
+ !ee.includes(l) && /* @__PURE__ */ t("option", { value: l, children: l }),
667
+ ee.map((r) => /* @__PURE__ */ t("option", { value: r, children: Ee[r] }, r))
665
668
  ]
666
669
  }
667
670
  ),
668
- !n && /* @__PURE__ */ e("span", { className: "hint", children: "What the budget caps — this tenant, account or project as a whole, or one model route or connection. Fixed once created." })
671
+ !n && /* @__PURE__ */ t("span", { className: "hint", children: "What the budget caps — this tenant, account or project as a whole, or one model route or connection. Fixed once created." })
669
672
  ] }),
670
- w && /* @__PURE__ */ a("label", { className: "field", children: [
673
+ M && /* @__PURE__ */ a("label", { className: "field", children: [
671
674
  /* @__PURE__ */ a("span", { children: [
672
675
  l === "route" ? "Route" : "Connection id",
673
676
  " *"
674
677
  ] }),
675
- /* @__PURE__ */ e(
678
+ /* @__PURE__ */ t(
676
679
  "input",
677
680
  {
678
681
  type: "text",
@@ -681,13 +684,13 @@ function Be(t) {
681
684
  onChange: (r) => f(r.target.value),
682
685
  placeholder: l === "route" ? "e.g. fast" : "e.g. conn_…",
683
686
  "data-testid": "model-budget-scope-id",
684
- ...D
687
+ ...j
685
688
  }
686
689
  ),
687
- !n && /* @__PURE__ */ e("span", { className: "hint", children: l === "route" ? "The route's name or id. Required for a route budget." : "The model-provider connection's id. Required for a connection budget." })
690
+ !n && /* @__PURE__ */ t("span", { className: "hint", children: l === "route" ? "The route's name or id. Required for a route budget." : "The model-provider connection's id. Required for a connection budget." })
688
691
  ] }),
689
692
  /* @__PURE__ */ a("label", { className: "field", children: [
690
- /* @__PURE__ */ e("span", { children: "Window" }),
693
+ /* @__PURE__ */ t("span", { children: "Window" }),
691
694
  /* @__PURE__ */ a(
692
695
  "select",
693
696
  {
@@ -695,16 +698,16 @@ function Be(t) {
695
698
  onChange: (r) => g(r.target.value),
696
699
  "data-testid": "model-budget-window",
697
700
  children: [
698
- !te.includes(o) && /* @__PURE__ */ e("option", { value: o, children: o }),
699
- te.map((r) => /* @__PURE__ */ e("option", { value: r, children: r }, r))
701
+ !te.includes(o) && /* @__PURE__ */ t("option", { value: o, children: o }),
702
+ te.map((r) => /* @__PURE__ */ t("option", { value: r, children: r }, r))
700
703
  ]
701
704
  }
702
705
  ),
703
- /* @__PURE__ */ e("span", { className: "hint", children: "The period the limits reset over, in UTC." })
706
+ /* @__PURE__ */ t("span", { className: "hint", children: "The period the limits reset over, in UTC." })
704
707
  ] }),
705
708
  /* @__PURE__ */ a("label", { className: "field", children: [
706
- /* @__PURE__ */ e("span", { children: "Requests" }),
707
- /* @__PURE__ */ e(
709
+ /* @__PURE__ */ t("span", { children: "Requests" }),
710
+ /* @__PURE__ */ t(
708
711
  "input",
709
712
  {
710
713
  type: "number",
@@ -713,13 +716,13 @@ function Be(t) {
713
716
  onChange: (r) => y(r.target.value),
714
717
  placeholder: "Unlimited",
715
718
  "data-testid": "model-budget-requests",
716
- ...D
719
+ ...j
717
720
  }
718
721
  )
719
722
  ] }),
720
723
  /* @__PURE__ */ a("label", { className: "field", children: [
721
- /* @__PURE__ */ e("span", { children: "Tokens" }),
722
- /* @__PURE__ */ e(
724
+ /* @__PURE__ */ t("span", { children: "Tokens" }),
725
+ /* @__PURE__ */ t(
723
726
  "input",
724
727
  {
725
728
  type: "number",
@@ -728,13 +731,13 @@ function Be(t) {
728
731
  onChange: (r) => N(r.target.value),
729
732
  placeholder: "Unlimited",
730
733
  "data-testid": "model-budget-tokens",
731
- ...D
734
+ ...j
732
735
  }
733
736
  )
734
737
  ] }),
735
738
  /* @__PURE__ */ a("label", { className: "field", children: [
736
- /* @__PURE__ */ e("span", { children: "Cost" }),
737
- /* @__PURE__ */ e(
739
+ /* @__PURE__ */ t("span", { children: "Cost" }),
740
+ /* @__PURE__ */ t(
738
741
  "input",
739
742
  {
740
743
  type: "number",
@@ -744,63 +747,63 @@ function Be(t) {
744
747
  onChange: (r) => S(r.target.value),
745
748
  placeholder: "Unlimited",
746
749
  "data-testid": "model-budget-cost",
747
- ...D
750
+ ...j
748
751
  }
749
752
  ),
750
- /* @__PURE__ */ e("span", { className: "hint", children: "In major units of the currency below (12.50 = 12.50 USD)." })
753
+ /* @__PURE__ */ t("span", { className: "hint", children: "In major units of the currency below (12.50 = 12.50 USD)." })
751
754
  ] }),
752
755
  /* @__PURE__ */ a("label", { className: "field", children: [
753
- /* @__PURE__ */ e("span", { children: "Currency" }),
754
- /* @__PURE__ */ e(
756
+ /* @__PURE__ */ t("span", { children: "Currency" }),
757
+ /* @__PURE__ */ t(
755
758
  "input",
756
759
  {
757
760
  type: "text",
758
761
  value: s,
759
- onChange: (r) => u(r.target.value),
762
+ onChange: (r) => c(r.target.value),
760
763
  placeholder: "USD",
761
764
  maxLength: 8,
762
765
  "data-testid": "model-budget-currency",
763
- ...D
766
+ ...j
764
767
  }
765
768
  )
766
769
  ] }),
767
770
  /* @__PURE__ */ a("label", { className: "field", children: [
768
- /* @__PURE__ */ e("span", { children: "On breach" }),
769
- /* @__PURE__ */ e(
771
+ /* @__PURE__ */ t("span", { children: "On breach" }),
772
+ /* @__PURE__ */ t(
770
773
  "select",
771
774
  {
772
- value: k,
773
- onChange: (r) => c(r.target.value),
775
+ value: w,
776
+ onChange: (r) => u(r.target.value),
774
777
  "data-testid": "model-budget-on-breach",
775
- children: Ee.map((r) => /* @__PURE__ */ e("option", { value: r, children: r }, r))
778
+ children: Me.map((r) => /* @__PURE__ */ t("option", { value: r, children: r }, r))
776
779
  }
777
780
  ),
778
- /* @__PURE__ */ e("span", { className: "hint", children: "`block` refuses calls past the limit; `warn` lets them through and flags them." })
781
+ /* @__PURE__ */ t("span", { className: "hint", children: "`block` refuses calls past the limit; `warn` lets them through and flags them." })
779
782
  ] }),
780
- M && /* @__PURE__ */ e("div", { className: "result error", "data-testid": "model-budget-error", children: M })
783
+ k && /* @__PURE__ */ t("div", { className: "result error", "data-testid": "model-budget-error", children: k })
781
784
  ] }),
782
785
  /* @__PURE__ */ a("div", { className: "modal-actions", children: [
783
- /* @__PURE__ */ e("button", { type: "button", className: "btn ghost", onClick: t.onClose, children: "Cancel" }),
784
- /* @__PURE__ */ e(
786
+ /* @__PURE__ */ t("button", { type: "button", className: "btn ghost", onClick: e.onClose, children: "Cancel" }),
787
+ /* @__PURE__ */ t(
785
788
  "button",
786
789
  {
787
790
  type: "button",
788
791
  className: "btn",
789
- disabled: !F,
790
- onClick: K,
792
+ disabled: !W,
793
+ onClick: F,
791
794
  "data-testid": "model-budget-save",
792
- children: x ? "Saving…" : n ? "Save changes" : "Save budget"
795
+ children: D ? "Saving…" : n ? "Save changes" : "Save budget"
793
796
  }
794
797
  )
795
798
  ] })
796
799
  ] });
797
800
  }
798
801
  export {
799
- He as CreateEndpointModal,
800
- Ye as CreateFunctionModal,
801
- Qe as ModelBudgetsManager,
802
- Ge as ModelRoutesManager,
803
- Ke as SecretsManager,
804
- Fe as VarsManager
802
+ Je as CreateEndpointModal,
803
+ He as CreateFunctionModal,
804
+ Ke as ModelBudgetsManager,
805
+ ze as ModelRoutesManager,
806
+ Fe as SecretsManager,
807
+ We as VarsManager
805
808
  };
806
809
  //# sourceMappingURL=forms.mjs.map