@feedmepos/mf-media 0.0.5 → 0.0.6
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/{AssetLibrary-571ef313.js → AssetLibrary-90b9985d.js} +1213 -1158
- package/dist/app.js +30 -30
- package/dist/src/app.d.ts +1 -0
- package/dist/style.css +1 -0
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useI18n as
|
|
3
|
-
import { useDialog as
|
|
4
|
-
function
|
|
1
|
+
import { defineComponent as ye, resolveComponent as M, openBlock as S, createElementBlock as C, toDisplayString as E, unref as T, createElementVNode as h, Fragment as Z, renderList as be, normalizeClass as te, withModifiers as st, createBlock as ne, createCommentVNode as V, createVNode as F, ref as N, withDirectives as Tn, withKeys as On, vModelText as Cn, computed as ae, withCtx as le, createTextVNode as ge, watch as he, onScopeDispose as _n, mergeModels as _t, useModel as An, onMounted as Bn } from "vue";
|
|
2
|
+
import { useI18n as ve, useCoreStore as Kt } from "@feedmepos/mf-common";
|
|
3
|
+
import { useDialog as Xt } from "@feedmepos/ui-library";
|
|
4
|
+
function Zt(e, t) {
|
|
5
5
|
return function() {
|
|
6
6
|
return e.apply(t, arguments);
|
|
7
7
|
};
|
|
8
8
|
}
|
|
9
|
-
const { toString:
|
|
9
|
+
const { toString: Dn } = Object.prototype, { getPrototypeOf: Ce } = Object, { iterator: Le, toStringTag: Qt } = Symbol, Ke = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Ne = (e, t) => {
|
|
10
10
|
let n = e;
|
|
11
11
|
const a = [];
|
|
12
12
|
for (; n != null && n !== Object.prototype; ) {
|
|
@@ -17,27 +17,27 @@ const { toString: _n } = Object.prototype, { getPrototypeOf: Ce } = Object, { it
|
|
|
17
17
|
n = Ce(n);
|
|
18
18
|
}
|
|
19
19
|
return !1;
|
|
20
|
-
},
|
|
21
|
-
const n =
|
|
20
|
+
}, Fn = (e, t) => e != null && Ne(e, t) ? e[t] : void 0, bt = ((e) => (t) => {
|
|
21
|
+
const n = Dn.call(t);
|
|
22
22
|
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
|
|
23
|
-
})(/* @__PURE__ */ Object.create(null)),
|
|
23
|
+
})(/* @__PURE__ */ Object.create(null)), oe = (e) => (e = e.toLowerCase(), (t) => bt(t) === e), Ye = (e) => (t) => typeof t === e, { isArray: Re } = Array, _e = Ye("undefined");
|
|
24
24
|
function Ae(e) {
|
|
25
|
-
return e !== null && !_e(e) && e.constructor !== null && !_e(e.constructor) &&
|
|
25
|
+
return e !== null && !_e(e) && e.constructor !== null && !_e(e.constructor) && Q(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
26
26
|
}
|
|
27
|
-
const
|
|
28
|
-
function
|
|
27
|
+
const Yt = oe("ArrayBuffer");
|
|
28
|
+
function Nn(e) {
|
|
29
29
|
let t;
|
|
30
|
-
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer &&
|
|
30
|
+
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && Yt(e.buffer), t;
|
|
31
31
|
}
|
|
32
|
-
const
|
|
32
|
+
const Ln = Ye("string"), Q = Ye("function"), en = Ye("number"), Be = (e) => e !== null && typeof e == "object", Un = (e) => e === !0 || e === !1, Ge = (e) => {
|
|
33
33
|
if (!Be(e))
|
|
34
34
|
return !1;
|
|
35
35
|
const t = Ce(e);
|
|
36
36
|
return (t === null || t === Object.prototype || Ce(t) === null) && // Treat any genuine (non-Object.prototype-polluted) Symbol.toStringTag or
|
|
37
37
|
// Symbol.iterator as evidence the value is a tagged/iterable type rather
|
|
38
38
|
// than a plain object, while ignoring keys injected onto Object.prototype.
|
|
39
|
-
!Ne(e,
|
|
40
|
-
},
|
|
39
|
+
!Ne(e, Qt) && !Ne(e, Le);
|
|
40
|
+
}, jn = (e) => {
|
|
41
41
|
if (!Be(e) || Ae(e))
|
|
42
42
|
return !1;
|
|
43
43
|
try {
|
|
@@ -45,32 +45,32 @@ const Dn = Ze("string"), X = Ze("function"), Zt = Ze("number"), Be = (e) => e !=
|
|
|
45
45
|
} catch {
|
|
46
46
|
return !1;
|
|
47
47
|
}
|
|
48
|
-
},
|
|
49
|
-
function
|
|
48
|
+
}, In = oe("Date"), Mn = oe("File"), zn = (e) => !!(e && typeof e.uri < "u"), Vn = (e) => e && typeof e.getParts < "u", qn = oe("Blob"), $n = oe("FileList"), Gn = (e) => Be(e) && Q(e.pipe);
|
|
49
|
+
function Hn() {
|
|
50
50
|
return typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {};
|
|
51
51
|
}
|
|
52
|
-
const
|
|
52
|
+
const At = Hn(), Bt = typeof At.FormData < "u" ? At.FormData : void 0, Jn = (e) => {
|
|
53
53
|
if (!e)
|
|
54
54
|
return !1;
|
|
55
|
-
if (
|
|
55
|
+
if (Bt && e instanceof Bt)
|
|
56
56
|
return !0;
|
|
57
57
|
const t = Ce(e);
|
|
58
|
-
if (!t || t === Object.prototype || !
|
|
58
|
+
if (!t || t === Object.prototype || !Q(e.append))
|
|
59
59
|
return !1;
|
|
60
60
|
const n = bt(e);
|
|
61
61
|
return n === "formdata" || // detect form-data instance
|
|
62
|
-
n === "object" &&
|
|
63
|
-
},
|
|
62
|
+
n === "object" && Q(e.toString) && e.toString() === "[object FormData]";
|
|
63
|
+
}, Wn = oe("URLSearchParams"), [Kn, Xn, Zn, Qn] = [
|
|
64
64
|
"ReadableStream",
|
|
65
65
|
"Request",
|
|
66
66
|
"Response",
|
|
67
67
|
"Headers"
|
|
68
|
-
].map(
|
|
68
|
+
].map(oe), Yn = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
69
69
|
function Ue(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
70
70
|
if (e === null || typeof e > "u")
|
|
71
71
|
return;
|
|
72
72
|
let a, r;
|
|
73
|
-
if (typeof e != "object" && (e = [e]),
|
|
73
|
+
if (typeof e != "object" && (e = [e]), Re(e))
|
|
74
74
|
for (a = 0, r = e.length; a < r; a++)
|
|
75
75
|
t.call(null, e[a], a, e);
|
|
76
76
|
else {
|
|
@@ -82,7 +82,7 @@ function Ue(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
|
82
82
|
i = o[a], t.call(null, e[i], i, e);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function tn(e, t) {
|
|
86
86
|
if (Ae(e))
|
|
87
87
|
return null;
|
|
88
88
|
t = t.toLowerCase();
|
|
@@ -93,34 +93,34 @@ function en(e, t) {
|
|
|
93
93
|
return r;
|
|
94
94
|
return null;
|
|
95
95
|
}
|
|
96
|
-
const
|
|
96
|
+
const Ee = (() => typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global)(), nn = (e) => !_e(e) && e !== Ee;
|
|
97
97
|
function dt(...e) {
|
|
98
|
-
const { caseless: t, skipUndefined: n } =
|
|
98
|
+
const { caseless: t, skipUndefined: n } = nn(this) && this || {}, a = {}, r = (o, s) => {
|
|
99
99
|
if (s === "__proto__" || s === "constructor" || s === "prototype")
|
|
100
100
|
return;
|
|
101
|
-
const i = t && typeof s == "string" &&
|
|
102
|
-
Ge(u) && Ge(o) ? a[i] = dt(u, o) : Ge(o) ? a[i] = dt({}, o) :
|
|
101
|
+
const i = t && typeof s == "string" && tn(a, s) || s, u = Ke(a, i) ? a[i] : void 0;
|
|
102
|
+
Ge(u) && Ge(o) ? a[i] = dt(u, o) : Ge(o) ? a[i] = dt({}, o) : Re(o) ? a[i] = o.slice() : (!n || !_e(o)) && (a[i] = o);
|
|
103
103
|
};
|
|
104
104
|
for (let o = 0, s = e.length; o < s; o++) {
|
|
105
105
|
const i = e[o];
|
|
106
|
-
if (!i || Ae(i) || (Ue(i, r), typeof i != "object" ||
|
|
106
|
+
if (!i || Ae(i) || (Ue(i, r), typeof i != "object" || Re(i)))
|
|
107
107
|
continue;
|
|
108
108
|
const u = Object.getOwnPropertySymbols(i);
|
|
109
109
|
for (let f = 0; f < u.length; f++) {
|
|
110
110
|
const c = u[f];
|
|
111
|
-
|
|
111
|
+
da.call(i, c) && r(i[c], c);
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
return a;
|
|
115
115
|
}
|
|
116
|
-
const
|
|
116
|
+
const ea = (e, t, n, { allOwnKeys: a } = {}) => (Ue(
|
|
117
117
|
t,
|
|
118
118
|
(r, o) => {
|
|
119
|
-
n &&
|
|
119
|
+
n && Q(r) ? Object.defineProperty(e, o, {
|
|
120
120
|
// Null-proto descriptor so a polluted Object.prototype.get cannot
|
|
121
121
|
// hijack defineProperty's accessor-vs-data resolution.
|
|
122
122
|
__proto__: null,
|
|
123
|
-
value:
|
|
123
|
+
value: Zt(r, n),
|
|
124
124
|
writable: !0,
|
|
125
125
|
enumerable: !0,
|
|
126
126
|
configurable: !0
|
|
@@ -133,7 +133,7 @@ const Yn = (e, t, n, { allOwnKeys: a } = {}) => (Ue(
|
|
|
133
133
|
});
|
|
134
134
|
},
|
|
135
135
|
{ allOwnKeys: a }
|
|
136
|
-
), e),
|
|
136
|
+
), e), ta = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), na = (e, t, n, a) => {
|
|
137
137
|
e.prototype = Object.create(t.prototype, a), Object.defineProperty(e.prototype, "constructor", {
|
|
138
138
|
__proto__: null,
|
|
139
139
|
value: e,
|
|
@@ -144,7 +144,7 @@ const Yn = (e, t, n, { allOwnKeys: a } = {}) => (Ue(
|
|
|
144
144
|
__proto__: null,
|
|
145
145
|
value: t.prototype
|
|
146
146
|
}), n && Object.assign(e.prototype, n);
|
|
147
|
-
},
|
|
147
|
+
}, aa = (e, t, n, a) => {
|
|
148
148
|
let r, o, s;
|
|
149
149
|
const i = {};
|
|
150
150
|
if (t = t || {}, e == null)
|
|
@@ -155,49 +155,49 @@ const Yn = (e, t, n, { allOwnKeys: a } = {}) => (Ue(
|
|
|
155
155
|
e = n !== !1 && Ce(e);
|
|
156
156
|
} while (e && (!n || n(e, t)) && e !== Object.prototype);
|
|
157
157
|
return t;
|
|
158
|
-
},
|
|
158
|
+
}, ra = (e, t, n) => {
|
|
159
159
|
e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
|
|
160
160
|
const a = e.indexOf(t, n);
|
|
161
161
|
return a !== -1 && a === n;
|
|
162
|
-
},
|
|
162
|
+
}, oa = (e) => {
|
|
163
163
|
if (!e)
|
|
164
164
|
return null;
|
|
165
|
-
if (
|
|
165
|
+
if (Re(e))
|
|
166
166
|
return e;
|
|
167
167
|
let t = e.length;
|
|
168
|
-
if (!
|
|
168
|
+
if (!en(t))
|
|
169
169
|
return null;
|
|
170
170
|
const n = new Array(t);
|
|
171
171
|
for (; t-- > 0; )
|
|
172
172
|
n[t] = e[t];
|
|
173
173
|
return n;
|
|
174
|
-
},
|
|
174
|
+
}, sa = ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && Ce(Uint8Array)), ia = (e, t) => {
|
|
175
175
|
const n = (e && e[Le]).call(e);
|
|
176
176
|
let a;
|
|
177
177
|
for (; (a = n.next()) && !a.done; ) {
|
|
178
178
|
const r = a.value;
|
|
179
179
|
t.call(e, r[0], r[1]);
|
|
180
180
|
}
|
|
181
|
-
},
|
|
181
|
+
}, la = (e, t) => {
|
|
182
182
|
let n;
|
|
183
183
|
const a = [];
|
|
184
184
|
for (; (n = e.exec(t)) !== null; )
|
|
185
185
|
a.push(n);
|
|
186
186
|
return a;
|
|
187
|
-
},
|
|
187
|
+
}, ua = oe("HTMLFormElement"), ca = (e) => e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function(t, n, a) {
|
|
188
188
|
return n.toUpperCase() + a;
|
|
189
|
-
}), { propertyIsEnumerable:
|
|
189
|
+
}), { propertyIsEnumerable: da } = Object.prototype, fa = oe("RegExp"), an = (e, t) => {
|
|
190
190
|
const n = Object.getOwnPropertyDescriptors(e), a = {};
|
|
191
191
|
Ue(n, (r, o) => {
|
|
192
192
|
let s;
|
|
193
193
|
(s = t(r, o, e)) !== !1 && (a[o] = s || r);
|
|
194
194
|
}), Object.defineProperties(e, a);
|
|
195
|
-
},
|
|
196
|
-
|
|
197
|
-
if (
|
|
195
|
+
}, pa = (e) => {
|
|
196
|
+
an(e, (t, n) => {
|
|
197
|
+
if (Q(e) && ["arguments", "caller", "callee"].includes(n))
|
|
198
198
|
return !1;
|
|
199
199
|
const a = e[n];
|
|
200
|
-
if (
|
|
200
|
+
if (Q(a)) {
|
|
201
201
|
if (t.enumerable = !1, "writable" in t) {
|
|
202
202
|
t.writable = !1;
|
|
203
203
|
return;
|
|
@@ -207,19 +207,19 @@ const Yn = (e, t, n, { allOwnKeys: a } = {}) => (Ue(
|
|
|
207
207
|
});
|
|
208
208
|
}
|
|
209
209
|
});
|
|
210
|
-
},
|
|
210
|
+
}, ma = (e, t) => {
|
|
211
211
|
const n = {}, a = (r) => {
|
|
212
212
|
r.forEach((o) => {
|
|
213
213
|
n[o] = !0;
|
|
214
214
|
});
|
|
215
215
|
};
|
|
216
|
-
return
|
|
217
|
-
},
|
|
218
|
-
},
|
|
219
|
-
function
|
|
220
|
-
return !!(e &&
|
|
216
|
+
return Re(e) ? a(e) : a(String(e).split(t)), n;
|
|
217
|
+
}, ga = () => {
|
|
218
|
+
}, ha = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
|
|
219
|
+
function ba(e) {
|
|
220
|
+
return !!(e && Q(e.append) && e[Qt] === "FormData" && e[Le]);
|
|
221
221
|
}
|
|
222
|
-
const
|
|
222
|
+
const ya = (e) => {
|
|
223
223
|
const t = /* @__PURE__ */ new WeakSet(), n = (a) => {
|
|
224
224
|
if (Be(a)) {
|
|
225
225
|
if (t.has(a))
|
|
@@ -228,7 +228,7 @@ const ga = (e) => {
|
|
|
228
228
|
return a;
|
|
229
229
|
if (!("toJSON" in a)) {
|
|
230
230
|
t.add(a);
|
|
231
|
-
const r =
|
|
231
|
+
const r = Re(a) ? [] : {};
|
|
232
232
|
return Ue(a, (o, s) => {
|
|
233
233
|
const i = n(o);
|
|
234
234
|
!_e(i) && (r[s] = i);
|
|
@@ -238,79 +238,79 @@ const ga = (e) => {
|
|
|
238
238
|
return a;
|
|
239
239
|
};
|
|
240
240
|
return n(e);
|
|
241
|
-
},
|
|
241
|
+
}, va = oe("AsyncFunction"), wa = (e) => e && (Be(e) || Q(e)) && Q(e.then) && Q(e.catch), rn = ((e, t) => e ? setImmediate : t ? ((n, a) => (Ee.addEventListener(
|
|
242
242
|
"message",
|
|
243
243
|
({ source: r, data: o }) => {
|
|
244
|
-
r ===
|
|
244
|
+
r === Ee && o === n && a.length && a.shift()();
|
|
245
245
|
},
|
|
246
246
|
!1
|
|
247
247
|
), (r) => {
|
|
248
|
-
a.push(r),
|
|
249
|
-
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(typeof setImmediate == "function",
|
|
250
|
-
isArray:
|
|
251
|
-
isArrayBuffer:
|
|
248
|
+
a.push(r), Ee.postMessage(n, "*");
|
|
249
|
+
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(typeof setImmediate == "function", Q(Ee.postMessage)), xa = typeof queueMicrotask < "u" ? queueMicrotask.bind(Ee) : typeof process < "u" && process.nextTick || rn, on = (e) => e != null && Q(e[Le]), ka = (e) => e != null && Ne(e, Le) && on(e), l = {
|
|
250
|
+
isArray: Re,
|
|
251
|
+
isArrayBuffer: Yt,
|
|
252
252
|
isBuffer: Ae,
|
|
253
|
-
isFormData:
|
|
254
|
-
isArrayBufferView:
|
|
255
|
-
isString:
|
|
256
|
-
isNumber:
|
|
257
|
-
isBoolean:
|
|
253
|
+
isFormData: Jn,
|
|
254
|
+
isArrayBufferView: Nn,
|
|
255
|
+
isString: Ln,
|
|
256
|
+
isNumber: en,
|
|
257
|
+
isBoolean: Un,
|
|
258
258
|
isObject: Be,
|
|
259
259
|
isPlainObject: Ge,
|
|
260
|
-
isEmptyObject:
|
|
261
|
-
isReadableStream:
|
|
262
|
-
isRequest:
|
|
263
|
-
isResponse:
|
|
264
|
-
isHeaders:
|
|
260
|
+
isEmptyObject: jn,
|
|
261
|
+
isReadableStream: Kn,
|
|
262
|
+
isRequest: Xn,
|
|
263
|
+
isResponse: Zn,
|
|
264
|
+
isHeaders: Qn,
|
|
265
265
|
isUndefined: _e,
|
|
266
|
-
isDate:
|
|
267
|
-
isFile:
|
|
268
|
-
isReactNativeBlob:
|
|
269
|
-
isReactNative:
|
|
270
|
-
isBlob:
|
|
271
|
-
isRegExp:
|
|
272
|
-
isFunction:
|
|
273
|
-
isStream:
|
|
274
|
-
isURLSearchParams:
|
|
275
|
-
isTypedArray:
|
|
276
|
-
isFileList:
|
|
266
|
+
isDate: In,
|
|
267
|
+
isFile: Mn,
|
|
268
|
+
isReactNativeBlob: zn,
|
|
269
|
+
isReactNative: Vn,
|
|
270
|
+
isBlob: qn,
|
|
271
|
+
isRegExp: fa,
|
|
272
|
+
isFunction: Q,
|
|
273
|
+
isStream: Gn,
|
|
274
|
+
isURLSearchParams: Wn,
|
|
275
|
+
isTypedArray: sa,
|
|
276
|
+
isFileList: $n,
|
|
277
277
|
forEach: Ue,
|
|
278
278
|
merge: dt,
|
|
279
|
-
extend:
|
|
280
|
-
trim:
|
|
281
|
-
stripBOM:
|
|
282
|
-
inherits:
|
|
283
|
-
toFlatObject:
|
|
279
|
+
extend: ea,
|
|
280
|
+
trim: Yn,
|
|
281
|
+
stripBOM: ta,
|
|
282
|
+
inherits: na,
|
|
283
|
+
toFlatObject: aa,
|
|
284
284
|
kindOf: bt,
|
|
285
|
-
kindOfTest:
|
|
286
|
-
endsWith:
|
|
287
|
-
toArray:
|
|
288
|
-
forEachEntry:
|
|
289
|
-
matchAll:
|
|
290
|
-
isHTMLForm:
|
|
285
|
+
kindOfTest: oe,
|
|
286
|
+
endsWith: ra,
|
|
287
|
+
toArray: oa,
|
|
288
|
+
forEachEntry: ia,
|
|
289
|
+
matchAll: la,
|
|
290
|
+
isHTMLForm: ua,
|
|
291
291
|
hasOwnProperty: Ke,
|
|
292
292
|
hasOwnProp: Ke,
|
|
293
293
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
294
294
|
hasOwnInPrototypeChain: Ne,
|
|
295
|
-
getSafeProp:
|
|
296
|
-
reduceDescriptors:
|
|
297
|
-
freezeMethods:
|
|
298
|
-
toObjectSet:
|
|
299
|
-
toCamelCase:
|
|
300
|
-
noop:
|
|
301
|
-
toFiniteNumber:
|
|
302
|
-
findKey:
|
|
303
|
-
global:
|
|
304
|
-
isContextDefined:
|
|
305
|
-
isSpecCompliantForm:
|
|
306
|
-
toJSONObject:
|
|
307
|
-
isAsyncFn:
|
|
308
|
-
isThenable:
|
|
309
|
-
setImmediate:
|
|
310
|
-
asap:
|
|
311
|
-
isIterable:
|
|
312
|
-
isSafeIterable:
|
|
313
|
-
},
|
|
295
|
+
getSafeProp: Fn,
|
|
296
|
+
reduceDescriptors: an,
|
|
297
|
+
freezeMethods: pa,
|
|
298
|
+
toObjectSet: ma,
|
|
299
|
+
toCamelCase: ca,
|
|
300
|
+
noop: ga,
|
|
301
|
+
toFiniteNumber: ha,
|
|
302
|
+
findKey: tn,
|
|
303
|
+
global: Ee,
|
|
304
|
+
isContextDefined: nn,
|
|
305
|
+
isSpecCompliantForm: ba,
|
|
306
|
+
toJSONObject: ya,
|
|
307
|
+
isAsyncFn: va,
|
|
308
|
+
isThenable: wa,
|
|
309
|
+
setImmediate: rn,
|
|
310
|
+
asap: xa,
|
|
311
|
+
isIterable: on,
|
|
312
|
+
isSafeIterable: ka
|
|
313
|
+
}, Sa = l.toObjectSet([
|
|
314
314
|
"age",
|
|
315
315
|
"authorization",
|
|
316
316
|
"content-length",
|
|
@@ -328,15 +328,15 @@ const ga = (e) => {
|
|
|
328
328
|
"referer",
|
|
329
329
|
"retry-after",
|
|
330
330
|
"user-agent"
|
|
331
|
-
]),
|
|
331
|
+
]), Pa = (e) => {
|
|
332
332
|
const t = {};
|
|
333
333
|
let n, a, r;
|
|
334
334
|
return e && e.split(`
|
|
335
335
|
`).forEach(function(o) {
|
|
336
|
-
r = o.indexOf(":"), n = o.substring(0, r).trim().toLowerCase(), a = o.substring(r + 1).trim(), !(!n || t[n] &&
|
|
336
|
+
r = o.indexOf(":"), n = o.substring(0, r).trim().toLowerCase(), a = o.substring(r + 1).trim(), !(!n || t[n] && Sa[n]) && (n === "set-cookie" ? t[n] ? t[n].push(a) : t[n] = [a] : t[n] = t[n] ? t[n] + ", " + a : a);
|
|
337
337
|
}), t;
|
|
338
338
|
};
|
|
339
|
-
function
|
|
339
|
+
function Ea(e) {
|
|
340
340
|
let t = 0, n = e.length;
|
|
341
341
|
for (; t < n; ) {
|
|
342
342
|
const a = e.charCodeAt(t);
|
|
@@ -352,32 +352,32 @@ function ka(e) {
|
|
|
352
352
|
}
|
|
353
353
|
return t === 0 && n === e.length ? e : e.slice(t, n);
|
|
354
354
|
}
|
|
355
|
-
const
|
|
355
|
+
const Ra = new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+", "g"), Ta = new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+", "g");
|
|
356
356
|
function yt(e, t) {
|
|
357
|
-
return l.isArray(e) ? e.map((n) => yt(n, t)) :
|
|
357
|
+
return l.isArray(e) ? e.map((n) => yt(n, t)) : Ea(String(e).replace(t, ""));
|
|
358
358
|
}
|
|
359
|
-
const
|
|
360
|
-
function
|
|
359
|
+
const Oa = (e) => yt(e, Ra), Ca = (e) => yt(e, Ta);
|
|
360
|
+
function sn(e) {
|
|
361
361
|
const t = /* @__PURE__ */ Object.create(null);
|
|
362
362
|
return l.forEach(e.toJSON(), (n, a) => {
|
|
363
|
-
t[a] =
|
|
363
|
+
t[a] = Ca(n);
|
|
364
364
|
}), t;
|
|
365
365
|
}
|
|
366
|
-
const
|
|
366
|
+
const Dt = Symbol("internals");
|
|
367
367
|
function Fe(e) {
|
|
368
368
|
return e && String(e).trim().toLowerCase();
|
|
369
369
|
}
|
|
370
370
|
function He(e) {
|
|
371
|
-
return e === !1 || e == null ? e : l.isArray(e) ? e.map(He) :
|
|
371
|
+
return e === !1 || e == null ? e : l.isArray(e) ? e.map(He) : Oa(String(e));
|
|
372
372
|
}
|
|
373
|
-
function
|
|
373
|
+
function _a(e) {
|
|
374
374
|
const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
375
375
|
let a;
|
|
376
376
|
for (; a = n.exec(e); )
|
|
377
377
|
t[a[1]] = a[2];
|
|
378
378
|
return t;
|
|
379
379
|
}
|
|
380
|
-
const
|
|
380
|
+
const Aa = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
|
|
381
381
|
function it(e, t, n, a, r) {
|
|
382
382
|
if (l.isFunction(a))
|
|
383
383
|
return a.call(this, t, n);
|
|
@@ -388,10 +388,10 @@ function it(e, t, n, a, r) {
|
|
|
388
388
|
return a.test(t);
|
|
389
389
|
}
|
|
390
390
|
}
|
|
391
|
-
function
|
|
391
|
+
function Ba(e) {
|
|
392
392
|
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, a) => n.toUpperCase() + a);
|
|
393
393
|
}
|
|
394
|
-
function
|
|
394
|
+
function Da(e, t) {
|
|
395
395
|
const n = l.toCamelCase(" " + t);
|
|
396
396
|
["get", "set", "has"].forEach((a) => {
|
|
397
397
|
Object.defineProperty(e, a + n, {
|
|
@@ -421,8 +421,8 @@ class et {
|
|
|
421
421
|
const s = (i, u) => l.forEach(i, (f, c) => o(f, c, u));
|
|
422
422
|
if (l.isPlainObject(t) || t instanceof this.constructor)
|
|
423
423
|
s(t, n);
|
|
424
|
-
else if (l.isString(t) && (t = t.trim()) && !
|
|
425
|
-
s(
|
|
424
|
+
else if (l.isString(t) && (t = t.trim()) && !Aa(t))
|
|
425
|
+
s(Pa(t), n);
|
|
426
426
|
else if (l.isObject(t) && l.isSafeIterable(t)) {
|
|
427
427
|
let i = /* @__PURE__ */ Object.create(null), u, f;
|
|
428
428
|
for (const c of t) {
|
|
@@ -443,7 +443,7 @@ class et {
|
|
|
443
443
|
if (!n)
|
|
444
444
|
return r;
|
|
445
445
|
if (n === !0)
|
|
446
|
-
return
|
|
446
|
+
return _a(r);
|
|
447
447
|
if (l.isFunction(n))
|
|
448
448
|
return n.call(this, r, a);
|
|
449
449
|
if (l.isRegExp(n))
|
|
@@ -487,7 +487,7 @@ class et {
|
|
|
487
487
|
n[s] = He(r), delete n[o];
|
|
488
488
|
return;
|
|
489
489
|
}
|
|
490
|
-
const i = t ?
|
|
490
|
+
const i = t ? Ba(o) : String(o).trim();
|
|
491
491
|
i !== o && delete n[o], n[i] = He(r), a[i] = !0;
|
|
492
492
|
}), this;
|
|
493
493
|
}
|
|
@@ -521,12 +521,12 @@ class et {
|
|
|
521
521
|
return n.forEach((r) => a.set(r)), a;
|
|
522
522
|
}
|
|
523
523
|
static accessor(t) {
|
|
524
|
-
const n = (this[
|
|
524
|
+
const n = (this[Dt] = this[Dt] = {
|
|
525
525
|
accessors: {}
|
|
526
526
|
}).accessors, a = this.prototype;
|
|
527
527
|
function r(o) {
|
|
528
528
|
const s = Fe(o);
|
|
529
|
-
n[s] || (
|
|
529
|
+
n[s] || (Da(a, o), n[s] = !0);
|
|
530
530
|
}
|
|
531
531
|
return l.isArray(t) ? t.forEach(r) : r(t), this;
|
|
532
532
|
}
|
|
@@ -549,8 +549,8 @@ l.reduceDescriptors(et.prototype, ({ value: e }, t) => {
|
|
|
549
549
|
};
|
|
550
550
|
});
|
|
551
551
|
l.freezeMethods(et);
|
|
552
|
-
const
|
|
553
|
-
function
|
|
552
|
+
const re = et, Fa = "[REDACTED ****]";
|
|
553
|
+
function Na(e) {
|
|
554
554
|
if (l.hasOwnProp(e, "toJSON"))
|
|
555
555
|
return !0;
|
|
556
556
|
let t = Object.getPrototypeOf(e);
|
|
@@ -561,13 +561,13 @@ function Ba(e) {
|
|
|
561
561
|
}
|
|
562
562
|
return !1;
|
|
563
563
|
}
|
|
564
|
-
function
|
|
564
|
+
function La(e, t) {
|
|
565
565
|
const n = new Set(t.map((o) => String(o).toLowerCase())), a = [], r = (o) => {
|
|
566
566
|
if (o === null || typeof o != "object" || l.isBuffer(o))
|
|
567
567
|
return o;
|
|
568
568
|
if (a.indexOf(o) !== -1)
|
|
569
569
|
return;
|
|
570
|
-
o instanceof
|
|
570
|
+
o instanceof re && (o = o.toJSON()), a.push(o);
|
|
571
571
|
let s;
|
|
572
572
|
if (l.isArray(o))
|
|
573
573
|
s = [], o.forEach((i, u) => {
|
|
@@ -575,11 +575,11 @@ function Da(e, t) {
|
|
|
575
575
|
l.isUndefined(f) || (s[u] = f);
|
|
576
576
|
});
|
|
577
577
|
else {
|
|
578
|
-
if (!l.isPlainObject(o) &&
|
|
578
|
+
if (!l.isPlainObject(o) && Na(o))
|
|
579
579
|
return a.pop(), o;
|
|
580
580
|
s = /* @__PURE__ */ Object.create(null);
|
|
581
581
|
for (const [i, u] of Object.entries(o)) {
|
|
582
|
-
const f = n.has(i.toLowerCase()) ?
|
|
582
|
+
const f = n.has(i.toLowerCase()) ? Fa : r(u);
|
|
583
583
|
l.isUndefined(f) || (s[i] = f);
|
|
584
584
|
}
|
|
585
585
|
}
|
|
@@ -587,9 +587,9 @@ function Da(e, t) {
|
|
|
587
587
|
};
|
|
588
588
|
return r(e);
|
|
589
589
|
}
|
|
590
|
-
class
|
|
590
|
+
class J extends Error {
|
|
591
591
|
static from(t, n, a, r, o, s) {
|
|
592
|
-
const i = new
|
|
592
|
+
const i = new J(t.message, n || t.code, a, r, o);
|
|
593
593
|
return Object.defineProperty(i, "cause", {
|
|
594
594
|
__proto__: null,
|
|
595
595
|
value: t,
|
|
@@ -621,7 +621,7 @@ class G extends Error {
|
|
|
621
621
|
}), this.name = "AxiosError", this.isAxiosError = !0, n && (this.code = n), a && (this.config = a), r && (this.request = r), o && (this.response = o, this.status = o.status);
|
|
622
622
|
}
|
|
623
623
|
toJSON() {
|
|
624
|
-
const t = this.config, n = t && l.hasOwnProp(t, "redact") ? t.redact : void 0, a = l.isArray(n) && n.length > 0 ?
|
|
624
|
+
const t = this.config, n = t && l.hasOwnProp(t, "redact") ? t.redact : void 0, a = l.isArray(n) && n.length > 0 ? La(t, n) : l.toJSONObject(t);
|
|
625
625
|
return {
|
|
626
626
|
// Standard
|
|
627
627
|
message: this.message,
|
|
@@ -641,36 +641,36 @@ class G extends Error {
|
|
|
641
641
|
};
|
|
642
642
|
}
|
|
643
643
|
}
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
const
|
|
659
|
-
function
|
|
644
|
+
J.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
|
|
645
|
+
J.ERR_BAD_OPTION = "ERR_BAD_OPTION";
|
|
646
|
+
J.ECONNABORTED = "ECONNABORTED";
|
|
647
|
+
J.ETIMEDOUT = "ETIMEDOUT";
|
|
648
|
+
J.ECONNREFUSED = "ECONNREFUSED";
|
|
649
|
+
J.ERR_NETWORK = "ERR_NETWORK";
|
|
650
|
+
J.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
|
|
651
|
+
J.ERR_DEPRECATED = "ERR_DEPRECATED";
|
|
652
|
+
J.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
|
|
653
|
+
J.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
|
|
654
|
+
J.ERR_CANCELED = "ERR_CANCELED";
|
|
655
|
+
J.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
|
|
656
|
+
J.ERR_INVALID_URL = "ERR_INVALID_URL";
|
|
657
|
+
J.ERR_FORM_DATA_DEPTH_EXCEEDED = "ERR_FORM_DATA_DEPTH_EXCEEDED";
|
|
658
|
+
const R = J, Ua = null, ln = 100;
|
|
659
|
+
function ft(e) {
|
|
660
660
|
return l.isPlainObject(e) || l.isArray(e);
|
|
661
661
|
}
|
|
662
|
-
function
|
|
662
|
+
function un(e) {
|
|
663
663
|
return l.endsWith(e, "[]") ? e.slice(0, -2) : e;
|
|
664
664
|
}
|
|
665
665
|
function lt(e, t, n) {
|
|
666
666
|
return e ? e.concat(t).map(function(a, r) {
|
|
667
|
-
return a =
|
|
667
|
+
return a = un(a), !n && r ? "[" + a + "]" : a;
|
|
668
668
|
}).join(n ? "." : "") : t;
|
|
669
669
|
}
|
|
670
|
-
function
|
|
671
|
-
return l.isArray(e) && !e.some(
|
|
670
|
+
function ja(e) {
|
|
671
|
+
return l.isArray(e) && !e.some(ft);
|
|
672
672
|
}
|
|
673
|
-
const
|
|
673
|
+
const Ia = l.toFlatObject(l, {}, null, function(e) {
|
|
674
674
|
return /^is[A-Z]/.test(e);
|
|
675
675
|
});
|
|
676
676
|
function tt(e, t, n) {
|
|
@@ -688,7 +688,7 @@ function tt(e, t, n) {
|
|
|
688
688
|
return !l.isUndefined(m[p]);
|
|
689
689
|
}
|
|
690
690
|
);
|
|
691
|
-
const a = n.metaTokens, r = n.visitor ||
|
|
691
|
+
const a = n.metaTokens, r = n.visitor || w, o = n.dots, s = n.indexes, i = n.Blob || typeof Blob < "u" && Blob, u = n.maxDepth === void 0 ? ln : n.maxDepth, f = i && l.isSpecCompliantForm(t), c = [];
|
|
692
692
|
if (!l.isFunction(r))
|
|
693
693
|
throw new TypeError("visitor must be a function");
|
|
694
694
|
function d(p) {
|
|
@@ -699,72 +699,72 @@ function tt(e, t, n) {
|
|
|
699
699
|
if (l.isBoolean(p))
|
|
700
700
|
return p.toString();
|
|
701
701
|
if (!f && l.isBlob(p))
|
|
702
|
-
throw new
|
|
702
|
+
throw new R("Blob is not supported. Use a Buffer instead.");
|
|
703
703
|
if (l.isArrayBuffer(p) || l.isTypedArray(p)) {
|
|
704
704
|
if (f && typeof i == "function")
|
|
705
705
|
return new i([p]);
|
|
706
706
|
if (typeof Buffer < "u")
|
|
707
707
|
return Buffer.from(p);
|
|
708
|
-
throw new
|
|
708
|
+
throw new R("Blob is not supported. Use a Buffer instead.", R.ERR_NOT_SUPPORT);
|
|
709
709
|
}
|
|
710
710
|
return p;
|
|
711
711
|
}
|
|
712
712
|
function b(p) {
|
|
713
713
|
if (p > u)
|
|
714
|
-
throw new
|
|
714
|
+
throw new R(
|
|
715
715
|
"Object is too deeply nested (" + p + " levels). Max depth: " + u,
|
|
716
|
-
|
|
716
|
+
R.ERR_FORM_DATA_DEPTH_EXCEEDED
|
|
717
717
|
);
|
|
718
718
|
}
|
|
719
|
-
function
|
|
719
|
+
function _(p, m) {
|
|
720
720
|
if (u === 1 / 0)
|
|
721
721
|
return JSON.stringify(p);
|
|
722
|
-
const
|
|
723
|
-
return JSON.stringify(p, function(
|
|
724
|
-
if (!l.isObject(
|
|
725
|
-
return
|
|
726
|
-
for (;
|
|
727
|
-
|
|
728
|
-
return
|
|
722
|
+
const P = [];
|
|
723
|
+
return JSON.stringify(p, function(x, k) {
|
|
724
|
+
if (!l.isObject(k))
|
|
725
|
+
return k;
|
|
726
|
+
for (; P.length && P[P.length - 1] !== this; )
|
|
727
|
+
P.pop();
|
|
728
|
+
return P.push(k), b(m + P.length - 1), k;
|
|
729
729
|
});
|
|
730
730
|
}
|
|
731
|
-
function
|
|
732
|
-
let
|
|
731
|
+
function w(p, m, P) {
|
|
732
|
+
let x = p;
|
|
733
733
|
if (l.isReactNative(t) && l.isReactNativeBlob(p))
|
|
734
|
-
return t.append(lt(
|
|
735
|
-
if (p && !
|
|
734
|
+
return t.append(lt(P, m, o), d(p)), !1;
|
|
735
|
+
if (p && !P && typeof p == "object") {
|
|
736
736
|
if (l.endsWith(m, "{}"))
|
|
737
|
-
m = a ? m : m.slice(0, -2), p =
|
|
738
|
-
else if (l.isArray(p) &&
|
|
739
|
-
return m =
|
|
740
|
-
!(l.isUndefined(
|
|
737
|
+
m = a ? m : m.slice(0, -2), p = _(p, 1);
|
|
738
|
+
else if (l.isArray(p) && ja(p) || (l.isFileList(p) || l.endsWith(m, "[]")) && (x = l.toArray(p)))
|
|
739
|
+
return m = un(m), x.forEach(function(k, g) {
|
|
740
|
+
!(l.isUndefined(k) || k === null) && t.append(
|
|
741
741
|
// eslint-disable-next-line no-nested-ternary
|
|
742
|
-
s === !0 ? lt([m],
|
|
743
|
-
d(
|
|
742
|
+
s === !0 ? lt([m], g, o) : s === null ? m : m + "[]",
|
|
743
|
+
d(k)
|
|
744
744
|
);
|
|
745
745
|
}), !1;
|
|
746
746
|
}
|
|
747
|
-
return
|
|
747
|
+
return ft(p) ? !0 : (t.append(lt(P, m, o), d(p)), !1);
|
|
748
748
|
}
|
|
749
|
-
const v = Object.assign(
|
|
750
|
-
defaultVisitor:
|
|
749
|
+
const v = Object.assign(Ia, {
|
|
750
|
+
defaultVisitor: w,
|
|
751
751
|
convertValue: d,
|
|
752
|
-
isVisitable:
|
|
752
|
+
isVisitable: ft
|
|
753
753
|
});
|
|
754
|
-
function
|
|
754
|
+
function y(p, m, P = 0) {
|
|
755
755
|
if (!l.isUndefined(p)) {
|
|
756
|
-
if (b(
|
|
756
|
+
if (b(P), c.indexOf(p) !== -1)
|
|
757
757
|
throw new Error("Circular reference detected in " + m.join("."));
|
|
758
|
-
c.push(p), l.forEach(p, function(
|
|
759
|
-
(!(l.isUndefined(
|
|
758
|
+
c.push(p), l.forEach(p, function(x, k) {
|
|
759
|
+
(!(l.isUndefined(x) || x === null) && r.call(t, x, l.isString(k) ? k.trim() : k, m, v)) === !0 && y(x, m ? m.concat(k) : [k], P + 1);
|
|
760
760
|
}), c.pop();
|
|
761
761
|
}
|
|
762
762
|
}
|
|
763
763
|
if (!l.isObject(e))
|
|
764
764
|
throw new TypeError("data must be an object");
|
|
765
|
-
return
|
|
765
|
+
return y(e), t;
|
|
766
766
|
}
|
|
767
|
-
function
|
|
767
|
+
function Ft(e) {
|
|
768
768
|
const t = {
|
|
769
769
|
"!": "%21",
|
|
770
770
|
"'": "%27",
|
|
@@ -780,26 +780,26 @@ function Dt(e) {
|
|
|
780
780
|
function vt(e, t) {
|
|
781
781
|
this._pairs = [], e && tt(e, this, t);
|
|
782
782
|
}
|
|
783
|
-
const
|
|
784
|
-
|
|
783
|
+
const cn = vt.prototype;
|
|
784
|
+
cn.append = function(e, t) {
|
|
785
785
|
this._pairs.push([e, t]);
|
|
786
786
|
};
|
|
787
|
-
|
|
788
|
-
const t = e ? (n) => e.call(this, n,
|
|
787
|
+
cn.toString = function(e) {
|
|
788
|
+
const t = e ? (n) => e.call(this, n, Ft) : Ft;
|
|
789
789
|
return this._pairs.map(function(n) {
|
|
790
790
|
return t(n[0]) + "=" + t(n[1]);
|
|
791
791
|
}, "").join("&");
|
|
792
792
|
};
|
|
793
|
-
function
|
|
793
|
+
function Ma(e) {
|
|
794
794
|
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
|
|
795
795
|
}
|
|
796
|
-
function
|
|
796
|
+
function dn(e, t, n) {
|
|
797
797
|
if (!t)
|
|
798
798
|
return e;
|
|
799
799
|
e = e || "";
|
|
800
800
|
const a = l.isFunction(n) ? {
|
|
801
801
|
serialize: n
|
|
802
|
-
} : n, r = l.getSafeProp(a, "encode") ||
|
|
802
|
+
} : n, r = l.getSafeProp(a, "encode") || Ma, o = l.getSafeProp(a, "serialize");
|
|
803
803
|
let s;
|
|
804
804
|
if (o ? s = o(t, a) : s = l.isURLSearchParams(t) ? t.toString() : new vt(t, a).toString(r), s) {
|
|
805
805
|
const i = e.indexOf("#");
|
|
@@ -807,7 +807,7 @@ function cn(e, t, n) {
|
|
|
807
807
|
}
|
|
808
808
|
return e;
|
|
809
809
|
}
|
|
810
|
-
class
|
|
810
|
+
class za {
|
|
811
811
|
constructor() {
|
|
812
812
|
this.handlers = [];
|
|
813
813
|
}
|
|
@@ -862,57 +862,57 @@ class ja {
|
|
|
862
862
|
});
|
|
863
863
|
}
|
|
864
864
|
}
|
|
865
|
-
const
|
|
865
|
+
const Nt = za, wt = {
|
|
866
866
|
silentJSONParsing: !0,
|
|
867
867
|
forcedJSONParsing: !0,
|
|
868
868
|
clarifyTimeoutError: !1,
|
|
869
869
|
legacyInterceptorReqResOrdering: !0,
|
|
870
870
|
advertiseZstdAcceptEncoding: !1,
|
|
871
871
|
validateStatusUndefinedResolves: !0
|
|
872
|
-
},
|
|
872
|
+
}, Va = typeof URLSearchParams < "u" ? URLSearchParams : vt, qa = typeof FormData < "u" ? FormData : null, $a = typeof Blob < "u" ? Blob : null, Ga = {
|
|
873
873
|
isBrowser: !0,
|
|
874
874
|
classes: {
|
|
875
|
-
URLSearchParams:
|
|
876
|
-
FormData:
|
|
877
|
-
Blob:
|
|
875
|
+
URLSearchParams: Va,
|
|
876
|
+
FormData: qa,
|
|
877
|
+
Blob: $a
|
|
878
878
|
},
|
|
879
879
|
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
880
|
-
}, xt = typeof window < "u" && typeof document < "u",
|
|
881
|
-
self instanceof WorkerGlobalScope && typeof self.importScripts == "function")(),
|
|
880
|
+
}, xt = typeof window < "u" && typeof document < "u", pt = typeof navigator == "object" && navigator || void 0, Ha = xt && (!pt || ["ReactNative", "NativeScript", "NS"].indexOf(pt.product) < 0), Ja = (() => typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
881
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts == "function")(), Wa = xt && window.location.href || "http://localhost", Ka = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
882
882
|
__proto__: null,
|
|
883
883
|
hasBrowserEnv: xt,
|
|
884
|
-
hasStandardBrowserEnv:
|
|
885
|
-
hasStandardBrowserWebWorkerEnv:
|
|
886
|
-
navigator:
|
|
887
|
-
origin:
|
|
888
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
889
|
-
...
|
|
890
|
-
...
|
|
884
|
+
hasStandardBrowserEnv: Ha,
|
|
885
|
+
hasStandardBrowserWebWorkerEnv: Ja,
|
|
886
|
+
navigator: pt,
|
|
887
|
+
origin: Wa
|
|
888
|
+
}, Symbol.toStringTag, { value: "Module" })), H = {
|
|
889
|
+
...Ka,
|
|
890
|
+
...Ga
|
|
891
891
|
};
|
|
892
|
-
function
|
|
893
|
-
return tt(e, new
|
|
892
|
+
function Xa(e, t) {
|
|
893
|
+
return tt(e, new H.classes.URLSearchParams(), {
|
|
894
894
|
visitor: function(n, a, r, o) {
|
|
895
|
-
return
|
|
895
|
+
return H.isNode && l.isBuffer(n) ? (this.append(a, n.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
|
|
896
896
|
},
|
|
897
897
|
...t
|
|
898
898
|
});
|
|
899
899
|
}
|
|
900
|
-
const
|
|
901
|
-
function
|
|
902
|
-
if (e >
|
|
903
|
-
throw new
|
|
904
|
-
"FormData field is too deeply nested (" + e + " levels). Max depth: " +
|
|
905
|
-
|
|
900
|
+
const Lt = ln;
|
|
901
|
+
function fn(e) {
|
|
902
|
+
if (e > Lt)
|
|
903
|
+
throw new R(
|
|
904
|
+
"FormData field is too deeply nested (" + e + " levels). Max depth: " + Lt,
|
|
905
|
+
R.ERR_FORM_DATA_DEPTH_EXCEEDED
|
|
906
906
|
);
|
|
907
907
|
}
|
|
908
|
-
function
|
|
908
|
+
function Za(e) {
|
|
909
909
|
const t = [], n = /\w+|\[(\w*)]/g;
|
|
910
910
|
let a;
|
|
911
911
|
for (; (a = n.exec(e)) !== null; )
|
|
912
|
-
|
|
912
|
+
fn(t.length), t.push(a[0] === "[]" ? "" : a[1] || a[0]);
|
|
913
913
|
return t;
|
|
914
914
|
}
|
|
915
|
-
function
|
|
915
|
+
function Qa(e) {
|
|
916
916
|
const t = {}, n = Object.keys(e);
|
|
917
917
|
let a;
|
|
918
918
|
const r = n.length;
|
|
@@ -923,23 +923,23 @@ function Ka(e) {
|
|
|
923
923
|
}
|
|
924
924
|
function pn(e) {
|
|
925
925
|
function t(n, a, r, o) {
|
|
926
|
-
|
|
926
|
+
fn(o);
|
|
927
927
|
let s = n[o++];
|
|
928
928
|
if (s === "__proto__")
|
|
929
929
|
return !0;
|
|
930
930
|
const i = Number.isFinite(+s), u = o >= n.length;
|
|
931
|
-
return s = !s && l.isArray(r) ? r.length : s, u ? (l.hasOwnProp(r, s) ? r[s] = l.isArray(r[s]) ? r[s].concat(a) : [r[s], a] : r[s] = a, !i) : ((!l.hasOwnProp(r, s) || !l.isObject(r[s])) && (r[s] = []), t(n, a, r[s], o) && l.isArray(r[s]) && (r[s] =
|
|
931
|
+
return s = !s && l.isArray(r) ? r.length : s, u ? (l.hasOwnProp(r, s) ? r[s] = l.isArray(r[s]) ? r[s].concat(a) : [r[s], a] : r[s] = a, !i) : ((!l.hasOwnProp(r, s) || !l.isObject(r[s])) && (r[s] = []), t(n, a, r[s], o) && l.isArray(r[s]) && (r[s] = Qa(r[s])), !i);
|
|
932
932
|
}
|
|
933
933
|
if (l.isFormData(e) && l.isFunction(e.entries)) {
|
|
934
934
|
const n = {};
|
|
935
935
|
return l.forEachEntry(e, (a, r) => {
|
|
936
|
-
t(
|
|
936
|
+
t(Za(a), r, n, 0);
|
|
937
937
|
}), n;
|
|
938
938
|
}
|
|
939
939
|
return null;
|
|
940
940
|
}
|
|
941
|
-
const
|
|
942
|
-
function
|
|
941
|
+
const Oe = (e, t) => e != null && l.hasOwnProp(e, t) ? e[t] : void 0;
|
|
942
|
+
function Ya(e, t, n) {
|
|
943
943
|
if (l.isString(e))
|
|
944
944
|
try {
|
|
945
945
|
return (t || JSON.parse)(e), l.trim(e);
|
|
@@ -965,11 +965,11 @@ const kt = {
|
|
|
965
965
|
return t.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), e.toString();
|
|
966
966
|
let o;
|
|
967
967
|
if (r) {
|
|
968
|
-
const s =
|
|
968
|
+
const s = Oe(this, "formSerializer");
|
|
969
969
|
if (n.indexOf("application/x-www-form-urlencoded") > -1)
|
|
970
|
-
return
|
|
970
|
+
return Xa(e, s).toString();
|
|
971
971
|
if ((o = l.isFileList(e)) || n.indexOf("multipart/form-data") > -1) {
|
|
972
|
-
const i =
|
|
972
|
+
const i = Oe(this, "env"), u = i && i.FormData;
|
|
973
973
|
return tt(
|
|
974
974
|
o ? { "files[]": e } : e,
|
|
975
975
|
u && new u(),
|
|
@@ -977,21 +977,21 @@ const kt = {
|
|
|
977
977
|
);
|
|
978
978
|
}
|
|
979
979
|
}
|
|
980
|
-
return r || a ? (t.setContentType("application/json", !1),
|
|
980
|
+
return r || a ? (t.setContentType("application/json", !1), Ya(e)) : e;
|
|
981
981
|
}
|
|
982
982
|
],
|
|
983
983
|
transformResponse: [
|
|
984
984
|
function(e) {
|
|
985
|
-
const t =
|
|
985
|
+
const t = Oe(this, "transitional") || kt.transitional, n = t && t.forcedJSONParsing, a = Oe(this, "responseType"), r = a === "json";
|
|
986
986
|
if (l.isResponse(e) || l.isReadableStream(e))
|
|
987
987
|
return e;
|
|
988
988
|
if (e && l.isString(e) && (n && !a || r)) {
|
|
989
989
|
const o = !(t && t.silentJSONParsing) && r;
|
|
990
990
|
try {
|
|
991
|
-
return JSON.parse(e,
|
|
991
|
+
return JSON.parse(e, Oe(this, "parseReviver"));
|
|
992
992
|
} catch (s) {
|
|
993
993
|
if (o)
|
|
994
|
-
throw s.name === "SyntaxError" ?
|
|
994
|
+
throw s.name === "SyntaxError" ? R.from(s, R.ERR_BAD_RESPONSE, this, null, Oe(this, "response")) : s;
|
|
995
995
|
}
|
|
996
996
|
}
|
|
997
997
|
return e;
|
|
@@ -1007,8 +1007,8 @@ const kt = {
|
|
|
1007
1007
|
maxContentLength: -1,
|
|
1008
1008
|
maxBodyLength: -1,
|
|
1009
1009
|
env: {
|
|
1010
|
-
FormData:
|
|
1011
|
-
Blob:
|
|
1010
|
+
FormData: H.classes.FormData,
|
|
1011
|
+
Blob: H.classes.Blob
|
|
1012
1012
|
},
|
|
1013
1013
|
validateStatus: function(e) {
|
|
1014
1014
|
return e >= 200 && e < 300;
|
|
@@ -1023,18 +1023,18 @@ const kt = {
|
|
|
1023
1023
|
l.forEach(["delete", "get", "head", "post", "put", "patch", "query"], (e) => {
|
|
1024
1024
|
kt.headers[e] = {};
|
|
1025
1025
|
});
|
|
1026
|
-
const
|
|
1026
|
+
const St = kt;
|
|
1027
1027
|
function ut(e, t) {
|
|
1028
|
-
const n = this ||
|
|
1028
|
+
const n = this || St, a = t || n, r = re.from(a.headers);
|
|
1029
1029
|
let o = a.data;
|
|
1030
1030
|
return l.forEach(e, function(s) {
|
|
1031
1031
|
o = s.call(n, o, r.normalize(), t ? t.status : void 0);
|
|
1032
1032
|
}), r.normalize(), o;
|
|
1033
1033
|
}
|
|
1034
|
-
function
|
|
1034
|
+
function mn(e) {
|
|
1035
1035
|
return !!(e && e.__CANCEL__);
|
|
1036
1036
|
}
|
|
1037
|
-
class
|
|
1037
|
+
class er extends R {
|
|
1038
1038
|
/**
|
|
1039
1039
|
* A `CanceledError` is an object that is thrown when an operation is canceled.
|
|
1040
1040
|
*
|
|
@@ -1045,25 +1045,25 @@ class Ya extends E {
|
|
|
1045
1045
|
* @returns {CanceledError} The created error.
|
|
1046
1046
|
*/
|
|
1047
1047
|
constructor(t, n, a) {
|
|
1048
|
-
super(t ?? "canceled",
|
|
1048
|
+
super(t ?? "canceled", R.ERR_CANCELED, n, a), this.name = "CanceledError", this.__CANCEL__ = !0;
|
|
1049
1049
|
}
|
|
1050
1050
|
}
|
|
1051
|
-
const je =
|
|
1052
|
-
function
|
|
1051
|
+
const je = er;
|
|
1052
|
+
function gn(e, t, n) {
|
|
1053
1053
|
const a = n.config.validateStatus;
|
|
1054
|
-
!n.status || !a || a(n.status) ? e(n) : t(new
|
|
1054
|
+
!n.status || !a || a(n.status) ? e(n) : t(new R(
|
|
1055
1055
|
"Request failed with status code " + n.status,
|
|
1056
|
-
n.status >= 400 && n.status < 500 ?
|
|
1056
|
+
n.status >= 400 && n.status < 500 ? R.ERR_BAD_REQUEST : R.ERR_BAD_RESPONSE,
|
|
1057
1057
|
n.config,
|
|
1058
1058
|
n.request,
|
|
1059
1059
|
n
|
|
1060
1060
|
));
|
|
1061
1061
|
}
|
|
1062
|
-
function
|
|
1062
|
+
function tr(e) {
|
|
1063
1063
|
const t = /^([-+\w]{1,25}):(?:\/\/)?/.exec(e);
|
|
1064
1064
|
return t && t[1] || "";
|
|
1065
1065
|
}
|
|
1066
|
-
function
|
|
1066
|
+
function nr(e, t) {
|
|
1067
1067
|
e = e || 10;
|
|
1068
1068
|
const n = new Array(e), a = new Array(e);
|
|
1069
1069
|
let r = 0, o = 0, s;
|
|
@@ -1079,7 +1079,7 @@ function Za(e, t) {
|
|
|
1079
1079
|
return b ? Math.round(d * 1e3 / b) : void 0;
|
|
1080
1080
|
};
|
|
1081
1081
|
}
|
|
1082
|
-
function
|
|
1082
|
+
function ar(e, t) {
|
|
1083
1083
|
let n = 0, a = 1e3 / t, r, o;
|
|
1084
1084
|
const s = (i, u = Date.now()) => {
|
|
1085
1085
|
n = u, r = null, o && (clearTimeout(o), o = null), e(...i);
|
|
@@ -1093,8 +1093,8 @@ function er(e, t) {
|
|
|
1093
1093
|
}
|
|
1094
1094
|
const Xe = (e, t, n = 3) => {
|
|
1095
1095
|
let a = 0;
|
|
1096
|
-
const r =
|
|
1097
|
-
return
|
|
1096
|
+
const r = nr(50, 250);
|
|
1097
|
+
return ar((o) => {
|
|
1098
1098
|
if (!o || typeof o.loaded != "number")
|
|
1099
1099
|
return;
|
|
1100
1100
|
const s = o.loaded, i = o.lengthComputable ? o.total : void 0, u = i != null ? Math.min(s, i) : s, f = Math.max(0, u - a), c = r(f);
|
|
@@ -1112,7 +1112,7 @@ const Xe = (e, t, n = 3) => {
|
|
|
1112
1112
|
};
|
|
1113
1113
|
e(d);
|
|
1114
1114
|
}, n);
|
|
1115
|
-
},
|
|
1115
|
+
}, Ut = (e, t) => {
|
|
1116
1116
|
const n = e != null;
|
|
1117
1117
|
return [
|
|
1118
1118
|
(a) => t[0]({
|
|
@@ -1122,10 +1122,10 @@ const Xe = (e, t, n = 3) => {
|
|
|
1122
1122
|
}),
|
|
1123
1123
|
t[1]
|
|
1124
1124
|
];
|
|
1125
|
-
},
|
|
1126
|
-
new URL(
|
|
1127
|
-
|
|
1128
|
-
) : () => !0,
|
|
1125
|
+
}, jt = (e) => (...t) => l.asap(() => e(...t)), rr = H.hasStandardBrowserEnv ? ((e, t) => (n) => (n = new URL(n, H.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
|
|
1126
|
+
new URL(H.origin),
|
|
1127
|
+
H.navigator && /(msie|trident)/i.test(H.navigator.userAgent)
|
|
1128
|
+
) : () => !0, or = H.hasStandardBrowserEnv ? (
|
|
1129
1129
|
// Standard browser envs support document.cookie
|
|
1130
1130
|
{
|
|
1131
1131
|
write(e, t, n, a, r, o, s) {
|
|
@@ -1165,37 +1165,37 @@ const Xe = (e, t, n = 3) => {
|
|
|
1165
1165
|
}
|
|
1166
1166
|
}
|
|
1167
1167
|
);
|
|
1168
|
-
function
|
|
1168
|
+
function sr(e) {
|
|
1169
1169
|
return typeof e != "string" ? !1 : /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
|
|
1170
1170
|
}
|
|
1171
|
-
function
|
|
1171
|
+
function ir(e, t) {
|
|
1172
1172
|
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
|
|
1173
1173
|
}
|
|
1174
|
-
const
|
|
1175
|
-
function
|
|
1174
|
+
const lr = /^https?:(?!\/\/)/i, ur = /[\t\n\r]/g;
|
|
1175
|
+
function cr(e) {
|
|
1176
1176
|
let t = 0;
|
|
1177
1177
|
for (; t < e.length && e.charCodeAt(t) <= 32; )
|
|
1178
1178
|
t++;
|
|
1179
1179
|
return e.slice(t);
|
|
1180
1180
|
}
|
|
1181
|
-
function
|
|
1182
|
-
return
|
|
1181
|
+
function dr(e) {
|
|
1182
|
+
return cr(e).replace(ur, "");
|
|
1183
1183
|
}
|
|
1184
|
-
function
|
|
1185
|
-
if (typeof e == "string" &&
|
|
1186
|
-
throw new
|
|
1184
|
+
function It(e, t) {
|
|
1185
|
+
if (typeof e == "string" && lr.test(dr(e)))
|
|
1186
|
+
throw new R(
|
|
1187
1187
|
'Invalid URL: missing "//" after protocol',
|
|
1188
|
-
|
|
1188
|
+
R.ERR_INVALID_URL,
|
|
1189
1189
|
t
|
|
1190
1190
|
);
|
|
1191
1191
|
}
|
|
1192
|
-
function
|
|
1193
|
-
|
|
1194
|
-
let r = !
|
|
1195
|
-
return e && (r || n === !1) ? (
|
|
1192
|
+
function hn(e, t, n, a) {
|
|
1193
|
+
It(t, a);
|
|
1194
|
+
let r = !sr(t);
|
|
1195
|
+
return e && (r || n === !1) ? (It(e, a), ir(e, t)) : t;
|
|
1196
1196
|
}
|
|
1197
|
-
const
|
|
1198
|
-
function
|
|
1197
|
+
const Mt = (e) => e instanceof re ? { ...e } : e;
|
|
1198
|
+
function Te(e, t) {
|
|
1199
1199
|
e = e || {}, t = t || {};
|
|
1200
1200
|
const n = /* @__PURE__ */ Object.create(null);
|
|
1201
1201
|
Object.defineProperty(n, "hasOwnProperty", {
|
|
@@ -1207,15 +1207,15 @@ function Se(e, t) {
|
|
|
1207
1207
|
writable: !0,
|
|
1208
1208
|
configurable: !0
|
|
1209
1209
|
});
|
|
1210
|
-
function a(c, d, b,
|
|
1211
|
-
return l.isPlainObject(c) && l.isPlainObject(d) ? l.merge.call({ caseless:
|
|
1210
|
+
function a(c, d, b, _) {
|
|
1211
|
+
return l.isPlainObject(c) && l.isPlainObject(d) ? l.merge.call({ caseless: _ }, c, d) : l.isPlainObject(d) ? l.merge({}, d) : l.isArray(d) ? d.slice() : d;
|
|
1212
1212
|
}
|
|
1213
|
-
function r(c, d, b,
|
|
1213
|
+
function r(c, d, b, _) {
|
|
1214
1214
|
if (l.isUndefined(d)) {
|
|
1215
1215
|
if (!l.isUndefined(c))
|
|
1216
|
-
return a(void 0, c, b,
|
|
1216
|
+
return a(void 0, c, b, _);
|
|
1217
1217
|
} else
|
|
1218
|
-
return a(c, d, b,
|
|
1218
|
+
return a(c, d, b, _);
|
|
1219
1219
|
}
|
|
1220
1220
|
function o(c, d) {
|
|
1221
1221
|
if (!l.isUndefined(d))
|
|
@@ -1276,73 +1276,73 @@ function Se(e, t) {
|
|
|
1276
1276
|
allowedSocketPaths: s,
|
|
1277
1277
|
responseEncoding: s,
|
|
1278
1278
|
validateStatus: u,
|
|
1279
|
-
headers: (c, d, b) => r(
|
|
1279
|
+
headers: (c, d, b) => r(Mt(c), Mt(d), b, !0)
|
|
1280
1280
|
};
|
|
1281
1281
|
return l.forEach(Object.keys({ ...e, ...t }), function(c) {
|
|
1282
1282
|
if (c === "__proto__" || c === "constructor" || c === "prototype")
|
|
1283
1283
|
return;
|
|
1284
|
-
const d = l.hasOwnProp(f, c) ? f[c] : r, b = l.hasOwnProp(e, c) ? e[c] : void 0,
|
|
1285
|
-
l.isUndefined(
|
|
1284
|
+
const d = l.hasOwnProp(f, c) ? f[c] : r, b = l.hasOwnProp(e, c) ? e[c] : void 0, _ = l.hasOwnProp(t, c) ? t[c] : void 0, w = d(b, _, c);
|
|
1285
|
+
l.isUndefined(w) && d !== u || (n[c] = w);
|
|
1286
1286
|
}), l.hasOwnProp(t, "validateStatus") && l.isUndefined(t.validateStatus) && i("validateStatusUndefinedResolves") === !1 && (l.hasOwnProp(e, "validateStatus") ? n.validateStatus = a(void 0, e.validateStatus) : delete n.validateStatus), n;
|
|
1287
1287
|
}
|
|
1288
|
-
const
|
|
1289
|
-
function
|
|
1288
|
+
const fr = ["content-type", "content-length"];
|
|
1289
|
+
function pr(e, t, n) {
|
|
1290
1290
|
if (n !== "content-only") {
|
|
1291
1291
|
e.set(t);
|
|
1292
1292
|
return;
|
|
1293
1293
|
}
|
|
1294
1294
|
Object.entries(t || {}).forEach(([a, r]) => {
|
|
1295
|
-
|
|
1295
|
+
fr.includes(a.toLowerCase()) && e.set(a, r);
|
|
1296
1296
|
});
|
|
1297
1297
|
}
|
|
1298
|
-
const
|
|
1298
|
+
const mr = (e) => encodeURIComponent(e).replace(
|
|
1299
1299
|
/%([0-9A-F]{2})/gi,
|
|
1300
1300
|
(t, n) => String.fromCharCode(parseInt(n, 16))
|
|
1301
1301
|
);
|
|
1302
|
-
function
|
|
1303
|
-
const t =
|
|
1302
|
+
function bn(e) {
|
|
1303
|
+
const t = Te({}, e), n = (b) => l.hasOwnProp(t, b) ? t[b] : void 0, a = n("data");
|
|
1304
1304
|
let r = n("withXSRFToken");
|
|
1305
1305
|
const o = n("xsrfHeaderName"), s = n("xsrfCookieName");
|
|
1306
1306
|
let i = n("headers");
|
|
1307
1307
|
const u = n("auth"), f = n("baseURL"), c = n("allowAbsoluteUrls"), d = n("url");
|
|
1308
|
-
if (t.headers = i =
|
|
1309
|
-
|
|
1308
|
+
if (t.headers = i = re.from(i), t.url = dn(
|
|
1309
|
+
hn(f, d, c, t),
|
|
1310
1310
|
n("params"),
|
|
1311
1311
|
n("paramsSerializer")
|
|
1312
1312
|
), u) {
|
|
1313
|
-
const b = l.getSafeProp(u, "username") || "",
|
|
1313
|
+
const b = l.getSafeProp(u, "username") || "", _ = l.getSafeProp(u, "password") || "";
|
|
1314
1314
|
try {
|
|
1315
1315
|
i.set(
|
|
1316
1316
|
"Authorization",
|
|
1317
|
-
"Basic " + btoa(b + ":" + (
|
|
1317
|
+
"Basic " + btoa(b + ":" + (_ ? mr(_) : ""))
|
|
1318
1318
|
);
|
|
1319
|
-
} catch (
|
|
1320
|
-
throw
|
|
1319
|
+
} catch (w) {
|
|
1320
|
+
throw R.from(w, R.ERR_BAD_OPTION_VALUE, e);
|
|
1321
1321
|
}
|
|
1322
1322
|
}
|
|
1323
|
-
if (l.isFormData(a) && (
|
|
1324
|
-
const b = o && s &&
|
|
1323
|
+
if (l.isFormData(a) && (H.hasStandardBrowserEnv || H.hasStandardBrowserWebWorkerEnv || l.isReactNative(a) ? i.setContentType(void 0) : l.isFunction(a.getHeaders) && pr(i, a.getHeaders(), n("formDataHeaderPolicy"))), H.hasStandardBrowserEnv && (l.isFunction(r) && (r = r(t)), r === !0 || r == null && rr(t.url))) {
|
|
1324
|
+
const b = o && s && or.read(s);
|
|
1325
1325
|
b && i.set(o, b);
|
|
1326
1326
|
}
|
|
1327
1327
|
return t;
|
|
1328
1328
|
}
|
|
1329
|
-
const
|
|
1329
|
+
const gr = typeof XMLHttpRequest < "u", hr = gr && function(e) {
|
|
1330
1330
|
return new Promise(function(t, n) {
|
|
1331
|
-
const a =
|
|
1331
|
+
const a = bn(e);
|
|
1332
1332
|
let r = a.data;
|
|
1333
|
-
const o =
|
|
1334
|
-
let { responseType: s, onUploadProgress: i, onDownloadProgress: u } = a, f, c, d, b,
|
|
1335
|
-
function
|
|
1336
|
-
b && b(),
|
|
1333
|
+
const o = re.from(a.headers).normalize();
|
|
1334
|
+
let { responseType: s, onUploadProgress: i, onDownloadProgress: u } = a, f, c, d, b, _;
|
|
1335
|
+
function w() {
|
|
1336
|
+
b && b(), _ && _(), a.cancelToken && a.cancelToken.unsubscribe(f), a.signal && a.signal.removeEventListener("abort", f);
|
|
1337
1337
|
}
|
|
1338
1338
|
let v = new XMLHttpRequest();
|
|
1339
1339
|
v.open(a.method.toUpperCase(), a.url, !0), v.timeout = a.timeout;
|
|
1340
|
-
function
|
|
1340
|
+
function y() {
|
|
1341
1341
|
if (!v)
|
|
1342
1342
|
return;
|
|
1343
|
-
const m =
|
|
1343
|
+
const m = re.from(
|
|
1344
1344
|
"getAllResponseHeaders" in v && v.getAllResponseHeaders()
|
|
1345
|
-
),
|
|
1345
|
+
), P = {
|
|
1346
1346
|
data: !s || s === "text" || s === "json" ? v.responseText : v.response,
|
|
1347
1347
|
status: v.status,
|
|
1348
1348
|
statusText: v.statusText,
|
|
@@ -1350,53 +1350,53 @@ const pr = typeof XMLHttpRequest < "u", fr = pr && function(e) {
|
|
|
1350
1350
|
config: e,
|
|
1351
1351
|
request: v
|
|
1352
1352
|
};
|
|
1353
|
-
|
|
1354
|
-
function(
|
|
1355
|
-
t(
|
|
1353
|
+
gn(
|
|
1354
|
+
function(x) {
|
|
1355
|
+
t(x), w();
|
|
1356
1356
|
},
|
|
1357
|
-
function(
|
|
1358
|
-
n(
|
|
1357
|
+
function(x) {
|
|
1358
|
+
n(x), w();
|
|
1359
1359
|
},
|
|
1360
|
-
|
|
1360
|
+
P
|
|
1361
1361
|
), v = null;
|
|
1362
1362
|
}
|
|
1363
|
-
"onloadend" in v ? v.onloadend =
|
|
1364
|
-
!v || v.readyState !== 4 || v.status === 0 && !(v.responseURL && v.responseURL.startsWith("file:")) || setTimeout(
|
|
1363
|
+
"onloadend" in v ? v.onloadend = y : v.onreadystatechange = function() {
|
|
1364
|
+
!v || v.readyState !== 4 || v.status === 0 && !(v.responseURL && v.responseURL.startsWith("file:")) || setTimeout(y);
|
|
1365
1365
|
}, v.onabort = function() {
|
|
1366
|
-
v && (n(new
|
|
1366
|
+
v && (n(new R("Request aborted", R.ECONNABORTED, e, v)), w(), v = null);
|
|
1367
1367
|
}, v.onerror = function(m) {
|
|
1368
|
-
const
|
|
1369
|
-
|
|
1368
|
+
const P = m && m.message ? m.message : "Network Error", x = new R(P, R.ERR_NETWORK, e, v);
|
|
1369
|
+
x.event = m || null, n(x), w(), v = null;
|
|
1370
1370
|
}, v.ontimeout = function() {
|
|
1371
1371
|
let m = a.timeout ? "timeout of " + a.timeout + "ms exceeded" : "timeout exceeded";
|
|
1372
|
-
const
|
|
1372
|
+
const P = a.transitional || wt;
|
|
1373
1373
|
a.timeoutErrorMessage && (m = a.timeoutErrorMessage), n(
|
|
1374
|
-
new
|
|
1374
|
+
new R(
|
|
1375
1375
|
m,
|
|
1376
|
-
|
|
1376
|
+
P.clarifyTimeoutError ? R.ETIMEDOUT : R.ECONNABORTED,
|
|
1377
1377
|
e,
|
|
1378
1378
|
v
|
|
1379
1379
|
)
|
|
1380
|
-
),
|
|
1381
|
-
}, r === void 0 && o.setContentType(null), "setRequestHeader" in v && l.forEach(
|
|
1382
|
-
v.setRequestHeader(
|
|
1383
|
-
}), l.isUndefined(a.withCredentials) || (v.withCredentials = !!a.withCredentials), s && s !== "json" && (v.responseType = a.responseType), u && ([d,
|
|
1384
|
-
v && (n(!m || m.type ? new je(null, e, v) : m), v.abort(),
|
|
1380
|
+
), w(), v = null;
|
|
1381
|
+
}, r === void 0 && o.setContentType(null), "setRequestHeader" in v && l.forEach(sn(o), function(m, P) {
|
|
1382
|
+
v.setRequestHeader(P, m);
|
|
1383
|
+
}), l.isUndefined(a.withCredentials) || (v.withCredentials = !!a.withCredentials), s && s !== "json" && (v.responseType = a.responseType), u && ([d, _] = Xe(u, !0), v.addEventListener("progress", d)), i && v.upload && ([c, b] = Xe(i), v.upload.addEventListener("progress", c), v.upload.addEventListener("loadend", b)), (a.cancelToken || a.signal) && (f = (m) => {
|
|
1384
|
+
v && (n(!m || m.type ? new je(null, e, v) : m), v.abort(), w(), v = null);
|
|
1385
1385
|
}, a.cancelToken && a.cancelToken.subscribe(f), a.signal && (a.signal.aborted ? f() : a.signal.addEventListener("abort", f)));
|
|
1386
|
-
const p =
|
|
1387
|
-
if (p &&
|
|
1386
|
+
const p = tr(a.url);
|
|
1387
|
+
if (p && !H.protocols.includes(p)) {
|
|
1388
1388
|
n(
|
|
1389
|
-
new
|
|
1389
|
+
new R(
|
|
1390
1390
|
"Unsupported protocol " + p + ":",
|
|
1391
|
-
|
|
1391
|
+
R.ERR_BAD_REQUEST,
|
|
1392
1392
|
e
|
|
1393
1393
|
)
|
|
1394
|
-
),
|
|
1394
|
+
), w();
|
|
1395
1395
|
return;
|
|
1396
1396
|
}
|
|
1397
1397
|
v.send(r || null);
|
|
1398
1398
|
});
|
|
1399
|
-
},
|
|
1399
|
+
}, br = (e, t) => {
|
|
1400
1400
|
if (e = e ? e.filter(Boolean) : [], !t && !e.length)
|
|
1401
1401
|
return;
|
|
1402
1402
|
const n = new AbortController();
|
|
@@ -1406,12 +1406,12 @@ const pr = typeof XMLHttpRequest < "u", fr = pr && function(e) {
|
|
|
1406
1406
|
a = !0, s();
|
|
1407
1407
|
const f = u instanceof Error ? u : this.reason;
|
|
1408
1408
|
n.abort(
|
|
1409
|
-
f instanceof
|
|
1409
|
+
f instanceof R ? f : new je(f instanceof Error ? f.message : f)
|
|
1410
1410
|
);
|
|
1411
1411
|
}
|
|
1412
1412
|
};
|
|
1413
1413
|
let o = t && setTimeout(() => {
|
|
1414
|
-
o = null, r(new
|
|
1414
|
+
o = null, r(new R(`timeout of ${t}ms exceeded`, R.ETIMEDOUT));
|
|
1415
1415
|
}, t);
|
|
1416
1416
|
const s = () => {
|
|
1417
1417
|
e && (o && clearTimeout(o), o = null, e.forEach((u) => {
|
|
@@ -1421,7 +1421,7 @@ const pr = typeof XMLHttpRequest < "u", fr = pr && function(e) {
|
|
|
1421
1421
|
e.forEach((u) => u.addEventListener("abort", r, { once: !0 }));
|
|
1422
1422
|
const { signal: i } = n;
|
|
1423
1423
|
return i.unsubscribe = () => l.asap(s), i;
|
|
1424
|
-
},
|
|
1424
|
+
}, yr = br, vr = function* (e, t) {
|
|
1425
1425
|
let n = e.byteLength;
|
|
1426
1426
|
if (!t || n < t) {
|
|
1427
1427
|
yield e;
|
|
@@ -1430,10 +1430,10 @@ const pr = typeof XMLHttpRequest < "u", fr = pr && function(e) {
|
|
|
1430
1430
|
let a = 0, r;
|
|
1431
1431
|
for (; a < n; )
|
|
1432
1432
|
r = a + t, yield e.slice(a, r), a = r;
|
|
1433
|
-
},
|
|
1434
|
-
for await (const n of
|
|
1435
|
-
yield*
|
|
1436
|
-
},
|
|
1433
|
+
}, wr = async function* (e, t) {
|
|
1434
|
+
for await (const n of xr(e))
|
|
1435
|
+
yield* vr(n, t);
|
|
1436
|
+
}, xr = async function* (e) {
|
|
1437
1437
|
if (e[Symbol.asyncIterator]) {
|
|
1438
1438
|
yield* e;
|
|
1439
1439
|
return;
|
|
@@ -1449,8 +1449,8 @@ const pr = typeof XMLHttpRequest < "u", fr = pr && function(e) {
|
|
|
1449
1449
|
} finally {
|
|
1450
1450
|
await t.cancel();
|
|
1451
1451
|
}
|
|
1452
|
-
},
|
|
1453
|
-
const r =
|
|
1452
|
+
}, zt = (e, t, n, a) => {
|
|
1453
|
+
const r = wr(e, t);
|
|
1454
1454
|
let o = 0, s, i = (u) => {
|
|
1455
1455
|
s || (s = !0, a && a(u));
|
|
1456
1456
|
};
|
|
@@ -1481,8 +1481,8 @@ const pr = typeof XMLHttpRequest < "u", fr = pr && function(e) {
|
|
|
1481
1481
|
highWaterMark: 2
|
|
1482
1482
|
}
|
|
1483
1483
|
);
|
|
1484
|
-
},
|
|
1485
|
-
function
|
|
1484
|
+
}, Ze = (e) => e >= 48 && e <= 57 || e >= 65 && e <= 70 || e >= 97 && e <= 102, kr = (e, t, n) => t + 2 < n && Ze(e.charCodeAt(t + 1)) && Ze(e.charCodeAt(t + 2));
|
|
1485
|
+
function Sr(e) {
|
|
1486
1486
|
if (!e || typeof e != "string" || !e.startsWith("data:"))
|
|
1487
1487
|
return 0;
|
|
1488
1488
|
const t = e.indexOf(",");
|
|
@@ -1494,8 +1494,8 @@ function wr(e) {
|
|
|
1494
1494
|
const s = a.length;
|
|
1495
1495
|
for (let d = 0; d < s; d++)
|
|
1496
1496
|
if (a.charCodeAt(d) === 37 && d + 2 < s) {
|
|
1497
|
-
const b = a.charCodeAt(d + 1),
|
|
1498
|
-
|
|
1497
|
+
const b = a.charCodeAt(d + 1), _ = a.charCodeAt(d + 2);
|
|
1498
|
+
Ze(b) && Ze(_) && (o -= 2, d += 2);
|
|
1499
1499
|
}
|
|
1500
1500
|
let i = 0, u = s - 1;
|
|
1501
1501
|
const f = (d) => d >= 2 && a.charCodeAt(d - 2) === 37 && // '%'
|
|
@@ -1508,7 +1508,7 @@ function wr(e) {
|
|
|
1508
1508
|
let r = 0;
|
|
1509
1509
|
for (let o = 0, s = a.length; o < s; o++) {
|
|
1510
1510
|
const i = a.charCodeAt(o);
|
|
1511
|
-
if (i === 37 &&
|
|
1511
|
+
if (i === 37 && kr(a, o, s))
|
|
1512
1512
|
r += 1, o += 2;
|
|
1513
1513
|
else if (i < 128)
|
|
1514
1514
|
r += 1;
|
|
@@ -1522,10 +1522,10 @@ function wr(e) {
|
|
|
1522
1522
|
}
|
|
1523
1523
|
return r;
|
|
1524
1524
|
}
|
|
1525
|
-
const
|
|
1525
|
+
const Pt = "1.18.1", Vt = 64 * 1024, { isFunction: $e } = l, Pr = (e) => encodeURIComponent(e).replace(
|
|
1526
1526
|
/%([0-9A-F]{2})/gi,
|
|
1527
1527
|
(t, n) => String.fromCharCode(parseInt(n, 16))
|
|
1528
|
-
),
|
|
1528
|
+
), qt = (e) => {
|
|
1529
1529
|
if (!l.isString(e))
|
|
1530
1530
|
return e;
|
|
1531
1531
|
try {
|
|
@@ -1533,17 +1533,17 @@ const Rt = "1.18.1", zt = 64 * 1024, { isFunction: $e } = l, xr = (e) => encodeU
|
|
|
1533
1533
|
} catch {
|
|
1534
1534
|
return e;
|
|
1535
1535
|
}
|
|
1536
|
-
},
|
|
1536
|
+
}, $t = (e, ...t) => {
|
|
1537
1537
|
try {
|
|
1538
1538
|
return !!e(...t);
|
|
1539
1539
|
} catch {
|
|
1540
1540
|
return !1;
|
|
1541
1541
|
}
|
|
1542
|
-
},
|
|
1542
|
+
}, Er = (e) => {
|
|
1543
1543
|
const t = e.indexOf("://");
|
|
1544
1544
|
let n = e;
|
|
1545
1545
|
return t !== -1 && (n = n.slice(t + 3)), n.includes("@") || n.includes(":");
|
|
1546
|
-
},
|
|
1546
|
+
}, Rr = (e) => {
|
|
1547
1547
|
const t = l.global !== void 0 && l.global !== null ? l.global : globalThis, { ReadableStream: n, TextEncoder: a } = t;
|
|
1548
1548
|
e = l.merge.call(
|
|
1549
1549
|
{
|
|
@@ -1558,28 +1558,28 @@ const Rt = "1.18.1", zt = 64 * 1024, { isFunction: $e } = l, xr = (e) => encodeU
|
|
|
1558
1558
|
const { fetch: r, Request: o, Response: s } = e, i = r ? $e(r) : typeof fetch == "function", u = $e(o), f = $e(s);
|
|
1559
1559
|
if (!i)
|
|
1560
1560
|
return !1;
|
|
1561
|
-
const c = i && $e(n), d = i && (typeof a == "function" ? ((p) => (m) => p.encode(m))(new a()) : async (p) => new Uint8Array(await new o(p).arrayBuffer())), b = u && c &&
|
|
1561
|
+
const c = i && $e(n), d = i && (typeof a == "function" ? ((p) => (m) => p.encode(m))(new a()) : async (p) => new Uint8Array(await new o(p).arrayBuffer())), b = u && c && $t(() => {
|
|
1562
1562
|
let p = !1;
|
|
1563
|
-
const m = new o(
|
|
1563
|
+
const m = new o(H.origin, {
|
|
1564
1564
|
body: new n(),
|
|
1565
1565
|
method: "POST",
|
|
1566
1566
|
get duplex() {
|
|
1567
1567
|
return p = !0, "half";
|
|
1568
1568
|
}
|
|
1569
|
-
}),
|
|
1570
|
-
return m.body != null && m.body.cancel(), p && !
|
|
1571
|
-
}),
|
|
1572
|
-
stream:
|
|
1569
|
+
}), P = m.headers.has("Content-Type");
|
|
1570
|
+
return m.body != null && m.body.cancel(), p && !P;
|
|
1571
|
+
}), _ = f && c && $t(() => l.isReadableStream(new s("").body)), w = {
|
|
1572
|
+
stream: _ && ((p) => p.body)
|
|
1573
1573
|
};
|
|
1574
1574
|
i && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((p) => {
|
|
1575
|
-
!
|
|
1576
|
-
let
|
|
1577
|
-
if (
|
|
1578
|
-
return
|
|
1579
|
-
throw new
|
|
1575
|
+
!w[p] && (w[p] = (m, P) => {
|
|
1576
|
+
let x = m && m[p];
|
|
1577
|
+
if (x)
|
|
1578
|
+
return x.call(m);
|
|
1579
|
+
throw new R(
|
|
1580
1580
|
`Response type '${p}' is not supported`,
|
|
1581
|
-
|
|
1582
|
-
|
|
1581
|
+
R.ERR_NOT_SUPPORT,
|
|
1582
|
+
P
|
|
1583
1583
|
);
|
|
1584
1584
|
});
|
|
1585
1585
|
});
|
|
@@ -1589,7 +1589,7 @@ const Rt = "1.18.1", zt = 64 * 1024, { isFunction: $e } = l, xr = (e) => encodeU
|
|
|
1589
1589
|
if (l.isBlob(p))
|
|
1590
1590
|
return p.size;
|
|
1591
1591
|
if (l.isSpecCompliantForm(p))
|
|
1592
|
-
return (await new o(
|
|
1592
|
+
return (await new o(H.origin, {
|
|
1593
1593
|
method: "POST",
|
|
1594
1594
|
body: p
|
|
1595
1595
|
}).arrayBuffer()).byteLength;
|
|
@@ -1597,196 +1597,196 @@ const Rt = "1.18.1", zt = 64 * 1024, { isFunction: $e } = l, xr = (e) => encodeU
|
|
|
1597
1597
|
return p.byteLength;
|
|
1598
1598
|
if (l.isURLSearchParams(p) && (p = p + ""), l.isString(p))
|
|
1599
1599
|
return (await d(p)).byteLength;
|
|
1600
|
-
},
|
|
1600
|
+
}, y = async (p, m) => l.toFiniteNumber(p.getContentLength()) ?? v(m);
|
|
1601
1601
|
return async (p) => {
|
|
1602
1602
|
let {
|
|
1603
1603
|
url: m,
|
|
1604
|
-
method:
|
|
1605
|
-
data:
|
|
1606
|
-
signal:
|
|
1607
|
-
cancelToken:
|
|
1604
|
+
method: P,
|
|
1605
|
+
data: x,
|
|
1606
|
+
signal: k,
|
|
1607
|
+
cancelToken: g,
|
|
1608
1608
|
timeout: A,
|
|
1609
|
-
onDownloadProgress:
|
|
1610
|
-
onUploadProgress:
|
|
1611
|
-
responseType:
|
|
1609
|
+
onDownloadProgress: Y,
|
|
1610
|
+
onUploadProgress: W,
|
|
1611
|
+
responseType: G,
|
|
1612
1612
|
headers: j,
|
|
1613
|
-
withCredentials:
|
|
1614
|
-
fetchOptions:
|
|
1615
|
-
maxContentLength:
|
|
1616
|
-
maxBodyLength:
|
|
1617
|
-
} =
|
|
1618
|
-
const
|
|
1613
|
+
withCredentials: z = "same-origin",
|
|
1614
|
+
fetchOptions: ue,
|
|
1615
|
+
maxContentLength: $,
|
|
1616
|
+
maxBodyLength: se
|
|
1617
|
+
} = bn(p);
|
|
1618
|
+
const X = l.isNumber($) && $ > -1, ce = l.isNumber(se) && se > -1, de = (L) => l.hasOwnProp(p, L) ? p[L] : void 0;
|
|
1619
1619
|
let Me = r || fetch;
|
|
1620
|
-
|
|
1621
|
-
let
|
|
1622
|
-
[
|
|
1620
|
+
G = G ? (G + "").toLowerCase() : "text";
|
|
1621
|
+
let ie = yr(
|
|
1622
|
+
[k, g && g.toAbortSignal()],
|
|
1623
1623
|
A
|
|
1624
1624
|
), O = null;
|
|
1625
|
-
const
|
|
1626
|
-
|
|
1625
|
+
const B = ie && ie.unsubscribe && (() => {
|
|
1626
|
+
ie.unsubscribe();
|
|
1627
1627
|
});
|
|
1628
|
-
let I,
|
|
1629
|
-
const ze = () => new
|
|
1628
|
+
let I, fe = null;
|
|
1629
|
+
const ze = () => new R(
|
|
1630
1630
|
"Request body larger than maxBodyLength limit",
|
|
1631
|
-
|
|
1631
|
+
R.ERR_BAD_REQUEST,
|
|
1632
1632
|
p,
|
|
1633
1633
|
O
|
|
1634
1634
|
);
|
|
1635
1635
|
try {
|
|
1636
1636
|
let L;
|
|
1637
|
-
const U =
|
|
1637
|
+
const U = de("auth");
|
|
1638
1638
|
if (U) {
|
|
1639
|
-
const
|
|
1639
|
+
const D = l.getSafeProp(U, "username") || "", ee = l.getSafeProp(U, "password") || "";
|
|
1640
1640
|
L = {
|
|
1641
|
-
username:
|
|
1642
|
-
password:
|
|
1641
|
+
username: D,
|
|
1642
|
+
password: ee
|
|
1643
1643
|
};
|
|
1644
1644
|
}
|
|
1645
|
-
if (
|
|
1646
|
-
const
|
|
1647
|
-
if (!L && (
|
|
1648
|
-
const
|
|
1645
|
+
if (Er(m)) {
|
|
1646
|
+
const D = new URL(m, H.origin);
|
|
1647
|
+
if (!L && (D.username || D.password)) {
|
|
1648
|
+
const ee = qt(D.username), xe = qt(D.password);
|
|
1649
1649
|
L = {
|
|
1650
|
-
username:
|
|
1651
|
-
password:
|
|
1650
|
+
username: ee,
|
|
1651
|
+
password: xe
|
|
1652
1652
|
};
|
|
1653
1653
|
}
|
|
1654
|
-
(
|
|
1654
|
+
(D.username || D.password) && (D.username = "", D.password = "", m = D.href);
|
|
1655
1655
|
}
|
|
1656
1656
|
if (L && (j.delete("authorization"), j.set(
|
|
1657
1657
|
"Authorization",
|
|
1658
|
-
"Basic " + btoa(
|
|
1659
|
-
)),
|
|
1660
|
-
throw new
|
|
1661
|
-
"maxContentLength size of " +
|
|
1662
|
-
|
|
1658
|
+
"Basic " + btoa(Pr((L.username || "") + ":" + (L.password || "")))
|
|
1659
|
+
)), X && typeof m == "string" && m.startsWith("data:") && Sr(m) > $)
|
|
1660
|
+
throw new R(
|
|
1661
|
+
"maxContentLength size of " + $ + " exceeded",
|
|
1662
|
+
R.ERR_BAD_RESPONSE,
|
|
1663
1663
|
p,
|
|
1664
1664
|
O
|
|
1665
1665
|
);
|
|
1666
|
-
if (
|
|
1667
|
-
const
|
|
1668
|
-
if (typeof
|
|
1666
|
+
if (ce && P !== "get" && P !== "head") {
|
|
1667
|
+
const D = await v(x);
|
|
1668
|
+
if (typeof D == "number" && isFinite(D) && (I = D, D > se))
|
|
1669
1669
|
throw ze();
|
|
1670
1670
|
}
|
|
1671
|
-
const
|
|
1672
|
-
|
|
1673
|
-
|
|
1671
|
+
const Se = ce && (l.isReadableStream(x) || l.isStream(x)), Ve = (D, ee, xe) => zt(
|
|
1672
|
+
D,
|
|
1673
|
+
Vt,
|
|
1674
1674
|
(Pe) => {
|
|
1675
|
-
if (
|
|
1676
|
-
throw
|
|
1677
|
-
|
|
1675
|
+
if (ce && Pe > se)
|
|
1676
|
+
throw fe = ze();
|
|
1677
|
+
ee && ee(Pe);
|
|
1678
1678
|
},
|
|
1679
|
-
|
|
1679
|
+
xe
|
|
1680
1680
|
);
|
|
1681
|
-
if (b &&
|
|
1682
|
-
if (I = I ?? await
|
|
1683
|
-
let
|
|
1681
|
+
if (b && P !== "get" && P !== "head" && (W || Se)) {
|
|
1682
|
+
if (I = I ?? await y(j, x), I !== 0 || Se) {
|
|
1683
|
+
let D = new o(m, {
|
|
1684
1684
|
method: "POST",
|
|
1685
|
-
body:
|
|
1685
|
+
body: x,
|
|
1686
1686
|
duplex: "half"
|
|
1687
|
-
}),
|
|
1688
|
-
if (l.isFormData(
|
|
1689
|
-
const [
|
|
1687
|
+
}), ee;
|
|
1688
|
+
if (l.isFormData(x) && (ee = D.headers.get("content-type")) && j.setContentType(ee), D.body) {
|
|
1689
|
+
const [xe, Pe] = W && Ut(
|
|
1690
1690
|
I,
|
|
1691
|
-
Xe(
|
|
1691
|
+
Xe(jt(W))
|
|
1692
1692
|
) || [];
|
|
1693
|
-
|
|
1693
|
+
x = Ve(D.body, xe, Pe);
|
|
1694
1694
|
}
|
|
1695
1695
|
}
|
|
1696
|
-
} else if (
|
|
1697
|
-
|
|
1698
|
-
else if (
|
|
1699
|
-
throw new
|
|
1696
|
+
} else if (Se && !u && c && P !== "get" && P !== "head")
|
|
1697
|
+
x = Ve(x);
|
|
1698
|
+
else if (Se && u && !b && P !== "get" && P !== "head")
|
|
1699
|
+
throw new R(
|
|
1700
1700
|
"Stream request bodies are not supported by the current fetch implementation",
|
|
1701
|
-
|
|
1701
|
+
R.ERR_NOT_SUPPORT,
|
|
1702
1702
|
p,
|
|
1703
1703
|
O
|
|
1704
1704
|
);
|
|
1705
|
-
l.isString(
|
|
1705
|
+
l.isString(z) || (z = z ? "include" : "omit");
|
|
1706
1706
|
const qe = u && "credentials" in o.prototype;
|
|
1707
|
-
if (l.isFormData(
|
|
1708
|
-
const
|
|
1709
|
-
|
|
1707
|
+
if (l.isFormData(x)) {
|
|
1708
|
+
const D = j.getContentType();
|
|
1709
|
+
D && /^multipart\/form-data/i.test(D) && !/boundary=/i.test(D) && j.delete("content-type");
|
|
1710
1710
|
}
|
|
1711
|
-
j.set("User-Agent", "axios/" +
|
|
1712
|
-
const
|
|
1713
|
-
...
|
|
1714
|
-
signal:
|
|
1715
|
-
method:
|
|
1716
|
-
headers:
|
|
1717
|
-
body:
|
|
1711
|
+
j.set("User-Agent", "axios/" + Pt, !1);
|
|
1712
|
+
const Tt = {
|
|
1713
|
+
...ue,
|
|
1714
|
+
signal: ie,
|
|
1715
|
+
method: P.toUpperCase(),
|
|
1716
|
+
headers: sn(j.normalize()),
|
|
1717
|
+
body: x,
|
|
1718
1718
|
duplex: "half",
|
|
1719
|
-
credentials: qe ?
|
|
1719
|
+
credentials: qe ? z : void 0
|
|
1720
1720
|
};
|
|
1721
|
-
O = u && new o(m,
|
|
1722
|
-
let
|
|
1723
|
-
const
|
|
1724
|
-
if (
|
|
1725
|
-
const
|
|
1726
|
-
if (
|
|
1727
|
-
throw new
|
|
1728
|
-
"maxContentLength size of " +
|
|
1729
|
-
|
|
1721
|
+
O = u && new o(m, Tt);
|
|
1722
|
+
let pe = await (u ? Me(O, ue) : Me(m, Tt));
|
|
1723
|
+
const Ot = re.from(pe.headers);
|
|
1724
|
+
if (X) {
|
|
1725
|
+
const D = l.toFiniteNumber(Ot.getContentLength());
|
|
1726
|
+
if (D != null && D > $)
|
|
1727
|
+
throw new R(
|
|
1728
|
+
"maxContentLength size of " + $ + " exceeded",
|
|
1729
|
+
R.ERR_BAD_RESPONSE,
|
|
1730
1730
|
p,
|
|
1731
1731
|
O
|
|
1732
1732
|
);
|
|
1733
1733
|
}
|
|
1734
|
-
const ot =
|
|
1735
|
-
if (
|
|
1736
|
-
const
|
|
1734
|
+
const ot = _ && (G === "stream" || G === "response");
|
|
1735
|
+
if (_ && pe.body && (Y || X || ot && B)) {
|
|
1736
|
+
const D = {};
|
|
1737
1737
|
["status", "statusText", "headers"].forEach((De) => {
|
|
1738
|
-
|
|
1738
|
+
D[De] = pe[De];
|
|
1739
1739
|
});
|
|
1740
|
-
const
|
|
1741
|
-
|
|
1742
|
-
Xe(
|
|
1740
|
+
const ee = l.toFiniteNumber(Ot.getContentLength()), [xe, Pe] = Y && Ut(
|
|
1741
|
+
ee,
|
|
1742
|
+
Xe(jt(Y), !0)
|
|
1743
1743
|
) || [];
|
|
1744
1744
|
let Ct = 0;
|
|
1745
1745
|
const Rn = (De) => {
|
|
1746
|
-
if (
|
|
1747
|
-
throw new
|
|
1748
|
-
"maxContentLength size of " +
|
|
1749
|
-
|
|
1746
|
+
if (X && (Ct = De, Ct > $))
|
|
1747
|
+
throw new R(
|
|
1748
|
+
"maxContentLength size of " + $ + " exceeded",
|
|
1749
|
+
R.ERR_BAD_RESPONSE,
|
|
1750
1750
|
p,
|
|
1751
1751
|
O
|
|
1752
1752
|
);
|
|
1753
|
-
|
|
1753
|
+
xe && xe(De);
|
|
1754
1754
|
};
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
Pe && Pe(),
|
|
1755
|
+
pe = new s(
|
|
1756
|
+
zt(pe.body, Vt, Rn, () => {
|
|
1757
|
+
Pe && Pe(), B && B();
|
|
1758
1758
|
}),
|
|
1759
|
-
|
|
1759
|
+
D
|
|
1760
1760
|
);
|
|
1761
1761
|
}
|
|
1762
|
-
|
|
1763
|
-
let
|
|
1764
|
-
|
|
1762
|
+
G = G || "text";
|
|
1763
|
+
let me = await w[l.findKey(w, G) || "text"](
|
|
1764
|
+
pe,
|
|
1765
1765
|
p
|
|
1766
1766
|
);
|
|
1767
|
-
if (
|
|
1768
|
-
let
|
|
1769
|
-
if (
|
|
1770
|
-
throw new
|
|
1771
|
-
"maxContentLength size of " +
|
|
1772
|
-
|
|
1767
|
+
if (X && !_ && !ot) {
|
|
1768
|
+
let D;
|
|
1769
|
+
if (me != null && (typeof me.byteLength == "number" ? D = me.byteLength : typeof me.size == "number" ? D = me.size : typeof me == "string" && (D = typeof a == "function" ? new a().encode(me).byteLength : me.length)), typeof D == "number" && D > $)
|
|
1770
|
+
throw new R(
|
|
1771
|
+
"maxContentLength size of " + $ + " exceeded",
|
|
1772
|
+
R.ERR_BAD_RESPONSE,
|
|
1773
1773
|
p,
|
|
1774
1774
|
O
|
|
1775
1775
|
);
|
|
1776
1776
|
}
|
|
1777
|
-
return !ot &&
|
|
1778
|
-
|
|
1779
|
-
data:
|
|
1780
|
-
headers:
|
|
1781
|
-
status:
|
|
1782
|
-
statusText:
|
|
1777
|
+
return !ot && B && B(), await new Promise((D, ee) => {
|
|
1778
|
+
gn(D, ee, {
|
|
1779
|
+
data: me,
|
|
1780
|
+
headers: re.from(pe.headers),
|
|
1781
|
+
status: pe.status,
|
|
1782
|
+
statusText: pe.statusText,
|
|
1783
1783
|
config: p,
|
|
1784
1784
|
request: O
|
|
1785
1785
|
});
|
|
1786
1786
|
});
|
|
1787
1787
|
} catch (L) {
|
|
1788
|
-
if (
|
|
1789
|
-
const U =
|
|
1788
|
+
if (B && B(), ie && ie.aborted && ie.reason instanceof R) {
|
|
1789
|
+
const U = ie.reason;
|
|
1790
1790
|
throw U.config = p, O && (U.request = O), L !== U && Object.defineProperty(U, "cause", {
|
|
1791
1791
|
__proto__: null,
|
|
1792
1792
|
value: L,
|
|
@@ -1795,14 +1795,14 @@ const Rt = "1.18.1", zt = 64 * 1024, { isFunction: $e } = l, xr = (e) => encodeU
|
|
|
1795
1795
|
configurable: !0
|
|
1796
1796
|
}), U;
|
|
1797
1797
|
}
|
|
1798
|
-
if (
|
|
1799
|
-
throw O && !
|
|
1800
|
-
if (L instanceof
|
|
1798
|
+
if (fe)
|
|
1799
|
+
throw O && !fe.request && (fe.request = O), fe;
|
|
1800
|
+
if (L instanceof R)
|
|
1801
1801
|
throw O && !L.request && (L.request = O), L;
|
|
1802
1802
|
if (L && L.name === "TypeError" && /Load failed|fetch/i.test(L.message)) {
|
|
1803
|
-
const U = new
|
|
1803
|
+
const U = new R(
|
|
1804
1804
|
"Network Error",
|
|
1805
|
-
|
|
1805
|
+
R.ERR_NETWORK,
|
|
1806
1806
|
p,
|
|
1807
1807
|
O,
|
|
1808
1808
|
L && L.response
|
|
@@ -1815,23 +1815,23 @@ const Rt = "1.18.1", zt = 64 * 1024, { isFunction: $e } = l, xr = (e) => encodeU
|
|
|
1815
1815
|
configurable: !0
|
|
1816
1816
|
}), U;
|
|
1817
1817
|
}
|
|
1818
|
-
throw
|
|
1818
|
+
throw R.from(L, L && L.code, p, O, L && L.response);
|
|
1819
1819
|
}
|
|
1820
1820
|
};
|
|
1821
|
-
},
|
|
1821
|
+
}, Tr = /* @__PURE__ */ new Map(), yn = (e) => {
|
|
1822
1822
|
let t = e && e.env || {};
|
|
1823
1823
|
const { fetch: n, Request: a, Response: r } = t, o = [a, r, n];
|
|
1824
|
-
let s = o.length, i = s, u, f, c =
|
|
1824
|
+
let s = o.length, i = s, u, f, c = Tr;
|
|
1825
1825
|
for (; i--; )
|
|
1826
|
-
u = o[i], f = c.get(u), f === void 0 && c.set(u, f = i ? /* @__PURE__ */ new Map() :
|
|
1826
|
+
u = o[i], f = c.get(u), f === void 0 && c.set(u, f = i ? /* @__PURE__ */ new Map() : Rr(t)), c = f;
|
|
1827
1827
|
return f;
|
|
1828
1828
|
};
|
|
1829
|
-
|
|
1829
|
+
yn();
|
|
1830
1830
|
const Et = {
|
|
1831
|
-
http:
|
|
1832
|
-
xhr:
|
|
1831
|
+
http: Ua,
|
|
1832
|
+
xhr: hr,
|
|
1833
1833
|
fetch: {
|
|
1834
|
-
get:
|
|
1834
|
+
get: yn
|
|
1835
1835
|
}
|
|
1836
1836
|
};
|
|
1837
1837
|
l.forEach(Et, (e, t) => {
|
|
@@ -1843,8 +1843,8 @@ l.forEach(Et, (e, t) => {
|
|
|
1843
1843
|
Object.defineProperty(e, "adapterName", { __proto__: null, value: t });
|
|
1844
1844
|
}
|
|
1845
1845
|
});
|
|
1846
|
-
const
|
|
1847
|
-
function
|
|
1846
|
+
const Gt = (e) => `- ${e}`, Or = (e) => l.isFunction(e) || e === null || e === !1;
|
|
1847
|
+
function Cr(e, t) {
|
|
1848
1848
|
e = l.isArray(e) ? e : [e];
|
|
1849
1849
|
const { length: n } = e;
|
|
1850
1850
|
let a, r;
|
|
@@ -1852,8 +1852,8 @@ function Sr(e, t) {
|
|
|
1852
1852
|
for (let s = 0; s < n; s++) {
|
|
1853
1853
|
a = e[s];
|
|
1854
1854
|
let i;
|
|
1855
|
-
if (r = a, !
|
|
1856
|
-
throw new
|
|
1855
|
+
if (r = a, !Or(a) && (r = Et[(i = String(a)).toLowerCase()], r === void 0))
|
|
1856
|
+
throw new R(`Unknown adapter '${i}'`);
|
|
1857
1857
|
if (r && (l.isFunction(r) || (r = r.get(t))))
|
|
1858
1858
|
break;
|
|
1859
1859
|
o[i || "#" + s] = r;
|
|
@@ -1863,21 +1863,21 @@ function Sr(e, t) {
|
|
|
1863
1863
|
([u, f]) => `adapter ${u} ` + (f === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
1864
1864
|
);
|
|
1865
1865
|
let i = n ? s.length > 1 ? `since :
|
|
1866
|
-
` + s.map(
|
|
1867
|
-
`) : " " +
|
|
1868
|
-
throw new
|
|
1866
|
+
` + s.map(Gt).join(`
|
|
1867
|
+
`) : " " + Gt(s[0]) : "as no adapter specified";
|
|
1868
|
+
throw new R(
|
|
1869
1869
|
"There is no suitable adapter to dispatch the request " + i,
|
|
1870
|
-
|
|
1870
|
+
R.ERR_NOT_SUPPORT
|
|
1871
1871
|
);
|
|
1872
1872
|
}
|
|
1873
1873
|
return r;
|
|
1874
1874
|
}
|
|
1875
|
-
const
|
|
1875
|
+
const vn = {
|
|
1876
1876
|
/**
|
|
1877
1877
|
* Resolve an adapter from a list of adapter names or functions.
|
|
1878
1878
|
* @type {Function}
|
|
1879
1879
|
*/
|
|
1880
|
-
getAdapter:
|
|
1880
|
+
getAdapter: Cr,
|
|
1881
1881
|
/**
|
|
1882
1882
|
* Exposes all known adapters
|
|
1883
1883
|
* @type {Object<string, Function|Object>}
|
|
@@ -1888,8 +1888,8 @@ function ct(e) {
|
|
|
1888
1888
|
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
1889
1889
|
throw new je(null, e);
|
|
1890
1890
|
}
|
|
1891
|
-
function
|
|
1892
|
-
return ct(e), e.headers =
|
|
1891
|
+
function Ht(e) {
|
|
1892
|
+
return ct(e), e.headers = re.from(e.headers), e.data = ut.call(e, e.transformRequest), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), vn.getAdapter(e.adapter || St.adapter, e)(e).then(
|
|
1893
1893
|
function(t) {
|
|
1894
1894
|
ct(e), e.response = t;
|
|
1895
1895
|
try {
|
|
@@ -1897,10 +1897,10 @@ function Gt(e) {
|
|
|
1897
1897
|
} finally {
|
|
1898
1898
|
delete e.response;
|
|
1899
1899
|
}
|
|
1900
|
-
return t.headers =
|
|
1900
|
+
return t.headers = re.from(t.headers), t;
|
|
1901
1901
|
},
|
|
1902
1902
|
function(t) {
|
|
1903
|
-
if (!
|
|
1903
|
+
if (!mn(t) && (ct(e), t && t.response)) {
|
|
1904
1904
|
e.response = t.response;
|
|
1905
1905
|
try {
|
|
1906
1906
|
t.response.data = ut.call(
|
|
@@ -1911,7 +1911,7 @@ function Gt(e) {
|
|
|
1911
1911
|
} finally {
|
|
1912
1912
|
delete e.response;
|
|
1913
1913
|
}
|
|
1914
|
-
t.response.headers =
|
|
1914
|
+
t.response.headers = re.from(t.response.headers);
|
|
1915
1915
|
}
|
|
1916
1916
|
return Promise.reject(t);
|
|
1917
1917
|
}
|
|
@@ -1923,18 +1923,18 @@ const nt = {};
|
|
|
1923
1923
|
return typeof n === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
1924
1924
|
};
|
|
1925
1925
|
});
|
|
1926
|
-
const
|
|
1926
|
+
const Jt = {};
|
|
1927
1927
|
nt.transitional = function(e, t, n) {
|
|
1928
1928
|
function a(r, o) {
|
|
1929
|
-
return "[Axios v" +
|
|
1929
|
+
return "[Axios v" + Pt + "] Transitional option '" + r + "'" + o + (n ? ". " + n : "");
|
|
1930
1930
|
}
|
|
1931
1931
|
return (r, o, s) => {
|
|
1932
1932
|
if (e === !1)
|
|
1933
|
-
throw new
|
|
1933
|
+
throw new R(
|
|
1934
1934
|
a(o, " has been removed" + (t ? " in " + t : "")),
|
|
1935
|
-
|
|
1935
|
+
R.ERR_DEPRECATED
|
|
1936
1936
|
);
|
|
1937
|
-
return t && !
|
|
1937
|
+
return t && !Jt[o] && (Jt[o] = !0, console.warn(
|
|
1938
1938
|
a(
|
|
1939
1939
|
o,
|
|
1940
1940
|
" has been deprecated since v" + t + " and will be removed in the near future"
|
|
@@ -1945,9 +1945,9 @@ nt.transitional = function(e, t, n) {
|
|
|
1945
1945
|
nt.spelling = function(e) {
|
|
1946
1946
|
return (t, n) => (console.warn(`${n} is likely a misspelling of ${e}`), !0);
|
|
1947
1947
|
};
|
|
1948
|
-
function
|
|
1948
|
+
function _r(e, t, n) {
|
|
1949
1949
|
if (typeof e != "object" || e === null)
|
|
1950
|
-
throw new
|
|
1950
|
+
throw new R("options must be an object", R.ERR_BAD_OPTION_VALUE);
|
|
1951
1951
|
const a = Object.keys(e);
|
|
1952
1952
|
let r = a.length;
|
|
1953
1953
|
for (; r-- > 0; ) {
|
|
@@ -1955,25 +1955,25 @@ function Or(e, t, n) {
|
|
|
1955
1955
|
if (s) {
|
|
1956
1956
|
const i = e[o], u = i === void 0 || s(i, o, e);
|
|
1957
1957
|
if (u !== !0)
|
|
1958
|
-
throw new
|
|
1958
|
+
throw new R(
|
|
1959
1959
|
"option " + o + " must be " + u,
|
|
1960
|
-
|
|
1960
|
+
R.ERR_BAD_OPTION_VALUE
|
|
1961
1961
|
);
|
|
1962
1962
|
continue;
|
|
1963
1963
|
}
|
|
1964
1964
|
if (n !== !0)
|
|
1965
|
-
throw new
|
|
1965
|
+
throw new R("Unknown option " + o, R.ERR_BAD_OPTION);
|
|
1966
1966
|
}
|
|
1967
1967
|
}
|
|
1968
1968
|
const Je = {
|
|
1969
|
-
assertOptions:
|
|
1969
|
+
assertOptions: _r,
|
|
1970
1970
|
validators: nt
|
|
1971
|
-
},
|
|
1971
|
+
}, K = Je.validators;
|
|
1972
1972
|
class Qe {
|
|
1973
1973
|
constructor(t) {
|
|
1974
1974
|
this.defaults = t || {}, this.interceptors = {
|
|
1975
|
-
request: new
|
|
1976
|
-
response: new
|
|
1975
|
+
request: new Nt(),
|
|
1976
|
+
response: new Nt()
|
|
1977
1977
|
};
|
|
1978
1978
|
}
|
|
1979
1979
|
/**
|
|
@@ -2015,17 +2015,17 @@ class Qe {
|
|
|
2015
2015
|
}
|
|
2016
2016
|
}
|
|
2017
2017
|
_request(t, n) {
|
|
2018
|
-
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n =
|
|
2018
|
+
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = Te(this.defaults, n);
|
|
2019
2019
|
const { transitional: a, paramsSerializer: r, headers: o } = n;
|
|
2020
2020
|
a !== void 0 && Je.assertOptions(
|
|
2021
2021
|
a,
|
|
2022
2022
|
{
|
|
2023
|
-
silentJSONParsing:
|
|
2024
|
-
forcedJSONParsing:
|
|
2025
|
-
clarifyTimeoutError:
|
|
2026
|
-
legacyInterceptorReqResOrdering:
|
|
2027
|
-
advertiseZstdAcceptEncoding:
|
|
2028
|
-
validateStatusUndefinedResolves:
|
|
2023
|
+
silentJSONParsing: K.transitional(K.boolean),
|
|
2024
|
+
forcedJSONParsing: K.transitional(K.boolean),
|
|
2025
|
+
clarifyTimeoutError: K.transitional(K.boolean),
|
|
2026
|
+
legacyInterceptorReqResOrdering: K.transitional(K.boolean),
|
|
2027
|
+
advertiseZstdAcceptEncoding: K.transitional(K.boolean),
|
|
2028
|
+
validateStatusUndefinedResolves: K.transitional(K.boolean)
|
|
2029
2029
|
},
|
|
2030
2030
|
!1
|
|
2031
2031
|
), r != null && (l.isFunction(r) ? n.paramsSerializer = {
|
|
@@ -2033,72 +2033,72 @@ class Qe {
|
|
|
2033
2033
|
} : Je.assertOptions(
|
|
2034
2034
|
r,
|
|
2035
2035
|
{
|
|
2036
|
-
encode:
|
|
2037
|
-
serialize:
|
|
2036
|
+
encode: K.function,
|
|
2037
|
+
serialize: K.function
|
|
2038
2038
|
},
|
|
2039
2039
|
!0
|
|
2040
2040
|
)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), Je.assertOptions(
|
|
2041
2041
|
n,
|
|
2042
2042
|
{
|
|
2043
|
-
baseUrl:
|
|
2044
|
-
withXsrfToken:
|
|
2043
|
+
baseUrl: K.spelling("baseURL"),
|
|
2044
|
+
withXsrfToken: K.spelling("withXSRFToken")
|
|
2045
2045
|
},
|
|
2046
2046
|
!0
|
|
2047
2047
|
), n.method = (n.method || this.defaults.method || "get").toLowerCase();
|
|
2048
2048
|
let s = o && l.merge(o.common, o[n.method]);
|
|
2049
|
-
o && l.forEach(["delete", "get", "head", "post", "put", "patch", "query", "common"], (
|
|
2050
|
-
delete o[
|
|
2051
|
-
}), n.headers =
|
|
2049
|
+
o && l.forEach(["delete", "get", "head", "post", "put", "patch", "query", "common"], (w) => {
|
|
2050
|
+
delete o[w];
|
|
2051
|
+
}), n.headers = re.concat(s, o);
|
|
2052
2052
|
const i = [];
|
|
2053
2053
|
let u = !0;
|
|
2054
|
-
this.interceptors.request.forEach(function(
|
|
2055
|
-
if (typeof
|
|
2054
|
+
this.interceptors.request.forEach(function(w) {
|
|
2055
|
+
if (typeof w.runWhen == "function" && w.runWhen(n) === !1)
|
|
2056
2056
|
return;
|
|
2057
|
-
u = u &&
|
|
2057
|
+
u = u && w.synchronous;
|
|
2058
2058
|
const v = n.transitional || wt;
|
|
2059
|
-
v && v.legacyInterceptorReqResOrdering ? i.unshift(
|
|
2059
|
+
v && v.legacyInterceptorReqResOrdering ? i.unshift(w.fulfilled, w.rejected) : i.push(w.fulfilled, w.rejected);
|
|
2060
2060
|
});
|
|
2061
2061
|
const f = [];
|
|
2062
|
-
this.interceptors.response.forEach(function(
|
|
2063
|
-
f.push(
|
|
2062
|
+
this.interceptors.response.forEach(function(w) {
|
|
2063
|
+
f.push(w.fulfilled, w.rejected);
|
|
2064
2064
|
});
|
|
2065
2065
|
let c, d = 0, b;
|
|
2066
2066
|
if (!u) {
|
|
2067
|
-
const
|
|
2068
|
-
for (
|
|
2069
|
-
c = c.then(
|
|
2067
|
+
const w = [Ht.bind(this), void 0];
|
|
2068
|
+
for (w.unshift(...i), w.push(...f), b = w.length, c = Promise.resolve(n); d < b; )
|
|
2069
|
+
c = c.then(w[d++], w[d++]);
|
|
2070
2070
|
return c;
|
|
2071
2071
|
}
|
|
2072
2072
|
b = i.length;
|
|
2073
|
-
let
|
|
2073
|
+
let _ = n;
|
|
2074
2074
|
for (; d < b; ) {
|
|
2075
|
-
const
|
|
2075
|
+
const w = i[d++], v = i[d++];
|
|
2076
2076
|
try {
|
|
2077
|
-
|
|
2078
|
-
} catch (
|
|
2079
|
-
v.call(this,
|
|
2077
|
+
_ = w(_);
|
|
2078
|
+
} catch (y) {
|
|
2079
|
+
v.call(this, y);
|
|
2080
2080
|
break;
|
|
2081
2081
|
}
|
|
2082
2082
|
}
|
|
2083
2083
|
try {
|
|
2084
|
-
c =
|
|
2085
|
-
} catch (
|
|
2086
|
-
return Promise.reject(
|
|
2084
|
+
c = Ht.call(this, _);
|
|
2085
|
+
} catch (w) {
|
|
2086
|
+
return Promise.reject(w);
|
|
2087
2087
|
}
|
|
2088
2088
|
for (d = 0, b = f.length; d < b; )
|
|
2089
2089
|
c = c.then(f[d++], f[d++]);
|
|
2090
2090
|
return c;
|
|
2091
2091
|
}
|
|
2092
2092
|
getUri(t) {
|
|
2093
|
-
t =
|
|
2094
|
-
const n =
|
|
2095
|
-
return
|
|
2093
|
+
t = Te(this.defaults, t);
|
|
2094
|
+
const n = hn(t.baseURL, t.url, t.allowAbsoluteUrls, t);
|
|
2095
|
+
return dn(n, t.params, t.paramsSerializer);
|
|
2096
2096
|
}
|
|
2097
2097
|
}
|
|
2098
2098
|
l.forEach(["delete", "get", "head", "options"], function(e) {
|
|
2099
2099
|
Qe.prototype[e] = function(t, n) {
|
|
2100
2100
|
return this.request(
|
|
2101
|
-
|
|
2101
|
+
Te(n || {}, {
|
|
2102
2102
|
method: e,
|
|
2103
2103
|
url: t,
|
|
2104
2104
|
data: n && l.hasOwnProp(n, "data") ? n.data : void 0
|
|
@@ -2110,7 +2110,7 @@ l.forEach(["post", "put", "patch", "query"], function(e) {
|
|
|
2110
2110
|
function t(n) {
|
|
2111
2111
|
return function(a, r, o) {
|
|
2112
2112
|
return this.request(
|
|
2113
|
-
|
|
2113
|
+
Te(o || {}, {
|
|
2114
2114
|
method: e,
|
|
2115
2115
|
headers: n ? {
|
|
2116
2116
|
"Content-Type": "multipart/form-data"
|
|
@@ -2124,7 +2124,7 @@ l.forEach(["post", "put", "patch", "query"], function(e) {
|
|
|
2124
2124
|
Qe.prototype[e] = t(), e !== "query" && (Qe.prototype[e + "Form"] = t(!0));
|
|
2125
2125
|
});
|
|
2126
2126
|
const We = Qe;
|
|
2127
|
-
class
|
|
2127
|
+
class Rt {
|
|
2128
2128
|
constructor(t) {
|
|
2129
2129
|
if (typeof t != "function")
|
|
2130
2130
|
throw new TypeError("executor must be a function.");
|
|
@@ -2191,20 +2191,20 @@ class St {
|
|
|
2191
2191
|
static source() {
|
|
2192
2192
|
let t;
|
|
2193
2193
|
return {
|
|
2194
|
-
token: new
|
|
2194
|
+
token: new Rt(function(n) {
|
|
2195
2195
|
t = n;
|
|
2196
2196
|
}),
|
|
2197
2197
|
cancel: t
|
|
2198
2198
|
};
|
|
2199
2199
|
}
|
|
2200
2200
|
}
|
|
2201
|
-
const
|
|
2202
|
-
function
|
|
2201
|
+
const Ar = Rt;
|
|
2202
|
+
function Br(e) {
|
|
2203
2203
|
return function(t) {
|
|
2204
2204
|
return e.apply(null, t);
|
|
2205
2205
|
};
|
|
2206
2206
|
}
|
|
2207
|
-
function
|
|
2207
|
+
function Dr(e) {
|
|
2208
2208
|
return l.isObject(e) && e.isAxiosError === !0;
|
|
2209
2209
|
}
|
|
2210
2210
|
const mt = {
|
|
@@ -2281,52 +2281,52 @@ const mt = {
|
|
|
2281
2281
|
Object.entries(mt).forEach(([e, t]) => {
|
|
2282
2282
|
mt[t] = e;
|
|
2283
2283
|
});
|
|
2284
|
-
const
|
|
2285
|
-
function
|
|
2286
|
-
const t = new We(e), n =
|
|
2284
|
+
const Fr = mt;
|
|
2285
|
+
function wn(e) {
|
|
2286
|
+
const t = new We(e), n = Zt(We.prototype.request, t);
|
|
2287
2287
|
return l.extend(n, We.prototype, t, { allOwnKeys: !0 }), l.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(a) {
|
|
2288
|
-
return
|
|
2288
|
+
return wn(Te(e, a));
|
|
2289
2289
|
}, n;
|
|
2290
2290
|
}
|
|
2291
|
-
const
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2291
|
+
const q = wn(St);
|
|
2292
|
+
q.Axios = We;
|
|
2293
|
+
q.CanceledError = je;
|
|
2294
|
+
q.CancelToken = Ar;
|
|
2295
|
+
q.isCancel = mn;
|
|
2296
|
+
q.VERSION = Pt;
|
|
2297
|
+
q.toFormData = tt;
|
|
2298
|
+
q.AxiosError = R;
|
|
2299
|
+
q.Cancel = q.CanceledError;
|
|
2300
|
+
q.all = function(e) {
|
|
2301
2301
|
return Promise.all(e);
|
|
2302
2302
|
};
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
const
|
|
2312
|
-
function
|
|
2303
|
+
q.spread = Br;
|
|
2304
|
+
q.isAxiosError = Dr;
|
|
2305
|
+
q.mergeConfig = Te;
|
|
2306
|
+
q.AxiosHeaders = re;
|
|
2307
|
+
q.formToJSON = (e) => pn(l.isHTMLForm(e) ? new FormData(e) : e);
|
|
2308
|
+
q.getAdapter = vn.getAdapter;
|
|
2309
|
+
q.HttpStatusCode = Fr;
|
|
2310
|
+
q.default = q;
|
|
2311
|
+
const Nr = q;
|
|
2312
|
+
function Lr(e, t) {
|
|
2313
2313
|
const n = t && t.toUpperCase() !== "MY" ? `.${t.toLowerCase()}` : "";
|
|
2314
2314
|
return `https://portal-v2${e === "dev" ? "-dev" : ""}${n}.feedmeapi.com`;
|
|
2315
2315
|
}
|
|
2316
|
-
function
|
|
2317
|
-
return
|
|
2316
|
+
function Ur(e, t) {
|
|
2317
|
+
return Lr(e, t);
|
|
2318
2318
|
}
|
|
2319
|
-
const
|
|
2320
|
-
function
|
|
2319
|
+
const jr = ["1x1", "4x3", "16x9", "9x16"], gt = "asset";
|
|
2320
|
+
function Ir(e) {
|
|
2321
2321
|
return e.some((t) => t.status === "pending");
|
|
2322
2322
|
}
|
|
2323
|
-
function
|
|
2323
|
+
function Mr(e) {
|
|
2324
2324
|
if (e.length === 0)
|
|
2325
2325
|
return null;
|
|
2326
2326
|
const t = e.filter((n) => n.status === "active").length;
|
|
2327
2327
|
return { tone: e.some((n) => n.status === "pending") ? "progress" : e.some((n) => n.status === "failed") ? "warning" : "done", active: t, total: e.length };
|
|
2328
2328
|
}
|
|
2329
|
-
function
|
|
2329
|
+
function xn(e, t) {
|
|
2330
2330
|
return [
|
|
2331
2331
|
{ key: "original", kind: "original", ratio: null, url: e.url, status: null },
|
|
2332
2332
|
...t.map((n) => ({
|
|
@@ -2338,7 +2338,7 @@ function jr(e, t) {
|
|
|
2338
2338
|
}))
|
|
2339
2339
|
];
|
|
2340
2340
|
}
|
|
2341
|
-
function
|
|
2341
|
+
function zr(e) {
|
|
2342
2342
|
return e.refType && e.refId ? {
|
|
2343
2343
|
kind: "image",
|
|
2344
2344
|
entry: {
|
|
@@ -2351,11 +2351,31 @@ function Ir(e) {
|
|
|
2351
2351
|
}
|
|
2352
2352
|
} : { kind: "asset", id: e.id };
|
|
2353
2353
|
}
|
|
2354
|
-
function
|
|
2354
|
+
function Vr(e, t, n) {
|
|
2355
|
+
if (e.kind === "original" || e.ratio === null)
|
|
2356
|
+
return {
|
|
2357
|
+
ratio: null,
|
|
2358
|
+
dimensions: `${t.width}×${t.height}`,
|
|
2359
|
+
sizeBytes: t.fileSizeBytes,
|
|
2360
|
+
contentType: t.mimeType,
|
|
2361
|
+
url: t.url
|
|
2362
|
+
};
|
|
2363
|
+
const a = n.find((r) => r.aspectRatio === e.ratio);
|
|
2364
|
+
return {
|
|
2365
|
+
ratio: e.ratio,
|
|
2366
|
+
dimensions: a != null && a.width && a != null && a.height ? `${a.width}×${a.height}` : null,
|
|
2367
|
+
sizeBytes: (a == null ? void 0 : a.fileSizeBytes) ?? null,
|
|
2368
|
+
contentType: (a == null ? void 0 : a.contentType) ?? null,
|
|
2369
|
+
// Falling back to the asset's url here would reintroduce the copy-link bug, so a
|
|
2370
|
+
// missing variant keeps its derivable address rather than borrowing the original's.
|
|
2371
|
+
url: (a == null ? void 0 : a.url) ?? `${t.url}?aspect_ratio=${e.ratio}`
|
|
2372
|
+
};
|
|
2373
|
+
}
|
|
2374
|
+
function we() {
|
|
2355
2375
|
var e;
|
|
2356
|
-
const { sessionUser: t, namespace: n, currentCountry: a } =
|
|
2357
|
-
return
|
|
2358
|
-
baseURL:
|
|
2376
|
+
const { sessionUser: t, namespace: n, currentCountry: a } = Kt(), r = (e = t.value) == null ? void 0 : e.token;
|
|
2377
|
+
return Nr.create({
|
|
2378
|
+
baseURL: Ur(n.value, a.value),
|
|
2359
2379
|
headers: r ? { Authorization: `Bearer ${r}` } : {}
|
|
2360
2380
|
});
|
|
2361
2381
|
}
|
|
@@ -2363,66 +2383,66 @@ function at(e) {
|
|
|
2363
2383
|
return `/media-v1/businesses/${e}/assets`;
|
|
2364
2384
|
}
|
|
2365
2385
|
async function rt(e) {
|
|
2366
|
-
const { businessId: t, ...n } = e, { data: a } = await
|
|
2386
|
+
const { businessId: t, ...n } = e, { data: a } = await we().get(at(t), { params: n });
|
|
2367
2387
|
return a;
|
|
2368
2388
|
}
|
|
2369
|
-
async function
|
|
2389
|
+
async function kn(e) {
|
|
2370
2390
|
const { resources: t } = await rt({ businessId: e, limit: 200 }), n = /* @__PURE__ */ new Set();
|
|
2371
2391
|
return t.forEach((a) => a.tags.forEach((r) => n.add(r))), [...n].sort();
|
|
2372
2392
|
}
|
|
2373
|
-
async function
|
|
2393
|
+
async function qr(e) {
|
|
2374
2394
|
const { resources: t } = await rt({ businessId: e, limit: 200 }), n = /* @__PURE__ */ new Map();
|
|
2375
2395
|
return t.forEach((a) => a.tags.forEach((r) => n.set(r, (n.get(r) ?? 0) + 1))), { tags: [...n.entries()].map(([a, r]) => ({ tag: a, count: r })).sort((a, r) => a.tag.localeCompare(r.tag)), total: t.length };
|
|
2376
2396
|
}
|
|
2377
|
-
async function
|
|
2378
|
-
const { data: a } = await
|
|
2397
|
+
async function $r(e, t, n) {
|
|
2398
|
+
const { data: a } = await we().patch(`${at(e)}/${t}`, { fileName: n });
|
|
2379
2399
|
return a;
|
|
2380
2400
|
}
|
|
2381
|
-
async function
|
|
2382
|
-
const { data: a } = await
|
|
2401
|
+
async function Gr(e, t, n) {
|
|
2402
|
+
const { data: a } = await we().patch(`${at(e)}/${t}`, { tags: n });
|
|
2383
2403
|
return a;
|
|
2384
2404
|
}
|
|
2385
|
-
async function
|
|
2386
|
-
await
|
|
2405
|
+
async function Hr(e, t) {
|
|
2406
|
+
await we().delete(`${at(e)}/${t}`);
|
|
2387
2407
|
}
|
|
2388
2408
|
function Ie(e) {
|
|
2389
2409
|
return `/media-v1/businesses/${e}/images`;
|
|
2390
2410
|
}
|
|
2391
|
-
async function
|
|
2392
|
-
const { data: a } = await
|
|
2411
|
+
async function Jr(e, t, n) {
|
|
2412
|
+
const { data: a } = await we().post(`${Ie(e)}/create`, t, {
|
|
2393
2413
|
headers: n ? { "Idempotency-Key": n } : {}
|
|
2394
2414
|
});
|
|
2395
2415
|
return a;
|
|
2396
2416
|
}
|
|
2397
|
-
async function
|
|
2398
|
-
const { data: n } = await
|
|
2417
|
+
async function Wr(e, t) {
|
|
2418
|
+
const { data: n } = await we().post(`${Ie(e)}/delete`, {
|
|
2399
2419
|
entries: t
|
|
2400
2420
|
});
|
|
2401
2421
|
return n.results;
|
|
2402
2422
|
}
|
|
2403
|
-
async function
|
|
2404
|
-
const { businessId: t, refIds: n, ...a } = e, { data: r } = await
|
|
2423
|
+
async function Kr(e) {
|
|
2424
|
+
const { businessId: t, refIds: n, ...a } = e, { data: r } = await we().get(Ie(t), {
|
|
2405
2425
|
params: { ...a, refIds: n.join(",") }
|
|
2406
2426
|
});
|
|
2407
2427
|
return r.images;
|
|
2408
2428
|
}
|
|
2409
|
-
async function
|
|
2410
|
-
const { data: n } = await
|
|
2429
|
+
async function Xr(e, t) {
|
|
2430
|
+
const { data: n } = await we().post(`${Ie(e)}/upload-intent`, t);
|
|
2411
2431
|
return n;
|
|
2412
2432
|
}
|
|
2413
|
-
async function
|
|
2414
|
-
const { data: n } = await
|
|
2433
|
+
async function Zr(e, t) {
|
|
2434
|
+
const { data: n } = await we().post(`${Ie(e)}/confirm`, t);
|
|
2415
2435
|
return n;
|
|
2416
2436
|
}
|
|
2417
2437
|
async function ht(e, t) {
|
|
2418
|
-
const n =
|
|
2438
|
+
const n = zr(t);
|
|
2419
2439
|
if (n.kind === "image") {
|
|
2420
|
-
await
|
|
2440
|
+
await Wr(e, [n.entry]);
|
|
2421
2441
|
return;
|
|
2422
2442
|
}
|
|
2423
|
-
await
|
|
2443
|
+
await Hr(e, n.id);
|
|
2424
2444
|
}
|
|
2425
|
-
const
|
|
2445
|
+
const Qr = {
|
|
2426
2446
|
assetGrid: {
|
|
2427
2447
|
loading: "Loading…",
|
|
2428
2448
|
empty: "No assets yet",
|
|
@@ -2494,9 +2514,9 @@ const Kr = {
|
|
|
2494
2514
|
failed: "Generation failed",
|
|
2495
2515
|
regenerate: "Regenerate"
|
|
2496
2516
|
}
|
|
2497
|
-
}, Xr = {
|
|
2498
|
-
mediaPicker: Kr
|
|
2499
2517
|
}, Yr = {
|
|
2518
|
+
mediaPicker: Qr
|
|
2519
|
+
}, eo = {
|
|
2500
2520
|
assetGrid: {
|
|
2501
2521
|
loading: "Chargement…",
|
|
2502
2522
|
empty: "Aucun média",
|
|
@@ -2568,9 +2588,9 @@ const Kr = {
|
|
|
2568
2588
|
failed: "Échec de la génération",
|
|
2569
2589
|
regenerate: "Régénérer"
|
|
2570
2590
|
}
|
|
2571
|
-
},
|
|
2572
|
-
mediaPicker:
|
|
2573
|
-
},
|
|
2591
|
+
}, to = {
|
|
2592
|
+
mediaPicker: eo
|
|
2593
|
+
}, no = {
|
|
2574
2594
|
assetGrid: {
|
|
2575
2595
|
loading: "Memuat…",
|
|
2576
2596
|
empty: "Belum ada media",
|
|
@@ -2642,9 +2662,9 @@ const Kr = {
|
|
|
2642
2662
|
failed: "Gagal membuat",
|
|
2643
2663
|
regenerate: "Buat ulang"
|
|
2644
2664
|
}
|
|
2645
|
-
},
|
|
2646
|
-
mediaPicker:
|
|
2647
|
-
},
|
|
2665
|
+
}, ao = {
|
|
2666
|
+
mediaPicker: no
|
|
2667
|
+
}, ro = {
|
|
2648
2668
|
assetGrid: {
|
|
2649
2669
|
loading: "読み込み中…",
|
|
2650
2670
|
empty: "素材がありません",
|
|
@@ -2716,9 +2736,9 @@ const Kr = {
|
|
|
2716
2736
|
failed: "生成に失敗しました",
|
|
2717
2737
|
regenerate: "再生成"
|
|
2718
2738
|
}
|
|
2719
|
-
},
|
|
2720
|
-
mediaPicker:
|
|
2721
|
-
},
|
|
2739
|
+
}, oo = {
|
|
2740
|
+
mediaPicker: ro
|
|
2741
|
+
}, so = {
|
|
2722
2742
|
assetGrid: {
|
|
2723
2743
|
loading: "กำลังโหลด…",
|
|
2724
2744
|
empty: "ยังไม่มีสื่อ",
|
|
@@ -2790,9 +2810,9 @@ const Kr = {
|
|
|
2790
2810
|
failed: "สร้างไม่สำเร็จ",
|
|
2791
2811
|
regenerate: "สร้างใหม่"
|
|
2792
2812
|
}
|
|
2793
|
-
},
|
|
2794
|
-
mediaPicker:
|
|
2795
|
-
},
|
|
2813
|
+
}, io = {
|
|
2814
|
+
mediaPicker: so
|
|
2815
|
+
}, lo = {
|
|
2796
2816
|
assetGrid: {
|
|
2797
2817
|
loading: "加载中…",
|
|
2798
2818
|
empty: "暂无素材",
|
|
@@ -2864,9 +2884,9 @@ const Kr = {
|
|
|
2864
2884
|
failed: "生成失败",
|
|
2865
2885
|
regenerate: "重新生成"
|
|
2866
2886
|
}
|
|
2867
|
-
},
|
|
2868
|
-
mediaPicker:
|
|
2869
|
-
},
|
|
2887
|
+
}, uo = {
|
|
2888
|
+
mediaPicker: lo
|
|
2889
|
+
}, co = {
|
|
2870
2890
|
assetGrid: {
|
|
2871
2891
|
loading: "載入中…",
|
|
2872
2892
|
empty: "暫無素材",
|
|
@@ -2938,29 +2958,29 @@ const Kr = {
|
|
|
2938
2958
|
failed: "產生失敗",
|
|
2939
2959
|
regenerate: "重新產生"
|
|
2940
2960
|
}
|
|
2941
|
-
},
|
|
2942
|
-
mediaPicker:
|
|
2943
|
-
},
|
|
2944
|
-
"en-US":
|
|
2945
|
-
"zh-CN":
|
|
2946
|
-
"zh-Hant":
|
|
2947
|
-
"th-TH":
|
|
2948
|
-
"ja-JP":
|
|
2949
|
-
"id-ID":
|
|
2950
|
-
"fr-MA":
|
|
2951
|
-
},
|
|
2961
|
+
}, fo = {
|
|
2962
|
+
mediaPicker: co
|
|
2963
|
+
}, ke = {
|
|
2964
|
+
"en-US": Yr,
|
|
2965
|
+
"zh-CN": uo,
|
|
2966
|
+
"zh-Hant": fo,
|
|
2967
|
+
"th-TH": io,
|
|
2968
|
+
"ja-JP": oo,
|
|
2969
|
+
"id-ID": ao,
|
|
2970
|
+
"fr-MA": to
|
|
2971
|
+
}, po = {
|
|
2952
2972
|
key: 0,
|
|
2953
2973
|
class: "py-64 text-center text-sm text-gray-400"
|
|
2954
|
-
},
|
|
2974
|
+
}, mo = {
|
|
2955
2975
|
key: 1,
|
|
2956
2976
|
class: "py-64 text-center text-sm text-gray-400"
|
|
2957
|
-
},
|
|
2977
|
+
}, go = {
|
|
2958
2978
|
key: 2,
|
|
2959
2979
|
class: "bg-white border border-fm-color-neutral-gray-200 rounded-lg overflow-hidden"
|
|
2960
|
-
},
|
|
2980
|
+
}, ho = { class: "grid grid-cols-[40px_56px_minmax(160px,2.2fr)_110px_90px_150px_120px_40px] 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" }, bo = ["onClick"], yo = ["onClick"], vo = { key: 1 }, wo = { class: "w-[44px] h-[36px] rounded overflow-hidden" }, xo = { class: "min-w-0 flex flex-col gap-4" }, ko = { class: "text-xs font-semibold truncate" }, So = { class: "flex items-center gap-8" }, Po = { class: "text-[11px] text-fm-color-typo-tertiary" }, Eo = { class: "text-xs text-fm-color-typo-primary" }, Ro = { class: "text-xs text-fm-color-typo-primary" }, To = { class: "flex items-center gap-8 min-w-0" }, Oo = { class: "text-xs text-fm-color-typo-primary truncate" }, Co = { class: "text-xs text-fm-color-typo-secondary" }, _o = {
|
|
2961
2981
|
key: 3,
|
|
2962
2982
|
class: "grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-16"
|
|
2963
|
-
},
|
|
2983
|
+
}, Ao = ["onClick"], Bo = { class: "relative aspect-[4/3]" }, Do = ["onClick"], Fo = { class: "absolute bottom-8 left-8 bg-black/70 text-white text-[11px] font-semibold px-[6px] py-[2px] rounded" }, No = { class: "px-8 py-6 space-y-2" }, Lo = { class: "text-xs font-semibold truncate" }, Uo = { class: "text-[11px] text-gray-500 truncate" }, Sn = /* @__PURE__ */ ye({
|
|
2964
2984
|
__name: "AssetGrid",
|
|
2965
2985
|
props: {
|
|
2966
2986
|
assets: {},
|
|
@@ -2972,13 +2992,13 @@ const Kr = {
|
|
|
2972
2992
|
},
|
|
2973
2993
|
emits: ["open", "toggle", "delete"],
|
|
2974
2994
|
setup(e, { emit: t }) {
|
|
2975
|
-
const { t: n } =
|
|
2995
|
+
const { t: n } = ve({ messages: ke }), a = e;
|
|
2976
2996
|
function r(c) {
|
|
2977
2997
|
var d;
|
|
2978
2998
|
if (!c.refId)
|
|
2979
2999
|
return null;
|
|
2980
3000
|
const b = (d = a.variantsByRefId) == null ? void 0 : d.get(c.refId);
|
|
2981
|
-
return b ?
|
|
3001
|
+
return b ? Mr(b.variants) : null;
|
|
2982
3002
|
}
|
|
2983
3003
|
function o(c) {
|
|
2984
3004
|
return c.tone === "done" ? n("mediaPicker.variants.badgeDone", { count: c.total }) : n("mediaPicker.variants.badgeProgress", { active: c.active, total: c.total });
|
|
@@ -2992,130 +3012,130 @@ const Kr = {
|
|
|
2992
3012
|
return c >= 1024 * 1024 ? `${(c / 1024 / 1024).toFixed(1)} MB` : `${Math.round(c / 1024)} KB`;
|
|
2993
3013
|
}
|
|
2994
3014
|
function f(c) {
|
|
2995
|
-
const d = Date.now() - new Date(c).getTime(), b = 6e4,
|
|
3015
|
+
const d = Date.now() - new Date(c).getTime(), b = 6e4, _ = 36e5, w = 864e5;
|
|
2996
3016
|
if (d < b)
|
|
2997
3017
|
return n("mediaPicker.assetGrid.time.justNow");
|
|
2998
|
-
if (d <
|
|
3018
|
+
if (d < _)
|
|
2999
3019
|
return n("mediaPicker.assetGrid.time.minutesAgo", { n: Math.floor(d / b) });
|
|
3000
|
-
if (d <
|
|
3001
|
-
return n("mediaPicker.assetGrid.time.hoursAgo", { n: Math.floor(d /
|
|
3002
|
-
if (d <
|
|
3003
|
-
return n("mediaPicker.assetGrid.time.daysAgo", { n: Math.floor(d /
|
|
3020
|
+
if (d < w)
|
|
3021
|
+
return n("mediaPicker.assetGrid.time.hoursAgo", { n: Math.floor(d / _) });
|
|
3022
|
+
if (d < w * 8)
|
|
3023
|
+
return n("mediaPicker.assetGrid.time.daysAgo", { n: Math.floor(d / w) });
|
|
3004
3024
|
const v = new Date(c);
|
|
3005
3025
|
return `${v.getFullYear()}-${String(v.getMonth() + 1).padStart(2, "0")}-${String(v.getDate()).padStart(2, "0")}`;
|
|
3006
3026
|
}
|
|
3007
3027
|
return (c, d) => {
|
|
3008
|
-
const b = M("FmIcon"),
|
|
3009
|
-
return e.loading ? (
|
|
3010
|
-
h("div",
|
|
3028
|
+
const b = M("FmIcon"), _ = M("FmThumbnail"), w = M("FmAvatar"), v = M("FmButton");
|
|
3029
|
+
return e.loading ? (S(), C("div", po, E(T(n)("mediaPicker.assetGrid.loading")), 1)) : e.assets.length === 0 ? (S(), C("div", mo, E(T(n)("mediaPicker.assetGrid.empty")), 1)) : e.view === "list" ? (S(), C("div", go, [
|
|
3030
|
+
h("div", ho, [
|
|
3011
3031
|
d[0] || (d[0] = h("span", null, null, -1)),
|
|
3012
3032
|
d[1] || (d[1] = h("span", null, null, -1)),
|
|
3013
|
-
h("span", null,
|
|
3014
|
-
h("span", null,
|
|
3015
|
-
h("span", null,
|
|
3016
|
-
h("span", null,
|
|
3017
|
-
h("span", null,
|
|
3033
|
+
h("span", null, E(T(n)("mediaPicker.assetGrid.columns.name")), 1),
|
|
3034
|
+
h("span", null, E(T(n)("mediaPicker.assetGrid.columns.dimensions")), 1),
|
|
3035
|
+
h("span", null, E(T(n)("mediaPicker.assetGrid.columns.fileSize")), 1),
|
|
3036
|
+
h("span", null, E(T(n)("mediaPicker.assetGrid.columns.uploader")), 1),
|
|
3037
|
+
h("span", null, E(T(n)("mediaPicker.assetGrid.columns.uploadedAt")), 1),
|
|
3018
3038
|
d[2] || (d[2] = h("span", null, null, -1))
|
|
3019
3039
|
]),
|
|
3020
|
-
(
|
|
3021
|
-
key:
|
|
3022
|
-
class:
|
|
3023
|
-
onClick: (p) => s("open",
|
|
3040
|
+
(S(!0), C(Z, null, be(e.assets, (y) => (S(), C("div", {
|
|
3041
|
+
key: y.id,
|
|
3042
|
+
class: te(["grid grid-cols-[40px_56px_minmax(160px,2.2fr)_110px_90px_150px_120px_40px] items-center gap-8 px-16 h-56 border-b border-fm-color-neutral-gray-200 last:border-b-0 cursor-pointer hover:bg-fm-color-neutral-gray-100", e.selectedIds.has(y.id) ? "bg-[#FFF7F0]" : "bg-white"]),
|
|
3043
|
+
onClick: (p) => s("open", y)
|
|
3024
3044
|
}, [
|
|
3025
|
-
e.selectable ? (
|
|
3045
|
+
e.selectable ? (S(), C("button", {
|
|
3026
3046
|
key: 0,
|
|
3027
|
-
class:
|
|
3028
|
-
onClick: st((p) => s("toggle",
|
|
3047
|
+
class: te(["w-[20px] h-[20px] rounded flex items-center justify-center", e.selectedIds.has(y.id) ? "bg-[--fm-color-brand-primary,#FF7823]" : "bg-white border border-fm-color-neutral-gray-200"]),
|
|
3048
|
+
onClick: st((p) => s("toggle", y), ["stop"])
|
|
3029
3049
|
}, [
|
|
3030
|
-
e.selectedIds.has(
|
|
3050
|
+
e.selectedIds.has(y.id) ? (S(), ne(b, {
|
|
3031
3051
|
key: 0,
|
|
3032
3052
|
name: "check",
|
|
3033
3053
|
size: "sm",
|
|
3034
3054
|
color: "white"
|
|
3035
|
-
})) :
|
|
3036
|
-
], 10,
|
|
3037
|
-
h("div",
|
|
3038
|
-
|
|
3039
|
-
src:
|
|
3055
|
+
})) : V("", !0)
|
|
3056
|
+
], 10, yo)) : (S(), C("span", vo)),
|
|
3057
|
+
h("div", wo, [
|
|
3058
|
+
F(_, {
|
|
3059
|
+
src: y.url,
|
|
3040
3060
|
size: "sm",
|
|
3041
3061
|
class: "!w-full !h-full"
|
|
3042
3062
|
}, null, 8, ["src"])
|
|
3043
3063
|
]),
|
|
3044
|
-
h("div",
|
|
3045
|
-
h("span",
|
|
3046
|
-
h("div",
|
|
3047
|
-
h("span",
|
|
3048
|
-
r(
|
|
3064
|
+
h("div", xo, [
|
|
3065
|
+
h("span", ko, E(y.fileName), 1),
|
|
3066
|
+
h("div", So, [
|
|
3067
|
+
h("span", Po, E(i(y.mimeType)), 1),
|
|
3068
|
+
r(y) ? (S(), C("span", {
|
|
3049
3069
|
key: 0,
|
|
3050
|
-
class:
|
|
3051
|
-
"text-fm-color-typo-tertiary": r(
|
|
3052
|
-
"text-blue-600": r(
|
|
3053
|
-
"text-amber-600": r(
|
|
3070
|
+
class: te(["text-[11px] font-semibold", {
|
|
3071
|
+
"text-fm-color-typo-tertiary": r(y).tone === "done",
|
|
3072
|
+
"text-blue-600": r(y).tone === "progress",
|
|
3073
|
+
"text-amber-600": r(y).tone === "warning"
|
|
3054
3074
|
}])
|
|
3055
|
-
},
|
|
3075
|
+
}, E(o(r(y))), 3)) : V("", !0)
|
|
3056
3076
|
])
|
|
3057
3077
|
]),
|
|
3058
|
-
h("span",
|
|
3059
|
-
h("span",
|
|
3060
|
-
h("div",
|
|
3061
|
-
|
|
3062
|
-
name:
|
|
3078
|
+
h("span", Eo, E(y.width) + "×" + E(y.height), 1),
|
|
3079
|
+
h("span", Ro, E(u(y.fileSizeBytes)), 1),
|
|
3080
|
+
h("div", To, [
|
|
3081
|
+
F(w, {
|
|
3082
|
+
name: y.uploadedBy,
|
|
3063
3083
|
size: "sm"
|
|
3064
3084
|
}, null, 8, ["name"]),
|
|
3065
|
-
h("span",
|
|
3085
|
+
h("span", Oo, E(y.uploadedBy), 1)
|
|
3066
3086
|
]),
|
|
3067
|
-
h("span",
|
|
3068
|
-
|
|
3087
|
+
h("span", Co, E(f(y.createdAt)), 1),
|
|
3088
|
+
F(v, {
|
|
3069
3089
|
variant: "tertiary",
|
|
3070
3090
|
size: "md",
|
|
3071
3091
|
"prepend-icon": "delete",
|
|
3072
3092
|
label: "",
|
|
3073
|
-
onClick: st((p) => s("delete",
|
|
3093
|
+
onClick: st((p) => s("delete", y), ["stop"])
|
|
3074
3094
|
}, null, 8, ["onClick"])
|
|
3075
|
-
], 10,
|
|
3076
|
-
])) : (
|
|
3077
|
-
(
|
|
3078
|
-
key:
|
|
3079
|
-
class:
|
|
3080
|
-
onClick: (p) => s("open",
|
|
3095
|
+
], 10, bo))), 128))
|
|
3096
|
+
])) : (S(), C("div", _o, [
|
|
3097
|
+
(S(!0), C(Z, null, be(e.assets, (y) => (S(), C("div", {
|
|
3098
|
+
key: y.id,
|
|
3099
|
+
class: te(["cursor-pointer rounded-lg border bg-white overflow-hidden transition-shadow hover:shadow-lg", e.selectedIds.has(y.id) ? "border-2 border-[--fm-color-brand-primary,#FF7823]" : "border-gray-200"]),
|
|
3100
|
+
onClick: (p) => s("open", y)
|
|
3081
3101
|
}, [
|
|
3082
|
-
h("div",
|
|
3083
|
-
|
|
3084
|
-
src:
|
|
3102
|
+
h("div", Bo, [
|
|
3103
|
+
F(_, {
|
|
3104
|
+
src: y.url,
|
|
3085
3105
|
size: "xl",
|
|
3086
3106
|
class: "w-full h-full"
|
|
3087
3107
|
}, null, 8, ["src"]),
|
|
3088
|
-
e.selectable ? (
|
|
3108
|
+
e.selectable ? (S(), C("button", {
|
|
3089
3109
|
key: 0,
|
|
3090
|
-
class:
|
|
3091
|
-
onClick: st((p) => s("toggle",
|
|
3110
|
+
class: te(["absolute top-8 left-8 z-10 w-24 h-24 rounded-full flex items-center justify-center", e.selectedIds.has(y.id) ? "bg-[--fm-color-brand-primary,#FF7823]" : "bg-black/30 border border-white/80"]),
|
|
3111
|
+
onClick: st((p) => s("toggle", y), ["stop"])
|
|
3092
3112
|
}, [
|
|
3093
|
-
e.selectedIds.has(
|
|
3113
|
+
e.selectedIds.has(y.id) ? (S(), ne(b, {
|
|
3094
3114
|
key: 0,
|
|
3095
3115
|
name: "check",
|
|
3096
3116
|
size: "sm",
|
|
3097
3117
|
color: "white"
|
|
3098
|
-
})) :
|
|
3099
|
-
], 10,
|
|
3100
|
-
h("span",
|
|
3101
|
-
r(
|
|
3118
|
+
})) : V("", !0)
|
|
3119
|
+
], 10, Do)) : V("", !0),
|
|
3120
|
+
h("span", Fo, E(i(y.mimeType)), 1),
|
|
3121
|
+
r(y) ? (S(), C("span", {
|
|
3102
3122
|
key: 1,
|
|
3103
|
-
class:
|
|
3104
|
-
"bg-black/70": r(
|
|
3105
|
-
"bg-blue-600/90": r(
|
|
3106
|
-
"bg-amber-600/90": r(
|
|
3123
|
+
class: te(["absolute bottom-8 right-8 text-white text-[11px] font-semibold px-[6px] py-[2px] rounded", {
|
|
3124
|
+
"bg-black/70": r(y).tone === "done",
|
|
3125
|
+
"bg-blue-600/90": r(y).tone === "progress",
|
|
3126
|
+
"bg-amber-600/90": r(y).tone === "warning"
|
|
3107
3127
|
}])
|
|
3108
|
-
},
|
|
3128
|
+
}, E(o(r(y))), 3)) : V("", !0)
|
|
3109
3129
|
]),
|
|
3110
|
-
h("div",
|
|
3111
|
-
h("div",
|
|
3112
|
-
h("span",
|
|
3130
|
+
h("div", No, [
|
|
3131
|
+
h("div", Lo, E(y.fileName), 1),
|
|
3132
|
+
h("span", Uo, E(y.width) + "×" + E(y.height) + " · " + E(u(y.fileSizeBytes)), 1)
|
|
3113
3133
|
])
|
|
3114
|
-
], 10,
|
|
3134
|
+
], 10, Ao))), 128))
|
|
3115
3135
|
]));
|
|
3116
3136
|
};
|
|
3117
3137
|
}
|
|
3118
|
-
}),
|
|
3138
|
+
}), jo = { class: "flex flex-wrap items-center gap-8" }, Io = { class: "flex items-center gap-6" }, Mo = { class: "flex items-center gap-6" }, zo = /* @__PURE__ */ ye({
|
|
3119
3139
|
__name: "TagFilterTabs",
|
|
3120
3140
|
props: {
|
|
3121
3141
|
tags: {},
|
|
@@ -3124,37 +3144,37 @@ const Kr = {
|
|
|
3124
3144
|
},
|
|
3125
3145
|
emits: ["update:modelValue"],
|
|
3126
3146
|
setup(e, { emit: t }) {
|
|
3127
|
-
const { t: n } =
|
|
3147
|
+
const { t: n } = ve({ messages: ke }), a = t;
|
|
3128
3148
|
return (r, o) => {
|
|
3129
3149
|
const s = M("FmChip");
|
|
3130
|
-
return
|
|
3131
|
-
|
|
3150
|
+
return S(), C("div", jo, [
|
|
3151
|
+
F(s, {
|
|
3132
3152
|
selectable: "",
|
|
3133
3153
|
selected: e.modelValue === null,
|
|
3134
3154
|
onClick: o[0] || (o[0] = (i) => a("update:modelValue", null))
|
|
3135
3155
|
}, {
|
|
3136
|
-
default:
|
|
3137
|
-
h("span",
|
|
3138
|
-
|
|
3156
|
+
default: le(() => [
|
|
3157
|
+
h("span", Io, [
|
|
3158
|
+
ge(E(T(n)("mediaPicker.tagFilterTabs.all")) + " ", 1),
|
|
3139
3159
|
h("span", {
|
|
3140
|
-
class:
|
|
3141
|
-
},
|
|
3160
|
+
class: te(["text-[11px] leading-none rounded-full px-6 py-2", e.modelValue === null ? "bg-white/25" : "bg-fm-color-neutral-gray-100"])
|
|
3161
|
+
}, E(e.total), 3)
|
|
3142
3162
|
])
|
|
3143
3163
|
]),
|
|
3144
3164
|
_: 1
|
|
3145
3165
|
}, 8, ["selected"]),
|
|
3146
|
-
(
|
|
3166
|
+
(S(!0), C(Z, null, be(e.tags, (i) => (S(), ne(s, {
|
|
3147
3167
|
key: i.tag,
|
|
3148
3168
|
selectable: "",
|
|
3149
3169
|
selected: e.modelValue === i.tag,
|
|
3150
3170
|
onClick: (u) => a("update:modelValue", i.tag)
|
|
3151
3171
|
}, {
|
|
3152
|
-
default:
|
|
3153
|
-
h("span",
|
|
3154
|
-
|
|
3172
|
+
default: le(() => [
|
|
3173
|
+
h("span", Mo, [
|
|
3174
|
+
ge(E(i.tag) + " ", 1),
|
|
3155
3175
|
h("span", {
|
|
3156
|
-
class:
|
|
3157
|
-
},
|
|
3176
|
+
class: te(["text-[11px] leading-none rounded-full px-6 py-2", e.modelValue === i.tag ? "bg-white/25" : "bg-fm-color-neutral-gray-100"])
|
|
3177
|
+
}, E(i.count), 3)
|
|
3158
3178
|
])
|
|
3159
3179
|
]),
|
|
3160
3180
|
_: 2
|
|
@@ -3162,7 +3182,7 @@ const Kr = {
|
|
|
3162
3182
|
]);
|
|
3163
3183
|
};
|
|
3164
3184
|
}
|
|
3165
|
-
}),
|
|
3185
|
+
}), Vo = { class: "space-y-8" }, qo = { class: "text-xs font-semibold text-gray-500" }, $o = { class: "flex flex-wrap gap-8" }, Go = ["onClick"], Ho = { class: "text-[11px] text-gray-400" }, Jo = /* @__PURE__ */ ye({
|
|
3166
3186
|
__name: "RatioSelector",
|
|
3167
3187
|
props: {
|
|
3168
3188
|
modelValue: {},
|
|
@@ -3170,7 +3190,7 @@ const Kr = {
|
|
|
3170
3190
|
},
|
|
3171
3191
|
emits: ["update:modelValue"],
|
|
3172
3192
|
setup(e, { emit: t }) {
|
|
3173
|
-
const { t: n } =
|
|
3193
|
+
const { t: n } = ve({ messages: ke }), a = e, r = t;
|
|
3174
3194
|
function o(i) {
|
|
3175
3195
|
a.disabled || r(
|
|
3176
3196
|
"update:modelValue",
|
|
@@ -3180,33 +3200,33 @@ const Kr = {
|
|
|
3180
3200
|
function s(i) {
|
|
3181
3201
|
return i.replace("x", ":");
|
|
3182
3202
|
}
|
|
3183
|
-
return (i, u) => (
|
|
3184
|
-
h("div",
|
|
3185
|
-
h("div",
|
|
3186
|
-
(
|
|
3203
|
+
return (i, u) => (S(), C("div", Vo, [
|
|
3204
|
+
h("div", qo, E(T(n)("mediaPicker.ratios.title")), 1),
|
|
3205
|
+
h("div", $o, [
|
|
3206
|
+
(S(!0), C(Z, null, be(T(jr), (f) => (S(), C("button", {
|
|
3187
3207
|
key: f,
|
|
3188
3208
|
type: "button",
|
|
3189
|
-
class:
|
|
3209
|
+
class: te(["h-[30px] px-12 rounded-full border text-[11px] font-semibold transition-colors", [
|
|
3190
3210
|
e.modelValue.includes(f) ? "border-[--fm-color-brand-primary,#FF7823] text-[--fm-color-brand-primary,#FF7823] bg-[#FFF7F0]" : "border-fm-color-neutral-gray-300 text-gray-500",
|
|
3191
3211
|
e.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
3192
3212
|
]]),
|
|
3193
3213
|
onClick: (c) => o(f)
|
|
3194
|
-
},
|
|
3214
|
+
}, E(s(f)), 11, Go))), 128))
|
|
3195
3215
|
]),
|
|
3196
|
-
h("div",
|
|
3216
|
+
h("div", Ho, E(T(n)("mediaPicker.ratios.hint")), 1)
|
|
3197
3217
|
]));
|
|
3198
3218
|
}
|
|
3199
3219
|
});
|
|
3200
|
-
function
|
|
3220
|
+
function Wt(e) {
|
|
3201
3221
|
return new Promise((t) => {
|
|
3202
3222
|
const n = new Image();
|
|
3203
3223
|
n.onload = () => t({ width: n.naturalWidth || 480, height: n.naturalHeight || 360 }), n.onerror = () => t({ width: 480, height: 360 }), n.src = e;
|
|
3204
3224
|
});
|
|
3205
3225
|
}
|
|
3206
|
-
const
|
|
3226
|
+
const Wo = { class: "flex flex-wrap items-center gap-8" }, Ko = {
|
|
3207
3227
|
key: 1,
|
|
3208
3228
|
class: "inline-flex items-center gap-4 border rounded-full border-gray-300 pl-8 pr-4 h-[28px]"
|
|
3209
|
-
},
|
|
3229
|
+
}, Xo = ["placeholder"], Pn = /* @__PURE__ */ ye({
|
|
3210
3230
|
__name: "TagFilterBar",
|
|
3211
3231
|
props: {
|
|
3212
3232
|
tags: {},
|
|
@@ -3215,67 +3235,67 @@ const Go = { class: "flex flex-wrap items-center gap-8" }, Ho = {
|
|
|
3215
3235
|
},
|
|
3216
3236
|
emits: ["update:modelValue", "tag-created"],
|
|
3217
3237
|
setup(e, { emit: t }) {
|
|
3218
|
-
const { t: n } =
|
|
3238
|
+
const { t: n } = ve({ messages: ke }), a = e, r = t;
|
|
3219
3239
|
function o(u) {
|
|
3220
3240
|
r("update:modelValue", a.modelValue.includes(u) ? a.modelValue.filter((f) => f !== u) : [...a.modelValue, u]);
|
|
3221
3241
|
}
|
|
3222
|
-
const s =
|
|
3242
|
+
const s = N("");
|
|
3223
3243
|
function i() {
|
|
3224
3244
|
const u = s.value.trim();
|
|
3225
3245
|
s.value = "", u && (a.modelValue.includes(u) || r("update:modelValue", [...a.modelValue, u]), a.tags.includes(u) || r("tag-created", u));
|
|
3226
3246
|
}
|
|
3227
3247
|
return (u, f) => {
|
|
3228
3248
|
const c = M("FmChip"), d = M("FmIcon");
|
|
3229
|
-
return
|
|
3230
|
-
e.mode === "filter" ? (
|
|
3249
|
+
return S(), C("div", Wo, [
|
|
3250
|
+
e.mode === "filter" ? (S(), ne(c, {
|
|
3231
3251
|
key: 0,
|
|
3232
|
-
label:
|
|
3252
|
+
label: T(n)("mediaPicker.tagFilterBar.all"),
|
|
3233
3253
|
selected: e.modelValue.length === 0,
|
|
3234
3254
|
selectable: "",
|
|
3235
3255
|
onClick: f[0] || (f[0] = (b) => r("update:modelValue", []))
|
|
3236
|
-
}, null, 8, ["label", "selected"])) :
|
|
3237
|
-
(
|
|
3256
|
+
}, null, 8, ["label", "selected"])) : V("", !0),
|
|
3257
|
+
(S(!0), C(Z, null, be(e.tags, (b) => (S(), ne(c, {
|
|
3238
3258
|
key: b,
|
|
3239
3259
|
label: b,
|
|
3240
3260
|
selected: e.modelValue.includes(b),
|
|
3241
3261
|
selectable: "",
|
|
3242
|
-
onClick: (
|
|
3262
|
+
onClick: (_) => o(b)
|
|
3243
3263
|
}, null, 8, ["label", "selected", "onClick"]))), 128)),
|
|
3244
|
-
e.mode === "assign" ? (
|
|
3245
|
-
|
|
3264
|
+
e.mode === "assign" ? (S(), C("div", Ko, [
|
|
3265
|
+
Tn(h("input", {
|
|
3246
3266
|
"onUpdate:modelValue": f[1] || (f[1] = (b) => s.value = b),
|
|
3247
|
-
placeholder:
|
|
3267
|
+
placeholder: T(n)("mediaPicker.tagFilterBar.newTagPlaceholder"),
|
|
3248
3268
|
class: "text-xs outline-none w-[88px]",
|
|
3249
|
-
onKeyup:
|
|
3250
|
-
}, null, 40,
|
|
3251
|
-
[
|
|
3269
|
+
onKeyup: On(i, ["enter"])
|
|
3270
|
+
}, null, 40, Xo), [
|
|
3271
|
+
[Cn, s.value]
|
|
3252
3272
|
]),
|
|
3253
3273
|
h("button", {
|
|
3254
3274
|
class: "p-2",
|
|
3255
3275
|
onClick: i
|
|
3256
3276
|
}, [
|
|
3257
|
-
|
|
3277
|
+
F(d, {
|
|
3258
3278
|
name: "add",
|
|
3259
3279
|
size: "sm"
|
|
3260
3280
|
})
|
|
3261
3281
|
])
|
|
3262
|
-
])) :
|
|
3282
|
+
])) : V("", !0)
|
|
3263
3283
|
]);
|
|
3264
3284
|
};
|
|
3265
3285
|
}
|
|
3266
|
-
}),
|
|
3286
|
+
}), Zo = { class: "space-y-16" }, Qo = {
|
|
3267
3287
|
key: 0,
|
|
3268
3288
|
class: "space-y-8"
|
|
3269
|
-
},
|
|
3289
|
+
}, Yo = { class: "text-xs font-semibold text-gray-500" }, es = ["src"], ts = { class: "flex-1 min-w-0 flex flex-col gap-2" }, ns = { class: "text-xs font-semibold truncate" }, as = {
|
|
3270
3290
|
key: 0,
|
|
3271
3291
|
class: "text-[11px] text-red-600"
|
|
3272
|
-
},
|
|
3292
|
+
}, rs = {
|
|
3273
3293
|
key: 1,
|
|
3274
3294
|
class: "text-[11px] text-gray-500"
|
|
3275
|
-
},
|
|
3295
|
+
}, os = ["onClick"], ss = { class: "space-y-8" }, is = { class: "text-xs font-semibold text-gray-500" }, ls = {
|
|
3276
3296
|
key: 0,
|
|
3277
3297
|
class: "flex flex-wrap items-center gap-8"
|
|
3278
|
-
},
|
|
3298
|
+
}, us = { class: "text-[11px] text-gray-400" }, cs = ["onClick"], En = /* @__PURE__ */ ye({
|
|
3279
3299
|
__name: "UploadPanel",
|
|
3280
3300
|
props: {
|
|
3281
3301
|
businessId: {},
|
|
@@ -3284,137 +3304,137 @@ const Go = { class: "flex flex-wrap items-center gap-8" }, Ho = {
|
|
|
3284
3304
|
},
|
|
3285
3305
|
emits: ["tag-created", "uploaded"],
|
|
3286
3306
|
setup(e, { expose: t, emit: n }) {
|
|
3287
|
-
const { t: a } =
|
|
3307
|
+
const { t: a } = ve({ messages: ke }), r = e, o = n, s = N([]), i = N([]), u = N([]), f = N(!1), c = ae(() => s.value.length), d = ae(() => r.availableTags.filter((m) => !i.value.includes(m)).slice(0, 6));
|
|
3288
3308
|
function b() {
|
|
3289
3309
|
s.value.forEach((m) => URL.revokeObjectURL(m.previewUrl)), s.value = [], i.value = [], u.value = [];
|
|
3290
3310
|
}
|
|
3291
|
-
async function
|
|
3292
|
-
const
|
|
3311
|
+
async function _(m) {
|
|
3312
|
+
const P = URL.createObjectURL(m), x = {
|
|
3293
3313
|
id: crypto.randomUUID(),
|
|
3294
3314
|
refId: crypto.randomUUID(),
|
|
3295
3315
|
file: m,
|
|
3296
|
-
previewUrl:
|
|
3316
|
+
previewUrl: P,
|
|
3297
3317
|
dimensions: null,
|
|
3298
3318
|
error: null
|
|
3299
3319
|
};
|
|
3300
|
-
s.value.push(
|
|
3320
|
+
s.value.push(x), x.dimensions = await Wt(P);
|
|
3301
3321
|
}
|
|
3302
|
-
function
|
|
3303
|
-
const
|
|
3304
|
-
|
|
3322
|
+
function w(m) {
|
|
3323
|
+
const P = s.value.find((x) => x.id === m);
|
|
3324
|
+
P && URL.revokeObjectURL(P.previewUrl), s.value = s.value.filter((x) => x.id !== m);
|
|
3305
3325
|
}
|
|
3306
3326
|
function v(m) {
|
|
3307
3327
|
return m >= 1024 * 1024 ? `${(m / 1024 / 1024).toFixed(1)} MB` : `${Math.round(m / 1024)} KB`;
|
|
3308
3328
|
}
|
|
3309
|
-
async function
|
|
3310
|
-
const
|
|
3329
|
+
async function y(m) {
|
|
3330
|
+
const P = m.dimensions ?? await Wt(m.previewUrl), x = m.file.type || "image/jpeg", k = await Xr(r.businessId, {
|
|
3311
3331
|
refType: gt,
|
|
3312
3332
|
refId: m.refId,
|
|
3313
3333
|
imageId: "main",
|
|
3314
|
-
contentType:
|
|
3334
|
+
contentType: x,
|
|
3315
3335
|
fileSize: m.file.size
|
|
3316
|
-
}),
|
|
3317
|
-
if (!
|
|
3318
|
-
throw new Error(a("mediaPicker.uploadPanel.uploadFailedError", { status:
|
|
3319
|
-
const A = await
|
|
3336
|
+
}), g = await fetch(k.uploadUrl, { method: "PUT", headers: { "Content-Type": x }, body: m.file });
|
|
3337
|
+
if (!g.ok)
|
|
3338
|
+
throw new Error(a("mediaPicker.uploadPanel.uploadFailedError", { status: g.status }));
|
|
3339
|
+
const A = await Zr(r.businessId, {
|
|
3320
3340
|
refType: gt,
|
|
3321
3341
|
refId: m.refId,
|
|
3322
3342
|
imageId: "main",
|
|
3323
3343
|
restaurantId: r.restaurantId,
|
|
3324
3344
|
fileName: m.file.name,
|
|
3325
|
-
width:
|
|
3326
|
-
height:
|
|
3345
|
+
width: P.width,
|
|
3346
|
+
height: P.height,
|
|
3327
3347
|
aspectRatios: u.value
|
|
3328
3348
|
});
|
|
3329
|
-
return i.value.length ? await
|
|
3349
|
+
return i.value.length ? await Gr(r.businessId, A.asset.id, i.value) : A.asset;
|
|
3330
3350
|
}
|
|
3331
3351
|
async function p() {
|
|
3332
3352
|
if (!(!s.value.length || !r.businessId)) {
|
|
3333
3353
|
f.value = !0;
|
|
3334
3354
|
try {
|
|
3335
|
-
const m = s.value,
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
}), s.value = m.filter((
|
|
3355
|
+
const m = s.value, P = await Promise.allSettled(m.map(y)), x = /* @__PURE__ */ new Set(), k = [];
|
|
3356
|
+
P.forEach((g, A) => {
|
|
3357
|
+
g.status === "rejected" ? (x.add(m[A].id), m[A].error = g.reason instanceof Error ? g.reason.message : String(g.reason)) : k.push(g.value);
|
|
3358
|
+
}), s.value = m.filter((g) => x.has(g.id)), k.length > 0 && o("uploaded", k);
|
|
3339
3359
|
} finally {
|
|
3340
3360
|
f.value = !1;
|
|
3341
3361
|
}
|
|
3342
3362
|
}
|
|
3343
3363
|
}
|
|
3344
|
-
return t({ stagedCount: c, uploading: f, upload: p, reset: b }), (m,
|
|
3345
|
-
const
|
|
3346
|
-
return
|
|
3347
|
-
|
|
3348
|
-
label:
|
|
3364
|
+
return t({ stagedCount: c, uploading: f, upload: p, reset: b }), (m, P) => {
|
|
3365
|
+
const x = M("FmDropField"), k = M("FmIcon");
|
|
3366
|
+
return S(), C("div", Zo, [
|
|
3367
|
+
F(x, {
|
|
3368
|
+
label: T(a)("mediaPicker.uploadPanel.dropLabel"),
|
|
3349
3369
|
accept: "image/jpeg,image/png,image/webp",
|
|
3350
3370
|
"max-file-size": 10 * 1024 * 1024,
|
|
3351
|
-
onFileUpload:
|
|
3371
|
+
onFileUpload: _
|
|
3352
3372
|
}, {
|
|
3353
|
-
"helper-text":
|
|
3354
|
-
|
|
3373
|
+
"helper-text": le(() => [
|
|
3374
|
+
ge(E(T(a)("mediaPicker.uploadPanel.helperText")), 1)
|
|
3355
3375
|
]),
|
|
3356
3376
|
_: 1
|
|
3357
3377
|
}, 8, ["label"]),
|
|
3358
|
-
|
|
3378
|
+
F(Jo, {
|
|
3359
3379
|
modelValue: u.value,
|
|
3360
|
-
"onUpdate:modelValue":
|
|
3380
|
+
"onUpdate:modelValue": P[0] || (P[0] = (g) => u.value = g),
|
|
3361
3381
|
disabled: f.value
|
|
3362
3382
|
}, null, 8, ["modelValue", "disabled"]),
|
|
3363
|
-
s.value.length ? (
|
|
3364
|
-
h("div",
|
|
3365
|
-
(
|
|
3366
|
-
key:
|
|
3367
|
-
class:
|
|
3383
|
+
s.value.length ? (S(), C("div", Qo, [
|
|
3384
|
+
h("div", Yo, E(T(a)("mediaPicker.uploadPanel.stagedCount", { count: s.value.length })), 1),
|
|
3385
|
+
(S(!0), C(Z, null, be(s.value, (g) => (S(), C("div", {
|
|
3386
|
+
key: g.id,
|
|
3387
|
+
class: te(["flex items-center gap-12 p-8 border rounded-lg", g.error ? "border-red-300 bg-red-50" : "border-fm-color-neutral-gray-200"])
|
|
3368
3388
|
}, [
|
|
3369
3389
|
h("img", {
|
|
3370
|
-
src:
|
|
3390
|
+
src: g.previewUrl,
|
|
3371
3391
|
class: "w-[44px] h-[44px] rounded flex-shrink-0 object-cover"
|
|
3372
|
-
}, null, 8,
|
|
3373
|
-
h("div",
|
|
3374
|
-
h("span",
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
], 64)) :
|
|
3379
|
-
|
|
3392
|
+
}, null, 8, es),
|
|
3393
|
+
h("div", ts, [
|
|
3394
|
+
h("span", ns, E(g.file.name), 1),
|
|
3395
|
+
g.error ? (S(), C("span", as, E(g.error), 1)) : (S(), C("span", rs, [
|
|
3396
|
+
g.dimensions ? (S(), C(Z, { key: 0 }, [
|
|
3397
|
+
ge(E(g.dimensions.width) + "×" + E(g.dimensions.height) + " · ", 1)
|
|
3398
|
+
], 64)) : V("", !0),
|
|
3399
|
+
ge(E(v(g.file.size)), 1)
|
|
3380
3400
|
]))
|
|
3381
3401
|
]),
|
|
3382
3402
|
h("button", {
|
|
3383
3403
|
class: "w-[28px] h-[28px] rounded flex-shrink-0 flex items-center justify-center text-gray-500 hover:bg-red-50 hover:text-red-600",
|
|
3384
|
-
onClick: (A) =>
|
|
3404
|
+
onClick: (A) => w(g.id)
|
|
3385
3405
|
}, [
|
|
3386
|
-
|
|
3406
|
+
F(k, {
|
|
3387
3407
|
name: "close",
|
|
3388
3408
|
size: "sm"
|
|
3389
3409
|
})
|
|
3390
|
-
], 8,
|
|
3410
|
+
], 8, os)
|
|
3391
3411
|
], 2))), 128))
|
|
3392
|
-
])) :
|
|
3393
|
-
h("div",
|
|
3394
|
-
h("div",
|
|
3395
|
-
|
|
3412
|
+
])) : V("", !0),
|
|
3413
|
+
h("div", ss, [
|
|
3414
|
+
h("div", is, E(T(a)("mediaPicker.uploadPanel.tagsLabel")), 1),
|
|
3415
|
+
F(Pn, {
|
|
3396
3416
|
modelValue: i.value,
|
|
3397
|
-
"onUpdate:modelValue":
|
|
3417
|
+
"onUpdate:modelValue": P[1] || (P[1] = (g) => i.value = g),
|
|
3398
3418
|
tags: e.availableTags,
|
|
3399
3419
|
mode: "assign",
|
|
3400
|
-
onTagCreated:
|
|
3420
|
+
onTagCreated: P[2] || (P[2] = (g) => o("tag-created", g))
|
|
3401
3421
|
}, null, 8, ["modelValue", "tags"]),
|
|
3402
|
-
d.value.length ? (
|
|
3403
|
-
h("span",
|
|
3404
|
-
(
|
|
3405
|
-
key:
|
|
3422
|
+
d.value.length ? (S(), C("div", ls, [
|
|
3423
|
+
h("span", us, E(T(a)("mediaPicker.uploadPanel.suggestedTagsLabel")), 1),
|
|
3424
|
+
(S(!0), C(Z, null, be(d.value, (g) => (S(), C("button", {
|
|
3425
|
+
key: g,
|
|
3406
3426
|
class: "h-[26px] px-12 rounded-full border border-dashed border-fm-color-neutral-gray-300 text-[11px] font-semibold text-gray-500",
|
|
3407
|
-
onClick: (A) => i.value.push(
|
|
3408
|
-
}, " + " +
|
|
3409
|
-
])) :
|
|
3427
|
+
onClick: (A) => i.value.push(g)
|
|
3428
|
+
}, " + " + E(g), 9, cs))), 128))
|
|
3429
|
+
])) : V("", !0)
|
|
3410
3430
|
])
|
|
3411
3431
|
]);
|
|
3412
3432
|
};
|
|
3413
3433
|
}
|
|
3414
|
-
}),
|
|
3434
|
+
}), ds = { class: "w-full flex items-center justify-between gap-16 pr-8" }, fs = { class: "text-xs font-normal text-fm-color-typo-secondary" }, ps = { class: "flex gap-16 border-b border-fm-color-neutral-gray-200 mb-12" }, ms = { class: "flex items-center justify-between w-full" }, gs = {
|
|
3415
3435
|
key: 0,
|
|
3416
3436
|
class: "text-xs text-fm-color-typo-secondary"
|
|
3417
|
-
},
|
|
3437
|
+
}, hs = { key: 1 }, bs = { class: "flex gap-8" }, ys = /* @__PURE__ */ ye({
|
|
3418
3438
|
__name: "MediaPickerModal",
|
|
3419
3439
|
props: {
|
|
3420
3440
|
open: { type: Boolean },
|
|
@@ -3424,12 +3444,12 @@ const Go = { class: "flex flex-wrap items-center gap-8" }, Ho = {
|
|
|
3424
3444
|
},
|
|
3425
3445
|
emits: ["update:open", "select", "confirm"],
|
|
3426
3446
|
setup(e, { emit: t }) {
|
|
3427
|
-
const { t: n } =
|
|
3428
|
-
async function
|
|
3447
|
+
const { t: n } = ve({ messages: ke }), a = e, r = t, o = N("browse"), s = N(""), i = N(null), u = N([]), f = N([]), c = N(0), d = N([]), b = N(!1);
|
|
3448
|
+
async function _() {
|
|
3429
3449
|
if (a.businessId) {
|
|
3430
3450
|
b.value = !0;
|
|
3431
3451
|
try {
|
|
3432
|
-
const
|
|
3452
|
+
const g = await rt({
|
|
3433
3453
|
businessId: a.businessId,
|
|
3434
3454
|
restaurantId: a.restaurantId,
|
|
3435
3455
|
search: s.value || void 0,
|
|
@@ -3438,212 +3458,215 @@ const Go = { class: "flex flex-wrap items-center gap-8" }, Ho = {
|
|
|
3438
3458
|
sortBy: "createdAt",
|
|
3439
3459
|
descending: !0
|
|
3440
3460
|
});
|
|
3441
|
-
u.value =
|
|
3461
|
+
u.value = g.resources;
|
|
3442
3462
|
} finally {
|
|
3443
3463
|
b.value = !1;
|
|
3444
3464
|
}
|
|
3445
3465
|
}
|
|
3446
3466
|
}
|
|
3447
|
-
async function
|
|
3467
|
+
async function w() {
|
|
3448
3468
|
if (!a.businessId)
|
|
3449
3469
|
return;
|
|
3450
|
-
const [
|
|
3451
|
-
f.value =
|
|
3470
|
+
const [g, A] = await Promise.all([qr(a.businessId), kn(a.businessId)]);
|
|
3471
|
+
f.value = g.tags, c.value = g.total, d.value = A;
|
|
3452
3472
|
}
|
|
3453
|
-
|
|
3473
|
+
he(
|
|
3454
3474
|
() => a.open,
|
|
3455
|
-
(
|
|
3475
|
+
(g) => {
|
|
3456
3476
|
var A;
|
|
3457
|
-
|
|
3477
|
+
g && (o.value = "browse", s.value = "", i.value = null, y.value = /* @__PURE__ */ new Set(), (A = x.value) == null || A.reset(), w(), _());
|
|
3458
3478
|
}
|
|
3459
|
-
),
|
|
3479
|
+
), he(i, _);
|
|
3460
3480
|
let v;
|
|
3461
|
-
|
|
3462
|
-
clearTimeout(v), v = setTimeout(
|
|
3481
|
+
he(s, () => {
|
|
3482
|
+
clearTimeout(v), v = setTimeout(_, 250);
|
|
3463
3483
|
});
|
|
3464
|
-
const
|
|
3465
|
-
function p(
|
|
3466
|
-
const A = new Set(
|
|
3467
|
-
A.has(
|
|
3484
|
+
const y = N(/* @__PURE__ */ new Set());
|
|
3485
|
+
function p(g) {
|
|
3486
|
+
const A = new Set(y.value);
|
|
3487
|
+
A.has(g.id) ? A.delete(g.id) : A.add(g.id), y.value = A;
|
|
3468
3488
|
}
|
|
3469
|
-
function m(
|
|
3489
|
+
function m(g) {
|
|
3470
3490
|
if (a.selectionMode === "single") {
|
|
3471
|
-
r("select",
|
|
3491
|
+
r("select", g), r("update:open", !1);
|
|
3472
3492
|
return;
|
|
3473
3493
|
}
|
|
3474
|
-
p(
|
|
3494
|
+
p(g);
|
|
3475
3495
|
}
|
|
3476
|
-
function
|
|
3477
|
-
const
|
|
3478
|
-
r("confirm",
|
|
3496
|
+
function P() {
|
|
3497
|
+
const g = u.value.filter((A) => y.value.has(A.id));
|
|
3498
|
+
r("confirm", g), r("update:open", !1);
|
|
3479
3499
|
}
|
|
3480
|
-
const
|
|
3481
|
-
async function
|
|
3482
|
-
var
|
|
3483
|
-
(
|
|
3500
|
+
const x = N(null);
|
|
3501
|
+
async function k() {
|
|
3502
|
+
var g;
|
|
3503
|
+
(g = x.value) != null && g.stagedCount || (o.value = "browse"), await Promise.all([_(), w()]);
|
|
3484
3504
|
}
|
|
3485
|
-
return (
|
|
3486
|
-
const
|
|
3487
|
-
return
|
|
3505
|
+
return (g, A) => {
|
|
3506
|
+
const Y = M("FmSearch"), W = M("FmButton"), G = M("FmDialog");
|
|
3507
|
+
return S(), ne(G, {
|
|
3488
3508
|
"model-value": e.open,
|
|
3489
3509
|
"max-width": 900,
|
|
3490
3510
|
"onUpdate:modelValue": A[7] || (A[7] = (j) => !j && r("update:open", !1))
|
|
3491
3511
|
}, {
|
|
3492
|
-
"dialog-header":
|
|
3493
|
-
h("div",
|
|
3512
|
+
"dialog-header": le(() => [
|
|
3513
|
+
h("div", ds, [
|
|
3494
3514
|
h("div", null, [
|
|
3495
|
-
h("div", null,
|
|
3496
|
-
h("div",
|
|
3515
|
+
h("div", null, E(T(n)("mediaPicker.pickerModal.title")), 1),
|
|
3516
|
+
h("div", fs, E(e.selectionMode === "multiple" ? T(n)("mediaPicker.pickerModal.subtitleMultiple") : T(n)("mediaPicker.pickerModal.subtitleSingle")), 1)
|
|
3497
3517
|
]),
|
|
3498
|
-
o.value === "browse" ? (
|
|
3518
|
+
o.value === "browse" ? (S(), ne(Y, {
|
|
3499
3519
|
key: 0,
|
|
3500
3520
|
modelValue: s.value,
|
|
3501
3521
|
"onUpdate:modelValue": A[0] || (A[0] = (j) => s.value = j),
|
|
3502
|
-
placeholder:
|
|
3522
|
+
placeholder: T(n)("mediaPicker.pickerModal.searchPlaceholder"),
|
|
3503
3523
|
class: "w-[200px] shrink-0"
|
|
3504
|
-
}, null, 8, ["modelValue", "placeholder"])) :
|
|
3524
|
+
}, null, 8, ["modelValue", "placeholder"])) : V("", !0)
|
|
3505
3525
|
])
|
|
3506
3526
|
]),
|
|
3507
|
-
"dialog-footer":
|
|
3508
|
-
var j,
|
|
3527
|
+
"dialog-footer": le(() => {
|
|
3528
|
+
var j, z;
|
|
3509
3529
|
return [
|
|
3510
|
-
h("div",
|
|
3511
|
-
o.value === "browse" && e.selectionMode === "multiple" ? (
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
], 64)) : (
|
|
3515
|
-
|
|
3530
|
+
h("div", ms, [
|
|
3531
|
+
o.value === "browse" && e.selectionMode === "multiple" ? (S(), C("span", gs, [
|
|
3532
|
+
y.value.size ? (S(), C(Z, { key: 0 }, [
|
|
3533
|
+
ge(E(T(n)("mediaPicker.pickerModal.selectedCount", { count: y.value.size })), 1)
|
|
3534
|
+
], 64)) : (S(), C(Z, { key: 1 }, [
|
|
3535
|
+
ge(E(T(n)("mediaPicker.pickerModal.selectPrompt")), 1)
|
|
3516
3536
|
], 64))
|
|
3517
|
-
])) : (
|
|
3518
|
-
h("div",
|
|
3519
|
-
|
|
3520
|
-
label:
|
|
3537
|
+
])) : (S(), C("span", hs)),
|
|
3538
|
+
h("div", bs, [
|
|
3539
|
+
F(W, {
|
|
3540
|
+
label: T(n)("mediaPicker.pickerModal.cancelButton"),
|
|
3521
3541
|
variant: "tertiary",
|
|
3522
|
-
onClick: A[5] || (A[5] = (
|
|
3542
|
+
onClick: A[5] || (A[5] = (ue) => r("update:open", !1))
|
|
3523
3543
|
}, null, 8, ["label"]),
|
|
3524
|
-
o.value === "upload" ? (
|
|
3544
|
+
o.value === "upload" ? (S(), ne(W, {
|
|
3525
3545
|
key: 0,
|
|
3526
|
-
label:
|
|
3546
|
+
label: T(n)("mediaPicker.pickerModal.uploadSubmitButton", { count: ((j = x.value) == null ? void 0 : j.stagedCount) ?? 0 }),
|
|
3527
3547
|
variant: "primary",
|
|
3528
|
-
disabled: !((
|
|
3529
|
-
onClick: A[6] || (A[6] = (
|
|
3530
|
-
var
|
|
3531
|
-
return (
|
|
3548
|
+
disabled: !((z = x.value) != null && z.stagedCount) || x.value.uploading,
|
|
3549
|
+
onClick: A[6] || (A[6] = (ue) => {
|
|
3550
|
+
var $;
|
|
3551
|
+
return ($ = x.value) == null ? void 0 : $.upload();
|
|
3532
3552
|
})
|
|
3533
|
-
}, null, 8, ["label", "disabled"])) : e.selectionMode === "multiple" ? (
|
|
3553
|
+
}, null, 8, ["label", "disabled"])) : e.selectionMode === "multiple" ? (S(), ne(W, {
|
|
3534
3554
|
key: 1,
|
|
3535
|
-
label:
|
|
3555
|
+
label: T(n)("mediaPicker.pickerModal.confirmButton"),
|
|
3536
3556
|
variant: "primary",
|
|
3537
|
-
disabled:
|
|
3538
|
-
onClick:
|
|
3539
|
-
}, null, 8, ["label", "disabled"])) :
|
|
3557
|
+
disabled: y.value.size === 0,
|
|
3558
|
+
onClick: P
|
|
3559
|
+
}, null, 8, ["label", "disabled"])) : V("", !0)
|
|
3540
3560
|
])
|
|
3541
3561
|
])
|
|
3542
3562
|
];
|
|
3543
3563
|
}),
|
|
3544
|
-
default:
|
|
3545
|
-
h("div",
|
|
3564
|
+
default: le(() => [
|
|
3565
|
+
h("div", ps, [
|
|
3546
3566
|
h("button", {
|
|
3547
|
-
class:
|
|
3567
|
+
class: te(["pb-8 px-4 text-sm", o.value === "browse" ? "font-semibold border-b-2 border-[--fm-color-brand-primary,#FF7823]" : "text-gray-500"]),
|
|
3548
3568
|
onClick: A[1] || (A[1] = (j) => o.value = "browse")
|
|
3549
|
-
},
|
|
3569
|
+
}, E(T(n)("mediaPicker.pickerModal.browseTab")), 3),
|
|
3550
3570
|
h("button", {
|
|
3551
|
-
class:
|
|
3571
|
+
class: te(["pb-8 px-4 text-sm", o.value === "upload" ? "font-semibold border-b-2 border-[--fm-color-brand-primary,#FF7823]" : "text-gray-500"]),
|
|
3552
3572
|
onClick: A[2] || (A[2] = (j) => o.value = "upload")
|
|
3553
|
-
},
|
|
3573
|
+
}, E(T(n)("mediaPicker.pickerModal.uploadTab")), 3)
|
|
3554
3574
|
]),
|
|
3555
|
-
o.value === "browse" ? (
|
|
3556
|
-
f.value.length ? (
|
|
3575
|
+
o.value === "browse" ? (S(), C(Z, { key: 0 }, [
|
|
3576
|
+
f.value.length ? (S(), ne(zo, {
|
|
3557
3577
|
key: 0,
|
|
3558
3578
|
modelValue: i.value,
|
|
3559
3579
|
"onUpdate:modelValue": A[3] || (A[3] = (j) => i.value = j),
|
|
3560
3580
|
tags: f.value,
|
|
3561
3581
|
total: c.value,
|
|
3562
3582
|
class: "mb-12"
|
|
3563
|
-
}, null, 8, ["modelValue", "tags", "total"])) :
|
|
3564
|
-
|
|
3583
|
+
}, null, 8, ["modelValue", "tags", "total"])) : V("", !0),
|
|
3584
|
+
F(Sn, {
|
|
3565
3585
|
assets: u.value,
|
|
3566
3586
|
loading: b.value,
|
|
3567
3587
|
selectable: e.selectionMode === "multiple",
|
|
3568
|
-
"selected-ids":
|
|
3588
|
+
"selected-ids": y.value,
|
|
3569
3589
|
onOpen: m,
|
|
3570
3590
|
onToggle: p
|
|
3571
3591
|
}, null, 8, ["assets", "loading", "selectable", "selected-ids"])
|
|
3572
|
-
], 64)) : (
|
|
3592
|
+
], 64)) : (S(), ne(En, {
|
|
3573
3593
|
key: 1,
|
|
3574
3594
|
ref_key: "uploadPanelRef",
|
|
3575
|
-
ref:
|
|
3595
|
+
ref: x,
|
|
3576
3596
|
"business-id": e.businessId,
|
|
3577
3597
|
"restaurant-id": e.restaurantId,
|
|
3578
3598
|
"available-tags": d.value,
|
|
3579
3599
|
onTagCreated: A[4] || (A[4] = (j) => d.value.push(j)),
|
|
3580
|
-
onUploaded:
|
|
3600
|
+
onUploaded: k
|
|
3581
3601
|
}, null, 8, ["business-id", "restaurant-id", "available-tags"]))
|
|
3582
3602
|
]),
|
|
3583
3603
|
_: 1
|
|
3584
3604
|
}, 8, ["model-value"]);
|
|
3585
3605
|
};
|
|
3586
3606
|
}
|
|
3587
|
-
}),
|
|
3607
|
+
}), vs = { class: "relative flex-1 min-w-0 bg-gray-900 flex items-center justify-center overflow-hidden" }, ws = ["src", "alt"], xs = {
|
|
3588
3608
|
key: 1,
|
|
3589
3609
|
class: "flex flex-col items-center gap-12 text-center px-24"
|
|
3590
|
-
},
|
|
3610
|
+
}, ks = { class: "text-sm text-white" }, Ss = { class: "absolute top-8 left-8 bg-black/70 text-white text-[11px] font-semibold px-8 py-[2px] rounded" }, Ps = { class: "absolute bottom-12 left-1/2 -translate-x-1/2 flex items-center gap-8" }, Es = ["onClick"], Rs = /* @__PURE__ */ ye({
|
|
3591
3611
|
__name: "VariantCarousel",
|
|
3592
|
-
props: {
|
|
3612
|
+
props: /* @__PURE__ */ _t({
|
|
3593
3613
|
original: {},
|
|
3594
3614
|
variants: {},
|
|
3595
3615
|
alt: {}
|
|
3596
|
-
},
|
|
3597
|
-
|
|
3616
|
+
}, {
|
|
3617
|
+
index: { default: 0 },
|
|
3618
|
+
indexModifiers: {}
|
|
3619
|
+
}),
|
|
3620
|
+
emits: /* @__PURE__ */ _t(["regenerate"], ["update:index"]),
|
|
3598
3621
|
setup(e, { emit: t }) {
|
|
3599
|
-
const { t: n } =
|
|
3600
|
-
|
|
3601
|
-
|
|
3622
|
+
const { t: n } = ve({ messages: ke }), a = e, r = t, o = An(e, "index"), s = ae(() => xn(a.original, a.variants));
|
|
3623
|
+
he(s, (c) => {
|
|
3624
|
+
o.value > c.length - 1 && (o.value = c.length - 1);
|
|
3602
3625
|
});
|
|
3603
|
-
const i =
|
|
3626
|
+
const i = ae(() => s.value[o.value]);
|
|
3604
3627
|
function u(c) {
|
|
3605
|
-
const d =
|
|
3606
|
-
|
|
3628
|
+
const d = s.value.length;
|
|
3629
|
+
o.value = (o.value + c + d) % d;
|
|
3607
3630
|
}
|
|
3608
3631
|
function f(c) {
|
|
3609
3632
|
return c ? c.replace("x", ":") : "";
|
|
3610
3633
|
}
|
|
3611
3634
|
return (c, d) => {
|
|
3612
|
-
var b,
|
|
3613
|
-
const
|
|
3614
|
-
return
|
|
3615
|
-
(b = i.value) != null && b.url ? (
|
|
3635
|
+
var b, _, w, v;
|
|
3636
|
+
const y = M("FmIcon"), p = M("FmButton");
|
|
3637
|
+
return S(), C("div", vs, [
|
|
3638
|
+
(b = i.value) != null && b.url ? (S(), C("img", {
|
|
3616
3639
|
key: 0,
|
|
3617
3640
|
src: i.value.url,
|
|
3618
3641
|
alt: e.alt,
|
|
3619
3642
|
class: "max-w-full max-h-full object-contain"
|
|
3620
|
-
}, null, 8,
|
|
3621
|
-
|
|
3643
|
+
}, null, 8, ws)) : i.value ? (S(), C("div", xs, [
|
|
3644
|
+
F(y, {
|
|
3622
3645
|
name: "error",
|
|
3623
3646
|
size: "lg",
|
|
3624
3647
|
color: "white"
|
|
3625
3648
|
}),
|
|
3626
|
-
h("span",
|
|
3627
|
-
|
|
3628
|
-
label:
|
|
3649
|
+
h("span", ks, E(T(n)("mediaPicker.variants.failed")), 1),
|
|
3650
|
+
F(p, {
|
|
3651
|
+
label: T(n)("mediaPicker.variants.regenerate"),
|
|
3629
3652
|
variant: "secondary",
|
|
3630
3653
|
size: "md",
|
|
3631
3654
|
"prepend-icon": "refresh",
|
|
3632
3655
|
onClick: d[0] || (d[0] = (m) => i.value.ratio && r("regenerate", i.value.ratio))
|
|
3633
3656
|
}, null, 8, ["label"])
|
|
3634
|
-
])) :
|
|
3635
|
-
h("span",
|
|
3636
|
-
|
|
3637
|
-
((v = i.value) == null ? void 0 : v.status) === "pending" ? (
|
|
3638
|
-
|
|
3639
|
-
], 64)) :
|
|
3657
|
+
])) : V("", !0),
|
|
3658
|
+
h("span", Ss, [
|
|
3659
|
+
ge(E(((_ = i.value) == null ? void 0 : _.kind) === "original" ? T(n)("mediaPicker.variants.original") : f(((w = i.value) == null ? void 0 : w.ratio) ?? null)) + " ", 1),
|
|
3660
|
+
((v = i.value) == null ? void 0 : v.status) === "pending" ? (S(), C(Z, { key: 0 }, [
|
|
3661
|
+
ge(" · " + E(T(n)("mediaPicker.variants.generating")), 1)
|
|
3662
|
+
], 64)) : V("", !0)
|
|
3640
3663
|
]),
|
|
3641
|
-
|
|
3664
|
+
s.value.length > 1 ? (S(), C(Z, { key: 2 }, [
|
|
3642
3665
|
h("button", {
|
|
3643
3666
|
class: "absolute left-8 top-1/2 -translate-y-1/2 w-[32px] h-[32px] rounded-full bg-black/50 flex items-center justify-center",
|
|
3644
3667
|
onClick: d[1] || (d[1] = (m) => u(-1))
|
|
3645
3668
|
}, [
|
|
3646
|
-
|
|
3669
|
+
F(y, {
|
|
3647
3670
|
name: "chevron_left",
|
|
3648
3671
|
size: "sm",
|
|
3649
3672
|
color: "white"
|
|
@@ -3653,36 +3676,36 @@ const Go = { class: "flex flex-wrap items-center gap-8" }, Ho = {
|
|
|
3653
3676
|
class: "absolute right-8 top-1/2 -translate-y-1/2 w-[32px] h-[32px] rounded-full bg-black/50 flex items-center justify-center",
|
|
3654
3677
|
onClick: d[2] || (d[2] = (m) => u(1))
|
|
3655
3678
|
}, [
|
|
3656
|
-
|
|
3679
|
+
F(y, {
|
|
3657
3680
|
name: "chevron_right",
|
|
3658
3681
|
size: "sm",
|
|
3659
3682
|
color: "white"
|
|
3660
3683
|
})
|
|
3661
3684
|
]),
|
|
3662
|
-
h("div",
|
|
3663
|
-
(
|
|
3685
|
+
h("div", Ps, [
|
|
3686
|
+
(S(!0), C(Z, null, be(s.value, (m, P) => (S(), C("button", {
|
|
3664
3687
|
key: m.key,
|
|
3665
|
-
class:
|
|
3666
|
-
onClick: (
|
|
3667
|
-
}, null, 10,
|
|
3688
|
+
class: te(["w-[8px] h-[8px] rounded-full", P === o.value ? "bg-white" : "bg-white/40"]),
|
|
3689
|
+
onClick: (x) => o.value = P
|
|
3690
|
+
}, null, 10, Es))), 128))
|
|
3668
3691
|
])
|
|
3669
|
-
], 64)) :
|
|
3692
|
+
], 64)) : V("", !0)
|
|
3670
3693
|
]);
|
|
3671
3694
|
};
|
|
3672
3695
|
}
|
|
3673
|
-
}),
|
|
3696
|
+
}), Ts = {
|
|
3674
3697
|
key: 0,
|
|
3675
3698
|
class: "flex h-[620px]"
|
|
3676
|
-
},
|
|
3699
|
+
}, Os = { class: "w-[320px] flex-shrink-0 flex flex-col gap-12 p-16 overflow-y-auto" }, Cs = { class: "flex items-center justify-between" }, _s = { class: "fm-typo-en-title-sm-600" }, As = {
|
|
3677
3700
|
key: 0,
|
|
3678
3701
|
class: "flex items-start gap-8"
|
|
3679
|
-
},
|
|
3702
|
+
}, Bs = { class: "flex-1 text-sm font-semibold break-all" }, Ds = {
|
|
3680
3703
|
key: 1,
|
|
3681
3704
|
class: "flex gap-8"
|
|
3682
|
-
},
|
|
3705
|
+
}, Fs = { class: "text-xs space-y-8 border-t pt-8" }, Ns = { class: "flex justify-between" }, Ls = { class: "text-gray-500" }, Us = { class: "font-semibold" }, js = { class: "flex justify-between" }, Is = { class: "text-gray-500" }, Ms = { class: "flex justify-between" }, zs = { class: "text-gray-500" }, Vs = { class: "flex justify-between" }, qs = { class: "text-gray-500" }, $s = {
|
|
3683
3706
|
key: 2,
|
|
3684
3707
|
class: "flex flex-wrap gap-4"
|
|
3685
|
-
},
|
|
3708
|
+
}, Gs = { class: "flex gap-8 border-t pt-12" }, Hs = /* @__PURE__ */ ye({
|
|
3686
3709
|
__name: "AssetDetailDialog",
|
|
3687
3710
|
props: {
|
|
3688
3711
|
asset: {},
|
|
@@ -3691,149 +3714,181 @@ const Go = { class: "flex flex-wrap items-center gap-8" }, Ho = {
|
|
|
3691
3714
|
},
|
|
3692
3715
|
emits: ["close", "renamed", "deleted", "changed"],
|
|
3693
3716
|
setup(e, { emit: t }) {
|
|
3694
|
-
const n =
|
|
3695
|
-
|
|
3717
|
+
const n = Xt(), { t: a } = ve({ messages: ke }), r = e, o = t, s = N(!1), i = N("");
|
|
3718
|
+
he(
|
|
3696
3719
|
() => r.asset,
|
|
3697
|
-
(
|
|
3698
|
-
s.value = !1, i.value = (
|
|
3720
|
+
(k) => {
|
|
3721
|
+
s.value = !1, i.value = (k == null ? void 0 : k.fileName) ?? "";
|
|
3699
3722
|
}
|
|
3700
3723
|
);
|
|
3701
3724
|
function u() {
|
|
3702
|
-
var
|
|
3703
|
-
i.value = ((
|
|
3725
|
+
var k;
|
|
3726
|
+
i.value = ((k = r.asset) == null ? void 0 : k.fileName) ?? "", s.value = !0;
|
|
3704
3727
|
}
|
|
3705
3728
|
async function f() {
|
|
3706
|
-
r.asset && (await
|
|
3729
|
+
r.asset && (await $r(r.businessId, r.asset.id, i.value), s.value = !1, o("renamed"));
|
|
3707
3730
|
}
|
|
3708
3731
|
function c() {
|
|
3709
3732
|
if (!r.asset)
|
|
3710
3733
|
return;
|
|
3711
|
-
const
|
|
3734
|
+
const k = r.asset;
|
|
3712
3735
|
n.open({
|
|
3713
3736
|
title: a("mediaPicker.assetDetailDialog.deleteDialogTitle"),
|
|
3714
3737
|
message: a("mediaPicker.assetDetailDialog.deleteDialogMessage", {
|
|
3715
|
-
fileName:
|
|
3738
|
+
fileName: k.fileName,
|
|
3716
3739
|
disclaimer: a("mediaPicker.assetDetailDialog.deleteDisclaimer")
|
|
3717
3740
|
}),
|
|
3718
3741
|
primaryActions: { text: a("mediaPicker.assetDetailDialog.deleteConfirmButton"), close: !1, variant: "destructive" },
|
|
3719
3742
|
secondaryActions: { text: a("mediaPicker.assetDetailDialog.cancelButton"), close: !0 }
|
|
3720
3743
|
}).onPrimary(async () => {
|
|
3721
|
-
await ht(r.businessId,
|
|
3744
|
+
await ht(r.businessId, k), o("deleted", k.id), n.close();
|
|
3722
3745
|
});
|
|
3723
3746
|
}
|
|
3724
|
-
const d =
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3747
|
+
const d = N(0), b = ae(() => {
|
|
3748
|
+
var k, g, A, Y, W, G;
|
|
3749
|
+
return {
|
|
3750
|
+
url: ((k = r.image) == null ? void 0 : k.original.url) ?? ((g = r.asset) == null ? void 0 : g.url) ?? "",
|
|
3751
|
+
width: ((A = r.image) == null ? void 0 : A.original.width) ?? ((Y = r.asset) == null ? void 0 : Y.width),
|
|
3752
|
+
height: ((W = r.image) == null ? void 0 : W.original.height) ?? ((G = r.asset) == null ? void 0 : G.height)
|
|
3753
|
+
};
|
|
3754
|
+
}), _ = ae(
|
|
3755
|
+
() => {
|
|
3756
|
+
var k;
|
|
3757
|
+
return r.asset ? xn(b.value, ((k = r.image) == null ? void 0 : k.variants) ?? []) : [];
|
|
3758
|
+
}
|
|
3759
|
+
);
|
|
3760
|
+
he(() => {
|
|
3761
|
+
var k;
|
|
3762
|
+
return (k = r.asset) == null ? void 0 : k.id;
|
|
3763
|
+
}, () => d.value = 0);
|
|
3764
|
+
const w = ae(() => {
|
|
3765
|
+
var k;
|
|
3766
|
+
const g = _.value[d.value];
|
|
3767
|
+
return !g || !r.asset ? null : Vr(g, r.asset, ((k = r.image) == null ? void 0 : k.variants) ?? []);
|
|
3768
|
+
}), v = ae(
|
|
3769
|
+
() => {
|
|
3770
|
+
var k;
|
|
3771
|
+
return (k = w.value) != null && k.ratio ? w.value.ratio.replace("x", ":") : a("mediaPicker.variants.original");
|
|
3772
|
+
}
|
|
3773
|
+
), y = N(!1);
|
|
3774
|
+
async function p(k) {
|
|
3775
|
+
var g;
|
|
3776
|
+
if (!(!((g = r.asset) != null && g.refType) || !r.asset.refId || y.value)) {
|
|
3777
|
+
y.value = !0;
|
|
3729
3778
|
try {
|
|
3730
|
-
await
|
|
3779
|
+
await Jr(r.businessId, {
|
|
3731
3780
|
refType: r.asset.refType,
|
|
3732
3781
|
refId: r.asset.refId,
|
|
3733
3782
|
imageId: r.asset.imageId ?? "main",
|
|
3734
|
-
aspectRatios: [
|
|
3783
|
+
aspectRatios: [k],
|
|
3735
3784
|
mode: "append"
|
|
3736
3785
|
}), o("changed");
|
|
3737
3786
|
} finally {
|
|
3738
|
-
|
|
3787
|
+
y.value = !1;
|
|
3739
3788
|
}
|
|
3740
3789
|
}
|
|
3741
3790
|
}
|
|
3742
|
-
function
|
|
3743
|
-
var
|
|
3744
|
-
|
|
3791
|
+
function m() {
|
|
3792
|
+
var k;
|
|
3793
|
+
w.value && ((k = navigator.clipboard) == null || k.writeText(w.value.url));
|
|
3745
3794
|
}
|
|
3746
|
-
function
|
|
3747
|
-
var
|
|
3748
|
-
return ((
|
|
3795
|
+
function P(k) {
|
|
3796
|
+
var g;
|
|
3797
|
+
return ((g = k.split("/")[1]) == null ? void 0 : g.toUpperCase()) ?? k;
|
|
3749
3798
|
}
|
|
3750
|
-
function
|
|
3751
|
-
return
|
|
3799
|
+
function x(k) {
|
|
3800
|
+
return k >= 1024 * 1024 ? `${(k / 1024 / 1024).toFixed(1)} MB` : `${Math.round(k / 1024)} KB`;
|
|
3752
3801
|
}
|
|
3753
|
-
return (
|
|
3754
|
-
const
|
|
3755
|
-
return
|
|
3802
|
+
return (k, g) => {
|
|
3803
|
+
const A = M("FmIcon"), Y = M("FmTextField"), W = M("FmButton"), G = M("FmDialog");
|
|
3804
|
+
return S(), ne(G, {
|
|
3756
3805
|
"model-value": !!e.asset,
|
|
3757
3806
|
"max-width": 920,
|
|
3758
3807
|
"max-height": "620px",
|
|
3759
3808
|
"content-class": "!p-0 asset-preview-dialog-content",
|
|
3760
3809
|
"close-button": !1,
|
|
3761
|
-
"onUpdate:modelValue":
|
|
3810
|
+
"onUpdate:modelValue": g[3] || (g[3] = (j) => !j && o("close"))
|
|
3762
3811
|
}, {
|
|
3763
|
-
default:
|
|
3764
|
-
var
|
|
3812
|
+
default: le(() => {
|
|
3813
|
+
var j, z, ue, $, se;
|
|
3765
3814
|
return [
|
|
3766
|
-
e.asset ? (
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3815
|
+
e.asset ? (S(), C("div", Ts, [
|
|
3816
|
+
F(Rs, {
|
|
3817
|
+
index: d.value,
|
|
3818
|
+
"onUpdate:index": g[0] || (g[0] = (X) => d.value = X),
|
|
3819
|
+
original: b.value,
|
|
3820
|
+
variants: ((j = e.image) == null ? void 0 : j.variants) ?? [],
|
|
3770
3821
|
alt: e.asset.fileName,
|
|
3771
|
-
onRegenerate:
|
|
3772
|
-
}, null, 8, ["original", "variants", "alt"]),
|
|
3773
|
-
h("div",
|
|
3774
|
-
h("div",
|
|
3775
|
-
h("span",
|
|
3822
|
+
onRegenerate: p
|
|
3823
|
+
}, null, 8, ["index", "original", "variants", "alt"]),
|
|
3824
|
+
h("div", Os, [
|
|
3825
|
+
h("div", Cs, [
|
|
3826
|
+
h("span", _s, E(T(a)("mediaPicker.assetDetailDialog.previewTitle")), 1),
|
|
3776
3827
|
h("button", {
|
|
3777
3828
|
class: "w-[32px] h-[32px] rounded-lg bg-fm-color-neutral-gray-100 flex items-center justify-center flex-shrink-0",
|
|
3778
|
-
onClick:
|
|
3829
|
+
onClick: g[1] || (g[1] = (X) => o("close"))
|
|
3779
3830
|
}, [
|
|
3780
|
-
|
|
3831
|
+
F(A, {
|
|
3781
3832
|
name: "close",
|
|
3782
3833
|
size: "sm"
|
|
3783
3834
|
})
|
|
3784
3835
|
])
|
|
3785
3836
|
]),
|
|
3786
|
-
s.value ? (
|
|
3787
|
-
|
|
3837
|
+
s.value ? (S(), C("div", Ds, [
|
|
3838
|
+
F(Y, {
|
|
3788
3839
|
modelValue: i.value,
|
|
3789
|
-
"onUpdate:modelValue":
|
|
3840
|
+
"onUpdate:modelValue": g[2] || (g[2] = (X) => i.value = X)
|
|
3790
3841
|
}, null, 8, ["modelValue"]),
|
|
3791
|
-
|
|
3792
|
-
label:
|
|
3842
|
+
F(W, {
|
|
3843
|
+
label: T(a)("mediaPicker.assetDetailDialog.saveButton"),
|
|
3793
3844
|
size: "md",
|
|
3794
3845
|
onClick: f
|
|
3795
3846
|
}, null, 8, ["label"])
|
|
3796
|
-
])) : (
|
|
3797
|
-
h("span",
|
|
3847
|
+
])) : (S(), C("div", As, [
|
|
3848
|
+
h("span", Bs, E(e.asset.fileName), 1),
|
|
3798
3849
|
h("button", { onClick: u }, [
|
|
3799
|
-
|
|
3850
|
+
F(A, {
|
|
3800
3851
|
name: "edit",
|
|
3801
3852
|
size: "sm"
|
|
3802
3853
|
})
|
|
3803
3854
|
])
|
|
3804
3855
|
])),
|
|
3805
|
-
h("div",
|
|
3806
|
-
h("div",
|
|
3807
|
-
h("span",
|
|
3808
|
-
h("span",
|
|
3856
|
+
h("div", Fs, [
|
|
3857
|
+
h("div", Ns, [
|
|
3858
|
+
h("span", Ls, E(T(a)("mediaPicker.ratios.title")), 1),
|
|
3859
|
+
h("span", Us, E(v.value), 1)
|
|
3809
3860
|
]),
|
|
3810
|
-
h("div",
|
|
3811
|
-
h("span",
|
|
3812
|
-
h("span", null,
|
|
3861
|
+
h("div", js, [
|
|
3862
|
+
h("span", Is, E(T(a)("mediaPicker.assetDetailDialog.dimensionsLabel")), 1),
|
|
3863
|
+
h("span", null, E(((z = w.value) == null ? void 0 : z.dimensions) ?? "—"), 1)
|
|
3813
3864
|
]),
|
|
3814
|
-
h("div",
|
|
3815
|
-
h("span",
|
|
3816
|
-
h("span", null,
|
|
3865
|
+
h("div", Ms, [
|
|
3866
|
+
h("span", zs, E(T(a)("mediaPicker.assetDetailDialog.sizeLabel")), 1),
|
|
3867
|
+
h("span", null, E((ue = w.value) != null && ue.sizeBytes ? x(w.value.sizeBytes) : "—"), 1)
|
|
3868
|
+
]),
|
|
3869
|
+
h("div", Vs, [
|
|
3870
|
+
h("span", qs, E(T(a)("mediaPicker.assetDetailDialog.formatLabel")), 1),
|
|
3871
|
+
h("span", null, E(($ = w.value) != null && $.contentType ? P(w.value.contentType) : "—"), 1)
|
|
3817
3872
|
])
|
|
3818
3873
|
]),
|
|
3819
|
-
(
|
|
3820
|
-
(
|
|
3821
|
-
key:
|
|
3874
|
+
(se = e.asset.tags) != null && se.length ? (S(), C("div", $s, [
|
|
3875
|
+
(S(!0), C(Z, null, be(e.asset.tags, (X) => (S(), C("span", {
|
|
3876
|
+
key: X,
|
|
3822
3877
|
class: "text-[11px] bg-gray-100 rounded-full px-8 py-[2px]"
|
|
3823
|
-
}, " # " +
|
|
3824
|
-
])) :
|
|
3825
|
-
|
|
3826
|
-
h("div",
|
|
3827
|
-
|
|
3828
|
-
label:
|
|
3878
|
+
}, " # " + E(X), 1))), 128))
|
|
3879
|
+
])) : V("", !0),
|
|
3880
|
+
g[4] || (g[4] = h("div", { class: "flex-1" }, null, -1)),
|
|
3881
|
+
h("div", Gs, [
|
|
3882
|
+
F(W, {
|
|
3883
|
+
label: T(a)("mediaPicker.assetDetailDialog.copyLinkButton"),
|
|
3829
3884
|
variant: "tertiary",
|
|
3830
3885
|
size: "md",
|
|
3831
3886
|
"prepend-icon": "link",
|
|
3832
3887
|
class: "flex-1",
|
|
3833
|
-
onClick:
|
|
3888
|
+
onClick: m
|
|
3834
3889
|
}, null, 8, ["label"]),
|
|
3835
|
-
|
|
3836
|
-
label:
|
|
3890
|
+
F(W, {
|
|
3891
|
+
label: T(a)("mediaPicker.assetDetailDialog.deleteButton"),
|
|
3837
3892
|
variant: "destructive",
|
|
3838
3893
|
size: "md",
|
|
3839
3894
|
"prepend-icon": "delete",
|
|
@@ -3841,16 +3896,16 @@ const Go = { class: "flex flex-wrap items-center gap-8" }, Ho = {
|
|
|
3841
3896
|
}, null, 8, ["label"])
|
|
3842
3897
|
])
|
|
3843
3898
|
])
|
|
3844
|
-
])) :
|
|
3899
|
+
])) : V("", !0)
|
|
3845
3900
|
];
|
|
3846
3901
|
}),
|
|
3847
3902
|
_: 1
|
|
3848
3903
|
}, 8, ["model-value"]);
|
|
3849
3904
|
};
|
|
3850
3905
|
}
|
|
3851
|
-
}),
|
|
3852
|
-
function
|
|
3853
|
-
const t =
|
|
3906
|
+
}), Js = 5e3, Ws = 3;
|
|
3907
|
+
function Ks(e) {
|
|
3908
|
+
const t = N(/* @__PURE__ */ new Map());
|
|
3854
3909
|
let n = [], a, r = 0;
|
|
3855
3910
|
function o() {
|
|
3856
3911
|
a !== void 0 && clearTimeout(a), a = void 0;
|
|
@@ -3858,15 +3913,15 @@ function qs(e) {
|
|
|
3858
3913
|
async function s() {
|
|
3859
3914
|
let u = !1;
|
|
3860
3915
|
try {
|
|
3861
|
-
const f = await
|
|
3916
|
+
const f = await Kr({ businessId: e(), refType: gt, refIds: n });
|
|
3862
3917
|
t.value = new Map(f.map((c) => [c.refId, c])), r = 0;
|
|
3863
3918
|
} catch (f) {
|
|
3864
|
-
if (u = !0, r += 1, r >=
|
|
3919
|
+
if (u = !0, r += 1, r >= Ws) {
|
|
3865
3920
|
console.warn("[media-picker] stopped polling image variants after repeated failures", f);
|
|
3866
3921
|
return;
|
|
3867
3922
|
}
|
|
3868
3923
|
}
|
|
3869
|
-
([...t.value.values()].some((f) =>
|
|
3924
|
+
([...t.value.values()].some((f) => Ir(f.variants)) || u) && (a = setTimeout(s, Js));
|
|
3870
3925
|
}
|
|
3871
3926
|
async function i(u) {
|
|
3872
3927
|
if (o(), r = 0, n = u, u.length === 0 || !e()) {
|
|
@@ -3875,73 +3930,73 @@ function qs(e) {
|
|
|
3875
3930
|
}
|
|
3876
3931
|
await s();
|
|
3877
3932
|
}
|
|
3878
|
-
return
|
|
3933
|
+
return _n(o), { byRefId: t, load: i, stop: o };
|
|
3879
3934
|
}
|
|
3880
|
-
const
|
|
3935
|
+
const Xs = { class: "p-24 relative min-h-full" }, Zs = { class: "flex items-center justify-between mb-16" }, Qs = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2" }, Ys = { class: "flex gap-8" }, ei = { class: "flex flex-col gap-12 mb-16" }, ti = { class: "flex items-center gap-12" }, ni = { class: "flex-1 text-xs text-fm-color-typo-secondary" }, ai = {
|
|
3881
3936
|
key: 0,
|
|
3882
3937
|
class: "text-fm-color-typo-primary font-semibold"
|
|
3883
|
-
},
|
|
3938
|
+
}, ri = { key: 1 }, oi = {
|
|
3884
3939
|
key: 0,
|
|
3885
3940
|
class: "fixed bottom-24 left-1/2 -translate-x-1/2 flex items-center gap-12 bg-white border rounded-lg shadow-lg px-16 py-8 z-30"
|
|
3886
|
-
},
|
|
3941
|
+
}, si = { class: "text-sm font-semibold" }, ii = { class: "flex justify-end gap-8 w-full" }, di = /* @__PURE__ */ ye({
|
|
3887
3942
|
__name: "AssetLibrary",
|
|
3888
3943
|
setup(e) {
|
|
3889
|
-
const t =
|
|
3944
|
+
const t = Kt(), { t: n } = ve(), a = ae(() => {
|
|
3890
3945
|
var O;
|
|
3891
3946
|
return ((O = t.currentBusiness.value) == null ? void 0 : O.id) ?? "";
|
|
3892
|
-
}), r =
|
|
3947
|
+
}), r = ae(() => {
|
|
3893
3948
|
var O;
|
|
3894
3949
|
return (O = t.currentRestaurant.value) == null ? void 0 : O._id;
|
|
3895
|
-
}), o =
|
|
3950
|
+
}), o = Xt(), s = N(!1);
|
|
3896
3951
|
function i(O) {
|
|
3897
|
-
console.log("[media-debug] MediaPickerModal selected", O),
|
|
3952
|
+
console.log("[media-debug] MediaPickerModal selected", O), x();
|
|
3898
3953
|
}
|
|
3899
|
-
const u =
|
|
3954
|
+
const u = N(""), f = N([]), c = N([]), d = N([]), b = N(!1), _ = N("recent"), w = {
|
|
3900
3955
|
recent: { sortBy: "createdAt", descending: !0 },
|
|
3901
3956
|
name: { sortBy: "fileName", descending: !1 },
|
|
3902
3957
|
size: { sortBy: "fileSizeBytes", descending: !0 }
|
|
3903
|
-
}, v = [{ icon: "grid_view" }, { icon: "view_list" }],
|
|
3904
|
-
const O = c.value.reduce((
|
|
3958
|
+
}, v = [{ icon: "grid_view" }, { icon: "view_list" }], y = N(v[0]), p = ae(() => y.value.icon === "grid_view" ? "grid" : "list"), m = ae(() => {
|
|
3959
|
+
const O = c.value.reduce((B, I) => B + I.fileSizeBytes, 0);
|
|
3905
3960
|
return O >= 1024 * 1024 ? `${(O / 1024 / 1024).toFixed(1)} MB` : `${Math.round(O / 1024)} KB`;
|
|
3906
|
-
}),
|
|
3907
|
-
async function
|
|
3961
|
+
}), P = Ks(() => a.value);
|
|
3962
|
+
async function x() {
|
|
3908
3963
|
if (a.value) {
|
|
3909
3964
|
c.value.length === 0 && (b.value = !0);
|
|
3910
3965
|
try {
|
|
3911
|
-
const [O,
|
|
3966
|
+
const [O, B] = await Promise.all([
|
|
3912
3967
|
rt({
|
|
3913
3968
|
businessId: a.value,
|
|
3914
3969
|
restaurantId: r.value,
|
|
3915
3970
|
search: u.value || void 0,
|
|
3916
3971
|
tags: f.value.length ? f.value : void 0,
|
|
3917
|
-
...
|
|
3972
|
+
...w[_.value]
|
|
3918
3973
|
}),
|
|
3919
|
-
|
|
3974
|
+
kn(a.value)
|
|
3920
3975
|
]);
|
|
3921
|
-
c.value = O.resources, d.value =
|
|
3976
|
+
c.value = O.resources, d.value = B, await P.load(O.resources.map((I) => I.refId).filter((I) => !!I));
|
|
3922
3977
|
} finally {
|
|
3923
3978
|
b.value = !1;
|
|
3924
3979
|
}
|
|
3925
3980
|
}
|
|
3926
3981
|
}
|
|
3927
|
-
|
|
3928
|
-
let
|
|
3929
|
-
|
|
3930
|
-
clearTimeout(
|
|
3982
|
+
Bn(x), he(a, x), he([f, _], x);
|
|
3983
|
+
let k;
|
|
3984
|
+
he(u, () => {
|
|
3985
|
+
clearTimeout(k), k = setTimeout(x, 250);
|
|
3931
3986
|
});
|
|
3932
|
-
const
|
|
3987
|
+
const g = N(/* @__PURE__ */ new Set());
|
|
3933
3988
|
function A(O) {
|
|
3934
|
-
const
|
|
3935
|
-
|
|
3989
|
+
const B = new Set(g.value);
|
|
3990
|
+
B.has(O.id) ? B.delete(O.id) : B.add(O.id), g.value = B;
|
|
3936
3991
|
}
|
|
3937
|
-
function
|
|
3938
|
-
|
|
3992
|
+
function Y() {
|
|
3993
|
+
g.value = /* @__PURE__ */ new Set();
|
|
3939
3994
|
}
|
|
3940
|
-
function
|
|
3941
|
-
|
|
3995
|
+
function W() {
|
|
3996
|
+
g.value = new Set(c.value.map((O) => O.id));
|
|
3942
3997
|
}
|
|
3943
|
-
function
|
|
3944
|
-
const O =
|
|
3998
|
+
function G() {
|
|
3999
|
+
const O = g.value.size;
|
|
3945
4000
|
o.open({
|
|
3946
4001
|
title: n("media.library.deleteBulkTitle"),
|
|
3947
4002
|
message: n("media.library.deleteBulkMessage", { count: O, disclaimer: n("media.library.deleteDisclaimer") }),
|
|
@@ -3949,11 +4004,11 @@ const $s = { class: "p-24 relative min-h-full" }, Gs = { class: "flex items-cent
|
|
|
3949
4004
|
secondaryActions: { text: n("media.library.cancelButton"), close: !0 }
|
|
3950
4005
|
}).onPrimary(async () => {
|
|
3951
4006
|
await Promise.all(
|
|
3952
|
-
[...
|
|
3953
|
-
const I = c.value.find((
|
|
4007
|
+
[...g.value].map((B) => {
|
|
4008
|
+
const I = c.value.find((fe) => fe.id === B);
|
|
3954
4009
|
return I ? ht(a.value, I) : Promise.resolve();
|
|
3955
4010
|
})
|
|
3956
|
-
),
|
|
4011
|
+
), Y(), await x(), o.close();
|
|
3957
4012
|
});
|
|
3958
4013
|
}
|
|
3959
4014
|
function j(O) {
|
|
@@ -3964,167 +4019,167 @@ const $s = { class: "p-24 relative min-h-full" }, Gs = { class: "flex items-cent
|
|
|
3964
4019
|
secondaryActions: { text: n("media.library.cancelButton"), close: !0 }
|
|
3965
4020
|
}).onPrimary(async () => {
|
|
3966
4021
|
await ht(a.value, O);
|
|
3967
|
-
const
|
|
3968
|
-
|
|
4022
|
+
const B = new Set(g.value);
|
|
4023
|
+
B.delete(O.id), g.value = B, await x(), o.close();
|
|
3969
4024
|
});
|
|
3970
4025
|
}
|
|
3971
|
-
const
|
|
4026
|
+
const z = N(null), ue = ae(
|
|
3972
4027
|
() => {
|
|
3973
4028
|
var O;
|
|
3974
|
-
return (O =
|
|
4029
|
+
return (O = z.value) != null && O.refId ? P.byRefId.value.get(z.value.refId) ?? null : null;
|
|
3975
4030
|
}
|
|
3976
4031
|
);
|
|
3977
|
-
function
|
|
3978
|
-
|
|
4032
|
+
function $(O) {
|
|
4033
|
+
z.value = O;
|
|
3979
4034
|
}
|
|
3980
|
-
async function
|
|
3981
|
-
await
|
|
3982
|
-
var
|
|
3983
|
-
return O.id === ((
|
|
4035
|
+
async function se() {
|
|
4036
|
+
await x(), z.value && (z.value = c.value.find((O) => {
|
|
4037
|
+
var B;
|
|
4038
|
+
return O.id === ((B = z.value) == null ? void 0 : B.id);
|
|
3984
4039
|
}) ?? null);
|
|
3985
4040
|
}
|
|
3986
|
-
async function
|
|
3987
|
-
|
|
4041
|
+
async function X() {
|
|
4042
|
+
z.value = null, await x();
|
|
3988
4043
|
}
|
|
3989
|
-
const
|
|
4044
|
+
const ce = N(!1), de = N(null);
|
|
3990
4045
|
function Me() {
|
|
3991
4046
|
var O;
|
|
3992
|
-
(O =
|
|
4047
|
+
(O = de.value) == null || O.reset(), ce.value = !0;
|
|
3993
4048
|
}
|
|
3994
|
-
async function
|
|
4049
|
+
async function ie() {
|
|
3995
4050
|
var O;
|
|
3996
|
-
(O =
|
|
4051
|
+
(O = de.value) != null && O.stagedCount || (ce.value = !1), await x();
|
|
3997
4052
|
}
|
|
3998
|
-
return (O,
|
|
3999
|
-
const I = M("FmButton"),
|
|
4000
|
-
return
|
|
4001
|
-
h("div",
|
|
4002
|
-
h("h1",
|
|
4003
|
-
h("div",
|
|
4004
|
-
|
|
4005
|
-
label:
|
|
4053
|
+
return (O, B) => {
|
|
4054
|
+
const I = M("FmButton"), fe = M("FmSearch"), ze = M("FmButtonGroup"), L = M("FmDialog");
|
|
4055
|
+
return S(), C("div", Xs, [
|
|
4056
|
+
h("div", Zs, [
|
|
4057
|
+
h("h1", Qs, E(T(n)("media.title")), 1),
|
|
4058
|
+
h("div", Ys, [
|
|
4059
|
+
F(I, {
|
|
4060
|
+
label: T(n)("media.library.testPickerButton"),
|
|
4006
4061
|
variant: "tertiary",
|
|
4007
|
-
onClick:
|
|
4062
|
+
onClick: B[0] || (B[0] = (U) => s.value = !0)
|
|
4008
4063
|
}, null, 8, ["label"]),
|
|
4009
|
-
|
|
4010
|
-
label:
|
|
4064
|
+
F(I, {
|
|
4065
|
+
label: T(n)("media.library.uploadButton"),
|
|
4011
4066
|
"prepend-icon": "add",
|
|
4012
4067
|
variant: "primary",
|
|
4013
4068
|
onClick: Me
|
|
4014
4069
|
}, null, 8, ["label"])
|
|
4015
4070
|
])
|
|
4016
4071
|
]),
|
|
4017
|
-
h("div",
|
|
4018
|
-
|
|
4072
|
+
h("div", ei, [
|
|
4073
|
+
F(fe, {
|
|
4019
4074
|
modelValue: u.value,
|
|
4020
|
-
"onUpdate:modelValue":
|
|
4021
|
-
placeholder:
|
|
4075
|
+
"onUpdate:modelValue": B[1] || (B[1] = (U) => u.value = U),
|
|
4076
|
+
placeholder: T(n)("media.library.searchPlaceholder"),
|
|
4022
4077
|
class: "max-w-[280px]"
|
|
4023
4078
|
}, null, 8, ["modelValue", "placeholder"]),
|
|
4024
|
-
d.value.length ? (
|
|
4079
|
+
d.value.length ? (S(), ne(T(Pn), {
|
|
4025
4080
|
key: 0,
|
|
4026
4081
|
modelValue: f.value,
|
|
4027
|
-
"onUpdate:modelValue":
|
|
4082
|
+
"onUpdate:modelValue": B[2] || (B[2] = (U) => f.value = U),
|
|
4028
4083
|
tags: d.value
|
|
4029
|
-
}, null, 8, ["modelValue", "tags"])) :
|
|
4030
|
-
h("div",
|
|
4031
|
-
h("div",
|
|
4032
|
-
|
|
4084
|
+
}, null, 8, ["modelValue", "tags"])) : V("", !0),
|
|
4085
|
+
h("div", ti, [
|
|
4086
|
+
h("div", ni, [
|
|
4087
|
+
g.value.size > 0 ? (S(), C("span", ai, E(T(n)("media.library.selectedCount", { count: g.value.size })), 1)) : (S(), C("span", ri, E(T(n)("media.library.totalSummary", { count: c.value.length, size: m.value })), 1))
|
|
4033
4088
|
]),
|
|
4034
|
-
|
|
4035
|
-
label:
|
|
4089
|
+
F(I, {
|
|
4090
|
+
label: T(n)("media.library.selectAllButton"),
|
|
4036
4091
|
variant: "tertiary",
|
|
4037
4092
|
size: "md",
|
|
4038
|
-
onClick:
|
|
4093
|
+
onClick: W
|
|
4039
4094
|
}, null, 8, ["label"]),
|
|
4040
|
-
|
|
4041
|
-
modelValue:
|
|
4042
|
-
"onUpdate:modelValue":
|
|
4095
|
+
F(ze, {
|
|
4096
|
+
modelValue: y.value,
|
|
4097
|
+
"onUpdate:modelValue": B[3] || (B[3] = (U) => y.value = U),
|
|
4043
4098
|
items: v
|
|
4044
4099
|
}, null, 8, ["modelValue"])
|
|
4045
4100
|
])
|
|
4046
4101
|
]),
|
|
4047
|
-
|
|
4102
|
+
F(T(Sn), {
|
|
4048
4103
|
assets: c.value,
|
|
4049
4104
|
loading: b.value,
|
|
4050
4105
|
view: p.value,
|
|
4051
4106
|
selectable: "",
|
|
4052
|
-
"selected-ids":
|
|
4053
|
-
"variants-by-ref-id":
|
|
4054
|
-
onOpen:
|
|
4107
|
+
"selected-ids": g.value,
|
|
4108
|
+
"variants-by-ref-id": T(P).byRefId.value,
|
|
4109
|
+
onOpen: $,
|
|
4055
4110
|
onToggle: A,
|
|
4056
4111
|
onDelete: j
|
|
4057
4112
|
}, null, 8, ["assets", "loading", "view", "selected-ids", "variants-by-ref-id"]),
|
|
4058
|
-
|
|
4059
|
-
h("span",
|
|
4060
|
-
|
|
4061
|
-
label:
|
|
4113
|
+
g.value.size > 0 ? (S(), C("div", oi, [
|
|
4114
|
+
h("span", si, E(T(n)("media.library.selectedCount", { count: g.value.size })), 1),
|
|
4115
|
+
F(I, {
|
|
4116
|
+
label: T(n)("media.library.cancelButton"),
|
|
4062
4117
|
variant: "tertiary",
|
|
4063
4118
|
size: "md",
|
|
4064
|
-
onClick:
|
|
4119
|
+
onClick: Y
|
|
4065
4120
|
}, null, 8, ["label"]),
|
|
4066
|
-
|
|
4067
|
-
label:
|
|
4121
|
+
F(I, {
|
|
4122
|
+
label: T(n)("media.library.deleteSelectedButton"),
|
|
4068
4123
|
variant: "destructive",
|
|
4069
4124
|
size: "md",
|
|
4070
4125
|
"prepend-icon": "delete",
|
|
4071
|
-
onClick:
|
|
4126
|
+
onClick: G
|
|
4072
4127
|
}, null, 8, ["label"])
|
|
4073
|
-
])) :
|
|
4074
|
-
|
|
4075
|
-
asset:
|
|
4076
|
-
image:
|
|
4128
|
+
])) : V("", !0),
|
|
4129
|
+
F(T(Hs), {
|
|
4130
|
+
asset: z.value,
|
|
4131
|
+
image: ue.value,
|
|
4077
4132
|
"business-id": a.value,
|
|
4078
|
-
onClose:
|
|
4079
|
-
onRenamed:
|
|
4080
|
-
onDeleted:
|
|
4081
|
-
onChanged:
|
|
4133
|
+
onClose: B[4] || (B[4] = (U) => z.value = null),
|
|
4134
|
+
onRenamed: se,
|
|
4135
|
+
onDeleted: X,
|
|
4136
|
+
onChanged: se
|
|
4082
4137
|
}, null, 8, ["asset", "image", "business-id"]),
|
|
4083
|
-
|
|
4138
|
+
F(T(ys), {
|
|
4084
4139
|
open: s.value,
|
|
4085
|
-
"onUpdate:open":
|
|
4140
|
+
"onUpdate:open": B[5] || (B[5] = (U) => s.value = U),
|
|
4086
4141
|
"business-id": a.value,
|
|
4087
4142
|
"restaurant-id": r.value,
|
|
4088
4143
|
onSelect: i
|
|
4089
4144
|
}, null, 8, ["open", "business-id", "restaurant-id"]),
|
|
4090
|
-
|
|
4091
|
-
modelValue:
|
|
4092
|
-
"onUpdate:modelValue":
|
|
4145
|
+
F(L, {
|
|
4146
|
+
modelValue: ce.value,
|
|
4147
|
+
"onUpdate:modelValue": B[9] || (B[9] = (U) => ce.value = U),
|
|
4093
4148
|
"max-width": 480
|
|
4094
4149
|
}, {
|
|
4095
|
-
"dialog-header":
|
|
4096
|
-
h("div", null,
|
|
4150
|
+
"dialog-header": le(() => [
|
|
4151
|
+
h("div", null, E(T(n)("media.library.uploadDialogTitle")), 1)
|
|
4097
4152
|
]),
|
|
4098
|
-
"dialog-footer":
|
|
4099
|
-
var U,
|
|
4153
|
+
"dialog-footer": le(() => {
|
|
4154
|
+
var U, Se;
|
|
4100
4155
|
return [
|
|
4101
|
-
h("div",
|
|
4102
|
-
|
|
4103
|
-
label:
|
|
4156
|
+
h("div", ii, [
|
|
4157
|
+
F(I, {
|
|
4158
|
+
label: T(n)("media.library.cancelButton"),
|
|
4104
4159
|
variant: "tertiary",
|
|
4105
|
-
onClick:
|
|
4160
|
+
onClick: B[7] || (B[7] = (Ve) => ce.value = !1)
|
|
4106
4161
|
}, null, 8, ["label"]),
|
|
4107
|
-
|
|
4108
|
-
label:
|
|
4162
|
+
F(I, {
|
|
4163
|
+
label: T(n)("media.library.uploadSubmitButton", { count: ((U = de.value) == null ? void 0 : U.stagedCount) ?? 0 }),
|
|
4109
4164
|
variant: "primary",
|
|
4110
|
-
disabled: !((
|
|
4111
|
-
onClick:
|
|
4165
|
+
disabled: !((Se = de.value) != null && Se.stagedCount) || de.value.uploading,
|
|
4166
|
+
onClick: B[8] || (B[8] = (Ve) => {
|
|
4112
4167
|
var qe;
|
|
4113
|
-
return (qe =
|
|
4168
|
+
return (qe = de.value) == null ? void 0 : qe.upload();
|
|
4114
4169
|
})
|
|
4115
4170
|
}, null, 8, ["label", "disabled"])
|
|
4116
4171
|
])
|
|
4117
4172
|
];
|
|
4118
4173
|
}),
|
|
4119
|
-
default:
|
|
4120
|
-
|
|
4174
|
+
default: le(() => [
|
|
4175
|
+
F(T(En), {
|
|
4121
4176
|
ref_key: "uploadPanelRef",
|
|
4122
|
-
ref:
|
|
4177
|
+
ref: de,
|
|
4123
4178
|
"business-id": a.value,
|
|
4124
4179
|
"restaurant-id": r.value,
|
|
4125
4180
|
"available-tags": d.value,
|
|
4126
|
-
onTagCreated:
|
|
4127
|
-
onUploaded:
|
|
4181
|
+
onTagCreated: B[6] || (B[6] = (U) => d.value.push(U)),
|
|
4182
|
+
onUploaded: ie
|
|
4128
4183
|
}, null, 8, ["business-id", "restaurant-id", "available-tags"])
|
|
4129
4184
|
]),
|
|
4130
4185
|
_: 1
|
|
@@ -4134,5 +4189,5 @@ const $s = { class: "p-24 relative min-h-full" }, Gs = { class: "flex items-cent
|
|
|
4134
4189
|
}
|
|
4135
4190
|
});
|
|
4136
4191
|
export {
|
|
4137
|
-
|
|
4192
|
+
di as default
|
|
4138
4193
|
};
|