@orangelogic/design-system 3.7.0 → 3.8.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.
@@ -12,39 +12,39 @@ import { a as ie } from "./string.Demn8Xmk.js";
12
12
  import "./date-picker.BGHn6qg8.js";
13
13
  import "./content-builder.BX4pHujE.js";
14
14
  import "./unsafe-html.Dff7-rCx.js";
15
- import { d as It, r as Bt, e as lt } from "./transformation.JkkMVin_.js";
16
- import { b as se } from "./_baseUniq.lwMgmtt2.js";
15
+ import { c as It, r as Bt, d as se, e as ct } from "./transformation.DNl_AZs1.js";
16
+ import { b as ae } from "./_baseUniq.lwMgmtt2.js";
17
17
  import { c as Q } from "./component.styles.CRO4Odto.js";
18
- import { M as zt, U as o, T as m } from "./asset-link-format.ClaYu_v8.js";
19
- import { v as ae } from "./v4.CKZ6klMF.js";
18
+ import { M as wt, U as r, T as f } from "./asset-link-format.ClaYu_v8.js";
19
+ import { v as oe } from "./v4.CKZ6klMF.js";
20
20
  import { P as N } from "./position-picker.DjnhxIKF.js";
21
21
  import { c as X } from "./custom-element.L4WJXn1j.js";
22
22
  import { w as P } from "./watch.DJF5K-8U.js";
23
- import { s as Et, a as ct } from "./number.Cx2ncfJJ.js";
24
- import { r as k } from "./state.CSDxrqLd.js";
23
+ import { s as Et, a as pt } from "./number.Cx2ncfJJ.js";
24
+ import { r as R } from "./state.CSDxrqLd.js";
25
25
  import { n as I } from "./when.Dr1es41R.js";
26
- import it from "../components/details.js";
26
+ import st from "../components/details.js";
27
27
  import qt from "../components/divider.js";
28
- import { C as st } from "./icon.CpHbi8tH.js";
28
+ import { C as at } from "./icon.CpHbi8tH.js";
29
29
  import { C as Pt } from "./icon-button.BWJ1Vqn5.js";
30
30
  import { C as Ft } from "./input.D1TGTsxj.js";
31
- import { C as St } from "./option.jeaj7_Lr.js";
32
- import At from "../components/select.js";
33
- import oe from "../components/position-picker.js";
34
- import { c as re } from "./image.Y5c_hFx8.js";
31
+ import { C as vt } from "./option.jeaj7_Lr.js";
32
+ import zt from "../components/select.js";
33
+ import re from "../components/position-picker.js";
34
+ import { c as ne } from "./image.Y5c_hFx8.js";
35
35
  import { e as tt } from "./query.BBf1UFkC.js";
36
- import { c as rt } from "./repeat.CFjcER6_.js";
36
+ import { c as nt } from "./repeat.CFjcER6_.js";
37
37
  import { o as O } from "./style-map.llVFPd__.js";
38
38
  import jt from "../components/tooltip.js";
39
- import ne from "../components/button-group.js";
40
- import he from "../components/checkbox.js";
41
- function le(t) {
42
- return t && t.length ? se(t) : [];
39
+ import he from "../components/button-group.js";
40
+ import le from "../components/checkbox.js";
41
+ function ce(t) {
42
+ return t && t.length ? ae(t) : [];
43
43
  }
44
44
  function Vt(t) {
45
45
  return typeof t == "object" && t !== null && "URI" in t;
46
46
  }
47
- const ce = {
47
+ const pe = {
48
48
  artist: "Artist",
49
49
  color: "Color",
50
50
  createDate: "CreateDate",
@@ -66,97 +66,97 @@ const ce = {
66
66
  systemIdentifier: "SystemIdentifier",
67
67
  text: "Text",
68
68
  title: "Title"
69
- }, pe = /* @__PURE__ */ new Set(["mediaDate", "createDate", "editDate"]);
70
- function kt(t) {
69
+ }, de = /* @__PURE__ */ new Set(["mediaDate", "createDate", "editDate"]);
70
+ function $t(t) {
71
71
  return !/[\s&+/*"\\:(),'<>~|[\]{}]/.test(t) && !/^(?:OR|AND|NOT)$/.test(t) ? t : `"${t.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
72
72
  }
73
73
  function Tt(t, e) {
74
- const s = (Array.isArray(e) ? e : [e]).map((a) => `${t}:${kt(a)}`);
74
+ const s = (Array.isArray(e) ? e : [e]).map((a) => `${t}:${$t(a)}`);
75
75
  return s.length > 1 ? `(${s.join(" OR ")})` : s[0] ?? "";
76
76
  }
77
- function de(t, e) {
77
+ function ue(t, e) {
78
78
  return (Array.isArray(e) ? e : [e]).map((s) => `${t}${s.operator}${s.value}`).join(" AND ");
79
79
  }
80
- function ue(t) {
80
+ function me(t) {
81
81
  const e = [];
82
82
  for (const i of Object.keys(t)) {
83
83
  const s = i, a = t[s];
84
84
  if (a == null)
85
85
  continue;
86
86
  if (s === "custom") {
87
- for (const [n, l] of Object.entries(
87
+ for (const [o, l] of Object.entries(
88
88
  a
89
89
  ))
90
- e.push(Tt(n, l));
90
+ e.push(Tt(o, l));
91
91
  continue;
92
92
  }
93
- const r = ce[s];
94
- if (r) {
95
- if (pe.has(s)) {
93
+ const n = pe[s];
94
+ if (n) {
95
+ if (de.has(s)) {
96
96
  e.push(
97
- de(r, a)
97
+ ue(n, a)
98
98
  );
99
99
  continue;
100
100
  }
101
101
  if (s === "color") {
102
- e.push(`${r}:${a}`);
102
+ e.push(`${n}:${a}`);
103
103
  continue;
104
104
  }
105
105
  if (s === "parentFolderIdentifier") {
106
- const n = Array.isArray(a) ? a : [a];
107
- if (n.length === 0)
106
+ const o = Array.isArray(a) ? a : [a];
107
+ if (o.length === 0)
108
108
  continue;
109
109
  const l = [
110
- ...n.map((p) => `ParentFolderIdentifier:${kt(String(p))}`),
111
- ...n.map((p) => `ParentAlbumIdentifier:${kt(String(p))}`)
110
+ ...o.map((d) => `ParentFolderIdentifier:${$t(String(d))}`),
111
+ ...o.map((d) => `ParentAlbumIdentifier:${$t(String(d))}`)
112
112
  ];
113
113
  e.push(`(${l.join(" OR ")})`);
114
114
  continue;
115
115
  }
116
- e.push(Tt(r, a));
116
+ e.push(Tt(n, a));
117
117
  }
118
118
  }
119
119
  return e.join(" AND ");
120
120
  }
121
- function pt(t) {
121
+ function dt(t) {
122
122
  if ("and" in t)
123
- return t.and.map(pt).filter(Boolean).join(" AND ");
123
+ return t.and.map(dt).filter(Boolean).join(" AND ");
124
124
  if ("or" in t) {
125
- const e = t.or.map(pt).filter(Boolean);
125
+ const e = t.or.map(dt).filter(Boolean);
126
126
  return e.length > 1 ? `(${e.join(" OR ")})` : e[0] ?? "";
127
127
  }
128
128
  if ("not" in t) {
129
- const e = pt(t.not);
129
+ const e = dt(t.not);
130
130
  return e ? `NOT (${e})` : "";
131
131
  }
132
- return ue(t);
132
+ return me(t);
133
133
  }
134
- const me = "CoreField.LargeSizePreview", dt = "CoreField.DocType", fe = "Document.Title", ge = "Document.CaptionLong", nt = "Document.FileExtension", ut = "CoreField.FileSize", Ht = "CoreField.Identifier", mt = "CoreField.MaxHeight", ft = "CoreField.MaxWidth", gt = "Document.RecordID", Wt = "CoreField.DocSubType", Gt = "CoreField.TitleWithFallback", xt = "CoreField.OriginalFileName", yt = "CoreField.UpdatedFileName", _t = "__width", xe = "CoreField.OriginalPreview", Oi = "Document.DocSubType", Li = "Document.InPoint", Ui = "Document.OutPoint", Ct = {
134
+ const fe = "CoreField.LargeSizePreview", ut = "CoreField.DocType", ge = "Document.Title", xe = "Document.CaptionLong", ht = "Document.FileExtension", mt = "CoreField.FileSize", Ht = "CoreField.Identifier", ft = "CoreField.MaxHeight", gt = "CoreField.MaxWidth", xt = "Document.RecordID", Wt = "CoreField.DocSubType", Gt = "CoreField.TitleWithFallback", yt = "CoreField.OriginalFileName", St = "CoreField.UpdatedFileName", _t = "__width", ye = "CoreField.OriginalPreview", Li = "Document.DocSubType", Ui = "Document.InPoint", Bi = "Document.OutPoint", bt = {
135
135
  DEFAULT_VIEW_SIZE: "Document.LargeSizePreview",
136
136
  FIELD_TITLE_WITH_FALLBACK: "Document.TitleWithFallback",
137
137
  ORIGINAL_VIEW_SIZE: "Document.OriginalPreview"
138
138
  }, Qt = {
139
- [me]: Ct.DEFAULT_VIEW_SIZE,
140
- [Gt]: Ct.FIELD_TITLE_WITH_FALLBACK,
141
- [xe]: Ct.ORIGINAL_VIEW_SIZE
142
- }, ye = Object.fromEntries(
139
+ [fe]: bt.DEFAULT_VIEW_SIZE,
140
+ [Gt]: bt.FIELD_TITLE_WITH_FALLBACK,
141
+ [ye]: bt.ORIGINAL_VIEW_SIZE
142
+ }, Se = Object.fromEntries(
143
143
  Object.entries(Qt).map(([t, e]) => [
144
144
  e,
145
145
  t
146
146
  ])
147
147
  );
148
- function Se(t) {
148
+ function Ae(t) {
149
149
  return Qt[t] ?? t;
150
150
  }
151
151
  function Dt(t) {
152
152
  const e = {};
153
153
  for (const [i, s] of Object.entries(t)) {
154
- const a = ye[i] ?? i;
154
+ const a = Se[i] ?? i;
155
155
  e[a] = s;
156
156
  }
157
157
  return e;
158
158
  }
159
- function Ae(t) {
159
+ function ve(t) {
160
160
  const e = new URLSearchParams();
161
161
  for (const [i, s] of Object.entries(t))
162
162
  s != null && (Array.isArray(s) ? s.forEach((a) => e.append(i, String(a))) : e.append(i, String(s)));
@@ -168,33 +168,33 @@ async function Xt({
168
168
  getPermanentAssetsPaths: i,
169
169
  httpMethod: s = "GET",
170
170
  isSiteBuilder: a,
171
- pageNumber: r,
172
- query: n,
171
+ pageNumber: n,
172
+ query: o,
173
173
  securityByPassToken: l,
174
- siteUrl: p,
175
- sort: x,
174
+ siteUrl: d,
175
+ sort: m,
176
176
  token: c,
177
- useSession: f
177
+ useSession: y
178
178
  }) {
179
- const y = e?.map(Se), d = {
179
+ const S = e?.map(Ae), p = {
180
180
  CountPerPage: t,
181
- Fields: le(y),
181
+ Fields: ce(S),
182
182
  Format: "json",
183
183
  GetPermanentAssetsPaths: i || void 0,
184
- PageNumber: r,
185
- Query: pt(n),
184
+ PageNumber: n,
185
+ Query: dt(o),
186
186
  SecurityByPassToken: l || void 0,
187
- Sort: x || void 0,
188
- UseSession: f || void 0
189
- }, S = s === "POST";
187
+ Sort: m || void 0,
188
+ UseSession: y || void 0
189
+ }, g = s === "POST";
190
190
  try {
191
191
  return (await T.request({
192
- baseURL: p,
192
+ baseURL: d,
193
193
  headers: c ? { Authorization: `Bearer ${c}` } : void 0,
194
194
  method: s,
195
195
  // POST large RecordID queries as a urlencoded body to dodge the ~2KB URL cap;
196
196
  // GET keeps the same fields on the query string.
197
- ...S ? { data: Ae(d) } : { params: d, paramsSerializer: { indexes: null } },
197
+ ...g ? { data: ve(p) } : { params: p, paramsSerializer: { indexes: null } },
198
198
  responseType: "json",
199
199
  transformResponse: [
200
200
  ...Array.isArray(T.defaults.transformResponse) ? T.defaults.transformResponse : [],
@@ -214,14 +214,14 @@ async function Xt({
214
214
  return { items: [], sort: "", totalCount: 0 };
215
215
  }
216
216
  }
217
- async function ve({
217
+ async function ze({
218
218
  assetId: t,
219
219
  extension: e,
220
220
  format: i,
221
221
  siteUrl: s,
222
222
  token: a,
223
- transformations: r,
224
- useSession: n
223
+ transformations: n,
224
+ useSession: o
225
225
  }) {
226
226
  try {
227
227
  return (await T.request({
@@ -232,8 +232,8 @@ async function ve({
232
232
  SourceAssetRecordID: t,
233
233
  TargetExtension: ie(e),
234
234
  Token: a || void 0,
235
- Transformations: r,
236
- UseSession: n || void 0
235
+ Transformations: n,
236
+ UseSession: o || void 0
237
237
  },
238
238
  /**
239
239
  * https://link.orangelogic.com/Tasks/41S1XH
@@ -246,65 +246,65 @@ async function ve({
246
246
  return null;
247
247
  }
248
248
  }
249
- const ze = 50;
250
- function Ce(t, e) {
249
+ const Ce = 50;
250
+ function we(t, e) {
251
251
  const i = [];
252
252
  for (let s = 0; s < t.length; s += e)
253
253
  i.push(t.slice(s, s + e));
254
254
  return i;
255
255
  }
256
- async function we({
256
+ async function be({
257
257
  extraFields: t,
258
258
  getPermanentAssetsPaths: e,
259
259
  isSiteBuilder: i,
260
260
  recordIds: s,
261
261
  securityByPassToken: a,
262
- token: r
262
+ token: n
263
263
  }) {
264
264
  if (!Array.isArray(s) || s.length === 0)
265
265
  return { facets: [], items: [], totalCount: 0 };
266
- const n = t?.filter((d) => d && typeof d == "string") ?? [], l = [
267
- ...n,
266
+ const o = t?.filter((p) => p && typeof p == "string") ?? [], l = [
267
+ ...o,
268
+ St,
268
269
  yt,
269
- xt,
270
- fe,
271
270
  ge,
272
- gt
273
- ], p = Ce(s, ze), x = await Promise.all(
274
- p.map(
275
- (d) => Xt({
276
- countPerPage: d.length,
271
+ xe,
272
+ xt
273
+ ], d = we(s, Ce), m = await Promise.all(
274
+ d.map(
275
+ (p) => Xt({
276
+ countPerPage: p.length,
277
277
  fields: l,
278
278
  getPermanentAssetsPaths: e,
279
279
  httpMethod: i ? "GET" : "POST",
280
280
  isSiteBuilder: i,
281
281
  pageNumber: 1,
282
- query: { recordId: d },
282
+ query: { recordId: p },
283
283
  securityByPassToken: a,
284
- token: r
284
+ token: n
285
285
  })
286
286
  )
287
- ), c = new Map(s.map((d, S) => [d, S])), f = x.flatMap((d) => d.items).map((d) => {
288
- let S = M(d, yt);
289
- return S === "" && (S = M(d, xt)), {
290
- name: S,
291
- recordId: M(d, gt),
292
- ...n.reduce(
293
- (R, A) => {
294
- R[A] = M(d, A);
295
- const F = Kt(d, A);
296
- return F !== void 0 && (R[`${A}${_t}`] = String(F)), R;
287
+ ), c = new Map(s.map((p, g) => [p, g])), y = m.flatMap((p) => p.items).map((p) => {
288
+ let g = M(p, St);
289
+ return g === "" && (g = M(p, yt)), {
290
+ name: g,
291
+ recordId: M(p, xt),
292
+ ...o.reduce(
293
+ (w, A) => {
294
+ w[A] = M(p, A);
295
+ const F = Kt(p, A);
296
+ return F !== void 0 && (w[`${A}${_t}`] = String(F)), w;
297
297
  },
298
298
  {}
299
299
  )
300
300
  };
301
301
  }).sort(
302
- (d, S) => (c.get(d.recordId) ?? 1 / 0) - (c.get(S.recordId) ?? 1 / 0)
303
- ), y = x.reduce(
304
- (d, S) => d + S.totalCount,
302
+ (p, g) => (c.get(p.recordId) ?? 1 / 0) - (c.get(g.recordId) ?? 1 / 0)
303
+ ), S = m.reduce(
304
+ (p, g) => p + g.totalCount,
305
305
  0
306
306
  );
307
- return { facets: [], items: f, totalCount: y };
307
+ return { facets: [], items: y, totalCount: S };
308
308
  }
309
309
  function M(t, e) {
310
310
  const i = t[e];
@@ -315,70 +315,70 @@ function Kt(t, e) {
315
315
  if (!(i == null || !Vt(i)))
316
316
  return typeof i.Width == "number" && i.Width > 0 ? i.Width : void 0;
317
317
  }
318
- async function be({
318
+ async function ke({
319
319
  countPerPage: t,
320
320
  directParentFolderIdentifier: e,
321
321
  excludedDocTypes: i,
322
322
  extraFields: s,
323
323
  getPermanentAssetsPaths: a,
324
- isSiteBuilder: r,
325
- limitedDocTypes: n,
324
+ isSiteBuilder: n,
325
+ limitedDocTypes: o,
326
326
  pageNumber: l,
327
- parentFolderIdentifier: p,
328
- searchTerm: x,
327
+ parentFolderIdentifier: d,
328
+ searchTerm: m,
329
329
  securityByPassToken: c,
330
- sortOrder: f,
331
- token: y
330
+ sortOrder: y,
331
+ token: S
332
332
  }) {
333
- if (!e && !p)
333
+ if (!e && !d)
334
334
  return { facets: [], items: [], totalCount: 0 };
335
- const d = (s?.filter((w) => w && typeof w == "string") ?? []).map((w) => w.replace("%20", " ")), S = {
335
+ const p = (s?.filter((b) => b && typeof b == "string") ?? []).map((b) => b.replace("%20", " ")), g = {
336
336
  directParentFolderIdentifier: e,
337
- parentFolderIdentifier: p,
338
- ...n && n.length > 0 ? { docType: n } : {}
339
- }, R = i && i.length > 0 ? { and: [S, { not: { docType: i } }] } : S, A = await Xt({
337
+ parentFolderIdentifier: d,
338
+ ...o && o.length > 0 ? { docType: o } : {}
339
+ }, w = i && i.length > 0 ? { and: [g, { not: { docType: i } }] } : g, A = await Xt({
340
340
  countPerPage: t,
341
341
  fields: [
342
- ...d,
342
+ ...p,
343
343
  Gt,
344
+ gt,
344
345
  ft,
345
346
  mt,
346
347
  ut,
347
- dt,
348
348
  Wt,
349
349
  Ht,
350
- nt,
351
- gt,
350
+ ht,
352
351
  xt,
353
- yt
352
+ yt,
353
+ St
354
354
  ],
355
355
  getPermanentAssetsPaths: a,
356
- isSiteBuilder: r,
356
+ isSiteBuilder: n,
357
357
  pageNumber: l,
358
- query: R,
358
+ query: w,
359
359
  securityByPassToken: c,
360
360
  sort: void 0,
361
- token: y
362
- }), F = A.items.map((w) => {
363
- let _ = M(w, nt), at = M(w, yt);
364
- _ && !_.startsWith(".") && (_ = "." + _), at === "" && (at = M(w, xt));
365
- const ht = M(w, gt);
361
+ token: S
362
+ }), F = A.items.map((b) => {
363
+ let _ = M(b, ht), ot = M(b, St);
364
+ _ && !_.startsWith(".") && (_ = "." + _), ot === "" && (ot = M(b, yt));
365
+ const lt = M(b, xt);
366
366
  return {
367
- docSubType: M(w, Wt),
368
- docType: M(w, dt) || "",
367
+ docSubType: M(b, Wt),
368
+ docType: M(b, ut) || "",
369
369
  extension: _,
370
- height: M(w, mt) || "0",
371
- id: ht,
372
- identifier: M(w, Ht),
373
- name: at,
374
- recordId: ht,
375
- size: M(w, ut) || "0 MB",
376
- width: M(w, ft) || "0",
377
- ...d.reduce(
370
+ height: M(b, ft) || "0",
371
+ id: lt,
372
+ identifier: M(b, Ht),
373
+ name: ot,
374
+ recordId: lt,
375
+ size: M(b, mt) || "0 MB",
376
+ width: M(b, gt) || "0",
377
+ ...p.reduce(
378
378
  (L, Z) => {
379
- L[Z] = M(w, Z);
380
- const ot = Kt(w, Z);
381
- return ot !== void 0 && (L[`${Z}${_t}`] = String(ot)), L;
379
+ L[Z] = M(b, Z);
380
+ const rt = Kt(b, Z);
381
+ return rt !== void 0 && (L[`${Z}${_t}`] = String(rt)), L;
382
382
  },
383
383
  {}
384
384
  )
@@ -390,7 +390,7 @@ async function be({
390
390
  totalCount: A.totalCount
391
391
  };
392
392
  }
393
- async function ke({
393
+ async function Re({
394
394
  autoCropMode: t,
395
395
  cropHeight: e,
396
396
  cropWidth: i,
@@ -412,11 +412,11 @@ async function ke({
412
412
  // 5 minutes
413
413
  transformResponse: [
414
414
  ...Array.isArray(T.defaults.transformResponse) ? T.defaults.transformResponse : [],
415
- (n) => ({
416
- height: n.cropHeight,
417
- width: n.cropWidth,
418
- x: n.cropX,
419
- y: n.cropY
415
+ (o) => ({
416
+ height: o.cropHeight,
417
+ width: o.cropWidth,
418
+ x: o.cropX,
419
+ y: o.cropY
420
420
  })
421
421
  ],
422
422
  url: Ot.GET_CROP_ZONE_SUGGESTION
@@ -425,7 +425,7 @@ async function ke({
425
425
  return null;
426
426
  }
427
427
  }
428
- async function Bi({
428
+ async function qi({
429
429
  assetRecordId: t,
430
430
  isSiteBuilder: e,
431
431
  siteUrl: i,
@@ -444,7 +444,7 @@ async function Bi({
444
444
  responseType: "json",
445
445
  transformResponse: [
446
446
  ...Array.isArray(T.defaults.transformResponse) ? T.defaults.transformResponse : [],
447
- (n) => !n || typeof n != "object" ? [] : n.proxies?.map((l) => ({
447
+ (o) => !o || typeof o != "object" ? [] : o.proxies?.map((l) => ({
448
448
  cdnName: l.cdnName,
449
449
  extension: l.extension,
450
450
  formatHeight: l.formatHeight,
@@ -462,7 +462,7 @@ async function Bi({
462
462
  return [];
463
463
  }
464
464
  }
465
- async function qi({
465
+ async function ji({
466
466
  siteUrl: t
467
467
  } = {}) {
468
468
  try {
@@ -489,7 +489,7 @@ async function qi({
489
489
  return { formatsByDocType: {} };
490
490
  }
491
491
  }
492
- async function ji({
492
+ async function Vi({
493
493
  recordIds: t,
494
494
  rightsToCheck: e
495
495
  }) {
@@ -512,11 +512,11 @@ async function ji({
512
512
  return i;
513
513
  }
514
514
  }
515
- const wt = 20, Re = [
516
- zt.Album,
517
- zt.ProjectDocument,
518
- zt.Story
519
- ], Rt = "TR1", $t = "TRX", $e = /* @__PURE__ */ new Set([".gif"]), Pe = /* @__PURE__ */ new Set([
515
+ const kt = 20, $e = [
516
+ wt.Album,
517
+ wt.ProjectDocument,
518
+ wt.Story
519
+ ], it = "TR1", At = "TRX", Pe = /* @__PURE__ */ new Set([".gif"]), Fe = /* @__PURE__ */ new Set([
520
520
  ".avif",
521
521
  ".bmp",
522
522
  ".gif",
@@ -529,30 +529,43 @@ const wt = 20, Re = [
529
529
  ]);
530
530
  function Zt(t) {
531
531
  const e = t.toLowerCase(), i = e.startsWith(".") ? e : `.${e}`;
532
- return Pe.has(i);
532
+ return Fe.has(i);
533
533
  }
534
534
  function Nt({
535
- extension: t,
536
- format: e,
537
- item: i,
538
- manualFormat: s,
539
- size: a
535
+ autoFormat: t,
536
+ extension: e,
537
+ format: i,
538
+ item: s,
539
+ manualFormat: a,
540
+ size: n
540
541
  }) {
541
- const r = t?.toLowerCase() ?? "", n = r.startsWith(".") ? r : `.${r}`, l = `path_${Rt}`, p = (y) => i[y] ? { maxWidth: i[`${y}${_t}`], src: i[y] } : void 0;
542
- if (!s)
543
- return p(`path_${Bt(r, a)}`) ?? p(l) ?? {};
544
- if (!!r && $e.has(n))
545
- return p(`path_${$t}`) ?? p(l) ?? {};
546
- const c = !r || Zt(r), f = e ? `path_${e}` : void 0;
547
- return f && c && i[f] ? p(f) ?? {} : p(l) ?? {};
542
+ const o = e?.toLowerCase() ?? "", l = o.startsWith(".") ? o : `.${o}`, d = `path_${it}`, m = (p, g) => {
543
+ const w = s[p];
544
+ if (w)
545
+ return {
546
+ maxWidth: s[`${p}${_t}`],
547
+ src: t ? se(w, {
548
+ extension: o,
549
+ format: g
550
+ }) : w
551
+ };
552
+ };
553
+ if (!a) {
554
+ const p = Bt(o, n), g = `path_${p}`;
555
+ return m(g, p) ?? m(d, it) ?? {};
556
+ }
557
+ if (!!o && Pe.has(l))
558
+ return m(`path_${At}`, At) ?? m(d, it) ?? {};
559
+ const y = !o || Zt(o), S = i ? `path_${i}` : void 0;
560
+ return S && y && s[S] ? m(S, i) ?? {} : m(d, it) ?? {};
548
561
  }
549
- class Vi {
562
+ class Gi {
550
563
  constructor(e, i) {
551
- 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);
564
+ this.data = [], this.folderId = "", this.fetchedPages = /* @__PURE__ */ new Set(), this.totalCount = 0, this.maxEnd = 1 / 0, this.pageSize = kt, this.requestEpoch = 0, this.host = e, this.host.addController?.(this);
552
565
  const s = i?.maxEnd;
553
566
  this.maxEnd = typeof s == "number" && Number.isFinite(s) && s >= 0 ? Math.floor(s) : 1 / 0;
554
567
  const a = i?.pageSize;
555
- 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;
568
+ this.pageSize = typeof a == "number" && Number.isFinite(a) && a >= 1 ? Math.floor(a) : kt, this.authToken = i?.token, this.securityByPassToken = i?.securityByPassToken, this.isSiteBuilder = i?.isSiteBuilder ?? !1, this.autoFormat = i?.autoFormat ?? !1;
556
569
  }
557
570
  get totalDataCount() {
558
571
  return this.totalCount;
@@ -570,7 +583,7 @@ class Vi {
570
583
  * Shrinking is ignored once pages are cached: collapsing already has what it needs.
571
584
  */
572
585
  setPageSize(e) {
573
- const i = Number.isFinite(e) && e >= 1 ? Math.floor(e) : wt;
586
+ const i = Number.isFinite(e) && e >= 1 ? Math.floor(e) : kt;
574
587
  if (this.pageSize === i)
575
588
  return;
576
589
  const s = this.fetchedPages.size > 0;
@@ -581,34 +594,34 @@ class Vi {
581
594
  extraFields: i = [],
582
595
  format: s,
583
596
  manualFormat: a = !0,
584
- start: r,
585
- transformations: n
597
+ start: n,
598
+ transformations: o
586
599
  }) {
587
- if (e < r)
600
+ if (e < n)
588
601
  return this.data;
589
- if (this.totalCount > 0 && e >= this.totalCount && (e = this.totalCount - 1, e < r))
602
+ if (this.totalCount > 0 && e >= this.totalCount && (e = this.totalCount - 1, e < n))
590
603
  return this.data;
591
604
  const l = this.requestEpoch;
592
605
  if (!this.folderId || l !== this.requestEpoch)
593
606
  return this.data;
594
- const p = s ? `path_${s}` : void 0, x = `path_${Rt}`, c = `path_${$t}`, f = [
607
+ const d = s ? `path_${s}` : void 0, m = `path_${it}`, c = `path_${At}`, y = [
595
608
  ...new Set(
596
- [p, x, c].filter(
597
- (S) => !!S
609
+ [d, m, c].filter(
610
+ (g) => !!g
598
611
  )
599
612
  )
600
- ], y = Math.floor(r / this.pageSize) + 1, d = Math.floor(e / this.pageSize) + 1;
601
- for (let S = y; S <= d; S++) {
602
- if (this.fetchedPages.has(S))
613
+ ], S = Math.floor(n / this.pageSize) + 1, p = Math.floor(e / this.pageSize) + 1;
614
+ for (let g = S; g <= p; g++) {
615
+ if (this.fetchedPages.has(g))
603
616
  continue;
604
- const R = await be({
617
+ const w = await ke({
605
618
  countPerPage: this.pageSize,
606
619
  directParentFolderIdentifier: this.folderId,
607
- excludedDocTypes: Re,
608
- extraFields: [...i, ...f],
620
+ excludedDocTypes: $e,
621
+ extraFields: [...i, ...y],
609
622
  getPermanentAssetsPaths: !0,
610
623
  isSiteBuilder: this.isSiteBuilder,
611
- pageNumber: S,
624
+ pageNumber: g,
612
625
  searchTerm: "",
613
626
  securityByPassToken: this.securityByPassToken,
614
627
  sortOrder: "",
@@ -616,37 +629,38 @@ class Vi {
616
629
  });
617
630
  if (l !== this.requestEpoch)
618
631
  return this.data;
619
- if (this.fetchedPages.add(S), !this.totalCount && R.totalCount) {
620
- const F = Math.min(this.maxEnd, R.totalCount);
632
+ if (this.fetchedPages.add(g), !this.totalCount && w.totalCount) {
633
+ const F = Math.min(this.maxEnd, w.totalCount);
621
634
  this.totalCount = F, this.data = Array.from({ length: F }, () => ({
622
635
  alt: "",
623
- id: `temp-${ae()}`,
636
+ id: `temp-${oe()}`,
624
637
  name: "",
625
638
  src: ""
626
639
  }));
627
640
  }
628
- const A = (S - 1) * this.pageSize;
629
- for (let F = 0; F < R.items.length; F++) {
630
- const w = A + F;
631
- if (w < this.data.length) {
632
- const _ = R.items[F], { maxWidth: at, src: ht } = Nt({
641
+ const A = (g - 1) * this.pageSize;
642
+ for (let F = 0; F < w.items.length; F++) {
643
+ const b = A + F;
644
+ if (b < this.data.length) {
645
+ const _ = w.items[F], { maxWidth: ot, src: lt } = Nt({
646
+ autoFormat: this.autoFormat,
633
647
  extension: _.extension,
634
648
  format: s,
635
649
  item: _,
636
650
  manualFormat: a,
637
651
  size: _.size
638
652
  });
639
- let L = ht;
640
- L && n && n.length > 0 && (L = It(L, n)), this.data[w] = {
653
+ let L = lt;
654
+ L && o && o.length > 0 && (L = It(L, o)), this.data[b] = {
641
655
  alt: _.name,
642
656
  docType: _.docType,
643
657
  extension: _.extension,
644
658
  id: _.id,
645
- maxWidth: at,
659
+ maxWidth: ot,
646
660
  name: _.name,
647
661
  src: L,
648
662
  ...i.reduce(
649
- (Z, ot) => (Z[ot] = _[ot] ?? "", Z),
663
+ (Z, rt) => (Z[rt] = _[rt] ?? "", Z),
650
664
  {}
651
665
  )
652
666
  };
@@ -659,85 +673,86 @@ class Vi {
659
673
  extraFields: i = [],
660
674
  folderId: s,
661
675
  forceRefetch: a = !1,
662
- format: r,
663
- manualFormat: n = !0,
676
+ format: n,
677
+ manualFormat: o = !0,
664
678
  minLimit: l = 5,
665
- noPlaceholders: p = !1,
666
- transformations: x
679
+ noPlaceholders: d = !1,
680
+ transformations: m
667
681
  }) {
668
682
  (!this.folderId || this.folderId !== s) && (this.folderId = s, this.resetFolderState()), a && this.resetPageCache();
669
- const c = Math.max(5, l), f = e, y = e + c, d = [
683
+ const c = Math.max(5, l), y = e, S = e + c, p = [
670
684
  ...i,
671
- mt,
672
- ft
685
+ ft,
686
+ gt
673
687
  ];
674
688
  await this.fetchImages({
675
- end: y,
676
- extraFields: d.filter((A) => A !== ""),
677
- format: r,
678
- manualFormat: n,
679
- start: f,
680
- transformations: x
689
+ end: S,
690
+ extraFields: p.filter((A) => A !== ""),
691
+ format: n,
692
+ manualFormat: o,
693
+ start: y,
694
+ transformations: m
681
695
  });
682
- let S = e - c;
683
- S < 0 && (this.totalCount === 0 ? S = 0 : S = Math.max(0, this.totalCount + S));
684
- const R = S + c;
696
+ let g = e - c;
697
+ g < 0 && (this.totalCount === 0 ? g = 0 : g = Math.max(0, this.totalCount + g));
698
+ const w = g + c;
685
699
  return await this.fetchImages({
686
- end: R,
687
- extraFields: d.filter((A) => A !== ""),
688
- format: r,
689
- manualFormat: n,
690
- start: S,
691
- transformations: x
692
- }), p ? this.data.filter((A) => A.id && !A.id.startsWith("temp-")) : this.data;
700
+ end: w,
701
+ extraFields: p.filter((A) => A !== ""),
702
+ format: n,
703
+ manualFormat: o,
704
+ start: g,
705
+ transformations: m
706
+ }), d ? this.data.filter((A) => A.id && !A.id.startsWith("temp-")) : this.data;
693
707
  }
694
708
  async fetchImagesByIDs({
695
709
  extraFields: e = [],
696
710
  format: i,
697
711
  manualFormat: s = !0,
698
712
  recordIds: a,
699
- transformations: r
713
+ transformations: n
700
714
  }) {
701
715
  if (a.length === 0)
702
716
  return [];
703
- const n = i ? `path_${i}` : void 0, l = `path_${Rt}`, p = `path_${$t}`, x = [
717
+ const o = i ? `path_${i}` : void 0, l = `path_${it}`, d = `path_${At}`, m = [
704
718
  ...new Set(
705
- [n, l, p].filter(
706
- (d) => !!d
719
+ [o, l, d].filter(
720
+ (p) => !!p
707
721
  )
708
722
  )
709
- ], c = [nt, ut], f = [
723
+ ], c = [ht, mt], y = [
710
724
  ...e,
711
- dt,
712
- mt,
713
- ft
725
+ ut,
726
+ ft,
727
+ gt
714
728
  ];
715
- return (await we({
716
- extraFields: [...f, ...x, ...c].filter((d) => d !== ""),
729
+ return (await be({
730
+ extraFields: [...y, ...m, ...c].filter((p) => p !== ""),
717
731
  getPermanentAssetsPaths: !0,
718
732
  isSiteBuilder: this.isSiteBuilder,
719
733
  recordIds: a,
720
734
  securityByPassToken: this.securityByPassToken,
721
735
  token: this.authToken
722
- })).items.map((d) => {
723
- const { maxWidth: S, src: R } = Nt({
724
- extension: d[nt],
736
+ })).items.map((p) => {
737
+ const { maxWidth: g, src: w } = Nt({
738
+ autoFormat: this.autoFormat,
739
+ extension: p[ht],
725
740
  format: i,
726
- item: d,
741
+ item: p,
727
742
  manualFormat: s,
728
- size: d[ut]
743
+ size: p[mt]
729
744
  });
730
- let A = R;
731
- return A && r && r.length > 0 && (A = It(A, r)), {
732
- alt: d.name,
733
- docType: d[dt],
734
- extension: d[nt] || "",
735
- id: d.recordId,
736
- maxWidth: S,
737
- name: d.name,
745
+ let A = w;
746
+ return A && n && n.length > 0 && (A = It(A, n)), {
747
+ alt: p.name,
748
+ docType: p[ut],
749
+ extension: p[ht] || "",
750
+ id: p.recordId,
751
+ maxWidth: g,
752
+ name: p.name,
738
753
  src: A,
739
- ...f.reduce(
740
- (F, w) => (F[w] = d[w] ?? "", F),
754
+ ...y.reduce(
755
+ (F, b) => (F[b] = p[b] ?? "", F),
741
756
  {}
742
757
  )
743
758
  };
@@ -748,63 +763,63 @@ class Vi {
748
763
  folderId: i,
749
764
  forceRefetch: s = !1,
750
765
  format: a,
751
- manualFormat: r = !0,
752
- noPlaceholders: n = !1,
766
+ manualFormat: n = !0,
767
+ noPlaceholders: o = !1,
753
768
  page: l,
754
- pageSize: p = 10,
755
- transformations: x
769
+ pageSize: d = 10,
770
+ transformations: m
756
771
  }) {
757
772
  (!this.folderId || this.folderId !== i) && (this.folderId = i, this.resetFolderState()), s && this.resetPageCache();
758
- const c = l * p, f = c + p - 1;
773
+ const c = l * d, y = c + d - 1;
759
774
  return await this.fetchImages({
760
- end: f,
775
+ end: y,
761
776
  extraFields: e,
762
777
  format: a,
763
- manualFormat: r,
778
+ manualFormat: n,
764
779
  start: c,
765
- transformations: x
766
- }), n ? this.data.filter((y) => y.id && !y.id.startsWith("temp-")) : this.data;
780
+ transformations: m
781
+ }), o ? this.data.filter((S) => S.id && !S.id.startsWith("temp-")) : this.data;
767
782
  }
768
783
  async *fetchImagesInFolderByChunk({
769
784
  chunkSize: e = 10,
770
785
  end: i = 0,
771
786
  extraFields: s = [],
772
787
  folderId: a,
773
- forceRefetch: r = !1,
774
- format: n,
788
+ forceRefetch: n = !1,
789
+ format: o,
775
790
  manualFormat: l = !0,
776
- start: p = 0,
777
- transformations: x
791
+ start: d = 0,
792
+ transformations: m
778
793
  }) {
779
794
  const c = Math.max(1, e);
780
- if ((!this.folderId || this.folderId !== a) && (this.folderId = a, this.resetFolderState()), r && this.resetPageCache(), i !== -1) {
795
+ if ((!this.folderId || this.folderId !== a) && (this.folderId = a, this.resetFolderState()), n && this.resetPageCache(), i !== -1) {
781
796
  await this.fetchImages({
782
797
  end: i,
783
798
  extraFields: s,
784
- format: n,
799
+ format: o,
785
800
  manualFormat: l,
786
- start: p,
787
- transformations: x
801
+ start: d,
802
+ transformations: m
788
803
  }), yield this.data;
789
804
  return;
790
805
  }
791
- let f = p, y = p + c;
806
+ let y = d, S = d + c;
792
807
  if (await this.fetchImages({
793
- end: y,
808
+ end: S,
794
809
  extraFields: s,
795
- format: n,
810
+ format: o,
796
811
  manualFormat: l,
797
- start: f,
798
- transformations: x
799
- }), yield this.data, !(!this.totalCount || this.totalCount <= y))
800
- for (; y < this.totalCount; )
801
- f = y, y = Math.min(y + c, this.totalCount), await this.fetchImages({
802
- end: y,
812
+ start: y,
813
+ transformations: m
814
+ }), yield this.data, !(!this.totalCount || this.totalCount <= S))
815
+ for (; S < this.totalCount; )
816
+ y = S, S = Math.min(S + c, this.totalCount), await this.fetchImages({
817
+ end: S,
803
818
  extraFields: s,
804
- format: n,
819
+ format: o,
805
820
  manualFormat: l,
806
- start: f,
807
- transformations: x
821
+ start: y,
822
+ transformations: m
808
823
  }), yield this.data;
809
824
  }
810
825
  hostConnected() {
@@ -819,29 +834,29 @@ class Vi {
819
834
  this.resetPageCache();
820
835
  }
821
836
  }
822
- const Fe = V`.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}`, _e = V`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}`;
823
- var Me = Object.defineProperty, Ie = Object.getOwnPropertyDescriptor, z = (t, e, i, s) => {
824
- for (var a = s > 1 ? void 0 : s ? Ie(e, i) : e, r = t.length - 1, n; r >= 0; r--)
825
- (n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
826
- return s && a && Me(e, i, a), a;
837
+ const _e = V`.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}`, Me = V`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}`;
838
+ var Ie = Object.defineProperty, Ee = Object.getOwnPropertyDescriptor, z = (t, e, i, s) => {
839
+ for (var a = s > 1 ? void 0 : s ? Ee(e, i) : e, n = t.length - 1, o; n >= 0; n--)
840
+ (o = t[n]) && (a = (s ? o(e, i, a) : o(a)) || a);
841
+ return s && a && Ie(e, i, a), a;
827
842
  };
828
843
  let v = class extends j {
829
844
  constructor() {
830
- super(...arguments), this.localize = new G(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 = {
831
- [o.Pixel]: {
845
+ super(...arguments), this.localize = new G(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 = r.Pixel, this.disabledApply = !1, this.noRatioModes = !1, this.showPositionPicker = !1, this.lastAppliedSetting = {
846
+ [r.Pixel]: {
832
847
  height: 0,
833
848
  percentageHeight: 100,
834
849
  percentageWidth: 100,
835
- unit: o.Pixel,
850
+ unit: r.Pixel,
836
851
  width: 0,
837
852
  x: 0,
838
853
  y: 0
839
854
  },
840
- [o.AspectRatio]: {
855
+ [r.AspectRatio]: {
841
856
  height: 1,
842
857
  percentageHeight: 100,
843
858
  percentageWidth: 100,
844
- unit: o.AspectRatio,
859
+ unit: r.AspectRatio,
845
860
  width: 1,
846
861
  x: 0,
847
862
  y: 0
@@ -858,10 +873,10 @@ let v = class extends j {
858
873
  return;
859
874
  }
860
875
  if (this.keepAspectRatio) {
861
- if (this.unit === o.Pixel && this.width && this.height) {
876
+ if (this.unit === r.Pixel && this.width && this.height) {
862
877
  this.aspectRatio = this.width / this.height;
863
878
  return;
864
- } else if (this.unit === o.AspectRatio && this.ratioWidth && this.ratioHeight) {
879
+ } else if (this.unit === r.AspectRatio && this.ratioWidth && this.ratioHeight) {
865
880
  this.aspectRatio = this.ratioWidth / this.ratioHeight;
866
881
  return;
867
882
  }
@@ -892,9 +907,9 @@ let v = class extends j {
892
907
  }
893
908
  this.invalidWidth = !1;
894
909
  let e = Number(t.target.value);
895
- this.unit === o.Pixel && (e = Math.max(Math.min(e, this.maxWidth), 1)), t.target.value = e.toString();
896
- let i = this.unit === o.Pixel ? this.height : this.ratioHeight, s = !1;
897
- this.keepAspectRatio && (i = Math.round(e / this.aspectRatio), this.unit === o.Pixel && i > this.maxHeight && (i = this.maxHeight, s = !0)), this.invalidHeight = !1, this.emit("cx-asset-link-format-crop-change", {
910
+ this.unit === r.Pixel && (e = Math.max(Math.min(e, this.maxWidth), 1)), t.target.value = e.toString();
911
+ let i = this.unit === r.Pixel ? this.height : this.ratioHeight, s = !1;
912
+ this.keepAspectRatio && (i = Math.round(e / this.aspectRatio), this.unit === r.Pixel && i > this.maxHeight && (i = this.maxHeight, s = !0)), this.invalidHeight = !1, this.emit("cx-asset-link-format-crop-change", {
898
913
  detail: {
899
914
  breakAspectRatio: s,
900
915
  height: i,
@@ -911,9 +926,9 @@ let v = class extends j {
911
926
  }
912
927
  this.invalidHeight = !1;
913
928
  let e = Number(t.target.value);
914
- this.unit === o.Pixel && (e = Math.max(Math.min(e, this.maxHeight), 1)), t.target.value = e.toString();
915
- let i = this.unit === o.Pixel ? this.width : this.ratioWidth, s = !1;
916
- this.keepAspectRatio && (i = Math.round(e * this.aspectRatio), this.unit === o.Pixel && i > this.maxWidth && (i = this.maxWidth, s = !0)), this.invalidWidth = !1, this.emit("cx-asset-link-format-crop-change", {
929
+ this.unit === r.Pixel && (e = Math.max(Math.min(e, this.maxHeight), 1)), t.target.value = e.toString();
930
+ let i = this.unit === r.Pixel ? this.width : this.ratioWidth, s = !1;
931
+ this.keepAspectRatio && (i = Math.round(e * this.aspectRatio), this.unit === r.Pixel && i > this.maxWidth && (i = this.maxWidth, s = !0)), this.invalidWidth = !1, this.emit("cx-asset-link-format-crop-change", {
917
932
  detail: {
918
933
  breakAspectRatio: s,
919
934
  height: e,
@@ -928,29 +943,29 @@ let v = class extends j {
928
943
  if (e === "free")
929
944
  this.selectedMode?.auto && this.emit("cx-asset-link-format-crop-change", {
930
945
  detail: {
931
- height: this.lastAppliedSetting[o.Pixel].height,
946
+ height: this.lastAppliedSetting[r.Pixel].height,
932
947
  keepAspectRatio: !1,
933
948
  silent: !0,
934
- unit: o.Pixel,
935
- width: this.lastAppliedSetting[o.Pixel].width
949
+ unit: r.Pixel,
950
+ width: this.lastAppliedSetting[r.Pixel].width
936
951
  }
937
952
  });
938
953
  else if (!i) {
939
954
  const [s, a] = e.split(":").map(Number);
940
- if (this.unit === o.Pixel) {
941
- let r = s, n = a;
942
- Number.isFinite(this.maxWidth) && Number.isFinite(this.maxHeight) && ({ height: n, width: r } = re(
955
+ if (this.unit === r.Pixel) {
956
+ let n = s, o = a;
957
+ Number.isFinite(this.maxWidth) && Number.isFinite(this.maxHeight) && ({ height: o, width: n } = ne(
943
958
  this.maxWidth,
944
959
  this.maxHeight,
945
960
  s,
946
961
  a
947
962
  )), this.emit("cx-asset-link-format-crop-change", {
948
963
  detail: {
949
- height: n,
964
+ height: o,
950
965
  keepAspectRatio: !0,
951
966
  silent: !0,
952
- unit: o.Pixel,
953
- width: r
967
+ unit: r.Pixel,
968
+ width: n
954
969
  }
955
970
  });
956
971
  } else
@@ -959,7 +974,7 @@ let v = class extends j {
959
974
  height: a,
960
975
  keepAspectRatio: !0,
961
976
  silent: !0,
962
- unit: o.AspectRatio,
977
+ unit: r.AspectRatio,
963
978
  width: s
964
979
  }
965
980
  });
@@ -992,19 +1007,19 @@ let v = class extends j {
992
1007
  * This allows the parent component to update the crop settings accordingly.
993
1008
  */
994
1009
  onUnitChange(t) {
995
- t.target.value === o.AspectRatio ? this.emit("cx-asset-link-format-crop-change", {
1010
+ t.target.value === r.AspectRatio ? this.emit("cx-asset-link-format-crop-change", {
996
1011
  detail: {
997
- height: this.lastAppliedSetting[o.AspectRatio].height,
1012
+ height: this.lastAppliedSetting[r.AspectRatio].height,
998
1013
  keepAspectRatio: this.keepAspectRatio,
999
- unit: o.AspectRatio,
1000
- width: this.lastAppliedSetting[o.AspectRatio].width
1014
+ unit: r.AspectRatio,
1015
+ width: this.lastAppliedSetting[r.AspectRatio].width
1001
1016
  }
1002
1017
  }) : this.emit("cx-asset-link-format-crop-change", {
1003
1018
  detail: {
1004
- height: this.lastAppliedSetting[o.Pixel].height,
1019
+ height: this.lastAppliedSetting[r.Pixel].height,
1005
1020
  keepAspectRatio: this.keepAspectRatio,
1006
- unit: o.Pixel,
1007
- width: this.lastAppliedSetting[o.Pixel].width
1021
+ unit: r.Pixel,
1022
+ width: this.lastAppliedSetting[r.Pixel].width
1008
1023
  }
1009
1024
  }), this.emit("cx-asset-link-format-crop-mode-change", {
1010
1025
  detail: {
@@ -1048,10 +1063,10 @@ let v = class extends j {
1048
1063
  }
1049
1064
  }), this.emit("cx-asset-link-format-crop-change", {
1050
1065
  detail: {
1051
- height: this.unit === o.Pixel ? this.height : this.ratioHeight,
1066
+ height: this.unit === r.Pixel ? this.height : this.ratioHeight,
1052
1067
  keepAspectRatio: !this.keepAspectRatio,
1053
1068
  unit: this.unit,
1054
- width: this.unit === o.Pixel ? this.width : this.ratioWidth
1069
+ width: this.unit === r.Pixel ? this.width : this.ratioWidth
1055
1070
  }
1056
1071
  });
1057
1072
  }
@@ -1061,7 +1076,7 @@ let v = class extends j {
1061
1076
  !this.noRatioModes,
1062
1077
  () => C`<cx-select data-testid="cx-asset-link-format-crop-mode" value=${this.cropMode} hoist style=${O({
1063
1078
  width: "100%"
1064
- })} @cx-change=${this.onCropModeChange} ?disabled=${this.loading}>${rt(
1079
+ })} @cx-change=${this.onCropModeChange} ?disabled=${this.loading}>${nt(
1065
1080
  t,
1066
1081
  (i) => i.value,
1067
1082
  ({ label: i, value: s }) => C`<cx-option value=${s}>${i}</cx-option>`
@@ -1070,25 +1085,25 @@ let v = class extends j {
1070
1085
  e.length > 0,
1071
1086
  () => C`<cx-divider></cx-divider><small>${this.localize.term("autoCropping")}</small>`
1072
1087
  )}
1073
- ${rt(
1088
+ ${nt(
1074
1089
  e,
1075
1090
  (i) => i.value,
1076
1091
  ({ label: i, value: s }) => C`<cx-option value=${s}>${i}</cx-option>`
1077
1092
  )}</cx-select>`
1078
- )}<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">
1093
+ )}<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 === r.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">
1079
1094
  W
1080
1095
  </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=${O({
1081
1096
  color: this.keepAspectRatio ? "var(--cx-color-primary)" : void 0
1082
- })} ?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">
1097
+ })} ?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 === r.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">
1083
1098
  H
1084
1099
  </cx-typography></cx-input></div>${I(
1085
1100
  !this.noRatioModes,
1086
- () => C`<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>`
1101
+ () => C`<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=${r.Pixel}>${this.localize.term("pixels")}</cx-option><cx-option value=${r.AspectRatio}>${this.localize.term("aspectRatio")}</cx-option></cx-select>`
1087
1102
  )}</cx-space>${I(
1088
1103
  this.focusModes.length > 0,
1089
1104
  () => C`<cx-select data-testid="cx-asset-link-format-crop-focus-mode" value=${this.focusMode} hoist style=${O({
1090
1105
  width: "100%"
1091
- })} @cx-change=${this.onFocusModeChange} ?disabled=${this.loading || this.selectedMode?.disabledSize}>${rt(
1106
+ })} @cx-change=${this.onFocusModeChange} ?disabled=${this.loading || this.selectedMode?.disabledSize}>${nt(
1092
1107
  this.focusModes,
1093
1108
  (i) => i.value,
1094
1109
  ({ label: i, value: s }) => C`<cx-option value=${s}>${i}</cx-option>`
@@ -1102,17 +1117,17 @@ let v = class extends j {
1102
1117
  })} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
1103
1118
  }
1104
1119
  };
1105
- v.styles = [Q, _e];
1120
+ v.styles = [Q, Me];
1106
1121
  v.dependencies = {
1107
1122
  "cx-button": J,
1108
- "cx-details": it,
1123
+ "cx-details": st,
1109
1124
  "cx-divider": qt,
1110
- "cx-icon": st,
1125
+ "cx-icon": at,
1111
1126
  "cx-icon-button": Pt,
1112
1127
  "cx-input": Ft,
1113
- "cx-option": St,
1114
- "cx-position-picker": oe,
1115
- "cx-select": At,
1128
+ "cx-option": vt,
1129
+ "cx-position-picker": re,
1130
+ "cx-select": zt,
1116
1131
  "cx-space": B,
1117
1132
  "cx-typography": q
1118
1133
  };
@@ -1186,13 +1201,13 @@ z([
1186
1201
  h({ attribute: "keep-aspect-ratio", reflect: !0, type: Boolean })
1187
1202
  ], v.prototype, "keepAspectRatio", 2);
1188
1203
  z([
1189
- k()
1204
+ R()
1190
1205
  ], v.prototype, "invalidWidth", 2);
1191
1206
  z([
1192
- k()
1207
+ R()
1193
1208
  ], v.prototype, "invalidHeight", 2);
1194
1209
  z([
1195
- k()
1210
+ R()
1196
1211
  ], v.prototype, "aspectRatio", 2);
1197
1212
  z([
1198
1213
  P("cropMode", { waitUntilFirstUpdate: !0 }),
@@ -1206,11 +1221,11 @@ z([
1206
1221
  v = z([
1207
1222
  X("cx-asset-link-format-crop")
1208
1223
  ], v);
1209
- const Ee = V`.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%}}`;
1210
- var Te = Object.defineProperty, He = Object.getOwnPropertyDescriptor, Mt = (t, e, i, s) => {
1211
- for (var a = s > 1 ? void 0 : s ? He(e, i) : e, r = t.length - 1, n; r >= 0; r--)
1212
- (n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
1213
- return s && a && Te(e, i, a), a;
1224
+ const Te = V`.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%}}`;
1225
+ var He = Object.defineProperty, We = Object.getOwnPropertyDescriptor, Mt = (t, e, i, s) => {
1226
+ for (var a = s > 1 ? void 0 : s ? We(e, i) : e, n = t.length - 1, o; n >= 0; n--)
1227
+ (o = t[n]) && (a = (s ? o(e, i, a) : o(a)) || a);
1228
+ return s && a && He(e, i, a), a;
1214
1229
  };
1215
1230
  let Y = class extends j {
1216
1231
  constructor() {
@@ -1223,17 +1238,17 @@ let Y = class extends j {
1223
1238
  });
1224
1239
  }
1225
1240
  render() {
1226
- return C`<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}>${rt(
1241
+ return C`<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}>${nt(
1227
1242
  this.items,
1228
1243
  (t) => t.value,
1229
1244
  (t) => C`<cx-option value=${t.value}>${t.displayName}</cx-option>`
1230
1245
  )}</cx-select></cx-space>`;
1231
1246
  }
1232
1247
  };
1233
- Y.styles = [Q, Ee];
1248
+ Y.styles = [Q, Te];
1234
1249
  Y.dependencies = {
1235
- "cx-option": St,
1236
- "cx-select": At,
1250
+ "cx-option": vt,
1251
+ "cx-select": zt,
1237
1252
  "cx-space": B,
1238
1253
  "cx-typography": q
1239
1254
  };
@@ -1246,13 +1261,13 @@ Mt([
1246
1261
  Y = Mt([
1247
1262
  X("cx-asset-link-format-extension")
1248
1263
  ], Y);
1249
- const We = V`cx-details::part(base){border-bottom-width:0}`;
1250
- var De = Object.defineProperty, Ne = Object.getOwnPropertyDescriptor, D = (t, e, i, s) => {
1251
- for (var a = s > 1 ? void 0 : s ? Ne(e, i) : e, r = t.length - 1, n; r >= 0; r--)
1252
- (n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
1253
- return s && a && De(e, i, a), a;
1264
+ const De = V`cx-details::part(base){border-bottom-width:0}`;
1265
+ var Ne = Object.defineProperty, Oe = Object.getOwnPropertyDescriptor, D = (t, e, i, s) => {
1266
+ for (var a = s > 1 ? void 0 : s ? Oe(e, i) : e, n = t.length - 1, o; n >= 0; n--)
1267
+ (o = t[n]) && (a = (s ? o(e, i, a) : o(a)) || a);
1268
+ return s && a && Ne(e, i, a), a;
1254
1269
  };
1255
- const bt = "auto";
1270
+ const Rt = "auto";
1256
1271
  let E = class extends j {
1257
1272
  constructor() {
1258
1273
  super(...arguments), this.localize = new G(this), this.open = !1, this.value = "", this.items = [], this.canAutoFormat = !1, this.autoFormat = !1, this.loading = !1, this.scopedValue = "";
@@ -1262,7 +1277,7 @@ let E = class extends j {
1262
1277
  * active, otherwise the resolved proxy id.
1263
1278
  */
1264
1279
  get committedValue() {
1265
- return this.autoFormat ? bt : this.value;
1280
+ return this.autoFormat ? Rt : this.value;
1266
1281
  }
1267
1282
  handleValueChange() {
1268
1283
  this.scopedValue = this.committedValue;
@@ -1282,7 +1297,7 @@ let E = class extends j {
1282
1297
  handleApply() {
1283
1298
  if (this.loading)
1284
1299
  return;
1285
- if (this.scopedValue === bt) {
1300
+ if (this.scopedValue === Rt) {
1286
1301
  this.emit("cx-asset-link-format-proxy-change", {
1287
1302
  detail: { autoFormat: !0 }
1288
1303
  });
@@ -1312,28 +1327,28 @@ let E = class extends j {
1312
1327
  t.target !== this.base && t.stopPropagation();
1313
1328
  }
1314
1329
  render() {
1315
- return C`<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}>${rt(
1330
+ return C`<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}>${nt(
1316
1331
  this.items,
1317
1332
  (t) => t.id,
1318
1333
  (t) => C`<cx-option value=${t.id}>${t.proxyLabel}</cx-option>`
1319
1334
  )}
1320
1335
  ${I(
1321
1336
  this.canAutoFormat,
1322
- () => C`<cx-divider></cx-divider><cx-option data-testid="cx-asset-link-format-proxy-auto-option" value=${bt}>${this.localize.term("auto")}</cx-option>`,
1337
+ () => C`<cx-divider></cx-divider><cx-option data-testid="cx-asset-link-format-proxy-auto-option" value=${Rt}>${this.localize.term("auto")}</cx-option>`,
1323
1338
  () => Ut
1324
1339
  )}</cx-select><cx-button data-testid="cx-asset-link-format-proxy-apply" variant="primary" style=${O({
1325
1340
  "margin-left": "auto"
1326
1341
  })} ?disabled=${this.scopedValue === this.committedValue} ?loading=${this.loading} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
1327
1342
  }
1328
1343
  };
1329
- E.styles = [Q, We];
1344
+ E.styles = [Q, De];
1330
1345
  E.dependencies = {
1331
1346
  "cx-button": J,
1332
- "cx-details": it,
1347
+ "cx-details": st,
1333
1348
  "cx-divider": qt,
1334
- "cx-icon": st,
1335
- "cx-option": St,
1336
- "cx-select": At,
1349
+ "cx-icon": at,
1350
+ "cx-option": vt,
1351
+ "cx-select": zt,
1337
1352
  "cx-space": B,
1338
1353
  "cx-typography": q
1339
1354
  };
@@ -1359,7 +1374,7 @@ D([
1359
1374
  h({ reflect: !0, type: Boolean })
1360
1375
  ], E.prototype, "loading", 2);
1361
1376
  D([
1362
- k()
1377
+ R()
1363
1378
  ], E.prototype, "scopedValue", 2);
1364
1379
  D([
1365
1380
  P("autoFormat"),
@@ -1371,11 +1386,11 @@ D([
1371
1386
  E = D([
1372
1387
  X("cx-asset-link-format-proxy")
1373
1388
  ], E);
1374
- const Oe = V`cx-details::part(base){border-bottom-width:0}`;
1375
- var Le = Object.defineProperty, Ue = Object.getOwnPropertyDescriptor, et = (t, e, i, s) => {
1376
- for (var a = s > 1 ? void 0 : s ? Ue(e, i) : e, r = t.length - 1, n; r >= 0; r--)
1377
- (n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
1378
- return s && a && Le(e, i, a), a;
1389
+ const Le = V`cx-details::part(base){border-bottom-width:0}`;
1390
+ var Ue = Object.defineProperty, Be = Object.getOwnPropertyDescriptor, et = (t, e, i, s) => {
1391
+ for (var a = s > 1 ? void 0 : s ? Be(e, i) : e, n = t.length - 1, o; n >= 0; n--)
1392
+ (o = t[n]) && (a = (s ? o(e, i, a) : o(a)) || a);
1393
+ return s && a && Ue(e, i, a), a;
1379
1394
  };
1380
1395
  let W = class extends j {
1381
1396
  constructor() {
@@ -1428,11 +1443,11 @@ let W = class extends j {
1428
1443
  })} @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>`;
1429
1444
  }
1430
1445
  };
1431
- W.styles = [Q, Oe];
1446
+ W.styles = [Q, Le];
1432
1447
  W.dependencies = {
1433
1448
  "cx-button": J,
1434
- "cx-details": it,
1435
- "cx-icon": st,
1449
+ "cx-details": st,
1450
+ "cx-icon": at,
1436
1451
  "cx-input": Ft,
1437
1452
  "cx-space": B,
1438
1453
  "cx-tooltip": jt,
@@ -1451,7 +1466,7 @@ et([
1451
1466
  h({ reflect: !0, type: Boolean })
1452
1467
  ], W.prototype, "loading", 2);
1453
1468
  et([
1454
- k()
1469
+ R()
1455
1470
  ], W.prototype, "scopedValue", 2);
1456
1471
  et([
1457
1472
  P("value")
@@ -1459,17 +1474,17 @@ et([
1459
1474
  W = et([
1460
1475
  X("cx-asset-link-format-quality")
1461
1476
  ], W);
1462
- const Be = V`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}`;
1463
- var qe = Object.defineProperty, je = Object.getOwnPropertyDescriptor, $ = (t, e, i, s) => {
1464
- for (var a = s > 1 ? void 0 : s ? je(e, i) : e, r = t.length - 1, n; r >= 0; r--)
1465
- (n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
1466
- return s && a && qe(e, i, a), a;
1477
+ const qe = V`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}`;
1478
+ var je = Object.defineProperty, Ve = Object.getOwnPropertyDescriptor, $ = (t, e, i, s) => {
1479
+ for (var a = s > 1 ? void 0 : s ? Ve(e, i) : e, n = t.length - 1, o; n >= 0; n--)
1480
+ (o = t[n]) && (a = (s ? o(e, i, a) : o(a)) || a);
1481
+ return s && a && je(e, i, a), a;
1467
1482
  };
1468
- let b = class extends j {
1483
+ let k = class extends j {
1469
1484
  constructor() {
1470
- super(...arguments), this.localize = new G(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 = {
1471
- [o.Pixel]: { height: 0, width: 0 },
1472
- [o.AspectRatio]: { height: 1, width: 1 }
1485
+ super(...arguments), this.localize = new G(this), this.open = !1, this.width = 0, this.height = 0, this.maxWidth = 0, this.maxHeight = 0, this.ratioWidth = 1, this.ratioHeight = 1, this.unit = r.Pixel, this.lastAppliedSetting = {
1486
+ [r.Pixel]: { height: 0, width: 0 },
1487
+ [r.AspectRatio]: { height: 1, width: 1 }
1473
1488
  }, this.loading = !1, this.noRatioModes = !1, this.keepAspectRatio = !1, this.invalidWidth = !1, this.invalidHeight = !1, this.aspectRatio = 0;
1474
1489
  }
1475
1490
  /**
@@ -1483,11 +1498,11 @@ let b = class extends j {
1483
1498
  async handleCropModeChange() {
1484
1499
  const t = Number.isFinite(this.maxWidth) && Number.isFinite(this.maxHeight) && this.maxWidth > 0 && this.maxHeight > 0;
1485
1500
  if (this.keepAspectRatio) {
1486
- if (this.unit === o.AspectRatio && this.ratioWidth && this.ratioHeight) {
1501
+ if (this.unit === r.AspectRatio && this.ratioWidth && this.ratioHeight) {
1487
1502
  this.aspectRatio = this.ratioWidth / this.ratioHeight;
1488
1503
  return;
1489
1504
  }
1490
- if (this.unit === o.Pixel && !t && this.width && this.height) {
1505
+ if (this.unit === r.Pixel && !t && this.width && this.height) {
1491
1506
  this.aspectRatio = this.width / this.height;
1492
1507
  return;
1493
1508
  }
@@ -1518,8 +1533,8 @@ let b = class extends j {
1518
1533
  }
1519
1534
  this.invalidWidth = !1;
1520
1535
  let e = Number(t.target.value);
1521
- this.unit === o.Pixel && (e = Math.max(Math.min(e, this.maxWidth), 1)), t.target.value = e.toString();
1522
- let i = this.unit === o.Pixel ? this.height : this.ratioHeight;
1536
+ this.unit === r.Pixel && (e = Math.max(Math.min(e, this.maxWidth), 1)), t.target.value = e.toString();
1537
+ let i = this.unit === r.Pixel ? this.height : this.ratioHeight;
1523
1538
  this.keepAspectRatio && (i = Math.min(
1524
1539
  Math.round(e / this.aspectRatio),
1525
1540
  this.maxHeight
@@ -1539,8 +1554,8 @@ let b = class extends j {
1539
1554
  }
1540
1555
  this.invalidHeight = !1;
1541
1556
  let e = Number(t.target.value);
1542
- this.unit === o.Pixel && (e = Math.max(Math.min(e, this.maxHeight), 1)), t.target.value = e.toString();
1543
- let i = this.unit === o.Pixel ? this.width : this.ratioWidth;
1557
+ this.unit === r.Pixel && (e = Math.max(Math.min(e, this.maxHeight), 1)), t.target.value = e.toString();
1558
+ let i = this.unit === r.Pixel ? this.width : this.ratioWidth;
1544
1559
  this.keepAspectRatio && (i = Math.min(
1545
1560
  Math.round(e * this.aspectRatio),
1546
1561
  this.maxWidth
@@ -1554,19 +1569,19 @@ let b = class extends j {
1554
1569
  });
1555
1570
  }
1556
1571
  onUnitChange(t) {
1557
- t.target.value === o.AspectRatio ? this.emit("cx-asset-link-format-resize-change", {
1572
+ t.target.value === r.AspectRatio ? this.emit("cx-asset-link-format-resize-change", {
1558
1573
  detail: {
1559
- height: this.lastAppliedSetting[o.AspectRatio].height,
1574
+ height: this.lastAppliedSetting[r.AspectRatio].height,
1560
1575
  keepAspectRatio: this.keepAspectRatio,
1561
- unit: o.AspectRatio,
1562
- width: this.lastAppliedSetting[o.AspectRatio].width
1576
+ unit: r.AspectRatio,
1577
+ width: this.lastAppliedSetting[r.AspectRatio].width
1563
1578
  }
1564
1579
  }) : this.emit("cx-asset-link-format-resize-change", {
1565
1580
  detail: {
1566
- height: this.lastAppliedSetting[o.Pixel].height,
1581
+ height: this.lastAppliedSetting[r.Pixel].height,
1567
1582
  keepAspectRatio: this.keepAspectRatio,
1568
- unit: o.Pixel,
1569
- width: this.lastAppliedSetting[o.Pixel].width
1583
+ unit: r.Pixel,
1584
+ width: this.lastAppliedSetting[r.Pixel].width
1570
1585
  }
1571
1586
  });
1572
1587
  }
@@ -1598,105 +1613,105 @@ let b = class extends j {
1598
1613
  handleAspectRatioClick() {
1599
1614
  this.emit("cx-asset-link-format-resize-change", {
1600
1615
  detail: {
1601
- height: this.unit === o.Pixel ? this.height : this.ratioHeight,
1616
+ height: this.unit === r.Pixel ? this.height : this.ratioHeight,
1602
1617
  keepAspectRatio: !this.keepAspectRatio,
1603
1618
  unit: this.unit,
1604
- width: this.unit === o.Pixel ? this.width : this.ratioWidth
1619
+ width: this.unit === r.Pixel ? this.width : this.ratioWidth
1605
1620
  }
1606
1621
  });
1607
1622
  }
1608
1623
  render() {
1609
- return C`<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">
1624
+ return C`<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 === r.Pixel ? this.width.toString() : this.ratioWidth.toString()} @cx-input=${this.handleWidthChange} required ?disabled=${this.loading}><cx-typography slot="prefix" variant="body3" part="input-label">
1610
1625
  W
1611
1626
  </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=${O({
1612
1627
  color: this.keepAspectRatio ? "var(--cx-color-primary)" : void 0
1613
- })} ?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">
1628
+ })} ?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 === r.Pixel ? this.height.toString() : this.ratioHeight.toString()} @cx-input=${this.handleHeightChange} required ?disabled=${this.loading}><cx-typography slot="prefix" variant="body3" part="input-label">
1614
1629
  H
1615
1630
  </cx-typography></cx-input></div>${I(
1616
1631
  !this.noRatioModes,
1617
- () => C`<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>`
1632
+ () => C`<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=${r.Pixel}>${this.localize.term("pixels")}</cx-option><cx-option value=${r.AspectRatio}>${this.localize.term("aspectRatio")}</cx-option></cx-select>`
1618
1633
  )}</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=${O({
1619
1634
  marginLeft: "auto"
1620
1635
  })} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
1621
1636
  }
1622
1637
  };
1623
- b.styles = [Q, Be];
1624
- b.dependencies = {
1638
+ k.styles = [Q, qe];
1639
+ k.dependencies = {
1625
1640
  "cx-button": J,
1626
- "cx-details": it,
1627
- "cx-icon": st,
1641
+ "cx-details": st,
1642
+ "cx-icon": at,
1628
1643
  "cx-icon-button": Pt,
1629
1644
  "cx-input": Ft,
1630
- "cx-option": St,
1631
- "cx-select": At,
1645
+ "cx-option": vt,
1646
+ "cx-select": zt,
1632
1647
  "cx-space": B,
1633
1648
  "cx-typography": q
1634
1649
  };
1635
1650
  $([
1636
1651
  tt(".details")
1637
- ], b.prototype, "base", 2);
1652
+ ], k.prototype, "base", 2);
1638
1653
  $([
1639
1654
  h({ reflect: !0, type: Boolean })
1640
- ], b.prototype, "open", 2);
1655
+ ], k.prototype, "open", 2);
1641
1656
  $([
1642
1657
  h({ reflect: !0, type: Number })
1643
- ], b.prototype, "width", 2);
1658
+ ], k.prototype, "width", 2);
1644
1659
  $([
1645
1660
  h({ reflect: !0, type: Number })
1646
- ], b.prototype, "height", 2);
1661
+ ], k.prototype, "height", 2);
1647
1662
  $([
1648
1663
  h({ attribute: "max-width", reflect: !0, type: Number })
1649
- ], b.prototype, "maxWidth", 2);
1664
+ ], k.prototype, "maxWidth", 2);
1650
1665
  $([
1651
1666
  h({ attribute: "max-height", reflect: !0, type: Number })
1652
- ], b.prototype, "maxHeight", 2);
1667
+ ], k.prototype, "maxHeight", 2);
1653
1668
  $([
1654
1669
  h({ attribute: "ratio-width", reflect: !0, type: Number })
1655
- ], b.prototype, "ratioWidth", 2);
1670
+ ], k.prototype, "ratioWidth", 2);
1656
1671
  $([
1657
1672
  h({ attribute: "ratio-height", reflect: !0, type: Number })
1658
- ], b.prototype, "ratioHeight", 2);
1673
+ ], k.prototype, "ratioHeight", 2);
1659
1674
  $([
1660
1675
  h({ reflect: !0, type: String })
1661
- ], b.prototype, "unit", 2);
1676
+ ], k.prototype, "unit", 2);
1662
1677
  $([
1663
1678
  h({ attribute: "last-applied-setting", reflect: !1, type: Object })
1664
- ], b.prototype, "lastAppliedSetting", 2);
1679
+ ], k.prototype, "lastAppliedSetting", 2);
1665
1680
  $([
1666
1681
  h({ reflect: !0, type: Boolean })
1667
- ], b.prototype, "loading", 2);
1682
+ ], k.prototype, "loading", 2);
1668
1683
  $([
1669
1684
  h({ attribute: "no-ratio-modes", reflect: !0, type: Boolean })
1670
- ], b.prototype, "noRatioModes", 2);
1685
+ ], k.prototype, "noRatioModes", 2);
1671
1686
  $([
1672
1687
  h({ attribute: "keep-aspect-ratio", reflect: !0, type: Boolean })
1673
- ], b.prototype, "keepAspectRatio", 2);
1688
+ ], k.prototype, "keepAspectRatio", 2);
1674
1689
  $([
1675
- k()
1676
- ], b.prototype, "invalidWidth", 2);
1690
+ R()
1691
+ ], k.prototype, "invalidWidth", 2);
1677
1692
  $([
1678
- k()
1679
- ], b.prototype, "invalidHeight", 2);
1693
+ R()
1694
+ ], k.prototype, "invalidHeight", 2);
1680
1695
  $([
1681
- k()
1682
- ], b.prototype, "aspectRatio", 2);
1696
+ R()
1697
+ ], k.prototype, "aspectRatio", 2);
1683
1698
  $([
1684
1699
  P("cropMode", { waitUntilFirstUpdate: !0 }),
1685
1700
  P("maxWidth", { waitUntilFirstUpdate: !0 }),
1686
1701
  P("maxHeight", { waitUntilFirstUpdate: !0 }),
1687
1702
  P("keepAspectRatio")
1688
- ], b.prototype, "handleCropModeChange", 1);
1703
+ ], k.prototype, "handleCropModeChange", 1);
1689
1704
  $([
1690
1705
  P("open", { waitUntilFirstUpdate: !0 })
1691
- ], b.prototype, "handleOpenChange", 1);
1692
- b = $([
1706
+ ], k.prototype, "handleOpenChange", 1);
1707
+ k = $([
1693
1708
  X("cx-asset-link-format-resize")
1694
- ], b);
1695
- const Ve = V`cx-details::part(base){border-bottom-width:0}`;
1696
- var Ge = Object.defineProperty, Qe = Object.getOwnPropertyDescriptor, K = (t, e, i, s) => {
1697
- for (var a = s > 1 ? void 0 : s ? Qe(e, i) : e, r = t.length - 1, n; r >= 0; r--)
1698
- (n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
1699
- return s && a && Ge(e, i, a), a;
1709
+ ], k);
1710
+ const Ge = V`cx-details::part(base){border-bottom-width:0}`;
1711
+ var Qe = Object.defineProperty, Xe = Object.getOwnPropertyDescriptor, K = (t, e, i, s) => {
1712
+ for (var a = s > 1 ? void 0 : s ? Xe(e, i) : e, n = t.length - 1, o; n >= 0; n--)
1713
+ (o = t[n]) && (a = (s ? o(e, i, a) : o(a)) || a);
1714
+ return s && a && Qe(e, i, a), a;
1700
1715
  };
1701
1716
  let H = class extends j {
1702
1717
  constructor() {
@@ -1744,12 +1759,12 @@ let H = class extends j {
1744
1759
  })} @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>`;
1745
1760
  }
1746
1761
  };
1747
- H.styles = [Q, Ve];
1762
+ H.styles = [Q, Ge];
1748
1763
  H.dependencies = {
1749
1764
  "cx-button": J,
1750
- "cx-button-group": ne,
1751
- "cx-details": it,
1752
- "cx-icon": st,
1765
+ "cx-button-group": he,
1766
+ "cx-details": st,
1767
+ "cx-icon": at,
1753
1768
  "cx-icon-button": Pt,
1754
1769
  "cx-space": B,
1755
1770
  "cx-typography": q
@@ -1778,11 +1793,11 @@ K([
1778
1793
  H = K([
1779
1794
  X("cx-asset-link-format-rotation")
1780
1795
  ], H);
1781
- const Xe = V`cx-details::part(base){border-bottom-width:0}`;
1782
- var Ke = Object.defineProperty, Ze = Object.getOwnPropertyDescriptor, vt = (t, e, i, s) => {
1783
- for (var a = s > 1 ? void 0 : s ? Ze(e, i) : e, r = t.length - 1, n; r >= 0; r--)
1784
- (n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
1785
- return s && a && Ke(e, i, a), a;
1796
+ const Ke = V`cx-details::part(base){border-bottom-width:0}`;
1797
+ var Ze = Object.defineProperty, Ye = Object.getOwnPropertyDescriptor, Ct = (t, e, i, s) => {
1798
+ for (var a = s > 1 ? void 0 : s ? Ye(e, i) : e, n = t.length - 1, o; n >= 0; n--)
1799
+ (o = t[n]) && (a = (s ? o(e, i, a) : o(a)) || a);
1800
+ return s && a && Ze(e, i, a), a;
1786
1801
  };
1787
1802
  let U = class extends j {
1788
1803
  constructor() {
@@ -1813,32 +1828,32 @@ let U = class extends j {
1813
1828
  return C`<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>`;
1814
1829
  }
1815
1830
  };
1816
- U.styles = [Q, Xe];
1831
+ U.styles = [Q, Ke];
1817
1832
  U.dependencies = {
1818
1833
  "cx-button": J,
1819
- "cx-checkbox": he,
1820
- "cx-details": it,
1821
- "cx-icon": st,
1834
+ "cx-checkbox": le,
1835
+ "cx-details": st,
1836
+ "cx-icon": at,
1822
1837
  "cx-space": B,
1823
1838
  "cx-tooltip": jt,
1824
1839
  "cx-typography": q
1825
1840
  };
1826
- vt([
1841
+ Ct([
1827
1842
  tt(".details")
1828
1843
  ], U.prototype, "base", 2);
1829
- vt([
1844
+ Ct([
1830
1845
  h({ reflect: !0, type: Boolean })
1831
1846
  ], U.prototype, "open", 2);
1832
- vt([
1847
+ Ct([
1833
1848
  h({ reflect: !0, type: Boolean })
1834
1849
  ], U.prototype, "value", 2);
1835
- U = vt([
1850
+ U = Ct([
1836
1851
  X("cx-asset-link-format-metadata")
1837
1852
  ], U);
1838
- var Ye = Object.defineProperty, Je = Object.getOwnPropertyDescriptor, g = (t, e, i, s) => {
1839
- for (var a = s > 1 ? void 0 : s ? Je(e, i) : e, r = t.length - 1, n; r >= 0; r--)
1840
- (n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
1841
- return s && a && Ye(e, i, a), a;
1853
+ var Je = Object.defineProperty, ti = Object.getOwnPropertyDescriptor, x = (t, e, i, s) => {
1854
+ for (var a = s > 1 ? void 0 : s ? ti(e, i) : e, n = t.length - 1, o; n >= 0; n--)
1855
+ (o = t[n]) && (a = (s ? o(e, i, a) : o(a)) || a);
1856
+ return s && a && Je(e, i, a), a;
1842
1857
  };
1843
1858
  let u = class extends j {
1844
1859
  constructor() {
@@ -1914,7 +1929,7 @@ let u = class extends j {
1914
1929
  keepAspectRatio: !0,
1915
1930
  ratioHeight: 1,
1916
1931
  ratioWidth: 1,
1917
- unit: o.Pixel,
1932
+ unit: r.Pixel,
1918
1933
  width: 1
1919
1934
  }, this.cropSize = {
1920
1935
  cropMode: "free",
@@ -1931,14 +1946,14 @@ let u = class extends j {
1931
1946
  position: N.CenterCenter,
1932
1947
  ratioHeight: 1,
1933
1948
  ratioWidth: 1,
1934
- unit: o.Pixel,
1949
+ unit: r.Pixel,
1935
1950
  width: 1,
1936
1951
  x: 0,
1937
1952
  y: 0
1938
1953
  }, this.rotation = 0, this.defaultSize = {
1939
1954
  height: 0,
1940
1955
  width: 0
1941
- }, this.cropperElement = null, this.parameters = [], this.loading = !1, this.lastAction = void 0, this.frozenIndex = void 0, this.preResetTransformations = void 0, this.preResetAutoFormat = void 0, this.preResetSelectedProxy = void 0, this.apiGetTransformAssetLink = ve, this.apiGetCropFocusMode = ke, this.onCropComplete = this.onCropComplete.bind(this), this.onCropDragStart = this.onCropDragStart.bind(this);
1956
+ }, this.cropperElement = null, this.parameters = [], this.loading = !1, this.lastAction = void 0, this.frozenIndex = void 0, this.preResetTransformations = void 0, this.preResetAutoFormat = void 0, this.preResetSelectedProxy = void 0, this.apiGetTransformAssetLink = ze, this.apiGetCropFocusMode = Re, this.onCropComplete = this.onCropComplete.bind(this), this.onCropDragStart = this.onCropDragStart.bind(this);
1942
1957
  }
1943
1958
  /**
1944
1959
  * Transform requests must resolve to a web-displayable image (the browser renders the
@@ -1960,8 +1975,8 @@ let u = class extends j {
1960
1975
  */
1961
1976
  get lastAppliedCropUnit() {
1962
1977
  return this.transformations.findLast(
1963
- (e) => e.key === m.Crop
1964
- )?.value.unit ?? o.Pixel;
1978
+ (e) => e.key === f.Crop
1979
+ )?.value.unit ?? r.Pixel;
1965
1980
  }
1966
1981
  /**
1967
1982
  * The focus mode of the last applied crop transformation, for the no-asset case only.
@@ -1970,7 +1985,7 @@ let u = class extends j {
1970
1985
  */
1971
1986
  get lastAppliedCropFocusMode() {
1972
1987
  return this.transformations.findLast(
1973
- (e) => e.key === m.Crop
1988
+ (e) => e.key === f.Crop
1974
1989
  )?.value.focusMode ?? "manual";
1975
1990
  }
1976
1991
  /**
@@ -1980,7 +1995,7 @@ let u = class extends j {
1980
1995
  */
1981
1996
  get lastAppliedCropPosition() {
1982
1997
  return this.transformations.findLast(
1983
- (e) => e.key === m.Crop
1998
+ (e) => e.key === f.Crop
1984
1999
  )?.value.position ?? N.CenterCenter;
1985
2000
  }
1986
2001
  /**
@@ -1992,8 +2007,8 @@ let u = class extends j {
1992
2007
  get disabledCropApply() {
1993
2008
  if (!this.asset && this.cropSize.unit !== this.lastAppliedCropUnit)
1994
2009
  return !1;
1995
- if (this.cropSize.unit === o.AspectRatio && !this.asset) {
1996
- const e = this.lastCropSize[o.AspectRatio];
2010
+ if (this.cropSize.unit === r.AspectRatio && !this.asset) {
2011
+ const e = this.lastCropSize[r.AspectRatio];
1997
2012
  return this.cropSize.ratioWidth === e.width && this.cropSize.ratioHeight === e.height && this.cropSize.focusMode === this.lastAppliedCropFocusMode && this.cropSize.position === this.lastAppliedCropPosition;
1998
2013
  }
1999
2014
  if (!this.asset && this.cropSize.focusMode !== this.lastAppliedCropFocusMode || !this.asset && this.cropSize.position !== this.lastAppliedCropPosition)
@@ -2007,7 +2022,7 @@ let u = class extends j {
2007
2022
  "y"
2008
2023
  ];
2009
2024
  for (const e of t)
2010
- if (this.cropSize[e] !== this.lastCropSize[o.Pixel][e])
2025
+ if (this.cropSize[e] !== this.lastCropSize[r.Pixel][e])
2011
2026
  return !1;
2012
2027
  return !0;
2013
2028
  }
@@ -2032,15 +2047,15 @@ let u = class extends j {
2032
2047
  get lastCropSize() {
2033
2048
  if (!this.asset) {
2034
2049
  const e = this.transformations.findLast(
2035
- (i) => i.key === m.Crop
2050
+ (i) => i.key === f.Crop
2036
2051
  );
2037
- if (e?.value.unit === o.AspectRatio && e.value.ratioWidth && e.value.ratioHeight)
2052
+ if (e?.value.unit === r.AspectRatio && e.value.ratioWidth && e.value.ratioHeight)
2038
2053
  return {
2039
- [o.AspectRatio]: {
2054
+ [r.AspectRatio]: {
2040
2055
  height: e.value.ratioHeight,
2041
2056
  percentageHeight: 100,
2042
2057
  percentageWidth: 100,
2043
- unit: o.AspectRatio,
2058
+ unit: r.AspectRatio,
2044
2059
  width: e.value.ratioWidth,
2045
2060
  x: 0,
2046
2061
  y: 0
@@ -2051,56 +2066,56 @@ let u = class extends j {
2051
2066
  * `min: 1`) instead of 0x0, so switching the unit selector back to Pixel and
2052
2067
  * clicking Apply immediately still commits a meaningful crop instead of a no-op.
2053
2068
  */
2054
- [o.Pixel]: {
2069
+ [r.Pixel]: {
2055
2070
  height: 1,
2056
2071
  percentageHeight: 100,
2057
2072
  percentageWidth: 100,
2058
- unit: o.Pixel,
2073
+ unit: r.Pixel,
2059
2074
  width: 1,
2060
2075
  x: 0,
2061
2076
  y: 0
2062
2077
  }
2063
2078
  };
2064
2079
  if (e?.value.width && e?.value.height) {
2065
- const { height: i, width: s, x: a = 0, y: r = 0 } = e.value, n = ct(s, i);
2080
+ const { height: i, width: s, x: a = 0, y: n = 0 } = e.value, o = pt(s, i);
2066
2081
  return {
2067
- [o.AspectRatio]: {
2068
- height: n.height,
2082
+ [r.AspectRatio]: {
2083
+ height: o.height,
2069
2084
  percentageHeight: 100,
2070
2085
  percentageWidth: 100,
2071
- unit: o.AspectRatio,
2072
- width: n.width,
2086
+ unit: r.AspectRatio,
2087
+ width: o.width,
2073
2088
  x: 0,
2074
2089
  y: 0
2075
2090
  },
2076
- [o.Pixel]: {
2091
+ [r.Pixel]: {
2077
2092
  height: i,
2078
2093
  percentageHeight: 100,
2079
2094
  percentageWidth: 100,
2080
- unit: o.Pixel,
2095
+ unit: r.Pixel,
2081
2096
  width: s,
2082
2097
  x: a,
2083
- y: r
2098
+ y: n
2084
2099
  }
2085
2100
  };
2086
2101
  }
2087
2102
  }
2088
- const t = this.lastImageSize.width && this.lastImageSize.height ? ct(this.lastImageSize.width, this.lastImageSize.height) : { height: 1, width: 1 };
2103
+ const t = this.lastImageSize.width && this.lastImageSize.height ? pt(this.lastImageSize.width, this.lastImageSize.height) : { height: 1, width: 1 };
2089
2104
  return {
2090
- [o.AspectRatio]: {
2105
+ [r.AspectRatio]: {
2091
2106
  height: t.height,
2092
2107
  percentageHeight: 100,
2093
2108
  percentageWidth: 100,
2094
- unit: o.AspectRatio,
2109
+ unit: r.AspectRatio,
2095
2110
  width: t.width,
2096
2111
  x: 0,
2097
2112
  y: 0
2098
2113
  },
2099
- [o.Pixel]: {
2114
+ [r.Pixel]: {
2100
2115
  height: this.lastImageSize.height,
2101
2116
  percentageHeight: 100,
2102
2117
  percentageWidth: 100,
2103
- unit: o.Pixel,
2118
+ unit: r.Pixel,
2104
2119
  width: this.lastImageSize.width,
2105
2120
  x: 0,
2106
2121
  y: 0
@@ -2115,48 +2130,48 @@ let u = class extends j {
2115
2130
  get lastResizeSize() {
2116
2131
  if (!this.asset) {
2117
2132
  const e = this.transformations.findLast(
2118
- (i) => i.key === m.Resize
2133
+ (i) => i.key === f.Resize
2119
2134
  );
2120
- if (e?.value.unit === o.AspectRatio && e.value.ratioWidth && e.value.ratioHeight)
2135
+ if (e?.value.unit === r.AspectRatio && e.value.ratioWidth && e.value.ratioHeight)
2121
2136
  return {
2122
- [o.AspectRatio]: {
2137
+ [r.AspectRatio]: {
2123
2138
  height: e.value.ratioHeight,
2124
- unit: o.AspectRatio,
2139
+ unit: r.AspectRatio,
2125
2140
  width: e.value.ratioWidth
2126
2141
  },
2127
2142
  // See lastCropSize's equivalent branch for why this falls back to 1x1, not 0x0.
2128
- [o.Pixel]: {
2143
+ [r.Pixel]: {
2129
2144
  height: 1,
2130
- unit: o.Pixel,
2145
+ unit: r.Pixel,
2131
2146
  width: 1
2132
2147
  }
2133
2148
  };
2134
2149
  if (e?.value.width && e?.value.height) {
2135
- const { height: i, width: s } = e.value, a = ct(s, i);
2150
+ const { height: i, width: s } = e.value, a = pt(s, i);
2136
2151
  return {
2137
- [o.AspectRatio]: {
2152
+ [r.AspectRatio]: {
2138
2153
  height: a.height,
2139
- unit: o.AspectRatio,
2154
+ unit: r.AspectRatio,
2140
2155
  width: a.width
2141
2156
  },
2142
- [o.Pixel]: {
2157
+ [r.Pixel]: {
2143
2158
  height: i,
2144
- unit: o.Pixel,
2159
+ unit: r.Pixel,
2145
2160
  width: s
2146
2161
  }
2147
2162
  };
2148
2163
  }
2149
2164
  }
2150
- const t = this.lastImageSize.width && this.lastImageSize.height ? ct(this.lastImageSize.width, this.lastImageSize.height) : { height: 1, width: 1 };
2165
+ const t = this.lastImageSize.width && this.lastImageSize.height ? pt(this.lastImageSize.width, this.lastImageSize.height) : { height: 1, width: 1 };
2151
2166
  return {
2152
- [o.AspectRatio]: {
2167
+ [r.AspectRatio]: {
2153
2168
  height: t.height,
2154
- unit: o.AspectRatio,
2169
+ unit: r.AspectRatio,
2155
2170
  width: t.width
2156
2171
  },
2157
- [o.Pixel]: {
2172
+ [r.Pixel]: {
2158
2173
  height: this.lastImageSize.height,
2159
- unit: o.Pixel,
2174
+ unit: r.Pixel,
2160
2175
  width: this.lastImageSize.width
2161
2176
  }
2162
2177
  };
@@ -2171,14 +2186,14 @@ let u = class extends j {
2171
2186
  */
2172
2187
  get lastRotation() {
2173
2188
  return this.asset ? 0 : this.transformations.findLast(
2174
- (e) => e.key === m.Rotate
2189
+ (e) => e.key === f.Rotate
2175
2190
  )?.value.rotation ?? 0;
2176
2191
  }
2177
2192
  /**
2178
2193
  * Returns the transformation string for the asset link.
2179
2194
  */
2180
2195
  get transformationString() {
2181
- return lt({
2196
+ return ct({
2182
2197
  asset: this.asset,
2183
2198
  baseUrl: "",
2184
2199
  parameters: this.parameters,
@@ -2223,7 +2238,7 @@ let u = class extends j {
2223
2238
  token: this.token,
2224
2239
  transformations: this.transformationString
2225
2240
  }).then((s) => {
2226
- this.loading = !1, !(!s?.relativePath || !this.selectedFormat) && (this.lastAction === m.Rotate && (this.rotation = 0), this.lastAction = void 0, this.lastImageSize = {
2241
+ this.loading = !1, !(!s?.relativePath || !this.selectedFormat) && (this.lastAction === f.Rotate && (this.rotation = 0), this.lastAction = void 0, this.lastImageSize = {
2227
2242
  height: s.height,
2228
2243
  width: s.width
2229
2244
  }, this.selectedFormat = {
@@ -2237,7 +2252,7 @@ let u = class extends j {
2237
2252
  */
2238
2253
  });
2239
2254
  });
2240
- const i = lt({
2255
+ const i = ct({
2241
2256
  asset: this.asset,
2242
2257
  baseUrl: "",
2243
2258
  extension: this.selectedFormat.extension,
@@ -2270,7 +2285,7 @@ let u = class extends j {
2270
2285
  async handleTransformationsChange() {
2271
2286
  if (await this.updateComplete, !this.asset) {
2272
2287
  this.emit("cx-asset-link-format-change", {
2273
- detail: lt({
2288
+ detail: ct({
2274
2289
  asset: this.asset,
2275
2290
  baseUrl: "",
2276
2291
  options: {
@@ -2281,35 +2296,35 @@ let u = class extends j {
2281
2296
  useSession: this.useSession
2282
2297
  }).replace(/\/t\//g, "")
2283
2298
  });
2284
- const r = this.transformations.findLast(
2285
- (c) => c.key === m.Crop && (c.value.unit === o.AspectRatio && c.value.ratioWidth && c.value.ratioHeight || c.value.width && c.value.height)
2299
+ const n = this.transformations.findLast(
2300
+ (c) => c.key === f.Crop && (c.value.unit === r.AspectRatio && c.value.ratioWidth && c.value.ratioHeight || c.value.width && c.value.height)
2286
2301
  );
2287
- if (r?.value.unit === o.AspectRatio && r.value.ratioWidth && r.value.ratioHeight) {
2288
- const { focusMode: c, position: f, ratioHeight: y, ratioWidth: d } = r.value;
2302
+ if (n?.value.unit === r.AspectRatio && n.value.ratioWidth && n.value.ratioHeight) {
2303
+ const { focusMode: c, position: y, ratioHeight: S, ratioWidth: p } = n.value;
2289
2304
  this.cropSize = {
2290
2305
  ...this.cropSize,
2291
2306
  cropMode: "free",
2292
2307
  focusMode: c ?? "manual",
2293
2308
  percentageHeight: 100,
2294
2309
  percentageWidth: 100,
2295
- position: f ?? N.CenterCenter,
2296
- ratioHeight: y,
2297
- ratioWidth: d,
2298
- unit: o.AspectRatio
2310
+ position: y ?? N.CenterCenter,
2311
+ ratioHeight: S,
2312
+ ratioWidth: p,
2313
+ unit: r.AspectRatio
2299
2314
  };
2300
- } else if (r) {
2301
- const { focusMode: c, height: f, position: y, unit: d, width: S, x: R = 0, y: A = 0 } = r.value;
2315
+ } else if (n) {
2316
+ const { focusMode: c, height: y, position: S, unit: p, width: g, x: w = 0, y: A = 0 } = n.value;
2302
2317
  this.cropSize = {
2303
2318
  ...this.cropSize,
2304
2319
  cropMode: "free",
2305
2320
  focusMode: c ?? "manual",
2306
- height: f,
2321
+ height: y,
2307
2322
  percentageHeight: 100,
2308
2323
  percentageWidth: 100,
2309
- position: y ?? N.CenterCenter,
2310
- unit: d ?? o.Pixel,
2311
- width: S,
2312
- x: R,
2324
+ position: S ?? N.CenterCenter,
2325
+ unit: p ?? r.Pixel,
2326
+ width: g,
2327
+ x: w,
2313
2328
  y: A
2314
2329
  };
2315
2330
  } else
@@ -2327,29 +2342,29 @@ let u = class extends j {
2327
2342
  percentageHeight: 0,
2328
2343
  percentageWidth: 0,
2329
2344
  position: N.CenterCenter,
2330
- unit: o.Pixel,
2345
+ unit: r.Pixel,
2331
2346
  width: 1,
2332
2347
  x: 0,
2333
2348
  y: 0
2334
2349
  };
2335
- const n = this.transformations.findLast(
2336
- (c) => c.key === m.Resize && (c.value.unit === o.AspectRatio && c.value.ratioWidth && c.value.ratioHeight || c.value.width || c.value.height)
2350
+ const o = this.transformations.findLast(
2351
+ (c) => c.key === f.Resize && (c.value.unit === r.AspectRatio && c.value.ratioWidth && c.value.ratioHeight || c.value.width || c.value.height)
2337
2352
  );
2338
- if (n?.value.unit === o.AspectRatio && n.value.ratioWidth && n.value.ratioHeight) {
2339
- const { ratioHeight: c, ratioWidth: f } = n.value;
2353
+ if (o?.value.unit === r.AspectRatio && o.value.ratioWidth && o.value.ratioHeight) {
2354
+ const { ratioHeight: c, ratioWidth: y } = o.value;
2340
2355
  this.resizeSize = {
2341
2356
  ...this.resizeSize,
2342
2357
  ratioHeight: c,
2343
- ratioWidth: f,
2344
- unit: o.AspectRatio
2358
+ ratioWidth: y,
2359
+ unit: r.AspectRatio
2345
2360
  };
2346
- } else if (n) {
2347
- const { height: c = 0, unit: f, width: y = 0 } = n.value;
2361
+ } else if (o) {
2362
+ const { height: c = 0, unit: y, width: S = 0 } = o.value;
2348
2363
  this.resizeSize = {
2349
2364
  ...this.resizeSize,
2350
2365
  height: c,
2351
- unit: f ?? o.Pixel,
2352
- width: y
2366
+ unit: y ?? r.Pixel,
2367
+ width: S
2353
2368
  };
2354
2369
  } else
2355
2370
  this.resizeSize = {
@@ -2360,21 +2375,21 @@ let u = class extends j {
2360
2375
  * Apply silently no-op.
2361
2376
  */
2362
2377
  height: 1,
2363
- unit: o.Pixel,
2378
+ unit: r.Pixel,
2364
2379
  width: 1
2365
2380
  };
2366
2381
  const l = this.transformations.findLast(
2367
- (c) => c.key === m.Rotate
2382
+ (c) => c.key === f.Rotate
2368
2383
  );
2369
2384
  this.rotation = l?.value.rotation ?? 0;
2370
- const p = this.transformations.findLast((c) => c.key === m.Quality)?.value.quality ?? 100, x = this.transformations.some(
2371
- (c) => c.key === m.Metadata
2385
+ const d = this.transformations.findLast((c) => c.key === f.Quality)?.value.quality ?? 100, m = this.transformations.some(
2386
+ (c) => c.key === f.Metadata
2372
2387
  );
2373
- this.selectedFormat ? this.selectedFormat = { ...this.selectedFormat, keepMetadata: x, quality: p } : this.selectedFormat = {
2388
+ this.selectedFormat ? this.selectedFormat = { ...this.selectedFormat, keepMetadata: m, quality: d } : this.selectedFormat = {
2374
2389
  extension: "",
2375
2390
  height: 0,
2376
- keepMetadata: x,
2377
- quality: p,
2391
+ keepMetadata: m,
2392
+ quality: d,
2378
2393
  rotation: 0,
2379
2394
  url: "",
2380
2395
  width: 0,
@@ -2386,7 +2401,7 @@ let u = class extends j {
2386
2401
  if (!this.selectedFormat)
2387
2402
  return;
2388
2403
  const t = this.proxies?.find(
2389
- (r) => r.id === this.selectedProxy
2404
+ (n) => n.id === this.selectedProxy
2390
2405
  );
2391
2406
  this.loading = !0;
2392
2407
  const e = await this.apiGetTransformAssetLink({
@@ -2407,7 +2422,7 @@ let u = class extends j {
2407
2422
  keepAspectRatio: !0,
2408
2423
  ratioHeight: 1,
2409
2424
  ratioWidth: 1,
2410
- unit: o.Pixel,
2425
+ unit: r.Pixel,
2411
2426
  width: e.width
2412
2427
  }, this.cropSize = {
2413
2428
  cropMode: "free",
@@ -2419,15 +2434,15 @@ let u = class extends j {
2419
2434
  position: N.CenterCenter,
2420
2435
  ratioHeight: 1,
2421
2436
  ratioWidth: 1,
2422
- unit: o.Pixel,
2437
+ unit: r.Pixel,
2423
2438
  width: e.width,
2424
2439
  x: 0,
2425
2440
  y: 0
2426
- }, this.lastAction === m.Rotate && (this.rotation = 0), this.lastAction = void 0;
2441
+ }, this.lastAction === f.Rotate && (this.rotation = 0), this.lastAction = void 0;
2427
2442
  const i = this.transformations.some(
2428
- (r) => r.key === m.Metadata
2443
+ (n) => n.key === f.Metadata
2429
2444
  ), s = this.transformations.findLast(
2430
- (r) => r.key === m.Quality
2445
+ (n) => n.key === f.Quality
2431
2446
  );
2432
2447
  this.selectedFormat = {
2433
2448
  ...this.selectedFormat,
@@ -2441,7 +2456,7 @@ let u = class extends j {
2441
2456
  * url: `${this.baseUrl}/${response.relativePath}`,
2442
2457
  */
2443
2458
  };
2444
- const a = lt({
2459
+ const a = ct({
2445
2460
  asset: this.asset,
2446
2461
  baseUrl: "",
2447
2462
  extension: this.selectedFormat.extension,
@@ -2473,7 +2488,7 @@ let u = class extends j {
2473
2488
  width: Number.parseInt(this.asset.width, 10)
2474
2489
  });
2475
2490
  const t = this.transformations.findLast(
2476
- (e) => e.key === m.Quality
2491
+ (e) => e.key === f.Quality
2477
2492
  );
2478
2493
  this.selectedFormat = {
2479
2494
  extension: this.asset.extension,
@@ -2499,7 +2514,7 @@ let u = class extends j {
2499
2514
  position: N.CenterCenter,
2500
2515
  ratioHeight: 1,
2501
2516
  ratioWidth: 1,
2502
- unit: o.Pixel,
2517
+ unit: r.Pixel,
2503
2518
  width: this.defaultSize.width,
2504
2519
  x: 0,
2505
2520
  y: 0
@@ -2528,26 +2543,26 @@ let u = class extends j {
2528
2543
  e.proxyName === "TRX" && (e.formatHeight = Number(this.asset.height), e.formatWidth = Number(this.asset.width));
2529
2544
  const i = this.proxies?.find((s) => s.id === t);
2530
2545
  i && (this.asset && i.proxyName === "TRX" && (i.formatHeight = Number(this.asset.height), i.formatWidth = Number(this.asset.width)), this.transformations = this.transformations.map((s) => {
2531
- if (s.key === m.Crop) {
2532
- const a = s.value, r = a.width / i.formatWidth * e.formatWidth, n = a.height / i.formatHeight * e.formatHeight, l = a.x / i.formatWidth * e.formatWidth, p = a.y / i.formatHeight * e.formatHeight;
2546
+ if (s.key === f.Crop) {
2547
+ const a = s.value, n = a.width / i.formatWidth * e.formatWidth, o = a.height / i.formatHeight * e.formatHeight, l = a.x / i.formatWidth * e.formatWidth, d = a.y / i.formatHeight * e.formatHeight;
2533
2548
  return {
2534
2549
  ...s,
2535
2550
  value: {
2536
2551
  ...s.value,
2537
- height: n,
2538
- width: r,
2552
+ height: o,
2553
+ width: n,
2539
2554
  x: l,
2540
- y: p
2555
+ y: d
2541
2556
  }
2542
2557
  };
2543
2558
  }
2544
- if (s.key === m.Resize) {
2545
- const a = s.value, r = a.width / i.formatWidth * e.formatWidth, n = a.height / i.formatHeight * e.formatHeight;
2559
+ if (s.key === f.Resize) {
2560
+ const a = s.value, n = a.width / i.formatWidth * e.formatWidth, o = a.height / i.formatHeight * e.formatHeight;
2546
2561
  return {
2547
2562
  ...s,
2548
2563
  value: {
2549
- height: n,
2550
- width: r
2564
+ height: o,
2565
+ width: n
2551
2566
  }
2552
2567
  };
2553
2568
  }
@@ -2562,24 +2577,24 @@ let u = class extends j {
2562
2577
  }, await this.updateComplete, this.cropSize = {
2563
2578
  cropMode: "free",
2564
2579
  focusMode: "manual",
2565
- height: this.lastCropSize[o.Pixel].height,
2580
+ height: this.lastCropSize[r.Pixel].height,
2566
2581
  keepAspectRatio: !0,
2567
2582
  percentageHeight: 100,
2568
2583
  percentageWidth: 100,
2569
2584
  position: N.CenterCenter,
2570
2585
  ratioHeight: 1,
2571
2586
  ratioWidth: 1,
2572
- unit: o.Pixel,
2573
- width: this.lastCropSize[o.Pixel].width,
2587
+ unit: r.Pixel,
2588
+ width: this.lastCropSize[r.Pixel].width,
2574
2589
  x: 0,
2575
2590
  y: 0
2576
2591
  }, this.resizeSize = {
2577
- height: this.lastResizeSize[o.Pixel].height,
2592
+ height: this.lastResizeSize[r.Pixel].height,
2578
2593
  keepAspectRatio: !0,
2579
2594
  ratioHeight: 1,
2580
2595
  ratioWidth: 1,
2581
- unit: o.Pixel,
2582
- width: this.lastResizeSize[o.Pixel].width
2596
+ unit: r.Pixel,
2597
+ width: this.lastResizeSize[r.Pixel].width
2583
2598
  };
2584
2599
  }
2585
2600
  handleLoadingChange() {
@@ -2599,12 +2614,12 @@ let u = class extends j {
2599
2614
  }
2600
2615
  handleActiveSettingChange() {
2601
2616
  this.cropperElement && (this.resizeSize = {
2602
- height: this.lastResizeSize[o.Pixel].height,
2617
+ height: this.lastResizeSize[r.Pixel].height,
2603
2618
  keepAspectRatio: !0,
2604
2619
  ratioHeight: 1,
2605
2620
  ratioWidth: 1,
2606
- unit: o.Pixel,
2607
- width: this.lastResizeSize[o.Pixel].width
2621
+ unit: r.Pixel,
2622
+ width: this.lastResizeSize[r.Pixel].width
2608
2623
  }, this.cropperElement.disabled = this.activeSetting !== "cx-asset-link-format-crop");
2609
2624
  }
2610
2625
  async handleRequestAutoCropSuggestion({
@@ -2613,33 +2628,33 @@ let u = class extends j {
2613
2628
  height: i,
2614
2629
  keepAspectRatio: s,
2615
2630
  percentageHeight: a,
2616
- percentageWidth: r,
2617
- ratioHeight: n,
2631
+ percentageWidth: n,
2632
+ ratioHeight: o,
2618
2633
  ratioWidth: l,
2619
- unit: p,
2620
- useCropMode: x,
2634
+ unit: d,
2635
+ useCropMode: m,
2621
2636
  width: c
2622
2637
  }) {
2623
2638
  if (!this.selectedFormat?.url || e === "manual")
2624
2639
  return;
2625
- this.loading = !0, this.lastAction = m.Crop;
2626
- const f = await this.apiGetCropFocusMode({
2640
+ this.loading = !0, this.lastAction = f.Crop;
2641
+ const y = await this.apiGetCropFocusMode({
2627
2642
  autoCropMode: e,
2628
2643
  cropHeight: i,
2629
2644
  cropWidth: c,
2630
2645
  imageUrl: this.selectedFormat.url
2631
2646
  });
2632
- if (f) {
2633
- let y = a, d = r;
2634
- i || (y = f.height * 100 / this.selectedFormat.height), c || (d = f.width * 100 / this.selectedFormat.width), this.cropSize = {
2647
+ if (y) {
2648
+ let S = a, p = n;
2649
+ i || (S = y.height * 100 / this.selectedFormat.height), c || (p = y.width * 100 / this.selectedFormat.width), this.cropSize = {
2635
2650
  ...this.cropSize,
2636
- height: f.height,
2637
- percentageHeight: y ?? this.cropSize.percentageHeight,
2638
- percentageWidth: d ?? this.cropSize.percentageWidth,
2639
- width: f.width,
2640
- x: f.x * 100 / this.selectedFormat.width,
2641
- y: f.y * 100 / this.selectedFormat.height,
2642
- ...x ? {
2651
+ height: y.height,
2652
+ percentageHeight: S ?? this.cropSize.percentageHeight,
2653
+ percentageWidth: p ?? this.cropSize.percentageWidth,
2654
+ width: y.width,
2655
+ x: y.x * 100 / this.selectedFormat.width,
2656
+ y: y.y * 100 / this.selectedFormat.height,
2657
+ ...m ? {
2643
2658
  cropMode: e,
2644
2659
  focusMode: "manual",
2645
2660
  keepAspectRatio: !1
@@ -2648,9 +2663,9 @@ let u = class extends j {
2648
2663
  focusMode: e
2649
2664
  },
2650
2665
  keepAspectRatio: s ?? this.cropSize.keepAspectRatio,
2651
- ratioHeight: n ?? this.cropSize.ratioHeight,
2666
+ ratioHeight: o ?? this.cropSize.ratioHeight,
2652
2667
  ratioWidth: l ?? this.cropSize.ratioWidth,
2653
- unit: p ?? this.cropSize.unit
2668
+ unit: d ?? this.cropSize.unit
2654
2669
  };
2655
2670
  }
2656
2671
  this.loading = !1, this.lastAction = void 0;
@@ -2660,32 +2675,32 @@ let u = class extends j {
2660
2675
  height: i,
2661
2676
  width: s,
2662
2677
  x: a,
2663
- y: r
2678
+ y: n
2664
2679
  } = e;
2665
2680
  if (s === 0 || i === 0)
2666
2681
  return;
2667
- const n = this.cropSize.percentageWidth !== s, l = this.cropSize.percentageHeight !== i;
2668
- let p = this.cropSize.height, x = this.cropSize.width;
2669
- n && (x = Math.round(s * this.selectedFormat.width / 100)), l && (p = Math.round(
2682
+ const o = this.cropSize.percentageWidth !== s, l = this.cropSize.percentageHeight !== i;
2683
+ let d = this.cropSize.height, m = this.cropSize.width;
2684
+ o && (m = Math.round(s * this.selectedFormat.width / 100)), l && (d = Math.round(
2670
2685
  i * this.selectedFormat.height / 100
2671
2686
  ));
2672
2687
  const c = this.cropSize.focusMode;
2673
2688
  this.focusModes.find(
2674
- (y) => y.value === c
2689
+ (S) => S.value === c
2675
2690
  )?.auto && this.selectedFormat?.url && this.cropperElement ? await this.handleRequestAutoCropSuggestion({
2676
2691
  focusMode: c,
2677
- height: p,
2692
+ height: d,
2678
2693
  percentageHeight: i,
2679
2694
  percentageWidth: s,
2680
- width: x
2695
+ width: m
2681
2696
  }) : this.cropSize = {
2682
2697
  ...this.cropSize,
2683
- height: p,
2698
+ height: d,
2684
2699
  percentageHeight: i,
2685
2700
  percentageWidth: s,
2686
- width: x,
2701
+ width: m,
2687
2702
  x: a,
2688
- y: r
2703
+ y: n
2689
2704
  };
2690
2705
  }
2691
2706
  onCropDragStart() {
@@ -2719,7 +2734,7 @@ let u = class extends j {
2719
2734
  }
2720
2735
  onProxyChange(t) {
2721
2736
  const e = t.detail;
2722
- if (this.lastAction = m.Proxy, e.autoFormat) {
2737
+ if (this.lastAction = f.Proxy, e.autoFormat) {
2723
2738
  this.autoFormat = !0;
2724
2739
  const i = this.autoResolvedProxyId;
2725
2740
  i && (this.selectedProxy = i);
@@ -2736,21 +2751,21 @@ let u = class extends j {
2736
2751
  });
2737
2752
  else {
2738
2753
  const s = this.focusModes.find(
2739
- (p) => p.value === this.cropSize.focusMode
2754
+ (d) => d.value === this.cropSize.focusMode
2740
2755
  )?.auto;
2741
- let a = this.cropSize.keepAspectRatio, r = this.cropSize.focusMode, n = this.cropSize.x, l = this.cropSize.y;
2742
- e === "free" ? (a = !1, r = "manual") : this.cropSize.unit === o.Pixel && !s && (n = 0, l = 0), s ? await this.handleRequestAutoCropSuggestion({
2756
+ let a = this.cropSize.keepAspectRatio, n = this.cropSize.focusMode, o = this.cropSize.x, l = this.cropSize.y;
2757
+ e === "free" ? (a = !1, n = "manual") : this.cropSize.unit === r.Pixel && !s && (o = 0, l = 0), s ? await this.handleRequestAutoCropSuggestion({
2743
2758
  cropMode: e,
2744
- focusMode: r,
2759
+ focusMode: n,
2745
2760
  height: this.cropSize.height,
2746
2761
  keepAspectRatio: a,
2747
2762
  width: this.cropSize.width
2748
2763
  }) : this.cropSize = {
2749
2764
  ...this.cropSize,
2750
2765
  cropMode: e,
2751
- focusMode: r,
2766
+ focusMode: n,
2752
2767
  keepAspectRatio: a,
2753
- x: n,
2768
+ x: o,
2754
2769
  y: l
2755
2770
  };
2756
2771
  }
@@ -2774,52 +2789,52 @@ let u = class extends j {
2774
2789
  }
2775
2790
  async onCropChange(t) {
2776
2791
  const e = this.cropSize.unit;
2777
- if (t.detail.unit === o.AspectRatio) {
2792
+ if (t.detail.unit === r.AspectRatio) {
2778
2793
  const i = t.detail.width / t.detail.height, s = this.asset ? Math.min(
2779
2794
  Math.max(Math.round(this.cropSize.height * i), 0),
2780
2795
  this.resizeSize.width
2781
2796
  ) : 0, a = this.asset ? Math.min(
2782
2797
  Math.max(Math.round(s / i), 0),
2783
2798
  this.resizeSize.height
2784
- ) : 0, r = this.asset ? a * 100 / this.selectedFormat.height : 100, n = this.asset ? s * 100 / this.selectedFormat.width : 100;
2785
- let l = this.cropSize.x, p = this.cropSize.y;
2786
- l + n > 100 && (l = 100 - n), p + r > 100 && (p = 100 - r);
2787
- let x = this.cropSize.cropMode;
2799
+ ) : 0, n = this.asset ? a * 100 / this.selectedFormat.height : 100, o = this.asset ? s * 100 / this.selectedFormat.width : 100;
2800
+ let l = this.cropSize.x, d = this.cropSize.y;
2801
+ l + o > 100 && (l = 100 - o), d + n > 100 && (d = 100 - n);
2802
+ let m = this.cropSize.cropMode;
2788
2803
  this.cropModes.find(
2789
- (f) => f.value === x
2790
- )?.auto && (x = "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 = {
2804
+ (y) => y.value === m
2805
+ )?.auto && (m = "free"), t.detail.silent ? (this.cropSize.height = a, this.cropSize.keepAspectRatio = t.detail.keepAspectRatio, this.cropSize.percentageHeight = n, this.cropSize.percentageWidth = o, this.cropSize.ratioHeight = t.detail.height, this.cropSize.ratioWidth = t.detail.width, this.cropSize.unit = r.AspectRatio, this.cropSize.width = s) : this.cropSize = {
2791
2806
  ...this.cropSize,
2792
- cropMode: x,
2807
+ cropMode: m,
2793
2808
  height: a,
2794
2809
  keepAspectRatio: t.detail.keepAspectRatio,
2795
- percentageHeight: r,
2796
- percentageWidth: n,
2810
+ percentageHeight: n,
2811
+ percentageWidth: o,
2797
2812
  ratioHeight: t.detail.height,
2798
2813
  ratioWidth: t.detail.width,
2799
- unit: o.AspectRatio,
2814
+ unit: r.AspectRatio,
2800
2815
  width: s,
2801
2816
  x: l,
2802
- y: p
2817
+ y: d
2803
2818
  };
2804
2819
  } else {
2805
2820
  const i = this.asset ? t.detail.height * 100 / this.selectedFormat.height : 100, s = this.asset ? t.detail.width * 100 / this.selectedFormat.width : 100;
2806
- let a = this.cropSize.x, r = this.cropSize.y;
2807
- a + s > 100 && (a = 100 - s), r + i > 100 && (r = 100 - i);
2808
- let n = this.cropSize.cropMode;
2821
+ let a = this.cropSize.x, n = this.cropSize.y;
2822
+ a + s > 100 && (a = 100 - s), n + i > 100 && (n = 100 - i);
2823
+ let o = this.cropSize.cropMode;
2809
2824
  const l = this.cropModes.find(
2810
- (p) => p.value === n
2825
+ (d) => d.value === o
2811
2826
  )?.auto;
2812
- (t.detail.breakAspectRatio || l) && (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 = {
2827
+ (t.detail.breakAspectRatio || l) && (o = "free"), t.detail.silent ? (this.cropSize.cropMode = o, this.cropSize.height = t.detail.height, this.cropSize.keepAspectRatio = t.detail.keepAspectRatio, this.cropSize.percentageHeight = i, this.cropSize.percentageWidth = s, this.cropSize.unit = r.Pixel, this.cropSize.width = t.detail.width, this.cropSize.x = a, this.cropSize.y = n) : this.cropSize = {
2813
2828
  ...this.cropSize,
2814
- cropMode: n,
2829
+ cropMode: o,
2815
2830
  height: t.detail.height,
2816
2831
  keepAspectRatio: t.detail.keepAspectRatio,
2817
2832
  percentageHeight: i,
2818
2833
  percentageWidth: s,
2819
- unit: o.Pixel,
2834
+ unit: r.Pixel,
2820
2835
  width: t.detail.width,
2821
2836
  x: a,
2822
- y: r
2837
+ y: n
2823
2838
  };
2824
2839
  }
2825
2840
  e !== this.cropSize.unit && (this.cropSize = {
@@ -2837,43 +2852,43 @@ let u = class extends j {
2837
2852
  });
2838
2853
  }
2839
2854
  onCropApply(t) {
2840
- if (this.clearResetSnapshot(), this.lastAction = m.Crop, !this.asset) {
2855
+ if (this.clearResetSnapshot(), this.lastAction = f.Crop, !this.asset) {
2841
2856
  const {
2842
2857
  focusMode: l,
2843
- height: p,
2844
- position: x,
2858
+ height: d,
2859
+ position: m,
2845
2860
  ratioHeight: c,
2846
- ratioWidth: f,
2847
- unit: y,
2848
- width: d,
2849
- x: S,
2850
- y: R
2861
+ ratioWidth: y,
2862
+ unit: S,
2863
+ width: p,
2864
+ x: g,
2865
+ y: w
2851
2866
  } = this.cropSize, A = this.focusModes.find(
2852
2867
  (F) => F.value === l
2853
2868
  )?.auto ?? !1;
2854
- if (y === o.AspectRatio) {
2855
- f && c && this.upsertTransformation({
2856
- key: m.Crop,
2869
+ if (S === r.AspectRatio) {
2870
+ y && c && this.upsertTransformation({
2871
+ key: f.Crop,
2857
2872
  value: {
2858
2873
  focusMode: l,
2859
2874
  isFocusModeAuto: A,
2860
- position: x,
2875
+ position: m,
2861
2876
  ratioHeight: c,
2862
- ratioWidth: f,
2863
- unit: y
2877
+ ratioWidth: y,
2878
+ unit: S
2864
2879
  }
2865
2880
  });
2866
2881
  return;
2867
2882
  }
2868
- (p || d) && this.upsertTransformation({
2869
- key: m.Crop,
2883
+ (d || p) && this.upsertTransformation({
2884
+ key: f.Crop,
2870
2885
  value: {
2871
2886
  focusMode: l,
2872
- height: p,
2887
+ height: d,
2873
2888
  isFocusModeAuto: A,
2874
- position: x,
2875
- unit: y,
2876
- width: d,
2889
+ position: m,
2890
+ unit: S,
2891
+ width: p,
2877
2892
  /**
2878
2893
  * Without an asset there is no cropper to drag, so x/y are always the 0
2879
2894
  * placeholder from cropSize's default — never a real manual offset. Omit
@@ -2881,8 +2896,8 @@ let u = class extends j {
2881
2896
  * string) so `hasManualXY` in buildTransformationString doesn't spuriously
2882
2897
  * suppress the focus mode / position `c_g_` gravity value.
2883
2898
  */
2884
- x: Number.isFinite(S) && S !== 0 ? S : void 0,
2885
- y: Number.isFinite(R) && R !== 0 ? R : void 0
2899
+ x: Number.isFinite(g) && g !== 0 ? g : void 0,
2900
+ y: Number.isFinite(w) && w !== 0 ? w : void 0
2886
2901
  }
2887
2902
  });
2888
2903
  return;
@@ -2890,38 +2905,38 @@ let u = class extends j {
2890
2905
  const { height: e, mode: i, unit: s, width: a } = t.detail;
2891
2906
  if (!this.cropperElement || !this.selectedFormat)
2892
2907
  return;
2893
- const r = this.cropSize.focusMode, n = this.focusModes.find(
2894
- (l) => l.value === r
2908
+ const n = this.cropSize.focusMode, o = this.focusModes.find(
2909
+ (l) => l.value === n
2895
2910
  )?.auto ?? !1;
2896
2911
  if (e && a && s) {
2897
- let l = a, p = e;
2898
- if (s === o.AspectRatio && (l = this.cropSize.percentageWidth * this.selectedFormat.width / 100, p = this.cropSize.percentageHeight * this.selectedFormat.height / 100), i)
2912
+ let l = a, d = e;
2913
+ if (s === r.AspectRatio && (l = this.cropSize.percentageWidth * this.selectedFormat.width / 100, d = this.cropSize.percentageHeight * this.selectedFormat.height / 100), i)
2899
2914
  this.transformations = [
2900
2915
  ...this.transformations,
2901
2916
  {
2902
- key: m.Crop,
2917
+ key: f.Crop,
2903
2918
  value: {
2904
- focusMode: r,
2905
- height: p,
2906
- isFocusModeAuto: n,
2919
+ focusMode: n,
2920
+ height: d,
2921
+ isFocusModeAuto: o,
2907
2922
  mode: i,
2908
2923
  width: l
2909
2924
  }
2910
2925
  }
2911
2926
  ];
2912
2927
  else {
2913
- const x = this.cropSize.x / 100 * this.selectedFormat.width, c = this.cropSize.y / 100 * this.selectedFormat.height;
2928
+ const m = this.cropSize.x / 100 * this.selectedFormat.width, c = this.cropSize.y / 100 * this.selectedFormat.height;
2914
2929
  this.transformations = [
2915
2930
  ...this.transformations,
2916
2931
  {
2917
- key: m.Crop,
2932
+ key: f.Crop,
2918
2933
  value: {
2919
- focusMode: r,
2920
- height: p,
2921
- isFocusModeAuto: n,
2934
+ focusMode: n,
2935
+ height: d,
2936
+ isFocusModeAuto: o,
2922
2937
  unit: s,
2923
2938
  width: l,
2924
- x,
2939
+ x: m,
2925
2940
  y: c
2926
2941
  }
2927
2942
  }
@@ -2930,19 +2945,19 @@ let u = class extends j {
2930
2945
  } else i && (this.transformations = [
2931
2946
  ...this.transformations,
2932
2947
  {
2933
- key: m.Crop,
2948
+ key: f.Crop,
2934
2949
  value: {
2935
- focusMode: r,
2936
- isFocusModeAuto: n,
2950
+ focusMode: n,
2951
+ isFocusModeAuto: o,
2937
2952
  mode: i
2938
2953
  }
2939
2954
  }
2940
2955
  ]);
2941
2956
  }
2942
2957
  onResizeChange(t) {
2943
- if (t.detail.unit === o.AspectRatio) {
2958
+ if (t.detail.unit === r.AspectRatio) {
2944
2959
  const e = t.detail.width / t.detail.height, i = Math.max(
2945
- Math.round(this.lastResizeSize[o.Pixel].height * e),
2960
+ Math.round(this.lastResizeSize[r.Pixel].height * e),
2946
2961
  0
2947
2962
  ), s = Math.max(Math.round(i / e), 0);
2948
2963
  this.resizeSize = {
@@ -2965,21 +2980,21 @@ let u = class extends j {
2965
2980
  }
2966
2981
  onResizeApply(t) {
2967
2982
  const { height: e, unit: i, width: s } = t.detail;
2968
- if (this.clearResetSnapshot(), this.lastAction = m.Resize, !this.asset) {
2969
- if (i === o.AspectRatio) {
2970
- const { ratioHeight: p, ratioWidth: x } = this.resizeSize;
2971
- x && p && this.upsertTransformation({
2972
- key: m.Resize,
2983
+ if (this.clearResetSnapshot(), this.lastAction = f.Resize, !this.asset) {
2984
+ if (i === r.AspectRatio) {
2985
+ const { ratioHeight: d, ratioWidth: m } = this.resizeSize;
2986
+ m && d && this.upsertTransformation({
2987
+ key: f.Resize,
2973
2988
  value: {
2974
- ratioHeight: p,
2975
- ratioWidth: x,
2989
+ ratioHeight: d,
2990
+ ratioWidth: m,
2976
2991
  unit: i
2977
2992
  }
2978
2993
  });
2979
2994
  return;
2980
2995
  }
2981
2996
  (e || s) && this.upsertTransformation({
2982
- key: m.Resize,
2997
+ key: f.Resize,
2983
2998
  value: {
2984
2999
  height: e,
2985
3000
  unit: i,
@@ -2990,16 +3005,16 @@ let u = class extends j {
2990
3005
  }
2991
3006
  if (!this.selectedFormat)
2992
3007
  return;
2993
- const a = this.selectedFormat.width || this.defaultSize.width, r = this.selectedFormat.height || this.defaultSize.height;
2994
- let n = s, l = e;
2995
- this.resizeSize.unit !== i ? (n = a, l = r) : i === o.AspectRatio && (n = Math.round(s / e * r), l = r), this.transformations = [
3008
+ const a = this.selectedFormat.width || this.defaultSize.width, n = this.selectedFormat.height || this.defaultSize.height;
3009
+ let o = s, l = e;
3010
+ this.resizeSize.unit !== i ? (o = a, l = n) : i === r.AspectRatio && (o = Math.round(s / e * n), l = n), this.transformations = [
2996
3011
  ...this.transformations,
2997
3012
  {
2998
- key: m.Resize,
3013
+ key: f.Resize,
2999
3014
  value: {
3000
3015
  height: l,
3001
3016
  unit: i,
3002
- width: n
3017
+ width: o
3003
3018
  }
3004
3019
  }
3005
3020
  ];
@@ -3009,21 +3024,21 @@ let u = class extends j {
3009
3024
  }
3010
3025
  onRotationApply(t) {
3011
3026
  const e = t.detail;
3012
- if (this.clearResetSnapshot(), this.lastAction = m.Rotate, !this.asset) {
3027
+ if (this.clearResetSnapshot(), this.lastAction = f.Rotate, !this.asset) {
3013
3028
  e ? this.upsertTransformation({
3014
- key: m.Rotate,
3029
+ key: f.Rotate,
3015
3030
  value: {
3016
3031
  rotation: e
3017
3032
  }
3018
3033
  }) : this.transformations = this.transformations.filter(
3019
- (i) => i.key !== m.Rotate
3034
+ (i) => i.key !== f.Rotate
3020
3035
  );
3021
3036
  return;
3022
3037
  }
3023
3038
  this.selectedFormat && (this.transformations = [
3024
3039
  ...this.transformations,
3025
3040
  {
3026
- key: m.Rotate,
3041
+ key: f.Rotate,
3027
3042
  value: {
3028
3043
  rotation: e
3029
3044
  }
@@ -3032,9 +3047,9 @@ let u = class extends j {
3032
3047
  }
3033
3048
  onQualityChange(t) {
3034
3049
  const e = t.detail;
3035
- this.selectedFormat && (this.selectedFormat.quality = e), this.clearResetSnapshot(), this.lastAction = m.Quality;
3050
+ this.selectedFormat && (this.selectedFormat.quality = e), this.clearResetSnapshot(), this.lastAction = f.Quality;
3036
3051
  const i = {
3037
- key: m.Quality,
3052
+ key: f.Quality,
3038
3053
  value: {
3039
3054
  quality: e
3040
3055
  }
@@ -3048,22 +3063,22 @@ let u = class extends j {
3048
3063
  keepMetadata: e
3049
3064
  }), !this.asset) {
3050
3065
  e ? this.upsertTransformation({
3051
- key: m.Metadata,
3066
+ key: f.Metadata,
3052
3067
  value: {
3053
3068
  keepMetadata: e
3054
3069
  }
3055
3070
  }) : this.transformations = this.transformations.filter(
3056
- (i) => i.key !== m.Metadata
3071
+ (i) => i.key !== f.Metadata
3057
3072
  );
3058
3073
  return;
3059
3074
  }
3060
3075
  e ? this.upsertTransformation({
3061
- key: m.Metadata,
3076
+ key: f.Metadata,
3062
3077
  value: {
3063
3078
  keepMetadata: e
3064
3079
  }
3065
3080
  }) : this.transformations = this.transformations.filter(
3066
- (i) => i.key !== m.Metadata
3081
+ (i) => i.key !== f.Metadata
3067
3082
  );
3068
3083
  }
3069
3084
  onExtensionChange(t) {
@@ -3075,7 +3090,7 @@ let u = class extends j {
3075
3090
  }
3076
3091
  syncQuality() {
3077
3092
  const t = this.transformations.findLast(
3078
- (e) => e.key === m.Quality
3093
+ (e) => e.key === f.Quality
3079
3094
  )?.value?.quality;
3080
3095
  this.selectedFormat && (this.selectedFormat = {
3081
3096
  ...this.selectedFormat,
@@ -3120,20 +3135,20 @@ let u = class extends j {
3120
3135
  )}
3121
3136
  ${I(
3122
3137
  !this.noFormat,
3123
- () => C`<cx-asset-link-format-proxy class="asset-link-format__details" value=${this.selectedProxy || this.proxies?.[0]?.id || ""} ?open=${this.activeSetting === "cx-asset-link-format-proxy"} ?auto-format=${this.autoFormat} ?can-auto-format=${this.canAutoFormat} .items=${this.formats} ?loading=${this.loading && this.lastAction === m.Proxy} @cx-asset-link-format-proxy-change=${this.onProxyChange}></cx-asset-link-format-proxy>`
3138
+ () => C`<cx-asset-link-format-proxy class="asset-link-format__details" value=${this.selectedProxy || this.proxies?.[0]?.id || ""} ?open=${this.activeSetting === "cx-asset-link-format-proxy"} ?auto-format=${this.autoFormat} ?can-auto-format=${this.canAutoFormat} .items=${this.formats} ?loading=${this.loading && this.lastAction === f.Proxy} @cx-asset-link-format-proxy-change=${this.onProxyChange}></cx-asset-link-format-proxy>`
3124
3139
  )}
3125
3140
  ${I(
3126
3141
  !this.noCrop,
3127
- () => C`<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 === m.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>`
3142
+ () => C`<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 === f.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[r.Pixel].width : 1 / 0} max-height=${this.asset ? this.lastResizeSize[r.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>`
3128
3143
  )}
3129
3144
  ${I(
3130
3145
  !this.noResize,
3131
- () => C`<cx-asset-link-format-resize class="asset-link-format__details" ?open=${this.activeSetting === "cx-asset-link-format-resize"} ?loading=${this.loading && this.lastAction === m.Resize} ?no-ratio-modes=${!this.asset} ?keep-aspect-ratio=${this.resizeSize.keepAspectRatio} width=${this.resizeSize.width} height=${this.resizeSize.height} max-width=${this.asset ? this.imageSize.width : 1 / 0} max-height=${this.asset ? this.imageSize.height : 1 / 0} ratio-width=${this.resizeSize.ratioWidth} ratio-height=${this.resizeSize.ratioHeight} unit=${this.resizeSize.unit} .lastAppliedSetting=${this.lastResizeSize} @cx-asset-link-format-resize-change=${this.onResizeChange} @cx-asset-link-format-resize-apply=${this.onResizeApply}></cx-asset-link-format-resize>`
3146
+ () => C`<cx-asset-link-format-resize class="asset-link-format__details" ?open=${this.activeSetting === "cx-asset-link-format-resize"} ?loading=${this.loading && this.lastAction === f.Resize} ?no-ratio-modes=${!this.asset} ?keep-aspect-ratio=${this.resizeSize.keepAspectRatio} width=${this.resizeSize.width} height=${this.resizeSize.height} max-width=${this.asset ? this.imageSize.width : 1 / 0} max-height=${this.asset ? this.imageSize.height : 1 / 0} ratio-width=${this.resizeSize.ratioWidth} ratio-height=${this.resizeSize.ratioHeight} unit=${this.resizeSize.unit} .lastAppliedSetting=${this.lastResizeSize} @cx-asset-link-format-resize-change=${this.onResizeChange} @cx-asset-link-format-resize-apply=${this.onResizeApply}></cx-asset-link-format-resize>`
3132
3147
  )}
3133
3148
  ${I(
3134
3149
  !this.noRotate,
3135
- () => C`<cx-asset-link-format-rotation class="asset-link-format__details" ?loading=${this.loading && this.lastAction === m.Rotate} ?open=${this.activeSetting === "cx-asset-link-format-rotation"} default-value=${this.selectedFormat?.rotation ?? 0} last-applied-value=${this.lastRotation} value=${this.rotation} @cx-asset-link-format-rotation-change=${this.onRotationChange} @cx-asset-link-format-rotation-apply=${this.onRotationApply}></cx-asset-link-format-rotation>`
3136
- )}<cx-asset-link-format-quality class="asset-link-format__details" ?loading=${this.loading && this.lastAction === m.Quality} ?open=${this.activeSetting === "cx-asset-link-format-quality"} value=${this.selectedFormat?.quality ?? 100} @cx-asset-link-format-quality-change=${this.onQualityChange}></cx-asset-link-format-quality>${I(
3150
+ () => C`<cx-asset-link-format-rotation class="asset-link-format__details" ?loading=${this.loading && this.lastAction === f.Rotate} ?open=${this.activeSetting === "cx-asset-link-format-rotation"} default-value=${this.selectedFormat?.rotation ?? 0} last-applied-value=${this.lastRotation} value=${this.rotation} @cx-asset-link-format-rotation-change=${this.onRotationChange} @cx-asset-link-format-rotation-apply=${this.onRotationApply}></cx-asset-link-format-rotation>`
3151
+ )}<cx-asset-link-format-quality class="asset-link-format__details" ?loading=${this.loading && this.lastAction === f.Quality} ?open=${this.activeSetting === "cx-asset-link-format-quality"} value=${this.selectedFormat?.quality ?? 100} @cx-asset-link-format-quality-change=${this.onQualityChange}></cx-asset-link-format-quality>${I(
3137
3152
  !this.noMetadata,
3138
3153
  () => C`<cx-asset-link-format-metadata class="asset-link-format__details" ?open=${this.activeSetting === "cx-asset-link-format-metadata"} .value=${this.selectedFormat?.keepMetadata ?? !1} @cx-asset-link-format-metadata-change=${this.onMetadataChange}></cx-asset-link-format-metadata>`
3139
3154
  )}
@@ -3143,168 +3158,168 @@ let u = class extends j {
3143
3158
  )}</div>`;
3144
3159
  }
3145
3160
  };
3146
- u.styles = [Q, Fe];
3161
+ u.styles = [Q, _e];
3147
3162
  u.dependencies = {
3148
3163
  "cx-asset-link-format-crop": v,
3149
3164
  "cx-asset-link-format-extension": Y,
3150
3165
  "cx-asset-link-format-metadata": U,
3151
3166
  "cx-asset-link-format-proxy": E,
3152
3167
  "cx-asset-link-format-quality": W,
3153
- "cx-asset-link-format-resize": b,
3168
+ "cx-asset-link-format-resize": k,
3154
3169
  "cx-asset-link-format-rotation": H,
3155
3170
  "cx-button": J,
3156
3171
  "cx-space": B,
3157
3172
  "cx-typography": q
3158
3173
  };
3159
- g([
3174
+ x([
3160
3175
  h({ attribute: "base-url", type: String })
3161
3176
  ], u.prototype, "baseUrl", 2);
3162
- g([
3177
+ x([
3163
3178
  h({ attribute: "token", type: String })
3164
3179
  ], u.prototype, "token", 2);
3165
- g([
3180
+ x([
3166
3181
  h({ reflect: !1, type: Object })
3167
3182
  ], u.prototype, "asset", 2);
3168
- g([
3183
+ x([
3169
3184
  h({ attribute: "crop-modes", reflect: !1, type: Array })
3170
3185
  ], u.prototype, "cropModes", 2);
3171
- g([
3186
+ x([
3172
3187
  h({ attribute: "focus-modes", reflect: !1, type: Object })
3173
3188
  ], u.prototype, "focusModes", 2);
3174
- g([
3189
+ x([
3175
3190
  h({ reflect: !1, type: Array })
3176
3191
  ], u.prototype, "extensions", 2);
3177
- g([
3192
+ x([
3178
3193
  h({ reflect: !1, type: Array })
3179
3194
  ], u.prototype, "proxies", 2);
3180
- g([
3195
+ x([
3181
3196
  h({ attribute: "for-cropper", reflect: !0, type: String })
3182
3197
  ], u.prototype, "forCropper", 2);
3183
- g([
3198
+ x([
3184
3199
  h({ attribute: "use-session", reflect: !0, type: String })
3185
3200
  ], u.prototype, "useSession", 2);
3186
- g([
3201
+ x([
3187
3202
  h({ reflect: !1, type: Array })
3188
3203
  ], u.prototype, "transformations", 2);
3189
- g([
3204
+ x([
3190
3205
  h({ attribute: "selected-proxy", reflect: !0, type: String })
3191
3206
  ], u.prototype, "selectedProxy", 2);
3192
- g([
3207
+ x([
3193
3208
  h({ attribute: "default-proxy", reflect: !0, type: String })
3194
3209
  ], u.prototype, "defaultProxy", 2);
3195
- g([
3210
+ x([
3196
3211
  h({ attribute: "can-auto-format", reflect: !0, type: Boolean })
3197
3212
  ], u.prototype, "canAutoFormat", 2);
3198
- g([
3213
+ x([
3199
3214
  h({ attribute: "auto-format", reflect: !0, type: Boolean })
3200
3215
  ], u.prototype, "autoFormat", 2);
3201
- g([
3216
+ x([
3202
3217
  h({ attribute: "use-custom-extension", reflect: !0, type: Boolean })
3203
3218
  ], u.prototype, "useCustomExtension", 2);
3204
- g([
3219
+ x([
3205
3220
  h({ attribute: "no-metadata", reflect: !0, type: Boolean })
3206
3221
  ], u.prototype, "noMetadata", 2);
3207
- g([
3222
+ x([
3208
3223
  h({ attribute: "no-format", reflect: !0, type: Boolean })
3209
3224
  ], u.prototype, "noFormat", 2);
3210
- g([
3225
+ x([
3211
3226
  h({ attribute: "no-crop", reflect: !0, type: Boolean })
3212
3227
  ], u.prototype, "noCrop", 2);
3213
- g([
3228
+ x([
3214
3229
  h({ attribute: "no-resize", reflect: !0, type: Boolean })
3215
3230
  ], u.prototype, "noResize", 2);
3216
- g([
3231
+ x([
3217
3232
  h({ attribute: "no-rotate", reflect: !0, type: Boolean })
3218
3233
  ], u.prototype, "noRotate", 2);
3219
- g([
3234
+ x([
3220
3235
  h({ attribute: "last-image-size", reflect: !1, type: Object })
3221
3236
  ], u.prototype, "lastImageSize", 2);
3222
- g([
3237
+ x([
3223
3238
  h({ attribute: "hide-header", reflect: !1, type: Boolean })
3224
3239
  ], u.prototype, "hideHeader", 2);
3225
- g([
3240
+ x([
3226
3241
  h({ attribute: "can-reset", type: Boolean })
3227
3242
  ], u.prototype, "canReset", 2);
3228
- g([
3243
+ x([
3229
3244
  h({ attribute: !1, reflect: !1, type: Object })
3230
3245
  ], u.prototype, "queryElement", 2);
3231
- g([
3232
- k()
3246
+ x([
3247
+ R()
3233
3248
  ], u.prototype, "activeSetting", 2);
3234
- g([
3235
- k()
3249
+ x([
3250
+ R()
3236
3251
  ], u.prototype, "selectedFormat", 2);
3237
- g([
3238
- k()
3252
+ x([
3253
+ R()
3239
3254
  ], u.prototype, "resizeSize", 2);
3240
- g([
3241
- k()
3255
+ x([
3256
+ R()
3242
3257
  ], u.prototype, "cropSize", 2);
3243
- g([
3244
- k()
3258
+ x([
3259
+ R()
3245
3260
  ], u.prototype, "rotation", 2);
3246
- g([
3247
- k()
3261
+ x([
3262
+ R()
3248
3263
  ], u.prototype, "defaultSize", 2);
3249
- g([
3250
- k()
3264
+ x([
3265
+ R()
3251
3266
  ], u.prototype, "cropperElement", 2);
3252
- g([
3253
- k()
3267
+ x([
3268
+ R()
3254
3269
  ], u.prototype, "parameters", 2);
3255
- g([
3256
- k()
3270
+ x([
3271
+ R()
3257
3272
  ], u.prototype, "loading", 2);
3258
- g([
3259
- k()
3273
+ x([
3274
+ R()
3260
3275
  ], u.prototype, "lastAction", 2);
3261
- g([
3262
- k()
3276
+ x([
3277
+ R()
3263
3278
  ], u.prototype, "frozenIndex", 2);
3264
- g([
3265
- k()
3279
+ x([
3280
+ R()
3266
3281
  ], u.prototype, "preResetTransformations", 2);
3267
- g([
3268
- k()
3282
+ x([
3283
+ R()
3269
3284
  ], u.prototype, "preResetAutoFormat", 2);
3270
- g([
3271
- k()
3285
+ x([
3286
+ R()
3272
3287
  ], u.prototype, "preResetSelectedProxy", 2);
3273
- g([
3288
+ x([
3274
3289
  P("transformations")
3275
3290
  ], u.prototype, "handleTransformationsChange", 1);
3276
- g([
3291
+ x([
3277
3292
  P("selectedProxy")
3278
3293
  ], u.prototype, "handleSelectedProxyChange", 1);
3279
- g([
3294
+ x([
3280
3295
  P("loading")
3281
3296
  ], u.prototype, "handleLoadingChange", 1);
3282
- u = g([
3297
+ u = x([
3283
3298
  X("cx-asset-link-format")
3284
3299
  ], u);
3285
3300
  export {
3286
3301
  u as C,
3287
- Vi as F,
3302
+ Gi as F,
3288
3303
  _t as M,
3289
- we as a,
3304
+ be as a,
3290
3305
  Xt as b,
3291
- nt as c,
3292
- gt as d,
3306
+ ht as c,
3307
+ xt as d,
3293
3308
  Vt as e,
3294
- fe as f,
3309
+ ge as f,
3295
3310
  Gt as g,
3296
- qi as h,
3311
+ ji as h,
3297
3312
  Zt as i,
3298
- ji as j,
3299
- Bi as k,
3300
- dt as l,
3301
- ut as m,
3313
+ Vi as j,
3314
+ qi as k,
3315
+ ut as l,
3316
+ mt as m,
3302
3317
  Ht as n,
3303
- mt as o,
3304
- ft as p,
3318
+ ft as o,
3319
+ gt as p,
3305
3320
  Wt as q,
3306
- Oi as r,
3307
- Li as s,
3308
- Ui as t,
3309
- le as u
3321
+ Li as r,
3322
+ Ui as s,
3323
+ Bi as t,
3324
+ ce as u
3310
3325
  };