@orangelogic/design-system 2.163.0 → 2.164.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 (45) hide show
  1. package/library/chunks/{asset-link-format.BdB6fQA_.js → asset-link-format.0q_MQOYh.js} +689 -633
  2. package/library/chunks/asset-link-format.ClaYu_v8.js +7 -0
  3. package/library/chunks/{color-swatch-group.w5DMzNco.js → color-swatch-group.ChP9amU9.js} +375 -296
  4. package/library/chunks/{document-viewer.gyH0NGM5.js → document-viewer.Cng07M-1.js} +1 -1
  5. package/library/chunks/{folder-select.Dh4SX0eU.js → folder-select.Dw1ZKZAq.js} +156 -136
  6. package/library/chunks/position-picker.DjnhxIKF.js +4 -0
  7. package/library/chunks/{toast.C5Ir5yKA.js → toast.CXEAfCvN.js} +1 -1
  8. package/library/chunks/transformation.8uLv6uwG.js +264 -0
  9. package/library/chunks/{tree.Dvnw_4vz.js → tree.vn5sHbdt.js} +120 -114
  10. package/library/components/asset-link-format.js +5 -4
  11. package/library/components/atoms.js +2 -2
  12. package/library/components/color-swatch-group.js +3 -3
  13. package/library/components/cropper.js +1 -1
  14. package/library/components/document-viewer.js +1 -1
  15. package/library/components/file-on-demand.js +1 -1
  16. package/library/components/folder-select.js +2 -2
  17. package/library/components/masonry.js +74 -71
  18. package/library/components/molecules.js +1 -1
  19. package/library/components/organisms.js +2 -2
  20. package/library/components/position-picker.js +25 -25
  21. package/library/components/tree-item.js +1 -1
  22. package/library/components/tree.js +1 -1
  23. package/library/components/types.js +10511 -10509
  24. package/library/package.json +1 -1
  25. package/library/packages/atoms/src/components/tree/tree.d.ts +7 -1
  26. package/library/packages/atoms/src/components/tree-item/tree-item.d.ts +11 -1
  27. package/library/packages/events/src/cx-folder-select-loading-change.d.ts +8 -0
  28. package/library/packages/events/src/events.d.ts +1 -0
  29. package/library/packages/hybrid/table-core/src/table/styles/table-frozen.styles.d.ts +8 -0
  30. package/library/packages/hybrid/table-core/src/table/table.d.ts +9 -1
  31. package/library/packages/hybrid/table-core/src/tabulator-tables/modules/FrozenColumns/FrozenColumns.d.ts +14 -1
  32. package/library/packages/hybrid/table-core/src/tabulator-tables/modules/ResizeColumns/ResizeColumns.d.ts +18 -1
  33. package/library/packages/molecules/src/folder-select/components/folder-select-tree/folder-select-tree.d.ts +7 -0
  34. package/library/packages/molecules/src/folder-select/folder-select.d.ts +7 -0
  35. package/library/packages/molecules/src/masonry/masonry.d.ts +5 -0
  36. package/library/packages/organisms/src/asset-link-format/asset-link-format.d.ts +9 -0
  37. package/library/packages/organisms/src/asset-link-format/components/asset-link-format-crop/asset-link-format-crop.d.ts +30 -0
  38. package/library/packages/types/src/asset-link-format.d.ts +19 -0
  39. package/library/packages/types/src/tree-item.d.ts +12 -0
  40. package/library/react-web-component.d.ts +15 -3
  41. package/library/utils.js +63 -64
  42. package/package.json +1 -1
  43. package/library/chunks/asset-link-format.QzzboHHE.js +0 -6
  44. package/library/chunks/content-builder.BX4pHujE.js +0 -60
  45. package/library/chunks/transformation.D1alV_s4.js +0 -189
@@ -1,48 +1,49 @@
1
1
  import "../components/cropper.js";
2
- import { C as K } from "./button.DGyqdBou.js";
3
- import O from "../components/space.js";
4
- import { C as L } from "./typography.IqHbnd3C.js";
5
- import { n as l, C as U } from "./lib-cortex-element.CVMmyPMC.js";
6
- import { h as M, a as Dt, C as Nt, S as qt, b as jt, c as Vt, d as Gt } from "./endpoints.CwgTrs4A.js";
7
- import { M as Rt, U as o, T as u } from "./asset-link-format.QzzboHHE.js";
2
+ import { C as Z } from "./button.DGyqdBou.js";
3
+ import L from "../components/space.js";
4
+ import { C as U } from "./typography.IqHbnd3C.js";
5
+ import { n as l, C as B } from "./lib-cortex-element.CVMmyPMC.js";
6
+ import { h as I, a as Nt, C as Ot, S as jt, b as Vt, c as Gt, d as Qt } from "./endpoints.CwgTrs4A.js";
7
+ import { M as $t, U as o, T as u } from "./asset-link-format.ClaYu_v8.js";
8
8
  import "./browser.BHOCIF_A.js";
9
- import { i as B, x as A, E as Qt } from "./lit-element.jLBm65_O.js";
9
+ import { i as q, x as A, E as Xt } from "./lit-element.jLBm65_O.js";
10
10
  import "./form.CP9KLGjF.js";
11
- import { L as q } from "./i18n.Bchq8v1d.js";
12
- import { a as Xt } from "./string.BhJ0Zogu.js";
11
+ import { L as j } from "./i18n.Bchq8v1d.js";
12
+ import { a as Kt } from "./string.BhJ0Zogu.js";
13
13
  import "./date-picker.BGHn6qg8.js";
14
- import "./content-builder.BX4pHujE.js";
14
+ import { a as Pt, b as rt } from "./transformation.8uLv6uwG.js";
15
15
  import "./unsafe-html.Dff7-rCx.js";
16
- import { b as Kt } from "./_baseUniq.lwMgmtt2.js";
17
- import { c as j } from "./component.styles.CRO4Odto.js";
18
- import { a as $t, b as ot } from "./transformation.D1alV_s4.js";
19
- import { v as Zt } from "./v4.CKZ6klMF.js";
20
- import { c as V } from "./custom-element.L4WJXn1j.js";
21
- import { w as F } from "./watch.DJF5K-8U.js";
22
- import { s as Pt, a as rt } from "./number.Cx2ncfJJ.js";
23
- import { r as k } from "./state.CSDxrqLd.js";
16
+ import { b as Zt } from "./_baseUniq.lwMgmtt2.js";
17
+ import { c as V } from "./component.styles.CRO4Odto.js";
18
+ import { v as Yt } from "./v4.CKZ6klMF.js";
19
+ import { P as W } from "./position-picker.DjnhxIKF.js";
20
+ import { c as G } from "./custom-element.L4WJXn1j.js";
21
+ import { w as M } from "./watch.DJF5K-8U.js";
22
+ import { s as Mt, a as nt } from "./number.Cx2ncfJJ.js";
23
+ import { r as R } from "./state.CSDxrqLd.js";
24
24
  import { n as _ } from "./when.Dr1es41R.js";
25
- import J from "../components/details.js";
26
- import Yt from "../components/divider.js";
27
- import { C as tt } from "./icon.D5iM9wXS.js";
25
+ import et from "../components/details.js";
26
+ import Jt from "../components/divider.js";
27
+ import { C as it } from "./icon.D5iM9wXS.js";
28
28
  import { C as vt } from "./icon-button.BwmMJ0bI.js";
29
29
  import { C as bt } from "./input.DOorVTYZ.js";
30
- import { C as ft } from "./option.DyNR1vzy.js";
31
- import gt from "../components/select.js";
32
- import { c as Jt } from "./image.Y5c_hFx8.js";
33
- import { e as et } from "./query.BBf1UFkC.js";
34
- import { c as at } from "./repeat.CFjcER6_.js";
35
- import { o as W } from "./style-map.llVFPd__.js";
36
- import Ot from "../components/tooltip.js";
37
- import te from "../components/button-group.js";
38
- import ee from "../components/checkbox.js";
39
- function ie(t) {
40
- return t && t.length ? Kt(t) : [];
30
+ import { C as gt } from "./option.DyNR1vzy.js";
31
+ import xt from "../components/select.js";
32
+ import te from "../components/position-picker.js";
33
+ import { c as ee } from "./image.Y5c_hFx8.js";
34
+ import { e as Y } from "./query.BBf1UFkC.js";
35
+ import { c as ot } from "./repeat.CFjcER6_.js";
36
+ import { o as D } from "./style-map.llVFPd__.js";
37
+ import Lt from "../components/tooltip.js";
38
+ import ie from "../components/button-group.js";
39
+ import se from "../components/checkbox.js";
40
+ function ae(t) {
41
+ return t && t.length ? Zt(t) : [];
41
42
  }
42
- function se(t) {
43
+ function oe(t) {
43
44
  return typeof t == "object" && t !== null && "URI" in t;
44
45
  }
45
- const ae = {
46
+ const re = {
46
47
  artist: "Artist",
47
48
  color: "Color",
48
49
  createDate: "CreateDate",
@@ -64,7 +65,7 @@ const ae = {
64
65
  systemIdentifier: "SystemIdentifier",
65
66
  text: "Text",
66
67
  title: "Title"
67
- }, oe = /* @__PURE__ */ new Set(["mediaDate", "createDate", "editDate"]);
68
+ }, ne = /* @__PURE__ */ new Set(["mediaDate", "createDate", "editDate"]);
68
69
  function zt(t) {
69
70
  return !/[\s&+/*"\\:(),'<>~|[\]{}]/.test(t) && !/^(?:OR|AND|NOT)$/.test(t) ? t : `"${t.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
70
71
  }
@@ -72,27 +73,27 @@ function Ft(t, e) {
72
73
  const s = (Array.isArray(e) ? e : [e]).map((a) => `${t}:${zt(a)}`);
73
74
  return s.length > 1 ? `(${s.join(" OR ")})` : s[0] ?? "";
74
75
  }
75
- function re(t, e) {
76
+ function he(t, e) {
76
77
  return (Array.isArray(e) ? e : [e]).map((s) => `${t}${s.operator}${s.value}`).join(" AND ");
77
78
  }
78
- function he(t) {
79
+ function le(t) {
79
80
  const e = [];
80
81
  for (const i of Object.keys(t)) {
81
82
  const s = i, a = t[s];
82
83
  if (a == null)
83
84
  continue;
84
85
  if (s === "custom") {
85
- for (const [h, n] of Object.entries(
86
+ for (const [n, h] of Object.entries(
86
87
  a
87
88
  ))
88
- e.push(Ft(h, n));
89
+ e.push(Ft(n, h));
89
90
  continue;
90
91
  }
91
- const r = ae[s];
92
+ const r = re[s];
92
93
  if (r) {
93
- if (oe.has(s)) {
94
+ if (ne.has(s)) {
94
95
  e.push(
95
- re(r, a)
96
+ he(r, a)
96
97
  );
97
98
  continue;
98
99
  }
@@ -101,14 +102,14 @@ function he(t) {
101
102
  continue;
102
103
  }
103
104
  if (s === "parentFolderIdentifier") {
104
- const h = Array.isArray(a) ? a : [a];
105
- if (h.length === 0)
105
+ const n = Array.isArray(a) ? a : [a];
106
+ if (n.length === 0)
106
107
  continue;
107
- const n = [
108
- ...h.map((d) => `ParentFolderIdentifier:${zt(String(d))}`),
109
- ...h.map((d) => `ParentAlbumIdentifier:${zt(String(d))}`)
108
+ const h = [
109
+ ...n.map((d) => `ParentFolderIdentifier:${zt(String(d))}`),
110
+ ...n.map((d) => `ParentAlbumIdentifier:${zt(String(d))}`)
110
111
  ];
111
- e.push(`(${n.join(" OR ")})`);
112
+ e.push(`(${h.join(" OR ")})`);
112
113
  continue;
113
114
  }
114
115
  e.push(Ft(r, a));
@@ -127,123 +128,123 @@ function ht(t) {
127
128
  const e = ht(t.not);
128
129
  return e ? `NOT (${e})` : "";
129
130
  }
130
- return he(t);
131
+ return le(t);
131
132
  }
132
- const wt = "CoreField.LargeSizePreview", nt = "CoreField.DocType", ne = "Document.Title", le = "Document.CaptionLong", lt = "Document.FileExtension", Mt = "CoreField.FileSize", _t = "CoreField.Identifier", It = "CoreField.Keywords", ct = "CoreField.MaxHeight", pt = "CoreField.MaxWidth", dt = "Document.RecordID", Et = "CoreField.DocSubType", Lt = "CoreField.TitleWithFallback", ut = "CoreField.OriginalFileName", mt = "CoreField.UpdatedFileName", Y = "CoreField.OriginalPreview", St = {
133
+ const wt = "CoreField.LargeSizePreview", lt = "CoreField.DocType", ce = "Document.Title", pe = "Document.CaptionLong", ct = "Document.FileExtension", _t = "CoreField.FileSize", It = "CoreField.Identifier", Et = "CoreField.Keywords", pt = "CoreField.MaxHeight", dt = "CoreField.MaxWidth", ut = "Document.RecordID", Ht = "CoreField.DocSubType", Ut = "CoreField.TitleWithFallback", mt = "CoreField.OriginalFileName", ft = "CoreField.UpdatedFileName", tt = "CoreField.OriginalPreview", Ct = {
133
134
  DEFAULT_VIEW_SIZE: "Document.LargeSizePreview",
134
135
  FIELD_TITLE_WITH_FALLBACK: "Document.TitleWithFallback",
135
136
  ORIGINAL_VIEW_SIZE: "Document.OriginalPreview"
136
- }, Ut = {
137
- [wt]: St.DEFAULT_VIEW_SIZE,
138
- [Lt]: St.FIELD_TITLE_WITH_FALLBACK,
139
- [Y]: St.ORIGINAL_VIEW_SIZE
140
- }, ce = Object.fromEntries(
141
- Object.entries(Ut).map(([t, e]) => [
137
+ }, Bt = {
138
+ [wt]: Ct.DEFAULT_VIEW_SIZE,
139
+ [Ut]: Ct.FIELD_TITLE_WITH_FALLBACK,
140
+ [tt]: Ct.ORIGINAL_VIEW_SIZE
141
+ }, de = Object.fromEntries(
142
+ Object.entries(Bt).map(([t, e]) => [
142
143
  e,
143
144
  t
144
145
  ])
145
146
  );
146
- function pe(t) {
147
- return Ut[t] ?? t;
147
+ function ue(t) {
148
+ return Bt[t] ?? t;
148
149
  }
149
- function Ht(t) {
150
+ function Tt(t) {
150
151
  const e = {};
151
152
  for (const [i, s] of Object.entries(t)) {
152
- const a = ce[i] ?? i;
153
+ const a = de[i] ?? i;
153
154
  e[a] = s;
154
155
  }
155
156
  return e;
156
157
  }
157
- async function Bt({
158
+ async function qt({
158
159
  countPerPage: t,
159
160
  fields: e,
160
161
  getPermanentAssetsPaths: i,
161
162
  isSiteBuilder: s,
162
163
  pageNumber: a,
163
164
  query: r,
164
- securityByPassToken: h,
165
- siteUrl: n,
165
+ securityByPassToken: n,
166
+ siteUrl: h,
166
167
  sort: d,
167
168
  token: m,
168
169
  useSession: c
169
170
  }) {
170
- const f = e?.map(pe);
171
+ const f = e?.map(ue);
171
172
  try {
172
- return (await M.request({
173
- baseURL: n,
173
+ return (await I.request({
174
+ baseURL: h,
174
175
  headers: m ? { Authorization: `Bearer ${m}` } : void 0,
175
176
  method: "GET",
176
177
  params: {
177
178
  CountPerPage: t,
178
- Fields: ie(f),
179
+ Fields: ae(f),
179
180
  Format: "json",
180
181
  GetPermanentAssetsPaths: i || void 0,
181
182
  PageNumber: a,
182
183
  Query: ht(r),
183
- SecurityByPassToken: h || void 0,
184
+ SecurityByPassToken: n || void 0,
184
185
  Sort: d || void 0,
185
186
  UseSession: c || void 0
186
187
  },
187
188
  paramsSerializer: { indexes: null },
188
189
  responseType: "json",
189
190
  transformResponse: [
190
- ...Array.isArray(M.defaults.transformResponse) ? M.defaults.transformResponse : [],
191
+ ...Array.isArray(I.defaults.transformResponse) ? I.defaults.transformResponse : [],
191
192
  s ? (p) => ({
192
- items: (p.results?.Items ?? []).map(Ht),
193
+ items: (p.results?.Items ?? []).map(Tt),
193
194
  sort: p.results?.GlobalInfo?.Sort ?? "",
194
195
  totalCount: p.results?.GlobalInfo?.TotalCount ?? 0
195
196
  }) : (p) => ({
196
- items: (p.APIResponse?.Items ?? []).map(Ht),
197
+ items: (p.APIResponse?.Items ?? []).map(Tt),
197
198
  sort: p.APIResponse?.GlobalInfo?.Sort ?? "",
198
199
  totalCount: p.APIResponse?.GlobalInfo?.TotalCount ?? 0
199
200
  })
200
201
  ],
201
- url: s ? Nt.SEARCH_ASSETS : qt["4.0"]
202
+ url: s ? Ot.SEARCH_ASSETS : jt["4.0"]
202
203
  })).data;
203
204
  } catch {
204
205
  return { items: [], sort: "", totalCount: 0 };
205
206
  }
206
207
  }
207
- async function de({
208
+ async function me({
208
209
  assetId: t,
209
210
  extension: e,
210
211
  format: i,
211
212
  siteUrl: s,
212
213
  token: a,
213
214
  transformations: r,
214
- useSession: h
215
+ useSession: n
215
216
  }) {
216
217
  try {
217
- return (await M.request({
218
+ return (await I.request({
218
219
  baseURL: s,
219
220
  method: "GET",
220
221
  params: {
221
222
  SourceAssetFormat: i,
222
223
  SourceAssetRecordID: t,
223
- TargetExtension: Xt(e),
224
+ TargetExtension: Kt(e),
224
225
  Token: a || void 0,
225
226
  Transformations: r,
226
- UseSession: h || void 0
227
+ UseSession: n || void 0
227
228
  },
228
229
  /**
229
230
  * https://link.orangelogic.com/Tasks/41S1XH
230
231
  */
231
232
  timeout: 3e5,
232
233
  // 5 minutes
233
- url: Dt.GET_TRANSFORM_ASSET_LINK
234
+ url: Nt.GET_TRANSFORM_ASSET_LINK
234
235
  })).data;
235
236
  } catch {
236
237
  return null;
237
238
  }
238
239
  }
239
- const ue = 50;
240
- function me(t, e) {
240
+ const fe = 50;
241
+ function ge(t, e) {
241
242
  const i = [];
242
243
  for (let s = 0; s < t.length; s += e)
243
244
  i.push(t.slice(s, s + e));
244
245
  return i;
245
246
  }
246
- async function fe({
247
+ async function xe({
247
248
  extraFields: t,
248
249
  getPermanentAssetsPaths: e,
249
250
  isSiteBuilder: i,
@@ -253,19 +254,19 @@ async function fe({
253
254
  }) {
254
255
  if (!Array.isArray(s) || s.length === 0)
255
256
  return { facets: [], items: [], totalCount: 0 };
256
- const h = t?.filter((p) => p && typeof p == "string") ?? [], n = [
257
- ...h,
258
- Y,
257
+ const n = t?.filter((p) => p && typeof p == "string") ?? [], h = [
258
+ ...n,
259
+ tt,
260
+ ft,
259
261
  mt,
260
- ut,
261
- ne,
262
- le,
263
- dt
264
- ], d = me(s, ue), m = await Promise.all(
262
+ ce,
263
+ pe,
264
+ ut
265
+ ], d = ge(s, fe), m = await Promise.all(
265
266
  d.map(
266
- (p) => Bt({
267
+ (p) => qt({
267
268
  countPerPage: p.length,
268
- fields: n,
269
+ fields: h,
269
270
  getPermanentAssetsPaths: e,
270
271
  isSiteBuilder: i,
271
272
  pageNumber: 1,
@@ -275,13 +276,13 @@ async function fe({
275
276
  })
276
277
  )
277
278
  ), c = new Map(s.map((p, w) => [p, w])), f = m.flatMap((p) => p.items).map((p) => {
278
- let w = C(p, mt);
279
- return w === "" && (w = C(p, ut)), {
279
+ let w = k(p, ft);
280
+ return w === "" && (w = k(p, mt)), {
280
281
  name: w,
281
- originalUrl: C(p, Y),
282
- recordId: C(p, dt),
283
- ...h.reduce(
284
- (R, x) => (R[x] = C(p, x), R),
282
+ originalUrl: k(p, tt),
283
+ recordId: k(p, ut),
284
+ ...n.reduce(
285
+ (b, x) => (b[x] = k(p, x), b),
285
286
  {}
286
287
  )
287
288
  };
@@ -293,87 +294,87 @@ async function fe({
293
294
  );
294
295
  return { facets: [], items: f, totalCount: S };
295
296
  }
296
- function C(t, e) {
297
+ function k(t, e) {
297
298
  const i = t[e];
298
- return i == null ? "" : typeof i == "string" ? i : typeof i == "number" || typeof i == "boolean" ? String(i) : se(i) ? i.URI : "";
299
+ return i == null ? "" : typeof i == "string" ? i : typeof i == "number" || typeof i == "boolean" ? String(i) : oe(i) ? i.URI : "";
299
300
  }
300
- async function ge({
301
+ async function ye({
301
302
  countPerPage: t,
302
303
  directParentFolderIdentifier: e,
303
304
  extraFields: i,
304
305
  getPermanentAssetsPaths: s,
305
306
  isSiteBuilder: a,
306
307
  limitedDocTypes: r,
307
- pageNumber: h,
308
- parentFolderIdentifier: n,
308
+ pageNumber: n,
309
+ parentFolderIdentifier: h,
309
310
  searchTerm: d,
310
311
  securityByPassToken: m,
311
312
  sortOrder: c,
312
313
  token: f
313
314
  }) {
314
- if (!e && !n)
315
+ if (!e && !h)
315
316
  return { facets: [], items: [], totalCount: 0 };
316
317
  const S = (i?.filter((x) => x && typeof x == "string") ?? []).map((x) => x.replace("%20", " ")), p = {
317
318
  directParentFolderIdentifier: e,
318
- parentFolderIdentifier: n,
319
- ...r.length > 0 ? { docType: [Rt.Image, Rt.Audio] } : {}
320
- }, w = await Bt({
319
+ parentFolderIdentifier: h,
320
+ ...r.length > 0 ? { docType: [$t.Image, $t.Audio] } : {}
321
+ }, w = await qt({
321
322
  countPerPage: t,
322
323
  fields: [
323
324
  ...S,
324
- Lt,
325
+ Ut,
325
326
  wt,
326
- Y,
327
- It,
328
- pt,
329
- ct,
330
- Mt,
331
- nt,
327
+ tt,
332
328
  Et,
329
+ dt,
330
+ pt,
333
331
  _t,
334
332
  lt,
335
- dt,
333
+ Ht,
334
+ It,
335
+ ct,
336
336
  ut,
337
- mt
337
+ mt,
338
+ ft
338
339
  ],
339
340
  getPermanentAssetsPaths: s,
340
341
  isSiteBuilder: a,
341
- pageNumber: h,
342
+ pageNumber: n,
342
343
  query: p,
343
344
  securityByPassToken: m,
344
345
  sort: void 0,
345
346
  token: f
346
- }), R = w.items.map((x) => {
347
- let E = C(x, lt), P = C(x, mt), it = C(x, wt);
348
- E && !E.startsWith(".") && (E = "." + E), P === "" && (P = C(x, ut)), E.toLowerCase() === ".gif" && (it = C(x, Y));
349
- const yt = C(x, dt);
347
+ }), b = w.items.map((x) => {
348
+ let F = k(x, ct), P = k(x, ft), st = k(x, wt);
349
+ F && !F.startsWith(".") && (F = "." + F), P === "" && (P = k(x, mt)), F.toLowerCase() === ".gif" && (st = k(x, tt));
350
+ const St = k(x, ut);
350
351
  return {
351
- docSubType: C(x, Et),
352
- docType: C(x, nt) || "",
353
- extension: E,
354
- height: C(x, ct) || "0",
355
- id: yt,
356
- identifier: C(x, _t),
357
- imageUrl: it,
352
+ docSubType: k(x, Ht),
353
+ docType: k(x, lt) || "",
354
+ extension: F,
355
+ height: k(x, pt) || "0",
356
+ id: St,
357
+ identifier: k(x, It),
358
+ imageUrl: st,
358
359
  name: P,
359
- originalUrl: C(x, Y),
360
- recordId: yt,
361
- size: C(x, Mt) || "0 MB",
362
- tags: C(x, It),
363
- width: C(x, pt) || "0",
360
+ originalUrl: k(x, tt),
361
+ recordId: St,
362
+ size: k(x, _t) || "0 MB",
363
+ tags: k(x, Et),
364
+ width: k(x, dt) || "0",
364
365
  ...S.reduce(
365
- (Q, st) => (Q[st] = C(x, st), Q),
366
+ (X, at) => (X[at] = k(x, at), X),
366
367
  {}
367
368
  )
368
369
  };
369
370
  });
370
371
  return {
371
372
  facets: [],
372
- items: R,
373
+ items: b,
373
374
  totalCount: w.totalCount
374
375
  };
375
376
  }
376
- async function xe({
377
+ async function Se({
377
378
  autoCropMode: t,
378
379
  cropHeight: e,
379
380
  cropWidth: i,
@@ -381,7 +382,7 @@ async function xe({
381
382
  useSession: a
382
383
  }) {
383
384
  try {
384
- return (await M.request({
385
+ return (await I.request({
385
386
  method: "GET",
386
387
  params: {
387
388
  AutoCropMode: t,
@@ -394,21 +395,21 @@ async function xe({
394
395
  timeout: 3e5,
395
396
  // 5 minutes
396
397
  transformResponse: [
397
- ...Array.isArray(M.defaults.transformResponse) ? M.defaults.transformResponse : [],
398
- (h) => ({
399
- height: h.cropHeight,
400
- width: h.cropWidth,
401
- x: h.cropX,
402
- y: h.cropY
398
+ ...Array.isArray(I.defaults.transformResponse) ? I.defaults.transformResponse : [],
399
+ (n) => ({
400
+ height: n.cropHeight,
401
+ width: n.cropWidth,
402
+ x: n.cropX,
403
+ y: n.cropY
403
404
  })
404
405
  ],
405
- url: Dt.GET_CROP_ZONE_SUGGESTION
406
+ url: Nt.GET_CROP_ZONE_SUGGESTION
406
407
  })).data;
407
408
  } catch {
408
409
  return null;
409
410
  }
410
411
  }
411
- async function Ri({
412
+ async function Mi({
412
413
  assetRecordId: t,
413
414
  isSiteBuilder: e,
414
415
  siteUrl: i,
@@ -416,7 +417,7 @@ async function Ri({
416
417
  useSession: a
417
418
  }) {
418
419
  try {
419
- return (await M.request({
420
+ return (await I.request({
420
421
  baseURL: i,
421
422
  method: "GET",
422
423
  params: {
@@ -426,35 +427,35 @@ async function Ri({
426
427
  },
427
428
  responseType: "json",
428
429
  transformResponse: [
429
- ...Array.isArray(M.defaults.transformResponse) ? M.defaults.transformResponse : [],
430
- (h) => !h || typeof h != "object" ? [] : h.proxies?.map((n) => ({
431
- cdnName: n.cdnName,
432
- extension: n.extension,
433
- formatHeight: n.formatHeight,
434
- formatWidth: n.formatWidth,
435
- height: n.height,
436
- permanentLink: n.permanentLink,
437
- proxyLabel: n.proxyLabel,
438
- proxyName: n.proxyName,
439
- width: n.width
430
+ ...Array.isArray(I.defaults.transformResponse) ? I.defaults.transformResponse : [],
431
+ (n) => !n || typeof n != "object" ? [] : n.proxies?.map((h) => ({
432
+ cdnName: h.cdnName,
433
+ extension: h.extension,
434
+ formatHeight: h.formatHeight,
435
+ formatWidth: h.formatWidth,
436
+ height: h.height,
437
+ permanentLink: h.permanentLink,
438
+ proxyLabel: h.proxyLabel,
439
+ proxyName: h.proxyName,
440
+ width: h.width
440
441
  })) ?? []
441
442
  ],
442
- url: e ? Nt.GET_AVAILABLE_PROXIES : Gt
443
+ url: e ? Ot.GET_AVAILABLE_PROXIES : Qt
443
444
  })).data;
444
445
  } catch {
445
446
  return [];
446
447
  }
447
448
  }
448
- async function $i({
449
+ async function Fi({
449
450
  siteUrl: t
450
451
  } = {}) {
451
452
  try {
452
- return (await M.request({
453
+ return (await I.request({
453
454
  baseURL: t,
454
455
  method: "GET",
455
456
  responseType: "json",
456
457
  transformResponse: [
457
- ...Array.isArray(M.defaults.transformResponse) ? M.defaults.transformResponse : [],
458
+ ...Array.isArray(I.defaults.transformResponse) ? I.defaults.transformResponse : [],
458
459
  (i) => !i || typeof i != "object" ? {
459
460
  formatsByDocType: {
460
461
  Audio: {},
@@ -466,13 +467,13 @@ async function $i({
466
467
  formatsByDocType: i.formatsByDocType ?? {}
467
468
  }
468
469
  ],
469
- url: jt
470
+ url: Vt
470
471
  })).data;
471
472
  } catch {
472
473
  return { formatsByDocType: {} };
473
474
  }
474
475
  }
475
- async function Pi({
476
+ async function _i({
476
477
  recordIds: t,
477
478
  rightsToCheck: e
478
479
  }) {
@@ -483,19 +484,19 @@ async function Pi({
483
484
  invalidObjects: []
484
485
  };
485
486
  try {
486
- const { data: s } = await M.request({
487
+ const { data: s } = await I.request({
487
488
  method: "GET",
488
489
  params: { RecordIDs: t, RightsToCheck: e },
489
490
  paramsSerializer: { indexes: null },
490
491
  responseType: "json",
491
- url: Vt.GET_AUTHORIZED_OBJECTS
492
+ url: Gt.GET_AUTHORIZED_OBJECTS
492
493
  });
493
494
  return s;
494
495
  } catch {
495
496
  return i;
496
497
  }
497
498
  }
498
- const Tt = 20, Wt = "TR1", ye = /* @__PURE__ */ new Set([
499
+ const Wt = 20, Dt = "TR1", Ce = /* @__PURE__ */ new Set([
499
500
  ".avif",
500
501
  ".bmp",
501
502
  ".gif",
@@ -508,15 +509,15 @@ const Tt = 20, Wt = "TR1", ye = /* @__PURE__ */ new Set([
508
509
  ]);
509
510
  function At(t) {
510
511
  const e = t.toLowerCase(), i = e.startsWith(".") ? e : `.${e}`;
511
- return ye.has(i);
512
+ return Ce.has(i);
512
513
  }
513
- class Fi {
514
+ class Ii {
514
515
  constructor(e, i) {
515
- this.data = [], this.folderId = "", this.fetchedPages = /* @__PURE__ */ new Set(), this.totalCount = 0, this.maxEnd = 1 / 0, this.pageSize = Tt, this.requestEpoch = 0, this.host = e, this.host.addController?.(this);
516
+ this.data = [], this.folderId = "", this.fetchedPages = /* @__PURE__ */ new Set(), this.totalCount = 0, this.maxEnd = 1 / 0, this.pageSize = Wt, this.requestEpoch = 0, this.host = e, this.host.addController?.(this);
516
517
  const s = i?.maxEnd;
517
518
  this.maxEnd = typeof s == "number" && Number.isFinite(s) && s >= 0 ? Math.floor(s) : 1 / 0;
518
519
  const a = i?.pageSize;
519
- this.pageSize = typeof a == "number" && Number.isFinite(a) && a >= 1 ? Math.floor(a) : Tt, this.authToken = i?.token, this.securityByPassToken = i?.securityByPassToken, this.isSiteBuilder = i?.isSiteBuilder ?? !1;
520
+ this.pageSize = typeof a == "number" && Number.isFinite(a) && a >= 1 ? Math.floor(a) : Wt, this.authToken = i?.token, this.securityByPassToken = i?.securityByPassToken, this.isSiteBuilder = i?.isSiteBuilder ?? !1;
520
521
  }
521
522
  get totalDataCount() {
522
523
  return this.totalCount;
@@ -535,14 +536,14 @@ class Fi {
535
536
  return this.data;
536
537
  if (this.totalCount > 0 && e >= this.totalCount && (e = this.totalCount - 1, e < a))
537
538
  return this.data;
538
- const h = this.requestEpoch;
539
- if (!this.folderId || h !== this.requestEpoch)
539
+ const n = this.requestEpoch;
540
+ if (!this.folderId || n !== this.requestEpoch)
540
541
  return this.data;
541
- const n = s ? `path_${s}` : void 0, d = s === "TRX", m = `path_${Wt}`, c = n ? d && n !== m ? [n, m] : [n] : [], f = Math.floor(a / this.pageSize) + 1, S = Math.floor(e / this.pageSize) + 1;
542
+ const h = s ? `path_${s}` : void 0, d = s === "TRX", m = `path_${Dt}`, c = h ? d && h !== m ? [h, m] : [h] : [], f = Math.floor(a / this.pageSize) + 1, S = Math.floor(e / this.pageSize) + 1;
542
543
  for (let p = f; p <= S; p++) {
543
544
  if (this.fetchedPages.has(p))
544
545
  continue;
545
- const w = await ge({
546
+ const w = await ye({
546
547
  countPerPage: this.pageSize,
547
548
  directParentFolderIdentifier: this.folderId,
548
549
  extraFields: [...i, ...c],
@@ -555,31 +556,31 @@ class Fi {
555
556
  sortOrder: "",
556
557
  token: this.authToken
557
558
  });
558
- if (h !== this.requestEpoch)
559
+ if (n !== this.requestEpoch)
559
560
  return this.data;
560
561
  if (this.fetchedPages.add(p), !this.totalCount && w.totalCount) {
561
562
  const x = Math.min(this.maxEnd, w.totalCount);
562
563
  this.totalCount = x, this.data = Array.from({ length: x }, () => ({
563
564
  alt: "",
564
- id: `temp-${Zt()}`,
565
+ id: `temp-${Yt()}`,
565
566
  name: "",
566
567
  src: ""
567
568
  }));
568
569
  }
569
- const R = (p - 1) * this.pageSize;
570
+ const b = (p - 1) * this.pageSize;
570
571
  for (let x = 0; x < w.items.length; x++) {
571
- const E = R + x;
572
- if (E < this.data.length) {
573
- const P = w.items[x], it = !P.extension || At(P.extension);
574
- let Q = n && (!d || it) && P[n] || d && !it && P[m] || P.imageUrl;
575
- Q && r && r.length > 0 && (Q = $t(Q, r)), this.data[E] = {
572
+ const F = b + x;
573
+ if (F < this.data.length) {
574
+ const P = w.items[x], st = !P.extension || At(P.extension);
575
+ let X = h && (!d || st) && P[h] || d && !st && P[m] || P.imageUrl;
576
+ X && r && r.length > 0 && (X = Pt(X, r)), this.data[F] = {
576
577
  alt: P.name,
577
578
  docType: P.docType,
578
579
  id: P.id,
579
580
  name: P.name,
580
- src: Q,
581
+ src: X,
581
582
  ...i.reduce(
582
- (st, kt) => (st[kt] = P[kt] ?? "", st),
583
+ (at, Rt) => (at[Rt] = P[Rt] ?? "", at),
583
584
  {}
584
585
  )
585
586
  };
@@ -593,19 +594,19 @@ class Fi {
593
594
  folderId: s,
594
595
  forceRefetch: a = !1,
595
596
  format: r,
596
- minLimit: h = 5,
597
- noPlaceholders: n = !1,
597
+ minLimit: n = 5,
598
+ noPlaceholders: h = !1,
598
599
  transformations: d
599
600
  }) {
600
601
  (!this.folderId || this.folderId !== s) && (this.folderId = s, this.resetFolderState()), a && this.resetPageCache();
601
- const m = Math.max(5, h), c = e, f = e + m, S = [
602
+ const m = Math.max(5, n), c = e, f = e + m, S = [
602
603
  ...i,
603
- ct,
604
- pt
604
+ pt,
605
+ dt
605
606
  ];
606
607
  await this.fetchImages({
607
608
  end: f,
608
- extraFields: S.filter((R) => R !== ""),
609
+ extraFields: S.filter((b) => b !== ""),
609
610
  format: r,
610
611
  start: c,
611
612
  transformations: d
@@ -615,11 +616,11 @@ class Fi {
615
616
  const w = p + m;
616
617
  return await this.fetchImages({
617
618
  end: w,
618
- extraFields: S.filter((R) => R !== ""),
619
+ extraFields: S.filter((b) => b !== ""),
619
620
  format: r,
620
621
  start: p,
621
622
  transformations: d
622
- }), n ? this.data.filter((R) => R.id && !R.id.startsWith("temp-")) : this.data;
623
+ }), h ? this.data.filter((b) => b.id && !b.id.startsWith("temp-")) : this.data;
623
624
  }
624
625
  async fetchImagesByIDs({
625
626
  extraFields: e = [],
@@ -629,13 +630,13 @@ class Fi {
629
630
  }) {
630
631
  if (s.length === 0)
631
632
  return [];
632
- const r = i ? `path_${i}` : void 0, h = i === "TRX", n = `path_${Wt}`, d = r ? h && r !== n ? [r, n] : [r] : [], m = h ? [lt] : [], c = [
633
+ const r = i ? `path_${i}` : void 0, n = i === "TRX", h = `path_${Dt}`, d = r ? n && r !== h ? [r, h] : [r] : [], m = n ? [ct] : [], c = [
633
634
  ...e,
634
- nt,
635
- ct,
636
- pt
635
+ lt,
636
+ pt,
637
+ dt
637
638
  ];
638
- return (await fe({
639
+ return (await xe({
639
640
  extraFields: [...c, ...d, ...m].filter((S) => S !== ""),
640
641
  getPermanentAssetsPaths: d.length > 0 || void 0,
641
642
  isSiteBuilder: this.isSiteBuilder,
@@ -643,16 +644,16 @@ class Fi {
643
644
  securityByPassToken: this.securityByPassToken,
644
645
  token: this.authToken
645
646
  })).items.map((S) => {
646
- const p = h && S[lt] || "", w = !p || At(p);
647
- let x = r && (!h || w) && S[r] || h && !w && S[n] || S.originalUrl;
648
- return x && a && a.length > 0 && (x = $t(x, a)), {
647
+ const p = n && S[ct] || "", w = !p || At(p);
648
+ let x = r && (!n || w) && S[r] || n && !w && S[h] || S.originalUrl;
649
+ return x && a && a.length > 0 && (x = Pt(x, a)), {
649
650
  alt: S.name,
650
- docType: S[nt],
651
+ docType: S[lt],
651
652
  id: S.recordId,
652
653
  name: S.name,
653
654
  src: x,
654
655
  ...c.reduce(
655
- (E, P) => (E[P] = S[P] ?? "", E),
656
+ (F, P) => (F[P] = S[P] ?? "", F),
656
657
  {}
657
658
  )
658
659
  };
@@ -664,12 +665,12 @@ class Fi {
664
665
  forceRefetch: s = !1,
665
666
  format: a,
666
667
  noPlaceholders: r = !1,
667
- page: h,
668
- pageSize: n = 10,
668
+ page: n,
669
+ pageSize: h = 10,
669
670
  transformations: d
670
671
  }) {
671
672
  (!this.folderId || this.folderId !== i) && (this.folderId = i, this.resetFolderState()), s && this.resetPageCache();
672
- const m = h * n, c = m + n - 1;
673
+ const m = n * h, c = m + h - 1;
673
674
  return await this.fetchImages({
674
675
  end: c,
675
676
  extraFields: e,
@@ -684,8 +685,8 @@ class Fi {
684
685
  extraFields: s = [],
685
686
  folderId: a,
686
687
  forceRefetch: r = !1,
687
- format: h,
688
- start: n = 0,
688
+ format: n,
689
+ start: h = 0,
689
690
  transformations: d
690
691
  }) {
691
692
  const m = Math.max(1, e);
@@ -693,17 +694,17 @@ class Fi {
693
694
  await this.fetchImages({
694
695
  end: i,
695
696
  extraFields: s,
696
- format: h,
697
- start: n,
697
+ format: n,
698
+ start: h,
698
699
  transformations: d
699
700
  }), yield this.data;
700
701
  return;
701
702
  }
702
- let c = n, f = n + m;
703
+ let c = h, f = h + m;
703
704
  if (await this.fetchImages({
704
705
  end: f,
705
706
  extraFields: s,
706
- format: h,
707
+ format: n,
707
708
  start: c,
708
709
  transformations: d
709
710
  }), yield this.data, !(!this.totalCount || this.totalCount <= f))
@@ -711,7 +712,7 @@ class Fi {
711
712
  c = f, f = Math.min(f + m, this.totalCount), await this.fetchImages({
712
713
  end: f,
713
714
  extraFields: s,
714
- format: h,
715
+ format: n,
715
716
  start: c,
716
717
  transformations: d
717
718
  }), yield this.data;
@@ -728,15 +729,15 @@ class Fi {
728
729
  this.resetPageCache();
729
730
  }
730
731
  }
731
- const Se = B`.asset-link-format__details{--header-padding:var(--cx-spacing-small) var(--cx-spacing-medium)}.asset-link-format__details::part(icon){width:var(--cx-font-size-3x-large);height:var(--cx-font-size-3x-large);background-color:var(--cx-color-neutral-100);border-radius:var(--cx-border-radius-large);color:var(--cx-color-neutral-600);font-size:var(--cx-font-size-large);justify-content:center;align-items:center;display:flex}.asset-link-format__details::part(input-label){color:var(--cx-color-neutral-400);margin-inline-start:var(--cx-spacing-small)}.asset-link-format__header{padding:var(--cx-spacing-medium)}.asset-link-format__section-header{padding:0 var(--cx-spacing-medium);border-top:var(--section-header-border-width,1px) solid var(--cx-color-neutral-200);background-color:var(--cx-color-neutral-50)}.asset-link-format__undo,.asset-link-format__reset{--color:var(--cx-color-primary);--background-color:transparent}`, ze = B`cx-details::part(base){border-bottom-width:0}cx-space{width:100%}cx-space cx-input{flex:1}.crop__unit-select{width:120px}.crop__input-group{flex:1;display:flex}`;
732
- var we = Object.defineProperty, Ae = Object.getOwnPropertyDescriptor, v = (t, e, i, s) => {
733
- for (var a = s > 1 ? void 0 : s ? Ae(e, i) : e, r = t.length - 1, h; r >= 0; r--)
734
- (h = t[r]) && (a = (s ? h(e, i, a) : h(a)) || a);
735
- return s && a && we(e, i, a), a;
732
+ const ze = q`.asset-link-format__details{--header-padding:var(--cx-spacing-small) var(--cx-spacing-medium)}.asset-link-format__details::part(icon){width:var(--cx-font-size-3x-large);height:var(--cx-font-size-3x-large);background-color:var(--cx-color-neutral-100);border-radius:var(--cx-border-radius-large);color:var(--cx-color-neutral-600);font-size:var(--cx-font-size-large);justify-content:center;align-items:center;display:flex}.asset-link-format__details::part(input-label){color:var(--cx-color-neutral-400);margin-inline-start:var(--cx-spacing-small)}.asset-link-format__header{padding:var(--cx-spacing-medium)}.asset-link-format__section-header{padding:0 var(--cx-spacing-medium);border-top:var(--section-header-border-width,1px) solid var(--cx-color-neutral-200);background-color:var(--cx-color-neutral-50)}.asset-link-format__undo,.asset-link-format__reset{--color:var(--cx-color-primary);--background-color:transparent}`, we = q`cx-details::part(base){border-bottom-width:0}cx-space{width:100%}cx-space cx-input{flex:1}.crop__unit-select{width:120px}.crop__input-group{flex:1;display:flex}`;
733
+ var Ae = Object.defineProperty, ve = Object.getOwnPropertyDescriptor, z = (t, e, i, s) => {
734
+ for (var a = s > 1 ? void 0 : s ? ve(e, i) : e, r = t.length - 1, n; r >= 0; r--)
735
+ (n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
736
+ return s && a && Ae(e, i, a), a;
736
737
  };
737
- let z = class extends U {
738
+ let C = class extends B {
738
739
  constructor() {
739
- super(...arguments), this.localize = new q(this), this.open = !1, this.width = 0, this.height = 0, this.maxWidth = 0, this.maxHeight = 0, this.ratioWidth = 1, this.ratioHeight = 1, this.percentageWidth = 0, this.percentageHeight = 0, this.unit = o.Pixel, this.disabledApply = !1, this.noRatioModes = !1, this.lastAppliedSetting = {
740
+ super(...arguments), this.localize = new j(this), this.open = !1, this.width = 0, this.height = 0, this.maxWidth = 0, this.maxHeight = 0, this.ratioWidth = 1, this.ratioHeight = 1, this.percentageWidth = 0, this.percentageHeight = 0, this.unit = o.Pixel, this.disabledApply = !1, this.noRatioModes = !1, this.showPositionPicker = !1, this.lastAppliedSetting = {
740
741
  [o.Pixel]: {
741
742
  height: 0,
742
743
  percentageHeight: 100,
@@ -755,7 +756,7 @@ let z = class extends U {
755
756
  x: 0,
756
757
  y: 0
757
758
  }
758
- }, this.loading = !1, this.cropModes = [], this.focusModes = [], this.focusMode = "manual", this.cropMode = "free", this.keepAspectRatio = !1, this.invalidWidth = !1, this.invalidHeight = !1, this.aspectRatio = 0;
759
+ }, this.loading = !1, this.cropModes = [], this.focusModes = [], this.focusMode = "manual", this.cropMode = "free", this.position = W.CenterCenter, this.keepAspectRatio = !1, this.invalidWidth = !1, this.invalidHeight = !1, this.aspectRatio = 0;
759
760
  }
760
761
  get selectedMode() {
761
762
  return this.cropModes.find((t) => t.value === this.cropMode);
@@ -847,15 +848,15 @@ let z = class extends U {
847
848
  else if (!i) {
848
849
  const [s, a] = e.split(":").map(Number);
849
850
  if (this.unit === o.Pixel) {
850
- let r = s, h = a;
851
- Number.isFinite(this.maxWidth) && Number.isFinite(this.maxHeight) && ({ height: h, width: r } = Jt(
851
+ let r = s, n = a;
852
+ Number.isFinite(this.maxWidth) && Number.isFinite(this.maxHeight) && ({ height: n, width: r } = ee(
852
853
  this.maxWidth,
853
854
  this.maxHeight,
854
855
  s,
855
856
  a
856
857
  )), this.emit("cx-asset-link-format-crop-change", {
857
858
  detail: {
858
- height: h,
859
+ height: n,
859
860
  keepAspectRatio: !0,
860
861
  silent: !0,
861
862
  unit: o.Pixel,
@@ -887,6 +888,13 @@ let z = class extends U {
887
888
  }
888
889
  });
889
890
  }
891
+ onPositionChange() {
892
+ this.emit("cx-asset-link-format-crop-position-change", {
893
+ detail: {
894
+ position: this.positionPicker.value
895
+ }
896
+ });
897
+ }
890
898
  /**
891
899
  * Handles the change of the unit of measurement for the crop settings.
892
900
  * When the unit is changed to Aspect Ratio, it emits an event with the last applied settings for Aspect Ratio.
@@ -921,6 +929,7 @@ let z = class extends U {
921
929
  this.loading || this.emit("cx-asset-link-format-crop-apply", {
922
930
  detail: {
923
931
  height: this.height,
932
+ position: this.showPositionPicker ? this.position : void 0,
924
933
  unit: this.unit,
925
934
  width: this.width
926
935
  }
@@ -960,9 +969,9 @@ let z = class extends U {
960
969
  const t = this.cropModes.filter((i) => !i.auto), e = this.cropModes.filter((i) => i.auto);
961
970
  return A`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="crop"></cx-icon></div><cx-typography variant="body2">${this.localize.term("crop")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small">${_(
962
971
  !this.noRatioModes,
963
- () => A`<cx-select data-testid="cx-asset-link-format-crop-mode" value=${this.cropMode} hoist style=${W({
972
+ () => A`<cx-select data-testid="cx-asset-link-format-crop-mode" value=${this.cropMode} hoist style=${D({
964
973
  width: "100%"
965
- })} @cx-change=${this.onCropModeChange} ?disabled=${this.loading}>${at(
974
+ })} @cx-change=${this.onCropModeChange} ?disabled=${this.loading}>${ot(
966
975
  t,
967
976
  (i) => i.value,
968
977
  ({ label: i, value: s }) => A`<cx-option value=${s}>${i}</cx-option>`
@@ -971,14 +980,14 @@ let z = class extends U {
971
980
  e.length > 0,
972
981
  () => A`<cx-divider></cx-divider><small>${this.localize.term("autoCropping")}</small>`
973
982
  )}
974
- ${at(
983
+ ${ot(
975
984
  e,
976
985
  (i) => i.value,
977
986
  ({ label: i, value: s }) => A`<cx-option value=${s}>${i}</cx-option>`
978
987
  )}</cx-select>`
979
988
  )}<cx-space spacing="small"><div class="crop__input-group"><cx-input data-testid="cx-asset-link-format-crop-width" placeholder=${this.localize.term("width")} mask="num" .maskBlocks=${{ num: { mask: Number, min: 1 } }} value=${this.unit === o.Pixel ? this.width.toString() : this.ratioWidth.toString()} @cx-change=${this.handleInputChange} @cx-input=${this.handleWidthChange} required ?disabled=${this.loading}><cx-typography slot="prefix" variant="body3" part="input-label">
980
989
  W
981
- </cx-typography></cx-input><cx-icon-button data-testid="cx-asset-link-format-crop-aspect-ratio" name=${this.keepAspectRatio ? "insert_link" : "link_off"} @click=${this.handleAspectRatioClick} style=${W({
990
+ </cx-typography></cx-input><cx-icon-button data-testid="cx-asset-link-format-crop-aspect-ratio" name=${this.keepAspectRatio ? "insert_link" : "link_off"} @click=${this.handleAspectRatioClick} style=${D({
982
991
  color: this.keepAspectRatio ? "var(--cx-color-primary)" : void 0
983
992
  })} ?disabled=${this.loading}></cx-icon-button><cx-input data-testid="cx-asset-link-format-crop-height" placeholder=${this.localize.term("height")} mask="num" .maskBlocks=${{ num: { mask: Number, min: 1 } }} value=${this.unit === o.Pixel ? this.height.toString() : this.ratioHeight.toString()} ?disabled=${this.loading} @cx-change=${this.handleInputChange} @cx-input=${this.handleHeightChange} required><cx-typography slot="prefix" variant="body3" part="input-label">
984
993
  H
@@ -987,121 +996,135 @@ let z = class extends U {
987
996
  () => A`<cx-select data-testid="cx-asset-link-format-crop-unit" value=${this.unit} hoist class="crop__unit-select" ?disabled=${this.loading} @cx-change=${this.onUnitChange}><cx-option value=${o.Pixel}>${this.localize.term("pixels")}</cx-option><cx-option value=${o.AspectRatio}>${this.localize.term("aspectRatio")}</cx-option></cx-select>`
988
997
  )}</cx-space>${_(
989
998
  this.focusModes.length > 0,
990
- () => A`<cx-select data-testid="cx-asset-link-format-crop-focus-mode" value=${this.focusMode} hoist style=${W({
999
+ () => A`<cx-select data-testid="cx-asset-link-format-crop-focus-mode" value=${this.focusMode} hoist style=${D({
991
1000
  width: "100%"
992
- })} @cx-change=${this.onFocusModeChange} ?disabled=${this.loading || this.selectedMode?.disabledSize}>${at(
1001
+ })} @cx-change=${this.onFocusModeChange} ?disabled=${this.loading || this.selectedMode?.disabledSize}>${ot(
993
1002
  this.focusModes,
994
1003
  (i) => i.value,
995
1004
  ({ label: i, value: s }) => A`<cx-option value=${s}>${i}</cx-option>`
996
1005
  )}</cx-select>`
997
- )}<cx-button data-testid="cx-asset-link-format-crop-apply" variant="primary" ?disabled=${this.disabledApply || this.invalidHeight || this.invalidWidth} ?loading=${this.loading} style=${W({
1006
+ )}
1007
+ ${_(
1008
+ this.showPositionPicker && this.focusMode === "manual",
1009
+ () => A`<cx-position-picker data-testid="cx-asset-link-format-crop-position" value=${this.position} @cx-change=${this.onPositionChange}></cx-position-picker>`
1010
+ )}<cx-button data-testid="cx-asset-link-format-crop-apply" variant="primary" ?disabled=${this.disabledApply || this.invalidHeight || this.invalidWidth} ?loading=${this.loading} style=${D({
998
1011
  marginLeft: "auto"
999
1012
  })} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
1000
1013
  }
1001
1014
  };
1002
- z.styles = [j, ze];
1003
- z.dependencies = {
1004
- "cx-button": K,
1005
- "cx-details": J,
1006
- "cx-divider": Yt,
1007
- "cx-icon": tt,
1015
+ C.styles = [V, we];
1016
+ C.dependencies = {
1017
+ "cx-button": Z,
1018
+ "cx-details": et,
1019
+ "cx-divider": Jt,
1020
+ "cx-icon": it,
1008
1021
  "cx-icon-button": vt,
1009
1022
  "cx-input": bt,
1010
- "cx-option": ft,
1011
- "cx-select": gt,
1012
- "cx-space": O,
1013
- "cx-typography": L
1023
+ "cx-option": gt,
1024
+ "cx-position-picker": te,
1025
+ "cx-select": xt,
1026
+ "cx-space": L,
1027
+ "cx-typography": U
1014
1028
  };
1015
- v([
1016
- et(".details")
1017
- ], z.prototype, "base", 2);
1018
- v([
1029
+ z([
1030
+ Y(".details")
1031
+ ], C.prototype, "base", 2);
1032
+ z([
1033
+ Y("cx-position-picker")
1034
+ ], C.prototype, "positionPicker", 2);
1035
+ z([
1019
1036
  l({ reflect: !0, type: Boolean })
1020
- ], z.prototype, "open", 2);
1021
- v([
1037
+ ], C.prototype, "open", 2);
1038
+ z([
1022
1039
  l({ reflect: !0, type: Number })
1023
- ], z.prototype, "width", 2);
1024
- v([
1040
+ ], C.prototype, "width", 2);
1041
+ z([
1025
1042
  l({ reflect: !0, type: Number })
1026
- ], z.prototype, "height", 2);
1027
- v([
1043
+ ], C.prototype, "height", 2);
1044
+ z([
1028
1045
  l({ attribute: "max-width", reflect: !0, type: Number })
1029
- ], z.prototype, "maxWidth", 2);
1030
- v([
1046
+ ], C.prototype, "maxWidth", 2);
1047
+ z([
1031
1048
  l({ attribute: "max-height", reflect: !0, type: Number })
1032
- ], z.prototype, "maxHeight", 2);
1033
- v([
1049
+ ], C.prototype, "maxHeight", 2);
1050
+ z([
1034
1051
  l({ attribute: "ratio-width", reflect: !0, type: Number })
1035
- ], z.prototype, "ratioWidth", 2);
1036
- v([
1052
+ ], C.prototype, "ratioWidth", 2);
1053
+ z([
1037
1054
  l({ attribute: "ratio-height", reflect: !0, type: Number })
1038
- ], z.prototype, "ratioHeight", 2);
1039
- v([
1055
+ ], C.prototype, "ratioHeight", 2);
1056
+ z([
1040
1057
  l({ attribute: "percentage-width", reflect: !0, type: Number })
1041
- ], z.prototype, "percentageWidth", 2);
1042
- v([
1058
+ ], C.prototype, "percentageWidth", 2);
1059
+ z([
1043
1060
  l({ attribute: "percentage-height", reflect: !0, type: Number })
1044
- ], z.prototype, "percentageHeight", 2);
1045
- v([
1061
+ ], C.prototype, "percentageHeight", 2);
1062
+ z([
1046
1063
  l({ reflect: !0, type: String })
1047
- ], z.prototype, "unit", 2);
1048
- v([
1064
+ ], C.prototype, "unit", 2);
1065
+ z([
1049
1066
  l({ attribute: "disabled-apply", reflect: !0, type: Boolean })
1050
- ], z.prototype, "disabledApply", 2);
1051
- v([
1067
+ ], C.prototype, "disabledApply", 2);
1068
+ z([
1052
1069
  l({ attribute: "no-ratio-modes", reflect: !0, type: Boolean })
1053
- ], z.prototype, "noRatioModes", 2);
1054
- v([
1070
+ ], C.prototype, "noRatioModes", 2);
1071
+ z([
1072
+ l({ attribute: "show-position-picker", reflect: !0, type: Boolean })
1073
+ ], C.prototype, "showPositionPicker", 2);
1074
+ z([
1055
1075
  l({ attribute: "last-applied-setting", reflect: !1, type: Object })
1056
- ], z.prototype, "lastAppliedSetting", 2);
1057
- v([
1076
+ ], C.prototype, "lastAppliedSetting", 2);
1077
+ z([
1058
1078
  l({ reflect: !0, type: Boolean })
1059
- ], z.prototype, "loading", 2);
1060
- v([
1079
+ ], C.prototype, "loading", 2);
1080
+ z([
1061
1081
  l({ attribute: "crop-modes", reflect: !1, type: Array })
1062
- ], z.prototype, "cropModes", 2);
1063
- v([
1082
+ ], C.prototype, "cropModes", 2);
1083
+ z([
1064
1084
  l({ attribute: "focus-modes", reflect: !1, type: Object })
1065
- ], z.prototype, "focusModes", 2);
1066
- v([
1085
+ ], C.prototype, "focusModes", 2);
1086
+ z([
1067
1087
  l({ attribute: "focus-mode", reflect: !0, type: String })
1068
- ], z.prototype, "focusMode", 2);
1069
- v([
1088
+ ], C.prototype, "focusMode", 2);
1089
+ z([
1070
1090
  l({ attribute: "crop-mode", reflect: !0, type: String })
1071
- ], z.prototype, "cropMode", 2);
1072
- v([
1091
+ ], C.prototype, "cropMode", 2);
1092
+ z([
1093
+ l({ reflect: !0, type: String })
1094
+ ], C.prototype, "position", 2);
1095
+ z([
1073
1096
  l({ attribute: "keep-aspect-ratio", reflect: !0, type: Boolean })
1074
- ], z.prototype, "keepAspectRatio", 2);
1075
- v([
1076
- k()
1077
- ], z.prototype, "invalidWidth", 2);
1078
- v([
1079
- k()
1080
- ], z.prototype, "invalidHeight", 2);
1081
- v([
1082
- k()
1083
- ], z.prototype, "aspectRatio", 2);
1084
- v([
1085
- F("cropMode", { waitUntilFirstUpdate: !0 }),
1086
- F("maxWidth", { waitUntilFirstUpdate: !0 }),
1087
- F("maxHeight", { waitUntilFirstUpdate: !0 }),
1088
- F("keepAspectRatio")
1089
- ], z.prototype, "handleCropModeChange", 1);
1090
- v([
1091
- F("open", { waitUntilFirstUpdate: !0 })
1092
- ], z.prototype, "handleOpenChange", 1);
1093
- z = v([
1094
- V("cx-asset-link-format-crop")
1095
- ], z);
1096
- const ve = B`.extension{padding:var(--cx-spacing-small) var(--cx-spacing-medium);border:solid 1px var(--cx-color-neutral-200);background-color:var(--cx-color-neutral-0);& cx-select{flex:1;width:100%}}`;
1097
- var be = Object.defineProperty, Ce = Object.getOwnPropertyDescriptor, Ct = (t, e, i, s) => {
1098
- for (var a = s > 1 ? void 0 : s ? Ce(e, i) : e, r = t.length - 1, h; r >= 0; r--)
1099
- (h = t[r]) && (a = (s ? h(e, i, a) : h(a)) || a);
1100
- return s && a && be(e, i, a), a;
1097
+ ], C.prototype, "keepAspectRatio", 2);
1098
+ z([
1099
+ R()
1100
+ ], C.prototype, "invalidWidth", 2);
1101
+ z([
1102
+ R()
1103
+ ], C.prototype, "invalidHeight", 2);
1104
+ z([
1105
+ R()
1106
+ ], C.prototype, "aspectRatio", 2);
1107
+ z([
1108
+ M("cropMode", { waitUntilFirstUpdate: !0 }),
1109
+ M("maxWidth", { waitUntilFirstUpdate: !0 }),
1110
+ M("maxHeight", { waitUntilFirstUpdate: !0 }),
1111
+ M("keepAspectRatio")
1112
+ ], C.prototype, "handleCropModeChange", 1);
1113
+ z([
1114
+ M("open", { waitUntilFirstUpdate: !0 })
1115
+ ], C.prototype, "handleOpenChange", 1);
1116
+ C = z([
1117
+ G("cx-asset-link-format-crop")
1118
+ ], C);
1119
+ const be = q`.extension{padding:var(--cx-spacing-small) var(--cx-spacing-medium);border:solid 1px var(--cx-color-neutral-200);background-color:var(--cx-color-neutral-0);& cx-select{flex:1;width:100%}}`;
1120
+ var ke = Object.defineProperty, Re = Object.getOwnPropertyDescriptor, kt = (t, e, i, s) => {
1121
+ for (var a = s > 1 ? void 0 : s ? Re(e, i) : e, r = t.length - 1, n; r >= 0; r--)
1122
+ (n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
1123
+ return s && a && ke(e, i, a), a;
1101
1124
  };
1102
- let X = class extends U {
1125
+ let K = class extends B {
1103
1126
  constructor() {
1104
- super(...arguments), this.localize = new q(this), this.value = "", this.items = [];
1127
+ super(...arguments), this.localize = new j(this), this.value = "", this.items = [];
1105
1128
  }
1106
1129
  handleExtensionChange(t) {
1107
1130
  const e = t.target.value;
@@ -1110,38 +1133,38 @@ let X = class extends U {
1110
1133
  });
1111
1134
  }
1112
1135
  render() {
1113
- return A`<cx-space direction="vertical" spacing="small" class="extension"><cx-typography variant="body2">${this.localize.term("extension")}</cx-typography><cx-select data-label=${this.localize.term("extension")} data-testid="cx-asset-link-format-extension-select" value=${this.value} hoist @cx-change=${this.handleExtensionChange}>${at(
1136
+ return A`<cx-space direction="vertical" spacing="small" class="extension"><cx-typography variant="body2">${this.localize.term("extension")}</cx-typography><cx-select data-label=${this.localize.term("extension")} data-testid="cx-asset-link-format-extension-select" value=${this.value} hoist @cx-change=${this.handleExtensionChange}>${ot(
1114
1137
  this.items,
1115
1138
  (t) => t.value,
1116
1139
  (t) => A`<cx-option value=${t.value}>${t.displayName}</cx-option>`
1117
1140
  )}</cx-select></cx-space>`;
1118
1141
  }
1119
1142
  };
1120
- X.styles = [j, ve];
1121
- X.dependencies = {
1122
- "cx-option": ft,
1123
- "cx-select": gt,
1124
- "cx-space": O,
1125
- "cx-typography": L
1143
+ K.styles = [V, be];
1144
+ K.dependencies = {
1145
+ "cx-option": gt,
1146
+ "cx-select": xt,
1147
+ "cx-space": L,
1148
+ "cx-typography": U
1126
1149
  };
1127
- Ct([
1150
+ kt([
1128
1151
  l({ reflect: !0, type: String })
1129
- ], X.prototype, "value", 2);
1130
- Ct([
1152
+ ], K.prototype, "value", 2);
1153
+ kt([
1131
1154
  l({ reflect: !1, type: Array })
1132
- ], X.prototype, "items", 2);
1133
- X = Ct([
1134
- V("cx-asset-link-format-extension")
1135
- ], X);
1136
- const ke = B`cx-details::part(base){border-bottom-width:0}`;
1137
- var Re = Object.defineProperty, $e = Object.getOwnPropertyDescriptor, D = (t, e, i, s) => {
1138
- for (var a = s > 1 ? void 0 : s ? $e(e, i) : e, r = t.length - 1, h; r >= 0; r--)
1139
- (h = t[r]) && (a = (s ? h(e, i, a) : h(a)) || a);
1140
- return s && a && Re(e, i, a), a;
1155
+ ], K.prototype, "items", 2);
1156
+ K = kt([
1157
+ G("cx-asset-link-format-extension")
1158
+ ], K);
1159
+ const $e = q`cx-details::part(base){border-bottom-width:0}`;
1160
+ var Pe = Object.defineProperty, Me = Object.getOwnPropertyDescriptor, N = (t, e, i, s) => {
1161
+ for (var a = s > 1 ? void 0 : s ? Me(e, i) : e, r = t.length - 1, n; r >= 0; r--)
1162
+ (n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
1163
+ return s && a && Pe(e, i, a), a;
1141
1164
  };
1142
- let I = class extends U {
1165
+ let E = class extends B {
1143
1166
  constructor() {
1144
- super(...arguments), this.localize = new q(this), this.open = !1, this.value = "", this.items = [], this.loading = !1, this.scopedValue = "";
1167
+ super(...arguments), this.localize = new j(this), this.open = !1, this.value = "", this.items = [], this.loading = !1, this.scopedValue = "";
1145
1168
  }
1146
1169
  handleValueChange() {
1147
1170
  this.scopedValue = this.value;
@@ -1185,61 +1208,61 @@ let I = class extends U {
1185
1208
  t.target !== this.base && t.stopPropagation();
1186
1209
  }
1187
1210
  render() {
1188
- return A`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="photo_size_select_large"></cx-icon></div><cx-typography variant="body2">${this.localize.term("format")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small" class="format"><cx-select data-label=${this.localize.term("imageFormat")} data-testid="cx-asset-link-format-proxy-select" value=${this.scopedValue} hoist @cx-change=${this.handleProxyChange} ?disabled=${this.loading}>${at(
1211
+ return A`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="photo_size_select_large"></cx-icon></div><cx-typography variant="body2">${this.localize.term("format")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small" class="format"><cx-select data-label=${this.localize.term("imageFormat")} data-testid="cx-asset-link-format-proxy-select" value=${this.scopedValue} hoist @cx-change=${this.handleProxyChange} ?disabled=${this.loading}>${ot(
1189
1212
  this.items,
1190
1213
  (t) => t.id,
1191
1214
  (t) => A`<cx-option value=${t.id}>${t.proxyLabel}</cx-option>`
1192
- )}</cx-select><cx-button data-testid="cx-asset-link-format-proxy-apply" variant="primary" style=${W({
1215
+ )}</cx-select><cx-button data-testid="cx-asset-link-format-proxy-apply" variant="primary" style=${D({
1193
1216
  "margin-left": "auto"
1194
1217
  })} ?disabled=${this.scopedValue === this.value} ?loading=${this.loading} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
1195
1218
  }
1196
1219
  };
1197
- I.styles = [j, ke];
1198
- I.dependencies = {
1199
- "cx-button": K,
1200
- "cx-details": J,
1201
- "cx-icon": tt,
1202
- "cx-option": ft,
1203
- "cx-select": gt,
1204
- "cx-space": O,
1205
- "cx-typography": L
1220
+ E.styles = [V, $e];
1221
+ E.dependencies = {
1222
+ "cx-button": Z,
1223
+ "cx-details": et,
1224
+ "cx-icon": it,
1225
+ "cx-option": gt,
1226
+ "cx-select": xt,
1227
+ "cx-space": L,
1228
+ "cx-typography": U
1206
1229
  };
1207
- D([
1208
- et(".details")
1209
- ], I.prototype, "base", 2);
1210
- D([
1230
+ N([
1231
+ Y(".details")
1232
+ ], E.prototype, "base", 2);
1233
+ N([
1211
1234
  l({ reflect: !0, type: Boolean })
1212
- ], I.prototype, "open", 2);
1213
- D([
1235
+ ], E.prototype, "open", 2);
1236
+ N([
1214
1237
  l({ reflect: !0, type: String })
1215
- ], I.prototype, "value", 2);
1216
- D([
1238
+ ], E.prototype, "value", 2);
1239
+ N([
1217
1240
  l({ reflect: !1, type: Array })
1218
- ], I.prototype, "items", 2);
1219
- D([
1241
+ ], E.prototype, "items", 2);
1242
+ N([
1220
1243
  l({ reflect: !0, type: Boolean })
1221
- ], I.prototype, "loading", 2);
1222
- D([
1223
- k()
1224
- ], I.prototype, "scopedValue", 2);
1225
- D([
1226
- F("value")
1227
- ], I.prototype, "handleValueChange", 1);
1228
- D([
1229
- F("open", { waitUntilFirstUpdate: !0 })
1230
- ], I.prototype, "handleOpenChange", 1);
1231
- I = D([
1232
- V("cx-asset-link-format-proxy")
1233
- ], I);
1234
- const Pe = B`cx-details::part(base){border-bottom-width:0}`;
1235
- var Fe = Object.defineProperty, Me = Object.getOwnPropertyDescriptor, Z = (t, e, i, s) => {
1236
- for (var a = s > 1 ? void 0 : s ? Me(e, i) : e, r = t.length - 1, h; r >= 0; r--)
1237
- (h = t[r]) && (a = (s ? h(e, i, a) : h(a)) || a);
1238
- return s && a && Fe(e, i, a), a;
1244
+ ], E.prototype, "loading", 2);
1245
+ N([
1246
+ R()
1247
+ ], E.prototype, "scopedValue", 2);
1248
+ N([
1249
+ M("value")
1250
+ ], E.prototype, "handleValueChange", 1);
1251
+ N([
1252
+ M("open", { waitUntilFirstUpdate: !0 })
1253
+ ], E.prototype, "handleOpenChange", 1);
1254
+ E = N([
1255
+ G("cx-asset-link-format-proxy")
1256
+ ], E);
1257
+ const Fe = q`cx-details::part(base){border-bottom-width:0}`;
1258
+ var _e = Object.defineProperty, Ie = Object.getOwnPropertyDescriptor, J = (t, e, i, s) => {
1259
+ for (var a = s > 1 ? void 0 : s ? Ie(e, i) : e, r = t.length - 1, n; r >= 0; r--)
1260
+ (n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
1261
+ return s && a && _e(e, i, a), a;
1239
1262
  };
1240
- let T = class extends U {
1263
+ let T = class extends B {
1241
1264
  constructor() {
1242
- super(...arguments), this.localize = new q(this), this.open = !1, this.value = 100, this.loading = !1, this.scopedValue = 100;
1265
+ super(...arguments), this.localize = new j(this), this.open = !1, this.value = 100, this.loading = !1, this.scopedValue = 100;
1243
1266
  }
1244
1267
  /**
1245
1268
  * A computed property that checks if the current quality value is invalid.
@@ -1283,51 +1306,51 @@ let T = class extends U {
1283
1306
  t.target !== this.base && t.stopPropagation();
1284
1307
  }
1285
1308
  render() {
1286
- return A`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div class="details__summary__icon"><div part="icon"><cx-icon name="blur_on"></cx-icon></div></div><cx-typography variant="body2">${this.localize.term("quality")}</cx-typography></cx-space><cx-space spacing="small"><cx-tooltip data-testid="cx-asset-link-format-quality-tooltip" content=${this.localize.term("qualityHelpText")} hoist><cx-input data-testid="cx-asset-link-format-quality" class="details__checkbox" mask="num" .maskBlocks=${{ num: { mask: Number, max: 100, min: 1 } }} value=${this.scopedValue.toString()} style=${W({
1309
+ return A`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div class="details__summary__icon"><div part="icon"><cx-icon name="blur_on"></cx-icon></div></div><cx-typography variant="body2">${this.localize.term("quality")}</cx-typography></cx-space><cx-space spacing="small"><cx-tooltip data-testid="cx-asset-link-format-quality-tooltip" content=${this.localize.term("qualityHelpText")} hoist><cx-input data-testid="cx-asset-link-format-quality" class="details__checkbox" mask="num" .maskBlocks=${{ num: { mask: Number, max: 100, min: 1 } }} value=${this.scopedValue.toString()} style=${D({
1287
1310
  flex: "1"
1288
1311
  })} @cx-input=${this.handleQualityChange}></cx-input></cx-tooltip><cx-button data-testid="cx-asset-link-format-quality-apply" variant="primary" ?disabled=${this.invalidValue} ?loading=${this.loading} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
1289
1312
  }
1290
1313
  };
1291
- T.styles = [j, Pe];
1314
+ T.styles = [V, Fe];
1292
1315
  T.dependencies = {
1293
- "cx-button": K,
1294
- "cx-details": J,
1295
- "cx-icon": tt,
1316
+ "cx-button": Z,
1317
+ "cx-details": et,
1318
+ "cx-icon": it,
1296
1319
  "cx-input": bt,
1297
- "cx-space": O,
1298
- "cx-tooltip": Ot,
1299
- "cx-typography": L
1320
+ "cx-space": L,
1321
+ "cx-tooltip": Lt,
1322
+ "cx-typography": U
1300
1323
  };
1301
- Z([
1302
- et(".details")
1324
+ J([
1325
+ Y(".details")
1303
1326
  ], T.prototype, "base", 2);
1304
- Z([
1327
+ J([
1305
1328
  l({ reflect: !0, type: Boolean })
1306
1329
  ], T.prototype, "open", 2);
1307
- Z([
1330
+ J([
1308
1331
  l({ reflect: !0, type: Number })
1309
1332
  ], T.prototype, "value", 2);
1310
- Z([
1333
+ J([
1311
1334
  l({ reflect: !0, type: Boolean })
1312
1335
  ], T.prototype, "loading", 2);
1313
- Z([
1314
- k()
1336
+ J([
1337
+ R()
1315
1338
  ], T.prototype, "scopedValue", 2);
1316
- Z([
1317
- F("value")
1339
+ J([
1340
+ M("value")
1318
1341
  ], T.prototype, "handleValueChange", 1);
1319
- T = Z([
1320
- V("cx-asset-link-format-quality")
1342
+ T = J([
1343
+ G("cx-asset-link-format-quality")
1321
1344
  ], T);
1322
- const _e = B`cx-details::part(base){border-bottom-width:0}cx-space{width:100%}cx-space cx-input{flex:1}.resize__unit-select{width:120px}.resize__input-group{flex:1;display:flex}`;
1323
- var Ie = Object.defineProperty, Ee = Object.getOwnPropertyDescriptor, $ = (t, e, i, s) => {
1324
- for (var a = s > 1 ? void 0 : s ? Ee(e, i) : e, r = t.length - 1, h; r >= 0; r--)
1325
- (h = t[r]) && (a = (s ? h(e, i, a) : h(a)) || a);
1326
- return s && a && Ie(e, i, a), a;
1345
+ const Ee = q`cx-details::part(base){border-bottom-width:0}cx-space{width:100%}cx-space cx-input{flex:1}.resize__unit-select{width:120px}.resize__input-group{flex:1;display:flex}`;
1346
+ var He = Object.defineProperty, Te = Object.getOwnPropertyDescriptor, $ = (t, e, i, s) => {
1347
+ for (var a = s > 1 ? void 0 : s ? Te(e, i) : e, r = t.length - 1, n; r >= 0; r--)
1348
+ (n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
1349
+ return s && a && He(e, i, a), a;
1327
1350
  };
1328
- let b = class extends U {
1351
+ let v = class extends B {
1329
1352
  constructor() {
1330
- super(...arguments), this.localize = new q(this), this.open = !1, this.width = 0, this.height = 0, this.maxWidth = 0, this.maxHeight = 0, this.ratioWidth = 1, this.ratioHeight = 1, this.unit = o.Pixel, this.lastAppliedSetting = {
1353
+ super(...arguments), this.localize = new j(this), this.open = !1, this.width = 0, this.height = 0, this.maxWidth = 0, this.maxHeight = 0, this.ratioWidth = 1, this.ratioHeight = 1, this.unit = o.Pixel, this.lastAppliedSetting = {
1331
1354
  [o.Pixel]: { height: 0, width: 0 },
1332
1355
  [o.AspectRatio]: { height: 1, width: 1 }
1333
1356
  }, this.loading = !1, this.noRatioModes = !1, this.keepAspectRatio = !1, this.invalidWidth = !1, this.invalidHeight = !1, this.aspectRatio = 0;
@@ -1466,99 +1489,99 @@ let b = class extends U {
1466
1489
  render() {
1467
1490
  return A`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="aspect_ratio"></cx-icon></div><cx-typography variant="body2">${this.localize.term("resize")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small"><cx-space spacing="small"><div class="resize__input-group"><cx-input data-testid="cx-asset-link-format-resize-width" placeholder=${this.localize.term("width")} mask="num" .maskBlocks=${{ num: { mask: Number, min: 1 } }} value=${this.unit === o.Pixel ? this.width.toString() : this.ratioWidth.toString()} @cx-input=${this.handleWidthChange} required ?disabled=${this.loading}><cx-typography slot="prefix" variant="body3" part="input-label">
1468
1491
  W
1469
- </cx-typography></cx-input><cx-icon-button data-testid="cx-asset-link-format-resize-aspect-ratio" name=${this.keepAspectRatio ? "insert_link" : "link_off"} @click=${this.handleAspectRatioClick} style=${W({
1492
+ </cx-typography></cx-input><cx-icon-button data-testid="cx-asset-link-format-resize-aspect-ratio" name=${this.keepAspectRatio ? "insert_link" : "link_off"} @click=${this.handleAspectRatioClick} style=${D({
1470
1493
  color: this.keepAspectRatio ? "var(--cx-color-primary)" : void 0
1471
1494
  })} ?disabled=${this.loading}></cx-icon-button><cx-input data-testid="cx-asset-link-format-resize-height" placeholder=${this.localize.term("height")} mask="num" .maskBlocks=${{ num: { mask: Number, min: 1 } }} value=${this.unit === o.Pixel ? this.height.toString() : this.ratioHeight.toString()} @cx-input=${this.handleHeightChange} required ?disabled=${this.loading}><cx-typography slot="prefix" variant="body3" part="input-label">
1472
1495
  H
1473
1496
  </cx-typography></cx-input></div>${_(
1474
1497
  !this.noRatioModes,
1475
1498
  () => A`<cx-select data-testid="cx-asset-link-format-resize-unit" value=${this.unit} hoist class="resize__unit-select" @cx-change=${this.onUnitChange}><cx-option value=${o.Pixel}>${this.localize.term("pixels")}</cx-option><cx-option value=${o.AspectRatio}>${this.localize.term("aspectRatio")}</cx-option></cx-select>`
1476
- )}</cx-space><cx-button data-testid="cx-asset-link-format-resize-apply" variant="primary" ?disabled=${this.disabledApply || this.invalidHeight || this.invalidWidth} ?loading=${this.loading} style=${W({
1499
+ )}</cx-space><cx-button data-testid="cx-asset-link-format-resize-apply" variant="primary" ?disabled=${this.disabledApply || this.invalidHeight || this.invalidWidth} ?loading=${this.loading} style=${D({
1477
1500
  marginLeft: "auto"
1478
1501
  })} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
1479
1502
  }
1480
1503
  };
1481
- b.styles = [j, _e];
1482
- b.dependencies = {
1483
- "cx-button": K,
1484
- "cx-details": J,
1485
- "cx-icon": tt,
1504
+ v.styles = [V, Ee];
1505
+ v.dependencies = {
1506
+ "cx-button": Z,
1507
+ "cx-details": et,
1508
+ "cx-icon": it,
1486
1509
  "cx-icon-button": vt,
1487
1510
  "cx-input": bt,
1488
- "cx-option": ft,
1489
- "cx-select": gt,
1490
- "cx-space": O,
1491
- "cx-typography": L
1511
+ "cx-option": gt,
1512
+ "cx-select": xt,
1513
+ "cx-space": L,
1514
+ "cx-typography": U
1492
1515
  };
1493
1516
  $([
1494
- et(".details")
1495
- ], b.prototype, "base", 2);
1517
+ Y(".details")
1518
+ ], v.prototype, "base", 2);
1496
1519
  $([
1497
1520
  l({ reflect: !0, type: Boolean })
1498
- ], b.prototype, "open", 2);
1521
+ ], v.prototype, "open", 2);
1499
1522
  $([
1500
1523
  l({ reflect: !0, type: Number })
1501
- ], b.prototype, "width", 2);
1524
+ ], v.prototype, "width", 2);
1502
1525
  $([
1503
1526
  l({ reflect: !0, type: Number })
1504
- ], b.prototype, "height", 2);
1527
+ ], v.prototype, "height", 2);
1505
1528
  $([
1506
1529
  l({ attribute: "max-width", reflect: !0, type: Number })
1507
- ], b.prototype, "maxWidth", 2);
1530
+ ], v.prototype, "maxWidth", 2);
1508
1531
  $([
1509
1532
  l({ attribute: "max-height", reflect: !0, type: Number })
1510
- ], b.prototype, "maxHeight", 2);
1533
+ ], v.prototype, "maxHeight", 2);
1511
1534
  $([
1512
1535
  l({ attribute: "ratio-width", reflect: !0, type: Number })
1513
- ], b.prototype, "ratioWidth", 2);
1536
+ ], v.prototype, "ratioWidth", 2);
1514
1537
  $([
1515
1538
  l({ attribute: "ratio-height", reflect: !0, type: Number })
1516
- ], b.prototype, "ratioHeight", 2);
1539
+ ], v.prototype, "ratioHeight", 2);
1517
1540
  $([
1518
1541
  l({ reflect: !0, type: String })
1519
- ], b.prototype, "unit", 2);
1542
+ ], v.prototype, "unit", 2);
1520
1543
  $([
1521
1544
  l({ attribute: "last-applied-setting", reflect: !1, type: Object })
1522
- ], b.prototype, "lastAppliedSetting", 2);
1545
+ ], v.prototype, "lastAppliedSetting", 2);
1523
1546
  $([
1524
1547
  l({ reflect: !0, type: Boolean })
1525
- ], b.prototype, "loading", 2);
1548
+ ], v.prototype, "loading", 2);
1526
1549
  $([
1527
1550
  l({ attribute: "no-ratio-modes", reflect: !0, type: Boolean })
1528
- ], b.prototype, "noRatioModes", 2);
1551
+ ], v.prototype, "noRatioModes", 2);
1529
1552
  $([
1530
1553
  l({ attribute: "keep-aspect-ratio", reflect: !0, type: Boolean })
1531
- ], b.prototype, "keepAspectRatio", 2);
1554
+ ], v.prototype, "keepAspectRatio", 2);
1532
1555
  $([
1533
- k()
1534
- ], b.prototype, "invalidWidth", 2);
1556
+ R()
1557
+ ], v.prototype, "invalidWidth", 2);
1535
1558
  $([
1536
- k()
1537
- ], b.prototype, "invalidHeight", 2);
1559
+ R()
1560
+ ], v.prototype, "invalidHeight", 2);
1538
1561
  $([
1539
- k()
1540
- ], b.prototype, "aspectRatio", 2);
1562
+ R()
1563
+ ], v.prototype, "aspectRatio", 2);
1541
1564
  $([
1542
- F("cropMode", { waitUntilFirstUpdate: !0 }),
1543
- F("maxWidth", { waitUntilFirstUpdate: !0 }),
1544
- F("maxHeight", { waitUntilFirstUpdate: !0 }),
1545
- F("keepAspectRatio")
1546
- ], b.prototype, "handleCropModeChange", 1);
1565
+ M("cropMode", { waitUntilFirstUpdate: !0 }),
1566
+ M("maxWidth", { waitUntilFirstUpdate: !0 }),
1567
+ M("maxHeight", { waitUntilFirstUpdate: !0 }),
1568
+ M("keepAspectRatio")
1569
+ ], v.prototype, "handleCropModeChange", 1);
1547
1570
  $([
1548
- F("open", { waitUntilFirstUpdate: !0 })
1549
- ], b.prototype, "handleOpenChange", 1);
1550
- b = $([
1551
- V("cx-asset-link-format-resize")
1552
- ], b);
1553
- const He = B`cx-details::part(base){border-bottom-width:0}`;
1554
- var Te = Object.defineProperty, We = Object.getOwnPropertyDescriptor, G = (t, e, i, s) => {
1555
- for (var a = s > 1 ? void 0 : s ? We(e, i) : e, r = t.length - 1, h; r >= 0; r--)
1556
- (h = t[r]) && (a = (s ? h(e, i, a) : h(a)) || a);
1557
- return s && a && Te(e, i, a), a;
1571
+ M("open", { waitUntilFirstUpdate: !0 })
1572
+ ], v.prototype, "handleOpenChange", 1);
1573
+ v = $([
1574
+ G("cx-asset-link-format-resize")
1575
+ ], v);
1576
+ const We = q`cx-details::part(base){border-bottom-width:0}`;
1577
+ var De = Object.defineProperty, Ne = Object.getOwnPropertyDescriptor, Q = (t, e, i, s) => {
1578
+ for (var a = s > 1 ? void 0 : s ? Ne(e, i) : e, r = t.length - 1, n; r >= 0; r--)
1579
+ (n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
1580
+ return s && a && De(e, i, a), a;
1558
1581
  };
1559
- let H = class extends U {
1582
+ let H = class extends B {
1560
1583
  constructor() {
1561
- super(...arguments), this.localize = new q(this), this.open = !1, this.value = 0, this.defaultValue = 0, this.loading = !1, this.lastAppliedValue = 0;
1584
+ super(...arguments), this.localize = new j(this), this.open = !1, this.value = 0, this.defaultValue = 0, this.loading = !1, this.lastAppliedValue = 0;
1562
1585
  }
1563
1586
  handleOpenChange() {
1564
1587
  this.open || this.emit("cx-asset-link-format-rotation-change", {
@@ -1569,14 +1592,14 @@ let H = class extends U {
1569
1592
  const e = t.target.value, i = Number(e);
1570
1593
  if (Number.isNaN(i))
1571
1594
  return;
1572
- const s = Pt(i);
1595
+ const s = Mt(i);
1573
1596
  (i > 360 || i < -360) && (t.target.value = s.toString()), this.emit("cx-asset-link-format-rotation-change", {
1574
1597
  detail: s
1575
1598
  });
1576
1599
  }
1577
1600
  handleButtonClick(t) {
1578
1601
  this.emit("cx-asset-link-format-rotation-change", {
1579
- detail: Pt(t)
1602
+ detail: Mt(t)
1580
1603
  });
1581
1604
  }
1582
1605
  handleClockwiseClick() {
@@ -1596,55 +1619,55 @@ let H = class extends U {
1596
1619
  });
1597
1620
  }
1598
1621
  render() {
1599
- return A`<cx-details class="details" ?open=${this.open}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="rotate_90_degrees_cw"></cx-icon></div><cx-typography variant="body2">Rotate</cx-typography></cx-space><cx-space spacing="small"><cx-button-group label=${this.localize.term("history")}><cx-icon-button data-testid="cx-asset-link-format-rotation-ccw" name="rotate_90_degrees_ccw" label=${this.localize.term("undo")} outline size="small" ?disabled=${this.loading || this.value === -360} @click=${this.handleCounterClockwiseClick}></cx-icon-button><cx-icon-button data-testid="cx-asset-link-format-rotation-cw" name="rotate_90_degrees_cw" label=${this.localize.term("redo")} outline size="small" ?disabled=${this.loading || this.value === 360} @click=${this.handleClockwiseClick}></cx-icon-button></cx-button-group><cx-input data-testid="cx-asset-link-format-rotation" value=${(this.value + this.defaultValue).toString()} placeholder="0" mask="num" .maskBlocks=${{ num: { mask: Number, max: 360, min: -360, signed: !0 } }} ?disabled=${this.loading} style=${W({
1622
+ return A`<cx-details class="details" ?open=${this.open}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="rotate_90_degrees_cw"></cx-icon></div><cx-typography variant="body2">Rotate</cx-typography></cx-space><cx-space spacing="small"><cx-button-group label=${this.localize.term("history")}><cx-icon-button data-testid="cx-asset-link-format-rotation-ccw" name="rotate_90_degrees_ccw" label=${this.localize.term("undo")} outline size="small" ?disabled=${this.loading || this.value === -360} @click=${this.handleCounterClockwiseClick}></cx-icon-button><cx-icon-button data-testid="cx-asset-link-format-rotation-cw" name="rotate_90_degrees_cw" label=${this.localize.term("redo")} outline size="small" ?disabled=${this.loading || this.value === 360} @click=${this.handleClockwiseClick}></cx-icon-button></cx-button-group><cx-input data-testid="cx-asset-link-format-rotation" value=${(this.value + this.defaultValue).toString()} placeholder="0" mask="num" .maskBlocks=${{ num: { mask: Number, max: 360, min: -360, signed: !0 } }} ?disabled=${this.loading} style=${D({
1600
1623
  flex: "none",
1601
1624
  width: "80px"
1602
1625
  })} @cx-input=${this.handleRotationChange}></cx-input><cx-button data-testid="cx-asset-link-format-rotation-apply" variant="primary" ?disabled=${this.value === this.lastAppliedValue} ?loading=${this.loading} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
1603
1626
  }
1604
1627
  };
1605
- H.styles = [j, He];
1628
+ H.styles = [V, We];
1606
1629
  H.dependencies = {
1607
- "cx-button": K,
1608
- "cx-button-group": te,
1609
- "cx-details": J,
1610
- "cx-icon": tt,
1630
+ "cx-button": Z,
1631
+ "cx-button-group": ie,
1632
+ "cx-details": et,
1633
+ "cx-icon": it,
1611
1634
  "cx-icon-button": vt,
1612
- "cx-space": O,
1613
- "cx-typography": L
1635
+ "cx-space": L,
1636
+ "cx-typography": U
1614
1637
  };
1615
- G([
1616
- et(".details")
1638
+ Q([
1639
+ Y(".details")
1617
1640
  ], H.prototype, "base", 2);
1618
- G([
1641
+ Q([
1619
1642
  l({ reflect: !0, type: Boolean })
1620
1643
  ], H.prototype, "open", 2);
1621
- G([
1644
+ Q([
1622
1645
  l({ reflect: !0, type: Number })
1623
1646
  ], H.prototype, "value", 2);
1624
- G([
1647
+ Q([
1625
1648
  l({ attribute: "default-value", reflect: !0, type: Number })
1626
1649
  ], H.prototype, "defaultValue", 2);
1627
- G([
1650
+ Q([
1628
1651
  l({ reflect: !0, type: Boolean })
1629
1652
  ], H.prototype, "loading", 2);
1630
- G([
1653
+ Q([
1631
1654
  l({ attribute: "last-applied-value", reflect: !0, type: Number })
1632
1655
  ], H.prototype, "lastAppliedValue", 2);
1633
- G([
1634
- F("open", { waitUntilFirstUpdate: !0 })
1656
+ Q([
1657
+ M("open", { waitUntilFirstUpdate: !0 })
1635
1658
  ], H.prototype, "handleOpenChange", 1);
1636
- H = G([
1637
- V("cx-asset-link-format-rotation")
1659
+ H = Q([
1660
+ G("cx-asset-link-format-rotation")
1638
1661
  ], H);
1639
- const De = B`cx-details::part(base){border-bottom-width:0}`;
1640
- var Ne = Object.defineProperty, Oe = Object.getOwnPropertyDescriptor, xt = (t, e, i, s) => {
1641
- for (var a = s > 1 ? void 0 : s ? Oe(e, i) : e, r = t.length - 1, h; r >= 0; r--)
1642
- (h = t[r]) && (a = (s ? h(e, i, a) : h(a)) || a);
1643
- return s && a && Ne(e, i, a), a;
1662
+ const Oe = q`cx-details::part(base){border-bottom-width:0}`;
1663
+ var Le = Object.defineProperty, Ue = Object.getOwnPropertyDescriptor, yt = (t, e, i, s) => {
1664
+ for (var a = s > 1 ? void 0 : s ? Ue(e, i) : e, r = t.length - 1, n; r >= 0; r--)
1665
+ (n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
1666
+ return s && a && Le(e, i, a), a;
1644
1667
  };
1645
- let N = class extends U {
1668
+ let O = class extends B {
1646
1669
  constructor() {
1647
- super(...arguments), this.localize = new q(this), this.open = !1, this.value = !1;
1670
+ super(...arguments), this.localize = new j(this), this.open = !1, this.value = !1;
1648
1671
  }
1649
1672
  handleApply(t) {
1650
1673
  this.emit("cx-asset-link-format-metadata-change", {
@@ -1671,36 +1694,36 @@ let N = class extends U {
1671
1694
  return A`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div class="details__summary__icon"><div part="icon"><cx-icon name="short_text"></cx-icon></div></div><cx-typography variant="body2">${this.localize.term("metadata")}</cx-typography></cx-space><cx-space spacing="small"><cx-tooltip data-testid="cx-asset-link-format-metadata-tooltip" content=${this.localize.term("metadataHelpText")} hoist><cx-checkbox data-testid="cx-asset-link-format-metadata" class="details__checkbox" ?checked=${this.value} @cx-change=${this.handleApply}>${this.localize.term("preserveMetadata")}</cx-checkbox></cx-tooltip></cx-space></cx-details>`;
1672
1695
  }
1673
1696
  };
1674
- N.styles = [j, De];
1675
- N.dependencies = {
1676
- "cx-button": K,
1677
- "cx-checkbox": ee,
1678
- "cx-details": J,
1679
- "cx-icon": tt,
1680
- "cx-space": O,
1681
- "cx-tooltip": Ot,
1682
- "cx-typography": L
1697
+ O.styles = [V, Oe];
1698
+ O.dependencies = {
1699
+ "cx-button": Z,
1700
+ "cx-checkbox": se,
1701
+ "cx-details": et,
1702
+ "cx-icon": it,
1703
+ "cx-space": L,
1704
+ "cx-tooltip": Lt,
1705
+ "cx-typography": U
1683
1706
  };
1684
- xt([
1685
- et(".details")
1686
- ], N.prototype, "base", 2);
1687
- xt([
1707
+ yt([
1708
+ Y(".details")
1709
+ ], O.prototype, "base", 2);
1710
+ yt([
1688
1711
  l({ reflect: !0, type: Boolean })
1689
- ], N.prototype, "open", 2);
1690
- xt([
1712
+ ], O.prototype, "open", 2);
1713
+ yt([
1691
1714
  l({ reflect: !0, type: Boolean })
1692
- ], N.prototype, "value", 2);
1693
- N = xt([
1694
- V("cx-asset-link-format-metadata")
1695
- ], N);
1696
- var Le = Object.defineProperty, Ue = Object.getOwnPropertyDescriptor, y = (t, e, i, s) => {
1697
- for (var a = s > 1 ? void 0 : s ? Ue(e, i) : e, r = t.length - 1, h; r >= 0; r--)
1698
- (h = t[r]) && (a = (s ? h(e, i, a) : h(a)) || a);
1699
- return s && a && Le(e, i, a), a;
1715
+ ], O.prototype, "value", 2);
1716
+ O = yt([
1717
+ G("cx-asset-link-format-metadata")
1718
+ ], O);
1719
+ var Be = Object.defineProperty, qe = Object.getOwnPropertyDescriptor, y = (t, e, i, s) => {
1720
+ for (var a = s > 1 ? void 0 : s ? qe(e, i) : e, r = t.length - 1, n; r >= 0; r--)
1721
+ (n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
1722
+ return s && a && Be(e, i, a), a;
1700
1723
  };
1701
- let g = class extends U {
1724
+ let g = class extends B {
1702
1725
  constructor() {
1703
- super(), this.localize = new q(this), this.baseUrl = void 0, this.token = void 0, this.asset = void 0, this.cropModes = [
1726
+ super(), this.localize = new j(this), this.baseUrl = void 0, this.token = void 0, this.asset = void 0, this.cropModes = [
1704
1727
  {
1705
1728
  label: "Free",
1706
1729
  value: "free"
@@ -1786,6 +1809,7 @@ let g = class extends U {
1786
1809
  keepAspectRatio: !0,
1787
1810
  percentageHeight: 0,
1788
1811
  percentageWidth: 0,
1812
+ position: W.CenterCenter,
1789
1813
  ratioHeight: 1,
1790
1814
  ratioWidth: 1,
1791
1815
  unit: o.Pixel,
@@ -1795,7 +1819,7 @@ let g = class extends U {
1795
1819
  }, this.rotation = 0, this.defaultSize = {
1796
1820
  height: 0,
1797
1821
  width: 0
1798
- }, this.cropperElement = null, this.parameters = [], this.loading = !1, this.lastAction = void 0, this.frozenIndex = void 0, this.preResetTransformations = void 0, this.apiGetTransformAssetLink = de, this.apiGetCropFocusMode = xe, this.onCropComplete = this.onCropComplete.bind(this), this.onCropDragStart = this.onCropDragStart.bind(this);
1822
+ }, this.cropperElement = null, this.parameters = [], this.loading = !1, this.lastAction = void 0, this.frozenIndex = void 0, this.preResetTransformations = void 0, this.apiGetTransformAssetLink = me, this.apiGetCropFocusMode = Se, this.onCropComplete = this.onCropComplete.bind(this), this.onCropDragStart = this.onCropDragStart.bind(this);
1799
1823
  }
1800
1824
  /**
1801
1825
  * Transform requests must resolve to a web-displayable image (the browser renders the
@@ -1830,6 +1854,16 @@ let g = class extends U {
1830
1854
  (e) => e.key === u.Crop
1831
1855
  )?.value.focusMode ?? "manual";
1832
1856
  }
1857
+ /**
1858
+ * The anchor position of the last applied crop transformation, for the no-asset case
1859
+ * only. Reflects whatever position the last committed Crop transformation used, or
1860
+ * top-left when nothing has been applied yet.
1861
+ */
1862
+ get lastAppliedCropPosition() {
1863
+ return this.transformations.findLast(
1864
+ (e) => e.key === u.Crop
1865
+ )?.value.position ?? W.CenterCenter;
1866
+ }
1833
1867
  /**
1834
1868
  * Checks if the crop apply button should be disabled.
1835
1869
  * This is determined by comparing the current crop size with the last crop size.
@@ -1841,9 +1875,9 @@ let g = class extends U {
1841
1875
  return !1;
1842
1876
  if (this.cropSize.unit === o.AspectRatio && !this.asset) {
1843
1877
  const e = this.lastCropSize[o.AspectRatio];
1844
- return this.cropSize.ratioWidth === e.width && this.cropSize.ratioHeight === e.height && this.cropSize.focusMode === this.lastAppliedCropFocusMode;
1878
+ return this.cropSize.ratioWidth === e.width && this.cropSize.ratioHeight === e.height && this.cropSize.focusMode === this.lastAppliedCropFocusMode && this.cropSize.position === this.lastAppliedCropPosition;
1845
1879
  }
1846
- if (!this.asset && this.cropSize.focusMode !== this.lastAppliedCropFocusMode)
1880
+ if (!this.asset && this.cropSize.focusMode !== this.lastAppliedCropFocusMode || !this.asset && this.cropSize.position !== this.lastAppliedCropPosition)
1847
1881
  return !1;
1848
1882
  const t = [
1849
1883
  "height",
@@ -1909,14 +1943,14 @@ let g = class extends U {
1909
1943
  }
1910
1944
  };
1911
1945
  if (e?.value.width && e?.value.height) {
1912
- const { height: i, width: s, x: a = 0, y: r = 0 } = e.value, h = rt(s, i);
1946
+ const { height: i, width: s, x: a = 0, y: r = 0 } = e.value, n = nt(s, i);
1913
1947
  return {
1914
1948
  [o.AspectRatio]: {
1915
- height: h.height,
1949
+ height: n.height,
1916
1950
  percentageHeight: 100,
1917
1951
  percentageWidth: 100,
1918
1952
  unit: o.AspectRatio,
1919
- width: h.width,
1953
+ width: n.width,
1920
1954
  x: 0,
1921
1955
  y: 0
1922
1956
  },
@@ -1932,7 +1966,7 @@ let g = class extends U {
1932
1966
  };
1933
1967
  }
1934
1968
  }
1935
- const t = this.lastImageSize.width && this.lastImageSize.height ? rt(this.lastImageSize.width, this.lastImageSize.height) : { height: 1, width: 1 };
1969
+ const t = this.lastImageSize.width && this.lastImageSize.height ? nt(this.lastImageSize.width, this.lastImageSize.height) : { height: 1, width: 1 };
1936
1970
  return {
1937
1971
  [o.AspectRatio]: {
1938
1972
  height: t.height,
@@ -1979,7 +2013,7 @@ let g = class extends U {
1979
2013
  }
1980
2014
  };
1981
2015
  if (e?.value.width && e?.value.height) {
1982
- const { height: i, width: s } = e.value, a = rt(s, i);
2016
+ const { height: i, width: s } = e.value, a = nt(s, i);
1983
2017
  return {
1984
2018
  [o.AspectRatio]: {
1985
2019
  height: a.height,
@@ -1994,7 +2028,7 @@ let g = class extends U {
1994
2028
  };
1995
2029
  }
1996
2030
  }
1997
- const t = this.lastImageSize.width && this.lastImageSize.height ? rt(this.lastImageSize.width, this.lastImageSize.height) : { height: 1, width: 1 };
2031
+ const t = this.lastImageSize.width && this.lastImageSize.height ? nt(this.lastImageSize.width, this.lastImageSize.height) : { height: 1, width: 1 };
1998
2032
  return {
1999
2033
  [o.AspectRatio]: {
2000
2034
  height: t.height,
@@ -2025,7 +2059,7 @@ let g = class extends U {
2025
2059
  * Returns the transformation string for the asset link.
2026
2060
  */
2027
2061
  get transformationString() {
2028
- return ot({
2062
+ return rt({
2029
2063
  asset: this.asset,
2030
2064
  baseUrl: "",
2031
2065
  parameters: this.parameters,
@@ -2080,7 +2114,7 @@ let g = class extends U {
2080
2114
  */
2081
2115
  });
2082
2116
  });
2083
- const i = ot({
2117
+ const i = rt({
2084
2118
  asset: this.asset,
2085
2119
  baseUrl: "",
2086
2120
  extension: this.selectedFormat.extension,
@@ -2113,7 +2147,7 @@ let g = class extends U {
2113
2147
  async handleTransformationsChange() {
2114
2148
  if (await this.updateComplete, !this.asset) {
2115
2149
  this.emit("cx-asset-link-format-change", {
2116
- detail: ot({
2150
+ detail: rt({
2117
2151
  asset: this.asset,
2118
2152
  baseUrl: "",
2119
2153
  options: {
@@ -2128,19 +2162,20 @@ let g = class extends U {
2128
2162
  (c) => c.key === u.Crop && (c.value.unit === o.AspectRatio && c.value.ratioWidth && c.value.ratioHeight || c.value.width && c.value.height)
2129
2163
  );
2130
2164
  if (r?.value.unit === o.AspectRatio && r.value.ratioWidth && r.value.ratioHeight) {
2131
- const { focusMode: c, ratioHeight: f, ratioWidth: S } = r.value;
2165
+ const { focusMode: c, position: f, ratioHeight: S, ratioWidth: p } = r.value;
2132
2166
  this.cropSize = {
2133
2167
  ...this.cropSize,
2134
2168
  cropMode: "free",
2135
2169
  focusMode: c ?? "manual",
2136
2170
  percentageHeight: 100,
2137
2171
  percentageWidth: 100,
2138
- ratioHeight: f,
2139
- ratioWidth: S,
2172
+ position: f ?? W.CenterCenter,
2173
+ ratioHeight: S,
2174
+ ratioWidth: p,
2140
2175
  unit: o.AspectRatio
2141
2176
  };
2142
2177
  } else if (r) {
2143
- const { focusMode: c, height: f, unit: S, width: p, x: w = 0, y: R = 0 } = r.value;
2178
+ const { focusMode: c, height: f, position: S, unit: p, width: w, x: b = 0, y: x = 0 } = r.value;
2144
2179
  this.cropSize = {
2145
2180
  ...this.cropSize,
2146
2181
  cropMode: "free",
@@ -2148,10 +2183,11 @@ let g = class extends U {
2148
2183
  height: f,
2149
2184
  percentageHeight: 100,
2150
2185
  percentageWidth: 100,
2151
- unit: S ?? o.Pixel,
2152
- width: p,
2153
- x: w,
2154
- y: R
2186
+ position: S ?? W.CenterCenter,
2187
+ unit: p ?? o.Pixel,
2188
+ width: w,
2189
+ x: b,
2190
+ y: x
2155
2191
  };
2156
2192
  } else
2157
2193
  this.cropSize = {
@@ -2167,24 +2203,25 @@ let g = class extends U {
2167
2203
  height: 1,
2168
2204
  percentageHeight: 0,
2169
2205
  percentageWidth: 0,
2206
+ position: W.CenterCenter,
2170
2207
  unit: o.Pixel,
2171
2208
  width: 1,
2172
2209
  x: 0,
2173
2210
  y: 0
2174
2211
  };
2175
- const h = this.transformations.findLast(
2212
+ const n = this.transformations.findLast(
2176
2213
  (c) => c.key === u.Resize && (c.value.unit === o.AspectRatio && c.value.ratioWidth && c.value.ratioHeight || c.value.width || c.value.height)
2177
2214
  );
2178
- if (h?.value.unit === o.AspectRatio && h.value.ratioWidth && h.value.ratioHeight) {
2179
- const { ratioHeight: c, ratioWidth: f } = h.value;
2215
+ if (n?.value.unit === o.AspectRatio && n.value.ratioWidth && n.value.ratioHeight) {
2216
+ const { ratioHeight: c, ratioWidth: f } = n.value;
2180
2217
  this.resizeSize = {
2181
2218
  ...this.resizeSize,
2182
2219
  ratioHeight: c,
2183
2220
  ratioWidth: f,
2184
2221
  unit: o.AspectRatio
2185
2222
  };
2186
- } else if (h) {
2187
- const { height: c = 0, unit: f, width: S = 0 } = h.value;
2223
+ } else if (n) {
2224
+ const { height: c = 0, unit: f, width: S = 0 } = n.value;
2188
2225
  this.resizeSize = {
2189
2226
  ...this.resizeSize,
2190
2227
  height: c,
@@ -2203,10 +2240,10 @@ let g = class extends U {
2203
2240
  unit: o.Pixel,
2204
2241
  width: 1
2205
2242
  };
2206
- const n = this.transformations.findLast(
2243
+ const h = this.transformations.findLast(
2207
2244
  (c) => c.key === u.Rotate
2208
2245
  );
2209
- this.rotation = n?.value.rotation ?? 0;
2246
+ this.rotation = h?.value.rotation ?? 0;
2210
2247
  const d = this.transformations.findLast((c) => c.key === u.Quality)?.value.quality ?? 100, m = this.transformations.some(
2211
2248
  (c) => c.key === u.Metadata
2212
2249
  );
@@ -2257,6 +2294,7 @@ let g = class extends U {
2257
2294
  keepAspectRatio: this.cropSize.keepAspectRatio,
2258
2295
  percentageHeight: 100,
2259
2296
  percentageWidth: 100,
2297
+ position: W.CenterCenter,
2260
2298
  ratioHeight: 1,
2261
2299
  ratioWidth: 1,
2262
2300
  unit: o.Pixel,
@@ -2281,7 +2319,7 @@ let g = class extends U {
2281
2319
  * url: `${this.baseUrl}/${response.relativePath}`,
2282
2320
  */
2283
2321
  };
2284
- const a = ot({
2322
+ const a = rt({
2285
2323
  asset: this.asset,
2286
2324
  baseUrl: "",
2287
2325
  extension: this.selectedFormat.extension,
@@ -2337,6 +2375,7 @@ let g = class extends U {
2337
2375
  keepAspectRatio: !0,
2338
2376
  percentageHeight: 100,
2339
2377
  percentageWidth: 100,
2378
+ position: W.CenterCenter,
2340
2379
  ratioHeight: 1,
2341
2380
  ratioWidth: 1,
2342
2381
  unit: o.Pixel,
@@ -2360,24 +2399,24 @@ let g = class extends U {
2360
2399
  const i = this.proxies?.find((s) => s.id === t);
2361
2400
  i && (this.asset && i.proxyName === "TRX" && (i.formatHeight = Number(this.asset.height), i.formatWidth = Number(this.asset.width)), this.transformations = this.transformations.map((s) => {
2362
2401
  if (s.key === u.Crop) {
2363
- const a = s.value, r = a.width / i.formatWidth * e.formatWidth, h = a.height / i.formatHeight * e.formatHeight, n = a.x / i.formatWidth * e.formatWidth, d = a.y / i.formatHeight * e.formatHeight;
2402
+ const a = s.value, r = a.width / i.formatWidth * e.formatWidth, n = a.height / i.formatHeight * e.formatHeight, h = a.x / i.formatWidth * e.formatWidth, d = a.y / i.formatHeight * e.formatHeight;
2364
2403
  return {
2365
2404
  ...s,
2366
2405
  value: {
2367
2406
  ...s.value,
2368
- height: h,
2407
+ height: n,
2369
2408
  width: r,
2370
- x: n,
2409
+ x: h,
2371
2410
  y: d
2372
2411
  }
2373
2412
  };
2374
2413
  }
2375
2414
  if (s.key === u.Resize) {
2376
- const a = s.value, r = a.width / i.formatWidth * e.formatWidth, h = a.height / i.formatHeight * e.formatHeight;
2415
+ const a = s.value, r = a.width / i.formatWidth * e.formatWidth, n = a.height / i.formatHeight * e.formatHeight;
2377
2416
  return {
2378
2417
  ...s,
2379
2418
  value: {
2380
- height: h,
2419
+ height: n,
2381
2420
  width: r
2382
2421
  }
2383
2422
  };
@@ -2397,6 +2436,7 @@ let g = class extends U {
2397
2436
  keepAspectRatio: !0,
2398
2437
  percentageHeight: 100,
2399
2438
  percentageWidth: 100,
2439
+ position: W.CenterCenter,
2400
2440
  ratioHeight: 1,
2401
2441
  ratioWidth: 1,
2402
2442
  unit: o.Pixel,
@@ -2444,8 +2484,8 @@ let g = class extends U {
2444
2484
  keepAspectRatio: s,
2445
2485
  percentageHeight: a,
2446
2486
  percentageWidth: r,
2447
- ratioHeight: h,
2448
- ratioWidth: n,
2487
+ ratioHeight: n,
2488
+ ratioWidth: h,
2449
2489
  unit: d,
2450
2490
  useCropMode: m,
2451
2491
  width: c
@@ -2478,8 +2518,8 @@ let g = class extends U {
2478
2518
  focusMode: e
2479
2519
  },
2480
2520
  keepAspectRatio: s ?? this.cropSize.keepAspectRatio,
2481
- ratioHeight: h ?? this.cropSize.ratioHeight,
2482
- ratioWidth: n ?? this.cropSize.ratioWidth,
2521
+ ratioHeight: n ?? this.cropSize.ratioHeight,
2522
+ ratioWidth: h ?? this.cropSize.ratioWidth,
2483
2523
  unit: d ?? this.cropSize.unit
2484
2524
  };
2485
2525
  }
@@ -2494,9 +2534,9 @@ let g = class extends U {
2494
2534
  } = e;
2495
2535
  if (s === 0 || i === 0)
2496
2536
  return;
2497
- const h = this.cropSize.percentageWidth !== s, n = this.cropSize.percentageHeight !== i;
2537
+ const n = this.cropSize.percentageWidth !== s, h = this.cropSize.percentageHeight !== i;
2498
2538
  let d = this.cropSize.height, m = this.cropSize.width;
2499
- h && (m = Math.round(s * this.selectedFormat.width / 100)), n && (d = Math.round(
2539
+ n && (m = Math.round(s * this.selectedFormat.width / 100)), h && (d = Math.round(
2500
2540
  i * this.selectedFormat.height / 100
2501
2541
  ));
2502
2542
  const c = this.cropSize.focusMode;
@@ -2551,8 +2591,8 @@ let g = class extends U {
2551
2591
  const s = this.focusModes.find(
2552
2592
  (d) => d.value === this.cropSize.focusMode
2553
2593
  )?.auto;
2554
- let a = this.cropSize.keepAspectRatio, r = this.cropSize.focusMode, h = this.cropSize.x, n = this.cropSize.y;
2555
- e === "free" ? (a = !1, r = "manual") : this.cropSize.unit === o.Pixel && !s && (h = 0, n = 0), s ? await this.handleRequestAutoCropSuggestion({
2594
+ let a = this.cropSize.keepAspectRatio, r = this.cropSize.focusMode, n = this.cropSize.x, h = this.cropSize.y;
2595
+ e === "free" ? (a = !1, r = "manual") : this.cropSize.unit === o.Pixel && !s && (n = 0, h = 0), s ? await this.handleRequestAutoCropSuggestion({
2556
2596
  cropMode: e,
2557
2597
  focusMode: r,
2558
2598
  height: this.cropSize.height,
@@ -2563,8 +2603,8 @@ let g = class extends U {
2563
2603
  cropMode: e,
2564
2604
  focusMode: r,
2565
2605
  keepAspectRatio: a,
2566
- x: h,
2567
- y: n
2606
+ x: n,
2607
+ y: h
2568
2608
  };
2569
2609
  }
2570
2610
  }
@@ -2579,6 +2619,12 @@ let g = class extends U {
2579
2619
  focusMode: e
2580
2620
  };
2581
2621
  }
2622
+ onCropPositionChange(t) {
2623
+ this.cropSize = {
2624
+ ...this.cropSize,
2625
+ position: t.detail.position
2626
+ };
2627
+ }
2582
2628
  async onCropChange(t) {
2583
2629
  const e = this.cropSize.unit;
2584
2630
  if (t.detail.unit === o.AspectRatio) {
@@ -2588,37 +2634,37 @@ let g = class extends U {
2588
2634
  ) : 0, a = this.asset ? Math.min(
2589
2635
  Math.max(Math.round(s / i), 0),
2590
2636
  this.resizeSize.height
2591
- ) : 0, r = this.asset ? a * 100 / this.selectedFormat.height : 100, h = this.asset ? s * 100 / this.selectedFormat.width : 100;
2592
- let n = this.cropSize.x, d = this.cropSize.y;
2593
- n + h > 100 && (n = 100 - h), d + r > 100 && (d = 100 - r);
2637
+ ) : 0, r = this.asset ? a * 100 / this.selectedFormat.height : 100, n = this.asset ? s * 100 / this.selectedFormat.width : 100;
2638
+ let h = this.cropSize.x, d = this.cropSize.y;
2639
+ h + n > 100 && (h = 100 - n), d + r > 100 && (d = 100 - r);
2594
2640
  let m = this.cropSize.cropMode;
2595
2641
  this.cropModes.find(
2596
2642
  (f) => f.value === m
2597
- )?.auto && (m = "free"), t.detail.silent ? (this.cropSize.height = a, this.cropSize.keepAspectRatio = t.detail.keepAspectRatio, this.cropSize.percentageHeight = r, this.cropSize.percentageWidth = h, this.cropSize.ratioHeight = t.detail.height, this.cropSize.ratioWidth = t.detail.width, this.cropSize.unit = o.AspectRatio, this.cropSize.width = s) : this.cropSize = {
2643
+ )?.auto && (m = "free"), t.detail.silent ? (this.cropSize.height = a, this.cropSize.keepAspectRatio = t.detail.keepAspectRatio, this.cropSize.percentageHeight = r, this.cropSize.percentageWidth = n, this.cropSize.ratioHeight = t.detail.height, this.cropSize.ratioWidth = t.detail.width, this.cropSize.unit = o.AspectRatio, this.cropSize.width = s) : this.cropSize = {
2598
2644
  ...this.cropSize,
2599
2645
  cropMode: m,
2600
2646
  height: a,
2601
2647
  keepAspectRatio: t.detail.keepAspectRatio,
2602
2648
  percentageHeight: r,
2603
- percentageWidth: h,
2649
+ percentageWidth: n,
2604
2650
  ratioHeight: t.detail.height,
2605
2651
  ratioWidth: t.detail.width,
2606
2652
  unit: o.AspectRatio,
2607
2653
  width: s,
2608
- x: n,
2654
+ x: h,
2609
2655
  y: d
2610
2656
  };
2611
2657
  } else {
2612
2658
  const i = this.asset ? t.detail.height * 100 / this.selectedFormat.height : 100, s = this.asset ? t.detail.width * 100 / this.selectedFormat.width : 100;
2613
2659
  let a = this.cropSize.x, r = this.cropSize.y;
2614
2660
  a + s > 100 && (a = 100 - s), r + i > 100 && (r = 100 - i);
2615
- let h = this.cropSize.cropMode;
2616
- const n = this.cropModes.find(
2617
- (d) => d.value === h
2661
+ let n = this.cropSize.cropMode;
2662
+ const h = this.cropModes.find(
2663
+ (d) => d.value === n
2618
2664
  )?.auto;
2619
- (t.detail.breakAspectRatio || n) && (h = "free"), t.detail.silent ? (this.cropSize.cropMode = h, this.cropSize.height = t.detail.height, this.cropSize.keepAspectRatio = t.detail.keepAspectRatio, this.cropSize.percentageHeight = i, this.cropSize.percentageWidth = s, this.cropSize.unit = o.Pixel, this.cropSize.width = t.detail.width, this.cropSize.x = a, this.cropSize.y = r) : this.cropSize = {
2665
+ (t.detail.breakAspectRatio || h) && (n = "free"), t.detail.silent ? (this.cropSize.cropMode = n, this.cropSize.height = t.detail.height, this.cropSize.keepAspectRatio = t.detail.keepAspectRatio, this.cropSize.percentageHeight = i, this.cropSize.percentageWidth = s, this.cropSize.unit = o.Pixel, this.cropSize.width = t.detail.width, this.cropSize.x = a, this.cropSize.y = r) : this.cropSize = {
2620
2666
  ...this.cropSize,
2621
- cropMode: h,
2667
+ cropMode: n,
2622
2668
  height: t.detail.height,
2623
2669
  keepAspectRatio: t.detail.keepAspectRatio,
2624
2670
  percentageHeight: i,
@@ -2646,40 +2692,50 @@ let g = class extends U {
2646
2692
  onCropApply(t) {
2647
2693
  if (this.preResetTransformations = void 0, this.lastAction = u.Crop, !this.asset) {
2648
2694
  const {
2649
- focusMode: n,
2695
+ focusMode: h,
2650
2696
  height: d,
2651
- ratioHeight: m,
2652
- ratioWidth: c,
2653
- unit: f,
2654
- width: S,
2655
- x: p,
2656
- y: w
2657
- } = this.cropSize, R = this.focusModes.find(
2658
- (x) => x.value === n
2697
+ position: m,
2698
+ ratioHeight: c,
2699
+ ratioWidth: f,
2700
+ unit: S,
2701
+ width: p,
2702
+ x: w,
2703
+ y: b
2704
+ } = this.cropSize, x = this.focusModes.find(
2705
+ (F) => F.value === h
2659
2706
  )?.auto ?? !1;
2660
- if (f === o.AspectRatio) {
2661
- c && m && this.upsertTransformation({
2707
+ if (S === o.AspectRatio) {
2708
+ f && c && this.upsertTransformation({
2662
2709
  key: u.Crop,
2663
2710
  value: {
2664
- focusMode: n,
2665
- isFocusModeAuto: R,
2666
- ratioHeight: m,
2667
- ratioWidth: c,
2668
- unit: f
2711
+ focusMode: h,
2712
+ isFocusModeAuto: x,
2713
+ position: m,
2714
+ ratioHeight: c,
2715
+ ratioWidth: f,
2716
+ unit: S
2669
2717
  }
2670
2718
  });
2671
2719
  return;
2672
2720
  }
2673
- (d || S) && this.upsertTransformation({
2721
+ (d || p) && this.upsertTransformation({
2674
2722
  key: u.Crop,
2675
2723
  value: {
2676
- focusMode: n,
2724
+ focusMode: h,
2677
2725
  height: d,
2678
- isFocusModeAuto: R,
2679
- unit: f,
2680
- width: S,
2681
- x: Number.isFinite(p) ? p : void 0,
2682
- y: Number.isFinite(w) ? w : void 0
2726
+ isFocusModeAuto: x,
2727
+ position: m,
2728
+ unit: S,
2729
+ width: p,
2730
+ /**
2731
+ * Without an asset there is no cropper to drag, so x/y are always the 0
2732
+ * placeholder from cropSize's default — never a real manual offset. Omit
2733
+ * zero values (matching the `omitZeroXY` behavior used for the live preview
2734
+ * string) so `hasManualXY` in buildTransformationString doesn't spuriously
2735
+ * suppress the focus mode / position `c_g_` gravity value.
2736
+ */
2737
+ x: Number.isFinite(w) && w !== 0 ? w : void 0,
2738
+ y: Number.isFinite(b) && b !== 0 ? b : void 0
2683
2739
  }
2684
2740
  });
2685
2741
  return;
@@ -2687,12 +2743,12 @@ let g = class extends U {
2687
2743
  const { height: e, mode: i, unit: s, width: a } = t.detail;
2688
2744
  if (!this.cropperElement || !this.selectedFormat)
2689
2745
  return;
2690
- const r = this.cropSize.focusMode, h = this.focusModes.find(
2691
- (n) => n.value === r
2746
+ const r = this.cropSize.focusMode, n = this.focusModes.find(
2747
+ (h) => h.value === r
2692
2748
  )?.auto ?? !1;
2693
2749
  if (e && a && s) {
2694
- let n = a, d = e;
2695
- if (s === o.AspectRatio && (n = this.cropSize.percentageWidth * this.selectedFormat.width / 100, d = this.cropSize.percentageHeight * this.selectedFormat.height / 100), i)
2750
+ let h = a, d = e;
2751
+ if (s === o.AspectRatio && (h = this.cropSize.percentageWidth * this.selectedFormat.width / 100, d = this.cropSize.percentageHeight * this.selectedFormat.height / 100), i)
2696
2752
  this.transformations = [
2697
2753
  ...this.transformations,
2698
2754
  {
@@ -2700,9 +2756,9 @@ let g = class extends U {
2700
2756
  value: {
2701
2757
  focusMode: r,
2702
2758
  height: d,
2703
- isFocusModeAuto: h,
2759
+ isFocusModeAuto: n,
2704
2760
  mode: i,
2705
- width: n
2761
+ width: h
2706
2762
  }
2707
2763
  }
2708
2764
  ];
@@ -2715,9 +2771,9 @@ let g = class extends U {
2715
2771
  value: {
2716
2772
  focusMode: r,
2717
2773
  height: d,
2718
- isFocusModeAuto: h,
2774
+ isFocusModeAuto: n,
2719
2775
  unit: s,
2720
- width: n,
2776
+ width: h,
2721
2777
  x: m,
2722
2778
  y: c
2723
2779
  }
@@ -2730,7 +2786,7 @@ let g = class extends U {
2730
2786
  key: u.Crop,
2731
2787
  value: {
2732
2788
  focusMode: r,
2733
- isFocusModeAuto: h,
2789
+ isFocusModeAuto: n,
2734
2790
  mode: i
2735
2791
  }
2736
2792
  }
@@ -2788,15 +2844,15 @@ let g = class extends U {
2788
2844
  if (!this.selectedFormat)
2789
2845
  return;
2790
2846
  const a = this.selectedFormat.width || this.defaultSize.width, r = this.selectedFormat.height || this.defaultSize.height;
2791
- let h = s, n = e;
2792
- this.resizeSize.unit !== i ? (h = a, n = r) : i === o.AspectRatio && (h = Math.round(s / e * r), n = r), this.transformations = [
2847
+ let n = s, h = e;
2848
+ this.resizeSize.unit !== i ? (n = a, h = r) : i === o.AspectRatio && (n = Math.round(s / e * r), h = r), this.transformations = [
2793
2849
  ...this.transformations,
2794
2850
  {
2795
2851
  key: u.Resize,
2796
2852
  value: {
2797
- height: n,
2853
+ height: h,
2798
2854
  unit: i,
2799
- width: h
2855
+ width: n
2800
2856
  }
2801
2857
  }
2802
2858
  ];
@@ -2891,7 +2947,7 @@ let g = class extends U {
2891
2947
  return A`<div class="asset-link-format" @cx-show=${this.onDetailsShow} @cx-hide=${this.onDetailsHide}>${_(
2892
2948
  !this.hideHeader,
2893
2949
  () => A`<cx-space class="asset-link-format__section-header" direction="horizontal" spacing="small" align-items="center" justify-content="space-between"><cx-typography variant="body3">${this.localize.term("transformations")}</cx-typography><cx-space direction="horizontal" spacing="3x-small" align-items="center"><cx-button class="asset-link-format__undo" variant="custom" ?disabled=${!this.hasUnfrozenTransformations && this.preResetTransformations === void 0} @click=${this.handleUndo}>${this.localize.term("undo")}</cx-button>${_(this.canReset, () => A`<cx-button class="asset-link-format__reset" variant="custom" ?disabled=${this.transformations.length === 0} @click=${this.handleReset}>${this.localize.term("reset")}</cx-button>`)}</cx-space></cx-space>`,
2894
- () => Qt
2950
+ () => Xt
2895
2951
  )}
2896
2952
  ${_(
2897
2953
  !this.noFormat,
@@ -2899,7 +2955,7 @@ let g = class extends U {
2899
2955
  )}
2900
2956
  ${_(
2901
2957
  !this.noCrop,
2902
- () => A`<cx-asset-link-format-crop class="asset-link-format__details" ?open=${this.activeSetting === "cx-asset-link-format-crop"} ?disabled-apply=${this.disabledCropApply} ?loading=${this.loading && this.lastAction === u.Crop} ?no-ratio-modes=${!this.asset} ?keep-aspect-ratio=${this.cropSize.keepAspectRatio} focus-mode=${this.cropSize.focusMode} crop-mode=${this.cropSize.cropMode} width=${this.cropSize.width} height=${this.cropSize.height} max-width=${this.asset ? this.lastResizeSize[o.Pixel].width : 1 / 0} max-height=${this.asset ? this.lastResizeSize[o.Pixel].height : 1 / 0} percentage-width=${this.cropSize.percentageWidth} percentage-height=${this.cropSize.percentageHeight} ratio-width=${this.cropSize.ratioWidth} ratio-height=${this.cropSize.ratioHeight} unit=${this.cropSize.unit} .lastAppliedSetting=${this.lastCropSize} .cropModes=${this.cropModes} .focusModes=${this.focusModes} @cx-asset-link-format-crop-mode-change=${this.onCropModeChange} @cx-asset-link-format-crop-focus-mode-change=${this.onCropFocusModeChange} @cx-asset-link-format-crop-change=${this.onCropChange} @cx-asset-link-format-crop-changed=${this.onCropChanged} @cx-asset-link-format-crop-apply=${this.onCropApply}></cx-asset-link-format-crop>`
2958
+ () => A`<cx-asset-link-format-crop class="asset-link-format__details" ?open=${this.activeSetting === "cx-asset-link-format-crop"} ?disabled-apply=${this.disabledCropApply} ?loading=${this.loading && this.lastAction === u.Crop} ?keep-aspect-ratio=${this.cropSize.keepAspectRatio} ?show-position-picker=${!this.asset} focus-mode=${this.cropSize.focusMode} crop-mode=${this.cropSize.cropMode} width=${this.cropSize.width} height=${this.cropSize.height} max-width=${this.asset ? this.lastResizeSize[o.Pixel].width : 1 / 0} max-height=${this.asset ? this.lastResizeSize[o.Pixel].height : 1 / 0} percentage-width=${this.cropSize.percentageWidth} percentage-height=${this.cropSize.percentageHeight} position=${this.cropSize.position} ratio-width=${this.cropSize.ratioWidth} ratio-height=${this.cropSize.ratioHeight} unit=${this.cropSize.unit} .lastAppliedSetting=${this.lastCropSize} .cropModes=${this.cropModes} .focusModes=${this.focusModes} @cx-asset-link-format-crop-mode-change=${this.onCropModeChange} @cx-asset-link-format-crop-focus-mode-change=${this.onCropFocusModeChange} @cx-asset-link-format-crop-position-change=${this.onCropPositionChange} @cx-asset-link-format-crop-change=${this.onCropChange} @cx-asset-link-format-crop-changed=${this.onCropChanged} @cx-asset-link-format-crop-apply=${this.onCropApply}></cx-asset-link-format-crop>`
2903
2959
  )}
2904
2960
  ${_(
2905
2961
  !this.noResize,
@@ -2918,18 +2974,18 @@ let g = class extends U {
2918
2974
  )}</div>`;
2919
2975
  }
2920
2976
  };
2921
- g.styles = [j, Se];
2977
+ g.styles = [V, ze];
2922
2978
  g.dependencies = {
2923
- "cx-asset-link-format-crop": z,
2924
- "cx-asset-link-format-extension": X,
2925
- "cx-asset-link-format-metadata": N,
2926
- "cx-asset-link-format-proxy": I,
2979
+ "cx-asset-link-format-crop": C,
2980
+ "cx-asset-link-format-extension": K,
2981
+ "cx-asset-link-format-metadata": O,
2982
+ "cx-asset-link-format-proxy": E,
2927
2983
  "cx-asset-link-format-quality": T,
2928
- "cx-asset-link-format-resize": b,
2984
+ "cx-asset-link-format-resize": v,
2929
2985
  "cx-asset-link-format-rotation": H,
2930
- "cx-button": K,
2931
- "cx-space": O,
2932
- "cx-typography": L
2986
+ "cx-button": Z,
2987
+ "cx-space": L,
2988
+ "cx-typography": U
2933
2989
  };
2934
2990
  y([
2935
2991
  l({ attribute: "base-url", type: String })
@@ -2998,74 +3054,74 @@ y([
2998
3054
  l({ attribute: !1, reflect: !1, type: Object })
2999
3055
  ], g.prototype, "queryElement", 2);
3000
3056
  y([
3001
- k()
3057
+ R()
3002
3058
  ], g.prototype, "activeSetting", 2);
3003
3059
  y([
3004
- k()
3060
+ R()
3005
3061
  ], g.prototype, "selectedFormat", 2);
3006
3062
  y([
3007
- k()
3063
+ R()
3008
3064
  ], g.prototype, "resizeSize", 2);
3009
3065
  y([
3010
- k()
3066
+ R()
3011
3067
  ], g.prototype, "cropSize", 2);
3012
3068
  y([
3013
- k()
3069
+ R()
3014
3070
  ], g.prototype, "rotation", 2);
3015
3071
  y([
3016
- k()
3072
+ R()
3017
3073
  ], g.prototype, "defaultSize", 2);
3018
3074
  y([
3019
- k()
3075
+ R()
3020
3076
  ], g.prototype, "cropperElement", 2);
3021
3077
  y([
3022
- k()
3078
+ R()
3023
3079
  ], g.prototype, "parameters", 2);
3024
3080
  y([
3025
- k()
3081
+ R()
3026
3082
  ], g.prototype, "loading", 2);
3027
3083
  y([
3028
- k()
3084
+ R()
3029
3085
  ], g.prototype, "lastAction", 2);
3030
3086
  y([
3031
- k()
3087
+ R()
3032
3088
  ], g.prototype, "frozenIndex", 2);
3033
3089
  y([
3034
- k()
3090
+ R()
3035
3091
  ], g.prototype, "preResetTransformations", 2);
3036
3092
  y([
3037
- F("transformations")
3093
+ M("transformations")
3038
3094
  ], g.prototype, "handleTransformationsChange", 1);
3039
3095
  y([
3040
- F("selectedProxy")
3096
+ M("selectedProxy")
3041
3097
  ], g.prototype, "handleSelectedProxyChange", 1);
3042
3098
  y([
3043
- F("loading")
3099
+ M("loading")
3044
3100
  ], g.prototype, "handleLoadingChange", 1);
3045
3101
  g = y([
3046
- V("cx-asset-link-format")
3102
+ G("cx-asset-link-format")
3047
3103
  ], g);
3048
3104
  export {
3049
3105
  g as C,
3050
3106
  wt as D,
3051
- lt as F,
3052
- Y as O,
3053
- fe as a,
3054
- ne as b,
3055
- Lt as c,
3056
- $i as d,
3057
- Pi as e,
3058
- Ri as f,
3059
- Bt as g,
3060
- dt as h,
3107
+ ct as F,
3108
+ tt as O,
3109
+ xe as a,
3110
+ ce as b,
3111
+ Ut as c,
3112
+ Fi as d,
3113
+ _i as e,
3114
+ Mi as f,
3115
+ qt as g,
3116
+ ut as h,
3061
3117
  At as i,
3062
- nt as j,
3063
- Mt as k,
3064
- _t as l,
3065
- ct as m,
3066
- pt as n,
3067
- Et as o,
3068
- Fi as p,
3069
- se as q,
3070
- ie as u
3118
+ lt as j,
3119
+ _t as k,
3120
+ It as l,
3121
+ pt as m,
3122
+ dt as n,
3123
+ Ht as o,
3124
+ Ii as p,
3125
+ oe as q,
3126
+ ae as u
3071
3127
  };