@cobaltcore-dev/aurora 2.1.0 → 2.2.0

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 (171) hide show
  1. package/README.md +31 -25
  2. package/dist/client/AuroraApp.d.ts +9 -2
  3. package/dist/client/context/AppConfigContext.d.ts +44 -0
  4. package/dist/client/index.d.ts +2 -0
  5. package/dist/client/index.js +41221 -844
  6. package/dist/client/index.js.map +1 -1
  7. package/dist/client/trpcClient.d.ts +314 -1
  8. package/dist/client/utils/appConfigGating.d.ts +21 -0
  9. package/dist/server/index.d.ts +694 -4
  10. package/dist/server/index.js +2521 -1243
  11. package/package.json +2 -2
  12. package/dist/client/AuthProvider-CVSAwW9f.mjs +0 -83
  13. package/dist/client/AuthProvider-CVSAwW9f.mjs.map +0 -1
  14. package/dist/client/ContentHeader-fKKZVu-o.mjs +0 -116
  15. package/dist/client/ContentHeader-fKKZVu-o.mjs.map +0 -1
  16. package/dist/client/DeleteFlavorModal-Be2GFiB_.mjs +0 -802
  17. package/dist/client/DeleteFlavorModal-Be2GFiB_.mjs.map +0 -1
  18. package/dist/client/DynamicBreadcrumbContext-CVcUQFou.mjs +0 -26
  19. package/dist/client/DynamicBreadcrumbContext-CVcUQFou.mjs.map +0 -1
  20. package/dist/client/FiltersInput-Becwxo_J.mjs +0 -85
  21. package/dist/client/FiltersInput-Becwxo_J.mjs.map +0 -1
  22. package/dist/client/FloatingIpActionModals-Cq10WljB.mjs +0 -466
  23. package/dist/client/FloatingIpActionModals-Cq10WljB.mjs.map +0 -1
  24. package/dist/client/ImageToastNotifications-BWfzOUMc.mjs +0 -1135
  25. package/dist/client/ImageToastNotifications-BWfzOUMc.mjs.map +0 -1
  26. package/dist/client/RouteIdLevelDefaultError-DPF_x2tG.mjs +0 -26
  27. package/dist/client/RouteIdLevelDefaultError-DPF_x2tG.mjs.map +0 -1
  28. package/dist/client/Slot-CWb612-_.mjs +0 -28
  29. package/dist/client/Slot-CWb612-_.mjs.map +0 -1
  30. package/dist/client/SortInput-4g7nSTHW.mjs +0 -34
  31. package/dist/client/SortInput-4g7nSTHW.mjs.map +0 -1
  32. package/dist/client/StorageNotFound-B-zVinVD.mjs +0 -30
  33. package/dist/client/StorageNotFound-B-zVinVD.mjs.map +0 -1
  34. package/dist/client/TwoColumnDescriptionList-DKS42RKa.mjs +0 -28
  35. package/dist/client/TwoColumnDescriptionList-DKS42RKa.mjs.map +0 -1
  36. package/dist/client/_-CAsCx-Ay.mjs +0 -6
  37. package/dist/client/_-CAsCx-Ay.mjs.map +0 -1
  38. package/dist/client/_auth-SrDjHL6j.mjs +0 -12
  39. package/dist/client/_auth-SrDjHL6j.mjs.map +0 -1
  40. package/dist/client/_flavorId-0PioWpEp.mjs +0 -276
  41. package/dist/client/_flavorId-0PioWpEp.mjs.map +0 -1
  42. package/dist/client/_flavorId-B7fp6Nk8.mjs +0 -22
  43. package/dist/client/_flavorId-B7fp6Nk8.mjs.map +0 -1
  44. package/dist/client/_flavorId-CgueqKTs.mjs +0 -27
  45. package/dist/client/_flavorId-CgueqKTs.mjs.map +0 -1
  46. package/dist/client/_floatingIpId-B8r64AL9.mjs +0 -196
  47. package/dist/client/_floatingIpId-B8r64AL9.mjs.map +0 -1
  48. package/dist/client/_floatingIpId-lEobpOER.mjs +0 -26
  49. package/dist/client/_floatingIpId-lEobpOER.mjs.map +0 -1
  50. package/dist/client/_imageId-Ccv8PedW.mjs +0 -40
  51. package/dist/client/_imageId-Ccv8PedW.mjs.map +0 -1
  52. package/dist/client/_imageId-CiqEQB_J.mjs +0 -558
  53. package/dist/client/_imageId-CiqEQB_J.mjs.map +0 -1
  54. package/dist/client/_imageId-D9LR-02T.mjs +0 -22
  55. package/dist/client/_imageId-D9LR-02T.mjs.map +0 -1
  56. package/dist/client/_projectId-BDARsteX.mjs +0 -77
  57. package/dist/client/_projectId-BDARsteX.mjs.map +0 -1
  58. package/dist/client/_projectId-CtyAHqhH.mjs +0 -30
  59. package/dist/client/_projectId-CtyAHqhH.mjs.map +0 -1
  60. package/dist/client/_projectId-D3VOH5lN.mjs +0 -94
  61. package/dist/client/_projectId-D3VOH5lN.mjs.map +0 -1
  62. package/dist/client/_projectId-ZBk6vka0.mjs +0 -283
  63. package/dist/client/_projectId-ZBk6vka0.mjs.map +0 -1
  64. package/dist/client/_securityGroupId-BwgZnoiR.mjs +0 -29
  65. package/dist/client/_securityGroupId-BwgZnoiR.mjs.map +0 -1
  66. package/dist/client/_securityGroupId-Cz2NUHdB.mjs +0 -1819
  67. package/dist/client/_securityGroupId-Cz2NUHdB.mjs.map +0 -1
  68. package/dist/client/_serviceType-DS8DxsrP.mjs +0 -20
  69. package/dist/client/_serviceType-DS8DxsrP.mjs.map +0 -1
  70. package/dist/client/_serviceType-M8d9rOT6.mjs +0 -6
  71. package/dist/client/_serviceType-M8d9rOT6.mjs.map +0 -1
  72. package/dist/client/_storageType-BNpP1A2N.mjs +0 -13
  73. package/dist/client/_storageType-BNpP1A2N.mjs.map +0 -1
  74. package/dist/client/_storageType-BxSGKhAI.mjs +0 -15
  75. package/dist/client/_storageType-BxSGKhAI.mjs.map +0 -1
  76. package/dist/client/_storageType-DZYCmiLt.mjs +0 -30
  77. package/dist/client/_storageType-DZYCmiLt.mjs.map +0 -1
  78. package/dist/client/_storageType-UqAMP-8d.mjs +0 -859
  79. package/dist/client/_storageType-UqAMP-8d.mjs.map +0 -1
  80. package/dist/client/_storageType-u51_7OwJ.mjs +0 -7
  81. package/dist/client/_storageType-u51_7OwJ.mjs.map +0 -1
  82. package/dist/client/about-BmQTyLWc.mjs +0 -92
  83. package/dist/client/about-BmQTyLWc.mjs.map +0 -1
  84. package/dist/client/assets/__mocks__/svgMock.d.ts +0 -3
  85. package/dist/client/aurora-CIml-f2f.mjs +0 -19
  86. package/dist/client/aurora-CIml-f2f.mjs.map +0 -1
  87. package/dist/client/build-WuxXRAqf.mjs +0 -14530
  88. package/dist/client/build-WuxXRAqf.mjs.map +0 -1
  89. package/dist/client/cn-DM4Cy3jv.mjs +0 -10
  90. package/dist/client/cn-DM4Cy3jv.mjs.map +0 -1
  91. package/dist/client/flavors-Ce3J-cFa.mjs +0 -15
  92. package/dist/client/flavors-Ce3J-cFa.mjs.map +0 -1
  93. package/dist/client/flavors-D5ThLaXO.mjs +0 -666
  94. package/dist/client/flavors-D5ThLaXO.mjs.map +0 -1
  95. package/dist/client/flavors-DWMZ6TuJ.mjs +0 -8
  96. package/dist/client/flavors-DWMZ6TuJ.mjs.map +0 -1
  97. package/dist/client/floatingips-Cz9k80cc.mjs +0 -8
  98. package/dist/client/floatingips-Cz9k80cc.mjs.map +0 -1
  99. package/dist/client/floatingips-DXnRlLvV.mjs +0 -551
  100. package/dist/client/floatingips-DXnRlLvV.mjs.map +0 -1
  101. package/dist/client/floatingips-HRbuLxiN.mjs +0 -22
  102. package/dist/client/floatingips-HRbuLxiN.mjs.map +0 -1
  103. package/dist/client/floatingips-nN1kQmsu.mjs +0 -14
  104. package/dist/client/floatingips-nN1kQmsu.mjs.map +0 -1
  105. package/dist/client/formatBytes-CZv_XyCY.mjs +0 -38
  106. package/dist/client/formatBytes-CZv_XyCY.mjs.map +0 -1
  107. package/dist/client/helpers-1PpYf-fC.mjs +0 -6
  108. package/dist/client/helpers-1PpYf-fC.mjs.map +0 -1
  109. package/dist/client/hooks-D0yKIumu.mjs +0 -22
  110. package/dist/client/hooks-D0yKIumu.mjs.map +0 -1
  111. package/dist/client/images-C8M3ysWR.mjs +0 -2023
  112. package/dist/client/images-C8M3ysWR.mjs.map +0 -1
  113. package/dist/client/images-Cf5R28NR.mjs +0 -15
  114. package/dist/client/images-Cf5R28NR.mjs.map +0 -1
  115. package/dist/client/images-NBf2bV43.mjs +0 -8
  116. package/dist/client/images-NBf2bV43.mjs.map +0 -1
  117. package/dist/client/md-kvaGCNAK.mjs +0 -336
  118. package/dist/client/md-kvaGCNAK.mjs.map +0 -1
  119. package/dist/client/network-DuZm76BZ.mjs +0 -8
  120. package/dist/client/network-DuZm76BZ.mjs.map +0 -1
  121. package/dist/client/objects-BudUAfWY.mjs +0 -12909
  122. package/dist/client/objects-BudUAfWY.mjs.map +0 -1
  123. package/dist/client/objects-Dc7sKUr8.mjs +0 -67
  124. package/dist/client/objects-Dc7sKUr8.mjs.map +0 -1
  125. package/dist/client/objects-Dw7oeTq2.mjs +0 -80
  126. package/dist/client/objects-Dw7oeTq2.mjs.map +0 -1
  127. package/dist/client/objects-_g7nGIn5.mjs +0 -25
  128. package/dist/client/objects-_g7nGIn5.mjs.map +0 -1
  129. package/dist/client/objects-eBxvY6_n.mjs +0 -78
  130. package/dist/client/objects-eBxvY6_n.mjs.map +0 -1
  131. package/dist/client/projects-yiK0HGSA.mjs +0 -7
  132. package/dist/client/projects-yiK0HGSA.mjs.map +0 -1
  133. package/dist/client/routeInfo-DP3v74Wg.mjs +0 -19
  134. package/dist/client/routeInfo-DP3v74Wg.mjs.map +0 -1
  135. package/dist/client/routes-CJj7SR_K.mjs +0 -10
  136. package/dist/client/routes-CJj7SR_K.mjs.map +0 -1
  137. package/dist/client/routes-xofA3ksU.mjs +0 -110
  138. package/dist/client/routes-xofA3ksU.mjs.map +0 -1
  139. package/dist/client/securitygroups-67fFxiwt.mjs +0 -15
  140. package/dist/client/securitygroups-67fFxiwt.mjs.map +0 -1
  141. package/dist/client/securitygroups-CtKne8UQ.mjs +0 -8
  142. package/dist/client/securitygroups-CtKne8UQ.mjs.map +0 -1
  143. package/dist/client/securitygroups-DXrfyuVF.mjs +0 -580
  144. package/dist/client/securitygroups-DXrfyuVF.mjs.map +0 -1
  145. package/dist/client/securitygroups-WLB1_IM6.mjs +0 -22
  146. package/dist/client/securitygroups-WLB1_IM6.mjs.map +0 -1
  147. package/dist/client/securitygroups-o0IXZM6S.mjs +0 -14
  148. package/dist/client/securitygroups-o0IXZM6S.mjs.map +0 -1
  149. package/dist/client/serviceCatalog-B3lKWC9V.mjs +0 -6
  150. package/dist/client/serviceCatalog-B3lKWC9V.mjs.map +0 -1
  151. package/dist/client/services-D1PbooD1.mjs +0 -6
  152. package/dist/client/services-D1PbooD1.mjs.map +0 -1
  153. package/dist/client/services-DEMVtFyn.mjs +0 -9
  154. package/dist/client/services-DEMVtFyn.mjs.map +0 -1
  155. package/dist/client/storageProviders-CJ5rOh13.mjs +0 -15
  156. package/dist/client/storageProviders-CJ5rOh13.mjs.map +0 -1
  157. package/dist/client/trpcClient-D7gpR7YG.mjs +0 -71
  158. package/dist/client/trpcClient-D7gpR7YG.mjs.map +0 -1
  159. package/dist/client/useBreadcrumbs-ha3IlaxX.mjs +0 -54
  160. package/dist/client/useBreadcrumbs-ha3IlaxX.mjs.map +0 -1
  161. package/dist/client/useModal-DCs1OJh7.mjs +0 -12
  162. package/dist/client/useModal-DCs1OJh7.mjs.map +0 -1
  163. package/dist/client/useModalTracking-BYd37pXm.mjs +0 -37
  164. package/dist/client/useModalTracking-BYd37pXm.mjs.map +0 -1
  165. package/dist/client/useProjectId-DBc5lpoU.mjs +0 -11
  166. package/dist/client/useProjectId-DBc5lpoU.mjs.map +0 -1
  167. package/dist/client/useSecurityGroupPermissions--hK4aR8Y.mjs +0 -294
  168. package/dist/client/useSecurityGroupPermissions--hK4aR8Y.mjs.map +0 -1
  169. package/dist/client/useSetBreadcrumb-tn7lBaQV.mjs +0 -19
  170. package/dist/client/useSetBreadcrumb-tn7lBaQV.mjs.map +0 -1
  171. package/dist/client/utils/trpcErrors.d.ts +0 -13
@@ -1,1135 +0,0 @@
1
- import { E as e, K as t, L as n, M as r, Q as i, R as a, S as o, T as s, U as c, X as l, ft as u, h as d, i as f, it as p, m, n as h, o as g, p as _, rt as v, s as y, st as b, t as x } from "./build-WuxXRAqf.mjs";
2
- import { a as S } from "./trpcClient-D7gpR7YG.mjs";
3
- import { t as C } from "./useProjectId-DBc5lpoU.mjs";
4
- import { n as w } from "./formatBytes-CZv_XyCY.mjs";
5
- import { t as T } from "./useModalTracking-BYd37pXm.mjs";
6
- import "./hooks-D0yKIumu.mjs";
7
- import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
8
- import k, { useEffect as A, useMemo as j, useState as M } from "react";
9
- import { Trans as N, useLingui as P } from "@lingui/react";
10
- import { z as F } from "zod";
11
- import { useForm as I, useStore as L } from "@tanstack/react-form";
12
- //#region src/client/routes/_auth/projects/$projectId/compute/images/-components/SizeDisplay.tsx
13
- function R({ size: e }) {
14
- return e === void 0 ? /*#__PURE__*/ D("span", { children: "N/A" }) : /*#__PURE__*/ D("span", { children: w(e) });
15
- }
16
- //#endregion
17
- //#region src/client/routes/_auth/projects/$projectId/compute/-constants/filters.ts
18
- var z = {
19
- PENDING: "pending",
20
- ACCEPTED: "accepted",
21
- REJECTED: "rejected",
22
- ALL: "all"
23
- }, B = {
24
- QUEUED: "queued",
25
- SAVING: "saving",
26
- ACTIVE: "active",
27
- DEACTIVATED: "deactivated",
28
- KILLED: "killed",
29
- DELETED: "deleted",
30
- PENDING_DELETE: "pending_delete"
31
- }, V = {
32
- PUBLIC: "public",
33
- PRIVATE: "private",
34
- SHARED: "shared",
35
- COMMUNITY: "community",
36
- ALL: "all"
37
- }, H = {
38
- AMI: "ami",
39
- ARI: "ari",
40
- AKI: "aki",
41
- VHD: "vhd",
42
- VHDX: "vhdx",
43
- VMDK: "vmdk",
44
- RAW: "raw",
45
- QCOW2: "qcow2",
46
- VDI: "vdi",
47
- ISO: "iso",
48
- PLOOP: "ploop"
49
- }, ee = {
50
- AMI: "ami",
51
- ARI: "ari",
52
- AKI: "aki",
53
- BARE: "bare",
54
- OVF: "ovf",
55
- OVA: "ova",
56
- DOCKER: "docker"
57
- }, te = ({ memberId: e, imageId: t, errors: n, isLoading: i, onMemberIdChange: a, onSave: o, onCancel: c }) => {
58
- let { i18n: l, _: u } = P();
59
- return /*#__PURE__*/ O(s, { children: [
60
- /*#__PURE__*/ D(x, {
61
- className: "break-all",
62
- children: t
63
- }),
64
- /*#__PURE__*/ D(x, {
65
- className: "pl-0",
66
- children: /*#__PURE__*/ D(m, {
67
- value: e,
68
- onChange: (e) => a(e.target.value),
69
- placeholder: l._({ id: "vlyDm2" }),
70
- errortext: n.memberId,
71
- required: !0
72
- })
73
- }),
74
- /*#__PURE__*/ D(x, {}),
75
- /*#__PURE__*/ D(x, { children: /*#__PURE__*/ O(r, { children: [/*#__PURE__*/ D(f, {
76
- icon: "check",
77
- onClick: o,
78
- variant: "primary",
79
- title: l._({ id: "3Qn0me" }),
80
- disabled: i
81
- }), /*#__PURE__*/ D(f, {
82
- icon: "cancel",
83
- onClick: c,
84
- title: l._({ id: "dEgA5A" }),
85
- disabled: i
86
- })] }) })
87
- ] });
88
- }, U = ({ member: e, isDeleting: n, onDelete: r, canDelete: a }) => {
89
- let { i18n: o, _: c } = P(), [l, u] = M(!1);
90
- A(() => {
91
- if (l) {
92
- let e = setTimeout(() => {
93
- u(!1);
94
- }, 3e3);
95
- return () => clearTimeout(e);
96
- }
97
- }, [l]);
98
- let d = () => {
99
- u(!1), r();
100
- };
101
- return /*#__PURE__*/ O(s, { children: [
102
- /*#__PURE__*/ D(x, {
103
- className: "break-all",
104
- children: e.image_id
105
- }),
106
- /*#__PURE__*/ D(x, {
107
- className: "break-all",
108
- children: e.member_id
109
- }),
110
- /*#__PURE__*/ D(x, {
111
- className: `break-all text-theme-${((e) => {
112
- switch (e) {
113
- case z.PENDING: return "warning";
114
- case z.ACCEPTED: return "success";
115
- case z.REJECTED: return "danger";
116
- default: return "default";
117
- }
118
- })(e.status)}`,
119
- children: ((e) => {
120
- switch (e) {
121
- case z.PENDING: return o._({ id: "UbRKMZ" });
122
- case z.ACCEPTED: return o._({ id: "bzMKg7" });
123
- case z.REJECTED: return o._({ id: "ekCRTP" });
124
- default: return e;
125
- }
126
- })(e.status)
127
- }),
128
- /*#__PURE__*/ D(x, { children: n ? /*#__PURE__*/ D(i, {
129
- distribution: "center",
130
- alignment: "center",
131
- children: /*#__PURE__*/ D(t, { variant: "primary" })
132
- }) : /*#__PURE__*/ D(i, {
133
- distribution: "end",
134
- alignment: "end",
135
- children: (() => {
136
- if (!a) return /*#__PURE__*/ D(E, {});
137
- if (l) return /*#__PURE__*/ D(f, {
138
- variant: "primary-danger",
139
- onClick: d,
140
- title: o._({ id: "n9jJG6" }),
141
- "aria-label": o._({ id: "n9jJG6" }),
142
- "data-testid": "confirm-removal",
143
- disabled: n,
144
- children: o._({ id: "t/YqKh" })
145
- });
146
- {
147
- let t = e.member_id;
148
- return /*#__PURE__*/ D(f, {
149
- icon: "deleteForever",
150
- onClick: () => u(!0),
151
- title: o._({
152
- id: "pebLmQ",
153
- values: { memberIdDisplay: t }
154
- }),
155
- "aria-label": o._({
156
- id: "pebLmQ",
157
- values: { memberIdDisplay: t }
158
- }),
159
- "data-testid": `remove-${t}`,
160
- disabled: n
161
- });
162
- }
163
- })()
164
- }) })
165
- ] });
166
- }, W = ({ image: e, imageMembers: t, isMembersLoading: r, canAdd: a, canRemove: c, isAddingMember: l, setIsAddingMember: u, setMessage: d, projectId: p }) => {
167
- let { i18n: m, _: h } = P(), _ = S.useUtils(), [y, b] = M(""), [C, w] = M({}), [T, k] = M(/* @__PURE__ */ new Set()), A = S.compute.createImageMember.useMutation({ onSuccess: () => {
168
- _.compute.listImageMembers.invalidate({
169
- project_id: p,
170
- imageId: e.id
171
- });
172
- } }), j = S.compute.deleteImageMember.useMutation({ onSuccess: () => {
173
- _.compute.listImageMembers.invalidate({
174
- project_id: p,
175
- imageId: e.id
176
- });
177
- } }), N = e.visibility === "public", F = !t || t.length === 0, I = A.isPending || j.isPending, L = () => {
178
- let e = y.trim(), n = {};
179
- return e ? t?.some((t) => t.member_id === e) && (n.memberId = m._({ id: "jyqLKs" })) : n.memberId = m._({ id: "QFPSXA" }), w(n), Object.keys(n).length === 0;
180
- }, R = () => {
181
- b(""), w({});
182
- }, z = async () => {
183
- if (!L()) {
184
- d({
185
- text: m._({ id: "CBFSfX" }),
186
- type: "error"
187
- });
188
- return;
189
- }
190
- let t = y.trim();
191
- try {
192
- await A.mutateAsync({
193
- project_id: p,
194
- imageId: e.id,
195
- member: t
196
- }), d({
197
- text: m._({
198
- id: "Sgz1vJ",
199
- values: { trimmedMemberId: t }
200
- }),
201
- type: "info"
202
- }), R(), u(!1);
203
- } catch (e) {
204
- d({
205
- text: e?.message || m._({ id: "9doWrf" }),
206
- type: "error"
207
- });
208
- }
209
- }, B = async (t) => {
210
- k((e) => new Set(e).add(t));
211
- try {
212
- await j.mutateAsync({
213
- project_id: p,
214
- imageId: e.id,
215
- memberId: t
216
- }), d({
217
- text: m._({
218
- id: "4O2AH3",
219
- values: { memberIdToRemove: t }
220
- }),
221
- type: "info"
222
- });
223
- } catch (e) {
224
- d({
225
- text: e?.message || m._({ id: "n46oLW" }) || m._({
226
- id: "7T1fHv",
227
- values: { memberIdToRemove: t }
228
- }),
229
- type: "error"
230
- });
231
- } finally {
232
- k((e) => {
233
- let n = new Set(e);
234
- return n.delete(t), n;
235
- });
236
- }
237
- };
238
- return r ? /*#__PURE__*/ O(g, {
239
- columns: 4,
240
- children: [/*#__PURE__*/ O(s, { children: [
241
- /*#__PURE__*/ D(o, { children: m._({ id: "vrPCbw" }) }),
242
- /*#__PURE__*/ D(o, { children: m._({ id: "mSfwLL" }) }),
243
- /*#__PURE__*/ D(o, { children: m._({ id: "uAQUqI" }) }),
244
- /*#__PURE__*/ D(o, {})
245
- ] }), /*#__PURE__*/ D(s, { children: /*#__PURE__*/ D(x, {
246
- colSpan: 4,
247
- children: /*#__PURE__*/ D(v, {
248
- status: "progress",
249
- title: m._({ id: "Z3FXyt" })
250
- })
251
- }) })]
252
- }) : N ? /*#__PURE__*/ D(n, {
253
- text: m._({ id: "6H/Lg1" }),
254
- variant: "info"
255
- }) : /*#__PURE__*/ O(E, { children: [a && /*#__PURE__*/ D(i, {
256
- direction: "horizontal",
257
- className: "bg-theme-background-lvl-1 justify-end p-2",
258
- children: /*#__PURE__*/ D(f, {
259
- label: m._({ id: "VCM3KS" }),
260
- "data-testid": "addMemberButton",
261
- onClick: () => u(!0),
262
- variant: "primary",
263
- disabled: l
264
- })
265
- }), /*#__PURE__*/ O(g, {
266
- columns: 4,
267
- children: [
268
- /*#__PURE__*/ O(s, { children: [
269
- /*#__PURE__*/ D(o, { children: m._({ id: "vrPCbw" }) }),
270
- /*#__PURE__*/ D(o, { children: m._({ id: "mSfwLL" }) }),
271
- /*#__PURE__*/ D(o, { children: m._({ id: "uAQUqI" }) }),
272
- /*#__PURE__*/ D(o, {})
273
- ] }),
274
- l && /*#__PURE__*/ D(te, {
275
- memberId: y,
276
- imageId: e.id,
277
- errors: C,
278
- isLoading: I,
279
- onMemberIdChange: (e) => {
280
- b(e), C.memberId && w((e) => ({
281
- ...e,
282
- memberId: void 0
283
- }));
284
- },
285
- onSave: z,
286
- onCancel: () => {
287
- R(), u(!1), d(null);
288
- }
289
- }),
290
- t?.map((e, t) => /*#__PURE__*/ D(U, {
291
- member: e,
292
- isDeleting: T.has(e.member_id),
293
- onDelete: () => B(e.member_id),
294
- canDelete: c
295
- }, `${e.member_id}-${t}`)),
296
- F && !l && /*#__PURE__*/ D(s, { children: /*#__PURE__*/ D(x, {
297
- colSpan: 4,
298
- className: "text-theme-default py-4 text-center",
299
- children: m._({ id: "H7u085" })
300
- }) })
301
- ]
302
- })] });
303
- }, G = ({ image: e, isOpen: t, isLoading: n = !1, onClose: r, onSave: o }) => {
304
- let { i18n: s, _: h } = P(), [g, y] = M({
305
- name: e.name || "",
306
- tags: e.tags || [],
307
- visibility: e.visibility || V.PRIVATE,
308
- protected: e.protected || !1,
309
- min_disk: e.min_disk || 0,
310
- min_ram: e.min_ram || 0
311
- }), [x, S] = M(""), [C, w] = M({}), T = (e, t) => {
312
- if (e.length !== t.length) return !1;
313
- let n = [...e].sort(), r = [...t].sort();
314
- return n.every((e, t) => e === r[t]);
315
- }, E = e.name === g.name && T(e.tags || [], g.tags) && e.visibility === g.visibility && e.protected === g.protected && e.min_disk === g.min_disk && e.min_ram === g.min_ram, k = (e) => {
316
- let { name: t, value: n, type: r, checked: i } = e.target;
317
- y((e) => ({
318
- ...e,
319
- [t]: r === "checkbox" ? i : n
320
- })), C[t] && w((e) => {
321
- let n = { ...e };
322
- return delete n[t], n;
323
- });
324
- }, A = (e, t) => {
325
- y((n) => ({
326
- ...n,
327
- [e]: t
328
- })), C[e] && w((t) => {
329
- let n = { ...t };
330
- return delete n[e], n;
331
- });
332
- }, j = (e, t) => {
333
- let n = t === "" ? 0 : parseInt(t, 10);
334
- isNaN(n) || (y((t) => ({
335
- ...t,
336
- [e]: n
337
- })), C[e] && w((t) => {
338
- let n = { ...t };
339
- return delete n[e], n;
340
- }));
341
- }, F = (e) => {
342
- S(e.target.value);
343
- }, I = () => {
344
- let e = x.trim();
345
- if (e !== "") {
346
- if (g.tags.includes(e)) {
347
- S("");
348
- return;
349
- }
350
- y((t) => ({
351
- ...t,
352
- tags: [...t.tags, e]
353
- })), S("");
354
- }
355
- }, L = (e) => {
356
- e.key === "Enter" && (e.preventDefault(), I());
357
- }, R = (e) => {
358
- y((t) => ({
359
- ...t,
360
- tags: t.tags.filter((t) => t !== e)
361
- }));
362
- }, z = () => {
363
- let e = {};
364
- return (!g.name || g.name.trim() === "") && (e.name = s._({ id: "wyIOMP" })), g.min_disk < 0 && (e.min_disk = s._({ id: "K3bUTE" })), g.min_ram < 0 && (e.min_ram = s._({ id: "PEGvy+" })), w(e), Object.keys(e).length === 0;
365
- };
366
- return /*#__PURE__*/ D(l, {
367
- open: t,
368
- onCancel: () => {
369
- w({}), r();
370
- },
371
- size: "large",
372
- title: s._({ id: "M5Epeo" }),
373
- onConfirm: (t) => {
374
- t.preventDefault(), z() && o({
375
- ...e.name === g.name.trim() ? {} : { name: g.name.trim() },
376
- ...T(e.tags || [], g.tags) ? {} : { tags: g.tags },
377
- ...e.visibility === g.visibility ? {} : { visibility: g.visibility },
378
- ...e.protected === g.protected ? {} : { protected: g.protected },
379
- ...e.min_disk === g.min_disk ? {} : { min_disk: g.min_disk },
380
- ...e.min_ram === g.min_ram ? {} : { min_ram: g.min_ram }
381
- });
382
- },
383
- confirmButtonLabel: s._({ id: "IUwGEM" }),
384
- cancelButtonLabel: s._({ id: "dEgA5A" }),
385
- disableConfirmButton: n || E,
386
- children: n ? /*#__PURE__*/ D(v, {
387
- status: "progress",
388
- title: s._({ id: "lsiOhA" }),
389
- className: "mt-0"
390
- }) : /*#__PURE__*/ O(u, { children: [/*#__PURE__*/ O(_, {
391
- className: "mb-6",
392
- children: [
393
- /*#__PURE__*/ D(d, {
394
- className: "mb-4",
395
- children: /*#__PURE__*/ D(m, {
396
- id: "name",
397
- name: "name",
398
- label: s._({ id: "ExLULX" }),
399
- value: g.name,
400
- onChange: k,
401
- required: !0,
402
- errortext: C.name
403
- })
404
- }),
405
- /*#__PURE__*/ D(d, {
406
- className: "my-6",
407
- children: /*#__PURE__*/ O("div", {
408
- className: "w-full",
409
- children: [/*#__PURE__*/ O(i, {
410
- gap: "2",
411
- direction: "horizontal",
412
- alignment: "start",
413
- children: [/*#__PURE__*/ D("div", {
414
- className: "flex-1",
415
- children: /*#__PURE__*/ D(m, {
416
- id: "tags",
417
- name: "tags",
418
- label: s._({ id: "OYHzN1" }),
419
- value: x,
420
- onChange: F,
421
- onKeyDown: L,
422
- helptext: s._({ id: "MOug+V" }),
423
- placeholder: s._({ id: "y+KBOY" })
424
- })
425
- }), /*#__PURE__*/ D(f, {
426
- variant: "primary",
427
- onClick: I,
428
- disabled: n || x.trim() === "",
429
- children: /*#__PURE__*/ D(N, { id: "m16xKo" })
430
- })]
431
- }), g.tags.length > 0 && /*#__PURE__*/ D(i, {
432
- gap: "2",
433
- wrap: !0,
434
- alignment: "center",
435
- className: "mt-3",
436
- children: g.tags.map((e) => /*#__PURE__*/ D(c, {
437
- closeable: !0,
438
- pillKey: "",
439
- pillValue: e,
440
- onClose: () => R(e)
441
- }, e))
442
- })]
443
- })
444
- }),
445
- /*#__PURE__*/ D(d, {
446
- className: "mb-4",
447
- children: /*#__PURE__*/ O(p, {
448
- id: "visibility",
449
- name: "visibility",
450
- label: s._({ id: "2q/Q7x" }),
451
- value: g.visibility,
452
- onChange: (e) => A("visibility", e),
453
- children: [
454
- /*#__PURE__*/ D(a, {
455
- value: V.PUBLIC,
456
- label: s._({ id: "7d1a0d" })
457
- }),
458
- /*#__PURE__*/ D(a, {
459
- value: V.PRIVATE,
460
- label: s._({ id: "zwBp5t" })
461
- }),
462
- /*#__PURE__*/ D(a, {
463
- value: V.SHARED,
464
- label: s._({ id: "0Gd0NU" })
465
- }),
466
- /*#__PURE__*/ D(a, {
467
- value: V.COMMUNITY,
468
- label: s._({ id: "chL5IG" })
469
- })
470
- ]
471
- })
472
- }),
473
- /*#__PURE__*/ D(d, { children: /*#__PURE__*/ D(b, {
474
- id: "protected",
475
- name: "protected",
476
- label: s._({ id: "644xgx" }),
477
- checked: g.protected,
478
- onChange: k,
479
- helptext: s._({ id: "lAsm87" })
480
- }) })
481
- ]
482
- }), /*#__PURE__*/ O(_, {
483
- className: "mb-6",
484
- children: [/*#__PURE__*/ D(d, {
485
- className: "mb-4",
486
- children: /*#__PURE__*/ D(m, {
487
- id: "min_disk",
488
- name: "min_disk",
489
- label: s._({ id: "tbwGSx" }),
490
- type: "number",
491
- value: String(g.min_disk),
492
- onChange: (e) => j("min_disk", e.target.value),
493
- helptext: s._({ id: "RFDYCD" }),
494
- errortext: C.min_disk
495
- })
496
- }), /*#__PURE__*/ D(d, { children: /*#__PURE__*/ D(m, {
497
- id: "min_ram",
498
- name: "min_ram",
499
- label: s._({ id: "UYSopm" }),
500
- type: "number",
501
- value: String(g.min_ram),
502
- onChange: (e) => j("min_ram", e.target.value),
503
- helptext: s._({ id: "WErCZy" }),
504
- errortext: C.min_ram
505
- }) })]
506
- })] })
507
- });
508
- };
509
- //#endregion
510
- //#region src/client/routes/_auth/projects/$projectId/compute/images/-components/EditImageMetadataModal.tsx
511
- function K(e) {
512
- return e == null ? "" : typeof e == "object" ? JSON.stringify(e) : String(e);
513
- }
514
- function q(e, t) {
515
- return Object.entries(e).filter(([e]) => !t.has(e.toLowerCase())).map(([e, t]) => {
516
- let n = K(t);
517
- return {
518
- key: e,
519
- value: n,
520
- isNew: !1,
521
- isEditing: !1,
522
- originalKey: e,
523
- originalValue: n
524
- };
525
- });
526
- }
527
- function J({ isLoading: t, onClose: n, onSave: r, onSuccess: a, initialMetadata: o, excludedProperties: s, canEdit: c = !0 }) {
528
- let { i18n: u, _: d } = P(), [p, g] = M(o), [_, b] = M({}), [x, S] = M(!1), [C, w] = M(""), [T, A] = M(""), j = p.every((e) => !e.isNew && e.key === e.originalKey && e.value === e.originalValue) && o.length === p.length, N = (e, t, n) => {
529
- let r = e?.trim().toLowerCase();
530
- return r ? s.has(r) ? u._({ id: "n3eQzA" }) : p.some((e, i) => e.key.trim().toLowerCase() === r && i !== n && e.originalKey !== t) ? u._({ id: "i6/ygf" }) : null : u._({ id: "QV1ZPO" });
531
- }, F = () => {
532
- let e = N(C, void 0, p.length);
533
- if (e) {
534
- b({ newKey: e });
535
- return;
536
- }
537
- if (!T.trim()) {
538
- b({ newValue: u._({ id: "hXUWyd" }) });
539
- return;
540
- }
541
- g((e) => [{
542
- key: C.trim(),
543
- value: T.trim(),
544
- isNew: !0,
545
- isEditing: !1
546
- }, ...e]), w(""), A(""), S(!1), b({});
547
- }, I = () => {
548
- w(""), A(""), S(!1), b({});
549
- }, L = (e) => {
550
- g((t) => t.map((t, n) => n === e ? {
551
- ...t,
552
- isEditing: !0
553
- } : {
554
- ...t,
555
- isEditing: !1
556
- })), S(!1);
557
- }, R = (e) => {
558
- let t = p[e], n = N(t.key, t.originalKey, e);
559
- if (n) {
560
- b({ [`edit-${e}`]: n });
561
- return;
562
- }
563
- if (!t.value.trim()) {
564
- b({ [`edit-${e}`]: u._({ id: "hXUWyd" }) });
565
- return;
566
- }
567
- g((t) => t.map((t, n) => n === e ? {
568
- ...t,
569
- isEditing: !1,
570
- key: t.key.trim(),
571
- value: t.value.trim()
572
- } : t)), b({});
573
- }, z = (e) => {
574
- g((t) => t.map((t, n) => n === e ? {
575
- ...t,
576
- isEditing: !1,
577
- key: t.originalKey ?? t.key,
578
- value: t.originalValue ?? t.value
579
- } : t)), b({});
580
- }, B = (e) => {
581
- g((t) => t.filter((t, n) => n !== e)), b({});
582
- }, V = (e, t) => {
583
- g((n) => n.map((n, r) => r === e ? {
584
- ...n,
585
- key: t
586
- } : n)), _[`edit-${e}`] && b((t) => {
587
- let n = { ...t };
588
- return delete n[`edit-${e}`], n;
589
- });
590
- }, H = (e, t) => {
591
- g((n) => n.map((n, r) => r === e ? {
592
- ...n,
593
- value: t
594
- } : n)), _[`edit-${e}`] && b((t) => {
595
- let n = { ...t };
596
- return delete n[`edit-${e}`], n;
597
- });
598
- };
599
- return /*#__PURE__*/ D(l, {
600
- open: !0,
601
- onCancel: () => {
602
- g(o), S(!1), w(""), A(""), b({}), n();
603
- },
604
- size: "xl",
605
- title: c ? u._({ id: "SIfYq6" }) : u._({ id: "0K+QVi" }),
606
- onConfirm: c ? async () => {
607
- let e = {}, t = Object.fromEntries(o.filter((e) => !p.map((e) => e.originalKey).includes(e.originalKey) || !p.map((e) => e.key).includes(e.key)).map((e) => [e.key, null]));
608
- p.filter((e) => e.isNew || e.value !== e.originalValue || e.key !== e.originalKey).forEach((t) => {
609
- e[t.key] = t.value;
610
- }), await r({
611
- ...e,
612
- ...t
613
- }) && (n(), a?.());
614
- } : void 0,
615
- confirmButtonLabel: c ? u._({ id: "IUwGEM" }) : void 0,
616
- cancelButtonLabel: u._({ id: "dEgA5A" }),
617
- disableConfirmButton: t || x || p.some((e) => e.isEditing) || j,
618
- children: t ? /*#__PURE__*/ D(v, {
619
- status: "progress",
620
- title: u._({ id: "AB2Oms" }),
621
- className: "mt-0"
622
- }) : /*#__PURE__*/ O("div", { children: [c && /*#__PURE__*/ D(i, {
623
- direction: "horizontal",
624
- className: "mb-4 justify-end p-2",
625
- children: /*#__PURE__*/ D(f, {
626
- label: u._({ id: "sWBLli" }),
627
- onClick: () => S(!0),
628
- variant: "primary",
629
- disabled: x || p.some((e) => e.isEditing),
630
- icon: "addCircle"
631
- })
632
- }), p.length === 0 && !x ? /*#__PURE__*/ D("p", {
633
- className: "jn:text-theme-light py-8 text-center",
634
- children: c ? u._({ id: "t1POAD" }) : u._({ id: "FqjOoy" })
635
- }) : /*#__PURE__*/ O(y, {
636
- className: "mb-6",
637
- alignTerms: "left",
638
- children: [/*#__PURE__*/ D(E, { children: x && /*#__PURE__*/ O(E, { children: [/*#__PURE__*/ D(h, { children: /*#__PURE__*/ D(m, {
639
- value: C,
640
- onChange: (e) => {
641
- w(e.target.value), _.newKey && b((e) => {
642
- let t = { ...e };
643
- return delete t.newKey, t;
644
- });
645
- },
646
- placeholder: u._({ id: "T8N6oi" }),
647
- errortext: _.newKey,
648
- invalid: !!_.newKey,
649
- autoFocus: !0
650
- }) }), /*#__PURE__*/ D(e, { children: /*#__PURE__*/ O(i, {
651
- direction: "horizontal",
652
- gap: "2",
653
- alignment: "center",
654
- className: "justify-between",
655
- children: [/*#__PURE__*/ D(m, {
656
- value: T,
657
- onChange: (e) => {
658
- A(e.target.value), _.newValue && b((e) => {
659
- let t = { ...e };
660
- return delete t.newValue, t;
661
- });
662
- },
663
- placeholder: u._({ id: "wMHvYH" }),
664
- errortext: _.newValue
665
- }), /*#__PURE__*/ O(i, {
666
- direction: "horizontal",
667
- gap: "2",
668
- children: [/*#__PURE__*/ D(f, {
669
- size: "small",
670
- variant: "primary",
671
- onClick: F,
672
- icon: "check",
673
- title: u._({ id: "tfDRzk" }),
674
- disabled: !C.trim()
675
- }), /*#__PURE__*/ D(f, {
676
- size: "small",
677
- variant: "subdued",
678
- onClick: I,
679
- icon: "close",
680
- title: u._({ id: "bzSI52" })
681
- })]
682
- })]
683
- }) })] }) }), /*#__PURE__*/ D(E, { children: p.map((t, n) => /*#__PURE__*/ O(k.Fragment, { children: [/*#__PURE__*/ D(h, { children: t.isEditing ? /*#__PURE__*/ D(m, {
684
- value: t.key,
685
- onChange: (e) => V(n, e.target.value),
686
- errortext: _[`edit-${n}`],
687
- invalid: !!_[`edit-${n}`]
688
- }) : /*#__PURE__*/ D("span", {
689
- className: "jn:text-theme-high block max-w-xs truncate",
690
- title: t.key,
691
- children: t.key
692
- }) }), /*#__PURE__*/ D(e, {
693
- className: "flex items-center justify-between gap-2",
694
- children: t.isEditing ? /*#__PURE__*/ O(E, { children: [/*#__PURE__*/ D(m, {
695
- value: t.value,
696
- onChange: (e) => H(n, e.target.value)
697
- }), /*#__PURE__*/ O(i, {
698
- direction: "horizontal",
699
- gap: "2",
700
- children: [/*#__PURE__*/ D(f, {
701
- size: "small",
702
- variant: "primary",
703
- onClick: () => R(n),
704
- icon: "check",
705
- title: u._({ id: "tfDRzk" })
706
- }), /*#__PURE__*/ D(f, {
707
- size: "small",
708
- variant: "subdued",
709
- onClick: () => z(n),
710
- icon: "close",
711
- title: u._({ id: "bzSI52" })
712
- })]
713
- })] }) : /*#__PURE__*/ O(E, { children: [/*#__PURE__*/ D("span", {
714
- className: "jn:text-theme-default block max-w-md truncate",
715
- title: t.value,
716
- children: t.value
717
- }), c && /*#__PURE__*/ O(i, {
718
- direction: "horizontal",
719
- gap: "2",
720
- children: [/*#__PURE__*/ D(f, {
721
- size: "small",
722
- variant: "subdued",
723
- onClick: () => L(n),
724
- icon: "edit",
725
- "data-testid": `edit-${t.key}`,
726
- title: u._({ id: "ePK91l" }),
727
- disabled: x || p.some((e) => e.isEditing)
728
- }), /*#__PURE__*/ D(f, {
729
- size: "small",
730
- onClick: () => B(n),
731
- icon: "deleteForever",
732
- "aria-label": u._({ id: "cnGeoo" }),
733
- "data-testid": `delete-${t.key}`,
734
- title: u._({ id: "cnGeoo" }),
735
- disabled: x || p.some((e) => e.isEditing)
736
- })]
737
- })] })
738
- })] }, `${t.originalKey}-${n}`)) })]
739
- })] })
740
- });
741
- }
742
- var Y = ({ image: e, isOpen: t, isLoading: n = !1, canEdit: r = !0, onClose: i, onSave: a }) => {
743
- let { i18n: o, _: s } = P(), c = C(), { data: u, isLoading: d, isError: f } = S.compute.getImageMetadataExcludedProperties.useQuery({ project_id: c }, { enabled: t }), p = j(() => new Set((u ?? []).map((e) => e.toLowerCase())), [u]), m = j(() => q(e, p), [
744
- e.id,
745
- e.updated_at,
746
- p
747
- ]);
748
- return t ? d ? /*#__PURE__*/ D(l, {
749
- open: !0,
750
- onCancel: i,
751
- size: "xl",
752
- title: r ? o._({ id: "SIfYq6" }) : o._({ id: "0K+QVi" }),
753
- children: /*#__PURE__*/ D(v, {
754
- status: "progress",
755
- title: o._({ id: "5flpDm" }),
756
- className: "mt-0"
757
- })
758
- }) : f ? /*#__PURE__*/ D(l, {
759
- open: !0,
760
- onCancel: i,
761
- size: "xl",
762
- title: r ? o._({ id: "SIfYq6" }) : o._({ id: "0K+QVi" }),
763
- children: /*#__PURE__*/ D(v, {
764
- status: "error",
765
- title: o._({ id: "0BBnkg" }),
766
- className: "mt-0"
767
- })
768
- }) : /*#__PURE__*/ D(J, {
769
- isLoading: n,
770
- onClose: i,
771
- onSave: a,
772
- initialMetadata: m,
773
- excludedProperties: p,
774
- canEdit: r
775
- }, `${e.id}-${e.updated_at}-${p.size}`) : null;
776
- }, X = ({ image: t, isOpen: n, isLoading: r, isDisabled: a, onClose: o, onDelete: s }) => {
777
- if (!t) return null;
778
- let { i18n: c, _: d } = P(), { trackClose: f, markSubmitted: p, resetTracking: g } = T({
779
- isOpen: n,
780
- actionPrefix: "compute.image.delete"
781
- }), v = F.object({ confirm: F.string().refine((e) => e === "delete", { message: c._({ id: "QytzQr" }) }) }), b = I({
782
- defaultValues: { confirm: "" },
783
- validators: { onSubmit: v },
784
- onSubmit: async () => {
785
- r || a || (p(), s(t), S());
786
- }
787
- }), x = L(b.store, (e) => e.isSubmitting || e.values.confirm !== "delete"), S = () => {
788
- f(), b.reset(), g(), o();
789
- }, C = r ? c._({ id: "EF2EU9" }) : c._({ id: "KWa0gi" }), w = t?.name || t?.id;
790
- return /*#__PURE__*/ D(l, {
791
- open: n,
792
- onCancel: S,
793
- size: "small",
794
- title: c._({
795
- id: "XbeFW9",
796
- values: { imageName: w }
797
- }),
798
- confirmButtonLabel: C,
799
- confirmButtonVariant: "primary-danger",
800
- onConfirm: b.handleSubmit,
801
- cancelButtonLabel: c._({ id: "dEgA5A" }),
802
- disableConfirmButton: x || r || a,
803
- disableCancelButton: r,
804
- disableCloseButton: r,
805
- children: /*#__PURE__*/ O(i, {
806
- direction: "vertical",
807
- gap: "4",
808
- children: [
809
- /*#__PURE__*/ D("p", {
810
- className: "text-theme-default",
811
- children: /*#__PURE__*/ D(N, { id: "2zceEg" })
812
- }),
813
- t && /*#__PURE__*/ O(y, { children: [
814
- /*#__PURE__*/ D(h, { children: c._({ id: "6YtxFj" }) }),
815
- /*#__PURE__*/ D(e, { children: t.name || c._({ id: "MEIAzV" }) }),
816
- /*#__PURE__*/ D(h, { children: c._({ id: "dFb5Nt" }) }),
817
- /*#__PURE__*/ D(e, { children: t.id }),
818
- /*#__PURE__*/ D(h, { children: c._({ id: "uAQUqI" }) }),
819
- /*#__PURE__*/ D(e, { children: t.status }),
820
- /*#__PURE__*/ D(h, { children: c._({ id: "2q/Q7x" }) }),
821
- /*#__PURE__*/ D(e, { children: t.visibility }),
822
- /*#__PURE__*/ D(h, { children: c._({ id: "Cj2Gtd" }) }),
823
- /*#__PURE__*/ D(e, { children: /*#__PURE__*/ D(R, { size: t.size }) }),
824
- /*#__PURE__*/ D(h, { children: c._({ id: "NopYGU" }) }),
825
- /*#__PURE__*/ D(e, { children: t.disk_format || c._({ id: "fj5byd" }) }),
826
- /*#__PURE__*/ D(h, { children: c._({ id: "d+F6q9" }) }),
827
- /*#__PURE__*/ D(e, { children: t.created_at ? new Date(t.created_at).toLocaleDateString() : c._({ id: "fj5byd" }) })
828
- ] }),
829
- /*#__PURE__*/ D(u, {
830
- className: "mb-0",
831
- id: "delete-image-form",
832
- onSubmit: (e) => {
833
- e.preventDefault(), b.handleSubmit();
834
- },
835
- children: /*#__PURE__*/ D(_, { children: /*#__PURE__*/ D(b.Field, {
836
- name: "confirm",
837
- children: (e) => /*#__PURE__*/ D(m, {
838
- id: e.name,
839
- name: e.name,
840
- label: c._({ id: "QytzQr" }),
841
- value: e.state.value,
842
- onChange: (t) => e.handleChange(t.target.value),
843
- placeholder: "delete",
844
- autoFocus: !0,
845
- disabled: r,
846
- required: !0
847
- })
848
- }) })
849
- })
850
- ]
851
- })
852
- });
853
- }, Z = ({ image: t, isOpen: n, isLoading: r, onClose: i, onActivate: a }) => {
854
- if (!t) return null;
855
- let { i18n: o, _: s } = P();
856
- return /*#__PURE__*/ D(l, {
857
- onCancel: i,
858
- size: "small",
859
- title: o._({ id: "RSFkXF" }),
860
- open: n,
861
- onConfirm: (e) => {
862
- e.preventDefault(), a(t);
863
- },
864
- confirmButtonLabel: o._({ id: "FQBaXG" }),
865
- cancelButtonLabel: o._({ id: "dEgA5A" }),
866
- disableConfirmButton: r,
867
- disableCancelButton: r,
868
- disableCloseButton: r,
869
- children: r ? /*#__PURE__*/ D(v, {
870
- status: "progress",
871
- title: o._({ id: "1zdNju" }),
872
- className: "mt-0"
873
- }) : /*#__PURE__*/ O(E, { children: [/*#__PURE__*/ D("p", {
874
- className: "mb-4",
875
- children: o._({ id: "+NwLgN" })
876
- }), /*#__PURE__*/ O(y, { children: [
877
- /*#__PURE__*/ D(h, { children: o._({ id: "6YtxFj" }) }),
878
- /*#__PURE__*/ D(e, { children: t.name || o._({ id: "MEIAzV" }) }),
879
- /*#__PURE__*/ D(h, { children: o._({ id: "dFb5Nt" }) }),
880
- /*#__PURE__*/ D(e, { children: t.id }),
881
- /*#__PURE__*/ D(h, { children: o._({ id: "uAQUqI" }) }),
882
- /*#__PURE__*/ D(e, { children: t.status }),
883
- /*#__PURE__*/ D(h, { children: o._({ id: "2q/Q7x" }) }),
884
- /*#__PURE__*/ D(e, { children: t.visibility }),
885
- /*#__PURE__*/ D(h, { children: o._({ id: "Cj2Gtd" }) }),
886
- /*#__PURE__*/ D(e, { children: /*#__PURE__*/ D(R, { size: t.size }) }),
887
- /*#__PURE__*/ D(h, { children: o._({ id: "NopYGU" }) }),
888
- /*#__PURE__*/ D(e, { children: t.disk_format || o._({ id: "fj5byd" }) }),
889
- /*#__PURE__*/ D(h, { children: o._({ id: "d+F6q9" }) }),
890
- /*#__PURE__*/ D(e, { children: (() => {
891
- let e = new Date(t.created_at ?? "");
892
- return isNaN(e.getTime()) ? o._({ id: "fj5byd" }) : e.toLocaleDateString();
893
- })() })
894
- ] })] })
895
- });
896
- }, Q = ({ image: t, isOpen: n, isLoading: r, onClose: i, onDeactivate: a }) => {
897
- if (!t) return null;
898
- let { i18n: o, _: s } = P();
899
- return /*#__PURE__*/ D(l, {
900
- onCancel: i,
901
- size: "small",
902
- title: o._({ id: "hQr1Cr" }),
903
- open: n,
904
- onConfirm: (e) => {
905
- e.preventDefault(), a(t);
906
- },
907
- confirmButtonLabel: o._({ id: "5y3O+A" }),
908
- cancelButtonLabel: o._({ id: "dEgA5A" }),
909
- disableConfirmButton: r,
910
- disableCancelButton: r,
911
- disableCloseButton: r,
912
- children: r ? /*#__PURE__*/ D(v, {
913
- status: "progress",
914
- title: o._({ id: "jhCG7a" }),
915
- className: "mt-0"
916
- }) : /*#__PURE__*/ O(E, { children: [/*#__PURE__*/ D("p", {
917
- className: "mb-4",
918
- children: o._({ id: "8TSI9h" })
919
- }), /*#__PURE__*/ O(y, { children: [
920
- /*#__PURE__*/ D(h, { children: o._({ id: "6YtxFj" }) }),
921
- /*#__PURE__*/ D(e, { children: t.name || o._({ id: "MEIAzV" }) }),
922
- /*#__PURE__*/ D(h, { children: o._({ id: "dFb5Nt" }) }),
923
- /*#__PURE__*/ D(e, { children: t.id }),
924
- /*#__PURE__*/ D(h, { children: o._({ id: "uAQUqI" }) }),
925
- /*#__PURE__*/ D(e, { children: t.status }),
926
- /*#__PURE__*/ D(h, { children: o._({ id: "2q/Q7x" }) }),
927
- /*#__PURE__*/ D(e, { children: t.visibility }),
928
- /*#__PURE__*/ D(h, { children: o._({ id: "Cj2Gtd" }) }),
929
- /*#__PURE__*/ D(e, { children: /*#__PURE__*/ D(R, { size: t.size }) }),
930
- /*#__PURE__*/ D(h, { children: o._({ id: "NopYGU" }) }),
931
- /*#__PURE__*/ D(e, { children: t.disk_format || o._({ id: "fj5byd" }) }),
932
- /*#__PURE__*/ D(h, { children: o._({ id: "d+F6q9" }) }),
933
- /*#__PURE__*/ D(e, { children: (() => {
934
- let e = new Date(t.created_at ?? "");
935
- return isNaN(e.getTime()) ? o._({ id: "fj5byd" }) : e.toLocaleDateString();
936
- })() })
937
- ] })] })
938
- });
939
- }, ne = (e) => ({
940
- message: /*#__PURE__*/ D(N, { id: "bM1O3m" }),
941
- description: /*#__PURE__*/ D(N, {
942
- id: "hHL/wm",
943
- values: { imageName: e }
944
- })
945
- }), re = (e, t) => ({
946
- message: /*#__PURE__*/ D(N, { id: "9iz2XW" }),
947
- description: /*#__PURE__*/ D(N, {
948
- id: "wODCcl",
949
- values: {
950
- imageName: e,
951
- errorMessage: t
952
- }
953
- })
954
- }), ie = (e) => ({
955
- message: /*#__PURE__*/ D(N, { id: "bM1O3m" }),
956
- description: /*#__PURE__*/ D(N, {
957
- id: "8AriEH",
958
- values: { imageName: e }
959
- })
960
- }), ae = (e, t) => ({
961
- message: /*#__PURE__*/ D(N, { id: "lWTy+Y" }),
962
- description: /*#__PURE__*/ D(N, {
963
- id: "lYC3YX",
964
- values: {
965
- imageName: e,
966
- errorMessage: t
967
- }
968
- })
969
- }), oe = (e, t) => ({
970
- message: /*#__PURE__*/ D(N, { id: "AGXLLY" }),
971
- description: /*#__PURE__*/ D(N, {
972
- id: "Vf3tzc",
973
- values: {
974
- fileName: e,
975
- errorMessage: t
976
- }
977
- })
978
- }), se = (e) => ({
979
- message: /*#__PURE__*/ D(N, { id: "bM1O3m" }),
980
- description: /*#__PURE__*/ D(N, {
981
- id: "S1iTXO",
982
- values: { imageName: e }
983
- })
984
- }), ce = (e, t) => ({
985
- message: /*#__PURE__*/ D(N, { id: "o/VDOG" }),
986
- description: /*#__PURE__*/ D(N, {
987
- id: "lIlLtp",
988
- values: {
989
- imageId: e,
990
- errorMessage: t
991
- }
992
- })
993
- }), le = (e) => ({
994
- message: /*#__PURE__*/ D(N, { id: "bM1O3m" }),
995
- description: /*#__PURE__*/ D(N, {
996
- id: "cj17eo",
997
- values: { imageName: e }
998
- })
999
- }), ue = (e) => ({
1000
- message: /*#__PURE__*/ D(N, { id: "bM1O3m" }),
1001
- description: /*#__PURE__*/ D(N, {
1002
- id: "ZcWMT1",
1003
- values: { imageName: e }
1004
- })
1005
- }), de = (e, t) => ({
1006
- message: /*#__PURE__*/ D(N, { id: "tiflqy" }),
1007
- description: /*#__PURE__*/ D(N, {
1008
- id: "G/045D",
1009
- values: {
1010
- imageId: e,
1011
- errorMessage: t
1012
- }
1013
- })
1014
- }), fe = (e, t) => ({
1015
- message: /*#__PURE__*/ D(N, { id: "BYH/2L" }),
1016
- description: /*#__PURE__*/ D(N, {
1017
- id: "KYFkcz",
1018
- values: {
1019
- imageId: e,
1020
- errorMessage: t
1021
- }
1022
- })
1023
- }), pe = (e, t) => ({
1024
- message: /*#__PURE__*/ D(N, { id: "CFMxC8" }),
1025
- description: /*#__PURE__*/ D(N, {
1026
- id: "T7mgdd",
1027
- values: {
1028
- successCount: e,
1029
- totalCount: t
1030
- }
1031
- })
1032
- }), me = (e, t) => ({
1033
- message: /*#__PURE__*/ D(N, { id: "fIvd7X" }),
1034
- description: /*#__PURE__*/ D(N, {
1035
- id: "xNZKYy",
1036
- values: {
1037
- failedCount: e,
1038
- totalCount: t
1039
- }
1040
- })
1041
- }), he = (e, t) => ({
1042
- message: /*#__PURE__*/ D(N, { id: "Z5r9vC" }),
1043
- description: /*#__PURE__*/ D(N, {
1044
- id: "plnnns",
1045
- values: {
1046
- successCount: e,
1047
- failedCount: t
1048
- }
1049
- })
1050
- }), ge = (e, t) => ({
1051
- message: /*#__PURE__*/ D(N, { id: "ryf/ee" }),
1052
- description: /*#__PURE__*/ D(N, {
1053
- id: "J9QcnV",
1054
- values: {
1055
- successCount: e,
1056
- totalCount: t
1057
- }
1058
- })
1059
- }), $ = (e, t) => ({
1060
- message: /*#__PURE__*/ D(N, { id: "9njIiV" }),
1061
- description: /*#__PURE__*/ D(N, {
1062
- id: "R6u5CR",
1063
- values: {
1064
- failedCount: e,
1065
- totalCount: t
1066
- }
1067
- })
1068
- }), _e = (e, t) => ({
1069
- message: /*#__PURE__*/ D(N, { id: "YZmsaT" }),
1070
- description: /*#__PURE__*/ D(N, {
1071
- id: "GbKqnI",
1072
- values: {
1073
- successCount: e,
1074
- failedCount: t
1075
- }
1076
- })
1077
- }), ve = (e, t) => ({
1078
- message: /*#__PURE__*/ D(N, { id: "h8h6oz" }),
1079
- description: /*#__PURE__*/ D(N, {
1080
- id: "ZAy0zp",
1081
- values: {
1082
- successCount: e,
1083
- totalCount: t
1084
- }
1085
- })
1086
- }), ye = (e, t) => ({
1087
- message: /*#__PURE__*/ D(N, { id: "fJpv9x" }),
1088
- description: /*#__PURE__*/ D(N, {
1089
- id: "quU9wK",
1090
- values: {
1091
- failedCount: e,
1092
- totalCount: t
1093
- }
1094
- })
1095
- }), be = (e, t) => ({
1096
- message: /*#__PURE__*/ D(N, { id: "JfWCsP" }),
1097
- description: /*#__PURE__*/ D(N, {
1098
- id: "8t1+HU",
1099
- values: {
1100
- successCount: e,
1101
- failedCount: t
1102
- }
1103
- })
1104
- }), xe = (e) => ({
1105
- message: /*#__PURE__*/ D(N, { id: "V66Jih" }),
1106
- description: /*#__PURE__*/ D(N, {
1107
- id: "Vmojta",
1108
- values: { newStatus: e }
1109
- })
1110
- }), Se = (e) => ({
1111
- message: /*#__PURE__*/ D(N, { id: "V66Jih" }),
1112
- description: e || /*#__PURE__*/ D(N, { id: "QYiqYb" })
1113
- }), Ce = (e, t) => ({
1114
- message: /*#__PURE__*/ D(N, { id: "OSlLnz" }),
1115
- description: /*#__PURE__*/ D(N, {
1116
- id: "CA8ZeT",
1117
- values: {
1118
- imageName: e,
1119
- visibility: t
1120
- }
1121
- })
1122
- }), we = (e, t) => ({
1123
- message: /*#__PURE__*/ D(N, { id: "aqagJH" }),
1124
- description: /*#__PURE__*/ D(N, {
1125
- id: "FEfQAu",
1126
- values: {
1127
- imageName: e,
1128
- errorMessage: t
1129
- }
1130
- })
1131
- });
1132
- //#endregion
1133
- export { W as A, we as C, X as D, Z as E, z as F, R as I, H as M, B as N, Y as O, V as P, ne as S, Q as T, fe as _, be as a, oe as b, he as c, xe as d, le as f, ue as g, ie as h, ye as i, ee as j, G as k, pe as l, ae as m, _e as n, ve as o, de as p, ge as r, me as s, $ as t, Se as u, ce as v, Ce as w, re as x, se as y };
1134
-
1135
- //# sourceMappingURL=ImageToastNotifications-BWfzOUMc.mjs.map