@uploadcare/react-uploader 0.2.0-alpha.0 → 0.3.0-alpha.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.
@@ -1,9 +1,9 @@
1
- var cr = Object.defineProperty;
2
- var hr = (s, i, e) => i in s ? cr(s, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[i] = e;
3
- var u = (s, i, e) => (hr(s, typeof i != "symbol" ? i + "" : i, e), e);
4
- import I, { useMemo as Pe } from "react";
5
- var ur = Object.defineProperty, dr = (s, i, e) => i in s ? ur(s, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[i] = e, Dt = (s, i, e) => (dr(s, typeof i != "symbol" ? i + "" : i, e), e);
6
- function fr(s) {
1
+ var hr = Object.defineProperty;
2
+ var ur = (s, i, e) => i in s ? hr(s, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[i] = e;
3
+ var u = (s, i, e) => (ur(s, typeof i != "symbol" ? i + "" : i, e), e);
4
+ import O, { useMemo as Pe } from "react";
5
+ var dr = Object.defineProperty, fr = (s, i, e) => i in s ? dr(s, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[i] = e, Dt = (s, i, e) => (fr(s, typeof i != "symbol" ? i + "" : i, e), e);
6
+ function pr(s) {
7
7
  let i = (e) => {
8
8
  var t;
9
9
  for (let r in e)
@@ -14,7 +14,7 @@ function fr(s) {
14
14
  }
15
15
  var T = class {
16
16
  constructor(s) {
17
- s.constructor === Object ? this.store = fr(s) : (this._storeIsProxy = !0, this.store = s), this.callbackMap = /* @__PURE__ */ Object.create(null);
17
+ s.constructor === Object ? this.store = pr(s) : (this._storeIsProxy = !0, this.store = s), this.callbackMap = /* @__PURE__ */ Object.create(null);
18
18
  }
19
19
  static warn(s, i) {
20
20
  console.warn(`Symbiote Data: cannot ${s}. Prop name: ` + i);
@@ -79,24 +79,24 @@ var _ = Object.freeze({
79
79
  SET_LATER_KEY: "__toSetLater__",
80
80
  USE_TPL: "use-template",
81
81
  ROOT_STYLE_ATTR_NAME: "sym-component"
82
- }), Wi = "1234567890QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm", pr = Wi.length - 1, te = class {
82
+ }), qi = "1234567890QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm", mr = qi.length - 1, Ae = class {
83
83
  static generate(s = "XXXXXXXXX-XXX") {
84
84
  let i = "";
85
85
  for (let e = 0; e < s.length; e++)
86
- i += s[e] === "-" ? s[e] : Wi.charAt(Math.random() * pr);
86
+ i += s[e] === "-" ? s[e] : qi.charAt(Math.random() * mr);
87
87
  return i;
88
88
  }
89
89
  };
90
- function qi(s, i, e) {
90
+ function Gi(s, i, e) {
91
91
  let t = !0, r, n = i.split(".");
92
92
  return n.forEach((o, l) => {
93
93
  l < n.length - 1 ? s = s[o] : r = o;
94
94
  }), s ? s[r] = e : t = !1, t;
95
95
  }
96
- function mr(s) {
96
+ function gr(s) {
97
97
  return s.split("-").map((i, e) => i && e ? i[0].toUpperCase() + i.slice(1) : i).join("").split("_").map((i, e) => i && e ? i.toUpperCase() : i).join("");
98
98
  }
99
- function gr(s, i) {
99
+ function br(s, i) {
100
100
  [...s.querySelectorAll(`[${_.REPEAT_ATTR}]`)].forEach((e) => {
101
101
  let t = e.getAttribute(_.REPEAT_ITEM_TAG_ATTR), r;
102
102
  if (t && (r = window.customElements.get(t)), !r) {
@@ -154,8 +154,8 @@ function gr(s, i) {
154
154
  }), e.removeAttribute(_.REPEAT_ATTR), e.removeAttribute(_.REPEAT_ITEM_TAG_ATTR);
155
155
  });
156
156
  }
157
- var mi = "__default__";
158
- function br(s, i) {
157
+ var gi = "__default__";
158
+ function _r(s, i) {
159
159
  if (i.shadowRoot)
160
160
  return;
161
161
  let e = [...s.querySelectorAll("slot")];
@@ -163,14 +163,14 @@ function br(s, i) {
163
163
  return;
164
164
  let t = {};
165
165
  e.forEach((r) => {
166
- let n = r.getAttribute("name") || mi;
166
+ let n = r.getAttribute("name") || gi;
167
167
  t[n] = {
168
168
  slot: r,
169
169
  fr: document.createDocumentFragment()
170
170
  };
171
171
  }), i.initChildren.forEach((r) => {
172
172
  var n;
173
- let o = mi;
173
+ let o = gi;
174
174
  r instanceof Element && r.hasAttribute("slot") && (o = r.getAttribute("slot"), r.removeAttribute("slot")), (n = t[o]) == null || n.fr.appendChild(r);
175
175
  }), Object.values(t).forEach((r) => {
176
176
  if (r.fr.childNodes.length)
@@ -182,18 +182,18 @@ function br(s, i) {
182
182
  r.slot.remove();
183
183
  });
184
184
  }
185
- function _r(s, i) {
185
+ function yr(s, i) {
186
186
  [...s.querySelectorAll(`[${_.EL_REF_ATTR}]`)].forEach((e) => {
187
187
  let t = e.getAttribute(_.EL_REF_ATTR);
188
188
  i.ref[t] = e, e.removeAttribute(_.EL_REF_ATTR);
189
189
  });
190
190
  }
191
- function yr(s, i) {
191
+ function vr(s, i) {
192
192
  [...s.querySelectorAll(`[${_.BIND_ATTR}]`)].forEach((e) => {
193
193
  let r = e.getAttribute(_.BIND_ATTR).split(";");
194
194
  [...e.attributes].forEach((n) => {
195
195
  if (n.name.startsWith("-") && n.value) {
196
- let o = mr(n.name.replace("-", ""));
196
+ let o = gr(n.name.replace("-", ""));
197
197
  r.push(o + ":" + n.value), e.removeAttribute(n.name);
198
198
  }
199
199
  }), r.forEach((n) => {
@@ -205,26 +205,26 @@ function yr(s, i) {
205
205
  for (let h of c) {
206
206
  let d;
207
207
  h.startsWith("!!") ? (d = "double", h = h.replace("!!", "")) : h.startsWith("!") && (d = "single", h = h.replace("!", "")), i.sub(h, (f) => {
208
- d === "double" ? f = !!f : d === "single" && (f = !f), a ? (f == null ? void 0 : f.constructor) === Boolean ? f ? e.setAttribute(l, "") : e.removeAttribute(l) : e.setAttribute(l, f) : qi(e, l, f) || (e[_.SET_LATER_KEY] || (e[_.SET_LATER_KEY] = /* @__PURE__ */ Object.create(null)), e[_.SET_LATER_KEY][l] = f);
208
+ d === "double" ? f = !!f : d === "single" && (f = !f), a ? (f == null ? void 0 : f.constructor) === Boolean ? f ? e.setAttribute(l, "") : e.removeAttribute(l) : e.setAttribute(l, f) : Gi(e, l, f) || (e[_.SET_LATER_KEY] || (e[_.SET_LATER_KEY] = /* @__PURE__ */ Object.create(null)), e[_.SET_LATER_KEY][l] = f);
209
209
  });
210
210
  }
211
211
  }), e.removeAttribute(_.BIND_ATTR);
212
212
  });
213
213
  }
214
- var it = "{{", je = "}}", vr = "skip-text";
215
- function Cr(s) {
214
+ var it = "{{", je = "}}", Cr = "skip-text";
215
+ function wr(s) {
216
216
  let i, e = [], t = document.createTreeWalker(s, NodeFilter.SHOW_TEXT, {
217
217
  acceptNode: (r) => {
218
218
  var n;
219
- return !((n = r.parentElement) != null && n.hasAttribute(vr)) && r.textContent.includes(it) && r.textContent.includes(je) && 1;
219
+ return !((n = r.parentElement) != null && n.hasAttribute(Cr)) && r.textContent.includes(it) && r.textContent.includes(je) && 1;
220
220
  }
221
221
  });
222
222
  for (; i = t.nextNode(); )
223
223
  e.push(i);
224
224
  return e;
225
225
  }
226
- var wr = function(s, i) {
227
- Cr(s).forEach((t) => {
226
+ var Er = function(s, i) {
227
+ wr(s).forEach((t) => {
228
228
  let r = [], n;
229
229
  for (; t.textContent.includes(je); )
230
230
  t.textContent.startsWith(it) ? (n = t.textContent.indexOf(je) + je.length, t.splitText(n), r.push(t)) : (n = t.textContent.indexOf(it), t.splitText(n)), t = t.nextSibling;
@@ -235,14 +235,14 @@ var wr = function(s, i) {
235
235
  });
236
236
  });
237
237
  });
238
- }, Er = [gr, br, _r, yr, wr], rt = "'", Le = '"', Ar = /\\([0-9a-fA-F]{1,6} ?)/g;
239
- function Tr(s) {
238
+ }, Ar = [br, _r, yr, vr, Er], rt = "'", Le = '"', Tr = /\\([0-9a-fA-F]{1,6} ?)/g;
239
+ function $r(s) {
240
240
  return (s[0] === Le || s[0] === rt) && (s[s.length - 1] === Le || s[s.length - 1] === rt);
241
241
  }
242
- function $r(s) {
242
+ function Sr(s) {
243
243
  return (s[0] === Le || s[0] === rt) && (s = s.slice(1)), (s[s.length - 1] === Le || s[s.length - 1] === rt) && (s = s.slice(0, -1)), s;
244
244
  }
245
- function Sr(s) {
245
+ function xr(s) {
246
246
  let i = "", e = "";
247
247
  for (var t = 0; t < s.length; t++) {
248
248
  const r = s[t + 1];
@@ -250,17 +250,17 @@ function Sr(s) {
250
250
  }
251
251
  return i;
252
252
  }
253
- function xr(s) {
253
+ function Ir(s) {
254
254
  let i = s;
255
- Tr(s) && (i = $r(i), i = i.replace(Ar, (e, t) => String.fromCodePoint(parseInt(t.trim(), 16))), i = i.replaceAll(`\\
256
- `, "\\n"), i = Sr(i), i = Le + i + Le);
255
+ $r(s) && (i = Sr(i), i = i.replace(Tr, (e, t) => String.fromCodePoint(parseInt(t.trim(), 16))), i = i.replaceAll(`\\
256
+ `, "\\n"), i = xr(i), i = Le + i + Le);
257
257
  try {
258
258
  return JSON.parse(i);
259
259
  } catch {
260
260
  throw new Error(`Failed to parse CSS property value: ${i}. Original input: ${s}`);
261
261
  }
262
262
  }
263
- var gi = 0, $e = null, re = null, ue = class extends HTMLElement {
263
+ var bi = 0, $e = null, se = null, he = class extends HTMLElement {
264
264
  constructor() {
265
265
  super(), Dt(this, "updateCssData", () => {
266
266
  var s;
@@ -271,7 +271,7 @@ var gi = 0, $e = null, re = null, ue = class extends HTMLElement {
271
271
  }), this.init$ = /* @__PURE__ */ Object.create(null), this.cssInit$ = /* @__PURE__ */ Object.create(null), this.tplProcessors = /* @__PURE__ */ new Set(), this.ref = /* @__PURE__ */ Object.create(null), this.allSubs = /* @__PURE__ */ new Set(), this.pauseRender = !1, this.renderShadow = !1, this.readyToDestroy = !0, this.processInnerHtml = !1, this.allowCustomTemplate = !1, this.ctxOwner = !1;
272
272
  }
273
273
  get BaseComponent() {
274
- return ue;
274
+ return he;
275
275
  }
276
276
  initCallback() {
277
277
  }
@@ -318,7 +318,7 @@ var gi = 0, $e = null, re = null, ue = class extends HTMLElement {
318
318
  this.tplProcessors.add(s);
319
319
  }
320
320
  get autoCtxName() {
321
- return this.__autoCtxName || (this.__autoCtxName = te.generate(), this.style.setProperty(_.CSS_CTX_PROP, `'${this.__autoCtxName}'`)), this.__autoCtxName;
321
+ return this.__autoCtxName || (this.__autoCtxName = Ae.generate(), this.style.setProperty(_.CSS_CTX_PROP, `'${this.__autoCtxName}'`)), this.__autoCtxName;
322
322
  }
323
323
  get cssCtxName() {
324
324
  return this.getCssData(_.CSS_CTX_PROP, !0);
@@ -351,21 +351,21 @@ var gi = 0, $e = null, re = null, ue = class extends HTMLElement {
351
351
  sub(s, i, e = !0) {
352
352
  let t = (n) => {
353
353
  this.isConnected && i(n);
354
- }, r = ue.__parseProp(s, this);
354
+ }, r = he.__parseProp(s, this);
355
355
  r.ctx.has(r.name) ? this.allSubs.add(r.ctx.sub(r.name, t, e)) : window.setTimeout(() => {
356
356
  this.allSubs.add(r.ctx.sub(r.name, t, e));
357
357
  });
358
358
  }
359
359
  notify(s) {
360
- let i = ue.__parseProp(s, this);
360
+ let i = he.__parseProp(s, this);
361
361
  i.ctx.notify(i.name);
362
362
  }
363
363
  has(s) {
364
- let i = ue.__parseProp(s, this);
364
+ let i = he.__parseProp(s, this);
365
365
  return i.ctx.has(i.name);
366
366
  }
367
367
  add(s, i, e = !1) {
368
- let t = ue.__parseProp(s, this);
368
+ let t = he.__parseProp(s, this);
369
369
  t.ctx.add(t.name, i, e);
370
370
  }
371
371
  add$(s, i = !1) {
@@ -377,11 +377,11 @@ var gi = 0, $e = null, re = null, ue = class extends HTMLElement {
377
377
  let s = /* @__PURE__ */ Object.create(null);
378
378
  this.__stateProxy = new Proxy(s, {
379
379
  set: (i, e, t) => {
380
- let r = ue.__parseProp(e, this);
380
+ let r = he.__parseProp(e, this);
381
381
  return r.ctx.pub(r.name, t), !0;
382
382
  },
383
383
  get: (i, e) => {
384
- let t = ue.__parseProp(e, this);
384
+ let t = he.__parseProp(e, this);
385
385
  return t.ctx.read(t.name);
386
386
  }
387
387
  });
@@ -424,11 +424,11 @@ var gi = 0, $e = null, re = null, ue = class extends HTMLElement {
424
424
  let i = (s = this.getAttribute(_.CTX_NAME_ATTR)) == null ? void 0 : s.trim();
425
425
  if (i && this.style.setProperty(_.CSS_CTX_PROP, `'${i}'`), this.__initDataCtx(), this[_.SET_LATER_KEY]) {
426
426
  for (let e in this[_.SET_LATER_KEY])
427
- qi(this, e, this[_.SET_LATER_KEY][e]);
427
+ Gi(this, e, this[_.SET_LATER_KEY][e]);
428
428
  delete this[_.SET_LATER_KEY];
429
429
  }
430
430
  this.initChildren = [...this.childNodes];
431
- for (let e of Er)
431
+ for (let e of Ar)
432
432
  this.addTemplateProcessor(e);
433
433
  if (this.pauseRender)
434
434
  this.__initCallback();
@@ -459,11 +459,11 @@ var gi = 0, $e = null, re = null, ue = class extends HTMLElement {
459
459
  s.remove(), this.allSubs.delete(s);
460
460
  for (let s of this.tplProcessors)
461
461
  this.tplProcessors.delete(s);
462
- re == null || re.delete(this.updateCssData), re != null && re.size || ($e == null || $e.disconnect(), $e = null, re = null);
462
+ se == null || se.delete(this.updateCssData), se != null && se.size || ($e == null || $e.disconnect(), $e = null, se = null);
463
463
  }, 100)));
464
464
  }
465
465
  static reg(s, i = !1) {
466
- s || (gi++, s = `${_.AUTO_TAG_PRFX}-${gi}`), this.__tag = s;
466
+ s || (bi++, s = `${_.AUTO_TAG_PRFX}-${bi}`), this.__tag = s;
467
467
  let e = window.customElements.get(s);
468
468
  if (e) {
469
469
  !i && e !== this && console.warn([
@@ -496,7 +496,7 @@ var gi = 0, $e = null, re = null, ue = class extends HTMLElement {
496
496
  this.__computedStyle || (this.__computedStyle = window.getComputedStyle(this));
497
497
  let e = this.__computedStyle.getPropertyValue(s).trim();
498
498
  try {
499
- this.__cssDataCache[s] = xr(e);
499
+ this.__cssDataCache[s] = Ir(e);
500
500
  } catch {
501
501
  !i && console.warn(`CSS Data error: ${s}`), this.__cssDataCache[s] = null;
502
502
  }
@@ -507,8 +507,8 @@ var gi = 0, $e = null, re = null, ue = class extends HTMLElement {
507
507
  return s.split("--").map((i, e) => e === 0 ? "" : i).join("--");
508
508
  }
509
509
  __initStyleAttrObserver() {
510
- re || (re = /* @__PURE__ */ new Set()), re.add(this.updateCssData), $e || ($e = new MutationObserver((s) => {
511
- s[0].type === "attributes" && re.forEach((i) => {
510
+ se || (se = /* @__PURE__ */ new Set()), se.add(this.updateCssData), $e || ($e = new MutationObserver((s) => {
511
+ s[0].type === "attributes" && se.forEach((i) => {
512
512
  i();
513
513
  });
514
514
  }), $e.observe(document, {
@@ -551,19 +551,19 @@ var gi = 0, $e = null, re = null, ue = class extends HTMLElement {
551
551
  t.href = e, t.rel = "stylesheet", this.__rootStylesLink = t;
552
552
  }
553
553
  }
554
- }, ht = ue;
554
+ }, ht = he;
555
555
  Dt(ht, "template");
556
- function Gi(s, i) {
556
+ function Xi(s, i) {
557
557
  for (let e in i)
558
558
  e.includes("-") ? s.style.setProperty(e, i[e]) : s.style[e] = i[e];
559
559
  }
560
- function Ir(s, i) {
560
+ function kr(s, i) {
561
561
  for (let e in i)
562
562
  i[e].constructor === Boolean ? i[e] ? s.setAttribute(e, "") : s.removeAttribute(e) : s.setAttribute(e, i[e]);
563
563
  }
564
564
  function zt(s = { tag: "div" }) {
565
565
  let i = document.createElement(s.tag);
566
- if (s.attributes && Ir(i, s.attributes), s.styles && Gi(i, s.styles), s.properties)
566
+ if (s.attributes && kr(i, s.attributes), s.styles && Xi(i, s.styles), s.properties)
567
567
  for (let e in s.properties)
568
568
  i[e] = s.properties[e];
569
569
  return s.processors && s.processors.forEach((e) => {
@@ -573,9 +573,9 @@ function zt(s = { tag: "div" }) {
573
573
  i.appendChild(t);
574
574
  }), i;
575
575
  }
576
- var Xi = "idb-store-ready", kr = "symbiote-db", Or = "symbiote-idb-update_", Pr = class {
576
+ var Ki = "idb-store-ready", Or = "symbiote-db", Pr = "symbiote-idb-update_", Lr = class {
577
577
  _notifyWhenReady(s = null) {
578
- window.dispatchEvent(new CustomEvent(Xi, {
578
+ window.dispatchEvent(new CustomEvent(Ki, {
579
579
  detail: {
580
580
  dbName: this.name,
581
581
  storeName: this.storeName,
@@ -584,7 +584,7 @@ var Xi = "idb-store-ready", kr = "symbiote-db", Or = "symbiote-idb-update_", Pr
584
584
  }));
585
585
  }
586
586
  get _updEventName() {
587
- return Or + this.name;
587
+ return Pr + this.name;
588
588
  }
589
589
  _getUpdateEvent(s) {
590
590
  return new CustomEvent(this._updEventName, {
@@ -671,15 +671,15 @@ var Xi = "idb-store-ready", kr = "symbiote-db", Or = "symbiote-idb-update_", Pr
671
671
  };
672
672
  }
673
673
  stop() {
674
- window.removeEventListener("storage", this._updateHandler), this._subscriptionsMap = null, Ki.clear(this.name);
674
+ window.removeEventListener("storage", this._updateHandler), this._subscriptionsMap = null, Yi.clear(this.name);
675
675
  }
676
- }, Ki = class {
676
+ }, Yi = class {
677
677
  static get readyEventName() {
678
- return Xi;
678
+ return Ki;
679
679
  }
680
- static open(s = kr, i = "store") {
680
+ static open(s = Or, i = "store") {
681
681
  let e = s + "/" + i;
682
- return this._reg[e] || (this._reg[e] = new Pr(s, i)), this._reg[e];
682
+ return this._reg[e] || (this._reg[e] = new Lr(s, i)), this._reg[e];
683
683
  }
684
684
  static clear(s) {
685
685
  window.indexedDB.deleteDatabase(s);
@@ -687,8 +687,8 @@ var Xi = "idb-store-ready", kr = "symbiote-db", Or = "symbiote-idb-update_", Pr
687
687
  i.split("/")[0] === s && delete this._reg[i];
688
688
  }
689
689
  };
690
- Dt(Ki, "_reg", /* @__PURE__ */ Object.create(null));
691
- const Lr = 20, S = Object.freeze({
690
+ Dt(Yi, "_reg", /* @__PURE__ */ Object.create(null));
691
+ const Ur = 20, S = Object.freeze({
692
692
  FILE_ADDED: "file-added",
693
693
  FILE_REMOVED: "file-removed",
694
694
  FILE_UPLOAD_START: "file-upload-start",
@@ -708,7 +708,7 @@ const Lr = 20, S = Object.freeze({
708
708
  CHANGE: "change",
709
709
  GROUP_CREATED: "group-created"
710
710
  });
711
- class Ur {
711
+ class Rr {
712
712
  /** @param {(...args: unknown[]) => void} debugPrint */
713
713
  constructor(i) {
714
714
  /**
@@ -768,7 +768,7 @@ class Ur {
768
768
  return;
769
769
  }
770
770
  this._timeoutStore.has(i) && window.clearTimeout(this._timeoutStore.get(i));
771
- const r = typeof t == "number" ? t : Lr, n = window.setTimeout(() => {
771
+ const r = typeof t == "number" ? t : Ur, n = window.setTimeout(() => {
772
772
  this._dispatch(i, typeof e == "function" ? e() : e), this._timeoutStore.delete(i);
773
773
  }, r);
774
774
  this._timeoutStore.set(i, n);
@@ -787,7 +787,7 @@ function H(s, i) {
787
787
  }, /** @type {T & { cancel: () => void }} } */
788
788
  t;
789
789
  }
790
- const bi = "--uploadcare-blocks-window-height";
790
+ const _i = "--uploadcare-blocks-window-height";
791
791
  class nt {
792
792
  /**
793
793
  * @param {unknown} client
@@ -809,7 +809,7 @@ class nt {
809
809
  }
810
810
  /** @private */
811
811
  static detachTracker() {
812
- window.removeEventListener("resize", this.flush, { capture: !0 }), document.documentElement.style.removeProperty(bi);
812
+ window.removeEventListener("resize", this.flush, { capture: !0 }), document.documentElement.style.removeProperty(_i);
813
813
  }
814
814
  }
815
815
  /**
@@ -818,35 +818,35 @@ class nt {
818
818
  */
819
819
  u(nt, "clientsRegistry", /* @__PURE__ */ new Set()), /** @private */
820
820
  u(nt, "flush", H(() => {
821
- document.documentElement.style.setProperty(bi, `${window.innerHeight}px`);
821
+ document.documentElement.style.setProperty(_i, `${window.innerHeight}px`);
822
822
  }, 100));
823
- const Yi = (s, i) => new Intl.PluralRules(s).select(i), Rr = (s) => s, kt = "{{", Ji = "}}", _i = "plural:";
823
+ const Ji = (s, i) => new Intl.PluralRules(s).select(i), Mr = (s) => s, kt = "{{", Zi = "}}", yi = "plural:";
824
824
  function Ot(s, i, e = {}) {
825
825
  var o;
826
- let { openToken: t = kt, closeToken: r = Ji, transform: n = Rr } = e;
826
+ let { openToken: t = kt, closeToken: r = Zi, transform: n = Mr } = e;
827
827
  for (let l in i) {
828
828
  let a = (o = i[l]) == null ? void 0 : o.toString();
829
829
  s = s.replaceAll(t + l + r, typeof a == "string" ? n(a) : a);
830
830
  }
831
831
  return s;
832
832
  }
833
- function Mr(s) {
833
+ function Fr(s) {
834
834
  const i = [];
835
835
  let e = s.indexOf(kt);
836
836
  for (; e !== -1; ) {
837
- const t = s.indexOf(Ji, e), r = s.substring(e + 2, t);
838
- if (r.startsWith(_i)) {
839
- const n = s.substring(e + 2, t).replace(_i, ""), o = n.substring(0, n.indexOf("(")), l = n.substring(n.indexOf("(") + 1, n.indexOf(")"));
837
+ const t = s.indexOf(Zi, e), r = s.substring(e + 2, t);
838
+ if (r.startsWith(yi)) {
839
+ const n = s.substring(e + 2, t).replace(yi, ""), o = n.substring(0, n.indexOf("(")), l = n.substring(n.indexOf("(") + 1, n.indexOf(")"));
840
840
  i.push({ variable: r, pluralKey: o, countVariable: l });
841
841
  }
842
842
  e = s.indexOf(kt, t);
843
843
  }
844
844
  return i;
845
845
  }
846
- const we = (s) => {
846
+ const Ce = (s) => {
847
847
  var i;
848
848
  return (i = s.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)) == null ? void 0 : i.map((e) => e.toLowerCase()).join("-");
849
- }, Zi = ({ element: s, attribute: i, onSuccess: e, onTimeout: t, timeout: r = 300 }) => {
849
+ }, Qi = ({ element: s, attribute: i, onSuccess: e, onTimeout: t, timeout: r = 300 }) => {
850
850
  const n = s.getAttribute(i);
851
851
  if (n !== null) {
852
852
  e(n);
@@ -866,24 +866,24 @@ const we = (s) => {
866
866
  const h = s.getAttribute(i);
867
867
  c.type === "attributes" && c.attributeName === i && h !== null && (clearTimeout(l), o.disconnect(), e(h));
868
868
  };
869
- }, yi = /* @__PURE__ */ new Set();
869
+ }, vi = /* @__PURE__ */ new Set();
870
870
  function ot(s) {
871
- yi.has(s) || (yi.add(s), console.warn(s));
871
+ vi.has(s) || (vi.add(s), console.warn(s));
872
872
  }
873
- function vi(s) {
873
+ function Ci(s) {
874
874
  return Object.prototype.toString.call(s) === "[object Object]";
875
875
  }
876
- const Fr = /\W|_/g;
877
- function Nr(s) {
878
- return s.split(Fr).map((i, e) => i.charAt(0)[e > 0 ? "toUpperCase" : "toLowerCase"]() + i.slice(1)).join("");
876
+ const Nr = /\W|_/g;
877
+ function Dr(s) {
878
+ return s.split(Nr).map((i, e) => i.charAt(0)[e > 0 ? "toUpperCase" : "toLowerCase"]() + i.slice(1)).join("");
879
879
  }
880
- function Ci(s, { ignoreKeys: i } = { ignoreKeys: [] }) {
881
- return Array.isArray(s) ? s.map((e) => he(e, { ignoreKeys: i })) : s;
880
+ function wi(s, { ignoreKeys: i } = { ignoreKeys: [] }) {
881
+ return Array.isArray(s) ? s.map((e) => ce(e, { ignoreKeys: i })) : s;
882
882
  }
883
- function he(s, { ignoreKeys: i } = { ignoreKeys: [] }) {
883
+ function ce(s, { ignoreKeys: i } = { ignoreKeys: [] }) {
884
884
  if (Array.isArray(s))
885
- return Ci(s, { ignoreKeys: i });
886
- if (!vi(s))
885
+ return wi(s, { ignoreKeys: i });
886
+ if (!Ci(s))
887
887
  return s;
888
888
  const e = {};
889
889
  for (const t of Object.keys(s)) {
@@ -892,12 +892,12 @@ function he(s, { ignoreKeys: i } = { ignoreKeys: [] }) {
892
892
  e[t] = r;
893
893
  continue;
894
894
  }
895
- vi(r) ? r = he(r, { ignoreKeys: i }) : Array.isArray(r) && (r = Ci(r, { ignoreKeys: i })), e[Nr(t)] = r;
895
+ Ci(r) ? r = ce(r, { ignoreKeys: i }) : Array.isArray(r) && (r = wi(r, { ignoreKeys: i })), e[Dr(t)] = r;
896
896
  }
897
897
  return e;
898
898
  }
899
- const Dr = (s) => new Promise((i) => setTimeout(i, s));
900
- function Qi({ libraryName: s, libraryVersion: i, userAgent: e, publicKey: t = "", integration: r = "" }) {
899
+ const zr = (s) => new Promise((i) => setTimeout(i, s));
900
+ function es({ libraryName: s, libraryVersion: i, userAgent: e, publicKey: t = "", integration: r = "" }) {
901
901
  const n = "JavaScript";
902
902
  if (typeof e == "string")
903
903
  return e;
@@ -912,17 +912,17 @@ function Qi({ libraryName: s, libraryVersion: i, userAgent: e, publicKey: t = ""
912
912
  const o = [s, i, t].filter(Boolean).join("/"), l = [n, r].filter(Boolean).join("; ");
913
913
  return `${o} (${l})`;
914
914
  }
915
- const zr = {
915
+ const Vr = {
916
916
  factor: 2,
917
917
  time: 100
918
918
  };
919
- function Vr(s, i = zr) {
919
+ function Br(s, i = Vr) {
920
920
  let e = 0;
921
921
  function t(r) {
922
922
  const n = Math.round(i.time * i.factor ** e);
923
923
  return r({
924
924
  attempt: e,
925
- retry: (l) => Dr(l ?? n).then(() => (e += 1, t(r)))
925
+ retry: (l) => zr(l ?? n).then(() => (e += 1, t(r)))
926
926
  });
927
927
  }
928
928
  return t(s);
@@ -939,19 +939,19 @@ class Xe extends Vt {
939
939
  const ut = (s, i) => {
940
940
  s && (s.aborted ? Promise.resolve().then(i) : s.addEventListener("abort", () => i(), { once: !0 }));
941
941
  };
942
- class Ae extends Vt {
942
+ class Ee extends Vt {
943
943
  constructor(e = "Request canceled") {
944
944
  super(e);
945
945
  u(this, "isCancel", !0);
946
- this.name = "CancelError", Object.setPrototypeOf(this, Ae.prototype);
946
+ this.name = "CancelError", Object.setPrototypeOf(this, Ee.prototype);
947
947
  }
948
948
  }
949
- const Br = 500, es = ({ check: s, interval: i = Br, timeout: e, signal: t }) => new Promise((r, n) => {
949
+ const jr = 500, ts = ({ check: s, interval: i = jr, timeout: e, signal: t }) => new Promise((r, n) => {
950
950
  let o, l;
951
951
  ut(t, () => {
952
- o && clearTimeout(o), n(new Ae("Poll cancelled"));
952
+ o && clearTimeout(o), n(new Ee("Poll cancelled"));
953
953
  }), e && (l = setTimeout(() => {
954
- o && clearTimeout(o), n(new Ae("Timed out"));
954
+ o && clearTimeout(o), n(new Ee("Timed out"));
955
955
  }, e));
956
956
  const a = () => {
957
957
  try {
@@ -981,14 +981,14 @@ const Br = 500, es = ({ check: s, interval: i = Br, timeout: e, signal: t }) =>
981
981
  maxConcurrentRequests: 4,
982
982
  pollingTimeoutMilliseconds: 1e4,
983
983
  pusherKey: "79ae88bd931ea68464d9"
984
- }, dt = "application/octet-stream", ts = "original", ge = ({ method: s, url: i, data: e, headers: t = {}, signal: r, onProgress: n }) => new Promise((o, l) => {
984
+ }, dt = "application/octet-stream", is = "original", me = ({ method: s, url: i, data: e, headers: t = {}, signal: r, onProgress: n }) => new Promise((o, l) => {
985
985
  const a = new XMLHttpRequest(), c = (s == null ? void 0 : s.toUpperCase()) || "GET";
986
986
  let h = !1;
987
987
  a.open(c, i, !0), t && Object.entries(t).forEach((d) => {
988
988
  const [f, m] = d;
989
989
  typeof m < "u" && !Array.isArray(m) && a.setRequestHeader(f, m);
990
990
  }), a.responseType = "text", ut(r, () => {
991
- h = !0, a.abort(), l(new Ae());
991
+ h = !0, a.abort(), l(new Ee());
992
992
  }), a.onload = () => {
993
993
  if (a.status != 200)
994
994
  l(new Error(`Error ${a.status}: ${a.statusText}`));
@@ -1022,33 +1022,33 @@ const Br = 500, es = ({ check: s, interval: i = Br, timeout: e, signal: t }) =>
1022
1022
  }) : n({ isComputable: !1 });
1023
1023
  }), e ? a.send(e) : a.send();
1024
1024
  });
1025
- function jr(s, ...i) {
1025
+ function Hr(s, ...i) {
1026
1026
  return s;
1027
1027
  }
1028
- const Hr = ({ name: s }) => s ? [s] : [], Wr = jr;
1029
- var qr = () => new FormData();
1030
- const is = (s) => !1, ft = (s) => typeof Blob < "u" && s instanceof Blob, pt = (s) => typeof File < "u" && s instanceof File, mt = (s) => !!s && typeof s == "object" && !Array.isArray(s) && "uri" in s && typeof s.uri == "string", Me = (s) => ft(s) || pt(s) || is() || mt(s), Gr = (s) => typeof s == "string" || typeof s == "number" || typeof s > "u", Xr = (s) => !!s && typeof s == "object" && !Array.isArray(s), Kr = (s) => !!s && typeof s == "object" && "data" in s && Me(s.data);
1031
- function ss(s, i, e) {
1028
+ const Wr = ({ name: s }) => s ? [s] : [], qr = Hr;
1029
+ var Gr = () => new FormData();
1030
+ const ss = (s) => !1, ft = (s) => typeof Blob < "u" && s instanceof Blob, pt = (s) => typeof File < "u" && s instanceof File, mt = (s) => !!s && typeof s == "object" && !Array.isArray(s) && "uri" in s && typeof s.uri == "string", Me = (s) => ft(s) || pt(s) || ss() || mt(s), Xr = (s) => typeof s == "string" || typeof s == "number" || typeof s > "u", Kr = (s) => !!s && typeof s == "object" && !Array.isArray(s), Yr = (s) => !!s && typeof s == "object" && "data" in s && Me(s.data);
1031
+ function rs(s, i, e) {
1032
1032
  if (Array.isArray(e))
1033
1033
  for (const t of e)
1034
- ss(s, `${i}[]`, t);
1035
- else if (Kr(e)) {
1036
- const { name: t, contentType: r } = e, n = Wr(e.data, t, r ?? dt), o = Hr({ name: t, contentType: r });
1034
+ rs(s, `${i}[]`, t);
1035
+ else if (Yr(e)) {
1036
+ const { name: t, contentType: r } = e, n = qr(e.data, t, r ?? dt), o = Wr({ name: t, contentType: r });
1037
1037
  s.push([i, n, ...o]);
1038
- } else if (Xr(e))
1038
+ } else if (Kr(e))
1039
1039
  for (const [t, r] of Object.entries(e))
1040
1040
  typeof r < "u" && s.push([`${i}[${t}]`, String(r)]);
1041
1041
  else
1042
- Gr(e) && e && s.push([i, e.toString()]);
1042
+ Xr(e) && e && s.push([i, e.toString()]);
1043
1043
  }
1044
- function Yr(s) {
1044
+ function Jr(s) {
1045
1045
  const i = [];
1046
1046
  for (const [e, t] of Object.entries(s))
1047
- ss(i, e, t);
1047
+ rs(i, e, t);
1048
1048
  return i;
1049
1049
  }
1050
1050
  function gt(s) {
1051
- const i = qr(), e = Yr(s);
1051
+ const i = Gr(), e = Jr(s);
1052
1052
  for (const t of e) {
1053
1053
  const [r, n, ...o] = t;
1054
1054
  i.append(r, n, ...o);
@@ -1065,58 +1065,58 @@ class D extends Vt {
1065
1065
  this.name = "UploadError", this.message = e, this.code = t, this.request = r, this.response = n, this.headers = o, Object.setPrototypeOf(this, D.prototype);
1066
1066
  }
1067
1067
  }
1068
- const Jr = (s) => {
1068
+ const Zr = (s) => {
1069
1069
  const i = new URLSearchParams();
1070
1070
  for (const [e, t] of Object.entries(s))
1071
1071
  t && typeof t == "object" && !Array.isArray(t) ? Object.entries(t).filter((r) => r[1] ?? !1).forEach((r) => i.set(`${e}[${r[0]}]`, String(r[1]))) : Array.isArray(t) ? t.forEach((r) => {
1072
1072
  i.append(`${e}[]`, r);
1073
1073
  }) : typeof t == "string" && t ? i.set(e, t) : typeof t == "number" && i.set(e, t.toString());
1074
1074
  return i.toString();
1075
- }, le = (s, i, e) => {
1075
+ }, oe = (s, i, e) => {
1076
1076
  const t = new URL(s);
1077
- return t.pathname = (t.pathname + i).replace("//", "/"), e && (t.search = Jr(e)), t.toString();
1077
+ return t.pathname = (t.pathname + i).replace("//", "/"), e && (t.search = Zr(e)), t.toString();
1078
1078
  };
1079
- var Zr = "6.14.1";
1080
- const Qr = "UploadcareUploadClient", en = Zr;
1079
+ var Qr = "6.14.1";
1080
+ const en = "UploadcareUploadClient", tn = Qr;
1081
1081
  function Te(s) {
1082
- return Qi({
1083
- libraryName: Qr,
1084
- libraryVersion: en,
1082
+ return es({
1083
+ libraryName: en,
1084
+ libraryVersion: tn,
1085
1085
  ...s
1086
1086
  });
1087
1087
  }
1088
- const tn = "RequestThrottledError", wi = 15e3, sn = 1e3;
1089
- function rn(s) {
1088
+ const sn = "RequestThrottledError", Ei = 15e3, rn = 1e3;
1089
+ function nn(s) {
1090
1090
  const { headers: i } = s || {};
1091
1091
  if (!i || typeof i["retry-after"] != "string")
1092
- return wi;
1092
+ return Ei;
1093
1093
  const e = parseInt(i["retry-after"], 10);
1094
- return Number.isFinite(e) ? e * 1e3 : wi;
1094
+ return Number.isFinite(e) ? e * 1e3 : Ei;
1095
1095
  }
1096
- function be(s, i) {
1096
+ function ge(s, i) {
1097
1097
  const { retryThrottledRequestMaxTimes: e, retryNetworkErrorMaxTimes: t } = i;
1098
- return Vr(({ attempt: r, retry: n }) => s().catch((o) => {
1099
- if ("response" in o && (o == null ? void 0 : o.code) === tn && r < e)
1100
- return n(rn(o));
1098
+ return Br(({ attempt: r, retry: n }) => s().catch((o) => {
1099
+ if ("response" in o && (o == null ? void 0 : o.code) === sn && r < e)
1100
+ return n(nn(o));
1101
1101
  if (o instanceof Xe && r < t)
1102
- return n((r + 1) * sn);
1102
+ return n((r + 1) * rn);
1103
1103
  throw o;
1104
1104
  }));
1105
1105
  }
1106
- const rs = (s) => {
1106
+ const ns = (s) => {
1107
1107
  let i = "";
1108
1108
  return (ft(s) || pt(s) || mt(s)) && (i = s.type), i || dt;
1109
- }, ns = (s) => {
1109
+ }, os = (s) => {
1110
1110
  let i = "";
1111
- return pt(s) && s.name ? i = s.name : ft(s) || is() ? i = "" : mt(s) && s.name && (i = s.name), i || ts;
1111
+ return pt(s) && s.name ? i = s.name : ft(s) || ss() ? i = "" : mt(s) && s.name && (i = s.name), i || is;
1112
1112
  };
1113
1113
  function Bt(s) {
1114
1114
  return typeof s > "u" || s === "auto" ? "auto" : s ? "1" : "0";
1115
1115
  }
1116
- function nn(s, { publicKey: i, fileName: e, contentType: t, baseURL: r = E.baseURL, secureSignature: n, secureExpire: o, store: l, signal: a, onProgress: c, source: h = "local", integration: d, userAgent: f, retryThrottledRequestMaxTimes: m = E.retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes: p = E.retryNetworkErrorMaxTimes, metadata: g }) {
1117
- return be(() => ge({
1116
+ function on(s, { publicKey: i, fileName: e, contentType: t, baseURL: r = E.baseURL, secureSignature: n, secureExpire: o, store: l, signal: a, onProgress: c, source: h = "local", integration: d, userAgent: f, retryThrottledRequestMaxTimes: m = E.retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes: p = E.retryNetworkErrorMaxTimes, metadata: g }) {
1117
+ return ge(() => me({
1118
1118
  method: "POST",
1119
- url: le(r, "/base/", {
1119
+ url: oe(r, "/base/", {
1120
1120
  jsonerrors: 1
1121
1121
  }),
1122
1122
  headers: {
@@ -1125,8 +1125,8 @@ function nn(s, { publicKey: i, fileName: e, contentType: t, baseURL: r = E.baseU
1125
1125
  data: gt({
1126
1126
  file: {
1127
1127
  data: s,
1128
- name: e || ns(s),
1129
- contentType: t || rs(s)
1128
+ name: e || os(s),
1129
+ contentType: t || ns(s)
1130
1130
  },
1131
1131
  UPLOADCARE_PUB_KEY: i,
1132
1132
  UPLOADCARE_STORE: Bt(l),
@@ -1138,7 +1138,7 @@ function nn(s, { publicKey: i, fileName: e, contentType: t, baseURL: r = E.baseU
1138
1138
  signal: a,
1139
1139
  onProgress: c
1140
1140
  }).then(({ data: A, headers: w, request: C }) => {
1141
- const y = he(JSON.parse(A));
1141
+ const y = ce(JSON.parse(A));
1142
1142
  if ("error" in y)
1143
1143
  throw new D(y.error.content, y.error.errorCode, C, y, w);
1144
1144
  return y;
@@ -1148,13 +1148,13 @@ var Pt;
1148
1148
  (function(s) {
1149
1149
  s.Token = "token", s.FileInfo = "file_info";
1150
1150
  })(Pt || (Pt = {}));
1151
- function on(s, { publicKey: i, baseURL: e = E.baseURL, store: t, fileName: r, checkForUrlDuplicates: n, saveUrlForRecurrentUploads: o, secureSignature: l, secureExpire: a, source: c = "url", signal: h, integration: d, userAgent: f, retryThrottledRequestMaxTimes: m = E.retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes: p = E.retryNetworkErrorMaxTimes, metadata: g }) {
1152
- return be(() => ge({
1151
+ function ln(s, { publicKey: i, baseURL: e = E.baseURL, store: t, fileName: r, checkForUrlDuplicates: n, saveUrlForRecurrentUploads: o, secureSignature: l, secureExpire: a, source: c = "url", signal: h, integration: d, userAgent: f, retryThrottledRequestMaxTimes: m = E.retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes: p = E.retryNetworkErrorMaxTimes, metadata: g }) {
1152
+ return ge(() => me({
1153
1153
  method: "POST",
1154
1154
  headers: {
1155
1155
  "X-UC-User-Agent": Te({ publicKey: i, integration: d, userAgent: f })
1156
1156
  },
1157
- url: le(e, "/from_url/", {
1157
+ url: oe(e, "/from_url/", {
1158
1158
  jsonerrors: 1,
1159
1159
  pub_key: i,
1160
1160
  source_url: s,
@@ -1169,7 +1169,7 @@ function on(s, { publicKey: i, baseURL: e = E.baseURL, store: t, fileName: r, ch
1169
1169
  }),
1170
1170
  signal: h
1171
1171
  }).then(({ data: A, headers: w, request: C }) => {
1172
- const y = he(JSON.parse(A));
1172
+ const y = ce(JSON.parse(A));
1173
1173
  if ("error" in y)
1174
1174
  throw new D(y.error.content, y.error.errorCode, C, y, w);
1175
1175
  return y;
@@ -1179,9 +1179,9 @@ var N;
1179
1179
  (function(s) {
1180
1180
  s.Unknown = "unknown", s.Waiting = "waiting", s.Progress = "progress", s.Error = "error", s.Success = "success";
1181
1181
  })(N || (N = {}));
1182
- const ln = (s) => "status" in s && s.status === N.Error;
1183
- function an(s, { publicKey: i, baseURL: e = E.baseURL, signal: t, integration: r, userAgent: n, retryThrottledRequestMaxTimes: o = E.retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes: l = E.retryNetworkErrorMaxTimes } = {}) {
1184
- return be(() => ge({
1182
+ const an = (s) => "status" in s && s.status === N.Error;
1183
+ function cn(s, { publicKey: i, baseURL: e = E.baseURL, signal: t, integration: r, userAgent: n, retryThrottledRequestMaxTimes: o = E.retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes: l = E.retryNetworkErrorMaxTimes } = {}) {
1184
+ return ge(() => me({
1185
1185
  method: "GET",
1186
1186
  headers: i ? {
1187
1187
  "X-UC-User-Agent": Te({
@@ -1190,25 +1190,25 @@ function an(s, { publicKey: i, baseURL: e = E.baseURL, signal: t, integration: r
1190
1190
  userAgent: n
1191
1191
  })
1192
1192
  } : void 0,
1193
- url: le(e, "/from_url/status/", {
1193
+ url: oe(e, "/from_url/status/", {
1194
1194
  jsonerrors: 1,
1195
1195
  token: s
1196
1196
  }),
1197
1197
  signal: t
1198
1198
  }).then(({ data: a, headers: c, request: h }) => {
1199
- const d = he(JSON.parse(a));
1200
- if ("error" in d && !ln(d))
1199
+ const d = ce(JSON.parse(a));
1200
+ if ("error" in d && !an(d))
1201
1201
  throw new D(d.error.content, d.error.errorCode, h, d, c);
1202
1202
  return d;
1203
1203
  }), { retryNetworkErrorMaxTimes: l, retryThrottledRequestMaxTimes: o });
1204
1204
  }
1205
- function cn(s, { publicKey: i, baseURL: e = E.baseURL, jsonpCallback: t, secureSignature: r, secureExpire: n, signal: o, source: l, integration: a, userAgent: c, retryThrottledRequestMaxTimes: h = E.retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes: d = E.retryNetworkErrorMaxTimes }) {
1206
- return be(() => ge({
1205
+ function hn(s, { publicKey: i, baseURL: e = E.baseURL, jsonpCallback: t, secureSignature: r, secureExpire: n, signal: o, source: l, integration: a, userAgent: c, retryThrottledRequestMaxTimes: h = E.retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes: d = E.retryNetworkErrorMaxTimes }) {
1206
+ return ge(() => me({
1207
1207
  method: "POST",
1208
1208
  headers: {
1209
1209
  "X-UC-User-Agent": Te({ publicKey: i, integration: a, userAgent: c })
1210
1210
  },
1211
- url: le(e, "/group/", {
1211
+ url: oe(e, "/group/", {
1212
1212
  jsonerrors: 1
1213
1213
  }),
1214
1214
  data: gt({
@@ -1221,19 +1221,19 @@ function cn(s, { publicKey: i, baseURL: e = E.baseURL, jsonpCallback: t, secureS
1221
1221
  }),
1222
1222
  signal: o
1223
1223
  }).then(({ data: f, headers: m, request: p }) => {
1224
- const g = he(JSON.parse(f));
1224
+ const g = ce(JSON.parse(f));
1225
1225
  if ("error" in g)
1226
1226
  throw new D(g.error.content, g.error.errorCode, p, g, m);
1227
1227
  return g;
1228
1228
  }), { retryNetworkErrorMaxTimes: d, retryThrottledRequestMaxTimes: h });
1229
1229
  }
1230
- function os(s, { publicKey: i, baseURL: e = E.baseURL, signal: t, source: r, integration: n, userAgent: o, retryThrottledRequestMaxTimes: l = E.retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes: a = E.retryNetworkErrorMaxTimes }) {
1231
- return be(() => ge({
1230
+ function ls(s, { publicKey: i, baseURL: e = E.baseURL, signal: t, source: r, integration: n, userAgent: o, retryThrottledRequestMaxTimes: l = E.retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes: a = E.retryNetworkErrorMaxTimes }) {
1231
+ return ge(() => me({
1232
1232
  method: "GET",
1233
1233
  headers: {
1234
1234
  "X-UC-User-Agent": Te({ publicKey: i, integration: n, userAgent: o })
1235
1235
  },
1236
- url: le(e, "/info/", {
1236
+ url: oe(e, "/info/", {
1237
1237
  jsonerrors: 1,
1238
1238
  pub_key: i,
1239
1239
  file_id: s,
@@ -1241,21 +1241,21 @@ function os(s, { publicKey: i, baseURL: e = E.baseURL, signal: t, source: r, int
1241
1241
  }),
1242
1242
  signal: t
1243
1243
  }).then(({ data: c, headers: h, request: d }) => {
1244
- const f = he(JSON.parse(c));
1244
+ const f = ce(JSON.parse(c));
1245
1245
  if ("error" in f)
1246
1246
  throw new D(f.error.content, f.error.errorCode, d, f, h);
1247
1247
  return f;
1248
1248
  }), { retryThrottledRequestMaxTimes: l, retryNetworkErrorMaxTimes: a });
1249
1249
  }
1250
- function hn(s, { publicKey: i, contentType: e, fileName: t, multipartChunkSize: r = E.multipartChunkSize, baseURL: n = "", secureSignature: o, secureExpire: l, store: a, signal: c, source: h = "local", integration: d, userAgent: f, retryThrottledRequestMaxTimes: m = E.retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes: p = E.retryNetworkErrorMaxTimes, metadata: g }) {
1251
- return be(() => ge({
1250
+ function un(s, { publicKey: i, contentType: e, fileName: t, multipartChunkSize: r = E.multipartChunkSize, baseURL: n = "", secureSignature: o, secureExpire: l, store: a, signal: c, source: h = "local", integration: d, userAgent: f, retryThrottledRequestMaxTimes: m = E.retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes: p = E.retryNetworkErrorMaxTimes, metadata: g }) {
1251
+ return ge(() => me({
1252
1252
  method: "POST",
1253
- url: le(n, "/multipart/start/", { jsonerrors: 1 }),
1253
+ url: oe(n, "/multipart/start/", { jsonerrors: 1 }),
1254
1254
  headers: {
1255
1255
  "X-UC-User-Agent": Te({ publicKey: i, integration: d, userAgent: f })
1256
1256
  },
1257
1257
  data: gt({
1258
- filename: t || ts,
1258
+ filename: t || is,
1259
1259
  size: s,
1260
1260
  content_type: e || dt,
1261
1261
  part_size: r,
@@ -1268,14 +1268,14 @@ function hn(s, { publicKey: i, contentType: e, fileName: t, multipartChunkSize:
1268
1268
  }),
1269
1269
  signal: c
1270
1270
  }).then(({ data: A, headers: w, request: C }) => {
1271
- const y = he(JSON.parse(A));
1271
+ const y = ce(JSON.parse(A));
1272
1272
  if ("error" in y)
1273
1273
  throw new D(y.error.content, y.error.errorCode, C, y, w);
1274
1274
  return y.parts = Object.keys(y.parts).map((U) => y.parts[Number(U)]), y;
1275
1275
  }), { retryThrottledRequestMaxTimes: m, retryNetworkErrorMaxTimes: p });
1276
1276
  }
1277
- function un(s, i, { contentType: e, signal: t, onProgress: r, retryThrottledRequestMaxTimes: n = E.retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes: o = E.retryNetworkErrorMaxTimes }) {
1278
- return be(() => ge({
1277
+ function dn(s, i, { contentType: e, signal: t, onProgress: r, retryThrottledRequestMaxTimes: n = E.retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes: o = E.retryNetworkErrorMaxTimes }) {
1278
+ return ge(() => me({
1279
1279
  method: "PUT",
1280
1280
  url: i,
1281
1281
  data: s,
@@ -1293,10 +1293,10 @@ function un(s, i, { contentType: e, signal: t, onProgress: r, retryThrottledRequ
1293
1293
  retryNetworkErrorMaxTimes: o
1294
1294
  });
1295
1295
  }
1296
- function dn(s, { publicKey: i, baseURL: e = E.baseURL, source: t = "local", signal: r, integration: n, userAgent: o, retryThrottledRequestMaxTimes: l = E.retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes: a = E.retryNetworkErrorMaxTimes }) {
1297
- return be(() => ge({
1296
+ function fn(s, { publicKey: i, baseURL: e = E.baseURL, source: t = "local", signal: r, integration: n, userAgent: o, retryThrottledRequestMaxTimes: l = E.retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes: a = E.retryNetworkErrorMaxTimes }) {
1297
+ return ge(() => me({
1298
1298
  method: "POST",
1299
- url: le(e, "/multipart/complete/", { jsonerrors: 1 }),
1299
+ url: oe(e, "/multipart/complete/", { jsonerrors: 1 }),
1300
1300
  headers: {
1301
1301
  "X-UC-User-Agent": Te({ publicKey: i, integration: n, userAgent: o })
1302
1302
  },
@@ -1307,15 +1307,15 @@ function dn(s, { publicKey: i, baseURL: e = E.baseURL, source: t = "local", sign
1307
1307
  }),
1308
1308
  signal: r
1309
1309
  }).then(({ data: c, headers: h, request: d }) => {
1310
- const f = he(JSON.parse(c));
1310
+ const f = ce(JSON.parse(c));
1311
1311
  if ("error" in f)
1312
1312
  throw new D(f.error.content, f.error.errorCode, d, f, h);
1313
1313
  return f;
1314
1314
  }), { retryThrottledRequestMaxTimes: l, retryNetworkErrorMaxTimes: a });
1315
1315
  }
1316
1316
  function jt(s, { publicKey: i, baseURL: e, source: t, integration: r, userAgent: n, retryThrottledRequestMaxTimes: o, retryNetworkErrorMaxTimes: l, signal: a, onProgress: c }) {
1317
- return es({
1318
- check: (h) => os(s, {
1317
+ return ts({
1318
+ check: (h) => ls(s, {
1319
1319
  publicKey: i,
1320
1320
  baseURL: e,
1321
1321
  signal: h,
@@ -1328,7 +1328,7 @@ function jt(s, { publicKey: i, baseURL: e, source: t, integration: r, userAgent:
1328
1328
  signal: a
1329
1329
  });
1330
1330
  }
1331
- function fn(s) {
1331
+ function pn(s) {
1332
1332
  return "defaultEffects" in s;
1333
1333
  }
1334
1334
  class Fe {
@@ -1348,11 +1348,11 @@ class Fe {
1348
1348
  u(this, "metadata", null);
1349
1349
  u(this, "s3Bucket", null);
1350
1350
  u(this, "defaultEffects", null);
1351
- const { uuid: r, s3Bucket: n } = i, o = le(e, `${r}/`), l = n ? le(`https://${n}.s3.amazonaws.com/`, `${r}/${i.filename}`) : null;
1352
- this.uuid = r, this.name = t || i.filename, this.size = i.size, this.isStored = i.isStored, this.isImage = i.isImage, this.mimeType = i.mimeType, this.cdnUrl = o, this.originalFilename = i.originalFilename, this.imageInfo = i.imageInfo, this.videoInfo = i.videoInfo, this.contentInfo = i.contentInfo, this.metadata = i.metadata || null, this.s3Bucket = n || null, this.s3Url = l, fn(i) && (this.defaultEffects = i.defaultEffects);
1351
+ const { uuid: r, s3Bucket: n } = i, o = oe(e, `${r}/`), l = n ? oe(`https://${n}.s3.amazonaws.com/`, `${r}/${i.filename}`) : null;
1352
+ this.uuid = r, this.name = t || i.filename, this.size = i.size, this.isStored = i.isStored, this.isImage = i.isImage, this.mimeType = i.mimeType, this.cdnUrl = o, this.originalFilename = i.originalFilename, this.imageInfo = i.imageInfo, this.videoInfo = i.videoInfo, this.contentInfo = i.contentInfo, this.metadata = i.metadata || null, this.s3Bucket = n || null, this.s3Url = l, pn(i) && (this.defaultEffects = i.defaultEffects);
1353
1353
  }
1354
1354
  }
1355
- const pn = (s, { publicKey: i, fileName: e, baseURL: t, secureSignature: r, secureExpire: n, store: o, contentType: l, signal: a, onProgress: c, source: h, integration: d, userAgent: f, retryThrottledRequestMaxTimes: m, retryNetworkErrorMaxTimes: p, baseCDN: g, metadata: A }) => nn(s, {
1355
+ const mn = (s, { publicKey: i, fileName: e, baseURL: t, secureSignature: r, secureExpire: n, store: o, contentType: l, signal: a, onProgress: c, source: h, integration: d, userAgent: f, retryThrottledRequestMaxTimes: m, retryNetworkErrorMaxTimes: p, baseCDN: g, metadata: A }) => on(s, {
1356
1356
  publicKey: i,
1357
1357
  fileName: e,
1358
1358
  contentType: l,
@@ -1378,7 +1378,7 @@ const pn = (s, { publicKey: i, fileName: e, baseURL: t, secureSignature: r, secu
1378
1378
  retryNetworkErrorMaxTimes: p,
1379
1379
  onProgress: c,
1380
1380
  signal: a
1381
- })).then((w) => new Fe(w, { baseCDN: g })), mn = (s, { publicKey: i, fileName: e, baseURL: t, signal: r, onProgress: n, source: o, integration: l, userAgent: a, retryThrottledRequestMaxTimes: c, retryNetworkErrorMaxTimes: h, baseCDN: d }) => os(s, {
1381
+ })).then((w) => new Fe(w, { baseCDN: g })), gn = (s, { publicKey: i, fileName: e, baseURL: t, signal: r, onProgress: n, source: o, integration: l, userAgent: a, retryThrottledRequestMaxTimes: c, retryNetworkErrorMaxTimes: h, baseCDN: d }) => ls(s, {
1382
1382
  publicKey: i,
1383
1383
  baseURL: t,
1384
1384
  signal: r,
@@ -1390,7 +1390,7 @@ const pn = (s, { publicKey: i, fileName: e, baseURL: t, secureSignature: r, secu
1390
1390
  }).then((f) => new Fe(f, { baseCDN: d, fileName: e })).then((f) => (n && n({
1391
1391
  isComputable: !0,
1392
1392
  value: 1
1393
- }), f)), gn = (s, { signal: i } = {}) => {
1393
+ }), f)), bn = (s, { signal: i } = {}) => {
1394
1394
  let e = null, t = null;
1395
1395
  const r = s.map(() => new AbortController()), n = (o) => () => {
1396
1396
  t = o, r.forEach((l, a) => a !== o && l.abort());
@@ -1406,8 +1406,8 @@ const pn = (s, { publicKey: i, fileName: e, baseURL: t, secureSignature: r, secu
1406
1406
  return o[t];
1407
1407
  });
1408
1408
  };
1409
- var bn = window.WebSocket;
1410
- class _n {
1409
+ var _n = window.WebSocket;
1410
+ class yn {
1411
1411
  constructor() {
1412
1412
  u(this, "events", /* @__PURE__ */ Object.create({}));
1413
1413
  }
@@ -1422,8 +1422,8 @@ class _n {
1422
1422
  e ? this.events[i] = this.events[i].filter((t) => t !== e) : this.events[i] = [];
1423
1423
  }
1424
1424
  }
1425
- const yn = (s, i) => s === "success" ? { status: N.Success, ...i } : s === "progress" ? { status: N.Progress, ...i } : { status: N.Error, ...i };
1426
- class vn {
1425
+ const vn = (s, i) => s === "success" ? { status: N.Success, ...i } : s === "progress" ? { status: N.Progress, ...i } : { status: N.Error, ...i };
1426
+ class Cn {
1427
1427
  constructor(i, e = 3e4) {
1428
1428
  u(this, "key");
1429
1429
  u(this, "disconnectTime");
@@ -1431,14 +1431,14 @@ class vn {
1431
1431
  u(this, "queue", []);
1432
1432
  u(this, "isConnected", !1);
1433
1433
  u(this, "subscribers", 0);
1434
- u(this, "emmitter", new _n());
1434
+ u(this, "emmitter", new yn());
1435
1435
  u(this, "disconnectTimeoutId", null);
1436
1436
  this.key = i, this.disconnectTime = e;
1437
1437
  }
1438
1438
  connect() {
1439
1439
  if (this.disconnectTimeoutId && clearTimeout(this.disconnectTimeoutId), !this.isConnected && !this.ws) {
1440
1440
  const i = `wss://ws.pusherapp.com/app/${this.key}?protocol=5&client=js&version=1.12.2`;
1441
- this.ws = new bn(i), this.ws.addEventListener("error", (e) => {
1441
+ this.ws = new _n(i), this.ws.addEventListener("error", (e) => {
1442
1442
  this.emmitter.emit("error", new Error(e.message));
1443
1443
  }), this.emmitter.on("connected", () => {
1444
1444
  this.isConnected = !0, this.queue.forEach((e) => this.send(e.event, e.data)), this.queue = [];
@@ -1456,7 +1456,7 @@ class vn {
1456
1456
  case "progress":
1457
1457
  case "success":
1458
1458
  case "fail":
1459
- this.emmitter.emit(t.channel, yn(t.event, JSON.parse(t.data)));
1459
+ this.emmitter.emit(t.channel, vn(t.event, JSON.parse(t.data)));
1460
1460
  }
1461
1461
  });
1462
1462
  }
@@ -1499,15 +1499,15 @@ let Et = null;
1499
1499
  const Ht = (s) => {
1500
1500
  if (!Et) {
1501
1501
  const i = typeof window > "u" ? 0 : 3e4;
1502
- Et = new vn(s, i);
1502
+ Et = new Cn(s, i);
1503
1503
  }
1504
1504
  return Et;
1505
- }, Cn = (s) => {
1505
+ }, wn = (s) => {
1506
1506
  Ht(s).connect();
1507
1507
  };
1508
- function wn({ token: s, publicKey: i, baseURL: e, integration: t, userAgent: r, retryThrottledRequestMaxTimes: n, retryNetworkErrorMaxTimes: o, onProgress: l, signal: a }) {
1509
- return es({
1510
- check: (c) => an(s, {
1508
+ function En({ token: s, publicKey: i, baseURL: e, integration: t, userAgent: r, retryThrottledRequestMaxTimes: n, retryNetworkErrorMaxTimes: o, onProgress: l, signal: a }) {
1509
+ return ts({
1510
+ check: (c) => cn(s, {
1511
1511
  publicKey: i,
1512
1512
  baseURL: e,
1513
1513
  integration: t,
@@ -1540,12 +1540,12 @@ function wn({ token: s, publicKey: i, baseURL: e, integration: t, userAgent: r,
1540
1540
  signal: a
1541
1541
  });
1542
1542
  }
1543
- const En = ({ token: s, pusherKey: i, signal: e, onProgress: t }) => new Promise((r, n) => {
1543
+ const An = ({ token: s, pusherKey: i, signal: e, onProgress: t }) => new Promise((r, n) => {
1544
1544
  const o = Ht(i), l = o.onError(n), a = () => {
1545
1545
  l(), o.unsubscribe(s);
1546
1546
  };
1547
1547
  ut(e, () => {
1548
- a(), n(new Ae("pusher cancelled"));
1548
+ a(), n(new Ee("pusher cancelled"));
1549
1549
  }), o.subscribe(s, (c) => {
1550
1550
  switch (c.status) {
1551
1551
  case N.Progress: {
@@ -1566,7 +1566,7 @@ const En = ({ token: s, pusherKey: i, signal: e, onProgress: t }) => new Promise
1566
1566
  a(), n(new D(c.msg, c.error_code));
1567
1567
  }
1568
1568
  });
1569
- }), An = (s, { publicKey: i, fileName: e, baseURL: t, baseCDN: r, checkForUrlDuplicates: n, saveUrlForRecurrentUploads: o, secureSignature: l, secureExpire: a, store: c, signal: h, onProgress: d, source: f, integration: m, userAgent: p, retryThrottledRequestMaxTimes: g, pusherKey: A = E.pusherKey, metadata: w }) => Promise.resolve(Cn(A)).then(() => on(s, {
1569
+ }), Tn = (s, { publicKey: i, fileName: e, baseURL: t, baseCDN: r, checkForUrlDuplicates: n, saveUrlForRecurrentUploads: o, secureSignature: l, secureExpire: a, store: c, signal: h, onProgress: d, source: f, integration: m, userAgent: p, retryThrottledRequestMaxTimes: g, pusherKey: A = E.pusherKey, metadata: w }) => Promise.resolve(wn(A)).then(() => ln(s, {
1570
1570
  publicKey: i,
1571
1571
  fileName: e,
1572
1572
  baseURL: t,
@@ -1584,8 +1584,8 @@ const En = ({ token: s, pusherKey: i, signal: e, onProgress: t }) => new Promise
1584
1584
  })).catch((C) => {
1585
1585
  const y = Ht(A);
1586
1586
  return y == null || y.disconnect(), Promise.reject(C);
1587
- }).then((C) => C.type === Pt.FileInfo ? C : gn([
1588
- ({ signal: y }) => wn({
1587
+ }).then((C) => C.type === Pt.FileInfo ? C : bn([
1588
+ ({ signal: y }) => En({
1589
1589
  token: C.token,
1590
1590
  publicKey: i,
1591
1591
  baseURL: t,
@@ -1595,7 +1595,7 @@ const En = ({ token: s, pusherKey: i, signal: e, onProgress: t }) => new Promise
1595
1595
  onProgress: d,
1596
1596
  signal: y
1597
1597
  }),
1598
- ({ signal: y }) => En({
1598
+ ({ signal: y }) => An({
1599
1599
  token: C.token,
1600
1600
  pusherKey: A,
1601
1601
  signal: y,
@@ -1613,24 +1613,24 @@ const En = ({ token: s, pusherKey: i, signal: e, onProgress: t }) => new Promise
1613
1613
  retryThrottledRequestMaxTimes: g,
1614
1614
  onProgress: d,
1615
1615
  signal: h
1616
- })).then((C) => new Fe(C, { baseCDN: r })), At = /* @__PURE__ */ new WeakMap(), Tn = async (s) => {
1616
+ })).then((C) => new Fe(C, { baseCDN: r })), At = /* @__PURE__ */ new WeakMap(), $n = async (s) => {
1617
1617
  if (At.has(s))
1618
1618
  return At.get(s);
1619
1619
  const i = await fetch(s.uri).then((e) => e.blob());
1620
1620
  return At.set(s, i), i;
1621
- }, ls = async (s) => {
1621
+ }, as = async (s) => {
1622
1622
  if (pt(s) || ft(s))
1623
1623
  return s.size;
1624
1624
  if (mt(s))
1625
- return (await Tn(s)).size;
1625
+ return (await $n(s)).size;
1626
1626
  throw new Error("Unknown file type. Cannot determine file size.");
1627
- }, $n = (s, i = E.multipartMinFileSize) => s >= i, as = (s) => {
1627
+ }, Sn = (s, i = E.multipartMinFileSize) => s >= i, cs = (s) => {
1628
1628
  const i = "[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}", e = new RegExp(i);
1629
1629
  return !Me(s) && e.test(s);
1630
1630
  }, Wt = (s) => {
1631
1631
  const i = "^(?:\\w+:)?\\/\\/([^\\s\\.]+\\.\\S{2}|localhost[\\:?\\d]*)\\S*$", e = new RegExp(i);
1632
1632
  return !Me(s) && e.test(s);
1633
- }, Sn = (s, i) => new Promise((e, t) => {
1633
+ }, xn = (s, i) => new Promise((e, t) => {
1634
1634
  const r = [];
1635
1635
  let n = !1, o = i.length;
1636
1636
  const l = [...i], a = () => {
@@ -1643,10 +1643,10 @@ const En = ({ token: s, pusherKey: i, signal: e, onProgress: t }) => new Promise
1643
1643
  };
1644
1644
  for (let c = 0; c < s; c++)
1645
1645
  a();
1646
- }), xn = (s, i, e, t) => {
1646
+ }), In = (s, i, e, t) => {
1647
1647
  const r = t * i, n = Math.min(r + t, e);
1648
1648
  return s.slice(r, n);
1649
- }, In = async (s, i, e) => (t) => xn(s, t, i, e), kn = (s, i, { publicKey: e, contentType: t, onProgress: r, signal: n, integration: o, retryThrottledRequestMaxTimes: l, retryNetworkErrorMaxTimes: a }) => un(s, i, {
1649
+ }, kn = async (s, i, e) => (t) => In(s, t, i, e), On = (s, i, { publicKey: e, contentType: t, onProgress: r, signal: n, integration: o, retryThrottledRequestMaxTimes: l, retryNetworkErrorMaxTimes: a }) => dn(s, i, {
1650
1650
  publicKey: e,
1651
1651
  contentType: t,
1652
1652
  onProgress: r,
@@ -1654,25 +1654,25 @@ const En = ({ token: s, pusherKey: i, signal: e, onProgress: t }) => new Promise
1654
1654
  integration: o,
1655
1655
  retryThrottledRequestMaxTimes: l,
1656
1656
  retryNetworkErrorMaxTimes: a
1657
- }), On = async (s, { publicKey: i, fileName: e, fileSize: t, baseURL: r, secureSignature: n, secureExpire: o, store: l, signal: a, onProgress: c, source: h, integration: d, userAgent: f, retryThrottledRequestMaxTimes: m, retryNetworkErrorMaxTimes: p, contentType: g, multipartChunkSize: A = E.multipartChunkSize, maxConcurrentRequests: w = E.maxConcurrentRequests, baseCDN: C, metadata: y }) => {
1658
- const U = t ?? await ls(s);
1659
- let ie;
1660
- const ye = (O, R) => {
1657
+ }), Pn = async (s, { publicKey: i, fileName: e, fileSize: t, baseURL: r, secureSignature: n, secureExpire: o, store: l, signal: a, onProgress: c, source: h, integration: d, userAgent: f, retryThrottledRequestMaxTimes: m, retryNetworkErrorMaxTimes: p, contentType: g, multipartChunkSize: A = E.multipartChunkSize, maxConcurrentRequests: w = E.maxConcurrentRequests, baseCDN: C, metadata: y }) => {
1658
+ const U = t ?? await as(s);
1659
+ let te;
1660
+ const _e = (k, R) => {
1661
1661
  if (!c)
1662
1662
  return;
1663
- ie || (ie = Array(O).fill(0));
1664
- const W = (K) => K.reduce((se, wt) => se + wt, 0);
1663
+ te || (te = Array(k).fill(0));
1664
+ const W = (K) => K.reduce((ie, wt) => ie + wt, 0);
1665
1665
  return (K) => {
1666
- K.isComputable && (ie[R] = K.value, c({
1666
+ K.isComputable && (te[R] = K.value, c({
1667
1667
  isComputable: !0,
1668
- value: W(ie) / O
1668
+ value: W(te) / k
1669
1669
  }));
1670
1670
  };
1671
1671
  };
1672
- return g || (g = rs(s)), hn(U, {
1672
+ return g || (g = ns(s)), un(U, {
1673
1673
  publicKey: i,
1674
1674
  contentType: g,
1675
- fileName: e || ns(s),
1675
+ fileName: e || os(s),
1676
1676
  baseURL: r,
1677
1677
  secureSignature: n,
1678
1678
  secureExpire: o,
@@ -1684,21 +1684,21 @@ const En = ({ token: s, pusherKey: i, signal: e, onProgress: t }) => new Promise
1684
1684
  retryThrottledRequestMaxTimes: m,
1685
1685
  retryNetworkErrorMaxTimes: p,
1686
1686
  metadata: y
1687
- }).then(async ({ uuid: O, parts: R }) => {
1688
- const W = await In(s, U, A);
1687
+ }).then(async ({ uuid: k, parts: R }) => {
1688
+ const W = await kn(s, U, A);
1689
1689
  return Promise.all([
1690
- O,
1691
- Sn(w, R.map((K, se) => () => kn(W(se), K, {
1690
+ k,
1691
+ xn(w, R.map((K, ie) => () => On(W(ie), K, {
1692
1692
  publicKey: i,
1693
1693
  contentType: g,
1694
- onProgress: ye(R.length, se),
1694
+ onProgress: _e(R.length, ie),
1695
1695
  signal: a,
1696
1696
  integration: d,
1697
1697
  retryThrottledRequestMaxTimes: m,
1698
1698
  retryNetworkErrorMaxTimes: p
1699
1699
  })))
1700
1700
  ]);
1701
- }).then(([O]) => dn(O, {
1701
+ }).then(([k]) => fn(k, {
1702
1702
  publicKey: i,
1703
1703
  baseURL: r,
1704
1704
  source: h,
@@ -1706,7 +1706,7 @@ const En = ({ token: s, pusherKey: i, signal: e, onProgress: t }) => new Promise
1706
1706
  userAgent: f,
1707
1707
  retryThrottledRequestMaxTimes: m,
1708
1708
  retryNetworkErrorMaxTimes: p
1709
- })).then((O) => O.isReady ? O : jt(O.uuid, {
1709
+ })).then((k) => k.isReady ? k : jt(k.uuid, {
1710
1710
  publicKey: i,
1711
1711
  baseURL: r,
1712
1712
  source: h,
@@ -1716,16 +1716,16 @@ const En = ({ token: s, pusherKey: i, signal: e, onProgress: t }) => new Promise
1716
1716
  retryNetworkErrorMaxTimes: p,
1717
1717
  onProgress: c,
1718
1718
  signal: a
1719
- })).then((O) => new Fe(O, { baseCDN: C }));
1719
+ })).then((k) => new Fe(k, { baseCDN: C }));
1720
1720
  };
1721
- async function cs(s, { publicKey: i, fileName: e, baseURL: t = E.baseURL, secureSignature: r, secureExpire: n, store: o, signal: l, onProgress: a, source: c, integration: h, userAgent: d, retryThrottledRequestMaxTimes: f, retryNetworkErrorMaxTimes: m, contentType: p, multipartMinFileSize: g, multipartChunkSize: A, maxConcurrentRequests: w, baseCDN: C = E.baseCDN, checkForUrlDuplicates: y, saveUrlForRecurrentUploads: U, pusherKey: ie, metadata: ye }) {
1721
+ async function hs(s, { publicKey: i, fileName: e, baseURL: t = E.baseURL, secureSignature: r, secureExpire: n, store: o, signal: l, onProgress: a, source: c, integration: h, userAgent: d, retryThrottledRequestMaxTimes: f, retryNetworkErrorMaxTimes: m, contentType: p, multipartMinFileSize: g, multipartChunkSize: A, maxConcurrentRequests: w, baseCDN: C = E.baseCDN, checkForUrlDuplicates: y, saveUrlForRecurrentUploads: U, pusherKey: te, metadata: _e }) {
1722
1722
  if (Me(s)) {
1723
- const O = await ls(s);
1724
- return $n(O, g) ? On(s, {
1723
+ const k = await as(s);
1724
+ return Sn(k, g) ? Pn(s, {
1725
1725
  publicKey: i,
1726
1726
  contentType: p,
1727
1727
  multipartChunkSize: A,
1728
- fileSize: O,
1728
+ fileSize: k,
1729
1729
  fileName: e,
1730
1730
  baseURL: t,
1731
1731
  secureSignature: r,
@@ -1740,8 +1740,8 @@ async function cs(s, { publicKey: i, fileName: e, baseURL: t = E.baseURL, secure
1740
1740
  retryThrottledRequestMaxTimes: f,
1741
1741
  retryNetworkErrorMaxTimes: m,
1742
1742
  baseCDN: C,
1743
- metadata: ye
1744
- }) : pn(s, {
1743
+ metadata: _e
1744
+ }) : mn(s, {
1745
1745
  publicKey: i,
1746
1746
  fileName: e,
1747
1747
  contentType: p,
@@ -1757,11 +1757,11 @@ async function cs(s, { publicKey: i, fileName: e, baseURL: t = E.baseURL, secure
1757
1757
  retryThrottledRequestMaxTimes: f,
1758
1758
  retryNetworkErrorMaxTimes: m,
1759
1759
  baseCDN: C,
1760
- metadata: ye
1760
+ metadata: _e
1761
1761
  });
1762
1762
  }
1763
1763
  if (Wt(s))
1764
- return An(s, {
1764
+ return Tn(s, {
1765
1765
  publicKey: i,
1766
1766
  fileName: e,
1767
1767
  baseURL: t,
@@ -1778,11 +1778,11 @@ async function cs(s, { publicKey: i, fileName: e, baseURL: t = E.baseURL, secure
1778
1778
  userAgent: d,
1779
1779
  retryThrottledRequestMaxTimes: f,
1780
1780
  retryNetworkErrorMaxTimes: m,
1781
- pusherKey: ie,
1782
- metadata: ye
1781
+ pusherKey: te,
1782
+ metadata: _e
1783
1783
  });
1784
- if (as(s))
1785
- return mn(s, {
1784
+ if (cs(s))
1785
+ return gn(s, {
1786
1786
  publicKey: i,
1787
1787
  fileName: e,
1788
1788
  baseURL: t,
@@ -1797,7 +1797,7 @@ async function cs(s, { publicKey: i, fileName: e, baseURL: t = E.baseURL, secure
1797
1797
  });
1798
1798
  throw new TypeError(`File uploading from "${s}" is not supported`);
1799
1799
  }
1800
- class Pn {
1800
+ class Ln {
1801
1801
  constructor(i, { baseCDN: e = E.baseCDN } = {}) {
1802
1802
  u(this, "uuid");
1803
1803
  u(this, "filesCount");
@@ -1813,40 +1813,40 @@ class Pn {
1813
1813
  this.totalSize = Object.values(t).reduce((r, n) => r + n.size, 0), this.isStored = !!i.datetimeStored, this.isImage = !!Object.values(t).filter((r) => r.isImage).length, this.cdnUrl = i.cdnUrl, this.files = t.map((r) => new Fe(r, { baseCDN: e })), this.createdAt = i.datetimeCreated, this.storedAt = i.datetimeStored;
1814
1814
  }
1815
1815
  }
1816
- const Ln = (s) => {
1816
+ const Un = (s) => {
1817
1817
  for (const i of s)
1818
1818
  if (!Me(i))
1819
1819
  return !1;
1820
1820
  return !0;
1821
- }, Un = (s) => {
1821
+ }, Rn = (s) => {
1822
1822
  for (const i of s)
1823
- if (!as(i))
1823
+ if (!cs(i))
1824
1824
  return !1;
1825
1825
  return !0;
1826
- }, Rn = (s) => {
1826
+ }, Mn = (s) => {
1827
1827
  for (const i of s)
1828
1828
  if (!Wt(i))
1829
1829
  return !1;
1830
1830
  return !0;
1831
1831
  };
1832
- function Mn(s, { publicKey: i, fileName: e, baseURL: t = E.baseURL, secureSignature: r, secureExpire: n, store: o, signal: l, onProgress: a, source: c, integration: h, userAgent: d, retryThrottledRequestMaxTimes: f, retryNetworkErrorMaxTimes: m, contentType: p, multipartChunkSize: g = E.multipartChunkSize, baseCDN: A = E.baseCDN, checkForUrlDuplicates: w, saveUrlForRecurrentUploads: C, jsonpCallback: y }) {
1833
- if (!Ln(s) && !Rn(s) && !Un(s))
1832
+ function Fn(s, { publicKey: i, fileName: e, baseURL: t = E.baseURL, secureSignature: r, secureExpire: n, store: o, signal: l, onProgress: a, source: c, integration: h, userAgent: d, retryThrottledRequestMaxTimes: f, retryNetworkErrorMaxTimes: m, contentType: p, multipartChunkSize: g = E.multipartChunkSize, baseCDN: A = E.baseCDN, checkForUrlDuplicates: w, saveUrlForRecurrentUploads: C, jsonpCallback: y }) {
1833
+ if (!Un(s) && !Mn(s) && !Rn(s))
1834
1834
  throw new TypeError(`Group uploading from "${s}" is not supported`);
1835
- let U, ie = !0;
1836
- const ye = s.length, O = (R, W) => {
1835
+ let U, te = !0;
1836
+ const _e = s.length, k = (R, W) => {
1837
1837
  if (!a)
1838
1838
  return;
1839
1839
  U || (U = Array(R).fill(0));
1840
- const K = (se) => se.reduce((wt, ar) => wt + ar) / R;
1841
- return (se) => {
1842
- if (!se.isComputable || !ie) {
1843
- ie = !1, a({ isComputable: !1 });
1840
+ const K = (ie) => ie.reduce((wt, cr) => wt + cr) / R;
1841
+ return (ie) => {
1842
+ if (!ie.isComputable || !te) {
1843
+ te = !1, a({ isComputable: !1 });
1844
1844
  return;
1845
1845
  }
1846
- U[W] = se.value, a({ isComputable: !0, value: K(U) });
1846
+ U[W] = ie.value, a({ isComputable: !0, value: K(U) });
1847
1847
  };
1848
1848
  };
1849
- return Promise.all(s.map((R, W) => Me(R) || Wt(R) ? cs(R, {
1849
+ return Promise.all(s.map((R, W) => Me(R) || Wt(R) ? hs(R, {
1850
1850
  publicKey: i,
1851
1851
  fileName: e,
1852
1852
  baseURL: t,
@@ -1854,7 +1854,7 @@ function Mn(s, { publicKey: i, fileName: e, baseURL: t = E.baseURL, secureSignat
1854
1854
  secureExpire: n,
1855
1855
  store: o,
1856
1856
  signal: l,
1857
- onProgress: O(ye, W),
1857
+ onProgress: k(_e, W),
1858
1858
  source: c,
1859
1859
  integration: h,
1860
1860
  userAgent: d,
@@ -1865,7 +1865,7 @@ function Mn(s, { publicKey: i, fileName: e, baseURL: t = E.baseURL, secureSignat
1865
1865
  baseCDN: A,
1866
1866
  checkForUrlDuplicates: w,
1867
1867
  saveUrlForRecurrentUploads: C
1868
- }).then((K) => K.uuid) : R)).then((R) => cn(R, {
1868
+ }).then((K) => K.uuid) : R)).then((R) => hn(R, {
1869
1869
  publicKey: i,
1870
1870
  baseURL: t,
1871
1871
  jsonpCallback: y,
@@ -1877,9 +1877,9 @@ function Mn(s, { publicKey: i, fileName: e, baseURL: t = E.baseURL, secureSignat
1877
1877
  userAgent: d,
1878
1878
  retryThrottledRequestMaxTimes: f,
1879
1879
  retryNetworkErrorMaxTimes: m
1880
- }).then((W) => new Pn(W, { baseCDN: A })).then((W) => (a && a({ isComputable: !0, value: 1 }), W)));
1880
+ }).then((W) => new Ln(W, { baseCDN: A })).then((W) => (a && a({ isComputable: !0, value: 1 }), W)));
1881
1881
  }
1882
- class Fn {
1882
+ class Nn {
1883
1883
  constructor(i) {
1884
1884
  u(this, "_concurrency", 1);
1885
1885
  u(this, "_pending", []);
@@ -1920,13 +1920,13 @@ class Fn {
1920
1920
  return this._concurrency;
1921
1921
  }
1922
1922
  }
1923
- const hs = () => ({
1923
+ const us = () => ({
1924
1924
  /** @type {Set<import('./Block').Block>} */
1925
1925
  "*blocksRegistry": /* @__PURE__ */ new Set(),
1926
1926
  /** @type {import('../blocks/UploadCtxProvider/EventEmitter.js').EventEmitter | null} */
1927
1927
  "*eventEmitter": null
1928
- }), us = (s) => ({
1929
- ...hs(),
1928
+ }), ds = (s) => ({
1929
+ ...us(),
1930
1930
  "*currentActivity": "",
1931
1931
  "*currentActivityParams": {},
1932
1932
  "*history": [],
@@ -1937,13 +1937,13 @@ const hs = () => ({
1937
1937
  "*currentActivity": ""
1938
1938
  });
1939
1939
  }
1940
- }), ds = (s) => ({
1941
- ...us(s),
1940
+ }), fs = (s) => ({
1941
+ ...ds(s),
1942
1942
  "*commonProgress": 0,
1943
1943
  "*uploadList": [],
1944
1944
  "*focusedEntry": null,
1945
1945
  "*uploadMetadata": null,
1946
- "*uploadQueue": new Fn(1),
1946
+ "*uploadQueue": new Nn(1),
1947
1947
  "*uploadCollection": null,
1948
1948
  /** @type {ReturnType<import('../utils/buildOutputError.js').buildCollectionFileError>[]} */
1949
1949
  "*collectionErrors": [],
@@ -1954,7 +1954,7 @@ const hs = () => ({
1954
1954
  /** @type {Set<string>} */
1955
1955
  "*uploadTrigger": /* @__PURE__ */ new Set()
1956
1956
  });
1957
- function Nn(s, i) {
1957
+ function Dn(s, i) {
1958
1958
  [...s.querySelectorAll("[l10n]")].forEach((e) => {
1959
1959
  let t = e.getAttribute("l10n"), r = "textContent";
1960
1960
  if (t.includes(":")) {
@@ -1968,14 +1968,14 @@ function Nn(s, i) {
1968
1968
  });
1969
1969
  }
1970
1970
  const z = (s) => `*cfg/${s}`, Tt = "lr-";
1971
- class k extends ht {
1971
+ class I extends ht {
1972
1972
  constructor() {
1973
1973
  super();
1974
1974
  u(this, "requireCtxName", !1);
1975
1975
  u(this, "allowCustomTemplate", !0);
1976
1976
  /** @type {import('./ActivityBlock.js').ActivityType} */
1977
1977
  u(this, "activityType", null);
1978
- u(this, "init$", hs());
1978
+ u(this, "init$", us());
1979
1979
  /** @deprecated */
1980
1980
  u(this, "updateCtxCssData", () => {
1981
1981
  ot(
@@ -1985,7 +1985,7 @@ class k extends ht {
1985
1985
  for (let t of e)
1986
1986
  t.isConnected && t.updateCssData();
1987
1987
  });
1988
- this.addTemplateProcessor(Nn), this.__l10nKeys = [];
1988
+ this.addTemplateProcessor(Dn), this.__l10nKeys = [];
1989
1989
  }
1990
1990
  /**
1991
1991
  * @param {String} str
@@ -1995,7 +1995,7 @@ class k extends ht {
1995
1995
  l10n(e, t = {}) {
1996
1996
  if (!e)
1997
1997
  return "";
1998
- let r = this.getCssData("--l10n-" + e, !0) || e, n = Mr(r);
1998
+ let r = this.getCssData("--l10n-" + e, !0) || e, n = Fr(r);
1999
1999
  for (let l of n)
2000
2000
  t[l.variable] = this.pluralize(
2001
2001
  l.pluralKey,
@@ -2009,7 +2009,7 @@ class k extends ht {
2009
2009
  * @returns {string}
2010
2010
  */
2011
2011
  pluralize(e, t) {
2012
- const r = this.l10n("locale-name") || "en-US", n = Yi(r, t);
2012
+ const r = this.l10n("locale-name") || "en-US", n = Ji(r, t);
2013
2013
  return this.l10n(`${e}__${n}`);
2014
2014
  }
2015
2015
  /**
@@ -2066,7 +2066,7 @@ class k extends ht {
2066
2066
  /** @type {typeof Block} */
2067
2067
  this.constructor.className
2068
2068
  );
2069
- e && this.classList.toggle(`${Tt}${e}`, !0), this.hasAttribute("retpl") && (this.constructor.template = null, this.processInnerHtml = !0), this.requireCtxName ? Zi({
2069
+ e && this.classList.toggle(`${Tt}${e}`, !0), this.hasAttribute("retpl") && (this.constructor.template = null, this.processInnerHtml = !0), this.requireCtxName ? Qi({
2070
2070
  element: this,
2071
2071
  attribute: "ctx-name",
2072
2072
  onSuccess: () => {
@@ -2081,7 +2081,7 @@ class k extends ht {
2081
2081
  super.disconnectedCallback(), nt.unregisterClient(this);
2082
2082
  }
2083
2083
  initCallback() {
2084
- this.$["*blocksRegistry"].add(this), this.$["*eventEmitter"] || (this.$["*eventEmitter"] = new Ur(this.debugPrint.bind(this)));
2084
+ this.$["*blocksRegistry"].add(this), this.$["*eventEmitter"] || (this.$["*eventEmitter"] = new Rr(this.debugPrint.bind(this)));
2085
2085
  }
2086
2086
  destroyCallback() {
2087
2087
  let e = this.$["*blocksRegistry"];
@@ -2152,7 +2152,7 @@ class k extends ht {
2152
2152
  const n = z(r), o = this.parseCfgProp(n);
2153
2153
  return o.ctx.has(o.name) ? o.ctx.read(o.name) : (ot(
2154
2154
  "Using CSS variables for configuration is deprecated. Please use `lr-config` instead. See migration guide: https://uploadcare.com/docs/file-uploader/migration-to-0.25.0/"
2155
- ), this.getCssData(`--cfg-${we(r)}`));
2155
+ ), this.getCssData(`--cfg-${Ce(r)}`));
2156
2156
  }
2157
2157
  });
2158
2158
  }
@@ -2165,7 +2165,7 @@ class k extends ht {
2165
2165
  */
2166
2166
  subConfigValue(e, t) {
2167
2167
  const r = this.parseCfgProp(z(e));
2168
- r.ctx.has(r.name) ? this.sub(z(e), t) : (this.bindCssData(`--cfg-${we(e)}`), this.sub(`--cfg-${we(e)}`, t));
2168
+ r.ctx.has(r.name) ? this.sub(z(e), t) : (this.bindCssData(`--cfg-${Ce(e)}`), this.sub(`--cfg-${Ce(e)}`, t));
2169
2169
  }
2170
2170
  /** @param {unknown[]} args */
2171
2171
  debugPrint(...e) {
@@ -2191,25 +2191,25 @@ class k extends ht {
2191
2191
  }
2192
2192
  }
2193
2193
  /** @type {string | null} */
2194
- u(k, "StateConsumerScope", null), u(k, "className", "");
2195
- const Ei = "active", De = "___ACTIVITY_IS_ACTIVE___", G = class G extends k {
2194
+ u(I, "StateConsumerScope", null), u(I, "className", "");
2195
+ const Ai = "active", De = "___ACTIVITY_IS_ACTIVE___", G = class G extends I {
2196
2196
  constructor() {
2197
2197
  super(...arguments);
2198
2198
  u(this, "historyTracked", !1);
2199
- u(this, "init$", us(this));
2199
+ u(this, "init$", ds(this));
2200
2200
  u(this, "_debouncedHistoryFlush", H(this._historyFlush.bind(this), 10));
2201
2201
  }
2202
2202
  /** @private */
2203
2203
  _deactivate() {
2204
2204
  var t;
2205
2205
  let e = G._activityRegistry[this.activityKey];
2206
- this[De] = !1, this.removeAttribute(Ei), (t = e == null ? void 0 : e.deactivateCallback) == null || t.call(e);
2206
+ this[De] = !1, this.removeAttribute(Ai), (t = e == null ? void 0 : e.deactivateCallback) == null || t.call(e);
2207
2207
  }
2208
2208
  /** @private */
2209
2209
  _activate() {
2210
2210
  var t;
2211
2211
  let e = G._activityRegistry[this.activityKey];
2212
- this.$["*historyBack"] = this.historyBack.bind(this), this[De] = !0, this.setAttribute(Ei, ""), (t = e == null ? void 0 : e.activateCallback) == null || t.call(e), this._debouncedHistoryFlush(), this.emit(S.ACTIVITY_CHANGE, {
2212
+ this.$["*historyBack"] = this.historyBack.bind(this), this[De] = !0, this.setAttribute(Ai, ""), (t = e == null ? void 0 : e.activateCallback) == null || t.call(e), this._debouncedHistoryFlush(), this.emit(S.ACTIVITY_CHANGE, {
2213
2213
  activity: this.activityType
2214
2214
  });
2215
2215
  }
@@ -2304,7 +2304,7 @@ b.activities = Object.freeze({
2304
2304
  EXTERNAL: "external",
2305
2305
  DETAILS: "details"
2306
2306
  });
2307
- const Dn = 20, Lt = 24, He = 34, fs = 3, Z = fs / 2, ve = 1, Je = 100 / 3, v = 1, Ai = 24, zn = 6;
2307
+ const zn = 20, Lt = 24, He = 34, ps = 3, Z = ps / 2, ye = 1, Je = 100 / 3, v = 1, Ti = 24, Vn = 6;
2308
2308
  function Ie(s, i) {
2309
2309
  for (let e in i)
2310
2310
  s.setAttributeNS(null, e, i[e].toString());
@@ -2313,7 +2313,7 @@ function q(s, i = {}) {
2313
2313
  let e = document.createElementNS("http://www.w3.org/2000/svg", s);
2314
2314
  return Ie(e, i), e;
2315
2315
  }
2316
- function Vn(s, i, e) {
2316
+ function Bn(s, i, e) {
2317
2317
  let { x: t, y: r, width: n, height: o } = s, l = i.includes("w") ? 0 : 1, a = i.includes("n") ? 0 : 1, c = [-1, 1][l], h = [-1, 1][a], d = [
2318
2318
  t + l * n + Z * c,
2319
2319
  r + a * o + Z * h - Lt * e * h
@@ -2326,7 +2326,7 @@ function Vn(s, i, e) {
2326
2326
  center: f
2327
2327
  };
2328
2328
  }
2329
- function Bn(s, i, e) {
2329
+ function jn(s, i, e) {
2330
2330
  let { x: t, y: r, width: n, height: o } = s, l = ["n", "s"].includes(i) ? 0.5 : { w: 0, e: 1 }[
2331
2331
  /** @type {Extract<import('./types.js').Direction, 'w' | 'e'>} */
2332
2332
  i
@@ -2338,10 +2338,10 @@ function Bn(s, i, e) {
2338
2338
  let m = `M ${d[0]} ${d[1]} L ${f[0]} ${f[1]}`, p = [f[0] - (f[0] - d[0]) / 2, f[1] - (f[1] - d[1]) / 2];
2339
2339
  return { d: m, center: p };
2340
2340
  }
2341
- function jn(s) {
2341
+ function Hn(s) {
2342
2342
  return s === "" ? "move" : ["e", "w"].includes(s) ? "ew-resize" : ["n", "s"].includes(s) ? "ns-resize" : ["nw", "se"].includes(s) ? "nwse-resize" : "nesw-resize";
2343
2343
  }
2344
- function Hn({ rect: s, delta: [i, e], imageBox: t }) {
2344
+ function Wn({ rect: s, delta: [i, e], imageBox: t }) {
2345
2345
  return lt(
2346
2346
  {
2347
2347
  ...s,
@@ -2359,86 +2359,86 @@ function lt(s, i) {
2359
2359
  y: t
2360
2360
  };
2361
2361
  }
2362
- function Wn({ rect: s, delta: i, aspectRatio: e, imageBox: t }) {
2362
+ function qn({ rect: s, delta: i, aspectRatio: e, imageBox: t }) {
2363
2363
  const [, r] = i;
2364
2364
  let { y: n, width: o, height: l } = s;
2365
2365
  n += r, l -= r, e && (o = l * e);
2366
2366
  let a = s.x + s.width / 2 - o / 2;
2367
2367
  return n <= t.y && (n = t.y, l = s.y + s.height - n, e && (o = l * e, a = s.x + s.width / 2 - o / 2)), a <= t.x && (a = t.x, n = s.y + s.height - l), a + o >= t.x + t.width && (a = Math.max(t.x, t.x + t.width - o), o = t.x + t.width - a, e && (l = o / e), n = s.y + s.height - l), l < v && (l = v, e && (o = l * e, a = s.x + s.width / 2 - o / 2), n = s.y + s.height - l), o < v && (o = v, e && (l = o / e, a = s.x + s.width / 2 - o / 2), n = s.y + s.height - l), { x: a, y: n, width: o, height: l };
2368
2368
  }
2369
- function qn({ rect: s, delta: i, aspectRatio: e, imageBox: t }) {
2369
+ function Gn({ rect: s, delta: i, aspectRatio: e, imageBox: t }) {
2370
2370
  const [r] = i;
2371
2371
  let { x: n, width: o, height: l } = s;
2372
2372
  n += r, o -= r, e && (l = o / e);
2373
2373
  let a = s.y + s.height / 2 - l / 2;
2374
2374
  return n <= t.x && (n = t.x, o = s.x + s.width - n, e && (l = o / e, a = s.y + s.height / 2 - l / 2)), a <= t.y && (a = t.y, n = s.x + s.width - o), a + l >= t.y + t.height && (a = Math.max(t.y, t.y + t.height - l), l = t.y + t.height - a, e && (o = l * e), n = s.x + s.width - o), l < v && (l = v, e && (o = l * e), a = s.y + s.height / 2 - l / 2, n = s.x + s.width - o), o < v && (o = v, e && (l = o / e), a = s.y + s.height / 2 - l / 2, n = s.x + s.width - o), { x: n, y: a, width: o, height: l };
2375
2375
  }
2376
- function Gn({ rect: s, delta: i, aspectRatio: e, imageBox: t }) {
2376
+ function Xn({ rect: s, delta: i, aspectRatio: e, imageBox: t }) {
2377
2377
  const [, r] = i;
2378
2378
  let { y: n, width: o, height: l } = s;
2379
2379
  l += r, e && (o = l * e);
2380
2380
  let a = s.x + s.width / 2 - o / 2;
2381
2381
  return n + l >= t.y + t.height && (l = t.y + t.height - n, e && (o = l * e), a = s.x + s.width / 2 - o / 2), a <= t.x && (a = t.x, n = s.y), a + o >= t.x + t.width && (a = Math.max(t.x, t.x + t.width - o), o = t.x + t.width - a, e && (l = o / e), n = s.y), l < v && (l = v, e && (o = l * e), a = s.x + s.width / 2 - o / 2), o < v && (o = v, e && (l = o / e), a = s.x + s.width / 2 - o / 2), { x: a, y: n, width: o, height: l };
2382
2382
  }
2383
- function Xn({ rect: s, delta: i, aspectRatio: e, imageBox: t }) {
2383
+ function Kn({ rect: s, delta: i, aspectRatio: e, imageBox: t }) {
2384
2384
  const [r] = i;
2385
2385
  let { x: n, width: o, height: l } = s;
2386
2386
  o += r, e && (l = o / e);
2387
2387
  let a = s.y + s.height / 2 - l / 2;
2388
2388
  return n + o >= t.x + t.width && (o = t.x + t.width - n, e && (l = o / e), a = s.y + s.height / 2 - l / 2), a <= t.y && (a = t.y, n = s.x), a + l >= t.y + t.height && (a = Math.max(t.y, t.y + t.height - l), l = t.y + t.height - a, e && (o = l * e), n = s.x), l < v && (l = v, e && (o = l * e), a = s.y + s.height / 2 - l / 2), o < v && (o = v, e && (l = o / e), a = s.y + s.height / 2 - l / 2), { x: n, y: a, width: o, height: l };
2389
2389
  }
2390
- function Kn({ rect: s, delta: i, aspectRatio: e, imageBox: t }) {
2390
+ function Yn({ rect: s, delta: i, aspectRatio: e, imageBox: t }) {
2391
2391
  let [r, n] = i, { x: o, y: l, width: a, height: c } = s;
2392
2392
  return o + r < t.x && (r = t.x - o), l + n < t.y && (n = t.y - l), o += r, a -= r, l += n, c -= n, e && Math.abs(a / c) > e ? (n = a / e - c, c += n, l -= n, l <= t.y && (c = c - (t.y - l), a = c * e, o = s.x + s.width - a, l = t.y)) : e && (r = c * e - a, a = a + r, o -= r, o <= t.x && (a = a - (t.x - o), c = a / e, o = t.x, l = s.y + s.height - c)), c < v && (c = v, e && (a = c * e), o = s.x + s.width - a, l = s.y + s.height - c), a < v && (a = v, e && (c = a / e), o = s.x + s.width - a, l = s.y + s.height - c), { x: o, y: l, width: a, height: c };
2393
2393
  }
2394
- function Yn({ rect: s, delta: i, aspectRatio: e, imageBox: t }) {
2394
+ function Jn({ rect: s, delta: i, aspectRatio: e, imageBox: t }) {
2395
2395
  let [r, n] = i, { x: o, y: l, width: a, height: c } = s;
2396
2396
  return o + a + r > t.x + t.width && (r = t.x + t.width - o - a), l + n < t.y && (n = t.y - l), a += r, l += n, c -= n, e && Math.abs(a / c) > e ? (n = a / e - c, c += n, l -= n, l <= t.y && (c = c - (t.y - l), a = c * e, o = s.x, l = t.y)) : e && (r = c * e - a, a += r, o + a >= t.x + t.width && (a = t.x + t.width - o, c = a / e, o = t.x + t.width - a, l = s.y + s.height - c)), c < v && (c = v, e && (a = c * e), l = s.y + s.height - c), a < v && (a = v, e && (c = a / e), l = s.y + s.height - c), { x: o, y: l, width: a, height: c };
2397
2397
  }
2398
- function Jn({ rect: s, delta: i, aspectRatio: e, imageBox: t }) {
2398
+ function Zn({ rect: s, delta: i, aspectRatio: e, imageBox: t }) {
2399
2399
  let [r, n] = i, { x: o, y: l, width: a, height: c } = s;
2400
2400
  return o + r < t.x && (r = t.x - o), l + c + n > t.y + t.height && (n = t.y + t.height - l - c), o += r, a -= r, c += n, e && Math.abs(a / c) > e ? (n = a / e - c, c += n, l + c >= t.y + t.height && (c = t.y + t.height - l, a = c * e, o = s.x + s.width - a, l = t.y + t.height - c)) : e && (r = c * e - a, a += r, o -= r, o <= t.x && (a = a - (t.x - o), c = a / e, o = t.x, l = s.y)), c < v && (c = v, e && (a = c * e), o = s.x + s.width - a), a < v && (a = v, e && (c = a / e), o = s.x + s.width - a), { x: o, y: l, width: a, height: c };
2401
2401
  }
2402
- function Zn({ rect: s, delta: i, aspectRatio: e, imageBox: t }) {
2402
+ function Qn({ rect: s, delta: i, aspectRatio: e, imageBox: t }) {
2403
2403
  let [r, n] = i, { x: o, y: l, width: a, height: c } = s;
2404
2404
  return o + a + r > t.x + t.width && (r = t.x + t.width - o - a), l + c + n > t.y + t.height && (n = t.y + t.height - l - c), a += r, c += n, e && Math.abs(a / c) > e ? (n = a / e - c, c += n, l + c >= t.y + t.height && (c = t.y + t.height - l, a = c * e, o = s.x, l = t.y + t.height - c)) : e && (r = c * e - a, a += r, o + a >= t.x + t.width && (a = t.x + t.width - o, c = a / e, o = t.x + t.width - a, l = s.y)), c < v && (c = v, e && (a = c * e)), a < v && (a = v, e && (c = a / e)), { x: o, y: l, width: a, height: c };
2405
2405
  }
2406
- function Qn({ direction: s, ...i }) {
2406
+ function eo({ direction: s, ...i }) {
2407
2407
  switch (s) {
2408
2408
  case "n":
2409
- return Wn(i);
2410
- case "w":
2411
2409
  return qn(i);
2412
- case "s":
2410
+ case "w":
2413
2411
  return Gn(i);
2414
- case "e":
2412
+ case "s":
2415
2413
  return Xn(i);
2416
- case "nw":
2414
+ case "e":
2417
2415
  return Kn(i);
2418
- case "ne":
2416
+ case "nw":
2419
2417
  return Yn(i);
2420
- case "sw":
2418
+ case "ne":
2421
2419
  return Jn(i);
2422
- case "se":
2420
+ case "sw":
2423
2421
  return Zn(i);
2422
+ case "se":
2423
+ return Qn(i);
2424
2424
  default:
2425
2425
  return i.rect;
2426
2426
  }
2427
2427
  }
2428
- function eo(s, [i, e]) {
2428
+ function to(s, [i, e]) {
2429
2429
  return s.x <= i && i <= s.x + s.width && s.y <= e && e <= s.y + s.height;
2430
2430
  }
2431
- function to(s, i) {
2431
+ function io(s, i) {
2432
2432
  return s.x >= i.x && s.y >= i.y && s.x + s.width <= i.x + i.width && s.y + s.height <= i.y + i.height;
2433
2433
  }
2434
- function io(s, i) {
2434
+ function so(s, i) {
2435
2435
  return Math.abs(s.width / s.height - i) < 0.1;
2436
2436
  }
2437
2437
  function ze({ width: s, height: i }, e) {
2438
2438
  let t = e / 90 % 2 !== 0;
2439
2439
  return { width: t ? i : s, height: t ? s : i };
2440
2440
  }
2441
- function so(s, i, e) {
2441
+ function ro(s, i, e) {
2442
2442
  const t = s / i;
2443
2443
  let r, n;
2444
2444
  t > e ? (r = Math.round(i * e), n = i) : (r = s, n = Math.round(s / e));
@@ -2456,7 +2456,7 @@ function st(s) {
2456
2456
  function ke(s, i, e) {
2457
2457
  return Math.min(Math.max(s, i), e);
2458
2458
  }
2459
- const ps = (s) => {
2459
+ const ms = (s) => {
2460
2460
  if (!s)
2461
2461
  return [];
2462
2462
  const [i, e] = s.split(":").map(Number);
@@ -2472,51 +2472,51 @@ const ps = (s) => {
2472
2472
  CAMERA: "camera",
2473
2473
  EXTERNAL: "external",
2474
2474
  API: "js-api"
2475
- }), ro = (s) => s ? s.split(",").map((i) => i.trim()) : [], qt = (s) => s ? s.join(",") : "", Gt = "blocks", bt = "0.36.0";
2476
- function no(s) {
2477
- return Qi({
2475
+ }), no = (s) => s ? s.split(",").map((i) => i.trim()) : [], qt = (s) => s ? s.join(",") : "", Gt = "blocks", bt = "0.36.0";
2476
+ function oo(s) {
2477
+ return es({
2478
2478
  ...s,
2479
2479
  libraryName: Gt,
2480
2480
  libraryVersion: bt
2481
2481
  });
2482
2482
  }
2483
- const ms = ({ type: s, message: i, ...e }) => ({
2483
+ const gs = ({ type: s, message: i, ...e }) => ({
2484
2484
  type: s,
2485
2485
  message: i,
2486
2486
  ...e
2487
- }), Se = ms, $t = ms, gs = (s) => {
2487
+ }), Se = gs, $t = gs, bs = (s) => {
2488
2488
  if (typeof s != "string" || !s)
2489
2489
  return "";
2490
2490
  let i = s.trim();
2491
2491
  return i.startsWith("-/") ? i = i.slice(2) : i.startsWith("/") && (i = i.slice(1)), i.endsWith("/") && (i = i.slice(0, i.length - 1)), i;
2492
- }, Xt = (...s) => s.filter((i) => typeof i == "string" && i).map((i) => gs(
2492
+ }, Xt = (...s) => s.filter((i) => typeof i == "string" && i).map((i) => bs(
2493
2493
  /** @type {String} */
2494
2494
  i
2495
- )).join("/-/"), ae = (...s) => {
2495
+ )).join("/-/"), le = (...s) => {
2496
2496
  let i = Xt(...s);
2497
2497
  return i ? `-/${i}/` : "";
2498
2498
  };
2499
- function bs(s) {
2499
+ function _s(s) {
2500
2500
  let i = new URL(s), e = i.pathname + i.search + i.hash, t = e.lastIndexOf("http"), r = e.lastIndexOf("/"), n = "";
2501
2501
  return t >= 0 ? n = e.slice(t) : r >= 0 && (n = e.slice(r + 1)), n;
2502
2502
  }
2503
- function oo(s) {
2503
+ function lo(s) {
2504
2504
  let i = new URL(s), { pathname: e } = i;
2505
2505
  const t = e.indexOf("/"), r = e.indexOf("/", t + 1);
2506
2506
  return e.substring(t + 1, r);
2507
2507
  }
2508
- function lo(s) {
2509
- let i = _s(s), e = new URL(i), t = e.pathname.indexOf("/-/");
2510
- return t === -1 ? [] : e.pathname.substring(t).split("/-/").filter(Boolean).map((n) => gs(n));
2508
+ function ao(s) {
2509
+ let i = ys(s), e = new URL(i), t = e.pathname.indexOf("/-/");
2510
+ return t === -1 ? [] : e.pathname.substring(t).split("/-/").filter(Boolean).map((n) => bs(n));
2511
2511
  }
2512
- function _s(s) {
2513
- let i = new URL(s), e = bs(s), t = ys(e) ? vs(e).pathname : e;
2512
+ function ys(s) {
2513
+ let i = new URL(s), e = _s(s), t = vs(e) ? Cs(e).pathname : e;
2514
2514
  return i.pathname = i.pathname.replace(t, ""), i.search = "", i.hash = "", i.toString();
2515
2515
  }
2516
- function ys(s) {
2516
+ function vs(s) {
2517
2517
  return s.startsWith("http");
2518
2518
  }
2519
- function vs(s) {
2519
+ function Cs(s) {
2520
2520
  let i = new URL(s);
2521
2521
  return {
2522
2522
  pathname: i.origin + i.pathname || "",
@@ -2525,9 +2525,9 @@ function vs(s) {
2525
2525
  };
2526
2526
  }
2527
2527
  const V = (s, i, e) => {
2528
- let t = new URL(_s(s));
2529
- if (e = e || bs(s), t.pathname.startsWith("//") && (t.pathname = t.pathname.replace("//", "/")), ys(e)) {
2530
- let r = vs(e);
2528
+ let t = new URL(ys(s));
2529
+ if (e = e || _s(s), t.pathname.startsWith("//") && (t.pathname = t.pathname.replace("//", "/")), vs(e)) {
2530
+ let r = Cs(e);
2531
2531
  t.pathname = t.pathname + (i || "") + (r.pathname || ""), t.search = r.search, t.hash = r.hash;
2532
2532
  } else
2533
2533
  t.pathname = t.pathname + (i || "") + (e || "");
@@ -2535,7 +2535,7 @@ const V = (s, i, e) => {
2535
2535
  }, qe = (s, i) => {
2536
2536
  let e = new URL(s);
2537
2537
  return e.pathname = i + "/", e.toString();
2538
- }, ce = (s, i = ",") => s.trim().split(i).map((e) => e.trim()).filter((e) => e.length > 0), Ut = [
2538
+ }, ae = (s, i = ",") => s.trim().split(i).map((e) => e.trim()).filter((e) => e.length > 0), Ut = [
2539
2539
  "image/*",
2540
2540
  "image/heif",
2541
2541
  "image/heif-sequence",
@@ -2549,10 +2549,10 @@ const V = (s, i, e) => {
2549
2549
  ".heics",
2550
2550
  ".avif",
2551
2551
  ".avifs"
2552
- ], Ti = (s) => s ? s.filter((i) => typeof i == "string").map((i) => ce(i)).flat() : [], Cs = (s, i) => i.some((e) => e.endsWith("*") ? (e = e.replace("*", ""), s.startsWith(e)) : s === e), ao = (s, i) => i.some((e) => e.startsWith(".") ? s.toLowerCase().endsWith(e.toLowerCase()) : !1), Rt = (s) => {
2552
+ ], $i = (s) => s ? s.filter((i) => typeof i == "string").map((i) => ae(i)).flat() : [], ws = (s, i) => i.some((e) => e.endsWith("*") ? (e = e.replace("*", ""), s.startsWith(e)) : s === e), co = (s, i) => i.some((e) => e.startsWith(".") ? s.toLowerCase().endsWith(e.toLowerCase()) : !1), Rt = (s) => {
2553
2553
  let i = s == null ? void 0 : s.type;
2554
- return i ? Cs(i, Ut) : !1;
2555
- }, Y = 1e3, Ce = Object.freeze({
2554
+ return i ? ws(i, Ut) : !1;
2555
+ }, Y = 1e3, ve = Object.freeze({
2556
2556
  AUTO: "auto",
2557
2557
  BYTE: "byte",
2558
2558
  KB: "kb",
@@ -2560,27 +2560,27 @@ const V = (s, i, e) => {
2560
2560
  GB: "gb",
2561
2561
  TB: "tb",
2562
2562
  PB: "pb"
2563
- }), Ve = (s) => Math.ceil(s * 100) / 100, co = (s, i = Ce.AUTO) => {
2564
- const e = i === Ce.AUTO;
2565
- if (i === Ce.BYTE || e && s < Y ** 1) {
2563
+ }), Ve = (s) => Math.ceil(s * 100) / 100, ho = (s, i = ve.AUTO) => {
2564
+ const e = i === ve.AUTO;
2565
+ if (i === ve.BYTE || e && s < Y ** 1) {
2566
2566
  const t = (
2567
2567
  /** @type {Extract<import('./getPluralForm').PluralForm, 'one' | 'other'>} */
2568
- Yi("en-US", s)
2568
+ Ji("en-US", s)
2569
2569
  ), r = {
2570
2570
  one: "byte",
2571
2571
  other: "bytes"
2572
2572
  }[t];
2573
2573
  return `${s} ${r}`;
2574
2574
  }
2575
- return i === Ce.KB || e && s < Y ** 2 ? `${Ve(s / Y ** 1)} KB` : i === Ce.MB || e && s < Y ** 3 ? `${Ve(s / Y ** 2)} MB` : i === Ce.GB || e && s < Y ** 4 ? `${Ve(s / Y ** 3)} GB` : i === Ce.TB || e && s < Y ** 5 ? `${Ve(s / Y ** 4)} TB` : `${Ve(s / Y ** 5)} PB`;
2576
- }, $i = "[Typed State] Wrong property name: ", ho = "[Typed State] Wrong property type: ";
2577
- class uo {
2575
+ return i === ve.KB || e && s < Y ** 2 ? `${Ve(s / Y ** 1)} KB` : i === ve.MB || e && s < Y ** 3 ? `${Ve(s / Y ** 2)} MB` : i === ve.GB || e && s < Y ** 4 ? `${Ve(s / Y ** 3)} GB` : i === ve.TB || e && s < Y ** 5 ? `${Ve(s / Y ** 4)} TB` : `${Ve(s / Y ** 5)} PB`;
2576
+ }, Si = "[Typed State] Wrong property name: ", uo = "[Typed State] Wrong property type: ";
2577
+ class fo {
2578
2578
  /**
2579
2579
  * @param {Object<string, { type: any; value: any; nullable?: Boolean }>} typedSchema
2580
2580
  * @param {String} [ctxName]
2581
2581
  */
2582
2582
  constructor(i, e) {
2583
- this.__typedSchema = i, this.__ctxId = e || te.generate(), this.__schema = Object.keys(i).reduce((t, r) => (t[r] = i[r].value, t), {}), this.__data = T.registerCtx(this.__schema, this.__ctxId);
2583
+ this.__typedSchema = i, this.__ctxId = e || Ae.generate(), this.__schema = Object.keys(i).reduce((t, r) => (t[r] = i[r].value, t), {}), this.__data = T.registerCtx(this.__schema, this.__ctxId);
2584
2584
  }
2585
2585
  /** @returns {String} */
2586
2586
  get uid() {
@@ -2592,7 +2592,7 @@ class uo {
2592
2592
  */
2593
2593
  setValue(i, e) {
2594
2594
  if (!this.__typedSchema.hasOwnProperty(i)) {
2595
- console.warn($i + i);
2595
+ console.warn(Si + i);
2596
2596
  return;
2597
2597
  }
2598
2598
  let t = this.__typedSchema[i];
@@ -2600,7 +2600,7 @@ class uo {
2600
2600
  this.__data.pub(i, e);
2601
2601
  return;
2602
2602
  }
2603
- console.warn(ho + i);
2603
+ console.warn(uo + i);
2604
2604
  }
2605
2605
  /** @param {Object<string, any>} updObj */
2606
2606
  setMultipleValues(i) {
@@ -2610,7 +2610,7 @@ class uo {
2610
2610
  /** @param {String} prop */
2611
2611
  getValue(i) {
2612
2612
  if (!this.__typedSchema.hasOwnProperty(i)) {
2613
- console.warn($i + i);
2613
+ console.warn(Si + i);
2614
2614
  return;
2615
2615
  }
2616
2616
  return this.__data.read(i);
@@ -2626,7 +2626,7 @@ class uo {
2626
2626
  T.deleteCtx(this.__ctxId);
2627
2627
  }
2628
2628
  }
2629
- class fo {
2629
+ class po {
2630
2630
  /**
2631
2631
  * @param {Object} options
2632
2632
  * @param {Object<string, { type: any; value: any }>} options.typedSchema
@@ -2635,7 +2635,7 @@ class fo {
2635
2635
  * @param {String} [options.ctxName]
2636
2636
  */
2637
2637
  constructor(i) {
2638
- this.__typedSchema = i.typedSchema, this.__ctxId = i.ctxName || te.generate(), this.__data = T.registerCtx({}, this.__ctxId), this.__watchList = i.watchList || [], this.__subsMap = /* @__PURE__ */ Object.create(null), this.__propertyObservers = /* @__PURE__ */ new Set(), this.__collectionObservers = /* @__PURE__ */ new Set(), this.__items = /* @__PURE__ */ new Set(), this.__removed = /* @__PURE__ */ new Set(), this.__added = /* @__PURE__ */ new Set();
2638
+ this.__typedSchema = i.typedSchema, this.__ctxId = i.ctxName || Ae.generate(), this.__data = T.registerCtx({}, this.__ctxId), this.__watchList = i.watchList || [], this.__subsMap = /* @__PURE__ */ Object.create(null), this.__propertyObservers = /* @__PURE__ */ new Set(), this.__collectionObservers = /* @__PURE__ */ new Set(), this.__items = /* @__PURE__ */ new Set(), this.__removed = /* @__PURE__ */ new Set(), this.__added = /* @__PURE__ */ new Set();
2639
2639
  let e = /* @__PURE__ */ Object.create(null);
2640
2640
  this.__notifyObservers = (t, r) => {
2641
2641
  this.__observeTimeout && window.clearTimeout(this.__observeTimeout), e[t] || (e[t] = /* @__PURE__ */ new Set()), e[t].add(r), this.__observeTimeout = window.setTimeout(() => {
@@ -2669,7 +2669,7 @@ class fo {
2669
2669
  * @returns {string}
2670
2670
  */
2671
2671
  add(i) {
2672
- let e = new uo(this.__typedSchema);
2672
+ let e = new fo(this.__typedSchema);
2673
2673
  for (let t in i)
2674
2674
  e.setValue(t, i[t]);
2675
2675
  return this.__items.add(e.uid), this.notify(), this.__data.add(e.uid, e), this.__added.add(e), this.__watchList.forEach((t) => {
@@ -2749,7 +2749,7 @@ class fo {
2749
2749
  }), delete this.__subsMap[i];
2750
2750
  }
2751
2751
  }
2752
- const po = (s) => {
2752
+ const mo = (s) => {
2753
2753
  const i = /* @__PURE__ */ new Map();
2754
2754
  return (
2755
2755
  /** @type {T} */
@@ -2762,7 +2762,7 @@ const po = (s) => {
2762
2762
  }
2763
2763
  );
2764
2764
  };
2765
- function mo(s) {
2765
+ function go(s) {
2766
2766
  let i = !1;
2767
2767
  return setTimeout(() => {
2768
2768
  i = !0;
@@ -2771,7 +2771,7 @@ function mo(s) {
2771
2771
  (...r) => (i && ot(s), t(...r))
2772
2772
  );
2773
2773
  }
2774
- function go(s) {
2774
+ function bo(s) {
2775
2775
  const i = {
2776
2776
  /** @returns {number} */
2777
2777
  progress: () => s.$["*commonProgress"],
@@ -2796,14 +2796,14 @@ function go(s) {
2796
2796
  /** @type {import('../index.js').OutputCollectionState<TCollectionStatus, TGroupFlag>} */
2797
2797
  /** @type {unknown} */
2798
2798
  {}
2799
- ), t = mo(
2799
+ ), t = go(
2800
2800
  "You're trying to access the OutputCollectionState asynchronously. In this case, the data you retrieve will be newer than it was when the OutputCollectionState was created or when the event was dispatched. If you want to retain the state at a specific moment in time, you should use the spread operator like this: `{...outputCollectionState}` or `{...e.detail}`"
2801
2801
  );
2802
2802
  for (const [r, n] of Object.entries(i)) {
2803
2803
  const o = (
2804
2804
  /** @type {keyof typeof getters} */
2805
2805
  r
2806
- ), a = po(t(
2806
+ ), a = mo(t(
2807
2807
  /** @type {(typeof getters)[name]} */
2808
2808
  n
2809
2809
  ));
@@ -2814,7 +2814,7 @@ function go(s) {
2814
2814
  }
2815
2815
  return e;
2816
2816
  }
2817
- const bo = Object.freeze({
2817
+ const _o = Object.freeze({
2818
2818
  file: {
2819
2819
  type: File,
2820
2820
  value: null
@@ -2916,11 +2916,11 @@ const bo = Object.freeze({
2916
2916
  type: Boolean,
2917
2917
  value: !1
2918
2918
  }
2919
- }), _o = /[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/i, yo = new RegExp(`^/?(${_o.source})(?:/(-/(?:[^/]+/)+)?([^/]*))?$`, "i"), vo = ({ url: s, cdnBase: i }) => {
2919
+ }), yo = /[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/i, vo = new RegExp(`^/?(${yo.source})(?:/(-/(?:[^/]+/)+)?([^/]*))?$`, "i"), Co = ({ url: s, cdnBase: i }) => {
2920
2920
  const e = new URL(i), t = new URL(s);
2921
2921
  if (e.host !== t.host)
2922
2922
  return null;
2923
- const [, r, n, o] = yo.exec(t.pathname);
2923
+ const [, r, n, o] = vo.exec(t.pathname);
2924
2924
  return {
2925
2925
  uuid: r,
2926
2926
  cdnUrlModifiers: n || "",
@@ -2932,7 +2932,7 @@ class $ extends b {
2932
2932
  super(...arguments);
2933
2933
  u(this, "couldBeCtxOwner", !1);
2934
2934
  u(this, "isCtxOwner", !1);
2935
- u(this, "init$", ds(this));
2935
+ u(this, "init$", fs(this));
2936
2936
  /** @private */
2937
2937
  u(this, "__initialUploadMetadata", null);
2938
2938
  /**
@@ -3128,8 +3128,8 @@ class $ extends b {
3128
3128
  }
3129
3129
  initCallback() {
3130
3130
  if (super.initCallback(), !this.$["*uploadCollection"]) {
3131
- let e = new fo({
3132
- typedSchema: bo,
3131
+ let e = new po({
3132
+ typedSchema: _o,
3133
3133
  watchList: ["uploadProgress", "uploadError", "fileInfo", "errors", "cdnUrl", "isUploading"]
3134
3134
  });
3135
3135
  this.$["*uploadCollection"] = e;
@@ -3186,7 +3186,7 @@ class $ extends b {
3186
3186
  * @returns {import('../types').OutputFileEntry<'idle'>}
3187
3187
  */
3188
3188
  addFileFromCdnUrl(e, { silent: t, fileName: r, source: n } = {}) {
3189
- const o = vo({ url: e, cdnBase: this.cfg.cdnCname });
3189
+ const o = Co({ url: e, cdnBase: this.cfg.cdnCname });
3190
3190
  if (!o)
3191
3191
  throw new Error("Invalid CDN URL");
3192
3192
  const l = this.uploadCollection.add({
@@ -3248,7 +3248,7 @@ class $ extends b {
3248
3248
  }
3249
3249
  /** @param {{ captureCamera?: boolean }} options */
3250
3250
  openSystemDialog(e = {}) {
3251
- let t = qt(Ti([this.cfg.accept ?? "", ...this.cfg.imgOnly ? Ut : []]));
3251
+ let t = qt($i([this.cfg.accept ?? "", ...this.cfg.imgOnly ? Ut : []]));
3252
3252
  this.cfg.accept && this.cfg.imgOnly && console.warn(
3253
3253
  "There could be a mistake.\nBoth `accept` and `imgOnly` parameters are set.\nThe value of `accept` will be concatenated with the internal image mime types list."
3254
3254
  ), this.fileInput = document.createElement("input"), this.fileInput.type = "file", this.fileInput.multiple = this.cfg.multiple, e.captureCamera ? (this.fileInput.capture = this.cfg.cameraCapture, this.fileInput.accept = "image/*") : this.fileInput.accept = t, this.fileInput.dispatchEvent(new MouseEvent("click")), this.fileInput.onchange = () => {
@@ -3260,7 +3260,7 @@ class $ extends b {
3260
3260
  /** @type {string[]} */
3261
3261
  get sourceList() {
3262
3262
  let e = [];
3263
- return this.cfg.sourceList && (e = ce(this.cfg.sourceList)), e;
3263
+ return this.cfg.sourceList && (e = ae(this.cfg.sourceList)), e;
3264
3264
  }
3265
3265
  /** @param {Boolean} [force] */
3266
3266
  initFlow(e = !1) {
@@ -3297,13 +3297,13 @@ class $ extends b {
3297
3297
  * @param {import('../types').OutputFileEntry} outputEntry
3298
3298
  */
3299
3299
  _validateFileType(e) {
3300
- const t = this.cfg.imgOnly, r = this.cfg.accept, n = Ti([...t ? Ut : [], r]);
3300
+ const t = this.cfg.imgOnly, r = this.cfg.accept, n = $i([...t ? Ut : [], r]);
3301
3301
  if (!n.length)
3302
3302
  return;
3303
3303
  const o = e.mimeType, l = e.name;
3304
3304
  if (!o || !l)
3305
3305
  return;
3306
- const a = Cs(o, n), c = ao(l, n);
3306
+ const a = ws(o, n), c = co(l, n);
3307
3307
  if (!a && !c)
3308
3308
  return Se({
3309
3309
  type: "FORBIDDEN_FILE_TYPE",
@@ -3320,7 +3320,7 @@ class $ extends b {
3320
3320
  if (t && r && r > t)
3321
3321
  return Se({
3322
3322
  type: "FILE_SIZE_EXCEEDED",
3323
- message: this.l10n("files-max-size-limit-error", { maxFileSize: co(t) }),
3323
+ message: this.l10n("files-max-size-limit-error", { maxFileSize: ho(t) }),
3324
3324
  entry: e
3325
3325
  });
3326
3326
  }
@@ -3414,7 +3414,7 @@ class $ extends b {
3414
3414
  * @param {import('../types').OutputCollectionState} collectionState
3415
3415
  */
3416
3416
  async _createGroup(e) {
3417
- const t = this.getUploadClientOptions(), r = e.allEntries.map((a) => a.uuid + (a.cdnUrlModifiers ? `/${a.cdnUrlModifiers}` : "")), n = new AbortController(), o = await Mn(r, { ...t, signal: n.signal });
3417
+ const t = this.getUploadClientOptions(), r = e.allEntries.map((a) => a.uuid + (a.cdnUrlModifiers ? `/${a.cdnUrlModifiers}` : "")), n = new AbortController(), o = await Fn(r, { ...t, signal: n.signal });
3418
3418
  if (this.$["*collectionState"] !== e) {
3419
3419
  n.abort();
3420
3420
  return;
@@ -3428,7 +3428,7 @@ class $ extends b {
3428
3428
  }
3429
3429
  /** @private */
3430
3430
  setInitialCrop() {
3431
- const e = ps(this.cfg.cropPreset);
3431
+ const e = ms(this.cfg.cropPreset);
3432
3432
  if (e) {
3433
3433
  const [t] = e, r = this.uploadCollection.findItems(
3434
3434
  (n) => {
@@ -3437,7 +3437,7 @@ class $ extends b {
3437
3437
  }
3438
3438
  ).map((n) => this.uploadCollection.read(n));
3439
3439
  for (const n of r) {
3440
- const o = n.getValue("fileInfo"), { width: l, height: a } = o.imageInfo, c = t.width / t.height, h = so(l, a, c), d = ae(
3440
+ const o = n.getValue("fileInfo"), { width: l, height: a } = o.imageInfo, c = t.width / t.height, h = ro(l, a, c), d = le(
3441
3441
  `crop/${h.width}x${h.height}/${h.x},${h.y}`,
3442
3442
  "preview"
3443
3443
  );
@@ -3468,7 +3468,7 @@ class $ extends b {
3468
3468
  publicKey: this.cfg.pubkey,
3469
3469
  baseCDN: this.cfg.cdnCname,
3470
3470
  baseURL: this.cfg.baseUrl,
3471
- userAgent: no,
3471
+ userAgent: oo,
3472
3472
  integration: this.cfg.userAgentIntegration,
3473
3473
  secureSignature: this.cfg.secureSignature,
3474
3474
  secureExpire: this.cfg.secureExpire,
@@ -3529,7 +3529,7 @@ class $ extends b {
3529
3529
  getOutputCollectionState() {
3530
3530
  return (
3531
3531
  /** @type {ReturnType<typeof buildOutputCollectionState<TStatus>>} */
3532
- go(this)
3532
+ bo(this)
3533
3533
  );
3534
3534
  }
3535
3535
  }
@@ -3567,7 +3567,7 @@ const j = Object.freeze({
3567
3567
  mirror: !1,
3568
3568
  flip: !1,
3569
3569
  crop: void 0
3570
- }), ws = (
3570
+ }), Es = (
3571
3571
  /** @type {const} */
3572
3572
  [
3573
3573
  "enhance",
@@ -3585,7 +3585,7 @@ const j = Object.freeze({
3585
3585
  "crop"
3586
3586
  ]
3587
3587
  );
3588
- function Co(s, i) {
3588
+ function wo(s, i) {
3589
3589
  if (typeof i == "number") {
3590
3590
  const e = i;
3591
3591
  return j[s] !== e ? `${s}/${e}` : "";
@@ -3612,52 +3612,52 @@ function Co(s, i) {
3612
3612
  }
3613
3613
  function _t(s) {
3614
3614
  return Xt(
3615
- ...ws.filter(
3615
+ ...Es.filter(
3616
3616
  (i) => typeof s[i] < "u" && s[i] !== null
3617
3617
  ).map((i) => {
3618
3618
  let e = s[i];
3619
- return Co(i, e);
3619
+ return wo(i, e);
3620
3620
  }).filter((i) => !!i)
3621
3621
  );
3622
3622
  }
3623
- const Es = Xt("format/auto", "progressive/yes"), ne = ([s]) => typeof s < "u" ? Number(s) : void 0, Si = () => !0, wo = ([s, i]) => ({
3623
+ const As = Xt("format/auto", "progressive/yes"), re = ([s]) => typeof s < "u" ? Number(s) : void 0, xi = () => !0, Eo = ([s, i]) => ({
3624
3624
  name: s,
3625
3625
  amount: typeof i < "u" ? Number(i) : 100
3626
- }), Eo = ([s, i]) => {
3626
+ }), Ao = ([s, i]) => {
3627
3627
  if (!/\d+x\d+/.test(s) || !/\d+,\d+/.test(i))
3628
3628
  throw new Error("Crop by aspect ratio, percentage or alignment shortcuts is not supported.");
3629
3629
  return (
3630
3630
  /** @type {{ dimensions: [number, number]; coords: [number, number] }} */
3631
3631
  {
3632
- dimensions: ce(s, "x").map(Number),
3633
- coords: ce(i).map(Number)
3632
+ dimensions: ae(s, "x").map(Number),
3633
+ coords: ae(i).map(Number)
3634
3634
  }
3635
3635
  );
3636
- }, Ao = Object.freeze({
3637
- enhance: ne,
3638
- brightness: ne,
3639
- exposure: ne,
3640
- gamma: ne,
3641
- contrast: ne,
3642
- saturation: ne,
3643
- vibrance: ne,
3644
- warmth: ne,
3645
- filter: wo,
3646
- mirror: Si,
3647
- flip: Si,
3648
- rotate: ne,
3649
- crop: Eo
3636
+ }, To = Object.freeze({
3637
+ enhance: re,
3638
+ brightness: re,
3639
+ exposure: re,
3640
+ gamma: re,
3641
+ contrast: re,
3642
+ saturation: re,
3643
+ vibrance: re,
3644
+ warmth: re,
3645
+ filter: Eo,
3646
+ mirror: xi,
3647
+ flip: xi,
3648
+ rotate: re,
3649
+ crop: Ao
3650
3650
  });
3651
- function To(s) {
3651
+ function $o(s) {
3652
3652
  const i = {};
3653
3653
  for (const e of s) {
3654
3654
  const [t, ...r] = e.split("/");
3655
- if (!ws.includes(t))
3655
+ if (!Es.includes(t))
3656
3656
  continue;
3657
3657
  const n = (
3658
3658
  /** @type {(typeof SUPPORTED_OPERATIONS_ORDERED)[number]} */
3659
3659
  t
3660
- ), o = Ao[n];
3660
+ ), o = To[n];
3661
3661
  try {
3662
3662
  const l = o(r);
3663
3663
  i[n] = l;
@@ -3681,7 +3681,7 @@ const L = Object.freeze({
3681
3681
  CROP: "crop",
3682
3682
  TUNING: "tuning",
3683
3683
  FILTERS: "filters"
3684
- }), ee = [L.CROP, L.TUNING, L.FILTERS], $o = [
3684
+ }), ee = [L.CROP, L.TUNING, L.FILTERS], So = [
3685
3685
  "brightness",
3686
3686
  "exposure",
3687
3687
  "gamma",
@@ -3690,7 +3690,7 @@ const L = Object.freeze({
3690
3690
  "vibrance",
3691
3691
  "warmth",
3692
3692
  "enhance"
3693
- ], So = [
3693
+ ], xo = [
3694
3694
  "adaris",
3695
3695
  "briaril",
3696
3696
  "calarel",
@@ -3731,7 +3731,7 @@ const L = Object.freeze({
3731
3731
  "yllara",
3732
3732
  "zatvel",
3733
3733
  "zevcen"
3734
- ], xo = ["rotate", "mirror", "flip"], Ue = Object.freeze({
3734
+ ], Io = ["rotate", "mirror", "flip"], Ue = Object.freeze({
3735
3735
  brightness: {
3736
3736
  zero: j.brightness,
3737
3737
  range: [-100, 100],
@@ -3777,7 +3777,7 @@ const L = Object.freeze({
3777
3777
  range: [0, 100],
3778
3778
  keypointsNumber: 1
3779
3779
  }
3780
- }), Io = "https://ucarecdn.com", ko = "https://upload.uploadcare.com", Oo = "https://social.uploadcare.com", Oe = {
3780
+ }), ko = "https://ucarecdn.com", Oo = "https://upload.uploadcare.com", Po = "https://social.uploadcare.com", Oe = {
3781
3781
  pubkey: "",
3782
3782
  multiple: !0,
3783
3783
  multipleMin: 0,
@@ -3803,9 +3803,9 @@ const L = Object.freeze({
3803
3803
  modalBackdropStrokes: !1,
3804
3804
  sourceListWrap: !0,
3805
3805
  remoteTabSessionKey: "",
3806
- cdnCname: Io,
3807
- baseUrl: ko,
3808
- socialBaseUrl: Oo,
3806
+ cdnCname: ko,
3807
+ baseUrl: Oo,
3808
+ socialBaseUrl: Po,
3809
3809
  secureSignature: "",
3810
3810
  secureExpire: "",
3811
3811
  secureDeliveryProxy: "",
@@ -3836,12 +3836,12 @@ const L = Object.freeze({
3836
3836
  if (s === "false")
3837
3837
  return !1;
3838
3838
  throw new Error(`Invalid boolean: "${s}"`);
3839
- }, Po = (s) => s === "auto" ? s : x(s), Lo = (s) => {
3839
+ }, Lo = (s) => s === "auto" ? s : x(s), Uo = (s) => {
3840
3840
  const i = P(s);
3841
3841
  if (i !== "user" && i !== "environment" && i !== "")
3842
3842
  throw new Error(`Invalid "cameraCapture" value: "${i}"`);
3843
3843
  return i;
3844
- }, Uo = {
3844
+ }, Ro = {
3845
3845
  pubkey: P,
3846
3846
  multiple: x,
3847
3847
  multipleMin: J,
@@ -3850,9 +3850,9 @@ const L = Object.freeze({
3850
3850
  imgOnly: x,
3851
3851
  accept: P,
3852
3852
  externalSourcesPreferredTypes: P,
3853
- store: Po,
3853
+ store: Lo,
3854
3854
  cameraMirror: x,
3855
- cameraCapture: Lo,
3855
+ cameraCapture: Uo,
3856
3856
  sourceList: P,
3857
3857
  maxLocalFileSizeBytes: J,
3858
3858
  thumbSize: J,
@@ -3884,33 +3884,33 @@ const L = Object.freeze({
3884
3884
  groupOutput: x,
3885
3885
  userAgentIntegration: P,
3886
3886
  debug: x
3887
- }, Ro = (s, i) => {
3887
+ }, Mo = (s, i) => {
3888
3888
  if (!(typeof i > "u" || i === null))
3889
3889
  try {
3890
- return Uo[s](i);
3890
+ return Ro[s](i);
3891
3891
  } catch (e) {
3892
3892
  return console.error(`Invalid value for config key "${s}".`, e), Oe[s];
3893
3893
  }
3894
3894
  }, Re = (
3895
3895
  /** @type {(keyof import('../../types').ConfigType)[]} */
3896
3896
  Object.keys(Oe)
3897
- ), Mo = ["metadata"], Fo = (s) => Mo.includes(s), at = (
3897
+ ), Fo = ["metadata"], No = (s) => Fo.includes(s), at = (
3898
3898
  /** @type {(keyof import('../../types').ConfigPlainType)[]} */
3899
- Re.filter((s) => !Fo(s))
3900
- ), No = (
3899
+ Re.filter((s) => !No(s))
3900
+ ), Do = (
3901
3901
  /** @type {Record<keyof import('../../types').ConfigAttributesType, keyof import('../../types').ConfigPlainType>} */
3902
3902
  {
3903
- ...Object.fromEntries(at.map((s) => [we(s), s])),
3903
+ ...Object.fromEntries(at.map((s) => [Ce(s), s])),
3904
3904
  ...Object.fromEntries(at.map((s) => [s.toLowerCase(), s]))
3905
3905
  }
3906
- ), Do = (
3906
+ ), zo = (
3907
3907
  /** @type {Record<keyof import('../../types').ConfigAttributesType, string>} */
3908
3908
  {
3909
- ...Object.fromEntries(Re.map((s) => [we(s), z(s)])),
3909
+ ...Object.fromEntries(Re.map((s) => [Ce(s), z(s)])),
3910
3910
  ...Object.fromEntries(Re.map((s) => [s.toLowerCase(), z(s)]))
3911
3911
  }
3912
3912
  );
3913
- class Kt extends k {
3913
+ class Kt extends I {
3914
3914
  constructor() {
3915
3915
  super();
3916
3916
  u(this, "requireCtxName", !0);
@@ -3954,7 +3954,7 @@ class Kt extends k {
3954
3954
  /** @param {unknown} value */
3955
3955
  set: (n) => {
3956
3956
  if (e[r] = n, at.includes(t)) {
3957
- const o = [.../* @__PURE__ */ new Set([we(t), t.toLowerCase()])];
3957
+ const o = [.../* @__PURE__ */ new Set([Ce(t), t.toLowerCase()])];
3958
3958
  for (const l of o)
3959
3959
  typeof n > "u" || n === null ? this.removeAttribute(l) : this.setAttribute(l, n.toString());
3960
3960
  }
@@ -3972,14 +3972,14 @@ class Kt extends k {
3972
3972
  attributeChangedCallback(e, t, r) {
3973
3973
  if (t === r)
3974
3974
  return;
3975
- const n = No[e], l = Ro(n, r) ?? Oe[n], a = (
3975
+ const n = Do[e], l = Mo(n, r) ?? Oe[n], a = (
3976
3976
  /** @type {typeof this & any} */
3977
3977
  this
3978
3978
  );
3979
3979
  a[n] = l;
3980
3980
  }
3981
3981
  }
3982
- Kt.bindAttributes(Do);
3982
+ Kt.bindAttributes(zo);
3983
3983
  for (const s of Re) {
3984
3984
  const i = "__" + s;
3985
3985
  Object.defineProperty(Kt.prototype, s, {
@@ -3992,12 +3992,12 @@ for (const s of Re) {
3992
3992
  }
3993
3993
  });
3994
3994
  }
3995
- const As = (
3995
+ const Ts = (
3996
3996
  /** @type {Config} */
3997
3997
  /** @type {unknown} */
3998
3998
  Kt
3999
3999
  );
4000
- class Yt extends k {
4000
+ class Yt extends I {
4001
4001
  constructor() {
4002
4002
  super(...arguments);
4003
4003
  u(this, "init$", {
@@ -4031,7 +4031,7 @@ Yt.bindAttributes({
4031
4031
  name: "name",
4032
4032
  size: "size"
4033
4033
  });
4034
- const zo = (s) => [...new Set(s)], Vo = (s) => Object.entries(s).filter(([i, e]) => e !== void 0 && e !== "").map(([i, e]) => i === "cdn-operations" || i === "analytics" ? e : `${i}/${e}`), Bo = "https://ucarecdn.com", ct = Object.freeze({
4034
+ const Vo = (s) => [...new Set(s)], Bo = (s) => Object.entries(s).filter(([i, e]) => e !== void 0 && e !== "").map(([i, e]) => i === "cdn-operations" || i === "analytics" ? e : `${i}/${e}`), jo = "https://ucarecdn.com", ct = Object.freeze({
4035
4035
  "dev-mode": {},
4036
4036
  pubkey: {},
4037
4037
  uuid: {},
@@ -4046,7 +4046,7 @@ const zo = (s) => [...new Set(s)], Vo = (s) => Object.entries(s).filter(([i, e])
4046
4046
  // '200, 300, 400'
4047
4047
  },
4048
4048
  "cdn-cname": {
4049
- default: Bo
4049
+ default: jo
4050
4050
  },
4051
4051
  "proxy-cname": {},
4052
4052
  "secure-delivery-proxy": {},
@@ -4063,17 +4063,17 @@ const zo = (s) => [...new Set(s)], Vo = (s) => Object.entries(s).filter(([i, e])
4063
4063
  "is-preview-blur": {
4064
4064
  default: 1
4065
4065
  }
4066
- }), We = "--lr-img-", xi = "unresolved", Ze = 2, Qe = 3, Ii = !window.location.host.trim() || window.location.host.includes(":") || window.location.hostname.includes("localhost"), ki = 3e3, Oi = 5e3, Pi = Object.freeze({
4066
+ }), We = "--lr-img-", Ii = "unresolved", Ze = 2, Qe = 3, ki = !window.location.host.trim() || window.location.host.includes(":") || window.location.hostname.includes("localhost"), Oi = 3e3, Pi = 5e3, Li = Object.freeze({
4067
4067
  PREVIEW: "PREVIEW",
4068
4068
  MAIN: "MAIN"
4069
- }), Ts = /* @__PURE__ */ Object.create(null);
4070
- var Hi;
4069
+ }), $s = /* @__PURE__ */ Object.create(null);
4070
+ var Wi;
4071
4071
  for (let s in ct)
4072
- Ts[We + s] = ((Hi = ct[s]) == null ? void 0 : Hi.default) || "";
4073
- class jo extends ht {
4072
+ $s[We + s] = ((Wi = ct[s]) == null ? void 0 : Wi.default) || "";
4073
+ class Ho extends ht {
4074
4074
  constructor() {
4075
4075
  super(...arguments);
4076
- u(this, "cssInit$", Ts);
4076
+ u(this, "cssInit$", $s);
4077
4077
  }
4078
4078
  /**
4079
4079
  * @param {String} key
@@ -4133,7 +4133,7 @@ class jo extends ht {
4133
4133
  });
4134
4134
  }
4135
4135
  }
4136
- class Ho extends jo {
4136
+ class Wo extends Ho {
4137
4137
  constructor() {
4138
4138
  super(...arguments);
4139
4139
  u(this, "_img", new Image());
@@ -4144,7 +4144,7 @@ class Ho extends jo {
4144
4144
  * @param {String} src
4145
4145
  */
4146
4146
  _fmtAbs(e) {
4147
- return !e.includes("//") && !Ii && (e = new URL(e, document.baseURI).href), e;
4147
+ return !e.includes("//") && !ki && (e = new URL(e, document.baseURI).href), e;
4148
4148
  }
4149
4149
  /**
4150
4150
  * Validate size
@@ -4156,10 +4156,10 @@ class Ho extends jo {
4156
4156
  if ((e == null ? void 0 : e.trim()) !== "") {
4157
4157
  let t = e.match(/\d+/)[0], r = e.match(/[a-zA-Z]+/)[0];
4158
4158
  const n = parseInt(t, 10);
4159
- if (Number(n) > Oi && this.hasFormatJPG)
4159
+ if (Number(n) > Pi && this.hasFormatJPG)
4160
+ return Pi + r;
4161
+ if (Number(n) > Oi && !this.hasFormatJPG)
4160
4162
  return Oi + r;
4161
- if (Number(n) > ki && !this.hasFormatJPG)
4162
- return ki + r;
4163
4163
  }
4164
4164
  return e;
4165
4165
  }
@@ -4178,7 +4178,7 @@ class Ho extends jo {
4178
4178
  "cdn-operations": this.$$("cdn-operations"),
4179
4179
  analytics: this.analyticsParams()
4180
4180
  };
4181
- return ae(...Vo(r));
4181
+ return le(...Bo(r));
4182
4182
  }
4183
4183
  /**
4184
4184
  * @private
@@ -4189,7 +4189,7 @@ class Ho extends jo {
4189
4189
  _getUrlBase(e = "", t = "") {
4190
4190
  if (this.$$("src").startsWith("data:") || this.$$("src").startsWith("blob:"))
4191
4191
  return this.$$("src");
4192
- if (Ii && this.$$("src") && !this.$$("src").includes("//"))
4192
+ if (ki && this.$$("src") && !this.$$("src").includes("//"))
4193
4193
  return this._proxyUrl(this.$$("src"));
4194
4194
  let r = this._getCdnModifiers(e, t);
4195
4195
  if (this.$$("src").startsWith(this.$$("cdn-cname")))
@@ -4266,10 +4266,10 @@ class Ho extends jo {
4266
4266
  }
4267
4267
  get currentImg() {
4268
4268
  return this.hasPreviewImage ? {
4269
- type: Pi.PREVIEW,
4269
+ type: Li.PREVIEW,
4270
4270
  img: this._imgPreview
4271
4271
  } : {
4272
- type: Pi.MAIN,
4272
+ type: Li.MAIN,
4273
4273
  img: this.img
4274
4274
  };
4275
4275
  }
@@ -4281,8 +4281,8 @@ class Ho extends jo {
4281
4281
  }
4282
4282
  get breakpoints() {
4283
4283
  if (this.$$("breakpoints")) {
4284
- const e = ce(this.$$("breakpoints"));
4285
- return zo(e.map((t) => parseInt(t, 10)));
4284
+ const e = ae(this.$$("breakpoints"));
4285
+ return Vo(e.map((t) => parseInt(t, 10)));
4286
4286
  } else
4287
4287
  return null;
4288
4288
  }
@@ -4323,8 +4323,8 @@ class Ho extends jo {
4323
4323
  }
4324
4324
  loaderImage({ src: e, srcset: t, elNode: r }) {
4325
4325
  return new Promise((n, o) => {
4326
- this._setupConfigForImage({ elNode: r }), r.setAttribute(xi, ""), r.addEventListener("load", () => {
4327
- r.removeAttribute(xi), n(r);
4326
+ this._setupConfigForImage({ elNode: r }), r.setAttribute(Ii, ""), r.addEventListener("load", () => {
4327
+ r.removeAttribute(Ii), n(r);
4328
4328
  }), r.addEventListener("error", () => {
4329
4329
  o(!1);
4330
4330
  }), this._appendURL({
@@ -4369,7 +4369,7 @@ class Ho extends jo {
4369
4369
  this.bgSelector ? this.renderBackground() : this.renderImage();
4370
4370
  }
4371
4371
  }
4372
- class Wo extends Ho {
4372
+ class qo extends Wo {
4373
4373
  initCallback() {
4374
4374
  super.initCallback(), this.sub$$("src", () => {
4375
4375
  this.init();
@@ -4420,7 +4420,7 @@ Jt.bindAttributes({
4420
4420
  // @ts-expect-error TODO: we need to update symbiote types
4421
4421
  dropzone: null
4422
4422
  });
4423
- class $s extends b {
4423
+ class Ss extends b {
4424
4424
  constructor() {
4425
4425
  super(...arguments);
4426
4426
  u(this, "historyTracked", !0);
@@ -4431,9 +4431,9 @@ class $s extends b {
4431
4431
  super.initCallback(), this.registerActivity(this.activityType);
4432
4432
  }
4433
4433
  }
4434
- $s.template = /* HTML */
4434
+ Ss.template = /* HTML */
4435
4435
  ' <div class="content"><slot></slot></div> ';
4436
- function qo(s) {
4436
+ function Go(s) {
4437
4437
  return new Promise((i) => {
4438
4438
  typeof window.FileReader != "function" && i(!1);
4439
4439
  try {
@@ -4450,7 +4450,7 @@ function qo(s) {
4450
4450
  }
4451
4451
  });
4452
4452
  }
4453
- function Go(s, i) {
4453
+ function Xo(s, i) {
4454
4454
  return new Promise((e) => {
4455
4455
  let t = 0;
4456
4456
  const r = [], n = (l) => {
@@ -4478,7 +4478,7 @@ function Go(s, i) {
4478
4478
  n(s);
4479
4479
  });
4480
4480
  }
4481
- function Xo(s) {
4481
+ function Ko(s) {
4482
4482
  const i = [], e = [];
4483
4483
  for (let t = 0; t < s.items.length; t++) {
4484
4484
  let r = s.items[t];
@@ -4492,7 +4492,7 @@ function Xo(s) {
4492
4492
  r.getAsEntry()
4493
4493
  );
4494
4494
  e.push(
4495
- Go(l, n).then((a) => {
4495
+ Xo(l, n).then((a) => {
4496
4496
  a && i.push(...a);
4497
4497
  })
4498
4498
  );
@@ -4500,7 +4500,7 @@ function Xo(s) {
4500
4500
  }
4501
4501
  const o = r.getAsFile();
4502
4502
  o && e.push(
4503
- qo(o).then((l) => {
4503
+ Go(o).then((l) => {
4504
4504
  l || i.push({
4505
4505
  type: "file",
4506
4506
  file: o
@@ -4527,12 +4527,12 @@ const F = {
4527
4527
  NEAR: 2,
4528
4528
  OVER: 3
4529
4529
  };
4530
- let Li = ["focus"], Ko = 100, St = /* @__PURE__ */ new Map();
4531
- function Yo(s, i) {
4530
+ let Ui = ["focus"], Yo = 100, St = /* @__PURE__ */ new Map();
4531
+ function Jo(s, i) {
4532
4532
  let e = Math.max(Math.min(s[0], i.x + i.width), i.x), t = Math.max(Math.min(s[1], i.y + i.height), i.y);
4533
4533
  return Math.sqrt((s[0] - e) * (s[0] - e) + (s[1] - t) * (s[1] - t));
4534
4534
  }
4535
- function Ui(s) {
4535
+ function Ri(s) {
4536
4536
  let i = 0, e = document.body, t = /* @__PURE__ */ new Set(), r = (p) => t.add(p), n = F.INACTIVE, o = (p) => {
4537
4537
  s.shouldIgnore() && p !== F.INACTIVE || (n !== p && t.forEach((g) => g(p)), n = p);
4538
4538
  }, l = () => i > 0;
@@ -4549,7 +4549,7 @@ function Ui(s) {
4549
4549
  if (s.shouldIgnore())
4550
4550
  return;
4551
4551
  l() || (i += 1);
4552
- let g = [p.x, p.y], A = s.element.getBoundingClientRect(), w = Math.floor(Yo(g, A)), C = w < Ko, y = p.composedPath().includes(s.element);
4552
+ let g = [p.x, p.y], A = s.element.getBoundingClientRect(), w = Math.floor(Jo(g, A)), C = w < Yo, y = p.composedPath().includes(s.element);
4553
4553
  St.set(s.element, w);
4554
4554
  let U = Math.min(...St.values()) === w;
4555
4555
  y && U ? (p.preventDefault(), o(F.OVER)) : o(C && U ? F.NEAR : F.ACTIVE);
@@ -4557,18 +4557,18 @@ function Ui(s) {
4557
4557
  if (s.shouldIgnore())
4558
4558
  return;
4559
4559
  p.preventDefault();
4560
- let g = await Xo(p.dataTransfer);
4560
+ let g = await Ko(p.dataTransfer);
4561
4561
  s.onItems(g), o(F.INACTIVE);
4562
4562
  };
4563
- return e.addEventListener("drop", d), e.addEventListener("dragleave", h), e.addEventListener("dragenter", c), e.addEventListener("dragover", f), s.element.addEventListener("drop", m), Li.forEach((p) => {
4563
+ return e.addEventListener("drop", d), e.addEventListener("dragleave", h), e.addEventListener("dragenter", c), e.addEventListener("dragover", f), s.element.addEventListener("drop", m), Ui.forEach((p) => {
4564
4564
  window.addEventListener(p, a);
4565
4565
  }), () => {
4566
- St.delete(s.element), e.removeEventListener("drop", d), e.removeEventListener("dragleave", h), e.removeEventListener("dragenter", c), e.removeEventListener("dragover", f), s.element.removeEventListener("drop", m), Li.forEach((p) => {
4566
+ St.delete(s.element), e.removeEventListener("drop", d), e.removeEventListener("dragleave", h), e.removeEventListener("dragenter", c), e.removeEventListener("dragover", f), s.element.removeEventListener("drop", m), Ui.forEach((p) => {
4567
4567
  window.removeEventListener(p, a);
4568
4568
  });
4569
4569
  };
4570
4570
  }
4571
- const Ss = "lr-drop-area", xe = `${Ss}/registry`;
4571
+ const xs = "lr-drop-area", xe = `${xs}/registry`;
4572
4572
  class Zt extends $ {
4573
4573
  constructor() {
4574
4574
  super(), this.init$ = {
@@ -4620,7 +4620,7 @@ class Zt extends $ {
4620
4620
  (e) => {
4621
4621
  typeof e == "string" ? this.set$({ text: this.l10n(e) || e }) : this.set$({ text: this.l10n("drop-files-here") });
4622
4622
  }
4623
- ), this._destroyDropzone = Ui({
4623
+ ), this._destroyDropzone = Ri({
4624
4624
  element: this,
4625
4625
  shouldIgnore: () => this._shouldIgnore(),
4626
4626
  /** @param {DropzoneState} state */
@@ -4637,7 +4637,7 @@ class Zt extends $ {
4637
4637
  }
4638
4638
  });
4639
4639
  let i = this.ref["content-wrapper"];
4640
- i && (this._destroyContentWrapperDropzone = Ui({
4640
+ i && (this._destroyContentWrapperDropzone = Ri({
4641
4641
  element: i,
4642
4642
  /** @param {DropzoneState} state */
4643
4643
  onChange: (e) => {
@@ -4653,7 +4653,7 @@ class Zt extends $ {
4653
4653
  const t = (r = Object.entries(F).find(([, n]) => n === e)) == null ? void 0 : r[0].toLowerCase();
4654
4654
  t && this.setAttribute("drag-state", t);
4655
4655
  }), this.subConfigValue("sourceList", (e) => {
4656
- const t = ce(e);
4656
+ const t = ae(e);
4657
4657
  this.$.isEnabled = t.includes($.sourceTypes.LOCAL), this.$.isVisible = this.$.isEnabled || !this.querySelector("[data-default-slot]");
4658
4658
  }), this.sub("isVisible", (e) => {
4659
4659
  this.toggleAttribute("hidden", !e);
@@ -4681,7 +4681,7 @@ class Zt extends $ {
4681
4681
  var e, t;
4682
4682
  super.destroyCallback();
4683
4683
  const i = this.$[xe];
4684
- i && (i.delete(this), i.size === 0 && T.deleteCtx(Ss)), (e = this._destroyDropzone) == null || e.call(this), (t = this._destroyContentWrapperDropzone) == null || t.call(this), this._onAreaClicked && this.removeEventListener("click", this._onAreaClicked);
4684
+ i && (i.delete(this), i.size === 0 && T.deleteCtx(xs)), (e = this._destroyDropzone) == null || e.call(this), (t = this._destroyContentWrapperDropzone) == null || t.call(this), this._onAreaClicked && this.removeEventListener("click", this._onAreaClicked);
4685
4685
  }
4686
4686
  }
4687
4687
  Zt.template = /* HTML */
@@ -4709,7 +4709,7 @@ Zt.bindAttributes({
4709
4709
  // @ts-expect-error TODO: fix types inside symbiote
4710
4710
  disabled: null
4711
4711
  });
4712
- const Jo = "src-type-";
4712
+ const Zo = "src-type-";
4713
4713
  class Qt extends $ {
4714
4714
  constructor() {
4715
4715
  super();
@@ -4789,7 +4789,7 @@ class Qt extends $ {
4789
4789
  return;
4790
4790
  }
4791
4791
  const { textKey: r = e, icon: n = e } = t;
4792
- this.applyL10nKey("src-type", `${Jo}${r}`), this.$.iconName = n, this.onclick = () => {
4792
+ this.applyL10nKey("src-type", `${Zo}${r}`), this.$.iconName = n, this.onclick = () => {
4793
4793
  this.activate();
4794
4794
  };
4795
4795
  }
@@ -4803,10 +4803,10 @@ Qt.bindAttributes({
4803
4803
  // @ts-expect-error symbiote types bug
4804
4804
  type: null
4805
4805
  });
4806
- class Zo extends k {
4806
+ class Qo extends I {
4807
4807
  initCallback() {
4808
4808
  super.initCallback(), this.subConfigValue("sourceList", (i) => {
4809
- let e = ce(i), t = "";
4809
+ let e = ae(i), t = "";
4810
4810
  e.forEach((r) => {
4811
4811
  t += /* HTML */
4812
4812
  `<lr-source-btn type="${r}"></lr-source-btn>`;
@@ -4862,13 +4862,13 @@ const yt = () => {
4862
4862
  });
4863
4863
  })
4864
4864
  };
4865
- }, Qo = async (s) => {
4865
+ }, el = async (s) => {
4866
4866
  const i = [], { promiseReadJpegChunks: e, stack: t } = yt();
4867
4867
  return await e(s), t.forEach(({ marker: r, view: n }) => {
4868
4868
  r === 226 && // check for "ICC_PROFILE\0"
4869
4869
  n.getUint32(0) === 1229144927 && n.getUint32(4) === 1347571526 && n.getUint32(8) === 1229735168 && i.push(n);
4870
4870
  }), i;
4871
- }, xs = async (s, i, e) => {
4871
+ }, Is = async (s, i, e) => {
4872
4872
  {
4873
4873
  const t = [], r = [], { promiseReadJpegChunks: n, stack: o } = yt();
4874
4874
  await n(s), o.forEach((c) => {
@@ -4887,13 +4887,13 @@ const yt = () => {
4887
4887
  type: s.type
4888
4888
  });
4889
4889
  }
4890
- }, el = 226, Is = (s, i) => xs(s, el, i.map((e) => e.buffer)), tl = async (s) => {
4890
+ }, tl = 226, ks = (s, i) => Is(s, tl, i.map((e) => e.buffer)), il = async (s) => {
4891
4891
  try {
4892
- return await Is(s, []);
4892
+ return await ks(s, []);
4893
4893
  } catch (i) {
4894
4894
  throw new Error(`Failed to strip ICC profile: ${i}`);
4895
4895
  }
4896
- }, il = (s, i, e) => new Promise((t, r) => {
4896
+ }, sl = (s, i, e) => new Promise((t, r) => {
4897
4897
  const n = (o) => {
4898
4898
  if (!o) {
4899
4899
  r("Failed to convert canvas to blob");
@@ -4908,7 +4908,7 @@ const yt = () => {
4908
4908
  canvas: s,
4909
4909
  ctx: i
4910
4910
  };
4911
- }, sl = (s) => {
4911
+ }, rl = (s) => {
4912
4912
  const { ctx: e, canvas: t } = Ge();
4913
4913
  t.width = t.height = 50, e.drawImage(s, 0, 0, 50, 50);
4914
4914
  const r = e.getImageData(0, 0, 50, 50).data;
@@ -4917,7 +4917,7 @@ const yt = () => {
4917
4917
  if (r[n] < 254)
4918
4918
  return !0;
4919
4919
  return !1;
4920
- }, rl = async (s) => {
4920
+ }, nl = async (s) => {
4921
4921
  let i = null;
4922
4922
  const { promiseReadJpegChunks: e, stack: t } = yt();
4923
4923
  return await e(s), t.forEach(({ marker: r, view: n }) => {
@@ -4927,18 +4927,18 @@ const yt = () => {
4927
4927
  return;
4928
4928
  }
4929
4929
  }), i;
4930
- }, nl = "data:image/jpg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4QA6RXhpZgAATU0AKgAAAAgAAwESAAMAAAABAAYAAAEoAAMAAAABAAIAAAITAAMAAAABAAEAAAAAAAD/2wBDAP//////////////////////////////////////////////////////////////////////////////////////wAALCAABAAIBASIA/8QAJgABAAAAAAAAAAAAAAAAAAAAAxABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQAAPwBH/9k=";
4930
+ }, ol = "data:image/jpg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4QA6RXhpZgAATU0AKgAAAAgAAwESAAMAAAABAAYAAAEoAAMAAAABAAIAAAITAAMAAAABAAEAAAAAAAD/2wBDAP//////////////////////////////////////////////////////////////////////////////////////wAALCAABAAIBASIA/8QAJgABAAAAAAAAAAAAAAAAAAAAAxABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQAAPwBH/9k=";
4931
4931
  let et;
4932
- const ol = () => new Promise((s) => {
4932
+ const ll = () => new Promise((s) => {
4933
4933
  if (et !== void 0)
4934
4934
  s(et);
4935
4935
  else {
4936
4936
  const i = new Image();
4937
4937
  i.addEventListener("load", () => {
4938
4938
  et = i.naturalWidth < i.naturalHeight, i.src = "//:0", s(et);
4939
- }), i.src = nl;
4939
+ }), i.src = ol;
4940
4940
  }
4941
- }), ll = (s, i) => {
4941
+ }), al = (s, i) => {
4942
4942
  let e, t, r, n;
4943
4943
  if (!s || s.byteLength < 14 || s.getUint32(0) !== 1165519206 || s.getUint16(4) !== 0)
4944
4944
  return;
@@ -4957,20 +4957,20 @@ const ol = () => new Promise((s) => {
4957
4957
  return;
4958
4958
  s.getUint16(r, t) === 274 && i(r + 8, t), r += 12;
4959
4959
  }
4960
- }, al = (s, i) => {
4961
- ll(s, (e, t) => s.setUint16(e, i, t));
4962
- }, cl = async (s, i, e) => (e && al(i, 1), xs(s, 225, [i.buffer])), hl = (s, i) => new Promise((e, t) => {
4960
+ }, cl = (s, i) => {
4961
+ al(s, (e, t) => s.setUint16(e, i, t));
4962
+ }, hl = async (s, i, e) => (e && cl(i, 1), Is(s, 225, [i.buffer])), ul = (s, i) => new Promise((e, t) => {
4963
4963
  i && (s.src = i), s.complete ? e(s) : (s.addEventListener("load", () => {
4964
4964
  e(s);
4965
4965
  }), s.addEventListener("error", () => {
4966
4966
  t(new Error("Failed to load image. Probably not an image."));
4967
4967
  }));
4968
- }), ul = (s) => hl(new Image(), s), dl = [
4968
+ }), dl = (s) => ul(new Image(), s), fl = [
4969
4969
  1,
4970
4970
  // L (black-white)
4971
4971
  3
4972
4972
  // RGB
4973
- ], fl = [
4973
+ ], pl = [
4974
4974
  192,
4975
4975
  // ("SOF0", "Baseline DCT", SOF)
4976
4976
  193,
@@ -4997,7 +4997,7 @@ const ol = () => new Promise((s) => {
4997
4997
  // ("SOF14", "Differential progressive DCT (AC)", SOF)
4998
4998
  207
4999
4999
  // ("SOF15", "Differential spatial (AC)", SOF)
5000
- ], Ri = {
5000
+ ], Mi = {
5001
5001
  squareSide: [
5002
5002
  // Safari (iOS < 9, ram >= 256)
5003
5003
  // We are supported mobile safari < 9 since widget v2, by 5 Mpx limit
@@ -5041,22 +5041,22 @@ const ol = () => new Promise((s) => {
5041
5041
  // but we will not use them
5042
5042
  65535
5043
5043
  ]
5044
- }, pl = async (s) => {
5044
+ }, ml = async (s) => {
5045
5045
  let i = !1;
5046
5046
  const { promiseReadJpegChunks: e, stack: t } = yt();
5047
5047
  return await e(s).then(() => (t.forEach(({ marker: r, view: n }) => {
5048
- if (!i && fl.indexOf(r) >= 0) {
5048
+ if (!i && pl.indexOf(r) >= 0) {
5049
5049
  const o = n.getUint8(5);
5050
- dl.indexOf(o) < 0 && (i = !0);
5050
+ fl.indexOf(o) < 0 && (i = !0);
5051
5051
  }
5052
5052
  }), i)).catch(() => i);
5053
- }, ks = (s, i) => {
5053
+ }, Os = (s, i) => {
5054
5054
  const e = {};
5055
5055
  return (...t) => {
5056
5056
  const r = i(t, e);
5057
5057
  return r in e ? e[r] : e[r] = s(...t);
5058
5058
  };
5059
- }, Os = (s, i) => {
5059
+ }, Ps = (s, i) => {
5060
5060
  const [e] = s, t = Object.keys(i).map((r) => parseInt(r, 10)).sort((r, n) => r - n);
5061
5061
  for (let r = 0; r < t.length; r++) {
5062
5062
  const n = t[r], o = !!i[n];
@@ -5064,25 +5064,25 @@ const ol = () => new Promise((s) => {
5064
5064
  return n;
5065
5065
  }
5066
5066
  return e;
5067
- }, de = {
5067
+ }, ue = {
5068
5068
  R: 55,
5069
5069
  G: 110,
5070
5070
  B: 165,
5071
5071
  A: 255
5072
- }, ml = `rgba(${de.R}, ${de.G}, ${de.B}, ${de.A / 255})`, Ps = (s, i) => {
5072
+ }, gl = `rgba(${ue.R}, ${ue.G}, ${ue.B}, ${ue.A / 255})`, Ls = (s, i) => {
5073
5073
  try {
5074
5074
  const e = [s - 1, i - 1, 1, 1], { canvas: t, ctx: r } = Ge();
5075
5075
  t.width = 1, t.height = 1;
5076
5076
  const { canvas: n, ctx: o } = Ge();
5077
- n.width = s, n.height = i, o && (o.fillStyle = ml, o.fillRect(...e), r.drawImage(n, s - 1, i - 1, 1, 1, 0, 0, 1, 1));
5077
+ n.width = s, n.height = i, o && (o.fillStyle = gl, o.fillRect(...e), r.drawImage(n, s - 1, i - 1, 1, 1, 0, 0, 1, 1));
5078
5078
  const l = r && r.getImageData(0, 0, 1, 1).data;
5079
5079
  let a = !1;
5080
- return l && (a = l[0] === de.R && l[1] === de.G && l[2] === de.B && l[3] === de.A), n.width = n.height = 1, a;
5080
+ return l && (a = l[0] === ue.R && l[1] === ue.G && l[2] === ue.B && l[3] === ue.A), n.width = n.height = 1, a;
5081
5081
  } catch {
5082
5082
  return console.error(`Failed to test for max canvas size of ${s}x${i}.`), !1;
5083
5083
  }
5084
5084
  };
5085
- function Ls(s) {
5085
+ function Us(s) {
5086
5086
  return (...i) => new Promise((e) => {
5087
5087
  setTimeout(() => {
5088
5088
  const t = s(...i);
@@ -5090,71 +5090,71 @@ function Ls(s) {
5090
5090
  }, 0);
5091
5091
  });
5092
5092
  }
5093
- const gl = Ls(ks(Ps, Os)), bl = Ls(ks(Ps, Os)), Us = async (s, i) => {
5094
- const e = Ri.squareSide.find((o) => o * o >= s * i), t = Ri.dimension.find((o) => o >= s && o >= i);
5093
+ const bl = Us(Os(Ls, Ps)), _l = Us(Os(Ls, Ps)), Rs = async (s, i) => {
5094
+ const e = Mi.squareSide.find((o) => o * o >= s * i), t = Mi.dimension.find((o) => o >= s && o >= i);
5095
5095
  if (!e || !t)
5096
5096
  throw new Error("Not supported");
5097
5097
  const [r, n] = await Promise.all([
5098
- gl(e, e),
5099
- bl(t, 1)
5098
+ bl(e, e),
5099
+ _l(t, 1)
5100
5100
  ]);
5101
5101
  if (r && n)
5102
5102
  return !0;
5103
5103
  throw new Error("Not supported");
5104
- }, Rs = async (s, i, e) => {
5104
+ }, Ms = async (s, i, e) => {
5105
5105
  try {
5106
5106
  const { ctx: t, canvas: r } = Ge();
5107
5107
  return r.width = i, r.height = e, t.imageSmoothingQuality = "high", t.drawImage(s, 0, 0, i, e), s instanceof HTMLImageElement && (s.src = "//:0"), s instanceof HTMLCanvasElement && (s.width = s.height = 1), r;
5108
5108
  } catch (t) {
5109
5109
  throw new Error("Canvas resize error", { cause: t });
5110
5110
  }
5111
- }, _l = ({ img: s, targetW: i, targetH: e }) => Rs(s, i, e), yl = function({ sourceW: s, targetW: i, targetH: e, step: t }) {
5111
+ }, yl = ({ img: s, targetW: i, targetH: e }) => Ms(s, i, e), vl = function({ sourceW: s, targetW: i, targetH: e, step: t }) {
5112
5112
  const r = [];
5113
5113
  let n = i, o = e;
5114
5114
  do
5115
5115
  r.push([n, o]), n = Math.round(n / t), o = Math.round(o / t);
5116
5116
  while (n < s * t);
5117
5117
  return r.reverse();
5118
- }, vl = ({ img: s, sourceW: i, targetW: e, targetH: t, step: r }) => yl({ sourceW: i, targetW: e, targetH: t, step: r }).reduce((o, [l, a]) => o.then((c) => Us(l, a).then(() => Rs(c, l, a)).catch(() => c)), Promise.resolve(s)), Cl = () => /iPad|iPhone|iPod/.test(navigator.platform) ? !0 : navigator.maxTouchPoints && navigator.maxTouchPoints > 2 && /MacIntel/.test(navigator.platform), wl = navigator.maxTouchPoints && navigator.maxTouchPoints > 2 && /MacIntel/.test(navigator.platform), xt = 0.71, El = (s, i) => {
5118
+ }, Cl = ({ img: s, sourceW: i, targetW: e, targetH: t, step: r }) => vl({ sourceW: i, targetW: e, targetH: t, step: r }).reduce((o, [l, a]) => o.then((c) => Rs(l, a).then(() => Ms(c, l, a)).catch(() => c)), Promise.resolve(s)), wl = () => /iPad|iPhone|iPod/.test(navigator.platform) ? !0 : navigator.maxTouchPoints && navigator.maxTouchPoints > 2 && /MacIntel/.test(navigator.platform), El = navigator.maxTouchPoints && navigator.maxTouchPoints > 2 && /MacIntel/.test(navigator.platform), xt = 0.71, Al = (s, i) => {
5119
5119
  if (s.width * xt * s.height * xt < i.size)
5120
5120
  throw new Error("Not required");
5121
5121
  const e = s.width, t = s.height, r = e / t, n = Math.floor(Math.sqrt(i.size * r)), o = Math.floor(i.size / Math.sqrt(i.size * r));
5122
- return Us(n, o).then(() => {
5122
+ return Rs(n, o).then(() => {
5123
5123
  const { ctx: l } = Ge();
5124
- return "imageSmoothingQuality" in l && !Cl() && !wl ? _l({ img: s, targetW: n, targetH: o }) : vl({ img: s, sourceW: e, targetW: n, targetH: o, step: xt });
5124
+ return "imageSmoothingQuality" in l && !wl() && !El ? yl({ img: s, targetW: n, targetH: o }) : Cl({ img: s, sourceW: e, targetW: n, targetH: o, step: xt });
5125
5125
  }).catch(() => Promise.reject("Not supported"));
5126
- }, Al = async (s, i) => {
5126
+ }, Tl = async (s, i) => {
5127
5127
  try {
5128
- if (await pl(s))
5128
+ if (await ml(s))
5129
5129
  throw new Error("Should skipped");
5130
5130
  const t = await Promise.allSettled([
5131
- rl(s),
5132
- ol(),
5133
- Qo(s)
5134
- ]), n = !t.some((g) => g.status === "rejected"), [o, l, a] = t, c = await tl(s).catch(() => s), h = await ul(URL.createObjectURL(c));
5131
+ nl(s),
5132
+ ll(),
5133
+ el(s)
5134
+ ]), n = !t.some((g) => g.status === "rejected"), [o, l, a] = t, c = await il(s).catch(() => s), h = await dl(URL.createObjectURL(c));
5135
5135
  URL.revokeObjectURL(h.src);
5136
- const d = await El(h, i);
5136
+ const d = await Al(h, i);
5137
5137
  let f = "image/jpeg", m = (i == null ? void 0 : i.quality) || 0.8;
5138
- !n && sl(d) && (f = "image/png", m = void 0);
5139
- let p = await il(d, f, m);
5138
+ !n && rl(d) && (f = "image/png", m = void 0);
5139
+ let p = await sl(d, f, m);
5140
5140
  if (n && o.status === "fulfilled" && o.value) {
5141
5141
  const g = o.value, A = l.status === "fulfilled" ? l.value : !1;
5142
- p = await cl(p, g, A);
5142
+ p = await hl(p, g, A);
5143
5143
  }
5144
- return n && a.status === "fulfilled" && a.value.length > 0 && (p = await Is(p, a.value)), p;
5144
+ return n && a.status === "fulfilled" && a.value.length > 0 && (p = await ks(p, a.value)), p;
5145
5145
  } catch (e) {
5146
5146
  let t;
5147
5147
  throw e instanceof Error && (t = e.message), typeof e == "string" && (t = e), new Error(`Failed to shrink image. ${t ? `Message: "${t}".` : ""}`, { cause: e });
5148
5148
  }
5149
5149
  };
5150
- function Ms(s) {
5150
+ function Fs(s) {
5151
5151
  let i = new Blob([s], {
5152
5152
  type: "image/svg+xml"
5153
5153
  });
5154
5154
  return URL.createObjectURL(i);
5155
5155
  }
5156
- function Tl(s = "#fff", i = "rgba(0, 0, 0, .1)") {
5157
- return Ms(
5156
+ function $l(s = "#fff", i = "rgba(0, 0, 0, .1)") {
5157
+ return Fs(
5158
5158
  /*svg*/
5159
5159
  `<svg height="20" width="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
5160
5160
  <rect x="0" y="0" width="20" height="20" fill="${s}" />
@@ -5164,7 +5164,7 @@ function Tl(s = "#fff", i = "rgba(0, 0, 0, .1)") {
5164
5164
  );
5165
5165
  }
5166
5166
  function Mt(s = "hsl(209, 21%, 65%)", i = 32, e = 32) {
5167
- return Ms(
5167
+ return Fs(
5168
5168
  /*svg*/
5169
5169
  `
5170
5170
  <svg width="${i}" height="${e}" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -5173,7 +5173,7 @@ function Mt(s = "hsl(209, 21%, 65%)", i = 32, e = 32) {
5173
5173
  `
5174
5174
  );
5175
5175
  }
5176
- function $l(s, i = 40) {
5176
+ function Sl(s, i = 40) {
5177
5177
  if (s.type === "image/svg+xml")
5178
5178
  return URL.createObjectURL(s);
5179
5179
  let e = document.createElement("canvas"), t = e.getContext("2d"), r = new Image(), n = new Promise((o, l) => {
@@ -5193,11 +5193,11 @@ function $l(s, i = 40) {
5193
5193
  });
5194
5194
  return r.src = URL.createObjectURL(s), n;
5195
5195
  }
5196
- const Mi = 16384, Sl = /^([0-9]+)x([0-9]+)(?:\s+(\d{1,2}|100)%)?$/i, xl = (s) => {
5197
- const i = Sl.exec(s == null ? void 0 : s.toLocaleLowerCase()) || [];
5196
+ const Fi = 16384, xl = /^([0-9]+)x([0-9]+)(?:\s+(\d{1,2}|100)%)?$/i, Il = (s) => {
5197
+ const i = xl.exec(s == null ? void 0 : s.toLocaleLowerCase()) || [];
5198
5198
  if (!i.length)
5199
5199
  return !1;
5200
- const e = i[1] * i[2], t = Mi * Mi;
5200
+ const e = i[1] * i[2], t = Fi * Fi;
5201
5201
  return e > t ? (console.warn(
5202
5202
  `Shrinked size can not be larger than ${Math.floor(t / 1e3 / 1e3)}MP. You have set ${i[1]}x${i[2]} (${Math.ceil(e / 1e3 / 100) / 10}MP).`
5203
5203
  ), !1) : {
@@ -5210,7 +5210,7 @@ const Mi = 16384, Sl = /^([0-9]+)x([0-9]+)(?:\s+(\d{1,2}|100)%)?$/i, xl = (s) =>
5210
5210
  UPLOADING: Symbol(2),
5211
5211
  IDLE: Symbol(3)
5212
5212
  });
5213
- class Ee extends $ {
5213
+ class we extends $ {
5214
5214
  constructor() {
5215
5215
  super();
5216
5216
  u(this, "couldBeCtxOwner", !0);
@@ -5288,7 +5288,7 @@ class Ee extends $ {
5288
5288
  let r = this.cfg.thumbSize, n = this.proxyUrl(
5289
5289
  V(
5290
5290
  qe(this.cfg.cdnCname, this._entry.getValue("uuid")),
5291
- ae(e.getValue("cdnUrlModifiers"), `scale_crop/${r}x${r}/center`)
5291
+ le(e.getValue("cdnUrlModifiers"), `scale_crop/${r}x${r}/center`)
5292
5292
  )
5293
5293
  ), o = e.getValue("thumbUrl");
5294
5294
  o !== n && (e.setValue("thumbUrl", n), o != null && o.startsWith("blob:") && URL.revokeObjectURL(o));
@@ -5297,7 +5297,7 @@ class Ee extends $ {
5297
5297
  if (!e.getValue("thumbUrl"))
5298
5298
  if ((t = e.getValue("file")) != null && t.type.includes("image"))
5299
5299
  try {
5300
- let r = await $l(e.getValue("file"), this.cfg.thumbSize);
5300
+ let r = await Sl(e.getValue("file"), this.cfg.thumbSize);
5301
5301
  e.setValue("thumbUrl", r);
5302
5302
  } catch {
5303
5303
  let n = window.getComputedStyle(this).getPropertyValue("--clr-generic-file-icon");
@@ -5351,7 +5351,7 @@ class Ee extends $ {
5351
5351
  }), this.sub("state", (e) => {
5352
5352
  this._handleState(e);
5353
5353
  }), this.subConfigValue("useCloudImageEditor", () => this._debouncedCalculateState()), this.onclick = () => {
5354
- Ee.activeInstances.forEach((e) => {
5354
+ we.activeInstances.forEach((e) => {
5355
5355
  e === this ? e.setAttribute("focused", "") : e.removeAttribute("focused");
5356
5356
  });
5357
5357
  }, this.sub(
@@ -5360,7 +5360,7 @@ class Ee extends $ {
5360
5360
  (e) => {
5361
5361
  e.has(this._entry.uid) && setTimeout(() => this.isConnected && this.upload());
5362
5362
  }
5363
- ), Ee.activeInstances.add(this);
5363
+ ), we.activeInstances.add(this);
5364
5364
  }
5365
5365
  /** @param {(typeof FileItemState)[keyof typeof FileItemState]} state */
5366
5366
  _handleState(e) {
@@ -5375,7 +5375,7 @@ class Ee extends $ {
5375
5375
  });
5376
5376
  }
5377
5377
  destroyCallback() {
5378
- super.destroyCallback(), Ee.activeInstances.delete(this), this._reset();
5378
+ super.destroyCallback(), we.activeInstances.delete(this), this._reset();
5379
5379
  }
5380
5380
  connectedCallback() {
5381
5381
  super.connectedCallback(), this._observer = new window.IntersectionObserver(this._observerCallback.bind(this), {
@@ -5389,14 +5389,14 @@ class Ee extends $ {
5389
5389
  super.disconnectedCallback(), this._debouncedGenerateThumb.cancel(), (e = this._observer) == null || e.disconnect();
5390
5390
  }
5391
5391
  _settingsOfShrink() {
5392
- return xl(this.cfg.imageShrink);
5392
+ return Il(this.cfg.imageShrink);
5393
5393
  }
5394
5394
  /**
5395
5395
  * @private
5396
5396
  * @param {File} file
5397
5397
  */
5398
5398
  _processShrink(e) {
5399
- return Al(e, this._settingsOfShrink());
5399
+ return Tl(e, this._settingsOfShrink());
5400
5400
  }
5401
5401
  async upload() {
5402
5402
  var r, n;
@@ -5425,7 +5425,7 @@ class Ee extends $ {
5425
5425
  signal: o.signal,
5426
5426
  metadata: await this.getMetadataFor(e.uid)
5427
5427
  };
5428
- return this.debugPrint("upload options", h, f), cs(h, f);
5428
+ return this.debugPrint("upload options", h, f), hs(h, f);
5429
5429
  };
5430
5430
  let a = await this.$["*uploadQueue"].add(l);
5431
5431
  e.setMultipleValues({
@@ -5441,7 +5441,7 @@ class Ee extends $ {
5441
5441
  uploadProgress: 100
5442
5442
  }), e === this._entry && this._debouncedCalculateState();
5443
5443
  } catch (o) {
5444
- o instanceof Ae && o.isCancel ? e.setMultipleValues({
5444
+ o instanceof Ee && o.isCancel ? e.setMultipleValues({
5445
5445
  isUploading: !1,
5446
5446
  uploadProgress: 0
5447
5447
  }) : e.setMultipleValues({
@@ -5453,7 +5453,7 @@ class Ee extends $ {
5453
5453
  }
5454
5454
  }
5455
5455
  }
5456
- Ee.template = /* HTML */
5456
+ we.template = /* HTML */
5457
5457
  `
5458
5458
  <div class="inner" set="@finished: isFinished; @uploading: isUploading; @failed: isFailed; @focused: isFocused">
5459
5459
  <div class="thumb" set="style.backgroundImage: thumbUrl">
@@ -5479,8 +5479,8 @@ Ee.template = /* HTML */
5479
5479
  <lr-progress-bar class="progress-bar" set="value: progressValue; visible: progressVisible;"> </lr-progress-bar>
5480
5480
  </div>
5481
5481
  `;
5482
- Ee.activeInstances = /* @__PURE__ */ new Set();
5483
- class ei extends k {
5482
+ we.activeInstances = /* @__PURE__ */ new Set();
5483
+ class ei extends I {
5484
5484
  constructor() {
5485
5485
  super();
5486
5486
  u(this, "_handleBackdropClick", () => {
@@ -5540,7 +5540,7 @@ ei.template = /* HTML */
5540
5540
  <slot></slot>
5541
5541
  </dialog>
5542
5542
  `;
5543
- const Fs = (s, i) => {
5543
+ const Ns = (s, i) => {
5544
5544
  let e, t, r;
5545
5545
  const n = (...o) => {
5546
5546
  e ? (clearTimeout(t), t = setTimeout(
@@ -5561,7 +5561,7 @@ const Fs = (s, i) => {
5561
5561
  /** @type {unknown} */
5562
5562
  n;
5563
5563
  };
5564
- class Ns extends $ {
5564
+ class Ds extends $ {
5565
5565
  constructor() {
5566
5566
  super();
5567
5567
  // Context owner should have access to CSS l10n
@@ -5570,7 +5570,7 @@ class Ns extends $ {
5570
5570
  u(this, "historyTracked", !0);
5571
5571
  u(this, "activityType", b.activities.UPLOAD_LIST);
5572
5572
  /** @private */
5573
- u(this, "_throttledHandleCollectionUpdate", Fs(() => {
5573
+ u(this, "_throttledHandleCollectionUpdate", Ns(() => {
5574
5574
  this.isConnected && (this._updateUploadsState(), !this.couldOpenActivity && this.$["*currentActivity"] === this.activityType && this.historyBack());
5575
5575
  }, 300));
5576
5576
  this.init$ = {
@@ -5665,7 +5665,7 @@ class Ns extends $ {
5665
5665
  super.destroyCallback(), this.uploadCollection.unobserveProperties(this._throttledHandleCollectionUpdate);
5666
5666
  }
5667
5667
  }
5668
- Ns.template = /* HTML */
5668
+ Ds.template = /* HTML */
5669
5669
  `
5670
5670
  <lr-activity-header>
5671
5671
  <span class="header-text">{{headerText}}</span>
@@ -5708,7 +5708,7 @@ Ns.template = /* HTML */
5708
5708
 
5709
5709
  <lr-drop-area ghost></lr-drop-area>
5710
5710
  `;
5711
- class Ds extends $ {
5711
+ class zs extends $ {
5712
5712
  constructor() {
5713
5713
  super(...arguments);
5714
5714
  u(this, "couldBeCtxOwner", !0);
@@ -5741,7 +5741,7 @@ class Ds extends $ {
5741
5741
  });
5742
5742
  }
5743
5743
  }
5744
- Ds.template = /* HTML */
5744
+ zs.template = /* HTML */
5745
5745
  `
5746
5746
  <lr-activity-header>
5747
5747
  <button type="button" class="mini-btn" set="onclick: *historyBack">
@@ -5764,8 +5764,8 @@ Ds.template = /* HTML */
5764
5764
  ></button>
5765
5765
  </form>
5766
5766
  `;
5767
- const Fi = () => typeof navigator.permissions < "u";
5768
- class zs extends $ {
5767
+ const Ni = () => typeof navigator.permissions < "u";
5768
+ class Vs extends $ {
5769
5769
  constructor() {
5770
5770
  super(...arguments);
5771
5771
  u(this, "couldBeCtxOwner", !0);
@@ -5779,7 +5779,7 @@ class zs extends $ {
5779
5779
  shotBtnDisabled: !0,
5780
5780
  videoHidden: !0,
5781
5781
  messageHidden: !0,
5782
- requestBtnHidden: Fi(),
5782
+ requestBtnHidden: Ni(),
5783
5783
  l10nMessage: null,
5784
5784
  originalErrorMessage: null,
5785
5785
  cameraSelectOptions: null,
@@ -5799,7 +5799,7 @@ class zs extends $ {
5799
5799
  });
5800
5800
  /** @private */
5801
5801
  u(this, "_onActivate", () => {
5802
- Fi() && this._subscribePermissions(), this._capture();
5802
+ Ni() && this._subscribePermissions(), this._capture();
5803
5803
  });
5804
5804
  /** @private */
5805
5805
  u(this, "_onDeactivate", () => {
@@ -5902,7 +5902,7 @@ class zs extends $ {
5902
5902
  }
5903
5903
  }
5904
5904
  }
5905
- zs.template = /* HTML */
5905
+ Vs.template = /* HTML */
5906
5906
  `
5907
5907
  <lr-activity-header>
5908
5908
  <button type="button" class="mini-btn" set="onclick: *historyBack">
@@ -5942,7 +5942,7 @@ zs.template = /* HTML */
5942
5942
  </button>
5943
5943
  </div>
5944
5944
  `;
5945
- class Vs extends $ {
5945
+ class Bs extends $ {
5946
5946
  constructor() {
5947
5947
  super(...arguments);
5948
5948
  u(this, "requireCtxName", !0);
@@ -5954,13 +5954,13 @@ class Vs extends $ {
5954
5954
  super.destroyCallback(), this.$["*eventEmitter"].unbindTarget(this);
5955
5955
  }
5956
5956
  }
5957
- Vs.EventType = S;
5957
+ Bs.EventType = S;
5958
5958
  const Ft = (
5959
5959
  /** @type {UploadCtxProvider} */
5960
5960
  /** @type {unknown} */
5961
- Vs
5961
+ Bs
5962
5962
  );
5963
- class Bs extends $ {
5963
+ class js extends $ {
5964
5964
  constructor() {
5965
5965
  super(...arguments);
5966
5966
  u(this, "activityType", b.activities.DETAILS);
@@ -6034,14 +6034,14 @@ class Bs extends $ {
6034
6034
  cdnUrl: n,
6035
6035
  cloudEditBtnHidden: !o
6036
6036
  }), n && this.entry.getValue("isImage")) {
6037
- let l = V(n, ae("format/auto", "preview"));
6037
+ let l = V(n, le("format/auto", "preview"));
6038
6038
  this.ref.filePreview.setImageUrl(this.proxyUrl(l));
6039
6039
  }
6040
6040
  });
6041
6041
  });
6042
6042
  }
6043
6043
  }
6044
- Bs.template = /* HTML */
6044
+ js.template = /* HTML */
6045
6045
  `
6046
6046
  <lr-activity-header>
6047
6047
  <button type="button" class="mini-btn" set="onclick: *historyBack">
@@ -6097,7 +6097,7 @@ Bs.template = /* HTML */
6097
6097
  </div>
6098
6098
  </div>
6099
6099
  `;
6100
- class Il {
6100
+ class kl {
6101
6101
  constructor() {
6102
6102
  u(this, "captionL10nStr", "confirm-your-action");
6103
6103
  u(this, "messageL10Str", "are-you-sure");
@@ -6111,12 +6111,12 @@ class Il {
6111
6111
  this.historyBack();
6112
6112
  }
6113
6113
  }
6114
- class js extends b {
6114
+ class Hs extends b {
6115
6115
  constructor() {
6116
6116
  super(...arguments);
6117
6117
  u(this, "activityType", b.activities.CONFIRMATION);
6118
6118
  /** @private */
6119
- u(this, "_defaults", new Il());
6119
+ u(this, "_defaults", new kl());
6120
6120
  u(this, "init$", {
6121
6121
  ...this.init$,
6122
6122
  activityCaption: "",
@@ -6150,7 +6150,7 @@ class js extends b {
6150
6150
  });
6151
6151
  }
6152
6152
  }
6153
- js.template = /* HTML */
6153
+ Hs.template = /* HTML */
6154
6154
  `
6155
6155
  <lr-activity-header>
6156
6156
  <button type="button" class="mini-btn" set="onclick: *historyBack">
@@ -6168,7 +6168,7 @@ js.template = /* HTML */
6168
6168
  <button type="button" class="confirm-btn primary-btn" set="onclick: onConfirm">{{confirmBtnTxt}}</button>
6169
6169
  </div>
6170
6170
  `;
6171
- class Hs extends $ {
6171
+ class Ws extends $ {
6172
6172
  constructor() {
6173
6173
  super(...arguments);
6174
6174
  u(this, "init$", {
@@ -6193,9 +6193,9 @@ class Hs extends $ {
6193
6193
  super.destroyCallback(), (e = this._unobserveCollection) == null || e.call(this);
6194
6194
  }
6195
6195
  }
6196
- Hs.template = /* HTML */
6196
+ Ws.template = /* HTML */
6197
6197
  ' <lr-progress-bar set="visible: visible; value: value"></lr-progress-bar> ';
6198
- class Ws extends k {
6198
+ class qs extends I {
6199
6199
  constructor() {
6200
6200
  super(...arguments);
6201
6201
  /** @type {Number} */
@@ -6223,21 +6223,21 @@ class Ws extends k {
6223
6223
  });
6224
6224
  }
6225
6225
  }
6226
- Ws.template = /* HTML */
6226
+ qs.template = /* HTML */
6227
6227
  ' <div ref="line" class="progress"></div> ';
6228
- const me = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=";
6229
- class ti extends k {
6228
+ const pe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=";
6229
+ class ti extends I {
6230
6230
  constructor() {
6231
6231
  super();
6232
6232
  u(this, "init$", {
6233
6233
  ...this.init$,
6234
6234
  checkerboard: !1,
6235
- src: me
6235
+ src: pe
6236
6236
  });
6237
6237
  }
6238
6238
  initCallback() {
6239
6239
  super.initCallback(), this.sub("checkerboard", () => {
6240
- this.style.backgroundImage = this.hasAttribute("checkerboard") ? `url(${Tl()})` : "unset";
6240
+ this.style.backgroundImage = this.hasAttribute("checkerboard") ? `url(${$l()})` : "unset";
6241
6241
  });
6242
6242
  }
6243
6243
  destroyCallback() {
@@ -6257,7 +6257,7 @@ class ti extends k {
6257
6257
  this.$.src = e;
6258
6258
  }
6259
6259
  clear() {
6260
- URL.revokeObjectURL(this._lastObjectUrl), this.$.src = me;
6260
+ URL.revokeObjectURL(this._lastObjectUrl), this.$.src = pe;
6261
6261
  }
6262
6262
  }
6263
6263
  ti.template = /* HTML */
@@ -6265,14 +6265,14 @@ ti.template = /* HTML */
6265
6265
  ti.bindAttributes({
6266
6266
  checkerboard: "checkerboard"
6267
6267
  });
6268
- const Ni = "--cfg-ctx-name";
6269
- class _e extends k {
6268
+ const Di = "--cfg-ctx-name";
6269
+ class be extends I {
6270
6270
  /**
6271
6271
  * @private
6272
6272
  * @returns {string}
6273
6273
  */
6274
6274
  get cfgCssCtxName() {
6275
- return this.getCssData(Ni, !0);
6275
+ return this.getCssData(Di, !0);
6276
6276
  }
6277
6277
  /** @private */
6278
6278
  get cfgCtxName() {
@@ -6286,7 +6286,7 @@ class _e extends k {
6286
6286
  var i;
6287
6287
  if (!this.connectedOnce) {
6288
6288
  const e = (i = this.getAttribute("ctx-name")) == null ? void 0 : i.trim();
6289
- e && this.style.setProperty(Ni, `'${e}'`);
6289
+ e && this.style.setProperty(Di, `'${e}'`);
6290
6290
  }
6291
6291
  super.connectedCallback();
6292
6292
  }
@@ -6307,7 +6307,7 @@ class _e extends k {
6307
6307
  return this.cfgCtxName;
6308
6308
  }
6309
6309
  }
6310
- function qs(...s) {
6310
+ function Gs(...s) {
6311
6311
  return s.reduce((i, e) => {
6312
6312
  if (typeof e == "string")
6313
6313
  return i[e] = !0, i;
@@ -6317,21 +6317,21 @@ function qs(...s) {
6317
6317
  }, {});
6318
6318
  }
6319
6319
  function X(...s) {
6320
- let i = qs(...s);
6320
+ let i = Gs(...s);
6321
6321
  return Object.keys(i).reduce((e, t) => (i[t] && e.push(t), e), []).join(" ");
6322
6322
  }
6323
- function kl(s, ...i) {
6324
- let e = qs(...i);
6323
+ function Ol(s, ...i) {
6324
+ let e = Gs(...i);
6325
6325
  for (let t of Object.keys(e))
6326
6326
  s.classList.toggle(t, e[t]);
6327
6327
  }
6328
- const Ol = (s) => {
6328
+ const Pl = (s) => {
6329
6329
  if (!s)
6330
6330
  return ee;
6331
- const i = ro(s).filter((e) => ee.includes(e));
6331
+ const i = no(s).filter((e) => ee.includes(e));
6332
6332
  return i.length === 0 ? ee : i;
6333
6333
  };
6334
- function Pl(s) {
6334
+ function Ll(s) {
6335
6335
  return {
6336
6336
  "*originalUrl": null,
6337
6337
  "*faderEl": null,
@@ -6352,7 +6352,7 @@ function Pl(s) {
6352
6352
  modalCaption: "",
6353
6353
  isImage: !1,
6354
6354
  msg: "",
6355
- src: me,
6355
+ src: pe,
6356
6356
  fileType: "",
6357
6357
  showLoader: !1,
6358
6358
  // options
@@ -6369,7 +6369,7 @@ function Pl(s) {
6369
6369
  let i = s.querySelectorAll("img");
6370
6370
  for (let e of i) {
6371
6371
  let t = e.src;
6372
- e.src = me, e.src = t;
6372
+ e.src = pe, e.src = t;
6373
6373
  }
6374
6374
  s.$["*networkProblems"] = !1;
6375
6375
  },
@@ -6377,7 +6377,7 @@ function Pl(s) {
6377
6377
  "*on.apply": (i) => {
6378
6378
  if (!i)
6379
6379
  return;
6380
- let e = s.$["*originalUrl"], t = ae(_t(i), "preview"), r = V(e, t), n = {
6380
+ let e = s.$["*originalUrl"], t = le(_t(i), "preview"), r = V(e, t), n = {
6381
6381
  originalUrl: e,
6382
6382
  cdnUrlModifiers: t,
6383
6383
  cdnUrl: r,
@@ -6401,7 +6401,7 @@ function Pl(s) {
6401
6401
  }
6402
6402
  };
6403
6403
  }
6404
- const Ll = (
6404
+ const Ul = (
6405
6405
  /* HTML */
6406
6406
  `
6407
6407
  <div class="wrapper wrapper_desktop">
@@ -6421,7 +6421,7 @@ const Ll = (
6421
6421
  <div class="file_type">{{fileType}}</div>
6422
6422
  </div>
6423
6423
  <div class="image_container" ref="img-container-el">
6424
- <img src="${me}" class="image image_visible_from_editor" ref="img-el" />
6424
+ <img src="${pe}" class="image image_visible_from_editor" ref="img-el" />
6425
6425
  <lr-editor-image-cropper ref="cropper-el"></lr-editor-image-cropper>
6426
6426
  <lr-editor-image-fader ref="fader-el"></lr-editor-image-fader>
6427
6427
  </div>
@@ -6436,14 +6436,14 @@ const Ll = (
6436
6436
  </div>
6437
6437
  `
6438
6438
  );
6439
- class Ne extends _e {
6439
+ class Ne extends be {
6440
6440
  constructor() {
6441
6441
  super();
6442
6442
  /** @private */
6443
6443
  u(this, "_debouncedShowLoader", H(this._showLoader.bind(this), 300));
6444
6444
  this.init$ = {
6445
6445
  ...this.init$,
6446
- ...Pl(this)
6446
+ ...Ll(this)
6447
6447
  };
6448
6448
  }
6449
6449
  /** Force cloud editor to always use own context */
@@ -6479,11 +6479,11 @@ class Ne extends _e {
6479
6479
  async updateImage() {
6480
6480
  if (this.isConnected) {
6481
6481
  if (await this._waitForSize(), this.$.cdnUrl) {
6482
- const e = oo(this.$.cdnUrl), t = qe(this.$.cdnUrl, e);
6482
+ const e = lo(this.$.cdnUrl), t = qe(this.$.cdnUrl, e);
6483
6483
  if (t === this.$["*originalUrl"])
6484
6484
  return;
6485
6485
  this.$["*originalUrl"] = t;
6486
- const r = lo(this.$.cdnUrl), n = To(r);
6486
+ const r = ao(this.$.cdnUrl), n = $o(r);
6487
6487
  this.$["*editorTransformations"] = n;
6488
6488
  } else if (this.$.uuid) {
6489
6489
  const e = qe(this.cfg.cdnCname, this.$.uuid);
@@ -6494,7 +6494,7 @@ class Ne extends _e {
6494
6494
  throw new Error("No UUID nor CDN URL provided");
6495
6495
  this.$["*tabId"] === L.CROP ? this.$["*cropperEl"].deactivate({ reset: !0 }) : this.$["*faderEl"].deactivate();
6496
6496
  try {
6497
- const e = V(this.$["*originalUrl"], ae("json")), t = await fetch(e).then((o) => o.json()), { width: r, height: n } = (
6497
+ const e = V(this.$["*originalUrl"], le("json")), t = await fetch(e).then((o) => o.json()), { width: r, height: n } = (
6498
6498
  /** @type {{ width: number; height: number }} */
6499
6499
  t
6500
6500
  );
@@ -6512,19 +6512,19 @@ class Ne extends _e {
6512
6512
  return;
6513
6513
  }
6514
6514
  this.ref["img-el"].addEventListener("load", () => {
6515
- this._imgLoading = !1, this._debouncedShowLoader(!1), this.$.src !== me && (this.$["*networkProblems"] = !1);
6515
+ this._imgLoading = !1, this._debouncedShowLoader(!1), this.$.src !== pe && (this.$["*networkProblems"] = !1);
6516
6516
  }), this.ref["img-el"].addEventListener("error", () => {
6517
6517
  this._imgLoading = !1, this._debouncedShowLoader(!1), this.$["*networkProblems"] = !0;
6518
6518
  }), this.sub("src", (e) => {
6519
6519
  let t = this.ref["img-el"];
6520
- t.src !== e && (this._imgLoading = !0, t.src = e || me);
6520
+ t.src !== e && (this._imgLoading = !0, t.src = e || pe);
6521
6521
  }), this.sub("cropPreset", (e) => {
6522
- this.$["*cropPresetList"] = ps(e);
6522
+ this.$["*cropPresetList"] = ms(e);
6523
6523
  }), this.sub(
6524
6524
  "tabs",
6525
6525
  /** @param {string} val */
6526
6526
  (e) => {
6527
- this.$["*tabList"] = Ol(e);
6527
+ this.$["*tabList"] = Pl(e);
6528
6528
  }
6529
6529
  ), this.sub("*tabId", (e) => {
6530
6530
  this.ref["img-el"].className = X("image", {
@@ -6538,7 +6538,7 @@ class Ne extends _e {
6538
6538
  (e) => {
6539
6539
  if (Object.keys(e).length === 0)
6540
6540
  return;
6541
- let t = this.$["*originalUrl"], r = ae(_t(e), "preview"), n = V(t, r), o = {
6541
+ let t = this.$["*originalUrl"], r = le(_t(e), "preview"), n = V(t, r), o = {
6542
6542
  originalUrl: t,
6543
6543
  cdnUrlModifiers: r,
6544
6544
  cdnUrl: n,
@@ -6557,14 +6557,14 @@ class Ne extends _e {
6557
6557
  }
6558
6558
  }
6559
6559
  u(Ne, "className", "cloud-image-editor");
6560
- Ne.template = Ll;
6560
+ Ne.template = Ul;
6561
6561
  Ne.bindAttributes({
6562
6562
  uuid: "uuid",
6563
6563
  "cdn-url": "cdnUrl",
6564
6564
  "crop-preset": "cropPreset",
6565
6565
  tabs: "tabs"
6566
6566
  });
6567
- class Gs extends _e {
6567
+ class Xs extends be {
6568
6568
  constructor() {
6569
6569
  super(), this.init$ = {
6570
6570
  ...this.init$,
@@ -6651,15 +6651,15 @@ class Gs extends _e {
6651
6651
  0,
6652
6652
  1
6653
6653
  );
6654
- let { d: g, center: A } = a ? Vn(i, t, p) : Bn(
6654
+ let { d: g, center: A } = a ? Bn(i, t, p) : jn(
6655
6655
  i,
6656
6656
  /** @type {Extract<import('./types.js').Direction, 'n' | 's' | 'w' | 'e'>} */
6657
6657
  t,
6658
6658
  p
6659
6659
  );
6660
6660
  const w = Math.max(
6661
- Ai * ke(Math.min(d, f) / Ai / 3, 0, 1),
6662
- zn
6661
+ Ti * ke(Math.min(d, f) / Ti / 3, 0, 1),
6662
+ Vn
6663
6663
  );
6664
6664
  Ie(n, {
6665
6665
  x: A[0] - w,
@@ -6678,10 +6678,10 @@ class Gs extends _e {
6678
6678
  );
6679
6679
  }
6680
6680
  Ie(this._frameGuides, {
6681
- x: i.x - ve * 0.5,
6682
- y: i.y - ve * 0.5,
6683
- width: i.width + ve,
6684
- height: i.height + ve
6681
+ x: i.x - ye * 0.5,
6682
+ y: i.y - ye * 0.5,
6683
+ width: i.width + ye,
6684
+ height: i.height + ye
6685
6685
  });
6686
6686
  }
6687
6687
  }
@@ -6700,7 +6700,7 @@ class Gs extends _e {
6700
6700
  }), l = q("path", {
6701
6701
  stroke: "currentColor",
6702
6702
  fill: "none",
6703
- "stroke-width": fs
6703
+ "stroke-width": ps
6704
6704
  });
6705
6705
  n.appendChild(l), n.appendChild(o), i[r] = {
6706
6706
  direction: r,
@@ -6720,7 +6720,7 @@ class Gs extends _e {
6720
6720
  height: "100%",
6721
6721
  fill: "none",
6722
6722
  stroke: "#000000",
6723
- "stroke-width": ve,
6723
+ "stroke-width": ye,
6724
6724
  "stroke-opacity": 0.5
6725
6725
  });
6726
6726
  i.appendChild(e);
@@ -6731,7 +6731,7 @@ class Gs extends _e {
6731
6731
  x2: `${Je * t}%`,
6732
6732
  y2: "100%",
6733
6733
  stroke: "#000000",
6734
- "stroke-width": ve,
6734
+ "stroke-width": ye,
6735
6735
  "stroke-opacity": 0.3
6736
6736
  });
6737
6737
  i.appendChild(r);
@@ -6743,7 +6743,7 @@ class Gs extends _e {
6743
6743
  x2: "100%",
6744
6744
  y2: `${Je * t}%`,
6745
6745
  stroke: "#000000",
6746
- "stroke-width": ve,
6746
+ "stroke-width": ye,
6747
6747
  "stroke-opacity": 0.3
6748
6748
  });
6749
6749
  i.appendChild(r);
@@ -6805,7 +6805,7 @@ class Gs extends _e {
6805
6805
  this._dragStartCrop ?? this.$["*cropBox"]
6806
6806
  );
6807
6807
  const l = (c = this.$["*cropPresetList"]) == null ? void 0 : c[0], a = l ? l.width / l.height : void 0;
6808
- if (i === "" ? o = Hn({ rect: o, delta: [t, r], imageBox: n }) : o = Qn({ rect: o, delta: [t, r], direction: i, aspectRatio: a, imageBox: n }), !Object.values(o).every((h) => Number.isFinite(h) && h >= 0)) {
6808
+ if (i === "" ? o = Wn({ rect: o, delta: [t, r], imageBox: n }) : o = eo({ rect: o, delta: [t, r], direction: i, aspectRatio: a, imageBox: n }), !Object.values(o).every((h) => Number.isFinite(h) && h >= 0)) {
6809
6809
  console.error("CropFrame is trying to create invalid rectangle", {
6810
6810
  payload: o
6811
6811
  });
@@ -6829,14 +6829,14 @@ class Gs extends _e {
6829
6829
  width: n.width,
6830
6830
  height: n.height
6831
6831
  };
6832
- return eo(o, [i.x, i.y]);
6832
+ return to(o, [i.x, i.y]);
6833
6833
  });
6834
6834
  this._hoverThumb = e, this._updateCursor();
6835
6835
  }
6836
6836
  /** @private */
6837
6837
  _updateCursor() {
6838
6838
  let i = this._hoverThumb;
6839
- this.ref["svg-el"].style.cursor = i ? jn(i.direction) : "initial";
6839
+ this.ref["svg-el"].style.cursor = i ? Hn(i.direction) : "initial";
6840
6840
  }
6841
6841
  /** @private */
6842
6842
  _render() {
@@ -6878,9 +6878,9 @@ class Gs extends _e {
6878
6878
  super.destroyCallback(), document.removeEventListener("pointermove", this._handlePointerMove), document.removeEventListener("pointerup", this._handlePointerUp);
6879
6879
  }
6880
6880
  }
6881
- Gs.template = /* HTML */
6881
+ Xs.template = /* HTML */
6882
6882
  ' <svg class="svg" ref="svg-el" xmlns="http://www.w3.org/2000/svg"></svg> ';
6883
- class vt extends _e {
6883
+ class vt extends be {
6884
6884
  constructor() {
6885
6885
  super(...arguments);
6886
6886
  u(this, "init$", {
@@ -6910,19 +6910,19 @@ vt.template = /* HTML */
6910
6910
  <lr-icon size="20" set="@name: icon;"></lr-icon>
6911
6911
  <div class="title" ref="title-el">{{title}}</div>
6912
6912
  `;
6913
- function Ul(s) {
6913
+ function Rl(s) {
6914
6914
  let i = s + 90;
6915
6915
  return i = i >= 360 ? 0 : i, i;
6916
6916
  }
6917
- function Rl(s, i) {
6918
- return s === "rotate" ? Ul(i) : ["mirror", "flip"].includes(s) ? !i : null;
6917
+ function Ml(s, i) {
6918
+ return s === "rotate" ? Rl(i) : ["mirror", "flip"].includes(s) ? !i : null;
6919
6919
  }
6920
- class Xs extends vt {
6920
+ class Ks extends vt {
6921
6921
  initCallback() {
6922
6922
  super.initCallback(), this.defineAccessor("operation", (i) => {
6923
6923
  i && (this._operation = i, this.$.icon = i);
6924
6924
  }), this.$["on.click"] = (i) => {
6925
- let e = this.$["*cropperEl"].getValue(this._operation), t = Rl(this._operation, e);
6925
+ let e = this.$["*cropperEl"].getValue(this._operation), t = Ml(this._operation, e);
6926
6926
  this.$["*cropperEl"].setValue(this._operation, t);
6927
6927
  };
6928
6928
  }
@@ -6930,8 +6930,8 @@ class Xs extends vt {
6930
6930
  const Be = {
6931
6931
  FILTER: "filter",
6932
6932
  COLOR_OPERATION: "color_operation"
6933
- }, fe = "original";
6934
- class Ks extends _e {
6933
+ }, de = "original";
6934
+ class Ys extends be {
6935
6935
  constructor() {
6936
6936
  super(...arguments);
6937
6937
  u(this, "init$", {
@@ -6955,8 +6955,8 @@ class Ks extends _e {
6955
6955
  this._controlType = e === "filter" ? Be.FILTER : Be.COLOR_OPERATION, this._operation = e, this._iconName = e, this._title = e.toUpperCase(), this._filter = t, this._initializeValues(), this.$["*faderEl"].activate({
6956
6956
  url: this.$["*originalUrl"],
6957
6957
  operation: this._operation,
6958
- value: this._filter === fe ? void 0 : this.$.value,
6959
- filter: this._filter === fe ? void 0 : this._filter,
6958
+ value: this._filter === de ? void 0 : this.$.value,
6959
+ filter: this._filter === de ? void 0 : this._filter,
6960
6960
  fromViewer: !1
6961
6961
  });
6962
6962
  }
@@ -6980,7 +6980,7 @@ class Ks extends _e {
6980
6980
  }
6981
6981
  apply() {
6982
6982
  let e;
6983
- this._controlType === Be.FILTER ? this._filter === fe ? e = null : e = { name: this._filter, amount: this.$.value } : e = this.$.value;
6983
+ this._controlType === Be.FILTER ? this._filter === de ? e = null : e = { name: this._filter, amount: this.$.value } : e = this.$.value;
6984
6984
  let t = {
6985
6985
  ...this.$["*editorTransformations"],
6986
6986
  [this._operation]: e
@@ -6999,7 +6999,7 @@ class Ks extends _e {
6999
6999
  });
7000
7000
  }
7001
7001
  }
7002
- Ks.template = /* HTML */
7002
+ Ys.template = /* HTML */
7003
7003
  `
7004
7004
  <lr-slider-ui
7005
7005
  ref="slider-el"
@@ -7011,7 +7011,7 @@ function ii(s) {
7011
7011
  return { promise: new Promise((r, n) => {
7012
7012
  i.src = s, i.onload = r, i.onerror = n;
7013
7013
  }), image: i, cancel: () => {
7014
- i.naturalWidth === 0 && (i.src = me);
7014
+ i.naturalWidth === 0 && (i.src = pe);
7015
7015
  } };
7016
7016
  }
7017
7017
  function Nt(s) {
@@ -7042,13 +7042,13 @@ class si extends vt {
7042
7042
  }
7043
7043
  _previewSrc() {
7044
7044
  let e = parseInt(window.getComputedStyle(this).getPropertyValue("--l-base-min-width"), 10), t = window.devicePixelRatio, r = Math.ceil(t * e), n = t >= 2 ? "lightest" : "normal", o = 100, l = { ...this.$["*editorTransformations"] };
7045
- return l[this._operation] = this._filter !== fe ? {
7045
+ return l[this._operation] = this._filter !== de ? {
7046
7046
  name: this._filter,
7047
7047
  amount: o
7048
7048
  } : void 0, V(
7049
7049
  this._originalUrl,
7050
- ae(
7051
- Es,
7050
+ le(
7051
+ As,
7052
7052
  _t(l),
7053
7053
  `quality/${n}`,
7054
7054
  `scale_crop/${r}x${r}/center`
@@ -7074,7 +7074,7 @@ class si extends vt {
7074
7074
  super.initCallback(), this.$["on.click"] = (t) => {
7075
7075
  this.$.active ? this.$.isOriginal || (this.$["*sliderEl"].setOperation(this._operation, this._filter), this.$["*showSlider"] = !0) : (this.$["*sliderEl"].setOperation(this._operation, this._filter), this.$["*sliderEl"].apply()), this.$["*currentFilter"] = this._filter;
7076
7076
  }, this.defineAccessor("filter", (t) => {
7077
- this._operation = "filter", this._filter = t, this.$.isOriginal = t === fe, this.$.icon = this.$.isOriginal ? "original" : "slider";
7077
+ this._operation = "filter", this._filter = t, this.$.isOriginal = t === de, this.$.icon = this.$.isOriginal ? "original" : "slider";
7078
7078
  }), this._observer = new window.IntersectionObserver(this._observerCallback.bind(this), {
7079
7079
  threshold: [0, 1]
7080
7080
  });
@@ -7108,7 +7108,7 @@ si.template = /* HTML */
7108
7108
  <div class="preview" ref="preview-el"></div>
7109
7109
  <lr-icon size="40" ref="icon-el" set="@name: icon; @size: iconSize;"></lr-icon>
7110
7110
  `;
7111
- class Ys extends vt {
7111
+ class Js extends vt {
7112
7112
  constructor() {
7113
7113
  super(...arguments);
7114
7114
  /**
@@ -7130,7 +7130,7 @@ class Ys extends vt {
7130
7130
  });
7131
7131
  }
7132
7132
  }
7133
- function Ml(s, i) {
7133
+ function Fl(s, i) {
7134
7134
  let e = {};
7135
7135
  for (let t of i) {
7136
7136
  let r = s[t];
@@ -7142,26 +7142,26 @@ function ri(s, i, e) {
7142
7142
  let r = window.devicePixelRatio, n = Math.min(Math.ceil(i * r), 3e3), o = r >= 2 ? "lightest" : "normal";
7143
7143
  return V(
7144
7144
  s,
7145
- ae(
7146
- Es,
7145
+ le(
7146
+ As,
7147
7147
  _t(e),
7148
7148
  `quality/${o}`,
7149
7149
  `stretch/off/-/resize/${n}x`
7150
7150
  )
7151
7151
  );
7152
7152
  }
7153
- function Fl(s) {
7153
+ function Nl(s) {
7154
7154
  return s ? [
7155
7155
  ({ dimensions: e, coords: t }) => [...e, ...t].every((r) => Number.isInteger(r) && Number.isFinite(r)),
7156
7156
  ({ dimensions: e, coords: t }) => e.every((r) => r > 0) && t.every((r) => r >= 0)
7157
7157
  ].every((e) => e(s)) : !0;
7158
7158
  }
7159
- class Js extends _e {
7159
+ class Zs extends be {
7160
7160
  constructor() {
7161
7161
  super(), this.init$ = {
7162
7162
  ...this.init$,
7163
7163
  image: null,
7164
- "*padding": Dn,
7164
+ "*padding": zn,
7165
7165
  /** @type {Operations} */
7166
7166
  "*operations": {
7167
7167
  rotate: 0,
@@ -7182,7 +7182,7 @@ class Js extends _e {
7182
7182
  width: 0,
7183
7183
  height: 0
7184
7184
  }
7185
- }, this._commitDebounced = H(this._commit.bind(this), 300), this._handleResizeThrottled = Fs(this._handleResize.bind(this), 100), this._imageSize = { width: 0, height: 0 };
7185
+ }, this._commitDebounced = H(this._commit.bind(this), 300), this._handleResizeThrottled = Ns(this._handleResize.bind(this), 100), this._imageSize = { width: 0, height: 0 };
7186
7186
  }
7187
7187
  /** @private */
7188
7188
  _handleResize() {
@@ -7190,7 +7190,7 @@ class Js extends _e {
7190
7190
  }
7191
7191
  /** @private */
7192
7192
  _syncTransformations() {
7193
- let i = this.$["*editorTransformations"], e = Ml(i, Object.keys(this.$["*operations"])), t = { ...this.$["*operations"], ...e };
7193
+ let i = this.$["*editorTransformations"], e = Fl(i, Object.keys(this.$["*operations"])), t = { ...this.$["*operations"], ...e };
7194
7194
  this.$["*operations"] = t;
7195
7195
  }
7196
7196
  /** @private */
@@ -7238,7 +7238,7 @@ class Js extends _e {
7238
7238
  );
7239
7239
  }
7240
7240
  const c = (d = this.$["*cropPresetList"]) == null ? void 0 : d[0], h = c ? c.width / c.height : void 0;
7241
- if (!to(i, e) || h && !io(i, h)) {
7241
+ if (!io(i, e) || h && !so(i, h)) {
7242
7242
  const f = e.width / e.height;
7243
7243
  let m = e.width, p = e.height;
7244
7244
  h && (f > h ? m = Math.min(e.height * h, e.width) : p = Math.min(e.width / h, e.height)), i = {
@@ -7304,7 +7304,7 @@ class Js extends _e {
7304
7304
  ]
7305
7305
  )
7306
7306
  };
7307
- if (!Fl(A)) {
7307
+ if (!Nl(A)) {
7308
7308
  console.error("Cropper is trying to create invalid crop object", {
7309
7309
  payload: A
7310
7310
  });
@@ -7431,41 +7431,41 @@ class Js extends _e {
7431
7431
  super.destroyCallback(), (i = this._observer) == null || i.disconnect();
7432
7432
  }
7433
7433
  }
7434
- Js.template = /* HTML */
7434
+ Zs.template = /* HTML */
7435
7435
  `
7436
7436
  <canvas class="canvas" ref="canvas-el"></canvas>
7437
7437
  <lr-crop-frame ref="frame-el"></lr-crop-frame>
7438
7438
  `;
7439
- function Di(s, i, e) {
7439
+ function zi(s, i, e) {
7440
7440
  let t = Array(e);
7441
7441
  e--;
7442
7442
  for (let r = e; r >= 0; r--)
7443
7443
  t[r] = Math.ceil((r * i + (e - r) * s) / e);
7444
7444
  return t;
7445
7445
  }
7446
- function Nl(s) {
7446
+ function Dl(s) {
7447
7447
  return s.reduce(
7448
7448
  (i, e, t) => t < s.length - 1 ? [...i, [e, s[t + 1]]] : i,
7449
7449
  []
7450
7450
  );
7451
7451
  }
7452
- function Dl(s, i, e) {
7453
- let t = Nl(s).find(([r, n]) => r <= i && i <= n);
7452
+ function zl(s, i, e) {
7453
+ let t = Dl(s).find(([r, n]) => r <= i && i <= n);
7454
7454
  return s.map((r) => {
7455
7455
  let n = Math.abs(t[0] - t[1]), o = Math.abs(i - t[0]) / n;
7456
7456
  return t[0] === r ? i > e ? 1 : 1 - o : t[1] === r ? i >= e ? o : 1 : 0;
7457
7457
  });
7458
7458
  }
7459
- function zl(s, i) {
7459
+ function Vl(s, i) {
7460
7460
  return s.map((e, t) => e < i ? s.length - t : t);
7461
7461
  }
7462
- function zi(s, i) {
7462
+ function Vi(s, i) {
7463
7463
  let e = Ue[s].keypointsNumber, { range: t, zero: r } = Ue[s];
7464
- return [.../* @__PURE__ */ new Set([...Di(t[0], r, e + 1), ...Di(r, t[1], e + 1), r, i])].sort(
7464
+ return [.../* @__PURE__ */ new Set([...zi(t[0], r, e + 1), ...zi(r, t[1], e + 1), r, i])].sort(
7465
7465
  (n, o) => n - o
7466
7466
  );
7467
7467
  }
7468
- class Vl extends _e {
7468
+ class Bl extends be {
7469
7469
  constructor() {
7470
7470
  super(), this._isActive = !1, this._hidden = !0, this._addKeypointDebounced = H(this._addKeypoint.bind(this), 600), this.classList.add("inactive_to_cropper");
7471
7471
  }
@@ -7572,7 +7572,7 @@ class Vl extends _e {
7572
7572
  */
7573
7573
  _update(i, e) {
7574
7574
  this._operation = i, this._value = e;
7575
- let { zero: t } = Ue[i], r = this._keypoints.map((l) => l.value), n = Dl(r, e, t), o = zl(r, t);
7575
+ let { zero: t } = Ue[i], r = this._keypoints.map((l) => l.value), n = zl(r, e, t), o = Vl(r, t);
7576
7576
  for (let [l, a] of Object.entries(this._keypoints))
7577
7577
  a.opacity = n[l], a.zIndex = o[l];
7578
7578
  this._flush();
@@ -7623,7 +7623,7 @@ class Vl extends _e {
7623
7623
  */
7624
7624
  preload({ url: i, filter: e, operation: t, value: r }) {
7625
7625
  this._cancelBatchPreload && this._cancelBatchPreload();
7626
- let o = zi(t, r).map((a) => this._imageSrc({ url: i, filter: e, operation: t, value: a })), { cancel: l } = Nt(o);
7626
+ let o = Vi(t, r).map((a) => this._imageSrc({ url: i, filter: e, operation: t, value: a })), { cancel: l } = Nt(o);
7627
7627
  this._cancelBatchPreload = l;
7628
7628
  }
7629
7629
  /** @private */
@@ -7671,7 +7671,7 @@ class Vl extends _e {
7671
7671
  this._setOriginalSrc(l), this._container && this._container.remove();
7672
7672
  return;
7673
7673
  }
7674
- this._keypoints = zi(e, t).map((l) => this._constructKeypoint(e, l)), this._update(e, t), this._initNodes();
7674
+ this._keypoints = Vi(e, t).map((l) => this._constructKeypoint(e, l)), this._update(e, t), this._initNodes();
7675
7675
  }
7676
7676
  /** @param {{ hide?: Boolean }} options */
7677
7677
  deactivate({ hide: i = !0 } = {}) {
@@ -7688,19 +7688,19 @@ class Vl extends _e {
7688
7688
  )) : this._container && this._container.remove();
7689
7689
  }
7690
7690
  }
7691
- const Bl = 1;
7692
- class Zs extends _e {
7691
+ const jl = 1;
7692
+ class Qs extends be {
7693
7693
  initCallback() {
7694
7694
  super.initCallback(), this.addEventListener("wheel", (i) => {
7695
7695
  i.preventDefault();
7696
7696
  let { deltaY: e, deltaX: t } = i;
7697
- Math.abs(t) > Bl ? this.scrollLeft += t : this.scrollLeft += e;
7697
+ Math.abs(t) > jl ? this.scrollLeft += t : this.scrollLeft += e;
7698
7698
  });
7699
7699
  }
7700
7700
  }
7701
- Zs.template = /* HTML */
7701
+ Qs.template = /* HTML */
7702
7702
  " <slot></slot> ";
7703
- function jl(s) {
7703
+ function Hl(s) {
7704
7704
  return (
7705
7705
  /* HTML */
7706
7706
  `
@@ -7718,7 +7718,7 @@ function jl(s) {
7718
7718
  `
7719
7719
  );
7720
7720
  }
7721
- function Hl(s) {
7721
+ function Wl(s) {
7722
7722
  return (
7723
7723
  /* HTML */
7724
7724
  `
@@ -7732,7 +7732,7 @@ function Hl(s) {
7732
7732
  `
7733
7733
  );
7734
7734
  }
7735
- class Qs extends _e {
7735
+ class er extends be {
7736
7736
  constructor() {
7737
7737
  super();
7738
7738
  u(this, "_updateInfoTooltip", H(() => {
@@ -7744,7 +7744,7 @@ class Qs extends _e {
7744
7744
  let a = ((l = e == null ? void 0 : e.filter) == null ? void 0 : l.amount) || 100;
7745
7745
  r = this.l10n(this.$["*currentFilter"]) + " " + a;
7746
7746
  } else
7747
- r = this.l10n(fe);
7747
+ r = this.l10n(de);
7748
7748
  else if (this.$["*tabId"] === L.TUNING && t) {
7749
7749
  n = !0;
7750
7750
  let a = (e == null ? void 0 : e[t]) || Ue[t].zero;
@@ -7758,12 +7758,12 @@ class Qs extends _e {
7758
7758
  /** @type {import('./types.js').LoadingOperations} */
7759
7759
  "*loadingOperations": /* @__PURE__ */ new Map(),
7760
7760
  "*showSlider": !1,
7761
- "*currentFilter": fe,
7761
+ "*currentFilter": de,
7762
7762
  "*currentOperation": null,
7763
7763
  showLoader: !1,
7764
- filters: So,
7765
- colorOperations: $o,
7766
- cropOperations: xo,
7764
+ filters: xo,
7765
+ colorOperations: So,
7766
+ cropOperations: Io,
7767
7767
  "*operationTooltip": null,
7768
7768
  "l10n.cancel": this.l10n("cancel"),
7769
7769
  "l10n.apply": this.l10n("apply"),
@@ -7827,7 +7827,7 @@ class Qs extends _e {
7827
7827
  * @param {String} operation
7828
7828
  */
7829
7829
  _createOperationControl(e) {
7830
- let t = new Ys();
7830
+ let t = new Js();
7831
7831
  return t.operation = e, t;
7832
7832
  }
7833
7833
  /**
@@ -7843,7 +7843,7 @@ class Qs extends _e {
7843
7843
  * @param {String} operation
7844
7844
  */
7845
7845
  _createToggleControl(e) {
7846
- let t = new Xs();
7846
+ let t = new Ks();
7847
7847
  return t.operation = e, t;
7848
7848
  }
7849
7849
  /**
@@ -7858,7 +7858,7 @@ class Qs extends _e {
7858
7858
  let o = this._createToggleControl(n);
7859
7859
  r.appendChild(o);
7860
7860
  }
7861
- ) : e === L.FILTERS ? [fe, ...this.$.filters].forEach((n) => {
7861
+ ) : e === L.FILTERS ? [de, ...this.$.filters].forEach((n) => {
7862
7862
  let o = this._createFilterControl(n);
7863
7863
  r.appendChild(o);
7864
7864
  }) : e === L.TUNING && this.$.colorOperations.forEach(
@@ -7958,7 +7958,7 @@ class Qs extends _e {
7958
7958
  }), this._updateInfoTooltip();
7959
7959
  }
7960
7960
  }
7961
- Qs.template = /* HTML */
7961
+ er.template = /* HTML */
7962
7962
  `
7963
7963
  <lr-line-loader-ui set="active: showLoader"></lr-line-loader-ui>
7964
7964
  <div class="info-tooltip_container">
@@ -7968,12 +7968,12 @@ Qs.template = /* HTML */
7968
7968
  </div>
7969
7969
  <div class="toolbar-container">
7970
7970
  <lr-presence-toggle class="sub-toolbar" set="visible: presence.mainToolbar; styles: presence.subTopToolbarStyles">
7971
- <div class="tab-content-row">${ee.map(Hl).join("")}</div>
7971
+ <div class="tab-content-row">${ee.map(Wl).join("")}</div>
7972
7972
  <div class="controls-row">
7973
7973
  <lr-btn-ui theme="boring" icon="closeMax" set="onclick: on.cancel"> </lr-btn-ui>
7974
7974
  <lr-presence-toggle class="tab-toggles" set="visible: presence.tabToggles; styles: presence.tabTogglesStyles">
7975
7975
  <div ref="tabs-indicator" class="tab-toggles_indicator"></div>
7976
- ${ee.map(jl).join("")}
7976
+ ${ee.map(Hl).join("")}
7977
7977
  </lr-presence-toggle>
7978
7978
  <lr-btn-ui theme="primary" icon="done" set="onclick: on.apply"> </lr-btn-ui>
7979
7979
  </div>
@@ -7989,7 +7989,7 @@ Qs.template = /* HTML */
7989
7989
  </lr-presence-toggle>
7990
7990
  </div>
7991
7991
  `;
7992
- class ni extends k {
7992
+ class ni extends I {
7993
7993
  constructor() {
7994
7994
  super(), this._iconReversed = !1, this._iconSingle = !1, this._iconHidden = !1, this.init$ = {
7995
7995
  ...this.init$,
@@ -8028,7 +8028,7 @@ ni.template = /* HTML */
8028
8028
  <lr-icon size="20" set="className: iconCss; @name: icon;"></lr-icon>
8029
8029
  <div class="text">{{text}}</div>
8030
8030
  `;
8031
- class er extends k {
8031
+ class tr extends I {
8032
8032
  constructor() {
8033
8033
  super(), this._active = !1, this._handleTransitionEndRight = () => {
8034
8034
  let i = this.ref["line-el"];
@@ -8051,7 +8051,7 @@ class er extends k {
8051
8051
  this._active = !1;
8052
8052
  }
8053
8053
  }
8054
- er.template = /* HTML */
8054
+ tr.template = /* HTML */
8055
8055
  `
8056
8056
  <div class="inner">
8057
8057
  <div class="line" ref="line-el"></div>
@@ -8062,7 +8062,7 @@ const tt = {
8062
8062
  visible: "visible",
8063
8063
  hidden: "hidden"
8064
8064
  };
8065
- class tr extends k {
8065
+ class ir extends I {
8066
8066
  constructor() {
8067
8067
  super(), this._visible = !1, this._visibleStyle = tt.visible, this._hiddenStyle = tt.hidden, this._externalTransitions = !1, this.defineAccessor("styles", (i) => {
8068
8068
  i && (this._externalTransitions = !0, this._visibleStyle = i.visible, this._hiddenStyle = i.hidden);
@@ -8071,7 +8071,7 @@ class tr extends k {
8071
8071
  });
8072
8072
  }
8073
8073
  _handleVisible() {
8074
- this.style.visibility = this._visible ? "inherit" : "hidden", kl(this, {
8074
+ this.style.visibility = this._visible ? "inherit" : "hidden", Ol(this, {
8075
8075
  [tt.transition]: !this._externalTransitions,
8076
8076
  [this._visibleStyle]: this._visible,
8077
8077
  [this._hiddenStyle]: !this._visible
@@ -8081,9 +8081,9 @@ class tr extends k {
8081
8081
  super.initCallback(), this.setAttribute("hidden", ""), this._externalTransitions || this.classList.add(tt.transition), this._handleVisible(), setTimeout(() => this.removeAttribute("hidden"), 0);
8082
8082
  }
8083
8083
  }
8084
- tr.template = /* HTML */
8084
+ ir.template = /* HTML */
8085
8085
  " <slot></slot> ";
8086
- class ir extends k {
8086
+ class sr extends I {
8087
8087
  constructor() {
8088
8088
  super();
8089
8089
  u(this, "init$", {
@@ -8174,7 +8174,7 @@ class ir extends k {
8174
8174
  (e = this._observer) == null || e.disconnect();
8175
8175
  }
8176
8176
  }
8177
- ir.template = /* HTML */
8177
+ sr.template = /* HTML */
8178
8178
  `
8179
8179
  <div class="steps" ref="steps-el"></div>
8180
8180
  <div ref="thumb-el" class="thumb"></div>
@@ -8186,7 +8186,7 @@ ir.template = /* HTML */
8186
8186
  set="oninput: on.sliderInput; onchange: on.sliderChange; @min: min; @max: max; @value: defaultValue;"
8187
8187
  />
8188
8188
  `;
8189
- class Wl extends $ {
8189
+ class ql extends $ {
8190
8190
  constructor() {
8191
8191
  super();
8192
8192
  u(this, "couldBeCtxOwner", !0);
@@ -8249,22 +8249,22 @@ class Wl extends $ {
8249
8249
  this._instance = void 0, this.innerHTML = "";
8250
8250
  }
8251
8251
  }
8252
- const ql = function(s) {
8252
+ const Gl = function(s) {
8253
8253
  return s.replace(/[\\-\\[]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
8254
- }, Gl = function(s, i = "i") {
8255
- const e = s.split("*").map(ql);
8254
+ }, Xl = function(s, i = "i") {
8255
+ const e = s.split("*").map(Gl);
8256
8256
  return new RegExp("^" + e.join(".+") + "$", i);
8257
8257
  };
8258
- let Xl = (s) => Object.keys(s).reduce((e, t) => {
8258
+ let Kl = (s) => Object.keys(s).reduce((e, t) => {
8259
8259
  let r = s[t], n = Object.keys(r).reduce((o, l) => {
8260
8260
  let a = r[l];
8261
8261
  return o + `${l}: ${a};`;
8262
8262
  }, "");
8263
8263
  return e + `${t}{${n}}`;
8264
8264
  }, "");
8265
- function Kl({ textColor: s, backgroundColor: i, linkColor: e, linkColorHover: t, shadeColor: r }) {
8265
+ function Yl({ textColor: s, backgroundColor: i, linkColor: e, linkColorHover: t, shadeColor: r }) {
8266
8266
  let n = `solid 1px ${r}`;
8267
- return Xl({
8267
+ return Kl({
8268
8268
  body: {
8269
8269
  color: s,
8270
8270
  "background-color": i
@@ -8331,7 +8331,7 @@ function Kl({ textColor: s, backgroundColor: i, linkColor: e, linkColorHover: t,
8331
8331
  }
8332
8332
  });
8333
8333
  }
8334
- let pe = {};
8334
+ let fe = {};
8335
8335
  window.addEventListener("message", (s) => {
8336
8336
  let i;
8337
8337
  try {
@@ -8339,24 +8339,24 @@ window.addEventListener("message", (s) => {
8339
8339
  } catch {
8340
8340
  return;
8341
8341
  }
8342
- if ((i == null ? void 0 : i.type) in pe) {
8343
- let e = pe[i.type];
8342
+ if ((i == null ? void 0 : i.type) in fe) {
8343
+ let e = fe[i.type];
8344
8344
  for (let [t, r] of e)
8345
8345
  s.source === t && r(i);
8346
8346
  }
8347
8347
  });
8348
- const Yl = function(s, i, e) {
8349
- s in pe || (pe[s] = []), pe[s].push([i, e]);
8350
- }, Jl = function(s, i) {
8351
- s in pe && (pe[s] = pe[s].filter((e) => e[0] !== i));
8348
+ const Jl = function(s, i, e) {
8349
+ s in fe || (fe[s] = []), fe[s].push([i, e]);
8350
+ }, Zl = function(s, i) {
8351
+ s in fe && (fe[s] = fe[s].filter((e) => e[0] !== i));
8352
8352
  };
8353
- function Zl(s) {
8353
+ function Ql(s) {
8354
8354
  let i = [];
8355
8355
  for (let [e, t] of Object.entries(s))
8356
8356
  t == null || typeof t == "string" && t.length === 0 || i.push(`${e}=${encodeURIComponent(t)}`);
8357
8357
  return i.join("&");
8358
8358
  }
8359
- class sr extends $ {
8359
+ class rr extends $ {
8360
8360
  constructor() {
8361
8361
  super();
8362
8362
  u(this, "couldBeCtxOwner", !0);
@@ -8416,9 +8416,9 @@ class sr extends $ {
8416
8416
  */
8417
8417
  extractUrlFromMessage(e) {
8418
8418
  if (e.alternatives) {
8419
- const t = ce(this.cfg.externalSourcesPreferredTypes);
8419
+ const t = ae(this.cfg.externalSourcesPreferredTypes);
8420
8420
  for (const r of t) {
8421
- const n = Gl(r);
8421
+ const n = Xl(r);
8422
8422
  for (const [o, l] of Object.entries(e.alternatives))
8423
8423
  if (n.test(o))
8424
8424
  return l;
@@ -8463,7 +8463,7 @@ class sr extends $ {
8463
8463
  };
8464
8464
  this.sendMessage({
8465
8465
  type: "embed-css",
8466
- style: Kl(e)
8466
+ style: Yl(e)
8467
8467
  });
8468
8468
  }
8469
8469
  /** @private */
@@ -8476,7 +8476,7 @@ class sr extends $ {
8476
8476
  pass_window_open: !1,
8477
8477
  session_key: this.cfg.remoteTabSessionKey
8478
8478
  }, o = new URL(this.cfg.socialBaseUrl);
8479
- return o.pathname = `/window3/${r}`, o.search = Zl(n), o.toString();
8479
+ return o.pathname = `/window3/${r}`, o.search = Ql(n), o.toString();
8480
8480
  }
8481
8481
  /** @private */
8482
8482
  mountIframe() {
@@ -8490,14 +8490,14 @@ class sr extends $ {
8490
8490
  allowTransparency: !0
8491
8491
  }
8492
8492
  });
8493
- e.addEventListener("load", this.handleIframeLoad.bind(this)), this.ref.iframeWrapper.innerHTML = "", this.ref.iframeWrapper.appendChild(e), Yl("file-selected", e.contentWindow, this.handleFileSelected.bind(this)), this._iframe = e, this.$.selectedList = [];
8493
+ e.addEventListener("load", this.handleIframeLoad.bind(this)), this.ref.iframeWrapper.innerHTML = "", this.ref.iframeWrapper.appendChild(e), Jl("file-selected", e.contentWindow, this.handleFileSelected.bind(this)), this._iframe = e, this.$.selectedList = [];
8494
8494
  }
8495
8495
  /** @private */
8496
8496
  unmountIframe() {
8497
- this._iframe && Jl("file-selected", this._iframe.contentWindow), this.ref.iframeWrapper.innerHTML = "", this._iframe = null, this.$.selectedList = [], this.$.counter = 0;
8497
+ this._iframe && Zl("file-selected", this._iframe.contentWindow), this.ref.iframeWrapper.innerHTML = "", this._iframe = null, this.$.selectedList = [], this.$.counter = 0;
8498
8498
  }
8499
8499
  }
8500
- sr.template = /* HTML */
8500
+ rr.template = /* HTML */
8501
8501
  `
8502
8502
  <lr-activity-header>
8503
8503
  <button type="button" class="mini-btn" set="onclick: *historyBack">
@@ -8523,7 +8523,7 @@ sr.template = /* HTML */
8523
8523
  </div>
8524
8524
  </div>
8525
8525
  `;
8526
- class oi extends k {
8526
+ class oi extends I {
8527
8527
  /** @param {String} tabL10nStr */
8528
8528
  setCurrentTab(i) {
8529
8529
  if (!i)
@@ -8538,7 +8538,7 @@ class oi extends k {
8538
8538
  super.initCallback(), this._tabMap = {}, this.defineAccessor("tab-list", (i) => {
8539
8539
  if (!i)
8540
8540
  return;
8541
- ce(i).forEach((t) => {
8541
+ ae(i).forEach((t) => {
8542
8542
  let r = zt({
8543
8543
  tag: "div",
8544
8544
  attributes: {
@@ -8568,14 +8568,14 @@ oi.template = /* HTML */
8568
8568
  <slot></slot>
8569
8569
  </div>
8570
8570
  `;
8571
- class Ql extends $ {
8571
+ class ea extends $ {
8572
8572
  constructor() {
8573
8573
  super(...arguments);
8574
8574
  u(this, "requireCtxName", !0);
8575
8575
  }
8576
8576
  _createValidationInput() {
8577
8577
  const e = document.createElement("input");
8578
- return e.type = "text", e.name = this.ctxName, e.required = this.cfg.multipleMin > 0, e.tabIndex = -1, Gi(e, {
8578
+ return e.type = "text", e.name = this.ctxName, e.required = this.cfg.multipleMin > 0, e.tabIndex = -1, Xi(e, {
8579
8579
  opacity: 0,
8580
8580
  height: 0,
8581
8581
  width: 0
@@ -8623,9 +8623,9 @@ class Ql extends $ {
8623
8623
  );
8624
8624
  }
8625
8625
  }
8626
- class ea extends b {
8626
+ class ta extends b {
8627
8627
  }
8628
- class rr extends k {
8628
+ class nr extends I {
8629
8629
  constructor() {
8630
8630
  super(...arguments);
8631
8631
  u(this, "init$", {
@@ -8651,7 +8651,7 @@ class rr extends k {
8651
8651
  });
8652
8652
  }
8653
8653
  }
8654
- rr.template = /* HTML */
8654
+ nr.template = /* HTML */
8655
8655
  `
8656
8656
  <button>
8657
8657
  {{currentText}}
@@ -8668,7 +8668,7 @@ const M = {
8668
8668
  VOL_OFF: "mute",
8669
8669
  CAP_ON: "captions",
8670
8670
  CAP_OFF: "captions-off"
8671
- }, Vi = {
8671
+ }, Bi = {
8672
8672
  requestFullscreen: (s) => {
8673
8673
  s.requestFullscreen ? s.requestFullscreen() : s.webkitRequestFullscreen && s.webkitRequestFullscreen();
8674
8674
  },
@@ -8676,7 +8676,7 @@ const M = {
8676
8676
  document.exitFullscreen ? document.exitFullscreen() : document.webkitExitFullscreen && document.webkitExitFullscreen();
8677
8677
  }
8678
8678
  };
8679
- class oe extends k {
8679
+ class ne extends I {
8680
8680
  constructor() {
8681
8681
  super(...arguments);
8682
8682
  u(this, "init$", {
@@ -8718,16 +8718,16 @@ class oe extends k {
8718
8718
  this._video.paused || this._video.ended ? this._video.play() : this._video.pause();
8719
8719
  }
8720
8720
  toggleFullscreen() {
8721
- (document.fullscreenElement || document.webkitFullscreenElement) === this ? Vi.exitFullscreen() : Vi.requestFullscreen(this);
8721
+ (document.fullscreenElement || document.webkitFullscreenElement) === this ? Bi.exitFullscreen() : Bi.requestFullscreen(this);
8722
8722
  }
8723
8723
  toggleCaptions() {
8724
- this.$.capIcon === M.CAP_OFF ? (this.$.capIcon = M.CAP_ON, this._video.textTracks[0].mode = "showing", window.localStorage.setItem(oe.is + ":captions", "1")) : (this.$.capIcon = M.CAP_OFF, this._video.textTracks[0].mode = "hidden", window.localStorage.removeItem(oe.is + ":captions"));
8724
+ this.$.capIcon === M.CAP_OFF ? (this.$.capIcon = M.CAP_ON, this._video.textTracks[0].mode = "showing", window.localStorage.setItem(ne.is + ":captions", "1")) : (this.$.capIcon = M.CAP_OFF, this._video.textTracks[0].mode = "hidden", window.localStorage.removeItem(ne.is + ":captions"));
8725
8725
  }
8726
8726
  toggleSound() {
8727
8727
  this.$.volIcon === M.VOL_ON ? (this.$.volIcon = M.VOL_OFF, this.$.volumeDisabled = !0, this._video.muted = !0) : (this.$.volIcon = M.VOL_ON, this.$.volumeDisabled = !1, this._video.muted = !1);
8728
8728
  }
8729
8729
  setVolume(e) {
8730
- window.localStorage.setItem(oe.is + ":volume", e);
8730
+ window.localStorage.setItem(ne.is + ":volume", e);
8731
8731
  let t = e ? e / 100 : 0;
8732
8732
  this._video.volume = t;
8733
8733
  }
@@ -8766,7 +8766,7 @@ class oe extends k {
8766
8766
  _initTracks() {
8767
8767
  [...this._video.textTracks].forEach((e) => {
8768
8768
  e.mode = "hidden";
8769
- }), window.localStorage.getItem(oe.is + ":captions") && this.toggleCaptions();
8769
+ }), window.localStorage.getItem(ne.is + ":captions") && this.toggleCaptions();
8770
8770
  }
8771
8771
  /** @private */
8772
8772
  _castAttributes() {
@@ -8806,14 +8806,14 @@ class oe extends k {
8806
8806
  let r = Math.round(100 * (this._video.currentTime / this._video.duration));
8807
8807
  this.$.progressCssWidth = r + "%", this.$.currentTime = this._timeFmt(this._video.currentTime);
8808
8808
  });
8809
- let e = window.localStorage.getItem(oe.is + ":volume");
8809
+ let e = window.localStorage.getItem(ne.is + ":volume");
8810
8810
  if (e) {
8811
8811
  let t = parseFloat(e);
8812
8812
  this.setVolume(t), this.$.volumeValue = t;
8813
8813
  }
8814
8814
  }
8815
8815
  }
8816
- oe.template = /* HTML */
8816
+ ne.template = /* HTML */
8817
8817
  `
8818
8818
  <div class="video-wrapper">
8819
8819
  <video ref="video" preload="metadata" crossorigin="anonymous"></video>
@@ -8848,11 +8848,11 @@ oe.template = /* HTML */
8848
8848
  </div>
8849
8849
  </div>
8850
8850
  `;
8851
- oe.bindAttributes({
8851
+ ne.bindAttributes({
8852
8852
  video: "video",
8853
8853
  src: "src"
8854
8854
  });
8855
- const ta = "css-src";
8855
+ const ia = "css-src";
8856
8856
  function li(s) {
8857
8857
  return class extends s {
8858
8858
  constructor() {
@@ -8880,9 +8880,9 @@ function li(s) {
8880
8880
  });
8881
8881
  }
8882
8882
  initCallback() {
8883
- super.initCallback(), this.setAttribute("hidden", ""), Zi({
8883
+ super.initCallback(), this.setAttribute("hidden", ""), Qi({
8884
8884
  element: this,
8885
- attribute: ta,
8885
+ attribute: ia,
8886
8886
  onSuccess: (e) => {
8887
8887
  this.attachShadow({
8888
8888
  mode: "open"
@@ -8905,9 +8905,9 @@ function li(s) {
8905
8905
  }
8906
8906
  };
8907
8907
  }
8908
- class nr extends li(k) {
8908
+ class or extends li(I) {
8909
8909
  }
8910
- class or extends k {
8910
+ class lr extends I {
8911
8911
  initCallback() {
8912
8912
  super.initCallback(), this.subConfigValue(
8913
8913
  "removeCopyright",
@@ -8919,7 +8919,7 @@ class or extends k {
8919
8919
  }
8920
8920
  }
8921
8921
  u(
8922
- or,
8922
+ lr,
8923
8923
  "template",
8924
8924
  /* HTML */
8925
8925
  `
@@ -8931,11 +8931,11 @@ u(
8931
8931
  >
8932
8932
  `
8933
8933
  );
8934
- class ai extends nr {
8934
+ class ai extends or {
8935
8935
  constructor() {
8936
8936
  super(...arguments);
8937
8937
  u(this, "requireCtxName", !0);
8938
- u(this, "init$", ds(this));
8938
+ u(this, "init$", fs(this));
8939
8939
  u(this, "_template", null);
8940
8940
  }
8941
8941
  static set template(e) {
@@ -9003,7 +9003,7 @@ Ct.template = /* HTML */
9003
9003
  </lr-start-from>
9004
9004
  <lr-upload-list ref="uBlock"></lr-upload-list>
9005
9005
  `;
9006
- let lr = class extends ai {
9006
+ let ar = class extends ai {
9007
9007
  constructor() {
9008
9008
  super(), this.init$ = {
9009
9009
  ...this.init$,
@@ -9031,7 +9031,7 @@ let lr = class extends ai {
9031
9031
  });
9032
9032
  }
9033
9033
  };
9034
- lr.template = /* HTML */
9034
+ ar.template = /* HTML */
9035
9035
  ` <lr-start-from>
9036
9036
  <lr-drop-area with-icon clickable></lr-drop-area>
9037
9037
  <lr-source-list wrap></lr-source-list>
@@ -9049,7 +9049,7 @@ lr.template = /* HTML */
9049
9049
  <lr-external-source></lr-external-source>
9050
9050
  <lr-progress-bar></lr-progress-bar>
9051
9051
  <lr-cloud-image-editor-activity></lr-cloud-image-editor-activity>`;
9052
- class ia extends li(Ne) {
9052
+ class sa extends li(Ne) {
9053
9053
  shadowReadyCallback() {
9054
9054
  this.__shadowReady = !0, this.$["*faderEl"] = this.ref["fader-el"], this.$["*cropperEl"] = this.ref["cropper-el"], this.$["*imgContainerEl"] = this.ref["img-container-el"], this.initEditor();
9055
9055
  }
@@ -9064,7 +9064,7 @@ function Ke(s) {
9064
9064
  }
9065
9065
  }
9066
9066
  const It = "LR";
9067
- async function sa(s, i = !1) {
9067
+ async function ra(s, i = !1) {
9068
9068
  return new Promise((e, t) => {
9069
9069
  if (typeof document != "object") {
9070
9070
  e(null);
@@ -9086,76 +9086,76 @@ async function sa(s, i = !1) {
9086
9086
  const hi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9087
9087
  __proto__: null,
9088
9088
  ActivityBlock: b,
9089
- ActivityHeader: ea,
9089
+ ActivityHeader: ta,
9090
9090
  BaseComponent: ht,
9091
- Block: k,
9092
- CameraSource: zs,
9093
- CloudImageEditor: ia,
9094
- CloudImageEditorActivity: Wl,
9091
+ Block: I,
9092
+ CameraSource: Vs,
9093
+ CloudImageEditor: sa,
9094
+ CloudImageEditorActivity: ql,
9095
9095
  CloudImageEditorBlock: Ne,
9096
- Config: As,
9097
- ConfirmationDialog: js,
9098
- Copyright: or,
9099
- CropFrame: Gs,
9096
+ Config: Ts,
9097
+ ConfirmationDialog: Hs,
9098
+ Copyright: lr,
9099
+ CropFrame: Xs,
9100
9100
  Data: T,
9101
9101
  DropArea: Zt,
9102
- EditorCropButtonControl: Xs,
9102
+ EditorCropButtonControl: Ks,
9103
9103
  EditorFilterControl: si,
9104
- EditorImageCropper: Js,
9105
- EditorImageFader: Vl,
9106
- EditorOperationControl: Ys,
9107
- EditorScroller: Zs,
9108
- EditorSlider: Ks,
9109
- EditorToolbar: Qs,
9110
- ExternalSource: sr,
9111
- FileItem: Ee,
9104
+ EditorImageCropper: Zs,
9105
+ EditorImageFader: Bl,
9106
+ EditorOperationControl: Js,
9107
+ EditorScroller: Qs,
9108
+ EditorSlider: Ys,
9109
+ EditorToolbar: er,
9110
+ ExternalSource: rr,
9111
+ FileItem: we,
9112
9112
  FilePreview: ti,
9113
- FileUploaderInline: lr,
9113
+ FileUploaderInline: ar,
9114
9114
  FileUploaderMinimal: Ct,
9115
9115
  FileUploaderRegular: ci,
9116
- FormInput: Ql,
9116
+ FormInput: ea,
9117
9117
  Icon: Yt,
9118
- Img: Wo,
9119
- LineLoaderUi: er,
9118
+ Img: qo,
9119
+ LineLoaderUi: tr,
9120
9120
  LrBtnUi: ni,
9121
9121
  Modal: ei,
9122
9122
  PACKAGE_NAME: Gt,
9123
9123
  PACKAGE_VERSION: bt,
9124
- PresenceToggle: tr,
9125
- ProgressBar: Ws,
9126
- ProgressBarCommon: Hs,
9127
- Select: rr,
9128
- ShadowWrapper: nr,
9124
+ PresenceToggle: ir,
9125
+ ProgressBar: qs,
9126
+ ProgressBarCommon: Ws,
9127
+ Select: nr,
9128
+ ShadowWrapper: or,
9129
9129
  SimpleBtn: Jt,
9130
- SliderUi: ir,
9130
+ SliderUi: sr,
9131
9131
  SourceBtn: Qt,
9132
- SourceList: Zo,
9133
- StartFrom: $s,
9132
+ SourceList: Qo,
9133
+ StartFrom: Ss,
9134
9134
  Tabs: oi,
9135
- UID: te,
9135
+ UID: Ae,
9136
9136
  UploadCtxProvider: Ft,
9137
- UploadDetails: Bs,
9138
- UploadList: Ns,
9137
+ UploadDetails: js,
9138
+ UploadList: Ds,
9139
9139
  UploaderBlock: $,
9140
- UrlSource: Ds,
9141
- Video: oe,
9142
- connectBlocksFrom: sa,
9140
+ UrlSource: zs,
9141
+ Video: ne,
9142
+ connectBlocksFrom: ra,
9143
9143
  registerBlocks: Ke,
9144
9144
  shadowed: li,
9145
- toKebabCase: we
9146
- }, Symbol.toStringTag, { value: "Module" })), ra = /* @__PURE__ */ new Set([
9145
+ toKebabCase: Ce
9146
+ }, Symbol.toStringTag, { value: "Module" })), na = /* @__PURE__ */ new Set([
9147
9147
  "children",
9148
9148
  "ref",
9149
9149
  "style",
9150
9150
  "className"
9151
- ]), na = (s = {}) => Object == null ? void 0 : Object.keys(s).reduce((i, e) => {
9151
+ ]), oa = (s = {}) => Object == null ? void 0 : Object.keys(s).reduce((i, e) => {
9152
9152
  var t, r;
9153
9153
  const n = s == null ? void 0 : s[e], o = `on${(r = (t = n == null ? void 0 : n.split("-")) == null ? void 0 : t.map((l) => l.charAt(0).toUpperCase() + l.slice(1))) == null ? void 0 : r.join("")}`;
9154
9154
  return i[o] = n, i;
9155
- }, {}), Bi = /* @__PURE__ */ new WeakMap(), oa = (s) => {
9156
- let i = Bi.get(s);
9157
- return i || (i = /* @__PURE__ */ new Map(), Bi.set(s, i)), i;
9158
- }, ji = ({
9155
+ }, {}), ji = /* @__PURE__ */ new WeakMap(), la = (s) => {
9156
+ let i = ji.get(s);
9157
+ return i || (i = /* @__PURE__ */ new Map(), ji.set(s, i)), i;
9158
+ }, Hi = ({
9159
9159
  node: s,
9160
9160
  nameProp: i,
9161
9161
  valueProp: e,
@@ -9163,7 +9163,7 @@ const hi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9163
9163
  event: r
9164
9164
  }) => {
9165
9165
  if (r !== void 0 && e !== t) {
9166
- const n = oa(s), o = n.has(r);
9166
+ const n = la(s), o = n.has(r);
9167
9167
  if (e) {
9168
9168
  const l = {
9169
9169
  handleEvent: e
@@ -9176,10 +9176,10 @@ const hi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9176
9176
  return;
9177
9177
  }
9178
9178
  s[i] = e, e == null && i in HTMLElement.prototype && s.removeAttribute(i);
9179
- }, la = (s, i, e) => {
9179
+ }, aa = (s, i, e) => {
9180
9180
  const t = {}, r = {};
9181
9181
  return Object.entries(s).forEach(([n, o]) => {
9182
- ra.has(n) ? t[n === "className" ? "class" : n] = o : i.has(n) || n in e.prototype ? r[n] = o : t[n] = o;
9182
+ na.has(n) ? t[n === "className" ? "class" : n] = o : i.has(n) || n in e.prototype ? r[n] = o : t[n] = o;
9183
9183
  }), { reactProps: t, customElProps: r };
9184
9184
  }, Ye = ({
9185
9185
  react: s,
@@ -9188,15 +9188,15 @@ const hi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9188
9188
  elClass: e,
9189
9189
  schemaEvents: t
9190
9190
  }) => {
9191
- const r = na(t), n = new Set(Object.keys(r ?? {})), o = s.forwardRef(
9191
+ const r = oa(t), n = new Set(Object.keys(r ?? {})), o = s.forwardRef(
9192
9192
  (l, a) => {
9193
- const c = s.useRef(/* @__PURE__ */ new Map()), h = s.useRef(null), { reactProps: d, customElProps: f } = la(l, n, e);
9193
+ const c = s.useRef(/* @__PURE__ */ new Map()), h = s.useRef(null), { reactProps: d, customElProps: f } = aa(l, n, e);
9194
9194
  return s.useLayoutEffect(() => {
9195
9195
  if (h.current === null)
9196
9196
  return;
9197
9197
  const m = /* @__PURE__ */ new Map();
9198
9198
  for (const p in f)
9199
- ji({
9199
+ Hi({
9200
9200
  node: h.current,
9201
9201
  nameProp: p,
9202
9202
  valueProp: f[p],
@@ -9204,7 +9204,7 @@ const hi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9204
9204
  event: r[p]
9205
9205
  }), c.current.delete(p), m.set(p, l[p]);
9206
9206
  for (const [p, g] of c.current)
9207
- ji({
9207
+ Hi({
9208
9208
  node: h.current,
9209
9209
  nameProp: p,
9210
9210
  valueProp: void 0,
@@ -9225,11 +9225,11 @@ const hi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9225
9225
  );
9226
9226
  return o.displayName = e.name, o;
9227
9227
  }, ui = Ye({
9228
- react: I,
9228
+ react: O,
9229
9229
  tag: "lr-config",
9230
- elClass: As
9230
+ elClass: Ts
9231
9231
  }), di = Ye({
9232
- react: I,
9232
+ react: O,
9233
9233
  tag: "lr-upload-ctx-provider",
9234
9234
  elClass: Ft,
9235
9235
  schemaEvents: Ft.EventType
@@ -9241,103 +9241,94 @@ const hi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9241
9241
  eventHandlers: i,
9242
9242
  config: e
9243
9243
  };
9244
- };
9244
+ }, ca = "0.3.0-alpha.0", ha = "React-Uploader", mi = () => `${ha}/${ca}`;
9245
9245
  Ke(hi);
9246
- const aa = Ye({
9247
- react: I,
9246
+ const ua = Ye({
9247
+ react: O,
9248
9248
  tag: "lr-file-uploader-regular",
9249
9249
  elClass: ci
9250
- }), ca = fi("regular"), ya = ({
9250
+ }), da = fi("regular"), wa = ({
9251
9251
  ctxName: s,
9252
9252
  className: i,
9253
- refUploadCtxProvider: e,
9253
+ apiRef: e,
9254
9254
  ...t
9255
9255
  }) => {
9256
- const r = Pe(
9257
- () => s ?? te.generate(),
9258
- [s, te.generate]
9259
- ), { eventHandlers: n, config: o } = Pe(
9256
+ const r = Pe(() => s ?? Ae.generate(), [s]), { eventHandlers: n, config: o } = Pe(
9260
9257
  () => pi(t),
9261
9258
  [t]
9262
9259
  );
9263
- return /* @__PURE__ */ I.createElement(I.Fragment, null, /* @__PURE__ */ I.createElement(ui, { "ctx-name": r, ...o }), /* @__PURE__ */ I.createElement(
9260
+ return /* @__PURE__ */ O.createElement("div", { className: i }, /* @__PURE__ */ O.createElement(ui, { userAgentIntegration: mi(), "ctx-name": r, ...o }), /* @__PURE__ */ O.createElement(
9264
9261
  di,
9265
9262
  {
9266
9263
  ref: e,
9267
9264
  "ctx-name": r,
9268
9265
  ...n
9269
9266
  }
9270
- ), /* @__PURE__ */ I.createElement(
9271
- aa,
9267
+ ), /* @__PURE__ */ O.createElement(
9268
+ ua,
9272
9269
  {
9273
9270
  "ctx-name": r,
9274
- "css-src": ca
9271
+ "css-src": da
9275
9272
  }
9276
9273
  ));
9277
9274
  };
9278
9275
  Ke(hi);
9279
- const ha = Ye({
9280
- react: I,
9276
+ const fa = Ye({
9277
+ react: O,
9281
9278
  tag: "lr-file-uploader-minimal",
9282
9279
  elClass: Ct
9283
- }), ua = fi("minimal"), va = ({
9280
+ }), pa = fi("minimal"), Ea = ({
9284
9281
  ctxName: s,
9285
9282
  className: i,
9286
- refUploadCtxProvider: e,
9283
+ apiRef: e,
9287
9284
  ...t
9288
9285
  }) => {
9289
- const r = Pe(
9290
- () => s ?? te.generate(),
9291
- [s, te.generate]
9292
- ), { eventHandlers: n, config: o } = Pe(
9286
+ const r = Pe(() => s ?? Ae.generate(), [s]), { eventHandlers: n, config: o } = Pe(
9293
9287
  () => pi(t),
9294
9288
  [t]
9295
9289
  );
9296
- return /* @__PURE__ */ I.createElement(I.Fragment, null, /* @__PURE__ */ I.createElement(ui, { "ctx-name": r, ...o }), /* @__PURE__ */ I.createElement(
9290
+ return /* @__PURE__ */ O.createElement("div", { className: i }, /* @__PURE__ */ O.createElement(ui, { userAgentIntegration: mi(), "ctx-name": r, ...o }), /* @__PURE__ */ O.createElement(
9297
9291
  di,
9298
9292
  {
9299
9293
  ref: e,
9300
9294
  "ctx-name": r,
9301
9295
  ...n
9302
9296
  }
9303
- ), /* @__PURE__ */ I.createElement(
9304
- ha,
9297
+ ), /* @__PURE__ */ O.createElement(
9298
+ fa,
9305
9299
  {
9306
9300
  "ctx-name": r,
9307
- "css-src": ua
9301
+ "css-src": pa
9308
9302
  }
9309
9303
  ));
9310
9304
  };
9311
9305
  Ke(hi);
9312
- const da = Ye({
9313
- react: I,
9306
+ const ma = Ye({
9307
+ react: O,
9314
9308
  tag: "lr-file-uploader-inline",
9315
9309
  elClass: Ct
9316
- }), fa = fi("inline"), Ca = ({
9310
+ }), ga = fi("inline"), Aa = ({
9317
9311
  ctxName: s,
9318
9312
  className: i,
9319
- refUploadCtxProvider: e,
9313
+ apiRef: e,
9320
9314
  ...t
9321
9315
  }) => {
9322
- const r = Pe(
9323
- () => s ?? te.generate(),
9324
- [s, te.generate]
9325
- ), { eventHandlers: n, config: o } = Pe(
9316
+ const r = Pe(() => s ?? Ae.generate(), [s]), { eventHandlers: n, config: o } = Pe(
9326
9317
  () => pi(t),
9327
9318
  [t]
9328
9319
  );
9329
- return /* @__PURE__ */ I.createElement(I.Fragment, null, /* @__PURE__ */ I.createElement(ui, { "ctx-name": r, ...o }), /* @__PURE__ */ I.createElement(
9320
+ return /* @__PURE__ */ O.createElement("div", { className: i }, /* @__PURE__ */ O.createElement(ui, { userAgentIntegration: mi(), "ctx-name": r, ...o }), /* @__PURE__ */ O.createElement(
9330
9321
  di,
9331
9322
  {
9332
9323
  ref: e,
9333
9324
  "ctx-name": r,
9334
9325
  ...n
9335
9326
  }
9336
- ), /* @__PURE__ */ I.createElement(da, { "ctx-name": r, "css-src": fa }));
9327
+ ), /* @__PURE__ */ O.createElement(ma, { "ctx-name": r, "css-src": ga }));
9337
9328
  };
9338
9329
  export {
9339
- Ca as FileUploaderInline,
9340
- va as FileUploaderMinimal,
9341
- ya as FileUploaderRegular,
9330
+ Aa as FileUploaderInline,
9331
+ Ea as FileUploaderMinimal,
9332
+ wa as FileUploaderRegular,
9342
9333
  Ft as UploadCtxProvider
9343
9334
  };