@cobaltcore-dev/aurora 0.10.0 → 0.11.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 (120) hide show
  1. package/README.md +2 -1
  2. package/dist/client/AuroraApp.d.ts +2 -0
  3. package/dist/client/AuthProvider-DZqOvceF.mjs +64 -0
  4. package/dist/client/AuthProvider-DZqOvceF.mjs.map +1 -0
  5. package/dist/client/ContentHeader-DsuZD8fa.mjs +110 -0
  6. package/dist/client/ContentHeader-DsuZD8fa.mjs.map +1 -0
  7. package/dist/client/{DeleteFlavorModal-C3m7bQJu.mjs → DeleteFlavorModal-RnbspW_2.mjs} +135 -135
  8. package/dist/client/{DeleteFlavorModal-C3m7bQJu.mjs.map → DeleteFlavorModal-RnbspW_2.mjs.map} +1 -1
  9. package/dist/client/{DeleteVersionsModal-CyYZfB8d.mjs → DeleteVersionsModal-CsBJzXoW.mjs} +57 -57
  10. package/dist/client/{DeleteVersionsModal-CyYZfB8d.mjs.map → DeleteVersionsModal-CsBJzXoW.mjs.map} +1 -1
  11. package/dist/client/{EditSecurityGroupModal-DKusxfta.mjs → EditSecurityGroupModal-BPv3d7am.mjs} +15 -15
  12. package/dist/client/{EditSecurityGroupModal-DKusxfta.mjs.map → EditSecurityGroupModal-BPv3d7am.mjs.map} +1 -1
  13. package/dist/client/{FiltersInput-GzR4D0q6.mjs → FiltersInput-CViamP59.mjs} +2 -2
  14. package/dist/client/{FiltersInput-GzR4D0q6.mjs.map → FiltersInput-CViamP59.mjs.map} +1 -1
  15. package/dist/client/{FloatingIpActionModals-CRvROJ3H.mjs → FloatingIpActionModals-DTn3HFei.mjs} +45 -45
  16. package/dist/client/{FloatingIpActionModals-CRvROJ3H.mjs.map → FloatingIpActionModals-DTn3HFei.mjs.map} +1 -1
  17. package/dist/client/{ImageToastNotifications-BuDXpTkl.mjs → ImageToastNotifications-CFKQZTgf.mjs} +261 -261
  18. package/dist/client/{ImageToastNotifications-BuDXpTkl.mjs.map → ImageToastNotifications-CFKQZTgf.mjs.map} +1 -1
  19. package/dist/client/{RouteError-DVAiT0mT.mjs → RouteError-BebIhFpQ.mjs} +2 -2
  20. package/dist/client/{RouteError-DVAiT0mT.mjs.map → RouteError-BebIhFpQ.mjs.map} +1 -1
  21. package/dist/client/{SortInput-DLcusjGZ.mjs → SortInput-D0Vb864D.mjs} +2 -2
  22. package/dist/client/{SortInput-DLcusjGZ.mjs.map → SortInput-D0Vb864D.mjs.map} +1 -1
  23. package/dist/client/{_auth-DXJkv9QO.mjs → _auth-DnImOqR-.mjs} +2 -2
  24. package/dist/client/_auth-DnImOqR-.mjs.map +1 -0
  25. package/dist/client/{_flavorId-Dy7EYQum.mjs → _flavorId-C9SZd1jL.mjs} +8 -8
  26. package/dist/client/{_flavorId-Dy7EYQum.mjs.map → _flavorId-C9SZd1jL.mjs.map} +1 -1
  27. package/dist/client/{_flavorId-DsD2VTKA.mjs → _flavorId-DINgWoeV.mjs} +38 -38
  28. package/dist/client/{_flavorId-DsD2VTKA.mjs.map → _flavorId-DINgWoeV.mjs.map} +1 -1
  29. package/dist/client/{_floatingIpId-j17rCQqG2.mjs → _floatingIpId-BACLbMzi2.mjs} +32 -32
  30. package/dist/client/{_floatingIpId-j17rCQqG2.mjs.map → _floatingIpId-BACLbMzi2.mjs.map} +1 -1
  31. package/dist/client/{_floatingIpId-BjVbeNw_.mjs → _floatingIpId-BzVMOv97.mjs} +2 -2
  32. package/dist/client/{_floatingIpId-BjVbeNw_.mjs.map → _floatingIpId-BzVMOv97.mjs.map} +1 -1
  33. package/dist/client/_imageId-DCvaU7-S.mjs +534 -0
  34. package/dist/client/_imageId-DCvaU7-S.mjs.map +1 -0
  35. package/dist/client/{_pcaId-Bo7yHkNW.mjs → _pcaId-B3PqECyO.mjs} +115 -115
  36. package/dist/client/{_pcaId-Bo7yHkNW.mjs.map → _pcaId-B3PqECyO.mjs.map} +1 -1
  37. package/dist/client/{_pcaId-CKkCVC7b.mjs → _pcaId-DAJEt3ZI.mjs} +2 -2
  38. package/dist/client/{_pcaId-CKkCVC7b.mjs.map → _pcaId-DAJEt3ZI.mjs.map} +1 -1
  39. package/dist/client/{_projectId-CARHuZTU.mjs → _projectId-B2hG5peP.mjs} +3 -3
  40. package/dist/client/_projectId-B2hG5peP.mjs.map +1 -0
  41. package/dist/client/{_projectId-CY8W0IF6.mjs → _projectId-BnWXWTBR.mjs} +3 -3
  42. package/dist/client/{_projectId-CY8W0IF6.mjs.map → _projectId-BnWXWTBR.mjs.map} +1 -1
  43. package/dist/client/{_projectId-Dbck_MFa.mjs → _projectId-DRr9rLST.mjs} +66 -66
  44. package/dist/client/{_projectId-Dbck_MFa.mjs.map → _projectId-DRr9rLST.mjs.map} +1 -1
  45. package/dist/client/{_projectId-B_2sZKk-.mjs → _projectId-DU8qRiZk.mjs} +2 -2
  46. package/dist/client/_projectId-DU8qRiZk.mjs.map +1 -0
  47. package/dist/client/{_securityGroupId-gSEZbBII.mjs → _securityGroupId-Cj9IotMJ.mjs} +2 -2
  48. package/dist/client/{_securityGroupId-gSEZbBII.mjs.map → _securityGroupId-Cj9IotMJ.mjs.map} +1 -1
  49. package/dist/client/{_securityGroupId-CkN0CGVg.mjs → _securityGroupId-ClJiFh4R.mjs} +267 -267
  50. package/dist/client/{_securityGroupId-CkN0CGVg.mjs.map → _securityGroupId-ClJiFh4R.mjs.map} +1 -1
  51. package/dist/client/_storageType-BrHDa2bD.mjs +3005 -0
  52. package/dist/client/_storageType-BrHDa2bD.mjs.map +1 -0
  53. package/dist/client/{_storageType-6k8lUnQo.mjs → _storageType-CSLH93js.mjs} +2 -2
  54. package/dist/client/{_storageType-6k8lUnQo.mjs.map → _storageType-CSLH93js.mjs.map} +1 -1
  55. package/dist/client/_storageType-zeSZe--V.mjs.map +1 -1
  56. package/dist/client/{about-Nsxkyh9U.mjs → about-BnU297yB.mjs} +2 -2
  57. package/dist/client/about-BnU297yB.mjs.map +1 -0
  58. package/dist/client/{aurora-DDzsst74.mjs → aurora-6RsAZtnz.mjs} +2 -2
  59. package/dist/client/aurora-6RsAZtnz.mjs.map +1 -0
  60. package/dist/client/{build-BdRRmNf5.mjs → build-DF7MTyXG.mjs} +3582 -3114
  61. package/dist/client/{build-BdRRmNf5.mjs.map → build-DF7MTyXG.mjs.map} +1 -1
  62. package/dist/client/{constants-PMXUGI4Q.mjs → constants-BskfpGYY.mjs} +16 -16
  63. package/dist/client/{constants-PMXUGI4Q.mjs.map → constants-BskfpGYY.mjs.map} +1 -1
  64. package/dist/client/{flavors-p2TKcqP-.mjs → flavors-DAbtRoep.mjs} +151 -151
  65. package/dist/client/{flavors-p2TKcqP-.mjs.map → flavors-DAbtRoep.mjs.map} +1 -1
  66. package/dist/client/{flavors-BclEwobO.mjs → flavors-DODudzrA.mjs} +2 -2
  67. package/dist/client/{flavors-BclEwobO.mjs.map → flavors-DODudzrA.mjs.map} +1 -1
  68. package/dist/client/flavors-DWMZ6TuJ.mjs.map +1 -1
  69. package/dist/client/{floatingips-ph0ZxJw8.mjs → floatingips-DJW9ftN_.mjs} +83 -83
  70. package/dist/client/floatingips-DJW9ftN_.mjs.map +1 -0
  71. package/dist/client/{hooks-dSArr2Ca.mjs → hooks-CMgoYcDG.mjs} +1 -1
  72. package/dist/client/{images-CXdghaMW.mjs → images-BbLnuYrL.mjs} +2 -2
  73. package/dist/client/{images-CXdghaMW.mjs.map → images-BbLnuYrL.mjs.map} +1 -1
  74. package/dist/client/{images-Dbjo4yKn.mjs → images-C3JyPwer.mjs} +2 -2
  75. package/dist/client/images-C3JyPwer.mjs.map +1 -0
  76. package/dist/client/{images-BblnyWJq.mjs → images-Cp6V1nF5.mjs} +455 -455
  77. package/dist/client/{images-BblnyWJq.mjs.map → images-Cp6V1nF5.mjs.map} +1 -1
  78. package/dist/client/images-NBf2bV43.mjs.map +1 -1
  79. package/dist/client/index.js +257 -257
  80. package/dist/client/index.js.map +1 -1
  81. package/dist/client/network-DuZm76BZ.mjs.map +1 -1
  82. package/dist/client/{objects-B9Jh3SMG.mjs → objects-Bw96WXOs.mjs} +2 -2
  83. package/dist/client/{objects-B9Jh3SMG.mjs.map → objects-Bw96WXOs.mjs.map} +1 -1
  84. package/dist/client/{objects-Bw25cE1m.mjs → objects-DUmK3WgA.mjs} +1458 -1430
  85. package/dist/client/objects-DUmK3WgA.mjs.map +1 -0
  86. package/dist/client/objects-o2Cj_ndZ.mjs.map +1 -1
  87. package/dist/client/{pca-DUrQ_tIg.mjs → pca-DKeGzbww.mjs} +2 -2
  88. package/dist/client/{pca-DUrQ_tIg.mjs.map → pca-DKeGzbww.mjs.map} +1 -1
  89. package/dist/client/{pca-CiLPHmK7.mjs → pca-Dc_tdh4-.mjs} +47 -47
  90. package/dist/client/{pca-CiLPHmK7.mjs.map → pca-Dc_tdh4-.mjs.map} +1 -1
  91. package/dist/client/{projects-DNd3UTas.mjs → projects-CRL37ftA.mjs} +16 -16
  92. package/dist/client/{projects-DNd3UTas.mjs.map → projects-CRL37ftA.mjs.map} +1 -1
  93. package/dist/client/{projects-B5topuei.mjs → projects-DUWOgB3m.mjs} +2 -2
  94. package/dist/client/{projects-B5topuei.mjs.map → projects-DUWOgB3m.mjs.map} +1 -1
  95. package/dist/client/{projects-CHYn7L5e.mjs → projects-DpXQYfKc.mjs} +2 -2
  96. package/dist/client/projects-DpXQYfKc.mjs.map +1 -0
  97. package/dist/client/{securitygroups-CcA2TpAt.mjs → securitygroups-CWWFSjjj.mjs} +94 -94
  98. package/dist/client/securitygroups-CWWFSjjj.mjs.map +1 -0
  99. package/dist/client/{useListWithFiltering-CVzhMyEA.mjs → useListWithFiltering-C9k7xWqz.mjs} +7 -7
  100. package/dist/client/{useListWithFiltering-CVzhMyEA.mjs.map → useListWithFiltering-C9k7xWqz.mjs.map} +1 -1
  101. package/dist/server/index.js +697 -406
  102. package/package.json +3 -3
  103. package/dist/client/AuthProvider-Co4d0WzB.mjs +0 -100
  104. package/dist/client/AuthProvider-Co4d0WzB.mjs.map +0 -1
  105. package/dist/client/ContentHeader-D4jlOG-9.mjs +0 -96
  106. package/dist/client/ContentHeader-D4jlOG-9.mjs.map +0 -1
  107. package/dist/client/_auth-DXJkv9QO.mjs.map +0 -1
  108. package/dist/client/_imageId-BjfhqAje.mjs +0 -534
  109. package/dist/client/_imageId-BjfhqAje.mjs.map +0 -1
  110. package/dist/client/_projectId-B_2sZKk-.mjs.map +0 -1
  111. package/dist/client/_projectId-CARHuZTU.mjs.map +0 -1
  112. package/dist/client/_storageType-CLTxXjQZ.mjs +0 -3048
  113. package/dist/client/_storageType-CLTxXjQZ.mjs.map +0 -1
  114. package/dist/client/about-Nsxkyh9U.mjs.map +0 -1
  115. package/dist/client/aurora-DDzsst74.mjs.map +0 -1
  116. package/dist/client/floatingips-ph0ZxJw8.mjs.map +0 -1
  117. package/dist/client/images-Dbjo4yKn.mjs.map +0 -1
  118. package/dist/client/objects-Bw25cE1m.mjs.map +0 -1
  119. package/dist/client/projects-CHYn7L5e.mjs.map +0 -1
  120. package/dist/client/securitygroups-CcA2TpAt.mjs.map +0 -1
@@ -0,0 +1,3005 @@
1
+ import { $ as e, A as t, C as n, D as r, F as i, H as a, K as o, L as s, N as c, T as l, U as u, W as d, X as f, Y as p, _ as m, at as h, c as g, ct as _, d as v, dt as y, f as b, it as x, k as S, m as C, nt as w, o as T, ot as E, q as D, rt as O, t as k, tt as A, ut as j } from "./build-DF7MTyXG.mjs";
2
+ import { r as M } from "./trpcClient-BzPUgiM2.mjs";
3
+ import { t as N } from "./_storageType-CSLH93js.mjs";
4
+ import { t as P } from "./ContentHeader-DsuZD8fa.mjs";
5
+ import { t as ee } from "./SortInput-D0Vb864D.mjs";
6
+ import { t as F } from "./formatBytes-CZv_XyCY.mjs";
7
+ import { t as I } from "./useProjectId-DBc5lpoU.mjs";
8
+ import { n as te, r as L } from "./DeleteVersionsModal-CsBJzXoW.mjs";
9
+ import { Fragment as R, jsx as z, jsxs as B } from "react/jsx-runtime";
10
+ import { Fragment as ne, startTransition as re, useCallback as V, useEffect as ie, useRef as ae, useState as H } from "react";
11
+ import { useNavigate as U, useParams as oe } from "@tanstack/react-router";
12
+ import { Trans as W, useLingui as G } from "@lingui/react";
13
+ import { i18n as K } from "@lingui/core";
14
+ import { ErrorBoundary as se } from "react-error-boundary";
15
+ import { useVirtualizer as q } from "@tanstack/react-virtual";
16
+ //#region src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Containers/CreateContainerModal.tsx
17
+ var ce = ({ isOpen: e, onClose: t, onSuccess: n, onError: r, maxContainerNameLength: i = 256 }) => {
18
+ let { i18n: a, _: o } = G(), s = I(), [c, l] = H(""), [u, d] = H(null), p = M.useUtils(), m = M.storage.swift.createContainer.useMutation({
19
+ onSuccess: () => {
20
+ p.storage.swift.listContainers.invalidate();
21
+ let e = c.trim();
22
+ n?.(e);
23
+ },
24
+ onError: (e) => {
25
+ r?.(c.trim(), e.message);
26
+ },
27
+ onSettled: () => {
28
+ h();
29
+ }
30
+ }), h = () => {
31
+ l(""), d(null), m.reset(), t();
32
+ }, g = (e) => e.trim() ? e.length > i ? (d(a._({
33
+ id: "r5SQFW",
34
+ values: { maxContainerNameLength: i }
35
+ })), !1) : e.includes("/") ? (d(a._({ id: "9J93Xr" })), !1) : (d(null), !0) : (d(a._({ id: "JNGYAW" })), !1), _ = (e) => {
36
+ let t = e.target.value;
37
+ l(t), u && g(t);
38
+ }, v = () => {
39
+ g(c) && m.mutate({
40
+ project_id: s,
41
+ container: c.trim()
42
+ });
43
+ };
44
+ return e ? /*#__PURE__*/ z(j, {
45
+ title: a._({ id: "vTh35P" }),
46
+ open: e,
47
+ onCancel: h,
48
+ confirmButtonLabel: a._({ id: "hYgDIe" }),
49
+ onConfirm: v,
50
+ cancelButtonLabel: a._({ id: "dEgA5A" }),
51
+ size: "small",
52
+ disableConfirmButton: m.isPending || !c.trim(),
53
+ children: /*#__PURE__*/ B(f, {
54
+ direction: "vertical",
55
+ gap: "6",
56
+ children: [/*#__PURE__*/ z("p", {
57
+ className: "text-theme-default",
58
+ children: /*#__PURE__*/ z(W, { id: "ne/GWZ" })
59
+ }), /*#__PURE__*/ z(C, {
60
+ label: a._({ id: "SUSS9i" }),
61
+ required: !0,
62
+ value: c,
63
+ onChange: _,
64
+ onKeyDown: (e) => {
65
+ e.key === "Enter" && v();
66
+ },
67
+ invalid: !!u,
68
+ errortext: u || void 0,
69
+ disabled: m.isPending,
70
+ autoFocus: !0,
71
+ placeholder: a._({ id: "W5FkH9" })
72
+ })]
73
+ })
74
+ }) : null;
75
+ }, J = ({ isOpen: e, container: t, onClose: n, onSuccess: r, onError: i }) => {
76
+ let { i18n: a, _: l } = G(), d = I(), [p, h] = H(""), [_, v] = H(null), [x, S] = H(!1), T = ae(""), E = () => {
77
+ t && navigator.clipboard.writeText(t.name).then(() => {
78
+ S(!0), setTimeout(() => S(!1), 2e3);
79
+ });
80
+ }, D = M.useUtils(), { data: O, isLoading: k, error: A } = M.storage.swift.listObjects.useQuery({
81
+ project_id: d,
82
+ container: t?.name ?? "",
83
+ format: "json",
84
+ limit: 100
85
+ }, { enabled: e && t !== null }), N = M.storage.swift.emptyContainer.useMutation({
86
+ onSuccess: (e) => {
87
+ D.storage.swift.listContainers.invalidate(), D.storage.swift.listObjects.invalidate({
88
+ project_id: d,
89
+ container: T.current
90
+ }), r?.(T.current, e);
91
+ },
92
+ onError: (e) => {
93
+ i?.(T.current, e.message);
94
+ },
95
+ onSettled: () => {
96
+ P();
97
+ }
98
+ }), P = () => {
99
+ h(""), v(null), N.reset(), n();
100
+ }, ee = (e) => {
101
+ let t = e.target.value;
102
+ h(t), _ && v(null);
103
+ }, te = () => {
104
+ if (t) {
105
+ if (p.trim() !== t.name) {
106
+ v(a._({ id: "jS4B2+" }));
107
+ return;
108
+ }
109
+ T.current = t.name, N.mutate({
110
+ project_id: d,
111
+ container: t.name
112
+ });
113
+ }
114
+ }, L = (e) => {
115
+ e.key === "Enter" && te();
116
+ };
117
+ if (!e || !t) return null;
118
+ let R = O?.length ?? 0, ne = !k && t.count === 0 && R === 0, re = !k && t.count > 0 && R === 0, V = ne || re;
119
+ return /*#__PURE__*/ B(j, {
120
+ title: /* @__PURE__ */ B("span", {
121
+ className: "flex max-w-[400px] items-center gap-2",
122
+ children: [
123
+ /*#__PURE__*/ z("span", {
124
+ className: "shrink-0",
125
+ children: /*#__PURE__*/ z(W, { id: "5Okch2" })
126
+ }),
127
+ /*#__PURE__*/ z("span", {
128
+ className: "truncate",
129
+ title: t.name,
130
+ children: t.name
131
+ }),
132
+ !k && !V && /*#__PURE__*/ z("button", {
133
+ type: "button",
134
+ onClick: E,
135
+ title: x ? a._({ id: "PiH3UR" }) : a._({ id: "NQU1Nn" }),
136
+ className: "text-theme-light hover:text-theme-default inline-flex items-center transition-colors",
137
+ children: /*#__PURE__*/ z(g, {
138
+ icon: x ? "checkCircle" : "contentCopy",
139
+ size: "16"
140
+ })
141
+ })
142
+ ]
143
+ }),
144
+ open: e,
145
+ onCancel: P,
146
+ confirmButtonLabel: V ? void 0 : a._({ id: "N2S1rs" }),
147
+ confirmButtonVariant: "primary-danger",
148
+ onConfirm: V ? void 0 : te,
149
+ cancelButtonLabel: V ? void 0 : a._({ id: "dEgA5A" }),
150
+ modalFooter: V ? /*#__PURE__*/ z(b, {
151
+ className: "flex justify-end",
152
+ children: /*#__PURE__*/ z(y, { children: /*#__PURE__*/ z(m, {
153
+ variant: "primary",
154
+ onClick: P,
155
+ "data-testid": "empty-info-close-button",
156
+ children: /*#__PURE__*/ z(W, { id: "yz7wBu" })
157
+ }) })
158
+ }) : void 0,
159
+ size: "small",
160
+ disableConfirmButton: k || N.isPending || !V && !p.trim() || !V && p.trim() !== t.name,
161
+ children: [A && /*#__PURE__*/ z("p", {
162
+ className: "text-theme-error mb-4",
163
+ children: (() => {
164
+ let e = A.message;
165
+ return /*#__PURE__*/ z(W, {
166
+ id: "56IxdF",
167
+ values: { errorMessage: e }
168
+ });
169
+ })()
170
+ }), k ? /*#__PURE__*/ B(f, {
171
+ direction: "horizontal",
172
+ alignment: "center",
173
+ gap: "2",
174
+ className: "py-4",
175
+ children: [/*#__PURE__*/ z(u, { size: "small" }), /*#__PURE__*/ z(W, { id: "ujK/QN" })]
176
+ }) : V && !A ? /*#__PURE__*/ z("p", {
177
+ className: "text-theme-default py-2",
178
+ children: ne ? /*#__PURE__*/ z(W, { id: "jNm/qL" }) : /*#__PURE__*/ z(W, { id: "WefafP" })
179
+ }) : A ? null : /*#__PURE__*/ B(f, {
180
+ direction: "vertical",
181
+ gap: "6",
182
+ children: [
183
+ /*#__PURE__*/ B("p", {
184
+ className: "text-theme-default",
185
+ children: [
186
+ /*#__PURE__*/ z(W, { id: "Ioblgz" }),
187
+ /*#__PURE__*/ z("br", {}),
188
+ /*#__PURE__*/ z(W, {
189
+ id: "kiRrtv",
190
+ components: {
191
+ 0: /*#__PURE__*/ z("strong", {}),
192
+ 1: /*#__PURE__*/ z("strong", {}),
193
+ 2: /*#__PURE__*/ z("strong", {})
194
+ }
195
+ })
196
+ ]
197
+ }),
198
+ /*#__PURE__*/ B("div", {
199
+ className: "border-theme-background-lvl-3 overflow-hidden rounded border",
200
+ children: [
201
+ t.count > R && /*#__PURE__*/ z("p", {
202
+ className: "text-theme-light px-3 py-2 text-xs",
203
+ children: (() => {
204
+ let e = t.count;
205
+ return /*#__PURE__*/ z(W, {
206
+ id: "1iQtS2",
207
+ values: {
208
+ actualObjectCount: R,
209
+ total: e
210
+ }
211
+ });
212
+ })()
213
+ }),
214
+ /*#__PURE__*/ z(w, {
215
+ columns: 3,
216
+ className: "text-sm",
217
+ children: /*#__PURE__*/ B(c, { children: [
218
+ /*#__PURE__*/ z(s, { children: /*#__PURE__*/ z(W, { id: "6YtxFj" }) }),
219
+ /*#__PURE__*/ z(s, { children: /*#__PURE__*/ z(W, { id: "Cj2Gtd" }) }),
220
+ /*#__PURE__*/ z(s, { children: /*#__PURE__*/ z(W, { id: "sjMCOP" }) })
221
+ ] })
222
+ }),
223
+ /*#__PURE__*/ z("div", {
224
+ className: "max-h-48 overflow-y-auto",
225
+ children: /*#__PURE__*/ z(w, {
226
+ columns: 3,
227
+ className: "text-sm",
228
+ children: O.map((e) => /*#__PURE__*/ B(c, { children: [
229
+ /*#__PURE__*/ z(o, {
230
+ className: "max-w-[200px] truncate",
231
+ title: e.name,
232
+ children: e.name
233
+ }),
234
+ /*#__PURE__*/ z(o, { children: F(e.bytes) }),
235
+ /*#__PURE__*/ z(o, { children: e.last_modified ? new Date(e.last_modified).toLocaleString() : a._({ id: "fj5byd" }) })
236
+ ] }, e.name))
237
+ })
238
+ })
239
+ ]
240
+ }),
241
+ /*#__PURE__*/ z(C, {
242
+ label: a._({ id: "33F2A+" }),
243
+ required: !0,
244
+ value: p,
245
+ onChange: ee,
246
+ onKeyDown: L,
247
+ invalid: !!_,
248
+ errortext: _ || void 0,
249
+ disabled: N.isPending,
250
+ autoFocus: !0,
251
+ placeholder: t.name
252
+ })
253
+ ]
254
+ })]
255
+ });
256
+ }, le = ({ isOpen: e, container: t, onClose: n, onSuccess: r, onError: i }) => {
257
+ let { i18n: a, _: o } = G(), s = I(), [c, l] = H(""), [d, p] = H(null), [h, g] = H(!1), _ = M.useUtils(), { data: v, isLoading: x, error: S } = M.storage.swift.listObjects.useQuery({
258
+ project_id: s,
259
+ container: t?.name ?? "",
260
+ format: "json",
261
+ limit: 1
262
+ }, { enabled: e && t !== null }), { data: w, error: T } = M.storage.swift.getContainerMetadata.useQuery({
263
+ project_id: s,
264
+ container: t?.name ?? ""
265
+ }, { enabled: e && t !== null }), D = !!(w?.versionsEnabled || w?.versionsLocation || w?.historyLocation), O = M.storage.swift.deleteContainer.useMutation({
266
+ onSuccess: () => {
267
+ _.storage.swift.listContainers.invalidate(), r?.(t.name);
268
+ },
269
+ onError: (e) => {
270
+ i?.(t.name, e.message);
271
+ },
272
+ onSettled: () => {
273
+ k();
274
+ }
275
+ });
276
+ ie(() => {
277
+ e || (l(""), p(null), g(!1), O.reset());
278
+ }, [e, t?.name]);
279
+ let k = () => {
280
+ l(""), p(null), g(!1), O.reset(), n();
281
+ }, A = (e) => {
282
+ let t = e.target.value;
283
+ l(t), d && p(null);
284
+ }, N = () => {
285
+ if (t && !(S || T)) {
286
+ if (c.trim() !== "delete") {
287
+ p(a._({ id: "b5aNMO" }));
288
+ return;
289
+ }
290
+ D && !h || O.mutate({
291
+ project_id: s,
292
+ container: t.name
293
+ });
294
+ }
295
+ }, P = (e) => {
296
+ e.key === "Enter" && N();
297
+ };
298
+ if (!e || !t) return null;
299
+ let ee = v?.length ?? 0, F = !x && (ee > 0 || t.count > 0), te = !x && t.count > 0 && ee === 0, L = !!(S || T);
300
+ return /*#__PURE__*/ B(j, {
301
+ title: /* @__PURE__ */ B("span", {
302
+ className: "flex max-w-[400px] items-center gap-2",
303
+ children: [/*#__PURE__*/ z("span", {
304
+ className: "shrink-0",
305
+ children: /*#__PURE__*/ z(W, { id: "Vzlopx" })
306
+ }), /*#__PURE__*/ z("span", {
307
+ className: "truncate",
308
+ title: t.name,
309
+ children: t.name
310
+ })]
311
+ }),
312
+ open: e,
313
+ onCancel: k,
314
+ confirmButtonLabel: F ? void 0 : a._({ id: "cnGeoo" }),
315
+ confirmButtonVariant: F ? void 0 : "primary-danger",
316
+ onConfirm: F ? void 0 : N,
317
+ cancelButtonLabel: F ? void 0 : a._({ id: "dEgA5A" }),
318
+ modalFooter: F ? /*#__PURE__*/ z(b, {
319
+ className: "flex justify-end",
320
+ children: /*#__PURE__*/ z(y, { children: /*#__PURE__*/ z(m, {
321
+ variant: "primary",
322
+ onClick: k,
323
+ "data-testid": "delete-has-objects-close-button",
324
+ children: /*#__PURE__*/ z(W, { id: "yz7wBu" })
325
+ }) })
326
+ }) : void 0,
327
+ size: "small",
328
+ disableConfirmButton: x || L || O.isPending || !F && c.trim() !== "delete" || !F && D && !h,
329
+ children: [(S || T) && /*#__PURE__*/ B(f, {
330
+ direction: "vertical",
331
+ gap: "2",
332
+ className: "mb-4",
333
+ role: "alert",
334
+ "aria-live": "assertive",
335
+ children: [S && /*#__PURE__*/ z("p", {
336
+ className: "text-theme-error",
337
+ children: (() => {
338
+ let e = S.message;
339
+ return /*#__PURE__*/ z(W, {
340
+ id: "56IxdF",
341
+ values: { errorMessage: e }
342
+ });
343
+ })()
344
+ }), T && /*#__PURE__*/ z("p", {
345
+ className: "text-theme-error",
346
+ children: (() => {
347
+ let e = T.message;
348
+ return /*#__PURE__*/ z(W, {
349
+ id: "BCXapL",
350
+ values: { errorMessage: e }
351
+ });
352
+ })()
353
+ })]
354
+ }), x ? /*#__PURE__*/ B(f, {
355
+ direction: "horizontal",
356
+ alignment: "center",
357
+ gap: "2",
358
+ className: "py-4",
359
+ children: [/*#__PURE__*/ z(u, { size: "small" }), /*#__PURE__*/ z(W, { id: "Z3FXyt" })]
360
+ }) : F ? /*#__PURE__*/ B(f, {
361
+ direction: "vertical",
362
+ gap: "3",
363
+ children: [/*#__PURE__*/ z("p", {
364
+ className: "text-theme-default",
365
+ children: /*#__PURE__*/ z(W, { id: "3dBmvU" })
366
+ }), te && /*#__PURE__*/ z("p", {
367
+ className: "text-theme-default",
368
+ children: /*#__PURE__*/ z(W, { id: "x3T4pq" })
369
+ })]
370
+ }) : /*#__PURE__*/ B(f, {
371
+ direction: "vertical",
372
+ gap: "6",
373
+ children: [
374
+ /*#__PURE__*/ B("p", {
375
+ className: "text-theme-default",
376
+ children: [
377
+ /*#__PURE__*/ z(W, { id: "Y8M9Uc" }),
378
+ /*#__PURE__*/ z("br", {}),
379
+ /*#__PURE__*/ z(W, {
380
+ id: "YzUoh9",
381
+ components: { 0: /*#__PURE__*/ z("strong", {}) }
382
+ })
383
+ ]
384
+ }),
385
+ D && /*#__PURE__*/ z(E, {
386
+ label: a._({ id: "V/8B9A" }),
387
+ checked: h,
388
+ onChange: (e) => g(e.target.checked),
389
+ invalid: !h
390
+ }),
391
+ /*#__PURE__*/ z(C, {
392
+ label: a._({ id: "QytzQr" }),
393
+ required: !0,
394
+ value: c,
395
+ onChange: A,
396
+ onKeyDown: P,
397
+ invalid: !!d,
398
+ errortext: d || void 0,
399
+ disabled: O.isPending,
400
+ autoFocus: !0,
401
+ placeholder: a._({ id: "HNlEFZ" })
402
+ })
403
+ ]
404
+ })]
405
+ });
406
+ }, ue = new Set([
407
+ "quota-bytes",
408
+ "quota-count",
409
+ "web-index",
410
+ "web-listings",
411
+ "web-listings-css",
412
+ "web-error"
413
+ ]), de = 50, fe = /^[a-zA-Z0-9!#$%&'*+\-.^_`|~]+$/, Y = ({ isOpen: e, container: r, onClose: i, onSuccess: a, onError: l }) => {
414
+ let { i18n: d, _: p } = G(), h = I(), { data: _, isLoading: y, isError: b, error: x } = M.storage.swift.getContainerMetadata.useQuery({
415
+ project_id: h,
416
+ container: r?.name ?? ""
417
+ }, { enabled: e && r !== null }), S = _?.read === ".r:*,.rlistings", { data: D } = M.storage.swift.getContainerPublicUrl.useQuery({
418
+ project_id: h,
419
+ container: r?.name ?? ""
420
+ }, { enabled: e && r !== null && S }), { data: O } = M.storage.swift.listContainers.useQuery({ project_id: h }, { enabled: e }), [A, N] = H(""), [P, ee] = H(""), F = ae(null), te = V((e) => {
421
+ let t = e.target.value;
422
+ N(t), F.current && clearTimeout(F.current), F.current = setTimeout(() => ee(t), 300);
423
+ }, []), L = P.trim().length > 0 ? (O ?? []).filter((e) => e.name !== r?.name && e.name.toLowerCase().includes(P.toLowerCase())) : [], R = L.slice(0, de), ne = L.length - R.length, re = M.useUtils(), [U, oe] = H(""), [K, se] = H(null), [q, ce] = H(""), [J, le] = H(null), [Y, pe] = H(""), [me, he] = H(!1), [ge, _e] = H(!1), [ve, ye] = H(""), [X, Z] = H([]), [be, xe] = H({}), [Q, Se] = H(!1), [Ce, we] = H(""), [Te, Ee] = H(""), [De, Oe] = H(null), [ke, Ae] = H(null);
424
+ ie(() => {
425
+ if (!_) return;
426
+ oe(_.quotaBytes == null ? "" : String(_.quotaBytes)), ce(_.quotaCount == null ? "" : String(_.quotaCount)), _e(!!(_.versionsEnabled || _.versionsLocation || _.historyLocation)), ye(_.versionsLocation || _.historyLocation || "");
427
+ let e = _.metadata ?? {};
428
+ pe(e["web-index"] ?? ""), he(e["web-listings"] === "1" || e["web-listings"] === "true");
429
+ let t = _.metadata ?? {};
430
+ Z(Object.entries(t).filter(([e]) => !ue.has(e)).map(([e, t]) => ({
431
+ key: e,
432
+ value: t,
433
+ isNew: !1,
434
+ isEditing: !1,
435
+ originalKey: e,
436
+ originalValue: t
437
+ })));
438
+ }, [_]), ie(() => {
439
+ e || je();
440
+ }, [e]);
441
+ let je = () => {
442
+ oe(""), se(null), ce(""), le(null), pe(""), he(!1), _e(!1), ye(""), N(""), ee(""), F.current && clearTimeout(F.current), Z([]), xe({}), Se(!1), we(""), Ee(""), Oe(null), Ae(null), Me.reset();
443
+ }, Me = M.storage.swift.updateContainerMetadata.useMutation({
444
+ onSuccess: () => {
445
+ re.storage.swift.getContainerMetadata.invalidate({ container: r.name }), re.storage.swift.listContainers.invalidate(), a?.(r.name), Ue();
446
+ },
447
+ onError: (e) => {
448
+ l?.(r.name, e.message);
449
+ }
450
+ }), $ = () => {
451
+ let e = !0;
452
+ return U !== "" && (isNaN(Number(U)) || Number(U) < 0) ? (se(d._({ id: "AuQtzx" })), e = !1) : se(null), q !== "" && (isNaN(Number(q)) || Number(q) < 0) ? (le(d._({ id: "AuQtzx" })), e = !1) : le(null), e;
453
+ }, Ne = (e, t) => e.trim() ? fe.test(e) ? /[a-zA-Z0-9]/.test(e) ? ue.has(e.toLowerCase()) ? d._({ id: "JeRXll" }) : X.some((n) => n.key.toLowerCase() === e.toLowerCase() && n.originalKey !== t) ? d._({ id: "i6/ygf" }) : null : d._({ id: "dTNzBI" }) : d._({ id: "XYZLy9" }) : d._({ id: "QV1ZPO" }), Pe = () => {
454
+ let e = Ne(Ce);
455
+ if (e) {
456
+ Oe(e);
457
+ return;
458
+ }
459
+ if (!Te.trim()) {
460
+ Ae(d._({ id: "hXUWyd" }));
461
+ return;
462
+ }
463
+ Z([...X, {
464
+ key: Ce.trim(),
465
+ value: Te.trim(),
466
+ isNew: !0,
467
+ isEditing: !1
468
+ }]), we(""), Ee(""), Se(!1), Oe(null), Ae(null);
469
+ }, Fe = () => {
470
+ we(""), Ee(""), Se(!1), Oe(null), Ae(null);
471
+ }, Ie = (e) => {
472
+ Z(X.map((t, n) => n === e ? {
473
+ ...t,
474
+ isEditing: !0
475
+ } : {
476
+ ...t,
477
+ isEditing: !1
478
+ })), Se(!1);
479
+ }, Le = (e) => {
480
+ let t = X[e], n = Ne(t.key, t.originalKey);
481
+ if (n) {
482
+ xe({ [`edit-${e}`]: n });
483
+ return;
484
+ }
485
+ if (!t.value.trim()) {
486
+ xe({ [`edit-${e}`]: d._({ id: "hXUWyd" }) });
487
+ return;
488
+ }
489
+ Z(X.map((t, n) => n === e ? {
490
+ ...t,
491
+ isEditing: !1,
492
+ key: t.key.trim(),
493
+ value: t.value.trim()
494
+ } : t)), xe({});
495
+ }, Re = (e) => {
496
+ Z(X.map((t, n) => n === e ? {
497
+ ...t,
498
+ isEditing: !1,
499
+ key: t.originalKey ?? t.key,
500
+ value: t.originalValue ?? t.value
501
+ } : t)), xe({});
502
+ }, ze = (e) => {
503
+ Z(X.filter((t, n) => n !== e)), xe({});
504
+ }, Be = (e, t) => {
505
+ Z(X.map((n, r) => r === e ? {
506
+ ...n,
507
+ key: t
508
+ } : n)), xe((t) => {
509
+ let n = { ...t };
510
+ return delete n[`edit-${e}`], n;
511
+ });
512
+ }, Ve = (e, t) => {
513
+ Z(X.map((n, r) => r === e ? {
514
+ ...n,
515
+ value: t
516
+ } : n)), xe((t) => {
517
+ let n = { ...t };
518
+ return delete n[`edit-${e}`], n;
519
+ });
520
+ }, He = () => {
521
+ if (!r || !$()) return;
522
+ let e = _?.metadata ?? {}, t = {}, n = [];
523
+ X.forEach((e) => {
524
+ (e.isNew || e.value !== e.originalValue || e.key !== e.originalKey) && (t[e.key] = e.value, !e.isNew && e.originalKey && e.key !== e.originalKey && n.push(e.originalKey));
525
+ });
526
+ let i = Object.keys(e).filter((e) => !ue.has(e)), a = X.map((e) => e.originalKey).filter(Boolean);
527
+ i.forEach((e) => {
528
+ !a.includes(e) && !n.includes(e) && n.push(e);
529
+ }), S && (Y ? t["web-index"] = Y : _?.metadata?.["web-index"] && n.push("web-index"), me ? t["web-listings"] = "1" : _?.metadata?.["web-listings"] && n.push("web-listings"));
530
+ let o = !!(_?.versionsEnabled || _?.versionsLocation || _?.historyLocation), s = _?.versionsLocation || _?.historyLocation || "";
531
+ Me.mutate({
532
+ project_id: h,
533
+ container: r.name,
534
+ metadata: t,
535
+ removeMetadata: n.length ? n : void 0,
536
+ quotaBytes: U === "" ? void 0 : Number(U),
537
+ quotaCount: q === "" ? void 0 : Number(q),
538
+ versionsLocation: ge && (!o || ve !== s) && ve ? ve : void 0,
539
+ removeVersionsLocation: !ge && o ? !0 : void 0
540
+ });
541
+ }, Ue = () => {
542
+ je(), i();
543
+ };
544
+ if (!e || !r) return null;
545
+ let We = y || Me.isPending, Ge = b && !y, Ke = X.some((e) => e.isEditing), qe = _?.quotaBytes == null ? "" : String(_.quotaBytes), Je = _?.quotaCount == null ? "" : String(_.quotaCount), Ye = !!_?.versionsEnabled, Xe = _?.versionsLocation || _?.historyLocation || "", Ze = _?.metadata?.["web-index"] ?? "", Qe = _?.metadata?.["web-listings"] === "1" || _?.metadata?.["web-listings"] === "true", $e = Object.keys(_?.metadata ?? {}).filter((e) => !ue.has(e)), et = X.length === $e.length && X.every((e) => !e.isNew && e.key === e.originalKey && e.value === e.originalValue), tt = U === qe && q === Je && ge === Ye && ve === Xe && Y === Ze && me === Qe && et, nt = _?.quotaBytes == null ? null : `${_.quotaBytes} B`;
546
+ return /*#__PURE__*/ B(j, {
547
+ title: /*#__PURE__*/ B("span", {
548
+ className: "flex max-w-[500px] items-center gap-2",
549
+ children: [/*#__PURE__*/ z("span", {
550
+ className: "shrink-0",
551
+ children: /*#__PURE__*/ z(W, { id: "y02Bu1" })
552
+ }), /*#__PURE__*/ z("span", {
553
+ className: "truncate",
554
+ title: r.name,
555
+ children: r.name
556
+ })]
557
+ }),
558
+ open: e,
559
+ onCancel: Ue,
560
+ confirmButtonLabel: d._({ id: "tfDRzk" }),
561
+ onConfirm: He,
562
+ cancelButtonLabel: d._({ id: "dEgA5A" }),
563
+ size: "large",
564
+ disableConfirmButton: We || Q || Ke || tt || Ge,
565
+ children: [Me.isError && /*#__PURE__*/ z("p", {
566
+ className: "text-theme-error mb-4",
567
+ children: (() => {
568
+ let e = Me.error.message;
569
+ return /*#__PURE__*/ z(W, {
570
+ id: "nUuaq8",
571
+ values: { errorMessage: e }
572
+ });
573
+ })()
574
+ }), y ? /*#__PURE__*/ B(f, {
575
+ direction: "horizontal",
576
+ alignment: "center",
577
+ gap: "2",
578
+ className: "py-8",
579
+ children: [/*#__PURE__*/ z(u, { size: "small" }), /*#__PURE__*/ z(W, { id: "WRZ3Mt" })]
580
+ }) : Ge ? /*#__PURE__*/ z("p", {
581
+ className: "text-theme-error py-8 text-center",
582
+ children: /*#__PURE__*/ z(W, {
583
+ id: "BCXapL",
584
+ values: { errorMessage: x?.message ?? "Unknown error" }
585
+ })
586
+ }) : /*#__PURE__*/ z("div", {
587
+ className: "max-h-[65vh] overflow-y-auto pr-1 pl-1",
588
+ children: /*#__PURE__*/ B(f, {
589
+ direction: "vertical",
590
+ gap: "6",
591
+ children: [
592
+ /*#__PURE__*/ B("div", {
593
+ className: "grid grid-cols-2 gap-4",
594
+ children: [/*#__PURE__*/ z(C, {
595
+ label: d._({ id: "z45o5B" }),
596
+ value: String(r.count),
597
+ disabled: !0,
598
+ readOnly: !0
599
+ }), /*#__PURE__*/ z(C, {
600
+ label: d._({ id: "/InK0O" }),
601
+ value: _?.bytesUsed == null ? `${r.bytes.toLocaleString()} B` : `${_.bytesUsed.toLocaleString()} B`,
602
+ disabled: !0,
603
+ readOnly: !0
604
+ })]
605
+ }),
606
+ /*#__PURE__*/ B("div", {
607
+ className: "grid grid-cols-2 gap-4",
608
+ children: [/*#__PURE__*/ z("div", { children: /*#__PURE__*/ z(C, {
609
+ label: d._({ id: "k0vAWv" }),
610
+ value: q,
611
+ onChange: (e) => {
612
+ ce(e.target.value), J && le(null);
613
+ },
614
+ placeholder: d._({ id: "qtoOYG" }),
615
+ invalid: !!J,
616
+ errortext: J ?? void 0,
617
+ disabled: We
618
+ }) }), /*#__PURE__*/ z("div", { children: /*#__PURE__*/ z(C, {
619
+ label: d._({ id: "KOpPMt" }),
620
+ value: U,
621
+ onChange: (e) => {
622
+ oe(e.target.value), K && se(null);
623
+ },
624
+ placeholder: d._({ id: "qtoOYG" }),
625
+ invalid: !!K,
626
+ errortext: K ?? void 0,
627
+ disabled: We,
628
+ helptext: U && nt ? nt : void 0
629
+ }) })]
630
+ }),
631
+ S && D && /*#__PURE__*/ B("div", { children: [/*#__PURE__*/ B("p", {
632
+ className: "text-theme-default mb-1 text-sm font-semibold",
633
+ children: [
634
+ /*#__PURE__*/ z(W, { id: "mvz5Eo" }),
635
+ " ",
636
+ /*#__PURE__*/ z("a", {
637
+ href: D,
638
+ target: "_blank",
639
+ rel: "noopener noreferrer",
640
+ className: "text-theme-info text-xs font-normal underline",
641
+ children: /*#__PURE__*/ z(W, { id: "Alx2/L" })
642
+ })
643
+ ]
644
+ }), /*#__PURE__*/ z(C, {
645
+ value: D,
646
+ disabled: !0,
647
+ readOnly: !0
648
+ })] }),
649
+ /*#__PURE__*/ B("div", { children: [/*#__PURE__*/ z("p", {
650
+ className: "text-theme-default mb-3 text-sm font-semibold",
651
+ children: /*#__PURE__*/ z(W, { id: "6CDYXS" })
652
+ }), S ? /*#__PURE__*/ B(f, {
653
+ direction: "vertical",
654
+ gap: "4",
655
+ children: [/*#__PURE__*/ B(f, {
656
+ direction: "vertical",
657
+ gap: "1",
658
+ children: [/*#__PURE__*/ z(E, {
659
+ label: d._({ id: "6+7EwD" }),
660
+ checked: !!Y,
661
+ onChange: (e) => {
662
+ e.target.checked ? Y || pe("index.html") : pe("");
663
+ },
664
+ disabled: We
665
+ }), /*#__PURE__*/ z("div", {
666
+ className: "pl-6",
667
+ children: /*#__PURE__*/ z(C, {
668
+ value: Y,
669
+ onChange: (e) => pe(e.target.value),
670
+ placeholder: "index.html",
671
+ disabled: We || !Y,
672
+ className: "flex-1"
673
+ })
674
+ })]
675
+ }), /*#__PURE__*/ B(f, {
676
+ direction: "horizontal",
677
+ alignment: "start",
678
+ gap: "2",
679
+ children: [/*#__PURE__*/ z(E, {
680
+ label: d._({ id: "NeUjqc" }),
681
+ checked: me,
682
+ onChange: (e) => he(e.target.checked),
683
+ disabled: We
684
+ }), /*#__PURE__*/ B(t, {
685
+ triggerEvent: "hover",
686
+ children: [/*#__PURE__*/ z(T, { children: /*#__PURE__*/ z(g, {
687
+ icon: "help",
688
+ size: "16",
689
+ className: "text-theme-light cursor-help"
690
+ }) }), /*#__PURE__*/ z(n, {
691
+ className: "z-10 max-w-[220px]",
692
+ children: /*#__PURE__*/ z(W, { id: "Oxl1UN" })
693
+ })]
694
+ })]
695
+ })]
696
+ }) : /*#__PURE__*/ z("p", {
697
+ className: "text-theme-default text-sm",
698
+ children: /*#__PURE__*/ z(W, {
699
+ id: "aSsVD3",
700
+ components: { 0: /*#__PURE__*/ z("strong", {}) }
701
+ })
702
+ })] }),
703
+ /*#__PURE__*/ B("div", { children: [/*#__PURE__*/ z("p", {
704
+ className: "text-theme-default mb-2 text-sm font-semibold",
705
+ children: /*#__PURE__*/ z(W, { id: "jNzyQo" })
706
+ }), Ye && !ve ? /*#__PURE__*/ z(E, {
707
+ label: d._({ id: "Nvfd2b" }),
708
+ checked: !0,
709
+ onChange: (e) => {
710
+ e.target.checked || (_e(!1), ye(""), N(""), ee(""));
711
+ },
712
+ disabled: !0
713
+ }) : !ge && !ve ? /*#__PURE__*/ z(E, {
714
+ label: d._({ id: "WyKwnD" }),
715
+ checked: !1,
716
+ onChange: (e) => _e(e.target.checked),
717
+ disabled: We
718
+ }) : /*#__PURE__*/ B(f, {
719
+ direction: "vertical",
720
+ gap: "1",
721
+ children: [/*#__PURE__*/ z(E, {
722
+ label: d._({ id: "b0uU1G" }),
723
+ checked: ge,
724
+ onChange: (e) => {
725
+ _e(e.target.checked), e.target.checked || (ye(""), N(""), ee(""));
726
+ },
727
+ disabled: We
728
+ }), ge && /*#__PURE__*/ z("div", {
729
+ className: "pl-6",
730
+ children: /*#__PURE__*/ z(v, {
731
+ value: ve,
732
+ onChange: (e) => ye(e),
733
+ onInputChange: te,
734
+ placeholder: d._({ id: "a13wDR" }),
735
+ helptext: (() => {
736
+ if (A.trim().length === 0) return d._({ id: "c+fUtV" });
737
+ if (ne > 0) {
738
+ let e = de, t = L.length;
739
+ return d._({
740
+ id: "qzhUb9",
741
+ values: {
742
+ maxOptions: e,
743
+ totalCount: t
744
+ }
745
+ });
746
+ }
747
+ })(),
748
+ disabled: We,
749
+ children: R.map((e) => /*#__PURE__*/ z(k, {
750
+ value: e.name,
751
+ children: e.name
752
+ }, e.name))
753
+ })
754
+ })]
755
+ })] }),
756
+ /*#__PURE__*/ B("div", { children: [
757
+ /*#__PURE__*/ B(f, {
758
+ direction: "horizontal",
759
+ alignment: "center",
760
+ distribution: "between",
761
+ className: "mb-3",
762
+ children: [/*#__PURE__*/ z("p", {
763
+ className: "text-theme-default text-sm font-semibold",
764
+ children: /*#__PURE__*/ z(W, { id: "6GBt0m" })
765
+ }), /*#__PURE__*/ z("p", {
766
+ className: "text-theme-light text-xs",
767
+ children: /*#__PURE__*/ z(W, { id: "kuYWaD" })
768
+ })]
769
+ }),
770
+ /*#__PURE__*/ z(f, {
771
+ direction: "horizontal",
772
+ className: "jn:bg-theme-background-lvl-1 justify-end p-2",
773
+ children: /*#__PURE__*/ z(m, {
774
+ label: d._({ id: "sWBLli" }),
775
+ onClick: () => Se(!0),
776
+ variant: "primary",
777
+ icon: "addCircle",
778
+ size: "small",
779
+ disabled: Q || Ke || We
780
+ })
781
+ }),
782
+ /*#__PURE__*/ B(w, {
783
+ columns: 3,
784
+ children: [
785
+ /*#__PURE__*/ B(c, { children: [
786
+ /*#__PURE__*/ z(s, { children: /*#__PURE__*/ z(W, { id: "7sMeHQ" }) }),
787
+ /*#__PURE__*/ z(s, { children: /*#__PURE__*/ z(W, { id: "wMHvYH" }) }),
788
+ /*#__PURE__*/ z(s, { children: /*#__PURE__*/ z(W, { id: "7L01XJ" }) })
789
+ ] }),
790
+ Q && /*#__PURE__*/ B(c, { children: [
791
+ /*#__PURE__*/ z(o, { children: /*#__PURE__*/ z(C, {
792
+ value: Ce,
793
+ onChange: (e) => {
794
+ we(e.target.value), De && Oe(null);
795
+ },
796
+ placeholder: d._({ id: "x9AdZ8" }),
797
+ errortext: De ?? void 0,
798
+ invalid: !!De,
799
+ autoFocus: !0
800
+ }) }),
801
+ /*#__PURE__*/ z(o, { children: /*#__PURE__*/ z(C, {
802
+ value: Te,
803
+ onChange: (e) => {
804
+ Ee(e.target.value), ke && Ae(null);
805
+ },
806
+ placeholder: d._({ id: "wMHvYH" }),
807
+ errortext: ke ?? void 0,
808
+ invalid: !!ke
809
+ }) }),
810
+ /*#__PURE__*/ z(o, { children: /*#__PURE__*/ B(f, {
811
+ direction: "horizontal",
812
+ gap: "2",
813
+ children: [/*#__PURE__*/ z(m, {
814
+ size: "small",
815
+ variant: "primary",
816
+ onClick: Pe,
817
+ icon: "check",
818
+ title: d._({ id: "tfDRzk" })
819
+ }), /*#__PURE__*/ z(m, {
820
+ size: "small",
821
+ variant: "subdued",
822
+ onClick: Fe,
823
+ icon: "close",
824
+ title: d._({ id: "bzSI52" })
825
+ })]
826
+ }) })
827
+ ] }),
828
+ X.map((e, t) => /*#__PURE__*/ B(c, { children: [
829
+ /*#__PURE__*/ z(o, { children: e.isEditing ? /*#__PURE__*/ z(C, {
830
+ value: e.key,
831
+ onChange: (e) => Be(t, e.target.value),
832
+ errortext: be[`edit-${t}`],
833
+ invalid: !!be[`edit-${t}`]
834
+ }) : /*#__PURE__*/ z("span", {
835
+ className: "block max-w-xs truncate text-sm",
836
+ title: e.key,
837
+ children: e.key
838
+ }) }),
839
+ /*#__PURE__*/ z(o, { children: e.isEditing ? /*#__PURE__*/ z(C, {
840
+ value: e.value,
841
+ onChange: (e) => Ve(t, e.target.value)
842
+ }) : /*#__PURE__*/ z("span", {
843
+ className: "block max-w-md truncate text-sm",
844
+ title: e.value,
845
+ children: e.value
846
+ }) }),
847
+ /*#__PURE__*/ z(o, { children: e.isEditing ? /*#__PURE__*/ B(f, {
848
+ direction: "horizontal",
849
+ gap: "2",
850
+ children: [/*#__PURE__*/ z(m, {
851
+ size: "small",
852
+ variant: "primary",
853
+ onClick: () => Le(t),
854
+ icon: "check",
855
+ title: d._({ id: "tfDRzk" })
856
+ }), /*#__PURE__*/ z(m, {
857
+ size: "small",
858
+ variant: "subdued",
859
+ onClick: () => Re(t),
860
+ icon: "close",
861
+ title: d._({ id: "bzSI52" })
862
+ })]
863
+ }) : /*#__PURE__*/ B(f, {
864
+ direction: "horizontal",
865
+ gap: "2",
866
+ children: [/*#__PURE__*/ z(m, {
867
+ size: "small",
868
+ variant: "subdued",
869
+ onClick: () => Ie(t),
870
+ icon: "edit",
871
+ title: d._({ id: "ePK91l" }),
872
+ disabled: Q || Ke || We
873
+ }), /*#__PURE__*/ z(m, {
874
+ size: "small",
875
+ variant: "primary-danger",
876
+ onClick: () => ze(t),
877
+ icon: "deleteForever",
878
+ title: d._({ id: "cnGeoo" }),
879
+ disabled: Q || Ke || We
880
+ })]
881
+ }) })
882
+ ] }, t)),
883
+ X.length === 0 && !Q && /*#__PURE__*/ z(c, { children: /*#__PURE__*/ z(o, {
884
+ colSpan: 3,
885
+ className: "py-6 text-center",
886
+ children: /*#__PURE__*/ z(f, {
887
+ alignment: "center",
888
+ children: /*#__PURE__*/ z("span", {
889
+ className: "text-theme-light text-sm",
890
+ children: /*#__PURE__*/ z(W, { id: "F02e8I" })
891
+ })
892
+ })
893
+ }) })
894
+ ]
895
+ })
896
+ ] })
897
+ ]
898
+ })
899
+ })]
900
+ });
901
+ };
902
+ //#endregion
903
+ //#region src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Containers/ManageContainerAccessModal.tsx
904
+ function pe(e) {
905
+ let t = e.trim();
906
+ if (t === ".r:*") return {
907
+ raw: t,
908
+ type: "any-referrer",
909
+ description: "",
910
+ requiresToken: !1
911
+ };
912
+ if (t.startsWith(".r:")) {
913
+ let e = t.slice(3), n = e.startsWith("-"), r = n ? e.slice(1) : e;
914
+ return {
915
+ raw: t,
916
+ type: n ? "denied-referrer" : "specific-referrer",
917
+ host: r,
918
+ description: "",
919
+ requiresToken: !1
920
+ };
921
+ }
922
+ if (t === ".rlistings") return {
923
+ raw: t,
924
+ type: "listing-access",
925
+ description: "",
926
+ requiresToken: !1
927
+ };
928
+ if (/^[^:]+:\*$/.test(t) && !t.startsWith("*")) {
929
+ let [e] = t.split(":");
930
+ return {
931
+ raw: t,
932
+ type: "all-project-users",
933
+ projectId: e,
934
+ description: "",
935
+ requiresToken: !0
936
+ };
937
+ }
938
+ if (t.startsWith("*:")) return {
939
+ raw: t,
940
+ type: "specific-user-any-project",
941
+ userId: t.slice(2),
942
+ description: "",
943
+ requiresToken: !0
944
+ };
945
+ if (t.includes(":")) {
946
+ let [e, n] = t.split(":");
947
+ return {
948
+ raw: t,
949
+ type: "specific-user",
950
+ projectId: e,
951
+ userId: n,
952
+ description: "",
953
+ requiresToken: !0
954
+ };
955
+ }
956
+ return {
957
+ raw: t,
958
+ type: "unknown",
959
+ description: "",
960
+ requiresToken: !0
961
+ };
962
+ }
963
+ function me(e) {
964
+ return e.trim() ? e.split(",").map((e) => e.trim()).filter(Boolean).map(pe) : [];
965
+ }
966
+ var he = [".r:*", ".rlistings"];
967
+ function ge(e) {
968
+ let t = e.split(",").map((e) => e.trim()).filter(Boolean);
969
+ return he.every((e) => t.includes(e));
970
+ }
971
+ function _e(e) {
972
+ let t = e.split(",").map((e) => e.trim()).filter(Boolean);
973
+ return [...new Set([...he, ...t])].join(",");
974
+ }
975
+ function ve(e) {
976
+ return e.split(",").map((e) => e.trim()).filter((e) => !he.includes(e)).join(",");
977
+ }
978
+ function ye(e) {
979
+ switch (e.type) {
980
+ case "any-referrer": return K._({ id: "HVdrr1" });
981
+ case "denied-referrer": {
982
+ let t = e.host || "";
983
+ return K._({
984
+ id: "7XQ3QJ",
985
+ values: { host: t }
986
+ });
987
+ }
988
+ case "specific-referrer": {
989
+ let t = e.host || "";
990
+ return K._({
991
+ id: "Dqnh7K",
992
+ values: { host: t }
993
+ });
994
+ }
995
+ case "listing-access": return K._({ id: "ntNlXu" });
996
+ case "all-project-users": {
997
+ let t = e.projectId || "";
998
+ return K._({
999
+ id: "sa4CV6",
1000
+ values: { projectId: t }
1001
+ });
1002
+ }
1003
+ case "specific-user-any-project": {
1004
+ let t = e.userId || "";
1005
+ return K._({
1006
+ id: "izMhIO",
1007
+ values: { userId: t }
1008
+ });
1009
+ }
1010
+ case "specific-user": {
1011
+ let t = e.projectId || "", n = e.userId || "";
1012
+ return K._({
1013
+ id: "cXuXkb",
1014
+ values: {
1015
+ userId: n,
1016
+ projectId: t
1017
+ }
1018
+ });
1019
+ }
1020
+ default: return e.raw;
1021
+ }
1022
+ }
1023
+ var X = ({ isOpen: e, container: t, onClose: n, onSuccess: r, onError: a }) => {
1024
+ let { i18n: o, _: s } = G(), c = I(), [l, h] = H(""), [g, _] = H(""), [v, y] = H(!1), [b, x] = H(!1);
1025
+ ie(() => {
1026
+ !l.trim() && !g.trim() && x(!1);
1027
+ }, [l, g]);
1028
+ let { data: S, isLoading: C, isError: w, error: T } = M.storage.swift.getContainerMetadata.useQuery({
1029
+ project_id: c,
1030
+ container: t?.name ?? ""
1031
+ }, { enabled: e && t !== null });
1032
+ ie(() => {
1033
+ if (!S) return;
1034
+ let e = S.read ?? "", t = S.write ?? "";
1035
+ h(e), _(t), y(ge(e));
1036
+ }, [S]);
1037
+ let k = M.useUtils(), A = M.storage.swift.updateContainerMetadata.useMutation({
1038
+ onSuccess: () => {
1039
+ k.storage.swift.getContainerMetadata.invalidate({
1040
+ project_id: c,
1041
+ container: t.name
1042
+ }), k.storage.swift.listContainers.invalidate(), r?.(t.name), P();
1043
+ },
1044
+ onError: (e) => {
1045
+ a?.(t.name, e.message);
1046
+ }
1047
+ }), N = ae(A.reset);
1048
+ N.current = A.reset;
1049
+ let P = () => {
1050
+ h(""), _(""), y(!1), x(!1), A.reset(), n();
1051
+ };
1052
+ ie(() => {
1053
+ e || (h(""), _(""), y(!1), N.current());
1054
+ }, [e]);
1055
+ let ee = (e) => {
1056
+ let t = e.target.checked;
1057
+ y(t), h((e) => t ? _e(e) : ve(e));
1058
+ }, F = (e) => {
1059
+ let t = e.target.value;
1060
+ h(t), y(ge(t));
1061
+ }, te = () => {
1062
+ t && A.mutate({
1063
+ project_id: c,
1064
+ container: t.name,
1065
+ read: l.trim(),
1066
+ write: g.trim()
1067
+ });
1068
+ };
1069
+ if (!e || !t) return null;
1070
+ let L = C || A.isPending, re = l.trim().length > 0 || g.trim().length > 0, V = me(l), U = me(g);
1071
+ return /*#__PURE__*/ B(j, {
1072
+ title: /* @__PURE__ */ B("span", {
1073
+ className: "flex items-center gap-2",
1074
+ children: [/*#__PURE__*/ z(W, { id: "EdxcAN" }), /*#__PURE__*/ z("span", {
1075
+ className: "max-w-[250px] truncate",
1076
+ title: t.name,
1077
+ children: t.name
1078
+ })]
1079
+ }),
1080
+ open: e,
1081
+ onCancel: P,
1082
+ confirmButtonLabel: o._({ id: "tfDRzk" }),
1083
+ onConfirm: te,
1084
+ cancelButtonLabel: o._({ id: "dEgA5A" }),
1085
+ size: "xl",
1086
+ disableConfirmButton: L || w,
1087
+ children: [A.isError && /*#__PURE__*/ z("p", {
1088
+ className: "text-theme-error mb-4",
1089
+ children: (() => {
1090
+ let e = A.error.message;
1091
+ return /*#__PURE__*/ z(W, {
1092
+ id: "u2xIeO",
1093
+ values: { errorMessage: e }
1094
+ });
1095
+ })()
1096
+ }), /*#__PURE__*/ B("div", {
1097
+ className: "max-h-[70vh] overflow-y-auto pr-1 pl-1",
1098
+ children: [
1099
+ /*#__PURE__*/ z("div", {
1100
+ className: "mb-4",
1101
+ children: /*#__PURE__*/ z(p, {
1102
+ variant: "warning",
1103
+ className: "mb-4",
1104
+ children: /*#__PURE__*/ z(W, { id: "wH0MtN" })
1105
+ })
1106
+ }),
1107
+ C ? /*#__PURE__*/ B(f, {
1108
+ direction: "horizontal",
1109
+ alignment: "center",
1110
+ gap: "2",
1111
+ className: "py-6",
1112
+ children: [/*#__PURE__*/ z(u, { size: "small" }), /*#__PURE__*/ z(W, { id: "poCbZw" })]
1113
+ }) : w ? /*#__PURE__*/ z("p", {
1114
+ className: "text-theme-error py-2",
1115
+ children: /*#__PURE__*/ z(W, {
1116
+ id: "QNHur0",
1117
+ values: { errorMessage: T?.message ?? "" }
1118
+ })
1119
+ }) : /*#__PURE__*/ z(R, { children: /*#__PURE__*/ B("div", {
1120
+ className: "flex gap-6",
1121
+ children: [/*#__PURE__*/ z("div", {
1122
+ className: "min-w-0 flex-1",
1123
+ children: /*#__PURE__*/ B(f, {
1124
+ direction: "vertical",
1125
+ gap: "6",
1126
+ children: [
1127
+ /*#__PURE__*/ B("div", { children: [
1128
+ /*#__PURE__*/ z(be, { label: o._({ id: "SBGiGm" }) }),
1129
+ /*#__PURE__*/ z(d, {
1130
+ value: l,
1131
+ onChange: F,
1132
+ disabled: L || v,
1133
+ placeholder: o._({ id: "FKL6Jv" }),
1134
+ className: "text-sm",
1135
+ rows: 3
1136
+ }),
1137
+ /*#__PURE__*/ z(E, {
1138
+ label: o._({ id: "23wBCX" }),
1139
+ checked: v,
1140
+ onChange: ee,
1141
+ disabled: L,
1142
+ className: "mt-2"
1143
+ })
1144
+ ] }),
1145
+ /*#__PURE__*/ B("div", { children: [/*#__PURE__*/ z(be, { label: o._({ id: "6qzsuS" }) }), /*#__PURE__*/ z(d, {
1146
+ value: g,
1147
+ onChange: (e) => {
1148
+ let t = e.target.value;
1149
+ _(t);
1150
+ },
1151
+ disabled: L,
1152
+ placeholder: o._({ id: "UVFHGY" }),
1153
+ className: "text-sm",
1154
+ rows: 3
1155
+ })] }),
1156
+ re && /*#__PURE__*/ z(m, {
1157
+ label: b ? o._({ id: "we28Pq" }) : o._({ id: "YiMCKk" }),
1158
+ onClick: () => x((e) => !e),
1159
+ variant: "subdued",
1160
+ disabled: L,
1161
+ className: "self-start"
1162
+ }),
1163
+ b && (V.length > 0 || U.length > 0) && /*#__PURE__*/ B(f, {
1164
+ direction: "vertical",
1165
+ gap: "4",
1166
+ children: [V.length > 0 && /*#__PURE__*/ B("div", { children: [/*#__PURE__*/ z("p", {
1167
+ className: "text-theme-default mb-2 text-sm font-semibold",
1168
+ children: /*#__PURE__*/ z(W, { id: "x7SF89" })
1169
+ }), /*#__PURE__*/ z("div", {
1170
+ className: "border-theme-background-lvl-3 rounded border p-3",
1171
+ children: /*#__PURE__*/ z(O, {
1172
+ className: "grid-cols-2",
1173
+ alignTerms: "left",
1174
+ children: V.map((e, t) => /*#__PURE__*/ B(ne, { children: [/*#__PURE__*/ z(D, {
1175
+ className: "col-span-1",
1176
+ children: /*#__PURE__*/ z("span", {
1177
+ className: "block truncate text-xs",
1178
+ title: e.raw,
1179
+ children: e.raw
1180
+ })
1181
+ }), /*#__PURE__*/ B(i, {
1182
+ className: "col-span-1",
1183
+ children: [/*#__PURE__*/ z("span", {
1184
+ className: "block truncate text-sm",
1185
+ title: ye(e),
1186
+ children: ye(e)
1187
+ }), /*#__PURE__*/ z("span", {
1188
+ className: "text-theme-light block text-xs",
1189
+ children: e.requiresToken ? /*#__PURE__*/ z(W, { id: "z+zpLP" }) : /*#__PURE__*/ z(W, { id: "t7ff15" })
1190
+ })]
1191
+ })] }, t))
1192
+ })
1193
+ })] }), U.length > 0 && /*#__PURE__*/ B("div", { children: [/*#__PURE__*/ z("p", {
1194
+ className: "text-theme-default mb-2 text-sm font-semibold",
1195
+ children: /*#__PURE__*/ z(W, { id: "lRRkwQ" })
1196
+ }), /*#__PURE__*/ z("div", {
1197
+ className: "border-theme-background-lvl-3 rounded border p-3",
1198
+ children: /*#__PURE__*/ z(O, {
1199
+ className: "grid-cols-2",
1200
+ alignTerms: "left",
1201
+ children: U.map((e, t) => /*#__PURE__*/ B(ne, { children: [/*#__PURE__*/ z(D, {
1202
+ className: "col-span-1",
1203
+ children: /*#__PURE__*/ z("span", {
1204
+ className: "block truncate text-xs",
1205
+ title: e.raw,
1206
+ children: e.raw
1207
+ })
1208
+ }), /*#__PURE__*/ B(i, {
1209
+ className: "col-span-1",
1210
+ children: [/*#__PURE__*/ z("span", {
1211
+ className: "block truncate text-sm",
1212
+ title: ye(e),
1213
+ children: ye(e)
1214
+ }), /*#__PURE__*/ z("span", {
1215
+ className: "text-theme-light block text-xs",
1216
+ children: e.requiresToken ? /*#__PURE__*/ z(W, { id: "z+zpLP" }) : /*#__PURE__*/ z(W, { id: "t7ff15" })
1217
+ })]
1218
+ })] }, t))
1219
+ })
1220
+ })] })]
1221
+ })
1222
+ ]
1223
+ })
1224
+ }), /*#__PURE__*/ B("div", {
1225
+ className: "border-theme-background-lvl-3 w-72 shrink-0 border-l pl-6",
1226
+ children: [
1227
+ /*#__PURE__*/ z("p", {
1228
+ className: "text-theme-light mb-3 text-xs",
1229
+ children: /*#__PURE__*/ z(W, { id: "dd2ndz" })
1230
+ }),
1231
+ /*#__PURE__*/ B(f, {
1232
+ direction: "vertical",
1233
+ gap: "4",
1234
+ children: [
1235
+ /*#__PURE__*/ z(Z, {
1236
+ code: ".r:*",
1237
+ description: o._({ id: "VV1fdg" })
1238
+ }),
1239
+ /*#__PURE__*/ z(Z, {
1240
+ code: ".rlistings",
1241
+ description: o._({ id: "s/s1lz" })
1242
+ }),
1243
+ /*#__PURE__*/ z(Z, {
1244
+ code: "PROJECT_ID:USER_ID",
1245
+ description: o._({ id: "zhM8FP" })
1246
+ }),
1247
+ /*#__PURE__*/ z(Z, {
1248
+ code: "PROJECT_ID:*",
1249
+ description: o._({ id: "BCJPTn" })
1250
+ }),
1251
+ /*#__PURE__*/ z(Z, {
1252
+ code: "*:USER_ID",
1253
+ description: o._({ id: "/xnbdQ" })
1254
+ })
1255
+ ]
1256
+ }),
1257
+ /*#__PURE__*/ z("p", {
1258
+ className: "text-theme-light mt-4 text-xs",
1259
+ children: /*#__PURE__*/ z(W, {
1260
+ id: "rrjuul",
1261
+ components: { 0: /*#__PURE__*/ z("a", {
1262
+ href: "https://docs.openstack.org/swift/latest/overview_acl.html",
1263
+ target: "_blank",
1264
+ rel: "noopener noreferrer",
1265
+ className: "text-theme-link underline"
1266
+ }) }
1267
+ })
1268
+ })
1269
+ ]
1270
+ })]
1271
+ }) }),
1272
+ !C && !w && /*#__PURE__*/ z("p", {
1273
+ className: "text-theme-light mt-4 text-xs",
1274
+ children: /*#__PURE__*/ z(W, { id: "j9lCXl" })
1275
+ })
1276
+ ]
1277
+ })]
1278
+ });
1279
+ };
1280
+ function Z({ code: e, description: t }) {
1281
+ return /*#__PURE__*/ B("div", { children: [/*#__PURE__*/ z(l, {
1282
+ variant: "info",
1283
+ className: "mb-1 text-xs",
1284
+ children: e
1285
+ }), /*#__PURE__*/ z("p", {
1286
+ className: "text-theme-light text-xs leading-relaxed",
1287
+ children: t
1288
+ })] });
1289
+ }
1290
+ function be({ label: e }) {
1291
+ return /*#__PURE__*/ B("div", {
1292
+ className: "mb-1 flex items-center gap-1",
1293
+ children: [/*#__PURE__*/ z("label", {
1294
+ className: "text-theme-default text-sm font-semibold",
1295
+ children: e
1296
+ }), /*#__PURE__*/ B(t, {
1297
+ triggerEvent: "hover",
1298
+ children: [/*#__PURE__*/ z(T, { children: /*#__PURE__*/ z(g, {
1299
+ icon: "info",
1300
+ size: "14",
1301
+ className: "text-theme-light cursor-help"
1302
+ }) }), /*#__PURE__*/ z(n, {
1303
+ className: "z-10 max-w-[350px]",
1304
+ children: /*#__PURE__*/ z(W, { id: "AdtLNV" })
1305
+ })]
1306
+ })]
1307
+ });
1308
+ }
1309
+ //#endregion
1310
+ //#region src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Containers/ContainerTableView.tsx
1311
+ var xe = ({ containers: e, createModalOpen: t, setCreateModalOpen: n, maxContainerNameLength: i, onCreateSuccess: a, onCreateError: l, onEmptySuccess: u, onEmptyError: d, onDeleteSuccess: f, onDeleteError: p, onPropertiesSuccess: m, onPropertiesError: h, onAclSuccess: g, onAclError: v, selectedContainers: y, setSelectedContainers: b, hasAnyBulkAction: x = !0 }) => {
1312
+ let { projectId: C, provider: T, storageType: D } = oe({ from: "/_auth/projects/$projectId/storage/$provider/$storageType/" }), { i18n: O, _: k } = G(), A = U(), j = ae(null), [M, N] = H(0), [P, ee] = H(null), [I, te] = H(null), [L, ne] = H(null), [re, V] = H(null);
1313
+ ie(() => {
1314
+ j.current && N(j.current.offsetWidth - j.current.clientWidth);
1315
+ }, [e.length]);
1316
+ let K = (e) => {
1317
+ try {
1318
+ return new Date(e).toLocaleString();
1319
+ } catch {
1320
+ return O._({ id: "fj5byd" });
1321
+ }
1322
+ }, se = q({
1323
+ count: e.length,
1324
+ getScrollElement: () => j.current,
1325
+ estimateSize: () => 48,
1326
+ overscan: 10
1327
+ }), ue = (e) => {
1328
+ y.includes(e) ? b(y.filter((t) => t !== e)) : b([...y, e]);
1329
+ };
1330
+ if (!e || e.length === 0) return /*#__PURE__*/ B(R, { children: [/*#__PURE__*/ z(w, {
1331
+ columns: 4,
1332
+ className: "containers",
1333
+ "data-testid": "no-containers",
1334
+ children: /*#__PURE__*/ z(c, { children: /*#__PURE__*/ z(o, {
1335
+ colSpan: 4,
1336
+ children: /*#__PURE__*/ B("div", {
1337
+ className: "py-8 text-center",
1338
+ children: [/*#__PURE__*/ z("h3", {
1339
+ className: "text-lg font-semibold",
1340
+ children: /*#__PURE__*/ z(W, { id: "Hiw1Ha" })
1341
+ }), /*#__PURE__*/ z("p", {
1342
+ className: "text-theme-light mt-2",
1343
+ children: /*#__PURE__*/ z(W, { id: "x1bK0h" })
1344
+ })]
1345
+ })
1346
+ }) })
1347
+ }), /*#__PURE__*/ z(ce, {
1348
+ isOpen: t,
1349
+ onClose: () => n(!1),
1350
+ onSuccess: a,
1351
+ onError: l,
1352
+ maxContainerNameLength: i
1353
+ })] });
1354
+ let de = x ? 6 : 5, fe = x ? "40px minmax(200px, 2fr) minmax(100px, 1fr) minmax(180px, 2fr) minmax(100px, 1fr) 60px" : "minmax(200px, 2fr) minmax(100px, 1fr) minmax(180px, 2fr) minmax(100px, 1fr) 60px";
1355
+ return /*#__PURE__*/ B(R, { children: [
1356
+ /*#__PURE__*/ B("div", {
1357
+ className: "relative",
1358
+ children: [/*#__PURE__*/ z("div", {
1359
+ style: { paddingRight: `${M}px` },
1360
+ children: /*#__PURE__*/ z(w, {
1361
+ columns: de,
1362
+ gridColumnTemplate: fe,
1363
+ className: "containers",
1364
+ "data-testid": "containers-table-header",
1365
+ children: /*#__PURE__*/ B(c, { children: [
1366
+ x && /*#__PURE__*/ z(s, {}),
1367
+ /*#__PURE__*/ z(s, { children: /*#__PURE__*/ z(W, { id: "t0X9+8" }) }),
1368
+ /*#__PURE__*/ z(s, { children: /*#__PURE__*/ z(W, { id: "sxbP3b" }) }),
1369
+ /*#__PURE__*/ z(s, { children: /*#__PURE__*/ z(W, { id: "sjMCOP" }) }),
1370
+ /*#__PURE__*/ z(s, { children: /*#__PURE__*/ z(W, { id: "hgpMHD" }) }),
1371
+ /*#__PURE__*/ z(s, { style: { marginRight: `-${M}px` } })
1372
+ ] })
1373
+ })
1374
+ }), /*#__PURE__*/ z("div", {
1375
+ ref: j,
1376
+ className: "overflow-auto",
1377
+ style: { height: "calc(100vh - 490px)" },
1378
+ "data-testid": "containers-table-body",
1379
+ children: /*#__PURE__*/ z("div", {
1380
+ style: {
1381
+ height: `${se.getTotalSize()}px`,
1382
+ width: "100%",
1383
+ position: "relative"
1384
+ },
1385
+ children: se.getVirtualItems().map((t) => {
1386
+ let n = e[t.index], i = y.includes(n.name), a = () => A({
1387
+ to: "/projects/$projectId/storage/$provider/$storageType/$containerName/objects",
1388
+ params: {
1389
+ projectId: C,
1390
+ provider: T,
1391
+ storageType: D,
1392
+ containerName: n.name
1393
+ }
1394
+ });
1395
+ return /*#__PURE__*/ B("div", {
1396
+ "data-index": t.index,
1397
+ ref: se.measureElement,
1398
+ className: "juno-datagrid group hover:bg-theme-background-lvl-1 cursor-pointer",
1399
+ style: {
1400
+ position: "absolute",
1401
+ top: 0,
1402
+ left: 0,
1403
+ width: "100%",
1404
+ transform: `translateY(${t.start}px)`,
1405
+ display: "grid",
1406
+ gridTemplateColumns: fe,
1407
+ alignItems: "stretch"
1408
+ },
1409
+ "data-testid": `container-row-${n.name}`,
1410
+ role: "link",
1411
+ tabIndex: 0,
1412
+ onClick: a,
1413
+ onKeyDown: (e) => {
1414
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), a());
1415
+ },
1416
+ children: [
1417
+ x && /*#__PURE__*/ z(o, {
1418
+ onClick: (e) => e.stopPropagation(),
1419
+ onKeyDown: (e) => {
1420
+ (e.key === "Enter" || e.key === " ") && e.stopPropagation();
1421
+ },
1422
+ children: /*#__PURE__*/ z(E, {
1423
+ checked: i,
1424
+ onChange: () => ue(n.name),
1425
+ "data-testid": `select-container-${n.name}`
1426
+ })
1427
+ }),
1428
+ /*#__PURE__*/ z(o, {
1429
+ className: "min-w-0 overflow-hidden",
1430
+ children: /*#__PURE__*/ z("span", {
1431
+ className: "block truncate",
1432
+ title: n.name,
1433
+ children: n.name
1434
+ })
1435
+ }),
1436
+ /*#__PURE__*/ z(o, { children: n.count.toLocaleString() }),
1437
+ /*#__PURE__*/ z(o, { children: n.last_modified ? K(n.last_modified) : O._({ id: "fj5byd" }) }),
1438
+ /*#__PURE__*/ z(o, { children: F(n.bytes) }),
1439
+ /*#__PURE__*/ z(o, {
1440
+ onClick: (e) => e.stopPropagation(),
1441
+ children: /*#__PURE__*/ z(r, { children: /*#__PURE__*/ B(_, { children: [
1442
+ /*#__PURE__*/ z(S, {
1443
+ label: O._({ id: "cWbW6w" }),
1444
+ onClick: () => V(n),
1445
+ "data-testid": `access-control-action-${n.name}`
1446
+ }),
1447
+ /*#__PURE__*/ z(S, {
1448
+ label: O._({ id: "Oc8Aqv" }),
1449
+ onClick: () => ne(n),
1450
+ "data-testid": `properties-action-${n.name}`
1451
+ }),
1452
+ /*#__PURE__*/ z(S, {
1453
+ label: O._({ id: "N2S1rs" }),
1454
+ onClick: () => ee(n),
1455
+ "data-testid": `empty-action-${n.name}`
1456
+ }),
1457
+ /*#__PURE__*/ z(S, {
1458
+ label: O._({ id: "cnGeoo" }),
1459
+ onClick: () => te(n),
1460
+ "data-testid": `delete-action-${n.name}`
1461
+ })
1462
+ ] }) })
1463
+ })
1464
+ ]
1465
+ }, n.name);
1466
+ })
1467
+ })
1468
+ })]
1469
+ }),
1470
+ /*#__PURE__*/ z(ce, {
1471
+ isOpen: t,
1472
+ onClose: () => n(!1),
1473
+ onSuccess: a,
1474
+ onError: l,
1475
+ maxContainerNameLength: i
1476
+ }),
1477
+ /*#__PURE__*/ z(J, {
1478
+ isOpen: P !== null,
1479
+ container: P,
1480
+ onClose: () => ee(null),
1481
+ onSuccess: u,
1482
+ onError: d
1483
+ }),
1484
+ /*#__PURE__*/ z(le, {
1485
+ isOpen: I !== null,
1486
+ container: I,
1487
+ onClose: () => te(null),
1488
+ onSuccess: f,
1489
+ onError: p
1490
+ }),
1491
+ /*#__PURE__*/ z(Y, {
1492
+ isOpen: L !== null,
1493
+ container: L,
1494
+ onClose: () => ne(null),
1495
+ onSuccess: m,
1496
+ onError: h
1497
+ }),
1498
+ /*#__PURE__*/ z(X, {
1499
+ isOpen: re !== null,
1500
+ container: re,
1501
+ onClose: () => V(null),
1502
+ onSuccess: g,
1503
+ onError: v
1504
+ })
1505
+ ] });
1506
+ };
1507
+ //#endregion
1508
+ //#region src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Containers/ContainerToastNotifications.tsx
1509
+ function Q({ title: e, description: t }) {
1510
+ return /*#__PURE__*/ B(f, {
1511
+ direction: "vertical",
1512
+ gap: "1.5",
1513
+ children: [/*#__PURE__*/ z("span", { children: e }), /*#__PURE__*/ z("span", {
1514
+ className: "text-theme-light",
1515
+ children: t
1516
+ })]
1517
+ });
1518
+ }
1519
+ var Se = (e, t) => ({
1520
+ variant: "success",
1521
+ children: /*#__PURE__*/ z(Q, {
1522
+ title: /*#__PURE__*/ z(W, { id: "6w+VnM" }),
1523
+ description: /*#__PURE__*/ z(W, {
1524
+ id: "XwxJJB",
1525
+ values: { containerName: e }
1526
+ })
1527
+ }),
1528
+ onDismiss: t.onDismiss
1529
+ }), Ce = (e, t, n) => ({
1530
+ variant: "error",
1531
+ children: /*#__PURE__*/ z(Q, {
1532
+ title: /*#__PURE__*/ z(W, { id: "Vj8XFg" }),
1533
+ description: /*#__PURE__*/ z(W, {
1534
+ id: "Vz+7ZA",
1535
+ values: {
1536
+ containerName: e,
1537
+ errorMessage: t
1538
+ }
1539
+ })
1540
+ }),
1541
+ onDismiss: n.onDismiss
1542
+ }), we = (e, t, n) => ({
1543
+ variant: "success",
1544
+ children: /*#__PURE__*/ z(Q, {
1545
+ title: /*#__PURE__*/ z(W, { id: "6OopEX" }),
1546
+ description: t === 0 ? /*#__PURE__*/ z(W, {
1547
+ id: "nkpZyk",
1548
+ values: { containerName: e }
1549
+ }) : t === 1 ? /*#__PURE__*/ z(W, {
1550
+ id: "TZJiVf",
1551
+ values: {
1552
+ containerName: e,
1553
+ deletedCount: t
1554
+ }
1555
+ }) : /*#__PURE__*/ z(W, {
1556
+ id: "Sb/VT5",
1557
+ values: {
1558
+ containerName: e,
1559
+ deletedCount: t
1560
+ }
1561
+ })
1562
+ }),
1563
+ onDismiss: n.onDismiss
1564
+ }), Te = (e, t, n) => ({
1565
+ variant: "error",
1566
+ children: /*#__PURE__*/ z(Q, {
1567
+ title: /*#__PURE__*/ z(W, { id: "S8/j2h" }),
1568
+ description: /*#__PURE__*/ z(W, {
1569
+ id: "1rLu3+",
1570
+ values: {
1571
+ containerName: e,
1572
+ errorMessage: t
1573
+ }
1574
+ })
1575
+ }),
1576
+ onDismiss: n.onDismiss
1577
+ }), Ee = (e, t) => ({
1578
+ variant: "success",
1579
+ children: /*#__PURE__*/ z(Q, {
1580
+ title: /*#__PURE__*/ z(W, { id: "odVI9Y" }),
1581
+ description: /*#__PURE__*/ z(W, {
1582
+ id: "V1TzeS",
1583
+ values: { containerName: e }
1584
+ })
1585
+ }),
1586
+ onDismiss: t.onDismiss
1587
+ }), De = (e, t, n) => ({
1588
+ variant: "error",
1589
+ children: /*#__PURE__*/ z(Q, {
1590
+ title: /*#__PURE__*/ z(W, { id: "BJt+PJ" }),
1591
+ description: /*#__PURE__*/ z(W, {
1592
+ id: "RGrgxg",
1593
+ values: {
1594
+ containerName: e,
1595
+ errorMessage: t
1596
+ }
1597
+ })
1598
+ }),
1599
+ onDismiss: n.onDismiss
1600
+ }), Oe = (e, t) => ({
1601
+ variant: "success",
1602
+ children: /*#__PURE__*/ z(Q, {
1603
+ title: /*#__PURE__*/ z(W, { id: "a7C4YS" }),
1604
+ description: /*#__PURE__*/ z(W, {
1605
+ id: "/NeNjH",
1606
+ values: { containerName: e }
1607
+ })
1608
+ }),
1609
+ onDismiss: t.onDismiss
1610
+ }), ke = (e, t, n) => ({
1611
+ variant: "error",
1612
+ children: /*#__PURE__*/ z(Q, {
1613
+ title: /*#__PURE__*/ z(W, { id: "5MF8U2" }),
1614
+ description: /*#__PURE__*/ z(W, {
1615
+ id: "uLtFAr",
1616
+ values: {
1617
+ containerName: e,
1618
+ errorMessage: t
1619
+ }
1620
+ })
1621
+ }),
1622
+ onDismiss: n.onDismiss
1623
+ }), Ae = (e, t) => ({
1624
+ variant: "success",
1625
+ children: /*#__PURE__*/ z(Q, {
1626
+ title: /*#__PURE__*/ z(W, { id: "olfSYj" }),
1627
+ description: /*#__PURE__*/ z(W, {
1628
+ id: "tM5SEI",
1629
+ values: { containerName: e }
1630
+ })
1631
+ }),
1632
+ onDismiss: t.onDismiss
1633
+ }), je = (e, t, n) => ({
1634
+ variant: "error",
1635
+ children: /*#__PURE__*/ z(Q, {
1636
+ title: /*#__PURE__*/ z(W, { id: "p7DzCB" }),
1637
+ description: /*#__PURE__*/ z(W, {
1638
+ id: "DcMIiu",
1639
+ values: {
1640
+ containerName: e,
1641
+ errorMessage: t
1642
+ }
1643
+ })
1644
+ }),
1645
+ onDismiss: n.onDismiss
1646
+ }), Me = (e, t, n, r) => {
1647
+ let i = n.length > 0, a = e > 0, o = i && a;
1648
+ return {
1649
+ variant: o ? "warning" : i ? "error" : "success",
1650
+ children: /*#__PURE__*/ z(Q, {
1651
+ title: o ? /*#__PURE__*/ z(W, { id: "q44uUq" }) : i ? /*#__PURE__*/ z(W, { id: "wFaT8w" }) : /*#__PURE__*/ z(W, { id: "0WsqO0" }),
1652
+ description: /*#__PURE__*/ B(f, {
1653
+ direction: "vertical",
1654
+ gap: "1",
1655
+ children: [a && /*#__PURE__*/ z("span", { children: /*#__PURE__*/ z(W, {
1656
+ id: "1NS3nd",
1657
+ values: {
1658
+ emptiedCount: e,
1659
+ totalDeleted: t
1660
+ }
1661
+ }) }), i && /*#__PURE__*/ z("span", {
1662
+ className: "whitespace-pre-line",
1663
+ children: /*#__PURE__*/ z(W, {
1664
+ id: "JrmKyf",
1665
+ values: { errorDetails: n.join("\n") }
1666
+ })
1667
+ })]
1668
+ })
1669
+ }),
1670
+ onDismiss: r.onDismiss
1671
+ };
1672
+ }, $ = ({ label: e, value: t }) => t == null ? null : /*#__PURE__*/ B("span", {
1673
+ className: "flex items-start gap-1.5",
1674
+ children: [/*#__PURE__*/ z(g, {
1675
+ icon: "check",
1676
+ size: "16px",
1677
+ className: "text-theme-success mt-0.5 shrink-0"
1678
+ }), /*#__PURE__*/ B("span", { children: [
1679
+ /*#__PURE__*/ B("span", {
1680
+ className: "font-medium",
1681
+ children: [e, ":"]
1682
+ }),
1683
+ " ",
1684
+ t
1685
+ ] })]
1686
+ }), Ne = ({ label: e }) => /*#__PURE__*/ B("span", {
1687
+ className: "flex items-start gap-1.5",
1688
+ children: [/*#__PURE__*/ z(g, {
1689
+ icon: "check",
1690
+ size: "16px",
1691
+ className: "text-theme-success mt-0.5 shrink-0"
1692
+ }), /*#__PURE__*/ z("span", { children: e })]
1693
+ }), Pe = ({ title: e, children: t }) => /*#__PURE__*/ B("span", {
1694
+ className: "flex flex-col gap-1.5",
1695
+ children: [/*#__PURE__*/ z("span", {
1696
+ className: "text-theme-default block font-semibold",
1697
+ children: e
1698
+ }), t]
1699
+ }), Fe = ({ serviceInfo: e, accountInfo: r, open: i }) => {
1700
+ let { i18n: a, _: o } = G(), s = e?.swift, c = {
1701
+ account_quotas: a._({ id: "DJT9tB" }),
1702
+ container_quotas: a._({ id: "USiuNX" }),
1703
+ bulk_delete: a._({ id: "F6YIQe" }),
1704
+ bulk_upload: a._({ id: "2Inn83" }),
1705
+ slo: a._({ id: "cpw++p" }),
1706
+ container_sync: a._({ id: "ezT9KW" }),
1707
+ tempurl: a._({ id: "UO3hJ2" }),
1708
+ symlink: a._({ id: "Q2xmVl" }),
1709
+ versioned_writes: a._({ id: "8jLXs3" })
1710
+ }, l = Object.entries(c).filter(([e]) => s?.[e]).map(([, e]) => e);
1711
+ return /*#__PURE__*/ B(t, {
1712
+ triggerEvent: "hover",
1713
+ placement: "bottom-end",
1714
+ open: i,
1715
+ children: [/*#__PURE__*/ z(T, {
1716
+ asChild: !0,
1717
+ children: /*#__PURE__*/ z(g, {
1718
+ icon: "info",
1719
+ size: "20px",
1720
+ className: "text-theme-light hover:text-theme-default cursor-pointer"
1721
+ })
1722
+ }), /*#__PURE__*/ z(n, {
1723
+ className: "z-10 w-72 text-sm",
1724
+ children: /*#__PURE__*/ B("span", {
1725
+ className: "flex flex-col gap-3 p-1",
1726
+ children: [
1727
+ r && /*#__PURE__*/ B(Pe, {
1728
+ title: /*#__PURE__*/ z(W, { id: "AeXO77" }),
1729
+ children: [
1730
+ /*#__PURE__*/ z($, {
1731
+ label: a._({ id: "ClGcRq" }),
1732
+ value: r.containerCount.toLocaleString()
1733
+ }),
1734
+ /*#__PURE__*/ z($, {
1735
+ label: a._({ id: "B3toQF" }),
1736
+ value: r.objectCount.toLocaleString()
1737
+ }),
1738
+ /*#__PURE__*/ z($, {
1739
+ label: a._({ id: "aL1w5Z" }),
1740
+ value: F(r.bytesUsed)
1741
+ }),
1742
+ r.quotaBytes !== void 0 && /*#__PURE__*/ z($, {
1743
+ label: a._({ id: "vEkTR9" }),
1744
+ value: F(r.quotaBytes)
1745
+ })
1746
+ ]
1747
+ }),
1748
+ s && /*#__PURE__*/ B(Pe, {
1749
+ title: /*#__PURE__*/ z(W, { id: "6BDqha" }),
1750
+ children: [
1751
+ /*#__PURE__*/ z($, {
1752
+ label: a._({ id: "wTg+FY" }),
1753
+ value: s.max_file_size === void 0 ? void 0 : F(s.max_file_size)
1754
+ }),
1755
+ /*#__PURE__*/ z($, {
1756
+ label: a._({ id: "Rih53k" }),
1757
+ value: s.max_container_name_length
1758
+ }),
1759
+ /*#__PURE__*/ z($, {
1760
+ label: a._({ id: "qAkkjP" }),
1761
+ value: s.max_object_name_length
1762
+ }),
1763
+ /*#__PURE__*/ z($, {
1764
+ label: a._({ id: "OZImTR" }),
1765
+ value: s.container_listing_limit?.toLocaleString()
1766
+ }),
1767
+ /*#__PURE__*/ z($, {
1768
+ label: a._({ id: "a4A2uB" }),
1769
+ value: s.account_listing_limit?.toLocaleString()
1770
+ }),
1771
+ /*#__PURE__*/ z($, {
1772
+ label: a._({ id: "zWb/Nn" }),
1773
+ value: s.max_header_size
1774
+ }),
1775
+ /*#__PURE__*/ z($, {
1776
+ label: a._({ id: "RGwfoL" }),
1777
+ value: s.max_meta_count
1778
+ }),
1779
+ /*#__PURE__*/ z($, {
1780
+ label: a._({ id: "8c3/77" }),
1781
+ value: s.max_meta_name_length
1782
+ }),
1783
+ /*#__PURE__*/ z($, {
1784
+ label: a._({ id: "5JDSvn" }),
1785
+ value: s.max_meta_value_length
1786
+ }),
1787
+ /*#__PURE__*/ z($, {
1788
+ label: a._({ id: "ZAx+d1" }),
1789
+ value: s.max_meta_overall_size
1790
+ }),
1791
+ s.bulk_delete && /*#__PURE__*/ z($, {
1792
+ label: a._({ id: "lQ3EIe" }),
1793
+ value: s.bulk_delete.max_deletes_per_request.toLocaleString()
1794
+ }),
1795
+ s.bulk_upload && /*#__PURE__*/ z($, {
1796
+ label: a._({ id: "STc+7E" }),
1797
+ value: s.bulk_upload.max_containers_per_extraction.toLocaleString()
1798
+ }),
1799
+ s.slo && /*#__PURE__*/ z($, {
1800
+ label: a._({ id: "RNBvdl" }),
1801
+ value: s.slo.max_manifest_segments.toLocaleString()
1802
+ })
1803
+ ]
1804
+ }),
1805
+ l.length > 0 && /*#__PURE__*/ z(Pe, {
1806
+ title: /*#__PURE__*/ z(W, { id: "Qx7DM7" }),
1807
+ children: l.map((e) => /*#__PURE__*/ z(Ne, { label: e }, e))
1808
+ })
1809
+ ]
1810
+ })
1811
+ })]
1812
+ });
1813
+ }, Ie = 20, Le = "empty", Re = ({ isOpen: e, containers: t, onClose: n, onComplete: r }) => {
1814
+ let { i18n: a, i18n: o, _: s } = G(), c = I(), [l, d] = H(null), [m, h] = H(""), g = m.trim() === Le, _ = M.useUtils(), v = M.storage.swift.emptyContainer.useMutation(), y = () => {
1815
+ v.reset(), d(null), h(""), n();
1816
+ }, b = async () => {
1817
+ let e = 0, n = 0, i = [], a = t.length;
1818
+ for (let r = 0; r < t.length; r++) {
1819
+ d({
1820
+ current: r + 1,
1821
+ total: a
1822
+ });
1823
+ let o = t[r];
1824
+ try {
1825
+ let t = await v.mutateAsync({
1826
+ project_id: c,
1827
+ container: o.name
1828
+ });
1829
+ n += t, e++;
1830
+ } catch (e) {
1831
+ let t = e instanceof Error ? e.message : String(e);
1832
+ i.push(`${o.name}: ${t}`);
1833
+ }
1834
+ }
1835
+ e > 0 && await _.storage.swift.listContainers.invalidate(), r?.({
1836
+ emptiedCount: e,
1837
+ totalDeleted: n,
1838
+ errors: i
1839
+ }), y();
1840
+ };
1841
+ if (!e || t.length === 0) return null;
1842
+ let x = t.length, S = t.slice(0, Ie), w = x - S.length, T = v.isPending || l !== null, E = l?.current, k = l?.total;
1843
+ return /*#__PURE__*/ z(j, {
1844
+ title: /*#__PURE__*/ z(W, {
1845
+ id: "0efWir",
1846
+ values: { totalCount: x }
1847
+ }),
1848
+ open: e,
1849
+ onCancel: y,
1850
+ confirmButtonLabel: T ? a._({ id: "s4Vnq2" }) : a._({ id: "N2S1rs" }),
1851
+ confirmButtonVariant: "primary-danger",
1852
+ cancelButtonLabel: a._({ id: "dEgA5A" }),
1853
+ onConfirm: b,
1854
+ disableConfirmButton: T || !g,
1855
+ disableCancelButton: T,
1856
+ disableCloseButton: T,
1857
+ size: "small",
1858
+ children: T ? /*#__PURE__*/ B(f, {
1859
+ direction: "vertical",
1860
+ distribution: "center",
1861
+ alignment: "center",
1862
+ gap: "2",
1863
+ className: "py-4",
1864
+ children: [/*#__PURE__*/ z(u, { variant: "primary" }), l && /*#__PURE__*/ z("p", {
1865
+ className: "text-theme-light text-sm",
1866
+ children: /*#__PURE__*/ z(W, {
1867
+ id: "7NSdfG",
1868
+ values: {
1869
+ progressCurrent: E,
1870
+ progressTotal: k
1871
+ }
1872
+ })
1873
+ })]
1874
+ }) : /*#__PURE__*/ B("div", {
1875
+ className: "my-6",
1876
+ children: [
1877
+ /*#__PURE__*/ z(p, {
1878
+ variant: "danger",
1879
+ className: "mb-6",
1880
+ children: /*#__PURE__*/ z(W, { id: "JuOpPY" })
1881
+ }),
1882
+ /*#__PURE__*/ z("p", {
1883
+ className: "text-theme-default mb-6 text-sm",
1884
+ children: /*#__PURE__*/ z(W, {
1885
+ id: "XXjbEV",
1886
+ components: {
1887
+ 0: /*#__PURE__*/ z("strong", {}),
1888
+ 1: /*#__PURE__*/ z("strong", {})
1889
+ }
1890
+ })
1891
+ }),
1892
+ /*#__PURE__*/ B("div", {
1893
+ className: "mb-6",
1894
+ children: [/*#__PURE__*/ z("h3", {
1895
+ className: "jn:text-theme-high mb-3 font-semibold",
1896
+ children: /*#__PURE__*/ z(W, {
1897
+ id: "VKmlZ+",
1898
+ values: { totalCount: x }
1899
+ })
1900
+ }), /*#__PURE__*/ B("div", {
1901
+ className: "jn:bg-theme-background-lvl-1 max-h-48 overflow-y-auto rounded p-4",
1902
+ children: [/*#__PURE__*/ z(O, {
1903
+ className: "grid-cols-2",
1904
+ alignTerms: "left",
1905
+ children: S.map((e) => {
1906
+ let t = e.count;
1907
+ return /*#__PURE__*/ B(ne, { children: [/*#__PURE__*/ z(D, {
1908
+ className: "col-span-1",
1909
+ children: /*#__PURE__*/ z("span", {
1910
+ className: "block truncate",
1911
+ title: e.name,
1912
+ children: e.name
1913
+ })
1914
+ }), /*#__PURE__*/ z(i, {
1915
+ className: "col-span-1",
1916
+ children: /*#__PURE__*/ z("span", {
1917
+ className: "whitespace-nowrap",
1918
+ children: t == null ? "" : o._(a._({
1919
+ id: "7Ocn0b",
1920
+ values: { count: t }
1921
+ }))
1922
+ })
1923
+ })] }, e.name);
1924
+ })
1925
+ }), w > 0 && /*#__PURE__*/ z("p", {
1926
+ className: "text-theme-light mt-2 text-xs",
1927
+ children: /*#__PURE__*/ z(W, {
1928
+ id: "yqPflB",
1929
+ values: { hiddenCount: w }
1930
+ })
1931
+ })]
1932
+ })]
1933
+ }),
1934
+ /*#__PURE__*/ z(C, {
1935
+ label: a._({ id: "Ghp863" }),
1936
+ placeholder: Le,
1937
+ value: m,
1938
+ onChange: (e) => h(e.target.value)
1939
+ })
1940
+ ]
1941
+ })
1942
+ });
1943
+ }, ze = () => {
1944
+ let { i18n: e, i18n: t, _: n } = G(), i = I(), o = U({ from: N.fullPath }), { sortBy: s, sortDirection: c, search: l = "" } = N.useSearch(), [d, p] = H(!1), [g, v] = H(!1), [y, b] = H([]), [C, w] = H(null), [T, D] = H(l), O = ae(void 0);
1945
+ ie(() => () => clearTimeout(O.current), []), ie(() => {
1946
+ D(l);
1947
+ }, [l]);
1948
+ let k = () => w(null), j = (e) => {
1949
+ w(Se(e, { onDismiss: k }));
1950
+ }, P = (e, t) => {
1951
+ w(Ce(e, t, { onDismiss: k }));
1952
+ }, te = (e, t) => {
1953
+ w(we(e, t, { onDismiss: k }));
1954
+ }, L = (e, t) => {
1955
+ w(Te(e, t, { onDismiss: k }));
1956
+ }, ne = (e) => {
1957
+ w(Ee(e, { onDismiss: k }));
1958
+ }, V = (e, t) => {
1959
+ w(De(e, t, { onDismiss: k }));
1960
+ }, oe = (e) => {
1961
+ w(Oe(e, { onDismiss: k }));
1962
+ }, K = (e, t) => {
1963
+ w(ke(e, t, { onDismiss: k }));
1964
+ }, se = (e) => {
1965
+ w(Ae(e, { onDismiss: k }));
1966
+ }, q = (e, t) => {
1967
+ w(je(e, t, { onDismiss: k }));
1968
+ }, ce = ({ emptiedCount: e, totalDeleted: t, errors: n }) => {
1969
+ if (n.length === 0) b([]);
1970
+ else {
1971
+ let e = new Set(n.map((e) => e.split(": ")[0]));
1972
+ b((t) => t.filter((t) => e.has(t)));
1973
+ }
1974
+ w(Me(e, t, n, { onDismiss: k }));
1975
+ }, J = {
1976
+ options: [
1977
+ {
1978
+ label: e._({ id: "6YtxFj" }),
1979
+ value: "name"
1980
+ },
1981
+ {
1982
+ label: e._({ id: "sxbP3b" }),
1983
+ value: "count"
1984
+ },
1985
+ {
1986
+ label: e._({ id: "hgpMHD" }),
1987
+ value: "bytes"
1988
+ },
1989
+ {
1990
+ label: e._({ id: "sjMCOP" }),
1991
+ value: "last_modified"
1992
+ }
1993
+ ],
1994
+ sortBy: s ?? "name",
1995
+ sortDirection: c ?? "asc"
1996
+ }, { data: le, isLoading: ue, error: de } = M.storage.swift.listContainers.useQuery({
1997
+ project_id: i,
1998
+ format: "json"
1999
+ }), { data: fe } = M.storage.swift.getAccountMetadata.useQuery({ project_id: i }), { data: Y } = M.storage.swift.getServiceInfo.useQuery(), pe = (e) => [...e].sort((e, t) => {
2000
+ let n;
2001
+ switch (s ?? "name") {
2002
+ case "name":
2003
+ n = e.name.localeCompare(t.name);
2004
+ break;
2005
+ case "count":
2006
+ n = e.count - t.count;
2007
+ break;
2008
+ case "bytes":
2009
+ n = e.bytes - t.bytes;
2010
+ break;
2011
+ case "last_modified":
2012
+ if (!e.last_modified || !t.last_modified) return e.last_modified ? -1 : 1;
2013
+ n = new Date(e.last_modified).getTime() - new Date(t.last_modified).getTime();
2014
+ break;
2015
+ default: n = e.name.localeCompare(t.name);
2016
+ }
2017
+ return (c ?? "asc") === "desc" ? -n : n;
2018
+ }), me = (le || []).filter((e) => e.name.toLowerCase().includes(l.toLowerCase())), he = pe(me), ge = (e) => {
2019
+ let t = typeof e == "string" ? e : "";
2020
+ re(() => {
2021
+ o({ search: (e) => ({
2022
+ ...e,
2023
+ search: t || void 0
2024
+ }) });
2025
+ });
2026
+ }, _e = (e) => {
2027
+ let t = e.sortBy?.toString() || "name", n = e.sortDirection || "asc";
2028
+ re(() => {
2029
+ o({ search: (e) => ({
2030
+ ...e,
2031
+ sortBy: t,
2032
+ sortDirection: n
2033
+ }) });
2034
+ });
2035
+ };
2036
+ if (ue) return /*#__PURE__*/ B(f, {
2037
+ className: "absolute inset-0",
2038
+ distribution: "center",
2039
+ alignment: "center",
2040
+ direction: "vertical",
2041
+ children: [/*#__PURE__*/ z(u, {
2042
+ variant: "primary",
2043
+ size: "large",
2044
+ className: "mb-2"
2045
+ }), /*#__PURE__*/ z(W, { id: "WYiUDa" })]
2046
+ });
2047
+ if (de) {
2048
+ let e = de.message;
2049
+ return /*#__PURE__*/ z(f, {
2050
+ className: "absolute inset-0",
2051
+ distribution: "center",
2052
+ alignment: "center",
2053
+ direction: "vertical",
2054
+ children: /*#__PURE__*/ z(W, {
2055
+ id: "dLFiER",
2056
+ values: { errorMessage: e }
2057
+ })
2058
+ });
2059
+ }
2060
+ let ve = fe?.bytesUsed || 0, ye = fe?.quotaBytes || 0, X = ye > 0 ? ye - ve : 0, Z = (le || []).filter((e) => y.includes(e.name)), be = Z.length > 0, Q = Z.length, $ = (le || []).length, Ne = me.length, Pe = Ne !== $, Ie = he.map((e) => e.name), Le = Ie.length > 0 && Ie.every((e) => y.includes(e)), ze = Ie.some((e) => y.includes(e));
2061
+ return /*#__PURE__*/ B("div", {
2062
+ className: "relative",
2063
+ children: [
2064
+ /*#__PURE__*/ B(f, {
2065
+ direction: "vertical",
2066
+ children: [
2067
+ /*#__PURE__*/ B(f, {
2068
+ distribution: "end",
2069
+ alignment: "center",
2070
+ gap: "2",
2071
+ className: "pb-2",
2072
+ children: [/*#__PURE__*/ z(f, {
2073
+ gap: "0.5",
2074
+ alignment: "center",
2075
+ children: /*#__PURE__*/ z(ee, {
2076
+ options: J.options,
2077
+ sortBy: J.sortBy,
2078
+ sortDirection: J.sortDirection ?? "asc",
2079
+ onSortByChange: (e) => _e({
2080
+ ...J,
2081
+ sortBy: e,
2082
+ sortDirection: J.sortDirection
2083
+ }),
2084
+ onSortDirectionChange: (e) => _e({
2085
+ ...J,
2086
+ sortDirection: e
2087
+ })
2088
+ })
2089
+ }), /*#__PURE__*/ z(m, {
2090
+ variant: "primary",
2091
+ className: "whitespace-nowrap",
2092
+ onClick: () => p(!0),
2093
+ children: /*#__PURE__*/ z(W, { id: "vTh35P" })
2094
+ })]
2095
+ }),
2096
+ /*#__PURE__*/ z(h, { children: /*#__PURE__*/ z(f, {
2097
+ direction: "vertical",
2098
+ gap: "2",
2099
+ children: /*#__PURE__*/ z(f, {
2100
+ distribution: "end",
2101
+ alignment: "center",
2102
+ children: /*#__PURE__*/ z(a, {
2103
+ placeholder: e._({ id: "TipzDp" }),
2104
+ "data-testid": "searchbar",
2105
+ value: T,
2106
+ onInput: (e) => {
2107
+ let t = e.currentTarget.value;
2108
+ D(t), clearTimeout(O.current), O.current = window.setTimeout(() => ge(t), 500);
2109
+ },
2110
+ onSearch: (e) => {
2111
+ clearTimeout(O.current), ge(typeof e == "string" ? e : "");
2112
+ },
2113
+ onClear: () => {
2114
+ clearTimeout(O.current), D(""), ge("");
2115
+ }
2116
+ })
2117
+ })
2118
+ }) }),
2119
+ /*#__PURE__*/ z(h, { children: /*#__PURE__*/ B(f, {
2120
+ distribution: "start",
2121
+ gap: "2",
2122
+ alignment: "center",
2123
+ className: "text-sm",
2124
+ children: [/*#__PURE__*/ B(f, {
2125
+ gap: "2",
2126
+ alignment: "center",
2127
+ children: [/*#__PURE__*/ z(E, {
2128
+ checked: Le,
2129
+ indeterminate: ze && !Le,
2130
+ onChange: () => {
2131
+ b(Le ? (e) => e.filter((e) => !Ie.includes(e)) : (e) => [...new Set([...e, ...Ie])]);
2132
+ }
2133
+ }), /*#__PURE__*/ B(r, {
2134
+ className: "flex items-center",
2135
+ children: [/*#__PURE__*/ z(x, {
2136
+ as: "div",
2137
+ children: /*#__PURE__*/ z(m, {
2138
+ disabled: !be,
2139
+ size: "small",
2140
+ icon: "moreVert",
2141
+ label: e._({ id: "7L01XJ" })
2142
+ })
2143
+ }), be && /*#__PURE__*/ z(_, { children: /*#__PURE__*/ z(S, {
2144
+ disabled: !be,
2145
+ label: t._(e._({
2146
+ id: "0Th0CH",
2147
+ values: { selectedCount: Q }
2148
+ })),
2149
+ onClick: () => v(!0)
2150
+ }) })]
2151
+ })]
2152
+ }), /*#__PURE__*/ B("div", {
2153
+ className: "text-theme-light flex items-center gap-1",
2154
+ "data-testid": "containers-info-block",
2155
+ children: [
2156
+ Pe ? /*#__PURE__*/ z(W, {
2157
+ id: "8uPTwT",
2158
+ values: {
2159
+ filteredCount: Ne,
2160
+ totalCount: $
2161
+ }
2162
+ }) : /*#__PURE__*/ z(W, {
2163
+ id: "ywe1H/",
2164
+ values: { totalCount: $ }
2165
+ }),
2166
+ ye > 0 && /*#__PURE__*/ B(R, { children: [/*#__PURE__*/ z("span", { children: "," }), /*#__PURE__*/ B("span", { children: [
2167
+ /*#__PURE__*/ z(W, { id: "kKK8AH" }),
2168
+ " ",
2169
+ /*#__PURE__*/ z("span", {
2170
+ className: "text-theme-default font-semibold",
2171
+ children: F(X)
2172
+ })
2173
+ ] })] }),
2174
+ /*#__PURE__*/ z(Fe, {
2175
+ serviceInfo: Y,
2176
+ accountInfo: fe
2177
+ })
2178
+ ]
2179
+ })]
2180
+ }) })
2181
+ ]
2182
+ }),
2183
+ /*#__PURE__*/ z(xe, {
2184
+ containers: he,
2185
+ createModalOpen: d,
2186
+ setCreateModalOpen: p,
2187
+ maxContainerNameLength: Y?.swift?.max_container_name_length,
2188
+ onCreateSuccess: j,
2189
+ onCreateError: P,
2190
+ onEmptySuccess: te,
2191
+ onEmptyError: L,
2192
+ onDeleteSuccess: ne,
2193
+ onDeleteError: V,
2194
+ onPropertiesSuccess: oe,
2195
+ onPropertiesError: K,
2196
+ onAclSuccess: se,
2197
+ onAclError: q,
2198
+ selectedContainers: y,
2199
+ setSelectedContainers: b,
2200
+ hasAnyBulkAction: !0
2201
+ }),
2202
+ /*#__PURE__*/ z(Re, {
2203
+ isOpen: g,
2204
+ containers: Z,
2205
+ onClose: () => v(!1),
2206
+ onComplete: ce
2207
+ }),
2208
+ C && /*#__PURE__*/ z(A, {
2209
+ ...C,
2210
+ className: "border-theme-light fixed top-5 right-5 z-50 rounded-lg border shadow-lg"
2211
+ })
2212
+ ]
2213
+ });
2214
+ }, Be = /^[a-z0-9][a-z0-9.-]*[a-z0-9]$/, Ve = /^(\d{1,3}\.){3}\d{1,3}$/, He = [
2215
+ "xn--",
2216
+ "sthree-",
2217
+ "amzn-s3-demo-"
2218
+ ], Ue = [
2219
+ "-s3alias",
2220
+ "--ol-s3",
2221
+ ".mrap",
2222
+ "--x-s3",
2223
+ "--table-s3"
2224
+ ], We = ({ isOpen: e, onClose: t, onSuccess: n, onError: r }) => {
2225
+ let { i18n: i, _: a } = G(), o = I(), [s, c] = H(""), [l, u] = H(null), [d, p] = H(!1), m = M.useUtils(), h = M.storage.ceph.containers.create.useMutation({
2226
+ onSuccess: () => {
2227
+ m.storage.ceph.containers.list.invalidate();
2228
+ let e = s.trim();
2229
+ n?.(e);
2230
+ },
2231
+ onError: (e) => {
2232
+ r?.(s.trim(), e.message);
2233
+ },
2234
+ onSettled: () => {
2235
+ g();
2236
+ }
2237
+ }), g = () => {
2238
+ c(""), u(null), p(!1), h.reset(), t();
2239
+ }, _ = (e) => {
2240
+ let t = e.trim();
2241
+ if (!t) return u(i._({ id: "48bMai" })), !1;
2242
+ if (t.length < 3) return u(i._({ id: "gjop1H" })), !1;
2243
+ if (t.length > 63) return u(i._({ id: "is0Bhk" })), !1;
2244
+ if (!Be.test(t)) return u(i._({ id: "IQldU4" })), !1;
2245
+ if (!/^[a-z0-9]/.test(t) || !/[a-z0-9]$/.test(t)) return u(i._({ id: "VG2a+x" })), !1;
2246
+ if (t.includes("..")) return u(i._({ id: "V8/eES" })), !1;
2247
+ if (Ve.test(t)) return u(i._({ id: "W8Rb/w" })), !1;
2248
+ for (let e of He) if (t.startsWith(e)) return u(i._({
2249
+ id: "B2SpR8",
2250
+ values: { prefix: e }
2251
+ })), !1;
2252
+ for (let e of Ue) if (t.endsWith(e)) return u(i._({
2253
+ id: "QRlXaL",
2254
+ values: { suffix: e }
2255
+ })), !1;
2256
+ return u(null), !0;
2257
+ }, v = (e) => {
2258
+ let t = e.target.value;
2259
+ c(t), l && _(t);
2260
+ }, y = () => {
2261
+ _(s) && h.mutate({
2262
+ project_id: o,
2263
+ bucketName: s.trim(),
2264
+ enableVersioning: d
2265
+ });
2266
+ };
2267
+ return e ? /*#__PURE__*/ z(j, {
2268
+ title: i._({ id: "HiDAFk" }),
2269
+ open: e,
2270
+ onCancel: g,
2271
+ confirmButtonLabel: i._({ id: "hYgDIe" }),
2272
+ onConfirm: y,
2273
+ cancelButtonLabel: i._({ id: "dEgA5A" }),
2274
+ size: "small",
2275
+ disableConfirmButton: h.isPending || !s.trim(),
2276
+ children: /*#__PURE__*/ B(f, {
2277
+ direction: "vertical",
2278
+ gap: "6",
2279
+ children: [
2280
+ /*#__PURE__*/ z("p", {
2281
+ className: "text-theme-default",
2282
+ children: /*#__PURE__*/ z(W, { id: "ASJMIw" })
2283
+ }),
2284
+ /*#__PURE__*/ z(C, {
2285
+ label: i._({ id: "NNpgo3" }),
2286
+ required: !0,
2287
+ value: s,
2288
+ onChange: v,
2289
+ onKeyDown: (e) => {
2290
+ e.key === "Enter" && y();
2291
+ },
2292
+ invalid: !!l,
2293
+ errortext: l || void 0,
2294
+ disabled: h.isPending,
2295
+ autoFocus: !0,
2296
+ placeholder: i._({ id: "yDHGP+" })
2297
+ }),
2298
+ /*#__PURE__*/ z(E, {
2299
+ label: i._({ id: "ifQSTI" }),
2300
+ helptext: i._({ id: "WM+Nm7" }),
2301
+ checked: d,
2302
+ onChange: (e) => p(e.target.checked),
2303
+ disabled: h.isPending
2304
+ })
2305
+ ]
2306
+ })
2307
+ }) : null;
2308
+ }, Ge = ({ buckets: e, createModalOpen: t, setCreateModalOpen: n, onCreateSuccess: i, onCreateError: a, onEmptySuccess: l, onEmptyError: u, onDeleteSuccess: d, onDeleteError: f, selectedBuckets: p, setSelectedBuckets: m, hasAnyBulkAction: h = !0 }) => {
2309
+ let { projectId: g, provider: v, storageType: y } = oe({ strict: !1 }), { i18n: b, _: x } = G(), C = U(), T = ae(null), [D, O] = H(0), [k, A] = H(null), [j, M] = H(null);
2310
+ ie(() => {
2311
+ T.current && O(T.current.offsetWidth - T.current.clientWidth);
2312
+ }, [e.length]);
2313
+ let N = (e) => {
2314
+ try {
2315
+ return new Date(e).toLocaleString();
2316
+ } catch {
2317
+ return b._({ id: "fj5byd" });
2318
+ }
2319
+ }, P = q({
2320
+ count: e.length,
2321
+ getScrollElement: () => T.current,
2322
+ estimateSize: () => 48,
2323
+ overscan: 10
2324
+ }), ee = (e) => {
2325
+ p.includes(e) ? m(p.filter((t) => t !== e)) : m([...p, e]);
2326
+ };
2327
+ if (!e || e.length === 0) return /*#__PURE__*/ z(w, {
2328
+ columns: 4,
2329
+ className: "buckets",
2330
+ "data-testid": "no-buckets",
2331
+ children: /*#__PURE__*/ z(c, { children: /*#__PURE__*/ z(o, {
2332
+ colSpan: 4,
2333
+ children: /*#__PURE__*/ B("div", {
2334
+ className: "py-8 text-center",
2335
+ children: [/*#__PURE__*/ z("h3", {
2336
+ className: "text-lg font-semibold",
2337
+ children: /*#__PURE__*/ z(W, { id: "ih2lfP" })
2338
+ }), /*#__PURE__*/ z("p", {
2339
+ className: "text-theme-light mt-2",
2340
+ children: /*#__PURE__*/ z(W, { id: "emkxJa" })
2341
+ })]
2342
+ })
2343
+ }) })
2344
+ });
2345
+ let I = h ? 6 : 5, ne = h ? "40px minmax(200px, 2fr) minmax(100px, 1fr) minmax(180px, 2fr) minmax(100px, 1fr) 60px" : "minmax(200px, 2fr) minmax(100px, 1fr) minmax(180px, 2fr) minmax(100px, 1fr) 60px";
2346
+ return /*#__PURE__*/ B(R, { children: [
2347
+ /*#__PURE__*/ B("div", {
2348
+ className: "relative",
2349
+ children: [/*#__PURE__*/ z("div", {
2350
+ style: { paddingRight: `${D}px` },
2351
+ children: /*#__PURE__*/ z(w, {
2352
+ columns: I,
2353
+ gridColumnTemplate: ne,
2354
+ className: "buckets",
2355
+ "data-testid": "buckets-table-header",
2356
+ children: /*#__PURE__*/ B(c, { children: [
2357
+ h && /*#__PURE__*/ z(s, {}),
2358
+ /*#__PURE__*/ z(s, { children: /*#__PURE__*/ z(W, { id: "BTsbBe" }) }),
2359
+ /*#__PURE__*/ z(s, { children: /*#__PURE__*/ z(W, { id: "sxbP3b" }) }),
2360
+ /*#__PURE__*/ z(s, { children: /*#__PURE__*/ z(W, { id: "sjMCOP" }) }),
2361
+ /*#__PURE__*/ z(s, { children: /*#__PURE__*/ z(W, { id: "hgpMHD" }) }),
2362
+ /*#__PURE__*/ z(s, { style: { marginRight: `-${D}px` } })
2363
+ ] })
2364
+ })
2365
+ }), /*#__PURE__*/ z("div", {
2366
+ ref: T,
2367
+ className: "overflow-auto",
2368
+ style: { height: "calc(100vh - 490px)" },
2369
+ "data-testid": "buckets-table-body",
2370
+ children: /*#__PURE__*/ z("div", {
2371
+ style: {
2372
+ height: `${P.getTotalSize()}px`,
2373
+ width: "100%",
2374
+ position: "relative"
2375
+ },
2376
+ children: P.getVirtualItems().map((t) => {
2377
+ let n = e[t.index], i = p.includes(n.name), a = () => C({
2378
+ to: "/projects/$projectId/storage/$provider/$storageType/$containerName/objects",
2379
+ params: {
2380
+ projectId: g ?? "",
2381
+ provider: v ?? "ceph",
2382
+ storageType: y ?? "buckets",
2383
+ containerName: n.name
2384
+ }
2385
+ });
2386
+ return /*#__PURE__*/ B("div", {
2387
+ "data-index": t.index,
2388
+ ref: P.measureElement,
2389
+ className: "juno-datagrid group hover:bg-theme-background-lvl-1 cursor-pointer",
2390
+ style: {
2391
+ position: "absolute",
2392
+ top: 0,
2393
+ left: 0,
2394
+ width: "100%",
2395
+ transform: `translateY(${t.start}px)`,
2396
+ display: "grid",
2397
+ gridTemplateColumns: ne,
2398
+ alignItems: "stretch"
2399
+ },
2400
+ "data-testid": `bucket-row-${n.name}`,
2401
+ role: "link",
2402
+ tabIndex: 0,
2403
+ onClick: a,
2404
+ onKeyDown: (e) => {
2405
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), a());
2406
+ },
2407
+ children: [
2408
+ h && /*#__PURE__*/ z(o, {
2409
+ onClick: (e) => e.stopPropagation(),
2410
+ onKeyDown: (e) => {
2411
+ (e.key === "Enter" || e.key === " ") && e.stopPropagation();
2412
+ },
2413
+ children: /*#__PURE__*/ z(E, {
2414
+ checked: i,
2415
+ onChange: () => ee(n.name),
2416
+ "data-testid": `select-bucket-${n.name}`
2417
+ })
2418
+ }),
2419
+ /*#__PURE__*/ z(o, {
2420
+ className: "min-w-0 overflow-hidden",
2421
+ children: /*#__PURE__*/ z("span", {
2422
+ className: "block truncate",
2423
+ title: n.name,
2424
+ children: n.name
2425
+ })
2426
+ }),
2427
+ /*#__PURE__*/ z(o, { children: n.count.toLocaleString() }),
2428
+ /*#__PURE__*/ z(o, { children: N(n.last_modified || n.creationDate || "") }),
2429
+ /*#__PURE__*/ z(o, { children: F(n.bytes) }),
2430
+ /*#__PURE__*/ z(o, {
2431
+ onClick: (e) => e.stopPropagation(),
2432
+ children: /*#__PURE__*/ z(r, { children: /*#__PURE__*/ B(_, { children: [
2433
+ /*#__PURE__*/ z(S, {
2434
+ label: b._({ id: "v0hPHE" }),
2435
+ onClick: a,
2436
+ "data-testid": `show-details-action-${n.name}`
2437
+ }),
2438
+ /*#__PURE__*/ z(S, {
2439
+ label: b._({ id: "N2S1rs" }),
2440
+ onClick: () => A(n),
2441
+ "data-testid": `empty-action-${n.name}`
2442
+ }),
2443
+ /*#__PURE__*/ z(S, {
2444
+ label: b._({ id: "cnGeoo" }),
2445
+ onClick: () => M(n),
2446
+ "data-testid": `delete-action-${n.name}`
2447
+ })
2448
+ ] }) })
2449
+ })
2450
+ ]
2451
+ }, n.name);
2452
+ })
2453
+ })
2454
+ })]
2455
+ }),
2456
+ /*#__PURE__*/ z(We, {
2457
+ isOpen: t,
2458
+ onClose: () => n(!1),
2459
+ onSuccess: i,
2460
+ onError: a
2461
+ }),
2462
+ /*#__PURE__*/ z(L, {
2463
+ isOpen: k !== null,
2464
+ bucket: k,
2465
+ onClose: () => A(null),
2466
+ onSuccess: l,
2467
+ onError: u
2468
+ }),
2469
+ /*#__PURE__*/ z(te, {
2470
+ isOpen: j !== null,
2471
+ bucket: j,
2472
+ onClose: () => M(null),
2473
+ onSuccess: d,
2474
+ onError: f
2475
+ })
2476
+ ] });
2477
+ }, Ke = (e) => ({
2478
+ message: /*#__PURE__*/ z(W, { id: "M3bysB" }),
2479
+ description: /*#__PURE__*/ z(W, {
2480
+ id: "VKCkZH",
2481
+ values: { bucketName: e }
2482
+ })
2483
+ }), qe = (e, t) => ({
2484
+ message: /*#__PURE__*/ z(W, { id: "UaP7Th" }),
2485
+ description: /*#__PURE__*/ z(W, {
2486
+ id: "boefwq",
2487
+ values: {
2488
+ bucketName: e,
2489
+ errorMessage: t
2490
+ }
2491
+ })
2492
+ }), Je = (e, t) => ({
2493
+ message: /*#__PURE__*/ z(W, { id: "b95YH9" }),
2494
+ description: t === 0 ? /*#__PURE__*/ z(W, {
2495
+ id: "8erw15",
2496
+ values: { bucketName: e }
2497
+ }) : t === 1 ? /*#__PURE__*/ z(W, {
2498
+ id: "QpbWpf",
2499
+ values: {
2500
+ bucketName: e,
2501
+ deletedCount: t
2502
+ }
2503
+ }) : /*#__PURE__*/ z(W, {
2504
+ id: "JPWqr2",
2505
+ values: {
2506
+ bucketName: e,
2507
+ deletedCount: t
2508
+ }
2509
+ })
2510
+ }), Ye = (e, t) => ({
2511
+ message: /*#__PURE__*/ z(W, { id: "66YUKF" }),
2512
+ description: /*#__PURE__*/ z(W, {
2513
+ id: "t7ewhH",
2514
+ values: {
2515
+ bucketName: e,
2516
+ errorMessage: t
2517
+ }
2518
+ })
2519
+ }), Xe = (e) => ({
2520
+ message: /*#__PURE__*/ z(W, { id: "bHUarC" }),
2521
+ description: /*#__PURE__*/ z(W, {
2522
+ id: "hQdfmR",
2523
+ values: { bucketName: e }
2524
+ })
2525
+ }), Ze = (e, t) => ({
2526
+ message: /*#__PURE__*/ z(W, { id: "1NFtQz" }),
2527
+ description: /*#__PURE__*/ z(W, {
2528
+ id: "CongmL",
2529
+ values: {
2530
+ bucketName: e,
2531
+ errorMessage: t
2532
+ }
2533
+ })
2534
+ }), Qe = (e, t, n) => {
2535
+ let r = n.length > 0, i = e + n.length, a = n.length;
2536
+ return {
2537
+ message: r ? /*#__PURE__*/ z(W, { id: "6fuDFZ" }) : /*#__PURE__*/ z(W, { id: "BOoOLQ" }),
2538
+ description: r ? /*#__PURE__*/ z(W, {
2539
+ id: "pD/2BQ",
2540
+ values: {
2541
+ emptiedCount: e,
2542
+ totalBuckets: i,
2543
+ totalDeleted: t,
2544
+ errorsLength: a
2545
+ }
2546
+ }) : /*#__PURE__*/ z(W, {
2547
+ id: "YVLcyI",
2548
+ values: {
2549
+ emptiedCount: e,
2550
+ totalDeleted: t
2551
+ }
2552
+ })
2553
+ };
2554
+ }, $e = 20, et = ({ isOpen: e, buckets: t, onClose: n, onComplete: r }) => {
2555
+ let { i18n: i, _: a } = G(), o = I(), [s, c] = H(null), [l, d] = H(""), p = M.useUtils(), m = M.storage.ceph.objects.deleteAll.useMutation(), h = () => {
2556
+ m.reset(), c(null), d(""), n();
2557
+ }, g = async () => {
2558
+ let e = 0, n = 0, i = [], a = t.length;
2559
+ for (let r = 0; r < t.length; r++) {
2560
+ c({
2561
+ current: r + 1,
2562
+ total: a
2563
+ });
2564
+ let s = t[r];
2565
+ try {
2566
+ let t = await m.mutateAsync({
2567
+ project_id: o,
2568
+ containerName: s.name
2569
+ });
2570
+ n += t, e++;
2571
+ } catch (e) {
2572
+ let t = e instanceof Error ? e.message : String(e);
2573
+ i.push(`${s.name}: ${t}`);
2574
+ }
2575
+ }
2576
+ e > 0 && await p.storage.ceph.containers.list.invalidate(), r?.({
2577
+ emptiedCount: e,
2578
+ totalDeleted: n,
2579
+ errors: i
2580
+ }), h();
2581
+ };
2582
+ if (!e || t.length === 0) return null;
2583
+ let _ = t.length, v = t.slice(0, $e), y = _ - v.length, b = m.isPending || s !== null, x = s?.current, S = s?.total, w = l === "empty";
2584
+ return /*#__PURE__*/ z(j, {
2585
+ title: /*#__PURE__*/ z(W, {
2586
+ id: "DWBWmW",
2587
+ values: { totalCount: _ }
2588
+ }),
2589
+ open: e,
2590
+ onCancel: h,
2591
+ confirmButtonLabel: b ? i._({ id: "s4Vnq2" }) : i._({ id: "N2S1rs" }),
2592
+ confirmButtonVariant: "primary-danger",
2593
+ cancelButtonLabel: i._({ id: "dEgA5A" }),
2594
+ onConfirm: g,
2595
+ disableConfirmButton: b || !w,
2596
+ disableCancelButton: b,
2597
+ disableCloseButton: b,
2598
+ size: "small",
2599
+ children: b ? /*#__PURE__*/ B(f, {
2600
+ direction: "vertical",
2601
+ distribution: "center",
2602
+ alignment: "center",
2603
+ gap: "2",
2604
+ className: "py-4",
2605
+ children: [/*#__PURE__*/ z(u, { variant: "primary" }), s && /*#__PURE__*/ z("p", {
2606
+ className: "text-theme-light text-sm",
2607
+ children: /*#__PURE__*/ z(W, {
2608
+ id: "NW1XEL",
2609
+ values: {
2610
+ progressCurrent: x,
2611
+ progressTotal: S
2612
+ }
2613
+ })
2614
+ })]
2615
+ }) : /*#__PURE__*/ B(f, {
2616
+ direction: "vertical",
2617
+ gap: "4",
2618
+ children: [
2619
+ /*#__PURE__*/ z(W, {
2620
+ id: "CtiFDz",
2621
+ values: { totalCount: _ }
2622
+ }),
2623
+ /*#__PURE__*/ B("div", { children: [/*#__PURE__*/ z("p", {
2624
+ className: "text-theme-light mb-2 text-sm",
2625
+ children: /*#__PURE__*/ z(W, { id: "Zshv0H" })
2626
+ }), /*#__PURE__*/ B("ul", {
2627
+ className: "list-inside list-disc space-y-1 text-sm",
2628
+ children: [v.map((e) => {
2629
+ let t = e.name, n = e.count;
2630
+ return /*#__PURE__*/ B("li", { children: [t, n > 0 && /*#__PURE__*/ B("span", {
2631
+ className: "text-theme-light ml-2",
2632
+ children: [
2633
+ "(",
2634
+ n,
2635
+ " ",
2636
+ /*#__PURE__*/ z(W, {
2637
+ id: "gFsjJK",
2638
+ values: { bucketCount: n }
2639
+ }),
2640
+ ")"
2641
+ ]
2642
+ })] }, t);
2643
+ }), y > 0 && /*#__PURE__*/ z("li", {
2644
+ className: "text-theme-light",
2645
+ children: /*#__PURE__*/ z(W, {
2646
+ id: "yqPflB",
2647
+ values: { hiddenCount: y }
2648
+ })
2649
+ })]
2650
+ })] }),
2651
+ /*#__PURE__*/ z(C, {
2652
+ label: i._({ id: "Ghp863" }),
2653
+ value: l,
2654
+ onChange: (e) => d(e.target.value),
2655
+ placeholder: "empty",
2656
+ autoFocus: !0
2657
+ })
2658
+ ]
2659
+ })
2660
+ });
2661
+ };
2662
+ //#endregion
2663
+ //#region src/client/routes/_auth/projects/$projectId/storage/-components/Ceph/Buckets/CredentialPrompt.tsx
2664
+ function tt({ onSuccess: t }) {
2665
+ let n = I(), r = M.useUtils(), i = M.storage.ceph.ec2Credentials.create.useMutation({
2666
+ onSuccess: () => {
2667
+ r.storage.ceph.ec2Credentials.list.invalidate(), t();
2668
+ },
2669
+ onError: (t) => {
2670
+ let n = t.message;
2671
+ e.error(/*#__PURE__*/ z(W, {
2672
+ id: "rcBt6T",
2673
+ values: { errorMessage: n }
2674
+ }));
2675
+ }
2676
+ });
2677
+ return /*#__PURE__*/ B(f, {
2678
+ direction: "vertical",
2679
+ gap: "4",
2680
+ className: "mt-8 max-w-lg",
2681
+ children: [
2682
+ /*#__PURE__*/ z("h2", {
2683
+ className: "text-lg font-semibold",
2684
+ children: /*#__PURE__*/ z(W, { id: "wXxPjv" })
2685
+ }),
2686
+ /*#__PURE__*/ z("p", {
2687
+ className: "text-theme-default",
2688
+ children: /*#__PURE__*/ z(W, { id: "+8m5QE" })
2689
+ }),
2690
+ /*#__PURE__*/ z("p", {
2691
+ className: "text-theme-default text-sm",
2692
+ children: /*#__PURE__*/ z(W, { id: "+1xG4p" })
2693
+ }),
2694
+ /*#__PURE__*/ z("div", { children: /*#__PURE__*/ z(m, {
2695
+ onClick: () => n && i.mutate({ project_id: n }),
2696
+ disabled: i.isPending || !n,
2697
+ children: i.isPending ? /*#__PURE__*/ z(W, { id: "k/zHK7" }) : /*#__PURE__*/ z(W, { id: "FJO48W" })
2698
+ }) })
2699
+ ]
2700
+ });
2701
+ }
2702
+ //#endregion
2703
+ //#region src/client/routes/_auth/projects/$projectId/storage/-components/Ceph/Buckets/index.tsx
2704
+ var nt = () => {
2705
+ let { i18n: t, i18n: n, _: i } = G(), o = I(), s = U({ from: N.fullPath }), { sortBy: c, sortDirection: l, search: d = "" } = N.useSearch(), [p, g] = H(!1), [v, y] = H(!1), [b, C] = H([]), [w, T] = H(d), D = ae(void 0);
2706
+ ie(() => () => clearTimeout(D.current), []), ie(() => {
2707
+ T(d);
2708
+ }, [d]);
2709
+ let O = (t) => {
2710
+ let { message: n, ...r } = Ke(t);
2711
+ e.success(n, r);
2712
+ }, k = (t, n) => {
2713
+ let { message: r, ...i } = qe(t, n);
2714
+ e.error(r, i);
2715
+ }, A = (t, n) => {
2716
+ let { message: r, ...i } = Je(t, n);
2717
+ e.success(r, i);
2718
+ }, j = (t, n) => {
2719
+ let { message: r, ...i } = Ye(t, n);
2720
+ e.error(r, i);
2721
+ }, P = (t) => {
2722
+ let { message: n, ...r } = Xe(t);
2723
+ e.success(n, r);
2724
+ }, F = (t, n) => {
2725
+ let { message: r, ...i } = Ze(t, n);
2726
+ e.error(r, i);
2727
+ }, te = ({ emptiedCount: t, totalDeleted: n, errors: r }) => {
2728
+ if (r.length === 0) C([]);
2729
+ else {
2730
+ let e = new Set(r.map((e) => e.split(": ")[0]));
2731
+ C((t) => t.filter((t) => e.has(t)));
2732
+ }
2733
+ let { message: i, ...a } = Qe(t, n, r);
2734
+ r.length > 0 ? e.warning(i, a) : e.success(i, a);
2735
+ }, L = {
2736
+ options: [
2737
+ {
2738
+ label: t._({ id: "6YtxFj" }),
2739
+ value: "name"
2740
+ },
2741
+ {
2742
+ label: t._({ id: "sxbP3b" }),
2743
+ value: "count"
2744
+ },
2745
+ {
2746
+ label: t._({ id: "hgpMHD" }),
2747
+ value: "bytes"
2748
+ },
2749
+ {
2750
+ label: t._({ id: "sjMCOP" }),
2751
+ value: "last_modified"
2752
+ }
2753
+ ],
2754
+ sortBy: c ?? "name",
2755
+ sortDirection: l ?? "asc"
2756
+ }, { data: R, isLoading: ne, error: V } = M.storage.ceph.containers.list.useQuery({
2757
+ project_id: o,
2758
+ includeMetadata: !0
2759
+ }, {
2760
+ enabled: !!o,
2761
+ retry: !1
2762
+ }), oe = (e) => [...e].sort((e, t) => {
2763
+ let n;
2764
+ switch (c ?? "name") {
2765
+ case "name":
2766
+ n = e.name.localeCompare(t.name);
2767
+ break;
2768
+ case "count":
2769
+ n = e.count - t.count;
2770
+ break;
2771
+ case "bytes":
2772
+ n = e.bytes - t.bytes;
2773
+ break;
2774
+ case "last_modified":
2775
+ if (!e.last_modified && !t.last_modified) return 0;
2776
+ if (!e.last_modified) return 1;
2777
+ if (!t.last_modified) return -1;
2778
+ n = new Date(e.last_modified).getTime() - new Date(t.last_modified).getTime();
2779
+ break;
2780
+ default: n = e.name.localeCompare(t.name);
2781
+ }
2782
+ return (l ?? "asc") === "desc" ? -n : n;
2783
+ }), K = (R || []).filter((e) => e.name.toLowerCase().includes(d.toLowerCase())), se = oe(K), q = (e) => {
2784
+ let t = typeof e == "string" ? e : "";
2785
+ re(() => {
2786
+ s({ search: (e) => ({
2787
+ ...e,
2788
+ search: t || void 0
2789
+ }) });
2790
+ });
2791
+ }, ce = (e) => {
2792
+ let t = e.sortBy?.toString() || "name", n = e.sortDirection || "asc";
2793
+ re(() => {
2794
+ s({ search: (e) => ({
2795
+ ...e,
2796
+ sortBy: t,
2797
+ sortDirection: n
2798
+ }) });
2799
+ });
2800
+ };
2801
+ if (ne) return /*#__PURE__*/ B(f, {
2802
+ className: "absolute inset-0",
2803
+ distribution: "center",
2804
+ alignment: "center",
2805
+ direction: "vertical",
2806
+ children: [/*#__PURE__*/ z(u, {
2807
+ variant: "primary",
2808
+ size: "large",
2809
+ className: "mb-2"
2810
+ }), /*#__PURE__*/ z(W, { id: "c5i+X0" })]
2811
+ });
2812
+ if (V) {
2813
+ let e = V.message;
2814
+ if (e === "NO_CEPH_CREDENTIALS") return /*#__PURE__*/ z(tt, { onSuccess: () => window.location.reload() });
2815
+ let t = e.includes("Access denied") || e.includes("AccessDenied"), n = e.includes("Invalid access key") || e.includes("InvalidAccessKeyId");
2816
+ return /*#__PURE__*/ z("div", {
2817
+ className: "p-8",
2818
+ children: /*#__PURE__*/ z("p", {
2819
+ className: "text-theme-default text-sm",
2820
+ children: t ? /*#__PURE__*/ z(W, { id: "HAcOOW" }) : n ? /*#__PURE__*/ z(W, { id: "xIXYTK" }) : /*#__PURE__*/ z(W, {
2821
+ id: "yDAMyU",
2822
+ values: { errorMessage: e }
2823
+ })
2824
+ })
2825
+ });
2826
+ }
2827
+ let J = (R || []).filter((e) => b.includes(e.name)), le = J.length > 0, ue = J.length, de = (R || []).length, fe = K.length, Y = se.map((e) => e.name), pe = Y.length > 0 && Y.every((e) => b.includes(e)), me = Y.some((e) => b.includes(e));
2828
+ return /*#__PURE__*/ B("div", {
2829
+ className: "relative",
2830
+ children: [
2831
+ /*#__PURE__*/ B(f, {
2832
+ direction: "vertical",
2833
+ children: [
2834
+ /*#__PURE__*/ B(f, {
2835
+ distribution: "end",
2836
+ alignment: "center",
2837
+ gap: "2",
2838
+ className: "pb-2",
2839
+ children: [/*#__PURE__*/ z(f, {
2840
+ gap: "0.5",
2841
+ alignment: "center",
2842
+ children: /*#__PURE__*/ z(ee, {
2843
+ options: L.options,
2844
+ sortBy: L.sortBy,
2845
+ sortDirection: L.sortDirection ?? "asc",
2846
+ selectClassName: "w-40",
2847
+ onSortByChange: (e) => ce({
2848
+ ...L,
2849
+ sortBy: e,
2850
+ sortDirection: L.sortDirection
2851
+ }),
2852
+ onSortDirectionChange: (e) => ce({
2853
+ ...L,
2854
+ sortDirection: e
2855
+ })
2856
+ })
2857
+ }), /*#__PURE__*/ z(m, {
2858
+ variant: "primary",
2859
+ className: "whitespace-nowrap",
2860
+ onClick: () => g(!0),
2861
+ children: /*#__PURE__*/ z(W, { id: "HiDAFk" })
2862
+ })]
2863
+ }),
2864
+ /*#__PURE__*/ z(h, { children: /*#__PURE__*/ z(f, {
2865
+ direction: "vertical",
2866
+ gap: "2",
2867
+ children: /*#__PURE__*/ z(f, {
2868
+ distribution: "end",
2869
+ alignment: "center",
2870
+ children: /*#__PURE__*/ z(a, {
2871
+ placeholder: t._({ id: "VeDAv2" }),
2872
+ "data-testid": "searchbar",
2873
+ value: w,
2874
+ onInput: (e) => {
2875
+ let t = e.currentTarget.value;
2876
+ T(t), clearTimeout(D.current), D.current = window.setTimeout(() => q(t), 500);
2877
+ },
2878
+ onSearch: (e) => {
2879
+ clearTimeout(D.current), q(typeof e == "string" ? e : "");
2880
+ },
2881
+ onClear: () => {
2882
+ clearTimeout(D.current), T(""), q("");
2883
+ }
2884
+ })
2885
+ })
2886
+ }) }),
2887
+ /*#__PURE__*/ z(h, { children: /*#__PURE__*/ B(f, {
2888
+ distribution: "start",
2889
+ gap: "2",
2890
+ alignment: "center",
2891
+ className: "text-sm",
2892
+ children: [/*#__PURE__*/ B(f, {
2893
+ gap: "2",
2894
+ alignment: "center",
2895
+ children: [/*#__PURE__*/ z(E, {
2896
+ checked: pe,
2897
+ indeterminate: me && !pe,
2898
+ onChange: () => {
2899
+ C(pe ? (e) => e.filter((e) => !Y.includes(e)) : (e) => [...new Set([...e, ...Y])]);
2900
+ }
2901
+ }), /*#__PURE__*/ B(r, {
2902
+ className: "flex items-center",
2903
+ children: [/*#__PURE__*/ z(x, {
2904
+ as: "div",
2905
+ children: /*#__PURE__*/ z(m, {
2906
+ disabled: !le,
2907
+ size: "small",
2908
+ icon: "moreVert",
2909
+ label: t._({ id: "7L01XJ" })
2910
+ })
2911
+ }), le && /*#__PURE__*/ z(_, { children: /*#__PURE__*/ z(S, {
2912
+ disabled: !le,
2913
+ label: n._(t._({
2914
+ id: "P2tWBZ",
2915
+ values: { selectedCount: ue }
2916
+ })),
2917
+ onClick: () => y(!0)
2918
+ }) })]
2919
+ })]
2920
+ }), /*#__PURE__*/ z("div", {
2921
+ className: "text-theme-light flex items-center gap-1",
2922
+ "data-testid": "buckets-info-block",
2923
+ children: d.trim() ? /*#__PURE__*/ z(W, {
2924
+ id: "xOvKAE",
2925
+ values: {
2926
+ totalCount: de,
2927
+ filteredCount: fe
2928
+ }
2929
+ }) : /*#__PURE__*/ z(W, {
2930
+ id: "Ux/pNd",
2931
+ values: { totalCount: de }
2932
+ })
2933
+ })]
2934
+ }) })
2935
+ ]
2936
+ }),
2937
+ /*#__PURE__*/ z(Ge, {
2938
+ buckets: se,
2939
+ createModalOpen: p,
2940
+ setCreateModalOpen: g,
2941
+ onCreateSuccess: O,
2942
+ onCreateError: k,
2943
+ onEmptySuccess: A,
2944
+ onEmptyError: j,
2945
+ onDeleteSuccess: P,
2946
+ onDeleteError: F,
2947
+ selectedBuckets: b,
2948
+ setSelectedBuckets: C,
2949
+ hasAnyBulkAction: !0
2950
+ }),
2951
+ /*#__PURE__*/ z(et, {
2952
+ isOpen: v,
2953
+ buckets: J,
2954
+ onClose: () => y(!1),
2955
+ onComplete: te
2956
+ })
2957
+ ]
2958
+ });
2959
+ };
2960
+ //#endregion
2961
+ //#region src/client/routes/_auth/projects/$projectId/storage/$provider/$storageType/index.tsx?tsr-split=component
2962
+ function rt() {
2963
+ let { project: e, provider: t } = oe({
2964
+ from: "/_auth/projects/$projectId/storage/$provider/$storageType/",
2965
+ select: (e) => ({
2966
+ project: e.projectId,
2967
+ provider: e.provider,
2968
+ storageType: e.storageType
2969
+ })
2970
+ }), { i18n: n, _: r } = G(), i;
2971
+ switch (t) {
2972
+ case "swift":
2973
+ i = n._({ id: "+OEi73" });
2974
+ break;
2975
+ case "ceph":
2976
+ i = n._({ id: "KhNDX4" });
2977
+ break;
2978
+ default: i = n._({ id: "IWF68U" });
2979
+ }
2980
+ return /*#__PURE__*/ B("div", { children: [/*#__PURE__*/ z(P, {
2981
+ title: i,
2982
+ projectId: e
2983
+ }), e ? /*#__PURE__*/ z(se, {
2984
+ resetKeys: [e, t],
2985
+ fallback: /*#__PURE__*/ z("div", {
2986
+ className: "p-4 text-center",
2987
+ children: /*#__PURE__*/ z(W, { id: "diFNkW" })
2988
+ }),
2989
+ children: (() => {
2990
+ switch (t) {
2991
+ case "swift": return /*#__PURE__*/ z(ze, {});
2992
+ case "ceph": return /*#__PURE__*/ z(nt, {});
2993
+ default: return /*#__PURE__*/ z("div", { children: "Storage Overview Page" });
2994
+ }
2995
+ })()
2996
+ }) : /*#__PURE__*/ z("div", {
2997
+ className: "p-4 text-center",
2998
+ children: /*#__PURE__*/ z(W, { id: "Z2fZGD" })
2999
+ })] });
3000
+ }
3001
+ var it = () => /*#__PURE__*/ z(rt, {});
3002
+ //#endregion
3003
+ export { it as component };
3004
+
3005
+ //# sourceMappingURL=_storageType-BrHDa2bD.mjs.map