@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
@@ -1,459 +0,0 @@
1
- import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { r as t } from "./trpc-CvJUuUXp.js";
3
- import { f as n, h as r, m as i, n as a } from "./i18n-BgzakKoC.js";
4
- import { a as o, d as s, n as c, t as l } from "./mutation-form-validators-BNz5bsv1.js";
5
- import { t as u } from "./utils-CX-Pz5p6.js";
6
- import { G as d, V as f } from "./spinner-C-HPNxOc.js";
7
- import { t as p } from "./button-6SxPBYMz.js";
8
- import { a as m, i as h, l as g, o as _, r as v, t as y } from "./dialog-BIhQXcZC.js";
9
- import { n as b } from "./skeleton-6yk8Tdh5.js";
10
- import { n as x } from "./api-error-9rQmUN5L.js";
11
- import { t as S } from "./switch-BqD0RH_G.js";
12
- import { n as C, t as w } from "./toggle-group-9Bs0Mm3r.js";
13
- import { o as T } from "./mutations-THtGG6Ai.js";
14
- import { t as E } from "./page-header-RB2YFWlE.js";
15
- import { r as D, t as O } from "./query-gate-DVhNIkge.js";
16
- import { i as k, n as ee, t as A } from "./display-DmOo23mi.js";
17
- import { t as te } from "./breadcrumbs-0cjsV2cq.js";
18
- import { a as ne, i as re, n as ie, r as j, t as M } from "./presence-code-BfSXr50g.js";
19
- import { a as N, c as P, d as F, i as I, l as L, n as R, o as z, r as B, s as V, t as H, u as U } from "./catalog-list-DjZojYLJ.js";
20
- import { t as W } from "./wireguard-docs-AfU6NzTL.js";
21
- import { useState as G } from "react";
22
- import { Fragment as K, jsx as q, jsxs as J } from "react/jsx-runtime";
23
- import { BookOpenIcon as Y, CableIcon as ae, PencilIcon as oe, PlusIcon as se, Trash2Icon as ce } from "lucide-react";
24
- import { formatAppDateTime as le, resolveLocalized as ue } from "@overvis/hmi-shared";
25
- import { useNavigate as de } from "@tanstack/react-router";
26
- import { endpointCreateFormSchema as fe, endpointCreateFormToInput as pe, endpointDefaultPort as me } from "@overvis/hmi-shared/endpoint";
27
- //#region src/workspace/setup/endpoints/form-problem.ts
28
- function X({ problem: e }) {
29
- switch (e) {
30
- case "name_required": return n("error_field_required");
31
- case "hostname_invalid": return n("error_endpoint_hostname_invalid");
32
- case "pin_invalid": return n("error_endpoint_pin_invalid");
33
- case "public_key_invalid": return n("error_endpoint_public_key_invalid");
34
- case "port_invalid": return n("error_endpoint_port_invalid");
35
- }
36
- }
37
- //#endregion
38
- //#region src/workspace/setup/endpoints/connection-indicator.tsx
39
- function he(e) {
40
- if (e === void 0) return n("endpoint_status_state_unknown");
41
- if (e == null) return n("endpoint_status_state_disconnected");
42
- switch (e) {
43
- case "connecting": return n("endpoint_status_state_connecting");
44
- case "connected": return n("endpoint_status_state_connected");
45
- case "disconnected": return n("endpoint_status_state_disconnected");
46
- case "error": return n("endpoint_status_state_error");
47
- }
48
- }
49
- function Z(e) {
50
- return e === "connected" ? "bg-emerald-500" : e === "error" ? "bg-destructive" : e === "connecting" ? "bg-amber-500" : "bg-muted-foreground/40";
51
- }
52
- function ge({ endpointId: e }) {
53
- r();
54
- let t = k(e), n = t === void 0 ? void 0 : t?.state ?? null, i = he(n);
55
- return /* @__PURE__ */ q("span", {
56
- className: "inline-flex size-5 shrink-0 items-center justify-center",
57
- title: i,
58
- "aria-label": i,
59
- role: "img",
60
- children: /* @__PURE__ */ q("span", { className: u("size-2.5 rounded-full", Z(n)) })
61
- });
62
- }
63
- //#endregion
64
- //#region src/workspace/setup/endpoints/enabled-switch.tsx
65
- function _e({ workspaceId: e, endpoint: t, compact: n = !1, className: r }) {
66
- let o = i(), s = a(), { enable: c, disable: l } = T(e), u = (e) => ({
67
- onSuccess: () => {
68
- s.success(e);
69
- },
70
- onError: (e) => {
71
- s.error(x(e));
72
- }
73
- });
74
- return /* @__PURE__ */ J("div", {
75
- className: r,
76
- onClick: (e) => {
77
- e.stopPropagation();
78
- },
79
- onKeyDown: (e) => {
80
- e.stopPropagation();
81
- },
82
- children: [/* @__PURE__ */ J("div", {
83
- className: "flex items-center gap-2",
84
- children: [/* @__PURE__ */ q(S, {
85
- checked: t.disabledSince == null,
86
- disabled: l.isPending || c.isPending,
87
- size: "sm",
88
- "aria-label": o("endpoint_enabled_label"),
89
- onCheckedChange: (e) => {
90
- e ? c.mutate({
91
- id: t.id,
92
- baseRevision: t.revision
93
- }, u(o("endpoint_enable_toast"))) : l.mutate({
94
- id: t.id,
95
- baseRevision: t.revision
96
- }, u(o("endpoint_disable_toast")));
97
- }
98
- }), n ? null : /* @__PURE__ */ q("span", {
99
- className: "text-sm text-muted-foreground",
100
- children: o("endpoint_enabled_label")
101
- })]
102
- }), !n && t.disabledSince != null ? /* @__PURE__ */ q("p", {
103
- className: "mt-1 text-xs text-muted-foreground",
104
- children: o("endpoint_disabled_since", { since: le(t.disabledSince) })
105
- }) : null]
106
- });
107
- }
108
- function ve({ endpoint: e }) {
109
- let t = i();
110
- return e.disabledSince == null ? null : /* @__PURE__ */ q("span", {
111
- className: "\n inline-flex shrink-0 items-center rounded-md bg-muted px-1.5 py-0.5 text-xs font-medium\n text-muted-foreground\n ",
112
- children: t("endpoint_disabled_badge")
113
- });
114
- }
115
- //#endregion
116
- //#region src/workspace/setup/endpoints/page.tsx
117
- var ye = /* @__PURE__ */ e({
118
- CreateEndpointForm: () => $,
119
- SetupEndpointsPage: () => Q
120
- });
121
- function Q({ workspaceId: e }) {
122
- let n = i(), o = a(), s = r(), c = de(), l = t.endpoint.list.useQuery({ workspaceId: e }), { open: u } = W(), [d, f] = G(null);
123
- return /* @__PURE__ */ J(L, { children: [
124
- /* @__PURE__ */ q(E, {
125
- icon: /* @__PURE__ */ q(ae, {}),
126
- breadcrumbs: /* @__PURE__ */ q(te, { workspaceId: e }),
127
- title: n("setup_endpoints_title"),
128
- description: n("setup_endpoints_description"),
129
- actions: /* @__PURE__ */ J(p, {
130
- type: "button",
131
- size: "sm",
132
- onClick: () => {
133
- c({
134
- to: "/workspace/$workspaceId/setup/endpoints/new",
135
- params: { workspaceId: e }
136
- });
137
- },
138
- children: [/* @__PURE__ */ q(se, { "data-icon": "inline-start" }), n("endpoint_create_action")]
139
- })
140
- }),
141
- /* @__PURE__ */ q(R, { children: /* @__PURE__ */ q(D, {
142
- query: l,
143
- loading: /* @__PURE__ */ J("div", {
144
- className: "space-y-2",
145
- children: [/* @__PURE__ */ q(b, { className: "h-10 w-full" }), /* @__PURE__ */ q(b, { className: "h-10 w-4/5" })]
146
- }),
147
- error: (e) => /* @__PURE__ */ q(O, { message: x(e) }),
148
- isEmpty: (e) => e.endpoints.length === 0,
149
- empty: /* @__PURE__ */ q(B, { children: n("setup_endpoints_empty") }),
150
- children: ({ endpoints: t }) => /* @__PURE__ */ q(N, { children: t.map((t) => /* @__PURE__ */ J(U, {
151
- "data-context-endpoint-id": t.id,
152
- children: [
153
- /* @__PURE__ */ q(ge, { endpointId: t.id }),
154
- /* @__PURE__ */ J(P, {
155
- to: "/workspace/$workspaceId/setup/endpoints/$endpointId/status",
156
- params: {
157
- workspaceId: e,
158
- endpointId: t.id
159
- },
160
- children: [/* @__PURE__ */ J("div", {
161
- className: "flex min-w-0 items-center gap-2",
162
- children: [/* @__PURE__ */ q(V, { children: ue(t.name, s) }), /* @__PURE__ */ q(ve, { endpoint: t })]
163
- }), /* @__PURE__ */ q(z, { children: t.kind === "pin" ? A(t) : t.kind === "wireguard" ? ee(t.port) : `${n("endpoint_list_host")}: ${t.hostname ?? "—"}:${String(t.port)}` })]
164
- }),
165
- /* @__PURE__ */ J(H, { children: [/* @__PURE__ */ q(_e, {
166
- workspaceId: e,
167
- endpoint: t,
168
- compact: !0
169
- }), /* @__PURE__ */ J(I, { children: [
170
- t.kind === "wireguard" ? /* @__PURE__ */ q(F, {
171
- "aria-label": n("endpoint_docs_action"),
172
- onClick: () => {
173
- u(t.id);
174
- },
175
- children: /* @__PURE__ */ q(Y, {})
176
- }) : null,
177
- /* @__PURE__ */ q(F, {
178
- "aria-label": n("endpoint_edit_action"),
179
- onClick: () => {
180
- c({
181
- to: "/workspace/$workspaceId/setup/endpoints/$endpointId",
182
- params: {
183
- workspaceId: e,
184
- endpointId: t.id
185
- }
186
- });
187
- },
188
- children: /* @__PURE__ */ q(oe, {})
189
- }),
190
- /* @__PURE__ */ q(F, {
191
- tone: "destructive",
192
- "aria-label": n("endpoint_delete_action"),
193
- onClick: () => {
194
- f(t);
195
- },
196
- children: /* @__PURE__ */ q(ce, {})
197
- })
198
- ] })] })
199
- ]
200
- }, t.id)) })
201
- }) }),
202
- /* @__PURE__ */ q(y, {
203
- open: d != null,
204
- onOpenChange: (e) => {
205
- e || f(null);
206
- },
207
- children: /* @__PURE__ */ q(v, { children: d ? /* @__PURE__ */ q(be, {
208
- workspaceId: e,
209
- endpointId: d.id,
210
- baseRevision: d.revision,
211
- onCancel: () => {
212
- f(null);
213
- },
214
- onDeleted: () => {
215
- f(null), o.success(n("endpoint_delete_toast"));
216
- }
217
- }) : null })
218
- })
219
- ] });
220
- }
221
- function $({ workspaceId: e, onCancel: t, onCreated: r }) {
222
- let u = i(), v = a(), { open: y } = W(), b = T(e).create, x = ne(), [S, E] = G(null), D = o({
223
- defaultValues: {
224
- kind: "pin",
225
- name: u("endpoint_default_name"),
226
- hostname: "",
227
- pinCode: "",
228
- publicKey: "",
229
- port: String(me),
230
- authorizationCode: ""
231
- },
232
- validators: l({
233
- schema: fe,
234
- submit: async (t) => {
235
- let i = pe(t, {
236
- workspaceId: e,
237
- defaultName: n("endpoint_default_name")
238
- });
239
- if (!i.ok) return c(i, X);
240
- let a = i.input;
241
- if (a.kind === "pin") if (S == null) {
242
- let t = await x.begin({
243
- workspaceId: e,
244
- pinCode: a.pinCode
245
- });
246
- if (t === "closed") return null;
247
- if (t != null) return E({
248
- ...t,
249
- pinCode: a.pinCode
250
- }), null;
251
- } else {
252
- let e = M(t.authorizationCode);
253
- if (!e.ok) return { fields: { authorizationCode: () => n("endpoint_presence_code_invalid") } };
254
- a = {
255
- ...a,
256
- pinCode: S.pinCode,
257
- challengeId: S.challengeId,
258
- ...e.code == null ? {} : { authorizationCode: e.code }
259
- };
260
- }
261
- let o;
262
- try {
263
- o = await b.mutateAsync(a);
264
- } catch (e) {
265
- throw S != null && !re(e) && (x.cancel(S.challengeId), E(null), D.setFieldValue("authorizationCode", "")), e;
266
- }
267
- return S != null && x.settle(S.challengeId), v.success(u("endpoint_create_toast")), queueMicrotask(() => {
268
- r({
269
- id: o.id,
270
- kind: o.kind
271
- }), o.kind === "wireguard" && y(o.id);
272
- }), null;
273
- },
274
- mapError: (e, t) => j(e, t, S?.codeDisplayed ?? !0)
275
- }),
276
- onSubmitInvalid: s
277
- });
278
- return /* @__PURE__ */ q(D.AppForm, { children: /* @__PURE__ */ J(D.FormRoot, {
279
- layout: "dialog",
280
- children: [
281
- /* @__PURE__ */ J(_, { children: [/* @__PURE__ */ q(g, { children: u(S == null ? "endpoint_create_title" : "endpoint_presence_title") }), S == null ? /* @__PURE__ */ q(D.Subscribe, {
282
- selector: (e) => e.values.kind,
283
- children: (e) => /* @__PURE__ */ q(h, { children: u(e === "pin" ? "endpoint_create_description_pin" : e === "wireguard" ? "endpoint_create_description_wireguard" : "endpoint_create_description") })
284
- }) : /* @__PURE__ */ q(h, { children: u("endpoint_presence_button") })] }),
285
- /* @__PURE__ */ J(f, { children: [S == null ? null : /* @__PURE__ */ J(K, { children: [
286
- /* @__PURE__ */ q(D.Subscribe, {
287
- selector: (e) => e.isSubmitting,
288
- children: (e) => /* @__PURE__ */ q(ie, {
289
- challengeId: S.challengeId,
290
- paused: e,
291
- onDone: () => {
292
- D.setFieldValue("authorizationCode", ""), D.handleSubmit();
293
- }
294
- })
295
- }),
296
- /* @__PURE__ */ q("p", {
297
- className: "text-sm",
298
- children: S.codeDisplayed ? u("endpoint_presence_or_code") : u("endpoint_presence_button_only")
299
- }),
300
- S.codeDisplayed ? /* @__PURE__ */ q(D.AppField, {
301
- name: "authorizationCode",
302
- children: (e) => /* @__PURE__ */ q(e.TextField, {
303
- label: u("endpoint_presence_code_label"),
304
- id: "endpoint-authorization-code",
305
- autoComplete: "off",
306
- spellCheck: !1,
307
- inputMode: "numeric",
308
- autoFocus: !0
309
- })
310
- }) : null
311
- ] }), S == null ? /* @__PURE__ */ q(D.Subscribe, {
312
- selector: (e) => e.isSubmitting,
313
- children: (e) => /* @__PURE__ */ J(d, {
314
- disabled: e,
315
- className: "contents",
316
- children: [
317
- /* @__PURE__ */ q(D.AppField, {
318
- name: "kind",
319
- children: (e) => /* @__PURE__ */ J("div", {
320
- className: "space-y-2",
321
- children: [/* @__PURE__ */ q("p", {
322
- className: "text-sm font-medium",
323
- children: u("endpoint_field_kind")
324
- }), /* @__PURE__ */ J(w, {
325
- variant: "outline",
326
- size: "sm",
327
- spacing: 0,
328
- value: [e.state.value],
329
- onValueChange: (t) => {
330
- let n = t[0];
331
- n !== "direct" && n !== "pin" && n !== "wireguard" || e.handleChange(n);
332
- },
333
- className: "w-full",
334
- children: [
335
- /* @__PURE__ */ q(C, {
336
- value: "pin",
337
- className: "flex-1",
338
- children: u("endpoint_kind_pin")
339
- }),
340
- /* @__PURE__ */ q(C, {
341
- value: "wireguard",
342
- className: "flex-1",
343
- children: u("endpoint_kind_wireguard")
344
- }),
345
- /* @__PURE__ */ q(C, {
346
- value: "direct",
347
- className: "flex-1",
348
- children: u("endpoint_kind_direct")
349
- })
350
- ]
351
- })]
352
- })
353
- }),
354
- /* @__PURE__ */ q(D.AppField, {
355
- name: "name",
356
- children: (e) => /* @__PURE__ */ q(e.TextField, {
357
- label: u("endpoint_field_name"),
358
- id: "endpoint-name",
359
- autoFocus: !0
360
- })
361
- }),
362
- /* @__PURE__ */ q(D.Subscribe, {
363
- selector: (e) => e.values.kind,
364
- children: (e) => e === "pin" ? /* @__PURE__ */ q(D.AppField, {
365
- name: "pinCode",
366
- children: (e) => /* @__PURE__ */ q(e.TextField, {
367
- label: u("endpoint_field_pin_code"),
368
- id: "endpoint-pin",
369
- autoComplete: "off",
370
- spellCheck: !1
371
- })
372
- }) : e === "wireguard" ? /* @__PURE__ */ J("div", {
373
- className: "\n grid grid-cols-1 gap-4\n sm:grid-cols-[minmax(0,1fr)_6.5rem]\n ",
374
- children: [/* @__PURE__ */ q(D.AppField, {
375
- name: "publicKey",
376
- children: (e) => /* @__PURE__ */ q(e.TextField, {
377
- label: u("endpoint_field_public_key"),
378
- id: "endpoint-public-key",
379
- autoComplete: "off",
380
- spellCheck: !1
381
- })
382
- }), /* @__PURE__ */ q(D.AppField, {
383
- name: "port",
384
- children: (e) => /* @__PURE__ */ q(e.TextField, {
385
- label: u("endpoint_field_port"),
386
- id: "endpoint-port",
387
- type: "number",
388
- inputMode: "numeric"
389
- })
390
- })]
391
- }) : /* @__PURE__ */ J("div", {
392
- className: "\n grid grid-cols-1 gap-4\n sm:grid-cols-[minmax(0,1fr)_6.5rem]\n ",
393
- children: [/* @__PURE__ */ q(D.AppField, {
394
- name: "hostname",
395
- children: (e) => /* @__PURE__ */ q(e.TextField, {
396
- label: u("endpoint_field_hostname"),
397
- id: "endpoint-hostname",
398
- autoComplete: "off",
399
- spellCheck: !1
400
- })
401
- }), /* @__PURE__ */ q(D.AppField, {
402
- name: "port",
403
- children: (e) => /* @__PURE__ */ q(e.TextField, {
404
- label: u("endpoint_field_port"),
405
- id: "endpoint-port",
406
- type: "number",
407
- inputMode: "numeric"
408
- })
409
- })]
410
- })
411
- })
412
- ]
413
- })
414
- }) : null] }),
415
- /* @__PURE__ */ J(m, { children: [/* @__PURE__ */ q(p, {
416
- type: "button",
417
- variant: "outline",
418
- onClick: () => {
419
- t();
420
- },
421
- children: u("action_cancel")
422
- }), /* @__PURE__ */ q(D.SubmitButton, {
423
- label: S == null ? u("endpoint_create_submit") : S.codeDisplayed ? u("endpoint_presence_submit") : u("endpoint_presence_waiting"),
424
- pendingLabel: u("action_creating"),
425
- disabled: S != null && !S.codeDisplayed
426
- })] })
427
- ]
428
- }) });
429
- }
430
- function be({ workspaceId: e, endpointId: t, baseRevision: n, onCancel: r, onDeleted: a }) {
431
- let c = i(), u = T(e).remove, d = o({
432
- defaultValues: {},
433
- validators: l({ submit: async () => (await u.mutateAsync({
434
- id: t,
435
- baseRevision: n
436
- }), null) }),
437
- onSubmitInvalid: s,
438
- onSubmit: () => {
439
- a();
440
- }
441
- });
442
- return /* @__PURE__ */ q(d.AppForm, { children: /* @__PURE__ */ J(d.FormRoot, {
443
- layout: "dialog",
444
- children: [/* @__PURE__ */ J(_, { children: [/* @__PURE__ */ q(g, { children: c("endpoint_delete_confirm_title") }), /* @__PURE__ */ q(h, { children: c("endpoint_delete_confirm_description") })] }), /* @__PURE__ */ J(m, { children: [/* @__PURE__ */ q(p, {
445
- type: "button",
446
- variant: "outline",
447
- onClick: () => {
448
- r();
449
- },
450
- children: c("action_cancel")
451
- }), /* @__PURE__ */ q(d.SubmitButton, {
452
- label: c("endpoint_delete_confirm_submit"),
453
- pendingLabel: c("action_deleting"),
454
- variant: "destructive"
455
- })] })]
456
- }) });
457
- }
458
- //#endregion
459
- export { X as i, Q as n, ye as r, $ as t };