virtual-human-cf 1.3.0 → 1.5.0

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.
@@ -1,5 +1,5 @@
1
- import { defineComponent as $, ref as b, watch as C, onMounted as M, onUnmounted as R, openBlock as W, createBlock as J, Transition as L, withCtx as j, createElementBlock as G, normalizeStyle as K, normalizeClass as Q, createElementVNode as F, createCommentVNode as X, renderSlot as Y } from "vue";
2
- const Z = ["src", "muted"], ee = /* @__PURE__ */ $({
1
+ import { defineComponent as Ye, ref as Q, watch as ne, onMounted as et, onUnmounted as tt, openBlock as ve, createBlock as Tt, Transition as Ct, withCtx as Pt, createElementBlock as xt, normalizeStyle as _t, normalizeClass as Nt, createElementVNode as Be, createCommentVNode as Ut, renderSlot as kt } from "vue";
2
+ const Ft = ["src", "muted"], vt = /* @__PURE__ */ Ye({
3
3
  __name: "VirtualHumanPersona",
4
4
  props: {
5
5
  // 视频源URL
@@ -49,88 +49,1982 @@ const Z = ["src", "muted"], ee = /* @__PURE__ */ $({
49
49
  }
50
50
  },
51
51
  emits: ["update:isPlaying", "ended", "update:visible"],
52
- setup(c, { emit: S }) {
53
- const n = c, a = S, s = b(null), P = b(null), e = b(null), p = b(!1), d = () => {
54
- if (e.value && e.value.close(), !(!n.wsUrl || !n.screenClientId))
52
+ setup(e, { emit: t }) {
53
+ const n = e, r = t, s = Q(null), i = Q(null), o = Q(null), a = Q(!1), d = () => {
54
+ if (o.value && o.value.close(), !(!n.wsUrl || !n.screenClientId))
55
55
  try {
56
- const l = new URL(n.wsUrl);
57
- l.searchParams.append("sessionId", n.screenClientId + "-persona"), e.value = new WebSocket(l.toString()), e.value.onopen = () => {
58
- p.value = !0, console.log(`[VirtualHumanPersona] Connected to ${n.wsUrl} for session ${n.screenClientId}-persona`);
59
- }, e.value.onmessage = (i) => {
56
+ const g = new URL(n.wsUrl);
57
+ g.searchParams.append("sessionId", n.screenClientId + "-persona"), o.value = new WebSocket(g.toString()), o.value.onopen = () => {
58
+ a.value = !0, console.log(`[VirtualHumanPersona] Connected to ${n.wsUrl} for session ${n.screenClientId}-persona`);
59
+ }, o.value.onmessage = (c) => {
60
60
  try {
61
- const u = JSON.parse(i.data);
62
- v(u);
63
- } catch (u) {
64
- console.error("[VirtualHumanPersona] Failed to parse message:", i.data, u);
61
+ const p = JSON.parse(c.data);
62
+ f(p);
63
+ } catch (p) {
64
+ console.error("[VirtualHumanPersona] Failed to parse message:", c.data, p);
65
65
  }
66
- }, e.value.onerror = (i) => {
67
- console.error("[VirtualHumanPersona] WebSocket error:", i);
68
- }, e.value.onclose = () => {
69
- p.value = !1, console.log("[VirtualHumanPersona] WebSocket disconnected");
66
+ }, o.value.onerror = (c) => {
67
+ console.error("[VirtualHumanPersona] WebSocket error:", c);
68
+ }, o.value.onclose = () => {
69
+ a.value = !1, console.log("[VirtualHumanPersona] WebSocket disconnected");
70
70
  };
71
- } catch (l) {
72
- console.error("[VirtualHumanPersona] Failed to initialize WebSocket:", l);
71
+ } catch (g) {
72
+ console.error("[VirtualHumanPersona] Failed to initialize WebSocket:", g);
73
73
  }
74
- }, v = (l) => {
75
- const { type: i, action: u } = l;
76
- i === "control" && (u === "play" || u === "resume" ? (a("update:isPlaying", !0), a("update:visible", !0)) : u === "pause" ? (a("update:isPlaying", !1), a("update:visible", !0)) : u === "stop" && (a("update:isPlaying", !1), a("update:visible", !1), s.value && (s.value.currentTime = 0)));
74
+ }, f = (g) => {
75
+ const { type: c, action: p } = g;
76
+ c === "control" && (p === "play" || p === "resume" ? (r("update:isPlaying", !0), r("update:visible", !0)) : p === "pause" ? (s.value && s.value.pause(), r("update:isPlaying", !1), r("update:visible", !0)) : p === "stop" && (r("update:isPlaying", !1), r("update:visible", !1), s.value && (s.value.currentTime = 0)));
77
77
  };
78
- C(() => n.screenClientId, () => {
78
+ ne(() => n.screenClientId, () => {
79
79
  n.screenClientId && n.wsUrl && d();
80
- }), C(() => n.wsUrl, () => {
80
+ }), ne(() => n.wsUrl, () => {
81
81
  n.screenClientId && n.wsUrl && d();
82
- }), C(() => n.isPlaying, (l) => {
83
- s.value && (l ? s.value.play().catch((i) => console.error("Video play failed:", i)) : s.value.pause());
82
+ }), ne(() => n.isPlaying, (g) => {
83
+ s.value && (g ? s.value.play().catch((c) => console.error("Video play failed:", c)) : s.value.pause());
84
84
  });
85
- const y = () => {
86
- n.isPlaying || a("update:isPlaying", !0);
85
+ const u = () => {
86
+ n.isPlaying || r("update:isPlaying", !0);
87
+ }, m = () => {
88
+ n.isPlaying && r("update:isPlaying", !1);
87
89
  }, w = () => {
88
- n.isPlaying && a("update:isPlaying", !1);
89
- }, h = () => {
90
- a("update:isPlaying", !1), a("ended");
90
+ r("update:isPlaying", !1), r("ended");
91
91
  };
92
- return M(() => {
93
- n.isPlaying && s.value && s.value.play().catch((l) => console.error("Video play failed:", l)), n.screenClientId && n.wsUrl && d();
94
- }), R(() => {
95
- e.value && e.value.close();
96
- }), (l, i) => (W(), J(L, { name: "fade" }, {
97
- default: j(() => [
98
- c.visible ? (W(), G("div", {
92
+ return et(() => {
93
+ n.isPlaying && s.value && s.value.play().catch((g) => console.error("Video play failed:", g)), n.screenClientId && n.wsUrl && d();
94
+ }), tt(() => {
95
+ o.value && o.value.close();
96
+ }), (g, c) => (ve(), Tt(Ct, { name: "fade" }, {
97
+ default: Pt(() => [
98
+ e.visible ? (ve(), xt("div", {
99
99
  key: 0,
100
- class: Q(["virtual-human-container", { "is-dark": c.isDark }]),
101
- style: K(c.styles)
100
+ class: Nt(["virtual-human-container", { "is-dark": e.isDark }]),
101
+ style: _t(e.styles)
102
102
  }, [
103
- F("div", {
103
+ Be("div", {
104
104
  class: "video-wrapper",
105
105
  ref_key: "wrapperRef",
106
- ref: P
106
+ ref: i
107
107
  }, [
108
- F("video", {
108
+ Be("video", {
109
109
  ref_key: "videoRef",
110
110
  ref: s,
111
- src: c.videoSrc,
111
+ src: e.videoSrc,
112
112
  class: "persona-video",
113
- muted: c.muted,
113
+ muted: e.muted,
114
114
  playsinline: "",
115
115
  loop: "",
116
116
  autoPlay: "",
117
117
  disablePictureInPicture: "",
118
- onPlay: y,
119
- onPause: w,
120
- onEnded: h
121
- }, null, 40, Z)
118
+ onPlay: u,
119
+ onPause: m,
120
+ onEnded: w
121
+ }, null, 40, Ft)
122
122
  ], 512)
123
- ], 6)) : X("", !0)
123
+ ], 6)) : Ut("", !0)
124
124
  ]),
125
125
  _: 1
126
126
  }));
127
127
  }
128
- }), te = (c, S) => {
129
- const n = c.__vccOpts || c;
130
- for (const [a, s] of S)
131
- n[a] = s;
128
+ }), Bt = (e, t) => {
129
+ const n = e.__vccOpts || e;
130
+ for (const [r, s] of t)
131
+ n[r] = s;
132
132
  return n;
133
- }, ne = /* @__PURE__ */ te(ee, [["__scopeId", "data-v-bf23f155"]]), ae = /* @__PURE__ */ $({
133
+ }, It = /* @__PURE__ */ Bt(vt, [["__scopeId", "data-v-02ec3645"]]);
134
+ function nt(e, t) {
135
+ return function() {
136
+ return e.apply(t, arguments);
137
+ };
138
+ }
139
+ const { toString: Lt } = Object.prototype, { getPrototypeOf: _e } = Object, { iterator: ye, toStringTag: rt } = Symbol, be = /* @__PURE__ */ ((e) => (t) => {
140
+ const n = Lt.call(t);
141
+ return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
142
+ })(/* @__PURE__ */ Object.create(null)), B = (e) => (e = e.toLowerCase(), (t) => be(t) === e), we = (e) => (t) => typeof t === e, { isArray: Y } = Array, Z = we("undefined");
143
+ function re(e) {
144
+ return e !== null && !Z(e) && e.constructor !== null && !Z(e.constructor) && N(e.constructor.isBuffer) && e.constructor.isBuffer(e);
145
+ }
146
+ const st = B("ArrayBuffer");
147
+ function Dt(e) {
148
+ let t;
149
+ return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && st(e.buffer), t;
150
+ }
151
+ const jt = we("string"), N = we("function"), ot = we("number"), se = (e) => e !== null && typeof e == "object", Ht = (e) => e === !0 || e === !1, de = (e) => {
152
+ if (be(e) !== "object")
153
+ return !1;
154
+ const t = _e(e);
155
+ return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(rt in e) && !(ye in e);
156
+ }, qt = (e) => {
157
+ if (!se(e) || re(e))
158
+ return !1;
159
+ try {
160
+ return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
161
+ } catch {
162
+ return !1;
163
+ }
164
+ }, Mt = B("Date"), $t = B("File"), Vt = (e) => !!(e && typeof e.uri < "u"), zt = (e) => e && typeof e.getParts < "u", Wt = B("Blob"), Jt = B("FileList"), Kt = (e) => se(e) && N(e.pipe);
165
+ function Xt() {
166
+ return typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {};
167
+ }
168
+ const Ie = Xt(), Le = typeof Ie.FormData < "u" ? Ie.FormData : void 0, Gt = (e) => {
169
+ let t;
170
+ return e && (Le && e instanceof Le || N(e.append) && ((t = be(e)) === "formdata" || // detect form-data instance
171
+ t === "object" && N(e.toString) && e.toString() === "[object FormData]"));
172
+ }, Qt = B("URLSearchParams"), [Zt, Yt, en, tn] = [
173
+ "ReadableStream",
174
+ "Request",
175
+ "Response",
176
+ "Headers"
177
+ ].map(B), nn = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
178
+ function oe(e, t, { allOwnKeys: n = !1 } = {}) {
179
+ if (e === null || typeof e > "u")
180
+ return;
181
+ let r, s;
182
+ if (typeof e != "object" && (e = [e]), Y(e))
183
+ for (r = 0, s = e.length; r < s; r++)
184
+ t.call(null, e[r], r, e);
185
+ else {
186
+ if (re(e))
187
+ return;
188
+ const i = n ? Object.getOwnPropertyNames(e) : Object.keys(e), o = i.length;
189
+ let a;
190
+ for (r = 0; r < o; r++)
191
+ a = i[r], t.call(null, e[a], a, e);
192
+ }
193
+ }
194
+ function it(e, t) {
195
+ if (re(e))
196
+ return null;
197
+ t = t.toLowerCase();
198
+ const n = Object.keys(e);
199
+ let r = n.length, s;
200
+ for (; r-- > 0; )
201
+ if (s = n[r], t === s.toLowerCase())
202
+ return s;
203
+ return null;
204
+ }
205
+ const W = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, at = (e) => !Z(e) && e !== W;
206
+ function Te() {
207
+ const { caseless: e, skipUndefined: t } = at(this) && this || {}, n = {}, r = (s, i) => {
208
+ if (i === "__proto__" || i === "constructor" || i === "prototype")
209
+ return;
210
+ const o = e && it(n, i) || i;
211
+ de(n[o]) && de(s) ? n[o] = Te(n[o], s) : de(s) ? n[o] = Te({}, s) : Y(s) ? n[o] = s.slice() : (!t || !Z(s)) && (n[o] = s);
212
+ };
213
+ for (let s = 0, i = arguments.length; s < i; s++)
214
+ arguments[s] && oe(arguments[s], r);
215
+ return n;
216
+ }
217
+ const rn = (e, t, n, { allOwnKeys: r } = {}) => (oe(
218
+ t,
219
+ (s, i) => {
220
+ n && N(s) ? Object.defineProperty(e, i, {
221
+ value: nt(s, n),
222
+ writable: !0,
223
+ enumerable: !0,
224
+ configurable: !0
225
+ }) : Object.defineProperty(e, i, {
226
+ value: s,
227
+ writable: !0,
228
+ enumerable: !0,
229
+ configurable: !0
230
+ });
231
+ },
232
+ { allOwnKeys: r }
233
+ ), e), sn = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), on = (e, t, n, r) => {
234
+ e.prototype = Object.create(t.prototype, r), Object.defineProperty(e.prototype, "constructor", {
235
+ value: e,
236
+ writable: !0,
237
+ enumerable: !1,
238
+ configurable: !0
239
+ }), Object.defineProperty(e, "super", {
240
+ value: t.prototype
241
+ }), n && Object.assign(e.prototype, n);
242
+ }, an = (e, t, n, r) => {
243
+ let s, i, o;
244
+ const a = {};
245
+ if (t = t || {}, e == null) return t;
246
+ do {
247
+ for (s = Object.getOwnPropertyNames(e), i = s.length; i-- > 0; )
248
+ o = s[i], (!r || r(o, e, t)) && !a[o] && (t[o] = e[o], a[o] = !0);
249
+ e = n !== !1 && _e(e);
250
+ } while (e && (!n || n(e, t)) && e !== Object.prototype);
251
+ return t;
252
+ }, ln = (e, t, n) => {
253
+ e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
254
+ const r = e.indexOf(t, n);
255
+ return r !== -1 && r === n;
256
+ }, cn = (e) => {
257
+ if (!e) return null;
258
+ if (Y(e)) return e;
259
+ let t = e.length;
260
+ if (!ot(t)) return null;
261
+ const n = new Array(t);
262
+ for (; t-- > 0; )
263
+ n[t] = e[t];
264
+ return n;
265
+ }, un = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && _e(Uint8Array)), fn = (e, t) => {
266
+ const r = (e && e[ye]).call(e);
267
+ let s;
268
+ for (; (s = r.next()) && !s.done; ) {
269
+ const i = s.value;
270
+ t.call(e, i[0], i[1]);
271
+ }
272
+ }, dn = (e, t) => {
273
+ let n;
274
+ const r = [];
275
+ for (; (n = e.exec(t)) !== null; )
276
+ r.push(n);
277
+ return r;
278
+ }, pn = B("HTMLFormElement"), hn = (e) => e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function(n, r, s) {
279
+ return r.toUpperCase() + s;
280
+ }), De = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), mn = B("RegExp"), lt = (e, t) => {
281
+ const n = Object.getOwnPropertyDescriptors(e), r = {};
282
+ oe(n, (s, i) => {
283
+ let o;
284
+ (o = t(s, i, e)) !== !1 && (r[i] = o || s);
285
+ }), Object.defineProperties(e, r);
286
+ }, yn = (e) => {
287
+ lt(e, (t, n) => {
288
+ if (N(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
289
+ return !1;
290
+ const r = e[n];
291
+ if (N(r)) {
292
+ if (t.enumerable = !1, "writable" in t) {
293
+ t.writable = !1;
294
+ return;
295
+ }
296
+ t.set || (t.set = () => {
297
+ throw Error("Can not rewrite read-only method '" + n + "'");
298
+ });
299
+ }
300
+ });
301
+ }, bn = (e, t) => {
302
+ const n = {}, r = (s) => {
303
+ s.forEach((i) => {
304
+ n[i] = !0;
305
+ });
306
+ };
307
+ return Y(e) ? r(e) : r(String(e).split(t)), n;
308
+ }, wn = () => {
309
+ }, gn = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
310
+ function En(e) {
311
+ return !!(e && N(e.append) && e[rt] === "FormData" && e[ye]);
312
+ }
313
+ const Rn = (e) => {
314
+ const t = new Array(10), n = (r, s) => {
315
+ if (se(r)) {
316
+ if (t.indexOf(r) >= 0)
317
+ return;
318
+ if (re(r))
319
+ return r;
320
+ if (!("toJSON" in r)) {
321
+ t[s] = r;
322
+ const i = Y(r) ? [] : {};
323
+ return oe(r, (o, a) => {
324
+ const d = n(o, s + 1);
325
+ !Z(d) && (i[a] = d);
326
+ }), t[s] = void 0, i;
327
+ }
328
+ }
329
+ return r;
330
+ };
331
+ return n(e, 0);
332
+ }, Sn = B("AsyncFunction"), On = (e) => e && (se(e) || N(e)) && N(e.then) && N(e.catch), ct = ((e, t) => e ? setImmediate : t ? ((n, r) => (W.addEventListener(
333
+ "message",
334
+ ({ source: s, data: i }) => {
335
+ s === W && i === n && r.length && r.shift()();
336
+ },
337
+ !1
338
+ ), (s) => {
339
+ r.push(s), W.postMessage(n, "*");
340
+ }))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(typeof setImmediate == "function", N(W.postMessage)), An = typeof queueMicrotask < "u" ? queueMicrotask.bind(W) : typeof process < "u" && process.nextTick || ct, Tn = (e) => e != null && N(e[ye]), l = {
341
+ isArray: Y,
342
+ isArrayBuffer: st,
343
+ isBuffer: re,
344
+ isFormData: Gt,
345
+ isArrayBufferView: Dt,
346
+ isString: jt,
347
+ isNumber: ot,
348
+ isBoolean: Ht,
349
+ isObject: se,
350
+ isPlainObject: de,
351
+ isEmptyObject: qt,
352
+ isReadableStream: Zt,
353
+ isRequest: Yt,
354
+ isResponse: en,
355
+ isHeaders: tn,
356
+ isUndefined: Z,
357
+ isDate: Mt,
358
+ isFile: $t,
359
+ isReactNativeBlob: Vt,
360
+ isReactNative: zt,
361
+ isBlob: Wt,
362
+ isRegExp: mn,
363
+ isFunction: N,
364
+ isStream: Kt,
365
+ isURLSearchParams: Qt,
366
+ isTypedArray: un,
367
+ isFileList: Jt,
368
+ forEach: oe,
369
+ merge: Te,
370
+ extend: rn,
371
+ trim: nn,
372
+ stripBOM: sn,
373
+ inherits: on,
374
+ toFlatObject: an,
375
+ kindOf: be,
376
+ kindOfTest: B,
377
+ endsWith: ln,
378
+ toArray: cn,
379
+ forEachEntry: fn,
380
+ matchAll: dn,
381
+ isHTMLForm: pn,
382
+ hasOwnProperty: De,
383
+ hasOwnProp: De,
384
+ // an alias to avoid ESLint no-prototype-builtins detection
385
+ reduceDescriptors: lt,
386
+ freezeMethods: yn,
387
+ toObjectSet: bn,
388
+ toCamelCase: hn,
389
+ noop: wn,
390
+ toFiniteNumber: gn,
391
+ findKey: it,
392
+ global: W,
393
+ isContextDefined: at,
394
+ isSpecCompliantForm: En,
395
+ toJSONObject: Rn,
396
+ isAsyncFn: Sn,
397
+ isThenable: On,
398
+ setImmediate: ct,
399
+ asap: An,
400
+ isIterable: Tn
401
+ };
402
+ let b = class ut extends Error {
403
+ static from(t, n, r, s, i, o) {
404
+ const a = new ut(t.message, n || t.code, r, s, i);
405
+ return a.cause = t, a.name = t.name, t.status != null && a.status == null && (a.status = t.status), o && Object.assign(a, o), a;
406
+ }
407
+ /**
408
+ * Create an Error with the specified message, config, error code, request and response.
409
+ *
410
+ * @param {string} message The error message.
411
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
412
+ * @param {Object} [config] The config.
413
+ * @param {Object} [request] The request.
414
+ * @param {Object} [response] The response.
415
+ *
416
+ * @returns {Error} The created error.
417
+ */
418
+ constructor(t, n, r, s, i) {
419
+ super(t), Object.defineProperty(this, "message", {
420
+ value: t,
421
+ enumerable: !0,
422
+ writable: !0,
423
+ configurable: !0
424
+ }), this.name = "AxiosError", this.isAxiosError = !0, n && (this.code = n), r && (this.config = r), s && (this.request = s), i && (this.response = i, this.status = i.status);
425
+ }
426
+ toJSON() {
427
+ return {
428
+ // Standard
429
+ message: this.message,
430
+ name: this.name,
431
+ // Microsoft
432
+ description: this.description,
433
+ number: this.number,
434
+ // Mozilla
435
+ fileName: this.fileName,
436
+ lineNumber: this.lineNumber,
437
+ columnNumber: this.columnNumber,
438
+ stack: this.stack,
439
+ // Axios
440
+ config: l.toJSONObject(this.config),
441
+ code: this.code,
442
+ status: this.status
443
+ };
444
+ }
445
+ };
446
+ b.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
447
+ b.ERR_BAD_OPTION = "ERR_BAD_OPTION";
448
+ b.ECONNABORTED = "ECONNABORTED";
449
+ b.ETIMEDOUT = "ETIMEDOUT";
450
+ b.ERR_NETWORK = "ERR_NETWORK";
451
+ b.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
452
+ b.ERR_DEPRECATED = "ERR_DEPRECATED";
453
+ b.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
454
+ b.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
455
+ b.ERR_CANCELED = "ERR_CANCELED";
456
+ b.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
457
+ b.ERR_INVALID_URL = "ERR_INVALID_URL";
458
+ const Cn = null;
459
+ function Ce(e) {
460
+ return l.isPlainObject(e) || l.isArray(e);
461
+ }
462
+ function ft(e) {
463
+ return l.endsWith(e, "[]") ? e.slice(0, -2) : e;
464
+ }
465
+ function Re(e, t, n) {
466
+ return e ? e.concat(t).map(function(s, i) {
467
+ return s = ft(s), !n && i ? "[" + s + "]" : s;
468
+ }).join(n ? "." : "") : t;
469
+ }
470
+ function Pn(e) {
471
+ return l.isArray(e) && !e.some(Ce);
472
+ }
473
+ const xn = l.toFlatObject(l, {}, null, function(t) {
474
+ return /^is[A-Z]/.test(t);
475
+ });
476
+ function ge(e, t, n) {
477
+ if (!l.isObject(e))
478
+ throw new TypeError("target must be an object");
479
+ t = t || new FormData(), n = l.toFlatObject(
480
+ n,
481
+ {
482
+ metaTokens: !0,
483
+ dots: !1,
484
+ indexes: !1
485
+ },
486
+ !1,
487
+ function(p, h) {
488
+ return !l.isUndefined(h[p]);
489
+ }
490
+ );
491
+ const r = n.metaTokens, s = n.visitor || u, i = n.dots, o = n.indexes, d = (n.Blob || typeof Blob < "u" && Blob) && l.isSpecCompliantForm(t);
492
+ if (!l.isFunction(s))
493
+ throw new TypeError("visitor must be a function");
494
+ function f(c) {
495
+ if (c === null) return "";
496
+ if (l.isDate(c))
497
+ return c.toISOString();
498
+ if (l.isBoolean(c))
499
+ return c.toString();
500
+ if (!d && l.isBlob(c))
501
+ throw new b("Blob is not supported. Use a Buffer instead.");
502
+ return l.isArrayBuffer(c) || l.isTypedArray(c) ? d && typeof Blob == "function" ? new Blob([c]) : Buffer.from(c) : c;
503
+ }
504
+ function u(c, p, h) {
505
+ let R = c;
506
+ if (l.isReactNative(t) && l.isReactNativeBlob(c))
507
+ return t.append(Re(h, p, i), f(c)), !1;
508
+ if (c && !h && typeof c == "object") {
509
+ if (l.endsWith(p, "{}"))
510
+ p = r ? p : p.slice(0, -2), c = JSON.stringify(c);
511
+ else if (l.isArray(c) && Pn(c) || (l.isFileList(c) || l.endsWith(p, "[]")) && (R = l.toArray(c)))
512
+ return p = ft(p), R.forEach(function(A, T) {
513
+ !(l.isUndefined(A) || A === null) && t.append(
514
+ // eslint-disable-next-line no-nested-ternary
515
+ o === !0 ? Re([p], T, i) : o === null ? p : p + "[]",
516
+ f(A)
517
+ );
518
+ }), !1;
519
+ }
520
+ return Ce(c) ? !0 : (t.append(Re(h, p, i), f(c)), !1);
521
+ }
522
+ const m = [], w = Object.assign(xn, {
523
+ defaultVisitor: u,
524
+ convertValue: f,
525
+ isVisitable: Ce
526
+ });
527
+ function g(c, p) {
528
+ if (!l.isUndefined(c)) {
529
+ if (m.indexOf(c) !== -1)
530
+ throw Error("Circular reference detected in " + p.join("."));
531
+ m.push(c), l.forEach(c, function(R, k) {
532
+ (!(l.isUndefined(R) || R === null) && s.call(t, R, l.isString(k) ? k.trim() : k, p, w)) === !0 && g(R, p ? p.concat(k) : [k]);
533
+ }), m.pop();
534
+ }
535
+ }
536
+ if (!l.isObject(e))
537
+ throw new TypeError("data must be an object");
538
+ return g(e), t;
539
+ }
540
+ function je(e) {
541
+ const t = {
542
+ "!": "%21",
543
+ "'": "%27",
544
+ "(": "%28",
545
+ ")": "%29",
546
+ "~": "%7E",
547
+ "%20": "+",
548
+ "%00": "\0"
549
+ };
550
+ return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(r) {
551
+ return t[r];
552
+ });
553
+ }
554
+ function Ne(e, t) {
555
+ this._pairs = [], e && ge(e, this, t);
556
+ }
557
+ const dt = Ne.prototype;
558
+ dt.append = function(t, n) {
559
+ this._pairs.push([t, n]);
560
+ };
561
+ dt.toString = function(t) {
562
+ const n = t ? function(r) {
563
+ return t.call(this, r, je);
564
+ } : je;
565
+ return this._pairs.map(function(s) {
566
+ return n(s[0]) + "=" + n(s[1]);
567
+ }, "").join("&");
568
+ };
569
+ function _n(e) {
570
+ return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
571
+ }
572
+ function pt(e, t, n) {
573
+ if (!t)
574
+ return e;
575
+ const r = n && n.encode || _n, s = l.isFunction(n) ? {
576
+ serialize: n
577
+ } : n, i = s && s.serialize;
578
+ let o;
579
+ if (i ? o = i(t, s) : o = l.isURLSearchParams(t) ? t.toString() : new Ne(t, s).toString(r), o) {
580
+ const a = e.indexOf("#");
581
+ a !== -1 && (e = e.slice(0, a)), e += (e.indexOf("?") === -1 ? "?" : "&") + o;
582
+ }
583
+ return e;
584
+ }
585
+ class He {
586
+ constructor() {
587
+ this.handlers = [];
588
+ }
589
+ /**
590
+ * Add a new interceptor to the stack
591
+ *
592
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
593
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
594
+ * @param {Object} options The options for the interceptor, synchronous and runWhen
595
+ *
596
+ * @return {Number} An ID used to remove interceptor later
597
+ */
598
+ use(t, n, r) {
599
+ return this.handlers.push({
600
+ fulfilled: t,
601
+ rejected: n,
602
+ synchronous: r ? r.synchronous : !1,
603
+ runWhen: r ? r.runWhen : null
604
+ }), this.handlers.length - 1;
605
+ }
606
+ /**
607
+ * Remove an interceptor from the stack
608
+ *
609
+ * @param {Number} id The ID that was returned by `use`
610
+ *
611
+ * @returns {void}
612
+ */
613
+ eject(t) {
614
+ this.handlers[t] && (this.handlers[t] = null);
615
+ }
616
+ /**
617
+ * Clear all interceptors from the stack
618
+ *
619
+ * @returns {void}
620
+ */
621
+ clear() {
622
+ this.handlers && (this.handlers = []);
623
+ }
624
+ /**
625
+ * Iterate over all the registered interceptors
626
+ *
627
+ * This method is particularly useful for skipping over any
628
+ * interceptors that may have become `null` calling `eject`.
629
+ *
630
+ * @param {Function} fn The function to call for each interceptor
631
+ *
632
+ * @returns {void}
633
+ */
634
+ forEach(t) {
635
+ l.forEach(this.handlers, function(r) {
636
+ r !== null && t(r);
637
+ });
638
+ }
639
+ }
640
+ const Ue = {
641
+ silentJSONParsing: !0,
642
+ forcedJSONParsing: !0,
643
+ clarifyTimeoutError: !1,
644
+ legacyInterceptorReqResOrdering: !0
645
+ }, Nn = typeof URLSearchParams < "u" ? URLSearchParams : Ne, Un = typeof FormData < "u" ? FormData : null, kn = typeof Blob < "u" ? Blob : null, Fn = {
646
+ isBrowser: !0,
647
+ classes: {
648
+ URLSearchParams: Nn,
649
+ FormData: Un,
650
+ Blob: kn
651
+ },
652
+ protocols: ["http", "https", "file", "blob", "url", "data"]
653
+ }, ke = typeof window < "u" && typeof document < "u", Pe = typeof navigator == "object" && navigator || void 0, vn = ke && (!Pe || ["ReactNative", "NativeScript", "NS"].indexOf(Pe.product) < 0), Bn = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
654
+ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", In = ke && window.location.href || "http://localhost", Ln = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
655
+ __proto__: null,
656
+ hasBrowserEnv: ke,
657
+ hasStandardBrowserEnv: vn,
658
+ hasStandardBrowserWebWorkerEnv: Bn,
659
+ navigator: Pe,
660
+ origin: In
661
+ }, Symbol.toStringTag, { value: "Module" })), P = {
662
+ ...Ln,
663
+ ...Fn
664
+ };
665
+ function Dn(e, t) {
666
+ return ge(e, new P.classes.URLSearchParams(), {
667
+ visitor: function(n, r, s, i) {
668
+ return P.isNode && l.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
669
+ },
670
+ ...t
671
+ });
672
+ }
673
+ function jn(e) {
674
+ return l.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
675
+ }
676
+ function Hn(e) {
677
+ const t = {}, n = Object.keys(e);
678
+ let r;
679
+ const s = n.length;
680
+ let i;
681
+ for (r = 0; r < s; r++)
682
+ i = n[r], t[i] = e[i];
683
+ return t;
684
+ }
685
+ function ht(e) {
686
+ function t(n, r, s, i) {
687
+ let o = n[i++];
688
+ if (o === "__proto__") return !0;
689
+ const a = Number.isFinite(+o), d = i >= n.length;
690
+ return o = !o && l.isArray(s) ? s.length : o, d ? (l.hasOwnProp(s, o) ? s[o] = [s[o], r] : s[o] = r, !a) : ((!s[o] || !l.isObject(s[o])) && (s[o] = []), t(n, r, s[o], i) && l.isArray(s[o]) && (s[o] = Hn(s[o])), !a);
691
+ }
692
+ if (l.isFormData(e) && l.isFunction(e.entries)) {
693
+ const n = {};
694
+ return l.forEachEntry(e, (r, s) => {
695
+ t(jn(r), s, n, 0);
696
+ }), n;
697
+ }
698
+ return null;
699
+ }
700
+ function qn(e, t, n) {
701
+ if (l.isString(e))
702
+ try {
703
+ return (t || JSON.parse)(e), l.trim(e);
704
+ } catch (r) {
705
+ if (r.name !== "SyntaxError")
706
+ throw r;
707
+ }
708
+ return (n || JSON.stringify)(e);
709
+ }
710
+ const ie = {
711
+ transitional: Ue,
712
+ adapter: ["xhr", "http", "fetch"],
713
+ transformRequest: [
714
+ function(t, n) {
715
+ const r = n.getContentType() || "", s = r.indexOf("application/json") > -1, i = l.isObject(t);
716
+ if (i && l.isHTMLForm(t) && (t = new FormData(t)), l.isFormData(t))
717
+ return s ? JSON.stringify(ht(t)) : t;
718
+ if (l.isArrayBuffer(t) || l.isBuffer(t) || l.isStream(t) || l.isFile(t) || l.isBlob(t) || l.isReadableStream(t))
719
+ return t;
720
+ if (l.isArrayBufferView(t))
721
+ return t.buffer;
722
+ if (l.isURLSearchParams(t))
723
+ return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
724
+ let a;
725
+ if (i) {
726
+ if (r.indexOf("application/x-www-form-urlencoded") > -1)
727
+ return Dn(t, this.formSerializer).toString();
728
+ if ((a = l.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
729
+ const d = this.env && this.env.FormData;
730
+ return ge(
731
+ a ? { "files[]": t } : t,
732
+ d && new d(),
733
+ this.formSerializer
734
+ );
735
+ }
736
+ }
737
+ return i || s ? (n.setContentType("application/json", !1), qn(t)) : t;
738
+ }
739
+ ],
740
+ transformResponse: [
741
+ function(t) {
742
+ const n = this.transitional || ie.transitional, r = n && n.forcedJSONParsing, s = this.responseType === "json";
743
+ if (l.isResponse(t) || l.isReadableStream(t))
744
+ return t;
745
+ if (t && l.isString(t) && (r && !this.responseType || s)) {
746
+ const o = !(n && n.silentJSONParsing) && s;
747
+ try {
748
+ return JSON.parse(t, this.parseReviver);
749
+ } catch (a) {
750
+ if (o)
751
+ throw a.name === "SyntaxError" ? b.from(a, b.ERR_BAD_RESPONSE, this, null, this.response) : a;
752
+ }
753
+ }
754
+ return t;
755
+ }
756
+ ],
757
+ /**
758
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
759
+ * timeout is not created.
760
+ */
761
+ timeout: 0,
762
+ xsrfCookieName: "XSRF-TOKEN",
763
+ xsrfHeaderName: "X-XSRF-TOKEN",
764
+ maxContentLength: -1,
765
+ maxBodyLength: -1,
766
+ env: {
767
+ FormData: P.classes.FormData,
768
+ Blob: P.classes.Blob
769
+ },
770
+ validateStatus: function(t) {
771
+ return t >= 200 && t < 300;
772
+ },
773
+ headers: {
774
+ common: {
775
+ Accept: "application/json, text/plain, */*",
776
+ "Content-Type": void 0
777
+ }
778
+ }
779
+ };
780
+ l.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
781
+ ie.headers[e] = {};
782
+ });
783
+ const Mn = l.toObjectSet([
784
+ "age",
785
+ "authorization",
786
+ "content-length",
787
+ "content-type",
788
+ "etag",
789
+ "expires",
790
+ "from",
791
+ "host",
792
+ "if-modified-since",
793
+ "if-unmodified-since",
794
+ "last-modified",
795
+ "location",
796
+ "max-forwards",
797
+ "proxy-authorization",
798
+ "referer",
799
+ "retry-after",
800
+ "user-agent"
801
+ ]), $n = (e) => {
802
+ const t = {};
803
+ let n, r, s;
804
+ return e && e.split(`
805
+ `).forEach(function(o) {
806
+ s = o.indexOf(":"), n = o.substring(0, s).trim().toLowerCase(), r = o.substring(s + 1).trim(), !(!n || t[n] && Mn[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
807
+ }), t;
808
+ }, qe = Symbol("internals");
809
+ function te(e) {
810
+ return e && String(e).trim().toLowerCase();
811
+ }
812
+ function pe(e) {
813
+ return e === !1 || e == null ? e : l.isArray(e) ? e.map(pe) : String(e).replace(/[\r\n]+$/, "");
814
+ }
815
+ function Vn(e) {
816
+ const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
817
+ let r;
818
+ for (; r = n.exec(e); )
819
+ t[r[1]] = r[2];
820
+ return t;
821
+ }
822
+ const zn = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
823
+ function Se(e, t, n, r, s) {
824
+ if (l.isFunction(r))
825
+ return r.call(this, t, n);
826
+ if (s && (t = n), !!l.isString(t)) {
827
+ if (l.isString(r))
828
+ return t.indexOf(r) !== -1;
829
+ if (l.isRegExp(r))
830
+ return r.test(t);
831
+ }
832
+ }
833
+ function Wn(e) {
834
+ return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
835
+ }
836
+ function Jn(e, t) {
837
+ const n = l.toCamelCase(" " + t);
838
+ ["get", "set", "has"].forEach((r) => {
839
+ Object.defineProperty(e, r + n, {
840
+ value: function(s, i, o) {
841
+ return this[r].call(this, t, s, i, o);
842
+ },
843
+ configurable: !0
844
+ });
845
+ });
846
+ }
847
+ let U = class {
848
+ constructor(t) {
849
+ t && this.set(t);
850
+ }
851
+ set(t, n, r) {
852
+ const s = this;
853
+ function i(a, d, f) {
854
+ const u = te(d);
855
+ if (!u)
856
+ throw new Error("header name must be a non-empty string");
857
+ const m = l.findKey(s, u);
858
+ (!m || s[m] === void 0 || f === !0 || f === void 0 && s[m] !== !1) && (s[m || d] = pe(a));
859
+ }
860
+ const o = (a, d) => l.forEach(a, (f, u) => i(f, u, d));
861
+ if (l.isPlainObject(t) || t instanceof this.constructor)
862
+ o(t, n);
863
+ else if (l.isString(t) && (t = t.trim()) && !zn(t))
864
+ o($n(t), n);
865
+ else if (l.isObject(t) && l.isIterable(t)) {
866
+ let a = {}, d, f;
867
+ for (const u of t) {
868
+ if (!l.isArray(u))
869
+ throw TypeError("Object iterator must return a key-value pair");
870
+ a[f = u[0]] = (d = a[f]) ? l.isArray(d) ? [...d, u[1]] : [d, u[1]] : u[1];
871
+ }
872
+ o(a, n);
873
+ } else
874
+ t != null && i(n, t, r);
875
+ return this;
876
+ }
877
+ get(t, n) {
878
+ if (t = te(t), t) {
879
+ const r = l.findKey(this, t);
880
+ if (r) {
881
+ const s = this[r];
882
+ if (!n)
883
+ return s;
884
+ if (n === !0)
885
+ return Vn(s);
886
+ if (l.isFunction(n))
887
+ return n.call(this, s, r);
888
+ if (l.isRegExp(n))
889
+ return n.exec(s);
890
+ throw new TypeError("parser must be boolean|regexp|function");
891
+ }
892
+ }
893
+ }
894
+ has(t, n) {
895
+ if (t = te(t), t) {
896
+ const r = l.findKey(this, t);
897
+ return !!(r && this[r] !== void 0 && (!n || Se(this, this[r], r, n)));
898
+ }
899
+ return !1;
900
+ }
901
+ delete(t, n) {
902
+ const r = this;
903
+ let s = !1;
904
+ function i(o) {
905
+ if (o = te(o), o) {
906
+ const a = l.findKey(r, o);
907
+ a && (!n || Se(r, r[a], a, n)) && (delete r[a], s = !0);
908
+ }
909
+ }
910
+ return l.isArray(t) ? t.forEach(i) : i(t), s;
911
+ }
912
+ clear(t) {
913
+ const n = Object.keys(this);
914
+ let r = n.length, s = !1;
915
+ for (; r--; ) {
916
+ const i = n[r];
917
+ (!t || Se(this, this[i], i, t, !0)) && (delete this[i], s = !0);
918
+ }
919
+ return s;
920
+ }
921
+ normalize(t) {
922
+ const n = this, r = {};
923
+ return l.forEach(this, (s, i) => {
924
+ const o = l.findKey(r, i);
925
+ if (o) {
926
+ n[o] = pe(s), delete n[i];
927
+ return;
928
+ }
929
+ const a = t ? Wn(i) : String(i).trim();
930
+ a !== i && delete n[i], n[a] = pe(s), r[a] = !0;
931
+ }), this;
932
+ }
933
+ concat(...t) {
934
+ return this.constructor.concat(this, ...t);
935
+ }
936
+ toJSON(t) {
937
+ const n = /* @__PURE__ */ Object.create(null);
938
+ return l.forEach(this, (r, s) => {
939
+ r != null && r !== !1 && (n[s] = t && l.isArray(r) ? r.join(", ") : r);
940
+ }), n;
941
+ }
942
+ [Symbol.iterator]() {
943
+ return Object.entries(this.toJSON())[Symbol.iterator]();
944
+ }
945
+ toString() {
946
+ return Object.entries(this.toJSON()).map(([t, n]) => t + ": " + n).join(`
947
+ `);
948
+ }
949
+ getSetCookie() {
950
+ return this.get("set-cookie") || [];
951
+ }
952
+ get [Symbol.toStringTag]() {
953
+ return "AxiosHeaders";
954
+ }
955
+ static from(t) {
956
+ return t instanceof this ? t : new this(t);
957
+ }
958
+ static concat(t, ...n) {
959
+ const r = new this(t);
960
+ return n.forEach((s) => r.set(s)), r;
961
+ }
962
+ static accessor(t) {
963
+ const r = (this[qe] = this[qe] = {
964
+ accessors: {}
965
+ }).accessors, s = this.prototype;
966
+ function i(o) {
967
+ const a = te(o);
968
+ r[a] || (Jn(s, o), r[a] = !0);
969
+ }
970
+ return l.isArray(t) ? t.forEach(i) : i(t), this;
971
+ }
972
+ };
973
+ U.accessor([
974
+ "Content-Type",
975
+ "Content-Length",
976
+ "Accept",
977
+ "Accept-Encoding",
978
+ "User-Agent",
979
+ "Authorization"
980
+ ]);
981
+ l.reduceDescriptors(U.prototype, ({ value: e }, t) => {
982
+ let n = t[0].toUpperCase() + t.slice(1);
983
+ return {
984
+ get: () => e,
985
+ set(r) {
986
+ this[n] = r;
987
+ }
988
+ };
989
+ });
990
+ l.freezeMethods(U);
991
+ function Oe(e, t) {
992
+ const n = this || ie, r = t || n, s = U.from(r.headers);
993
+ let i = r.data;
994
+ return l.forEach(e, function(a) {
995
+ i = a.call(n, i, s.normalize(), t ? t.status : void 0);
996
+ }), s.normalize(), i;
997
+ }
998
+ function mt(e) {
999
+ return !!(e && e.__CANCEL__);
1000
+ }
1001
+ let ae = class extends b {
1002
+ /**
1003
+ * A `CanceledError` is an object that is thrown when an operation is canceled.
1004
+ *
1005
+ * @param {string=} message The message.
1006
+ * @param {Object=} config The config.
1007
+ * @param {Object=} request The request.
1008
+ *
1009
+ * @returns {CanceledError} The created error.
1010
+ */
1011
+ constructor(t, n, r) {
1012
+ super(t ?? "canceled", b.ERR_CANCELED, n, r), this.name = "CanceledError", this.__CANCEL__ = !0;
1013
+ }
1014
+ };
1015
+ function yt(e, t, n) {
1016
+ const r = n.config.validateStatus;
1017
+ !n.status || !r || r(n.status) ? e(n) : t(
1018
+ new b(
1019
+ "Request failed with status code " + n.status,
1020
+ [b.ERR_BAD_REQUEST, b.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
1021
+ n.config,
1022
+ n.request,
1023
+ n
1024
+ )
1025
+ );
1026
+ }
1027
+ function Kn(e) {
1028
+ const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
1029
+ return t && t[1] || "";
1030
+ }
1031
+ function Xn(e, t) {
1032
+ e = e || 10;
1033
+ const n = new Array(e), r = new Array(e);
1034
+ let s = 0, i = 0, o;
1035
+ return t = t !== void 0 ? t : 1e3, function(d) {
1036
+ const f = Date.now(), u = r[i];
1037
+ o || (o = f), n[s] = d, r[s] = f;
1038
+ let m = i, w = 0;
1039
+ for (; m !== s; )
1040
+ w += n[m++], m = m % e;
1041
+ if (s = (s + 1) % e, s === i && (i = (i + 1) % e), f - o < t)
1042
+ return;
1043
+ const g = u && f - u;
1044
+ return g ? Math.round(w * 1e3 / g) : void 0;
1045
+ };
1046
+ }
1047
+ function Gn(e, t) {
1048
+ let n = 0, r = 1e3 / t, s, i;
1049
+ const o = (f, u = Date.now()) => {
1050
+ n = u, s = null, i && (clearTimeout(i), i = null), e(...f);
1051
+ };
1052
+ return [(...f) => {
1053
+ const u = Date.now(), m = u - n;
1054
+ m >= r ? o(f, u) : (s = f, i || (i = setTimeout(() => {
1055
+ i = null, o(s);
1056
+ }, r - m)));
1057
+ }, () => s && o(s)];
1058
+ }
1059
+ const me = (e, t, n = 3) => {
1060
+ let r = 0;
1061
+ const s = Xn(50, 250);
1062
+ return Gn((i) => {
1063
+ const o = i.loaded, a = i.lengthComputable ? i.total : void 0, d = o - r, f = s(d), u = o <= a;
1064
+ r = o;
1065
+ const m = {
1066
+ loaded: o,
1067
+ total: a,
1068
+ progress: a ? o / a : void 0,
1069
+ bytes: d,
1070
+ rate: f || void 0,
1071
+ estimated: f && a && u ? (a - o) / f : void 0,
1072
+ event: i,
1073
+ lengthComputable: a != null,
1074
+ [t ? "download" : "upload"]: !0
1075
+ };
1076
+ e(m);
1077
+ }, n);
1078
+ }, Me = (e, t) => {
1079
+ const n = e != null;
1080
+ return [
1081
+ (r) => t[0]({
1082
+ lengthComputable: n,
1083
+ total: e,
1084
+ loaded: r
1085
+ }),
1086
+ t[1]
1087
+ ];
1088
+ }, $e = (e) => (...t) => l.asap(() => e(...t)), Qn = P.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, P.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
1089
+ new URL(P.origin),
1090
+ P.navigator && /(msie|trident)/i.test(P.navigator.userAgent)
1091
+ ) : () => !0, Zn = P.hasStandardBrowserEnv ? (
1092
+ // Standard browser envs support document.cookie
1093
+ {
1094
+ write(e, t, n, r, s, i, o) {
1095
+ if (typeof document > "u") return;
1096
+ const a = [`${e}=${encodeURIComponent(t)}`];
1097
+ l.isNumber(n) && a.push(`expires=${new Date(n).toUTCString()}`), l.isString(r) && a.push(`path=${r}`), l.isString(s) && a.push(`domain=${s}`), i === !0 && a.push("secure"), l.isString(o) && a.push(`SameSite=${o}`), document.cookie = a.join("; ");
1098
+ },
1099
+ read(e) {
1100
+ if (typeof document > "u") return null;
1101
+ const t = document.cookie.match(new RegExp("(?:^|; )" + e + "=([^;]*)"));
1102
+ return t ? decodeURIComponent(t[1]) : null;
1103
+ },
1104
+ remove(e) {
1105
+ this.write(e, "", Date.now() - 864e5, "/");
1106
+ }
1107
+ }
1108
+ ) : (
1109
+ // Non-standard browser env (web workers, react-native) lack needed support.
1110
+ {
1111
+ write() {
1112
+ },
1113
+ read() {
1114
+ return null;
1115
+ },
1116
+ remove() {
1117
+ }
1118
+ }
1119
+ );
1120
+ function Yn(e) {
1121
+ return typeof e != "string" ? !1 : /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
1122
+ }
1123
+ function er(e, t) {
1124
+ return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
1125
+ }
1126
+ function bt(e, t, n) {
1127
+ let r = !Yn(t);
1128
+ return e && (r || n == !1) ? er(e, t) : t;
1129
+ }
1130
+ const Ve = (e) => e instanceof U ? { ...e } : e;
1131
+ function K(e, t) {
1132
+ t = t || {};
1133
+ const n = {};
1134
+ function r(f, u, m, w) {
1135
+ return l.isPlainObject(f) && l.isPlainObject(u) ? l.merge.call({ caseless: w }, f, u) : l.isPlainObject(u) ? l.merge({}, u) : l.isArray(u) ? u.slice() : u;
1136
+ }
1137
+ function s(f, u, m, w) {
1138
+ if (l.isUndefined(u)) {
1139
+ if (!l.isUndefined(f))
1140
+ return r(void 0, f, m, w);
1141
+ } else return r(f, u, m, w);
1142
+ }
1143
+ function i(f, u) {
1144
+ if (!l.isUndefined(u))
1145
+ return r(void 0, u);
1146
+ }
1147
+ function o(f, u) {
1148
+ if (l.isUndefined(u)) {
1149
+ if (!l.isUndefined(f))
1150
+ return r(void 0, f);
1151
+ } else return r(void 0, u);
1152
+ }
1153
+ function a(f, u, m) {
1154
+ if (m in t)
1155
+ return r(f, u);
1156
+ if (m in e)
1157
+ return r(void 0, f);
1158
+ }
1159
+ const d = {
1160
+ url: i,
1161
+ method: i,
1162
+ data: i,
1163
+ baseURL: o,
1164
+ transformRequest: o,
1165
+ transformResponse: o,
1166
+ paramsSerializer: o,
1167
+ timeout: o,
1168
+ timeoutMessage: o,
1169
+ withCredentials: o,
1170
+ withXSRFToken: o,
1171
+ adapter: o,
1172
+ responseType: o,
1173
+ xsrfCookieName: o,
1174
+ xsrfHeaderName: o,
1175
+ onUploadProgress: o,
1176
+ onDownloadProgress: o,
1177
+ decompress: o,
1178
+ maxContentLength: o,
1179
+ maxBodyLength: o,
1180
+ beforeRedirect: o,
1181
+ transport: o,
1182
+ httpAgent: o,
1183
+ httpsAgent: o,
1184
+ cancelToken: o,
1185
+ socketPath: o,
1186
+ responseEncoding: o,
1187
+ validateStatus: a,
1188
+ headers: (f, u, m) => s(Ve(f), Ve(u), m, !0)
1189
+ };
1190
+ return l.forEach(Object.keys({ ...e, ...t }), function(u) {
1191
+ if (u === "__proto__" || u === "constructor" || u === "prototype") return;
1192
+ const m = l.hasOwnProp(d, u) ? d[u] : s, w = m(e[u], t[u], u);
1193
+ l.isUndefined(w) && m !== a || (n[u] = w);
1194
+ }), n;
1195
+ }
1196
+ const wt = (e) => {
1197
+ const t = K({}, e);
1198
+ let { data: n, withXSRFToken: r, xsrfHeaderName: s, xsrfCookieName: i, headers: o, auth: a } = t;
1199
+ if (t.headers = o = U.from(o), t.url = pt(
1200
+ bt(t.baseURL, t.url, t.allowAbsoluteUrls),
1201
+ e.params,
1202
+ e.paramsSerializer
1203
+ ), a && o.set(
1204
+ "Authorization",
1205
+ "Basic " + btoa(
1206
+ (a.username || "") + ":" + (a.password ? unescape(encodeURIComponent(a.password)) : "")
1207
+ )
1208
+ ), l.isFormData(n)) {
1209
+ if (P.hasStandardBrowserEnv || P.hasStandardBrowserWebWorkerEnv)
1210
+ o.setContentType(void 0);
1211
+ else if (l.isFunction(n.getHeaders)) {
1212
+ const d = n.getHeaders(), f = ["content-type", "content-length"];
1213
+ Object.entries(d).forEach(([u, m]) => {
1214
+ f.includes(u.toLowerCase()) && o.set(u, m);
1215
+ });
1216
+ }
1217
+ }
1218
+ if (P.hasStandardBrowserEnv && (r && l.isFunction(r) && (r = r(t)), r || r !== !1 && Qn(t.url))) {
1219
+ const d = s && i && Zn.read(i);
1220
+ d && o.set(s, d);
1221
+ }
1222
+ return t;
1223
+ }, tr = typeof XMLHttpRequest < "u", nr = tr && function(e) {
1224
+ return new Promise(function(n, r) {
1225
+ const s = wt(e);
1226
+ let i = s.data;
1227
+ const o = U.from(s.headers).normalize();
1228
+ let { responseType: a, onUploadProgress: d, onDownloadProgress: f } = s, u, m, w, g, c;
1229
+ function p() {
1230
+ g && g(), c && c(), s.cancelToken && s.cancelToken.unsubscribe(u), s.signal && s.signal.removeEventListener("abort", u);
1231
+ }
1232
+ let h = new XMLHttpRequest();
1233
+ h.open(s.method.toUpperCase(), s.url, !0), h.timeout = s.timeout;
1234
+ function R() {
1235
+ if (!h)
1236
+ return;
1237
+ const A = U.from(
1238
+ "getAllResponseHeaders" in h && h.getAllResponseHeaders()
1239
+ ), _ = {
1240
+ data: !a || a === "text" || a === "json" ? h.responseText : h.response,
1241
+ status: h.status,
1242
+ statusText: h.statusText,
1243
+ headers: A,
1244
+ config: e,
1245
+ request: h
1246
+ };
1247
+ yt(
1248
+ function(x) {
1249
+ n(x), p();
1250
+ },
1251
+ function(x) {
1252
+ r(x), p();
1253
+ },
1254
+ _
1255
+ ), h = null;
1256
+ }
1257
+ "onloadend" in h ? h.onloadend = R : h.onreadystatechange = function() {
1258
+ !h || h.readyState !== 4 || h.status === 0 && !(h.responseURL && h.responseURL.indexOf("file:") === 0) || setTimeout(R);
1259
+ }, h.onabort = function() {
1260
+ h && (r(new b("Request aborted", b.ECONNABORTED, e, h)), h = null);
1261
+ }, h.onerror = function(T) {
1262
+ const _ = T && T.message ? T.message : "Network Error", I = new b(_, b.ERR_NETWORK, e, h);
1263
+ I.event = T || null, r(I), h = null;
1264
+ }, h.ontimeout = function() {
1265
+ let T = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
1266
+ const _ = s.transitional || Ue;
1267
+ s.timeoutErrorMessage && (T = s.timeoutErrorMessage), r(
1268
+ new b(
1269
+ T,
1270
+ _.clarifyTimeoutError ? b.ETIMEDOUT : b.ECONNABORTED,
1271
+ e,
1272
+ h
1273
+ )
1274
+ ), h = null;
1275
+ }, i === void 0 && o.setContentType(null), "setRequestHeader" in h && l.forEach(o.toJSON(), function(T, _) {
1276
+ h.setRequestHeader(_, T);
1277
+ }), l.isUndefined(s.withCredentials) || (h.withCredentials = !!s.withCredentials), a && a !== "json" && (h.responseType = s.responseType), f && ([w, c] = me(f, !0), h.addEventListener("progress", w)), d && h.upload && ([m, g] = me(d), h.upload.addEventListener("progress", m), h.upload.addEventListener("loadend", g)), (s.cancelToken || s.signal) && (u = (A) => {
1278
+ h && (r(!A || A.type ? new ae(null, e, h) : A), h.abort(), h = null);
1279
+ }, s.cancelToken && s.cancelToken.subscribe(u), s.signal && (s.signal.aborted ? u() : s.signal.addEventListener("abort", u)));
1280
+ const k = Kn(s.url);
1281
+ if (k && P.protocols.indexOf(k) === -1) {
1282
+ r(
1283
+ new b(
1284
+ "Unsupported protocol " + k + ":",
1285
+ b.ERR_BAD_REQUEST,
1286
+ e
1287
+ )
1288
+ );
1289
+ return;
1290
+ }
1291
+ h.send(i || null);
1292
+ });
1293
+ }, rr = (e, t) => {
1294
+ const { length: n } = e = e ? e.filter(Boolean) : [];
1295
+ if (t || n) {
1296
+ let r = new AbortController(), s;
1297
+ const i = function(f) {
1298
+ if (!s) {
1299
+ s = !0, a();
1300
+ const u = f instanceof Error ? f : this.reason;
1301
+ r.abort(
1302
+ u instanceof b ? u : new ae(u instanceof Error ? u.message : u)
1303
+ );
1304
+ }
1305
+ };
1306
+ let o = t && setTimeout(() => {
1307
+ o = null, i(new b(`timeout of ${t}ms exceeded`, b.ETIMEDOUT));
1308
+ }, t);
1309
+ const a = () => {
1310
+ e && (o && clearTimeout(o), o = null, e.forEach((f) => {
1311
+ f.unsubscribe ? f.unsubscribe(i) : f.removeEventListener("abort", i);
1312
+ }), e = null);
1313
+ };
1314
+ e.forEach((f) => f.addEventListener("abort", i));
1315
+ const { signal: d } = r;
1316
+ return d.unsubscribe = () => l.asap(a), d;
1317
+ }
1318
+ }, sr = function* (e, t) {
1319
+ let n = e.byteLength;
1320
+ if (n < t) {
1321
+ yield e;
1322
+ return;
1323
+ }
1324
+ let r = 0, s;
1325
+ for (; r < n; )
1326
+ s = r + t, yield e.slice(r, s), r = s;
1327
+ }, or = async function* (e, t) {
1328
+ for await (const n of ir(e))
1329
+ yield* sr(n, t);
1330
+ }, ir = async function* (e) {
1331
+ if (e[Symbol.asyncIterator]) {
1332
+ yield* e;
1333
+ return;
1334
+ }
1335
+ const t = e.getReader();
1336
+ try {
1337
+ for (; ; ) {
1338
+ const { done: n, value: r } = await t.read();
1339
+ if (n)
1340
+ break;
1341
+ yield r;
1342
+ }
1343
+ } finally {
1344
+ await t.cancel();
1345
+ }
1346
+ }, ze = (e, t, n, r) => {
1347
+ const s = or(e, t);
1348
+ let i = 0, o, a = (d) => {
1349
+ o || (o = !0, r && r(d));
1350
+ };
1351
+ return new ReadableStream(
1352
+ {
1353
+ async pull(d) {
1354
+ try {
1355
+ const { done: f, value: u } = await s.next();
1356
+ if (f) {
1357
+ a(), d.close();
1358
+ return;
1359
+ }
1360
+ let m = u.byteLength;
1361
+ if (n) {
1362
+ let w = i += m;
1363
+ n(w);
1364
+ }
1365
+ d.enqueue(new Uint8Array(u));
1366
+ } catch (f) {
1367
+ throw a(f), f;
1368
+ }
1369
+ },
1370
+ cancel(d) {
1371
+ return a(d), s.return();
1372
+ }
1373
+ },
1374
+ {
1375
+ highWaterMark: 2
1376
+ }
1377
+ );
1378
+ }, We = 64 * 1024, { isFunction: ue } = l, ar = (({ Request: e, Response: t }) => ({
1379
+ Request: e,
1380
+ Response: t
1381
+ }))(l.global), { ReadableStream: Je, TextEncoder: Ke } = l.global, Xe = (e, ...t) => {
1382
+ try {
1383
+ return !!e(...t);
1384
+ } catch {
1385
+ return !1;
1386
+ }
1387
+ }, lr = (e) => {
1388
+ e = l.merge.call(
1389
+ {
1390
+ skipUndefined: !0
1391
+ },
1392
+ ar,
1393
+ e
1394
+ );
1395
+ const { fetch: t, Request: n, Response: r } = e, s = t ? ue(t) : typeof fetch == "function", i = ue(n), o = ue(r);
1396
+ if (!s)
1397
+ return !1;
1398
+ const a = s && ue(Je), d = s && (typeof Ke == "function" ? /* @__PURE__ */ ((c) => (p) => c.encode(p))(new Ke()) : async (c) => new Uint8Array(await new n(c).arrayBuffer())), f = i && a && Xe(() => {
1399
+ let c = !1;
1400
+ const p = new Je(), h = new n(P.origin, {
1401
+ body: p,
1402
+ method: "POST",
1403
+ get duplex() {
1404
+ return c = !0, "half";
1405
+ }
1406
+ }).headers.has("Content-Type");
1407
+ return p.cancel(), c && !h;
1408
+ }), u = o && a && Xe(() => l.isReadableStream(new r("").body)), m = {
1409
+ stream: u && ((c) => c.body)
1410
+ };
1411
+ s && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((c) => {
1412
+ !m[c] && (m[c] = (p, h) => {
1413
+ let R = p && p[c];
1414
+ if (R)
1415
+ return R.call(p);
1416
+ throw new b(
1417
+ `Response type '${c}' is not supported`,
1418
+ b.ERR_NOT_SUPPORT,
1419
+ h
1420
+ );
1421
+ });
1422
+ });
1423
+ const w = async (c) => {
1424
+ if (c == null)
1425
+ return 0;
1426
+ if (l.isBlob(c))
1427
+ return c.size;
1428
+ if (l.isSpecCompliantForm(c))
1429
+ return (await new n(P.origin, {
1430
+ method: "POST",
1431
+ body: c
1432
+ }).arrayBuffer()).byteLength;
1433
+ if (l.isArrayBufferView(c) || l.isArrayBuffer(c))
1434
+ return c.byteLength;
1435
+ if (l.isURLSearchParams(c) && (c = c + ""), l.isString(c))
1436
+ return (await d(c)).byteLength;
1437
+ }, g = async (c, p) => {
1438
+ const h = l.toFiniteNumber(c.getContentLength());
1439
+ return h ?? w(p);
1440
+ };
1441
+ return async (c) => {
1442
+ let {
1443
+ url: p,
1444
+ method: h,
1445
+ data: R,
1446
+ signal: k,
1447
+ cancelToken: A,
1448
+ timeout: T,
1449
+ onDownloadProgress: _,
1450
+ onUploadProgress: I,
1451
+ responseType: x,
1452
+ headers: q,
1453
+ withCredentials: M = "same-origin",
1454
+ fetchOptions: le
1455
+ } = wt(c), ee = t || fetch;
1456
+ x = x ? (x + "").toLowerCase() : "text";
1457
+ let X = rr(
1458
+ [k, A && A.toAbortSignal()],
1459
+ T
1460
+ ), $ = null;
1461
+ const v = X && X.unsubscribe && (() => {
1462
+ X.unsubscribe();
1463
+ });
1464
+ let ce;
1465
+ try {
1466
+ if (I && f && h !== "get" && h !== "head" && (ce = await g(q, R)) !== 0) {
1467
+ let C = new n(p, {
1468
+ method: "POST",
1469
+ body: R,
1470
+ duplex: "half"
1471
+ }), D;
1472
+ if (l.isFormData(R) && (D = C.headers.get("content-type")) && q.setContentType(D), C.body) {
1473
+ const [z, j] = Me(
1474
+ ce,
1475
+ me($e(I))
1476
+ );
1477
+ R = ze(C.body, We, z, j);
1478
+ }
1479
+ }
1480
+ l.isString(M) || (M = M ? "include" : "omit");
1481
+ const y = i && "credentials" in n.prototype, S = {
1482
+ ...le,
1483
+ signal: X,
1484
+ method: h.toUpperCase(),
1485
+ headers: q.normalize().toJSON(),
1486
+ body: R,
1487
+ duplex: "half",
1488
+ credentials: y ? M : void 0
1489
+ };
1490
+ $ = i && new n(p, S);
1491
+ let E = await (i ? ee($, le) : ee(p, S));
1492
+ const L = u && (x === "stream" || x === "response");
1493
+ if (u && (_ || L && v)) {
1494
+ const C = {};
1495
+ ["status", "statusText", "headers"].forEach((G) => {
1496
+ C[G] = E[G];
1497
+ });
1498
+ const D = l.toFiniteNumber(E.headers.get("content-length")), [z, j] = _ && Me(
1499
+ D,
1500
+ me($e(_), !0)
1501
+ ) || [];
1502
+ E = new r(
1503
+ ze(E.body, We, z, () => {
1504
+ j && j(), v && v();
1505
+ }),
1506
+ C
1507
+ );
1508
+ }
1509
+ x = x || "text";
1510
+ let V = await m[l.findKey(m, x) || "text"](
1511
+ E,
1512
+ c
1513
+ );
1514
+ return !L && v && v(), await new Promise((C, D) => {
1515
+ yt(C, D, {
1516
+ data: V,
1517
+ headers: U.from(E.headers),
1518
+ status: E.status,
1519
+ statusText: E.statusText,
1520
+ config: c,
1521
+ request: $
1522
+ });
1523
+ });
1524
+ } catch (y) {
1525
+ throw v && v(), y && y.name === "TypeError" && /Load failed|fetch/i.test(y.message) ? Object.assign(
1526
+ new b(
1527
+ "Network Error",
1528
+ b.ERR_NETWORK,
1529
+ c,
1530
+ $,
1531
+ y && y.response
1532
+ ),
1533
+ {
1534
+ cause: y.cause || y
1535
+ }
1536
+ ) : b.from(y, y && y.code, c, $, y && y.response);
1537
+ }
1538
+ };
1539
+ }, cr = /* @__PURE__ */ new Map(), gt = (e) => {
1540
+ let t = e && e.env || {};
1541
+ const { fetch: n, Request: r, Response: s } = t, i = [r, s, n];
1542
+ let o = i.length, a = o, d, f, u = cr;
1543
+ for (; a--; )
1544
+ d = i[a], f = u.get(d), f === void 0 && u.set(d, f = a ? /* @__PURE__ */ new Map() : lr(t)), u = f;
1545
+ return f;
1546
+ };
1547
+ gt();
1548
+ const Fe = {
1549
+ http: Cn,
1550
+ xhr: nr,
1551
+ fetch: {
1552
+ get: gt
1553
+ }
1554
+ };
1555
+ l.forEach(Fe, (e, t) => {
1556
+ if (e) {
1557
+ try {
1558
+ Object.defineProperty(e, "name", { value: t });
1559
+ } catch {
1560
+ }
1561
+ Object.defineProperty(e, "adapterName", { value: t });
1562
+ }
1563
+ });
1564
+ const Ge = (e) => `- ${e}`, ur = (e) => l.isFunction(e) || e === null || e === !1;
1565
+ function fr(e, t) {
1566
+ e = l.isArray(e) ? e : [e];
1567
+ const { length: n } = e;
1568
+ let r, s;
1569
+ const i = {};
1570
+ for (let o = 0; o < n; o++) {
1571
+ r = e[o];
1572
+ let a;
1573
+ if (s = r, !ur(r) && (s = Fe[(a = String(r)).toLowerCase()], s === void 0))
1574
+ throw new b(`Unknown adapter '${a}'`);
1575
+ if (s && (l.isFunction(s) || (s = s.get(t))))
1576
+ break;
1577
+ i[a || "#" + o] = s;
1578
+ }
1579
+ if (!s) {
1580
+ const o = Object.entries(i).map(
1581
+ ([d, f]) => `adapter ${d} ` + (f === !1 ? "is not supported by the environment" : "is not available in the build")
1582
+ );
1583
+ let a = n ? o.length > 1 ? `since :
1584
+ ` + o.map(Ge).join(`
1585
+ `) : " " + Ge(o[0]) : "as no adapter specified";
1586
+ throw new b(
1587
+ "There is no suitable adapter to dispatch the request " + a,
1588
+ "ERR_NOT_SUPPORT"
1589
+ );
1590
+ }
1591
+ return s;
1592
+ }
1593
+ const Et = {
1594
+ /**
1595
+ * Resolve an adapter from a list of adapter names or functions.
1596
+ * @type {Function}
1597
+ */
1598
+ getAdapter: fr,
1599
+ /**
1600
+ * Exposes all known adapters
1601
+ * @type {Object<string, Function|Object>}
1602
+ */
1603
+ adapters: Fe
1604
+ };
1605
+ function Ae(e) {
1606
+ if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
1607
+ throw new ae(null, e);
1608
+ }
1609
+ function Qe(e) {
1610
+ return Ae(e), e.headers = U.from(e.headers), e.data = Oe.call(e, e.transformRequest), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), Et.getAdapter(e.adapter || ie.adapter, e)(e).then(
1611
+ function(r) {
1612
+ return Ae(e), r.data = Oe.call(e, e.transformResponse, r), r.headers = U.from(r.headers), r;
1613
+ },
1614
+ function(r) {
1615
+ return mt(r) || (Ae(e), r && r.response && (r.response.data = Oe.call(
1616
+ e,
1617
+ e.transformResponse,
1618
+ r.response
1619
+ ), r.response.headers = U.from(r.response.headers))), Promise.reject(r);
1620
+ }
1621
+ );
1622
+ }
1623
+ const Rt = "1.14.0", Ee = {};
1624
+ ["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
1625
+ Ee[e] = function(r) {
1626
+ return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
1627
+ };
1628
+ });
1629
+ const Ze = {};
1630
+ Ee.transitional = function(t, n, r) {
1631
+ function s(i, o) {
1632
+ return "[Axios v" + Rt + "] Transitional option '" + i + "'" + o + (r ? ". " + r : "");
1633
+ }
1634
+ return (i, o, a) => {
1635
+ if (t === !1)
1636
+ throw new b(
1637
+ s(o, " has been removed" + (n ? " in " + n : "")),
1638
+ b.ERR_DEPRECATED
1639
+ );
1640
+ return n && !Ze[o] && (Ze[o] = !0, console.warn(
1641
+ s(
1642
+ o,
1643
+ " has been deprecated since v" + n + " and will be removed in the near future"
1644
+ )
1645
+ )), t ? t(i, o, a) : !0;
1646
+ };
1647
+ };
1648
+ Ee.spelling = function(t) {
1649
+ return (n, r) => (console.warn(`${r} is likely a misspelling of ${t}`), !0);
1650
+ };
1651
+ function dr(e, t, n) {
1652
+ if (typeof e != "object")
1653
+ throw new b("options must be an object", b.ERR_BAD_OPTION_VALUE);
1654
+ const r = Object.keys(e);
1655
+ let s = r.length;
1656
+ for (; s-- > 0; ) {
1657
+ const i = r[s], o = t[i];
1658
+ if (o) {
1659
+ const a = e[i], d = a === void 0 || o(a, i, e);
1660
+ if (d !== !0)
1661
+ throw new b(
1662
+ "option " + i + " must be " + d,
1663
+ b.ERR_BAD_OPTION_VALUE
1664
+ );
1665
+ continue;
1666
+ }
1667
+ if (n !== !0)
1668
+ throw new b("Unknown option " + i, b.ERR_BAD_OPTION);
1669
+ }
1670
+ }
1671
+ const he = {
1672
+ assertOptions: dr,
1673
+ validators: Ee
1674
+ }, F = he.validators;
1675
+ let J = class {
1676
+ constructor(t) {
1677
+ this.defaults = t || {}, this.interceptors = {
1678
+ request: new He(),
1679
+ response: new He()
1680
+ };
1681
+ }
1682
+ /**
1683
+ * Dispatch a request
1684
+ *
1685
+ * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
1686
+ * @param {?Object} config
1687
+ *
1688
+ * @returns {Promise} The Promise to be fulfilled
1689
+ */
1690
+ async request(t, n) {
1691
+ try {
1692
+ return await this._request(t, n);
1693
+ } catch (r) {
1694
+ if (r instanceof Error) {
1695
+ let s = {};
1696
+ Error.captureStackTrace ? Error.captureStackTrace(s) : s = new Error();
1697
+ const i = s.stack ? s.stack.replace(/^.+\n/, "") : "";
1698
+ try {
1699
+ r.stack ? i && !String(r.stack).endsWith(i.replace(/^.+\n.+\n/, "")) && (r.stack += `
1700
+ ` + i) : r.stack = i;
1701
+ } catch {
1702
+ }
1703
+ }
1704
+ throw r;
1705
+ }
1706
+ }
1707
+ _request(t, n) {
1708
+ typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = K(this.defaults, n);
1709
+ const { transitional: r, paramsSerializer: s, headers: i } = n;
1710
+ r !== void 0 && he.assertOptions(
1711
+ r,
1712
+ {
1713
+ silentJSONParsing: F.transitional(F.boolean),
1714
+ forcedJSONParsing: F.transitional(F.boolean),
1715
+ clarifyTimeoutError: F.transitional(F.boolean),
1716
+ legacyInterceptorReqResOrdering: F.transitional(F.boolean)
1717
+ },
1718
+ !1
1719
+ ), s != null && (l.isFunction(s) ? n.paramsSerializer = {
1720
+ serialize: s
1721
+ } : he.assertOptions(
1722
+ s,
1723
+ {
1724
+ encode: F.function,
1725
+ serialize: F.function
1726
+ },
1727
+ !0
1728
+ )), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), he.assertOptions(
1729
+ n,
1730
+ {
1731
+ baseUrl: F.spelling("baseURL"),
1732
+ withXsrfToken: F.spelling("withXSRFToken")
1733
+ },
1734
+ !0
1735
+ ), n.method = (n.method || this.defaults.method || "get").toLowerCase();
1736
+ let o = i && l.merge(i.common, i[n.method]);
1737
+ i && l.forEach(["delete", "get", "head", "post", "put", "patch", "common"], (c) => {
1738
+ delete i[c];
1739
+ }), n.headers = U.concat(o, i);
1740
+ const a = [];
1741
+ let d = !0;
1742
+ this.interceptors.request.forEach(function(p) {
1743
+ if (typeof p.runWhen == "function" && p.runWhen(n) === !1)
1744
+ return;
1745
+ d = d && p.synchronous;
1746
+ const h = n.transitional || Ue;
1747
+ h && h.legacyInterceptorReqResOrdering ? a.unshift(p.fulfilled, p.rejected) : a.push(p.fulfilled, p.rejected);
1748
+ });
1749
+ const f = [];
1750
+ this.interceptors.response.forEach(function(p) {
1751
+ f.push(p.fulfilled, p.rejected);
1752
+ });
1753
+ let u, m = 0, w;
1754
+ if (!d) {
1755
+ const c = [Qe.bind(this), void 0];
1756
+ for (c.unshift(...a), c.push(...f), w = c.length, u = Promise.resolve(n); m < w; )
1757
+ u = u.then(c[m++], c[m++]);
1758
+ return u;
1759
+ }
1760
+ w = a.length;
1761
+ let g = n;
1762
+ for (; m < w; ) {
1763
+ const c = a[m++], p = a[m++];
1764
+ try {
1765
+ g = c(g);
1766
+ } catch (h) {
1767
+ p.call(this, h);
1768
+ break;
1769
+ }
1770
+ }
1771
+ try {
1772
+ u = Qe.call(this, g);
1773
+ } catch (c) {
1774
+ return Promise.reject(c);
1775
+ }
1776
+ for (m = 0, w = f.length; m < w; )
1777
+ u = u.then(f[m++], f[m++]);
1778
+ return u;
1779
+ }
1780
+ getUri(t) {
1781
+ t = K(this.defaults, t);
1782
+ const n = bt(t.baseURL, t.url, t.allowAbsoluteUrls);
1783
+ return pt(n, t.params, t.paramsSerializer);
1784
+ }
1785
+ };
1786
+ l.forEach(["delete", "get", "head", "options"], function(t) {
1787
+ J.prototype[t] = function(n, r) {
1788
+ return this.request(
1789
+ K(r || {}, {
1790
+ method: t,
1791
+ url: n,
1792
+ data: (r || {}).data
1793
+ })
1794
+ );
1795
+ };
1796
+ });
1797
+ l.forEach(["post", "put", "patch"], function(t) {
1798
+ function n(r) {
1799
+ return function(i, o, a) {
1800
+ return this.request(
1801
+ K(a || {}, {
1802
+ method: t,
1803
+ headers: r ? {
1804
+ "Content-Type": "multipart/form-data"
1805
+ } : {},
1806
+ url: i,
1807
+ data: o
1808
+ })
1809
+ );
1810
+ };
1811
+ }
1812
+ J.prototype[t] = n(), J.prototype[t + "Form"] = n(!0);
1813
+ });
1814
+ let pr = class St {
1815
+ constructor(t) {
1816
+ if (typeof t != "function")
1817
+ throw new TypeError("executor must be a function.");
1818
+ let n;
1819
+ this.promise = new Promise(function(i) {
1820
+ n = i;
1821
+ });
1822
+ const r = this;
1823
+ this.promise.then((s) => {
1824
+ if (!r._listeners) return;
1825
+ let i = r._listeners.length;
1826
+ for (; i-- > 0; )
1827
+ r._listeners[i](s);
1828
+ r._listeners = null;
1829
+ }), this.promise.then = (s) => {
1830
+ let i;
1831
+ const o = new Promise((a) => {
1832
+ r.subscribe(a), i = a;
1833
+ }).then(s);
1834
+ return o.cancel = function() {
1835
+ r.unsubscribe(i);
1836
+ }, o;
1837
+ }, t(function(i, o, a) {
1838
+ r.reason || (r.reason = new ae(i, o, a), n(r.reason));
1839
+ });
1840
+ }
1841
+ /**
1842
+ * Throws a `CanceledError` if cancellation has been requested.
1843
+ */
1844
+ throwIfRequested() {
1845
+ if (this.reason)
1846
+ throw this.reason;
1847
+ }
1848
+ /**
1849
+ * Subscribe to the cancel signal
1850
+ */
1851
+ subscribe(t) {
1852
+ if (this.reason) {
1853
+ t(this.reason);
1854
+ return;
1855
+ }
1856
+ this._listeners ? this._listeners.push(t) : this._listeners = [t];
1857
+ }
1858
+ /**
1859
+ * Unsubscribe from the cancel signal
1860
+ */
1861
+ unsubscribe(t) {
1862
+ if (!this._listeners)
1863
+ return;
1864
+ const n = this._listeners.indexOf(t);
1865
+ n !== -1 && this._listeners.splice(n, 1);
1866
+ }
1867
+ toAbortSignal() {
1868
+ const t = new AbortController(), n = (r) => {
1869
+ t.abort(r);
1870
+ };
1871
+ return this.subscribe(n), t.signal.unsubscribe = () => this.unsubscribe(n), t.signal;
1872
+ }
1873
+ /**
1874
+ * Returns an object that contains a new `CancelToken` and a function that, when called,
1875
+ * cancels the `CancelToken`.
1876
+ */
1877
+ static source() {
1878
+ let t;
1879
+ return {
1880
+ token: new St(function(s) {
1881
+ t = s;
1882
+ }),
1883
+ cancel: t
1884
+ };
1885
+ }
1886
+ };
1887
+ function hr(e) {
1888
+ return function(n) {
1889
+ return e.apply(null, n);
1890
+ };
1891
+ }
1892
+ function mr(e) {
1893
+ return l.isObject(e) && e.isAxiosError === !0;
1894
+ }
1895
+ const xe = {
1896
+ Continue: 100,
1897
+ SwitchingProtocols: 101,
1898
+ Processing: 102,
1899
+ EarlyHints: 103,
1900
+ Ok: 200,
1901
+ Created: 201,
1902
+ Accepted: 202,
1903
+ NonAuthoritativeInformation: 203,
1904
+ NoContent: 204,
1905
+ ResetContent: 205,
1906
+ PartialContent: 206,
1907
+ MultiStatus: 207,
1908
+ AlreadyReported: 208,
1909
+ ImUsed: 226,
1910
+ MultipleChoices: 300,
1911
+ MovedPermanently: 301,
1912
+ Found: 302,
1913
+ SeeOther: 303,
1914
+ NotModified: 304,
1915
+ UseProxy: 305,
1916
+ Unused: 306,
1917
+ TemporaryRedirect: 307,
1918
+ PermanentRedirect: 308,
1919
+ BadRequest: 400,
1920
+ Unauthorized: 401,
1921
+ PaymentRequired: 402,
1922
+ Forbidden: 403,
1923
+ NotFound: 404,
1924
+ MethodNotAllowed: 405,
1925
+ NotAcceptable: 406,
1926
+ ProxyAuthenticationRequired: 407,
1927
+ RequestTimeout: 408,
1928
+ Conflict: 409,
1929
+ Gone: 410,
1930
+ LengthRequired: 411,
1931
+ PreconditionFailed: 412,
1932
+ PayloadTooLarge: 413,
1933
+ UriTooLong: 414,
1934
+ UnsupportedMediaType: 415,
1935
+ RangeNotSatisfiable: 416,
1936
+ ExpectationFailed: 417,
1937
+ ImATeapot: 418,
1938
+ MisdirectedRequest: 421,
1939
+ UnprocessableEntity: 422,
1940
+ Locked: 423,
1941
+ FailedDependency: 424,
1942
+ TooEarly: 425,
1943
+ UpgradeRequired: 426,
1944
+ PreconditionRequired: 428,
1945
+ TooManyRequests: 429,
1946
+ RequestHeaderFieldsTooLarge: 431,
1947
+ UnavailableForLegalReasons: 451,
1948
+ InternalServerError: 500,
1949
+ NotImplemented: 501,
1950
+ BadGateway: 502,
1951
+ ServiceUnavailable: 503,
1952
+ GatewayTimeout: 504,
1953
+ HttpVersionNotSupported: 505,
1954
+ VariantAlsoNegotiates: 506,
1955
+ InsufficientStorage: 507,
1956
+ LoopDetected: 508,
1957
+ NotExtended: 510,
1958
+ NetworkAuthenticationRequired: 511,
1959
+ WebServerIsDown: 521,
1960
+ ConnectionTimedOut: 522,
1961
+ OriginIsUnreachable: 523,
1962
+ TimeoutOccurred: 524,
1963
+ SslHandshakeFailed: 525,
1964
+ InvalidSslCertificate: 526
1965
+ };
1966
+ Object.entries(xe).forEach(([e, t]) => {
1967
+ xe[t] = e;
1968
+ });
1969
+ function Ot(e) {
1970
+ const t = new J(e), n = nt(J.prototype.request, t);
1971
+ return l.extend(n, J.prototype, t, { allOwnKeys: !0 }), l.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(s) {
1972
+ return Ot(K(e, s));
1973
+ }, n;
1974
+ }
1975
+ const O = Ot(ie);
1976
+ O.Axios = J;
1977
+ O.CanceledError = ae;
1978
+ O.CancelToken = pr;
1979
+ O.isCancel = mt;
1980
+ O.VERSION = Rt;
1981
+ O.toFormData = ge;
1982
+ O.AxiosError = b;
1983
+ O.Cancel = O.CanceledError;
1984
+ O.all = function(t) {
1985
+ return Promise.all(t);
1986
+ };
1987
+ O.spread = hr;
1988
+ O.isAxiosError = mr;
1989
+ O.mergeConfig = K;
1990
+ O.AxiosHeaders = U;
1991
+ O.formToJSON = (e) => ht(l.isHTMLForm(e) ? new FormData(e) : e);
1992
+ O.getAdapter = Et.getAdapter;
1993
+ O.HttpStatusCode = xe;
1994
+ O.default = O;
1995
+ const {
1996
+ Axios: Sr,
1997
+ AxiosError: Or,
1998
+ CanceledError: Ar,
1999
+ isCancel: Tr,
2000
+ CancelToken: Cr,
2001
+ VERSION: Pr,
2002
+ all: xr,
2003
+ Cancel: _r,
2004
+ isAxiosError: Nr,
2005
+ spread: Ur,
2006
+ toFormData: kr,
2007
+ AxiosHeaders: Fr,
2008
+ HttpStatusCode: vr,
2009
+ formToJSON: Br,
2010
+ getAdapter: Ir,
2011
+ mergeConfig: Lr
2012
+ } = O, At = O.create({
2013
+ baseURL: "http://t1.lingganai.cyou:90",
2014
+ // Assuming backend runs on 8080
2015
+ timeout: 1e4
2016
+ });
2017
+ At.interceptors.response.use(
2018
+ (e) => {
2019
+ const t = e.data;
2020
+ return t.code === 200 ? t.data : Promise.reject(new Error(t.message || "Error"));
2021
+ },
2022
+ (e) => Promise.reject(e)
2023
+ );
2024
+ const fe = (e, t) => At.post("/api/screen/control", {
2025
+ screenClientId: e,
2026
+ action: t
2027
+ }), yr = /* @__PURE__ */ Ye({
134
2028
  __name: "VirtualHumanEventAdapter",
135
2029
  props: {
136
2030
  // 屏幕客户端ID
@@ -145,157 +2039,163 @@ const Z = ["src", "muted"], ee = /* @__PURE__ */ $({
145
2039
  }
146
2040
  },
147
2041
  emits: ["eventNotifaction", "controlEvent", "end", "pause", "connected", "error", "playComplete"],
148
- setup(c, { emit: S }) {
149
- const n = c, a = S, s = b(null), P = b(!1);
150
- let e = null, p = 0, d = !1, v = 0, y = !1;
151
- const w = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Map();
152
- let i = null;
153
- const u = (t) => {
154
- if (typeof t == "number" && Number.isFinite(t)) return t;
155
- if (typeof t == "string" && t.trim() !== "") {
156
- const o = Number(t);
157
- if (Number.isFinite(o)) return o;
2042
+ setup(e, { expose: t, emit: n }) {
2043
+ const r = e, s = n, i = Q(null), o = Q(!1);
2044
+ let a = null, d = 0, f = !1, u = 0, m = !1;
2045
+ const w = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Map();
2046
+ let p = null;
2047
+ t({
2048
+ play: () => o.value ? fe(r.screenClientId, "play").then(() => Promise.resolve(!0)).catch(() => Promise.reject(!1)) : Promise.reject(!1),
2049
+ pause: () => o.value ? fe(r.screenClientId, "pause").then(() => Promise.resolve(!0)).catch(() => Promise.reject(!1)) : Promise.reject(!1),
2050
+ resume: () => o.value ? fe(r.screenClientId, "resume").then(() => Promise.resolve(!0)).catch(() => Promise.reject(!1)) : Promise.reject(!1),
2051
+ stop: () => o.value ? fe(r.screenClientId, "stop").then(() => Promise.resolve(!0)).catch(() => Promise.reject(!1)) : Promise.reject(!1)
2052
+ });
2053
+ const T = (y) => {
2054
+ if (typeof y == "number" && Number.isFinite(y)) return y;
2055
+ if (typeof y == "string" && y.trim() !== "") {
2056
+ const S = Number(y);
2057
+ if (Number.isFinite(S)) return S;
158
2058
  }
159
2059
  return null;
160
2060
  }, _ = () => {
161
- i !== null && (window.clearInterval(i), i = null);
162
- }, B = () => {
163
- _(), w.clear(), h.clear(), l.clear();
164
- }, N = () => {
165
- for (const [t] of w)
166
- if (!h.has(t) && l.has(t)) return !0;
167
- return !1;
2061
+ p !== null && (window.clearInterval(p), p = null);
168
2062
  }, I = () => {
169
- if (!(!e || e.state !== "running")) {
170
- for (const [t, o] of l) {
171
- if (h.has(t)) continue;
172
- const r = w.get(t);
173
- r && e.currentTime + 5e-3 >= o && (h.add(t), w.delete(t), a("eventNotifaction", r));
2063
+ _(), w.clear(), g.clear(), c.clear();
2064
+ }, x = () => {
2065
+ for (const [y] of w)
2066
+ if (!g.has(y) && c.has(y)) return !0;
2067
+ return !1;
2068
+ }, q = () => {
2069
+ if (!(!a || a.state !== "running")) {
2070
+ for (const [y, S] of c) {
2071
+ if (g.has(y)) continue;
2072
+ const E = w.get(y);
2073
+ E && a.currentTime + 5e-3 >= S && (g.add(y), w.delete(y), s("eventNotifaction", E));
174
2074
  }
175
- N() || _();
2075
+ x() || _();
176
2076
  }
177
- }, x = () => {
178
- i === null && N() && (i = window.setInterval(() => {
179
- I();
2077
+ }, M = () => {
2078
+ p === null && x() && (p = window.setInterval(() => {
2079
+ q();
180
2080
  }, 30));
181
- }, q = () => {
182
- e || (e = new (window.AudioContext || window.webkitAudioContext)({
2081
+ }, le = () => {
2082
+ a || (a = new (window.AudioContext || window.webkitAudioContext)({
183
2083
  sampleRate: 24e3
184
- })), e.state === "suspended" && !y && e.resume();
185
- }, T = () => {
186
- d && v === 0 && (a("playComplete", n.screenClientId), d = !1);
187
- }, z = (t, o) => {
188
- if (q(), !!e)
2084
+ })), a.state === "suspended" && !m && a.resume();
2085
+ }, ee = () => {
2086
+ f && u === 0 && (s("playComplete", r.screenClientId), f = !1);
2087
+ }, X = (y, S) => {
2088
+ if (le(), !!a)
189
2089
  try {
190
- const r = window.atob(t), g = r.length, k = new Uint8Array(g);
191
- for (let f = 0; f < g; f++)
192
- k[f] = r.charCodeAt(f);
193
- const m = new Int16Array(k.buffer), A = new Float32Array(m.length);
194
- for (let f = 0; f < m.length; f++)
195
- A[f] = m[f] / 32768;
196
- const U = e.createBuffer(1, A.length, 24e3);
197
- U.getChannelData(0).set(A);
198
- const E = e.createBufferSource();
199
- E.buffer = U, E.connect(e.destination);
200
- const H = p < e.currentTime ? e.currentTime : p;
201
- o !== null && !l.has(o) && (l.set(o, H), I(), x()), E.start(H), p = H + U.duration, v++, E.onended = () => {
202
- v--, T();
2090
+ const E = window.atob(y), L = E.length, V = new Uint8Array(L);
2091
+ for (let H = 0; H < L; H++)
2092
+ V[H] = E.charCodeAt(H);
2093
+ const C = new Int16Array(V.buffer), D = new Float32Array(C.length);
2094
+ for (let H = 0; H < C.length; H++)
2095
+ D[H] = C[H] / 32768;
2096
+ const z = a.createBuffer(1, D.length, 24e3);
2097
+ z.getChannelData(0).set(D);
2098
+ const j = a.createBufferSource();
2099
+ j.buffer = z, j.connect(a.destination);
2100
+ const G = d < a.currentTime ? a.currentTime : d;
2101
+ S !== null && !c.has(S) && (c.set(S, G), q(), M()), j.start(G), d = G + z.duration, u++, j.onended = () => {
2102
+ u--, ee();
203
2103
  };
204
- } catch (r) {
205
- console.error("[VirtualHumanEventAdapter] Failed to decode and play audio:", r);
2104
+ } catch (E) {
2105
+ console.error("[VirtualHumanEventAdapter] Failed to decode and play audio:", E);
206
2106
  }
207
- }, D = (t) => {
208
- switch (t) {
2107
+ }, $ = (y) => {
2108
+ switch (y) {
209
2109
  case "play":
210
- B(), d = !1, v = 0, p = 0, y = !1, e && e.state === "suspended" && e.resume();
2110
+ I(), f = !1, u = 0, d = 0, m = !1, a && a.state === "suspended" && a.resume();
211
2111
  break;
212
2112
  case "resume":
213
- y = !1, e && e.state === "suspended" && e.resume(), I(), x();
2113
+ m = !1, a && a.state === "suspended" && a.resume(), q(), M();
214
2114
  break;
215
2115
  case "pause":
216
- y = !0, e && e.state === "running" && e.suspend();
2116
+ m = !0, a && a.state === "running" && a.suspend();
217
2117
  break;
218
2118
  case "stop":
219
- B(), y = !1, e && (e.close(), e = null), p = 0, d = !1, v = 0;
2119
+ I(), m = !1, a && (a.close(), a = null), d = 0, f = !1, u = 0;
220
2120
  break;
221
2121
  case "tts_complete":
222
- d = !0, T();
2122
+ f = !0, ee();
223
2123
  break;
224
2124
  default:
225
- console.warn(`[VirtualHumanEventAdapter] Unknown control action: ${t}`);
2125
+ console.warn(`[VirtualHumanEventAdapter] Unknown control action: ${y}`);
226
2126
  }
227
- }, V = () => {
228
- s.value && s.value.close();
2127
+ }, v = () => {
2128
+ i.value && i.value.close();
229
2129
  try {
230
- const t = new URL(n.wsUrl);
231
- t.searchParams.append("sessionId", n.screenClientId + "-event"), s.value = new WebSocket(t.toString()), s.value.onopen = () => {
232
- P.value = !0, a("connected"), console.log(`[VirtualHumanEventAdapter] Connected to ${n.wsUrl} for session ${n.screenClientId}-event`);
233
- }, s.value.onmessage = (o) => {
2130
+ const y = new URL(r.wsUrl);
2131
+ y.searchParams.append("sessionId", r.screenClientId + "-event"), i.value = new WebSocket(y.toString()), i.value.onopen = () => {
2132
+ o.value = !0, s("connected"), console.log(`[VirtualHumanEventAdapter] Connected to ${r.wsUrl} for session ${r.screenClientId}-event`);
2133
+ }, i.value.onmessage = (S) => {
234
2134
  try {
235
- const r = JSON.parse(o.data);
236
- O(r);
237
- } catch (r) {
238
- console.error("[VirtualHumanEventAdapter] Failed to parse message:", o.data, r);
2135
+ const E = JSON.parse(S.data);
2136
+ ce(E);
2137
+ } catch (E) {
2138
+ console.error("[VirtualHumanEventAdapter] Failed to parse message:", S.data, E);
239
2139
  }
240
- }, s.value.onerror = (o) => {
241
- console.error("[VirtualHumanEventAdapter] WebSocket error:", o), a("error", o);
242
- }, s.value.onclose = () => {
243
- P.value = !1, console.log("[VirtualHumanEventAdapter] WebSocket disconnected");
2140
+ }, i.value.onerror = (S) => {
2141
+ console.error("[VirtualHumanEventAdapter] WebSocket error:", S), s("error", S);
2142
+ }, i.value.onclose = () => {
2143
+ o.value = !1, console.log("[VirtualHumanEventAdapter] WebSocket disconnected");
244
2144
  };
245
- } catch (t) {
246
- console.error("[VirtualHumanEventAdapter] Failed to initialize WebSocket:", t), a("error", t);
2145
+ } catch (y) {
2146
+ console.error("[VirtualHumanEventAdapter] Failed to initialize WebSocket:", y), s("error", y);
247
2147
  }
248
- }, O = (t) => {
249
- const { type: o, payload: r, action: g } = t;
250
- switch (o) {
2148
+ }, ce = (y) => {
2149
+ const { type: S, payload: E, action: L } = y;
2150
+ switch (S) {
251
2151
  case "audio":
252
- const k = (r == null ? void 0 : r.data) || t.data;
253
- if (k) {
254
- const m = u((r == null ? void 0 : r.index) ?? t.index);
255
- z(k, m);
2152
+ const V = (E == null ? void 0 : E.data) || y.data;
2153
+ if (V) {
2154
+ const C = T((E == null ? void 0 : E.index) ?? y.index);
2155
+ X(V, C);
256
2156
  }
257
2157
  break;
258
2158
  case "send_event":
259
- if (t.event) {
260
- console.log("adapter send_event:", t);
261
- const m = u(t.index);
262
- if (m === null) {
263
- a("eventNotifaction", t);
2159
+ if (y.event) {
2160
+ console.log("adapter send_event:", y);
2161
+ const C = T(y.index);
2162
+ if (C === null) {
2163
+ s("eventNotifaction", y);
264
2164
  break;
265
2165
  }
266
- w.set(m, t), I(), x();
2166
+ w.set(C, y), q(), M();
267
2167
  }
268
2168
  break;
269
2169
  case "control":
270
- g && (console.log("adapter control:", g), a("controlEvent", g), D(g));
2170
+ L && (console.log("adapter control:", L), s("controlEvent", L), $(L));
271
2171
  break;
272
2172
  case "end":
273
- console.log("adapter end:", r), a("end", r);
2173
+ console.log("adapter end:", E), s("end", E);
274
2174
  break;
275
2175
  case "pause":
276
- console.log("adapter pause:", r), a("pause", r);
2176
+ console.log("adapter pause:", E), s("pause", E);
277
2177
  break;
278
2178
  default:
279
- console.warn(`[VirtualHumanEventAdapter] Unknown message type: ${o}`);
2179
+ console.warn(`[VirtualHumanEventAdapter] Unknown message type: ${S}`);
280
2180
  }
281
2181
  };
282
- return C(() => n.screenClientId, () => {
283
- n.screenClientId && n.wsUrl && V();
284
- }), C(() => n.wsUrl, () => {
285
- n.screenClientId && n.wsUrl && V();
286
- }), M(() => {
287
- n.screenClientId && n.wsUrl && V();
288
- }), R(() => {
289
- s.value && s.value.close(), e && e.close();
290
- }), (t, o) => Y(t.$slots, "default");
291
- }
292
- }), re = (c) => {
293
- c.component("VirtualHumanPersona", ne), c.component("VirtualHumanEventAdapter", ae);
294
- }, oe = {
295
- install: re
2182
+ return ne(() => r.screenClientId, () => {
2183
+ r.screenClientId && r.wsUrl && v();
2184
+ }), ne(() => r.wsUrl, () => {
2185
+ r.screenClientId && r.wsUrl && v();
2186
+ }), et(() => {
2187
+ r.screenClientId && r.wsUrl && v();
2188
+ }), tt(() => {
2189
+ i.value && i.value.close(), a && a.close();
2190
+ }), (y, S) => kt(y.$slots, "default");
2191
+ }
2192
+ }), br = (e) => {
2193
+ e.component("VirtualHumanPersona", It), e.component("VirtualHumanEventAdapter", yr);
2194
+ }, Dr = {
2195
+ install: br
296
2196
  };
297
2197
  export {
298
- ae as VirtualHumanEventAdapter,
299
- ne as VirtualHumanPersona,
300
- oe as default
2198
+ yr as VirtualHumanEventAdapter,
2199
+ It as VirtualHumanPersona,
2200
+ Dr as default
301
2201
  };