@overvis/hmi-workspace-ui 0.1.0 → 0.1.2

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 (130) hide show
  1. package/dist/alarm-list-DKFio0hg.js +414 -0
  2. package/dist/alarm-rule-dialog-mb4_nHRW.js +417 -0
  3. package/dist/{alarm-rule-lists-C5v1Kf7A.js → alarm-rule-lists-CfZXTWkK.js} +123 -125
  4. package/dist/{alarm-rules-page-CqFzofPd.js → alarm-rules-page-DBLSkrrG.js} +15 -18
  5. package/dist/alert-dialog-D_iDv2lQ.js +891 -0
  6. package/dist/{base-revision-YCO27zR4.js → base-revision-DLF9EnGV.js} +26 -29
  7. package/dist/{breadcrumbs-0cjsV2cq.js → breadcrumbs-D5R6Fz74.js} +6 -7
  8. package/dist/{catalog-list-DjZojYLJ.js → catalog-list-BkWosvh1.js} +2 -4
  9. package/dist/{code-editor-BVimvjDV.js → code-editor-DCM0KdMJ.js} +9 -6
  10. package/dist/dashboard-bindings.js +1 -2
  11. package/dist/{dashboards-page-BlrJguNz.js → dashboards-page-DLc11Vzu.js} +335 -359
  12. package/dist/{de-14WdmJxZ.js → de-Z2er-E5v.js} +4 -2
  13. package/dist/diagnostic-text-CYZFPiND.js +116 -0
  14. package/dist/{dialogs-D_v1LeH4.js → dialogs-BX023zml.js} +2523 -2590
  15. package/dist/{dialogs-B6BRnf3Q.js → dialogs-DEOg9lxy.js} +219 -227
  16. package/dist/{display-DmOo23mi.js → display-VYGzneE0.js} +4 -6
  17. package/dist/{editor-language-To9MxloY.js → editor-language-CGENZxbI.js} +3 -5
  18. package/dist/editor-page-CaN52OQh.js +1337 -0
  19. package/dist/{en-BgercpT0.js → en-CKPPL6bQ.js} +4 -2
  20. package/dist/entity-controls-DJT47yeV.js +71 -0
  21. package/dist/errors-BAWoH_5w.js +25 -0
  22. package/dist/{footer-DC-Q0052.js → footer-CbPMP8aq.js} +2404 -2515
  23. package/dist/host.js +8254 -675
  24. package/dist/{i18n-BgzakKoC.js → i18n-ChjEbYEg.js} +77 -90
  25. package/dist/i18n.js +1 -2
  26. package/dist/index.js +5168 -5353
  27. package/dist/{lat-lng-B12P7QyY.js → lat-lng-Bl77AGSO.js} +1 -2
  28. package/dist/{list-page-CvsdZb86.js → list-page-Fa29SkaJ.js} +116 -123
  29. package/dist/{location-map-renderer-DO5yfdSU.js → location-map-renderer-DvXIYc1Z.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-V_0K0lO0.js} +54 -58
  33. package/dist/page-B5te_1Lc.js +449 -0
  34. package/dist/{page-v6LCwswN.js → page-BorlLnMX.js} +92 -100
  35. package/dist/page-DxF7FOve.js +507 -0
  36. package/dist/panel-DuZD-cBP.js +949 -0
  37. package/dist/parameter-values.js +3 -16
  38. package/dist/{pl-lQ9HXV9k.js → pl-DVABrn5G.js} +4 -2
  39. package/dist/presence-code-DsabLTZs.js +73 -0
  40. package/dist/{query-gate-DVhNIkge.js → query-gate-BbIo1Xrj.js} +6 -6
  41. package/dist/{provider-DoEpKcQ-.js → quick-report-BcZsfkCZ.js} +9423 -5102
  42. package/dist/{retention-BYXNpYmR.js → retention-C7EZsq8u.js} +4 -6
  43. package/dist/retention-note-CmMeHV_u.js +40 -0
  44. package/dist/{rolldown-runtime-Dy4uBu1J.js → rolldown-runtime-CGnMp29N.js} +1 -2
  45. package/dist/{ru-qTKINoUj.js → ru-CBRLC_xM.js} +8 -6
  46. package/dist/run-text-CDdfbKbg.js +112 -0
  47. package/dist/{search-D4rDnE9T.js → search-C6xQ_Hvo.js} +26 -29
  48. package/dist/{sections-kCOyc4NR.js → sections-D_SBfVzV.js} +2 -3
  49. package/dist/{select-BKiOWdSr.js → select-nNLG-AMz.js} +17 -23
  50. package/dist/{spinner-C-HPNxOc.js → spinner-B-KLtBjp.js} +182 -201
  51. package/dist/src/code-editor/code-editor.d.ts +3 -0
  52. package/dist/src/code-editor/taskfile-language.d.ts +22 -2
  53. package/dist/src/i18n/catalogs/de/edge-program.d.ts +3 -0
  54. package/dist/src/i18n/catalogs/de.d.ts +3 -0
  55. package/dist/src/i18n/catalogs/en/edge-program.d.ts +3 -0
  56. package/dist/src/i18n/catalogs/en.d.ts +3 -0
  57. package/dist/src/i18n/catalogs/pl/edge-program.d.ts +3 -0
  58. package/dist/src/i18n/catalogs/pl.d.ts +3 -0
  59. package/dist/src/i18n/catalogs/ru/edge-program.d.ts +5 -2
  60. package/dist/src/i18n/catalogs/ru/graphics.d.ts +2 -2
  61. package/dist/src/i18n/catalogs/ru.d.ts +7 -4
  62. package/dist/src/i18n/catalogs/uk/edge-program.d.ts +5 -2
  63. package/dist/src/i18n/catalogs/uk/graphics.d.ts +2 -2
  64. package/dist/src/i18n/catalogs/uk.d.ts +7 -4
  65. package/dist/src/version.d.ts +1 -1
  66. package/dist/src/workspace/graphics/inspector/item.d.ts +6 -6
  67. package/dist/src/workspace/local-workspace-app.d.ts +1 -1
  68. package/dist/src/workspace/routes.d.ts +1 -1
  69. package/dist/{starter-fields-BRLX0z-v.js → starter-fields-7S3LmtGa.js} +154 -157
  70. package/dist/{starter-handoff-BA3ucMKL.js → starter-handoff-BaK8Ss8I.js} +1 -2
  71. package/dist/styles.css +1 -1
  72. package/dist/ui.js +334 -374
  73. package/dist/{uk-CwpJAxmx.js → uk-17pbVYZa.js} +8 -6
  74. package/dist/{wireguard-docs-AfU6NzTL.js → wireguard-docs-Clb-7xRY.js} +14 -17
  75. package/package.json +15 -9
  76. package/dist/alarm-list-BL3xQ5Lf.js +0 -423
  77. package/dist/alarm-rule-dialog-S1ZUg-74.js +0 -423
  78. package/dist/alert-B8MAoIO8.js +0 -45
  79. package/dist/alert-dialog-CYkuMg5D.js +0 -129
  80. package/dist/api-error-9rQmUN5L.js +0 -93
  81. package/dist/breadcrumb-DzVL1yHa.js +0 -74
  82. package/dist/button-6SxPBYMz.js +0 -44
  83. package/dist/context-u9KJQmdB.js +0 -102
  84. package/dist/copyable-id-DYGiAcnq.js +0 -40
  85. package/dist/dashboard-context-CBfG6DoT.js +0 -191
  86. package/dist/date-time-picker-C3FhMXk6.js +0 -266
  87. package/dist/diagnostic-text-BAkzW0SE.js +0 -111
  88. package/dist/diagnostic-text-DiKd2i1w.js +0 -76
  89. package/dist/dialog-BIhQXcZC.js +0 -237
  90. package/dist/dialog-BqyIxMD-.js +0 -54
  91. package/dist/dropdown-menu-DSzbBq3v.js +0 -136
  92. package/dist/editor-page-BiSZJz5b.js +0 -1353
  93. package/dist/empty-B-QJ-06w.js +0 -59
  94. package/dist/entity-controls-D1K4Ot3O.js +0 -76
  95. package/dist/errors-CcsvDHu8.js +0 -26
  96. package/dist/history-page-sAAhG54V.js +0 -1400
  97. package/dist/icon-D-pR9htW.js +0 -57
  98. package/dist/index-page-DMH82fZe.js +0 -214
  99. package/dist/item-B5SaTFQU.js +0 -120
  100. package/dist/mutation-form-validators-BNz5bsv1.js +0 -2408
  101. package/dist/mutations-THtGG6Ai.js +0 -240
  102. package/dist/page-2KPemaAj.js +0 -328
  103. package/dist/page-6rIoTg2L.js +0 -459
  104. package/dist/page-C6giEoEd.js +0 -1935
  105. package/dist/page-DCbTxKsi.js +0 -313
  106. package/dist/page-DWO427hT.js +0 -208
  107. package/dist/page-LXu_2zm3.js +0 -137
  108. package/dist/page-aaUiVOnk.js +0 -513
  109. package/dist/page-header-RB2YFWlE.js +0 -55
  110. package/dist/page-title-CdCbiLt8.js +0 -14
  111. package/dist/panel-DDy8tUNR.js +0 -338
  112. package/dist/presence-code-BfSXr50g.js +0 -83
  113. package/dist/progress-C7cxNJA1.js +0 -83
  114. package/dist/provider-BOeYHi0n.js +0 -134
  115. package/dist/quick-report-CUVJnbKP.js +0 -416
  116. package/dist/radio-group-CZGqVbkJ.js +0 -26
  117. package/dist/retention-note-CHhA6gjY.js +0 -42
  118. package/dist/run-text-DvaO8LDF.js +0 -113
  119. package/dist/select-eNgZdZ30.js +0 -521
  120. package/dist/skeleton-6yk8Tdh5.js +0 -19
  121. package/dist/slider-DorDsoF8.js +0 -37
  122. package/dist/status-page-DAHiKM9P.js +0 -3286
  123. package/dist/switch-BqD0RH_G.js +0 -18
  124. package/dist/table-Q2-voLuw.js +0 -65
  125. package/dist/tabs-CSIucYFP.js +0 -57
  126. package/dist/theme-provider-BkRohQFU.js +0 -61
  127. package/dist/toggle-group-9Bs0Mm3r.js +0 -82
  128. package/dist/trpc-CvJUuUXp.js +0 -153
  129. package/dist/utils-CX-Pz5p6.js +0 -8
  130. package/dist/writability-BuH-spxv.js +0 -57
@@ -0,0 +1,417 @@
1
+ import { At as e, Bn as t, Kn as n, Mt as r, Ot as i, Qn as a, Wn as o, ii as s, kt as c, zn as l } from "./quick-report-BcZsfkCZ.js";
2
+ import { h as u, m as d, n as f } from "./i18n-ChjEbYEg.js";
3
+ import { jt as p, xt as m } from "./alert-dialog-D_iDv2lQ.js";
4
+ import { A as h, G as g, H as _, L as v, M as y, U as b, V as x, Y as S, z as C } from "./spinner-B-KLtBjp.js";
5
+ import { t as w } from "./diagnostic-text-CYZFPiND.js";
6
+ import { n as T, r as E, t as D } from "./query-gate-BbIo1Xrj.js";
7
+ import { i as O, n as k, r as A, t as j } from "./alarm-rule-lists-CfZXTWkK.js";
8
+ import { n as ee, t as te } from "./base-revision-DLF9EnGV.js";
9
+ import { i as ne } from "./run-text-CDdfbKbg.js";
10
+ import { r as M } from "./editor-language-CGENZxbI.js";
11
+ import { t as N } from "./starter-handoff-BaK8Ss8I.js";
12
+ import { useMemo as P, useRef as re, useState as F } from "react";
13
+ import { Fragment as ie, jsx as I, jsxs as L } from "react/jsx-runtime";
14
+ import { resolveLocalized as R } from "@overvis/hmi-shared";
15
+ import { alarmRuleDiagnosticField as z, alarmRuleFormKey as B, alarmRuleFormSchema as V, alarmRuleFormToDocument as H, alarmRuleFormValues as U, alarmRuleFormVariables as W, automationCommandRoles as G, automationContextOf as K, automationDocumentVariables as q, automationSeverities as J, newAlarmRuleFormValues as ae, validateAlarmRule as Y } from "@overvis/hmi-shared/automation";
16
+ import { useNavigate as X } from "@tanstack/react-router";
17
+ // src/workspace/setup/automations/alarm-rule-dialog.tsx
18
+ var Z = ["view_only", ...G];
19
+ function oe() {
20
+ let e = d();
21
+ return (t) => {
22
+ switch (t) {
23
+ case "owner": return e("automation_role_owner");
24
+ case "admin": return e("automation_role_admin");
25
+ case "editor": return e("automation_role_editor");
26
+ case "operator": return e("automation_role_operator");
27
+ case "view_only": return e("automation_role_view_only");
28
+ default: return t;
29
+ }
30
+ };
31
+ }
32
+ function Q(e, t, n, r) {
33
+ let i = d();
34
+ return P(() => {
35
+ let a = /* @__PURE__ */ new Map(), o = H(e, n, r);
36
+ if (!o.ok) return a.set(o.field, [o.problem === "duplicate_param" ? i("alarm_rule_param_duplicate") : o.problem === "unnamed_param" ? i("alarm_rule_param_unnamed") : i("alarm_rule_seconds_invalid")]), {
37
+ byField: a,
38
+ errors: 1
39
+ };
40
+ let s = Y(o.input, K(t), t.limits);
41
+ for (let t of s.diagnostics) {
42
+ let n = z(t.path, e) ?? "", r = t.code === "invalid_shape", o = r && /^\/variables\/\d+\/source\//.test(t.path) ? i("alarm_rule_variable_choose_source") : r && /^\/recipients\/(?:userIds|roles)$/.test(t.path) ? i("alarm_rule_recipients_choose") : w(t);
43
+ a.set(n, [...a.get(n) ?? [], o]);
44
+ }
45
+ return {
46
+ byField: a,
47
+ errors: s.diagnostics.filter((e) => e.severity === "error").length
48
+ };
49
+ }, [
50
+ e,
51
+ t,
52
+ n,
53
+ r,
54
+ i
55
+ ]);
56
+ }
57
+ function $({ workspaceId: t, alarmRuleId: n, starterHandoff: r }) {
58
+ let a = d(), c = u(), l = X(), f = s.useUtils(), [p, h] = F(0), g = n != null, [_] = F(() => g ? void 0 : N(r)), v = () => {
59
+ l({
60
+ to: "/workspace/$workspaceId/setup/automations/alarm-rules",
61
+ params: { workspaceId: t }
62
+ });
63
+ }, y = s.automation.validationContext.useQuery({ workspaceId: t }), b = s.alarmRule.get.useQuery({ id: n ?? "" }, { enabled: g }), x = s.endpoint.list.useQuery({ workspaceId: t }), S = s.alarmRule.list.useQuery({ workspaceId: t }), C = s.automation.list.useQuery({ workspaceId: t }), w = s.automation.members.useQuery({ workspaceId: t }), O = (e) => e.map((e) => ({
64
+ id: e.id,
65
+ name: R(e.name, c)
66
+ })), k = y.data != null && x.data != null && S.data != null && C.data != null && w.data != null && (!g || b.data != null), A = y.isError || x.isError || S.isError || C.isError || w.isError || g && b.isError, j = {
67
+ isLoading: y.isLoading || x.isLoading || S.isLoading || C.isLoading || w.isLoading || g && b.isLoading,
68
+ isError: !k && A,
69
+ error: g ? b.error : null,
70
+ data: k ? {
71
+ context: y.data,
72
+ detail: b.data,
73
+ endpoints: O(x.data.endpoints),
74
+ alarmRules: O(S.data.items.filter((e) => e.id !== n)),
75
+ automations: O(C.data.items),
76
+ members: w.data.members
77
+ } : void 0
78
+ };
79
+ return /* @__PURE__ */ I(i, {
80
+ onClose: v,
81
+ title: a(g ? "alarm_rule_edit_title" : "alarm_rule_create_title"),
82
+ ...n == null ? {} : { entityId: n },
83
+ contentClassName: "max-w-2xl sm:max-w-2xl",
84
+ stickyChrome: !0,
85
+ children: /* @__PURE__ */ I(E, {
86
+ query: j,
87
+ loading: /* @__PURE__ */ L("div", {
88
+ className: "flex flex-col gap-4 p-4",
89
+ children: [/* @__PURE__ */ I(m, { className: "h-8 w-64" }), /* @__PURE__ */ I(m, { className: "h-40 w-full" })]
90
+ }),
91
+ error: (e) => /* @__PURE__ */ I(T, {
92
+ className: "p-4",
93
+ message: g ? o(e ?? "alarm_rule_not_found") : a("error_request_failed"),
94
+ onRetry: () => Promise.all([
95
+ y.refetch(),
96
+ x.refetch(),
97
+ S.refetch(),
98
+ C.refetch(),
99
+ w.refetch(),
100
+ ...g ? [b.refetch()] : []
101
+ ])
102
+ }),
103
+ children: (r) => /* @__PURE__ */ L(e, { children: [A ? /* @__PURE__ */ I(D, {
104
+ className: "m-4 mb-0",
105
+ message: a("error_request_failed"),
106
+ onRetry: () => Promise.all([
107
+ y.refetch(),
108
+ x.refetch(),
109
+ S.refetch(),
110
+ C.refetch(),
111
+ w.refetch(),
112
+ ...g ? [b.refetch()] : []
113
+ ])
114
+ }) : null, /* @__PURE__ */ I(se, {
115
+ workspaceId: t,
116
+ data: r,
117
+ ..._ === void 0 ? {} : { starter: _ },
118
+ onClose: v,
119
+ onReload: async () => {
120
+ if (n == null) return;
121
+ let e = await f.client.alarmRule.get.query({ id: n });
122
+ f.alarmRule.get.setData({ id: n }, e), h((e) => e + 1);
123
+ }
124
+ }, `${n ?? "new"}-${String(p)}`)] })
125
+ })
126
+ });
127
+ }
128
+ function se({ workspaceId: e, data: i, starter: o, onClose: s, onReload: m }) {
129
+ let w = d(), T = f(), E = u(), [D] = F(E), M = oe(), N = r(e), { detail: P, context: R } = i, z = ee(P?.revision), [W] = F(P?.document ?? o ?? null), [G] = F(() => P == null ? o === void 0 ? ae(w("alarm_rule_new_name"), Math.max(1e4, R.limits.minTriggerIntervalMs)) : U(o, null, D) : U(P.document, P.dashboardId, D)), q = re(1e3), X = () => B(q.current++), Q = n({
130
+ defaultValues: G,
131
+ validators: l({
132
+ schema: V,
133
+ submit: async (n) => {
134
+ let r = H(n, W, D);
135
+ if (!r.ok) return t(r, (e) => e.problem === "duplicate_param" ? w("alarm_rule_param_duplicate") : e.problem === "unnamed_param" ? w("alarm_rule_param_unnamed") : w("alarm_rule_seconds_invalid"));
136
+ if (!Y(r.input, K(R), R.limits).ok) return {
137
+ form: () => w("automation_editor_save_has_errors"),
138
+ fields: {}
139
+ };
140
+ let i = n.dashboardId === "" ? null : n.dashboardId;
141
+ return P == null ? await N.create.mutateAsync({
142
+ workspaceId: e,
143
+ document: r.input,
144
+ dashboardId: i
145
+ }) : await N.update.mutateAsync({
146
+ id: P.id,
147
+ document: r.input,
148
+ dashboardId: i,
149
+ ...z.baseRevision === void 0 ? {} : { baseRevision: z.baseRevision }
150
+ }), null;
151
+ },
152
+ mapError: z.mapError(),
153
+ onError: z.onError
154
+ }),
155
+ onSubmitInvalid: a,
156
+ onSubmit: () => {
157
+ T.success(w(P == null ? "alarm_rule_create_toast" : "alarm_rule_save_toast")), s();
158
+ }
159
+ }), $ = (t, n, r) => {
160
+ let a = (e, t, r) => /* @__PURE__ */ L("div", {
161
+ className: "flex flex-col gap-1",
162
+ children: [/* @__PURE__ */ I(Q.AppField, {
163
+ name: e,
164
+ children: (e) => /* @__PURE__ */ I(e.TextField, {
165
+ label: t,
166
+ inputMode: "decimal",
167
+ ...r === void 0 ? {} : { description: r }
168
+ })
169
+ }), /* @__PURE__ */ I(A, { texts: n(e) })]
170
+ }), o = (e, t, i) => /* @__PURE__ */ L("div", {
171
+ className: "flex flex-col gap-1",
172
+ children: [/* @__PURE__ */ I(Q.AppField, {
173
+ name: e,
174
+ children: (n) => /* @__PURE__ */ I(n.FormulaField, {
175
+ label: t,
176
+ id: `alarm-rule-${e}`,
177
+ language: r.condition,
178
+ ...i === void 0 ? {} : { description: i }
179
+ })
180
+ }), /* @__PURE__ */ I(A, { texts: n(e) })]
181
+ });
182
+ return /* @__PURE__ */ L("div", {
183
+ className: "flex flex-col gap-6",
184
+ children: [
185
+ /* @__PURE__ */ I(A, { texts: n("") }),
186
+ /* @__PURE__ */ L(g, { children: [/* @__PURE__ */ I(b, { children: w("alarm_rule_section_rule") }), /* @__PURE__ */ L(x, { children: [
187
+ /* @__PURE__ */ L("div", {
188
+ className: "flex flex-col gap-1",
189
+ children: [/* @__PURE__ */ I(Q.AppField, {
190
+ name: "name",
191
+ children: (e) => /* @__PURE__ */ I(e.TextField, {
192
+ label: w("alarm_rule_field_name"),
193
+ autoFocus: !0
194
+ })
195
+ }), /* @__PURE__ */ I(A, { texts: n("name") })]
196
+ }),
197
+ /* @__PURE__ */ I(Q.AppField, {
198
+ name: "description",
199
+ children: (e) => /* @__PURE__ */ I(e.TextAreaField, {
200
+ label: w("alarm_rule_field_description"),
201
+ rows: 2
202
+ })
203
+ }),
204
+ /* @__PURE__ */ L("div", {
205
+ className: "\n grid grid-cols-1 gap-4\n sm:grid-cols-2\n ",
206
+ children: [/* @__PURE__ */ I(Q.AppField, {
207
+ name: "severity",
208
+ children: (e) => /* @__PURE__ */ L(v, { children: [/* @__PURE__ */ I(_, {
209
+ htmlFor: "alarm-rule-severity",
210
+ children: w("alarm_rule_field_severity")
211
+ }), /* @__PURE__ */ I(h, {
212
+ id: "alarm-rule-severity",
213
+ value: e.state.value,
214
+ onChange: (t) => {
215
+ let n = J.find((e) => e === t.target.value);
216
+ n !== void 0 && e.handleChange(n);
217
+ },
218
+ children: J.map((e) => /* @__PURE__ */ I(y, {
219
+ value: e,
220
+ children: ne(e)
221
+ }, e))
222
+ })] })
223
+ }), a("pollIntervalSeconds", w("alarm_rule_field_poll_interval"))]
224
+ }),
225
+ /* @__PURE__ */ I(Q.AppField, {
226
+ name: "dashboardId",
227
+ children: (t) => /* @__PURE__ */ I(t.DashboardPickerField, {
228
+ label: w("automation_field_dashboard"),
229
+ workspaceId: e,
230
+ description: w("automation_field_dashboard_description")
231
+ })
232
+ })
233
+ ] })] }),
234
+ /* @__PURE__ */ L(g, { children: [
235
+ /* @__PURE__ */ I(b, { children: w("alarm_rule_section_inputs") }),
236
+ /* @__PURE__ */ I(C, { children: w("alarm_rule_section_inputs_description") }),
237
+ /* @__PURE__ */ I(Q.AppField, {
238
+ name: "variables",
239
+ children: (t) => /* @__PURE__ */ I(O, {
240
+ value: t.state.value,
241
+ onChange: t.handleChange,
242
+ formulaLanguage: r.value,
243
+ data: i,
244
+ workspaceId: e,
245
+ at: n,
246
+ newKey: X
247
+ })
248
+ })
249
+ ] }),
250
+ /* @__PURE__ */ L(g, { children: [/* @__PURE__ */ I(b, { children: w("alarm_rule_section_condition") }), /* @__PURE__ */ L(x, { children: [
251
+ o("condition", w("alarm_rule_field_condition"), w("alarm_rule_field_condition_description")),
252
+ a("holdSeconds", w("alarm_rule_field_hold"), w("alarm_rule_field_hold_description")),
253
+ o("clearCondition", w("alarm_rule_field_clear_condition"), w("alarm_rule_field_clear_condition_description")),
254
+ a("clearHoldSeconds", w("alarm_rule_field_clear_hold"), w("alarm_rule_field_optional")),
255
+ /* @__PURE__ */ I(Q.AppField, {
256
+ name: "latching",
257
+ children: (e) => /* @__PURE__ */ I(e.CheckboxField, {
258
+ label: w("alarm_rule_field_latching"),
259
+ description: w("alarm_rule_field_latching_description")
260
+ })
261
+ }),
262
+ a("unavailableAfterSeconds", w("alarm_rule_field_unavailable_after"), w("alarm_rule_field_unavailable_after_description"))
263
+ ] })] }),
264
+ /* @__PURE__ */ L(g, { children: [/* @__PURE__ */ I(b, { children: w("alarm_rule_section_message") }), /* @__PURE__ */ L(x, { children: [
265
+ /* @__PURE__ */ L("div", {
266
+ className: "flex flex-col gap-1",
267
+ children: [/* @__PURE__ */ I(Q.AppField, {
268
+ name: "title",
269
+ children: (e) => /* @__PURE__ */ I(e.TextField, {
270
+ label: w("alarm_rule_field_title"),
271
+ description: w("alarm_rule_field_title_description")
272
+ })
273
+ }), /* @__PURE__ */ I(A, { texts: n("title") })]
274
+ }),
275
+ /* @__PURE__ */ L("div", {
276
+ className: "flex flex-col gap-1",
277
+ children: [/* @__PURE__ */ I(Q.AppField, {
278
+ name: "body",
279
+ children: (e) => /* @__PURE__ */ I(e.TextAreaField, {
280
+ label: w("alarm_rule_field_body"),
281
+ rows: 3
282
+ })
283
+ }), /* @__PURE__ */ I(A, { texts: n("body") })]
284
+ }),
285
+ /* @__PURE__ */ I(Q.AppField, {
286
+ name: "params",
287
+ children: (e) => /* @__PURE__ */ I(k, {
288
+ value: e.state.value,
289
+ onChange: e.handleChange,
290
+ formulaLanguage: r.value,
291
+ at: n,
292
+ newKey: X
293
+ })
294
+ }),
295
+ a("notifyDelaySeconds", w("alarm_rule_field_notify_delay"), w("alarm_rule_field_notify_delay_description")),
296
+ /* @__PURE__ */ I(Q.AppField, {
297
+ name: "recipients",
298
+ children: (e) => /* @__PURE__ */ L(v, { children: [
299
+ /* @__PURE__ */ I(_, {
300
+ htmlFor: "alarm-rule-recipients",
301
+ children: w("alarm_rule_field_recipients")
302
+ }),
303
+ /* @__PURE__ */ L(h, {
304
+ id: "alarm-rule-recipients",
305
+ value: e.state.value,
306
+ onChange: (t) => {
307
+ let n = [
308
+ "default",
309
+ "roles",
310
+ "members"
311
+ ].find((e) => e === t.target.value);
312
+ n !== void 0 && e.handleChange(n);
313
+ },
314
+ children: [
315
+ /* @__PURE__ */ I(y, {
316
+ value: "default",
317
+ children: w("alarm_rule_recipients_default")
318
+ }),
319
+ /* @__PURE__ */ I(y, {
320
+ value: "roles",
321
+ children: w("alarm_rule_recipients_roles")
322
+ }),
323
+ /* @__PURE__ */ I(y, {
324
+ value: "members",
325
+ children: w("alarm_rule_recipients_members")
326
+ })
327
+ ]
328
+ }),
329
+ /* @__PURE__ */ I(A, { texts: n("recipients") })
330
+ ] })
331
+ }),
332
+ t.recipients === "roles" ? /* @__PURE__ */ I(Q.AppField, {
333
+ name: "roles",
334
+ children: (e) => /* @__PURE__ */ I("div", {
335
+ className: "flex flex-wrap gap-4",
336
+ children: Z.map((t) => /* @__PURE__ */ L("label", {
337
+ className: "flex items-center gap-2 text-sm",
338
+ children: [/* @__PURE__ */ I(S, {
339
+ checked: e.state.value.includes(t),
340
+ onCheckedChange: (n) => {
341
+ e.handleChange(n ? [...e.state.value, t] : e.state.value.filter((e) => e !== t));
342
+ }
343
+ }), M(t)]
344
+ }, t))
345
+ })
346
+ }) : null,
347
+ t.recipients === "members" ? /* @__PURE__ */ I(Q.AppField, {
348
+ name: "memberIds",
349
+ children: (e) => /* @__PURE__ */ I(j, {
350
+ members: i.members,
351
+ value: e.state.value,
352
+ onChange: e.handleChange
353
+ })
354
+ }) : null
355
+ ] })] })
356
+ ]
357
+ });
358
+ };
359
+ return /* @__PURE__ */ I(Q.AppForm, { children: /* @__PURE__ */ I(Q.FormRoot, {
360
+ layout: "dialog-fill",
361
+ children: /* @__PURE__ */ I(c, {
362
+ notice: /* @__PURE__ */ I(te, {
363
+ base: z,
364
+ onReload: m
365
+ }),
366
+ footer: /* @__PURE__ */ L(ie, { children: [/* @__PURE__ */ I(p, {
367
+ type: "button",
368
+ variant: "outline",
369
+ onClick: s,
370
+ children: w("action_cancel")
371
+ }), /* @__PURE__ */ I(Q.SubmitButton, {
372
+ label: w(P == null ? "alarm_rule_create_submit" : "action_save"),
373
+ pendingLabel: w("action_saving")
374
+ })] }),
375
+ children: /* @__PURE__ */ I(Q.Subscribe, {
376
+ selector: (e) => ({
377
+ values: e.values,
378
+ show: P != null || o !== void 0 || e.isDirty || e.submissionAttempts > 0
379
+ }),
380
+ children: ({ values: e, show: t }) => /* @__PURE__ */ I(le, {
381
+ values: e,
382
+ context: R,
383
+ original: W,
384
+ locale: D,
385
+ show: t,
386
+ children: (t, n) => $(e, t, n)
387
+ })
388
+ })
389
+ })
390
+ }) });
391
+ }
392
+ function ce(e, t) {
393
+ let n = d()("automation_language_docs");
394
+ return P(() => {
395
+ let r = q({ variables: W(e) }, K(t));
396
+ return {
397
+ condition: M({
398
+ variables: r,
399
+ time: !0,
400
+ result: ["boolean"]
401
+ }, n),
402
+ value: M({
403
+ variables: r,
404
+ time: !0
405
+ }, n)
406
+ };
407
+ }, [
408
+ e,
409
+ t,
410
+ n
411
+ ]);
412
+ }
413
+ function le({ values: e, context: t, original: n, locale: r, show: i, children: a }) {
414
+ let o = Q(e, t, n, r);
415
+ return a((e) => i ? o.byField.get(e) : void 0, ce(e, t));
416
+ }
417
+ export { $ as SetupAlarmRuleFormDialog };