media-av 0.0.18 → 0.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,8 +5,8 @@
5
5
  3. 支持软电话,实现音视频呼叫
6
6
  4. 支持音视频全双工半/双工呼叫
7
7
 
8
- 2024/03/07 0.0.18
9
- 1. 新增广播喊话
8
+ 2024/03/07 0.0.19
9
+ 1. 新增桌面共享
10
10
 
11
11
  2024/01/29 0.0.15
12
12
  1. 新增app代理, 支持音视频全双工/半双工呼叫
package/dist/mediaAV.js CHANGED
@@ -1782,7 +1782,7 @@ const jo = {}, Jo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
1782
1782
  __proto__: null,
1783
1783
  default: jo
1784
1784
  }, Symbol.toStringTag, { value: "Module" })), Ko = /* @__PURE__ */ wo(Jo);
1785
- var Ct = typeof Map == "function" && Map.prototype, Xe = Object.getOwnPropertyDescriptor && Ct ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, ke = Ct && Xe && typeof Xe.get == "function" ? Xe.get : null, Kt = Ct && Map.prototype.forEach, It = typeof Set == "function" && Set.prototype, Ye = Object.getOwnPropertyDescriptor && It ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, Be = It && Ye && typeof Ye.get == "function" ? Ye.get : null, Qt = It && Set.prototype.forEach, Qo = typeof WeakMap == "function" && WeakMap.prototype, Se = Qo ? WeakMap.prototype.has : null, Xo = typeof WeakSet == "function" && WeakSet.prototype, we = Xo ? WeakSet.prototype.has : null, Yo = typeof WeakRef == "function" && WeakRef.prototype, Xt = Yo ? WeakRef.prototype.deref : null, Zo = Boolean.prototype.valueOf, ei = Object.prototype.toString, ti = Function.prototype.toString, ri = String.prototype.match, Tt = String.prototype.slice, j = String.prototype.replace, ni = String.prototype.toUpperCase, Yt = String.prototype.toLowerCase, xr = RegExp.prototype.test, Zt = Array.prototype.concat, U = Array.prototype.join, oi = Array.prototype.slice, er = Math.floor, lt = typeof BigInt == "function" ? BigInt.prototype.valueOf : null, Ze = Object.getOwnPropertySymbols, ut = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Symbol.prototype.toString : null, ue = typeof Symbol == "function" && typeof Symbol.iterator == "object", P = typeof Symbol == "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === ue || !0) ? Symbol.toStringTag : null, Ur = Object.prototype.propertyIsEnumerable, tr = (typeof Reflect == "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(t) {
1785
+ var Ct = typeof Map == "function" && Map.prototype, Xe = Object.getOwnPropertyDescriptor && Ct ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, ke = Ct && Xe && typeof Xe.get == "function" ? Xe.get : null, Kt = Ct && Map.prototype.forEach, It = typeof Set == "function" && Set.prototype, Ye = Object.getOwnPropertyDescriptor && It ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, Be = It && Ye && typeof Ye.get == "function" ? Ye.get : null, Qt = It && Set.prototype.forEach, Qo = typeof WeakMap == "function" && WeakMap.prototype, Se = Qo ? WeakMap.prototype.has : null, Xo = typeof WeakSet == "function" && WeakSet.prototype, we = Xo ? WeakSet.prototype.has : null, Yo = typeof WeakRef == "function" && WeakRef.prototype, Xt = Yo ? WeakRef.prototype.deref : null, Zo = Boolean.prototype.valueOf, ei = Object.prototype.toString, ti = Function.prototype.toString, ri = String.prototype.match, Tt = String.prototype.slice, J = String.prototype.replace, ni = String.prototype.toUpperCase, Yt = String.prototype.toLowerCase, xr = RegExp.prototype.test, Zt = Array.prototype.concat, U = Array.prototype.join, oi = Array.prototype.slice, er = Math.floor, lt = typeof BigInt == "function" ? BigInt.prototype.valueOf : null, Ze = Object.getOwnPropertySymbols, ut = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Symbol.prototype.toString : null, ue = typeof Symbol == "function" && typeof Symbol.iterator == "object", P = typeof Symbol == "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === ue || !0) ? Symbol.toStringTag : null, Ur = Object.prototype.propertyIsEnumerable, tr = (typeof Reflect == "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(t) {
1786
1786
  return t.__proto__;
1787
1787
  } : null);
1788
1788
  function rr(t, e) {
@@ -1793,23 +1793,23 @@ function rr(t, e) {
1793
1793
  var n = t < 0 ? -er(-t) : er(t);
1794
1794
  if (n !== t) {
1795
1795
  var o = String(n), i = Tt.call(e, o.length + 1);
1796
- return j.call(o, r, "$&_") + "." + j.call(j.call(i, /([0-9]{3})/g, "$&_"), /_$/, "");
1796
+ return J.call(o, r, "$&_") + "." + J.call(J.call(i, /([0-9]{3})/g, "$&_"), /_$/, "");
1797
1797
  }
1798
1798
  }
1799
- return j.call(e, r, "$&_");
1799
+ return J.call(e, r, "$&_");
1800
1800
  }
1801
1801
  var ft = Ko, nr = ft.custom, or = Br(nr) ? nr : null, ii = function t(e, r, n, o) {
1802
1802
  var i = r || {};
1803
- if (z(i, "quoteStyle") && i.quoteStyle !== "single" && i.quoteStyle !== "double")
1803
+ if (j(i, "quoteStyle") && i.quoteStyle !== "single" && i.quoteStyle !== "double")
1804
1804
  throw new TypeError('option "quoteStyle" must be "single" or "double"');
1805
- if (z(i, "maxStringLength") && (typeof i.maxStringLength == "number" ? i.maxStringLength < 0 && i.maxStringLength !== 1 / 0 : i.maxStringLength !== null))
1805
+ if (j(i, "maxStringLength") && (typeof i.maxStringLength == "number" ? i.maxStringLength < 0 && i.maxStringLength !== 1 / 0 : i.maxStringLength !== null))
1806
1806
  throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
1807
- var s = z(i, "customInspect") ? i.customInspect : !0;
1807
+ var s = j(i, "customInspect") ? i.customInspect : !0;
1808
1808
  if (typeof s != "boolean" && s !== "symbol")
1809
1809
  throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");
1810
- if (z(i, "indent") && i.indent !== null && i.indent !== " " && !(parseInt(i.indent, 10) === i.indent && i.indent > 0))
1810
+ if (j(i, "indent") && i.indent !== null && i.indent !== " " && !(parseInt(i.indent, 10) === i.indent && i.indent > 0))
1811
1811
  throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
1812
- if (z(i, "numericSeparator") && typeof i.numericSeparator != "boolean")
1812
+ if (j(i, "numericSeparator") && typeof i.numericSeparator != "boolean")
1813
1813
  throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
1814
1814
  var a = i.numericSeparator;
1815
1815
  if (typeof e > "u")
@@ -1843,7 +1843,7 @@ var ft = Ko, nr = ft.custom, or = Br(nr) ? nr : null, ii = function t(e, r, n, o
1843
1843
  var oe = {
1844
1844
  depth: i.depth
1845
1845
  };
1846
- return z(i, "quoteStyle") && (oe.quoteStyle = i.quoteStyle), t(H, oe, n + 1, o);
1846
+ return j(i, "quoteStyle") && (oe.quoteStyle = i.quoteStyle), t(H, oe, n + 1, o);
1847
1847
  }
1848
1848
  return t(H, i, n + 1, o);
1849
1849
  }
@@ -1852,7 +1852,7 @@ var ft = Ko, nr = ft.custom, or = Br(nr) ? nr : null, ii = function t(e, r, n, o
1852
1852
  return "[Function" + (w ? ": " + w : " (anonymous)") + "]" + (p.length > 0 ? " { " + U.call(p, ", ") + " }" : "");
1853
1853
  }
1854
1854
  if (Br(e)) {
1855
- var h = ue ? j.call(String(e), /^(Symbol\(.*\))_[^)]*$/, "$1") : ut.call(e);
1855
+ var h = ue ? J.call(String(e), /^(Symbol\(.*\))_[^)]*$/, "$1") : ut.call(e);
1856
1856
  return typeof e == "object" && !ue ? ge(h) : h;
1857
1857
  }
1858
1858
  if (bi(e)) {
@@ -1903,8 +1903,8 @@ var ft = Ko, nr = ft.custom, or = Br(nr) ? nr : null, ii = function t(e, r, n, o
1903
1903
  if (li(e))
1904
1904
  return ge(y(String(e)));
1905
1905
  if (!ai(e) && !ir(e)) {
1906
- var K = Ie(e, y), W = tr ? tr(e) === Object.prototype : e instanceof Object || e.constructor === Object, te = e instanceof Object ? "" : "null prototype", re = !W && P && Object(e) === e && P in e ? Tt.call(J(e), 8, -1) : te ? "Object" : "", ye = W || typeof e.constructor != "function" ? "" : e.constructor.name ? e.constructor.name + " " : "", _ = ye + (re || te ? "[" + U.call(Zt.call([], re || [], te || []), ": ") + "] " : "");
1907
- return K.length === 0 ? _ + "{}" : f ? _ + "{" + pt(K, f) + "}" : _ + "{ " + U.call(K, ", ") + " }";
1906
+ var Q = Ie(e, y), W = tr ? tr(e) === Object.prototype : e instanceof Object || e.constructor === Object, te = e instanceof Object ? "" : "null prototype", re = !W && P && Object(e) === e && P in e ? Tt.call(K(e), 8, -1) : te ? "Object" : "", ye = W || typeof e.constructor != "function" ? "" : e.constructor.name ? e.constructor.name + " " : "", _ = ye + (re || te ? "[" + U.call(Zt.call([], re || [], te || []), ": ") + "] " : "");
1907
+ return Q.length === 0 ? _ + "{}" : f ? _ + "{" + pt(Q, f) + "}" : _ + "{ " + U.call(Q, ", ") + " }";
1908
1908
  }
1909
1909
  return String(e);
1910
1910
  };
@@ -1913,28 +1913,28 @@ function kr(t, e, r) {
1913
1913
  return n + t + n;
1914
1914
  }
1915
1915
  function si(t) {
1916
- return j.call(String(t), /"/g, "&quot;");
1916
+ return J.call(String(t), /"/g, "&quot;");
1917
1917
  }
1918
1918
  function dt(t) {
1919
- return J(t) === "[object Array]" && (!P || !(typeof t == "object" && P in t));
1919
+ return K(t) === "[object Array]" && (!P || !(typeof t == "object" && P in t));
1920
1920
  }
1921
1921
  function ai(t) {
1922
- return J(t) === "[object Date]" && (!P || !(typeof t == "object" && P in t));
1922
+ return K(t) === "[object Date]" && (!P || !(typeof t == "object" && P in t));
1923
1923
  }
1924
1924
  function ir(t) {
1925
- return J(t) === "[object RegExp]" && (!P || !(typeof t == "object" && P in t));
1925
+ return K(t) === "[object RegExp]" && (!P || !(typeof t == "object" && P in t));
1926
1926
  }
1927
1927
  function ci(t) {
1928
- return J(t) === "[object Error]" && (!P || !(typeof t == "object" && P in t));
1928
+ return K(t) === "[object Error]" && (!P || !(typeof t == "object" && P in t));
1929
1929
  }
1930
1930
  function li(t) {
1931
- return J(t) === "[object String]" && (!P || !(typeof t == "object" && P in t));
1931
+ return K(t) === "[object String]" && (!P || !(typeof t == "object" && P in t));
1932
1932
  }
1933
1933
  function ui(t) {
1934
- return J(t) === "[object Number]" && (!P || !(typeof t == "object" && P in t));
1934
+ return K(t) === "[object Number]" && (!P || !(typeof t == "object" && P in t));
1935
1935
  }
1936
1936
  function fi(t) {
1937
- return J(t) === "[object Boolean]" && (!P || !(typeof t == "object" && P in t));
1937
+ return K(t) === "[object Boolean]" && (!P || !(typeof t == "object" && P in t));
1938
1938
  }
1939
1939
  function Br(t) {
1940
1940
  if (ue)
@@ -1961,10 +1961,10 @@ function di(t) {
1961
1961
  var pi = Object.prototype.hasOwnProperty || function(t) {
1962
1962
  return t in this;
1963
1963
  };
1964
- function z(t, e) {
1964
+ function j(t, e) {
1965
1965
  return pi.call(t, e);
1966
1966
  }
1967
- function J(t) {
1967
+ function K(t) {
1968
1968
  return ei.call(t);
1969
1969
  }
1970
1970
  function hi(t) {
@@ -2058,7 +2058,7 @@ function Hr(t, e) {
2058
2058
  var r = t.length - e.maxStringLength, n = "... " + r + " more character" + (r > 1 ? "s" : "");
2059
2059
  return Hr(Tt.call(t, 0, e.maxStringLength), e) + n;
2060
2060
  }
2061
- var o = j.call(j.call(t, /(['\\])/g, "\\$1"), /[\x00-\x1f]/g, vi);
2061
+ var o = J.call(J.call(t, /(['\\])/g, "\\$1"), /[\x00-\x1f]/g, vi);
2062
2062
  return kr(o, "single", e);
2063
2063
  }
2064
2064
  function vi(t) {
@@ -2114,7 +2114,7 @@ function Ie(t, e) {
2114
2114
  if (r) {
2115
2115
  n.length = t.length;
2116
2116
  for (var o = 0; o < t.length; o++)
2117
- n[o] = z(t, o) ? e(t[o], t) : "";
2117
+ n[o] = j(t, o) ? e(t[o], t) : "";
2118
2118
  }
2119
2119
  var i = typeof Ze == "function" ? Ze(t) : [], s;
2120
2120
  if (ue) {
@@ -2123,7 +2123,7 @@ function Ie(t, e) {
2123
2123
  s["$" + i[a]] = i[a];
2124
2124
  }
2125
2125
  for (var c in t)
2126
- z(t, c) && (r && String(Number(c)) === c && c < t.length || ue && s["$" + c] instanceof Symbol || (xr.call(/[^\w$]/, c) ? n.push(e(c, t) + ": " + e(t[c], t)) : n.push(c + ": " + e(t[c], t))));
2126
+ j(t, c) && (r && String(Number(c)) === c && c < t.length || ue && s["$" + c] instanceof Symbol || (xr.call(/[^\w$]/, c) ? n.push(e(c, t) + ": " + e(t[c], t)) : n.push(c + ": " + e(t[c], t))));
2127
2127
  if (typeof Ze == "function")
2128
2128
  for (var l = 0; l < i.length; l++)
2129
2129
  Ur.call(t, i[l]) && n.push("[" + e(i[l]) + "]: " + e(t[i[l]], t));
@@ -2365,9 +2365,9 @@ var Dt = Rt, pe = zo, Oi = ii, Ri = Dt("%TypeError%"), Te = Dt("%WeakMap%", !0),
2365
2365
  }
2366
2366
  return [w(r) + "=" + w(String(S))];
2367
2367
  }
2368
- var K = [];
2368
+ var Q = [];
2369
2369
  if (typeof S > "u")
2370
- return K;
2370
+ return Q;
2371
2371
  var W;
2372
2372
  if (n === "comma" && $(S))
2373
2373
  p && a && (S = Ne.maybeMap(S, a)), W = [{ value: S.length > 0 ? S.join(",") || null : void 0 }];
@@ -2383,7 +2383,7 @@ var Dt = Rt, pe = zo, Oi = ii, Ri = Dt("%TypeError%"), Te = Dt("%WeakMap%", !0),
2383
2383
  var ne = $(S) ? typeof n == "function" ? n(re, _) : re : re + (d ? "." + _ : "[" + _ + "]");
2384
2384
  E.set(e, T);
2385
2385
  var Ce = Gr();
2386
- Ce.set(nt, E), Wr(K, t(
2386
+ Ce.set(nt, E), Wr(Q, t(
2387
2387
  H,
2388
2388
  ne,
2389
2389
  n,
@@ -2403,7 +2403,7 @@ var Dt = Rt, pe = zo, Oi = ii, Ri = Dt("%TypeError%"), Te = Dt("%WeakMap%", !0),
2403
2403
  ));
2404
2404
  }
2405
2405
  }
2406
- return K;
2406
+ return Q;
2407
2407
  }, es = function(e) {
2408
2408
  if (!e)
2409
2409
  return D;
@@ -2639,7 +2639,7 @@ class ms {
2639
2639
  console.debug("onStopDesktopShare");
2640
2640
  }
2641
2641
  }
2642
- var g = /* @__PURE__ */ ((t) => (t[t.UNKNOWN = 0] = "UNKNOWN", t[t.AUDIO = 1] = "AUDIO", t[t.VIDEO = 2] = "VIDEO", t[t.RTSP_PULL = 3] = "RTSP_PULL", t[t.AUDIO_PUSH = 4] = "AUDIO_PUSH", t[t.VIDEO_PUSH = 5] = "VIDEO_PUSH", t[t.AUDIO_HALF = 6] = "AUDIO_HALF", t[t.VIDEO_HALF = 7] = "VIDEO_HALF", t))(g || {}), Q = /* @__PURE__ */ ((t) => (t.FRONT_FACING = "user", t.BACK_FACING = "environment", t))(Q || {});
2642
+ var g = /* @__PURE__ */ ((t) => (t[t.UNKNOWN = 0] = "UNKNOWN", t[t.AUDIO = 1] = "AUDIO", t[t.VIDEO = 2] = "VIDEO", t[t.RTSP_PULL = 3] = "RTSP_PULL", t[t.AUDIO_PUSH = 4] = "AUDIO_PUSH", t[t.VIDEO_PUSH = 5] = "VIDEO_PUSH", t[t.AUDIO_HALF = 6] = "AUDIO_HALF", t[t.VIDEO_HALF = 7] = "VIDEO_HALF", t))(g || {}), z = /* @__PURE__ */ ((t) => (t.FRONT_FACING = "user", t.BACK_FACING = "environment", t))(z || {});
2643
2643
  class Ft {
2644
2644
  constructor(e) {
2645
2645
  // private config: RTCConfiguration = { iceServers: [] }
@@ -2660,7 +2660,7 @@ class Ft {
2660
2660
  // 是否设置了对端sdp
2661
2661
  m(this, "hasSetRemoteSdp", !1);
2662
2662
  // 前置摄像头 "user", 后置摄像头 "environment"
2663
- m(this, "facingMode", Q.FRONT_FACING);
2663
+ m(this, "facingMode", z.FRONT_FACING);
2664
2664
  // 摄像头切换中
2665
2665
  m(this, "facingChanging", !1);
2666
2666
  // 是否闭麦
@@ -2689,7 +2689,7 @@ class Ft {
2689
2689
  this.error(new Error("start failed, remoteSdp is null."));
2690
2690
  return;
2691
2691
  }
2692
- switch (this.isCallOut = e, this.hasSetRemoteSdp = !1, this.facingMode = Q.FRONT_FACING, this.facingChanging = !1, this.muted = !1, this.desktopSharing = !1, this.peerConnection = new RTCPeerConnection({ iceServers: [] }), this.peerConnection.onnegotiationneeded = () => {
2692
+ switch (this.isCallOut = e, this.hasSetRemoteSdp = !1, this.facingMode = z.FRONT_FACING, this.facingChanging = !1, this.muted = !1, this.desktopSharing = !1, this.peerConnection = new RTCPeerConnection({ iceServers: [] }), this.peerConnection.onnegotiationneeded = () => {
2693
2693
  switch (this.sessionType) {
2694
2694
  case g.AUDIO_PUSH:
2695
2695
  case g.VIDEO_PUSH:
@@ -2733,7 +2733,7 @@ class Ft {
2733
2733
  this.sessionListener.onAddRemoteStream(this.remoteStream);
2734
2734
  }, this.peerConnection.oniceconnectionstatechange = (n) => {
2735
2735
  var o, i, s, a, c;
2736
- console.debug("oniceconnectionstatechange", (o = this.peerConnection) == null ? void 0 : o.iceConnectionState), (((i = this.peerConnection) == null ? void 0 : i.iceConnectionState) == "completed" || ((s = this.peerConnection) == null ? void 0 : s.iceConnectionState) == "disconnected" || ((a = this.peerConnection) == null ? void 0 : a.iceConnectionState) == "failed" || ((c = this.peerConnection) == null ? void 0 : c.iceConnectionState) == "closed") && (this.stop(), this.sessionListener.onError(new Error("session closed.")));
2736
+ console.debug("oniceconnectionstatechange", (o = this.peerConnection) == null ? void 0 : o.iceConnectionState), (((i = this.peerConnection) == null ? void 0 : i.iceConnectionState) == "completed" || ((s = this.peerConnection) == null ? void 0 : s.iceConnectionState) == "disconnected" || ((a = this.peerConnection) == null ? void 0 : a.iceConnectionState) == "failed" || ((c = this.peerConnection) == null ? void 0 : c.iceConnectionState) == "closed") && (this.dataChannel = void 0, this.stop(), this.sessionListener.onError(new Error("session closed.")));
2737
2737
  }, this.sessionType) {
2738
2738
  case g.RTSP_PULL:
2739
2739
  this.addTransceivers(), this.createDataChannel();
@@ -2774,19 +2774,21 @@ class Ft {
2774
2774
  * @param data
2775
2775
  */
2776
2776
  sendStringData(e) {
2777
- this.dataChannel && this.dataChannel.send(e);
2777
+ try {
2778
+ this.dataChannel && this.dataChannel.send(e);
2779
+ } catch (r) {
2780
+ console.debug("sendStringData failed", r);
2781
+ }
2778
2782
  }
2779
2783
  /**
2780
2784
  * 关闭会话
2781
2785
  */
2782
2786
  stop() {
2783
2787
  var e;
2784
- if (console.debug("webrtc stop"), (this.sessionType == g.VIDEO_PUSH || this.sessionType == g.AUDIO_PUSH || this.sessionType == g.RTSP_PULL) && this.sendStringData("close"), (e = this.peerConnection) == null || e.close(), this.peerConnection = void 0, this.localStream) {
2788
+ if (console.debug("webrtc stop"), (this.sessionType == g.VIDEO_PUSH || this.sessionType == g.AUDIO_PUSH || this.sessionType == g.RTSP_PULL) && this.sendStringData("close"), (e = this.peerConnection) == null || e.close(), this.localStream)
2785
2789
  for (let r of this.localStream.getTracks())
2786
2790
  this.localStream.removeTrack(r), r.stop();
2787
- this.localStream = void 0;
2788
- }
2789
- this.remoteStream = void 0, this.desktopSharing = !1;
2791
+ this.desktopSharing && (this.desktopSharing = !1, this.sessionListener.onStopDesktopShare()), this.peerConnection = void 0, this.dataChannel = void 0, this.localStream = void 0, this.remoteStream = void 0, this.isCallOut = !1, this.sessionType = g.UNKNOWN, this.hasSetRemoteSdp = !1, this.facingMode = z.FRONT_FACING, this.facingChanging = !1, this.muted = !1, this.openCamera = !1, this.desktopSharing = !1;
2790
2792
  }
2791
2793
  /**
2792
2794
  * 移动端切换前后置摄像头
@@ -2968,7 +2970,7 @@ class Ft {
2968
2970
  changeCameraLocalMedia() {
2969
2971
  return new Promise((e, r) => {
2970
2972
  let n;
2971
- if (this.facingMode === Q.FRONT_FACING ? n = {
2973
+ if (this.facingMode === z.FRONT_FACING ? n = {
2972
2974
  audio: { echoCancellation: !0, noiseSuppression: !0 },
2973
2975
  video: { height: { exact: 1280 }, width: { exact: 720 }, facingMode: "environment" }
2974
2976
  } : n = {
@@ -3002,7 +3004,7 @@ class Ft {
3002
3004
  }).catch((n) => {
3003
3005
  console.log(n);
3004
3006
  });
3005
- }), this.facingMode === Q.FRONT_FACING ? this.facingMode = Q.BACK_FACING : this.facingMode = Q.FRONT_FACING, this.facingChanging = !1;
3007
+ }), this.facingMode === z.FRONT_FACING ? this.facingMode = z.BACK_FACING : this.facingMode = z.FRONT_FACING, this.facingChanging = !1;
3006
3008
  }
3007
3009
  changeCameraFailed(e) {
3008
3010
  console.log(e), this.facingChanging = !1;
@@ -1,9 +1,9 @@
1
- (function(T,N){typeof exports=="object"&&typeof module<"u"?N(exports):typeof define=="function"&&define.amd?define(["exports"],N):(T=typeof globalThis<"u"?globalThis:T||self,N(T.mediaAV={}))})(this,function(T){"use strict";var Rs=Object.defineProperty;var Cs=(T,N,X)=>N in T?Rs(T,N,{enumerable:!0,configurable:!0,writable:!0,value:X}):T[N]=X;var m=(T,N,X)=>(Cs(T,typeof N!="symbol"?N+"":N,X),X);function N(t,e){return function(){return t.apply(e,arguments)}}const{toString:X}=Object.prototype,{getPrototypeOf:ze}=Object,Te=(t=>e=>{const r=X.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),k=t=>(t=t.toLowerCase(),e=>Te(e)===t),Pe=t=>e=>typeof e===t,{isArray:oe}=Array,ge=Pe("undefined");function en(t){return t!==null&&!ge(t)&&t.constructor!==null&&!ge(t.constructor)&&x(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const kt=k("ArrayBuffer");function tn(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&kt(t.buffer),e}const rn=Pe("string"),x=Pe("function"),Bt=Pe("number"),De=t=>t!==null&&typeof t=="object",nn=t=>t===!0||t===!1,Le=t=>{if(Te(t)!=="object")return!1;const e=ze(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},on=k("Date"),sn=k("File"),an=k("Blob"),cn=k("FileList"),ln=t=>De(t)&&x(t.pipe),un=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||x(t.append)&&((e=Te(t))==="formdata"||e==="object"&&x(t.toString)&&t.toString()==="[object FormData]"))},fn=k("URLSearchParams"),dn=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Se(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let n,o;if(typeof t!="object"&&(t=[t]),oe(t))for(n=0,o=t.length;n<o;n++)e.call(null,t[n],n,t);else{const i=r?Object.getOwnPropertyNames(t):Object.keys(t),s=i.length;let a;for(n=0;n<s;n++)a=i[n],e.call(null,t[a],a,t)}}function Mt(t,e){e=e.toLowerCase();const r=Object.keys(t);let n=r.length,o;for(;n-- >0;)if(o=r[n],e===o.toLowerCase())return o;return null}const Ht=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,$t=t=>!ge(t)&&t!==Ht;function Je(){const{caseless:t}=$t(this)&&this||{},e={},r=(n,o)=>{const i=t&&Mt(e,o)||o;Le(e[i])&&Le(n)?e[i]=Je(e[i],n):Le(n)?e[i]=Je({},n):oe(n)?e[i]=n.slice():e[i]=n};for(let n=0,o=arguments.length;n<o;n++)arguments[n]&&Se(arguments[n],r);return e}const pn=(t,e,r,{allOwnKeys:n}={})=>(Se(e,(o,i)=>{r&&x(o)?t[i]=N(o,r):t[i]=o},{allOwnKeys:n}),t),hn=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),yn=(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},mn=(t,e,r,n)=>{let o,i,s;const a={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),i=o.length;i-- >0;)s=o[i],(!n||n(s,t,e))&&!a[s]&&(e[s]=t[s],a[s]=!0);t=r!==!1&&ze(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},gn=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;const n=t.indexOf(e,r);return n!==-1&&n===r},Sn=t=>{if(!t)return null;if(oe(t))return t;let e=t.length;if(!Bt(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},wn=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&ze(Uint8Array)),bn=(t,e)=>{const n=(t&&t[Symbol.iterator]).call(t);let o;for(;(o=n.next())&&!o.done;){const i=o.value;e.call(t,i[0],i[1])}},vn=(t,e)=>{let r;const n=[];for(;(r=t.exec(e))!==null;)n.push(r);return n},En=k("HTMLFormElement"),An=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),Vt=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),On=k("RegExp"),Gt=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};Se(r,(o,i)=>{let s;(s=e(o,i,t))!==!1&&(n[i]=s||o)}),Object.defineProperties(t,n)},Rn=t=>{Gt(t,(e,r)=>{if(x(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=t[r];if(x(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Cn=(t,e)=>{const r={},n=o=>{o.forEach(i=>{r[i]=!0})};return oe(t)?n(t):n(String(t).split(e)),r},In=()=>{},Tn=(t,e)=>(t=+t,Number.isFinite(t)?t:e),Ke="abcdefghijklmnopqrstuvwxyz",Wt="0123456789",qt={DIGIT:Wt,ALPHA:Ke,ALPHA_DIGIT:Ke+Ke.toUpperCase()+Wt},Pn=(t=16,e=qt.ALPHA_DIGIT)=>{let r="";const{length:n}=e;for(;t--;)r+=e[Math.random()*n|0];return r};function Dn(t){return!!(t&&x(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const Ln=t=>{const e=new Array(10),r=(n,o)=>{if(De(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[o]=n;const i=oe(n)?[]:{};return Se(n,(s,a)=>{const c=r(s,o+1);!ge(c)&&(i[a]=c)}),e[o]=void 0,i}}return n};return r(t,0)},Fn=k("AsyncFunction"),u={isArray:oe,isArrayBuffer:kt,isBuffer:en,isFormData:un,isArrayBufferView:tn,isString:rn,isNumber:Bt,isBoolean:nn,isObject:De,isPlainObject:Le,isUndefined:ge,isDate:on,isFile:sn,isBlob:an,isRegExp:On,isFunction:x,isStream:ln,isURLSearchParams:fn,isTypedArray:wn,isFileList:cn,forEach:Se,merge:Je,extend:pn,trim:dn,stripBOM:hn,inherits:yn,toFlatObject:mn,kindOf:Te,kindOfTest:k,endsWith:gn,toArray:Sn,forEachEntry:bn,matchAll:vn,isHTMLForm:En,hasOwnProperty:Vt,hasOwnProp:Vt,reduceDescriptors:Gt,freezeMethods:Rn,toObjectSet:Cn,toCamelCase:An,noop:In,toFiniteNumber:Tn,findKey:Mt,global:Ht,isContextDefined:$t,ALPHABET:qt,generateString:Pn,isSpecCompliantForm:Dn,toJSONObject:Ln,isAsyncFn:Fn,isThenable:t=>t&&(De(t)||x(t))&&x(t.then)&&x(t.catch)};function v(t,e,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o)}u.inherits(v,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:u.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const jt=v.prototype,zt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{zt[t]={value:t}}),Object.defineProperties(v,zt),Object.defineProperty(jt,"isAxiosError",{value:!0}),v.from=(t,e,r,n,o,i)=>{const s=Object.create(jt);return u.toFlatObject(t,s,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),v.call(s,t.message,e,r,n,o),s.cause=t,s.name=t.name,i&&Object.assign(s,i),s};const Nn=null;function Qe(t){return u.isPlainObject(t)||u.isArray(t)}function Jt(t){return u.endsWith(t,"[]")?t.slice(0,-2):t}function Kt(t,e,r){return t?t.concat(e).map(function(o,i){return o=Jt(o),!r&&i?"["+o+"]":o}).join(r?".":""):e}function _n(t){return u.isArray(t)&&!t.some(Qe)}const xn=u.toFlatObject(u,{},null,function(e){return/^is[A-Z]/.test(e)});function Fe(t,e,r){if(!u.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,r=u.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,E){return!u.isUndefined(E[h])});const n=r.metaTokens,o=r.visitor||d,i=r.dots,s=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&u.isSpecCompliantForm(e);if(!u.isFunction(o))throw new TypeError("visitor must be a function");function l(p){if(p===null)return"";if(u.isDate(p))return p.toISOString();if(!c&&u.isBlob(p))throw new v("Blob is not supported. Use a Buffer instead.");return u.isArrayBuffer(p)||u.isTypedArray(p)?c&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function d(p,h,E){let S=p;if(p&&!E&&typeof p=="object"){if(u.endsWith(h,"{}"))h=n?h:h.slice(0,-2),p=JSON.stringify(p);else if(u.isArray(p)&&_n(p)||(u.isFileList(p)||u.endsWith(h,"[]"))&&(S=u.toArray(p)))return h=Jt(h),S.forEach(function(P,K){!(u.isUndefined(P)||P===null)&&e.append(s===!0?Kt([h],K,i):s===null?h:h+"[]",l(P))}),!1}return Qe(p)?!0:(e.append(Kt(E,h,i),l(p)),!1)}const f=[],y=Object.assign(xn,{defaultVisitor:d,convertValue:l,isVisitable:Qe});function w(p,h){if(!u.isUndefined(p)){if(f.indexOf(p)!==-1)throw Error("Circular reference detected in "+h.join("."));f.push(p),u.forEach(p,function(S,I){(!(u.isUndefined(S)||S===null)&&o.call(e,S,u.isString(I)?I.trim():I,h,y))===!0&&w(S,h?h.concat(I):[I])}),f.pop()}}if(!u.isObject(t))throw new TypeError("data must be an object");return w(t),e}function Qt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function Xe(t,e){this._pairs=[],t&&Fe(t,this,e)}const Xt=Xe.prototype;Xt.append=function(e,r){this._pairs.push([e,r])},Xt.toString=function(e){const r=e?function(n){return e.call(this,n,Qt)}:Qt;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function Un(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Yt(t,e,r){if(!e)return t;const n=r&&r.encode||Un,o=r&&r.serialize;let i;if(o?i=o(e,r):i=u.isURLSearchParams(e)?e.toString():new Xe(e,r).toString(n),i){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class Zt{constructor(){this.handlers=[]}use(e,r,n){return this.handlers.push({fulfilled:e,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){u.forEach(this.handlers,function(n){n!==null&&e(n)})}}const er={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},kn={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Xe,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},tr=typeof window<"u"&&typeof document<"u",Bn=(t=>tr&&["ReactNative","NativeScript","NS"].indexOf(t)<0)(typeof navigator<"u"&&navigator.product),Mn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",B={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:tr,hasStandardBrowserEnv:Bn,hasStandardBrowserWebWorkerEnv:Mn},Symbol.toStringTag,{value:"Module"})),...kn};function Hn(t,e){return Fe(t,new B.classes.URLSearchParams,Object.assign({visitor:function(r,n,o,i){return B.isNode&&u.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function $n(t){return u.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Vn(t){const e={},r=Object.keys(t);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],e[i]=t[i];return e}function rr(t){function e(r,n,o,i){let s=r[i++];if(s==="__proto__")return!0;const a=Number.isFinite(+s),c=i>=r.length;return s=!s&&u.isArray(o)?o.length:s,c?(u.hasOwnProp(o,s)?o[s]=[o[s],n]:o[s]=n,!a):((!o[s]||!u.isObject(o[s]))&&(o[s]=[]),e(r,n,o[s],i)&&u.isArray(o[s])&&(o[s]=Vn(o[s])),!a)}if(u.isFormData(t)&&u.isFunction(t.entries)){const r={};return u.forEachEntry(t,(n,o)=>{e($n(n),o,r,0)}),r}return null}function Gn(t,e,r){if(u.isString(t))try{return(e||JSON.parse)(t),u.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(t)}const Ye={transitional:er,adapter:["xhr","http"],transformRequest:[function(e,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,i=u.isObject(e);if(i&&u.isHTMLForm(e)&&(e=new FormData(e)),u.isFormData(e))return o?JSON.stringify(rr(e)):e;if(u.isArrayBuffer(e)||u.isBuffer(e)||u.isStream(e)||u.isFile(e)||u.isBlob(e))return e;if(u.isArrayBufferView(e))return e.buffer;if(u.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Hn(e,this.formSerializer).toString();if((a=u.isFileList(e))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Fe(a?{"files[]":e}:e,c&&new c,this.formSerializer)}}return i||o?(r.setContentType("application/json",!1),Gn(e)):e}],transformResponse:[function(e){const r=this.transitional||Ye.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(e&&u.isString(e)&&(n&&!this.responseType||o)){const s=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(a){if(s)throw a.name==="SyntaxError"?v.from(a,v.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:B.classes.FormData,Blob:B.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};u.forEach(["delete","get","head","post","put","patch"],t=>{Ye.headers[t]={}});const Ze=Ye,Wn=u.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),qn=t=>{const e={};let r,n,o;return t&&t.split(`
1
+ (function(T,N){typeof exports=="object"&&typeof module<"u"?N(exports):typeof define=="function"&&define.amd?define(["exports"],N):(T=typeof globalThis<"u"?globalThis:T||self,N(T.mediaAV={}))})(this,function(T){"use strict";var Rs=Object.defineProperty;var Cs=(T,N,Y)=>N in T?Rs(T,N,{enumerable:!0,configurable:!0,writable:!0,value:Y}):T[N]=Y;var m=(T,N,Y)=>(Cs(T,typeof N!="symbol"?N+"":N,Y),Y);function N(t,e){return function(){return t.apply(e,arguments)}}const{toString:Y}=Object.prototype,{getPrototypeOf:ze}=Object,Te=(t=>e=>{const r=Y.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),k=t=>(t=t.toLowerCase(),e=>Te(e)===t),De=t=>e=>typeof e===t,{isArray:oe}=Array,ge=De("undefined");function en(t){return t!==null&&!ge(t)&&t.constructor!==null&&!ge(t.constructor)&&x(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const kt=k("ArrayBuffer");function tn(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&kt(t.buffer),e}const rn=De("string"),x=De("function"),Bt=De("number"),Pe=t=>t!==null&&typeof t=="object",nn=t=>t===!0||t===!1,Le=t=>{if(Te(t)!=="object")return!1;const e=ze(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},on=k("Date"),sn=k("File"),an=k("Blob"),cn=k("FileList"),ln=t=>Pe(t)&&x(t.pipe),un=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||x(t.append)&&((e=Te(t))==="formdata"||e==="object"&&x(t.toString)&&t.toString()==="[object FormData]"))},fn=k("URLSearchParams"),dn=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Se(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let n,o;if(typeof t!="object"&&(t=[t]),oe(t))for(n=0,o=t.length;n<o;n++)e.call(null,t[n],n,t);else{const i=r?Object.getOwnPropertyNames(t):Object.keys(t),s=i.length;let a;for(n=0;n<s;n++)a=i[n],e.call(null,t[a],a,t)}}function Mt(t,e){e=e.toLowerCase();const r=Object.keys(t);let n=r.length,o;for(;n-- >0;)if(o=r[n],e===o.toLowerCase())return o;return null}const Ht=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,$t=t=>!ge(t)&&t!==Ht;function Je(){const{caseless:t}=$t(this)&&this||{},e={},r=(n,o)=>{const i=t&&Mt(e,o)||o;Le(e[i])&&Le(n)?e[i]=Je(e[i],n):Le(n)?e[i]=Je({},n):oe(n)?e[i]=n.slice():e[i]=n};for(let n=0,o=arguments.length;n<o;n++)arguments[n]&&Se(arguments[n],r);return e}const pn=(t,e,r,{allOwnKeys:n}={})=>(Se(e,(o,i)=>{r&&x(o)?t[i]=N(o,r):t[i]=o},{allOwnKeys:n}),t),hn=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),yn=(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},mn=(t,e,r,n)=>{let o,i,s;const a={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),i=o.length;i-- >0;)s=o[i],(!n||n(s,t,e))&&!a[s]&&(e[s]=t[s],a[s]=!0);t=r!==!1&&ze(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},gn=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;const n=t.indexOf(e,r);return n!==-1&&n===r},Sn=t=>{if(!t)return null;if(oe(t))return t;let e=t.length;if(!Bt(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},wn=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&ze(Uint8Array)),bn=(t,e)=>{const n=(t&&t[Symbol.iterator]).call(t);let o;for(;(o=n.next())&&!o.done;){const i=o.value;e.call(t,i[0],i[1])}},vn=(t,e)=>{let r;const n=[];for(;(r=t.exec(e))!==null;)n.push(r);return n},En=k("HTMLFormElement"),An=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),Vt=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),On=k("RegExp"),Gt=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};Se(r,(o,i)=>{let s;(s=e(o,i,t))!==!1&&(n[i]=s||o)}),Object.defineProperties(t,n)},Rn=t=>{Gt(t,(e,r)=>{if(x(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=t[r];if(x(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Cn=(t,e)=>{const r={},n=o=>{o.forEach(i=>{r[i]=!0})};return oe(t)?n(t):n(String(t).split(e)),r},In=()=>{},Tn=(t,e)=>(t=+t,Number.isFinite(t)?t:e),Ke="abcdefghijklmnopqrstuvwxyz",Wt="0123456789",qt={DIGIT:Wt,ALPHA:Ke,ALPHA_DIGIT:Ke+Ke.toUpperCase()+Wt},Dn=(t=16,e=qt.ALPHA_DIGIT)=>{let r="";const{length:n}=e;for(;t--;)r+=e[Math.random()*n|0];return r};function Pn(t){return!!(t&&x(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const Ln=t=>{const e=new Array(10),r=(n,o)=>{if(Pe(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[o]=n;const i=oe(n)?[]:{};return Se(n,(s,a)=>{const c=r(s,o+1);!ge(c)&&(i[a]=c)}),e[o]=void 0,i}}return n};return r(t,0)},Fn=k("AsyncFunction"),u={isArray:oe,isArrayBuffer:kt,isBuffer:en,isFormData:un,isArrayBufferView:tn,isString:rn,isNumber:Bt,isBoolean:nn,isObject:Pe,isPlainObject:Le,isUndefined:ge,isDate:on,isFile:sn,isBlob:an,isRegExp:On,isFunction:x,isStream:ln,isURLSearchParams:fn,isTypedArray:wn,isFileList:cn,forEach:Se,merge:Je,extend:pn,trim:dn,stripBOM:hn,inherits:yn,toFlatObject:mn,kindOf:Te,kindOfTest:k,endsWith:gn,toArray:Sn,forEachEntry:bn,matchAll:vn,isHTMLForm:En,hasOwnProperty:Vt,hasOwnProp:Vt,reduceDescriptors:Gt,freezeMethods:Rn,toObjectSet:Cn,toCamelCase:An,noop:In,toFiniteNumber:Tn,findKey:Mt,global:Ht,isContextDefined:$t,ALPHABET:qt,generateString:Dn,isSpecCompliantForm:Pn,toJSONObject:Ln,isAsyncFn:Fn,isThenable:t=>t&&(Pe(t)||x(t))&&x(t.then)&&x(t.catch)};function v(t,e,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o)}u.inherits(v,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:u.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const jt=v.prototype,zt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{zt[t]={value:t}}),Object.defineProperties(v,zt),Object.defineProperty(jt,"isAxiosError",{value:!0}),v.from=(t,e,r,n,o,i)=>{const s=Object.create(jt);return u.toFlatObject(t,s,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),v.call(s,t.message,e,r,n,o),s.cause=t,s.name=t.name,i&&Object.assign(s,i),s};const Nn=null;function Qe(t){return u.isPlainObject(t)||u.isArray(t)}function Jt(t){return u.endsWith(t,"[]")?t.slice(0,-2):t}function Kt(t,e,r){return t?t.concat(e).map(function(o,i){return o=Jt(o),!r&&i?"["+o+"]":o}).join(r?".":""):e}function _n(t){return u.isArray(t)&&!t.some(Qe)}const xn=u.toFlatObject(u,{},null,function(e){return/^is[A-Z]/.test(e)});function Fe(t,e,r){if(!u.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,r=u.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,E){return!u.isUndefined(E[h])});const n=r.metaTokens,o=r.visitor||d,i=r.dots,s=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&u.isSpecCompliantForm(e);if(!u.isFunction(o))throw new TypeError("visitor must be a function");function l(p){if(p===null)return"";if(u.isDate(p))return p.toISOString();if(!c&&u.isBlob(p))throw new v("Blob is not supported. Use a Buffer instead.");return u.isArrayBuffer(p)||u.isTypedArray(p)?c&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function d(p,h,E){let S=p;if(p&&!E&&typeof p=="object"){if(u.endsWith(h,"{}"))h=n?h:h.slice(0,-2),p=JSON.stringify(p);else if(u.isArray(p)&&_n(p)||(u.isFileList(p)||u.endsWith(h,"[]"))&&(S=u.toArray(p)))return h=Jt(h),S.forEach(function(D,Q){!(u.isUndefined(D)||D===null)&&e.append(s===!0?Kt([h],Q,i):s===null?h:h+"[]",l(D))}),!1}return Qe(p)?!0:(e.append(Kt(E,h,i),l(p)),!1)}const f=[],y=Object.assign(xn,{defaultVisitor:d,convertValue:l,isVisitable:Qe});function w(p,h){if(!u.isUndefined(p)){if(f.indexOf(p)!==-1)throw Error("Circular reference detected in "+h.join("."));f.push(p),u.forEach(p,function(S,I){(!(u.isUndefined(S)||S===null)&&o.call(e,S,u.isString(I)?I.trim():I,h,y))===!0&&w(S,h?h.concat(I):[I])}),f.pop()}}if(!u.isObject(t))throw new TypeError("data must be an object");return w(t),e}function Qt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function Xe(t,e){this._pairs=[],t&&Fe(t,this,e)}const Xt=Xe.prototype;Xt.append=function(e,r){this._pairs.push([e,r])},Xt.toString=function(e){const r=e?function(n){return e.call(this,n,Qt)}:Qt;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function Un(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Yt(t,e,r){if(!e)return t;const n=r&&r.encode||Un,o=r&&r.serialize;let i;if(o?i=o(e,r):i=u.isURLSearchParams(e)?e.toString():new Xe(e,r).toString(n),i){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class Zt{constructor(){this.handlers=[]}use(e,r,n){return this.handlers.push({fulfilled:e,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){u.forEach(this.handlers,function(n){n!==null&&e(n)})}}const er={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},kn={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Xe,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},tr=typeof window<"u"&&typeof document<"u",Bn=(t=>tr&&["ReactNative","NativeScript","NS"].indexOf(t)<0)(typeof navigator<"u"&&navigator.product),Mn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",B={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:tr,hasStandardBrowserEnv:Bn,hasStandardBrowserWebWorkerEnv:Mn},Symbol.toStringTag,{value:"Module"})),...kn};function Hn(t,e){return Fe(t,new B.classes.URLSearchParams,Object.assign({visitor:function(r,n,o,i){return B.isNode&&u.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function $n(t){return u.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Vn(t){const e={},r=Object.keys(t);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],e[i]=t[i];return e}function rr(t){function e(r,n,o,i){let s=r[i++];if(s==="__proto__")return!0;const a=Number.isFinite(+s),c=i>=r.length;return s=!s&&u.isArray(o)?o.length:s,c?(u.hasOwnProp(o,s)?o[s]=[o[s],n]:o[s]=n,!a):((!o[s]||!u.isObject(o[s]))&&(o[s]=[]),e(r,n,o[s],i)&&u.isArray(o[s])&&(o[s]=Vn(o[s])),!a)}if(u.isFormData(t)&&u.isFunction(t.entries)){const r={};return u.forEachEntry(t,(n,o)=>{e($n(n),o,r,0)}),r}return null}function Gn(t,e,r){if(u.isString(t))try{return(e||JSON.parse)(t),u.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(t)}const Ye={transitional:er,adapter:["xhr","http"],transformRequest:[function(e,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,i=u.isObject(e);if(i&&u.isHTMLForm(e)&&(e=new FormData(e)),u.isFormData(e))return o?JSON.stringify(rr(e)):e;if(u.isArrayBuffer(e)||u.isBuffer(e)||u.isStream(e)||u.isFile(e)||u.isBlob(e))return e;if(u.isArrayBufferView(e))return e.buffer;if(u.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Hn(e,this.formSerializer).toString();if((a=u.isFileList(e))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Fe(a?{"files[]":e}:e,c&&new c,this.formSerializer)}}return i||o?(r.setContentType("application/json",!1),Gn(e)):e}],transformResponse:[function(e){const r=this.transitional||Ye.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(e&&u.isString(e)&&(n&&!this.responseType||o)){const s=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(a){if(s)throw a.name==="SyntaxError"?v.from(a,v.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:B.classes.FormData,Blob:B.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};u.forEach(["delete","get","head","post","put","patch"],t=>{Ye.headers[t]={}});const Ze=Ye,Wn=u.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),qn=t=>{const e={};let r,n,o;return t&&t.split(`
2
2
  `).forEach(function(s){o=s.indexOf(":"),r=s.substring(0,o).trim().toLowerCase(),n=s.substring(o+1).trim(),!(!r||e[r]&&Wn[r])&&(r==="set-cookie"?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)}),e},nr=Symbol("internals");function we(t){return t&&String(t).trim().toLowerCase()}function Ne(t){return t===!1||t==null?t:u.isArray(t)?t.map(Ne):String(t)}function jn(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}const zn=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function et(t,e,r,n,o){if(u.isFunction(n))return n.call(this,e,r);if(o&&(e=r),!!u.isString(e)){if(u.isString(n))return e.indexOf(n)!==-1;if(u.isRegExp(n))return n.test(e)}}function Jn(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,n)=>r.toUpperCase()+n)}function Kn(t,e){const r=u.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+r,{value:function(o,i,s){return this[n].call(this,e,o,i,s)},configurable:!0})})}class _e{constructor(e){e&&this.set(e)}set(e,r,n){const o=this;function i(a,c,l){const d=we(c);if(!d)throw new Error("header name must be a non-empty string");const f=u.findKey(o,d);(!f||o[f]===void 0||l===!0||l===void 0&&o[f]!==!1)&&(o[f||c]=Ne(a))}const s=(a,c)=>u.forEach(a,(l,d)=>i(l,d,c));return u.isPlainObject(e)||e instanceof this.constructor?s(e,r):u.isString(e)&&(e=e.trim())&&!zn(e)?s(qn(e),r):e!=null&&i(r,e,n),this}get(e,r){if(e=we(e),e){const n=u.findKey(this,e);if(n){const o=this[n];if(!r)return o;if(r===!0)return jn(o);if(u.isFunction(r))return r.call(this,o,n);if(u.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,r){if(e=we(e),e){const n=u.findKey(this,e);return!!(n&&this[n]!==void 0&&(!r||et(this,this[n],n,r)))}return!1}delete(e,r){const n=this;let o=!1;function i(s){if(s=we(s),s){const a=u.findKey(n,s);a&&(!r||et(n,n[a],a,r))&&(delete n[a],o=!0)}}return u.isArray(e)?e.forEach(i):i(e),o}clear(e){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const i=r[n];(!e||et(this,this[i],i,e,!0))&&(delete this[i],o=!0)}return o}normalize(e){const r=this,n={};return u.forEach(this,(o,i)=>{const s=u.findKey(n,i);if(s){r[s]=Ne(o),delete r[i];return}const a=e?Jn(i):String(i).trim();a!==i&&delete r[i],r[a]=Ne(o),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const r=Object.create(null);return u.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=e&&u.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,r])=>e+": "+r).join(`
3
- `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){const n=new this(e);return r.forEach(o=>n.set(o)),n}static accessor(e){const n=(this[nr]=this[nr]={accessors:{}}).accessors,o=this.prototype;function i(s){const a=we(s);n[a]||(Kn(o,s),n[a]=!0)}return u.isArray(e)?e.forEach(i):i(e),this}}_e.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),u.reduceDescriptors(_e.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(n){this[r]=n}}}),u.freezeMethods(_e);const V=_e;function tt(t,e){const r=this||Ze,n=e||r,o=V.from(n.headers);let i=n.data;return u.forEach(t,function(a){i=a.call(r,i,o.normalize(),e?e.status:void 0)}),o.normalize(),i}function or(t){return!!(t&&t.__CANCEL__)}function be(t,e,r){v.call(this,t??"canceled",v.ERR_CANCELED,e,r),this.name="CanceledError"}u.inherits(be,v,{__CANCEL__:!0});function Qn(t,e,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?t(r):e(new v("Request failed with status code "+r.status,[v.ERR_BAD_REQUEST,v.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}const Xn=B.hasStandardBrowserEnv?{write(t,e,r,n,o,i){const s=[t+"="+encodeURIComponent(e)];u.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),u.isString(n)&&s.push("path="+n),u.isString(o)&&s.push("domain="+o),i===!0&&s.push("secure"),document.cookie=s.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Yn(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Zn(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function ir(t,e){return t&&!Yn(e)?Zn(t,e):e}const eo=B.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");let n;function o(i){let s=i;return e&&(r.setAttribute("href",s),s=r.href),r.setAttribute("href",s),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=o(window.location.href),function(s){const a=u.isString(s)?o(s):s;return a.protocol===n.protocol&&a.host===n.host}}():function(){return function(){return!0}}();function to(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function ro(t,e){t=t||10;const r=new Array(t),n=new Array(t);let o=0,i=0,s;return e=e!==void 0?e:1e3,function(c){const l=Date.now(),d=n[i];s||(s=l),r[o]=c,n[o]=l;let f=i,y=0;for(;f!==o;)y+=r[f++],f=f%t;if(o=(o+1)%t,o===i&&(i=(i+1)%t),l-s<e)return;const w=d&&l-d;return w?Math.round(y*1e3/w):void 0}}function sr(t,e){let r=0;const n=ro(50,250);return o=>{const i=o.loaded,s=o.lengthComputable?o.total:void 0,a=i-r,c=n(a),l=i<=s;r=i;const d={loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&l?(s-i)/c:void 0,event:o};d[e?"download":"upload"]=!0,t(d)}}const rt={http:Nn,xhr:typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(r,n){let o=t.data;const i=V.from(t.headers).normalize();let{responseType:s,withXSRFToken:a}=t,c;function l(){t.cancelToken&&t.cancelToken.unsubscribe(c),t.signal&&t.signal.removeEventListener("abort",c)}let d;if(u.isFormData(o)){if(B.hasStandardBrowserEnv||B.hasStandardBrowserWebWorkerEnv)i.setContentType(!1);else if((d=i.getContentType())!==!1){const[h,...E]=d?d.split(";").map(S=>S.trim()).filter(Boolean):[];i.setContentType([h||"multipart/form-data",...E].join("; "))}}let f=new XMLHttpRequest;if(t.auth){const h=t.auth.username||"",E=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.set("Authorization","Basic "+btoa(h+":"+E))}const y=ir(t.baseURL,t.url);f.open(t.method.toUpperCase(),Yt(y,t.params,t.paramsSerializer),!0),f.timeout=t.timeout;function w(){if(!f)return;const h=V.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders()),S={data:!s||s==="text"||s==="json"?f.responseText:f.response,status:f.status,statusText:f.statusText,headers:h,config:t,request:f};Qn(function(P){r(P),l()},function(P){n(P),l()},S),f=null}if("onloadend"in f?f.onloadend=w:f.onreadystatechange=function(){!f||f.readyState!==4||f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)||setTimeout(w)},f.onabort=function(){f&&(n(new v("Request aborted",v.ECONNABORTED,t,f)),f=null)},f.onerror=function(){n(new v("Network Error",v.ERR_NETWORK,t,f)),f=null},f.ontimeout=function(){let E=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const S=t.transitional||er;t.timeoutErrorMessage&&(E=t.timeoutErrorMessage),n(new v(E,S.clarifyTimeoutError?v.ETIMEDOUT:v.ECONNABORTED,t,f)),f=null},B.hasStandardBrowserEnv&&(a&&u.isFunction(a)&&(a=a(t)),a||a!==!1&&eo(y))){const h=t.xsrfHeaderName&&t.xsrfCookieName&&Xn.read(t.xsrfCookieName);h&&i.set(t.xsrfHeaderName,h)}o===void 0&&i.setContentType(null),"setRequestHeader"in f&&u.forEach(i.toJSON(),function(E,S){f.setRequestHeader(S,E)}),u.isUndefined(t.withCredentials)||(f.withCredentials=!!t.withCredentials),s&&s!=="json"&&(f.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&f.addEventListener("progress",sr(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&f.upload&&f.upload.addEventListener("progress",sr(t.onUploadProgress)),(t.cancelToken||t.signal)&&(c=h=>{f&&(n(!h||h.type?new be(null,t,f):h),f.abort(),f=null)},t.cancelToken&&t.cancelToken.subscribe(c),t.signal&&(t.signal.aborted?c():t.signal.addEventListener("abort",c)));const p=to(y);if(p&&B.protocols.indexOf(p)===-1){n(new v("Unsupported protocol "+p+":",v.ERR_BAD_REQUEST,t));return}f.send(o||null)})}};u.forEach(rt,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const ar=t=>`- ${t}`,no=t=>u.isFunction(t)||t===null||t===!1,cr={getAdapter:t=>{t=u.isArray(t)?t:[t];const{length:e}=t;let r,n;const o={};for(let i=0;i<e;i++){r=t[i];let s;if(n=r,!no(r)&&(n=rt[(s=String(r)).toLowerCase()],n===void 0))throw new v(`Unknown adapter '${s}'`);if(n)break;o[s||"#"+i]=n}if(!n){const i=Object.entries(o).map(([a,c])=>`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build"));let s=e?i.length>1?`since :
3
+ `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){const n=new this(e);return r.forEach(o=>n.set(o)),n}static accessor(e){const n=(this[nr]=this[nr]={accessors:{}}).accessors,o=this.prototype;function i(s){const a=we(s);n[a]||(Kn(o,s),n[a]=!0)}return u.isArray(e)?e.forEach(i):i(e),this}}_e.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),u.reduceDescriptors(_e.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(n){this[r]=n}}}),u.freezeMethods(_e);const V=_e;function tt(t,e){const r=this||Ze,n=e||r,o=V.from(n.headers);let i=n.data;return u.forEach(t,function(a){i=a.call(r,i,o.normalize(),e?e.status:void 0)}),o.normalize(),i}function or(t){return!!(t&&t.__CANCEL__)}function be(t,e,r){v.call(this,t??"canceled",v.ERR_CANCELED,e,r),this.name="CanceledError"}u.inherits(be,v,{__CANCEL__:!0});function Qn(t,e,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?t(r):e(new v("Request failed with status code "+r.status,[v.ERR_BAD_REQUEST,v.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}const Xn=B.hasStandardBrowserEnv?{write(t,e,r,n,o,i){const s=[t+"="+encodeURIComponent(e)];u.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),u.isString(n)&&s.push("path="+n),u.isString(o)&&s.push("domain="+o),i===!0&&s.push("secure"),document.cookie=s.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Yn(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Zn(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function ir(t,e){return t&&!Yn(e)?Zn(t,e):e}const eo=B.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");let n;function o(i){let s=i;return e&&(r.setAttribute("href",s),s=r.href),r.setAttribute("href",s),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=o(window.location.href),function(s){const a=u.isString(s)?o(s):s;return a.protocol===n.protocol&&a.host===n.host}}():function(){return function(){return!0}}();function to(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function ro(t,e){t=t||10;const r=new Array(t),n=new Array(t);let o=0,i=0,s;return e=e!==void 0?e:1e3,function(c){const l=Date.now(),d=n[i];s||(s=l),r[o]=c,n[o]=l;let f=i,y=0;for(;f!==o;)y+=r[f++],f=f%t;if(o=(o+1)%t,o===i&&(i=(i+1)%t),l-s<e)return;const w=d&&l-d;return w?Math.round(y*1e3/w):void 0}}function sr(t,e){let r=0;const n=ro(50,250);return o=>{const i=o.loaded,s=o.lengthComputable?o.total:void 0,a=i-r,c=n(a),l=i<=s;r=i;const d={loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&l?(s-i)/c:void 0,event:o};d[e?"download":"upload"]=!0,t(d)}}const rt={http:Nn,xhr:typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(r,n){let o=t.data;const i=V.from(t.headers).normalize();let{responseType:s,withXSRFToken:a}=t,c;function l(){t.cancelToken&&t.cancelToken.unsubscribe(c),t.signal&&t.signal.removeEventListener("abort",c)}let d;if(u.isFormData(o)){if(B.hasStandardBrowserEnv||B.hasStandardBrowserWebWorkerEnv)i.setContentType(!1);else if((d=i.getContentType())!==!1){const[h,...E]=d?d.split(";").map(S=>S.trim()).filter(Boolean):[];i.setContentType([h||"multipart/form-data",...E].join("; "))}}let f=new XMLHttpRequest;if(t.auth){const h=t.auth.username||"",E=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.set("Authorization","Basic "+btoa(h+":"+E))}const y=ir(t.baseURL,t.url);f.open(t.method.toUpperCase(),Yt(y,t.params,t.paramsSerializer),!0),f.timeout=t.timeout;function w(){if(!f)return;const h=V.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders()),S={data:!s||s==="text"||s==="json"?f.responseText:f.response,status:f.status,statusText:f.statusText,headers:h,config:t,request:f};Qn(function(D){r(D),l()},function(D){n(D),l()},S),f=null}if("onloadend"in f?f.onloadend=w:f.onreadystatechange=function(){!f||f.readyState!==4||f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)||setTimeout(w)},f.onabort=function(){f&&(n(new v("Request aborted",v.ECONNABORTED,t,f)),f=null)},f.onerror=function(){n(new v("Network Error",v.ERR_NETWORK,t,f)),f=null},f.ontimeout=function(){let E=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const S=t.transitional||er;t.timeoutErrorMessage&&(E=t.timeoutErrorMessage),n(new v(E,S.clarifyTimeoutError?v.ETIMEDOUT:v.ECONNABORTED,t,f)),f=null},B.hasStandardBrowserEnv&&(a&&u.isFunction(a)&&(a=a(t)),a||a!==!1&&eo(y))){const h=t.xsrfHeaderName&&t.xsrfCookieName&&Xn.read(t.xsrfCookieName);h&&i.set(t.xsrfHeaderName,h)}o===void 0&&i.setContentType(null),"setRequestHeader"in f&&u.forEach(i.toJSON(),function(E,S){f.setRequestHeader(S,E)}),u.isUndefined(t.withCredentials)||(f.withCredentials=!!t.withCredentials),s&&s!=="json"&&(f.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&f.addEventListener("progress",sr(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&f.upload&&f.upload.addEventListener("progress",sr(t.onUploadProgress)),(t.cancelToken||t.signal)&&(c=h=>{f&&(n(!h||h.type?new be(null,t,f):h),f.abort(),f=null)},t.cancelToken&&t.cancelToken.subscribe(c),t.signal&&(t.signal.aborted?c():t.signal.addEventListener("abort",c)));const p=to(y);if(p&&B.protocols.indexOf(p)===-1){n(new v("Unsupported protocol "+p+":",v.ERR_BAD_REQUEST,t));return}f.send(o||null)})}};u.forEach(rt,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const ar=t=>`- ${t}`,no=t=>u.isFunction(t)||t===null||t===!1,cr={getAdapter:t=>{t=u.isArray(t)?t:[t];const{length:e}=t;let r,n;const o={};for(let i=0;i<e;i++){r=t[i];let s;if(n=r,!no(r)&&(n=rt[(s=String(r)).toLowerCase()],n===void 0))throw new v(`Unknown adapter '${s}'`);if(n)break;o[s||"#"+i]=n}if(!n){const i=Object.entries(o).map(([a,c])=>`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build"));let s=e?i.length>1?`since :
4
4
  `+i.map(ar).join(`
5
5
  `):" "+ar(i[0]):"as no adapter specified";throw new v("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return n},adapters:rt};function nt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new be(null,t)}function lr(t){return nt(t),t.headers=V.from(t.headers),t.data=tt.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),cr.getAdapter(t.adapter||Ze.adapter)(t).then(function(n){return nt(t),n.data=tt.call(t,t.transformResponse,n),n.headers=V.from(n.headers),n},function(n){return or(n)||(nt(t),n&&n.response&&(n.response.data=tt.call(t,t.transformResponse,n.response),n.response.headers=V.from(n.response.headers))),Promise.reject(n)})}const ur=t=>t instanceof V?t.toJSON():t;function ie(t,e){e=e||{};const r={};function n(l,d,f){return u.isPlainObject(l)&&u.isPlainObject(d)?u.merge.call({caseless:f},l,d):u.isPlainObject(d)?u.merge({},d):u.isArray(d)?d.slice():d}function o(l,d,f){if(u.isUndefined(d)){if(!u.isUndefined(l))return n(void 0,l,f)}else return n(l,d,f)}function i(l,d){if(!u.isUndefined(d))return n(void 0,d)}function s(l,d){if(u.isUndefined(d)){if(!u.isUndefined(l))return n(void 0,l)}else return n(void 0,d)}function a(l,d,f){if(f in e)return n(l,d);if(f in t)return n(void 0,l)}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(l,d)=>o(ur(l),ur(d),!0)};return u.forEach(Object.keys(Object.assign({},t,e)),function(d){const f=c[d]||o,y=f(t[d],e[d],d);u.isUndefined(y)&&f!==a||(r[d]=y)}),r}const fr="1.6.7",ot={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{ot[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});const dr={};ot.transitional=function(e,r,n){function o(i,s){return"[Axios v"+fr+"] Transitional option '"+i+"'"+s+(n?". "+n:"")}return(i,s,a)=>{if(e===!1)throw new v(o(s," has been removed"+(r?" in "+r:"")),v.ERR_DEPRECATED);return r&&!dr[s]&&(dr[s]=!0,console.warn(o(s," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(i,s,a):!0}};function oo(t,e,r){if(typeof t!="object")throw new v("options must be an object",v.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let o=n.length;for(;o-- >0;){const i=n[o],s=e[i];if(s){const a=t[i],c=a===void 0||s(a,i,t);if(c!==!0)throw new v("option "+i+" must be "+c,v.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new v("Unknown option "+i,v.ERR_BAD_OPTION)}}const it={assertOptions:oo,validators:ot},q=it.validators;class xe{constructor(e){this.defaults=e,this.interceptors={request:new Zt,response:new Zt}}async request(e,r){try{return await this._request(e,r)}catch(n){if(n instanceof Error){let o;Error.captureStackTrace?Error.captureStackTrace(o={}):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
6
- `+i):n.stack=i}throw n}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=ie(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:i}=r;n!==void 0&&it.assertOptions(n,{silentJSONParsing:q.transitional(q.boolean),forcedJSONParsing:q.transitional(q.boolean),clarifyTimeoutError:q.transitional(q.boolean)},!1),o!=null&&(u.isFunction(o)?r.paramsSerializer={serialize:o}:it.assertOptions(o,{encode:q.function,serialize:q.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&u.merge(i.common,i[r.method]);i&&u.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),r.headers=V.concat(s,i);const a=[];let c=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(r)===!1||(c=c&&h.synchronous,a.unshift(h.fulfilled,h.rejected))});const l=[];this.interceptors.response.forEach(function(h){l.push(h.fulfilled,h.rejected)});let d,f=0,y;if(!c){const p=[lr.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,l),y=p.length,d=Promise.resolve(r);f<y;)d=d.then(p[f++],p[f++]);return d}y=a.length;let w=r;for(f=0;f<y;){const p=a[f++],h=a[f++];try{w=p(w)}catch(E){h.call(this,E);break}}try{d=lr.call(this,w)}catch(p){return Promise.reject(p)}for(f=0,y=l.length;f<y;)d=d.then(l[f++],l[f++]);return d}getUri(e){e=ie(this.defaults,e);const r=ir(e.baseURL,e.url);return Yt(r,e.params,e.paramsSerializer)}}u.forEach(["delete","get","head","options"],function(e){xe.prototype[e]=function(r,n){return this.request(ie(n||{},{method:e,url:r,data:(n||{}).data}))}}),u.forEach(["post","put","patch"],function(e){function r(n){return function(i,s,a){return this.request(ie(a||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}xe.prototype[e]=r(),xe.prototype[e+"Form"]=r(!0)});const Ue=xe;class st{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(o=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](o);n._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(a=>{n.subscribe(a),i=a}).then(o);return s.cancel=function(){n.unsubscribe(i)},s},e(function(i,s,a){n.reason||(n.reason=new be(i,s,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}static source(){let e;return{token:new st(function(o){e=o}),cancel:e}}}const io=st;function so(t){return function(r){return t.apply(null,r)}}function ao(t){return u.isObject(t)&&t.isAxiosError===!0}const at={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(at).forEach(([t,e])=>{at[e]=t});const co=at;function pr(t){const e=new Ue(t),r=N(Ue.prototype.request,e);return u.extend(r,Ue.prototype,e,{allOwnKeys:!0}),u.extend(r,e,null,{allOwnKeys:!0}),r.create=function(o){return pr(ie(t,o))},r}const O=pr(Ze);O.Axios=Ue,O.CanceledError=be,O.CancelToken=io,O.isCancel=or,O.VERSION=fr,O.toFormData=Fe,O.AxiosError=v,O.Cancel=O.CanceledError,O.all=function(e){return Promise.all(e)},O.spread=so,O.isAxiosError=ao,O.mergeConfig=ie,O.AxiosHeaders=V,O.formToJSON=t=>rr(u.isHTMLForm(t)?new FormData(t):t),O.getAdapter=cr.getAdapter,O.HttpStatusCode=co,O.default=O;function lo(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function uo(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}),r}var fo=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;e[r]=o;for(r in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var i=Object.getOwnPropertySymbols(e);if(i.length!==1||i[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,r);if(s.value!==o||s.enumerable!==!0)return!1}return!0},hr=typeof Symbol<"u"&&Symbol,po=fo,ho=function(){return typeof hr!="function"||typeof Symbol!="function"||typeof hr("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:po()},yr={foo:{}},yo=Object,mo=function(){return{__proto__:yr}.foo===yr.foo&&!({__proto__:null}instanceof yo)},go="Function.prototype.bind called on incompatible ",ct=Array.prototype.slice,So=Object.prototype.toString,wo="[object Function]",bo=function(e){var r=this;if(typeof r!="function"||So.call(r)!==wo)throw new TypeError(go+r);for(var n=ct.call(arguments,1),o,i=function(){if(this instanceof o){var d=r.apply(this,n.concat(ct.call(arguments)));return Object(d)===d?d:this}else return r.apply(e,n.concat(ct.call(arguments)))},s=Math.max(0,r.length-n.length),a=[],c=0;c<s;c++)a.push("$"+c);if(o=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this,arguments); }")(i),r.prototype){var l=function(){};l.prototype=r.prototype,o.prototype=new l,l.prototype=null}return o},vo=bo,lt=Function.prototype.bind||vo,Eo=lt,Ao=Eo.call(Function.call,Object.prototype.hasOwnProperty),b,se=SyntaxError,mr=Function,ae=TypeError,ut=function(t){try{return mr('"use strict"; return ('+t+").constructor;")()}catch{}},Y=Object.getOwnPropertyDescriptor;if(Y)try{Y({},"")}catch{Y=null}var ft=function(){throw new ae},Oo=Y?function(){try{return arguments.callee,ft}catch{try{return Y(arguments,"callee").get}catch{return ft}}}():ft,ce=ho(),Ro=mo(),R=Object.getPrototypeOf||(Ro?function(t){return t.__proto__}:null),le={},Co=typeof Uint8Array>"u"||!R?b:R(Uint8Array),Z={"%AggregateError%":typeof AggregateError>"u"?b:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?b:ArrayBuffer,"%ArrayIteratorPrototype%":ce&&R?R([][Symbol.iterator]()):b,"%AsyncFromSyncIteratorPrototype%":b,"%AsyncFunction%":le,"%AsyncGenerator%":le,"%AsyncGeneratorFunction%":le,"%AsyncIteratorPrototype%":le,"%Atomics%":typeof Atomics>"u"?b:Atomics,"%BigInt%":typeof BigInt>"u"?b:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?b:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?b:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?b:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?b:Float32Array,"%Float64Array%":typeof Float64Array>"u"?b:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?b:FinalizationRegistry,"%Function%":mr,"%GeneratorFunction%":le,"%Int8Array%":typeof Int8Array>"u"?b:Int8Array,"%Int16Array%":typeof Int16Array>"u"?b:Int16Array,"%Int32Array%":typeof Int32Array>"u"?b:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":ce&&R?R(R([][Symbol.iterator]())):b,"%JSON%":typeof JSON=="object"?JSON:b,"%Map%":typeof Map>"u"?b:Map,"%MapIteratorPrototype%":typeof Map>"u"||!ce||!R?b:R(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?b:Promise,"%Proxy%":typeof Proxy>"u"?b:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?b:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?b:Set,"%SetIteratorPrototype%":typeof Set>"u"||!ce||!R?b:R(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?b:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":ce&&R?R(""[Symbol.iterator]()):b,"%Symbol%":ce?Symbol:b,"%SyntaxError%":se,"%ThrowTypeError%":Oo,"%TypedArray%":Co,"%TypeError%":ae,"%Uint8Array%":typeof Uint8Array>"u"?b:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?b:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?b:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?b:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?b:WeakMap,"%WeakRef%":typeof WeakRef>"u"?b:WeakRef,"%WeakSet%":typeof WeakSet>"u"?b:WeakSet};if(R)try{null.error}catch(t){var Io=R(R(t));Z["%Error.prototype%"]=Io}var To=function t(e){var r;if(e==="%AsyncFunction%")r=ut("async function () {}");else if(e==="%GeneratorFunction%")r=ut("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=ut("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var o=t("%AsyncGenerator%");o&&R&&(r=R(o.prototype))}return Z[e]=r,r},gr={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},ve=lt,ke=Ao,Po=ve.call(Function.call,Array.prototype.concat),Do=ve.call(Function.apply,Array.prototype.splice),Sr=ve.call(Function.call,String.prototype.replace),Be=ve.call(Function.call,String.prototype.slice),Lo=ve.call(Function.call,RegExp.prototype.exec),Fo=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,No=/\\(\\)?/g,_o=function(e){var r=Be(e,0,1),n=Be(e,-1);if(r==="%"&&n!=="%")throw new se("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new se("invalid intrinsic syntax, expected opening `%`");var o=[];return Sr(e,Fo,function(i,s,a,c){o[o.length]=a?Sr(c,No,"$1"):s||i}),o},xo=function(e,r){var n=e,o;if(ke(gr,n)&&(o=gr[n],n="%"+o[0]+"%"),ke(Z,n)){var i=Z[n];if(i===le&&(i=To(n)),typeof i>"u"&&!r)throw new ae("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:i}}throw new se("intrinsic "+e+" does not exist!")},dt=function(e,r){if(typeof e!="string"||e.length===0)throw new ae("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new ae('"allowMissing" argument must be a boolean');if(Lo(/^%?[^%]*%?$/,e)===null)throw new se("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=_o(e),o=n.length>0?n[0]:"",i=xo("%"+o+"%",r),s=i.name,a=i.value,c=!1,l=i.alias;l&&(o=l[0],Do(n,Po([0,1],l)));for(var d=1,f=!0;d<n.length;d+=1){var y=n[d],w=Be(y,0,1),p=Be(y,-1);if((w==='"'||w==="'"||w==="`"||p==='"'||p==="'"||p==="`")&&w!==p)throw new se("property names with quotes must have matching quotes");if((y==="constructor"||!f)&&(c=!0),o+="."+y,s="%"+o+"%",ke(Z,s))a=Z[s];else if(a!=null){if(!(y in a)){if(!r)throw new ae("base intrinsic for "+e+" exists, but the property is not available.");return}if(Y&&d+1>=n.length){var h=Y(a,y);f=!!h,f&&"get"in h&&!("originalValue"in h.get)?a=h.get:a=a[y]}else f=ke(a,y),a=a[y];f&&!c&&(Z[s]=a)}}return a},wr={exports:{}};(function(t){var e=lt,r=dt,n=r("%Function.prototype.apply%"),o=r("%Function.prototype.call%"),i=r("%Reflect.apply%",!0)||e.call(o,n),s=r("%Object.getOwnPropertyDescriptor%",!0),a=r("%Object.defineProperty%",!0),c=r("%Math.max%");if(a)try{a({},"a",{value:1})}catch{a=null}t.exports=function(f){var y=i(e,o,arguments);if(s&&a){var w=s(y,"length");w.configurable&&a(y,"length",{value:1+c(0,f.length-(arguments.length-1))})}return y};var l=function(){return i(e,n,arguments)};a?a(t.exports,"apply",{value:l}):t.exports.apply=l})(wr);var Uo=wr.exports,br=dt,vr=Uo,ko=vr(br("String.prototype.indexOf")),Bo=function(e,r){var n=br(e,!!r);return typeof n=="function"&&ko(e,".prototype.")>-1?vr(n):n};const Mo=uo(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var pt=typeof Map=="function"&&Map.prototype,ht=Object.getOwnPropertyDescriptor&&pt?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Me=pt&&ht&&typeof ht.get=="function"?ht.get:null,Er=pt&&Map.prototype.forEach,yt=typeof Set=="function"&&Set.prototype,mt=Object.getOwnPropertyDescriptor&&yt?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,He=yt&&mt&&typeof mt.get=="function"?mt.get:null,Ar=yt&&Set.prototype.forEach,Ho=typeof WeakMap=="function"&&WeakMap.prototype,Ee=Ho?WeakMap.prototype.has:null,$o=typeof WeakSet=="function"&&WeakSet.prototype,Ae=$o?WeakSet.prototype.has:null,Vo=typeof WeakRef=="function"&&WeakRef.prototype,Or=Vo?WeakRef.prototype.deref:null,Go=Boolean.prototype.valueOf,Wo=Object.prototype.toString,qo=Function.prototype.toString,jo=String.prototype.match,gt=String.prototype.slice,j=String.prototype.replace,zo=String.prototype.toUpperCase,Rr=String.prototype.toLowerCase,Cr=RegExp.prototype.test,Ir=Array.prototype.concat,M=Array.prototype.join,Jo=Array.prototype.slice,Tr=Math.floor,St=typeof BigInt=="function"?BigInt.prototype.valueOf:null,wt=Object.getOwnPropertySymbols,bt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,ue=typeof Symbol=="function"&&typeof Symbol.iterator=="object",D=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===ue||!0)?Symbol.toStringTag:null,Pr=Object.prototype.propertyIsEnumerable,Dr=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function Lr(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||Cr.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-Tr(-t):Tr(t);if(n!==t){var o=String(n),i=gt.call(e,o.length+1);return j.call(o,r,"$&_")+"."+j.call(j.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return j.call(e,r,"$&_")}var vt=Mo,Fr=vt.custom,Nr=Ur(Fr)?Fr:null,Ko=function t(e,r,n,o){var i=r||{};if(z(i,"quoteStyle")&&i.quoteStyle!=="single"&&i.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(z(i,"maxStringLength")&&(typeof i.maxStringLength=="number"?i.maxStringLength<0&&i.maxStringLength!==1/0:i.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=z(i,"customInspect")?i.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(z(i,"indent")&&i.indent!==null&&i.indent!==" "&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(z(i,"numericSeparator")&&typeof i.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=i.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Br(e,i);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var c=String(e);return a?Lr(e,c):c}if(typeof e=="bigint"){var l=String(e)+"n";return a?Lr(e,l):l}var d=typeof i.depth>"u"?5:i.depth;if(typeof n>"u"&&(n=0),n>=d&&d>0&&typeof e=="object")return Et(e)?"[Array]":"[Object]";var f=pi(i,n);if(typeof o>"u")o=[];else if(kr(o,e)>=0)return"[Circular]";function y(W,ye,je){if(ye&&(o=Jo.call(o),o.push(ye)),je){var me={depth:i.depth};return z(i,"quoteStyle")&&(me.quoteStyle=i.quoteStyle),t(W,me,n+1,o)}return t(W,i,n+1,o)}if(typeof e=="function"&&!xr(e)){var w=oi(e),p=$e(e,y);return"[Function"+(w?": "+w:" (anonymous)")+"]"+(p.length>0?" { "+M.call(p,", ")+" }":"")}if(Ur(e)){var h=ue?j.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):bt.call(e);return typeof e=="object"&&!ue?Oe(h):h}if(ui(e)){for(var E="<"+Rr.call(String(e.nodeName)),S=e.attributes||[],I=0;I<S.length;I++)E+=" "+S[I].name+"="+_r(Qo(S[I].value),"double",i);return E+=">",e.childNodes&&e.childNodes.length&&(E+="..."),E+="</"+Rr.call(String(e.nodeName))+">",E}if(Et(e)){if(e.length===0)return"[]";var P=$e(e,y);return f&&!di(P)?"["+Ot(P,f)+"]":"[ "+M.call(P,", ")+" ]"}if(Yo(e)){var K=$e(e,y);return!("cause"in Error.prototype)&&"cause"in e&&!Pr.call(e,"cause")?"{ ["+String(e)+"] "+M.call(Ir.call("[cause]: "+y(e.cause),K),", ")+" }":K.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+M.call(K,", ")+" }"}if(typeof e=="object"&&s){if(Nr&&typeof e[Nr]=="function"&&vt)return vt(e,{depth:d-n});if(s!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(ii(e)){var Ce=[];return Er&&Er.call(e,function(W,ye){Ce.push(y(ye,e,!0)+" => "+y(W,e))}),Mr("Map",Me.call(e),Ce,f)}if(ci(e)){var qe=[];return Ar&&Ar.call(e,function(W){qe.push(y(W,e))}),Mr("Set",He.call(e),qe,f)}if(si(e))return At("WeakMap");if(li(e))return At("WeakSet");if(ai(e))return At("WeakRef");if(ei(e))return Oe(y(Number(e)));if(ri(e))return Oe(y(St.call(e)));if(ti(e))return Oe(Go.call(e));if(Zo(e))return Oe(y(String(e)));if(!Xo(e)&&!xr(e)){var ne=$e(e,y),Q=Dr?Dr(e)===Object.prototype:e instanceof Object||e.constructor===Object,pe=e instanceof Object?"":"null prototype",he=!Q&&D&&Object(e)===e&&D in e?gt.call(J(e),8,-1):pe?"Object":"",Ie=Q||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",U=Ie+(he||pe?"["+M.call(Ir.call([],he||[],pe||[]),": ")+"] ":"");return ne.length===0?U+"{}":f?U+"{"+Ot(ne,f)+"}":U+"{ "+M.call(ne,", ")+" }"}return String(e)};function _r(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function Qo(t){return j.call(String(t),/"/g,"&quot;")}function Et(t){return J(t)==="[object Array]"&&(!D||!(typeof t=="object"&&D in t))}function Xo(t){return J(t)==="[object Date]"&&(!D||!(typeof t=="object"&&D in t))}function xr(t){return J(t)==="[object RegExp]"&&(!D||!(typeof t=="object"&&D in t))}function Yo(t){return J(t)==="[object Error]"&&(!D||!(typeof t=="object"&&D in t))}function Zo(t){return J(t)==="[object String]"&&(!D||!(typeof t=="object"&&D in t))}function ei(t){return J(t)==="[object Number]"&&(!D||!(typeof t=="object"&&D in t))}function ti(t){return J(t)==="[object Boolean]"&&(!D||!(typeof t=="object"&&D in t))}function Ur(t){if(ue)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!bt)return!1;try{return bt.call(t),!0}catch{}return!1}function ri(t){if(!t||typeof t!="object"||!St)return!1;try{return St.call(t),!0}catch{}return!1}var ni=Object.prototype.hasOwnProperty||function(t){return t in this};function z(t,e){return ni.call(t,e)}function J(t){return Wo.call(t)}function oi(t){if(t.name)return t.name;var e=jo.call(qo.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function kr(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function ii(t){if(!Me||!t||typeof t!="object")return!1;try{Me.call(t);try{He.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}function si(t){if(!Ee||!t||typeof t!="object")return!1;try{Ee.call(t,Ee);try{Ae.call(t,Ae)}catch{return!0}return t instanceof WeakMap}catch{}return!1}function ai(t){if(!Or||!t||typeof t!="object")return!1;try{return Or.call(t),!0}catch{}return!1}function ci(t){if(!He||!t||typeof t!="object")return!1;try{He.call(t);try{Me.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}function li(t){if(!Ae||!t||typeof t!="object")return!1;try{Ae.call(t,Ae);try{Ee.call(t,Ee)}catch{return!0}return t instanceof WeakSet}catch{}return!1}function ui(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}function Br(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return Br(gt.call(t,0,e.maxStringLength),e)+n}var o=j.call(j.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,fi);return _r(o,"single",e)}function fi(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+zo.call(e.toString(16))}function Oe(t){return"Object("+t+")"}function At(t){return t+" { ? }"}function Mr(t,e,r,n){var o=n?Ot(r,n):M.call(r,", ");return t+" ("+e+") {"+o+"}"}function di(t){for(var e=0;e<t.length;e++)if(kr(t[e],`
6
+ `+i):n.stack=i}throw n}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=ie(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:i}=r;n!==void 0&&it.assertOptions(n,{silentJSONParsing:q.transitional(q.boolean),forcedJSONParsing:q.transitional(q.boolean),clarifyTimeoutError:q.transitional(q.boolean)},!1),o!=null&&(u.isFunction(o)?r.paramsSerializer={serialize:o}:it.assertOptions(o,{encode:q.function,serialize:q.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&u.merge(i.common,i[r.method]);i&&u.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),r.headers=V.concat(s,i);const a=[];let c=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(r)===!1||(c=c&&h.synchronous,a.unshift(h.fulfilled,h.rejected))});const l=[];this.interceptors.response.forEach(function(h){l.push(h.fulfilled,h.rejected)});let d,f=0,y;if(!c){const p=[lr.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,l),y=p.length,d=Promise.resolve(r);f<y;)d=d.then(p[f++],p[f++]);return d}y=a.length;let w=r;for(f=0;f<y;){const p=a[f++],h=a[f++];try{w=p(w)}catch(E){h.call(this,E);break}}try{d=lr.call(this,w)}catch(p){return Promise.reject(p)}for(f=0,y=l.length;f<y;)d=d.then(l[f++],l[f++]);return d}getUri(e){e=ie(this.defaults,e);const r=ir(e.baseURL,e.url);return Yt(r,e.params,e.paramsSerializer)}}u.forEach(["delete","get","head","options"],function(e){xe.prototype[e]=function(r,n){return this.request(ie(n||{},{method:e,url:r,data:(n||{}).data}))}}),u.forEach(["post","put","patch"],function(e){function r(n){return function(i,s,a){return this.request(ie(a||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}xe.prototype[e]=r(),xe.prototype[e+"Form"]=r(!0)});const Ue=xe;class st{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(o=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](o);n._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(a=>{n.subscribe(a),i=a}).then(o);return s.cancel=function(){n.unsubscribe(i)},s},e(function(i,s,a){n.reason||(n.reason=new be(i,s,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}static source(){let e;return{token:new st(function(o){e=o}),cancel:e}}}const io=st;function so(t){return function(r){return t.apply(null,r)}}function ao(t){return u.isObject(t)&&t.isAxiosError===!0}const at={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(at).forEach(([t,e])=>{at[e]=t});const co=at;function pr(t){const e=new Ue(t),r=N(Ue.prototype.request,e);return u.extend(r,Ue.prototype,e,{allOwnKeys:!0}),u.extend(r,e,null,{allOwnKeys:!0}),r.create=function(o){return pr(ie(t,o))},r}const O=pr(Ze);O.Axios=Ue,O.CanceledError=be,O.CancelToken=io,O.isCancel=or,O.VERSION=fr,O.toFormData=Fe,O.AxiosError=v,O.Cancel=O.CanceledError,O.all=function(e){return Promise.all(e)},O.spread=so,O.isAxiosError=ao,O.mergeConfig=ie,O.AxiosHeaders=V,O.formToJSON=t=>rr(u.isHTMLForm(t)?new FormData(t):t),O.getAdapter=cr.getAdapter,O.HttpStatusCode=co,O.default=O;function lo(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function uo(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}),r}var fo=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;e[r]=o;for(r in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var i=Object.getOwnPropertySymbols(e);if(i.length!==1||i[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,r);if(s.value!==o||s.enumerable!==!0)return!1}return!0},hr=typeof Symbol<"u"&&Symbol,po=fo,ho=function(){return typeof hr!="function"||typeof Symbol!="function"||typeof hr("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:po()},yr={foo:{}},yo=Object,mo=function(){return{__proto__:yr}.foo===yr.foo&&!({__proto__:null}instanceof yo)},go="Function.prototype.bind called on incompatible ",ct=Array.prototype.slice,So=Object.prototype.toString,wo="[object Function]",bo=function(e){var r=this;if(typeof r!="function"||So.call(r)!==wo)throw new TypeError(go+r);for(var n=ct.call(arguments,1),o,i=function(){if(this instanceof o){var d=r.apply(this,n.concat(ct.call(arguments)));return Object(d)===d?d:this}else return r.apply(e,n.concat(ct.call(arguments)))},s=Math.max(0,r.length-n.length),a=[],c=0;c<s;c++)a.push("$"+c);if(o=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this,arguments); }")(i),r.prototype){var l=function(){};l.prototype=r.prototype,o.prototype=new l,l.prototype=null}return o},vo=bo,lt=Function.prototype.bind||vo,Eo=lt,Ao=Eo.call(Function.call,Object.prototype.hasOwnProperty),b,se=SyntaxError,mr=Function,ae=TypeError,ut=function(t){try{return mr('"use strict"; return ('+t+").constructor;")()}catch{}},Z=Object.getOwnPropertyDescriptor;if(Z)try{Z({},"")}catch{Z=null}var ft=function(){throw new ae},Oo=Z?function(){try{return arguments.callee,ft}catch{try{return Z(arguments,"callee").get}catch{return ft}}}():ft,ce=ho(),Ro=mo(),R=Object.getPrototypeOf||(Ro?function(t){return t.__proto__}:null),le={},Co=typeof Uint8Array>"u"||!R?b:R(Uint8Array),ee={"%AggregateError%":typeof AggregateError>"u"?b:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?b:ArrayBuffer,"%ArrayIteratorPrototype%":ce&&R?R([][Symbol.iterator]()):b,"%AsyncFromSyncIteratorPrototype%":b,"%AsyncFunction%":le,"%AsyncGenerator%":le,"%AsyncGeneratorFunction%":le,"%AsyncIteratorPrototype%":le,"%Atomics%":typeof Atomics>"u"?b:Atomics,"%BigInt%":typeof BigInt>"u"?b:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?b:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?b:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?b:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?b:Float32Array,"%Float64Array%":typeof Float64Array>"u"?b:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?b:FinalizationRegistry,"%Function%":mr,"%GeneratorFunction%":le,"%Int8Array%":typeof Int8Array>"u"?b:Int8Array,"%Int16Array%":typeof Int16Array>"u"?b:Int16Array,"%Int32Array%":typeof Int32Array>"u"?b:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":ce&&R?R(R([][Symbol.iterator]())):b,"%JSON%":typeof JSON=="object"?JSON:b,"%Map%":typeof Map>"u"?b:Map,"%MapIteratorPrototype%":typeof Map>"u"||!ce||!R?b:R(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?b:Promise,"%Proxy%":typeof Proxy>"u"?b:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?b:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?b:Set,"%SetIteratorPrototype%":typeof Set>"u"||!ce||!R?b:R(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?b:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":ce&&R?R(""[Symbol.iterator]()):b,"%Symbol%":ce?Symbol:b,"%SyntaxError%":se,"%ThrowTypeError%":Oo,"%TypedArray%":Co,"%TypeError%":ae,"%Uint8Array%":typeof Uint8Array>"u"?b:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?b:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?b:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?b:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?b:WeakMap,"%WeakRef%":typeof WeakRef>"u"?b:WeakRef,"%WeakSet%":typeof WeakSet>"u"?b:WeakSet};if(R)try{null.error}catch(t){var Io=R(R(t));ee["%Error.prototype%"]=Io}var To=function t(e){var r;if(e==="%AsyncFunction%")r=ut("async function () {}");else if(e==="%GeneratorFunction%")r=ut("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=ut("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var o=t("%AsyncGenerator%");o&&R&&(r=R(o.prototype))}return ee[e]=r,r},gr={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},ve=lt,ke=Ao,Do=ve.call(Function.call,Array.prototype.concat),Po=ve.call(Function.apply,Array.prototype.splice),Sr=ve.call(Function.call,String.prototype.replace),Be=ve.call(Function.call,String.prototype.slice),Lo=ve.call(Function.call,RegExp.prototype.exec),Fo=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,No=/\\(\\)?/g,_o=function(e){var r=Be(e,0,1),n=Be(e,-1);if(r==="%"&&n!=="%")throw new se("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new se("invalid intrinsic syntax, expected opening `%`");var o=[];return Sr(e,Fo,function(i,s,a,c){o[o.length]=a?Sr(c,No,"$1"):s||i}),o},xo=function(e,r){var n=e,o;if(ke(gr,n)&&(o=gr[n],n="%"+o[0]+"%"),ke(ee,n)){var i=ee[n];if(i===le&&(i=To(n)),typeof i>"u"&&!r)throw new ae("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:i}}throw new se("intrinsic "+e+" does not exist!")},dt=function(e,r){if(typeof e!="string"||e.length===0)throw new ae("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new ae('"allowMissing" argument must be a boolean');if(Lo(/^%?[^%]*%?$/,e)===null)throw new se("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=_o(e),o=n.length>0?n[0]:"",i=xo("%"+o+"%",r),s=i.name,a=i.value,c=!1,l=i.alias;l&&(o=l[0],Po(n,Do([0,1],l)));for(var d=1,f=!0;d<n.length;d+=1){var y=n[d],w=Be(y,0,1),p=Be(y,-1);if((w==='"'||w==="'"||w==="`"||p==='"'||p==="'"||p==="`")&&w!==p)throw new se("property names with quotes must have matching quotes");if((y==="constructor"||!f)&&(c=!0),o+="."+y,s="%"+o+"%",ke(ee,s))a=ee[s];else if(a!=null){if(!(y in a)){if(!r)throw new ae("base intrinsic for "+e+" exists, but the property is not available.");return}if(Z&&d+1>=n.length){var h=Z(a,y);f=!!h,f&&"get"in h&&!("originalValue"in h.get)?a=h.get:a=a[y]}else f=ke(a,y),a=a[y];f&&!c&&(ee[s]=a)}}return a},wr={exports:{}};(function(t){var e=lt,r=dt,n=r("%Function.prototype.apply%"),o=r("%Function.prototype.call%"),i=r("%Reflect.apply%",!0)||e.call(o,n),s=r("%Object.getOwnPropertyDescriptor%",!0),a=r("%Object.defineProperty%",!0),c=r("%Math.max%");if(a)try{a({},"a",{value:1})}catch{a=null}t.exports=function(f){var y=i(e,o,arguments);if(s&&a){var w=s(y,"length");w.configurable&&a(y,"length",{value:1+c(0,f.length-(arguments.length-1))})}return y};var l=function(){return i(e,n,arguments)};a?a(t.exports,"apply",{value:l}):t.exports.apply=l})(wr);var Uo=wr.exports,br=dt,vr=Uo,ko=vr(br("String.prototype.indexOf")),Bo=function(e,r){var n=br(e,!!r);return typeof n=="function"&&ko(e,".prototype.")>-1?vr(n):n};const Mo=uo(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var pt=typeof Map=="function"&&Map.prototype,ht=Object.getOwnPropertyDescriptor&&pt?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Me=pt&&ht&&typeof ht.get=="function"?ht.get:null,Er=pt&&Map.prototype.forEach,yt=typeof Set=="function"&&Set.prototype,mt=Object.getOwnPropertyDescriptor&&yt?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,He=yt&&mt&&typeof mt.get=="function"?mt.get:null,Ar=yt&&Set.prototype.forEach,Ho=typeof WeakMap=="function"&&WeakMap.prototype,Ee=Ho?WeakMap.prototype.has:null,$o=typeof WeakSet=="function"&&WeakSet.prototype,Ae=$o?WeakSet.prototype.has:null,Vo=typeof WeakRef=="function"&&WeakRef.prototype,Or=Vo?WeakRef.prototype.deref:null,Go=Boolean.prototype.valueOf,Wo=Object.prototype.toString,qo=Function.prototype.toString,jo=String.prototype.match,gt=String.prototype.slice,j=String.prototype.replace,zo=String.prototype.toUpperCase,Rr=String.prototype.toLowerCase,Cr=RegExp.prototype.test,Ir=Array.prototype.concat,M=Array.prototype.join,Jo=Array.prototype.slice,Tr=Math.floor,St=typeof BigInt=="function"?BigInt.prototype.valueOf:null,wt=Object.getOwnPropertySymbols,bt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,ue=typeof Symbol=="function"&&typeof Symbol.iterator=="object",P=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===ue||!0)?Symbol.toStringTag:null,Dr=Object.prototype.propertyIsEnumerable,Pr=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function Lr(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||Cr.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-Tr(-t):Tr(t);if(n!==t){var o=String(n),i=gt.call(e,o.length+1);return j.call(o,r,"$&_")+"."+j.call(j.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return j.call(e,r,"$&_")}var vt=Mo,Fr=vt.custom,Nr=Ur(Fr)?Fr:null,Ko=function t(e,r,n,o){var i=r||{};if(z(i,"quoteStyle")&&i.quoteStyle!=="single"&&i.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(z(i,"maxStringLength")&&(typeof i.maxStringLength=="number"?i.maxStringLength<0&&i.maxStringLength!==1/0:i.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=z(i,"customInspect")?i.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(z(i,"indent")&&i.indent!==null&&i.indent!==" "&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(z(i,"numericSeparator")&&typeof i.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=i.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Br(e,i);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var c=String(e);return a?Lr(e,c):c}if(typeof e=="bigint"){var l=String(e)+"n";return a?Lr(e,l):l}var d=typeof i.depth>"u"?5:i.depth;if(typeof n>"u"&&(n=0),n>=d&&d>0&&typeof e=="object")return Et(e)?"[Array]":"[Object]";var f=pi(i,n);if(typeof o>"u")o=[];else if(kr(o,e)>=0)return"[Circular]";function y(W,ye,je){if(ye&&(o=Jo.call(o),o.push(ye)),je){var me={depth:i.depth};return z(i,"quoteStyle")&&(me.quoteStyle=i.quoteStyle),t(W,me,n+1,o)}return t(W,i,n+1,o)}if(typeof e=="function"&&!xr(e)){var w=oi(e),p=$e(e,y);return"[Function"+(w?": "+w:" (anonymous)")+"]"+(p.length>0?" { "+M.call(p,", ")+" }":"")}if(Ur(e)){var h=ue?j.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):bt.call(e);return typeof e=="object"&&!ue?Oe(h):h}if(ui(e)){for(var E="<"+Rr.call(String(e.nodeName)),S=e.attributes||[],I=0;I<S.length;I++)E+=" "+S[I].name+"="+_r(Qo(S[I].value),"double",i);return E+=">",e.childNodes&&e.childNodes.length&&(E+="..."),E+="</"+Rr.call(String(e.nodeName))+">",E}if(Et(e)){if(e.length===0)return"[]";var D=$e(e,y);return f&&!di(D)?"["+Ot(D,f)+"]":"[ "+M.call(D,", ")+" ]"}if(Yo(e)){var Q=$e(e,y);return!("cause"in Error.prototype)&&"cause"in e&&!Dr.call(e,"cause")?"{ ["+String(e)+"] "+M.call(Ir.call("[cause]: "+y(e.cause),Q),", ")+" }":Q.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+M.call(Q,", ")+" }"}if(typeof e=="object"&&s){if(Nr&&typeof e[Nr]=="function"&&vt)return vt(e,{depth:d-n});if(s!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(ii(e)){var Ce=[];return Er&&Er.call(e,function(W,ye){Ce.push(y(ye,e,!0)+" => "+y(W,e))}),Mr("Map",Me.call(e),Ce,f)}if(ci(e)){var qe=[];return Ar&&Ar.call(e,function(W){qe.push(y(W,e))}),Mr("Set",He.call(e),qe,f)}if(si(e))return At("WeakMap");if(li(e))return At("WeakSet");if(ai(e))return At("WeakRef");if(ei(e))return Oe(y(Number(e)));if(ri(e))return Oe(y(St.call(e)));if(ti(e))return Oe(Go.call(e));if(Zo(e))return Oe(y(String(e)));if(!Xo(e)&&!xr(e)){var ne=$e(e,y),X=Pr?Pr(e)===Object.prototype:e instanceof Object||e.constructor===Object,pe=e instanceof Object?"":"null prototype",he=!X&&P&&Object(e)===e&&P in e?gt.call(J(e),8,-1):pe?"Object":"",Ie=X||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",U=Ie+(he||pe?"["+M.call(Ir.call([],he||[],pe||[]),": ")+"] ":"");return ne.length===0?U+"{}":f?U+"{"+Ot(ne,f)+"}":U+"{ "+M.call(ne,", ")+" }"}return String(e)};function _r(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function Qo(t){return j.call(String(t),/"/g,"&quot;")}function Et(t){return J(t)==="[object Array]"&&(!P||!(typeof t=="object"&&P in t))}function Xo(t){return J(t)==="[object Date]"&&(!P||!(typeof t=="object"&&P in t))}function xr(t){return J(t)==="[object RegExp]"&&(!P||!(typeof t=="object"&&P in t))}function Yo(t){return J(t)==="[object Error]"&&(!P||!(typeof t=="object"&&P in t))}function Zo(t){return J(t)==="[object String]"&&(!P||!(typeof t=="object"&&P in t))}function ei(t){return J(t)==="[object Number]"&&(!P||!(typeof t=="object"&&P in t))}function ti(t){return J(t)==="[object Boolean]"&&(!P||!(typeof t=="object"&&P in t))}function Ur(t){if(ue)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!bt)return!1;try{return bt.call(t),!0}catch{}return!1}function ri(t){if(!t||typeof t!="object"||!St)return!1;try{return St.call(t),!0}catch{}return!1}var ni=Object.prototype.hasOwnProperty||function(t){return t in this};function z(t,e){return ni.call(t,e)}function J(t){return Wo.call(t)}function oi(t){if(t.name)return t.name;var e=jo.call(qo.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function kr(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function ii(t){if(!Me||!t||typeof t!="object")return!1;try{Me.call(t);try{He.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}function si(t){if(!Ee||!t||typeof t!="object")return!1;try{Ee.call(t,Ee);try{Ae.call(t,Ae)}catch{return!0}return t instanceof WeakMap}catch{}return!1}function ai(t){if(!Or||!t||typeof t!="object")return!1;try{return Or.call(t),!0}catch{}return!1}function ci(t){if(!He||!t||typeof t!="object")return!1;try{He.call(t);try{Me.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}function li(t){if(!Ae||!t||typeof t!="object")return!1;try{Ae.call(t,Ae);try{Ee.call(t,Ee)}catch{return!0}return t instanceof WeakSet}catch{}return!1}function ui(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}function Br(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return Br(gt.call(t,0,e.maxStringLength),e)+n}var o=j.call(j.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,fi);return _r(o,"single",e)}function fi(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+zo.call(e.toString(16))}function Oe(t){return"Object("+t+")"}function At(t){return t+" { ? }"}function Mr(t,e,r,n){var o=n?Ot(r,n):M.call(r,", ");return t+" ("+e+") {"+o+"}"}function di(t){for(var e=0;e<t.length;e++)if(kr(t[e],`
7
7
  `)>=0)return!1;return!0}function pi(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=M.call(Array(t.indent+1)," ");else return null;return{base:r,prev:M.call(Array(e+1),r)}}function Ot(t,e){if(t.length===0)return"";var r=`
8
8
  `+e.prev+e.base;return r+M.call(t,","+r)+`
9
- `+e.prev}function $e(t,e){var r=Et(t),n=[];if(r){n.length=t.length;for(var o=0;o<t.length;o++)n[o]=z(t,o)?e(t[o],t):""}var i=typeof wt=="function"?wt(t):[],s;if(ue){s={};for(var a=0;a<i.length;a++)s["$"+i[a]]=i[a]}for(var c in t)z(t,c)&&(r&&String(Number(c))===c&&c<t.length||ue&&s["$"+c]instanceof Symbol||(Cr.call(/[^\w$]/,c)?n.push(e(c,t)+": "+e(t[c],t)):n.push(c+": "+e(t[c],t))));if(typeof wt=="function")for(var l=0;l<i.length;l++)Pr.call(t,i[l])&&n.push("["+e(i[l])+"]: "+e(t[i[l]],t));return n}var Rt=dt,fe=Bo,hi=Ko,yi=Rt("%TypeError%"),Ve=Rt("%WeakMap%",!0),Ge=Rt("%Map%",!0),mi=fe("WeakMap.prototype.get",!0),gi=fe("WeakMap.prototype.set",!0),Si=fe("WeakMap.prototype.has",!0),wi=fe("Map.prototype.get",!0),bi=fe("Map.prototype.set",!0),vi=fe("Map.prototype.has",!0),Ct=function(t,e){for(var r=t,n;(n=r.next)!==null;r=n)if(n.key===e)return r.next=n.next,n.next=t.next,t.next=n,n},Ei=function(t,e){var r=Ct(t,e);return r&&r.value},Ai=function(t,e,r){var n=Ct(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},Oi=function(t,e){return!!Ct(t,e)},Ri=function(){var e,r,n,o={assert:function(i){if(!o.has(i))throw new yi("Side channel does not contain "+hi(i))},get:function(i){if(Ve&&i&&(typeof i=="object"||typeof i=="function")){if(e)return mi(e,i)}else if(Ge){if(r)return wi(r,i)}else if(n)return Ei(n,i)},has:function(i){if(Ve&&i&&(typeof i=="object"||typeof i=="function")){if(e)return Si(e,i)}else if(Ge){if(r)return vi(r,i)}else if(n)return Oi(n,i);return!1},set:function(i,s){Ve&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new Ve),gi(e,i,s)):Ge?(r||(r=new Ge),bi(r,i,s)):(n||(n={key:{},next:null}),Ai(n,i,s))}};return o},Ci=String.prototype.replace,Ii=/%20/g,It={RFC1738:"RFC1738",RFC3986:"RFC3986"},Tt={default:It.RFC3986,formatters:{RFC1738:function(t){return Ci.call(t,Ii,"+")},RFC3986:function(t){return String(t)}},RFC1738:It.RFC1738,RFC3986:It.RFC3986},Ti=Tt,Pt=Object.prototype.hasOwnProperty,ee=Array.isArray,H=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),Pi=function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(ee(n)){for(var o=[],i=0;i<n.length;++i)typeof n[i]<"u"&&o.push(n[i]);r.obj[r.prop]=o}}},Hr=function(e,r){for(var n=r&&r.plainObjects?Object.create(null):{},o=0;o<e.length;++o)typeof e[o]<"u"&&(n[o]=e[o]);return n},Di=function t(e,r,n){if(!r)return e;if(typeof r!="object"){if(ee(e))e.push(r);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!Pt.call(Object.prototype,r))&&(e[r]=!0);else return[e,r];return e}if(!e||typeof e!="object")return[e].concat(r);var o=e;return ee(e)&&!ee(r)&&(o=Hr(e,n)),ee(e)&&ee(r)?(r.forEach(function(i,s){if(Pt.call(e,s)){var a=e[s];a&&typeof a=="object"&&i&&typeof i=="object"?e[s]=t(a,i,n):e.push(i)}else e[s]=i}),e):Object.keys(r).reduce(function(i,s){var a=r[s];return Pt.call(i,s)?i[s]=t(i[s],a,n):i[s]=a,i},o)},Li=function(e,r){return Object.keys(r).reduce(function(n,o){return n[o]=r[o],n},e)},Fi=function(t,e,r){var n=t.replace(/\+/g," ");if(r==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},Ni=function(e,r,n,o,i){if(e.length===0)return e;var s=e;if(typeof e=="symbol"?s=Symbol.prototype.toString.call(e):typeof e!="string"&&(s=String(e)),n==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(d){return"%26%23"+parseInt(d.slice(2),16)+"%3B"});for(var a="",c=0;c<s.length;++c){var l=s.charCodeAt(c);if(l===45||l===46||l===95||l===126||l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||i===Ti.RFC1738&&(l===40||l===41)){a+=s.charAt(c);continue}if(l<128){a=a+H[l];continue}if(l<2048){a=a+(H[192|l>>6]+H[128|l&63]);continue}if(l<55296||l>=57344){a=a+(H[224|l>>12]+H[128|l>>6&63]+H[128|l&63]);continue}c+=1,l=65536+((l&1023)<<10|s.charCodeAt(c)&1023),a+=H[240|l>>18]+H[128|l>>12&63]+H[128|l>>6&63]+H[128|l&63]}return a},_i=function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],o=0;o<r.length;++o)for(var i=r[o],s=i.obj[i.prop],a=Object.keys(s),c=0;c<a.length;++c){var l=a[c],d=s[l];typeof d=="object"&&d!==null&&n.indexOf(d)===-1&&(r.push({obj:s,prop:l}),n.push(d))}return Pi(r),e},xi=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Ui=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},ki=function(e,r){return[].concat(e,r)},Bi=function(e,r){if(ee(e)){for(var n=[],o=0;o<e.length;o+=1)n.push(r(e[o]));return n}return r(e)},$r={arrayToObject:Hr,assign:Li,combine:ki,compact:_i,decode:Fi,encode:Ni,isBuffer:Ui,isRegExp:xi,maybeMap:Bi,merge:Di},Vr=Ri,We=$r,Re=Tt,Mi=Object.prototype.hasOwnProperty,Gr={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,r){return e+"["+r+"]"},repeat:function(e){return e}},G=Array.isArray,Hi=Array.prototype.push,Wr=function(t,e){Hi.apply(t,G(e)?e:[e])},$i=Date.prototype.toISOString,qr=Re.default,L={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:We.encode,encodeValuesOnly:!1,format:qr,formatter:Re.formatters[qr],indices:!1,serializeDate:function(e){return $i.call(e)},skipNulls:!1,strictNullHandling:!1},Vi=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},Dt={},Gi=function t(e,r,n,o,i,s,a,c,l,d,f,y,w,p,h,E){for(var S=e,I=E,P=0,K=!1;(I=I.get(Dt))!==void 0&&!K;){var Ce=I.get(e);if(P+=1,typeof Ce<"u"){if(Ce===P)throw new RangeError("Cyclic object value");K=!0}typeof I.get(Dt)>"u"&&(P=0)}if(typeof c=="function"?S=c(r,S):S instanceof Date?S=f(S):n==="comma"&&G(S)&&(S=We.maybeMap(S,function(me){return me instanceof Date?f(me):me})),S===null){if(i)return a&&!p?a(r,L.encoder,h,"key",y):r;S=""}if(Vi(S)||We.isBuffer(S)){if(a){var qe=p?r:a(r,L.encoder,h,"key",y);return[w(qe)+"="+w(a(S,L.encoder,h,"value",y))]}return[w(r)+"="+w(String(S))]}var ne=[];if(typeof S>"u")return ne;var Q;if(n==="comma"&&G(S))p&&a&&(S=We.maybeMap(S,a)),Q=[{value:S.length>0?S.join(",")||null:void 0}];else if(G(c))Q=c;else{var pe=Object.keys(S);Q=l?pe.sort(l):pe}for(var he=o&&G(S)&&S.length===1?r+"[]":r,Ie=0;Ie<Q.length;++Ie){var U=Q[Ie],W=typeof U=="object"&&typeof U.value<"u"?U.value:S[U];if(!(s&&W===null)){var ye=G(S)?typeof n=="function"?n(he,U):he:he+(d?"."+U:"["+U+"]");E.set(e,P);var je=Vr();je.set(Dt,E),Wr(ne,t(W,ye,n,o,i,s,n==="comma"&&p&&G(S)?null:a,c,l,d,f,y,w,p,h,je))}}return ne},Wi=function(e){if(!e)return L;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=e.charset||L.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=Re.default;if(typeof e.format<"u"){if(!Mi.call(Re.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var o=Re.formatters[n],i=L.filter;return(typeof e.filter=="function"||G(e.filter))&&(i=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:L.addQueryPrefix,allowDots:typeof e.allowDots>"u"?L.allowDots:!!e.allowDots,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:L.charsetSentinel,delimiter:typeof e.delimiter>"u"?L.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:L.encode,encoder:typeof e.encoder=="function"?e.encoder:L.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:L.encodeValuesOnly,filter:i,format:n,formatter:o,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:L.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:L.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:L.strictNullHandling}},qi=function(t,e){var r=t,n=Wi(e),o,i;typeof n.filter=="function"?(i=n.filter,r=i("",r)):G(n.filter)&&(i=n.filter,o=i);var s=[];if(typeof r!="object"||r===null)return"";var a;e&&e.arrayFormat in Gr?a=e.arrayFormat:e&&"indices"in e?a=e.indices?"indices":"repeat":a="indices";var c=Gr[a];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var l=c==="comma"&&e&&e.commaRoundTrip;o||(o=Object.keys(r)),n.sort&&o.sort(n.sort);for(var d=Vr(),f=0;f<o.length;++f){var y=o[f];n.skipNulls&&r[y]===null||Wr(s,Gi(r[y],y,c,l,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,d))}var w=s.join(n.delimiter),p=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?p+="utf8=%26%2310003%3B&":p+="utf8=%E2%9C%93&"),w.length>0?p+w:""},de=$r,Lt=Object.prototype.hasOwnProperty,ji=Array.isArray,C={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:de.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},zi=function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},jr=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},Ji="utf8=%26%2310003%3B",Ki="utf8=%E2%9C%93",Qi=function(e,r){var n={__proto__:null},o=r.ignoreQueryPrefix?e.replace(/^\?/,""):e,i=r.parameterLimit===1/0?void 0:r.parameterLimit,s=o.split(r.delimiter,i),a=-1,c,l=r.charset;if(r.charsetSentinel)for(c=0;c<s.length;++c)s[c].indexOf("utf8=")===0&&(s[c]===Ki?l="utf-8":s[c]===Ji&&(l="iso-8859-1"),a=c,c=s.length);for(c=0;c<s.length;++c)if(c!==a){var d=s[c],f=d.indexOf("]="),y=f===-1?d.indexOf("="):f+1,w,p;y===-1?(w=r.decoder(d,C.decoder,l,"key"),p=r.strictNullHandling?null:""):(w=r.decoder(d.slice(0,y),C.decoder,l,"key"),p=de.maybeMap(jr(d.slice(y+1),r),function(h){return r.decoder(h,C.decoder,l,"value")})),p&&r.interpretNumericEntities&&l==="iso-8859-1"&&(p=zi(p)),d.indexOf("[]=")>-1&&(p=ji(p)?[p]:p),Lt.call(n,w)?n[w]=de.combine(n[w],p):n[w]=p}return n},Xi=function(t,e,r,n){for(var o=n?e:jr(e,r),i=t.length-1;i>=0;--i){var s,a=t[i];if(a==="[]"&&r.parseArrays)s=[].concat(o);else{s=r.plainObjects?Object.create(null):{};var c=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,l=parseInt(c,10);!r.parseArrays&&c===""?s={0:o}:!isNaN(l)&&a!==c&&String(l)===c&&l>=0&&r.parseArrays&&l<=r.arrayLimit?(s=[],s[l]=o):c!=="__proto__"&&(s[c]=o)}o=s}return o},Yi=function(e,r,n,o){if(e){var i=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,c=n.depth>0&&s.exec(i),l=c?i.slice(0,c.index):i,d=[];if(l){if(!n.plainObjects&&Lt.call(Object.prototype,l)&&!n.allowPrototypes)return;d.push(l)}for(var f=0;n.depth>0&&(c=a.exec(i))!==null&&f<n.depth;){if(f+=1,!n.plainObjects&&Lt.call(Object.prototype,c[1].slice(1,-1))&&!n.allowPrototypes)return;d.push(c[1])}return c&&d.push("["+i.slice(c.index)+"]"),Xi(d,r,n,o)}},Zi=function(e){if(!e)return C;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=typeof e.charset>"u"?C.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?C.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:C.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:C.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:C.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:C.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:C.comma,decoder:typeof e.decoder=="function"?e.decoder:C.decoder,delimiter:typeof e.delimiter=="string"||de.isRegExp(e.delimiter)?e.delimiter:C.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:C.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:C.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:C.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:C.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:C.strictNullHandling}},es=function(t,e){var r=Zi(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof t=="string"?Qi(t,r):t,o=r.plainObjects?Object.create(null):{},i=Object.keys(n),s=0;s<i.length;++s){var a=i[s],c=Yi(a,n[a],r,typeof t=="string");o=de.merge(o,c,r)}return r.allowSparse===!0?o:de.compact(o)},ts=qi,rs=es,ns=Tt,os={formats:ns,parse:rs,stringify:ts};const is=lo(os);class zr{constructor(e){m(this,"axiosInstance");this.axiosInstance=O.create({baseURL:e,timeout:12e4})}Request(e){return new Promise((r,n)=>{this.axiosInstance.request(e).then(o=>r(o)).catch(o=>n(o))})}Get(e,r,n){return new Promise((o,i)=>{r&&(n?n.params=r:n={params:r}),n&&(n.paramsSerializer={serialize:(s,a)=>is.stringify(s,{indices:!1})}),this.axiosInstance.get(e,n??{}).then(({data:s})=>o(s)).catch(s=>i(s))})}Post(e,r,n){return new Promise((o,i)=>{this.axiosInstance.post(e,r,n??{}).then(({data:s})=>o(s)).catch(s=>i(s))})}Put(e,r,n){return new Promise((o,i)=>{this.axiosInstance.put(e,r,n??{}).then(({data:s})=>o(s)).catch(s=>i(s))})}Delete(e,r,n){return new Promise((o,i)=>{r&&(n?n.data=r:n={data:r}),this.axiosInstance.delete(e,n??{}).then(({data:s})=>o(s)).catch(s=>i(s))})}}class ss{onAddLocalStream(e){console.debug("onAddLocalStream:",e)}onAddRemoteStream(e){console.debug("onAddRemoteStream:",e)}onError(e){console.debug("onError:",e)}onStartSuccess(e){console.debug("onStartSuccess:",e)}onDataChannelMessage(e){console.debug("onDataChannelMessage:",e)}onStopDesktopShare(){console.debug("onStopDesktopShare")}}var g=(t=>(t[t.UNKNOWN=0]="UNKNOWN",t[t.AUDIO=1]="AUDIO",t[t.VIDEO=2]="VIDEO",t[t.RTSP_PULL=3]="RTSP_PULL",t[t.AUDIO_PUSH=4]="AUDIO_PUSH",t[t.VIDEO_PUSH=5]="VIDEO_PUSH",t[t.AUDIO_HALF=6]="AUDIO_HALF",t[t.VIDEO_HALF=7]="VIDEO_HALF",t))(g||{}),te=(t=>(t.FRONT_FACING="user",t.BACK_FACING="environment",t))(te||{});class Ft{constructor(e){m(this,"peerConnection");m(this,"sessionListener",new ss);m(this,"isCallOut",!1);m(this,"sessionType",g.UNKNOWN);m(this,"localStream");m(this,"remoteStream");m(this,"dataChannel");m(this,"hasSetRemoteSdp",!1);m(this,"facingMode",te.FRONT_FACING);m(this,"facingChanging",!1);m(this,"muted",!1);m(this,"openCamera",!1);m(this,"desktopSharing",!1);this.sessionType=e}setListener(e){this.sessionListener=e}start(e,r){if(!e&&!r){this.error(new Error("start failed, remoteSdp is null."));return}switch(this.isCallOut=e,this.hasSetRemoteSdp=!1,this.facingMode=te.FRONT_FACING,this.facingChanging=!1,this.muted=!1,this.desktopSharing=!1,this.peerConnection=new RTCPeerConnection({iceServers:[]}),this.peerConnection.onnegotiationneeded=()=>{switch(this.sessionType){case g.AUDIO_PUSH:case g.VIDEO_PUSH:case g.AUDIO_HALF:case g.VIDEO_HALF:this.createDataChannel()}e?(console.debug("webrtc call out"),this.peerConnection.createOffer().then(n=>{console.debug("webrtc createOffer success"),this.peerConnection.setLocalDescription(n).then(()=>{console.debug("webrtc setLocalDescription success")}).catch(o=>{this.error(o)})}).catch(n=>{this.error(n)})):(console.debug("webrtc call in: ",r),this.peerConnection.setRemoteDescription(new RTCSessionDescription({type:"offer",sdp:r})).then(()=>{console.debug("webrtc setRemoteDescription success"),this.peerConnection.createAnswer().then(n=>{console.debug("webrtc createAnswer success"),this.peerConnection.setLocalDescription(n).then(()=>{console.debug("webrtc setLocalDescription success")}).catch(o=>{this.error(o)})}).catch(n=>{this.error(n)})}).catch(n=>{this.error(n)}))},this.peerConnection.onicegatheringstatechange=()=>{var n;console.debug("webrtc onicegatheringstatechange",(n=this.peerConnection)==null?void 0:n.iceGatheringState),this.peerConnection&&this.peerConnection.iceGatheringState=="complete"&&this.peerConnection.localDescription&&this.sessionListener.onStartSuccess(this.peerConnection.localDescription)},this.peerConnection.ontrack=n=>{console.debug("webrtc ontrack");for(let o=0;o<n.streams.length;o++)this.remoteStream?n.streams[o].getTracks().forEach(i=>{var s;(s=this.remoteStream)==null||s.addTrack(i)}):this.remoteStream=new MediaStream(n.streams[o]);this.sessionListener.onAddRemoteStream(this.remoteStream)},this.peerConnection.oniceconnectionstatechange=n=>{var o,i,s,a,c;console.debug("oniceconnectionstatechange",(o=this.peerConnection)==null?void 0:o.iceConnectionState),(((i=this.peerConnection)==null?void 0:i.iceConnectionState)=="completed"||((s=this.peerConnection)==null?void 0:s.iceConnectionState)=="disconnected"||((a=this.peerConnection)==null?void 0:a.iceConnectionState)=="failed"||((c=this.peerConnection)==null?void 0:c.iceConnectionState)=="closed")&&(this.stop(),this.sessionListener.onError(new Error("session closed.")))},this.sessionType){case g.RTSP_PULL:this.addTransceivers(),this.createDataChannel();break;case g.AUDIO_PUSH:case g.VIDEO_PUSH:case g.AUDIO_HALF:case g.VIDEO_HALF:case g.VIDEO:case g.AUDIO:this.gotLocalMedia();break;default:this.error(new Error("session type unknown: "+this.sessionType));break}}setRemoteSdp(e){e&&e!==""&&this.peerConnection&&this.isCallOut&&!this.hasSetRemoteSdp&&(this.hasSetRemoteSdp=!0,this.peerConnection.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:e})).then(()=>{console.debug("webrtc setRemoteDescription success")}).catch(r=>{this.error(r),this.hasSetRemoteSdp=!1}))}addRemoteCandidate(e){this.peerConnection&&e.forEach(r=>{this.peerConnection.addIceCandidate(r).then(()=>{console.debug("webrtc addIceCandidate success")}).catch(n=>console.log(n))})}sendStringData(e){this.dataChannel&&this.dataChannel.send(e)}stop(){var e;if(console.debug("webrtc stop"),(this.sessionType==g.VIDEO_PUSH||this.sessionType==g.AUDIO_PUSH||this.sessionType==g.RTSP_PULL)&&this.sendStringData("close"),(e=this.peerConnection)==null||e.close(),this.peerConnection=void 0,this.localStream){for(let r of this.localStream.getTracks())this.localStream.removeTrack(r),r.stop();this.localStream=void 0}this.remoteStream=void 0,this.desktopSharing=!1}changeFacing(){return new Promise((e,r)=>{if(this.sessionType!==g.VIDEO&&this.sessionType!==g.VIDEO_PUSH){r(new Error("not video call"));return}if(!this.localStream||this.localStream.getVideoTracks().length<=0){r(new Error("not in calling or not video call"));return}if(this.facingChanging){r(new Error("camera switching in progress"));return}if(!/mobile/i.test(navigator.userAgent)){r(new Error("not mobile device"));return}this.facingChanging=!0,this.changeCameraLocalMedia().then(()=>e(this.facingMode)).catch(n=>r(n))})}changeMuted(){return new Promise((e,r)=>{!this.localStream||this.localStream.getAudioTracks().length<=0?r(new Error("not in calling")):(this.localStream.getAudioTracks().forEach(n=>{n.enabled=!n.enabled,this.muted=!n.enabled}),e(this.muted))})}changeCameraOpened(){return new Promise((e,r)=>{!this.localStream||this.localStream.getVideoTracks().length<=0?r(new Error("not in video calling")):(this.localStream.getVideoTracks().forEach(n=>{n.enabled=!n.enabled,this.openCamera=!n.enabled}),e(this.openCamera))})}startDesktopShare(){return new Promise((e,r)=>{if(this.desktopSharing){r(new Error("desktop sharing has opened"));return}if(this.sessionType!=g.VIDEO&&this.sessionType!=g.VIDEO_PUSH){r(new Error("desktop sharing not in video calling"));return}if(!this.localStream){r(new Error("localStream undefined"));return}navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia?(this.desktopSharing=!0,navigator.mediaDevices.getDisplayMedia({audio:!1,video:!0}).then(n=>{let o=this.changeVideoTrack(n,()=>{this.stopDesktopShare(),this.sessionListener.onStopDesktopShare()});o?(this.desktopSharing=!1,r(o)):e()}).catch(n=>{this.desktopSharing=!1,r(n)})):r(new Error("error: browsers unsupported DesktopShare"))})}stopDesktopShare(){if(!(!this.peerConnection||!this.localStream)&&this.desktopSharing){for(let e of this.localStream.getVideoTracks())this.localStream.removeTrack(e),e.stop();navigator.mediaDevices.getUserMedia({audio:!1,video:{height:{exact:720},width:{exact:1280}}}).then(e=>{this.changeVideoTrack(e),this.desktopSharing=!1}).catch(e=>{this.desktopSharing=!1,console.debug("stopDesktopShare getUserMedia failed: ",e)})}}changeVideoTrack(e,r){if(!this.localStream||!this.peerConnection){for(let n of e.getTracks())e.removeTrack(n),n.stop();return new Error("localStream undefined or peerConnection undefined")}for(let n of this.localStream.getVideoTracks())this.localStream.removeTrack(n),n.stop();for(let n of e.getTracks())e.removeTrack(n),n.kind=="video"?(this.localStream.addTrack(n),r&&(n.onended=o=>{r()})):n.stop();for(let n of this.peerConnection.getSenders())n.track&&n.track.kind==="video"&&n.replaceTrack(this.localStream.getVideoTracks()[0]).then(()=>{}).catch(o=>{console.error(o)})}error(e){console.debug("webrtc error: ",e),this.stop(),this.sessionListener.onError(e)}addTransceivers(){this.peerConnection.addTransceiver("audio",{direction:"recvonly"}),this.peerConnection.addTransceiver("video",{direction:"recvonly"})}gotLocalMedia(){let e={audio:{echoCancellation:!0,noiseSuppression:!0}};switch(this.sessionType){case g.VIDEO:case g.VIDEO_PUSH:case g.VIDEO_HALF:e.video={height:{exact:720},width:{exact:1280}};break}navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?navigator.mediaDevices.getUserMedia(e).then(r=>{this.getMediaSuccess(r)}).catch(r=>{this.getMediaFailed(r)}):this.error(new Error("Browser does not support WebRTC"))}getMediaSuccess(e){console.debug("webrtc getMediaSuccess"),this.localStream=e,(this.sessionType===g.VIDEO||this.sessionType===g.VIDEO_PUSH||this.sessionType===g.VIDEO_HALF)&&this.sessionListener.onAddLocalStream(e),e.getTracks().forEach(r=>{switch(this.sessionType){case g.AUDIO_PUSH:case g.VIDEO_PUSH:this.peerConnection.addTransceiver(r,{direction:"sendonly",streams:[e]});break;default:this.peerConnection.addTrack(r,e)}}),this.muted=!1}getMediaFailed(e){if(console.debug("webrtc getMediaFailed failed"),this.sessionType===g.VIDEO){console.error("get video media failed. maybe not found camera.",e),this.sessionType=g.AUDIO,this.gotLocalMedia();return}else if(this.sessionType===g.VIDEO_PUSH){console.error("get video media failed. maybe not found camera.",e),this.sessionType=g.AUDIO_PUSH,this.gotLocalMedia();return}else if(this.sessionType===g.VIDEO_HALF){console.error("get video media failed. maybe not found camera.",e),this.sessionType=g.AUDIO_HALF,this.gotLocalMedia();return}this.error(e)}createDataChannel(){this.peerConnection&&(this.isCallOut?(this.dataChannel=this.peerConnection.createDataChannel("command_channel"),this.dataChannel.onmessage=e=>{this.onDataChannelReceive(e.data)}):this.peerConnection.ondatachannel=e=>{this.dataChannel=e.channel,this.dataChannel.onmessage=r=>{this.onDataChannelReceive(r.data)}})}onDataChannelReceive(e){if(e==="close"){console.debug("data channel receive from server: close"),this.dataChannel=void 0,this.stop();return}(this.sessionType==g.VIDEO_HALF||this.sessionType==g.AUDIO_HALF)&&this.sessionListener.onDataChannelMessage(e)}changeCameraLocalMedia(){return new Promise((e,r)=>{let n;if(this.facingMode===te.FRONT_FACING?n={audio:{echoCancellation:!0,noiseSuppression:!0},video:{height:{exact:1280},width:{exact:720},facingMode:"environment"}}:n={audio:{echoCancellation:!0,noiseSuppression:!0},video:{height:{exact:720},width:{exact:1280},facingMode:"user"}},navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)navigator.mediaDevices.getUserMedia(n).then(o=>{this.changeCameraSuccess(o),e()}).catch(o=>{this.changeCameraFailed(o),r(o)});else{let o=new Error("Browser does not support WebRTC");this.changeCameraFailed(o),r(new Error("Browser does not support WebRTC"))}})}changeCameraSuccess(e){if(!this.localStream){e.getTracks().forEach(r=>{r.stop()}),this.facingChanging=!1;return}this.localStream.getVideoTracks().forEach(r=>{this.localStream.removeTrack(r),r.stop()}),e.getVideoTracks().forEach(r=>{this.localStream.addTrack(r)}),this.peerConnection.getSenders().forEach(r=>{r.track&&r.track.kind==="video"&&r.replaceTrack(e.getVideoTracks()[0]).then(()=>{}).catch(n=>{console.log(n)})}),this.facingMode===te.FRONT_FACING?this.facingMode=te.BACK_FACING:this.facingMode=te.FRONT_FACING,this.facingChanging=!1}changeCameraFailed(e){console.log(e),this.facingChanging=!1}}class as{onAddRemoteStream(e){console.debug("onAddRemoteStream:",e)}onError(e){console.debug("onError:",e)}}class Jr{constructor(e,r){m(this,"url");m(this,"offerSdp");this.url=e,this.offerSdp=r}}const cs="/media-server/video-play/webrtc";class ls{constructor(e,r){m(this,"rtspUrl");m(this,"webrtcSession",new Ft(g.RTSP_PULL));m(this,"sessionListener",new as);m(this,"httpClient");this.rtspUrl=e,this.httpClient=r,this.webrtcSession.setListener(this)}setRtspPullSessionListener(e){this.sessionListener=e}start(){this.webrtcSession.start(!0)}stop(){this.webrtcSession.stop()}onAddLocalStream(e){}onAddRemoteStream(e){this.sessionListener.onAddRemoteStream(e)}onError(e){this.sessionListener.onError(e)}onStartSuccess(e){console.debug("rtsp offer:",e.sdp),this.httpClient.Post(cs,new Jr(this.rtspUrl,e.sdp??"")).then(r=>{var n,o,i,s;if(r.code!=200){this.stop(),this.sessionListener.onError(new Error(r.message));return}console.debug("rtsp answer",(n=r.data)==null?void 0:n.sdp),console.debug("rtsp answer",(o=r.data)==null?void 0:o.candidateList),this.webrtcSession.setRemoteSdp(((i=r.data)==null?void 0:i.sdp)??""),this.webrtcSession.addRemoteCandidate(((s=r.data)==null?void 0:s.candidateList)??[])}).catch(r=>{this.stop(),this.sessionListener.onError(r)})}onDataChannelMessage(e){}onStopDesktopShare(){}}var A=(t=>(t[t.OFFLINE=-1]="OFFLINE",t[t.IDLE=0]="IDLE",t[t.TRY=1]="TRY",t[t.RING=2]="RING",t[t.TALK=3]="TALK",t))(A||{}),F=(t=>(t.VIDEO="video",t.AUDIO="audio",t))(F||{}),$=(t=>(t.FULL="full-duplex",t.HALF="half-duplex",t))($||{}),re=(t=>(t.IN="in",t.OUT="out",t))(re||{}),_=(t=>(t.LOGIN="login",t.LOGOUT="logout",t.Invite="invite",t.RING="ring",t.ANSWER="answer",t.HANGUP="hangup",t.DTMF="dtmf",t))(_||{});function Kr(){try{return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}catch{return!1}}function us(){return"browser-"+fs()+ds(6)}function fs(){let t=new Date;return`${t.getFullYear()}${t.getMonth()}${t.getDate()}${t.getHours()}${t.getMinutes()}${t.getSeconds()}`}function ds(t){let e="",r=["0","1","2","3","4","5","6","7","8","9","0","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];for(let n=0;n<t;n++)e+=r[Math.floor(Math.random()*(r.length-1))];return e}class ps{constructor(e,r,n){m(this,"tel");m(this,"mediaType");m(this,"callMode");this.tel=e,this.callMode=n,this.mediaType=r}}class Qr{onAddLocalStream(e){console.debug("onAddLocalStream:",e)}onAddRemoteStream(e){console.debug("onAddRemoteStream:",e)}onAnswer(){console.debug("onAnswer")}onClose(e){console.debug("onClose:",e)}onError(e){console.debug("onError:",e)}onHangup(e){console.debug("onHangup:",e)}onNewCall(e){console.debug("onNewCall:",e)}onRing(){console.debug("onRing")}onInitResult(e){console.debug("onInitResult: ",e)}onStopDesktopShare(){console.debug("onStopDesktopShare")}}class Xr{constructor(e,r,n){m(this,"tel","");m(this,"status",A.OFFLINE);m(this,"mediaType",F.AUDIO);m(this,"callMode",$.FULL);m(this,"callDirect",re.OUT);m(this,"called","");m(this,"callId");m(this,"remoteSdp");m(this,"candidate");m(this,"ringBackTone",new Audio("sound/ringbacktone.wav"));m(this,"ringtone",new Audio("sound/ringtone.wav"));m(this,"dtmfAudio",new Audio("sound/dtmf.wav"));m(this,"ws");m(this,"wsConnected",!1);m(this,"closeBySelf",!1);m(this,"webrtcSession");m(this,"sessionListener",new Qr);m(this,"wsUrl");m(this,"accountId");this.tel=r??"",this.wsUrl=e,this.accountId=n,this.ringBackTone.loop=!0,this.ringtone.loop=!0}setCallSessionListener(e){this.sessionListener=e}init(){this.websocketInit(this.wsUrl)}audioCall(e){this.makeCall(e)}videoCall(e){this.makeCall(e,F.VIDEO)}answer(){var r;if(this.status!=A.RING){console.debug("session is not ring state");return}if(this.callDirect!=re.IN){console.debug("session is call out, not allow answer");return}let e;this.callMode==$.HALF?e=F.VIDEO==this.mediaType?g.VIDEO_HALF:g.AUDIO_HALF:e=F.VIDEO==this.mediaType?g.VIDEO:g.AUDIO,this.webrtcCreate(e),(r=this.webrtcSession)==null||r.start(!1,this.remoteSdp)}hangup(){this.status<=A.IDLE||(this.status==A.TALK?this.sendHangup(this.callId??""):this.callDirect==re.IN?this.sendHangup(this.callId??"",488):this.sendHangup(this.callId??"",801),this.close())}dtmf(e){return this.status!==A.TALK?!1:(this.sendDtmf(e),!0)}changeCamera(){return new Promise((e,r)=>{var n;this.webrtcSession||r(new Error("webrtc session not start")),(n=this.webrtcSession)==null||n.changeFacing().then(o=>e(o)).catch(o=>r(o))})}changeMuted(){return new Promise((e,r)=>{this.webrtcSession||r(new Error("webrtc session not start")),this.webrtcSession.changeMuted().then(n=>e(n)).catch(n=>r(n))})}changeCameraOpened(){return new Promise((e,r)=>{this.webrtcSession||r(new Error("webrtc session not start")),this.webrtcSession.changeCameraOpened().then(n=>e(n)).catch(n=>r(n))})}startDesktopShare(){return new Promise((e,r)=>{this.webrtcSession||r(new Error("webrtc session not start")),this.status!=A.TALK&&r(new Error(`session status[${this.status}] not talk`)),this.webrtcSession.startDesktopShare().then(()=>e()).catch(n=>r(n))})}stopDesktopShare(){this.webrtcSession&&this.status==A.TALK&&this.webrtcSession.stopDesktopShare()}destroy(){var e;this.closeBySelf=!0,this.hangup(),this.close(),(e=this.ws)==null||e.close()}makeCall(e,r=F.AUDIO,n=$.FULL){var o;try{if(!Kr()){console.debug("Browser does not support WEBRTC"),this.sessionListener.onError(new Error("Browser does not support WEBRTC"));return}if(this.status==A.OFFLINE){console.debug("The initialization has not been completed yet. Please try again later"),this.sessionListener.onError(new Error("The initialization has not been completed yet. Please try again later"));return}this.status>A.IDLE&&(console.debug("Another call is currently in progress, hangup it"),this.hangup()),this.mediaType=r,this.callMode=n,this.called=e,this.callDirect=re.OUT,this.callId=us();let i;this.callMode==$.HALF?i=F.VIDEO==r?g.VIDEO_HALF:g.AUDIO_HALF:i=F.VIDEO==r?g.VIDEO:g.AUDIO,this.webrtcCreate(i),(o=this.webrtcSession)==null||o.start(!0),this.status=A.TRY}catch(i){this.status=A.IDLE,this.sessionListener.onError(new Error(""+i))}}close(){this.webrtcClose();try{this.ringtone.pause(),this.ringBackTone.pause()}catch(e){console.debug("FullSession.close: ",e)}this.status=A.IDLE}websocketInit(e){this.ws=new WebSocket(e),this.closeBySelf=!1,this.ws.onopen=()=>{console.debug("ws connect success"),this.wsConnected=!0,this.sendLogin()},this.ws.onclose=r=>{console.error("ws on close: ",r),this.wsConnected=!1,this.close(),this.status=A.OFFLINE,this.closeBySelf||this.sessionListener.onClose(new Error(r.reason)),this.ws=void 0},this.ws.onmessage=r=>{try{let n=JSON.parse(r.data);switch(console.debug("receive msg from server <<<<<<<<<<<<<<<",n),n.type){case _.Invite:this.inviteHandler(n);break;case _.ANSWER:this.answerHandler(n);break;case _.RING:this.ringHandler(n);break;case _.HANGUP:this.hangupHandler(n);break;case _.LOGIN:this.loginHandler(n);break}}catch(n){console.error("receive msg from server, but process error: ",n,r)}},this.ws.onerror=r=>{console.error("ws on error: ",r)}}sendTo(e){var r;try{this.wsConnected?(console.debug("send msg to server >>>>>>>>>>>>>>>>>> ",e),(r=this.ws)==null||r.send(JSON.stringify(e))):console.error("ws not connected.")}catch(n){console.debug("FullSession sendTo error: ",n)}}sendLogin(){this.sendTo({type:_.LOGIN,username:this.tel,userAgent:this.getUserAgent(),accountId:this.accountId})}sendLogout(){this.sendTo({type:_.LOGOUT,username:this.tel}),this.status=A.OFFLINE}sendInvite(e){this.sendTo({callId:this.callId,type:_.Invite,from:this.tel,to:this.called,callMode:this.callMode,mediaType:this.mediaType,sdp:e}),this.status=A.TRY}sendRing(){this.sendTo({type:_.RING,callId:this.callId,code:180}),this.status=A.RING}sendAnswer(e){this.sendTo({type:_.ANSWER,callId:this.callId,mediaType:this.mediaType,sdp:e}),this.status=A.TALK,this.ringtone.pause(),this.ringBackTone.pause()}sendDtmf(e){this.sendTo({type:_.DTMF,callId:this.callId,callInfo:"dtmf="+e}),this.dtmfAudio.play().then(()=>{}).catch(r=>console.debug(r))}sendHangup(e,r=800){this.sendTo({type:_.HANGUP,callId:e,code:r}),e==this.callId&&(this.status=A.IDLE,this.callId=void 0)}loginHandler(e){var r;if(e.code!=200){(r=this.ws)==null||r.close(),this.wsConnected=!1,this.ws=void 0,this.status=A.OFFLINE,this.sessionListener.onInitResult(!1);return}this.tel=e.username??"",this.status=A.IDLE,this.sessionListener.onInitResult(!0)}inviteHandler(e){if(!e.callId){console.debug("receive invite, but callId is null.");return}if(!Kr()){console.debug("receive invite, but unsupported webrtc."),this.sendHangup(e.callId,803);return}if(this.status>A.IDLE){e.callId!=this.callId?(console.debug("receive invite, but busy."),this.sendHangup(e.callId,486)):console.debug("receive re invite. not process");return}this.callId=e.callId,this.mediaType=e.mediaType??F.AUDIO,this.callMode=e.callMode??$.FULL,this.called=e.from??"",this.callDirect=re.IN,this.remoteSdp=e.sdp,this.candidate=e.candidate,this.sendRing(),this.ringtone.currentTime=0,this.ringtone.play().then(()=>{}).catch(()=>{}),this.sessionListener.onNewCall(new ps(this.called,this.mediaType,this.callMode))}ringHandler(e){var r,n;!e.callId||e.callId!=this.callId||(e.code==183?(this.ringBackTone.pause(),(r=this.webrtcSession)==null||r.setRemoteSdp(e.sdp??""),(n=this.webrtcSession)==null||n.addRemoteCandidate(e.candidate??[])):(this.ringBackTone.currentTime=0,this.ringBackTone.play().then(()=>{}).catch(()=>{})),this.sessionListener.onRing(),this.status=A.RING)}answerHandler(e){var r,n;!e.callId||e.callId!=this.callId||(this.ringBackTone.pause(),(r=this.webrtcSession)==null||r.setRemoteSdp(e.sdp??""),(n=this.webrtcSession)==null||n.addRemoteCandidate(e.candidate??[]),this.sessionListener.onAnswer(),this.status=A.TALK)}hangupHandler(e){!e.callId||e.callId!=this.callId||(this.close(),this.sessionListener.onHangup(e.code))}getUserAgent(){return navigator.platform.indexOf("Win")>=0?"windows":"phone"}webrtcCreate(e){this.webrtcClose(),this.webrtcSession=new Ft(e),this.webrtcSession.setListener(this)}webrtcClose(){var e;(e=this.webrtcSession)==null||e.stop(),this.webrtcSession=void 0}onAddLocalStream(e){this.sessionListener.onAddLocalStream(e)}onAddRemoteStream(e){this.sessionListener.onAddRemoteStream(e)}onError(e){this.close(),this.callDirect==re.OUT&&this.hangup(),this.sessionListener.onError(e)}onStartSuccess(e){var r;e.type=="answer"?(this.sendAnswer(e.sdp??""),(r=this.webrtcSession)==null||r.addRemoteCandidate(this.candidate??[])):e.type=="offer"&&this.sendInvite(e.sdp??"")}onDataChannelMessage(e){}onStopDesktopShare(){this.sessionListener.onStopDesktopShare()}}class hs{onError(e){console.debug("onError:",e)}onAddLocalStream(e){console.debug("onAddLocalStream:",e)}onStopDesktopShare(){console.debug("onStopDesktopShare")}}const ys="/media-server/broadcast/webrtc";class ms{constructor(e,r,n){m(this,"tel");m(this,"mediaType");m(this,"webrtcSession");m(this,"sessionListener",new hs);m(this,"httpClient");this.tel=e,this.httpClient=r,this.mediaType=n===F.VIDEO?F.VIDEO:F.AUDIO,this.webrtcSession=new Ft(n==F.VIDEO?g.VIDEO_PUSH:g.AUDIO_PUSH),this.webrtcSession.setListener(this)}setBroadcastSessionListener(e){this.sessionListener=e}start(){this.webrtcSession.start(!0)}stop(){this.webrtcSession.stop()}startDesktopShare(){return new Promise((e,r)=>{this.webrtcSession||r(new Error("webrtc session not start")),this.webrtcSession.startDesktopShare().then(()=>e()).catch(n=>r(n))})}stopDesktopShare(){this.webrtcSession&&this.webrtcSession.stopDesktopShare()}onAddLocalStream(e){this.sessionListener.onAddLocalStream(e)}onAddRemoteStream(e){}onError(e){this.sessionListener.onError(e)}onStartSuccess(e){console.debug("offer:",e.sdp),this.httpClient.Post(ys,new Jr(this.tel,e.sdp??"")).then(r=>{var n,o,i;if(r.code!=200){this.stop(),this.sessionListener.onError(new Error(r.message));return}console.debug("answer",(n=r.data)==null?void 0:n.sdp),this.webrtcSession.setRemoteSdp(((o=r.data)==null?void 0:o.sdp)??""),this.webrtcSession.addRemoteCandidate(((i=r.data)==null?void 0:i.candidateList)??[])}).catch(r=>{this.stop(),this.sessionListener.onError(r)})}onDataChannelMessage(e){}onStopDesktopShare(){this.sessionListener.onStopDesktopShare()}}var Nt=(t=>(t.TB_REQUEST="tb_request",t.TB_GRANTED="tb_granted",t.TB_TAKEN="tb_taken",t.TB_DENY="tb_deny",t.TB_RELEASE="tb_release",t.TB_IDLE="tb_idle",t.TB_REVOKE="tb_revoke",t))(Nt||{});class gs extends Qr{onTbcpMessage(e){console.debug("onTbcpMessage:",e)}}class Ss extends Xr{constructor(r,n,o){super(r,n,o);m(this,"sessionListener",new gs)}setCallSessionListener(r){this.sessionListener=r}audioHalfCall(r){this.makeCall(r,F.AUDIO,$.HALF)}videoHalfCall(r){this.makeCall(r,F.VIDEO,$.HALF)}tbcpRequest(){var r;this.callMode==$.HALF&&this.status==A.TALK&&((r=this.webrtcSession)==null||r.sendStringData(JSON.stringify({type:Nt.TB_REQUEST})))}tbcpRelease(){var r;this.callMode==$.HALF&&this.status==A.TALK&&((r=this.webrtcSession)==null||r.sendStringData(JSON.stringify({type:Nt.TB_RELEASE})))}onDataChannelMessage(r){try{this.sessionListener.onTbcpMessage(JSON.parse(r))}catch(n){console.debug("onDataChannelMessage err: ",n,r)}}}let _t=new zr("/"),Yr="/media-server/ws/voip",Zr="/media-server/ws/b-trun-c",xt=new URL((location.protocol=="https:"?"wss://":"ws://")+location.host+Yr),Ut=new URL((location.protocol=="https:"?"wss://":"ws://")+location.host+Zr);function ws(t){_t=new zr(t)}function bs(t){return new ls(t,_t)}function vs(t,e){return new ms(t,_t,e)}function Es(t){xt=new URL(t),xt.pathname=Yr,Ut=new URL(t),Ut.pathname=Zr}function As(t){return new Xr(xt.toString(),t)}function Os(t,e){return new Ss(Ut.toString(),t,e)}T.createAppCallSession=Os,T.createBroadcastSession=vs,T.createCallSession=As,T.createRtspPullSession=bs,T.videoModuleInit=ws,T.voipModuleInit=Es,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})});
9
+ `+e.prev}function $e(t,e){var r=Et(t),n=[];if(r){n.length=t.length;for(var o=0;o<t.length;o++)n[o]=z(t,o)?e(t[o],t):""}var i=typeof wt=="function"?wt(t):[],s;if(ue){s={};for(var a=0;a<i.length;a++)s["$"+i[a]]=i[a]}for(var c in t)z(t,c)&&(r&&String(Number(c))===c&&c<t.length||ue&&s["$"+c]instanceof Symbol||(Cr.call(/[^\w$]/,c)?n.push(e(c,t)+": "+e(t[c],t)):n.push(c+": "+e(t[c],t))));if(typeof wt=="function")for(var l=0;l<i.length;l++)Dr.call(t,i[l])&&n.push("["+e(i[l])+"]: "+e(t[i[l]],t));return n}var Rt=dt,fe=Bo,hi=Ko,yi=Rt("%TypeError%"),Ve=Rt("%WeakMap%",!0),Ge=Rt("%Map%",!0),mi=fe("WeakMap.prototype.get",!0),gi=fe("WeakMap.prototype.set",!0),Si=fe("WeakMap.prototype.has",!0),wi=fe("Map.prototype.get",!0),bi=fe("Map.prototype.set",!0),vi=fe("Map.prototype.has",!0),Ct=function(t,e){for(var r=t,n;(n=r.next)!==null;r=n)if(n.key===e)return r.next=n.next,n.next=t.next,t.next=n,n},Ei=function(t,e){var r=Ct(t,e);return r&&r.value},Ai=function(t,e,r){var n=Ct(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},Oi=function(t,e){return!!Ct(t,e)},Ri=function(){var e,r,n,o={assert:function(i){if(!o.has(i))throw new yi("Side channel does not contain "+hi(i))},get:function(i){if(Ve&&i&&(typeof i=="object"||typeof i=="function")){if(e)return mi(e,i)}else if(Ge){if(r)return wi(r,i)}else if(n)return Ei(n,i)},has:function(i){if(Ve&&i&&(typeof i=="object"||typeof i=="function")){if(e)return Si(e,i)}else if(Ge){if(r)return vi(r,i)}else if(n)return Oi(n,i);return!1},set:function(i,s){Ve&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new Ve),gi(e,i,s)):Ge?(r||(r=new Ge),bi(r,i,s)):(n||(n={key:{},next:null}),Ai(n,i,s))}};return o},Ci=String.prototype.replace,Ii=/%20/g,It={RFC1738:"RFC1738",RFC3986:"RFC3986"},Tt={default:It.RFC3986,formatters:{RFC1738:function(t){return Ci.call(t,Ii,"+")},RFC3986:function(t){return String(t)}},RFC1738:It.RFC1738,RFC3986:It.RFC3986},Ti=Tt,Dt=Object.prototype.hasOwnProperty,te=Array.isArray,H=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),Di=function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(te(n)){for(var o=[],i=0;i<n.length;++i)typeof n[i]<"u"&&o.push(n[i]);r.obj[r.prop]=o}}},Hr=function(e,r){for(var n=r&&r.plainObjects?Object.create(null):{},o=0;o<e.length;++o)typeof e[o]<"u"&&(n[o]=e[o]);return n},Pi=function t(e,r,n){if(!r)return e;if(typeof r!="object"){if(te(e))e.push(r);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!Dt.call(Object.prototype,r))&&(e[r]=!0);else return[e,r];return e}if(!e||typeof e!="object")return[e].concat(r);var o=e;return te(e)&&!te(r)&&(o=Hr(e,n)),te(e)&&te(r)?(r.forEach(function(i,s){if(Dt.call(e,s)){var a=e[s];a&&typeof a=="object"&&i&&typeof i=="object"?e[s]=t(a,i,n):e.push(i)}else e[s]=i}),e):Object.keys(r).reduce(function(i,s){var a=r[s];return Dt.call(i,s)?i[s]=t(i[s],a,n):i[s]=a,i},o)},Li=function(e,r){return Object.keys(r).reduce(function(n,o){return n[o]=r[o],n},e)},Fi=function(t,e,r){var n=t.replace(/\+/g," ");if(r==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},Ni=function(e,r,n,o,i){if(e.length===0)return e;var s=e;if(typeof e=="symbol"?s=Symbol.prototype.toString.call(e):typeof e!="string"&&(s=String(e)),n==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(d){return"%26%23"+parseInt(d.slice(2),16)+"%3B"});for(var a="",c=0;c<s.length;++c){var l=s.charCodeAt(c);if(l===45||l===46||l===95||l===126||l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||i===Ti.RFC1738&&(l===40||l===41)){a+=s.charAt(c);continue}if(l<128){a=a+H[l];continue}if(l<2048){a=a+(H[192|l>>6]+H[128|l&63]);continue}if(l<55296||l>=57344){a=a+(H[224|l>>12]+H[128|l>>6&63]+H[128|l&63]);continue}c+=1,l=65536+((l&1023)<<10|s.charCodeAt(c)&1023),a+=H[240|l>>18]+H[128|l>>12&63]+H[128|l>>6&63]+H[128|l&63]}return a},_i=function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],o=0;o<r.length;++o)for(var i=r[o],s=i.obj[i.prop],a=Object.keys(s),c=0;c<a.length;++c){var l=a[c],d=s[l];typeof d=="object"&&d!==null&&n.indexOf(d)===-1&&(r.push({obj:s,prop:l}),n.push(d))}return Di(r),e},xi=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Ui=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},ki=function(e,r){return[].concat(e,r)},Bi=function(e,r){if(te(e)){for(var n=[],o=0;o<e.length;o+=1)n.push(r(e[o]));return n}return r(e)},$r={arrayToObject:Hr,assign:Li,combine:ki,compact:_i,decode:Fi,encode:Ni,isBuffer:Ui,isRegExp:xi,maybeMap:Bi,merge:Pi},Vr=Ri,We=$r,Re=Tt,Mi=Object.prototype.hasOwnProperty,Gr={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,r){return e+"["+r+"]"},repeat:function(e){return e}},G=Array.isArray,Hi=Array.prototype.push,Wr=function(t,e){Hi.apply(t,G(e)?e:[e])},$i=Date.prototype.toISOString,qr=Re.default,L={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:We.encode,encodeValuesOnly:!1,format:qr,formatter:Re.formatters[qr],indices:!1,serializeDate:function(e){return $i.call(e)},skipNulls:!1,strictNullHandling:!1},Vi=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},Pt={},Gi=function t(e,r,n,o,i,s,a,c,l,d,f,y,w,p,h,E){for(var S=e,I=E,D=0,Q=!1;(I=I.get(Pt))!==void 0&&!Q;){var Ce=I.get(e);if(D+=1,typeof Ce<"u"){if(Ce===D)throw new RangeError("Cyclic object value");Q=!0}typeof I.get(Pt)>"u"&&(D=0)}if(typeof c=="function"?S=c(r,S):S instanceof Date?S=f(S):n==="comma"&&G(S)&&(S=We.maybeMap(S,function(me){return me instanceof Date?f(me):me})),S===null){if(i)return a&&!p?a(r,L.encoder,h,"key",y):r;S=""}if(Vi(S)||We.isBuffer(S)){if(a){var qe=p?r:a(r,L.encoder,h,"key",y);return[w(qe)+"="+w(a(S,L.encoder,h,"value",y))]}return[w(r)+"="+w(String(S))]}var ne=[];if(typeof S>"u")return ne;var X;if(n==="comma"&&G(S))p&&a&&(S=We.maybeMap(S,a)),X=[{value:S.length>0?S.join(",")||null:void 0}];else if(G(c))X=c;else{var pe=Object.keys(S);X=l?pe.sort(l):pe}for(var he=o&&G(S)&&S.length===1?r+"[]":r,Ie=0;Ie<X.length;++Ie){var U=X[Ie],W=typeof U=="object"&&typeof U.value<"u"?U.value:S[U];if(!(s&&W===null)){var ye=G(S)?typeof n=="function"?n(he,U):he:he+(d?"."+U:"["+U+"]");E.set(e,D);var je=Vr();je.set(Pt,E),Wr(ne,t(W,ye,n,o,i,s,n==="comma"&&p&&G(S)?null:a,c,l,d,f,y,w,p,h,je))}}return ne},Wi=function(e){if(!e)return L;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=e.charset||L.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=Re.default;if(typeof e.format<"u"){if(!Mi.call(Re.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var o=Re.formatters[n],i=L.filter;return(typeof e.filter=="function"||G(e.filter))&&(i=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:L.addQueryPrefix,allowDots:typeof e.allowDots>"u"?L.allowDots:!!e.allowDots,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:L.charsetSentinel,delimiter:typeof e.delimiter>"u"?L.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:L.encode,encoder:typeof e.encoder=="function"?e.encoder:L.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:L.encodeValuesOnly,filter:i,format:n,formatter:o,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:L.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:L.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:L.strictNullHandling}},qi=function(t,e){var r=t,n=Wi(e),o,i;typeof n.filter=="function"?(i=n.filter,r=i("",r)):G(n.filter)&&(i=n.filter,o=i);var s=[];if(typeof r!="object"||r===null)return"";var a;e&&e.arrayFormat in Gr?a=e.arrayFormat:e&&"indices"in e?a=e.indices?"indices":"repeat":a="indices";var c=Gr[a];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var l=c==="comma"&&e&&e.commaRoundTrip;o||(o=Object.keys(r)),n.sort&&o.sort(n.sort);for(var d=Vr(),f=0;f<o.length;++f){var y=o[f];n.skipNulls&&r[y]===null||Wr(s,Gi(r[y],y,c,l,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,d))}var w=s.join(n.delimiter),p=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?p+="utf8=%26%2310003%3B&":p+="utf8=%E2%9C%93&"),w.length>0?p+w:""},de=$r,Lt=Object.prototype.hasOwnProperty,ji=Array.isArray,C={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:de.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},zi=function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},jr=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},Ji="utf8=%26%2310003%3B",Ki="utf8=%E2%9C%93",Qi=function(e,r){var n={__proto__:null},o=r.ignoreQueryPrefix?e.replace(/^\?/,""):e,i=r.parameterLimit===1/0?void 0:r.parameterLimit,s=o.split(r.delimiter,i),a=-1,c,l=r.charset;if(r.charsetSentinel)for(c=0;c<s.length;++c)s[c].indexOf("utf8=")===0&&(s[c]===Ki?l="utf-8":s[c]===Ji&&(l="iso-8859-1"),a=c,c=s.length);for(c=0;c<s.length;++c)if(c!==a){var d=s[c],f=d.indexOf("]="),y=f===-1?d.indexOf("="):f+1,w,p;y===-1?(w=r.decoder(d,C.decoder,l,"key"),p=r.strictNullHandling?null:""):(w=r.decoder(d.slice(0,y),C.decoder,l,"key"),p=de.maybeMap(jr(d.slice(y+1),r),function(h){return r.decoder(h,C.decoder,l,"value")})),p&&r.interpretNumericEntities&&l==="iso-8859-1"&&(p=zi(p)),d.indexOf("[]=")>-1&&(p=ji(p)?[p]:p),Lt.call(n,w)?n[w]=de.combine(n[w],p):n[w]=p}return n},Xi=function(t,e,r,n){for(var o=n?e:jr(e,r),i=t.length-1;i>=0;--i){var s,a=t[i];if(a==="[]"&&r.parseArrays)s=[].concat(o);else{s=r.plainObjects?Object.create(null):{};var c=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,l=parseInt(c,10);!r.parseArrays&&c===""?s={0:o}:!isNaN(l)&&a!==c&&String(l)===c&&l>=0&&r.parseArrays&&l<=r.arrayLimit?(s=[],s[l]=o):c!=="__proto__"&&(s[c]=o)}o=s}return o},Yi=function(e,r,n,o){if(e){var i=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,c=n.depth>0&&s.exec(i),l=c?i.slice(0,c.index):i,d=[];if(l){if(!n.plainObjects&&Lt.call(Object.prototype,l)&&!n.allowPrototypes)return;d.push(l)}for(var f=0;n.depth>0&&(c=a.exec(i))!==null&&f<n.depth;){if(f+=1,!n.plainObjects&&Lt.call(Object.prototype,c[1].slice(1,-1))&&!n.allowPrototypes)return;d.push(c[1])}return c&&d.push("["+i.slice(c.index)+"]"),Xi(d,r,n,o)}},Zi=function(e){if(!e)return C;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=typeof e.charset>"u"?C.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?C.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:C.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:C.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:C.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:C.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:C.comma,decoder:typeof e.decoder=="function"?e.decoder:C.decoder,delimiter:typeof e.delimiter=="string"||de.isRegExp(e.delimiter)?e.delimiter:C.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:C.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:C.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:C.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:C.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:C.strictNullHandling}},es=function(t,e){var r=Zi(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof t=="string"?Qi(t,r):t,o=r.plainObjects?Object.create(null):{},i=Object.keys(n),s=0;s<i.length;++s){var a=i[s],c=Yi(a,n[a],r,typeof t=="string");o=de.merge(o,c,r)}return r.allowSparse===!0?o:de.compact(o)},ts=qi,rs=es,ns=Tt,os={formats:ns,parse:rs,stringify:ts};const is=lo(os);class zr{constructor(e){m(this,"axiosInstance");this.axiosInstance=O.create({baseURL:e,timeout:12e4})}Request(e){return new Promise((r,n)=>{this.axiosInstance.request(e).then(o=>r(o)).catch(o=>n(o))})}Get(e,r,n){return new Promise((o,i)=>{r&&(n?n.params=r:n={params:r}),n&&(n.paramsSerializer={serialize:(s,a)=>is.stringify(s,{indices:!1})}),this.axiosInstance.get(e,n??{}).then(({data:s})=>o(s)).catch(s=>i(s))})}Post(e,r,n){return new Promise((o,i)=>{this.axiosInstance.post(e,r,n??{}).then(({data:s})=>o(s)).catch(s=>i(s))})}Put(e,r,n){return new Promise((o,i)=>{this.axiosInstance.put(e,r,n??{}).then(({data:s})=>o(s)).catch(s=>i(s))})}Delete(e,r,n){return new Promise((o,i)=>{r&&(n?n.data=r:n={data:r}),this.axiosInstance.delete(e,n??{}).then(({data:s})=>o(s)).catch(s=>i(s))})}}class ss{onAddLocalStream(e){console.debug("onAddLocalStream:",e)}onAddRemoteStream(e){console.debug("onAddRemoteStream:",e)}onError(e){console.debug("onError:",e)}onStartSuccess(e){console.debug("onStartSuccess:",e)}onDataChannelMessage(e){console.debug("onDataChannelMessage:",e)}onStopDesktopShare(){console.debug("onStopDesktopShare")}}var g=(t=>(t[t.UNKNOWN=0]="UNKNOWN",t[t.AUDIO=1]="AUDIO",t[t.VIDEO=2]="VIDEO",t[t.RTSP_PULL=3]="RTSP_PULL",t[t.AUDIO_PUSH=4]="AUDIO_PUSH",t[t.VIDEO_PUSH=5]="VIDEO_PUSH",t[t.AUDIO_HALF=6]="AUDIO_HALF",t[t.VIDEO_HALF=7]="VIDEO_HALF",t))(g||{}),K=(t=>(t.FRONT_FACING="user",t.BACK_FACING="environment",t))(K||{});class Ft{constructor(e){m(this,"peerConnection");m(this,"sessionListener",new ss);m(this,"isCallOut",!1);m(this,"sessionType",g.UNKNOWN);m(this,"localStream");m(this,"remoteStream");m(this,"dataChannel");m(this,"hasSetRemoteSdp",!1);m(this,"facingMode",K.FRONT_FACING);m(this,"facingChanging",!1);m(this,"muted",!1);m(this,"openCamera",!1);m(this,"desktopSharing",!1);this.sessionType=e}setListener(e){this.sessionListener=e}start(e,r){if(!e&&!r){this.error(new Error("start failed, remoteSdp is null."));return}switch(this.isCallOut=e,this.hasSetRemoteSdp=!1,this.facingMode=K.FRONT_FACING,this.facingChanging=!1,this.muted=!1,this.desktopSharing=!1,this.peerConnection=new RTCPeerConnection({iceServers:[]}),this.peerConnection.onnegotiationneeded=()=>{switch(this.sessionType){case g.AUDIO_PUSH:case g.VIDEO_PUSH:case g.AUDIO_HALF:case g.VIDEO_HALF:this.createDataChannel()}e?(console.debug("webrtc call out"),this.peerConnection.createOffer().then(n=>{console.debug("webrtc createOffer success"),this.peerConnection.setLocalDescription(n).then(()=>{console.debug("webrtc setLocalDescription success")}).catch(o=>{this.error(o)})}).catch(n=>{this.error(n)})):(console.debug("webrtc call in: ",r),this.peerConnection.setRemoteDescription(new RTCSessionDescription({type:"offer",sdp:r})).then(()=>{console.debug("webrtc setRemoteDescription success"),this.peerConnection.createAnswer().then(n=>{console.debug("webrtc createAnswer success"),this.peerConnection.setLocalDescription(n).then(()=>{console.debug("webrtc setLocalDescription success")}).catch(o=>{this.error(o)})}).catch(n=>{this.error(n)})}).catch(n=>{this.error(n)}))},this.peerConnection.onicegatheringstatechange=()=>{var n;console.debug("webrtc onicegatheringstatechange",(n=this.peerConnection)==null?void 0:n.iceGatheringState),this.peerConnection&&this.peerConnection.iceGatheringState=="complete"&&this.peerConnection.localDescription&&this.sessionListener.onStartSuccess(this.peerConnection.localDescription)},this.peerConnection.ontrack=n=>{console.debug("webrtc ontrack");for(let o=0;o<n.streams.length;o++)this.remoteStream?n.streams[o].getTracks().forEach(i=>{var s;(s=this.remoteStream)==null||s.addTrack(i)}):this.remoteStream=new MediaStream(n.streams[o]);this.sessionListener.onAddRemoteStream(this.remoteStream)},this.peerConnection.oniceconnectionstatechange=n=>{var o,i,s,a,c;console.debug("oniceconnectionstatechange",(o=this.peerConnection)==null?void 0:o.iceConnectionState),(((i=this.peerConnection)==null?void 0:i.iceConnectionState)=="completed"||((s=this.peerConnection)==null?void 0:s.iceConnectionState)=="disconnected"||((a=this.peerConnection)==null?void 0:a.iceConnectionState)=="failed"||((c=this.peerConnection)==null?void 0:c.iceConnectionState)=="closed")&&(this.dataChannel=void 0,this.stop(),this.sessionListener.onError(new Error("session closed.")))},this.sessionType){case g.RTSP_PULL:this.addTransceivers(),this.createDataChannel();break;case g.AUDIO_PUSH:case g.VIDEO_PUSH:case g.AUDIO_HALF:case g.VIDEO_HALF:case g.VIDEO:case g.AUDIO:this.gotLocalMedia();break;default:this.error(new Error("session type unknown: "+this.sessionType));break}}setRemoteSdp(e){e&&e!==""&&this.peerConnection&&this.isCallOut&&!this.hasSetRemoteSdp&&(this.hasSetRemoteSdp=!0,this.peerConnection.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:e})).then(()=>{console.debug("webrtc setRemoteDescription success")}).catch(r=>{this.error(r),this.hasSetRemoteSdp=!1}))}addRemoteCandidate(e){this.peerConnection&&e.forEach(r=>{this.peerConnection.addIceCandidate(r).then(()=>{console.debug("webrtc addIceCandidate success")}).catch(n=>console.log(n))})}sendStringData(e){try{this.dataChannel&&this.dataChannel.send(e)}catch(r){console.debug("sendStringData failed",r)}}stop(){var e;if(console.debug("webrtc stop"),(this.sessionType==g.VIDEO_PUSH||this.sessionType==g.AUDIO_PUSH||this.sessionType==g.RTSP_PULL)&&this.sendStringData("close"),(e=this.peerConnection)==null||e.close(),this.localStream)for(let r of this.localStream.getTracks())this.localStream.removeTrack(r),r.stop();this.desktopSharing&&(this.desktopSharing=!1,this.sessionListener.onStopDesktopShare()),this.peerConnection=void 0,this.dataChannel=void 0,this.localStream=void 0,this.remoteStream=void 0,this.isCallOut=!1,this.sessionType=g.UNKNOWN,this.hasSetRemoteSdp=!1,this.facingMode=K.FRONT_FACING,this.facingChanging=!1,this.muted=!1,this.openCamera=!1,this.desktopSharing=!1}changeFacing(){return new Promise((e,r)=>{if(this.sessionType!==g.VIDEO&&this.sessionType!==g.VIDEO_PUSH){r(new Error("not video call"));return}if(!this.localStream||this.localStream.getVideoTracks().length<=0){r(new Error("not in calling or not video call"));return}if(this.facingChanging){r(new Error("camera switching in progress"));return}if(!/mobile/i.test(navigator.userAgent)){r(new Error("not mobile device"));return}this.facingChanging=!0,this.changeCameraLocalMedia().then(()=>e(this.facingMode)).catch(n=>r(n))})}changeMuted(){return new Promise((e,r)=>{!this.localStream||this.localStream.getAudioTracks().length<=0?r(new Error("not in calling")):(this.localStream.getAudioTracks().forEach(n=>{n.enabled=!n.enabled,this.muted=!n.enabled}),e(this.muted))})}changeCameraOpened(){return new Promise((e,r)=>{!this.localStream||this.localStream.getVideoTracks().length<=0?r(new Error("not in video calling")):(this.localStream.getVideoTracks().forEach(n=>{n.enabled=!n.enabled,this.openCamera=!n.enabled}),e(this.openCamera))})}startDesktopShare(){return new Promise((e,r)=>{if(this.desktopSharing){r(new Error("desktop sharing has opened"));return}if(this.sessionType!=g.VIDEO&&this.sessionType!=g.VIDEO_PUSH){r(new Error("desktop sharing not in video calling"));return}if(!this.localStream){r(new Error("localStream undefined"));return}navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia?(this.desktopSharing=!0,navigator.mediaDevices.getDisplayMedia({audio:!1,video:!0}).then(n=>{let o=this.changeVideoTrack(n,()=>{this.stopDesktopShare(),this.sessionListener.onStopDesktopShare()});o?(this.desktopSharing=!1,r(o)):e()}).catch(n=>{this.desktopSharing=!1,r(n)})):r(new Error("error: browsers unsupported DesktopShare"))})}stopDesktopShare(){if(!(!this.peerConnection||!this.localStream)&&this.desktopSharing){for(let e of this.localStream.getVideoTracks())this.localStream.removeTrack(e),e.stop();navigator.mediaDevices.getUserMedia({audio:!1,video:{height:{exact:720},width:{exact:1280}}}).then(e=>{this.changeVideoTrack(e),this.desktopSharing=!1}).catch(e=>{this.desktopSharing=!1,console.debug("stopDesktopShare getUserMedia failed: ",e)})}}changeVideoTrack(e,r){if(!this.localStream||!this.peerConnection){for(let n of e.getTracks())e.removeTrack(n),n.stop();return new Error("localStream undefined or peerConnection undefined")}for(let n of this.localStream.getVideoTracks())this.localStream.removeTrack(n),n.stop();for(let n of e.getTracks())e.removeTrack(n),n.kind=="video"?(this.localStream.addTrack(n),r&&(n.onended=o=>{r()})):n.stop();for(let n of this.peerConnection.getSenders())n.track&&n.track.kind==="video"&&n.replaceTrack(this.localStream.getVideoTracks()[0]).then(()=>{}).catch(o=>{console.error(o)})}error(e){console.debug("webrtc error: ",e),this.stop(),this.sessionListener.onError(e)}addTransceivers(){this.peerConnection.addTransceiver("audio",{direction:"recvonly"}),this.peerConnection.addTransceiver("video",{direction:"recvonly"})}gotLocalMedia(){let e={audio:{echoCancellation:!0,noiseSuppression:!0}};switch(this.sessionType){case g.VIDEO:case g.VIDEO_PUSH:case g.VIDEO_HALF:e.video={height:{exact:720},width:{exact:1280}};break}navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?navigator.mediaDevices.getUserMedia(e).then(r=>{this.getMediaSuccess(r)}).catch(r=>{this.getMediaFailed(r)}):this.error(new Error("Browser does not support WebRTC"))}getMediaSuccess(e){console.debug("webrtc getMediaSuccess"),this.localStream=e,(this.sessionType===g.VIDEO||this.sessionType===g.VIDEO_PUSH||this.sessionType===g.VIDEO_HALF)&&this.sessionListener.onAddLocalStream(e),e.getTracks().forEach(r=>{switch(this.sessionType){case g.AUDIO_PUSH:case g.VIDEO_PUSH:this.peerConnection.addTransceiver(r,{direction:"sendonly",streams:[e]});break;default:this.peerConnection.addTrack(r,e)}}),this.muted=!1}getMediaFailed(e){if(console.debug("webrtc getMediaFailed failed"),this.sessionType===g.VIDEO){console.error("get video media failed. maybe not found camera.",e),this.sessionType=g.AUDIO,this.gotLocalMedia();return}else if(this.sessionType===g.VIDEO_PUSH){console.error("get video media failed. maybe not found camera.",e),this.sessionType=g.AUDIO_PUSH,this.gotLocalMedia();return}else if(this.sessionType===g.VIDEO_HALF){console.error("get video media failed. maybe not found camera.",e),this.sessionType=g.AUDIO_HALF,this.gotLocalMedia();return}this.error(e)}createDataChannel(){this.peerConnection&&(this.isCallOut?(this.dataChannel=this.peerConnection.createDataChannel("command_channel"),this.dataChannel.onmessage=e=>{this.onDataChannelReceive(e.data)}):this.peerConnection.ondatachannel=e=>{this.dataChannel=e.channel,this.dataChannel.onmessage=r=>{this.onDataChannelReceive(r.data)}})}onDataChannelReceive(e){if(e==="close"){console.debug("data channel receive from server: close"),this.dataChannel=void 0,this.stop();return}(this.sessionType==g.VIDEO_HALF||this.sessionType==g.AUDIO_HALF)&&this.sessionListener.onDataChannelMessage(e)}changeCameraLocalMedia(){return new Promise((e,r)=>{let n;if(this.facingMode===K.FRONT_FACING?n={audio:{echoCancellation:!0,noiseSuppression:!0},video:{height:{exact:1280},width:{exact:720},facingMode:"environment"}}:n={audio:{echoCancellation:!0,noiseSuppression:!0},video:{height:{exact:720},width:{exact:1280},facingMode:"user"}},navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)navigator.mediaDevices.getUserMedia(n).then(o=>{this.changeCameraSuccess(o),e()}).catch(o=>{this.changeCameraFailed(o),r(o)});else{let o=new Error("Browser does not support WebRTC");this.changeCameraFailed(o),r(new Error("Browser does not support WebRTC"))}})}changeCameraSuccess(e){if(!this.localStream){e.getTracks().forEach(r=>{r.stop()}),this.facingChanging=!1;return}this.localStream.getVideoTracks().forEach(r=>{this.localStream.removeTrack(r),r.stop()}),e.getVideoTracks().forEach(r=>{this.localStream.addTrack(r)}),this.peerConnection.getSenders().forEach(r=>{r.track&&r.track.kind==="video"&&r.replaceTrack(e.getVideoTracks()[0]).then(()=>{}).catch(n=>{console.log(n)})}),this.facingMode===K.FRONT_FACING?this.facingMode=K.BACK_FACING:this.facingMode=K.FRONT_FACING,this.facingChanging=!1}changeCameraFailed(e){console.log(e),this.facingChanging=!1}}class as{onAddRemoteStream(e){console.debug("onAddRemoteStream:",e)}onError(e){console.debug("onError:",e)}}class Jr{constructor(e,r){m(this,"url");m(this,"offerSdp");this.url=e,this.offerSdp=r}}const cs="/media-server/video-play/webrtc";class ls{constructor(e,r){m(this,"rtspUrl");m(this,"webrtcSession",new Ft(g.RTSP_PULL));m(this,"sessionListener",new as);m(this,"httpClient");this.rtspUrl=e,this.httpClient=r,this.webrtcSession.setListener(this)}setRtspPullSessionListener(e){this.sessionListener=e}start(){this.webrtcSession.start(!0)}stop(){this.webrtcSession.stop()}onAddLocalStream(e){}onAddRemoteStream(e){this.sessionListener.onAddRemoteStream(e)}onError(e){this.sessionListener.onError(e)}onStartSuccess(e){console.debug("rtsp offer:",e.sdp),this.httpClient.Post(cs,new Jr(this.rtspUrl,e.sdp??"")).then(r=>{var n,o,i,s;if(r.code!=200){this.stop(),this.sessionListener.onError(new Error(r.message));return}console.debug("rtsp answer",(n=r.data)==null?void 0:n.sdp),console.debug("rtsp answer",(o=r.data)==null?void 0:o.candidateList),this.webrtcSession.setRemoteSdp(((i=r.data)==null?void 0:i.sdp)??""),this.webrtcSession.addRemoteCandidate(((s=r.data)==null?void 0:s.candidateList)??[])}).catch(r=>{this.stop(),this.sessionListener.onError(r)})}onDataChannelMessage(e){}onStopDesktopShare(){}}var A=(t=>(t[t.OFFLINE=-1]="OFFLINE",t[t.IDLE=0]="IDLE",t[t.TRY=1]="TRY",t[t.RING=2]="RING",t[t.TALK=3]="TALK",t))(A||{}),F=(t=>(t.VIDEO="video",t.AUDIO="audio",t))(F||{}),$=(t=>(t.FULL="full-duplex",t.HALF="half-duplex",t))($||{}),re=(t=>(t.IN="in",t.OUT="out",t))(re||{}),_=(t=>(t.LOGIN="login",t.LOGOUT="logout",t.Invite="invite",t.RING="ring",t.ANSWER="answer",t.HANGUP="hangup",t.DTMF="dtmf",t))(_||{});function Kr(){try{return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}catch{return!1}}function us(){return"browser-"+fs()+ds(6)}function fs(){let t=new Date;return`${t.getFullYear()}${t.getMonth()}${t.getDate()}${t.getHours()}${t.getMinutes()}${t.getSeconds()}`}function ds(t){let e="",r=["0","1","2","3","4","5","6","7","8","9","0","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];for(let n=0;n<t;n++)e+=r[Math.floor(Math.random()*(r.length-1))];return e}class ps{constructor(e,r,n){m(this,"tel");m(this,"mediaType");m(this,"callMode");this.tel=e,this.callMode=n,this.mediaType=r}}class Qr{onAddLocalStream(e){console.debug("onAddLocalStream:",e)}onAddRemoteStream(e){console.debug("onAddRemoteStream:",e)}onAnswer(){console.debug("onAnswer")}onClose(e){console.debug("onClose:",e)}onError(e){console.debug("onError:",e)}onHangup(e){console.debug("onHangup:",e)}onNewCall(e){console.debug("onNewCall:",e)}onRing(){console.debug("onRing")}onInitResult(e){console.debug("onInitResult: ",e)}onStopDesktopShare(){console.debug("onStopDesktopShare")}}class Xr{constructor(e,r,n){m(this,"tel","");m(this,"status",A.OFFLINE);m(this,"mediaType",F.AUDIO);m(this,"callMode",$.FULL);m(this,"callDirect",re.OUT);m(this,"called","");m(this,"callId");m(this,"remoteSdp");m(this,"candidate");m(this,"ringBackTone",new Audio("sound/ringbacktone.wav"));m(this,"ringtone",new Audio("sound/ringtone.wav"));m(this,"dtmfAudio",new Audio("sound/dtmf.wav"));m(this,"ws");m(this,"wsConnected",!1);m(this,"closeBySelf",!1);m(this,"webrtcSession");m(this,"sessionListener",new Qr);m(this,"wsUrl");m(this,"accountId");this.tel=r??"",this.wsUrl=e,this.accountId=n,this.ringBackTone.loop=!0,this.ringtone.loop=!0}setCallSessionListener(e){this.sessionListener=e}init(){this.websocketInit(this.wsUrl)}audioCall(e){this.makeCall(e)}videoCall(e){this.makeCall(e,F.VIDEO)}answer(){var r;if(this.status!=A.RING){console.debug("session is not ring state");return}if(this.callDirect!=re.IN){console.debug("session is call out, not allow answer");return}let e;this.callMode==$.HALF?e=F.VIDEO==this.mediaType?g.VIDEO_HALF:g.AUDIO_HALF:e=F.VIDEO==this.mediaType?g.VIDEO:g.AUDIO,this.webrtcCreate(e),(r=this.webrtcSession)==null||r.start(!1,this.remoteSdp)}hangup(){this.status<=A.IDLE||(this.status==A.TALK?this.sendHangup(this.callId??""):this.callDirect==re.IN?this.sendHangup(this.callId??"",488):this.sendHangup(this.callId??"",801),this.close())}dtmf(e){return this.status!==A.TALK?!1:(this.sendDtmf(e),!0)}changeCamera(){return new Promise((e,r)=>{var n;this.webrtcSession||r(new Error("webrtc session not start")),(n=this.webrtcSession)==null||n.changeFacing().then(o=>e(o)).catch(o=>r(o))})}changeMuted(){return new Promise((e,r)=>{this.webrtcSession||r(new Error("webrtc session not start")),this.webrtcSession.changeMuted().then(n=>e(n)).catch(n=>r(n))})}changeCameraOpened(){return new Promise((e,r)=>{this.webrtcSession||r(new Error("webrtc session not start")),this.webrtcSession.changeCameraOpened().then(n=>e(n)).catch(n=>r(n))})}startDesktopShare(){return new Promise((e,r)=>{this.webrtcSession||r(new Error("webrtc session not start")),this.status!=A.TALK&&r(new Error(`session status[${this.status}] not talk`)),this.webrtcSession.startDesktopShare().then(()=>e()).catch(n=>r(n))})}stopDesktopShare(){this.webrtcSession&&this.status==A.TALK&&this.webrtcSession.stopDesktopShare()}destroy(){var e;this.closeBySelf=!0,this.hangup(),this.close(),(e=this.ws)==null||e.close()}makeCall(e,r=F.AUDIO,n=$.FULL){var o;try{if(!Kr()){console.debug("Browser does not support WEBRTC"),this.sessionListener.onError(new Error("Browser does not support WEBRTC"));return}if(this.status==A.OFFLINE){console.debug("The initialization has not been completed yet. Please try again later"),this.sessionListener.onError(new Error("The initialization has not been completed yet. Please try again later"));return}this.status>A.IDLE&&(console.debug("Another call is currently in progress, hangup it"),this.hangup()),this.mediaType=r,this.callMode=n,this.called=e,this.callDirect=re.OUT,this.callId=us();let i;this.callMode==$.HALF?i=F.VIDEO==r?g.VIDEO_HALF:g.AUDIO_HALF:i=F.VIDEO==r?g.VIDEO:g.AUDIO,this.webrtcCreate(i),(o=this.webrtcSession)==null||o.start(!0),this.status=A.TRY}catch(i){this.status=A.IDLE,this.sessionListener.onError(new Error(""+i))}}close(){this.webrtcClose();try{this.ringtone.pause(),this.ringBackTone.pause()}catch(e){console.debug("FullSession.close: ",e)}this.status=A.IDLE}websocketInit(e){this.ws=new WebSocket(e),this.closeBySelf=!1,this.ws.onopen=()=>{console.debug("ws connect success"),this.wsConnected=!0,this.sendLogin()},this.ws.onclose=r=>{console.error("ws on close: ",r),this.wsConnected=!1,this.close(),this.status=A.OFFLINE,this.closeBySelf||this.sessionListener.onClose(new Error(r.reason)),this.ws=void 0},this.ws.onmessage=r=>{try{let n=JSON.parse(r.data);switch(console.debug("receive msg from server <<<<<<<<<<<<<<<",n),n.type){case _.Invite:this.inviteHandler(n);break;case _.ANSWER:this.answerHandler(n);break;case _.RING:this.ringHandler(n);break;case _.HANGUP:this.hangupHandler(n);break;case _.LOGIN:this.loginHandler(n);break}}catch(n){console.error("receive msg from server, but process error: ",n,r)}},this.ws.onerror=r=>{console.error("ws on error: ",r)}}sendTo(e){var r;try{this.wsConnected?(console.debug("send msg to server >>>>>>>>>>>>>>>>>> ",e),(r=this.ws)==null||r.send(JSON.stringify(e))):console.error("ws not connected.")}catch(n){console.debug("FullSession sendTo error: ",n)}}sendLogin(){this.sendTo({type:_.LOGIN,username:this.tel,userAgent:this.getUserAgent(),accountId:this.accountId})}sendLogout(){this.sendTo({type:_.LOGOUT,username:this.tel}),this.status=A.OFFLINE}sendInvite(e){this.sendTo({callId:this.callId,type:_.Invite,from:this.tel,to:this.called,callMode:this.callMode,mediaType:this.mediaType,sdp:e}),this.status=A.TRY}sendRing(){this.sendTo({type:_.RING,callId:this.callId,code:180}),this.status=A.RING}sendAnswer(e){this.sendTo({type:_.ANSWER,callId:this.callId,mediaType:this.mediaType,sdp:e}),this.status=A.TALK,this.ringtone.pause(),this.ringBackTone.pause()}sendDtmf(e){this.sendTo({type:_.DTMF,callId:this.callId,callInfo:"dtmf="+e}),this.dtmfAudio.play().then(()=>{}).catch(r=>console.debug(r))}sendHangup(e,r=800){this.sendTo({type:_.HANGUP,callId:e,code:r}),e==this.callId&&(this.status=A.IDLE,this.callId=void 0)}loginHandler(e){var r;if(e.code!=200){(r=this.ws)==null||r.close(),this.wsConnected=!1,this.ws=void 0,this.status=A.OFFLINE,this.sessionListener.onInitResult(!1);return}this.tel=e.username??"",this.status=A.IDLE,this.sessionListener.onInitResult(!0)}inviteHandler(e){if(!e.callId){console.debug("receive invite, but callId is null.");return}if(!Kr()){console.debug("receive invite, but unsupported webrtc."),this.sendHangup(e.callId,803);return}if(this.status>A.IDLE){e.callId!=this.callId?(console.debug("receive invite, but busy."),this.sendHangup(e.callId,486)):console.debug("receive re invite. not process");return}this.callId=e.callId,this.mediaType=e.mediaType??F.AUDIO,this.callMode=e.callMode??$.FULL,this.called=e.from??"",this.callDirect=re.IN,this.remoteSdp=e.sdp,this.candidate=e.candidate,this.sendRing(),this.ringtone.currentTime=0,this.ringtone.play().then(()=>{}).catch(()=>{}),this.sessionListener.onNewCall(new ps(this.called,this.mediaType,this.callMode))}ringHandler(e){var r,n;!e.callId||e.callId!=this.callId||(e.code==183?(this.ringBackTone.pause(),(r=this.webrtcSession)==null||r.setRemoteSdp(e.sdp??""),(n=this.webrtcSession)==null||n.addRemoteCandidate(e.candidate??[])):(this.ringBackTone.currentTime=0,this.ringBackTone.play().then(()=>{}).catch(()=>{})),this.sessionListener.onRing(),this.status=A.RING)}answerHandler(e){var r,n;!e.callId||e.callId!=this.callId||(this.ringBackTone.pause(),(r=this.webrtcSession)==null||r.setRemoteSdp(e.sdp??""),(n=this.webrtcSession)==null||n.addRemoteCandidate(e.candidate??[]),this.sessionListener.onAnswer(),this.status=A.TALK)}hangupHandler(e){!e.callId||e.callId!=this.callId||(this.close(),this.sessionListener.onHangup(e.code))}getUserAgent(){return navigator.platform.indexOf("Win")>=0?"windows":"phone"}webrtcCreate(e){this.webrtcClose(),this.webrtcSession=new Ft(e),this.webrtcSession.setListener(this)}webrtcClose(){var e;(e=this.webrtcSession)==null||e.stop(),this.webrtcSession=void 0}onAddLocalStream(e){this.sessionListener.onAddLocalStream(e)}onAddRemoteStream(e){this.sessionListener.onAddRemoteStream(e)}onError(e){this.close(),this.callDirect==re.OUT&&this.hangup(),this.sessionListener.onError(e)}onStartSuccess(e){var r;e.type=="answer"?(this.sendAnswer(e.sdp??""),(r=this.webrtcSession)==null||r.addRemoteCandidate(this.candidate??[])):e.type=="offer"&&this.sendInvite(e.sdp??"")}onDataChannelMessage(e){}onStopDesktopShare(){this.sessionListener.onStopDesktopShare()}}class hs{onError(e){console.debug("onError:",e)}onAddLocalStream(e){console.debug("onAddLocalStream:",e)}onStopDesktopShare(){console.debug("onStopDesktopShare")}}const ys="/media-server/broadcast/webrtc";class ms{constructor(e,r,n){m(this,"tel");m(this,"mediaType");m(this,"webrtcSession");m(this,"sessionListener",new hs);m(this,"httpClient");this.tel=e,this.httpClient=r,this.mediaType=n===F.VIDEO?F.VIDEO:F.AUDIO,this.webrtcSession=new Ft(n==F.VIDEO?g.VIDEO_PUSH:g.AUDIO_PUSH),this.webrtcSession.setListener(this)}setBroadcastSessionListener(e){this.sessionListener=e}start(){this.webrtcSession.start(!0)}stop(){this.webrtcSession.stop()}startDesktopShare(){return new Promise((e,r)=>{this.webrtcSession||r(new Error("webrtc session not start")),this.webrtcSession.startDesktopShare().then(()=>e()).catch(n=>r(n))})}stopDesktopShare(){this.webrtcSession&&this.webrtcSession.stopDesktopShare()}onAddLocalStream(e){this.sessionListener.onAddLocalStream(e)}onAddRemoteStream(e){}onError(e){this.sessionListener.onError(e)}onStartSuccess(e){console.debug("offer:",e.sdp),this.httpClient.Post(ys,new Jr(this.tel,e.sdp??"")).then(r=>{var n,o,i;if(r.code!=200){this.stop(),this.sessionListener.onError(new Error(r.message));return}console.debug("answer",(n=r.data)==null?void 0:n.sdp),this.webrtcSession.setRemoteSdp(((o=r.data)==null?void 0:o.sdp)??""),this.webrtcSession.addRemoteCandidate(((i=r.data)==null?void 0:i.candidateList)??[])}).catch(r=>{this.stop(),this.sessionListener.onError(r)})}onDataChannelMessage(e){}onStopDesktopShare(){this.sessionListener.onStopDesktopShare()}}var Nt=(t=>(t.TB_REQUEST="tb_request",t.TB_GRANTED="tb_granted",t.TB_TAKEN="tb_taken",t.TB_DENY="tb_deny",t.TB_RELEASE="tb_release",t.TB_IDLE="tb_idle",t.TB_REVOKE="tb_revoke",t))(Nt||{});class gs extends Qr{onTbcpMessage(e){console.debug("onTbcpMessage:",e)}}class Ss extends Xr{constructor(r,n,o){super(r,n,o);m(this,"sessionListener",new gs)}setCallSessionListener(r){this.sessionListener=r}audioHalfCall(r){this.makeCall(r,F.AUDIO,$.HALF)}videoHalfCall(r){this.makeCall(r,F.VIDEO,$.HALF)}tbcpRequest(){var r;this.callMode==$.HALF&&this.status==A.TALK&&((r=this.webrtcSession)==null||r.sendStringData(JSON.stringify({type:Nt.TB_REQUEST})))}tbcpRelease(){var r;this.callMode==$.HALF&&this.status==A.TALK&&((r=this.webrtcSession)==null||r.sendStringData(JSON.stringify({type:Nt.TB_RELEASE})))}onDataChannelMessage(r){try{this.sessionListener.onTbcpMessage(JSON.parse(r))}catch(n){console.debug("onDataChannelMessage err: ",n,r)}}}let _t=new zr("/"),Yr="/media-server/ws/voip",Zr="/media-server/ws/b-trun-c",xt=new URL((location.protocol=="https:"?"wss://":"ws://")+location.host+Yr),Ut=new URL((location.protocol=="https:"?"wss://":"ws://")+location.host+Zr);function ws(t){_t=new zr(t)}function bs(t){return new ls(t,_t)}function vs(t,e){return new ms(t,_t,e)}function Es(t){xt=new URL(t),xt.pathname=Yr,Ut=new URL(t),Ut.pathname=Zr}function As(t){return new Xr(xt.toString(),t)}function Os(t,e){return new Ss(Ut.toString(),t,e)}T.createAppCallSession=Os,T.createBroadcastSession=vs,T.createCallSession=As,T.createRtspPullSession=bs,T.videoModuleInit=ws,T.voipModuleInit=Es,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "media-av",
3
3
  "private": false,
4
- "version": "0.0.18",
4
+ "version": "0.0.20",
5
5
  "type": "module",
6
6
  "author": "W.w.",
7
7
  "license": "MIT",