@templatical/media-library 0.24.0 → 0.25.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.
- package/dist/cdn/chunks/{icons-C_T1y_t4.js → icons-D2C-Sl7d.js} +12 -11
- package/dist/cdn/chunks/{icons-C_T1y_t4.js.map → icons-D2C-Sl7d.js.map} +1 -1
- package/dist/cdn/media-library.js +995 -1241
- package/dist/cdn/media-library.js.map +1 -1
- package/dist/templatical-media-library.js +454 -452
- package/package.json +7 -7
|
@@ -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 te, d as ne, et as re, f as
|
|
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 ie, g as ae, h as oe, i as se, it as A, j, k as M, l as ce, m as le, n as ue, nt as de, o as fe, ot as N, p as pe, q as P, r as me, rt as F, s as he, st as I, t as ge, tt as L, u as _e, v as ve, w as R, x as ye, y as be, z } from "./chunks/icons-D2C-Sl7d.js";
|
|
2
2
|
//#region ../types/src/config.ts
|
|
3
3
|
var xe = class extends Error {
|
|
4
4
|
statusCode;
|
|
@@ -28,7 +28,7 @@ var xe = class extends Error {
|
|
|
28
28
|
requestOptions;
|
|
29
29
|
onError;
|
|
30
30
|
refreshPromise = null;
|
|
31
|
-
static REFRESH_THRESHOLD_MS =
|
|
31
|
+
static REFRESH_THRESHOLD_MS = 6e4;
|
|
32
32
|
constructor(t) {
|
|
33
33
|
this.url = t.url, this.baseUrl = (t.baseUrl ?? e.DEFAULT_BASE_URL).replace(/\/$/, ""), this.requestOptions = t.requestOptions ?? {}, this.onError = t.onError;
|
|
34
34
|
}
|
|
@@ -91,14 +91,14 @@ var xe = class extends Error {
|
|
|
91
91
|
if (!r.ok) throw new xe(`Token refresh failed: ${r.status}`, r.status);
|
|
92
92
|
let i = await r.json();
|
|
93
93
|
if (!i.token || !i.expires_at || !i.project_id || !i.tenant) throw Error("Invalid token response: missing token, expires_at, project_id, or tenant");
|
|
94
|
-
return this.accessToken = i.token, this.expiresAt = /* @__PURE__ */ new Date(i.expires_at * 1e3), this._projectId = i.project_id, this._tenantSlug = i.tenant, i.test_email?.allowed_emails && i.test_email?.signature ?
|
|
94
|
+
return this.accessToken = i.token, this.expiresAt = /* @__PURE__ */ new Date(i.expires_at * 1e3), this._projectId = i.project_id, this._tenantSlug = i.tenant, this._testEmailConfig = i.test_email?.allowed_emails && i.test_email?.signature ? {
|
|
95
95
|
allowedEmails: i.test_email.allowed_emails,
|
|
96
96
|
signature: i.test_email.signature
|
|
97
|
-
} : this.
|
|
97
|
+
} : null, this._userConfig = i.user?.id && i.user?.name && i.user?.signature ? {
|
|
98
98
|
id: i.user.id,
|
|
99
99
|
name: i.user.name,
|
|
100
100
|
signature: i.user.signature
|
|
101
|
-
} :
|
|
101
|
+
} : null, this.accessToken;
|
|
102
102
|
} catch (e) {
|
|
103
103
|
let t = e instanceof Error ? e : Error("Token refresh failed", { cause: e });
|
|
104
104
|
throw this.onError?.(t), t;
|
|
@@ -417,7 +417,7 @@ var je = {
|
|
|
417
417
|
class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
|
|
418
418
|
style: { color: "var(--tpl-primary)" },
|
|
419
419
|
onClick: n[0] ||= (e) => o("navigate", null)
|
|
420
|
-
},
|
|
420
|
+
}, I(A(s).mediaLibrary.allFiles), 1), (z(!0), t(R, null, S(c.value, (e, n) => (z(), t(R, { key: e.id }, [p(A(ae), {
|
|
421
421
|
size: 12,
|
|
422
422
|
"stroke-width": 2
|
|
423
423
|
}), n < c.value.length - 1 ? (z(), t("button", {
|
|
@@ -425,7 +425,7 @@ var je = {
|
|
|
425
425
|
class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
|
|
426
426
|
style: { color: "var(--tpl-primary)" },
|
|
427
427
|
onClick: (t) => o("navigate", e.id)
|
|
428
|
-
},
|
|
428
|
+
}, I(e.name), 9, Me)) : (z(), t("span", Ne, I(e.name), 1))], 64))), 128))])) : M("", !0);
|
|
429
429
|
}
|
|
430
430
|
});
|
|
431
431
|
//#endregion
|
|
@@ -615,7 +615,7 @@ var Ke, qe, Je, G = (Ke = function(e) {
|
|
|
615
615
|
throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
|
|
616
616
|
}(t == null && Je.path);
|
|
617
617
|
}
|
|
618
|
-
}, Je.exports), Je.exports),
|
|
618
|
+
}, Je.exports), Je.exports), Ye = function(e) {
|
|
619
619
|
return function(t, n) {
|
|
620
620
|
if (!t) return e;
|
|
621
621
|
var r;
|
|
@@ -627,7 +627,7 @@ var Ke, qe, Je, G = (Ke = function(e) {
|
|
|
627
627
|
}), "") : "");
|
|
628
628
|
};
|
|
629
629
|
};
|
|
630
|
-
function
|
|
630
|
+
function Xe(e, t, n) {
|
|
631
631
|
var r, i, a, o, s;
|
|
632
632
|
function c() {
|
|
633
633
|
var l = Date.now() - o;
|
|
@@ -645,65 +645,65 @@ function Ye(e, t, n) {
|
|
|
645
645
|
r &&= (s = e.apply(a, i), a = i = null, clearTimeout(r), null);
|
|
646
646
|
}, l;
|
|
647
647
|
}
|
|
648
|
-
|
|
649
|
-
var
|
|
650
|
-
return
|
|
648
|
+
Xe.debounce = Xe;
|
|
649
|
+
var Ze = Xe, K = function() {
|
|
650
|
+
return K = Object.assign || function(e) {
|
|
651
651
|
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]);
|
|
652
652
|
return e;
|
|
653
|
-
},
|
|
653
|
+
}, K.apply(this, arguments);
|
|
654
654
|
};
|
|
655
|
-
function
|
|
655
|
+
function Qe(e, t) {
|
|
656
656
|
var n, r;
|
|
657
657
|
return e && t ? (n = "" + e + t[0].toUpperCase() + t.slice(1), r = e + "-" + t) : (n = e || t, r = e || t), {
|
|
658
658
|
name: n,
|
|
659
659
|
classname: r
|
|
660
660
|
};
|
|
661
661
|
}
|
|
662
|
-
function
|
|
662
|
+
function $e(e) {
|
|
663
663
|
return /^blob:/.test(e);
|
|
664
664
|
}
|
|
665
|
-
function
|
|
666
|
-
return
|
|
665
|
+
function et(e) {
|
|
666
|
+
return $e(e) || function(e) {
|
|
667
667
|
return /^data:/.test(e);
|
|
668
668
|
}(e);
|
|
669
669
|
}
|
|
670
|
-
function
|
|
670
|
+
function tt(e) {
|
|
671
671
|
return !!(e && e.constructor && e.call && e.apply);
|
|
672
672
|
}
|
|
673
|
-
function
|
|
673
|
+
function q(e) {
|
|
674
674
|
return e === void 0;
|
|
675
675
|
}
|
|
676
|
-
function
|
|
676
|
+
function nt(e) {
|
|
677
677
|
return typeof e == "object" && !!e;
|
|
678
678
|
}
|
|
679
|
-
function
|
|
679
|
+
function rt(e, t, n) {
|
|
680
680
|
var r = {};
|
|
681
|
-
return
|
|
682
|
-
|
|
681
|
+
return nt(e) ? (Object.keys(t).forEach((function(i) {
|
|
682
|
+
r[i] = q(e[i]) ? t[i] : nt(t[i]) ? nt(e[i]) ? rt(e[i], t[i], n[i]) : e[i] ? t[i] : n[i] : !0 === t[i] || !1 === t[i] ? !!e[i] : e[i];
|
|
683
683
|
})), r) : e ? t : n;
|
|
684
684
|
}
|
|
685
|
-
function
|
|
685
|
+
function it(e) {
|
|
686
686
|
var t = Number(e);
|
|
687
687
|
return Number.isNaN(t) ? e : t;
|
|
688
688
|
}
|
|
689
|
-
function
|
|
689
|
+
function at(e) {
|
|
690
690
|
return typeof (e == "number" || function(e) {
|
|
691
691
|
return typeof e == "object" && !!e;
|
|
692
|
-
}(e) && toString.call(e) == "[object Number]") && !
|
|
692
|
+
}(e) && toString.call(e) == "[object Number]") && !ot(e);
|
|
693
693
|
}
|
|
694
|
-
function
|
|
694
|
+
function ot(e) {
|
|
695
695
|
return e != e;
|
|
696
696
|
}
|
|
697
|
-
function
|
|
697
|
+
function st(e, t) {
|
|
698
698
|
return Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2);
|
|
699
699
|
}
|
|
700
|
-
var
|
|
700
|
+
var ct = function(e, t) {
|
|
701
701
|
e === void 0 && (e = {}), t === void 0 && (t = {}), this.type = "manipulateImage", this.move = e, this.scale = t;
|
|
702
|
-
},
|
|
702
|
+
}, lt = function(e, t) {
|
|
703
703
|
t === void 0 && (t = {}), this.type = "resize", this.directions = e, this.params = t;
|
|
704
|
-
},
|
|
704
|
+
}, ut = function(e) {
|
|
705
705
|
this.type = "move", this.directions = e;
|
|
706
|
-
},
|
|
706
|
+
}, dt = function() {
|
|
707
707
|
function e(e, t, n, r, i) {
|
|
708
708
|
this.type = "drag", this.nativeEvent = e, this.position = n, this.previousPosition = r, this.element = t, this.anchor = i;
|
|
709
709
|
}
|
|
@@ -721,7 +721,7 @@ var st = function(e, t) {
|
|
|
721
721
|
top: 0
|
|
722
722
|
};
|
|
723
723
|
}, e;
|
|
724
|
-
}(),
|
|
724
|
+
}(), ft = {
|
|
725
725
|
name: "DraggableElement",
|
|
726
726
|
props: { classname: { type: String } },
|
|
727
727
|
beforeMount: function() {
|
|
@@ -792,7 +792,7 @@ var st = function(e, t) {
|
|
|
792
792
|
if (this.touches.length) {
|
|
793
793
|
if (this.touches.length === 1 && n.length === 1) {
|
|
794
794
|
var r = this.$refs.draggable;
|
|
795
|
-
this.$emit("drag", new
|
|
795
|
+
this.$emit("drag", new dt(e, r, {
|
|
796
796
|
left: n[0].clientX,
|
|
797
797
|
top: n[0].clientY
|
|
798
798
|
}, {
|
|
@@ -814,7 +814,7 @@ var st = function(e, t) {
|
|
|
814
814
|
"enter"
|
|
815
815
|
]
|
|
816
816
|
};
|
|
817
|
-
|
|
817
|
+
ft.render = function(e, t, n, r, i, a) {
|
|
818
818
|
return z(), h("div", {
|
|
819
819
|
ref: "draggable",
|
|
820
820
|
class: n.classname,
|
|
@@ -832,9 +832,9 @@ dt.render = function(e, t, n, r, i, a) {
|
|
|
832
832
|
}
|
|
833
833
|
}, [c(e.$slots, "default")], 34);
|
|
834
834
|
};
|
|
835
|
-
var
|
|
835
|
+
var pt = Ye("vue-handler-wrapper"), mt = {
|
|
836
836
|
name: "HandlerWrapper",
|
|
837
|
-
components: { DraggableElement:
|
|
837
|
+
components: { DraggableElement: ft },
|
|
838
838
|
props: {
|
|
839
839
|
horizontalPosition: { type: String },
|
|
840
840
|
verticalPosition: { type: String },
|
|
@@ -846,12 +846,12 @@ var ft = K("vue-handler-wrapper"), pt = {
|
|
|
846
846
|
computed: { classes: function() {
|
|
847
847
|
var e;
|
|
848
848
|
if (this.horizontalPosition || this.verticalPosition) {
|
|
849
|
-
var t, n =
|
|
850
|
-
e =
|
|
851
|
-
} else e =
|
|
849
|
+
var t, n = Qe(this.horizontalPosition, this.verticalPosition);
|
|
850
|
+
e = pt((W(t = {}, n.classname, !0), W(t, "disabled", this.disabled), t));
|
|
851
|
+
} else e = pt({ disabled: this.disabled });
|
|
852
852
|
return {
|
|
853
853
|
root: e,
|
|
854
|
-
draggable:
|
|
854
|
+
draggable: pt("draggable")
|
|
855
855
|
};
|
|
856
856
|
} },
|
|
857
857
|
emits: [
|
|
@@ -861,7 +861,7 @@ var ft = K("vue-handler-wrapper"), pt = {
|
|
|
861
861
|
"drag-end"
|
|
862
862
|
]
|
|
863
863
|
};
|
|
864
|
-
|
|
864
|
+
mt.render = function(e, t, n, r, i, a) {
|
|
865
865
|
var o = x("DraggableElement");
|
|
866
866
|
return z(), h("div", { class: a.classes.root }, [p(o, {
|
|
867
867
|
class: a.classes.draggable,
|
|
@@ -878,15 +878,15 @@ pt.render = function(e, t, n, r, i, a) {
|
|
|
878
878
|
return e.$emit("enter");
|
|
879
879
|
}
|
|
880
880
|
}, {
|
|
881
|
-
default:
|
|
881
|
+
default: P((function() {
|
|
882
882
|
return [c(e.$slots, "default")];
|
|
883
883
|
})),
|
|
884
884
|
_: 3
|
|
885
885
|
}, 8, ["class"])], 2);
|
|
886
886
|
};
|
|
887
|
-
var
|
|
887
|
+
var ht = Ye("vue-line-wrapper"), gt = {
|
|
888
888
|
name: "LineWrapper",
|
|
889
|
-
components: { DraggableElement:
|
|
889
|
+
components: { DraggableElement: ft },
|
|
890
890
|
props: {
|
|
891
891
|
position: {
|
|
892
892
|
type: String,
|
|
@@ -899,7 +899,7 @@ var mt = K("vue-line-wrapper"), ht = {
|
|
|
899
899
|
},
|
|
900
900
|
computed: { classname: function() {
|
|
901
901
|
var e;
|
|
902
|
-
return
|
|
902
|
+
return ht((W(e = {}, this.position, !0), W(e, "disabled", this.disabled), e));
|
|
903
903
|
} },
|
|
904
904
|
emits: [
|
|
905
905
|
"leave",
|
|
@@ -908,7 +908,7 @@ var mt = K("vue-line-wrapper"), ht = {
|
|
|
908
908
|
"drag-end"
|
|
909
909
|
]
|
|
910
910
|
};
|
|
911
|
-
|
|
911
|
+
gt.render = function(e, t, n, r, i, a) {
|
|
912
912
|
var o = x("DraggableElement");
|
|
913
913
|
return z(), h(o, {
|
|
914
914
|
class: a.classname,
|
|
@@ -925,29 +925,29 @@ ht.render = function(e, t, n, r, i, a) {
|
|
|
925
925
|
return e.$emit("enter");
|
|
926
926
|
}
|
|
927
927
|
}, {
|
|
928
|
-
default:
|
|
928
|
+
default: P((function() {
|
|
929
929
|
return [c(e.$slots, "default")];
|
|
930
930
|
})),
|
|
931
931
|
_: 3
|
|
932
932
|
}, 8, ["class"]);
|
|
933
933
|
};
|
|
934
|
-
var
|
|
934
|
+
var _t = [
|
|
935
935
|
"left",
|
|
936
936
|
"right",
|
|
937
937
|
"top",
|
|
938
938
|
"bottom"
|
|
939
|
-
],
|
|
939
|
+
], vt = ["left", "right"], yt = ["top", "bottom"], bt = ["left", "top"], xt = [
|
|
940
940
|
"fill-area",
|
|
941
941
|
"fit-area",
|
|
942
942
|
"stencil",
|
|
943
943
|
"none"
|
|
944
|
-
],
|
|
944
|
+
], St = {
|
|
945
945
|
left: 0,
|
|
946
946
|
top: 0,
|
|
947
947
|
width: 0,
|
|
948
948
|
height: 0
|
|
949
949
|
};
|
|
950
|
-
function
|
|
950
|
+
function Ct(e, t, n) {
|
|
951
951
|
return !(n ||= [
|
|
952
952
|
"width",
|
|
953
953
|
"height",
|
|
@@ -957,7 +957,7 @@ function St(e, t, n) {
|
|
|
957
957
|
return e[n] !== t[n];
|
|
958
958
|
}));
|
|
959
959
|
}
|
|
960
|
-
function
|
|
960
|
+
function wt(e) {
|
|
961
961
|
return {
|
|
962
962
|
left: e.left,
|
|
963
963
|
top: e.top,
|
|
@@ -965,31 +965,31 @@ function Ct(e) {
|
|
|
965
965
|
bottom: e.top + e.height
|
|
966
966
|
};
|
|
967
967
|
}
|
|
968
|
-
function
|
|
968
|
+
function Tt(e, t) {
|
|
969
969
|
return {
|
|
970
970
|
left: e.left - t.left,
|
|
971
971
|
top: e.top - t.top
|
|
972
972
|
};
|
|
973
973
|
}
|
|
974
|
-
function
|
|
974
|
+
function J(e) {
|
|
975
975
|
return {
|
|
976
976
|
left: e.left + e.width / 2,
|
|
977
977
|
top: e.top + e.height / 2
|
|
978
978
|
};
|
|
979
979
|
}
|
|
980
|
-
function
|
|
980
|
+
function Et(e, t) {
|
|
981
981
|
var n = {
|
|
982
982
|
left: 0,
|
|
983
983
|
top: 0,
|
|
984
984
|
right: 0,
|
|
985
985
|
bottom: 0
|
|
986
986
|
};
|
|
987
|
-
return
|
|
988
|
-
var i = t[r], a =
|
|
987
|
+
return _t.forEach((function(r) {
|
|
988
|
+
var i = t[r], a = wt(e)[r];
|
|
989
989
|
n[r] = i !== void 0 && a !== void 0 ? r === "left" || r === "top" ? Math.max(0, i - a) : Math.max(0, a - i) : 0;
|
|
990
990
|
})), n;
|
|
991
991
|
}
|
|
992
|
-
function
|
|
992
|
+
function Dt(e, t) {
|
|
993
993
|
return {
|
|
994
994
|
left: e.left - t.left,
|
|
995
995
|
top: e.top - t.top,
|
|
@@ -997,22 +997,22 @@ function Et(e, t) {
|
|
|
997
997
|
height: e.height + t.top + t.bottom
|
|
998
998
|
};
|
|
999
999
|
}
|
|
1000
|
-
function
|
|
1000
|
+
function Ot(e) {
|
|
1001
1001
|
return {
|
|
1002
1002
|
left: -e.left,
|
|
1003
1003
|
top: -e.top
|
|
1004
1004
|
};
|
|
1005
1005
|
}
|
|
1006
|
-
function
|
|
1007
|
-
return
|
|
1006
|
+
function Y(e, t) {
|
|
1007
|
+
return K(K({}, e), {
|
|
1008
1008
|
left: e.left + t.left,
|
|
1009
1009
|
top: e.top + t.top
|
|
1010
1010
|
});
|
|
1011
1011
|
}
|
|
1012
|
-
function
|
|
1012
|
+
function X(e, t, n, r) {
|
|
1013
1013
|
if (t !== 1) {
|
|
1014
1014
|
if (n) {
|
|
1015
|
-
var i =
|
|
1015
|
+
var i = J(e);
|
|
1016
1016
|
return {
|
|
1017
1017
|
width: e.width * t,
|
|
1018
1018
|
height: e.height * t,
|
|
@@ -1029,25 +1029,25 @@ function Z(e, t, n, r) {
|
|
|
1029
1029
|
}
|
|
1030
1030
|
return e;
|
|
1031
1031
|
}
|
|
1032
|
-
function
|
|
1032
|
+
function Z(e) {
|
|
1033
1033
|
return e.width / e.height;
|
|
1034
1034
|
}
|
|
1035
|
-
function
|
|
1035
|
+
function kt(e, t) {
|
|
1036
1036
|
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);
|
|
1037
1037
|
}
|
|
1038
|
-
function
|
|
1038
|
+
function At(e, t) {
|
|
1039
1039
|
var n = {
|
|
1040
1040
|
left: 0,
|
|
1041
1041
|
top: 0
|
|
1042
|
-
}, r =
|
|
1042
|
+
}, r = Et(e, t);
|
|
1043
1043
|
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;
|
|
1044
1044
|
}
|
|
1045
|
-
function
|
|
1045
|
+
function jt(e, t) {
|
|
1046
1046
|
var n;
|
|
1047
1047
|
return t.minimum && e < t.minimum ? n = t.minimum : t.maximum && e > t.maximum && (n = t.maximum), n;
|
|
1048
1048
|
}
|
|
1049
|
-
function
|
|
1050
|
-
var n =
|
|
1049
|
+
function Mt(e, t) {
|
|
1050
|
+
var n = Z(e), r = Z(t);
|
|
1051
1051
|
return t.width < Infinity && t.height < Infinity ? n > r ? {
|
|
1052
1052
|
width: t.width,
|
|
1053
1053
|
height: t.width / n
|
|
@@ -1062,62 +1062,62 @@ function jt(e, t) {
|
|
|
1062
1062
|
height: t.height
|
|
1063
1063
|
} : e;
|
|
1064
1064
|
}
|
|
1065
|
-
function
|
|
1065
|
+
function Nt(e, t) {
|
|
1066
1066
|
var n = t * Math.PI / 180;
|
|
1067
1067
|
return {
|
|
1068
1068
|
width: Math.abs(e.width * Math.cos(n)) + Math.abs(e.height * Math.sin(n)),
|
|
1069
1069
|
height: Math.abs(e.width * Math.sin(n)) + Math.abs(e.height * Math.cos(n))
|
|
1070
1070
|
};
|
|
1071
1071
|
}
|
|
1072
|
-
function
|
|
1072
|
+
function Pt(e, t) {
|
|
1073
1073
|
var n = t * Math.PI / 180;
|
|
1074
1074
|
return {
|
|
1075
1075
|
left: e.left * Math.cos(n) - e.top * Math.sin(n),
|
|
1076
1076
|
top: e.left * Math.sin(n) + e.top * Math.cos(n)
|
|
1077
1077
|
};
|
|
1078
1078
|
}
|
|
1079
|
-
function
|
|
1080
|
-
var n =
|
|
1081
|
-
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,
|
|
1079
|
+
function Ft(e, t) {
|
|
1080
|
+
var n = Et(Q(e, t), t);
|
|
1081
|
+
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, kt(e, t)) : Math.min((e.height + n.top + n.bottom) / e.height, kt(e, t)) : 1;
|
|
1082
1082
|
}
|
|
1083
|
-
function
|
|
1083
|
+
function Q(e, t, n) {
|
|
1084
1084
|
n === void 0 && (n = !1);
|
|
1085
|
-
var r =
|
|
1086
|
-
return
|
|
1085
|
+
var r = At(e, t);
|
|
1086
|
+
return Y(e, n ? Ot(r) : r);
|
|
1087
1087
|
}
|
|
1088
|
-
function
|
|
1088
|
+
function It(e) {
|
|
1089
1089
|
return {
|
|
1090
1090
|
width: e.right !== void 0 && e.left !== void 0 ? e.right - e.left : Infinity,
|
|
1091
1091
|
height: e.bottom !== void 0 && e.top !== void 0 ? e.bottom - e.top : Infinity
|
|
1092
1092
|
};
|
|
1093
1093
|
}
|
|
1094
|
-
function
|
|
1095
|
-
return
|
|
1094
|
+
function Lt(e, t) {
|
|
1095
|
+
return K(K({}, e), {
|
|
1096
1096
|
minWidth: Math.min(t.width, e.minWidth),
|
|
1097
1097
|
minHeight: Math.min(t.height, e.minHeight),
|
|
1098
1098
|
maxWidth: Math.min(t.width, e.maxWidth),
|
|
1099
1099
|
maxHeight: Math.min(t.height, e.maxHeight)
|
|
1100
1100
|
});
|
|
1101
1101
|
}
|
|
1102
|
-
function
|
|
1102
|
+
function Rt(e, t, n) {
|
|
1103
1103
|
n === void 0 && (n = !0);
|
|
1104
1104
|
var r = {};
|
|
1105
|
-
return
|
|
1105
|
+
return _t.forEach((function(i) {
|
|
1106
1106
|
var a = e[i], o = t[i];
|
|
1107
1107
|
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;
|
|
1108
1108
|
})), r;
|
|
1109
1109
|
}
|
|
1110
|
-
function
|
|
1111
|
-
return
|
|
1110
|
+
function zt(e, t) {
|
|
1111
|
+
return Rt(e, t, !0);
|
|
1112
1112
|
}
|
|
1113
|
-
function
|
|
1113
|
+
function Bt(e) {
|
|
1114
1114
|
var t = e.size, n = e.aspectRatio, r = e.ignoreMinimum, i = e.sizeRestrictions;
|
|
1115
|
-
return !!((t.correctRatio ||
|
|
1115
|
+
return !!((t.correctRatio || Z(t) >= n.minimum && Z(t) <= n.maximum) && t.height <= i.maxHeight && t.width <= i.maxWidth && t.width && t.height && (r || t.height >= i.minHeight && t.width >= i.minWidth));
|
|
1116
1116
|
}
|
|
1117
|
-
function
|
|
1117
|
+
function Vt(e, t) {
|
|
1118
1118
|
return (e.width - t.width) ** 2 + (e.height - t.height) ** 2;
|
|
1119
1119
|
}
|
|
1120
|
-
function
|
|
1120
|
+
function Ht(e) {
|
|
1121
1121
|
var t = e.width, n = e.height, r = e.sizeRestrictions, i = {
|
|
1122
1122
|
minimum: e.aspectRatio && e.aspectRatio.minimum || 0,
|
|
1123
1123
|
maximum: e.aspectRatio && e.aspectRatio.maximum || Infinity
|
|
@@ -1127,15 +1127,15 @@ function Vt(e) {
|
|
|
1127
1127
|
};
|
|
1128
1128
|
function o(e, a) {
|
|
1129
1129
|
return a === void 0 && (a = !1), e.reduce((function(e, o) {
|
|
1130
|
-
return
|
|
1130
|
+
return Bt({
|
|
1131
1131
|
size: o,
|
|
1132
1132
|
aspectRatio: i,
|
|
1133
1133
|
sizeRestrictions: r,
|
|
1134
1134
|
ignoreMinimum: a
|
|
1135
|
-
}) && (!e ||
|
|
1135
|
+
}) && (!e || Vt(o, {
|
|
1136
1136
|
width: t,
|
|
1137
1137
|
height: n
|
|
1138
|
-
}) <
|
|
1138
|
+
}) < Vt(e, {
|
|
1139
1139
|
width: t,
|
|
1140
1140
|
height: n
|
|
1141
1141
|
})) ? o : e;
|
|
@@ -1152,7 +1152,7 @@ function Vt(e) {
|
|
|
1152
1152
|
height: a.height,
|
|
1153
1153
|
correctRatio: !0
|
|
1154
1154
|
});
|
|
1155
|
-
})),
|
|
1155
|
+
})), Bt({
|
|
1156
1156
|
size: a,
|
|
1157
1157
|
aspectRatio: i,
|
|
1158
1158
|
sizeRestrictions: r
|
|
@@ -1163,29 +1163,29 @@ function Vt(e) {
|
|
|
1163
1163
|
height: c.height
|
|
1164
1164
|
};
|
|
1165
1165
|
}
|
|
1166
|
-
function Ht(e) {
|
|
1167
|
-
var t = e.event, n = e.coordinates, r = e.positionRestrictions, i = r === void 0 ? {} : r, a = X(n, t.directions);
|
|
1168
|
-
return X(a, kt(a, i));
|
|
1169
|
-
}
|
|
1170
1166
|
function Ut(e) {
|
|
1167
|
+
var t = e.event, n = e.coordinates, r = e.positionRestrictions, i = r === void 0 ? {} : r, a = Y(n, t.directions);
|
|
1168
|
+
return Y(a, At(a, i));
|
|
1169
|
+
}
|
|
1170
|
+
function Wt(e) {
|
|
1171
1171
|
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) {
|
|
1172
|
-
return
|
|
1172
|
+
return Ut({
|
|
1173
1173
|
coordinates: e,
|
|
1174
1174
|
positionRestrictions: a,
|
|
1175
|
-
event: new
|
|
1175
|
+
event: new ut({
|
|
1176
1176
|
left: t.left - e.left,
|
|
1177
1177
|
top: t.top - e.top
|
|
1178
1178
|
})
|
|
1179
1179
|
});
|
|
1180
|
-
}, l =
|
|
1180
|
+
}, l = K({}, t);
|
|
1181
1181
|
return (Array.isArray(n) ? n : [n]).forEach((function(e) {
|
|
1182
1182
|
var t = {};
|
|
1183
|
-
|
|
1183
|
+
q((t = typeof e == "function" ? e({
|
|
1184
1184
|
coordinates: l,
|
|
1185
1185
|
imageSize: r,
|
|
1186
1186
|
visibleArea: s
|
|
1187
|
-
}) : e).width) &&
|
|
1188
|
-
return c(
|
|
1187
|
+
}) : e).width) && q(t.height) || (l = function(e, t) {
|
|
1188
|
+
return c(K(K(K({}, e), Ht({
|
|
1189
1189
|
width: t.width,
|
|
1190
1190
|
height: t.height,
|
|
1191
1191
|
sizeRestrictions: i,
|
|
@@ -1197,65 +1197,65 @@ function Ut(e) {
|
|
|
1197
1197
|
left: e.left,
|
|
1198
1198
|
top: e.top
|
|
1199
1199
|
});
|
|
1200
|
-
}(l,
|
|
1200
|
+
}(l, K(K({}, l), t))), q(t.left) && q(t.top) || (l = c(l, K(K({}, l), t)));
|
|
1201
1201
|
})), l;
|
|
1202
1202
|
}
|
|
1203
|
-
function
|
|
1204
|
-
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 =
|
|
1205
|
-
c =
|
|
1203
|
+
function Gt(e) {
|
|
1204
|
+
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 = K({}, r), f = K({}, i), p = K({}, a);
|
|
1205
|
+
c = Z(p), l = Z(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 = K(K({}, d), Ht({
|
|
1206
1206
|
sizeRestrictions: o,
|
|
1207
1207
|
width: d.width,
|
|
1208
1208
|
height: d.height,
|
|
1209
1209
|
aspectRatio: {
|
|
1210
|
-
minimum:
|
|
1211
|
-
maximum:
|
|
1210
|
+
minimum: Z(p),
|
|
1211
|
+
maximum: Z(p)
|
|
1212
1212
|
}
|
|
1213
1213
|
})));
|
|
1214
|
-
var m =
|
|
1214
|
+
var m = Ft(f = X(f, d.width * n.width / (f.width * p.width)), t({
|
|
1215
1215
|
visibleArea: f,
|
|
1216
1216
|
type: "resize"
|
|
1217
1217
|
}));
|
|
1218
|
-
return m !== 1 && (f =
|
|
1218
|
+
return m !== 1 && (f = X(f, m), d = X(d, m)), f = Q(f = Y(f, Tt(J(d), J(f))), t({
|
|
1219
1219
|
visibleArea: f,
|
|
1220
1220
|
type: "move"
|
|
1221
1221
|
})), {
|
|
1222
|
-
coordinates: d =
|
|
1222
|
+
coordinates: d = Q(d, zt(wt(f), s)),
|
|
1223
1223
|
visibleArea: f
|
|
1224
1224
|
};
|
|
1225
1225
|
}
|
|
1226
|
-
function
|
|
1227
|
-
var t = e.event, n = e.getAreaRestrictions, r = e.boundaries, i = e.coordinates, a = e.visibleArea, o = e.positionRestrictions, s =
|
|
1226
|
+
function Kt(e) {
|
|
1227
|
+
var t = e.event, n = e.getAreaRestrictions, r = e.boundaries, i = e.coordinates, a = e.visibleArea, o = e.positionRestrictions, s = K({}, i), c = K({}, a);
|
|
1228
1228
|
if (i && a && t.type !== "manipulateImage") {
|
|
1229
1229
|
var l = {
|
|
1230
1230
|
width: 0,
|
|
1231
1231
|
height: 0
|
|
1232
1232
|
};
|
|
1233
|
-
|
|
1234
|
-
var u =
|
|
1233
|
+
Z(r) > Z(s) ? (l.height = .8 * r.height, l.width = l.height * Z(s)) : (l.width = .8 * r.width, l.height = l.width * Z(s));
|
|
1234
|
+
var u = Ft(c = X(c, s.width * r.width / (c.width * l.width)), n({
|
|
1235
1235
|
visibleArea: c,
|
|
1236
1236
|
type: "resize"
|
|
1237
1237
|
}));
|
|
1238
|
-
c =
|
|
1238
|
+
c = X(c, u), u !== 1 && (l.height /= u, l.width /= u), c = Q(c = Y(c, Tt(J(s), J(c))), n({
|
|
1239
1239
|
visibleArea: c,
|
|
1240
1240
|
type: "move"
|
|
1241
|
-
})), s =
|
|
1241
|
+
})), s = Q(s, zt(wt(c), o));
|
|
1242
1242
|
}
|
|
1243
1243
|
return {
|
|
1244
1244
|
coordinates: s,
|
|
1245
1245
|
visibleArea: c
|
|
1246
1246
|
};
|
|
1247
1247
|
}
|
|
1248
|
-
function
|
|
1249
|
-
var t = e.event, n = e.coordinates, r = e.visibleArea, i = e.getAreaRestrictions, a =
|
|
1248
|
+
function qt(e) {
|
|
1249
|
+
var t = e.event, n = e.coordinates, r = e.visibleArea, i = e.getAreaRestrictions, a = K({}, r), o = K({}, n);
|
|
1250
1250
|
if (t.type === "setCoordinates") {
|
|
1251
1251
|
var s = Math.max(0, o.width - a.width), c = Math.max(0, o.height - a.height);
|
|
1252
|
-
s > c ? a =
|
|
1252
|
+
s > c ? a = X(a, Math.min(o.width / a.width, kt(a, i({
|
|
1253
1253
|
visibleArea: a,
|
|
1254
1254
|
type: "resize"
|
|
1255
|
-
})))) : c > s && (a =
|
|
1255
|
+
})))) : c > s && (a = X(a, Math.min(o.height / a.height, kt(a, i({
|
|
1256
1256
|
visibleArea: a,
|
|
1257
1257
|
type: "resize"
|
|
1258
|
-
}))))), a =
|
|
1258
|
+
}))))), a = Q(a = Y(a, Ot(At(o, wt(a)))), i({
|
|
1259
1259
|
visibleArea: a,
|
|
1260
1260
|
type: "move"
|
|
1261
1261
|
}));
|
|
@@ -1265,56 +1265,56 @@ function Kt(e) {
|
|
|
1265
1265
|
coordinates: o
|
|
1266
1266
|
};
|
|
1267
1267
|
}
|
|
1268
|
-
function
|
|
1268
|
+
function Jt(e) {
|
|
1269
1269
|
var t = e.imageSize, n = e.visibleArea, r = e.coordinates, i = n || t;
|
|
1270
1270
|
return {
|
|
1271
1271
|
left: (n ? n.left : 0) + i.width / 2 - r.width / 2,
|
|
1272
1272
|
top: (n ? n.top : 0) + i.height / 2 - r.height / 2
|
|
1273
1273
|
};
|
|
1274
1274
|
}
|
|
1275
|
-
function
|
|
1276
|
-
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,
|
|
1275
|
+
function Yt(e) {
|
|
1276
|
+
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, Z(a))), s = a.width < a.height ? {
|
|
1277
1277
|
width: .8 * a.width,
|
|
1278
1278
|
height: .8 * a.width / o
|
|
1279
1279
|
} : {
|
|
1280
1280
|
height: .8 * a.height,
|
|
1281
1281
|
width: .8 * a.height * o
|
|
1282
1282
|
};
|
|
1283
|
-
return
|
|
1283
|
+
return Ht(K(K({}, s), {
|
|
1284
1284
|
aspectRatio: r,
|
|
1285
1285
|
sizeRestrictions: i
|
|
1286
1286
|
}));
|
|
1287
1287
|
}
|
|
1288
|
-
function
|
|
1288
|
+
function Xt(e) {
|
|
1289
1289
|
var t, n, r = e.imageSize, i = e.visibleArea, a = e.boundaries, o = e.aspectRatio, s = e.sizeRestrictions, c = e.stencilSize, l = i || r;
|
|
1290
|
-
return
|
|
1290
|
+
return Z(l) > Z(a) ? n = (t = c.height * l.height / a.height) * Z(c) : t = (n = c.width * l.width / a.width) / Z(c), Ht({
|
|
1291
1291
|
width: n,
|
|
1292
1292
|
height: t,
|
|
1293
1293
|
aspectRatio: o,
|
|
1294
1294
|
sizeRestrictions: s
|
|
1295
1295
|
});
|
|
1296
1296
|
}
|
|
1297
|
-
function
|
|
1298
|
-
var t = e.getAreaRestrictions, n = e.coordinates, r = e.imageSize, i =
|
|
1297
|
+
function Zt(e) {
|
|
1298
|
+
var t = e.getAreaRestrictions, n = e.coordinates, r = e.imageSize, i = Z(e.boundaries);
|
|
1299
1299
|
if (n) {
|
|
1300
1300
|
var a = {
|
|
1301
1301
|
height: Math.max(n.height, r.height),
|
|
1302
1302
|
width: Math.max(n.width, r.width)
|
|
1303
|
-
}, o =
|
|
1304
|
-
width:
|
|
1305
|
-
height:
|
|
1306
|
-
},
|
|
1303
|
+
}, o = Mt({
|
|
1304
|
+
width: Z(a) > i ? a.width : a.height * i,
|
|
1305
|
+
height: Z(a) > i ? a.width / i : a.height
|
|
1306
|
+
}, It(t())), s = {
|
|
1307
1307
|
left: n.left + n.width / 2 - o.width / 2,
|
|
1308
1308
|
top: n.top + n.height / 2 - o.height / 2,
|
|
1309
1309
|
width: o.width,
|
|
1310
1310
|
height: o.height
|
|
1311
|
-
}, c =
|
|
1311
|
+
}, c = Et(n, wt(K({
|
|
1312
1312
|
left: 0,
|
|
1313
1313
|
top: 0
|
|
1314
1314
|
}, r))), l = {};
|
|
1315
|
-
return !c.left && !c.right && s.width <= r.width && (l.left = 0, l.right = r.width), !c.top && !c.bottom && s.height <= r.height && (l.top = 0, l.bottom = r.height),
|
|
1315
|
+
return !c.left && !c.right && s.width <= r.width && (l.left = 0, l.right = r.width), !c.top && !c.bottom && s.height <= r.height && (l.top = 0, l.bottom = r.height), Q(s, l);
|
|
1316
1316
|
}
|
|
1317
|
-
var u =
|
|
1317
|
+
var u = Z(r);
|
|
1318
1318
|
return o = {
|
|
1319
1319
|
height: u > i ? r.height : r.width / i,
|
|
1320
1320
|
width: u > i ? r.height * i : r.width
|
|
@@ -1325,28 +1325,28 @@ function Xt(e) {
|
|
|
1325
1325
|
height: o.height
|
|
1326
1326
|
};
|
|
1327
1327
|
}
|
|
1328
|
-
function
|
|
1329
|
-
return
|
|
1328
|
+
function Qt(e, t) {
|
|
1329
|
+
return Rt(e, wt(t));
|
|
1330
1330
|
}
|
|
1331
|
-
function
|
|
1332
|
-
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 =
|
|
1333
|
-
u =
|
|
1331
|
+
function $t(e) {
|
|
1332
|
+
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 = K({}, r), d = K({}, n), f = 1, p = 1, m = c.factor && Math.abs(c.factor - 1) > .001;
|
|
1333
|
+
u = Y(u, {
|
|
1334
1334
|
left: l.left || 0,
|
|
1335
1335
|
top: l.top || 0
|
|
1336
1336
|
});
|
|
1337
1337
|
var h = {
|
|
1338
1338
|
stencil: {
|
|
1339
1339
|
minimum: Math.max(i.minWidth ? i.minWidth / d.width : 0, i.minHeight ? i.minHeight / d.height : 0),
|
|
1340
|
-
maximum: Math.min(i.maxWidth ? i.maxWidth / d.width : Infinity, i.maxHeight ? i.maxHeight / d.height : Infinity,
|
|
1340
|
+
maximum: Math.min(i.maxWidth ? i.maxWidth / d.width : Infinity, i.maxHeight ? i.maxHeight / d.height : Infinity, kt(d, o))
|
|
1341
1341
|
},
|
|
1342
|
-
area: { maximum:
|
|
1342
|
+
area: { maximum: kt(u, a({
|
|
1343
1343
|
visibleArea: u,
|
|
1344
1344
|
type: "resize"
|
|
1345
1345
|
})) }
|
|
1346
1346
|
};
|
|
1347
|
-
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 =
|
|
1347
|
+
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 = X(u, p, c.center));
|
|
1348
1348
|
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);
|
|
1349
|
-
return u =
|
|
1349
|
+
return u = Q(u = Y(u, At(u, {
|
|
1350
1350
|
left: o.left === void 0 ? void 0 : o.left - g * p,
|
|
1351
1351
|
top: o.top === void 0 ? void 0 : o.top - v * p,
|
|
1352
1352
|
bottom: o.bottom === void 0 ? void 0 : o.bottom + y * p,
|
|
@@ -1354,49 +1354,49 @@ function Qt(e) {
|
|
|
1354
1354
|
})), a({
|
|
1355
1355
|
visibleArea: u,
|
|
1356
1356
|
type: "move"
|
|
1357
|
-
})), d.width *= p, d.height *= p, d.left = u.left + g * p, d.top = u.top + v * p, d =
|
|
1357
|
+
})), d.width *= p, d.height *= p, d.left = u.left + g * p, d.top = u.top + v * p, d = Q(d, zt(wt(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 = Y(u = Q(u = X(u, f, c.factor > 1 ? c.center : J(d)), a({
|
|
1358
1358
|
visibleArea: u,
|
|
1359
1359
|
type: "move"
|
|
1360
|
-
})),
|
|
1360
|
+
})), Ot(At(d, wt(u)))))), {
|
|
1361
1361
|
coordinates: d,
|
|
1362
1362
|
visibleArea: u
|
|
1363
1363
|
};
|
|
1364
1364
|
}
|
|
1365
|
-
function
|
|
1366
|
-
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 =
|
|
1365
|
+
function en(e) {
|
|
1366
|
+
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 = K({}, r), d = K({}, i), f = Pt(J(K({
|
|
1367
1367
|
left: 0,
|
|
1368
1368
|
top: 0
|
|
1369
1369
|
}, c)), l);
|
|
1370
|
-
return (u =
|
|
1370
|
+
return (u = K(K({}, Ht({
|
|
1371
1371
|
sizeRestrictions: a,
|
|
1372
1372
|
aspectRatio: t,
|
|
1373
1373
|
width: u.width,
|
|
1374
1374
|
height: u.height
|
|
1375
|
-
})),
|
|
1375
|
+
})), Pt(J(u), l))).left -= f.left - s.width / 2 + u.width / 2, u.top -= f.top - s.height / 2 + u.height / 2, d = X(d, Ft(d, n({
|
|
1376
1376
|
visibleArea: d,
|
|
1377
1377
|
type: "resize"
|
|
1378
1378
|
}))), {
|
|
1379
|
-
coordinates: u =
|
|
1380
|
-
visibleArea: d =
|
|
1379
|
+
coordinates: u = Q(u, o),
|
|
1380
|
+
visibleArea: d = Q(d = Y(d, Tt(J(u), J(r))), n({
|
|
1381
1381
|
visibleArea: d,
|
|
1382
1382
|
type: "move"
|
|
1383
1383
|
}))
|
|
1384
1384
|
};
|
|
1385
1385
|
}
|
|
1386
|
-
function
|
|
1387
|
-
var t = e.flip, n = e.previousFlip, r = e.rotate, i = e.getAreaRestrictions, a = e.coordinates, o = e.visibleArea, s = e.imageSize, c =
|
|
1386
|
+
function tn(e) {
|
|
1387
|
+
var t = e.flip, n = e.previousFlip, r = e.rotate, i = e.getAreaRestrictions, a = e.coordinates, o = e.visibleArea, s = e.imageSize, c = K({}, a), l = K({}, o), u = n.horizontal !== t.horizontal, d = n.vertical !== t.vertical;
|
|
1388
1388
|
if (u || d) {
|
|
1389
|
-
var f =
|
|
1389
|
+
var f = Pt({
|
|
1390
1390
|
left: s.width / 2,
|
|
1391
1391
|
top: s.height / 2
|
|
1392
|
-
}, -r), p =
|
|
1392
|
+
}, -r), p = Pt(J(c), -r), m = Pt({
|
|
1393
1393
|
left: u ? f.left - (p.left - f.left) : p.left,
|
|
1394
1394
|
top: d ? f.top - (p.top - f.top) : p.top
|
|
1395
1395
|
}, r);
|
|
1396
|
-
c =
|
|
1396
|
+
c = Y(c, Tt(m, J(c))), p = Pt(J(l), -r), l = Q(l = Y(l, Tt(m = Pt({
|
|
1397
1397
|
left: u ? f.left - (p.left - f.left) : p.left,
|
|
1398
1398
|
top: d ? f.top - (p.top - f.top) : p.top
|
|
1399
|
-
}, r),
|
|
1399
|
+
}, r), J(l))), i({
|
|
1400
1400
|
visibleArea: l,
|
|
1401
1401
|
type: "move"
|
|
1402
1402
|
}));
|
|
@@ -1406,11 +1406,11 @@ function en(e) {
|
|
|
1406
1406
|
visibleArea: l
|
|
1407
1407
|
};
|
|
1408
1408
|
}
|
|
1409
|
-
function
|
|
1410
|
-
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 =
|
|
1409
|
+
function nn(e) {
|
|
1410
|
+
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 = K({}, t), l = Dt(n, c).width, u = Dt(n, c).height;
|
|
1411
1411
|
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)));
|
|
1412
|
-
var d =
|
|
1413
|
-
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 =
|
|
1412
|
+
var d = Et(Dt(n, c), i);
|
|
1413
|
+
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 = Et(Dt(n, c), i));
|
|
1414
1414
|
var f = {
|
|
1415
1415
|
width: Infinity,
|
|
1416
1416
|
height: Infinity,
|
|
@@ -1419,37 +1419,37 @@ function tn(e) {
|
|
|
1419
1419
|
top: Infinity,
|
|
1420
1420
|
bottom: Infinity
|
|
1421
1421
|
};
|
|
1422
|
-
if (
|
|
1422
|
+
if (_t.forEach((function(e) {
|
|
1423
1423
|
var t = d[e];
|
|
1424
1424
|
t && c[e] && (f[e] = Math.max(0, 1 - t / c[e]));
|
|
1425
1425
|
})), o) {
|
|
1426
|
-
var p = Math.min.apply(null,
|
|
1426
|
+
var p = Math.min.apply(null, _t.map((function(e) {
|
|
1427
1427
|
return f[e];
|
|
1428
1428
|
})));
|
|
1429
|
-
p !== Infinity &&
|
|
1429
|
+
p !== Infinity && _t.forEach((function(e) {
|
|
1430
1430
|
c[e] *= p;
|
|
1431
1431
|
}));
|
|
1432
|
-
} else
|
|
1432
|
+
} else _t.forEach((function(e) {
|
|
1433
1433
|
f[e] !== Infinity && (c[e] *= f[e]);
|
|
1434
1434
|
}));
|
|
1435
|
-
if (l =
|
|
1435
|
+
if (l = Dt(n, c).width, u = Dt(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) {
|
|
1436
1436
|
var m = Math.min(f.width, f.height);
|
|
1437
|
-
m !== Infinity &&
|
|
1437
|
+
m !== Infinity && _t.forEach((function(e) {
|
|
1438
1438
|
c[e] *= m;
|
|
1439
1439
|
}));
|
|
1440
|
-
} else f.width !== Infinity &&
|
|
1440
|
+
} else f.width !== Infinity && vt.forEach((function(e) {
|
|
1441
1441
|
c[e] *= f.width;
|
|
1442
|
-
})), f.height !== Infinity &&
|
|
1442
|
+
})), f.height !== Infinity && yt.forEach((function(e) {
|
|
1443
1443
|
c[e] *= f.height;
|
|
1444
1444
|
}));
|
|
1445
1445
|
return c;
|
|
1446
1446
|
}
|
|
1447
|
-
function
|
|
1447
|
+
function rn(e, t, n) {
|
|
1448
1448
|
return t == 0 && n == 0 ? e / 2 : t == 0 ? 0 : n == 0 ? e : e * Math.abs(t / (t + n));
|
|
1449
1449
|
}
|
|
1450
|
-
var
|
|
1450
|
+
var an = Ye("vue-simple-handler"), on = Ye("vue-simple-handler-wrapper"), sn = {
|
|
1451
1451
|
name: "SimpleHandler",
|
|
1452
|
-
components: { HandlerWrapper:
|
|
1452
|
+
components: { HandlerWrapper: mt },
|
|
1453
1453
|
props: {
|
|
1454
1454
|
defaultClass: { type: String },
|
|
1455
1455
|
hoverClass: { type: String },
|
|
@@ -1467,8 +1467,8 @@ var rn = K("vue-simple-handler"), an = K("vue-simple-handler-wrapper"), on = {
|
|
|
1467
1467
|
computed: { classes: function() {
|
|
1468
1468
|
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);
|
|
1469
1469
|
return {
|
|
1470
|
-
default: G(
|
|
1471
|
-
wrapper: G(
|
|
1470
|
+
default: G(an(t), this.defaultClass, this.hover && this.hoverClass),
|
|
1471
|
+
wrapper: G(on(t), this.wrapperClass)
|
|
1472
1472
|
};
|
|
1473
1473
|
} },
|
|
1474
1474
|
methods: {
|
|
@@ -1487,7 +1487,7 @@ var rn = K("vue-simple-handler"), an = K("vue-simple-handler-wrapper"), on = {
|
|
|
1487
1487
|
},
|
|
1488
1488
|
emits: ["drag", "drag-end"]
|
|
1489
1489
|
};
|
|
1490
|
-
|
|
1490
|
+
sn.render = function(e, t, n, r, i, a) {
|
|
1491
1491
|
var o = x("HandlerWrapper");
|
|
1492
1492
|
return z(), h(o, {
|
|
1493
1493
|
class: a.classes.wrapper,
|
|
@@ -1499,7 +1499,7 @@ on.render = function(e, t, n, r, i, a) {
|
|
|
1499
1499
|
onEnter: a.onEnter,
|
|
1500
1500
|
onLeave: a.onLeave
|
|
1501
1501
|
}, {
|
|
1502
|
-
default:
|
|
1502
|
+
default: P((function() {
|
|
1503
1503
|
return [p("div", { class: a.classes.default }, null, 2)];
|
|
1504
1504
|
})),
|
|
1505
1505
|
_: 1
|
|
@@ -1514,9 +1514,9 @@ on.render = function(e, t, n, r, i, a) {
|
|
|
1514
1514
|
"onLeave"
|
|
1515
1515
|
]);
|
|
1516
1516
|
};
|
|
1517
|
-
var
|
|
1517
|
+
var cn = Ye("vue-simple-line"), ln = Ye("vue-simple-line-wrapper"), un = {
|
|
1518
1518
|
name: "SimpleLine",
|
|
1519
|
-
components: { LineWrapper:
|
|
1519
|
+
components: { LineWrapper: gt },
|
|
1520
1520
|
props: {
|
|
1521
1521
|
defaultClass: { type: String },
|
|
1522
1522
|
hoverClass: { type: String },
|
|
@@ -1532,8 +1532,8 @@ var sn = K("vue-simple-line"), cn = K("vue-simple-line-wrapper"), ln = {
|
|
|
1532
1532
|
},
|
|
1533
1533
|
computed: { classes: function() {
|
|
1534
1534
|
return {
|
|
1535
|
-
root: G(
|
|
1536
|
-
wrapper: G(
|
|
1535
|
+
root: G(cn(W({}, this.position, !0)), this.defaultClass, this.hover && this.hoverClass),
|
|
1536
|
+
wrapper: G(ln(W({}, this.position, !0)), this.wrapperClass)
|
|
1537
1537
|
};
|
|
1538
1538
|
} },
|
|
1539
1539
|
methods: {
|
|
@@ -1552,7 +1552,7 @@ var sn = K("vue-simple-line"), cn = K("vue-simple-line-wrapper"), ln = {
|
|
|
1552
1552
|
},
|
|
1553
1553
|
emits: ["drag", "drag-end"]
|
|
1554
1554
|
};
|
|
1555
|
-
|
|
1555
|
+
un.render = function(e, t, n, r, i, a) {
|
|
1556
1556
|
var o = x("LineWrapper");
|
|
1557
1557
|
return z(), h(o, {
|
|
1558
1558
|
class: a.classes.wrapper,
|
|
@@ -1563,7 +1563,7 @@ ln.render = function(e, t, n, r, i, a) {
|
|
|
1563
1563
|
onEnter: a.onEnter,
|
|
1564
1564
|
onLeave: a.onLeave
|
|
1565
1565
|
}, {
|
|
1566
|
-
default:
|
|
1566
|
+
default: P((function() {
|
|
1567
1567
|
return [p("div", { class: a.classes.root }, null, 2)];
|
|
1568
1568
|
})),
|
|
1569
1569
|
_: 1
|
|
@@ -1577,15 +1577,15 @@ ln.render = function(e, t, n, r, i, a) {
|
|
|
1577
1577
|
"onLeave"
|
|
1578
1578
|
]);
|
|
1579
1579
|
};
|
|
1580
|
-
var
|
|
1580
|
+
var dn = Ye("vue-bounding-box"), fn = [
|
|
1581
1581
|
"east",
|
|
1582
1582
|
"west",
|
|
1583
1583
|
null
|
|
1584
|
-
],
|
|
1584
|
+
], pn = [
|
|
1585
1585
|
"south",
|
|
1586
1586
|
"north",
|
|
1587
1587
|
null
|
|
1588
|
-
],
|
|
1588
|
+
], mn = {
|
|
1589
1589
|
name: "BoundingBox",
|
|
1590
1590
|
props: {
|
|
1591
1591
|
width: { type: Number },
|
|
@@ -1609,7 +1609,7 @@ var un = K("vue-bounding-box"), dn = [
|
|
|
1609
1609
|
handlersComponent: {
|
|
1610
1610
|
type: [Object, String],
|
|
1611
1611
|
default: function() {
|
|
1612
|
-
return
|
|
1612
|
+
return sn;
|
|
1613
1613
|
}
|
|
1614
1614
|
},
|
|
1615
1615
|
handlersClasses: {
|
|
@@ -1638,7 +1638,7 @@ var un = K("vue-bounding-box"), dn = [
|
|
|
1638
1638
|
linesComponent: {
|
|
1639
1639
|
type: [Object, String],
|
|
1640
1640
|
default: function() {
|
|
1641
|
-
return
|
|
1641
|
+
return un;
|
|
1642
1642
|
}
|
|
1643
1643
|
},
|
|
1644
1644
|
linesClasses: {
|
|
@@ -1660,10 +1660,10 @@ var un = K("vue-bounding-box"), dn = [
|
|
|
1660
1660
|
},
|
|
1661
1661
|
data: function() {
|
|
1662
1662
|
var e = [];
|
|
1663
|
-
return
|
|
1664
|
-
|
|
1663
|
+
return fn.forEach((function(t) {
|
|
1664
|
+
pn.forEach((function(n) {
|
|
1665
1665
|
if (t !== n) {
|
|
1666
|
-
var r =
|
|
1666
|
+
var r = Qe(t, n);
|
|
1667
1667
|
e.push({
|
|
1668
1668
|
name: r.name,
|
|
1669
1669
|
classname: r.classname,
|
|
@@ -1682,7 +1682,7 @@ var un = K("vue-bounding-box"), dn = [
|
|
|
1682
1682
|
classes: function() {
|
|
1683
1683
|
var e = this.handlersClasses, t = this.handlersWrappersClasses, n = this.linesClasses, r = this.linesWrappersClasses;
|
|
1684
1684
|
return {
|
|
1685
|
-
root:
|
|
1685
|
+
root: dn(),
|
|
1686
1686
|
handlers: e,
|
|
1687
1687
|
handlersWrappers: t,
|
|
1688
1688
|
lines: n,
|
|
@@ -1720,8 +1720,8 @@ var un = K("vue-bounding-box"), dn = [
|
|
|
1720
1720
|
};
|
|
1721
1721
|
if (n && r) {
|
|
1722
1722
|
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;
|
|
1723
|
-
a.wrapperClass =
|
|
1724
|
-
} else a.wrapperClass =
|
|
1723
|
+
a.wrapperClass = dn("handler"), a.wrapperStyle = { transform: `translate(${c}px, ${l}px)` }, e.transitions && e.transitions.enabled && (a.wrapperStyle.transition = `${e.transitions.time}ms ${e.transitions.timingFunction}`);
|
|
1724
|
+
} else a.wrapperClass = dn("handler", W({}, i.classname, !0));
|
|
1725
1725
|
t.push(a);
|
|
1726
1726
|
}
|
|
1727
1727
|
})), t;
|
|
@@ -1747,7 +1747,7 @@ var un = K("vue-bounding-box"), dn = [
|
|
|
1747
1747
|
top: 0,
|
|
1748
1748
|
bottom: 0
|
|
1749
1749
|
};
|
|
1750
|
-
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
|
|
1750
|
+
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 lt(s, {
|
|
1751
1751
|
allowedDirections: {
|
|
1752
1752
|
left: t === "west" || !t,
|
|
1753
1753
|
right: t === "east" || !t,
|
|
@@ -1761,7 +1761,7 @@ var un = K("vue-bounding-box"), dn = [
|
|
|
1761
1761
|
},
|
|
1762
1762
|
emits: ["resize", "resize-end"]
|
|
1763
1763
|
};
|
|
1764
|
-
|
|
1764
|
+
mn.render = function(e, t, n, r, i, a) {
|
|
1765
1765
|
return z(), h("div", {
|
|
1766
1766
|
ref: "box",
|
|
1767
1767
|
class: a.classes.root,
|
|
@@ -1821,7 +1821,7 @@ pn.render = function(e, t, n, r, i, a) {
|
|
|
1821
1821
|
})), 128))
|
|
1822
1822
|
], 6);
|
|
1823
1823
|
};
|
|
1824
|
-
var
|
|
1824
|
+
var hn = Ye("vue-draggable-area"), gn = {
|
|
1825
1825
|
name: "DraggableArea",
|
|
1826
1826
|
props: {
|
|
1827
1827
|
movable: {
|
|
@@ -1834,7 +1834,7 @@ var mn = K("vue-draggable-area"), hn = {
|
|
|
1834
1834
|
}
|
|
1835
1835
|
},
|
|
1836
1836
|
computed: { classnames: function() {
|
|
1837
|
-
return { default:
|
|
1837
|
+
return { default: hn() };
|
|
1838
1838
|
} },
|
|
1839
1839
|
beforeMount: function() {
|
|
1840
1840
|
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 });
|
|
@@ -1856,7 +1856,7 @@ var mn = K("vue-draggable-area"), hn = {
|
|
|
1856
1856
|
this.touchStarted = !1, this.processEnd();
|
|
1857
1857
|
},
|
|
1858
1858
|
onTouchMove: function(e) {
|
|
1859
|
-
this.touches.length >= 1 && (this.touchStarted ? (this.processMove(e, e.touches), e.preventDefault(), e.stopPropagation()) :
|
|
1859
|
+
this.touches.length >= 1 && (this.touchStarted ? (this.processMove(e, e.touches), e.preventDefault(), e.stopPropagation()) : st({
|
|
1860
1860
|
x: this.touches[0].clientX,
|
|
1861
1861
|
y: this.touches[0].clientY
|
|
1862
1862
|
}, {
|
|
@@ -1898,7 +1898,7 @@ var mn = K("vue-draggable-area"), hn = {
|
|
|
1898
1898
|
var n = We(t);
|
|
1899
1899
|
if (this.touches.length) {
|
|
1900
1900
|
var r = this.$refs.container.getBoundingClientRect(), i = r.left, a = r.top;
|
|
1901
|
-
this.touches.length === 1 && n.length === 1 && this.$emit("move", new
|
|
1901
|
+
this.touches.length === 1 && n.length === 1 && this.$emit("move", new ut({
|
|
1902
1902
|
left: n[0].clientX - (i + this.anchor.x),
|
|
1903
1903
|
top: n[0].clientY - (a + this.anchor.y)
|
|
1904
1904
|
}));
|
|
@@ -1910,7 +1910,7 @@ var mn = K("vue-draggable-area"), hn = {
|
|
|
1910
1910
|
},
|
|
1911
1911
|
emits: ["move", "move-end"]
|
|
1912
1912
|
};
|
|
1913
|
-
|
|
1913
|
+
gn.render = function(e, t, n, r, i, a) {
|
|
1914
1914
|
return z(), h("div", {
|
|
1915
1915
|
ref: "container",
|
|
1916
1916
|
onTouchstart: t[1] ||= function() {
|
|
@@ -1921,7 +1921,7 @@ hn.render = function(e, t, n, r, i, a) {
|
|
|
1921
1921
|
}
|
|
1922
1922
|
}, [c(e.$slots, "default")], 544);
|
|
1923
1923
|
};
|
|
1924
|
-
function
|
|
1924
|
+
function _n(e) {
|
|
1925
1925
|
return {
|
|
1926
1926
|
rotate: e.rotate || 0,
|
|
1927
1927
|
flip: {
|
|
@@ -1930,7 +1930,7 @@ function gn(e) {
|
|
|
1930
1930
|
}
|
|
1931
1931
|
};
|
|
1932
1932
|
}
|
|
1933
|
-
function
|
|
1933
|
+
function vn(e) {
|
|
1934
1934
|
return new Promise((function(t, n) {
|
|
1935
1935
|
try {
|
|
1936
1936
|
if (e) if (/^data:/i.test(e)) t(function(e) {
|
|
@@ -1962,11 +1962,11 @@ function _n(e) {
|
|
|
1962
1962
|
var a, o, s;
|
|
1963
1963
|
}));
|
|
1964
1964
|
}
|
|
1965
|
-
function
|
|
1965
|
+
function yn(e) {
|
|
1966
1966
|
var t = e.rotate, n = e.flip, r = e.scaleX, i = e.scaleY, a = "";
|
|
1967
1967
|
return a += " rotate(" + t + "deg) ", a += " scaleX(" + r * (n.horizontal ? -1 : 1) + ") ", a += " scaleY(" + i * (n.vertical ? -1 : 1) + ") ";
|
|
1968
1968
|
}
|
|
1969
|
-
function
|
|
1969
|
+
function bn(e) {
|
|
1970
1970
|
try {
|
|
1971
1971
|
var t, n = new DataView(e), r = void 0, i = void 0, a = void 0, o = void 0;
|
|
1972
1972
|
if (n.getUint8(0) === 255 && n.getUint8(1) === 216) for (var s = n.byteLength, c = 2; c + 1 < s;) {
|
|
@@ -1998,64 +1998,7 @@ function yn(e) {
|
|
|
1998
1998
|
return null;
|
|
1999
1999
|
}
|
|
2000
2000
|
}
|
|
2001
|
-
|
|
2002
|
-
name: "PreviewResult",
|
|
2003
|
-
props: {
|
|
2004
|
-
image: { type: Object },
|
|
2005
|
-
transitions: { type: Object },
|
|
2006
|
-
stencilCoordinates: {
|
|
2007
|
-
type: Object,
|
|
2008
|
-
default: function() {
|
|
2009
|
-
return {
|
|
2010
|
-
width: 0,
|
|
2011
|
-
height: 0,
|
|
2012
|
-
left: 0,
|
|
2013
|
-
top: 0
|
|
2014
|
-
};
|
|
2015
|
-
}
|
|
2016
|
-
},
|
|
2017
|
-
imageClass: { type: String }
|
|
2018
|
-
},
|
|
2019
|
-
computed: {
|
|
2020
|
-
classes: function() {
|
|
2021
|
-
return {
|
|
2022
|
-
root: bn(),
|
|
2023
|
-
wrapper: bn("wrapper"),
|
|
2024
|
-
imageWrapper: bn("image-wrapper"),
|
|
2025
|
-
image: G(bn("image"), this.imageClass)
|
|
2026
|
-
};
|
|
2027
|
-
},
|
|
2028
|
-
wrapperStyle: function() {
|
|
2029
|
-
var e = {
|
|
2030
|
-
width: `${this.stencilCoordinates.width}px`,
|
|
2031
|
-
height: `${this.stencilCoordinates.height}px`,
|
|
2032
|
-
left: `calc(50% - ${this.stencilCoordinates.width / 2}px)`,
|
|
2033
|
-
top: `calc(50% - ${this.stencilCoordinates.height / 2}px)`
|
|
2034
|
-
};
|
|
2035
|
-
return this.transitions && this.transitions.enabled && (e.transition = `${this.transitions.time}ms ${this.transitions.timingFunction}`), e;
|
|
2036
|
-
},
|
|
2037
|
-
imageStyle: function() {
|
|
2038
|
-
var e = this.image.transforms, t = Mt({
|
|
2039
|
-
width: this.image.width,
|
|
2040
|
-
height: this.image.height
|
|
2041
|
-
}, e.rotate), n = {
|
|
2042
|
-
width: `${this.image.width}px`,
|
|
2043
|
-
height: `${this.image.height}px`,
|
|
2044
|
-
left: "0px",
|
|
2045
|
-
top: "0px"
|
|
2046
|
-
}, r = {
|
|
2047
|
-
left: (this.image.width - t.width) * e.scaleX / 2,
|
|
2048
|
-
top: (this.image.height - t.height) * e.scaleY / 2
|
|
2049
|
-
}, i = {
|
|
2050
|
-
left: (1 - e.scaleX) * this.image.width / 2,
|
|
2051
|
-
top: (1 - e.scaleY) * this.image.height / 2
|
|
2052
|
-
};
|
|
2053
|
-
return n.transform = `translate(
|
|
2054
|
-
${-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;
|
|
2055
|
-
}
|
|
2056
|
-
}
|
|
2057
|
-
};
|
|
2058
|
-
function Sn(e, t) {
|
|
2001
|
+
function xn(e, t) {
|
|
2059
2002
|
var n = t.getBoundingClientRect(), r = n.left, i = n.top, a = {
|
|
2060
2003
|
left: 0,
|
|
2061
2004
|
top: 0
|
|
@@ -2063,7 +2006,7 @@ function Sn(e, t) {
|
|
|
2063
2006
|
return e.forEach((function(t) {
|
|
2064
2007
|
a.left += (t.clientX - r) / e.length, a.top += (t.clientY - i) / e.length;
|
|
2065
2008
|
})), e.forEach((function(e) {
|
|
2066
|
-
o +=
|
|
2009
|
+
o += st({
|
|
2067
2010
|
x: a.left,
|
|
2068
2011
|
y: a.top
|
|
2069
2012
|
}, {
|
|
@@ -2076,19 +2019,7 @@ function Sn(e, t) {
|
|
|
2076
2019
|
count: e.length
|
|
2077
2020
|
};
|
|
2078
2021
|
}
|
|
2079
|
-
|
|
2080
|
-
return z(), h("div", { class: a.classes.root }, [p("div", {
|
|
2081
|
-
ref: "wrapper",
|
|
2082
|
-
class: a.classes.wrapper,
|
|
2083
|
-
style: a.wrapperStyle
|
|
2084
|
-
}, [p("img", {
|
|
2085
|
-
ref: "image",
|
|
2086
|
-
src: n.image.src,
|
|
2087
|
-
class: a.classes.image,
|
|
2088
|
-
style: a.imageStyle
|
|
2089
|
-
}, null, 14, ["src"])], 6)], 2);
|
|
2090
|
-
};
|
|
2091
|
-
var Cn = {
|
|
2022
|
+
var Sn = {
|
|
2092
2023
|
props: {
|
|
2093
2024
|
touchMove: {
|
|
2094
2025
|
type: Boolean,
|
|
@@ -2118,18 +2049,18 @@ var Cn = {
|
|
|
2118
2049
|
window.removeEventListener("mouseup", this.onMouseUp), window.removeEventListener("mousemove", this.onMouseMove), window.removeEventListener("touchmove", this.onTouchMove), window.removeEventListener("touchend", this.onTouchEnd);
|
|
2119
2050
|
},
|
|
2120
2051
|
created: function() {
|
|
2121
|
-
this.transforming = !1, this.debouncedProcessEnd =
|
|
2052
|
+
this.transforming = !1, this.debouncedProcessEnd = Ze(this.processEnd), this.touches = [];
|
|
2122
2053
|
},
|
|
2123
2054
|
methods: {
|
|
2124
2055
|
processMove: function(e, t) {
|
|
2125
2056
|
if (this.touches.length) {
|
|
2126
|
-
if (this.touches.length === 1 && t.length === 1) this.$emit("move", new
|
|
2057
|
+
if (this.touches.length === 1 && t.length === 1) this.$emit("move", new ct({
|
|
2127
2058
|
left: this.touches[0].clientX - t[0].clientX,
|
|
2128
2059
|
top: this.touches[0].clientY - t[0].clientY
|
|
2129
2060
|
}));
|
|
2130
2061
|
else if (this.touches.length > 1 && this.touchResize) {
|
|
2131
|
-
var n =
|
|
2132
|
-
r.count === n.count && r.count > 1 && this.$emit("resize", new
|
|
2062
|
+
var n = xn(t, this.$refs.container), r = this.oldGeometricProperties;
|
|
2063
|
+
r.count === n.count && r.count > 1 && this.$emit("resize", new ct({
|
|
2133
2064
|
left: r.centerMass.left - n.centerMass.left,
|
|
2134
2065
|
top: r.centerMass.top - n.centerMass.top
|
|
2135
2066
|
}, {
|
|
@@ -2154,7 +2085,7 @@ var Cn = {
|
|
|
2154
2085
|
var t = this.$refs.container, n = t.getBoundingClientRect(), r = n.left, i = n.top, a = n.bottom, o = n.right;
|
|
2155
2086
|
this.touches = We(e.touches).filter((function(e) {
|
|
2156
2087
|
return e.clientX > r && e.clientX < o && e.clientY > i && e.clientY < a;
|
|
2157
|
-
})), this.oldGeometricProperties =
|
|
2088
|
+
})), this.oldGeometricProperties = xn(this.touches, t);
|
|
2158
2089
|
}
|
|
2159
2090
|
},
|
|
2160
2091
|
onTouchEnd: function(e) {
|
|
@@ -2192,11 +2123,11 @@ var Cn = {
|
|
|
2192
2123
|
},
|
|
2193
2124
|
onWheel: function(e) {
|
|
2194
2125
|
if (this.wheelResize && this.processEvent(e)) {
|
|
2195
|
-
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 ||
|
|
2126
|
+
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 || ot(s) ? s : s > 0 ? 1 : -1), a = {
|
|
2196
2127
|
left: e.clientX - n,
|
|
2197
2128
|
top: e.clientY - r
|
|
2198
2129
|
};
|
|
2199
|
-
this.$emit("resize", new
|
|
2130
|
+
this.$emit("resize", new ct({}, {
|
|
2200
2131
|
factor: i,
|
|
2201
2132
|
center: a
|
|
2202
2133
|
})), this.touches.length || this.debouncedProcessEnd();
|
|
@@ -2210,7 +2141,7 @@ var Cn = {
|
|
|
2210
2141
|
"transform-end"
|
|
2211
2142
|
]
|
|
2212
2143
|
};
|
|
2213
|
-
|
|
2144
|
+
Sn.render = function(e, t, n, r, i, a) {
|
|
2214
2145
|
return z(), h("div", {
|
|
2215
2146
|
ref: "container",
|
|
2216
2147
|
onTouchstart: t[1] ||= function() {
|
|
@@ -2224,8 +2155,8 @@ Cn.render = function(e, t, n, r, i, a) {
|
|
|
2224
2155
|
}
|
|
2225
2156
|
}, [c(e.$slots, "default")], 544);
|
|
2226
2157
|
};
|
|
2227
|
-
var
|
|
2228
|
-
components: { TransformableImage:
|
|
2158
|
+
var Cn = {
|
|
2159
|
+
components: { TransformableImage: Sn },
|
|
2229
2160
|
props: {
|
|
2230
2161
|
touchMove: {
|
|
2231
2162
|
type: Boolean,
|
|
@@ -2246,7 +2177,7 @@ var wn = {
|
|
|
2246
2177
|
},
|
|
2247
2178
|
emits: ["resize", "move"]
|
|
2248
2179
|
};
|
|
2249
|
-
|
|
2180
|
+
Cn.render = function(e, t, n, r, i, a) {
|
|
2250
2181
|
var o = x("transformable-image");
|
|
2251
2182
|
return z(), h(o, {
|
|
2252
2183
|
"touch-move": n.touchMove,
|
|
@@ -2260,7 +2191,7 @@ wn.render = function(e, t, n, r, i, a) {
|
|
|
2260
2191
|
return e.$emit("resize", t);
|
|
2261
2192
|
}
|
|
2262
2193
|
}, {
|
|
2263
|
-
default:
|
|
2194
|
+
default: P((function() {
|
|
2264
2195
|
return [c(e.$slots, "default")];
|
|
2265
2196
|
})),
|
|
2266
2197
|
_: 3
|
|
@@ -2271,7 +2202,7 @@ wn.render = function(e, t, n, r, i, a) {
|
|
|
2271
2202
|
"wheel-resize"
|
|
2272
2203
|
]);
|
|
2273
2204
|
};
|
|
2274
|
-
var
|
|
2205
|
+
var wn = Ye("vue-preview"), Tn = {
|
|
2275
2206
|
props: {
|
|
2276
2207
|
coordinates: { type: Object },
|
|
2277
2208
|
transitions: { type: Object },
|
|
@@ -2301,10 +2232,10 @@ var Tn = K("vue-preview"), En = {
|
|
|
2301
2232
|
computed: {
|
|
2302
2233
|
classes: function() {
|
|
2303
2234
|
return {
|
|
2304
|
-
root:
|
|
2305
|
-
wrapper:
|
|
2306
|
-
imageWrapper:
|
|
2307
|
-
image: G(
|
|
2235
|
+
root: wn({ fill: this.fill }),
|
|
2236
|
+
wrapper: wn("wrapper"),
|
|
2237
|
+
imageWrapper: wn("image-wrapper"),
|
|
2238
|
+
image: G(wn("image"), this.imageClass)
|
|
2308
2239
|
};
|
|
2309
2240
|
},
|
|
2310
2241
|
style: function() {
|
|
@@ -2332,7 +2263,7 @@ var Tn = K("vue-preview"), En = {
|
|
|
2332
2263
|
}, this.image.transforms), {}, {
|
|
2333
2264
|
scaleX: 1 / e,
|
|
2334
2265
|
scaleY: 1 / e
|
|
2335
|
-
}), n = this.imageSize.width, r = this.imageSize.height, i =
|
|
2266
|
+
}), n = this.imageSize.width, r = this.imageSize.height, i = Nt({
|
|
2336
2267
|
width: n,
|
|
2337
2268
|
height: r
|
|
2338
2269
|
}, t.rotate), a = {
|
|
@@ -2351,7 +2282,7 @@ var Tn = K("vue-preview"), En = {
|
|
|
2351
2282
|
}
|
|
2352
2283
|
};
|
|
2353
2284
|
return a.transform = `translate(
|
|
2354
|
-
${-this.coordinates.left / e - o.rotate.left - o.scale.left}px,${-this.coordinates.top / e - o.rotate.top - o.scale.top}px) ` +
|
|
2285
|
+
${-this.coordinates.left / e - o.rotate.left - o.scale.left}px,${-this.coordinates.top / e - o.rotate.top - o.scale.top}px) ` + yn(t), this.transitions && this.transitions.enabled && (a.transition = `${this.transitions.time}ms ${this.transitions.timingFunction}`), a;
|
|
2355
2286
|
}
|
|
2356
2287
|
return {};
|
|
2357
2288
|
},
|
|
@@ -2395,7 +2326,7 @@ var Tn = K("vue-preview"), En = {
|
|
|
2395
2326
|
}
|
|
2396
2327
|
}
|
|
2397
2328
|
};
|
|
2398
|
-
|
|
2329
|
+
Tn.render = function(e, t, n, r, i, a) {
|
|
2399
2330
|
return z(), h("div", {
|
|
2400
2331
|
ref: "root",
|
|
2401
2332
|
class: a.classes.root,
|
|
@@ -2411,20 +2342,20 @@ En.render = function(e, t, n, r, i, a) {
|
|
|
2411
2342
|
style: a.imageStyle
|
|
2412
2343
|
}, null, 14, ["src"]), [[ye, n.image && n.image.src]])], 6)], 6);
|
|
2413
2344
|
};
|
|
2414
|
-
var
|
|
2415
|
-
components: { Preview:
|
|
2345
|
+
var En = {
|
|
2346
|
+
components: { Preview: Tn },
|
|
2416
2347
|
inheritAttrs: !1
|
|
2417
2348
|
};
|
|
2418
|
-
|
|
2349
|
+
En.render = function(e, t, n, r, i, a) {
|
|
2419
2350
|
var o = x("preview");
|
|
2420
2351
|
return z(), h(o, f(e.$attrs, { fill: !0 }), null, 16);
|
|
2421
2352
|
};
|
|
2422
|
-
var
|
|
2353
|
+
var Dn = Ye("vue-rectangle-stencil"), On = {
|
|
2423
2354
|
name: "RectangleStencil",
|
|
2424
2355
|
components: {
|
|
2425
|
-
StencilPreview:
|
|
2426
|
-
BoundingBox:
|
|
2427
|
-
DraggableArea:
|
|
2356
|
+
StencilPreview: En,
|
|
2357
|
+
BoundingBox: mn,
|
|
2358
|
+
DraggableArea: gn
|
|
2428
2359
|
},
|
|
2429
2360
|
props: {
|
|
2430
2361
|
image: { type: Object },
|
|
@@ -2434,14 +2365,14 @@ var On = K("vue-rectangle-stencil"), kn = {
|
|
|
2434
2365
|
handlersComponent: {
|
|
2435
2366
|
type: [Object, String],
|
|
2436
2367
|
default: function() {
|
|
2437
|
-
return
|
|
2368
|
+
return sn;
|
|
2438
2369
|
}
|
|
2439
2370
|
},
|
|
2440
2371
|
lines: { type: Object },
|
|
2441
2372
|
linesComponent: {
|
|
2442
2373
|
type: [Object, String],
|
|
2443
2374
|
default: function() {
|
|
2444
|
-
return
|
|
2375
|
+
return un;
|
|
2445
2376
|
}
|
|
2446
2377
|
},
|
|
2447
2378
|
aspectRatio: { type: [Number, String] },
|
|
@@ -2494,13 +2425,13 @@ var On = K("vue-rectangle-stencil"), kn = {
|
|
|
2494
2425
|
computed: {
|
|
2495
2426
|
classes: function() {
|
|
2496
2427
|
return {
|
|
2497
|
-
stencil: G(
|
|
2428
|
+
stencil: G(Dn({
|
|
2498
2429
|
movable: this.movable,
|
|
2499
2430
|
moving: this.moving,
|
|
2500
2431
|
resizing: this.resizing
|
|
2501
2432
|
}), this.moving && this.movingClass, this.resizing && this.resizingClass),
|
|
2502
|
-
preview: G(
|
|
2503
|
-
boundingBox: G(
|
|
2433
|
+
preview: G(Dn("preview"), this.previewClass),
|
|
2434
|
+
boundingBox: G(Dn("bounding-box"), this.boundingBoxClass)
|
|
2504
2435
|
};
|
|
2505
2436
|
},
|
|
2506
2437
|
style: function() {
|
|
@@ -2539,7 +2470,7 @@ var On = K("vue-rectangle-stencil"), kn = {
|
|
|
2539
2470
|
"move-end"
|
|
2540
2471
|
]
|
|
2541
2472
|
};
|
|
2542
|
-
|
|
2473
|
+
On.render = function(e, t, n, r, i, a) {
|
|
2543
2474
|
var o = x("stencil-preview"), s = x("draggable-area"), c = x("bounding-box");
|
|
2544
2475
|
return z(), h("div", {
|
|
2545
2476
|
class: a.classes.stencil,
|
|
@@ -2561,13 +2492,13 @@ kn.render = function(e, t, n, r, i, a) {
|
|
|
2561
2492
|
onResize: a.onResize,
|
|
2562
2493
|
onResizeEnd: a.onResizeEnd
|
|
2563
2494
|
}, {
|
|
2564
|
-
default:
|
|
2495
|
+
default: P((function() {
|
|
2565
2496
|
return [p(s, {
|
|
2566
2497
|
movable: n.movable,
|
|
2567
2498
|
onMove: a.onMove,
|
|
2568
2499
|
onMoveEnd: a.onMoveEnd
|
|
2569
2500
|
}, {
|
|
2570
|
-
default:
|
|
2501
|
+
default: P((function() {
|
|
2571
2502
|
return [p(o, {
|
|
2572
2503
|
image: n.image,
|
|
2573
2504
|
coordinates: n.coordinates,
|
|
@@ -2610,206 +2541,9 @@ kn.render = function(e, t, n, r, i, a) {
|
|
|
2610
2541
|
"onResizeEnd"
|
|
2611
2542
|
])], 6);
|
|
2612
2543
|
};
|
|
2613
|
-
var An =
|
|
2614
|
-
components: {
|
|
2615
|
-
StencilPreview: Dn,
|
|
2616
|
-
BoundingBox: pn,
|
|
2617
|
-
DraggableArea: hn
|
|
2618
|
-
},
|
|
2619
|
-
props: {
|
|
2620
|
-
image: { type: Object },
|
|
2621
|
-
coordinates: { type: Object },
|
|
2622
|
-
stencilCoordinates: { type: Object },
|
|
2623
|
-
handlers: {
|
|
2624
|
-
type: Object,
|
|
2625
|
-
default: function() {
|
|
2626
|
-
return {
|
|
2627
|
-
eastNorth: !0,
|
|
2628
|
-
westNorth: !0,
|
|
2629
|
-
westSouth: !0,
|
|
2630
|
-
eastSouth: !0
|
|
2631
|
-
};
|
|
2632
|
-
}
|
|
2633
|
-
},
|
|
2634
|
-
handlersComponent: {
|
|
2635
|
-
type: [Object, String],
|
|
2636
|
-
default: function() {
|
|
2637
|
-
return on;
|
|
2638
|
-
}
|
|
2639
|
-
},
|
|
2640
|
-
handlersClasses: {
|
|
2641
|
-
type: Object,
|
|
2642
|
-
default: function() {
|
|
2643
|
-
return {};
|
|
2644
|
-
}
|
|
2645
|
-
},
|
|
2646
|
-
handlersWrappersClasses: {
|
|
2647
|
-
type: Object,
|
|
2648
|
-
default: function() {
|
|
2649
|
-
return {};
|
|
2650
|
-
}
|
|
2651
|
-
},
|
|
2652
|
-
lines: { type: Object },
|
|
2653
|
-
linesComponent: {
|
|
2654
|
-
type: [Object, String],
|
|
2655
|
-
default: function() {
|
|
2656
|
-
return ln;
|
|
2657
|
-
}
|
|
2658
|
-
},
|
|
2659
|
-
linesClasses: {
|
|
2660
|
-
type: Object,
|
|
2661
|
-
default: function() {
|
|
2662
|
-
return {};
|
|
2663
|
-
}
|
|
2664
|
-
},
|
|
2665
|
-
linesWrappersClasses: {
|
|
2666
|
-
type: Object,
|
|
2667
|
-
default: function() {
|
|
2668
|
-
return {};
|
|
2669
|
-
}
|
|
2670
|
-
},
|
|
2671
|
-
movable: {
|
|
2672
|
-
type: Boolean,
|
|
2673
|
-
default: !0
|
|
2674
|
-
},
|
|
2675
|
-
resizable: {
|
|
2676
|
-
type: Boolean,
|
|
2677
|
-
default: !0
|
|
2678
|
-
},
|
|
2679
|
-
transitions: { type: Object },
|
|
2680
|
-
movingClass: { type: String },
|
|
2681
|
-
resizingClass: { type: String },
|
|
2682
|
-
previewClass: { type: String },
|
|
2683
|
-
boundingBoxClass: { type: String }
|
|
2684
|
-
},
|
|
2685
|
-
data: function() {
|
|
2686
|
-
return {
|
|
2687
|
-
moving: !1,
|
|
2688
|
-
resizing: !1
|
|
2689
|
-
};
|
|
2690
|
-
},
|
|
2691
|
-
computed: {
|
|
2692
|
-
classes: function() {
|
|
2693
|
-
return {
|
|
2694
|
-
stencil: G(An({
|
|
2695
|
-
movable: this.movable,
|
|
2696
|
-
moving: this.moving,
|
|
2697
|
-
resizing: this.resizing
|
|
2698
|
-
}), this.moving && this.movingClass, this.resizing && this.resizingClass),
|
|
2699
|
-
preview: G(An("preview"), this.previewClass),
|
|
2700
|
-
boundingBox: G(An("bounding-box"), this.boundingBoxClass)
|
|
2701
|
-
};
|
|
2702
|
-
},
|
|
2703
|
-
style: function() {
|
|
2704
|
-
var e = this.stencilCoordinates, t = e.height, n = e.width, r = e.left, i = e.top, a = {
|
|
2705
|
-
width: `${n}px`,
|
|
2706
|
-
height: `${t}px`,
|
|
2707
|
-
transform: `translate(${r}px, ${i}px)`
|
|
2708
|
-
};
|
|
2709
|
-
return this.transitions && this.transitions.enabled && (a.transition = `${this.transitions.time}ms ${this.transitions.timingFunction}`), a;
|
|
2710
|
-
}
|
|
2711
|
-
},
|
|
2712
|
-
methods: {
|
|
2713
|
-
onMove: function(e) {
|
|
2714
|
-
this.$emit("move", e), this.moving = !0;
|
|
2715
|
-
},
|
|
2716
|
-
onMoveEnd: function() {
|
|
2717
|
-
this.$emit("move-end"), this.moving = !1;
|
|
2718
|
-
},
|
|
2719
|
-
onResize: function(e) {
|
|
2720
|
-
this.$emit("resize", e), this.resizing = !0;
|
|
2721
|
-
},
|
|
2722
|
-
onResizeEnd: function() {
|
|
2723
|
-
this.$emit("resize-end"), this.resizing = !1;
|
|
2724
|
-
},
|
|
2725
|
-
aspectRatios: function() {
|
|
2726
|
-
return {
|
|
2727
|
-
minimum: 1,
|
|
2728
|
-
maximum: 1
|
|
2729
|
-
};
|
|
2730
|
-
}
|
|
2731
|
-
},
|
|
2732
|
-
emits: [
|
|
2733
|
-
"resize",
|
|
2734
|
-
"resize-end",
|
|
2735
|
-
"move",
|
|
2736
|
-
"move-end"
|
|
2737
|
-
]
|
|
2738
|
-
};
|
|
2739
|
-
jn.render = function(e, t, n, r, i, a) {
|
|
2740
|
-
var o = x("stencil-preview"), s = x("draggable-area"), c = x("bounding-box");
|
|
2741
|
-
return z(), h("div", {
|
|
2742
|
-
class: a.classes.stencil,
|
|
2743
|
-
style: a.style
|
|
2744
|
-
}, [p(c, {
|
|
2745
|
-
width: n.stencilCoordinates.width,
|
|
2746
|
-
height: n.stencilCoordinates.height,
|
|
2747
|
-
transitions: n.transitions,
|
|
2748
|
-
class: a.classes.boundingBox,
|
|
2749
|
-
handlers: n.handlers,
|
|
2750
|
-
"handlers-component": n.handlersComponent,
|
|
2751
|
-
"handlers-classes": n.handlersClasses,
|
|
2752
|
-
"handlers-wrappers-classes": n.handlersWrappersClasses,
|
|
2753
|
-
lines: n.lines,
|
|
2754
|
-
"lines-component": n.linesComponent,
|
|
2755
|
-
"lines-classes": n.linesClasses,
|
|
2756
|
-
"lines-wrappers-classes": n.linesWrappersClasses,
|
|
2757
|
-
resizable: n.resizable,
|
|
2758
|
-
onResize: a.onResize,
|
|
2759
|
-
onResizeEnd: a.onResizeEnd
|
|
2760
|
-
}, {
|
|
2761
|
-
default: F((function() {
|
|
2762
|
-
return [p(s, {
|
|
2763
|
-
movable: n.movable,
|
|
2764
|
-
onMove: a.onMove,
|
|
2765
|
-
onMoveEnd: a.onMoveEnd
|
|
2766
|
-
}, {
|
|
2767
|
-
default: F((function() {
|
|
2768
|
-
return [p(o, {
|
|
2769
|
-
image: n.image,
|
|
2770
|
-
coordinates: n.coordinates,
|
|
2771
|
-
width: n.stencilCoordinates.width,
|
|
2772
|
-
height: n.stencilCoordinates.height,
|
|
2773
|
-
class: a.classes.preview,
|
|
2774
|
-
transitions: n.transitions
|
|
2775
|
-
}, null, 8, [
|
|
2776
|
-
"image",
|
|
2777
|
-
"coordinates",
|
|
2778
|
-
"width",
|
|
2779
|
-
"height",
|
|
2780
|
-
"class",
|
|
2781
|
-
"transitions"
|
|
2782
|
-
])];
|
|
2783
|
-
})),
|
|
2784
|
-
_: 1
|
|
2785
|
-
}, 8, [
|
|
2786
|
-
"movable",
|
|
2787
|
-
"onMove",
|
|
2788
|
-
"onMoveEnd"
|
|
2789
|
-
])];
|
|
2790
|
-
})),
|
|
2791
|
-
_: 1
|
|
2792
|
-
}, 8, [
|
|
2793
|
-
"width",
|
|
2794
|
-
"height",
|
|
2795
|
-
"transitions",
|
|
2796
|
-
"class",
|
|
2797
|
-
"handlers",
|
|
2798
|
-
"handlers-component",
|
|
2799
|
-
"handlers-classes",
|
|
2800
|
-
"handlers-wrappers-classes",
|
|
2801
|
-
"lines",
|
|
2802
|
-
"lines-component",
|
|
2803
|
-
"lines-classes",
|
|
2804
|
-
"lines-wrappers-classes",
|
|
2805
|
-
"resizable",
|
|
2806
|
-
"onResize",
|
|
2807
|
-
"onResizeEnd"
|
|
2808
|
-
])], 6);
|
|
2809
|
-
};
|
|
2810
|
-
var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
2544
|
+
var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
|
|
2811
2545
|
name: "Cropper",
|
|
2812
|
-
components: { BackgroundWrapper:
|
|
2546
|
+
components: { BackgroundWrapper: Cn },
|
|
2813
2547
|
props: {
|
|
2814
2548
|
src: {
|
|
2815
2549
|
type: String,
|
|
@@ -2818,13 +2552,13 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
2818
2552
|
stencilComponent: {
|
|
2819
2553
|
type: [Object, String],
|
|
2820
2554
|
default: function() {
|
|
2821
|
-
return
|
|
2555
|
+
return On;
|
|
2822
2556
|
}
|
|
2823
2557
|
},
|
|
2824
2558
|
backgroundWrapperComponent: {
|
|
2825
2559
|
type: [Object, String],
|
|
2826
2560
|
default: function() {
|
|
2827
|
-
return
|
|
2561
|
+
return Cn;
|
|
2828
2562
|
}
|
|
2829
2563
|
},
|
|
2830
2564
|
stencilProps: {
|
|
@@ -2873,7 +2607,7 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
2873
2607
|
type: String,
|
|
2874
2608
|
default: "fit-area",
|
|
2875
2609
|
validator: function(e) {
|
|
2876
|
-
return
|
|
2610
|
+
return xt.indexOf(e) !== -1;
|
|
2877
2611
|
}
|
|
2878
2612
|
},
|
|
2879
2613
|
roundResult: {
|
|
@@ -2887,7 +2621,7 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
2887
2621
|
defaultBoundaries: {
|
|
2888
2622
|
type: [Function, String],
|
|
2889
2623
|
validator: function(e) {
|
|
2890
|
-
return
|
|
2624
|
+
return typeof e != "string" || e === "fill" || e === "fit";
|
|
2891
2625
|
}
|
|
2892
2626
|
},
|
|
2893
2627
|
priority: {
|
|
@@ -2907,40 +2641,40 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
2907
2641
|
resizeAlgorithm: {
|
|
2908
2642
|
type: Function,
|
|
2909
2643
|
default: function(e) {
|
|
2910
|
-
var t = e.event, n = e.coordinates, r = e.aspectRatio, i = e.positionRestrictions, a = e.sizeRestrictions, o =
|
|
2644
|
+
var t = e.event, n = e.coordinates, r = e.aspectRatio, i = e.positionRestrictions, a = e.sizeRestrictions, o = K(K({}, n), {
|
|
2911
2645
|
right: n.left + n.width,
|
|
2912
2646
|
bottom: n.top + n.height
|
|
2913
|
-
}), s = t.params || {}, c =
|
|
2647
|
+
}), s = t.params || {}, c = K({}, t.directions), l = s.allowedDirections || {
|
|
2914
2648
|
left: !0,
|
|
2915
2649
|
right: !0,
|
|
2916
2650
|
bottom: !0,
|
|
2917
2651
|
top: !0
|
|
2918
2652
|
};
|
|
2919
|
-
a.widthFrozen && (c.left = 0, c.right = 0), a.heightFrozen && (c.top = 0, c.bottom = 0),
|
|
2653
|
+
a.widthFrozen && (c.left = 0, c.right = 0), a.heightFrozen && (c.top = 0, c.bottom = 0), _t.forEach((function(e) {
|
|
2920
2654
|
l[e] || (c[e] = 0);
|
|
2921
2655
|
}));
|
|
2922
|
-
var u =
|
|
2656
|
+
var u = Dt(o, c = nn({
|
|
2923
2657
|
coordinates: o,
|
|
2924
2658
|
directions: c,
|
|
2925
2659
|
sizeRestrictions: a,
|
|
2926
2660
|
positionRestrictions: i
|
|
2927
|
-
})).width, d =
|
|
2661
|
+
})).width, d = Dt(o, c).height, f = s.preserveRatio ? Z(o) : jt(u / d, r);
|
|
2928
2662
|
if (f) {
|
|
2929
2663
|
var p = s.respectDirection;
|
|
2930
2664
|
if (p ||= o.width >= o.height || f === 1 ? "width" : "height", p === "width") {
|
|
2931
2665
|
var m = u / f - o.height;
|
|
2932
2666
|
if (l.top && l.bottom) {
|
|
2933
2667
|
var h = c.top, g = c.bottom;
|
|
2934
|
-
c.bottom =
|
|
2668
|
+
c.bottom = rn(m, g, h), c.top = rn(m, h, g);
|
|
2935
2669
|
} else l.bottom ? c.bottom = m : l.top ? c.top = m : l.right ? c.right = 0 : l.left && (c.left = 0);
|
|
2936
2670
|
} else if (p === "height") {
|
|
2937
2671
|
var _ = o.width - d * f;
|
|
2938
2672
|
if (l.left && l.right) {
|
|
2939
2673
|
var v = c.left, y = c.right;
|
|
2940
|
-
c.left = -
|
|
2674
|
+
c.left = -rn(_, v, y), c.right = -rn(_, y, v);
|
|
2941
2675
|
} else l.left ? c.left = -_ : l.right ? c.right = -_ : l.top ? c.top = 0 : l.bottom && (c.bottom = 0);
|
|
2942
2676
|
}
|
|
2943
|
-
c =
|
|
2677
|
+
c = nn({
|
|
2944
2678
|
directions: c,
|
|
2945
2679
|
coordinates: o,
|
|
2946
2680
|
sizeRestrictions: a,
|
|
@@ -2949,10 +2683,10 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
2949
2683
|
compensate: s.compensate
|
|
2950
2684
|
});
|
|
2951
2685
|
}
|
|
2952
|
-
return u =
|
|
2686
|
+
return u = Dt(o, c).width, d = Dt(o, c).height, (f = s.preserveRatio ? Z(o) : jt(u / d, r)) && Math.abs(f - u / d) > .001 && _t.forEach((function(e) {
|
|
2953
2687
|
l[e] || (c[e] = 0);
|
|
2954
|
-
})),
|
|
2955
|
-
event: new
|
|
2688
|
+
})), Ut({
|
|
2689
|
+
event: new ut({
|
|
2956
2690
|
left: -c.left,
|
|
2957
2691
|
top: -c.top
|
|
2958
2692
|
}),
|
|
@@ -2968,19 +2702,19 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
2968
2702
|
},
|
|
2969
2703
|
moveAlgorithm: {
|
|
2970
2704
|
type: Function,
|
|
2971
|
-
default:
|
|
2705
|
+
default: Ut
|
|
2972
2706
|
},
|
|
2973
2707
|
initStretcher: {
|
|
2974
2708
|
type: Function,
|
|
2975
2709
|
default: function(e) {
|
|
2976
|
-
var t = e.stretcher, n = e.imageSize, r =
|
|
2710
|
+
var t = e.stretcher, n = e.imageSize, r = Z(n);
|
|
2977
2711
|
t.style.width = n.width + "px", t.style.height = t.clientWidth / r + "px", t.style.width = t.clientWidth + "px";
|
|
2978
2712
|
}
|
|
2979
2713
|
},
|
|
2980
2714
|
fitCoordinates: {
|
|
2981
2715
|
type: Function,
|
|
2982
2716
|
default: function(e) {
|
|
2983
|
-
var t = e.visibleArea, n = e.coordinates, r = e.aspectRatio, i = e.sizeRestrictions, a = e.positionRestrictions, o =
|
|
2717
|
+
var t = e.visibleArea, n = e.coordinates, r = e.aspectRatio, i = e.sizeRestrictions, a = e.positionRestrictions, o = K(K({}, n), Ht({
|
|
2984
2718
|
width: n.width,
|
|
2985
2719
|
height: n.height,
|
|
2986
2720
|
aspectRatio: r,
|
|
@@ -2991,19 +2725,19 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
2991
2725
|
minWidth: Math.min(t.width, i.minWidth)
|
|
2992
2726
|
}
|
|
2993
2727
|
}));
|
|
2994
|
-
return o =
|
|
2728
|
+
return o = Q(o = Y(o, Tt(J(n), J(o))), zt(wt(t), a));
|
|
2995
2729
|
}
|
|
2996
2730
|
},
|
|
2997
2731
|
fitVisibleArea: {
|
|
2998
2732
|
type: Function,
|
|
2999
2733
|
default: function(e) {
|
|
3000
|
-
var t = e.visibleArea, n = e.boundaries, r = e.getAreaRestrictions, i = e.coordinates, a =
|
|
3001
|
-
a.height = a.width /
|
|
3002
|
-
var o =
|
|
2734
|
+
var t = e.visibleArea, n = e.boundaries, r = e.getAreaRestrictions, i = e.coordinates, a = K({}, t);
|
|
2735
|
+
a.height = a.width / Z(n), a.top += (t.height - a.height) / 2, (i.height - a.height > 0 || i.width - a.width > 0) && (a = X(a, Math.max(i.height / a.height, i.width / a.width)));
|
|
2736
|
+
var o = Ot(At(i, wt(a = X(a, Ft(a, r({
|
|
3003
2737
|
visibleArea: a,
|
|
3004
2738
|
type: "resize"
|
|
3005
2739
|
}))))));
|
|
3006
|
-
return a.width < i.width && (o.left = 0), a.height < i.height && (o.top = 0), a =
|
|
2740
|
+
return a.width < i.width && (o.left = 0), a.height < i.height && (o.top = 0), a = Q(a = Y(a, o), r({
|
|
3007
2741
|
visibleArea: a,
|
|
3008
2742
|
type: "move"
|
|
3009
2743
|
}));
|
|
@@ -3018,7 +2752,7 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
3018
2752
|
top: 0,
|
|
3019
2753
|
right: r.width,
|
|
3020
2754
|
bottom: r.height
|
|
3021
|
-
} : i === "fit-area" && (
|
|
2755
|
+
} : i === "fit-area" && (Z(n) > Z(r) ? (o = {
|
|
3022
2756
|
top: 0,
|
|
3023
2757
|
bottom: r.height
|
|
3024
2758
|
}, t && a === "move" && (t.width > r.width ? (o.left = -(t.width - r.width) / 2, o.right = r.width - o.left) : (o.left = 0, o.right = r.width))) : (o = {
|
|
@@ -3080,7 +2814,7 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
3080
2814
|
height: 0
|
|
3081
2815
|
},
|
|
3082
2816
|
visibleArea: null,
|
|
3083
|
-
coordinates: U({},
|
|
2817
|
+
coordinates: U({}, St)
|
|
3084
2818
|
};
|
|
3085
2819
|
},
|
|
3086
2820
|
computed: {
|
|
@@ -3118,7 +2852,7 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
3118
2852
|
return !!(this.visibleArea && this.imageLoaded);
|
|
3119
2853
|
},
|
|
3120
2854
|
settings: function() {
|
|
3121
|
-
var e =
|
|
2855
|
+
var e = rt(this.resizeImage, {
|
|
3122
2856
|
touch: !0,
|
|
3123
2857
|
wheel: { ratio: .1 },
|
|
3124
2858
|
adjustStencil: !0
|
|
@@ -3128,7 +2862,7 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
3128
2862
|
adjustStencil: !1
|
|
3129
2863
|
});
|
|
3130
2864
|
return {
|
|
3131
|
-
moveImage:
|
|
2865
|
+
moveImage: rt(this.moveImage, {
|
|
3132
2866
|
touch: !0,
|
|
3133
2867
|
mouse: !0
|
|
3134
2868
|
}, {
|
|
@@ -3159,20 +2893,20 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
3159
2893
|
if (this.boundaries.width && this.boundaries.height && this.imageSize.width && this.imageSize.height) {
|
|
3160
2894
|
var e = this.sizeRestrictionsAlgorithm({
|
|
3161
2895
|
imageSize: this.imageSize,
|
|
3162
|
-
minWidth:
|
|
3163
|
-
minHeight:
|
|
3164
|
-
maxWidth:
|
|
3165
|
-
maxHeight:
|
|
2896
|
+
minWidth: q(this.minWidth) ? 0 : it(this.minWidth),
|
|
2897
|
+
minHeight: q(this.minHeight) ? 0 : it(this.minHeight),
|
|
2898
|
+
maxWidth: q(this.maxWidth) ? Infinity : it(this.maxWidth),
|
|
2899
|
+
maxHeight: q(this.maxHeight) ? Infinity : it(this.maxHeight)
|
|
3166
2900
|
});
|
|
3167
2901
|
if (e = function(e) {
|
|
3168
|
-
var t = e.areaRestrictions, n = e.sizeRestrictions, r = e.boundaries, i = e.positionRestrictions, a =
|
|
2902
|
+
var t = e.areaRestrictions, n = e.sizeRestrictions, r = e.boundaries, i = e.positionRestrictions, a = K(K({}, n), {
|
|
3169
2903
|
minWidth: n.minWidth === void 0 ? 0 : n.minWidth,
|
|
3170
2904
|
minHeight: n.minHeight === void 0 ? 0 : n.minHeight,
|
|
3171
2905
|
maxWidth: n.maxWidth === void 0 ? Infinity : n.maxWidth,
|
|
3172
2906
|
maxHeight: n.maxHeight === void 0 ? Infinity : n.maxHeight
|
|
3173
2907
|
});
|
|
3174
2908
|
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));
|
|
3175
|
-
var o =
|
|
2909
|
+
var o = It(t), s = Mt(r, o);
|
|
3176
2910
|
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;
|
|
3177
2911
|
}({
|
|
3178
2912
|
sizeRestrictions: e,
|
|
@@ -3187,7 +2921,7 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
3187
2921
|
visibleArea: this.visibleArea,
|
|
3188
2922
|
stencilSize: this.getStencilSize()
|
|
3189
2923
|
}), this.visibleArea && this.stencilSize) {
|
|
3190
|
-
var t = this.getStencilSize(), n =
|
|
2924
|
+
var t = this.getStencilSize(), n = It(this.getAreaRestrictions({
|
|
3191
2925
|
visibleArea: this.visibleArea,
|
|
3192
2926
|
type: "resize"
|
|
3193
2927
|
}));
|
|
@@ -3210,15 +2944,15 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
3210
2944
|
},
|
|
3211
2945
|
classes: function() {
|
|
3212
2946
|
return {
|
|
3213
|
-
cropper:
|
|
3214
|
-
image: G(
|
|
3215
|
-
stencil:
|
|
3216
|
-
boundaries: G(
|
|
3217
|
-
stretcher: G(
|
|
3218
|
-
background: G(
|
|
3219
|
-
foreground: G(
|
|
3220
|
-
imageWrapper: G(
|
|
3221
|
-
cropperWrapper: G(
|
|
2947
|
+
cropper: An(),
|
|
2948
|
+
image: G(An("image"), this.imageClass),
|
|
2949
|
+
stencil: An("stencil"),
|
|
2950
|
+
boundaries: G(An("boundaries"), this.boundariesClass),
|
|
2951
|
+
stretcher: G(An("stretcher")),
|
|
2952
|
+
background: G(An("background"), this.backgroundClass),
|
|
2953
|
+
foreground: G(An("foreground"), this.foregroundClass),
|
|
2954
|
+
imageWrapper: G(An("image-wrapper")),
|
|
2955
|
+
cropperWrapper: G(An("cropper-wrapper"))
|
|
3222
2956
|
};
|
|
3223
2957
|
},
|
|
3224
2958
|
stencilCoordinates: function() {
|
|
@@ -3263,7 +2997,7 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
3263
2997
|
height: `${e.height}px`,
|
|
3264
2998
|
left: "0px",
|
|
3265
2999
|
top: "0px",
|
|
3266
|
-
transform: `translate(${-t.left - n.left - this.imageTransforms.translateX}px, ${-t.top - n.top - this.imageTransforms.translateY}px)` +
|
|
3000
|
+
transform: `translate(${-t.left - n.left - this.imageTransforms.translateX}px, ${-t.top - n.top - this.imageTransforms.translateY}px)` + yn(r)
|
|
3267
3001
|
};
|
|
3268
3002
|
return this.transitionsOptions.enabled && (i.transition = `${this.transitionsOptions.time}ms ${this.transitionsOptions.timingFunction}`), i;
|
|
3269
3003
|
}
|
|
@@ -3304,7 +3038,7 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
3304
3038
|
}
|
|
3305
3039
|
},
|
|
3306
3040
|
created: function() {
|
|
3307
|
-
this.debouncedUpdate =
|
|
3041
|
+
this.debouncedUpdate = Ze(this.update, this.debounce), this.debouncedDisableTransitions = Ze(this.disableTransitions, this.transitionsOptions.time), this.awaiting = !1;
|
|
3308
3042
|
},
|
|
3309
3043
|
mounted: function() {
|
|
3310
3044
|
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);
|
|
@@ -3340,7 +3074,7 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
3340
3074
|
},
|
|
3341
3075
|
zoom: function(e, t) {
|
|
3342
3076
|
var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
|
|
3343
|
-
this.onManipulateImage(new
|
|
3077
|
+
this.onManipulateImage(new ct({}, {
|
|
3344
3078
|
factor: 1 / e,
|
|
3345
3079
|
center: t
|
|
3346
3080
|
}), {
|
|
@@ -3350,7 +3084,7 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
3350
3084
|
},
|
|
3351
3085
|
move: function(e, t) {
|
|
3352
3086
|
var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
|
|
3353
|
-
this.onManipulateImage(new
|
|
3087
|
+
this.onManipulateImage(new ct({
|
|
3354
3088
|
left: e || 0,
|
|
3355
3089
|
top: t || 0
|
|
3356
3090
|
}), {
|
|
@@ -3392,15 +3126,15 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
3392
3126
|
left: Math.round(t.left),
|
|
3393
3127
|
top: Math.round(t.top)
|
|
3394
3128
|
};
|
|
3395
|
-
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)),
|
|
3129
|
+
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)), Q(i, r);
|
|
3396
3130
|
}(U(U({}, this.getPublicProperties()), {}, {
|
|
3397
|
-
positionRestrictions:
|
|
3131
|
+
positionRestrictions: Qt(this.positionRestrictions, this.visibleArea),
|
|
3398
3132
|
coordinates: e
|
|
3399
3133
|
})) : e;
|
|
3400
3134
|
},
|
|
3401
3135
|
processAutoZoom: function(e, t, n, r) {
|
|
3402
3136
|
var i = this.autoZoomAlgorithm;
|
|
3403
|
-
i ||= this.stencilSize ?
|
|
3137
|
+
i ||= this.stencilSize ? Gt : this.autoZoom ? Kt : qt;
|
|
3404
3138
|
var a = i({
|
|
3405
3139
|
event: {
|
|
3406
3140
|
type: e,
|
|
@@ -3415,16 +3149,16 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
3415
3149
|
sizeRestrictions: this.sizeRestrictions,
|
|
3416
3150
|
stencilSize: this.getStencilSize()
|
|
3417
3151
|
});
|
|
3418
|
-
return U(U({}, a), {}, { changed: !
|
|
3152
|
+
return U(U({}, a), {}, { changed: !Ct(a.visibleArea, t) || !Ct(a.coordinates, n) });
|
|
3419
3153
|
},
|
|
3420
3154
|
runAutoZoom: function(e) {
|
|
3421
|
-
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = t.transitions, r = n !== void 0 && n, i = Ue(t,
|
|
3155
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = t.transitions, r = n !== void 0 && n, i = Ue(t, kn), a = this.processAutoZoom(e, this.visibleArea, this.coordinates, i), o = a.visibleArea, s = a.coordinates, c = a.changed;
|
|
3422
3156
|
r && c && this.enableTransitions(), this.visibleArea = o, this.coordinates = s, r && c && this.debouncedDisableTransitions();
|
|
3423
3157
|
},
|
|
3424
3158
|
normalizeEvent: function(e) {
|
|
3425
3159
|
return function(e) {
|
|
3426
3160
|
var t = e.event, n = e.visibleArea, r = e.coefficient;
|
|
3427
|
-
if (t.type === "manipulateImage") return
|
|
3161
|
+
if (t.type === "manipulateImage") return K(K({}, t), {
|
|
3428
3162
|
move: {
|
|
3429
3163
|
left: t.move && t.move.left ? r * t.move.left : 0,
|
|
3430
3164
|
top: t.move && t.move.top ? r * t.move.top : 0
|
|
@@ -3438,14 +3172,14 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
3438
3172
|
}
|
|
3439
3173
|
});
|
|
3440
3174
|
if (t.type === "resize") {
|
|
3441
|
-
var i =
|
|
3442
|
-
return
|
|
3175
|
+
var i = K(K({}, t), { directions: K({}, t.directions) });
|
|
3176
|
+
return _t.forEach((function(e) {
|
|
3443
3177
|
i.directions[e] *= r;
|
|
3444
3178
|
})), i;
|
|
3445
3179
|
}
|
|
3446
3180
|
if (t.type === "move") {
|
|
3447
|
-
var a =
|
|
3448
|
-
return
|
|
3181
|
+
var a = K(K({}, t), { directions: K({}, t.directions) });
|
|
3182
|
+
return bt.forEach((function(e) {
|
|
3449
3183
|
a.directions[e] *= r;
|
|
3450
3184
|
})), a;
|
|
3451
3185
|
}
|
|
@@ -3458,9 +3192,9 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
3458
3192
|
var r = n.rotate, i = n.flip, a = {
|
|
3459
3193
|
width: t.naturalWidth,
|
|
3460
3194
|
height: t.naturalHeight
|
|
3461
|
-
}, o =
|
|
3195
|
+
}, o = Nt(a, r), s = e.getContext("2d");
|
|
3462
3196
|
e.height = o.height, e.width = o.width, s.save();
|
|
3463
|
-
var c =
|
|
3197
|
+
var c = Pt(J(K({
|
|
3464
3198
|
left: 0,
|
|
3465
3199
|
top: 0
|
|
3466
3200
|
}, a)), r);
|
|
@@ -3479,7 +3213,7 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
3479
3213
|
return t = e, !Number.isNaN(parseFloat(t)) && isFinite(t);
|
|
3480
3214
|
var t;
|
|
3481
3215
|
}));
|
|
3482
|
-
}, a =
|
|
3216
|
+
}, a = Ht({
|
|
3483
3217
|
sizeRestrictions: {
|
|
3484
3218
|
minWidth: i([r.width, r.minWidth]) || 0,
|
|
3485
3219
|
minHeight: i([r.height, r.minHeight]) || 0,
|
|
@@ -3513,8 +3247,8 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
3513
3247
|
this.$emit("change", this.getResult());
|
|
3514
3248
|
},
|
|
3515
3249
|
applyTransform: function(e) {
|
|
3516
|
-
var t = arguments.length > 1 && arguments[1] !== void 0 && arguments[1], n = this.visibleArea && t ?
|
|
3517
|
-
return
|
|
3250
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 && arguments[1], n = this.visibleArea && t ? Lt(this.sizeRestrictions, this.visibleArea) : this.sizeRestrictions, r = this.visibleArea && t ? Qt(this.positionRestrictions, this.visibleArea) : this.positionRestrictions;
|
|
3251
|
+
return Wt({
|
|
3518
3252
|
transform: e,
|
|
3519
3253
|
coordinates: this.coordinates,
|
|
3520
3254
|
imageSize: this.imageSize,
|
|
@@ -3529,17 +3263,17 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
3529
3263
|
if (this.$refs.image) {
|
|
3530
3264
|
this.$refs.cropper, this.$refs.image;
|
|
3531
3265
|
var t = this.defaultSize;
|
|
3532
|
-
t ||= this.stencilSize ?
|
|
3533
|
-
var n =
|
|
3266
|
+
t ||= this.stencilSize ? Xt : Yt, this.sizeRestrictions;
|
|
3267
|
+
var n = tt(t) ? t({
|
|
3534
3268
|
boundaries: this.boundaries,
|
|
3535
3269
|
imageSize: this.imageSize,
|
|
3536
3270
|
aspectRatio: this.getAspectRatio(),
|
|
3537
3271
|
sizeRestrictions: this.sizeRestrictions,
|
|
3538
3272
|
stencilSize: this.getStencilSize(),
|
|
3539
3273
|
visibleArea: this.visibleArea
|
|
3540
|
-
}) : t, r = this.defaultPosition ||
|
|
3274
|
+
}) : t, r = this.defaultPosition || Jt, i = [n, function(t) {
|
|
3541
3275
|
var n = t.coordinates;
|
|
3542
|
-
return U({},
|
|
3276
|
+
return U({}, tt(r) ? r({
|
|
3543
3277
|
coordinates: n,
|
|
3544
3278
|
imageSize: e.imageSize,
|
|
3545
3279
|
visibleArea: e.visibleArea
|
|
@@ -3575,13 +3309,13 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
3575
3309
|
cropper: n,
|
|
3576
3310
|
imageSize: e.imageSize
|
|
3577
3311
|
};
|
|
3578
|
-
if (
|
|
3312
|
+
if (e.boundaries = tt(e.defaultBoundaries) ? e.defaultBoundaries(t) : e.defaultBoundaries === "fit" ? function(e) {
|
|
3579
3313
|
var t = e.cropper, n = e.imageSize, r = t.clientHeight, i = t.clientWidth, a = r, o = n.width * r / n.height;
|
|
3580
3314
|
return o > i && (o = i, a = n.height * i / n.width), {
|
|
3581
3315
|
width: o,
|
|
3582
3316
|
height: a
|
|
3583
3317
|
};
|
|
3584
|
-
}(t) :
|
|
3318
|
+
}(t) : function(e) {
|
|
3585
3319
|
var t = e.cropper;
|
|
3586
3320
|
return {
|
|
3587
3321
|
width: t.clientWidth,
|
|
@@ -3594,8 +3328,8 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
3594
3328
|
var e = this;
|
|
3595
3329
|
return this.appliedImageTransforms = U(U({}, this.defaultImageTransforms), {}, { flip: U({}, this.defaultImageTransforms.flip) }), this.updateBoundaries().then((function() {
|
|
3596
3330
|
e.priority !== "visible-area" && (e.visibleArea = null, e.resetCoordinates());
|
|
3597
|
-
var t, n, r, i, a, o, s = e.defaultVisibleArea ||
|
|
3598
|
-
e.visibleArea =
|
|
3331
|
+
var t, n, r, i, a, o, s = e.defaultVisibleArea || Zt;
|
|
3332
|
+
e.visibleArea = tt(s) ? s({
|
|
3599
3333
|
imageSize: e.imageSize,
|
|
3600
3334
|
boundaries: e.boundaries,
|
|
3601
3335
|
coordinates: e.priority === "visible-area" ? null : e.coordinates,
|
|
@@ -3605,7 +3339,7 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
3605
3339
|
visibleArea: e.visibleArea,
|
|
3606
3340
|
boundaries: e.boundaries,
|
|
3607
3341
|
getAreaRestrictions: e.getAreaRestrictions
|
|
3608
|
-
}, n = t.visibleArea, r = t.boundaries, i = t.getAreaRestrictions, a =
|
|
3342
|
+
}, n = t.visibleArea, r = t.boundaries, i = t.getAreaRestrictions, a = K({}, n), o = Z(r), a.width / a.height !== o && (a.height = a.width / o), Q(a, i({
|
|
3609
3343
|
visibleArea: a,
|
|
3610
3344
|
type: "move"
|
|
3611
3345
|
}))), e.priority === "visible-area" ? e.resetCoordinates() : e.coordinates = e.fitCoordinates({
|
|
@@ -3646,7 +3380,7 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
3646
3380
|
var e, t = this;
|
|
3647
3381
|
if (this.imageLoaded = !1, this.delayedTransforms = null, this.src) {
|
|
3648
3382
|
if (function(e) {
|
|
3649
|
-
if (
|
|
3383
|
+
if (et(e)) return !1;
|
|
3650
3384
|
var t = window.location, n = /(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(e) || [], r = {
|
|
3651
3385
|
protocol: n[1] || "",
|
|
3652
3386
|
host: n[2] || "",
|
|
@@ -3656,13 +3390,13 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
3656
3390
|
};
|
|
3657
3391
|
return !(!r.protocol && !r.host && !r.port || r.protocol && r.protocol == t.protocol && r.host && r.host == t.host && r.host && i(r) == i(t));
|
|
3658
3392
|
}(this.src)) {
|
|
3659
|
-
var n =
|
|
3393
|
+
var n = q(this.crossOrigin) ? this.canvas : this.crossOrigin;
|
|
3660
3394
|
!0 === n && (n = "anonymous"), this.imageAttributes.crossOrigin = n || null;
|
|
3661
3395
|
}
|
|
3662
3396
|
if (this.checkOrientation) {
|
|
3663
3397
|
var r = (e = this.src, new Promise((function(t) {
|
|
3664
|
-
|
|
3665
|
-
var r =
|
|
3398
|
+
vn(e).then((function(n) {
|
|
3399
|
+
var r = bn(n);
|
|
3666
3400
|
t(n ? {
|
|
3667
3401
|
source: e,
|
|
3668
3402
|
arrayBuffer: n,
|
|
@@ -3699,14 +3433,14 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
3699
3433
|
},
|
|
3700
3434
|
onParseImage: function(e) {
|
|
3701
3435
|
var t = this, n = e.source, r = e.arrayBuffer, i = e.orientation;
|
|
3702
|
-
this.imageAttributes.revoke && this.imageAttributes.src && URL.revokeObjectURL(this.imageAttributes.src), this.imageAttributes.revoke = !1, r && i && i > 1 ?
|
|
3436
|
+
this.imageAttributes.revoke && this.imageAttributes.src && URL.revokeObjectURL(this.imageAttributes.src), this.imageAttributes.revoke = !1, r && i && i > 1 ? $e(n) || !et(n) ? (this.imageAttributes.src = URL.createObjectURL(new Blob([r])), this.imageAttributes.revoke = !0) : this.imageAttributes.src = function(e) {
|
|
3703
3437
|
for (var t = [], n = new Uint8Array(e); n.length > 0;) {
|
|
3704
3438
|
var r = n.subarray(0, 8192);
|
|
3705
3439
|
t.push(String.fromCharCode.apply(null, Array.from ? Array.from(r) : r.slice())), n = n.subarray(8192);
|
|
3706
3440
|
}
|
|
3707
3441
|
return "data:image/jpeg;base64," + btoa(t.join(""));
|
|
3708
|
-
}(r) : this.imageAttributes.src = n,
|
|
3709
|
-
var t =
|
|
3442
|
+
}(r) : this.imageAttributes.src = n, this.appliedImageTransforms = tt(this.defaultTransforms) ? _n(this.defaultTransforms()) : nt(this.defaultTransforms) ? _n(this.defaultTransforms) : function(e) {
|
|
3443
|
+
var t = _n({});
|
|
3710
3444
|
if (e) switch (e) {
|
|
3711
3445
|
case 2:
|
|
3712
3446
|
t.flip.horizontal = !0;
|
|
@@ -3746,7 +3480,7 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
3746
3480
|
var t = this;
|
|
3747
3481
|
this.transitionsOptions.enabled || this.awaitRender((function() {
|
|
3748
3482
|
t.coordinates = t.moveAlgorithm(U(U({}, t.getPublicProperties()), {}, {
|
|
3749
|
-
positionRestrictions:
|
|
3483
|
+
positionRestrictions: Qt(t.positionRestrictions, t.visibleArea),
|
|
3750
3484
|
coordinates: t.coordinates,
|
|
3751
3485
|
event: t.normalizeEvent(e)
|
|
3752
3486
|
})), t.onChange();
|
|
@@ -3757,7 +3491,7 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
3757
3491
|
this.transitionsOptions.enabled || this.stencilSize && !this.autoZoom || this.awaitRender((function() {
|
|
3758
3492
|
var n = t.sizeRestrictions, r = Math.min(t.coordinates.width, t.coordinates.height, 20 * t.coefficient);
|
|
3759
3493
|
t.coordinates = t.resizeAlgorithm(U(U({}, t.getPublicProperties()), {}, {
|
|
3760
|
-
positionRestrictions:
|
|
3494
|
+
positionRestrictions: Qt(t.positionRestrictions, t.visibleArea),
|
|
3761
3495
|
sizeRestrictions: {
|
|
3762
3496
|
maxWidth: Math.min(n.maxWidth, t.visibleArea.width),
|
|
3763
3497
|
maxHeight: Math.min(n.maxHeight, t.visibleArea.height),
|
|
@@ -3773,7 +3507,7 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
3773
3507
|
if (!this.transitionsOptions.enabled) {
|
|
3774
3508
|
var n = t.transitions, r = n !== void 0 && n, i = t.normalize, a = i === void 0 || i;
|
|
3775
3509
|
r && this.enableTransitions();
|
|
3776
|
-
var o =
|
|
3510
|
+
var o = $t(U(U({}, this.getPublicProperties()), {}, {
|
|
3777
3511
|
event: a ? this.normalizeEvent(e) : e,
|
|
3778
3512
|
getAreaRestrictions: this.getAreaRestrictions,
|
|
3779
3513
|
imageRestriction: this.imageRestriction,
|
|
@@ -3801,9 +3535,9 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
3801
3535
|
var s = this.$refs.stencil.aspectRatios();
|
|
3802
3536
|
t = s.minimum, n = s.maximum;
|
|
3803
3537
|
}
|
|
3804
|
-
if (
|
|
3805
|
-
var c = this.getStencilSize(), l = c ?
|
|
3806
|
-
|
|
3538
|
+
if (q(t) && (t = q(i) ? a : i), q(n) && (n = q(i) ? o : i), !e && (q(t) || q(n))) {
|
|
3539
|
+
var c = this.getStencilSize(), l = c ? Z(c) : null;
|
|
3540
|
+
q(t) && (t = at(l) ? l : void 0), q(n) && (n = at(l) ? l : void 0);
|
|
3807
3541
|
}
|
|
3808
3542
|
return {
|
|
3809
3543
|
minimum: t,
|
|
@@ -3821,10 +3555,10 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
3821
3555
|
coefficient: this.coefficient,
|
|
3822
3556
|
coordinates: this.coordinates,
|
|
3823
3557
|
aspectRatio: this.getAspectRatio(!0)
|
|
3824
|
-
}, t = e.boundaries, n = e.stencilSize, r = e.aspectRatio,
|
|
3558
|
+
}, t = e.boundaries, n = e.stencilSize, r = e.aspectRatio, jt(Z(i = tt(n) ? n({
|
|
3825
3559
|
boundaries: t,
|
|
3826
3560
|
aspectRatio: r
|
|
3827
|
-
}) : n), r) && (i =
|
|
3561
|
+
}) : n), r) && (i = Ht({
|
|
3828
3562
|
sizeRestrictions: {
|
|
3829
3563
|
maxWidth: t.width,
|
|
3830
3564
|
maxHeight: t.height,
|
|
@@ -3837,7 +3571,7 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
3837
3571
|
minimum: r.minimum,
|
|
3838
3572
|
maximum: r.maximum
|
|
3839
3573
|
}
|
|
3840
|
-
})), (i.width > t.width || i.height > t.height) && (i =
|
|
3574
|
+
})), (i.width > t.width || i.height > t.height) && (i = Ht({
|
|
3841
3575
|
sizeRestrictions: {
|
|
3842
3576
|
maxWidth: t.width,
|
|
3843
3577
|
maxHeight: t.height,
|
|
@@ -3847,8 +3581,8 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
3847
3581
|
width: i.width,
|
|
3848
3582
|
height: i.height,
|
|
3849
3583
|
aspectRatio: {
|
|
3850
|
-
minimum:
|
|
3851
|
-
maximum:
|
|
3584
|
+
minimum: Z(i),
|
|
3585
|
+
maximum: Z(i)
|
|
3852
3586
|
}
|
|
3853
3587
|
})), i;
|
|
3854
3588
|
var e, t, n, r, i;
|
|
@@ -3866,13 +3600,13 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
3866
3600
|
};
|
|
3867
3601
|
},
|
|
3868
3602
|
defaultCoordinates: function() {
|
|
3869
|
-
return U({},
|
|
3603
|
+
return U({}, St);
|
|
3870
3604
|
},
|
|
3871
3605
|
flip: function(e, t) {
|
|
3872
3606
|
var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
|
|
3873
3607
|
if (!this.transitionsActive) {
|
|
3874
3608
|
r && this.enableTransitions();
|
|
3875
|
-
var i = U({}, this.imageTransforms.flip), a =
|
|
3609
|
+
var i = U({}, this.imageTransforms.flip), a = tn({
|
|
3876
3610
|
flip: {
|
|
3877
3611
|
horizontal: e ? !i.horizontal : i.horizontal,
|
|
3878
3612
|
vertical: t ? !i.vertical : i.vertical
|
|
@@ -3896,7 +3630,7 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
3896
3630
|
n && this.enableTransitions();
|
|
3897
3631
|
var r = U({}, this.imageSize);
|
|
3898
3632
|
this.appliedImageTransforms.rotate += e;
|
|
3899
|
-
var i =
|
|
3633
|
+
var i = en({
|
|
3900
3634
|
visibleArea: this.visibleArea,
|
|
3901
3635
|
coordinates: this.coordinates,
|
|
3902
3636
|
previousImageSize: r,
|
|
@@ -3916,16 +3650,16 @@ var Mn = ["transitions"], Nn = K("vue-advanced-cropper"), Pn = {
|
|
|
3916
3650
|
"error",
|
|
3917
3651
|
"ready"
|
|
3918
3652
|
]
|
|
3919
|
-
},
|
|
3653
|
+
}, Mn = {
|
|
3920
3654
|
key: 0,
|
|
3921
3655
|
ref: "canvas",
|
|
3922
3656
|
style: { display: "none" }
|
|
3923
|
-
},
|
|
3657
|
+
}, Nn = {
|
|
3924
3658
|
key: 1,
|
|
3925
3659
|
ref: "sourceCanvas",
|
|
3926
3660
|
style: { display: "none" }
|
|
3927
3661
|
};
|
|
3928
|
-
|
|
3662
|
+
jn.render = function(e, t, n, i, a, o) {
|
|
3929
3663
|
return z(), h("div", {
|
|
3930
3664
|
ref: "cropper",
|
|
3931
3665
|
class: o.classes.cropper
|
|
@@ -3944,7 +3678,7 @@ Pn.render = function(e, t, n, i, a, o) {
|
|
|
3944
3678
|
onMove: o.onManipulateImage,
|
|
3945
3679
|
onResize: o.onManipulateImage
|
|
3946
3680
|
}, {
|
|
3947
|
-
default:
|
|
3681
|
+
default: P((function() {
|
|
3948
3682
|
return [
|
|
3949
3683
|
p("div", {
|
|
3950
3684
|
class: o.classes.background,
|
|
@@ -3983,8 +3717,8 @@ Pn.render = function(e, t, n, i, a, o) {
|
|
|
3983
3717
|
"onMove",
|
|
3984
3718
|
"onMoveEnd"
|
|
3985
3719
|
])), [[ye, a.imageLoaded]]),
|
|
3986
|
-
n.canvas ? (z(), h("canvas",
|
|
3987
|
-
n.canvas ? (z(), h("canvas",
|
|
3720
|
+
n.canvas ? (z(), h("canvas", Mn, null, 512)) : M("", !0),
|
|
3721
|
+
n.canvas ? (z(), h("canvas", Nn, null, 512)) : M("", !0)
|
|
3988
3722
|
];
|
|
3989
3723
|
})),
|
|
3990
3724
|
_: 1
|
|
@@ -4000,57 +3734,57 @@ Pn.render = function(e, t, n, i, a, o) {
|
|
|
4000
3734
|
};
|
|
4001
3735
|
//#endregion
|
|
4002
3736
|
//#region src/components/media/MediaEditModal.vue?vue&type=script&setup=true&lang.ts
|
|
4003
|
-
var
|
|
3737
|
+
var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In = {
|
|
4004
3738
|
class: "tpl:text-sm tpl:font-semibold",
|
|
4005
3739
|
style: { color: "var(--tpl-text)" }
|
|
4006
|
-
},
|
|
3740
|
+
}, Ln = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto tpl:px-5" }, Rn = {
|
|
4007
3741
|
key: 0,
|
|
4008
3742
|
class: "tpl:mb-4"
|
|
4009
|
-
},
|
|
3743
|
+
}, zn = {
|
|
4010
3744
|
class: "tpl:relative tpl:mb-3 tpl:overflow-hidden tpl:rounded-md tpl:border",
|
|
4011
3745
|
style: {
|
|
4012
3746
|
"border-color": "var(--tpl-border)",
|
|
4013
3747
|
height: "300px",
|
|
4014
3748
|
"background-color": "var(--tpl-bg)"
|
|
4015
3749
|
}
|
|
4016
|
-
},
|
|
3750
|
+
}, Bn = { class: "tpl:space-y-3" }, Vn = {
|
|
4017
3751
|
class: "tpl:mb-1.5 tpl:block tpl:text-xs tpl:font-medium",
|
|
4018
3752
|
style: { color: "var(--tpl-text-muted)" }
|
|
4019
|
-
},
|
|
3753
|
+
}, Hn = { class: "tpl:flex tpl:flex-wrap tpl:gap-1.5" }, Un = ["onClick"], Wn = { class: "tpl:flex tpl:gap-3" }, Gn = { class: "tpl:flex-1" }, Kn = {
|
|
4020
3754
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
4021
3755
|
style: { color: "var(--tpl-text-muted)" }
|
|
4022
|
-
},
|
|
3756
|
+
}, qn = {
|
|
4023
3757
|
class: "tpl:font-normal",
|
|
4024
3758
|
style: { color: "var(--tpl-text-dim)" }
|
|
4025
|
-
},
|
|
3759
|
+
}, Jn = { class: "tpl:relative" }, Yn = ["value", "placeholder"], Xn = {
|
|
4026
3760
|
class: "tpl:absolute tpl:top-1/2 tpl:right-2.5 tpl:-translate-y-1/2 tpl:text-xs",
|
|
4027
3761
|
style: { color: "var(--tpl-text-dim)" }
|
|
4028
|
-
},
|
|
3762
|
+
}, Zn = { class: "tpl:flex-1" }, Qn = {
|
|
4029
3763
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
4030
3764
|
style: { color: "var(--tpl-text-muted)" }
|
|
4031
|
-
},
|
|
3765
|
+
}, $n = {
|
|
4032
3766
|
class: "tpl:font-normal",
|
|
4033
3767
|
style: { color: "var(--tpl-text-dim)" }
|
|
4034
|
-
},
|
|
3768
|
+
}, er = { class: "tpl:relative" }, tr = ["value", "placeholder"], nr = {
|
|
4035
3769
|
class: "tpl:absolute tpl:top-1/2 tpl:right-2.5 tpl:-translate-y-1/2 tpl:text-xs",
|
|
4036
3770
|
style: { color: "var(--tpl-text-dim)" }
|
|
4037
|
-
},
|
|
3771
|
+
}, rr = {
|
|
4038
3772
|
key: 0,
|
|
4039
3773
|
class: "tpl:flex tpl:items-center tpl:gap-1 tpl:text-xs",
|
|
4040
3774
|
style: { color: "var(--tpl-text-muted)" }
|
|
4041
|
-
},
|
|
3775
|
+
}, ir = {
|
|
4042
3776
|
class: "tpl:font-medium",
|
|
4043
3777
|
style: { color: "var(--tpl-text)" }
|
|
4044
|
-
},
|
|
3778
|
+
}, ar = { class: "tpl:mb-3" }, or = {
|
|
4045
3779
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
4046
3780
|
style: { color: "var(--tpl-text-muted)" }
|
|
4047
|
-
},
|
|
3781
|
+
}, sr = ["autofocus"], cr = {
|
|
4048
3782
|
key: 1,
|
|
4049
3783
|
class: "tpl:mb-4"
|
|
4050
|
-
},
|
|
3784
|
+
}, lr = {
|
|
4051
3785
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
4052
3786
|
style: { color: "var(--tpl-text-muted)" }
|
|
4053
|
-
},
|
|
3787
|
+
}, ur = ["placeholder"], dr = { class: "tpl:flex tpl:shrink-0 tpl:justify-end tpl:gap-2 tpl:p-5 tpl:pt-4" }, fr = ["disabled"], pr = /*@__PURE__*/ m({
|
|
4054
3788
|
__name: "MediaEditModal",
|
|
4055
3789
|
props: {
|
|
4056
3790
|
visible: { type: Boolean },
|
|
@@ -4058,38 +3792,38 @@ var Ln = ["data-tpl-theme"], Rn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, zn
|
|
|
4058
3792
|
},
|
|
4059
3793
|
emits: ["save", "close"],
|
|
4060
3794
|
setup(n, { emit: o }) {
|
|
4061
|
-
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),
|
|
3795
|
+
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), ie = e(!1), ae = e(!1), oe = a(() => c.item ? [
|
|
4062
3796
|
"image/jpeg",
|
|
4063
3797
|
"image/png",
|
|
4064
3798
|
"image/webp",
|
|
4065
3799
|
"image/gif"
|
|
4066
|
-
].includes(c.item.mime_type) : !1),
|
|
3800
|
+
].includes(c.item.mime_type) : !1), se = a(() => w.value === "original" ? te.value : Ie[w.value]), ce = a(() => ne.value ? Be(ne.value.width, ne.value.height, T.value, E.value) : null);
|
|
4067
3801
|
s(() => c.visible, (e) => {
|
|
4068
|
-
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,
|
|
3802
|
+
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, ae.value = !1, c.item.width && c.item.height && (te.value = c.item.width / c.item.height));
|
|
4069
3803
|
});
|
|
4070
|
-
function
|
|
3804
|
+
function le(e) {
|
|
4071
3805
|
e.coordinates && (ne.value = {
|
|
4072
3806
|
width: Math.round(e.coordinates.width),
|
|
4073
3807
|
height: Math.round(e.coordinates.height)
|
|
4074
|
-
},
|
|
3808
|
+
}, ae.value = !0);
|
|
4075
3809
|
}
|
|
4076
|
-
function
|
|
3810
|
+
function ue() {
|
|
4077
3811
|
re.value = !0, !te.value && c.item?.width && c.item?.height && (te.value = c.item.width / c.item.height);
|
|
4078
3812
|
}
|
|
4079
|
-
function
|
|
3813
|
+
function de(e) {
|
|
4080
3814
|
let t = e.target.value;
|
|
4081
3815
|
D.value = t, T.value = t && parseInt(t, 10) || void 0;
|
|
4082
3816
|
}
|
|
4083
|
-
function
|
|
3817
|
+
function fe(e) {
|
|
4084
3818
|
let t = e.target.value;
|
|
4085
3819
|
O.value = t, E.value = t && parseInt(t, 10) || void 0;
|
|
4086
3820
|
}
|
|
4087
|
-
async function
|
|
3821
|
+
async function pe() {
|
|
4088
3822
|
let e = y.value.trim();
|
|
4089
|
-
if (!e || !c.item ||
|
|
3823
|
+
if (!e || !c.item || ie.value) return;
|
|
4090
3824
|
let t = v(c.item.mime_type), n;
|
|
4091
|
-
if (
|
|
4092
|
-
|
|
3825
|
+
if (oe.value && C.value && ae.value) {
|
|
3826
|
+
ie.value = !0;
|
|
4093
3827
|
try {
|
|
4094
3828
|
let { canvas: e } = C.value.getResult();
|
|
4095
3829
|
if (e) {
|
|
@@ -4097,17 +3831,17 @@ var Ln = ["data-tpl-theme"], Rn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, zn
|
|
|
4097
3831
|
n = { file: await ze(t, c.item.filename, r) };
|
|
4098
3832
|
}
|
|
4099
3833
|
} catch {
|
|
4100
|
-
|
|
3834
|
+
ie.value = !1;
|
|
4101
3835
|
return;
|
|
4102
3836
|
}
|
|
4103
|
-
|
|
3837
|
+
ie.value = !1;
|
|
4104
3838
|
}
|
|
4105
3839
|
d("save", c.item.id, e, t ? x.value : void 0, n), d("close");
|
|
4106
3840
|
}
|
|
4107
|
-
function
|
|
4108
|
-
e.key === "Enter" && !
|
|
3841
|
+
function me(e) {
|
|
3842
|
+
e.key === "Enter" && !ie.value && (e.preventDefault(), pe()), e.key === "Escape" && d("close");
|
|
4109
3843
|
}
|
|
4110
|
-
return (e, a) => (z(), h(b, { to:
|
|
3844
|
+
return (e, a) => (z(), h(b, { to: A(g) || "body" }, [p(ve, {
|
|
4111
3845
|
"enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
|
|
4112
3846
|
"enter-from-class": "tpl:opacity-0",
|
|
4113
3847
|
"enter-to-class": "tpl:opacity-100",
|
|
@@ -4115,30 +3849,30 @@ var Ln = ["data-tpl-theme"], Rn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, zn
|
|
|
4115
3849
|
"leave-from-class": "tpl:opacity-100",
|
|
4116
3850
|
"leave-to-class": "tpl:opacity-0"
|
|
4117
3851
|
}, {
|
|
4118
|
-
default:
|
|
3852
|
+
default: P(() => [n.visible && n.item ? (z(), t("div", {
|
|
4119
3853
|
key: 0,
|
|
4120
|
-
"data-tpl-theme":
|
|
3854
|
+
"data-tpl-theme": A(m),
|
|
4121
3855
|
class: "tpl tpl:fixed tpl:inset-0 tpl:z-[10000] tpl:flex tpl:items-center tpl:justify-center",
|
|
4122
3856
|
style: { "background-color": "var(--tpl-overlay)" },
|
|
4123
3857
|
onClick: a[3] ||= r((e) => d("close"), ["self"]),
|
|
4124
|
-
onKeydown:
|
|
3858
|
+
onKeydown: me
|
|
4125
3859
|
}, [i("div", {
|
|
4126
|
-
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",
|
|
3860
|
+
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", oe.value ? "tpl:max-w-2xl" : "tpl:max-w-sm"]),
|
|
4127
3861
|
style: { "background-color": "var(--tpl-bg-elevated)" }
|
|
4128
3862
|
}, [
|
|
4129
|
-
i("div",
|
|
4130
|
-
i("div",
|
|
4131
|
-
|
|
3863
|
+
i("div", Fn, [i("h3", In, I(A(f).mediaLibrary.editFile), 1)]),
|
|
3864
|
+
i("div", Ln, [
|
|
3865
|
+
oe.value ? (z(), t("div", Rn, [i("div", zn, [p(A(jn), {
|
|
4132
3866
|
ref_key: "cropperRef",
|
|
4133
3867
|
ref: C,
|
|
4134
3868
|
src: n.item.url,
|
|
4135
|
-
"stencil-props": { aspectRatio:
|
|
3869
|
+
"stencil-props": { aspectRatio: se.value },
|
|
4136
3870
|
class: "tpl:h-full tpl:w-full",
|
|
4137
3871
|
"background-class": "tpl-cropper-background",
|
|
4138
|
-
onChange:
|
|
4139
|
-
onReady:
|
|
4140
|
-
}, null, 8, ["src", "stencil-props"])]), i("div",
|
|
4141
|
-
i("div", null, [i("label",
|
|
3872
|
+
onChange: le,
|
|
3873
|
+
onReady: ue
|
|
3874
|
+
}, null, 8, ["src", "stencil-props"])]), i("div", Bn, [
|
|
3875
|
+
i("div", null, [i("label", Vn, I(A(f).mediaLibrary.cropAspectRatio), 1), i("div", Hn, [(z(), t(R, null, S([
|
|
4142
3876
|
"free",
|
|
4143
3877
|
"square",
|
|
4144
3878
|
"landscape43",
|
|
@@ -4148,14 +3882,14 @@ var Ln = ["data-tpl-theme"], Rn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, zn
|
|
|
4148
3882
|
key: e,
|
|
4149
3883
|
type: "button",
|
|
4150
3884
|
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",
|
|
4151
|
-
style:
|
|
3885
|
+
style: N({
|
|
4152
3886
|
borderColor: w.value === e ? "var(--tpl-primary)" : "var(--tpl-border)",
|
|
4153
3887
|
backgroundColor: w.value === e ? "var(--tpl-primary-light)" : "var(--tpl-bg)",
|
|
4154
3888
|
color: w.value === e ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
4155
3889
|
}),
|
|
4156
3890
|
onClick: (t) => w.value = e
|
|
4157
|
-
},
|
|
4158
|
-
i("div",
|
|
3891
|
+
}, I(A(_)[`crop${e.charAt(0).toUpperCase()}${e.slice(1)}`]), 13, Un)), 64))])]),
|
|
3892
|
+
i("div", Wn, [i("div", Gn, [i("label", Kn, [j(I(A(f).mediaLibrary.cropMaxWidth) + " ", 1), i("span", qn, I(A(f).mediaLibrary.cropOptional), 1)]), i("div", Jn, [i("input", {
|
|
4159
3893
|
value: D.value,
|
|
4160
3894
|
type: "number",
|
|
4161
3895
|
min: "1",
|
|
@@ -4166,8 +3900,8 @@ var Ln = ["data-tpl-theme"], Rn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, zn
|
|
|
4166
3900
|
color: "var(--tpl-text)"
|
|
4167
3901
|
},
|
|
4168
3902
|
placeholder: ne.value?.width?.toString() || "",
|
|
4169
|
-
onInput:
|
|
4170
|
-
}, null, 40,
|
|
3903
|
+
onInput: de
|
|
3904
|
+
}, null, 40, Yn), i("span", Xn, I(A(f).mediaLibrary.cropPixels), 1)])]), i("div", Zn, [i("label", Qn, [j(I(A(f).mediaLibrary.cropMaxHeight) + " ", 1), i("span", $n, I(A(f).mediaLibrary.cropOptional), 1)]), i("div", er, [i("input", {
|
|
4171
3905
|
value: O.value,
|
|
4172
3906
|
type: "number",
|
|
4173
3907
|
min: "1",
|
|
@@ -4178,11 +3912,11 @@ var Ln = ["data-tpl-theme"], Rn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, zn
|
|
|
4178
3912
|
color: "var(--tpl-text)"
|
|
4179
3913
|
},
|
|
4180
3914
|
placeholder: ne.value?.height?.toString() || "",
|
|
4181
|
-
onInput:
|
|
4182
|
-
}, null, 40,
|
|
4183
|
-
|
|
4184
|
-
])])) :
|
|
4185
|
-
i("div",
|
|
3915
|
+
onInput: fe
|
|
3916
|
+
}, null, 40, tr), i("span", nr, I(A(f).mediaLibrary.cropPixels), 1)])])]),
|
|
3917
|
+
ce.value ? (z(), t("div", rr, [i("span", null, I(A(f).mediaLibrary.cropOutputSize) + ": ", 1), i("span", ir, I(ce.value.width) + " x " + I(ce.value.height) + " " + I(A(f).mediaLibrary.cropPixels), 1)])) : M("", !0)
|
|
3918
|
+
])])) : M("", !0),
|
|
3919
|
+
i("div", ar, [i("label", or, I(A(f).mediaLibrary.fileName), 1), u(i("input", {
|
|
4186
3920
|
"onUpdate:modelValue": a[0] ||= (e) => y.value = e,
|
|
4187
3921
|
type: "text",
|
|
4188
3922
|
class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
|
|
@@ -4191,9 +3925,9 @@ var Ln = ["data-tpl-theme"], Rn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, zn
|
|
|
4191
3925
|
"background-color": "var(--tpl-bg)",
|
|
4192
3926
|
color: "var(--tpl-text)"
|
|
4193
3927
|
},
|
|
4194
|
-
autofocus: !
|
|
4195
|
-
}, null, 8,
|
|
4196
|
-
|
|
3928
|
+
autofocus: !oe.value
|
|
3929
|
+
}, null, 8, sr), [[ee, y.value]])]),
|
|
3930
|
+
A(v)(n.item.mime_type) ? (z(), t("div", cr, [i("label", lr, I(A(f).mediaLibrary.altText), 1), u(i("input", {
|
|
4197
3931
|
"onUpdate:modelValue": a[1] ||= (e) => x.value = e,
|
|
4198
3932
|
type: "text",
|
|
4199
3933
|
class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
|
|
@@ -4202,10 +3936,10 @@ var Ln = ["data-tpl-theme"], Rn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, zn
|
|
|
4202
3936
|
"background-color": "var(--tpl-bg)",
|
|
4203
3937
|
color: "var(--tpl-text)"
|
|
4204
3938
|
},
|
|
4205
|
-
placeholder:
|
|
4206
|
-
}, null, 8,
|
|
3939
|
+
placeholder: A(f).mediaLibrary.altTextPlaceholder
|
|
3940
|
+
}, null, 8, ur), [[ee, x.value]])])) : M("", !0)
|
|
4207
3941
|
]),
|
|
4208
|
-
i("div",
|
|
3942
|
+
i("div", dr, [i("button", {
|
|
4209
3943
|
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",
|
|
4210
3944
|
style: {
|
|
4211
3945
|
"border-color": "var(--tpl-border)",
|
|
@@ -4213,30 +3947,30 @@ var Ln = ["data-tpl-theme"], Rn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, zn
|
|
|
4213
3947
|
"background-color": "var(--tpl-bg)"
|
|
4214
3948
|
},
|
|
4215
3949
|
onClick: a[2] ||= (e) => d("close")
|
|
4216
|
-
},
|
|
3950
|
+
}, I(A(f).mediaLibrary.cancel), 1), i("button", {
|
|
4217
3951
|
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",
|
|
4218
3952
|
style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
|
|
4219
|
-
disabled:
|
|
4220
|
-
onClick:
|
|
4221
|
-
},
|
|
4222
|
-
], 2)], 40,
|
|
3953
|
+
disabled: ie.value,
|
|
3954
|
+
onClick: pe
|
|
3955
|
+
}, I(ie.value ? A(f).mediaLibrary.saving : A(f).mediaLibrary.saveChanges), 9, fr)])
|
|
3956
|
+
], 2)], 40, Pn)) : M("", !0)]),
|
|
4223
3957
|
_: 1
|
|
4224
3958
|
})], 8, ["to"]));
|
|
4225
3959
|
}
|
|
4226
|
-
}),
|
|
3960
|
+
}), mr = (e, t) => {
|
|
4227
3961
|
let n = e.__vccOpts || e;
|
|
4228
3962
|
for (let [e, r] of t) n[e] = r;
|
|
4229
3963
|
return n;
|
|
4230
|
-
},
|
|
3964
|
+
}, hr = /*#__PURE__*/ mr(pr, [["__scopeId", "data-v-6b677237"]]), gr = {
|
|
4231
3965
|
key: 1,
|
|
4232
3966
|
class: "tpl:size-4 tpl:shrink-0"
|
|
4233
|
-
},
|
|
3967
|
+
}, _r = {
|
|
4234
3968
|
key: 0,
|
|
4235
3969
|
class: "tpl:truncate"
|
|
4236
|
-
},
|
|
3970
|
+
}, vr = {
|
|
4237
3971
|
key: 3,
|
|
4238
3972
|
class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:gap-0.5 tpl:opacity-0 tpl:transition-opacity tpl:group-hover:opacity-100"
|
|
4239
|
-
},
|
|
3973
|
+
}, yr = ["title"], br = ["title"], xr = { key: 0 }, Sr = ["placeholder"], Cr = /* @__PURE__ */ m({
|
|
4240
3974
|
__name: "MediaFolderTreeNode",
|
|
4241
3975
|
props: {
|
|
4242
3976
|
folder: {},
|
|
@@ -4250,7 +3984,7 @@ var Ln = ["data-tpl-theme"], Rn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, zn
|
|
|
4250
3984
|
"deleteFolder"
|
|
4251
3985
|
],
|
|
4252
3986
|
setup(n, { emit: o }) {
|
|
4253
|
-
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 <
|
|
3987
|
+
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 < 4), 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);
|
|
4254
3988
|
function E(e, t) {
|
|
4255
3989
|
for (let n of e) if (n.id === t || n.children && E(n.children, t)) return !0;
|
|
4256
3990
|
return !1;
|
|
@@ -4271,17 +4005,17 @@ var Ln = ["data-tpl-theme"], Rn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, zn
|
|
|
4271
4005
|
function re() {
|
|
4272
4006
|
g.value = !0, _.value = "", d.value = !0;
|
|
4273
4007
|
}
|
|
4274
|
-
function
|
|
4008
|
+
function ie() {
|
|
4275
4009
|
_.value.trim() && c("createFolder", _.value.trim(), s.folder.id), g.value = !1, _.value = "";
|
|
4276
4010
|
}
|
|
4277
|
-
function
|
|
4011
|
+
function oe() {
|
|
4278
4012
|
g.value = !1, _.value = "";
|
|
4279
4013
|
}
|
|
4280
4014
|
return (e, a) => {
|
|
4281
4015
|
let o = x("MediaFolderTreeNode", !0);
|
|
4282
4016
|
return z(), t("div", null, [i("div", {
|
|
4283
4017
|
class: "tpl:group tpl:flex tpl:w-full tpl:items-center tpl:gap-1 tpl:py-1.5 tpl:pr-2 tpl:text-left tpl:text-xs tpl:transition-all tpl:duration-150",
|
|
4284
|
-
style:
|
|
4018
|
+
style: N({
|
|
4285
4019
|
paddingLeft: `${n.depth * 16 + 8}px`,
|
|
4286
4020
|
backgroundColor: C.value ? "var(--tpl-bg-active)" : "transparent",
|
|
4287
4021
|
color: C.value ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
@@ -4291,19 +4025,19 @@ var Ln = ["data-tpl-theme"], Rn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, zn
|
|
|
4291
4025
|
key: 0,
|
|
4292
4026
|
class: "tpl:flex tpl:size-4 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
4293
4027
|
onClick: r(D, ["stop"])
|
|
4294
|
-
}, [p(
|
|
4028
|
+
}, [p(A(ae), {
|
|
4295
4029
|
class: k(["tpl:transition-transform tpl:duration-150", { "tpl:rotate-90": T.value }]),
|
|
4296
4030
|
size: 10,
|
|
4297
4031
|
"stroke-width": 2
|
|
4298
|
-
}, null, 8, ["class"])])) : (z(), t("span",
|
|
4032
|
+
}, null, 8, ["class"])])) : (z(), t("span", gr)),
|
|
4299
4033
|
i("button", {
|
|
4300
4034
|
class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-1.5",
|
|
4301
4035
|
onClick: a[0] ||= (e) => c("navigate", n.folder.id)
|
|
4302
|
-
}, [p(
|
|
4036
|
+
}, [p(A(pe), {
|
|
4303
4037
|
class: "tpl:shrink-0",
|
|
4304
4038
|
size: 14,
|
|
4305
4039
|
"stroke-width": 1.5
|
|
4306
|
-
}), f.value ?
|
|
4040
|
+
}), f.value ? M("", !0) : (z(), t("span", _r, I(n.folder.name), 1))]),
|
|
4307
4041
|
f.value ? u((z(), t("input", {
|
|
4308
4042
|
key: 2,
|
|
4309
4043
|
"onUpdate:modelValue": a[1] ||= (e) => m.value = e,
|
|
@@ -4318,35 +4052,35 @@ var Ln = ["data-tpl-theme"], Rn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, zn
|
|
|
4318
4052
|
onKeydown: [y(te, ["enter"]), y(ne, ["escape"])],
|
|
4319
4053
|
onBlur: te,
|
|
4320
4054
|
onClick: a[2] ||= r(() => {}, ["stop"])
|
|
4321
|
-
}, null, 544)), [[ee, m.value]]) :
|
|
4322
|
-
f.value ?
|
|
4055
|
+
}, null, 544)), [[ee, m.value]]) : M("", !0),
|
|
4056
|
+
f.value ? M("", !0) : (z(), t("span", vr, [
|
|
4323
4057
|
b.value ? (z(), t("button", {
|
|
4324
4058
|
key: 0,
|
|
4325
4059
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
4326
|
-
title:
|
|
4060
|
+
title: A(l).mediaLibrary.addSubfolder,
|
|
4327
4061
|
onClick: r(re, ["stop"])
|
|
4328
|
-
}, [p(
|
|
4062
|
+
}, [p(A(fe), {
|
|
4329
4063
|
size: 12,
|
|
4330
4064
|
"stroke-width": 2
|
|
4331
|
-
})], 8,
|
|
4065
|
+
})], 8, yr)) : M("", !0),
|
|
4332
4066
|
i("button", {
|
|
4333
4067
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
4334
|
-
title:
|
|
4068
|
+
title: A(l).mediaLibrary.renameFolder,
|
|
4335
4069
|
onClick: r(O, ["stop"])
|
|
4336
|
-
}, [p(
|
|
4070
|
+
}, [p(A(he), {
|
|
4337
4071
|
size: 12,
|
|
4338
4072
|
"stroke-width": 2
|
|
4339
|
-
})], 8,
|
|
4073
|
+
})], 8, br),
|
|
4340
4074
|
i("button", {
|
|
4341
4075
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
4342
4076
|
onClick: a[3] ||= r((e) => c("deleteFolder", n.folder.id), ["stop"])
|
|
4343
|
-
}, [p(
|
|
4077
|
+
}, [p(A(ue), {
|
|
4344
4078
|
size: 12,
|
|
4345
4079
|
"stroke-width": 2,
|
|
4346
4080
|
style: { color: "var(--tpl-danger)" }
|
|
4347
4081
|
})])
|
|
4348
4082
|
]))
|
|
4349
|
-
], 4), T.value ? (z(), t("div",
|
|
4083
|
+
], 4), T.value ? (z(), t("div", xr, [(z(!0), t(R, null, S(n.folder.children, (e) => (z(), h(o, {
|
|
4350
4084
|
key: e.id,
|
|
4351
4085
|
folder: e,
|
|
4352
4086
|
"current-folder-id": n.currentFolderId,
|
|
@@ -4361,7 +4095,7 @@ var Ln = ["data-tpl-theme"], Rn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, zn
|
|
|
4361
4095
|
"depth"
|
|
4362
4096
|
]))), 128)), g.value ? (z(), t("div", {
|
|
4363
4097
|
key: 0,
|
|
4364
|
-
style:
|
|
4098
|
+
style: N({ paddingLeft: `${(n.depth + 1) * 16 + 8}px` }),
|
|
4365
4099
|
class: "tpl:py-1.5 tpl:pr-2"
|
|
4366
4100
|
}, [u(i("input", {
|
|
4367
4101
|
"onUpdate:modelValue": a[8] ||= (e) => _.value = e,
|
|
@@ -4372,17 +4106,17 @@ var Ln = ["data-tpl-theme"], Rn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, zn
|
|
|
4372
4106
|
"background-color": "var(--tpl-bg)",
|
|
4373
4107
|
color: "var(--tpl-text)"
|
|
4374
4108
|
},
|
|
4375
|
-
placeholder:
|
|
4109
|
+
placeholder: A(l).mediaLibrary.subfolderName,
|
|
4376
4110
|
autofocus: "",
|
|
4377
|
-
onKeydown: [y(
|
|
4378
|
-
onBlur:
|
|
4379
|
-
}, null, 40,
|
|
4111
|
+
onKeydown: [y(ie, ["enter"]), y(oe, ["escape"])],
|
|
4112
|
+
onBlur: ie
|
|
4113
|
+
}, null, 40, Sr), [[ee, _.value]])], 4)) : M("", !0)])) : M("", !0)]);
|
|
4380
4114
|
};
|
|
4381
4115
|
}
|
|
4382
|
-
}),
|
|
4116
|
+
}), wr = { class: "tpl:flex tpl:h-full tpl:flex-col tpl:overflow-y-auto" }, Tr = {
|
|
4383
4117
|
key: 0,
|
|
4384
4118
|
class: "tpl:px-3 tpl:py-2"
|
|
4385
|
-
},
|
|
4119
|
+
}, Er = ["placeholder"], Dr = /* @__PURE__ */ m({
|
|
4386
4120
|
__name: "MediaFolderTree",
|
|
4387
4121
|
props: {
|
|
4388
4122
|
folders: {},
|
|
@@ -4408,19 +4142,19 @@ var Ln = ["data-tpl-theme"], Rn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, zn
|
|
|
4408
4142
|
function f() {
|
|
4409
4143
|
s.value = !1, c.value = "";
|
|
4410
4144
|
}
|
|
4411
|
-
return (e, r) => (z(), t("div",
|
|
4145
|
+
return (e, r) => (z(), t("div", wr, [
|
|
4412
4146
|
i("button", {
|
|
4413
4147
|
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",
|
|
4414
|
-
style:
|
|
4148
|
+
style: N({
|
|
4415
4149
|
backgroundColor: n.viewMode === "files" && n.currentFolderId === null ? "var(--tpl-bg-active)" : "transparent",
|
|
4416
4150
|
color: n.viewMode === "files" && n.currentFolderId === null ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
4417
4151
|
}),
|
|
4418
4152
|
onClick: r[0] ||= (e) => a("navigate", null)
|
|
4419
|
-
}, [p(
|
|
4153
|
+
}, [p(A(le), {
|
|
4420
4154
|
size: 14,
|
|
4421
4155
|
"stroke-width": 1.5
|
|
4422
|
-
}),
|
|
4423
|
-
(z(!0), t(R, null, S(n.folders, (e) => (z(), h(
|
|
4156
|
+
}), j(" " + I(A(o).mediaLibrary.allFiles), 1)], 4),
|
|
4157
|
+
(z(!0), t(R, null, S(n.folders, (e) => (z(), h(Cr, {
|
|
4424
4158
|
key: e.id,
|
|
4425
4159
|
folder: e,
|
|
4426
4160
|
"current-folder-id": n.currentFolderId,
|
|
@@ -4430,7 +4164,7 @@ var Ln = ["data-tpl-theme"], Rn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, zn
|
|
|
4430
4164
|
onRenameFolder: r[3] ||= (e, t) => a("renameFolder", e, t),
|
|
4431
4165
|
onDeleteFolder: r[4] ||= (e) => a("deleteFolder", e)
|
|
4432
4166
|
}, null, 8, ["folder", "current-folder-id"]))), 128)),
|
|
4433
|
-
s.value ? (z(), t("div",
|
|
4167
|
+
s.value ? (z(), t("div", Tr, [u(i("input", {
|
|
4434
4168
|
"onUpdate:modelValue": r[5] ||= (e) => c.value = e,
|
|
4435
4169
|
type: "text",
|
|
4436
4170
|
class: "tpl:w-full tpl:rounded tpl:border tpl:px-2 tpl:py-1 tpl:text-xs tpl:outline-none",
|
|
@@ -4439,37 +4173,37 @@ var Ln = ["data-tpl-theme"], Rn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, zn
|
|
|
4439
4173
|
"background-color": "var(--tpl-bg)",
|
|
4440
4174
|
color: "var(--tpl-text)"
|
|
4441
4175
|
},
|
|
4442
|
-
placeholder:
|
|
4176
|
+
placeholder: A(o).mediaLibrary.folderName,
|
|
4443
4177
|
autofocus: "",
|
|
4444
4178
|
onKeydown: [y(d, ["enter"]), y(f, ["escape"])],
|
|
4445
4179
|
onBlur: d
|
|
4446
|
-
}, null, 40,
|
|
4447
|
-
s.value ?
|
|
4180
|
+
}, null, 40, Er), [[ee, c.value]])])) : M("", !0),
|
|
4181
|
+
s.value ? M("", !0) : (z(), t("button", {
|
|
4448
4182
|
key: 1,
|
|
4449
4183
|
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",
|
|
4450
4184
|
style: { color: "var(--tpl-text-muted)" },
|
|
4451
4185
|
onClick: l
|
|
4452
|
-
}, [p(
|
|
4186
|
+
}, [p(A(fe), {
|
|
4453
4187
|
size: 14,
|
|
4454
4188
|
"stroke-width": 1.5
|
|
4455
|
-
}),
|
|
4189
|
+
}), j(" " + I(A(o).mediaLibrary.newFolder), 1)])),
|
|
4456
4190
|
r[7] ||= i("div", { class: "tpl:flex-1" }, null, -1),
|
|
4457
4191
|
n.hasFrequentlyUsed ? (z(), t("button", {
|
|
4458
4192
|
key: 2,
|
|
4459
4193
|
class: "tpl:flex tpl:w-full tpl:items-center tpl:gap-2 tpl:border-t tpl:px-3 tpl:py-2 tpl:text-left tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
4460
|
-
style:
|
|
4194
|
+
style: N({
|
|
4461
4195
|
borderColor: "var(--tpl-border)",
|
|
4462
4196
|
backgroundColor: n.viewMode === "frequently-used" ? "var(--tpl-bg-active)" : "transparent",
|
|
4463
4197
|
color: n.viewMode === "frequently-used" ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
4464
4198
|
}),
|
|
4465
4199
|
onClick: r[6] ||= (e) => a("showFrequentlyUsed")
|
|
4466
|
-
}, [p(
|
|
4200
|
+
}, [p(A(me), {
|
|
4467
4201
|
size: 14,
|
|
4468
4202
|
"stroke-width": 1.5
|
|
4469
|
-
}),
|
|
4203
|
+
}), j(" " + I(A(o).mediaLibrary.frequentlyUsed), 1)], 4)) : M("", !0)
|
|
4470
4204
|
]));
|
|
4471
4205
|
}
|
|
4472
|
-
}),
|
|
4206
|
+
}), Or = { class: "tpl:flex tpl:aspect-square tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2" }, kr = /* @__PURE__ */ m({
|
|
4473
4207
|
__name: "MediaFileIcon",
|
|
4474
4208
|
props: { mimeType: {} },
|
|
4475
4209
|
setup(e) {
|
|
@@ -4570,7 +4304,7 @@ var Ln = ["data-tpl-theme"], Rn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, zn
|
|
|
4570
4304
|
bgColor: "#f9fafb",
|
|
4571
4305
|
icon: "document"
|
|
4572
4306
|
}, s = a(() => r[n.mimeType] ?? o);
|
|
4573
|
-
return (e, n) => (z(), t("div",
|
|
4307
|
+
return (e, n) => (z(), t("div", Or, [s.value.icon === "document" ? (z(), t("svg", {
|
|
4574
4308
|
key: 0,
|
|
4575
4309
|
width: "60",
|
|
4576
4310
|
height: "60",
|
|
@@ -4578,7 +4312,7 @@ var Ln = ["data-tpl-theme"], Rn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, zn
|
|
|
4578
4312
|
fill: "none",
|
|
4579
4313
|
stroke: "currentColor",
|
|
4580
4314
|
"stroke-width": "1.5",
|
|
4581
|
-
style:
|
|
4315
|
+
style: N({ color: s.value.color })
|
|
4582
4316
|
}, [...n[0] ||= [
|
|
4583
4317
|
i("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }, null, -1),
|
|
4584
4318
|
i("polyline", { points: "14 2 14 8 20 8" }, null, -1),
|
|
@@ -4602,7 +4336,7 @@ var Ln = ["data-tpl-theme"], Rn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, zn
|
|
|
4602
4336
|
fill: "none",
|
|
4603
4337
|
stroke: "currentColor",
|
|
4604
4338
|
"stroke-width": "1.5",
|
|
4605
|
-
style:
|
|
4339
|
+
style: N({ color: s.value.color })
|
|
4606
4340
|
}, [...n[1] ||= [i("rect", {
|
|
4607
4341
|
x: "2",
|
|
4608
4342
|
y: "4",
|
|
@@ -4621,7 +4355,7 @@ var Ln = ["data-tpl-theme"], Rn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, zn
|
|
|
4621
4355
|
fill: "none",
|
|
4622
4356
|
stroke: "currentColor",
|
|
4623
4357
|
"stroke-width": "1.5",
|
|
4624
|
-
style:
|
|
4358
|
+
style: N({ color: s.value.color })
|
|
4625
4359
|
}, [...n[2] ||= [
|
|
4626
4360
|
i("path", { d: "M9 18V5l12-2v13" }, null, -1),
|
|
4627
4361
|
i("circle", {
|
|
@@ -4636,16 +4370,16 @@ var Ln = ["data-tpl-theme"], Rn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, zn
|
|
|
4636
4370
|
}, null, -1)
|
|
4637
4371
|
]], 4)), i("span", {
|
|
4638
4372
|
class: "tpl:text-xs tpl:font-bold tpl:tracking-wider",
|
|
4639
|
-
style:
|
|
4640
|
-
},
|
|
4373
|
+
style: N({ color: s.value.color })
|
|
4374
|
+
}, I(s.value.label), 5)]));
|
|
4641
4375
|
}
|
|
4642
4376
|
});
|
|
4643
4377
|
//#endregion
|
|
4644
|
-
//#region ../../node_modules/.pnpm/@vueuse+shared@14.
|
|
4645
|
-
function
|
|
4378
|
+
//#region ../../node_modules/.pnpm/@vueuse+shared@14.4.0_vue@3.5.40_typescript@6.0.3_/node_modules/@vueuse/shared/dist/index.js
|
|
4379
|
+
function Ar(e, t) {
|
|
4646
4380
|
return T() ? (E(e, t), !0) : !1;
|
|
4647
4381
|
}
|
|
4648
|
-
function
|
|
4382
|
+
function jr() {
|
|
4649
4383
|
let e = /* @__PURE__ */ new Set(), t = (t) => {
|
|
4650
4384
|
e.delete(t);
|
|
4651
4385
|
};
|
|
@@ -4653,7 +4387,7 @@ function Fr() {
|
|
|
4653
4387
|
on: (n) => {
|
|
4654
4388
|
e.add(n);
|
|
4655
4389
|
let r = () => t(n);
|
|
4656
|
-
return
|
|
4390
|
+
return Ar(r), { off: r };
|
|
4657
4391
|
},
|
|
4658
4392
|
off: t,
|
|
4659
4393
|
trigger: (...t) => Promise.all(Array.from(e).map((e) => e(...t))),
|
|
@@ -4662,14 +4396,14 @@ function Fr() {
|
|
|
4662
4396
|
}
|
|
4663
4397
|
};
|
|
4664
4398
|
}
|
|
4665
|
-
var
|
|
4399
|
+
var Mr = typeof window < "u" && typeof document < "u";
|
|
4666
4400
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
4667
|
-
var
|
|
4668
|
-
function
|
|
4401
|
+
var Nr = (e) => e != null, Pr = Object.prototype.toString, Fr = (e) => Pr.call(e) === "[object Object]", $ = () => {}, Ir = (e, t) => Object.hasOwn(e, t), Lr = /* #__PURE__ */ Rr();
|
|
4402
|
+
function Rr() {
|
|
4669
4403
|
var e, t;
|
|
4670
|
-
return
|
|
4404
|
+
return Mr && !!((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));
|
|
4671
4405
|
}
|
|
4672
|
-
function
|
|
4406
|
+
function zr(e, t) {
|
|
4673
4407
|
function n(...n) {
|
|
4674
4408
|
return new Promise((r, i) => {
|
|
4675
4409
|
Promise.resolve(e(() => t.apply(this, n), {
|
|
@@ -4679,24 +4413,40 @@ function Wr(e, t) {
|
|
|
4679
4413
|
})).then(r).catch(i);
|
|
4680
4414
|
});
|
|
4681
4415
|
}
|
|
4682
|
-
return n
|
|
4416
|
+
return "cancel" in e && Object.assign(n, {
|
|
4417
|
+
cancel: e.cancel,
|
|
4418
|
+
flush: e.flush,
|
|
4419
|
+
isPending: e.isPending
|
|
4420
|
+
}), n;
|
|
4683
4421
|
}
|
|
4684
|
-
function
|
|
4685
|
-
let n, r, i =
|
|
4686
|
-
clearTimeout(e), i(), i =
|
|
4687
|
-
},
|
|
4688
|
-
return (
|
|
4689
|
-
let
|
|
4690
|
-
return n &&
|
|
4691
|
-
i = t.rejectOnCancel ?
|
|
4692
|
-
n &&
|
|
4693
|
-
},
|
|
4694
|
-
r &&
|
|
4695
|
-
},
|
|
4696
|
-
});
|
|
4697
|
-
}
|
|
4422
|
+
function Br(e, t = {}) {
|
|
4423
|
+
let n, r, i = $, a = $, o = L(!1), s = (e) => {
|
|
4424
|
+
clearTimeout(e), i(), i = $;
|
|
4425
|
+
}, c;
|
|
4426
|
+
return Object.assign((l) => {
|
|
4427
|
+
let u = F(e), d = F(t.maxWait);
|
|
4428
|
+
return n && s(n), u <= 0 || d !== void 0 && d <= 0 ? (r &&= (s(r), void 0), o.value = !1, Promise.resolve(l())) : (o.value = !0, new Promise((e, f) => {
|
|
4429
|
+
i = t.rejectOnCancel ? f : e, a = e, c = l, d && !r && (r = setTimeout(() => {
|
|
4430
|
+
n && s(n), r = void 0, o.value = !1, e(c());
|
|
4431
|
+
}, d)), n = setTimeout(() => {
|
|
4432
|
+
r && s(r), r = void 0, o.value = !1, e(l());
|
|
4433
|
+
}, u);
|
|
4434
|
+
}));
|
|
4435
|
+
}, {
|
|
4436
|
+
cancel: () => {
|
|
4437
|
+
n &&= (s(n), void 0), r &&= (s(r), void 0), o.value = !1, a = $;
|
|
4438
|
+
},
|
|
4439
|
+
flush: () => {
|
|
4440
|
+
if (o.value) {
|
|
4441
|
+
n &&= (clearTimeout(n), void 0), r &&= (clearTimeout(r), void 0), o.value = !1;
|
|
4442
|
+
let e = a;
|
|
4443
|
+
i = $, a = $, e(c());
|
|
4444
|
+
}
|
|
4445
|
+
},
|
|
4446
|
+
isPending: re(o)
|
|
4447
|
+
});
|
|
4698
4448
|
}
|
|
4699
|
-
function
|
|
4449
|
+
function Vr(e) {
|
|
4700
4450
|
let t;
|
|
4701
4451
|
function n() {
|
|
4702
4452
|
return t ||= e(), t;
|
|
@@ -4706,14 +4456,14 @@ function Kr(e) {
|
|
|
4706
4456
|
t = void 0, e && await e;
|
|
4707
4457
|
}, n;
|
|
4708
4458
|
}
|
|
4709
|
-
function
|
|
4459
|
+
function Hr(e) {
|
|
4710
4460
|
return Array.isArray(e) ? e : [e];
|
|
4711
4461
|
}
|
|
4712
|
-
function
|
|
4713
|
-
return
|
|
4462
|
+
function Ur(e, t = 200, n = {}) {
|
|
4463
|
+
return zr(Br(t, n), e);
|
|
4714
4464
|
}
|
|
4715
|
-
function
|
|
4716
|
-
let { immediate: r = !0, immediateCallback: i = !1 } = n, a =
|
|
4465
|
+
function Wr(e, t, n = {}) {
|
|
4466
|
+
let { immediate: r = !0, immediateCallback: i = !1 } = n, a = L(!1), o;
|
|
4717
4467
|
function s() {
|
|
4718
4468
|
o &&= (clearTimeout(o), void 0);
|
|
4719
4469
|
}
|
|
@@ -4723,75 +4473,75 @@ function Yr(e, t, n = {}) {
|
|
|
4723
4473
|
function l(...n) {
|
|
4724
4474
|
i && e(), s(), a.value = !0, o = setTimeout(() => {
|
|
4725
4475
|
a.value = !1, o = void 0, e(...n);
|
|
4726
|
-
},
|
|
4476
|
+
}, F(t));
|
|
4727
4477
|
}
|
|
4728
|
-
return r && (a.value = !0,
|
|
4478
|
+
return r && (a.value = !0, Mr && l()), Ar(c), {
|
|
4729
4479
|
isPending: re(a),
|
|
4730
4480
|
start: l,
|
|
4731
4481
|
stop: c
|
|
4732
4482
|
};
|
|
4733
4483
|
}
|
|
4734
|
-
function
|
|
4484
|
+
function Gr(e, t, n) {
|
|
4735
4485
|
return s(e, t, {
|
|
4736
4486
|
...n,
|
|
4737
4487
|
immediate: !0
|
|
4738
4488
|
});
|
|
4739
4489
|
}
|
|
4740
4490
|
//#endregion
|
|
4741
|
-
//#region ../../node_modules/.pnpm/@vueuse+core@14.
|
|
4742
|
-
var
|
|
4743
|
-
function
|
|
4744
|
-
let t =
|
|
4491
|
+
//#region ../../node_modules/.pnpm/@vueuse+core@14.4.0_vue@3.5.40_typescript@6.0.3_/node_modules/@vueuse/core/dist/index.js
|
|
4492
|
+
var Kr = Mr ? window : void 0, qr = Mr ? window.document : void 0, Jr = Mr ? window.navigator : void 0;
|
|
4493
|
+
function Yr(e) {
|
|
4494
|
+
let t = F(e);
|
|
4745
4495
|
return t?.$el ?? t;
|
|
4746
4496
|
}
|
|
4747
|
-
function
|
|
4497
|
+
function Xr(...e) {
|
|
4748
4498
|
let t = (e, t, n, r) => (e.addEventListener(t, n, r), () => e.removeEventListener(t, n, r)), n = a(() => {
|
|
4749
|
-
let t =
|
|
4499
|
+
let t = Hr(F(e[0])).filter((e) => e != null);
|
|
4750
4500
|
return t.every((e) => typeof e != "string") ? t : void 0;
|
|
4751
4501
|
});
|
|
4752
|
-
return
|
|
4753
|
-
n.value?.map((e) =>
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4502
|
+
return Gr(() => [
|
|
4503
|
+
n.value?.map((e) => Yr(e)) ?? [Kr].filter((e) => e != null),
|
|
4504
|
+
Hr(F(n.value ? e[1] : e[0])),
|
|
4505
|
+
Hr(A(n.value ? e[2] : e[1])),
|
|
4506
|
+
F(n.value ? e[3] : e[2])
|
|
4757
4507
|
], ([e, n, r, i], a, o) => {
|
|
4758
4508
|
if (!e?.length || !n?.length || !r?.length) return;
|
|
4759
|
-
let s =
|
|
4509
|
+
let s = Fr(i) ? { ...i } : i, c = e.flatMap((e) => n.flatMap((n) => r.map((r) => t(e, n, r, s))));
|
|
4760
4510
|
o(() => {
|
|
4761
4511
|
c.forEach((e) => e());
|
|
4762
4512
|
});
|
|
4763
4513
|
}, { flush: "post" });
|
|
4764
4514
|
}
|
|
4765
|
-
var
|
|
4766
|
-
function
|
|
4767
|
-
let { window: r =
|
|
4515
|
+
var Zr = !1;
|
|
4516
|
+
function Qr(e, t, n = {}) {
|
|
4517
|
+
let { window: r = Kr, ignore: i = [], capture: a = !0, detectIframe: o = !1, controls: s = !1 } = n;
|
|
4768
4518
|
if (!r) return s ? {
|
|
4769
|
-
stop:
|
|
4770
|
-
cancel:
|
|
4771
|
-
trigger:
|
|
4772
|
-
} :
|
|
4773
|
-
if (
|
|
4774
|
-
|
|
4519
|
+
stop: $,
|
|
4520
|
+
cancel: $,
|
|
4521
|
+
trigger: $
|
|
4522
|
+
} : $;
|
|
4523
|
+
if (Lr && !Zr) {
|
|
4524
|
+
Zr = !0;
|
|
4775
4525
|
let e = { passive: !0 };
|
|
4776
|
-
Array.from(r.document.body.children).forEach((t) => t.addEventListener("click",
|
|
4526
|
+
Array.from(r.document.body.children).forEach((t) => t.addEventListener("click", $, e)), r.document.documentElement.addEventListener("click", $, e);
|
|
4777
4527
|
}
|
|
4778
|
-
let c = !0, l = (e) =>
|
|
4528
|
+
let c = !0, l = (e) => F(i).some((t) => {
|
|
4779
4529
|
if (typeof t == "string") return Array.from(r.document.querySelectorAll(t)).some((t) => t === e.target || e.composedPath().includes(t));
|
|
4780
4530
|
{
|
|
4781
|
-
let n =
|
|
4531
|
+
let n = Yr(t);
|
|
4782
4532
|
return n && (e.target === n || e.composedPath().includes(n));
|
|
4783
4533
|
}
|
|
4784
4534
|
});
|
|
4785
4535
|
function u(e) {
|
|
4786
|
-
let t =
|
|
4536
|
+
let t = F(e);
|
|
4787
4537
|
return t && t.$.subTree.shapeFlag === 16;
|
|
4788
4538
|
}
|
|
4789
4539
|
function d(e, t) {
|
|
4790
|
-
let n =
|
|
4540
|
+
let n = F(e), r = n.$.subTree && n.$.subTree.children;
|
|
4791
4541
|
return r == null || !Array.isArray(r) ? !1 : r.some((e) => e.el === t.target || t.composedPath().includes(e.el));
|
|
4792
4542
|
}
|
|
4793
4543
|
let f = (n) => {
|
|
4794
|
-
let r =
|
|
4544
|
+
let r = Yr(e);
|
|
4795
4545
|
if (n.target != null && !(!(r instanceof Element) && u(e) && d(e, n)) && !(!r || r === n.target || n.composedPath().includes(r))) {
|
|
4796
4546
|
if ("detail" in n && n.detail === 0 && (c = !l(n)), !c) {
|
|
4797
4547
|
c = !0;
|
|
@@ -4800,7 +4550,7 @@ function ri(e, t, n = {}) {
|
|
|
4800
4550
|
t(n);
|
|
4801
4551
|
}
|
|
4802
4552
|
}, p = !1, m = [
|
|
4803
|
-
|
|
4553
|
+
Xr(r, "click", (e) => {
|
|
4804
4554
|
p || (p = !0, setTimeout(() => {
|
|
4805
4555
|
p = !1;
|
|
4806
4556
|
}, 0), f(e));
|
|
@@ -4808,13 +4558,13 @@ function ri(e, t, n = {}) {
|
|
|
4808
4558
|
passive: !0,
|
|
4809
4559
|
capture: a
|
|
4810
4560
|
}),
|
|
4811
|
-
|
|
4812
|
-
let n =
|
|
4561
|
+
Xr(r, "pointerdown", (t) => {
|
|
4562
|
+
let n = Yr(e);
|
|
4813
4563
|
c = !l(t) && !!(n && !t.composedPath().includes(n));
|
|
4814
4564
|
}, { passive: !0 }),
|
|
4815
|
-
o &&
|
|
4565
|
+
o && Xr(r, "blur", (n) => {
|
|
4816
4566
|
setTimeout(() => {
|
|
4817
|
-
let i =
|
|
4567
|
+
let i = Yr(e), a = r.document.activeElement;
|
|
4818
4568
|
for (; a?.shadowRoot;) a = a.shadowRoot.activeElement;
|
|
4819
4569
|
a?.tagName === "IFRAME" && !i?.contains(r.document.activeElement) && t(n);
|
|
4820
4570
|
}, 0);
|
|
@@ -4830,22 +4580,22 @@ function ri(e, t, n = {}) {
|
|
|
4830
4580
|
}
|
|
4831
4581
|
} : h;
|
|
4832
4582
|
}
|
|
4833
|
-
function
|
|
4834
|
-
let e =
|
|
4583
|
+
function $r() {
|
|
4584
|
+
let e = L(!1), t = g();
|
|
4835
4585
|
return t && v(() => {
|
|
4836
4586
|
e.value = !0;
|
|
4837
4587
|
}, t), e;
|
|
4838
4588
|
}
|
|
4839
4589
|
/* @__NO_SIDE_EFFECTS__ */
|
|
4840
|
-
function
|
|
4841
|
-
return
|
|
4590
|
+
function ei(e) {
|
|
4591
|
+
return $r(), a(() => !!e());
|
|
4842
4592
|
}
|
|
4843
|
-
function
|
|
4844
|
-
let { controls: n = !1, navigator: r =
|
|
4593
|
+
function ti(e, t = {}) {
|
|
4594
|
+
let { controls: n = !1, navigator: r = Jr } = t, i = /* @__PURE__ */ ei(() => r && "permissions" in r), a = L(), o = typeof e == "string" ? { name: e } : e, s = L(), c = () => {
|
|
4845
4595
|
s.value = a.value?.state ?? "prompt";
|
|
4846
4596
|
};
|
|
4847
|
-
|
|
4848
|
-
let l =
|
|
4597
|
+
Xr(a, "change", c, { passive: !0 });
|
|
4598
|
+
let l = Vr(async () => {
|
|
4849
4599
|
if (i.value) {
|
|
4850
4600
|
if (!a.value) try {
|
|
4851
4601
|
a.value = await r.permissions.query(o);
|
|
@@ -4854,7 +4604,7 @@ function oi(e, t = {}) {
|
|
|
4854
4604
|
} finally {
|
|
4855
4605
|
c();
|
|
4856
4606
|
}
|
|
4857
|
-
if (n) return
|
|
4607
|
+
if (n) return de(a.value);
|
|
4858
4608
|
}
|
|
4859
4609
|
});
|
|
4860
4610
|
return l(), n ? {
|
|
@@ -4863,8 +4613,8 @@ function oi(e, t = {}) {
|
|
|
4863
4613
|
query: l
|
|
4864
4614
|
} : s;
|
|
4865
4615
|
}
|
|
4866
|
-
function
|
|
4867
|
-
let { navigator: t =
|
|
4616
|
+
function ni(e = {}) {
|
|
4617
|
+
let { navigator: t = Jr, read: n = !1, source: r, copiedDuring: i = 1500, legacy: o = !1 } = e, s = /* @__PURE__ */ ei(() => t && "clipboard" in t), c = ti("clipboard-read"), l = ti("clipboard-write"), u = a(() => s.value || o), d = L(""), f = L(!1), p = L(!1), m = Wr(() => f.value = !1, i, { immediate: !1 }), h = 0;
|
|
4868
4618
|
async function g() {
|
|
4869
4619
|
let e = !(s.value && x(c.value));
|
|
4870
4620
|
if (!e) try {
|
|
@@ -4874,9 +4624,9 @@ function si(e = {}) {
|
|
|
4874
4624
|
}
|
|
4875
4625
|
e && (d.value = b());
|
|
4876
4626
|
}
|
|
4877
|
-
u.value && n &&
|
|
4627
|
+
u.value && n && Xr(["copy", "cut"], g, { passive: !0 });
|
|
4878
4628
|
async function _(e) {
|
|
4879
|
-
let n = e ??
|
|
4629
|
+
let n = e ?? F(r);
|
|
4880
4630
|
if (u.value && n != null) {
|
|
4881
4631
|
p.value = !0;
|
|
4882
4632
|
let e = !(s.value && x(l.value));
|
|
@@ -4916,16 +4666,20 @@ function si(e = {}) {
|
|
|
4916
4666
|
copy: _
|
|
4917
4667
|
};
|
|
4918
4668
|
}
|
|
4919
|
-
function
|
|
4920
|
-
let n =
|
|
4921
|
-
if (
|
|
4669
|
+
function ri(e, t = {}) {
|
|
4670
|
+
let n = L(!1), r = L(null), i = 0, a = !0;
|
|
4671
|
+
if (Mr) {
|
|
4922
4672
|
let o = typeof t == "function" ? { onDrop: t } : t, s = o.multiple ?? !0, c = o.preventDefaultForUnhandled ?? !1, l = (e) => {
|
|
4923
4673
|
let t = Array.from(e.dataTransfer?.files ?? []);
|
|
4924
4674
|
return t.length === 0 ? null : s ? t : [t[0]];
|
|
4925
4675
|
}, u = (e) => {
|
|
4926
|
-
let t =
|
|
4676
|
+
let t = A(o.dataTypes);
|
|
4927
4677
|
return typeof t == "function" ? t(e) : !t?.length || e.length !== 0 && e.every((e) => t.some((t) => e.includes(t)));
|
|
4928
|
-
}, d = (e) =>
|
|
4678
|
+
}, d = (e) => {
|
|
4679
|
+
if (o.checkValidity) return o.checkValidity(e);
|
|
4680
|
+
let t = Array.from(e ?? []).map((e) => e.type);
|
|
4681
|
+
return u(t) && (s || e.length <= 1);
|
|
4682
|
+
}, f = () => /^(?:(?!chrome|android).)*safari/i.test(navigator.userAgent) && !("chrome" in window), p = (e, t) => {
|
|
4929
4683
|
let s = e.dataTransfer?.items;
|
|
4930
4684
|
if (a = (s && d(s)) ?? !1, c && e.preventDefault(), !f() && !a) {
|
|
4931
4685
|
e.dataTransfer && (e.dataTransfer.dropEffect = "none");
|
|
@@ -4946,44 +4700,42 @@ function ci(e, t = {}) {
|
|
|
4946
4700
|
var h;
|
|
4947
4701
|
--i, i === 0 && (n.value = !1), (h = o.onLeave) == null || h.call(o, null, e);
|
|
4948
4702
|
break;
|
|
4949
|
-
case "drop":
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
}
|
|
4954
|
-
break;
|
|
4703
|
+
case "drop": if (i = 0, n.value = !1, a) {
|
|
4704
|
+
var g;
|
|
4705
|
+
r.value = u, (g = o.onDrop) == null || g.call(o, u, e);
|
|
4706
|
+
}
|
|
4955
4707
|
}
|
|
4956
4708
|
};
|
|
4957
|
-
|
|
4709
|
+
Xr(e, "dragenter", (e) => p(e, "enter")), Xr(e, "dragover", (e) => p(e, "over")), Xr(e, "dragleave", (e) => p(e, "leave")), Xr(e, "drop", (e) => p(e, "drop"));
|
|
4958
4710
|
}
|
|
4959
4711
|
return {
|
|
4960
4712
|
files: r,
|
|
4961
4713
|
isOverDropZone: n
|
|
4962
4714
|
};
|
|
4963
4715
|
}
|
|
4964
|
-
function
|
|
4965
|
-
let { root: r, rootMargin: i, threshold: o = 0, window: c =
|
|
4716
|
+
function ii(e, t, n = {}) {
|
|
4717
|
+
let { root: r, rootMargin: i, threshold: o = 0, window: c = Kr, immediate: l = !0 } = n, u = /* @__PURE__ */ ei(() => c && "IntersectionObserver" in c), d = a(() => Hr(F(e)).map(Yr).filter(Nr)), f = $, p = L(l), m = u.value ? s(() => [
|
|
4966
4718
|
d.value,
|
|
4967
|
-
|
|
4968
|
-
|
|
4719
|
+
Yr(r),
|
|
4720
|
+
F(i),
|
|
4969
4721
|
p.value
|
|
4970
4722
|
], ([e, n, r]) => {
|
|
4971
4723
|
if (f(), !p.value || !e.length) return;
|
|
4972
4724
|
let i = new IntersectionObserver(t, {
|
|
4973
|
-
root:
|
|
4725
|
+
root: Yr(n),
|
|
4974
4726
|
rootMargin: r,
|
|
4975
4727
|
threshold: o
|
|
4976
4728
|
});
|
|
4977
4729
|
e.forEach((e) => e && i.observe(e)), f = () => {
|
|
4978
|
-
i.disconnect(), f =
|
|
4730
|
+
i.disconnect(), f = $;
|
|
4979
4731
|
};
|
|
4980
4732
|
}, {
|
|
4981
4733
|
immediate: l,
|
|
4982
4734
|
flush: "post"
|
|
4983
|
-
}) :
|
|
4735
|
+
}) : $, h = () => {
|
|
4984
4736
|
f(), m(), p.value = !1;
|
|
4985
4737
|
};
|
|
4986
|
-
return
|
|
4738
|
+
return Ar(h), {
|
|
4987
4739
|
isSupported: u,
|
|
4988
4740
|
isActive: p,
|
|
4989
4741
|
pause() {
|
|
@@ -4995,22 +4747,22 @@ function li(e, t, n = {}) {
|
|
|
4995
4747
|
stop: h
|
|
4996
4748
|
};
|
|
4997
4749
|
}
|
|
4998
|
-
var
|
|
4750
|
+
var ai = {
|
|
4999
4751
|
multiple: !0,
|
|
5000
4752
|
accept: "*",
|
|
5001
4753
|
reset: !1,
|
|
5002
4754
|
directory: !1
|
|
5003
4755
|
};
|
|
5004
|
-
function
|
|
4756
|
+
function oi(e) {
|
|
5005
4757
|
if (!e) return null;
|
|
5006
4758
|
if (e instanceof FileList) return e;
|
|
5007
4759
|
let t = new DataTransfer();
|
|
5008
4760
|
for (let n of e) t.items.add(n);
|
|
5009
4761
|
return t.files;
|
|
5010
4762
|
}
|
|
5011
|
-
function
|
|
5012
|
-
let { document: n =
|
|
5013
|
-
let e =
|
|
4763
|
+
function si(t = {}) {
|
|
4764
|
+
let { document: n = qr } = t, r = e(oi(t.initialFiles)), { on: i, trigger: o } = jr(), { on: s, trigger: c } = jr(), l = a(() => {
|
|
4765
|
+
let e = Yr(t.input) ?? (n ? n.createElement("input") : void 0);
|
|
5014
4766
|
return e && (e.type = "file", e.onchange = (e) => {
|
|
5015
4767
|
r.value = e.target.files, o(r.value);
|
|
5016
4768
|
}, e.oncancel = () => {
|
|
@@ -5020,7 +4772,7 @@ function fi(t = {}) {
|
|
|
5020
4772
|
r.value = null, l.value && l.value.value && (l.value.value = "", o(null));
|
|
5021
4773
|
}, f = (e) => {
|
|
5022
4774
|
let t = l.value;
|
|
5023
|
-
t && (t.multiple =
|
|
4775
|
+
t && (t.multiple = F(e.multiple), t.accept = F(e.accept), t.webkitdirectory = F(e.directory), Ir(e, "capture") && (t.capture = F(e.capture)));
|
|
5024
4776
|
};
|
|
5025
4777
|
return d(() => {
|
|
5026
4778
|
f(t);
|
|
@@ -5030,11 +4782,11 @@ function fi(t = {}) {
|
|
|
5030
4782
|
let n = l.value;
|
|
5031
4783
|
if (!n) return;
|
|
5032
4784
|
let r = {
|
|
5033
|
-
...
|
|
4785
|
+
...ai,
|
|
5034
4786
|
...t,
|
|
5035
4787
|
...e
|
|
5036
4788
|
};
|
|
5037
|
-
f(r),
|
|
4789
|
+
f(r), F(r.reset) && u(), n.click();
|
|
5038
4790
|
},
|
|
5039
4791
|
reset: u,
|
|
5040
4792
|
onCancel: s,
|
|
@@ -5043,48 +4795,48 @@ function fi(t = {}) {
|
|
|
5043
4795
|
}
|
|
5044
4796
|
//#endregion
|
|
5045
4797
|
//#region src/components/media/MediaGrid.vue?vue&type=script&setup=true&lang.ts
|
|
5046
|
-
var
|
|
4798
|
+
var ci = { class: "tpl:p-4" }, li = {
|
|
5047
4799
|
key: 1,
|
|
5048
4800
|
class: "tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:py-16"
|
|
5049
|
-
},
|
|
4801
|
+
}, ui = {
|
|
5050
4802
|
class: "tpl:text-xs",
|
|
5051
4803
|
style: { color: "var(--tpl-text-muted)" }
|
|
5052
|
-
},
|
|
4804
|
+
}, di = {
|
|
5053
4805
|
key: 2,
|
|
5054
4806
|
class: "tpl:grid tpl:grid-cols-4 tpl:gap-3"
|
|
5055
|
-
},
|
|
4807
|
+
}, fi = ["onClick"], pi = { class: "tpl:aspect-square" }, mi = ["src", "alt"], hi = { class: "tpl:px-2 tpl:py-1.5" }, gi = {
|
|
5056
4808
|
class: "tpl:truncate tpl:text-[10px] tpl:font-medium",
|
|
5057
4809
|
style: { color: "var(--tpl-text)" }
|
|
5058
|
-
},
|
|
4810
|
+
}, _i = {
|
|
5059
4811
|
class: "tpl:flex tpl:justify-between tpl:text-[9px]",
|
|
5060
4812
|
style: { color: "var(--tpl-text-muted)" }
|
|
5061
|
-
},
|
|
4813
|
+
}, vi = { key: 0 }, yi = { 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" }, bi = ["title", "onClick"], xi = ["title", "onClick"], Si = {
|
|
5062
4814
|
key: 0,
|
|
5063
4815
|
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",
|
|
5064
4816
|
style: { "background-color": "var(--tpl-primary)" }
|
|
5065
|
-
},
|
|
4817
|
+
}, Ci = {
|
|
5066
4818
|
key: 3,
|
|
5067
4819
|
class: "tpl:flex tpl:flex-col tpl:gap-1"
|
|
5068
|
-
},
|
|
4820
|
+
}, wi = ["onClick"], Ti = {
|
|
5069
4821
|
class: "tpl:size-10 tpl:shrink-0 tpl:overflow-hidden tpl:rounded",
|
|
5070
4822
|
style: { "background-color": "var(--tpl-bg-hover)" }
|
|
5071
|
-
},
|
|
4823
|
+
}, Ei = ["src", "alt"], Di = {
|
|
5072
4824
|
key: 1,
|
|
5073
4825
|
class: "tpl-list-icon tpl:size-full"
|
|
5074
|
-
},
|
|
4826
|
+
}, Oi = { class: "tpl:min-w-0 tpl:flex-1" }, ki = {
|
|
5075
4827
|
class: "tpl:truncate tpl:text-xs tpl:font-medium",
|
|
5076
4828
|
style: { color: "var(--tpl-text)" }
|
|
5077
|
-
},
|
|
4829
|
+
}, Ai = {
|
|
5078
4830
|
class: "tpl:text-[10px]",
|
|
5079
4831
|
style: { color: "var(--tpl-text-muted)" }
|
|
5080
|
-
},
|
|
4832
|
+
}, ji = { class: "tpl:flex tpl:gap-1 tpl:opacity-0 tpl:transition-opacity tpl:duration-150 tpl:group-hover:opacity-100" }, Mi = ["title", "onClick"], Ni = ["title", "onClick"], Pi = {
|
|
5081
4833
|
key: 0,
|
|
5082
4834
|
class: "tpl:flex tpl:size-5 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
|
|
5083
4835
|
style: { "background-color": "var(--tpl-primary)" }
|
|
5084
|
-
},
|
|
4836
|
+
}, Fi = {
|
|
5085
4837
|
key: 4,
|
|
5086
4838
|
class: "tpl:flex tpl:justify-center tpl:py-4"
|
|
5087
|
-
},
|
|
4839
|
+
}, Ii = /*#__PURE__*/ mr(/* @__PURE__ */ m({
|
|
5088
4840
|
__name: "MediaGrid",
|
|
5089
4841
|
props: {
|
|
5090
4842
|
items: {},
|
|
@@ -5110,11 +4862,11 @@ var pi = { class: "tpl:p-4" }, mi = {
|
|
|
5110
4862
|
s("select", e);
|
|
5111
4863
|
}
|
|
5112
4864
|
let { t: f } = Ae(), m = e(null);
|
|
5113
|
-
|
|
4865
|
+
ii(m, ([{ isIntersecting: e }]) => {
|
|
5114
4866
|
e && o.hasMore && !o.isLoading && s("loadMore");
|
|
5115
4867
|
}, { threshold: .1 });
|
|
5116
4868
|
function g(e) {
|
|
5117
|
-
return e < 1024 ? `${e} B` : e <
|
|
4869
|
+
return e < 1024 ? `${e} B` : e < 1048576 ? `${(e / 1024).toFixed(1)} KB` : `${(e / 1048576).toFixed(1)} MB`;
|
|
5118
4870
|
}
|
|
5119
4871
|
function _(e) {
|
|
5120
4872
|
return new Date(e).toLocaleDateString(void 0, {
|
|
@@ -5123,7 +4875,7 @@ var pi = { class: "tpl:p-4" }, mi = {
|
|
|
5123
4875
|
day: "numeric"
|
|
5124
4876
|
});
|
|
5125
4877
|
}
|
|
5126
|
-
return (e, a) => (z(), t("div",
|
|
4878
|
+
return (e, a) => (z(), t("div", ci, [
|
|
5127
4879
|
n.isLoading && n.items.length === 0 ? (z(), t("div", {
|
|
5128
4880
|
key: 0,
|
|
5129
4881
|
class: k(n.layout === "list" ? "tpl:flex tpl:flex-col tpl:gap-1" : "tpl:grid tpl:grid-cols-4 tpl:gap-3")
|
|
@@ -5131,119 +4883,119 @@ var pi = { class: "tpl:p-4" }, mi = {
|
|
|
5131
4883
|
key: e,
|
|
5132
4884
|
class: k(["tpl-pulse tpl:rounded-lg", n.layout === "list" ? "tpl:h-12" : "tpl:aspect-square"]),
|
|
5133
4885
|
style: { "background-color": "var(--tpl-bg-hover)" }
|
|
5134
|
-
}, null, 2)), 64))], 2)) : n.items.length === 0 ? (z(), t("div",
|
|
4886
|
+
}, null, 2)), 64))], 2)) : n.items.length === 0 ? (z(), t("div", li, [p(A(le), {
|
|
5135
4887
|
class: "tpl:mb-3",
|
|
5136
4888
|
size: 40,
|
|
5137
4889
|
"stroke-width": 1,
|
|
5138
4890
|
style: { color: "var(--tpl-text-dim)" }
|
|
5139
|
-
}), i("p",
|
|
4891
|
+
}), i("p", ui, I(A(f).mediaLibrary.noFiles), 1)])) : n.layout === "list" ? (z(), t("div", Ci, [(z(!0), t(R, null, S(n.items, (e) => (z(), t("div", {
|
|
5140
4892
|
key: e.id,
|
|
5141
4893
|
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" : ""]]),
|
|
5142
|
-
style:
|
|
4894
|
+
style: N({ backgroundColor: n.selectedIds.has(e.id) ? "var(--tpl-bg-hover)" : "transparent" }),
|
|
5143
4895
|
onClick: (t) => d(e)
|
|
5144
4896
|
}, [
|
|
5145
|
-
i("div",
|
|
4897
|
+
i("div", Ti, [A(l)(e.mime_type) ? (z(), t("img", {
|
|
5146
4898
|
key: 0,
|
|
5147
4899
|
src: e.small_url || e.url,
|
|
5148
4900
|
alt: e.filename,
|
|
5149
4901
|
class: "tpl:size-full tpl:object-cover",
|
|
5150
4902
|
loading: "lazy"
|
|
5151
|
-
}, null, 8,
|
|
5152
|
-
i("div",
|
|
5153
|
-
i("div",
|
|
4903
|
+
}, null, 8, Ei)) : (z(), t("div", Di, [p(kr, { "mime-type": e.mime_type }, null, 8, ["mime-type"])]))]),
|
|
4904
|
+
i("div", Oi, [i("p", ki, I(e.filename), 1), i("p", Ai, [j(I(g(e.size)) + " · " + I(_(e.created_at)) + " ", 1), A(l)(e.mime_type) && e.width && e.height ? (z(), t(R, { key: 0 }, [j(" · " + I(e.width) + "×" + I(e.height), 1)], 64)) : M("", !0)])]),
|
|
4905
|
+
i("div", ji, [i("button", {
|
|
5154
4906
|
class: "tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded",
|
|
5155
4907
|
style: { color: "var(--tpl-text-muted)" },
|
|
5156
|
-
title:
|
|
4908
|
+
title: A(f).mediaLibrary.editFile,
|
|
5157
4909
|
onClick: r((t) => s("edit", e), ["stop"])
|
|
5158
|
-
}, [p(
|
|
4910
|
+
}, [p(A(he), {
|
|
5159
4911
|
size: 12,
|
|
5160
4912
|
"stroke-width": 2
|
|
5161
|
-
})], 8,
|
|
4913
|
+
})], 8, Mi), i("button", {
|
|
5162
4914
|
class: "tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded",
|
|
5163
4915
|
style: { color: "var(--tpl-text-muted)" },
|
|
5164
|
-
title:
|
|
4916
|
+
title: A(f).mediaLibrary.replaceFile,
|
|
5165
4917
|
onClick: r((t) => s("replace", e), ["stop"])
|
|
5166
|
-
}, [p(
|
|
4918
|
+
}, [p(A(O), {
|
|
5167
4919
|
size: 12,
|
|
5168
4920
|
"stroke-width": 2
|
|
5169
|
-
})], 8,
|
|
5170
|
-
n.selectedIds.has(e.id) ? (z(), t("div",
|
|
4921
|
+
})], 8, Ni)]),
|
|
4922
|
+
n.selectedIds.has(e.id) ? (z(), t("div", Pi, [p(A(D), {
|
|
5171
4923
|
size: 12,
|
|
5172
4924
|
"stroke-width": 3
|
|
5173
|
-
})])) :
|
|
5174
|
-
], 14,
|
|
4925
|
+
})])) : M("", !0)
|
|
4926
|
+
], 14, wi))), 128))])) : (z(), t("div", di, [(z(!0), t(R, null, S(n.items, (e) => (z(), t("div", {
|
|
5175
4927
|
key: e.id,
|
|
5176
4928
|
class: k(["tpl-media-item tpl:group tpl:relative tpl:overflow-hidden tpl:rounded-lg tpl:border-2 tpl:transition-all tpl:duration-150", [
|
|
5177
4929
|
"tpl:cursor-pointer",
|
|
5178
4930
|
!u(e) && !n.selectedIds.has(e.id) ? "tpl:opacity-60" : "",
|
|
5179
4931
|
n.selectedIds.has(e.id) ? "tpl-media-item--selected" : ""
|
|
5180
4932
|
]]),
|
|
5181
|
-
style:
|
|
4933
|
+
style: N({
|
|
5182
4934
|
borderColor: n.selectedIds.has(e.id) ? "var(--tpl-primary)" : "transparent",
|
|
5183
4935
|
backgroundColor: !u(e) && !n.selectedIds.has(e.id) ? "var(--tpl-bg)" : "var(--tpl-bg-hover)"
|
|
5184
4936
|
}),
|
|
5185
4937
|
onClick: (t) => d(e)
|
|
5186
4938
|
}, [
|
|
5187
|
-
i("div",
|
|
4939
|
+
i("div", pi, [A(l)(e.mime_type) ? (z(), t("img", {
|
|
5188
4940
|
key: 0,
|
|
5189
4941
|
src: e.small_url || e.url,
|
|
5190
4942
|
alt: e.filename,
|
|
5191
4943
|
class: "tpl:size-full tpl:object-cover",
|
|
5192
4944
|
loading: "lazy"
|
|
5193
|
-
}, null, 8,
|
|
4945
|
+
}, null, 8, mi)) : (z(), h(kr, {
|
|
5194
4946
|
key: 1,
|
|
5195
4947
|
"mime-type": e.mime_type
|
|
5196
4948
|
}, null, 8, ["mime-type"]))]),
|
|
5197
|
-
i("div",
|
|
5198
|
-
i("div",
|
|
4949
|
+
i("div", hi, [i("p", gi, I(e.filename), 1), i("p", _i, [i("span", null, I(g(e.size)), 1), A(l)(e.mime_type) && e.width && e.height ? (z(), t("span", vi, I(e.width) + "×" + I(e.height), 1)) : M("", !0)])]),
|
|
4950
|
+
i("div", yi, [i("button", {
|
|
5199
4951
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
|
|
5200
4952
|
style: { "background-color": "rgba(0, 0, 0, 0.6)" },
|
|
5201
|
-
title:
|
|
4953
|
+
title: A(f).mediaLibrary.editFile,
|
|
5202
4954
|
onClick: r((t) => s("edit", e), ["stop"])
|
|
5203
|
-
}, [p(
|
|
4955
|
+
}, [p(A(he), {
|
|
5204
4956
|
size: 11,
|
|
5205
4957
|
"stroke-width": 2
|
|
5206
|
-
})], 8,
|
|
4958
|
+
})], 8, bi), i("button", {
|
|
5207
4959
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
|
|
5208
4960
|
style: { "background-color": "rgba(0, 0, 0, 0.6)" },
|
|
5209
|
-
title:
|
|
4961
|
+
title: A(f).mediaLibrary.replaceFile,
|
|
5210
4962
|
onClick: r((t) => s("replace", e), ["stop"])
|
|
5211
|
-
}, [p(
|
|
4963
|
+
}, [p(A(O), {
|
|
5212
4964
|
size: 11,
|
|
5213
4965
|
"stroke-width": 2
|
|
5214
|
-
})], 8,
|
|
5215
|
-
n.selectedIds.has(e.id) ? (z(), t("div",
|
|
4966
|
+
})], 8, xi)]),
|
|
4967
|
+
n.selectedIds.has(e.id) ? (z(), t("div", Si, [p(A(D), {
|
|
5216
4968
|
size: 12,
|
|
5217
4969
|
"stroke-width": 3
|
|
5218
|
-
})])) :
|
|
5219
|
-
], 14,
|
|
4970
|
+
})])) : M("", !0)
|
|
4971
|
+
], 14, fi))), 128))])),
|
|
5220
4972
|
i("div", {
|
|
5221
4973
|
ref_key: "sentinelRef",
|
|
5222
4974
|
ref: m,
|
|
5223
4975
|
class: "tpl:h-4"
|
|
5224
4976
|
}, null, 512),
|
|
5225
|
-
n.isLoading && n.items.length > 0 ? (z(), t("div",
|
|
4977
|
+
n.isLoading && n.items.length > 0 ? (z(), t("div", Fi, [p(A(ce), {
|
|
5226
4978
|
class: "tpl-spinner",
|
|
5227
4979
|
size: 20,
|
|
5228
4980
|
"stroke-width": 2,
|
|
5229
4981
|
style: { color: "var(--tpl-primary)" }
|
|
5230
|
-
})])) :
|
|
4982
|
+
})])) : M("", !0)
|
|
5231
4983
|
]));
|
|
5232
4984
|
}
|
|
5233
|
-
}), [["__scopeId", "data-v-9db961d1"]]),
|
|
4985
|
+
}), [["__scopeId", "data-v-9db961d1"]]), Li = ["data-tpl-theme"], Ri = {
|
|
5234
4986
|
class: "tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-lg tpl:p-5 tpl:shadow-xl",
|
|
5235
4987
|
style: { "background-color": "var(--tpl-bg-elevated)" }
|
|
5236
|
-
},
|
|
4988
|
+
}, zi = {
|
|
5237
4989
|
class: "tpl:mb-4 tpl:text-sm tpl:font-semibold",
|
|
5238
4990
|
style: { color: "var(--tpl-text)" }
|
|
5239
|
-
},
|
|
4991
|
+
}, Bi = { class: "tpl:mb-3" }, Vi = ["placeholder", "disabled"], Hi = {
|
|
5240
4992
|
key: 0,
|
|
5241
4993
|
class: "tpl:mb-3 tpl:text-xs",
|
|
5242
4994
|
style: { color: "var(--tpl-danger)" }
|
|
5243
|
-
},
|
|
4995
|
+
}, Ui = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Wi = ["disabled"], Gi = ["disabled"], Ki = {
|
|
5244
4996
|
key: 0,
|
|
5245
4997
|
class: "tpl:flex tpl:items-center tpl:gap-1.5"
|
|
5246
|
-
},
|
|
4998
|
+
}, qi = { key: 1 }, Ji = /* @__PURE__ */ m({
|
|
5247
4999
|
__name: "MediaImportUrlModal",
|
|
5248
5000
|
props: {
|
|
5249
5001
|
visible: { type: Boolean },
|
|
@@ -5266,7 +5018,7 @@ var pi = { class: "tpl:p-4" }, mi = {
|
|
|
5266
5018
|
function y(e) {
|
|
5267
5019
|
e.key === "Enter" && (e.preventDefault(), _()), e.key === "Escape" && v();
|
|
5268
5020
|
}
|
|
5269
|
-
return (e, a) => (z(), h(b, { to:
|
|
5021
|
+
return (e, a) => (z(), h(b, { to: A(m) || "body" }, [p(ve, {
|
|
5270
5022
|
"enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
|
|
5271
5023
|
"enter-from-class": "tpl:opacity-0",
|
|
5272
5024
|
"enter-to-class": "tpl:opacity-100",
|
|
@@ -5274,16 +5026,16 @@ var pi = { class: "tpl:p-4" }, mi = {
|
|
|
5274
5026
|
"leave-from-class": "tpl:opacity-100",
|
|
5275
5027
|
"leave-to-class": "tpl:opacity-0"
|
|
5276
5028
|
}, {
|
|
5277
|
-
default:
|
|
5029
|
+
default: P(() => [n.visible ? (z(), t("div", {
|
|
5278
5030
|
key: 0,
|
|
5279
|
-
"data-tpl-theme":
|
|
5031
|
+
"data-tpl-theme": A(f),
|
|
5280
5032
|
class: "tpl tpl:fixed tpl:inset-0 tpl:z-[10000] tpl:flex tpl:items-center tpl:justify-center",
|
|
5281
5033
|
style: { "background-color": "var(--tpl-overlay)" },
|
|
5282
5034
|
onClick: r(v, ["self"]),
|
|
5283
5035
|
onKeydown: y
|
|
5284
|
-
}, [i("div",
|
|
5285
|
-
i("h3",
|
|
5286
|
-
i("div",
|
|
5036
|
+
}, [i("div", Ri, [
|
|
5037
|
+
i("h3", zi, I(A(d).mediaLibrary.importFromUrl), 1),
|
|
5038
|
+
i("div", Bi, [u(i("input", {
|
|
5287
5039
|
"onUpdate:modelValue": a[0] ||= (e) => g.value = e,
|
|
5288
5040
|
type: "url",
|
|
5289
5041
|
class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
|
|
@@ -5292,12 +5044,12 @@ var pi = { class: "tpl:p-4" }, mi = {
|
|
|
5292
5044
|
"background-color": "var(--tpl-bg)",
|
|
5293
5045
|
color: "var(--tpl-text)"
|
|
5294
5046
|
},
|
|
5295
|
-
placeholder:
|
|
5047
|
+
placeholder: A(d).mediaLibrary.importUrlPlaceholder,
|
|
5296
5048
|
disabled: n.isImporting,
|
|
5297
5049
|
autofocus: ""
|
|
5298
|
-
}, null, 8,
|
|
5299
|
-
n.error ? (z(), t("p",
|
|
5300
|
-
i("div",
|
|
5050
|
+
}, null, 8, Vi), [[ee, g.value]])]),
|
|
5051
|
+
n.error ? (z(), t("p", Hi, I(n.error), 1)) : M("", !0),
|
|
5052
|
+
i("div", Ui, [i("button", {
|
|
5301
5053
|
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 }]),
|
|
5302
5054
|
style: {
|
|
5303
5055
|
"border-color": "var(--tpl-border)",
|
|
@@ -5306,25 +5058,25 @@ var pi = { class: "tpl:p-4" }, mi = {
|
|
|
5306
5058
|
},
|
|
5307
5059
|
disabled: n.isImporting,
|
|
5308
5060
|
onClick: v
|
|
5309
|
-
},
|
|
5061
|
+
}, I(A(d).mediaLibrary.cancel), 11, Wi), i("button", {
|
|
5310
5062
|
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",
|
|
5311
5063
|
style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
|
|
5312
5064
|
disabled: !g.value.trim() || n.isImporting,
|
|
5313
5065
|
onClick: _
|
|
5314
|
-
}, [n.isImporting ? (z(), t("span",
|
|
5066
|
+
}, [n.isImporting ? (z(), t("span", Ki, [p(A(ce), {
|
|
5315
5067
|
class: "tpl:animate-spin",
|
|
5316
5068
|
size: 12,
|
|
5317
5069
|
"stroke-width": 2
|
|
5318
|
-
}),
|
|
5319
|
-
])], 40,
|
|
5070
|
+
}), j(" " + I(A(d).mediaLibrary.importing), 1)])) : (z(), t("span", qi, I(A(d).mediaLibrary.import), 1))], 8, Gi)])
|
|
5071
|
+
])], 40, Li)) : M("", !0)]),
|
|
5320
5072
|
_: 1
|
|
5321
5073
|
})], 8, ["to"]));
|
|
5322
5074
|
}
|
|
5323
|
-
}),
|
|
5075
|
+
}), Yi = { class: "tpl:max-h-56 tpl:overflow-y-auto tpl:py-1" }, Xi = ["disabled", "onClick"], Zi = { class: "tpl:truncate" }, Qi = {
|
|
5324
5076
|
key: 0,
|
|
5325
5077
|
class: "tpl:shrink-0",
|
|
5326
5078
|
style: { color: "var(--tpl-text-dim)" }
|
|
5327
|
-
},
|
|
5079
|
+
}, $i = /* @__PURE__ */ m({
|
|
5328
5080
|
__name: "MediaMovePicker",
|
|
5329
5081
|
props: {
|
|
5330
5082
|
folders: {},
|
|
@@ -5342,7 +5094,7 @@ var pi = { class: "tpl:p-4" }, mi = {
|
|
|
5342
5094
|
}), r.children?.length && n.push(...c(r.children, t + 1));
|
|
5343
5095
|
return n;
|
|
5344
5096
|
}
|
|
5345
|
-
return
|
|
5097
|
+
return Qr(s, () => {
|
|
5346
5098
|
a("close");
|
|
5347
5099
|
}), (e, r) => (z(), t("div", {
|
|
5348
5100
|
ref_key: "pickerRef",
|
|
@@ -5352,19 +5104,19 @@ var pi = { class: "tpl:p-4" }, mi = {
|
|
|
5352
5104
|
"border-color": "var(--tpl-border)",
|
|
5353
5105
|
"background-color": "var(--tpl-bg-elevated)"
|
|
5354
5106
|
}
|
|
5355
|
-
}, [i("div",
|
|
5107
|
+
}, [i("div", Yi, [n.currentFolderId === null ? M("", !0) : (z(), t("button", {
|
|
5356
5108
|
key: 0,
|
|
5357
5109
|
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",
|
|
5358
5110
|
style: { color: "var(--tpl-text)" },
|
|
5359
5111
|
onClick: r[0] ||= (e) => a("select", null)
|
|
5360
|
-
}, [p(
|
|
5112
|
+
}, [p(A(le), {
|
|
5361
5113
|
class: "tpl:shrink-0",
|
|
5362
5114
|
size: 14,
|
|
5363
5115
|
"stroke-width": 1.5
|
|
5364
|
-
}),
|
|
5116
|
+
}), j(" " + I(A(o).mediaLibrary.moveToRoot), 1)])), (z(!0), t(R, null, S(c(n.folders), (e) => (z(), t("button", {
|
|
5365
5117
|
key: e.id,
|
|
5366
5118
|
class: "tpl:flex tpl:w-full tpl:items-center tpl:gap-1.5 tpl:py-1.5 tpl:pr-3 tpl:text-left tpl:text-xs tpl:transition-colors tpl:duration-100",
|
|
5367
|
-
style:
|
|
5119
|
+
style: N({
|
|
5368
5120
|
paddingLeft: `${e.depth * 16 + 12}px`,
|
|
5369
5121
|
color: e.id === n.currentFolderId ? "var(--tpl-text-dim)" : "var(--tpl-text)",
|
|
5370
5122
|
opacity: e.id === n.currentFolderId ? .5 : 1
|
|
@@ -5372,32 +5124,32 @@ var pi = { class: "tpl:p-4" }, mi = {
|
|
|
5372
5124
|
disabled: e.id === n.currentFolderId,
|
|
5373
5125
|
onClick: (t) => a("select", e.id)
|
|
5374
5126
|
}, [
|
|
5375
|
-
p(
|
|
5127
|
+
p(A(pe), {
|
|
5376
5128
|
class: "tpl:shrink-0",
|
|
5377
5129
|
size: 14,
|
|
5378
5130
|
"stroke-width": 1.5
|
|
5379
5131
|
}),
|
|
5380
|
-
i("span",
|
|
5381
|
-
e.id === n.currentFolderId ? (z(), t("span",
|
|
5382
|
-
], 12,
|
|
5132
|
+
i("span", Zi, I(e.name), 1),
|
|
5133
|
+
e.id === n.currentFolderId ? (z(), t("span", Qi, I(A(o).mediaLibrary.currentFolder), 1)) : M("", !0)
|
|
5134
|
+
], 12, Xi))), 128))])], 512));
|
|
5383
5135
|
}
|
|
5384
|
-
}),
|
|
5136
|
+
}), ea = { class: "tpl:flex tpl:items-center tpl:gap-3" }, ta = ["src", "alt"], na = {
|
|
5385
5137
|
key: 1,
|
|
5386
5138
|
class: "tpl:flex tpl:size-10 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:overflow-hidden tpl:rounded",
|
|
5387
5139
|
style: { border: "1px solid var(--tpl-border)" }
|
|
5388
|
-
},
|
|
5140
|
+
}, ra = { class: "tpl:min-w-0 tpl:flex-1" }, ia = {
|
|
5389
5141
|
class: "tpl:truncate tpl:text-xs tpl:font-medium",
|
|
5390
5142
|
style: { color: "var(--tpl-text)" }
|
|
5391
|
-
},
|
|
5143
|
+
}, aa = {
|
|
5392
5144
|
class: "tpl:mt-0.5 tpl:text-[10px]",
|
|
5393
5145
|
style: { color: "var(--tpl-text-muted)" }
|
|
5394
|
-
},
|
|
5146
|
+
}, oa = {
|
|
5395
5147
|
key: 2,
|
|
5396
5148
|
class: "tpl:shrink-0"
|
|
5397
|
-
},
|
|
5149
|
+
}, sa = {
|
|
5398
5150
|
class: "tpl:block tpl:text-[10px]",
|
|
5399
5151
|
style: { color: "var(--tpl-text-muted)" }
|
|
5400
|
-
},
|
|
5152
|
+
}, ca = ["value"], la = ["value"], ua = /*#__PURE__*/ mr(/* @__PURE__ */ m({
|
|
5401
5153
|
__name: "MediaPreviewPanel",
|
|
5402
5154
|
props: {
|
|
5403
5155
|
item: {},
|
|
@@ -5456,7 +5208,7 @@ var pi = { class: "tpl:p-4" }, mi = {
|
|
|
5456
5208
|
return e ? e.join("/") : null;
|
|
5457
5209
|
}), g = a(() => c(r.item.mime_type));
|
|
5458
5210
|
function _(e) {
|
|
5459
|
-
return e < 1024 ? `${e} B` : e <
|
|
5211
|
+
return e < 1024 ? `${e} B` : e < 1048576 ? `${(e / 1024).toFixed(1)} KB` : `${(e / 1048576).toFixed(1)} MB`;
|
|
5460
5212
|
}
|
|
5461
5213
|
function v(e) {
|
|
5462
5214
|
return new Date(e).toLocaleDateString(void 0, {
|
|
@@ -5465,39 +5217,39 @@ var pi = { class: "tpl:p-4" }, mi = {
|
|
|
5465
5217
|
day: "numeric"
|
|
5466
5218
|
});
|
|
5467
5219
|
}
|
|
5468
|
-
return (n, r) => (z(), t("div",
|
|
5220
|
+
return (n, r) => (z(), t("div", ea, [
|
|
5469
5221
|
g.value ? (z(), t("img", {
|
|
5470
5222
|
key: 0,
|
|
5471
5223
|
src: d.value ?? void 0,
|
|
5472
5224
|
alt: e.item.alt_text || e.item.filename,
|
|
5473
5225
|
class: "tpl:size-10 tpl:shrink-0 tpl:rounded tpl:object-cover",
|
|
5474
5226
|
style: { border: "1px solid var(--tpl-border)" }
|
|
5475
|
-
}, null, 8,
|
|
5227
|
+
}, null, 8, ta)) : (z(), t("div", na, [p(kr, {
|
|
5476
5228
|
"mime-type": e.item.mime_type,
|
|
5477
5229
|
class: "tpl-preview-icon"
|
|
5478
5230
|
}, null, 8, ["mime-type"])])),
|
|
5479
|
-
i("div",
|
|
5480
|
-
i("p",
|
|
5481
|
-
i("p",
|
|
5482
|
-
|
|
5483
|
-
g.value && e.item.width && e.item.height ? (z(), t(R, { key: 0 }, [
|
|
5231
|
+
i("div", ra, [
|
|
5232
|
+
i("p", ia, I(e.item.filename), 1),
|
|
5233
|
+
i("p", aa, [
|
|
5234
|
+
j(I(_(e.item.size)) + " · " + I(v(e.item.created_at)) + " ", 1),
|
|
5235
|
+
g.value && e.item.width && e.item.height ? (z(), t(R, { key: 0 }, [j(" · " + I(e.item.width) + "×" + I(e.item.height) + "px ", 1)], 64)) : M("", !0),
|
|
5484
5236
|
h.value ? (z(), t(R, { key: 1 }, [
|
|
5485
|
-
r[0] ||=
|
|
5486
|
-
p(
|
|
5237
|
+
r[0] ||= j(" · ", -1),
|
|
5238
|
+
p(A(pe), {
|
|
5487
5239
|
class: "tpl:mb-px tpl:inline",
|
|
5488
5240
|
size: 9,
|
|
5489
5241
|
"stroke-width": 2
|
|
5490
5242
|
}),
|
|
5491
|
-
|
|
5492
|
-
], 64)) :
|
|
5243
|
+
j(" " + I(h.value), 1)
|
|
5244
|
+
], 64)) : M("", !0)
|
|
5493
5245
|
]),
|
|
5494
5246
|
g.value ? (z(), t("p", {
|
|
5495
5247
|
key: 0,
|
|
5496
5248
|
class: k(["tpl:mt-0.5 tpl:truncate tpl:text-[10px] tpl:italic", { "tpl:invisible": !e.item.alt_text }]),
|
|
5497
5249
|
style: { color: "var(--tpl-text-dim)" }
|
|
5498
|
-
},
|
|
5250
|
+
}, I(e.item.alt_text || "\xA0"), 3)) : M("", !0)
|
|
5499
5251
|
]),
|
|
5500
|
-
u.value ? (z(), t("div",
|
|
5252
|
+
u.value ? (z(), t("div", oa, [i("label", sa, I(A(s).mediaLibrary.conversionLabel), 1), i("select", {
|
|
5501
5253
|
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",
|
|
5502
5254
|
style: {
|
|
5503
5255
|
"border-color": "var(--tpl-border)",
|
|
@@ -5509,36 +5261,36 @@ var pi = { class: "tpl:p-4" }, mi = {
|
|
|
5509
5261
|
}, [(z(!0), t(R, null, S(l.value, (e) => (z(), t("option", {
|
|
5510
5262
|
key: e.value,
|
|
5511
5263
|
value: e.value
|
|
5512
|
-
},
|
|
5264
|
+
}, I(e.label), 9, la))), 128))], 40, ca)])) : M("", !0)
|
|
5513
5265
|
]));
|
|
5514
5266
|
}
|
|
5515
|
-
}), [["__scopeId", "data-v-060e36cd"]]),
|
|
5267
|
+
}), [["__scopeId", "data-v-060e36cd"]]), da = ["data-tpl-theme"], fa = {
|
|
5516
5268
|
class: "tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-lg tpl:p-5 tpl:shadow-xl",
|
|
5517
5269
|
style: { "background-color": "var(--tpl-bg-elevated)" }
|
|
5518
|
-
},
|
|
5270
|
+
}, pa = {
|
|
5519
5271
|
class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
|
|
5520
5272
|
style: { color: "var(--tpl-text)" }
|
|
5521
|
-
},
|
|
5273
|
+
}, ma = {
|
|
5522
5274
|
class: "tpl:mb-2 tpl:text-xs",
|
|
5523
5275
|
style: { color: "var(--tpl-text-muted)" }
|
|
5524
|
-
},
|
|
5276
|
+
}, ha = {
|
|
5525
5277
|
key: 0,
|
|
5526
5278
|
class: "tpl:mb-3 tpl:text-xs",
|
|
5527
5279
|
style: { color: "var(--tpl-warning)" }
|
|
5528
|
-
},
|
|
5280
|
+
}, ga = {
|
|
5529
5281
|
class: "tpl:mb-3 tpl:rounded tpl:border tpl:p-2",
|
|
5530
5282
|
style: { "border-color": "var(--tpl-border)" }
|
|
5531
|
-
},
|
|
5283
|
+
}, _a = {
|
|
5532
5284
|
class: "tpl:truncate tpl:text-xs tpl:font-medium",
|
|
5533
5285
|
style: { color: "var(--tpl-text)" }
|
|
5534
|
-
},
|
|
5286
|
+
}, va = { class: "tpl:mb-4" }, ya = {
|
|
5535
5287
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
5536
5288
|
style: { color: "var(--tpl-text-muted)" }
|
|
5537
|
-
},
|
|
5289
|
+
}, ba = ["accept"], xa = {
|
|
5538
5290
|
key: 1,
|
|
5539
5291
|
class: "tpl:mb-3 tpl:text-xs",
|
|
5540
5292
|
style: { color: "var(--tpl-danger)" }
|
|
5541
|
-
},
|
|
5293
|
+
}, Sa = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Ca = ["disabled"], wa = ["disabled"], Ta = /* @__PURE__ */ m({
|
|
5542
5294
|
__name: "MediaReplaceModal",
|
|
5543
5295
|
props: {
|
|
5544
5296
|
visible: { type: Boolean },
|
|
@@ -5567,7 +5319,7 @@ var pi = { class: "tpl:p-4" }, mi = {
|
|
|
5567
5319
|
function w(e) {
|
|
5568
5320
|
e.key === "Escape" && u("close");
|
|
5569
5321
|
}
|
|
5570
|
-
return (e, a) => (z(), h(b, { to:
|
|
5322
|
+
return (e, a) => (z(), h(b, { to: A(m) || "body" }, [p(ve, {
|
|
5571
5323
|
"enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
|
|
5572
5324
|
"enter-from-class": "tpl:opacity-0",
|
|
5573
5325
|
"enter-to-class": "tpl:opacity-100",
|
|
@@ -5575,19 +5327,19 @@ var pi = { class: "tpl:p-4" }, mi = {
|
|
|
5575
5327
|
"leave-from-class": "tpl:opacity-100",
|
|
5576
5328
|
"leave-to-class": "tpl:opacity-0"
|
|
5577
5329
|
}, {
|
|
5578
|
-
default:
|
|
5330
|
+
default: P(() => [n.visible && n.item ? (z(), t("div", {
|
|
5579
5331
|
key: 0,
|
|
5580
|
-
"data-tpl-theme":
|
|
5332
|
+
"data-tpl-theme": A(f),
|
|
5581
5333
|
class: "tpl tpl:fixed tpl:inset-0 tpl:z-[10000] tpl:flex tpl:items-center tpl:justify-center",
|
|
5582
5334
|
style: { "background-color": "var(--tpl-overlay)" },
|
|
5583
5335
|
onClick: a[1] ||= r((e) => u("close"), ["self"]),
|
|
5584
5336
|
onKeydown: w
|
|
5585
|
-
}, [i("div",
|
|
5586
|
-
i("h3",
|
|
5587
|
-
i("p",
|
|
5588
|
-
x.value ? (z(), t("p",
|
|
5589
|
-
i("div",
|
|
5590
|
-
i("div",
|
|
5337
|
+
}, [i("div", fa, [
|
|
5338
|
+
i("h3", pa, I(A(d).mediaLibrary.replaceWarningTitle), 1),
|
|
5339
|
+
i("p", ma, I(A(d).mediaLibrary.replaceWarningMessage.replace("{extension}", `.${v.value}`)), 1),
|
|
5340
|
+
x.value ? (z(), t("p", ha, I(A(d).mediaLibrary.replaceWarningUsageNote.replace("{count}", n.usageInfo.template_count.toString())), 1)) : M("", !0),
|
|
5341
|
+
i("div", ga, [i("p", _a, I(n.item.filename), 1)]),
|
|
5342
|
+
i("div", va, [i("label", ya, I(A(d).mediaLibrary.replaceSelectFile), 1), i("input", {
|
|
5591
5343
|
ref_key: "fileInputRef",
|
|
5592
5344
|
ref: g,
|
|
5593
5345
|
type: "file",
|
|
@@ -5599,9 +5351,9 @@ var pi = { class: "tpl:p-4" }, mi = {
|
|
|
5599
5351
|
color: "var(--tpl-text)"
|
|
5600
5352
|
},
|
|
5601
5353
|
onChange: S
|
|
5602
|
-
}, null, 40,
|
|
5603
|
-
n.error ? (z(), t("p",
|
|
5604
|
-
i("div",
|
|
5354
|
+
}, null, 40, ba)]),
|
|
5355
|
+
n.error ? (z(), t("p", xa, I(n.error), 1)) : M("", !0),
|
|
5356
|
+
i("div", Sa, [i("button", {
|
|
5605
5357
|
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",
|
|
5606
5358
|
style: {
|
|
5607
5359
|
"border-color": "var(--tpl-border)",
|
|
@@ -5610,29 +5362,29 @@ var pi = { class: "tpl:p-4" }, mi = {
|
|
|
5610
5362
|
},
|
|
5611
5363
|
disabled: n.isReplacing,
|
|
5612
5364
|
onClick: a[0] ||= (e) => u("close")
|
|
5613
|
-
},
|
|
5365
|
+
}, I(A(d).mediaLibrary.cancel), 9, Ca), i("button", {
|
|
5614
5366
|
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",
|
|
5615
5367
|
style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
|
|
5616
5368
|
disabled: !_.value || n.isReplacing,
|
|
5617
5369
|
onClick: C
|
|
5618
|
-
},
|
|
5619
|
-
])], 40,
|
|
5370
|
+
}, I(n.isReplacing ? A(d).mediaLibrary.replacing : A(d).mediaLibrary.replace), 9, wa)])
|
|
5371
|
+
])], 40, da)) : M("", !0)]),
|
|
5620
5372
|
_: 1
|
|
5621
5373
|
})], 8, ["to"]));
|
|
5622
5374
|
}
|
|
5623
|
-
}),
|
|
5375
|
+
}), Ea = {
|
|
5624
5376
|
key: 0,
|
|
5625
5377
|
class: "tpl:flex tpl:items-center tpl:gap-2"
|
|
5626
|
-
},
|
|
5378
|
+
}, Da = {
|
|
5627
5379
|
class: "tpl:text-xs",
|
|
5628
5380
|
style: { color: "var(--tpl-text-muted)" }
|
|
5629
|
-
},
|
|
5381
|
+
}, Oa = {
|
|
5630
5382
|
class: "tpl:text-xs",
|
|
5631
5383
|
style: { color: "var(--tpl-text-muted)" }
|
|
5632
|
-
},
|
|
5384
|
+
}, ka = {
|
|
5633
5385
|
class: "tpl:mt-1 tpl:text-[10px]",
|
|
5634
5386
|
style: { color: "var(--tpl-text-dim)" }
|
|
5635
|
-
},
|
|
5387
|
+
}, Aa = /* @__PURE__ */ m({
|
|
5636
5388
|
__name: "MediaUploadZone",
|
|
5637
5389
|
props: {
|
|
5638
5390
|
isUploading: { type: Boolean },
|
|
@@ -5650,9 +5402,9 @@ var pi = { class: "tpl:p-4" }, mi = {
|
|
|
5650
5402
|
let t = f(e);
|
|
5651
5403
|
t.length && a("upload", t);
|
|
5652
5404
|
}
|
|
5653
|
-
let { isOverDropZone: h } =
|
|
5405
|
+
let { isOverDropZone: h } = ri(d, { onDrop: (e) => {
|
|
5654
5406
|
e?.length && m(e);
|
|
5655
|
-
} }), { open: g, onChange: _ } =
|
|
5407
|
+
} }), { open: g, onChange: _ } = si({
|
|
5656
5408
|
accept: l.value,
|
|
5657
5409
|
multiple: !0
|
|
5658
5410
|
});
|
|
@@ -5661,41 +5413,41 @@ var pi = { class: "tpl:p-4" }, mi = {
|
|
|
5661
5413
|
}), (e, r) => (z(), t("div", {
|
|
5662
5414
|
ref_key: "dropZoneRef",
|
|
5663
5415
|
ref: d,
|
|
5664
|
-
class: k(["tpl-upload-zone tpl:flex tpl:cursor-pointer tpl:flex-col tpl:items-center tpl:justify-center tpl:rounded-lg tpl:border-2 tpl:border-dashed tpl:p-5 tpl:text-center tpl:transition-all tpl:duration-150",
|
|
5416
|
+
class: k(["tpl-upload-zone tpl:flex tpl:cursor-pointer tpl:flex-col tpl:items-center tpl:justify-center tpl:rounded-lg tpl:border-2 tpl:border-dashed tpl:p-5 tpl:text-center tpl:transition-all tpl:duration-150", A(h) ? "tpl-upload-zone-active" : ""]),
|
|
5665
5417
|
style: {
|
|
5666
5418
|
"border-color": "var(--tpl-border-light)",
|
|
5667
5419
|
"background-color": "var(--tpl-bg)"
|
|
5668
5420
|
},
|
|
5669
|
-
onClick: r[0] ||= (e) =>
|
|
5670
|
-
}, [n.isUploading ? (z(), t("div",
|
|
5421
|
+
onClick: r[0] ||= (e) => A(g)()
|
|
5422
|
+
}, [n.isUploading ? (z(), t("div", Ea, [p(A(ce), {
|
|
5671
5423
|
class: "tpl-spinner",
|
|
5672
5424
|
size: 20,
|
|
5673
5425
|
"stroke-width": 2,
|
|
5674
5426
|
style: { color: "var(--tpl-primary)" }
|
|
5675
|
-
}), i("span",
|
|
5427
|
+
}), i("span", Da, I(n.uploadProgress && n.uploadProgress.total > 1 ? A(s)(A(o).mediaLibrary.uploadingProgress, {
|
|
5676
5428
|
current: n.uploadProgress.current,
|
|
5677
5429
|
total: n.uploadProgress.total
|
|
5678
|
-
}) :
|
|
5679
|
-
p(
|
|
5430
|
+
}) : A(o).mediaLibrary.uploading), 1)])) : (z(), t(R, { key: 1 }, [
|
|
5431
|
+
p(A(ge), {
|
|
5680
5432
|
class: "tpl:mb-2",
|
|
5681
5433
|
size: 24,
|
|
5682
5434
|
"stroke-width": 1.5,
|
|
5683
5435
|
style: { color: "var(--tpl-text-dim)" }
|
|
5684
5436
|
}),
|
|
5685
|
-
i("p",
|
|
5686
|
-
i("p",
|
|
5437
|
+
i("p", Oa, I(A(o).mediaLibrary.dropOrClick), 1),
|
|
5438
|
+
i("p", ka, I(A(o).mediaLibrary.acceptedFormats), 1)
|
|
5687
5439
|
], 64))], 2));
|
|
5688
5440
|
}
|
|
5689
|
-
}),
|
|
5441
|
+
}), ja = [
|
|
5690
5442
|
"width",
|
|
5691
5443
|
"height",
|
|
5692
5444
|
"viewBox"
|
|
5693
|
-
],
|
|
5445
|
+
], Ma = [
|
|
5694
5446
|
"cx",
|
|
5695
5447
|
"cy",
|
|
5696
5448
|
"r",
|
|
5697
5449
|
"stroke-width"
|
|
5698
|
-
],
|
|
5450
|
+
], Na = [
|
|
5699
5451
|
"cx",
|
|
5700
5452
|
"cy",
|
|
5701
5453
|
"r",
|
|
@@ -5703,14 +5455,14 @@ var pi = { class: "tpl:p-4" }, mi = {
|
|
|
5703
5455
|
"stroke",
|
|
5704
5456
|
"stroke-dasharray",
|
|
5705
5457
|
"stroke-dashoffset"
|
|
5706
|
-
],
|
|
5458
|
+
], Pa = {
|
|
5707
5459
|
key: 0,
|
|
5708
5460
|
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",
|
|
5709
5461
|
style: {
|
|
5710
5462
|
"background-color": "var(--tpl-text)",
|
|
5711
5463
|
color: "var(--tpl-bg-elevated)"
|
|
5712
5464
|
}
|
|
5713
|
-
},
|
|
5465
|
+
}, Fa = /* @__PURE__ */ m({
|
|
5714
5466
|
__name: "StorageProgressRing",
|
|
5715
5467
|
props: {
|
|
5716
5468
|
usedBytes: {},
|
|
@@ -5750,7 +5502,7 @@ var pi = { class: "tpl:p-4" }, mi = {
|
|
|
5750
5502
|
fill: "none",
|
|
5751
5503
|
"stroke-width": u.value,
|
|
5752
5504
|
style: { stroke: "var(--tpl-border)" }
|
|
5753
|
-
}, null, 8,
|
|
5505
|
+
}, null, 8, Ma), i("circle", {
|
|
5754
5506
|
cx: l.value / 2,
|
|
5755
5507
|
cy: l.value / 2,
|
|
5756
5508
|
r: d.value,
|
|
@@ -5761,7 +5513,7 @@ var pi = { class: "tpl:p-4" }, mi = {
|
|
|
5761
5513
|
"stroke-dasharray": f.value,
|
|
5762
5514
|
"stroke-dashoffset": h.value,
|
|
5763
5515
|
class: "tpl:transition-all tpl:duration-300 tpl:ease-out"
|
|
5764
|
-
}, null, 8,
|
|
5516
|
+
}, null, 8, Na)], 8, ja)), p(ve, {
|
|
5765
5517
|
"enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
|
|
5766
5518
|
"enter-from-class": "tpl:opacity-0 tpl:translate-y-1",
|
|
5767
5519
|
"enter-to-class": "tpl:opacity-100 tpl:translate-y-0",
|
|
@@ -5769,14 +5521,14 @@ var pi = { class: "tpl:p-4" }, mi = {
|
|
|
5769
5521
|
"leave-from-class": "tpl:opacity-100 tpl:translate-y-0",
|
|
5770
5522
|
"leave-to-class": "tpl:opacity-0 tpl:translate-y-1"
|
|
5771
5523
|
}, {
|
|
5772
|
-
default:
|
|
5524
|
+
default: P(() => [c.value ? (z(), t("div", Pa, [j(I(S.value) + " ", 1), n[2] ||= i("div", {
|
|
5773
5525
|
class: "tpl:absolute tpl:-top-1 tpl:left-1/2 tpl:size-2 tpl:-translate-x-1/2 tpl:rotate-45",
|
|
5774
5526
|
style: { "background-color": "var(--tpl-text)" }
|
|
5775
|
-
}, null, -1)])) :
|
|
5527
|
+
}, null, -1)])) : M("", !0)]),
|
|
5776
5528
|
_: 1
|
|
5777
5529
|
})], 32));
|
|
5778
5530
|
}
|
|
5779
|
-
}),
|
|
5531
|
+
}), Ia = class {
|
|
5780
5532
|
authManager;
|
|
5781
5533
|
constructor(e) {
|
|
5782
5534
|
this.authManager = e;
|
|
@@ -5933,9 +5685,9 @@ var pi = { class: "tpl:p-4" }, mi = {
|
|
|
5933
5685
|
};
|
|
5934
5686
|
//#endregion
|
|
5935
5687
|
//#region src/composable.ts
|
|
5936
|
-
function
|
|
5688
|
+
function La(t) {
|
|
5937
5689
|
if (!t.projectId) throw Error("projectId is required for useMediaLibrary");
|
|
5938
|
-
let n = new
|
|
5690
|
+
let n = new Ia(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;
|
|
5939
5691
|
async function k() {
|
|
5940
5692
|
let e = ++O;
|
|
5941
5693
|
u.value = !0;
|
|
@@ -5985,13 +5737,13 @@ function Ha(t) {
|
|
|
5985
5737
|
async function re(e) {
|
|
5986
5738
|
l.value = e, await k();
|
|
5987
5739
|
}
|
|
5988
|
-
async function
|
|
5740
|
+
async function ie(e) {
|
|
5989
5741
|
o.value = "files", a.value = e, s.value = "", h.value = /* @__PURE__ */ new Set(), g.value = null, await k();
|
|
5990
5742
|
}
|
|
5991
|
-
async function
|
|
5992
|
-
o.value = "frequently-used", a.value = null, s.value = "", h.value = /* @__PURE__ */ new Set(), g.value = null, await
|
|
5743
|
+
async function ae() {
|
|
5744
|
+
o.value = "frequently-used", a.value = null, s.value = "", h.value = /* @__PURE__ */ new Set(), g.value = null, await ce();
|
|
5993
5745
|
}
|
|
5994
|
-
async function
|
|
5746
|
+
async function oe(e) {
|
|
5995
5747
|
d.value = !0;
|
|
5996
5748
|
try {
|
|
5997
5749
|
let t = await n.uploadMedia(e, a.value);
|
|
@@ -6002,7 +5754,7 @@ function Ha(t) {
|
|
|
6002
5754
|
d.value = !1;
|
|
6003
5755
|
}
|
|
6004
5756
|
}
|
|
6005
|
-
async function
|
|
5757
|
+
async function se(e) {
|
|
6006
5758
|
d.value = !0, m.value = {
|
|
6007
5759
|
current: 0,
|
|
6008
5760
|
total: e.length
|
|
@@ -6024,7 +5776,7 @@ function Ha(t) {
|
|
|
6024
5776
|
d.value = !1, m.value = null;
|
|
6025
5777
|
}
|
|
6026
5778
|
}
|
|
6027
|
-
async function
|
|
5779
|
+
async function A(e) {
|
|
6028
5780
|
if (h.value.size !== 0) try {
|
|
6029
5781
|
let t = await n.moveMedia([...h.value], e);
|
|
6030
5782
|
if (a.value === null) {
|
|
@@ -6036,7 +5788,7 @@ function Ha(t) {
|
|
|
6036
5788
|
t.onError?.(e);
|
|
6037
5789
|
}
|
|
6038
5790
|
}
|
|
6039
|
-
async function
|
|
5791
|
+
async function j(e, i, a) {
|
|
6040
5792
|
try {
|
|
6041
5793
|
let t = await n.updateMedia(e, i, a);
|
|
6042
5794
|
r.value = r.value.map((n) => n.id === e ? t : n), g.value?.id === e && (g.value = t);
|
|
@@ -6044,21 +5796,21 @@ function Ha(t) {
|
|
|
6044
5796
|
t.onError?.(e);
|
|
6045
5797
|
}
|
|
6046
5798
|
}
|
|
6047
|
-
async function
|
|
5799
|
+
async function M() {
|
|
6048
5800
|
if (h.value.size !== 0) try {
|
|
6049
5801
|
await n.deleteMedia([...h.value]), r.value = r.value.filter((e) => !h.value.has(e.id)), _.value = _.value.filter((e) => !h.value.has(e.id)), h.value = /* @__PURE__ */ new Set(), g.value = null;
|
|
6050
5802
|
} catch (e) {
|
|
6051
5803
|
t.onError?.(e);
|
|
6052
5804
|
}
|
|
6053
5805
|
}
|
|
6054
|
-
async function
|
|
5806
|
+
async function ce() {
|
|
6055
5807
|
try {
|
|
6056
5808
|
_.value = await n.getFrequentlyUsed();
|
|
6057
5809
|
} catch (e) {
|
|
6058
5810
|
t.onError?.(e);
|
|
6059
5811
|
}
|
|
6060
5812
|
}
|
|
6061
|
-
async function
|
|
5813
|
+
async function le() {
|
|
6062
5814
|
if (h.value.size === 0) return !1;
|
|
6063
5815
|
b.value = [...h.value];
|
|
6064
5816
|
try {
|
|
@@ -6070,17 +5822,17 @@ function Ha(t) {
|
|
|
6070
5822
|
return t.onError?.(e), !1;
|
|
6071
5823
|
}
|
|
6072
5824
|
}
|
|
6073
|
-
async function
|
|
5825
|
+
async function ue() {
|
|
6074
5826
|
if (y.value = !1, b.value.length !== 0) try {
|
|
6075
5827
|
await n.deleteMedia(b.value), r.value = r.value.filter((e) => !b.value.includes(e.id)), _.value = _.value.filter((e) => !b.value.includes(e.id)), h.value = /* @__PURE__ */ new Set(), g.value = null, b.value = [], v.value = {};
|
|
6076
5828
|
} catch (e) {
|
|
6077
5829
|
t.onError?.(e);
|
|
6078
5830
|
}
|
|
6079
5831
|
}
|
|
6080
|
-
function
|
|
5832
|
+
function de() {
|
|
6081
5833
|
y.value = !1, b.value = [], v.value = {};
|
|
6082
5834
|
}
|
|
6083
|
-
async function
|
|
5835
|
+
async function fe(e) {
|
|
6084
5836
|
x.value = !0, S.value = null;
|
|
6085
5837
|
try {
|
|
6086
5838
|
let t = await n.importFromUrl(e, a.value);
|
|
@@ -6091,57 +5843,57 @@ function Ha(t) {
|
|
|
6091
5843
|
x.value = !1;
|
|
6092
5844
|
}
|
|
6093
5845
|
}
|
|
6094
|
-
function
|
|
5846
|
+
function N(e) {
|
|
6095
5847
|
let t = new Set(h.value);
|
|
6096
5848
|
t.has(e) ? t.delete(e) : t.add(e), h.value = t;
|
|
6097
5849
|
}
|
|
6098
|
-
function
|
|
5850
|
+
function pe() {
|
|
6099
5851
|
h.value = /* @__PURE__ */ new Set(), g.value = null;
|
|
6100
5852
|
}
|
|
6101
|
-
function
|
|
5853
|
+
function P(e) {
|
|
6102
5854
|
g.value = e, h.value = /* @__PURE__ */ new Set([e.id]);
|
|
6103
5855
|
}
|
|
6104
|
-
async function
|
|
5856
|
+
async function me() {
|
|
6105
5857
|
try {
|
|
6106
5858
|
i.value = await n.getMediaFolders();
|
|
6107
5859
|
} catch (e) {
|
|
6108
5860
|
t.onError?.(e);
|
|
6109
5861
|
}
|
|
6110
5862
|
}
|
|
6111
|
-
async function
|
|
5863
|
+
async function F(e, r) {
|
|
6112
5864
|
try {
|
|
6113
5865
|
let t = await n.createMediaFolder(e, r);
|
|
6114
|
-
return await
|
|
5866
|
+
return await me(), t;
|
|
6115
5867
|
} catch (e) {
|
|
6116
5868
|
return t.onError?.(e), null;
|
|
6117
5869
|
}
|
|
6118
5870
|
}
|
|
6119
|
-
function
|
|
5871
|
+
function he(e, t) {
|
|
6120
5872
|
for (let n of e) {
|
|
6121
5873
|
if (n.id === t) return n;
|
|
6122
5874
|
if (n.children) {
|
|
6123
|
-
let e =
|
|
5875
|
+
let e = he(n.children, t);
|
|
6124
5876
|
if (e) return e;
|
|
6125
5877
|
}
|
|
6126
5878
|
}
|
|
6127
5879
|
return null;
|
|
6128
5880
|
}
|
|
6129
|
-
async function
|
|
5881
|
+
async function I(e, r) {
|
|
6130
5882
|
try {
|
|
6131
|
-
await n.renameMediaFolder(e, r), await
|
|
5883
|
+
await n.renameMediaFolder(e, r), await me();
|
|
6132
5884
|
} catch (e) {
|
|
6133
5885
|
t.onError?.(e);
|
|
6134
5886
|
}
|
|
6135
5887
|
}
|
|
6136
|
-
async function
|
|
5888
|
+
async function ge(e) {
|
|
6137
5889
|
try {
|
|
6138
|
-
let t =
|
|
6139
|
-
await n.deleteMediaFolder(e), a.value === e && (a.value = t), await
|
|
5890
|
+
let t = he(i.value, e)?.parent_id ?? null;
|
|
5891
|
+
await n.deleteMediaFolder(e), a.value === e && (a.value = t), await me(), await k();
|
|
6140
5892
|
} catch (e) {
|
|
6141
5893
|
t.onError?.(e);
|
|
6142
5894
|
}
|
|
6143
5895
|
}
|
|
6144
|
-
async function
|
|
5896
|
+
async function L(e) {
|
|
6145
5897
|
E.value = e, w.value = null;
|
|
6146
5898
|
try {
|
|
6147
5899
|
let t = await n.checkMediaUsage([e.id]);
|
|
@@ -6195,34 +5947,34 @@ function Ha(t) {
|
|
|
6195
5947
|
search: te,
|
|
6196
5948
|
filterByCategory: ne,
|
|
6197
5949
|
sortBy: re,
|
|
6198
|
-
navigateToFolder:
|
|
6199
|
-
showFrequentlyUsed:
|
|
6200
|
-
uploadFile:
|
|
6201
|
-
uploadFiles:
|
|
6202
|
-
moveSelected:
|
|
6203
|
-
updateFile:
|
|
6204
|
-
deleteSelected:
|
|
5950
|
+
navigateToFolder: ie,
|
|
5951
|
+
showFrequentlyUsed: ae,
|
|
5952
|
+
uploadFile: oe,
|
|
5953
|
+
uploadFiles: se,
|
|
5954
|
+
moveSelected: A,
|
|
5955
|
+
updateFile: j,
|
|
5956
|
+
deleteSelected: M,
|
|
6205
5957
|
isImportingFromUrl: x,
|
|
6206
5958
|
importFromUrlError: S,
|
|
6207
|
-
importFromUrl:
|
|
6208
|
-
toggleSelection:
|
|
6209
|
-
clearSelection:
|
|
6210
|
-
selectItem:
|
|
6211
|
-
loadFolders:
|
|
6212
|
-
createFolder:
|
|
6213
|
-
renameFolder:
|
|
6214
|
-
deleteFolder:
|
|
6215
|
-
findFolderInTree:
|
|
6216
|
-
loadFrequentlyUsed:
|
|
6217
|
-
checkUsageBeforeDelete:
|
|
6218
|
-
confirmDelete:
|
|
6219
|
-
cancelDelete:
|
|
5959
|
+
importFromUrl: fe,
|
|
5960
|
+
toggleSelection: N,
|
|
5961
|
+
clearSelection: pe,
|
|
5962
|
+
selectItem: P,
|
|
5963
|
+
loadFolders: me,
|
|
5964
|
+
createFolder: F,
|
|
5965
|
+
renameFolder: I,
|
|
5966
|
+
deleteFolder: ge,
|
|
5967
|
+
findFolderInTree: he,
|
|
5968
|
+
loadFrequentlyUsed: ce,
|
|
5969
|
+
checkUsageBeforeDelete: le,
|
|
5970
|
+
confirmDelete: ue,
|
|
5971
|
+
cancelDelete: de,
|
|
6220
5972
|
isReplacing: C,
|
|
6221
5973
|
replaceError: w,
|
|
6222
5974
|
showReplaceWarning: T,
|
|
6223
5975
|
pendingReplaceItem: E,
|
|
6224
5976
|
replaceUsageInfo: D,
|
|
6225
|
-
checkUsageBeforeReplace:
|
|
5977
|
+
checkUsageBeforeReplace: L,
|
|
6226
5978
|
cancelReplace: _e,
|
|
6227
5979
|
replaceFile: ve,
|
|
6228
5980
|
replaceMediaDirectly: R
|
|
@@ -6230,7 +5982,7 @@ function Ha(t) {
|
|
|
6230
5982
|
}
|
|
6231
5983
|
//#endregion
|
|
6232
5984
|
//#region src/composables/useMediaLibraryUI.ts
|
|
6233
|
-
function
|
|
5985
|
+
function Ra(t) {
|
|
6234
5986
|
let { library: n, canUseMediaFolders: r, translations: i } = t;
|
|
6235
5987
|
function o() {
|
|
6236
5988
|
return "value" in i && typeof i.value == "object" ? i.value : i;
|
|
@@ -6258,13 +6010,13 @@ function Ua(t) {
|
|
|
6258
6010
|
}), s(() => n.previewItem.value?.id, () => {
|
|
6259
6011
|
d.value = "original";
|
|
6260
6012
|
});
|
|
6261
|
-
let x =
|
|
6013
|
+
let x = Ur((e) => {
|
|
6262
6014
|
n.search(e);
|
|
6263
6015
|
}, 300);
|
|
6264
6016
|
function S(e) {
|
|
6265
6017
|
u.value = e, x(e);
|
|
6266
6018
|
}
|
|
6267
|
-
let { copy: C, copied: w } =
|
|
6019
|
+
let { copy: C, copied: w } = ni({
|
|
6268
6020
|
copiedDuring: 2e3,
|
|
6269
6021
|
legacy: !0
|
|
6270
6022
|
});
|
|
@@ -6295,16 +6047,16 @@ function Ua(t) {
|
|
|
6295
6047
|
async function re(e) {
|
|
6296
6048
|
m.value = !1, await n.moveSelected(e);
|
|
6297
6049
|
}
|
|
6298
|
-
async function
|
|
6050
|
+
async function ie() {
|
|
6299
6051
|
await n.checkUsageBeforeDelete();
|
|
6300
6052
|
}
|
|
6301
|
-
function
|
|
6053
|
+
function ae(e) {
|
|
6302
6054
|
n.checkUsageBeforeReplace(e);
|
|
6303
6055
|
}
|
|
6304
|
-
async function
|
|
6056
|
+
async function oe(e) {
|
|
6305
6057
|
await n.replaceFile(e);
|
|
6306
6058
|
}
|
|
6307
|
-
function
|
|
6059
|
+
function se() {
|
|
6308
6060
|
n.clearSelection(), n.cancelDelete(), n.cancelReplace(), u.value = "", n.categoryFilter.value = null, n.sortOption.value = "newest", n.viewMode.value = "files", f.value = null, p.value = !1, d.value = "original";
|
|
6309
6061
|
}
|
|
6310
6062
|
return {
|
|
@@ -6332,15 +6084,15 @@ function Ua(t) {
|
|
|
6332
6084
|
handleEditSave: te,
|
|
6333
6085
|
handleImportFromUrl: ne,
|
|
6334
6086
|
handleMoveToFolder: re,
|
|
6335
|
-
handleDeleteClick:
|
|
6336
|
-
handleReplaceItem:
|
|
6337
|
-
handleReplaceFile:
|
|
6338
|
-
resetUI:
|
|
6087
|
+
handleDeleteClick: ie,
|
|
6088
|
+
handleReplaceItem: ae,
|
|
6089
|
+
handleReplaceFile: oe,
|
|
6090
|
+
resetUI: se
|
|
6339
6091
|
};
|
|
6340
6092
|
}
|
|
6341
6093
|
//#endregion
|
|
6342
6094
|
//#region src/standalone/MediaLibrary.vue?vue&type=script&setup=true&lang.ts
|
|
6343
|
-
var
|
|
6095
|
+
var za = {
|
|
6344
6096
|
class: "tpl tpl:flex tpl:flex-col tpl:overflow-hidden tpl:rounded-[var(--tpl-radius-lg)]",
|
|
6345
6097
|
style: {
|
|
6346
6098
|
width: "100%",
|
|
@@ -6348,62 +6100,62 @@ var Wa = {
|
|
|
6348
6100
|
"background-color": "var(--tpl-bg-elevated)",
|
|
6349
6101
|
border: "1px solid var(--tpl-border)"
|
|
6350
6102
|
}
|
|
6351
|
-
},
|
|
6103
|
+
}, Ba = {
|
|
6352
6104
|
class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-3.5",
|
|
6353
6105
|
style: { "border-color": "var(--tpl-border)" }
|
|
6354
|
-
},
|
|
6106
|
+
}, Va = {
|
|
6355
6107
|
class: "tpl:text-sm tpl:font-semibold",
|
|
6356
6108
|
style: { color: "var(--tpl-text)" }
|
|
6357
|
-
},
|
|
6109
|
+
}, Ha = { class: "tpl:flex tpl:items-center tpl:gap-3" }, Ua = { class: "tpl:relative" }, Wa = ["value", "placeholder"], Ga = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, Ka = {
|
|
6358
6110
|
key: 0,
|
|
6359
6111
|
class: "tpl:flex tpl:w-48 tpl:shrink-0 tpl:flex-col tpl:border-r",
|
|
6360
6112
|
style: {
|
|
6361
6113
|
"border-color": "var(--tpl-border)",
|
|
6362
6114
|
"background-color": "var(--tpl-bg)"
|
|
6363
6115
|
}
|
|
6364
|
-
},
|
|
6116
|
+
}, qa = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:flex-col" }, Ja = {
|
|
6365
6117
|
class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-4 tpl:py-2.5",
|
|
6366
6118
|
style: { "border-color": "var(--tpl-border)" }
|
|
6367
|
-
},
|
|
6119
|
+
}, Ya = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Xa = ["title"], Za = {
|
|
6368
6120
|
key: 1,
|
|
6369
6121
|
class: "tpl:text-xs tpl:font-medium",
|
|
6370
6122
|
style: { color: "var(--tpl-text)" }
|
|
6371
|
-
},
|
|
6123
|
+
}, Qa = {
|
|
6372
6124
|
class: "tpl:flex tpl:rounded-md tpl:p-0.5",
|
|
6373
6125
|
style: {
|
|
6374
6126
|
border: "1px solid var(--tpl-border)",
|
|
6375
6127
|
"background-color": "var(--tpl-bg)"
|
|
6376
6128
|
}
|
|
6377
|
-
},
|
|
6129
|
+
}, $a = ["title"], eo = ["title"], to = { class: "tpl:flex tpl:items-center tpl:gap-2" }, no = ["value"], ro = { value: "" }, io = ["value"], ao = ["value"], oo = { value: "newest" }, so = { value: "oldest" }, co = { value: "name_asc" }, lo = { value: "name_desc" }, uo = { value: "size_asc" }, fo = { value: "size_desc" }, po = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto" }, mo = {
|
|
6378
6130
|
key: 0,
|
|
6379
6131
|
class: "tpl:px-4 tpl:pt-3"
|
|
6380
|
-
},
|
|
6132
|
+
}, ho = {
|
|
6381
6133
|
class: "tpl-scale-in tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5",
|
|
6382
6134
|
style: {
|
|
6383
6135
|
"background-color": "var(--tpl-bg-elevated)",
|
|
6384
6136
|
"box-shadow": "var(--tpl-shadow-xl)"
|
|
6385
6137
|
}
|
|
6386
|
-
},
|
|
6138
|
+
}, go = {
|
|
6387
6139
|
class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
|
|
6388
6140
|
style: { color: "var(--tpl-text)" }
|
|
6389
|
-
},
|
|
6141
|
+
}, _o = {
|
|
6390
6142
|
key: 0,
|
|
6391
6143
|
class: "tpl:mb-4 tpl:text-xs",
|
|
6392
6144
|
style: { color: "var(--tpl-text-muted)" }
|
|
6393
|
-
},
|
|
6145
|
+
}, vo = {
|
|
6394
6146
|
key: 1,
|
|
6395
6147
|
class: "tpl:mb-4 tpl:max-h-32 tpl:overflow-y-auto tpl:rounded tpl:border tpl:p-2",
|
|
6396
6148
|
style: { "border-color": "var(--tpl-border)" }
|
|
6397
|
-
},
|
|
6149
|
+
}, yo = { class: "tpl:font-medium" }, bo = { style: { color: "var(--tpl-text-muted)" } }, xo = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, So = {
|
|
6398
6150
|
class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-t tpl:px-5 tpl:py-3",
|
|
6399
6151
|
style: { "border-color": "var(--tpl-border)" }
|
|
6400
|
-
},
|
|
6152
|
+
}, Co = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-3" }, wo = { class: "tpl:flex tpl:items-center tpl:gap-5" }, To = {
|
|
6401
6153
|
key: 0,
|
|
6402
6154
|
class: "tpl:flex tpl:items-center tpl:gap-2"
|
|
6403
|
-
},
|
|
6155
|
+
}, Eo = {
|
|
6404
6156
|
key: 1,
|
|
6405
6157
|
class: "tpl:relative"
|
|
6406
|
-
},
|
|
6158
|
+
}, Do = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Oo = ["disabled"], ko = /* @__PURE__ */ m({
|
|
6407
6159
|
__name: "MediaLibrary",
|
|
6408
6160
|
props: {
|
|
6409
6161
|
authManager: {},
|
|
@@ -6416,39 +6168,41 @@ var Wa = {
|
|
|
6416
6168
|
emits: ["ready"],
|
|
6417
6169
|
setup(o, { emit: s }) {
|
|
6418
6170
|
let c = o, l = s, u = a(() => c.translations);
|
|
6419
|
-
n("translations", c.translations), n("authManager", c.authManager), n("projectId", a(() => c.projectId))
|
|
6420
|
-
|
|
6171
|
+
n("translations", c.translations), n("authManager", c.authManager), n("projectId", a(() => c.projectId));
|
|
6172
|
+
let d = e(c.planConfig);
|
|
6173
|
+
n("planConfig", {
|
|
6174
|
+
config: d,
|
|
6421
6175
|
isLoading: e(!1),
|
|
6422
6176
|
hasFeature: (e) => c.planConfig.features[e] ?? !1,
|
|
6423
6177
|
features: a(() => c.planConfig.features),
|
|
6424
6178
|
fetchConfig: async () => {}
|
|
6425
6179
|
});
|
|
6426
|
-
let
|
|
6180
|
+
let f = a(() => c.planConfig.features.media_folders ?? !1), m = a(() => c.planConfig.features.import_from_url ?? !1), g = a(() => c.planConfig.storage.used_bytes ?? 0), _ = a(() => c.planConfig.storage.limit_bytes ?? 0), { availableCategories: y } = Fe(), b = La({
|
|
6427
6181
|
projectId: c.projectId,
|
|
6428
6182
|
authManager: c.authManager,
|
|
6429
6183
|
onError: c.onError
|
|
6430
|
-
}),
|
|
6431
|
-
library:
|
|
6432
|
-
canUseMediaFolders:
|
|
6184
|
+
}), x = Ra({
|
|
6185
|
+
library: b,
|
|
6186
|
+
canUseMediaFolders: f,
|
|
6433
6187
|
translations: u
|
|
6434
6188
|
});
|
|
6435
|
-
function
|
|
6436
|
-
if (!
|
|
6437
|
-
let e =
|
|
6189
|
+
function C() {
|
|
6190
|
+
if (!b.previewItem.value) return;
|
|
6191
|
+
let e = b.previewItem.value;
|
|
6438
6192
|
c.onSelect?.({
|
|
6439
6193
|
...e,
|
|
6440
|
-
url:
|
|
6194
|
+
url: x.selectedUrl.value || e.url
|
|
6441
6195
|
});
|
|
6442
6196
|
}
|
|
6443
6197
|
return v(() => {
|
|
6444
|
-
|
|
6445
|
-
}), (e, n) => (z(), t("div",
|
|
6446
|
-
i("div",
|
|
6447
|
-
"used-bytes":
|
|
6448
|
-
"limit-bytes":
|
|
6198
|
+
b.loadItems(), b.loadFrequentlyUsed(), l("ready");
|
|
6199
|
+
}), (e, n) => (z(), t("div", za, [
|
|
6200
|
+
i("div", Ba, [i("h2", Va, I(u.value.mediaLibrary.title), 1), i("div", Ha, [p(Fa, {
|
|
6201
|
+
"used-bytes": g.value,
|
|
6202
|
+
"limit-bytes": _.value,
|
|
6449
6203
|
size: 22
|
|
6450
|
-
}, null, 8, ["used-bytes", "limit-bytes"]), i("div",
|
|
6451
|
-
value:
|
|
6204
|
+
}, null, 8, ["used-bytes", "limit-bytes"]), i("div", Ua, [i("input", {
|
|
6205
|
+
value: A(x).searchInput.value,
|
|
6452
6206
|
type: "text",
|
|
6453
6207
|
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)]",
|
|
6454
6208
|
style: {
|
|
@@ -6457,14 +6211,14 @@ var Wa = {
|
|
|
6457
6211
|
color: "var(--tpl-text)"
|
|
6458
6212
|
},
|
|
6459
6213
|
placeholder: u.value.mediaLibrary.searchPlaceholder,
|
|
6460
|
-
onInput: n[0] ||= (e) =>
|
|
6461
|
-
}, null, 40,
|
|
6214
|
+
onInput: n[0] ||= (e) => A(x).handleSearchInput(e.target.value)
|
|
6215
|
+
}, null, 40, Wa), p(A(se), {
|
|
6462
6216
|
class: "tpl:absolute tpl:top-1/2 tpl:left-2.5 tpl:-translate-y-1/2",
|
|
6463
6217
|
size: 13,
|
|
6464
6218
|
"stroke-width": 2,
|
|
6465
6219
|
style: { color: "var(--tpl-text-dim)" }
|
|
6466
6220
|
})])])]),
|
|
6467
|
-
i("div",
|
|
6221
|
+
i("div", Ga, [p(ve, {
|
|
6468
6222
|
"enter-active-class": "tpl:transition-all tpl:duration-200 tpl:ease-out",
|
|
6469
6223
|
"enter-from-class": "tpl:-ml-48 tpl:opacity-0",
|
|
6470
6224
|
"enter-to-class": "tpl:ml-0 tpl:opacity-100",
|
|
@@ -6472,16 +6226,16 @@ var Wa = {
|
|
|
6472
6226
|
"leave-from-class": "tpl:ml-0 tpl:opacity-100",
|
|
6473
6227
|
"leave-to-class": "tpl:-ml-48 tpl:opacity-0"
|
|
6474
6228
|
}, {
|
|
6475
|
-
default:
|
|
6476
|
-
folders:
|
|
6477
|
-
"current-folder-id":
|
|
6478
|
-
"view-mode":
|
|
6479
|
-
"has-frequently-used":
|
|
6480
|
-
onNavigate:
|
|
6481
|
-
onCreateFolder:
|
|
6482
|
-
onRenameFolder:
|
|
6483
|
-
onDeleteFolder:
|
|
6484
|
-
onShowFrequentlyUsed:
|
|
6229
|
+
default: P(() => [f.value && A(x).showSidebar.value ? (z(), t("div", Ka, [p(Dr, {
|
|
6230
|
+
folders: A(b).folders.value,
|
|
6231
|
+
"current-folder-id": A(b).currentFolderId.value,
|
|
6232
|
+
"view-mode": A(b).viewMode.value,
|
|
6233
|
+
"has-frequently-used": A(x).hasFrequentlyUsed.value,
|
|
6234
|
+
onNavigate: A(b).navigateToFolder,
|
|
6235
|
+
onCreateFolder: A(x).handleCreateFolder,
|
|
6236
|
+
onRenameFolder: A(x).handleRenameFolder,
|
|
6237
|
+
onDeleteFolder: A(x).handleDeleteFolder,
|
|
6238
|
+
onShowFrequentlyUsed: A(b).showFrequentlyUsed
|
|
6485
6239
|
}, null, 8, [
|
|
6486
6240
|
"folders",
|
|
6487
6241
|
"current-folder-id",
|
|
@@ -6492,57 +6246,57 @@ var Wa = {
|
|
|
6492
6246
|
"onRenameFolder",
|
|
6493
6247
|
"onDeleteFolder",
|
|
6494
6248
|
"onShowFrequentlyUsed"
|
|
6495
|
-
])])) :
|
|
6249
|
+
])])) : M("", !0)]),
|
|
6496
6250
|
_: 1
|
|
6497
|
-
}), i("div",
|
|
6498
|
-
|
|
6251
|
+
}), i("div", qa, [i("div", Ja, [i("div", Ya, [
|
|
6252
|
+
f.value ? (z(), t("button", {
|
|
6499
6253
|
key: 0,
|
|
6500
6254
|
class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
|
|
6501
|
-
style:
|
|
6502
|
-
color:
|
|
6503
|
-
backgroundColor:
|
|
6504
|
-
border:
|
|
6255
|
+
style: N({
|
|
6256
|
+
color: A(x).showSidebar.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
6257
|
+
backgroundColor: A(x).showSidebar.value ? "var(--tpl-bg)" : "transparent",
|
|
6258
|
+
border: A(x).showSidebar.value ? "1px solid var(--tpl-border)" : "1px solid transparent"
|
|
6505
6259
|
}),
|
|
6506
|
-
title:
|
|
6507
|
-
onClick: n[1] ||= (e) =>
|
|
6508
|
-
}, [p(
|
|
6260
|
+
title: A(x).showSidebar.value ? u.value.mediaLibrary.hideFolders : u.value.mediaLibrary.showFolders,
|
|
6261
|
+
onClick: n[1] ||= (e) => A(x).showSidebar.value = !A(x).showSidebar.value
|
|
6262
|
+
}, [p(A(te), {
|
|
6509
6263
|
size: 16,
|
|
6510
6264
|
"stroke-width": 2
|
|
6511
|
-
})], 12,
|
|
6512
|
-
|
|
6265
|
+
})], 12, Xa)) : M("", !0),
|
|
6266
|
+
A(b).viewMode.value === "frequently-used" ? (z(), t("span", Za, I(u.value.mediaLibrary.frequentlyUsed), 1)) : (z(), h(Pe, {
|
|
6513
6267
|
key: 2,
|
|
6514
|
-
folders:
|
|
6515
|
-
"current-folder-id":
|
|
6516
|
-
onNavigate:
|
|
6268
|
+
folders: A(b).folders.value,
|
|
6269
|
+
"current-folder-id": A(b).currentFolderId.value,
|
|
6270
|
+
onNavigate: A(b).navigateToFolder
|
|
6517
6271
|
}, null, 8, [
|
|
6518
6272
|
"folders",
|
|
6519
6273
|
"current-folder-id",
|
|
6520
6274
|
"onNavigate"
|
|
6521
6275
|
])),
|
|
6522
|
-
i("div",
|
|
6276
|
+
i("div", Qa, [i("button", {
|
|
6523
6277
|
class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
|
|
6524
|
-
style:
|
|
6525
|
-
color:
|
|
6526
|
-
backgroundColor:
|
|
6278
|
+
style: N({
|
|
6279
|
+
color: A(x).layoutMode.value === "grid" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
6280
|
+
backgroundColor: A(x).layoutMode.value === "grid" ? "var(--tpl-bg-elevated)" : "transparent"
|
|
6527
6281
|
}),
|
|
6528
6282
|
title: u.value.mediaLibrary.viewGrid,
|
|
6529
|
-
onClick: n[2] ||= (e) =>
|
|
6530
|
-
}, [p(
|
|
6283
|
+
onClick: n[2] ||= (e) => A(x).layoutMode.value = "grid"
|
|
6284
|
+
}, [p(A(ie), {
|
|
6531
6285
|
size: 14,
|
|
6532
6286
|
"stroke-width": 2
|
|
6533
|
-
})], 12,
|
|
6287
|
+
})], 12, $a), i("button", {
|
|
6534
6288
|
class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
|
|
6535
|
-
style:
|
|
6536
|
-
color:
|
|
6537
|
-
backgroundColor:
|
|
6289
|
+
style: N({
|
|
6290
|
+
color: A(x).layoutMode.value === "list" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
6291
|
+
backgroundColor: A(x).layoutMode.value === "list" ? "var(--tpl-bg-elevated)" : "transparent"
|
|
6538
6292
|
}),
|
|
6539
6293
|
title: u.value.mediaLibrary.viewList,
|
|
6540
|
-
onClick: n[3] ||= (e) =>
|
|
6541
|
-
}, [p(
|
|
6294
|
+
onClick: n[3] ||= (e) => A(x).layoutMode.value = "list"
|
|
6295
|
+
}, [p(A(_e), {
|
|
6542
6296
|
size: 14,
|
|
6543
6297
|
"stroke-width": 2
|
|
6544
|
-
})], 12,
|
|
6545
|
-
]), i("div",
|
|
6298
|
+
})], 12, eo)])
|
|
6299
|
+
]), i("div", to, [A(y).length > 1 ? (z(), t("select", {
|
|
6546
6300
|
key: 0,
|
|
6547
6301
|
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",
|
|
6548
6302
|
style: {
|
|
@@ -6550,36 +6304,36 @@ var Wa = {
|
|
|
6550
6304
|
"background-color": "var(--tpl-bg)",
|
|
6551
6305
|
color: "var(--tpl-text)"
|
|
6552
6306
|
},
|
|
6553
|
-
value:
|
|
6554
|
-
onChange: n[4] ||= (e) =>
|
|
6555
|
-
}, [i("option",
|
|
6307
|
+
value: A(b).categoryFilter.value ?? "",
|
|
6308
|
+
onChange: n[4] ||= (e) => A(b).filterByCategory(e.target.value || null)
|
|
6309
|
+
}, [i("option", ro, I(u.value.mediaLibrary.filterAll), 1), (z(!0), t(R, null, S(A(y), (e) => (z(), t("option", {
|
|
6556
6310
|
key: e,
|
|
6557
6311
|
value: e
|
|
6558
|
-
},
|
|
6312
|
+
}, I(A(x).getCategoryLabel(e)), 9, io))), 128))], 40, no)) : M("", !0), i("select", {
|
|
6559
6313
|
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",
|
|
6560
6314
|
style: {
|
|
6561
6315
|
"border-color": "var(--tpl-border)",
|
|
6562
6316
|
"background-color": "var(--tpl-bg)",
|
|
6563
6317
|
color: "var(--tpl-text)"
|
|
6564
6318
|
},
|
|
6565
|
-
value:
|
|
6566
|
-
onChange: n[5] ||= (e) =>
|
|
6319
|
+
value: A(b).sortOption.value,
|
|
6320
|
+
onChange: n[5] ||= (e) => A(b).sortBy(e.target.value)
|
|
6567
6321
|
}, [
|
|
6568
|
-
i("option",
|
|
6569
|
-
i("option",
|
|
6570
|
-
i("option",
|
|
6571
|
-
i("option",
|
|
6572
|
-
i("option",
|
|
6573
|
-
i("option",
|
|
6574
|
-
], 40,
|
|
6575
|
-
"is-uploading":
|
|
6576
|
-
"upload-progress":
|
|
6577
|
-
onUpload:
|
|
6322
|
+
i("option", oo, I(u.value.mediaLibrary.sortNewest), 1),
|
|
6323
|
+
i("option", so, I(u.value.mediaLibrary.sortOldest), 1),
|
|
6324
|
+
i("option", co, I(u.value.mediaLibrary.sortNameAsc), 1),
|
|
6325
|
+
i("option", lo, I(u.value.mediaLibrary.sortNameDesc), 1),
|
|
6326
|
+
i("option", uo, I(u.value.mediaLibrary.sortSizeAsc), 1),
|
|
6327
|
+
i("option", fo, I(u.value.mediaLibrary.sortSizeDesc), 1)
|
|
6328
|
+
], 40, ao)])]), i("div", po, [A(b).viewMode.value === "files" ? (z(), t("div", mo, [p(Aa, {
|
|
6329
|
+
"is-uploading": A(b).isUploading.value,
|
|
6330
|
+
"upload-progress": A(b).uploadProgress.value,
|
|
6331
|
+
onUpload: A(x).handleUpload
|
|
6578
6332
|
}, null, 8, [
|
|
6579
6333
|
"is-uploading",
|
|
6580
6334
|
"upload-progress",
|
|
6581
6335
|
"onUpload"
|
|
6582
|
-
]),
|
|
6336
|
+
]), m.value ? (z(), t("button", {
|
|
6583
6337
|
key: 0,
|
|
6584
6338
|
class: "tpl:mt-2 tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-dashed tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
6585
6339
|
style: {
|
|
@@ -6587,21 +6341,21 @@ var Wa = {
|
|
|
6587
6341
|
color: "var(--tpl-text-muted)",
|
|
6588
6342
|
"background-color": "var(--tpl-bg)"
|
|
6589
6343
|
},
|
|
6590
|
-
onClick: n[6] ||= (e) =>
|
|
6591
|
-
}, [p(
|
|
6344
|
+
onClick: n[6] ||= (e) => A(x).showImportUrlModal.value = !0
|
|
6345
|
+
}, [p(A(ne), {
|
|
6592
6346
|
size: 14,
|
|
6593
6347
|
"stroke-width": 2
|
|
6594
|
-
}),
|
|
6595
|
-
items:
|
|
6596
|
-
"selected-ids":
|
|
6597
|
-
"is-loading":
|
|
6598
|
-
"has-more":
|
|
6599
|
-
layout:
|
|
6600
|
-
onSelect:
|
|
6601
|
-
onToggle:
|
|
6602
|
-
onLoadMore:
|
|
6603
|
-
onEdit:
|
|
6604
|
-
onReplace:
|
|
6348
|
+
}), j(" " + I(u.value.mediaLibrary.importFromUrl), 1)])) : M("", !0)])) : M("", !0), p(Ii, {
|
|
6349
|
+
items: A(x).displayItems.value,
|
|
6350
|
+
"selected-ids": A(b).selectedItems.value,
|
|
6351
|
+
"is-loading": A(b).isLoading.value,
|
|
6352
|
+
"has-more": A(b).viewMode.value === "files" && A(b).hasMore.value,
|
|
6353
|
+
layout: A(x).layoutMode.value,
|
|
6354
|
+
onSelect: A(x).handleSelect,
|
|
6355
|
+
onToggle: A(b).toggleSelection,
|
|
6356
|
+
onLoadMore: A(b).loadMore,
|
|
6357
|
+
onEdit: A(x).handleEditItem,
|
|
6358
|
+
onReplace: A(x).handleReplaceItem
|
|
6605
6359
|
}, null, 8, [
|
|
6606
6360
|
"items",
|
|
6607
6361
|
"selected-ids",
|
|
@@ -6614,36 +6368,36 @@ var Wa = {
|
|
|
6614
6368
|
"onEdit",
|
|
6615
6369
|
"onReplace"
|
|
6616
6370
|
])])])]),
|
|
6617
|
-
p(
|
|
6618
|
-
visible:
|
|
6619
|
-
"is-importing":
|
|
6620
|
-
error:
|
|
6621
|
-
onImport:
|
|
6622
|
-
onClose: n[7] ||= (e) =>
|
|
6371
|
+
p(Ji, {
|
|
6372
|
+
visible: A(x).showImportUrlModal.value,
|
|
6373
|
+
"is-importing": A(b).isImportingFromUrl.value,
|
|
6374
|
+
error: A(b).importFromUrlError.value,
|
|
6375
|
+
onImport: A(x).handleImportFromUrl,
|
|
6376
|
+
onClose: n[7] ||= (e) => A(x).showImportUrlModal.value = !1
|
|
6623
6377
|
}, null, 8, [
|
|
6624
6378
|
"visible",
|
|
6625
6379
|
"is-importing",
|
|
6626
6380
|
"error",
|
|
6627
6381
|
"onImport"
|
|
6628
6382
|
]),
|
|
6629
|
-
p(
|
|
6630
|
-
visible: !!
|
|
6631
|
-
item:
|
|
6632
|
-
onSave:
|
|
6633
|
-
onClose: n[8] ||= (e) =>
|
|
6383
|
+
p(hr, {
|
|
6384
|
+
visible: !!A(x).editingItem.value,
|
|
6385
|
+
item: A(x).editingItem.value,
|
|
6386
|
+
onSave: A(x).handleEditSave,
|
|
6387
|
+
onClose: n[8] ||= (e) => A(x).editingItem.value = null
|
|
6634
6388
|
}, null, 8, [
|
|
6635
6389
|
"visible",
|
|
6636
6390
|
"item",
|
|
6637
6391
|
"onSave"
|
|
6638
6392
|
]),
|
|
6639
|
-
p(
|
|
6640
|
-
visible:
|
|
6641
|
-
item:
|
|
6642
|
-
"usage-info":
|
|
6643
|
-
"is-replacing":
|
|
6644
|
-
error:
|
|
6645
|
-
onReplace:
|
|
6646
|
-
onClose:
|
|
6393
|
+
p(Ta, {
|
|
6394
|
+
visible: A(b).showReplaceWarning.value,
|
|
6395
|
+
item: A(b).pendingReplaceItem.value,
|
|
6396
|
+
"usage-info": A(b).replaceUsageInfo.value,
|
|
6397
|
+
"is-replacing": A(b).isReplacing.value,
|
|
6398
|
+
error: A(b).replaceError.value,
|
|
6399
|
+
onReplace: A(x).handleReplaceFile,
|
|
6400
|
+
onClose: A(b).cancelReplace
|
|
6647
6401
|
}, null, 8, [
|
|
6648
6402
|
"visible",
|
|
6649
6403
|
"item",
|
|
@@ -6661,7 +6415,7 @@ var Wa = {
|
|
|
6661
6415
|
"leave-from-class": "tpl:opacity-100",
|
|
6662
6416
|
"leave-to-class": "tpl:opacity-0"
|
|
6663
6417
|
}, {
|
|
6664
|
-
default:
|
|
6418
|
+
default: P(() => [A(b).showDeleteWarning.value ? (z(), t("div", {
|
|
6665
6419
|
key: 0,
|
|
6666
6420
|
class: "tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-lg)]",
|
|
6667
6421
|
style: {
|
|
@@ -6669,85 +6423,85 @@ var Wa = {
|
|
|
6669
6423
|
"backdrop-filter": "blur(8px)",
|
|
6670
6424
|
"-webkit-backdrop-filter": "blur(8px)"
|
|
6671
6425
|
},
|
|
6672
|
-
onClick: n[11] ||= r((...e) =>
|
|
6673
|
-
}, [i("div",
|
|
6674
|
-
i("h3",
|
|
6426
|
+
onClick: n[11] ||= r((...e) => A(b).cancelDelete && A(b).cancelDelete(...e), ["self"])
|
|
6427
|
+
}, [i("div", ho, [
|
|
6428
|
+
i("h3", go, I(u.value.mediaLibrary.deleteWarningTitle), 1),
|
|
6675
6429
|
i("p", {
|
|
6676
|
-
class: k(["tpl:text-xs",
|
|
6430
|
+
class: k(["tpl:text-xs", A(x).hasUsedFiles.value ? "tpl:mb-2" : "tpl:mb-4"]),
|
|
6677
6431
|
style: { color: "var(--tpl-text-muted)" }
|
|
6678
|
-
},
|
|
6679
|
-
|
|
6680
|
-
|
|
6432
|
+
}, I(u.value.mediaLibrary.deleteWarningMessage), 3),
|
|
6433
|
+
A(x).hasUsedFiles.value ? (z(), t("p", _o, I(u.value.mediaLibrary.deleteWarningUsageNote), 1)) : M("", !0),
|
|
6434
|
+
A(x).hasUsedFiles.value ? (z(), t("div", vo, [(z(!0), t(R, null, S(A(b).deleteUsageInfo.value, (e, n) => (z(), t("div", {
|
|
6681
6435
|
key: n,
|
|
6682
6436
|
class: "tpl:text-xs",
|
|
6683
6437
|
style: { color: "var(--tpl-text)" }
|
|
6684
|
-
}, [e.template_count > 0 ? (z(), t(R, { key: 0 }, [i("span",
|
|
6685
|
-
i("div",
|
|
6438
|
+
}, [e.template_count > 0 ? (z(), t(R, { key: 0 }, [i("span", yo, I(A(x).displayItems.value.find((e) => e.id === n)?.filename || n), 1), i("span", bo, " - " + I(u.value.mediaLibrary.usedInTemplates.replace("{count}", e.template_count.toString())), 1)], 64)) : M("", !0)]))), 128))])) : M("", !0),
|
|
6439
|
+
i("div", xo, [i("button", {
|
|
6686
6440
|
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",
|
|
6687
6441
|
style: {
|
|
6688
6442
|
"border-color": "var(--tpl-border)",
|
|
6689
6443
|
color: "var(--tpl-text)",
|
|
6690
6444
|
"background-color": "var(--tpl-bg)"
|
|
6691
6445
|
},
|
|
6692
|
-
onClick: n[9] ||= (...e) =>
|
|
6693
|
-
},
|
|
6446
|
+
onClick: n[9] ||= (...e) => A(b).cancelDelete && A(b).cancelDelete(...e)
|
|
6447
|
+
}, I(u.value.mediaLibrary.cancel), 1), i("button", {
|
|
6694
6448
|
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",
|
|
6695
6449
|
style: {
|
|
6696
6450
|
"border-color": "var(--tpl-danger)",
|
|
6697
6451
|
color: "var(--tpl-danger)",
|
|
6698
6452
|
"background-color": "var(--tpl-danger-light)"
|
|
6699
6453
|
},
|
|
6700
|
-
onClick: n[10] ||= (...e) =>
|
|
6701
|
-
},
|
|
6702
|
-
])])) :
|
|
6454
|
+
onClick: n[10] ||= (...e) => A(b).confirmDelete && A(b).confirmDelete(...e)
|
|
6455
|
+
}, I(A(x).hasUsedFiles.value ? u.value.mediaLibrary.deleteAnyway : u.value.mediaLibrary.confirmDelete), 1)])
|
|
6456
|
+
])])) : M("", !0)]),
|
|
6703
6457
|
_: 1
|
|
6704
6458
|
}),
|
|
6705
|
-
i("div",
|
|
6459
|
+
i("div", So, [i("div", Co, [A(b).previewItem.value ? (z(), h(ua, {
|
|
6706
6460
|
key: 0,
|
|
6707
|
-
"selected-conversion":
|
|
6708
|
-
"onUpdate:selectedConversion": n[12] ||= (e) =>
|
|
6709
|
-
item:
|
|
6710
|
-
folders:
|
|
6461
|
+
"selected-conversion": A(x).selectedConversion.value,
|
|
6462
|
+
"onUpdate:selectedConversion": n[12] ||= (e) => A(x).selectedConversion.value = e,
|
|
6463
|
+
item: A(b).previewItem.value,
|
|
6464
|
+
folders: A(b).folders.value
|
|
6711
6465
|
}, null, 8, [
|
|
6712
6466
|
"selected-conversion",
|
|
6713
6467
|
"item",
|
|
6714
6468
|
"folders"
|
|
6715
|
-
])) :
|
|
6469
|
+
])) : M("", !0)]), i("div", wo, [A(b).selectedItems.value.size > 0 ? (z(), t("div", To, [A(b).previewItem.value ? (z(), t("button", {
|
|
6716
6470
|
key: 0,
|
|
6717
6471
|
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",
|
|
6718
|
-
style:
|
|
6719
|
-
borderColor:
|
|
6720
|
-
color:
|
|
6472
|
+
style: N({
|
|
6473
|
+
borderColor: A(x).copied.value ? "var(--tpl-success)" : "var(--tpl-border)",
|
|
6474
|
+
color: A(x).copied.value ? "var(--tpl-success)" : "var(--tpl-text)",
|
|
6721
6475
|
backgroundColor: "var(--tpl-bg)"
|
|
6722
6476
|
}),
|
|
6723
|
-
onClick: n[13] ||= (e) =>
|
|
6724
|
-
}, [
|
|
6477
|
+
onClick: n[13] ||= (e) => A(x).copy(A(x).selectedUrl.value)
|
|
6478
|
+
}, [A(x).copied.value ? (z(), h(A(D), {
|
|
6725
6479
|
key: 1,
|
|
6726
6480
|
size: 12,
|
|
6727
6481
|
"stroke-width": 2
|
|
6728
|
-
})) : (z(), h(
|
|
6482
|
+
})) : (z(), h(A(oe), {
|
|
6729
6483
|
key: 0,
|
|
6730
6484
|
size: 12,
|
|
6731
6485
|
"stroke-width": 2
|
|
6732
|
-
})),
|
|
6486
|
+
})), j(" " + I(A(x).copied.value ? u.value.mediaLibrary.copied : u.value.mediaLibrary.copyUrl), 1)], 4)) : M("", !0), f.value ? (z(), t("div", Eo, [i("button", {
|
|
6733
6487
|
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",
|
|
6734
6488
|
style: {
|
|
6735
6489
|
"border-color": "var(--tpl-border)",
|
|
6736
6490
|
color: "var(--tpl-text)",
|
|
6737
6491
|
"background-color": "var(--tpl-bg)"
|
|
6738
6492
|
},
|
|
6739
|
-
onClick: n[14] ||= (e) =>
|
|
6740
|
-
},
|
|
6493
|
+
onClick: n[14] ||= (e) => A(x).showMovePicker.value = !A(x).showMovePicker.value
|
|
6494
|
+
}, I(u.value.mediaLibrary.moveSelected), 1), A(x).showMovePicker.value ? (z(), h($i, {
|
|
6741
6495
|
key: 0,
|
|
6742
|
-
folders:
|
|
6743
|
-
"current-folder-id":
|
|
6744
|
-
onSelect:
|
|
6745
|
-
onClose: n[15] ||= (e) =>
|
|
6496
|
+
folders: A(b).folders.value,
|
|
6497
|
+
"current-folder-id": A(b).currentFolderId.value,
|
|
6498
|
+
onSelect: A(x).handleMoveToFolder,
|
|
6499
|
+
onClose: n[15] ||= (e) => A(x).showMovePicker.value = !1
|
|
6746
6500
|
}, null, 8, [
|
|
6747
6501
|
"folders",
|
|
6748
6502
|
"current-folder-id",
|
|
6749
6503
|
"onSelect"
|
|
6750
|
-
])) :
|
|
6504
|
+
])) : M("", !0)])) : M("", !0)])) : M("", !0), i("div", Do, [A(b).selectedItems.value.size > 0 ? (z(), t("button", {
|
|
6751
6505
|
key: 0,
|
|
6752
6506
|
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",
|
|
6753
6507
|
style: {
|
|
@@ -6755,20 +6509,20 @@ var Wa = {
|
|
|
6755
6509
|
color: "var(--tpl-danger)",
|
|
6756
6510
|
"background-color": "var(--tpl-danger-light)"
|
|
6757
6511
|
},
|
|
6758
|
-
onClick: n[16] ||= (...e) =>
|
|
6759
|
-
},
|
|
6512
|
+
onClick: n[16] ||= (...e) => A(x).handleDeleteClick && A(x).handleDeleteClick(...e)
|
|
6513
|
+
}, I(u.value.mediaLibrary.deleteSelected), 1)) : M("", !0), o.onSelect ? (z(), t("button", {
|
|
6760
6514
|
key: 1,
|
|
6761
6515
|
class: "tpl:cursor-pointer tpl:rounded-md tpl:px-4 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
|
|
6762
6516
|
style: {
|
|
6763
6517
|
"background-color": "var(--tpl-primary)",
|
|
6764
6518
|
color: "var(--tpl-bg)"
|
|
6765
6519
|
},
|
|
6766
|
-
disabled: !
|
|
6767
|
-
onClick:
|
|
6768
|
-
},
|
|
6520
|
+
disabled: !A(b).previewItem.value,
|
|
6521
|
+
onClick: C
|
|
6522
|
+
}, I(u.value.mediaLibrary.selectFile), 9, Oo)) : M("", !0)])])])
|
|
6769
6523
|
]));
|
|
6770
6524
|
}
|
|
6771
|
-
}),
|
|
6525
|
+
}), Ao = /* #__PURE__ */ Object.assign({
|
|
6772
6526
|
"./locales/ca.ts": () => import("./chunks/ca-DnghH5Xn.js"),
|
|
6773
6527
|
"./locales/de.ts": () => import("./chunks/de-ByQyu2jv.js"),
|
|
6774
6528
|
"./locales/en.ts": () => import("./chunks/en-B-xajqfh.js"),
|
|
@@ -6777,73 +6531,73 @@ var Wa = {
|
|
|
6777
6531
|
"./locales/nl.ts": () => import("./chunks/nl-DGT1t3Be.js"),
|
|
6778
6532
|
"./locales/pt-BR.ts": () => import("./chunks/pt-BR-C0Hzc26R.js")
|
|
6779
6533
|
});
|
|
6780
|
-
function
|
|
6534
|
+
function jo(e) {
|
|
6781
6535
|
return Object.keys(e).map((e) => e.match(/\/([^/]+)\.ts$/)?.[1]).filter((e) => !!e);
|
|
6782
6536
|
}
|
|
6783
|
-
var
|
|
6784
|
-
function
|
|
6537
|
+
var Mo = jo(Ao);
|
|
6538
|
+
function No(e) {
|
|
6785
6539
|
return e.trim().replace(/_/g, "-").toLowerCase();
|
|
6786
6540
|
}
|
|
6787
|
-
function
|
|
6788
|
-
let t =
|
|
6789
|
-
return
|
|
6541
|
+
function Po(e) {
|
|
6542
|
+
let t = No(e);
|
|
6543
|
+
return Mo.find((e) => No(e) === t);
|
|
6790
6544
|
}
|
|
6791
|
-
function
|
|
6792
|
-
return
|
|
6545
|
+
function Fo(e) {
|
|
6546
|
+
return No(e).split("-")[0];
|
|
6793
6547
|
}
|
|
6794
|
-
function
|
|
6795
|
-
return
|
|
6548
|
+
function Io(e) {
|
|
6549
|
+
return Po(e) ?? Po(Fo(e)) ?? "en";
|
|
6796
6550
|
}
|
|
6797
|
-
async function
|
|
6798
|
-
let t =
|
|
6551
|
+
async function Lo(e) {
|
|
6552
|
+
let t = Ao[`./locales/${Io(e)}.ts`];
|
|
6799
6553
|
return (await t()).default;
|
|
6800
6554
|
}
|
|
6801
6555
|
//#endregion
|
|
6802
6556
|
//#region src/standalone/visual.ts
|
|
6803
|
-
var
|
|
6804
|
-
async function
|
|
6557
|
+
var Ro = null, zo = e(null);
|
|
6558
|
+
async function Bo(e) {
|
|
6805
6559
|
let t = typeof e.container == "string" ? document.querySelector(e.container) : e.container;
|
|
6806
6560
|
if (!t) throw Error(`Container element not found: ${e.container}`);
|
|
6807
6561
|
let n = Ce(e.auth, e.onError);
|
|
6808
6562
|
await n.initialize();
|
|
6809
|
-
let r = await new ke(n).fetchConfig(), i = await
|
|
6810
|
-
return
|
|
6563
|
+
let r = await new ke(n).fetchConfig(), i = await Lo(e.locale ?? "en");
|
|
6564
|
+
return Ho(t, e.theme), Ro && Vo(), new Promise((a, s) => {
|
|
6811
6565
|
try {
|
|
6812
|
-
|
|
6566
|
+
Ro = be({ setup() {
|
|
6813
6567
|
let s = () => {
|
|
6814
6568
|
a({
|
|
6815
|
-
setTheme: (e) =>
|
|
6816
|
-
unmount:
|
|
6569
|
+
setTheme: (e) => Ho(t, e),
|
|
6570
|
+
unmount: Vo
|
|
6817
6571
|
});
|
|
6818
6572
|
};
|
|
6819
|
-
return () => o(
|
|
6573
|
+
return () => o(ko, {
|
|
6820
6574
|
authManager: n,
|
|
6821
6575
|
projectId: n.projectId,
|
|
6822
6576
|
planConfig: r,
|
|
6823
6577
|
translations: i,
|
|
6824
6578
|
onSelect: e.onSelect,
|
|
6825
6579
|
onError: e.onError,
|
|
6826
|
-
ref:
|
|
6580
|
+
ref: zo,
|
|
6827
6581
|
onReady: s
|
|
6828
6582
|
});
|
|
6829
|
-
} }),
|
|
6583
|
+
} }), Ro.mount(t);
|
|
6830
6584
|
} catch (e) {
|
|
6831
6585
|
s(e);
|
|
6832
6586
|
}
|
|
6833
6587
|
});
|
|
6834
6588
|
}
|
|
6835
|
-
function
|
|
6836
|
-
|
|
6589
|
+
function Vo() {
|
|
6590
|
+
Ro && (Ro.unmount(), Ro = null, zo.value = null);
|
|
6837
6591
|
}
|
|
6838
|
-
function
|
|
6592
|
+
function Ho(e, t) {
|
|
6839
6593
|
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`)));
|
|
6840
6594
|
}
|
|
6841
|
-
var
|
|
6842
|
-
init:
|
|
6843
|
-
unmount:
|
|
6595
|
+
var Uo = {
|
|
6596
|
+
init: Bo,
|
|
6597
|
+
unmount: Vo
|
|
6844
6598
|
};
|
|
6845
|
-
typeof window < "u" && (window.TemplaticalMedia =
|
|
6599
|
+
typeof window < "u" && (window.TemplaticalMedia = Uo);
|
|
6846
6600
|
//#endregion
|
|
6847
|
-
export {
|
|
6601
|
+
export { Uo as default, Bo as init, Vo as unmount };
|
|
6848
6602
|
|
|
6849
6603
|
//# sourceMappingURL=media-library.js.map
|