@overvis/hmi-workspace-ui 0.1.0 → 0.1.1

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 (115) hide show
  1. package/dist/alarm-list-sheAq-pb.js +414 -0
  2. package/dist/alarm-rule-dialog-D_ml7V0v.js +417 -0
  3. package/dist/{alarm-rule-lists-C5v1Kf7A.js → alarm-rule-lists-DaA4soF4.js} +123 -125
  4. package/dist/{alarm-rules-page-CqFzofPd.js → alarm-rules-page-OFjOQ-dm.js} +15 -18
  5. package/dist/alert-dialog-B60PF7S9.js +891 -0
  6. package/dist/{base-revision-YCO27zR4.js → base-revision-DYCOZS0R.js} +26 -29
  7. package/dist/{breadcrumbs-0cjsV2cq.js → breadcrumbs-D2u8KZQo.js} +6 -7
  8. package/dist/{catalog-list-DjZojYLJ.js → catalog-list-LXuRix0-.js} +2 -4
  9. package/dist/{code-editor-BVimvjDV.js → code-editor-BMSyzAxu.js} +5 -6
  10. package/dist/dashboard-bindings.js +1 -2
  11. package/dist/{dashboards-page-BlrJguNz.js → dashboards-page-wnmmLpVC.js} +335 -359
  12. package/dist/{de-14WdmJxZ.js → de-hkEr2usK.js} +1 -2
  13. package/dist/diagnostic-text-CsbENUNI.js +116 -0
  14. package/dist/{dialogs-B6BRnf3Q.js → dialogs-AtIYlNSy.js} +219 -227
  15. package/dist/{dialogs-D_v1LeH4.js → dialogs-DsHbKgZD.js} +2523 -2590
  16. package/dist/{display-DmOo23mi.js → display-DSyEwQt8.js} +4 -6
  17. package/dist/{editor-language-To9MxloY.js → editor-language-CTfJBXMs.js} +3 -5
  18. package/dist/editor-page-BWbVGJvU.js +1337 -0
  19. package/dist/{en-BgercpT0.js → en-UW_k-Bd6.js} +1 -2
  20. package/dist/entity-controls-BCuRx882.js +71 -0
  21. package/dist/errors-Cawve9yD.js +25 -0
  22. package/dist/{footer-DC-Q0052.js → footer-B9XdpVzq.js} +2404 -2515
  23. package/dist/host.js +8143 -675
  24. package/dist/{i18n-BgzakKoC.js → i18n-Dt6xbSK6.js} +77 -90
  25. package/dist/i18n.js +1 -2
  26. package/dist/index.js +5149 -5345
  27. package/dist/{lat-lng-B12P7QyY.js → lat-lng-Bl77AGSO.js} +1 -2
  28. package/dist/{list-page-CvsdZb86.js → list-page-agHupfNb.js} +116 -123
  29. package/dist/{location-map-renderer-DO5yfdSU.js → location-map-renderer-kxU6cgFl.js} +6 -6
  30. package/dist/{location-picker-renderer-CjCxg6ai.js → location-picker-renderer-B1_-n8lf.js} +3 -4
  31. package/dist/{model-B8gGi4OK.js → model-tpg_xpFB.js} +1 -2
  32. package/dist/{notice-card-DyGywFsW.js → notice-card-CH28rYUt.js} +54 -58
  33. package/dist/{page-v6LCwswN.js → page-CZPHJUmz.js} +92 -100
  34. package/dist/page-DpdkOGGb.js +449 -0
  35. package/dist/page-HCGXXGjy.js +507 -0
  36. package/dist/panel-BCwBlB_h.js +949 -0
  37. package/dist/parameter-values.js +3 -16
  38. package/dist/{pl-lQ9HXV9k.js → pl-BokvsP3J.js} +1 -2
  39. package/dist/presence-code-cT6wxlTg.js +73 -0
  40. package/dist/{query-gate-DVhNIkge.js → query-gate-DqmHsZ07.js} +6 -6
  41. package/dist/{provider-DoEpKcQ-.js → quick-report-DEqqwQxR.js} +9423 -5102
  42. package/dist/{retention-BYXNpYmR.js → retention-DZ0reGGe.js} +4 -6
  43. package/dist/retention-note-nequESpo.js +40 -0
  44. package/dist/{rolldown-runtime-Dy4uBu1J.js → rolldown-runtime-CGnMp29N.js} +1 -2
  45. package/dist/{ru-qTKINoUj.js → ru-DZSlsRHq.js} +1 -2
  46. package/dist/run-text-DneX9rWh.js +112 -0
  47. package/dist/{search-D4rDnE9T.js → search-DP9_alSQ.js} +26 -29
  48. package/dist/{sections-kCOyc4NR.js → sections-BU7NKUOQ.js} +2 -3
  49. package/dist/{select-BKiOWdSr.js → select-Te6Qv1Zu.js} +17 -23
  50. package/dist/{spinner-C-HPNxOc.js → spinner-BRcNKwjH.js} +182 -201
  51. package/dist/src/version.d.ts +1 -1
  52. package/dist/src/workspace/local-workspace-app.d.ts +1 -1
  53. package/dist/src/workspace/routes.d.ts +1 -1
  54. package/dist/{starter-fields-BRLX0z-v.js → starter-fields-yM4B49nd.js} +154 -157
  55. package/dist/{starter-handoff-BA3ucMKL.js → starter-handoff-BaK8Ss8I.js} +1 -2
  56. package/dist/styles.css +1 -1
  57. package/dist/ui.js +334 -374
  58. package/dist/{uk-CwpJAxmx.js → uk-CjXPq9Lk.js} +1 -2
  59. package/dist/{wireguard-docs-AfU6NzTL.js → wireguard-docs-CC8XKBR7.js} +14 -17
  60. package/package.json +15 -9
  61. package/dist/alarm-list-BL3xQ5Lf.js +0 -423
  62. package/dist/alarm-rule-dialog-S1ZUg-74.js +0 -423
  63. package/dist/alert-B8MAoIO8.js +0 -45
  64. package/dist/alert-dialog-CYkuMg5D.js +0 -129
  65. package/dist/api-error-9rQmUN5L.js +0 -93
  66. package/dist/breadcrumb-DzVL1yHa.js +0 -74
  67. package/dist/button-6SxPBYMz.js +0 -44
  68. package/dist/context-u9KJQmdB.js +0 -102
  69. package/dist/copyable-id-DYGiAcnq.js +0 -40
  70. package/dist/dashboard-context-CBfG6DoT.js +0 -191
  71. package/dist/date-time-picker-C3FhMXk6.js +0 -266
  72. package/dist/diagnostic-text-BAkzW0SE.js +0 -111
  73. package/dist/diagnostic-text-DiKd2i1w.js +0 -76
  74. package/dist/dialog-BIhQXcZC.js +0 -237
  75. package/dist/dialog-BqyIxMD-.js +0 -54
  76. package/dist/dropdown-menu-DSzbBq3v.js +0 -136
  77. package/dist/editor-page-BiSZJz5b.js +0 -1353
  78. package/dist/empty-B-QJ-06w.js +0 -59
  79. package/dist/entity-controls-D1K4Ot3O.js +0 -76
  80. package/dist/errors-CcsvDHu8.js +0 -26
  81. package/dist/history-page-sAAhG54V.js +0 -1400
  82. package/dist/icon-D-pR9htW.js +0 -57
  83. package/dist/index-page-DMH82fZe.js +0 -214
  84. package/dist/item-B5SaTFQU.js +0 -120
  85. package/dist/mutation-form-validators-BNz5bsv1.js +0 -2408
  86. package/dist/mutations-THtGG6Ai.js +0 -240
  87. package/dist/page-2KPemaAj.js +0 -328
  88. package/dist/page-6rIoTg2L.js +0 -459
  89. package/dist/page-C6giEoEd.js +0 -1935
  90. package/dist/page-DCbTxKsi.js +0 -313
  91. package/dist/page-DWO427hT.js +0 -208
  92. package/dist/page-LXu_2zm3.js +0 -137
  93. package/dist/page-aaUiVOnk.js +0 -513
  94. package/dist/page-header-RB2YFWlE.js +0 -55
  95. package/dist/page-title-CdCbiLt8.js +0 -14
  96. package/dist/panel-DDy8tUNR.js +0 -338
  97. package/dist/presence-code-BfSXr50g.js +0 -83
  98. package/dist/progress-C7cxNJA1.js +0 -83
  99. package/dist/provider-BOeYHi0n.js +0 -134
  100. package/dist/quick-report-CUVJnbKP.js +0 -416
  101. package/dist/radio-group-CZGqVbkJ.js +0 -26
  102. package/dist/retention-note-CHhA6gjY.js +0 -42
  103. package/dist/run-text-DvaO8LDF.js +0 -113
  104. package/dist/select-eNgZdZ30.js +0 -521
  105. package/dist/skeleton-6yk8Tdh5.js +0 -19
  106. package/dist/slider-DorDsoF8.js +0 -37
  107. package/dist/status-page-DAHiKM9P.js +0 -3286
  108. package/dist/switch-BqD0RH_G.js +0 -18
  109. package/dist/table-Q2-voLuw.js +0 -65
  110. package/dist/tabs-CSIucYFP.js +0 -57
  111. package/dist/theme-provider-BkRohQFU.js +0 -61
  112. package/dist/toggle-group-9Bs0Mm3r.js +0 -82
  113. package/dist/trpc-CvJUuUXp.js +0 -153
  114. package/dist/utils-CX-Pz5p6.js +0 -8
  115. package/dist/writability-BuH-spxv.js +0 -57
@@ -1,21 +1,15 @@
1
- import { r as e } from "./trpc-CvJUuUXp.js";
2
- import { f as t, h as n, m as r } from "./i18n-BgzakKoC.js";
3
- import { C as i, a, d as o, r as s, t as c, w as l } from "./mutation-form-validators-BNz5bsv1.js";
4
- import { t as u } from "./utils-CX-Pz5p6.js";
5
- import { B as d, H as f, L as p, V as m, Y as h, c as g, z as _ } from "./spinner-C-HPNxOc.js";
6
- import { t as v } from "./button-6SxPBYMz.js";
7
- import { a as y, i as b, l as x, o as S } from "./dialog-BIhQXcZC.js";
8
- import { t as C } from "./writability-BuH-spxv.js";
9
- import { r as w, t as T } from "./alert-B8MAoIO8.js";
10
- import { n as E, t as D } from "./date-time-picker-C3FhMXk6.js";
11
- import { n as O, t as k } from "./radio-group-CZGqVbkJ.js";
12
- import { a as A, o as j } from "./retention-BYXNpYmR.js";
1
+ import { Kn as e, Mn as t, Qn as n, Vn as r, dr as i, ii as a, ur as o, zn as s } from "./quick-report-DEqqwQxR.js";
2
+ import { f as c, h as l, m as u } from "./i18n-Dt6xbSK6.js";
3
+ import { H as d, K as f, Nt as p, U as m, V as h, jt as g, rt as _, tt as v } from "./alert-dialog-B60PF7S9.js";
4
+ import { B as y, H as b, L as x, V as S, Y as C, c as w, z as T } from "./spinner-BRcNKwjH.js";
5
+ import { M as E, j as D, v as O, y as k } from "./panel-BCwBlB_h.js";
6
+ import { a as A, o as j } from "./retention-DZ0reGGe.js";
13
7
  import { useMemo as M, useState as N } from "react";
14
8
  import { jsx as P, jsxs as F } from "react/jsx-runtime";
15
9
  import { ChevronDownIcon as I, ChevronRightIcon as L, FolderIcon as R, TriangleAlertIcon as z } from "lucide-react";
16
10
  import { appDateTimeToISOString as B, formatAppDateTime as V, resolveLocalized as H } from "@overvis/hmi-shared";
17
11
  import { STORAGE_ALARM_LOG_RETENTION_MIN_DAYS as U, STORAGE_AUDIT_RETENTION_MIN_DAYS as W, STORAGE_RETENTION_MAX_DAYS as G, retentionCutoffMs as K } from "@overvis/hmi-shared/workspace";
18
- //#region src/workspace/setup/parameters/tree/model.ts
12
+ // src/workspace/setup/parameters/tree/model.ts
19
13
  var q = [
20
14
  "pl-0",
21
15
  "pl-4",
@@ -72,7 +66,7 @@ function ee(e, t) {
72
66
  function te(e, t) {
73
67
  if (t.length === 0) return !0;
74
68
  let n = t.toLowerCase();
75
- return l(e.name, n) || l(e.mnemonic, n) ? !0 : e.tags.some((e) => e.toLowerCase().includes(n));
69
+ return i(e.name, n) || i(e.mnemonic, n) ? !0 : e.tags.some((e) => e.toLowerCase().includes(n));
76
70
  }
77
71
  function ne(e, t, n, r) {
78
72
  let i = /* @__PURE__ */ new Map();
@@ -94,46 +88,46 @@ function ne(e, t, n, r) {
94
88
  }
95
89
  function re(e, t) {
96
90
  let n = /* @__PURE__ */ new Map();
97
- for (let r of e) n.set(r.id, i(r, t));
91
+ for (let r of e) n.set(r.id, o(r, t));
98
92
  return n;
99
93
  }
100
94
  function ie(e) {
101
- let { branchesByParent: t, paramsByBranch: n, paramCountByBranchId: r, partsByParamId: i, effectiveExpanded: a, filterActive: o, matchingParamIds: s, ancestorsOfMatches: c } = e, l = [], u = (d, f) => {
102
- for (let p of t.get(d) ?? []) {
103
- if (c != null && !c.has(p.id)) continue;
104
- let d = t.get(p.id) ?? [], m = n.get(p.id) ?? [], h = s == null ? m : m.filter((e) => s.has(e.id)), g = d.length > 0 || m.length > 0, _ = e.locale;
105
- if (l.push({
95
+ let { branchesByParent: n, paramsByBranch: r, paramCountByBranchId: i, partsByParamId: a, effectiveExpanded: o, filterActive: s, matchingParamIds: c, ancestorsOfMatches: l } = e, u = [], d = (f, p) => {
96
+ for (let m of n.get(f) ?? []) {
97
+ if (l != null && !l.has(m.id)) continue;
98
+ let f = n.get(m.id) ?? [], h = r.get(m.id) ?? [], g = c == null ? h : h.filter((e) => c.has(e.id)), _ = f.length > 0 || h.length > 0, v = e.locale;
99
+ if (u.push({
106
100
  kind: "branch",
107
- id: p.id,
108
- name: H(p.name, _),
109
- depth: f,
110
- paramCount: r.get(p.id) ?? 0,
111
- hasChildren: g
112
- }), o || a.has(p.id)) {
113
- u(p.id, f + 1);
114
- for (let e of h) {
115
- let t = i.get(e.id);
116
- t != null && l.push({
101
+ id: m.id,
102
+ name: H(m.name, v),
103
+ depth: p,
104
+ paramCount: i.get(m.id) ?? 0,
105
+ hasChildren: _
106
+ }), s || o.has(m.id)) {
107
+ d(m.id, p + 1);
108
+ for (let e of g) {
109
+ let n = a.get(e.id);
110
+ n != null && u.push({
117
111
  kind: "param",
118
112
  id: e.id,
119
113
  branchId: e.branchId,
120
- depth: f + 1,
114
+ depth: p + 1,
121
115
  icon: e.icon,
122
- units: t.units,
116
+ units: n.units,
123
117
  disabled: e.disabledSince != null,
124
118
  backgroundReadingPeriodMs: e.backgroundReadingPeriodMs,
125
119
  deviceLog: e.deviceLog,
126
120
  lastReadingReceivedAt: e.lastReading?.receivedAt ?? null,
127
121
  nextReadingDueAt: e.nextReading?.nextDueAt ?? null,
128
- writable: C(e),
122
+ writable: t(e),
129
123
  valueType: e.valueType,
130
- parts: t
124
+ parts: n
131
125
  });
132
126
  }
133
127
  }
134
128
  }
135
129
  };
136
- return u(null, 0), l;
130
+ return d(null, 0), u;
137
131
  }
138
132
  function ae(e) {
139
133
  let t = [], n = (r) => {
@@ -166,8 +160,7 @@ function se(e, t, n) {
166
160
  branchCount: i.size
167
161
  };
168
162
  }
169
- //#endregion
170
- //#region src/workspace/setup/storage/dialogs.tsx
163
+ // src/workspace/setup/storage/dialogs.tsx
171
164
  function X(e) {
172
165
  return {
173
166
  readingsKeepDays: e.readingsKeepDays,
@@ -186,30 +179,30 @@ function Z(e, t) {
186
179
  return n >= t && n <= G ? n : null;
187
180
  }
188
181
  function ce(e) {
189
- return () => t("storage_days_invalid", {
182
+ return () => c("storage_days_invalid", {
190
183
  min: String(e),
191
184
  max: String(G)
192
185
  });
193
186
  }
194
187
  function Q() {
195
- let t = e.useUtils();
188
+ let e = a.useUtils();
196
189
  return async () => {
197
- await t.storage.invalidate();
190
+ await e.storage.invalidate();
198
191
  };
199
192
  }
200
- function le(t, n) {
201
- return e.storage.retentionPreview.useQuery({
202
- workspaceId: t,
203
- retention: n ?? X(de)
204
- }, { enabled: n != null });
193
+ function le(e, t) {
194
+ return a.storage.retentionPreview.useQuery({
195
+ workspaceId: e,
196
+ retention: t ?? X(de)
197
+ }, { enabled: t != null });
205
198
  }
206
199
  function $({ message: e, onRetry: t, retrying: n }) {
207
- let i = r();
208
- return /* @__PURE__ */ F(T, {
200
+ let r = u();
201
+ return /* @__PURE__ */ F(v, {
209
202
  variant: "destructive",
210
- children: [/* @__PURE__ */ P(z, {}), /* @__PURE__ */ F(w, {
203
+ children: [/* @__PURE__ */ P(z, {}), /* @__PURE__ */ F(_, {
211
204
  className: "flex flex-col items-start gap-2",
212
- children: [/* @__PURE__ */ P("span", { children: e }), /* @__PURE__ */ P(v, {
205
+ children: [/* @__PURE__ */ P("span", { children: e }), /* @__PURE__ */ P(g, {
213
206
  type: "button",
214
207
  size: "sm",
215
208
  variant: "outline",
@@ -217,33 +210,33 @@ function $({ message: e, onRetry: t, retrying: n }) {
217
210
  onClick: () => {
218
211
  t();
219
212
  },
220
- children: i("ui_notice_retry")
213
+ children: r("ui_notice_retry")
221
214
  })]
222
215
  })]
223
216
  });
224
217
  }
225
218
  function ue({ retention: e, preview: t }) {
226
- let i = r(), a = n();
219
+ let n = u(), r = l();
227
220
  if (e == null) return null;
228
221
  if (t.isError) return /* @__PURE__ */ P($, {
229
- message: i("storage_preview_failed"),
222
+ message: n("storage_preview_failed"),
230
223
  onRetry: () => t.refetch(),
231
224
  retrying: t.isFetching
232
225
  });
233
226
  if (t.data == null) return /* @__PURE__ */ P("p", {
234
227
  className: "text-sm text-muted-foreground",
235
- children: i("storage_preview_loading")
228
+ children: n("storage_preview_loading")
236
229
  });
237
- let { readingsRecords: o, auditRecords: s, alarmLogRecords: c } = t.data;
238
- return o === 0 && s === 0 && c === 0 ? /* @__PURE__ */ P("p", {
230
+ let { readingsRecords: i, auditRecords: a, alarmLogRecords: o } = t.data;
231
+ return i === 0 && a === 0 && o === 0 ? /* @__PURE__ */ P("p", {
239
232
  className: "text-sm text-muted-foreground",
240
- children: i("storage_preview_nothing")
241
- }) : /* @__PURE__ */ F(T, {
233
+ children: n("storage_preview_nothing")
234
+ }) : /* @__PURE__ */ F(v, {
242
235
  variant: "destructive",
243
- children: [/* @__PURE__ */ P(z, {}), /* @__PURE__ */ P(w, { children: i("storage_preview_removes", {
244
- readings: A(o, a),
245
- history: A(s, a),
246
- alarms: A(c, a)
236
+ children: [/* @__PURE__ */ P(z, {}), /* @__PURE__ */ P(_, { children: n("storage_preview_removes", {
237
+ readings: A(i, r),
238
+ history: A(a, r),
239
+ alarms: A(o, r)
247
240
  }) })]
248
241
  });
249
242
  }
@@ -253,58 +246,58 @@ var de = {
253
246
  alarmLogKeepDays: null,
254
247
  overrides: []
255
248
  };
256
- function fe({ idPrefix: e, keep: t, days: n, min: i, daysInvalid: a, onKeepChange: o, onDaysChange: s }) {
257
- let c = r();
258
- return /* @__PURE__ */ F(k, {
249
+ function fe({ idPrefix: e, keep: t, days: n, min: r, daysInvalid: i, onKeepChange: a, onDaysChange: o }) {
250
+ let s = u();
251
+ return /* @__PURE__ */ F(O, {
259
252
  value: t,
260
253
  onValueChange: (e) => {
261
- o(e === "days" ? "days" : "forever");
254
+ a(e === "days" ? "days" : "forever");
262
255
  },
263
256
  children: [
264
- /* @__PURE__ */ F(p, {
257
+ /* @__PURE__ */ F(x, {
265
258
  orientation: "horizontal",
266
- children: [/* @__PURE__ */ P(O, {
259
+ children: [/* @__PURE__ */ P(k, {
267
260
  value: "forever",
268
261
  id: `${e}-forever`
269
- }), /* @__PURE__ */ P(f, {
262
+ }), /* @__PURE__ */ P(b, {
270
263
  htmlFor: `${e}-forever`,
271
- children: c("storage_keep_forever")
264
+ children: s("storage_keep_forever")
272
265
  })]
273
266
  }),
274
- /* @__PURE__ */ F(p, {
267
+ /* @__PURE__ */ F(x, {
275
268
  orientation: "horizontal",
276
- children: [/* @__PURE__ */ P(O, {
269
+ children: [/* @__PURE__ */ P(k, {
277
270
  value: "days",
278
271
  id: `${e}-days`
279
- }), /* @__PURE__ */ P(f, {
272
+ }), /* @__PURE__ */ P(b, {
280
273
  htmlFor: `${e}-days`,
281
- children: c("storage_keep_for")
274
+ children: s("storage_keep_for")
282
275
  })]
283
276
  }),
284
- t === "days" ? /* @__PURE__ */ F(p, {
285
- "data-invalid": a ? !0 : void 0,
277
+ t === "days" ? /* @__PURE__ */ F(x, {
278
+ "data-invalid": i ? !0 : void 0,
286
279
  className: "pl-6",
287
280
  children: [
288
- /* @__PURE__ */ P(f, {
281
+ /* @__PURE__ */ P(b, {
289
282
  htmlFor: `${e}-days-input`,
290
- children: c("storage_days_field")
283
+ children: s("storage_days_field")
291
284
  }),
292
- /* @__PURE__ */ P(g, {
285
+ /* @__PURE__ */ P(w, {
293
286
  id: `${e}-days-input`,
294
287
  name: "days",
295
288
  inputMode: "numeric",
296
289
  className: "w-32",
297
290
  value: n,
298
291
  onChange: (e) => {
299
- s(e.target.value);
292
+ o(e.target.value);
300
293
  },
301
- "aria-invalid": a || void 0
294
+ "aria-invalid": i || void 0
302
295
  }),
303
- /* @__PURE__ */ P(_, { children: c("storage_days_hint", {
304
- min: String(i),
296
+ /* @__PURE__ */ P(T, { children: s("storage_days_hint", {
297
+ min: String(r),
305
298
  max: String(G)
306
299
  }) }),
307
- a ? /* @__PURE__ */ P(d, { errors: [{ message: ce(i)() }] }) : null
300
+ i ? /* @__PURE__ */ P(y, { errors: [{ message: ce(r)() }] }) : null
308
301
  ]
309
302
  }) : null
310
303
  ]
@@ -324,30 +317,30 @@ var pe = {
324
317
  field: "alarmLogKeepDays"
325
318
  }
326
319
  };
327
- function me({ workspaceId: t, kind: n, retention: i, onCancel: l, onDone: u }) {
328
- let d = r(), f = Q(), p = e.storage.setRetentionDefaults.useMutation(), { min: h, field: g } = pe[n], _ = i[g], [C, w] = N(_ == null ? "forever" : "days"), [T, E] = N(String(_ ?? 365)), D = C === "forever" ? null : Z(T, h), O = C === "days" && D == null ? null : {
329
- ...X(i),
330
- [g]: D
331
- }, k = le(t, O), A = O != null && k.isSuccess, j = a({
320
+ function me({ workspaceId: t, kind: i, retention: o, onCancel: c, onDone: l }) {
321
+ let p = u(), _ = Q(), v = a.storage.setRetentionDefaults.useMutation(), { min: y, field: b } = pe[i], x = o[b], [C, w] = N(x == null ? "forever" : "days"), [T, E] = N(String(x ?? 365)), D = C === "forever" ? null : Z(T, y), O = C === "days" && D == null ? null : {
322
+ ...X(o),
323
+ [b]: D
324
+ }, k = le(t, O), A = O != null && k.isSuccess, j = e({
332
325
  defaultValues: {},
333
- validators: c({ submit: async () => A ? (await p.mutateAsync({
326
+ validators: s({ submit: async () => A ? (await v.mutateAsync({
334
327
  workspaceId: t,
335
- [g]: D
336
- }), null) : s(() => d("storage_preview_required")) }),
337
- onSubmitInvalid: o,
328
+ [b]: D
329
+ }), null) : r(() => p("storage_preview_required")) }),
330
+ onSubmitInvalid: n,
338
331
  onSubmit: async () => {
339
- await f(), u();
332
+ await _(), l();
340
333
  }
341
334
  });
342
335
  return /* @__PURE__ */ P(j.AppForm, { children: /* @__PURE__ */ F(j.FormRoot, {
343
336
  layout: "dialog",
344
337
  children: [
345
- /* @__PURE__ */ F(S, { children: [/* @__PURE__ */ P(x, { children: d(n === "readings" ? "storage_readings_default_title" : n === "audit" ? "storage_history_retention_title" : "storage_alarm_log_retention_title") }), /* @__PURE__ */ P(b, { children: d(n === "readings" ? "storage_readings_default_description" : n === "audit" ? "storage_history_retention_description" : "storage_alarm_log_retention_description") })] }),
346
- /* @__PURE__ */ F(m, { children: [/* @__PURE__ */ P(fe, {
347
- idPrefix: `storage-${n}`,
338
+ /* @__PURE__ */ F(m, { children: [/* @__PURE__ */ P(f, { children: p(i === "readings" ? "storage_readings_default_title" : i === "audit" ? "storage_history_retention_title" : "storage_alarm_log_retention_title") }), /* @__PURE__ */ P(h, { children: p(i === "readings" ? "storage_readings_default_description" : i === "audit" ? "storage_history_retention_description" : "storage_alarm_log_retention_description") })] }),
339
+ /* @__PURE__ */ F(S, { children: [/* @__PURE__ */ P(fe, {
340
+ idPrefix: `storage-${i}`,
348
341
  keep: C,
349
342
  days: T,
350
- min: h,
343
+ min: y,
351
344
  daysInvalid: C === "days" && D == null,
352
345
  onKeepChange: w,
353
346
  onDaysChange: E
@@ -355,21 +348,21 @@ function me({ workspaceId: t, kind: n, retention: i, onCancel: l, onDone: u }) {
355
348
  retention: O,
356
349
  preview: k
357
350
  })] }),
358
- /* @__PURE__ */ F(y, { children: [/* @__PURE__ */ P(v, {
351
+ /* @__PURE__ */ F(d, { children: [/* @__PURE__ */ P(g, {
359
352
  type: "button",
360
353
  variant: "outline",
361
- onClick: l,
362
- children: d("action_cancel")
354
+ onClick: c,
355
+ children: p("action_cancel")
363
356
  }), /* @__PURE__ */ P(j.SubmitButton, {
364
- label: d("action_save"),
365
- pendingLabel: d("action_saving"),
357
+ label: p("action_save"),
358
+ pendingLabel: p("action_saving"),
366
359
  disabled: !A
367
360
  })] })
368
361
  ]
369
362
  }) });
370
363
  }
371
- function he({ tree: e, value: t, taken: i, onChange: a }) {
372
- let o = r(), s = n(), [c, l] = N(() => /* @__PURE__ */ new Set()), [d, f] = N(""), p = M(() => {
364
+ function he({ tree: e, value: t, taken: n, onChange: r }) {
365
+ let i = u(), a = l(), [o, s] = N(() => /* @__PURE__ */ new Set()), [c, d] = N(""), f = M(() => {
373
366
  let t = /* @__PURE__ */ new Map();
374
367
  for (let n of e.branches) t.set(n.parentId, [...t.get(n.parentId) ?? [], n]);
375
368
  let n = /* @__PURE__ */ new Map();
@@ -379,34 +372,34 @@ function he({ tree: e, value: t, taken: i, onChange: a }) {
379
372
  parameters: n
380
373
  };
381
374
  }, [e]), m = /* @__PURE__ */ new Set([...t.parameterIds, ...t.branchIds]);
382
- function _(e, n, r) {
383
- let i = e === "parameter" ? "parameterIds" : "branchIds", o = t[i].filter((e) => e !== n);
384
- a({
375
+ function h(e, n, i) {
376
+ let a = e === "parameter" ? "parameterIds" : "branchIds", o = t[a].filter((e) => e !== n);
377
+ r({
385
378
  ...t,
386
- [i]: r ? [...o, n] : o
379
+ [a]: i ? [...o, n] : o
387
380
  });
388
381
  }
389
- function v(e, t, n, r) {
390
- let a = i.has(t), s = c.has(t);
382
+ function g(e, t, r, a) {
383
+ let l = n.has(t), u = o.has(t);
391
384
  return /* @__PURE__ */ F("li", {
392
- className: u("flex items-center gap-2 py-1", J(r)),
385
+ className: p("flex items-center gap-2 py-1", J(a)),
393
386
  children: [
394
- e === "branch" && d === "" ? /* @__PURE__ */ P("button", {
387
+ e === "branch" && c === "" ? /* @__PURE__ */ P("button", {
395
388
  type: "button",
396
389
  className: "text-muted-foreground",
397
- "aria-label": o(s ? "storage_picker_collapse" : "storage_picker_expand"),
390
+ "aria-label": i(u ? "storage_picker_collapse" : "storage_picker_expand"),
398
391
  onClick: () => {
399
- let e = new Set(c);
400
- s ? e.delete(t) : e.add(t), l(e);
392
+ let e = new Set(o);
393
+ u ? e.delete(t) : e.add(t), s(e);
401
394
  },
402
- children: P(s ? I : L, { className: "size-4" })
395
+ children: P(u ? I : L, { className: "size-4" })
403
396
  }) : /* @__PURE__ */ P("span", { className: "size-4 shrink-0" }),
404
- /* @__PURE__ */ P(h, {
397
+ /* @__PURE__ */ P(C, {
405
398
  id: `storage-target-${t}`,
406
399
  checked: m.has(t),
407
- disabled: a,
400
+ disabled: l,
408
401
  onCheckedChange: (n) => {
409
- _(e, t, n);
402
+ h(e, t, n);
410
403
  }
411
404
  }),
412
405
  /* @__PURE__ */ F("label", {
@@ -416,74 +409,74 @@ function he({ tree: e, value: t, taken: i, onChange: a }) {
416
409
  e === "branch" ? /* @__PURE__ */ P(R, { className: "size-4 shrink-0 text-muted-foreground" }) : null,
417
410
  /* @__PURE__ */ P("span", {
418
411
  className: "truncate",
419
- children: n
412
+ children: r
420
413
  }),
421
- a ? /* @__PURE__ */ P("span", {
414
+ l ? /* @__PURE__ */ P("span", {
422
415
  className: "shrink-0 text-xs text-muted-foreground",
423
- children: o("storage_picker_taken")
416
+ children: i("storage_picker_taken")
424
417
  }) : null
425
418
  ]
426
419
  })
427
420
  ]
428
421
  }, t);
429
422
  }
430
- function y(e, t) {
431
- return (p.branches.get(e) ?? []).flatMap((e) => [v("branch", e.id, H(e.name, s), t), ...c.has(e.id) ? [...y(e.id, t + 1), ...(p.parameters.get(e.id) ?? []).map((e) => v("parameter", e.id, H(e.name, s), t + 1))] : []]);
423
+ function _(e, t) {
424
+ return (f.branches.get(e) ?? []).flatMap((e) => [g("branch", e.id, H(e.name, a), t), ...o.has(e.id) ? [..._(e.id, t + 1), ...(f.parameters.get(e.id) ?? []).map((e) => g("parameter", e.id, H(e.name, a), t + 1))] : []]);
432
425
  }
433
- let b = d.trim().toLocaleLowerCase(s), x = b === "" ? y(null, 0) : [...e.branches.map((e) => ({
426
+ let v = c.trim().toLocaleLowerCase(a), y = v === "" ? _(null, 0) : [...e.branches.map((e) => ({
434
427
  kind: "branch",
435
428
  item: e
436
429
  })), ...e.parameters.map((e) => ({
437
430
  kind: "parameter",
438
431
  item: e
439
- }))].filter(({ item: e }) => H(e.name, s).toLocaleLowerCase(s).includes(b)).map(({ kind: e, item: t }) => v(e, t.id, H(t.name, s), 0));
432
+ }))].filter(({ item: e }) => H(e.name, a).toLocaleLowerCase(a).includes(v)).map(({ kind: e, item: t }) => g(e, t.id, H(t.name, a), 0));
440
433
  return /* @__PURE__ */ F("div", {
441
434
  className: "flex flex-col gap-2",
442
- children: [/* @__PURE__ */ P(g, {
443
- value: d,
444
- placeholder: o("storage_picker_filter"),
435
+ children: [/* @__PURE__ */ P(w, {
436
+ value: c,
437
+ placeholder: i("storage_picker_filter"),
445
438
  onChange: (e) => {
446
- f(e.target.value);
439
+ d(e.target.value);
447
440
  }
448
441
  }), /* @__PURE__ */ P("ul", {
449
442
  className: "max-h-64 overflow-y-auto rounded-md border p-2",
450
- children: x.length === 0 ? /* @__PURE__ */ P("li", {
443
+ children: y.length === 0 ? /* @__PURE__ */ P("li", {
451
444
  className: "py-1 text-sm text-muted-foreground",
452
- children: o("storage_picker_empty")
453
- }) : x
445
+ children: i("storage_picker_empty")
446
+ }) : y
454
447
  })]
455
448
  });
456
449
  }
457
- function ge({ workspaceId: t, retention: n, override: i, tree: l, onCancel: u, onDone: d }) {
458
- let h = r(), g = Q(), C = e.storage.saveRetentionOverride.useMutation(), w = M(() => /* @__PURE__ */ new Set([...l.parameters.map((e) => e.id), ...l.branches.map((e) => e.id)]), [l]), T = M(() => new Set(n.overrides.filter((e) => e.id !== i?.id).flatMap((e) => [...e.parameterIds, ...e.branchIds])), [i?.id, n.overrides]), [E, D] = N(i == null || i.keepDays != null ? "days" : "forever"), [O, k] = N(String(i?.keepDays ?? 30)), [A, j] = N(() => ({
459
- parameterIds: (i?.parameterIds ?? []).filter((e) => w.has(e)),
460
- branchIds: (i?.branchIds ?? []).filter((e) => w.has(e))
461
- })), I = E === "forever" ? null : Z(O, 1), L = A.parameterIds.length + A.branchIds.length > 0, R = X(n).overrides.filter((e, t) => n.overrides[t]?.id !== i?.id), z = E === "days" && I == null || !L ? null : {
462
- ...X(n),
450
+ function ge({ workspaceId: t, retention: i, override: o, tree: c, onCancel: l, onDone: p }) {
451
+ let _ = u(), v = Q(), y = a.storage.saveRetentionOverride.useMutation(), C = M(() => /* @__PURE__ */ new Set([...c.parameters.map((e) => e.id), ...c.branches.map((e) => e.id)]), [c]), w = M(() => new Set(i.overrides.filter((e) => e.id !== o?.id).flatMap((e) => [...e.parameterIds, ...e.branchIds])), [o?.id, i.overrides]), [E, D] = N(o == null || o.keepDays != null ? "days" : "forever"), [O, k] = N(String(o?.keepDays ?? 30)), [A, j] = N(() => ({
452
+ parameterIds: (o?.parameterIds ?? []).filter((e) => C.has(e)),
453
+ branchIds: (o?.branchIds ?? []).filter((e) => C.has(e))
454
+ })), I = E === "forever" ? null : Z(O, 1), L = A.parameterIds.length + A.branchIds.length > 0, R = X(i).overrides.filter((e, t) => i.overrides[t]?.id !== o?.id), z = E === "days" && I == null || !L ? null : {
455
+ ...X(i),
463
456
  overrides: [...R, {
464
457
  keepDays: I,
465
458
  parameterIds: [...A.parameterIds],
466
459
  branchIds: [...A.branchIds]
467
460
  }]
468
- }, B = le(t, z), V = z != null && B.isSuccess, H = a({
461
+ }, B = le(t, z), V = z != null && B.isSuccess, H = e({
469
462
  defaultValues: {},
470
- validators: c({ submit: async () => L ? V ? (await C.mutateAsync({
463
+ validators: s({ submit: async () => L ? V ? (await y.mutateAsync({
471
464
  workspaceId: t,
472
- ...i == null ? {} : { overrideId: i.id },
465
+ ...o == null ? {} : { overrideId: o.id },
473
466
  keepDays: I,
474
467
  parameterIds: [...A.parameterIds],
475
468
  branchIds: [...A.branchIds]
476
- }), null) : s(() => h("storage_preview_required")) : s(() => h("error_storage_override_empty")) }),
477
- onSubmitInvalid: o,
469
+ }), null) : r(() => _("storage_preview_required")) : r(() => _("error_storage_override_empty")) }),
470
+ onSubmitInvalid: n,
478
471
  onSubmit: async () => {
479
- await g(), d();
472
+ await v(), p();
480
473
  }
481
474
  });
482
475
  return /* @__PURE__ */ P(H.AppForm, { children: /* @__PURE__ */ F(H.FormRoot, {
483
476
  layout: "dialog",
484
477
  children: [
485
- /* @__PURE__ */ F(S, { children: [/* @__PURE__ */ P(x, { children: h(i == null ? "storage_rule_create_title" : "storage_rule_edit_title") }), /* @__PURE__ */ P(b, { children: h("storage_rule_description") })] }),
486
- /* @__PURE__ */ F(m, { children: [
478
+ /* @__PURE__ */ F(m, { children: [/* @__PURE__ */ P(f, { children: _(o == null ? "storage_rule_create_title" : "storage_rule_edit_title") }), /* @__PURE__ */ P(h, { children: _("storage_rule_description") })] }),
479
+ /* @__PURE__ */ F(S, { children: [
487
480
  /* @__PURE__ */ P(fe, {
488
481
  idPrefix: "storage-rule",
489
482
  keep: E,
@@ -493,56 +486,56 @@ function ge({ workspaceId: t, retention: n, override: i, tree: l, onCancel: u, o
493
486
  onKeepChange: D,
494
487
  onDaysChange: k
495
488
  }),
496
- /* @__PURE__ */ F(p, { children: [
497
- /* @__PURE__ */ P(f, { children: h("storage_rule_targets") }),
489
+ /* @__PURE__ */ F(x, { children: [
490
+ /* @__PURE__ */ P(b, { children: _("storage_rule_targets") }),
498
491
  /* @__PURE__ */ P(he, {
499
- tree: l,
492
+ tree: c,
500
493
  value: A,
501
- taken: T,
494
+ taken: w,
502
495
  onChange: j
503
496
  }),
504
- /* @__PURE__ */ P(_, { children: h("storage_rule_targets_hint") })
497
+ /* @__PURE__ */ P(T, { children: _("storage_rule_targets_hint") })
505
498
  ] }),
506
499
  /* @__PURE__ */ P(ue, {
507
500
  retention: z,
508
501
  preview: B
509
502
  })
510
503
  ] }),
511
- /* @__PURE__ */ F(y, { children: [/* @__PURE__ */ P(v, {
504
+ /* @__PURE__ */ F(d, { children: [/* @__PURE__ */ P(g, {
512
505
  type: "button",
513
506
  variant: "outline",
514
- onClick: u,
515
- children: h("action_cancel")
507
+ onClick: l,
508
+ children: _("action_cancel")
516
509
  }), /* @__PURE__ */ P(H.SubmitButton, {
517
- label: h("action_save"),
518
- pendingLabel: h("action_saving"),
510
+ label: _("action_save"),
511
+ pendingLabel: _("action_saving"),
519
512
  disabled: !V
520
513
  })] })
521
514
  ]
522
515
  }) });
523
516
  }
524
- function _e({ workspaceId: t, override: n, onCancel: i, onDone: s }) {
525
- let l = r(), u = Q(), d = e.storage.deleteRetentionOverride.useMutation(), f = a({
517
+ function _e({ workspaceId: t, override: r, onCancel: i, onDone: o }) {
518
+ let c = u(), l = Q(), p = a.storage.deleteRetentionOverride.useMutation(), _ = e({
526
519
  defaultValues: {},
527
- validators: c({ submit: async () => (await d.mutateAsync({
520
+ validators: s({ submit: async () => (await p.mutateAsync({
528
521
  workspaceId: t,
529
- overrideId: n.id
522
+ overrideId: r.id
530
523
  }), null) }),
531
- onSubmitInvalid: o,
524
+ onSubmitInvalid: n,
532
525
  onSubmit: async () => {
533
- await u(), s();
526
+ await l(), o();
534
527
  }
535
528
  });
536
- return /* @__PURE__ */ P(f.AppForm, { children: /* @__PURE__ */ F(f.FormRoot, {
529
+ return /* @__PURE__ */ P(_.AppForm, { children: /* @__PURE__ */ F(_.FormRoot, {
537
530
  layout: "dialog",
538
- children: [/* @__PURE__ */ F(S, { children: [/* @__PURE__ */ P(x, { children: l("storage_rule_delete_title") }), /* @__PURE__ */ P(b, { children: l("storage_rule_delete_description", { keep: j(n.keepDays) }) })] }), /* @__PURE__ */ F(y, { children: [/* @__PURE__ */ P(v, {
531
+ children: [/* @__PURE__ */ F(m, { children: [/* @__PURE__ */ P(f, { children: c("storage_rule_delete_title") }), /* @__PURE__ */ P(h, { children: c("storage_rule_delete_description", { keep: j(r.keepDays) }) })] }), /* @__PURE__ */ F(d, { children: [/* @__PURE__ */ P(g, {
539
532
  type: "button",
540
533
  variant: "outline",
541
534
  onClick: i,
542
- children: l("action_cancel")
543
- }), /* @__PURE__ */ P(f.SubmitButton, {
544
- label: l("storage_rule_delete_submit"),
545
- pendingLabel: l("action_deleting"),
535
+ children: c("action_cancel")
536
+ }), /* @__PURE__ */ P(_.SubmitButton, {
537
+ label: c("storage_rule_delete_submit"),
538
+ pendingLabel: c("action_deleting"),
546
539
  variant: "destructive"
547
540
  })] })]
548
541
  }) });
@@ -572,91 +565,91 @@ function ve(e, t, n) {
572
565
  to: s
573
566
  } : null;
574
567
  }
575
- function ye({ workspaceId: t, scope: i, onCancel: l, onStarted: u }) {
576
- let d = r(), h = n(), g = e.storage.deleteReadings.useMutation(), [_, C] = N(i.kind === "workspace" ? "before" : "all"), [j, M] = N(""), [I, L] = N({
568
+ function ye({ workspaceId: t, scope: i, onCancel: o, onStarted: c }) {
569
+ let p = u(), y = l(), C = a.storage.deleteReadings.useMutation(), [w, T] = N(i.kind === "workspace" ? "before" : "all"), [j, M] = N(""), [I, L] = N({
577
570
  from: "",
578
571
  to: ""
579
572
  }), R = ve(t, i, {
580
- range: _,
573
+ range: w,
581
574
  before: j,
582
575
  ...I
583
- }), B = e.storage.readingsDeletePreview.useQuery(R ?? {
576
+ }), B = a.storage.readingsDeletePreview.useQuery(R ?? {
584
577
  workspaceId: t,
585
578
  scope: { kind: "workspace" }
586
- }, { enabled: R != null }), V = a({
579
+ }, { enabled: R != null }), V = e({
587
580
  defaultValues: {},
588
- validators: c({ submit: async () => {
589
- if (R == null || U == null || !B.isSuccess) return s(() => d("storage_delete_range_invalid"));
590
- let { jobId: e } = await g.mutateAsync({
581
+ validators: s({ submit: async () => {
582
+ if (R == null || U == null || !B.isSuccess) return r(() => p("storage_delete_range_invalid"));
583
+ let { jobId: e } = await C.mutateAsync({
591
584
  ...R,
592
585
  to: B.data.until
593
586
  });
594
- return u(e), null;
587
+ return c(e), null;
595
588
  } }),
596
- onSubmitInvalid: o
589
+ onSubmitInvalid: n
597
590
  }), H = R?.from != null && B.isSuccess && B.data.until <= R.from, U = R != null && B.isSuccess && !H ? B.data.records : null;
598
591
  return /* @__PURE__ */ P(V.AppForm, { children: /* @__PURE__ */ F(V.FormRoot, {
599
592
  layout: "dialog",
600
593
  children: [
601
- /* @__PURE__ */ F(S, { children: [/* @__PURE__ */ P(x, { children: i.kind === "workspace" ? d("storage_delete_readings_workspace_title") : d("storage_delete_readings_title", { name: i.label }) }), /* @__PURE__ */ P(b, { children: d("storage_delete_readings_description") })] }),
602
- /* @__PURE__ */ F(m, { children: [
603
- /* @__PURE__ */ P(k, {
604
- value: _,
594
+ /* @__PURE__ */ F(m, { children: [/* @__PURE__ */ P(f, { children: i.kind === "workspace" ? p("storage_delete_readings_workspace_title") : p("storage_delete_readings_title", { name: i.label }) }), /* @__PURE__ */ P(h, { children: p("storage_delete_readings_description") })] }),
595
+ /* @__PURE__ */ F(S, { children: [
596
+ /* @__PURE__ */ P(O, {
597
+ value: w,
605
598
  onValueChange: (e) => {
606
- C(e === "all" ? "all" : e === "between" ? "between" : "before");
599
+ T(e === "all" ? "all" : e === "between" ? "between" : "before");
607
600
  },
608
601
  children: [
609
602
  "before",
610
603
  "between",
611
604
  "all"
612
- ].map((e) => /* @__PURE__ */ F(p, {
605
+ ].map((e) => /* @__PURE__ */ F(x, {
613
606
  orientation: "horizontal",
614
- children: [/* @__PURE__ */ P(O, {
607
+ children: [/* @__PURE__ */ P(k, {
615
608
  value: e,
616
609
  id: `storage-delete-${e}`
617
- }), /* @__PURE__ */ P(f, {
610
+ }), /* @__PURE__ */ P(b, {
618
611
  htmlFor: `storage-delete-${e}`,
619
- children: d(e === "before" ? "storage_delete_range_before" : e === "between" ? "storage_delete_range_between" : "storage_delete_range_all")
612
+ children: p(e === "before" ? "storage_delete_range_before" : e === "between" ? "storage_delete_range_between" : "storage_delete_range_all")
620
613
  })]
621
614
  }, e))
622
615
  }),
623
- _ === "before" ? /* @__PURE__ */ F(p, { children: [/* @__PURE__ */ P(f, {
616
+ w === "before" ? /* @__PURE__ */ F(x, { children: [/* @__PURE__ */ P(b, {
624
617
  htmlFor: "storage-delete-before-date",
625
- children: d("storage_delete_before_field")
618
+ children: p("storage_delete_before_field")
626
619
  }), /* @__PURE__ */ P(D, {
627
620
  id: "storage-delete-before-date",
628
621
  value: j,
629
622
  onValueChange: M
630
- })] }) : _ === "between" ? /* @__PURE__ */ F(p, { children: [/* @__PURE__ */ P(f, { children: d("storage_delete_between_field") }), /* @__PURE__ */ P(E, {
623
+ })] }) : w === "between" ? /* @__PURE__ */ F(x, { children: [/* @__PURE__ */ P(b, { children: p("storage_delete_between_field") }), /* @__PURE__ */ P(E, {
631
624
  value: I,
632
625
  onValueChange: L
633
626
  })] }) : null,
634
627
  H ? /* @__PURE__ */ P("p", {
635
628
  className: "text-sm text-muted-foreground",
636
- children: d("storage_delete_preview_nothing")
629
+ children: p("storage_delete_preview_nothing")
637
630
  }) : R != null && B.isError ? /* @__PURE__ */ P($, {
638
- message: d("storage_delete_preview_failed"),
631
+ message: p("storage_delete_preview_failed"),
639
632
  onRetry: () => B.refetch(),
640
633
  retrying: B.isFetching
641
634
  }) : U == null ? null : U === 0 ? /* @__PURE__ */ P("p", {
642
635
  className: "text-sm text-muted-foreground",
643
- children: d("storage_delete_preview_cleanup")
644
- }) : /* @__PURE__ */ F(T, {
636
+ children: p("storage_delete_preview_cleanup")
637
+ }) : /* @__PURE__ */ F(v, {
645
638
  variant: "destructive",
646
- children: [/* @__PURE__ */ P(z, {}), /* @__PURE__ */ P(w, { children: d("storage_delete_preview", {
647
- records: A(U, h),
648
- parameters: A(B.data?.parameters ?? 0, h)
639
+ children: [/* @__PURE__ */ P(z, {}), /* @__PURE__ */ P(_, { children: p("storage_delete_preview", {
640
+ records: A(U, y),
641
+ parameters: A(B.data?.parameters ?? 0, y)
649
642
  }) })]
650
643
  })
651
644
  ] }),
652
- /* @__PURE__ */ F(y, { children: [/* @__PURE__ */ P(v, {
645
+ /* @__PURE__ */ F(d, { children: [/* @__PURE__ */ P(g, {
653
646
  type: "button",
654
647
  variant: "outline",
655
- onClick: l,
656
- children: d("action_cancel")
648
+ onClick: o,
649
+ children: p("action_cancel")
657
650
  }), /* @__PURE__ */ P(V.SubmitButton, {
658
- label: d("storage_delete_submit"),
659
- pendingLabel: d("action_deleting"),
651
+ label: p("storage_delete_submit"),
652
+ pendingLabel: p("action_deleting"),
660
653
  variant: "destructive",
661
654
  disabled: U == null
662
655
  })] })
@@ -666,65 +659,64 @@ function ye({ workspaceId: t, scope: i, onCancel: l, onStarted: u }) {
666
659
  function be(e) {
667
660
  return new Date(K(pe[e].min, Date.now()));
668
661
  }
669
- function xe({ workspaceId: t, kind: i, onCancel: l, onStarted: u }) {
670
- let h = r(), g = n(), C = e.storage.deleteHistory.useMutation(), E = e.storage.deleteAlarmLog.useMutation(), O = M(() => be(i), [i]), [k, j] = N(() => V(O)), I = B(k), L = I != null && Date.parse(I) > O.getTime(), R = {
662
+ function xe({ workspaceId: t, kind: i, onCancel: o, onStarted: c }) {
663
+ let p = u(), C = l(), w = a.storage.deleteHistory.useMutation(), E = a.storage.deleteAlarmLog.useMutation(), O = M(() => be(i), [i]), [k, j] = N(() => V(O)), I = B(k), L = I != null && Date.parse(I) > O.getTime(), R = {
671
664
  workspaceId: t,
672
665
  before: I ?? O.toISOString()
673
- }, H = I != null && !L, U = e.storage.historyDeletePreview.useQuery(R, { enabled: H && i === "audit" }), W = e.storage.alarmLogDeletePreview.useQuery(R, { enabled: H && i === "alarm_log" }), G = i === "audit" ? U : W, K = h(i === "audit" ? "error_storage_history_too_recent" : "error_storage_alarm_log_too_recent"), q = a({
666
+ }, H = I != null && !L, U = a.storage.historyDeletePreview.useQuery(R, { enabled: H && i === "audit" }), W = a.storage.alarmLogDeletePreview.useQuery(R, { enabled: H && i === "alarm_log" }), G = i === "audit" ? U : W, K = p(i === "audit" ? "error_storage_history_too_recent" : "error_storage_alarm_log_too_recent"), q = e({
674
667
  defaultValues: {},
675
- validators: c({ submit: async () => {
676
- if (I == null || L || J == null) return s(() => K);
677
- let { jobId: e } = await (i === "audit" ? C : E).mutateAsync({
668
+ validators: s({ submit: async () => {
669
+ if (I == null || L || J == null) return r(() => K);
670
+ let { jobId: e } = await (i === "audit" ? w : E).mutateAsync({
678
671
  workspaceId: t,
679
672
  before: I
680
673
  });
681
- return u(e), null;
674
+ return c(e), null;
682
675
  } }),
683
- onSubmitInvalid: o
676
+ onSubmitInvalid: n
684
677
  }), J = H && G.isSuccess ? G.data.records : null;
685
678
  return /* @__PURE__ */ P(q.AppForm, { children: /* @__PURE__ */ F(q.FormRoot, {
686
679
  layout: "dialog",
687
680
  children: [
688
- /* @__PURE__ */ F(S, { children: [/* @__PURE__ */ P(x, { children: h(i === "audit" ? "storage_delete_history_title" : "storage_delete_alarm_log_title") }), /* @__PURE__ */ P(b, { children: h(i === "audit" ? "storage_delete_history_description" : "storage_delete_alarm_log_description") })] }),
689
- /* @__PURE__ */ F(m, { children: [/* @__PURE__ */ F(p, {
681
+ /* @__PURE__ */ F(m, { children: [/* @__PURE__ */ P(f, { children: p(i === "audit" ? "storage_delete_history_title" : "storage_delete_alarm_log_title") }), /* @__PURE__ */ P(h, { children: p(i === "audit" ? "storage_delete_history_description" : "storage_delete_alarm_log_description") })] }),
682
+ /* @__PURE__ */ F(S, { children: [/* @__PURE__ */ F(x, {
690
683
  "data-invalid": L ? !0 : void 0,
691
684
  children: [
692
- /* @__PURE__ */ P(f, {
685
+ /* @__PURE__ */ P(b, {
693
686
  htmlFor: "storage-history-before",
694
- children: h("storage_delete_before_field")
687
+ children: p("storage_delete_before_field")
695
688
  }),
696
689
  /* @__PURE__ */ P(D, {
697
690
  id: "storage-history-before",
698
691
  value: k,
699
692
  onValueChange: j
700
693
  }),
701
- /* @__PURE__ */ P(_, { children: h("storage_delete_history_hint", { latest: V(O) }) }),
702
- L ? /* @__PURE__ */ P(d, { errors: [{ message: K }] }) : null
694
+ /* @__PURE__ */ P(T, { children: p("storage_delete_history_hint", { latest: V(O) }) }),
695
+ L ? /* @__PURE__ */ P(y, { errors: [{ message: K }] }) : null
703
696
  ]
704
697
  }), H && G.isError ? /* @__PURE__ */ P($, {
705
- message: h("storage_delete_preview_failed"),
698
+ message: p("storage_delete_preview_failed"),
706
699
  onRetry: () => G.refetch(),
707
700
  retrying: G.isFetching
708
701
  }) : J == null ? null : J === 0 ? /* @__PURE__ */ P("p", {
709
702
  className: "text-sm text-muted-foreground",
710
- children: h("storage_delete_preview_nothing")
711
- }) : /* @__PURE__ */ F(T, {
703
+ children: p("storage_delete_preview_nothing")
704
+ }) : /* @__PURE__ */ F(v, {
712
705
  variant: "destructive",
713
- children: [/* @__PURE__ */ P(z, {}), /* @__PURE__ */ P(w, { children: h(i === "audit" ? "storage_delete_history_preview" : "storage_delete_alarm_log_preview", { records: A(J, g) }) })]
706
+ children: [/* @__PURE__ */ P(z, {}), /* @__PURE__ */ P(_, { children: p(i === "audit" ? "storage_delete_history_preview" : "storage_delete_alarm_log_preview", { records: A(J, C) }) })]
714
707
  })] }),
715
- /* @__PURE__ */ F(y, { children: [/* @__PURE__ */ P(v, {
708
+ /* @__PURE__ */ F(d, { children: [/* @__PURE__ */ P(g, {
716
709
  type: "button",
717
710
  variant: "outline",
718
- onClick: l,
719
- children: h("action_cancel")
711
+ onClick: o,
712
+ children: p("action_cancel")
720
713
  }), /* @__PURE__ */ P(q.SubmitButton, {
721
- label: h("storage_delete_submit"),
722
- pendingLabel: h("action_deleting"),
714
+ label: p("storage_delete_submit"),
715
+ pendingLabel: p("action_deleting"),
723
716
  variant: "destructive",
724
717
  disabled: J == null || J === 0
725
718
  })] })
726
719
  ]
727
720
  }) });
728
721
  }
729
- //#endregion
730
722
  export { ge as a, ee as c, se as d, Y as f, J as h, me as i, ie as l, te as m, ye as n, ne as o, oe as p, _e as r, re as s, xe as t, ae as u };