@orangelogic/design-system 2.95.0 → 2.97.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/library/chunks/asset.B3vySOI-.js +431 -0
  2. package/library/chunks/{asset.types.6DCzTOQm.js → asset.types.KXRZEtBr.js} +127 -126
  3. package/library/chunks/{button.BZjbVq8t.js → button.CAa1kvwe.js} +2 -2
  4. package/library/chunks/{color-swatch-group.Q8ybVS0A.js → color-swatch-group.ChcPlkPU.js} +5 -5
  5. package/library/chunks/{color-swatch.CbL_TpRZ.js → color-swatch.DJ1kUnBQ.js} +1 -1
  6. package/library/chunks/{confirm-popover.bBo9aPlX.js → confirm-popover.D4x0nO5g.js} +3 -3
  7. package/library/chunks/content-builder.CcgZciZN.js +58 -0
  8. package/library/chunks/{cropper.uKGcvnPk.js → cropper.Bib8Abm3.js} +4937 -4932
  9. package/library/chunks/{dialog.DRW8iwh-.js → dialog.BLaxLMSc.js} +2 -2
  10. package/library/chunks/{dom.DURaLV1d.js → dom.0RpWet6y.js} +1 -1
  11. package/library/chunks/{dot-pagination.CvUr6R4S.js → dot-pagination.-nDdQxJN.js} +1 -1
  12. package/library/chunks/{file-on-demand.KQlA1JFF.js → file-on-demand.AzwoUvwB.js} +10 -10
  13. package/library/chunks/{folder-select.DxBOSyvo.js → folder-select.XpkOFzAW.js} +5 -5
  14. package/library/chunks/{form.nRqYei4e.js → form.Ch1cwYzO.js} +1 -1
  15. package/library/chunks/{header.ClxEkQPZ.js → header.BZxyeLPK.js} +1 -1
  16. package/library/chunks/{i18n.W6czbRms.js → i18n.BABe9hN4.js} +6 -0
  17. package/library/chunks/{icon-button.MqA-pNw8.js → icon-button.C2s3pHG4.js} +1 -1
  18. package/library/chunks/{iframe.PcSPtm_O.js → iframe.DPccxsnE.js} +1 -1
  19. package/library/chunks/{image.Dtdklw5q.js → image.9qwbjGNb.js} +1 -1
  20. package/library/chunks/{image.C-Covc0H.js → image.Cc4V85ID.js} +354 -311
  21. package/library/chunks/{list-editor.BnHKqD0O.js → list-editor.pVYc_70c.js} +183 -153
  22. package/library/chunks/{number.CCF6IxpN.js → number.B4PQLJIg.js} +32 -32
  23. package/library/chunks/{option.Cx54zrJq.js → option.DGXQzdtb.js} +1 -1
  24. package/library/chunks/{pagination.CG5odPWi.js → pagination.DZqKSA86.js} +4 -4
  25. package/library/chunks/{responsive.D9TUCX5p.js → responsive.Oz9HWjyQ.js} +1 -1
  26. package/library/chunks/{string.DfV21HEI.js → string.DUgD4c9f.js} +41 -34
  27. package/library/chunks/{tab-group.BLZ-qEpp.js → tab-group.BhCf9Smq.js} +4 -4
  28. package/library/chunks/{table.CYxWpvAC.js → table.V5PGGTfO.js} +13 -11
  29. package/library/chunks/{time.BNrE47-8.js → time.BiQnh9wt.js} +1 -1
  30. package/library/chunks/toast.D3AW3RWv.js +94 -0
  31. package/library/chunks/transformation.Cqz3hPaQ.js +144 -0
  32. package/library/chunks/{tree.CKi63r95.js → tree.DZa7k-4E.js} +1 -1
  33. package/library/components/alert.js +2 -2
  34. package/library/components/asset-link-format.js +767 -862
  35. package/library/components/atoms.js +12 -12
  36. package/library/components/border-input-group.js +1 -1
  37. package/library/components/breadcrumb.js +1 -1
  38. package/library/components/button.js +3 -3
  39. package/library/components/checkbox.js +1 -1
  40. package/library/components/color-picker.js +3 -3
  41. package/library/components/color-swatch-group.js +6 -6
  42. package/library/components/color-swatch.js +2 -2
  43. package/library/components/confirm-popover.js +4 -4
  44. package/library/components/copy-button.js +1 -1
  45. package/library/components/corner-position-input-group.js +2 -2
  46. package/library/components/cropper.js +1 -1
  47. package/library/components/details.js +4 -4
  48. package/library/components/dialog.js +3 -3
  49. package/library/components/dot-pagination.js +2 -2
  50. package/library/components/drawer.js +2 -2
  51. package/library/components/dropdown.js +1 -1
  52. package/library/components/dynamic-select.js +4 -4
  53. package/library/components/e-chart.js +1 -1
  54. package/library/components/element-clamp.js +2 -2
  55. package/library/components/file-on-demand.js +11 -11
  56. package/library/components/folder-select.js +4 -4
  57. package/library/components/format-bytes.js +1 -1
  58. package/library/components/format-date.js +1 -1
  59. package/library/components/format-number.js +1 -1
  60. package/library/components/format-time.js +2 -2
  61. package/library/components/header.js +2 -2
  62. package/library/components/icon-button.js +2 -2
  63. package/library/components/iframe.js +2 -2
  64. package/library/components/image-comparer.js +1 -1
  65. package/library/components/image.js +2 -2
  66. package/library/components/input.js +4 -7
  67. package/library/components/line-clamp.js +1 -1
  68. package/library/components/list-editor.js +6 -6
  69. package/library/components/masonry.js +2 -2
  70. package/library/components/menu-item.js +1 -1
  71. package/library/components/menu.js +1 -1
  72. package/library/components/molecules.js +5 -5
  73. package/library/components/option.js +2 -2
  74. package/library/components/organisms.js +2 -2
  75. package/library/components/pagination.js +5 -5
  76. package/library/components/popup.js +1 -1
  77. package/library/components/position-picker.js +1 -1
  78. package/library/components/progress-bar.js +1 -1
  79. package/library/components/progress-ring.js +1 -1
  80. package/library/components/radio-group.js +1 -1
  81. package/library/components/range.js +2 -2
  82. package/library/components/rating.js +1 -1
  83. package/library/components/relative-time.js +1 -1
  84. package/library/components/select.js +3 -3
  85. package/library/components/share-option-list.js +2 -2
  86. package/library/components/sidebar.js +1 -1
  87. package/library/components/size-input-group.js +2 -2
  88. package/library/components/spinner.js +1 -1
  89. package/library/components/split-panel.js +1 -1
  90. package/library/components/switch.js +1 -1
  91. package/library/components/tab-group.js +5 -5
  92. package/library/components/tab.js +2 -2
  93. package/library/components/table.js +5 -5
  94. package/library/components/tag.js +2 -2
  95. package/library/components/textarea.js +2 -2
  96. package/library/components/timecode.js +1 -1
  97. package/library/components/tooltip.js +1 -1
  98. package/library/components/tree-item.js +2 -2
  99. package/library/components/tree.js +2 -2
  100. package/library/components/typeface.js +2 -2
  101. package/library/components/types.js +31066 -29848
  102. package/library/components/video.js +554 -545
  103. package/library/package.json +1 -1
  104. package/library/packages/atoms/src/components/image/image.d.ts +15 -1
  105. package/library/packages/atoms/src/components/input/input.d.ts +1 -2
  106. package/library/packages/atoms/src/components/video/video.d.ts +3 -1
  107. package/library/packages/events/src/cx-asset-format-picker-delete.d.ts +6 -0
  108. package/library/packages/events/src/cx-asset-format-picker-select.d.ts +8 -0
  109. package/library/packages/events/src/cx-asset-transformation-dialog-cancel.d.ts +6 -0
  110. package/library/packages/events/src/cx-asset-transformation-dialog-confirm.d.ts +11 -0
  111. package/library/packages/events/src/cx-asset-transformation-dialog-delete.d.ts +6 -0
  112. package/library/packages/events/src/cx-bento-range-change.d.ts +9 -0
  113. package/library/packages/events/src/cx-content-builder-gallery-fetched.d.ts +10 -0
  114. package/library/packages/events/src/cx-lightbox-close.d.ts +6 -0
  115. package/library/packages/events/src/cx-lightbox-download.d.ts +11 -0
  116. package/library/packages/events/src/cx-timeline-data-resolved.d.ts +10 -0
  117. package/library/packages/events/src/cx-video-thumbnail-resolved.d.ts +8 -0
  118. package/library/packages/events/src/events.d.ts +12 -1
  119. package/library/packages/molecules/src/asset-data-display/asset-data-display.d.ts +1 -0
  120. package/library/packages/molecules/src/asset-format-picker/asset-format-picker.d.ts +56 -0
  121. package/library/packages/molecules/src/asset-format-picker/asset-format-picker.styles.d.ts +2 -0
  122. package/library/packages/molecules/src/asset-picker/asset-picker.d.ts +7 -0
  123. package/library/packages/molecules/src/cropper/cropper.d.ts +1 -0
  124. package/library/packages/molecules/src/cropper/react/Cropper.d.ts +1 -0
  125. package/library/packages/molecules/src/download-format-picker/download-format-picker.d.ts +5 -1
  126. package/library/packages/molecules/src/index.d.ts +1 -0
  127. package/library/packages/molecules/src/timeline/timeline.d.ts +18 -0
  128. package/library/packages/organisms/src/asset-link-format/asset-link-format.d.ts +12 -0
  129. package/library/packages/organisms/src/asset-link-format/components/asset-link-format-rotation/asset-link-format-rotation.d.ts +7 -7
  130. package/library/packages/organisms/src/asset-transformation-dialog/asset-transformation-dialog.d.ts +102 -0
  131. package/library/packages/organisms/src/asset-transformation-dialog/asset-transformation-dialog.styles.d.ts +2 -0
  132. package/library/packages/organisms/src/bento-grid/bento-grid.d.ts +57 -26
  133. package/library/packages/organisms/src/bento-grid/bento-layout.d.ts +44 -0
  134. package/library/packages/organisms/src/carousel/carousel.d.ts +3 -1
  135. package/library/packages/organisms/src/content-builder/components/block-picker/block-picker.d.ts +7 -0
  136. package/library/packages/organisms/src/content-builder/components/config-form/config-form-controller.d.ts +4 -0
  137. package/library/packages/organisms/src/content-builder/components/config-form/config-form.d.ts +11 -0
  138. package/library/packages/organisms/src/content-builder/components/config-manager/config-manager.d.ts +10 -0
  139. package/library/packages/organisms/src/content-builder/components/gallery-picker/gallery-picker.d.ts +6 -0
  140. package/library/packages/organisms/src/content-builder/configs/carousel.d.ts +6 -2
  141. package/library/packages/organisms/src/content-builder/configs/gallery.d.ts +6 -2
  142. package/library/packages/organisms/src/content-builder/configs/image.d.ts +7 -4
  143. package/library/packages/organisms/src/content-builder/configs/timeline.d.ts +5 -2
  144. package/library/packages/organisms/src/content-builder/configs/video.d.ts +11 -2
  145. package/library/packages/organisms/src/content-builder/configs-controller.d.ts +45 -4
  146. package/library/packages/organisms/src/content-builder/content-builder-constants.d.ts +2 -2
  147. package/library/packages/organisms/src/content-builder/content-builder.d.ts +13 -0
  148. package/library/packages/organisms/src/content-builder/plugins/gallery.d.ts +45 -1
  149. package/library/packages/organisms/src/content-builder/styleController.d.ts +26 -1
  150. package/library/packages/organisms/src/index.d.ts +2 -0
  151. package/library/packages/organisms/src/lightbox/lightbox.d.ts +79 -0
  152. package/library/packages/organisms/src/lightbox/lightbox.styles.d.ts +2 -0
  153. package/library/packages/services/src/api/asset/asset.d.ts +2 -2
  154. package/library/packages/services/src/api/asset/asset.types.d.ts +4 -0
  155. package/library/packages/tools/src/fetch-asset/fetch-asset.d.ts +2 -1
  156. package/library/packages/tools/src/fetch-image/fetch-image.d.ts +19 -5
  157. package/library/packages/types/src/asset-click-action.d.ts +3 -1
  158. package/library/packages/types/src/asset-format-picker.d.ts +11 -0
  159. package/library/packages/types/src/bento-grid.d.ts +37 -0
  160. package/library/packages/types/src/content-builder.d.ts +37 -1
  161. package/library/packages/types/src/gallery.d.ts +0 -6
  162. package/library/packages/utils/src/actions/asset-click.d.ts +1 -3
  163. package/library/packages/utils/src/custom-element/i18n.d.ts +6 -0
  164. package/library/packages/utils/src/index.d.ts +1 -0
  165. package/library/packages/utils/src/string/string.d.ts +1 -0
  166. package/library/packages/utils/src/transformation/index.d.ts +1 -0
  167. package/library/react-web-component.d.ts +236 -8
  168. package/library/utils.js +517 -192
  169. package/package.json +1 -1
  170. package/library/chunks/asset.Duzr3O3z.js +0 -370
  171. package/library/chunks/index.BgXEXk4m.js +0 -398
  172. package/library/chunks/toast.Bc4wpYJ1.js +0 -150
  173. /package/library/packages/{organisms/src/asset-link-format/asset-link-format.utils.d.ts → utils/src/transformation/transformation.d.ts} +0 -0
@@ -0,0 +1,431 @@
1
+ import { h as l, S as B, A as w, a as K, b as $, M as R } from "./asset.types.KXRZEtBr.js";
2
+ import "./browser.BHOCIF_A.js";
3
+ import "./lit-element.jLBm65_O.js";
4
+ import "./form.Ch1cwYzO.js";
5
+ import "./i18n.BABe9hN4.js";
6
+ import { a as V } from "./string.DUgD4c9f.js";
7
+ import "./content-builder.CcgZciZN.js";
8
+ import "./unsafe-html.Dff7-rCx.js";
9
+ function q(e) {
10
+ return typeof e == "object" && e !== null && "URI" in e;
11
+ }
12
+ const Z = {
13
+ artist: "Artist",
14
+ color: "Color",
15
+ createDate: "CreateDate",
16
+ docSubType: "DocSubType",
17
+ docType: "DocType",
18
+ editDate: "EditDate",
19
+ fileExtension: "Fileextension",
20
+ keyword: "Keyword",
21
+ mediaDate: "MediaDate",
22
+ mediaNumber: "MediaNumber",
23
+ nativeKeyword: "NativeKeyword",
24
+ orientation: "Orientation",
25
+ parentFolderIdentifier: "ParentFolderIdentifier",
26
+ path: "Path",
27
+ photographer: "Photographer",
28
+ purpose: "Purpose",
29
+ recordId: "RecordID",
30
+ systemIdentifier: "SystemIdentifier",
31
+ text: "Text",
32
+ title: "Title"
33
+ }, X = /* @__PURE__ */ new Set(["mediaDate", "createDate", "editDate"]);
34
+ function z(e) {
35
+ return !/[\s&+/*"\\:(),'<>~|[\]{}]/.test(e) && !/^(?:OR|AND|NOT)$/.test(e) ? e : `"${e.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
36
+ }
37
+ function O(e, t) {
38
+ const o = (Array.isArray(t) ? t : [t]).map((s) => `${e}:${z(s)}`);
39
+ return o.length > 1 ? `(${o.join(" OR ")})` : o[0] ?? "";
40
+ }
41
+ function Y(e, t) {
42
+ return (Array.isArray(t) ? t : [t]).map((o) => `${e}${o.operator}${o.value}`).join(" AND ");
43
+ }
44
+ function Q(e) {
45
+ const t = [];
46
+ for (const r of Object.keys(e)) {
47
+ const o = r, s = e[o];
48
+ if (s == null)
49
+ continue;
50
+ if (o === "custom") {
51
+ for (const [a, p] of Object.entries(
52
+ s
53
+ ))
54
+ t.push(O(a, p));
55
+ continue;
56
+ }
57
+ const u = Z[o];
58
+ if (u) {
59
+ if (X.has(o)) {
60
+ t.push(
61
+ Y(u, s)
62
+ );
63
+ continue;
64
+ }
65
+ if (o === "color") {
66
+ t.push(`${u}:${s}`);
67
+ continue;
68
+ }
69
+ t.push(O(u, s));
70
+ }
71
+ }
72
+ return t.join(" AND ");
73
+ }
74
+ function _(e) {
75
+ if ("and" in e)
76
+ return e.and.map(_).filter(Boolean).join(" AND ");
77
+ if ("or" in e) {
78
+ const t = e.or.map(_).filter(Boolean);
79
+ return t.length > 1 ? `(${t.join(" OR ")})` : t[0] ?? "";
80
+ }
81
+ if ("not" in e) {
82
+ const t = _(e.not);
83
+ return t ? `NOT (${t})` : "";
84
+ }
85
+ return Q(e);
86
+ }
87
+ const L = "CoreField.LargeSizePreview", P = "CoreField.DocType", J = "Document.Title", ee = "Document.CaptionLong", b = "Document.FileExtension", G = "CoreField.FileSize", M = "CoreField.Identifier", U = "CoreField.Keywords", j = "CoreField.MaxHeight", v = "CoreField.MaxWidth", D = "Document.RecordID", W = "CoreField.DocSubType", H = "CoreField.TitleWithFallback", T = "CoreField.OriginalFileName", y = "CoreField.UpdatedFileName", E = "CoreField.OriginalPreview", F = {
88
+ DEFAULT_VIEW_SIZE: "Document.LargeSizePreview",
89
+ FIELD_TITLE_WITH_FALLBACK: "Document.TitleWithFallback",
90
+ ORIGINAL_VIEW_SIZE: "Document.OriginalPreview"
91
+ }, k = {
92
+ [L]: F.DEFAULT_VIEW_SIZE,
93
+ [H]: F.FIELD_TITLE_WITH_FALLBACK,
94
+ [E]: F.ORIGINAL_VIEW_SIZE
95
+ }, te = Object.fromEntries(
96
+ Object.entries(k).map(([e, t]) => [
97
+ t,
98
+ e
99
+ ])
100
+ );
101
+ function re(e) {
102
+ return k[e] ?? e;
103
+ }
104
+ function oe(e) {
105
+ const t = {};
106
+ for (const [r, o] of Object.entries(e)) {
107
+ const s = te[r] ?? r;
108
+ t[s] = o;
109
+ }
110
+ return t;
111
+ }
112
+ async function x({
113
+ countPerPage: e,
114
+ fields: t,
115
+ getPermanentAssetsPaths: r,
116
+ pageNumber: o,
117
+ query: s,
118
+ siteUrl: u,
119
+ sort: a,
120
+ token: p,
121
+ useSession: I
122
+ }) {
123
+ const m = t?.map(re);
124
+ try {
125
+ return (await l.request({
126
+ baseURL: u,
127
+ method: "GET",
128
+ params: {
129
+ CountPerPage: e,
130
+ Fields: m,
131
+ Format: "json",
132
+ GetPermanentAssetsPaths: r || void 0,
133
+ PageNumber: o,
134
+ Query: _(s),
135
+ Sort: a || void 0,
136
+ Token: p || void 0,
137
+ UseSession: I || void 0
138
+ },
139
+ paramsSerializer: { indexes: null },
140
+ responseType: "json",
141
+ transformResponse: [
142
+ ...Array.isArray(l.defaults.transformResponse) ? l.defaults.transformResponse : [],
143
+ (n) => ({
144
+ items: (n.APIResponse?.Items ?? []).map(oe),
145
+ sort: n.APIResponse?.GlobalInfo?.Sort ?? "",
146
+ totalCount: n.APIResponse?.GlobalInfo?.TotalCount ?? 0
147
+ })
148
+ ],
149
+ url: B["4.0"]
150
+ })).data;
151
+ } catch {
152
+ return { items: [], sort: "", totalCount: 0 };
153
+ }
154
+ }
155
+ async function Ie({
156
+ assetId: e,
157
+ extension: t,
158
+ format: r,
159
+ siteUrl: o,
160
+ token: s,
161
+ transformations: u,
162
+ useSession: a
163
+ }) {
164
+ try {
165
+ return (await l.request({
166
+ baseURL: o,
167
+ method: "GET",
168
+ params: {
169
+ SourceAssetFormat: r,
170
+ SourceAssetRecordID: e,
171
+ TargetExtension: V(t),
172
+ Token: s || void 0,
173
+ Transformations: u,
174
+ UseSession: a || void 0
175
+ },
176
+ /**
177
+ * https://link.orangelogic.com/Tasks/41S1XH
178
+ */
179
+ timeout: 3e5,
180
+ // 5 minutes
181
+ url: w.GET_TRANSFORM_ASSET_LINK
182
+ })).data;
183
+ } catch {
184
+ return null;
185
+ }
186
+ }
187
+ const ne = 50;
188
+ function se(e, t) {
189
+ const r = [];
190
+ for (let o = 0; o < e.length; o += t)
191
+ r.push(e.slice(o, o + t));
192
+ return r;
193
+ }
194
+ async function me({
195
+ extraFields: e,
196
+ getPermanentAssetsPaths: t,
197
+ recordIds: r,
198
+ token: o
199
+ }) {
200
+ if (!Array.isArray(r) || r.length === 0)
201
+ return { facets: [], items: [], totalCount: 0 };
202
+ const s = e?.filter((n) => n && typeof n == "string") ?? [], u = [
203
+ ...s,
204
+ E,
205
+ y,
206
+ T,
207
+ J,
208
+ ee,
209
+ D
210
+ ], a = se(r, ne), p = await Promise.all(
211
+ a.map(
212
+ (n) => x({
213
+ countPerPage: n.length,
214
+ fields: u,
215
+ getPermanentAssetsPaths: t,
216
+ pageNumber: 1,
217
+ query: { recordId: n },
218
+ token: o
219
+ })
220
+ )
221
+ ), I = new Map(r.map((n, d) => [n, d])), m = p.flatMap((n) => n.items).map((n) => {
222
+ let d = c(n, y);
223
+ return d === "" && (d = c(n, T)), {
224
+ name: d,
225
+ originalUrl: c(n, E),
226
+ recordId: c(n, D),
227
+ ...s.reduce(
228
+ (i, f) => (i[f] = c(n, f), i),
229
+ {}
230
+ )
231
+ };
232
+ }).sort(
233
+ (n, d) => (I.get(n.recordId) ?? 1 / 0) - (I.get(d.recordId) ?? 1 / 0)
234
+ ), A = p.reduce(
235
+ (n, d) => n + d.totalCount,
236
+ 0
237
+ );
238
+ return { facets: [], items: m, totalCount: A };
239
+ }
240
+ function c(e, t) {
241
+ const r = e[t];
242
+ return r == null ? "" : typeof r == "string" ? r : typeof r == "number" || typeof r == "boolean" ? String(r) : q(r) ? r.URI : "";
243
+ }
244
+ async function Ee({
245
+ countPerPage: e,
246
+ extraFields: t,
247
+ getPermanentAssetsPaths: r,
248
+ limitedDocTypes: o,
249
+ pageNumber: s,
250
+ parentFolderIdentifier: u,
251
+ searchTerm: a,
252
+ sortOrder: p,
253
+ token: I
254
+ }) {
255
+ if (!u)
256
+ return { facets: [], items: [], totalCount: 0 };
257
+ const m = (t?.filter((i) => i && typeof i == "string") ?? []).map((i) => i.replace("%20", " ")), A = {
258
+ parentFolderIdentifier: u,
259
+ ...o.length > 0 ? { docType: [R.Image, R.Audio] } : {}
260
+ }, n = await x({
261
+ countPerPage: e,
262
+ fields: [
263
+ ...m,
264
+ H,
265
+ L,
266
+ E,
267
+ U,
268
+ v,
269
+ j,
270
+ G,
271
+ P,
272
+ W,
273
+ M,
274
+ b,
275
+ D,
276
+ T,
277
+ y
278
+ ],
279
+ getPermanentAssetsPaths: r,
280
+ pageNumber: s,
281
+ query: A,
282
+ sort: void 0,
283
+ token: I
284
+ }), d = n.items.map((i) => {
285
+ let f = c(i, b), h = c(i, y), S = c(i, L);
286
+ f && !f.startsWith(".") && (f = "." + f), h === "" && (h = c(i, T)), f.toLowerCase() === ".gif" && (S = c(i, E));
287
+ const C = c(i, D);
288
+ return {
289
+ docSubType: c(i, W),
290
+ docType: c(i, P) || "",
291
+ extension: f,
292
+ height: c(i, j) || "0",
293
+ id: C,
294
+ identifier: c(i, M),
295
+ imageUrl: S,
296
+ name: h,
297
+ originalUrl: c(i, E),
298
+ recordId: C,
299
+ size: c(i, G) || "0 MB",
300
+ tags: c(i, U),
301
+ width: c(i, v) || "0",
302
+ ...m.reduce(
303
+ (g, N) => (g[N] = c(i, N), g),
304
+ {}
305
+ )
306
+ };
307
+ });
308
+ return {
309
+ facets: [],
310
+ items: d,
311
+ totalCount: n.totalCount
312
+ };
313
+ }
314
+ async function Ae({
315
+ autoCropMode: e,
316
+ cropHeight: t,
317
+ cropWidth: r,
318
+ imageUrl: o,
319
+ useSession: s
320
+ }) {
321
+ try {
322
+ return (await l.request({
323
+ method: "GET",
324
+ params: {
325
+ AutoCropMode: e,
326
+ CropHeight: t,
327
+ CropWidth: r,
328
+ ImageUrl: o && new URL(o, window.location.origin).href,
329
+ UseSession: s || void 0
330
+ },
331
+ responseType: "json",
332
+ timeout: 3e5,
333
+ // 5 minutes
334
+ transformResponse: [
335
+ ...Array.isArray(l.defaults.transformResponse) ? l.defaults.transformResponse : [],
336
+ (a) => ({
337
+ height: a.cropHeight,
338
+ width: a.cropWidth,
339
+ x: a.cropX,
340
+ y: a.cropY
341
+ })
342
+ ],
343
+ url: w.GET_CROP_ZONE_SUGGESTION
344
+ })).data;
345
+ } catch {
346
+ return null;
347
+ }
348
+ }
349
+ async function _e({
350
+ assetRecordId: e,
351
+ siteUrl: t,
352
+ token: r,
353
+ useSession: o
354
+ }) {
355
+ try {
356
+ return (await l.request({
357
+ baseURL: t,
358
+ method: "GET",
359
+ params: {
360
+ RecordId: e,
361
+ Token: r,
362
+ UseSession: o || void 0
363
+ },
364
+ responseType: "json",
365
+ transformResponse: [
366
+ ...Array.isArray(l.defaults.transformResponse) ? l.defaults.transformResponse : [],
367
+ (u) => !u || typeof u != "object" ? [] : u.proxies?.map((a) => ({
368
+ cdnName: a.cdnName,
369
+ extension: a.extension,
370
+ formatHeight: a.formatHeight,
371
+ formatWidth: a.formatWidth,
372
+ height: a.height,
373
+ permanentLink: a.permanentLink,
374
+ proxyLabel: a.proxyLabel,
375
+ proxyName: a.proxyName,
376
+ width: a.width
377
+ })) ?? []
378
+ ],
379
+ url: $
380
+ })).data;
381
+ } catch {
382
+ return [];
383
+ }
384
+ }
385
+ async function De({
386
+ siteUrl: e
387
+ } = {}) {
388
+ try {
389
+ return (await l.request({
390
+ baseURL: e,
391
+ method: "GET",
392
+ responseType: "json",
393
+ transformResponse: [
394
+ ...Array.isArray(l.defaults.transformResponse) ? l.defaults.transformResponse : [],
395
+ (r) => !r || typeof r != "object" ? {
396
+ formatsByDocType: {
397
+ Audio: {},
398
+ Image: {},
399
+ Multimedia: {},
400
+ Video: {}
401
+ }
402
+ } : {
403
+ formatsByDocType: r.formatsByDocType ?? {}
404
+ }
405
+ ],
406
+ url: K
407
+ })).data;
408
+ } catch {
409
+ return { formatsByDocType: {} };
410
+ }
411
+ }
412
+ export {
413
+ L as D,
414
+ D as F,
415
+ E as O,
416
+ me as a,
417
+ Ie as b,
418
+ Ae as c,
419
+ De as d,
420
+ x as e,
421
+ Ee as f,
422
+ j as g,
423
+ v as h,
424
+ q as i,
425
+ b as j,
426
+ M as k,
427
+ _e as l,
428
+ P as m,
429
+ G as n,
430
+ W as o
431
+ };