@feedmepos/mf-media 0.0.4 → 0.0.5

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