@epam/ai-dial-publish-panel 1.4.0-dev.8 → 1.4.0-dev.81

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