@epam/ai-dial-publish-panel 1.3.0-dev.35 → 1.3.0-dev.353

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 (40) hide show
  1. package/components/PublishAccessRuleEditor/PublishAccessRuleEditor.d.ts +1 -1
  2. package/components/PublishAccessRuleEditor/PublishAccessRuleEditor.d.ts.map +1 -1
  3. package/components/PublishAccessRules/PublishAccessRules.d.ts.map +1 -1
  4. package/components/PublishFoldersTree/PublishFoldersTree.d.ts +1 -1
  5. package/components/PublishFoldersTree/PublishFoldersTree.d.ts.map +1 -1
  6. package/components/PublishHistoryList/PublishHistoryList.d.ts.map +1 -1
  7. package/components/PublishPanel/PublishFooter.d.ts +12 -1
  8. package/components/PublishPanel/PublishFooter.d.ts.map +1 -1
  9. package/components/PublishPanel/PublishPanel.d.ts +28 -11
  10. package/components/PublishPanel/PublishPanel.d.ts.map +1 -1
  11. package/components/PublishPanel/StandalonePublishPanel.d.ts +14 -3
  12. package/components/PublishPanel/StandalonePublishPanel.d.ts.map +1 -1
  13. package/components/SaveToFolderPanel/SaveToFolderPanel.d.ts +5 -0
  14. package/components/SaveToFolderPanel/SaveToFolderPanel.d.ts.map +1 -0
  15. package/components/SaveToFolderPanel/StandaloneSaveToFolderPanel.d.ts +5 -0
  16. package/components/SaveToFolderPanel/StandaloneSaveToFolderPanel.d.ts.map +1 -0
  17. package/index.css +3 -2
  18. package/index.d.ts +8 -0
  19. package/index.d.ts.map +1 -1
  20. package/index.js +1005 -600
  21. package/models/folder-destination.d.ts +28 -0
  22. package/models/folder-destination.d.ts.map +1 -0
  23. package/models/publish-access-rule-editor.d.ts +3 -7
  24. package/models/publish-access-rule-editor.d.ts.map +1 -1
  25. package/models/publish-folders-tree.d.ts +19 -10
  26. package/models/publish-folders-tree.d.ts.map +1 -1
  27. package/models/publish-panel-styles.d.ts +2 -6
  28. package/models/publish-panel-styles.d.ts.map +1 -1
  29. package/models/publish.d.ts +3 -3
  30. package/models/save-to-folder-panel.d.ts +204 -0
  31. package/models/save-to-folder-panel.d.ts.map +1 -0
  32. package/package.json +5 -5
  33. package/types/publish-panel.d.ts +8 -0
  34. package/types/publish-panel.d.ts.map +1 -0
  35. package/types/save-to-folder.d.ts +15 -0
  36. package/types/save-to-folder.d.ts.map +1 -0
  37. package/utils/folder-destination.d.ts +17 -0
  38. package/utils/folder-destination.d.ts.map +1 -0
  39. package/utils/use-publish-folder-view.d.ts +28 -0
  40. package/utils/use-publish-folder-view.d.ts.map +1 -0
package/index.js CHANGED
@@ -1,46 +1,46 @@
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 { ButtonVariant as o, Checkbox as s, DIAL_ICON_SIZE as c, DIAL_KIT_ICON_STROKE as l, DialFileNodeType as u, GhostButton as d, GhostIconButton as f, Highlight as p, Input as m, NeutralButton as h, Notification as g, NotificationType as _, NotificationVariant as v, Search as y, Select as b, SideDrawer as x, Spinner as S, Tag as C, TagInput as ee } from "@epam/ai-dial-ui-kit";
3
- import { ResourceSummary as w, TAG_INPUT_TAG_CLASS_NAME as T, buildCssVars as E, mergeClasses as D } from "@epam/ai-dial-chat-shared";
4
- import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
5
- import { IconFolderPlus as j, IconPlus as te, IconTrashX as ne } from "@tabler/icons-react";
6
- import { DialFileNodeType as re, DialFoldersTree as ie } from "@epam/ai-dial-react-file-manager";
2
+ import { BottomSheet as o, ButtonVariant as s, Checkbox as c, DIAL_ICON_SIZE as l, DIAL_KIT_ICON_STROKE as u, DialFileNodeType as d, ElementSize as f, ErrorText as p, FolderName as m, GhostButton as h, GhostIconButton as g, Highlight as _, Input as ee, LinkButton as v, LiveRegion as y, LiveRegionElement as b, LiveRegionPoliteness as x, NeutralButton as S, Notification as C, NotificationType as w, NotificationVariant as T, PrimaryButton as E, RadioGroup as D, Search as O, Select as k, SideDrawer as A, Spinner as j, Tag as M, TagInput as N } from "@epam/ai-dial-ui-kit";
3
+ import { ResourceSummary as P, TAG_INPUT_TAG_CLASS_NAME as te, buildCssVars as ne, mergeClasses as F, useIsMobile as I } from "@epam/ai-dial-chat-shared";
4
+ import { Fragment as L, jsx as R, jsxs as z } from "react/jsx-runtime";
5
+ import { IconFolder as B, IconFolderPlus as re, IconPlus as ie, IconTrashX as ae } from "@tabler/icons-react";
6
+ import { DialFileNodeType as oe, DialFoldersTree as se } from "@epam/ai-dial-react-file-manager";
7
7
  //#region src/models/publish.ts
8
- var M = /* @__PURE__ */ function(e) {
8
+ var V = /* @__PURE__ */ function(e) {
9
9
  return e.Equal = "EQUAL", e.Contain = "CONTAIN", e.Regex = "REGEX", e;
10
- }({}), N = /* @__PURE__ */ function(e) {
10
+ }({}), H = /* @__PURE__ */ function(e) {
11
11
  return e.None = "none", e.Info = "info", e.ReplaceWarning = "replaceWarning", e.NoAccess = "noAccess", e.SubmitError = "submitError", e;
12
- }({}), P = (e) => e.isSubmitting ? {
13
- calloutKind: N.None,
12
+ }({}), U = (e) => e.isSubmitting ? {
13
+ calloutKind: H.None,
14
14
  isSubmitDisabled: !0,
15
15
  isSubmitLoading: !0
16
16
  } : e.hasSelectedFolder ? e.hasWriteAccess ? e.hasSubmitError ? {
17
- calloutKind: N.SubmitError,
17
+ calloutKind: H.SubmitError,
18
18
  isSubmitDisabled: !1,
19
19
  isSubmitLoading: !1
20
20
  } : e.hasExistingPublicationInFolder ? {
21
- calloutKind: N.ReplaceWarning,
21
+ calloutKind: H.ReplaceWarning,
22
22
  isSubmitDisabled: e.allowReplace === !1,
23
23
  isSubmitLoading: !1
24
24
  } : {
25
- calloutKind: N.Info,
25
+ calloutKind: H.Info,
26
26
  isSubmitDisabled: !1,
27
27
  isSubmitLoading: !1
28
28
  } : {
29
- calloutKind: N.NoAccess,
29
+ calloutKind: H.NoAccess,
30
30
  isSubmitDisabled: !0,
31
31
  isSubmitLoading: !1
32
32
  } : {
33
- calloutKind: N.None,
33
+ calloutKind: H.None,
34
34
  isSubmitDisabled: !0,
35
35
  isSubmitLoading: !1
36
- }, F = 1440 * 60 * 1e3, I = (e, t = Date.now(), n) => {
37
- let r = Math.floor((t - e) / F);
36
+ }, ce = 864e5, W = (e, t = Date.now(), n) => {
37
+ let r = Math.floor((t - e) / ce);
38
38
  return r <= 0 ? "Today" : r === 1 ? "Yesterday" : r < 7 ? `${r} days ago` : new Date(e).toLocaleDateString(n, {
39
39
  month: "short",
40
40
  day: "numeric",
41
41
  year: "numeric"
42
42
  });
43
- }, L = (e, t, n) => t.length === 0 ? [...e, {
43
+ }, le = (e, t, n) => t.length === 0 ? [...e, {
44
44
  path: [n],
45
45
  name: n
46
46
  }] : e.map((e) => e.path.join("/") === t.join("/") ? {
@@ -51,37 +51,37 @@ var M = /* @__PURE__ */ function(e) {
51
51
  }]
52
52
  } : {
53
53
  ...e,
54
- children: e.children ? L(e.children, t, n) : e.children
55
- }), R = (e, t, n) => {
54
+ children: e.children ? le(e.children, t, n) : e.children
55
+ }), G = (e, t, n) => {
56
56
  let r = [...t, n].join("/");
57
57
  return t.length === 0 ? e.filter((e) => e.path.join("/") !== r) : e.map((e) => e.path.join("/") === t.join("/") ? {
58
58
  ...e,
59
59
  children: (e.children ?? []).filter((e) => e.path.join("/") !== r)
60
60
  } : {
61
61
  ...e,
62
- children: e.children ? R(e.children, t, n) : e.children
62
+ children: e.children ? G(e.children, t, n) : e.children
63
63
  });
64
- }, z = ({ item: n, history: i, folderItems: o, hasWriteAccess: s = () => !0, defaultAuthor: c = "", onCreateFolder: l, onPublish: u, onPublishSuccess: d, onPublishError: f, onFetchExistingRules: p }) => {
64
+ }, K = ({ item: n, history: i, folderItems: o, hasWriteAccess: s = () => !0, defaultAuthor: c = "", onCreateFolder: l, onPublish: u, onPublishSuccess: d, onPublishError: f, onFetchExistingRules: p }) => {
65
65
  let [m, h] = a(o);
66
66
  t(() => {
67
67
  h(o);
68
68
  }, [o]);
69
- let [g, _] = a(), [v, y] = a(!1), [b, x] = a(!1), [S, C] = a([]), [ee, w] = a(!1), [T, E] = a(!1), [D, O] = a(c), [k, A] = a(!1), [j, te] = a(!1);
69
+ let [g, _] = a(), [ee, v] = a(!1), [y, b] = a(!1), [x, S] = a([]), [C, w] = a(!1), [T, E] = a(!1), [D, O] = a(c), [k, A] = a(!1), [j, M] = a(!1);
70
70
  t(() => {
71
71
  j || O(c);
72
72
  }, [c, j]);
73
- let ne = e((e) => {
74
- te(!0), O(e);
73
+ let N = e((e) => {
74
+ M(!0), O(e);
75
75
  }, []);
76
76
  t(() => {
77
77
  if (g == null) {
78
- C([]), E(!1);
78
+ S([]), E(!1);
79
79
  return;
80
80
  }
81
81
  if (!p) return;
82
82
  let e = !1;
83
83
  return w(!0), E(!1), p(g).then((t) => {
84
- e || C(t);
84
+ e || S(t);
85
85
  }).catch(() => {
86
86
  e || E(!0);
87
87
  }).finally(() => {
@@ -90,30 +90,30 @@ var M = /* @__PURE__ */ function(e) {
90
90
  e = !0;
91
91
  };
92
92
  }, [g]);
93
- let re = r(() => {
93
+ let P = r(() => {
94
94
  if (!g) return !1;
95
95
  let e = g.join("/");
96
- return i.some((t) => t.folderPath.join("/") === e ? n.version == null ? !0 : t.version === n.version : !1);
96
+ return i.some((t) => t.folderPath.join("/") === e ? n.version == null || t.version === n.version : !1);
97
97
  }, [
98
98
  i,
99
99
  n.version,
100
100
  g
101
- ]), ie = e(async (e, t) => {
102
- h((n) => L(n, e, t));
101
+ ]), te = e(async (e, t) => {
102
+ h((n) => le(n, e, t));
103
103
  try {
104
104
  await l?.(e, t);
105
105
  } catch {
106
- h((n) => R(n, e, t)), x(!0);
106
+ h((n) => G(n, e, t)), b(!0);
107
107
  }
108
- }, [l]), M = e(async () => {
108
+ }, [l]), ne = e(async () => {
109
109
  if (!g) return !1;
110
- y(!0), x(!1);
110
+ v(!0), b(!1);
111
111
  try {
112
- return await u(n, g, S, D.trim(), k), d?.(n, g), !0;
112
+ return await u(n, g, x, D.trim(), k), d?.(n, g), !0;
113
113
  } catch (e) {
114
- return x(!0), f?.(n, g, e), !1;
114
+ return b(!0), f?.(n, g, e), !1;
115
115
  } finally {
116
- y(!1);
116
+ v(!1);
117
117
  }
118
118
  }, [
119
119
  D,
@@ -122,405 +122,418 @@ var M = /* @__PURE__ */ function(e) {
122
122
  f,
123
123
  d,
124
124
  k,
125
- S,
125
+ x,
126
126
  g
127
- ]), N = e(() => {
128
- h(o), _(void 0), x(!1), C([]), E(!1), O(c), te(!1), A(!1);
127
+ ]), F = e(() => {
128
+ h(o), _(void 0), b(!1), S([]), E(!1), O(c), M(!1), A(!1);
129
129
  }, [c, o]);
130
130
  return {
131
131
  folderItems: m,
132
132
  selectedFolderPath: g,
133
133
  setSelectedFolderPath: _,
134
- handleCreateFolder: ie,
135
- hasExistingPublicationInFolder: re,
136
- hasWriteAccess: g ? s(g) : !0,
137
- isSubmitting: v,
138
- hasSubmitError: b,
139
- handleSubmit: M,
140
- reset: N,
141
- rules: S,
142
- setRules: C,
134
+ handleCreateFolder: te,
135
+ hasExistingPublicationInFolder: P,
136
+ hasWriteAccess: !g || s(g),
137
+ isSubmitting: ee,
138
+ hasSubmitError: y,
139
+ handleSubmit: ne,
140
+ reset: F,
141
+ rules: x,
142
+ setRules: S,
143
143
  author: D,
144
- setAuthor: ne,
144
+ setAuthor: N,
145
145
  publishCredentials: k,
146
146
  setPublishCredentials: A,
147
- isRulesLoading: ee,
147
+ isRulesLoading: C,
148
148
  hasRulesLoadError: T
149
149
  };
150
- }, ae = (e, t) => {
150
+ }, q = /* @__PURE__ */ function(e) {
151
+ return e.Main = "main", e.ChangeFolder = "change-folder", e;
152
+ }({}), ue = ({ isOpen: e, selectedFolderPath: n, onSelectedFolderPathChange: r }) => {
153
+ let [i, o] = a(q.Main), [s, c] = a();
154
+ return t(() => {
155
+ e && o(q.Main);
156
+ }, [e]), {
157
+ view: i,
158
+ pendingFolderPath: s,
159
+ setPendingFolderPath: c,
160
+ openFolderView: () => {
161
+ c(n), o(q.ChangeFolder);
162
+ },
163
+ backToMain: () => o(q.Main),
164
+ selectFolder: () => {
165
+ s != null && r(s), o(q.Main);
166
+ }
167
+ };
168
+ }, J = (e, t) => {
151
169
  let n = t.trim().toLowerCase();
152
170
  return n ? e.reduce((e, r) => {
153
- let i = r.children ? ae(r.children, t) : void 0;
171
+ let i = r.children ? J(r.children, t) : void 0;
154
172
  return r.name.toLowerCase().includes(n) ? e.push(r) : i?.length && e.push({
155
173
  ...r,
156
174
  children: i
157
175
  }), e;
158
176
  }, []) : e;
159
- }, B = (e, t) => e.localeCompare(t, void 0, {
177
+ }, de = (e, t) => e.localeCompare(t, void 0, {
160
178
  sensitivity: "base",
161
179
  numeric: !0
162
- }), oe = (e) => [...e].sort((e, t) => B(e.name, t.name)).map((e) => e.children ? {
180
+ }), Y = (e) => [...e].sort((e, t) => de(e.name, t.name)).map((e) => e.children ? {
163
181
  ...e,
164
- children: oe(e.children)
165
- } : e), V = (e, t, n) => {
182
+ children: Y(e.children)
183
+ } : e), X = (e, t, n) => {
166
184
  let [r, ...i] = t;
167
185
  if (r == null) return e;
168
186
  let a = [...n, r], o = e.find((e) => e.name === r);
169
187
  return o ? i.length ? e.map((e) => e === o ? {
170
188
  ...e,
171
- children: V(e.children ?? [], i, a)
189
+ children: X(e.children ?? [], i, a)
172
190
  } : e) : e : [...e, {
173
191
  path: a,
174
192
  name: r,
175
- children: i.length ? V([], i, a) : void 0
193
+ children: i.length ? X([], i, a) : void 0
176
194
  }];
177
- }, se = (e, t) => t.reduce((e, t) => t.length ? V(e, t, []) : e, e), H = (e) => e.flatMap((e) => [e.path.join("/"), ...e.children ? H(e.children) : []]), U = (e) => e.join("/"), W = (e) => e.split("/").filter(Boolean), G = (e) => e.map((e) => {
178
- let t = U(e.path);
195
+ }, Z = (e, t) => t.reduce((e, t) => t.length ? X(e, t, []) : e, e), fe = (e) => e.flatMap((e) => [e.path.join("/"), ...e.children ? fe(e.children) : []]), Q = (e) => e.join("/"), pe = (e) => e.split("/").filter(Boolean), me = (e) => e.map((e) => {
196
+ let t = Q(e.path);
179
197
  return {
180
198
  path: t,
181
199
  name: e.name,
182
200
  folderId: t,
183
- nodeType: u.FOLDER,
184
- items: e.children ? G(e.children) : void 0
201
+ nodeType: d.FOLDER,
202
+ items: e.children ? me(e.children) : void 0
185
203
  };
186
- }), K = /[/\\:;,={}&"]/, q = (e, t, n) => {
204
+ }), he = /[/\\:;,={}&"]/, ge = (e, t, n) => {
187
205
  let r = e.trim();
188
- return r ? r.includes("..") || K.test(r) ? n.invalid : t.some((e) => e.toLowerCase() === r.toLowerCase()) ? n.duplicate : null : n.empty;
189
- }, ce = (e, t) => {
206
+ return r ? r.includes("..") || he.test(r) ? n.invalid : t.some((e) => e.toLowerCase() === r.toLowerCase()) ? n.duplicate : null : n.empty;
207
+ }, _e = (e, t) => {
190
208
  let n = new Set(t.map((e) => e.toLowerCase()));
191
209
  if (!n.has(e.toLowerCase())) return e;
192
210
  let r = 2;
193
211
  for (; n.has(`${e} ${r}`.toLowerCase());) r += 1;
194
212
  return `${e} ${r}`;
195
- }, J = (e, t) => {
213
+ }, ve = (e, t) => {
196
214
  if (t.length === 0) return e.map((e) => e.name);
197
- let n = U(t), r = (e) => {
215
+ let n = Q(t), r = (e) => {
198
216
  for (let t of e) {
199
- if (U(t.path) === n) return t;
217
+ if (Q(t.path) === n) return t;
200
218
  let e = t.children ? r(t.children) : void 0;
201
219
  if (e) return e;
202
220
  }
203
221
  };
204
222
  return (r(e)?.children ?? []).map((e) => e.name);
205
- }, Y = {
206
- dialog: "_dialog_jqcm2_5",
207
- error: "_error_jqcm2_14",
208
- selectField: "_selectField_jqcm2_28",
209
- selectFieldOpen: "_selectFieldOpen_jqcm2_40"
210
- }, le = 20, ue = 200, de = 8, fe = (e) => {
223
+ }, ye = {
224
+ sheet: "_sheet_1jbwn_3",
225
+ inline: "_inline_1jbwn_7",
226
+ selectField: "_selectField_1jbwn_21",
227
+ selectFieldOpen: "_selectFieldOpen_1jbwn_33"
228
+ }, be = 20, xe = 200, Se = 8, Ce = (e) => {
211
229
  let t = e.trim();
212
- if (t.length === 0 || t.length > ue) return !1;
230
+ if (t.length === 0 || t.length > xe) return !1;
213
231
  try {
214
232
  return new RegExp(t) instanceof RegExp;
215
233
  } catch {
216
234
  return !1;
217
235
  }
218
- }, pe = ({ sourceOptions: e, onSave: o, onCancel: s, disabled: c = !1, maxTargets: l = le, labels: u = {}, errorClassName: f = "dial-small-text", styles: g = {} }) => {
219
- let _ = {
220
- ...E({
221
- "--pare-mobile-bg": g.colors?.mobileBackground,
222
- "--pare-bg": g.colors?.background,
223
- "--pare-error-text": g.colors?.errorText,
224
- "--pare-select-border": g.colors?.selectBorder,
225
- "--pare-select-border-hover": g.colors?.selectBorderHover,
226
- "--pare-select-border-open": g.colors?.selectBorderOpen,
227
- "--pare-select-border-focus": g.colors?.selectBorderFocus
236
+ }, we = ({ sourceOptions: e, onSave: s, onCancel: c, disabled: l = !1, maxTargets: u = be, labels: d = {}, styles: f = {} }) => {
237
+ let p = I(), m = {
238
+ ...ne({
239
+ "--pare-mobile-bg": f.colors?.mobileBackground,
240
+ "--pare-bg": f.colors?.background,
241
+ "--pare-select-border": f.colors?.selectBorder,
242
+ "--pare-select-border-hover": f.colors?.selectBorderHover,
243
+ "--pare-select-border-open": f.colors?.selectBorderOpen,
244
+ "--pare-select-border-focus": f.colors?.selectBorderFocus
228
245
  }),
229
- ...g.cssVars
230
- }, { sourceLabel: v = "Source", sourcePlaceholder: y = "Select...", functionLabel: x = "Function", equalOptionLabel: S = "Equal", containOptionLabel: C = "Contain", regexOptionLabel: w = "Regex", targetsLabel: O = "Targets", targetsPlaceholder: j = "Add a target", targetsHintLabel: te = "Press Enter or comma to add a target.", patternLabel: ne = "Pattern", patternPlaceholder: re = "Enter a regular expression", invalidRegexError: ie = "Enter a valid regular expression.", requiredFieldError: N = "This field is required.", targetsRequiredError: P = "Add at least one target.", saveLabel: F = "Save", cancelLabel: I = "Cancel", dialogAriaLabel: L = "Add access rule" } = u, R = n(), z = n(), ae = n(), B = n(), oe = i(null);
246
+ ...f.cssVars
247
+ }, { sourceLabel: g = "Source", sourcePlaceholder: v = "Select...", functionLabel: y = "Function", equalOptionLabel: b = "Equal", containOptionLabel: x = "Contain", regexOptionLabel: C = "Regex", targetsLabel: w = "Targets", targetsPlaceholder: T = "Add a target", targetsHintLabel: E = "Press Enter or comma to add a target.", patternLabel: D = "Pattern", patternPlaceholder: O = "Enter a regular expression", invalidRegexError: A = "Enter a valid regular expression.", requiredFieldError: j = "This field is required.", targetsRequiredError: M = "Add at least one target.", saveLabel: P = "Save", cancelLabel: B = "Cancel", dialogAriaLabel: re = "Add access rule" } = d, ie = n(), ae = n(), oe = n(), se = n(), H = i(null);
231
248
  t(() => {
232
- oe.current?.focus();
233
- }, []);
234
- let [V, se] = a(), [H, U] = a(), [W, G] = a([]), [K, q] = a(""), [ce, J] = a(!1), [ue, pe] = a(""), [X, me] = a(!1), [Z, he] = a(!1), Q = D(Y.selectField, ce && Y.selectFieldOpen), ge = D(Y.selectField, X && Y.selectFieldOpen), _e = r(() => e.map((e) => ({
249
+ p || H.current?.focus();
250
+ }, [p]);
251
+ let [U, ce] = a(), [W, le] = a(), [G, K] = a([]), [q, ue] = a(""), [J, de] = a(!1), [Y, X] = a(""), [Z, fe] = a(!1), [Q, pe] = a(!1), me = F(ye.selectField, J && ye.selectFieldOpen), he = F(ye.selectField, Z && ye.selectFieldOpen), ge = r(() => e.map((e) => ({
235
252
  value: e,
236
253
  label: e,
237
- labelNode: ue.trim() ? /* @__PURE__ */ k(p, {
254
+ labelNode: Y.trim() ? /* @__PURE__ */ R(_, {
238
255
  text: e,
239
- query: ue,
256
+ query: Y,
240
257
  maxLines: 1
241
258
  }) : void 0
242
- })), [e, ue]), ve = r(() => [
259
+ })), [e, Y]), _e = r(() => [
243
260
  {
244
- value: M.Equal,
245
- label: S
261
+ value: V.Equal,
262
+ label: b
246
263
  },
247
264
  {
248
- value: M.Contain,
249
- label: C
265
+ value: V.Contain,
266
+ label: x
250
267
  },
251
268
  {
252
- value: M.Regex,
253
- label: w
269
+ value: V.Regex,
270
+ label: C
254
271
  }
255
272
  ], [
256
- S,
257
- C,
258
- w
259
- ]), $ = H === M.Regex, ye = fe(K), be = V != null && H != null && ($ ? ye : W.length > 0);
260
- return /* @__PURE__ */ A("div", {
261
- ref: oe,
262
- role: "dialog",
263
- "aria-modal": "true",
264
- "aria-label": L,
273
+ b,
274
+ x,
275
+ C
276
+ ]), ve = W === V.Regex, xe = Ce(q), we = U != null && W != null && (ve ? xe : G.length > 0), $ = (e) => {
277
+ ce(Array.isArray(e) ? e[0] : e), de(!1);
278
+ }, Te = (e) => {
279
+ let t = Array.isArray(e) ? e[0] : e;
280
+ W === V.Regex != (t === V.Regex) && (K([]), ue("")), le(t), fe(!1);
281
+ }, Ee = (e) => {
282
+ let t = [];
283
+ for (let n of e) {
284
+ let e = n.trim();
285
+ if (!(e.length === 0 || t.includes(e)) && (t.push(e), t.length >= u)) break;
286
+ }
287
+ K(t);
288
+ }, De = () => {
289
+ !we || U == null || W == null ? pe(!0) : s({
290
+ source: U,
291
+ function: W,
292
+ targets: ve ? [q.trim()] : G
293
+ });
294
+ }, Oe = (q.length > 0 || Q) && !xe, ke = (e) => {
295
+ e.key === "Escape" && (e.stopPropagation(), c());
296
+ }, Ae = /* @__PURE__ */ z(L, { children: [
297
+ /* @__PURE__ */ R(k, {
298
+ id: ae,
299
+ labelProps: { label: g },
300
+ options: ge,
301
+ value: U,
302
+ onChange: $,
303
+ placeholder: v,
304
+ searchable: e.length > Se,
305
+ searchPlaceholder: v,
306
+ onSearchQueryChange: X,
307
+ disabled: l,
308
+ open: J,
309
+ onOpenChange: de,
310
+ fieldClassName: me,
311
+ invalid: Q && U == null,
312
+ error: Q && U == null ? j : void 0
313
+ }),
314
+ /* @__PURE__ */ R(k, {
315
+ labelProps: { label: y },
316
+ id: oe,
317
+ options: _e,
318
+ value: W,
319
+ onChange: Te,
320
+ placeholder: y,
321
+ disabled: l,
322
+ open: Z,
323
+ onOpenChange: fe,
324
+ fieldClassName: he,
325
+ invalid: Q && W == null,
326
+ error: Q && W == null ? j : void 0
327
+ }),
328
+ ve ? /* @__PURE__ */ R(ee, {
329
+ id: ie,
330
+ labelProps: { label: D },
331
+ placeholder: O,
332
+ value: q,
333
+ onChange: (e) => ue(e ?? ""),
334
+ error: Oe ? A : void 0,
335
+ disabled: l
336
+ }) : /* @__PURE__ */ R(N, {
337
+ id: se,
338
+ labelProps: { label: w },
339
+ placeholder: T,
340
+ caption: Q && G.length === 0 ? void 0 : E,
341
+ error: Q && G.length === 0 ? M : void 0,
342
+ invalid: Q && G.length === 0,
343
+ value: G,
344
+ onChange: Ee,
345
+ disabled: l,
346
+ tagClassName: te
347
+ }),
348
+ /* @__PURE__ */ z("div", {
349
+ className: "mt-auto flex justify-end gap-2 desktop:mt-2",
350
+ children: [/* @__PURE__ */ R(h, {
351
+ label: B,
352
+ onClick: c,
353
+ disabled: l
354
+ }), /* @__PURE__ */ R(S, {
355
+ label: P,
356
+ onClick: De,
357
+ disabled: l
358
+ })]
359
+ })
360
+ ] });
361
+ return p ? /* @__PURE__ */ R(o, {
362
+ open: !0,
363
+ onClose: c,
364
+ ariaLabel: re,
365
+ style: m,
366
+ className: ye.sheet,
367
+ bodyClassName: "flex flex-col gap-3 p-4",
368
+ children: Ae
369
+ }) : /* @__PURE__ */ R("div", {
370
+ ref: H,
371
+ role: "group",
372
+ "aria-label": re,
265
373
  tabIndex: -1,
266
- onKeyDown: (e) => {
267
- e.key === "Escape" && (e.stopPropagation(), s());
268
- },
269
- style: _,
270
- className: D("fixed inset-0 z-[60] flex flex-col gap-3 overflow-y-auto p-4", "desktop:static desktop:z-auto desktop:flex-none desktop:overflow-visible desktop:rounded-lg desktop:p-3", Y.dialog),
271
- children: [
272
- /* @__PURE__ */ k(b, {
273
- id: z,
274
- labelProps: { label: v },
275
- options: _e,
276
- value: V,
277
- onChange: (e) => {
278
- se(Array.isArray(e) ? e[0] : e), J(!1);
279
- },
280
- placeholder: y,
281
- searchable: e.length > de,
282
- searchPlaceholder: y,
283
- onSearchQueryChange: pe,
284
- disabled: c,
285
- open: ce,
286
- onOpenChange: J,
287
- fieldClassName: Q,
288
- invalid: Z && V == null,
289
- error: Z && V == null ? N : void 0
290
- }),
291
- /* @__PURE__ */ k(b, {
292
- labelProps: { label: x },
293
- id: ae,
294
- options: ve,
295
- value: H,
296
- onChange: (e) => {
297
- let t = Array.isArray(e) ? e[0] : e;
298
- H === M.Regex != (t === M.Regex) && (G([]), q("")), U(t), me(!1);
299
- },
300
- placeholder: x,
301
- disabled: c,
302
- open: X,
303
- onOpenChange: me,
304
- fieldClassName: ge,
305
- invalid: Z && H == null,
306
- error: Z && H == null ? N : void 0
307
- }),
308
- $ ? /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k(m, {
309
- id: `${R}-input`,
310
- labelProps: { label: ne },
311
- placeholder: re,
312
- value: K,
313
- onChange: (e) => q(e ?? ""),
314
- invalid: (K.length > 0 || Z) && !ye,
315
- "aria-describedby": (K.length > 0 || Z) && !ye ? R : void 0,
316
- disabled: c
317
- }), (K.length > 0 || Z) && !ye && /* @__PURE__ */ k("span", {
318
- id: R,
319
- role: "alert",
320
- className: D("mt-1 block", f, Y.error),
321
- children: ie
322
- })] }) : /* @__PURE__ */ k(ee, {
323
- id: B,
324
- labelProps: { label: O },
325
- placeholder: j,
326
- caption: Z && W.length === 0 ? void 0 : te,
327
- error: Z && W.length === 0 ? P : void 0,
328
- invalid: Z && W.length === 0,
329
- value: W,
330
- onChange: (e) => {
331
- let t = [];
332
- for (let n of e) {
333
- let e = n.trim();
334
- if (!(e.length === 0 || t.includes(e)) && (t.push(e), t.length >= l)) break;
335
- }
336
- G(t);
337
- },
338
- disabled: c,
339
- tagClassName: T
340
- }),
341
- /* @__PURE__ */ A("div", {
342
- className: "mt-auto flex justify-end gap-2 desktop:mt-2",
343
- children: [/* @__PURE__ */ k(d, {
344
- label: I,
345
- onClick: s,
346
- disabled: c
347
- }), /* @__PURE__ */ k(h, {
348
- label: F,
349
- onClick: () => {
350
- if (!be || V == null || H == null) {
351
- he(!0);
352
- return;
353
- }
354
- o({
355
- source: V,
356
- function: H,
357
- targets: $ ? [K.trim()] : W
358
- });
359
- },
360
- disabled: c
361
- })]
362
- })
363
- ]
374
+ onKeyDown: ke,
375
+ style: m,
376
+ className: F("flex flex-none flex-col gap-3 rounded-lg p-3", ye.inline),
377
+ children: Ae
364
378
  });
365
- }, X = {
379
+ }, $ = {
366
380
  ruleRow: "_ruleRow_nx0en_1",
367
381
  heading: "_heading_nx0en_5",
368
382
  hint: "_hint_nx0en_9",
369
383
  loading: "_loading_nx0en_13",
370
384
  ruleText: "_ruleText_nx0en_17"
371
- }, me = 20, Z = (e, t) => e === M.Equal ? t.equal : e === M.Contain ? t.contain : t.regex, he = ({ rules: e, onRulesChange: r, sourceOptions: s, folderName: u, disabled: p = !1, isLoading: m = !1, hasLoadError: h = !1, maxRules: y = me, maxTargetsPerRule: b, labels: x = {}, headingClassName: C = "dial-body-semi-text", hintClassName: ee = "dial-small-text", loadingClassName: w = "dial-small-text", ruleTextClassName: T = "dial-small-text", ruleSourceClassName: O = "dial-small-semi-text", styles: j = {} }) => {
372
- let re = {
373
- ...E({
374
- "--par-rule-bg": j.colors?.ruleBackground,
375
- "--par-heading-text": j.colors?.headingText,
376
- "--par-hint-text": j.colors?.hintText,
377
- "--par-loading-text": j.colors?.loadingText,
378
- "--par-rule-text": j.colors?.ruleText
385
+ }, Te = 20, Ee = (e, t) => e === V.Equal ? t.equal : e === V.Contain ? t.contain : t.regex, De = ({ rules: e, onRulesChange: r, sourceOptions: o, folderName: c, disabled: d = !1, isLoading: f = !1, hasLoadError: p = !1, maxRules: m = Te, maxTargetsPerRule: _, labels: ee = {}, headingClassName: v = "dial-body-semi-text", hintClassName: x = "dial-small-text", loadingClassName: S = "dial-small-text", ruleTextClassName: E = "dial-small-text", ruleSourceClassName: D = "dial-small-semi-text", styles: O = {} }) => {
386
+ let k = {
387
+ ...ne({
388
+ "--par-rule-bg": O.colors?.ruleBackground,
389
+ "--par-heading-text": O.colors?.headingText,
390
+ "--par-hint-text": O.colors?.hintText,
391
+ "--par-loading-text": O.colors?.loadingText,
392
+ "--par-rule-text": O.colors?.ruleText
379
393
  }),
380
- ...j.cssVars
381
- }, { heading: ie = "Allow access if all match", folderScopeHint: M = "These rules apply to \"{folder}\". Selecting another folder loads that folder's own rules instead.", noFolderScopeHint: N = "Access rules apply to the destination folder — pick a folder above to set its rules.", rulesWithoutFolderWarning: P = "These rules have no destination yet. Select a folder above to apply them.", maxRulesReachedLabel: F = "Rule limit reached ({max}). Remove a rule to add another.", addRuleLabel: I = "Add rule", clearAllLabel: L = "Clear all", orSeparatorLabel: R = "Or", removeRuleAriaLabelTemplate: z = "Remove rule for {source}: {targets}", equalFunctionLabel: ae = "Equal", containFunctionLabel: B = "Contain", regexFunctionLabel: oe = "Regex", loadingLabel: V = "Loading existing rules…", loadErrorLabel: se = "Couldn't load existing rules for this folder. You can still add rules manually.", ruleAddedAnnouncement: H = "Rule added.", ruleRemovedAnnouncement: U = "Rule removed.", rulesClearedAnnouncement: W = "All rules cleared.", rulesLoadedAnnouncement: G = "Existing rules loaded for the selected folder.", editorLabels: K } = x, q = n(), [ce, J] = a(!1), [Y, le] = a(""), ue = i(null), de = i(m);
394
+ ...O.cssVars
395
+ }, { heading: A = "Allow access if all match", folderScopeHint: M = "These rules apply to \"{folder}\". Selecting another folder loads that folder's own rules instead.", noFolderScopeHint: N = "Access rules apply to the destination folder — pick a folder above to set its rules.", rulesWithoutFolderWarning: P = "These rules have no destination yet. Select a folder above to apply them.", maxRulesReachedLabel: te = "Rule limit reached ({max}). Remove a rule to add another.", addRuleLabel: I = "Add rule", clearAllLabel: L = "Clear all", orSeparatorLabel: B = "Or", removeRuleAriaLabelTemplate: re = "Remove rule for {source}: {targets}", equalFunctionLabel: oe = "Equal", containFunctionLabel: se = "Contain", regexFunctionLabel: V = "Regex", loadingLabel: H = "Loading existing rules…", loadErrorLabel: U = "Couldn't load existing rules for this folder. You can still add rules manually.", ruleAddedAnnouncement: ce = "Rule added.", ruleRemovedAnnouncement: W = "Rule removed.", rulesClearedAnnouncement: le = "All rules cleared.", rulesLoadedAnnouncement: G = "Existing rules loaded for the selected folder.", editorLabels: K } = ee, q = n(), [ue, J] = a(!1), [de, Y] = a(""), X = i(null), Z = i(f);
382
396
  t(() => {
383
- de.current && !m && e.length > 0 && le(G), de.current = m;
397
+ Z.current && !f && e.length > 0 && Y(G), Z.current = f;
384
398
  }, [
385
- m,
399
+ f,
386
400
  e,
387
401
  G
388
402
  ]);
389
403
  let fe = () => {
390
- ue.current = document.activeElement, J(!0);
404
+ X.current = document.activeElement, J(!0);
405
+ }, Q = () => {
406
+ J(!1), X.current?.focus?.();
407
+ }, pe = (t) => {
408
+ r([...e, t]), Y(ce), Q();
409
+ }, me = (t) => {
410
+ r(e.filter((e, n) => n !== t)), Y(W);
391
411
  }, he = () => {
392
- J(!1), ue.current?.focus?.();
393
- }, Q = (t) => {
394
- r([...e, t]), le(H), he();
395
- }, ge = (t) => {
396
- r(e.filter((e, n) => n !== t)), le(U);
397
- }, _e = () => {
398
- r([]), le(W);
399
- }, ve = {
400
- equal: ae,
401
- contain: B,
402
- regex: oe
403
- }, $ = e.length >= y, ye = p || $, be = u != null && u !== "";
404
- return /* @__PURE__ */ A("div", {
412
+ r([]), Y(le);
413
+ }, ge = {
414
+ equal: oe,
415
+ contain: se,
416
+ regex: V
417
+ }, _e = e.length >= m, ve = d || _e, ye = c != null && c !== "";
418
+ return /* @__PURE__ */ z("div", {
405
419
  role: "group",
406
420
  "aria-labelledby": q,
407
- style: re,
408
- className: D(p && "pointer-events-none opacity-60"),
421
+ style: k,
422
+ className: F(d && "pointer-events-none opacity-60"),
409
423
  children: [
410
- /* @__PURE__ */ k("span", {
411
- role: "status",
412
- "aria-live": "polite",
413
- className: "sr-only",
414
- children: Y
424
+ /* @__PURE__ */ R(y, {
425
+ visuallyHidden: !0,
426
+ as: b.Span,
427
+ children: de
415
428
  }),
416
- /* @__PURE__ */ A("div", {
429
+ /* @__PURE__ */ z("div", {
417
430
  className: "mb-1 flex items-center justify-between gap-2",
418
- children: [/* @__PURE__ */ k("div", {
431
+ children: [/* @__PURE__ */ R("div", {
419
432
  id: q,
420
- className: D(C, X.heading),
421
- children: ie
422
- }), e.length > 0 && /* @__PURE__ */ k(d, {
423
- variant: o.Primary,
433
+ className: F(v, $.heading),
434
+ children: A
435
+ }), e.length > 0 && /* @__PURE__ */ R(h, {
436
+ variant: s.Primary,
424
437
  label: L,
425
- onClick: _e,
426
- disabled: p
438
+ onClick: he,
439
+ disabled: d
427
440
  })]
428
441
  }),
429
- /* @__PURE__ */ k("p", {
430
- className: D("mb-2", ee, X.hint),
431
- children: be ? M.replace("{folder}", u) : N
442
+ /* @__PURE__ */ R("p", {
443
+ className: F("mb-2", x, $.hint),
444
+ children: ye ? M.replace("{folder}", c) : N
432
445
  }),
433
- e.length > 0 && !be && /* @__PURE__ */ k("div", {
446
+ e.length > 0 && !ye && /* @__PURE__ */ R("div", {
434
447
  className: "mb-2",
435
- children: /* @__PURE__ */ k(g, {
436
- type: _.SectionMessage,
437
- variant: v.Warning,
448
+ children: /* @__PURE__ */ R(C, {
449
+ type: w.SectionMessage,
450
+ variant: T.Warning,
438
451
  message: P
439
452
  })
440
453
  }),
441
- m && /* @__PURE__ */ A("div", {
442
- className: D("mb-2 flex items-center gap-2", w, X.loading),
443
- children: [/* @__PURE__ */ k(S, {
454
+ f && /* @__PURE__ */ z("div", {
455
+ className: F("mb-2 flex items-center gap-2", S, $.loading),
456
+ children: [/* @__PURE__ */ R(j, {
444
457
  size: 16,
445
- ariaLabel: V
446
- }), /* @__PURE__ */ k("span", { children: V })]
458
+ ariaLabel: H
459
+ }), /* @__PURE__ */ R("span", { children: H })]
447
460
  }),
448
- h && /* @__PURE__ */ k("div", {
461
+ p && /* @__PURE__ */ R("div", {
449
462
  className: "mb-2",
450
- children: /* @__PURE__ */ k(g, {
451
- type: _.SectionMessage,
452
- variant: v.Warning,
453
- message: se
463
+ children: /* @__PURE__ */ R(C, {
464
+ type: w.SectionMessage,
465
+ variant: T.Warning,
466
+ message: U
454
467
  })
455
468
  }),
456
- e.length > 0 && /* @__PURE__ */ k("ul", {
469
+ e.length > 0 && /* @__PURE__ */ R("ul", {
457
470
  className: "mb-3 flex flex-col gap-2",
458
471
  children: e.map((e, t) => {
459
- let n = e.targets.join(` ${R} `), r = z.replace("{source}", e.source).replace("{targets}", n);
460
- return /* @__PURE__ */ A("li", {
461
- className: D("flex items-center justify-between gap-2 rounded-lg px-3 py-2", X.ruleRow),
462
- children: [/* @__PURE__ */ A("span", {
463
- className: D("truncate", T, X.ruleText),
472
+ let n = e.targets.join(` ${B} `), r = re.replace("{source}", e.source).replace("{targets}", n);
473
+ return /* @__PURE__ */ z("li", {
474
+ className: F("flex items-center justify-between gap-2 rounded-lg px-3 py-2", $.ruleRow),
475
+ children: [/* @__PURE__ */ z("span", {
476
+ className: F("truncate", E, $.ruleText),
464
477
  children: [
465
- /* @__PURE__ */ k("span", {
466
- className: O,
478
+ /* @__PURE__ */ R("span", {
479
+ className: D,
467
480
  children: e.source
468
481
  }),
469
482
  " ",
470
- Z(e.function, ve),
483
+ Ee(e.function, ge),
471
484
  ": ",
472
485
  n
473
486
  ]
474
- }), /* @__PURE__ */ k(f, {
475
- icon: /* @__PURE__ */ k(ne, {
476
- size: c.SM,
487
+ }), /* @__PURE__ */ R(g, {
488
+ icon: /* @__PURE__ */ R(ae, {
489
+ size: l.SM,
477
490
  "aria-hidden": !0,
478
- stroke: l
491
+ stroke: u
479
492
  }),
480
493
  "aria-label": r,
481
- onClick: () => ge(t),
482
- disabled: p
494
+ onClick: () => me(t),
495
+ disabled: d
483
496
  })]
484
497
  }, t);
485
498
  })
486
499
  }),
487
- ce && /* @__PURE__ */ k(pe, {
488
- sourceOptions: s,
489
- onSave: Q,
490
- onCancel: he,
491
- disabled: p,
492
- maxTargets: b,
500
+ ue && /* @__PURE__ */ R(we, {
501
+ sourceOptions: o,
502
+ onSave: pe,
503
+ onCancel: Q,
504
+ disabled: d,
505
+ maxTargets: _,
493
506
  labels: K,
494
- styles: j.editor
507
+ styles: O.editor
495
508
  }),
496
- /* @__PURE__ */ k("div", {
509
+ /* @__PURE__ */ R("div", {
497
510
  className: "flex flex-wrap items-center gap-2",
498
- children: /* @__PURE__ */ k(d, {
511
+ children: /* @__PURE__ */ R(h, {
499
512
  label: I,
500
- iconBefore: /* @__PURE__ */ k(te, {
501
- size: c.SM,
513
+ iconBefore: /* @__PURE__ */ R(ie, {
514
+ size: l.SM,
502
515
  "aria-hidden": !0,
503
- stroke: l
516
+ stroke: u
504
517
  }),
505
518
  onClick: fe,
506
- disabled: ye
519
+ disabled: ve
507
520
  })
508
521
  }),
509
- $ && /* @__PURE__ */ k("p", {
510
- className: D("mt-2", ee, X.hint),
511
- children: F.replace("{max}", String(y))
522
+ _e && /* @__PURE__ */ R("p", {
523
+ className: F("mt-2", x, $.hint),
524
+ children: te.replace("{max}", String(m))
512
525
  })
513
526
  ]
514
527
  });
515
- }, Q = {
528
+ }, Oe = {
516
529
  currentBadge: "_currentBadge_d0adf_1",
517
530
  sharedCredentialsBadge: "_sharedCredentialsBadge_d0adf_7",
518
531
  version: "_version_d0adf_13",
519
532
  date: "_date_d0adf_17",
520
533
  emptyState: "_emptyState_d0adf_21",
521
534
  stripedRow: "_stripedRow_d0adf_25"
522
- }, ge = ({ 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 }) => {
523
- let m = E({
535
+ }, ke = ({ 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 }) => {
536
+ let m = ne({
524
537
  "--phl-badge-border": p?.currentBadgeBorder,
525
538
  "--phl-badge-bg": p?.currentBadgeBackground,
526
539
  "--phl-badge-text": p?.currentBadgeText,
@@ -531,348 +544,468 @@ var M = /* @__PURE__ */ function(e) {
531
544
  "--phl-date-text": p?.dateText,
532
545
  "--phl-empty-text": p?.emptyStateText,
533
546
  "--phl-striped-bg": p?.stripedBackground
534
- }), h = D(f, Q.emptyState);
535
- return n ? /* @__PURE__ */ k("p", {
536
- style: m,
537
- className: h,
538
- children: c
539
- }) : r ? /* @__PURE__ */ k("p", {
540
- style: m,
541
- className: h,
542
- role: "alert",
543
- children: l
544
- }) : e.length === 0 ? /* @__PURE__ */ k("p", {
545
- style: m,
546
- className: h,
547
- children: s
548
- }) : /* @__PURE__ */ k("ul", {
547
+ }), h = F(f, Oe.emptyState);
548
+ if (n || r || e.length === 0) {
549
+ let e = s;
550
+ return n ? e = c : r && (e = l), /* @__PURE__ */ R(y, {
551
+ as: b.P,
552
+ style: m,
553
+ className: h,
554
+ children: e
555
+ });
556
+ }
557
+ return /* @__PURE__ */ R("ul", {
549
558
  style: m,
550
- children: e.map((e, n) => /* @__PURE__ */ A("li", {
551
- className: D("flex items-center justify-between gap-2 rounded-lg px-3 py-[11px]", n % 2 == 0 && Q.stripedRow),
552
- children: [/* @__PURE__ */ A("span", {
559
+ children: e.map((e, n) => /* @__PURE__ */ z("li", {
560
+ className: F("flex items-center justify-between gap-2 rounded-lg px-3 py-[11px]", n % 2 == 0 && Oe.stripedRow),
561
+ children: [/* @__PURE__ */ z("span", {
553
562
  className: "flex min-w-0 items-center gap-2",
554
563
  style: m,
555
564
  children: [
556
- /* @__PURE__ */ A("span", {
557
- className: D(u, Q.version),
565
+ /* @__PURE__ */ z("span", {
566
+ className: F(u, Oe.version),
558
567
  children: [
559
568
  i,
560
569
  " ",
561
570
  e.version
562
571
  ]
563
572
  }),
564
- e.version === t && /* @__PURE__ */ k(C, {
573
+ e.version === t && /* @__PURE__ */ R(M, {
565
574
  label: a,
566
- className: D("shrink-0 whitespace-nowrap", Q.currentBadge)
575
+ className: F("shrink-0 whitespace-nowrap", Oe.currentBadge)
567
576
  }),
568
- e.publishCredentials === !0 && /* @__PURE__ */ k(C, {
577
+ e.publishCredentials === !0 && /* @__PURE__ */ R(M, {
569
578
  label: o,
570
- className: D("shrink-0 whitespace-nowrap", Q.sharedCredentialsBadge)
579
+ className: F("shrink-0 whitespace-nowrap", Oe.sharedCredentialsBadge)
571
580
  })
572
581
  ]
573
- }), /* @__PURE__ */ k("span", {
574
- className: D(d, Q.date),
575
- children: I(e.publishedAt)
582
+ }), /* @__PURE__ */ R("span", {
583
+ className: F(d, Oe.date),
584
+ children: W(e.publishedAt)
576
585
  })]
577
586
  }, `${e.version}-${n}`))
578
587
  });
579
- }, _e = {
588
+ }, Ae = ":", je = (e) => `${Ae}${e}`, Me = (e) => e?.startsWith(Ae) ? e.slice(1) : void 0, Ne = (e) => [je(e.rootKey), ...e.path], Pe = (e) => {
589
+ let [t, ...n] = e, r = Me(t);
590
+ return r == null ? void 0 : {
591
+ rootKey: r,
592
+ path: n
593
+ };
594
+ }, Fe = (e, t) => e.map((e) => ({
595
+ ...e,
596
+ path: [t, ...e.path],
597
+ children: e.children ? Fe(e.children, t) : void 0
598
+ })), Ie = (e) => e.map((e) => {
599
+ let t = je(e.key);
600
+ return {
601
+ path: [t],
602
+ name: e.label,
603
+ children: Fe(Y(e.items), t)
604
+ };
605
+ }), Le = (e) => e.map((e) => je(e.key)), Re = (e, t) => {
606
+ let n = /* @__PURE__ */ new Set();
607
+ for (let r of e) {
608
+ let e = je(r.key);
609
+ for (let i of t(r) ?? []) n.add(i ? `${e}/${i}` : e);
610
+ }
611
+ return n;
612
+ }, ze = (e, t) => {
613
+ let n = new Map(e.map((e) => [e.key, /* @__PURE__ */ new Set()]));
614
+ for (let e of t) {
615
+ let [t, ...r] = e.split("/"), i = Me(t);
616
+ i != null && r.length !== 0 && n.get(i)?.add(Q(r));
617
+ }
618
+ return n;
619
+ }, Be = {
580
620
  divider: "_divider_1gs31_1",
581
621
  tree: "_tree_1gs31_17"
582
- }, ve = ({ items: e, selectedPath: t, onSelectedPathChange: n, onCreateFolder: o, searchQuery: s, disabled: u = !1, createFolderLabel: f = "Create new folder", cancelCreatingFolderLabel: p = "Cancel", addSiblingFolderLabel: m = "Add sibling", addChildFolderLabel: h = "Add child", newFolderDefaultName: g = "New folder", noResultsLabel: _ = "No folders match \"{query}\".", emptyFolderNameError: v = "Folder name cannot be empty.", invalidFolderNameError: y = "Folder name contains invalid characters.", duplicateFolderNameError: b = "A folder with this name already exists.", rootLabel: x = "Organization", expandedPaths: S, onExpandedPathsChange: C, loadingPaths: ee, styles: w = {} }) => {
583
- let T = {
584
- ...E({ "--pft-divider": w.colors?.divider }),
585
- ...w.cssVars
586
- }, [O, ne] = a(() => new Set(t?.map((e, n) => U(t.slice(0, n + 1))) ?? [])), M = S ?? O, N = (e) => {
622
+ }, Ve = "data-cancel-creating-folder", He = "", Ue = [], We = ({ items: e = Ue, selectedPath: n, onSelectedPathChange: o, onCreateFolder: s, roots: c, destination: d, onDestinationChange: f, onCreateDestinationFolder: p, searchQuery: m, disabled: g = !1, createFolderLabel: _ = "Create new folder", cancelCreatingFolderLabel: ee = "Cancel", addSiblingFolderLabel: v = "Add sibling", addChildFolderLabel: y = "Add child", newFolderDefaultName: b = "New folder", noResultsLabel: x = "No folders match \"{query}\".", emptyFolderNameError: S = "Folder name cannot be empty.", invalidFolderNameError: C = "Folder name contains invalid characters.", duplicateFolderNameError: w = "A folder with this name already exists.", rootLabel: T = "Organization", expandedPaths: E, onExpandedPathsChange: D, loadingPaths: O, styles: k = {} }) => {
623
+ let A = {
624
+ ...ne({ "--pft-divider": k.colors?.divider }),
625
+ ...k.cssVars
626
+ }, j = c != null, M = r(() => c ? Ie(c) : e, [c, e]), N = r(() => c ? Le(c) : [He], [c]), P = n;
627
+ j && (P = d ? Ne(d) : void 0);
628
+ let te = (e) => {
629
+ j ? f?.(e ? Pe(e) : void 0) : o?.(e);
630
+ }, [I, L] = a(() => new Set(P?.map((e, t) => Q(P.slice(0, t + 1))) ?? [])), B = r(() => c ? /* @__PURE__ */ new Set([...I, ...Re(c, (e) => e.expandedPaths)]) : void 0, [c, I]) ?? E ?? I, ae = r(() => c ? Re(c, (e) => e.loadingPaths) : O, [c, O]), V = (e) => {
587
631
  let t = new Set(e);
588
- t.delete(""), C ? C(t) : ne(t);
589
- }, [P, F] = a(null), [I, L] = a(g), R = i(null), z = s.trim(), B = P != null, V = r(() => ae(e, s), [e, s]), se = z.length > 0 && V.length === 0, K = !B && z.length > 0, Y = r(() => oe(K ? V : e), [
590
- K,
591
- V,
592
- e
593
- ]), le = r(() => new Set(["", ...H(Y)]), [Y]), ue = r(() => new Set(["", ...K ? le : M]), [
594
- K,
595
- le,
596
- M
597
- ]), de = r(() => G(Y), [Y]), fe = r(() => K && de.length === 0 ? [] : [{
598
- path: "",
599
- name: x,
600
- folderId: "",
601
- nodeType: re.FOLDER,
602
- items: de
632
+ for (let e of N) t.delete(e);
633
+ if (c) {
634
+ L(t);
635
+ let e = ze(c, t);
636
+ for (let t of c) t.onExpandedPathsChange?.(e.get(t.key) ?? /* @__PURE__ */ new Set());
637
+ } else D ? D(t) : L(t);
638
+ }, [H, U] = a(null), [ce, W] = a(b), le = i(null), G = i(!1);
639
+ t(() => {
640
+ let e = (e) => {
641
+ e.target instanceof Element && e.target.closest(`[${Ve}]`) && (G.current = !0);
642
+ };
643
+ return document.addEventListener("pointerdown", e, !0), () => document.removeEventListener("pointerdown", e, !0);
644
+ }, []);
645
+ let K = m.trim(), q = H != null, ue = r(() => J(M, m), [M, m]), de = K.length > 0 && ue.length === 0, X = !q && K.length > 0, Z = r(() => {
646
+ let e = X ? ue : M;
647
+ return j ? e : Y(e);
648
+ }, [
649
+ X,
650
+ ue,
651
+ M,
652
+ j
653
+ ]), he = r(() => /* @__PURE__ */ new Set([...N, ...fe(Z)]), [N, Z]), ye = r(() => /* @__PURE__ */ new Set([...N, ...X ? he : B]), [
654
+ N,
655
+ X,
656
+ he,
657
+ B
658
+ ]), be = r(() => me(Z), [Z]), xe = r(() => X && be.length === 0 ? [] : j ? be : [{
659
+ path: He,
660
+ name: T,
661
+ folderId: He,
662
+ nodeType: oe.FOLDER,
663
+ items: be
603
664
  }], [
604
- de,
605
- x,
606
- K
607
- ]), pe = P ? U(P) : null, X = {
608
- empty: v,
609
- invalid: y,
610
- duplicate: b
611
- }, me = (t) => ce(se && q(z, [], X) == null ? z : g, J(e, t)), Z = (e) => {
612
- F(e), L(me(e)), R.current = null;
613
- let t = U(e);
614
- t && N(new Set(M).add(t));
615
- }, he = () => Z(t ?? []), Q = (e) => {
616
- let t = W(e.path), n = [{
665
+ be,
666
+ T,
667
+ X,
668
+ j
669
+ ]), Se = H ? Q(H) : null, Ce = {
670
+ empty: S,
671
+ invalid: C,
672
+ duplicate: w
673
+ }, we = (e) => {
674
+ if (!c) return !0;
675
+ let t = Pe(e), n = c.find((e) => e.key === t?.rootKey);
676
+ return n != null && n.canCreateFolders !== !1;
677
+ }, $ = (() => {
678
+ if (!c) return P ?? [];
679
+ if (P && we(P)) return P;
680
+ let e = c.find((e) => e.canCreateFolders !== !1);
681
+ return e ? Ne({
682
+ rootKey: e.key,
683
+ path: []
684
+ }) : void 0;
685
+ })(), Te = (e) => _e(de && ge(K, [], Ce) == null ? K : b, ve(M, e)), Ee = (e) => {
686
+ U(e), W(Te(e)), le.current = null, G.current = !1;
687
+ let t = Q(e);
688
+ t && V(new Set(B).add(t));
689
+ }, De = () => {
690
+ $ && Ee($);
691
+ }, Oe = (e) => {
692
+ let t = pe(e.path);
693
+ if (!we(t)) return [];
694
+ let n = [{
617
695
  key: "add-child",
618
- label: h,
619
- icon: /* @__PURE__ */ k(j, {
620
- size: c.SM,
696
+ label: y,
697
+ icon: /* @__PURE__ */ R(re, {
698
+ size: l.SM,
621
699
  "aria-hidden": !0,
622
- stroke: l
700
+ stroke: u
623
701
  }),
624
- onClick: () => Z(t)
702
+ onClick: () => Ee(t)
625
703
  }];
626
- return e.path !== "" && n.push({
704
+ return N.includes(e.path) || n.push({
627
705
  key: "add-sibling",
628
- label: m,
629
- icon: /* @__PURE__ */ k(te, {
630
- size: c.SM,
706
+ label: v,
707
+ icon: /* @__PURE__ */ R(ie, {
708
+ size: l.SM,
631
709
  "aria-hidden": !0,
632
- stroke: l
710
+ stroke: u
633
711
  }),
634
- onClick: () => Z(t.slice(0, -1))
712
+ onClick: () => Ee(t.slice(0, -1))
635
713
  }), n;
636
- }, ge = (t) => {
637
- if (!P) return null;
638
- let n = q(t, J(e, P), X);
639
- return R.current = n, n;
640
- }, ve = (e) => {
641
- if (!P) return;
642
- let t = e.trim(), r = R.current;
643
- (ge(e) ?? r) || (o(P, t), n([...P, t])), F(null);
644
- }, $ = () => F(null);
645
- return /* @__PURE__ */ A("div", {
646
- style: T,
647
- className: D(u && "pointer-events-none opacity-60", w.className),
714
+ }, ke = (e) => {
715
+ if (!H) return null;
716
+ let t = ge(e, ve(M, H), Ce);
717
+ return le.current = t, t;
718
+ }, Ae = (e) => {
719
+ if (!H || G.current) return;
720
+ let t = e.trim(), n = le.current;
721
+ if (!(ke(e) ?? n)) {
722
+ let e = c ? Pe(H) : void 0;
723
+ e ? p?.(e.rootKey, e.path, t) : s?.(H, t), te([...H, t]);
724
+ }
725
+ U(null);
726
+ }, je = () => U(null);
727
+ return /* @__PURE__ */ z("div", {
728
+ style: A,
729
+ className: F(g && "pointer-events-none opacity-60", k.className),
648
730
  children: [
649
- /* @__PURE__ */ k("div", {
650
- className: D("w-full min-w-0 max-w-full", _e.tree),
651
- children: /* @__PURE__ */ k(ie, {
652
- items: fe,
731
+ /* @__PURE__ */ R("div", {
732
+ className: F("w-full max-w-full min-w-0", Be.tree),
733
+ children: /* @__PURE__ */ R(se, {
734
+ items: xe,
653
735
  showFiles: !1,
654
- selectedPath: t == null ? void 0 : U(t),
655
- expandedPaths: ue,
656
- onExpandedPathsChange: N,
657
- loadingPaths: ee,
736
+ selectedPath: P == null ? void 0 : Q(P),
737
+ expandedPaths: ye,
738
+ onExpandedPathsChange: V,
739
+ loadingPaths: ae,
658
740
  onItemClick: (e) => {
659
- n(t != null && U(t) === e.path ? void 0 : W(e.path));
741
+ let t = P != null && Q(P) === e.path;
742
+ te(t ? void 0 : pe(e.path));
660
743
  },
661
- getContextMenuItems: Q,
662
- createdFolderPath: pe,
663
- newFolderDefaultName: I,
664
- onCreateFolderSave: ve,
665
- onCreateFolderCancel: $,
666
- onRenameValidate: (e) => ge(e),
667
- emptyStateTitle: K ? _.replace("{query}", z) : void 0
744
+ getContextMenuItems: Oe,
745
+ createdFolderPath: Se,
746
+ newFolderDefaultName: ce,
747
+ onCreateFolderSave: Ae,
748
+ onCreateFolderCancel: je,
749
+ onRenameValidate: (e) => ke(e),
750
+ emptyStateTitle: X ? x.replace("{query}", K) : void 0
668
751
  })
669
752
  }),
670
- /* @__PURE__ */ k("div", {
671
- className: D("my-2 h-px", _e.divider),
753
+ /* @__PURE__ */ R("div", {
754
+ className: F("my-2 h-px", Be.divider),
672
755
  "aria-hidden": !0
673
756
  }),
674
- /* @__PURE__ */ A("div", {
757
+ /* @__PURE__ */ z("div", {
675
758
  className: "mb-4 flex flex-wrap items-center gap-2",
676
- children: [/* @__PURE__ */ k(d, {
677
- onClick: he,
678
- label: f,
679
- iconBefore: /* @__PURE__ */ k(te, {
680
- size: c.SM,
759
+ children: [/* @__PURE__ */ R(h, {
760
+ onClick: De,
761
+ label: _,
762
+ iconBefore: /* @__PURE__ */ R(ie, {
763
+ size: l.SM,
681
764
  "aria-hidden": !0,
682
- stroke: l
765
+ stroke: u
683
766
  }),
684
- disabled: u || B
685
- }), B && /* @__PURE__ */ k(d, {
686
- label: p,
687
- onClick: $,
688
- disabled: u
767
+ disabled: g || q || !$
768
+ }), q && /* @__PURE__ */ R(h, {
769
+ label: ee,
770
+ onClick: je,
771
+ disabled: g,
772
+ [Ve]: ""
689
773
  })]
690
774
  })
691
775
  ]
692
776
  });
693
- }, $ = { panel: "dial-publish-panel-panel" }, ye = {
694
- summaryTitle: "_summaryTitle_tf20a_1",
695
- sectionHeading: "_sectionHeading_tf20a_5"
696
- }, be = 200, xe = ({ resource: e, renderSummary: t, folderItems: i, selectedFolderPath: o, onSelectedFolderPathChange: c, onCreateFolder: l, expandedPaths: u, onExpandedPathsChange: d, loadingPaths: f, hasExistingPublicationInFolder: p, hasWriteAccess: h, isSubmitting: v, hasSubmitError: b = !1, allowReplace: x = !0, author: S, onAuthorChange: C, publishCredentials: ee = !1, onPublishCredentialsChange: T, rules: O, onRulesChange: j, ruleSourceOptions: te, isRulesLoading: ne = !1, hasRulesLoadError: re = !1, labels: ie = {}, summaryTitleClassName: M = "dial-body-semi-text", headingClassName: F = "dial-body-semi-text", styles: I = {} }) => {
697
- let { colors: L, folderTree: R, accessRules: z } = I, ae = {
698
- ...E({
699
- "--pp-summary-title-text": L?.summaryTitleText,
700
- "--pp-heading-text": L?.headingText
777
+ }, Ge = { panel: "dial-publish-panel-panel" }, Ke = {
778
+ summaryTitle: "_summaryTitle_zj3gd_1",
779
+ sectionHeading: "_sectionHeading_zj3gd_5",
780
+ destination: "_destination_zj3gd_9"
781
+ }, qe = 200, Je = ({ view: e = q.Main, onChangeFolderClick: o, resource: s, renderSummary: d, folderItems: p, selectedFolderPath: g, pendingFolderPath: _, onPendingFolderPathChange: v, onCreateFolder: y, expandedPaths: b, onExpandedPathsChange: x, loadingPaths: S, hasExistingPublicationInFolder: T, hasWriteAccess: E, isSubmitting: D, hasSubmitError: k = !1, allowReplace: A = !0, author: j, onAuthorChange: M, publishCredentials: N = !1, onPublishCredentialsChange: te, rules: I, onRulesChange: L, ruleSourceOptions: re, isRulesLoading: ie = !1, hasRulesLoadError: ae = !1, labels: oe = {}, summaryTitleClassName: se = "dial-body-semi-text", headingClassName: V = "dial-body-semi-text", destinationClassName: ce = "dial-small-semi-text", calloutFolderNameClassName: W = "dial-small-paragraph-semi-text", styles: le = {} }) => {
782
+ let { colors: G, folderTree: K, accessRules: ue } = le, J = {
783
+ ...ne({
784
+ "--pp-summary-title-text": G?.summaryTitleText,
785
+ "--pp-heading-text": G?.headingText,
786
+ "--pp-destination-text": G?.destinationText
701
787
  }),
702
- ...I.cssVars
703
- }, B = {
704
- border: L?.summaryBorder,
705
- background: L?.summaryBackground,
706
- versionTagBorder: L?.summaryVersionTagBorder,
707
- versionTagBackground: L?.summaryVersionTagBackground,
708
- versionTagText: L?.summaryVersionTagText
709
- }, { folderLabel: oe = "Publish to folder", replaceWarning: V = "Version {version} is already published in {folder}. Publishing will replace it.", noAccessError: se = "You don't have permission to publish to {folder}. Pick another, or ask an owner for access.", submitError: H = "Publishing failed. Please try again.", folderEmptyStateLabel: U, addSiblingFolderLabel: W, addChildFolderLabel: G, cancelCreatingFolderLabel: K, createFolderEmptyNameError: q, createFolderInvalidNameError: ce, createFolderDuplicateNameError: J, rootFolderLabel: Y = "Organization", summaryVersionLabel: le, accessRulesLabels: ue, searchPlaceholder: de, clearSearchAriaLabel: fe, authorLabel: pe = "Author", authorPlaceholder: X = "Author name", authorHint: me = "Shown as the publication’s author. Defaults to you — replace it to credit a team instead.", credentialsLabel: Z = "Publish with my credentials", credentialsHint: Q = "Members will use this without signing in themselves. Your credential itself is never shown to them." } = ie, [ge, _e] = a(""), xe = n(), Ce = (e) => {
710
- _e(e ?? "");
711
- }, Te = o != null, Ee = r(() => P({
712
- hasSelectedFolder: Te,
713
- hasExistingPublicationInFolder: p,
714
- hasWriteAccess: h,
715
- isSubmitting: v,
716
- hasSubmitError: b,
717
- allowReplace: x
788
+ ...le.cssVars
789
+ }, de = {
790
+ border: G?.summaryBorder,
791
+ background: G?.summaryBackground
792
+ }, { folderLabel: Y = "Publish to folder", destinationAriaLabel: X = "Destination folder", noFolderSelectedLabel: Z = "No folder selected", changeFolderLabel: fe = "Change", chooseFolderLabel: Q = "Choose", replaceWarning: pe = "Version {version} is already published in {folder}. Publishing will replace it.", noAccessError: me = "You don't have permission to publish to {folder}. Pick another, or ask an owner for access.", submitError: he = "Publishing failed. Please try again.", folderEmptyStateLabel: ge, addSiblingFolderLabel: _e, addChildFolderLabel: ve, cancelCreatingFolderLabel: ye, createFolderEmptyNameError: be, createFolderInvalidNameError: xe, createFolderDuplicateNameError: Se, rootFolderLabel: Ce = "Organization", accessRulesLabels: we, searchPlaceholder: $, clearSearchAriaLabel: Te, authorLabel: Ee = "Author", authorPlaceholder: Oe = "Author name", authorHint: ke = "Shown as the publication’s author. Defaults to you — replace it to credit a team instead.", credentialsLabel: Ae = "Publish with my credentials", credentialsHint: je = "Members will use this without signing in themselves. Your credential itself is never shown to them." } = oe, [Me, Ne] = a(""), Pe = n(), Fe = i(null), Ie = i(null), Le = (e) => {
793
+ Ne(e ?? "");
794
+ }, Re = i(e);
795
+ t(() => {
796
+ Re.current !== e && (Re.current = e, e === q.ChangeFolder ? Ie.current?.focus({ preventScroll: !0 }) : Fe.current?.focus({ preventScroll: !0 }));
797
+ }, [e]);
798
+ let ze = g != null, Be = r(() => U({
799
+ hasSelectedFolder: ze,
800
+ hasExistingPublicationInFolder: T,
801
+ hasWriteAccess: E,
802
+ isSubmitting: D,
803
+ hasSubmitError: k,
804
+ allowReplace: A
718
805
  }), [
719
- Te,
720
- p,
721
- h,
722
- v,
723
- b,
724
- x
725
- ]), De = Te ? o[o.length - 1] ?? Y : "", Oe = t ? t() : /* @__PURE__ */ k("span", {
726
- className: D("truncate", M, ye.summaryTitle),
727
- children: e?.title
806
+ ze,
807
+ T,
808
+ E,
809
+ D,
810
+ k,
811
+ A
812
+ ]), Ve = ze ? g[g.length - 1] ?? Ce : "", He = d ? d() : /* @__PURE__ */ R("span", {
813
+ className: F("truncate", se, Ke.summaryTitle),
814
+ children: s?.title
815
+ });
816
+ if (e === q.ChangeFolder) return /* @__PURE__ */ z("div", {
817
+ ref: Ie,
818
+ tabIndex: -1,
819
+ role: "group",
820
+ "aria-label": Y,
821
+ className: F("flex flex-col gap-3 outline-none", Ge.panel),
822
+ style: J,
823
+ children: [/* @__PURE__ */ R("div", {
824
+ role: "search",
825
+ children: /* @__PURE__ */ R(O, {
826
+ value: Me,
827
+ onChange: Le,
828
+ placeholder: $,
829
+ clearLabel: Te,
830
+ "aria-label": $
831
+ })
832
+ }), /* @__PURE__ */ R(We, {
833
+ items: p,
834
+ selectedPath: _,
835
+ onSelectedPathChange: v,
836
+ onCreateFolder: y,
837
+ expandedPaths: b,
838
+ onExpandedPathsChange: x,
839
+ loadingPaths: S,
840
+ searchQuery: Me,
841
+ disabled: D,
842
+ noResultsLabel: ge,
843
+ addSiblingFolderLabel: _e,
844
+ addChildFolderLabel: ve,
845
+ cancelCreatingFolderLabel: ye,
846
+ emptyFolderNameError: be,
847
+ invalidFolderNameError: xe,
848
+ duplicateFolderNameError: Se,
849
+ rootLabel: Ce,
850
+ styles: K
851
+ })]
728
852
  });
729
- return /* @__PURE__ */ A("div", {
730
- className: D("flex flex-col gap-5", $.panel),
731
- style: ae,
732
- children: [e?.type == null ? /* @__PURE__ */ k(w, {
733
- colors: B,
734
- children: Oe
735
- }) : /* @__PURE__ */ k(w, {
853
+ let Ue = F(ce, Ke.destination);
854
+ return /* @__PURE__ */ z("div", {
855
+ className: F("flex flex-col gap-5", Ge.panel),
856
+ style: J,
857
+ children: [s?.type == null ? /* @__PURE__ */ R(P, {
858
+ colors: de,
859
+ children: He
860
+ }) : /* @__PURE__ */ R(P, {
736
861
  item: {
737
- type: e.type,
738
- name: e.title,
739
- version: e.version ?? "",
740
- iconUrl: e.iconUrl
862
+ type: s.type,
863
+ name: s.title,
864
+ version: s.version ?? "",
865
+ iconUrl: s.iconUrl
741
866
  },
742
- versionLabel: le,
743
- colors: B
744
- }), /* @__PURE__ */ A("div", { children: [
745
- /* @__PURE__ */ k("div", {
746
- className: D("mb-2", F, ye.sectionHeading),
747
- children: oe
748
- }),
749
- /* @__PURE__ */ k("div", {
750
- role: "search",
751
- className: "mb-3",
752
- children: /* @__PURE__ */ k(y, {
753
- value: ge,
754
- onChange: Ce,
755
- placeholder: de,
756
- clearLabel: fe,
757
- "aria-label": de
758
- })
867
+ hasVersionTag: !1,
868
+ colors: de
869
+ }), /* @__PURE__ */ z("section", { children: [
870
+ /* @__PURE__ */ R("h2", {
871
+ className: F("mb-2", V, Ke.sectionHeading),
872
+ children: Y
759
873
  }),
760
- /* @__PURE__ */ k(ve, {
761
- items: i,
762
- selectedPath: o,
763
- onSelectedPathChange: c,
764
- onCreateFolder: l,
765
- expandedPaths: u,
766
- onExpandedPathsChange: d,
767
- loadingPaths: f,
768
- searchQuery: ge,
769
- disabled: v,
770
- noResultsLabel: U,
771
- addSiblingFolderLabel: W,
772
- addChildFolderLabel: G,
773
- cancelCreatingFolderLabel: K,
774
- emptyFolderNameError: q,
775
- invalidFolderNameError: ce,
776
- duplicateFolderNameError: J,
777
- rootLabel: Y,
778
- styles: R
874
+ /* @__PURE__ */ z("div", {
875
+ className: "flex min-w-0 items-center gap-2",
876
+ children: [/* @__PURE__ */ R("div", {
877
+ role: "group",
878
+ "aria-label": X,
879
+ className: "min-w-0 flex-1",
880
+ children: ze ? /* @__PURE__ */ R(m, {
881
+ name: [Ce, ...g].join(" / "),
882
+ nameClassName: Ue
883
+ }) : /* @__PURE__ */ R("span", {
884
+ className: F("block truncate", Ue),
885
+ children: Z
886
+ })
887
+ }), /* @__PURE__ */ R(h, {
888
+ ref: Fe,
889
+ size: f.Small,
890
+ label: ze ? fe : Q,
891
+ iconBefore: /* @__PURE__ */ R(B, {
892
+ size: l.SM,
893
+ stroke: u,
894
+ "aria-hidden": !0
895
+ }),
896
+ disabled: D,
897
+ onClick: o
898
+ })]
779
899
  }),
780
- Ee.calloutKind !== N.None && Ee.calloutKind !== N.Info && /* @__PURE__ */ k("div", {
900
+ Be.calloutKind !== H.None && Be.calloutKind !== H.Info && /* @__PURE__ */ R("div", {
781
901
  className: "mt-3",
782
- children: /* @__PURE__ */ k(g, {
783
- type: _.SectionMessage,
784
- variant: Se(Ee.calloutKind),
785
- message: we(Ee.calloutKind, {
786
- replaceWarning: V,
787
- noAccessError: se,
788
- submitError: H,
789
- folderName: De,
790
- version: e?.version
902
+ children: /* @__PURE__ */ R(C, {
903
+ type: w.SectionMessage,
904
+ variant: Ye(Be.calloutKind),
905
+ message: Ze(Be.calloutKind, {
906
+ replaceWarning: pe,
907
+ noAccessError: me,
908
+ submitError: he,
909
+ folderName: Ve,
910
+ version: s?.version,
911
+ folderNameClassName: W
791
912
  })
792
913
  })
793
914
  }),
794
- /* @__PURE__ */ k("div", {
915
+ /* @__PURE__ */ R("div", {
795
916
  className: "mt-4",
796
- children: /* @__PURE__ */ k(m, {
797
- id: xe,
798
- labelProps: { label: pe },
799
- placeholder: X,
800
- caption: me,
801
- value: S,
802
- onChange: (e) => C(e ?? ""),
803
- maxLength: be,
804
- disabled: v
917
+ children: /* @__PURE__ */ R(ee, {
918
+ id: Pe,
919
+ labelProps: { label: Ee },
920
+ placeholder: Oe,
921
+ caption: ke,
922
+ value: j,
923
+ onChange: (e) => M(e ?? ""),
924
+ maxLength: qe,
925
+ disabled: D
805
926
  })
806
927
  }),
807
- T != null && /* @__PURE__ */ k("div", {
928
+ te != null && /* @__PURE__ */ R("div", {
808
929
  className: "mt-4",
809
- children: /* @__PURE__ */ k(s, {
810
- labelProps: { label: Z },
811
- caption: Q,
812
- isSelected: ee,
813
- onChange: T,
814
- disabled: v
930
+ children: /* @__PURE__ */ R(c, {
931
+ labelProps: { label: Ae },
932
+ caption: je,
933
+ isSelected: N,
934
+ onChange: te,
935
+ disabled: D
815
936
  })
816
937
  }),
817
- /* @__PURE__ */ k("div", {
938
+ /* @__PURE__ */ R("div", {
818
939
  className: "mt-4",
819
- children: /* @__PURE__ */ k(he, {
820
- rules: O,
821
- onRulesChange: j,
822
- sourceOptions: te,
823
- folderName: Te ? De : void 0,
824
- disabled: v,
825
- isLoading: ne,
826
- hasLoadError: re,
827
- labels: ue,
828
- styles: z
940
+ children: /* @__PURE__ */ R(De, {
941
+ rules: I,
942
+ onRulesChange: L,
943
+ sourceOptions: re,
944
+ folderName: ze ? Ve : void 0,
945
+ disabled: D,
946
+ isLoading: ie,
947
+ hasLoadError: ae,
948
+ labels: we,
949
+ styles: ue
829
950
  })
830
951
  })
831
952
  ] })]
832
953
  });
833
- }, Se = (e) => e === N.ReplaceWarning ? v.Warning : v.Error, Ce = (e, t) => {
834
- let [n, r, ...i] = e.split("{folder}");
835
- return r === void 0 || i.length > 0 ? e : /* @__PURE__ */ A(O, { children: [
836
- n,
837
- /* @__PURE__ */ k("strong", {
838
- className: "font-semibold",
954
+ }, Ye = (e) => e === H.ReplaceWarning ? T.Warning : T.Error, Xe = (e, t, n) => {
955
+ let [r, i, ...a] = e.split("{folder}");
956
+ return i === void 0 || a.length > 0 ? e : /* @__PURE__ */ z(L, { children: [
957
+ r,
958
+ /* @__PURE__ */ R("strong", {
959
+ className: n,
839
960
  children: t
840
961
  }),
841
- r
962
+ i
842
963
  ] });
843
- }, we = (e, t) => e === N.ReplaceWarning ? Ce(t.replaceWarning.replace("{version}", t.version ?? ""), t.folderName) : e === N.NoAccess ? Ce(t.noAccessError, t.folderName) : t.submitError, Te = { footer: "_footer_dks1v_1" }, Ee = ({ version: e, hasExistingPublicationInFolder: t, isSubmitDisabled: n, isSubmitLoading: r, onCancel: i, onSubmit: a, labels: o = {}, colors: s }) => {
844
- let l = E({ "--pf-border": s?.border }), { cancelLabel: u = "Cancel", publishDefaultLabel: f = "Publish", updateLabel: p = "Update version {version}", publishingInProgressLabel: m = "Publishing…" } = o, g = r ? m : t && e != null ? p.replace("{version}", e) : f;
845
- return /* @__PURE__ */ A("div", {
846
- style: l,
847
- className: D("flex items-center justify-end gap-2 border-t px-4 py-4 desktop:px-3.5 rtl:flex-row-reverse rtl:justify-start", Te.footer),
848
- children: [/* @__PURE__ */ k(d, {
849
- label: u,
850
- className: "mobile:flex-1",
851
- disabled: r,
852
- onClick: i
853
- }), /* @__PURE__ */ k(h, {
854
- label: g,
964
+ }, Ze = (e, t) => e === H.ReplaceWarning ? Xe(t.replaceWarning.replace("{version}", t.version ?? ""), t.folderName, t.folderNameClassName) : e === H.NoAccess ? Xe(t.noAccessError, t.folderName, t.folderNameClassName) : t.submitError, Qe = { footer: "_footer_dks1v_1" }, $e = ({ version: e, hasExistingPublicationInFolder: t, allowReplace: n = !0, isSubmitDisabled: r, isSubmitLoading: i, onCancel: a, onSubmit: o, view: s = q.Main, onSelectFolder: c, isSelectFolderDisabled: u = !1, labels: d = {}, colors: f }) => {
965
+ let p = ne({ "--pf-border": f?.border }), { cancelLabel: m = "Cancel", publishDefaultLabel: g = "Publish", updateLabel: _ = "Update version {version}", publishingInProgressLabel: ee = "Publishing…", selectFolderLabel: v = "Select" } = d, y = s === q.ChangeFolder, b = i ? ee : n && t && e != null ? _.replace("{version}", e) : g;
966
+ return /* @__PURE__ */ z("div", {
967
+ style: p,
968
+ className: F("flex items-center justify-end gap-2 border-t px-4 py-4 rtl:flex-row-reverse rtl:justify-start desktop:px-3.5", Qe.footer),
969
+ children: [/* @__PURE__ */ R(h, {
970
+ label: m,
855
971
  className: "mobile:flex-1",
856
- disabled: n,
857
- iconBefore: r ? /* @__PURE__ */ k(S, { size: c.SM }) : void 0,
972
+ disabled: i,
858
973
  onClick: a
974
+ }), y ? /* @__PURE__ */ R(S, {
975
+ label: v,
976
+ className: "mobile:flex-1",
977
+ disabled: u,
978
+ onClick: c
979
+ }) : /* @__PURE__ */ R(S, {
980
+ label: b,
981
+ className: "mobile:flex-1",
982
+ disabled: r,
983
+ iconBefore: i ? /* @__PURE__ */ R("span", {
984
+ "aria-hidden": !0,
985
+ children: /* @__PURE__ */ R(j, { size: l.SM })
986
+ }) : void 0,
987
+ onClick: o
859
988
  })]
860
989
  });
861
- }, De = {
990
+ }, et = {
862
991
  backdrop: "_backdrop_16jmd_6",
863
992
  panel: "_panel_16jmd_10",
864
993
  divider: "_divider_16jmd_15",
865
994
  content: "_content_16jmd_19",
866
995
  title: "_title_16jmd_24"
867
- }, Oe = ({ isOpen: e, resource: n, renderSummary: i, folderItems: o, selectedFolderPath: s, onSelectedFolderPathChange: c, onCreateFolder: l, expandedPaths: u, onExpandedPathsChange: d, loadingPaths: f, hasExistingPublicationInFolder: p, hasWriteAccess: m, isSubmitting: h, hasSubmitError: g = !1, allowReplace: _ = !0, author: v, onAuthorChange: y, rules: b, onRulesChange: S, ruleSourceOptions: C, isRulesLoading: ee = !1, hasRulesLoadError: w = !1, onClose: T, returnFocusRef: O, onSubmit: j, panelLabels: te, panelStyles: ne, footerLabels: re, labels: ie = {}, titleClassName: M = "dial-body-semi-text", colors: N }) => {
868
- let F = E({
869
- "--spp-backdrop-bg": N?.backdropBackground,
870
- "--spp-panel-bg": N?.panelBackground,
871
- "--spp-panel-border": N?.panelBorder,
872
- "--spp-divider-border": N?.dividerBorder,
873
- "--spp-scrollbar-thumb": N?.scrollbarThumb,
874
- "--spp-title-text": N?.titleText
875
- }), [I, L] = a(null), { title: R = "Publish", ariaLabel: z = "Publish", closeAriaLabel: ae = "Close" } = ie, B = r(() => P({
996
+ }, tt = ({ isOpen: e, resource: n, renderSummary: i, folderItems: o, selectedFolderPath: s, onSelectedFolderPathChange: c, onCreateFolder: l, expandedPaths: u, onExpandedPathsChange: d, loadingPaths: f, hasExistingPublicationInFolder: p, hasWriteAccess: m, isSubmitting: h, hasSubmitError: g = !1, allowReplace: _ = !0, author: ee, onAuthorChange: v, rules: y, onRulesChange: b, ruleSourceOptions: x, isRulesLoading: S = !1, hasRulesLoadError: C = !1, onClose: w, returnFocusRef: T, onSubmit: E, panelLabels: D, panelStyles: O, panelSummaryTitleClassName: k, panelHeadingClassName: j, panelCalloutFolderNameClassName: M, footerLabels: N, labels: P = {}, titleClassName: te = "dial-body-semi-text", colors: I }) => {
997
+ let L = ne({
998
+ "--spp-backdrop-bg": I?.backdropBackground,
999
+ "--spp-panel-bg": I?.panelBackground,
1000
+ "--spp-panel-border": I?.panelBorder,
1001
+ "--spp-divider-border": I?.dividerBorder,
1002
+ "--spp-scrollbar-thumb": I?.scrollbarThumb,
1003
+ "--spp-title-text": I?.titleText
1004
+ }), [B, re] = a(null), { title: ie = "Publish", changeFolderTitle: ae = "Change folder", backAriaLabel: oe = "Back", ariaLabel: se = "Publish", closeAriaLabel: V = "Close" } = P, H = ue({
1005
+ isOpen: e,
1006
+ selectedFolderPath: s,
1007
+ onSelectedFolderPathChange: c
1008
+ }), ce = H.view === q.ChangeFolder, W = r(() => U({
876
1009
  hasSelectedFolder: s != null,
877
1010
  hasExistingPublicationInFolder: p,
878
1011
  hasWriteAccess: m,
@@ -888,7 +1021,7 @@ var M = /* @__PURE__ */ function(e) {
888
1021
  _
889
1022
  ]);
890
1023
  return t(() => {
891
- let t = I?.closest("[role=\"dialog\"]");
1024
+ let t = B?.closest("[role=\"dialog\"]");
892
1025
  if (!e || !t) return;
893
1026
  let n = () => t.focus({ preventScroll: !0 });
894
1027
  n();
@@ -898,41 +1031,47 @@ var M = /* @__PURE__ */ function(e) {
898
1031
  document.addEventListener("focusin", r);
899
1032
  let i = requestAnimationFrame(() => {
900
1033
  document.removeEventListener("focusin", r);
901
- }), a = O?.current;
1034
+ }), a = T?.current;
902
1035
  return () => {
903
1036
  cancelAnimationFrame(i), document.removeEventListener("focusin", r), a?.isConnected && a.focus({ preventScroll: !0 });
904
1037
  };
905
1038
  }, [
906
1039
  e,
907
- I,
908
- O
909
- ]), /* @__PURE__ */ A(x, {
1040
+ B,
1041
+ T
1042
+ ]), /* @__PURE__ */ z(A, {
910
1043
  open: e,
911
- onClose: T,
912
- header: /* @__PURE__ */ k("span", {
913
- className: D("block truncate text-center", M, De.title),
914
- children: R
1044
+ onClose: w,
1045
+ header: /* @__PURE__ */ R("span", {
1046
+ className: F("block truncate text-center", te, et.title),
1047
+ children: ce ? ae : ie
915
1048
  }),
916
- ariaLabel: z,
917
- closeAriaLabel: ae,
1049
+ ariaLabel: se,
1050
+ onBack: ce ? H.backToMain : void 0,
1051
+ backAriaLabel: oe,
1052
+ backDisabled: h,
1053
+ closeAriaLabel: V,
918
1054
  closeDisabled: h,
919
- style: F,
920
- overlayStyle: F,
921
- className: De.panel,
922
- overlayClassName: De.backdrop,
923
- headerClassName: D("px-[22px]", De.divider),
1055
+ style: L,
1056
+ overlayStyle: L,
1057
+ className: F(et.panel, "tablet:w-[540px]! tablet:max-w-[calc(100%-32px)]!"),
1058
+ overlayClassName: et.backdrop,
1059
+ headerClassName: F("px-[22px]", et.divider),
924
1060
  bodyClassName: "flex flex-col overflow-hidden",
925
- children: [/* @__PURE__ */ k("div", {
926
- ref: L,
927
- className: D("min-h-0 flex-1 overflow-y-auto", De.content),
928
- children: /* @__PURE__ */ k("div", {
1061
+ children: [/* @__PURE__ */ R("div", {
1062
+ ref: re,
1063
+ className: F("min-h-0 flex-1 overflow-y-auto", et.content),
1064
+ children: /* @__PURE__ */ R("div", {
929
1065
  className: "p-[22px]",
930
- children: /* @__PURE__ */ k(xe, {
1066
+ children: /* @__PURE__ */ R(Je, {
931
1067
  resource: n,
932
1068
  renderSummary: i,
1069
+ view: H.view,
1070
+ onChangeFolderClick: H.openFolderView,
933
1071
  folderItems: o,
934
1072
  selectedFolderPath: s,
935
- onSelectedFolderPathChange: c,
1073
+ pendingFolderPath: H.pendingFolderPath,
1074
+ onPendingFolderPathChange: H.setPendingFolderPath,
936
1075
  onCreateFolder: l,
937
1076
  expandedPaths: u,
938
1077
  onExpandedPathsChange: d,
@@ -942,27 +1081,293 @@ var M = /* @__PURE__ */ function(e) {
942
1081
  isSubmitting: h,
943
1082
  hasSubmitError: g,
944
1083
  allowReplace: _,
945
- author: v,
946
- onAuthorChange: y,
947
- rules: b,
948
- onRulesChange: S,
949
- ruleSourceOptions: C,
950
- isRulesLoading: ee,
951
- hasRulesLoadError: w,
952
- labels: te,
953
- styles: ne
1084
+ author: ee,
1085
+ onAuthorChange: v,
1086
+ rules: y,
1087
+ onRulesChange: b,
1088
+ ruleSourceOptions: x,
1089
+ isRulesLoading: S,
1090
+ hasRulesLoadError: C,
1091
+ labels: D,
1092
+ styles: O,
1093
+ summaryTitleClassName: k,
1094
+ headingClassName: j,
1095
+ calloutFolderNameClassName: M
954
1096
  })
955
1097
  })
956
- }), /* @__PURE__ */ k(Ee, {
1098
+ }), /* @__PURE__ */ R($e, {
957
1099
  version: n?.version,
958
1100
  hasExistingPublicationInFolder: p,
959
- isSubmitDisabled: B.isSubmitDisabled,
960
- isSubmitLoading: B.isSubmitLoading,
961
- onCancel: T,
962
- onSubmit: j,
963
- labels: re
1101
+ allowReplace: _,
1102
+ isSubmitDisabled: W.isSubmitDisabled,
1103
+ isSubmitLoading: W.isSubmitLoading,
1104
+ onCancel: ce ? H.backToMain : w,
1105
+ onSubmit: E,
1106
+ view: H.view,
1107
+ onSelectFolder: H.selectFolder,
1108
+ isSelectFolderDisabled: H.pendingFolderPath == null,
1109
+ labels: N
1110
+ })]
1111
+ });
1112
+ }, nt = /* @__PURE__ */ function(e) {
1113
+ return e.Keep = "keep", e.New = "new", e;
1114
+ }({}), rt = /* @__PURE__ */ function(e) {
1115
+ return e.Main = "main", e.ChangeFolder = "change-folder", e;
1116
+ }({}), it = {
1117
+ heading: "_heading_vk731_1",
1118
+ destination: "_destination_vk731_5"
1119
+ }, at = ({ view: e, resource: t, roots: i, destination: o, onCreateFolder: s, onChangeFolderClick: c, changeFolderButtonRef: d, pendingDestination: g, onPendingDestinationChange: _, version: b, accessRules: S, isSubmitting: C = !1, submitError: w, foldersError: T, onRetryFolders: E, panelLabels: k = {}, panelStyles: A = {}, headingClassName: j = "dial-body-semi-text", destinationClassName: M = "dial-small-semi-text" }) => {
1120
+ let { saveToFolderHeading: N = "Save to folder", changeFolderLabel: te = "Change", destinationAriaLabel: I = "Destination folder", versionHeading: L = "Version", keepVersionLabel: re = "Keep version {version}", saveAsNewVersionLabel: ie = "Save as new version", newVersionLabel: ae = "Version", newVersionPlaceholder: oe = "Enter new version", searchPlaceholder: se = "Search folders", clearSearchAriaLabel: V = "Clear search", folderEmptyStateLabel: H, createFolderLabel: U, cancelCreatingFolderLabel: ce, addSiblingFolderLabel: W, addChildFolderLabel: le, createFolderEmptyNameError: G, createFolderInvalidNameError: K, createFolderDuplicateNameError: q, retryLabel: ue = "Retry" } = k, { colors: J, folderTree: de } = A, Y = {
1121
+ ...ne({
1122
+ "--stf-heading-text": J?.headingText,
1123
+ "--stf-destination-text": J?.destinationText
1124
+ }),
1125
+ ...A.cssVars
1126
+ }, X = {
1127
+ border: J?.summaryBorder,
1128
+ background: J?.summaryBackground
1129
+ }, [Z, fe] = a(""), Q = n(), pe = r(() => [i.find((e) => e.key === o.rootKey)?.label ?? o.rootKey, ...o.path], [i, o]), me = i.find((e) => e.key === g?.rootKey), he = g ? g.path[g.path.length - 1] ?? me?.label : void 0, ge = F(j, it.heading);
1130
+ if (e === rt.ChangeFolder) return /* @__PURE__ */ z("div", {
1131
+ className: "flex flex-col gap-3",
1132
+ style: Y,
1133
+ children: [
1134
+ /* @__PURE__ */ R("div", {
1135
+ role: "search",
1136
+ children: /* @__PURE__ */ R(O, {
1137
+ value: Z,
1138
+ onChange: (e) => fe(e ?? ""),
1139
+ placeholder: se,
1140
+ clearLabel: V,
1141
+ "aria-label": se
1142
+ })
1143
+ }),
1144
+ /* @__PURE__ */ R(y, {
1145
+ politeness: x.Assertive,
1146
+ children: T && /* @__PURE__ */ z("div", {
1147
+ className: "flex flex-wrap items-center gap-2",
1148
+ children: [/* @__PURE__ */ R(p, { text: T }), E && /* @__PURE__ */ R(v, {
1149
+ label: ue,
1150
+ onClick: E
1151
+ })]
1152
+ })
1153
+ }),
1154
+ /* @__PURE__ */ R(We, {
1155
+ roots: i,
1156
+ destination: g,
1157
+ onDestinationChange: _,
1158
+ onCreateDestinationFolder: s,
1159
+ searchQuery: Z,
1160
+ disabled: C,
1161
+ noResultsLabel: H,
1162
+ createFolderLabel: U,
1163
+ cancelCreatingFolderLabel: ce,
1164
+ addSiblingFolderLabel: W,
1165
+ addChildFolderLabel: le,
1166
+ emptyFolderNameError: G,
1167
+ invalidFolderNameError: K,
1168
+ duplicateFolderNameError: q,
1169
+ styles: de
1170
+ }),
1171
+ S && me?.hasAccessRules && /* @__PURE__ */ R("div", {
1172
+ className: "mt-1",
1173
+ children: /* @__PURE__ */ R(De, {
1174
+ rules: S.rules,
1175
+ onRulesChange: S.onRulesChange,
1176
+ sourceOptions: S.sourceOptions,
1177
+ folderName: he,
1178
+ disabled: C,
1179
+ isLoading: S.isLoading,
1180
+ hasLoadError: S.hasLoadError,
1181
+ labels: S.labels,
1182
+ styles: S.styles
1183
+ })
1184
+ })
1185
+ ]
1186
+ });
1187
+ let _e = b ? [{
1188
+ value: nt.Keep,
1189
+ label: re.replace("{version}", b.currentVersion)
1190
+ }, {
1191
+ value: nt.New,
1192
+ label: ie,
1193
+ content: /* @__PURE__ */ R(ee, {
1194
+ id: Q,
1195
+ value: b.newVersion,
1196
+ onChange: (e) => b.onNewVersionChange(e ?? ""),
1197
+ onBlur: b.onNewVersionBlur,
1198
+ labelProps: {
1199
+ label: ae,
1200
+ required: !0
1201
+ },
1202
+ placeholder: oe,
1203
+ error: b.newVersionError,
1204
+ invalid: !!b.newVersionError,
1205
+ disabled: C
1206
+ })
1207
+ }] : [];
1208
+ return /* @__PURE__ */ z("div", {
1209
+ className: "flex flex-col gap-5",
1210
+ style: Y,
1211
+ children: [
1212
+ t.type == null ? /* @__PURE__ */ R(P, {
1213
+ colors: X,
1214
+ children: /* @__PURE__ */ R("span", {
1215
+ className: F("truncate", ge),
1216
+ children: t.title
1217
+ })
1218
+ }) : /* @__PURE__ */ R(P, {
1219
+ item: {
1220
+ type: t.type,
1221
+ name: t.title,
1222
+ version: t.version ?? "",
1223
+ iconUrl: t.iconUrl
1224
+ },
1225
+ hasVersionTag: !1,
1226
+ colors: X
1227
+ }),
1228
+ /* @__PURE__ */ z("section", {
1229
+ className: "flex flex-col gap-2",
1230
+ children: [/* @__PURE__ */ R("h2", {
1231
+ className: ge,
1232
+ children: N
1233
+ }), /* @__PURE__ */ z("div", {
1234
+ className: "flex min-w-0 items-center gap-2",
1235
+ children: [/* @__PURE__ */ R("div", {
1236
+ role: "group",
1237
+ "aria-label": I,
1238
+ className: "min-w-0 flex-1",
1239
+ children: /* @__PURE__ */ R(m, {
1240
+ name: pe.join(" / "),
1241
+ nameClassName: F(M, it.destination)
1242
+ })
1243
+ }), /* @__PURE__ */ R(h, {
1244
+ ref: d,
1245
+ size: f.Small,
1246
+ label: te,
1247
+ iconBefore: /* @__PURE__ */ R(B, {
1248
+ size: l.SM,
1249
+ stroke: u,
1250
+ "aria-hidden": !0
1251
+ }),
1252
+ disabled: C,
1253
+ onClick: c
1254
+ })]
1255
+ })]
1256
+ }),
1257
+ b && /* @__PURE__ */ z("section", {
1258
+ className: "flex flex-col gap-2",
1259
+ children: [/* @__PURE__ */ R("h2", {
1260
+ className: ge,
1261
+ children: L
1262
+ }), /* @__PURE__ */ R(D, {
1263
+ ariaLabel: L,
1264
+ value: b.versionMode,
1265
+ onChange: (e) => b.onVersionModeChange(e),
1266
+ items: _e,
1267
+ disabled: C
1268
+ })]
1269
+ }),
1270
+ /* @__PURE__ */ R(y, {
1271
+ politeness: x.Assertive,
1272
+ children: w && /* @__PURE__ */ R(p, { text: w })
1273
+ })
1274
+ ]
1275
+ });
1276
+ }, ot = {
1277
+ backdrop: "_backdrop_1ie8s_6",
1278
+ panel: "_panel_1ie8s_10",
1279
+ divider: "_divider_1ie8s_15",
1280
+ footer: "_footer_1ie8s_19",
1281
+ content: "_content_1ie8s_23",
1282
+ title: "_title_1ie8s_28"
1283
+ }, st = ({ isOpen: e, onClose: n, onSubmit: r, isSubmitDisabled: o = !1, returnFocusRef: s, labels: c = {}, colors: u, titleClassName: d = "dial-body-semi-text", destination: f, onDestinationChange: p, isSubmitting: m = !1, onPendingDestinationChange: g, ..._ }) => {
1284
+ let { title: ee = "Save", changeFolderTitle: v = "Change folder", closeAriaLabel: y = "Close", backAriaLabel: b = "Back", cancelLabel: x = "Cancel", saveLabel: C = "Save", savingLabel: w = "Saving…", selectLabel: T = "Select" } = c, D = ne({
1285
+ "--sstf-backdrop-bg": u?.backdropBackground,
1286
+ "--sstf-panel-bg": u?.panelBackground,
1287
+ "--sstf-panel-border": u?.panelBorder,
1288
+ "--sstf-divider-border": u?.dividerBorder,
1289
+ "--sstf-scrollbar-thumb": u?.scrollbarThumb,
1290
+ "--sstf-title-text": u?.titleText
1291
+ }), [O, k] = a(rt.Main), [M, N] = a(f), P = i(null), te = i(null);
1292
+ t(() => {
1293
+ e && k(rt.Main);
1294
+ }, [e]);
1295
+ let I = i(O);
1296
+ t(() => {
1297
+ I.current !== O && (I.current = O, O === rt.ChangeFolder ? P.current?.focus({ preventScroll: !0 }) : te.current?.focus({ preventScroll: !0 }));
1298
+ }, [O]);
1299
+ let L = i(e);
1300
+ t(() => {
1301
+ let t = L.current;
1302
+ L.current = e, t && !e && s?.current?.isConnected && s.current.focus({ preventScroll: !0 });
1303
+ }, [e, s]);
1304
+ let B = O === rt.ChangeFolder, re = (e) => {
1305
+ N(e), g?.(e);
1306
+ }, ie = () => {
1307
+ re(f), k(rt.ChangeFolder);
1308
+ }, ae = () => {
1309
+ g?.(f), k(rt.Main);
1310
+ }, oe = () => {
1311
+ M && p(M), k(rt.Main);
1312
+ };
1313
+ return /* @__PURE__ */ z(A, {
1314
+ open: e,
1315
+ onClose: n,
1316
+ header: /* @__PURE__ */ R("span", {
1317
+ ref: P,
1318
+ tabIndex: -1,
1319
+ className: F("block truncate outline-none", d, ot.title),
1320
+ children: B ? v : ee
1321
+ }),
1322
+ ariaLabel: ee,
1323
+ onBack: B ? ae : void 0,
1324
+ backAriaLabel: b,
1325
+ backDisabled: m,
1326
+ closeAriaLabel: y,
1327
+ closeDisabled: m,
1328
+ style: D,
1329
+ overlayStyle: D,
1330
+ className: F(ot.panel, "tablet:w-[540px]! tablet:max-w-[calc(100%-32px)]!"),
1331
+ overlayClassName: ot.backdrop,
1332
+ headerClassName: F("px-[22px]", ot.divider),
1333
+ bodyClassName: "flex flex-col overflow-hidden",
1334
+ children: [/* @__PURE__ */ R("div", {
1335
+ className: F("min-h-0 flex-1 overflow-y-auto p-[22px]", ot.content),
1336
+ children: /* @__PURE__ */ R(at, {
1337
+ ..._,
1338
+ view: O,
1339
+ destination: f,
1340
+ onDestinationChange: p,
1341
+ isSubmitting: m,
1342
+ onChangeFolderClick: ie,
1343
+ changeFolderButtonRef: te,
1344
+ pendingDestination: M,
1345
+ onPendingDestinationChange: re
1346
+ })
1347
+ }), /* @__PURE__ */ z("div", {
1348
+ className: F("flex items-center justify-end gap-2 border-t px-4 py-4 desktop:px-3.5", ot.footer),
1349
+ children: [/* @__PURE__ */ R(h, {
1350
+ label: x,
1351
+ className: "mobile:flex-1",
1352
+ disabled: m,
1353
+ onClick: B ? ae : n
1354
+ }), B ? /* @__PURE__ */ R(S, {
1355
+ label: T,
1356
+ className: "mobile:flex-1",
1357
+ disabled: M == null,
1358
+ onClick: oe
1359
+ }) : /* @__PURE__ */ R(E, {
1360
+ label: m ? w : C,
1361
+ className: "mobile:flex-1",
1362
+ disabled: o || m,
1363
+ iconBefore: m ? /* @__PURE__ */ R("span", {
1364
+ "aria-hidden": !0,
1365
+ children: /* @__PURE__ */ R(j, { size: l.SM })
1366
+ }) : void 0,
1367
+ onClick: r
1368
+ })]
964
1369
  })]
965
1370
  });
966
1371
  };
967
1372
  //#endregion
968
- export { $ as PUBLISH_PANEL_CLASS, M as PublicationRuleFunction, pe as PublishAccessRuleEditor, he as PublishAccessRules, N as PublishCalloutKind, ve as PublishFoldersTree, Ee as PublishFooter, ge as PublishHistoryList, xe as PublishPanel, Oe as StandalonePublishPanel, H as collectFolderKeys, P as derivePublishState, ae as filterFolderTree, I as formatPublishedDate, W as fromFolderPathKey, J as getSiblingFolderNames, ce as getUniqueFolderName, se as mergeFolderPaths, oe as sortFolderTree, G as toDialFileTree, U as toFolderPathKey, z as usePublishFlow, q as validateFolderName };
1373
+ export { Ge as PUBLISH_PANEL_CLASS, V as PublicationRuleFunction, we as PublishAccessRuleEditor, De as PublishAccessRules, H as PublishCalloutKind, We as PublishFoldersTree, $e as PublishFooter, ke as PublishHistoryList, Je as PublishPanel, q as PublishPanelView, at as SaveToFolderPanel, rt as SaveToFolderView, nt as SaveVersionMode, tt as StandalonePublishPanel, st as StandaloneSaveToFolderPanel, fe as collectFolderKeys, U as derivePublishState, J as filterFolderTree, W as formatPublishedDate, pe as fromFolderPathKey, ve as getSiblingFolderNames, _e as getUniqueFolderName, Z as mergeFolderPaths, Y as sortFolderTree, me as toDialFileTree, Q as toFolderPathKey, K as usePublishFlow, ue as usePublishFolderView, ge as validateFolderName };