@orangelogic/orange-dam-content-browser-sdk 2.3.6 → 2.3.7-table-view-beta-2

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 (24) hide show
  1. package/build/GlobalConfigContext.d.ts +3 -0
  2. package/build/OrangeDAMContentBrowserSDK.min.js +782 -326
  3. package/build/api/asset/asset.d.ts +2 -1
  4. package/build/components/content-browser/content-browser.d.ts +37 -2
  5. package/build/components/content-browser-asset-card/content-browser-asset-card.d.ts +17 -1
  6. package/build/components/content-browser-control-bar/content-browser-control-bar.d.ts +1 -0
  7. package/build/components/content-browser-control-view/content-browser-control-view.d.ts +5 -2
  8. package/build/components/content-browser-format-dialog/content-browser-format-dialog.d.ts +27 -1
  9. package/build/components/content-browser-grid/content-browser-grid.d.ts +5 -1
  10. package/build/components/content-browser-grid/scroll-anchor-controller.d.ts +12 -1
  11. package/build/components/content-browser-table/content-browser-table.d.ts +178 -0
  12. package/build/components/content-browser-table/content-browser-table.styles.d.ts +2 -0
  13. package/build/content-browser.mjs +1725 -474
  14. package/build/events/cx-content-browser-control-view-change.d.ts +2 -2
  15. package/build/events/cx-content-browser-request-change.d.ts +2 -2
  16. package/build/events/cx-content-browser-table-column-resize.d.ts +16 -0
  17. package/build/events/index.d.ts +1 -0
  18. package/build/index.d.ts +29 -2
  19. package/build/index.html +4 -0
  20. package/build/index.mjs +1694 -425
  21. package/build/tools/fetch-and-merge-assets.d.ts +10 -1
  22. package/build/types/asset.d.ts +5 -0
  23. package/build/types/content-browser.d.ts +53 -0
  24. package/package.json +1 -1
package/build/index.mjs CHANGED
@@ -110,7 +110,7 @@ var __yieldStar = (value) => {
110
110
  }, "return" in obj && method("return"), it2;
111
111
  };
112
112
  var __forAwait = (obj, it2, method) => (it2 = obj[__knownSymbol("asyncIterator")]) ? it2.call(obj) : (obj = obj[__knownSymbol("iterator")](), it2 = {}, method = (key, fn) => (fn = obj[key]) && (it2[key] = (arg) => new Promise((yes, no, done) => (arg = fn.call(obj, arg), done = arg.done, Promise.resolve(arg.value).then((value) => yes({ value, done }), no)))), method("next"), method("return"), it2);
113
- var _a, _b, _c, _d, _e2, _f, _host, _getContainer, _getItemIndexById, _itemSelector, _anchor, _columnCount, _itemHeight, _pendingRestoreFrames, _restoreSequence, _lastGetDataParameters, _lastMappedAvailableExtensions, _lastData, _hasFetchedOnce;
113
+ var _a, _b, _c, _d, _e2, _f, _host, _getContainer, _getContentOffset, _getItemIndexById, _getLayoutSource, _itemSelector, _anchor, _columnCount, _itemHeight, _pendingRestoreFrames, _restoreSequence, _lastGetDataParameters, _lastMappedAvailableExtensions, _lastData, _hasFetchedOnce;
114
114
  import CxDrawer from "@orangelogic/design-system/components/drawer";
115
115
  import CxFolderSelect from "@orangelogic/design-system/components/folder-select";
116
116
  import CxIcon from "@orangelogic/design-system/components/icon";
@@ -1222,13 +1222,13 @@ var camelCase = createCompounder(function(result, word, index) {
1222
1222
  word = word.toLowerCase();
1223
1223
  return result + (index ? capitalize(word) : word);
1224
1224
  });
1225
- var __defProp$h = Object.defineProperty;
1226
- var __decorateClass$h = (decorators, target, key, kind) => {
1225
+ var __defProp$i = Object.defineProperty;
1226
+ var __decorateClass$i = (decorators, target, key, kind) => {
1227
1227
  var result = void 0;
1228
1228
  for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
1229
1229
  if (decorator = decorators[i4])
1230
1230
  result = decorator(target, key, result) || result;
1231
- if (result) __defProp$h(target, key, result);
1231
+ if (result) __defProp$i(target, key, result);
1232
1232
  return result;
1233
1233
  };
1234
1234
  const _CortexElement = class _CortexElement extends i$4 {
@@ -1355,16 +1355,16 @@ const _CortexElement = class _CortexElement extends i$4 {
1355
1355
  _CortexElement.version = "1";
1356
1356
  _CortexElement.dependencies = {};
1357
1357
  let CortexElement = _CortexElement;
1358
- __decorateClass$h([
1358
+ __decorateClass$i([
1359
1359
  n$6()
1360
1360
  ], CortexElement.prototype, "dir");
1361
- __decorateClass$h([
1361
+ __decorateClass$i([
1362
1362
  n$6()
1363
1363
  ], CortexElement.prototype, "lang");
1364
- __decorateClass$h([
1364
+ __decorateClass$i([
1365
1365
  n$6()
1366
1366
  ], CortexElement.prototype, "theme");
1367
- __decorateClass$h([
1367
+ __decorateClass$i([
1368
1368
  n$6({ attribute: "pre-render", type: Boolean })
1369
1369
  ], CortexElement.prototype, "preRender");
1370
1370
  function rescueElementPrototype(element) {
@@ -5814,7 +5814,7 @@ function watch(propertyName, options) {
5814
5814
  };
5815
5815
  };
5816
5816
  }
5817
- const styles$e = i$7`
5817
+ const styles$f = i$7`
5818
5818
  :host {
5819
5819
  display: contents;
5820
5820
  }
@@ -5903,14 +5903,14 @@ const styles$e = i$7`
5903
5903
  display: block;
5904
5904
  }
5905
5905
  `;
5906
- var __defProp$g = Object.defineProperty;
5907
- var __getOwnPropDesc$g = Object.getOwnPropertyDescriptor;
5908
- var __decorateClass$g = (decorators, target, key, kind) => {
5909
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$g(target, key) : target;
5906
+ var __defProp$h = Object.defineProperty;
5907
+ var __getOwnPropDesc$h = Object.getOwnPropertyDescriptor;
5908
+ var __decorateClass$h = (decorators, target, key, kind) => {
5909
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$h(target, key) : target;
5910
5910
  for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
5911
5911
  if (decorator = decorators[i4])
5912
5912
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
5913
- if (kind && result) __defProp$g(target, key, result);
5913
+ if (kind && result) __defProp$h(target, key, result);
5914
5914
  return result;
5915
5915
  };
5916
5916
  const LIBRARY_FOLDER_TITLE = "Library";
@@ -6173,7 +6173,7 @@ let CxContentBrowserBrowser = class extends CortexElement {
6173
6173
  `;
6174
6174
  }
6175
6175
  };
6176
- CxContentBrowserBrowser.styles = [componentStyles, styles$e];
6176
+ CxContentBrowserBrowser.styles = [componentStyles, styles$f];
6177
6177
  CxContentBrowserBrowser.dependencies = {
6178
6178
  "cx-drawer": CxDrawer,
6179
6179
  "cx-folder-select": CxFolderSelect,
@@ -6183,67 +6183,67 @@ CxContentBrowserBrowser.dependencies = {
6183
6183
  "cx-tooltip": CxTooltip,
6184
6184
  "cx-typography": CxTypography
6185
6185
  };
6186
- __decorateClass$g([
6186
+ __decorateClass$h([
6187
6187
  e$7(".drawer-trigger")
6188
6188
  ], CxContentBrowserBrowser.prototype, "trigger", 2);
6189
- __decorateClass$g([
6189
+ __decorateClass$h([
6190
6190
  e$7(".content-browser-browser")
6191
6191
  ], CxContentBrowserBrowser.prototype, "drawer", 2);
6192
- __decorateClass$g([
6192
+ __decorateClass$h([
6193
6193
  n$6({ attribute: "folder-id", type: String })
6194
6194
  ], CxContentBrowserBrowser.prototype, "folderId", 2);
6195
- __decorateClass$g([
6195
+ __decorateClass$h([
6196
6196
  n$6({ attribute: "folder-title", type: String })
6197
6197
  ], CxContentBrowserBrowser.prototype, "folderTitle", 2);
6198
- __decorateClass$g([
6198
+ __decorateClass$h([
6199
6199
  n$6({ attribute: "allowed-folders", type: Array })
6200
6200
  ], CxContentBrowserBrowser.prototype, "allowedFolders", 2);
6201
- __decorateClass$g([
6201
+ __decorateClass$h([
6202
6202
  n$6({ attribute: "can-pin", type: Boolean })
6203
6203
  ], CxContentBrowserBrowser.prototype, "canPin", 2);
6204
- __decorateClass$g([
6204
+ __decorateClass$h([
6205
6205
  n$6({ attribute: "collection-path", type: String })
6206
6206
  ], CxContentBrowserBrowser.prototype, "collectionPath", 2);
6207
- __decorateClass$g([
6207
+ __decorateClass$h([
6208
6208
  n$6({ attribute: "favorite-folder-id", type: String })
6209
6209
  ], CxContentBrowserBrowser.prototype, "favoriteFolderId", 2);
6210
- __decorateClass$g([
6210
+ __decorateClass$h([
6211
6211
  n$6({ attribute: "show-collections", type: Boolean })
6212
6212
  ], CxContentBrowserBrowser.prototype, "showCollections", 2);
6213
- __decorateClass$g([
6213
+ __decorateClass$h([
6214
6214
  n$6({ attribute: "show-favorite-folder", type: Boolean })
6215
6215
  ], CxContentBrowserBrowser.prototype, "showFavoriteFolder", 2);
6216
- __decorateClass$g([
6216
+ __decorateClass$h([
6217
6217
  n$6({ attribute: "force-overlay", type: Boolean })
6218
6218
  ], CxContentBrowserBrowser.prototype, "forceOverlay", 2);
6219
- __decorateClass$g([
6219
+ __decorateClass$h([
6220
6220
  n$6({ attribute: "see-thru", type: Boolean })
6221
6221
  ], CxContentBrowserBrowser.prototype, "seeThru", 2);
6222
- __decorateClass$g([
6222
+ __decorateClass$h([
6223
6223
  n$6({ attribute: "min-query-length", type: Number })
6224
6224
  ], CxContentBrowserBrowser.prototype, "minQueryLength", 2);
6225
- __decorateClass$g([
6225
+ __decorateClass$h([
6226
6226
  n$6({ attribute: "token", type: String })
6227
6227
  ], CxContentBrowserBrowser.prototype, "token", 2);
6228
- __decorateClass$g([
6228
+ __decorateClass$h([
6229
6229
  n$6({ attribute: "base-url", type: String })
6230
6230
  ], CxContentBrowserBrowser.prototype, "baseUrl", 2);
6231
- __decorateClass$g([
6231
+ __decorateClass$h([
6232
6232
  n$6({ attribute: "use-site-session", type: Boolean })
6233
6233
  ], CxContentBrowserBrowser.prototype, "useSiteSession", 2);
6234
- __decorateClass$g([
6234
+ __decorateClass$h([
6235
6235
  r$6()
6236
6236
  ], CxContentBrowserBrowser.prototype, "searchTerm", 2);
6237
- __decorateClass$g([
6237
+ __decorateClass$h([
6238
6238
  r$6()
6239
6239
  ], CxContentBrowserBrowser.prototype, "isPersistent", 2);
6240
- __decorateClass$g([
6240
+ __decorateClass$h([
6241
6241
  r$6()
6242
6242
  ], CxContentBrowserBrowser.prototype, "collectionsOpen", 2);
6243
- __decorateClass$g([
6243
+ __decorateClass$h([
6244
6244
  watch("forceOverlay", { waitUntilFirstUpdate: true })
6245
6245
  ], CxContentBrowserBrowser.prototype, "handleForceOverlayChange", 1);
6246
- CxContentBrowserBrowser = __decorateClass$g([
6246
+ CxContentBrowserBrowser = __decorateClass$h([
6247
6247
  customElement("cx-content-browser-browser")
6248
6248
  ], CxContentBrowserBrowser);
6249
6249
  /**
@@ -6374,6 +6374,7 @@ var GridView$1 = /* @__PURE__ */ ((GridView2) => {
6374
6374
  GridView2["Small"] = "small";
6375
6375
  return GridView2;
6376
6376
  })(GridView$1 || {});
6377
+ const TABLE_VIEW = "table";
6377
6378
  const ASSET_SIZE = {
6378
6379
  [
6379
6380
  "small"
@@ -6406,19 +6407,40 @@ var TransformationAction = /* @__PURE__ */ ((TransformationAction2) => {
6406
6407
  TransformationAction2["Rotate"] = "Rotate";
6407
6408
  return TransformationAction2;
6408
6409
  })(TransformationAction || {});
6410
+ const autoSelectFormatConverter = {
6411
+ fromAttribute: (value) => {
6412
+ if (value === null) {
6413
+ return false;
6414
+ }
6415
+ const normalized = value.trim();
6416
+ if (normalized === "" || normalized.toLowerCase() === "true") {
6417
+ return true;
6418
+ }
6419
+ if (normalized.toLowerCase() === "false") {
6420
+ return false;
6421
+ }
6422
+ return normalized;
6423
+ },
6424
+ toAttribute: (value) => {
6425
+ return value === false ? null : String(value);
6426
+ }
6427
+ };
6428
+ function isAutoSelectFormatActive(value) {
6429
+ return value === true || typeof value === "string" && value.trim() !== "";
6430
+ }
6409
6431
  var ContentBrowserFormatDialogVariant = /* @__PURE__ */ ((ContentBrowserFormatDialogVariant2) => {
6410
6432
  ContentBrowserFormatDialogVariant2["Dialog"] = "dialog";
6411
6433
  ContentBrowserFormatDialogVariant2["Drawer"] = "drawer";
6412
6434
  return ContentBrowserFormatDialogVariant2;
6413
6435
  })(ContentBrowserFormatDialogVariant || {});
6414
- var __defProp$f = Object.defineProperty;
6415
- var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor;
6416
- var __decorateClass$f = (decorators, target, key, kind) => {
6417
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$f(target, key) : target;
6436
+ var __defProp$g = Object.defineProperty;
6437
+ var __getOwnPropDesc$g = Object.getOwnPropertyDescriptor;
6438
+ var __decorateClass$g = (decorators, target, key, kind) => {
6439
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$g(target, key) : target;
6418
6440
  for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
6419
6441
  if (decorator = decorators[i4])
6420
6442
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6421
- if (kind && result) __defProp$f(target, key, result);
6443
+ if (kind && result) __defProp$g(target, key, result);
6422
6444
  return result;
6423
6445
  };
6424
6446
  let CxContentBrowserControlFilterFacet = class extends CortexElement {
@@ -6554,37 +6576,37 @@ CxContentBrowserControlFilterFacet.dependencies = {
6554
6576
  "cx-typography": CxTypography
6555
6577
  };
6556
6578
  CxContentBrowserControlFilterFacet.itemsPerPage = 10;
6557
- __decorateClass$f([
6579
+ __decorateClass$g([
6558
6580
  n$6({ attribute: "loading", reflect: false, type: Boolean })
6559
6581
  ], CxContentBrowserControlFilterFacet.prototype, "loading", 2);
6560
- __decorateClass$f([
6582
+ __decorateClass$g([
6561
6583
  n$6({ attribute: "display-name", reflect: false, type: String })
6562
6584
  ], CxContentBrowserControlFilterFacet.prototype, "displayName", 2);
6563
- __decorateClass$f([
6585
+ __decorateClass$g([
6564
6586
  n$6({ attribute: "type", reflect: true, type: String })
6565
6587
  ], CxContentBrowserControlFilterFacet.prototype, "type", 2);
6566
- __decorateClass$f([
6588
+ __decorateClass$g([
6567
6589
  n$6({ attribute: "values", reflect: false, type: Array })
6568
6590
  ], CxContentBrowserControlFilterFacet.prototype, "values", 2);
6569
- __decorateClass$f([
6591
+ __decorateClass$g([
6570
6592
  n$6({ attribute: "collections", reflect: false, type: Array })
6571
6593
  ], CxContentBrowserControlFilterFacet.prototype, "collections", 2);
6572
- __decorateClass$f([
6594
+ __decorateClass$g([
6573
6595
  r$6()
6574
6596
  ], CxContentBrowserControlFilterFacet.prototype, "mappedSubtypes", 2);
6575
- __decorateClass$f([
6597
+ __decorateClass$g([
6576
6598
  r$6()
6577
6599
  ], CxContentBrowserControlFilterFacet.prototype, "mappedDisplayNames", 2);
6578
- __decorateClass$f([
6600
+ __decorateClass$g([
6579
6601
  r$6()
6580
6602
  ], CxContentBrowserControlFilterFacet.prototype, "page", 2);
6581
- __decorateClass$f([
6603
+ __decorateClass$g([
6582
6604
  watch("values")
6583
6605
  ], CxContentBrowserControlFilterFacet.prototype, "handleValuesChange", 1);
6584
- CxContentBrowserControlFilterFacet = __decorateClass$f([
6606
+ CxContentBrowserControlFilterFacet = __decorateClass$g([
6585
6607
  customElement("cx-content-browser-control-filter-facet")
6586
6608
  ], CxContentBrowserControlFilterFacet);
6587
- const styles$d = i$7`
6609
+ const styles$e = i$7`
6588
6610
  :host {
6589
6611
  --details-width: min(240px, 90dvw);
6590
6612
 
@@ -6609,14 +6631,14 @@ const styles$d = i$7`
6609
6631
  border-left-width: 0px;
6610
6632
  }
6611
6633
  `;
6612
- var __defProp$e = Object.defineProperty;
6613
- var __getOwnPropDesc$e = Object.getOwnPropertyDescriptor;
6614
- var __decorateClass$e = (decorators, target, key, kind) => {
6615
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$e(target, key) : target;
6634
+ var __defProp$f = Object.defineProperty;
6635
+ var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor;
6636
+ var __decorateClass$f = (decorators, target, key, kind) => {
6637
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$f(target, key) : target;
6616
6638
  for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
6617
6639
  if (decorator = decorators[i4])
6618
6640
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6619
- if (kind && result) __defProp$e(target, key, result);
6641
+ if (kind && result) __defProp$f(target, key, result);
6620
6642
  return result;
6621
6643
  };
6622
6644
  let CxContentBrowserControlFilter = class extends CortexElement {
@@ -6841,7 +6863,7 @@ let CxContentBrowserControlFilter = class extends CortexElement {
6841
6863
  `;
6842
6864
  }
6843
6865
  };
6844
- CxContentBrowserControlFilter.styles = [componentStyles, styles$d];
6866
+ CxContentBrowserControlFilter.styles = [componentStyles, styles$e];
6845
6867
  CxContentBrowserControlFilter.dependencies = {
6846
6868
  "cx-badge": CxBadge,
6847
6869
  "cx-button": CxButton,
@@ -6862,52 +6884,52 @@ CxContentBrowserControlFilter.dependencies = {
6862
6884
  "cx-tooltip": CxTooltip,
6863
6885
  "cx-typography": CxTypography
6864
6886
  };
6865
- __decorateClass$e([
6887
+ __decorateClass$f([
6866
6888
  n$6({ attribute: "facets", reflect: false, type: Array })
6867
6889
  ], CxContentBrowserControlFilter.prototype, "facets", 2);
6868
- __decorateClass$e([
6890
+ __decorateClass$f([
6869
6891
  n$6({ attribute: "available-facets", reflect: false, type: Array })
6870
6892
  ], CxContentBrowserControlFilter.prototype, "availableFacets", 2);
6871
- __decorateClass$e([
6893
+ __decorateClass$f([
6872
6894
  n$6({ attribute: "selected-facets", reflect: false, type: Object })
6873
6895
  ], CxContentBrowserControlFilter.prototype, "selectedFacets", 2);
6874
- __decorateClass$e([
6896
+ __decorateClass$f([
6875
6897
  n$6({ attribute: "loading", reflect: false, type: Boolean })
6876
6898
  ], CxContentBrowserControlFilter.prototype, "loading", 2);
6877
- __decorateClass$e([
6899
+ __decorateClass$f([
6878
6900
  n$6({ attribute: "newly-changed-option", reflect: false, type: Object })
6879
6901
  ], CxContentBrowserControlFilter.prototype, "newlyChangedOption", 2);
6880
- __decorateClass$e([
6902
+ __decorateClass$f([
6881
6903
  n$6({ attribute: "is-mobile", reflect: false, type: Boolean })
6882
6904
  ], CxContentBrowserControlFilter.prototype, "isMobile", 2);
6883
- __decorateClass$e([
6905
+ __decorateClass$f([
6884
6906
  r$6()
6885
6907
  ], CxContentBrowserControlFilter.prototype, "appliedFiltersCount", 2);
6886
- __decorateClass$e([
6908
+ __decorateClass$f([
6887
6909
  r$6()
6888
6910
  ], CxContentBrowserControlFilter.prototype, "mappedDisplayNames", 2);
6889
- __decorateClass$e([
6911
+ __decorateClass$f([
6890
6912
  watch("facets")
6891
6913
  ], CxContentBrowserControlFilter.prototype, "handleFacetsChange", 1);
6892
- __decorateClass$e([
6914
+ __decorateClass$f([
6893
6915
  watch("selectedFacets")
6894
6916
  ], CxContentBrowserControlFilter.prototype, "handleSelectedFacetsChange", 1);
6895
- CxContentBrowserControlFilter = __decorateClass$e([
6917
+ CxContentBrowserControlFilter = __decorateClass$f([
6896
6918
  customElement("cx-content-browser-control-filter")
6897
6919
  ], CxContentBrowserControlFilter);
6898
- const styles$c = i$7`
6920
+ const styles$d = i$7`
6899
6921
  :host {
6900
6922
  display: contents;
6901
6923
  }
6902
6924
  `;
6903
- var __defProp$d = Object.defineProperty;
6904
- var __getOwnPropDesc$d = Object.getOwnPropertyDescriptor;
6905
- var __decorateClass$d = (decorators, target, key, kind) => {
6906
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$d(target, key) : target;
6925
+ var __defProp$e = Object.defineProperty;
6926
+ var __getOwnPropDesc$e = Object.getOwnPropertyDescriptor;
6927
+ var __decorateClass$e = (decorators, target, key, kind) => {
6928
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$e(target, key) : target;
6907
6929
  for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
6908
6930
  if (decorator = decorators[i4])
6909
6931
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6910
- if (kind && result) __defProp$d(target, key, result);
6932
+ if (kind && result) __defProp$e(target, key, result);
6911
6933
  return result;
6912
6934
  };
6913
6935
  let CxContentBrowserControlSort = class extends CortexElement {
@@ -7046,7 +7068,7 @@ let CxContentBrowserControlSort = class extends CortexElement {
7046
7068
  `;
7047
7069
  }
7048
7070
  };
7049
- CxContentBrowserControlSort.styles = [componentStyles, styles$c];
7071
+ CxContentBrowserControlSort.styles = [componentStyles, styles$d];
7050
7072
  CxContentBrowserControlSort.dependencies = {
7051
7073
  "cx-divider": CxDivider,
7052
7074
  "cx-dropdown": CxDropdown,
@@ -7057,40 +7079,40 @@ CxContentBrowserControlSort.dependencies = {
7057
7079
  "cx-spinner": CxSpinner,
7058
7080
  "cx-tooltip": CxTooltip
7059
7081
  };
7060
- __decorateClass$d([
7082
+ __decorateClass$e([
7061
7083
  n$6({ attribute: "sort-order-name", reflect: true, type: String })
7062
7084
  ], CxContentBrowserControlSort.prototype, "sortOrderName", 2);
7063
- __decorateClass$d([
7085
+ __decorateClass$e([
7064
7086
  n$6({ attribute: "sort-direction", reflect: true, type: String })
7065
7087
  ], CxContentBrowserControlSort.prototype, "sortDirection", 2);
7066
- __decorateClass$d([
7088
+ __decorateClass$e([
7067
7089
  n$6({ attribute: "sort-orders", reflect: false, type: Array })
7068
7090
  ], CxContentBrowserControlSort.prototype, "sortOrders", 2);
7069
- __decorateClass$d([
7091
+ __decorateClass$e([
7070
7092
  n$6({ attribute: "loading", reflect: true, type: Boolean })
7071
7093
  ], CxContentBrowserControlSort.prototype, "loading", 2);
7072
- __decorateClass$d([
7094
+ __decorateClass$e([
7073
7095
  n$6({ attribute: "is-mobile", reflect: false, type: Boolean })
7074
7096
  ], CxContentBrowserControlSort.prototype, "isMobile", 2);
7075
- __decorateClass$d([
7097
+ __decorateClass$e([
7076
7098
  n$6({ attribute: "newly-changed-option", reflect: false, type: Object })
7077
7099
  ], CxContentBrowserControlSort.prototype, "newlyChangedOption", 2);
7078
- __decorateClass$d([
7100
+ __decorateClass$e([
7079
7101
  r$6()
7080
7102
  ], CxContentBrowserControlSort.prototype, "mappedSortDirections", 2);
7081
- __decorateClass$d([
7103
+ __decorateClass$e([
7082
7104
  r$6()
7083
7105
  ], CxContentBrowserControlSort.prototype, "sortDirections", 2);
7084
- __decorateClass$d([
7106
+ __decorateClass$e([
7085
7107
  watch("sortOrderName"),
7086
7108
  watch("sortDirection"),
7087
7109
  watch("sortOrders", { waitUntilFirstUpdate: true }),
7088
7110
  watch("sortDirections", { waitUntilFirstUpdate: true })
7089
7111
  ], CxContentBrowserControlSort.prototype, "handleSortDirectionsChange", 1);
7090
- CxContentBrowserControlSort = __decorateClass$d([
7112
+ CxContentBrowserControlSort = __decorateClass$e([
7091
7113
  customElement("cx-content-browser-control-sort")
7092
7114
  ], CxContentBrowserControlSort);
7093
- const styles$b = i$7`
7115
+ const styles$c = i$7`
7094
7116
  :host {
7095
7117
  display: contents;
7096
7118
  }
@@ -7100,14 +7122,14 @@ const styles$b = i$7`
7100
7122
  --checked-icon-display: none;
7101
7123
  }
7102
7124
  `;
7103
- var __defProp$c = Object.defineProperty;
7104
- var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor;
7105
- var __decorateClass$c = (decorators, target, key, kind) => {
7106
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$c(target, key) : target;
7125
+ var __defProp$d = Object.defineProperty;
7126
+ var __getOwnPropDesc$d = Object.getOwnPropertyDescriptor;
7127
+ var __decorateClass$d = (decorators, target, key, kind) => {
7128
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$d(target, key) : target;
7107
7129
  for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
7108
7130
  if (decorator = decorators[i4])
7109
7131
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7110
- if (kind && result) __defProp$c(target, key, result);
7132
+ if (kind && result) __defProp$d(target, key, result);
7111
7133
  return result;
7112
7134
  };
7113
7135
  let CxContentBrowserControlView = class extends CortexElement {
@@ -7118,6 +7140,10 @@ let CxContentBrowserControlView = class extends CortexElement {
7118
7140
  this.views = [];
7119
7141
  this.isSeeThrough = false;
7120
7142
  this.isMobile = false;
7143
+ this.canUseTable = false;
7144
+ }
7145
+ get isTable() {
7146
+ return this.view === TABLE_VIEW;
7121
7147
  }
7122
7148
  runConnectedCallback() {
7123
7149
  this.handleViewChange();
@@ -7137,6 +7163,21 @@ let CxContentBrowserControlView = class extends CortexElement {
7137
7163
  }
7138
7164
  });
7139
7165
  }
7166
+ renderTableOption() {
7167
+ if (!this.canUseTable) {
7168
+ return A$1;
7169
+ }
7170
+ return b`
7171
+ <cx-menu-item
7172
+ value=${TABLE_VIEW}
7173
+ type="checkbox"
7174
+ ?checked=${this.isTable}
7175
+ >
7176
+ <cx-line-clamp lines="1">${this.localize.term("table")}</cx-line-clamp>
7177
+ <cx-icon slot="prefix" name="table_rows"></cx-icon>
7178
+ </cx-menu-item>
7179
+ `;
7180
+ }
7140
7181
  handleViewChange() {
7141
7182
  this.selectedView = this.views.find((item) => item.value === this.view);
7142
7183
  }
@@ -7154,7 +7195,7 @@ let CxContentBrowserControlView = class extends CortexElement {
7154
7195
  <div slot="trigger">
7155
7196
  <cx-tooltip content=${this.localize.term("view")}>
7156
7197
  <cx-icon-button
7157
- name="dashboard"
7198
+ name=${this.isTable ? "table_rows" : "dashboard"}
7158
7199
  label=${this.localize.term("view")}
7159
7200
  outline
7160
7201
  ></cx-icon-button>
@@ -7181,6 +7222,7 @@ let CxContentBrowserControlView = class extends CortexElement {
7181
7222
  )}
7182
7223
  <cx-icon slot="prefix" name="grid_view"></cx-icon>
7183
7224
  </cx-menu-item>
7225
+ ${this.renderTableOption()}
7184
7226
  <cx-divider></cx-divider>
7185
7227
  <cx-menu-item value="see-thru" class="menu-item--switch">
7186
7228
  <cx-space direction="horizontal" justify-content="space-between">
@@ -7214,7 +7256,7 @@ let CxContentBrowserControlView = class extends CortexElement {
7214
7256
  () => b`
7215
7257
  <cx-menu key="default-menu" no-uncheck>
7216
7258
  <cx-menu-label>${this.localize.term("view")}</cx-menu-label>
7217
- <cx-menu-item type="checkbox">
7259
+ <cx-menu-item type="checkbox" ?checked=${!this.isTable}>
7218
7260
  ${this.localize.term("grid")}
7219
7261
  ${n$5(
7220
7262
  this.selectedView,
@@ -7243,6 +7285,7 @@ let CxContentBrowserControlView = class extends CortexElement {
7243
7285
  </cx-menu>
7244
7286
  <cx-icon slot="prefix" name="grid_view"></cx-icon>
7245
7287
  </cx-menu-item>
7288
+ ${this.renderTableOption()}
7246
7289
  <cx-divider></cx-divider>
7247
7290
  <cx-menu-item value="see-thru" class="menu-item--switch">
7248
7291
  <cx-space direction="horizontal" justify-content="space-between">
@@ -7260,7 +7303,7 @@ let CxContentBrowserControlView = class extends CortexElement {
7260
7303
  `;
7261
7304
  }
7262
7305
  };
7263
- CxContentBrowserControlView.styles = [componentStyles, styles$b];
7306
+ CxContentBrowserControlView.styles = [componentStyles, styles$c];
7264
7307
  CxContentBrowserControlView.dependencies = {
7265
7308
  "cx-divider": CxDivider,
7266
7309
  "cx-dropdown": CxDropdown,
@@ -7274,28 +7317,31 @@ CxContentBrowserControlView.dependencies = {
7274
7317
  "cx-switch": CxSwitch,
7275
7318
  "cx-tooltip": CxTooltip
7276
7319
  };
7277
- __decorateClass$c([
7320
+ __decorateClass$d([
7278
7321
  n$6({ attribute: "view", reflect: true, type: String })
7279
7322
  ], CxContentBrowserControlView.prototype, "view", 2);
7280
- __decorateClass$c([
7323
+ __decorateClass$d([
7281
7324
  n$6({ attribute: "views", reflect: false, type: Array })
7282
7325
  ], CxContentBrowserControlView.prototype, "views", 2);
7283
- __decorateClass$c([
7326
+ __decorateClass$d([
7284
7327
  n$6({ attribute: "is-see-through", reflect: true, type: Boolean })
7285
7328
  ], CxContentBrowserControlView.prototype, "isSeeThrough", 2);
7286
- __decorateClass$c([
7329
+ __decorateClass$d([
7287
7330
  n$6({ attribute: "is-mobile", reflect: false, type: Boolean })
7288
7331
  ], CxContentBrowserControlView.prototype, "isMobile", 2);
7289
- __decorateClass$c([
7332
+ __decorateClass$d([
7333
+ n$6({ attribute: "can-use-table", reflect: true, type: Boolean })
7334
+ ], CxContentBrowserControlView.prototype, "canUseTable", 2);
7335
+ __decorateClass$d([
7290
7336
  r$6()
7291
7337
  ], CxContentBrowserControlView.prototype, "selectedView", 2);
7292
- __decorateClass$c([
7338
+ __decorateClass$d([
7293
7339
  watch("view", { waitUntilFirstUpdate: true })
7294
7340
  ], CxContentBrowserControlView.prototype, "handleViewChange", 1);
7295
- CxContentBrowserControlView = __decorateClass$c([
7341
+ CxContentBrowserControlView = __decorateClass$d([
7296
7342
  customElement("cx-content-browser-control-view")
7297
7343
  ], CxContentBrowserControlView);
7298
- const styles$a = i$7`
7344
+ const styles$b = i$7`
7299
7345
  :host {
7300
7346
  display: block;
7301
7347
  }
@@ -7318,14 +7364,14 @@ const styles$a = i$7`
7318
7364
  margin-left: auto;
7319
7365
  }
7320
7366
  `;
7321
- var __defProp$b = Object.defineProperty;
7322
- var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor;
7323
- var __decorateClass$b = (decorators, target, key, kind) => {
7324
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(target, key) : target;
7367
+ var __defProp$c = Object.defineProperty;
7368
+ var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor;
7369
+ var __decorateClass$c = (decorators, target, key, kind) => {
7370
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$c(target, key) : target;
7325
7371
  for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
7326
7372
  if (decorator = decorators[i4])
7327
7373
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7328
- if (kind && result) __defProp$b(target, key, result);
7374
+ if (kind && result) __defProp$c(target, key, result);
7329
7375
  return result;
7330
7376
  };
7331
7377
  let CxContentBrowserControlBar = class extends CortexElement {
@@ -7346,6 +7392,7 @@ let CxContentBrowserControlBar = class extends CortexElement {
7346
7392
  this.loading = false;
7347
7393
  this.searchText = "";
7348
7394
  this.isMobile = false;
7395
+ this.canUseTable = false;
7349
7396
  }
7350
7397
  handleSearchChange(event) {
7351
7398
  this.searchText = event.target.value;
@@ -7393,6 +7440,7 @@ let CxContentBrowserControlBar = class extends CortexElement {
7393
7440
  <cx-content-browser-control-view
7394
7441
  view=${this.view}
7395
7442
  .views=${this.views}
7443
+ ?can-use-table=${this.canUseTable}
7396
7444
  ?is-see-through=${this.isSeeThrough}
7397
7445
  ?is-mobile=${this.isMobile}
7398
7446
  ></cx-content-browser-control-view>
@@ -7409,7 +7457,7 @@ let CxContentBrowserControlBar = class extends CortexElement {
7409
7457
  `;
7410
7458
  }
7411
7459
  };
7412
- CxContentBrowserControlBar.styles = [componentStyles, styles$a];
7460
+ CxContentBrowserControlBar.styles = [componentStyles, styles$b];
7413
7461
  CxContentBrowserControlBar.dependencies = {
7414
7462
  "cx-avatar": CxAvatar,
7415
7463
  "cx-content-browser-control-filter": CxContentBrowserControlFilter,
@@ -7421,52 +7469,55 @@ CxContentBrowserControlBar.dependencies = {
7421
7469
  "cx-space": CxSpace,
7422
7470
  "cx-typography": CxTypography
7423
7471
  };
7424
- __decorateClass$b([
7472
+ __decorateClass$c([
7425
7473
  n$6({ attribute: "current-count", type: Number })
7426
7474
  ], CxContentBrowserControlBar.prototype, "currentCount", 2);
7427
- __decorateClass$b([
7475
+ __decorateClass$c([
7428
7476
  n$6({ attribute: "total-count", type: Number })
7429
7477
  ], CxContentBrowserControlBar.prototype, "totalCount", 2);
7430
- __decorateClass$b([
7478
+ __decorateClass$c([
7431
7479
  n$6({ attribute: "sort-order-name", reflect: true, type: String })
7432
7480
  ], CxContentBrowserControlBar.prototype, "sortOrderName", 2);
7433
- __decorateClass$b([
7481
+ __decorateClass$c([
7434
7482
  n$6({ attribute: "sort-direction", reflect: true, type: String })
7435
7483
  ], CxContentBrowserControlBar.prototype, "sortDirection", 2);
7436
- __decorateClass$b([
7484
+ __decorateClass$c([
7437
7485
  n$6({ attribute: "sort-orders", reflect: false, type: Array })
7438
7486
  ], CxContentBrowserControlBar.prototype, "sortOrders", 2);
7439
- __decorateClass$b([
7487
+ __decorateClass$c([
7440
7488
  n$6({ attribute: "view", reflect: true, type: String })
7441
7489
  ], CxContentBrowserControlBar.prototype, "view", 2);
7442
- __decorateClass$b([
7490
+ __decorateClass$c([
7443
7491
  n$6({ attribute: "views", reflect: false, type: Array })
7444
7492
  ], CxContentBrowserControlBar.prototype, "views", 2);
7445
- __decorateClass$b([
7493
+ __decorateClass$c([
7446
7494
  n$6({ attribute: "facets", reflect: false, type: Array })
7447
7495
  ], CxContentBrowserControlBar.prototype, "facets", 2);
7448
- __decorateClass$b([
7496
+ __decorateClass$c([
7449
7497
  n$6({ attribute: "available-facets", reflect: false, type: Array })
7450
7498
  ], CxContentBrowserControlBar.prototype, "availableFacets", 2);
7451
- __decorateClass$b([
7499
+ __decorateClass$c([
7452
7500
  n$6({ attribute: "selected-facets", reflect: false, type: Object })
7453
7501
  ], CxContentBrowserControlBar.prototype, "selectedFacets", 2);
7454
- __decorateClass$b([
7502
+ __decorateClass$c([
7455
7503
  n$6({ attribute: "is-see-through", reflect: true, type: Boolean })
7456
7504
  ], CxContentBrowserControlBar.prototype, "isSeeThrough", 2);
7457
- __decorateClass$b([
7505
+ __decorateClass$c([
7458
7506
  n$6({ attribute: "loading", reflect: true, type: Boolean })
7459
7507
  ], CxContentBrowserControlBar.prototype, "loading", 2);
7460
- __decorateClass$b([
7508
+ __decorateClass$c([
7461
7509
  n$6({ attribute: false, reflect: false, type: Object })
7462
7510
  ], CxContentBrowserControlBar.prototype, "newlyChangedOption", 2);
7463
- __decorateClass$b([
7511
+ __decorateClass$c([
7464
7512
  n$6({ attribute: "search-text", reflect: false, type: String })
7465
7513
  ], CxContentBrowserControlBar.prototype, "searchText", 2);
7466
- __decorateClass$b([
7514
+ __decorateClass$c([
7467
7515
  n$6({ attribute: "is-mobile", reflect: false, type: Boolean })
7468
7516
  ], CxContentBrowserControlBar.prototype, "isMobile", 2);
7469
- CxContentBrowserControlBar = __decorateClass$b([
7517
+ __decorateClass$c([
7518
+ n$6({ attribute: "can-use-table", reflect: true, type: Boolean })
7519
+ ], CxContentBrowserControlBar.prototype, "canUseTable", 2);
7520
+ CxContentBrowserControlBar = __decorateClass$c([
7470
7521
  customElement("cx-content-browser-control-bar")
7471
7522
  ], CxContentBrowserControlBar);
7472
7523
  /**
@@ -7773,14 +7824,14 @@ var Orientation = /* @__PURE__ */ ((Orientation2) => {
7773
7824
  Orientation2["Vertical"] = "vertical";
7774
7825
  return Orientation2;
7775
7826
  })(Orientation || {});
7776
- var __defProp$a = Object.defineProperty;
7777
- var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
7778
- var __decorateClass$a = (decorators, target, key, kind) => {
7779
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$a(target, key) : target;
7827
+ var __defProp$b = Object.defineProperty;
7828
+ var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor;
7829
+ var __decorateClass$b = (decorators, target, key, kind) => {
7830
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(target, key) : target;
7780
7831
  for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
7781
7832
  if (decorator = decorators[i4])
7782
7833
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7783
- if (kind && result) __defProp$a(target, key, result);
7834
+ if (kind && result) __defProp$b(target, key, result);
7784
7835
  return result;
7785
7836
  };
7786
7837
  let CxContentBrowserAssetPreviewVideo = class extends CortexElement {
@@ -7896,40 +7947,40 @@ CxContentBrowserAssetPreviewVideo.dependencies = {
7896
7947
  "cx-typography": CxTypography,
7897
7948
  "cx-video": CxVideo
7898
7949
  };
7899
- __decorateClass$a([
7950
+ __decorateClass$b([
7900
7951
  e$7("cx-video")
7901
7952
  ], CxContentBrowserAssetPreviewVideo.prototype, "videoElement", 2);
7902
- __decorateClass$a([
7953
+ __decorateClass$b([
7903
7954
  e$7("img")
7904
7955
  ], CxContentBrowserAssetPreviewVideo.prototype, "imageElement", 2);
7905
- __decorateClass$a([
7956
+ __decorateClass$b([
7906
7957
  n$6({ attribute: "src", reflect: true, type: String })
7907
7958
  ], CxContentBrowserAssetPreviewVideo.prototype, "src", 2);
7908
- __decorateClass$a([
7959
+ __decorateClass$b([
7909
7960
  n$6({ attribute: "alt", reflect: true, type: String })
7910
7961
  ], CxContentBrowserAssetPreviewVideo.prototype, "alt", 2);
7911
- __decorateClass$a([
7962
+ __decorateClass$b([
7912
7963
  n$6({ attribute: "thumbnail-only", reflect: true, type: Boolean })
7913
7964
  ], CxContentBrowserAssetPreviewVideo.prototype, "thumbnailOnly", 2);
7914
- __decorateClass$a([
7965
+ __decorateClass$b([
7915
7966
  n$6({ attribute: "thumbnail-src", reflect: true, type: String })
7916
7967
  ], CxContentBrowserAssetPreviewVideo.prototype, "thumbnailSrc", 2);
7917
- __decorateClass$a([
7968
+ __decorateClass$b([
7918
7969
  n$6({ reflect: true, type: Boolean })
7919
7970
  ], CxContentBrowserAssetPreviewVideo.prototype, "controls", 2);
7920
- __decorateClass$a([
7971
+ __decorateClass$b([
7921
7972
  n$6({ attribute: "loaded", reflect: true, type: Boolean })
7922
7973
  ], CxContentBrowserAssetPreviewVideo.prototype, "loaded", 2);
7923
- __decorateClass$a([
7974
+ __decorateClass$b([
7924
7975
  r$6()
7925
7976
  ], CxContentBrowserAssetPreviewVideo.prototype, "assetDirection", 2);
7926
- __decorateClass$a([
7977
+ __decorateClass$b([
7927
7978
  r$6()
7928
7979
  ], CxContentBrowserAssetPreviewVideo.prototype, "progress", 2);
7929
- CxContentBrowserAssetPreviewVideo = __decorateClass$a([
7980
+ CxContentBrowserAssetPreviewVideo = __decorateClass$b([
7930
7981
  customElement("cx-content-browser-asset-preview-video")
7931
7982
  ], CxContentBrowserAssetPreviewVideo);
7932
- const styles$9 = i$7`
7983
+ const styles$a = i$7`
7933
7984
  :host {
7934
7985
  display: block;
7935
7986
  position: relative;
@@ -8076,14 +8127,14 @@ const styles$9 = i$7`
8076
8127
  transition: none;
8077
8128
  }
8078
8129
  `;
8079
- var __defProp$9 = Object.defineProperty;
8080
- var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
8081
- var __decorateClass$9 = (decorators, target, key, kind) => {
8082
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target;
8130
+ var __defProp$a = Object.defineProperty;
8131
+ var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
8132
+ var __decorateClass$a = (decorators, target, key, kind) => {
8133
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$a(target, key) : target;
8083
8134
  for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
8084
8135
  if (decorator = decorators[i4])
8085
8136
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8086
- if (kind && result) __defProp$9(target, key, result);
8137
+ if (kind && result) __defProp$a(target, key, result);
8087
8138
  return result;
8088
8139
  };
8089
8140
  const GIF_EXTENSION = ".gif";
@@ -8248,53 +8299,53 @@ let CxContentBrowserAssetPreview = class extends CortexElement {
8248
8299
  `;
8249
8300
  }
8250
8301
  };
8251
- CxContentBrowserAssetPreview.styles = [componentStyles, styles$9];
8302
+ CxContentBrowserAssetPreview.styles = [componentStyles, styles$a];
8252
8303
  CxContentBrowserAssetPreview.dependencies = {
8253
8304
  "cx-content-browser-asset-preview-video": CxContentBrowserAssetPreviewVideo,
8254
8305
  "cx-icon": CxIcon,
8255
8306
  "cx-skeleton": CxSkeleton,
8256
8307
  "cx-typography": CxTypography
8257
8308
  };
8258
- __decorateClass$9([
8309
+ __decorateClass$a([
8259
8310
  e$7("cx-content-browser-asset-preview-video")
8260
8311
  ], CxContentBrowserAssetPreview.prototype, "previewVideo", 2);
8261
- __decorateClass$9([
8312
+ __decorateClass$a([
8262
8313
  n$6({ attribute: "image-url", reflect: true, type: String })
8263
8314
  ], CxContentBrowserAssetPreview.prototype, "imageUrl", 2);
8264
- __decorateClass$9([
8315
+ __decorateClass$a([
8265
8316
  n$6({ attribute: "original-url", reflect: true, type: String })
8266
8317
  ], CxContentBrowserAssetPreview.prototype, "originalUrl", 2);
8267
- __decorateClass$9([
8318
+ __decorateClass$a([
8268
8319
  n$6({ attribute: "preview-url", reflect: true, type: String })
8269
8320
  ], CxContentBrowserAssetPreview.prototype, "previewUrl", 2);
8270
- __decorateClass$9([
8321
+ __decorateClass$a([
8271
8322
  n$6({ attribute: "alt", reflect: true, type: String })
8272
8323
  ], CxContentBrowserAssetPreview.prototype, "alt", 2);
8273
- __decorateClass$9([
8324
+ __decorateClass$a([
8274
8325
  n$6({ attribute: "doc-type", reflect: true, type: String })
8275
8326
  ], CxContentBrowserAssetPreview.prototype, "docType", 2);
8276
- __decorateClass$9([
8327
+ __decorateClass$a([
8277
8328
  n$6({ attribute: "extension", reflect: true, type: String })
8278
8329
  ], CxContentBrowserAssetPreview.prototype, "extension", 2);
8279
- __decorateClass$9([
8330
+ __decorateClass$a([
8280
8331
  n$6({ attribute: "in-cold-storage", reflect: true, type: Boolean })
8281
8332
  ], CxContentBrowserAssetPreview.prototype, "inColdStorage", 2);
8282
- __decorateClass$9([
8333
+ __decorateClass$a([
8283
8334
  n$6({ attribute: "thumbnail-only", reflect: true, type: Boolean })
8284
8335
  ], CxContentBrowserAssetPreview.prototype, "thumbnailOnly", 2);
8285
- __decorateClass$9([
8336
+ __decorateClass$a([
8286
8337
  n$6({ attribute: "controls", reflect: true, type: Boolean })
8287
8338
  ], CxContentBrowserAssetPreview.prototype, "controls", 2);
8288
- __decorateClass$9([
8339
+ __decorateClass$a([
8289
8340
  r$6()
8290
8341
  ], CxContentBrowserAssetPreview.prototype, "isError", 2);
8291
- __decorateClass$9([
8342
+ __decorateClass$a([
8292
8343
  r$6()
8293
8344
  ], CxContentBrowserAssetPreview.prototype, "loaded", 2);
8294
- CxContentBrowserAssetPreview = __decorateClass$9([
8345
+ CxContentBrowserAssetPreview = __decorateClass$a([
8295
8346
  customElement("cx-content-browser-asset-preview")
8296
8347
  ], CxContentBrowserAssetPreview);
8297
- const styles$8 = i$7`
8348
+ const styles$9 = i$7`
8298
8349
  :host {
8299
8350
  display: block;
8300
8351
  padding: var(--cx-spacing-small);
@@ -8304,14 +8355,14 @@ const styles$8 = i$7`
8304
8355
  width: 100%;
8305
8356
  }
8306
8357
  `;
8307
- var __defProp$8 = Object.defineProperty;
8308
- var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
8309
- var __decorateClass$8 = (decorators, target, key, kind) => {
8310
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target;
8358
+ var __defProp$9 = Object.defineProperty;
8359
+ var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
8360
+ var __decorateClass$9 = (decorators, target, key, kind) => {
8361
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target;
8311
8362
  for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
8312
8363
  if (decorator = decorators[i4])
8313
8364
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8314
- if (kind && result) __defProp$8(target, key, result);
8365
+ if (kind && result) __defProp$9(target, key, result);
8315
8366
  return result;
8316
8367
  };
8317
8368
  let CxContentBrowserAssetTrackingParameters = class extends CortexElement {
@@ -8420,7 +8471,7 @@ let CxContentBrowserAssetTrackingParameters = class extends CortexElement {
8420
8471
  `;
8421
8472
  }
8422
8473
  };
8423
- CxContentBrowserAssetTrackingParameters.styles = [componentStyles, styles$8];
8474
+ CxContentBrowserAssetTrackingParameters.styles = [componentStyles, styles$9];
8424
8475
  CxContentBrowserAssetTrackingParameters.dependencies = {
8425
8476
  "cx-button": CxButton,
8426
8477
  "cx-icon": CxIcon,
@@ -8429,13 +8480,13 @@ CxContentBrowserAssetTrackingParameters.dependencies = {
8429
8480
  "cx-input-group": CxInputGroup,
8430
8481
  "cx-space": CxSpace
8431
8482
  };
8432
- __decorateClass$8([
8483
+ __decorateClass$9([
8433
8484
  n$6({ attribute: false, type: Array })
8434
8485
  ], CxContentBrowserAssetTrackingParameters.prototype, "values", 2);
8435
- CxContentBrowserAssetTrackingParameters = __decorateClass$8([
8486
+ CxContentBrowserAssetTrackingParameters = __decorateClass$9([
8436
8487
  customElement("cx-content-browser-asset-tracking-parameters")
8437
8488
  ], CxContentBrowserAssetTrackingParameters);
8438
- const styles$7 = i$7`
8489
+ const styles$8 = i$7`
8439
8490
  :host {
8440
8491
  display: block;
8441
8492
  }
@@ -8544,14 +8595,14 @@ const styles$7 = i$7`
8544
8595
  color: var(--cx-color-primary);
8545
8596
  }
8546
8597
  `;
8547
- var __defProp$7 = Object.defineProperty;
8548
- var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
8549
- var __decorateClass$7 = (decorators, target, key, kind) => {
8550
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target;
8598
+ var __defProp$8 = Object.defineProperty;
8599
+ var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
8600
+ var __decorateClass$8 = (decorators, target, key, kind) => {
8601
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target;
8551
8602
  for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
8552
8603
  if (decorator = decorators[i4])
8553
8604
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8554
- if (kind && result) __defProp$7(target, key, result);
8605
+ if (kind && result) __defProp$8(target, key, result);
8555
8606
  return result;
8556
8607
  };
8557
8608
  const USE_REPRESENTATIVE_VALUE = "use-representative";
@@ -8801,7 +8852,7 @@ let CxContentBrowserAssetProxySelector = class extends CortexElement {
8801
8852
  `;
8802
8853
  }
8803
8854
  };
8804
- CxContentBrowserAssetProxySelector.styles = [componentStyles, styles$7];
8855
+ CxContentBrowserAssetProxySelector.styles = [componentStyles, styles$8];
8805
8856
  CxContentBrowserAssetProxySelector.dependencies = {
8806
8857
  "cx-content-browser-asset-tracking-parameters": CxContentBrowserAssetTrackingParameters,
8807
8858
  "cx-icon": CxIcon,
@@ -8811,46 +8862,46 @@ CxContentBrowserAssetProxySelector.dependencies = {
8811
8862
  "cx-switch": CxSwitch,
8812
8863
  "cx-typography": CxTypography
8813
8864
  };
8814
- __decorateClass$7([
8865
+ __decorateClass$8([
8815
8866
  n$6({ reflect: false, type: Array })
8816
8867
  ], CxContentBrowserAssetProxySelector.prototype, "items", 2);
8817
- __decorateClass$7([
8868
+ __decorateClass$8([
8818
8869
  n$6({ attribute: "can-custom-format", reflect: true, type: Boolean })
8819
8870
  ], CxContentBrowserAssetProxySelector.prototype, "canCustomFormat", 2);
8820
- __decorateClass$7([
8871
+ __decorateClass$8([
8821
8872
  n$6({ attribute: "can-use-representative", reflect: true, type: Boolean })
8822
8873
  ], CxContentBrowserAssetProxySelector.prototype, "canUseRepresentative", 2);
8823
- __decorateClass$7([
8874
+ __decorateClass$8([
8824
8875
  n$6({ attribute: "can-use-ats", reflect: true, type: Boolean })
8825
8876
  ], CxContentBrowserAssetProxySelector.prototype, "canUseATS", 2);
8826
- __decorateClass$7([
8877
+ __decorateClass$8([
8827
8878
  n$6({ attribute: "can-use-tracking", reflect: true, type: Boolean })
8828
8879
  ], CxContentBrowserAssetProxySelector.prototype, "canUseTracking", 2);
8829
- __decorateClass$7([
8880
+ __decorateClass$8([
8830
8881
  n$6({ attribute: "selected", reflect: true, type: String })
8831
8882
  ], CxContentBrowserAssetProxySelector.prototype, "selected", 2);
8832
- __decorateClass$7([
8883
+ __decorateClass$8([
8833
8884
  n$6({ attribute: "disabled-selected", reflect: true, type: Boolean })
8834
8885
  ], CxContentBrowserAssetProxySelector.prototype, "disabledSelected", 2);
8835
- __decorateClass$7([
8886
+ __decorateClass$8([
8836
8887
  n$6({ attribute: "custom-width", reflect: true, type: String })
8837
8888
  ], CxContentBrowserAssetProxySelector.prototype, "customWidth", 2);
8838
- __decorateClass$7([
8889
+ __decorateClass$8([
8839
8890
  n$6({ attribute: "custom-height", reflect: true, type: String })
8840
8891
  ], CxContentBrowserAssetProxySelector.prototype, "customHeight", 2);
8841
- __decorateClass$7([
8892
+ __decorateClass$8([
8842
8893
  n$6({ attribute: "custom-extension", reflect: true, type: String })
8843
8894
  ], CxContentBrowserAssetProxySelector.prototype, "customExtension", 2);
8844
- __decorateClass$7([
8895
+ __decorateClass$8([
8845
8896
  n$6({ attribute: "enabled-tracking", reflect: true, type: Boolean })
8846
8897
  ], CxContentBrowserAssetProxySelector.prototype, "enabledTracking", 2);
8847
- __decorateClass$7([
8898
+ __decorateClass$8([
8848
8899
  n$6({ attribute: "tracking-parameters", reflect: false, type: Array })
8849
8900
  ], CxContentBrowserAssetProxySelector.prototype, "trackingParameters", 2);
8850
- CxContentBrowserAssetProxySelector = __decorateClass$7([
8901
+ CxContentBrowserAssetProxySelector = __decorateClass$8([
8851
8902
  customElement("cx-content-browser-asset-proxy-selector")
8852
8903
  ], CxContentBrowserAssetProxySelector);
8853
- const styles$6 = i$7`
8904
+ const styles$7 = i$7`
8854
8905
  :host {
8855
8906
  display: block;
8856
8907
  width: 100%;
@@ -8923,14 +8974,14 @@ const styles$6 = i$7`
8923
8974
  font-size: var(--cx-font-size-3x-large);
8924
8975
  }
8925
8976
  `;
8926
- var __defProp$6 = Object.defineProperty;
8927
- var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
8928
- var __decorateClass$6 = (decorators, target, key, kind) => {
8929
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
8977
+ var __defProp$7 = Object.defineProperty;
8978
+ var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
8979
+ var __decorateClass$7 = (decorators, target, key, kind) => {
8980
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target;
8930
8981
  for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
8931
8982
  if (decorator = decorators[i4])
8932
8983
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8933
- if (kind && result) __defProp$6(target, key, result);
8984
+ if (kind && result) __defProp$7(target, key, result);
8934
8985
  return result;
8935
8986
  };
8936
8987
  let CxContentBrowserAssetVersionHistory = class extends CortexElement {
@@ -9002,7 +9053,7 @@ let CxContentBrowserAssetVersionHistory = class extends CortexElement {
9002
9053
  `;
9003
9054
  }
9004
9055
  };
9005
- CxContentBrowserAssetVersionHistory.styles = [componentStyles, styles$6];
9056
+ CxContentBrowserAssetVersionHistory.styles = [componentStyles, styles$7];
9006
9057
  CxContentBrowserAssetVersionHistory.dependencies = {
9007
9058
  "cx-grid": CxGrid,
9008
9059
  "cx-grid-item": CxGridItem,
@@ -9014,13 +9065,13 @@ CxContentBrowserAssetVersionHistory.dependencies = {
9014
9065
  "cx-typography": CxTypography,
9015
9066
  "cx-content-browser-asset-preview": CxContentBrowserAssetPreview
9016
9067
  };
9017
- __decorateClass$6([
9068
+ __decorateClass$7([
9018
9069
  n$6({ reflect: false, type: Array })
9019
9070
  ], CxContentBrowserAssetVersionHistory.prototype, "versions", 2);
9020
- __decorateClass$6([
9071
+ __decorateClass$7([
9021
9072
  n$6({ reflect: true, type: Boolean })
9022
9073
  ], CxContentBrowserAssetVersionHistory.prototype, "loading", 2);
9023
- CxContentBrowserAssetVersionHistory = __decorateClass$6([
9074
+ CxContentBrowserAssetVersionHistory = __decorateClass$7([
9024
9075
  customElement("cx-content-browser-asset-version-history")
9025
9076
  ], CxContentBrowserAssetVersionHistory);
9026
9077
  const dialogStyles = i$7`
@@ -9071,7 +9122,7 @@ const drawerStyles = i$7`
9071
9122
  padding: var(--cx-spacing-medium);
9072
9123
  }
9073
9124
  `;
9074
- const styles$5 = i$7`
9125
+ const styles$6 = i$7`
9075
9126
  :host {
9076
9127
  display: block;
9077
9128
  }
@@ -9111,14 +9162,14 @@ const styles$5 = i$7`
9111
9162
  width: 100%;
9112
9163
  }
9113
9164
  `;
9114
- var __defProp$5 = Object.defineProperty;
9115
- var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
9116
- var __decorateClass$5 = (decorators, target, key, kind) => {
9117
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target;
9165
+ var __defProp$6 = Object.defineProperty;
9166
+ var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
9167
+ var __decorateClass$6 = (decorators, target, key, kind) => {
9168
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
9118
9169
  for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
9119
9170
  if (decorator = decorators[i4])
9120
9171
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
9121
- if (kind && result) __defProp$5(target, key, result);
9172
+ if (kind && result) __defProp$6(target, key, result);
9122
9173
  return result;
9123
9174
  };
9124
9175
  const DEFAULT_TRACKING_PARAMETERS = [{
@@ -9160,6 +9211,7 @@ let CxContentBrowserFormatDialog = class extends CortexElement {
9160
9211
  this.canPinAsset = false;
9161
9212
  this.canTrack = false;
9162
9213
  this.canUseProxies = false;
9214
+ this.autoSelectFormat = false;
9163
9215
  this.simplePick = false;
9164
9216
  this.canViewVersions = false;
9165
9217
  this.variant = ContentBrowserFormatDialogVariant.Dialog;
@@ -9200,33 +9252,96 @@ let CxContentBrowserFormatDialog = class extends CortexElement {
9200
9252
  ], "value") : [{ displayName: this.localize.term("automatic"), value: this.autoExtension }]).filter((item) => this.shouldAppendAutoExtension || item.value !== this.autoExtension);
9201
9253
  return this.canCustomFormat && extensionList.some((item) => item.value === this.asset.extension);
9202
9254
  }
9203
- handleSupportedExtensionsChange() {
9204
- var _a2, _b2;
9205
- this.filteredProxies = this.proxies.filter((item) => {
9206
- var _a3, _b3, _c2;
9207
- const assetExtension = (_c2 = (_b3 = (_a3 = this.asset) == null ? void 0 : _a3.extension) == null ? void 0 : _b3.replace(/^\./, "")) != null ? _c2 : "";
9255
+ filterProxies(proxies) {
9256
+ return proxies.filter((item) => {
9257
+ var _a2, _b2, _c2;
9258
+ const assetExtension = (_c2 = (_b2 = (_a2 = this.asset) == null ? void 0 : _a2.extension) == null ? void 0 : _b2.replace(/^\./, "")) != null ? _c2 : "";
9208
9259
  if (!item.extension && this.asset && assetExtension) {
9209
9260
  return this.supportedExtensions.includes(assetExtension);
9210
9261
  }
9211
9262
  return true;
9212
9263
  });
9264
+ }
9265
+ handleSupportedExtensionsChange() {
9266
+ var _a2, _b2;
9267
+ this.filteredProxies = this.filterProxies(this.proxies);
9213
9268
  this.selectedProxy = (_b2 = (_a2 = this.filteredProxies[0]) == null ? void 0 : _a2.id) != null ? _b2 : "";
9214
9269
  }
9270
+ /**
9271
+ * What `autoSelectFormat` resolves to for this asset: the proxy to insert with, or `undefined`
9272
+ * when the dialog should open as usual.
9273
+ *
9274
+ * `{ proxy: undefined }` is deliberate rather than a miss — with the picker switched off there is
9275
+ * no format to name and the original file is the only outcome, which is `handleProxyConfirm`'s
9276
+ * no-proxy branch. With the picker on a proxy must actually resolve: confirming none emits
9277
+ * nothing and would turn the click into a silent no-op, so both an empty proxy list and a format
9278
+ * name that matches nothing fall back to the dialog.
9279
+ */
9280
+ resolveAutoSelection() {
9281
+ const requested = this.autoSelectFormat;
9282
+ if (!isAutoSelectFormatActive(requested)) {
9283
+ return void 0;
9284
+ }
9285
+ if (!this.canUseProxies) {
9286
+ return { proxy: void 0 };
9287
+ }
9288
+ if (requested === true) {
9289
+ const [first] = this.filteredProxies;
9290
+ return first ? { proxy: first } : void 0;
9291
+ }
9292
+ const wanted = String(requested).trim().toLowerCase();
9293
+ const match2 = this.filteredProxies.find((proxy) => {
9294
+ var _a2, _b2;
9295
+ return ((_a2 = proxy.proxyName) == null ? void 0 : _a2.toLowerCase()) === wanted || ((_b2 = proxy.proxyLabel) == null ? void 0 : _b2.toLowerCase()) === wanted;
9296
+ });
9297
+ return match2 ? { proxy: match2 } : void 0;
9298
+ }
9215
9299
  open({
9216
9300
  asset,
9217
9301
  isFavorite,
9218
9302
  isAssetPinned = false,
9219
9303
  proxies
9220
9304
  }) {
9305
+ var _a2, _b2;
9221
9306
  this.asset = asset;
9222
9307
  this.isFavorite = isFavorite;
9223
9308
  this.isAssetPinned = isAssetPinned;
9224
9309
  this.proxies = proxies;
9310
+ this.filteredProxies = this.filterProxies(this.proxies);
9311
+ this.selectedProxy = (_b2 = (_a2 = this.filteredProxies[0]) == null ? void 0 : _a2.id) != null ? _b2 : "";
9312
+ const autoSelection = this.disabledConfirm ? void 0 : this.resolveAutoSelection();
9313
+ if (autoSelection) {
9314
+ if (autoSelection.proxy) {
9315
+ this.selectedProxy = autoSelection.proxy.id;
9316
+ }
9317
+ if (!this.loadingConfirm) {
9318
+ this.handleProxyConfirm();
9319
+ }
9320
+ return;
9321
+ }
9322
+ this.loadingConfirm = false;
9225
9323
  this.isOpen = true;
9226
9324
  }
9227
9325
  hide() {
9228
9326
  this.handleClose();
9229
9327
  }
9328
+ /**
9329
+ * Show a dialog that `open()` skipped through the auto-confirm shortcut. The asset, proxies and
9330
+ * resolved selection are still in place, so this lands the user on exactly the dialog the
9331
+ * shortcut spared them, with its confirm button live again to retry.
9332
+ */
9333
+ revealAfterAutoConfirm() {
9334
+ if (!this.asset) {
9335
+ this.handleClose();
9336
+ return;
9337
+ }
9338
+ this.loadingConfirm = false;
9339
+ this.isOpen = true;
9340
+ }
9341
+ /** Whether the dialog is actually on screen — false when `open()` took the auto-confirm path. */
9342
+ get isDialogOpen() {
9343
+ return this.isOpen;
9344
+ }
9230
9345
  setVersionHistory(versions) {
9231
9346
  this.versions = versions;
9232
9347
  this.loadingVersionHistory = false;
@@ -9710,7 +9825,7 @@ let CxContentBrowserFormatDialog = class extends CortexElement {
9710
9825
  <cx-button
9711
9826
  class="content-browser-format__footer__button"
9712
9827
  variant="primary"
9713
- ?loading=${this.loadingProxies}
9828
+ ?loading=${this.loadingConfirm || this.loadingProxies}
9714
9829
  @click=${this.handleProxyConfirm}
9715
9830
  >
9716
9831
  <cx-icon slot="prefix" name="folder"></cx-icon>
@@ -9775,7 +9890,7 @@ let CxContentBrowserFormatDialog = class extends CortexElement {
9775
9890
  `;
9776
9891
  }
9777
9892
  handleRequestClose(event) {
9778
- if (this.loadingFavorites || this.loadingPinAsset) {
9893
+ if (this.loadingConfirm || this.loadingFavorites || this.loadingPinAsset) {
9779
9894
  event.preventDefault();
9780
9895
  return;
9781
9896
  }
@@ -9836,7 +9951,7 @@ let CxContentBrowserFormatDialog = class extends CortexElement {
9836
9951
  `;
9837
9952
  }
9838
9953
  };
9839
- CxContentBrowserFormatDialog.styles = [componentStyles, styles$5];
9954
+ CxContentBrowserFormatDialog.styles = [componentStyles, styles$6];
9840
9955
  CxContentBrowserFormatDialog.dependencies = {
9841
9956
  "cx-asset-link-format": CxAssetLinkFormat,
9842
9957
  "cx-cropper": CxCropper,
@@ -9852,16 +9967,16 @@ CxContentBrowserFormatDialog.dependencies = {
9852
9967
  "cx-tooltip": CxTooltip,
9853
9968
  "cx-typography": CxTypography
9854
9969
  };
9855
- __decorateClass$5([
9970
+ __decorateClass$6([
9856
9971
  e$7("cx-asset-link-format")
9857
9972
  ], CxContentBrowserFormatDialog.prototype, "assetLinkFormat", 2);
9858
- __decorateClass$5([
9973
+ __decorateClass$6([
9859
9974
  n$6({ reflect: false, type: Object })
9860
9975
  ], CxContentBrowserFormatDialog.prototype, "boundary", 2);
9861
- __decorateClass$5([
9976
+ __decorateClass$6([
9862
9977
  n$6({ attribute: false, reflect: false, type: Object })
9863
9978
  ], CxContentBrowserFormatDialog.prototype, "availableExtensions", 2);
9864
- __decorateClass$5([
9979
+ __decorateClass$6([
9865
9980
  n$6({
9866
9981
  attribute: "supported-extensions",
9867
9982
  converter: {
@@ -9872,7 +9987,7 @@ __decorateClass$5([
9872
9987
  type: Array
9873
9988
  })
9874
9989
  ], CxContentBrowserFormatDialog.prototype, "supportedExtensions", 2);
9875
- __decorateClass$5([
9990
+ __decorateClass$6([
9876
9991
  n$6({
9877
9992
  attribute: "supported-representative-subtypes",
9878
9993
  converter: {
@@ -9883,113 +9998,116 @@ __decorateClass$5([
9883
9998
  type: Array
9884
9999
  })
9885
10000
  ], CxContentBrowserFormatDialog.prototype, "supportedRepresentativeSubtypes", 2);
9886
- __decorateClass$5([
10001
+ __decorateClass$6([
9887
10002
  n$6({ attribute: "auto-extension", reflect: false, type: String })
9888
10003
  ], CxContentBrowserFormatDialog.prototype, "autoExtension", 2);
9889
- __decorateClass$5([
10004
+ __decorateClass$6([
9890
10005
  n$6({ attribute: "cta-text", reflect: false, type: String })
9891
10006
  ], CxContentBrowserFormatDialog.prototype, "ctaText", 2);
9892
- __decorateClass$5([
10007
+ __decorateClass$6([
9893
10008
  n$6({ attribute: "cta-text-transform", reflect: false, type: String })
9894
10009
  ], CxContentBrowserFormatDialog.prototype, "ctaTextTransform", 2);
9895
- __decorateClass$5([
10010
+ __decorateClass$6([
9896
10011
  n$6({ attribute: "can-custom-format", reflect: false, type: Boolean })
9897
10012
  ], CxContentBrowserFormatDialog.prototype, "canCustomFormat", 2);
9898
- __decorateClass$5([
10013
+ __decorateClass$6([
9899
10014
  n$6({ attribute: "can-favorite", reflect: false, type: Boolean })
9900
10015
  ], CxContentBrowserFormatDialog.prototype, "canFavorite", 2);
9901
- __decorateClass$5([
10016
+ __decorateClass$6([
9902
10017
  n$6({ attribute: "can-pin-asset", reflect: false, type: Boolean })
9903
10018
  ], CxContentBrowserFormatDialog.prototype, "canPinAsset", 2);
9904
- __decorateClass$5([
10019
+ __decorateClass$6([
9905
10020
  n$6({ attribute: "can-track", reflect: false, type: Boolean })
9906
10021
  ], CxContentBrowserFormatDialog.prototype, "canTrack", 2);
9907
- __decorateClass$5([
10022
+ __decorateClass$6([
9908
10023
  n$6({ attribute: "can-use-proxies", reflect: false, type: Boolean })
9909
10024
  ], CxContentBrowserFormatDialog.prototype, "canUseProxies", 2);
9910
- __decorateClass$5([
10025
+ __decorateClass$6([
10026
+ n$6({ attribute: "auto-select-format", converter: autoSelectFormatConverter, reflect: false })
10027
+ ], CxContentBrowserFormatDialog.prototype, "autoSelectFormat", 2);
10028
+ __decorateClass$6([
9911
10029
  n$6({ attribute: "simple-pick", reflect: false, type: Boolean })
9912
10030
  ], CxContentBrowserFormatDialog.prototype, "simplePick", 2);
9913
- __decorateClass$5([
10031
+ __decorateClass$6([
9914
10032
  n$6({ attribute: "can-view-versions", reflect: false, type: Boolean })
9915
10033
  ], CxContentBrowserFormatDialog.prototype, "canViewVersions", 2);
9916
- __decorateClass$5([
10034
+ __decorateClass$6([
9917
10035
  n$6({ reflect: true, type: String })
9918
10036
  ], CxContentBrowserFormatDialog.prototype, "variant", 2);
9919
- __decorateClass$5([
10037
+ __decorateClass$6([
9920
10038
  n$6({ attribute: "loading-favorites", reflect: true, type: Boolean })
9921
10039
  ], CxContentBrowserFormatDialog.prototype, "loadingFavorites", 2);
9922
- __decorateClass$5([
10040
+ __decorateClass$6([
9923
10041
  n$6({ attribute: "loading-pin-asset", reflect: true, type: Boolean })
9924
10042
  ], CxContentBrowserFormatDialog.prototype, "loadingPinAsset", 2);
9925
- __decorateClass$5([
10043
+ __decorateClass$6([
9926
10044
  n$6({ attribute: "loading-proxies", reflect: true, type: Boolean })
9927
10045
  ], CxContentBrowserFormatDialog.prototype, "loadingProxies", 2);
9928
- __decorateClass$5([
10046
+ __decorateClass$6([
9929
10047
  n$6({ attribute: "disabled-confirm", reflect: true, type: Boolean })
9930
10048
  ], CxContentBrowserFormatDialog.prototype, "disabledConfirm", 2);
9931
- __decorateClass$5([
10049
+ __decorateClass$6([
9932
10050
  n$6({ attribute: "token", type: String })
9933
10051
  ], CxContentBrowserFormatDialog.prototype, "token", 2);
9934
- __decorateClass$5([
10052
+ __decorateClass$6([
9935
10053
  n$6({ attribute: "base-url", type: String })
9936
10054
  ], CxContentBrowserFormatDialog.prototype, "baseUrl", 2);
9937
- __decorateClass$5([
10055
+ __decorateClass$6([
9938
10056
  r$6()
9939
10057
  ], CxContentBrowserFormatDialog.prototype, "asset", 2);
9940
- __decorateClass$5([
10058
+ __decorateClass$6([
9941
10059
  r$6()
9942
10060
  ], CxContentBrowserFormatDialog.prototype, "isOpen", 2);
9943
- __decorateClass$5([
10061
+ __decorateClass$6([
9944
10062
  r$6()
9945
10063
  ], CxContentBrowserFormatDialog.prototype, "isFavorite", 2);
9946
- __decorateClass$5([
10064
+ __decorateClass$6([
9947
10065
  r$6()
9948
10066
  ], CxContentBrowserFormatDialog.prototype, "isAssetPinned", 2);
9949
- __decorateClass$5([
10067
+ __decorateClass$6([
9950
10068
  r$6()
9951
10069
  ], CxContentBrowserFormatDialog.prototype, "proxies", 2);
9952
- __decorateClass$5([
10070
+ __decorateClass$6([
9953
10071
  r$6()
9954
10072
  ], CxContentBrowserFormatDialog.prototype, "showVersionHistory", 2);
9955
- __decorateClass$5([
10073
+ __decorateClass$6([
9956
10074
  r$6()
9957
10075
  ], CxContentBrowserFormatDialog.prototype, "showCustomFormat", 2);
9958
- __decorateClass$5([
10076
+ __decorateClass$6([
9959
10077
  r$6()
9960
10078
  ], CxContentBrowserFormatDialog.prototype, "loadingVersionHistory", 2);
9961
- __decorateClass$5([
10079
+ __decorateClass$6([
9962
10080
  r$6()
9963
10081
  ], CxContentBrowserFormatDialog.prototype, "versions", 2);
9964
- __decorateClass$5([
10082
+ __decorateClass$6([
9965
10083
  r$6()
9966
10084
  ], CxContentBrowserFormatDialog.prototype, "filteredProxies", 2);
9967
- __decorateClass$5([
10085
+ __decorateClass$6([
9968
10086
  r$6()
9969
10087
  ], CxContentBrowserFormatDialog.prototype, "selectedProxy", 2);
9970
- __decorateClass$5([
10088
+ __decorateClass$6([
9971
10089
  r$6()
9972
10090
  ], CxContentBrowserFormatDialog.prototype, "lastProxyBeforeCustomFormat", 2);
9973
- __decorateClass$5([
10091
+ __decorateClass$6([
9974
10092
  r$6()
9975
10093
  ], CxContentBrowserFormatDialog.prototype, "confirmedTransformations", 2);
9976
- __decorateClass$5([
10094
+ __decorateClass$6([
9977
10095
  r$6()
9978
10096
  ], CxContentBrowserFormatDialog.prototype, "confirmedFormat", 2);
9979
- __decorateClass$5([
10097
+ __decorateClass$6([
9980
10098
  r$6()
9981
10099
  ], CxContentBrowserFormatDialog.prototype, "loadingConfirm", 2);
9982
- __decorateClass$5([
10100
+ __decorateClass$6([
9983
10101
  r$6()
9984
10102
  ], CxContentBrowserFormatDialog.prototype, "enabledTracking", 2);
9985
- __decorateClass$5([
10103
+ __decorateClass$6([
9986
10104
  r$6()
9987
10105
  ], CxContentBrowserFormatDialog.prototype, "trackingParameters", 2);
9988
- __decorateClass$5([
10106
+ __decorateClass$6([
9989
10107
  watch("proxies", { waitUntilFirstUpdate: true }),
9990
10108
  watch("supportedExtensions")
9991
10109
  ], CxContentBrowserFormatDialog.prototype, "handleSupportedExtensionsChange", 1);
9992
- CxContentBrowserFormatDialog = __decorateClass$5([
10110
+ CxContentBrowserFormatDialog = __decorateClass$6([
9993
10111
  customElement("cx-content-browser-format-dialog")
9994
10112
  ], CxContentBrowserFormatDialog);
9995
10113
  function __decorate(decorators, target, key, desc) {
@@ -11788,7 +11906,7 @@ class GridLayout extends GridBaseLayout {
11788
11906
  this._scrollSize = size;
11789
11907
  }
11790
11908
  }
11791
- const styles$4 = i$7`
11909
+ const styles$5 = i$7`
11792
11910
  :host {
11793
11911
  display: block;
11794
11912
  }
@@ -11824,6 +11942,44 @@ const styles$4 = i$7`
11824
11942
  line-height: var(--cx-line-height-small);
11825
11943
  }
11826
11944
 
11945
+ /*
11946
+ * Affordance only, never a second control: pointer-events stay off so the click lands on the card
11947
+ * beneath and takes the one path a card click already takes, and the button is aria-hidden and
11948
+ * untabbable so the card is still the single thing announced and focused.
11949
+ */
11950
+ .content-browser-asset-card__cta {
11951
+ /*
11952
+ * Positioned against the card's base, not the image slot, so the image box has to be described
11953
+ * here: inset by the card's own padding and given the same aspect-ratio ::part(image) carries,
11954
+ * which lands it exactly on the thumbnail. Without this it covers the title row too and centres
11955
+ * the button on the card rather than on the image. Keep the ratio in step with ::part(image).
11956
+ */
11957
+ position: absolute;
11958
+ inset: var(--cx-spacing-x-small);
11959
+ bottom: auto;
11960
+ aspect-ratio: 246 / 180;
11961
+ z-index: 1;
11962
+ display: flex;
11963
+ align-items: center;
11964
+ justify-content: center;
11965
+ background-color: rgb(0 0 0 / 35%);
11966
+ opacity: 0;
11967
+ pointer-events: none;
11968
+ transition: opacity 150ms ease;
11969
+ }
11970
+
11971
+ .content-browser-asset-card:hover .content-browser-asset-card__cta,
11972
+ .content-browser-asset-card:focus-within .content-browser-asset-card__cta,
11973
+ .content-browser-asset-card__cta--busy {
11974
+ opacity: 1;
11975
+ }
11976
+
11977
+ @media (prefers-reduced-motion: reduce) {
11978
+ .content-browser-asset-card__cta {
11979
+ transition: none;
11980
+ }
11981
+ }
11982
+
11827
11983
  .content-browser-asset-card__checkbox {
11828
11984
  position: absolute;
11829
11985
  top: 2px;
@@ -11836,19 +11992,24 @@ const styles$4 = i$7`
11836
11992
  pointer-events: none;
11837
11993
  }
11838
11994
  `;
11839
- var __defProp$4 = Object.defineProperty;
11840
- var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
11841
- var __decorateClass$4 = (decorators, target, key, kind) => {
11842
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target;
11995
+ var __defProp$5 = Object.defineProperty;
11996
+ var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
11997
+ var __decorateClass$5 = (decorators, target, key, kind) => {
11998
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target;
11843
11999
  for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
11844
12000
  if (decorator = decorators[i4])
11845
12001
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
11846
- if (kind && result) __defProp$4(target, key, result);
12002
+ if (kind && result) __defProp$5(target, key, result);
11847
12003
  return result;
11848
12004
  };
11849
12005
  let CxContentBrowserAssetCard = class extends CortexElement {
11850
12006
  constructor() {
11851
12007
  super(...arguments);
12008
+ this.localize = new LocalizeController(this);
12009
+ this.showCta = false;
12010
+ this.ctaText = "";
12011
+ this.ctaTextTransform = "capitalize";
12012
+ this.busy = false;
11852
12013
  this.imageUrl = "";
11853
12014
  this.originalUrl = "";
11854
12015
  this.scrubUrl = "";
@@ -11916,6 +12077,26 @@ let CxContentBrowserAssetCard = class extends CortexElement {
11916
12077
  ?thumbnail-only=${this.view === "small"}
11917
12078
  ?in-cold-storage=${this.inColdStorage}
11918
12079
  ></cx-content-browser-asset-preview>
12080
+ ${n$5(
12081
+ this.showCta && !this.inColdStorage,
12082
+ () => b`
12083
+ <div
12084
+ slot="image"
12085
+ class=${e$5({
12086
+ "content-browser-asset-card__cta": true,
12087
+ "content-browser-asset-card__cta--busy": this.busy
12088
+ })}
12089
+ aria-hidden="true"
12090
+ >
12091
+ <cx-button size="small" variant="primary" tabindex="-1" ?loading=${this.busy}>
12092
+ <span style=${o$2({ textTransform: this.ctaTextTransform })}>
12093
+ ${this.ctaText || this.localize.term("insert")}
12094
+ </span>
12095
+ </cx-button>
12096
+ </div>
12097
+ `,
12098
+ () => A$1
12099
+ )}
11919
12100
  <cx-space spacing="small" align-items="center" wrap="nowrap" class="content-browser-asset-card__info">
11920
12101
  ${n$5(
11921
12102
  this.showTitle && this.assetName,
@@ -12026,9 +12207,10 @@ let CxContentBrowserAssetCard = class extends CortexElement {
12026
12207
  `;
12027
12208
  }
12028
12209
  };
12029
- CxContentBrowserAssetCard.styles = [componentStyles, styles$4];
12210
+ CxContentBrowserAssetCard.styles = [componentStyles, styles$5];
12030
12211
  CxContentBrowserAssetCard.dependencies = {
12031
12212
  "cx-array-line-clamp": CxArrayLineClamp,
12213
+ "cx-button": CxButton,
12032
12214
  "cx-card": CxCard,
12033
12215
  "cx-checkbox": CxCheckbox,
12034
12216
  "cx-content-browser-asset-preview": CxContentBrowserAssetPreview,
@@ -12037,46 +12219,58 @@ CxContentBrowserAssetCard.dependencies = {
12037
12219
  "cx-tag": CxTag,
12038
12220
  "cx-typography": CxTypography
12039
12221
  };
12040
- __decorateClass$4([
12222
+ __decorateClass$5([
12223
+ n$6({ attribute: "show-cta", reflect: true, type: Boolean })
12224
+ ], CxContentBrowserAssetCard.prototype, "showCta", 2);
12225
+ __decorateClass$5([
12226
+ n$6({ attribute: "cta-text", reflect: false, type: String })
12227
+ ], CxContentBrowserAssetCard.prototype, "ctaText", 2);
12228
+ __decorateClass$5([
12229
+ n$6({ attribute: "cta-text-transform", reflect: false, type: String })
12230
+ ], CxContentBrowserAssetCard.prototype, "ctaTextTransform", 2);
12231
+ __decorateClass$5([
12232
+ n$6({ attribute: "busy", reflect: true, type: Boolean })
12233
+ ], CxContentBrowserAssetCard.prototype, "busy", 2);
12234
+ __decorateClass$5([
12041
12235
  n$6({ attribute: "image-url", reflect: true, type: String })
12042
12236
  ], CxContentBrowserAssetCard.prototype, "imageUrl", 2);
12043
- __decorateClass$4([
12237
+ __decorateClass$5([
12044
12238
  n$6({ attribute: "original-url", reflect: true, type: String })
12045
12239
  ], CxContentBrowserAssetCard.prototype, "originalUrl", 2);
12046
- __decorateClass$4([
12240
+ __decorateClass$5([
12047
12241
  n$6({ attribute: "scrub-url", reflect: true, type: String })
12048
12242
  ], CxContentBrowserAssetCard.prototype, "scrubUrl", 2);
12049
- __decorateClass$4([
12243
+ __decorateClass$5([
12050
12244
  n$6({ attribute: "asset-id", reflect: true, type: String })
12051
12245
  ], CxContentBrowserAssetCard.prototype, "assetId", 2);
12052
- __decorateClass$4([
12246
+ __decorateClass$5([
12053
12247
  n$6({ attribute: "asset-name", reflect: true, type: String })
12054
12248
  ], CxContentBrowserAssetCard.prototype, "assetName", 2);
12055
- __decorateClass$4([
12249
+ __decorateClass$5([
12056
12250
  n$6({ attribute: "asset-width", reflect: true, type: String })
12057
12251
  ], CxContentBrowserAssetCard.prototype, "assetWidth", 2);
12058
- __decorateClass$4([
12252
+ __decorateClass$5([
12059
12253
  n$6({ attribute: "asset-height", reflect: true, type: String })
12060
12254
  ], CxContentBrowserAssetCard.prototype, "assetHeight", 2);
12061
- __decorateClass$4([
12255
+ __decorateClass$5([
12062
12256
  n$6({ attribute: "asset-size", reflect: true, type: String })
12063
12257
  ], CxContentBrowserAssetCard.prototype, "assetSize", 2);
12064
- __decorateClass$4([
12258
+ __decorateClass$5([
12065
12259
  n$6({ attribute: "extension", reflect: true, type: String })
12066
12260
  ], CxContentBrowserAssetCard.prototype, "extension", 2);
12067
- __decorateClass$4([
12261
+ __decorateClass$5([
12068
12262
  n$6({ attribute: "in-cold-storage", reflect: true, type: Boolean })
12069
12263
  ], CxContentBrowserAssetCard.prototype, "inColdStorage", 2);
12070
- __decorateClass$4([
12264
+ __decorateClass$5([
12071
12265
  n$6({ attribute: "doc-type", reflect: true, type: String })
12072
12266
  ], CxContentBrowserAssetCard.prototype, "docType", 2);
12073
- __decorateClass$4([
12267
+ __decorateClass$5([
12074
12268
  n$6({ attribute: "view", reflect: true, type: String })
12075
12269
  ], CxContentBrowserAssetCard.prototype, "view", 2);
12076
- __decorateClass$4([
12270
+ __decorateClass$5([
12077
12271
  n$6({ attribute: "selected", reflect: true, type: Boolean })
12078
12272
  ], CxContentBrowserAssetCard.prototype, "selected", 2);
12079
- __decorateClass$4([
12273
+ __decorateClass$5([
12080
12274
  n$6({
12081
12275
  converter: {
12082
12276
  fromAttribute: (value) => value ? value.split(",").map((tag) => tag.trim()).filter(Boolean) : [],
@@ -12091,25 +12285,25 @@ __decorateClass$4([
12091
12285
  type: String
12092
12286
  })
12093
12287
  ], CxContentBrowserAssetCard.prototype, "tags", 2);
12094
- __decorateClass$4([
12288
+ __decorateClass$5([
12095
12289
  n$6({ attribute: "show-tags", reflect: true, type: Boolean })
12096
12290
  ], CxContentBrowserAssetCard.prototype, "showTags", 2);
12097
- __decorateClass$4([
12291
+ __decorateClass$5([
12098
12292
  n$6({ attribute: "show-title", reflect: true, type: Boolean })
12099
12293
  ], CxContentBrowserAssetCard.prototype, "showTitle", 2);
12100
- __decorateClass$4([
12294
+ __decorateClass$5([
12101
12295
  n$6({ attribute: "show-size", reflect: true, type: Boolean })
12102
12296
  ], CxContentBrowserAssetCard.prototype, "showSize", 2);
12103
- __decorateClass$4([
12297
+ __decorateClass$5([
12104
12298
  n$6({ attribute: "show-dimensions", reflect: true, type: Boolean })
12105
12299
  ], CxContentBrowserAssetCard.prototype, "showDimensions", 2);
12106
- __decorateClass$4([
12300
+ __decorateClass$5([
12107
12301
  e$7("cx-content-browser-asset-preview")
12108
12302
  ], CxContentBrowserAssetCard.prototype, "preview", 2);
12109
- CxContentBrowserAssetCard = __decorateClass$4([
12303
+ CxContentBrowserAssetCard = __decorateClass$5([
12110
12304
  customElement("cx-content-browser-asset-card")
12111
12305
  ], CxContentBrowserAssetCard);
12112
- const styles$3 = i$7`
12306
+ const styles$4 = i$7`
12113
12307
  :host {
12114
12308
  display: flex;
12115
12309
  align-items: center;
@@ -12134,14 +12328,14 @@ const styles$3 = i$7`
12134
12328
  font-size: 96px;
12135
12329
  }
12136
12330
  `;
12137
- var __defProp$3 = Object.defineProperty;
12138
- var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
12139
- var __decorateClass$3 = (decorators, target, key, kind) => {
12140
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target;
12331
+ var __defProp$4 = Object.defineProperty;
12332
+ var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
12333
+ var __decorateClass$4 = (decorators, target, key, kind) => {
12334
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target;
12141
12335
  for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
12142
12336
  if (decorator = decorators[i4])
12143
12337
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
12144
- if (kind && result) __defProp$3(target, key, result);
12338
+ if (kind && result) __defProp$4(target, key, result);
12145
12339
  return result;
12146
12340
  };
12147
12341
  let CxContentBrowserNoResult = class extends CortexElement {
@@ -12159,36 +12353,40 @@ let CxContentBrowserNoResult = class extends CortexElement {
12159
12353
  `;
12160
12354
  }
12161
12355
  };
12162
- CxContentBrowserNoResult.styles = [componentStyles, styles$3];
12356
+ CxContentBrowserNoResult.styles = [componentStyles, styles$4];
12163
12357
  CxContentBrowserNoResult.dependencies = {
12164
12358
  "cx-icon": CxIcon
12165
12359
  };
12166
- __decorateClass$3([
12360
+ __decorateClass$4([
12167
12361
  n$6({ attribute: "icon", type: String })
12168
12362
  ], CxContentBrowserNoResult.prototype, "icon", 2);
12169
- __decorateClass$3([
12363
+ __decorateClass$4([
12170
12364
  n$6({ attribute: "message", type: String })
12171
12365
  ], CxContentBrowserNoResult.prototype, "message", 2);
12172
- CxContentBrowserNoResult = __decorateClass$3([
12366
+ CxContentBrowserNoResult = __decorateClass$4([
12173
12367
  customElement("cx-content-browser-no-result")
12174
12368
  ], CxContentBrowserNoResult);
12175
12369
  class ScrollAnchorController {
12176
12370
  constructor(host, options) {
12177
12371
  __privateAdd(this, _host);
12178
12372
  __privateAdd(this, _getContainer);
12373
+ __privateAdd(this, _getContentOffset);
12179
12374
  __privateAdd(this, _getItemIndexById);
12375
+ __privateAdd(this, _getLayoutSource);
12180
12376
  __privateAdd(this, _itemSelector);
12181
12377
  __privateAdd(this, _anchor, null);
12182
12378
  __privateAdd(this, _columnCount, 0);
12183
12379
  __privateAdd(this, _itemHeight, 0);
12184
12380
  __privateAdd(this, _pendingRestoreFrames, []);
12185
12381
  __privateAdd(this, _restoreSequence, 0);
12186
- var _a2;
12382
+ var _a2, _b2, _c2;
12187
12383
  __privateSet(this, _host, host);
12188
12384
  __privateSet(this, _getContainer, options.getContainer);
12385
+ __privateSet(this, _getContentOffset, (_a2 = options.getContentOffset) != null ? _a2 : (() => 0));
12189
12386
  __privateSet(this, _getItemIndexById, options.getItemIndexById);
12387
+ __privateSet(this, _getLayoutSource, (_b2 = options.getLayoutSource) != null ? _b2 : options.getContainer);
12190
12388
  __privateSet(this, _itemSelector, options.itemSelector);
12191
- (_a2 = host.addController) == null ? void 0 : _a2.call(host, this);
12389
+ (_c2 = host.addController) == null ? void 0 : _c2.call(host, this);
12192
12390
  }
12193
12391
  capture(container = __privateGet(this, _getContainer).call(this)) {
12194
12392
  if (!container || typeof container.querySelectorAll !== "function") {
@@ -12198,10 +12396,11 @@ class ScrollAnchorController {
12198
12396
  container.querySelectorAll(__privateGet(this, _itemSelector))
12199
12397
  );
12200
12398
  const containerTop = container.getBoundingClientRect().top;
12399
+ const contentTop = containerTop + __privateGet(this, _getContentOffset).call(this);
12201
12400
  for (const el of children) {
12202
12401
  const rect = el.getBoundingClientRect();
12203
12402
  const id = el.assetId || el.dataset.id;
12204
- if (rect.bottom > containerTop && id) {
12403
+ if (rect.bottom > contentTop && id) {
12205
12404
  __privateSet(this, _anchor, {
12206
12405
  id,
12207
12406
  offset: rect.top - containerTop
@@ -12221,8 +12420,8 @@ class ScrollAnchorController {
12221
12420
  this.cancelPendingRestore();
12222
12421
  const sequence = ++__privateWrapper(this, _restoreSequence)._;
12223
12422
  void __privateGet(this, _host).updateComplete.then(() => __async(this, null, function* () {
12224
- var _a2;
12225
- yield (_a2 = __privateGet(this, _getContainer).call(this)) == null ? void 0 : _a2.layoutComplete;
12423
+ var _a2, _b2;
12424
+ yield (_b2 = (_a2 = __privateGet(this, _getLayoutSource).call(this)) == null ? void 0 : _a2.layoutComplete) == null ? void 0 : _b2.catch(() => void 0);
12226
12425
  if (sequence !== __privateGet(this, _restoreSequence)) {
12227
12426
  return;
12228
12427
  }
@@ -12270,7 +12469,10 @@ class ScrollAnchorController {
12270
12469
  return void 0;
12271
12470
  }
12272
12471
  const rowIndex = Math.floor(assetIndex / __privateGet(this, _columnCount));
12273
- return Math.max(0, rowIndex * __privateGet(this, _itemHeight) - __privateGet(this, _anchor).offset);
12472
+ return Math.max(
12473
+ 0,
12474
+ __privateGet(this, _getContentOffset).call(this) + rowIndex * __privateGet(this, _itemHeight) - __privateGet(this, _anchor).offset
12475
+ );
12274
12476
  }
12275
12477
  hostDisconnected() {
12276
12478
  this.cancelPendingRestore();
@@ -12292,14 +12494,16 @@ class ScrollAnchorController {
12292
12494
  }
12293
12495
  _host = new WeakMap();
12294
12496
  _getContainer = new WeakMap();
12497
+ _getContentOffset = new WeakMap();
12295
12498
  _getItemIndexById = new WeakMap();
12499
+ _getLayoutSource = new WeakMap();
12296
12500
  _itemSelector = new WeakMap();
12297
12501
  _anchor = new WeakMap();
12298
12502
  _columnCount = new WeakMap();
12299
12503
  _itemHeight = new WeakMap();
12300
12504
  _pendingRestoreFrames = new WeakMap();
12301
12505
  _restoreSequence = new WeakMap();
12302
- const styles$2 = i$7`
12506
+ const styles$3 = i$7`
12303
12507
  :host {
12304
12508
  display: block;
12305
12509
  flex: 1;
@@ -12320,24 +12524,24 @@ const styles$2 = i$7`
12320
12524
  --height: 4px;
12321
12525
  }
12322
12526
  `;
12323
- var __defProp$2 = Object.defineProperty;
12324
- var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
12325
- var __typeError2 = (msg) => {
12527
+ var __defProp$3 = Object.defineProperty;
12528
+ var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
12529
+ var __typeError$2 = (msg) => {
12326
12530
  throw TypeError(msg);
12327
12531
  };
12328
- var __decorateClass$2 = (decorators, target, key, kind) => {
12329
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target;
12532
+ var __decorateClass$3 = (decorators, target, key, kind) => {
12533
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target;
12330
12534
  for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
12331
12535
  if (decorator = decorators[i4])
12332
12536
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
12333
- if (kind && result) __defProp$2(target, key, result);
12537
+ if (kind && result) __defProp$3(target, key, result);
12334
12538
  return result;
12335
12539
  };
12336
- var __accessCheck2 = (obj, member, msg) => member.has(obj) || __typeError2("Cannot " + msg);
12337
- var __privateGet2 = (obj, member, getter) => (__accessCheck2(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
12338
- var __privateAdd2 = (obj, member, value) => member.has(obj) ? __typeError2("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
12339
- var __privateSet2 = (obj, member, value, setter) => (__accessCheck2(obj, member, "write to private field"), member.set(obj, value), value);
12340
- var _gutter, _lastHeight, _lastWidth;
12540
+ var __accessCheck$2 = (obj, member, msg) => member.has(obj) || __typeError$2("Cannot " + msg);
12541
+ var __privateGet$2 = (obj, member, getter) => (__accessCheck$2(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
12542
+ var __privateAdd$2 = (obj, member, value) => member.has(obj) ? __typeError$2("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
12543
+ var __privateSet$2 = (obj, member, value, setter) => (__accessCheck$2(obj, member, "write to private field"), member.set(obj, value), value);
12544
+ var _gutter, _lastHeight$1, _lastWidth;
12341
12545
  let CxContentBrowserGrid = class extends CortexElement {
12342
12546
  constructor() {
12343
12547
  super();
@@ -12351,12 +12555,16 @@ let CxContentBrowserGrid = class extends CortexElement {
12351
12555
  this.showSize = true;
12352
12556
  this.showDimensions = true;
12353
12557
  this.showTags = false;
12558
+ this.showCta = false;
12559
+ this.ctaText = "";
12560
+ this.ctaTextTransform = "capitalize";
12561
+ this.busyAssetId = void 0;
12354
12562
  this.selectedAssetId = void 0;
12355
12563
  this.assetMap = /* @__PURE__ */ new Map();
12356
12564
  this.columnWidth = 0;
12357
- __privateAdd2(this, _gutter, 8);
12358
- __privateAdd2(this, _lastHeight, 0);
12359
- __privateAdd2(this, _lastWidth, 0);
12565
+ __privateAdd$2(this, _gutter, 8);
12566
+ __privateAdd$2(this, _lastHeight$1, 0);
12567
+ __privateAdd$2(this, _lastWidth, 0);
12360
12568
  this.scrollAnchorController = new ScrollAnchorController(this, {
12361
12569
  getContainer: () => this.virtualizerEl,
12362
12570
  getItemIndexById: (id) => this.assets.findIndex((asset) => asset.id === id),
@@ -12369,7 +12577,7 @@ let CxContentBrowserGrid = class extends CortexElement {
12369
12577
  }
12370
12578
  handleViewChange() {
12371
12579
  this.scrollAnchorController.capture();
12372
- this.calculatePageSize(__privateGet2(this, _lastWidth), __privateGet2(this, _lastHeight), true);
12580
+ this.calculatePageSize(__privateGet$2(this, _lastWidth), __privateGet$2(this, _lastHeight$1), true);
12373
12581
  }
12374
12582
  handleAssetsChange() {
12375
12583
  this.assetMap.clear();
@@ -12387,17 +12595,17 @@ let CxContentBrowserGrid = class extends CortexElement {
12387
12595
  this.debouncedCalculatePageSize(width, height);
12388
12596
  }
12389
12597
  calculatePageSize(width, height, force = false) {
12390
- const lastHeight = __privateGet2(this, _lastHeight);
12391
- const lastWidth = __privateGet2(this, _lastWidth);
12598
+ const lastHeight = __privateGet$2(this, _lastHeight$1);
12599
+ const lastWidth = __privateGet$2(this, _lastWidth);
12392
12600
  if (!force && Math.abs(lastHeight - height) < 10 && Math.abs(lastWidth - width) < 10) {
12393
12601
  return;
12394
12602
  }
12395
- __privateSet2(this, _lastHeight, height);
12396
- __privateSet2(this, _lastWidth, width);
12603
+ __privateSet$2(this, _lastHeight$1, height);
12604
+ __privateSet$2(this, _lastWidth, width);
12397
12605
  const { columnCount, rowCount } = this.calculateColumnCount(width, height);
12398
12606
  this.scrollAnchorController.setLayoutMetrics({
12399
12607
  columnCount,
12400
- itemHeight: Math.max(this.columnWidth, 150) + __privateGet2(this, _gutter)
12608
+ itemHeight: Math.max(this.columnWidth, 150) + __privateGet$2(this, _gutter)
12401
12609
  });
12402
12610
  this.emit("cx-content-browser-grid-resize", {
12403
12611
  detail: {
@@ -12417,12 +12625,12 @@ let CxContentBrowserGrid = class extends CortexElement {
12417
12625
  }
12418
12626
  const effectiveWidth = ((_a2 = this.virtualizerEl) == null ? void 0 : _a2.clientWidth) || width;
12419
12627
  const breakPoint = ((_b2 = ASSET_SIZE[this.view]) == null ? void 0 : _b2.minWidth) || ASSET_SIZE[GridView$1.Large].minWidth;
12420
- const columnCount = Math.max(1, Math.floor((effectiveWidth + __privateGet2(this, _gutter)) / (breakPoint + __privateGet2(this, _gutter))));
12628
+ const columnCount = Math.max(1, Math.floor((effectiveWidth + __privateGet$2(this, _gutter)) / (breakPoint + __privateGet$2(this, _gutter))));
12421
12629
  let rowCount = 0;
12422
12630
  if (height) {
12423
- rowCount = Math.ceil(height / (breakPoint + __privateGet2(this, _gutter)));
12631
+ rowCount = Math.ceil(height / (breakPoint + __privateGet$2(this, _gutter)));
12424
12632
  }
12425
- const newColumnWidth = Math.floor((effectiveWidth - __privateGet2(this, _gutter) * (columnCount + 1)) / columnCount);
12633
+ const newColumnWidth = Math.floor((effectiveWidth - __privateGet$2(this, _gutter) * (columnCount + 1)) / columnCount);
12426
12634
  if (newColumnWidth !== this.columnWidth) {
12427
12635
  this.columnWidth = newColumnWidth;
12428
12636
  }
@@ -12466,6 +12674,10 @@ let CxContentBrowserGrid = class extends CortexElement {
12466
12674
  ?show-size=${this.showSize}
12467
12675
  ?show-dimensions=${this.showDimensions}
12468
12676
  ?show-tags=${this.showTags}
12677
+ ?show-cta=${this.showCta}
12678
+ ?busy=${asset.id === this.busyAssetId}
12679
+ cta-text=${this.ctaText}
12680
+ cta-text-transform=${this.ctaTextTransform}
12469
12681
  ?in-cold-storage=${asset.inColdStorage}
12470
12682
  @click=${this.handleClick}
12471
12683
  ></cx-content-browser-asset-card>
@@ -12489,7 +12701,7 @@ let CxContentBrowserGrid = class extends CortexElement {
12489
12701
  class="content-browser-grid-loading"
12490
12702
  style=${o$2({
12491
12703
  opacity: this.loading ? 1 : 0,
12492
- padding: `0 ${__privateGet2(this, _gutter) * 2}px ${__privateGet2(this, _gutter)}px`
12704
+ padding: `0 ${__privateGet$2(this, _gutter) * 2}px ${__privateGet$2(this, _gutter)}px`
12493
12705
  })}
12494
12706
  >
12495
12707
  <cx-progress-bar indeterminate></cx-progress-bar>
@@ -12513,7 +12725,7 @@ let CxContentBrowserGrid = class extends CortexElement {
12513
12725
  "overflow-x": "hidden"
12514
12726
  })}
12515
12727
  .layout=${grid({
12516
- gap: `${__privateGet2(this, _gutter)}px`,
12728
+ gap: `${__privateGet$2(this, _gutter)}px`,
12517
12729
  itemSize: {
12518
12730
  height: `${Math.max(this.columnWidth, 150)}px`,
12519
12731
  width: `${this.columnWidth}px`
@@ -12532,67 +12744,79 @@ let CxContentBrowserGrid = class extends CortexElement {
12532
12744
  }
12533
12745
  };
12534
12746
  _gutter = /* @__PURE__ */ new WeakMap();
12535
- _lastHeight = /* @__PURE__ */ new WeakMap();
12747
+ _lastHeight$1 = /* @__PURE__ */ new WeakMap();
12536
12748
  _lastWidth = /* @__PURE__ */ new WeakMap();
12537
- CxContentBrowserGrid.styles = [componentStyles, styles$2];
12749
+ CxContentBrowserGrid.styles = [componentStyles, styles$3];
12538
12750
  CxContentBrowserGrid.dependencies = {
12539
12751
  "cx-content-browser-asset-card": CxContentBrowserAssetCard,
12540
12752
  "cx-content-browser-no-result": CxContentBrowserNoResult,
12541
12753
  "cx-progress-bar": CxProgressBar,
12542
12754
  "cx-resize-observer": CxResizeObserver
12543
12755
  };
12544
- __decorateClass$2([
12756
+ __decorateClass$3([
12545
12757
  e$7(".content-browser-grid")
12546
12758
  ], CxContentBrowserGrid.prototype, "containerEl", 2);
12547
- __decorateClass$2([
12759
+ __decorateClass$3([
12548
12760
  e$7("lit-virtualizer")
12549
12761
  ], CxContentBrowserGrid.prototype, "virtualizerEl", 2);
12550
- __decorateClass$2([
12762
+ __decorateClass$3([
12551
12763
  n$6({ attribute: "assets", reflect: false, type: Array })
12552
12764
  ], CxContentBrowserGrid.prototype, "assets", 2);
12553
- __decorateClass$2([
12765
+ __decorateClass$3([
12554
12766
  n$6({ attribute: "empty", reflect: true, type: Boolean })
12555
12767
  ], CxContentBrowserGrid.prototype, "empty", 2);
12556
- __decorateClass$2([
12768
+ __decorateClass$3([
12557
12769
  n$6({ attribute: "view", reflect: true, type: String })
12558
12770
  ], CxContentBrowserGrid.prototype, "view", 2);
12559
- __decorateClass$2([
12771
+ __decorateClass$3([
12560
12772
  n$6({ attribute: "has-more", reflect: true, type: Boolean })
12561
12773
  ], CxContentBrowserGrid.prototype, "hasMore", 2);
12562
- __decorateClass$2([
12774
+ __decorateClass$3([
12563
12775
  n$6({ attribute: "loading", reflect: true, type: Boolean })
12564
12776
  ], CxContentBrowserGrid.prototype, "loading", 2);
12565
- __decorateClass$2([
12777
+ __decorateClass$3([
12566
12778
  n$6({ attribute: "show-title", reflect: true, type: Boolean })
12567
12779
  ], CxContentBrowserGrid.prototype, "showTitle", 2);
12568
- __decorateClass$2([
12780
+ __decorateClass$3([
12569
12781
  n$6({ attribute: "show-size", reflect: true, type: Boolean })
12570
12782
  ], CxContentBrowserGrid.prototype, "showSize", 2);
12571
- __decorateClass$2([
12783
+ __decorateClass$3([
12572
12784
  n$6({ attribute: "show-dimensions", reflect: true, type: Boolean })
12573
12785
  ], CxContentBrowserGrid.prototype, "showDimensions", 2);
12574
- __decorateClass$2([
12786
+ __decorateClass$3([
12575
12787
  n$6({ attribute: "show-tags", reflect: true, type: Boolean })
12576
12788
  ], CxContentBrowserGrid.prototype, "showTags", 2);
12577
- __decorateClass$2([
12789
+ __decorateClass$3([
12790
+ n$6({ attribute: "show-cta", reflect: true, type: Boolean })
12791
+ ], CxContentBrowserGrid.prototype, "showCta", 2);
12792
+ __decorateClass$3([
12793
+ n$6({ attribute: "cta-text", reflect: false, type: String })
12794
+ ], CxContentBrowserGrid.prototype, "ctaText", 2);
12795
+ __decorateClass$3([
12796
+ n$6({ attribute: "cta-text-transform", reflect: false, type: String })
12797
+ ], CxContentBrowserGrid.prototype, "ctaTextTransform", 2);
12798
+ __decorateClass$3([
12799
+ n$6({ attribute: false })
12800
+ ], CxContentBrowserGrid.prototype, "busyAssetId", 2);
12801
+ __decorateClass$3([
12578
12802
  n$6({ attribute: "selected-asset-id", reflect: true, type: String })
12579
12803
  ], CxContentBrowserGrid.prototype, "selectedAssetId", 2);
12580
- __decorateClass$2([
12804
+ __decorateClass$3([
12581
12805
  r$6()
12582
12806
  ], CxContentBrowserGrid.prototype, "assetMap", 2);
12583
- __decorateClass$2([
12807
+ __decorateClass$3([
12584
12808
  r$6()
12585
12809
  ], CxContentBrowserGrid.prototype, "columnWidth", 2);
12586
- __decorateClass$2([
12810
+ __decorateClass$3([
12587
12811
  watch("view", { waitUntilFirstUpdate: true })
12588
12812
  ], CxContentBrowserGrid.prototype, "handleViewChange", 1);
12589
- __decorateClass$2([
12813
+ __decorateClass$3([
12590
12814
  watch("assets")
12591
12815
  ], CxContentBrowserGrid.prototype, "handleAssetsChange", 1);
12592
- CxContentBrowserGrid = __decorateClass$2([
12816
+ CxContentBrowserGrid = __decorateClass$3([
12593
12817
  customElement("cx-content-browser-grid")
12594
12818
  ], CxContentBrowserGrid);
12595
- const styles$1 = i$7`
12819
+ const styles$2 = i$7`
12596
12820
  :host {
12597
12821
  display: block;
12598
12822
  }
@@ -12651,14 +12875,14 @@ const styles$1 = i$7`
12651
12875
  cursor: default;
12652
12876
  }
12653
12877
  `;
12654
- var __defProp$1 = Object.defineProperty;
12655
- var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
12656
- var __decorateClass$1 = (decorators, target, key, kind) => {
12657
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
12878
+ var __defProp$2 = Object.defineProperty;
12879
+ var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
12880
+ var __decorateClass$2 = (decorators, target, key, kind) => {
12881
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target;
12658
12882
  for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
12659
12883
  if (decorator = decorators[i4])
12660
12884
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
12661
- if (kind && result) __defProp$1(target, key, result);
12885
+ if (kind && result) __defProp$2(target, key, result);
12662
12886
  return result;
12663
12887
  };
12664
12888
  const LOGOUT_ITEM_VALUE = "logout";
@@ -12791,7 +13015,7 @@ let CxContentBrowserHeader = class extends CortexElement {
12791
13015
  `;
12792
13016
  }
12793
13017
  };
12794
- CxContentBrowserHeader.styles = [componentStyles, styles$1];
13018
+ CxContentBrowserHeader.styles = [componentStyles, styles$2];
12795
13019
  CxContentBrowserHeader.dependencies = {
12796
13020
  "cx-avatar": CxAvatar,
12797
13021
  "cx-divider": CxDivider,
@@ -12805,36 +13029,908 @@ CxContentBrowserHeader.dependencies = {
12805
13029
  "cx-space": CxSpace,
12806
13030
  "cx-typography": CxTypography
12807
13031
  };
12808
- __decorateClass$1([
13032
+ __decorateClass$2([
12809
13033
  n$6({ type: Boolean })
12810
13034
  ], CxContentBrowserHeader.prototype, "bordered", 2);
12811
- __decorateClass$1([
13035
+ __decorateClass$2([
12812
13036
  n$6({ attribute: "application-name", type: String })
12813
13037
  ], CxContentBrowserHeader.prototype, "applicationName", 2);
12814
- __decorateClass$1([
13038
+ __decorateClass$2([
12815
13039
  n$6({ type: Boolean })
12816
13040
  ], CxContentBrowserHeader.prototype, "loading", 2);
12817
- __decorateClass$1([
13041
+ __decorateClass$2([
12818
13042
  n$6({ attribute: "is-fetching", type: Boolean })
12819
13043
  ], CxContentBrowserHeader.prototype, "isFetching", 2);
12820
- __decorateClass$1([
13044
+ __decorateClass$2([
12821
13045
  n$6({ attribute: "avatar", type: String })
12822
13046
  ], CxContentBrowserHeader.prototype, "avatar", 2);
12823
- __decorateClass$1([
13047
+ __decorateClass$2([
12824
13048
  n$6({ attribute: "full-name", type: String })
12825
13049
  ], CxContentBrowserHeader.prototype, "fullName", 2);
12826
- __decorateClass$1([
13050
+ __decorateClass$2([
12827
13051
  n$6({ attribute: "folder-title", type: String })
12828
13052
  ], CxContentBrowserHeader.prototype, "folderTitle", 2);
12829
- __decorateClass$1([
13053
+ __decorateClass$2([
12830
13054
  n$6({ attribute: "show-close-button", type: Boolean })
12831
13055
  ], CxContentBrowserHeader.prototype, "showCloseButton", 2);
12832
- __decorateClass$1([
13056
+ __decorateClass$2([
12833
13057
  n$6({ attribute: "can-logout", type: Boolean })
12834
13058
  ], CxContentBrowserHeader.prototype, "canLogout", 2);
12835
- CxContentBrowserHeader = __decorateClass$1([
13059
+ CxContentBrowserHeader = __decorateClass$2([
12836
13060
  customElement("cx-content-browser-header")
12837
13061
  ], CxContentBrowserHeader);
13062
+ const styles$1 = i$7`
13063
+ /* Containing block for the absolutely positioned loading bar, which is a direct child. */
13064
+ :host {
13065
+ position: relative;
13066
+ display: block;
13067
+ flex: 1;
13068
+ box-sizing: border-box;
13069
+ /*
13070
+ * The overflow has to stop at the scrollport below, which it only does while the host cannot
13071
+ * grow with the grids' min-content width. Two different parents can let it grow, so both are
13072
+ * closed off:
13073
+ *
13074
+ * width -- a multi-line flex parent stretches an item to its own flex line's cross size, the
13075
+ * largest hypothetical size on that line, and not to the container's width; only a
13076
+ * single-line container does the latter. The picker's column parent wraps, so the
13077
+ * host stretched to the grids' min-content width and carried everything beside it
13078
+ * along (L-429EVG: the login avatar left the viewport). A definite width ends that.
13079
+ * min-width -- in a row parent the main axis is the horizontal one, and a flex item's automatic
13080
+ * minimum size refuses to shrink below its content there. In a column parent that
13081
+ * automatic minimum lands on min-height instead, which is why width alone is not
13082
+ * enough for one shape and min-width alone is not enough for the other.
13083
+ */
13084
+ width: 100%;
13085
+ min-width: 0;
13086
+ min-height: 0;
13087
+ }
13088
+
13089
+ /*
13090
+ * The one scrollport for both axes. The header and the virtualized rows are separate grids, so
13091
+ * anything that scrolled them separately could drift; sharing a scroll container means a single
13092
+ * scroll offset moves both and they cannot. The vertical scrollbar therefore sits outside both
13093
+ * grids, which is why neither has to reserve a gutter for it.
13094
+ */
13095
+ .content-browser-table {
13096
+ display: flex;
13097
+ flex-direction: column;
13098
+ height: 100%;
13099
+ overflow: auto;
13100
+ }
13101
+
13102
+ .content-browser-table-loading {
13103
+ position: absolute;
13104
+ width: 100%;
13105
+ z-index: var(--cx-z-index-drawer);
13106
+ }
13107
+
13108
+ .content-browser-table-loading cx-progress-bar {
13109
+ --height: 4px;
13110
+ }
13111
+
13112
+ /*
13113
+ * min-width: min-content is what makes the table scroll instead of squashing: it is the width
13114
+ * at which every track that cannot shrink still fits, so a column dragged wider than the viewport
13115
+ * widens both grids past it and the container gains a horizontal scrollbar. The header and a row
13116
+ * resolve the same track list against the same padding and gaps, so their min-content widths are
13117
+ * equal and their column boundaries stay on top of each other at any scroll offset.
13118
+ */
13119
+ .content-browser-table__header,
13120
+ .content-browser-table__row {
13121
+ display: grid;
13122
+ align-items: center;
13123
+ /* Set on the host so the header and every virtualized row resolve one identical track list. */
13124
+ grid-template-columns: var(--cx-content-browser-table-columns);
13125
+ column-gap: var(--cx-spacing-medium);
13126
+ padding: var(--cx-spacing-x-small) var(--cx-spacing-medium);
13127
+ min-width: min-content;
13128
+ }
13129
+
13130
+ /*
13131
+ * Sticky rather than outside the scroller: the header has to travel with the rows horizontally
13132
+ * and stay put vertically, and only sharing their scrollport gives the first of those for free.
13133
+ */
13134
+ .content-browser-table__head {
13135
+ position: sticky;
13136
+ top: 0;
13137
+ z-index: 1;
13138
+ flex: none;
13139
+ min-width: min-content;
13140
+ /*
13141
+ * The offset and the background belong to the sticky box, not to the row inside it: rows now
13142
+ * scroll underneath within the same scrollport, and any part of the sticky box that paints
13143
+ * nothing shows them through. __head is a flex item, so a child's margin cannot collapse out
13144
+ * of it either. Literal fallback because an unthemed host paints no background at all.
13145
+ */
13146
+ padding-top: 5px;
13147
+ background-color: var(--cx-color-neutral-50, #f9f9f9);
13148
+ }
13149
+
13150
+ .content-browser-table__header {
13151
+ border-bottom: 1px solid var(--cx-color-neutral-200);
13152
+ color: var(--cx-color-neutral-700);
13153
+ }
13154
+
13155
+ /* cx-typography sets its own font-weight, so the host cannot simply inherit one in. */
13156
+ .content-browser-table__header cx-typography::part(base) {
13157
+ font-weight: var(--cx-font-weight-medium);
13158
+ }
13159
+
13160
+ .content-browser-table__body {
13161
+ flex: 1;
13162
+ min-height: 0;
13163
+ }
13164
+
13165
+ /*
13166
+ * lit-virtualizer positions rows absolutely, which makes them shrink-to-fit. Without an explicit
13167
+ * width the row's grid resolves its fr tracks against the row's own content width while the
13168
+ * header -- not virtualized -- resolves the same tracks against the full container, so the two
13169
+ * disagree and a fractional column never receives the free space. 100% is the scrollport, not
13170
+ * the scroll width, so the shared min-width: min-content above is what carries a row past it.
13171
+ */
13172
+ .content-browser-table__row {
13173
+ box-sizing: border-box;
13174
+ width: 100%;
13175
+ border-bottom: 1px solid var(--cx-color-neutral-200);
13176
+ cursor: pointer;
13177
+ }
13178
+
13179
+ .content-browser-table__row:hover,
13180
+ .content-browser-table__row:focus-visible {
13181
+ background-color: var(--cx-color-neutral-100);
13182
+ outline: none;
13183
+ }
13184
+
13185
+ .content-browser-table__row--selected {
13186
+ background-color: var(--cx-color-primary-100);
13187
+ }
13188
+
13189
+ .content-browser-table__row--disabled {
13190
+ cursor: default;
13191
+ pointer-events: none;
13192
+ opacity: 0.5;
13193
+ }
13194
+
13195
+ .content-browser-table__cell {
13196
+ min-width: 0;
13197
+ overflow: hidden;
13198
+ }
13199
+
13200
+ .content-browser-table__cell--center {
13201
+ text-align: center;
13202
+ }
13203
+
13204
+ .content-browser-table__cell--right {
13205
+ text-align: right;
13206
+ }
13207
+
13208
+ /* Anchors the resize handle; the cell clips, so the handle stays inside its own right edge. */
13209
+ .content-browser-table__header .content-browser-table__cell {
13210
+ position: relative;
13211
+ }
13212
+
13213
+ /*
13214
+ * Kept wholly inside the cell: the cell clips, so any part hanging into the column gap is not
13215
+ * painted and, more importantly, not hit-testable.
13216
+ */
13217
+ .content-browser-table__resize {
13218
+ position: absolute;
13219
+ top: 0;
13220
+ right: 0;
13221
+ bottom: 0;
13222
+ /* Fallback matters: with no design-system theme the token is empty and the grab target is 0px. */
13223
+ width: var(--cx-spacing-medium, 16px);
13224
+ cursor: col-resize;
13225
+ touch-action: none;
13226
+ }
13227
+
13228
+ /*
13229
+ * The column divider, pinned to the grab target's right edge -- which the cell clips to, so it
13230
+ * lands on the column boundary. Visible at rest as a neutral full-height hairline: it is what
13231
+ * tells the user where the draggable boundaries are before the pointer is anywhere near one, so
13232
+ * it has to read as table chrome. The rules below take it to the primary treatment once the
13233
+ * boundary is actually being addressed. Literal fallbacks because the tokens resolve to nothing
13234
+ * on an unthemed host, and an invisible divider is the defect this fixes.
13235
+ */
13236
+ .content-browser-table__resize::after {
13237
+ position: absolute;
13238
+ top: 0;
13239
+ right: 0;
13240
+ bottom: 0;
13241
+ width: 1px;
13242
+ background-color: var(--cx-color-neutral-200, #e4e4e7);
13243
+ content: '';
13244
+ }
13245
+
13246
+ .content-browser-table__resize:hover::after,
13247
+ .content-browser-table__resize:focus-visible::after {
13248
+ width: 2px;
13249
+ background-color: var(--cx-color-primary-500, #3b82f6);
13250
+ }
13251
+
13252
+ /*
13253
+ * Keyboard focus needs an indicator of its own: the hover hairline is 2px wide and half the cell
13254
+ * high, far too small to read as focus. The ring is inset by its own width because the header
13255
+ * cell clips -- the handle is flush with the cell's top, right and bottom edges, so anything
13256
+ * drawn outside its box is never painted. Fallbacks matter: with no design-system theme the
13257
+ * tokens are empty and the ring would disappear entirely.
13258
+ */
13259
+ .content-browser-table__resize:focus-visible {
13260
+ outline: var(--cx-focus-ring-style, solid) var(--cx-focus-ring-width, 3px)
13261
+ var(--cx-focus-ring-color, #2563eb);
13262
+ outline-offset: calc(-1 * var(--cx-focus-ring-width, 3px));
13263
+ }
13264
+
13265
+ /*
13266
+ * While a column is being dragged the pointer is captured, so it can travel anywhere in the
13267
+ * document -- keep the resize cursor and stop the drag from selecting header text.
13268
+ */
13269
+ .content-browser-table--resizing {
13270
+ cursor: col-resize;
13271
+ user-select: none;
13272
+ }
13273
+
13274
+ .content-browser-table--resizing .content-browser-table__resize::after {
13275
+ width: 2px;
13276
+ background-color: var(--cx-color-primary-500, #3b82f6);
13277
+ }
13278
+
13279
+ .content-browser-table__cell--action {
13280
+ display: flex;
13281
+ justify-content: flex-end;
13282
+ }
13283
+
13284
+ /*
13285
+ * visibility, not display: the action column is a max-content track, so removing the button
13286
+ * from layout would collapse the track and reflow every other column on hover.
13287
+ */
13288
+ .content-browser-table__action {
13289
+ --min-height: 0;
13290
+
13291
+ visibility: hidden;
13292
+ }
13293
+
13294
+ .content-browser-table__row:hover .content-browser-table__action,
13295
+ .content-browser-table__row:focus-visible .content-browser-table__action,
13296
+ .content-browser-table__row:focus-within .content-browser-table__action,
13297
+ .content-browser-table__row--selected .content-browser-table__action,
13298
+ .content-browser-table__action--busy {
13299
+ visibility: visible;
13300
+ }
13301
+
13302
+ /*
13303
+ * Reserves the action track's width in the header grid so it resolves to the same max-content
13304
+ * size the row grid resolves to. It is never shown and never focusable.
13305
+ */
13306
+ .content-browser-table__action--placeholder {
13307
+ visibility: hidden;
13308
+ pointer-events: none;
13309
+ }
13310
+
13311
+ .content-browser-table__empty {
13312
+ flex: 1;
13313
+ }
13314
+ `;
13315
+ var __defProp$1 = Object.defineProperty;
13316
+ var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
13317
+ var __typeError$1 = (msg) => {
13318
+ throw TypeError(msg);
13319
+ };
13320
+ var __decorateClass$1 = (decorators, target, key, kind) => {
13321
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
13322
+ for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
13323
+ if (decorator = decorators[i4])
13324
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
13325
+ if (kind && result) __defProp$1(target, key, result);
13326
+ return result;
13327
+ };
13328
+ var __accessCheck$1 = (obj, member, msg) => member.has(obj) || __typeError$1("Cannot " + msg);
13329
+ var __privateGet$1 = (obj, member, getter) => (__accessCheck$1(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
13330
+ var __privateAdd$1 = (obj, member, value) => member.has(obj) ? __typeError$1("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
13331
+ var __privateSet$1 = (obj, member, value, setter) => (__accessCheck$1(obj, member, "write to private field"), member.set(obj, value), value);
13332
+ var _lastHeight, _lastScrollTop, _resize, _fallbackListeners;
13333
+ const ROW_HEIGHT = 40;
13334
+ const ACTION_COLUMN_TRACK = "max-content";
13335
+ const MIN_COLUMN_WIDTH = 48;
13336
+ const MAX_COLUMN_WIDTH = 2e3;
13337
+ const COLUMN_RESIZE_STEP = 8;
13338
+ const COLUMN_RESIZE_STEP_LARGE = 32;
13339
+ const TABLE_COLUMNS_PROPERTY = "--cx-content-browser-table-columns";
13340
+ const FLEX_TRACK = /^\d*\.?\d+fr$/i;
13341
+ const MINMAX_TRACK = /^minmax\(\s*(.+?)\s*,\s*(.+?)\s*\)$/i;
13342
+ const COLLAPSIBLE_MINIMUM = /^(auto|min-content)$/i;
13343
+ const PIXEL_MINIMUM = /^(\d*\.?\d+)(px)?$/i;
13344
+ function floorFlexibleTrack(track) {
13345
+ const authored = track.trim();
13346
+ const minmax = MINMAX_TRACK.exec(authored);
13347
+ if (!minmax) {
13348
+ return FLEX_TRACK.test(authored) ? `minmax(${MIN_COLUMN_WIDTH}px, ${authored})` : authored;
13349
+ }
13350
+ const [, minimum, maximum] = minmax;
13351
+ if (!FLEX_TRACK.test(maximum)) {
13352
+ return authored;
13353
+ }
13354
+ const pixels = PIXEL_MINIMUM.exec(minimum);
13355
+ const collapsible = COLLAPSIBLE_MINIMUM.test(minimum) || pixels !== null && Number.parseFloat(pixels[1]) < MIN_COLUMN_WIDTH;
13356
+ return collapsible ? `minmax(${MIN_COLUMN_WIDTH}px, ${maximum})` : authored;
13357
+ }
13358
+ function createColumnWidths(entries = []) {
13359
+ return Object.assign(/* @__PURE__ */ Object.create(null), Object.fromEntries(entries));
13360
+ }
13361
+ function readCellValue(asset, field) {
13362
+ const value = asset[field];
13363
+ if (value === void 0 || value === null || typeof value === "object") {
13364
+ return "";
13365
+ }
13366
+ return String(value);
13367
+ }
13368
+ let CxContentBrowserTable = class extends CortexElement {
13369
+ constructor() {
13370
+ super();
13371
+ this.localize = new LocalizeController(this);
13372
+ this.assets = [];
13373
+ this.columns = [];
13374
+ this.ctaText = "";
13375
+ this.ctaTextTransform = "capitalize";
13376
+ this.empty = false;
13377
+ this.hasMore = false;
13378
+ this.loading = false;
13379
+ this.selectedAssetId = void 0;
13380
+ this.busyAssetId = void 0;
13381
+ this.assetMap = /* @__PURE__ */ new Map();
13382
+ this.columnWidths = createColumnWidths();
13383
+ __privateAdd$1(this, _lastHeight, 0);
13384
+ __privateAdd$1(this, _lastScrollTop, 0);
13385
+ this.scrollAnchorController = new ScrollAnchorController(this, {
13386
+ // The rows scroll inside the table container, not inside the virtualizer, so that is the
13387
+ // element whose scroll offset an anchor has to be captured against and restored on.
13388
+ getContainer: () => this.containerEl,
13389
+ // The sticky header is the container's first in-flow child, so row 0 starts below it rather
13390
+ // than at the content origin. Measured rather than a constant: the height is whatever the
13391
+ // host's tokens and column titles resolve to.
13392
+ getContentOffset: () => {
13393
+ var _a2, _b2;
13394
+ return (_b2 = (_a2 = this.headEl) == null ? void 0 : _a2.getBoundingClientRect().height) != null ? _b2 : 0;
13395
+ },
13396
+ getItemIndexById: (id) => this.assets.findIndex((asset) => asset.id === id),
13397
+ // The container is a plain div, so it has no `layoutComplete` of its own; the virtualizer still
13398
+ // has to have laid the rows out before a restore can land on one.
13399
+ getLayoutSource: () => this.bodyEl,
13400
+ itemSelector: ".content-browser-table__row"
13401
+ });
13402
+ __privateAdd$1(this, _resize);
13403
+ __privateAdd$1(this, _fallbackListeners);
13404
+ this.debouncedCalculatePageSize = debounce(this.calculatePageSize, 200);
13405
+ this.debouncedHandleScrollEnd = debounce(this.handleScrollEnd, 200);
13406
+ this.handleRowClick = this.handleRowClick.bind(this);
13407
+ this.handleActionClick = this.handleActionClick.bind(this);
13408
+ this.handleRowKeyDown = this.handleRowKeyDown.bind(this);
13409
+ }
13410
+ /** One authored track per configured column, in order. The action track is not one of them. */
13411
+ buildColumnTracks(widths) {
13412
+ return this.columns.map((column2) => {
13413
+ var _a2;
13414
+ const resized = widths[column2.field];
13415
+ return resized === void 0 ? floorFlexibleTrack((_a2 = column2.width) != null ? _a2 : "minmax(0, 1fr)") : `${resized}px`;
13416
+ });
13417
+ }
13418
+ buildTemplateColumns(widths) {
13419
+ return [...this.buildColumnTracks(widths), ACTION_COLUMN_TRACK].join(" ");
13420
+ }
13421
+ get templateColumns() {
13422
+ return this.buildTemplateColumns(this.columnWidths);
13423
+ }
13424
+ resolveColumnWidth(field) {
13425
+ var _a2;
13426
+ const configured = this.columnWidths[field];
13427
+ if (configured !== void 0) {
13428
+ return configured;
13429
+ }
13430
+ const cell = this.renderRoot.querySelector(
13431
+ `.content-browser-table__header [role="columnheader"][data-field="${CSS.escape(field)}"]`
13432
+ );
13433
+ return this.clampColumnWidth((_a2 = cell == null ? void 0 : cell.getBoundingClientRect().width) != null ? _a2 : MIN_COLUMN_WIDTH);
13434
+ }
13435
+ clampColumnWidth(width) {
13436
+ return Math.round(Math.min(MAX_COLUMN_WIDTH, Math.max(MIN_COLUMN_WIDTH, width)));
13437
+ }
13438
+ commitColumnWidth(field, width) {
13439
+ if (this.columnWidths[field] === width) {
13440
+ return;
13441
+ }
13442
+ const next2 = createColumnWidths(Object.entries(this.columnWidths));
13443
+ if (width === void 0) {
13444
+ delete next2[field];
13445
+ } else {
13446
+ next2[field] = width;
13447
+ }
13448
+ this.columnWidths = next2;
13449
+ this.emit("cx-content-browser-table-column-resize", { detail: { field, width } });
13450
+ }
13451
+ /**
13452
+ * Kept off the reactive path: its only effect is the cursor, the text selection and the handle
13453
+ * colour, while a reactive toggle would rebind `renderItem` and re-render every visible row twice
13454
+ * per drag.
13455
+ */
13456
+ setResizingClass(active) {
13457
+ var _a2;
13458
+ (_a2 = this.containerEl) == null ? void 0 : _a2.classList.toggle("content-browser-table--resizing", active);
13459
+ }
13460
+ bindFallbackListeners(target) {
13461
+ const onMove = (event) => this.handleResizeMove(event);
13462
+ const onUp = (event) => this.handleResizeEnd(event);
13463
+ const onCancel = (event) => this.handleResizeCancel(event);
13464
+ __privateSet$1(this, _fallbackListeners, { onCancel, onMove, onUp, target });
13465
+ target.addEventListener("pointermove", onMove);
13466
+ target.addEventListener("pointerup", onUp);
13467
+ target.addEventListener("pointercancel", onCancel);
13468
+ }
13469
+ releaseFallbackListeners() {
13470
+ if (!__privateGet$1(this, _fallbackListeners)) {
13471
+ return;
13472
+ }
13473
+ const { onCancel, onMove, onUp, target } = __privateGet$1(this, _fallbackListeners);
13474
+ target.removeEventListener("pointermove", onMove);
13475
+ target.removeEventListener("pointerup", onUp);
13476
+ target.removeEventListener("pointercancel", onCancel);
13477
+ __privateSet$1(this, _fallbackListeners, void 0);
13478
+ }
13479
+ /**
13480
+ * With the fallback bound, an event dispatched at the handle reaches the handle's own binding and
13481
+ * then the document one, running every terminal handler twice. The fallback owns the whole drag on
13482
+ * that path, so the element-level delivery is dropped.
13483
+ */
13484
+ isHandledByFallback(event) {
13485
+ return __privateGet$1(this, _fallbackListeners) !== void 0 && event.currentTarget !== __privateGet$1(this, _fallbackListeners).target;
13486
+ }
13487
+ /** Every trace of a drag: the state the track-list publish is gated on, the cursor, the fallback. */
13488
+ endResize() {
13489
+ __privateSet$1(this, _resize, void 0);
13490
+ this.releaseFallbackListeners();
13491
+ this.setResizingClass(false);
13492
+ }
13493
+ handleResizeStart(event) {
13494
+ const handle = event.currentTarget;
13495
+ const field = handle.dataset.field;
13496
+ if (!field || !event.isPrimary || event.button !== 0 || __privateGet$1(this, _resize)) {
13497
+ return;
13498
+ }
13499
+ event.preventDefault();
13500
+ handle.focus();
13501
+ const startWidth = this.resolveColumnWidth(field);
13502
+ __privateSet$1(this, _resize, {
13503
+ field,
13504
+ pointerId: event.pointerId,
13505
+ startWidth,
13506
+ startX: event.clientX,
13507
+ width: startWidth
13508
+ });
13509
+ this.setResizingClass(true);
13510
+ try {
13511
+ handle.setPointerCapture(event.pointerId);
13512
+ } catch (e2) {
13513
+ this.bindFallbackListeners(handle.ownerDocument);
13514
+ }
13515
+ }
13516
+ /**
13517
+ * The track list a running drag owns, built against the columns rendering right now: the committed
13518
+ * widths with the drag's own preview over the top. Falls back to the committed list when no drag is
13519
+ * running, so one expression covers both.
13520
+ */
13521
+ get previewTemplateColumns() {
13522
+ if (!__privateGet$1(this, _resize)) {
13523
+ return this.templateColumns;
13524
+ }
13525
+ const preview = createColumnWidths(Object.entries(this.columnWidths));
13526
+ preview[__privateGet$1(this, _resize).field] = __privateGet$1(this, _resize).width;
13527
+ return this.buildTemplateColumns(preview);
13528
+ }
13529
+ /** Repaints the drag with one property write: no re-render, no layout read. */
13530
+ previewColumnWidth(width) {
13531
+ if (!__privateGet$1(this, _resize)) {
13532
+ return;
13533
+ }
13534
+ __privateGet$1(this, _resize).width = width;
13535
+ this.style.setProperty(TABLE_COLUMNS_PROPERTY, this.previewTemplateColumns);
13536
+ }
13537
+ handleResizeMove(event) {
13538
+ if (this.isHandledByFallback(event) || !__privateGet$1(this, _resize) || __privateGet$1(this, _resize).pointerId !== event.pointerId) {
13539
+ return;
13540
+ }
13541
+ this.previewColumnWidth(this.clampColumnWidth(
13542
+ __privateGet$1(this, _resize).startWidth + (event.clientX - __privateGet$1(this, _resize).startX)
13543
+ ));
13544
+ }
13545
+ handleResizeEnd(event) {
13546
+ if (this.isHandledByFallback(event) || !__privateGet$1(this, _resize) || __privateGet$1(this, _resize).pointerId !== event.pointerId) {
13547
+ return;
13548
+ }
13549
+ const { field, startWidth, width } = __privateGet$1(this, _resize);
13550
+ this.endResize();
13551
+ if (!this.columns.some((column2) => column2.field === field)) {
13552
+ this.style.setProperty(TABLE_COLUMNS_PROPERTY, this.templateColumns);
13553
+ return;
13554
+ }
13555
+ if (width !== startWidth) {
13556
+ this.commitColumnWidth(field, width);
13557
+ return;
13558
+ }
13559
+ this.style.setProperty(TABLE_COLUMNS_PROPERTY, this.templateColumns);
13560
+ }
13561
+ /**
13562
+ * A gesture the user agent took away was never a decision: restore the committed track list and
13563
+ * tell the host nothing.
13564
+ */
13565
+ handleResizeCancel(event) {
13566
+ if (this.isHandledByFallback(event) || !__privateGet$1(this, _resize) || __privateGet$1(this, _resize).pointerId !== event.pointerId) {
13567
+ return;
13568
+ }
13569
+ this.endResize();
13570
+ this.style.setProperty(TABLE_COLUMNS_PROPERTY, this.templateColumns);
13571
+ }
13572
+ handleResizeKeyDown(event) {
13573
+ const handle = event.currentTarget;
13574
+ const field = handle.dataset.field;
13575
+ if (!field) {
13576
+ return;
13577
+ }
13578
+ if (event.key === "Home") {
13579
+ event.preventDefault();
13580
+ this.commitColumnWidth(field, void 0);
13581
+ return;
13582
+ }
13583
+ const step = event.shiftKey ? COLUMN_RESIZE_STEP_LARGE : COLUMN_RESIZE_STEP;
13584
+ const delta = event.key === "ArrowLeft" ? -step : event.key === "ArrowRight" ? step : 0;
13585
+ if (!delta) {
13586
+ return;
13587
+ }
13588
+ event.preventDefault();
13589
+ const startWidth = this.resolveColumnWidth(field);
13590
+ const width = this.clampColumnWidth(startWidth + delta);
13591
+ if (width === startWidth) {
13592
+ return;
13593
+ }
13594
+ this.commitColumnWidth(field, width);
13595
+ }
13596
+ handleResizeReset(event) {
13597
+ const field = event.currentTarget.dataset.field;
13598
+ if (field) {
13599
+ this.commitColumnWidth(field, void 0);
13600
+ }
13601
+ }
13602
+ renderResizeHandle(column2) {
13603
+ const pinned = this.columnWidths[column2.field];
13604
+ return b`
13605
+ <div
13606
+ class="content-browser-table__resize"
13607
+ role="separator"
13608
+ aria-orientation="vertical"
13609
+ aria-label=${this.localize.term("resize")}
13610
+ aria-valuemin=${MIN_COLUMN_WIDTH}
13611
+ aria-valuemax=${MAX_COLUMN_WIDTH}
13612
+ aria-valuenow=${o$5(pinned)}
13613
+ tabindex="0"
13614
+ data-field=${column2.field}
13615
+ @pointerdown=${this.handleResizeStart}
13616
+ @pointermove=${this.handleResizeMove}
13617
+ @pointerup=${this.handleResizeEnd}
13618
+ @pointercancel=${this.handleResizeCancel}
13619
+ @lostpointercapture=${this.handleResizeEnd}
13620
+ @dblclick=${this.handleResizeReset}
13621
+ @keydown=${this.handleResizeKeyDown}
13622
+ ></div>
13623
+ `;
13624
+ }
13625
+ handleColumnsChange() {
13626
+ const fields = new Set(this.columns.map((column2) => column2.field));
13627
+ const kept = Object.entries(this.columnWidths).filter(([field]) => fields.has(field));
13628
+ if (kept.length !== Object.keys(this.columnWidths).length) {
13629
+ this.columnWidths = createColumnWidths(kept);
13630
+ }
13631
+ }
13632
+ updated() {
13633
+ this.style.setProperty(TABLE_COLUMNS_PROPERTY, this.previewTemplateColumns);
13634
+ }
13635
+ disconnectedCallback() {
13636
+ super.disconnectedCallback();
13637
+ this.endResize();
13638
+ }
13639
+ handleAssetsChange() {
13640
+ this.assetMap.clear();
13641
+ this.assets.forEach((item) => this.assetMap.set(item.id, item));
13642
+ this.scrollAnchorController.scheduleRestore();
13643
+ }
13644
+ handleResize(event) {
13645
+ event.stopPropagation();
13646
+ const entries = event.detail.entries;
13647
+ if (entries[0].target !== this.containerEl) {
13648
+ return;
13649
+ }
13650
+ this.scrollAnchorController.capture();
13651
+ this.debouncedCalculatePageSize(entries[0].contentRect.height);
13652
+ }
13653
+ calculatePageSize(height) {
13654
+ if (Math.abs(__privateGet$1(this, _lastHeight) - height) < 10) {
13655
+ return;
13656
+ }
13657
+ __privateSet$1(this, _lastHeight, height);
13658
+ this.scrollAnchorController.setLayoutMetrics({
13659
+ columnCount: 1,
13660
+ itemHeight: ROW_HEIGHT
13661
+ });
13662
+ this.emit("cx-content-browser-grid-resize", {
13663
+ detail: {
13664
+ columnCount: 1,
13665
+ rowCount: Math.ceil(height / ROW_HEIGHT)
13666
+ }
13667
+ });
13668
+ this.scrollAnchorController.scheduleRestore();
13669
+ }
13670
+ selectRow(assetId) {
13671
+ var _a2;
13672
+ if (!assetId || ((_a2 = this.assetMap.get(assetId)) == null ? void 0 : _a2.inColdStorage)) {
13673
+ return;
13674
+ }
13675
+ this.emit("cx-content-browser-grid-click", {
13676
+ detail: {
13677
+ id: assetId
13678
+ }
13679
+ });
13680
+ }
13681
+ handleRowClick(event) {
13682
+ var _a2;
13683
+ this.selectRow((_a2 = event.currentTarget.dataset.id) != null ? _a2 : "");
13684
+ }
13685
+ handleActionClick(event) {
13686
+ var _a2;
13687
+ event.stopPropagation();
13688
+ this.selectRow((_a2 = event.currentTarget.dataset.id) != null ? _a2 : "");
13689
+ }
13690
+ handleRowKeyDown(event) {
13691
+ var _a2;
13692
+ if (event.key !== "Enter" && event.key !== " ") {
13693
+ return;
13694
+ }
13695
+ event.preventDefault();
13696
+ this.selectRow((_a2 = event.currentTarget.dataset.id) != null ? _a2 : "");
13697
+ }
13698
+ /**
13699
+ * @param assetId - omitted for the header's sizing twin, which is inert and never announced.
13700
+ */
13701
+ renderActionButton(assetId) {
13702
+ const isPlaceholder = assetId === void 0;
13703
+ const isBusy = !isPlaceholder && assetId === this.busyAssetId;
13704
+ return b`
13705
+ <cx-button
13706
+ class=${e$5({
13707
+ "content-browser-table__action": true,
13708
+ "content-browser-table__action--busy": isBusy,
13709
+ "content-browser-table__action--placeholder": isPlaceholder
13710
+ })}
13711
+ data-id=${o$5(assetId)}
13712
+ size="small"
13713
+ variant="primary"
13714
+ tabindex="-1"
13715
+ ?loading=${isBusy}
13716
+ aria-hidden=${isPlaceholder ? "true" : "false"}
13717
+ @click=${isPlaceholder ? A$1 : this.handleActionClick}
13718
+ >
13719
+ <span style=${o$2({ textTransform: this.ctaTextTransform })}>
13720
+ ${this.ctaText || this.localize.term("insert")}
13721
+ </span>
13722
+ </cx-button>
13723
+ `;
13724
+ }
13725
+ /**
13726
+ * Bound fresh on every render at the call site, deliberately. `lit-virtualizer` re-runs this only
13727
+ * when `items` or `renderItem` change identity, and the selected id lives on neither — with a
13728
+ * stable reference the rows keep their first render and the selected row is never marked. A new
13729
+ * `items` array alone does not do it; the function identity is what the virtualizer acts on.
13730
+ */
13731
+ renderRow(asset) {
13732
+ if (!asset) {
13733
+ return A$1;
13734
+ }
13735
+ return b`
13736
+ <div
13737
+ class=${e$5({
13738
+ "content-browser-table__row": true,
13739
+ "content-browser-table__row--disabled": Boolean(asset.inColdStorage),
13740
+ "content-browser-table__row--selected": asset.id === this.selectedAssetId
13741
+ })}
13742
+ data-id=${asset.id}
13743
+ role="row"
13744
+ tabindex=${asset.inColdStorage ? -1 : 0}
13745
+ aria-current=${asset.id === this.selectedAssetId ? "true" : "false"}
13746
+ style=${o$2({
13747
+ "min-height": `${ROW_HEIGHT}px`
13748
+ })}
13749
+ @click=${this.handleRowClick}
13750
+ @keydown=${this.handleRowKeyDown}
13751
+ >
13752
+ ${c$1(
13753
+ this.columns,
13754
+ (column2, index) => `${column2.field}:${index}`,
13755
+ (column2) => {
13756
+ var _a2;
13757
+ return b`
13758
+ <div
13759
+ class=${e$5({
13760
+ "content-browser-table__cell": true,
13761
+ [`content-browser-table__cell--${column2.align}`]: Boolean(column2.align)
13762
+ })}
13763
+ role="cell"
13764
+ >
13765
+ <cx-line-clamp lines=${(_a2 = column2.lines) != null ? _a2 : 1}>
13766
+ <cx-typography variant="body3">${readCellValue(asset, column2.field)}</cx-typography>
13767
+ </cx-line-clamp>
13768
+ </div>
13769
+ `;
13770
+ }
13771
+ )}
13772
+ <div class="content-browser-table__cell content-browser-table__cell--action" role="cell">
13773
+ ${this.renderActionButton(asset.id)}
13774
+ </div>
13775
+ </div>
13776
+ `;
13777
+ }
13778
+ handleScroll(event) {
13779
+ const container = event.target;
13780
+ this.scrollAnchorController.capture(container);
13781
+ const scrolledVertically = container.scrollTop !== __privateGet$1(this, _lastScrollTop);
13782
+ __privateSet$1(this, _lastScrollTop, container.scrollTop);
13783
+ if (!scrolledVertically) {
13784
+ return;
13785
+ }
13786
+ if (container.scrollTop + container.clientHeight >= container.scrollHeight - 10) {
13787
+ this.debouncedHandleScrollEnd();
13788
+ }
13789
+ }
13790
+ handleScrollEnd() {
13791
+ if (this.hasMore) {
13792
+ this.emit("cx-content-browser-grid-scroll-end");
13793
+ }
13794
+ }
13795
+ render() {
13796
+ return b`
13797
+ <div
13798
+ class="content-browser-table-loading"
13799
+ style=${o$2({
13800
+ opacity: this.loading ? 1 : 0
13801
+ })}
13802
+ >
13803
+ <cx-progress-bar indeterminate></cx-progress-bar>
13804
+ </div>
13805
+ <cx-resize-observer @cx-resize=${this.handleResize}>
13806
+ <div
13807
+ class="content-browser-table"
13808
+ role="table"
13809
+ @scroll=${this.handleScroll}
13810
+ >
13811
+ <div class="content-browser-table__head" role="rowgroup">
13812
+ <div
13813
+ class="content-browser-table__header"
13814
+ role="row"
13815
+ >
13816
+ ${c$1(
13817
+ this.columns,
13818
+ (column2) => column2.field,
13819
+ (column2) => b`
13820
+ <div
13821
+ class=${e$5({
13822
+ "content-browser-table__cell": true,
13823
+ [`content-browser-table__cell--${column2.align}`]: Boolean(column2.align)
13824
+ })}
13825
+ role="columnheader"
13826
+ data-field=${column2.field}
13827
+ >
13828
+ <cx-line-clamp lines="1">
13829
+ <cx-typography variant="small">${column2.title}</cx-typography>
13830
+ </cx-line-clamp>
13831
+ ${this.renderResizeHandle(column2)}
13832
+ </div>
13833
+ `
13834
+ )}
13835
+ <div
13836
+ class="content-browser-table__cell content-browser-table__cell--action"
13837
+ role="columnheader"
13838
+ aria-label=${this.ctaText || this.localize.term("insert")}
13839
+ >
13840
+ ${this.renderActionButton(void 0)}
13841
+ </div>
13842
+ </div>
13843
+ </div>
13844
+ ${n$5(
13845
+ this.empty,
13846
+ () => b`
13847
+ <cx-content-browser-no-result
13848
+ class="content-browser-table__empty"
13849
+ icon="search_off"
13850
+ message=${this.localize.term("noResults")}
13851
+ ></cx-content-browser-no-result>
13852
+ `,
13853
+ // Deliberately not a `scroller`: the table container scrolls both axes, so the
13854
+ // virtualizer sizes itself to the whole list and reacts to that ancestor's scrolling.
13855
+ // One scrollport is what keeps the header and the rows on one horizontal offset.
13856
+ () => b`
13857
+ <lit-virtualizer
13858
+ class="content-browser-table__body"
13859
+ role="rowgroup"
13860
+ .items=${this.assets}
13861
+ .renderItem=${(asset) => this.renderRow(asset)}
13862
+ ></lit-virtualizer>
13863
+ `
13864
+ )}
13865
+ </div>
13866
+ </cx-resize-observer>
13867
+ `;
13868
+ }
13869
+ };
13870
+ _lastHeight = /* @__PURE__ */ new WeakMap();
13871
+ _lastScrollTop = /* @__PURE__ */ new WeakMap();
13872
+ _resize = /* @__PURE__ */ new WeakMap();
13873
+ _fallbackListeners = /* @__PURE__ */ new WeakMap();
13874
+ CxContentBrowserTable.styles = [componentStyles, styles$1];
13875
+ CxContentBrowserTable.dependencies = {
13876
+ "cx-button": CxButton,
13877
+ "cx-content-browser-no-result": CxContentBrowserNoResult,
13878
+ "cx-line-clamp": CxLineClamp,
13879
+ "cx-progress-bar": CxProgressBar,
13880
+ "cx-resize-observer": CxResizeObserver,
13881
+ "cx-typography": CxTypography
13882
+ };
13883
+ __decorateClass$1([
13884
+ e$7(".content-browser-table")
13885
+ ], CxContentBrowserTable.prototype, "containerEl", 2);
13886
+ __decorateClass$1([
13887
+ e$7(".content-browser-table__head")
13888
+ ], CxContentBrowserTable.prototype, "headEl", 2);
13889
+ __decorateClass$1([
13890
+ e$7("lit-virtualizer")
13891
+ ], CxContentBrowserTable.prototype, "bodyEl", 2);
13892
+ __decorateClass$1([
13893
+ n$6({ attribute: "assets", reflect: false, type: Array })
13894
+ ], CxContentBrowserTable.prototype, "assets", 2);
13895
+ __decorateClass$1([
13896
+ n$6({ attribute: "columns", reflect: false, type: Array })
13897
+ ], CxContentBrowserTable.prototype, "columns", 2);
13898
+ __decorateClass$1([
13899
+ n$6({ attribute: "cta-text", reflect: false, type: String })
13900
+ ], CxContentBrowserTable.prototype, "ctaText", 2);
13901
+ __decorateClass$1([
13902
+ n$6({ attribute: "cta-text-transform", reflect: false, type: String })
13903
+ ], CxContentBrowserTable.prototype, "ctaTextTransform", 2);
13904
+ __decorateClass$1([
13905
+ n$6({ attribute: "empty", reflect: true, type: Boolean })
13906
+ ], CxContentBrowserTable.prototype, "empty", 2);
13907
+ __decorateClass$1([
13908
+ n$6({ attribute: "has-more", reflect: true, type: Boolean })
13909
+ ], CxContentBrowserTable.prototype, "hasMore", 2);
13910
+ __decorateClass$1([
13911
+ n$6({ attribute: "loading", reflect: true, type: Boolean })
13912
+ ], CxContentBrowserTable.prototype, "loading", 2);
13913
+ __decorateClass$1([
13914
+ n$6({ attribute: "selected-asset-id", reflect: true, type: String })
13915
+ ], CxContentBrowserTable.prototype, "selectedAssetId", 2);
13916
+ __decorateClass$1([
13917
+ n$6({ attribute: false })
13918
+ ], CxContentBrowserTable.prototype, "busyAssetId", 2);
13919
+ __decorateClass$1([
13920
+ r$6()
13921
+ ], CxContentBrowserTable.prototype, "assetMap", 2);
13922
+ __decorateClass$1([
13923
+ r$6()
13924
+ ], CxContentBrowserTable.prototype, "columnWidths", 2);
13925
+ __decorateClass$1([
13926
+ watch("columns", { waitUntilFirstUpdate: true })
13927
+ ], CxContentBrowserTable.prototype, "handleColumnsChange", 1);
13928
+ __decorateClass$1([
13929
+ watch("assets")
13930
+ ], CxContentBrowserTable.prototype, "handleAssetsChange", 1);
13931
+ CxContentBrowserTable = __decorateClass$1([
13932
+ customElement("cx-content-browser-table")
13933
+ ], CxContentBrowserTable);
12838
13934
  const appendPathAndQuery = (baseUrl, pathSuffix, extraQueryParams = []) => {
12839
13935
  const questionMarkIndex = baseUrl.indexOf("?");
12840
13936
  const hashIndex = baseUrl.indexOf("#");
@@ -13223,8 +14319,26 @@ function apiGetAssetsByIDs(_0) {
13223
14319
  }
13224
14320
  });
13225
14321
  }
14322
+ const ASSET_LIST_FIELDS = [
14323
+ DEFAULT_VIEW_SIZE,
14324
+ FIELD_DOC_TYPE,
14325
+ FIELD_EXTENSION,
14326
+ FIELD_FILE_SIZE,
14327
+ FIELD_IDENTIFIER,
14328
+ FIELD_KEYWORDS,
14329
+ FIELD_MAX_HEIGHT,
14330
+ FIELD_MAX_WIDTH,
14331
+ FIELD_ORIGINAL_FILE_NAME,
14332
+ FIELD_RECORD_ID,
14333
+ FIELD_SUBTYPE,
14334
+ FIELD_TITLE_WITH_FALLBACK,
14335
+ FIELD_UPDATED_FILE_NAME,
14336
+ FIELD_STORAGE_GROUP,
14337
+ ORIGINAL_VIEW_SIZE
14338
+ ];
13226
14339
  function apiGetAssets(_0) {
13227
14340
  return __async(this, arguments, function* ({
14341
+ fields,
13228
14342
  folderId,
13229
14343
  isSeeThrough,
13230
14344
  limitedToDocTypes = [],
@@ -13235,25 +14349,17 @@ function apiGetAssets(_0) {
13235
14349
  start,
13236
14350
  useSession
13237
14351
  }) {
14352
+ var _a2;
14353
+ const validatedFields = (_a2 = fields == null ? void 0 : fields.filter((field) => field && typeof field === "string")) != null ? _a2 : [];
13238
14354
  try {
13239
14355
  const response = yield http.request({
13240
14356
  data: __spreadValues({
13241
14357
  Fields: [
13242
- DEFAULT_VIEW_SIZE,
13243
- FIELD_DOC_TYPE,
13244
- FIELD_EXTENSION,
13245
- FIELD_FILE_SIZE,
13246
- FIELD_IDENTIFIER,
13247
- FIELD_KEYWORDS,
13248
- FIELD_MAX_HEIGHT,
13249
- FIELD_MAX_WIDTH,
13250
- FIELD_ORIGINAL_FILE_NAME,
13251
- FIELD_RECORD_ID,
13252
- FIELD_SUBTYPE,
13253
- FIELD_TITLE_WITH_FALLBACK,
13254
- FIELD_UPDATED_FILE_NAME,
13255
- FIELD_STORAGE_GROUP,
13256
- ORIGINAL_VIEW_SIZE
14358
+ ...ASSET_LIST_FIELDS,
14359
+ ...validatedFields.filter((field, index) => {
14360
+ const seen = [...ASSET_LIST_FIELDS, ...validatedFields.slice(0, index)];
14361
+ return !seen.some((item) => item.toLowerCase() === field.toLowerCase());
14362
+ })
13257
14363
  ],
13258
14364
  Limit: pageSize || void 0,
13259
14365
  LimitedToDocTypes: limitedToDocTypes,
@@ -13269,15 +14375,22 @@ function apiGetAssets(_0) {
13269
14375
  transformResponse: [
13270
14376
  ...Array.isArray(http.defaults.transformResponse) ? http.defaults.transformResponse : [],
13271
14377
  (rawResponse) => {
13272
- var _a2, _b2;
13273
- const mappedItems = (_b2 = (_a2 = rawResponse.contentItems) == null ? void 0 : _a2.map((item) => {
13274
- var _a3, _b3, _c2, _d2, _e3, _f2, _g, _h, _i, _j, _k, _l;
13275
- let extension = (_a3 = item.fields[FIELD_EXTENSION]) != null ? _a3 : "";
14378
+ var _a3, _b2;
14379
+ const mappedItems = (_b2 = (_a3 = rawResponse.contentItems) == null ? void 0 : _a3.map((item) => {
14380
+ var _a4, _b3, _c2, _d2, _e3, _f2, _g, _h, _i, _j, _k, _l;
14381
+ let extension = (_a4 = item.fields[FIELD_EXTENSION]) != null ? _a4 : "";
13276
14382
  const name = item.fields[FIELD_TITLE_WITH_FALLBACK];
13277
14383
  if (extension && !extension.startsWith(".")) {
13278
14384
  extension = "." + extension;
13279
14385
  }
13280
- return {
14386
+ return __spreadProps(__spreadValues({}, validatedFields.reduce((acc, field) => {
14387
+ var _a5, _b4;
14388
+ const sourceField = (_a5 = ASSET_LIST_FIELDS.find(
14389
+ (defaultField) => defaultField.toLowerCase() === field.toLowerCase()
14390
+ )) != null ? _a5 : field;
14391
+ acc[field] = (_b4 = item.fields[sourceField]) != null ? _b4 : "";
14392
+ return acc;
14393
+ }, {})), {
13281
14394
  allowATSLink: item.fields[FIELD_ALLOW_ATS_LINK] === "True",
13282
14395
  docSubType: (_b3 = item.fields[FIELD_SUBTYPE]) != null ? _b3 : "",
13283
14396
  docType: (_c2 = item.fields[FIELD_DOC_TYPE]) != null ? _c2 : "",
@@ -13294,7 +14407,7 @@ function apiGetAssets(_0) {
13294
14407
  size: (_j = item.fields[FIELD_FILE_SIZE]) != null ? _j : "0 MB",
13295
14408
  tags: (_k = item.fields[FIELD_KEYWORDS]) != null ? _k : "",
13296
14409
  width: (_l = item.fields[FIELD_MAX_WIDTH]) != null ? _l : "0"
13297
- };
14410
+ });
13298
14411
  })) != null ? _b2 : [];
13299
14412
  return {
13300
14413
  facets: rawResponse.facets,
@@ -13769,6 +14882,7 @@ var intersection = baseRest(function(arrays) {
13769
14882
  });
13770
14883
  class FetchAndMergeAssetsController {
13771
14884
  constructor(host, {
14885
+ additionalFields,
13772
14886
  availableDocTypes,
13773
14887
  baseUrl,
13774
14888
  defaultFolderId,
@@ -13810,6 +14924,7 @@ class FetchAndMergeAssetsController {
13810
14924
  this._debounceResolve = null;
13811
14925
  this.host = host;
13812
14926
  this.availableDocTypes = availableDocTypes;
14927
+ this.additionalFields = additionalFields != null ? additionalFields : [];
13813
14928
  this.defaultFolderId = defaultFolderId;
13814
14929
  this.defaultIsSeeThrough = defaultIsSeeThrough;
13815
14930
  this.defaultSearchText = defaultSearchText;
@@ -13940,6 +15055,14 @@ class FetchAndMergeAssetsController {
13940
15055
  }
13941
15056
  this.host.requestUpdate();
13942
15057
  }
15058
+ /**
15059
+ * Table columns are host configuration and can be reconfigured after mount, unlike the rest of
15060
+ * these options — every later fetch must ask for the current field list, not the one that
15061
+ * happened to be set when the controller was constructed.
15062
+ */
15063
+ updateAdditionalFields(additionalFields) {
15064
+ this.additionalFields = additionalFields;
15065
+ }
13943
15066
  updateAuth(token2, useSession) {
13944
15067
  if (this.useSiteSession) {
13945
15068
  return;
@@ -14080,6 +15203,7 @@ class FetchAndMergeAssetsController {
14080
15203
  }
14081
15204
  }
14082
15205
  request = __spreadProps(__spreadValues({}, request), {
15206
+ fields: this.additionalFields,
14083
15207
  limitedToDocTypes: this.availableDocTypes
14084
15208
  });
14085
15209
  this.lastRequest = request;
@@ -14347,6 +15471,9 @@ const styles = i$7`
14347
15471
  `;
14348
15472
  var __defProp2 = Object.defineProperty;
14349
15473
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
15474
+ var __typeError2 = (msg) => {
15475
+ throw TypeError(msg);
15476
+ };
14350
15477
  var __decorateClass = (decorators, target, key, kind) => {
14351
15478
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
14352
15479
  for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
@@ -14355,10 +15482,26 @@ var __decorateClass = (decorators, target, key, kind) => {
14355
15482
  if (kind && result) __defProp2(target, key, result);
14356
15483
  return result;
14357
15484
  };
15485
+ var __accessCheck2 = (obj, member, msg) => member.has(obj) || __typeError2("Cannot " + msg);
15486
+ var __privateGet2 = (obj, member, getter) => (__accessCheck2(obj, member, "read from private field"), member.get(obj));
15487
+ var __privateAdd2 = (obj, member, value) => member.has(obj) ? __typeError2("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
15488
+ var __privateSet2 = (obj, member, value, setter) => (__accessCheck2(obj, member, "write to private field"), member.set(obj, value), value);
15489
+ var _openingAsset, _insertInFlight;
14358
15490
  const COMPUTED_FIELDS = ["ScrubUrl", "AllowATSLink"];
14359
15491
  const MOBILE_WIDTH_THRESHOLD = 480;
14360
15492
  const FORCE_OVERLAY_THRESHOLD = 650;
14361
15493
  const PERSISTENT_DRAWER_WIDTH = 400;
15494
+ function resolvePageSize(view) {
15495
+ switch (view) {
15496
+ case GridView$1.Large:
15497
+ return 15;
15498
+ case GridView$1.Small:
15499
+ case TABLE_VIEW:
15500
+ return 30;
15501
+ default:
15502
+ return 20;
15503
+ }
15504
+ }
14362
15505
  let CxContentBrowser = class extends CortexElement {
14363
15506
  constructor() {
14364
15507
  super(...arguments);
@@ -14384,6 +15527,7 @@ let CxContentBrowser = class extends CortexElement {
14384
15527
  this.canFavorite = false;
14385
15528
  this.canPinAsset = false;
14386
15529
  this.canUseProxies = false;
15530
+ this.autoSelectFormat = false;
14387
15531
  this.simplePick = false;
14388
15532
  this.canViewVersions = false;
14389
15533
  this.canTrack = false;
@@ -14392,6 +15536,7 @@ let CxContentBrowser = class extends CortexElement {
14392
15536
  this.ctaTextTransform = "capitalize";
14393
15537
  this.extraFields = [];
14394
15538
  this.defaultGridView = GridView$1.Medium;
15539
+ this.tableColumns = [];
14395
15540
  this.defaultSortOrderName = "";
14396
15541
  this.defaultSortDirection = "ascending";
14397
15542
  this.defaultSelectedFacets = {};
@@ -14429,28 +15574,40 @@ let CxContentBrowser = class extends CortexElement {
14429
15574
  this.selectedAssetId = void 0;
14430
15575
  this.isMobile = false;
14431
15576
  this.defaultPageSize = 10;
15577
+ this.busyAssetId = void 0;
15578
+ __privateAdd2(this, _openingAsset, false);
15579
+ __privateAdd2(this, _insertInFlight, false);
14432
15580
  }
14433
15581
  willUpdate(changedProperties) {
14434
15582
  super.willUpdate(changedProperties);
14435
15583
  if (!this.hasUpdated) {
14436
- this.view = this.defaultGridView;
15584
+ this.view = this.defaultGridView === TABLE_VIEW && !this.canUseTable ? GridView$1.Medium : this.defaultGridView;
15585
+ }
15586
+ }
15587
+ /**
15588
+ * Never trust the host's value: it also arrives by direct property assignment, past the converter.
15589
+ * Entries are checked one by one, not just the outer array — `field` is dereferenced while the
15590
+ * fetch controller is being built, where a throw leaves the controller unassigned and the picker
15591
+ * blank. `title` is only rendered, and Lit renders a nullish one as nothing, so a column is not
15592
+ * worth dropping over it.
15593
+ */
15594
+ get tableColumnList() {
15595
+ const columns = this.tableColumns;
15596
+ if (!Array.isArray(columns)) {
15597
+ return [];
14437
15598
  }
15599
+ return columns.filter((column2) => {
15600
+ return !!column2 && typeof column2 === "object" && typeof column2.field === "string" && column2.field.length > 0;
15601
+ });
15602
+ }
15603
+ get canUseTable() {
15604
+ return this.tableColumnList.length > 0;
14438
15605
  }
14439
15606
  runFirstUpdated() {
14440
15607
  if (this.useSiteSession) {
14441
15608
  this.baseUrl = resolveSiteSessionUrl(this.baseUrl);
14442
15609
  }
14443
- switch (this.view) {
14444
- case GridView$1.Large:
14445
- this.defaultPageSize = 15;
14446
- break;
14447
- case GridView$1.Medium:
14448
- this.defaultPageSize = 20;
14449
- break;
14450
- case GridView$1.Small:
14451
- this.defaultPageSize = 30;
14452
- break;
14453
- }
15610
+ this.defaultPageSize = resolvePageSize(this.view);
14454
15611
  this.lastRequest = __spreadProps(__spreadValues({}, this.lastRequest), {
14455
15612
  folderId: this.defaultFolderId,
14456
15613
  isSeeThrough: this.defaultIsSeeThrough,
@@ -14461,6 +15618,7 @@ let CxContentBrowser = class extends CortexElement {
14461
15618
  });
14462
15619
  this.updateComplete.then(() => {
14463
15620
  this.fetchAndMergeAssetsController = new FetchAndMergeAssetsController(this, {
15621
+ additionalFields: this.tableColumnList.map((column2) => column2.field),
14464
15622
  availableDocTypes: this.availableDocTypes,
14465
15623
  baseUrl: this.baseUrl,
14466
15624
  defaultFolderId: this.defaultFolderId,
@@ -14500,7 +15658,12 @@ let CxContentBrowser = class extends CortexElement {
14500
15658
  }
14501
15659
  openFormatDialog(id) {
14502
15660
  return __async(this, null, function* () {
15661
+ if (__privateGet2(this, _openingAsset) || __privateGet2(this, _insertInFlight)) {
15662
+ return;
15663
+ }
15664
+ __privateSet2(this, _openingAsset, true);
14503
15665
  this.selectedAssetId = id;
15666
+ this.busyAssetId = id;
14504
15667
  try {
14505
15668
  const asset = yield this.fetchAndMergeAssetsController.fetchAssetByID(id, {
14506
15669
  canFavorite: this.canFavorite,
@@ -14508,6 +15671,7 @@ let CxContentBrowser = class extends CortexElement {
14508
15671
  });
14509
15672
  if (!asset) {
14510
15673
  this.selectedAssetId = void 0;
15674
+ this.busyAssetId = void 0;
14511
15675
  return;
14512
15676
  }
14513
15677
  let isAssetPinned = false;
@@ -14518,8 +15682,14 @@ let CxContentBrowser = class extends CortexElement {
14518
15682
  isAssetPinned = lookupEvent.detail.isAssetPinned;
14519
15683
  }
14520
15684
  this.formatDialog.open(__spreadProps(__spreadValues({}, asset), { isAssetPinned }));
15685
+ if (this.formatDialog.isDialogOpen) {
15686
+ this.busyAssetId = void 0;
15687
+ }
14521
15688
  } catch (e2) {
14522
15689
  this.selectedAssetId = void 0;
15690
+ this.busyAssetId = void 0;
15691
+ } finally {
15692
+ __privateSet2(this, _openingAsset, false);
14523
15693
  }
14524
15694
  });
14525
15695
  }
@@ -14533,6 +15703,16 @@ let CxContentBrowser = class extends CortexElement {
14533
15703
  });
14534
15704
  });
14535
15705
  }
15706
+ handleTableColumnsChange() {
15707
+ if (!this.fetchAndMergeAssetsController) {
15708
+ return;
15709
+ }
15710
+ this.fetchAndMergeAssetsController.updateAdditionalFields(
15711
+ this.tableColumnList.map((column2) => column2.field)
15712
+ );
15713
+ this.lastRequest = __spreadProps(__spreadValues({}, this.lastRequest), { start: 0 });
15714
+ void this.fetchAndMergeAssetsController.fetchAndMergeAssets(this.lastRequest);
15715
+ }
14536
15716
  handleAuthChange() {
14537
15717
  var _a2;
14538
15718
  (_a2 = this.fetchAndMergeAssetsController) == null ? void 0 : _a2.updateAuth(this.token, this.useSession);
@@ -14590,17 +15770,7 @@ let CxContentBrowser = class extends CortexElement {
14590
15770
  });
14591
15771
  yield this.fetchAndMergeAssetsController.fetchAndMergeAssets(this.lastRequest);
14592
15772
  }
14593
- switch (event.detail.view) {
14594
- case GridView$1.Large:
14595
- this.defaultPageSize = 15;
14596
- break;
14597
- case GridView$1.Medium:
14598
- this.defaultPageSize = 20;
14599
- break;
14600
- case GridView$1.Small:
14601
- this.defaultPageSize = 30;
14602
- break;
14603
- }
15773
+ this.defaultPageSize = resolvePageSize(event.detail.view);
14604
15774
  this.view = event.detail.view;
14605
15775
  });
14606
15776
  }
@@ -14720,15 +15890,17 @@ let CxContentBrowser = class extends CortexElement {
14720
15890
  selectedProxyMetadata: event.detail.selectedProxyMetadata
14721
15891
  });
14722
15892
  this.formatDialog.hide();
15893
+ this.busyAssetId = void 0;
14723
15894
  return;
14724
15895
  }
15896
+ __privateSet2(this, _insertInFlight, true);
14725
15897
  try {
14726
15898
  const response = yield this.fetchAndMergeAssetsController.getAssetLink(__spreadProps(__spreadValues({}, event.detail), {
14727
15899
  assets: [event.detail.asset],
14728
15900
  extraFields: this.extraFields
14729
15901
  }));
14730
15902
  if (response.isError) {
14731
- this.formatDialog.setLoadingConfirm(false);
15903
+ this.reportProxyConfirmFailure();
14732
15904
  return;
14733
15905
  }
14734
15906
  this.handleSelectedAsset({
@@ -14738,12 +15910,23 @@ let CxContentBrowser = class extends CortexElement {
14738
15910
  });
14739
15911
  this.formatDialog.hide();
14740
15912
  } catch (e2) {
14741
- this.formatDialog.setLoadingConfirm(false);
15913
+ this.reportProxyConfirmFailure();
15914
+ } finally {
15915
+ __privateSet2(this, _insertInFlight, false);
15916
+ this.busyAssetId = void 0;
14742
15917
  }
14743
15918
  });
14744
15919
  }
15920
+ reportProxyConfirmFailure() {
15921
+ if (this.formatDialog.isDialogOpen) {
15922
+ this.formatDialog.setLoadingConfirm(false);
15923
+ return;
15924
+ }
15925
+ this.formatDialog.revealAfterAutoConfirm();
15926
+ }
14745
15927
  handleFormatConfirm(event) {
14746
15928
  return __async(this, null, function* () {
15929
+ __privateSet2(this, _insertInFlight, true);
14747
15930
  try {
14748
15931
  const response = yield this.fetchAndMergeAssetsController.getAssetLink(__spreadProps(__spreadValues({}, event.detail), {
14749
15932
  assets: [event.detail.asset],
@@ -14762,6 +15945,9 @@ let CxContentBrowser = class extends CortexElement {
14762
15945
  this.formatDialog.hide();
14763
15946
  } catch (e2) {
14764
15947
  this.formatDialog.setLoadingConfirm(false);
15948
+ } finally {
15949
+ __privateSet2(this, _insertInFlight, false);
15950
+ this.busyAssetId = void 0;
14765
15951
  }
14766
15952
  });
14767
15953
  }
@@ -14907,6 +16093,7 @@ let CxContentBrowser = class extends CortexElement {
14907
16093
  .newlyChangedOption=${this.newlyChangedOption}
14908
16094
  .sortOrders=${sortOrders}
14909
16095
  .views=${this.views}
16096
+ ?can-use-table=${this.canUseTable}
14910
16097
  ?is-mobile=${this.isMobile}
14911
16098
  ?is-see-through=${request == null ? void 0 : request.isSeeThrough}
14912
16099
  ?loading=${loading}
@@ -14922,20 +16109,45 @@ let CxContentBrowser = class extends CortexElement {
14922
16109
  @cx-content-browser-control-filter-change=${this.handleFilterChange}
14923
16110
  @cx-content-browser-control-bar-search-change=${this.handleSearchChange}
14924
16111
  ></cx-content-browser-control-bar>
14925
- <cx-content-browser-grid
14926
- .assets=${items}
14927
- ?has-more=${items.length < totalCount}
14928
- ?loading=${loading}
14929
- ?show-title=${this.showTitle}
14930
- ?show-size=${this.showSize}
14931
- ?show-dimensions=${this.showDimensions}
14932
- ?show-tags=${this.showTags}
14933
- selected-asset-id=${o$5(this.selectedAssetId || void 0)}
14934
- view=${this.view}
14935
- @cx-content-browser-grid-scroll-end=${this.handleScrollEnd}
14936
- @cx-content-browser-grid-resize=${this.handleGridResize}
14937
- @cx-content-browser-grid-click=${this.handleGridClick}
14938
- ></cx-content-browser-grid>
16112
+ ${n$5(
16113
+ this.view === TABLE_VIEW && this.canUseTable,
16114
+ () => b`
16115
+ <cx-content-browser-table
16116
+ .busyAssetId=${this.busyAssetId}
16117
+ .assets=${items}
16118
+ .columns=${this.tableColumnList}
16119
+ ?empty=${!loading && items.length === 0}
16120
+ cta-text=${this.ctaText}
16121
+ cta-text-transform=${this.ctaTextTransform}
16122
+ ?has-more=${items.length < totalCount}
16123
+ ?loading=${loading}
16124
+ selected-asset-id=${o$5(this.selectedAssetId || void 0)}
16125
+ @cx-content-browser-grid-scroll-end=${this.handleScrollEnd}
16126
+ @cx-content-browser-grid-resize=${this.handleGridResize}
16127
+ @cx-content-browser-grid-click=${this.handleGridClick}
16128
+ ></cx-content-browser-table>
16129
+ `,
16130
+ () => b`
16131
+ <cx-content-browser-grid
16132
+ .assets=${items}
16133
+ ?has-more=${items.length < totalCount}
16134
+ ?loading=${loading}
16135
+ ?show-title=${this.showTitle}
16136
+ ?show-size=${this.showSize}
16137
+ ?show-dimensions=${this.showDimensions}
16138
+ ?show-tags=${this.showTags}
16139
+ ?show-cta=${isAutoSelectFormatActive(this.autoSelectFormat)}
16140
+ .busyAssetId=${this.busyAssetId}
16141
+ cta-text=${this.ctaText}
16142
+ cta-text-transform=${this.ctaTextTransform}
16143
+ selected-asset-id=${o$5(this.selectedAssetId || void 0)}
16144
+ view=${this.view}
16145
+ @cx-content-browser-grid-scroll-end=${this.handleScrollEnd}
16146
+ @cx-content-browser-grid-resize=${this.handleGridResize}
16147
+ @cx-content-browser-grid-click=${this.handleGridClick}
16148
+ ></cx-content-browser-grid>
16149
+ `
16150
+ )}
14939
16151
  </cx-resize-observer>
14940
16152
  <cx-content-browser-format-dialog
14941
16153
  .availableExtensions=${availableExtensions}
@@ -14948,6 +16160,7 @@ let CxContentBrowser = class extends CortexElement {
14948
16160
  cta-text-transform=${this.ctaTextTransform}
14949
16161
  variant=${this.isMobile ? ContentBrowserFormatDialogVariant.Drawer : ContentBrowserFormatDialogVariant.Dialog}
14950
16162
  token=${this.useSiteSession ? "" : this.token}
16163
+ .autoSelectFormat=${this.autoSelectFormat}
14951
16164
  ?can-custom-format=${!!(parameters == null ? void 0 : parameters.ATSEnabled)}
14952
16165
  ?can-favorite=${this.canFavorite}
14953
16166
  ?can-pin-asset=${this.canPinAsset}
@@ -14967,6 +16180,8 @@ let CxContentBrowser = class extends CortexElement {
14967
16180
  `;
14968
16181
  }
14969
16182
  };
16183
+ _openingAsset = /* @__PURE__ */ new WeakMap();
16184
+ _insertInFlight = /* @__PURE__ */ new WeakMap();
14970
16185
  CxContentBrowser.styles = [componentStyles, styles];
14971
16186
  CxContentBrowser.dependencies = {
14972
16187
  "cx-content-browser-browser": CxContentBrowserBrowser,
@@ -14975,6 +16190,7 @@ CxContentBrowser.dependencies = {
14975
16190
  "cx-content-browser-grid": CxContentBrowserGrid,
14976
16191
  "cx-content-browser-header": CxContentBrowserHeader,
14977
16192
  "cx-content-browser-no-result": CxContentBrowserNoResult,
16193
+ "cx-content-browser-table": CxContentBrowserTable,
14978
16194
  "cx-icon": CxIcon,
14979
16195
  "cx-icon-button": CxIconButton,
14980
16196
  "cx-resize-observer": CxResizeObserver,
@@ -15066,6 +16282,9 @@ __decorateClass([
15066
16282
  __decorateClass([
15067
16283
  n$6({ attribute: "can-use-proxies", reflect: true, type: Boolean })
15068
16284
  ], CxContentBrowser.prototype, "canUseProxies", 2);
16285
+ __decorateClass([
16286
+ n$6({ attribute: "auto-select-format", converter: autoSelectFormatConverter, reflect: false })
16287
+ ], CxContentBrowser.prototype, "autoSelectFormat", 2);
15069
16288
  __decorateClass([
15070
16289
  n$6({ attribute: "simple-pick", reflect: true, type: Boolean })
15071
16290
  ], CxContentBrowser.prototype, "simplePick", 2);
@@ -15098,6 +16317,32 @@ __decorateClass([
15098
16317
  __decorateClass([
15099
16318
  n$6({ attribute: "default-grid-view", type: String })
15100
16319
  ], CxContentBrowser.prototype, "defaultGridView", 2);
16320
+ __decorateClass([
16321
+ n$6({
16322
+ attribute: "table-columns",
16323
+ /**
16324
+ * Lit's stock Array converter returns `null` for anything `JSON.parse` rejects, and a host that
16325
+ * stringifies an array into the attribute hands it `""` or `"[object Object]"`. `null` then
16326
+ * throws on every read below, taking the whole picker down. An unreadable value means "no
16327
+ * columns", which turns the table view off — the same outcome as not configuring one.
16328
+ */
16329
+ converter: {
16330
+ fromAttribute: (value) => {
16331
+ if (!value) {
16332
+ return [];
16333
+ }
16334
+ try {
16335
+ const parsed = JSON.parse(value);
16336
+ return Array.isArray(parsed) ? parsed : [];
16337
+ } catch (e2) {
16338
+ return [];
16339
+ }
16340
+ },
16341
+ toAttribute: (value) => JSON.stringify(value != null ? value : [])
16342
+ },
16343
+ type: Array
16344
+ })
16345
+ ], CxContentBrowser.prototype, "tableColumns", 2);
15101
16346
  __decorateClass([
15102
16347
  n$6({ attribute: "default-sort-order-name", type: String })
15103
16348
  ], CxContentBrowser.prototype, "defaultSortOrderName", 2);
@@ -15161,9 +16406,15 @@ __decorateClass([
15161
16406
  __decorateClass([
15162
16407
  r$6()
15163
16408
  ], CxContentBrowser.prototype, "isMobile", 2);
16409
+ __decorateClass([
16410
+ r$6()
16411
+ ], CxContentBrowser.prototype, "busyAssetId", 2);
15164
16412
  __decorateClass([
15165
16413
  watch("lastRequest", { waitUntilFirstUpdate: true })
15166
16414
  ], CxContentBrowser.prototype, "handleLastRequestChange", 1);
16415
+ __decorateClass([
16416
+ watch("tableColumns", { waitUntilFirstUpdate: true })
16417
+ ], CxContentBrowser.prototype, "handleTableColumnsChange", 1);
15167
16418
  __decorateClass([
15168
16419
  watch(["token", "useSession"], { waitUntilFirstUpdate: true })
15169
16420
  ], CxContentBrowser.prototype, "handleAuthChange", 1);
@@ -29342,7 +30593,9 @@ const GlobalConfigContext = reactExports.createContext({
29342
30593
  allowFavorites: false,
29343
30594
  allowPin: false,
29344
30595
  allowFormatDialogPin: false,
29345
- defaultGridView: ""
30596
+ defaultGridView: "",
30597
+ autoSelectFormat: false,
30598
+ tableColumns: []
29346
30599
  });
29347
30600
  function formatProdErrorMessage$1(code) {
29348
30601
  return `Minified Redux error #${code}; visit https://redux.js.org/Errors?code=${code} for the full message or use the non-minified dev environment for full errors. `;
@@ -32153,6 +33406,9 @@ var GridView = /* @__PURE__ */ ((GridView2) => {
32153
33406
  function isPromise(value) {
32154
33407
  return typeof value === "object" && value !== null && typeof value.then === "function";
32155
33408
  }
33409
+ function isSupportedView(view) {
33410
+ return view === TABLE_VIEW || Object.values(GridView).includes(view);
33411
+ }
32156
33412
  function parseSelectedFacets(selectedFilter) {
32157
33413
  var _a2;
32158
33414
  if (!selectedFilter) {
@@ -32214,7 +33470,9 @@ const AssetsPicker = reactExports.forwardRef(function AssetsPicker2({ accessToke
32214
33470
  pluginInfo,
32215
33471
  showCollections,
32216
33472
  showFavoriteFolder,
32217
- showVersions
33473
+ showVersions,
33474
+ tableColumns,
33475
+ autoSelectFormat
32218
33476
  } = reactExports.useContext(GlobalConfigContext);
32219
33477
  const {
32220
33478
  extraFields,
@@ -32231,7 +33489,7 @@ const AssetsPicker = reactExports.forwardRef(function AssetsPicker2({ accessToke
32231
33489
  const [defaultSettings, setDefaultSettings] = reactExports.useState({
32232
33490
  sortOrder: "",
32233
33491
  sortDirection: "",
32234
- view: Object.values(GridView).includes(defaultGridView) ? defaultGridView : GridView.Medium,
33492
+ view: isSupportedView(defaultGridView) ? defaultGridView : GridView.Medium,
32235
33493
  facets: [],
32236
33494
  selectedFacets: {},
32237
33495
  isSeeThrough: true,
@@ -32428,6 +33686,8 @@ const AssetsPicker = reactExports.forwardRef(function AssetsPicker2({ accessToke
32428
33686
  "available-doc-types": availableDocTypes,
32429
33687
  "available-representative-subtypes": availableRepresentativeSubtypes,
32430
33688
  "default-grid-view": defaultSettings.view,
33689
+ "table-columns": tableColumns != null ? tableColumns : [],
33690
+ "auto-select-format": autoSelectFormat != null ? autoSelectFormat : false,
32431
33691
  "default-sort-order-name": defaultSettings.sortOrder,
32432
33692
  "default-sort-direction": defaultSettings.sortDirection,
32433
33693
  "default-facets": defaultSettings.facets,
@@ -33115,6 +34375,11 @@ const ContentBrowser = {
33115
34375
  lastLocationMode: true, // Whether to open the last selected folder on load
33116
34376
  allowTracking: true, // Whether to enable tracking parameters for asset URLs
33117
34377
  allowFormatDialogPin: true, // Whether to show pin/unpin actions in format dialog
34378
+ tableColumns: [ // Columns of the table view; omit to offer grid views only
34379
+ { title: "Identifier", field: "CoreField.Identifier", width: "160px" },
34380
+ { title: "Title", field: "CoreField.TitleWithFallback", width: "minmax(0, 2fr)" },
34381
+ { title: "Description", field: "Document.CaptionLong", lines: 2 },
34382
+ ],
33118
34383
  });`);
33119
34384
  },
33120
34385
  open: (_0) => __async(null, [_0], function* ({
@@ -33165,7 +34430,9 @@ const ContentBrowser = {
33165
34430
  showVersions,
33166
34431
  useSession,
33167
34432
  useSiteSession = false,
33168
- defaultGridView
34433
+ defaultGridView,
34434
+ tableColumns,
34435
+ autoSelectFormat
33169
34436
  }) {
33170
34437
  var _a2;
33171
34438
  const siteSessionUrl = useSiteSession ? resolveSiteSessionUrl(baseUrl) : void 0;
@@ -33273,7 +34540,9 @@ const ContentBrowser = {
33273
34540
  allowProxy: simplePick ? false : allowProxy !== void 0 ? !!allowProxy : true,
33274
34541
  simplePick: !!simplePick,
33275
34542
  allowFavorites: !!allowFavorites,
33276
- defaultGridView: defaultGridView != null ? defaultGridView : ""
34543
+ defaultGridView: defaultGridView != null ? defaultGridView : "",
34544
+ autoSelectFormat: autoSelectFormat != null ? autoSelectFormat : false,
34545
+ tableColumns: tableColumns != null ? tableColumns : []
33277
34546
  },
33278
34547
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
33279
34548
  App,