@orangelogic/design-system 2.133.0 → 2.135.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 (232) hide show
  1. package/library/chunks/asset-link-format.BBWyY5fn.js +2627 -0
  2. package/library/chunks/{button.DYoFn504.js → button.3giRMk79.js} +2 -2
  3. package/library/chunks/{checkbox.uH0uF0OV.js → checkbox.B-2O517F.js} +3 -3
  4. package/library/chunks/{table.DuP4v5FN.js → color-swatch-group.DC6vIYo4.js} +3133 -2887
  5. package/library/chunks/{color-swatch.0zyBEfL_.js → color-swatch.g3FPUnxM.js} +2 -2
  6. package/library/chunks/{confirm-popover.DpVYvK20.js → confirm-popover.DtndPsMa.js} +3 -3
  7. package/library/chunks/{dialog.BwBD_hJi.js → dialog.BQq3xBeH.js} +2 -2
  8. package/library/chunks/directive-helpers.DEDMV45_.js +42 -0
  9. package/library/chunks/{document-viewer.BM716ovi.js → document-viewer.BQPJD2lJ.js} +8 -8
  10. package/library/chunks/{dom.BXeuEG1b.js → dom.acWb8KCK.js} +1 -1
  11. package/library/chunks/{dot-pagination.B70lV5Av.js → dot-pagination.DBk9Rz1e.js} +1 -1
  12. package/library/chunks/{endpoints.6E17hFiK.js → endpoints.tU0_RZ_7.js} +4 -4
  13. package/library/chunks/{file-on-demand.D-Ectby2.js → file-on-demand.Bnloo9Ui.js} +12 -12
  14. package/library/chunks/folder-select.DuG4dSPm.js +942 -0
  15. package/library/chunks/{form.3af0bYrm.js → form.K1XOtu3S.js} +1 -1
  16. package/library/chunks/{header.BMGvKrdP.js → header.Bpjw08j7.js} +1 -1
  17. package/library/chunks/{i18n.DoMIwXr2.js → i18n.DJikbkDK.js} +48 -12
  18. package/library/chunks/{icon-button.B-Jf9W3v.js → icon-button.xobY-9OH.js} +1 -1
  19. package/library/chunks/{iframe.Cdv6esyS.js → iframe.BkvxcywO.js} +1 -1
  20. package/library/chunks/{image.SLqIVjqc.js → image.KZRXIthe.js} +241 -229
  21. package/library/chunks/{input.CQNhMu4z.js → input.GUw7x9tK.js} +3 -3
  22. package/library/chunks/{keyed.C0rkKrxH.js → keyed.DdOUTIg-.js} +1 -1
  23. package/library/chunks/{live.SCz6M8Gs.js → live.DCegntDo.js} +1 -1
  24. package/library/chunks/{option.SCVixE2L.js → option.uHye0aDT.js} +1 -1
  25. package/library/chunks/{pagination.BFE6Nk3_.js → pagination.D8Hzwlan.js} +6 -6
  26. package/library/chunks/{ref.bzeTdX0K.js → ref.DktKp7fP.js} +1 -1
  27. package/library/chunks/{repeat.DbF2p5ae.js → repeat.CFjcER6_.js} +1 -1
  28. package/library/chunks/{resizable-component.styles.BVhOesNE.js → resizable-component.styles.CAfXABBc.js} +5 -5
  29. package/library/chunks/{string.CbnVBzsd.js → string.CjJ09HK3.js} +14 -11
  30. package/library/chunks/{tab-group.C-p2Dljr.js → tab-group.0_aOE22R.js} +5 -5
  31. package/library/chunks/toast.Bz-j7zP2.js +109 -0
  32. package/library/chunks/{tree.9PK8ifJd.js → tree.C14rLLol.js} +3 -3
  33. package/library/chunks/url.-WDYqplj.js +42 -0
  34. package/library/components/alert.js +2 -2
  35. package/library/components/asset-link-format.js +16 -2163
  36. package/library/components/atoms.js +49 -51
  37. package/library/components/audio.js +3 -3
  38. package/library/components/border-input-group.js +2 -2
  39. package/library/components/breadcrumb.js +1 -1
  40. package/library/components/button.js +3 -3
  41. package/library/components/checkbox.js +3 -3
  42. package/library/components/color-picker.js +4 -4
  43. package/library/components/color-swatch-group.js +6 -7
  44. package/library/components/color-swatch.js +3 -3
  45. package/library/components/confirm-popover.js +4 -4
  46. package/library/components/copy-button.js +1 -1
  47. package/library/components/corner-position-input-group.js +3 -3
  48. package/library/components/date-calendar.js +2 -2
  49. package/library/components/details.js +1 -1
  50. package/library/components/dialog.js +3 -3
  51. package/library/components/diff.js +1 -1
  52. package/library/components/document-viewer.js +4 -4
  53. package/library/components/dot-pagination.js +2 -2
  54. package/library/components/drawer.js +2 -2
  55. package/library/components/dropdown.js +2 -2
  56. package/library/components/dynamic-select.js +88 -85
  57. package/library/components/e-chart.js +1 -1
  58. package/library/components/element-clamp.js +2 -2
  59. package/library/components/file-on-demand.js +13 -13
  60. package/library/components/folder-select.js +5 -5
  61. package/library/components/format-bytes.js +1 -1
  62. package/library/components/format-date.js +1 -1
  63. package/library/components/format-number.js +1 -1
  64. package/library/components/format-time.js +1 -1
  65. package/library/components/header.js +2 -2
  66. package/library/components/icon-button.js +2 -2
  67. package/library/components/iframe.js +2 -2
  68. package/library/components/image-comparer.js +1 -1
  69. package/library/components/image.js +6 -5
  70. package/library/components/input.js +4 -4
  71. package/library/components/line-clamp.js +1 -1
  72. package/library/components/masonry.js +3 -3
  73. package/library/components/menu-item.js +2 -2
  74. package/library/components/menu.js +1 -1
  75. package/library/components/molecules.js +27 -29
  76. package/library/components/option.js +2 -2
  77. package/library/components/organisms.js +6 -6
  78. package/library/components/padding-input-group.js +2 -2
  79. package/library/components/pagination.js +7 -7
  80. package/library/components/popup.js +1 -1
  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/radio-group.js +1 -1
  85. package/library/components/range.js +5 -5
  86. package/library/components/rating.js +2 -2
  87. package/library/components/relative-time.js +1 -1
  88. package/library/components/select.js +10 -7
  89. package/library/components/shadow-input-group.js +2 -2
  90. package/library/components/share-option-list.js +3 -3
  91. package/library/components/sidebar.js +1 -1
  92. package/library/components/size-input-group.js +3 -3
  93. package/library/components/spinner.js +1 -1
  94. package/library/components/split-panel.js +1 -1
  95. package/library/components/stepper-wizard.js +1 -1
  96. package/library/components/switch.js +2 -2
  97. package/library/components/tab-group.js +5 -5
  98. package/library/components/tab.js +2 -2
  99. package/library/components/tag.js +2 -2
  100. package/library/components/textarea.js +2 -2
  101. package/library/components/timecode.js +1 -1
  102. package/library/components/tooltip.js +1 -1
  103. package/library/components/tree-item.js +4 -4
  104. package/library/components/tree.js +2 -2
  105. package/library/components/typeface.js +2 -2
  106. package/library/components/types.js +46083 -43779
  107. package/library/components/video.js +3 -3
  108. package/library/package.json +3 -1
  109. package/library/packages/atoms/src/components/image/image.d.ts +3 -0
  110. package/library/packages/atoms/src/components/select/select.d.ts +6 -0
  111. package/library/packages/atoms/src/components/tab-group/tab-group.d.ts +1 -0
  112. package/library/packages/atoms/src/index.d.ts +0 -1
  113. package/library/packages/events/src/cx-folder-select-selection-seeded.d.ts +6 -0
  114. package/library/packages/events/src/cx-image-src-resolved.d.ts +9 -0
  115. package/library/packages/events/src/cx-pdf-viewer-annotation-draw-mode-change.d.ts +10 -0
  116. package/library/packages/events/src/cx-pdf-viewer-annotation-draw-params-change.d.ts +11 -0
  117. package/library/packages/events/src/cx-pdf-viewer-more-options-select.d.ts +8 -0
  118. package/library/packages/events/src/cx-pdf-viewer-toolbar-annotation-mode-change.d.ts +10 -0
  119. package/library/packages/events/src/cx-pdf-viewer-toolbar-annotation-params-change.d.ts +11 -0
  120. package/library/packages/events/src/cx-pdf-viewer-toolbar-click.d.ts +8 -0
  121. package/library/packages/events/src/cx-pdf-viewer-toolbar-page-change.d.ts +8 -0
  122. package/library/packages/events/src/cx-pdf-viewer-toolbar-scale-change.d.ts +8 -0
  123. package/library/packages/events/src/cx-pdf-viewer-toolbar-view-toggle.d.ts +11 -0
  124. package/library/packages/events/src/cx-pdf-viewer-view-on-asset-toggle.d.ts +11 -0
  125. package/library/packages/events/src/cx-video-src-resolved.d.ts +8 -0
  126. package/library/packages/events/src/events.d.ts +13 -0
  127. package/library/packages/hybrid/table-core/src/index.d.ts +3 -0
  128. package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/components/table-row-actions/table-row-actions-dropdown.d.ts +8 -8
  129. package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/components/table-row-actions/table-row-actions.d.ts +6 -5
  130. package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/components/table-toolbar/table-dropdown-filter.d.ts +4 -4
  131. package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/components/table-toolbar/table-group-by-dropdown.d.ts +4 -4
  132. package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/components/table-toolbar/table-saved-search-dropdown.d.ts +6 -5
  133. package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/components/table-toolbar/table-toolbar.d.ts +12 -12
  134. package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/table.d.ts +11 -11
  135. package/library/packages/hybrid/table-core/src/tabulator-tables/modules/Clipboard/Clipboard.d.ts +1 -1
  136. package/library/packages/hybrid/table-core/src/tabulator-tables/modules/Clipboard/extensions/extensions.d.ts +1 -1
  137. package/library/packages/hybrid/table-core/src/tabulator-tables/modules/History/History.d.ts +1 -1
  138. package/library/packages/hybrid/table-core/src/tabulator-tables/modules/History/extensions/extensions.d.ts +1 -1
  139. package/library/packages/hybrid/table-core/src/tabulator-tables/modules/HoverMenu/HoverMenu.d.ts +1 -1
  140. package/library/packages/hybrid/table-core/src/tabulator-tables/modules/Import/defaults/importers.d.ts +1 -1
  141. package/library/packages/hybrid/table-core/src/tabulator-tables/modules/SelectRange/SelectRange.d.ts +4 -4
  142. package/library/packages/hybrid/table-core/src/tabulator-tables/modules/SelectRange/extensions/extensions.d.ts +2 -2
  143. package/library/packages/molecules/src/asset-picker/asset-picker.d.ts +1 -1
  144. package/library/packages/molecules/src/dynamic-select/dynamic-select.d.ts +5 -0
  145. package/library/packages/molecules/src/folder-select/components/folder-select-tree-item/folder-select-tree-item.d.ts +32 -0
  146. package/library/packages/molecules/src/folder-select/folder-select.d.ts +20 -3
  147. package/library/packages/molecules/src/gallery-item/gallery-item.d.ts +5 -0
  148. package/library/packages/molecules/src/index.d.ts +1 -1
  149. package/library/packages/molecules/src/library-index.d.ts +0 -1
  150. package/library/packages/molecules/src/pdf-viewer-toolbar/components/index.d.ts +3 -0
  151. package/library/packages/molecules/src/pdf-viewer-toolbar/components/pdf-viewer-annotation-draw/pdf-viewer-annotation-draw.d.ts +92 -0
  152. package/library/packages/molecules/src/pdf-viewer-toolbar/components/pdf-viewer-more-options/pdf-viewer-more-options.d.ts +43 -0
  153. package/library/packages/molecules/src/pdf-viewer-toolbar/components/pdf-viewer-more-options/pdf-viewer-more-options.styles.d.ts +2 -0
  154. package/library/packages/molecules/src/pdf-viewer-toolbar/components/pdf-viewer-view-on-asset/pdf-viewer-view-on-asset.d.ts +42 -0
  155. package/library/packages/molecules/src/pdf-viewer-toolbar/components/pdf-viewer-view-on-asset/pdf-viewer-view-on-asset.styles.d.ts +2 -0
  156. package/library/packages/molecules/src/pdf-viewer-toolbar/pdf-viewer-toolbar.d.ts +101 -0
  157. package/library/packages/molecules/src/pdf-viewer-toolbar/pdf-viewer-toolbar.styles.d.ts +2 -0
  158. package/library/packages/organisms/src/bento-grid/bento-grid.d.ts +66 -0
  159. package/library/packages/organisms/src/color-swatch-group/color-swatch-group.constants.d.ts +1 -1
  160. package/library/packages/organisms/src/color-swatch-group/color-swatch-group.d.ts +1 -1
  161. package/library/packages/organisms/src/content-builder/components/color-swatch-picker/color-swatch-picker.constants.d.ts +1 -1
  162. package/library/packages/organisms/src/content-builder/components/color-swatch-picker/color-swatch-picker.d.ts +1 -1
  163. package/library/packages/organisms/src/content-builder/components/config-form/config-form-controller.d.ts +1 -0
  164. package/library/packages/organisms/src/content-builder/components/config-form/config-form.d.ts +2 -9
  165. package/library/packages/organisms/src/content-builder/configs/dam-view.d.ts +1 -7
  166. package/library/packages/organisms/src/content-builder/configs-controller.d.ts +2 -14
  167. package/library/packages/organisms/src/content-builder/styleController.d.ts +1 -1
  168. package/library/packages/organisms/src/dam-custom-toolbar-buttons-editor/dam-custom-toolbar-buttons-editor.d.ts +9 -1
  169. package/library/packages/organisms/src/dashboard-table/dashboard-table.d.ts +1 -1
  170. package/library/packages/organisms/src/index.d.ts +1 -0
  171. package/library/packages/{molecules → organisms}/src/list-editor/list-editor.d.ts +9 -3
  172. package/library/packages/organisms/src/list-editor/list-editor.styles.d.ts +2 -0
  173. package/library/packages/organisms/src/video-chapters-manager/video-chapters-manager.d.ts +1 -1
  174. package/library/packages/services/src/api/folder/folder.types.d.ts +9 -2
  175. package/library/packages/tools/src/fetch-asset/fetch-asset.d.ts +16 -0
  176. package/library/packages/types/src/content-builder.d.ts +1 -1
  177. package/library/packages/types/src/dam-view.d.ts +1 -0
  178. package/library/packages/types/src/folder-select.d.ts +8 -1
  179. package/library/packages/types/src/pdf-viewer-toolbar.d.ts +82 -0
  180. package/library/packages/utils/src/custom-element/i18n.d.ts +43 -7
  181. package/library/packages/utils/src/string/string.d.ts +1 -1
  182. package/library/packages/utils/src/url/url.d.ts +12 -2
  183. package/library/react-web-component.d.ts +514 -913
  184. package/library/utils.js +200 -199
  185. package/package.json +3 -1
  186. package/library/chunks/asset.CcxcYY9d.js +0 -469
  187. package/library/chunks/color-swatch-group.DlTVQ3Ul.js +0 -362
  188. package/library/chunks/directive-helpers.Dm4rc594.js +0 -37
  189. package/library/chunks/folder-select.DHV6f6TA.js +0 -884
  190. package/library/chunks/list-editor.BXY4UIAI.js +0 -1394
  191. package/library/chunks/responsive.Cf65FCWd.js +0 -17
  192. package/library/chunks/toast.D3AW3RWv.js +0 -94
  193. package/library/chunks/url.Cj9cIQXJ.js +0 -27
  194. package/library/components/list-editor.d.ts +0 -3
  195. package/library/components/list-editor.js +0 -33
  196. package/library/components/table.d.ts +0 -3
  197. package/library/components/table.js +0 -84
  198. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/components/index.d.ts +0 -0
  199. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/components/table-footer/table-footer.d.ts +0 -0
  200. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/components/table-footer/table-footer.styles.d.ts +0 -0
  201. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/components/table-row-actions/table-row-actions.styles.d.ts +0 -0
  202. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/components/table-toolbar/table-toolbar.styles.d.ts +0 -0
  203. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/controllers/ajax-facets/ajax-facet-data-controller.d.ts +0 -0
  204. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/controllers/ajax-facets/ajax-facet-filter-controller.d.ts +0 -0
  205. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/controllers/filter-controller.d.ts +0 -0
  206. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/controllers/select-all-controller.d.ts +0 -0
  207. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-alert.styles.d.ts +0 -0
  208. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-base.styles.d.ts +0 -0
  209. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-calcs.styles.d.ts +0 -0
  210. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-clickable-cell.styles.d.ts +0 -0
  211. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-data-tree.styles.d.ts +0 -0
  212. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-edit.styles.d.ts +0 -0
  213. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-footer.styles.d.ts +0 -0
  214. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-format.styles.d.ts +0 -0
  215. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-group-rows.styles.d.ts +0 -0
  216. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-header.styles.d.ts +0 -0
  217. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-hover-menu.styles.d.ts +0 -0
  218. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-move-rows.styles.d.ts +0 -0
  219. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-page.styles.d.ts +0 -0
  220. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-placeholder.styles.d.ts +0 -0
  221. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-popup.styles.d.ts +0 -0
  222. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-print.styles.d.ts +0 -0
  223. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-resize.styles.d.ts +0 -0
  224. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-responsive-layout.styles.d.ts +0 -0
  225. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-rows.styles.d.ts +0 -0
  226. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-rtl.styles.d.ts +0 -0
  227. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-select-range.styles.d.ts +0 -0
  228. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-spreadsheet.styles.d.ts +0 -0
  229. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/table-data-loader.d.ts +0 -0
  230. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/table.styles.d.ts +0 -0
  231. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/table.utils.d.ts +0 -0
  232. /package/library/packages/molecules/src/{list-editor/list-editor.styles.d.ts → pdf-viewer-toolbar/components/pdf-viewer-annotation-draw/pdf-viewer-annotation-draw.styles.d.ts} +0 -0
@@ -0,0 +1,942 @@
1
+ import { C as ee } from "./icon.DnBh6-56.js";
2
+ import { C as ue } from "./input.GUw7x9tK.js";
3
+ import te from "../components/line-clamp.js";
4
+ import fe from "../components/select.js";
5
+ import me from "../components/tag.js";
6
+ import { C as v, a as ye } from "./tree.C14rLLol.js";
7
+ import { n as s, C as B } from "./lib-cortex-element.CVMmyPMC.js";
8
+ import { h as L, F as xe, A as ge } from "./endpoints.tU0_RZ_7.js";
9
+ import { M as P } from "./asset-link-format.QzzboHHE.js";
10
+ import { c as re } from "./component.styles.CRO4Odto.js";
11
+ import { c as N } from "./custom-element.L4WJXn1j.js";
12
+ import { L as W } from "./i18n.DJikbkDK.js";
13
+ import { w as y } from "./watch.CThbualB.js";
14
+ import { x as m, i as be } from "./lit-element.jLBm65_O.js";
15
+ import { r as x } from "./state.CSDxrqLd.js";
16
+ import { e as se } from "./query.BBf1UFkC.js";
17
+ import { r as $e } from "./choose.BTbF6BAn.js";
18
+ import { C as ie } from "./button.3giRMk79.js";
19
+ import { d as ve } from "./debounce.DaHuiSGU.js";
20
+ import { g as G, p as J, e as Se } from "./string.CjJ09HK3.js";
21
+ import { o as p } from "./if-defined.BRoBj_Rp.js";
22
+ import { c as A } from "./repeat.CFjcER6_.js";
23
+ import { o as le } from "./style-map.llVFPd__.js";
24
+ import { n as w } from "./when.Dr1es41R.js";
25
+ import Ie from "../components/space.js";
26
+ import { g as Fe } from "./template.ClovJacp.js";
27
+ import { e as Te } from "./class-map.BiVq-cVR.js";
28
+ var b = /* @__PURE__ */ ((e) => (e.CortexPath = "Document.CortexPath", e.DocSubTypeIconColor = "DocSubTypeIconColor", e.DocSubTypeIconImageUrl = "DocSubTypeIconImageUrl", e.DocSubTypeIconName = "DocSubTypeIconName", e.DocSubTypeIsFontIcon = "DocSubTypeIsFontIcon", e.DocType = "CoreField.DocType", e.HasBrowserChildren = "Document.HasBrowserChildren", e.RepresentativeAssetId = "Document.DocumentDirectRepresentativeRID", e.TitleWithFallback = "CoreField.TitleWithFallback", e))(b || {});
29
+ const Ce = 50;
30
+ async function q({
31
+ allowedFolders: e,
32
+ baseUrl: t,
33
+ bearerToken: r,
34
+ excludeVirtualFolders: l,
35
+ folderId: i,
36
+ includeDirectChild: u,
37
+ limit: f = Ce,
38
+ searchTerm: $,
39
+ self: T,
40
+ start: H = 0,
41
+ token: he
42
+ }) {
43
+ let U = [], Q = u ?? !0;
44
+ e && e.length > 0 && !i ? (U = e, T = !0, Q = !1) : i && (U = [i]);
45
+ try {
46
+ return (await L.request({
47
+ baseURL: t,
48
+ headers: {
49
+ Authorization: `Bearer ${r}`
50
+ },
51
+ method: "GET",
52
+ params: {
53
+ IncludeDirectChild: Q,
54
+ IncludeVirtualFolders: !l,
55
+ Limit: f,
56
+ ObjectRecordIDs: U,
57
+ SeeThru: !!$,
58
+ Self: T,
59
+ Start: H,
60
+ Text: $ || void 0,
61
+ Token: he || void 0
62
+ },
63
+ paramsSerializer: {
64
+ indexes: null
65
+ },
66
+ responseType: "json",
67
+ transformResponse: [
68
+ ...Array.isArray(L.defaults.transformResponse) ? L.defaults.transformResponse : [],
69
+ (S, Oe, E) => {
70
+ if (E !== void 0 && (E < 200 || E >= 300))
71
+ return {
72
+ data: [],
73
+ hasMore: !1,
74
+ totalCount: 0
75
+ };
76
+ if (!S || typeof S != "object")
77
+ throw new Error("Invalid response format");
78
+ const pe = S.contentItems?.length ?? 0;
79
+ return {
80
+ data: S.contentItems?.map((g) => {
81
+ const O = g.fields[b.DocType] ?? "", R = g.fields[b.TitleWithFallback] ?? "", k = g.fields[b.CortexPath] ?? "", M = k.endsWith("/") && k.length > 1 ? k.slice(0, -1) : k;
82
+ let j = M;
83
+ (O === P.Album || O === P.ProjectDocument) && (j = M ? `${M}/${R}` : R);
84
+ const Z = g.fields[b.DocSubTypeIsFontIcon];
85
+ return {
86
+ docType: O,
87
+ fullPath: j,
88
+ hasChildren: g.fields[b.HasBrowserChildren] === "1",
89
+ iconColor: g.fields[b.DocSubTypeIconColor],
90
+ iconImageUrl: g.fields[b.DocSubTypeIconImageUrl],
91
+ iconName: g.fields[b.DocSubTypeIconName],
92
+ id: g.recordID,
93
+ isFontIcon: Z === void 0 ? void 0 : Z === "1",
94
+ representativeAssetId: g.fields[b.RepresentativeAssetId] ?? "",
95
+ title: R
96
+ };
97
+ }) ?? [],
98
+ hasMore: H + pe < S.totalCount,
99
+ totalCount: S.totalCount
100
+ };
101
+ }
102
+ ],
103
+ url: xe
104
+ })).data;
105
+ } catch {
106
+ return {
107
+ data: [],
108
+ hasMore: !1,
109
+ totalCount: 0
110
+ };
111
+ }
112
+ }
113
+ var C = /* @__PURE__ */ ((e) => (e.Input = "input", e.Select = "select", e))(C || {}), De = Object.defineProperty, _e = Object.getOwnPropertyDescriptor, c = (e, t, r, l) => {
114
+ for (var i = l > 1 ? void 0 : l ? _e(t, r) : t, u = e.length - 1, f; u >= 0; u--)
115
+ (f = e[u]) && (i = (l ? f(t, r, i) : f(i)) || i);
116
+ return l && i && De(t, r, i), i;
117
+ };
118
+ let a = class extends B {
119
+ constructor() {
120
+ super(...arguments), this.localize = new W(this), this.role = "treeitem", this.disabledSyncCheckboxes = !0, this.folderId = "", this.hasChildren = !1, this.selectable = !1, this.fullPath = "", this.docType = P.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 = q, this.excludeVirtualFolders = !1, this.url = "", this.icon = "", this.iconName = "", this.iconImageUrl = "", this.iconColor = "", this.isFontIcon = !1, this.data = null, this.hasMore = !1, this.loading = !1;
121
+ }
122
+ /**
123
+ * 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
124
+ */
125
+ createRenderRoot() {
126
+ return this;
127
+ }
128
+ async fetchFolders({
129
+ folderId: e,
130
+ start: t = 0
131
+ }) {
132
+ if (!this.api)
133
+ return {
134
+ data: [],
135
+ hasMore: !1,
136
+ totalCount: 0
137
+ };
138
+ try {
139
+ const { data: r, hasMore: l, totalCount: i } = await this.api({
140
+ baseUrl: this.baseUrl,
141
+ bearerToken: this.bearerToken,
142
+ excludeVirtualFolders: this.excludeVirtualFolders,
143
+ folderId: e,
144
+ start: t,
145
+ token: this.token
146
+ });
147
+ return {
148
+ data: r,
149
+ hasMore: l,
150
+ totalCount: i
151
+ };
152
+ } catch {
153
+ return {
154
+ data: [],
155
+ hasMore: !1,
156
+ totalCount: 0
157
+ };
158
+ }
159
+ }
160
+ async loadMore(e) {
161
+ e.stopPropagation();
162
+ const t = this.data?.length || 0;
163
+ this.loading = !0;
164
+ try {
165
+ const { data: r, hasMore: l } = await this.fetchFolders({
166
+ folderId: this.folderId,
167
+ start: t
168
+ });
169
+ this.data = [...this.data || [], ...r], this.hasMore = l, this.emit("cx-folder-select-children-loaded", { detail: { folders: r } });
170
+ } catch {
171
+ } finally {
172
+ this.loading = !1;
173
+ }
174
+ }
175
+ async handleLazyLoad(e) {
176
+ e.stopPropagation(), this.treeItem.expanded = !0;
177
+ const t = this.data?.length || 0;
178
+ try {
179
+ const { data: r, hasMore: l } = await this.fetchFolders({
180
+ folderId: this.folderId,
181
+ start: t
182
+ });
183
+ this.data = r, this.hasMore = l, this.emit("cx-folder-select-children-loaded", { detail: { folders: r } });
184
+ } catch {
185
+ this.treeItem.expanded = !1;
186
+ }
187
+ }
188
+ async syncBoxes() {
189
+ if (this.selection !== "multiple" || (await this.updateComplete, !this.treeItem))
190
+ return;
191
+ const e = this.fullPath, t = G({ id: this.folderId, path: e }), r = J(e), l = this.currentRootIDsSet.has(t);
192
+ let i = !1;
193
+ if (e)
194
+ for (const f of this.currentRootIDsSet) {
195
+ const $ = Se(f);
196
+ if (!$.path.trim() || !$.id.trim())
197
+ continue;
198
+ const T = J($.path);
199
+ if (T.startsWith(r) && T !== r) {
200
+ i = !0;
201
+ break;
202
+ }
203
+ }
204
+ const u = !l && i;
205
+ this.treeItem.selected = l, await this.treeItem.updateComplete, this.treeItem.indeterminate = u;
206
+ }
207
+ /**
208
+ * Resolves the icon to render, in priority order:
209
+ * 1. `icon` explicit override (unchanged legacy behavior; used by the
210
+ * separate `extra-folder-icon` feature).
211
+ * 2. Server-resolved DocSubType image icon (`isFontIcon === false` and
212
+ * `iconImageUrl` set).
213
+ * 3. Server-resolved DocSubType font icon (`isFontIcon !== false` and
214
+ * `iconName` set).
215
+ * 4. Default folder icon, keeping the existing docType-driven variant.
216
+ */
217
+ renderIcon() {
218
+ const e = le(
219
+ this.iconColor ? { color: this.iconColor } : {}
220
+ );
221
+ if (!this.icon && this.isFontIcon === !1 && this.iconImageUrl)
222
+ return m`<cx-icon class="folder-select-tree__item__icon" src=${this.iconImageUrl} style=${e}></cx-icon>`;
223
+ if (!this.icon && this.isFontIcon !== !1 && this.iconName)
224
+ return m`<cx-icon class="folder-select-tree__item__icon" name=${this.iconName} variant="fa" style=${e}></cx-icon>`;
225
+ const t = this.docType === P.Album ? "outlined" : "filled";
226
+ return m`<cx-icon class="folder-select-tree__item__icon" name=${this.icon || "folder"} variant=${t}></cx-icon>`;
227
+ }
228
+ render() {
229
+ return m`<cx-tree-item class=${Te({
230
+ "folder-select-tree-item": !0
231
+ })} data-id=${this.folderId} data-url=${p(this.url)} data-name=${p(this.name?.trim() || void 0)} data-representative-asset-id=${p(
232
+ this.representativeAssetId || void 0
233
+ )} 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">${this.renderIcon()}<cx-line-clamp lines="1" class="folder-select-tree-item__title">${Fe(this.name, this.searchTerm)}</cx-line-clamp></cx-space>${A(
234
+ this.data || [],
235
+ (e) => e.id,
236
+ (e) => m`<cx-folder-select-tree-item slot="children" folder-id=${e.id} full-path=${e.fullPath} name=${e.title} doc-type=${e.docType} icon-name=${p(e.iconName || void 0)} icon-image-url=${p(e.iconImageUrl || void 0)} icon-color=${p(e.iconColor || void 0)} representative-asset-id=${e.representativeAssetId} selected-value=${this.selectedValue} selection=${this.selection} token=${this.token} bearer-token=${this.bearerToken} ?exclude-virtual-folders=${this.excludeVirtualFolders} ?has-children=${e.hasChildren} ?is-font-icon=${e.isFontIcon} ?selectable=${this.selectable} base-url=${this.baseUrl} url=${p(e.url ?? void 0)} .api=${this.api} .currentRootIDsSet=${this.currentRootIDsSet} .removedIDs=${this.removedIDs} value=${e.url}></cx-folder-select-tree-item>`
237
+ )}
238
+ ${w(
239
+ this.hasMore,
240
+ () => 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>`
241
+ )}</cx-tree-item>`;
242
+ }
243
+ };
244
+ a.styles = [re];
245
+ a.dependencies = {
246
+ "cx-button": ie,
247
+ "cx-icon": ee,
248
+ "cx-line-clamp": te,
249
+ "cx-space": Ie,
250
+ "cx-tree-item": v
251
+ };
252
+ c([
253
+ se("cx-tree-item")
254
+ ], a.prototype, "treeItem", 2);
255
+ c([
256
+ s({ attribute: "folder-id", reflect: !0, type: String })
257
+ ], a.prototype, "folderId", 2);
258
+ c([
259
+ s({ attribute: "has-children", reflect: !0, type: Boolean })
260
+ ], a.prototype, "hasChildren", 2);
261
+ c([
262
+ s({ reflect: !0, type: Boolean })
263
+ ], a.prototype, "selectable", 2);
264
+ c([
265
+ s({ attribute: "full-path", reflect: !0, type: String })
266
+ ], a.prototype, "fullPath", 2);
267
+ c([
268
+ s({ attribute: "doc-type", reflect: !0, type: String })
269
+ ], a.prototype, "docType", 2);
270
+ c([
271
+ s({ reflect: !0, type: String })
272
+ ], a.prototype, "name", 2);
273
+ c([
274
+ s({
275
+ attribute: "representative-asset-id",
276
+ reflect: !0,
277
+ type: String
278
+ })
279
+ ], a.prototype, "representativeAssetId", 2);
280
+ c([
281
+ s({ attribute: "selected-value", reflect: !0, type: String })
282
+ ], a.prototype, "selectedValue", 2);
283
+ c([
284
+ s({ attribute: "selection", reflect: !0, type: String })
285
+ ], a.prototype, "selection", 2);
286
+ c([
287
+ s({ attribute: !1, type: Object })
288
+ ], a.prototype, "currentRootIDsSet", 2);
289
+ c([
290
+ s({ attribute: !1, type: Array })
291
+ ], a.prototype, "removedIDs", 2);
292
+ c([
293
+ s({ reflect: !0, type: String })
294
+ ], a.prototype, "token", 2);
295
+ c([
296
+ s({ attribute: "bearer-token", reflect: !0, type: String })
297
+ ], a.prototype, "bearerToken", 2);
298
+ c([
299
+ s({ attribute: "base-url", reflect: !0, type: String })
300
+ ], a.prototype, "baseUrl", 2);
301
+ c([
302
+ s({ attribute: "search-term", reflect: !0, type: String })
303
+ ], a.prototype, "searchTerm", 2);
304
+ c([
305
+ s({ type: Function })
306
+ ], a.prototype, "api", 2);
307
+ c([
308
+ s({
309
+ attribute: "exclude-virtual-folders",
310
+ reflect: !0,
311
+ type: Boolean
312
+ })
313
+ ], a.prototype, "excludeVirtualFolders", 2);
314
+ c([
315
+ s({ reflect: !0, type: String })
316
+ ], a.prototype, "url", 2);
317
+ c([
318
+ s({ reflect: !0, type: String })
319
+ ], a.prototype, "icon", 2);
320
+ c([
321
+ s({ attribute: "icon-name", reflect: !0, type: String })
322
+ ], a.prototype, "iconName", 2);
323
+ c([
324
+ s({ attribute: "icon-image-url", reflect: !0, type: String })
325
+ ], a.prototype, "iconImageUrl", 2);
326
+ c([
327
+ s({ attribute: "icon-color", reflect: !0, type: String })
328
+ ], a.prototype, "iconColor", 2);
329
+ c([
330
+ s({ attribute: "is-font-icon", reflect: !0, type: Boolean })
331
+ ], a.prototype, "isFontIcon", 2);
332
+ c([
333
+ x()
334
+ ], a.prototype, "data", 2);
335
+ c([
336
+ x()
337
+ ], a.prototype, "hasMore", 2);
338
+ c([
339
+ x()
340
+ ], a.prototype, "loading", 2);
341
+ c([
342
+ y("currentRootIDsSet"),
343
+ y("removedIDs"),
344
+ y("fullPath"),
345
+ y("folderId")
346
+ ], a.prototype, "syncBoxes", 1);
347
+ a = c([
348
+ N("cx-folder-select-tree-item")
349
+ ], a);
350
+ var ke = Object.defineProperty, we = Object.getOwnPropertyDescriptor, ae = (e) => {
351
+ throw TypeError(e);
352
+ }, d = (e, t, r, l) => {
353
+ for (var i = l > 1 ? void 0 : l ? we(t, r) : t, u = e.length - 1, f; u >= 0; u--)
354
+ (f = e[u]) && (i = (l ? f(t, r, i) : f(i)) || i);
355
+ return l && i && ke(t, r, i), i;
356
+ }, oe = (e, t, r) => t.has(e) || ae("Cannot " + r), I = (e, t, r) => (oe(e, t, "read from private field"), t.get(e)), z = (e, t, r) => t.has(e) ? ae("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), K = (e, t, r, l) => (oe(e, t, "write to private field"), t.set(e, r), r), D, V, _;
357
+ let n = class extends B {
358
+ constructor() {
359
+ super(...arguments), this.localize = new W(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 = q, this.excludeVirtualFolders = !1, this.firstFetchCallback = null, this.autoPageSize = !1, this.data = [], this.hasMore = !1, this.loading = !1, this.preloadedFolders = [], this.currentRootIDsSet = /* @__PURE__ */ new Set(), this.removedIDs = [], z(this, D, !1), z(this, V, 10), z(this, _, /* @__PURE__ */ new Set());
360
+ }
361
+ get empty() {
362
+ return !this.loading && this.data.length === 0;
363
+ }
364
+ /**
365
+ * This is used to render the cx-tree inside the cx-folder-select without the shadow root so that the cx-folder-select can query select the cx-tree inside
366
+ */
367
+ createRenderRoot() {
368
+ return this;
369
+ }
370
+ computeInitialLimit() {
371
+ const t = this.getRootNode();
372
+ let r = t instanceof ShadowRoot ? t.host : this.parentElement;
373
+ for (; r; ) {
374
+ if (r instanceof HTMLElement && r.offsetHeight > 0)
375
+ return Math.max(10, Math.ceil(r.offsetHeight / 32) + 2);
376
+ const l = r.getRootNode();
377
+ r = l instanceof ShadowRoot ? l.host : r.parentElement;
378
+ }
379
+ return 10;
380
+ }
381
+ runFirstUpdated() {
382
+ this.searchTerm = "", this.autoPageSize && K(this, V, this.computeInitialLimit()), this.handleFetchFolders();
383
+ }
384
+ async handleExtraFolderIdChange() {
385
+ if (!this.extraFolderId || !this.api) {
386
+ this.extraFolderData = null;
387
+ return;
388
+ }
389
+ const { data: e } = await this.api({
390
+ baseUrl: this.baseUrl,
391
+ bearerToken: this.bearerToken,
392
+ excludeVirtualFolders: this.excludeVirtualFolders,
393
+ folderId: this.extraFolderId,
394
+ includeDirectChild: !1,
395
+ limit: 1,
396
+ searchTerm: this.searchTerm,
397
+ seeThru: this.seeThru,
398
+ self: !0,
399
+ start: 0,
400
+ token: this.token
401
+ });
402
+ this.extraFolderData = e[0] ?? null;
403
+ }
404
+ /**
405
+ * Update `currentRootIDsSet` from a tree-item's toggle. Per-folder
406
+ * selection: each folder is independent, so a click only adds/removes
407
+ * the clicked folder — never its ancestors or descendants. Parents
408
+ * showing an indeterminate hint is purely visual (computed in
409
+ * `cx-folder-select-tree-item.syncBoxes` from path-prefix matches),
410
+ * not a real selection.
411
+ *
412
+ * Only runs in multiple mode — single mode is still driven by `selectedValue`.
413
+ */
414
+ async handleSelectedChange(e) {
415
+ if (this.selection !== "multiple")
416
+ return;
417
+ const t = e.target, r = t.dataset.id ?? "", l = t.closest(
418
+ "cx-folder-select-tree-item"
419
+ )?.fullPath;
420
+ if (await t.updateComplete, !r.trim() || !l?.trim())
421
+ return;
422
+ const i = G({ id: r, path: l });
423
+ t.indeterminate && !t.selected || (t.selected ? this.currentRootIDsSet.add(i) : this.currentRootIDsSet.delete(i), this.currentRootIDsSet = new Set(this.currentRootIDsSet));
424
+ }
425
+ async loadMore(e) {
426
+ if (!this.api)
427
+ return;
428
+ e.stopPropagation();
429
+ const t = this.data.length;
430
+ this.loading = !0;
431
+ const { data: r, hasMore: l } = await this.api({
432
+ baseUrl: this.baseUrl,
433
+ bearerToken: this.bearerToken,
434
+ excludeVirtualFolders: this.excludeVirtualFolders,
435
+ folderId: "",
436
+ limit: 10,
437
+ searchTerm: this.searchTerm,
438
+ seeThru: this.seeThru,
439
+ start: t,
440
+ token: this.token
441
+ });
442
+ this.data = [...this.data, ...r], this.hasMore = l, this.loading = !1, this.seedSelectionFromValue(r), this.removePreloadedFolders(r);
443
+ }
444
+ async handleFetchFolders() {
445
+ const { data: e, hasMore: t } = await this.fetchFolders();
446
+ I(this, D) || (e.length > 0 && this.firstFetchCallback?.(e), K(this, D, !0)), this.data = e, this.hasMore = t, this.loading = !1, this.seedSelectionFromValue(e), this.removePreloadedFolders(e), await this.preloadSelectedFolders();
447
+ }
448
+ async handleSelectedValueChange() {
449
+ if (!I(this, D))
450
+ return;
451
+ const e = new Set(
452
+ this.selectedValue.split(/[\s,]+/).filter(Boolean)
453
+ ), t = this.preloadedFolders.filter((r) => e.has(r.id));
454
+ t.length !== this.preloadedFolders.length && (this.preloadedFolders = t), await this.preloadSelectedFolders();
455
+ }
456
+ async fetchFolders() {
457
+ if (!this.api)
458
+ return {
459
+ data: [],
460
+ hasMore: !1
461
+ };
462
+ if (this.searchTerm.length > 0 && this.searchTerm.length < this.minQueryLength)
463
+ return {
464
+ data: [],
465
+ hasMore: !1
466
+ };
467
+ this.loading = !0;
468
+ const { data: e, hasMore: t } = await this.api({
469
+ baseUrl: this.baseUrl,
470
+ bearerToken: this.bearerToken,
471
+ excludeVirtualFolders: this.excludeVirtualFolders,
472
+ folderId: "",
473
+ limit: I(this, V),
474
+ searchTerm: this.searchTerm,
475
+ seeThru: this.seeThru,
476
+ start: 0,
477
+ token: this.token
478
+ });
479
+ return this.data = e, this.hasMore = t, this.loading = !1, {
480
+ data: e,
481
+ hasMore: t
482
+ };
483
+ }
484
+ handleChildrenLoaded(e) {
485
+ this.seedSelectionFromValue(e.detail.folders), this.removePreloadedFolders(e.detail.folders);
486
+ }
487
+ removePreloadedFolders(e) {
488
+ if (this.preloadedFolders.length === 0)
489
+ return;
490
+ const t = new Set(e.map((l) => l.id)), r = this.preloadedFolders.filter((l) => !t.has(l.id));
491
+ r.length !== this.preloadedFolders.length && (this.preloadedFolders = r);
492
+ }
493
+ async preloadSelectedFolders() {
494
+ if (this.selection !== "multiple" || !this.selectedValue || !this.api)
495
+ return;
496
+ const e = new Set(
497
+ this.selectedValue.split(/[\s,]+/).filter(Boolean)
498
+ ), t = /* @__PURE__ */ new Set([
499
+ ...this.data.map((i) => i.id),
500
+ ...this.extraFolderData ? [this.extraFolderData.id] : [],
501
+ ...this.preloadedFolders.map((i) => i.id),
502
+ ...I(this, _),
503
+ ...[
504
+ ...this.querySelectorAll(
505
+ "cx-folder-select-tree-item"
506
+ )
507
+ ].map((i) => i.getAttribute("folder-id") ?? "").filter(Boolean)
508
+ ]), r = [...e].filter(
509
+ (i) => !t.has(i)
510
+ );
511
+ if (r.length === 0)
512
+ return;
513
+ r.forEach((i) => I(this, _).add(i));
514
+ const l = [];
515
+ if (await Promise.all(
516
+ r.map(async (i) => {
517
+ try {
518
+ const { data: u } = await this.api({
519
+ baseUrl: this.baseUrl,
520
+ bearerToken: this.bearerToken,
521
+ excludeVirtualFolders: this.excludeVirtualFolders,
522
+ folderId: i,
523
+ includeDirectChild: !1,
524
+ limit: 1,
525
+ searchTerm: "",
526
+ seeThru: this.seeThru,
527
+ self: !0,
528
+ start: 0,
529
+ token: this.token
530
+ });
531
+ u[0] && l.push(u[0]);
532
+ } catch {
533
+ }
534
+ })
535
+ ), r.forEach((i) => I(this, _).delete(i)), l.length > 0) {
536
+ const i = new Set(this.preloadedFolders.map((f) => f.id)), u = l.filter((f) => !i.has(f.id));
537
+ u.length > 0 && (this.preloadedFolders = [...this.preloadedFolders, ...u].sort(
538
+ (f, $) => f.title.localeCompare($.title)
539
+ ), this.seedSelectionFromValue(u));
540
+ }
541
+ }
542
+ seedSelectionFromValue(e) {
543
+ if (this.selection !== "multiple" || !this.selectedValue)
544
+ return;
545
+ const t = new Set(
546
+ this.selectedValue.split(/[\s,]+/).map((l) => l.trim()).filter(Boolean)
547
+ );
548
+ let r = !1;
549
+ for (const l of e)
550
+ if (l.fullPath && t.has(l.id)) {
551
+ const i = G({ id: l.id, path: l.fullPath });
552
+ this.currentRootIDsSet.has(i) || (this.currentRootIDsSet.add(i), r = !0);
553
+ }
554
+ r && (this.currentRootIDsSet = new Set(this.currentRootIDsSet), this.emit("cx-folder-select-selection-seeded"));
555
+ }
556
+ renderFolder(e) {
557
+ 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=${p(e.fullPath ?? void 0)} icon-name=${p(e.iconName || void 0)} icon-image-url=${p(e.iconImageUrl || void 0)} icon-color=${p(e.iconColor || void 0)} name=${e.title} search-term=${this.searchTerm} selected-value=${this.selectedValue} selection=${this.selection} token=${this.token} bearer-token=${this.bearerToken} url=${p(e.url ?? void 0)} ?has-children=${e.hasChildren} ?is-font-icon=${e.isFontIcon} ?selectable=${this.selection === "multiple"} ?exclude-virtual-folders=${this.excludeVirtualFolders}></cx-folder-select-tree-item>`;
558
+ }
559
+ render() {
560
+ 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(
561
+ this.empty,
562
+ () => m`<div class="folder-select-tree__empty-message" role="status" aria-live="polite"><cx-typography variant="body3">${this.localize.term("noResults")}</cx-typography></div>`
563
+ )}
564
+ ${w(
565
+ this.extraFolderData,
566
+ () => m`<cx-folder-select-tree-item .api=${this.api} .currentRootIDsSet=${this.currentRootIDsSet} .removedIDs=${this.removedIDs} base-url=${this.baseUrl} doc-type=${p(this.extraFolderData?.docType ?? void 0)} folder-id=${p(this.extraFolderData?.id ?? void 0)} full-path=${p(this.extraFolderData?.fullPath ?? void 0)} icon=${this.extraFolderIcon} icon-name=${p(this.extraFolderData?.iconName || void 0)} icon-image-url=${p(
567
+ this.extraFolderData?.iconImageUrl || void 0
568
+ )} icon-color=${p(this.extraFolderData?.iconColor || void 0)} 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=${p(this.extraFolderData?.url ?? void 0)} ?has-children=${this.extraFolderData?.hasChildren} ?is-font-icon=${this.extraFolderData?.isFontIcon} ?selectable=${this.selection === "multiple"} ?exclude-virtual-folders=${this.excludeVirtualFolders}></cx-folder-select-tree-item>`
569
+ )}
570
+ ${A(
571
+ this.data,
572
+ (e) => e.id,
573
+ (e) => this.renderFolder(e)
574
+ )}
575
+ ${w(
576
+ this.hasMore,
577
+ () => m`<cx-button class="folder-select-tree__load-more" variant="text" @click=${this.loadMore} ?loading=${this.loading}>${this.localize.term("more")}</cx-button>`
578
+ )}</cx-tree>${A(
579
+ this.preloadedFolders,
580
+ (e) => `preloaded-${e.id}`,
581
+ (e) => m`<cx-folder-select-tree-item style=${le({ 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=${p(e.fullPath ?? void 0)} icon-name=${p(e.iconName || void 0)} icon-image-url=${p(e.iconImageUrl || void 0)} icon-color=${p(e.iconColor || void 0)} name=${e.title} search-term=${this.searchTerm} selected-value=${this.selectedValue} selection=${this.selection} token=${this.token} bearer-token=${this.bearerToken} url=${p(e.url ?? void 0)} ?has-children=${!1} ?is-font-icon=${e.isFontIcon} ?selectable=${this.selection === "multiple"} ?exclude-virtual-folders=${this.excludeVirtualFolders}></cx-folder-select-tree-item>`
582
+ )}`;
583
+ }
584
+ };
585
+ D = /* @__PURE__ */ new WeakMap();
586
+ V = /* @__PURE__ */ new WeakMap();
587
+ _ = /* @__PURE__ */ new WeakMap();
588
+ n.dependencies = {
589
+ "cx-button": ie,
590
+ "cx-folder-select-tree-item": a,
591
+ "cx-tree": ye
592
+ };
593
+ d([
594
+ s({ attribute: "min-query-length", reflect: !0, type: Number })
595
+ ], n.prototype, "minQueryLength", 2);
596
+ d([
597
+ s({ attribute: "selection", reflect: !0, type: String })
598
+ ], n.prototype, "selection", 2);
599
+ d([
600
+ s({ attribute: "search-term", reflect: !0, type: String })
601
+ ], n.prototype, "searchTerm", 2);
602
+ d([
603
+ s({ attribute: "selected-value", reflect: !0, type: String })
604
+ ], n.prototype, "selectedValue", 2);
605
+ d([
606
+ s({ reflect: !0, type: String })
607
+ ], n.prototype, "token", 2);
608
+ d([
609
+ s({ attribute: "bearer-token", reflect: !0, type: String })
610
+ ], n.prototype, "bearerToken", 2);
611
+ d([
612
+ s({ attribute: "base-url", reflect: !0, type: String })
613
+ ], n.prototype, "baseUrl", 2);
614
+ d([
615
+ s({ attribute: "extra-folder-id", reflect: !0, type: String })
616
+ ], n.prototype, "extraFolderId", 2);
617
+ d([
618
+ s({ attribute: "extra-folder-title", reflect: !0, type: String })
619
+ ], n.prototype, "extraFolderTitle", 2);
620
+ d([
621
+ s({ attribute: "extra-folder-icon", reflect: !0, type: String })
622
+ ], n.prototype, "extraFolderIcon", 2);
623
+ d([
624
+ s({ attribute: "see-thru", reflect: !0, type: Boolean })
625
+ ], n.prototype, "seeThru", 2);
626
+ d([
627
+ x()
628
+ ], n.prototype, "extraFolderData", 2);
629
+ d([
630
+ s({ type: Function })
631
+ ], n.prototype, "api", 2);
632
+ d([
633
+ s({
634
+ attribute: "exclude-virtual-folders",
635
+ reflect: !0,
636
+ type: Boolean
637
+ })
638
+ ], n.prototype, "excludeVirtualFolders", 2);
639
+ d([
640
+ s({ attribute: "first-fetch-callback", reflect: !1, type: Function })
641
+ ], n.prototype, "firstFetchCallback", 2);
642
+ d([
643
+ s({ attribute: "auto-page-size", reflect: !0, type: Boolean })
644
+ ], n.prototype, "autoPageSize", 2);
645
+ d([
646
+ x()
647
+ ], n.prototype, "data", 2);
648
+ d([
649
+ x()
650
+ ], n.prototype, "hasMore", 2);
651
+ d([
652
+ x()
653
+ ], n.prototype, "loading", 2);
654
+ d([
655
+ x()
656
+ ], n.prototype, "preloadedFolders", 2);
657
+ d([
658
+ x()
659
+ ], n.prototype, "currentRootIDsSet", 2);
660
+ d([
661
+ x()
662
+ ], n.prototype, "removedIDs", 2);
663
+ d([
664
+ y("extraFolderId")
665
+ ], n.prototype, "handleExtraFolderIdChange", 1);
666
+ d([
667
+ y("baseUrl", { waitUntilFirstUpdate: !0 }),
668
+ y("token", { waitUntilFirstUpdate: !0 }),
669
+ y("searchTerm", { waitUntilFirstUpdate: !0 }),
670
+ y("excludeVirtualFolders", { waitUntilFirstUpdate: !0 }),
671
+ ve(500)
672
+ ], n.prototype, "handleFetchFolders", 1);
673
+ d([
674
+ y("selectedValue", { waitUntilFirstUpdate: !0 })
675
+ ], n.prototype, "handleSelectedValueChange", 1);
676
+ n = d([
677
+ N("cx-folder-select-tree")
678
+ ], n);
679
+ const Ve = be`: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}`;
680
+ var Pe = Object.defineProperty, Ue = Object.getOwnPropertyDescriptor, ne = (e) => {
681
+ throw TypeError(e);
682
+ }, h = (e, t, r, l) => {
683
+ for (var i = l > 1 ? void 0 : l ? Ue(t, r) : t, u = e.length - 1, f; u >= 0; u--)
684
+ (f = e[u]) && (i = (l ? f(t, r, i) : f(i)) || i);
685
+ return l && i && Pe(t, r, i), i;
686
+ }, ce = (e, t, r) => t.has(e) || ne("Cannot " + r), X = (e, t, r) => (ce(e, t, "read from private field"), r ? r.call(e) : t.get(e)), Ee = (e, t, r) => t.has(e) ? ne("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), Y = (e, t, r, l) => (ce(e, t, "write to private field"), t.set(e, r), r), F;
687
+ let o = class extends B {
688
+ constructor() {
689
+ super(), this.localize = new W(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 = q, this.required = !1, this.form = void 0, this.excludeVirtualFolders = !1, this.extraFolderId = "", this.extraFolderTitle = "", this.extraFolderIcon = "", this.autoPageSize = !1, this.firstFetchCallback = null, this.searchTerm = "", Ee(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();
690
+ }
691
+ updateWrappedApi() {
692
+ if (!this.api) {
693
+ Y(this, F, void 0);
694
+ return;
695
+ }
696
+ Y(this, F, async (e) => {
697
+ try {
698
+ return await this.api(e);
699
+ } catch (t) {
700
+ return t instanceof ge && t.response?.status === 401 && this.emit("cx-renew-token"), { data: [], hasMore: !1, totalCount: 0 };
701
+ }
702
+ });
703
+ }
704
+ handleSearchTermChange() {
705
+ this.emit("cx-folder-select-search-term-change", {
706
+ detail: {
707
+ value: this.searchTerm
708
+ }
709
+ });
710
+ }
711
+ handleSearchTermInputChange(e) {
712
+ this.searchTerm = e.target.value;
713
+ }
714
+ handleSearchTermSelectChange(e) {
715
+ e.target === e.currentTarget && (this.searchTerm = e.currentTarget.displayInput.value);
716
+ }
717
+ handleSelectClear() {
718
+ if (this.searchTerm = "", this.selection !== "multiple")
719
+ return;
720
+ const e = this.shadowRoot?.querySelector("cx-folder-select-tree");
721
+ e && (e.currentRootIDsSet = /* @__PURE__ */ new Set(), e.removedIDs = []);
722
+ }
723
+ /**
724
+ * cx-select's own `value` only reflects our `value` correctly the very
725
+ * first time it parses the initial `value` attribute. Any
726
+ * `handleDefaultSlotChange()` call that runs before matching tree-items
727
+ * exist (e.g. right after mount, before the tree has fetched/preloaded
728
+ * folders) makes cx-select recompute `selectedOptions` from zero matches
729
+ * and overwrite its own `value` to `[]` (`selectionChanged` in
730
+ * select.ts) — permanently losing the original folder ids, since nothing
731
+ * else ever pushes `value` back into cx-select afterwards. Re-derive
732
+ * cx-select.value from our own `value` (the real source of truth) before
733
+ * every `handleDefaultSlotChange()` call so that wipe never sticks.
734
+ */
735
+ syncSelectValue() {
736
+ this.selectEl && (this.selectEl.value = this.selection === "multiple" ? this.value.split(/[\s,]+/).filter(Boolean) : this.value);
737
+ }
738
+ /**
739
+ * cx-select's selectedOptions cache (which drives the tag UI in
740
+ * `multiple` mode) is only recomputed during its own `selectionChanged`
741
+ * flow — that flow doesn't run in our setup because we no-op
742
+ * `selectSetOptionSelected` for multi-select (cx-tree owns selection).
743
+ * Re-read options here so the rendered tag list matches, in response to
744
+ * either signal cx-folder-select-tree can emit:
745
+ * - `cx-selected-change`, bubbled from a user toggling a tree-item.
746
+ * - `cx-folder-select-selection-seeded`, emitted when selection is derived
747
+ * from `value` during data loading/preloading — those tree-items never
748
+ * emit a real `cx-selected-change` themselves (suppressed on their own
749
+ * first update), so this is the only signal for that case.
750
+ */
751
+ async handleTreeSelectedChange() {
752
+ this.selection !== "multiple" || !this.selectEl || (await new Promise(
753
+ (e) => requestAnimationFrame(() => e())
754
+ ), this.syncSelectValue(), this.selectEl.handleDefaultSlotChange(), await this.selectEl.updateComplete, this.selectEl.displayLabel = this.searchTerm);
755
+ }
756
+ selectGetOptionValue(e) {
757
+ return !e || !(e instanceof v) ? this.value : e.dataset.id || this.value;
758
+ }
759
+ selectGetOptionLabel(e) {
760
+ return !e || !(e instanceof v) ? this.selectedLabel : e.dataset.name || this.selectedLabel;
761
+ }
762
+ selectGetOptionSelected(e) {
763
+ if (!(!e || !(e instanceof v)))
764
+ return e.selected;
765
+ }
766
+ selectFilterCallback(e) {
767
+ return !(!e || !(e instanceof v));
768
+ }
769
+ /**
770
+ * Custom tag renderer for cx-select multi mode. Identical visuals to the
771
+ * default tag, but the X click goes through cx-tree's selection flow
772
+ * (`option.selected = false` → `cx-selected-change` →
773
+ * cx-folder-select-tree.handleSelectedChange) rather than
774
+ * cx-select.toggleOptionSelection (which our `selectSetOptionSelected`
775
+ * no-ops in multi mode, so the default X click would do nothing).
776
+ */
777
+ selectGetTag(e) {
778
+ return m`<cx-tag part="tag" exportparts="
779
+ base:tag__base,
780
+ content:tag__content,
781
+ remove-button:tag__remove-button,
782
+ remove-button__base:tag__remove-button__base
783
+ " removable @cx-remove=${(r) => {
784
+ r.stopPropagation(), e instanceof v && (e.selected = !1);
785
+ }}><cx-line-clamp lines="1">${this.selectGetOptionLabel(e)}</cx-line-clamp></cx-tag>`;
786
+ }
787
+ selectSetOptionSelected(e, t) {
788
+ if (!(!e || !(e instanceof v)) && this.selection !== "multiple") {
789
+ if (t === void 0) {
790
+ e.selected = !e.selected;
791
+ return;
792
+ }
793
+ e.selected = t;
794
+ }
795
+ }
796
+ updateFunctionProps() {
797
+ this.selectEl && (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.syncSelectValue(), this.selectEl.handleDefaultSlotChange());
798
+ }
799
+ handleOpenChange() {
800
+ if (this.selectEl) {
801
+ if (!this.open) {
802
+ this.selectEl.hide();
803
+ return;
804
+ }
805
+ this.updateFunctionProps();
806
+ }
807
+ }
808
+ async handleVariantChange() {
809
+ this.variant === C.Select && (await this.updateComplete, this.updateFunctionProps());
810
+ }
811
+ handleValueChange() {
812
+ 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.syncSelectValue(), this.selectEl.handleDefaultSlotChange());
813
+ }
814
+ render() {
815
+ return m`<div class="folder-select">${$e(this.variant, [
816
+ [
817
+ C.Input,
818
+ () => 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} ?auto-page-size=${this.autoPageSize} .api=${X(this, F)} .firstFetchCallback=${this.firstFetchCallback}></cx-folder-select-tree>`
819
+ ],
820
+ [
821
+ C.Select,
822
+ () => 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} @cx-folder-select-selection-seeded=${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} ?auto-page-size=${this.autoPageSize} .api=${X(this, F)} .firstFetchCallback=${this.firstFetchCallback}></cx-folder-select-tree></cx-select>`
823
+ ]
824
+ ])}</div>`;
825
+ }
826
+ };
827
+ F = /* @__PURE__ */ new WeakMap();
828
+ o.styles = [re, Ve];
829
+ o.dependencies = {
830
+ "cx-folder-select-tree": n,
831
+ "cx-icon": ee,
832
+ "cx-input": ue,
833
+ "cx-line-clamp": te,
834
+ "cx-select": fe,
835
+ "cx-tag": me
836
+ };
837
+ h([
838
+ se("cx-select")
839
+ ], o.prototype, "selectEl", 2);
840
+ h([
841
+ s({ attribute: "min-query-length", reflect: !0, type: Number })
842
+ ], o.prototype, "minQueryLength", 2);
843
+ h([
844
+ s({ attribute: "selection", reflect: !0, type: String })
845
+ ], o.prototype, "selection", 2);
846
+ h([
847
+ s({ attribute: "variant", reflect: !0, type: String })
848
+ ], o.prototype, "variant", 2);
849
+ h([
850
+ s({ reflect: !0, type: String })
851
+ ], o.prototype, "value", 2);
852
+ h([
853
+ s({ reflect: !0, type: String })
854
+ ], o.prototype, "name", 2);
855
+ h([
856
+ s({ attribute: "selected-label", reflect: !0, type: String })
857
+ ], o.prototype, "selectedLabel", 2);
858
+ h([
859
+ s({ attribute: "base-url", reflect: !0, type: String })
860
+ ], o.prototype, "baseUrl", 2);
861
+ h([
862
+ s({ reflect: !0, type: Boolean })
863
+ ], o.prototype, "open", 2);
864
+ h([
865
+ s({ reflect: !1, type: String })
866
+ ], o.prototype, "token", 2);
867
+ h([
868
+ s({ attribute: "bearer-token", reflect: !0, type: String })
869
+ ], o.prototype, "bearerToken", 2);
870
+ h([
871
+ s({ attribute: "see-thru", reflect: !0, type: Boolean })
872
+ ], o.prototype, "seeThru", 2);
873
+ h([
874
+ s({ type: Function })
875
+ ], o.prototype, "api", 2);
876
+ h([
877
+ s({ reflect: !0, type: Boolean })
878
+ ], o.prototype, "required", 2);
879
+ h([
880
+ s({ reflect: !1 })
881
+ ], o.prototype, "form", 2);
882
+ h([
883
+ s({
884
+ attribute: "exclude-virtual-folders",
885
+ reflect: !0,
886
+ type: Boolean
887
+ })
888
+ ], o.prototype, "excludeVirtualFolders", 2);
889
+ h([
890
+ s({
891
+ attribute: "extra-folder-id",
892
+ reflect: !0,
893
+ type: String
894
+ })
895
+ ], o.prototype, "extraFolderId", 2);
896
+ h([
897
+ s({
898
+ attribute: "extra-folder-title",
899
+ reflect: !0,
900
+ type: String
901
+ })
902
+ ], o.prototype, "extraFolderTitle", 2);
903
+ h([
904
+ s({
905
+ attribute: "extra-folder-icon",
906
+ reflect: !0,
907
+ type: String
908
+ })
909
+ ], o.prototype, "extraFolderIcon", 2);
910
+ h([
911
+ s({ attribute: "auto-page-size", reflect: !0, type: Boolean })
912
+ ], o.prototype, "autoPageSize", 2);
913
+ h([
914
+ s({ attribute: "first-fetch-callback", reflect: !1, type: Function })
915
+ ], o.prototype, "firstFetchCallback", 2);
916
+ h([
917
+ x()
918
+ ], o.prototype, "searchTerm", 2);
919
+ h([
920
+ y("api")
921
+ ], o.prototype, "updateWrappedApi", 1);
922
+ h([
923
+ y("searchTerm", { waitUntilFirstUpdate: !0 })
924
+ ], o.prototype, "handleSearchTermChange", 1);
925
+ h([
926
+ y("open")
927
+ ], o.prototype, "handleOpenChange", 1);
928
+ h([
929
+ y("variant")
930
+ ], o.prototype, "handleVariantChange", 1);
931
+ h([
932
+ y("selectedLabel", { waitUntilFirstUpdate: !0 }),
933
+ y("value", { waitUntilFirstUpdate: !0 })
934
+ ], o.prototype, "handleValueChange", 1);
935
+ o = h([
936
+ N("cx-folder-select")
937
+ ], o);
938
+ export {
939
+ o as C,
940
+ C as F,
941
+ q as a
942
+ };