@orangelogic/design-system 2.118.0 → 2.119.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/library/assets/diff.worker-ClilI1xm.js +1 -0
  2. package/library/chunks/{animation.8MjXJybe.js → animation.hpY88RxG.js} +106 -100
  3. package/library/chunks/{asset.CIWxY-Aw.js → asset.D_MQwP1C.js} +4 -4
  4. package/library/chunks/browser.BHOCIF_A.js +84 -0
  5. package/library/chunks/{button.DwJEeW2t.js → button.bufNNyTc.js} +1 -1
  6. package/library/chunks/{color-swatch-group.BvLicLI4.js → color-swatch-group.CeazdbIe.js} +6 -6
  7. package/library/chunks/{color-swatch.DVzEaNeL.js → color-swatch.LEvHo5G_.js} +2 -2
  8. package/library/chunks/{confirm-popover.BifwpSuf.js → confirm-popover.BLQFU6Hs.js} +3 -3
  9. package/library/chunks/{content-builder.OsUmm8Wu.js → content-builder.BGzxZUgi.js} +1 -1
  10. package/library/chunks/debounce.DaHuiSGU.js +15 -0
  11. package/library/chunks/{dialog.BYCWepBc.js → dialog.DdsJ_WqU.js} +2 -2
  12. package/library/chunks/{document-viewer.CKCX8ueu.js → document-viewer.B5VtBEEP.js} +7 -7
  13. package/library/chunks/{dot-pagination.C4l5vKor.js → dot-pagination.Bny2T6DA.js} +1 -1
  14. package/library/chunks/{endpoints.D4h8hp1m.js → endpoints.6E17hFiK.js} +385 -385
  15. package/library/chunks/{file-on-demand.AwMj4AfO.js → file-on-demand.DDuWnvmy.js} +10 -10
  16. package/library/chunks/{folder-select.CrWjwQcw.js → folder-select.D1jO1hB_.js} +295 -203
  17. package/library/chunks/{header.Cf9ujCpg.js → header.CfiA4TRu.js} +1 -1
  18. package/library/chunks/{i18n.CH-wak_P.js → i18n.DDj5y9px.js} +106 -11
  19. package/library/chunks/{icon-button.CQiBjznj.js → icon-button.DOrACmes.js} +1 -1
  20. package/library/chunks/{iframe.BQPVygBJ.js → iframe.qaVD1n1m.js} +1 -1
  21. package/library/chunks/{image.cT-FziNS.js → image.BugewF1g.js} +129 -146
  22. package/library/chunks/{input.CH4lKxPM.js → input.BYj6YXcM.js} +1 -1
  23. package/library/chunks/keyed.C0rkKrxH.js +22 -0
  24. package/library/chunks/{list-editor.BfpDIsU5.js → list-editor.D5szxqSM.js} +11 -11
  25. package/library/chunks/math.DuKzLacZ.js +26 -0
  26. package/library/chunks/{option.Bvh35v8S.js → option.CnxdM30G.js} +1 -1
  27. package/library/chunks/{pagination.zQ2FFtxB.js → pagination.Dxig0LoI.js} +6 -6
  28. package/library/chunks/{responsive.C8NCkfCG.js → responsive.Cf65FCWd.js} +1 -1
  29. package/library/chunks/{tab-group.DvMX02hY.js → tab-group.CGg9lPLP.js} +3 -3
  30. package/library/chunks/{table.GCs54Y2t.js → table.BkdcDorc.js} +1471 -1400
  31. package/library/chunks/{tree.Btf2Q4YZ.js → tree.yYbWIRnc.js} +3 -3
  32. package/library/components/alert.js +2 -2
  33. package/library/components/animation.js +1 -1
  34. package/library/components/asset-link-format.js +8 -8
  35. package/library/components/atoms.js +144 -142
  36. package/library/components/audio.js +2 -2
  37. package/library/components/border-input-group.js +2 -2
  38. package/library/components/breadcrumb.js +1 -1
  39. package/library/components/button.js +2 -2
  40. package/library/components/color-picker.js +5 -5
  41. package/library/components/color-swatch-group.js +7 -7
  42. package/library/components/color-swatch.js +3 -3
  43. package/library/components/confirm-popover.js +4 -4
  44. package/library/components/copy-button.js +1 -1
  45. package/library/components/corner-position-input-group.js +3 -3
  46. package/library/components/date-calendar.js +1 -1
  47. package/library/components/details.js +1 -1
  48. package/library/components/dialog.js +3 -3
  49. package/library/components/diff.d.ts +3 -0
  50. package/library/components/diff.js +104 -0
  51. package/library/components/document-viewer.js +3 -3
  52. package/library/components/dot-pagination.js +2 -2
  53. package/library/components/drawer.js +2 -2
  54. package/library/components/dropdown.js +2 -2
  55. package/library/components/dynamic-select.js +282 -211
  56. package/library/components/e-chart.js +1 -1
  57. package/library/components/element-clamp.js +2 -2
  58. package/library/components/file-on-demand.js +11 -11
  59. package/library/components/folder-select.js +5 -5
  60. package/library/components/format-bytes.js +1 -1
  61. package/library/components/format-date.js +1 -1
  62. package/library/components/format-number.js +1 -1
  63. package/library/components/format-time.js +1 -1
  64. package/library/components/header.js +2 -2
  65. package/library/components/icon-button.js +2 -2
  66. package/library/components/iframe.js +2 -2
  67. package/library/components/image-comparer.js +2 -2
  68. package/library/components/image.js +5 -4
  69. package/library/components/input.js +2 -2
  70. package/library/components/line-clamp.js +6 -5
  71. package/library/components/list-editor.js +8 -8
  72. package/library/components/masonry.js +2 -2
  73. package/library/components/menu-item.js +1 -1
  74. package/library/components/menu.js +1 -1
  75. package/library/components/molecules.js +4 -4
  76. package/library/components/option.js +2 -2
  77. package/library/components/organisms.js +2 -2
  78. package/library/components/padding-input-group.js +1 -1
  79. package/library/components/pagination.js +7 -7
  80. package/library/components/popup.js +76 -75
  81. package/library/components/position-picker.js +1 -1
  82. package/library/components/progress-bar.js +1 -1
  83. package/library/components/progress-ring.js +1 -1
  84. package/library/components/range.js +3 -3
  85. package/library/components/rating.js +2 -2
  86. package/library/components/relative-time.js +1 -1
  87. package/library/components/select.js +33 -32
  88. package/library/components/shadow-input-group.js +1 -1
  89. package/library/components/share-option-list.js +2 -2
  90. package/library/components/sidebar.js +1 -1
  91. package/library/components/size-input-group.js +3 -3
  92. package/library/components/spinner.js +1 -1
  93. package/library/components/split-panel.js +2 -2
  94. package/library/components/tab-group.js +4 -4
  95. package/library/components/tab.js +2 -2
  96. package/library/components/table.js +62 -60
  97. package/library/components/tag.js +2 -2
  98. package/library/components/tooltip.js +1 -1
  99. package/library/components/tree-item.js +2 -2
  100. package/library/components/tree.js +3 -3
  101. package/library/components/typeface.js +2 -2
  102. package/library/components/types.js +35400 -32968
  103. package/library/components/video.js +3 -3
  104. package/library/package.json +1 -1
  105. package/library/packages/atoms/src/animations/index.d.ts +2 -1
  106. package/library/packages/atoms/src/animations/rotating/rotate.d.ts +4 -0
  107. package/library/packages/atoms/src/components/diff/diff.d.ts +46 -0
  108. package/library/packages/atoms/src/components/diff/diff.styles.d.ts +2 -0
  109. package/library/packages/atoms/src/components/diff/utils/diff-worker-client.d.ts +10 -0
  110. package/library/packages/atoms/src/components/select/select.d.ts +9 -9
  111. package/library/packages/atoms/src/components/tab-group/tab-group.d.ts +1 -1
  112. package/library/packages/atoms/src/components/table/components/index.d.ts +1 -0
  113. package/library/packages/atoms/src/components/table/components/table-footer/table-footer.d.ts +25 -0
  114. package/library/packages/atoms/src/components/table/components/table-footer/table-footer.styles.d.ts +2 -0
  115. package/library/packages/atoms/src/components/table/components/table-toolbar/table-toolbar.d.ts +7 -1
  116. package/library/packages/atoms/src/components/table/table.d.ts +14 -3
  117. package/library/packages/atoms/src/index.d.ts +1 -0
  118. package/library/packages/events/src/cx-capacity-change.d.ts +20 -0
  119. package/library/packages/events/src/cx-capacity-week-bar.d.ts +26 -0
  120. package/library/packages/events/src/cx-folder-select-children-loaded.d.ts +10 -0
  121. package/library/packages/events/src/cx-list-editor-change.d.ts +1 -1
  122. package/library/packages/events/src/cx-sb-dam-view-config-change.d.ts +8 -0
  123. package/library/packages/events/src/events.d.ts +4 -0
  124. package/library/packages/hybrid/table-core/src/tabulator-tables/modules/Format/defaults/formatters/diff.d.ts +5 -0
  125. package/library/packages/hybrid/table-core/src/tabulator-tables/modules/Format/defaults/formatters.d.ts +2 -0
  126. package/library/packages/molecules/src/dynamic-select/dynamic-select.d.ts +19 -1
  127. package/library/packages/molecules/src/folder-select/components/folder-select-tree/folder-select-tree.d.ts +11 -0
  128. package/library/packages/organisms/src/capacity-planner/capacity-core.d.ts +81 -0
  129. package/library/packages/organisms/src/capacity-planner/capacity-planner.d.ts +194 -0
  130. package/library/packages/organisms/src/capacity-planner/capacity-planner.styles.d.ts +2 -0
  131. package/library/packages/organisms/src/capacity-planner/components/capacity-toolbar/capacity-toolbar.d.ts +35 -0
  132. package/library/packages/organisms/src/capacity-planner/components/capacity-toolbar/capacity-toolbar.styles.d.ts +2 -0
  133. package/library/packages/organisms/src/capacity-planner/components/capacity-week-bar/capacity-week-bar.d.ts +101 -0
  134. package/library/packages/organisms/src/capacity-planner/components/capacity-week-bar/capacity-week-bar.styles.d.ts +2 -0
  135. package/library/packages/organisms/src/content-builder/components/config-form/config-form.d.ts +12 -0
  136. package/library/packages/organisms/src/content-builder/components/config-manager/config-manager.d.ts +6 -0
  137. package/library/packages/organisms/src/content-builder/configs/dam-view.d.ts +66 -0
  138. package/library/packages/organisms/src/content-builder/configs/index.d.ts +1 -0
  139. package/library/packages/organisms/src/content-builder/configs-controller.d.ts +110 -0
  140. package/library/packages/organisms/src/content-builder/content-builder-config.d.ts +3 -0
  141. package/library/packages/organisms/src/content-builder/content-builder.d.ts +1 -0
  142. package/library/packages/organisms/src/content-builder/plugins/dam-view.d.ts +5 -0
  143. package/library/packages/organisms/src/content-builder/plugins/index.d.ts +1 -0
  144. package/library/packages/organisms/src/content-builder/styleController.d.ts +7 -3
  145. package/library/packages/organisms/src/dam-custom-toolbar-buttons-editor/dam-custom-toolbar-buttons-editor.d.ts +176 -0
  146. package/library/packages/organisms/src/dam-custom-toolbar-buttons-editor/dam-custom-toolbar-buttons-editor.styles.d.ts +2 -0
  147. package/library/packages/organisms/src/index.d.ts +2 -0
  148. package/library/packages/services/src/api/cms5/cms5.d.ts +17 -1
  149. package/library/packages/services/src/api/endpoints.d.ts +13 -1
  150. package/library/packages/services/src/api/metadata/index.d.ts +1 -0
  151. package/library/packages/services/src/api/metadata/metadata.d.ts +3 -1
  152. package/library/packages/services/src/api/metadata/metadata.types.d.ts +53 -0
  153. package/library/packages/styles/src/table-select.styles.d.ts +2 -0
  154. package/library/packages/types/src/content-builder.d.ts +13 -5
  155. package/library/packages/types/src/dam-view.d.ts +48 -0
  156. package/library/packages/types/src/table.d.ts +17 -1
  157. package/library/packages/utils/src/custom-element/i18n.d.ts +95 -0
  158. package/library/packages/utils/src/custom-element/math.d.ts +8 -0
  159. package/library/packages/utils/src/date/index.d.ts +1 -0
  160. package/library/packages/utils/src/date/iso-week-number.d.ts +9 -0
  161. package/library/react-web-component.d.ts +545 -438
  162. package/library/utils.js +267 -253
  163. package/package.json +1 -1
  164. package/library/chunks/debounce.CIEhztrj.js +0 -97
  165. package/library/chunks/math.DqTA6ya4.js +0 -7
@@ -1,72 +1,73 @@
1
- import { C as N } from "./icon.DnBh6-56.js";
2
- import { C as ie } from "./input.CH4lKxPM.js";
3
- import H from "../components/line-clamp.js";
4
- import oe from "../components/select.js";
5
- import ce from "../components/tag.js";
6
- import { C as g, a as ne } from "./tree.Btf2Q4YZ.js";
7
- import { n as r, C as U } from "./lib-cortex-element.CVMmyPMC.js";
8
- import { h as R, F as he, c as de } from "./endpoints.D4h8hp1m.js";
9
- import { M as k } from "./asset-link-format.QzzboHHE.js";
10
- import { c as j } from "./component.styles.CRO4Odto.js";
11
- import { c as M } from "./custom-element.L4WJXn1j.js";
12
- import { L } from "./i18n.CH-wak_P.js";
1
+ import { C as K } from "./icon.DnBh6-56.js";
2
+ import { C as ce } from "./input.BYj6YXcM.js";
3
+ import X from "../components/line-clamp.js";
4
+ import he from "../components/select.js";
5
+ import de from "../components/tag.js";
6
+ import { C as $, a as pe } from "./tree.yYbWIRnc.js";
7
+ import { n as l, C as A } from "./lib-cortex-element.CVMmyPMC.js";
8
+ import { h as L, F as ue, c as fe } from "./endpoints.6E17hFiK.js";
9
+ import { M as V } from "./asset-link-format.QzzboHHE.js";
10
+ import { c as Y } from "./component.styles.CRO4Odto.js";
11
+ import { c as B } from "./custom-element.L4WJXn1j.js";
12
+ import { L as z } from "./i18n.DDj5y9px.js";
13
13
  import { w as f } from "./watch.CThbualB.js";
14
- import { x as m, i as pe } from "./lit-element.jLBm65_O.js";
14
+ import { x as m, i as me } from "./lit-element.jLBm65_O.js";
15
15
  import { r as x } from "./state.CSDxrqLd.js";
16
- import { e as Z } from "./query.BBf1UFkC.js";
17
- import { r as ue } from "./choose.BTbF6BAn.js";
18
- import { C as J } from "./button.DwJEeW2t.js";
19
- import { d as fe } from "./debounce.CIEhztrj.js";
20
- import { g as K, p as W, e as me } from "./string.DUgD4c9f.js";
16
+ import { e as ee } from "./query.BBf1UFkC.js";
17
+ import { r as ye } from "./choose.BTbF6BAn.js";
18
+ import { C as te } from "./button.bufNNyTc.js";
19
+ import { d as xe } from "./debounce.DaHuiSGU.js";
20
+ import { g as M, p as N, e as be } from "./string.DUgD4c9f.js";
21
21
  import { o as y } from "./if-defined.BRoBj_Rp.js";
22
- import { c as X } from "./repeat.DbF2p5ae.js";
23
- import { n as _ } from "./when.Dr1es41R.js";
24
- import ye from "../components/space.js";
25
- import { g as xe } from "./template.ClovJacp.js";
26
- import { e as be } from "./class-map.BiVq-cVR.js";
22
+ import { c as G } from "./repeat.DbF2p5ae.js";
23
+ import { o as ge } from "./style-map.llVFPd__.js";
24
+ import { n as w } from "./when.Dr1es41R.js";
25
+ import $e from "../components/space.js";
26
+ import { g as ve } from "./template.ClovJacp.js";
27
+ import { e as Se } from "./class-map.BiVq-cVR.js";
27
28
  var v = /* @__PURE__ */ ((e) => (e.CortexPath = "Document.CortexPath", e.DocType = "CoreField.DocType", e.HasBrowserChildren = "Document.HasBrowserChildren", e.RepresentativeAssetId = "Document.DocumentDirectRepresentativeRID", e.TitleWithFallback = "CoreField.TitleWithFallback", e.rawDocSubtype = "Document.RawDocSubType", e))(v || {});
28
- const ge = 50;
29
- async function G({
29
+ const Fe = 50;
30
+ async function W({
30
31
  allowedFolders: e,
31
32
  baseUrl: t,
32
- bearerToken: s,
33
- excludeVirtualFolders: l,
34
- folderId: a,
33
+ bearerToken: r,
34
+ excludeVirtualFolders: a,
35
+ folderId: s,
35
36
  includeDirectChild: p,
36
- limit: u = ge,
37
- searchTerm: $,
38
- self: F,
39
- start: A = 0,
40
- token: se
37
+ limit: u = Fe,
38
+ searchTerm: b,
39
+ self: T,
40
+ start: q = 0,
41
+ token: ie
41
42
  }) {
42
- let w = [], z = p ?? !0;
43
- e && e.length > 0 && !a ? (w = e, F = !0, z = !1) : a && (w = [a]);
43
+ let O = [], Q = p ?? !0;
44
+ e && e.length > 0 && !s ? (O = e, T = !0, Q = !1) : s && (O = [s]);
44
45
  try {
45
- return (await R.request({
46
+ return (await L.request({
46
47
  baseURL: t,
47
48
  headers: {
48
- Authorization: `Bearer ${s}`
49
+ Authorization: `Bearer ${r}`
49
50
  },
50
51
  method: "GET",
51
52
  params: {
52
- IncludeDirectChild: z,
53
- IncludeVirtualFolders: !l,
53
+ IncludeDirectChild: Q,
54
+ IncludeVirtualFolders: !a,
54
55
  Limit: u,
55
- ObjectRecordIDs: w,
56
- SeeThru: !!$,
57
- Self: F,
58
- Start: A,
59
- Text: $ || void 0,
60
- Token: se || void 0
56
+ ObjectRecordIDs: O,
57
+ SeeThru: !!b,
58
+ Self: T,
59
+ Start: q,
60
+ Text: b || void 0,
61
+ Token: ie || void 0
61
62
  },
62
63
  paramsSerializer: {
63
64
  indexes: null
64
65
  },
65
66
  responseType: "json",
66
67
  transformResponse: [
67
- ...Array.isArray(R.defaults.transformResponse) ? R.defaults.transformResponse : [],
68
- (S, Oe, O) => {
69
- if (O !== void 0 && (O < 200 || O >= 300))
68
+ ...Array.isArray(L.defaults.transformResponse) ? L.defaults.transformResponse : [],
69
+ (S, Pe, P) => {
70
+ if (P !== void 0 && (P < 200 || P >= 300))
70
71
  return {
71
72
  data: [],
72
73
  hasMore: !1,
@@ -74,27 +75,27 @@ async function G({
74
75
  };
75
76
  if (!S || typeof S != "object")
76
77
  throw new Error("Invalid response format");
77
- const le = S.contentItems?.length ?? 0;
78
+ const ne = S.contentItems?.length ?? 0;
78
79
  return {
79
- data: S.contentItems?.map((b) => {
80
- const P = b.fields[v.DocType] ?? "", E = b.fields[v.TitleWithFallback] ?? "", I = b.fields[v.CortexPath] ?? "", V = I.endsWith("/") && I.length > 1 ? I.slice(0, -1) : I;
81
- let B = V;
82
- return (P === k.Album || P === k.ProjectDocument) && (B = V ? `${V}/${E}` : E), {
83
- docType: P,
84
- fullPath: B,
85
- hasChildren: b.fields[v.HasBrowserChildren] === "1",
86
- id: b.recordID,
87
- isShared: b.fields[v.rawDocSubtype] === "DO_OR1ND000001913488",
88
- representativeAssetId: b.fields[v.RepresentativeAssetId] ?? "",
80
+ data: S.contentItems?.map((g) => {
81
+ const R = g.fields[v.DocType] ?? "", E = g.fields[v.TitleWithFallback] ?? "", k = g.fields[v.CortexPath] ?? "", U = k.endsWith("/") && k.length > 1 ? k.slice(0, -1) : k;
82
+ let H = U;
83
+ return (R === V.Album || R === V.ProjectDocument) && (H = U ? `${U}/${E}` : E), {
84
+ docType: R,
85
+ fullPath: H,
86
+ hasChildren: g.fields[v.HasBrowserChildren] === "1",
87
+ id: g.recordID,
88
+ isShared: g.fields[v.rawDocSubtype] === "DO_OR1ND000001913488",
89
+ representativeAssetId: g.fields[v.RepresentativeAssetId] ?? "",
89
90
  title: E
90
91
  };
91
92
  }) ?? [],
92
- hasMore: A + le < S.totalCount,
93
+ hasMore: q + ne < S.totalCount,
93
94
  totalCount: S.totalCount
94
95
  };
95
96
  }
96
97
  ],
97
- url: he
98
+ url: ue
98
99
  })).data;
99
100
  } catch {
100
101
  return {
@@ -104,14 +105,14 @@ async function G({
104
105
  };
105
106
  }
106
107
  }
107
- var C = /* @__PURE__ */ ((e) => (e.Input = "input", e.Select = "select", e))(C || {}), ve = Object.defineProperty, $e = Object.getOwnPropertyDescriptor, h = (e, t, s, l) => {
108
- for (var a = l > 1 ? void 0 : l ? $e(t, s) : t, p = e.length - 1, u; p >= 0; p--)
109
- (u = e[p]) && (a = (l ? u(t, s, a) : u(a)) || a);
110
- return l && a && ve(t, s, a), a;
108
+ var C = /* @__PURE__ */ ((e) => (e.Input = "input", e.Select = "select", e))(C || {}), Te = Object.defineProperty, Ie = Object.getOwnPropertyDescriptor, h = (e, t, r, a) => {
109
+ for (var s = a > 1 ? void 0 : a ? Ie(t, r) : t, p = e.length - 1, u; p >= 0; p--)
110
+ (u = e[p]) && (s = (a ? u(t, r, s) : u(s)) || s);
111
+ return a && s && Te(t, r, s), s;
111
112
  };
112
- let o = class extends U {
113
+ let o = class extends A {
113
114
  constructor() {
114
- super(...arguments), this.localize = new L(this), this.role = "treeitem", this.disabledSyncCheckboxes = !0, this.folderId = "", this.hasChildren = !1, this.selectable = !1, this.fullPath = "", this.docType = k.Story, this.name = "", this.representativeAssetId = "", this.selectedValue = "", this.selection = "single", this.currentRootIDsSet = /* @__PURE__ */ new Set(), this.removedIDs = [], this.token = "", this.bearerToken = "", this.baseUrl = "", this.searchTerm = "", this.api = G, this.excludeVirtualFolders = !1, this.url = "", this.icon = "", this.data = null, this.hasMore = !1, this.loading = !1;
115
+ super(...arguments), this.localize = new z(this), this.role = "treeitem", this.disabledSyncCheckboxes = !0, this.folderId = "", this.hasChildren = !1, this.selectable = !1, this.fullPath = "", this.docType = V.Story, this.name = "", this.representativeAssetId = "", this.selectedValue = "", this.selection = "single", this.currentRootIDsSet = /* @__PURE__ */ new Set(), this.removedIDs = [], this.token = "", this.bearerToken = "", this.baseUrl = "", this.searchTerm = "", this.api = W, this.excludeVirtualFolders = !1, this.url = "", this.icon = "", this.data = null, this.hasMore = !1, this.loading = !1;
115
116
  }
116
117
  /**
117
118
  * This is used to render the cx-tree-item inside the cx-folder-item without the shadow root so that the cx-tree can query select the cx-tree-item inside
@@ -130,7 +131,7 @@ let o = class extends U {
130
131
  totalCount: 0
131
132
  };
132
133
  try {
133
- const { data: s, hasMore: l, totalCount: a } = await this.api({
134
+ const { data: r, hasMore: a, totalCount: s } = await this.api({
134
135
  baseUrl: this.baseUrl,
135
136
  bearerToken: this.bearerToken,
136
137
  excludeVirtualFolders: this.excludeVirtualFolders,
@@ -139,9 +140,9 @@ let o = class extends U {
139
140
  token: this.token
140
141
  });
141
142
  return {
142
- data: s,
143
- hasMore: l,
144
- totalCount: a
143
+ data: r,
144
+ hasMore: a,
145
+ totalCount: s
145
146
  };
146
147
  } catch {
147
148
  return {
@@ -156,11 +157,11 @@ let o = class extends U {
156
157
  const t = this.data?.length || 0;
157
158
  this.loading = !0;
158
159
  try {
159
- const { data: s, hasMore: l } = await this.fetchFolders({
160
+ const { data: r, hasMore: a } = await this.fetchFolders({
160
161
  folderId: this.folderId,
161
162
  start: t
162
163
  });
163
- this.data = [...this.data || [], ...s], this.hasMore = l;
164
+ this.data = [...this.data || [], ...r], this.hasMore = a, this.emit("cx-folder-select-children-loaded", { detail: { folders: r } });
164
165
  } catch {
165
166
  } finally {
166
167
  this.loading = !1;
@@ -170,11 +171,11 @@ let o = class extends U {
170
171
  e.stopPropagation(), this.treeItem.expanded = !0;
171
172
  const t = this.data?.length || 0;
172
173
  try {
173
- const { data: s, hasMore: l } = await this.fetchFolders({
174
+ const { data: r, hasMore: a } = await this.fetchFolders({
174
175
  folderId: this.folderId,
175
176
  start: t
176
177
  });
177
- this.data = s, this.hasMore = l;
178
+ this.data = r, this.hasMore = a, this.emit("cx-folder-select-children-loaded", { detail: { folders: r } });
178
179
  } catch {
179
180
  this.treeItem.expanded = !1;
180
181
  }
@@ -182,114 +183,114 @@ let o = class extends U {
182
183
  async syncBoxes() {
183
184
  if (this.selection !== "multiple" || (await this.updateComplete, !this.treeItem))
184
185
  return;
185
- const e = this.fullPath, t = K({ id: this.folderId, path: e }), s = W(e), l = this.currentRootIDsSet.has(t);
186
- let a = !1;
186
+ const e = this.fullPath, t = M({ id: this.folderId, path: e }), r = N(e), a = this.currentRootIDsSet.has(t);
187
+ let s = !1;
187
188
  if (e)
188
189
  for (const u of this.currentRootIDsSet) {
189
- const $ = me(u);
190
- if (!$.path.trim() || !$.id.trim())
190
+ const b = be(u);
191
+ if (!b.path.trim() || !b.id.trim())
191
192
  continue;
192
- const F = W($.path);
193
- if (F.startsWith(s) && F !== s) {
194
- a = !0;
193
+ const T = N(b.path);
194
+ if (T.startsWith(r) && T !== r) {
195
+ s = !0;
195
196
  break;
196
197
  }
197
198
  }
198
- const p = !l && a;
199
- this.treeItem.selected = l, await this.treeItem.updateComplete, this.treeItem.indeterminate = p;
199
+ const p = !a && s;
200
+ this.treeItem.selected = a, await this.treeItem.updateComplete, this.treeItem.indeterminate = p;
200
201
  }
201
202
  render() {
202
203
  let e = "filled";
203
- return this.docType === k.Album && (e = "outlined"), m`<cx-tree-item class=${be({
204
+ return this.docType === V.Album && (e = "outlined"), m`<cx-tree-item class=${Se({
204
205
  "folder-select-tree-item": !0
205
206
  })} data-id=${this.folderId} data-url=${y(this.url)} data-name=${y(this.name?.trim() || void 0)} data-representative-asset-id=${y(
206
207
  this.representativeAssetId || void 0
207
- )} role="option" ?lazy=${this.hasChildren && this.data === null} ?selected=${this.selection !== "multiple" && this.selectedValue === this.folderId} ?disabled-sync-checkboxes=${this.selection === "multiple"} .selectable=${this.selectable} @cx-lazy-load=${this.handleLazyLoad}><cx-space class="folder-select-tree-item__label" direction="horizontal" spacing="x-small" align-items="center" wrap="nowrap"><cx-icon class="folder-select-tree__item__icon" name=${this.icon || "folder"} variant=${e}></cx-icon><cx-line-clamp lines="1" class="folder-select-tree-item__title">${xe(this.name, this.searchTerm)}</cx-line-clamp></cx-space>${X(
208
+ )} role="option" ?lazy=${this.hasChildren && this.data === null} ?selected=${this.selection !== "multiple" && this.selectedValue === this.folderId} ?disabled-sync-checkboxes=${this.selection === "multiple"} .selectable=${this.selectable} @cx-lazy-load=${this.handleLazyLoad}><cx-space class="folder-select-tree-item__label" direction="horizontal" spacing="x-small" align-items="center" wrap="nowrap"><cx-icon class="folder-select-tree__item__icon" name=${this.icon || "folder"} variant=${e}></cx-icon><cx-line-clamp lines="1" class="folder-select-tree-item__title">${ve(this.name, this.searchTerm)}</cx-line-clamp></cx-space>${G(
208
209
  this.data || [],
209
210
  (t) => t.id,
210
211
  (t) => m`<cx-folder-select-tree-item slot="children" folder-id=${t.id} full-path=${t.fullPath} name=${t.title} representative-asset-id=${t.representativeAssetId} selected-value=${this.selectedValue} selection=${this.selection} token=${this.token} bearer-token=${this.bearerToken} ?exclude-virtual-folders=${this.excludeVirtualFolders} ?has-children=${t.hasChildren} ?selectable=${this.selectable} base-url=${this.baseUrl} url=${y(t.url ?? void 0)} .api=${this.api} .currentRootIDsSet=${this.currentRootIDsSet} .removedIDs=${this.removedIDs} value=${t.url}></cx-folder-select-tree-item>`
211
- )}</cx-tree-item>${_(
212
+ )}</cx-tree-item>${w(
212
213
  this.hasMore,
213
214
  () => m`<div slot="children" class="load-more-button"><cx-button variant="text" @click=${this.loadMore} ?loading=${this.loading}>${this.localize.term("more")}</cx-button></div>`
214
215
  )}
215
216
  `;
216
217
  }
217
218
  };
218
- o.styles = [j];
219
+ o.styles = [Y];
219
220
  o.dependencies = {
220
- "cx-button": J,
221
- "cx-icon": N,
222
- "cx-line-clamp": H,
223
- "cx-space": ye,
224
- "cx-tree-item": g
221
+ "cx-button": te,
222
+ "cx-icon": K,
223
+ "cx-line-clamp": X,
224
+ "cx-space": $e,
225
+ "cx-tree-item": $
225
226
  };
226
227
  h([
227
- Z("cx-tree-item")
228
+ ee("cx-tree-item")
228
229
  ], o.prototype, "treeItem", 2);
229
230
  h([
230
- r({ attribute: "folder-id", reflect: !0, type: String })
231
+ l({ attribute: "folder-id", reflect: !0, type: String })
231
232
  ], o.prototype, "folderId", 2);
232
233
  h([
233
- r({ attribute: "has-children", reflect: !0, type: Boolean })
234
+ l({ attribute: "has-children", reflect: !0, type: Boolean })
234
235
  ], o.prototype, "hasChildren", 2);
235
236
  h([
236
- r({ reflect: !0, type: Boolean })
237
+ l({ reflect: !0, type: Boolean })
237
238
  ], o.prototype, "selectable", 2);
238
239
  h([
239
- r({ attribute: "full-path", reflect: !0, type: String })
240
+ l({ attribute: "full-path", reflect: !0, type: String })
240
241
  ], o.prototype, "fullPath", 2);
241
242
  h([
242
- r({ attribute: "doc-type", reflect: !0, type: String })
243
+ l({ attribute: "doc-type", reflect: !0, type: String })
243
244
  ], o.prototype, "docType", 2);
244
245
  h([
245
- r({ reflect: !0, type: String })
246
+ l({ reflect: !0, type: String })
246
247
  ], o.prototype, "name", 2);
247
248
  h([
248
- r({
249
+ l({
249
250
  attribute: "representative-asset-id",
250
251
  reflect: !0,
251
252
  type: String
252
253
  })
253
254
  ], o.prototype, "representativeAssetId", 2);
254
255
  h([
255
- r({ attribute: "selected-value", reflect: !0, type: String })
256
+ l({ attribute: "selected-value", reflect: !0, type: String })
256
257
  ], o.prototype, "selectedValue", 2);
257
258
  h([
258
- r({ attribute: "selection", reflect: !0, type: String })
259
+ l({ attribute: "selection", reflect: !0, type: String })
259
260
  ], o.prototype, "selection", 2);
260
261
  h([
261
- r({ attribute: !1, type: Object })
262
+ l({ attribute: !1, type: Object })
262
263
  ], o.prototype, "currentRootIDsSet", 2);
263
264
  h([
264
- r({ attribute: !1, type: Array })
265
+ l({ attribute: !1, type: Array })
265
266
  ], o.prototype, "removedIDs", 2);
266
267
  h([
267
- r({ reflect: !0, type: String })
268
+ l({ reflect: !0, type: String })
268
269
  ], o.prototype, "token", 2);
269
270
  h([
270
- r({ attribute: "bearer-token", reflect: !0, type: String })
271
+ l({ attribute: "bearer-token", reflect: !0, type: String })
271
272
  ], o.prototype, "bearerToken", 2);
272
273
  h([
273
- r({ attribute: "base-url", reflect: !0, type: String })
274
+ l({ attribute: "base-url", reflect: !0, type: String })
274
275
  ], o.prototype, "baseUrl", 2);
275
276
  h([
276
- r({ attribute: "search-term", reflect: !0, type: String })
277
+ l({ attribute: "search-term", reflect: !0, type: String })
277
278
  ], o.prototype, "searchTerm", 2);
278
279
  h([
279
- r({ type: Function })
280
+ l({ type: Function })
280
281
  ], o.prototype, "api", 2);
281
282
  h([
282
- r({
283
+ l({
283
284
  attribute: "exclude-virtual-folders",
284
285
  reflect: !0,
285
286
  type: Boolean
286
287
  })
287
288
  ], o.prototype, "excludeVirtualFolders", 2);
288
289
  h([
289
- r({ reflect: !0, type: String })
290
+ l({ reflect: !0, type: String })
290
291
  ], o.prototype, "url", 2);
291
292
  h([
292
- r({ reflect: !0, type: String })
293
+ l({ reflect: !0, type: String })
293
294
  ], o.prototype, "icon", 2);
294
295
  h([
295
296
  x()
@@ -307,18 +308,18 @@ h([
307
308
  f("folderId")
308
309
  ], o.prototype, "syncBoxes", 1);
309
310
  o = h([
310
- M("cx-folder-select-tree-item")
311
+ B("cx-folder-select-tree-item")
311
312
  ], o);
312
- var Se = Object.defineProperty, Te = Object.getOwnPropertyDescriptor, Y = (e) => {
313
+ var Ce = Object.defineProperty, De = Object.getOwnPropertyDescriptor, re = (e) => {
313
314
  throw TypeError(e);
314
- }, d = (e, t, s, l) => {
315
- for (var a = l > 1 ? void 0 : l ? Te(t, s) : t, p = e.length - 1, u; p >= 0; p--)
316
- (u = e[p]) && (a = (l ? u(t, s, a) : u(a)) || a);
317
- return l && a && Se(t, s, a), a;
318
- }, ee = (e, t, s) => t.has(e) || Y("Cannot " + s), Fe = (e, t, s) => (ee(e, t, "read from private field"), t.get(e)), Ce = (e, t, s) => t.has(e) ? Y("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), Ie = (e, t, s, l) => (ee(e, t, "write to private field"), t.set(e, s), s), D;
319
- let n = class extends U {
315
+ }, d = (e, t, r, a) => {
316
+ for (var s = a > 1 ? void 0 : a ? De(t, r) : t, p = e.length - 1, u; p >= 0; p--)
317
+ (u = e[p]) && (s = (a ? u(t, r, s) : u(s)) || s);
318
+ return a && s && Ce(t, r, s), s;
319
+ }, se = (e, t, r) => t.has(e) || re("Cannot " + r), I = (e, t, r) => (se(e, t, "read from private field"), t.get(e)), j = (e, t, r) => t.has(e) ? re("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), _e = (e, t, r, a) => (se(e, t, "write to private field"), t.set(e, r), r), D, _;
320
+ let n = class extends A {
320
321
  constructor() {
321
- super(...arguments), this.localize = new L(this), this.minQueryLength = 1, this.selection = "single", this.searchTerm = "", this.selectedValue = "", this.token = "", this.bearerToken = "", this.baseUrl = "", this.extraFolderId = "", this.extraFolderTitle = "", this.extraFolderIcon = "", this.seeThru = !1, this.extraFolderData = null, this.api = G, this.excludeVirtualFolders = !1, this.firstFetchCallback = null, this.data = [], this.hasMore = !1, this.loading = !1, this.currentRootIDsSet = /* @__PURE__ */ new Set(), this.removedIDs = [], Ce(this, D, !1);
322
+ super(...arguments), this.localize = new z(this), this.minQueryLength = 1, this.selection = "single", this.searchTerm = "", this.selectedValue = "", this.token = "", this.bearerToken = "", this.baseUrl = "", this.extraFolderId = "", this.extraFolderTitle = "", this.extraFolderIcon = "", this.seeThru = !1, this.extraFolderData = null, this.api = W, this.excludeVirtualFolders = !1, this.firstFetchCallback = null, this.data = [], this.hasMore = !1, this.loading = !1, this.preloadedFolders = [], this.currentRootIDsSet = /* @__PURE__ */ new Set(), this.removedIDs = [], j(this, D, !1), j(this, _, /* @__PURE__ */ new Set());
322
323
  }
323
324
  get empty() {
324
325
  return !this.loading && this.data.length === 0;
@@ -365,13 +366,13 @@ let n = class extends U {
365
366
  async handleSelectedChange(e) {
366
367
  if (this.selection !== "multiple")
367
368
  return;
368
- const t = e.target, s = t.dataset.id ?? "", l = t.closest(
369
+ const t = e.target, r = t.dataset.id ?? "", a = t.closest(
369
370
  "cx-folder-select-tree-item"
370
371
  )?.fullPath;
371
- if (await t.updateComplete, !s.trim() || !l?.trim())
372
+ if (await t.updateComplete, !r.trim() || !a?.trim())
372
373
  return;
373
- const a = K({ id: s, path: l });
374
- t.indeterminate && !t.selected || (t.selected ? this.currentRootIDsSet.add(a) : this.currentRootIDsSet.delete(a), this.currentRootIDsSet = new Set(this.currentRootIDsSet));
374
+ const s = M({ id: r, path: a });
375
+ t.indeterminate && !t.selected || (t.selected ? this.currentRootIDsSet.add(s) : this.currentRootIDsSet.delete(s), this.currentRootIDsSet = new Set(this.currentRootIDsSet));
375
376
  }
376
377
  async loadMore(e) {
377
378
  if (!this.api)
@@ -379,7 +380,7 @@ let n = class extends U {
379
380
  e.stopPropagation();
380
381
  const t = this.data.length;
381
382
  this.loading = !0;
382
- const { data: s, hasMore: l } = await this.api({
383
+ const { data: r, hasMore: a } = await this.api({
383
384
  baseUrl: this.baseUrl,
384
385
  bearerToken: this.bearerToken,
385
386
  excludeVirtualFolders: this.excludeVirtualFolders,
@@ -390,11 +391,19 @@ let n = class extends U {
390
391
  start: t,
391
392
  token: this.token
392
393
  });
393
- this.data = [...this.data, ...s], this.hasMore = l, this.loading = !1;
394
+ this.data = [...this.data, ...r], this.hasMore = a, this.loading = !1, this.seedSelectionFromValue(r), this.removePreloadedFolders(r);
394
395
  }
395
396
  async handleFetchFolders() {
396
397
  const { data: e, hasMore: t } = await this.fetchFolders();
397
- Fe(this, D) || e.length > 0 && (this.firstFetchCallback?.(e), Ie(this, D, !0)), this.data = e, this.hasMore = t, this.loading = !1;
398
+ I(this, D) || (e.length > 0 && this.firstFetchCallback?.(e), _e(this, D, !0)), this.data = e, this.hasMore = t, this.loading = !1, this.seedSelectionFromValue(e), this.removePreloadedFolders(e), await this.preloadSelectedFolders();
399
+ }
400
+ async handleSelectedValueChange() {
401
+ if (!I(this, D))
402
+ return;
403
+ const e = new Set(
404
+ this.selectedValue.split(/[\s,]+/).filter(Boolean)
405
+ ), t = this.preloadedFolders.filter((r) => e.has(r.id));
406
+ t.length !== this.preloadedFolders.length && (this.preloadedFolders = t), await this.preloadSelectedFolders();
398
407
  }
399
408
  async fetchFolders() {
400
409
  if (!this.api)
@@ -424,83 +433,160 @@ let n = class extends U {
424
433
  hasMore: t
425
434
  };
426
435
  }
436
+ handleChildrenLoaded(e) {
437
+ this.seedSelectionFromValue(e.detail.folders), this.removePreloadedFolders(e.detail.folders);
438
+ }
439
+ removePreloadedFolders(e) {
440
+ if (this.preloadedFolders.length === 0)
441
+ return;
442
+ const t = new Set(e.map((a) => a.id)), r = this.preloadedFolders.filter((a) => !t.has(a.id));
443
+ r.length !== this.preloadedFolders.length && (this.preloadedFolders = r);
444
+ }
445
+ async preloadSelectedFolders() {
446
+ if (this.selection !== "multiple" || !this.selectedValue || !this.api)
447
+ return;
448
+ const e = new Set(
449
+ this.selectedValue.split(/[\s,]+/).filter(Boolean)
450
+ ), t = /* @__PURE__ */ new Set([
451
+ ...this.data.map((s) => s.id),
452
+ ...this.extraFolderData ? [this.extraFolderData.id] : [],
453
+ ...this.preloadedFolders.map((s) => s.id),
454
+ ...I(this, _),
455
+ ...[
456
+ ...this.querySelectorAll(
457
+ "cx-folder-select-tree-item"
458
+ )
459
+ ].map((s) => s.getAttribute("folder-id") ?? "").filter(Boolean)
460
+ ]), r = [...e].filter(
461
+ (s) => !t.has(s)
462
+ );
463
+ if (r.length === 0)
464
+ return;
465
+ r.forEach((s) => I(this, _).add(s));
466
+ const a = [];
467
+ if (await Promise.all(
468
+ r.map(async (s) => {
469
+ try {
470
+ const { data: p } = await this.api({
471
+ baseUrl: this.baseUrl,
472
+ bearerToken: this.bearerToken,
473
+ excludeVirtualFolders: this.excludeVirtualFolders,
474
+ folderId: s,
475
+ includeDirectChild: !1,
476
+ limit: 1,
477
+ searchTerm: "",
478
+ seeThru: this.seeThru,
479
+ self: !0,
480
+ start: 0,
481
+ token: this.token
482
+ });
483
+ p[0] && a.push(p[0]);
484
+ } catch {
485
+ }
486
+ })
487
+ ), r.forEach((s) => I(this, _).delete(s)), a.length > 0) {
488
+ const s = new Set(this.preloadedFolders.map((u) => u.id)), p = a.filter((u) => !s.has(u.id));
489
+ p.length > 0 && (this.preloadedFolders = [...this.preloadedFolders, ...p].sort(
490
+ (u, b) => u.title.localeCompare(b.title)
491
+ ), this.seedSelectionFromValue(p));
492
+ }
493
+ }
494
+ seedSelectionFromValue(e) {
495
+ if (this.selection !== "multiple" || !this.selectedValue)
496
+ return;
497
+ const t = new Set(
498
+ this.selectedValue.split(/[\s,]+/).map((a) => a.trim()).filter(Boolean)
499
+ );
500
+ let r = !1;
501
+ for (const a of e)
502
+ if (a.fullPath && t.has(a.id)) {
503
+ const s = M({ id: a.id, path: a.fullPath });
504
+ this.currentRootIDsSet.has(s) || (this.currentRootIDsSet.add(s), r = !0);
505
+ }
506
+ r && (this.currentRootIDsSet = new Set(this.currentRootIDsSet));
507
+ }
427
508
  renderFolder(e) {
428
509
  return m`<cx-folder-select-tree-item .api=${this.api} .currentRootIDsSet=${this.currentRootIDsSet} .removedIDs=${this.removedIDs} base-url=${this.baseUrl} doc-type=${e.docType} folder-id=${e.id} full-path=${y(e.fullPath ?? void 0)} name=${e.title} search-term=${this.searchTerm} selected-value=${this.selectedValue} selection=${this.selection} token=${this.token} bearer-token=${this.bearerToken} url=${y(e.url ?? void 0)} ?has-children=${e.hasChildren} ?selectable=${this.selection === "multiple"} ?exclude-virtual-folders=${this.excludeVirtualFolders}></cx-folder-select-tree-item>`;
429
510
  }
430
511
  render() {
431
- return m`<cx-tree class="folder-select-tree" selection=${this.selection} force-on-change disabled-auto-expand disabled-sync-checkboxes @cx-selected-change=${this.handleSelectedChange}>${_(
512
+ return m`<cx-tree class="folder-select-tree" selection=${this.selection} force-on-change disabled-auto-expand disabled-sync-checkboxes @cx-selected-change=${this.handleSelectedChange} @cx-folder-select-children-loaded=${this.handleChildrenLoaded}>${w(
432
513
  this.empty,
433
514
  () => m`<div class="folder-select-tree__empty-message" role="status" aria-live="polite"><cx-typography variant="body3">${this.localize.term("noResults")}</cx-typography></div>`
434
515
  )}
435
- ${_(
516
+ ${w(
436
517
  this.extraFolderData,
437
518
  () => m`<cx-folder-select-tree-item .api=${this.api} .currentRootIDsSet=${this.currentRootIDsSet} .removedIDs=${this.removedIDs} base-url=${this.baseUrl} doc-type=${y(this.extraFolderData?.docType ?? void 0)} folder-id=${y(this.extraFolderData?.id ?? void 0)} full-path=${y(this.extraFolderData?.fullPath ?? void 0)} icon=${this.extraFolderIcon} name=${this.extraFolderTitle || this.extraFolderData?.title} search-term=${this.searchTerm} selected-value=${this.selectedValue} selection=${this.selection} token=${this.token} bearer-token=${this.bearerToken} url=${y(this.extraFolderData?.url ?? void 0)} ?has-children=${this.extraFolderData?.hasChildren} ?selectable=${this.selection === "multiple"} ?exclude-virtual-folders=${this.excludeVirtualFolders}></cx-folder-select-tree-item>`
438
519
  )}
439
- ${X(
520
+ ${G(
440
521
  this.data,
441
522
  (e) => e.id,
442
523
  (e) => this.renderFolder(e)
443
524
  )}
444
- ${_(
525
+ ${w(
445
526
  this.hasMore,
446
527
  () => m`<cx-button class="folder-select-tree__load-more" variant="text" @click=${this.loadMore} ?loading=${this.loading}>${this.localize.term("more")}</cx-button>`
447
- )}</cx-tree>`;
528
+ )}</cx-tree>${G(
529
+ this.preloadedFolders,
530
+ (e) => `preloaded-${e.id}`,
531
+ (e) => m`<cx-folder-select-tree-item style=${ge({ display: "none" })} .api=${this.api} .currentRootIDsSet=${this.currentRootIDsSet} .removedIDs=${this.removedIDs} base-url=${this.baseUrl} doc-type=${e.docType} folder-id=${e.id} full-path=${y(e.fullPath ?? void 0)} name=${e.title} search-term=${this.searchTerm} selected-value=${this.selectedValue} selection=${this.selection} token=${this.token} bearer-token=${this.bearerToken} url=${y(e.url ?? void 0)} ?has-children=${!1} ?selectable=${this.selection === "multiple"} ?exclude-virtual-folders=${this.excludeVirtualFolders}></cx-folder-select-tree-item>`
532
+ )}`;
448
533
  }
449
534
  };
450
535
  D = /* @__PURE__ */ new WeakMap();
536
+ _ = /* @__PURE__ */ new WeakMap();
451
537
  n.dependencies = {
452
- "cx-button": J,
538
+ "cx-button": te,
453
539
  "cx-folder-select-tree-item": o,
454
- "cx-tree": ne
540
+ "cx-tree": pe
455
541
  };
456
542
  d([
457
- r({ attribute: "min-query-length", reflect: !0, type: Number })
543
+ l({ attribute: "min-query-length", reflect: !0, type: Number })
458
544
  ], n.prototype, "minQueryLength", 2);
459
545
  d([
460
- r({ attribute: "selection", reflect: !0, type: String })
546
+ l({ attribute: "selection", reflect: !0, type: String })
461
547
  ], n.prototype, "selection", 2);
462
548
  d([
463
- r({ attribute: "search-term", reflect: !0, type: String })
549
+ l({ attribute: "search-term", reflect: !0, type: String })
464
550
  ], n.prototype, "searchTerm", 2);
465
551
  d([
466
- r({ attribute: "selected-value", reflect: !0, type: String })
552
+ l({ attribute: "selected-value", reflect: !0, type: String })
467
553
  ], n.prototype, "selectedValue", 2);
468
554
  d([
469
- r({ reflect: !0, type: String })
555
+ l({ reflect: !0, type: String })
470
556
  ], n.prototype, "token", 2);
471
557
  d([
472
- r({ attribute: "bearer-token", reflect: !0, type: String })
558
+ l({ attribute: "bearer-token", reflect: !0, type: String })
473
559
  ], n.prototype, "bearerToken", 2);
474
560
  d([
475
- r({ attribute: "base-url", reflect: !0, type: String })
561
+ l({ attribute: "base-url", reflect: !0, type: String })
476
562
  ], n.prototype, "baseUrl", 2);
477
563
  d([
478
- r({ attribute: "extra-folder-id", reflect: !0, type: String })
564
+ l({ attribute: "extra-folder-id", reflect: !0, type: String })
479
565
  ], n.prototype, "extraFolderId", 2);
480
566
  d([
481
- r({ attribute: "extra-folder-title", reflect: !0, type: String })
567
+ l({ attribute: "extra-folder-title", reflect: !0, type: String })
482
568
  ], n.prototype, "extraFolderTitle", 2);
483
569
  d([
484
- r({ attribute: "extra-folder-icon", reflect: !0, type: String })
570
+ l({ attribute: "extra-folder-icon", reflect: !0, type: String })
485
571
  ], n.prototype, "extraFolderIcon", 2);
486
572
  d([
487
- r({ attribute: "see-thru", reflect: !0, type: Boolean })
573
+ l({ attribute: "see-thru", reflect: !0, type: Boolean })
488
574
  ], n.prototype, "seeThru", 2);
489
575
  d([
490
576
  x()
491
577
  ], n.prototype, "extraFolderData", 2);
492
578
  d([
493
- r({ type: Function })
579
+ l({ type: Function })
494
580
  ], n.prototype, "api", 2);
495
581
  d([
496
- r({
582
+ l({
497
583
  attribute: "exclude-virtual-folders",
498
584
  reflect: !0,
499
585
  type: Boolean
500
586
  })
501
587
  ], n.prototype, "excludeVirtualFolders", 2);
502
588
  d([
503
- r({ attribute: "first-fetch-callback", reflect: !1, type: Function })
589
+ l({ attribute: "first-fetch-callback", reflect: !1, type: Function })
504
590
  ], n.prototype, "firstFetchCallback", 2);
505
591
  d([
506
592
  x()
@@ -511,6 +597,9 @@ d([
511
597
  d([
512
598
  x()
513
599
  ], n.prototype, "loading", 2);
600
+ d([
601
+ x()
602
+ ], n.prototype, "preloadedFolders", 2);
514
603
  d([
515
604
  x()
516
605
  ], n.prototype, "currentRootIDsSet", 2);
@@ -525,33 +614,36 @@ d([
525
614
  f("token", { waitUntilFirstUpdate: !0 }),
526
615
  f("searchTerm", { waitUntilFirstUpdate: !0 }),
527
616
  f("excludeVirtualFolders", { waitUntilFirstUpdate: !0 }),
528
- fe(500)
617
+ xe(500)
529
618
  ], n.prototype, "handleFetchFolders", 1);
619
+ d([
620
+ f("selectedValue", { waitUntilFirstUpdate: !0 })
621
+ ], n.prototype, "handleSelectedValueChange", 1);
530
622
  n = d([
531
- M("cx-folder-select-tree")
623
+ B("cx-folder-select-tree")
532
624
  ], n);
533
- const _e = pe`:host{flex-direction:column;width:100%;height:100%;min-height:0;max-height:100%;display:flex}.folder-select{gap:var(--cx-spacing-x-small);flex-direction:column;flex:1;width:100%;min-height:0;display:flex}.folder-select__search{flex-shrink:0}.folder-select__tree{flex-direction:column;flex:1;min-height:0;display:flex}.folder-select-tree{flex:1;min-height:0;overflow:auto}.folder-select-tree__item__icon{color:var(--cx-color-primary)}.folder-select-tree__empty-message{font-size:var(--cx-font-size-small);color:var(--cx-color-neutral-500);padding-block:var(--cx-spacing-2x-small);padding-inline:var(--cx-spacing-small);text-align:center;cursor:default;user-select:none}.folder-select-tree__load-more{margin-inline:var(--cx-spacing-small)}.folder-select-tree-item::part(label),.folder-select-tree-item__label,.folder-select-tree-item__title{overflow:hidden}`;
534
- var De = Object.defineProperty, ke = Object.getOwnPropertyDescriptor, te = (e) => {
625
+ const ke = me`:host{flex-direction:column;width:100%;height:100%;min-height:0;max-height:100%;display:flex}.folder-select{gap:var(--cx-spacing-x-small);flex-direction:column;flex:1;width:100%;min-height:0;display:flex}.folder-select__search{flex-shrink:0}.folder-select__tree{flex-direction:column;flex:1;min-height:0;display:flex}.folder-select-tree{flex:1;min-height:0;overflow:auto}.folder-select-tree__item__icon{color:var(--cx-color-primary)}.folder-select-tree__empty-message{font-size:var(--cx-font-size-small);color:var(--cx-color-neutral-500);padding-block:var(--cx-spacing-2x-small);padding-inline:var(--cx-spacing-small);text-align:center;cursor:default;user-select:none}.folder-select-tree__load-more{margin-inline:var(--cx-spacing-small)}.folder-select-tree-item::part(label),.folder-select-tree-item__label,.folder-select-tree-item__title{overflow:hidden}`;
626
+ var we = Object.defineProperty, Ve = Object.getOwnPropertyDescriptor, le = (e) => {
535
627
  throw TypeError(e);
536
- }, c = (e, t, s, l) => {
537
- for (var a = l > 1 ? void 0 : l ? ke(t, s) : t, p = e.length - 1, u; p >= 0; p--)
538
- (u = e[p]) && (a = (l ? u(t, s, a) : u(a)) || a);
539
- return l && a && De(t, s, a), a;
540
- }, re = (e, t, s) => t.has(e) || te("Cannot " + s), q = (e, t, s) => (re(e, t, "read from private field"), s ? s.call(e) : t.get(e)), we = (e, t, s) => t.has(e) ? te("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), Q = (e, t, s, l) => (re(e, t, "write to private field"), t.set(e, s), s), T;
541
- let i = class extends U {
628
+ }, c = (e, t, r, a) => {
629
+ for (var s = a > 1 ? void 0 : a ? Ve(t, r) : t, p = e.length - 1, u; p >= 0; p--)
630
+ (u = e[p]) && (s = (a ? u(t, r, s) : u(s)) || s);
631
+ return a && s && we(t, r, s), s;
632
+ }, ae = (e, t, r) => t.has(e) || le("Cannot " + r), Z = (e, t, r) => (ae(e, t, "read from private field"), r ? r.call(e) : t.get(e)), Oe = (e, t, r) => t.has(e) ? le("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), J = (e, t, r, a) => (ae(e, t, "write to private field"), t.set(e, r), r), F;
633
+ let i = class extends A {
542
634
  constructor() {
543
- super(), this.localize = new L(this), this.minQueryLength = 1, this.selection = "single", this.variant = C.Input, this.value = "", this.name = "", this.selectedLabel = "", this.baseUrl = "", this.open = !1, this.token = "", this.bearerToken = "", this.seeThru = !1, this.api = G, this.required = !1, this.form = void 0, this.excludeVirtualFolders = !1, this.extraFolderId = "", this.extraFolderTitle = "", this.extraFolderIcon = "", this.firstFetchCallback = null, this.searchTerm = "", we(this, T), this.selectGetOptionValue = this.selectGetOptionValue.bind(this), this.selectGetOptionLabel = this.selectGetOptionLabel.bind(this), this.selectGetOptionSelected = this.selectGetOptionSelected.bind(this), this.selectFilterCallback = this.selectFilterCallback.bind(this), this.selectSetOptionSelected = this.selectSetOptionSelected.bind(this), this.selectGetTag = this.selectGetTag.bind(this), this.updateWrappedApi();
635
+ super(), this.localize = new z(this), this.minQueryLength = 1, this.selection = "single", this.variant = C.Input, this.value = "", this.name = "", this.selectedLabel = "", this.baseUrl = "", this.open = !1, this.token = "", this.bearerToken = "", this.seeThru = !1, this.api = W, this.required = !1, this.form = void 0, this.excludeVirtualFolders = !1, this.extraFolderId = "", this.extraFolderTitle = "", this.extraFolderIcon = "", this.firstFetchCallback = null, this.searchTerm = "", Oe(this, F), this.selectGetOptionValue = this.selectGetOptionValue.bind(this), this.selectGetOptionLabel = this.selectGetOptionLabel.bind(this), this.selectGetOptionSelected = this.selectGetOptionSelected.bind(this), this.selectFilterCallback = this.selectFilterCallback.bind(this), this.selectSetOptionSelected = this.selectSetOptionSelected.bind(this), this.selectGetTag = this.selectGetTag.bind(this), this.updateWrappedApi();
544
636
  }
545
637
  updateWrappedApi() {
546
638
  if (!this.api) {
547
- Q(this, T, void 0);
639
+ J(this, F, void 0);
548
640
  return;
549
641
  }
550
- Q(this, T, async (e) => {
642
+ J(this, F, async (e) => {
551
643
  try {
552
644
  return await this.api(e);
553
645
  } catch (t) {
554
- return t instanceof de && t.response?.status === 401 && this.emit("cx-renew-token"), { data: [], hasMore: !1, totalCount: 0 };
646
+ return t instanceof fe && t.response?.status === 401 && this.emit("cx-renew-token"), { data: [], hasMore: !1, totalCount: 0 };
555
647
  }
556
648
  });
557
649
  }
@@ -589,17 +681,17 @@ let i = class extends U {
589
681
  ), this.selectEl.handleDefaultSlotChange(), await this.selectEl.updateComplete, this.selectEl.displayLabel = this.searchTerm);
590
682
  }
591
683
  selectGetOptionValue(e) {
592
- return !e || !(e instanceof g) ? this.value : e.dataset.id || this.value;
684
+ return !e || !(e instanceof $) ? this.value : e.dataset.id || this.value;
593
685
  }
594
686
  selectGetOptionLabel(e) {
595
- return !e || !(e instanceof g) ? this.selectedLabel : e.dataset.name || this.selectedLabel;
687
+ return !e || !(e instanceof $) ? this.selectedLabel : e.dataset.name || this.selectedLabel;
596
688
  }
597
689
  selectGetOptionSelected(e) {
598
- if (!(!e || !(e instanceof g)))
690
+ if (!(!e || !(e instanceof $)))
599
691
  return e.selected;
600
692
  }
601
693
  selectFilterCallback(e) {
602
- return !(!e || !(e instanceof g));
694
+ return !(!e || !(e instanceof $));
603
695
  }
604
696
  /**
605
697
  * Custom tag renderer for cx-select multi mode. Identical visuals to the
@@ -615,12 +707,12 @@ let i = class extends U {
615
707
  content:tag__content,
616
708
  remove-button:tag__remove-button,
617
709
  remove-button__base:tag__remove-button__base
618
- " removable @cx-remove=${(s) => {
619
- s.stopPropagation(), e instanceof g && (e.selected = !1);
710
+ " removable @cx-remove=${(r) => {
711
+ r.stopPropagation(), e instanceof $ && (e.selected = !1);
620
712
  }}><cx-line-clamp lines="1">${this.selectGetOptionLabel(e)}</cx-line-clamp></cx-tag>`;
621
713
  }
622
714
  selectSetOptionSelected(e, t) {
623
- if (!(!e || !(e instanceof g)) && this.selection !== "multiple") {
715
+ if (!(!e || !(e instanceof $)) && this.selection !== "multiple") {
624
716
  if (t === void 0) {
625
717
  e.selected = !e.selected;
626
718
  return;
@@ -647,103 +739,103 @@ let i = class extends U {
647
739
  this.selectEl && (this.searchTerm = "", this.selectEl.getOptionValue = this.selectGetOptionValue, this.selectEl.getOptionLabel = this.selectGetOptionLabel, this.selectEl.getOptionSelected = this.selectGetOptionSelected, this.selectEl.filterCallback = this.selectFilterCallback, this.selectEl.setOptionSelected = this.selectSetOptionSelected, this.selectEl.getTag = this.selectGetTag, this.selectEl.handleDefaultSlotChange());
648
740
  }
649
741
  render() {
650
- return m`<div class="folder-select">${ue(this.variant, [
742
+ return m`<div class="folder-select">${ye(this.variant, [
651
743
  [
652
744
  C.Input,
653
- () => m`<cx-input class="folder-select__search" aria-label=${this.localize.term("searchFolders")} placeholder=${`${this.localize.term("searchFolders")}...`} value=${this.searchTerm} clearable @cx-input=${this.handleSearchTermInputChange}><cx-icon name="search" slot="prefix"></cx-icon></cx-input><cx-folder-select-tree class="folder-select__tree" base-url=${this.baseUrl} extra-folder-id=${this.extraFolderId} extra-folder-title=${this.extraFolderTitle} extra-folder-icon=${this.extraFolderIcon} min-query-length=${this.minQueryLength} search-term=${this.searchTerm} selected-value=${this.value} selection=${this.selection} token=${this.token} bearer-token=${this.bearerToken} ?exclude-virtual-folders=${this.excludeVirtualFolders} ?see-thru=${this.seeThru} .api=${q(this, T)} .firstFetchCallback=${this.firstFetchCallback}></cx-folder-select-tree>`
745
+ () => m`<cx-input class="folder-select__search" aria-label=${this.localize.term("searchFolders")} placeholder=${`${this.localize.term("searchFolders")}...`} value=${this.searchTerm} clearable @cx-input=${this.handleSearchTermInputChange}><cx-icon name="search" slot="prefix"></cx-icon></cx-input><cx-folder-select-tree class="folder-select__tree" base-url=${this.baseUrl} extra-folder-id=${this.extraFolderId} extra-folder-title=${this.extraFolderTitle} extra-folder-icon=${this.extraFolderIcon} min-query-length=${this.minQueryLength} search-term=${this.searchTerm} selected-value=${this.value} selection=${this.selection} token=${this.token} bearer-token=${this.bearerToken} ?exclude-virtual-folders=${this.excludeVirtualFolders} ?see-thru=${this.seeThru} .api=${Z(this, F)} .firstFetchCallback=${this.firstFetchCallback}></cx-folder-select-tree>`
654
746
  ],
655
747
  [
656
748
  C.Select,
657
- () => m`<cx-select clearable hoist lazy name=${this.name} value=${this.value} .form=${this.form} ?required=${this.required} ?multiple=${this.selection === "multiple"} @input=${this.handleSearchTermSelectChange} @cx-clear=${this.handleSelectClear} @cx-selected-change=${this.handleTreeSelectedChange} allow-freetext><cx-folder-select-tree base-url=${this.baseUrl} extra-folder-id=${this.extraFolderId} extra-folder-title=${this.extraFolderTitle} extra-folder-icon=${this.extraFolderIcon} min-query-length=${this.minQueryLength} search-term=${this.searchTerm} selected-value=${this.value} selection=${this.selection} token=${this.token} bearer-token=${this.bearerToken} ?exclude-virtual-folders=${this.excludeVirtualFolders} ?see-thru=${this.seeThru} .api=${q(this, T)} .firstFetchCallback=${this.firstFetchCallback}></cx-folder-select-tree></cx-select>`
749
+ () => m`<cx-select clearable hoist lazy name=${this.name} value=${this.value} .form=${this.form} ?required=${this.required} ?multiple=${this.selection === "multiple"} @input=${this.handleSearchTermSelectChange} @cx-clear=${this.handleSelectClear} @cx-selected-change=${this.handleTreeSelectedChange} allow-freetext><cx-folder-select-tree base-url=${this.baseUrl} extra-folder-id=${this.extraFolderId} extra-folder-title=${this.extraFolderTitle} extra-folder-icon=${this.extraFolderIcon} min-query-length=${this.minQueryLength} search-term=${this.searchTerm} selected-value=${this.value} selection=${this.selection} token=${this.token} bearer-token=${this.bearerToken} ?exclude-virtual-folders=${this.excludeVirtualFolders} ?see-thru=${this.seeThru} .api=${Z(this, F)} .firstFetchCallback=${this.firstFetchCallback}></cx-folder-select-tree></cx-select>`
658
750
  ]
659
751
  ])}</div>`;
660
752
  }
661
753
  };
662
- T = /* @__PURE__ */ new WeakMap();
663
- i.styles = [j, _e];
754
+ F = /* @__PURE__ */ new WeakMap();
755
+ i.styles = [Y, ke];
664
756
  i.dependencies = {
665
757
  "cx-folder-select-tree": n,
666
- "cx-icon": N,
667
- "cx-input": ie,
668
- "cx-line-clamp": H,
669
- "cx-select": oe,
670
- "cx-tag": ce
758
+ "cx-icon": K,
759
+ "cx-input": ce,
760
+ "cx-line-clamp": X,
761
+ "cx-select": he,
762
+ "cx-tag": de
671
763
  };
672
764
  c([
673
- Z("cx-select")
765
+ ee("cx-select")
674
766
  ], i.prototype, "selectEl", 2);
675
767
  c([
676
- r({ attribute: "min-query-length", reflect: !0, type: Number })
768
+ l({ attribute: "min-query-length", reflect: !0, type: Number })
677
769
  ], i.prototype, "minQueryLength", 2);
678
770
  c([
679
- r({ attribute: "selection", reflect: !0, type: String })
771
+ l({ attribute: "selection", reflect: !0, type: String })
680
772
  ], i.prototype, "selection", 2);
681
773
  c([
682
- r({ attribute: "variant", reflect: !0, type: String })
774
+ l({ attribute: "variant", reflect: !0, type: String })
683
775
  ], i.prototype, "variant", 2);
684
776
  c([
685
- r({ reflect: !0, type: String })
777
+ l({ reflect: !0, type: String })
686
778
  ], i.prototype, "value", 2);
687
779
  c([
688
- r({ reflect: !0, type: String })
780
+ l({ reflect: !0, type: String })
689
781
  ], i.prototype, "name", 2);
690
782
  c([
691
- r({ attribute: "selected-label", reflect: !0, type: String })
783
+ l({ attribute: "selected-label", reflect: !0, type: String })
692
784
  ], i.prototype, "selectedLabel", 2);
693
785
  c([
694
- r({ attribute: "base-url", reflect: !0, type: String })
786
+ l({ attribute: "base-url", reflect: !0, type: String })
695
787
  ], i.prototype, "baseUrl", 2);
696
788
  c([
697
- r({ reflect: !0, type: Boolean })
789
+ l({ reflect: !0, type: Boolean })
698
790
  ], i.prototype, "open", 2);
699
791
  c([
700
- r({ reflect: !1, type: String })
792
+ l({ reflect: !1, type: String })
701
793
  ], i.prototype, "token", 2);
702
794
  c([
703
- r({ attribute: "bearer-token", reflect: !0, type: String })
795
+ l({ attribute: "bearer-token", reflect: !0, type: String })
704
796
  ], i.prototype, "bearerToken", 2);
705
797
  c([
706
- r({ attribute: "see-thru", reflect: !0, type: Boolean })
798
+ l({ attribute: "see-thru", reflect: !0, type: Boolean })
707
799
  ], i.prototype, "seeThru", 2);
708
800
  c([
709
- r({ type: Function })
801
+ l({ type: Function })
710
802
  ], i.prototype, "api", 2);
711
803
  c([
712
- r({ reflect: !0, type: Boolean })
804
+ l({ reflect: !0, type: Boolean })
713
805
  ], i.prototype, "required", 2);
714
806
  c([
715
- r({ reflect: !1 })
807
+ l({ reflect: !1 })
716
808
  ], i.prototype, "form", 2);
717
809
  c([
718
- r({
810
+ l({
719
811
  attribute: "exclude-virtual-folders",
720
812
  reflect: !0,
721
813
  type: Boolean
722
814
  })
723
815
  ], i.prototype, "excludeVirtualFolders", 2);
724
816
  c([
725
- r({
817
+ l({
726
818
  attribute: "extra-folder-id",
727
819
  reflect: !0,
728
820
  type: String
729
821
  })
730
822
  ], i.prototype, "extraFolderId", 2);
731
823
  c([
732
- r({
824
+ l({
733
825
  attribute: "extra-folder-title",
734
826
  reflect: !0,
735
827
  type: String
736
828
  })
737
829
  ], i.prototype, "extraFolderTitle", 2);
738
830
  c([
739
- r({
831
+ l({
740
832
  attribute: "extra-folder-icon",
741
833
  reflect: !0,
742
834
  type: String
743
835
  })
744
836
  ], i.prototype, "extraFolderIcon", 2);
745
837
  c([
746
- r({ attribute: "first-fetch-callback", reflect: !1, type: Function })
838
+ l({ attribute: "first-fetch-callback", reflect: !1, type: Function })
747
839
  ], i.prototype, "firstFetchCallback", 2);
748
840
  c([
749
841
  x()
@@ -765,10 +857,10 @@ c([
765
857
  f("value", { waitUntilFirstUpdate: !0 })
766
858
  ], i.prototype, "handleValueChange", 1);
767
859
  i = c([
768
- M("cx-folder-select")
860
+ B("cx-folder-select")
769
861
  ], i);
770
862
  export {
771
863
  i as C,
772
864
  C as F,
773
- G as a
865
+ W as a
774
866
  };