@feedmepos/mf-media 0.0.10-dev.3 → 1.0.1-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-9f9c1203.js → AiStudio-a685be4a.js} +79 -78
- package/dist/{AssetLibrary-7609684b.js → AssetLibrary-bb6b1fb8.js} +73 -71
- package/dist/app.js +18 -18
- package/dist/media-picker-9b94d32f.js +4754 -0
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/dist/media-picker-cf281640.js +0 -4297
|
@@ -0,0 +1,4754 @@
|
|
|
1
|
+
import { defineComponent as ge, resolveComponent as J, resolveDirective as sa, openBlock as b, createElementBlock as k, toDisplayString as x, unref as m, createElementVNode as y, normalizeStyle as N, Fragment as Y, renderList as me, withDirectives as et, normalizeClass as Z, withModifiers as ct, createBlock as ne, createCommentVNode as U, createVNode as V, createTextVNode as se, ref as G, withKeys as za, vModelText as Va, computed as W, withCtx as Oe, onScopeDispose as qa, watch as we, mergeModels as bt, useModel as la } from "vue";
|
|
2
|
+
import { useI18n as he, useCoreStore as $a } from "@feedmepos/mf-common";
|
|
3
|
+
import { useDialog as Wa } from "@feedmepos/ui-library";
|
|
4
|
+
function ua(e, t) {
|
|
5
|
+
return function() {
|
|
6
|
+
return e.apply(t, arguments);
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
const { toString: Ga } = Object.prototype, { getPrototypeOf: _e } = Object, { iterator: qe, toStringTag: ca } = Symbol, tt = (({ hasOwnProperty: e }) => (t, a) => e.call(t, a))(Object.prototype), Ve = (e, t) => {
|
|
10
|
+
let a = e;
|
|
11
|
+
const n = [];
|
|
12
|
+
for (; a != null && a !== Object.prototype; ) {
|
|
13
|
+
if (n.indexOf(a) !== -1)
|
|
14
|
+
return !1;
|
|
15
|
+
if (n.push(a), tt(a, t))
|
|
16
|
+
return !0;
|
|
17
|
+
a = _e(a);
|
|
18
|
+
}
|
|
19
|
+
return !1;
|
|
20
|
+
}, Ha = (e, t) => e != null && Ve(e, t) ? e[t] : void 0, xt = ((e) => (t) => {
|
|
21
|
+
const a = Ga.call(t);
|
|
22
|
+
return e[a] || (e[a] = a.slice(8, -1).toLowerCase());
|
|
23
|
+
})(/* @__PURE__ */ Object.create(null)), fe = (e) => (e = e.toLowerCase(), (t) => xt(t) === e), rt = (e) => (t) => typeof t === e, { isArray: Re } = Array, Fe = rt("undefined");
|
|
24
|
+
function Ie(e) {
|
|
25
|
+
return e !== null && !Fe(e) && e.constructor !== null && !Fe(e.constructor) && re(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
26
|
+
}
|
|
27
|
+
const da = fe("ArrayBuffer");
|
|
28
|
+
function Ja(e) {
|
|
29
|
+
let t;
|
|
30
|
+
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && da(e.buffer), t;
|
|
31
|
+
}
|
|
32
|
+
const Ka = rt("string"), re = rt("function"), pa = rt("number"), Le = (e) => e !== null && typeof e == "object", Xa = (e) => e === !0 || e === !1, Xe = (e) => {
|
|
33
|
+
if (!Le(e))
|
|
34
|
+
return !1;
|
|
35
|
+
const t = _e(e);
|
|
36
|
+
return (t === null || t === Object.prototype || _e(t) === null) && // Treat any genuine (non-Object.prototype-polluted) Symbol.toStringTag or
|
|
37
|
+
// Symbol.iterator as evidence the value is a tagged/iterable type rather
|
|
38
|
+
// than a plain object, while ignoring keys injected onto Object.prototype.
|
|
39
|
+
!Ve(e, ca) && !Ve(e, qe);
|
|
40
|
+
}, Qa = (e) => {
|
|
41
|
+
if (!Le(e) || Ie(e))
|
|
42
|
+
return !1;
|
|
43
|
+
try {
|
|
44
|
+
return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
|
|
45
|
+
} catch {
|
|
46
|
+
return !1;
|
|
47
|
+
}
|
|
48
|
+
}, Ya = fe("Date"), Za = fe("File"), en = (e) => !!(e && typeof e.uri < "u"), tn = (e) => e && typeof e.getParts < "u", an = fe("Blob"), nn = fe("FileList"), on = (e) => Le(e) && re(e.pipe);
|
|
49
|
+
function rn() {
|
|
50
|
+
return typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {};
|
|
51
|
+
}
|
|
52
|
+
const zt = rn(), Vt = typeof zt.FormData < "u" ? zt.FormData : void 0, sn = (e) => {
|
|
53
|
+
if (!e)
|
|
54
|
+
return !1;
|
|
55
|
+
if (Vt && e instanceof Vt)
|
|
56
|
+
return !0;
|
|
57
|
+
const t = _e(e);
|
|
58
|
+
if (!t || t === Object.prototype || !re(e.append))
|
|
59
|
+
return !1;
|
|
60
|
+
const a = xt(e);
|
|
61
|
+
return a === "formdata" || // detect form-data instance
|
|
62
|
+
a === "object" && re(e.toString) && e.toString() === "[object FormData]";
|
|
63
|
+
}, ln = fe("URLSearchParams"), [un, cn, dn, pn] = [
|
|
64
|
+
"ReadableStream",
|
|
65
|
+
"Request",
|
|
66
|
+
"Response",
|
|
67
|
+
"Headers"
|
|
68
|
+
].map(fe), fn = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
69
|
+
function $e(e, t, { allOwnKeys: a = !1 } = {}) {
|
|
70
|
+
if (e === null || typeof e > "u")
|
|
71
|
+
return;
|
|
72
|
+
let n, o;
|
|
73
|
+
if (typeof e != "object" && (e = [e]), Re(e))
|
|
74
|
+
for (n = 0, o = e.length; n < o; n++)
|
|
75
|
+
t.call(null, e[n], n, e);
|
|
76
|
+
else {
|
|
77
|
+
if (Ie(e))
|
|
78
|
+
return;
|
|
79
|
+
const r = a ? Object.getOwnPropertyNames(e) : Object.keys(e), i = r.length;
|
|
80
|
+
let s;
|
|
81
|
+
for (n = 0; n < i; n++)
|
|
82
|
+
s = r[n], t.call(null, e[s], s, e);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function fa(e, t) {
|
|
86
|
+
if (Ie(e))
|
|
87
|
+
return null;
|
|
88
|
+
t = t.toLowerCase();
|
|
89
|
+
const a = Object.keys(e);
|
|
90
|
+
let n = a.length, o;
|
|
91
|
+
for (; n-- > 0; )
|
|
92
|
+
if (o = a[n], t === o.toLowerCase())
|
|
93
|
+
return o;
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
const Ce = (() => typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global)(), ma = (e) => !Fe(e) && e !== Ce;
|
|
97
|
+
function yt(...e) {
|
|
98
|
+
const { caseless: t, skipUndefined: a } = ma(this) && this || {}, n = {}, o = (r, i) => {
|
|
99
|
+
if (i === "__proto__" || i === "constructor" || i === "prototype")
|
|
100
|
+
return;
|
|
101
|
+
const s = t && typeof i == "string" && fa(n, i) || i, u = tt(n, s) ? n[s] : void 0;
|
|
102
|
+
Xe(u) && Xe(r) ? n[s] = yt(u, r) : Xe(r) ? n[s] = yt({}, r) : Re(r) ? n[s] = r.slice() : (!a || !Fe(r)) && (n[s] = r);
|
|
103
|
+
};
|
|
104
|
+
for (let r = 0, i = e.length; r < i; r++) {
|
|
105
|
+
const s = e[r];
|
|
106
|
+
if (!s || Ie(s) || ($e(s, o), typeof s != "object" || Re(s)))
|
|
107
|
+
continue;
|
|
108
|
+
const u = Object.getOwnPropertySymbols(s);
|
|
109
|
+
for (let d = 0; d < u.length; d++) {
|
|
110
|
+
const c = u[d];
|
|
111
|
+
Sn.call(s, c) && o(s[c], c);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return n;
|
|
115
|
+
}
|
|
116
|
+
const mn = (e, t, a, { allOwnKeys: n } = {}) => ($e(
|
|
117
|
+
t,
|
|
118
|
+
(o, r) => {
|
|
119
|
+
a && re(o) ? Object.defineProperty(e, r, {
|
|
120
|
+
// Null-proto descriptor so a polluted Object.prototype.get cannot
|
|
121
|
+
// hijack defineProperty's accessor-vs-data resolution.
|
|
122
|
+
__proto__: null,
|
|
123
|
+
value: ua(o, a),
|
|
124
|
+
writable: !0,
|
|
125
|
+
enumerable: !0,
|
|
126
|
+
configurable: !0
|
|
127
|
+
}) : Object.defineProperty(e, r, {
|
|
128
|
+
__proto__: null,
|
|
129
|
+
value: o,
|
|
130
|
+
writable: !0,
|
|
131
|
+
enumerable: !0,
|
|
132
|
+
configurable: !0
|
|
133
|
+
});
|
|
134
|
+
},
|
|
135
|
+
{ allOwnKeys: n }
|
|
136
|
+
), e), gn = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), hn = (e, t, a, n) => {
|
|
137
|
+
e.prototype = Object.create(t.prototype, n), Object.defineProperty(e.prototype, "constructor", {
|
|
138
|
+
__proto__: null,
|
|
139
|
+
value: e,
|
|
140
|
+
writable: !0,
|
|
141
|
+
enumerable: !1,
|
|
142
|
+
configurable: !0
|
|
143
|
+
}), Object.defineProperty(e, "super", {
|
|
144
|
+
__proto__: null,
|
|
145
|
+
value: t.prototype
|
|
146
|
+
}), a && Object.assign(e.prototype, a);
|
|
147
|
+
}, bn = (e, t, a, n) => {
|
|
148
|
+
let o, r, i;
|
|
149
|
+
const s = {};
|
|
150
|
+
if (t = t || {}, e == null)
|
|
151
|
+
return t;
|
|
152
|
+
do {
|
|
153
|
+
for (o = Object.getOwnPropertyNames(e), r = o.length; r-- > 0; )
|
|
154
|
+
i = o[r], (!n || n(i, e, t)) && !s[i] && (t[i] = e[i], s[i] = !0);
|
|
155
|
+
e = a !== !1 && _e(e);
|
|
156
|
+
} while (e && (!a || a(e, t)) && e !== Object.prototype);
|
|
157
|
+
return t;
|
|
158
|
+
}, yn = (e, t, a) => {
|
|
159
|
+
e = String(e), (a === void 0 || a > e.length) && (a = e.length), a -= t.length;
|
|
160
|
+
const n = e.indexOf(t, a);
|
|
161
|
+
return n !== -1 && n === a;
|
|
162
|
+
}, vn = (e) => {
|
|
163
|
+
if (!e)
|
|
164
|
+
return null;
|
|
165
|
+
if (Re(e))
|
|
166
|
+
return e;
|
|
167
|
+
let t = e.length;
|
|
168
|
+
if (!pa(t))
|
|
169
|
+
return null;
|
|
170
|
+
const a = new Array(t);
|
|
171
|
+
for (; t-- > 0; )
|
|
172
|
+
a[t] = e[t];
|
|
173
|
+
return a;
|
|
174
|
+
}, wn = ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && _e(Uint8Array)), kn = (e, t) => {
|
|
175
|
+
const a = (e && e[qe]).call(e);
|
|
176
|
+
let n;
|
|
177
|
+
for (; (n = a.next()) && !n.done; ) {
|
|
178
|
+
const o = n.value;
|
|
179
|
+
t.call(e, o[0], o[1]);
|
|
180
|
+
}
|
|
181
|
+
}, xn = (e, t) => {
|
|
182
|
+
let a;
|
|
183
|
+
const n = [];
|
|
184
|
+
for (; (a = e.exec(t)) !== null; )
|
|
185
|
+
n.push(a);
|
|
186
|
+
return n;
|
|
187
|
+
}, Pn = fe("HTMLFormElement"), Tn = (e) => e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function(t, a, n) {
|
|
188
|
+
return a.toUpperCase() + n;
|
|
189
|
+
}), { propertyIsEnumerable: Sn } = Object.prototype, En = fe("RegExp"), ga = (e, t) => {
|
|
190
|
+
const a = Object.getOwnPropertyDescriptors(e), n = {};
|
|
191
|
+
$e(a, (o, r) => {
|
|
192
|
+
let i;
|
|
193
|
+
(i = t(o, r, e)) !== !1 && (n[r] = i || o);
|
|
194
|
+
}), Object.defineProperties(e, n);
|
|
195
|
+
}, Cn = (e) => {
|
|
196
|
+
ga(e, (t, a) => {
|
|
197
|
+
if (re(e) && ["arguments", "caller", "callee"].includes(a))
|
|
198
|
+
return !1;
|
|
199
|
+
const n = e[a];
|
|
200
|
+
if (re(n)) {
|
|
201
|
+
if (t.enumerable = !1, "writable" in t) {
|
|
202
|
+
t.writable = !1;
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
t.set || (t.set = () => {
|
|
206
|
+
throw Error("Can not rewrite read-only method '" + a + "'");
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
}, On = (e, t) => {
|
|
211
|
+
const a = {}, n = (o) => {
|
|
212
|
+
o.forEach((r) => {
|
|
213
|
+
a[r] = !0;
|
|
214
|
+
});
|
|
215
|
+
};
|
|
216
|
+
return Re(e) ? n(e) : n(String(e).split(t)), a;
|
|
217
|
+
}, Rn = () => {
|
|
218
|
+
}, An = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
|
|
219
|
+
function Bn(e) {
|
|
220
|
+
return !!(e && re(e.append) && e[ca] === "FormData" && e[qe]);
|
|
221
|
+
}
|
|
222
|
+
const Dn = (e) => {
|
|
223
|
+
const t = /* @__PURE__ */ new WeakSet(), a = (n) => {
|
|
224
|
+
if (Le(n)) {
|
|
225
|
+
if (t.has(n))
|
|
226
|
+
return;
|
|
227
|
+
if (Ie(n))
|
|
228
|
+
return n;
|
|
229
|
+
if (!("toJSON" in n)) {
|
|
230
|
+
t.add(n);
|
|
231
|
+
const o = Re(n) ? [] : {};
|
|
232
|
+
return $e(n, (r, i) => {
|
|
233
|
+
const s = a(r);
|
|
234
|
+
!Fe(s) && (o[i] = s);
|
|
235
|
+
}), t.delete(n), o;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
return n;
|
|
239
|
+
};
|
|
240
|
+
return a(e);
|
|
241
|
+
}, _n = fe("AsyncFunction"), Fn = (e) => e && (Le(e) || re(e)) && re(e.then) && re(e.catch), ha = ((e, t) => e ? setImmediate : t ? ((a, n) => (Ce.addEventListener(
|
|
242
|
+
"message",
|
|
243
|
+
({ source: o, data: r }) => {
|
|
244
|
+
o === Ce && r === a && n.length && n.shift()();
|
|
245
|
+
},
|
|
246
|
+
!1
|
|
247
|
+
), (o) => {
|
|
248
|
+
n.push(o), Ce.postMessage(a, "*");
|
|
249
|
+
}))(`axios@${Math.random()}`, []) : (a) => setTimeout(a))(typeof setImmediate == "function", re(Ce.postMessage)), In = typeof queueMicrotask < "u" ? queueMicrotask.bind(Ce) : typeof process < "u" && process.nextTick || ha, ba = (e) => e != null && re(e[qe]), Ln = (e) => e != null && Ve(e, qe) && ba(e), l = {
|
|
250
|
+
isArray: Re,
|
|
251
|
+
isArrayBuffer: da,
|
|
252
|
+
isBuffer: Ie,
|
|
253
|
+
isFormData: sn,
|
|
254
|
+
isArrayBufferView: Ja,
|
|
255
|
+
isString: Ka,
|
|
256
|
+
isNumber: pa,
|
|
257
|
+
isBoolean: Xa,
|
|
258
|
+
isObject: Le,
|
|
259
|
+
isPlainObject: Xe,
|
|
260
|
+
isEmptyObject: Qa,
|
|
261
|
+
isReadableStream: un,
|
|
262
|
+
isRequest: cn,
|
|
263
|
+
isResponse: dn,
|
|
264
|
+
isHeaders: pn,
|
|
265
|
+
isUndefined: Fe,
|
|
266
|
+
isDate: Ya,
|
|
267
|
+
isFile: Za,
|
|
268
|
+
isReactNativeBlob: en,
|
|
269
|
+
isReactNative: tn,
|
|
270
|
+
isBlob: an,
|
|
271
|
+
isRegExp: En,
|
|
272
|
+
isFunction: re,
|
|
273
|
+
isStream: on,
|
|
274
|
+
isURLSearchParams: ln,
|
|
275
|
+
isTypedArray: wn,
|
|
276
|
+
isFileList: nn,
|
|
277
|
+
forEach: $e,
|
|
278
|
+
merge: yt,
|
|
279
|
+
extend: mn,
|
|
280
|
+
trim: fn,
|
|
281
|
+
stripBOM: gn,
|
|
282
|
+
inherits: hn,
|
|
283
|
+
toFlatObject: bn,
|
|
284
|
+
kindOf: xt,
|
|
285
|
+
kindOfTest: fe,
|
|
286
|
+
endsWith: yn,
|
|
287
|
+
toArray: vn,
|
|
288
|
+
forEachEntry: kn,
|
|
289
|
+
matchAll: xn,
|
|
290
|
+
isHTMLForm: Pn,
|
|
291
|
+
hasOwnProperty: tt,
|
|
292
|
+
hasOwnProp: tt,
|
|
293
|
+
// an alias to avoid ESLint no-prototype-builtins detection
|
|
294
|
+
hasOwnInPrototypeChain: Ve,
|
|
295
|
+
getSafeProp: Ha,
|
|
296
|
+
reduceDescriptors: ga,
|
|
297
|
+
freezeMethods: Cn,
|
|
298
|
+
toObjectSet: On,
|
|
299
|
+
toCamelCase: Tn,
|
|
300
|
+
noop: Rn,
|
|
301
|
+
toFiniteNumber: An,
|
|
302
|
+
findKey: fa,
|
|
303
|
+
global: Ce,
|
|
304
|
+
isContextDefined: ma,
|
|
305
|
+
isSpecCompliantForm: Bn,
|
|
306
|
+
toJSONObject: Dn,
|
|
307
|
+
isAsyncFn: _n,
|
|
308
|
+
isThenable: Fn,
|
|
309
|
+
setImmediate: ha,
|
|
310
|
+
asap: In,
|
|
311
|
+
isIterable: ba,
|
|
312
|
+
isSafeIterable: Ln
|
|
313
|
+
}, Nn = l.toObjectSet([
|
|
314
|
+
"age",
|
|
315
|
+
"authorization",
|
|
316
|
+
"content-length",
|
|
317
|
+
"content-type",
|
|
318
|
+
"etag",
|
|
319
|
+
"expires",
|
|
320
|
+
"from",
|
|
321
|
+
"host",
|
|
322
|
+
"if-modified-since",
|
|
323
|
+
"if-unmodified-since",
|
|
324
|
+
"last-modified",
|
|
325
|
+
"location",
|
|
326
|
+
"max-forwards",
|
|
327
|
+
"proxy-authorization",
|
|
328
|
+
"referer",
|
|
329
|
+
"retry-after",
|
|
330
|
+
"user-agent"
|
|
331
|
+
]), Un = (e) => {
|
|
332
|
+
const t = {};
|
|
333
|
+
let a, n, o;
|
|
334
|
+
return e && e.split(`
|
|
335
|
+
`).forEach(function(r) {
|
|
336
|
+
o = r.indexOf(":"), a = r.substring(0, o).trim().toLowerCase(), n = r.substring(o + 1).trim(), !(!a || t[a] && Nn[a]) && (a === "set-cookie" ? t[a] ? t[a].push(n) : t[a] = [n] : t[a] = t[a] ? t[a] + ", " + n : n);
|
|
337
|
+
}), t;
|
|
338
|
+
};
|
|
339
|
+
function Mn(e) {
|
|
340
|
+
let t = 0, a = e.length;
|
|
341
|
+
for (; t < a; ) {
|
|
342
|
+
const n = e.charCodeAt(t);
|
|
343
|
+
if (n !== 9 && n !== 32)
|
|
344
|
+
break;
|
|
345
|
+
t += 1;
|
|
346
|
+
}
|
|
347
|
+
for (; a > t; ) {
|
|
348
|
+
const n = e.charCodeAt(a - 1);
|
|
349
|
+
if (n !== 9 && n !== 32)
|
|
350
|
+
break;
|
|
351
|
+
a -= 1;
|
|
352
|
+
}
|
|
353
|
+
return t === 0 && a === e.length ? e : e.slice(t, a);
|
|
354
|
+
}
|
|
355
|
+
const jn = new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+", "g"), zn = new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+", "g");
|
|
356
|
+
function Pt(e, t) {
|
|
357
|
+
return l.isArray(e) ? e.map((a) => Pt(a, t)) : Mn(String(e).replace(t, ""));
|
|
358
|
+
}
|
|
359
|
+
const Vn = (e) => Pt(e, jn), qn = (e) => Pt(e, zn);
|
|
360
|
+
function ya(e) {
|
|
361
|
+
const t = /* @__PURE__ */ Object.create(null);
|
|
362
|
+
return l.forEach(e.toJSON(), (a, n) => {
|
|
363
|
+
t[n] = qn(a);
|
|
364
|
+
}), t;
|
|
365
|
+
}
|
|
366
|
+
const qt = Symbol("internals");
|
|
367
|
+
function Me(e) {
|
|
368
|
+
return e && String(e).trim().toLowerCase();
|
|
369
|
+
}
|
|
370
|
+
function Qe(e) {
|
|
371
|
+
return e === !1 || e == null ? e : l.isArray(e) ? e.map(Qe) : Vn(String(e));
|
|
372
|
+
}
|
|
373
|
+
function $n(e) {
|
|
374
|
+
const t = /* @__PURE__ */ Object.create(null), a = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
375
|
+
let n;
|
|
376
|
+
for (; n = a.exec(e); )
|
|
377
|
+
t[n[1]] = n[2];
|
|
378
|
+
return t;
|
|
379
|
+
}
|
|
380
|
+
const Wn = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
|
|
381
|
+
function dt(e, t, a, n, o) {
|
|
382
|
+
if (l.isFunction(n))
|
|
383
|
+
return n.call(this, t, a);
|
|
384
|
+
if (o && (t = a), !!l.isString(t)) {
|
|
385
|
+
if (l.isString(n))
|
|
386
|
+
return t.indexOf(n) !== -1;
|
|
387
|
+
if (l.isRegExp(n))
|
|
388
|
+
return n.test(t);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
function Gn(e) {
|
|
392
|
+
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, a, n) => a.toUpperCase() + n);
|
|
393
|
+
}
|
|
394
|
+
function Hn(e, t) {
|
|
395
|
+
const a = l.toCamelCase(" " + t);
|
|
396
|
+
["get", "set", "has"].forEach((n) => {
|
|
397
|
+
Object.defineProperty(e, n + a, {
|
|
398
|
+
// Null-proto descriptor so a polluted Object.prototype.get cannot turn
|
|
399
|
+
// this data descriptor into an accessor descriptor on the way in.
|
|
400
|
+
__proto__: null,
|
|
401
|
+
value: function(o, r, i) {
|
|
402
|
+
return this[n].call(this, t, o, r, i);
|
|
403
|
+
},
|
|
404
|
+
configurable: !0
|
|
405
|
+
});
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
class it {
|
|
409
|
+
constructor(t) {
|
|
410
|
+
t && this.set(t);
|
|
411
|
+
}
|
|
412
|
+
set(t, a, n) {
|
|
413
|
+
const o = this;
|
|
414
|
+
function r(s, u, d) {
|
|
415
|
+
const c = Me(u);
|
|
416
|
+
if (!c)
|
|
417
|
+
return;
|
|
418
|
+
const f = l.findKey(o, c);
|
|
419
|
+
(!f || o[f] === void 0 || d === !0 || d === void 0 && o[f] !== !1) && (o[f || u] = Qe(s));
|
|
420
|
+
}
|
|
421
|
+
const i = (s, u) => l.forEach(s, (d, c) => r(d, c, u));
|
|
422
|
+
if (l.isPlainObject(t) || t instanceof this.constructor)
|
|
423
|
+
i(t, a);
|
|
424
|
+
else if (l.isString(t) && (t = t.trim()) && !Wn(t))
|
|
425
|
+
i(Un(t), a);
|
|
426
|
+
else if (l.isObject(t) && l.isSafeIterable(t)) {
|
|
427
|
+
let s = /* @__PURE__ */ Object.create(null), u, d;
|
|
428
|
+
for (const c of t) {
|
|
429
|
+
if (!l.isArray(c))
|
|
430
|
+
throw new TypeError("Object iterator must return a key-value pair");
|
|
431
|
+
d = c[0], l.hasOwnProp(s, d) ? (u = s[d], s[d] = l.isArray(u) ? [...u, c[1]] : [u, c[1]]) : s[d] = c[1];
|
|
432
|
+
}
|
|
433
|
+
i(s, a);
|
|
434
|
+
} else
|
|
435
|
+
t != null && r(a, t, n);
|
|
436
|
+
return this;
|
|
437
|
+
}
|
|
438
|
+
get(t, a) {
|
|
439
|
+
if (t = Me(t), t) {
|
|
440
|
+
const n = l.findKey(this, t);
|
|
441
|
+
if (n) {
|
|
442
|
+
const o = this[n];
|
|
443
|
+
if (!a)
|
|
444
|
+
return o;
|
|
445
|
+
if (a === !0)
|
|
446
|
+
return $n(o);
|
|
447
|
+
if (l.isFunction(a))
|
|
448
|
+
return a.call(this, o, n);
|
|
449
|
+
if (l.isRegExp(a))
|
|
450
|
+
return a.exec(o);
|
|
451
|
+
throw new TypeError("parser must be boolean|regexp|function");
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
has(t, a) {
|
|
456
|
+
if (t = Me(t), t) {
|
|
457
|
+
const n = l.findKey(this, t);
|
|
458
|
+
return !!(n && this[n] !== void 0 && (!a || dt(this, this[n], n, a)));
|
|
459
|
+
}
|
|
460
|
+
return !1;
|
|
461
|
+
}
|
|
462
|
+
delete(t, a) {
|
|
463
|
+
const n = this;
|
|
464
|
+
let o = !1;
|
|
465
|
+
function r(i) {
|
|
466
|
+
if (i = Me(i), i) {
|
|
467
|
+
const s = l.findKey(n, i);
|
|
468
|
+
s && (!a || dt(n, n[s], s, a)) && (delete n[s], o = !0);
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
return l.isArray(t) ? t.forEach(r) : r(t), o;
|
|
472
|
+
}
|
|
473
|
+
clear(t) {
|
|
474
|
+
const a = Object.keys(this);
|
|
475
|
+
let n = a.length, o = !1;
|
|
476
|
+
for (; n--; ) {
|
|
477
|
+
const r = a[n];
|
|
478
|
+
(!t || dt(this, this[r], r, t, !0)) && (delete this[r], o = !0);
|
|
479
|
+
}
|
|
480
|
+
return o;
|
|
481
|
+
}
|
|
482
|
+
normalize(t) {
|
|
483
|
+
const a = this, n = {};
|
|
484
|
+
return l.forEach(this, (o, r) => {
|
|
485
|
+
const i = l.findKey(n, r);
|
|
486
|
+
if (i) {
|
|
487
|
+
a[i] = Qe(o), delete a[r];
|
|
488
|
+
return;
|
|
489
|
+
}
|
|
490
|
+
const s = t ? Gn(r) : String(r).trim();
|
|
491
|
+
s !== r && delete a[r], a[s] = Qe(o), n[s] = !0;
|
|
492
|
+
}), this;
|
|
493
|
+
}
|
|
494
|
+
concat(...t) {
|
|
495
|
+
return this.constructor.concat(this, ...t);
|
|
496
|
+
}
|
|
497
|
+
toJSON(t) {
|
|
498
|
+
const a = /* @__PURE__ */ Object.create(null);
|
|
499
|
+
return l.forEach(this, (n, o) => {
|
|
500
|
+
n != null && n !== !1 && (a[o] = t && l.isArray(n) ? n.join(", ") : n);
|
|
501
|
+
}), a;
|
|
502
|
+
}
|
|
503
|
+
[Symbol.iterator]() {
|
|
504
|
+
return Object.entries(this.toJSON())[Symbol.iterator]();
|
|
505
|
+
}
|
|
506
|
+
toString() {
|
|
507
|
+
return Object.entries(this.toJSON()).map(([t, a]) => t + ": " + a).join(`
|
|
508
|
+
`);
|
|
509
|
+
}
|
|
510
|
+
getSetCookie() {
|
|
511
|
+
return this.get("set-cookie") || [];
|
|
512
|
+
}
|
|
513
|
+
get [Symbol.toStringTag]() {
|
|
514
|
+
return "AxiosHeaders";
|
|
515
|
+
}
|
|
516
|
+
static from(t) {
|
|
517
|
+
return t instanceof this ? t : new this(t);
|
|
518
|
+
}
|
|
519
|
+
static concat(t, ...a) {
|
|
520
|
+
const n = new this(t);
|
|
521
|
+
return a.forEach((o) => n.set(o)), n;
|
|
522
|
+
}
|
|
523
|
+
static accessor(t) {
|
|
524
|
+
const a = (this[qt] = this[qt] = {
|
|
525
|
+
accessors: {}
|
|
526
|
+
}).accessors, n = this.prototype;
|
|
527
|
+
function o(r) {
|
|
528
|
+
const i = Me(r);
|
|
529
|
+
a[i] || (Hn(n, r), a[i] = !0);
|
|
530
|
+
}
|
|
531
|
+
return l.isArray(t) ? t.forEach(o) : o(t), this;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
it.accessor([
|
|
535
|
+
"Content-Type",
|
|
536
|
+
"Content-Length",
|
|
537
|
+
"Accept",
|
|
538
|
+
"Accept-Encoding",
|
|
539
|
+
"User-Agent",
|
|
540
|
+
"Authorization"
|
|
541
|
+
]);
|
|
542
|
+
l.reduceDescriptors(it.prototype, ({ value: e }, t) => {
|
|
543
|
+
let a = t[0].toUpperCase() + t.slice(1);
|
|
544
|
+
return {
|
|
545
|
+
get: () => e,
|
|
546
|
+
set(n) {
|
|
547
|
+
this[a] = n;
|
|
548
|
+
}
|
|
549
|
+
};
|
|
550
|
+
});
|
|
551
|
+
l.freezeMethods(it);
|
|
552
|
+
const le = it, Jn = "[REDACTED ****]";
|
|
553
|
+
function Kn(e) {
|
|
554
|
+
if (l.hasOwnProp(e, "toJSON"))
|
|
555
|
+
return !0;
|
|
556
|
+
let t = Object.getPrototypeOf(e);
|
|
557
|
+
for (; t && t !== Object.prototype; ) {
|
|
558
|
+
if (l.hasOwnProp(t, "toJSON"))
|
|
559
|
+
return !0;
|
|
560
|
+
t = Object.getPrototypeOf(t);
|
|
561
|
+
}
|
|
562
|
+
return !1;
|
|
563
|
+
}
|
|
564
|
+
function Xn(e, t) {
|
|
565
|
+
const a = new Set(t.map((r) => String(r).toLowerCase())), n = [], o = (r) => {
|
|
566
|
+
if (r === null || typeof r != "object" || l.isBuffer(r))
|
|
567
|
+
return r;
|
|
568
|
+
if (n.indexOf(r) !== -1)
|
|
569
|
+
return;
|
|
570
|
+
r instanceof le && (r = r.toJSON()), n.push(r);
|
|
571
|
+
let i;
|
|
572
|
+
if (l.isArray(r))
|
|
573
|
+
i = [], r.forEach((s, u) => {
|
|
574
|
+
const d = o(s);
|
|
575
|
+
l.isUndefined(d) || (i[u] = d);
|
|
576
|
+
});
|
|
577
|
+
else {
|
|
578
|
+
if (!l.isPlainObject(r) && Kn(r))
|
|
579
|
+
return n.pop(), r;
|
|
580
|
+
i = /* @__PURE__ */ Object.create(null);
|
|
581
|
+
for (const [s, u] of Object.entries(r)) {
|
|
582
|
+
const d = a.has(s.toLowerCase()) ? Jn : o(u);
|
|
583
|
+
l.isUndefined(d) || (i[s] = d);
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
return n.pop(), i;
|
|
587
|
+
};
|
|
588
|
+
return o(e);
|
|
589
|
+
}
|
|
590
|
+
class te extends Error {
|
|
591
|
+
static from(t, a, n, o, r, i) {
|
|
592
|
+
const s = new te(t.message, a || t.code, n, o, r);
|
|
593
|
+
return Object.defineProperty(s, "cause", {
|
|
594
|
+
__proto__: null,
|
|
595
|
+
value: t,
|
|
596
|
+
writable: !0,
|
|
597
|
+
enumerable: !1,
|
|
598
|
+
configurable: !0
|
|
599
|
+
}), s.name = t.name, t.status != null && s.status == null && (s.status = t.status), i && Object.assign(s, i), s;
|
|
600
|
+
}
|
|
601
|
+
/**
|
|
602
|
+
* Create an Error with the specified message, config, error code, request and response.
|
|
603
|
+
*
|
|
604
|
+
* @param {string} message The error message.
|
|
605
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
606
|
+
* @param {Object} [config] The config.
|
|
607
|
+
* @param {Object} [request] The request.
|
|
608
|
+
* @param {Object} [response] The response.
|
|
609
|
+
*
|
|
610
|
+
* @returns {Error} The created error.
|
|
611
|
+
*/
|
|
612
|
+
constructor(t, a, n, o, r) {
|
|
613
|
+
super(t), Object.defineProperty(this, "message", {
|
|
614
|
+
// Null-proto descriptor so a polluted Object.prototype.get cannot turn
|
|
615
|
+
// this data descriptor into an accessor descriptor on the way in.
|
|
616
|
+
__proto__: null,
|
|
617
|
+
value: t,
|
|
618
|
+
enumerable: !0,
|
|
619
|
+
writable: !0,
|
|
620
|
+
configurable: !0
|
|
621
|
+
}), this.name = "AxiosError", this.isAxiosError = !0, a && (this.code = a), n && (this.config = n), o && (this.request = o), r && (this.response = r, this.status = r.status);
|
|
622
|
+
}
|
|
623
|
+
toJSON() {
|
|
624
|
+
const t = this.config, a = t && l.hasOwnProp(t, "redact") ? t.redact : void 0, n = l.isArray(a) && a.length > 0 ? Xn(t, a) : l.toJSONObject(t);
|
|
625
|
+
return {
|
|
626
|
+
// Standard
|
|
627
|
+
message: this.message,
|
|
628
|
+
name: this.name,
|
|
629
|
+
// Microsoft
|
|
630
|
+
description: this.description,
|
|
631
|
+
number: this.number,
|
|
632
|
+
// Mozilla
|
|
633
|
+
fileName: this.fileName,
|
|
634
|
+
lineNumber: this.lineNumber,
|
|
635
|
+
columnNumber: this.columnNumber,
|
|
636
|
+
stack: this.stack,
|
|
637
|
+
// Axios
|
|
638
|
+
config: n,
|
|
639
|
+
code: this.code,
|
|
640
|
+
status: this.status
|
|
641
|
+
};
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
te.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
|
|
645
|
+
te.ERR_BAD_OPTION = "ERR_BAD_OPTION";
|
|
646
|
+
te.ECONNABORTED = "ECONNABORTED";
|
|
647
|
+
te.ETIMEDOUT = "ETIMEDOUT";
|
|
648
|
+
te.ECONNREFUSED = "ECONNREFUSED";
|
|
649
|
+
te.ERR_NETWORK = "ERR_NETWORK";
|
|
650
|
+
te.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
|
|
651
|
+
te.ERR_DEPRECATED = "ERR_DEPRECATED";
|
|
652
|
+
te.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
|
|
653
|
+
te.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
|
|
654
|
+
te.ERR_CANCELED = "ERR_CANCELED";
|
|
655
|
+
te.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
|
|
656
|
+
te.ERR_INVALID_URL = "ERR_INVALID_URL";
|
|
657
|
+
te.ERR_FORM_DATA_DEPTH_EXCEEDED = "ERR_FORM_DATA_DEPTH_EXCEEDED";
|
|
658
|
+
const C = te, Qn = null, va = 100;
|
|
659
|
+
function vt(e) {
|
|
660
|
+
return l.isPlainObject(e) || l.isArray(e);
|
|
661
|
+
}
|
|
662
|
+
function wa(e) {
|
|
663
|
+
return l.endsWith(e, "[]") ? e.slice(0, -2) : e;
|
|
664
|
+
}
|
|
665
|
+
function pt(e, t, a) {
|
|
666
|
+
return e ? e.concat(t).map(function(n, o) {
|
|
667
|
+
return n = wa(n), !a && o ? "[" + n + "]" : n;
|
|
668
|
+
}).join(a ? "." : "") : t;
|
|
669
|
+
}
|
|
670
|
+
function Yn(e) {
|
|
671
|
+
return l.isArray(e) && !e.some(vt);
|
|
672
|
+
}
|
|
673
|
+
const Zn = l.toFlatObject(l, {}, null, function(e) {
|
|
674
|
+
return /^is[A-Z]/.test(e);
|
|
675
|
+
});
|
|
676
|
+
function st(e, t, a) {
|
|
677
|
+
if (!l.isObject(e))
|
|
678
|
+
throw new TypeError("target must be an object");
|
|
679
|
+
t = t || new FormData(), a = l.toFlatObject(
|
|
680
|
+
a,
|
|
681
|
+
{
|
|
682
|
+
metaTokens: !0,
|
|
683
|
+
dots: !1,
|
|
684
|
+
indexes: !1
|
|
685
|
+
},
|
|
686
|
+
!1,
|
|
687
|
+
function(p, h) {
|
|
688
|
+
return !l.isUndefined(h[p]);
|
|
689
|
+
}
|
|
690
|
+
);
|
|
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 ? va : a.maxDepth, d = s && l.isSpecCompliantForm(t), c = [];
|
|
692
|
+
if (!l.isFunction(o))
|
|
693
|
+
throw new TypeError("visitor must be a function");
|
|
694
|
+
function f(p) {
|
|
695
|
+
if (p === null)
|
|
696
|
+
return "";
|
|
697
|
+
if (l.isDate(p))
|
|
698
|
+
return p.toISOString();
|
|
699
|
+
if (l.isBoolean(p))
|
|
700
|
+
return p.toString();
|
|
701
|
+
if (!d && l.isBlob(p))
|
|
702
|
+
throw new C("Blob is not supported. Use a Buffer instead.");
|
|
703
|
+
if (l.isArrayBuffer(p) || l.isTypedArray(p)) {
|
|
704
|
+
if (d && typeof s == "function")
|
|
705
|
+
return new s([p]);
|
|
706
|
+
if (typeof Buffer < "u")
|
|
707
|
+
return Buffer.from(p);
|
|
708
|
+
throw new C("Blob is not supported. Use a Buffer instead.", C.ERR_NOT_SUPPORT);
|
|
709
|
+
}
|
|
710
|
+
return p;
|
|
711
|
+
}
|
|
712
|
+
function v(p) {
|
|
713
|
+
if (p > u)
|
|
714
|
+
throw new C(
|
|
715
|
+
"Object is too deeply nested (" + p + " levels). Max depth: " + u,
|
|
716
|
+
C.ERR_FORM_DATA_DEPTH_EXCEEDED
|
|
717
|
+
);
|
|
718
|
+
}
|
|
719
|
+
function F(p, h) {
|
|
720
|
+
if (u === 1 / 0)
|
|
721
|
+
return JSON.stringify(p);
|
|
722
|
+
const A = [];
|
|
723
|
+
return JSON.stringify(p, function(D, j) {
|
|
724
|
+
if (!l.isObject(j))
|
|
725
|
+
return j;
|
|
726
|
+
for (; A.length && A[A.length - 1] !== this; )
|
|
727
|
+
A.pop();
|
|
728
|
+
return A.push(j), v(h + A.length - 1), j;
|
|
729
|
+
});
|
|
730
|
+
}
|
|
731
|
+
function P(p, h, A) {
|
|
732
|
+
let D = p;
|
|
733
|
+
if (l.isReactNative(t) && l.isReactNativeBlob(p))
|
|
734
|
+
return t.append(pt(A, h, r), f(p)), !1;
|
|
735
|
+
if (p && !A && typeof p == "object") {
|
|
736
|
+
if (l.endsWith(h, "{}"))
|
|
737
|
+
h = n ? h : h.slice(0, -2), p = F(p, 1);
|
|
738
|
+
else if (l.isArray(p) && Yn(p) || (l.isFileList(p) || l.endsWith(h, "[]")) && (D = l.toArray(p)))
|
|
739
|
+
return h = wa(h), D.forEach(function(j, X) {
|
|
740
|
+
!(l.isUndefined(j) || j === null) && t.append(
|
|
741
|
+
// eslint-disable-next-line no-nested-ternary
|
|
742
|
+
i === !0 ? pt([h], X, r) : i === null ? h : h + "[]",
|
|
743
|
+
f(j)
|
|
744
|
+
);
|
|
745
|
+
}), !1;
|
|
746
|
+
}
|
|
747
|
+
return vt(p) ? !0 : (t.append(pt(A, h, r), f(p)), !1);
|
|
748
|
+
}
|
|
749
|
+
const S = Object.assign(Zn, {
|
|
750
|
+
defaultVisitor: P,
|
|
751
|
+
convertValue: f,
|
|
752
|
+
isVisitable: vt
|
|
753
|
+
});
|
|
754
|
+
function O(p, h, A = 0) {
|
|
755
|
+
if (!l.isUndefined(p)) {
|
|
756
|
+
if (v(A), c.indexOf(p) !== -1)
|
|
757
|
+
throw new Error("Circular reference detected in " + h.join("."));
|
|
758
|
+
c.push(p), l.forEach(p, function(D, j) {
|
|
759
|
+
(!(l.isUndefined(D) || D === null) && o.call(t, D, l.isString(j) ? j.trim() : j, h, S)) === !0 && O(D, h ? h.concat(j) : [j], A + 1);
|
|
760
|
+
}), c.pop();
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
if (!l.isObject(e))
|
|
764
|
+
throw new TypeError("data must be an object");
|
|
765
|
+
return O(e), t;
|
|
766
|
+
}
|
|
767
|
+
function $t(e) {
|
|
768
|
+
const t = {
|
|
769
|
+
"!": "%21",
|
|
770
|
+
"'": "%27",
|
|
771
|
+
"(": "%28",
|
|
772
|
+
")": "%29",
|
|
773
|
+
"~": "%7E",
|
|
774
|
+
"%20": "+"
|
|
775
|
+
};
|
|
776
|
+
return encodeURIComponent(e).replace(/[!'()~]|%20/g, function(a) {
|
|
777
|
+
return t[a];
|
|
778
|
+
});
|
|
779
|
+
}
|
|
780
|
+
function Tt(e, t) {
|
|
781
|
+
this._pairs = [], e && st(e, this, t);
|
|
782
|
+
}
|
|
783
|
+
const ka = Tt.prototype;
|
|
784
|
+
ka.append = function(e, t) {
|
|
785
|
+
this._pairs.push([e, t]);
|
|
786
|
+
};
|
|
787
|
+
ka.toString = function(e) {
|
|
788
|
+
const t = e ? (a) => e.call(this, a, $t) : $t;
|
|
789
|
+
return this._pairs.map(function(a) {
|
|
790
|
+
return t(a[0]) + "=" + t(a[1]);
|
|
791
|
+
}, "").join("&");
|
|
792
|
+
};
|
|
793
|
+
function eo(e) {
|
|
794
|
+
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
|
|
795
|
+
}
|
|
796
|
+
function xa(e, t, a) {
|
|
797
|
+
if (!t)
|
|
798
|
+
return e;
|
|
799
|
+
e = e || "";
|
|
800
|
+
const n = l.isFunction(a) ? {
|
|
801
|
+
serialize: a
|
|
802
|
+
} : a, o = l.getSafeProp(n, "encode") || eo, r = l.getSafeProp(n, "serialize");
|
|
803
|
+
let i;
|
|
804
|
+
if (r ? i = r(t, n) : i = l.isURLSearchParams(t) ? t.toString() : new Tt(t, n).toString(o), i) {
|
|
805
|
+
const s = e.indexOf("#");
|
|
806
|
+
s !== -1 && (e = e.slice(0, s)), e += (e.indexOf("?") === -1 ? "?" : "&") + i;
|
|
807
|
+
}
|
|
808
|
+
return e;
|
|
809
|
+
}
|
|
810
|
+
class to {
|
|
811
|
+
constructor() {
|
|
812
|
+
this.handlers = [];
|
|
813
|
+
}
|
|
814
|
+
/**
|
|
815
|
+
* Add a new interceptor to the stack
|
|
816
|
+
*
|
|
817
|
+
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
818
|
+
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
819
|
+
* @param {Object} options The options for the interceptor, synchronous and runWhen
|
|
820
|
+
*
|
|
821
|
+
* @return {Number} An ID used to remove interceptor later
|
|
822
|
+
*/
|
|
823
|
+
use(t, a, n) {
|
|
824
|
+
return this.handlers.push({
|
|
825
|
+
fulfilled: t,
|
|
826
|
+
rejected: a,
|
|
827
|
+
synchronous: n ? n.synchronous : !1,
|
|
828
|
+
runWhen: n ? n.runWhen : null
|
|
829
|
+
}), this.handlers.length - 1;
|
|
830
|
+
}
|
|
831
|
+
/**
|
|
832
|
+
* Remove an interceptor from the stack
|
|
833
|
+
*
|
|
834
|
+
* @param {Number} id The ID that was returned by `use`
|
|
835
|
+
*
|
|
836
|
+
* @returns {void}
|
|
837
|
+
*/
|
|
838
|
+
eject(t) {
|
|
839
|
+
this.handlers[t] && (this.handlers[t] = null);
|
|
840
|
+
}
|
|
841
|
+
/**
|
|
842
|
+
* Clear all interceptors from the stack
|
|
843
|
+
*
|
|
844
|
+
* @returns {void}
|
|
845
|
+
*/
|
|
846
|
+
clear() {
|
|
847
|
+
this.handlers && (this.handlers = []);
|
|
848
|
+
}
|
|
849
|
+
/**
|
|
850
|
+
* Iterate over all the registered interceptors
|
|
851
|
+
*
|
|
852
|
+
* This method is particularly useful for skipping over any
|
|
853
|
+
* interceptors that may have become `null` calling `eject`.
|
|
854
|
+
*
|
|
855
|
+
* @param {Function} fn The function to call for each interceptor
|
|
856
|
+
*
|
|
857
|
+
* @returns {void}
|
|
858
|
+
*/
|
|
859
|
+
forEach(t) {
|
|
860
|
+
l.forEach(this.handlers, function(a) {
|
|
861
|
+
a !== null && t(a);
|
|
862
|
+
});
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
const Wt = to, St = {
|
|
866
|
+
silentJSONParsing: !0,
|
|
867
|
+
forcedJSONParsing: !0,
|
|
868
|
+
clarifyTimeoutError: !1,
|
|
869
|
+
legacyInterceptorReqResOrdering: !0,
|
|
870
|
+
advertiseZstdAcceptEncoding: !1,
|
|
871
|
+
validateStatusUndefinedResolves: !0
|
|
872
|
+
}, ao = typeof URLSearchParams < "u" ? URLSearchParams : Tt, no = typeof FormData < "u" ? FormData : null, oo = typeof Blob < "u" ? Blob : null, ro = {
|
|
873
|
+
isBrowser: !0,
|
|
874
|
+
classes: {
|
|
875
|
+
URLSearchParams: ao,
|
|
876
|
+
FormData: no,
|
|
877
|
+
Blob: oo
|
|
878
|
+
},
|
|
879
|
+
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
880
|
+
}, Et = typeof window < "u" && typeof document < "u", wt = typeof navigator == "object" && navigator || void 0, io = Et && (!wt || ["ReactNative", "NativeScript", "NS"].indexOf(wt.product) < 0), so = (() => typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
881
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts == "function")(), lo = Et && window.location.href || "http://localhost", uo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
882
|
+
__proto__: null,
|
|
883
|
+
hasBrowserEnv: Et,
|
|
884
|
+
hasStandardBrowserEnv: io,
|
|
885
|
+
hasStandardBrowserWebWorkerEnv: so,
|
|
886
|
+
navigator: wt,
|
|
887
|
+
origin: lo
|
|
888
|
+
}, Symbol.toStringTag, { value: "Module" })), ee = {
|
|
889
|
+
...uo,
|
|
890
|
+
...ro
|
|
891
|
+
};
|
|
892
|
+
function co(e, t) {
|
|
893
|
+
return st(e, new ee.classes.URLSearchParams(), {
|
|
894
|
+
visitor: function(a, n, o, r) {
|
|
895
|
+
return ee.isNode && l.isBuffer(a) ? (this.append(n, a.toString("base64")), !1) : r.defaultVisitor.apply(this, arguments);
|
|
896
|
+
},
|
|
897
|
+
...t
|
|
898
|
+
});
|
|
899
|
+
}
|
|
900
|
+
const Gt = va;
|
|
901
|
+
function Pa(e) {
|
|
902
|
+
if (e > Gt)
|
|
903
|
+
throw new C(
|
|
904
|
+
"FormData field is too deeply nested (" + e + " levels). Max depth: " + Gt,
|
|
905
|
+
C.ERR_FORM_DATA_DEPTH_EXCEEDED
|
|
906
|
+
);
|
|
907
|
+
}
|
|
908
|
+
function po(e) {
|
|
909
|
+
const t = [], a = /\w+|\[(\w*)]/g;
|
|
910
|
+
let n;
|
|
911
|
+
for (; (n = a.exec(e)) !== null; )
|
|
912
|
+
Pa(t.length), t.push(n[0] === "[]" ? "" : n[1] || n[0]);
|
|
913
|
+
return t;
|
|
914
|
+
}
|
|
915
|
+
function fo(e) {
|
|
916
|
+
const t = {}, a = Object.keys(e);
|
|
917
|
+
let n;
|
|
918
|
+
const o = a.length;
|
|
919
|
+
let r;
|
|
920
|
+
for (n = 0; n < o; n++)
|
|
921
|
+
r = a[n], t[r] = e[r];
|
|
922
|
+
return t;
|
|
923
|
+
}
|
|
924
|
+
function Ta(e) {
|
|
925
|
+
function t(a, n, o, r) {
|
|
926
|
+
Pa(r);
|
|
927
|
+
let i = a[r++];
|
|
928
|
+
if (i === "__proto__")
|
|
929
|
+
return !0;
|
|
930
|
+
const s = Number.isFinite(+i), u = r >= a.length;
|
|
931
|
+
return i = !i && l.isArray(o) ? o.length : i, u ? (l.hasOwnProp(o, i) ? o[i] = l.isArray(o[i]) ? o[i].concat(n) : [o[i], n] : o[i] = n, !s) : ((!l.hasOwnProp(o, i) || !l.isObject(o[i])) && (o[i] = []), t(a, n, o[i], r) && l.isArray(o[i]) && (o[i] = fo(o[i])), !s);
|
|
932
|
+
}
|
|
933
|
+
if (l.isFormData(e) && l.isFunction(e.entries)) {
|
|
934
|
+
const a = {};
|
|
935
|
+
return l.forEachEntry(e, (n, o) => {
|
|
936
|
+
t(po(n), o, a, 0);
|
|
937
|
+
}), a;
|
|
938
|
+
}
|
|
939
|
+
return null;
|
|
940
|
+
}
|
|
941
|
+
const De = (e, t) => e != null && l.hasOwnProp(e, t) ? e[t] : void 0;
|
|
942
|
+
function mo(e, t, a) {
|
|
943
|
+
if (l.isString(e))
|
|
944
|
+
try {
|
|
945
|
+
return (t || JSON.parse)(e), l.trim(e);
|
|
946
|
+
} catch (n) {
|
|
947
|
+
if (n.name !== "SyntaxError")
|
|
948
|
+
throw n;
|
|
949
|
+
}
|
|
950
|
+
return (a || JSON.stringify)(e);
|
|
951
|
+
}
|
|
952
|
+
const Ct = {
|
|
953
|
+
transitional: St,
|
|
954
|
+
adapter: ["xhr", "http", "fetch"],
|
|
955
|
+
transformRequest: [
|
|
956
|
+
function(e, t) {
|
|
957
|
+
const a = t.getContentType() || "", n = a.indexOf("application/json") > -1, o = l.isObject(e);
|
|
958
|
+
if (o && l.isHTMLForm(e) && (e = new FormData(e)), l.isFormData(e))
|
|
959
|
+
return n ? JSON.stringify(Ta(e)) : e;
|
|
960
|
+
if (l.isArrayBuffer(e) || l.isBuffer(e) || l.isStream(e) || l.isFile(e) || l.isBlob(e) || l.isReadableStream(e))
|
|
961
|
+
return e;
|
|
962
|
+
if (l.isArrayBufferView(e))
|
|
963
|
+
return e.buffer;
|
|
964
|
+
if (l.isURLSearchParams(e))
|
|
965
|
+
return t.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), e.toString();
|
|
966
|
+
let r;
|
|
967
|
+
if (o) {
|
|
968
|
+
const i = De(this, "formSerializer");
|
|
969
|
+
if (a.indexOf("application/x-www-form-urlencoded") > -1)
|
|
970
|
+
return co(e, i).toString();
|
|
971
|
+
if ((r = l.isFileList(e)) || a.indexOf("multipart/form-data") > -1) {
|
|
972
|
+
const s = De(this, "env"), u = s && s.FormData;
|
|
973
|
+
return st(
|
|
974
|
+
r ? { "files[]": e } : e,
|
|
975
|
+
u && new u(),
|
|
976
|
+
i
|
|
977
|
+
);
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
return o || n ? (t.setContentType("application/json", !1), mo(e)) : e;
|
|
981
|
+
}
|
|
982
|
+
],
|
|
983
|
+
transformResponse: [
|
|
984
|
+
function(e) {
|
|
985
|
+
const t = De(this, "transitional") || Ct.transitional, a = t && t.forcedJSONParsing, n = De(this, "responseType"), o = n === "json";
|
|
986
|
+
if (l.isResponse(e) || l.isReadableStream(e))
|
|
987
|
+
return e;
|
|
988
|
+
if (e && l.isString(e) && (a && !n || o)) {
|
|
989
|
+
const r = !(t && t.silentJSONParsing) && o;
|
|
990
|
+
try {
|
|
991
|
+
return JSON.parse(e, De(this, "parseReviver"));
|
|
992
|
+
} catch (i) {
|
|
993
|
+
if (r)
|
|
994
|
+
throw i.name === "SyntaxError" ? C.from(i, C.ERR_BAD_RESPONSE, this, null, De(this, "response")) : i;
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
return e;
|
|
998
|
+
}
|
|
999
|
+
],
|
|
1000
|
+
/**
|
|
1001
|
+
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
1002
|
+
* timeout is not created.
|
|
1003
|
+
*/
|
|
1004
|
+
timeout: 0,
|
|
1005
|
+
xsrfCookieName: "XSRF-TOKEN",
|
|
1006
|
+
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
1007
|
+
maxContentLength: -1,
|
|
1008
|
+
maxBodyLength: -1,
|
|
1009
|
+
env: {
|
|
1010
|
+
FormData: ee.classes.FormData,
|
|
1011
|
+
Blob: ee.classes.Blob
|
|
1012
|
+
},
|
|
1013
|
+
validateStatus: function(e) {
|
|
1014
|
+
return e >= 200 && e < 300;
|
|
1015
|
+
},
|
|
1016
|
+
headers: {
|
|
1017
|
+
common: {
|
|
1018
|
+
Accept: "application/json, text/plain, */*",
|
|
1019
|
+
"Content-Type": void 0
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
};
|
|
1023
|
+
l.forEach(["delete", "get", "head", "post", "put", "patch", "query"], (e) => {
|
|
1024
|
+
Ct.headers[e] = {};
|
|
1025
|
+
});
|
|
1026
|
+
const Ot = Ct;
|
|
1027
|
+
function ft(e, t) {
|
|
1028
|
+
const a = this || Ot, n = t || a, o = le.from(n.headers);
|
|
1029
|
+
let r = n.data;
|
|
1030
|
+
return l.forEach(e, function(i) {
|
|
1031
|
+
r = i.call(a, r, o.normalize(), t ? t.status : void 0);
|
|
1032
|
+
}), o.normalize(), r;
|
|
1033
|
+
}
|
|
1034
|
+
function Sa(e) {
|
|
1035
|
+
return !!(e && e.__CANCEL__);
|
|
1036
|
+
}
|
|
1037
|
+
class go extends C {
|
|
1038
|
+
/**
|
|
1039
|
+
* A `CanceledError` is an object that is thrown when an operation is canceled.
|
|
1040
|
+
*
|
|
1041
|
+
* @param {string=} message The message.
|
|
1042
|
+
* @param {Object=} config The config.
|
|
1043
|
+
* @param {Object=} request The request.
|
|
1044
|
+
*
|
|
1045
|
+
* @returns {CanceledError} The created error.
|
|
1046
|
+
*/
|
|
1047
|
+
constructor(t, a, n) {
|
|
1048
|
+
super(t ?? "canceled", C.ERR_CANCELED, a, n), this.name = "CanceledError", this.__CANCEL__ = !0;
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
const We = go;
|
|
1052
|
+
function Ea(e, t, a) {
|
|
1053
|
+
const n = a.config.validateStatus;
|
|
1054
|
+
!a.status || !n || n(a.status) ? e(a) : t(new C(
|
|
1055
|
+
"Request failed with status code " + a.status,
|
|
1056
|
+
a.status >= 400 && a.status < 500 ? C.ERR_BAD_REQUEST : C.ERR_BAD_RESPONSE,
|
|
1057
|
+
a.config,
|
|
1058
|
+
a.request,
|
|
1059
|
+
a
|
|
1060
|
+
));
|
|
1061
|
+
}
|
|
1062
|
+
function ho(e) {
|
|
1063
|
+
const t = /^([-+\w]{1,25}):(?:\/\/)?/.exec(e);
|
|
1064
|
+
return t && t[1] || "";
|
|
1065
|
+
}
|
|
1066
|
+
function bo(e, t) {
|
|
1067
|
+
e = e || 10;
|
|
1068
|
+
const a = new Array(e), n = new Array(e);
|
|
1069
|
+
let o = 0, r = 0, i;
|
|
1070
|
+
return t = t !== void 0 ? t : 1e3, function(s) {
|
|
1071
|
+
const u = Date.now(), d = n[r];
|
|
1072
|
+
i || (i = u), a[o] = s, n[o] = u;
|
|
1073
|
+
let c = r, f = 0;
|
|
1074
|
+
for (; c !== o; )
|
|
1075
|
+
f += a[c++], c = c % e;
|
|
1076
|
+
if (o = (o + 1) % e, o === r && (r = (r + 1) % e), u - i < t)
|
|
1077
|
+
return;
|
|
1078
|
+
const v = d && u - d;
|
|
1079
|
+
return v ? Math.round(f * 1e3 / v) : void 0;
|
|
1080
|
+
};
|
|
1081
|
+
}
|
|
1082
|
+
function yo(e, t) {
|
|
1083
|
+
let a = 0, n = 1e3 / t, o, r;
|
|
1084
|
+
const i = (s, u = Date.now()) => {
|
|
1085
|
+
a = u, o = null, r && (clearTimeout(r), r = null), e(...s);
|
|
1086
|
+
};
|
|
1087
|
+
return [(...s) => {
|
|
1088
|
+
const u = Date.now(), d = u - a;
|
|
1089
|
+
d >= n ? i(s, u) : (o = s, r || (r = setTimeout(() => {
|
|
1090
|
+
r = null, i(o);
|
|
1091
|
+
}, n - d)));
|
|
1092
|
+
}, () => o && i(o)];
|
|
1093
|
+
}
|
|
1094
|
+
const at = (e, t, a = 3) => {
|
|
1095
|
+
let n = 0;
|
|
1096
|
+
const o = bo(50, 250);
|
|
1097
|
+
return yo((r) => {
|
|
1098
|
+
if (!r || typeof r.loaded != "number")
|
|
1099
|
+
return;
|
|
1100
|
+
const i = r.loaded, s = r.lengthComputable ? r.total : void 0, u = s != null ? Math.min(i, s) : i, d = Math.max(0, u - n), c = o(d);
|
|
1101
|
+
n = Math.max(n, u);
|
|
1102
|
+
const f = {
|
|
1103
|
+
loaded: u,
|
|
1104
|
+
total: s,
|
|
1105
|
+
progress: s ? u / s : void 0,
|
|
1106
|
+
bytes: d,
|
|
1107
|
+
rate: c || void 0,
|
|
1108
|
+
estimated: c && s ? (s - u) / c : void 0,
|
|
1109
|
+
event: r,
|
|
1110
|
+
lengthComputable: s != null,
|
|
1111
|
+
[t ? "download" : "upload"]: !0
|
|
1112
|
+
};
|
|
1113
|
+
e(f);
|
|
1114
|
+
}, a);
|
|
1115
|
+
}, Ht = (e, t) => {
|
|
1116
|
+
const a = e != null;
|
|
1117
|
+
return [
|
|
1118
|
+
(n) => t[0]({
|
|
1119
|
+
lengthComputable: a,
|
|
1120
|
+
total: e,
|
|
1121
|
+
loaded: n
|
|
1122
|
+
}),
|
|
1123
|
+
t[1]
|
|
1124
|
+
];
|
|
1125
|
+
}, Jt = (e) => (...t) => l.asap(() => e(...t)), vo = ee.hasStandardBrowserEnv ? ((e, t) => (a) => (a = new URL(a, ee.origin), e.protocol === a.protocol && e.host === a.host && (t || e.port === a.port)))(
|
|
1126
|
+
new URL(ee.origin),
|
|
1127
|
+
ee.navigator && /(msie|trident)/i.test(ee.navigator.userAgent)
|
|
1128
|
+
) : () => !0, wo = ee.hasStandardBrowserEnv ? (
|
|
1129
|
+
// Standard browser envs support document.cookie
|
|
1130
|
+
{
|
|
1131
|
+
write(e, t, a, n, o, r, i) {
|
|
1132
|
+
if (typeof document > "u")
|
|
1133
|
+
return;
|
|
1134
|
+
const s = [`${e}=${encodeURIComponent(t)}`];
|
|
1135
|
+
l.isNumber(a) && s.push(`expires=${new Date(a).toUTCString()}`), l.isString(n) && s.push(`path=${n}`), l.isString(o) && s.push(`domain=${o}`), r === !0 && s.push("secure"), l.isString(i) && s.push(`SameSite=${i}`), document.cookie = s.join("; ");
|
|
1136
|
+
},
|
|
1137
|
+
read(e) {
|
|
1138
|
+
if (typeof document > "u")
|
|
1139
|
+
return null;
|
|
1140
|
+
const t = document.cookie.split(";");
|
|
1141
|
+
for (let a = 0; a < t.length; a++) {
|
|
1142
|
+
const n = t[a].replace(/^\s+/, ""), o = n.indexOf("=");
|
|
1143
|
+
if (o !== -1 && n.slice(0, o) === e)
|
|
1144
|
+
try {
|
|
1145
|
+
return decodeURIComponent(n.slice(o + 1));
|
|
1146
|
+
} catch {
|
|
1147
|
+
return n.slice(o + 1);
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
return null;
|
|
1151
|
+
},
|
|
1152
|
+
remove(e) {
|
|
1153
|
+
this.write(e, "", Date.now() - 864e5, "/");
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
) : (
|
|
1157
|
+
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
1158
|
+
{
|
|
1159
|
+
write() {
|
|
1160
|
+
},
|
|
1161
|
+
read() {
|
|
1162
|
+
return null;
|
|
1163
|
+
},
|
|
1164
|
+
remove() {
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
);
|
|
1168
|
+
function ko(e) {
|
|
1169
|
+
return typeof e != "string" ? !1 : /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
|
|
1170
|
+
}
|
|
1171
|
+
function xo(e, t) {
|
|
1172
|
+
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
|
|
1173
|
+
}
|
|
1174
|
+
const Po = /^https?:(?!\/\/)/i, To = /[\t\n\r]/g;
|
|
1175
|
+
function So(e) {
|
|
1176
|
+
let t = 0;
|
|
1177
|
+
for (; t < e.length && e.charCodeAt(t) <= 32; )
|
|
1178
|
+
t++;
|
|
1179
|
+
return e.slice(t);
|
|
1180
|
+
}
|
|
1181
|
+
function Eo(e) {
|
|
1182
|
+
return So(e).replace(To, "");
|
|
1183
|
+
}
|
|
1184
|
+
function Kt(e, t) {
|
|
1185
|
+
if (typeof e == "string" && Po.test(Eo(e)))
|
|
1186
|
+
throw new C(
|
|
1187
|
+
'Invalid URL: missing "//" after protocol',
|
|
1188
|
+
C.ERR_INVALID_URL,
|
|
1189
|
+
t
|
|
1190
|
+
);
|
|
1191
|
+
}
|
|
1192
|
+
function Ca(e, t, a, n) {
|
|
1193
|
+
Kt(t, n);
|
|
1194
|
+
let o = !ko(t);
|
|
1195
|
+
return e && (o || a === !1) ? (Kt(e, n), xo(e, t)) : t;
|
|
1196
|
+
}
|
|
1197
|
+
const Xt = (e) => e instanceof le ? { ...e } : e;
|
|
1198
|
+
function Ae(e, t) {
|
|
1199
|
+
e = e || {}, t = t || {};
|
|
1200
|
+
const a = /* @__PURE__ */ Object.create(null);
|
|
1201
|
+
Object.defineProperty(a, "hasOwnProperty", {
|
|
1202
|
+
// Null-proto descriptor so a polluted Object.prototype.get cannot turn
|
|
1203
|
+
// this data descriptor into an accessor descriptor on the way in.
|
|
1204
|
+
__proto__: null,
|
|
1205
|
+
value: Object.prototype.hasOwnProperty,
|
|
1206
|
+
enumerable: !1,
|
|
1207
|
+
writable: !0,
|
|
1208
|
+
configurable: !0
|
|
1209
|
+
});
|
|
1210
|
+
function n(c, f, v, F) {
|
|
1211
|
+
return l.isPlainObject(c) && l.isPlainObject(f) ? l.merge.call({ caseless: F }, c, f) : l.isPlainObject(f) ? l.merge({}, f) : l.isArray(f) ? f.slice() : f;
|
|
1212
|
+
}
|
|
1213
|
+
function o(c, f, v, F) {
|
|
1214
|
+
if (l.isUndefined(f)) {
|
|
1215
|
+
if (!l.isUndefined(c))
|
|
1216
|
+
return n(void 0, c, v, F);
|
|
1217
|
+
} else
|
|
1218
|
+
return n(c, f, v, F);
|
|
1219
|
+
}
|
|
1220
|
+
function r(c, f) {
|
|
1221
|
+
if (!l.isUndefined(f))
|
|
1222
|
+
return n(void 0, f);
|
|
1223
|
+
}
|
|
1224
|
+
function i(c, f) {
|
|
1225
|
+
if (l.isUndefined(f)) {
|
|
1226
|
+
if (!l.isUndefined(c))
|
|
1227
|
+
return n(void 0, c);
|
|
1228
|
+
} else
|
|
1229
|
+
return n(void 0, f);
|
|
1230
|
+
}
|
|
1231
|
+
function s(c) {
|
|
1232
|
+
const f = l.hasOwnProp(t, "transitional") ? t.transitional : void 0;
|
|
1233
|
+
if (!l.isUndefined(f))
|
|
1234
|
+
if (l.isPlainObject(f)) {
|
|
1235
|
+
if (l.hasOwnProp(f, c))
|
|
1236
|
+
return f[c];
|
|
1237
|
+
} else
|
|
1238
|
+
return;
|
|
1239
|
+
const v = l.hasOwnProp(e, "transitional") ? e.transitional : void 0;
|
|
1240
|
+
if (l.isPlainObject(v) && l.hasOwnProp(v, c))
|
|
1241
|
+
return v[c];
|
|
1242
|
+
}
|
|
1243
|
+
function u(c, f, v) {
|
|
1244
|
+
if (l.hasOwnProp(t, v))
|
|
1245
|
+
return n(c, f);
|
|
1246
|
+
if (l.hasOwnProp(e, v))
|
|
1247
|
+
return n(void 0, c);
|
|
1248
|
+
}
|
|
1249
|
+
const d = {
|
|
1250
|
+
url: r,
|
|
1251
|
+
method: r,
|
|
1252
|
+
data: r,
|
|
1253
|
+
baseURL: i,
|
|
1254
|
+
transformRequest: i,
|
|
1255
|
+
transformResponse: i,
|
|
1256
|
+
paramsSerializer: i,
|
|
1257
|
+
timeout: i,
|
|
1258
|
+
timeoutMessage: i,
|
|
1259
|
+
withCredentials: i,
|
|
1260
|
+
withXSRFToken: i,
|
|
1261
|
+
adapter: i,
|
|
1262
|
+
responseType: i,
|
|
1263
|
+
xsrfCookieName: i,
|
|
1264
|
+
xsrfHeaderName: i,
|
|
1265
|
+
onUploadProgress: i,
|
|
1266
|
+
onDownloadProgress: i,
|
|
1267
|
+
decompress: i,
|
|
1268
|
+
maxContentLength: i,
|
|
1269
|
+
maxBodyLength: i,
|
|
1270
|
+
beforeRedirect: i,
|
|
1271
|
+
transport: i,
|
|
1272
|
+
httpAgent: i,
|
|
1273
|
+
httpsAgent: i,
|
|
1274
|
+
cancelToken: i,
|
|
1275
|
+
socketPath: i,
|
|
1276
|
+
allowedSocketPaths: i,
|
|
1277
|
+
responseEncoding: i,
|
|
1278
|
+
validateStatus: u,
|
|
1279
|
+
headers: (c, f, v) => o(Xt(c), Xt(f), v, !0)
|
|
1280
|
+
};
|
|
1281
|
+
return l.forEach(Object.keys({ ...e, ...t }), function(c) {
|
|
1282
|
+
if (c === "__proto__" || c === "constructor" || c === "prototype")
|
|
1283
|
+
return;
|
|
1284
|
+
const f = l.hasOwnProp(d, c) ? d[c] : o, v = l.hasOwnProp(e, c) ? e[c] : void 0, F = l.hasOwnProp(t, c) ? t[c] : void 0, P = f(v, F, c);
|
|
1285
|
+
l.isUndefined(P) && f !== u || (a[c] = P);
|
|
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
|
+
}
|
|
1288
|
+
const Co = ["content-type", "content-length"];
|
|
1289
|
+
function Oo(e, t, a) {
|
|
1290
|
+
if (a !== "content-only") {
|
|
1291
|
+
e.set(t);
|
|
1292
|
+
return;
|
|
1293
|
+
}
|
|
1294
|
+
Object.entries(t || {}).forEach(([n, o]) => {
|
|
1295
|
+
Co.includes(n.toLowerCase()) && e.set(n, o);
|
|
1296
|
+
});
|
|
1297
|
+
}
|
|
1298
|
+
const Ro = (e) => encodeURIComponent(e).replace(
|
|
1299
|
+
/%([0-9A-F]{2})/gi,
|
|
1300
|
+
(t, a) => String.fromCharCode(parseInt(a, 16))
|
|
1301
|
+
);
|
|
1302
|
+
function Oa(e) {
|
|
1303
|
+
const t = Ae({}, e), a = (v) => l.hasOwnProp(t, v) ? t[v] : void 0, n = a("data");
|
|
1304
|
+
let o = a("withXSRFToken");
|
|
1305
|
+
const r = a("xsrfHeaderName"), i = a("xsrfCookieName");
|
|
1306
|
+
let s = a("headers");
|
|
1307
|
+
const u = a("auth"), d = a("baseURL"), c = a("allowAbsoluteUrls"), f = a("url");
|
|
1308
|
+
if (t.headers = s = le.from(s), t.url = xa(
|
|
1309
|
+
Ca(d, f, c, t),
|
|
1310
|
+
a("params"),
|
|
1311
|
+
a("paramsSerializer")
|
|
1312
|
+
), u) {
|
|
1313
|
+
const v = l.getSafeProp(u, "username") || "", F = l.getSafeProp(u, "password") || "";
|
|
1314
|
+
try {
|
|
1315
|
+
s.set(
|
|
1316
|
+
"Authorization",
|
|
1317
|
+
"Basic " + btoa(v + ":" + (F ? Ro(F) : ""))
|
|
1318
|
+
);
|
|
1319
|
+
} catch (P) {
|
|
1320
|
+
throw C.from(P, C.ERR_BAD_OPTION_VALUE, e);
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1323
|
+
if (l.isFormData(n) && (ee.hasStandardBrowserEnv || ee.hasStandardBrowserWebWorkerEnv || l.isReactNative(n) ? s.setContentType(void 0) : l.isFunction(n.getHeaders) && Oo(s, n.getHeaders(), a("formDataHeaderPolicy"))), ee.hasStandardBrowserEnv && (l.isFunction(o) && (o = o(t)), o === !0 || o == null && vo(t.url))) {
|
|
1324
|
+
const v = r && i && wo.read(i);
|
|
1325
|
+
v && s.set(r, v);
|
|
1326
|
+
}
|
|
1327
|
+
return t;
|
|
1328
|
+
}
|
|
1329
|
+
const Ao = typeof XMLHttpRequest < "u", Bo = Ao && function(e) {
|
|
1330
|
+
return new Promise(function(t, a) {
|
|
1331
|
+
const n = Oa(e);
|
|
1332
|
+
let o = n.data;
|
|
1333
|
+
const r = le.from(n.headers).normalize();
|
|
1334
|
+
let { responseType: i, onUploadProgress: s, onDownloadProgress: u } = n, d, c, f, v, F;
|
|
1335
|
+
function P() {
|
|
1336
|
+
v && v(), F && F(), n.cancelToken && n.cancelToken.unsubscribe(d), n.signal && n.signal.removeEventListener("abort", d);
|
|
1337
|
+
}
|
|
1338
|
+
let S = new XMLHttpRequest();
|
|
1339
|
+
S.open(n.method.toUpperCase(), n.url, !0), S.timeout = n.timeout;
|
|
1340
|
+
function O() {
|
|
1341
|
+
if (!S)
|
|
1342
|
+
return;
|
|
1343
|
+
const h = le.from(
|
|
1344
|
+
"getAllResponseHeaders" in S && S.getAllResponseHeaders()
|
|
1345
|
+
), A = {
|
|
1346
|
+
data: !i || i === "text" || i === "json" ? S.responseText : S.response,
|
|
1347
|
+
status: S.status,
|
|
1348
|
+
statusText: S.statusText,
|
|
1349
|
+
headers: h,
|
|
1350
|
+
config: e,
|
|
1351
|
+
request: S
|
|
1352
|
+
};
|
|
1353
|
+
Ea(
|
|
1354
|
+
function(D) {
|
|
1355
|
+
t(D), P();
|
|
1356
|
+
},
|
|
1357
|
+
function(D) {
|
|
1358
|
+
a(D), P();
|
|
1359
|
+
},
|
|
1360
|
+
A
|
|
1361
|
+
), S = null;
|
|
1362
|
+
}
|
|
1363
|
+
"onloadend" in S ? S.onloadend = O : S.onreadystatechange = function() {
|
|
1364
|
+
!S || S.readyState !== 4 || S.status === 0 && !(S.responseURL && S.responseURL.startsWith("file:")) || setTimeout(O);
|
|
1365
|
+
}, S.onabort = function() {
|
|
1366
|
+
S && (a(new C("Request aborted", C.ECONNABORTED, e, S)), P(), S = null);
|
|
1367
|
+
}, S.onerror = function(h) {
|
|
1368
|
+
const A = h && h.message ? h.message : "Network Error", D = new C(A, C.ERR_NETWORK, e, S);
|
|
1369
|
+
D.event = h || null, a(D), P(), S = null;
|
|
1370
|
+
}, S.ontimeout = function() {
|
|
1371
|
+
let h = n.timeout ? "timeout of " + n.timeout + "ms exceeded" : "timeout exceeded";
|
|
1372
|
+
const A = n.transitional || St;
|
|
1373
|
+
n.timeoutErrorMessage && (h = n.timeoutErrorMessage), a(
|
|
1374
|
+
new C(
|
|
1375
|
+
h,
|
|
1376
|
+
A.clarifyTimeoutError ? C.ETIMEDOUT : C.ECONNABORTED,
|
|
1377
|
+
e,
|
|
1378
|
+
S
|
|
1379
|
+
)
|
|
1380
|
+
), P(), S = null;
|
|
1381
|
+
}, o === void 0 && r.setContentType(null), "setRequestHeader" in S && l.forEach(ya(r), function(h, A) {
|
|
1382
|
+
S.setRequestHeader(A, h);
|
|
1383
|
+
}), l.isUndefined(n.withCredentials) || (S.withCredentials = !!n.withCredentials), i && i !== "json" && (S.responseType = n.responseType), u && ([f, F] = at(u, !0), S.addEventListener("progress", f)), s && S.upload && ([c, v] = at(s), S.upload.addEventListener("progress", c), S.upload.addEventListener("loadend", v)), (n.cancelToken || n.signal) && (d = (h) => {
|
|
1384
|
+
S && (a(!h || h.type ? new We(null, e, S) : h), S.abort(), P(), S = null);
|
|
1385
|
+
}, n.cancelToken && n.cancelToken.subscribe(d), n.signal && (n.signal.aborted ? d() : n.signal.addEventListener("abort", d)));
|
|
1386
|
+
const p = ho(n.url);
|
|
1387
|
+
if (p && !ee.protocols.includes(p)) {
|
|
1388
|
+
a(
|
|
1389
|
+
new C(
|
|
1390
|
+
"Unsupported protocol " + p + ":",
|
|
1391
|
+
C.ERR_BAD_REQUEST,
|
|
1392
|
+
e
|
|
1393
|
+
)
|
|
1394
|
+
), P();
|
|
1395
|
+
return;
|
|
1396
|
+
}
|
|
1397
|
+
S.send(o || null);
|
|
1398
|
+
});
|
|
1399
|
+
}, Do = (e, t) => {
|
|
1400
|
+
if (e = e ? e.filter(Boolean) : [], !t && !e.length)
|
|
1401
|
+
return;
|
|
1402
|
+
const a = new AbortController();
|
|
1403
|
+
let n = !1;
|
|
1404
|
+
const o = function(u) {
|
|
1405
|
+
if (!n) {
|
|
1406
|
+
n = !0, i();
|
|
1407
|
+
const d = u instanceof Error ? u : this.reason;
|
|
1408
|
+
a.abort(
|
|
1409
|
+
d instanceof C ? d : new We(d instanceof Error ? d.message : d)
|
|
1410
|
+
);
|
|
1411
|
+
}
|
|
1412
|
+
};
|
|
1413
|
+
let r = t && setTimeout(() => {
|
|
1414
|
+
r = null, o(new C(`timeout of ${t}ms exceeded`, C.ETIMEDOUT));
|
|
1415
|
+
}, t);
|
|
1416
|
+
const i = () => {
|
|
1417
|
+
e && (r && clearTimeout(r), r = null, e.forEach((u) => {
|
|
1418
|
+
u.unsubscribe ? u.unsubscribe(o) : u.removeEventListener("abort", o);
|
|
1419
|
+
}), e = null);
|
|
1420
|
+
};
|
|
1421
|
+
e.forEach((u) => u.addEventListener("abort", o, { once: !0 }));
|
|
1422
|
+
const { signal: s } = a;
|
|
1423
|
+
return s.unsubscribe = () => l.asap(i), s;
|
|
1424
|
+
}, _o = Do, Fo = function* (e, t) {
|
|
1425
|
+
let a = e.byteLength;
|
|
1426
|
+
if (!t || a < t) {
|
|
1427
|
+
yield e;
|
|
1428
|
+
return;
|
|
1429
|
+
}
|
|
1430
|
+
let n = 0, o;
|
|
1431
|
+
for (; n < a; )
|
|
1432
|
+
o = n + t, yield e.slice(n, o), n = o;
|
|
1433
|
+
}, Io = async function* (e, t) {
|
|
1434
|
+
for await (const a of Lo(e))
|
|
1435
|
+
yield* Fo(a, t);
|
|
1436
|
+
}, Lo = async function* (e) {
|
|
1437
|
+
if (e[Symbol.asyncIterator]) {
|
|
1438
|
+
yield* e;
|
|
1439
|
+
return;
|
|
1440
|
+
}
|
|
1441
|
+
const t = e.getReader();
|
|
1442
|
+
try {
|
|
1443
|
+
for (; ; ) {
|
|
1444
|
+
const { done: a, value: n } = await t.read();
|
|
1445
|
+
if (a)
|
|
1446
|
+
break;
|
|
1447
|
+
yield n;
|
|
1448
|
+
}
|
|
1449
|
+
} finally {
|
|
1450
|
+
await t.cancel();
|
|
1451
|
+
}
|
|
1452
|
+
}, Qt = (e, t, a, n) => {
|
|
1453
|
+
const o = Io(e, t);
|
|
1454
|
+
let r = 0, i, s = (u) => {
|
|
1455
|
+
i || (i = !0, n && n(u));
|
|
1456
|
+
};
|
|
1457
|
+
return new ReadableStream(
|
|
1458
|
+
{
|
|
1459
|
+
async pull(u) {
|
|
1460
|
+
try {
|
|
1461
|
+
const { done: d, value: c } = await o.next();
|
|
1462
|
+
if (d) {
|
|
1463
|
+
s(), u.close();
|
|
1464
|
+
return;
|
|
1465
|
+
}
|
|
1466
|
+
let f = c.byteLength;
|
|
1467
|
+
if (a) {
|
|
1468
|
+
let v = r += f;
|
|
1469
|
+
a(v);
|
|
1470
|
+
}
|
|
1471
|
+
u.enqueue(new Uint8Array(c));
|
|
1472
|
+
} catch (d) {
|
|
1473
|
+
throw s(d), d;
|
|
1474
|
+
}
|
|
1475
|
+
},
|
|
1476
|
+
cancel(u) {
|
|
1477
|
+
return s(u), o.return();
|
|
1478
|
+
}
|
|
1479
|
+
},
|
|
1480
|
+
{
|
|
1481
|
+
highWaterMark: 2
|
|
1482
|
+
}
|
|
1483
|
+
);
|
|
1484
|
+
}, nt = (e) => e >= 48 && e <= 57 || e >= 65 && e <= 70 || e >= 97 && e <= 102, No = (e, t, a) => t + 2 < a && nt(e.charCodeAt(t + 1)) && nt(e.charCodeAt(t + 2));
|
|
1485
|
+
function Uo(e) {
|
|
1486
|
+
if (!e || typeof e != "string" || !e.startsWith("data:"))
|
|
1487
|
+
return 0;
|
|
1488
|
+
const t = e.indexOf(",");
|
|
1489
|
+
if (t < 0)
|
|
1490
|
+
return 0;
|
|
1491
|
+
const a = e.slice(5, t), n = e.slice(t + 1);
|
|
1492
|
+
if (/;base64/i.test(a)) {
|
|
1493
|
+
let r = n.length;
|
|
1494
|
+
const i = n.length;
|
|
1495
|
+
for (let f = 0; f < i; f++)
|
|
1496
|
+
if (n.charCodeAt(f) === 37 && f + 2 < i) {
|
|
1497
|
+
const v = n.charCodeAt(f + 1), F = n.charCodeAt(f + 2);
|
|
1498
|
+
nt(v) && nt(F) && (r -= 2, f += 2);
|
|
1499
|
+
}
|
|
1500
|
+
let s = 0, u = i - 1;
|
|
1501
|
+
const d = (f) => f >= 2 && n.charCodeAt(f - 2) === 37 && // '%'
|
|
1502
|
+
n.charCodeAt(f - 1) === 51 && // '3'
|
|
1503
|
+
(n.charCodeAt(f) === 68 || n.charCodeAt(f) === 100);
|
|
1504
|
+
u >= 0 && (n.charCodeAt(u) === 61 ? (s++, u--) : d(u) && (s++, u -= 3)), s === 1 && u >= 0 && (n.charCodeAt(u) === 61 || d(u)) && s++;
|
|
1505
|
+
const c = Math.floor(r / 4) * 3 - (s || 0);
|
|
1506
|
+
return c > 0 ? c : 0;
|
|
1507
|
+
}
|
|
1508
|
+
let o = 0;
|
|
1509
|
+
for (let r = 0, i = n.length; r < i; r++) {
|
|
1510
|
+
const s = n.charCodeAt(r);
|
|
1511
|
+
if (s === 37 && No(n, r, i))
|
|
1512
|
+
o += 1, r += 2;
|
|
1513
|
+
else if (s < 128)
|
|
1514
|
+
o += 1;
|
|
1515
|
+
else if (s < 2048)
|
|
1516
|
+
o += 2;
|
|
1517
|
+
else if (s >= 55296 && s <= 56319 && r + 1 < i) {
|
|
1518
|
+
const u = n.charCodeAt(r + 1);
|
|
1519
|
+
u >= 56320 && u <= 57343 ? (o += 4, r++) : o += 3;
|
|
1520
|
+
} else
|
|
1521
|
+
o += 3;
|
|
1522
|
+
}
|
|
1523
|
+
return o;
|
|
1524
|
+
}
|
|
1525
|
+
const Rt = "1.18.1", Yt = 64 * 1024, { isFunction: Ke } = l, Mo = (e) => encodeURIComponent(e).replace(
|
|
1526
|
+
/%([0-9A-F]{2})/gi,
|
|
1527
|
+
(t, a) => String.fromCharCode(parseInt(a, 16))
|
|
1528
|
+
), Zt = (e) => {
|
|
1529
|
+
if (!l.isString(e))
|
|
1530
|
+
return e;
|
|
1531
|
+
try {
|
|
1532
|
+
return decodeURIComponent(e);
|
|
1533
|
+
} catch {
|
|
1534
|
+
return e;
|
|
1535
|
+
}
|
|
1536
|
+
}, ea = (e, ...t) => {
|
|
1537
|
+
try {
|
|
1538
|
+
return !!e(...t);
|
|
1539
|
+
} catch {
|
|
1540
|
+
return !1;
|
|
1541
|
+
}
|
|
1542
|
+
}, jo = (e) => {
|
|
1543
|
+
const t = e.indexOf("://");
|
|
1544
|
+
let a = e;
|
|
1545
|
+
return t !== -1 && (a = a.slice(t + 3)), a.includes("@") || a.includes(":");
|
|
1546
|
+
}, zo = (e) => {
|
|
1547
|
+
const t = l.global !== void 0 && l.global !== null ? l.global : globalThis, { ReadableStream: a, TextEncoder: n } = t;
|
|
1548
|
+
e = l.merge.call(
|
|
1549
|
+
{
|
|
1550
|
+
skipUndefined: !0
|
|
1551
|
+
},
|
|
1552
|
+
{
|
|
1553
|
+
Request: t.Request,
|
|
1554
|
+
Response: t.Response
|
|
1555
|
+
},
|
|
1556
|
+
e
|
|
1557
|
+
);
|
|
1558
|
+
const { fetch: o, Request: r, Response: i } = e, s = o ? Ke(o) : typeof fetch == "function", u = Ke(r), d = Ke(i);
|
|
1559
|
+
if (!s)
|
|
1560
|
+
return !1;
|
|
1561
|
+
const c = s && Ke(a), f = s && (typeof n == "function" ? ((p) => (h) => p.encode(h))(new n()) : async (p) => new Uint8Array(await new r(p).arrayBuffer())), v = u && c && ea(() => {
|
|
1562
|
+
let p = !1;
|
|
1563
|
+
const h = new r(ee.origin, {
|
|
1564
|
+
body: new a(),
|
|
1565
|
+
method: "POST",
|
|
1566
|
+
get duplex() {
|
|
1567
|
+
return p = !0, "half";
|
|
1568
|
+
}
|
|
1569
|
+
}), A = h.headers.has("Content-Type");
|
|
1570
|
+
return h.body != null && h.body.cancel(), p && !A;
|
|
1571
|
+
}), F = d && c && ea(() => l.isReadableStream(new i("").body)), P = {
|
|
1572
|
+
stream: F && ((p) => p.body)
|
|
1573
|
+
};
|
|
1574
|
+
s && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((p) => {
|
|
1575
|
+
!P[p] && (P[p] = (h, A) => {
|
|
1576
|
+
let D = h && h[p];
|
|
1577
|
+
if (D)
|
|
1578
|
+
return D.call(h);
|
|
1579
|
+
throw new C(
|
|
1580
|
+
`Response type '${p}' is not supported`,
|
|
1581
|
+
C.ERR_NOT_SUPPORT,
|
|
1582
|
+
A
|
|
1583
|
+
);
|
|
1584
|
+
});
|
|
1585
|
+
});
|
|
1586
|
+
const S = async (p) => {
|
|
1587
|
+
if (p == null)
|
|
1588
|
+
return 0;
|
|
1589
|
+
if (l.isBlob(p))
|
|
1590
|
+
return p.size;
|
|
1591
|
+
if (l.isSpecCompliantForm(p))
|
|
1592
|
+
return (await new r(ee.origin, {
|
|
1593
|
+
method: "POST",
|
|
1594
|
+
body: p
|
|
1595
|
+
}).arrayBuffer()).byteLength;
|
|
1596
|
+
if (l.isArrayBufferView(p) || l.isArrayBuffer(p))
|
|
1597
|
+
return p.byteLength;
|
|
1598
|
+
if (l.isURLSearchParams(p) && (p = p + ""), l.isString(p))
|
|
1599
|
+
return (await f(p)).byteLength;
|
|
1600
|
+
}, O = async (p, h) => l.toFiniteNumber(p.getContentLength()) ?? S(h);
|
|
1601
|
+
return async (p) => {
|
|
1602
|
+
let {
|
|
1603
|
+
url: h,
|
|
1604
|
+
method: A,
|
|
1605
|
+
data: D,
|
|
1606
|
+
signal: j,
|
|
1607
|
+
cancelToken: X,
|
|
1608
|
+
timeout: E,
|
|
1609
|
+
onDownloadProgress: oe,
|
|
1610
|
+
onUploadProgress: B,
|
|
1611
|
+
responseType: g,
|
|
1612
|
+
headers: _,
|
|
1613
|
+
withCredentials: M = "same-origin",
|
|
1614
|
+
fetchOptions: I,
|
|
1615
|
+
maxContentLength: R,
|
|
1616
|
+
maxBodyLength: T
|
|
1617
|
+
} = Oa(p);
|
|
1618
|
+
const w = l.isNumber(R) && R > -1, Q = l.isNumber(T) && T > -1, ke = (z) => l.hasOwnProp(p, z) ? p[z] : void 0;
|
|
1619
|
+
let Se = o || fetch;
|
|
1620
|
+
g = g ? (g + "").toLowerCase() : "text";
|
|
1621
|
+
let q = _o(
|
|
1622
|
+
[j, X && X.toAbortSignal()],
|
|
1623
|
+
E
|
|
1624
|
+
), $ = null;
|
|
1625
|
+
const de = q && q.unsubscribe && (() => {
|
|
1626
|
+
q.unsubscribe();
|
|
1627
|
+
});
|
|
1628
|
+
let xe, Ne = null;
|
|
1629
|
+
const Lt = () => new C(
|
|
1630
|
+
"Request body larger than maxBodyLength limit",
|
|
1631
|
+
C.ERR_BAD_REQUEST,
|
|
1632
|
+
p,
|
|
1633
|
+
$
|
|
1634
|
+
);
|
|
1635
|
+
try {
|
|
1636
|
+
let z;
|
|
1637
|
+
const ce = ke("auth");
|
|
1638
|
+
if (ce) {
|
|
1639
|
+
const L = l.getSafeProp(ce, "username") || "", ie = l.getSafeProp(ce, "password") || "";
|
|
1640
|
+
z = {
|
|
1641
|
+
username: L,
|
|
1642
|
+
password: ie
|
|
1643
|
+
};
|
|
1644
|
+
}
|
|
1645
|
+
if (jo(h)) {
|
|
1646
|
+
const L = new URL(h, ee.origin);
|
|
1647
|
+
if (!z && (L.username || L.password)) {
|
|
1648
|
+
const ie = Zt(L.username), Pe = Zt(L.password);
|
|
1649
|
+
z = {
|
|
1650
|
+
username: ie,
|
|
1651
|
+
password: Pe
|
|
1652
|
+
};
|
|
1653
|
+
}
|
|
1654
|
+
(L.username || L.password) && (L.username = "", L.password = "", h = L.href);
|
|
1655
|
+
}
|
|
1656
|
+
if (z && (_.delete("authorization"), _.set(
|
|
1657
|
+
"Authorization",
|
|
1658
|
+
"Basic " + btoa(Mo((z.username || "") + ":" + (z.password || "")))
|
|
1659
|
+
)), w && typeof h == "string" && h.startsWith("data:") && Uo(h) > R)
|
|
1660
|
+
throw new C(
|
|
1661
|
+
"maxContentLength size of " + R + " exceeded",
|
|
1662
|
+
C.ERR_BAD_RESPONSE,
|
|
1663
|
+
p,
|
|
1664
|
+
$
|
|
1665
|
+
);
|
|
1666
|
+
if (Q && A !== "get" && A !== "head") {
|
|
1667
|
+
const L = await S(D);
|
|
1668
|
+
if (typeof L == "number" && isFinite(L) && (xe = L, L > T))
|
|
1669
|
+
throw Lt();
|
|
1670
|
+
}
|
|
1671
|
+
const Je = Q && (l.isReadableStream(D) || l.isStream(D)), Nt = (L, ie, Pe) => Qt(
|
|
1672
|
+
L,
|
|
1673
|
+
Yt,
|
|
1674
|
+
(Ee) => {
|
|
1675
|
+
if (Q && Ee > T)
|
|
1676
|
+
throw Ne = Lt();
|
|
1677
|
+
ie && ie(Ee);
|
|
1678
|
+
},
|
|
1679
|
+
Pe
|
|
1680
|
+
);
|
|
1681
|
+
if (v && A !== "get" && A !== "head" && (B || Je)) {
|
|
1682
|
+
if (xe = xe ?? await O(_, D), xe !== 0 || Je) {
|
|
1683
|
+
let L = new r(h, {
|
|
1684
|
+
method: "POST",
|
|
1685
|
+
body: D,
|
|
1686
|
+
duplex: "half"
|
|
1687
|
+
}), ie;
|
|
1688
|
+
if (l.isFormData(D) && (ie = L.headers.get("content-type")) && _.setContentType(ie), L.body) {
|
|
1689
|
+
const [Pe, Ee] = B && Ht(
|
|
1690
|
+
xe,
|
|
1691
|
+
at(Jt(B))
|
|
1692
|
+
) || [];
|
|
1693
|
+
D = Nt(L.body, Pe, Ee);
|
|
1694
|
+
}
|
|
1695
|
+
}
|
|
1696
|
+
} else if (Je && !u && c && A !== "get" && A !== "head")
|
|
1697
|
+
D = Nt(D);
|
|
1698
|
+
else if (Je && u && !v && A !== "get" && A !== "head")
|
|
1699
|
+
throw new C(
|
|
1700
|
+
"Stream request bodies are not supported by the current fetch implementation",
|
|
1701
|
+
C.ERR_NOT_SUPPORT,
|
|
1702
|
+
p,
|
|
1703
|
+
$
|
|
1704
|
+
);
|
|
1705
|
+
l.isString(M) || (M = M ? "include" : "omit");
|
|
1706
|
+
const Ma = u && "credentials" in r.prototype;
|
|
1707
|
+
if (l.isFormData(D)) {
|
|
1708
|
+
const L = _.getContentType();
|
|
1709
|
+
L && /^multipart\/form-data/i.test(L) && !/boundary=/i.test(L) && _.delete("content-type");
|
|
1710
|
+
}
|
|
1711
|
+
_.set("User-Agent", "axios/" + Rt, !1);
|
|
1712
|
+
const Ut = {
|
|
1713
|
+
...I,
|
|
1714
|
+
signal: q,
|
|
1715
|
+
method: A.toUpperCase(),
|
|
1716
|
+
headers: ya(_.normalize()),
|
|
1717
|
+
body: D,
|
|
1718
|
+
duplex: "half",
|
|
1719
|
+
credentials: Ma ? M : void 0
|
|
1720
|
+
};
|
|
1721
|
+
$ = u && new r(h, Ut);
|
|
1722
|
+
let ye = await (u ? Se($, I) : Se(h, Ut));
|
|
1723
|
+
const Mt = le.from(ye.headers);
|
|
1724
|
+
if (w) {
|
|
1725
|
+
const L = l.toFiniteNumber(Mt.getContentLength());
|
|
1726
|
+
if (L != null && L > R)
|
|
1727
|
+
throw new C(
|
|
1728
|
+
"maxContentLength size of " + R + " exceeded",
|
|
1729
|
+
C.ERR_BAD_RESPONSE,
|
|
1730
|
+
p,
|
|
1731
|
+
$
|
|
1732
|
+
);
|
|
1733
|
+
}
|
|
1734
|
+
const ut = F && (g === "stream" || g === "response");
|
|
1735
|
+
if (F && ye.body && (oe || w || ut && de)) {
|
|
1736
|
+
const L = {};
|
|
1737
|
+
["status", "statusText", "headers"].forEach((Ue) => {
|
|
1738
|
+
L[Ue] = ye[Ue];
|
|
1739
|
+
});
|
|
1740
|
+
const ie = l.toFiniteNumber(Mt.getContentLength()), [Pe, Ee] = oe && Ht(
|
|
1741
|
+
ie,
|
|
1742
|
+
at(Jt(oe), !0)
|
|
1743
|
+
) || [];
|
|
1744
|
+
let jt = 0;
|
|
1745
|
+
const ja = (Ue) => {
|
|
1746
|
+
if (w && (jt = Ue, jt > R))
|
|
1747
|
+
throw new C(
|
|
1748
|
+
"maxContentLength size of " + R + " exceeded",
|
|
1749
|
+
C.ERR_BAD_RESPONSE,
|
|
1750
|
+
p,
|
|
1751
|
+
$
|
|
1752
|
+
);
|
|
1753
|
+
Pe && Pe(Ue);
|
|
1754
|
+
};
|
|
1755
|
+
ye = new i(
|
|
1756
|
+
Qt(ye.body, Yt, ja, () => {
|
|
1757
|
+
Ee && Ee(), de && de();
|
|
1758
|
+
}),
|
|
1759
|
+
L
|
|
1760
|
+
);
|
|
1761
|
+
}
|
|
1762
|
+
g = g || "text";
|
|
1763
|
+
let ve = await P[l.findKey(P, g) || "text"](
|
|
1764
|
+
ye,
|
|
1765
|
+
p
|
|
1766
|
+
);
|
|
1767
|
+
if (w && !F && !ut) {
|
|
1768
|
+
let L;
|
|
1769
|
+
if (ve != null && (typeof ve.byteLength == "number" ? L = ve.byteLength : typeof ve.size == "number" ? L = ve.size : typeof ve == "string" && (L = typeof n == "function" ? new n().encode(ve).byteLength : ve.length)), typeof L == "number" && L > R)
|
|
1770
|
+
throw new C(
|
|
1771
|
+
"maxContentLength size of " + R + " exceeded",
|
|
1772
|
+
C.ERR_BAD_RESPONSE,
|
|
1773
|
+
p,
|
|
1774
|
+
$
|
|
1775
|
+
);
|
|
1776
|
+
}
|
|
1777
|
+
return !ut && de && de(), await new Promise((L, ie) => {
|
|
1778
|
+
Ea(L, ie, {
|
|
1779
|
+
data: ve,
|
|
1780
|
+
headers: le.from(ye.headers),
|
|
1781
|
+
status: ye.status,
|
|
1782
|
+
statusText: ye.statusText,
|
|
1783
|
+
config: p,
|
|
1784
|
+
request: $
|
|
1785
|
+
});
|
|
1786
|
+
});
|
|
1787
|
+
} catch (z) {
|
|
1788
|
+
if (de && de(), q && q.aborted && q.reason instanceof C) {
|
|
1789
|
+
const ce = q.reason;
|
|
1790
|
+
throw ce.config = p, $ && (ce.request = $), z !== ce && Object.defineProperty(ce, "cause", {
|
|
1791
|
+
__proto__: null,
|
|
1792
|
+
value: z,
|
|
1793
|
+
writable: !0,
|
|
1794
|
+
enumerable: !1,
|
|
1795
|
+
configurable: !0
|
|
1796
|
+
}), ce;
|
|
1797
|
+
}
|
|
1798
|
+
if (Ne)
|
|
1799
|
+
throw $ && !Ne.request && (Ne.request = $), Ne;
|
|
1800
|
+
if (z instanceof C)
|
|
1801
|
+
throw $ && !z.request && (z.request = $), z;
|
|
1802
|
+
if (z && z.name === "TypeError" && /Load failed|fetch/i.test(z.message)) {
|
|
1803
|
+
const ce = new C(
|
|
1804
|
+
"Network Error",
|
|
1805
|
+
C.ERR_NETWORK,
|
|
1806
|
+
p,
|
|
1807
|
+
$,
|
|
1808
|
+
z && z.response
|
|
1809
|
+
);
|
|
1810
|
+
throw Object.defineProperty(ce, "cause", {
|
|
1811
|
+
__proto__: null,
|
|
1812
|
+
value: z.cause || z,
|
|
1813
|
+
writable: !0,
|
|
1814
|
+
enumerable: !1,
|
|
1815
|
+
configurable: !0
|
|
1816
|
+
}), ce;
|
|
1817
|
+
}
|
|
1818
|
+
throw C.from(z, z && z.code, p, $, z && z.response);
|
|
1819
|
+
}
|
|
1820
|
+
};
|
|
1821
|
+
}, Vo = /* @__PURE__ */ new Map(), Ra = (e) => {
|
|
1822
|
+
let t = e && e.env || {};
|
|
1823
|
+
const { fetch: a, Request: n, Response: o } = t, r = [n, o, a];
|
|
1824
|
+
let i = r.length, s = i, u, d, c = Vo;
|
|
1825
|
+
for (; s--; )
|
|
1826
|
+
u = r[s], d = c.get(u), d === void 0 && c.set(u, d = s ? /* @__PURE__ */ new Map() : zo(t)), c = d;
|
|
1827
|
+
return d;
|
|
1828
|
+
};
|
|
1829
|
+
Ra();
|
|
1830
|
+
const At = {
|
|
1831
|
+
http: Qn,
|
|
1832
|
+
xhr: Bo,
|
|
1833
|
+
fetch: {
|
|
1834
|
+
get: Ra
|
|
1835
|
+
}
|
|
1836
|
+
};
|
|
1837
|
+
l.forEach(At, (e, t) => {
|
|
1838
|
+
if (e) {
|
|
1839
|
+
try {
|
|
1840
|
+
Object.defineProperty(e, "name", { __proto__: null, value: t });
|
|
1841
|
+
} catch {
|
|
1842
|
+
}
|
|
1843
|
+
Object.defineProperty(e, "adapterName", { __proto__: null, value: t });
|
|
1844
|
+
}
|
|
1845
|
+
});
|
|
1846
|
+
const ta = (e) => `- ${e}`, qo = (e) => l.isFunction(e) || e === null || e === !1;
|
|
1847
|
+
function $o(e, t) {
|
|
1848
|
+
e = l.isArray(e) ? e : [e];
|
|
1849
|
+
const { length: a } = e;
|
|
1850
|
+
let n, o;
|
|
1851
|
+
const r = {};
|
|
1852
|
+
for (let i = 0; i < a; i++) {
|
|
1853
|
+
n = e[i];
|
|
1854
|
+
let s;
|
|
1855
|
+
if (o = n, !qo(n) && (o = At[(s = String(n)).toLowerCase()], o === void 0))
|
|
1856
|
+
throw new C(`Unknown adapter '${s}'`);
|
|
1857
|
+
if (o && (l.isFunction(o) || (o = o.get(t))))
|
|
1858
|
+
break;
|
|
1859
|
+
r[s || "#" + i] = o;
|
|
1860
|
+
}
|
|
1861
|
+
if (!o) {
|
|
1862
|
+
const i = Object.entries(r).map(
|
|
1863
|
+
([u, d]) => `adapter ${u} ` + (d === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
1864
|
+
);
|
|
1865
|
+
let s = a ? i.length > 1 ? `since :
|
|
1866
|
+
` + i.map(ta).join(`
|
|
1867
|
+
`) : " " + ta(i[0]) : "as no adapter specified";
|
|
1868
|
+
throw new C(
|
|
1869
|
+
"There is no suitable adapter to dispatch the request " + s,
|
|
1870
|
+
C.ERR_NOT_SUPPORT
|
|
1871
|
+
);
|
|
1872
|
+
}
|
|
1873
|
+
return o;
|
|
1874
|
+
}
|
|
1875
|
+
const Aa = {
|
|
1876
|
+
/**
|
|
1877
|
+
* Resolve an adapter from a list of adapter names or functions.
|
|
1878
|
+
* @type {Function}
|
|
1879
|
+
*/
|
|
1880
|
+
getAdapter: $o,
|
|
1881
|
+
/**
|
|
1882
|
+
* Exposes all known adapters
|
|
1883
|
+
* @type {Object<string, Function|Object>}
|
|
1884
|
+
*/
|
|
1885
|
+
adapters: At
|
|
1886
|
+
};
|
|
1887
|
+
function mt(e) {
|
|
1888
|
+
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
1889
|
+
throw new We(null, e);
|
|
1890
|
+
}
|
|
1891
|
+
function aa(e) {
|
|
1892
|
+
return mt(e), e.headers = le.from(e.headers), e.data = ft.call(e, e.transformRequest), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), Aa.getAdapter(e.adapter || Ot.adapter, e)(e).then(
|
|
1893
|
+
function(t) {
|
|
1894
|
+
mt(e), e.response = t;
|
|
1895
|
+
try {
|
|
1896
|
+
t.data = ft.call(e, e.transformResponse, t);
|
|
1897
|
+
} finally {
|
|
1898
|
+
delete e.response;
|
|
1899
|
+
}
|
|
1900
|
+
return t.headers = le.from(t.headers), t;
|
|
1901
|
+
},
|
|
1902
|
+
function(t) {
|
|
1903
|
+
if (!Sa(t) && (mt(e), t && t.response)) {
|
|
1904
|
+
e.response = t.response;
|
|
1905
|
+
try {
|
|
1906
|
+
t.response.data = ft.call(
|
|
1907
|
+
e,
|
|
1908
|
+
e.transformResponse,
|
|
1909
|
+
t.response
|
|
1910
|
+
);
|
|
1911
|
+
} finally {
|
|
1912
|
+
delete e.response;
|
|
1913
|
+
}
|
|
1914
|
+
t.response.headers = le.from(t.response.headers);
|
|
1915
|
+
}
|
|
1916
|
+
return Promise.reject(t);
|
|
1917
|
+
}
|
|
1918
|
+
);
|
|
1919
|
+
}
|
|
1920
|
+
const lt = {};
|
|
1921
|
+
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
|
|
1922
|
+
lt[e] = function(a) {
|
|
1923
|
+
return typeof a === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
1924
|
+
};
|
|
1925
|
+
});
|
|
1926
|
+
const na = {};
|
|
1927
|
+
lt.transitional = function(e, t, a) {
|
|
1928
|
+
function n(o, r) {
|
|
1929
|
+
return "[Axios v" + Rt + "] Transitional option '" + o + "'" + r + (a ? ". " + a : "");
|
|
1930
|
+
}
|
|
1931
|
+
return (o, r, i) => {
|
|
1932
|
+
if (e === !1)
|
|
1933
|
+
throw new C(
|
|
1934
|
+
n(r, " has been removed" + (t ? " in " + t : "")),
|
|
1935
|
+
C.ERR_DEPRECATED
|
|
1936
|
+
);
|
|
1937
|
+
return t && !na[r] && (na[r] = !0, console.warn(
|
|
1938
|
+
n(
|
|
1939
|
+
r,
|
|
1940
|
+
" has been deprecated since v" + t + " and will be removed in the near future"
|
|
1941
|
+
)
|
|
1942
|
+
)), e ? e(o, r, i) : !0;
|
|
1943
|
+
};
|
|
1944
|
+
};
|
|
1945
|
+
lt.spelling = function(e) {
|
|
1946
|
+
return (t, a) => (console.warn(`${a} is likely a misspelling of ${e}`), !0);
|
|
1947
|
+
};
|
|
1948
|
+
function Wo(e, t, a) {
|
|
1949
|
+
if (typeof e != "object" || e === null)
|
|
1950
|
+
throw new C("options must be an object", C.ERR_BAD_OPTION_VALUE);
|
|
1951
|
+
const n = Object.keys(e);
|
|
1952
|
+
let o = n.length;
|
|
1953
|
+
for (; o-- > 0; ) {
|
|
1954
|
+
const r = n[o], i = Object.prototype.hasOwnProperty.call(t, r) ? t[r] : void 0;
|
|
1955
|
+
if (i) {
|
|
1956
|
+
const s = e[r], u = s === void 0 || i(s, r, e);
|
|
1957
|
+
if (u !== !0)
|
|
1958
|
+
throw new C(
|
|
1959
|
+
"option " + r + " must be " + u,
|
|
1960
|
+
C.ERR_BAD_OPTION_VALUE
|
|
1961
|
+
);
|
|
1962
|
+
continue;
|
|
1963
|
+
}
|
|
1964
|
+
if (a !== !0)
|
|
1965
|
+
throw new C("Unknown option " + r, C.ERR_BAD_OPTION);
|
|
1966
|
+
}
|
|
1967
|
+
}
|
|
1968
|
+
const Ye = {
|
|
1969
|
+
assertOptions: Wo,
|
|
1970
|
+
validators: lt
|
|
1971
|
+
}, ae = Ye.validators;
|
|
1972
|
+
class ot {
|
|
1973
|
+
constructor(t) {
|
|
1974
|
+
this.defaults = t || {}, this.interceptors = {
|
|
1975
|
+
request: new Wt(),
|
|
1976
|
+
response: new Wt()
|
|
1977
|
+
};
|
|
1978
|
+
}
|
|
1979
|
+
/**
|
|
1980
|
+
* Dispatch a request
|
|
1981
|
+
*
|
|
1982
|
+
* @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
|
|
1983
|
+
* @param {?Object} config
|
|
1984
|
+
*
|
|
1985
|
+
* @returns {Promise} The Promise to be fulfilled
|
|
1986
|
+
*/
|
|
1987
|
+
async request(t, a) {
|
|
1988
|
+
try {
|
|
1989
|
+
return await this._request(t, a);
|
|
1990
|
+
} catch (n) {
|
|
1991
|
+
if (n instanceof Error) {
|
|
1992
|
+
let o = {};
|
|
1993
|
+
Error.captureStackTrace ? Error.captureStackTrace(o) : o = new Error();
|
|
1994
|
+
const r = (() => {
|
|
1995
|
+
if (!o.stack)
|
|
1996
|
+
return "";
|
|
1997
|
+
const i = o.stack.indexOf(`
|
|
1998
|
+
`);
|
|
1999
|
+
return i === -1 ? "" : o.stack.slice(i + 1);
|
|
2000
|
+
})();
|
|
2001
|
+
try {
|
|
2002
|
+
if (!n.stack)
|
|
2003
|
+
n.stack = r;
|
|
2004
|
+
else if (r) {
|
|
2005
|
+
const i = r.indexOf(`
|
|
2006
|
+
`), s = i === -1 ? -1 : r.indexOf(`
|
|
2007
|
+
`, i + 1), u = s === -1 ? "" : r.slice(s + 1);
|
|
2008
|
+
String(n.stack).endsWith(u) || (n.stack += `
|
|
2009
|
+
` + r);
|
|
2010
|
+
}
|
|
2011
|
+
} catch {
|
|
2012
|
+
}
|
|
2013
|
+
}
|
|
2014
|
+
throw n;
|
|
2015
|
+
}
|
|
2016
|
+
}
|
|
2017
|
+
_request(t, a) {
|
|
2018
|
+
typeof t == "string" ? (a = a || {}, a.url = t) : a = t || {}, a = Ae(this.defaults, a);
|
|
2019
|
+
const { transitional: n, paramsSerializer: o, headers: r } = a;
|
|
2020
|
+
n !== void 0 && Ye.assertOptions(
|
|
2021
|
+
n,
|
|
2022
|
+
{
|
|
2023
|
+
silentJSONParsing: ae.transitional(ae.boolean),
|
|
2024
|
+
forcedJSONParsing: ae.transitional(ae.boolean),
|
|
2025
|
+
clarifyTimeoutError: ae.transitional(ae.boolean),
|
|
2026
|
+
legacyInterceptorReqResOrdering: ae.transitional(ae.boolean),
|
|
2027
|
+
advertiseZstdAcceptEncoding: ae.transitional(ae.boolean),
|
|
2028
|
+
validateStatusUndefinedResolves: ae.transitional(ae.boolean)
|
|
2029
|
+
},
|
|
2030
|
+
!1
|
|
2031
|
+
), o != null && (l.isFunction(o) ? a.paramsSerializer = {
|
|
2032
|
+
serialize: o
|
|
2033
|
+
} : Ye.assertOptions(
|
|
2034
|
+
o,
|
|
2035
|
+
{
|
|
2036
|
+
encode: ae.function,
|
|
2037
|
+
serialize: ae.function
|
|
2038
|
+
},
|
|
2039
|
+
!0
|
|
2040
|
+
)), a.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? a.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : a.allowAbsoluteUrls = !0), Ye.assertOptions(
|
|
2041
|
+
a,
|
|
2042
|
+
{
|
|
2043
|
+
baseUrl: ae.spelling("baseURL"),
|
|
2044
|
+
withXsrfToken: ae.spelling("withXSRFToken")
|
|
2045
|
+
},
|
|
2046
|
+
!0
|
|
2047
|
+
), a.method = (a.method || this.defaults.method || "get").toLowerCase();
|
|
2048
|
+
let i = r && l.merge(r.common, r[a.method]);
|
|
2049
|
+
r && l.forEach(["delete", "get", "head", "post", "put", "patch", "query", "common"], (P) => {
|
|
2050
|
+
delete r[P];
|
|
2051
|
+
}), a.headers = le.concat(i, r);
|
|
2052
|
+
const s = [];
|
|
2053
|
+
let u = !0;
|
|
2054
|
+
this.interceptors.request.forEach(function(P) {
|
|
2055
|
+
if (typeof P.runWhen == "function" && P.runWhen(a) === !1)
|
|
2056
|
+
return;
|
|
2057
|
+
u = u && P.synchronous;
|
|
2058
|
+
const S = a.transitional || St;
|
|
2059
|
+
S && S.legacyInterceptorReqResOrdering ? s.unshift(P.fulfilled, P.rejected) : s.push(P.fulfilled, P.rejected);
|
|
2060
|
+
});
|
|
2061
|
+
const d = [];
|
|
2062
|
+
this.interceptors.response.forEach(function(P) {
|
|
2063
|
+
d.push(P.fulfilled, P.rejected);
|
|
2064
|
+
});
|
|
2065
|
+
let c, f = 0, v;
|
|
2066
|
+
if (!u) {
|
|
2067
|
+
const P = [aa.bind(this), void 0];
|
|
2068
|
+
for (P.unshift(...s), P.push(...d), v = P.length, c = Promise.resolve(a); f < v; )
|
|
2069
|
+
c = c.then(P[f++], P[f++]);
|
|
2070
|
+
return c;
|
|
2071
|
+
}
|
|
2072
|
+
v = s.length;
|
|
2073
|
+
let F = a;
|
|
2074
|
+
for (; f < v; ) {
|
|
2075
|
+
const P = s[f++], S = s[f++];
|
|
2076
|
+
try {
|
|
2077
|
+
F = P(F);
|
|
2078
|
+
} catch (O) {
|
|
2079
|
+
S.call(this, O);
|
|
2080
|
+
break;
|
|
2081
|
+
}
|
|
2082
|
+
}
|
|
2083
|
+
try {
|
|
2084
|
+
c = aa.call(this, F);
|
|
2085
|
+
} catch (P) {
|
|
2086
|
+
return Promise.reject(P);
|
|
2087
|
+
}
|
|
2088
|
+
for (f = 0, v = d.length; f < v; )
|
|
2089
|
+
c = c.then(d[f++], d[f++]);
|
|
2090
|
+
return c;
|
|
2091
|
+
}
|
|
2092
|
+
getUri(t) {
|
|
2093
|
+
t = Ae(this.defaults, t);
|
|
2094
|
+
const a = Ca(t.baseURL, t.url, t.allowAbsoluteUrls, t);
|
|
2095
|
+
return xa(a, t.params, t.paramsSerializer);
|
|
2096
|
+
}
|
|
2097
|
+
}
|
|
2098
|
+
l.forEach(["delete", "get", "head", "options"], function(e) {
|
|
2099
|
+
ot.prototype[e] = function(t, a) {
|
|
2100
|
+
return this.request(
|
|
2101
|
+
Ae(a || {}, {
|
|
2102
|
+
method: e,
|
|
2103
|
+
url: t,
|
|
2104
|
+
data: a && l.hasOwnProp(a, "data") ? a.data : void 0
|
|
2105
|
+
})
|
|
2106
|
+
);
|
|
2107
|
+
};
|
|
2108
|
+
});
|
|
2109
|
+
l.forEach(["post", "put", "patch", "query"], function(e) {
|
|
2110
|
+
function t(a) {
|
|
2111
|
+
return function(n, o, r) {
|
|
2112
|
+
return this.request(
|
|
2113
|
+
Ae(r || {}, {
|
|
2114
|
+
method: e,
|
|
2115
|
+
headers: a ? {
|
|
2116
|
+
"Content-Type": "multipart/form-data"
|
|
2117
|
+
} : {},
|
|
2118
|
+
url: n,
|
|
2119
|
+
data: o
|
|
2120
|
+
})
|
|
2121
|
+
);
|
|
2122
|
+
};
|
|
2123
|
+
}
|
|
2124
|
+
ot.prototype[e] = t(), e !== "query" && (ot.prototype[e + "Form"] = t(!0));
|
|
2125
|
+
});
|
|
2126
|
+
const Ze = ot;
|
|
2127
|
+
class Bt {
|
|
2128
|
+
constructor(t) {
|
|
2129
|
+
if (typeof t != "function")
|
|
2130
|
+
throw new TypeError("executor must be a function.");
|
|
2131
|
+
let a;
|
|
2132
|
+
this.promise = new Promise(function(o) {
|
|
2133
|
+
a = o;
|
|
2134
|
+
});
|
|
2135
|
+
const n = this;
|
|
2136
|
+
this.promise.then((o) => {
|
|
2137
|
+
if (!n._listeners)
|
|
2138
|
+
return;
|
|
2139
|
+
let r = n._listeners.length;
|
|
2140
|
+
for (; r-- > 0; )
|
|
2141
|
+
n._listeners[r](o);
|
|
2142
|
+
n._listeners = null;
|
|
2143
|
+
}), this.promise.then = (o) => {
|
|
2144
|
+
let r;
|
|
2145
|
+
const i = new Promise((s) => {
|
|
2146
|
+
n.subscribe(s), r = s;
|
|
2147
|
+
}).then(o);
|
|
2148
|
+
return i.cancel = function() {
|
|
2149
|
+
n.unsubscribe(r);
|
|
2150
|
+
}, i;
|
|
2151
|
+
}, t(function(o, r, i) {
|
|
2152
|
+
n.reason || (n.reason = new We(o, r, i), a(n.reason));
|
|
2153
|
+
});
|
|
2154
|
+
}
|
|
2155
|
+
/**
|
|
2156
|
+
* Throws a `CanceledError` if cancellation has been requested.
|
|
2157
|
+
*/
|
|
2158
|
+
throwIfRequested() {
|
|
2159
|
+
if (this.reason)
|
|
2160
|
+
throw this.reason;
|
|
2161
|
+
}
|
|
2162
|
+
/**
|
|
2163
|
+
* Subscribe to the cancel signal
|
|
2164
|
+
*/
|
|
2165
|
+
subscribe(t) {
|
|
2166
|
+
if (this.reason) {
|
|
2167
|
+
t(this.reason);
|
|
2168
|
+
return;
|
|
2169
|
+
}
|
|
2170
|
+
this._listeners ? this._listeners.push(t) : this._listeners = [t];
|
|
2171
|
+
}
|
|
2172
|
+
/**
|
|
2173
|
+
* Unsubscribe from the cancel signal
|
|
2174
|
+
*/
|
|
2175
|
+
unsubscribe(t) {
|
|
2176
|
+
if (!this._listeners)
|
|
2177
|
+
return;
|
|
2178
|
+
const a = this._listeners.indexOf(t);
|
|
2179
|
+
a !== -1 && this._listeners.splice(a, 1);
|
|
2180
|
+
}
|
|
2181
|
+
toAbortSignal() {
|
|
2182
|
+
const t = new AbortController(), a = (n) => {
|
|
2183
|
+
t.abort(n);
|
|
2184
|
+
};
|
|
2185
|
+
return this.subscribe(a), t.signal.unsubscribe = () => this.unsubscribe(a), t.signal;
|
|
2186
|
+
}
|
|
2187
|
+
/**
|
|
2188
|
+
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
2189
|
+
* cancels the `CancelToken`.
|
|
2190
|
+
*/
|
|
2191
|
+
static source() {
|
|
2192
|
+
let t;
|
|
2193
|
+
return {
|
|
2194
|
+
token: new Bt(function(a) {
|
|
2195
|
+
t = a;
|
|
2196
|
+
}),
|
|
2197
|
+
cancel: t
|
|
2198
|
+
};
|
|
2199
|
+
}
|
|
2200
|
+
}
|
|
2201
|
+
const Go = Bt;
|
|
2202
|
+
function Ho(e) {
|
|
2203
|
+
return function(t) {
|
|
2204
|
+
return e.apply(null, t);
|
|
2205
|
+
};
|
|
2206
|
+
}
|
|
2207
|
+
function Jo(e) {
|
|
2208
|
+
return l.isObject(e) && e.isAxiosError === !0;
|
|
2209
|
+
}
|
|
2210
|
+
const kt = {
|
|
2211
|
+
Continue: 100,
|
|
2212
|
+
SwitchingProtocols: 101,
|
|
2213
|
+
Processing: 102,
|
|
2214
|
+
EarlyHints: 103,
|
|
2215
|
+
Ok: 200,
|
|
2216
|
+
Created: 201,
|
|
2217
|
+
Accepted: 202,
|
|
2218
|
+
NonAuthoritativeInformation: 203,
|
|
2219
|
+
NoContent: 204,
|
|
2220
|
+
ResetContent: 205,
|
|
2221
|
+
PartialContent: 206,
|
|
2222
|
+
MultiStatus: 207,
|
|
2223
|
+
AlreadyReported: 208,
|
|
2224
|
+
ImUsed: 226,
|
|
2225
|
+
MultipleChoices: 300,
|
|
2226
|
+
MovedPermanently: 301,
|
|
2227
|
+
Found: 302,
|
|
2228
|
+
SeeOther: 303,
|
|
2229
|
+
NotModified: 304,
|
|
2230
|
+
UseProxy: 305,
|
|
2231
|
+
Unused: 306,
|
|
2232
|
+
TemporaryRedirect: 307,
|
|
2233
|
+
PermanentRedirect: 308,
|
|
2234
|
+
BadRequest: 400,
|
|
2235
|
+
Unauthorized: 401,
|
|
2236
|
+
PaymentRequired: 402,
|
|
2237
|
+
Forbidden: 403,
|
|
2238
|
+
NotFound: 404,
|
|
2239
|
+
MethodNotAllowed: 405,
|
|
2240
|
+
NotAcceptable: 406,
|
|
2241
|
+
ProxyAuthenticationRequired: 407,
|
|
2242
|
+
RequestTimeout: 408,
|
|
2243
|
+
Conflict: 409,
|
|
2244
|
+
Gone: 410,
|
|
2245
|
+
LengthRequired: 411,
|
|
2246
|
+
PreconditionFailed: 412,
|
|
2247
|
+
PayloadTooLarge: 413,
|
|
2248
|
+
UriTooLong: 414,
|
|
2249
|
+
UnsupportedMediaType: 415,
|
|
2250
|
+
RangeNotSatisfiable: 416,
|
|
2251
|
+
ExpectationFailed: 417,
|
|
2252
|
+
ImATeapot: 418,
|
|
2253
|
+
MisdirectedRequest: 421,
|
|
2254
|
+
UnprocessableEntity: 422,
|
|
2255
|
+
Locked: 423,
|
|
2256
|
+
FailedDependency: 424,
|
|
2257
|
+
TooEarly: 425,
|
|
2258
|
+
UpgradeRequired: 426,
|
|
2259
|
+
PreconditionRequired: 428,
|
|
2260
|
+
TooManyRequests: 429,
|
|
2261
|
+
RequestHeaderFieldsTooLarge: 431,
|
|
2262
|
+
UnavailableForLegalReasons: 451,
|
|
2263
|
+
InternalServerError: 500,
|
|
2264
|
+
NotImplemented: 501,
|
|
2265
|
+
BadGateway: 502,
|
|
2266
|
+
ServiceUnavailable: 503,
|
|
2267
|
+
GatewayTimeout: 504,
|
|
2268
|
+
HttpVersionNotSupported: 505,
|
|
2269
|
+
VariantAlsoNegotiates: 506,
|
|
2270
|
+
InsufficientStorage: 507,
|
|
2271
|
+
LoopDetected: 508,
|
|
2272
|
+
NotExtended: 510,
|
|
2273
|
+
NetworkAuthenticationRequired: 511,
|
|
2274
|
+
WebServerIsDown: 521,
|
|
2275
|
+
ConnectionTimedOut: 522,
|
|
2276
|
+
OriginIsUnreachable: 523,
|
|
2277
|
+
TimeoutOccurred: 524,
|
|
2278
|
+
SslHandshakeFailed: 525,
|
|
2279
|
+
InvalidSslCertificate: 526
|
|
2280
|
+
};
|
|
2281
|
+
Object.entries(kt).forEach(([e, t]) => {
|
|
2282
|
+
kt[t] = e;
|
|
2283
|
+
});
|
|
2284
|
+
const Ko = kt;
|
|
2285
|
+
function Ba(e) {
|
|
2286
|
+
const t = new Ze(e), a = ua(Ze.prototype.request, t);
|
|
2287
|
+
return l.extend(a, Ze.prototype, t, { allOwnKeys: !0 }), l.extend(a, t, null, { allOwnKeys: !0 }), a.create = function(n) {
|
|
2288
|
+
return Ba(Ae(e, n));
|
|
2289
|
+
}, a;
|
|
2290
|
+
}
|
|
2291
|
+
const K = Ba(Ot);
|
|
2292
|
+
K.Axios = Ze;
|
|
2293
|
+
K.CanceledError = We;
|
|
2294
|
+
K.CancelToken = Go;
|
|
2295
|
+
K.isCancel = Sa;
|
|
2296
|
+
K.VERSION = Rt;
|
|
2297
|
+
K.toFormData = st;
|
|
2298
|
+
K.AxiosError = C;
|
|
2299
|
+
K.Cancel = K.CanceledError;
|
|
2300
|
+
K.all = function(e) {
|
|
2301
|
+
return Promise.all(e);
|
|
2302
|
+
};
|
|
2303
|
+
K.spread = Ho;
|
|
2304
|
+
K.isAxiosError = Jo;
|
|
2305
|
+
K.mergeConfig = Ae;
|
|
2306
|
+
K.AxiosHeaders = le;
|
|
2307
|
+
K.formToJSON = (e) => Ta(l.isHTMLForm(e) ? new FormData(e) : e);
|
|
2308
|
+
K.getAdapter = Aa.getAdapter;
|
|
2309
|
+
K.HttpStatusCode = Ko;
|
|
2310
|
+
K.default = K;
|
|
2311
|
+
const Xo = K;
|
|
2312
|
+
function Qo(e, t) {
|
|
2313
|
+
const a = t && t.toUpperCase() !== "MY" ? `.${t.toLowerCase()}` : "";
|
|
2314
|
+
return `https://portal-v2${e === "dev" ? "-dev" : ""}${a}.feedmeapi.com`;
|
|
2315
|
+
}
|
|
2316
|
+
function Yo(e, t) {
|
|
2317
|
+
return Qo(e, t);
|
|
2318
|
+
}
|
|
2319
|
+
const Dt = ["1x1", "4x3", "16x9", "9x16"];
|
|
2320
|
+
function Be(e) {
|
|
2321
|
+
return e.replace("x", ":");
|
|
2322
|
+
}
|
|
2323
|
+
const je = "asset";
|
|
2324
|
+
function Zo(e) {
|
|
2325
|
+
return e.some((t) => t.status === "pending");
|
|
2326
|
+
}
|
|
2327
|
+
function er(e) {
|
|
2328
|
+
if (e.length === 0)
|
|
2329
|
+
return null;
|
|
2330
|
+
const t = e.filter((a) => a.status === "active").length;
|
|
2331
|
+
return { tone: e.some((a) => a.status === "pending") ? "progress" : e.some((a) => a.status === "failed") ? "warning" : "done", active: t, total: e.length };
|
|
2332
|
+
}
|
|
2333
|
+
function Da(e, t) {
|
|
2334
|
+
return [
|
|
2335
|
+
{ key: "original", kind: "original", ratio: null, url: e.url, status: null },
|
|
2336
|
+
...t.map((a) => ({
|
|
2337
|
+
key: a.aspectRatio,
|
|
2338
|
+
kind: "variant",
|
|
2339
|
+
ratio: a.aspectRatio,
|
|
2340
|
+
url: a.status === "failed" ? null : a.url,
|
|
2341
|
+
status: a.status,
|
|
2342
|
+
failureCode: a.failureCode
|
|
2343
|
+
}))
|
|
2344
|
+
];
|
|
2345
|
+
}
|
|
2346
|
+
function _a(e) {
|
|
2347
|
+
return e.kind ?? "image";
|
|
2348
|
+
}
|
|
2349
|
+
function Te(e) {
|
|
2350
|
+
return _a(e) === "video";
|
|
2351
|
+
}
|
|
2352
|
+
function Fa(e) {
|
|
2353
|
+
return e.hasPoster && e.posterUrl ? e.posterUrl : null;
|
|
2354
|
+
}
|
|
2355
|
+
function ze(e) {
|
|
2356
|
+
return e.width > 0 && e.height > 0 ? `${e.width}×${e.height}` : null;
|
|
2357
|
+
}
|
|
2358
|
+
function tr(e) {
|
|
2359
|
+
return e.kind === "video" && e.refType && e.refId ? {
|
|
2360
|
+
kind: "video",
|
|
2361
|
+
entry: {
|
|
2362
|
+
refType: e.refType,
|
|
2363
|
+
refId: e.refId,
|
|
2364
|
+
// The video's id sits in imageId on the wire: the two flows share the asset
|
|
2365
|
+
// document's field, since the segment means the same thing in both keys.
|
|
2366
|
+
videoId: e.imageId ?? "main"
|
|
2367
|
+
}
|
|
2368
|
+
} : e.refType && e.refId ? {
|
|
2369
|
+
kind: "image",
|
|
2370
|
+
entry: {
|
|
2371
|
+
refType: e.refType,
|
|
2372
|
+
refId: e.refId,
|
|
2373
|
+
imageId: e.imageId ?? "main",
|
|
2374
|
+
// null, not []: null deletes the whole set including the original, which is what
|
|
2375
|
+
// deleting an asset means. [] is rejected by the server.
|
|
2376
|
+
aspectRatios: null
|
|
2377
|
+
}
|
|
2378
|
+
} : { kind: "asset", id: e.id };
|
|
2379
|
+
}
|
|
2380
|
+
function ar(e, t, a) {
|
|
2381
|
+
if (e.kind === "original" || e.ratio === null)
|
|
2382
|
+
return {
|
|
2383
|
+
ratio: null,
|
|
2384
|
+
// Null rather than "0×0" for a video whose uploader could not decode it. The panel
|
|
2385
|
+
// already renders a dash for null, and its own rule is that absent data is
|
|
2386
|
+
// recoverable while wrong data that looks right is not.
|
|
2387
|
+
dimensions: ze(t),
|
|
2388
|
+
sizeBytes: t.fileSizeBytes,
|
|
2389
|
+
contentType: t.mimeType,
|
|
2390
|
+
url: t.url
|
|
2391
|
+
};
|
|
2392
|
+
const n = a.find((o) => o.aspectRatio === e.ratio);
|
|
2393
|
+
return {
|
|
2394
|
+
ratio: e.ratio,
|
|
2395
|
+
dimensions: n != null && n.width && n != null && n.height ? `${n.width}×${n.height}` : null,
|
|
2396
|
+
sizeBytes: (n == null ? void 0 : n.fileSizeBytes) ?? null,
|
|
2397
|
+
contentType: (n == null ? void 0 : n.contentType) ?? null,
|
|
2398
|
+
// Falling back to the asset's url here would reintroduce the copy-link bug, so a
|
|
2399
|
+
// missing variant keeps its derivable address rather than borrowing the original's.
|
|
2400
|
+
url: (n == null ? void 0 : n.url) ?? `${t.url}?aspect_ratio=${e.ratio}`
|
|
2401
|
+
};
|
|
2402
|
+
}
|
|
2403
|
+
function gt(e, t, a) {
|
|
2404
|
+
if (t === null)
|
|
2405
|
+
return { asset: e, ratio: null, url: e.url, kind: _a(e) };
|
|
2406
|
+
if (Te(e))
|
|
2407
|
+
return null;
|
|
2408
|
+
const n = a.find((o) => o.aspectRatio === t);
|
|
2409
|
+
return !n || n.status !== "active" ? null : { asset: e, ratio: t, url: n.url, kind: "image" };
|
|
2410
|
+
}
|
|
2411
|
+
function nr(e) {
|
|
2412
|
+
return e >= 1024 * 1024 ? `${(e / 1024 / 1024).toFixed(1)} MB` : `${Math.round(e / 1024)} KB`;
|
|
2413
|
+
}
|
|
2414
|
+
const Ia = "ai-draft";
|
|
2415
|
+
function or() {
|
|
2416
|
+
var e;
|
|
2417
|
+
const { sessionUser: t, namespace: a, currentCountry: n } = $a(), o = (e = t.value) == null ? void 0 : e.token;
|
|
2418
|
+
return Xo.create({
|
|
2419
|
+
baseURL: Yo(a.value, n.value),
|
|
2420
|
+
headers: o ? { Authorization: `Bearer ${o}` } : {}
|
|
2421
|
+
});
|
|
2422
|
+
}
|
|
2423
|
+
const ue = or;
|
|
2424
|
+
function Ge(e) {
|
|
2425
|
+
return `/media-v1/businesses/${e}/assets`;
|
|
2426
|
+
}
|
|
2427
|
+
async function rr(e) {
|
|
2428
|
+
const { businessId: t, ...a } = e, { data: n } = await ue().get(Ge(t), { params: a });
|
|
2429
|
+
return n;
|
|
2430
|
+
}
|
|
2431
|
+
async function La(e) {
|
|
2432
|
+
const { data: t } = await ue().get(`${Ge(e)}/tags`, {
|
|
2433
|
+
params: { excludeTags: [Ia] }
|
|
2434
|
+
});
|
|
2435
|
+
return t;
|
|
2436
|
+
}
|
|
2437
|
+
async function ir(e) {
|
|
2438
|
+
const { tags: t } = await La(e);
|
|
2439
|
+
return t.map((a) => a.tag);
|
|
2440
|
+
}
|
|
2441
|
+
async function sr(e, t, a) {
|
|
2442
|
+
const { data: n } = await ue().patch(`${Ge(e)}/${t}`, { fileName: a });
|
|
2443
|
+
return n;
|
|
2444
|
+
}
|
|
2445
|
+
async function lr(e, t, a) {
|
|
2446
|
+
const { data: n } = await ue().patch(`${Ge(e)}/${t}`, { tags: a });
|
|
2447
|
+
return n;
|
|
2448
|
+
}
|
|
2449
|
+
async function ur(e, t) {
|
|
2450
|
+
await ue().delete(`${Ge(e)}/${t}`);
|
|
2451
|
+
}
|
|
2452
|
+
function He(e) {
|
|
2453
|
+
return `/media-v1/businesses/${e}/images`;
|
|
2454
|
+
}
|
|
2455
|
+
async function cr(e, t, a) {
|
|
2456
|
+
const { data: n } = await ue().post(`${He(e)}/create`, t, {
|
|
2457
|
+
headers: a ? { "Idempotency-Key": a } : {}
|
|
2458
|
+
});
|
|
2459
|
+
return n;
|
|
2460
|
+
}
|
|
2461
|
+
async function dr(e, t) {
|
|
2462
|
+
const { data: a } = await ue().post(`${He(e)}/delete`, {
|
|
2463
|
+
entries: t
|
|
2464
|
+
});
|
|
2465
|
+
return a.results;
|
|
2466
|
+
}
|
|
2467
|
+
async function pr(e) {
|
|
2468
|
+
const { businessId: t, refIds: a, ...n } = e, { data: o } = await ue().get(He(t), {
|
|
2469
|
+
params: { ...n, refIds: a.join(",") }
|
|
2470
|
+
});
|
|
2471
|
+
return o.images;
|
|
2472
|
+
}
|
|
2473
|
+
async function fr(e, t) {
|
|
2474
|
+
const { data: a } = await ue().post(`${He(e)}/upload-intent`, t);
|
|
2475
|
+
return a;
|
|
2476
|
+
}
|
|
2477
|
+
async function mr(e, t) {
|
|
2478
|
+
const { data: a } = await ue().post(`${He(e)}/confirm`, t);
|
|
2479
|
+
return a;
|
|
2480
|
+
}
|
|
2481
|
+
function _t(e) {
|
|
2482
|
+
return `/media-v1/businesses/${e}/videos`;
|
|
2483
|
+
}
|
|
2484
|
+
async function gr(e, t) {
|
|
2485
|
+
const { data: a } = await ue().post(`${_t(e)}/upload-intent`, t);
|
|
2486
|
+
return a;
|
|
2487
|
+
}
|
|
2488
|
+
async function hr(e, t) {
|
|
2489
|
+
const { data: a } = await ue().post(`${_t(e)}/confirm`, t);
|
|
2490
|
+
return a;
|
|
2491
|
+
}
|
|
2492
|
+
async function br(e, t) {
|
|
2493
|
+
const { data: a } = await ue().post(`${_t(e)}/delete`, {
|
|
2494
|
+
entries: t
|
|
2495
|
+
});
|
|
2496
|
+
return a.results;
|
|
2497
|
+
}
|
|
2498
|
+
async function yr(e, t) {
|
|
2499
|
+
const a = tr(t);
|
|
2500
|
+
if (a.kind === "video") {
|
|
2501
|
+
await br(e, [a.entry]);
|
|
2502
|
+
return;
|
|
2503
|
+
}
|
|
2504
|
+
if (a.kind === "image") {
|
|
2505
|
+
await dr(e, [a.entry]);
|
|
2506
|
+
return;
|
|
2507
|
+
}
|
|
2508
|
+
await ur(e, a.id);
|
|
2509
|
+
}
|
|
2510
|
+
const pe = "var(--fm-color-brand-primary, #FF7823)", Ft = "#FFF7F0", oa = "40px 56px minmax(160px, 2.2fr) 110px 90px 150px 120px 40px", H = "font-size:11px", ht = "padding:2px 6px", vr = "background:#FFFBEB;border-color:#FCD34D", wr = "color:#B45309", kr = {
|
|
2511
|
+
assetGrid: {
|
|
2512
|
+
loading: "Loading…",
|
|
2513
|
+
empty: "No assets yet",
|
|
2514
|
+
unavailableForRatio: "This image has no {ratio} version yet",
|
|
2515
|
+
columns: {
|
|
2516
|
+
name: "Name",
|
|
2517
|
+
dimensions: "Dimensions",
|
|
2518
|
+
fileSize: "Size",
|
|
2519
|
+
uploader: "Uploaded By",
|
|
2520
|
+
uploadedAt: "Uploaded At"
|
|
2521
|
+
},
|
|
2522
|
+
time: {
|
|
2523
|
+
justNow: "Just now",
|
|
2524
|
+
minutesAgo: "{n} minutes ago",
|
|
2525
|
+
hoursAgo: "{n} hours ago",
|
|
2526
|
+
daysAgo: "{n} days ago"
|
|
2527
|
+
},
|
|
2528
|
+
noPoster: "No preview",
|
|
2529
|
+
videoUnavailableForRatio: "A video cannot be used where a fixed {ratio} ratio is required"
|
|
2530
|
+
},
|
|
2531
|
+
assetPagination: {
|
|
2532
|
+
itemCount: "{start}–{end} of {total}",
|
|
2533
|
+
pageCount: "{total} pages"
|
|
2534
|
+
},
|
|
2535
|
+
assetDetailDialog: {
|
|
2536
|
+
previewTitle: "Preview",
|
|
2537
|
+
saveButton: "Save",
|
|
2538
|
+
dimensionsLabel: "Dimensions",
|
|
2539
|
+
sizeLabel: "Size",
|
|
2540
|
+
formatLabel: "Format",
|
|
2541
|
+
copyLinkButton: "Copy Link",
|
|
2542
|
+
deleteButton: "Delete",
|
|
2543
|
+
deleteDisclaimer: "If any business module is still using this asset, it will show as broken wherever it's referenced after deletion — make sure it's no longer needed.",
|
|
2544
|
+
deleteDialogTitle: "Delete Asset",
|
|
2545
|
+
deleteDialogMessage: 'Delete "{fileName}"? {disclaimer}',
|
|
2546
|
+
deleteConfirmButton: "Delete",
|
|
2547
|
+
cancelButton: "Cancel",
|
|
2548
|
+
durationLabel: "Duration"
|
|
2549
|
+
},
|
|
2550
|
+
tagFilterBar: {
|
|
2551
|
+
all: "All",
|
|
2552
|
+
newTagPlaceholder: "New tag…"
|
|
2553
|
+
},
|
|
2554
|
+
tagFilterTabs: {
|
|
2555
|
+
all: "All"
|
|
2556
|
+
},
|
|
2557
|
+
uploadPanel: {
|
|
2558
|
+
dropLabel: "Drag images or videos here, or click to choose",
|
|
2559
|
+
helperText: "Images JPG/PNG/WEBP up to 10MB · Videos MP4/MOV/WEBM up to 512MB",
|
|
2560
|
+
stagedCount: "Pending · {count}",
|
|
2561
|
+
tagsLabel: "Tags (optional)",
|
|
2562
|
+
suggestedTagsLabel: "Common",
|
|
2563
|
+
uploadFailedError: "Upload failed: {status}",
|
|
2564
|
+
uploading: "Uploading…",
|
|
2565
|
+
videoUndecodableWarning: "This browser could not play the video, so no cover frame was captured. It may not play on POS terminals or in mini-programs either — converting it to MP4 (H.264) is recommended.",
|
|
2566
|
+
videoNoRatiosNote: "Videos have no aspect-ratio versions; the ratio options apply to images only.",
|
|
2567
|
+
fileTooLargeError: "This file is {limit} at most"
|
|
2568
|
+
},
|
|
2569
|
+
pickerModal: {
|
|
2570
|
+
title: "Select Assets",
|
|
2571
|
+
subtitleMultiple: "Select multiple or upload — click an item to toggle selection",
|
|
2572
|
+
subtitleSingle: "Click an item to select it, or switch to Upload New",
|
|
2573
|
+
searchPlaceholder: "Search…",
|
|
2574
|
+
browseTab: "Browse",
|
|
2575
|
+
uploadTab: "Upload New",
|
|
2576
|
+
selectedCount: "{count} selected",
|
|
2577
|
+
selectPrompt: "Select an item",
|
|
2578
|
+
cancelButton: "Cancel",
|
|
2579
|
+
uploadSubmitButton: "Upload {count}",
|
|
2580
|
+
confirmButton: "Confirm"
|
|
2581
|
+
},
|
|
2582
|
+
ratios: {
|
|
2583
|
+
title: "Ratios to generate",
|
|
2584
|
+
hint: "AI expands the canvas — about 40s per ratio"
|
|
2585
|
+
},
|
|
2586
|
+
variants: {
|
|
2587
|
+
badgeDone: "{count} ratios",
|
|
2588
|
+
badgeProgress: "{active}/{total} ratios",
|
|
2589
|
+
original: "Original",
|
|
2590
|
+
generating: "Generating…",
|
|
2591
|
+
failed: "Generation failed",
|
|
2592
|
+
failedNoTokens: "Out of AI tokens. Top up, then generate this size again.",
|
|
2593
|
+
failedTokenServiceDown: "Couldn't check your AI token balance. Try again shortly.",
|
|
2594
|
+
regenerate: "Regenerate"
|
|
2595
|
+
},
|
|
2596
|
+
ratioBar: {
|
|
2597
|
+
label: "Ratio",
|
|
2598
|
+
unavailableForSelection: "The selected image has no {ratio} version yet"
|
|
2599
|
+
}
|
|
2600
|
+
}, xr = {
|
|
2601
|
+
mediaPicker: kr
|
|
2602
|
+
}, Pr = {
|
|
2603
|
+
assetGrid: {
|
|
2604
|
+
loading: "Chargement…",
|
|
2605
|
+
empty: "Aucun média",
|
|
2606
|
+
unavailableForRatio: "Cette image n'a pas encore de version {ratio}",
|
|
2607
|
+
columns: {
|
|
2608
|
+
name: "Nom",
|
|
2609
|
+
dimensions: "Dimensions",
|
|
2610
|
+
fileSize: "Taille",
|
|
2611
|
+
uploader: "Importé par",
|
|
2612
|
+
uploadedAt: "Importé le"
|
|
2613
|
+
},
|
|
2614
|
+
time: {
|
|
2615
|
+
justNow: "À l'instant",
|
|
2616
|
+
minutesAgo: "il y a {n} min",
|
|
2617
|
+
hoursAgo: "il y a {n} h",
|
|
2618
|
+
daysAgo: "il y a {n} j"
|
|
2619
|
+
},
|
|
2620
|
+
noPoster: "Aucun aperçu",
|
|
2621
|
+
videoUnavailableForRatio: "Une vidéo ne peut pas être utilisée là où un ratio {ratio} fixe est requis"
|
|
2622
|
+
},
|
|
2623
|
+
assetPagination: {
|
|
2624
|
+
itemCount: "{start}–{end} sur {total}",
|
|
2625
|
+
pageCount: "{total} pages"
|
|
2626
|
+
},
|
|
2627
|
+
assetDetailDialog: {
|
|
2628
|
+
previewTitle: "Aperçu",
|
|
2629
|
+
saveButton: "Enregistrer",
|
|
2630
|
+
dimensionsLabel: "Dimensions",
|
|
2631
|
+
sizeLabel: "Taille",
|
|
2632
|
+
formatLabel: "Format",
|
|
2633
|
+
copyLinkButton: "Copier le lien",
|
|
2634
|
+
deleteButton: "Supprimer",
|
|
2635
|
+
deleteDisclaimer: "Après suppression, si un module métier utilise encore cet élément, il apparaîtra comme cassé à l'endroit où il est référencé. Assurez-vous qu'il n'est plus nécessaire.",
|
|
2636
|
+
deleteDialogTitle: "Supprimer le média",
|
|
2637
|
+
deleteDialogMessage: "Supprimer « {fileName} » ? {disclaimer}",
|
|
2638
|
+
deleteConfirmButton: "Supprimer",
|
|
2639
|
+
cancelButton: "Annuler",
|
|
2640
|
+
durationLabel: "Durée"
|
|
2641
|
+
},
|
|
2642
|
+
tagFilterBar: {
|
|
2643
|
+
all: "Tous",
|
|
2644
|
+
newTagPlaceholder: "Nouveau tag…"
|
|
2645
|
+
},
|
|
2646
|
+
tagFilterTabs: {
|
|
2647
|
+
all: "Tous"
|
|
2648
|
+
},
|
|
2649
|
+
uploadPanel: {
|
|
2650
|
+
dropLabel: "Glissez des images ou des vidéos ici, ou cliquez pour choisir",
|
|
2651
|
+
helperText: "Images JPG/PNG/WEBP jusqu'à 10 Mo · Vidéos MP4/MOV/WEBM jusqu'à 512 Mo",
|
|
2652
|
+
stagedCount: "En attente · {count}",
|
|
2653
|
+
tagsLabel: "Tags (facultatif)",
|
|
2654
|
+
suggestedTagsLabel: "Fréquents",
|
|
2655
|
+
uploadFailedError: "Échec de l'import : {status}",
|
|
2656
|
+
uploading: "Téléchargement…",
|
|
2657
|
+
videoUndecodableWarning: "Ce navigateur n'a pas pu lire la vidéo, aucune image de couverture n'a donc été capturée. Elle risque aussi de ne pas se lire sur les terminaux POS et dans les mini-programmes — il est conseillé de la convertir en MP4 (H.264).",
|
|
2658
|
+
videoNoRatiosNote: "Les vidéos n'ont pas de versions par ratio ; les options de ratio ne concernent que les images.",
|
|
2659
|
+
fileTooLargeError: "Ce fichier ne doit pas dépasser {limit}"
|
|
2660
|
+
},
|
|
2661
|
+
pickerModal: {
|
|
2662
|
+
title: "Sélectionner des médias",
|
|
2663
|
+
subtitleMultiple: "Sélectionnez plusieurs éléments ou importez — cliquez sur un élément pour le (dé)sélectionner",
|
|
2664
|
+
subtitleSingle: "Cliquez sur un élément pour le choisir, ou passez à l'onglet Importer",
|
|
2665
|
+
searchPlaceholder: "Rechercher…",
|
|
2666
|
+
browseTab: "Parcourir",
|
|
2667
|
+
uploadTab: "Importer",
|
|
2668
|
+
selectedCount: "{count} sélectionné(s)",
|
|
2669
|
+
selectPrompt: "Sélectionnez un élément",
|
|
2670
|
+
cancelButton: "Annuler",
|
|
2671
|
+
uploadSubmitButton: "Importer {count}",
|
|
2672
|
+
confirmButton: "Confirmer"
|
|
2673
|
+
},
|
|
2674
|
+
ratios: {
|
|
2675
|
+
title: "Ratios à générer",
|
|
2676
|
+
hint: "L'IA étend le cadre — environ 40 s par ratio"
|
|
2677
|
+
},
|
|
2678
|
+
variants: {
|
|
2679
|
+
badgeDone: "{count} ratios",
|
|
2680
|
+
badgeProgress: "{active}/{total} ratios",
|
|
2681
|
+
original: "Original",
|
|
2682
|
+
generating: "Génération…",
|
|
2683
|
+
failed: "Échec de la génération",
|
|
2684
|
+
failedNoTokens: "Jetons IA épuisés. Rechargez, puis regénérez ce format.",
|
|
2685
|
+
failedTokenServiceDown: "Impossible de vérifier votre solde de jetons IA. Réessayez sous peu.",
|
|
2686
|
+
regenerate: "Régénérer"
|
|
2687
|
+
},
|
|
2688
|
+
ratioBar: {
|
|
2689
|
+
label: "Ratio",
|
|
2690
|
+
unavailableForSelection: "L'image sélectionnée n'a pas encore de version {ratio}"
|
|
2691
|
+
}
|
|
2692
|
+
}, Tr = {
|
|
2693
|
+
mediaPicker: Pr
|
|
2694
|
+
}, Sr = {
|
|
2695
|
+
assetGrid: {
|
|
2696
|
+
loading: "Memuat…",
|
|
2697
|
+
empty: "Belum ada media",
|
|
2698
|
+
unavailableForRatio: "Gambar ini belum memiliki versi {ratio}",
|
|
2699
|
+
columns: {
|
|
2700
|
+
name: "Nama",
|
|
2701
|
+
dimensions: "Dimensi",
|
|
2702
|
+
fileSize: "Ukuran",
|
|
2703
|
+
uploader: "Diunggah Oleh",
|
|
2704
|
+
uploadedAt: "Waktu Unggah"
|
|
2705
|
+
},
|
|
2706
|
+
time: {
|
|
2707
|
+
justNow: "Baru saja",
|
|
2708
|
+
minutesAgo: "{n} menit lalu",
|
|
2709
|
+
hoursAgo: "{n} jam lalu",
|
|
2710
|
+
daysAgo: "{n} hari lalu"
|
|
2711
|
+
},
|
|
2712
|
+
noPoster: "Tanpa pratinjau",
|
|
2713
|
+
videoUnavailableForRatio: "Video tidak dapat dipakai pada slot yang mewajibkan rasio {ratio}"
|
|
2714
|
+
},
|
|
2715
|
+
assetPagination: {
|
|
2716
|
+
itemCount: "{start}–{end} dari {total}",
|
|
2717
|
+
pageCount: "{total} halaman"
|
|
2718
|
+
},
|
|
2719
|
+
assetDetailDialog: {
|
|
2720
|
+
previewTitle: "Pratinjau",
|
|
2721
|
+
saveButton: "Simpan",
|
|
2722
|
+
dimensionsLabel: "Dimensi",
|
|
2723
|
+
sizeLabel: "Ukuran",
|
|
2724
|
+
formatLabel: "Format",
|
|
2725
|
+
copyLinkButton: "Salin Tautan",
|
|
2726
|
+
deleteButton: "Hapus",
|
|
2727
|
+
deleteDisclaimer: "Setelah dihapus, jika ada modul bisnis yang masih menggunakan aset ini, aset akan tampil rusak di tempat penggunaannya. Pastikan aset ini sudah tidak diperlukan lagi.",
|
|
2728
|
+
deleteDialogTitle: "Hapus Media",
|
|
2729
|
+
deleteDialogMessage: 'Hapus "{fileName}"? {disclaimer}',
|
|
2730
|
+
deleteConfirmButton: "Hapus",
|
|
2731
|
+
cancelButton: "Batal",
|
|
2732
|
+
durationLabel: "Durasi"
|
|
2733
|
+
},
|
|
2734
|
+
tagFilterBar: {
|
|
2735
|
+
all: "Semua",
|
|
2736
|
+
newTagPlaceholder: "Buat tag baru…"
|
|
2737
|
+
},
|
|
2738
|
+
tagFilterTabs: {
|
|
2739
|
+
all: "Semua"
|
|
2740
|
+
},
|
|
2741
|
+
uploadPanel: {
|
|
2742
|
+
dropLabel: "Seret gambar atau video ke sini, atau klik untuk memilih",
|
|
2743
|
+
helperText: "Gambar JPG/PNG/WEBP maksimal 10MB per file · Video MP4/MOV/WEBM maksimal 512MB per file",
|
|
2744
|
+
stagedCount: "Menunggu diunggah · {count}",
|
|
2745
|
+
tagsLabel: "Tag (opsional)",
|
|
2746
|
+
suggestedTagsLabel: "Sering digunakan",
|
|
2747
|
+
uploadFailedError: "Unggah gagal: {status}",
|
|
2748
|
+
uploading: "Mengunggah…",
|
|
2749
|
+
videoUndecodableWarning: "Peramban ini tidak dapat memutar video tersebut, sehingga sampul gagal diambil. Video mungkin juga tidak dapat diputar di terminal POS maupun mini program — sebaiknya konversikan ke MP4 (H.264).",
|
|
2750
|
+
videoNoRatiosNote: "Video tidak memiliki versi rasio; opsi rasio hanya berlaku untuk gambar.",
|
|
2751
|
+
fileTooLargeError: "Berkas ini maksimal {limit}"
|
|
2752
|
+
},
|
|
2753
|
+
pickerModal: {
|
|
2754
|
+
title: "Pilih Media",
|
|
2755
|
+
subtitleMultiple: "Pilih beberapa atau unggah — klik item untuk mengubah pilihan",
|
|
2756
|
+
subtitleSingle: "Klik item untuk memilihnya, atau beralih ke Unggah Baru",
|
|
2757
|
+
searchPlaceholder: "Cari…",
|
|
2758
|
+
browseTab: "Jelajahi & Pilih",
|
|
2759
|
+
uploadTab: "Unggah Baru",
|
|
2760
|
+
selectedCount: "{count} dipilih",
|
|
2761
|
+
selectPrompt: "Pilih item",
|
|
2762
|
+
cancelButton: "Batal",
|
|
2763
|
+
uploadSubmitButton: "Unggah {count}",
|
|
2764
|
+
confirmButton: "Konfirmasi"
|
|
2765
|
+
},
|
|
2766
|
+
ratios: {
|
|
2767
|
+
title: "Rasio yang akan dibuat",
|
|
2768
|
+
hint: "AI memperluas kanvas — sekitar 40 detik per rasio"
|
|
2769
|
+
},
|
|
2770
|
+
variants: {
|
|
2771
|
+
badgeDone: "{count} rasio",
|
|
2772
|
+
badgeProgress: "{active}/{total} rasio",
|
|
2773
|
+
original: "Asli",
|
|
2774
|
+
generating: "Membuat…",
|
|
2775
|
+
failed: "Gagal membuat",
|
|
2776
|
+
failedNoTokens: "Token AI habis. Isi ulang, lalu buat ukuran ini lagi.",
|
|
2777
|
+
failedTokenServiceDown: "Saldo token AI tidak dapat diperiksa. Coba lagi sebentar lagi.",
|
|
2778
|
+
regenerate: "Buat ulang"
|
|
2779
|
+
},
|
|
2780
|
+
ratioBar: {
|
|
2781
|
+
label: "Rasio",
|
|
2782
|
+
unavailableForSelection: "Gambar yang dipilih belum memiliki versi {ratio}"
|
|
2783
|
+
}
|
|
2784
|
+
}, Er = {
|
|
2785
|
+
mediaPicker: Sr
|
|
2786
|
+
}, Cr = {
|
|
2787
|
+
assetGrid: {
|
|
2788
|
+
loading: "読み込み中…",
|
|
2789
|
+
empty: "素材がありません",
|
|
2790
|
+
unavailableForRatio: "この画像にはまだ {ratio} バージョンがありません",
|
|
2791
|
+
columns: {
|
|
2792
|
+
name: "名前",
|
|
2793
|
+
dimensions: "サイズ",
|
|
2794
|
+
fileSize: "容量",
|
|
2795
|
+
uploader: "アップロード者",
|
|
2796
|
+
uploadedAt: "アップロード日時"
|
|
2797
|
+
},
|
|
2798
|
+
time: {
|
|
2799
|
+
justNow: "たった今",
|
|
2800
|
+
minutesAgo: "{n} 分前",
|
|
2801
|
+
hoursAgo: "{n} 時間前",
|
|
2802
|
+
daysAgo: "{n} 日前"
|
|
2803
|
+
},
|
|
2804
|
+
noPoster: "プレビューなし",
|
|
2805
|
+
videoUnavailableForRatio: "{ratio} の比率が固定された場所では動画は使用できません"
|
|
2806
|
+
},
|
|
2807
|
+
assetPagination: {
|
|
2808
|
+
itemCount: "{total} 件中 {start}–{end} 件",
|
|
2809
|
+
pageCount: "全 {total} ページ"
|
|
2810
|
+
},
|
|
2811
|
+
assetDetailDialog: {
|
|
2812
|
+
previewTitle: "プレビュー",
|
|
2813
|
+
saveButton: "保存",
|
|
2814
|
+
dimensionsLabel: "サイズ",
|
|
2815
|
+
sizeLabel: "容量",
|
|
2816
|
+
formatLabel: "形式",
|
|
2817
|
+
copyLinkButton: "リンクをコピー",
|
|
2818
|
+
deleteButton: "削除",
|
|
2819
|
+
deleteDisclaimer: "削除後、この素材を使用している業務モジュールがある場合、参照元では表示されなくなります。不要であることを確認してください。",
|
|
2820
|
+
deleteDialogTitle: "素材を削除",
|
|
2821
|
+
deleteDialogMessage: "「{fileName}」を削除しますか?{disclaimer}",
|
|
2822
|
+
deleteConfirmButton: "削除",
|
|
2823
|
+
cancelButton: "キャンセル",
|
|
2824
|
+
durationLabel: "再生時間"
|
|
2825
|
+
},
|
|
2826
|
+
tagFilterBar: {
|
|
2827
|
+
all: "すべて",
|
|
2828
|
+
newTagPlaceholder: "新しいタグを作成…"
|
|
2829
|
+
},
|
|
2830
|
+
tagFilterTabs: {
|
|
2831
|
+
all: "すべて"
|
|
2832
|
+
},
|
|
2833
|
+
uploadPanel: {
|
|
2834
|
+
dropLabel: "画像または動画をここにドラッグ、またはクリックして選択",
|
|
2835
|
+
helperText: "画像 JPG/PNG/WEBP は1件あたり10MBまで・動画 MP4/MOV/WEBM は1件あたり512MBまで",
|
|
2836
|
+
stagedCount: "アップロード待ち · {count}",
|
|
2837
|
+
tagsLabel: "タグ(任意)",
|
|
2838
|
+
suggestedTagsLabel: "よく使うタグ",
|
|
2839
|
+
uploadFailedError: "アップロードに失敗しました:{status}",
|
|
2840
|
+
uploading: "アップロード中…",
|
|
2841
|
+
videoUndecodableWarning: "このブラウザーでは動画を再生できないため、サムネイルを取得できませんでした。POS端末やミニプログラムでも再生できない可能性があります。MP4(H.264)に変換してからアップロードすることをおすすめします。",
|
|
2842
|
+
videoNoRatiosNote: "動画には比率バージョンがありません。比率の選択は画像にのみ適用されます。",
|
|
2843
|
+
fileTooLargeError: "このファイルは最大 {limit} までです"
|
|
2844
|
+
},
|
|
2845
|
+
pickerModal: {
|
|
2846
|
+
title: "素材を選択",
|
|
2847
|
+
subtitleMultiple: "複数選択またはアップロードできます。素材をクリックで選択を切り替え",
|
|
2848
|
+
subtitleSingle: "素材をクリックして選択するか、「新規アップロード」に切り替えてください",
|
|
2849
|
+
searchPlaceholder: "検索…",
|
|
2850
|
+
browseTab: "選択して閲覧",
|
|
2851
|
+
uploadTab: "新規アップロード",
|
|
2852
|
+
selectedCount: "{count} 件選択中",
|
|
2853
|
+
selectPrompt: "素材を選択してください",
|
|
2854
|
+
cancelButton: "キャンセル",
|
|
2855
|
+
uploadSubmitButton: "{count} 件をアップロード",
|
|
2856
|
+
confirmButton: "確定"
|
|
2857
|
+
},
|
|
2858
|
+
ratios: {
|
|
2859
|
+
title: "生成する比率",
|
|
2860
|
+
hint: "AI がキャンバスを拡張します(1件あたり約40秒)"
|
|
2861
|
+
},
|
|
2862
|
+
variants: {
|
|
2863
|
+
badgeDone: "{count} 比率",
|
|
2864
|
+
badgeProgress: "{active}/{total} 比率",
|
|
2865
|
+
original: "元画像",
|
|
2866
|
+
generating: "生成中…",
|
|
2867
|
+
failed: "生成に失敗しました",
|
|
2868
|
+
failedNoTokens: "AIトークンが不足しています。チャージ後にこのサイズを再生成できます。",
|
|
2869
|
+
failedTokenServiceDown: "AIトークンの残高を確認できませんでした。しばらくしてからお試しください。",
|
|
2870
|
+
regenerate: "再生成"
|
|
2871
|
+
},
|
|
2872
|
+
ratioBar: {
|
|
2873
|
+
label: "比率",
|
|
2874
|
+
unavailableForSelection: "選択した画像にはまだ {ratio} バージョンがありません"
|
|
2875
|
+
}
|
|
2876
|
+
}, Or = {
|
|
2877
|
+
mediaPicker: Cr
|
|
2878
|
+
}, Rr = {
|
|
2879
|
+
assetGrid: {
|
|
2880
|
+
loading: "กำลังโหลด…",
|
|
2881
|
+
empty: "ยังไม่มีสื่อ",
|
|
2882
|
+
unavailableForRatio: "รูปนี้ยังไม่มีเวอร์ชัน {ratio}",
|
|
2883
|
+
columns: {
|
|
2884
|
+
name: "ชื่อ",
|
|
2885
|
+
dimensions: "ขนาด (พิกเซล)",
|
|
2886
|
+
fileSize: "ขนาดไฟล์",
|
|
2887
|
+
uploader: "ผู้อัปโหลด",
|
|
2888
|
+
uploadedAt: "เวลาอัปโหลด"
|
|
2889
|
+
},
|
|
2890
|
+
time: {
|
|
2891
|
+
justNow: "เมื่อสักครู่",
|
|
2892
|
+
minutesAgo: "{n} นาทีที่แล้ว",
|
|
2893
|
+
hoursAgo: "{n} ชั่วโมงที่แล้ว",
|
|
2894
|
+
daysAgo: "{n} วันที่แล้ว"
|
|
2895
|
+
},
|
|
2896
|
+
noPoster: "ไม่มีตัวอย่าง",
|
|
2897
|
+
videoUnavailableForRatio: "ตำแหน่งที่ต้องใช้อัตราส่วน {ratio} คงที่ใช้วิดีโอไม่ได้"
|
|
2898
|
+
},
|
|
2899
|
+
assetPagination: {
|
|
2900
|
+
itemCount: "{start}–{end} จาก {total} รายการ",
|
|
2901
|
+
pageCount: "{total} หน้า"
|
|
2902
|
+
},
|
|
2903
|
+
assetDetailDialog: {
|
|
2904
|
+
previewTitle: "ตัวอย่าง",
|
|
2905
|
+
saveButton: "บันทึก",
|
|
2906
|
+
dimensionsLabel: "ขนาด (พิกเซล)",
|
|
2907
|
+
sizeLabel: "ขนาดไฟล์",
|
|
2908
|
+
formatLabel: "รูปแบบ",
|
|
2909
|
+
copyLinkButton: "คัดลอกลิงก์",
|
|
2910
|
+
deleteButton: "ลบ",
|
|
2911
|
+
deleteDisclaimer: "หลังลบแล้ว หากมีโมดูลธุรกิจใดกำลังใช้สื่อนี้อยู่ สื่อจะแสดงเป็นลิงก์เสียในตำแหน่งที่ถูกใช้งาน กรุณายืนยันว่าไม่จำเป็นต้องใช้แล้ว",
|
|
2912
|
+
deleteDialogTitle: "ลบสื่อ",
|
|
2913
|
+
deleteDialogMessage: "ยืนยันลบ “{fileName}” ใช่หรือไม่? {disclaimer}",
|
|
2914
|
+
deleteConfirmButton: "ลบ",
|
|
2915
|
+
cancelButton: "ยกเลิก",
|
|
2916
|
+
durationLabel: "ความยาว"
|
|
2917
|
+
},
|
|
2918
|
+
tagFilterBar: {
|
|
2919
|
+
all: "ทั้งหมด",
|
|
2920
|
+
newTagPlaceholder: "สร้างแท็กใหม่…"
|
|
2921
|
+
},
|
|
2922
|
+
tagFilterTabs: {
|
|
2923
|
+
all: "ทั้งหมด"
|
|
2924
|
+
},
|
|
2925
|
+
uploadPanel: {
|
|
2926
|
+
dropLabel: "ลากรูปภาพหรือวิดีโอมาที่นี่ หรือคลิกเพื่อเลือก",
|
|
2927
|
+
helperText: "รูปภาพ JPG/PNG/WEBP ไม่เกิน 10MB ต่อไฟล์ · วิดีโอ MP4/MOV/WEBM ไม่เกิน 512MB ต่อไฟล์",
|
|
2928
|
+
stagedCount: "รอการอัปโหลด · {count}",
|
|
2929
|
+
tagsLabel: "แท็ก (ไม่บังคับ)",
|
|
2930
|
+
suggestedTagsLabel: "ที่ใช้บ่อย",
|
|
2931
|
+
uploadFailedError: "อัปโหลดล้มเหลว: {status}",
|
|
2932
|
+
uploading: "กำลังอัปโหลด…",
|
|
2933
|
+
videoUndecodableWarning: "เบราว์เซอร์นี้เล่นวิดีโอไม่ได้ จึงจับภาพหน้าปกไม่สำเร็จ วิดีโออาจเล่นไม่ได้บนเครื่อง POS และในมินิโปรแกรมด้วย แนะนำให้แปลงเป็น MP4 (H.264) ก่อนอัปโหลด",
|
|
2934
|
+
videoNoRatiosNote: "วิดีโอไม่มีเวอร์ชันตามอัตราส่วน ตัวเลือกอัตราส่วนใช้กับรูปภาพเท่านั้น",
|
|
2935
|
+
fileTooLargeError: "ไฟล์นี้ต้องไม่เกิน {limit}"
|
|
2936
|
+
},
|
|
2937
|
+
pickerModal: {
|
|
2938
|
+
title: "เลือกสื่อ",
|
|
2939
|
+
subtitleMultiple: "เลือกได้หลายรายการหรืออัปโหลด คลิกที่รายการเพื่อสลับการเลือก",
|
|
2940
|
+
subtitleSingle: "คลิกที่รายการเพื่อเลือก หรือสลับไปที่แท็บอัปโหลดใหม่",
|
|
2941
|
+
searchPlaceholder: "ค้นหา…",
|
|
2942
|
+
browseTab: "เรียกดูและเลือก",
|
|
2943
|
+
uploadTab: "อัปโหลดใหม่",
|
|
2944
|
+
selectedCount: "เลือกแล้ว {count} รายการ",
|
|
2945
|
+
selectPrompt: "เลือกรายการ",
|
|
2946
|
+
cancelButton: "ยกเลิก",
|
|
2947
|
+
uploadSubmitButton: "อัปโหลด {count} รายการ",
|
|
2948
|
+
confirmButton: "ยืนยัน"
|
|
2949
|
+
},
|
|
2950
|
+
ratios: {
|
|
2951
|
+
title: "อัตราส่วนที่ต้องการสร้าง",
|
|
2952
|
+
hint: "AI จะขยายพื้นที่ภาพ ใช้เวลาประมาณ 40 วินาทีต่อรายการ"
|
|
2953
|
+
},
|
|
2954
|
+
variants: {
|
|
2955
|
+
badgeDone: "{count} อัตราส่วน",
|
|
2956
|
+
badgeProgress: "{active}/{total} อัตราส่วน",
|
|
2957
|
+
original: "ภาพต้นฉบับ",
|
|
2958
|
+
generating: "กำลังสร้าง…",
|
|
2959
|
+
failed: "สร้างไม่สำเร็จ",
|
|
2960
|
+
failedNoTokens: "โทเค็น AI หมดแล้ว เติมเงินแล้วสร้างขนาดนี้ใหม่ได้",
|
|
2961
|
+
failedTokenServiceDown: "ตรวจสอบยอดโทเค็น AI ไม่ได้ กรุณาลองใหม่อีกครั้ง",
|
|
2962
|
+
regenerate: "สร้างใหม่"
|
|
2963
|
+
},
|
|
2964
|
+
ratioBar: {
|
|
2965
|
+
label: "อัตราส่วน",
|
|
2966
|
+
unavailableForSelection: "รูปที่เลือกยังไม่มีเวอร์ชัน {ratio}"
|
|
2967
|
+
}
|
|
2968
|
+
}, Ar = {
|
|
2969
|
+
mediaPicker: Rr
|
|
2970
|
+
}, Br = {
|
|
2971
|
+
assetGrid: {
|
|
2972
|
+
loading: "加载中…",
|
|
2973
|
+
empty: "暂无素材",
|
|
2974
|
+
unavailableForRatio: "这张图还没有 {ratio} 版本",
|
|
2975
|
+
columns: {
|
|
2976
|
+
name: "名称",
|
|
2977
|
+
dimensions: "尺寸",
|
|
2978
|
+
fileSize: "大小",
|
|
2979
|
+
uploader: "上传人",
|
|
2980
|
+
uploadedAt: "上传时间"
|
|
2981
|
+
},
|
|
2982
|
+
time: {
|
|
2983
|
+
justNow: "刚刚",
|
|
2984
|
+
minutesAgo: "{n} 分钟前",
|
|
2985
|
+
hoursAgo: "{n} 小时前",
|
|
2986
|
+
daysAgo: "{n} 天前"
|
|
2987
|
+
},
|
|
2988
|
+
noPoster: "无预览",
|
|
2989
|
+
videoUnavailableForRatio: "需要固定 {ratio} 比例的位置无法使用视频"
|
|
2990
|
+
},
|
|
2991
|
+
assetPagination: {
|
|
2992
|
+
itemCount: "第 {start}–{end} 项,共 {total} 项",
|
|
2993
|
+
pageCount: "共 {total} 页"
|
|
2994
|
+
},
|
|
2995
|
+
assetDetailDialog: {
|
|
2996
|
+
previewTitle: "预览",
|
|
2997
|
+
saveButton: "保存",
|
|
2998
|
+
dimensionsLabel: "尺寸",
|
|
2999
|
+
sizeLabel: "大小",
|
|
3000
|
+
formatLabel: "格式",
|
|
3001
|
+
copyLinkButton: "复制链接",
|
|
3002
|
+
deleteButton: "删除",
|
|
3003
|
+
deleteDisclaimer: "删除后如有业务模块正在使用这个素材,引用处会显示失效,请确认已不再需要。",
|
|
3004
|
+
deleteDialogTitle: "删除素材",
|
|
3005
|
+
deleteDialogMessage: "确定删除「{fileName}」吗?{disclaimer}",
|
|
3006
|
+
deleteConfirmButton: "删除",
|
|
3007
|
+
cancelButton: "取消",
|
|
3008
|
+
durationLabel: "时长"
|
|
3009
|
+
},
|
|
3010
|
+
tagFilterBar: {
|
|
3011
|
+
all: "全部",
|
|
3012
|
+
newTagPlaceholder: "新建标签…"
|
|
3013
|
+
},
|
|
3014
|
+
tagFilterTabs: {
|
|
3015
|
+
all: "全部"
|
|
3016
|
+
},
|
|
3017
|
+
uploadPanel: {
|
|
3018
|
+
dropLabel: "将图片或视频拖到此处,或点击选择",
|
|
3019
|
+
helperText: "图片 JPG/PNG/WEBP,单个不超过 10MB · 视频 MP4/MOV/WEBM,单个不超过 512MB",
|
|
3020
|
+
stagedCount: "待上传 · {count}",
|
|
3021
|
+
tagsLabel: "标签(可选)",
|
|
3022
|
+
suggestedTagsLabel: "常用",
|
|
3023
|
+
uploadFailedError: "上传失败:{status}",
|
|
3024
|
+
uploading: "上传中…",
|
|
3025
|
+
videoUndecodableWarning: "当前浏览器无法播放该视频,因此未能截取封面。它在 POS 终端和小程序上也可能无法播放,建议转成 MP4(H.264)后再上传。",
|
|
3026
|
+
videoNoRatiosNote: "视频没有比例版本,比例选项仅对图片生效。",
|
|
3027
|
+
fileTooLargeError: "该文件最大不能超过 {limit}"
|
|
3028
|
+
},
|
|
3029
|
+
pickerModal: {
|
|
3030
|
+
title: "选择素材",
|
|
3031
|
+
subtitleMultiple: "可多选或上传,点击素材切换选择",
|
|
3032
|
+
subtitleSingle: "点击素材完成选择,或切换到上传新素材",
|
|
3033
|
+
searchPlaceholder: "搜索…",
|
|
3034
|
+
browseTab: "浏览选择",
|
|
3035
|
+
uploadTab: "上传新素材",
|
|
3036
|
+
selectedCount: "已选择 {count} 个",
|
|
3037
|
+
selectPrompt: "请选择素材",
|
|
3038
|
+
cancelButton: "取消",
|
|
3039
|
+
uploadSubmitButton: "上传 {count} 个",
|
|
3040
|
+
confirmButton: "确定"
|
|
3041
|
+
},
|
|
3042
|
+
ratios: {
|
|
3043
|
+
title: "要生成的规格",
|
|
3044
|
+
hint: "AI 扩展画布,每个规格约 40 秒"
|
|
3045
|
+
},
|
|
3046
|
+
variants: {
|
|
3047
|
+
badgeDone: "{count} 规格",
|
|
3048
|
+
badgeProgress: "{active}/{total} 规格",
|
|
3049
|
+
original: "原图",
|
|
3050
|
+
generating: "生成中…",
|
|
3051
|
+
failed: "生成失败",
|
|
3052
|
+
failedNoTokens: "AI 额度已用完。充值后可重新生成这个尺寸。",
|
|
3053
|
+
failedTokenServiceDown: "暂时无法确认 AI 额度,请稍后重试。",
|
|
3054
|
+
regenerate: "重新生成"
|
|
3055
|
+
},
|
|
3056
|
+
ratioBar: {
|
|
3057
|
+
label: "规格",
|
|
3058
|
+
unavailableForSelection: "所选图片还没有 {ratio} 版本"
|
|
3059
|
+
}
|
|
3060
|
+
}, Dr = {
|
|
3061
|
+
mediaPicker: Br
|
|
3062
|
+
}, _r = {
|
|
3063
|
+
assetGrid: {
|
|
3064
|
+
loading: "載入中…",
|
|
3065
|
+
empty: "暫無素材",
|
|
3066
|
+
unavailableForRatio: "這張圖還沒有 {ratio} 版本",
|
|
3067
|
+
columns: {
|
|
3068
|
+
name: "名稱",
|
|
3069
|
+
dimensions: "尺寸",
|
|
3070
|
+
fileSize: "大小",
|
|
3071
|
+
uploader: "上傳人",
|
|
3072
|
+
uploadedAt: "上傳時間"
|
|
3073
|
+
},
|
|
3074
|
+
time: {
|
|
3075
|
+
justNow: "剛剛",
|
|
3076
|
+
minutesAgo: "{n} 分鐘前",
|
|
3077
|
+
hoursAgo: "{n} 小時前",
|
|
3078
|
+
daysAgo: "{n} 天前"
|
|
3079
|
+
},
|
|
3080
|
+
noPoster: "無預覽",
|
|
3081
|
+
videoUnavailableForRatio: "需要固定 {ratio} 比例的位置無法使用影片"
|
|
3082
|
+
},
|
|
3083
|
+
assetPagination: {
|
|
3084
|
+
itemCount: "第 {start}–{end} 項,共 {total} 項",
|
|
3085
|
+
pageCount: "共 {total} 頁"
|
|
3086
|
+
},
|
|
3087
|
+
assetDetailDialog: {
|
|
3088
|
+
previewTitle: "預覽",
|
|
3089
|
+
saveButton: "儲存",
|
|
3090
|
+
dimensionsLabel: "尺寸",
|
|
3091
|
+
sizeLabel: "大小",
|
|
3092
|
+
formatLabel: "格式",
|
|
3093
|
+
copyLinkButton: "複製連結",
|
|
3094
|
+
deleteButton: "刪除",
|
|
3095
|
+
deleteDisclaimer: "刪除後如有業務模組正在使用這個素材,引用處會顯示失效,請確認已不再需要。",
|
|
3096
|
+
deleteDialogTitle: "刪除素材",
|
|
3097
|
+
deleteDialogMessage: "確定刪除「{fileName}」嗎?{disclaimer}",
|
|
3098
|
+
deleteConfirmButton: "刪除",
|
|
3099
|
+
cancelButton: "取消",
|
|
3100
|
+
durationLabel: "時長"
|
|
3101
|
+
},
|
|
3102
|
+
tagFilterBar: {
|
|
3103
|
+
all: "全部",
|
|
3104
|
+
newTagPlaceholder: "新增標籤…"
|
|
3105
|
+
},
|
|
3106
|
+
tagFilterTabs: {
|
|
3107
|
+
all: "全部"
|
|
3108
|
+
},
|
|
3109
|
+
uploadPanel: {
|
|
3110
|
+
dropLabel: "將圖片或影片拖到此處,或點擊選擇",
|
|
3111
|
+
helperText: "圖片 JPG/PNG/WEBP,單個不超過 10MB · 影片 MP4/MOV/WEBM,單個不超過 512MB",
|
|
3112
|
+
stagedCount: "待上傳 · {count}",
|
|
3113
|
+
tagsLabel: "標籤(可選)",
|
|
3114
|
+
suggestedTagsLabel: "常用",
|
|
3115
|
+
uploadFailedError: "上傳失敗:{status}",
|
|
3116
|
+
uploading: "上傳中…",
|
|
3117
|
+
videoUndecodableWarning: "目前的瀏覽器無法播放此影片,因此未能擷取封面。它在 POS 終端與小程式上也可能無法播放,建議轉成 MP4(H.264)後再上傳。",
|
|
3118
|
+
videoNoRatiosNote: "影片沒有比例版本,比例選項僅對圖片生效。",
|
|
3119
|
+
fileTooLargeError: "此檔案最大不能超過 {limit}"
|
|
3120
|
+
},
|
|
3121
|
+
pickerModal: {
|
|
3122
|
+
title: "選擇素材",
|
|
3123
|
+
subtitleMultiple: "可多選或上傳,點擊素材切換選擇",
|
|
3124
|
+
subtitleSingle: "點擊素材完成選擇,或切換到上傳新素材",
|
|
3125
|
+
searchPlaceholder: "搜尋…",
|
|
3126
|
+
browseTab: "瀏覽選擇",
|
|
3127
|
+
uploadTab: "上傳新素材",
|
|
3128
|
+
selectedCount: "已選擇 {count} 個",
|
|
3129
|
+
selectPrompt: "請選擇素材",
|
|
3130
|
+
cancelButton: "取消",
|
|
3131
|
+
uploadSubmitButton: "上傳 {count} 個",
|
|
3132
|
+
confirmButton: "確定"
|
|
3133
|
+
},
|
|
3134
|
+
ratios: {
|
|
3135
|
+
title: "要產生的規格",
|
|
3136
|
+
hint: "AI 擴展畫布,每個規格約 40 秒"
|
|
3137
|
+
},
|
|
3138
|
+
variants: {
|
|
3139
|
+
badgeDone: "{count} 規格",
|
|
3140
|
+
badgeProgress: "{active}/{total} 規格",
|
|
3141
|
+
original: "原圖",
|
|
3142
|
+
generating: "產生中…",
|
|
3143
|
+
failed: "產生失敗",
|
|
3144
|
+
failedNoTokens: "AI 額度已用完。儲值後可重新產生這個尺寸。",
|
|
3145
|
+
failedTokenServiceDown: "暫時無法確認 AI 額度,請稍後重試。",
|
|
3146
|
+
regenerate: "重新產生"
|
|
3147
|
+
},
|
|
3148
|
+
ratioBar: {
|
|
3149
|
+
label: "規格",
|
|
3150
|
+
unavailableForSelection: "所選圖片還沒有 {ratio} 版本"
|
|
3151
|
+
}
|
|
3152
|
+
}, Fr = {
|
|
3153
|
+
mediaPicker: _r
|
|
3154
|
+
}, be = {
|
|
3155
|
+
"en-US": xr,
|
|
3156
|
+
"zh-CN": Dr,
|
|
3157
|
+
"zh-Hant": Fr,
|
|
3158
|
+
"th-TH": Ar,
|
|
3159
|
+
"ja-JP": Or,
|
|
3160
|
+
"id-ID": Er,
|
|
3161
|
+
"fr-MA": Tr
|
|
3162
|
+
}, Na = 15e3, Ir = 0.92, Lr = 0.1;
|
|
3163
|
+
function Nr(e) {
|
|
3164
|
+
return new Promise((t) => {
|
|
3165
|
+
const a = document.createElement("video");
|
|
3166
|
+
let n = !1;
|
|
3167
|
+
const o = (i) => {
|
|
3168
|
+
n || (n = !0, clearTimeout(r), a.removeAttribute("src"), a.load(), t(i));
|
|
3169
|
+
}, r = setTimeout(() => o(null), Na);
|
|
3170
|
+
a.preload = "metadata", a.muted = !0, a.onloadedmetadata = () => {
|
|
3171
|
+
const i = a.videoWidth, s = a.videoHeight, u = a.duration;
|
|
3172
|
+
if (!i || !s || !Number.isFinite(u) || u <= 0) {
|
|
3173
|
+
o(null);
|
|
3174
|
+
return;
|
|
3175
|
+
}
|
|
3176
|
+
o({ width: i, height: s, durationMs: Math.round(u * 1e3) });
|
|
3177
|
+
}, a.onerror = () => o(null), a.src = e;
|
|
3178
|
+
});
|
|
3179
|
+
}
|
|
3180
|
+
function Ur(e) {
|
|
3181
|
+
return new Promise((t) => {
|
|
3182
|
+
const a = document.createElement("video");
|
|
3183
|
+
let n = !1;
|
|
3184
|
+
const o = (s) => {
|
|
3185
|
+
n || (n = !0, clearTimeout(r), a.removeAttribute("src"), a.load(), t(s));
|
|
3186
|
+
}, r = setTimeout(() => o(null), Na), i = () => {
|
|
3187
|
+
try {
|
|
3188
|
+
const s = document.createElement("canvas");
|
|
3189
|
+
if (s.width = a.videoWidth, s.height = a.videoHeight, !s.width || !s.height) {
|
|
3190
|
+
o(null);
|
|
3191
|
+
return;
|
|
3192
|
+
}
|
|
3193
|
+
const u = s.getContext("2d");
|
|
3194
|
+
if (!u) {
|
|
3195
|
+
o(null);
|
|
3196
|
+
return;
|
|
3197
|
+
}
|
|
3198
|
+
u.drawImage(a, 0, 0, s.width, s.height), s.toBlob((d) => o(d), "image/jpeg", Ir);
|
|
3199
|
+
} catch {
|
|
3200
|
+
o(null);
|
|
3201
|
+
}
|
|
3202
|
+
};
|
|
3203
|
+
a.preload = "auto", a.muted = !0, a.crossOrigin = "anonymous", a.onloadeddata = () => {
|
|
3204
|
+
if (!a.videoWidth || !a.videoHeight) {
|
|
3205
|
+
o(null);
|
|
3206
|
+
return;
|
|
3207
|
+
}
|
|
3208
|
+
const s = Math.min(Lr, Math.max(0, (a.duration || 0) / 2));
|
|
3209
|
+
if (s <= 0) {
|
|
3210
|
+
i();
|
|
3211
|
+
return;
|
|
3212
|
+
}
|
|
3213
|
+
a.onseeked = i, a.currentTime = s;
|
|
3214
|
+
}, a.onerror = () => o(null), a.src = e;
|
|
3215
|
+
});
|
|
3216
|
+
}
|
|
3217
|
+
function It(e) {
|
|
3218
|
+
if (!Number.isFinite(e))
|
|
3219
|
+
return "0:00";
|
|
3220
|
+
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");
|
|
3221
|
+
return a > 0 ? `${a}:${r(n)}:${r(o)}` : `${n}:${r(o)}`;
|
|
3222
|
+
}
|
|
3223
|
+
const Mr = ["video/mp4", "video/quicktime", "video/webm"];
|
|
3224
|
+
function jr(e) {
|
|
3225
|
+
return e.type.startsWith("video/");
|
|
3226
|
+
}
|
|
3227
|
+
const zr = {
|
|
3228
|
+
key: 0,
|
|
3229
|
+
class: "py-64 text-center text-sm text-gray-400"
|
|
3230
|
+
}, Vr = {
|
|
3231
|
+
key: 1,
|
|
3232
|
+
class: "py-64 text-center text-sm text-gray-400"
|
|
3233
|
+
}, qr = {
|
|
3234
|
+
key: 2,
|
|
3235
|
+
class: "bg-white border border-fm-color-neutral-gray-200 rounded-lg overflow-hidden"
|
|
3236
|
+
}, $r = ["onClick"], Wr = ["onClick"], Gr = { key: 1 }, Hr = {
|
|
3237
|
+
class: "rounded overflow-hidden",
|
|
3238
|
+
style: { width: "44px", height: "36px" }
|
|
3239
|
+
}, Jr = {
|
|
3240
|
+
key: 1,
|
|
3241
|
+
class: "w-full h-full flex items-center justify-center bg-fm-color-neutral-gray-100 text-gray-400"
|
|
3242
|
+
}, Kr = { class: "min-w-0 flex flex-col gap-4" }, Xr = { class: "text-xs font-semibold truncate" }, Qr = { class: "flex items-center gap-8" }, Yr = { class: "text-xs text-fm-color-typo-primary" }, Zr = { class: "text-xs text-fm-color-typo-primary" }, ei = { class: "flex items-center gap-8 min-w-0" }, ti = { class: "text-xs text-fm-color-typo-primary truncate" }, ai = { class: "text-xs text-fm-color-typo-secondary" }, ni = {
|
|
3243
|
+
key: 3,
|
|
3244
|
+
class: "grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-16"
|
|
3245
|
+
}, oi = ["onClick"], ri = {
|
|
3246
|
+
class: "relative",
|
|
3247
|
+
style: { "aspect-ratio": "4 / 3" }
|
|
3248
|
+
}, ii = {
|
|
3249
|
+
key: 1,
|
|
3250
|
+
class: "w-full h-full flex flex-col items-center justify-center gap-4 bg-fm-color-neutral-gray-100 text-gray-400"
|
|
3251
|
+
}, si = {
|
|
3252
|
+
key: 2,
|
|
3253
|
+
class: "absolute inset-0 flex items-center justify-center pointer-events-none"
|
|
3254
|
+
}, li = {
|
|
3255
|
+
class: "rounded-full bg-black/50 flex items-center justify-center",
|
|
3256
|
+
style: { width: "40px", height: "40px" }
|
|
3257
|
+
}, ui = ["onClick"], ci = { class: "px-8 py-6 space-y-2" }, di = { class: "text-xs font-semibold truncate" }, pi = /* @__PURE__ */ ge({
|
|
3258
|
+
__name: "AssetGrid",
|
|
3259
|
+
props: {
|
|
3260
|
+
assets: {},
|
|
3261
|
+
loading: { type: Boolean, default: !1 },
|
|
3262
|
+
selectable: { type: Boolean, default: !1 },
|
|
3263
|
+
selectedIds: { default: () => /* @__PURE__ */ new Set() },
|
|
3264
|
+
view: { default: "grid" },
|
|
3265
|
+
variantsByRefId: {},
|
|
3266
|
+
unavailableIds: {},
|
|
3267
|
+
unavailableRatio: {}
|
|
3268
|
+
},
|
|
3269
|
+
emits: ["open", "toggle", "delete"],
|
|
3270
|
+
setup(e, { emit: t }) {
|
|
3271
|
+
const { t: a } = he({ messages: be }), n = e;
|
|
3272
|
+
function o(O) {
|
|
3273
|
+
var p;
|
|
3274
|
+
if (Te(O) || !O.refId)
|
|
3275
|
+
return null;
|
|
3276
|
+
const h = (p = n.variantsByRefId) == null ? void 0 : p.get(O.refId);
|
|
3277
|
+
return h ? er(h.variants) : null;
|
|
3278
|
+
}
|
|
3279
|
+
function r(O) {
|
|
3280
|
+
var p;
|
|
3281
|
+
return ((p = n.unavailableIds) == null ? void 0 : p.has(O.id)) ?? !1;
|
|
3282
|
+
}
|
|
3283
|
+
function i(O) {
|
|
3284
|
+
const p = n.unavailableRatio;
|
|
3285
|
+
return !r(O) || !p ? { content: "", disabled: !0 } : {
|
|
3286
|
+
content: Te(O) ? a("mediaPicker.assetGrid.videoUnavailableForRatio", { ratio: Be(p) }) : a("mediaPicker.assetGrid.unavailableForRatio", { ratio: Be(p) }),
|
|
3287
|
+
disabled: !1
|
|
3288
|
+
};
|
|
3289
|
+
}
|
|
3290
|
+
function s(O) {
|
|
3291
|
+
return Te(O) ? Fa(O) : O.url;
|
|
3292
|
+
}
|
|
3293
|
+
function u(O) {
|
|
3294
|
+
return Te(O) && O.durationMs ? It(O.durationMs) : null;
|
|
3295
|
+
}
|
|
3296
|
+
function d(O) {
|
|
3297
|
+
r(O) || v("open", O);
|
|
3298
|
+
}
|
|
3299
|
+
function c(O) {
|
|
3300
|
+
r(O) || v("toggle", O);
|
|
3301
|
+
}
|
|
3302
|
+
function f(O) {
|
|
3303
|
+
return O.tone === "done" ? a("mediaPicker.variants.badgeDone", { count: O.total }) : a("mediaPicker.variants.badgeProgress", { active: O.active, total: O.total });
|
|
3304
|
+
}
|
|
3305
|
+
const v = t;
|
|
3306
|
+
function F(O) {
|
|
3307
|
+
var p;
|
|
3308
|
+
return ((p = O.split("/")[1]) == null ? void 0 : p.toUpperCase()) ?? O;
|
|
3309
|
+
}
|
|
3310
|
+
function P(O) {
|
|
3311
|
+
return O >= 1024 * 1024 ? `${(O / 1024 / 1024).toFixed(1)} MB` : `${Math.round(O / 1024)} KB`;
|
|
3312
|
+
}
|
|
3313
|
+
function S(O) {
|
|
3314
|
+
const p = Date.now() - new Date(O).getTime(), h = 6e4, A = 36e5, D = 864e5;
|
|
3315
|
+
if (p < h)
|
|
3316
|
+
return a("mediaPicker.assetGrid.time.justNow");
|
|
3317
|
+
if (p < A)
|
|
3318
|
+
return a("mediaPicker.assetGrid.time.minutesAgo", { n: Math.floor(p / h) });
|
|
3319
|
+
if (p < D)
|
|
3320
|
+
return a("mediaPicker.assetGrid.time.hoursAgo", { n: Math.floor(p / A) });
|
|
3321
|
+
if (p < D * 8)
|
|
3322
|
+
return a("mediaPicker.assetGrid.time.daysAgo", { n: Math.floor(p / D) });
|
|
3323
|
+
const j = new Date(O);
|
|
3324
|
+
return `${j.getFullYear()}-${String(j.getMonth() + 1).padStart(2, "0")}-${String(j.getDate()).padStart(2, "0")}`;
|
|
3325
|
+
}
|
|
3326
|
+
return (O, p) => {
|
|
3327
|
+
const h = J("FmIcon"), A = J("FmThumbnail"), D = J("FmAvatar"), j = J("FmButton"), X = sa("tooltip");
|
|
3328
|
+
return e.loading ? (b(), k("div", zr, x(m(a)("mediaPicker.assetGrid.loading")), 1)) : e.assets.length === 0 ? (b(), k("div", Vr, x(m(a)("mediaPicker.assetGrid.empty")), 1)) : e.view === "list" ? (b(), k("div", qr, [
|
|
3329
|
+
y("div", {
|
|
3330
|
+
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",
|
|
3331
|
+
style: N({ gridTemplateColumns: m(oa) })
|
|
3332
|
+
}, [
|
|
3333
|
+
p[0] || (p[0] = y("span", null, null, -1)),
|
|
3334
|
+
p[1] || (p[1] = y("span", null, null, -1)),
|
|
3335
|
+
y("span", null, x(m(a)("mediaPicker.assetGrid.columns.name")), 1),
|
|
3336
|
+
y("span", null, x(m(a)("mediaPicker.assetGrid.columns.dimensions")), 1),
|
|
3337
|
+
y("span", null, x(m(a)("mediaPicker.assetGrid.columns.fileSize")), 1),
|
|
3338
|
+
y("span", null, x(m(a)("mediaPicker.assetGrid.columns.uploader")), 1),
|
|
3339
|
+
y("span", null, x(m(a)("mediaPicker.assetGrid.columns.uploadedAt")), 1),
|
|
3340
|
+
p[2] || (p[2] = y("span", null, null, -1))
|
|
3341
|
+
], 4),
|
|
3342
|
+
(b(!0), k(Y, null, me(e.assets, (E) => et((b(), k("div", {
|
|
3343
|
+
key: E.id,
|
|
3344
|
+
class: Z(["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(E) ? "opacity-40 cursor-not-allowed" : "cursor-pointer"]),
|
|
3345
|
+
style: N({
|
|
3346
|
+
gridTemplateColumns: m(oa),
|
|
3347
|
+
...e.selectedIds.has(E.id) ? { background: m(Ft) } : {}
|
|
3348
|
+
}),
|
|
3349
|
+
onClick: (oe) => d(E)
|
|
3350
|
+
}, [
|
|
3351
|
+
e.selectable ? (b(), k("button", {
|
|
3352
|
+
key: 0,
|
|
3353
|
+
class: Z(["rounded flex items-center justify-center", e.selectedIds.has(E.id) ? "" : "bg-white border border-fm-color-neutral-gray-200"]),
|
|
3354
|
+
style: N({
|
|
3355
|
+
width: "20px",
|
|
3356
|
+
height: "20px",
|
|
3357
|
+
...e.selectedIds.has(E.id) ? { background: m(pe) } : {}
|
|
3358
|
+
}),
|
|
3359
|
+
onClick: ct((oe) => c(E), ["stop"])
|
|
3360
|
+
}, [
|
|
3361
|
+
e.selectedIds.has(E.id) ? (b(), ne(h, {
|
|
3362
|
+
key: 0,
|
|
3363
|
+
name: "check",
|
|
3364
|
+
size: "sm",
|
|
3365
|
+
color: "white"
|
|
3366
|
+
})) : U("", !0)
|
|
3367
|
+
], 14, Wr)) : (b(), k("span", Gr)),
|
|
3368
|
+
y("div", Hr, [
|
|
3369
|
+
s(E) ? (b(), ne(A, {
|
|
3370
|
+
key: 0,
|
|
3371
|
+
src: s(E),
|
|
3372
|
+
size: "sm",
|
|
3373
|
+
class: "!w-full !h-full"
|
|
3374
|
+
}, null, 8, ["src"])) : (b(), k("div", Jr, [
|
|
3375
|
+
V(h, {
|
|
3376
|
+
name: "movie",
|
|
3377
|
+
size: "sm"
|
|
3378
|
+
})
|
|
3379
|
+
]))
|
|
3380
|
+
]),
|
|
3381
|
+
y("div", Kr, [
|
|
3382
|
+
y("span", Xr, x(E.fileName), 1),
|
|
3383
|
+
y("div", Qr, [
|
|
3384
|
+
y("span", {
|
|
3385
|
+
class: "text-fm-color-typo-tertiary",
|
|
3386
|
+
style: N(m(H))
|
|
3387
|
+
}, x(F(E.mimeType)), 5),
|
|
3388
|
+
u(E) ? (b(), k("span", {
|
|
3389
|
+
key: 0,
|
|
3390
|
+
class: "text-fm-color-typo-tertiary",
|
|
3391
|
+
style: N(m(H))
|
|
3392
|
+
}, x(u(E)), 5)) : U("", !0),
|
|
3393
|
+
o(E) ? (b(), k("span", {
|
|
3394
|
+
key: 1,
|
|
3395
|
+
class: Z(["font-semibold", {
|
|
3396
|
+
"text-fm-color-typo-tertiary": o(E).tone === "done",
|
|
3397
|
+
"text-blue-600": o(E).tone === "progress",
|
|
3398
|
+
"text-amber-600": o(E).tone === "warning"
|
|
3399
|
+
}]),
|
|
3400
|
+
style: N(m(H))
|
|
3401
|
+
}, x(f(o(E))), 7)) : U("", !0)
|
|
3402
|
+
])
|
|
3403
|
+
]),
|
|
3404
|
+
y("span", Yr, x(m(ze)(E) ?? "—"), 1),
|
|
3405
|
+
y("span", Zr, x(P(E.fileSizeBytes)), 1),
|
|
3406
|
+
y("div", ei, [
|
|
3407
|
+
V(D, {
|
|
3408
|
+
name: E.uploadedBy,
|
|
3409
|
+
size: "sm"
|
|
3410
|
+
}, null, 8, ["name"]),
|
|
3411
|
+
y("span", ti, x(E.uploadedBy), 1)
|
|
3412
|
+
]),
|
|
3413
|
+
y("span", ai, x(S(E.createdAt)), 1),
|
|
3414
|
+
V(j, {
|
|
3415
|
+
variant: "tertiary",
|
|
3416
|
+
size: "md",
|
|
3417
|
+
"prepend-icon": "delete",
|
|
3418
|
+
label: "",
|
|
3419
|
+
onClick: ct((oe) => v("delete", E), ["stop"])
|
|
3420
|
+
}, null, 8, ["onClick"])
|
|
3421
|
+
], 14, $r)), [
|
|
3422
|
+
[X, i(E)]
|
|
3423
|
+
])), 128))
|
|
3424
|
+
])) : (b(), k("div", ni, [
|
|
3425
|
+
(b(!0), k(Y, null, me(e.assets, (E) => et((b(), k("div", {
|
|
3426
|
+
key: E.id,
|
|
3427
|
+
class: Z(["rounded-lg border bg-white overflow-hidden transition-shadow hover:shadow-lg", [
|
|
3428
|
+
e.selectedIds.has(E.id) ? "border-2" : "border-gray-200",
|
|
3429
|
+
r(E) ? "opacity-40 cursor-not-allowed" : "cursor-pointer"
|
|
3430
|
+
]]),
|
|
3431
|
+
style: N(e.selectedIds.has(E.id) ? { borderColor: m(pe) } : {}),
|
|
3432
|
+
onClick: (oe) => d(E)
|
|
3433
|
+
}, [
|
|
3434
|
+
y("div", ri, [
|
|
3435
|
+
s(E) ? (b(), ne(A, {
|
|
3436
|
+
key: 0,
|
|
3437
|
+
src: s(E),
|
|
3438
|
+
size: "xl",
|
|
3439
|
+
class: "w-full h-full"
|
|
3440
|
+
}, null, 8, ["src"])) : (b(), k("div", ii, [
|
|
3441
|
+
V(h, {
|
|
3442
|
+
name: "movie",
|
|
3443
|
+
size: "lg"
|
|
3444
|
+
}),
|
|
3445
|
+
y("span", {
|
|
3446
|
+
style: N(m(H))
|
|
3447
|
+
}, x(m(a)("mediaPicker.assetGrid.noPoster")), 5)
|
|
3448
|
+
])),
|
|
3449
|
+
m(Te)(E) ? (b(), k("div", si, [
|
|
3450
|
+
y("span", li, [
|
|
3451
|
+
V(h, {
|
|
3452
|
+
name: "play_arrow",
|
|
3453
|
+
size: "md",
|
|
3454
|
+
color: "white"
|
|
3455
|
+
})
|
|
3456
|
+
])
|
|
3457
|
+
])) : U("", !0),
|
|
3458
|
+
e.selectable ? (b(), k("button", {
|
|
3459
|
+
key: 3,
|
|
3460
|
+
class: Z(["absolute top-8 left-8 z-10 w-24 h-24 rounded-full flex items-center justify-center", e.selectedIds.has(E.id) ? "" : "bg-black/30 border border-white/80"]),
|
|
3461
|
+
style: N(e.selectedIds.has(E.id) ? { background: m(pe) } : {}),
|
|
3462
|
+
onClick: ct((oe) => c(E), ["stop"])
|
|
3463
|
+
}, [
|
|
3464
|
+
e.selectedIds.has(E.id) ? (b(), ne(h, {
|
|
3465
|
+
key: 0,
|
|
3466
|
+
name: "check",
|
|
3467
|
+
size: "sm",
|
|
3468
|
+
color: "white"
|
|
3469
|
+
})) : U("", !0)
|
|
3470
|
+
], 14, ui)) : U("", !0),
|
|
3471
|
+
y("span", {
|
|
3472
|
+
class: "absolute bottom-8 left-8 bg-black/70 text-white font-semibold rounded",
|
|
3473
|
+
style: N([m(H), m(ht)])
|
|
3474
|
+
}, x(F(E.mimeType)), 5),
|
|
3475
|
+
u(E) ? (b(), k("span", {
|
|
3476
|
+
key: 4,
|
|
3477
|
+
class: "absolute bottom-8 right-8 bg-black/70 text-white font-semibold rounded",
|
|
3478
|
+
style: N([m(H), m(ht)])
|
|
3479
|
+
}, x(u(E)), 5)) : U("", !0),
|
|
3480
|
+
o(E) ? (b(), k("span", {
|
|
3481
|
+
key: 5,
|
|
3482
|
+
class: Z(["absolute bottom-8 right-8 text-white font-semibold rounded", {
|
|
3483
|
+
"bg-black/70": o(E).tone === "done",
|
|
3484
|
+
"bg-blue-600/90": o(E).tone === "progress",
|
|
3485
|
+
"bg-amber-600/90": o(E).tone === "warning"
|
|
3486
|
+
}]),
|
|
3487
|
+
style: N([m(H), m(ht)])
|
|
3488
|
+
}, x(f(o(E))), 7)) : U("", !0)
|
|
3489
|
+
]),
|
|
3490
|
+
y("div", ci, [
|
|
3491
|
+
y("div", di, x(E.fileName), 1),
|
|
3492
|
+
y("span", {
|
|
3493
|
+
class: "text-gray-500 truncate",
|
|
3494
|
+
style: N(m(H))
|
|
3495
|
+
}, [
|
|
3496
|
+
m(ze)(E) ? (b(), k(Y, { key: 0 }, [
|
|
3497
|
+
se(x(m(ze)(E)) + " · ", 1)
|
|
3498
|
+
], 64)) : U("", !0),
|
|
3499
|
+
se(x(P(E.fileSizeBytes)), 1)
|
|
3500
|
+
], 4)
|
|
3501
|
+
])
|
|
3502
|
+
], 14, oi)), [
|
|
3503
|
+
[X, i(E)]
|
|
3504
|
+
])), 128))
|
|
3505
|
+
]));
|
|
3506
|
+
};
|
|
3507
|
+
}
|
|
3508
|
+
}), fi = { class: "flex flex-wrap items-center gap-8" }, mi = /* @__PURE__ */ ge({
|
|
3509
|
+
__name: "TagFilterTabs",
|
|
3510
|
+
props: {
|
|
3511
|
+
tags: {},
|
|
3512
|
+
total: {},
|
|
3513
|
+
modelValue: {}
|
|
3514
|
+
},
|
|
3515
|
+
emits: ["update:modelValue"],
|
|
3516
|
+
setup(e, { emit: t }) {
|
|
3517
|
+
const { t: a } = he({ messages: be }), n = t;
|
|
3518
|
+
return (o, r) => {
|
|
3519
|
+
const i = J("FmChip");
|
|
3520
|
+
return b(), k("div", fi, [
|
|
3521
|
+
V(i, {
|
|
3522
|
+
selectable: "",
|
|
3523
|
+
selected: e.modelValue === null,
|
|
3524
|
+
onClick: r[0] || (r[0] = (s) => n("update:modelValue", null))
|
|
3525
|
+
}, {
|
|
3526
|
+
default: Oe(() => [
|
|
3527
|
+
y("span", {
|
|
3528
|
+
class: Z(["fm-typo-en-body-md-600 flex items-center gap-6", { "text-white": e.modelValue === null }])
|
|
3529
|
+
}, [
|
|
3530
|
+
se(x(m(a)("mediaPicker.tagFilterTabs.all")) + " ", 1),
|
|
3531
|
+
y("span", {
|
|
3532
|
+
class: Z(["leading-none rounded-full px-6 py-2", e.modelValue === null ? "bg-white/25" : "bg-fm-color-neutral-gray-100"]),
|
|
3533
|
+
style: N(m(H))
|
|
3534
|
+
}, x(e.total), 7)
|
|
3535
|
+
], 2)
|
|
3536
|
+
]),
|
|
3537
|
+
_: 1
|
|
3538
|
+
}, 8, ["selected"]),
|
|
3539
|
+
(b(!0), k(Y, null, me(e.tags, (s) => (b(), ne(i, {
|
|
3540
|
+
key: s.tag,
|
|
3541
|
+
selectable: "",
|
|
3542
|
+
selected: e.modelValue === s.tag,
|
|
3543
|
+
onClick: (u) => n("update:modelValue", e.modelValue === s.tag ? null : s.tag)
|
|
3544
|
+
}, {
|
|
3545
|
+
default: Oe(() => [
|
|
3546
|
+
y("span", {
|
|
3547
|
+
class: Z(["fm-typo-en-body-md-600 flex items-center gap-6", { "text-white": e.modelValue === s.tag }])
|
|
3548
|
+
}, [
|
|
3549
|
+
se(x(s.tag) + " ", 1),
|
|
3550
|
+
y("span", {
|
|
3551
|
+
class: Z(["leading-none rounded-full px-6 py-2", e.modelValue === s.tag ? "bg-white/25" : "bg-fm-color-neutral-gray-100"]),
|
|
3552
|
+
style: N(m(H))
|
|
3553
|
+
}, x(s.count), 7)
|
|
3554
|
+
], 2)
|
|
3555
|
+
]),
|
|
3556
|
+
_: 2
|
|
3557
|
+
}, 1032, ["selected", "onClick"]))), 128))
|
|
3558
|
+
]);
|
|
3559
|
+
};
|
|
3560
|
+
}
|
|
3561
|
+
}), gi = { class: "flex items-center gap-12 py-4 px-2" }, hi = { class: "text-xs font-semibold text-fm-color-typo-secondary shrink-0" }, bi = { class: "flex flex-wrap items-center gap-6" }, yi = ["onClick"], vi = {
|
|
3562
|
+
key: 0,
|
|
3563
|
+
class: "text-xs text-fm-color-typo-secondary shrink-0"
|
|
3564
|
+
}, wi = /* @__PURE__ */ ge({
|
|
3565
|
+
__name: "RatioPickerBar",
|
|
3566
|
+
props: /* @__PURE__ */ bt({
|
|
3567
|
+
facts: {},
|
|
3568
|
+
locked: { type: Boolean },
|
|
3569
|
+
unavailableRatios: {}
|
|
3570
|
+
}, {
|
|
3571
|
+
modelValue: { default: null },
|
|
3572
|
+
modelModifiers: {}
|
|
3573
|
+
}),
|
|
3574
|
+
emits: ["update:modelValue"],
|
|
3575
|
+
setup(e) {
|
|
3576
|
+
const { t } = he({ messages: be }), a = e, n = la(e, "modelValue");
|
|
3577
|
+
function o(u) {
|
|
3578
|
+
var d;
|
|
3579
|
+
a.locked || u !== null && (d = a.unavailableRatios) != null && d.has(u) || (n.value = u);
|
|
3580
|
+
}
|
|
3581
|
+
function r(u, d) {
|
|
3582
|
+
var c;
|
|
3583
|
+
return d !== void 0 && ((c = a.unavailableRatios) != null && c.has(d)) ? "border-fm-color-neutral-gray-200 text-fm-color-neutral-gray-300 cursor-not-allowed opacity-40" : [
|
|
3584
|
+
u ? "" : "border-fm-color-neutral-gray-300 text-gray-500",
|
|
3585
|
+
a.locked ? "cursor-not-allowed opacity-60" : ""
|
|
3586
|
+
];
|
|
3587
|
+
}
|
|
3588
|
+
function i(u) {
|
|
3589
|
+
var d;
|
|
3590
|
+
const c = u !== void 0 && (((d = a.unavailableRatios) == null ? void 0 : d.has(u)) ?? !1);
|
|
3591
|
+
return {
|
|
3592
|
+
content: c && u ? t("mediaPicker.ratioBar.unavailableForSelection", { ratio: Be(u) }) : "",
|
|
3593
|
+
disabled: !c
|
|
3594
|
+
};
|
|
3595
|
+
}
|
|
3596
|
+
function s(u, d) {
|
|
3597
|
+
var c;
|
|
3598
|
+
const f = d !== void 0 && ((c = a.unavailableRatios) == null ? void 0 : c.has(d));
|
|
3599
|
+
return [
|
|
3600
|
+
"height:28px",
|
|
3601
|
+
H,
|
|
3602
|
+
u && !f ? { borderColor: pe, color: pe, background: Ft } : {}
|
|
3603
|
+
];
|
|
3604
|
+
}
|
|
3605
|
+
return (u, d) => {
|
|
3606
|
+
const c = sa("tooltip");
|
|
3607
|
+
return b(), k("div", gi, [
|
|
3608
|
+
y("span", hi, x(m(t)("mediaPicker.ratioBar.label")), 1),
|
|
3609
|
+
y("div", bi, [
|
|
3610
|
+
y("button", {
|
|
3611
|
+
type: "button",
|
|
3612
|
+
class: Z(["px-12 rounded-full border font-semibold transition-colors", r(n.value === null)]),
|
|
3613
|
+
style: N(s(n.value === null)),
|
|
3614
|
+
onClick: d[0] || (d[0] = (f) => o(null))
|
|
3615
|
+
}, x(m(t)("mediaPicker.variants.original")), 7),
|
|
3616
|
+
(b(!0), k(Y, null, me(m(Dt), (f) => et((b(), k("button", {
|
|
3617
|
+
key: f,
|
|
3618
|
+
type: "button",
|
|
3619
|
+
class: Z(["px-12 rounded-full border font-semibold transition-colors", r(n.value === f, f)]),
|
|
3620
|
+
style: N(s(n.value === f, f)),
|
|
3621
|
+
onClick: (v) => o(f)
|
|
3622
|
+
}, [
|
|
3623
|
+
se(x(m(Be)(f)), 1)
|
|
3624
|
+
], 14, yi)), [
|
|
3625
|
+
[c, i(f)]
|
|
3626
|
+
])), 128))
|
|
3627
|
+
]),
|
|
3628
|
+
d[1] || (d[1] = y("div", { class: "flex-1" }, null, -1)),
|
|
3629
|
+
e.facts ? (b(), k("span", vi, x(e.facts.dimensions) + " · " + x(m(nr)(e.facts.sizeBytes)), 1)) : U("", !0)
|
|
3630
|
+
]);
|
|
3631
|
+
};
|
|
3632
|
+
}
|
|
3633
|
+
});
|
|
3634
|
+
function Ua(e) {
|
|
3635
|
+
var t, a;
|
|
3636
|
+
const n = (a = (t = e == null ? void 0 : e.response) == null ? void 0 : t.data) == null ? void 0 : a.message;
|
|
3637
|
+
return n || (e instanceof Error ? e.message : (e == null ? void 0 : e.message) || String(e));
|
|
3638
|
+
}
|
|
3639
|
+
function ki(e) {
|
|
3640
|
+
switch (e) {
|
|
3641
|
+
case "INSUFFICIENT_TOKENS":
|
|
3642
|
+
return "mediaPicker.variants.failedNoTokens";
|
|
3643
|
+
case "TOKEN_SERVICE_UNAVAILABLE":
|
|
3644
|
+
return "mediaPicker.variants.failedTokenServiceDown";
|
|
3645
|
+
default:
|
|
3646
|
+
return "mediaPicker.variants.failed";
|
|
3647
|
+
}
|
|
3648
|
+
}
|
|
3649
|
+
const xi = { class: "space-y-8" }, Pi = { class: "text-xs font-semibold text-gray-500" }, Ti = { class: "flex flex-wrap gap-8" }, Si = ["onClick"], Ei = /* @__PURE__ */ ge({
|
|
3650
|
+
__name: "RatioSelector",
|
|
3651
|
+
props: {
|
|
3652
|
+
modelValue: {},
|
|
3653
|
+
disabled: { type: Boolean }
|
|
3654
|
+
},
|
|
3655
|
+
emits: ["update:modelValue"],
|
|
3656
|
+
setup(e, { emit: t }) {
|
|
3657
|
+
const { t: a } = he({ messages: be }), n = e, o = t;
|
|
3658
|
+
function r(i) {
|
|
3659
|
+
n.disabled || o(
|
|
3660
|
+
"update:modelValue",
|
|
3661
|
+
n.modelValue.includes(i) ? n.modelValue.filter((s) => s !== i) : [...n.modelValue, i]
|
|
3662
|
+
);
|
|
3663
|
+
}
|
|
3664
|
+
return (i, s) => (b(), k("div", xi, [
|
|
3665
|
+
y("div", Pi, x(m(a)("mediaPicker.ratios.title")), 1),
|
|
3666
|
+
y("div", Ti, [
|
|
3667
|
+
(b(!0), k(Y, null, me(m(Dt), (u) => (b(), k("button", {
|
|
3668
|
+
key: u,
|
|
3669
|
+
type: "button",
|
|
3670
|
+
class: Z(["px-12 rounded-full border font-semibold transition-colors", [
|
|
3671
|
+
e.modelValue.includes(u) ? "" : "border-fm-color-neutral-gray-300 text-gray-500",
|
|
3672
|
+
e.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
3673
|
+
]]),
|
|
3674
|
+
style: N([
|
|
3675
|
+
"height:30px",
|
|
3676
|
+
m(H),
|
|
3677
|
+
e.modelValue.includes(u) ? { borderColor: m(pe), color: m(pe), background: m(Ft) } : {}
|
|
3678
|
+
]),
|
|
3679
|
+
onClick: (d) => r(u)
|
|
3680
|
+
}, x(m(Be)(u)), 15, Si))), 128))
|
|
3681
|
+
]),
|
|
3682
|
+
y("div", {
|
|
3683
|
+
class: "text-gray-400",
|
|
3684
|
+
style: N(m(H))
|
|
3685
|
+
}, x(m(a)("mediaPicker.ratios.hint")), 5)
|
|
3686
|
+
]));
|
|
3687
|
+
}
|
|
3688
|
+
});
|
|
3689
|
+
function ra(e) {
|
|
3690
|
+
return new Promise((t) => {
|
|
3691
|
+
const a = new Image();
|
|
3692
|
+
a.onload = () => t({ width: a.naturalWidth || 480, height: a.naturalHeight || 360 }), a.onerror = () => t({ width: 480, height: 360 }), a.src = e;
|
|
3693
|
+
});
|
|
3694
|
+
}
|
|
3695
|
+
const Ci = { class: "flex flex-wrap items-center gap-8" }, Oi = {
|
|
3696
|
+
key: 1,
|
|
3697
|
+
class: "inline-flex items-center gap-4 border rounded-full border-gray-300 pl-8 pr-4",
|
|
3698
|
+
style: { height: "28px" }
|
|
3699
|
+
}, Ri = ["placeholder"], Ai = /* @__PURE__ */ ge({
|
|
3700
|
+
__name: "TagFilterBar",
|
|
3701
|
+
props: {
|
|
3702
|
+
tags: {},
|
|
3703
|
+
modelValue: {},
|
|
3704
|
+
mode: { default: "filter" }
|
|
3705
|
+
},
|
|
3706
|
+
emits: ["update:modelValue", "tag-created"],
|
|
3707
|
+
setup(e, { emit: t }) {
|
|
3708
|
+
const { t: a } = he({ messages: be }), n = e, o = t;
|
|
3709
|
+
function r(u) {
|
|
3710
|
+
o("update:modelValue", n.modelValue.includes(u) ? n.modelValue.filter((d) => d !== u) : [...n.modelValue, u]);
|
|
3711
|
+
}
|
|
3712
|
+
const i = G("");
|
|
3713
|
+
function s() {
|
|
3714
|
+
const u = i.value.trim();
|
|
3715
|
+
i.value = "", u && (n.modelValue.includes(u) || o("update:modelValue", [...n.modelValue, u]), n.tags.includes(u) || o("tag-created", u));
|
|
3716
|
+
}
|
|
3717
|
+
return (u, d) => {
|
|
3718
|
+
const c = J("FmChip"), f = J("FmIcon");
|
|
3719
|
+
return b(), k("div", Ci, [
|
|
3720
|
+
e.mode === "filter" ? (b(), ne(c, {
|
|
3721
|
+
key: 0,
|
|
3722
|
+
label: m(a)("mediaPicker.tagFilterBar.all"),
|
|
3723
|
+
selected: e.modelValue.length === 0,
|
|
3724
|
+
selectable: "",
|
|
3725
|
+
onClick: d[0] || (d[0] = (v) => o("update:modelValue", []))
|
|
3726
|
+
}, null, 8, ["label", "selected"])) : U("", !0),
|
|
3727
|
+
(b(!0), k(Y, null, me(e.tags, (v) => (b(), ne(c, {
|
|
3728
|
+
key: v,
|
|
3729
|
+
label: v,
|
|
3730
|
+
selected: e.modelValue.includes(v),
|
|
3731
|
+
selectable: "",
|
|
3732
|
+
onClick: (F) => r(v)
|
|
3733
|
+
}, null, 8, ["label", "selected", "onClick"]))), 128)),
|
|
3734
|
+
e.mode === "assign" ? (b(), k("div", Oi, [
|
|
3735
|
+
et(y("input", {
|
|
3736
|
+
"onUpdate:modelValue": d[1] || (d[1] = (v) => i.value = v),
|
|
3737
|
+
placeholder: m(a)("mediaPicker.tagFilterBar.newTagPlaceholder"),
|
|
3738
|
+
class: "text-xs outline-none",
|
|
3739
|
+
style: { width: "88px" },
|
|
3740
|
+
onKeyup: za(s, ["enter"])
|
|
3741
|
+
}, null, 40, Ri), [
|
|
3742
|
+
[Va, i.value]
|
|
3743
|
+
]),
|
|
3744
|
+
y("button", {
|
|
3745
|
+
class: "p-2",
|
|
3746
|
+
onClick: s
|
|
3747
|
+
}, [
|
|
3748
|
+
V(f, {
|
|
3749
|
+
name: "add",
|
|
3750
|
+
size: "sm"
|
|
3751
|
+
})
|
|
3752
|
+
])
|
|
3753
|
+
])) : U("", !0)
|
|
3754
|
+
]);
|
|
3755
|
+
};
|
|
3756
|
+
}
|
|
3757
|
+
}), Bi = { class: "space-y-16" }, Di = {
|
|
3758
|
+
key: 2,
|
|
3759
|
+
class: "space-y-8"
|
|
3760
|
+
}, _i = { class: "text-xs font-semibold text-gray-500" }, Fi = ["src"], Ii = {
|
|
3761
|
+
key: 1,
|
|
3762
|
+
class: "rounded flex-shrink-0 flex items-center justify-center bg-fm-color-neutral-gray-100 text-gray-400",
|
|
3763
|
+
style: { width: "44px", height: "44px" }
|
|
3764
|
+
}, Li = { class: "flex-1 min-w-0 flex flex-col gap-2" }, Ni = { class: "text-xs font-semibold truncate" }, Ui = ["onClick"], Mi = { class: "space-y-8" }, ji = { class: "text-xs font-semibold text-gray-500" }, zi = {
|
|
3765
|
+
key: 0,
|
|
3766
|
+
class: "flex flex-wrap items-center gap-8"
|
|
3767
|
+
}, Vi = ["onClick"], qi = 10 * 1024 * 1024, ia = 512 * 1024 * 1024, $i = /* @__PURE__ */ ge({
|
|
3768
|
+
__name: "UploadPanel",
|
|
3769
|
+
props: {
|
|
3770
|
+
businessId: {},
|
|
3771
|
+
restaurantId: {},
|
|
3772
|
+
availableTags: {}
|
|
3773
|
+
},
|
|
3774
|
+
emits: ["tag-created", "uploaded"],
|
|
3775
|
+
setup(e, { expose: t, emit: a }) {
|
|
3776
|
+
const n = ["image/jpeg", "image/png", "image/webp", ...Mr].join(","), { t: o } = he({ messages: be }), r = e, i = a, s = G([]), u = G([]), d = G([]), c = G(!1), f = W(() => s.value.length), v = W(() => r.availableTags.filter((g) => !u.value.includes(g)).slice(0, 6)), F = W(() => s.value.some((g) => g.isVideo)), P = W(() => s.value.some((g) => !g.isVideo));
|
|
3777
|
+
function S(g) {
|
|
3778
|
+
URL.revokeObjectURL(g.previewUrl), g.posterPreviewUrl && URL.revokeObjectURL(g.posterPreviewUrl);
|
|
3779
|
+
}
|
|
3780
|
+
function O() {
|
|
3781
|
+
s.value.forEach(S), s.value = [], u.value = [], d.value = [];
|
|
3782
|
+
}
|
|
3783
|
+
async function p(g) {
|
|
3784
|
+
const _ = URL.createObjectURL(g), M = jr(g), I = {
|
|
3785
|
+
id: crypto.randomUUID(),
|
|
3786
|
+
refId: crypto.randomUUID(),
|
|
3787
|
+
file: g,
|
|
3788
|
+
previewUrl: _,
|
|
3789
|
+
dimensions: null,
|
|
3790
|
+
error: null,
|
|
3791
|
+
isVideo: M,
|
|
3792
|
+
durationMs: null,
|
|
3793
|
+
poster: null,
|
|
3794
|
+
posterPreviewUrl: null,
|
|
3795
|
+
probed: !1
|
|
3796
|
+
};
|
|
3797
|
+
s.value.push(I);
|
|
3798
|
+
const R = M ? ia : qi;
|
|
3799
|
+
if (g.size > R) {
|
|
3800
|
+
I.error = o("mediaPicker.uploadPanel.fileTooLargeError", { limit: j(R) }), I.probed = !0;
|
|
3801
|
+
return;
|
|
3802
|
+
}
|
|
3803
|
+
if (!M) {
|
|
3804
|
+
I.dimensions = await ra(_), I.probed = !0;
|
|
3805
|
+
return;
|
|
3806
|
+
}
|
|
3807
|
+
const T = await Nr(_);
|
|
3808
|
+
T && (I.dimensions = { width: T.width, height: T.height }, I.durationMs = T.durationMs, I.poster = await Ur(_), I.poster && (I.posterPreviewUrl = URL.createObjectURL(I.poster))), I.probed = !0;
|
|
3809
|
+
}
|
|
3810
|
+
function h(g) {
|
|
3811
|
+
return g.isVideo && g.probed && g.dimensions === null;
|
|
3812
|
+
}
|
|
3813
|
+
function A(g) {
|
|
3814
|
+
return g.durationMs === null ? null : It(g.durationMs);
|
|
3815
|
+
}
|
|
3816
|
+
function D(g) {
|
|
3817
|
+
const _ = s.value.find((M) => M.id === g);
|
|
3818
|
+
_ && S(_), s.value = s.value.filter((M) => M.id !== g);
|
|
3819
|
+
}
|
|
3820
|
+
function j(g) {
|
|
3821
|
+
return g >= 1024 * 1024 ? `${(g / 1024 / 1024).toFixed(1)} MB` : `${Math.round(g / 1024)} KB`;
|
|
3822
|
+
}
|
|
3823
|
+
async function X(g) {
|
|
3824
|
+
const _ = g.isVideo ? await E(g) : await oe(g);
|
|
3825
|
+
return u.value.length ? await lr(r.businessId, _.id, u.value) : _;
|
|
3826
|
+
}
|
|
3827
|
+
async function E(g) {
|
|
3828
|
+
const _ = g.dimensions ? { width: g.dimensions.width, height: g.dimensions.height, durationMs: g.durationMs ?? 0 } : { width: 0, height: 0, durationMs: 0 }, M = g.file.type, I = await gr(r.businessId, {
|
|
3829
|
+
refType: je,
|
|
3830
|
+
refId: g.refId,
|
|
3831
|
+
videoId: "main",
|
|
3832
|
+
contentType: M,
|
|
3833
|
+
fileSize: g.file.size
|
|
3834
|
+
}), R = await fetch(I.uploadUrl, {
|
|
3835
|
+
method: "PUT",
|
|
3836
|
+
headers: { "Content-Type": M },
|
|
3837
|
+
body: g.file
|
|
3838
|
+
});
|
|
3839
|
+
if (!R.ok)
|
|
3840
|
+
throw new Error(o("mediaPicker.uploadPanel.uploadFailedError", { status: R.status }));
|
|
3841
|
+
if (g.poster)
|
|
3842
|
+
try {
|
|
3843
|
+
await fetch(I.posterUploadUrl, {
|
|
3844
|
+
method: "PUT",
|
|
3845
|
+
headers: { "Content-Type": I.posterContentType },
|
|
3846
|
+
body: g.poster
|
|
3847
|
+
});
|
|
3848
|
+
} catch {
|
|
3849
|
+
}
|
|
3850
|
+
return (await hr(r.businessId, {
|
|
3851
|
+
refType: je,
|
|
3852
|
+
refId: g.refId,
|
|
3853
|
+
videoId: "main",
|
|
3854
|
+
restaurantId: r.restaurantId,
|
|
3855
|
+
fileName: g.file.name,
|
|
3856
|
+
// The same value the intent was signed for, and the same one the PUT sent. It is what
|
|
3857
|
+
// locates the object server-side, because the key ends in an extension derived from it.
|
|
3858
|
+
contentType: M,
|
|
3859
|
+
width: _.width,
|
|
3860
|
+
height: _.height,
|
|
3861
|
+
durationMs: _.durationMs
|
|
3862
|
+
})).asset;
|
|
3863
|
+
}
|
|
3864
|
+
async function oe(g) {
|
|
3865
|
+
const _ = g.dimensions ?? await ra(g.previewUrl), M = g.file.type || "image/jpeg", I = await fr(r.businessId, {
|
|
3866
|
+
refType: je,
|
|
3867
|
+
refId: g.refId,
|
|
3868
|
+
imageId: "main",
|
|
3869
|
+
contentType: M,
|
|
3870
|
+
fileSize: g.file.size
|
|
3871
|
+
}), R = await fetch(I.uploadUrl, { method: "PUT", headers: { "Content-Type": M }, body: g.file });
|
|
3872
|
+
if (!R.ok)
|
|
3873
|
+
throw new Error(o("mediaPicker.uploadPanel.uploadFailedError", { status: R.status }));
|
|
3874
|
+
return (await mr(r.businessId, {
|
|
3875
|
+
refType: je,
|
|
3876
|
+
refId: g.refId,
|
|
3877
|
+
imageId: "main",
|
|
3878
|
+
restaurantId: r.restaurantId,
|
|
3879
|
+
fileName: g.file.name,
|
|
3880
|
+
width: _.width,
|
|
3881
|
+
height: _.height,
|
|
3882
|
+
aspectRatios: d.value
|
|
3883
|
+
})).asset;
|
|
3884
|
+
}
|
|
3885
|
+
async function B() {
|
|
3886
|
+
if (!(!s.value.length || !r.businessId)) {
|
|
3887
|
+
c.value = !0;
|
|
3888
|
+
try {
|
|
3889
|
+
const g = s.value, _ = g.filter((w) => !w.error), M = g.filter((w) => w.error);
|
|
3890
|
+
if (!_.length)
|
|
3891
|
+
return;
|
|
3892
|
+
const I = await Promise.allSettled(_.map(X)), R = /* @__PURE__ */ new Set(), T = [];
|
|
3893
|
+
I.forEach((w, Q) => {
|
|
3894
|
+
w.status === "rejected" ? (R.add(_[Q].id), _[Q].error = Ua(w.reason)) : T.push(w.value);
|
|
3895
|
+
}), s.value = [...M, ..._.filter((w) => R.has(w.id))], T.length > 0 && i("uploaded", T);
|
|
3896
|
+
} finally {
|
|
3897
|
+
c.value = !1;
|
|
3898
|
+
}
|
|
3899
|
+
}
|
|
3900
|
+
}
|
|
3901
|
+
return t({ stagedCount: f, uploading: c, upload: B, reset: O }), (g, _) => {
|
|
3902
|
+
const M = J("FmDropField"), I = J("FmIcon");
|
|
3903
|
+
return b(), k("div", Bi, [
|
|
3904
|
+
V(M, {
|
|
3905
|
+
label: m(o)("mediaPicker.uploadPanel.dropLabel"),
|
|
3906
|
+
accept: m(n),
|
|
3907
|
+
"max-file-size": ia,
|
|
3908
|
+
onFileUpload: p
|
|
3909
|
+
}, {
|
|
3910
|
+
"helper-text": Oe(() => [
|
|
3911
|
+
se(x(m(o)("mediaPicker.uploadPanel.helperText")), 1)
|
|
3912
|
+
]),
|
|
3913
|
+
_: 1
|
|
3914
|
+
}, 8, ["label", "accept"]),
|
|
3915
|
+
P.value || !F.value ? (b(), ne(Ei, {
|
|
3916
|
+
key: 0,
|
|
3917
|
+
modelValue: d.value,
|
|
3918
|
+
"onUpdate:modelValue": _[0] || (_[0] = (R) => d.value = R),
|
|
3919
|
+
disabled: c.value
|
|
3920
|
+
}, null, 8, ["modelValue", "disabled"])) : U("", !0),
|
|
3921
|
+
F.value && P.value ? (b(), k("div", {
|
|
3922
|
+
key: 1,
|
|
3923
|
+
class: "text-gray-500",
|
|
3924
|
+
style: N(m(H))
|
|
3925
|
+
}, x(m(o)("mediaPicker.uploadPanel.videoNoRatiosNote")), 5)) : U("", !0),
|
|
3926
|
+
s.value.length ? (b(), k("div", Di, [
|
|
3927
|
+
y("div", _i, x(m(o)("mediaPicker.uploadPanel.stagedCount", { count: s.value.length })), 1),
|
|
3928
|
+
(b(!0), k(Y, null, me(s.value, (R) => (b(), k("div", {
|
|
3929
|
+
key: R.id,
|
|
3930
|
+
class: Z(["flex items-center gap-12 p-8 border rounded-lg", R.error ? "border-red-300 bg-red-50" : "border-fm-color-neutral-gray-200"]),
|
|
3931
|
+
style: N(h(R) && !R.error ? m(vr) : void 0)
|
|
3932
|
+
}, [
|
|
3933
|
+
!R.isVideo || R.posterPreviewUrl ? (b(), k("img", {
|
|
3934
|
+
key: 0,
|
|
3935
|
+
src: R.isVideo ? R.posterPreviewUrl : R.previewUrl,
|
|
3936
|
+
class: "rounded flex-shrink-0 object-cover",
|
|
3937
|
+
style: { width: "44px", height: "44px" }
|
|
3938
|
+
}, null, 8, Fi)) : (b(), k("div", Ii, [
|
|
3939
|
+
V(I, {
|
|
3940
|
+
name: "movie",
|
|
3941
|
+
size: "sm"
|
|
3942
|
+
})
|
|
3943
|
+
])),
|
|
3944
|
+
y("div", Li, [
|
|
3945
|
+
y("span", Ni, x(R.file.name), 1),
|
|
3946
|
+
R.error ? (b(), k("span", {
|
|
3947
|
+
key: 0,
|
|
3948
|
+
class: "text-red-600",
|
|
3949
|
+
style: N(m(H))
|
|
3950
|
+
}, x(R.error), 5)) : h(R) ? (b(), k("span", {
|
|
3951
|
+
key: 1,
|
|
3952
|
+
style: N([m(H), m(wr)])
|
|
3953
|
+
}, x(m(o)("mediaPicker.uploadPanel.videoUndecodableWarning")), 5)) : (b(), k("span", {
|
|
3954
|
+
key: 2,
|
|
3955
|
+
class: "text-gray-500",
|
|
3956
|
+
style: N(m(H))
|
|
3957
|
+
}, [
|
|
3958
|
+
R.dimensions ? (b(), k(Y, { key: 0 }, [
|
|
3959
|
+
se(x(R.dimensions.width) + "×" + x(R.dimensions.height) + " · ", 1)
|
|
3960
|
+
], 64)) : U("", !0),
|
|
3961
|
+
A(R) ? (b(), k(Y, { key: 1 }, [
|
|
3962
|
+
se(x(A(R)) + " · ", 1)
|
|
3963
|
+
], 64)) : U("", !0),
|
|
3964
|
+
se(x(j(R.file.size)), 1)
|
|
3965
|
+
], 4))
|
|
3966
|
+
]),
|
|
3967
|
+
y("button", {
|
|
3968
|
+
class: "rounded flex-shrink-0 flex items-center justify-center text-gray-500 hover:bg-red-50 hover:text-red-600",
|
|
3969
|
+
style: { width: "28px", height: "28px" },
|
|
3970
|
+
onClick: (T) => D(R.id)
|
|
3971
|
+
}, [
|
|
3972
|
+
V(I, {
|
|
3973
|
+
name: "close",
|
|
3974
|
+
size: "sm"
|
|
3975
|
+
})
|
|
3976
|
+
], 8, Ui)
|
|
3977
|
+
], 6))), 128))
|
|
3978
|
+
])) : U("", !0),
|
|
3979
|
+
y("div", Mi, [
|
|
3980
|
+
y("div", ji, x(m(o)("mediaPicker.uploadPanel.tagsLabel")), 1),
|
|
3981
|
+
V(Ai, {
|
|
3982
|
+
modelValue: u.value,
|
|
3983
|
+
"onUpdate:modelValue": _[1] || (_[1] = (R) => u.value = R),
|
|
3984
|
+
tags: e.availableTags,
|
|
3985
|
+
mode: "assign",
|
|
3986
|
+
onTagCreated: _[2] || (_[2] = (R) => i("tag-created", R))
|
|
3987
|
+
}, null, 8, ["modelValue", "tags"]),
|
|
3988
|
+
v.value.length ? (b(), k("div", zi, [
|
|
3989
|
+
y("span", {
|
|
3990
|
+
class: "text-gray-400",
|
|
3991
|
+
style: N(m(H))
|
|
3992
|
+
}, x(m(o)("mediaPicker.uploadPanel.suggestedTagsLabel")), 5),
|
|
3993
|
+
(b(!0), k(Y, null, me(v.value, (R) => (b(), k("button", {
|
|
3994
|
+
key: R,
|
|
3995
|
+
class: "px-12 rounded-full border border-dashed border-fm-color-neutral-gray-300 font-semibold text-gray-500",
|
|
3996
|
+
style: N([m(H), "height:26px"]),
|
|
3997
|
+
onClick: (T) => u.value.push(R)
|
|
3998
|
+
}, " + " + x(R), 13, Vi))), 128))
|
|
3999
|
+
])) : U("", !0)
|
|
4000
|
+
])
|
|
4001
|
+
]);
|
|
4002
|
+
};
|
|
4003
|
+
}
|
|
4004
|
+
}), Wi = 5e3, Gi = 3;
|
|
4005
|
+
function Hi(e) {
|
|
4006
|
+
const t = G(/* @__PURE__ */ new Map());
|
|
4007
|
+
let a = [], n, o = 0;
|
|
4008
|
+
function r() {
|
|
4009
|
+
n !== void 0 && clearTimeout(n), n = void 0;
|
|
4010
|
+
}
|
|
4011
|
+
async function i() {
|
|
4012
|
+
let u = !1;
|
|
4013
|
+
try {
|
|
4014
|
+
const d = await pr({ businessId: e(), refType: je, refIds: a });
|
|
4015
|
+
t.value = new Map(d.map((c) => [c.refId, c])), o = 0;
|
|
4016
|
+
} catch (d) {
|
|
4017
|
+
if (u = !0, o += 1, o >= Gi) {
|
|
4018
|
+
console.warn("[media-picker] stopped polling image variants after repeated failures", d);
|
|
4019
|
+
return;
|
|
4020
|
+
}
|
|
4021
|
+
}
|
|
4022
|
+
([...t.value.values()].some((d) => Zo(d.variants)) || u) && (n = setTimeout(i, Wi));
|
|
4023
|
+
}
|
|
4024
|
+
async function s(u) {
|
|
4025
|
+
if (r(), o = 0, a = u, u.length === 0 || !e()) {
|
|
4026
|
+
t.value = /* @__PURE__ */ new Map();
|
|
4027
|
+
return;
|
|
4028
|
+
}
|
|
4029
|
+
await i();
|
|
4030
|
+
}
|
|
4031
|
+
return qa(r), { byRefId: t, load: s, stop: r };
|
|
4032
|
+
}
|
|
4033
|
+
const Ji = { class: "w-full flex items-center justify-between gap-16 pr-8" }, Ki = { class: "text-xs font-normal text-fm-color-typo-secondary" }, Xi = { class: "relative" }, Qi = {
|
|
4034
|
+
key: 0,
|
|
4035
|
+
class: "absolute inset-0 z-10 flex flex-col items-center justify-center gap-12 bg-white/80 rounded"
|
|
4036
|
+
}, Yi = {
|
|
4037
|
+
key: 1,
|
|
4038
|
+
class: "flex gap-16 border-b border-fm-color-neutral-gray-200 mb-12"
|
|
4039
|
+
}, Zi = { class: "flex flex-col w-full" }, es = {
|
|
4040
|
+
key: 0,
|
|
4041
|
+
class: "border-b border-fm-color-neutral-gray-200 pb-12 mb-12"
|
|
4042
|
+
}, ts = { class: "flex items-center justify-between w-full" }, as = {
|
|
4043
|
+
key: 0,
|
|
4044
|
+
class: "text-xs text-fm-color-typo-secondary"
|
|
4045
|
+
}, ns = { key: 1 }, os = { class: "flex gap-8" }, Hs = /* @__PURE__ */ ge({
|
|
4046
|
+
__name: "MediaPickerModal",
|
|
4047
|
+
props: {
|
|
4048
|
+
open: { type: Boolean },
|
|
4049
|
+
businessId: {},
|
|
4050
|
+
restaurantId: {},
|
|
4051
|
+
selectionMode: { default: "single" },
|
|
4052
|
+
ratio: {},
|
|
4053
|
+
allowUpload: { type: Boolean, default: !0 },
|
|
4054
|
+
kinds: { default: () => ["image", "video"] }
|
|
4055
|
+
},
|
|
4056
|
+
emits: ["update:open", "select", "confirm"],
|
|
4057
|
+
setup(e, { emit: t }) {
|
|
4058
|
+
const { t: a } = he({ messages: be }), n = e, o = W(() => n.ratio ? n.kinds.filter((T) => T !== "video") : n.kinds), r = t, i = G("browse");
|
|
4059
|
+
we(
|
|
4060
|
+
() => n.allowUpload,
|
|
4061
|
+
(T) => {
|
|
4062
|
+
T || (i.value = "browse");
|
|
4063
|
+
},
|
|
4064
|
+
{ immediate: !0 }
|
|
4065
|
+
);
|
|
4066
|
+
const s = G(""), u = G(null), d = G([]), c = Hi(() => n.businessId), f = G([]), v = G(0), F = G([]), P = G(!1);
|
|
4067
|
+
async function S() {
|
|
4068
|
+
if (n.businessId) {
|
|
4069
|
+
P.value = !0;
|
|
4070
|
+
try {
|
|
4071
|
+
const T = await rr({
|
|
4072
|
+
// Never offer an unconfirmed AI draft as a pickable image.
|
|
4073
|
+
excludeTags: [Ia],
|
|
4074
|
+
businessId: n.businessId,
|
|
4075
|
+
restaurantId: n.restaurantId,
|
|
4076
|
+
search: s.value || void 0,
|
|
4077
|
+
tags: u.value ? [u.value] : void 0,
|
|
4078
|
+
kinds: o.value,
|
|
4079
|
+
limit: 200,
|
|
4080
|
+
sortBy: "createdAt",
|
|
4081
|
+
descending: !0
|
|
4082
|
+
});
|
|
4083
|
+
d.value = T.resources, await c.load(
|
|
4084
|
+
T.resources.filter((w) => !Te(w)).map((w) => w.refId).filter((w) => !!w)
|
|
4085
|
+
);
|
|
4086
|
+
} finally {
|
|
4087
|
+
P.value = !1;
|
|
4088
|
+
}
|
|
4089
|
+
}
|
|
4090
|
+
}
|
|
4091
|
+
async function O() {
|
|
4092
|
+
if (!n.businessId)
|
|
4093
|
+
return;
|
|
4094
|
+
const [T, w] = await Promise.all([La(n.businessId), ir(n.businessId)]);
|
|
4095
|
+
f.value = T.tags, v.value = T.total, F.value = w;
|
|
4096
|
+
}
|
|
4097
|
+
we(
|
|
4098
|
+
() => n.open,
|
|
4099
|
+
(T) => {
|
|
4100
|
+
var w;
|
|
4101
|
+
T && (i.value = "browse", s.value = "", u.value = null, X.value = /* @__PURE__ */ new Set(), h.value = n.ratio ?? null, (w = I.value) == null || w.reset(), O(), S());
|
|
4102
|
+
}
|
|
4103
|
+
), we(u, S), we(
|
|
4104
|
+
() => o.value.join(","),
|
|
4105
|
+
() => S()
|
|
4106
|
+
);
|
|
4107
|
+
let p;
|
|
4108
|
+
we(s, () => {
|
|
4109
|
+
clearTimeout(p), p = setTimeout(S, 250);
|
|
4110
|
+
});
|
|
4111
|
+
const h = G(n.ratio ?? null);
|
|
4112
|
+
we(
|
|
4113
|
+
() => n.ratio,
|
|
4114
|
+
(T) => h.value = T ?? null
|
|
4115
|
+
);
|
|
4116
|
+
const A = W(() => n.ratio !== void 0 && n.ratio !== null);
|
|
4117
|
+
function D(T) {
|
|
4118
|
+
var w;
|
|
4119
|
+
return T.refId ? ((w = c.byRefId.value.get(T.refId)) == null ? void 0 : w.variants) ?? [] : [];
|
|
4120
|
+
}
|
|
4121
|
+
const j = W(() => {
|
|
4122
|
+
const T = /* @__PURE__ */ new Set();
|
|
4123
|
+
if (h.value === null)
|
|
4124
|
+
return T;
|
|
4125
|
+
for (const w of d.value)
|
|
4126
|
+
gt(w, h.value, D(w)) || T.add(w.id);
|
|
4127
|
+
return T;
|
|
4128
|
+
}), X = G(/* @__PURE__ */ new Set());
|
|
4129
|
+
function E(T) {
|
|
4130
|
+
const w = new Set(X.value);
|
|
4131
|
+
w.has(T.id) ? w.delete(T.id) : (n.selectionMode === "single" && w.clear(), w.add(T.id)), X.value = w;
|
|
4132
|
+
}
|
|
4133
|
+
function oe(T) {
|
|
4134
|
+
E(T);
|
|
4135
|
+
}
|
|
4136
|
+
const B = W(
|
|
4137
|
+
() => d.value.filter((T) => X.value.has(T.id)).map((T) => gt(T, h.value, D(T))).filter((T) => T !== null)
|
|
4138
|
+
), g = W(() => {
|
|
4139
|
+
if (B.value.length !== 1)
|
|
4140
|
+
return /* @__PURE__ */ new Set();
|
|
4141
|
+
const T = B.value[0].asset, w = D(T);
|
|
4142
|
+
return new Set(Dt.filter((Q) => !gt(T, Q, w)));
|
|
4143
|
+
}), _ = W(() => {
|
|
4144
|
+
if (B.value.length !== 1)
|
|
4145
|
+
return null;
|
|
4146
|
+
const T = B.value[0];
|
|
4147
|
+
if (T.ratio === null) {
|
|
4148
|
+
const Q = ze(T.asset);
|
|
4149
|
+
return Q ? { dimensions: Q, sizeBytes: T.asset.fileSizeBytes } : null;
|
|
4150
|
+
}
|
|
4151
|
+
const w = D(T.asset).find((Q) => Q.aspectRatio === T.ratio);
|
|
4152
|
+
return !(w != null && w.width) || !(w != null && w.height) || !w.fileSizeBytes ? null : { dimensions: `${w.width}×${w.height}`, sizeBytes: w.fileSizeBytes };
|
|
4153
|
+
});
|
|
4154
|
+
function M() {
|
|
4155
|
+
if (n.selectionMode === "single") {
|
|
4156
|
+
const T = B.value[0];
|
|
4157
|
+
if (!T)
|
|
4158
|
+
return;
|
|
4159
|
+
r("select", T), r("update:open", !1);
|
|
4160
|
+
return;
|
|
4161
|
+
}
|
|
4162
|
+
r("confirm", B.value), r("update:open", !1);
|
|
4163
|
+
}
|
|
4164
|
+
const I = G(null);
|
|
4165
|
+
async function R() {
|
|
4166
|
+
var T;
|
|
4167
|
+
(T = I.value) != null && T.stagedCount || (i.value = "browse"), await Promise.all([S(), O()]);
|
|
4168
|
+
}
|
|
4169
|
+
return (T, w) => {
|
|
4170
|
+
const Q = J("FmSearch"), ke = J("FmButton"), Se = J("FmDialog");
|
|
4171
|
+
return b(), ne(Se, {
|
|
4172
|
+
"model-value": e.open,
|
|
4173
|
+
"max-width": 900,
|
|
4174
|
+
"onUpdate:modelValue": w[8] || (w[8] = (q) => !q && r("update:open", !1))
|
|
4175
|
+
}, {
|
|
4176
|
+
"dialog-header": Oe(() => [
|
|
4177
|
+
y("div", Ji, [
|
|
4178
|
+
y("div", null, [
|
|
4179
|
+
y("div", null, x(m(a)("mediaPicker.pickerModal.title")), 1),
|
|
4180
|
+
y("div", Ki, x(e.selectionMode === "multiple" ? m(a)("mediaPicker.pickerModal.subtitleMultiple") : m(a)("mediaPicker.pickerModal.subtitleSingle")), 1)
|
|
4181
|
+
]),
|
|
4182
|
+
i.value === "browse" ? (b(), ne(Q, {
|
|
4183
|
+
key: 0,
|
|
4184
|
+
modelValue: s.value,
|
|
4185
|
+
"onUpdate:modelValue": w[0] || (w[0] = (q) => s.value = q),
|
|
4186
|
+
placeholder: m(a)("mediaPicker.pickerModal.searchPlaceholder"),
|
|
4187
|
+
class: "shrink-0",
|
|
4188
|
+
style: { width: "200px" }
|
|
4189
|
+
}, null, 8, ["modelValue", "placeholder"])) : U("", !0)
|
|
4190
|
+
])
|
|
4191
|
+
]),
|
|
4192
|
+
"dialog-footer": Oe(() => {
|
|
4193
|
+
var q, $;
|
|
4194
|
+
return [
|
|
4195
|
+
y("div", Zi, [
|
|
4196
|
+
i.value === "browse" && e.selectionMode === "single" ? (b(), k("div", es, [
|
|
4197
|
+
V(wi, {
|
|
4198
|
+
modelValue: h.value,
|
|
4199
|
+
"onUpdate:modelValue": w[5] || (w[5] = (de) => h.value = de),
|
|
4200
|
+
facts: _.value,
|
|
4201
|
+
locked: A.value,
|
|
4202
|
+
"unavailable-ratios": g.value
|
|
4203
|
+
}, null, 8, ["modelValue", "facts", "locked", "unavailable-ratios"])
|
|
4204
|
+
])) : U("", !0),
|
|
4205
|
+
y("div", ts, [
|
|
4206
|
+
i.value === "browse" ? (b(), k("span", as, [
|
|
4207
|
+
X.value.size ? (b(), k(Y, { key: 0 }, [
|
|
4208
|
+
se(x(m(a)("mediaPicker.pickerModal.selectedCount", { count: X.value.size })), 1)
|
|
4209
|
+
], 64)) : (b(), k(Y, { key: 1 }, [
|
|
4210
|
+
se(x(m(a)("mediaPicker.pickerModal.selectPrompt")), 1)
|
|
4211
|
+
], 64))
|
|
4212
|
+
])) : (b(), k("span", ns)),
|
|
4213
|
+
y("div", os, [
|
|
4214
|
+
V(ke, {
|
|
4215
|
+
label: m(a)("mediaPicker.pickerModal.cancelButton"),
|
|
4216
|
+
variant: "tertiary",
|
|
4217
|
+
onClick: w[6] || (w[6] = (de) => r("update:open", !1))
|
|
4218
|
+
}, null, 8, ["label"]),
|
|
4219
|
+
i.value === "upload" ? (b(), ne(ke, {
|
|
4220
|
+
key: 0,
|
|
4221
|
+
label: m(a)("mediaPicker.pickerModal.uploadSubmitButton", { count: ((q = I.value) == null ? void 0 : q.stagedCount) ?? 0 }),
|
|
4222
|
+
variant: "primary",
|
|
4223
|
+
disabled: !(($ = I.value) != null && $.stagedCount) || I.value.uploading,
|
|
4224
|
+
onClick: w[7] || (w[7] = (de) => {
|
|
4225
|
+
var xe;
|
|
4226
|
+
return (xe = I.value) == null ? void 0 : xe.upload();
|
|
4227
|
+
})
|
|
4228
|
+
}, null, 8, ["label", "disabled"])) : (b(), ne(ke, {
|
|
4229
|
+
key: 1,
|
|
4230
|
+
label: m(a)("mediaPicker.pickerModal.confirmButton"),
|
|
4231
|
+
variant: "primary",
|
|
4232
|
+
disabled: B.value.length === 0,
|
|
4233
|
+
onClick: M
|
|
4234
|
+
}, null, 8, ["label", "disabled"]))
|
|
4235
|
+
])
|
|
4236
|
+
])
|
|
4237
|
+
])
|
|
4238
|
+
];
|
|
4239
|
+
}),
|
|
4240
|
+
default: Oe(() => {
|
|
4241
|
+
var q;
|
|
4242
|
+
return [
|
|
4243
|
+
y("div", Xi, [
|
|
4244
|
+
(q = I.value) != null && q.uploading ? (b(), k("div", Qi, [
|
|
4245
|
+
(b(), k("svg", {
|
|
4246
|
+
class: "animate-spin",
|
|
4247
|
+
style: N({ width: "32px", height: "32px", color: m(pe) }),
|
|
4248
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4249
|
+
fill: "none",
|
|
4250
|
+
viewBox: "0 0 24 24"
|
|
4251
|
+
}, [...w[9] || (w[9] = [
|
|
4252
|
+
y("circle", {
|
|
4253
|
+
class: "opacity-25",
|
|
4254
|
+
cx: "12",
|
|
4255
|
+
cy: "12",
|
|
4256
|
+
r: "10",
|
|
4257
|
+
stroke: "currentColor",
|
|
4258
|
+
"stroke-width": "3"
|
|
4259
|
+
}, null, -1),
|
|
4260
|
+
y("path", {
|
|
4261
|
+
class: "opacity-75",
|
|
4262
|
+
fill: "currentColor",
|
|
4263
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"
|
|
4264
|
+
}, null, -1)
|
|
4265
|
+
])], 4)),
|
|
4266
|
+
y("span", {
|
|
4267
|
+
class: "text-sm font-semibold",
|
|
4268
|
+
style: N({ color: m(pe) })
|
|
4269
|
+
}, x(m(a)("mediaPicker.uploadPanel.uploading")), 5)
|
|
4270
|
+
])) : U("", !0),
|
|
4271
|
+
e.allowUpload ? (b(), k("div", Yi, [
|
|
4272
|
+
y("button", {
|
|
4273
|
+
class: Z(["pb-8 px-4 text-sm", i.value === "browse" ? "font-semibold border-b-2" : "text-gray-500"]),
|
|
4274
|
+
style: N(i.value === "browse" ? { borderColor: m(pe) } : {}),
|
|
4275
|
+
onClick: w[1] || (w[1] = ($) => i.value = "browse")
|
|
4276
|
+
}, x(m(a)("mediaPicker.pickerModal.browseTab")), 7),
|
|
4277
|
+
y("button", {
|
|
4278
|
+
class: Z(["pb-8 px-4 text-sm", i.value === "upload" ? "font-semibold border-b-2" : "text-gray-500"]),
|
|
4279
|
+
style: N(i.value === "upload" ? { borderColor: m(pe) } : {}),
|
|
4280
|
+
onClick: w[2] || (w[2] = ($) => i.value = "upload")
|
|
4281
|
+
}, x(m(a)("mediaPicker.pickerModal.uploadTab")), 7)
|
|
4282
|
+
])) : U("", !0),
|
|
4283
|
+
i.value === "browse" ? (b(), k(Y, { key: 2 }, [
|
|
4284
|
+
f.value.length ? (b(), ne(mi, {
|
|
4285
|
+
key: 0,
|
|
4286
|
+
modelValue: u.value,
|
|
4287
|
+
"onUpdate:modelValue": w[3] || (w[3] = ($) => u.value = $),
|
|
4288
|
+
tags: f.value,
|
|
4289
|
+
total: v.value,
|
|
4290
|
+
class: "mb-12"
|
|
4291
|
+
}, null, 8, ["modelValue", "tags", "total"])) : U("", !0),
|
|
4292
|
+
V(pi, {
|
|
4293
|
+
assets: d.value,
|
|
4294
|
+
loading: P.value,
|
|
4295
|
+
selectable: "",
|
|
4296
|
+
"selected-ids": X.value,
|
|
4297
|
+
"variants-by-ref-id": m(c).byRefId.value,
|
|
4298
|
+
"unavailable-ids": j.value,
|
|
4299
|
+
"unavailable-ratio": h.value,
|
|
4300
|
+
onOpen: oe,
|
|
4301
|
+
onToggle: E
|
|
4302
|
+
}, null, 8, ["assets", "loading", "selected-ids", "variants-by-ref-id", "unavailable-ids", "unavailable-ratio"])
|
|
4303
|
+
], 64)) : e.allowUpload ? (b(), ne($i, {
|
|
4304
|
+
key: 3,
|
|
4305
|
+
ref_key: "uploadPanelRef",
|
|
4306
|
+
ref: I,
|
|
4307
|
+
"business-id": e.businessId,
|
|
4308
|
+
"restaurant-id": e.restaurantId,
|
|
4309
|
+
"available-tags": F.value,
|
|
4310
|
+
onTagCreated: w[4] || (w[4] = ($) => F.value.push($)),
|
|
4311
|
+
onUploaded: R
|
|
4312
|
+
}, null, 8, ["business-id", "restaurant-id", "available-tags"])) : U("", !0)
|
|
4313
|
+
])
|
|
4314
|
+
];
|
|
4315
|
+
}),
|
|
4316
|
+
_: 1
|
|
4317
|
+
}, 8, ["model-value"]);
|
|
4318
|
+
};
|
|
4319
|
+
}
|
|
4320
|
+
}), Js = 60;
|
|
4321
|
+
function rs(e, t) {
|
|
4322
|
+
return (e - 1) * t;
|
|
4323
|
+
}
|
|
4324
|
+
function is(e, t, a) {
|
|
4325
|
+
if (a === 0)
|
|
4326
|
+
return { start: 0, end: 0 };
|
|
4327
|
+
const n = rs(e, t) + 1;
|
|
4328
|
+
return { start: n, end: Math.min(n + t - 1, a) };
|
|
4329
|
+
}
|
|
4330
|
+
function Ks(e, t) {
|
|
4331
|
+
return Math.min(Math.max(e, 1), Math.max(t, 1));
|
|
4332
|
+
}
|
|
4333
|
+
function ss(e) {
|
|
4334
|
+
return Array.from({ length: Math.max(e, 0) }, (t, a) => ({
|
|
4335
|
+
label: String(a + 1),
|
|
4336
|
+
value: a + 1
|
|
4337
|
+
}));
|
|
4338
|
+
}
|
|
4339
|
+
const ls = {
|
|
4340
|
+
key: 0,
|
|
4341
|
+
class: "flex items-center justify-between gap-24 mt-16 flex-wrap"
|
|
4342
|
+
}, us = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, cs = { class: "flex gap-8 items-center" }, ds = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary" }, Xs = /* @__PURE__ */ ge({
|
|
4343
|
+
__name: "AssetPagination",
|
|
4344
|
+
props: {
|
|
4345
|
+
page: {},
|
|
4346
|
+
pageSize: {},
|
|
4347
|
+
totalResources: {},
|
|
4348
|
+
totalPages: {},
|
|
4349
|
+
disabled: { type: Boolean, default: !1 }
|
|
4350
|
+
},
|
|
4351
|
+
emits: ["update:page"],
|
|
4352
|
+
setup(e, { emit: t }) {
|
|
4353
|
+
const a = e, n = t, { t: o } = he({ messages: be }), r = W(() => is(a.page, a.pageSize, a.totalResources)), i = W(() => ss(a.totalPages)), s = W(() => a.page <= 1), u = W(() => a.page >= a.totalPages);
|
|
4354
|
+
function d(c) {
|
|
4355
|
+
c === a.page || c < 1 || c > a.totalPages || n("update:page", c);
|
|
4356
|
+
}
|
|
4357
|
+
return (c, f) => {
|
|
4358
|
+
const v = J("FmSelect"), F = J("FmButton");
|
|
4359
|
+
return e.totalPages > 1 ? (b(), k("div", ls, [
|
|
4360
|
+
y("span", us, x(m(o)("mediaPicker.assetPagination.itemCount", { start: r.value.start, end: r.value.end, total: e.totalResources })), 1),
|
|
4361
|
+
y("div", cs, [
|
|
4362
|
+
V(v, {
|
|
4363
|
+
items: i.value,
|
|
4364
|
+
"model-value": e.page,
|
|
4365
|
+
disabled: e.disabled,
|
|
4366
|
+
"onUpdate:modelValue": f[0] || (f[0] = (P) => d(P))
|
|
4367
|
+
}, null, 8, ["items", "model-value", "disabled"]),
|
|
4368
|
+
y("span", ds, x(m(o)("mediaPicker.assetPagination.pageCount", { total: e.totalPages })), 1),
|
|
4369
|
+
V(F, {
|
|
4370
|
+
icon: "chevron_left",
|
|
4371
|
+
"icon-color": "neutral-black",
|
|
4372
|
+
variant: "tertiary",
|
|
4373
|
+
disabled: e.disabled || s.value,
|
|
4374
|
+
onClick: f[1] || (f[1] = (P) => d(e.page - 1))
|
|
4375
|
+
}, null, 8, ["disabled"]),
|
|
4376
|
+
V(F, {
|
|
4377
|
+
icon: "chevron_right",
|
|
4378
|
+
"icon-color": "neutral-black",
|
|
4379
|
+
variant: "tertiary",
|
|
4380
|
+
disabled: e.disabled || u.value,
|
|
4381
|
+
onClick: f[2] || (f[2] = (P) => d(e.page + 1))
|
|
4382
|
+
}, null, 8, ["disabled"])
|
|
4383
|
+
])
|
|
4384
|
+
])) : U("", !0);
|
|
4385
|
+
};
|
|
4386
|
+
}
|
|
4387
|
+
}), ps = { class: "relative flex-1 min-w-0 bg-gray-900 flex items-center justify-center overflow-hidden" }, fs = ["src", "alt"], ms = {
|
|
4388
|
+
key: 1,
|
|
4389
|
+
class: "flex flex-col items-center gap-12 text-center px-24"
|
|
4390
|
+
}, gs = { class: "text-sm text-white" }, hs = { class: "absolute bottom-12 left-1/2 -translate-x-1/2 flex items-center gap-8" }, bs = ["onClick"], ys = /* @__PURE__ */ ge({
|
|
4391
|
+
__name: "VariantCarousel",
|
|
4392
|
+
props: /* @__PURE__ */ bt({
|
|
4393
|
+
original: {},
|
|
4394
|
+
variants: {},
|
|
4395
|
+
alt: {}
|
|
4396
|
+
}, {
|
|
4397
|
+
index: { default: 0 },
|
|
4398
|
+
indexModifiers: {}
|
|
4399
|
+
}),
|
|
4400
|
+
emits: /* @__PURE__ */ bt(["regenerate"], ["update:index"]),
|
|
4401
|
+
setup(e, { emit: t }) {
|
|
4402
|
+
const { t: a } = he({ messages: be }), n = e, o = t, r = la(e, "index"), i = W(() => Da(n.original, n.variants));
|
|
4403
|
+
we(i, (c) => {
|
|
4404
|
+
r.value > c.length - 1 && (r.value = c.length - 1);
|
|
4405
|
+
});
|
|
4406
|
+
const s = W(() => i.value[r.value]);
|
|
4407
|
+
function u(c) {
|
|
4408
|
+
const f = i.value.length;
|
|
4409
|
+
r.value = (r.value + c + f) % f;
|
|
4410
|
+
}
|
|
4411
|
+
function d(c) {
|
|
4412
|
+
return c ? Be(c) : "";
|
|
4413
|
+
}
|
|
4414
|
+
return (c, f) => {
|
|
4415
|
+
var v, F, P, S;
|
|
4416
|
+
const O = J("FmIcon"), p = J("FmButton");
|
|
4417
|
+
return b(), k("div", ps, [
|
|
4418
|
+
(v = s.value) != null && v.url ? (b(), k("img", {
|
|
4419
|
+
key: 0,
|
|
4420
|
+
src: s.value.url,
|
|
4421
|
+
alt: e.alt,
|
|
4422
|
+
class: "max-w-full max-h-full object-contain"
|
|
4423
|
+
}, null, 8, fs)) : s.value ? (b(), k("div", ms, [
|
|
4424
|
+
V(O, {
|
|
4425
|
+
name: "error",
|
|
4426
|
+
size: "lg",
|
|
4427
|
+
color: "white"
|
|
4428
|
+
}),
|
|
4429
|
+
y("span", gs, x(m(a)(m(ki)(s.value.failureCode))), 1),
|
|
4430
|
+
V(p, {
|
|
4431
|
+
label: m(a)("mediaPicker.variants.regenerate"),
|
|
4432
|
+
variant: "secondary",
|
|
4433
|
+
size: "md",
|
|
4434
|
+
"prepend-icon": "refresh",
|
|
4435
|
+
onClick: f[0] || (f[0] = (h) => s.value.ratio && o("regenerate", s.value.ratio))
|
|
4436
|
+
}, null, 8, ["label"])
|
|
4437
|
+
])) : U("", !0),
|
|
4438
|
+
y("span", {
|
|
4439
|
+
class: "absolute top-8 left-8 bg-black/70 text-white font-semibold px-8 rounded",
|
|
4440
|
+
style: N([m(H), "padding-top:2px;padding-bottom:2px"])
|
|
4441
|
+
}, [
|
|
4442
|
+
se(x(((F = s.value) == null ? void 0 : F.kind) === "original" ? m(a)("mediaPicker.variants.original") : d(((P = s.value) == null ? void 0 : P.ratio) ?? null)) + " ", 1),
|
|
4443
|
+
((S = s.value) == null ? void 0 : S.status) === "pending" ? (b(), k(Y, { key: 0 }, [
|
|
4444
|
+
se(" · " + x(m(a)("mediaPicker.variants.generating")), 1)
|
|
4445
|
+
], 64)) : U("", !0)
|
|
4446
|
+
], 4),
|
|
4447
|
+
i.value.length > 1 ? (b(), k(Y, { key: 2 }, [
|
|
4448
|
+
y("button", {
|
|
4449
|
+
class: "absolute left-8 top-1/2 -translate-y-1/2 rounded-full bg-black/50 flex items-center justify-center",
|
|
4450
|
+
style: { width: "32px", height: "32px" },
|
|
4451
|
+
onClick: f[1] || (f[1] = (h) => u(-1))
|
|
4452
|
+
}, [
|
|
4453
|
+
V(O, {
|
|
4454
|
+
name: "chevron_left",
|
|
4455
|
+
size: "sm",
|
|
4456
|
+
color: "white"
|
|
4457
|
+
})
|
|
4458
|
+
]),
|
|
4459
|
+
y("button", {
|
|
4460
|
+
class: "absolute right-8 top-1/2 -translate-y-1/2 rounded-full bg-black/50 flex items-center justify-center",
|
|
4461
|
+
style: { width: "32px", height: "32px" },
|
|
4462
|
+
onClick: f[2] || (f[2] = (h) => u(1))
|
|
4463
|
+
}, [
|
|
4464
|
+
V(O, {
|
|
4465
|
+
name: "chevron_right",
|
|
4466
|
+
size: "sm",
|
|
4467
|
+
color: "white"
|
|
4468
|
+
})
|
|
4469
|
+
]),
|
|
4470
|
+
y("div", hs, [
|
|
4471
|
+
(b(!0), k(Y, null, me(i.value, (h, A) => (b(), k("button", {
|
|
4472
|
+
key: h.key,
|
|
4473
|
+
class: Z(["rounded-full", A === r.value ? "bg-white" : "bg-white/40"]),
|
|
4474
|
+
style: { width: "8px", height: "8px" },
|
|
4475
|
+
onClick: (D) => r.value = A
|
|
4476
|
+
}, null, 10, bs))), 128))
|
|
4477
|
+
])
|
|
4478
|
+
], 64)) : U("", !0)
|
|
4479
|
+
]);
|
|
4480
|
+
};
|
|
4481
|
+
}
|
|
4482
|
+
}), vs = {
|
|
4483
|
+
key: 0,
|
|
4484
|
+
class: "flex",
|
|
4485
|
+
style: { height: "620px" }
|
|
4486
|
+
}, ws = {
|
|
4487
|
+
key: 0,
|
|
4488
|
+
class: "flex-1 min-w-0 bg-black flex items-center justify-center"
|
|
4489
|
+
}, ks = ["src", "poster"], xs = {
|
|
4490
|
+
class: "flex-shrink-0 flex flex-col gap-12 p-16 overflow-y-auto",
|
|
4491
|
+
style: { width: "320px" }
|
|
4492
|
+
}, Ps = {
|
|
4493
|
+
key: 0,
|
|
4494
|
+
class: "text-sm text-red-600 bg-red-50 rounded-lg px-12 py-8"
|
|
4495
|
+
}, Ts = { class: "flex items-center justify-between" }, Ss = { class: "fm-typo-en-title-sm-600" }, Es = {
|
|
4496
|
+
key: 1,
|
|
4497
|
+
class: "flex items-start gap-8"
|
|
4498
|
+
}, Cs = { class: "flex-1 text-sm font-semibold break-all" }, Os = {
|
|
4499
|
+
key: 2,
|
|
4500
|
+
class: "flex gap-8"
|
|
4501
|
+
}, Rs = { class: "text-xs space-y-8 border-t pt-8" }, As = {
|
|
4502
|
+
key: 0,
|
|
4503
|
+
class: "flex justify-between"
|
|
4504
|
+
}, Bs = { class: "text-gray-500" }, Ds = { class: "font-semibold" }, _s = {
|
|
4505
|
+
key: 1,
|
|
4506
|
+
class: "flex justify-between"
|
|
4507
|
+
}, Fs = { class: "text-gray-500" }, Is = { class: "font-semibold" }, Ls = { class: "flex justify-between" }, Ns = { class: "text-gray-500" }, Us = { class: "flex justify-between" }, Ms = { class: "text-gray-500" }, js = { class: "flex justify-between" }, zs = { class: "text-gray-500" }, Vs = {
|
|
4508
|
+
key: 3,
|
|
4509
|
+
class: "flex flex-wrap gap-4"
|
|
4510
|
+
}, qs = { class: "flex gap-8 border-t pt-12" }, Qs = /* @__PURE__ */ ge({
|
|
4511
|
+
__name: "AssetDetailDialog",
|
|
4512
|
+
props: {
|
|
4513
|
+
asset: {},
|
|
4514
|
+
businessId: {},
|
|
4515
|
+
image: {}
|
|
4516
|
+
},
|
|
4517
|
+
emits: ["close", "renamed", "deleted", "changed"],
|
|
4518
|
+
setup(e, { emit: t }) {
|
|
4519
|
+
const a = Wa(), { t: n } = he({ messages: be }), o = e, r = t, i = G(!1), s = G("");
|
|
4520
|
+
we(
|
|
4521
|
+
() => o.asset,
|
|
4522
|
+
(B) => {
|
|
4523
|
+
i.value = !1, s.value = (B == null ? void 0 : B.fileName) ?? "";
|
|
4524
|
+
}
|
|
4525
|
+
);
|
|
4526
|
+
function u() {
|
|
4527
|
+
var B;
|
|
4528
|
+
s.value = ((B = o.asset) == null ? void 0 : B.fileName) ?? "", i.value = !0;
|
|
4529
|
+
}
|
|
4530
|
+
async function d() {
|
|
4531
|
+
o.asset && (await sr(o.businessId, o.asset.id, s.value), i.value = !1, r("renamed"));
|
|
4532
|
+
}
|
|
4533
|
+
function c() {
|
|
4534
|
+
if (!o.asset)
|
|
4535
|
+
return;
|
|
4536
|
+
const B = o.asset;
|
|
4537
|
+
a.open({
|
|
4538
|
+
title: n("mediaPicker.assetDetailDialog.deleteDialogTitle"),
|
|
4539
|
+
message: n("mediaPicker.assetDetailDialog.deleteDialogMessage", {
|
|
4540
|
+
fileName: B.fileName,
|
|
4541
|
+
disclaimer: n("mediaPicker.assetDetailDialog.deleteDisclaimer")
|
|
4542
|
+
}),
|
|
4543
|
+
primaryActions: { text: n("mediaPicker.assetDetailDialog.deleteConfirmButton"), close: !1, variant: "destructive" },
|
|
4544
|
+
secondaryActions: { text: n("mediaPicker.assetDetailDialog.cancelButton"), close: !0 }
|
|
4545
|
+
}).onPrimary(async () => {
|
|
4546
|
+
await yr(o.businessId, B), r("deleted", B.id), a.close();
|
|
4547
|
+
});
|
|
4548
|
+
}
|
|
4549
|
+
const f = G(0), v = W(() => {
|
|
4550
|
+
var B, g, _, M, I, R;
|
|
4551
|
+
return {
|
|
4552
|
+
url: ((B = o.image) == null ? void 0 : B.original.url) ?? ((g = o.asset) == null ? void 0 : g.url) ?? "",
|
|
4553
|
+
width: ((_ = o.image) == null ? void 0 : _.original.width) ?? ((M = o.asset) == null ? void 0 : M.width),
|
|
4554
|
+
height: ((I = o.image) == null ? void 0 : I.original.height) ?? ((R = o.asset) == null ? void 0 : R.height)
|
|
4555
|
+
};
|
|
4556
|
+
}), F = W(
|
|
4557
|
+
() => {
|
|
4558
|
+
var B;
|
|
4559
|
+
return o.asset ? Da(v.value, ((B = o.image) == null ? void 0 : B.variants) ?? []) : [];
|
|
4560
|
+
}
|
|
4561
|
+
);
|
|
4562
|
+
we(() => {
|
|
4563
|
+
var B;
|
|
4564
|
+
return (B = o.asset) == null ? void 0 : B.id;
|
|
4565
|
+
}, () => f.value = 0);
|
|
4566
|
+
const P = W(() => {
|
|
4567
|
+
var B;
|
|
4568
|
+
const g = F.value[f.value];
|
|
4569
|
+
return !g || !o.asset ? null : ar(g, o.asset, ((B = o.image) == null ? void 0 : B.variants) ?? []);
|
|
4570
|
+
}), S = W(
|
|
4571
|
+
() => {
|
|
4572
|
+
var B;
|
|
4573
|
+
return (B = P.value) != null && B.ratio ? Be(P.value.ratio) : n("mediaPicker.variants.original");
|
|
4574
|
+
}
|
|
4575
|
+
), O = W(() => o.asset ? Te(o.asset) : !1), p = W(() => o.asset ? Fa(o.asset) ?? void 0 : void 0), h = W(
|
|
4576
|
+
() => {
|
|
4577
|
+
var B;
|
|
4578
|
+
return (B = o.asset) != null && B.durationMs ? It(o.asset.durationMs) : null;
|
|
4579
|
+
}
|
|
4580
|
+
), A = G(!1), D = G(null);
|
|
4581
|
+
async function j(B) {
|
|
4582
|
+
var g;
|
|
4583
|
+
if (!(!((g = o.asset) != null && g.refType) || !o.asset.refId || A.value)) {
|
|
4584
|
+
A.value = !0, D.value = null;
|
|
4585
|
+
try {
|
|
4586
|
+
await cr(o.businessId, {
|
|
4587
|
+
refType: o.asset.refType,
|
|
4588
|
+
refId: o.asset.refId,
|
|
4589
|
+
imageId: o.asset.imageId ?? "main",
|
|
4590
|
+
aspectRatios: [B],
|
|
4591
|
+
mode: "append"
|
|
4592
|
+
}), r("changed");
|
|
4593
|
+
} catch (_) {
|
|
4594
|
+
D.value = Ua(_);
|
|
4595
|
+
} finally {
|
|
4596
|
+
A.value = !1;
|
|
4597
|
+
}
|
|
4598
|
+
}
|
|
4599
|
+
}
|
|
4600
|
+
function X() {
|
|
4601
|
+
var B;
|
|
4602
|
+
P.value && ((B = navigator.clipboard) == null || B.writeText(P.value.url));
|
|
4603
|
+
}
|
|
4604
|
+
function E(B) {
|
|
4605
|
+
var g;
|
|
4606
|
+
return ((g = B.split("/")[1]) == null ? void 0 : g.toUpperCase()) ?? B;
|
|
4607
|
+
}
|
|
4608
|
+
function oe(B) {
|
|
4609
|
+
return B >= 1024 * 1024 ? `${(B / 1024 / 1024).toFixed(1)} MB` : `${Math.round(B / 1024)} KB`;
|
|
4610
|
+
}
|
|
4611
|
+
return (B, g) => {
|
|
4612
|
+
const _ = J("FmIcon"), M = J("FmTextField"), I = J("FmButton"), R = J("FmDialog");
|
|
4613
|
+
return b(), ne(R, {
|
|
4614
|
+
"model-value": !!e.asset,
|
|
4615
|
+
"max-width": 920,
|
|
4616
|
+
"max-height": "620px",
|
|
4617
|
+
"content-class": "!p-0 asset-preview-dialog-content",
|
|
4618
|
+
"close-button": !1,
|
|
4619
|
+
"onUpdate:modelValue": g[3] || (g[3] = (T) => !T && r("close"))
|
|
4620
|
+
}, {
|
|
4621
|
+
default: Oe(() => {
|
|
4622
|
+
var T, w, Q, ke, Se;
|
|
4623
|
+
return [
|
|
4624
|
+
e.asset ? (b(), k("div", vs, [
|
|
4625
|
+
O.value ? (b(), k("div", ws, [
|
|
4626
|
+
(b(), k("video", {
|
|
4627
|
+
key: e.asset.id,
|
|
4628
|
+
src: e.asset.url,
|
|
4629
|
+
poster: p.value,
|
|
4630
|
+
controls: "",
|
|
4631
|
+
preload: "metadata",
|
|
4632
|
+
class: "max-w-full max-h-full"
|
|
4633
|
+
}, null, 8, ks))
|
|
4634
|
+
])) : (b(), ne(ys, {
|
|
4635
|
+
key: 1,
|
|
4636
|
+
index: f.value,
|
|
4637
|
+
"onUpdate:index": g[0] || (g[0] = (q) => f.value = q),
|
|
4638
|
+
original: v.value,
|
|
4639
|
+
variants: ((T = e.image) == null ? void 0 : T.variants) ?? [],
|
|
4640
|
+
alt: e.asset.fileName,
|
|
4641
|
+
onRegenerate: j
|
|
4642
|
+
}, null, 8, ["index", "original", "variants", "alt"])),
|
|
4643
|
+
y("div", xs, [
|
|
4644
|
+
D.value ? (b(), k("p", Ps, x(D.value), 1)) : U("", !0),
|
|
4645
|
+
y("div", Ts, [
|
|
4646
|
+
y("span", Ss, x(m(n)("mediaPicker.assetDetailDialog.previewTitle")), 1),
|
|
4647
|
+
y("button", {
|
|
4648
|
+
class: "rounded-lg bg-fm-color-neutral-gray-100 flex items-center justify-center flex-shrink-0",
|
|
4649
|
+
style: { width: "32px", height: "32px" },
|
|
4650
|
+
onClick: g[1] || (g[1] = (q) => r("close"))
|
|
4651
|
+
}, [
|
|
4652
|
+
V(_, {
|
|
4653
|
+
name: "close",
|
|
4654
|
+
size: "sm"
|
|
4655
|
+
})
|
|
4656
|
+
])
|
|
4657
|
+
]),
|
|
4658
|
+
i.value ? (b(), k("div", Os, [
|
|
4659
|
+
V(M, {
|
|
4660
|
+
modelValue: s.value,
|
|
4661
|
+
"onUpdate:modelValue": g[2] || (g[2] = (q) => s.value = q),
|
|
4662
|
+
class: "flex-1 min-w-0"
|
|
4663
|
+
}, null, 8, ["modelValue"]),
|
|
4664
|
+
V(I, {
|
|
4665
|
+
label: m(n)("mediaPicker.assetDetailDialog.saveButton"),
|
|
4666
|
+
variant: "primary",
|
|
4667
|
+
size: "md",
|
|
4668
|
+
class: "flex-shrink-0",
|
|
4669
|
+
onClick: d
|
|
4670
|
+
}, null, 8, ["label"])
|
|
4671
|
+
])) : (b(), k("div", Es, [
|
|
4672
|
+
y("span", Cs, x(e.asset.fileName), 1),
|
|
4673
|
+
y("button", { onClick: u }, [
|
|
4674
|
+
V(_, {
|
|
4675
|
+
name: "edit",
|
|
4676
|
+
size: "sm"
|
|
4677
|
+
})
|
|
4678
|
+
])
|
|
4679
|
+
])),
|
|
4680
|
+
y("div", Rs, [
|
|
4681
|
+
O.value ? (b(), k("div", As, [
|
|
4682
|
+
y("span", Bs, x(m(n)("mediaPicker.assetDetailDialog.durationLabel")), 1),
|
|
4683
|
+
y("span", Ds, x(h.value ?? "—"), 1)
|
|
4684
|
+
])) : (b(), k("div", _s, [
|
|
4685
|
+
y("span", Fs, x(m(n)("mediaPicker.ratios.title")), 1),
|
|
4686
|
+
y("span", Is, x(S.value), 1)
|
|
4687
|
+
])),
|
|
4688
|
+
y("div", Ls, [
|
|
4689
|
+
y("span", Ns, x(m(n)("mediaPicker.assetDetailDialog.dimensionsLabel")), 1),
|
|
4690
|
+
y("span", null, x(((w = P.value) == null ? void 0 : w.dimensions) ?? "—"), 1)
|
|
4691
|
+
]),
|
|
4692
|
+
y("div", Us, [
|
|
4693
|
+
y("span", Ms, x(m(n)("mediaPicker.assetDetailDialog.sizeLabel")), 1),
|
|
4694
|
+
y("span", null, x((Q = P.value) != null && Q.sizeBytes ? oe(P.value.sizeBytes) : "—"), 1)
|
|
4695
|
+
]),
|
|
4696
|
+
y("div", js, [
|
|
4697
|
+
y("span", zs, x(m(n)("mediaPicker.assetDetailDialog.formatLabel")), 1),
|
|
4698
|
+
y("span", null, x((ke = P.value) != null && ke.contentType ? E(P.value.contentType) : "—"), 1)
|
|
4699
|
+
])
|
|
4700
|
+
]),
|
|
4701
|
+
(Se = e.asset.tags) != null && Se.length ? (b(), k("div", Vs, [
|
|
4702
|
+
(b(!0), k(Y, null, me(e.asset.tags, (q) => (b(), k("span", {
|
|
4703
|
+
key: q,
|
|
4704
|
+
class: "bg-gray-100 rounded-full px-8",
|
|
4705
|
+
style: N([m(H), "padding-top:2px;padding-bottom:2px"])
|
|
4706
|
+
}, " # " + x(q), 5))), 128))
|
|
4707
|
+
])) : U("", !0),
|
|
4708
|
+
g[4] || (g[4] = y("div", { class: "flex-1" }, null, -1)),
|
|
4709
|
+
y("div", qs, [
|
|
4710
|
+
V(I, {
|
|
4711
|
+
label: m(n)("mediaPicker.assetDetailDialog.copyLinkButton"),
|
|
4712
|
+
variant: "tertiary",
|
|
4713
|
+
size: "md",
|
|
4714
|
+
"prepend-icon": "link",
|
|
4715
|
+
class: "flex-1",
|
|
4716
|
+
onClick: X
|
|
4717
|
+
}, null, 8, ["label"]),
|
|
4718
|
+
V(I, {
|
|
4719
|
+
label: m(n)("mediaPicker.assetDetailDialog.deleteButton"),
|
|
4720
|
+
variant: "destructive",
|
|
4721
|
+
size: "md",
|
|
4722
|
+
"prepend-icon": "delete",
|
|
4723
|
+
onClick: c
|
|
4724
|
+
}, null, 8, ["label"])
|
|
4725
|
+
])
|
|
4726
|
+
])
|
|
4727
|
+
])) : U("", !0)
|
|
4728
|
+
];
|
|
4729
|
+
}),
|
|
4730
|
+
_: 1
|
|
4731
|
+
}, 8, ["model-value"]);
|
|
4732
|
+
};
|
|
4733
|
+
}
|
|
4734
|
+
});
|
|
4735
|
+
export {
|
|
4736
|
+
Hi as J,
|
|
4737
|
+
Ia as L,
|
|
4738
|
+
Ai as O,
|
|
4739
|
+
Te as T,
|
|
4740
|
+
Qs as a,
|
|
4741
|
+
rs as b,
|
|
4742
|
+
Hs as e,
|
|
4743
|
+
dr as f,
|
|
4744
|
+
or as i,
|
|
4745
|
+
pi as m,
|
|
4746
|
+
Ks as n,
|
|
4747
|
+
Xs as o,
|
|
4748
|
+
$i as q,
|
|
4749
|
+
ir as r,
|
|
4750
|
+
rr as s,
|
|
4751
|
+
Js as t,
|
|
4752
|
+
lr as u,
|
|
4753
|
+
yr as w
|
|
4754
|
+
};
|