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