@feedmepos/mf-media 1.0.1-dev.4 → 1.0.2-dev.1
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/{AiStudio-866a5c97.js → AiStudio-2cced8ce.js} +56 -56
- package/dist/AssetLibrary-34e89cba.js +301 -0
- package/dist/app.js +49 -35
- package/dist/{media-picker-fdce9066.js → media-picker-1cd70533.js} +588 -567
- package/dist/src/app.d.ts +14 -0
- package/package.json +2 -2
- package/dist/AssetLibrary-2444af84.js +0 -271
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as be, resolveComponent as K, resolveDirective as ua, openBlock as y, createElementBlock as k, toDisplayString as x, unref as h, createElementVNode as b, normalizeStyle as
|
|
1
|
+
import { defineComponent as be, resolveComponent as K, resolveDirective as ua, openBlock as y, createElementBlock as k, toDisplayString as x, unref as h, createElementVNode as b, normalizeStyle as F, Fragment as Z, renderList as he, withDirectives as et, normalizeClass as ee, withModifiers as ct, createBlock as oe, createCommentVNode as j, createVNode as W, createTextVNode as ce, ref as G, withKeys as $a, vModelText as Ja, computed as z, withCtx as Se, onScopeDispose as Ha, watch as xe, mergeModels as yt, useModel as da } from "vue";
|
|
2
2
|
import { useI18n as ye, useCoreStore as Ka } from "@feedmepos/mf-common";
|
|
3
3
|
import { useDialog as Xa } from "@feedmepos/ui-library";
|
|
4
4
|
function ca(e, t) {
|
|
@@ -238,7 +238,7 @@ const Un = (e) => {
|
|
|
238
238
|
return n;
|
|
239
239
|
};
|
|
240
240
|
return a(e);
|
|
241
|
-
}, Ln = ge("AsyncFunction"),
|
|
241
|
+
}, Ln = ge("AsyncFunction"), Fn = (e) => e && (Ie(e) || se(e)) && se(e.then) && se(e.catch), ya = ((e, t) => e ? setImmediate : t ? ((a, n) => (Oe.addEventListener(
|
|
242
242
|
"message",
|
|
243
243
|
({ source: o, data: r }) => {
|
|
244
244
|
o === Oe && r === a && n.length && n.shift()();
|
|
@@ -246,7 +246,7 @@ const Un = (e) => {
|
|
|
246
246
|
!1
|
|
247
247
|
), (o) => {
|
|
248
248
|
n.push(o), Oe.postMessage(a, "*");
|
|
249
|
-
}))(`axios@${Math.random()}`, []) : (a) => setTimeout(a))(typeof setImmediate == "function", se(Oe.postMessage)),
|
|
249
|
+
}))(`axios@${Math.random()}`, []) : (a) => setTimeout(a))(typeof setImmediate == "function", se(Oe.postMessage)), jn = typeof queueMicrotask < "u" ? queueMicrotask.bind(Oe) : typeof process < "u" && process.nextTick || ya, va = (e) => e != null && se(e[qe]), zn = (e) => e != null && Ve(e, qe) && va(e), l = {
|
|
250
250
|
isArray: Ce,
|
|
251
251
|
isArrayBuffer: fa,
|
|
252
252
|
isBuffer: Ne,
|
|
@@ -305,9 +305,9 @@ const Un = (e) => {
|
|
|
305
305
|
isSpecCompliantForm: In,
|
|
306
306
|
toJSONObject: Un,
|
|
307
307
|
isAsyncFn: Ln,
|
|
308
|
-
isThenable:
|
|
308
|
+
isThenable: Fn,
|
|
309
309
|
setImmediate: ya,
|
|
310
|
-
asap:
|
|
310
|
+
asap: jn,
|
|
311
311
|
isIterable: va,
|
|
312
312
|
isSafeIterable: zn
|
|
313
313
|
}, Vn = l.toObjectSet([
|
|
@@ -415,8 +415,8 @@ class it {
|
|
|
415
415
|
const d = je(u);
|
|
416
416
|
if (!d)
|
|
417
417
|
return;
|
|
418
|
-
const
|
|
419
|
-
(!
|
|
418
|
+
const p = l.findKey(o, d);
|
|
419
|
+
(!p || o[p] === void 0 || c === !0 || c === void 0 && o[p] !== !1) && (o[p || u] = Qe(s));
|
|
420
420
|
}
|
|
421
421
|
const i = (s, u) => l.forEach(s, (c, d) => r(c, d, u));
|
|
422
422
|
if (l.isPlainObject(t) || t instanceof this.constructor)
|
|
@@ -549,7 +549,7 @@ l.reduceDescriptors(it.prototype, ({ value: e }, t) => {
|
|
|
549
549
|
};
|
|
550
550
|
});
|
|
551
551
|
l.freezeMethods(it);
|
|
552
|
-
const
|
|
552
|
+
const pe = it, Zn = "[REDACTED ****]";
|
|
553
553
|
function eo(e) {
|
|
554
554
|
if (l.hasOwnProp(e, "toJSON"))
|
|
555
555
|
return !0;
|
|
@@ -567,7 +567,7 @@ function to(e, t) {
|
|
|
567
567
|
return r;
|
|
568
568
|
if (n.indexOf(r) !== -1)
|
|
569
569
|
return;
|
|
570
|
-
r instanceof
|
|
570
|
+
r instanceof pe && (r = r.toJSON()), n.push(r);
|
|
571
571
|
let i;
|
|
572
572
|
if (l.isArray(r))
|
|
573
573
|
i = [], r.forEach((s, u) => {
|
|
@@ -684,43 +684,43 @@ function st(e, t, a) {
|
|
|
684
684
|
indexes: !1
|
|
685
685
|
},
|
|
686
686
|
!1,
|
|
687
|
-
function(
|
|
688
|
-
return !l.isUndefined(v[
|
|
687
|
+
function(f, v) {
|
|
688
|
+
return !l.isUndefined(v[f]);
|
|
689
689
|
}
|
|
690
690
|
);
|
|
691
691
|
const n = a.metaTokens, o = a.visitor || P, r = a.dots, i = a.indexes, s = a.Blob || typeof Blob < "u" && Blob, u = a.maxDepth === void 0 ? ka : a.maxDepth, c = s && l.isSpecCompliantForm(t), d = [];
|
|
692
692
|
if (!l.isFunction(o))
|
|
693
693
|
throw new TypeError("visitor must be a function");
|
|
694
|
-
function f
|
|
695
|
-
if (
|
|
694
|
+
function p(f) {
|
|
695
|
+
if (f === null)
|
|
696
696
|
return "";
|
|
697
|
-
if (l.isDate(
|
|
698
|
-
return
|
|
699
|
-
if (l.isBoolean(
|
|
700
|
-
return
|
|
701
|
-
if (!c && l.isBlob(
|
|
697
|
+
if (l.isDate(f))
|
|
698
|
+
return f.toISOString();
|
|
699
|
+
if (l.isBoolean(f))
|
|
700
|
+
return f.toString();
|
|
701
|
+
if (!c && l.isBlob(f))
|
|
702
702
|
throw new T("Blob is not supported. Use a Buffer instead.");
|
|
703
|
-
if (l.isArrayBuffer(
|
|
703
|
+
if (l.isArrayBuffer(f) || l.isTypedArray(f)) {
|
|
704
704
|
if (c && typeof s == "function")
|
|
705
|
-
return new s([
|
|
705
|
+
return new s([f]);
|
|
706
706
|
if (typeof Buffer < "u")
|
|
707
|
-
return Buffer.from(
|
|
707
|
+
return Buffer.from(f);
|
|
708
708
|
throw new T("Blob is not supported. Use a Buffer instead.", T.ERR_NOT_SUPPORT);
|
|
709
709
|
}
|
|
710
|
-
return
|
|
710
|
+
return f;
|
|
711
711
|
}
|
|
712
|
-
function w(
|
|
713
|
-
if (
|
|
712
|
+
function w(f) {
|
|
713
|
+
if (f > u)
|
|
714
714
|
throw new T(
|
|
715
|
-
"Object is too deeply nested (" +
|
|
715
|
+
"Object is too deeply nested (" + f + " levels). Max depth: " + u,
|
|
716
716
|
T.ERR_FORM_DATA_DEPTH_EXCEEDED
|
|
717
717
|
);
|
|
718
718
|
}
|
|
719
|
-
function _(
|
|
719
|
+
function _(f, v) {
|
|
720
720
|
if (u === 1 / 0)
|
|
721
|
-
return JSON.stringify(
|
|
721
|
+
return JSON.stringify(f);
|
|
722
722
|
const C = [];
|
|
723
|
-
return JSON.stringify(
|
|
723
|
+
return JSON.stringify(f, function(A, V) {
|
|
724
724
|
if (!l.isObject(V))
|
|
725
725
|
return V;
|
|
726
726
|
for (; C.length && C[C.length - 1] !== this; )
|
|
@@ -728,34 +728,34 @@ function st(e, t, a) {
|
|
|
728
728
|
return C.push(V), w(v + C.length - 1), V;
|
|
729
729
|
});
|
|
730
730
|
}
|
|
731
|
-
function P(
|
|
732
|
-
let A =
|
|
733
|
-
if (l.isReactNative(t) && l.isReactNativeBlob(
|
|
734
|
-
return t.append(ft(C, v, r), f
|
|
735
|
-
if (
|
|
731
|
+
function P(f, v, C) {
|
|
732
|
+
let A = f;
|
|
733
|
+
if (l.isReactNative(t) && l.isReactNativeBlob(f))
|
|
734
|
+
return t.append(ft(C, v, r), p(f)), !1;
|
|
735
|
+
if (f && !C && typeof f == "object") {
|
|
736
736
|
if (l.endsWith(v, "{}"))
|
|
737
|
-
v = n ? v : v.slice(0, -2),
|
|
738
|
-
else if (l.isArray(
|
|
737
|
+
v = n ? v : v.slice(0, -2), f = _(f, 1);
|
|
738
|
+
else if (l.isArray(f) && no(f) || (l.isFileList(f) || l.endsWith(v, "[]")) && (A = l.toArray(f)))
|
|
739
739
|
return v = xa(v), A.forEach(function(V, Q) {
|
|
740
740
|
!(l.isUndefined(V) || V === null) && t.append(
|
|
741
741
|
// eslint-disable-next-line no-nested-ternary
|
|
742
742
|
i === !0 ? ft([v], Q, r) : i === null ? v : v + "[]",
|
|
743
|
-
|
|
743
|
+
p(V)
|
|
744
744
|
);
|
|
745
745
|
}), !1;
|
|
746
746
|
}
|
|
747
|
-
return wt(
|
|
747
|
+
return wt(f) ? !0 : (t.append(ft(C, v, r), p(f)), !1);
|
|
748
748
|
}
|
|
749
749
|
const E = Object.assign(oo, {
|
|
750
750
|
defaultVisitor: P,
|
|
751
|
-
convertValue:
|
|
751
|
+
convertValue: p,
|
|
752
752
|
isVisitable: wt
|
|
753
753
|
});
|
|
754
|
-
function R(
|
|
755
|
-
if (!l.isUndefined(
|
|
756
|
-
if (w(C), d.indexOf(
|
|
754
|
+
function R(f, v, C = 0) {
|
|
755
|
+
if (!l.isUndefined(f)) {
|
|
756
|
+
if (w(C), d.indexOf(f) !== -1)
|
|
757
757
|
throw new Error("Circular reference detected in " + v.join("."));
|
|
758
|
-
d.push(
|
|
758
|
+
d.push(f), l.forEach(f, function(A, V) {
|
|
759
759
|
(!(l.isUndefined(A) || A === null) && o.call(t, A, l.isString(V) ? V.trim() : V, v, E)) === !0 && R(A, v ? v.concat(V) : [V], C + 1);
|
|
760
760
|
}), d.pop();
|
|
761
761
|
}
|
|
@@ -1025,7 +1025,7 @@ l.forEach(["delete", "get", "head", "post", "put", "patch", "query"], (e) => {
|
|
|
1025
1025
|
});
|
|
1026
1026
|
const Ct = Ot;
|
|
1027
1027
|
function mt(e, t) {
|
|
1028
|
-
const a = this || Ct, n = t || a, o =
|
|
1028
|
+
const a = this || Ct, n = t || a, o = pe.from(n.headers);
|
|
1029
1029
|
let r = n.data;
|
|
1030
1030
|
return l.forEach(e, function(i) {
|
|
1031
1031
|
r = i.call(a, r, o.normalize(), t ? t.status : void 0);
|
|
@@ -1070,13 +1070,13 @@ function xo(e, t) {
|
|
|
1070
1070
|
return t = t !== void 0 ? t : 1e3, function(s) {
|
|
1071
1071
|
const u = Date.now(), c = n[r];
|
|
1072
1072
|
i || (i = u), a[o] = s, n[o] = u;
|
|
1073
|
-
let d = r,
|
|
1073
|
+
let d = r, p = 0;
|
|
1074
1074
|
for (; d !== o; )
|
|
1075
|
-
|
|
1075
|
+
p += a[d++], d = d % e;
|
|
1076
1076
|
if (o = (o + 1) % e, o === r && (r = (r + 1) % e), u - i < t)
|
|
1077
1077
|
return;
|
|
1078
1078
|
const w = c && u - c;
|
|
1079
|
-
return w ? Math.round(
|
|
1079
|
+
return w ? Math.round(p * 1e3 / w) : void 0;
|
|
1080
1080
|
};
|
|
1081
1081
|
}
|
|
1082
1082
|
function Po(e, t) {
|
|
@@ -1099,7 +1099,7 @@ const at = (e, t, a = 3) => {
|
|
|
1099
1099
|
return;
|
|
1100
1100
|
const i = r.loaded, s = r.lengthComputable ? r.total : void 0, u = s != null ? Math.min(i, s) : i, c = Math.max(0, u - n), d = o(c);
|
|
1101
1101
|
n = Math.max(n, u);
|
|
1102
|
-
const
|
|
1102
|
+
const p = {
|
|
1103
1103
|
loaded: u,
|
|
1104
1104
|
total: s,
|
|
1105
1105
|
progress: s ? u / s : void 0,
|
|
@@ -1110,7 +1110,7 @@ const at = (e, t, a = 3) => {
|
|
|
1110
1110
|
lengthComputable: s != null,
|
|
1111
1111
|
[t ? "download" : "upload"]: !0
|
|
1112
1112
|
};
|
|
1113
|
-
e(
|
|
1113
|
+
e(p);
|
|
1114
1114
|
}, a);
|
|
1115
1115
|
}, Kt = (e, t) => {
|
|
1116
1116
|
const a = e != null;
|
|
@@ -1194,7 +1194,7 @@ function Ca(e, t, a, n) {
|
|
|
1194
1194
|
let o = !So(t);
|
|
1195
1195
|
return e && (o || a === !1) ? (Qt(e, n), To(e, t)) : t;
|
|
1196
1196
|
}
|
|
1197
|
-
const Yt = (e) => e instanceof
|
|
1197
|
+
const Yt = (e) => e instanceof pe ? { ...e } : e;
|
|
1198
1198
|
function Ae(e, t) {
|
|
1199
1199
|
e = e || {}, t = t || {};
|
|
1200
1200
|
const a = /* @__PURE__ */ Object.create(null);
|
|
@@ -1207,42 +1207,42 @@ function Ae(e, t) {
|
|
|
1207
1207
|
writable: !0,
|
|
1208
1208
|
configurable: !0
|
|
1209
1209
|
});
|
|
1210
|
-
function n(d,
|
|
1211
|
-
return l.isPlainObject(d) && l.isPlainObject(
|
|
1210
|
+
function n(d, p, w, _) {
|
|
1211
|
+
return l.isPlainObject(d) && l.isPlainObject(p) ? l.merge.call({ caseless: _ }, d, p) : l.isPlainObject(p) ? l.merge({}, p) : l.isArray(p) ? p.slice() : p;
|
|
1212
1212
|
}
|
|
1213
|
-
function o(d,
|
|
1214
|
-
if (l.isUndefined(
|
|
1213
|
+
function o(d, p, w, _) {
|
|
1214
|
+
if (l.isUndefined(p)) {
|
|
1215
1215
|
if (!l.isUndefined(d))
|
|
1216
1216
|
return n(void 0, d, w, _);
|
|
1217
1217
|
} else
|
|
1218
|
-
return n(d,
|
|
1218
|
+
return n(d, p, w, _);
|
|
1219
1219
|
}
|
|
1220
|
-
function r(d,
|
|
1221
|
-
if (!l.isUndefined(
|
|
1222
|
-
return n(void 0,
|
|
1220
|
+
function r(d, p) {
|
|
1221
|
+
if (!l.isUndefined(p))
|
|
1222
|
+
return n(void 0, p);
|
|
1223
1223
|
}
|
|
1224
|
-
function i(d,
|
|
1225
|
-
if (l.isUndefined(
|
|
1224
|
+
function i(d, p) {
|
|
1225
|
+
if (l.isUndefined(p)) {
|
|
1226
1226
|
if (!l.isUndefined(d))
|
|
1227
1227
|
return n(void 0, d);
|
|
1228
1228
|
} else
|
|
1229
|
-
return n(void 0,
|
|
1229
|
+
return n(void 0, p);
|
|
1230
1230
|
}
|
|
1231
1231
|
function s(d) {
|
|
1232
|
-
const
|
|
1233
|
-
if (!l.isUndefined(
|
|
1234
|
-
if (l.isPlainObject(
|
|
1235
|
-
if (l.hasOwnProp(
|
|
1236
|
-
return
|
|
1232
|
+
const p = l.hasOwnProp(t, "transitional") ? t.transitional : void 0;
|
|
1233
|
+
if (!l.isUndefined(p))
|
|
1234
|
+
if (l.isPlainObject(p)) {
|
|
1235
|
+
if (l.hasOwnProp(p, d))
|
|
1236
|
+
return p[d];
|
|
1237
1237
|
} else
|
|
1238
1238
|
return;
|
|
1239
1239
|
const w = l.hasOwnProp(e, "transitional") ? e.transitional : void 0;
|
|
1240
1240
|
if (l.isPlainObject(w) && l.hasOwnProp(w, d))
|
|
1241
1241
|
return w[d];
|
|
1242
1242
|
}
|
|
1243
|
-
function u(d,
|
|
1243
|
+
function u(d, p, w) {
|
|
1244
1244
|
if (l.hasOwnProp(t, w))
|
|
1245
|
-
return n(d,
|
|
1245
|
+
return n(d, p);
|
|
1246
1246
|
if (l.hasOwnProp(e, w))
|
|
1247
1247
|
return n(void 0, d);
|
|
1248
1248
|
}
|
|
@@ -1276,13 +1276,13 @@ function Ae(e, t) {
|
|
|
1276
1276
|
allowedSocketPaths: i,
|
|
1277
1277
|
responseEncoding: i,
|
|
1278
1278
|
validateStatus: u,
|
|
1279
|
-
headers: (d,
|
|
1279
|
+
headers: (d, p, w) => o(Yt(d), Yt(p), w, !0)
|
|
1280
1280
|
};
|
|
1281
1281
|
return l.forEach(Object.keys({ ...e, ...t }), function(d) {
|
|
1282
1282
|
if (d === "__proto__" || d === "constructor" || d === "prototype")
|
|
1283
1283
|
return;
|
|
1284
|
-
const
|
|
1285
|
-
l.isUndefined(P) &&
|
|
1284
|
+
const p = l.hasOwnProp(c, d) ? c[d] : o, w = l.hasOwnProp(e, d) ? e[d] : void 0, _ = l.hasOwnProp(t, d) ? t[d] : void 0, P = p(w, _, d);
|
|
1285
|
+
l.isUndefined(P) && p !== u || (a[d] = P);
|
|
1286
1286
|
}), l.hasOwnProp(t, "validateStatus") && l.isUndefined(t.validateStatus) && s("validateStatusUndefinedResolves") === !1 && (l.hasOwnProp(e, "validateStatus") ? a.validateStatus = n(void 0, e.validateStatus) : delete a.validateStatus), a;
|
|
1287
1287
|
}
|
|
1288
1288
|
const _o = ["content-type", "content-length"];
|
|
@@ -1304,9 +1304,9 @@ function Aa(e) {
|
|
|
1304
1304
|
let o = a("withXSRFToken");
|
|
1305
1305
|
const r = a("xsrfHeaderName"), i = a("xsrfCookieName");
|
|
1306
1306
|
let s = a("headers");
|
|
1307
|
-
const u = a("auth"), c = a("baseURL"), d = a("allowAbsoluteUrls"),
|
|
1308
|
-
if (t.headers = s =
|
|
1309
|
-
Ca(c,
|
|
1307
|
+
const u = a("auth"), c = a("baseURL"), d = a("allowAbsoluteUrls"), p = a("url");
|
|
1308
|
+
if (t.headers = s = pe.from(s), t.url = Ea(
|
|
1309
|
+
Ca(c, p, d, t),
|
|
1310
1310
|
a("params"),
|
|
1311
1311
|
a("paramsSerializer")
|
|
1312
1312
|
), u) {
|
|
@@ -1330,8 +1330,8 @@ const No = typeof XMLHttpRequest < "u", Io = No && function(e) {
|
|
|
1330
1330
|
return new Promise(function(t, a) {
|
|
1331
1331
|
const n = Aa(e);
|
|
1332
1332
|
let o = n.data;
|
|
1333
|
-
const r =
|
|
1334
|
-
let { responseType: i, onUploadProgress: s, onDownloadProgress: u } = n, c, d,
|
|
1333
|
+
const r = pe.from(n.headers).normalize();
|
|
1334
|
+
let { responseType: i, onUploadProgress: s, onDownloadProgress: u } = n, c, d, p, w, _;
|
|
1335
1335
|
function P() {
|
|
1336
1336
|
w && w(), _ && _(), n.cancelToken && n.cancelToken.unsubscribe(c), n.signal && n.signal.removeEventListener("abort", c);
|
|
1337
1337
|
}
|
|
@@ -1340,7 +1340,7 @@ const No = typeof XMLHttpRequest < "u", Io = No && function(e) {
|
|
|
1340
1340
|
function R() {
|
|
1341
1341
|
if (!E)
|
|
1342
1342
|
return;
|
|
1343
|
-
const v =
|
|
1343
|
+
const v = pe.from(
|
|
1344
1344
|
"getAllResponseHeaders" in E && E.getAllResponseHeaders()
|
|
1345
1345
|
), C = {
|
|
1346
1346
|
data: !i || i === "text" || i === "json" ? E.responseText : E.response,
|
|
@@ -1380,14 +1380,14 @@ const No = typeof XMLHttpRequest < "u", Io = No && function(e) {
|
|
|
1380
1380
|
), P(), E = null;
|
|
1381
1381
|
}, o === void 0 && r.setContentType(null), "setRequestHeader" in E && l.forEach(wa(r), function(v, C) {
|
|
1382
1382
|
E.setRequestHeader(C, v);
|
|
1383
|
-
}), l.isUndefined(n.withCredentials) || (E.withCredentials = !!n.withCredentials), i && i !== "json" && (E.responseType = n.responseType), u && ([
|
|
1383
|
+
}), l.isUndefined(n.withCredentials) || (E.withCredentials = !!n.withCredentials), i && i !== "json" && (E.responseType = n.responseType), u && ([p, _] = at(u, !0), E.addEventListener("progress", p)), s && E.upload && ([d, w] = at(s), E.upload.addEventListener("progress", d), E.upload.addEventListener("loadend", w)), (n.cancelToken || n.signal) && (c = (v) => {
|
|
1384
1384
|
E && (a(!v || v.type ? new Ge(null, e, E) : v), E.abort(), P(), E = null);
|
|
1385
1385
|
}, n.cancelToken && n.cancelToken.subscribe(c), n.signal && (n.signal.aborted ? c() : n.signal.addEventListener("abort", c)));
|
|
1386
|
-
const
|
|
1387
|
-
if (
|
|
1386
|
+
const f = ko(n.url);
|
|
1387
|
+
if (f && !te.protocols.includes(f)) {
|
|
1388
1388
|
a(
|
|
1389
1389
|
new T(
|
|
1390
|
-
"Unsupported protocol " +
|
|
1390
|
+
"Unsupported protocol " + f + ":",
|
|
1391
1391
|
T.ERR_BAD_REQUEST,
|
|
1392
1392
|
e
|
|
1393
1393
|
)
|
|
@@ -1421,7 +1421,7 @@ const No = typeof XMLHttpRequest < "u", Io = No && function(e) {
|
|
|
1421
1421
|
e.forEach((u) => u.addEventListener("abort", o, { once: !0 }));
|
|
1422
1422
|
const { signal: s } = a;
|
|
1423
1423
|
return s.unsubscribe = () => l.asap(i), s;
|
|
1424
|
-
}, Lo = Uo,
|
|
1424
|
+
}, Lo = Uo, Fo = function* (e, t) {
|
|
1425
1425
|
let a = e.byteLength;
|
|
1426
1426
|
if (!t || a < t) {
|
|
1427
1427
|
yield e;
|
|
@@ -1430,9 +1430,9 @@ const No = typeof XMLHttpRequest < "u", Io = No && function(e) {
|
|
|
1430
1430
|
let n = 0, o;
|
|
1431
1431
|
for (; n < a; )
|
|
1432
1432
|
o = n + t, yield e.slice(n, o), n = o;
|
|
1433
|
-
},
|
|
1433
|
+
}, jo = async function* (e, t) {
|
|
1434
1434
|
for await (const a of zo(e))
|
|
1435
|
-
yield*
|
|
1435
|
+
yield* Fo(a, t);
|
|
1436
1436
|
}, zo = async function* (e) {
|
|
1437
1437
|
if (e[Symbol.asyncIterator]) {
|
|
1438
1438
|
yield* e;
|
|
@@ -1450,7 +1450,7 @@ const No = typeof XMLHttpRequest < "u", Io = No && function(e) {
|
|
|
1450
1450
|
await t.cancel();
|
|
1451
1451
|
}
|
|
1452
1452
|
}, Zt = (e, t, a, n) => {
|
|
1453
|
-
const o =
|
|
1453
|
+
const o = jo(e, t);
|
|
1454
1454
|
let r = 0, i, s = (u) => {
|
|
1455
1455
|
i || (i = !0, n && n(u));
|
|
1456
1456
|
};
|
|
@@ -1463,9 +1463,9 @@ const No = typeof XMLHttpRequest < "u", Io = No && function(e) {
|
|
|
1463
1463
|
s(), u.close();
|
|
1464
1464
|
return;
|
|
1465
1465
|
}
|
|
1466
|
-
let
|
|
1466
|
+
let p = d.byteLength;
|
|
1467
1467
|
if (a) {
|
|
1468
|
-
let w = r +=
|
|
1468
|
+
let w = r += p;
|
|
1469
1469
|
a(w);
|
|
1470
1470
|
}
|
|
1471
1471
|
u.enqueue(new Uint8Array(d));
|
|
@@ -1492,15 +1492,15 @@ function qo(e) {
|
|
|
1492
1492
|
if (/;base64/i.test(a)) {
|
|
1493
1493
|
let r = n.length;
|
|
1494
1494
|
const i = n.length;
|
|
1495
|
-
for (let
|
|
1496
|
-
if (n.charCodeAt(
|
|
1497
|
-
const w = n.charCodeAt(
|
|
1498
|
-
nt(w) && nt(_) && (r -= 2,
|
|
1495
|
+
for (let p = 0; p < i; p++)
|
|
1496
|
+
if (n.charCodeAt(p) === 37 && p + 2 < i) {
|
|
1497
|
+
const w = n.charCodeAt(p + 1), _ = n.charCodeAt(p + 2);
|
|
1498
|
+
nt(w) && nt(_) && (r -= 2, p += 2);
|
|
1499
1499
|
}
|
|
1500
1500
|
let s = 0, u = i - 1;
|
|
1501
|
-
const c = (
|
|
1502
|
-
n.charCodeAt(
|
|
1503
|
-
(n.charCodeAt(
|
|
1501
|
+
const c = (p) => p >= 2 && n.charCodeAt(p - 2) === 37 && // '%'
|
|
1502
|
+
n.charCodeAt(p - 1) === 51 && // '3'
|
|
1503
|
+
(n.charCodeAt(p) === 68 || n.charCodeAt(p) === 100);
|
|
1504
1504
|
u >= 0 && (n.charCodeAt(u) === 61 ? (s++, u--) : c(u) && (s++, u -= 3)), s === 1 && u >= 0 && (n.charCodeAt(u) === 61 || c(u)) && s++;
|
|
1505
1505
|
const d = Math.floor(r / 4) * 3 - (s || 0);
|
|
1506
1506
|
return d > 0 ? d : 0;
|
|
@@ -1522,7 +1522,7 @@ function qo(e) {
|
|
|
1522
1522
|
}
|
|
1523
1523
|
return o;
|
|
1524
1524
|
}
|
|
1525
|
-
const At = "1.18.1", ea = 64 * 1024, { isFunction:
|
|
1525
|
+
const At = "1.18.1", ea = 64 * 1024, { isFunction: He } = l, Wo = (e) => encodeURIComponent(e).replace(
|
|
1526
1526
|
/%([0-9A-F]{2})/gi,
|
|
1527
1527
|
(t, a) => String.fromCharCode(parseInt(a, 16))
|
|
1528
1528
|
), ta = (e) => {
|
|
@@ -1555,50 +1555,50 @@ const At = "1.18.1", ea = 64 * 1024, { isFunction: Ke } = l, Wo = (e) => encodeU
|
|
|
1555
1555
|
},
|
|
1556
1556
|
e
|
|
1557
1557
|
);
|
|
1558
|
-
const { fetch: o, Request: r, Response: i } = e, s = o ?
|
|
1558
|
+
const { fetch: o, Request: r, Response: i } = e, s = o ? He(o) : typeof fetch == "function", u = He(r), c = He(i);
|
|
1559
1559
|
if (!s)
|
|
1560
1560
|
return !1;
|
|
1561
|
-
const d = s &&
|
|
1562
|
-
let
|
|
1561
|
+
const d = s && He(a), p = s && (typeof n == "function" ? ((f) => (v) => f.encode(v))(new n()) : async (f) => new Uint8Array(await new r(f).arrayBuffer())), w = u && d && aa(() => {
|
|
1562
|
+
let f = !1;
|
|
1563
1563
|
const v = new r(te.origin, {
|
|
1564
1564
|
body: new a(),
|
|
1565
1565
|
method: "POST",
|
|
1566
1566
|
get duplex() {
|
|
1567
|
-
return
|
|
1567
|
+
return f = !0, "half";
|
|
1568
1568
|
}
|
|
1569
1569
|
}), C = v.headers.has("Content-Type");
|
|
1570
|
-
return v.body != null && v.body.cancel(),
|
|
1570
|
+
return v.body != null && v.body.cancel(), f && !C;
|
|
1571
1571
|
}), _ = c && d && aa(() => l.isReadableStream(new i("").body)), P = {
|
|
1572
|
-
stream: _ && ((
|
|
1572
|
+
stream: _ && ((f) => f.body)
|
|
1573
1573
|
};
|
|
1574
|
-
s && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((
|
|
1575
|
-
!P[
|
|
1576
|
-
let A = v && v[
|
|
1574
|
+
s && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((f) => {
|
|
1575
|
+
!P[f] && (P[f] = (v, C) => {
|
|
1576
|
+
let A = v && v[f];
|
|
1577
1577
|
if (A)
|
|
1578
1578
|
return A.call(v);
|
|
1579
1579
|
throw new T(
|
|
1580
|
-
`Response type '${
|
|
1580
|
+
`Response type '${f}' is not supported`,
|
|
1581
1581
|
T.ERR_NOT_SUPPORT,
|
|
1582
1582
|
C
|
|
1583
1583
|
);
|
|
1584
1584
|
});
|
|
1585
1585
|
});
|
|
1586
|
-
const E = async (
|
|
1587
|
-
if (
|
|
1586
|
+
const E = async (f) => {
|
|
1587
|
+
if (f == null)
|
|
1588
1588
|
return 0;
|
|
1589
|
-
if (l.isBlob(
|
|
1590
|
-
return
|
|
1591
|
-
if (l.isSpecCompliantForm(
|
|
1589
|
+
if (l.isBlob(f))
|
|
1590
|
+
return f.size;
|
|
1591
|
+
if (l.isSpecCompliantForm(f))
|
|
1592
1592
|
return (await new r(te.origin, {
|
|
1593
1593
|
method: "POST",
|
|
1594
|
-
body:
|
|
1594
|
+
body: f
|
|
1595
1595
|
}).arrayBuffer()).byteLength;
|
|
1596
|
-
if (l.isArrayBufferView(
|
|
1597
|
-
return
|
|
1598
|
-
if (l.isURLSearchParams(
|
|
1599
|
-
return (await f
|
|
1600
|
-
}, R = async (
|
|
1601
|
-
return async (
|
|
1596
|
+
if (l.isArrayBufferView(f) || l.isArrayBuffer(f))
|
|
1597
|
+
return f.byteLength;
|
|
1598
|
+
if (l.isURLSearchParams(f) && (f = f + ""), l.isString(f))
|
|
1599
|
+
return (await p(f)).byteLength;
|
|
1600
|
+
}, R = async (f, v) => l.toFiniteNumber(f.getContentLength()) ?? E(v);
|
|
1601
|
+
return async (f) => {
|
|
1602
1602
|
let {
|
|
1603
1603
|
url: v,
|
|
1604
1604
|
method: C,
|
|
@@ -1610,12 +1610,12 @@ const At = "1.18.1", ea = 64 * 1024, { isFunction: Ke } = l, Wo = (e) => encodeU
|
|
|
1610
1610
|
onUploadProgress: O,
|
|
1611
1611
|
responseType: N,
|
|
1612
1612
|
headers: J,
|
|
1613
|
-
withCredentials:
|
|
1613
|
+
withCredentials: ue = "same-origin",
|
|
1614
1614
|
fetchOptions: H,
|
|
1615
1615
|
maxContentLength: Y,
|
|
1616
1616
|
maxBodyLength: m
|
|
1617
|
-
} = Aa(
|
|
1618
|
-
const g = l.isNumber(Y) && Y > -1, L = l.isNumber(m) && m > -1, U = (q) => l.hasOwnProp(
|
|
1617
|
+
} = Aa(f);
|
|
1618
|
+
const g = l.isNumber(Y) && Y > -1, L = l.isNumber(m) && m > -1, U = (q) => l.hasOwnProp(f, q) ? f[q] : void 0;
|
|
1619
1619
|
let B = o || fetch;
|
|
1620
1620
|
N = N ? (N + "").toLowerCase() : "text";
|
|
1621
1621
|
let M = Lo(
|
|
@@ -1625,29 +1625,29 @@ const At = "1.18.1", ea = 64 * 1024, { isFunction: Ke } = l, Wo = (e) => encodeU
|
|
|
1625
1625
|
const ie = M && M.unsubscribe && (() => {
|
|
1626
1626
|
M.unsubscribe();
|
|
1627
1627
|
});
|
|
1628
|
-
let Pe,
|
|
1628
|
+
let Pe, Le = null;
|
|
1629
1629
|
const Lt = () => new T(
|
|
1630
1630
|
"Request body larger than maxBodyLength limit",
|
|
1631
1631
|
T.ERR_BAD_REQUEST,
|
|
1632
|
-
|
|
1632
|
+
f,
|
|
1633
1633
|
I
|
|
1634
1634
|
);
|
|
1635
1635
|
try {
|
|
1636
1636
|
let q;
|
|
1637
1637
|
const fe = U("auth");
|
|
1638
1638
|
if (fe) {
|
|
1639
|
-
const D = l.getSafeProp(fe, "username") || "",
|
|
1639
|
+
const D = l.getSafeProp(fe, "username") || "", de = l.getSafeProp(fe, "password") || "";
|
|
1640
1640
|
q = {
|
|
1641
1641
|
username: D,
|
|
1642
|
-
password:
|
|
1642
|
+
password: de
|
|
1643
1643
|
};
|
|
1644
1644
|
}
|
|
1645
1645
|
if (Go(v)) {
|
|
1646
1646
|
const D = new URL(v, te.origin);
|
|
1647
1647
|
if (!q && (D.username || D.password)) {
|
|
1648
|
-
const
|
|
1648
|
+
const de = ta(D.username), Ee = ta(D.password);
|
|
1649
1649
|
q = {
|
|
1650
|
-
username:
|
|
1650
|
+
username: de,
|
|
1651
1651
|
password: Ee
|
|
1652
1652
|
};
|
|
1653
1653
|
}
|
|
@@ -1660,7 +1660,7 @@ const At = "1.18.1", ea = 64 * 1024, { isFunction: Ke } = l, Wo = (e) => encodeU
|
|
|
1660
1660
|
throw new T(
|
|
1661
1661
|
"maxContentLength size of " + Y + " exceeded",
|
|
1662
1662
|
T.ERR_BAD_RESPONSE,
|
|
1663
|
-
|
|
1663
|
+
f,
|
|
1664
1664
|
I
|
|
1665
1665
|
);
|
|
1666
1666
|
if (L && C !== "get" && C !== "head") {
|
|
@@ -1668,89 +1668,89 @@ const At = "1.18.1", ea = 64 * 1024, { isFunction: Ke } = l, Wo = (e) => encodeU
|
|
|
1668
1668
|
if (typeof D == "number" && isFinite(D) && (Pe = D, D > m))
|
|
1669
1669
|
throw Lt();
|
|
1670
1670
|
}
|
|
1671
|
-
const
|
|
1671
|
+
const Je = L && (l.isReadableStream(A) || l.isStream(A)), Ft = (D, de, Ee) => Zt(
|
|
1672
1672
|
D,
|
|
1673
1673
|
ea,
|
|
1674
1674
|
(Te) => {
|
|
1675
1675
|
if (L && Te > m)
|
|
1676
|
-
throw
|
|
1677
|
-
|
|
1676
|
+
throw Le = Lt();
|
|
1677
|
+
de && de(Te);
|
|
1678
1678
|
},
|
|
1679
1679
|
Ee
|
|
1680
1680
|
);
|
|
1681
|
-
if (w && C !== "get" && C !== "head" && (O ||
|
|
1682
|
-
if (Pe = Pe ?? await R(J, A), Pe !== 0 ||
|
|
1681
|
+
if (w && C !== "get" && C !== "head" && (O || Je)) {
|
|
1682
|
+
if (Pe = Pe ?? await R(J, A), Pe !== 0 || Je) {
|
|
1683
1683
|
let D = new r(v, {
|
|
1684
1684
|
method: "POST",
|
|
1685
1685
|
body: A,
|
|
1686
1686
|
duplex: "half"
|
|
1687
|
-
}),
|
|
1688
|
-
if (l.isFormData(A) && (
|
|
1687
|
+
}), de;
|
|
1688
|
+
if (l.isFormData(A) && (de = D.headers.get("content-type")) && J.setContentType(de), D.body) {
|
|
1689
1689
|
const [Ee, Te] = O && Kt(
|
|
1690
1690
|
Pe,
|
|
1691
1691
|
at(Xt(O))
|
|
1692
1692
|
) || [];
|
|
1693
|
-
A =
|
|
1693
|
+
A = Ft(D.body, Ee, Te);
|
|
1694
1694
|
}
|
|
1695
1695
|
}
|
|
1696
|
-
} else if (
|
|
1697
|
-
A =
|
|
1698
|
-
else if (
|
|
1696
|
+
} else if (Je && !u && d && C !== "get" && C !== "head")
|
|
1697
|
+
A = Ft(A);
|
|
1698
|
+
else if (Je && u && !w && C !== "get" && C !== "head")
|
|
1699
1699
|
throw new T(
|
|
1700
1700
|
"Stream request bodies are not supported by the current fetch implementation",
|
|
1701
1701
|
T.ERR_NOT_SUPPORT,
|
|
1702
|
-
|
|
1702
|
+
f,
|
|
1703
1703
|
I
|
|
1704
1704
|
);
|
|
1705
|
-
l.isString(
|
|
1705
|
+
l.isString(ue) || (ue = ue ? "include" : "omit");
|
|
1706
1706
|
const Wa = u && "credentials" in r.prototype;
|
|
1707
1707
|
if (l.isFormData(A)) {
|
|
1708
1708
|
const D = J.getContentType();
|
|
1709
1709
|
D && /^multipart\/form-data/i.test(D) && !/boundary=/i.test(D) && J.delete("content-type");
|
|
1710
1710
|
}
|
|
1711
1711
|
J.set("User-Agent", "axios/" + At, !1);
|
|
1712
|
-
const
|
|
1712
|
+
const jt = {
|
|
1713
1713
|
...H,
|
|
1714
1714
|
signal: M,
|
|
1715
1715
|
method: C.toUpperCase(),
|
|
1716
1716
|
headers: wa(J.normalize()),
|
|
1717
1717
|
body: A,
|
|
1718
1718
|
duplex: "half",
|
|
1719
|
-
credentials: Wa ?
|
|
1719
|
+
credentials: Wa ? ue : void 0
|
|
1720
1720
|
};
|
|
1721
|
-
I = u && new r(v,
|
|
1722
|
-
let we = await (u ? B(I, H) : B(v,
|
|
1723
|
-
const zt =
|
|
1721
|
+
I = u && new r(v, jt);
|
|
1722
|
+
let we = await (u ? B(I, H) : B(v, jt));
|
|
1723
|
+
const zt = pe.from(we.headers);
|
|
1724
1724
|
if (g) {
|
|
1725
1725
|
const D = l.toFiniteNumber(zt.getContentLength());
|
|
1726
1726
|
if (D != null && D > Y)
|
|
1727
1727
|
throw new T(
|
|
1728
1728
|
"maxContentLength size of " + Y + " exceeded",
|
|
1729
1729
|
T.ERR_BAD_RESPONSE,
|
|
1730
|
-
|
|
1730
|
+
f,
|
|
1731
1731
|
I
|
|
1732
1732
|
);
|
|
1733
1733
|
}
|
|
1734
1734
|
const dt = _ && (N === "stream" || N === "response");
|
|
1735
1735
|
if (_ && we.body && (re || g || dt && ie)) {
|
|
1736
1736
|
const D = {};
|
|
1737
|
-
["status", "statusText", "headers"].forEach((
|
|
1738
|
-
D[
|
|
1737
|
+
["status", "statusText", "headers"].forEach((Fe) => {
|
|
1738
|
+
D[Fe] = we[Fe];
|
|
1739
1739
|
});
|
|
1740
|
-
const
|
|
1741
|
-
|
|
1740
|
+
const de = l.toFiniteNumber(zt.getContentLength()), [Ee, Te] = re && Kt(
|
|
1741
|
+
de,
|
|
1742
1742
|
at(Xt(re), !0)
|
|
1743
1743
|
) || [];
|
|
1744
1744
|
let Vt = 0;
|
|
1745
|
-
const Ga = (
|
|
1746
|
-
if (g && (Vt =
|
|
1745
|
+
const Ga = (Fe) => {
|
|
1746
|
+
if (g && (Vt = Fe, Vt > Y))
|
|
1747
1747
|
throw new T(
|
|
1748
1748
|
"maxContentLength size of " + Y + " exceeded",
|
|
1749
1749
|
T.ERR_BAD_RESPONSE,
|
|
1750
|
-
|
|
1750
|
+
f,
|
|
1751
1751
|
I
|
|
1752
1752
|
);
|
|
1753
|
-
Ee && Ee(
|
|
1753
|
+
Ee && Ee(Fe);
|
|
1754
1754
|
};
|
|
1755
1755
|
we = new i(
|
|
1756
1756
|
Zt(we.body, ea, Ga, () => {
|
|
@@ -1762,7 +1762,7 @@ const At = "1.18.1", ea = 64 * 1024, { isFunction: Ke } = l, Wo = (e) => encodeU
|
|
|
1762
1762
|
N = N || "text";
|
|
1763
1763
|
let ke = await P[l.findKey(P, N) || "text"](
|
|
1764
1764
|
we,
|
|
1765
|
-
|
|
1765
|
+
f
|
|
1766
1766
|
);
|
|
1767
1767
|
if (g && !_ && !dt) {
|
|
1768
1768
|
let D;
|
|
@@ -1770,24 +1770,24 @@ const At = "1.18.1", ea = 64 * 1024, { isFunction: Ke } = l, Wo = (e) => encodeU
|
|
|
1770
1770
|
throw new T(
|
|
1771
1771
|
"maxContentLength size of " + Y + " exceeded",
|
|
1772
1772
|
T.ERR_BAD_RESPONSE,
|
|
1773
|
-
|
|
1773
|
+
f,
|
|
1774
1774
|
I
|
|
1775
1775
|
);
|
|
1776
1776
|
}
|
|
1777
|
-
return !dt && ie && ie(), await new Promise((D,
|
|
1778
|
-
Oa(D,
|
|
1777
|
+
return !dt && ie && ie(), await new Promise((D, de) => {
|
|
1778
|
+
Oa(D, de, {
|
|
1779
1779
|
data: ke,
|
|
1780
|
-
headers:
|
|
1780
|
+
headers: pe.from(we.headers),
|
|
1781
1781
|
status: we.status,
|
|
1782
1782
|
statusText: we.statusText,
|
|
1783
|
-
config:
|
|
1783
|
+
config: f,
|
|
1784
1784
|
request: I
|
|
1785
1785
|
});
|
|
1786
1786
|
});
|
|
1787
1787
|
} catch (q) {
|
|
1788
1788
|
if (ie && ie(), M && M.aborted && M.reason instanceof T) {
|
|
1789
1789
|
const fe = M.reason;
|
|
1790
|
-
throw fe.config =
|
|
1790
|
+
throw fe.config = f, I && (fe.request = I), q !== fe && Object.defineProperty(fe, "cause", {
|
|
1791
1791
|
__proto__: null,
|
|
1792
1792
|
value: q,
|
|
1793
1793
|
writable: !0,
|
|
@@ -1795,15 +1795,15 @@ const At = "1.18.1", ea = 64 * 1024, { isFunction: Ke } = l, Wo = (e) => encodeU
|
|
|
1795
1795
|
configurable: !0
|
|
1796
1796
|
}), fe;
|
|
1797
1797
|
}
|
|
1798
|
-
if (
|
|
1799
|
-
throw I && !
|
|
1798
|
+
if (Le)
|
|
1799
|
+
throw I && !Le.request && (Le.request = I), Le;
|
|
1800
1800
|
if (q instanceof T)
|
|
1801
1801
|
throw I && !q.request && (q.request = I), q;
|
|
1802
1802
|
if (q && q.name === "TypeError" && /Load failed|fetch/i.test(q.message)) {
|
|
1803
1803
|
const fe = new T(
|
|
1804
1804
|
"Network Error",
|
|
1805
1805
|
T.ERR_NETWORK,
|
|
1806
|
-
|
|
1806
|
+
f,
|
|
1807
1807
|
I,
|
|
1808
1808
|
q && q.response
|
|
1809
1809
|
);
|
|
@@ -1815,7 +1815,7 @@ const At = "1.18.1", ea = 64 * 1024, { isFunction: Ke } = l, Wo = (e) => encodeU
|
|
|
1815
1815
|
configurable: !0
|
|
1816
1816
|
}), fe;
|
|
1817
1817
|
}
|
|
1818
|
-
throw T.from(q, q && q.code,
|
|
1818
|
+
throw T.from(q, q && q.code, f, I, q && q.response);
|
|
1819
1819
|
}
|
|
1820
1820
|
};
|
|
1821
1821
|
}, Jo = /* @__PURE__ */ new Map(), Ba = (e) => {
|
|
@@ -1889,7 +1889,7 @@ function gt(e) {
|
|
|
1889
1889
|
throw new Ge(null, e);
|
|
1890
1890
|
}
|
|
1891
1891
|
function oa(e) {
|
|
1892
|
-
return gt(e), e.headers =
|
|
1892
|
+
return gt(e), e.headers = pe.from(e.headers), e.data = mt.call(e, e.transformRequest), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), _a.getAdapter(e.adapter || Ct.adapter, e)(e).then(
|
|
1893
1893
|
function(t) {
|
|
1894
1894
|
gt(e), e.response = t;
|
|
1895
1895
|
try {
|
|
@@ -1897,7 +1897,7 @@ function oa(e) {
|
|
|
1897
1897
|
} finally {
|
|
1898
1898
|
delete e.response;
|
|
1899
1899
|
}
|
|
1900
|
-
return t.headers =
|
|
1900
|
+
return t.headers = pe.from(t.headers), t;
|
|
1901
1901
|
},
|
|
1902
1902
|
function(t) {
|
|
1903
1903
|
if (!Ta(t) && (gt(e), t && t.response)) {
|
|
@@ -1911,7 +1911,7 @@ function oa(e) {
|
|
|
1911
1911
|
} finally {
|
|
1912
1912
|
delete e.response;
|
|
1913
1913
|
}
|
|
1914
|
-
t.response.headers =
|
|
1914
|
+
t.response.headers = pe.from(t.response.headers);
|
|
1915
1915
|
}
|
|
1916
1916
|
return Promise.reject(t);
|
|
1917
1917
|
}
|
|
@@ -2048,7 +2048,7 @@ class ot {
|
|
|
2048
2048
|
let i = r && l.merge(r.common, r[a.method]);
|
|
2049
2049
|
r && l.forEach(["delete", "get", "head", "post", "put", "patch", "query", "common"], (P) => {
|
|
2050
2050
|
delete r[P];
|
|
2051
|
-
}), a.headers =
|
|
2051
|
+
}), a.headers = pe.concat(i, r);
|
|
2052
2052
|
const s = [];
|
|
2053
2053
|
let u = !0;
|
|
2054
2054
|
this.interceptors.request.forEach(function(P) {
|
|
@@ -2062,17 +2062,17 @@ class ot {
|
|
|
2062
2062
|
this.interceptors.response.forEach(function(P) {
|
|
2063
2063
|
c.push(P.fulfilled, P.rejected);
|
|
2064
2064
|
});
|
|
2065
|
-
let d,
|
|
2065
|
+
let d, p = 0, w;
|
|
2066
2066
|
if (!u) {
|
|
2067
2067
|
const P = [oa.bind(this), void 0];
|
|
2068
|
-
for (P.unshift(...s), P.push(...c), w = P.length, d = Promise.resolve(a);
|
|
2069
|
-
d = d.then(P[
|
|
2068
|
+
for (P.unshift(...s), P.push(...c), w = P.length, d = Promise.resolve(a); p < w; )
|
|
2069
|
+
d = d.then(P[p++], P[p++]);
|
|
2070
2070
|
return d;
|
|
2071
2071
|
}
|
|
2072
2072
|
w = s.length;
|
|
2073
2073
|
let _ = a;
|
|
2074
|
-
for (;
|
|
2075
|
-
const P = s[
|
|
2074
|
+
for (; p < w; ) {
|
|
2075
|
+
const P = s[p++], E = s[p++];
|
|
2076
2076
|
try {
|
|
2077
2077
|
_ = P(_);
|
|
2078
2078
|
} catch (R) {
|
|
@@ -2085,8 +2085,8 @@ class ot {
|
|
|
2085
2085
|
} catch (P) {
|
|
2086
2086
|
return Promise.reject(P);
|
|
2087
2087
|
}
|
|
2088
|
-
for (
|
|
2089
|
-
d = d.then(c[
|
|
2088
|
+
for (p = 0, w = c.length; p < w; )
|
|
2089
|
+
d = d.then(c[p++], c[p++]);
|
|
2090
2090
|
return d;
|
|
2091
2091
|
}
|
|
2092
2092
|
getUri(t) {
|
|
@@ -2303,7 +2303,7 @@ X.all = function(e) {
|
|
|
2303
2303
|
X.spread = Yo;
|
|
2304
2304
|
X.isAxiosError = Zo;
|
|
2305
2305
|
X.mergeConfig = Ae;
|
|
2306
|
-
X.AxiosHeaders =
|
|
2306
|
+
X.AxiosHeaders = pe;
|
|
2307
2307
|
X.formToJSON = (e) => Sa(l.isHTMLForm(e) ? new FormData(e) : e);
|
|
2308
2308
|
X.getAdapter = _a.getAdapter;
|
|
2309
2309
|
X.HttpStatusCode = er;
|
|
@@ -2320,7 +2320,7 @@ const Dt = ["1x1", "4x3", "16x9", "9x16"];
|
|
|
2320
2320
|
function Be(e) {
|
|
2321
2321
|
return e.replace("x", ":");
|
|
2322
2322
|
}
|
|
2323
|
-
const
|
|
2323
|
+
const Ke = "asset";
|
|
2324
2324
|
function or(e) {
|
|
2325
2325
|
return e.some((t) => t.status === "pending");
|
|
2326
2326
|
}
|
|
@@ -2420,16 +2420,16 @@ function ur() {
|
|
|
2420
2420
|
headers: o ? { Authorization: `Bearer ${o}` } : {}
|
|
2421
2421
|
});
|
|
2422
2422
|
}
|
|
2423
|
-
const
|
|
2424
|
-
function
|
|
2423
|
+
const le = ur;
|
|
2424
|
+
function Ue(e) {
|
|
2425
2425
|
return `/media-v1/businesses/${e}/assets`;
|
|
2426
2426
|
}
|
|
2427
2427
|
async function dr(e) {
|
|
2428
|
-
const { businessId: t, ...a } = e, { data: n } = await
|
|
2428
|
+
const { businessId: t, ...a } = e, { data: n } = await le().get(Ue(t), { params: a });
|
|
2429
2429
|
return n;
|
|
2430
2430
|
}
|
|
2431
2431
|
async function La(e) {
|
|
2432
|
-
const { data: t } = await
|
|
2432
|
+
const { data: t } = await le().get(`${Ue(e)}/tags`, {
|
|
2433
2433
|
params: { excludeTags: [Ua] }
|
|
2434
2434
|
});
|
|
2435
2435
|
return t;
|
|
@@ -2438,76 +2438,86 @@ async function cr(e) {
|
|
|
2438
2438
|
const { tags: t } = await La(e);
|
|
2439
2439
|
return t.map((a) => a.tag);
|
|
2440
2440
|
}
|
|
2441
|
-
async function pr(e, t
|
|
2442
|
-
const { data:
|
|
2443
|
-
|
|
2441
|
+
async function pr(e, t) {
|
|
2442
|
+
const { data: a } = await le().get(`${Ue(e)}/ref-types`, {
|
|
2443
|
+
params: { restaurantId: t }
|
|
2444
|
+
});
|
|
2445
|
+
return a;
|
|
2446
|
+
}
|
|
2447
|
+
async function ol(e, t) {
|
|
2448
|
+
const { refTypes: a } = await pr(e, t);
|
|
2449
|
+
return a.map((n) => n.refType);
|
|
2444
2450
|
}
|
|
2445
2451
|
async function fr(e, t, a) {
|
|
2446
|
-
const { data: n } = await
|
|
2452
|
+
const { data: n } = await le().patch(`${Ue(e)}/${t}`, { fileName: a });
|
|
2447
2453
|
return n;
|
|
2448
2454
|
}
|
|
2449
|
-
async function mr(e, t) {
|
|
2450
|
-
await
|
|
2455
|
+
async function mr(e, t, a) {
|
|
2456
|
+
const { data: n } = await le().patch(`${Ue(e)}/${t}`, { tags: a });
|
|
2457
|
+
return n;
|
|
2451
2458
|
}
|
|
2452
|
-
function
|
|
2459
|
+
async function gr(e, t, a) {
|
|
2460
|
+
await le().delete(`${Ue(e)}/${t}`, { params: a ? { hard: a } : void 0 });
|
|
2461
|
+
}
|
|
2462
|
+
function $e(e) {
|
|
2453
2463
|
return `/media-v1/businesses/${e}/images`;
|
|
2454
2464
|
}
|
|
2455
|
-
async function
|
|
2456
|
-
const { data: n } = await
|
|
2465
|
+
async function hr(e, t, a) {
|
|
2466
|
+
const { data: n } = await le().post(`${$e(e)}/create`, t, {
|
|
2457
2467
|
headers: a ? { "Idempotency-Key": a } : {}
|
|
2458
2468
|
});
|
|
2459
2469
|
return n;
|
|
2460
2470
|
}
|
|
2461
|
-
async function
|
|
2462
|
-
const { data: a } = await
|
|
2471
|
+
async function br(e, t) {
|
|
2472
|
+
const { data: a } = await le().post(`${$e(e)}/delete`, {
|
|
2463
2473
|
entries: t
|
|
2464
2474
|
});
|
|
2465
2475
|
return a.results;
|
|
2466
2476
|
}
|
|
2467
|
-
async function
|
|
2468
|
-
const { businessId: t, refIds: a, ...n } = e, { data: o } = await
|
|
2477
|
+
async function yr(e) {
|
|
2478
|
+
const { businessId: t, refIds: a, ...n } = e, { data: o } = await le().get($e(t), {
|
|
2469
2479
|
params: { ...n, refIds: a.join(",") }
|
|
2470
2480
|
});
|
|
2471
2481
|
return o.images;
|
|
2472
2482
|
}
|
|
2473
|
-
async function
|
|
2474
|
-
const { data: a } = await
|
|
2483
|
+
async function vr(e, t) {
|
|
2484
|
+
const { data: a } = await le().post(`${$e(e)}/upload-intent`, t);
|
|
2475
2485
|
return a;
|
|
2476
2486
|
}
|
|
2477
|
-
async function
|
|
2478
|
-
const { data: a } = await
|
|
2487
|
+
async function wr(e, t) {
|
|
2488
|
+
const { data: a } = await le().post(`${$e(e)}/confirm`, t);
|
|
2479
2489
|
return a;
|
|
2480
2490
|
}
|
|
2481
2491
|
function Mt(e) {
|
|
2482
2492
|
return `/media-v1/businesses/${e}/videos`;
|
|
2483
2493
|
}
|
|
2484
|
-
async function wr(e, t) {
|
|
2485
|
-
const { data: a } = await pe().post(`${Mt(e)}/upload-intent`, t);
|
|
2486
|
-
return a;
|
|
2487
|
-
}
|
|
2488
2494
|
async function kr(e, t) {
|
|
2489
|
-
const { data: a } = await
|
|
2495
|
+
const { data: a } = await le().post(`${Mt(e)}/upload-intent`, t);
|
|
2490
2496
|
return a;
|
|
2491
2497
|
}
|
|
2492
2498
|
async function xr(e, t) {
|
|
2493
|
-
const { data: a } = await
|
|
2499
|
+
const { data: a } = await le().post(`${Mt(e)}/confirm`, t);
|
|
2500
|
+
return a;
|
|
2501
|
+
}
|
|
2502
|
+
async function Pr(e, t) {
|
|
2503
|
+
const { data: a } = await le().post(`${Mt(e)}/delete`, {
|
|
2494
2504
|
entries: t
|
|
2495
2505
|
});
|
|
2496
2506
|
return a.results;
|
|
2497
2507
|
}
|
|
2498
|
-
async function
|
|
2499
|
-
const
|
|
2500
|
-
if (
|
|
2501
|
-
await
|
|
2508
|
+
async function Er(e, t, a) {
|
|
2509
|
+
const n = ir(t);
|
|
2510
|
+
if (n.kind === "video") {
|
|
2511
|
+
await Pr(e, [{ ...n.entry, hard: a }]);
|
|
2502
2512
|
return;
|
|
2503
2513
|
}
|
|
2504
|
-
if (
|
|
2505
|
-
await
|
|
2514
|
+
if (n.kind === "image") {
|
|
2515
|
+
await br(e, [{ ...n.entry, hard: a }]);
|
|
2506
2516
|
return;
|
|
2507
2517
|
}
|
|
2508
|
-
await
|
|
2518
|
+
await gr(e, n.id, a);
|
|
2509
2519
|
}
|
|
2510
|
-
const me = "var(--fm-color-brand-primary, #FF7823)", Nt = "#FFF7F0", ia = "40px 56px minmax(160px, 2.2fr) 110px 90px 150px 120px 40px", $ = "font-size:11px", bt = "padding:2px 6px",
|
|
2520
|
+
const me = "var(--fm-color-brand-primary, #FF7823)", Nt = "#FFF7F0", ia = "40px 56px minmax(160px, 2.2fr) 110px 90px 150px 120px 40px", $ = "font-size:11px", bt = "padding:2px 6px", Rr = "background:#FFFBEB;border-color:#FCD34D", Sr = "color:#B45309", Tr = {
|
|
2511
2521
|
assetGrid: {
|
|
2512
2522
|
loading: "Loading…",
|
|
2513
2523
|
empty: "No assets yet",
|
|
@@ -2602,9 +2612,9 @@ const me = "var(--fm-color-brand-primary, #FF7823)", Nt = "#FFF7F0", ia = "40px
|
|
|
2602
2612
|
label: "Ratio",
|
|
2603
2613
|
unavailableForSelection: "The selected image has no {ratio} version yet"
|
|
2604
2614
|
}
|
|
2605
|
-
}, Tr = {
|
|
2606
|
-
mediaPicker: Sr
|
|
2607
2615
|
}, Or = {
|
|
2616
|
+
mediaPicker: Tr
|
|
2617
|
+
}, Cr = {
|
|
2608
2618
|
assetGrid: {
|
|
2609
2619
|
loading: "Chargement…",
|
|
2610
2620
|
empty: "Aucun média",
|
|
@@ -2699,9 +2709,9 @@ const me = "var(--fm-color-brand-primary, #FF7823)", Nt = "#FFF7F0", ia = "40px
|
|
|
2699
2709
|
label: "Ratio",
|
|
2700
2710
|
unavailableForSelection: "L'image sélectionnée n'a pas encore de version {ratio}"
|
|
2701
2711
|
}
|
|
2702
|
-
}, Cr = {
|
|
2703
|
-
mediaPicker: Or
|
|
2704
2712
|
}, Ar = {
|
|
2713
|
+
mediaPicker: Cr
|
|
2714
|
+
}, Br = {
|
|
2705
2715
|
assetGrid: {
|
|
2706
2716
|
loading: "Memuat…",
|
|
2707
2717
|
empty: "Belum ada media",
|
|
@@ -2796,9 +2806,9 @@ const me = "var(--fm-color-brand-primary, #FF7823)", Nt = "#FFF7F0", ia = "40px
|
|
|
2796
2806
|
label: "Rasio",
|
|
2797
2807
|
unavailableForSelection: "Gambar yang dipilih belum memiliki versi {ratio}"
|
|
2798
2808
|
}
|
|
2799
|
-
}, Br = {
|
|
2800
|
-
mediaPicker: Ar
|
|
2801
2809
|
}, _r = {
|
|
2810
|
+
mediaPicker: Br
|
|
2811
|
+
}, Dr = {
|
|
2802
2812
|
assetGrid: {
|
|
2803
2813
|
loading: "読み込み中…",
|
|
2804
2814
|
empty: "素材がありません",
|
|
@@ -2893,9 +2903,9 @@ const me = "var(--fm-color-brand-primary, #FF7823)", Nt = "#FFF7F0", ia = "40px
|
|
|
2893
2903
|
label: "比率",
|
|
2894
2904
|
unavailableForSelection: "選択した画像にはまだ {ratio} バージョンがありません"
|
|
2895
2905
|
}
|
|
2896
|
-
}, Dr = {
|
|
2897
|
-
mediaPicker: _r
|
|
2898
2906
|
}, Mr = {
|
|
2907
|
+
mediaPicker: Dr
|
|
2908
|
+
}, Nr = {
|
|
2899
2909
|
assetGrid: {
|
|
2900
2910
|
loading: "กำลังโหลด…",
|
|
2901
2911
|
empty: "ยังไม่มีสื่อ",
|
|
@@ -2990,9 +3000,9 @@ const me = "var(--fm-color-brand-primary, #FF7823)", Nt = "#FFF7F0", ia = "40px
|
|
|
2990
3000
|
label: "อัตราส่วน",
|
|
2991
3001
|
unavailableForSelection: "รูปที่เลือกยังไม่มีเวอร์ชัน {ratio}"
|
|
2992
3002
|
}
|
|
2993
|
-
}, Nr = {
|
|
2994
|
-
mediaPicker: Mr
|
|
2995
3003
|
}, Ir = {
|
|
3004
|
+
mediaPicker: Nr
|
|
3005
|
+
}, Ur = {
|
|
2996
3006
|
assetGrid: {
|
|
2997
3007
|
loading: "加载中…",
|
|
2998
3008
|
empty: "暂无素材",
|
|
@@ -3087,9 +3097,9 @@ const me = "var(--fm-color-brand-primary, #FF7823)", Nt = "#FFF7F0", ia = "40px
|
|
|
3087
3097
|
label: "规格",
|
|
3088
3098
|
unavailableForSelection: "所选图片还没有 {ratio} 版本"
|
|
3089
3099
|
}
|
|
3090
|
-
}, Ur = {
|
|
3091
|
-
mediaPicker: Ir
|
|
3092
3100
|
}, Lr = {
|
|
3101
|
+
mediaPicker: Ur
|
|
3102
|
+
}, Fr = {
|
|
3093
3103
|
assetGrid: {
|
|
3094
3104
|
loading: "載入中…",
|
|
3095
3105
|
empty: "暫無素材",
|
|
@@ -3185,23 +3195,23 @@ const me = "var(--fm-color-brand-primary, #FF7823)", Nt = "#FFF7F0", ia = "40px
|
|
|
3185
3195
|
unavailableForSelection: "所選圖片還沒有 {ratio} 版本"
|
|
3186
3196
|
}
|
|
3187
3197
|
}, jr = {
|
|
3188
|
-
mediaPicker:
|
|
3198
|
+
mediaPicker: Fr
|
|
3189
3199
|
}, ve = {
|
|
3190
|
-
"en-US":
|
|
3191
|
-
"zh-CN":
|
|
3200
|
+
"en-US": Or,
|
|
3201
|
+
"zh-CN": Lr,
|
|
3192
3202
|
"zh-Hant": jr,
|
|
3193
|
-
"th-TH":
|
|
3194
|
-
"ja-JP":
|
|
3195
|
-
"id-ID":
|
|
3196
|
-
"fr-MA":
|
|
3197
|
-
},
|
|
3198
|
-
function
|
|
3203
|
+
"th-TH": Ir,
|
|
3204
|
+
"ja-JP": Mr,
|
|
3205
|
+
"id-ID": _r,
|
|
3206
|
+
"fr-MA": Ar
|
|
3207
|
+
}, Fa = 15e3, zr = 0.92, Vr = 0.1;
|
|
3208
|
+
function qr(e) {
|
|
3199
3209
|
return new Promise((t) => {
|
|
3200
3210
|
const a = document.createElement("video");
|
|
3201
3211
|
let n = !1;
|
|
3202
3212
|
const o = (i) => {
|
|
3203
3213
|
n || (n = !0, clearTimeout(r), a.removeAttribute("src"), a.load(), t(i));
|
|
3204
|
-
}, r = setTimeout(() => o(null),
|
|
3214
|
+
}, r = setTimeout(() => o(null), Fa);
|
|
3205
3215
|
a.preload = "metadata", a.muted = !0, a.onloadedmetadata = () => {
|
|
3206
3216
|
const i = a.videoWidth, s = a.videoHeight, u = a.duration;
|
|
3207
3217
|
if (!i || !s || !Number.isFinite(u) || u <= 0) {
|
|
@@ -3212,13 +3222,13 @@ function Vr(e) {
|
|
|
3212
3222
|
}, a.onerror = () => o(null), a.src = e;
|
|
3213
3223
|
});
|
|
3214
3224
|
}
|
|
3215
|
-
function
|
|
3225
|
+
function Wr(e) {
|
|
3216
3226
|
return new Promise((t) => {
|
|
3217
3227
|
const a = document.createElement("video");
|
|
3218
3228
|
let n = !1;
|
|
3219
3229
|
const o = (s) => {
|
|
3220
3230
|
n || (n = !0, clearTimeout(r), a.removeAttribute("src"), a.load(), t(s));
|
|
3221
|
-
}, r = setTimeout(() => o(null),
|
|
3231
|
+
}, r = setTimeout(() => o(null), Fa), i = () => {
|
|
3222
3232
|
try {
|
|
3223
3233
|
const s = document.createElement("canvas");
|
|
3224
3234
|
if (s.width = a.videoWidth, s.height = a.videoHeight, !s.width || !s.height) {
|
|
@@ -3230,7 +3240,7 @@ function qr(e) {
|
|
|
3230
3240
|
o(null);
|
|
3231
3241
|
return;
|
|
3232
3242
|
}
|
|
3233
|
-
u.drawImage(a, 0, 0, s.width, s.height), s.toBlob((c) => o(c), "image/jpeg",
|
|
3243
|
+
u.drawImage(a, 0, 0, s.width, s.height), s.toBlob((c) => o(c), "image/jpeg", zr);
|
|
3234
3244
|
} catch {
|
|
3235
3245
|
o(null);
|
|
3236
3246
|
}
|
|
@@ -3240,7 +3250,7 @@ function qr(e) {
|
|
|
3240
3250
|
o(null);
|
|
3241
3251
|
return;
|
|
3242
3252
|
}
|
|
3243
|
-
const s = Math.min(
|
|
3253
|
+
const s = Math.min(Vr, Math.max(0, (a.duration || 0) / 2));
|
|
3244
3254
|
if (s <= 0) {
|
|
3245
3255
|
i();
|
|
3246
3256
|
return;
|
|
@@ -3255,37 +3265,37 @@ function It(e) {
|
|
|
3255
3265
|
const t = Math.max(0, Math.round(e / 1e3)), a = Math.floor(t / 3600), n = Math.floor(t % 3600 / 60), o = t % 60, r = (i) => String(i).padStart(2, "0");
|
|
3256
3266
|
return a > 0 ? `${a}:${r(n)}:${r(o)}` : `${n}:${r(o)}`;
|
|
3257
3267
|
}
|
|
3258
|
-
const
|
|
3268
|
+
const Gr = {
|
|
3259
3269
|
key: 0,
|
|
3260
3270
|
class: "py-64 text-center text-sm text-gray-400"
|
|
3261
|
-
},
|
|
3271
|
+
}, $r = {
|
|
3262
3272
|
key: 1,
|
|
3263
3273
|
class: "py-64 text-center text-sm text-gray-400"
|
|
3264
|
-
},
|
|
3274
|
+
}, Jr = {
|
|
3265
3275
|
key: 2,
|
|
3266
3276
|
class: "bg-white border border-fm-color-neutral-gray-200 rounded-lg overflow-hidden"
|
|
3267
|
-
},
|
|
3277
|
+
}, Hr = ["onClick"], Kr = ["onClick"], Xr = { key: 1 }, Qr = {
|
|
3268
3278
|
class: "rounded overflow-hidden",
|
|
3269
3279
|
style: { width: "44px", height: "36px" }
|
|
3270
|
-
},
|
|
3280
|
+
}, Yr = {
|
|
3271
3281
|
key: 1,
|
|
3272
3282
|
class: "w-full h-full flex items-center justify-center bg-fm-color-neutral-gray-100 text-gray-400"
|
|
3273
|
-
},
|
|
3283
|
+
}, Zr = { class: "min-w-0 flex flex-col gap-4" }, ei = { class: "text-xs font-semibold truncate" }, ti = { class: "flex items-center gap-8" }, ai = { class: "text-xs text-fm-color-typo-primary" }, ni = { class: "text-xs text-fm-color-typo-primary" }, oi = { class: "flex items-center gap-8 min-w-0" }, ri = { class: "text-xs text-fm-color-typo-primary truncate" }, ii = { class: "text-xs text-fm-color-typo-secondary" }, si = {
|
|
3274
3284
|
key: 3,
|
|
3275
3285
|
class: "grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-16"
|
|
3276
|
-
},
|
|
3286
|
+
}, li = ["onClick"], ui = {
|
|
3277
3287
|
class: "relative",
|
|
3278
3288
|
style: { "aspect-ratio": "4 / 3" }
|
|
3279
|
-
},
|
|
3289
|
+
}, di = {
|
|
3280
3290
|
key: 1,
|
|
3281
3291
|
class: "w-full h-full flex flex-col items-center justify-center gap-4 bg-fm-color-neutral-gray-100 text-gray-400"
|
|
3282
|
-
},
|
|
3292
|
+
}, ci = {
|
|
3283
3293
|
key: 2,
|
|
3284
3294
|
class: "absolute inset-0 flex items-center justify-center pointer-events-none"
|
|
3285
|
-
},
|
|
3295
|
+
}, pi = {
|
|
3286
3296
|
class: "rounded-full bg-black/50 flex items-center justify-center",
|
|
3287
3297
|
style: { width: "40px", height: "40px" }
|
|
3288
|
-
},
|
|
3298
|
+
}, fi = ["onClick"], mi = { class: "px-8 py-6 space-y-2" }, gi = { class: "text-xs font-semibold truncate" }, hi = /* @__PURE__ */ be({
|
|
3289
3299
|
__name: "AssetGrid",
|
|
3290
3300
|
props: {
|
|
3291
3301
|
assets: {},
|
|
@@ -3301,20 +3311,20 @@ const Wr = {
|
|
|
3301
3311
|
setup(e, { emit: t }) {
|
|
3302
3312
|
const { t: a } = ye({ messages: ve }), n = e;
|
|
3303
3313
|
function o(R) {
|
|
3304
|
-
var
|
|
3314
|
+
var f;
|
|
3305
3315
|
if (Re(R) || !R.refId)
|
|
3306
3316
|
return null;
|
|
3307
|
-
const v = (
|
|
3317
|
+
const v = (f = n.variantsByRefId) == null ? void 0 : f.get(R.refId);
|
|
3308
3318
|
return v ? rr(v.variants) : null;
|
|
3309
3319
|
}
|
|
3310
3320
|
function r(R) {
|
|
3311
|
-
var
|
|
3312
|
-
return ((
|
|
3321
|
+
var f;
|
|
3322
|
+
return ((f = n.unavailableIds) == null ? void 0 : f.has(R.id)) ?? !1;
|
|
3313
3323
|
}
|
|
3314
3324
|
function i(R) {
|
|
3315
|
-
const
|
|
3316
|
-
return !r(R) || !
|
|
3317
|
-
content: Re(R) ? a("mediaPicker.assetGrid.videoUnavailableForRatio", { ratio: Be(
|
|
3325
|
+
const f = n.unavailableRatio;
|
|
3326
|
+
return !r(R) || !f ? { content: "", disabled: !0 } : {
|
|
3327
|
+
content: Re(R) ? a("mediaPicker.assetGrid.videoUnavailableForRatio", { ratio: Be(f) }) : a("mediaPicker.assetGrid.unavailableForRatio", { ratio: Be(f) }),
|
|
3318
3328
|
disabled: !1
|
|
3319
3329
|
};
|
|
3320
3330
|
}
|
|
@@ -3330,50 +3340,50 @@ const Wr = {
|
|
|
3330
3340
|
function d(R) {
|
|
3331
3341
|
r(R) || w("toggle", R);
|
|
3332
3342
|
}
|
|
3333
|
-
function
|
|
3343
|
+
function p(R) {
|
|
3334
3344
|
return R.tone === "done" ? a("mediaPicker.variants.badgeDone", { count: R.total }) : a("mediaPicker.variants.badgeProgress", { active: R.active, total: R.total });
|
|
3335
3345
|
}
|
|
3336
3346
|
const w = t;
|
|
3337
3347
|
function _(R) {
|
|
3338
|
-
var
|
|
3339
|
-
return ((
|
|
3348
|
+
var f;
|
|
3349
|
+
return ((f = R.split("/")[1]) == null ? void 0 : f.toUpperCase()) ?? R;
|
|
3340
3350
|
}
|
|
3341
3351
|
function P(R) {
|
|
3342
3352
|
return R >= 1024 * 1024 ? `${(R / 1024 / 1024).toFixed(1)} MB` : `${Math.round(R / 1024)} KB`;
|
|
3343
3353
|
}
|
|
3344
3354
|
function E(R) {
|
|
3345
|
-
const
|
|
3346
|
-
if (
|
|
3355
|
+
const f = Date.now() - new Date(R).getTime(), v = 6e4, C = 36e5, A = 864e5;
|
|
3356
|
+
if (f < v)
|
|
3347
3357
|
return a("mediaPicker.assetGrid.time.justNow");
|
|
3348
|
-
if (
|
|
3349
|
-
return a("mediaPicker.assetGrid.time.minutesAgo", { n: Math.floor(
|
|
3350
|
-
if (
|
|
3351
|
-
return a("mediaPicker.assetGrid.time.hoursAgo", { n: Math.floor(
|
|
3352
|
-
if (
|
|
3353
|
-
return a("mediaPicker.assetGrid.time.daysAgo", { n: Math.floor(
|
|
3358
|
+
if (f < C)
|
|
3359
|
+
return a("mediaPicker.assetGrid.time.minutesAgo", { n: Math.floor(f / v) });
|
|
3360
|
+
if (f < A)
|
|
3361
|
+
return a("mediaPicker.assetGrid.time.hoursAgo", { n: Math.floor(f / C) });
|
|
3362
|
+
if (f < A * 8)
|
|
3363
|
+
return a("mediaPicker.assetGrid.time.daysAgo", { n: Math.floor(f / A) });
|
|
3354
3364
|
const V = new Date(R);
|
|
3355
3365
|
return `${V.getFullYear()}-${String(V.getMonth() + 1).padStart(2, "0")}-${String(V.getDate()).padStart(2, "0")}`;
|
|
3356
3366
|
}
|
|
3357
|
-
return (R,
|
|
3367
|
+
return (R, f) => {
|
|
3358
3368
|
const v = K("FmIcon"), C = K("FmThumbnail"), A = K("FmAvatar"), V = K("FmButton"), Q = ua("tooltip");
|
|
3359
|
-
return e.loading ? (y(), k("div",
|
|
3369
|
+
return e.loading ? (y(), k("div", Gr, x(h(a)("mediaPicker.assetGrid.loading")), 1)) : e.assets.length === 0 ? (y(), k("div", $r, x(h(a)("mediaPicker.assetGrid.empty")), 1)) : e.view === "list" ? (y(), k("div", Jr, [
|
|
3360
3370
|
b("div", {
|
|
3361
3371
|
class: "grid items-center gap-8 px-16 h-40 bg-fm-color-neutral-gray-100 border-b border-fm-color-neutral-gray-200 text-xs font-semibold text-fm-color-typo-secondary",
|
|
3362
|
-
style:
|
|
3372
|
+
style: F({ gridTemplateColumns: h(ia) })
|
|
3363
3373
|
}, [
|
|
3364
|
-
|
|
3365
|
-
|
|
3374
|
+
f[0] || (f[0] = b("span", null, null, -1)),
|
|
3375
|
+
f[1] || (f[1] = b("span", null, null, -1)),
|
|
3366
3376
|
b("span", null, x(h(a)("mediaPicker.assetGrid.columns.name")), 1),
|
|
3367
3377
|
b("span", null, x(h(a)("mediaPicker.assetGrid.columns.dimensions")), 1),
|
|
3368
3378
|
b("span", null, x(h(a)("mediaPicker.assetGrid.columns.fileSize")), 1),
|
|
3369
3379
|
b("span", null, x(h(a)("mediaPicker.assetGrid.columns.uploader")), 1),
|
|
3370
3380
|
b("span", null, x(h(a)("mediaPicker.assetGrid.columns.uploadedAt")), 1),
|
|
3371
|
-
|
|
3381
|
+
f[2] || (f[2] = b("span", null, null, -1))
|
|
3372
3382
|
], 4),
|
|
3373
3383
|
(y(!0), k(Z, null, he(e.assets, (S) => et((y(), k("div", {
|
|
3374
3384
|
key: S.id,
|
|
3375
3385
|
class: ee(["grid items-center gap-8 px-16 h-56 border-b border-fm-color-neutral-gray-200 last:border-b-0 hover:bg-fm-color-neutral-gray-100", r(S) ? "opacity-40 cursor-not-allowed" : "cursor-pointer"]),
|
|
3376
|
-
style:
|
|
3386
|
+
style: F({
|
|
3377
3387
|
gridTemplateColumns: h(ia),
|
|
3378
3388
|
...e.selectedIds.has(S.id) ? { background: h(Nt) } : {}
|
|
3379
3389
|
}),
|
|
@@ -3382,7 +3392,7 @@ const Wr = {
|
|
|
3382
3392
|
e.selectable ? (y(), k("button", {
|
|
3383
3393
|
key: 0,
|
|
3384
3394
|
class: ee(["rounded flex items-center justify-center", e.selectedIds.has(S.id) ? "" : "bg-white border border-fm-color-neutral-gray-200"]),
|
|
3385
|
-
style:
|
|
3395
|
+
style: F({
|
|
3386
3396
|
width: "20px",
|
|
3387
3397
|
height: "20px",
|
|
3388
3398
|
...e.selectedIds.has(S.id) ? { background: h(me) } : {}
|
|
@@ -3394,33 +3404,33 @@ const Wr = {
|
|
|
3394
3404
|
name: "check",
|
|
3395
3405
|
size: "sm",
|
|
3396
3406
|
color: "white"
|
|
3397
|
-
})) :
|
|
3398
|
-
], 14,
|
|
3399
|
-
b("div",
|
|
3407
|
+
})) : j("", !0)
|
|
3408
|
+
], 14, Kr)) : (y(), k("span", Xr)),
|
|
3409
|
+
b("div", Qr, [
|
|
3400
3410
|
s(S) ? (y(), oe(C, {
|
|
3401
3411
|
key: 0,
|
|
3402
3412
|
src: s(S),
|
|
3403
3413
|
size: "sm",
|
|
3404
3414
|
class: "!w-full !h-full"
|
|
3405
|
-
}, null, 8, ["src"])) : (y(), k("div",
|
|
3415
|
+
}, null, 8, ["src"])) : (y(), k("div", Yr, [
|
|
3406
3416
|
W(v, {
|
|
3407
3417
|
name: "movie",
|
|
3408
3418
|
size: "sm"
|
|
3409
3419
|
})
|
|
3410
3420
|
]))
|
|
3411
3421
|
]),
|
|
3412
|
-
b("div",
|
|
3413
|
-
b("span",
|
|
3414
|
-
b("div",
|
|
3422
|
+
b("div", Zr, [
|
|
3423
|
+
b("span", ei, x(S.fileName), 1),
|
|
3424
|
+
b("div", ti, [
|
|
3415
3425
|
b("span", {
|
|
3416
3426
|
class: "text-fm-color-typo-tertiary",
|
|
3417
|
-
style:
|
|
3427
|
+
style: F(h($))
|
|
3418
3428
|
}, x(_(S.mimeType)), 5),
|
|
3419
3429
|
u(S) ? (y(), k("span", {
|
|
3420
3430
|
key: 0,
|
|
3421
3431
|
class: "text-fm-color-typo-tertiary",
|
|
3422
|
-
style:
|
|
3423
|
-
}, x(u(S)), 5)) :
|
|
3432
|
+
style: F(h($))
|
|
3433
|
+
}, x(u(S)), 5)) : j("", !0),
|
|
3424
3434
|
o(S) ? (y(), k("span", {
|
|
3425
3435
|
key: 1,
|
|
3426
3436
|
class: ee(["font-semibold", {
|
|
@@ -3428,20 +3438,20 @@ const Wr = {
|
|
|
3428
3438
|
"text-blue-600": o(S).tone === "progress",
|
|
3429
3439
|
"text-amber-600": o(S).tone === "warning"
|
|
3430
3440
|
}]),
|
|
3431
|
-
style:
|
|
3432
|
-
}, x(
|
|
3441
|
+
style: F(h($))
|
|
3442
|
+
}, x(p(o(S))), 7)) : j("", !0)
|
|
3433
3443
|
])
|
|
3434
3444
|
]),
|
|
3435
|
-
b("span",
|
|
3436
|
-
b("span",
|
|
3437
|
-
b("div",
|
|
3445
|
+
b("span", ai, x(h(ze)(S) ?? "—"), 1),
|
|
3446
|
+
b("span", ni, x(P(S.fileSizeBytes)), 1),
|
|
3447
|
+
b("div", oi, [
|
|
3438
3448
|
W(A, {
|
|
3439
3449
|
name: S.uploadedBy,
|
|
3440
3450
|
size: "sm"
|
|
3441
3451
|
}, null, 8, ["name"]),
|
|
3442
|
-
b("span",
|
|
3452
|
+
b("span", ri, x(S.uploadedBy), 1)
|
|
3443
3453
|
]),
|
|
3444
|
-
b("span",
|
|
3454
|
+
b("span", ii, x(E(S.createdAt)), 1),
|
|
3445
3455
|
W(V, {
|
|
3446
3456
|
variant: "tertiary",
|
|
3447
3457
|
size: "md",
|
|
@@ -3449,47 +3459,47 @@ const Wr = {
|
|
|
3449
3459
|
label: "",
|
|
3450
3460
|
onClick: ct((re) => w("delete", S), ["stop"])
|
|
3451
3461
|
}, null, 8, ["onClick"])
|
|
3452
|
-
], 14,
|
|
3462
|
+
], 14, Hr)), [
|
|
3453
3463
|
[Q, i(S)]
|
|
3454
3464
|
])), 128))
|
|
3455
|
-
])) : (y(), k("div",
|
|
3465
|
+
])) : (y(), k("div", si, [
|
|
3456
3466
|
(y(!0), k(Z, null, he(e.assets, (S) => et((y(), k("div", {
|
|
3457
3467
|
key: S.id,
|
|
3458
3468
|
class: ee(["rounded-lg border bg-white overflow-hidden transition-shadow hover:shadow-lg", [
|
|
3459
3469
|
e.selectedIds.has(S.id) ? "border-2" : "border-gray-200",
|
|
3460
3470
|
r(S) ? "opacity-40 cursor-not-allowed" : "cursor-pointer"
|
|
3461
3471
|
]]),
|
|
3462
|
-
style:
|
|
3472
|
+
style: F(e.selectedIds.has(S.id) ? { borderColor: h(me) } : {}),
|
|
3463
3473
|
onClick: (re) => c(S)
|
|
3464
3474
|
}, [
|
|
3465
|
-
b("div",
|
|
3475
|
+
b("div", ui, [
|
|
3466
3476
|
s(S) ? (y(), oe(C, {
|
|
3467
3477
|
key: 0,
|
|
3468
3478
|
src: s(S),
|
|
3469
3479
|
size: "xl",
|
|
3470
3480
|
class: "w-full h-full"
|
|
3471
|
-
}, null, 8, ["src"])) : (y(), k("div",
|
|
3481
|
+
}, null, 8, ["src"])) : (y(), k("div", di, [
|
|
3472
3482
|
W(v, {
|
|
3473
3483
|
name: "movie",
|
|
3474
3484
|
size: "lg"
|
|
3475
3485
|
}),
|
|
3476
3486
|
b("span", {
|
|
3477
|
-
style:
|
|
3487
|
+
style: F(h($))
|
|
3478
3488
|
}, x(h(a)("mediaPicker.assetGrid.noPoster")), 5)
|
|
3479
3489
|
])),
|
|
3480
|
-
h(Re)(S) ? (y(), k("div",
|
|
3481
|
-
b("span",
|
|
3490
|
+
h(Re)(S) ? (y(), k("div", ci, [
|
|
3491
|
+
b("span", pi, [
|
|
3482
3492
|
W(v, {
|
|
3483
3493
|
name: "play_arrow",
|
|
3484
3494
|
size: "md",
|
|
3485
3495
|
color: "white"
|
|
3486
3496
|
})
|
|
3487
3497
|
])
|
|
3488
|
-
])) :
|
|
3498
|
+
])) : j("", !0),
|
|
3489
3499
|
e.selectable ? (y(), k("button", {
|
|
3490
3500
|
key: 3,
|
|
3491
3501
|
class: ee(["absolute top-8 left-8 z-10 w-24 h-24 rounded-full flex items-center justify-center", e.selectedIds.has(S.id) ? "" : "bg-black/30 border border-white/80"]),
|
|
3492
|
-
style:
|
|
3502
|
+
style: F(e.selectedIds.has(S.id) ? { background: h(me) } : {}),
|
|
3493
3503
|
onClick: ct((re) => d(S), ["stop"])
|
|
3494
3504
|
}, [
|
|
3495
3505
|
e.selectedIds.has(S.id) ? (y(), oe(v, {
|
|
@@ -3497,17 +3507,17 @@ const Wr = {
|
|
|
3497
3507
|
name: "check",
|
|
3498
3508
|
size: "sm",
|
|
3499
3509
|
color: "white"
|
|
3500
|
-
})) :
|
|
3501
|
-
], 14,
|
|
3510
|
+
})) : j("", !0)
|
|
3511
|
+
], 14, fi)) : j("", !0),
|
|
3502
3512
|
b("span", {
|
|
3503
3513
|
class: "absolute bottom-8 left-8 bg-black/70 text-white font-semibold rounded",
|
|
3504
|
-
style:
|
|
3514
|
+
style: F([h($), h(bt)])
|
|
3505
3515
|
}, x(_(S.mimeType)), 5),
|
|
3506
3516
|
u(S) ? (y(), k("span", {
|
|
3507
3517
|
key: 4,
|
|
3508
3518
|
class: "absolute bottom-8 right-8 bg-black/70 text-white font-semibold rounded",
|
|
3509
|
-
style:
|
|
3510
|
-
}, x(u(S)), 5)) :
|
|
3519
|
+
style: F([h($), h(bt)])
|
|
3520
|
+
}, x(u(S)), 5)) : j("", !0),
|
|
3511
3521
|
o(S) ? (y(), k("span", {
|
|
3512
3522
|
key: 5,
|
|
3513
3523
|
class: ee(["absolute bottom-8 right-8 text-white font-semibold rounded", {
|
|
@@ -3515,28 +3525,28 @@ const Wr = {
|
|
|
3515
3525
|
"bg-blue-600/90": o(S).tone === "progress",
|
|
3516
3526
|
"bg-amber-600/90": o(S).tone === "warning"
|
|
3517
3527
|
}]),
|
|
3518
|
-
style:
|
|
3519
|
-
}, x(
|
|
3528
|
+
style: F([h($), h(bt)])
|
|
3529
|
+
}, x(p(o(S))), 7)) : j("", !0)
|
|
3520
3530
|
]),
|
|
3521
|
-
b("div",
|
|
3522
|
-
b("div",
|
|
3531
|
+
b("div", mi, [
|
|
3532
|
+
b("div", gi, x(S.fileName), 1),
|
|
3523
3533
|
b("span", {
|
|
3524
3534
|
class: "text-gray-500 truncate",
|
|
3525
|
-
style:
|
|
3535
|
+
style: F(h($))
|
|
3526
3536
|
}, [
|
|
3527
3537
|
h(ze)(S) ? (y(), k(Z, { key: 0 }, [
|
|
3528
|
-
|
|
3529
|
-
], 64)) :
|
|
3530
|
-
|
|
3538
|
+
ce(x(h(ze)(S)) + " · ", 1)
|
|
3539
|
+
], 64)) : j("", !0),
|
|
3540
|
+
ce(x(P(S.fileSizeBytes)), 1)
|
|
3531
3541
|
], 4)
|
|
3532
3542
|
])
|
|
3533
|
-
], 14,
|
|
3543
|
+
], 14, li)), [
|
|
3534
3544
|
[Q, i(S)]
|
|
3535
3545
|
])), 128))
|
|
3536
3546
|
]));
|
|
3537
3547
|
};
|
|
3538
3548
|
}
|
|
3539
|
-
}),
|
|
3549
|
+
}), bi = { class: "flex flex-wrap items-center gap-8" }, yi = /* @__PURE__ */ be({
|
|
3540
3550
|
__name: "TagFilterTabs",
|
|
3541
3551
|
props: {
|
|
3542
3552
|
tags: {},
|
|
@@ -3548,7 +3558,7 @@ const Wr = {
|
|
|
3548
3558
|
const { t: a } = ye({ messages: ve }), n = t;
|
|
3549
3559
|
return (o, r) => {
|
|
3550
3560
|
const i = K("FmChip");
|
|
3551
|
-
return y(), k("div",
|
|
3561
|
+
return y(), k("div", bi, [
|
|
3552
3562
|
W(i, {
|
|
3553
3563
|
selectable: "",
|
|
3554
3564
|
selected: e.modelValue === null,
|
|
@@ -3558,10 +3568,10 @@ const Wr = {
|
|
|
3558
3568
|
b("span", {
|
|
3559
3569
|
class: ee(["fm-typo-en-body-md-600 flex items-center gap-6", { "text-white": e.modelValue === null }])
|
|
3560
3570
|
}, [
|
|
3561
|
-
|
|
3571
|
+
ce(x(h(a)("mediaPicker.tagFilterTabs.all")) + " ", 1),
|
|
3562
3572
|
b("span", {
|
|
3563
3573
|
class: ee(["leading-none rounded-full px-6 py-2", e.modelValue === null ? "bg-white/25" : "bg-fm-color-neutral-gray-100"]),
|
|
3564
|
-
style:
|
|
3574
|
+
style: F(h($))
|
|
3565
3575
|
}, x(e.total), 7)
|
|
3566
3576
|
], 2)
|
|
3567
3577
|
]),
|
|
@@ -3577,10 +3587,10 @@ const Wr = {
|
|
|
3577
3587
|
b("span", {
|
|
3578
3588
|
class: ee(["fm-typo-en-body-md-600 flex items-center gap-6", { "text-white": e.modelValue === s.tag }])
|
|
3579
3589
|
}, [
|
|
3580
|
-
|
|
3590
|
+
ce(x(s.tag) + " ", 1),
|
|
3581
3591
|
b("span", {
|
|
3582
3592
|
class: ee(["leading-none rounded-full px-6 py-2", e.modelValue === s.tag ? "bg-white/25" : "bg-fm-color-neutral-gray-100"]),
|
|
3583
|
-
style:
|
|
3593
|
+
style: F(h($))
|
|
3584
3594
|
}, x(s.count), 7)
|
|
3585
3595
|
], 2)
|
|
3586
3596
|
]),
|
|
@@ -3589,10 +3599,10 @@ const Wr = {
|
|
|
3589
3599
|
]);
|
|
3590
3600
|
};
|
|
3591
3601
|
}
|
|
3592
|
-
}),
|
|
3602
|
+
}), vi = { class: "flex items-center gap-12 py-4 px-2" }, wi = { class: "text-xs font-semibold text-fm-color-typo-secondary shrink-0" }, ki = { class: "flex flex-wrap items-center gap-6" }, xi = ["onClick"], Pi = {
|
|
3593
3603
|
key: 0,
|
|
3594
3604
|
class: "text-xs text-fm-color-typo-secondary shrink-0"
|
|
3595
|
-
},
|
|
3605
|
+
}, Ei = /* @__PURE__ */ be({
|
|
3596
3606
|
__name: "RatioPickerBar",
|
|
3597
3607
|
props: /* @__PURE__ */ yt({
|
|
3598
3608
|
facts: {},
|
|
@@ -3626,48 +3636,48 @@ const Wr = {
|
|
|
3626
3636
|
}
|
|
3627
3637
|
function s(u, c) {
|
|
3628
3638
|
var d;
|
|
3629
|
-
const
|
|
3639
|
+
const p = c !== void 0 && ((d = a.unavailableRatios) == null ? void 0 : d.has(c));
|
|
3630
3640
|
return [
|
|
3631
3641
|
"height:28px",
|
|
3632
3642
|
$,
|
|
3633
|
-
u && !
|
|
3643
|
+
u && !p ? { borderColor: me, color: me, background: Nt } : {}
|
|
3634
3644
|
];
|
|
3635
3645
|
}
|
|
3636
3646
|
return (u, c) => {
|
|
3637
3647
|
const d = ua("tooltip");
|
|
3638
|
-
return y(), k("div",
|
|
3639
|
-
b("span",
|
|
3640
|
-
b("div",
|
|
3648
|
+
return y(), k("div", vi, [
|
|
3649
|
+
b("span", wi, x(h(t)("mediaPicker.ratioBar.label")), 1),
|
|
3650
|
+
b("div", ki, [
|
|
3641
3651
|
b("button", {
|
|
3642
3652
|
type: "button",
|
|
3643
3653
|
class: ee(["px-12 rounded-full border font-semibold transition-colors", r(n.value === null)]),
|
|
3644
|
-
style:
|
|
3645
|
-
onClick: c[0] || (c[0] = (
|
|
3654
|
+
style: F(s(n.value === null)),
|
|
3655
|
+
onClick: c[0] || (c[0] = (p) => o(null))
|
|
3646
3656
|
}, x(h(t)("mediaPicker.variants.original")), 7),
|
|
3647
|
-
(y(!0), k(Z, null, he(h(Dt), (
|
|
3648
|
-
key:
|
|
3657
|
+
(y(!0), k(Z, null, he(h(Dt), (p) => et((y(), k("button", {
|
|
3658
|
+
key: p,
|
|
3649
3659
|
type: "button",
|
|
3650
|
-
class: ee(["px-12 rounded-full border font-semibold transition-colors", r(n.value ===
|
|
3651
|
-
style:
|
|
3652
|
-
onClick: (w) => o(
|
|
3660
|
+
class: ee(["px-12 rounded-full border font-semibold transition-colors", r(n.value === p, p)]),
|
|
3661
|
+
style: F(s(n.value === p, p)),
|
|
3662
|
+
onClick: (w) => o(p)
|
|
3653
3663
|
}, [
|
|
3654
|
-
|
|
3655
|
-
], 14,
|
|
3656
|
-
[d, i(
|
|
3664
|
+
ce(x(h(Be)(p)), 1)
|
|
3665
|
+
], 14, xi)), [
|
|
3666
|
+
[d, i(p)]
|
|
3657
3667
|
])), 128))
|
|
3658
3668
|
]),
|
|
3659
3669
|
c[1] || (c[1] = b("div", { class: "flex-1" }, null, -1)),
|
|
3660
|
-
e.facts ? (y(), k("span",
|
|
3670
|
+
e.facts ? (y(), k("span", Pi, x(e.facts.dimensions) + " · " + x(h(lr)(e.facts.sizeBytes)), 1)) : j("", !0)
|
|
3661
3671
|
]);
|
|
3662
3672
|
};
|
|
3663
3673
|
}
|
|
3664
3674
|
});
|
|
3665
|
-
function
|
|
3675
|
+
function ja(e) {
|
|
3666
3676
|
var t, a;
|
|
3667
3677
|
const n = (a = (t = e == null ? void 0 : e.response) == null ? void 0 : t.data) == null ? void 0 : a.message;
|
|
3668
3678
|
return n || (e instanceof Error ? e.message : (e == null ? void 0 : e.message) || String(e));
|
|
3669
3679
|
}
|
|
3670
|
-
function
|
|
3680
|
+
function Ri(e) {
|
|
3671
3681
|
switch (e) {
|
|
3672
3682
|
case "INSUFFICIENT_TOKENS":
|
|
3673
3683
|
return "mediaPicker.variants.failedNoTokens";
|
|
@@ -3677,7 +3687,7 @@ function Ei(e) {
|
|
|
3677
3687
|
return "mediaPicker.variants.failed";
|
|
3678
3688
|
}
|
|
3679
3689
|
}
|
|
3680
|
-
const
|
|
3690
|
+
const Si = { class: "space-y-8" }, Ti = { class: "text-xs font-semibold text-gray-500" }, Oi = { class: "flex flex-wrap gap-8" }, Ci = ["onClick"], Ai = /* @__PURE__ */ be({
|
|
3681
3691
|
__name: "RatioSelector",
|
|
3682
3692
|
props: {
|
|
3683
3693
|
modelValue: {},
|
|
@@ -3692,9 +3702,9 @@ const Ri = { class: "space-y-8" }, Si = { class: "text-xs font-semibold text-gra
|
|
|
3692
3702
|
n.modelValue.includes(i) ? n.modelValue.filter((s) => s !== i) : [...n.modelValue, i]
|
|
3693
3703
|
);
|
|
3694
3704
|
}
|
|
3695
|
-
return (i, s) => (y(), k("div",
|
|
3696
|
-
b("div",
|
|
3697
|
-
b("div",
|
|
3705
|
+
return (i, s) => (y(), k("div", Si, [
|
|
3706
|
+
b("div", Ti, x(h(a)("mediaPicker.ratios.title")), 1),
|
|
3707
|
+
b("div", Oi, [
|
|
3698
3708
|
(y(!0), k(Z, null, he(h(Dt), (u) => (y(), k("button", {
|
|
3699
3709
|
key: u,
|
|
3700
3710
|
type: "button",
|
|
@@ -3702,17 +3712,17 @@ const Ri = { class: "space-y-8" }, Si = { class: "text-xs font-semibold text-gra
|
|
|
3702
3712
|
e.modelValue.includes(u) ? "" : "border-fm-color-neutral-gray-300 text-gray-500",
|
|
3703
3713
|
e.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
3704
3714
|
]]),
|
|
3705
|
-
style:
|
|
3715
|
+
style: F([
|
|
3706
3716
|
"height:30px",
|
|
3707
3717
|
h($),
|
|
3708
3718
|
e.modelValue.includes(u) ? { borderColor: h(me), color: h(me), background: h(Nt) } : {}
|
|
3709
3719
|
]),
|
|
3710
3720
|
onClick: (c) => r(u)
|
|
3711
|
-
}, x(h(Be)(u)), 15,
|
|
3721
|
+
}, x(h(Be)(u)), 15, Ci))), 128))
|
|
3712
3722
|
]),
|
|
3713
3723
|
b("div", {
|
|
3714
3724
|
class: "text-gray-400",
|
|
3715
|
-
style:
|
|
3725
|
+
style: F(h($))
|
|
3716
3726
|
}, x(h(a)("mediaPicker.ratios.hint")), 5)
|
|
3717
3727
|
]));
|
|
3718
3728
|
}
|
|
@@ -3723,11 +3733,11 @@ function sa(e) {
|
|
|
3723
3733
|
a.onload = () => t({ width: a.naturalWidth || 480, height: a.naturalHeight || 360 }), a.onerror = () => t({ width: 480, height: 360 }), a.src = e;
|
|
3724
3734
|
});
|
|
3725
3735
|
}
|
|
3726
|
-
const
|
|
3736
|
+
const Bi = { class: "flex flex-wrap items-center gap-8" }, _i = {
|
|
3727
3737
|
key: 1,
|
|
3728
3738
|
class: "inline-flex items-center gap-4 border rounded-full border-gray-300 pl-8 pr-4",
|
|
3729
3739
|
style: { height: "28px" }
|
|
3730
|
-
},
|
|
3740
|
+
}, Di = ["placeholder"], Mi = /* @__PURE__ */ be({
|
|
3731
3741
|
__name: "TagFilterBar",
|
|
3732
3742
|
props: {
|
|
3733
3743
|
tags: {},
|
|
@@ -3746,15 +3756,15 @@ const Ai = { class: "flex flex-wrap items-center gap-8" }, Bi = {
|
|
|
3746
3756
|
i.value = "", u && (n.modelValue.includes(u) || o("update:modelValue", [...n.modelValue, u]), n.tags.includes(u) || o("tag-created", u));
|
|
3747
3757
|
}
|
|
3748
3758
|
return (u, c) => {
|
|
3749
|
-
const d = K("FmChip"),
|
|
3750
|
-
return y(), k("div",
|
|
3759
|
+
const d = K("FmChip"), p = K("FmIcon");
|
|
3760
|
+
return y(), k("div", Bi, [
|
|
3751
3761
|
e.mode === "filter" ? (y(), oe(d, {
|
|
3752
3762
|
key: 0,
|
|
3753
3763
|
label: h(a)("mediaPicker.tagFilterBar.all"),
|
|
3754
3764
|
selected: e.modelValue.length === 0,
|
|
3755
3765
|
selectable: "",
|
|
3756
3766
|
onClick: c[0] || (c[0] = (w) => o("update:modelValue", []))
|
|
3757
|
-
}, null, 8, ["label", "selected"])) :
|
|
3767
|
+
}, null, 8, ["label", "selected"])) : j("", !0),
|
|
3758
3768
|
(y(!0), k(Z, null, he(e.tags, (w) => (y(), oe(d, {
|
|
3759
3769
|
key: w,
|
|
3760
3770
|
label: w,
|
|
@@ -3762,44 +3772,44 @@ const Ai = { class: "flex flex-wrap items-center gap-8" }, Bi = {
|
|
|
3762
3772
|
selectable: "",
|
|
3763
3773
|
onClick: (_) => r(w)
|
|
3764
3774
|
}, null, 8, ["label", "selected", "onClick"]))), 128)),
|
|
3765
|
-
e.mode === "assign" ? (y(), k("div",
|
|
3775
|
+
e.mode === "assign" ? (y(), k("div", _i, [
|
|
3766
3776
|
et(b("input", {
|
|
3767
3777
|
"onUpdate:modelValue": c[1] || (c[1] = (w) => i.value = w),
|
|
3768
3778
|
placeholder: h(a)("mediaPicker.tagFilterBar.newTagPlaceholder"),
|
|
3769
3779
|
class: "text-xs outline-none",
|
|
3770
3780
|
style: { width: "88px" },
|
|
3771
3781
|
onKeyup: $a(s, ["enter"])
|
|
3772
|
-
}, null, 40,
|
|
3782
|
+
}, null, 40, Di), [
|
|
3773
3783
|
[Ja, i.value]
|
|
3774
3784
|
]),
|
|
3775
3785
|
b("button", {
|
|
3776
3786
|
class: "p-2",
|
|
3777
3787
|
onClick: s
|
|
3778
3788
|
}, [
|
|
3779
|
-
W(
|
|
3789
|
+
W(p, {
|
|
3780
3790
|
name: "add",
|
|
3781
3791
|
size: "sm"
|
|
3782
3792
|
})
|
|
3783
3793
|
])
|
|
3784
|
-
])) :
|
|
3794
|
+
])) : j("", !0)
|
|
3785
3795
|
]);
|
|
3786
3796
|
};
|
|
3787
3797
|
}
|
|
3788
|
-
}), za = 10 * 1024 * 1024, Va = 512 * 1024 * 1024,
|
|
3798
|
+
}), za = 10 * 1024 * 1024, Va = 512 * 1024 * 1024, Ni = ["image/jpeg", "image/png", "image/webp"], Ii = ["video/mp4", "video/quicktime", "video/webm"], la = ["image", "video"];
|
|
3789
3799
|
function ut(e) {
|
|
3790
3800
|
return !e || e.length === 0 ? la : la.filter((t) => e.includes(t));
|
|
3791
3801
|
}
|
|
3792
|
-
function
|
|
3802
|
+
function Ui(e) {
|
|
3793
3803
|
return ut(e).includes("image");
|
|
3794
3804
|
}
|
|
3795
3805
|
function qa(e) {
|
|
3796
3806
|
return ut(e).includes("video");
|
|
3797
3807
|
}
|
|
3798
|
-
function
|
|
3808
|
+
function Li(e) {
|
|
3799
3809
|
const t = ut(e), a = [];
|
|
3800
|
-
return t.includes("image") && a.push(...
|
|
3810
|
+
return t.includes("image") && a.push(...Ni), t.includes("video") && a.push(...Ii), a.join(",");
|
|
3801
3811
|
}
|
|
3802
|
-
function
|
|
3812
|
+
function Fi(e) {
|
|
3803
3813
|
return qa(e) ? Va : za;
|
|
3804
3814
|
}
|
|
3805
3815
|
function Ut(e) {
|
|
@@ -3808,20 +3818,20 @@ function Ut(e) {
|
|
|
3808
3818
|
function ji(e) {
|
|
3809
3819
|
return Ut(e) === "video" ? Va : za;
|
|
3810
3820
|
}
|
|
3811
|
-
function
|
|
3821
|
+
function zi(e, t) {
|
|
3812
3822
|
return ut(t).includes(Ut(e));
|
|
3813
3823
|
}
|
|
3814
|
-
const
|
|
3824
|
+
const Vi = { class: "space-y-16" }, qi = {
|
|
3815
3825
|
key: 2,
|
|
3816
3826
|
class: "space-y-8"
|
|
3817
|
-
},
|
|
3827
|
+
}, Wi = { class: "text-xs font-semibold text-gray-500" }, Gi = ["src"], $i = {
|
|
3818
3828
|
key: 1,
|
|
3819
3829
|
class: "rounded flex-shrink-0 flex items-center justify-center bg-fm-color-neutral-gray-100 text-gray-400",
|
|
3820
3830
|
style: { width: "44px", height: "44px" }
|
|
3821
|
-
},
|
|
3831
|
+
}, Ji = { class: "flex-1 min-w-0 flex flex-col gap-2" }, Hi = { class: "text-xs font-semibold truncate" }, Ki = ["onClick"], Xi = { class: "space-y-8" }, Qi = { class: "text-xs font-semibold text-gray-500" }, Yi = {
|
|
3822
3832
|
key: 0,
|
|
3823
3833
|
class: "flex flex-wrap items-center gap-8"
|
|
3824
|
-
},
|
|
3834
|
+
}, Zi = ["onClick"], es = /* @__PURE__ */ be({
|
|
3825
3835
|
__name: "UploadPanel",
|
|
3826
3836
|
props: {
|
|
3827
3837
|
businessId: {},
|
|
@@ -3831,7 +3841,7 @@ const zi = { class: "space-y-16" }, Vi = {
|
|
|
3831
3841
|
},
|
|
3832
3842
|
emits: ["tag-created", "uploaded"],
|
|
3833
3843
|
setup(e, { expose: t, emit: a }) {
|
|
3834
|
-
const { t: n } = ye({ messages: ve }), o = e, r = a, i = G([]), s = G([]), u = G([]), c = G(!1), d = z(() => i.value.length),
|
|
3844
|
+
const { t: n } = ye({ messages: ve }), o = e, r = a, i = G([]), s = G([]), u = G([]), c = G(!1), d = z(() => i.value.length), p = z(() => o.availableTags.filter((m) => !s.value.includes(m)).slice(0, 6)), w = z(() => i.value.some((m) => m.isVideo)), _ = z(() => i.value.some((m) => !m.isVideo)), P = z(() => Li(o.kinds)), E = z(() => Fi(o.kinds)), R = z(() => Ui(o.kinds)), f = z(() => qa(o.kinds)), v = z(() => f.value ? R.value ? n("mediaPicker.uploadPanel.dropLabel") : n("mediaPicker.uploadPanel.dropLabelVideos") : n("mediaPicker.uploadPanel.dropLabelImages")), C = z(() => f.value ? R.value ? n("mediaPicker.uploadPanel.helperText") : n("mediaPicker.uploadPanel.helperTextVideos") : n("mediaPicker.uploadPanel.helperTextImages"));
|
|
3835
3845
|
function A(m) {
|
|
3836
3846
|
URL.revokeObjectURL(m.previewUrl), m.posterPreviewUrl && URL.revokeObjectURL(m.posterPreviewUrl);
|
|
3837
3847
|
}
|
|
@@ -3852,7 +3862,7 @@ const zi = { class: "space-y-16" }, Vi = {
|
|
|
3852
3862
|
posterPreviewUrl: null,
|
|
3853
3863
|
probed: !1
|
|
3854
3864
|
};
|
|
3855
|
-
if (i.value.push(U), !
|
|
3865
|
+
if (i.value.push(U), !zi(m, o.kinds)) {
|
|
3856
3866
|
U.error = n("mediaPicker.uploadPanel.kindNotAllowedError"), U.probed = !0;
|
|
3857
3867
|
return;
|
|
3858
3868
|
}
|
|
@@ -3865,8 +3875,8 @@ const zi = { class: "space-y-16" }, Vi = {
|
|
|
3865
3875
|
U.dimensions = await sa(g), U.probed = !0;
|
|
3866
3876
|
return;
|
|
3867
3877
|
}
|
|
3868
|
-
const M = await
|
|
3869
|
-
M && (U.dimensions = { width: M.width, height: M.height }, U.durationMs = M.durationMs, U.poster = await
|
|
3878
|
+
const M = await qr(g);
|
|
3879
|
+
M && (U.dimensions = { width: M.width, height: M.height }, U.durationMs = M.durationMs, U.poster = await Wr(g), U.poster && (U.posterPreviewUrl = URL.createObjectURL(U.poster))), U.probed = !0;
|
|
3870
3880
|
}
|
|
3871
3881
|
function S(m) {
|
|
3872
3882
|
return m.isVideo && m.probed && m.dimensions === null;
|
|
@@ -3882,12 +3892,12 @@ const zi = { class: "space-y-16" }, Vi = {
|
|
|
3882
3892
|
return m >= 1024 * 1024 ? `${(m / 1024 / 1024).toFixed(1)} MB` : `${Math.round(m / 1024)} KB`;
|
|
3883
3893
|
}
|
|
3884
3894
|
async function J(m) {
|
|
3885
|
-
const g = m.isVideo ? await
|
|
3886
|
-
return s.value.length ? await
|
|
3895
|
+
const g = m.isVideo ? await ue(m) : await H(m);
|
|
3896
|
+
return s.value.length ? await mr(o.businessId, g.id, s.value) : g;
|
|
3887
3897
|
}
|
|
3888
|
-
async function
|
|
3889
|
-
const g = m.dimensions ? { width: m.dimensions.width, height: m.dimensions.height, durationMs: m.durationMs ?? 0 } : { width: 0, height: 0, durationMs: 0 }, L = m.file.type, U = await
|
|
3890
|
-
refType:
|
|
3898
|
+
async function ue(m) {
|
|
3899
|
+
const g = m.dimensions ? { width: m.dimensions.width, height: m.dimensions.height, durationMs: m.durationMs ?? 0 } : { width: 0, height: 0, durationMs: 0 }, L = m.file.type, U = await kr(o.businessId, {
|
|
3900
|
+
refType: Ke,
|
|
3891
3901
|
refId: m.refId,
|
|
3892
3902
|
videoId: "main",
|
|
3893
3903
|
contentType: L,
|
|
@@ -3908,8 +3918,8 @@ const zi = { class: "space-y-16" }, Vi = {
|
|
|
3908
3918
|
});
|
|
3909
3919
|
} catch {
|
|
3910
3920
|
}
|
|
3911
|
-
return (await
|
|
3912
|
-
refType:
|
|
3921
|
+
return (await xr(o.businessId, {
|
|
3922
|
+
refType: Ke,
|
|
3913
3923
|
refId: m.refId,
|
|
3914
3924
|
videoId: "main",
|
|
3915
3925
|
restaurantId: o.restaurantId,
|
|
@@ -3923,8 +3933,8 @@ const zi = { class: "space-y-16" }, Vi = {
|
|
|
3923
3933
|
})).asset;
|
|
3924
3934
|
}
|
|
3925
3935
|
async function H(m) {
|
|
3926
|
-
const g = m.dimensions ?? await sa(m.previewUrl), L = m.file.type || "image/jpeg", U = await
|
|
3927
|
-
refType:
|
|
3936
|
+
const g = m.dimensions ?? await sa(m.previewUrl), L = m.file.type || "image/jpeg", U = await vr(o.businessId, {
|
|
3937
|
+
refType: Ke,
|
|
3928
3938
|
refId: m.refId,
|
|
3929
3939
|
imageId: "main",
|
|
3930
3940
|
contentType: L,
|
|
@@ -3932,8 +3942,8 @@ const zi = { class: "space-y-16" }, Vi = {
|
|
|
3932
3942
|
}), B = await fetch(U.uploadUrl, { method: "PUT", headers: { "Content-Type": L }, body: m.file });
|
|
3933
3943
|
if (!B.ok)
|
|
3934
3944
|
throw new Error(n("mediaPicker.uploadPanel.uploadFailedError", { status: B.status }));
|
|
3935
|
-
return (await
|
|
3936
|
-
refType:
|
|
3945
|
+
return (await wr(o.businessId, {
|
|
3946
|
+
refType: Ke,
|
|
3937
3947
|
refId: m.refId,
|
|
3938
3948
|
imageId: "main",
|
|
3939
3949
|
restaurantId: o.restaurantId,
|
|
@@ -3952,7 +3962,7 @@ const zi = { class: "space-y-16" }, Vi = {
|
|
|
3952
3962
|
return;
|
|
3953
3963
|
const U = await Promise.allSettled(g.map(J)), B = /* @__PURE__ */ new Set(), M = [];
|
|
3954
3964
|
U.forEach((I, ie) => {
|
|
3955
|
-
I.status === "rejected" ? (B.add(g[ie].id), g[ie].error =
|
|
3965
|
+
I.status === "rejected" ? (B.add(g[ie].id), g[ie].error = ja(I.reason)) : M.push(I.value);
|
|
3956
3966
|
}), i.value = [...L, ...g.filter((I) => B.has(I.id))], M.length > 0 && r("uploaded", M);
|
|
3957
3967
|
} finally {
|
|
3958
3968
|
c.value = !1;
|
|
@@ -3961,7 +3971,7 @@ const zi = { class: "space-y-16" }, Vi = {
|
|
|
3961
3971
|
}
|
|
3962
3972
|
return t({ stagedCount: d, uploading: c, upload: Y, reset: V }), (m, g) => {
|
|
3963
3973
|
const L = K("FmDropField"), U = K("FmIcon");
|
|
3964
|
-
return y(), k("div",
|
|
3974
|
+
return y(), k("div", Vi, [
|
|
3965
3975
|
W(L, {
|
|
3966
3976
|
label: v.value,
|
|
3967
3977
|
accept: P.value,
|
|
@@ -3972,60 +3982,60 @@ const zi = { class: "space-y-16" }, Vi = {
|
|
|
3972
3982
|
b("span", null, null, -1)
|
|
3973
3983
|
])]),
|
|
3974
3984
|
"helper-text": Se(() => [
|
|
3975
|
-
|
|
3985
|
+
ce(x(C.value), 1)
|
|
3976
3986
|
]),
|
|
3977
3987
|
_: 1
|
|
3978
3988
|
}, 8, ["label", "accept", "max-file-size"]),
|
|
3979
|
-
R.value && (_.value || !w.value) ? (y(), oe(
|
|
3989
|
+
R.value && (_.value || !w.value) ? (y(), oe(Ai, {
|
|
3980
3990
|
key: 0,
|
|
3981
3991
|
modelValue: u.value,
|
|
3982
3992
|
"onUpdate:modelValue": g[0] || (g[0] = (B) => u.value = B),
|
|
3983
3993
|
disabled: c.value
|
|
3984
|
-
}, null, 8, ["modelValue", "disabled"])) :
|
|
3994
|
+
}, null, 8, ["modelValue", "disabled"])) : j("", !0),
|
|
3985
3995
|
w.value && _.value ? (y(), k("div", {
|
|
3986
3996
|
key: 1,
|
|
3987
3997
|
class: "text-gray-500",
|
|
3988
|
-
style:
|
|
3989
|
-
}, x(h(n)("mediaPicker.uploadPanel.videoNoRatiosNote")), 5)) :
|
|
3990
|
-
i.value.length ? (y(), k("div",
|
|
3991
|
-
b("div",
|
|
3998
|
+
style: F(h($))
|
|
3999
|
+
}, x(h(n)("mediaPicker.uploadPanel.videoNoRatiosNote")), 5)) : j("", !0),
|
|
4000
|
+
i.value.length ? (y(), k("div", qi, [
|
|
4001
|
+
b("div", Wi, x(h(n)("mediaPicker.uploadPanel.stagedCount", { count: i.value.length })), 1),
|
|
3992
4002
|
(y(!0), k(Z, null, he(i.value, (B) => (y(), k("div", {
|
|
3993
4003
|
key: B.id,
|
|
3994
4004
|
class: ee(["flex items-center gap-12 p-8 border rounded-lg", B.error ? "border-red-300 bg-red-50" : "border-fm-color-neutral-gray-200"]),
|
|
3995
|
-
style:
|
|
4005
|
+
style: F(S(B) && !B.error ? h(Rr) : void 0)
|
|
3996
4006
|
}, [
|
|
3997
4007
|
!B.isVideo || B.posterPreviewUrl ? (y(), k("img", {
|
|
3998
4008
|
key: 0,
|
|
3999
4009
|
src: B.isVideo ? B.posterPreviewUrl : B.previewUrl,
|
|
4000
4010
|
class: "rounded flex-shrink-0 object-cover",
|
|
4001
4011
|
style: { width: "44px", height: "44px" }
|
|
4002
|
-
}, null, 8,
|
|
4012
|
+
}, null, 8, Gi)) : (y(), k("div", $i, [
|
|
4003
4013
|
W(U, {
|
|
4004
4014
|
name: "movie",
|
|
4005
4015
|
size: "sm"
|
|
4006
4016
|
})
|
|
4007
4017
|
])),
|
|
4008
|
-
b("div",
|
|
4009
|
-
b("span",
|
|
4018
|
+
b("div", Ji, [
|
|
4019
|
+
b("span", Hi, x(B.file.name), 1),
|
|
4010
4020
|
B.error ? (y(), k("span", {
|
|
4011
4021
|
key: 0,
|
|
4012
4022
|
class: "text-red-600",
|
|
4013
|
-
style:
|
|
4023
|
+
style: F(h($))
|
|
4014
4024
|
}, x(B.error), 5)) : S(B) ? (y(), k("span", {
|
|
4015
4025
|
key: 1,
|
|
4016
|
-
style:
|
|
4026
|
+
style: F([h($), h(Sr)])
|
|
4017
4027
|
}, x(h(n)("mediaPicker.uploadPanel.videoUndecodableWarning")), 5)) : (y(), k("span", {
|
|
4018
4028
|
key: 2,
|
|
4019
4029
|
class: "text-gray-500",
|
|
4020
|
-
style:
|
|
4030
|
+
style: F(h($))
|
|
4021
4031
|
}, [
|
|
4022
4032
|
B.dimensions ? (y(), k(Z, { key: 0 }, [
|
|
4023
|
-
|
|
4024
|
-
], 64)) :
|
|
4033
|
+
ce(x(B.dimensions.width) + "×" + x(B.dimensions.height) + " · ", 1)
|
|
4034
|
+
], 64)) : j("", !0),
|
|
4025
4035
|
re(B) ? (y(), k(Z, { key: 1 }, [
|
|
4026
|
-
|
|
4027
|
-
], 64)) :
|
|
4028
|
-
|
|
4036
|
+
ce(x(re(B)) + " · ", 1)
|
|
4037
|
+
], 64)) : j("", !0),
|
|
4038
|
+
ce(x(N(B.file.size)), 1)
|
|
4029
4039
|
], 4))
|
|
4030
4040
|
]),
|
|
4031
4041
|
b("button", {
|
|
@@ -4037,36 +4047,44 @@ const zi = { class: "space-y-16" }, Vi = {
|
|
|
4037
4047
|
name: "close",
|
|
4038
4048
|
size: "sm"
|
|
4039
4049
|
})
|
|
4040
|
-
], 8,
|
|
4050
|
+
], 8, Ki)
|
|
4041
4051
|
], 6))), 128))
|
|
4042
|
-
])) :
|
|
4043
|
-
b("div",
|
|
4044
|
-
b("div",
|
|
4045
|
-
W(
|
|
4052
|
+
])) : j("", !0),
|
|
4053
|
+
b("div", Xi, [
|
|
4054
|
+
b("div", Qi, x(h(n)("mediaPicker.uploadPanel.tagsLabel")), 1),
|
|
4055
|
+
W(Mi, {
|
|
4046
4056
|
modelValue: s.value,
|
|
4047
4057
|
"onUpdate:modelValue": g[1] || (g[1] = (B) => s.value = B),
|
|
4048
4058
|
tags: e.availableTags,
|
|
4049
4059
|
mode: "assign",
|
|
4050
4060
|
onTagCreated: g[2] || (g[2] = (B) => r("tag-created", B))
|
|
4051
4061
|
}, null, 8, ["modelValue", "tags"]),
|
|
4052
|
-
|
|
4062
|
+
p.value.length ? (y(), k("div", Yi, [
|
|
4053
4063
|
b("span", {
|
|
4054
4064
|
class: "text-gray-400",
|
|
4055
|
-
style:
|
|
4065
|
+
style: F(h($))
|
|
4056
4066
|
}, x(h(n)("mediaPicker.uploadPanel.suggestedTagsLabel")), 5),
|
|
4057
|
-
(y(!0), k(Z, null, he(
|
|
4067
|
+
(y(!0), k(Z, null, he(p.value, (B) => (y(), k("button", {
|
|
4058
4068
|
key: B,
|
|
4059
4069
|
class: "px-12 rounded-full border border-dashed border-fm-color-neutral-gray-300 font-semibold text-gray-500",
|
|
4060
|
-
style:
|
|
4070
|
+
style: F([h($), "height:26px"]),
|
|
4061
4071
|
onClick: (M) => s.value.push(B)
|
|
4062
|
-
}, " + " + x(B), 13,
|
|
4063
|
-
])) :
|
|
4072
|
+
}, " + " + x(B), 13, Zi))), 128))
|
|
4073
|
+
])) : j("", !0)
|
|
4064
4074
|
])
|
|
4065
4075
|
]);
|
|
4066
4076
|
};
|
|
4067
4077
|
}
|
|
4068
|
-
}),
|
|
4069
|
-
function
|
|
4078
|
+
}), ts = 5e3, as = 3;
|
|
4079
|
+
function ns(e) {
|
|
4080
|
+
const t = /* @__PURE__ */ new Map();
|
|
4081
|
+
for (const { refType: a, refId: n } of e) {
|
|
4082
|
+
const o = t.get(a);
|
|
4083
|
+
o ? o.push(n) : t.set(a, [n]);
|
|
4084
|
+
}
|
|
4085
|
+
return [...t.entries()];
|
|
4086
|
+
}
|
|
4087
|
+
function os(e) {
|
|
4070
4088
|
const t = G(/* @__PURE__ */ new Map());
|
|
4071
4089
|
let a = [], n, o = 0;
|
|
4072
4090
|
function r() {
|
|
@@ -4075,15 +4093,17 @@ function as(e) {
|
|
|
4075
4093
|
async function i() {
|
|
4076
4094
|
let u = !1;
|
|
4077
4095
|
try {
|
|
4078
|
-
const c =
|
|
4079
|
-
|
|
4096
|
+
const c = ns(a), d = await Promise.all(
|
|
4097
|
+
c.map(([p, w]) => yr({ businessId: e(), refType: p, refIds: w }))
|
|
4098
|
+
);
|
|
4099
|
+
t.value = new Map(d.flat().map((p) => [p.refId, p])), o = 0;
|
|
4080
4100
|
} catch (c) {
|
|
4081
|
-
if (u = !0, o += 1, o >=
|
|
4101
|
+
if (u = !0, o += 1, o >= as) {
|
|
4082
4102
|
console.warn("[media-picker] stopped polling image variants after repeated failures", c);
|
|
4083
4103
|
return;
|
|
4084
4104
|
}
|
|
4085
4105
|
}
|
|
4086
|
-
([...t.value.values()].some((c) => or(c.variants)) || u) && (n = setTimeout(i,
|
|
4106
|
+
([...t.value.values()].some((c) => or(c.variants)) || u) && (n = setTimeout(i, ts));
|
|
4087
4107
|
}
|
|
4088
4108
|
async function s(u) {
|
|
4089
4109
|
if (r(), o = 0, a = u, u.length === 0 || !e()) {
|
|
@@ -4094,19 +4114,19 @@ function as(e) {
|
|
|
4094
4114
|
}
|
|
4095
4115
|
return Ha(r), { byRefId: t, load: s, stop: r };
|
|
4096
4116
|
}
|
|
4097
|
-
const
|
|
4117
|
+
const rs = { class: "w-full flex items-center justify-between gap-16 pr-8" }, is = { class: "text-xs font-normal text-fm-color-typo-secondary" }, ss = { class: "relative" }, ls = {
|
|
4098
4118
|
key: 0,
|
|
4099
4119
|
class: "absolute inset-0 z-10 flex flex-col items-center justify-center gap-12 bg-white/80 rounded"
|
|
4100
|
-
},
|
|
4120
|
+
}, us = {
|
|
4101
4121
|
key: 1,
|
|
4102
4122
|
class: "flex gap-16 border-b border-fm-color-neutral-gray-200 mb-12"
|
|
4103
|
-
},
|
|
4123
|
+
}, ds = { class: "flex flex-col w-full" }, cs = {
|
|
4104
4124
|
key: 0,
|
|
4105
4125
|
class: "border-b border-fm-color-neutral-gray-200 pb-12 mb-12"
|
|
4106
|
-
},
|
|
4126
|
+
}, ps = { class: "flex items-center justify-between w-full" }, fs = {
|
|
4107
4127
|
key: 0,
|
|
4108
4128
|
class: "text-xs text-fm-color-typo-secondary"
|
|
4109
|
-
},
|
|
4129
|
+
}, ms = { key: 1 }, gs = { class: "flex gap-8" }, rl = /* @__PURE__ */ be({
|
|
4110
4130
|
__name: "MediaPickerModal",
|
|
4111
4131
|
props: {
|
|
4112
4132
|
open: { type: Boolean },
|
|
@@ -4127,7 +4147,7 @@ const ns = { class: "w-full flex items-center justify-between gap-16 pr-8" }, os
|
|
|
4127
4147
|
},
|
|
4128
4148
|
{ immediate: !0 }
|
|
4129
4149
|
);
|
|
4130
|
-
const s = G(""), u = G(null), c = G([]), d =
|
|
4150
|
+
const s = G(""), u = G(null), c = G([]), d = os(() => n.businessId), p = G([]), w = G(0), _ = G([]), P = G(!1);
|
|
4131
4151
|
async function E() {
|
|
4132
4152
|
if (n.businessId) {
|
|
4133
4153
|
P.value = !0;
|
|
@@ -4145,7 +4165,7 @@ const ns = { class: "w-full flex items-center justify-between gap-16 pr-8" }, os
|
|
|
4145
4165
|
descending: !0
|
|
4146
4166
|
});
|
|
4147
4167
|
c.value = m.resources, await d.load(
|
|
4148
|
-
m.resources.filter((g) => !Re(g)).
|
|
4168
|
+
m.resources.filter((g) => !Re(g)).filter((g) => !!g.refId && !!g.refType).map((g) => ({ refType: g.refType, refId: g.refId }))
|
|
4149
4169
|
);
|
|
4150
4170
|
} finally {
|
|
4151
4171
|
P.value = !1;
|
|
@@ -4156,7 +4176,7 @@ const ns = { class: "w-full flex items-center justify-between gap-16 pr-8" }, os
|
|
|
4156
4176
|
if (!n.businessId)
|
|
4157
4177
|
return;
|
|
4158
4178
|
const [m, g] = await Promise.all([La(n.businessId), cr(n.businessId)]);
|
|
4159
|
-
|
|
4179
|
+
p.value = m.tags, w.value = m.total, _.value = g;
|
|
4160
4180
|
}
|
|
4161
4181
|
xe(
|
|
4162
4182
|
() => n.open,
|
|
@@ -4168,9 +4188,9 @@ const ns = { class: "w-full flex items-center justify-between gap-16 pr-8" }, os
|
|
|
4168
4188
|
() => o.value.join(","),
|
|
4169
4189
|
() => E()
|
|
4170
4190
|
);
|
|
4171
|
-
let
|
|
4191
|
+
let f;
|
|
4172
4192
|
xe(s, () => {
|
|
4173
|
-
clearTimeout(
|
|
4193
|
+
clearTimeout(f), f = setTimeout(E, 250);
|
|
4174
4194
|
});
|
|
4175
4195
|
const v = G(n.ratio ?? null);
|
|
4176
4196
|
xe(
|
|
@@ -4215,7 +4235,7 @@ const ns = { class: "w-full flex items-center justify-between gap-16 pr-8" }, os
|
|
|
4215
4235
|
const g = A(m.asset).find((L) => L.aspectRatio === m.ratio);
|
|
4216
4236
|
return !(g != null && g.width) || !(g != null && g.height) || !g.fileSizeBytes ? null : { dimensions: `${g.width}×${g.height}`, sizeBytes: g.fileSizeBytes };
|
|
4217
4237
|
});
|
|
4218
|
-
function
|
|
4238
|
+
function ue() {
|
|
4219
4239
|
if (n.selectionMode === "single") {
|
|
4220
4240
|
const m = O.value[0];
|
|
4221
4241
|
if (!m)
|
|
@@ -4238,10 +4258,10 @@ const ns = { class: "w-full flex items-center justify-between gap-16 pr-8" }, os
|
|
|
4238
4258
|
"onUpdate:modelValue": g[8] || (g[8] = (M) => !M && r("update:open", !1))
|
|
4239
4259
|
}, {
|
|
4240
4260
|
"dialog-header": Se(() => [
|
|
4241
|
-
b("div",
|
|
4261
|
+
b("div", rs, [
|
|
4242
4262
|
b("div", null, [
|
|
4243
4263
|
b("div", null, x(h(a)("mediaPicker.pickerModal.title")), 1),
|
|
4244
|
-
b("div",
|
|
4264
|
+
b("div", is, x(e.selectionMode === "multiple" ? h(a)("mediaPicker.pickerModal.subtitleMultiple") : h(a)("mediaPicker.pickerModal.subtitleSingle")), 1)
|
|
4245
4265
|
]),
|
|
4246
4266
|
i.value === "browse" ? (y(), oe(L, {
|
|
4247
4267
|
key: 0,
|
|
@@ -4250,31 +4270,31 @@ const ns = { class: "w-full flex items-center justify-between gap-16 pr-8" }, os
|
|
|
4250
4270
|
placeholder: h(a)("mediaPicker.pickerModal.searchPlaceholder"),
|
|
4251
4271
|
class: "shrink-0",
|
|
4252
4272
|
style: { width: "200px" }
|
|
4253
|
-
}, null, 8, ["modelValue", "placeholder"])) :
|
|
4273
|
+
}, null, 8, ["modelValue", "placeholder"])) : j("", !0)
|
|
4254
4274
|
])
|
|
4255
4275
|
]),
|
|
4256
4276
|
"dialog-footer": Se(() => {
|
|
4257
4277
|
var M, I;
|
|
4258
4278
|
return [
|
|
4259
|
-
b("div",
|
|
4260
|
-
i.value === "browse" && e.selectionMode === "single" ? (y(), k("div",
|
|
4261
|
-
W(
|
|
4279
|
+
b("div", ds, [
|
|
4280
|
+
i.value === "browse" && e.selectionMode === "single" ? (y(), k("div", cs, [
|
|
4281
|
+
W(Ei, {
|
|
4262
4282
|
modelValue: v.value,
|
|
4263
4283
|
"onUpdate:modelValue": g[5] || (g[5] = (ie) => v.value = ie),
|
|
4264
4284
|
facts: J.value,
|
|
4265
4285
|
locked: C.value,
|
|
4266
4286
|
"unavailable-ratios": N.value
|
|
4267
4287
|
}, null, 8, ["modelValue", "facts", "locked", "unavailable-ratios"])
|
|
4268
|
-
])) :
|
|
4269
|
-
b("div",
|
|
4270
|
-
i.value === "browse" ? (y(), k("span",
|
|
4288
|
+
])) : j("", !0),
|
|
4289
|
+
b("div", ps, [
|
|
4290
|
+
i.value === "browse" ? (y(), k("span", fs, [
|
|
4271
4291
|
Q.value.size ? (y(), k(Z, { key: 0 }, [
|
|
4272
|
-
|
|
4292
|
+
ce(x(h(a)("mediaPicker.pickerModal.selectedCount", { count: Q.value.size })), 1)
|
|
4273
4293
|
], 64)) : (y(), k(Z, { key: 1 }, [
|
|
4274
|
-
|
|
4294
|
+
ce(x(h(a)("mediaPicker.pickerModal.selectPrompt")), 1)
|
|
4275
4295
|
], 64))
|
|
4276
|
-
])) : (y(), k("span",
|
|
4277
|
-
b("div",
|
|
4296
|
+
])) : (y(), k("span", ms)),
|
|
4297
|
+
b("div", gs, [
|
|
4278
4298
|
W(U, {
|
|
4279
4299
|
label: h(a)("mediaPicker.pickerModal.cancelButton"),
|
|
4280
4300
|
variant: "tertiary",
|
|
@@ -4294,7 +4314,7 @@ const ns = { class: "w-full flex items-center justify-between gap-16 pr-8" }, os
|
|
|
4294
4314
|
label: h(a)("mediaPicker.pickerModal.confirmButton"),
|
|
4295
4315
|
variant: "primary",
|
|
4296
4316
|
disabled: O.value.length === 0,
|
|
4297
|
-
onClick:
|
|
4317
|
+
onClick: ue
|
|
4298
4318
|
}, null, 8, ["label", "disabled"]))
|
|
4299
4319
|
])
|
|
4300
4320
|
])
|
|
@@ -4304,11 +4324,11 @@ const ns = { class: "w-full flex items-center justify-between gap-16 pr-8" }, os
|
|
|
4304
4324
|
default: Se(() => {
|
|
4305
4325
|
var M;
|
|
4306
4326
|
return [
|
|
4307
|
-
b("div",
|
|
4308
|
-
(M = H.value) != null && M.uploading ? (y(), k("div",
|
|
4327
|
+
b("div", ss, [
|
|
4328
|
+
(M = H.value) != null && M.uploading ? (y(), k("div", ls, [
|
|
4309
4329
|
(y(), k("svg", {
|
|
4310
4330
|
class: "animate-spin",
|
|
4311
|
-
style:
|
|
4331
|
+
style: F({ width: "32px", height: "32px", color: h(me) }),
|
|
4312
4332
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4313
4333
|
fill: "none",
|
|
4314
4334
|
viewBox: "0 0 24 24"
|
|
@@ -4329,31 +4349,31 @@ const ns = { class: "w-full flex items-center justify-between gap-16 pr-8" }, os
|
|
|
4329
4349
|
])], 4)),
|
|
4330
4350
|
b("span", {
|
|
4331
4351
|
class: "text-sm font-semibold",
|
|
4332
|
-
style:
|
|
4352
|
+
style: F({ color: h(me) })
|
|
4333
4353
|
}, x(h(a)("mediaPicker.uploadPanel.uploading")), 5)
|
|
4334
|
-
])) :
|
|
4335
|
-
e.allowUpload ? (y(), k("div",
|
|
4354
|
+
])) : j("", !0),
|
|
4355
|
+
e.allowUpload ? (y(), k("div", us, [
|
|
4336
4356
|
b("button", {
|
|
4337
4357
|
class: ee(["pb-8 px-4 text-sm", i.value === "browse" ? "font-semibold border-b-2" : "text-gray-500"]),
|
|
4338
|
-
style:
|
|
4358
|
+
style: F(i.value === "browse" ? { borderColor: h(me) } : {}),
|
|
4339
4359
|
onClick: g[1] || (g[1] = (I) => i.value = "browse")
|
|
4340
4360
|
}, x(h(a)("mediaPicker.pickerModal.browseTab")), 7),
|
|
4341
4361
|
b("button", {
|
|
4342
4362
|
class: ee(["pb-8 px-4 text-sm", i.value === "upload" ? "font-semibold border-b-2" : "text-gray-500"]),
|
|
4343
|
-
style:
|
|
4363
|
+
style: F(i.value === "upload" ? { borderColor: h(me) } : {}),
|
|
4344
4364
|
onClick: g[2] || (g[2] = (I) => i.value = "upload")
|
|
4345
4365
|
}, x(h(a)("mediaPicker.pickerModal.uploadTab")), 7)
|
|
4346
|
-
])) :
|
|
4366
|
+
])) : j("", !0),
|
|
4347
4367
|
i.value === "browse" ? (y(), k(Z, { key: 2 }, [
|
|
4348
|
-
|
|
4368
|
+
p.value.length ? (y(), oe(yi, {
|
|
4349
4369
|
key: 0,
|
|
4350
4370
|
modelValue: u.value,
|
|
4351
4371
|
"onUpdate:modelValue": g[3] || (g[3] = (I) => u.value = I),
|
|
4352
|
-
tags:
|
|
4372
|
+
tags: p.value,
|
|
4353
4373
|
total: w.value,
|
|
4354
4374
|
class: "mb-12"
|
|
4355
|
-
}, null, 8, ["modelValue", "tags", "total"])) :
|
|
4356
|
-
W(
|
|
4375
|
+
}, null, 8, ["modelValue", "tags", "total"])) : j("", !0),
|
|
4376
|
+
W(hi, {
|
|
4357
4377
|
assets: c.value,
|
|
4358
4378
|
loading: P.value,
|
|
4359
4379
|
selectable: "",
|
|
@@ -4364,7 +4384,7 @@ const ns = { class: "w-full flex items-center justify-between gap-16 pr-8" }, os
|
|
|
4364
4384
|
onOpen: re,
|
|
4365
4385
|
onToggle: S
|
|
4366
4386
|
}, null, 8, ["assets", "loading", "selected-ids", "variants-by-ref-id", "unavailable-ids", "unavailable-ratio"])
|
|
4367
|
-
], 64)) : e.allowUpload ? (y(), oe(
|
|
4387
|
+
], 64)) : e.allowUpload ? (y(), oe(es, {
|
|
4368
4388
|
key: 3,
|
|
4369
4389
|
ref_key: "uploadPanelRef",
|
|
4370
4390
|
ref: H,
|
|
@@ -4374,7 +4394,7 @@ const ns = { class: "w-full flex items-center justify-between gap-16 pr-8" }, os
|
|
|
4374
4394
|
kinds: o.value,
|
|
4375
4395
|
onTagCreated: g[4] || (g[4] = (I) => _.value.push(I)),
|
|
4376
4396
|
onUploaded: Y
|
|
4377
|
-
}, null, 8, ["business-id", "restaurant-id", "available-tags", "kinds"])) :
|
|
4397
|
+
}, null, 8, ["business-id", "restaurant-id", "available-tags", "kinds"])) : j("", !0)
|
|
4378
4398
|
])
|
|
4379
4399
|
];
|
|
4380
4400
|
}),
|
|
@@ -4382,29 +4402,29 @@ const ns = { class: "w-full flex items-center justify-between gap-16 pr-8" }, os
|
|
|
4382
4402
|
}, 8, ["model-value"]);
|
|
4383
4403
|
};
|
|
4384
4404
|
}
|
|
4385
|
-
}),
|
|
4386
|
-
function
|
|
4405
|
+
}), il = 60;
|
|
4406
|
+
function hs(e, t) {
|
|
4387
4407
|
return (e - 1) * t;
|
|
4388
4408
|
}
|
|
4389
|
-
function
|
|
4409
|
+
function bs(e, t, a) {
|
|
4390
4410
|
if (a === 0)
|
|
4391
4411
|
return { start: 0, end: 0 };
|
|
4392
|
-
const n =
|
|
4412
|
+
const n = hs(e, t) + 1;
|
|
4393
4413
|
return { start: n, end: Math.min(n + t - 1, a) };
|
|
4394
4414
|
}
|
|
4395
|
-
function
|
|
4415
|
+
function sl(e, t) {
|
|
4396
4416
|
return Math.min(Math.max(e, 1), Math.max(t, 1));
|
|
4397
4417
|
}
|
|
4398
|
-
function
|
|
4418
|
+
function ys(e) {
|
|
4399
4419
|
return Array.from({ length: Math.max(e, 0) }, (t, a) => ({
|
|
4400
4420
|
label: String(a + 1),
|
|
4401
4421
|
value: a + 1
|
|
4402
4422
|
}));
|
|
4403
4423
|
}
|
|
4404
|
-
const
|
|
4424
|
+
const vs = {
|
|
4405
4425
|
key: 0,
|
|
4406
4426
|
class: "flex items-center justify-between gap-24 mt-16 flex-wrap"
|
|
4407
|
-
},
|
|
4427
|
+
}, ws = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, ks = { class: "flex gap-8 items-center" }, xs = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary" }, ll = /* @__PURE__ */ be({
|
|
4408
4428
|
__name: "AssetPagination",
|
|
4409
4429
|
props: {
|
|
4410
4430
|
page: {},
|
|
@@ -4415,44 +4435,44 @@ const bs = {
|
|
|
4415
4435
|
},
|
|
4416
4436
|
emits: ["update:page"],
|
|
4417
4437
|
setup(e, { emit: t }) {
|
|
4418
|
-
const a = e, n = t, { t: o } = ye({ messages: ve }), r = z(() =>
|
|
4438
|
+
const a = e, n = t, { t: o } = ye({ messages: ve }), r = z(() => bs(a.page, a.pageSize, a.totalResources)), i = z(() => ys(a.totalPages)), s = z(() => a.page <= 1), u = z(() => a.page >= a.totalPages);
|
|
4419
4439
|
function c(d) {
|
|
4420
4440
|
d === a.page || d < 1 || d > a.totalPages || n("update:page", d);
|
|
4421
4441
|
}
|
|
4422
|
-
return (d,
|
|
4442
|
+
return (d, p) => {
|
|
4423
4443
|
const w = K("FmSelect"), _ = K("FmButton");
|
|
4424
|
-
return e.totalPages > 1 ? (y(), k("div",
|
|
4425
|
-
b("span",
|
|
4426
|
-
b("div",
|
|
4444
|
+
return e.totalPages > 1 ? (y(), k("div", vs, [
|
|
4445
|
+
b("span", ws, x(h(o)("mediaPicker.assetPagination.itemCount", { start: r.value.start, end: r.value.end, total: e.totalResources })), 1),
|
|
4446
|
+
b("div", ks, [
|
|
4427
4447
|
W(w, {
|
|
4428
4448
|
items: i.value,
|
|
4429
4449
|
"model-value": e.page,
|
|
4430
4450
|
disabled: e.disabled,
|
|
4431
|
-
"onUpdate:modelValue":
|
|
4451
|
+
"onUpdate:modelValue": p[0] || (p[0] = (P) => c(P))
|
|
4432
4452
|
}, null, 8, ["items", "model-value", "disabled"]),
|
|
4433
|
-
b("span",
|
|
4453
|
+
b("span", xs, x(h(o)("mediaPicker.assetPagination.pageCount", { total: e.totalPages })), 1),
|
|
4434
4454
|
W(_, {
|
|
4435
4455
|
icon: "chevron_left",
|
|
4436
4456
|
"icon-color": "neutral-black",
|
|
4437
4457
|
variant: "tertiary",
|
|
4438
4458
|
disabled: e.disabled || s.value,
|
|
4439
|
-
onClick:
|
|
4459
|
+
onClick: p[1] || (p[1] = (P) => c(e.page - 1))
|
|
4440
4460
|
}, null, 8, ["disabled"]),
|
|
4441
4461
|
W(_, {
|
|
4442
4462
|
icon: "chevron_right",
|
|
4443
4463
|
"icon-color": "neutral-black",
|
|
4444
4464
|
variant: "tertiary",
|
|
4445
4465
|
disabled: e.disabled || u.value,
|
|
4446
|
-
onClick:
|
|
4466
|
+
onClick: p[2] || (p[2] = (P) => c(e.page + 1))
|
|
4447
4467
|
}, null, 8, ["disabled"])
|
|
4448
4468
|
])
|
|
4449
|
-
])) :
|
|
4469
|
+
])) : j("", !0);
|
|
4450
4470
|
};
|
|
4451
4471
|
}
|
|
4452
|
-
}),
|
|
4472
|
+
}), Ps = { class: "relative flex-1 min-w-0 bg-gray-900 flex items-center justify-center overflow-hidden" }, Es = ["src", "alt"], Rs = {
|
|
4453
4473
|
key: 1,
|
|
4454
4474
|
class: "flex flex-col items-center gap-12 text-center px-24"
|
|
4455
|
-
},
|
|
4475
|
+
}, Ss = { class: "text-sm text-white" }, Ts = { class: "absolute bottom-12 left-1/2 -translate-x-1/2 flex items-center gap-8" }, Os = ["onClick"], Cs = /* @__PURE__ */ be({
|
|
4456
4476
|
__name: "VariantCarousel",
|
|
4457
4477
|
props: /* @__PURE__ */ yt({
|
|
4458
4478
|
original: {},
|
|
@@ -4470,50 +4490,50 @@ const bs = {
|
|
|
4470
4490
|
});
|
|
4471
4491
|
const s = z(() => i.value[r.value]);
|
|
4472
4492
|
function u(d) {
|
|
4473
|
-
const
|
|
4474
|
-
r.value = (r.value + d +
|
|
4493
|
+
const p = i.value.length;
|
|
4494
|
+
r.value = (r.value + d + p) % p;
|
|
4475
4495
|
}
|
|
4476
4496
|
function c(d) {
|
|
4477
4497
|
return d ? Be(d) : "";
|
|
4478
4498
|
}
|
|
4479
|
-
return (d,
|
|
4499
|
+
return (d, p) => {
|
|
4480
4500
|
var w, _, P, E;
|
|
4481
|
-
const R = K("FmIcon"),
|
|
4482
|
-
return y(), k("div",
|
|
4501
|
+
const R = K("FmIcon"), f = K("FmButton");
|
|
4502
|
+
return y(), k("div", Ps, [
|
|
4483
4503
|
(w = s.value) != null && w.url ? (y(), k("img", {
|
|
4484
4504
|
key: 0,
|
|
4485
4505
|
src: s.value.url,
|
|
4486
4506
|
alt: e.alt,
|
|
4487
4507
|
class: "max-w-full max-h-full object-contain"
|
|
4488
|
-
}, null, 8,
|
|
4508
|
+
}, null, 8, Es)) : s.value ? (y(), k("div", Rs, [
|
|
4489
4509
|
W(R, {
|
|
4490
4510
|
name: "error",
|
|
4491
4511
|
size: "lg",
|
|
4492
4512
|
color: "white"
|
|
4493
4513
|
}),
|
|
4494
|
-
b("span",
|
|
4495
|
-
W(
|
|
4514
|
+
b("span", Ss, x(h(a)(h(Ri)(s.value.failureCode))), 1),
|
|
4515
|
+
W(f, {
|
|
4496
4516
|
label: h(a)("mediaPicker.variants.regenerate"),
|
|
4497
4517
|
variant: "secondary",
|
|
4498
4518
|
size: "md",
|
|
4499
4519
|
"prepend-icon": "refresh",
|
|
4500
|
-
onClick:
|
|
4520
|
+
onClick: p[0] || (p[0] = (v) => s.value.ratio && o("regenerate", s.value.ratio))
|
|
4501
4521
|
}, null, 8, ["label"])
|
|
4502
|
-
])) :
|
|
4522
|
+
])) : j("", !0),
|
|
4503
4523
|
b("span", {
|
|
4504
4524
|
class: "absolute top-8 left-8 bg-black/70 text-white font-semibold px-8 rounded",
|
|
4505
|
-
style:
|
|
4525
|
+
style: F([h($), "padding-top:2px;padding-bottom:2px"])
|
|
4506
4526
|
}, [
|
|
4507
|
-
|
|
4527
|
+
ce(x(((_ = s.value) == null ? void 0 : _.kind) === "original" ? h(a)("mediaPicker.variants.original") : c(((P = s.value) == null ? void 0 : P.ratio) ?? null)) + " ", 1),
|
|
4508
4528
|
((E = s.value) == null ? void 0 : E.status) === "pending" ? (y(), k(Z, { key: 0 }, [
|
|
4509
|
-
|
|
4510
|
-
], 64)) :
|
|
4529
|
+
ce(" · " + x(h(a)("mediaPicker.variants.generating")), 1)
|
|
4530
|
+
], 64)) : j("", !0)
|
|
4511
4531
|
], 4),
|
|
4512
4532
|
i.value.length > 1 ? (y(), k(Z, { key: 2 }, [
|
|
4513
4533
|
b("button", {
|
|
4514
4534
|
class: "absolute left-8 top-1/2 -translate-y-1/2 rounded-full bg-black/50 flex items-center justify-center",
|
|
4515
4535
|
style: { width: "32px", height: "32px" },
|
|
4516
|
-
onClick:
|
|
4536
|
+
onClick: p[1] || (p[1] = (v) => u(-1))
|
|
4517
4537
|
}, [
|
|
4518
4538
|
W(R, {
|
|
4519
4539
|
name: "chevron_left",
|
|
@@ -4524,7 +4544,7 @@ const bs = {
|
|
|
4524
4544
|
b("button", {
|
|
4525
4545
|
class: "absolute right-8 top-1/2 -translate-y-1/2 rounded-full bg-black/50 flex items-center justify-center",
|
|
4526
4546
|
style: { width: "32px", height: "32px" },
|
|
4527
|
-
onClick:
|
|
4547
|
+
onClick: p[2] || (p[2] = (v) => u(1))
|
|
4528
4548
|
}, [
|
|
4529
4549
|
W(R, {
|
|
4530
4550
|
name: "chevron_right",
|
|
@@ -4532,47 +4552,47 @@ const bs = {
|
|
|
4532
4552
|
color: "white"
|
|
4533
4553
|
})
|
|
4534
4554
|
]),
|
|
4535
|
-
b("div",
|
|
4555
|
+
b("div", Ts, [
|
|
4536
4556
|
(y(!0), k(Z, null, he(i.value, (v, C) => (y(), k("button", {
|
|
4537
4557
|
key: v.key,
|
|
4538
4558
|
class: ee(["rounded-full", C === r.value ? "bg-white" : "bg-white/40"]),
|
|
4539
4559
|
style: { width: "8px", height: "8px" },
|
|
4540
4560
|
onClick: (A) => r.value = C
|
|
4541
|
-
}, null, 10,
|
|
4561
|
+
}, null, 10, Os))), 128))
|
|
4542
4562
|
])
|
|
4543
|
-
], 64)) :
|
|
4563
|
+
], 64)) : j("", !0)
|
|
4544
4564
|
]);
|
|
4545
4565
|
};
|
|
4546
4566
|
}
|
|
4547
|
-
}),
|
|
4567
|
+
}), As = {
|
|
4548
4568
|
key: 0,
|
|
4549
4569
|
class: "flex",
|
|
4550
4570
|
style: { height: "620px" }
|
|
4551
|
-
},
|
|
4571
|
+
}, Bs = {
|
|
4552
4572
|
key: 0,
|
|
4553
4573
|
class: "flex-1 min-w-0 bg-black flex items-center justify-center"
|
|
4554
|
-
},
|
|
4574
|
+
}, _s = ["src", "poster"], Ds = {
|
|
4555
4575
|
class: "flex-shrink-0 flex flex-col gap-12 p-16 overflow-y-auto",
|
|
4556
4576
|
style: { width: "320px" }
|
|
4557
|
-
},
|
|
4577
|
+
}, Ms = {
|
|
4558
4578
|
key: 0,
|
|
4559
4579
|
class: "text-sm text-red-600 bg-red-50 rounded-lg px-12 py-8"
|
|
4560
|
-
},
|
|
4580
|
+
}, Ns = { class: "flex items-center justify-between" }, Is = { class: "fm-typo-en-title-sm-600" }, Us = {
|
|
4561
4581
|
key: 1,
|
|
4562
4582
|
class: "flex items-start gap-8"
|
|
4563
|
-
},
|
|
4583
|
+
}, Ls = { class: "flex-1 text-sm font-semibold break-all" }, Fs = {
|
|
4564
4584
|
key: 2,
|
|
4565
4585
|
class: "flex gap-8"
|
|
4566
|
-
},
|
|
4586
|
+
}, js = { class: "text-xs space-y-8 border-t pt-8" }, zs = {
|
|
4567
4587
|
key: 0,
|
|
4568
4588
|
class: "flex justify-between"
|
|
4569
|
-
},
|
|
4589
|
+
}, Vs = { class: "text-gray-500" }, qs = { class: "font-semibold" }, Ws = {
|
|
4570
4590
|
key: 1,
|
|
4571
4591
|
class: "flex justify-between"
|
|
4572
|
-
},
|
|
4592
|
+
}, Gs = { class: "text-gray-500" }, $s = { class: "font-semibold" }, Js = { class: "flex justify-between" }, Hs = { class: "text-gray-500" }, Ks = { class: "flex justify-between" }, Xs = { class: "text-gray-500" }, Qs = { class: "flex justify-between" }, Ys = { class: "text-gray-500" }, Zs = {
|
|
4573
4593
|
key: 3,
|
|
4574
4594
|
class: "flex flex-wrap gap-4"
|
|
4575
|
-
},
|
|
4595
|
+
}, el = { class: "flex gap-8 border-t pt-12" }, ul = /* @__PURE__ */ be({
|
|
4576
4596
|
__name: "AssetDetailDialog",
|
|
4577
4597
|
props: {
|
|
4578
4598
|
asset: {},
|
|
@@ -4593,7 +4613,7 @@ const bs = {
|
|
|
4593
4613
|
s.value = ((O = o.asset) == null ? void 0 : O.fileName) ?? "", i.value = !0;
|
|
4594
4614
|
}
|
|
4595
4615
|
async function c() {
|
|
4596
|
-
o.asset && (await
|
|
4616
|
+
o.asset && (await fr(o.businessId, o.asset.id, s.value), i.value = !1, r("renamed"));
|
|
4597
4617
|
}
|
|
4598
4618
|
function d() {
|
|
4599
4619
|
if (!o.asset)
|
|
@@ -4608,14 +4628,14 @@ const bs = {
|
|
|
4608
4628
|
primaryActions: { text: n("mediaPicker.assetDetailDialog.deleteConfirmButton"), close: !1, variant: "destructive" },
|
|
4609
4629
|
secondaryActions: { text: n("mediaPicker.assetDetailDialog.cancelButton"), close: !0 }
|
|
4610
4630
|
}).onPrimary(async () => {
|
|
4611
|
-
await
|
|
4631
|
+
await Er(o.businessId, O), r("deleted", O.id), a.close();
|
|
4612
4632
|
});
|
|
4613
4633
|
}
|
|
4614
|
-
const
|
|
4615
|
-
var O, N, J,
|
|
4634
|
+
const p = G(0), w = z(() => {
|
|
4635
|
+
var O, N, J, ue, H, Y;
|
|
4616
4636
|
return {
|
|
4617
4637
|
url: ((O = o.image) == null ? void 0 : O.original.url) ?? ((N = o.asset) == null ? void 0 : N.url) ?? "",
|
|
4618
|
-
width: ((J = o.image) == null ? void 0 : J.original.width) ?? ((
|
|
4638
|
+
width: ((J = o.image) == null ? void 0 : J.original.width) ?? ((ue = o.asset) == null ? void 0 : ue.width),
|
|
4619
4639
|
height: ((H = o.image) == null ? void 0 : H.original.height) ?? ((Y = o.asset) == null ? void 0 : Y.height)
|
|
4620
4640
|
};
|
|
4621
4641
|
}), _ = z(
|
|
@@ -4627,17 +4647,17 @@ const bs = {
|
|
|
4627
4647
|
xe(() => {
|
|
4628
4648
|
var O;
|
|
4629
4649
|
return (O = o.asset) == null ? void 0 : O.id;
|
|
4630
|
-
}, () =>
|
|
4650
|
+
}, () => p.value = 0);
|
|
4631
4651
|
const P = z(() => {
|
|
4632
4652
|
var O;
|
|
4633
|
-
const N = _.value[
|
|
4653
|
+
const N = _.value[p.value];
|
|
4634
4654
|
return !N || !o.asset ? null : sr(N, o.asset, ((O = o.image) == null ? void 0 : O.variants) ?? []);
|
|
4635
4655
|
}), E = z(
|
|
4636
4656
|
() => {
|
|
4637
4657
|
var O;
|
|
4638
4658
|
return (O = P.value) != null && O.ratio ? Be(P.value.ratio) : n("mediaPicker.variants.original");
|
|
4639
4659
|
}
|
|
4640
|
-
), R = z(() => o.asset ? Re(o.asset) : !1),
|
|
4660
|
+
), R = z(() => o.asset ? Re(o.asset) : !1), f = z(() => o.asset ? Ia(o.asset) ?? void 0 : void 0), v = z(
|
|
4641
4661
|
() => {
|
|
4642
4662
|
var O;
|
|
4643
4663
|
return (O = o.asset) != null && O.durationMs ? It(o.asset.durationMs) : null;
|
|
@@ -4648,7 +4668,7 @@ const bs = {
|
|
|
4648
4668
|
if (!(!((N = o.asset) != null && N.refType) || !o.asset.refId || C.value)) {
|
|
4649
4669
|
C.value = !0, A.value = null;
|
|
4650
4670
|
try {
|
|
4651
|
-
await
|
|
4671
|
+
await hr(o.businessId, {
|
|
4652
4672
|
refType: o.asset.refType,
|
|
4653
4673
|
refId: o.asset.refId,
|
|
4654
4674
|
imageId: o.asset.imageId ?? "main",
|
|
@@ -4656,7 +4676,7 @@ const bs = {
|
|
|
4656
4676
|
mode: "append"
|
|
4657
4677
|
}), r("changed");
|
|
4658
4678
|
} catch (J) {
|
|
4659
|
-
A.value =
|
|
4679
|
+
A.value = ja(J);
|
|
4660
4680
|
} finally {
|
|
4661
4681
|
C.value = !1;
|
|
4662
4682
|
}
|
|
@@ -4674,7 +4694,7 @@ const bs = {
|
|
|
4674
4694
|
return O >= 1024 * 1024 ? `${(O / 1024 / 1024).toFixed(1)} MB` : `${Math.round(O / 1024)} KB`;
|
|
4675
4695
|
}
|
|
4676
4696
|
return (O, N) => {
|
|
4677
|
-
const J = K("FmIcon"),
|
|
4697
|
+
const J = K("FmIcon"), ue = K("FmTextField"), H = K("FmButton"), Y = K("FmDialog");
|
|
4678
4698
|
return y(), oe(Y, {
|
|
4679
4699
|
"model-value": !!e.asset,
|
|
4680
4700
|
"max-width": 920,
|
|
@@ -4686,29 +4706,29 @@ const bs = {
|
|
|
4686
4706
|
default: Se(() => {
|
|
4687
4707
|
var m, g, L, U, B;
|
|
4688
4708
|
return [
|
|
4689
|
-
e.asset ? (y(), k("div",
|
|
4690
|
-
R.value ? (y(), k("div",
|
|
4709
|
+
e.asset ? (y(), k("div", As, [
|
|
4710
|
+
R.value ? (y(), k("div", Bs, [
|
|
4691
4711
|
(y(), k("video", {
|
|
4692
4712
|
key: e.asset.id,
|
|
4693
4713
|
src: e.asset.url,
|
|
4694
|
-
poster:
|
|
4714
|
+
poster: f.value,
|
|
4695
4715
|
controls: "",
|
|
4696
4716
|
preload: "metadata",
|
|
4697
4717
|
class: "max-w-full max-h-full"
|
|
4698
|
-
}, null, 8,
|
|
4699
|
-
])) : (y(), oe(
|
|
4718
|
+
}, null, 8, _s))
|
|
4719
|
+
])) : (y(), oe(Cs, {
|
|
4700
4720
|
key: 1,
|
|
4701
|
-
index:
|
|
4702
|
-
"onUpdate:index": N[0] || (N[0] = (M) =>
|
|
4721
|
+
index: p.value,
|
|
4722
|
+
"onUpdate:index": N[0] || (N[0] = (M) => p.value = M),
|
|
4703
4723
|
original: w.value,
|
|
4704
4724
|
variants: ((m = e.image) == null ? void 0 : m.variants) ?? [],
|
|
4705
4725
|
alt: e.asset.fileName,
|
|
4706
4726
|
onRegenerate: V
|
|
4707
4727
|
}, null, 8, ["index", "original", "variants", "alt"])),
|
|
4708
|
-
b("div",
|
|
4709
|
-
A.value ? (y(), k("p",
|
|
4710
|
-
b("div",
|
|
4711
|
-
b("span",
|
|
4728
|
+
b("div", Ds, [
|
|
4729
|
+
A.value ? (y(), k("p", Ms, x(A.value), 1)) : j("", !0),
|
|
4730
|
+
b("div", Ns, [
|
|
4731
|
+
b("span", Is, x(h(n)("mediaPicker.assetDetailDialog.previewTitle")), 1),
|
|
4712
4732
|
b("button", {
|
|
4713
4733
|
class: "rounded-lg bg-fm-color-neutral-gray-100 flex items-center justify-center flex-shrink-0",
|
|
4714
4734
|
style: { width: "32px", height: "32px" },
|
|
@@ -4720,8 +4740,8 @@ const bs = {
|
|
|
4720
4740
|
})
|
|
4721
4741
|
])
|
|
4722
4742
|
]),
|
|
4723
|
-
i.value ? (y(), k("div",
|
|
4724
|
-
W(
|
|
4743
|
+
i.value ? (y(), k("div", Fs, [
|
|
4744
|
+
W(ue, {
|
|
4725
4745
|
modelValue: s.value,
|
|
4726
4746
|
"onUpdate:modelValue": N[2] || (N[2] = (M) => s.value = M),
|
|
4727
4747
|
class: "flex-1 min-w-0"
|
|
@@ -4733,8 +4753,8 @@ const bs = {
|
|
|
4733
4753
|
class: "flex-shrink-0",
|
|
4734
4754
|
onClick: c
|
|
4735
4755
|
}, null, 8, ["label"])
|
|
4736
|
-
])) : (y(), k("div",
|
|
4737
|
-
b("span",
|
|
4756
|
+
])) : (y(), k("div", Us, [
|
|
4757
|
+
b("span", Ls, x(e.asset.fileName), 1),
|
|
4738
4758
|
b("button", { onClick: u }, [
|
|
4739
4759
|
W(J, {
|
|
4740
4760
|
name: "edit",
|
|
@@ -4742,36 +4762,36 @@ const bs = {
|
|
|
4742
4762
|
})
|
|
4743
4763
|
])
|
|
4744
4764
|
])),
|
|
4745
|
-
b("div",
|
|
4746
|
-
R.value ? (y(), k("div",
|
|
4747
|
-
b("span",
|
|
4748
|
-
b("span",
|
|
4749
|
-
])) : (y(), k("div",
|
|
4750
|
-
b("span",
|
|
4751
|
-
b("span",
|
|
4765
|
+
b("div", js, [
|
|
4766
|
+
R.value ? (y(), k("div", zs, [
|
|
4767
|
+
b("span", Vs, x(h(n)("mediaPicker.assetDetailDialog.durationLabel")), 1),
|
|
4768
|
+
b("span", qs, x(v.value ?? "—"), 1)
|
|
4769
|
+
])) : (y(), k("div", Ws, [
|
|
4770
|
+
b("span", Gs, x(h(n)("mediaPicker.ratios.title")), 1),
|
|
4771
|
+
b("span", $s, x(E.value), 1)
|
|
4752
4772
|
])),
|
|
4753
|
-
b("div",
|
|
4754
|
-
b("span",
|
|
4773
|
+
b("div", Js, [
|
|
4774
|
+
b("span", Hs, x(h(n)("mediaPicker.assetDetailDialog.dimensionsLabel")), 1),
|
|
4755
4775
|
b("span", null, x(((g = P.value) == null ? void 0 : g.dimensions) ?? "—"), 1)
|
|
4756
4776
|
]),
|
|
4757
|
-
b("div",
|
|
4758
|
-
b("span",
|
|
4777
|
+
b("div", Ks, [
|
|
4778
|
+
b("span", Xs, x(h(n)("mediaPicker.assetDetailDialog.sizeLabel")), 1),
|
|
4759
4779
|
b("span", null, x((L = P.value) != null && L.sizeBytes ? re(P.value.sizeBytes) : "—"), 1)
|
|
4760
4780
|
]),
|
|
4761
|
-
b("div",
|
|
4762
|
-
b("span",
|
|
4781
|
+
b("div", Qs, [
|
|
4782
|
+
b("span", Ys, x(h(n)("mediaPicker.assetDetailDialog.formatLabel")), 1),
|
|
4763
4783
|
b("span", null, x((U = P.value) != null && U.contentType ? S(P.value.contentType) : "—"), 1)
|
|
4764
4784
|
])
|
|
4765
4785
|
]),
|
|
4766
|
-
(B = e.asset.tags) != null && B.length ? (y(), k("div",
|
|
4786
|
+
(B = e.asset.tags) != null && B.length ? (y(), k("div", Zs, [
|
|
4767
4787
|
(y(!0), k(Z, null, he(e.asset.tags, (M) => (y(), k("span", {
|
|
4768
4788
|
key: M,
|
|
4769
4789
|
class: "bg-gray-100 rounded-full px-8",
|
|
4770
|
-
style:
|
|
4790
|
+
style: F([h($), "padding-top:2px;padding-bottom:2px"])
|
|
4771
4791
|
}, " # " + x(M), 5))), 128))
|
|
4772
|
-
])) :
|
|
4792
|
+
])) : j("", !0),
|
|
4773
4793
|
N[4] || (N[4] = b("div", { class: "flex-1" }, null, -1)),
|
|
4774
|
-
b("div",
|
|
4794
|
+
b("div", el, [
|
|
4775
4795
|
W(H, {
|
|
4776
4796
|
label: h(n)("mediaPicker.assetDetailDialog.copyLinkButton"),
|
|
4777
4797
|
variant: "tertiary",
|
|
@@ -4789,7 +4809,7 @@ const bs = {
|
|
|
4789
4809
|
}, null, 8, ["label"])
|
|
4790
4810
|
])
|
|
4791
4811
|
])
|
|
4792
|
-
])) :
|
|
4812
|
+
])) : j("", !0)
|
|
4793
4813
|
];
|
|
4794
4814
|
}),
|
|
4795
4815
|
_: 1
|
|
@@ -4799,21 +4819,22 @@ const bs = {
|
|
|
4799
4819
|
});
|
|
4800
4820
|
export {
|
|
4801
4821
|
Re as E,
|
|
4802
|
-
|
|
4803
|
-
Pr as T,
|
|
4822
|
+
Mi as F,
|
|
4804
4823
|
Ua as U,
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
|
|
4824
|
+
os as a,
|
|
4825
|
+
hi as b,
|
|
4826
|
+
hs as c,
|
|
4808
4827
|
dr as d,
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
|
|
4812
|
-
|
|
4828
|
+
Er as e,
|
|
4829
|
+
cr as f,
|
|
4830
|
+
ul as g,
|
|
4831
|
+
ll as h,
|
|
4813
4832
|
ur as i,
|
|
4814
|
-
|
|
4833
|
+
rl as j,
|
|
4834
|
+
mr as k,
|
|
4815
4835
|
il as m,
|
|
4816
|
-
|
|
4817
|
-
|
|
4818
|
-
|
|
4836
|
+
sl as p,
|
|
4837
|
+
ol as r,
|
|
4838
|
+
es as t,
|
|
4839
|
+
br as y
|
|
4819
4840
|
};
|