@epam/ai-dial-publish-panel 1.4.0-dev.96 → 1.4.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/components/PublishDependenciesList/PublishDependenciesList.d.ts.map +1 -1
  2. package/components/PublishPanel/PublishPanel.d.ts +35 -19
  3. package/components/PublishPanel/PublishPanel.d.ts.map +1 -1
  4. package/components/PublishPanel/StandalonePublishPanel.d.ts +10 -14
  5. package/components/PublishPanel/StandalonePublishPanel.d.ts.map +1 -1
  6. package/components/SaveToFolderPanel/StandaloneSaveToFolderPanel.d.ts.map +1 -1
  7. package/constants/publish-dependencies.d.ts +3 -0
  8. package/constants/publish-dependencies.d.ts.map +1 -0
  9. package/index.css +2 -2
  10. package/index.d.ts +5 -12
  11. package/index.d.ts.map +1 -1
  12. package/index.js +700 -1269
  13. package/models/folder-destination.d.ts +0 -2
  14. package/models/folder-destination.d.ts.map +1 -1
  15. package/models/publish-dependencies-list.d.ts +25 -2
  16. package/models/publish-dependencies-list.d.ts.map +1 -1
  17. package/models/publish-panel-styles.d.ts +4 -5
  18. package/models/publish-panel-styles.d.ts.map +1 -1
  19. package/models/publish.d.ts +6 -19
  20. package/models/publish.d.ts.map +1 -1
  21. package/models/save-to-folder-panel.d.ts +51 -89
  22. package/models/save-to-folder-panel.d.ts.map +1 -1
  23. package/package.json +4 -4
  24. package/types/publish-panel.d.ts +1 -1
  25. package/types/publish-panel.d.ts.map +1 -1
  26. package/types/save-to-folder.d.ts +0 -7
  27. package/types/save-to-folder.d.ts.map +1 -1
  28. package/utils/publish-state.d.ts.map +1 -1
  29. package/utils/use-publish-flow.d.ts +53 -26
  30. package/utils/use-publish-flow.d.ts.map +1 -1
  31. package/components/PublishAccessRuleEditor/PublishAccessRuleEditor.d.ts +0 -5
  32. package/components/PublishAccessRuleEditor/PublishAccessRuleEditor.d.ts.map +0 -1
  33. package/components/PublishAccessRules/PublishAccessRules.d.ts +0 -83
  34. package/components/PublishAccessRules/PublishAccessRules.d.ts.map +0 -1
  35. package/components/PublishFoldersTree/PublishFoldersTree.d.ts +0 -5
  36. package/components/PublishFoldersTree/PublishFoldersTree.d.ts.map +0 -1
  37. package/components/SaveToFolderPanel/SaveToFolderPanel.d.ts +0 -5
  38. package/components/SaveToFolderPanel/SaveToFolderPanel.d.ts.map +0 -1
  39. package/models/publish-access-rule-editor.d.ts +0 -79
  40. package/models/publish-access-rule-editor.d.ts.map +0 -1
  41. package/models/publish-access-rules-styles.d.ts +0 -25
  42. package/models/publish-access-rules-styles.d.ts.map +0 -1
  43. package/models/publish-folders-tree.d.ts +0 -73
  44. package/models/publish-folders-tree.d.ts.map +0 -1
package/index.js CHANGED
@@ -1,48 +1,56 @@
1
1
  import { useCallback as e, useEffect as t, useId as n, useMemo as r, useRef as i, useState as a } from "react";
2
- import { Badge as o, BottomSheet as s, ButtonVariant as c, Checkbox as l, ConfirmationPopupVariant as u, DIAL_ICON_SIZE as d, DIAL_KIT_ICON_STROKE as f, DialFileNodeType as p, DialItemType as m, ElementSize as h, EllipsisTooltip as g, ErrorText as _, FileIcon as v, FolderName as y, GhostButton as b, GhostIconButton as x, Highlight as S, Input as ee, LinkButton as C, LiveRegion as w, LiveRegionElement as te, LiveRegionPoliteness as T, NeutralButton as E, Notification as D, NotificationType as O, NotificationVariant as k, PrimaryButton as A, RadioGroup as ne, Search as j, Select as M, SideDrawer as re, Skeleton as N, SkeletonVariant as P, Spinner as ie, Tag as F, TagInput as ae } from "@epam/ai-dial-ui-kit";
3
- import { ConfirmationDialog as I, DeploymentIcon as L, ResourceSummary as oe, TAG_INPUT_TAG_CLASS_NAME as R, buildCssVars as se, mergeClasses as z, useIsMobile as ce } from "@epam/ai-dial-chat-shared";
4
- import { Fragment as le, jsx as B, jsxs as V } from "react/jsx-runtime";
5
- import { IconFolder as H, IconFolderPlus as U, IconPlus as W, IconTrashX as ue } from "@tabler/icons-react";
6
- import { DialFileNodeType as de, DialFoldersTree as fe } from "@epam/ai-dial-react-file-manager";
2
+ import { Badge as o, Checkbox as s, ConfirmationPopupVariant as c, DIAL_ICON_SIZE as l, DIAL_KIT_ICON_STROKE as u, DialFileNodeType as d, DialItemType as f, ElementSize as p, EllipsisTooltip as m, ErrorText as h, FileIcon as g, FolderName as _, GhostButton as v, Input as y, LinkButton as b, LiveRegion as x, LiveRegionElement as S, LiveRegionPoliteness as C, NeutralButton as w, Notification as T, NotificationType as E, NotificationVariant as D, PrimaryButton as O, RadioGroup as k, SideDrawer as ee, Skeleton as A, SkeletonVariant as j, Spinner as M, Tag as N } from "@epam/ai-dial-ui-kit";
3
+ import { ConfirmationDialog as P, DeploymentIcon as te, EntityHeader as ne, ResourceSummary as F, buildCssVars as I, mergeClasses as L } from "@epam/ai-dial-chat-shared";
4
+ import { Fragment as R, jsx as z, jsxs as B } from "react/jsx-runtime";
5
+ import { FolderDestinationPanel as re, FolderDestinationPanelBody as ie, FolderDestinationView as ae } from "@epam/ai-dial-react-file-manager";
6
+ import { IconFolder as oe } from "@tabler/icons-react";
7
7
  //#region src/models/publish.ts
8
- var G = /* @__PURE__ */ function(e) {
9
- return e.Equal = "EQUAL", e.Contain = "CONTAIN", e.Regex = "REGEX", e;
10
- }({}), K = /* @__PURE__ */ function(e) {
11
- return e.None = "none", e.Info = "info", e.ReplaceWarning = "replaceWarning", e.NoAccess = "noAccess", e.SubmitError = "submitError", e;
12
- }({}), q = /* @__PURE__ */ function(e) {
8
+ var V = /* @__PURE__ */ function(e) {
9
+ return e.None = "none", e.Info = "info", e.ReplaceWarning = "replaceWarning", e.TargetTaken = "targetTaken", e.NoAccess = "noAccess", e.SubmitError = "submitError", e;
10
+ }({}), H = /* @__PURE__ */ function(e) {
13
11
  return e.Application = "application", e.Toolset = "toolset", e.Prompt = "prompt", e.Skill = "skill", e.File = "file", e;
14
- }({}), J = (e) => e.isSubmitting ? {
15
- calloutKind: K.None,
12
+ }({}), U = /* @__PURE__ */ function(e) {
13
+ return e.Warning = "warning", e.Published = "published", e;
14
+ }({}), se = (e) => e.isSubmitting ? {
15
+ calloutKind: V.None,
16
16
  isSubmitDisabled: !0,
17
17
  isSubmitLoading: !0
18
- } : e.hasSelectedFolder ? e.hasWriteAccess ? e.hasSubmitError ? {
19
- calloutKind: K.SubmitError,
18
+ } : e.hasSelectedFolder ? e.hasWriteAccess ? e.isTargetChecking ? {
19
+ calloutKind: V.None,
20
+ isSubmitDisabled: !0,
21
+ isSubmitLoading: !1
22
+ } : e.hasSubmitError ? {
23
+ calloutKind: V.SubmitError,
20
24
  isSubmitDisabled: !1,
21
25
  isSubmitLoading: !1
22
26
  } : e.hasExistingPublicationInFolder ? {
23
- calloutKind: K.ReplaceWarning,
27
+ calloutKind: V.ReplaceWarning,
24
28
  isSubmitDisabled: e.allowReplace === !1,
25
29
  isSubmitLoading: !1
30
+ } : e.isTargetTaken ? {
31
+ calloutKind: V.TargetTaken,
32
+ isSubmitDisabled: !0,
33
+ isSubmitLoading: !1
26
34
  } : {
27
- calloutKind: K.Info,
35
+ calloutKind: V.Info,
28
36
  isSubmitDisabled: !1,
29
37
  isSubmitLoading: !1
30
38
  } : {
31
- calloutKind: K.NoAccess,
39
+ calloutKind: V.NoAccess,
32
40
  isSubmitDisabled: !0,
33
41
  isSubmitLoading: !1
34
42
  } : {
35
- calloutKind: K.None,
43
+ calloutKind: V.None,
36
44
  isSubmitDisabled: !0,
37
45
  isSubmitLoading: !1
38
- }, pe = 864e5, Y = (e, t = Date.now(), n) => {
39
- let r = Math.floor((t - e) / pe);
46
+ }, W = 864e5, G = (e, t = Date.now(), n) => {
47
+ let r = Math.floor((t - e) / W);
40
48
  return r <= 0 ? "Today" : r === 1 ? "Yesterday" : r < 7 ? `${r} days ago` : new Date(e).toLocaleDateString(n, {
41
49
  month: "short",
42
50
  day: "numeric",
43
51
  year: "numeric"
44
52
  });
45
- }, X = (e, t, n) => t.length === 0 ? [...e, {
53
+ }, ce = (e, t, n) => t.length === 0 ? [...e, {
46
54
  path: [n],
47
55
  name: n
48
56
  }] : e.map((e) => e.path.join("/") === t.join("/") ? {
@@ -53,490 +61,199 @@ var G = /* @__PURE__ */ function(e) {
53
61
  }]
54
62
  } : {
55
63
  ...e,
56
- children: e.children ? X(e.children, t, n) : e.children
57
- }), Z = (e, t, n) => {
64
+ children: e.children ? ce(e.children, t, n) : e.children
65
+ }), le = (e, t, n) => {
58
66
  let r = [...t, n].join("/");
59
67
  return t.length === 0 ? e.filter((e) => e.path.join("/") !== r) : e.map((e) => e.path.join("/") === t.join("/") ? {
60
68
  ...e,
61
69
  children: (e.children ?? []).filter((e) => e.path.join("/") !== r)
62
70
  } : {
63
71
  ...e,
64
- children: e.children ? Z(e.children, t, n) : e.children
72
+ children: e.children ? le(e.children, t, n) : e.children
65
73
  });
66
- }, me = ({ item: n, history: i, folderItems: o, hasWriteAccess: s = () => !0, defaultAuthor: c = "", onCreateFolder: l, onPublish: u, onPublishSuccess: d, onPublishError: f, onFetchExistingRules: p }) => {
67
- let [m, h] = a(o);
74
+ }, ue = ({ item: n, history: o, folderItems: s, hasWriteAccess: c = () => !0, defaultAuthor: l = "", onCreateFolder: u, onPublish: d, onPublishSuccess: f, onPublishError: p, onCheckTargetExists: m, isTargetTakenError: h, canPublishDirectlyTo: g, onPublishDirectly: _ }) => {
75
+ let [v, y] = a(s);
68
76
  t(() => {
69
- h(o);
70
- }, [o]);
71
- let [g, _] = a(), [v, y] = a(!1), [b, x] = a(!1), [S, ee] = a([]), [C, w] = a(!1), [te, T] = a(!1), [E, D] = a(c), [O, k] = a(!1), [A, ne] = a(!1);
77
+ y(s);
78
+ }, [s]);
79
+ let [b, x] = a(), [S, C] = a(!1), [w, T] = a(!1), [E, D] = a(l), [O, k] = a(!1), [ee, A] = a(!1);
72
80
  t(() => {
73
- A || D(c);
74
- }, [c, A]);
81
+ ee || D(l);
82
+ }, [l, ee]);
75
83
  let j = e((e) => {
76
- ne(!0), D(e);
77
- }, []);
84
+ A(!0), D(e);
85
+ }, []), M = b != null && g != null && _ != null && g(b);
86
+ t(() => {
87
+ M && k(!1);
88
+ }, [M]);
89
+ let N = r(() => {
90
+ if (!b || M) return !1;
91
+ let e = b.join("/");
92
+ return o.some((t) => t.folderPath.join("/") === e ? n.version == null || t.version === n.version : !1);
93
+ }, [
94
+ o,
95
+ M,
96
+ n.version,
97
+ b
98
+ ]), P = i(/* @__PURE__ */ new Set()), [te, ne] = a(), [F, I] = a(), [L, R] = a(!1), z = b == null ? void 0 : `${n.id ?? ""}\u0000${b.join("/")}\u0000${n.version ?? ""}`, B = z != null && (te === z || F === z);
78
99
  t(() => {
79
- if (g == null) {
80
- ee([]), T(!1);
100
+ if (b == null || z == null || !m || N) {
101
+ R(!1);
102
+ return;
103
+ }
104
+ let e = b.join("/");
105
+ if ([...P.current].some((t) => e === t || e.startsWith(`${t}/`))) {
106
+ R(!1);
81
107
  return;
82
108
  }
83
- if (!p) return;
84
- let e = !1;
85
- return w(!0), T(!1), p(g).then((t) => {
86
- e || ee(t);
87
- }).catch(() => {
88
- e || T(!0);
89
- }).finally(() => {
90
- e || w(!1);
109
+ let t = !1;
110
+ return R(!0), m(n, b).then((e) => {
111
+ t || ne((t) => e ? z : t === z ? void 0 : t);
112
+ }).catch(() => void 0).finally(() => {
113
+ t || R(!1);
91
114
  }), () => {
92
- e = !0;
115
+ t = !0;
93
116
  };
94
- }, [g]);
95
- let M = r(() => {
96
- if (!g) return !1;
97
- let e = g.join("/");
98
- return i.some((t) => t.folderPath.join("/") === e ? n.version == null || t.version === n.version : !1);
99
117
  }, [
100
- i,
101
- n.version,
102
- g
103
- ]), re = e(async (e, t) => {
104
- h((n) => X(n, e, t));
118
+ z,
119
+ N,
120
+ m == null
121
+ ]);
122
+ let re = e(async (e, t) => {
123
+ let n = [...e, t].join("/");
124
+ P.current.add(n), y((n) => ce(n, e, t));
105
125
  try {
106
- await l?.(e, t);
126
+ await u?.(e, t);
107
127
  } catch {
108
- h((n) => Z(n, e, t)), x(!0);
128
+ P.current.delete(n), y((n) => le(n, e, t)), T(!0);
109
129
  }
110
- }, [l]), N = e(async () => {
111
- if (!g) return !1;
112
- y(!0), x(!1);
130
+ }, [u]), ie = e(async () => {
131
+ if (!b) return !1;
132
+ C(!0), T(!1);
113
133
  try {
114
- return await u(n, g, S, E.trim(), O), d?.(n, g), !0;
134
+ return M && _ ? await _(n, b) : await d(n, b, E.trim(), O), f?.(n, b, M), !0;
115
135
  } catch (e) {
116
- return x(!0), f?.(n, g, e), !1;
136
+ return h?.(e) && z != null ? I(z) : T(!0), p?.(n, b, e), !1;
117
137
  } finally {
118
- y(!1);
138
+ C(!1);
119
139
  }
120
140
  }, [
121
141
  E,
142
+ M,
143
+ h,
122
144
  n,
123
- u,
124
- f,
125
145
  d,
146
+ _,
147
+ p,
148
+ f,
126
149
  O,
127
- S,
128
- g
129
- ]), P = e(() => {
130
- h(o), _(void 0), x(!1), ee([]), T(!1), D(c), ne(!1), k(!1);
131
- }, [c, o]);
150
+ b,
151
+ z
152
+ ]), ae = e(() => {
153
+ y(s), x(void 0), T(!1), D(l), A(!1), k(!1), P.current.clear(), ne(void 0), I(void 0), R(!1);
154
+ }, [l, s]);
132
155
  return {
133
- folderItems: m,
134
- selectedFolderPath: g,
135
- setSelectedFolderPath: _,
156
+ folderItems: v,
157
+ selectedFolderPath: b,
158
+ setSelectedFolderPath: x,
136
159
  handleCreateFolder: re,
137
- hasExistingPublicationInFolder: M,
138
- hasWriteAccess: !g || s(g),
139
- isSubmitting: v,
140
- hasSubmitError: b,
141
- handleSubmit: N,
142
- reset: P,
143
- rules: S,
144
- setRules: ee,
160
+ hasExistingPublicationInFolder: N,
161
+ hasWriteAccess: !b || c(b),
162
+ isSubmitting: S,
163
+ hasSubmitError: w,
164
+ handleSubmit: ie,
165
+ reset: ae,
145
166
  author: E,
146
167
  setAuthor: j,
147
168
  publishCredentials: O,
148
169
  setPublishCredentials: k,
149
- isRulesLoading: C,
150
- hasRulesLoadError: te
170
+ isTargetTaken: B,
171
+ isTargetChecking: L,
172
+ isDirectWrite: M
151
173
  };
152
- }, Q = /* @__PURE__ */ function(e) {
174
+ }, K = /* @__PURE__ */ function(e) {
153
175
  return e.Main = "main", e.ChangeFolder = "change-folder", e;
154
- }({}), he = ({ isOpen: e, selectedFolderPath: n, onSelectedFolderPathChange: r }) => {
155
- let [i, o] = a(Q.Main), [s, c] = a();
176
+ }({}), de = ({ isOpen: e, selectedFolderPath: n, onSelectedFolderPathChange: r }) => {
177
+ let [i, o] = a(K.Main), [s, c] = a();
156
178
  return t(() => {
157
- e && o(Q.Main);
179
+ e && o(K.Main);
158
180
  }, [e]), {
159
181
  view: i,
160
182
  pendingFolderPath: s,
161
183
  setPendingFolderPath: c,
162
184
  openFolderView: () => {
163
- c(n), o(Q.ChangeFolder);
185
+ c(n), o(K.ChangeFolder);
164
186
  },
165
- backToMain: () => o(Q.Main),
187
+ backToMain: () => o(K.Main),
166
188
  selectFolder: () => {
167
- s != null && r(s), o(Q.Main);
189
+ s != null && r(s), o(K.Main);
168
190
  }
169
191
  };
170
- }, ge = (e, t) => {
192
+ }, fe = (e, t) => {
171
193
  let n = t.trim().toLowerCase();
172
194
  return n ? e.reduce((e, r) => {
173
- let i = r.children ? ge(r.children, t) : void 0;
195
+ let i = r.children ? fe(r.children, t) : void 0;
174
196
  return r.name.toLowerCase().includes(n) ? e.push(r) : i?.length && e.push({
175
197
  ...r,
176
198
  children: i
177
199
  }), e;
178
200
  }, []) : e;
179
- }, _e = (e, t) => e.localeCompare(t, void 0, {
201
+ }, pe = (e, t) => e.localeCompare(t, void 0, {
180
202
  sensitivity: "base",
181
203
  numeric: !0
182
- }), ve = (e) => [...e].sort((e, t) => _e(e.name, t.name)).map((e) => e.children ? {
204
+ }), q = (e) => [...e].sort((e, t) => pe(e.name, t.name)).map((e) => e.children ? {
183
205
  ...e,
184
- children: ve(e.children)
185
- } : e), ye = (e, t, n) => {
206
+ children: q(e.children)
207
+ } : e), me = (e, t, n) => {
186
208
  let [r, ...i] = t;
187
209
  if (r == null) return e;
188
210
  let a = [...n, r], o = e.find((e) => e.name === r);
189
211
  return o ? i.length ? e.map((e) => e === o ? {
190
212
  ...e,
191
- children: ye(e.children ?? [], i, a)
213
+ children: me(e.children ?? [], i, a)
192
214
  } : e) : e : [...e, {
193
215
  path: a,
194
216
  name: r,
195
- children: i.length ? ye([], i, a) : void 0
217
+ children: i.length ? me([], i, a) : void 0
196
218
  }];
197
- }, be = (e, t) => t.reduce((e, t) => t.length ? ye(e, t, []) : e, e), xe = (e) => e.flatMap((e) => [e.path.join("/"), ...e.children ? xe(e.children) : []]), $ = (e) => e.join("/"), Se = (e) => e.split("/").filter(Boolean), Ce = (e, t) => Se(e).at(-1) ?? t, we = (e) => e.map((e) => {
198
- let t = $(e.path);
219
+ }, he = (e, t) => t.reduce((e, t) => t.length ? me(e, t, []) : e, e), J = (e) => e.flatMap((e) => [e.path.join("/"), ...e.children ? J(e.children) : []]), Y = (e) => e.join("/"), ge = (e) => e.split("/").filter(Boolean), _e = (e, t) => ge(e).at(-1) ?? t, ve = (e) => e.map((e) => {
220
+ let t = Y(e.path);
199
221
  return {
200
222
  path: t,
201
223
  name: e.name,
202
224
  folderId: t,
203
- nodeType: p.FOLDER,
204
- items: e.children ? we(e.children) : void 0
225
+ nodeType: d.FOLDER,
226
+ items: e.children ? ve(e.children) : void 0
205
227
  };
206
- }), Te = /[/\\:;,={}&"]/, Ee = (e, t, n, r) => {
228
+ }), ye = /[/\\:;,={}&"]/, be = (e, t, n, r) => {
207
229
  let i = e.trim();
208
- return i ? i.includes("..") || Te.test(i) ? n.invalid : t.some((e) => e.toLowerCase() === i.toLowerCase()) ? n.duplicate : r?.toLowerCase() === i.toLowerCase() ? n.sameAsParent ?? n.duplicate : null : n.empty;
209
- }, De = (e, t) => {
230
+ return i ? i.includes("..") || ye.test(i) ? n.invalid : t.some((e) => e.toLowerCase() === i.toLowerCase()) ? n.duplicate : r?.toLowerCase() === i.toLowerCase() ? n.sameAsParent ?? n.duplicate : null : n.empty;
231
+ }, xe = (e, t) => {
210
232
  let n = new Set(t.map((e) => e.toLowerCase()));
211
233
  if (!n.has(e.toLowerCase())) return e;
212
234
  let r = 2;
213
235
  for (; n.has(`${e} ${r}`.toLowerCase());) r += 1;
214
236
  return `${e} ${r}`;
215
- }, Oe = (e, t) => {
237
+ }, Se = (e, t) => {
216
238
  if (t.length === 0) return e.map((e) => e.name);
217
- let n = $(t), r = (e) => {
239
+ let n = Y(t), r = (e) => {
218
240
  for (let t of e) {
219
- if ($(t.path) === n) return t;
241
+ if (Y(t.path) === n) return t;
220
242
  let e = t.children ? r(t.children) : void 0;
221
243
  if (e) return e;
222
244
  }
223
245
  };
224
246
  return (r(e)?.children ?? []).map((e) => e.name);
225
- }, ke = {
226
- sheet: "_sheet_1jbwn_3",
227
- inline: "_inline_1jbwn_7",
228
- selectField: "_selectField_1jbwn_21",
229
- selectFieldOpen: "_selectFieldOpen_1jbwn_33"
230
- }, Ae = 20, je = 200, Me = 8, Ne = (e) => {
231
- let t = e.trim();
232
- if (t.length === 0 || t.length > je) return !1;
233
- try {
234
- return new RegExp(t) instanceof RegExp;
235
- } catch {
236
- return !1;
237
- }
238
- }, Pe = ({ sourceOptions: e, onSave: o, onCancel: c, disabled: l = !1, maxTargets: u = Ae, labels: d = {}, styles: f = {} }) => {
239
- let p = ce(), m = {
240
- ...se({
241
- "--pare-mobile-bg": f.colors?.mobileBackground,
242
- "--pare-bg": f.colors?.background,
243
- "--pare-select-border": f.colors?.selectBorder,
244
- "--pare-select-border-hover": f.colors?.selectBorderHover,
245
- "--pare-select-border-open": f.colors?.selectBorderOpen,
246
- "--pare-select-border-focus": f.colors?.selectBorderFocus
247
- }),
248
- ...f.cssVars
249
- }, { sourceLabel: h = "Source", sourcePlaceholder: g = "Select...", functionLabel: _ = "Function", equalOptionLabel: v = "Equal", containOptionLabel: y = "Contain", regexOptionLabel: x = "Regex", targetsLabel: C = "Targets", targetsPlaceholder: w = "Add a target", targetsHintLabel: te = "Press Enter or comma to add a target.", patternLabel: T = "Pattern", patternPlaceholder: D = "Enter a regular expression", invalidRegexError: O = "Enter a valid regular expression.", requiredFieldError: k = "This field is required.", targetsRequiredError: A = "Add at least one target.", saveLabel: ne = "Save", cancelLabel: j = "Cancel", dialogAriaLabel: re = "Add access rule" } = d, N = n(), P = n(), ie = n(), F = n(), I = i(null);
250
- t(() => {
251
- p || I.current?.focus();
252
- }, [p]);
253
- let [L, oe] = a(), [H, U] = a(), [W, ue] = a([]), [de, fe] = a(""), [K, q] = a(!1), [J, pe] = a(""), [Y, X] = a(!1), [Z, me] = a(!1), Q = z(ke.selectField, K && ke.selectFieldOpen), he = z(ke.selectField, Y && ke.selectFieldOpen), ge = r(() => e.map((e) => ({
254
- value: e,
255
- label: e,
256
- labelNode: J.trim() ? /* @__PURE__ */ B(S, {
257
- text: e,
258
- query: J,
259
- maxLines: 1
260
- }) : void 0
261
- })), [e, J]), _e = r(() => [
262
- {
263
- value: G.Equal,
264
- label: v
265
- },
266
- {
267
- value: G.Contain,
268
- label: y
269
- },
270
- {
271
- value: G.Regex,
272
- label: x
273
- }
274
- ], [
275
- v,
276
- y,
277
- x
278
- ]), ve = H === G.Regex, ye = Ne(de), be = L != null && H != null && (ve ? ye : W.length > 0), xe = (e) => {
279
- oe(Array.isArray(e) ? e[0] : e), q(!1);
280
- }, $ = (e) => {
281
- let t = Array.isArray(e) ? e[0] : e;
282
- H === G.Regex != (t === G.Regex) && (ue([]), fe("")), U(t), X(!1);
283
- }, Se = (e) => {
284
- let t = [];
285
- for (let n of e) {
286
- let e = n.trim();
287
- if (!(e.length === 0 || t.includes(e)) && (t.push(e), t.length >= u)) break;
288
- }
289
- ue(t);
290
- }, Ce = () => {
291
- !be || L == null || H == null ? me(!0) : o({
292
- source: L,
293
- function: H,
294
- targets: ve ? [de.trim()] : W
295
- });
296
- }, we = (de.length > 0 || Z) && !ye, Te = (e) => {
297
- e.key === "Escape" && (e.stopPropagation(), c());
298
- }, Ee = /* @__PURE__ */ V(le, { children: [
299
- /* @__PURE__ */ B(M, {
300
- id: P,
301
- labelProps: { label: h },
302
- options: ge,
303
- value: L,
304
- onChange: xe,
305
- placeholder: g,
306
- searchable: e.length > Me,
307
- searchPlaceholder: g,
308
- onSearchQueryChange: pe,
309
- disabled: l,
310
- open: K,
311
- onOpenChange: q,
312
- fieldClassName: Q,
313
- invalid: Z && L == null,
314
- error: Z && L == null ? k : void 0
315
- }),
316
- /* @__PURE__ */ B(M, {
317
- labelProps: { label: _ },
318
- id: ie,
319
- options: _e,
320
- value: H,
321
- onChange: $,
322
- placeholder: _,
323
- disabled: l,
324
- open: Y,
325
- onOpenChange: X,
326
- fieldClassName: he,
327
- invalid: Z && H == null,
328
- error: Z && H == null ? k : void 0
329
- }),
330
- ve ? /* @__PURE__ */ B(ee, {
331
- id: N,
332
- labelProps: { label: T },
333
- placeholder: D,
334
- value: de,
335
- onChange: (e) => fe(e ?? ""),
336
- error: we ? O : void 0,
337
- disabled: l
338
- }) : /* @__PURE__ */ B(ae, {
339
- id: F,
340
- labelProps: { label: C },
341
- placeholder: w,
342
- caption: Z && W.length === 0 ? void 0 : te,
343
- error: Z && W.length === 0 ? A : void 0,
344
- invalid: Z && W.length === 0,
345
- value: W,
346
- onChange: Se,
347
- disabled: l,
348
- tagClassName: R
349
- }),
350
- /* @__PURE__ */ V("div", {
351
- className: "mt-auto flex justify-end gap-2 desktop:mt-2",
352
- children: [/* @__PURE__ */ B(b, {
353
- label: j,
354
- onClick: c,
355
- disabled: l
356
- }), /* @__PURE__ */ B(E, {
357
- label: ne,
358
- onClick: Ce,
359
- disabled: l
360
- })]
361
- })
362
- ] });
363
- return p ? /* @__PURE__ */ B(s, {
364
- open: !0,
365
- onClose: c,
366
- ariaLabel: re,
367
- style: m,
368
- className: ke.sheet,
369
- bodyClassName: "flex flex-col gap-3 p-4",
370
- children: Ee
371
- }) : /* @__PURE__ */ B("div", {
372
- ref: I,
373
- role: "group",
374
- "aria-label": re,
375
- tabIndex: -1,
376
- onKeyDown: Te,
377
- style: m,
378
- className: z("flex flex-none flex-col gap-3 rounded-lg p-3", ke.inline),
379
- children: Ee
380
- });
381
- }, Fe = {
382
- ruleRow: "_ruleRow_nx0en_1",
383
- heading: "_heading_nx0en_5",
384
- hint: "_hint_nx0en_9",
385
- loading: "_loading_nx0en_13",
386
- ruleText: "_ruleText_nx0en_17"
387
- }, Ie = 20, Le = (e, t) => e === G.Equal ? t.equal : e === G.Contain ? t.contain : t.regex, Re = ({ rules: e, onRulesChange: r, sourceOptions: o, folderName: s, disabled: l = !1, isLoading: u = !1, hasLoadError: p = !1, maxRules: m = Ie, maxTargetsPerRule: h, labels: g = {}, headingClassName: _ = "dial-body-semi-text", hintClassName: v = "dial-small-text", loadingClassName: y = "dial-small-text", ruleTextClassName: S = "dial-small-text", ruleSourceClassName: ee = "dial-small-semi-text", styles: C = {} }) => {
388
- let T = {
389
- ...se({
390
- "--par-rule-bg": C.colors?.ruleBackground,
391
- "--par-heading-text": C.colors?.headingText,
392
- "--par-hint-text": C.colors?.hintText,
393
- "--par-loading-text": C.colors?.loadingText,
394
- "--par-rule-text": C.colors?.ruleText
395
- }),
396
- ...C.cssVars
397
- }, { heading: E = "Allow access if all match", folderScopeHint: A = "These rules apply to \"{folder}\". Selecting another folder loads that folder's own rules instead.", noFolderScopeHint: ne = "Access rules apply to the destination folder — pick a folder above to set its rules.", rulesWithoutFolderWarning: j = "These rules have no destination yet. Select a folder above to apply them.", maxRulesReachedLabel: M = "Rule limit reached ({max}). Remove a rule to add another.", addRuleLabel: re = "Add rule", clearAllLabel: N = "Clear all", orSeparatorLabel: P = "Or", removeRuleAriaLabelTemplate: F = "Remove rule for {source}: {targets}", equalFunctionLabel: ae = "Equal", containFunctionLabel: I = "Contain", regexFunctionLabel: L = "Regex", loadingLabel: oe = "Loading existing rules…", loadErrorLabel: R = "Couldn't load existing rules for this folder. You can still add rules manually.", ruleAddedAnnouncement: ce = "Rule added.", ruleRemovedAnnouncement: le = "Rule removed.", rulesClearedAnnouncement: H = "All rules cleared.", rulesLoadedAnnouncement: U = "Existing rules loaded for the selected folder.", editorLabels: de } = g, fe = n(), [G, K] = a(!1), [q, J] = a(""), pe = i(null), Y = i(u);
398
- t(() => {
399
- Y.current && !u && e.length > 0 && J(U), Y.current = u;
400
- }, [
401
- u,
402
- e,
403
- U
404
- ]);
405
- let X = () => {
406
- pe.current = document.activeElement, K(!0);
407
- }, Z = () => {
408
- K(!1), pe.current?.focus?.();
409
- }, me = (t) => {
410
- r([...e, t]), J(ce), Z();
411
- }, Q = (t) => {
412
- r(e.filter((e, n) => n !== t)), J(le);
413
- }, he = () => {
414
- r([]), J(H);
415
- }, ge = {
416
- equal: ae,
417
- contain: I,
418
- regex: L
419
- }, _e = e.length >= m, ve = l || _e, ye = s != null && s !== "";
420
- return /* @__PURE__ */ V("div", {
421
- role: "group",
422
- "aria-labelledby": fe,
423
- style: T,
424
- className: z(l && "pointer-events-none opacity-60"),
425
- children: [
426
- /* @__PURE__ */ B(w, {
427
- visuallyHidden: !0,
428
- as: te.Span,
429
- children: q
430
- }),
431
- /* @__PURE__ */ V("div", {
432
- className: "mb-1 flex items-center justify-between gap-2",
433
- children: [/* @__PURE__ */ B("div", {
434
- id: fe,
435
- className: z(_, Fe.heading),
436
- children: E
437
- }), e.length > 0 && /* @__PURE__ */ B(b, {
438
- variant: c.Primary,
439
- label: N,
440
- onClick: he,
441
- disabled: l
442
- })]
443
- }),
444
- /* @__PURE__ */ B("p", {
445
- className: z("mb-2", v, Fe.hint),
446
- children: ye ? A.replace("{folder}", s) : ne
447
- }),
448
- e.length > 0 && !ye && /* @__PURE__ */ B("div", {
449
- className: "mb-2",
450
- children: /* @__PURE__ */ B(D, {
451
- type: O.SectionMessage,
452
- variant: k.Warning,
453
- message: j
454
- })
455
- }),
456
- u && /* @__PURE__ */ V("div", {
457
- className: z("mb-2 flex items-center gap-2", y, Fe.loading),
458
- children: [/* @__PURE__ */ B(ie, {
459
- size: 16,
460
- ariaLabel: oe
461
- }), /* @__PURE__ */ B("span", { children: oe })]
462
- }),
463
- p && /* @__PURE__ */ B("div", {
464
- className: "mb-2",
465
- children: /* @__PURE__ */ B(D, {
466
- type: O.SectionMessage,
467
- variant: k.Warning,
468
- message: R
469
- })
470
- }),
471
- e.length > 0 && /* @__PURE__ */ B("ul", {
472
- className: "mb-3 flex flex-col gap-2",
473
- children: e.map((e, t) => {
474
- let n = e.targets.join(` ${P} `), r = F.replace("{source}", e.source).replace("{targets}", n);
475
- return /* @__PURE__ */ V("li", {
476
- className: z("flex items-center justify-between gap-2 rounded-lg px-3 py-2", Fe.ruleRow),
477
- children: [/* @__PURE__ */ V("span", {
478
- className: z("truncate", S, Fe.ruleText),
479
- children: [
480
- /* @__PURE__ */ B("span", {
481
- className: ee,
482
- children: e.source
483
- }),
484
- " ",
485
- Le(e.function, ge),
486
- ": ",
487
- n
488
- ]
489
- }), /* @__PURE__ */ B(x, {
490
- icon: /* @__PURE__ */ B(ue, {
491
- size: d.SM,
492
- "aria-hidden": !0,
493
- stroke: f
494
- }),
495
- "aria-label": r,
496
- onClick: () => Q(t),
497
- disabled: l
498
- })]
499
- }, t);
500
- })
501
- }),
502
- G && /* @__PURE__ */ B(Pe, {
503
- sourceOptions: o,
504
- onSave: me,
505
- onCancel: Z,
506
- disabled: l,
507
- maxTargets: h,
508
- labels: de,
509
- styles: C.editor
510
- }),
511
- /* @__PURE__ */ B("div", {
512
- className: "flex flex-wrap items-center gap-2",
513
- children: /* @__PURE__ */ B(b, {
514
- label: re,
515
- iconBefore: /* @__PURE__ */ B(W, {
516
- size: d.SM,
517
- "aria-hidden": !0,
518
- stroke: f
519
- }),
520
- onClick: X,
521
- disabled: ve
522
- })
523
- }),
524
- _e && /* @__PURE__ */ B("p", {
525
- className: z("mt-2", v, Fe.hint),
526
- children: M.replace("{max}", String(m))
527
- })
528
- ]
529
- });
530
- }, ze = /* @__PURE__ */ function(e) {
247
+ }, Ce = /* @__PURE__ */ function(e) {
531
248
  return e.NotPublished = "not-published", e.InReview = "in-review", e.Published = "published", e.Unknown = "unknown", e;
532
- }({}), Be = {
249
+ }({}), X = {
533
250
  skeletonColor: "var(--pp-vh-skeleton, var(--bg-control-disable-primary, #dce0e8))",
534
251
  heading: "_heading_s0cgn_2",
535
252
  version: "_version_s0cgn_6",
536
253
  date: "_date_s0cgn_10",
537
254
  meta: "_meta_s0cgn_15",
538
255
  row: "_row_s0cgn_19"
539
- }, Ve = {
256
+ }, we = {
540
257
  heading: "Versions history",
541
258
  inReviewLabel: "In review",
542
259
  publishedLabel: "Published",
@@ -545,93 +262,93 @@ var G = /* @__PURE__ */ function(e) {
545
262
  emptyLabel: "No saved versions yet.",
546
263
  errorLabel: "Could not load publication statuses.",
547
264
  retryLabel: "Retry"
548
- }, He = (e, t) => {
265
+ }, Te = (e, t) => {
549
266
  switch (e.status) {
550
- case ze.InReview: return t.inReviewLabel;
551
- case ze.Unknown: return t.unknownLabel;
552
- case ze.Published: return t.publishedLabel;
267
+ case Ce.InReview: return t.inReviewLabel;
268
+ case Ce.Unknown: return t.unknownLabel;
269
+ case Ce.Published: return t.publishedLabel;
553
270
  default: return;
554
271
  }
555
- }, Ue = ({ rows: e, isLoading: r = !1, hasError: i = !1, onRetry: s, labels: c = {}, headingClassName: l = "dial-body-semi-text", versionClassName: u = "dial-small-semi-text", dateClassName: d = "dial-small-text", metaClassName: f = "dial-tiny-text", styles: p = {} }) => {
556
- let m = n(), [v, b] = a(!1);
557
- t(() => b(!0), []);
558
- let x = {
559
- ...Ve,
272
+ }, Ee = ({ rows: e, isLoading: r = !1, hasError: i = !1, onRetry: s, labels: c = {}, headingClassName: l = "dial-body-semi-text", versionClassName: u = "dial-small-semi-text", dateClassName: d = "dial-small-text", metaClassName: f = "dial-tiny-text", styles: g = {} }) => {
273
+ let v = n(), [y, S] = a(!1);
274
+ t(() => S(!0), []);
275
+ let w = {
276
+ ...we,
560
277
  ...c
561
- }, { colors: S } = p, ee = {
562
- ...se({
563
- "--pp-vh-heading-text": S?.headingText,
564
- "--pp-vh-version-text": S?.versionText,
565
- "--pp-vh-date-text": S?.dateText,
566
- "--pp-vh-skeleton": S?.skeleton,
567
- "--pp-vh-meta-text": S?.metaText,
568
- "--pp-vh-row-border": S?.rowBorder
278
+ }, { colors: T } = g, E = {
279
+ ...I({
280
+ "--pp-vh-heading-text": T?.headingText,
281
+ "--pp-vh-version-text": T?.versionText,
282
+ "--pp-vh-date-text": T?.dateText,
283
+ "--pp-vh-skeleton": T?.skeleton,
284
+ "--pp-vh-meta-text": T?.metaText,
285
+ "--pp-vh-row-border": T?.rowBorder
569
286
  }),
570
- ...p.cssVars
287
+ ...g.cssVars
571
288
  };
572
- return /* @__PURE__ */ V("section", {
573
- "aria-labelledby": m,
289
+ return /* @__PURE__ */ B("section", {
290
+ "aria-labelledby": v,
574
291
  className: "flex flex-col gap-2",
575
- style: ee,
292
+ style: E,
576
293
  children: [
577
- /* @__PURE__ */ B("h2", {
578
- id: m,
579
- className: z(l, Be.heading),
580
- children: x.heading
294
+ /* @__PURE__ */ z("h2", {
295
+ id: v,
296
+ className: L(l, X.heading),
297
+ children: w.heading
581
298
  }),
582
- /* @__PURE__ */ B(w, {
299
+ /* @__PURE__ */ z(x, {
583
300
  visuallyHidden: !0,
584
- politeness: T.Polite,
585
- children: v && r && !i ? x.loadingLabel : ""
301
+ politeness: C.Polite,
302
+ children: y && r && !i ? w.loadingLabel : ""
586
303
  }),
587
- /* @__PURE__ */ B(w, {
588
- politeness: T.Assertive,
589
- children: i && /* @__PURE__ */ V("div", {
304
+ /* @__PURE__ */ z(x, {
305
+ politeness: C.Assertive,
306
+ children: i && /* @__PURE__ */ B("div", {
590
307
  className: "flex flex-wrap items-center gap-2",
591
- children: [/* @__PURE__ */ B(_, { text: x.errorLabel }), s && /* @__PURE__ */ B(C, {
592
- label: x.retryLabel,
593
- size: h.Small,
308
+ children: [/* @__PURE__ */ z(h, { text: w.errorLabel }), s && /* @__PURE__ */ z(b, {
309
+ label: w.retryLabel,
310
+ size: p.Small,
594
311
  onClick: s
595
312
  })]
596
313
  })
597
314
  }),
598
- e.length === 0 ? /* @__PURE__ */ B("p", {
599
- className: z(f, Be.meta),
600
- children: x.emptyLabel
601
- }) : /* @__PURE__ */ B("ul", { children: e.map((e) => {
602
- let t = He(e, x), n = e.status == null && r && !i;
603
- return /* @__PURE__ */ V("li", {
604
- className: z("flex flex-col gap-1 py-2", Be.row),
605
- children: [/* @__PURE__ */ V("div", {
315
+ e.length === 0 ? /* @__PURE__ */ z("p", {
316
+ className: L(f, X.meta),
317
+ children: w.emptyLabel
318
+ }) : /* @__PURE__ */ z("ul", { children: e.map((e) => {
319
+ let t = Te(e, w), n = e.status == null && r && !i;
320
+ return /* @__PURE__ */ B("li", {
321
+ className: L("flex flex-col gap-1 py-2", X.row),
322
+ children: [/* @__PURE__ */ B("div", {
606
323
  className: "flex min-h-6 min-w-0 items-center gap-2",
607
324
  children: [
608
- /* @__PURE__ */ B(g, {
325
+ /* @__PURE__ */ z(m, {
609
326
  text: e.version,
610
- className: z("flex-initial!", u, Be.version)
327
+ className: L("flex-initial!", u, X.version)
611
328
  }),
612
- t && /* @__PURE__ */ B(o, { label: t }),
613
- n && /* @__PURE__ */ B("span", {
329
+ t && /* @__PURE__ */ z(o, { label: t }),
330
+ n && /* @__PURE__ */ z("span", {
614
331
  "aria-hidden": !0,
615
332
  className: "shrink-0",
616
- children: /* @__PURE__ */ B(N, {
617
- variant: P.Text,
333
+ children: /* @__PURE__ */ z(A, {
334
+ variant: j.Text,
618
335
  width: "84px",
619
336
  height: "24px",
620
- color: Be.skeletonColor
337
+ color: X.skeletonColor
621
338
  })
622
339
  }),
623
- e.modifiedAt && /* @__PURE__ */ B("span", {
624
- className: z("ms-auto shrink-0", d, Be.date),
340
+ e.modifiedAt && /* @__PURE__ */ z("span", {
341
+ className: L("ms-auto shrink-0", d, X.date),
625
342
  children: e.modifiedAt
626
343
  })
627
344
  ]
628
- }), (e.folder || e.author) && /* @__PURE__ */ V("div", {
345
+ }), (e.folder || e.author) && /* @__PURE__ */ B("div", {
629
346
  className: "flex min-w-0 items-center justify-between gap-2",
630
- children: [e.folder && /* @__PURE__ */ B(y, {
347
+ children: [e.folder && /* @__PURE__ */ z(_, {
631
348
  name: e.folder,
632
- nameClassName: z(f, Be.meta)
633
- }), e.author && /* @__PURE__ */ B("span", {
634
- className: z("ms-auto shrink-0", f, Be.meta),
349
+ nameClassName: L(f, X.meta)
350
+ }), e.author && /* @__PURE__ */ z("span", {
351
+ className: L("ms-auto shrink-0", f, X.meta),
635
352
  children: e.author
636
353
  })]
637
354
  })]
@@ -639,87 +356,120 @@ var G = /* @__PURE__ */ function(e) {
639
356
  }) })
640
357
  ]
641
358
  });
642
- }, We = {
359
+ }, Z = {
643
360
  panel: "dial-publish-panel-panel",
644
361
  dependencies: "dial-publish-panel-dependencies",
645
362
  dependenciesList: "dial-publish-panel-dependencies-list",
646
363
  dependenciesItem: "dial-publish-panel-dependencies-item"
647
- }, Ge = {
648
- heading: "_heading_k0m34_1",
649
- name: "_name_k0m34_5",
650
- meta: "_meta_k0m34_9"
651
- }, Ke = {
652
- [q.Application]: "Application",
653
- [q.Toolset]: "Toolset",
654
- [q.Prompt]: "Prompt",
655
- [q.Skill]: "Skill",
656
- [q.File]: "File"
657
- }, qe = 32, Je = 24, Ye = (e) => /* @__PURE__ */ B("span", {
658
- "aria-hidden": "true",
659
- className: "shrink-0",
660
- children: e.type === q.File ? /* @__PURE__ */ B("span", {
661
- className: "flex items-center justify-center",
662
- style: {
663
- width: qe,
664
- height: qe
665
- },
666
- children: /* @__PURE__ */ B(v, {
667
- decorative: !0,
668
- size: Je,
669
- name: e.name,
670
- type: e.isFolder ? m.Folder : m.File
364
+ }, De = "Private dependencies", Q = {
365
+ heading: "_heading_18b5e_1",
366
+ name: "_name_18b5e_5",
367
+ meta: "_meta_18b5e_9",
368
+ caption: "_caption_18b5e_13",
369
+ type: "_type_18b5e_17",
370
+ row: "_row_18b5e_21"
371
+ }, Oe = {
372
+ [H.Application]: "Application",
373
+ [H.Toolset]: "Toolset",
374
+ [H.Prompt]: "Prompt",
375
+ [H.Skill]: "Skill",
376
+ [H.File]: "File"
377
+ }, ke = 32, Ae = 24, je = 40, Me = 32, Ne = (e, t) => {
378
+ let n = t ? je : ke;
379
+ return /* @__PURE__ */ z("span", {
380
+ "aria-hidden": "true",
381
+ className: "shrink-0",
382
+ children: e.type === H.File ? /* @__PURE__ */ z("span", {
383
+ className: "flex items-center justify-center",
384
+ style: {
385
+ width: n,
386
+ height: n
387
+ },
388
+ children: /* @__PURE__ */ z(g, {
389
+ decorative: !0,
390
+ size: t ? Me : Ae,
391
+ name: e.name,
392
+ type: e.isFolder ? f.Folder : f.File
393
+ })
394
+ }) : /* @__PURE__ */ z(te, {
395
+ size: n,
396
+ src: e.iconUrl,
397
+ initialsName: e.name,
398
+ styles: { badgeClassName: t ? "rounded-xl" : "rounded-lg" }
671
399
  })
672
- }) : /* @__PURE__ */ B(L, {
673
- size: qe,
674
- src: e.iconUrl,
675
- initialsName: e.name,
676
- styles: { badgeClassName: "rounded-lg" }
677
- })
678
- }), Xe = "Private dependencies", Ze = "This item depends on personal private resources (listed below). After publishing, other users may not be able to use it fully, or may run into problems.", Qe = (e) => `${e} ${e === 1 ? "dependency is" : "dependencies are"} not public yet`, $e = ({ dependencies: e, labels: t = {}, headingClassName: r = "dial-body-semi-text", nameClassName: i = "dial-small-semi-text", metaClassName: a = "dial-small-text", styles: o = {} }) => {
679
- let s = n(), { title: c = Xe, description: l = Ze, typeLabels: u = {}, getAnnouncement: d = Qe } = t, { colors: f } = o, p = {
680
- ...se({
681
- "--pp-dependencies-heading-text": f?.headingText,
682
- "--pp-dependencies-name-text": f?.nameText,
683
- "--pp-dependencies-meta-text": f?.metaText
400
+ });
401
+ }, Pe = "This item depends on personal private resources (listed below). After publishing, other users may not be able to use it fully, or may run into problems.", Fe = (e) => `${e} ${e === 1 ? "dependency is" : "dependencies are"} not public yet`, Ie = ({ dependencies: e, labels: t = {}, headingClassName: r = "dial-body-semi-text", nameClassName: i, metaClassName: a = "dial-small-text", captionClassName: o = "dial-tiny-text", typeClassName: s = "dial-tiny-lead-semi-text", styles: c = {} }) => {
402
+ let l = n(), { title: u = De, description: d = Pe, appearance: f = U.Warning, typeLabels: p = {}, getAnnouncement: m = Fe } = t, h = f === U.Published, g = i ?? (h ? "dial-body-semi-text" : "dial-small-semi-text"), { colors: _ } = c, v = {
403
+ ...I({
404
+ "--pp-dependencies-heading-text": _?.headingText,
405
+ "--pp-dependencies-name-text": _?.nameText,
406
+ "--pp-dependencies-meta-text": _?.metaText,
407
+ "--pp-dependencies-caption-text": _?.captionText,
408
+ "--pp-dependencies-type-text": _?.typeText,
409
+ "--pp-dependencies-divider": _?.divider
684
410
  }),
685
- ...o.cssVars
686
- }, m = e.length;
687
- return /* @__PURE__ */ V(le, { children: [/* @__PURE__ */ B(w, {
411
+ ...c.cssVars
412
+ }, y = e.length;
413
+ return /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(x, {
688
414
  visuallyHidden: !0,
689
- as: te.Span,
690
- children: m > 0 ? d(m) : ""
691
- }), m > 0 && /* @__PURE__ */ V("section", {
692
- "aria-labelledby": s,
693
- className: z("flex flex-col gap-3", We.dependencies),
694
- style: p,
415
+ as: S.Span,
416
+ children: y > 0 ? m(y) : ""
417
+ }), y > 0 && /* @__PURE__ */ B("section", {
418
+ "aria-labelledby": l,
419
+ className: L("flex flex-col", h ? "gap-2" : "gap-3", Z.dependencies),
420
+ style: v,
695
421
  children: [
696
- /* @__PURE__ */ B("h2", {
697
- id: s,
698
- className: z(r, Ge.heading),
699
- children: c
422
+ /* @__PURE__ */ z("h2", {
423
+ id: l,
424
+ className: L(r, Q.heading),
425
+ children: u
700
426
  }),
701
- /* @__PURE__ */ B(D, {
702
- type: O.SectionMessage,
703
- variant: k.Warning,
704
- message: l,
427
+ h ? /* @__PURE__ */ z("p", {
428
+ className: L(o, Q.caption),
429
+ children: d
430
+ }) : /* @__PURE__ */ z(T, {
431
+ type: E.SectionMessage,
432
+ variant: D.Warning,
433
+ message: d,
705
434
  role: "note"
706
435
  }),
707
- /* @__PURE__ */ B("ul", {
708
- className: We.dependenciesList,
709
- children: e.map((e) => {
710
- let t = u[e.type] ?? Ke[e.type];
711
- return /* @__PURE__ */ V("li", {
712
- className: z("flex items-center gap-3 py-2", We.dependenciesItem),
713
- children: [Ye(e), /* @__PURE__ */ V("div", {
436
+ /* @__PURE__ */ z("ul", {
437
+ className: Z.dependenciesList,
438
+ children: e.map(h ? (e) => {
439
+ let t = p[e.type] ?? Oe[e.type];
440
+ return /* @__PURE__ */ B("li", {
441
+ className: L("flex items-center gap-3 py-3", Q.row, Z.dependenciesItem),
442
+ children: [Ne(e, !0), /* @__PURE__ */ B("div", {
714
443
  className: "flex min-w-0 flex-col",
715
- children: [/* @__PURE__ */ V("span", {
716
- className: z("truncate", i, Ge.name),
717
- children: [e.name, e.version != null && /* @__PURE__ */ B("span", {
718
- className: z("ms-2", a, Ge.meta),
719
- children: e.version
444
+ children: [/* @__PURE__ */ B("span", {
445
+ className: L("truncate", s, Q.type),
446
+ children: [t, e.location && /* @__PURE__ */ z("span", {
447
+ className: L("ms-1 normal-case", a, Q.meta),
448
+ children: `· ${e.location}`
720
449
  })]
721
450
  }), /* @__PURE__ */ B("span", {
722
- className: z("truncate", a, Ge.meta),
451
+ className: L("truncate", g, Q.name),
452
+ children: [e.name, e.version != null && /* @__PURE__ */ z("span", {
453
+ className: L("ms-2", a, Q.meta),
454
+ children: e.version
455
+ })]
456
+ })]
457
+ })]
458
+ }, e.id);
459
+ } : (e) => {
460
+ let t = p[e.type] ?? Oe[e.type];
461
+ return /* @__PURE__ */ B("li", {
462
+ className: L("flex items-center gap-3 py-2", Z.dependenciesItem),
463
+ children: [Ne(e, !1), /* @__PURE__ */ B("div", {
464
+ className: "flex min-w-0 flex-col",
465
+ children: [/* @__PURE__ */ B("span", {
466
+ className: L("truncate", g, Q.name),
467
+ children: [e.name, e.version != null && /* @__PURE__ */ z("span", {
468
+ className: L("ms-2", a, Q.meta),
469
+ children: e.version
470
+ })]
471
+ }), /* @__PURE__ */ z("span", {
472
+ className: L("truncate", a, Q.meta),
723
473
  children: e.location ? `${t} · ${e.location}` : t
724
474
  })]
725
475
  })]
@@ -728,15 +478,15 @@ var G = /* @__PURE__ */ function(e) {
728
478
  })
729
479
  ]
730
480
  })] });
731
- }, et = {
481
+ }, Le = {
732
482
  currentBadge: "_currentBadge_d0adf_1",
733
483
  sharedCredentialsBadge: "_sharedCredentialsBadge_d0adf_7",
734
484
  version: "_version_d0adf_13",
735
485
  date: "_date_d0adf_17",
736
486
  emptyState: "_emptyState_d0adf_21",
737
487
  stripedRow: "_stripedRow_d0adf_25"
738
- }, tt = ({ entries: e, currentVersion: t, isLoading: n = !1, hasError: r = !1, versionPrefix: i = "Version", currentBadgeLabel: a = "Current", sharedCredentialsLabel: o = "Shared credentials", emptyStateLabel: s = "Not published to this folder yet — this will be the first version here.", loadingLabel: c = "Loading history…", errorLabel: l = "Failed to load publish history.", versionClassName: u = "dial-small-text", dateClassName: d = "dial-small-text", emptyStateClassName: f = "dial-small-text", colors: p }) => {
739
- let m = se({
488
+ }, Re = ({ entries: e, currentVersion: t, isLoading: n = !1, hasError: r = !1, versionPrefix: i = "Version", currentBadgeLabel: a = "Current", sharedCredentialsLabel: o = "Shared credentials", emptyStateLabel: s = "Not published to this folder yet — this will be the first version here.", loadingLabel: c = "Loading history…", errorLabel: l = "Failed to load publish history.", versionClassName: u = "dial-small-text", dateClassName: d = "dial-small-text", emptyStateClassName: f = "dial-small-text", colors: p }) => {
489
+ let m = I({
740
490
  "--phl-badge-border": p?.currentBadgeBorder,
741
491
  "--phl-badge-bg": p?.currentBadgeBackground,
742
492
  "--phl-badge-text": p?.currentBadgeText,
@@ -747,535 +497,352 @@ var G = /* @__PURE__ */ function(e) {
747
497
  "--phl-date-text": p?.dateText,
748
498
  "--phl-empty-text": p?.emptyStateText,
749
499
  "--phl-striped-bg": p?.stripedBackground
750
- }), h = z(f, et.emptyState);
500
+ }), h = L(f, Le.emptyState);
751
501
  if (n || r || e.length === 0) {
752
502
  let e = s;
753
- return n ? e = c : r && (e = l), /* @__PURE__ */ B(w, {
754
- as: te.P,
503
+ return n ? e = c : r && (e = l), /* @__PURE__ */ z(x, {
504
+ as: S.P,
755
505
  style: m,
756
506
  className: h,
757
507
  children: e
758
508
  });
759
509
  }
760
- return /* @__PURE__ */ B("ul", {
510
+ return /* @__PURE__ */ z("ul", {
761
511
  style: m,
762
- children: e.map((e, n) => /* @__PURE__ */ V("li", {
763
- className: z("flex items-center justify-between gap-2 rounded-lg px-3 py-[11px]", n % 2 == 0 && et.stripedRow),
764
- children: [/* @__PURE__ */ V("span", {
512
+ children: e.map((e, n) => /* @__PURE__ */ B("li", {
513
+ className: L("flex items-center justify-between gap-2 rounded-lg px-3 py-[11px]", n % 2 == 0 && Le.stripedRow),
514
+ children: [/* @__PURE__ */ B("span", {
765
515
  className: "flex min-w-0 items-center gap-2",
766
516
  style: m,
767
517
  children: [
768
- /* @__PURE__ */ V("span", {
769
- className: z(u, et.version),
518
+ /* @__PURE__ */ B("span", {
519
+ className: L(u, Le.version),
770
520
  children: [
771
521
  i,
772
522
  " ",
773
523
  e.version
774
524
  ]
775
525
  }),
776
- e.version === t && /* @__PURE__ */ B(F, {
526
+ e.version === t && /* @__PURE__ */ z(N, {
777
527
  label: a,
778
- className: z("shrink-0 whitespace-nowrap", et.currentBadge)
528
+ className: L("shrink-0 whitespace-nowrap", Le.currentBadge)
779
529
  }),
780
- e.publishCredentials === !0 && /* @__PURE__ */ B(F, {
530
+ e.publishCredentials === !0 && /* @__PURE__ */ z(N, {
781
531
  label: o,
782
- className: z("shrink-0 whitespace-nowrap", et.sharedCredentialsBadge)
532
+ className: L("shrink-0 whitespace-nowrap", Le.sharedCredentialsBadge)
783
533
  })
784
534
  ]
785
- }), /* @__PURE__ */ B("span", {
786
- className: z(d, et.date),
787
- children: Y(e.publishedAt)
535
+ }), /* @__PURE__ */ z("span", {
536
+ className: L(d, Le.date),
537
+ children: G(e.publishedAt)
788
538
  })]
789
539
  }, `${e.version}-${n}`))
790
540
  });
791
- }, nt = ":", rt = (e) => `${nt}${e}`, it = (e) => e?.startsWith(nt) ? e.slice(1) : void 0, at = (e) => [rt(e.rootKey), ...e.path], ot = (e) => {
792
- let [t, ...n] = e, r = it(t);
793
- return r == null ? void 0 : {
794
- rootKey: r,
795
- path: n
796
- };
797
- }, st = (e, t) => e.map((e) => ({
798
- ...e,
799
- path: [t, ...e.path],
800
- children: e.children ? st(e.children, t) : void 0
801
- })), ct = (e) => e.map((e) => {
802
- let t = rt(e.key);
803
- return {
804
- path: [t],
805
- name: e.label,
806
- children: st(ve(e.items), t)
807
- };
808
- }), lt = (e) => e.map((e) => rt(e.key)), ut = (e, t) => {
809
- let n = /* @__PURE__ */ new Set();
810
- for (let r of e) {
811
- let e = rt(r.key);
812
- for (let i of t(r) ?? []) n.add(i ? `${e}/${i}` : e);
813
- }
814
- return n;
815
- }, dt = (e, t) => {
816
- let n = new Map(e.map((e) => [e.key, /* @__PURE__ */ new Set()]));
817
- for (let e of t) {
818
- let [t, ...r] = e.split("/"), i = it(t);
819
- i != null && r.length !== 0 && n.get(i)?.add($(r));
820
- }
821
- return n;
822
- }, ft = {
823
- divider: "_divider_1gs31_1",
824
- tree: "_tree_1gs31_17"
825
- }, pt = "data-cancel-creating-folder", mt = "", ht = [], gt = ({ items: e = ht, selectedPath: n, onSelectedPathChange: o, onCreateFolder: s, roots: c, destination: l, onDestinationChange: u, onCreateDestinationFolder: p, searchQuery: m, getDisabledReason: h, disabled: g = !1, createFolderLabel: _ = "Create new folder", cancelCreatingFolderLabel: v = "Cancel", addSiblingFolderLabel: y = "Add sibling", addChildFolderLabel: x = "Add child", newFolderDefaultName: S = "New folder", noResultsLabel: ee = "No folders match \"{query}\".", emptyFolderNameError: C = "Folder name cannot be empty.", invalidFolderNameError: w = "Folder name contains invalid characters.", duplicateFolderNameError: te = "A folder with this name already exists.", sameAsParentFolderNameError: T = "A folder cannot have the same name as its parent folder.", rootLabel: E = "Organization", expandedPaths: D, onExpandedPathsChange: O, loadingPaths: k, styles: A = {} }) => {
826
- let ne = {
827
- ...se({ "--pft-divider": A.colors?.divider }),
828
- ...A.cssVars
829
- }, j = c != null, M = r(() => c ? ct(c) : e, [c, e]), re = i(M);
830
- t(() => {
831
- re.current = M;
832
- }, [M]);
833
- let N = r(() => c ? lt(c) : [mt], [c]), P = n;
834
- j && (P = l ? at(l) : void 0);
835
- let ie = (e) => {
836
- j ? u?.(e ? ot(e) : void 0) : o?.(e);
837
- }, [F, ae] = a(() => new Set(P?.map((e, t) => $(P.slice(0, t + 1))) ?? [])), I = r(() => c ? /* @__PURE__ */ new Set([...F, ...ut(c, (e) => e.expandedPaths)]) : void 0, [c, F]) ?? D ?? F, L = r(() => c ? ut(c, (e) => e.loadingPaths) : k, [c, k]), oe = (e) => {
838
- let t = new Set(e);
839
- for (let e of N) t.delete(e);
840
- if (c) {
841
- ae(t);
842
- let e = dt(c, t);
843
- for (let t of c) t.onExpandedPathsChange?.(e.get(t.key) ?? /* @__PURE__ */ new Set());
844
- } else O ? O(t) : ae(t);
845
- }, [R, ce] = a(null), [le, H] = a(S), ue = i(null), G = i(!1);
846
- t(() => {
847
- let e = (e) => {
848
- e.target instanceof Element && e.target.closest(`[${pt}]`) && (G.current = !0);
849
- };
850
- return document.addEventListener("pointerdown", e, !0), () => document.removeEventListener("pointerdown", e, !0);
851
- }, []);
852
- let K = m.trim(), q = R != null, J = r(() => ge(M, m), [M, m]), pe = K.length > 0 && J.length === 0, Y = !q && K.length > 0, X = r(() => {
853
- let e = Y ? J : M;
854
- return j ? e : ve(e);
855
- }, [
856
- Y,
857
- J,
858
- M,
859
- j
860
- ]), Z = r(() => /* @__PURE__ */ new Set([...N, ...xe(X)]), [N, X]), me = r(() => /* @__PURE__ */ new Set([...N, ...Y ? Z : I]), [
861
- N,
862
- Y,
863
- Z,
864
- I
865
- ]), Q = r(() => we(X), [X]), he = r(() => Y && Q.length === 0 ? [] : j ? Q : [{
866
- path: mt,
867
- name: E,
868
- folderId: mt,
869
- nodeType: de.FOLDER,
870
- items: Q
871
- }], [
872
- Q,
873
- E,
874
- Y,
875
- j
876
- ]), _e = R ? $(R) : null, ye = {
877
- empty: C,
878
- invalid: w,
879
- duplicate: te,
880
- sameAsParent: T
881
- }, be = (e) => N.includes($(e)) ? void 0 : e.at(-1), Ce = (e) => c ? ot(e) : {
882
- rootKey: mt,
883
- path: e
884
- }, Te = (e) => {
885
- if (!h) return;
886
- let t = Ce(Se(e.path));
887
- return t && h(t) || void 0;
888
- }, ke = (e) => {
889
- let t = Ce(e);
890
- return t != null && !!h?.(t);
891
- }, Ae = (e) => {
892
- if (ke(e)) return !1;
893
- if (!c) return !0;
894
- let t = ot(e), n = c.find((e) => e.key === t?.rootKey);
895
- return n != null && n.canCreateFolders !== !1;
896
- }, je = (() => {
897
- if (!c) {
898
- let e = P ?? [];
899
- return Ae(e) ? e : void 0;
900
- }
901
- if (P && Ae(P)) return P;
902
- let e = c.find((e) => e.canCreateFolders !== !1);
903
- return e ? at({
904
- rootKey: e.key,
905
- path: []
906
- }) : void 0;
907
- })(), Me = (e) => {
908
- let t = pe && Ee(K, [], ye) == null, n = be(e);
909
- return De(t ? K : S, [...Oe(M, e), ...n ? [n] : []]);
910
- }, [Ne, Pe] = a(null);
911
- Ne != null && !L?.has($(Ne)) && (Pe(null), ce(Ne), H(Me(Ne)));
912
- let Fe = (e) => {
913
- ce(null), Pe(e), ue.current = null, G.current = !1;
914
- let t = $(e);
915
- t && oe(new Set(I).add(t));
916
- }, Ie = () => {
917
- je && Fe(je);
918
- }, Le = (e) => {
919
- let t = Se(e.path);
920
- if (!Ae(t)) return [];
921
- let n = [{
922
- key: "add-child",
923
- label: x,
924
- icon: /* @__PURE__ */ B(U, {
925
- size: d.SM,
926
- "aria-hidden": !0,
927
- stroke: f
928
- }),
929
- onClick: () => Fe(t)
930
- }];
931
- return N.includes(e.path) || n.push({
932
- key: "add-sibling",
933
- label: y,
934
- icon: /* @__PURE__ */ B(W, {
935
- size: d.SM,
936
- "aria-hidden": !0,
937
- stroke: f
938
- }),
939
- onClick: () => Fe(t.slice(0, -1))
940
- }), n;
941
- }, Re = (e) => {
942
- if (!R) return null;
943
- let t = Ee(e, Oe(re.current, R), ye, be(R));
944
- return ue.current = t, t;
945
- }, ze = (e) => {
946
- if (!R || G.current) return;
947
- let t = e.trim(), n = ue.current;
948
- if (!(Re(e) ?? n)) {
949
- let e = c ? ot(R) : void 0;
950
- e ? p?.(e.rootKey, e.path, t) : s?.(R, t), ie([...R, t]);
951
- }
952
- ce(null);
953
- }, Be = () => ce(null);
954
- return /* @__PURE__ */ V("div", {
955
- style: ne,
956
- className: z(g && "pointer-events-none opacity-60", A.className),
957
- children: [
958
- /* @__PURE__ */ B("div", {
959
- className: z("w-full max-w-full min-w-0", ft.tree),
960
- children: /* @__PURE__ */ B(fe, {
961
- items: he,
962
- showFiles: !1,
963
- selectedPath: P == null ? void 0 : $(P),
964
- expandedPaths: me,
965
- onExpandedPathsChange: oe,
966
- loadingPaths: L,
967
- onItemClick: (e) => {
968
- if (g || Te(e)) return;
969
- let t = P != null && $(P) === e.path;
970
- ie(t ? void 0 : Se(e.path));
971
- },
972
- getDisabledTooltip: h ? Te : void 0,
973
- getContextMenuItems: Le,
974
- createdFolderPath: _e,
975
- newFolderDefaultName: le,
976
- onCreateFolderSave: ze,
977
- onCreateFolderCancel: Be,
978
- onRenameValidate: (e) => Re(e),
979
- searchQuery: Y ? K : void 0,
980
- emptyStateTitle: Y ? ee.replace("{query}", K) : void 0
981
- })
982
- }),
983
- /* @__PURE__ */ B("div", {
984
- className: z("my-2 h-px", ft.divider),
985
- "aria-hidden": !0
986
- }),
987
- /* @__PURE__ */ V("div", {
988
- className: "mb-4 flex flex-wrap items-center gap-2",
989
- children: [/* @__PURE__ */ B(b, {
990
- onClick: Ie,
991
- label: _,
992
- iconBefore: /* @__PURE__ */ B(W, {
993
- size: d.SM,
994
- "aria-hidden": !0,
995
- stroke: f
996
- }),
997
- disabled: g || q || !je
998
- }), q && /* @__PURE__ */ B(b, {
999
- label: v,
1000
- onClick: Be,
1001
- disabled: g,
1002
- [pt]: ""
1003
- })]
1004
- })
1005
- ]
1006
- });
1007
- }, _t = {
1008
- summaryTitle: "_summaryTitle_zj3gd_1",
1009
- sectionHeading: "_sectionHeading_zj3gd_5",
1010
- destination: "_destination_zj3gd_9"
1011
- }, vt = 200, yt = ({ view: e = Q.Main, onChangeFolderClick: o, resource: s, renderSummary: c, dependencies: u, versionHistory: p, folderItems: m, selectedFolderPath: g, pendingFolderPath: _, onPendingFolderPathChange: v, onCreateFolder: x, getDisabledReason: S, expandedPaths: C, onExpandedPathsChange: w, loadingPaths: te, hasExistingPublicationInFolder: T, hasWriteAccess: E, isSubmitting: A, hasSubmitError: ne = !1, allowReplace: M = !0, author: re, onAuthorChange: N, publishCredentials: P = !1, onPublishCredentialsChange: ie, rules: F, onRulesChange: ae, ruleSourceOptions: I, isRulesLoading: L = !1, hasRulesLoadError: R = !1, labels: ce = {}, summaryTitleClassName: le = "dial-body-semi-text", headingClassName: U = "dial-body-semi-text", destinationClassName: W = "dial-small-semi-text", calloutFolderNameClassName: ue = "dial-small-paragraph-semi-text", styles: de = {} }) => {
1012
- let { colors: fe, folderTree: G, accessRules: q, dependencies: pe } = de, Y = {
1013
- ...se({
1014
- "--pp-summary-title-text": fe?.summaryTitleText,
1015
- "--pp-heading-text": fe?.headingText,
1016
- "--pp-destination-text": fe?.destinationText
541
+ }, ze = {
542
+ summaryTitle: "_summaryTitle_hp97x_1",
543
+ sectionHeading: "_sectionHeading_hp97x_5",
544
+ destination: "_destination_hp97x_9",
545
+ directNote: "_directNote_hp97x_13"
546
+ }, Be = "", Ve = () => void 0, He = (e) => e == null ? void 0 : {
547
+ rootKey: Be,
548
+ path: e
549
+ }, Ue = 200, We = ({ view: e = K.Main, onChangeFolderClick: a, resource: o, renderSummary: c, dependencies: d, versionHistory: f, folderItems: m, selectedFolderPath: h, pendingFolderPath: g, onPendingFolderPathChange: b, onCreateFolder: x, getDisabledReason: S, canCreateFolderIn: C, expandedPaths: w, onExpandedPathsChange: O, loadingPaths: k, hasExistingPublicationInFolder: ee, hasWriteAccess: A, isSubmitting: j, hasSubmitError: M = !1, isTargetTaken: N = !1, isTargetChecking: P = !1, allowReplace: te = !0, author: ne = "", onAuthorChange: R, publishCredentials: re = !1, onPublishCredentialsChange: H, isDirectWrite: U = !1, directUnavailableNote: W, labels: G = {}, summaryTitleClassName: ce = "dial-body-semi-text", headingClassName: le = "dial-body-semi-text", directNoteClassName: ue = "dial-small-text", destinationClassName: de = "dial-small-semi-text", calloutFolderNameClassName: fe = "dial-small-paragraph-semi-text", styles: pe = {} }) => {
550
+ let { colors: q, folderTree: me, dependencies: he } = pe, J = {
551
+ ...I({
552
+ "--pp-summary-title-text": q?.summaryTitleText,
553
+ "--pp-heading-text": q?.headingText,
554
+ "--pp-destination-text": q?.destinationText,
555
+ "--pp-direct-note-text": q?.directNoteText
1017
556
  }),
1018
- ...de.cssVars
1019
- }, X = {
1020
- border: fe?.summaryBorder,
1021
- background: fe?.summaryBackground
1022
- }, { folderLabel: Z = "Publish to folder", destinationAriaLabel: me = "Destination folder", noFolderSelectedLabel: he = "No folder selected", changeFolderLabel: ge = "Change", chooseFolderLabel: _e = "Choose", replaceWarning: ve = "Version {version} is already published in {folder}. Publishing will replace it.", noAccessError: ye = "You don't have permission to publish to {folder}. Pick another, or ask an owner for access.", submitError: be = "Publishing failed. Please try again.", adminApprovalTitle: xe = "Admin approval required", adminApprovalMessage: $ = "We’ll send a request to your organization’s admin. If approved, it will appear in the folder.", folderEmptyStateLabel: Se, addSiblingFolderLabel: Ce, addChildFolderLabel: we, cancelCreatingFolderLabel: Te, createFolderEmptyNameError: Ee, createFolderInvalidNameError: De, createFolderDuplicateNameError: Oe, createFolderSameAsParentNameError: ke, rootFolderLabel: Ae = "Organization", accessRulesLabels: je, dependenciesLabels: Me, searchPlaceholder: Ne, clearSearchAriaLabel: Pe, authorLabel: Fe = "Author", authorPlaceholder: Ie = "Author name", authorHint: Le = "Shown as the publication’s author. Defaults to you — replace it to credit a team instead.", credentialsLabel: ze = "Publish with my credentials", credentialsHint: Be = "Members will use this without signing in themselves. Your credential itself is never shown to them." } = ce, [Ve, He] = a(""), Ge = n(), Ke = i(null), qe = i(null), Je = (e) => {
1023
- He(e ?? "");
1024
- }, Ye = i(e);
557
+ ...pe.cssVars
558
+ }, Y = {
559
+ border: q?.summaryBorder,
560
+ background: q?.summaryBackground
561
+ }, { folderLabel: ge = "Publish to folder", destinationAriaLabel: _e = "Destination folder", noFolderSelectedLabel: ve = "No folder selected", changeFolderLabel: ye = "Change", chooseFolderLabel: be = "Choose", replaceWarning: xe = "Version {version} is already published in {folder}. Publishing will replace it.", targetTakenLabel: Se = "A resource with this name already exists in {folder}. Rename it or choose another folder.", targetTakenVersionedLabel: Ce = "Version {version} of a resource with this name already exists in {folder}. Rename it, change its version or choose another folder.", noAccessError: X = "You don't have permission to publish to {folder}. Pick another, or ask an owner for access.", submitError: we = "Publishing failed. Please try again.", adminApprovalTitle: Te = "Admin approval required", adminApprovalMessage: De = "We’ll send a request to your organization’s admin. If approved, it will appear in the folder.", folderEmptyStateLabel: Q, addSiblingFolderLabel: Oe, addChildFolderLabel: ke, cancelCreatingFolderLabel: Ae, createFolderEmptyNameError: je, createFolderInvalidNameError: Me, createFolderDuplicateNameError: Ne, createFolderSameAsParentNameError: Pe, rootFolderLabel: Fe = "Organization", dependenciesLabels: Le, searchPlaceholder: Re, clearSearchAriaLabel: We, authorLabel: Ke = "Author", authorPlaceholder: Je = "Author name", authorHint: Ye = "Shown as the publication’s author. Defaults to you — replace it to credit a team instead.", credentialsLabel: Xe = "Publish with my credentials", directWriteNote: Ze, credentialsHint: Qe = "Members will use this without signing in themselves. Your credential itself is never shown to them." } = G, $e = n(), et = i(null), tt = i(null), nt = i(e);
1025
562
  t(() => {
1026
- Ye.current !== e && (Ye.current = e, e === Q.ChangeFolder ? qe.current?.focus({ preventScroll: !0 }) : Ke.current?.focus({ preventScroll: !0 }));
563
+ nt.current !== e && (nt.current = e, e === K.ChangeFolder ? tt.current?.focus({ preventScroll: !0 }) : et.current?.focus({ preventScroll: !0 }));
1027
564
  }, [e]);
1028
- let Xe = g != null, Ze = r(() => J({
1029
- hasSelectedFolder: Xe,
1030
- hasExistingPublicationInFolder: T,
1031
- hasWriteAccess: E,
1032
- isSubmitting: A,
1033
- hasSubmitError: ne,
1034
- allowReplace: M
565
+ let rt = h != null, $ = r(() => se({
566
+ hasSelectedFolder: rt,
567
+ hasExistingPublicationInFolder: ee,
568
+ hasWriteAccess: A,
569
+ isSubmitting: j,
570
+ hasSubmitError: M,
571
+ isTargetTaken: N,
572
+ isTargetChecking: P,
573
+ allowReplace: te
1035
574
  }), [
1036
- Xe,
1037
- T,
1038
- E,
575
+ rt,
576
+ ee,
1039
577
  A,
1040
- ne,
1041
- M
1042
- ]), Qe = Xe ? g[g.length - 1] ?? Ae : "", et = c ? c() : /* @__PURE__ */ B("span", {
1043
- className: z("truncate", le, _t.summaryTitle),
1044
- children: s?.title
1045
- });
1046
- if (e === Q.ChangeFolder) return /* @__PURE__ */ V("div", {
1047
- ref: qe,
578
+ j,
579
+ M,
580
+ N,
581
+ P,
582
+ te
583
+ ]), it = rt ? h[h.length - 1] ?? Fe : "", at = c ? c() : /* @__PURE__ */ z("span", {
584
+ className: L("truncate", ce, ze.summaryTitle),
585
+ children: o?.title
586
+ }), ot = r(() => [{
587
+ key: Be,
588
+ label: Fe,
589
+ items: m,
590
+ expandedPaths: w,
591
+ onExpandedPathsChange: O,
592
+ loadingPaths: k
593
+ }], [
594
+ Fe,
595
+ m,
596
+ w,
597
+ O,
598
+ k
599
+ ]), st = r(() => ({
600
+ searchPlaceholder: Re,
601
+ clearSearchAriaLabel: We,
602
+ folderEmptyStateLabel: Q,
603
+ addSiblingFolderLabel: Oe,
604
+ addChildFolderLabel: ke,
605
+ cancelCreatingFolderLabel: Ae,
606
+ createFolderEmptyNameError: je,
607
+ createFolderInvalidNameError: Me,
608
+ createFolderDuplicateNameError: Ne,
609
+ createFolderSameAsParentNameError: Pe
610
+ }), [
611
+ Re,
612
+ We,
613
+ Q,
614
+ Oe,
615
+ ke,
616
+ Ae,
617
+ je,
618
+ Me,
619
+ Ne,
620
+ Pe
621
+ ]), ct = (e) => b(e?.path), lt = (e, t, n) => x(t, n);
622
+ if (e === K.ChangeFolder) return /* @__PURE__ */ z("div", {
623
+ ref: tt,
1048
624
  tabIndex: -1,
1049
625
  role: "group",
1050
- "aria-label": Z,
1051
- className: z("flex flex-col gap-3 outline-none", We.panel),
1052
- style: Y,
1053
- children: [/* @__PURE__ */ B("div", {
1054
- role: "search",
1055
- children: /* @__PURE__ */ B(j, {
1056
- value: Ve,
1057
- onChange: Je,
1058
- placeholder: Ne,
1059
- clearLabel: Pe,
1060
- "aria-label": Ne
1061
- })
1062
- }), /* @__PURE__ */ B(gt, {
1063
- items: m,
1064
- selectedPath: _,
1065
- onSelectedPathChange: v,
1066
- onCreateFolder: x,
626
+ "aria-label": ge,
627
+ className: L("flex flex-col gap-3 outline-none", Z.panel),
628
+ style: J,
629
+ children: /* @__PURE__ */ z(ie, {
630
+ view: ae.ChangeFolder,
631
+ item: { title: o?.title ?? "" },
632
+ roots: ot,
633
+ destination: {
634
+ rootKey: Be,
635
+ path: h ?? []
636
+ },
637
+ onDestinationChange: Ve,
638
+ onChangeFolderClick: Ve,
639
+ pendingDestination: He(g),
640
+ onPendingDestinationChange: ct,
641
+ onCreateFolder: lt,
1067
642
  getDisabledReason: S,
1068
- expandedPaths: C,
1069
- onExpandedPathsChange: w,
1070
- loadingPaths: te,
1071
- searchQuery: Ve,
1072
- disabled: A,
1073
- noResultsLabel: Se,
1074
- addSiblingFolderLabel: Ce,
1075
- addChildFolderLabel: we,
1076
- cancelCreatingFolderLabel: Te,
1077
- emptyFolderNameError: Ee,
1078
- invalidFolderNameError: De,
1079
- duplicateFolderNameError: Oe,
1080
- sameAsParentFolderNameError: ke,
1081
- rootLabel: Ae,
1082
- styles: G
1083
- })]
643
+ canCreateFolderIn: C,
644
+ isSubmitting: j,
645
+ panelLabels: st,
646
+ panelStyles: { folderTree: me }
647
+ })
1084
648
  });
1085
- let tt = z(W, _t.destination);
1086
- return /* @__PURE__ */ V("div", {
1087
- className: z("flex flex-col gap-5", We.panel),
1088
- style: Y,
649
+ let ut = L(de, ze.destination);
650
+ return /* @__PURE__ */ B("div", {
651
+ className: L("flex flex-col gap-5", Z.panel),
652
+ style: J,
1089
653
  children: [
1090
- s?.type == null ? /* @__PURE__ */ B(oe, {
1091
- colors: X,
1092
- children: et
1093
- }) : /* @__PURE__ */ B(oe, {
654
+ o?.type == null ? /* @__PURE__ */ z(F, {
655
+ colors: Y,
656
+ children: at
657
+ }) : /* @__PURE__ */ z(F, {
1094
658
  item: {
1095
- type: s.type,
1096
- name: s.title,
1097
- version: s.version ?? "",
1098
- iconUrl: s.iconUrl
659
+ type: o.type,
660
+ name: o.title,
661
+ version: o.version ?? "",
662
+ iconUrl: o.iconUrl
1099
663
  },
1100
664
  hasVersionTag: !1,
1101
- colors: X
665
+ colors: Y
1102
666
  }),
1103
- /* @__PURE__ */ V("section", { children: [
1104
- /* @__PURE__ */ B("h2", {
1105
- className: z("mb-2", U, _t.sectionHeading),
1106
- children: Z
667
+ /* @__PURE__ */ B("section", { children: [
668
+ /* @__PURE__ */ z("h2", {
669
+ className: L("mb-2", le, ze.sectionHeading),
670
+ children: ge
1107
671
  }),
1108
- /* @__PURE__ */ V("div", {
672
+ /* @__PURE__ */ B("div", {
1109
673
  className: "flex min-w-0 items-center gap-2",
1110
- children: [/* @__PURE__ */ B("div", {
674
+ children: [/* @__PURE__ */ z("div", {
1111
675
  role: "group",
1112
- "aria-label": me,
676
+ "aria-label": _e,
1113
677
  className: "min-w-0 flex-1",
1114
- children: Xe ? /* @__PURE__ */ B(y, {
1115
- name: [Ae, ...g].join(" / "),
1116
- nameClassName: tt
1117
- }) : /* @__PURE__ */ B("span", {
1118
- className: z("block truncate", tt),
1119
- children: he
678
+ children: rt ? /* @__PURE__ */ z(_, {
679
+ name: [Fe, ...h].join(" / "),
680
+ nameClassName: ut
681
+ }) : /* @__PURE__ */ z("span", {
682
+ className: L("block truncate", ut),
683
+ children: ve
1120
684
  })
1121
- }), /* @__PURE__ */ B(b, {
1122
- ref: Ke,
1123
- size: h.Small,
1124
- label: Xe ? ge : _e,
1125
- iconBefore: /* @__PURE__ */ B(H, {
1126
- size: d.SM,
1127
- stroke: f,
685
+ }), /* @__PURE__ */ z(v, {
686
+ ref: et,
687
+ size: p.Small,
688
+ label: rt ? ye : be,
689
+ iconBefore: /* @__PURE__ */ z(oe, {
690
+ size: l.SM,
691
+ stroke: u,
1128
692
  "aria-hidden": !0
1129
693
  }),
1130
- disabled: A,
1131
- onClick: o
694
+ disabled: j,
695
+ onClick: a
1132
696
  })]
1133
697
  }),
1134
- Ze.calloutKind === K.Info && /* @__PURE__ */ B("div", {
698
+ $.calloutKind === V.Info && !U && /* @__PURE__ */ z("div", {
1135
699
  className: "my-4",
1136
- children: /* @__PURE__ */ B(D, {
1137
- type: O.SectionMessage,
1138
- variant: k.Info,
1139
- title: xe,
1140
- message: $
700
+ children: /* @__PURE__ */ z(T, {
701
+ type: E.SectionMessage,
702
+ variant: D.Info,
703
+ title: Te,
704
+ message: W == null ? De : `${De} ${W}`
1141
705
  })
1142
706
  }),
1143
- Ze.calloutKind !== K.None && Ze.calloutKind !== K.Info && /* @__PURE__ */ B("div", {
707
+ $.calloutKind !== V.None && $.calloutKind !== V.Info && /* @__PURE__ */ z("div", {
1144
708
  className: "mt-3",
1145
- children: /* @__PURE__ */ B(D, {
1146
- type: O.SectionMessage,
1147
- variant: bt(Ze.calloutKind),
1148
- message: St(Ze.calloutKind, {
1149
- replaceWarning: ve,
1150
- noAccessError: ye,
1151
- submitError: be,
1152
- folderName: Qe,
1153
- version: s?.version,
1154
- folderNameClassName: ue
709
+ children: /* @__PURE__ */ z(T, {
710
+ type: E.SectionMessage,
711
+ variant: Ge($.calloutKind),
712
+ message: qe($.calloutKind, {
713
+ replaceWarning: xe,
714
+ targetTaken: o?.version ? Ce : Se,
715
+ noAccessError: X,
716
+ submitError: we,
717
+ folderName: it,
718
+ version: o?.version,
719
+ folderNameClassName: fe
1155
720
  })
1156
721
  })
1157
722
  }),
1158
- /* @__PURE__ */ B("div", {
723
+ W != null && !U && $.calloutKind !== V.Info && !$.isSubmitDisabled && /* @__PURE__ */ z("div", {
1159
724
  className: "mt-4",
1160
- children: /* @__PURE__ */ B(ee, {
1161
- id: Ge,
1162
- labelProps: { label: Fe },
1163
- placeholder: Ie,
1164
- caption: Le,
1165
- value: re,
1166
- onChange: (e) => N(e ?? ""),
1167
- maxLength: vt,
1168
- disabled: A
725
+ children: /* @__PURE__ */ z(T, {
726
+ type: E.SectionMessage,
727
+ variant: D.Info,
728
+ message: W
1169
729
  })
1170
730
  }),
1171
- ie != null && /* @__PURE__ */ B("div", {
731
+ R != null && !U && /* @__PURE__ */ z("div", {
1172
732
  className: "mt-4",
1173
- children: /* @__PURE__ */ B(l, {
1174
- labelProps: { label: ze },
1175
- caption: Be,
1176
- isSelected: P,
1177
- onChange: ie,
1178
- disabled: A
733
+ children: /* @__PURE__ */ z(y, {
734
+ id: $e,
735
+ labelProps: { label: Ke },
736
+ placeholder: Je,
737
+ caption: Ye,
738
+ value: ne,
739
+ onChange: (e) => R(e ?? ""),
740
+ maxLength: Ue,
741
+ disabled: j
1179
742
  })
1180
743
  }),
1181
- /* @__PURE__ */ B("div", {
744
+ U && Ze != null && /* @__PURE__ */ z("p", {
745
+ className: L("mt-4", ze.directNote, ue),
746
+ children: Ze
747
+ }),
748
+ H != null && !U && /* @__PURE__ */ z("div", {
1182
749
  className: "mt-4",
1183
- children: /* @__PURE__ */ B(Re, {
1184
- rules: F,
1185
- onRulesChange: ae,
1186
- sourceOptions: I,
1187
- folderName: Xe ? Qe : void 0,
1188
- disabled: A,
1189
- isLoading: L,
1190
- hasLoadError: R,
1191
- labels: je,
1192
- styles: q
750
+ children: /* @__PURE__ */ z(s, {
751
+ labelProps: { label: Xe },
752
+ caption: Qe,
753
+ isSelected: re,
754
+ onChange: H,
755
+ disabled: j
1193
756
  })
1194
757
  })
1195
758
  ] }),
1196
- u != null && /* @__PURE__ */ B($e, {
1197
- dependencies: u,
1198
- labels: Me,
1199
- headingClassName: U,
1200
- styles: pe
759
+ d != null && /* @__PURE__ */ z(Ie, {
760
+ dependencies: d,
761
+ labels: Le,
762
+ headingClassName: le,
763
+ styles: he
1201
764
  }),
1202
- p != null && /* @__PURE__ */ B(Ue, {
1203
- headingClassName: U,
1204
- ...p
765
+ f != null && /* @__PURE__ */ z(Ee, {
766
+ headingClassName: le,
767
+ ...f
1205
768
  })
1206
769
  ]
1207
770
  });
1208
- }, bt = (e) => e === K.ReplaceWarning ? k.Warning : k.Error, xt = (e, t, n) => {
771
+ }, Ge = (e) => e === V.ReplaceWarning || e === V.TargetTaken ? D.Warning : D.Error, Ke = (e, t, n) => {
1209
772
  let [r, i, ...a] = e.split("{folder}");
1210
- return i === void 0 || a.length > 0 ? e : /* @__PURE__ */ V(le, { children: [
773
+ return i === void 0 || a.length > 0 ? e : /* @__PURE__ */ B(R, { children: [
1211
774
  r,
1212
- /* @__PURE__ */ B("strong", {
775
+ /* @__PURE__ */ z("strong", {
1213
776
  className: n,
1214
777
  children: t
1215
778
  }),
1216
779
  i
1217
780
  ] });
1218
- }, St = (e, t) => e === K.ReplaceWarning ? xt(t.replaceWarning.replace("{version}", t.version ?? ""), t.folderName, t.folderNameClassName) : e === K.NoAccess ? xt(t.noAccessError, t.folderName, t.folderNameClassName) : t.submitError, Ct = { footer: "_footer_dks1v_1" }, wt = ({ version: e, hasExistingPublicationInFolder: t, allowReplace: n = !0, isSubmitDisabled: r, isSubmitLoading: i, onCancel: a, onSubmit: o, view: s = Q.Main, onSelectFolder: c, isSelectFolderDisabled: l = !1, labels: u = {}, colors: f }) => {
1219
- let p = se({ "--pf-border": f?.border }), { cancelLabel: m = "Cancel", publishDefaultLabel: h = "Publish", updateLabel: g = "Update version {version}", publishingInProgressLabel: _ = "Publishing…", selectFolderLabel: v = "Select" } = u, y = s === Q.ChangeFolder, x = i ? _ : n && t && e != null ? g.replace("{version}", e) : h;
1220
- return /* @__PURE__ */ V("div", {
781
+ }, qe = (e, t) => e === V.ReplaceWarning ? Ke(t.replaceWarning.replace("{version}", t.version ?? ""), t.folderName, t.folderNameClassName) : e === V.TargetTaken ? Ke(t.targetTaken.replace("{version}", t.version ?? ""), t.folderName, t.folderNameClassName) : e === V.NoAccess ? Ke(t.noAccessError, t.folderName, t.folderNameClassName) : t.submitError, Je = { footer: "_footer_dks1v_1" }, Ye = ({ version: e, hasExistingPublicationInFolder: t, allowReplace: n = !0, isSubmitDisabled: r, isSubmitLoading: i, onCancel: a, onSubmit: o, view: s = K.Main, onSelectFolder: c, isSelectFolderDisabled: u = !1, labels: d = {}, colors: f }) => {
782
+ let p = I({ "--pf-border": f?.border }), { cancelLabel: m = "Cancel", publishDefaultLabel: h = "Publish", updateLabel: g = "Update version {version}", publishingInProgressLabel: _ = "Publishing…", selectFolderLabel: y = "Select" } = d, b = s === K.ChangeFolder, x = i ? _ : n && t && e != null ? g.replace("{version}", e) : h;
783
+ return /* @__PURE__ */ B("div", {
1221
784
  style: p,
1222
- className: z("flex items-center justify-end gap-2 border-t px-4 py-4 rtl:flex-row-reverse rtl:justify-start desktop:px-3.5", Ct.footer),
1223
- children: [/* @__PURE__ */ B(b, {
785
+ className: L("flex items-center justify-end gap-2 border-t px-4 py-4 rtl:flex-row-reverse rtl:justify-start desktop:px-3.5", Je.footer),
786
+ children: [/* @__PURE__ */ z(v, {
1224
787
  label: m,
1225
788
  className: "mobile:flex-1",
1226
789
  disabled: i,
1227
790
  onClick: a
1228
- }), y ? /* @__PURE__ */ B(E, {
1229
- label: v,
791
+ }), b ? /* @__PURE__ */ z(w, {
792
+ label: y,
1230
793
  className: "mobile:flex-1",
1231
- disabled: l,
794
+ disabled: u,
1232
795
  onClick: c
1233
- }) : /* @__PURE__ */ B(A, {
796
+ }) : /* @__PURE__ */ z(O, {
1234
797
  label: x,
1235
798
  className: "mobile:flex-1",
1236
799
  disabled: r,
1237
- iconBefore: i ? /* @__PURE__ */ B("span", {
800
+ iconBefore: i ? /* @__PURE__ */ z("span", {
1238
801
  "aria-hidden": !0,
1239
- children: /* @__PURE__ */ B(ie, { size: d.SM })
802
+ children: /* @__PURE__ */ z(M, { size: l.SM })
1240
803
  }) : void 0,
1241
804
  onClick: o
1242
805
  })]
1243
806
  });
1244
- }, Tt = {
807
+ }, Xe = {
1245
808
  backdrop: "_backdrop_16jmd_6",
1246
809
  panel: "_panel_16jmd_10",
1247
810
  divider: "_divider_16jmd_15",
1248
811
  content: "_content_16jmd_19",
1249
812
  title: "_title_16jmd_24"
1250
- }, Et = ({ isOpen: e, resource: n, renderSummary: i, dependencies: o, versionHistory: s, folderItems: c, selectedFolderPath: l, onSelectedFolderPathChange: u, onCreateFolder: d, getDisabledReason: f, expandedPaths: p, onExpandedPathsChange: m, loadingPaths: h, hasExistingPublicationInFolder: g, hasWriteAccess: _, isSubmitting: v, hasSubmitError: y = !1, allowReplace: b = !0, author: x, onAuthorChange: S, rules: ee, onRulesChange: C, ruleSourceOptions: w, isRulesLoading: te = !1, hasRulesLoadError: T = !1, onClose: E, returnFocusRef: D, onSubmit: O, panelLabels: k, panelStyles: A, panelSummaryTitleClassName: ne, panelHeadingClassName: j, panelCalloutFolderNameClassName: M, footerLabels: N, labels: P = {}, titleClassName: ie = "dial-body-semi-text", colors: F }) => {
1251
- let ae = se({
813
+ }, Ze = ({ isOpen: e, resource: n, renderSummary: i, dependencies: o, versionHistory: s, folderItems: c, selectedFolderPath: l, onSelectedFolderPathChange: u, onCreateFolder: d, getDisabledReason: f, canCreateFolderIn: p, expandedPaths: m, onExpandedPathsChange: h, loadingPaths: g, hasExistingPublicationInFolder: _, hasWriteAccess: v, isSubmitting: y, hasSubmitError: b = !1, isTargetTaken: x = !1, isTargetChecking: S = !1, allowReplace: C = !0, author: w, onAuthorChange: T, onClose: E, returnFocusRef: D, onSubmit: O, panelLabels: k, panelStyles: A, panelSummaryTitleClassName: j, panelHeadingClassName: M, panelCalloutFolderNameClassName: N, footerLabels: P, labels: te = {}, titleClassName: ne = "dial-body-semi-text", colors: F }) => {
814
+ let R = I({
1252
815
  "--spp-backdrop-bg": F?.backdropBackground,
1253
816
  "--spp-panel-bg": F?.panelBackground,
1254
817
  "--spp-panel-border": F?.panelBorder,
1255
818
  "--spp-divider-border": F?.dividerBorder,
1256
819
  "--spp-scrollbar-thumb": F?.scrollbarThumb,
1257
820
  "--spp-title-text": F?.titleText
1258
- }), [I, L] = a(null), { title: oe = "Publish", changeFolderTitle: R = "Change folder", backAriaLabel: ce = "Back", ariaLabel: le = "Publish", closeAriaLabel: H = "Close" } = P, U = he({
821
+ }), [re, ie] = a(null), { title: ae = "Publish", changeFolderTitle: oe = "Change folder", backAriaLabel: V = "Back", ariaLabel: H = "Publish", closeAriaLabel: U = "Close" } = te, W = de({
1259
822
  isOpen: e,
1260
823
  selectedFolderPath: l,
1261
824
  onSelectedFolderPathChange: u
1262
- }), W = U.view === Q.ChangeFolder, ue = r(() => J({
825
+ }), G = W.view === K.ChangeFolder, ce = r(() => se({
1263
826
  hasSelectedFolder: l != null,
1264
- hasExistingPublicationInFolder: g,
1265
- hasWriteAccess: _,
1266
- isSubmitting: v,
1267
- hasSubmitError: y,
1268
- allowReplace: b
827
+ hasExistingPublicationInFolder: _,
828
+ hasWriteAccess: v,
829
+ isSubmitting: y,
830
+ hasSubmitError: b,
831
+ isTargetTaken: x,
832
+ isTargetChecking: S,
833
+ allowReplace: C
1269
834
  }), [
1270
835
  l,
1271
- g,
1272
836
  _,
1273
837
  v,
1274
838
  y,
1275
- b
839
+ b,
840
+ x,
841
+ S,
842
+ C
1276
843
  ]);
1277
844
  return t(() => {
1278
- let t = I?.closest("[role=\"dialog\"]");
845
+ let t = re?.closest("[role=\"dialog\"]");
1279
846
  if (!e || !t) return;
1280
847
  let n = () => t.focus({ preventScroll: !0 });
1281
848
  n();
@@ -1291,383 +858,247 @@ var G = /* @__PURE__ */ function(e) {
1291
858
  };
1292
859
  }, [
1293
860
  e,
1294
- I,
861
+ re,
1295
862
  D
1296
- ]), /* @__PURE__ */ V(re, {
863
+ ]), /* @__PURE__ */ B(ee, {
1297
864
  open: e,
1298
865
  onClose: E,
1299
- header: /* @__PURE__ */ B("span", {
1300
- className: z("block truncate text-center", ie, Tt.title),
1301
- children: W ? R : oe
866
+ header: /* @__PURE__ */ z("span", {
867
+ className: L("block truncate text-center", ne, Xe.title),
868
+ children: G ? oe : ae
1302
869
  }),
1303
- ariaLabel: le,
1304
- onBack: W ? U.backToMain : void 0,
1305
- backAriaLabel: ce,
1306
- backDisabled: v,
1307
- closeAriaLabel: H,
1308
- closeDisabled: v,
1309
- style: ae,
1310
- overlayStyle: ae,
1311
- className: z(Tt.panel, "tablet:w-[540px]! tablet:max-w-[calc(100%-32px)]!"),
1312
- overlayClassName: Tt.backdrop,
1313
- headerClassName: z("px-[22px]", Tt.divider),
870
+ ariaLabel: H,
871
+ onBack: G ? W.backToMain : void 0,
872
+ backAriaLabel: V,
873
+ backDisabled: y,
874
+ closeAriaLabel: U,
875
+ closeDisabled: y,
876
+ style: R,
877
+ overlayStyle: R,
878
+ className: L(Xe.panel, "tablet:w-[540px]! tablet:max-w-[calc(100%-32px)]!"),
879
+ overlayClassName: Xe.backdrop,
880
+ headerClassName: L("px-[22px]", Xe.divider),
1314
881
  bodyClassName: "flex flex-col overflow-hidden",
1315
- children: [/* @__PURE__ */ B("div", {
1316
- ref: L,
1317
- className: z("min-h-0 flex-1 overflow-y-auto", Tt.content),
1318
- children: /* @__PURE__ */ B("div", {
882
+ children: [/* @__PURE__ */ z("div", {
883
+ ref: ie,
884
+ className: L("min-h-0 flex-1 overflow-y-auto", Xe.content),
885
+ children: /* @__PURE__ */ z("div", {
1319
886
  className: "p-[22px]",
1320
- children: /* @__PURE__ */ B(yt, {
887
+ children: /* @__PURE__ */ z(We, {
1321
888
  resource: n,
1322
889
  renderSummary: i,
1323
890
  dependencies: o,
1324
891
  versionHistory: s,
1325
- view: U.view,
1326
- onChangeFolderClick: U.openFolderView,
892
+ view: W.view,
893
+ onChangeFolderClick: W.openFolderView,
1327
894
  folderItems: c,
1328
895
  selectedFolderPath: l,
1329
- pendingFolderPath: U.pendingFolderPath,
1330
- onPendingFolderPathChange: U.setPendingFolderPath,
896
+ pendingFolderPath: W.pendingFolderPath,
897
+ onPendingFolderPathChange: W.setPendingFolderPath,
1331
898
  onCreateFolder: d,
1332
899
  getDisabledReason: f,
1333
- expandedPaths: p,
1334
- onExpandedPathsChange: m,
1335
- loadingPaths: h,
1336
- hasExistingPublicationInFolder: g,
1337
- hasWriteAccess: _,
1338
- isSubmitting: v,
1339
- hasSubmitError: y,
1340
- allowReplace: b,
1341
- author: x,
1342
- onAuthorChange: S,
1343
- rules: ee,
1344
- onRulesChange: C,
1345
- ruleSourceOptions: w,
1346
- isRulesLoading: te,
1347
- hasRulesLoadError: T,
900
+ canCreateFolderIn: p,
901
+ expandedPaths: m,
902
+ onExpandedPathsChange: h,
903
+ loadingPaths: g,
904
+ hasExistingPublicationInFolder: _,
905
+ hasWriteAccess: v,
906
+ isSubmitting: y,
907
+ hasSubmitError: b,
908
+ isTargetTaken: x,
909
+ isTargetChecking: S,
910
+ allowReplace: C,
911
+ author: w,
912
+ onAuthorChange: T,
1348
913
  labels: k,
1349
914
  styles: A,
1350
- summaryTitleClassName: ne,
1351
- headingClassName: j,
1352
- calloutFolderNameClassName: M
915
+ summaryTitleClassName: j,
916
+ headingClassName: M,
917
+ calloutFolderNameClassName: N
1353
918
  })
1354
919
  })
1355
- }), /* @__PURE__ */ B(wt, {
920
+ }), /* @__PURE__ */ z(Ye, {
1356
921
  version: n?.version,
1357
- hasExistingPublicationInFolder: g,
1358
- allowReplace: b,
1359
- isSubmitDisabled: ue.isSubmitDisabled,
1360
- isSubmitLoading: ue.isSubmitLoading,
1361
- onCancel: W ? U.backToMain : E,
922
+ hasExistingPublicationInFolder: _,
923
+ allowReplace: C,
924
+ isSubmitDisabled: ce.isSubmitDisabled,
925
+ isSubmitLoading: ce.isSubmitLoading,
926
+ onCancel: G ? W.backToMain : E,
1362
927
  onSubmit: O,
1363
- view: U.view,
1364
- onSelectFolder: U.selectFolder,
1365
- isSelectFolderDisabled: U.pendingFolderPath == null,
1366
- labels: N
928
+ view: W.view,
929
+ onSelectFolder: W.selectFolder,
930
+ isSelectFolderDisabled: W.pendingFolderPath == null,
931
+ labels: P
1367
932
  })]
1368
933
  });
1369
- }, Dt = { option: "_option_skygm_1" }, Ot = (e, t) => `Unpublish "${e}" from "${t}"?`, kt = (e) => `Choose which folder to unpublish "${e}" from.`, At = ({ isOpen: e, name: t, folders: n, selectedFolder: r, onSelectedFolderChange: i, isLoading: a = !1, labels: o, optionClassName: s = "dial-small-text", colors: c, onConfirm: l, onClose: d }) => {
1370
- let { title: f = "Unpublish?", confirmLabel: p = "Unpublish", cancelLabel: m = "Cancel", rootFolderLabel: h = "Organization", folderGroupAriaLabel: g = "Published folders", loadingStatusLabel: _ = "Requesting unpublish…", confirmMessage: v = Ot, selectFolderMessage: y = kt } = o ?? {}, b = n.length > 1;
1371
- return /* @__PURE__ */ B(I, {
934
+ }, Qe = { option: "_option_skygm_1" }, $e = (e, t) => `Unpublish "${e}" from "${t}"?`, et = (e) => `Choose which folder to unpublish "${e}" from.`, tt = ({ isOpen: e, name: t, folders: n, selectedFolder: r, onSelectedFolderChange: i, isLoading: a = !1, labels: o, optionClassName: s = "dial-small-text", colors: l, onConfirm: u, onClose: d }) => {
935
+ let { title: f = "Unpublish?", confirmLabel: p = "Unpublish", cancelLabel: m = "Cancel", rootFolderLabel: h = "Organization", folderGroupAriaLabel: g = "Published folders", loadingStatusLabel: _ = "Requesting unpublish…", confirmMessage: v = $e, selectFolderMessage: y = et } = o ?? {}, b = n.length > 1;
936
+ return /* @__PURE__ */ z(P, {
1372
937
  open: e,
1373
938
  title: f,
1374
939
  confirmLabel: p,
1375
940
  cancelLabel: m,
1376
- variant: u.Danger,
941
+ variant: c.Danger,
1377
942
  isLoading: a,
1378
943
  isConfirmDisabled: b && r == null,
1379
944
  loadingStatusLabel: _,
1380
- message: /* @__PURE__ */ B("span", {
945
+ message: /* @__PURE__ */ z("span", {
1381
946
  className: "wrap-break-word",
1382
- children: b ? y(t) : v(t, Ce(n[0] ?? "", h))
947
+ children: b ? y(t) : v(t, _e(n[0] ?? "", h))
1383
948
  }),
1384
- onConfirm: l,
949
+ onConfirm: u,
1385
950
  onClose: d,
1386
- children: b && /* @__PURE__ */ B("div", {
951
+ children: b && /* @__PURE__ */ z("div", {
1387
952
  className: "mt-3",
1388
- style: se({ "--ucd-option-text": c?.optionText }),
1389
- children: /* @__PURE__ */ B(ne, {
953
+ style: I({ "--ucd-option-text": l?.optionText }),
954
+ children: /* @__PURE__ */ z(k, {
1390
955
  ariaLabel: g,
1391
956
  value: r ?? void 0,
1392
957
  onChange: i,
1393
958
  disabled: a,
1394
959
  items: n.map((e) => ({
1395
960
  value: e,
1396
- label: Ce(e, h)
961
+ label: _e(e, h)
1397
962
  })),
1398
- radioClassName: z(s, Dt.option)
963
+ radioClassName: L(s, Qe.option)
1399
964
  })
1400
965
  })
1401
966
  });
1402
- }, jt = /* @__PURE__ */ function(e) {
967
+ }, nt = /* @__PURE__ */ function(e) {
1403
968
  return e.Keep = "keep", e.New = "new", e;
1404
- }({}), Mt = /* @__PURE__ */ function(e) {
1405
- return e.Main = "main", e.ChangeFolder = "change-folder", e;
1406
- }({}), Nt = {
1407
- heading: "_heading_vk731_1",
1408
- destination: "_destination_vk731_5"
1409
- }, Pt = ({ view: e, resource: t, roots: i, destination: o, onCreateFolder: s, getDisabledReason: c, onChangeFolderClick: l, changeFolderButtonRef: u, pendingDestination: p, onPendingDestinationChange: m, version: g, accessRules: v, versionHistory: x, isSubmitting: S = !1, submitError: te, foldersError: E, onRetryFolders: D, panelLabels: O = {}, panelStyles: k = {}, headingClassName: A = "dial-body-semi-text", destinationClassName: M = "dial-small-semi-text" }) => {
1410
- let { saveToFolderHeading: re = "Save to folder", changeFolderLabel: N = "Change", destinationAriaLabel: P = "Destination folder", versionHeading: ie = "Version", keepVersionLabel: F = "Keep version {version}", saveAsNewVersionLabel: ae = "Save as new version", newVersionLabel: I = "Version", newVersionPlaceholder: L = "Enter new version", searchPlaceholder: R = "Search folders", clearSearchAriaLabel: ce = "Clear search", folderEmptyStateLabel: le, createFolderLabel: U, cancelCreatingFolderLabel: W, addSiblingFolderLabel: ue, addChildFolderLabel: de, createFolderEmptyNameError: fe, createFolderInvalidNameError: G, createFolderDuplicateNameError: K, createFolderSameAsParentNameError: q, retryLabel: J = "Retry" } = O, { colors: pe, folderTree: Y } = k, X = {
1411
- ...se({
1412
- "--stf-heading-text": pe?.headingText,
1413
- "--stf-destination-text": pe?.destinationText
969
+ }({}), rt = {
970
+ heading: "_heading_jh4a2_1",
971
+ note: "_note_jh4a2_5"
972
+ }, $ = ({ isOpen: t, onClose: r, onSubmit: i, isSubmitDisabled: o = !1, returnFocusRef: s, labels: c = {}, titleClassName: l = "dial-body-semi-text", resource: u, roots: d, destination: f, onDestinationChange: p, onPendingDestinationChange: m, getDisabledReason: h, canCreateFolderIn: g, onCreateFolder: _, onCreateFolderError: v, version: b, dependencies: x, dependenciesLabels: S, dependenciesStyles: C, dependenciesNote: w, destinationNote: T, noteClassName: E = "dial-small-text", versionHistory: D, isSubmitting: O = !1, submitError: ee, foldersError: A, onRetryFolders: j, panelLabels: M = {}, panelStyles: N = {}, headingClassName: P = "dial-body-semi-text", destinationClassName: te = "dial-small-semi-text" }) => {
973
+ let { title: F = "Save", changeFolderTitle: R = "Change folder", closeAriaLabel: ie = "Close", backAriaLabel: ae = "Back", cancelLabel: oe = "Cancel", saveLabel: V = "Save", savingLabel: H = "Saving…", selectLabel: U = "Select" } = c, { saveToFolderHeading: se = "Save to folder", versionHeading: W = "Version", keepVersionLabel: G = "Keep version {version}", saveAsNewVersionLabel: ce = "Save as new version", newVersionLabel: le = "Version", newVersionPlaceholder: ue = "Enter new version", createFolderFailedMessage: K = "Failed to create the folder. Please try again.", ...de } = M, { colors: fe, folderTree: pe, cssVars: q } = N, me = {
974
+ ...I({
975
+ "--stf-heading-text": fe?.headingText,
976
+ "--stf-note-text": fe?.noteText
1414
977
  }),
1415
- ...k.cssVars
1416
- }, Z = {
1417
- border: pe?.summaryBorder,
1418
- background: pe?.summaryBackground
1419
- }, [me, Q] = a(""), he = n(), ge = n(), _e = r(() => [i.find((e) => e.key === o.rootKey)?.label ?? o.rootKey, ...o.path], [i, o]), ve = i.find((e) => e.key === p?.rootKey), ye = p ? p.path[p.path.length - 1] ?? ve?.label : void 0, be = z(A, Nt.heading), xe = c?.(o);
1420
- if (e === Mt.ChangeFolder) return /* @__PURE__ */ V("div", {
1421
- className: "flex flex-col gap-3",
1422
- style: X,
1423
- children: [
1424
- /* @__PURE__ */ B("div", {
1425
- role: "search",
1426
- children: /* @__PURE__ */ B(j, {
1427
- value: me,
1428
- onChange: (e) => Q(e ?? ""),
1429
- placeholder: R,
1430
- clearLabel: ce,
1431
- "aria-label": R
1432
- })
1433
- }),
1434
- /* @__PURE__ */ B(w, {
1435
- politeness: T.Assertive,
1436
- children: E && /* @__PURE__ */ V("div", {
1437
- className: "flex flex-wrap items-center gap-2",
1438
- children: [/* @__PURE__ */ B(_, { text: E }), D && /* @__PURE__ */ B(C, {
1439
- label: J,
1440
- onClick: D
1441
- })]
1442
- })
1443
- }),
1444
- /* @__PURE__ */ B(gt, {
1445
- roots: i,
1446
- destination: p,
1447
- onDestinationChange: m,
1448
- onCreateDestinationFolder: s,
1449
- getDisabledReason: c,
1450
- searchQuery: me,
1451
- disabled: S,
1452
- noResultsLabel: le,
1453
- createFolderLabel: U,
1454
- cancelCreatingFolderLabel: W,
1455
- addSiblingFolderLabel: ue,
1456
- addChildFolderLabel: de,
1457
- emptyFolderNameError: fe,
1458
- invalidFolderNameError: G,
1459
- duplicateFolderNameError: K,
1460
- sameAsParentFolderNameError: q,
1461
- styles: Y
1462
- }),
1463
- v && ve?.hasAccessRules && !(p && v.isHiddenFor?.(p)) && /* @__PURE__ */ B("div", {
1464
- className: "mt-1",
1465
- children: /* @__PURE__ */ B(Re, {
1466
- rules: v.rules,
1467
- onRulesChange: v.onRulesChange,
1468
- sourceOptions: v.sourceOptions,
1469
- folderName: ye,
1470
- disabled: S,
1471
- isLoading: v.isLoading,
1472
- hasLoadError: v.hasLoadError,
1473
- labels: v.labels,
1474
- styles: v.styles
1475
- })
1476
- })
1477
- ]
1478
- });
1479
- let $ = g ? [{
1480
- value: jt.Keep,
1481
- label: F.replace("{version}", g.currentVersion)
978
+ ...q
979
+ }, [he, J] = a(), Y = e((e, t, n) => (J(void 0), _(e, t, n)), [_]), ge = e((e) => {
980
+ J(K), v?.(e);
981
+ }, [K, v]), _e = e((e) => {
982
+ J(void 0), p(e);
983
+ }, [p]), ve = n(), ye = n(), be = L(P, rt.heading), xe = L(E, rt.note), Se = !!w && (x?.length ?? 0) === 0, Ce = u.type == null ? void 0 : /* @__PURE__ */ z(ne, {
984
+ item: {
985
+ type: u.type,
986
+ name: u.title,
987
+ version: u.version ?? "",
988
+ iconUrl: u.iconUrl
989
+ },
990
+ iconSize: 40,
991
+ hasFeaturedTag: !1,
992
+ showVersion: !0
993
+ }), X = b ? [{
994
+ value: nt.Keep,
995
+ label: G.replace("{version}", b.currentVersion)
1482
996
  }, {
1483
- value: jt.New,
1484
- label: ae,
1485
- content: /* @__PURE__ */ B(ee, {
1486
- id: he,
1487
- value: g.newVersion,
1488
- onChange: (e) => g.onNewVersionChange(e ?? ""),
1489
- onBlur: g.onNewVersionBlur,
997
+ value: nt.New,
998
+ label: ce,
999
+ content: /* @__PURE__ */ z(y, {
1000
+ id: ve,
1001
+ value: b.newVersion,
1002
+ onChange: (e) => b.onNewVersionChange(e ?? ""),
1003
+ onBlur: b.onNewVersionBlur,
1490
1004
  labelProps: {
1491
- label: I,
1005
+ label: le,
1492
1006
  required: !0
1493
1007
  },
1494
- placeholder: L,
1495
- error: g.newVersionError,
1496
- invalid: !!g.newVersionError,
1497
- disabled: S
1008
+ placeholder: ue,
1009
+ error: b.newVersionError,
1010
+ invalid: !!b.newVersionError,
1011
+ disabled: O
1498
1012
  })
1499
- }] : [];
1500
- return /* @__PURE__ */ V("div", {
1013
+ }] : [], we = /* @__PURE__ */ B("div", {
1501
1014
  className: "flex flex-col gap-5",
1502
- style: X,
1015
+ style: me,
1503
1016
  children: [
1504
- t.type == null ? /* @__PURE__ */ B(oe, {
1505
- colors: Z,
1506
- children: /* @__PURE__ */ B("span", {
1507
- className: z("truncate", be),
1508
- children: t.title
1509
- })
1510
- }) : /* @__PURE__ */ B(oe, {
1511
- item: {
1512
- type: t.type,
1513
- name: t.title,
1514
- version: t.version ?? "",
1515
- iconUrl: t.iconUrl
1516
- },
1517
- hasVersionTag: !1,
1518
- colors: Z
1017
+ T && /* @__PURE__ */ z("p", {
1018
+ className: xe,
1019
+ children: T
1519
1020
  }),
1520
- /* @__PURE__ */ V("section", {
1021
+ b && /* @__PURE__ */ B("section", {
1521
1022
  className: "flex flex-col gap-2",
1522
- children: [/* @__PURE__ */ B("h2", {
1023
+ children: [/* @__PURE__ */ z("h2", {
1523
1024
  className: be,
1524
- children: re
1525
- }), /* @__PURE__ */ V("div", {
1526
- className: "flex min-w-0 items-center gap-2",
1527
- children: [/* @__PURE__ */ B("div", {
1528
- role: "group",
1529
- "aria-label": P,
1530
- "aria-describedby": xe ? ge : void 0,
1531
- className: "min-w-0 flex-1",
1532
- children: /* @__PURE__ */ B(y, {
1533
- name: _e.join(" / "),
1534
- nameClassName: z(M, Nt.destination)
1535
- })
1536
- }), /* @__PURE__ */ B(b, {
1537
- ref: u,
1538
- size: h.Small,
1539
- label: N,
1540
- iconBefore: /* @__PURE__ */ B(H, {
1541
- size: d.SM,
1542
- stroke: f,
1543
- "aria-hidden": !0
1544
- }),
1545
- disabled: S,
1546
- onClick: l
1547
- })]
1025
+ children: W
1026
+ }), /* @__PURE__ */ z(k, {
1027
+ ariaLabel: W,
1028
+ value: b.versionMode,
1029
+ onChange: (e) => b.onVersionModeChange(e),
1030
+ items: X,
1031
+ disabled: O
1548
1032
  })]
1549
1033
  }),
1550
- g && /* @__PURE__ */ V("section", {
1034
+ Se && /* @__PURE__ */ B("section", {
1551
1035
  className: "flex flex-col gap-2",
1552
- children: [/* @__PURE__ */ B("h2", {
1036
+ "aria-labelledby": ye,
1037
+ children: [/* @__PURE__ */ z("h2", {
1038
+ id: ye,
1553
1039
  className: be,
1554
- children: ie
1555
- }), /* @__PURE__ */ B(ne, {
1556
- ariaLabel: ie,
1557
- value: g.versionMode,
1558
- onChange: (e) => g.onVersionModeChange(e),
1559
- items: $,
1560
- disabled: S
1040
+ children: S?.title ?? "Private dependencies"
1041
+ }), /* @__PURE__ */ z("p", {
1042
+ className: xe,
1043
+ children: w
1561
1044
  })]
1562
1045
  }),
1563
- /* @__PURE__ */ V(w, {
1564
- politeness: T.Assertive,
1565
- children: [xe && /* @__PURE__ */ B(_, {
1566
- id: ge,
1567
- text: xe
1568
- }), te && /* @__PURE__ */ B(_, { text: te })]
1046
+ !Se && x != null && /* @__PURE__ */ z(Ie, {
1047
+ dependencies: x,
1048
+ labels: S,
1049
+ headingClassName: P,
1050
+ styles: C
1569
1051
  }),
1570
- x != null && /* @__PURE__ */ B(Ue, {
1571
- headingClassName: A,
1572
- ...x
1052
+ D != null && /* @__PURE__ */ z(Ee, {
1053
+ headingClassName: P,
1054
+ ...D
1573
1055
  })
1574
1056
  ]
1575
1057
  });
1576
- }, Ft = {
1577
- backdrop: "_backdrop_1ie8s_6",
1578
- panel: "_panel_1ie8s_10",
1579
- divider: "_divider_1ie8s_15",
1580
- footer: "_footer_1ie8s_19",
1581
- content: "_content_1ie8s_23",
1582
- title: "_title_1ie8s_28"
1583
- }, It = ({ isOpen: e, onClose: n, onSubmit: r, isSubmitDisabled: o = !1, returnFocusRef: s, labels: c = {}, colors: l, titleClassName: u = "dial-body-semi-text", destination: f, onDestinationChange: p, isSubmitting: m = !1, onPendingDestinationChange: h, ...g }) => {
1584
- let { title: _ = "Save", changeFolderTitle: v = "Change folder", closeAriaLabel: y = "Close", backAriaLabel: x = "Back", cancelLabel: S = "Cancel", saveLabel: ee = "Save", savingLabel: C = "Saving…", selectLabel: w = "Select" } = c, te = se({
1585
- "--sstf-backdrop-bg": l?.backdropBackground,
1586
- "--sstf-panel-bg": l?.panelBackground,
1587
- "--sstf-panel-border": l?.panelBorder,
1588
- "--sstf-divider-border": l?.dividerBorder,
1589
- "--sstf-scrollbar-thumb": l?.scrollbarThumb,
1590
- "--sstf-title-text": l?.titleText
1591
- }), [T, D] = a(Mt.Main), [O, k] = a(f), ne = i(null), j = i(null);
1592
- t(() => {
1593
- e && D(Mt.Main);
1594
- }, [e]);
1595
- let M = i(T);
1596
- t(() => {
1597
- M.current !== T && (M.current = T, T === Mt.ChangeFolder ? ne.current?.focus({ preventScroll: !0 }) : j.current?.focus({ preventScroll: !0 }));
1598
- }, [T]);
1599
- let N = i(e);
1600
- t(() => {
1601
- let t = N.current;
1602
- N.current = e, t && !e && s?.current?.isConnected && s.current.focus({ preventScroll: !0 });
1603
- }, [e, s]);
1604
- let P = T === Mt.ChangeFolder, F = (e) => {
1605
- k(e), h?.(e);
1606
- }, ae = () => {
1607
- F(f), D(Mt.ChangeFolder);
1608
- }, I = () => {
1609
- h?.(f), D(Mt.Main);
1610
- }, L = () => {
1611
- O && p(O), D(Mt.Main);
1612
- };
1613
- return /* @__PURE__ */ V(re, {
1614
- open: e,
1615
- onClose: n,
1616
- header: /* @__PURE__ */ B("span", {
1617
- ref: ne,
1618
- tabIndex: -1,
1619
- className: z("block truncate outline-none", u, Ft.title),
1620
- children: P ? v : _
1621
- }),
1622
- ariaLabel: _,
1623
- onBack: P ? I : void 0,
1624
- backAriaLabel: x,
1625
- backDisabled: m,
1626
- closeAriaLabel: y,
1627
- closeDisabled: m,
1628
- style: te,
1629
- overlayStyle: te,
1630
- className: z(Ft.panel, "tablet:w-[540px]! tablet:max-w-[calc(100%-32px)]!"),
1631
- overlayClassName: Ft.backdrop,
1632
- headerClassName: z("px-[22px]", Ft.divider),
1633
- bodyClassName: "flex flex-col overflow-hidden",
1634
- children: [/* @__PURE__ */ B("div", {
1635
- className: z("min-h-0 flex-1 overflow-y-auto p-[22px]", Ft.content),
1636
- children: /* @__PURE__ */ B(Pt, {
1637
- ...g,
1638
- view: T,
1639
- destination: f,
1640
- onDestinationChange: p,
1641
- isSubmitting: m,
1642
- onChangeFolderClick: ae,
1643
- changeFolderButtonRef: j,
1644
- pendingDestination: O,
1645
- onPendingDestinationChange: F
1646
- })
1647
- }), /* @__PURE__ */ V("div", {
1648
- className: z("flex items-center justify-end gap-2 border-t px-4 py-4 desktop:px-3.5", Ft.footer),
1649
- children: [/* @__PURE__ */ B(b, {
1650
- label: S,
1651
- className: "mobile:flex-1",
1652
- disabled: m,
1653
- onClick: P ? I : n
1654
- }), P ? /* @__PURE__ */ B(E, {
1655
- label: w,
1656
- className: "mobile:flex-1",
1657
- disabled: O == null,
1658
- onClick: L
1659
- }) : /* @__PURE__ */ B(A, {
1660
- label: m ? C : ee,
1661
- className: "mobile:flex-1",
1662
- disabled: o || m,
1663
- iconBefore: m ? /* @__PURE__ */ B("span", {
1664
- "aria-hidden": !0,
1665
- children: /* @__PURE__ */ B(ie, { size: d.SM })
1666
- }) : void 0,
1667
- onClick: r
1668
- })]
1669
- })]
1058
+ return /* @__PURE__ */ z(re, {
1059
+ isOpen: t,
1060
+ onClose: r,
1061
+ returnFocusRef: s,
1062
+ onPendingDestinationChange: m,
1063
+ labels: {
1064
+ title: F,
1065
+ changeFolderTitle: R,
1066
+ closeAriaLabel: ie,
1067
+ backAriaLabel: ae,
1068
+ cancelLabel: oe,
1069
+ selectLabel: U
1070
+ },
1071
+ titleClassName: l,
1072
+ action: {
1073
+ label: V,
1074
+ busyLabel: H,
1075
+ isDisabled: o,
1076
+ onClick: i
1077
+ },
1078
+ item: {
1079
+ title: u.title,
1080
+ summary: Ce
1081
+ },
1082
+ roots: d,
1083
+ destination: f,
1084
+ onDestinationChange: _e,
1085
+ onCreateFolder: Y,
1086
+ onCreateFolderError: ge,
1087
+ getDisabledReason: h,
1088
+ canCreateFolderIn: g,
1089
+ mainSections: we,
1090
+ isSubmitting: O,
1091
+ submitError: ee ?? he,
1092
+ foldersError: A,
1093
+ onRetryFolders: j,
1094
+ panelLabels: {
1095
+ destinationHeading: se,
1096
+ ...de
1097
+ },
1098
+ panelStyles: { folderTree: pe },
1099
+ headingClassName: P,
1100
+ destinationClassName: te
1670
1101
  });
1671
1102
  };
1672
1103
  //#endregion
1673
- export { We as PUBLISH_PANEL_CLASS, G as PublicationRuleFunction, Pe as PublishAccessRuleEditor, Re as PublishAccessRules, K as PublishCalloutKind, $e as PublishDependenciesList, q as PublishDependencyType, gt as PublishFoldersTree, wt as PublishFooter, tt as PublishHistoryList, yt as PublishPanel, Q as PublishPanelView, Pt as SaveToFolderPanel, Mt as SaveToFolderView, jt as SaveVersionMode, Et as StandalonePublishPanel, It as StandaloneSaveToFolderPanel, At as UnpublishConfirmationDialog, Ue as VersionHistorySection, ze as VersionHistoryStatus, xe as collectFolderKeys, J as derivePublishState, ge as filterFolderTree, Y as formatPublishedDate, Se as fromFolderPathKey, Oe as getSiblingFolderNames, De as getUniqueFolderName, be as mergeFolderPaths, ve as sortFolderTree, we as toDialFileTree, $ as toFolderPathKey, me as usePublishFlow, he as usePublishFolderView, Ee as validateFolderName };
1104
+ export { Z as PUBLISH_PANEL_CLASS, V as PublishCalloutKind, U as PublishDependenciesAppearance, Ie as PublishDependenciesList, H as PublishDependencyType, Ye as PublishFooter, Re as PublishHistoryList, We as PublishPanel, K as PublishPanelView, nt as SaveVersionMode, Ze as StandalonePublishPanel, $ as StandaloneSaveToFolderPanel, tt as UnpublishConfirmationDialog, Ee as VersionHistorySection, Ce as VersionHistoryStatus, J as collectFolderKeys, se as derivePublishState, fe as filterFolderTree, G as formatPublishedDate, ge as fromFolderPathKey, Se as getSiblingFolderNames, xe as getUniqueFolderName, he as mergeFolderPaths, q as sortFolderTree, ve as toDialFileTree, Y as toFolderPathKey, ue as usePublishFlow, de as usePublishFolderView, be as validateFolderName };