@templatical/media-library 0.6.7 → 0.7.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,4 +1,4 @@
1
- import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as u, K as d, L as f, M as p, N as m, O as h, P as g, Q as _, R as v, S as y, T as b, U as x, V as S, W as C, X as w, Y as T, Z as E, _ as D, a as O, at as k, b as ee, c as A, d as te, et as ne, f as re, g as ie, h as ae, i as oe, it as j, j as M, k as N, l as se, m as ce, n as le, nt as ue, o as de, ot as P, p as fe, q as F, r as pe, rt as I, s as me, st as L, t as he, tt as ge, u as _e, v as ve, w as R, x as ye, y as be, z } from "./chunks/icons-DY7nhIJb.js";
1
+ import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as u, K as d, L as f, M as p, N as m, O as h, P as g, Q as _, R as v, S as y, T as b, U as x, V as S, W as C, X as w, Y as T, Z as E, _ as D, a as O, at as k, b as ee, c as te, d as ne, et as re, f as A, g as ie, h as ae, i as oe, it as j, j as M, k as N, l as se, m as ce, n as le, nt as ue, o as de, ot as P, p as fe, q as F, r as pe, rt as I, s as me, st as L, t as he, tt as ge, u as _e, v as ve, w as R, x as ye, y as be, z } from "./chunks/icons-DY7nhIJb.js";
2
2
  //#region ../types/src/config.ts
3
3
  var xe = class extends Error {
4
4
  constructor(e, t) {
@@ -509,8 +509,11 @@ function Be(e, t, n, r) {
509
509
  };
510
510
  }
511
511
  //#endregion
512
+ //#region src/keys.ts
513
+ var Ve = Symbol("templaticalMediaPopoverTarget");
514
+ //#endregion
512
515
  //#region ../../node_modules/.pnpm/vue-advanced-cropper@2.8.9_vue@3.5.33_typescript@6.0.3_/node_modules/vue-advanced-cropper/dist/index.esm-bundler.js
513
- function Ve(e, t) {
516
+ function He(e, t) {
514
517
  var n = Object.keys(e);
515
518
  if (Object.getOwnPropertySymbols) {
516
519
  var r = Object.getOwnPropertySymbols(e);
@@ -523,9 +526,9 @@ function Ve(e, t) {
523
526
  function U(e) {
524
527
  for (var t = 1; t < arguments.length; t++) {
525
528
  var n = arguments[t] == null ? {} : arguments[t];
526
- t % 2 ? Ve(Object(n), !0).forEach((function(t) {
529
+ t % 2 ? He(Object(n), !0).forEach((function(t) {
527
530
  W(e, t, n[t]);
528
- })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Ve(Object(n)).forEach((function(t) {
531
+ })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : He(Object(n)).forEach((function(t) {
529
532
  Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
530
533
  }));
531
534
  }
@@ -539,7 +542,7 @@ function W(e, t, n) {
539
542
  writable: !0
540
543
  }) : e[t] = n, e;
541
544
  }
542
- function He(e, t) {
545
+ function Ue(e, t) {
543
546
  if (e == null) return {};
544
547
  var n, r, i = function(e, t) {
545
548
  if (e == null) return {};
@@ -553,28 +556,28 @@ function He(e, t) {
553
556
  }
554
557
  return i;
555
558
  }
556
- function Ue(e) {
559
+ function We(e) {
557
560
  return function(e) {
558
- if (Array.isArray(e)) return We(e);
561
+ if (Array.isArray(e)) return Ge(e);
559
562
  }(e) || function(e) {
560
563
  if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
561
564
  }(e) || function(e, t) {
562
565
  if (e) {
563
- if (typeof e == "string") return We(e, t);
566
+ if (typeof e == "string") return Ge(e, t);
564
567
  var n = Object.prototype.toString.call(e).slice(8, -1);
565
568
  if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
566
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return We(e, t);
569
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Ge(e, t);
567
570
  }
568
571
  }(e) || function() {
569
572
  throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
570
573
  }();
571
574
  }
572
- function We(e, t) {
575
+ function Ge(e, t) {
573
576
  (t == null || t > e.length) && (t = e.length);
574
577
  for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
575
578
  return r;
576
579
  }
577
- var Ge, Ke, qe, G = (Ge = function(e) {
580
+ var Ke, qe, Je, G = (Ke = function(e) {
578
581
  (function() {
579
582
  var t = {}.hasOwnProperty;
580
583
  function n() {
@@ -596,15 +599,15 @@ var Ge, Ke, qe, G = (Ge = function(e) {
596
599
  }
597
600
  e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
598
601
  })();
599
- }, Ge(qe = {
600
- path: Ke,
602
+ }, Ke(Je = {
603
+ path: qe,
601
604
  exports: {},
602
605
  require: function(e, t) {
603
606
  return function() {
604
607
  throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
605
- }(t == null && qe.path);
608
+ }(t == null && Je.path);
606
609
  }
607
- }, qe.exports), qe.exports), K = function(e) {
610
+ }, Je.exports), Je.exports), K = function(e) {
608
611
  return function(t, n) {
609
612
  if (!t) return e;
610
613
  var r;
@@ -616,7 +619,7 @@ var Ge, Ke, qe, G = (Ge = function(e) {
616
619
  }), "") : "");
617
620
  };
618
621
  };
619
- function Je(e, t, n) {
622
+ function Ye(e, t, n) {
620
623
  var r, i, a, o, s;
621
624
  function c() {
622
625
  var l = Date.now() - o;
@@ -634,65 +637,65 @@ function Je(e, t, n) {
634
637
  r &&= (s = e.apply(a, i), a = i = null, clearTimeout(r), null);
635
638
  }, l;
636
639
  }
637
- Je.debounce = Je;
638
- var Ye = Je, q = function() {
640
+ Ye.debounce = Ye;
641
+ var Xe = Ye, q = function() {
639
642
  return q = Object.assign || function(e) {
640
643
  for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n]) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
641
644
  return e;
642
645
  }, q.apply(this, arguments);
643
646
  };
644
- function Xe(e, t) {
647
+ function Ze(e, t) {
645
648
  var n, r;
646
649
  return e && t ? (n = "" + e + t[0].toUpperCase() + t.slice(1), r = e + "-" + t) : (n = e || t, r = e || t), {
647
650
  name: n,
648
651
  classname: r
649
652
  };
650
653
  }
651
- function Ze(e) {
654
+ function Qe(e) {
652
655
  return /^blob:/.test(e);
653
656
  }
654
- function Qe(e) {
655
- return Ze(e) || function(e) {
657
+ function $e(e) {
658
+ return Qe(e) || function(e) {
656
659
  return /^data:/.test(e);
657
660
  }(e);
658
661
  }
659
- function $e(e) {
662
+ function et(e) {
660
663
  return !!(e && e.constructor && e.call && e.apply);
661
664
  }
662
665
  function J(e) {
663
666
  return e === void 0;
664
667
  }
665
- function et(e) {
668
+ function tt(e) {
666
669
  return typeof e == "object" && !!e;
667
670
  }
668
- function tt(e, t, n) {
671
+ function nt(e, t, n) {
669
672
  var r = {};
670
- return et(e) ? (Object.keys(t).forEach((function(i) {
671
- J(e[i]) ? r[i] = t[i] : et(t[i]) ? et(e[i]) ? r[i] = tt(e[i], t[i], n[i]) : r[i] = e[i] ? t[i] : n[i] : !0 === t[i] || !1 === t[i] ? r[i] = !!e[i] : r[i] = e[i];
673
+ return tt(e) ? (Object.keys(t).forEach((function(i) {
674
+ J(e[i]) ? r[i] = t[i] : tt(t[i]) ? tt(e[i]) ? r[i] = nt(e[i], t[i], n[i]) : r[i] = e[i] ? t[i] : n[i] : !0 === t[i] || !1 === t[i] ? r[i] = !!e[i] : r[i] = e[i];
672
675
  })), r) : e ? t : n;
673
676
  }
674
- function nt(e) {
677
+ function rt(e) {
675
678
  var t = Number(e);
676
679
  return Number.isNaN(t) ? e : t;
677
680
  }
678
- function rt(e) {
681
+ function it(e) {
679
682
  return typeof (e == "number" || function(e) {
680
683
  return typeof e == "object" && !!e;
681
- }(e) && toString.call(e) == "[object Number]") && !it(e);
684
+ }(e) && toString.call(e) == "[object Number]") && !at(e);
682
685
  }
683
- function it(e) {
686
+ function at(e) {
684
687
  return e != e;
685
688
  }
686
- function at(e, t) {
689
+ function ot(e, t) {
687
690
  return Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2);
688
691
  }
689
- var ot = function(e, t) {
692
+ var st = function(e, t) {
690
693
  e === void 0 && (e = {}), t === void 0 && (t = {}), this.type = "manipulateImage", this.move = e, this.scale = t;
691
- }, st = function(e, t) {
694
+ }, ct = function(e, t) {
692
695
  t === void 0 && (t = {}), this.type = "resize", this.directions = e, this.params = t;
693
- }, ct = function(e) {
696
+ }, lt = function(e) {
694
697
  this.type = "move", this.directions = e;
695
- }, lt = function() {
698
+ }, ut = function() {
696
699
  function e(e, t, n, r, i) {
697
700
  this.type = "drag", this.nativeEvent = e, this.position = n, this.previousPosition = r, this.element = t, this.anchor = i;
698
701
  }
@@ -710,7 +713,7 @@ var ot = function(e, t) {
710
713
  top: 0
711
714
  };
712
715
  }, e;
713
- }(), ut = {
716
+ }(), dt = {
714
717
  name: "DraggableElement",
715
718
  props: { classname: { type: String } },
716
719
  beforeMount: function() {
@@ -731,7 +734,7 @@ var ot = function(e, t) {
731
734
  this.hovered && !this.touches.length && (this.hovered = !1, this.$emit("leave"));
732
735
  },
733
736
  onTouchStart: function(e) {
734
- e.cancelable && !this.disabled && e.touches.length === 1 && (this.touches = Ue(e.touches), this.hovered ||= (this.$emit("enter"), !0), e.touches.length && this.initAnchor(this.touches.reduce((function(t, n) {
737
+ e.cancelable && !this.disabled && e.touches.length === 1 && (this.touches = We(e.touches), this.hovered ||= (this.$emit("enter"), !0), e.touches.length && this.initAnchor(this.touches.reduce((function(t, n) {
735
738
  return {
736
739
  clientX: t.clientX + n.clientX / e.touches.length,
737
740
  clientY: t.clientY + n.clientY / e.touches.length
@@ -777,11 +780,11 @@ var ot = function(e, t) {
777
780
  };
778
781
  },
779
782
  processMove: function(e, t) {
780
- var n = Ue(t);
783
+ var n = We(t);
781
784
  if (this.touches.length) {
782
785
  if (this.touches.length === 1 && n.length === 1) {
783
786
  var r = this.$refs.draggable;
784
- this.$emit("drag", new lt(e, r, {
787
+ this.$emit("drag", new ut(e, r, {
785
788
  left: n[0].clientX,
786
789
  top: n[0].clientY
787
790
  }, {
@@ -803,7 +806,7 @@ var ot = function(e, t) {
803
806
  "enter"
804
807
  ]
805
808
  };
806
- ut.render = function(e, t, n, r, i, a) {
809
+ dt.render = function(e, t, n, r, i, a) {
807
810
  return z(), h("div", {
808
811
  ref: "draggable",
809
812
  class: n.classname,
@@ -821,9 +824,9 @@ ut.render = function(e, t, n, r, i, a) {
821
824
  }
822
825
  }, [c(e.$slots, "default")], 34);
823
826
  };
824
- var dt = K("vue-handler-wrapper"), ft = {
827
+ var ft = K("vue-handler-wrapper"), pt = {
825
828
  name: "HandlerWrapper",
826
- components: { DraggableElement: ut },
829
+ components: { DraggableElement: dt },
827
830
  props: {
828
831
  horizontalPosition: { type: String },
829
832
  verticalPosition: { type: String },
@@ -835,12 +838,12 @@ var dt = K("vue-handler-wrapper"), ft = {
835
838
  computed: { classes: function() {
836
839
  var e;
837
840
  if (this.horizontalPosition || this.verticalPosition) {
838
- var t, n = Xe(this.horizontalPosition, this.verticalPosition);
839
- e = dt((W(t = {}, n.classname, !0), W(t, "disabled", this.disabled), t));
840
- } else e = dt({ disabled: this.disabled });
841
+ var t, n = Ze(this.horizontalPosition, this.verticalPosition);
842
+ e = ft((W(t = {}, n.classname, !0), W(t, "disabled", this.disabled), t));
843
+ } else e = ft({ disabled: this.disabled });
841
844
  return {
842
845
  root: e,
843
- draggable: dt("draggable")
846
+ draggable: ft("draggable")
844
847
  };
845
848
  } },
846
849
  emits: [
@@ -850,7 +853,7 @@ var dt = K("vue-handler-wrapper"), ft = {
850
853
  "drag-end"
851
854
  ]
852
855
  };
853
- ft.render = function(e, t, n, r, i, a) {
856
+ pt.render = function(e, t, n, r, i, a) {
854
857
  var o = x("DraggableElement");
855
858
  return z(), h("div", { class: a.classes.root }, [p(o, {
856
859
  class: a.classes.draggable,
@@ -873,9 +876,9 @@ ft.render = function(e, t, n, r, i, a) {
873
876
  _: 3
874
877
  }, 8, ["class"])], 2);
875
878
  };
876
- var pt = K("vue-line-wrapper"), mt = {
879
+ var mt = K("vue-line-wrapper"), ht = {
877
880
  name: "LineWrapper",
878
- components: { DraggableElement: ut },
881
+ components: { DraggableElement: dt },
879
882
  props: {
880
883
  position: {
881
884
  type: String,
@@ -888,7 +891,7 @@ var pt = K("vue-line-wrapper"), mt = {
888
891
  },
889
892
  computed: { classname: function() {
890
893
  var e;
891
- return pt((W(e = {}, this.position, !0), W(e, "disabled", this.disabled), e));
894
+ return mt((W(e = {}, this.position, !0), W(e, "disabled", this.disabled), e));
892
895
  } },
893
896
  emits: [
894
897
  "leave",
@@ -897,7 +900,7 @@ var pt = K("vue-line-wrapper"), mt = {
897
900
  "drag-end"
898
901
  ]
899
902
  };
900
- mt.render = function(e, t, n, r, i, a) {
903
+ ht.render = function(e, t, n, r, i, a) {
901
904
  var o = x("DraggableElement");
902
905
  return z(), h(o, {
903
906
  class: a.classname,
@@ -920,23 +923,23 @@ mt.render = function(e, t, n, r, i, a) {
920
923
  _: 3
921
924
  }, 8, ["class"]);
922
925
  };
923
- var ht = [
926
+ var gt = [
924
927
  "left",
925
928
  "right",
926
929
  "top",
927
930
  "bottom"
928
- ], gt = ["left", "right"], _t = ["top", "bottom"], vt = ["left", "top"], yt = [
931
+ ], _t = ["left", "right"], vt = ["top", "bottom"], yt = ["left", "top"], bt = [
929
932
  "fill-area",
930
933
  "fit-area",
931
934
  "stencil",
932
935
  "none"
933
- ], bt = {
936
+ ], xt = {
934
937
  left: 0,
935
938
  top: 0,
936
939
  width: 0,
937
940
  height: 0
938
941
  };
939
- function xt(e, t, n) {
942
+ function St(e, t, n) {
940
943
  return !(n ||= [
941
944
  "width",
942
945
  "height",
@@ -946,7 +949,7 @@ function xt(e, t, n) {
946
949
  return e[n] !== t[n];
947
950
  }));
948
951
  }
949
- function St(e) {
952
+ function Ct(e) {
950
953
  return {
951
954
  left: e.left,
952
955
  top: e.top,
@@ -954,7 +957,7 @@ function St(e) {
954
957
  bottom: e.top + e.height
955
958
  };
956
959
  }
957
- function Ct(e, t) {
960
+ function wt(e, t) {
958
961
  return {
959
962
  left: e.left - t.left,
960
963
  top: e.top - t.top
@@ -966,19 +969,19 @@ function Y(e) {
966
969
  top: e.top + e.height / 2
967
970
  };
968
971
  }
969
- function wt(e, t) {
972
+ function Tt(e, t) {
970
973
  var n = {
971
974
  left: 0,
972
975
  top: 0,
973
976
  right: 0,
974
977
  bottom: 0
975
978
  };
976
- return ht.forEach((function(r) {
977
- var i = t[r], a = St(e)[r];
979
+ return gt.forEach((function(r) {
980
+ var i = t[r], a = Ct(e)[r];
978
981
  n[r] = i !== void 0 && a !== void 0 ? r === "left" || r === "top" ? Math.max(0, i - a) : Math.max(0, a - i) : 0;
979
982
  })), n;
980
983
  }
981
- function Tt(e, t) {
984
+ function Et(e, t) {
982
985
  return {
983
986
  left: e.left - t.left,
984
987
  top: e.top - t.top,
@@ -986,7 +989,7 @@ function Tt(e, t) {
986
989
  height: e.height + t.top + t.bottom
987
990
  };
988
991
  }
989
- function Et(e) {
992
+ function Dt(e) {
990
993
  return {
991
994
  left: -e.left,
992
995
  top: -e.top
@@ -1021,21 +1024,21 @@ function Z(e, t, n, r) {
1021
1024
  function Q(e) {
1022
1025
  return e.width / e.height;
1023
1026
  }
1024
- function Dt(e, t) {
1027
+ function Ot(e, t) {
1025
1028
  return Math.min(t.right !== void 0 && t.left !== void 0 ? (t.right - t.left) / e.width : Infinity, t.bottom !== void 0 && t.top !== void 0 ? (t.bottom - t.top) / e.height : Infinity);
1026
1029
  }
1027
- function Ot(e, t) {
1030
+ function kt(e, t) {
1028
1031
  var n = {
1029
1032
  left: 0,
1030
1033
  top: 0
1031
- }, r = wt(e, t);
1034
+ }, r = Tt(e, t);
1032
1035
  return r.left && r.left > 0 ? n.left = r.left : r.right && r.right > 0 && (n.left = -r.right), r.top && r.top > 0 ? n.top = r.top : r.bottom && r.bottom > 0 && (n.top = -r.bottom), n;
1033
1036
  }
1034
- function kt(e, t) {
1037
+ function At(e, t) {
1035
1038
  var n;
1036
1039
  return t.minimum && e < t.minimum ? n = t.minimum : t.maximum && e > t.maximum && (n = t.maximum), n;
1037
1040
  }
1038
- function At(e, t) {
1041
+ function jt(e, t) {
1039
1042
  var n = Q(e), r = Q(t);
1040
1043
  return t.width < Infinity && t.height < Infinity ? n > r ? {
1041
1044
  width: t.width,
@@ -1051,36 +1054,36 @@ function At(e, t) {
1051
1054
  height: t.height
1052
1055
  } : e;
1053
1056
  }
1054
- function jt(e, t) {
1057
+ function Mt(e, t) {
1055
1058
  var n = t * Math.PI / 180;
1056
1059
  return {
1057
1060
  width: Math.abs(e.width * Math.cos(n)) + Math.abs(e.height * Math.sin(n)),
1058
1061
  height: Math.abs(e.width * Math.sin(n)) + Math.abs(e.height * Math.cos(n))
1059
1062
  };
1060
1063
  }
1061
- function Mt(e, t) {
1064
+ function Nt(e, t) {
1062
1065
  var n = t * Math.PI / 180;
1063
1066
  return {
1064
1067
  left: e.left * Math.cos(n) - e.top * Math.sin(n),
1065
1068
  top: e.left * Math.sin(n) + e.top * Math.cos(n)
1066
1069
  };
1067
1070
  }
1068
- function Nt(e, t) {
1069
- var n = wt($(e, t), t);
1070
- return n.left + n.right + n.top + n.bottom ? n.left + n.right > n.top + n.bottom ? Math.min((e.width + n.left + n.right) / e.width, Dt(e, t)) : Math.min((e.height + n.top + n.bottom) / e.height, Dt(e, t)) : 1;
1071
+ function Pt(e, t) {
1072
+ var n = Tt($(e, t), t);
1073
+ return n.left + n.right + n.top + n.bottom ? n.left + n.right > n.top + n.bottom ? Math.min((e.width + n.left + n.right) / e.width, Ot(e, t)) : Math.min((e.height + n.top + n.bottom) / e.height, Ot(e, t)) : 1;
1071
1074
  }
1072
1075
  function $(e, t, n) {
1073
1076
  n === void 0 && (n = !1);
1074
- var r = Ot(e, t);
1075
- return X(e, n ? Et(r) : r);
1077
+ var r = kt(e, t);
1078
+ return X(e, n ? Dt(r) : r);
1076
1079
  }
1077
- function Pt(e) {
1080
+ function Ft(e) {
1078
1081
  return {
1079
1082
  width: e.right !== void 0 && e.left !== void 0 ? e.right - e.left : Infinity,
1080
1083
  height: e.bottom !== void 0 && e.top !== void 0 ? e.bottom - e.top : Infinity
1081
1084
  };
1082
1085
  }
1083
- function Ft(e, t) {
1086
+ function It(e, t) {
1084
1087
  return q(q({}, e), {
1085
1088
  minWidth: Math.min(t.width, e.minWidth),
1086
1089
  minHeight: Math.min(t.height, e.minHeight),
@@ -1088,25 +1091,25 @@ function Ft(e, t) {
1088
1091
  maxHeight: Math.min(t.height, e.maxHeight)
1089
1092
  });
1090
1093
  }
1091
- function It(e, t, n) {
1094
+ function Lt(e, t, n) {
1092
1095
  n === void 0 && (n = !0);
1093
1096
  var r = {};
1094
- return ht.forEach((function(i) {
1097
+ return gt.forEach((function(i) {
1095
1098
  var a = e[i], o = t[i];
1096
1099
  a !== void 0 && o !== void 0 ? r[i] = i === "left" || i === "top" ? n ? Math.max(a, o) : Math.min(a, o) : n ? Math.min(a, o) : Math.max(a, o) : o === void 0 ? a !== void 0 && (r[i] = a) : r[i] = o;
1097
1100
  })), r;
1098
1101
  }
1099
- function Lt(e, t) {
1100
- return It(e, t, !0);
1102
+ function Rt(e, t) {
1103
+ return Lt(e, t, !0);
1101
1104
  }
1102
- function Rt(e) {
1105
+ function zt(e) {
1103
1106
  var t = e.size, n = e.aspectRatio, r = e.ignoreMinimum, i = e.sizeRestrictions;
1104
1107
  return !!((t.correctRatio || Q(t) >= n.minimum && Q(t) <= n.maximum) && t.height <= i.maxHeight && t.width <= i.maxWidth && t.width && t.height && (r || t.height >= i.minHeight && t.width >= i.minWidth));
1105
1108
  }
1106
- function zt(e, t) {
1109
+ function Bt(e, t) {
1107
1110
  return (e.width - t.width) ** 2 + (e.height - t.height) ** 2;
1108
1111
  }
1109
- function Bt(e) {
1112
+ function Vt(e) {
1110
1113
  var t = e.width, n = e.height, r = e.sizeRestrictions, i = {
1111
1114
  minimum: e.aspectRatio && e.aspectRatio.minimum || 0,
1112
1115
  maximum: e.aspectRatio && e.aspectRatio.maximum || Infinity
@@ -1116,15 +1119,15 @@ function Bt(e) {
1116
1119
  };
1117
1120
  function o(e, a) {
1118
1121
  return a === void 0 && (a = !1), e.reduce((function(e, o) {
1119
- return Rt({
1122
+ return zt({
1120
1123
  size: o,
1121
1124
  aspectRatio: i,
1122
1125
  sizeRestrictions: r,
1123
1126
  ignoreMinimum: a
1124
- }) && (!e || zt(o, {
1127
+ }) && (!e || Bt(o, {
1125
1128
  width: t,
1126
1129
  height: n
1127
- }) < zt(e, {
1130
+ }) < Bt(e, {
1128
1131
  width: t,
1129
1132
  height: n
1130
1133
  })) ? o : e;
@@ -1141,7 +1144,7 @@ function Bt(e) {
1141
1144
  height: a.height,
1142
1145
  correctRatio: !0
1143
1146
  });
1144
- })), Rt({
1147
+ })), zt({
1145
1148
  size: a,
1146
1149
  aspectRatio: i,
1147
1150
  sizeRestrictions: r
@@ -1152,16 +1155,16 @@ function Bt(e) {
1152
1155
  height: c.height
1153
1156
  };
1154
1157
  }
1155
- function Vt(e) {
1158
+ function Ht(e) {
1156
1159
  var t = e.event, n = e.coordinates, r = e.positionRestrictions, i = r === void 0 ? {} : r, a = X(n, t.directions);
1157
- return X(a, Ot(a, i));
1160
+ return X(a, kt(a, i));
1158
1161
  }
1159
- function Ht(e) {
1162
+ function Ut(e) {
1160
1163
  var t = e.coordinates, n = e.transform, r = e.imageSize, i = e.sizeRestrictions, a = e.positionRestrictions, o = e.aspectRatio, s = e.visibleArea, c = function(e, t) {
1161
- return Vt({
1164
+ return Ht({
1162
1165
  coordinates: e,
1163
1166
  positionRestrictions: a,
1164
- event: new ct({
1167
+ event: new lt({
1165
1168
  left: t.left - e.left,
1166
1169
  top: t.top - e.top
1167
1170
  })
@@ -1174,7 +1177,7 @@ function Ht(e) {
1174
1177
  imageSize: r,
1175
1178
  visibleArea: s
1176
1179
  }) : e).width) && J(t.height) || (l = function(e, t) {
1177
- return c(q(q(q({}, e), Bt({
1180
+ return c(q(q(q({}, e), Vt({
1178
1181
  width: t.width,
1179
1182
  height: t.height,
1180
1183
  sizeRestrictions: i,
@@ -1189,9 +1192,9 @@ function Ht(e) {
1189
1192
  }(l, q(q({}, l), t))), J(t.left) && J(t.top) || (l = c(l, q(q({}, l), t)));
1190
1193
  })), l;
1191
1194
  }
1192
- function Ut(e) {
1195
+ function Wt(e) {
1193
1196
  var t = e.getAreaRestrictions, n = e.boundaries, r = e.coordinates, i = e.visibleArea, a = e.stencilSize, o = e.sizeRestrictions, s = e.positionRestrictions, c, l, u, d = q({}, r), f = q({}, i), p = q({}, a);
1194
- c = Q(p), l = Q(d), u === void 0 && (u = .001), (c === 0 || l === 0 ? Math.abs(l - c) < u : Math.abs(l / c) < 1 + u && Math.abs(l / c) > 1 - u) || (d = q(q({}, d), Bt({
1197
+ c = Q(p), l = Q(d), u === void 0 && (u = .001), (c === 0 || l === 0 ? Math.abs(l - c) < u : Math.abs(l / c) < 1 + u && Math.abs(l / c) > 1 - u) || (d = q(q({}, d), Vt({
1195
1198
  sizeRestrictions: o,
1196
1199
  width: d.width,
1197
1200
  height: d.height,
@@ -1200,19 +1203,19 @@ function Ut(e) {
1200
1203
  maximum: Q(p)
1201
1204
  }
1202
1205
  })));
1203
- var m = Nt(f = Z(f, d.width * n.width / (f.width * p.width)), t({
1206
+ var m = Pt(f = Z(f, d.width * n.width / (f.width * p.width)), t({
1204
1207
  visibleArea: f,
1205
1208
  type: "resize"
1206
1209
  }));
1207
- return m !== 1 && (f = Z(f, m), d = Z(d, m)), f = $(f = X(f, Ct(Y(d), Y(f))), t({
1210
+ return m !== 1 && (f = Z(f, m), d = Z(d, m)), f = $(f = X(f, wt(Y(d), Y(f))), t({
1208
1211
  visibleArea: f,
1209
1212
  type: "move"
1210
1213
  })), {
1211
- coordinates: d = $(d, Lt(St(f), s)),
1214
+ coordinates: d = $(d, Rt(Ct(f), s)),
1212
1215
  visibleArea: f
1213
1216
  };
1214
1217
  }
1215
- function Wt(e) {
1218
+ function Gt(e) {
1216
1219
  var t = e.event, n = e.getAreaRestrictions, r = e.boundaries, i = e.coordinates, a = e.visibleArea, o = e.positionRestrictions, s = q({}, i), c = q({}, a);
1217
1220
  if (i && a && t.type !== "manipulateImage") {
1218
1221
  var l = {
@@ -1220,31 +1223,31 @@ function Wt(e) {
1220
1223
  height: 0
1221
1224
  };
1222
1225
  Q(r) > Q(s) ? (l.height = .8 * r.height, l.width = l.height * Q(s)) : (l.width = .8 * r.width, l.height = l.width * Q(s));
1223
- var u = Nt(c = Z(c, s.width * r.width / (c.width * l.width)), n({
1226
+ var u = Pt(c = Z(c, s.width * r.width / (c.width * l.width)), n({
1224
1227
  visibleArea: c,
1225
1228
  type: "resize"
1226
1229
  }));
1227
- c = Z(c, u), u !== 1 && (l.height /= u, l.width /= u), c = $(c = X(c, Ct(Y(s), Y(c))), n({
1230
+ c = Z(c, u), u !== 1 && (l.height /= u, l.width /= u), c = $(c = X(c, wt(Y(s), Y(c))), n({
1228
1231
  visibleArea: c,
1229
1232
  type: "move"
1230
- })), s = $(s, Lt(St(c), o));
1233
+ })), s = $(s, Rt(Ct(c), o));
1231
1234
  }
1232
1235
  return {
1233
1236
  coordinates: s,
1234
1237
  visibleArea: c
1235
1238
  };
1236
1239
  }
1237
- function Gt(e) {
1240
+ function Kt(e) {
1238
1241
  var t = e.event, n = e.coordinates, r = e.visibleArea, i = e.getAreaRestrictions, a = q({}, r), o = q({}, n);
1239
1242
  if (t.type === "setCoordinates") {
1240
1243
  var s = Math.max(0, o.width - a.width), c = Math.max(0, o.height - a.height);
1241
- s > c ? a = Z(a, Math.min(o.width / a.width, Dt(a, i({
1244
+ s > c ? a = Z(a, Math.min(o.width / a.width, Ot(a, i({
1242
1245
  visibleArea: a,
1243
1246
  type: "resize"
1244
- })))) : c > s && (a = Z(a, Math.min(o.height / a.height, Dt(a, i({
1247
+ })))) : c > s && (a = Z(a, Math.min(o.height / a.height, Ot(a, i({
1245
1248
  visibleArea: a,
1246
1249
  type: "resize"
1247
- }))))), a = $(a = X(a, Et(Ot(o, St(a)))), i({
1250
+ }))))), a = $(a = X(a, Dt(kt(o, Ct(a)))), i({
1248
1251
  visibleArea: a,
1249
1252
  type: "move"
1250
1253
  }));
@@ -1254,14 +1257,14 @@ function Gt(e) {
1254
1257
  coordinates: o
1255
1258
  };
1256
1259
  }
1257
- function Kt(e) {
1260
+ function qt(e) {
1258
1261
  var t = e.imageSize, n = e.visibleArea, r = e.coordinates, i = n || t;
1259
1262
  return {
1260
1263
  left: (n ? n.left : 0) + i.width / 2 - r.width / 2,
1261
1264
  top: (n ? n.top : 0) + i.height / 2 - r.height / 2
1262
1265
  };
1263
1266
  }
1264
- function qt(e) {
1267
+ function Jt(e) {
1265
1268
  var t = e.imageSize, n = e.visibleArea, r = e.aspectRatio, i = e.sizeRestrictions, a = n || t, o = Math.min(r.maximum || Infinity, Math.max(r.minimum || 0, Q(a))), s = a.width < a.height ? {
1266
1269
  width: .8 * a.width,
1267
1270
  height: .8 * a.width / o
@@ -1269,35 +1272,35 @@ function qt(e) {
1269
1272
  height: .8 * a.height,
1270
1273
  width: .8 * a.height * o
1271
1274
  };
1272
- return Bt(q(q({}, s), {
1275
+ return Vt(q(q({}, s), {
1273
1276
  aspectRatio: r,
1274
1277
  sizeRestrictions: i
1275
1278
  }));
1276
1279
  }
1277
- function Jt(e) {
1280
+ function Yt(e) {
1278
1281
  var t, n, r = e.imageSize, i = e.visibleArea, a = e.boundaries, o = e.aspectRatio, s = e.sizeRestrictions, c = e.stencilSize, l = i || r;
1279
- return Q(l) > Q(a) ? n = (t = c.height * l.height / a.height) * Q(c) : t = (n = c.width * l.width / a.width) / Q(c), Bt({
1282
+ return Q(l) > Q(a) ? n = (t = c.height * l.height / a.height) * Q(c) : t = (n = c.width * l.width / a.width) / Q(c), Vt({
1280
1283
  width: n,
1281
1284
  height: t,
1282
1285
  aspectRatio: o,
1283
1286
  sizeRestrictions: s
1284
1287
  });
1285
1288
  }
1286
- function Yt(e) {
1289
+ function Xt(e) {
1287
1290
  var t = e.getAreaRestrictions, n = e.coordinates, r = e.imageSize, i = Q(e.boundaries);
1288
1291
  if (n) {
1289
1292
  var a = {
1290
1293
  height: Math.max(n.height, r.height),
1291
1294
  width: Math.max(n.width, r.width)
1292
- }, o = At({
1295
+ }, o = jt({
1293
1296
  width: Q(a) > i ? a.width : a.height * i,
1294
1297
  height: Q(a) > i ? a.width / i : a.height
1295
- }, Pt(t())), s = {
1298
+ }, Ft(t())), s = {
1296
1299
  left: n.left + n.width / 2 - o.width / 2,
1297
1300
  top: n.top + n.height / 2 - o.height / 2,
1298
1301
  width: o.width,
1299
1302
  height: o.height
1300
- }, c = wt(n, St(q({
1303
+ }, c = Tt(n, Ct(q({
1301
1304
  left: 0,
1302
1305
  top: 0
1303
1306
  }, r))), l = {};
@@ -1314,10 +1317,10 @@ function Yt(e) {
1314
1317
  height: o.height
1315
1318
  };
1316
1319
  }
1317
- function Xt(e, t) {
1318
- return It(e, St(t));
1320
+ function Zt(e, t) {
1321
+ return Lt(e, Ct(t));
1319
1322
  }
1320
- function Zt(e) {
1323
+ function Qt(e) {
1321
1324
  var t = e.event, n = e.coordinates, r = e.visibleArea, i = e.sizeRestrictions, a = e.getAreaRestrictions, o = e.positionRestrictions, s = e.adjustStencil, c = t.scale, l = t.move, u = q({}, r), d = q({}, n), f = 1, p = 1, m = c.factor && Math.abs(c.factor - 1) > .001;
1322
1325
  u = X(u, {
1323
1326
  left: l.left || 0,
@@ -1326,16 +1329,16 @@ function Zt(e) {
1326
1329
  var h = {
1327
1330
  stencil: {
1328
1331
  minimum: Math.max(i.minWidth ? i.minWidth / d.width : 0, i.minHeight ? i.minHeight / d.height : 0),
1329
- maximum: Math.min(i.maxWidth ? i.maxWidth / d.width : Infinity, i.maxHeight ? i.maxHeight / d.height : Infinity, Dt(d, o))
1332
+ maximum: Math.min(i.maxWidth ? i.maxWidth / d.width : Infinity, i.maxHeight ? i.maxHeight / d.height : Infinity, Ot(d, o))
1330
1333
  },
1331
- area: { maximum: Dt(u, a({
1334
+ area: { maximum: Ot(u, a({
1332
1335
  visibleArea: u,
1333
1336
  type: "resize"
1334
1337
  })) }
1335
1338
  };
1336
1339
  c.factor && m && (c.factor < 1 ? (p = Math.max(c.factor, h.stencil.minimum)) > 1 && (p = 1) : c.factor > 1 && (p = Math.min(c.factor, Math.min(h.area.maximum, h.stencil.maximum))) < 1 && (p = 1)), p && (u = Z(u, p, c.center));
1337
1340
  var g = n.left - r.left, _ = r.width + r.left - (n.width + n.left), v = n.top - r.top, y = r.height + r.top - (n.height + n.top);
1338
- return u = $(u = X(u, Ot(u, {
1341
+ return u = $(u = X(u, kt(u, {
1339
1342
  left: o.left === void 0 ? void 0 : o.left - g * p,
1340
1343
  top: o.top === void 0 ? void 0 : o.top - v * p,
1341
1344
  bottom: o.bottom === void 0 ? void 0 : o.bottom + y * p,
@@ -1343,46 +1346,46 @@ function Zt(e) {
1343
1346
  })), a({
1344
1347
  visibleArea: u,
1345
1348
  type: "move"
1346
- })), d.width *= p, d.height *= p, d.left = u.left + g * p, d.top = u.top + v * p, d = $(d, Lt(St(u), o)), c.factor && m && s && (c.factor > 1 ? f = Math.min(h.area.maximum, c.factor) / p : c.factor < 1 && (f = Math.max(d.height / u.height, d.width / u.width, c.factor / p)), f !== 1 && (u = X(u = $(u = Z(u, f, c.factor > 1 ? c.center : Y(d)), a({
1349
+ })), d.width *= p, d.height *= p, d.left = u.left + g * p, d.top = u.top + v * p, d = $(d, Rt(Ct(u), o)), c.factor && m && s && (c.factor > 1 ? f = Math.min(h.area.maximum, c.factor) / p : c.factor < 1 && (f = Math.max(d.height / u.height, d.width / u.width, c.factor / p)), f !== 1 && (u = X(u = $(u = Z(u, f, c.factor > 1 ? c.center : Y(d)), a({
1347
1350
  visibleArea: u,
1348
1351
  type: "move"
1349
- })), Et(Ot(d, St(u)))))), {
1352
+ })), Dt(kt(d, Ct(u)))))), {
1350
1353
  coordinates: d,
1351
1354
  visibleArea: u
1352
1355
  };
1353
1356
  }
1354
- function Qt(e) {
1355
- var t = e.aspectRatio, n = e.getAreaRestrictions, r = e.coordinates, i = e.visibleArea, a = e.sizeRestrictions, o = e.positionRestrictions, s = e.imageSize, c = e.previousImageSize, l = e.angle, u = q({}, r), d = q({}, i), f = Mt(Y(q({
1357
+ function $t(e) {
1358
+ var t = e.aspectRatio, n = e.getAreaRestrictions, r = e.coordinates, i = e.visibleArea, a = e.sizeRestrictions, o = e.positionRestrictions, s = e.imageSize, c = e.previousImageSize, l = e.angle, u = q({}, r), d = q({}, i), f = Nt(Y(q({
1356
1359
  left: 0,
1357
1360
  top: 0
1358
1361
  }, c)), l);
1359
- return (u = q(q({}, Bt({
1362
+ return (u = q(q({}, Vt({
1360
1363
  sizeRestrictions: a,
1361
1364
  aspectRatio: t,
1362
1365
  width: u.width,
1363
1366
  height: u.height
1364
- })), Mt(Y(u), l))).left -= f.left - s.width / 2 + u.width / 2, u.top -= f.top - s.height / 2 + u.height / 2, d = Z(d, Nt(d, n({
1367
+ })), Nt(Y(u), l))).left -= f.left - s.width / 2 + u.width / 2, u.top -= f.top - s.height / 2 + u.height / 2, d = Z(d, Pt(d, n({
1365
1368
  visibleArea: d,
1366
1369
  type: "resize"
1367
1370
  }))), {
1368
1371
  coordinates: u = $(u, o),
1369
- visibleArea: d = $(d = X(d, Ct(Y(u), Y(r))), n({
1372
+ visibleArea: d = $(d = X(d, wt(Y(u), Y(r))), n({
1370
1373
  visibleArea: d,
1371
1374
  type: "move"
1372
1375
  }))
1373
1376
  };
1374
1377
  }
1375
- function $t(e) {
1378
+ function en(e) {
1376
1379
  var t = e.flip, n = e.previousFlip, r = e.rotate, i = e.getAreaRestrictions, a = e.coordinates, o = e.visibleArea, s = e.imageSize, c = q({}, a), l = q({}, o), u = n.horizontal !== t.horizontal, d = n.vertical !== t.vertical;
1377
1380
  if (u || d) {
1378
- var f = Mt({
1381
+ var f = Nt({
1379
1382
  left: s.width / 2,
1380
1383
  top: s.height / 2
1381
- }, -r), p = Mt(Y(c), -r), m = Mt({
1384
+ }, -r), p = Nt(Y(c), -r), m = Nt({
1382
1385
  left: u ? f.left - (p.left - f.left) : p.left,
1383
1386
  top: d ? f.top - (p.top - f.top) : p.top
1384
1387
  }, r);
1385
- c = X(c, Ct(m, Y(c))), p = Mt(Y(l), -r), l = $(l = X(l, Ct(m = Mt({
1388
+ c = X(c, wt(m, Y(c))), p = Nt(Y(l), -r), l = $(l = X(l, wt(m = Nt({
1386
1389
  left: u ? f.left - (p.left - f.left) : p.left,
1387
1390
  top: d ? f.top - (p.top - f.top) : p.top
1388
1391
  }, r), Y(l))), i({
@@ -1395,11 +1398,11 @@ function $t(e) {
1395
1398
  visibleArea: l
1396
1399
  };
1397
1400
  }
1398
- function en(e) {
1399
- var t = e.directions, n = e.coordinates, r = e.positionRestrictions, i = r === void 0 ? {} : r, a = e.sizeRestrictions, o = e.preserveRatio, s = e.compensate, c = q({}, t), l = Tt(n, c).width, u = Tt(n, c).height;
1401
+ function tn(e) {
1402
+ var t = e.directions, n = e.coordinates, r = e.positionRestrictions, i = r === void 0 ? {} : r, a = e.sizeRestrictions, o = e.preserveRatio, s = e.compensate, c = q({}, t), l = Et(n, c).width, u = Et(n, c).height;
1400
1403
  l < 0 && (c.left < 0 && c.right < 0 ? (c.left = -(n.width - a.minWidth) / (c.left / c.right), c.right = -(n.width - a.minWidth) / (c.right / c.left)) : c.left < 0 ? c.left = -(n.width - a.minWidth) : c.right < 0 && (c.right = -(n.width - a.minWidth))), u < 0 && (c.top < 0 && c.bottom < 0 ? (c.top = -(n.height - a.minHeight) / (c.top / c.bottom), c.bottom = -(n.height - a.minHeight) / (c.bottom / c.top)) : c.top < 0 ? c.top = -(n.height - a.minHeight) : c.bottom < 0 && (c.bottom = -(n.height - a.minHeight)));
1401
- var d = wt(Tt(n, c), i);
1402
- s && (d.left && d.left > 0 && d.right === 0 ? (c.right += d.left, c.left -= d.left) : d.right && d.right > 0 && d.left === 0 && (c.left += d.right, c.right -= d.right), d.top && d.top > 0 && d.bottom === 0 ? (c.bottom += d.top, c.top -= d.top) : d.bottom && d.bottom > 0 && d.top === 0 && (c.top += d.bottom, c.bottom -= d.bottom), d = wt(Tt(n, c), i));
1404
+ var d = Tt(Et(n, c), i);
1405
+ s && (d.left && d.left > 0 && d.right === 0 ? (c.right += d.left, c.left -= d.left) : d.right && d.right > 0 && d.left === 0 && (c.left += d.right, c.right -= d.right), d.top && d.top > 0 && d.bottom === 0 ? (c.bottom += d.top, c.top -= d.top) : d.bottom && d.bottom > 0 && d.top === 0 && (c.top += d.bottom, c.bottom -= d.bottom), d = Tt(Et(n, c), i));
1403
1406
  var f = {
1404
1407
  width: Infinity,
1405
1408
  height: Infinity,
@@ -1408,37 +1411,37 @@ function en(e) {
1408
1411
  top: Infinity,
1409
1412
  bottom: Infinity
1410
1413
  };
1411
- if (ht.forEach((function(e) {
1414
+ if (gt.forEach((function(e) {
1412
1415
  var t = d[e];
1413
1416
  t && c[e] && (f[e] = Math.max(0, 1 - t / c[e]));
1414
1417
  })), o) {
1415
- var p = Math.min.apply(null, ht.map((function(e) {
1418
+ var p = Math.min.apply(null, gt.map((function(e) {
1416
1419
  return f[e];
1417
1420
  })));
1418
- p !== Infinity && ht.forEach((function(e) {
1421
+ p !== Infinity && gt.forEach((function(e) {
1419
1422
  c[e] *= p;
1420
1423
  }));
1421
- } else ht.forEach((function(e) {
1424
+ } else gt.forEach((function(e) {
1422
1425
  f[e] !== Infinity && (c[e] *= f[e]);
1423
1426
  }));
1424
- if (l = Tt(n, c).width, u = Tt(n, c).height, c.right + c.left && (l > a.maxWidth ? f.width = (a.maxWidth - n.width) / (c.right + c.left) : l < a.minWidth && (f.width = (a.minWidth - n.width) / (c.right + c.left))), c.bottom + c.top && (u > a.maxHeight ? f.height = (a.maxHeight - n.height) / (c.bottom + c.top) : u < a.minHeight && (f.height = (a.minHeight - n.height) / (c.bottom + c.top))), o) {
1427
+ if (l = Et(n, c).width, u = Et(n, c).height, c.right + c.left && (l > a.maxWidth ? f.width = (a.maxWidth - n.width) / (c.right + c.left) : l < a.minWidth && (f.width = (a.minWidth - n.width) / (c.right + c.left))), c.bottom + c.top && (u > a.maxHeight ? f.height = (a.maxHeight - n.height) / (c.bottom + c.top) : u < a.minHeight && (f.height = (a.minHeight - n.height) / (c.bottom + c.top))), o) {
1425
1428
  var m = Math.min(f.width, f.height);
1426
- m !== Infinity && ht.forEach((function(e) {
1429
+ m !== Infinity && gt.forEach((function(e) {
1427
1430
  c[e] *= m;
1428
1431
  }));
1429
- } else f.width !== Infinity && gt.forEach((function(e) {
1432
+ } else f.width !== Infinity && _t.forEach((function(e) {
1430
1433
  c[e] *= f.width;
1431
- })), f.height !== Infinity && _t.forEach((function(e) {
1434
+ })), f.height !== Infinity && vt.forEach((function(e) {
1432
1435
  c[e] *= f.height;
1433
1436
  }));
1434
1437
  return c;
1435
1438
  }
1436
- function tn(e, t, n) {
1439
+ function nn(e, t, n) {
1437
1440
  return t == 0 && n == 0 ? e / 2 : t == 0 ? 0 : n == 0 ? e : e * Math.abs(t / (t + n));
1438
1441
  }
1439
- var nn = K("vue-simple-handler"), rn = K("vue-simple-handler-wrapper"), an = {
1442
+ var rn = K("vue-simple-handler"), an = K("vue-simple-handler-wrapper"), on = {
1440
1443
  name: "SimpleHandler",
1441
- components: { HandlerWrapper: ft },
1444
+ components: { HandlerWrapper: pt },
1442
1445
  props: {
1443
1446
  defaultClass: { type: String },
1444
1447
  hoverClass: { type: String },
@@ -1456,8 +1459,8 @@ var nn = K("vue-simple-handler"), rn = K("vue-simple-handler-wrapper"), an = {
1456
1459
  computed: { classes: function() {
1457
1460
  var e, t = (W(e = {}, this.horizontalPosition, !!this.horizontalPosition), W(e, this.verticalPosition, !!this.verticalPosition), W(e, `${this.horizontalPosition}-${this.verticalPosition}`, !!(this.verticalPosition && this.horizontalPosition)), W(e, "hover", this.hover), e);
1458
1461
  return {
1459
- default: G(nn(t), this.defaultClass, this.hover && this.hoverClass),
1460
- wrapper: G(rn(t), this.wrapperClass)
1462
+ default: G(rn(t), this.defaultClass, this.hover && this.hoverClass),
1463
+ wrapper: G(an(t), this.wrapperClass)
1461
1464
  };
1462
1465
  } },
1463
1466
  methods: {
@@ -1476,7 +1479,7 @@ var nn = K("vue-simple-handler"), rn = K("vue-simple-handler-wrapper"), an = {
1476
1479
  },
1477
1480
  emits: ["drag", "drag-end"]
1478
1481
  };
1479
- an.render = function(e, t, n, r, i, a) {
1482
+ on.render = function(e, t, n, r, i, a) {
1480
1483
  var o = x("HandlerWrapper");
1481
1484
  return z(), h(o, {
1482
1485
  class: a.classes.wrapper,
@@ -1503,9 +1506,9 @@ an.render = function(e, t, n, r, i, a) {
1503
1506
  "onLeave"
1504
1507
  ]);
1505
1508
  };
1506
- var on = K("vue-simple-line"), sn = K("vue-simple-line-wrapper"), cn = {
1509
+ var sn = K("vue-simple-line"), cn = K("vue-simple-line-wrapper"), ln = {
1507
1510
  name: "SimpleLine",
1508
- components: { LineWrapper: mt },
1511
+ components: { LineWrapper: ht },
1509
1512
  props: {
1510
1513
  defaultClass: { type: String },
1511
1514
  hoverClass: { type: String },
@@ -1521,8 +1524,8 @@ var on = K("vue-simple-line"), sn = K("vue-simple-line-wrapper"), cn = {
1521
1524
  },
1522
1525
  computed: { classes: function() {
1523
1526
  return {
1524
- root: G(on(W({}, this.position, !0)), this.defaultClass, this.hover && this.hoverClass),
1525
- wrapper: G(sn(W({}, this.position, !0)), this.wrapperClass)
1527
+ root: G(sn(W({}, this.position, !0)), this.defaultClass, this.hover && this.hoverClass),
1528
+ wrapper: G(cn(W({}, this.position, !0)), this.wrapperClass)
1526
1529
  };
1527
1530
  } },
1528
1531
  methods: {
@@ -1541,7 +1544,7 @@ var on = K("vue-simple-line"), sn = K("vue-simple-line-wrapper"), cn = {
1541
1544
  },
1542
1545
  emits: ["drag", "drag-end"]
1543
1546
  };
1544
- cn.render = function(e, t, n, r, i, a) {
1547
+ ln.render = function(e, t, n, r, i, a) {
1545
1548
  var o = x("LineWrapper");
1546
1549
  return z(), h(o, {
1547
1550
  class: a.classes.wrapper,
@@ -1566,15 +1569,15 @@ cn.render = function(e, t, n, r, i, a) {
1566
1569
  "onLeave"
1567
1570
  ]);
1568
1571
  };
1569
- var ln = K("vue-bounding-box"), un = [
1572
+ var un = K("vue-bounding-box"), dn = [
1570
1573
  "east",
1571
1574
  "west",
1572
1575
  null
1573
- ], dn = [
1576
+ ], fn = [
1574
1577
  "south",
1575
1578
  "north",
1576
1579
  null
1577
- ], fn = {
1580
+ ], pn = {
1578
1581
  name: "BoundingBox",
1579
1582
  props: {
1580
1583
  width: { type: Number },
@@ -1598,7 +1601,7 @@ var ln = K("vue-bounding-box"), un = [
1598
1601
  handlersComponent: {
1599
1602
  type: [Object, String],
1600
1603
  default: function() {
1601
- return an;
1604
+ return on;
1602
1605
  }
1603
1606
  },
1604
1607
  handlersClasses: {
@@ -1627,7 +1630,7 @@ var ln = K("vue-bounding-box"), un = [
1627
1630
  linesComponent: {
1628
1631
  type: [Object, String],
1629
1632
  default: function() {
1630
- return cn;
1633
+ return ln;
1631
1634
  }
1632
1635
  },
1633
1636
  linesClasses: {
@@ -1649,10 +1652,10 @@ var ln = K("vue-bounding-box"), un = [
1649
1652
  },
1650
1653
  data: function() {
1651
1654
  var e = [];
1652
- return un.forEach((function(t) {
1653
- dn.forEach((function(n) {
1655
+ return dn.forEach((function(t) {
1656
+ fn.forEach((function(n) {
1654
1657
  if (t !== n) {
1655
- var r = Xe(t, n);
1658
+ var r = Ze(t, n);
1656
1659
  e.push({
1657
1660
  name: r.name,
1658
1661
  classname: r.classname,
@@ -1671,7 +1674,7 @@ var ln = K("vue-bounding-box"), un = [
1671
1674
  classes: function() {
1672
1675
  var e = this.handlersClasses, t = this.handlersWrappersClasses, n = this.linesClasses, r = this.linesWrappersClasses;
1673
1676
  return {
1674
- root: ln(),
1677
+ root: un(),
1675
1678
  handlers: e,
1676
1679
  handlersWrappers: t,
1677
1680
  lines: n,
@@ -1709,8 +1712,8 @@ var ln = K("vue-bounding-box"), un = [
1709
1712
  };
1710
1713
  if (n && r) {
1711
1714
  var o = i.horizontalDirection, s = i.verticalDirection, c = o === "east" ? n : o === "west" ? 0 : n / 2, l = s === "south" ? r : s === "north" ? 0 : r / 2;
1712
- a.wrapperClass = ln("handler"), a.wrapperStyle = { transform: `translate(${c}px, ${l}px)` }, e.transitions && e.transitions.enabled && (a.wrapperStyle.transition = `${e.transitions.time}ms ${e.transitions.timingFunction}`);
1713
- } else a.wrapperClass = ln("handler", W({}, i.classname, !0));
1715
+ a.wrapperClass = un("handler"), a.wrapperStyle = { transform: `translate(${c}px, ${l}px)` }, e.transitions && e.transitions.enabled && (a.wrapperStyle.transition = `${e.transitions.time}ms ${e.transitions.timingFunction}`);
1716
+ } else a.wrapperClass = un("handler", W({}, i.classname, !0));
1714
1717
  t.push(a);
1715
1718
  }
1716
1719
  })), t;
@@ -1736,7 +1739,7 @@ var ln = K("vue-bounding-box"), un = [
1736
1739
  top: 0,
1737
1740
  bottom: 0
1738
1741
  };
1739
- t === "west" ? s.left -= a : t === "east" && (s.right += a), n === "north" ? s.top -= o : n === "south" && (s.bottom += o), !n && t ? r = "width" : n && !t && (r = "height"), this.resizable && this.$emit("resize", new st(s, {
1742
+ t === "west" ? s.left -= a : t === "east" && (s.right += a), n === "north" ? s.top -= o : n === "south" && (s.bottom += o), !n && t ? r = "width" : n && !t && (r = "height"), this.resizable && this.$emit("resize", new ct(s, {
1740
1743
  allowedDirections: {
1741
1744
  left: t === "west" || !t,
1742
1745
  right: t === "east" || !t,
@@ -1750,7 +1753,7 @@ var ln = K("vue-bounding-box"), un = [
1750
1753
  },
1751
1754
  emits: ["resize", "resize-end"]
1752
1755
  };
1753
- fn.render = function(e, t, n, r, i, a) {
1756
+ pn.render = function(e, t, n, r, i, a) {
1754
1757
  return z(), h("div", {
1755
1758
  ref: "box",
1756
1759
  class: a.classes.root,
@@ -1810,7 +1813,7 @@ fn.render = function(e, t, n, r, i, a) {
1810
1813
  })), 128))
1811
1814
  ], 6);
1812
1815
  };
1813
- var pn = K("vue-draggable-area"), mn = {
1816
+ var mn = K("vue-draggable-area"), hn = {
1814
1817
  name: "DraggableArea",
1815
1818
  props: {
1816
1819
  movable: {
@@ -1823,7 +1826,7 @@ var pn = K("vue-draggable-area"), mn = {
1823
1826
  }
1824
1827
  },
1825
1828
  computed: { classnames: function() {
1826
- return { default: pn() };
1829
+ return { default: mn() };
1827
1830
  } },
1828
1831
  beforeMount: function() {
1829
1832
  window.addEventListener("mouseup", this.onMouseUp, { passive: !1 }), window.addEventListener("mousemove", this.onMouseMove, { passive: !1 }), window.addEventListener("touchmove", this.onTouchMove, { passive: !1 }), window.addEventListener("touchend", this.onTouchEnd, { passive: !1 });
@@ -1838,14 +1841,14 @@ var pn = K("vue-draggable-area"), mn = {
1838
1841
  onTouchStart: function(e) {
1839
1842
  if (e.cancelable) {
1840
1843
  var t = this.movable && e.touches.length === 1;
1841
- t && (this.touches = Ue(e.touches)), (this.touchStarted || t) && (e.preventDefault(), e.stopPropagation());
1844
+ t && (this.touches = We(e.touches)), (this.touchStarted || t) && (e.preventDefault(), e.stopPropagation());
1842
1845
  }
1843
1846
  },
1844
1847
  onTouchEnd: function() {
1845
1848
  this.touchStarted = !1, this.processEnd();
1846
1849
  },
1847
1850
  onTouchMove: function(e) {
1848
- this.touches.length >= 1 && (this.touchStarted ? (this.processMove(e, e.touches), e.preventDefault(), e.stopPropagation()) : at({
1851
+ this.touches.length >= 1 && (this.touchStarted ? (this.processMove(e, e.touches), e.preventDefault(), e.stopPropagation()) : ot({
1849
1852
  x: this.touches[0].clientX,
1850
1853
  y: this.touches[0].clientY
1851
1854
  }, {
@@ -1884,10 +1887,10 @@ var pn = K("vue-draggable-area"), mn = {
1884
1887
  };
1885
1888
  },
1886
1889
  processMove: function(e, t) {
1887
- var n = Ue(t);
1890
+ var n = We(t);
1888
1891
  if (this.touches.length) {
1889
1892
  var r = this.$refs.container.getBoundingClientRect(), i = r.left, a = r.top;
1890
- this.touches.length === 1 && n.length === 1 && this.$emit("move", new ct({
1893
+ this.touches.length === 1 && n.length === 1 && this.$emit("move", new lt({
1891
1894
  left: n[0].clientX - (i + this.anchor.x),
1892
1895
  top: n[0].clientY - (a + this.anchor.y)
1893
1896
  }));
@@ -1899,7 +1902,7 @@ var pn = K("vue-draggable-area"), mn = {
1899
1902
  },
1900
1903
  emits: ["move", "move-end"]
1901
1904
  };
1902
- mn.render = function(e, t, n, r, i, a) {
1905
+ hn.render = function(e, t, n, r, i, a) {
1903
1906
  return z(), h("div", {
1904
1907
  ref: "container",
1905
1908
  onTouchstart: t[1] ||= function() {
@@ -1910,7 +1913,7 @@ mn.render = function(e, t, n, r, i, a) {
1910
1913
  }
1911
1914
  }, [c(e.$slots, "default")], 544);
1912
1915
  };
1913
- function hn(e) {
1916
+ function gn(e) {
1914
1917
  return {
1915
1918
  rotate: e.rotate || 0,
1916
1919
  flip: {
@@ -1919,7 +1922,7 @@ function hn(e) {
1919
1922
  }
1920
1923
  };
1921
1924
  }
1922
- function gn(e) {
1925
+ function _n(e) {
1923
1926
  return new Promise((function(t, n) {
1924
1927
  try {
1925
1928
  if (e) if (/^data:/i.test(e)) t(function(e) {
@@ -1951,11 +1954,11 @@ function gn(e) {
1951
1954
  var a, o, s;
1952
1955
  }));
1953
1956
  }
1954
- function _n(e) {
1957
+ function vn(e) {
1955
1958
  var t = e.rotate, n = e.flip, r = e.scaleX, i = e.scaleY, a = "";
1956
1959
  return a += " rotate(" + t + "deg) ", a += " scaleX(" + r * (n.horizontal ? -1 : 1) + ") ", a += " scaleY(" + i * (n.vertical ? -1 : 1) + ") ";
1957
1960
  }
1958
- function vn(e) {
1961
+ function yn(e) {
1959
1962
  try {
1960
1963
  var t, n = new DataView(e), r = void 0, i = void 0, a = void 0, o = void 0;
1961
1964
  if (n.getUint8(0) === 255 && n.getUint8(1) === 216) for (var s = n.byteLength, c = 2; c + 1 < s;) {
@@ -1987,7 +1990,7 @@ function vn(e) {
1987
1990
  return null;
1988
1991
  }
1989
1992
  }
1990
- var yn = K("vue-preview-result"), bn = {
1993
+ var bn = K("vue-preview-result"), xn = {
1991
1994
  name: "PreviewResult",
1992
1995
  props: {
1993
1996
  image: { type: Object },
@@ -2008,10 +2011,10 @@ var yn = K("vue-preview-result"), bn = {
2008
2011
  computed: {
2009
2012
  classes: function() {
2010
2013
  return {
2011
- root: yn(),
2012
- wrapper: yn("wrapper"),
2013
- imageWrapper: yn("image-wrapper"),
2014
- image: G(yn("image"), this.imageClass)
2014
+ root: bn(),
2015
+ wrapper: bn("wrapper"),
2016
+ imageWrapper: bn("image-wrapper"),
2017
+ image: G(bn("image"), this.imageClass)
2015
2018
  };
2016
2019
  },
2017
2020
  wrapperStyle: function() {
@@ -2024,7 +2027,7 @@ var yn = K("vue-preview-result"), bn = {
2024
2027
  return this.transitions && this.transitions.enabled && (e.transition = `${this.transitions.time}ms ${this.transitions.timingFunction}`), e;
2025
2028
  },
2026
2029
  imageStyle: function() {
2027
- var e = this.image.transforms, t = jt({
2030
+ var e = this.image.transforms, t = Mt({
2028
2031
  width: this.image.width,
2029
2032
  height: this.image.height
2030
2033
  }, e.rotate), n = {
@@ -2040,11 +2043,11 @@ var yn = K("vue-preview-result"), bn = {
2040
2043
  top: (1 - e.scaleY) * this.image.height / 2
2041
2044
  };
2042
2045
  return n.transform = `translate(
2043
- ${-this.stencilCoordinates.left - e.translateX - r.left - i.left}px,${-this.stencilCoordinates.top - e.translateY - r.top - i.top}px) ` + _n(e), this.transitions && this.transitions.enabled && (n.transition = `${this.transitions.time}ms ${this.transitions.timingFunction}`), n;
2046
+ ${-this.stencilCoordinates.left - e.translateX - r.left - i.left}px,${-this.stencilCoordinates.top - e.translateY - r.top - i.top}px) ` + vn(e), this.transitions && this.transitions.enabled && (n.transition = `${this.transitions.time}ms ${this.transitions.timingFunction}`), n;
2044
2047
  }
2045
2048
  }
2046
2049
  };
2047
- function xn(e, t) {
2050
+ function Sn(e, t) {
2048
2051
  var n = t.getBoundingClientRect(), r = n.left, i = n.top, a = {
2049
2052
  left: 0,
2050
2053
  top: 0
@@ -2052,7 +2055,7 @@ function xn(e, t) {
2052
2055
  return e.forEach((function(t) {
2053
2056
  a.left += (t.clientX - r) / e.length, a.top += (t.clientY - i) / e.length;
2054
2057
  })), e.forEach((function(e) {
2055
- o += at({
2058
+ o += ot({
2056
2059
  x: a.left,
2057
2060
  y: a.top
2058
2061
  }, {
@@ -2065,7 +2068,7 @@ function xn(e, t) {
2065
2068
  count: e.length
2066
2069
  };
2067
2070
  }
2068
- bn.render = function(e, t, n, r, i, a) {
2071
+ xn.render = function(e, t, n, r, i, a) {
2069
2072
  return z(), h("div", { class: a.classes.root }, [p("div", {
2070
2073
  ref: "wrapper",
2071
2074
  class: a.classes.wrapper,
@@ -2077,7 +2080,7 @@ bn.render = function(e, t, n, r, i, a) {
2077
2080
  style: a.imageStyle
2078
2081
  }, null, 14, ["src"])], 6)], 2);
2079
2082
  };
2080
- var Sn = {
2083
+ var Cn = {
2081
2084
  props: {
2082
2085
  touchMove: {
2083
2086
  type: Boolean,
@@ -2107,18 +2110,18 @@ var Sn = {
2107
2110
  window.removeEventListener("mouseup", this.onMouseUp), window.removeEventListener("mousemove", this.onMouseMove), window.removeEventListener("touchmove", this.onTouchMove), window.removeEventListener("touchend", this.onTouchEnd);
2108
2111
  },
2109
2112
  created: function() {
2110
- this.transforming = !1, this.debouncedProcessEnd = Ye(this.processEnd), this.touches = [];
2113
+ this.transforming = !1, this.debouncedProcessEnd = Xe(this.processEnd), this.touches = [];
2111
2114
  },
2112
2115
  methods: {
2113
2116
  processMove: function(e, t) {
2114
2117
  if (this.touches.length) {
2115
- if (this.touches.length === 1 && t.length === 1) this.$emit("move", new ot({
2118
+ if (this.touches.length === 1 && t.length === 1) this.$emit("move", new st({
2116
2119
  left: this.touches[0].clientX - t[0].clientX,
2117
2120
  top: this.touches[0].clientY - t[0].clientY
2118
2121
  }));
2119
2122
  else if (this.touches.length > 1 && this.touchResize) {
2120
- var n = xn(t, this.$refs.container), r = this.oldGeometricProperties;
2121
- r.count === n.count && r.count > 1 && this.$emit("resize", new ot({
2123
+ var n = Sn(t, this.$refs.container), r = this.oldGeometricProperties;
2124
+ r.count === n.count && r.count > 1 && this.$emit("resize", new st({
2122
2125
  left: r.centerMass.left - n.centerMass.left,
2123
2126
  top: r.centerMass.top - n.centerMass.top
2124
2127
  }, {
@@ -2141,9 +2144,9 @@ var Sn = {
2141
2144
  onTouchStart: function(e) {
2142
2145
  if (e.cancelable && (this.touchMove || this.touchResize && e.touches.length > 1) && this.processEvent(e)) {
2143
2146
  var t = this.$refs.container, n = t.getBoundingClientRect(), r = n.left, i = n.top, a = n.bottom, o = n.right;
2144
- this.touches = Ue(e.touches).filter((function(e) {
2147
+ this.touches = We(e.touches).filter((function(e) {
2145
2148
  return e.clientX > r && e.clientX < o && e.clientY > i && e.clientY < a;
2146
- })), this.oldGeometricProperties = xn(this.touches, t);
2149
+ })), this.oldGeometricProperties = Sn(this.touches, t);
2147
2150
  }
2148
2151
  },
2149
2152
  onTouchEnd: function(e) {
@@ -2152,7 +2155,7 @@ var Sn = {
2152
2155
  onTouchMove: function(e) {
2153
2156
  var t = this;
2154
2157
  if (this.touches.length) {
2155
- var n = Ue(e.touches).filter((function(e) {
2158
+ var n = We(e.touches).filter((function(e) {
2156
2159
  return !e.identifier || t.touches.find((function(t) {
2157
2160
  return t.identifier === e.identifier;
2158
2161
  }));
@@ -2181,11 +2184,11 @@ var Sn = {
2181
2184
  },
2182
2185
  onWheel: function(e) {
2183
2186
  if (this.wheelResize && this.processEvent(e)) {
2184
- var t = this.$refs.container.getBoundingClientRect(), n = t.left, r = t.top, i = 1 + this.wheelResize.ratio * (o = e.deltaY || e.detail || e.wheelDelta, (s = +o) == 0 || it(s) ? s : s > 0 ? 1 : -1), a = {
2187
+ var t = this.$refs.container.getBoundingClientRect(), n = t.left, r = t.top, i = 1 + this.wheelResize.ratio * (o = e.deltaY || e.detail || e.wheelDelta, (s = +o) == 0 || at(s) ? s : s > 0 ? 1 : -1), a = {
2185
2188
  left: e.clientX - n,
2186
2189
  top: e.clientY - r
2187
2190
  };
2188
- this.$emit("resize", new ot({}, {
2191
+ this.$emit("resize", new st({}, {
2189
2192
  factor: i,
2190
2193
  center: a
2191
2194
  })), this.touches.length || this.debouncedProcessEnd();
@@ -2199,7 +2202,7 @@ var Sn = {
2199
2202
  "transform-end"
2200
2203
  ]
2201
2204
  };
2202
- Sn.render = function(e, t, n, r, i, a) {
2205
+ Cn.render = function(e, t, n, r, i, a) {
2203
2206
  return z(), h("div", {
2204
2207
  ref: "container",
2205
2208
  onTouchstart: t[1] ||= function() {
@@ -2213,8 +2216,8 @@ Sn.render = function(e, t, n, r, i, a) {
2213
2216
  }
2214
2217
  }, [c(e.$slots, "default")], 544);
2215
2218
  };
2216
- var Cn = {
2217
- components: { TransformableImage: Sn },
2219
+ var wn = {
2220
+ components: { TransformableImage: Cn },
2218
2221
  props: {
2219
2222
  touchMove: {
2220
2223
  type: Boolean,
@@ -2235,7 +2238,7 @@ var Cn = {
2235
2238
  },
2236
2239
  emits: ["resize", "move"]
2237
2240
  };
2238
- Cn.render = function(e, t, n, r, i, a) {
2241
+ wn.render = function(e, t, n, r, i, a) {
2239
2242
  var o = x("transformable-image");
2240
2243
  return z(), h(o, {
2241
2244
  "touch-move": n.touchMove,
@@ -2260,7 +2263,7 @@ Cn.render = function(e, t, n, r, i, a) {
2260
2263
  "wheel-resize"
2261
2264
  ]);
2262
2265
  };
2263
- var wn = K("vue-preview"), Tn = {
2266
+ var Tn = K("vue-preview"), En = {
2264
2267
  props: {
2265
2268
  coordinates: { type: Object },
2266
2269
  transitions: { type: Object },
@@ -2290,10 +2293,10 @@ var wn = K("vue-preview"), Tn = {
2290
2293
  computed: {
2291
2294
  classes: function() {
2292
2295
  return {
2293
- root: wn({ fill: this.fill }),
2294
- wrapper: wn("wrapper"),
2295
- imageWrapper: wn("image-wrapper"),
2296
- image: G(wn("image"), this.imageClass)
2296
+ root: Tn({ fill: this.fill }),
2297
+ wrapper: Tn("wrapper"),
2298
+ imageWrapper: Tn("image-wrapper"),
2299
+ image: G(Tn("image"), this.imageClass)
2297
2300
  };
2298
2301
  },
2299
2302
  style: function() {
@@ -2321,7 +2324,7 @@ var wn = K("vue-preview"), Tn = {
2321
2324
  }, this.image.transforms), {}, {
2322
2325
  scaleX: 1 / e,
2323
2326
  scaleY: 1 / e
2324
- }), n = this.imageSize.width, r = this.imageSize.height, i = jt({
2327
+ }), n = this.imageSize.width, r = this.imageSize.height, i = Mt({
2325
2328
  width: n,
2326
2329
  height: r
2327
2330
  }, t.rotate), a = {
@@ -2340,7 +2343,7 @@ var wn = K("vue-preview"), Tn = {
2340
2343
  }
2341
2344
  };
2342
2345
  return a.transform = `translate(
2343
- ${-this.coordinates.left / e - o.rotate.left - o.scale.left}px,${-this.coordinates.top / e - o.rotate.top - o.scale.top}px) ` + _n(t), this.transitions && this.transitions.enabled && (a.transition = `${this.transitions.time}ms ${this.transitions.timingFunction}`), a;
2346
+ ${-this.coordinates.left / e - o.rotate.left - o.scale.left}px,${-this.coordinates.top / e - o.rotate.top - o.scale.top}px) ` + vn(t), this.transitions && this.transitions.enabled && (a.transition = `${this.transitions.time}ms ${this.transitions.timingFunction}`), a;
2344
2347
  }
2345
2348
  return {};
2346
2349
  },
@@ -2384,7 +2387,7 @@ var wn = K("vue-preview"), Tn = {
2384
2387
  }
2385
2388
  }
2386
2389
  };
2387
- Tn.render = function(e, t, n, r, i, a) {
2390
+ En.render = function(e, t, n, r, i, a) {
2388
2391
  return z(), h("div", {
2389
2392
  ref: "root",
2390
2393
  class: a.classes.root,
@@ -2400,20 +2403,20 @@ Tn.render = function(e, t, n, r, i, a) {
2400
2403
  style: a.imageStyle
2401
2404
  }, null, 14, ["src"]), [[ye, n.image && n.image.src]])], 6)], 6);
2402
2405
  };
2403
- var En = {
2404
- components: { Preview: Tn },
2406
+ var Dn = {
2407
+ components: { Preview: En },
2405
2408
  inheritAttrs: !1
2406
2409
  };
2407
- En.render = function(e, t, n, r, i, a) {
2410
+ Dn.render = function(e, t, n, r, i, a) {
2408
2411
  var o = x("preview");
2409
2412
  return z(), h(o, f(e.$attrs, { fill: !0 }), null, 16);
2410
2413
  };
2411
- var Dn = K("vue-rectangle-stencil"), On = {
2414
+ var On = K("vue-rectangle-stencil"), kn = {
2412
2415
  name: "RectangleStencil",
2413
2416
  components: {
2414
- StencilPreview: En,
2415
- BoundingBox: fn,
2416
- DraggableArea: mn
2417
+ StencilPreview: Dn,
2418
+ BoundingBox: pn,
2419
+ DraggableArea: hn
2417
2420
  },
2418
2421
  props: {
2419
2422
  image: { type: Object },
@@ -2423,14 +2426,14 @@ var Dn = K("vue-rectangle-stencil"), On = {
2423
2426
  handlersComponent: {
2424
2427
  type: [Object, String],
2425
2428
  default: function() {
2426
- return an;
2429
+ return on;
2427
2430
  }
2428
2431
  },
2429
2432
  lines: { type: Object },
2430
2433
  linesComponent: {
2431
2434
  type: [Object, String],
2432
2435
  default: function() {
2433
- return cn;
2436
+ return ln;
2434
2437
  }
2435
2438
  },
2436
2439
  aspectRatio: { type: [Number, String] },
@@ -2483,13 +2486,13 @@ var Dn = K("vue-rectangle-stencil"), On = {
2483
2486
  computed: {
2484
2487
  classes: function() {
2485
2488
  return {
2486
- stencil: G(Dn({
2489
+ stencil: G(On({
2487
2490
  movable: this.movable,
2488
2491
  moving: this.moving,
2489
2492
  resizing: this.resizing
2490
2493
  }), this.moving && this.movingClass, this.resizing && this.resizingClass),
2491
- preview: G(Dn("preview"), this.previewClass),
2492
- boundingBox: G(Dn("bounding-box"), this.boundingBoxClass)
2494
+ preview: G(On("preview"), this.previewClass),
2495
+ boundingBox: G(On("bounding-box"), this.boundingBoxClass)
2493
2496
  };
2494
2497
  },
2495
2498
  style: function() {
@@ -2528,7 +2531,7 @@ var Dn = K("vue-rectangle-stencil"), On = {
2528
2531
  "move-end"
2529
2532
  ]
2530
2533
  };
2531
- On.render = function(e, t, n, r, i, a) {
2534
+ kn.render = function(e, t, n, r, i, a) {
2532
2535
  var o = x("stencil-preview"), s = x("draggable-area"), c = x("bounding-box");
2533
2536
  return z(), h("div", {
2534
2537
  class: a.classes.stencil,
@@ -2599,11 +2602,11 @@ On.render = function(e, t, n, r, i, a) {
2599
2602
  "onResizeEnd"
2600
2603
  ])], 6);
2601
2604
  };
2602
- var kn = K("vue-circle-stencil"), An = {
2605
+ var An = K("vue-circle-stencil"), jn = {
2603
2606
  components: {
2604
- StencilPreview: En,
2605
- BoundingBox: fn,
2606
- DraggableArea: mn
2607
+ StencilPreview: Dn,
2608
+ BoundingBox: pn,
2609
+ DraggableArea: hn
2607
2610
  },
2608
2611
  props: {
2609
2612
  image: { type: Object },
@@ -2623,7 +2626,7 @@ var kn = K("vue-circle-stencil"), An = {
2623
2626
  handlersComponent: {
2624
2627
  type: [Object, String],
2625
2628
  default: function() {
2626
- return an;
2629
+ return on;
2627
2630
  }
2628
2631
  },
2629
2632
  handlersClasses: {
@@ -2642,7 +2645,7 @@ var kn = K("vue-circle-stencil"), An = {
2642
2645
  linesComponent: {
2643
2646
  type: [Object, String],
2644
2647
  default: function() {
2645
- return cn;
2648
+ return ln;
2646
2649
  }
2647
2650
  },
2648
2651
  linesClasses: {
@@ -2680,13 +2683,13 @@ var kn = K("vue-circle-stencil"), An = {
2680
2683
  computed: {
2681
2684
  classes: function() {
2682
2685
  return {
2683
- stencil: G(kn({
2686
+ stencil: G(An({
2684
2687
  movable: this.movable,
2685
2688
  moving: this.moving,
2686
2689
  resizing: this.resizing
2687
2690
  }), this.moving && this.movingClass, this.resizing && this.resizingClass),
2688
- preview: G(kn("preview"), this.previewClass),
2689
- boundingBox: G(kn("bounding-box"), this.boundingBoxClass)
2691
+ preview: G(An("preview"), this.previewClass),
2692
+ boundingBox: G(An("bounding-box"), this.boundingBoxClass)
2690
2693
  };
2691
2694
  },
2692
2695
  style: function() {
@@ -2725,7 +2728,7 @@ var kn = K("vue-circle-stencil"), An = {
2725
2728
  "move-end"
2726
2729
  ]
2727
2730
  };
2728
- An.render = function(e, t, n, r, i, a) {
2731
+ jn.render = function(e, t, n, r, i, a) {
2729
2732
  var o = x("stencil-preview"), s = x("draggable-area"), c = x("bounding-box");
2730
2733
  return z(), h("div", {
2731
2734
  class: a.classes.stencil,
@@ -2796,9 +2799,9 @@ An.render = function(e, t, n, r, i, a) {
2796
2799
  "onResizeEnd"
2797
2800
  ])], 6);
2798
2801
  };
2799
- var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
2802
+ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
2800
2803
  name: "Cropper",
2801
- components: { BackgroundWrapper: Cn },
2804
+ components: { BackgroundWrapper: wn },
2802
2805
  props: {
2803
2806
  src: {
2804
2807
  type: String,
@@ -2807,13 +2810,13 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
2807
2810
  stencilComponent: {
2808
2811
  type: [Object, String],
2809
2812
  default: function() {
2810
- return On;
2813
+ return kn;
2811
2814
  }
2812
2815
  },
2813
2816
  backgroundWrapperComponent: {
2814
2817
  type: [Object, String],
2815
2818
  default: function() {
2816
- return Cn;
2819
+ return wn;
2817
2820
  }
2818
2821
  },
2819
2822
  stencilProps: {
@@ -2862,7 +2865,7 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
2862
2865
  type: String,
2863
2866
  default: "fit-area",
2864
2867
  validator: function(e) {
2865
- return yt.indexOf(e) !== -1;
2868
+ return bt.indexOf(e) !== -1;
2866
2869
  }
2867
2870
  },
2868
2871
  roundResult: {
@@ -2905,31 +2908,31 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
2905
2908
  bottom: !0,
2906
2909
  top: !0
2907
2910
  };
2908
- a.widthFrozen && (c.left = 0, c.right = 0), a.heightFrozen && (c.top = 0, c.bottom = 0), ht.forEach((function(e) {
2911
+ a.widthFrozen && (c.left = 0, c.right = 0), a.heightFrozen && (c.top = 0, c.bottom = 0), gt.forEach((function(e) {
2909
2912
  l[e] || (c[e] = 0);
2910
2913
  }));
2911
- var u = Tt(o, c = en({
2914
+ var u = Et(o, c = tn({
2912
2915
  coordinates: o,
2913
2916
  directions: c,
2914
2917
  sizeRestrictions: a,
2915
2918
  positionRestrictions: i
2916
- })).width, d = Tt(o, c).height, f = s.preserveRatio ? Q(o) : kt(u / d, r);
2919
+ })).width, d = Et(o, c).height, f = s.preserveRatio ? Q(o) : At(u / d, r);
2917
2920
  if (f) {
2918
2921
  var p = s.respectDirection;
2919
2922
  if (p ||= o.width >= o.height || f === 1 ? "width" : "height", p === "width") {
2920
2923
  var m = u / f - o.height;
2921
2924
  if (l.top && l.bottom) {
2922
2925
  var h = c.top, g = c.bottom;
2923
- c.bottom = tn(m, g, h), c.top = tn(m, h, g);
2926
+ c.bottom = nn(m, g, h), c.top = nn(m, h, g);
2924
2927
  } else l.bottom ? c.bottom = m : l.top ? c.top = m : l.right ? c.right = 0 : l.left && (c.left = 0);
2925
2928
  } else if (p === "height") {
2926
2929
  var _ = o.width - d * f;
2927
2930
  if (l.left && l.right) {
2928
2931
  var v = c.left, y = c.right;
2929
- c.left = -tn(_, v, y), c.right = -tn(_, y, v);
2932
+ c.left = -nn(_, v, y), c.right = -nn(_, y, v);
2930
2933
  } else l.left ? c.left = -_ : l.right ? c.right = -_ : l.top ? c.top = 0 : l.bottom && (c.bottom = 0);
2931
2934
  }
2932
- c = en({
2935
+ c = tn({
2933
2936
  directions: c,
2934
2937
  coordinates: o,
2935
2938
  sizeRestrictions: a,
@@ -2938,10 +2941,10 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
2938
2941
  compensate: s.compensate
2939
2942
  });
2940
2943
  }
2941
- return u = Tt(o, c).width, d = Tt(o, c).height, (f = s.preserveRatio ? Q(o) : kt(u / d, r)) && Math.abs(f - u / d) > .001 && ht.forEach((function(e) {
2944
+ return u = Et(o, c).width, d = Et(o, c).height, (f = s.preserveRatio ? Q(o) : At(u / d, r)) && Math.abs(f - u / d) > .001 && gt.forEach((function(e) {
2942
2945
  l[e] || (c[e] = 0);
2943
- })), Vt({
2944
- event: new ct({
2946
+ })), Ht({
2947
+ event: new lt({
2945
2948
  left: -c.left,
2946
2949
  top: -c.top
2947
2950
  }),
@@ -2957,7 +2960,7 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
2957
2960
  },
2958
2961
  moveAlgorithm: {
2959
2962
  type: Function,
2960
- default: Vt
2963
+ default: Ht
2961
2964
  },
2962
2965
  initStretcher: {
2963
2966
  type: Function,
@@ -2969,7 +2972,7 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
2969
2972
  fitCoordinates: {
2970
2973
  type: Function,
2971
2974
  default: function(e) {
2972
- var t = e.visibleArea, n = e.coordinates, r = e.aspectRatio, i = e.sizeRestrictions, a = e.positionRestrictions, o = q(q({}, n), Bt({
2975
+ var t = e.visibleArea, n = e.coordinates, r = e.aspectRatio, i = e.sizeRestrictions, a = e.positionRestrictions, o = q(q({}, n), Vt({
2973
2976
  width: n.width,
2974
2977
  height: n.height,
2975
2978
  aspectRatio: r,
@@ -2980,7 +2983,7 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
2980
2983
  minWidth: Math.min(t.width, i.minWidth)
2981
2984
  }
2982
2985
  }));
2983
- return o = $(o = X(o, Ct(Y(n), Y(o))), Lt(St(t), a));
2986
+ return o = $(o = X(o, wt(Y(n), Y(o))), Rt(Ct(t), a));
2984
2987
  }
2985
2988
  },
2986
2989
  fitVisibleArea: {
@@ -2988,7 +2991,7 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
2988
2991
  default: function(e) {
2989
2992
  var t = e.visibleArea, n = e.boundaries, r = e.getAreaRestrictions, i = e.coordinates, a = q({}, t);
2990
2993
  a.height = a.width / Q(n), a.top += (t.height - a.height) / 2, (i.height - a.height > 0 || i.width - a.width > 0) && (a = Z(a, Math.max(i.height / a.height, i.width / a.width)));
2991
- var o = Et(Ot(i, St(a = Z(a, Nt(a, r({
2994
+ var o = Dt(kt(i, Ct(a = Z(a, Pt(a, r({
2992
2995
  visibleArea: a,
2993
2996
  type: "resize"
2994
2997
  }))))));
@@ -3069,7 +3072,7 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
3069
3072
  height: 0
3070
3073
  },
3071
3074
  visibleArea: null,
3072
- coordinates: U({}, bt)
3075
+ coordinates: U({}, xt)
3073
3076
  };
3074
3077
  },
3075
3078
  computed: {
@@ -3107,7 +3110,7 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
3107
3110
  return !!(this.visibleArea && this.imageLoaded);
3108
3111
  },
3109
3112
  settings: function() {
3110
- var e = tt(this.resizeImage, {
3113
+ var e = nt(this.resizeImage, {
3111
3114
  touch: !0,
3112
3115
  wheel: { ratio: .1 },
3113
3116
  adjustStencil: !0
@@ -3117,7 +3120,7 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
3117
3120
  adjustStencil: !1
3118
3121
  });
3119
3122
  return {
3120
- moveImage: tt(this.moveImage, {
3123
+ moveImage: nt(this.moveImage, {
3121
3124
  touch: !0,
3122
3125
  mouse: !0
3123
3126
  }, {
@@ -3148,10 +3151,10 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
3148
3151
  if (this.boundaries.width && this.boundaries.height && this.imageSize.width && this.imageSize.height) {
3149
3152
  var e = this.sizeRestrictionsAlgorithm({
3150
3153
  imageSize: this.imageSize,
3151
- minWidth: J(this.minWidth) ? 0 : nt(this.minWidth),
3152
- minHeight: J(this.minHeight) ? 0 : nt(this.minHeight),
3153
- maxWidth: J(this.maxWidth) ? Infinity : nt(this.maxWidth),
3154
- maxHeight: J(this.maxHeight) ? Infinity : nt(this.maxHeight)
3154
+ minWidth: J(this.minWidth) ? 0 : rt(this.minWidth),
3155
+ minHeight: J(this.minHeight) ? 0 : rt(this.minHeight),
3156
+ maxWidth: J(this.maxWidth) ? Infinity : rt(this.maxWidth),
3157
+ maxHeight: J(this.maxHeight) ? Infinity : rt(this.maxHeight)
3155
3158
  });
3156
3159
  if (e = function(e) {
3157
3160
  var t = e.areaRestrictions, n = e.sizeRestrictions, r = e.boundaries, i = e.positionRestrictions, a = q(q({}, n), {
@@ -3161,7 +3164,7 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
3161
3164
  maxHeight: n.maxHeight === void 0 ? Infinity : n.maxHeight
3162
3165
  });
3163
3166
  i.left !== void 0 && i.right !== void 0 && (a.maxWidth = Math.min(a.maxWidth, i.right - i.left)), i.bottom !== void 0 && i.top !== void 0 && (a.maxHeight = Math.min(a.maxHeight, i.bottom - i.top));
3164
- var o = Pt(t), s = At(r, o);
3167
+ var o = Ft(t), s = jt(r, o);
3165
3168
  return o.width < Infinity && (!a.maxWidth || a.maxWidth > s.width) && (a.maxWidth = Math.min(a.maxWidth, s.width)), o.height < Infinity && (!a.maxHeight || a.maxHeight > s.height) && (a.maxHeight = Math.min(a.maxHeight, s.height)), a.minWidth > a.maxWidth && (a.minWidth = a.maxWidth, a.widthFrozen = !0), a.minHeight > a.maxHeight && (a.minHeight = a.maxHeight, a.heightFrozen = !0), a;
3166
3169
  }({
3167
3170
  sizeRestrictions: e,
@@ -3176,7 +3179,7 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
3176
3179
  visibleArea: this.visibleArea,
3177
3180
  stencilSize: this.getStencilSize()
3178
3181
  }), this.visibleArea && this.stencilSize) {
3179
- var t = this.getStencilSize(), n = Pt(this.getAreaRestrictions({
3182
+ var t = this.getStencilSize(), n = Ft(this.getAreaRestrictions({
3180
3183
  visibleArea: this.visibleArea,
3181
3184
  type: "resize"
3182
3185
  }));
@@ -3199,15 +3202,15 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
3199
3202
  },
3200
3203
  classes: function() {
3201
3204
  return {
3202
- cropper: Mn(),
3203
- image: G(Mn("image"), this.imageClass),
3204
- stencil: Mn("stencil"),
3205
- boundaries: G(Mn("boundaries"), this.boundariesClass),
3206
- stretcher: G(Mn("stretcher")),
3207
- background: G(Mn("background"), this.backgroundClass),
3208
- foreground: G(Mn("foreground"), this.foregroundClass),
3209
- imageWrapper: G(Mn("image-wrapper")),
3210
- cropperWrapper: G(Mn("cropper-wrapper"))
3205
+ cropper: Nn(),
3206
+ image: G(Nn("image"), this.imageClass),
3207
+ stencil: Nn("stencil"),
3208
+ boundaries: G(Nn("boundaries"), this.boundariesClass),
3209
+ stretcher: G(Nn("stretcher")),
3210
+ background: G(Nn("background"), this.backgroundClass),
3211
+ foreground: G(Nn("foreground"), this.foregroundClass),
3212
+ imageWrapper: G(Nn("image-wrapper")),
3213
+ cropperWrapper: G(Nn("cropper-wrapper"))
3211
3214
  };
3212
3215
  },
3213
3216
  stencilCoordinates: function() {
@@ -3252,7 +3255,7 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
3252
3255
  height: `${e.height}px`,
3253
3256
  left: "0px",
3254
3257
  top: "0px",
3255
- transform: `translate(${-t.left - n.left - this.imageTransforms.translateX}px, ${-t.top - n.top - this.imageTransforms.translateY}px)` + _n(r)
3258
+ transform: `translate(${-t.left - n.left - this.imageTransforms.translateX}px, ${-t.top - n.top - this.imageTransforms.translateY}px)` + vn(r)
3256
3259
  };
3257
3260
  return this.transitionsOptions.enabled && (i.transition = `${this.transitionsOptions.time}ms ${this.transitionsOptions.timingFunction}`), i;
3258
3261
  }
@@ -3293,7 +3296,7 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
3293
3296
  }
3294
3297
  },
3295
3298
  created: function() {
3296
- this.debouncedUpdate = Ye(this.update, this.debounce), this.debouncedDisableTransitions = Ye(this.disableTransitions, this.transitionsOptions.time), this.awaiting = !1;
3299
+ this.debouncedUpdate = Xe(this.update, this.debounce), this.debouncedDisableTransitions = Xe(this.disableTransitions, this.transitionsOptions.time), this.awaiting = !1;
3297
3300
  },
3298
3301
  mounted: function() {
3299
3302
  this.$refs.image.addEventListener("load", this.onSuccessLoadImage), this.$refs.image.addEventListener("error", this.onFailLoadImage), this.onChangeImage(), window.addEventListener("resize", this.refresh), window.addEventListener("orientationchange", this.refresh);
@@ -3329,7 +3332,7 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
3329
3332
  },
3330
3333
  zoom: function(e, t) {
3331
3334
  var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
3332
- this.onManipulateImage(new ot({}, {
3335
+ this.onManipulateImage(new st({}, {
3333
3336
  factor: 1 / e,
3334
3337
  center: t
3335
3338
  }), {
@@ -3339,7 +3342,7 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
3339
3342
  },
3340
3343
  move: function(e, t) {
3341
3344
  var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
3342
- this.onManipulateImage(new ot({
3345
+ this.onManipulateImage(new st({
3343
3346
  left: e || 0,
3344
3347
  top: t || 0
3345
3348
  }), {
@@ -3383,13 +3386,13 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
3383
3386
  };
3384
3387
  return i.width > n.maxWidth ? i.width = Math.floor(t.width) : i.width < n.minWidth && (i.width = Math.ceil(t.width)), i.height > n.maxHeight ? i.height = Math.floor(t.height) : i.height < n.minHeight && (i.height = Math.ceil(t.height)), $(i, r);
3385
3388
  }(U(U({}, this.getPublicProperties()), {}, {
3386
- positionRestrictions: Xt(this.positionRestrictions, this.visibleArea),
3389
+ positionRestrictions: Zt(this.positionRestrictions, this.visibleArea),
3387
3390
  coordinates: e
3388
3391
  })) : e;
3389
3392
  },
3390
3393
  processAutoZoom: function(e, t, n, r) {
3391
3394
  var i = this.autoZoomAlgorithm;
3392
- i ||= this.stencilSize ? Ut : this.autoZoom ? Wt : Gt;
3395
+ i ||= this.stencilSize ? Wt : this.autoZoom ? Gt : Kt;
3393
3396
  var a = i({
3394
3397
  event: {
3395
3398
  type: e,
@@ -3404,10 +3407,10 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
3404
3407
  sizeRestrictions: this.sizeRestrictions,
3405
3408
  stencilSize: this.getStencilSize()
3406
3409
  });
3407
- return U(U({}, a), {}, { changed: !xt(a.visibleArea, t) || !xt(a.coordinates, n) });
3410
+ return U(U({}, a), {}, { changed: !St(a.visibleArea, t) || !St(a.coordinates, n) });
3408
3411
  },
3409
3412
  runAutoZoom: function(e) {
3410
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = t.transitions, r = n !== void 0 && n, i = He(t, jn), a = this.processAutoZoom(e, this.visibleArea, this.coordinates, i), o = a.visibleArea, s = a.coordinates, c = a.changed;
3413
+ var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = t.transitions, r = n !== void 0 && n, i = Ue(t, Mn), a = this.processAutoZoom(e, this.visibleArea, this.coordinates, i), o = a.visibleArea, s = a.coordinates, c = a.changed;
3411
3414
  r && c && this.enableTransitions(), this.visibleArea = o, this.coordinates = s, r && c && this.debouncedDisableTransitions();
3412
3415
  },
3413
3416
  normalizeEvent: function(e) {
@@ -3428,13 +3431,13 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
3428
3431
  });
3429
3432
  if (t.type === "resize") {
3430
3433
  var i = q(q({}, t), { directions: q({}, t.directions) });
3431
- return ht.forEach((function(e) {
3434
+ return gt.forEach((function(e) {
3432
3435
  i.directions[e] *= r;
3433
3436
  })), i;
3434
3437
  }
3435
3438
  if (t.type === "move") {
3436
3439
  var a = q(q({}, t), { directions: q({}, t.directions) });
3437
- return vt.forEach((function(e) {
3440
+ return yt.forEach((function(e) {
3438
3441
  a.directions[e] *= r;
3439
3442
  })), a;
3440
3443
  }
@@ -3447,9 +3450,9 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
3447
3450
  var r = n.rotate, i = n.flip, a = {
3448
3451
  width: t.naturalWidth,
3449
3452
  height: t.naturalHeight
3450
- }, o = jt(a, r), s = e.getContext("2d");
3453
+ }, o = Mt(a, r), s = e.getContext("2d");
3451
3454
  e.height = o.height, e.width = o.width, s.save();
3452
- var c = Mt(Y(q({
3455
+ var c = Nt(Y(q({
3453
3456
  left: 0,
3454
3457
  top: 0
3455
3458
  }, a)), r);
@@ -3468,7 +3471,7 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
3468
3471
  return t = e, !Number.isNaN(parseFloat(t)) && isFinite(t);
3469
3472
  var t;
3470
3473
  }));
3471
- }, a = Bt({
3474
+ }, a = Vt({
3472
3475
  sizeRestrictions: {
3473
3476
  minWidth: i([r.width, r.minWidth]) || 0,
3474
3477
  minHeight: i([r.height, r.minHeight]) || 0,
@@ -3502,8 +3505,8 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
3502
3505
  this.$emit("change", this.getResult());
3503
3506
  },
3504
3507
  applyTransform: function(e) {
3505
- var t = arguments.length > 1 && arguments[1] !== void 0 && arguments[1], n = this.visibleArea && t ? Ft(this.sizeRestrictions, this.visibleArea) : this.sizeRestrictions, r = this.visibleArea && t ? Xt(this.positionRestrictions, this.visibleArea) : this.positionRestrictions;
3506
- return Ht({
3508
+ var t = arguments.length > 1 && arguments[1] !== void 0 && arguments[1], n = this.visibleArea && t ? It(this.sizeRestrictions, this.visibleArea) : this.sizeRestrictions, r = this.visibleArea && t ? Zt(this.positionRestrictions, this.visibleArea) : this.positionRestrictions;
3509
+ return Ut({
3507
3510
  transform: e,
3508
3511
  coordinates: this.coordinates,
3509
3512
  imageSize: this.imageSize,
@@ -3518,23 +3521,23 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
3518
3521
  if (this.$refs.image) {
3519
3522
  this.$refs.cropper, this.$refs.image;
3520
3523
  var t = this.defaultSize;
3521
- t ||= this.stencilSize ? Jt : qt, this.sizeRestrictions;
3522
- var n = $e(t) ? t({
3524
+ t ||= this.stencilSize ? Yt : Jt, this.sizeRestrictions;
3525
+ var n = et(t) ? t({
3523
3526
  boundaries: this.boundaries,
3524
3527
  imageSize: this.imageSize,
3525
3528
  aspectRatio: this.getAspectRatio(),
3526
3529
  sizeRestrictions: this.sizeRestrictions,
3527
3530
  stencilSize: this.getStencilSize(),
3528
3531
  visibleArea: this.visibleArea
3529
- }) : t, r = this.defaultPosition || Kt, i = [n, function(t) {
3532
+ }) : t, r = this.defaultPosition || qt, i = [n, function(t) {
3530
3533
  var n = t.coordinates;
3531
- return U({}, $e(r) ? r({
3534
+ return U({}, et(r) ? r({
3532
3535
  coordinates: n,
3533
3536
  imageSize: e.imageSize,
3534
3537
  visibleArea: e.visibleArea
3535
3538
  }) : e.defaultPosition);
3536
3539
  }];
3537
- this.delayedTransforms && i.push.apply(i, Ue(Array.isArray(this.delayedTransforms) ? this.delayedTransforms : [this.delayedTransforms])), this.coordinates = this.applyTransform(i, !0), this.delayedTransforms = null;
3540
+ this.delayedTransforms && i.push.apply(i, We(Array.isArray(this.delayedTransforms) ? this.delayedTransforms : [this.delayedTransforms])), this.coordinates = this.applyTransform(i, !0), this.delayedTransforms = null;
3538
3541
  }
3539
3542
  },
3540
3543
  clearImage: function() {
@@ -3564,7 +3567,7 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
3564
3567
  cropper: n,
3565
3568
  imageSize: e.imageSize
3566
3569
  };
3567
- if ($e(e.defaultBoundaries) ? e.boundaries = e.defaultBoundaries(t) : e.defaultBoundaries === "fit" ? e.boundaries = function(e) {
3570
+ if (et(e.defaultBoundaries) ? e.boundaries = e.defaultBoundaries(t) : e.defaultBoundaries === "fit" ? e.boundaries = function(e) {
3568
3571
  var t = e.cropper, n = e.imageSize, r = t.clientHeight, i = t.clientWidth, a = r, o = n.width * r / n.height;
3569
3572
  return o > i && (o = i, a = n.height * i / n.width), {
3570
3573
  width: o,
@@ -3583,8 +3586,8 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
3583
3586
  var e = this;
3584
3587
  return this.appliedImageTransforms = U(U({}, this.defaultImageTransforms), {}, { flip: U({}, this.defaultImageTransforms.flip) }), this.updateBoundaries().then((function() {
3585
3588
  e.priority !== "visible-area" && (e.visibleArea = null, e.resetCoordinates());
3586
- var t, n, r, i, a, o, s = e.defaultVisibleArea || Yt;
3587
- e.visibleArea = $e(s) ? s({
3589
+ var t, n, r, i, a, o, s = e.defaultVisibleArea || Xt;
3590
+ e.visibleArea = et(s) ? s({
3588
3591
  imageSize: e.imageSize,
3589
3592
  boundaries: e.boundaries,
3590
3593
  coordinates: e.priority === "visible-area" ? null : e.coordinates,
@@ -3635,7 +3638,7 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
3635
3638
  var e, t = this;
3636
3639
  if (this.imageLoaded = !1, this.delayedTransforms = null, this.src) {
3637
3640
  if (function(e) {
3638
- if (Qe(e)) return !1;
3641
+ if ($e(e)) return !1;
3639
3642
  var t = window.location, n = /(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(e) || [], r = {
3640
3643
  protocol: n[1] || "",
3641
3644
  host: n[2] || "",
@@ -3650,8 +3653,8 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
3650
3653
  }
3651
3654
  if (this.checkOrientation) {
3652
3655
  var r = (e = this.src, new Promise((function(t) {
3653
- gn(e).then((function(n) {
3654
- var r = vn(n);
3656
+ _n(e).then((function(n) {
3657
+ var r = yn(n);
3655
3658
  t(n ? {
3656
3659
  source: e,
3657
3660
  arrayBuffer: n,
@@ -3688,14 +3691,14 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
3688
3691
  },
3689
3692
  onParseImage: function(e) {
3690
3693
  var t = this, n = e.source, r = e.arrayBuffer, i = e.orientation;
3691
- this.imageAttributes.revoke && this.imageAttributes.src && URL.revokeObjectURL(this.imageAttributes.src), this.imageAttributes.revoke = !1, r && i && i > 1 ? Ze(n) || !Qe(n) ? (this.imageAttributes.src = URL.createObjectURL(new Blob([r])), this.imageAttributes.revoke = !0) : this.imageAttributes.src = function(e) {
3694
+ this.imageAttributes.revoke && this.imageAttributes.src && URL.revokeObjectURL(this.imageAttributes.src), this.imageAttributes.revoke = !1, r && i && i > 1 ? Qe(n) || !$e(n) ? (this.imageAttributes.src = URL.createObjectURL(new Blob([r])), this.imageAttributes.revoke = !0) : this.imageAttributes.src = function(e) {
3692
3695
  for (var t = [], n = new Uint8Array(e); n.length > 0;) {
3693
3696
  var r = n.subarray(0, 8192);
3694
3697
  t.push(String.fromCharCode.apply(null, Array.from ? Array.from(r) : r.slice())), n = n.subarray(8192);
3695
3698
  }
3696
3699
  return "data:image/jpeg;base64," + btoa(t.join(""));
3697
- }(r) : this.imageAttributes.src = n, $e(this.defaultTransforms) ? this.appliedImageTransforms = hn(this.defaultTransforms()) : et(this.defaultTransforms) ? this.appliedImageTransforms = hn(this.defaultTransforms) : this.appliedImageTransforms = function(e) {
3698
- var t = hn({});
3700
+ }(r) : this.imageAttributes.src = n, et(this.defaultTransforms) ? this.appliedImageTransforms = gn(this.defaultTransforms()) : tt(this.defaultTransforms) ? this.appliedImageTransforms = gn(this.defaultTransforms) : this.appliedImageTransforms = function(e) {
3701
+ var t = gn({});
3699
3702
  if (e) switch (e) {
3700
3703
  case 2:
3701
3704
  t.flip.horizontal = !0;
@@ -3735,7 +3738,7 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
3735
3738
  var t = this;
3736
3739
  this.transitionsOptions.enabled || this.awaitRender((function() {
3737
3740
  t.coordinates = t.moveAlgorithm(U(U({}, t.getPublicProperties()), {}, {
3738
- positionRestrictions: Xt(t.positionRestrictions, t.visibleArea),
3741
+ positionRestrictions: Zt(t.positionRestrictions, t.visibleArea),
3739
3742
  coordinates: t.coordinates,
3740
3743
  event: t.normalizeEvent(e)
3741
3744
  })), t.onChange();
@@ -3746,7 +3749,7 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
3746
3749
  this.transitionsOptions.enabled || this.stencilSize && !this.autoZoom || this.awaitRender((function() {
3747
3750
  var n = t.sizeRestrictions, r = Math.min(t.coordinates.width, t.coordinates.height, 20 * t.coefficient);
3748
3751
  t.coordinates = t.resizeAlgorithm(U(U({}, t.getPublicProperties()), {}, {
3749
- positionRestrictions: Xt(t.positionRestrictions, t.visibleArea),
3752
+ positionRestrictions: Zt(t.positionRestrictions, t.visibleArea),
3750
3753
  sizeRestrictions: {
3751
3754
  maxWidth: Math.min(n.maxWidth, t.visibleArea.width),
3752
3755
  maxHeight: Math.min(n.maxHeight, t.visibleArea.height),
@@ -3762,7 +3765,7 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
3762
3765
  if (!this.transitionsOptions.enabled) {
3763
3766
  var n = t.transitions, r = n !== void 0 && n, i = t.normalize, a = i === void 0 || i;
3764
3767
  r && this.enableTransitions();
3765
- var o = Zt(U(U({}, this.getPublicProperties()), {}, {
3768
+ var o = Qt(U(U({}, this.getPublicProperties()), {}, {
3766
3769
  event: a ? this.normalizeEvent(e) : e,
3767
3770
  getAreaRestrictions: this.getAreaRestrictions,
3768
3771
  imageRestriction: this.imageRestriction,
@@ -3792,7 +3795,7 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
3792
3795
  }
3793
3796
  if (J(t) && (t = J(i) ? a : i), J(n) && (n = J(i) ? o : i), !e && (J(t) || J(n))) {
3794
3797
  var c = this.getStencilSize(), l = c ? Q(c) : null;
3795
- J(t) && (t = rt(l) ? l : void 0), J(n) && (n = rt(l) ? l : void 0);
3798
+ J(t) && (t = it(l) ? l : void 0), J(n) && (n = it(l) ? l : void 0);
3796
3799
  }
3797
3800
  return {
3798
3801
  minimum: t,
@@ -3810,10 +3813,10 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
3810
3813
  coefficient: this.coefficient,
3811
3814
  coordinates: this.coordinates,
3812
3815
  aspectRatio: this.getAspectRatio(!0)
3813
- }, t = e.boundaries, n = e.stencilSize, r = e.aspectRatio, kt(Q(i = $e(n) ? n({
3816
+ }, t = e.boundaries, n = e.stencilSize, r = e.aspectRatio, At(Q(i = et(n) ? n({
3814
3817
  boundaries: t,
3815
3818
  aspectRatio: r
3816
- }) : n), r) && (i = Bt({
3819
+ }) : n), r) && (i = Vt({
3817
3820
  sizeRestrictions: {
3818
3821
  maxWidth: t.width,
3819
3822
  maxHeight: t.height,
@@ -3826,7 +3829,7 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
3826
3829
  minimum: r.minimum,
3827
3830
  maximum: r.maximum
3828
3831
  }
3829
- })), (i.width > t.width || i.height > t.height) && (i = Bt({
3832
+ })), (i.width > t.width || i.height > t.height) && (i = Vt({
3830
3833
  sizeRestrictions: {
3831
3834
  maxWidth: t.width,
3832
3835
  maxHeight: t.height,
@@ -3855,13 +3858,13 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
3855
3858
  };
3856
3859
  },
3857
3860
  defaultCoordinates: function() {
3858
- return U({}, bt);
3861
+ return U({}, xt);
3859
3862
  },
3860
3863
  flip: function(e, t) {
3861
3864
  var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
3862
3865
  if (!this.transitionsActive) {
3863
3866
  r && this.enableTransitions();
3864
- var i = U({}, this.imageTransforms.flip), a = $t({
3867
+ var i = U({}, this.imageTransforms.flip), a = en({
3865
3868
  flip: {
3866
3869
  horizontal: e ? !i.horizontal : i.horizontal,
3867
3870
  vertical: t ? !i.vertical : i.vertical
@@ -3885,7 +3888,7 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
3885
3888
  n && this.enableTransitions();
3886
3889
  var r = U({}, this.imageSize);
3887
3890
  this.appliedImageTransforms.rotate += e;
3888
- var i = Qt({
3891
+ var i = $t({
3889
3892
  visibleArea: this.visibleArea,
3890
3893
  coordinates: this.coordinates,
3891
3894
  previousImageSize: r,
@@ -3905,16 +3908,16 @@ var jn = ["transitions"], Mn = K("vue-advanced-cropper"), Nn = {
3905
3908
  "error",
3906
3909
  "ready"
3907
3910
  ]
3908
- }, Pn = {
3911
+ }, Fn = {
3909
3912
  key: 0,
3910
3913
  ref: "canvas",
3911
3914
  style: { display: "none" }
3912
- }, Fn = {
3915
+ }, In = {
3913
3916
  key: 1,
3914
3917
  ref: "sourceCanvas",
3915
3918
  style: { display: "none" }
3916
3919
  };
3917
- Nn.render = function(e, t, n, i, a, o) {
3920
+ Pn.render = function(e, t, n, i, a, o) {
3918
3921
  return z(), h("div", {
3919
3922
  ref: "cropper",
3920
3923
  class: o.classes.cropper
@@ -3972,8 +3975,8 @@ Nn.render = function(e, t, n, i, a, o) {
3972
3975
  "onMove",
3973
3976
  "onMoveEnd"
3974
3977
  ])), [[ye, a.imageLoaded]]),
3975
- n.canvas ? (z(), h("canvas", Pn, null, 512)) : N("", !0),
3976
- n.canvas ? (z(), h("canvas", Fn, null, 512)) : N("", !0)
3978
+ n.canvas ? (z(), h("canvas", Fn, null, 512)) : N("", !0),
3979
+ n.canvas ? (z(), h("canvas", In, null, 512)) : N("", !0)
3977
3980
  ];
3978
3981
  })),
3979
3982
  _: 1
@@ -3989,57 +3992,57 @@ Nn.render = function(e, t, n, i, a, o) {
3989
3992
  };
3990
3993
  //#endregion
3991
3994
  //#region src/components/media/MediaEditModal.vue?vue&type=script&setup=true&lang.ts
3992
- var In = ["data-tpl-theme"], Ln = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Rn = {
3995
+ var Ln = ["data-tpl-theme"], Rn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, zn = {
3993
3996
  class: "tpl:text-sm tpl:font-semibold",
3994
3997
  style: { color: "var(--tpl-text)" }
3995
- }, zn = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto tpl:px-5" }, Bn = {
3998
+ }, Bn = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto tpl:px-5" }, Vn = {
3996
3999
  key: 0,
3997
4000
  class: "tpl:mb-4"
3998
- }, Vn = {
4001
+ }, Hn = {
3999
4002
  class: "tpl:relative tpl:mb-3 tpl:overflow-hidden tpl:rounded-md tpl:border",
4000
4003
  style: {
4001
4004
  "border-color": "var(--tpl-border)",
4002
4005
  height: "300px",
4003
4006
  "background-color": "var(--tpl-bg)"
4004
4007
  }
4005
- }, Hn = { class: "tpl:space-y-3" }, Un = {
4008
+ }, Un = { class: "tpl:space-y-3" }, Wn = {
4006
4009
  class: "tpl:mb-1.5 tpl:block tpl:text-xs tpl:font-medium",
4007
4010
  style: { color: "var(--tpl-text-muted)" }
4008
- }, Wn = { class: "tpl:flex tpl:flex-wrap tpl:gap-1.5" }, Gn = ["onClick"], Kn = { class: "tpl:flex tpl:gap-3" }, qn = { class: "tpl:flex-1" }, Jn = {
4011
+ }, Gn = { class: "tpl:flex tpl:flex-wrap tpl:gap-1.5" }, Kn = ["onClick"], qn = { class: "tpl:flex tpl:gap-3" }, Jn = { class: "tpl:flex-1" }, Yn = {
4009
4012
  class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
4010
4013
  style: { color: "var(--tpl-text-muted)" }
4011
- }, Yn = {
4014
+ }, Xn = {
4012
4015
  class: "tpl:font-normal",
4013
4016
  style: { color: "var(--tpl-text-dim)" }
4014
- }, Xn = { class: "tpl:relative" }, Zn = ["value", "placeholder"], Qn = {
4017
+ }, Zn = { class: "tpl:relative" }, Qn = ["value", "placeholder"], $n = {
4015
4018
  class: "tpl:absolute tpl:top-1/2 tpl:right-2.5 tpl:-translate-y-1/2 tpl:text-xs",
4016
4019
  style: { color: "var(--tpl-text-dim)" }
4017
- }, $n = { class: "tpl:flex-1" }, er = {
4020
+ }, er = { class: "tpl:flex-1" }, tr = {
4018
4021
  class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
4019
4022
  style: { color: "var(--tpl-text-muted)" }
4020
- }, tr = {
4023
+ }, nr = {
4021
4024
  class: "tpl:font-normal",
4022
4025
  style: { color: "var(--tpl-text-dim)" }
4023
- }, nr = { class: "tpl:relative" }, rr = ["value", "placeholder"], ir = {
4026
+ }, rr = { class: "tpl:relative" }, ir = ["value", "placeholder"], ar = {
4024
4027
  class: "tpl:absolute tpl:top-1/2 tpl:right-2.5 tpl:-translate-y-1/2 tpl:text-xs",
4025
4028
  style: { color: "var(--tpl-text-dim)" }
4026
- }, ar = {
4029
+ }, or = {
4027
4030
  key: 0,
4028
4031
  class: "tpl:flex tpl:items-center tpl:gap-1 tpl:text-xs",
4029
4032
  style: { color: "var(--tpl-text-muted)" }
4030
- }, or = {
4033
+ }, sr = {
4031
4034
  class: "tpl:font-medium",
4032
4035
  style: { color: "var(--tpl-text)" }
4033
- }, sr = { class: "tpl:mb-3" }, cr = {
4036
+ }, cr = { class: "tpl:mb-3" }, lr = {
4034
4037
  class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
4035
4038
  style: { color: "var(--tpl-text-muted)" }
4036
- }, lr = ["autofocus"], ur = {
4039
+ }, ur = ["autofocus"], dr = {
4037
4040
  key: 1,
4038
4041
  class: "tpl:mb-4"
4039
- }, dr = {
4042
+ }, fr = {
4040
4043
  class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
4041
4044
  style: { color: "var(--tpl-text-muted)" }
4042
- }, fr = ["placeholder"], pr = { class: "tpl:flex tpl:shrink-0 tpl:justify-end tpl:gap-2 tpl:p-5 tpl:pt-4" }, mr = ["disabled"], hr = /* @__PURE__ */ m({
4045
+ }, pr = ["placeholder"], mr = { class: "tpl:flex tpl:shrink-0 tpl:justify-end tpl:gap-2 tpl:p-5 tpl:pt-4" }, hr = ["disabled"], gr = /* @__PURE__ */ m({
4043
4046
  __name: "MediaEditModal",
4044
4047
  props: {
4045
4048
  visible: { type: Boolean },
@@ -4047,56 +4050,56 @@ var In = ["data-tpl-theme"], Ln = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Rn
4047
4050
  },
4048
4051
  emits: ["save", "close"],
4049
4052
  setup(n, { emit: o }) {
4050
- let c = n, d = o, { t: f } = Ae(), m = l("tplUiTheme"), g = f.mediaLibrary, { isImageMimeType: _ } = Fe(), v = e(""), y = e(""), x = e(null), C = e("free"), w = e(void 0), T = e(void 0), E = e(""), D = e(""), O = e(void 0), A = e(null), te = e(!1), ne = e(!1), re = e(!1), ie = a(() => c.item ? [
4053
+ let c = n, d = o, { t: f } = Ae(), m = l("tplUiTheme"), g = l(Ve, e(null)), _ = f.mediaLibrary, { isImageMimeType: v } = Fe(), y = e(""), x = e(""), C = e(null), w = e("free"), T = e(void 0), E = e(void 0), D = e(""), O = e(""), te = e(void 0), ne = e(null), re = e(!1), A = e(!1), ie = e(!1), ae = a(() => c.item ? [
4051
4054
  "image/jpeg",
4052
4055
  "image/png",
4053
4056
  "image/webp",
4054
4057
  "image/gif"
4055
- ].includes(c.item.mime_type) : !1), ae = a(() => C.value === "original" ? O.value : Ie[C.value]), oe = a(() => A.value ? Be(A.value.width, A.value.height, w.value, T.value) : null);
4058
+ ].includes(c.item.mime_type) : !1), oe = a(() => w.value === "original" ? te.value : Ie[w.value]), se = a(() => ne.value ? Be(ne.value.width, ne.value.height, T.value, E.value) : null);
4056
4059
  s(() => c.visible, (e) => {
4057
- e && c.item && (v.value = c.item.filename, y.value = c.item.alt_text || "", C.value = "free", w.value = void 0, T.value = void 0, E.value = "", D.value = "", O.value = void 0, A.value = null, te.value = !1, re.value = !1, c.item.width && c.item.height && (O.value = c.item.width / c.item.height));
4060
+ e && c.item && (y.value = c.item.filename, x.value = c.item.alt_text || "", w.value = "free", T.value = void 0, E.value = void 0, D.value = "", O.value = "", te.value = void 0, ne.value = null, re.value = !1, ie.value = !1, c.item.width && c.item.height && (te.value = c.item.width / c.item.height));
4058
4061
  });
4059
- function se(e) {
4060
- e.coordinates && (A.value = {
4062
+ function ce(e) {
4063
+ e.coordinates && (ne.value = {
4061
4064
  width: Math.round(e.coordinates.width),
4062
4065
  height: Math.round(e.coordinates.height)
4063
- }, re.value = !0);
4064
- }
4065
- function ce() {
4066
- te.value = !0, !O.value && c.item?.width && c.item?.height && (O.value = c.item.width / c.item.height);
4066
+ }, ie.value = !0);
4067
4067
  }
4068
- function le(e) {
4069
- let t = e.target.value;
4070
- E.value = t, w.value = t && parseInt(t, 10) || void 0;
4068
+ function le() {
4069
+ re.value = !0, !te.value && c.item?.width && c.item?.height && (te.value = c.item.width / c.item.height);
4071
4070
  }
4072
4071
  function ue(e) {
4073
4072
  let t = e.target.value;
4074
4073
  D.value = t, T.value = t && parseInt(t, 10) || void 0;
4075
4074
  }
4076
- async function de() {
4077
- let e = v.value.trim();
4078
- if (!e || !c.item || ne.value) return;
4079
- let t = _(c.item.mime_type), n;
4080
- if (ie.value && x.value && re.value) {
4081
- ne.value = !0;
4075
+ function de(e) {
4076
+ let t = e.target.value;
4077
+ O.value = t, E.value = t && parseInt(t, 10) || void 0;
4078
+ }
4079
+ async function fe() {
4080
+ let e = y.value.trim();
4081
+ if (!e || !c.item || A.value) return;
4082
+ let t = v(c.item.mime_type), n;
4083
+ if (ae.value && C.value && ie.value) {
4084
+ A.value = !0;
4082
4085
  try {
4083
- let { canvas: e } = x.value.getResult();
4086
+ let { canvas: e } = C.value.getResult();
4084
4087
  if (e) {
4085
- let t = Re(e, w.value, T.value), r = Le(c.item.mime_type);
4088
+ let t = Re(e, T.value, E.value), r = Le(c.item.mime_type);
4086
4089
  n = { file: await ze(t, c.item.filename, r) };
4087
4090
  }
4088
4091
  } catch {
4089
- ne.value = !1;
4092
+ A.value = !1;
4090
4093
  return;
4091
4094
  }
4092
- ne.value = !1;
4095
+ A.value = !1;
4093
4096
  }
4094
- d("save", c.item.id, e, t ? y.value : void 0, n), d("close");
4097
+ d("save", c.item.id, e, t ? x.value : void 0, n), d("close");
4095
4098
  }
4096
- function fe(e) {
4097
- e.key === "Enter" && !ne.value && (e.preventDefault(), de()), e.key === "Escape" && d("close");
4099
+ function pe(e) {
4100
+ e.key === "Enter" && !A.value && (e.preventDefault(), fe()), e.key === "Escape" && d("close");
4098
4101
  }
4099
- return (e, a) => (z(), h(b, { to: "body" }, [p(ve, {
4102
+ return (e, a) => (z(), h(b, { to: j(g) || "body" }, [p(ve, {
4100
4103
  "enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
4101
4104
  "enter-from-class": "tpl:opacity-0",
4102
4105
  "enter-to-class": "tpl:opacity-100",
@@ -4110,24 +4113,24 @@ var In = ["data-tpl-theme"], Ln = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Rn
4110
4113
  class: "tpl tpl:fixed tpl:inset-0 tpl:z-[10000] tpl:flex tpl:items-center tpl:justify-center",
4111
4114
  style: { "background-color": "var(--tpl-overlay)" },
4112
4115
  onClick: a[3] ||= r((e) => d("close"), ["self"]),
4113
- onKeydown: fe
4116
+ onKeydown: pe
4114
4117
  }, [i("div", {
4115
- class: k(["tpl:mx-4 tpl:flex tpl:max-h-[90vh] tpl:w-full tpl:flex-col tpl:overflow-hidden tpl:rounded-lg tpl:shadow-xl", ie.value ? "tpl:max-w-2xl" : "tpl:max-w-sm"]),
4118
+ class: k(["tpl:mx-4 tpl:flex tpl:max-h-[90vh] tpl:w-full tpl:flex-col tpl:overflow-hidden tpl:rounded-lg tpl:shadow-xl", ae.value ? "tpl:max-w-2xl" : "tpl:max-w-sm"]),
4116
4119
  style: { "background-color": "var(--tpl-bg-elevated)" }
4117
4120
  }, [
4118
- i("div", Ln, [i("h3", Rn, L(j(f).mediaLibrary.editFile), 1)]),
4119
- i("div", zn, [
4120
- ie.value ? (z(), t("div", Bn, [i("div", Vn, [p(j(Nn), {
4121
+ i("div", Rn, [i("h3", zn, L(j(f).mediaLibrary.editFile), 1)]),
4122
+ i("div", Bn, [
4123
+ ae.value ? (z(), t("div", Vn, [i("div", Hn, [p(j(Pn), {
4121
4124
  ref_key: "cropperRef",
4122
- ref: x,
4125
+ ref: C,
4123
4126
  src: n.item.url,
4124
- "stencil-props": { aspectRatio: ae.value },
4127
+ "stencil-props": { aspectRatio: oe.value },
4125
4128
  class: "tpl:h-full tpl:w-full",
4126
4129
  "background-class": "tpl-cropper-background",
4127
- onChange: se,
4128
- onReady: ce
4129
- }, null, 8, ["src", "stencil-props"])]), i("div", Hn, [
4130
- i("div", null, [i("label", Un, L(j(f).mediaLibrary.cropAspectRatio), 1), i("div", Wn, [(z(), t(R, null, S([
4130
+ onChange: ce,
4131
+ onReady: le
4132
+ }, null, 8, ["src", "stencil-props"])]), i("div", Un, [
4133
+ i("div", null, [i("label", Wn, L(j(f).mediaLibrary.cropAspectRatio), 1), i("div", Gn, [(z(), t(R, null, S([
4131
4134
  "free",
4132
4135
  "square",
4133
4136
  "landscape43",
@@ -4138,14 +4141,14 @@ var In = ["data-tpl-theme"], Ln = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Rn
4138
4141
  type: "button",
4139
4142
  class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
4140
4143
  style: P({
4141
- borderColor: C.value === e ? "var(--tpl-primary)" : "var(--tpl-border)",
4142
- backgroundColor: C.value === e ? "var(--tpl-primary-light)" : "var(--tpl-bg)",
4143
- color: C.value === e ? "var(--tpl-primary)" : "var(--tpl-text)"
4144
+ borderColor: w.value === e ? "var(--tpl-primary)" : "var(--tpl-border)",
4145
+ backgroundColor: w.value === e ? "var(--tpl-primary-light)" : "var(--tpl-bg)",
4146
+ color: w.value === e ? "var(--tpl-primary)" : "var(--tpl-text)"
4144
4147
  }),
4145
- onClick: (t) => C.value = e
4146
- }, L(j(g)[`crop${e.charAt(0).toUpperCase()}${e.slice(1)}`]), 13, Gn)), 64))])]),
4147
- i("div", Kn, [i("div", qn, [i("label", Jn, [M(L(j(f).mediaLibrary.cropMaxWidth) + " ", 1), i("span", Yn, L(j(f).mediaLibrary.cropOptional), 1)]), i("div", Xn, [i("input", {
4148
- value: E.value,
4148
+ onClick: (t) => w.value = e
4149
+ }, L(j(_)[`crop${e.charAt(0).toUpperCase()}${e.slice(1)}`]), 13, Kn)), 64))])]),
4150
+ i("div", qn, [i("div", Jn, [i("label", Yn, [M(L(j(f).mediaLibrary.cropMaxWidth) + " ", 1), i("span", Xn, L(j(f).mediaLibrary.cropOptional), 1)]), i("div", Zn, [i("input", {
4151
+ value: D.value,
4149
4152
  type: "number",
4150
4153
  min: "1",
4151
4154
  class: "tpl:w-full tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-8 tpl:pl-3 tpl:text-xs tpl:outline-none",
@@ -4154,10 +4157,10 @@ var In = ["data-tpl-theme"], Ln = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Rn
4154
4157
  "background-color": "var(--tpl-bg)",
4155
4158
  color: "var(--tpl-text)"
4156
4159
  },
4157
- placeholder: A.value?.width?.toString() || "",
4158
- onInput: le
4159
- }, null, 40, Zn), i("span", Qn, L(j(f).mediaLibrary.cropPixels), 1)])]), i("div", $n, [i("label", er, [M(L(j(f).mediaLibrary.cropMaxHeight) + " ", 1), i("span", tr, L(j(f).mediaLibrary.cropOptional), 1)]), i("div", nr, [i("input", {
4160
- value: D.value,
4160
+ placeholder: ne.value?.width?.toString() || "",
4161
+ onInput: ue
4162
+ }, null, 40, Qn), i("span", $n, L(j(f).mediaLibrary.cropPixels), 1)])]), i("div", er, [i("label", tr, [M(L(j(f).mediaLibrary.cropMaxHeight) + " ", 1), i("span", nr, L(j(f).mediaLibrary.cropOptional), 1)]), i("div", rr, [i("input", {
4163
+ value: O.value,
4161
4164
  type: "number",
4162
4165
  min: "1",
4163
4166
  class: "tpl:w-full tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-8 tpl:pl-3 tpl:text-xs tpl:outline-none",
@@ -4166,13 +4169,13 @@ var In = ["data-tpl-theme"], Ln = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Rn
4166
4169
  "background-color": "var(--tpl-bg)",
4167
4170
  color: "var(--tpl-text)"
4168
4171
  },
4169
- placeholder: A.value?.height?.toString() || "",
4170
- onInput: ue
4171
- }, null, 40, rr), i("span", ir, L(j(f).mediaLibrary.cropPixels), 1)])])]),
4172
- oe.value ? (z(), t("div", ar, [i("span", null, L(j(f).mediaLibrary.cropOutputSize) + ": ", 1), i("span", or, L(oe.value.width) + " x " + L(oe.value.height) + " " + L(j(f).mediaLibrary.cropPixels), 1)])) : N("", !0)
4172
+ placeholder: ne.value?.height?.toString() || "",
4173
+ onInput: de
4174
+ }, null, 40, ir), i("span", ar, L(j(f).mediaLibrary.cropPixels), 1)])])]),
4175
+ se.value ? (z(), t("div", or, [i("span", null, L(j(f).mediaLibrary.cropOutputSize) + ": ", 1), i("span", sr, L(se.value.width) + " x " + L(se.value.height) + " " + L(j(f).mediaLibrary.cropPixels), 1)])) : N("", !0)
4173
4176
  ])])) : N("", !0),
4174
- i("div", sr, [i("label", cr, L(j(f).mediaLibrary.fileName), 1), u(i("input", {
4175
- "onUpdate:modelValue": a[0] ||= (e) => v.value = e,
4177
+ i("div", cr, [i("label", lr, L(j(f).mediaLibrary.fileName), 1), u(i("input", {
4178
+ "onUpdate:modelValue": a[0] ||= (e) => y.value = e,
4176
4179
  type: "text",
4177
4180
  class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
4178
4181
  style: {
@@ -4180,10 +4183,10 @@ var In = ["data-tpl-theme"], Ln = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Rn
4180
4183
  "background-color": "var(--tpl-bg)",
4181
4184
  color: "var(--tpl-text)"
4182
4185
  },
4183
- autofocus: !ie.value
4184
- }, null, 8, lr), [[ee, v.value]])]),
4185
- j(_)(n.item.mime_type) ? (z(), t("div", ur, [i("label", dr, L(j(f).mediaLibrary.altText), 1), u(i("input", {
4186
- "onUpdate:modelValue": a[1] ||= (e) => y.value = e,
4186
+ autofocus: !ae.value
4187
+ }, null, 8, ur), [[ee, y.value]])]),
4188
+ j(v)(n.item.mime_type) ? (z(), t("div", dr, [i("label", fr, L(j(f).mediaLibrary.altText), 1), u(i("input", {
4189
+ "onUpdate:modelValue": a[1] ||= (e) => x.value = e,
4187
4190
  type: "text",
4188
4191
  class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
4189
4192
  style: {
@@ -4192,9 +4195,9 @@ var In = ["data-tpl-theme"], Ln = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Rn
4192
4195
  color: "var(--tpl-text)"
4193
4196
  },
4194
4197
  placeholder: j(f).mediaLibrary.altTextPlaceholder
4195
- }, null, 8, fr), [[ee, y.value]])])) : N("", !0)
4198
+ }, null, 8, pr), [[ee, x.value]])])) : N("", !0)
4196
4199
  ]),
4197
- i("div", pr, [i("button", {
4200
+ i("div", mr, [i("button", {
4198
4201
  class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
4199
4202
  style: {
4200
4203
  "border-color": "var(--tpl-border)",
@@ -4205,27 +4208,27 @@ var In = ["data-tpl-theme"], Ln = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Rn
4205
4208
  }, L(j(f).mediaLibrary.cancel), 1), i("button", {
4206
4209
  class: "tpl:cursor-pointer tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:text-white tpl:transition-all tpl:duration-150 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
4207
4210
  style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
4208
- disabled: ne.value,
4209
- onClick: de
4210
- }, L(ne.value ? j(f).mediaLibrary.saving : j(f).mediaLibrary.saveChanges), 9, mr)])
4211
- ], 2)], 40, In)) : N("", !0)]),
4211
+ disabled: A.value,
4212
+ onClick: fe
4213
+ }, L(A.value ? j(f).mediaLibrary.saving : j(f).mediaLibrary.saveChanges), 9, hr)])
4214
+ ], 2)], 40, Ln)) : N("", !0)]),
4212
4215
  _: 1
4213
- })]));
4216
+ })], 8, ["to"]));
4214
4217
  }
4215
- }), gr = (e, t) => {
4218
+ }), _r = (e, t) => {
4216
4219
  let n = e.__vccOpts || e;
4217
4220
  for (let [e, r] of t) n[e] = r;
4218
4221
  return n;
4219
- }, _r = /* @__PURE__ */ gr(hr, [["__scopeId", "data-v-bd5f2e31"]]), vr = {
4222
+ }, vr = /* @__PURE__ */ _r(gr, [["__scopeId", "data-v-6b677237"]]), yr = {
4220
4223
  key: 1,
4221
4224
  class: "tpl:size-4 tpl:shrink-0"
4222
- }, yr = {
4225
+ }, br = {
4223
4226
  key: 0,
4224
4227
  class: "tpl:truncate"
4225
- }, br = {
4228
+ }, xr = {
4226
4229
  key: 3,
4227
4230
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:gap-0.5 tpl:opacity-0 tpl:transition-opacity tpl:group-hover:opacity-100"
4228
- }, xr = ["title"], Sr = ["title"], Cr = { key: 0 }, wr = ["placeholder"], Tr = 5, Er = /* @__PURE__ */ m({
4231
+ }, Sr = ["title"], Cr = ["title"], wr = { key: 0 }, Tr = ["placeholder"], Er = 5, Dr = /* @__PURE__ */ m({
4229
4232
  __name: "MediaFolderTreeNode",
4230
4233
  props: {
4231
4234
  folder: {},
@@ -4239,7 +4242,7 @@ var In = ["data-tpl-theme"], Ln = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Rn
4239
4242
  "deleteFolder"
4240
4243
  ],
4241
4244
  setup(n, { emit: o }) {
4242
- let s = n, c = o, { t: l } = Ae(), d = e(!1), f = e(!1), m = e(""), g = e(!1), _ = e(""), v = a(() => (s.folder.children?.length ?? 0) > 0), b = a(() => s.depth < Tr - 1), C = a(() => s.currentFolderId === s.folder.id), w = a(() => !s.currentFolderId || !s.folder.children ? !1 : E(s.folder.children, s.currentFolderId)), T = a(() => d.value || w.value);
4245
+ let s = n, c = o, { t: l } = Ae(), d = e(!1), f = e(!1), m = e(""), g = e(!1), _ = e(""), v = a(() => (s.folder.children?.length ?? 0) > 0), b = a(() => s.depth < Er - 1), C = a(() => s.currentFolderId === s.folder.id), w = a(() => !s.currentFolderId || !s.folder.children ? !1 : E(s.folder.children, s.currentFolderId)), T = a(() => d.value || w.value);
4243
4246
  function E(e, t) {
4244
4247
  for (let n of e) if (n.id === t || n.children && E(n.children, t)) return !0;
4245
4248
  return !1;
@@ -4250,17 +4253,17 @@ var In = ["data-tpl-theme"], Ln = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Rn
4250
4253
  function O() {
4251
4254
  f.value = !0, m.value = s.folder.name;
4252
4255
  }
4253
- function A() {
4256
+ function te() {
4254
4257
  let e = m.value.trim();
4255
4258
  e && e !== s.folder.name && c("renameFolder", s.folder.id, e), f.value = !1, m.value = "";
4256
4259
  }
4257
- function te() {
4260
+ function ne() {
4258
4261
  f.value = !1, m.value = "";
4259
4262
  }
4260
- function ne() {
4263
+ function re() {
4261
4264
  g.value = !0, _.value = "", d.value = !0;
4262
4265
  }
4263
- function re() {
4266
+ function A() {
4264
4267
  _.value.trim() && c("createFolder", _.value.trim(), s.folder.id), g.value = !1, _.value = "";
4265
4268
  }
4266
4269
  function ae() {
@@ -4284,7 +4287,7 @@ var In = ["data-tpl-theme"], Ln = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Rn
4284
4287
  class: k(["tpl:transition-transform tpl:duration-150", { "tpl:rotate-90": T.value }]),
4285
4288
  size: 10,
4286
4289
  "stroke-width": 2
4287
- }, null, 8, ["class"])])) : (z(), t("span", vr)),
4290
+ }, null, 8, ["class"])])) : (z(), t("span", yr)),
4288
4291
  i("button", {
4289
4292
  class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-1.5",
4290
4293
  onClick: a[0] ||= (e) => c("navigate", n.folder.id)
@@ -4292,7 +4295,7 @@ var In = ["data-tpl-theme"], Ln = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Rn
4292
4295
  class: "tpl:shrink-0",
4293
4296
  size: 14,
4294
4297
  "stroke-width": 1.5
4295
- }), f.value ? N("", !0) : (z(), t("span", yr, L(n.folder.name), 1))]),
4298
+ }), f.value ? N("", !0) : (z(), t("span", br, L(n.folder.name), 1))]),
4296
4299
  f.value ? u((z(), t("input", {
4297
4300
  key: 2,
4298
4301
  "onUpdate:modelValue": a[1] ||= (e) => m.value = e,
@@ -4304,20 +4307,20 @@ var In = ["data-tpl-theme"], Ln = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Rn
4304
4307
  color: "var(--tpl-text)"
4305
4308
  },
4306
4309
  autofocus: "",
4307
- onKeydown: [y(A, ["enter"]), y(te, ["escape"])],
4308
- onBlur: A,
4310
+ onKeydown: [y(te, ["enter"]), y(ne, ["escape"])],
4311
+ onBlur: te,
4309
4312
  onClick: a[2] ||= r(() => {}, ["stop"])
4310
4313
  }, null, 544)), [[ee, m.value]]) : N("", !0),
4311
- f.value ? N("", !0) : (z(), t("span", br, [
4314
+ f.value ? N("", !0) : (z(), t("span", xr, [
4312
4315
  b.value ? (z(), t("button", {
4313
4316
  key: 0,
4314
4317
  class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
4315
4318
  title: j(l).mediaLibrary.addSubfolder,
4316
- onClick: r(ne, ["stop"])
4319
+ onClick: r(re, ["stop"])
4317
4320
  }, [p(j(de), {
4318
4321
  size: 12,
4319
4322
  "stroke-width": 2
4320
- })], 8, xr)) : N("", !0),
4323
+ })], 8, Sr)) : N("", !0),
4321
4324
  i("button", {
4322
4325
  class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
4323
4326
  title: j(l).mediaLibrary.renameFolder,
@@ -4325,7 +4328,7 @@ var In = ["data-tpl-theme"], Ln = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Rn
4325
4328
  }, [p(j(me), {
4326
4329
  size: 12,
4327
4330
  "stroke-width": 2
4328
- })], 8, Sr),
4331
+ })], 8, Cr),
4329
4332
  i("button", {
4330
4333
  class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
4331
4334
  onClick: a[3] ||= r((e) => c("deleteFolder", n.folder.id), ["stop"])
@@ -4335,7 +4338,7 @@ var In = ["data-tpl-theme"], Ln = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Rn
4335
4338
  style: { color: "var(--tpl-danger)" }
4336
4339
  })])
4337
4340
  ]))
4338
- ], 4), T.value ? (z(), t("div", Cr, [(z(!0), t(R, null, S(n.folder.children, (e) => (z(), h(o, {
4341
+ ], 4), T.value ? (z(), t("div", wr, [(z(!0), t(R, null, S(n.folder.children, (e) => (z(), h(o, {
4339
4342
  key: e.id,
4340
4343
  folder: e,
4341
4344
  "current-folder-id": n.currentFolderId,
@@ -4363,15 +4366,15 @@ var In = ["data-tpl-theme"], Ln = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Rn
4363
4366
  },
4364
4367
  placeholder: j(l).mediaLibrary.subfolderName,
4365
4368
  autofocus: "",
4366
- onKeydown: [y(re, ["enter"]), y(ae, ["escape"])],
4367
- onBlur: re
4368
- }, null, 40, wr), [[ee, _.value]])], 4)) : N("", !0)])) : N("", !0)]);
4369
+ onKeydown: [y(A, ["enter"]), y(ae, ["escape"])],
4370
+ onBlur: A
4371
+ }, null, 40, Tr), [[ee, _.value]])], 4)) : N("", !0)])) : N("", !0)]);
4369
4372
  };
4370
4373
  }
4371
- }), Dr = { class: "tpl:flex tpl:h-full tpl:flex-col tpl:overflow-y-auto" }, Or = {
4374
+ }), Or = { class: "tpl:flex tpl:h-full tpl:flex-col tpl:overflow-y-auto" }, kr = {
4372
4375
  key: 0,
4373
4376
  class: "tpl:px-3 tpl:py-2"
4374
- }, kr = ["placeholder"], Ar = /* @__PURE__ */ m({
4377
+ }, Ar = ["placeholder"], jr = /* @__PURE__ */ m({
4375
4378
  __name: "MediaFolderTree",
4376
4379
  props: {
4377
4380
  folders: {},
@@ -4397,7 +4400,7 @@ var In = ["data-tpl-theme"], Ln = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Rn
4397
4400
  function f() {
4398
4401
  s.value = !1, c.value = "";
4399
4402
  }
4400
- return (e, r) => (z(), t("div", Dr, [
4403
+ return (e, r) => (z(), t("div", Or, [
4401
4404
  i("button", {
4402
4405
  class: "tpl:flex tpl:w-full tpl:items-center tpl:gap-2 tpl:px-3 tpl:py-2 tpl:text-left tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
4403
4406
  style: P({
@@ -4409,7 +4412,7 @@ var In = ["data-tpl-theme"], Ln = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Rn
4409
4412
  size: 14,
4410
4413
  "stroke-width": 1.5
4411
4414
  }), M(" " + L(j(o).mediaLibrary.allFiles), 1)], 4),
4412
- (z(!0), t(R, null, S(n.folders, (e) => (z(), h(Er, {
4415
+ (z(!0), t(R, null, S(n.folders, (e) => (z(), h(Dr, {
4413
4416
  key: e.id,
4414
4417
  folder: e,
4415
4418
  "current-folder-id": n.currentFolderId,
@@ -4419,7 +4422,7 @@ var In = ["data-tpl-theme"], Ln = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Rn
4419
4422
  onRenameFolder: r[3] ||= (e, t) => a("renameFolder", e, t),
4420
4423
  onDeleteFolder: r[4] ||= (e) => a("deleteFolder", e)
4421
4424
  }, null, 8, ["folder", "current-folder-id"]))), 128)),
4422
- s.value ? (z(), t("div", Or, [u(i("input", {
4425
+ s.value ? (z(), t("div", kr, [u(i("input", {
4423
4426
  "onUpdate:modelValue": r[5] ||= (e) => c.value = e,
4424
4427
  type: "text",
4425
4428
  class: "tpl:w-full tpl:rounded tpl:border tpl:px-2 tpl:py-1 tpl:text-xs tpl:outline-none",
@@ -4432,7 +4435,7 @@ var In = ["data-tpl-theme"], Ln = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Rn
4432
4435
  autofocus: "",
4433
4436
  onKeydown: [y(d, ["enter"]), y(f, ["escape"])],
4434
4437
  onBlur: d
4435
- }, null, 40, kr), [[ee, c.value]])])) : N("", !0),
4438
+ }, null, 40, Ar), [[ee, c.value]])])) : N("", !0),
4436
4439
  s.value ? N("", !0) : (z(), t("button", {
4437
4440
  key: 1,
4438
4441
  class: "tpl:flex tpl:w-full tpl:items-center tpl:gap-2 tpl:px-3 tpl:py-2 tpl:text-left tpl:text-xs tpl:transition-all tpl:duration-150",
@@ -4458,7 +4461,7 @@ var In = ["data-tpl-theme"], Ln = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Rn
4458
4461
  }), M(" " + L(j(o).mediaLibrary.frequentlyUsed), 1)], 4)) : N("", !0)
4459
4462
  ]));
4460
4463
  }
4461
- }), jr = { class: "tpl:flex tpl:aspect-square tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2" }, Mr = /* @__PURE__ */ m({
4464
+ }), Mr = { class: "tpl:flex tpl:aspect-square tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2" }, Nr = /* @__PURE__ */ m({
4462
4465
  __name: "MediaFileIcon",
4463
4466
  props: { mimeType: {} },
4464
4467
  setup(e) {
@@ -4559,7 +4562,7 @@ var In = ["data-tpl-theme"], Ln = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Rn
4559
4562
  bgColor: "#f9fafb",
4560
4563
  icon: "document"
4561
4564
  }, s = a(() => r[n.mimeType] ?? o);
4562
- return (e, n) => (z(), t("div", jr, [s.value.icon === "document" ? (z(), t("svg", {
4565
+ return (e, n) => (z(), t("div", Mr, [s.value.icon === "document" ? (z(), t("svg", {
4563
4566
  key: 0,
4564
4567
  width: "60",
4565
4568
  height: "60",
@@ -4631,10 +4634,10 @@ var In = ["data-tpl-theme"], Ln = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Rn
4631
4634
  });
4632
4635
  //#endregion
4633
4636
  //#region ../../node_modules/.pnpm/@vueuse+shared@14.2.1_vue@3.5.33_typescript@6.0.3_/node_modules/@vueuse/shared/dist/index.js
4634
- function Nr(e, t) {
4637
+ function Pr(e, t) {
4635
4638
  return T() ? (E(e, t), !0) : !1;
4636
4639
  }
4637
- function Pr() {
4640
+ function Fr() {
4638
4641
  let e = /* @__PURE__ */ new Set(), t = (t) => {
4639
4642
  e.delete(t);
4640
4643
  };
@@ -4642,7 +4645,7 @@ function Pr() {
4642
4645
  on: (n) => {
4643
4646
  e.add(n);
4644
4647
  let r = () => t(n);
4645
- return Nr(r), { off: r };
4648
+ return Pr(r), { off: r };
4646
4649
  },
4647
4650
  off: t,
4648
4651
  trigger: (...t) => Promise.all(Array.from(e).map((e) => e(...t))),
@@ -4651,14 +4654,14 @@ function Pr() {
4651
4654
  }
4652
4655
  };
4653
4656
  }
4654
- var Fr = typeof window < "u" && typeof document < "u";
4657
+ var Ir = typeof window < "u" && typeof document < "u";
4655
4658
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
4656
- var Ir = (e) => e != null, Lr = Object.prototype.toString, Rr = (e) => Lr.call(e) === "[object Object]", zr = () => {}, Br = (e, t) => Object.prototype.hasOwnProperty.call(e, t), Vr = /* @__PURE__ */ Hr();
4657
- function Hr() {
4659
+ var Lr = (e) => e != null, Rr = Object.prototype.toString, zr = (e) => Rr.call(e) === "[object Object]", Br = () => {}, Vr = (e, t) => Object.prototype.hasOwnProperty.call(e, t), Hr = /* @__PURE__ */ Ur();
4660
+ function Ur() {
4658
4661
  var e, t;
4659
- return Fr && !!(!((e = window) == null || (e = e.navigator) == null) && e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((t = window) == null || (t = t.navigator) == null ? void 0 : t.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window?.navigator.userAgent));
4662
+ return Ir && !!(!((e = window) == null || (e = e.navigator) == null) && e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((t = window) == null || (t = t.navigator) == null ? void 0 : t.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window?.navigator.userAgent));
4660
4663
  }
4661
- function Ur(e, t) {
4664
+ function Wr(e, t) {
4662
4665
  function n(...n) {
4663
4666
  return new Promise((r, i) => {
4664
4667
  Promise.resolve(e(() => t.apply(this, n), {
@@ -4670,9 +4673,9 @@ function Ur(e, t) {
4670
4673
  }
4671
4674
  return n;
4672
4675
  }
4673
- function Wr(e, t = {}) {
4674
- let n, r, i = zr, a = (e) => {
4675
- clearTimeout(e), i(), i = zr;
4676
+ function Gr(e, t = {}) {
4677
+ let n, r, i = Br, a = (e) => {
4678
+ clearTimeout(e), i(), i = Br;
4676
4679
  }, o;
4677
4680
  return (s) => {
4678
4681
  let c = I(e), l = I(t.maxWait);
@@ -4685,7 +4688,7 @@ function Wr(e, t = {}) {
4685
4688
  });
4686
4689
  };
4687
4690
  }
4688
- function Gr(e) {
4691
+ function Kr(e) {
4689
4692
  let t;
4690
4693
  function n() {
4691
4694
  return t ||= e(), t;
@@ -4695,13 +4698,13 @@ function Gr(e) {
4695
4698
  t = void 0, e && await e;
4696
4699
  }, n;
4697
4700
  }
4698
- function Kr(e) {
4701
+ function qr(e) {
4699
4702
  return Array.isArray(e) ? e : [e];
4700
4703
  }
4701
- function qr(e, t = 200, n = {}) {
4702
- return Ur(Wr(t, n), e);
4704
+ function Jr(e, t = 200, n = {}) {
4705
+ return Wr(Gr(t, n), e);
4703
4706
  }
4704
- function Jr(e, t, n = {}) {
4707
+ function Yr(e, t, n = {}) {
4705
4708
  let { immediate: r = !0, immediateCallback: i = !1 } = n, a = ge(!1), o;
4706
4709
  function s() {
4707
4710
  o &&= (clearTimeout(o), void 0);
@@ -4714,13 +4717,13 @@ function Jr(e, t, n = {}) {
4714
4717
  a.value = !1, o = void 0, e(...n);
4715
4718
  }, I(t));
4716
4719
  }
4717
- return r && (a.value = !0, Fr && l()), Nr(c), {
4718
- isPending: ne(a),
4720
+ return r && (a.value = !0, Ir && l()), Pr(c), {
4721
+ isPending: re(a),
4719
4722
  start: l,
4720
4723
  stop: c
4721
4724
  };
4722
4725
  }
4723
- function Yr(e, t, n) {
4726
+ function Xr(e, t, n) {
4724
4727
  return s(e, t, {
4725
4728
  ...n,
4726
4729
  immediate: !0
@@ -4728,46 +4731,46 @@ function Yr(e, t, n) {
4728
4731
  }
4729
4732
  //#endregion
4730
4733
  //#region ../../node_modules/.pnpm/@vueuse+core@14.2.1_vue@3.5.33_typescript@6.0.3_/node_modules/@vueuse/core/dist/index.js
4731
- var Xr = Fr ? window : void 0, Zr = Fr ? window.document : void 0, Qr = Fr ? window.navigator : void 0;
4732
- function $r(e) {
4734
+ var Zr = Ir ? window : void 0, Qr = Ir ? window.document : void 0, $r = Ir ? window.navigator : void 0;
4735
+ function ei(e) {
4733
4736
  let t = I(e);
4734
4737
  return t?.$el ?? t;
4735
4738
  }
4736
- function ei(...e) {
4739
+ function ti(...e) {
4737
4740
  let t = (e, t, n, r) => (e.addEventListener(t, n, r), () => e.removeEventListener(t, n, r)), n = a(() => {
4738
- let t = Kr(I(e[0])).filter((e) => e != null);
4741
+ let t = qr(I(e[0])).filter((e) => e != null);
4739
4742
  return t.every((e) => typeof e != "string") ? t : void 0;
4740
4743
  });
4741
- return Yr(() => [
4742
- n.value?.map((e) => $r(e)) ?? [Xr].filter((e) => e != null),
4743
- Kr(I(n.value ? e[1] : e[0])),
4744
- Kr(j(n.value ? e[2] : e[1])),
4744
+ return Xr(() => [
4745
+ n.value?.map((e) => ei(e)) ?? [Zr].filter((e) => e != null),
4746
+ qr(I(n.value ? e[1] : e[0])),
4747
+ qr(j(n.value ? e[2] : e[1])),
4745
4748
  I(n.value ? e[3] : e[2])
4746
4749
  ], ([e, n, r, i], a, o) => {
4747
4750
  if (!e?.length || !n?.length || !r?.length) return;
4748
- let s = Rr(i) ? { ...i } : i, c = e.flatMap((e) => n.flatMap((n) => r.map((r) => t(e, n, r, s))));
4751
+ let s = zr(i) ? { ...i } : i, c = e.flatMap((e) => n.flatMap((n) => r.map((r) => t(e, n, r, s))));
4749
4752
  o(() => {
4750
4753
  c.forEach((e) => e());
4751
4754
  });
4752
4755
  }, { flush: "post" });
4753
4756
  }
4754
- var ti = !1;
4755
- function ni(e, t, n = {}) {
4756
- let { window: r = Xr, ignore: i = [], capture: a = !0, detectIframe: o = !1, controls: s = !1 } = n;
4757
+ var ni = !1;
4758
+ function ri(e, t, n = {}) {
4759
+ let { window: r = Zr, ignore: i = [], capture: a = !0, detectIframe: o = !1, controls: s = !1 } = n;
4757
4760
  if (!r) return s ? {
4758
- stop: zr,
4759
- cancel: zr,
4760
- trigger: zr
4761
- } : zr;
4762
- if (Vr && !ti) {
4763
- ti = !0;
4761
+ stop: Br,
4762
+ cancel: Br,
4763
+ trigger: Br
4764
+ } : Br;
4765
+ if (Hr && !ni) {
4766
+ ni = !0;
4764
4767
  let e = { passive: !0 };
4765
- Array.from(r.document.body.children).forEach((t) => t.addEventListener("click", zr, e)), r.document.documentElement.addEventListener("click", zr, e);
4768
+ Array.from(r.document.body.children).forEach((t) => t.addEventListener("click", Br, e)), r.document.documentElement.addEventListener("click", Br, e);
4766
4769
  }
4767
4770
  let c = !0, l = (e) => I(i).some((t) => {
4768
4771
  if (typeof t == "string") return Array.from(r.document.querySelectorAll(t)).some((t) => t === e.target || e.composedPath().includes(t));
4769
4772
  {
4770
- let n = $r(t);
4773
+ let n = ei(t);
4771
4774
  return n && (e.target === n || e.composedPath().includes(n));
4772
4775
  }
4773
4776
  });
@@ -4780,7 +4783,7 @@ function ni(e, t, n = {}) {
4780
4783
  return r == null || !Array.isArray(r) ? !1 : r.some((e) => e.el === t.target || t.composedPath().includes(e.el));
4781
4784
  }
4782
4785
  let f = (n) => {
4783
- let r = $r(e);
4786
+ let r = ei(e);
4784
4787
  if (n.target != null && !(!(r instanceof Element) && u(e) && d(e, n)) && !(!r || r === n.target || n.composedPath().includes(r))) {
4785
4788
  if ("detail" in n && n.detail === 0 && (c = !l(n)), !c) {
4786
4789
  c = !0;
@@ -4789,7 +4792,7 @@ function ni(e, t, n = {}) {
4789
4792
  t(n);
4790
4793
  }
4791
4794
  }, p = !1, m = [
4792
- ei(r, "click", (e) => {
4795
+ ti(r, "click", (e) => {
4793
4796
  p || (p = !0, setTimeout(() => {
4794
4797
  p = !1;
4795
4798
  }, 0), f(e));
@@ -4797,13 +4800,13 @@ function ni(e, t, n = {}) {
4797
4800
  passive: !0,
4798
4801
  capture: a
4799
4802
  }),
4800
- ei(r, "pointerdown", (t) => {
4801
- let n = $r(e);
4803
+ ti(r, "pointerdown", (t) => {
4804
+ let n = ei(e);
4802
4805
  c = !l(t) && !!(n && !t.composedPath().includes(n));
4803
4806
  }, { passive: !0 }),
4804
- o && ei(r, "blur", (n) => {
4807
+ o && ti(r, "blur", (n) => {
4805
4808
  setTimeout(() => {
4806
- let i = $r(e);
4809
+ let i = ei(e);
4807
4810
  r.document.activeElement?.tagName === "IFRAME" && !i?.contains(r.document.activeElement) && t(n);
4808
4811
  }, 0);
4809
4812
  }, { passive: !0 })
@@ -4818,22 +4821,22 @@ function ni(e, t, n = {}) {
4818
4821
  }
4819
4822
  } : h;
4820
4823
  }
4821
- function ri() {
4824
+ function ii() {
4822
4825
  let e = ge(!1), t = g();
4823
4826
  return t && v(() => {
4824
4827
  e.value = !0;
4825
4828
  }, t), e;
4826
4829
  }
4827
4830
  /* @__NO_SIDE_EFFECTS__ */
4828
- function ii(e) {
4829
- return ri(), a(() => !!e());
4831
+ function ai(e) {
4832
+ return ii(), a(() => !!e());
4830
4833
  }
4831
- function ai(e, t = {}) {
4832
- let { controls: n = !1, navigator: r = Qr } = t, i = /* @__PURE__ */ ii(() => r && "permissions" in r), a = ge(), o = typeof e == "string" ? { name: e } : e, s = ge(), c = () => {
4834
+ function oi(e, t = {}) {
4835
+ let { controls: n = !1, navigator: r = $r } = t, i = /* @__PURE__ */ ai(() => r && "permissions" in r), a = ge(), o = typeof e == "string" ? { name: e } : e, s = ge(), c = () => {
4833
4836
  s.value = a.value?.state ?? "prompt";
4834
4837
  };
4835
- ei(a, "change", c, { passive: !0 });
4836
- let l = Gr(async () => {
4838
+ ti(a, "change", c, { passive: !0 });
4839
+ let l = Kr(async () => {
4837
4840
  if (i.value) {
4838
4841
  if (!a.value) try {
4839
4842
  a.value = await r.permissions.query(o);
@@ -4851,8 +4854,8 @@ function ai(e, t = {}) {
4851
4854
  query: l
4852
4855
  } : s;
4853
4856
  }
4854
- function oi(e = {}) {
4855
- let { navigator: t = Qr, read: n = !1, source: r, copiedDuring: i = 1500, legacy: o = !1 } = e, s = /* @__PURE__ */ ii(() => t && "clipboard" in t), c = ai("clipboard-read"), l = ai("clipboard-write"), u = a(() => s.value || o), d = ge(""), f = ge(!1), p = Jr(() => f.value = !1, i, { immediate: !1 });
4857
+ function si(e = {}) {
4858
+ let { navigator: t = $r, read: n = !1, source: r, copiedDuring: i = 1500, legacy: o = !1 } = e, s = /* @__PURE__ */ ai(() => t && "clipboard" in t), c = oi("clipboard-read"), l = oi("clipboard-write"), u = a(() => s.value || o), d = ge(""), f = ge(!1), p = Yr(() => f.value = !1, i, { immediate: !1 });
4856
4859
  async function m() {
4857
4860
  let e = !(s.value && y(c.value));
4858
4861
  if (!e) try {
@@ -4862,7 +4865,7 @@ function oi(e = {}) {
4862
4865
  }
4863
4866
  e && (d.value = v());
4864
4867
  }
4865
- u.value && n && ei(["copy", "cut"], m, { passive: !0 });
4868
+ u.value && n && ti(["copy", "cut"], m, { passive: !0 });
4866
4869
  async function h(e = I(r)) {
4867
4870
  if (u.value && e != null) {
4868
4871
  let n = !(s.value && y(l.value));
@@ -4892,9 +4895,9 @@ function oi(e = {}) {
4892
4895
  copy: h
4893
4896
  };
4894
4897
  }
4895
- function si(e, t = {}) {
4898
+ function ci(e, t = {}) {
4896
4899
  let n = ge(!1), r = ge(null), i = 0, a = !0;
4897
- if (Fr) {
4900
+ if (Ir) {
4898
4901
  let o = typeof t == "function" ? { onDrop: t } : t, s = o.multiple ?? !0, c = o.preventDefaultForUnhandled ?? !1, l = (e) => {
4899
4902
  let t = Array.from(e.dataTransfer?.files ?? []);
4900
4903
  return t.length === 0 ? null : s ? t : [t[0]];
@@ -4930,36 +4933,36 @@ function si(e, t = {}) {
4930
4933
  break;
4931
4934
  }
4932
4935
  };
4933
- ei(e, "dragenter", (e) => p(e, "enter")), ei(e, "dragover", (e) => p(e, "over")), ei(e, "dragleave", (e) => p(e, "leave")), ei(e, "drop", (e) => p(e, "drop"));
4936
+ ti(e, "dragenter", (e) => p(e, "enter")), ti(e, "dragover", (e) => p(e, "over")), ti(e, "dragleave", (e) => p(e, "leave")), ti(e, "drop", (e) => p(e, "drop"));
4934
4937
  }
4935
4938
  return {
4936
4939
  files: r,
4937
4940
  isOverDropZone: n
4938
4941
  };
4939
4942
  }
4940
- function ci(e, t, n = {}) {
4941
- let { root: r, rootMargin: i, threshold: o = 0, window: c = Xr, immediate: l = !0 } = n, u = /* @__PURE__ */ ii(() => c && "IntersectionObserver" in c), d = a(() => Kr(I(e)).map($r).filter(Ir)), f = zr, p = ge(l), m = u.value ? s(() => [
4943
+ function li(e, t, n = {}) {
4944
+ let { root: r, rootMargin: i, threshold: o = 0, window: c = Zr, immediate: l = !0 } = n, u = /* @__PURE__ */ ai(() => c && "IntersectionObserver" in c), d = a(() => qr(I(e)).map(ei).filter(Lr)), f = Br, p = ge(l), m = u.value ? s(() => [
4942
4945
  d.value,
4943
- $r(r),
4946
+ ei(r),
4944
4947
  I(i),
4945
4948
  p.value
4946
4949
  ], ([e, n, r]) => {
4947
4950
  if (f(), !p.value || !e.length) return;
4948
4951
  let i = new IntersectionObserver(t, {
4949
- root: $r(n),
4952
+ root: ei(n),
4950
4953
  rootMargin: r,
4951
4954
  threshold: o
4952
4955
  });
4953
4956
  e.forEach((e) => e && i.observe(e)), f = () => {
4954
- i.disconnect(), f = zr;
4957
+ i.disconnect(), f = Br;
4955
4958
  };
4956
4959
  }, {
4957
4960
  immediate: l,
4958
4961
  flush: "post"
4959
- }) : zr, h = () => {
4962
+ }) : Br, h = () => {
4960
4963
  f(), m(), p.value = !1;
4961
4964
  };
4962
- return Nr(h), {
4965
+ return Pr(h), {
4963
4966
  isSupported: u,
4964
4967
  isActive: p,
4965
4968
  pause() {
@@ -4971,22 +4974,22 @@ function ci(e, t, n = {}) {
4971
4974
  stop: h
4972
4975
  };
4973
4976
  }
4974
- var li = {
4977
+ var ui = {
4975
4978
  multiple: !0,
4976
4979
  accept: "*",
4977
4980
  reset: !1,
4978
4981
  directory: !1
4979
4982
  };
4980
- function ui(e) {
4983
+ function di(e) {
4981
4984
  if (!e) return null;
4982
4985
  if (e instanceof FileList) return e;
4983
4986
  let t = new DataTransfer();
4984
4987
  for (let n of e) t.items.add(n);
4985
4988
  return t.files;
4986
4989
  }
4987
- function di(t = {}) {
4988
- let { document: n = Zr } = t, r = e(ui(t.initialFiles)), { on: i, trigger: o } = Pr(), { on: s, trigger: c } = Pr(), l = a(() => {
4989
- let e = $r(t.input) ?? (n ? n.createElement("input") : void 0);
4990
+ function fi(t = {}) {
4991
+ let { document: n = Qr } = t, r = e(di(t.initialFiles)), { on: i, trigger: o } = Fr(), { on: s, trigger: c } = Fr(), l = a(() => {
4992
+ let e = ei(t.input) ?? (n ? n.createElement("input") : void 0);
4990
4993
  return e && (e.type = "file", e.onchange = (e) => {
4991
4994
  r.value = e.target.files, o(r.value);
4992
4995
  }, e.oncancel = () => {
@@ -4996,7 +4999,7 @@ function di(t = {}) {
4996
4999
  r.value = null, l.value && l.value.value && (l.value.value = "", o(null));
4997
5000
  }, f = (e) => {
4998
5001
  let t = l.value;
4999
- t && (t.multiple = I(e.multiple), t.accept = I(e.accept), t.webkitdirectory = I(e.directory), Br(e, "capture") && (t.capture = I(e.capture)));
5002
+ t && (t.multiple = I(e.multiple), t.accept = I(e.accept), t.webkitdirectory = I(e.directory), Vr(e, "capture") && (t.capture = I(e.capture)));
5000
5003
  };
5001
5004
  return d(() => {
5002
5005
  f(t);
@@ -5006,7 +5009,7 @@ function di(t = {}) {
5006
5009
  let n = l.value;
5007
5010
  if (!n) return;
5008
5011
  let r = {
5009
- ...li,
5012
+ ...ui,
5010
5013
  ...t,
5011
5014
  ...e
5012
5015
  };
@@ -5019,48 +5022,48 @@ function di(t = {}) {
5019
5022
  }
5020
5023
  //#endregion
5021
5024
  //#region src/components/media/MediaGrid.vue?vue&type=script&setup=true&lang.ts
5022
- var fi = { class: "tpl:p-4" }, pi = {
5025
+ var pi = { class: "tpl:p-4" }, mi = {
5023
5026
  key: 1,
5024
5027
  class: "tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:py-16"
5025
- }, mi = {
5028
+ }, hi = {
5026
5029
  class: "tpl:text-xs",
5027
5030
  style: { color: "var(--tpl-text-muted)" }
5028
- }, hi = {
5031
+ }, gi = {
5029
5032
  key: 2,
5030
5033
  class: "tpl:grid tpl:grid-cols-4 tpl:gap-3"
5031
- }, gi = ["onClick"], _i = { class: "tpl:aspect-square" }, vi = ["src", "alt"], yi = { class: "tpl:px-2 tpl:py-1.5" }, bi = {
5034
+ }, _i = ["onClick"], vi = { class: "tpl:aspect-square" }, yi = ["src", "alt"], bi = { class: "tpl:px-2 tpl:py-1.5" }, xi = {
5032
5035
  class: "tpl:truncate tpl:text-[10px] tpl:font-medium",
5033
5036
  style: { color: "var(--tpl-text)" }
5034
- }, xi = {
5037
+ }, Si = {
5035
5038
  class: "tpl:flex tpl:justify-between tpl:text-[9px]",
5036
5039
  style: { color: "var(--tpl-text-muted)" }
5037
- }, Si = { key: 0 }, Ci = { class: "tpl:absolute tpl:top-1.5 tpl:left-1.5 tpl:flex tpl:gap-1 tpl:opacity-0 tpl:transition-opacity tpl:duration-150 tpl:group-hover:opacity-100" }, wi = ["title", "onClick"], Ti = ["title", "onClick"], Ei = {
5040
+ }, Ci = { key: 0 }, wi = { class: "tpl:absolute tpl:top-1.5 tpl:left-1.5 tpl:flex tpl:gap-1 tpl:opacity-0 tpl:transition-opacity tpl:duration-150 tpl:group-hover:opacity-100" }, Ti = ["title", "onClick"], Ei = ["title", "onClick"], Di = {
5038
5041
  key: 0,
5039
5042
  class: "tpl:absolute tpl:top-1.5 tpl:right-1.5 tpl:flex tpl:size-5 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
5040
5043
  style: { "background-color": "var(--tpl-primary)" }
5041
- }, Di = {
5044
+ }, Oi = {
5042
5045
  key: 3,
5043
5046
  class: "tpl:flex tpl:flex-col tpl:gap-1"
5044
- }, Oi = ["onClick"], ki = {
5047
+ }, ki = ["onClick"], Ai = {
5045
5048
  class: "tpl:size-10 tpl:shrink-0 tpl:overflow-hidden tpl:rounded",
5046
5049
  style: { "background-color": "var(--tpl-bg-hover)" }
5047
- }, Ai = ["src", "alt"], ji = {
5050
+ }, ji = ["src", "alt"], Mi = {
5048
5051
  key: 1,
5049
5052
  class: "tpl-list-icon tpl:size-full"
5050
- }, Mi = { class: "tpl:min-w-0 tpl:flex-1" }, Ni = {
5053
+ }, Ni = { class: "tpl:min-w-0 tpl:flex-1" }, Pi = {
5051
5054
  class: "tpl:truncate tpl:text-xs tpl:font-medium",
5052
5055
  style: { color: "var(--tpl-text)" }
5053
- }, Pi = {
5056
+ }, Fi = {
5054
5057
  class: "tpl:text-[10px]",
5055
5058
  style: { color: "var(--tpl-text-muted)" }
5056
- }, Fi = { class: "tpl:flex tpl:gap-1 tpl:opacity-0 tpl:transition-opacity tpl:duration-150 tpl:group-hover:opacity-100" }, Ii = ["title", "onClick"], Li = ["title", "onClick"], Ri = {
5059
+ }, Ii = { class: "tpl:flex tpl:gap-1 tpl:opacity-0 tpl:transition-opacity tpl:duration-150 tpl:group-hover:opacity-100" }, Li = ["title", "onClick"], Ri = ["title", "onClick"], zi = {
5057
5060
  key: 0,
5058
5061
  class: "tpl:flex tpl:size-5 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
5059
5062
  style: { "background-color": "var(--tpl-primary)" }
5060
- }, zi = {
5063
+ }, Bi = {
5061
5064
  key: 4,
5062
5065
  class: "tpl:flex tpl:justify-center tpl:py-4"
5063
- }, Bi = /* @__PURE__ */ gr(/* @__PURE__ */ m({
5066
+ }, Vi = /* @__PURE__ */ _r(/* @__PURE__ */ m({
5064
5067
  __name: "MediaGrid",
5065
5068
  props: {
5066
5069
  items: {},
@@ -5086,7 +5089,7 @@ var fi = { class: "tpl:p-4" }, pi = {
5086
5089
  s("select", e);
5087
5090
  }
5088
5091
  let { t: f } = Ae(), m = e(null);
5089
- ci(m, ([{ isIntersecting: e }]) => {
5092
+ li(m, ([{ isIntersecting: e }]) => {
5090
5093
  e && o.hasMore && !o.isLoading && s("loadMore");
5091
5094
  }, { threshold: .1 });
5092
5095
  function g(e) {
@@ -5099,7 +5102,7 @@ var fi = { class: "tpl:p-4" }, pi = {
5099
5102
  day: "numeric"
5100
5103
  });
5101
5104
  }
5102
- return (e, a) => (z(), t("div", fi, [
5105
+ return (e, a) => (z(), t("div", pi, [
5103
5106
  n.isLoading && n.items.length === 0 ? (z(), t("div", {
5104
5107
  key: 0,
5105
5108
  class: k(n.layout === "list" ? "tpl:flex tpl:flex-col tpl:gap-1" : "tpl:grid tpl:grid-cols-4 tpl:gap-3")
@@ -5107,26 +5110,26 @@ var fi = { class: "tpl:p-4" }, pi = {
5107
5110
  key: e,
5108
5111
  class: k(["tpl-pulse tpl:rounded-lg", n.layout === "list" ? "tpl:h-12" : "tpl:aspect-square"]),
5109
5112
  style: { "background-color": "var(--tpl-bg-hover)" }
5110
- }, null, 2)), 64))], 2)) : n.items.length === 0 ? (z(), t("div", pi, [p(j(ce), {
5113
+ }, null, 2)), 64))], 2)) : n.items.length === 0 ? (z(), t("div", mi, [p(j(ce), {
5111
5114
  class: "tpl:mb-3",
5112
5115
  size: 40,
5113
5116
  "stroke-width": 1,
5114
5117
  style: { color: "var(--tpl-text-dim)" }
5115
- }), i("p", mi, L(j(f).mediaLibrary.noFiles), 1)])) : n.layout === "list" ? (z(), t("div", Di, [(z(!0), t(R, null, S(n.items, (e) => (z(), t("div", {
5118
+ }), i("p", hi, L(j(f).mediaLibrary.noFiles), 1)])) : n.layout === "list" ? (z(), t("div", Oi, [(z(!0), t(R, null, S(n.items, (e) => (z(), t("div", {
5116
5119
  key: e.id,
5117
5120
  class: k(["tpl-media-list-item tpl:group tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-3 tpl:rounded-lg tpl:px-3 tpl:py-2 tpl:transition-all tpl:duration-150", [!u(e) && !n.selectedIds.has(e.id) ? "tpl:opacity-60" : ""]]),
5118
5121
  style: P({ backgroundColor: n.selectedIds.has(e.id) ? "var(--tpl-bg-hover)" : "transparent" }),
5119
5122
  onClick: (t) => d(e)
5120
5123
  }, [
5121
- i("div", ki, [j(l)(e.mime_type) ? (z(), t("img", {
5124
+ i("div", Ai, [j(l)(e.mime_type) ? (z(), t("img", {
5122
5125
  key: 0,
5123
5126
  src: e.small_url || e.url,
5124
5127
  alt: e.filename,
5125
5128
  class: "tpl:size-full tpl:object-cover",
5126
5129
  loading: "lazy"
5127
- }, null, 8, Ai)) : (z(), t("div", ji, [p(Mr, { "mime-type": e.mime_type }, null, 8, ["mime-type"])]))]),
5128
- i("div", Mi, [i("p", Ni, L(e.filename), 1), i("p", Pi, [M(L(g(e.size)) + " · " + L(_(e.created_at)) + " ", 1), j(l)(e.mime_type) && e.width && e.height ? (z(), t(R, { key: 0 }, [M(" · " + L(e.width) + "×" + L(e.height), 1)], 64)) : N("", !0)])]),
5129
- i("div", Fi, [i("button", {
5130
+ }, null, 8, ji)) : (z(), t("div", Mi, [p(Nr, { "mime-type": e.mime_type }, null, 8, ["mime-type"])]))]),
5131
+ i("div", Ni, [i("p", Pi, L(e.filename), 1), i("p", Fi, [M(L(g(e.size)) + " · " + L(_(e.created_at)) + " ", 1), j(l)(e.mime_type) && e.width && e.height ? (z(), t(R, { key: 0 }, [M(" · " + L(e.width) + "×" + L(e.height), 1)], 64)) : N("", !0)])]),
5132
+ i("div", Ii, [i("button", {
5130
5133
  class: "tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded",
5131
5134
  style: { color: "var(--tpl-text-muted)" },
5132
5135
  title: j(f).mediaLibrary.editFile,
@@ -5134,7 +5137,7 @@ var fi = { class: "tpl:p-4" }, pi = {
5134
5137
  }, [p(j(me), {
5135
5138
  size: 12,
5136
5139
  "stroke-width": 2
5137
- })], 8, Ii), i("button", {
5140
+ })], 8, Li), i("button", {
5138
5141
  class: "tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded",
5139
5142
  style: { color: "var(--tpl-text-muted)" },
5140
5143
  title: j(f).mediaLibrary.replaceFile,
@@ -5142,12 +5145,12 @@ var fi = { class: "tpl:p-4" }, pi = {
5142
5145
  }, [p(j(O), {
5143
5146
  size: 12,
5144
5147
  "stroke-width": 2
5145
- })], 8, Li)]),
5146
- n.selectedIds.has(e.id) ? (z(), t("div", Ri, [p(j(D), {
5148
+ })], 8, Ri)]),
5149
+ n.selectedIds.has(e.id) ? (z(), t("div", zi, [p(j(D), {
5147
5150
  size: 12,
5148
5151
  "stroke-width": 3
5149
5152
  })])) : N("", !0)
5150
- ], 14, Oi))), 128))])) : (z(), t("div", hi, [(z(!0), t(R, null, S(n.items, (e) => (z(), t("div", {
5153
+ ], 14, ki))), 128))])) : (z(), t("div", gi, [(z(!0), t(R, null, S(n.items, (e) => (z(), t("div", {
5151
5154
  key: e.id,
5152
5155
  class: k(["tpl-media-item tpl:group tpl:relative tpl:overflow-hidden tpl:rounded-lg tpl:border-2 tpl:transition-all tpl:duration-150", [
5153
5156
  "tpl:cursor-pointer",
@@ -5160,18 +5163,18 @@ var fi = { class: "tpl:p-4" }, pi = {
5160
5163
  }),
5161
5164
  onClick: (t) => d(e)
5162
5165
  }, [
5163
- i("div", _i, [j(l)(e.mime_type) ? (z(), t("img", {
5166
+ i("div", vi, [j(l)(e.mime_type) ? (z(), t("img", {
5164
5167
  key: 0,
5165
5168
  src: e.small_url || e.url,
5166
5169
  alt: e.filename,
5167
5170
  class: "tpl:size-full tpl:object-cover",
5168
5171
  loading: "lazy"
5169
- }, null, 8, vi)) : (z(), h(Mr, {
5172
+ }, null, 8, yi)) : (z(), h(Nr, {
5170
5173
  key: 1,
5171
5174
  "mime-type": e.mime_type
5172
5175
  }, null, 8, ["mime-type"]))]),
5173
- i("div", yi, [i("p", bi, L(e.filename), 1), i("p", xi, [i("span", null, L(g(e.size)), 1), j(l)(e.mime_type) && e.width && e.height ? (z(), t("span", Si, L(e.width) + "×" + L(e.height), 1)) : N("", !0)])]),
5174
- i("div", Ci, [i("button", {
5176
+ i("div", bi, [i("p", xi, L(e.filename), 1), i("p", Si, [i("span", null, L(g(e.size)), 1), j(l)(e.mime_type) && e.width && e.height ? (z(), t("span", Ci, L(e.width) + "×" + L(e.height), 1)) : N("", !0)])]),
5177
+ i("div", wi, [i("button", {
5175
5178
  class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
5176
5179
  style: { "background-color": "rgba(0, 0, 0, 0.6)" },
5177
5180
  title: j(f).mediaLibrary.editFile,
@@ -5179,7 +5182,7 @@ var fi = { class: "tpl:p-4" }, pi = {
5179
5182
  }, [p(j(me), {
5180
5183
  size: 11,
5181
5184
  "stroke-width": 2
5182
- })], 8, wi), i("button", {
5185
+ })], 8, Ti), i("button", {
5183
5186
  class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
5184
5187
  style: { "background-color": "rgba(0, 0, 0, 0.6)" },
5185
5188
  title: j(f).mediaLibrary.replaceFile,
@@ -5187,18 +5190,18 @@ var fi = { class: "tpl:p-4" }, pi = {
5187
5190
  }, [p(j(O), {
5188
5191
  size: 11,
5189
5192
  "stroke-width": 2
5190
- })], 8, Ti)]),
5191
- n.selectedIds.has(e.id) ? (z(), t("div", Ei, [p(j(D), {
5193
+ })], 8, Ei)]),
5194
+ n.selectedIds.has(e.id) ? (z(), t("div", Di, [p(j(D), {
5192
5195
  size: 12,
5193
5196
  "stroke-width": 3
5194
5197
  })])) : N("", !0)
5195
- ], 14, gi))), 128))])),
5198
+ ], 14, _i))), 128))])),
5196
5199
  i("div", {
5197
5200
  ref_key: "sentinelRef",
5198
5201
  ref: m,
5199
5202
  class: "tpl:h-4"
5200
5203
  }, null, 512),
5201
- n.isLoading && n.items.length > 0 ? (z(), t("div", zi, [p(j(se), {
5204
+ n.isLoading && n.items.length > 0 ? (z(), t("div", Bi, [p(j(se), {
5202
5205
  class: "tpl-spinner",
5203
5206
  size: 20,
5204
5207
  "stroke-width": 2,
@@ -5206,20 +5209,20 @@ var fi = { class: "tpl:p-4" }, pi = {
5206
5209
  })])) : N("", !0)
5207
5210
  ]));
5208
5211
  }
5209
- }), [["__scopeId", "data-v-9db961d1"]]), Vi = ["data-tpl-theme"], Hi = {
5212
+ }), [["__scopeId", "data-v-9db961d1"]]), Hi = ["data-tpl-theme"], Ui = {
5210
5213
  class: "tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-lg tpl:p-5 tpl:shadow-xl",
5211
5214
  style: { "background-color": "var(--tpl-bg-elevated)" }
5212
- }, Ui = {
5215
+ }, Wi = {
5213
5216
  class: "tpl:mb-4 tpl:text-sm tpl:font-semibold",
5214
5217
  style: { color: "var(--tpl-text)" }
5215
- }, Wi = { class: "tpl:mb-3" }, Gi = ["placeholder", "disabled"], Ki = {
5218
+ }, Gi = { class: "tpl:mb-3" }, Ki = ["placeholder", "disabled"], qi = {
5216
5219
  key: 0,
5217
5220
  class: "tpl:mb-3 tpl:text-xs",
5218
5221
  style: { color: "var(--tpl-danger)" }
5219
- }, qi = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Ji = ["disabled"], Yi = ["disabled"], Xi = {
5222
+ }, Ji = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Yi = ["disabled"], Xi = ["disabled"], Zi = {
5220
5223
  key: 0,
5221
5224
  class: "tpl:flex tpl:items-center tpl:gap-1.5"
5222
- }, Zi = { key: 1 }, Qi = /* @__PURE__ */ m({
5225
+ }, Qi = { key: 1 }, $i = /* @__PURE__ */ m({
5223
5226
  __name: "MediaImportUrlModal",
5224
5227
  props: {
5225
5228
  visible: { type: Boolean },
@@ -5228,21 +5231,21 @@ var fi = { class: "tpl:p-4" }, pi = {
5228
5231
  },
5229
5232
  emits: ["import", "close"],
5230
5233
  setup(n, { emit: a }) {
5231
- let o = n, c = a, { t: d } = Ae(), f = l("tplUiTheme"), m = e("");
5234
+ let o = n, c = a, { t: d } = Ae(), f = l("tplUiTheme"), m = l(Ve, e(null)), g = e("");
5232
5235
  s(() => o.visible, (e) => {
5233
- e && (m.value = "");
5236
+ e && (g.value = "");
5234
5237
  });
5235
- function g() {
5236
- let e = m.value.trim();
5238
+ function _() {
5239
+ let e = g.value.trim();
5237
5240
  !e || o.isImporting || c("import", e);
5238
5241
  }
5239
- function _() {
5242
+ function v() {
5240
5243
  o.isImporting || c("close");
5241
5244
  }
5242
- function v(e) {
5243
- e.key === "Enter" && (e.preventDefault(), g()), e.key === "Escape" && _();
5245
+ function y(e) {
5246
+ e.key === "Enter" && (e.preventDefault(), _()), e.key === "Escape" && v();
5244
5247
  }
5245
- return (e, a) => (z(), h(b, { to: "body" }, [p(ve, {
5248
+ return (e, a) => (z(), h(b, { to: j(m) || "body" }, [p(ve, {
5246
5249
  "enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
5247
5250
  "enter-from-class": "tpl:opacity-0",
5248
5251
  "enter-to-class": "tpl:opacity-100",
@@ -5255,12 +5258,12 @@ var fi = { class: "tpl:p-4" }, pi = {
5255
5258
  "data-tpl-theme": j(f),
5256
5259
  class: "tpl tpl:fixed tpl:inset-0 tpl:z-[10000] tpl:flex tpl:items-center tpl:justify-center",
5257
5260
  style: { "background-color": "var(--tpl-overlay)" },
5258
- onClick: r(_, ["self"]),
5259
- onKeydown: v
5260
- }, [i("div", Hi, [
5261
- i("h3", Ui, L(j(d).mediaLibrary.importFromUrl), 1),
5262
- i("div", Wi, [u(i("input", {
5263
- "onUpdate:modelValue": a[0] ||= (e) => m.value = e,
5261
+ onClick: r(v, ["self"]),
5262
+ onKeydown: y
5263
+ }, [i("div", Ui, [
5264
+ i("h3", Wi, L(j(d).mediaLibrary.importFromUrl), 1),
5265
+ i("div", Gi, [u(i("input", {
5266
+ "onUpdate:modelValue": a[0] ||= (e) => g.value = e,
5264
5267
  type: "url",
5265
5268
  class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
5266
5269
  style: {
@@ -5271,9 +5274,9 @@ var fi = { class: "tpl:p-4" }, pi = {
5271
5274
  placeholder: j(d).mediaLibrary.importUrlPlaceholder,
5272
5275
  disabled: n.isImporting,
5273
5276
  autofocus: ""
5274
- }, null, 8, Gi), [[ee, m.value]])]),
5275
- n.error ? (z(), t("p", Ki, L(n.error), 1)) : N("", !0),
5276
- i("div", qi, [i("button", {
5277
+ }, null, 8, Ki), [[ee, g.value]])]),
5278
+ n.error ? (z(), t("p", qi, L(n.error), 1)) : N("", !0),
5279
+ i("div", Ji, [i("button", {
5277
5280
  class: k(["tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150", { "tpl:cursor-not-allowed tpl:opacity-50": n.isImporting }]),
5278
5281
  style: {
5279
5282
  "border-color": "var(--tpl-border)",
@@ -5281,26 +5284,26 @@ var fi = { class: "tpl:p-4" }, pi = {
5281
5284
  "background-color": "var(--tpl-bg)"
5282
5285
  },
5283
5286
  disabled: n.isImporting,
5284
- onClick: _
5285
- }, L(j(d).mediaLibrary.cancel), 11, Ji), i("button", {
5287
+ onClick: v
5288
+ }, L(j(d).mediaLibrary.cancel), 11, Yi), i("button", {
5286
5289
  class: "tpl:cursor-pointer tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:text-white tpl:transition-all tpl:duration-150 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
5287
5290
  style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
5288
- disabled: !m.value.trim() || n.isImporting,
5289
- onClick: g
5290
- }, [n.isImporting ? (z(), t("span", Xi, [p(j(se), {
5291
+ disabled: !g.value.trim() || n.isImporting,
5292
+ onClick: _
5293
+ }, [n.isImporting ? (z(), t("span", Zi, [p(j(se), {
5291
5294
  class: "tpl:animate-spin",
5292
5295
  size: 12,
5293
5296
  "stroke-width": 2
5294
- }), M(" " + L(j(d).mediaLibrary.importing), 1)])) : (z(), t("span", Zi, L(j(d).mediaLibrary.import), 1))], 8, Yi)])
5295
- ])], 40, Vi)) : N("", !0)]),
5297
+ }), M(" " + L(j(d).mediaLibrary.importing), 1)])) : (z(), t("span", Qi, L(j(d).mediaLibrary.import), 1))], 8, Xi)])
5298
+ ])], 40, Hi)) : N("", !0)]),
5296
5299
  _: 1
5297
- })]));
5300
+ })], 8, ["to"]));
5298
5301
  }
5299
- }), $i = { class: "tpl:max-h-56 tpl:overflow-y-auto tpl:py-1" }, ea = ["disabled", "onClick"], ta = { class: "tpl:truncate" }, na = {
5302
+ }), ea = { class: "tpl:max-h-56 tpl:overflow-y-auto tpl:py-1" }, ta = ["disabled", "onClick"], na = { class: "tpl:truncate" }, ra = {
5300
5303
  key: 0,
5301
5304
  class: "tpl:shrink-0",
5302
5305
  style: { color: "var(--tpl-text-dim)" }
5303
- }, ra = /* @__PURE__ */ m({
5306
+ }, ia = /* @__PURE__ */ m({
5304
5307
  __name: "MediaMovePicker",
5305
5308
  props: {
5306
5309
  folders: {},
@@ -5318,7 +5321,7 @@ var fi = { class: "tpl:p-4" }, pi = {
5318
5321
  }), r.children?.length && n.push(...c(r.children, t + 1));
5319
5322
  return n;
5320
5323
  }
5321
- return ni(s, () => {
5324
+ return ri(s, () => {
5322
5325
  a("close");
5323
5326
  }), (e, r) => (z(), t("div", {
5324
5327
  ref_key: "pickerRef",
@@ -5328,7 +5331,7 @@ var fi = { class: "tpl:p-4" }, pi = {
5328
5331
  "border-color": "var(--tpl-border)",
5329
5332
  "background-color": "var(--tpl-bg-elevated)"
5330
5333
  }
5331
- }, [i("div", $i, [n.currentFolderId === null ? N("", !0) : (z(), t("button", {
5334
+ }, [i("div", ea, [n.currentFolderId === null ? N("", !0) : (z(), t("button", {
5332
5335
  key: 0,
5333
5336
  class: "tpl:flex tpl:w-full tpl:items-center tpl:gap-1.5 tpl:px-3 tpl:py-1.5 tpl:text-left tpl:text-xs tpl:transition-colors tpl:duration-100",
5334
5337
  style: { color: "var(--tpl-text)" },
@@ -5353,27 +5356,27 @@ var fi = { class: "tpl:p-4" }, pi = {
5353
5356
  size: 14,
5354
5357
  "stroke-width": 1.5
5355
5358
  }),
5356
- i("span", ta, L(e.name), 1),
5357
- e.id === n.currentFolderId ? (z(), t("span", na, L(j(o).mediaLibrary.currentFolder), 1)) : N("", !0)
5358
- ], 12, ea))), 128))])], 512));
5359
+ i("span", na, L(e.name), 1),
5360
+ e.id === n.currentFolderId ? (z(), t("span", ra, L(j(o).mediaLibrary.currentFolder), 1)) : N("", !0)
5361
+ ], 12, ta))), 128))])], 512));
5359
5362
  }
5360
- }), ia = { class: "tpl:flex tpl:items-center tpl:gap-3" }, aa = ["src", "alt"], oa = {
5363
+ }), aa = { class: "tpl:flex tpl:items-center tpl:gap-3" }, oa = ["src", "alt"], sa = {
5361
5364
  key: 1,
5362
5365
  class: "tpl:flex tpl:size-10 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:overflow-hidden tpl:rounded",
5363
5366
  style: { border: "1px solid var(--tpl-border)" }
5364
- }, sa = { class: "tpl:min-w-0 tpl:flex-1" }, ca = {
5367
+ }, ca = { class: "tpl:min-w-0 tpl:flex-1" }, la = {
5365
5368
  class: "tpl:truncate tpl:text-xs tpl:font-medium",
5366
5369
  style: { color: "var(--tpl-text)" }
5367
- }, la = {
5370
+ }, ua = {
5368
5371
  class: "tpl:mt-0.5 tpl:text-[10px]",
5369
5372
  style: { color: "var(--tpl-text-muted)" }
5370
- }, ua = {
5373
+ }, da = {
5371
5374
  key: 2,
5372
5375
  class: "tpl:shrink-0"
5373
- }, da = {
5376
+ }, fa = {
5374
5377
  class: "tpl:block tpl:text-[10px]",
5375
5378
  style: { color: "var(--tpl-text-muted)" }
5376
- }, fa = ["value"], pa = ["value"], ma = /* @__PURE__ */ gr(/* @__PURE__ */ m({
5379
+ }, pa = ["value"], ma = ["value"], ha = /* @__PURE__ */ _r(/* @__PURE__ */ m({
5377
5380
  __name: "MediaPreviewPanel",
5378
5381
  props: {
5379
5382
  item: {},
@@ -5441,20 +5444,20 @@ var fi = { class: "tpl:p-4" }, pi = {
5441
5444
  day: "numeric"
5442
5445
  });
5443
5446
  }
5444
- return (n, r) => (z(), t("div", ia, [
5447
+ return (n, r) => (z(), t("div", aa, [
5445
5448
  g.value ? (z(), t("img", {
5446
5449
  key: 0,
5447
5450
  src: d.value ?? void 0,
5448
5451
  alt: e.item.alt_text || e.item.filename,
5449
5452
  class: "tpl:size-10 tpl:shrink-0 tpl:rounded tpl:object-cover",
5450
5453
  style: { border: "1px solid var(--tpl-border)" }
5451
- }, null, 8, aa)) : (z(), t("div", oa, [p(Mr, {
5454
+ }, null, 8, oa)) : (z(), t("div", sa, [p(Nr, {
5452
5455
  "mime-type": e.item.mime_type,
5453
5456
  class: "tpl-preview-icon"
5454
5457
  }, null, 8, ["mime-type"])])),
5455
- i("div", sa, [
5456
- i("p", ca, L(e.item.filename), 1),
5457
- i("p", la, [
5458
+ i("div", ca, [
5459
+ i("p", la, L(e.item.filename), 1),
5460
+ i("p", ua, [
5458
5461
  M(L(_(e.item.size)) + " · " + L(v(e.item.created_at)) + " ", 1),
5459
5462
  g.value && e.item.width && e.item.height ? (z(), t(R, { key: 0 }, [M(" · " + L(e.item.width) + "×" + L(e.item.height) + "px ", 1)], 64)) : N("", !0),
5460
5463
  h.value ? (z(), t(R, { key: 1 }, [
@@ -5473,7 +5476,7 @@ var fi = { class: "tpl:p-4" }, pi = {
5473
5476
  style: { color: "var(--tpl-text-dim)" }
5474
5477
  }, L(e.item.alt_text || "\xA0"), 3)) : N("", !0)
5475
5478
  ]),
5476
- u.value ? (z(), t("div", ua, [i("label", da, L(j(s).mediaLibrary.conversionLabel), 1), i("select", {
5479
+ u.value ? (z(), t("div", da, [i("label", fa, L(j(s).mediaLibrary.conversionLabel), 1), i("select", {
5477
5480
  class: "tpl:mt-0.5 tpl:rounded-md tpl:border tpl:py-1 tpl:pr-6 tpl:pl-2 tpl:text-xs tpl:outline-none",
5478
5481
  style: {
5479
5482
  "border-color": "var(--tpl-border)",
@@ -5485,36 +5488,36 @@ var fi = { class: "tpl:p-4" }, pi = {
5485
5488
  }, [(z(!0), t(R, null, S(l.value, (e) => (z(), t("option", {
5486
5489
  key: e.value,
5487
5490
  value: e.value
5488
- }, L(e.label), 9, pa))), 128))], 40, fa)])) : N("", !0)
5491
+ }, L(e.label), 9, ma))), 128))], 40, pa)])) : N("", !0)
5489
5492
  ]));
5490
5493
  }
5491
- }), [["__scopeId", "data-v-060e36cd"]]), ha = ["data-tpl-theme"], ga = {
5494
+ }), [["__scopeId", "data-v-060e36cd"]]), ga = ["data-tpl-theme"], _a = {
5492
5495
  class: "tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-lg tpl:p-5 tpl:shadow-xl",
5493
5496
  style: { "background-color": "var(--tpl-bg-elevated)" }
5494
- }, _a = {
5497
+ }, va = {
5495
5498
  class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
5496
5499
  style: { color: "var(--tpl-text)" }
5497
- }, va = {
5500
+ }, ya = {
5498
5501
  class: "tpl:mb-2 tpl:text-xs",
5499
5502
  style: { color: "var(--tpl-text-muted)" }
5500
- }, ya = {
5503
+ }, ba = {
5501
5504
  key: 0,
5502
5505
  class: "tpl:mb-3 tpl:text-xs",
5503
5506
  style: { color: "var(--tpl-warning)" }
5504
- }, ba = {
5507
+ }, xa = {
5505
5508
  class: "tpl:mb-3 tpl:rounded tpl:border tpl:p-2",
5506
5509
  style: { "border-color": "var(--tpl-border)" }
5507
- }, xa = {
5510
+ }, Sa = {
5508
5511
  class: "tpl:truncate tpl:text-xs tpl:font-medium",
5509
5512
  style: { color: "var(--tpl-text)" }
5510
- }, Sa = { class: "tpl:mb-4" }, Ca = {
5513
+ }, Ca = { class: "tpl:mb-4" }, wa = {
5511
5514
  class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
5512
5515
  style: { color: "var(--tpl-text-muted)" }
5513
- }, wa = ["accept"], Ta = {
5516
+ }, Ta = ["accept"], Ea = {
5514
5517
  key: 1,
5515
5518
  class: "tpl:mb-3 tpl:text-xs",
5516
5519
  style: { color: "var(--tpl-danger)" }
5517
- }, Ea = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Da = ["disabled"], Oa = ["disabled"], ka = /* @__PURE__ */ m({
5520
+ }, Da = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Oa = ["disabled"], ka = ["disabled"], Aa = /* @__PURE__ */ m({
5518
5521
  __name: "MediaReplaceModal",
5519
5522
  props: {
5520
5523
  visible: { type: Boolean },
@@ -5525,25 +5528,25 @@ var fi = { class: "tpl:p-4" }, pi = {
5525
5528
  },
5526
5529
  emits: ["replace", "close"],
5527
5530
  setup(n, { emit: o }) {
5528
- let c = n, u = o, { t: d } = Ae(), f = l("tplUiTheme"), m = e(null), g = e(null), _ = a(() => {
5531
+ let c = n, u = o, { t: d } = Ae(), f = l("tplUiTheme"), m = l(Ve, e(null)), g = e(null), _ = e(null), v = a(() => {
5529
5532
  if (!c.item) return "";
5530
5533
  let e = c.item.filename.split(".");
5531
5534
  return e.length > 1 ? e[e.length - 1].toLowerCase() : "";
5532
- }), v = a(() => _.value ? `.${_.value}` : "*"), y = a(() => (c.usageInfo?.template_count ?? 0) > 0);
5535
+ }), y = a(() => v.value ? `.${v.value}` : "*"), x = a(() => (c.usageInfo?.template_count ?? 0) > 0);
5533
5536
  s(() => c.visible, (e) => {
5534
- e || (g.value = null, m.value && (m.value.value = ""));
5537
+ e || (_.value = null, g.value && (g.value.value = ""));
5535
5538
  });
5536
- function x(e) {
5539
+ function S(e) {
5537
5540
  let t = e.target;
5538
- t.files && t.files.length > 0 && (g.value = t.files[0]);
5541
+ t.files && t.files.length > 0 && (_.value = t.files[0]);
5539
5542
  }
5540
- function S() {
5541
- g.value && u("replace", g.value);
5543
+ function C() {
5544
+ _.value && u("replace", _.value);
5542
5545
  }
5543
- function C(e) {
5546
+ function w(e) {
5544
5547
  e.key === "Escape" && u("close");
5545
5548
  }
5546
- return (e, a) => (z(), h(b, { to: "body" }, [p(ve, {
5549
+ return (e, a) => (z(), h(b, { to: j(m) || "body" }, [p(ve, {
5547
5550
  "enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
5548
5551
  "enter-from-class": "tpl:opacity-0",
5549
5552
  "enter-to-class": "tpl:opacity-100",
@@ -5557,27 +5560,27 @@ var fi = { class: "tpl:p-4" }, pi = {
5557
5560
  class: "tpl tpl:fixed tpl:inset-0 tpl:z-[10000] tpl:flex tpl:items-center tpl:justify-center",
5558
5561
  style: { "background-color": "var(--tpl-overlay)" },
5559
5562
  onClick: a[1] ||= r((e) => u("close"), ["self"]),
5560
- onKeydown: C
5561
- }, [i("div", ga, [
5562
- i("h3", _a, L(j(d).mediaLibrary.replaceWarningTitle), 1),
5563
- i("p", va, L(j(d).mediaLibrary.replaceWarningMessage.replace("{extension}", `.${_.value}`)), 1),
5564
- y.value ? (z(), t("p", ya, L(j(d).mediaLibrary.replaceWarningUsageNote.replace("{count}", n.usageInfo.template_count.toString())), 1)) : N("", !0),
5565
- i("div", ba, [i("p", xa, L(n.item.filename), 1)]),
5566
- i("div", Sa, [i("label", Ca, L(j(d).mediaLibrary.replaceSelectFile), 1), i("input", {
5563
+ onKeydown: w
5564
+ }, [i("div", _a, [
5565
+ i("h3", va, L(j(d).mediaLibrary.replaceWarningTitle), 1),
5566
+ i("p", ya, L(j(d).mediaLibrary.replaceWarningMessage.replace("{extension}", `.${v.value}`)), 1),
5567
+ x.value ? (z(), t("p", ba, L(j(d).mediaLibrary.replaceWarningUsageNote.replace("{count}", n.usageInfo.template_count.toString())), 1)) : N("", !0),
5568
+ i("div", xa, [i("p", Sa, L(n.item.filename), 1)]),
5569
+ i("div", Ca, [i("label", wa, L(j(d).mediaLibrary.replaceSelectFile), 1), i("input", {
5567
5570
  ref_key: "fileInputRef",
5568
- ref: m,
5571
+ ref: g,
5569
5572
  type: "file",
5570
- accept: v.value,
5573
+ accept: y.value,
5571
5574
  class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs",
5572
5575
  style: {
5573
5576
  "border-color": "var(--tpl-border)",
5574
5577
  "background-color": "var(--tpl-bg)",
5575
5578
  color: "var(--tpl-text)"
5576
5579
  },
5577
- onChange: x
5578
- }, null, 40, wa)]),
5579
- n.error ? (z(), t("p", Ta, L(n.error), 1)) : N("", !0),
5580
- i("div", Ea, [i("button", {
5580
+ onChange: S
5581
+ }, null, 40, Ta)]),
5582
+ n.error ? (z(), t("p", Ea, L(n.error), 1)) : N("", !0),
5583
+ i("div", Da, [i("button", {
5581
5584
  class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
5582
5585
  style: {
5583
5586
  "border-color": "var(--tpl-border)",
@@ -5586,29 +5589,29 @@ var fi = { class: "tpl:p-4" }, pi = {
5586
5589
  },
5587
5590
  disabled: n.isReplacing,
5588
5591
  onClick: a[0] ||= (e) => u("close")
5589
- }, L(j(d).mediaLibrary.cancel), 9, Da), i("button", {
5592
+ }, L(j(d).mediaLibrary.cancel), 9, Oa), i("button", {
5590
5593
  class: "tpl:cursor-pointer tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:text-white tpl:transition-all tpl:duration-150 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
5591
5594
  style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
5592
- disabled: !g.value || n.isReplacing,
5593
- onClick: S
5594
- }, L(n.isReplacing ? j(d).mediaLibrary.replacing : j(d).mediaLibrary.replace), 9, Oa)])
5595
- ])], 40, ha)) : N("", !0)]),
5595
+ disabled: !_.value || n.isReplacing,
5596
+ onClick: C
5597
+ }, L(n.isReplacing ? j(d).mediaLibrary.replacing : j(d).mediaLibrary.replace), 9, ka)])
5598
+ ])], 40, ga)) : N("", !0)]),
5596
5599
  _: 1
5597
- })]));
5600
+ })], 8, ["to"]));
5598
5601
  }
5599
- }), Aa = {
5602
+ }), ja = {
5600
5603
  key: 0,
5601
5604
  class: "tpl:flex tpl:items-center tpl:gap-2"
5602
- }, ja = {
5603
- class: "tpl:text-xs",
5604
- style: { color: "var(--tpl-text-muted)" }
5605
5605
  }, Ma = {
5606
5606
  class: "tpl:text-xs",
5607
5607
  style: { color: "var(--tpl-text-muted)" }
5608
5608
  }, Na = {
5609
+ class: "tpl:text-xs",
5610
+ style: { color: "var(--tpl-text-muted)" }
5611
+ }, Pa = {
5609
5612
  class: "tpl:mt-1 tpl:text-[10px]",
5610
5613
  style: { color: "var(--tpl-text-dim)" }
5611
- }, Pa = /* @__PURE__ */ m({
5614
+ }, Fa = /* @__PURE__ */ m({
5612
5615
  __name: "MediaUploadZone",
5613
5616
  props: {
5614
5617
  isUploading: { type: Boolean },
@@ -5626,9 +5629,9 @@ var fi = { class: "tpl:p-4" }, pi = {
5626
5629
  let t = f(e);
5627
5630
  t.length && a("upload", t);
5628
5631
  }
5629
- let { isOverDropZone: h } = si(d, { onDrop: (e) => {
5632
+ let { isOverDropZone: h } = ci(d, { onDrop: (e) => {
5630
5633
  e?.length && m(e);
5631
- } }), { open: g, onChange: _ } = di({
5634
+ } }), { open: g, onChange: _ } = fi({
5632
5635
  accept: l.value,
5633
5636
  multiple: !0
5634
5637
  });
@@ -5643,12 +5646,12 @@ var fi = { class: "tpl:p-4" }, pi = {
5643
5646
  "background-color": "var(--tpl-bg)"
5644
5647
  },
5645
5648
  onClick: r[0] ||= (e) => j(g)()
5646
- }, [n.isUploading ? (z(), t("div", Aa, [p(j(se), {
5649
+ }, [n.isUploading ? (z(), t("div", ja, [p(j(se), {
5647
5650
  class: "tpl-spinner",
5648
5651
  size: 20,
5649
5652
  "stroke-width": 2,
5650
5653
  style: { color: "var(--tpl-primary)" }
5651
- }), i("span", ja, L(n.uploadProgress && n.uploadProgress.total > 1 ? j(s)(j(o).mediaLibrary.uploadingProgress, {
5654
+ }), i("span", Ma, L(n.uploadProgress && n.uploadProgress.total > 1 ? j(s)(j(o).mediaLibrary.uploadingProgress, {
5652
5655
  current: n.uploadProgress.current,
5653
5656
  total: n.uploadProgress.total
5654
5657
  }) : j(o).mediaLibrary.uploading), 1)])) : (z(), t(R, { key: 1 }, [
@@ -5658,20 +5661,20 @@ var fi = { class: "tpl:p-4" }, pi = {
5658
5661
  "stroke-width": 1.5,
5659
5662
  style: { color: "var(--tpl-text-dim)" }
5660
5663
  }),
5661
- i("p", Ma, L(j(o).mediaLibrary.dropOrClick), 1),
5662
- i("p", Na, L(j(o).mediaLibrary.acceptedFormats), 1)
5664
+ i("p", Na, L(j(o).mediaLibrary.dropOrClick), 1),
5665
+ i("p", Pa, L(j(o).mediaLibrary.acceptedFormats), 1)
5663
5666
  ], 64))], 2));
5664
5667
  }
5665
- }), Fa = [
5668
+ }), Ia = [
5666
5669
  "width",
5667
5670
  "height",
5668
5671
  "viewBox"
5669
- ], Ia = [
5672
+ ], La = [
5670
5673
  "cx",
5671
5674
  "cy",
5672
5675
  "r",
5673
5676
  "stroke-width"
5674
- ], La = [
5677
+ ], Ra = [
5675
5678
  "cx",
5676
5679
  "cy",
5677
5680
  "r",
@@ -5679,14 +5682,14 @@ var fi = { class: "tpl:p-4" }, pi = {
5679
5682
  "stroke",
5680
5683
  "stroke-dasharray",
5681
5684
  "stroke-dashoffset"
5682
- ], Ra = {
5685
+ ], za = {
5683
5686
  key: 0,
5684
5687
  class: "tpl:absolute tpl:top-full tpl:left-1/2 tpl:z-50 tpl:mt-2 tpl:-translate-x-1/2 tpl:rounded-md tpl:px-2.5 tpl:py-1.5 tpl:text-xs tpl:whitespace-nowrap tpl:shadow-lg",
5685
5688
  style: {
5686
5689
  "background-color": "var(--tpl-text)",
5687
5690
  color: "var(--tpl-bg-elevated)"
5688
5691
  }
5689
- }, za = /* @__PURE__ */ m({
5692
+ }, Ba = /* @__PURE__ */ m({
5690
5693
  __name: "StorageProgressRing",
5691
5694
  props: {
5692
5695
  usedBytes: {},
@@ -5726,7 +5729,7 @@ var fi = { class: "tpl:p-4" }, pi = {
5726
5729
  fill: "none",
5727
5730
  "stroke-width": u.value,
5728
5731
  style: { stroke: "var(--tpl-border)" }
5729
- }, null, 8, Ia), i("circle", {
5732
+ }, null, 8, La), i("circle", {
5730
5733
  cx: l.value / 2,
5731
5734
  cy: l.value / 2,
5732
5735
  r: d.value,
@@ -5737,7 +5740,7 @@ var fi = { class: "tpl:p-4" }, pi = {
5737
5740
  "stroke-dasharray": f.value,
5738
5741
  "stroke-dashoffset": h.value,
5739
5742
  class: "tpl:transition-all tpl:duration-300 tpl:ease-out"
5740
- }, null, 8, La)], 8, Fa)), p(ve, {
5743
+ }, null, 8, Ra)], 8, Ia)), p(ve, {
5741
5744
  "enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
5742
5745
  "enter-from-class": "tpl:opacity-0 tpl:translate-y-1",
5743
5746
  "enter-to-class": "tpl:opacity-100 tpl:translate-y-0",
@@ -5745,14 +5748,14 @@ var fi = { class: "tpl:p-4" }, pi = {
5745
5748
  "leave-from-class": "tpl:opacity-100 tpl:translate-y-0",
5746
5749
  "leave-to-class": "tpl:opacity-0 tpl:translate-y-1"
5747
5750
  }, {
5748
- default: F(() => [c.value ? (z(), t("div", Ra, [M(L(S.value) + " ", 1), n[2] ||= i("div", {
5751
+ default: F(() => [c.value ? (z(), t("div", za, [M(L(S.value) + " ", 1), n[2] ||= i("div", {
5749
5752
  class: "tpl:absolute tpl:-top-1 tpl:left-1/2 tpl:size-2 tpl:-translate-x-1/2 tpl:rotate-45",
5750
5753
  style: { "background-color": "var(--tpl-text)" }
5751
5754
  }, null, -1)])) : N("", !0)]),
5752
5755
  _: 1
5753
5756
  })], 32));
5754
5757
  }
5755
- }), Ba = class {
5758
+ }), Va = class {
5756
5759
  constructor(e) {
5757
5760
  this.authManager = e;
5758
5761
  }
@@ -5908,9 +5911,9 @@ var fi = { class: "tpl:p-4" }, pi = {
5908
5911
  };
5909
5912
  //#endregion
5910
5913
  //#region src/composable.ts
5911
- function Va(t) {
5914
+ function Ha(t) {
5912
5915
  if (!t.projectId) throw Error("projectId is required for useMediaLibrary");
5913
- let n = new Ba(t.authManager), r = e([]), i = e([]), a = e(null), o = e("files"), s = e(""), c = e(null), l = e("newest"), u = e(!1), d = e(!1), f = e(!1), p = e(null), m = e(null), h = e(/* @__PURE__ */ new Set()), g = e(null), _ = e([]), v = e({}), y = e(!1), b = e([]), x = e(!1), S = e(null), C = e(!1), w = e(null), T = e(!1), E = e(null), D = e(null), O = 0;
5916
+ let n = new Va(t.authManager), r = e([]), i = e([]), a = e(null), o = e("files"), s = e(""), c = e(null), l = e("newest"), u = e(!1), d = e(!1), f = e(!1), p = e(null), m = e(null), h = e(/* @__PURE__ */ new Set()), g = e(null), _ = e([]), v = e({}), y = e(!1), b = e([]), x = e(!1), S = e(null), C = e(!1), w = e(null), T = e(!1), E = e(null), D = e(null), O = 0;
5914
5917
  async function k() {
5915
5918
  let e = ++O;
5916
5919
  u.value = !0;
@@ -5951,16 +5954,16 @@ function Va(t) {
5951
5954
  e === O && (u.value = !1);
5952
5955
  }
5953
5956
  }
5954
- async function A(e) {
5957
+ async function te(e) {
5955
5958
  s.value = e, await k();
5956
5959
  }
5957
- async function te(e) {
5960
+ async function ne(e) {
5958
5961
  c.value = e, await k();
5959
5962
  }
5960
- async function ne(e) {
5963
+ async function re(e) {
5961
5964
  l.value = e, await k();
5962
5965
  }
5963
- async function re(e) {
5966
+ async function A(e) {
5964
5967
  o.value = "files", a.value = e, s.value = "", h.value = /* @__PURE__ */ new Set(), g.value = null, await k();
5965
5968
  }
5966
5969
  async function ie() {
@@ -6165,10 +6168,10 @@ function Va(t) {
6165
6168
  showDeleteWarning: y,
6166
6169
  loadItems: k,
6167
6170
  loadMore: ee,
6168
- search: A,
6169
- filterByCategory: te,
6170
- sortBy: ne,
6171
- navigateToFolder: re,
6171
+ search: te,
6172
+ filterByCategory: ne,
6173
+ sortBy: re,
6174
+ navigateToFolder: A,
6172
6175
  showFrequentlyUsed: ie,
6173
6176
  uploadFile: ae,
6174
6177
  uploadFiles: oe,
@@ -6203,7 +6206,7 @@ function Va(t) {
6203
6206
  }
6204
6207
  //#endregion
6205
6208
  //#region src/composables/useMediaLibraryUI.ts
6206
- function Ha(t) {
6209
+ function Ua(t) {
6207
6210
  let { library: n, canUseMediaFolders: r, translations: i } = t;
6208
6211
  function o() {
6209
6212
  return "value" in i && typeof i.value == "object" ? i.value : i;
@@ -6231,13 +6234,13 @@ function Ha(t) {
6231
6234
  }), s(() => n.previewItem.value?.id, () => {
6232
6235
  d.value = "original";
6233
6236
  });
6234
- let x = qr((e) => {
6237
+ let x = Jr((e) => {
6235
6238
  n.search(e);
6236
6239
  }, 300);
6237
6240
  function S(e) {
6238
6241
  u.value = e, x(e);
6239
6242
  }
6240
- let { copy: C, copied: w } = oi({
6243
+ let { copy: C, copied: w } = si({
6241
6244
  copiedDuring: 2e3,
6242
6245
  legacy: !0
6243
6246
  });
@@ -6259,16 +6262,16 @@ function Ha(t) {
6259
6262
  function ee(e) {
6260
6263
  f.value = e;
6261
6264
  }
6262
- async function A(e, t, r, i) {
6265
+ async function te(e, t, r, i) {
6263
6266
  i && await n.replaceMediaDirectly(e, i.file), await n.updateFile(e, t, r), f.value = null;
6264
6267
  }
6265
- async function te(e) {
6268
+ async function ne(e) {
6266
6269
  await n.importFromUrl(e) && (p.value = !1);
6267
6270
  }
6268
- async function ne(e) {
6271
+ async function re(e) {
6269
6272
  m.value = !1, await n.moveSelected(e);
6270
6273
  }
6271
- async function re() {
6274
+ async function A() {
6272
6275
  await n.checkUsageBeforeDelete();
6273
6276
  }
6274
6277
  function ie(e) {
@@ -6302,10 +6305,10 @@ function Ha(t) {
6302
6305
  handleRenameFolder: O,
6303
6306
  handleDeleteFolder: k,
6304
6307
  handleEditItem: ee,
6305
- handleEditSave: A,
6306
- handleImportFromUrl: te,
6307
- handleMoveToFolder: ne,
6308
- handleDeleteClick: re,
6308
+ handleEditSave: te,
6309
+ handleImportFromUrl: ne,
6310
+ handleMoveToFolder: re,
6311
+ handleDeleteClick: A,
6309
6312
  handleReplaceItem: ie,
6310
6313
  handleReplaceFile: ae,
6311
6314
  resetUI: oe
@@ -6313,7 +6316,7 @@ function Ha(t) {
6313
6316
  }
6314
6317
  //#endregion
6315
6318
  //#region src/standalone/MediaLibrary.vue?vue&type=script&setup=true&lang.ts
6316
- var Ua = {
6319
+ var Wa = {
6317
6320
  class: "tpl tpl:flex tpl:flex-col tpl:overflow-hidden tpl:rounded-[var(--tpl-radius-lg)]",
6318
6321
  style: {
6319
6322
  width: "100%",
@@ -6321,62 +6324,62 @@ var Ua = {
6321
6324
  "background-color": "var(--tpl-bg-elevated)",
6322
6325
  border: "1px solid var(--tpl-border)"
6323
6326
  }
6324
- }, Wa = {
6327
+ }, Ga = {
6325
6328
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-3.5",
6326
6329
  style: { "border-color": "var(--tpl-border)" }
6327
- }, Ga = {
6330
+ }, Ka = {
6328
6331
  class: "tpl:text-sm tpl:font-semibold",
6329
6332
  style: { color: "var(--tpl-text)" }
6330
- }, Ka = { class: "tpl:flex tpl:items-center tpl:gap-3" }, qa = { class: "tpl:relative" }, Ja = ["value", "placeholder"], Ya = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, Xa = {
6333
+ }, qa = { class: "tpl:flex tpl:items-center tpl:gap-3" }, Ja = { class: "tpl:relative" }, Ya = ["value", "placeholder"], Xa = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, Za = {
6331
6334
  key: 0,
6332
6335
  class: "tpl:flex tpl:w-48 tpl:shrink-0 tpl:flex-col tpl:border-r",
6333
6336
  style: {
6334
6337
  "border-color": "var(--tpl-border)",
6335
6338
  "background-color": "var(--tpl-bg)"
6336
6339
  }
6337
- }, Za = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:flex-col" }, Qa = {
6340
+ }, Qa = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:flex-col" }, $a = {
6338
6341
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-4 tpl:py-2.5",
6339
6342
  style: { "border-color": "var(--tpl-border)" }
6340
- }, $a = { class: "tpl:flex tpl:items-center tpl:gap-2" }, eo = ["title"], to = {
6343
+ }, eo = { class: "tpl:flex tpl:items-center tpl:gap-2" }, to = ["title"], no = {
6341
6344
  key: 1,
6342
6345
  class: "tpl:text-xs tpl:font-medium",
6343
6346
  style: { color: "var(--tpl-text)" }
6344
- }, no = {
6347
+ }, ro = {
6345
6348
  class: "tpl:flex tpl:rounded-md tpl:p-0.5",
6346
6349
  style: {
6347
6350
  border: "1px solid var(--tpl-border)",
6348
6351
  "background-color": "var(--tpl-bg)"
6349
6352
  }
6350
- }, ro = ["title"], io = ["title"], ao = { class: "tpl:flex tpl:items-center tpl:gap-2" }, oo = ["value"], so = { value: "" }, co = ["value"], lo = ["value"], uo = { value: "newest" }, fo = { value: "oldest" }, po = { value: "name_asc" }, mo = { value: "name_desc" }, ho = { value: "size_asc" }, go = { value: "size_desc" }, _o = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto" }, vo = {
6353
+ }, io = ["title"], ao = ["title"], oo = { class: "tpl:flex tpl:items-center tpl:gap-2" }, so = ["value"], co = { value: "" }, lo = ["value"], uo = ["value"], fo = { value: "newest" }, po = { value: "oldest" }, mo = { value: "name_asc" }, ho = { value: "name_desc" }, go = { value: "size_asc" }, _o = { value: "size_desc" }, vo = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto" }, yo = {
6351
6354
  key: 0,
6352
6355
  class: "tpl:px-4 tpl:pt-3"
6353
- }, yo = {
6356
+ }, bo = {
6354
6357
  class: "tpl-scale-in tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5",
6355
6358
  style: {
6356
6359
  "background-color": "var(--tpl-bg-elevated)",
6357
6360
  "box-shadow": "var(--tpl-shadow-xl)"
6358
6361
  }
6359
- }, bo = {
6362
+ }, xo = {
6360
6363
  class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
6361
6364
  style: { color: "var(--tpl-text)" }
6362
- }, xo = {
6365
+ }, So = {
6363
6366
  key: 0,
6364
6367
  class: "tpl:mb-4 tpl:text-xs",
6365
6368
  style: { color: "var(--tpl-text-muted)" }
6366
- }, So = {
6369
+ }, Co = {
6367
6370
  key: 1,
6368
6371
  class: "tpl:mb-4 tpl:max-h-32 tpl:overflow-y-auto tpl:rounded tpl:border tpl:p-2",
6369
6372
  style: { "border-color": "var(--tpl-border)" }
6370
- }, Co = { class: "tpl:font-medium" }, wo = { style: { color: "var(--tpl-text-muted)" } }, To = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Eo = {
6373
+ }, wo = { class: "tpl:font-medium" }, To = { style: { color: "var(--tpl-text-muted)" } }, Eo = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Do = {
6371
6374
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-t tpl:px-5 tpl:py-3",
6372
6375
  style: { "border-color": "var(--tpl-border)" }
6373
- }, Do = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-3" }, Oo = { class: "tpl:flex tpl:items-center tpl:gap-5" }, ko = {
6376
+ }, Oo = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-3" }, ko = { class: "tpl:flex tpl:items-center tpl:gap-5" }, Ao = {
6374
6377
  key: 0,
6375
6378
  class: "tpl:flex tpl:items-center tpl:gap-2"
6376
- }, Ao = {
6379
+ }, jo = {
6377
6380
  key: 1,
6378
6381
  class: "tpl:relative"
6379
- }, jo = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Mo = ["disabled"], No = /* @__PURE__ */ m({
6382
+ }, Mo = { class: "tpl:flex tpl:items-center tpl:gap-2" }, No = ["disabled"], Po = /* @__PURE__ */ m({
6380
6383
  __name: "MediaLibrary",
6381
6384
  props: {
6382
6385
  authManager: {},
@@ -6396,11 +6399,11 @@ var Ua = {
6396
6399
  features: a(() => c.planConfig.features),
6397
6400
  fetchConfig: async () => {}
6398
6401
  });
6399
- let d = a(() => c.planConfig.features.media_folders ?? !1), f = a(() => c.planConfig.features.import_from_url ?? !1), m = a(() => c.planConfig.storage.used_bytes ?? 0), g = a(() => c.planConfig.storage.limit_bytes ?? 0), { availableCategories: _ } = Fe(), y = Va({
6402
+ let d = a(() => c.planConfig.features.media_folders ?? !1), f = a(() => c.planConfig.features.import_from_url ?? !1), m = a(() => c.planConfig.storage.used_bytes ?? 0), g = a(() => c.planConfig.storage.limit_bytes ?? 0), { availableCategories: _ } = Fe(), y = Ha({
6400
6403
  projectId: c.projectId,
6401
6404
  authManager: c.authManager,
6402
6405
  onError: c.onError
6403
- }), b = Ha({
6406
+ }), b = Ua({
6404
6407
  library: y,
6405
6408
  canUseMediaFolders: d,
6406
6409
  translations: u
@@ -6415,12 +6418,12 @@ var Ua = {
6415
6418
  }
6416
6419
  return v(() => {
6417
6420
  y.loadItems(), y.loadFrequentlyUsed(), l("ready");
6418
- }), (e, n) => (z(), t("div", Ua, [
6419
- i("div", Wa, [i("h2", Ga, L(u.value.mediaLibrary.title), 1), i("div", Ka, [p(za, {
6421
+ }), (e, n) => (z(), t("div", Wa, [
6422
+ i("div", Ga, [i("h2", Ka, L(u.value.mediaLibrary.title), 1), i("div", qa, [p(Ba, {
6420
6423
  "used-bytes": m.value,
6421
6424
  "limit-bytes": g.value,
6422
6425
  size: 22
6423
- }, null, 8, ["used-bytes", "limit-bytes"]), i("div", qa, [i("input", {
6426
+ }, null, 8, ["used-bytes", "limit-bytes"]), i("div", Ja, [i("input", {
6424
6427
  value: j(b).searchInput.value,
6425
6428
  type: "text",
6426
6429
  class: "tpl:w-52 tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-3 tpl:pl-8 tpl:text-xs tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:outline-none tpl:focus:shadow-[var(--tpl-ring)]",
@@ -6431,13 +6434,13 @@ var Ua = {
6431
6434
  },
6432
6435
  placeholder: u.value.mediaLibrary.searchPlaceholder,
6433
6436
  onInput: n[0] ||= (e) => j(b).handleSearchInput(e.target.value)
6434
- }, null, 40, Ja), p(j(oe), {
6437
+ }, null, 40, Ya), p(j(oe), {
6435
6438
  class: "tpl:absolute tpl:top-1/2 tpl:left-2.5 tpl:-translate-y-1/2",
6436
6439
  size: 13,
6437
6440
  "stroke-width": 2,
6438
6441
  style: { color: "var(--tpl-text-dim)" }
6439
6442
  })])])]),
6440
- i("div", Ya, [p(ve, {
6443
+ i("div", Xa, [p(ve, {
6441
6444
  "enter-active-class": "tpl:transition-all tpl:duration-200 tpl:ease-out",
6442
6445
  "enter-from-class": "tpl:-ml-48 tpl:opacity-0",
6443
6446
  "enter-to-class": "tpl:ml-0 tpl:opacity-100",
@@ -6445,7 +6448,7 @@ var Ua = {
6445
6448
  "leave-from-class": "tpl:ml-0 tpl:opacity-100",
6446
6449
  "leave-to-class": "tpl:-ml-48 tpl:opacity-0"
6447
6450
  }, {
6448
- default: F(() => [d.value && j(b).showSidebar.value ? (z(), t("div", Xa, [p(Ar, {
6451
+ default: F(() => [d.value && j(b).showSidebar.value ? (z(), t("div", Za, [p(jr, {
6449
6452
  folders: j(y).folders.value,
6450
6453
  "current-folder-id": j(y).currentFolderId.value,
6451
6454
  "view-mode": j(y).viewMode.value,
@@ -6467,7 +6470,7 @@ var Ua = {
6467
6470
  "onShowFrequentlyUsed"
6468
6471
  ])])) : N("", !0)]),
6469
6472
  _: 1
6470
- }), i("div", Za, [i("div", Qa, [i("div", $a, [
6473
+ }), i("div", Qa, [i("div", $a, [i("div", eo, [
6471
6474
  d.value ? (z(), t("button", {
6472
6475
  key: 0,
6473
6476
  class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
@@ -6478,11 +6481,11 @@ var Ua = {
6478
6481
  }),
6479
6482
  title: j(b).showSidebar.value ? u.value.mediaLibrary.hideFolders : u.value.mediaLibrary.showFolders,
6480
6483
  onClick: n[1] ||= (e) => j(b).showSidebar.value = !j(b).showSidebar.value
6481
- }, [p(j(A), {
6484
+ }, [p(j(te), {
6482
6485
  size: 16,
6483
6486
  "stroke-width": 2
6484
- })], 12, eo)) : N("", !0),
6485
- j(y).viewMode.value === "frequently-used" ? (z(), t("span", to, L(u.value.mediaLibrary.frequentlyUsed), 1)) : (z(), h(Pe, {
6487
+ })], 12, to)) : N("", !0),
6488
+ j(y).viewMode.value === "frequently-used" ? (z(), t("span", no, L(u.value.mediaLibrary.frequentlyUsed), 1)) : (z(), h(Pe, {
6486
6489
  key: 2,
6487
6490
  folders: j(y).folders.value,
6488
6491
  "current-folder-id": j(y).currentFolderId.value,
@@ -6492,7 +6495,7 @@ var Ua = {
6492
6495
  "current-folder-id",
6493
6496
  "onNavigate"
6494
6497
  ])),
6495
- i("div", no, [i("button", {
6498
+ i("div", ro, [i("button", {
6496
6499
  class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
6497
6500
  style: P({
6498
6501
  color: j(b).layoutMode.value === "grid" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
@@ -6500,10 +6503,10 @@ var Ua = {
6500
6503
  }),
6501
6504
  title: u.value.mediaLibrary.viewGrid,
6502
6505
  onClick: n[2] ||= (e) => j(b).layoutMode.value = "grid"
6503
- }, [p(j(re), {
6506
+ }, [p(j(A), {
6504
6507
  size: 14,
6505
6508
  "stroke-width": 2
6506
- })], 12, ro), i("button", {
6509
+ })], 12, io), i("button", {
6507
6510
  class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
6508
6511
  style: P({
6509
6512
  color: j(b).layoutMode.value === "list" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
@@ -6514,8 +6517,8 @@ var Ua = {
6514
6517
  }, [p(j(_e), {
6515
6518
  size: 14,
6516
6519
  "stroke-width": 2
6517
- })], 12, io)])
6518
- ]), i("div", ao, [j(_).length > 1 ? (z(), t("select", {
6520
+ })], 12, ao)])
6521
+ ]), i("div", oo, [j(_).length > 1 ? (z(), t("select", {
6519
6522
  key: 0,
6520
6523
  class: "tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-7 tpl:pl-2.5 tpl:text-xs tpl:transition-all tpl:duration-150 tpl:outline-none",
6521
6524
  style: {
@@ -6525,10 +6528,10 @@ var Ua = {
6525
6528
  },
6526
6529
  value: j(y).categoryFilter.value ?? "",
6527
6530
  onChange: n[4] ||= (e) => j(y).filterByCategory(e.target.value || null)
6528
- }, [i("option", so, L(u.value.mediaLibrary.filterAll), 1), (z(!0), t(R, null, S(j(_), (e) => (z(), t("option", {
6531
+ }, [i("option", co, L(u.value.mediaLibrary.filterAll), 1), (z(!0), t(R, null, S(j(_), (e) => (z(), t("option", {
6529
6532
  key: e,
6530
6533
  value: e
6531
- }, L(j(b).getCategoryLabel(e)), 9, co))), 128))], 40, oo)) : N("", !0), i("select", {
6534
+ }, L(j(b).getCategoryLabel(e)), 9, lo))), 128))], 40, so)) : N("", !0), i("select", {
6532
6535
  class: "tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-7 tpl:pl-2.5 tpl:text-xs tpl:transition-all tpl:duration-150 tpl:outline-none",
6533
6536
  style: {
6534
6537
  "border-color": "var(--tpl-border)",
@@ -6538,13 +6541,13 @@ var Ua = {
6538
6541
  value: j(y).sortOption.value,
6539
6542
  onChange: n[5] ||= (e) => j(y).sortBy(e.target.value)
6540
6543
  }, [
6541
- i("option", uo, L(u.value.mediaLibrary.sortNewest), 1),
6542
- i("option", fo, L(u.value.mediaLibrary.sortOldest), 1),
6543
- i("option", po, L(u.value.mediaLibrary.sortNameAsc), 1),
6544
- i("option", mo, L(u.value.mediaLibrary.sortNameDesc), 1),
6545
- i("option", ho, L(u.value.mediaLibrary.sortSizeAsc), 1),
6546
- i("option", go, L(u.value.mediaLibrary.sortSizeDesc), 1)
6547
- ], 40, lo)])]), i("div", _o, [j(y).viewMode.value === "files" ? (z(), t("div", vo, [p(Pa, {
6544
+ i("option", fo, L(u.value.mediaLibrary.sortNewest), 1),
6545
+ i("option", po, L(u.value.mediaLibrary.sortOldest), 1),
6546
+ i("option", mo, L(u.value.mediaLibrary.sortNameAsc), 1),
6547
+ i("option", ho, L(u.value.mediaLibrary.sortNameDesc), 1),
6548
+ i("option", go, L(u.value.mediaLibrary.sortSizeAsc), 1),
6549
+ i("option", _o, L(u.value.mediaLibrary.sortSizeDesc), 1)
6550
+ ], 40, uo)])]), i("div", vo, [j(y).viewMode.value === "files" ? (z(), t("div", yo, [p(Fa, {
6548
6551
  "is-uploading": j(y).isUploading.value,
6549
6552
  "upload-progress": j(y).uploadProgress.value,
6550
6553
  onUpload: j(b).handleUpload
@@ -6561,10 +6564,10 @@ var Ua = {
6561
6564
  "background-color": "var(--tpl-bg)"
6562
6565
  },
6563
6566
  onClick: n[6] ||= (e) => j(b).showImportUrlModal.value = !0
6564
- }, [p(j(te), {
6567
+ }, [p(j(ne), {
6565
6568
  size: 14,
6566
6569
  "stroke-width": 2
6567
- }), M(" " + L(u.value.mediaLibrary.importFromUrl), 1)])) : N("", !0)])) : N("", !0), p(Bi, {
6570
+ }), M(" " + L(u.value.mediaLibrary.importFromUrl), 1)])) : N("", !0)])) : N("", !0), p(Vi, {
6568
6571
  items: j(b).displayItems.value,
6569
6572
  "selected-ids": j(y).selectedItems.value,
6570
6573
  "is-loading": j(y).isLoading.value,
@@ -6587,7 +6590,7 @@ var Ua = {
6587
6590
  "onEdit",
6588
6591
  "onReplace"
6589
6592
  ])])])]),
6590
- p(Qi, {
6593
+ p($i, {
6591
6594
  visible: j(b).showImportUrlModal.value,
6592
6595
  "is-importing": j(y).isImportingFromUrl.value,
6593
6596
  error: j(y).importFromUrlError.value,
@@ -6599,7 +6602,7 @@ var Ua = {
6599
6602
  "error",
6600
6603
  "onImport"
6601
6604
  ]),
6602
- p(_r, {
6605
+ p(vr, {
6603
6606
  visible: !!j(b).editingItem.value,
6604
6607
  item: j(b).editingItem.value,
6605
6608
  onSave: j(b).handleEditSave,
@@ -6609,7 +6612,7 @@ var Ua = {
6609
6612
  "item",
6610
6613
  "onSave"
6611
6614
  ]),
6612
- p(ka, {
6615
+ p(Aa, {
6613
6616
  visible: j(y).showReplaceWarning.value,
6614
6617
  item: j(y).pendingReplaceItem.value,
6615
6618
  "usage-info": j(y).replaceUsageInfo.value,
@@ -6643,19 +6646,19 @@ var Ua = {
6643
6646
  "-webkit-backdrop-filter": "blur(8px)"
6644
6647
  },
6645
6648
  onClick: n[11] ||= r((...e) => j(y).cancelDelete && j(y).cancelDelete(...e), ["self"])
6646
- }, [i("div", yo, [
6647
- i("h3", bo, L(u.value.mediaLibrary.deleteWarningTitle), 1),
6649
+ }, [i("div", bo, [
6650
+ i("h3", xo, L(u.value.mediaLibrary.deleteWarningTitle), 1),
6648
6651
  i("p", {
6649
6652
  class: k(["tpl:text-xs", j(b).hasUsedFiles.value ? "tpl:mb-2" : "tpl:mb-4"]),
6650
6653
  style: { color: "var(--tpl-text-muted)" }
6651
6654
  }, L(u.value.mediaLibrary.deleteWarningMessage), 3),
6652
- j(b).hasUsedFiles.value ? (z(), t("p", xo, L(u.value.mediaLibrary.deleteWarningUsageNote), 1)) : N("", !0),
6653
- j(b).hasUsedFiles.value ? (z(), t("div", So, [(z(!0), t(R, null, S(j(y).deleteUsageInfo.value, (e, n) => (z(), t("div", {
6655
+ j(b).hasUsedFiles.value ? (z(), t("p", So, L(u.value.mediaLibrary.deleteWarningUsageNote), 1)) : N("", !0),
6656
+ j(b).hasUsedFiles.value ? (z(), t("div", Co, [(z(!0), t(R, null, S(j(y).deleteUsageInfo.value, (e, n) => (z(), t("div", {
6654
6657
  key: n,
6655
6658
  class: "tpl:text-xs",
6656
6659
  style: { color: "var(--tpl-text)" }
6657
- }, [e.template_count > 0 ? (z(), t(R, { key: 0 }, [i("span", Co, L(j(b).displayItems.value.find((e) => e.id === n)?.filename || n), 1), i("span", wo, " - " + L(u.value.mediaLibrary.usedInTemplates.replace("{count}", e.template_count.toString())), 1)], 64)) : N("", !0)]))), 128))])) : N("", !0),
6658
- i("div", To, [i("button", {
6660
+ }, [e.template_count > 0 ? (z(), t(R, { key: 0 }, [i("span", wo, L(j(b).displayItems.value.find((e) => e.id === n)?.filename || n), 1), i("span", To, " - " + L(u.value.mediaLibrary.usedInTemplates.replace("{count}", e.template_count.toString())), 1)], 64)) : N("", !0)]))), 128))])) : N("", !0),
6661
+ i("div", Eo, [i("button", {
6659
6662
  class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
6660
6663
  style: {
6661
6664
  "border-color": "var(--tpl-border)",
@@ -6675,7 +6678,7 @@ var Ua = {
6675
6678
  ])])) : N("", !0)]),
6676
6679
  _: 1
6677
6680
  }),
6678
- i("div", Eo, [i("div", Do, [j(y).previewItem.value ? (z(), h(ma, {
6681
+ i("div", Do, [i("div", Oo, [j(y).previewItem.value ? (z(), h(ha, {
6679
6682
  key: 0,
6680
6683
  "selected-conversion": j(b).selectedConversion.value,
6681
6684
  "onUpdate:selectedConversion": n[12] ||= (e) => j(b).selectedConversion.value = e,
@@ -6685,7 +6688,7 @@ var Ua = {
6685
6688
  "selected-conversion",
6686
6689
  "item",
6687
6690
  "folders"
6688
- ])) : N("", !0)]), i("div", Oo, [j(y).selectedItems.value.size > 0 ? (z(), t("div", ko, [j(y).previewItem.value ? (z(), t("button", {
6691
+ ])) : N("", !0)]), i("div", ko, [j(y).selectedItems.value.size > 0 ? (z(), t("div", Ao, [j(y).previewItem.value ? (z(), t("button", {
6689
6692
  key: 0,
6690
6693
  class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-1 tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
6691
6694
  style: P({
@@ -6702,7 +6705,7 @@ var Ua = {
6702
6705
  key: 0,
6703
6706
  size: 12,
6704
6707
  "stroke-width": 2
6705
- })), M(" " + L(j(b).copied.value ? u.value.mediaLibrary.copied : u.value.mediaLibrary.copyUrl), 1)], 4)) : N("", !0), d.value ? (z(), t("div", Ao, [i("button", {
6708
+ })), M(" " + L(j(b).copied.value ? u.value.mediaLibrary.copied : u.value.mediaLibrary.copyUrl), 1)], 4)) : N("", !0), d.value ? (z(), t("div", jo, [i("button", {
6706
6709
  class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
6707
6710
  style: {
6708
6711
  "border-color": "var(--tpl-border)",
@@ -6710,7 +6713,7 @@ var Ua = {
6710
6713
  "background-color": "var(--tpl-bg)"
6711
6714
  },
6712
6715
  onClick: n[14] ||= (e) => j(b).showMovePicker.value = !j(b).showMovePicker.value
6713
- }, L(u.value.mediaLibrary.moveSelected), 1), j(b).showMovePicker.value ? (z(), h(ra, {
6716
+ }, L(u.value.mediaLibrary.moveSelected), 1), j(b).showMovePicker.value ? (z(), h(ia, {
6714
6717
  key: 0,
6715
6718
  folders: j(y).folders.value,
6716
6719
  "current-folder-id": j(y).currentFolderId.value,
@@ -6720,7 +6723,7 @@ var Ua = {
6720
6723
  "folders",
6721
6724
  "current-folder-id",
6722
6725
  "onSelect"
6723
- ])) : N("", !0)])) : N("", !0)])) : N("", !0), i("div", jo, [j(y).selectedItems.value.size > 0 ? (z(), t("button", {
6726
+ ])) : N("", !0)])) : N("", !0)])) : N("", !0), i("div", Mo, [j(y).selectedItems.value.size > 0 ? (z(), t("button", {
6724
6727
  key: 0,
6725
6728
  class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
6726
6729
  style: {
@@ -6738,35 +6741,35 @@ var Ua = {
6738
6741
  },
6739
6742
  disabled: !j(y).previewItem.value,
6740
6743
  onClick: x
6741
- }, L(u.value.mediaLibrary.selectFile), 9, Mo)) : N("", !0)])])])
6744
+ }, L(u.value.mediaLibrary.selectFile), 9, No)) : N("", !0)])])])
6742
6745
  ]));
6743
6746
  }
6744
- }), Po = (e, t, n) => {
6747
+ }), Fo = (e, t, n) => {
6745
6748
  let r = t.lastIndexOf("?"), i = e[r === -1 || r < t.lastIndexOf("/") ? t : t.slice(0, r)];
6746
6749
  return i ? typeof i == "function" ? i() : Promise.resolve(i) : new Promise((e, r) => {
6747
6750
  (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(r.bind(null, /* @__PURE__ */ Error("Unknown variable dynamic import: " + t + (t.split("/").length === n ? "" : ". Note that variables only represent file names one level deep."))));
6748
6751
  });
6749
- }, Fo = [
6752
+ }, Io = [
6750
6753
  "en",
6751
6754
  "de",
6752
6755
  "pt-BR"
6753
6756
  ];
6754
- function Io(e) {
6755
- return e.trim().replace(/_/g, "-").toLowerCase();
6756
- }
6757
6757
  function Lo(e) {
6758
- let t = Io(e);
6759
- return Fo.find((e) => Io(e) === t);
6758
+ return e.trim().replace(/_/g, "-").toLowerCase();
6760
6759
  }
6761
6760
  function Ro(e) {
6762
- return Io(e).split("-")[0];
6761
+ let t = Lo(e);
6762
+ return Io.find((e) => Lo(e) === t);
6763
6763
  }
6764
6764
  function zo(e) {
6765
- return Lo(e) ?? Lo(Ro(e)) ?? "en";
6765
+ return Lo(e).split("-")[0];
6766
+ }
6767
+ function Bo(e) {
6768
+ return Ro(e) ?? Ro(zo(e)) ?? "en";
6766
6769
  }
6767
- async function Bo(e) {
6768
- let t = zo(e);
6769
- return (await Po(/* @__PURE__ */ Object.assign({
6770
+ async function Vo(e) {
6771
+ let t = Bo(e);
6772
+ return (await Fo(/* @__PURE__ */ Object.assign({
6770
6773
  "./locales/de.ts": () => import("./chunks/de-DTeAtaXF.js"),
6771
6774
  "./locales/en.ts": () => import("./chunks/en-DSB0cVAt.js"),
6772
6775
  "./locales/pt-BR.ts": () => import("./chunks/pt-BR-Dff76tHu.js")
@@ -6774,50 +6777,50 @@ async function Bo(e) {
6774
6777
  }
6775
6778
  //#endregion
6776
6779
  //#region src/standalone/visual.ts
6777
- var Vo = null, Ho = e(null);
6778
- async function Uo(e) {
6780
+ var Ho = null, Uo = e(null);
6781
+ async function Wo(e) {
6779
6782
  let t = typeof e.container == "string" ? document.querySelector(e.container) : e.container;
6780
6783
  if (!t) throw Error(`Container element not found: ${e.container}`);
6781
6784
  let n = Ce(e.auth, e.onError);
6782
6785
  await n.initialize();
6783
- let r = await new ke(n).fetchConfig(), i = await Bo(e.locale ?? "en");
6784
- return Go(t, e.theme), Vo && Wo(), new Promise((a, s) => {
6786
+ let r = await new ke(n).fetchConfig(), i = await Vo(e.locale ?? "en");
6787
+ return Ko(t, e.theme), Ho && Go(), new Promise((a, s) => {
6785
6788
  try {
6786
- Vo = be({ setup() {
6789
+ Ho = be({ setup() {
6787
6790
  let s = () => {
6788
6791
  a({
6789
- setTheme: (e) => Go(t, e),
6790
- unmount: Wo
6792
+ setTheme: (e) => Ko(t, e),
6793
+ unmount: Go
6791
6794
  });
6792
6795
  };
6793
- return () => o(No, {
6796
+ return () => o(Po, {
6794
6797
  authManager: n,
6795
6798
  projectId: n.projectId,
6796
6799
  planConfig: r,
6797
6800
  translations: i,
6798
6801
  onSelect: e.onSelect,
6799
6802
  onError: e.onError,
6800
- ref: Ho,
6803
+ ref: Uo,
6801
6804
  onReady: s
6802
6805
  });
6803
- } }), Vo.mount(t);
6806
+ } }), Ho.mount(t);
6804
6807
  } catch (e) {
6805
6808
  s(e);
6806
6809
  }
6807
6810
  });
6808
6811
  }
6809
- function Wo() {
6810
- Vo && (Vo.unmount(), Vo = null, Ho.value = null);
6812
+ function Go() {
6813
+ Ho && (Ho.unmount(), Ho = null, Uo.value = null);
6811
6814
  }
6812
- function Go(e, t) {
6815
+ function Ko(e, t) {
6813
6816
  t && (t.primaryColor && e.style.setProperty("--tpl-primary", t.primaryColor), t.borderRadius !== void 0 && (e.style.setProperty("--tpl-radius", `${t.borderRadius}px`), e.style.setProperty("--tpl-radius-sm", `${Math.max(0, t.borderRadius - 3)}px`), e.style.setProperty("--tpl-radius-lg", `${t.borderRadius + 4}px`)));
6814
6817
  }
6815
- var Ko = {
6816
- init: Uo,
6817
- unmount: Wo
6818
+ var qo = {
6819
+ init: Wo,
6820
+ unmount: Go
6818
6821
  };
6819
- typeof window < "u" && (window.TemplaticalMedia = Ko);
6822
+ typeof window < "u" && (window.TemplaticalMedia = qo);
6820
6823
  //#endregion
6821
- export { Ko as default, Uo as init, Wo as unmount };
6824
+ export { qo as default, Wo as init, Go as unmount };
6822
6825
 
6823
6826
  //# sourceMappingURL=media-library.js.map