react-luminus-components 2.0.29 → 2.0.30
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 +349 -349
- package/dist/.vite/manifest.json +44 -44
- package/dist/{FormDisabledProvider-v_f72bx-.js → FormDisabledProvider-BdVAJaqG.js} +5 -5
- package/dist/FormDisabledProvider-DyO7R2kE.cjs +1 -0
- package/dist/contexts/apiWebSocket/ApiWebSocketContext.d.ts +10 -0
- package/dist/contexts/apiWebSocket/ApiWebSocketProvider.d.ts +9 -0
- package/dist/contexts/apiWebSocket/useApiWebSocket.d.ts +2 -0
- package/dist/contexts/index.d.ts +3 -0
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +1418 -517
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useIsBrowserOnline/useIsBrowserOnline.d.ts +2 -0
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +159 -150
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +208 -214
- package/dist/{localStorageUtils-CZ4HDRzi.js → localStorageUtils-D2opn367.js} +2 -2
- package/dist/main.cjs.js +15 -15
- package/dist/main.es.js +12444 -12445
- package/dist/{ShortcutLinksContext-Bzk6zb9Z.js → nivo-bar-BsmDtzXw.js} +25782 -24835
- package/dist/nivo-bar-CdrSgzV1.cjs +285 -0
- package/dist/style.css +1 -1
- package/dist/useIsFormDirty-CzwHpad1.cjs +1 -0
- package/dist/{useIsFormDirty-Cp4xs1BK.js → useIsFormDirty-Pdd8CdTQ.js} +5 -5
- package/dist/{useLocalStorageState-DgJ_e5P1.js → useLocalStorageState-Byzo2ssr.js} +30 -30
- package/dist/useLocalStorageState-CbsbIUSp.cjs +1 -0
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.es.js +26 -26
- package/dist/variables.scss +165 -165
- package/package.json +128 -127
- package/dist/FormDisabledProvider-DkShe5lG.cjs +0 -1
- package/dist/ShortcutLinksContext-D4CGbP2q.cjs +0 -285
- package/dist/useIsFormDirty-DjNkWEmd.cjs +0 -1
- package/dist/useLocalStorageState-BOKWHt5u.cjs +0 -1
package/dist/contexts.es.js
CHANGED
|
@@ -1,660 +1,1561 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import {
|
|
3
|
-
import { jsxs as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { EventType as
|
|
6
|
-
import { useMsal as
|
|
1
|
+
import { t as se, bR as $e, c as N, bS as Ne, R as ce, an as He, bT as Ae, a5 as O, ak as Oe, S as re, bU as Ue, ar as We, ap as je, bh as ge, bC as De, bj as K, aq as Fe, bV as Be, aF as me, bW as ze, bX as Ge, bY as R, bZ as Ve, b_ as U, b$ as l, c0 as pe, c1 as Le, c2 as z, c3 as E, c4 as Q, c5 as ie, c6 as Re, c7 as Xe, c8 as we, c9 as Ke, ca as Je, cb as Qe, cc as qe, cd as Se, ce as B, cf as Ie, cg as be, ch as Ye, ci as Ze, cj as et, ao as tt, bc as nt, a6 as ot } from "./nivo-bar-BsmDtzXw.js";
|
|
2
|
+
import { ck as dn, ah as fn } from "./nivo-bar-BsmDtzXw.js";
|
|
3
|
+
import { jsxs as I, jsx as v } from "react/jsx-runtime";
|
|
4
|
+
import { useState as L, useContext as V, useEffect as W, useRef as ae, useMemo as J, useCallback as ne, useSyncExternalStore as st } from "react";
|
|
5
|
+
import { EventType as fe, InteractionStatus as Ce, InteractionRequiredAuthError as rt } from "@azure/msal-browser";
|
|
6
|
+
import { useMsal as it, MsalProvider as at } from "@azure/msal-react";
|
|
7
7
|
import "react-router";
|
|
8
8
|
import "react-dom";
|
|
9
9
|
import "react-hook-form";
|
|
10
10
|
import "react-flexmonster";
|
|
11
|
-
import { L as
|
|
12
|
-
import { F as
|
|
13
|
-
import { a as
|
|
14
|
-
function
|
|
15
|
-
const e =
|
|
11
|
+
import { L as ct, b as lt } from "./FormDisabledProvider-BdVAJaqG.js";
|
|
12
|
+
import { F as pn } from "./FormDisabledProvider-BdVAJaqG.js";
|
|
13
|
+
import { a as ht, u as ut } from "./useLocalStorageState-Byzo2ssr.js";
|
|
14
|
+
function dt(t) {
|
|
15
|
+
const e = se(t);
|
|
16
16
|
return e.setHours(23, 59, 59, 999), e;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
return
|
|
18
|
+
function ft() {
|
|
19
|
+
return dt(Date.now());
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
const
|
|
23
|
-
+
|
|
24
|
-
+
|
|
25
|
-
].sort((
|
|
26
|
-
return
|
|
21
|
+
function gt(t, e) {
|
|
22
|
+
const n = +se(t), [s, o] = [
|
|
23
|
+
+se(e.start),
|
|
24
|
+
+se(e.end)
|
|
25
|
+
].sort((r, i) => r - i);
|
|
26
|
+
return n >= s && n <= o;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
return
|
|
28
|
+
function pt() {
|
|
29
|
+
return $e(Date.now());
|
|
30
30
|
}
|
|
31
|
-
const
|
|
32
|
-
const e =
|
|
33
|
-
children:
|
|
34
|
-
} = t, [
|
|
35
|
-
let
|
|
36
|
-
e[0] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
37
|
-
|
|
38
|
-
}, e[0] =
|
|
39
|
-
const
|
|
40
|
-
let
|
|
41
|
-
e[1] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
42
|
-
|
|
43
|
-
}, e[1] =
|
|
44
|
-
const
|
|
45
|
-
let
|
|
46
|
-
e[2] !==
|
|
47
|
-
show:
|
|
48
|
-
text:
|
|
49
|
-
showConfirm:
|
|
50
|
-
hideConfirm:
|
|
51
|
-
textSm:
|
|
52
|
-
}, e[2] =
|
|
53
|
-
const
|
|
54
|
-
let
|
|
55
|
-
e[6] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
56
|
-
let
|
|
57
|
-
return e[7] !==
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
] }), e[7] =
|
|
61
|
-
},
|
|
62
|
-
const t =
|
|
31
|
+
const _t = (t) => {
|
|
32
|
+
const e = N.c(10), {
|
|
33
|
+
children: n
|
|
34
|
+
} = t, [s, o] = L(!1), [r, i] = L(""), [a, c] = L(void 0);
|
|
35
|
+
let u;
|
|
36
|
+
e[0] === Symbol.for("react.memo_cache_sentinel") ? (u = (S, m) => {
|
|
37
|
+
o(!0), i(S), c(m);
|
|
38
|
+
}, e[0] = u) : u = e[0];
|
|
39
|
+
const h = u;
|
|
40
|
+
let g;
|
|
41
|
+
e[1] === Symbol.for("react.memo_cache_sentinel") ? (g = () => {
|
|
42
|
+
o(!1);
|
|
43
|
+
}, e[1] = g) : g = e[1];
|
|
44
|
+
const p = g;
|
|
45
|
+
let f;
|
|
46
|
+
e[2] !== s || e[3] !== r || e[4] !== a ? (f = {
|
|
47
|
+
show: s,
|
|
48
|
+
text: r,
|
|
49
|
+
showConfirm: h,
|
|
50
|
+
hideConfirm: p,
|
|
51
|
+
textSm: a
|
|
52
|
+
}, e[2] = s, e[3] = r, e[4] = a, e[5] = f) : f = e[5];
|
|
53
|
+
const _ = f;
|
|
54
|
+
let w;
|
|
55
|
+
e[6] === Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ v(Bt, {}), e[6] = w) : w = e[6];
|
|
56
|
+
let d;
|
|
57
|
+
return e[7] !== n || e[8] !== _ ? (d = /* @__PURE__ */ I(Ne.Provider, { value: _, children: [
|
|
58
|
+
w,
|
|
59
|
+
n
|
|
60
|
+
] }), e[7] = n, e[8] = _, e[9] = d) : d = e[9], d;
|
|
61
|
+
}, mt = () => {
|
|
62
|
+
const t = N.c(43), {
|
|
63
63
|
texts: e
|
|
64
|
-
} =
|
|
65
|
-
confirm:
|
|
64
|
+
} = V(ce), {
|
|
65
|
+
confirm: n
|
|
66
66
|
} = e, {
|
|
67
|
-
isShown:
|
|
68
|
-
text:
|
|
69
|
-
onFinish:
|
|
70
|
-
} =
|
|
71
|
-
options:
|
|
72
|
-
} =
|
|
73
|
-
let x;
|
|
74
|
-
t[0] !== c ? (x = () => {
|
|
75
|
-
c(null);
|
|
76
|
-
}, t[0] = c, t[1] = x) : x = t[1];
|
|
77
|
-
const d = x;
|
|
78
|
-
let S;
|
|
79
|
-
t[2] !== c || t[3] !== o.required || t[4] !== s ? (S = (U) => {
|
|
80
|
-
U.preventDefault(), !(o.required && !s) && (c(s), v(""));
|
|
81
|
-
}, t[2] = c, t[3] = o.required, t[4] = s, t[5] = S) : S = t[5];
|
|
82
|
-
const m = S;
|
|
83
|
-
let a;
|
|
84
|
-
t[6] === Symbol.for("react.memo_cache_sentinel") ? (a = (U) => v(U.currentTarget.value), t[6] = a) : a = t[6];
|
|
67
|
+
isShown: s,
|
|
68
|
+
text: o,
|
|
69
|
+
onFinish: r
|
|
70
|
+
} = He(), {
|
|
71
|
+
options: i
|
|
72
|
+
} = V(Ae), [a, c] = L(i.defaultValue ?? "");
|
|
85
73
|
let u;
|
|
86
|
-
t[
|
|
87
|
-
|
|
88
|
-
|
|
74
|
+
t[0] !== r ? (u = () => {
|
|
75
|
+
r(null);
|
|
76
|
+
}, t[0] = r, t[1] = u) : u = t[1];
|
|
77
|
+
const h = u;
|
|
78
|
+
let g;
|
|
79
|
+
t[2] !== r || t[3] !== i.required || t[4] !== a ? (g = (F) => {
|
|
80
|
+
F.preventDefault(), !(i.required && !a) && (r(a), c(""));
|
|
81
|
+
}, t[2] = r, t[3] = i.required, t[4] = a, t[5] = g) : g = t[5];
|
|
82
|
+
const p = g;
|
|
83
|
+
let f;
|
|
84
|
+
t[6] === Symbol.for("react.memo_cache_sentinel") ? (f = (F) => c(F.currentTarget.value), t[6] = f) : f = t[6];
|
|
85
|
+
let _;
|
|
86
|
+
t[7] !== a ? (_ = {
|
|
87
|
+
value: a,
|
|
88
|
+
onChange: f,
|
|
89
89
|
className: "w-100",
|
|
90
90
|
autoFocus: !0,
|
|
91
91
|
tabIndex: 0
|
|
92
|
-
}, t[7] =
|
|
93
|
-
const
|
|
94
|
-
let
|
|
95
|
-
t[9] !==
|
|
96
|
-
|
|
97
|
-
},
|
|
98
|
-
let
|
|
99
|
-
t[13] !==
|
|
100
|
-
let w;
|
|
101
|
-
t[15] !== h || t[16] !== o.input ? (w = o.input === "textarea" ? /* @__PURE__ */ T("textarea", { ...h, rows: 5 }) : void 0, t[15] = h, t[16] = o.input, t[17] = w) : w = t[17];
|
|
92
|
+
}, t[7] = a, t[8] = _) : _ = t[8];
|
|
93
|
+
const w = _;
|
|
94
|
+
let d, S;
|
|
95
|
+
t[9] !== s || t[10] !== i.defaultValue ? (d = () => {
|
|
96
|
+
s === !0 && c(i.defaultValue ?? "");
|
|
97
|
+
}, S = [s, i.defaultValue], t[9] = s, t[10] = i.defaultValue, t[11] = d, t[12] = S) : (d = t[11], S = t[12]), W(d, S);
|
|
98
|
+
let m;
|
|
99
|
+
t[13] !== o ? (m = /* @__PURE__ */ v(O.Header, { className: "justify-content-center", children: /* @__PURE__ */ v(O.Title, { children: o }) }), t[13] = o, t[14] = m) : m = t[14];
|
|
102
100
|
let y;
|
|
103
|
-
t[
|
|
101
|
+
t[15] !== w || t[16] !== i.input ? (y = i.input === "textarea" ? /* @__PURE__ */ v("textarea", { ...w, rows: 5 }) : void 0, t[15] = w, t[16] = i.input, t[17] = y) : y = t[17];
|
|
104
102
|
let b;
|
|
105
|
-
t[
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
103
|
+
t[18] !== w || t[19] !== i.input || t[20] !== i.type ? (b = i.input === "input" ? /* @__PURE__ */ v(Oe, { ...w, type: i.type }) : void 0, t[18] = w, t[19] = i.input, t[20] = i.type, t[21] = b) : b = t[21];
|
|
104
|
+
let C;
|
|
105
|
+
t[22] !== y || t[23] !== b ? (C = /* @__PURE__ */ I(O.Body, { children: [
|
|
106
|
+
y,
|
|
107
|
+
b
|
|
108
|
+
] }), t[22] = y, t[23] = b, t[24] = C) : C = t[24];
|
|
109
109
|
let k;
|
|
110
|
-
t[25] !==
|
|
111
|
-
const
|
|
112
|
-
let
|
|
113
|
-
t[28] !==
|
|
110
|
+
t[25] !== n.cancel || t[26] !== h ? (k = /* @__PURE__ */ v(re, { variant: "outlined", color: "secondary", onClick: h, className: "flex-grow-1", children: n.cancel }), t[25] = n.cancel, t[26] = h, t[27] = k) : k = t[27];
|
|
111
|
+
const j = i.required && !a;
|
|
112
|
+
let P;
|
|
113
|
+
t[28] !== n.confirm || t[29] !== j ? (P = /* @__PURE__ */ v(re, { color: "primary", disabled: j, type: "submit", className: "flex-grow-1", children: n.confirm }), t[28] = n.confirm, t[29] = j, t[30] = P) : P = t[30];
|
|
114
114
|
let M;
|
|
115
|
-
t[31] !== k || t[32] !==
|
|
115
|
+
t[31] !== k || t[32] !== P ? (M = /* @__PURE__ */ I(O.Footer, { className: "w-100 d-flex gap-5", children: [
|
|
116
116
|
k,
|
|
117
|
-
|
|
118
|
-
] }), t[31] = k, t[32] =
|
|
119
|
-
let
|
|
120
|
-
t[34] !==
|
|
121
|
-
|
|
117
|
+
P
|
|
118
|
+
] }), t[31] = k, t[32] = P, t[33] = M) : M = t[33];
|
|
119
|
+
let x;
|
|
120
|
+
t[34] !== p || t[35] !== C || t[36] !== M ? (x = /* @__PURE__ */ I("form", { onSubmit: p, onKeyDown: wt, children: [
|
|
121
|
+
C,
|
|
122
122
|
M
|
|
123
|
-
] }), t[34] =
|
|
124
|
-
let
|
|
125
|
-
return t[38] !==
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
] }), t[38] =
|
|
123
|
+
] }), t[34] = p, t[35] = C, t[36] = M, t[37] = x) : x = t[37];
|
|
124
|
+
let H;
|
|
125
|
+
return t[38] !== s || t[39] !== h || t[40] !== x || t[41] !== m ? (H = /* @__PURE__ */ I(O, { show: s, size: "sm", centered: !0, onHide: h, children: [
|
|
126
|
+
m,
|
|
127
|
+
x
|
|
128
|
+
] }), t[38] = s, t[39] = h, t[40] = x, t[41] = m, t[42] = H) : H = t[42], H;
|
|
129
129
|
};
|
|
130
|
-
function
|
|
130
|
+
function wt(t) {
|
|
131
131
|
return t.stopPropagation();
|
|
132
132
|
}
|
|
133
|
-
const
|
|
134
|
-
const e =
|
|
135
|
-
children:
|
|
136
|
-
} = t, [
|
|
137
|
-
let
|
|
138
|
-
e[0] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
133
|
+
const St = (t) => {
|
|
134
|
+
const e = N.c(11), {
|
|
135
|
+
children: n
|
|
136
|
+
} = t, [s, o] = L(!1), [r, i] = L("");
|
|
137
|
+
let a;
|
|
138
|
+
e[0] === Symbol.for("react.memo_cache_sentinel") ? (a = {
|
|
139
139
|
input: "textarea",
|
|
140
140
|
type: "text"
|
|
141
|
-
}, e[0] =
|
|
142
|
-
const [
|
|
143
|
-
let S;
|
|
144
|
-
e[1] === Symbol.for("react.memo_cache_sentinel") ? (S = (w) => {
|
|
145
|
-
o(w), n(!0);
|
|
146
|
-
}, e[1] = S) : S = e[1];
|
|
147
|
-
const m = S;
|
|
148
|
-
let a;
|
|
149
|
-
e[2] === Symbol.for("react.memo_cache_sentinel") ? (a = () => {
|
|
150
|
-
n(!1);
|
|
151
|
-
}, e[2] = a) : a = e[2];
|
|
152
|
-
const u = a;
|
|
153
|
-
let h;
|
|
154
|
-
e[3] !== r || e[4] !== v || e[5] !== c ? (h = {
|
|
155
|
-
isShown: r,
|
|
156
|
-
text: c,
|
|
157
|
-
showPrompt: m,
|
|
158
|
-
hidePrompt: u,
|
|
159
|
-
resolveRef: d,
|
|
160
|
-
options: v,
|
|
161
|
-
setOptions: x
|
|
162
|
-
}, e[3] = r, e[4] = v, e[5] = c, e[6] = h) : h = e[6];
|
|
163
|
-
const i = h;
|
|
141
|
+
}, e[0] = a) : a = e[0];
|
|
142
|
+
const [c, u] = L(a), h = ae(bt);
|
|
164
143
|
let g;
|
|
165
|
-
e[
|
|
144
|
+
e[1] === Symbol.for("react.memo_cache_sentinel") ? (g = (y) => {
|
|
145
|
+
i(y), o(!0);
|
|
146
|
+
}, e[1] = g) : g = e[1];
|
|
147
|
+
const p = g;
|
|
166
148
|
let f;
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
149
|
+
e[2] === Symbol.for("react.memo_cache_sentinel") ? (f = () => {
|
|
150
|
+
o(!1);
|
|
151
|
+
}, e[2] = f) : f = e[2];
|
|
152
|
+
const _ = f;
|
|
153
|
+
let w;
|
|
154
|
+
e[3] !== s || e[4] !== c || e[5] !== r ? (w = {
|
|
155
|
+
isShown: s,
|
|
156
|
+
text: r,
|
|
157
|
+
showPrompt: p,
|
|
158
|
+
hidePrompt: _,
|
|
159
|
+
resolveRef: h,
|
|
160
|
+
options: c,
|
|
161
|
+
setOptions: u
|
|
162
|
+
}, e[3] = s, e[4] = c, e[5] = r, e[6] = w) : w = e[6];
|
|
163
|
+
const d = w;
|
|
164
|
+
let S;
|
|
165
|
+
e[7] === Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ v(mt, {}), e[7] = S) : S = e[7];
|
|
166
|
+
let m;
|
|
167
|
+
return e[8] !== n || e[9] !== d ? (m = /* @__PURE__ */ I(Ae.Provider, { value: d, children: [
|
|
168
|
+
n,
|
|
169
|
+
S
|
|
170
|
+
] }), e[8] = n, e[9] = d, e[10] = m) : m = e[10], m;
|
|
171
171
|
};
|
|
172
|
-
function
|
|
172
|
+
function bt() {
|
|
173
173
|
}
|
|
174
|
-
const
|
|
175
|
-
const e =
|
|
176
|
-
cookieDomain:
|
|
177
|
-
axiosOptions:
|
|
178
|
-
language:
|
|
179
|
-
texts:
|
|
180
|
-
ProjectIconComponent:
|
|
181
|
-
localizationContext:
|
|
182
|
-
chartColorPalette:
|
|
183
|
-
children:
|
|
174
|
+
const tn = (t) => {
|
|
175
|
+
const e = N.c(14), {
|
|
176
|
+
cookieDomain: n,
|
|
177
|
+
axiosOptions: s,
|
|
178
|
+
language: o,
|
|
179
|
+
texts: r,
|
|
180
|
+
ProjectIconComponent: i,
|
|
181
|
+
localizationContext: a,
|
|
182
|
+
chartColorPalette: c,
|
|
183
|
+
children: u
|
|
184
184
|
} = t;
|
|
185
|
-
let
|
|
186
|
-
e[0] !==
|
|
187
|
-
axiosOptions:
|
|
188
|
-
cookieDomain:
|
|
189
|
-
language:
|
|
190
|
-
texts:
|
|
191
|
-
ProjectIconComponent:
|
|
192
|
-
localizationContext:
|
|
193
|
-
chartColorPalette:
|
|
194
|
-
}, e[0] =
|
|
195
|
-
const
|
|
196
|
-
let
|
|
197
|
-
e[8] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
198
|
-
let
|
|
199
|
-
e[9] !==
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
] }) }), e[9] =
|
|
203
|
-
let
|
|
204
|
-
return e[11] !==
|
|
205
|
-
},
|
|
206
|
-
const e =
|
|
207
|
-
children:
|
|
208
|
-
} = t, [
|
|
209
|
-
let
|
|
210
|
-
e[0] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
211
|
-
const [
|
|
212
|
-
let s;
|
|
213
|
-
e[1] !== o ? (s = (h) => {
|
|
214
|
-
o.add(h), n(!0);
|
|
215
|
-
}, e[1] = o, e[2] = s) : s = e[2];
|
|
216
|
-
const v = s;
|
|
217
|
-
let x;
|
|
218
|
-
e[3] !== o ? (x = (h) => {
|
|
219
|
-
o.delete(h), o.size === 0 && n(!1);
|
|
220
|
-
}, e[3] = o, e[4] = x) : x = e[4];
|
|
221
|
-
const d = x;
|
|
222
|
-
let S;
|
|
223
|
-
e[5] !== r || e[6] !== v || e[7] !== d ? (S = {
|
|
224
|
-
isLoading: r,
|
|
225
|
-
startLoading: v,
|
|
226
|
-
stopLoading: d
|
|
227
|
-
}, e[5] = r, e[6] = v, e[7] = d, e[8] = S) : S = e[8];
|
|
228
|
-
const m = S;
|
|
185
|
+
let h;
|
|
186
|
+
e[0] !== i || e[1] !== s || e[2] !== c || e[3] !== n || e[4] !== o || e[5] !== a || e[6] !== r ? (h = {
|
|
187
|
+
axiosOptions: s,
|
|
188
|
+
cookieDomain: n,
|
|
189
|
+
language: o,
|
|
190
|
+
texts: r,
|
|
191
|
+
ProjectIconComponent: i,
|
|
192
|
+
localizationContext: a,
|
|
193
|
+
chartColorPalette: c
|
|
194
|
+
}, e[0] = i, e[1] = s, e[2] = c, e[3] = n, e[4] = o, e[5] = a, e[6] = r, e[7] = h) : h = e[7];
|
|
195
|
+
const g = h;
|
|
196
|
+
let p;
|
|
197
|
+
e[8] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ v(Ue, {}), e[8] = p) : p = e[8];
|
|
198
|
+
let f;
|
|
199
|
+
e[9] !== u ? (f = /* @__PURE__ */ v(_t, { children: /* @__PURE__ */ I(St, { children: [
|
|
200
|
+
p,
|
|
201
|
+
u
|
|
202
|
+
] }) }), e[9] = u, e[10] = f) : f = e[10];
|
|
203
|
+
let _;
|
|
204
|
+
return e[11] !== g || e[12] !== f ? (_ = /* @__PURE__ */ v(ce.Provider, { value: g, children: f }), e[11] = g, e[12] = f, e[13] = _) : _ = e[13], _;
|
|
205
|
+
}, nn = (t) => {
|
|
206
|
+
const e = N.c(15), {
|
|
207
|
+
children: n
|
|
208
|
+
} = t, [s, o] = L(!1);
|
|
209
|
+
let r;
|
|
210
|
+
e[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ new Set(), e[0] = r) : r = e[0];
|
|
211
|
+
const [i] = L(r);
|
|
229
212
|
let a;
|
|
230
|
-
e[
|
|
213
|
+
e[1] !== i ? (a = (w) => {
|
|
214
|
+
i.add(w), o(!0);
|
|
215
|
+
}, e[1] = i, e[2] = a) : a = e[2];
|
|
216
|
+
const c = a;
|
|
231
217
|
let u;
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
e[
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
218
|
+
e[3] !== i ? (u = (w) => {
|
|
219
|
+
i.delete(w), i.size === 0 && o(!1);
|
|
220
|
+
}, e[3] = i, e[4] = u) : u = e[4];
|
|
221
|
+
const h = u;
|
|
222
|
+
let g;
|
|
223
|
+
e[5] !== s || e[6] !== c || e[7] !== h ? (g = {
|
|
224
|
+
isLoading: s,
|
|
225
|
+
startLoading: c,
|
|
226
|
+
stopLoading: h
|
|
227
|
+
}, e[5] = s, e[6] = c, e[7] = h, e[8] = g) : g = e[8];
|
|
228
|
+
const p = g;
|
|
229
|
+
let f;
|
|
230
|
+
e[9] !== s ? (f = s && /* @__PURE__ */ v(ct, {}), e[9] = s, e[10] = f) : f = e[10];
|
|
231
|
+
let _;
|
|
232
|
+
return e[11] !== n || e[12] !== p || e[13] !== f ? (_ = /* @__PURE__ */ I(We.Provider, { value: p, children: [
|
|
233
|
+
f,
|
|
234
|
+
n
|
|
235
|
+
] }), e[11] = n, e[12] = p, e[13] = f, e[14] = _) : _ = e[14], _;
|
|
236
|
+
}, on = (t) => {
|
|
237
|
+
const e = N.c(39), {
|
|
238
|
+
children: n
|
|
239
|
+
} = t, s = je(), {
|
|
240
|
+
msalInstance: o,
|
|
241
|
+
getToken: r
|
|
242
|
+
} = V(ge), {
|
|
243
|
+
delegation: i,
|
|
244
|
+
setDelegation: a,
|
|
245
|
+
setAvailableDelegations: c,
|
|
246
|
+
refreshAvailableDelegations: u
|
|
247
|
+
} = V(De), [h, g] = L(null);
|
|
248
|
+
let p;
|
|
249
|
+
e[0] !== r ? (p = async () => {
|
|
250
|
+
const A = await r();
|
|
251
|
+
A && g(A.token);
|
|
252
|
+
}, e[0] = r, e[1] = p) : p = e[1];
|
|
253
|
+
const f = p;
|
|
254
|
+
let _, w;
|
|
255
|
+
e[2] !== f ? (_ = () => {
|
|
256
|
+
f();
|
|
257
|
+
}, w = [f], e[2] = f, e[3] = _, e[4] = w) : (_ = e[3], w = e[4]), W(_, w);
|
|
258
|
+
let d;
|
|
259
259
|
if (e[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
260
260
|
e: {
|
|
261
|
-
const
|
|
262
|
-
if (!
|
|
263
|
-
|
|
261
|
+
const A = localStorage.getItem("user") ?? null;
|
|
262
|
+
if (!A) {
|
|
263
|
+
d = null;
|
|
264
264
|
break e;
|
|
265
265
|
}
|
|
266
|
-
|
|
266
|
+
d = JSON.parse(A ?? "");
|
|
267
267
|
}
|
|
268
|
-
e[5] =
|
|
268
|
+
e[5] = d;
|
|
269
269
|
} else
|
|
270
|
-
|
|
271
|
-
const
|
|
272
|
-
let
|
|
273
|
-
e[6] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
274
|
-
state:
|
|
275
|
-
user:
|
|
276
|
-
}, e[6] =
|
|
277
|
-
const [
|
|
278
|
-
let
|
|
279
|
-
e[7] !==
|
|
280
|
-
let
|
|
281
|
-
return await
|
|
270
|
+
d = e[5];
|
|
271
|
+
const S = d;
|
|
272
|
+
let m;
|
|
273
|
+
e[6] === Symbol.for("react.memo_cache_sentinel") ? (m = {
|
|
274
|
+
state: S ? K.LOGGED_IN : K.LOGGED_OUT,
|
|
275
|
+
user: S
|
|
276
|
+
}, e[6] = m) : m = e[6];
|
|
277
|
+
const [y, b] = L(m);
|
|
278
|
+
let C;
|
|
279
|
+
e[7] !== s ? (C = async (A) => {
|
|
280
|
+
let $ = null;
|
|
281
|
+
return await s.get("/user/detail", A ? {
|
|
282
282
|
headers: {
|
|
283
|
-
Authorization: `Bearer ${
|
|
283
|
+
Authorization: `Bearer ${A}`
|
|
284
284
|
}
|
|
285
|
-
} : void 0).then((
|
|
286
|
-
|
|
285
|
+
} : void 0).then((de) => {
|
|
286
|
+
$ = de.data;
|
|
287
287
|
}).catch(() => {
|
|
288
|
-
|
|
289
|
-
}),
|
|
290
|
-
}, e[7] =
|
|
291
|
-
const k =
|
|
292
|
-
let
|
|
293
|
-
e[9] !==
|
|
294
|
-
localStorage.removeItem("user"),
|
|
295
|
-
state:
|
|
288
|
+
$ = null;
|
|
289
|
+
}), $;
|
|
290
|
+
}, e[7] = s, e[8] = C) : C = e[8];
|
|
291
|
+
const k = C;
|
|
292
|
+
let j;
|
|
293
|
+
e[9] !== c || e[10] !== a ? (j = () => {
|
|
294
|
+
localStorage.removeItem("user"), b({
|
|
295
|
+
state: K.LOGGED_OUT,
|
|
296
296
|
user: null
|
|
297
|
-
}),
|
|
298
|
-
}, e[9] =
|
|
299
|
-
const
|
|
297
|
+
}), a(null), c(null);
|
|
298
|
+
}, e[9] = c, e[10] = a, e[11] = j) : j = e[11];
|
|
299
|
+
const P = j;
|
|
300
300
|
let M;
|
|
301
|
-
e[12] !== k || e[13] !==
|
|
302
|
-
|
|
303
|
-
state:
|
|
301
|
+
e[12] !== k || e[13] !== u ? (M = async (A) => {
|
|
302
|
+
b({
|
|
303
|
+
state: K.LOGGING_IN,
|
|
304
304
|
user: null
|
|
305
305
|
});
|
|
306
|
-
const
|
|
307
|
-
return
|
|
308
|
-
state:
|
|
309
|
-
user:
|
|
310
|
-
}), localStorage.setItem("user", JSON.stringify(
|
|
311
|
-
state:
|
|
306
|
+
const $ = await k(A);
|
|
307
|
+
return $ ? (b({
|
|
308
|
+
state: K.LOGGED_IN,
|
|
309
|
+
user: $
|
|
310
|
+
}), localStorage.setItem("user", JSON.stringify($)), await u(), !0) : (b({
|
|
311
|
+
state: K.LOGIN_FAILED,
|
|
312
312
|
user: null
|
|
313
313
|
}), !1);
|
|
314
|
-
}, e[12] = k, e[13] =
|
|
315
|
-
const
|
|
316
|
-
let
|
|
317
|
-
e[15] !==
|
|
318
|
-
if (
|
|
319
|
-
const
|
|
320
|
-
if (
|
|
321
|
-
const
|
|
322
|
-
|
|
314
|
+
}, e[12] = k, e[13] = u, e[14] = M) : M = e[14];
|
|
315
|
+
const x = M;
|
|
316
|
+
let H;
|
|
317
|
+
e[15] !== o ? (H = () => {
|
|
318
|
+
if (o) {
|
|
319
|
+
const A = o.addEventCallback(($) => {
|
|
320
|
+
if ($.eventType === fe.LOGIN_SUCCESS && $.payload) {
|
|
321
|
+
const de = $.payload;
|
|
322
|
+
g(de.accessToken);
|
|
323
323
|
}
|
|
324
324
|
});
|
|
325
325
|
return () => {
|
|
326
|
-
|
|
326
|
+
A && o.removeEventCallback(A);
|
|
327
327
|
};
|
|
328
328
|
}
|
|
329
|
-
return
|
|
330
|
-
}, e[15] =
|
|
331
|
-
let U;
|
|
332
|
-
e[17] !== C || e[18] !== _ || e[19] !== n ? (U = [n, C, _], e[17] = C, e[18] = _, e[19] = n, e[20] = U) : U = e[20], H(O, U);
|
|
333
|
-
let I;
|
|
334
|
-
e[21] !== C || e[22] !== _ || e[23] !== s ? (I = async (D) => {
|
|
335
|
-
D && await C(D).catch(() => {
|
|
336
|
-
_(), s(null);
|
|
337
|
-
});
|
|
338
|
-
}, e[21] = C, e[22] = _, e[23] = s, e[24] = I) : I = e[24];
|
|
339
|
-
const R = I;
|
|
340
|
-
let z;
|
|
341
|
-
e[25] !== d || e[26] !== R ? (z = () => {
|
|
342
|
-
R(d);
|
|
343
|
-
}, e[25] = d, e[26] = R, e[27] = z) : z = e[27];
|
|
344
|
-
const Y = o == null ? void 0 : o.id;
|
|
329
|
+
return Ct;
|
|
330
|
+
}, e[15] = o, e[16] = H) : H = e[16];
|
|
345
331
|
let F;
|
|
346
|
-
e[
|
|
347
|
-
let
|
|
348
|
-
e[
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
332
|
+
e[17] !== x || e[18] !== P || e[19] !== o ? (F = [o, x, P], e[17] = x, e[18] = P, e[19] = o, e[20] = F) : F = e[20], W(H, F);
|
|
333
|
+
let q;
|
|
334
|
+
e[21] !== x || e[22] !== P || e[23] !== a ? (q = async (A) => {
|
|
335
|
+
A && await x(A).catch(() => {
|
|
336
|
+
P(), a(null);
|
|
337
|
+
});
|
|
338
|
+
}, e[21] = x, e[22] = P, e[23] = a, e[24] = q) : q = e[24];
|
|
339
|
+
const X = q;
|
|
340
|
+
let Y;
|
|
341
|
+
e[25] !== h || e[26] !== X ? (Y = () => {
|
|
342
|
+
X(h);
|
|
343
|
+
}, e[25] = h, e[26] = X, e[27] = Y) : Y = e[27];
|
|
344
|
+
const he = i == null ? void 0 : i.id;
|
|
345
|
+
let Z;
|
|
346
|
+
e[28] !== h || e[29] !== X || e[30] !== he ? (Z = [h, he, X], e[28] = h, e[29] = X, e[30] = he, e[31] = Z) : Z = e[31], W(Y, Z);
|
|
347
|
+
let ee;
|
|
348
|
+
e[32] !== x || e[33] !== P || e[34] !== y ? (ee = {
|
|
349
|
+
user: y.user,
|
|
350
|
+
userLoginState: y,
|
|
351
|
+
loginUser: x,
|
|
352
|
+
logoutUser: P
|
|
353
|
+
}, e[32] = x, e[33] = P, e[34] = y, e[35] = ee) : ee = e[35];
|
|
354
|
+
const ue = ee;
|
|
355
|
+
let te;
|
|
356
|
+
return e[36] !== n || e[37] !== ue ? (te = /* @__PURE__ */ v(Fe.Provider, { value: ue, children: n }), e[36] = n, e[37] = ue, e[38] = te) : te = e[38], te;
|
|
357
357
|
};
|
|
358
|
-
function
|
|
358
|
+
function Ct() {
|
|
359
359
|
}
|
|
360
|
-
const
|
|
361
|
-
const t =
|
|
360
|
+
const ye = () => {
|
|
361
|
+
const t = N.c(2);
|
|
362
362
|
let e;
|
|
363
|
-
t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */
|
|
364
|
-
let
|
|
365
|
-
return t[1] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
363
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ v("p", { children: "Redirecting..." }), t[0] = e) : e = t[0];
|
|
364
|
+
let n;
|
|
365
|
+
return t[1] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ I("div", { children: [
|
|
366
366
|
e,
|
|
367
|
-
/* @__PURE__ */
|
|
367
|
+
/* @__PURE__ */ I("p", { children: [
|
|
368
368
|
"If you are not redirected within 10 seconds, please click",
|
|
369
369
|
" ",
|
|
370
|
-
/* @__PURE__ */
|
|
370
|
+
/* @__PURE__ */ v("a", { href: window.location.href.replace("/blank", "/"), children: "here" })
|
|
371
371
|
] })
|
|
372
|
-
] }), t[1] =
|
|
373
|
-
},
|
|
372
|
+
] }), t[1] = n) : n = t[1], n;
|
|
373
|
+
}, yt = (t) => {
|
|
374
374
|
const e = t == null ? void 0 : t.getActiveAccount();
|
|
375
375
|
console.log("getTokenMsal activeAccount", e);
|
|
376
|
-
const
|
|
377
|
-
console.log("getTokenMsal allAccounts",
|
|
378
|
-
const
|
|
379
|
-
return console.log("getTokenMsal account",
|
|
380
|
-
},
|
|
376
|
+
const n = t == null ? void 0 : t.getAllAccounts();
|
|
377
|
+
console.log("getTokenMsal allAccounts", n);
|
|
378
|
+
const s = (n == null ? void 0 : n.at(0)) ?? void 0;
|
|
379
|
+
return console.log("getTokenMsal account", s), s ? (e || t == null || t.setActiveAccount(s), s) : null;
|
|
380
|
+
}, sn = ({
|
|
381
381
|
...t
|
|
382
382
|
}) => {
|
|
383
383
|
const {
|
|
384
384
|
inProgress: e
|
|
385
|
-
} =
|
|
386
|
-
cookieDomain:
|
|
387
|
-
} =
|
|
385
|
+
} = it(), {
|
|
386
|
+
cookieDomain: n
|
|
387
|
+
} = V(ce), [, s] = Be(["Authorization"]), o = J(
|
|
388
388
|
() => t.useMsal ? t.msalInstance : null,
|
|
389
389
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
390
390
|
[t.useMsal, t.useMsal ? t.msalInstance : null]
|
|
391
|
-
),
|
|
391
|
+
), r = J(
|
|
392
392
|
() => t.useMsal ? t.msalScopes : [],
|
|
393
393
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
394
394
|
[t.useMsal, t.useMsal ? t.msalScopes : null]
|
|
395
|
-
),
|
|
395
|
+
), i = J(
|
|
396
396
|
() => t.useMsal ? t.msalExtraScopes : [],
|
|
397
397
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
398
398
|
[t.useMsal, t.useMsal ? t.msalExtraScopes : null]
|
|
399
|
-
),
|
|
400
|
-
const
|
|
401
|
-
return
|
|
402
|
-
token:
|
|
403
|
-
expiresOn:
|
|
399
|
+
), a = ae(null), c = ae(!1), u = ne(() => {
|
|
400
|
+
const d = localStorage.getItem("token");
|
|
401
|
+
return d ? {
|
|
402
|
+
token: d,
|
|
403
|
+
expiresOn: lt(new Date(Date.now()), 1)
|
|
404
404
|
} : null;
|
|
405
|
-
}, []),
|
|
406
|
-
if (console.log("getTokenMsal"),
|
|
405
|
+
}, []), h = ne(async () => {
|
|
406
|
+
if (console.log("getTokenMsal"), o == null)
|
|
407
407
|
throw console.log("getTokenMsal throwing error because msalInstance is null"), new Error("getTokenMsal: msalInstance is null");
|
|
408
|
-
if (
|
|
409
|
-
return console.log("getTokenMsal returning tokenRequestPromise.current",
|
|
410
|
-
const
|
|
411
|
-
const
|
|
412
|
-
const
|
|
413
|
-
if (!
|
|
414
|
-
console.log("getTokenMsal no account found. Redirecting to login"),
|
|
415
|
-
scopes:
|
|
416
|
-
extraScopesToConsent:
|
|
408
|
+
if (a.current)
|
|
409
|
+
return console.log("getTokenMsal returning tokenRequestPromise.current", a.current), a.current;
|
|
410
|
+
const d = new Promise((S, m) => {
|
|
411
|
+
const y = (b) => {
|
|
412
|
+
const C = yt(o);
|
|
413
|
+
if (!C) {
|
|
414
|
+
console.log("getTokenMsal no account found. Redirecting to login"), o == null || o.loginRedirect({
|
|
415
|
+
scopes: r,
|
|
416
|
+
extraScopesToConsent: i
|
|
417
417
|
});
|
|
418
418
|
return;
|
|
419
419
|
}
|
|
420
|
-
|
|
421
|
-
scopes:
|
|
422
|
-
account:
|
|
420
|
+
o == null || o.acquireTokenSilent({
|
|
421
|
+
scopes: r,
|
|
422
|
+
account: C,
|
|
423
423
|
redirectUri: t.useMsal ? t.msalSilentRedirectUri : void 0
|
|
424
424
|
}).then((k) => {
|
|
425
|
-
|
|
425
|
+
b(), S({
|
|
426
426
|
token: k.accessToken,
|
|
427
427
|
expiresOn: k.expiresOn ?? new Date(Date.now())
|
|
428
428
|
});
|
|
429
429
|
}).catch((k) => {
|
|
430
|
-
console.error("Error acquiring token", k), k instanceof
|
|
431
|
-
scopes:
|
|
432
|
-
extraScopesToConsent:
|
|
433
|
-
}),
|
|
430
|
+
console.error("Error acquiring token", k), k instanceof rt && (console.log("Silent token acquisition failed. Acquiring token using redirect"), o == null || o.acquireTokenRedirect({
|
|
431
|
+
scopes: r,
|
|
432
|
+
extraScopesToConsent: i
|
|
433
|
+
}), b(), S(null)), b(), m(k);
|
|
434
434
|
}).finally(() => {
|
|
435
|
-
|
|
435
|
+
b(), m(new Error("No access token returned from handleRedirectPromise"));
|
|
436
436
|
});
|
|
437
437
|
};
|
|
438
|
-
if (console.log("getTokenMsal promise"), e !==
|
|
439
|
-
console.log("getTokenMsal rejecting because inProgress !== InteractionStatus.None", e),
|
|
438
|
+
if (console.log("getTokenMsal promise"), e !== Ce.None) {
|
|
439
|
+
console.log("getTokenMsal rejecting because inProgress !== InteractionStatus.None", e), m(new Error("Authentication in progress"));
|
|
440
440
|
return;
|
|
441
441
|
}
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
}) :
|
|
445
|
-
if (console.log("getTokenMsal tokenResponse",
|
|
446
|
-
|
|
447
|
-
|
|
442
|
+
c.current ? y(() => {
|
|
443
|
+
a.current = null;
|
|
444
|
+
}) : o.handleRedirectPromise().then((b) => {
|
|
445
|
+
if (console.log("getTokenMsal tokenResponse", b), !(b != null && b.accessToken)) {
|
|
446
|
+
y(() => {
|
|
447
|
+
a.current = null, c.current = !0;
|
|
448
448
|
});
|
|
449
449
|
return;
|
|
450
450
|
}
|
|
451
|
-
|
|
452
|
-
token:
|
|
453
|
-
expiresOn:
|
|
451
|
+
a.current = null, c.current = !0, S({
|
|
452
|
+
token: b.accessToken,
|
|
453
|
+
expiresOn: b.expiresOn ?? new Date(Date.now())
|
|
454
454
|
});
|
|
455
455
|
});
|
|
456
456
|
});
|
|
457
|
-
return
|
|
458
|
-
}, [e,
|
|
459
|
-
} : (window.addEventListener("storage",
|
|
460
|
-
window.removeEventListener("storage",
|
|
461
|
-
}), [t.useMsal]),
|
|
462
|
-
var
|
|
463
|
-
return t.useMsal ? e !==
|
|
464
|
-
}, [
|
|
457
|
+
return a.current = d, d;
|
|
458
|
+
}, [e, i, o, r, t.msalSilentRedirectUri, t.useMsal]), g = ne(async () => t.useMsal ? h() : u(), [u, h, t.useMsal]), p = ne((d) => t.useMsal ? () => {
|
|
459
|
+
} : (window.addEventListener("storage", d), window.addEventListener("dev-auth-change", d), () => {
|
|
460
|
+
window.removeEventListener("storage", d), window.removeEventListener("dev-auth-change", d);
|
|
461
|
+
}), [t.useMsal]), f = st(p, () => localStorage.getItem("token") !== null ? "AUTH_OK" : "NO_AUTH"), _ = J(() => {
|
|
462
|
+
var d;
|
|
463
|
+
return t.useMsal ? e !== Ce.None ? "AUTH_IN_PROGRESS" : (o == null ? void 0 : o.getActiveAccount()) ?? ((d = o == null ? void 0 : o.getAllAccounts()) == null ? void 0 : d[0]) ?? null ? "AUTH_OK" : "NO_AUTH" : f;
|
|
464
|
+
}, [f, e, o, t.useMsal]), w = J(() => ({
|
|
465
465
|
useMsal: t.useMsal ?? !1,
|
|
466
|
-
msalInstance:
|
|
467
|
-
msalScopes:
|
|
468
|
-
msalExtraScopes:
|
|
469
|
-
getToken:
|
|
470
|
-
authState:
|
|
471
|
-
}), [t.useMsal,
|
|
472
|
-
return
|
|
473
|
-
if (t.useMsal &&
|
|
474
|
-
const
|
|
475
|
-
if (
|
|
476
|
-
const
|
|
477
|
-
|
|
478
|
-
const
|
|
479
|
-
|
|
466
|
+
msalInstance: o,
|
|
467
|
+
msalScopes: r,
|
|
468
|
+
msalExtraScopes: i,
|
|
469
|
+
getToken: g,
|
|
470
|
+
authState: _
|
|
471
|
+
}), [t.useMsal, o, r, i, g, _]);
|
|
472
|
+
return W(() => {
|
|
473
|
+
if (t.useMsal && o) {
|
|
474
|
+
const d = o.addEventCallback((S) => {
|
|
475
|
+
if (S.eventType === fe.LOGIN_SUCCESS || S.eventType === fe.ACQUIRE_TOKEN_SUCCESS && S.payload) {
|
|
476
|
+
const m = S.payload, y = m.account;
|
|
477
|
+
o.setActiveAccount(y);
|
|
478
|
+
const b = m.accessToken, C = m.expiresOn;
|
|
479
|
+
s("Authorization", b, {
|
|
480
480
|
path: "/",
|
|
481
481
|
secure: !0,
|
|
482
482
|
sameSite: "none",
|
|
483
|
-
domain:
|
|
484
|
-
expires:
|
|
483
|
+
domain: n,
|
|
484
|
+
expires: C ?? void 0
|
|
485
485
|
});
|
|
486
486
|
}
|
|
487
|
-
|
|
487
|
+
S.error && console.error("AuthProvider MSAL Error", S);
|
|
488
488
|
});
|
|
489
489
|
return () => {
|
|
490
|
-
|
|
490
|
+
d && o.removeEventCallback(d);
|
|
491
491
|
};
|
|
492
492
|
}
|
|
493
493
|
return () => {
|
|
494
494
|
};
|
|
495
|
-
}, [t.useMsal,
|
|
496
|
-
},
|
|
497
|
-
const e =
|
|
498
|
-
children:
|
|
499
|
-
relativeEndpoint:
|
|
500
|
-
} = t, [
|
|
501
|
-
let
|
|
495
|
+
}, [t.useMsal, o, s, n]), /* @__PURE__ */ v(ge.Provider, { value: w, children: t.useMsal ? /* @__PURE__ */ v(at, { instance: t.msalInstance, children: window.location.pathname === "/blank" ? /* @__PURE__ */ v(ye, {}) : t.children }) : window.location.pathname === "/blank" ? /* @__PURE__ */ v(ye, {}) : t.children });
|
|
496
|
+
}, rn = (t) => {
|
|
497
|
+
const e = N.c(18), {
|
|
498
|
+
children: n,
|
|
499
|
+
relativeEndpoint: s
|
|
500
|
+
} = t, [o, r, i] = ht("user-delegation", null);
|
|
501
|
+
let a;
|
|
502
502
|
e: {
|
|
503
|
-
if (!
|
|
504
|
-
|
|
503
|
+
if (!o) {
|
|
504
|
+
a = null;
|
|
505
505
|
break e;
|
|
506
506
|
}
|
|
507
|
-
const
|
|
508
|
-
if (!
|
|
509
|
-
start:
|
|
507
|
+
const C = o.from ? me(o.from) : pt(), k = o.to ? me(o.to) : ft();
|
|
508
|
+
if (!gt(new Date(Date.now()), {
|
|
509
|
+
start: C,
|
|
510
510
|
end: k
|
|
511
511
|
})) {
|
|
512
|
-
|
|
512
|
+
r(null), a = null;
|
|
513
513
|
break e;
|
|
514
514
|
}
|
|
515
|
-
|
|
515
|
+
a = o;
|
|
516
516
|
}
|
|
517
|
-
const
|
|
518
|
-
let
|
|
519
|
-
e[0] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
517
|
+
const c = a;
|
|
518
|
+
let u;
|
|
519
|
+
e[0] === Symbol.for("react.memo_cache_sentinel") ? (u = {
|
|
520
520
|
nullStateBeforeLoad: !1,
|
|
521
521
|
nullStateOnFail: !0
|
|
522
|
-
}, e[0] =
|
|
522
|
+
}, e[0] = u) : u = e[0];
|
|
523
523
|
const {
|
|
524
|
-
data:
|
|
525
|
-
setData:
|
|
526
|
-
reloadData:
|
|
527
|
-
} =
|
|
528
|
-
let
|
|
529
|
-
e[1] !==
|
|
530
|
-
const
|
|
531
|
-
|
|
524
|
+
data: h,
|
|
525
|
+
setData: g,
|
|
526
|
+
reloadData: p
|
|
527
|
+
} = ut(s, u), f = ae(null);
|
|
528
|
+
let _, w;
|
|
529
|
+
e[1] !== p ? (_ = () => {
|
|
530
|
+
const C = () => {
|
|
531
|
+
p(), f.current = window.setTimeout(C, ze() + 5e3);
|
|
532
532
|
};
|
|
533
|
-
return
|
|
534
|
-
|
|
533
|
+
return C(), () => {
|
|
534
|
+
f.current !== null && window.clearTimeout(f.current);
|
|
535
535
|
};
|
|
536
|
-
},
|
|
537
|
-
let
|
|
538
|
-
e[4] !==
|
|
539
|
-
const
|
|
540
|
-
|
|
536
|
+
}, w = [p], e[1] = p, e[2] = _, e[3] = w) : (_ = e[2], w = e[3]), W(_, w);
|
|
537
|
+
let d;
|
|
538
|
+
e[4] !== i ? (d = () => {
|
|
539
|
+
const C = () => {
|
|
540
|
+
i();
|
|
541
541
|
};
|
|
542
|
-
return window.addEventListener("focus",
|
|
543
|
-
window.removeEventListener("focus",
|
|
542
|
+
return window.addEventListener("focus", C), () => {
|
|
543
|
+
window.removeEventListener("focus", C);
|
|
544
544
|
};
|
|
545
|
-
}, e[4] =
|
|
546
|
-
let
|
|
547
|
-
e[6] !==
|
|
548
|
-
let
|
|
549
|
-
e[9] !==
|
|
550
|
-
delegation:
|
|
551
|
-
setDelegation:
|
|
552
|
-
availableDelegations:
|
|
553
|
-
setAvailableDelegations:
|
|
554
|
-
refreshAvailableDelegations:
|
|
555
|
-
}, e[9] =
|
|
556
|
-
const
|
|
557
|
-
let
|
|
558
|
-
return e[15] !==
|
|
559
|
-
},
|
|
560
|
-
const e =
|
|
561
|
-
defaultHelmet:
|
|
562
|
-
children:
|
|
563
|
-
helmetPrefix:
|
|
564
|
-
} = t,
|
|
565
|
-
let
|
|
566
|
-
e[0] !==
|
|
567
|
-
let
|
|
568
|
-
e[3] !==
|
|
569
|
-
const [
|
|
545
|
+
}, e[4] = i, e[5] = d) : d = e[5];
|
|
546
|
+
let S;
|
|
547
|
+
e[6] !== i || e[7] !== p ? (S = [i, p], e[6] = i, e[7] = p, e[8] = S) : S = e[8], W(d, S);
|
|
548
|
+
let m;
|
|
549
|
+
e[9] !== h || e[10] !== p || e[11] !== g || e[12] !== r || e[13] !== c ? (m = {
|
|
550
|
+
delegation: c,
|
|
551
|
+
setDelegation: r,
|
|
552
|
+
availableDelegations: h,
|
|
553
|
+
setAvailableDelegations: g,
|
|
554
|
+
refreshAvailableDelegations: p
|
|
555
|
+
}, e[9] = h, e[10] = p, e[11] = g, e[12] = r, e[13] = c, e[14] = m) : m = e[14];
|
|
556
|
+
const y = m;
|
|
557
|
+
let b;
|
|
558
|
+
return e[15] !== n || e[16] !== y ? (b = /* @__PURE__ */ v(De.Provider, { value: y, children: n }), e[15] = n, e[16] = y, e[17] = b) : b = e[17], b;
|
|
559
|
+
}, ve = (t, e) => t ? `${t} | ${e}` : e, an = (t) => {
|
|
560
|
+
const e = N.c(18), {
|
|
561
|
+
defaultHelmet: n,
|
|
562
|
+
children: s,
|
|
563
|
+
helmetPrefix: o
|
|
564
|
+
} = t, r = o ?? "";
|
|
565
|
+
let i;
|
|
566
|
+
e[0] !== n || e[1] !== r ? (i = ve(r, n), e[0] = n, e[1] = r, e[2] = i) : i = e[2];
|
|
567
|
+
let a;
|
|
568
|
+
e[3] !== i ? (a = [i], e[3] = i, e[4] = a) : a = e[4];
|
|
569
|
+
const [c, u] = L(a);
|
|
570
|
+
let h;
|
|
571
|
+
e[5] !== o ? (h = (b) => {
|
|
572
|
+
u((C) => [...C, ve(o ?? "", b)]);
|
|
573
|
+
}, e[5] = o, e[6] = h) : h = e[6];
|
|
574
|
+
const g = h;
|
|
575
|
+
let p;
|
|
576
|
+
e[7] === Symbol.for("react.memo_cache_sentinel") ? (p = () => {
|
|
577
|
+
u(vt);
|
|
578
|
+
}, e[7] = p) : p = e[7];
|
|
579
|
+
const f = p;
|
|
580
|
+
let _;
|
|
581
|
+
e[8] !== c ? (_ = c.at(-1) ?? "", e[8] = c, e[9] = _) : _ = e[9];
|
|
582
|
+
const w = _;
|
|
570
583
|
let d;
|
|
571
|
-
e[
|
|
572
|
-
|
|
573
|
-
|
|
584
|
+
e[10] !== g ? (d = {
|
|
585
|
+
addHelmet: g,
|
|
586
|
+
removeHelmet: f
|
|
587
|
+
}, e[10] = g, e[11] = d) : d = e[11];
|
|
574
588
|
const S = d;
|
|
575
589
|
let m;
|
|
576
|
-
e[
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
e[
|
|
582
|
-
const h = u;
|
|
583
|
-
let i;
|
|
584
|
-
e[10] !== S ? (i = {
|
|
585
|
-
addHelmet: S,
|
|
586
|
-
removeHelmet: a
|
|
587
|
-
}, e[10] = S, e[11] = i) : i = e[11];
|
|
588
|
-
const g = i;
|
|
589
|
-
let f;
|
|
590
|
-
e[12] !== h ? (f = /* @__PURE__ */ T("title", { children: h }), e[12] = h, e[13] = f) : f = e[13];
|
|
591
|
-
let w;
|
|
592
|
-
return e[14] !== r || e[15] !== g || e[16] !== f ? (w = /* @__PURE__ */ P(ye.Provider, { value: g, children: [
|
|
593
|
-
f,
|
|
594
|
-
r
|
|
595
|
-
] }), e[14] = r, e[15] = g, e[16] = f, e[17] = w) : w = e[17], w;
|
|
590
|
+
e[12] !== w ? (m = /* @__PURE__ */ v("title", { children: w }), e[12] = w, e[13] = m) : m = e[13];
|
|
591
|
+
let y;
|
|
592
|
+
return e[14] !== s || e[15] !== S || e[16] !== m ? (y = /* @__PURE__ */ I(Ge.Provider, { value: S, children: [
|
|
593
|
+
m,
|
|
594
|
+
s
|
|
595
|
+
] }), e[14] = s, e[15] = S, e[16] = m, e[17] = y) : y = e[17], y;
|
|
596
596
|
};
|
|
597
|
-
function
|
|
597
|
+
function vt(t) {
|
|
598
598
|
return t.length > 1 ? t.slice(0, -1) : t;
|
|
599
599
|
}
|
|
600
|
-
|
|
601
|
-
|
|
600
|
+
class Me {
|
|
601
|
+
constructor(e, n, s) {
|
|
602
|
+
this.statusCode = e, this.statusText = n, this.content = s;
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
class le {
|
|
606
|
+
get(e, n) {
|
|
607
|
+
return this.send({
|
|
608
|
+
...n,
|
|
609
|
+
method: "GET",
|
|
610
|
+
url: e
|
|
611
|
+
});
|
|
612
|
+
}
|
|
613
|
+
post(e, n) {
|
|
614
|
+
return this.send({
|
|
615
|
+
...n,
|
|
616
|
+
method: "POST",
|
|
617
|
+
url: e
|
|
618
|
+
});
|
|
619
|
+
}
|
|
620
|
+
delete(e, n) {
|
|
621
|
+
return this.send({
|
|
622
|
+
...n,
|
|
623
|
+
method: "DELETE",
|
|
624
|
+
url: e
|
|
625
|
+
});
|
|
626
|
+
}
|
|
627
|
+
/** Gets all cookies that apply to the specified URL.
|
|
628
|
+
*
|
|
629
|
+
* @param url The URL that the cookies are valid for.
|
|
630
|
+
* @returns {string} A string containing all the key-value cookie pairs for the specified URL.
|
|
631
|
+
*/
|
|
632
|
+
// @ts-ignore
|
|
633
|
+
getCookieString(e) {
|
|
634
|
+
return "";
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
class kt extends le {
|
|
638
|
+
constructor(e) {
|
|
639
|
+
if (super(), this._logger = e, typeof fetch > "u" || R.isNode) {
|
|
640
|
+
const n = typeof __webpack_require__ == "function" ? __non_webpack_require__ : require;
|
|
641
|
+
this._jar = new (n("tough-cookie")).CookieJar(), typeof fetch > "u" ? this._fetchType = n("node-fetch") : this._fetchType = fetch, this._fetchType = n("fetch-cookie")(this._fetchType, this._jar);
|
|
642
|
+
} else
|
|
643
|
+
this._fetchType = fetch.bind(Ve());
|
|
644
|
+
if (typeof AbortController > "u") {
|
|
645
|
+
const n = typeof __webpack_require__ == "function" ? __non_webpack_require__ : require;
|
|
646
|
+
this._abortControllerType = n("abort-controller");
|
|
647
|
+
} else
|
|
648
|
+
this._abortControllerType = AbortController;
|
|
649
|
+
}
|
|
650
|
+
/** @inheritDoc */
|
|
651
|
+
async send(e) {
|
|
652
|
+
if (e.abortSignal && e.abortSignal.aborted)
|
|
653
|
+
throw new U();
|
|
654
|
+
if (!e.method)
|
|
655
|
+
throw new Error("No method defined.");
|
|
656
|
+
if (!e.url)
|
|
657
|
+
throw new Error("No url defined.");
|
|
658
|
+
const n = new this._abortControllerType();
|
|
659
|
+
let s;
|
|
660
|
+
e.abortSignal && (e.abortSignal.onabort = () => {
|
|
661
|
+
n.abort(), s = new U();
|
|
662
|
+
});
|
|
663
|
+
let o = null;
|
|
664
|
+
if (e.timeout) {
|
|
665
|
+
const c = e.timeout;
|
|
666
|
+
o = setTimeout(() => {
|
|
667
|
+
n.abort(), this._logger.log(l.Warning, "Timeout from HTTP request."), s = new pe();
|
|
668
|
+
}, c);
|
|
669
|
+
}
|
|
670
|
+
e.content === "" && (e.content = void 0), e.content && (e.headers = e.headers || {}, Le(e.content) ? e.headers["Content-Type"] = "application/octet-stream" : e.headers["Content-Type"] = "text/plain;charset=UTF-8");
|
|
671
|
+
let r;
|
|
672
|
+
try {
|
|
673
|
+
r = await this._fetchType(e.url, {
|
|
674
|
+
body: e.content,
|
|
675
|
+
cache: "no-cache",
|
|
676
|
+
credentials: e.withCredentials === !0 ? "include" : "same-origin",
|
|
677
|
+
headers: {
|
|
678
|
+
"X-Requested-With": "XMLHttpRequest",
|
|
679
|
+
...e.headers
|
|
680
|
+
},
|
|
681
|
+
method: e.method,
|
|
682
|
+
mode: "cors",
|
|
683
|
+
redirect: "follow",
|
|
684
|
+
signal: n.signal
|
|
685
|
+
});
|
|
686
|
+
} catch (c) {
|
|
687
|
+
throw s || (this._logger.log(l.Warning, `Error from HTTP request. ${c}.`), c);
|
|
688
|
+
} finally {
|
|
689
|
+
o && clearTimeout(o), e.abortSignal && (e.abortSignal.onabort = null);
|
|
690
|
+
}
|
|
691
|
+
if (!r.ok) {
|
|
692
|
+
const c = await ke(r, "text");
|
|
693
|
+
throw new z(c || r.statusText, r.status);
|
|
694
|
+
}
|
|
695
|
+
const a = await ke(r, e.responseType);
|
|
696
|
+
return new Me(r.status, r.statusText, a);
|
|
697
|
+
}
|
|
698
|
+
getCookieString(e) {
|
|
699
|
+
let n = "";
|
|
700
|
+
return R.isNode && this._jar && this._jar.getCookies(e, (s, o) => n = o.join("; ")), n;
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
function ke(t, e) {
|
|
704
|
+
let n;
|
|
705
|
+
switch (e) {
|
|
706
|
+
case "arraybuffer":
|
|
707
|
+
n = t.arrayBuffer();
|
|
708
|
+
break;
|
|
709
|
+
case "text":
|
|
710
|
+
n = t.text();
|
|
711
|
+
break;
|
|
712
|
+
case "blob":
|
|
713
|
+
case "document":
|
|
714
|
+
case "json":
|
|
715
|
+
throw new Error(`${e} is not supported.`);
|
|
716
|
+
default:
|
|
717
|
+
n = t.text();
|
|
718
|
+
break;
|
|
719
|
+
}
|
|
720
|
+
return n;
|
|
721
|
+
}
|
|
722
|
+
class Tt extends le {
|
|
723
|
+
constructor(e) {
|
|
724
|
+
super(), this._logger = e;
|
|
725
|
+
}
|
|
726
|
+
/** @inheritDoc */
|
|
727
|
+
send(e) {
|
|
728
|
+
return e.abortSignal && e.abortSignal.aborted ? Promise.reject(new U()) : e.method ? e.url ? new Promise((n, s) => {
|
|
729
|
+
const o = new XMLHttpRequest();
|
|
730
|
+
o.open(e.method, e.url, !0), o.withCredentials = e.withCredentials === void 0 ? !0 : e.withCredentials, o.setRequestHeader("X-Requested-With", "XMLHttpRequest"), e.content === "" && (e.content = void 0), e.content && (Le(e.content) ? o.setRequestHeader("Content-Type", "application/octet-stream") : o.setRequestHeader("Content-Type", "text/plain;charset=UTF-8"));
|
|
731
|
+
const r = e.headers;
|
|
732
|
+
r && Object.keys(r).forEach((i) => {
|
|
733
|
+
o.setRequestHeader(i, r[i]);
|
|
734
|
+
}), e.responseType && (o.responseType = e.responseType), e.abortSignal && (e.abortSignal.onabort = () => {
|
|
735
|
+
o.abort(), s(new U());
|
|
736
|
+
}), e.timeout && (o.timeout = e.timeout), o.onload = () => {
|
|
737
|
+
e.abortSignal && (e.abortSignal.onabort = null), o.status >= 200 && o.status < 300 ? n(new Me(o.status, o.statusText, o.response || o.responseText)) : s(new z(o.response || o.responseText || o.statusText, o.status));
|
|
738
|
+
}, o.onerror = () => {
|
|
739
|
+
this._logger.log(l.Warning, `Error from HTTP request. ${o.status}: ${o.statusText}.`), s(new z(o.statusText, o.status));
|
|
740
|
+
}, o.ontimeout = () => {
|
|
741
|
+
this._logger.log(l.Warning, "Timeout from HTTP request."), s(new pe());
|
|
742
|
+
}, o.send(e.content);
|
|
743
|
+
}) : Promise.reject(new Error("No url defined.")) : Promise.reject(new Error("No method defined."));
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
class Et extends le {
|
|
747
|
+
/** Creates a new instance of the {@link @microsoft/signalr.DefaultHttpClient}, using the provided {@link @microsoft/signalr.ILogger} to log messages. */
|
|
748
|
+
constructor(e) {
|
|
749
|
+
if (super(), typeof fetch < "u" || R.isNode)
|
|
750
|
+
this._httpClient = new kt(e);
|
|
751
|
+
else if (typeof XMLHttpRequest < "u")
|
|
752
|
+
this._httpClient = new Tt(e);
|
|
753
|
+
else
|
|
754
|
+
throw new Error("No usable HttpClient found.");
|
|
755
|
+
}
|
|
756
|
+
/** @inheritDoc */
|
|
757
|
+
send(e) {
|
|
758
|
+
return e.abortSignal && e.abortSignal.aborted ? Promise.reject(new U()) : e.method ? e.url ? this._httpClient.send(e) : Promise.reject(new Error("No url defined.")) : Promise.reject(new Error("No method defined."));
|
|
759
|
+
}
|
|
760
|
+
getCookieString(e) {
|
|
761
|
+
return this._httpClient.getCookieString(e);
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
const Pt = [0, 2e3, 1e4, 3e4, null];
|
|
765
|
+
class Te {
|
|
766
|
+
constructor(e) {
|
|
767
|
+
this._retryDelays = e !== void 0 ? [...e, null] : Pt;
|
|
768
|
+
}
|
|
769
|
+
nextRetryDelayInMilliseconds(e) {
|
|
770
|
+
return this._retryDelays[e.previousRetryCount];
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
class G {
|
|
774
|
+
}
|
|
775
|
+
G.Authorization = "Authorization";
|
|
776
|
+
G.Cookie = "Cookie";
|
|
777
|
+
class xt extends le {
|
|
778
|
+
constructor(e, n) {
|
|
779
|
+
super(), this._innerClient = e, this._accessTokenFactory = n;
|
|
780
|
+
}
|
|
781
|
+
async send(e) {
|
|
782
|
+
let n = !0;
|
|
783
|
+
this._accessTokenFactory && (!this._accessToken || e.url && e.url.indexOf("/negotiate?") > 0) && (n = !1, this._accessToken = await this._accessTokenFactory()), this._setAuthorizationHeader(e);
|
|
784
|
+
const s = await this._innerClient.send(e);
|
|
785
|
+
return n && s.statusCode === 401 && this._accessTokenFactory ? (this._accessToken = await this._accessTokenFactory(), this._setAuthorizationHeader(e), await this._innerClient.send(e)) : s;
|
|
786
|
+
}
|
|
787
|
+
_setAuthorizationHeader(e) {
|
|
788
|
+
e.headers || (e.headers = {}), this._accessToken ? e.headers[G.Authorization] = `Bearer ${this._accessToken}` : this._accessTokenFactory && e.headers[G.Authorization] && delete e.headers[G.Authorization];
|
|
789
|
+
}
|
|
790
|
+
getCookieString(e) {
|
|
791
|
+
return this._innerClient.getCookieString(e);
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
var T;
|
|
795
|
+
(function(t) {
|
|
796
|
+
t[t.None = 0] = "None", t[t.WebSockets = 1] = "WebSockets", t[t.ServerSentEvents = 2] = "ServerSentEvents", t[t.LongPolling = 4] = "LongPolling";
|
|
797
|
+
})(T || (T = {}));
|
|
798
|
+
var D;
|
|
799
|
+
(function(t) {
|
|
800
|
+
t[t.Text = 1] = "Text", t[t.Binary = 2] = "Binary";
|
|
801
|
+
})(D || (D = {}));
|
|
802
|
+
let At = class {
|
|
803
|
+
constructor() {
|
|
804
|
+
this._isAborted = !1, this.onabort = null;
|
|
805
|
+
}
|
|
806
|
+
abort() {
|
|
807
|
+
this._isAborted || (this._isAborted = !0, this.onabort && this.onabort());
|
|
808
|
+
}
|
|
809
|
+
get signal() {
|
|
810
|
+
return this;
|
|
811
|
+
}
|
|
812
|
+
get aborted() {
|
|
813
|
+
return this._isAborted;
|
|
814
|
+
}
|
|
815
|
+
};
|
|
816
|
+
class Ee {
|
|
817
|
+
// This is an internal type, not exported from 'index' so this is really just internal.
|
|
818
|
+
get pollAborted() {
|
|
819
|
+
return this._pollAbort.aborted;
|
|
820
|
+
}
|
|
821
|
+
constructor(e, n, s) {
|
|
822
|
+
this._httpClient = e, this._logger = n, this._pollAbort = new At(), this._options = s, this._running = !1, this.onreceive = null, this.onclose = null;
|
|
823
|
+
}
|
|
824
|
+
async connect(e, n) {
|
|
825
|
+
if (E.isRequired(e, "url"), E.isRequired(n, "transferFormat"), E.isIn(n, D, "transferFormat"), this._url = e, this._logger.log(l.Trace, "(LongPolling transport) Connecting."), n === D.Binary && typeof XMLHttpRequest < "u" && typeof new XMLHttpRequest().responseType != "string")
|
|
826
|
+
throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");
|
|
827
|
+
const [s, o] = Q(), r = { [s]: o, ...this._options.headers }, i = {
|
|
828
|
+
abortSignal: this._pollAbort.signal,
|
|
829
|
+
headers: r,
|
|
830
|
+
timeout: 1e5,
|
|
831
|
+
withCredentials: this._options.withCredentials
|
|
832
|
+
};
|
|
833
|
+
n === D.Binary && (i.responseType = "arraybuffer");
|
|
834
|
+
const a = `${e}&_=${Date.now()}`;
|
|
835
|
+
this._logger.log(l.Trace, `(LongPolling transport) polling: ${a}.`);
|
|
836
|
+
const c = await this._httpClient.get(a, i);
|
|
837
|
+
c.statusCode !== 200 ? (this._logger.log(l.Error, `(LongPolling transport) Unexpected response code: ${c.statusCode}.`), this._closeError = new z(c.statusText || "", c.statusCode), this._running = !1) : this._running = !0, this._receiving = this._poll(this._url, i);
|
|
838
|
+
}
|
|
839
|
+
async _poll(e, n) {
|
|
840
|
+
try {
|
|
841
|
+
for (; this._running; )
|
|
842
|
+
try {
|
|
843
|
+
const s = `${e}&_=${Date.now()}`;
|
|
844
|
+
this._logger.log(l.Trace, `(LongPolling transport) polling: ${s}.`);
|
|
845
|
+
const o = await this._httpClient.get(s, n);
|
|
846
|
+
o.statusCode === 204 ? (this._logger.log(l.Information, "(LongPolling transport) Poll terminated by server."), this._running = !1) : o.statusCode !== 200 ? (this._logger.log(l.Error, `(LongPolling transport) Unexpected response code: ${o.statusCode}.`), this._closeError = new z(o.statusText || "", o.statusCode), this._running = !1) : o.content ? (this._logger.log(l.Trace, `(LongPolling transport) data received. ${ie(o.content, this._options.logMessageContent)}.`), this.onreceive && this.onreceive(o.content)) : this._logger.log(l.Trace, "(LongPolling transport) Poll timed out, reissuing.");
|
|
847
|
+
} catch (s) {
|
|
848
|
+
this._running ? s instanceof pe ? this._logger.log(l.Trace, "(LongPolling transport) Poll timed out, reissuing.") : (this._closeError = s, this._running = !1) : this._logger.log(l.Trace, `(LongPolling transport) Poll errored after shutdown: ${s.message}`);
|
|
849
|
+
}
|
|
850
|
+
} finally {
|
|
851
|
+
this._logger.log(l.Trace, "(LongPolling transport) Polling complete."), this.pollAborted || this._raiseOnClose();
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
async send(e) {
|
|
855
|
+
return this._running ? Re(this._logger, "LongPolling", this._httpClient, this._url, e, this._options) : Promise.reject(new Error("Cannot send until the transport is connected"));
|
|
856
|
+
}
|
|
857
|
+
async stop() {
|
|
858
|
+
this._logger.log(l.Trace, "(LongPolling transport) Stopping polling."), this._running = !1, this._pollAbort.abort();
|
|
859
|
+
try {
|
|
860
|
+
await this._receiving, this._logger.log(l.Trace, `(LongPolling transport) sending DELETE request to ${this._url}.`);
|
|
861
|
+
const e = {}, [n, s] = Q();
|
|
862
|
+
e[n] = s;
|
|
863
|
+
const o = {
|
|
864
|
+
headers: { ...e, ...this._options.headers },
|
|
865
|
+
timeout: this._options.timeout,
|
|
866
|
+
withCredentials: this._options.withCredentials
|
|
867
|
+
};
|
|
868
|
+
let r;
|
|
869
|
+
try {
|
|
870
|
+
await this._httpClient.delete(this._url, o);
|
|
871
|
+
} catch (i) {
|
|
872
|
+
r = i;
|
|
873
|
+
}
|
|
874
|
+
r ? r instanceof z && (r.statusCode === 404 ? this._logger.log(l.Trace, "(LongPolling transport) A 404 response was returned from sending a DELETE request.") : this._logger.log(l.Trace, `(LongPolling transport) Error sending a DELETE request: ${r}`)) : this._logger.log(l.Trace, "(LongPolling transport) DELETE request accepted.");
|
|
875
|
+
} finally {
|
|
876
|
+
this._logger.log(l.Trace, "(LongPolling transport) Stop finished."), this._raiseOnClose();
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
_raiseOnClose() {
|
|
880
|
+
if (this.onclose) {
|
|
881
|
+
let e = "(LongPolling transport) Firing onclose event.";
|
|
882
|
+
this._closeError && (e += " Error: " + this._closeError), this._logger.log(l.Trace, e), this.onclose(this._closeError);
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
class Dt {
|
|
887
|
+
constructor(e, n, s, o) {
|
|
888
|
+
this._httpClient = e, this._accessToken = n, this._logger = s, this._options = o, this.onreceive = null, this.onclose = null;
|
|
889
|
+
}
|
|
890
|
+
async connect(e, n) {
|
|
891
|
+
return E.isRequired(e, "url"), E.isRequired(n, "transferFormat"), E.isIn(n, D, "transferFormat"), this._logger.log(l.Trace, "(SSE transport) Connecting."), this._url = e, this._accessToken && (e += (e.indexOf("?") < 0 ? "?" : "&") + `access_token=${encodeURIComponent(this._accessToken)}`), new Promise((s, o) => {
|
|
892
|
+
let r = !1;
|
|
893
|
+
if (n !== D.Text) {
|
|
894
|
+
o(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"));
|
|
895
|
+
return;
|
|
896
|
+
}
|
|
897
|
+
let i;
|
|
898
|
+
if (R.isBrowser || R.isWebWorker)
|
|
899
|
+
i = new this._options.EventSource(e, { withCredentials: this._options.withCredentials });
|
|
900
|
+
else {
|
|
901
|
+
const a = this._httpClient.getCookieString(e), c = {};
|
|
902
|
+
c.Cookie = a;
|
|
903
|
+
const [u, h] = Q();
|
|
904
|
+
c[u] = h, i = new this._options.EventSource(e, { withCredentials: this._options.withCredentials, headers: { ...c, ...this._options.headers } });
|
|
905
|
+
}
|
|
906
|
+
try {
|
|
907
|
+
i.onmessage = (a) => {
|
|
908
|
+
if (this.onreceive)
|
|
909
|
+
try {
|
|
910
|
+
this._logger.log(l.Trace, `(SSE transport) data received. ${ie(a.data, this._options.logMessageContent)}.`), this.onreceive(a.data);
|
|
911
|
+
} catch (c) {
|
|
912
|
+
this._close(c);
|
|
913
|
+
return;
|
|
914
|
+
}
|
|
915
|
+
}, i.onerror = (a) => {
|
|
916
|
+
r ? this._close() : o(new Error("EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled."));
|
|
917
|
+
}, i.onopen = () => {
|
|
918
|
+
this._logger.log(l.Information, `SSE connected to ${this._url}`), this._eventSource = i, r = !0, s();
|
|
919
|
+
};
|
|
920
|
+
} catch (a) {
|
|
921
|
+
o(a);
|
|
922
|
+
return;
|
|
923
|
+
}
|
|
924
|
+
});
|
|
925
|
+
}
|
|
926
|
+
async send(e) {
|
|
927
|
+
return this._eventSource ? Re(this._logger, "SSE", this._httpClient, this._url, e, this._options) : Promise.reject(new Error("Cannot send until the transport is connected"));
|
|
928
|
+
}
|
|
929
|
+
stop() {
|
|
930
|
+
return this._close(), Promise.resolve();
|
|
931
|
+
}
|
|
932
|
+
_close(e) {
|
|
933
|
+
this._eventSource && (this._eventSource.close(), this._eventSource = void 0, this.onclose && this.onclose(e));
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
class Lt {
|
|
937
|
+
constructor(e, n, s, o, r, i) {
|
|
938
|
+
this._logger = s, this._accessTokenFactory = n, this._logMessageContent = o, this._webSocketConstructor = r, this._httpClient = e, this.onreceive = null, this.onclose = null, this._headers = i;
|
|
939
|
+
}
|
|
940
|
+
async connect(e, n) {
|
|
941
|
+
E.isRequired(e, "url"), E.isRequired(n, "transferFormat"), E.isIn(n, D, "transferFormat"), this._logger.log(l.Trace, "(WebSockets transport) Connecting.");
|
|
942
|
+
let s;
|
|
943
|
+
return this._accessTokenFactory && (s = await this._accessTokenFactory()), new Promise((o, r) => {
|
|
944
|
+
e = e.replace(/^http/, "ws");
|
|
945
|
+
let i;
|
|
946
|
+
const a = this._httpClient.getCookieString(e);
|
|
947
|
+
let c = !1;
|
|
948
|
+
if (R.isNode || R.isReactNative) {
|
|
949
|
+
const u = {}, [h, g] = Q();
|
|
950
|
+
u[h] = g, s && (u[G.Authorization] = `Bearer ${s}`), a && (u[G.Cookie] = a), i = new this._webSocketConstructor(e, void 0, {
|
|
951
|
+
headers: { ...u, ...this._headers }
|
|
952
|
+
});
|
|
953
|
+
} else
|
|
954
|
+
s && (e += (e.indexOf("?") < 0 ? "?" : "&") + `access_token=${encodeURIComponent(s)}`);
|
|
955
|
+
i || (i = new this._webSocketConstructor(e)), n === D.Binary && (i.binaryType = "arraybuffer"), i.onopen = (u) => {
|
|
956
|
+
this._logger.log(l.Information, `WebSocket connected to ${e}.`), this._webSocket = i, c = !0, o();
|
|
957
|
+
}, i.onerror = (u) => {
|
|
958
|
+
let h = null;
|
|
959
|
+
typeof ErrorEvent < "u" && u instanceof ErrorEvent ? h = u.error : h = "There was an error with the transport", this._logger.log(l.Information, `(WebSockets transport) ${h}.`);
|
|
960
|
+
}, i.onmessage = (u) => {
|
|
961
|
+
if (this._logger.log(l.Trace, `(WebSockets transport) data received. ${ie(u.data, this._logMessageContent)}.`), this.onreceive)
|
|
962
|
+
try {
|
|
963
|
+
this.onreceive(u.data);
|
|
964
|
+
} catch (h) {
|
|
965
|
+
this._close(h);
|
|
966
|
+
return;
|
|
967
|
+
}
|
|
968
|
+
}, i.onclose = (u) => {
|
|
969
|
+
if (c)
|
|
970
|
+
this._close(u);
|
|
971
|
+
else {
|
|
972
|
+
let h = null;
|
|
973
|
+
typeof ErrorEvent < "u" && u instanceof ErrorEvent ? h = u.error : h = "WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.", r(new Error(h));
|
|
974
|
+
}
|
|
975
|
+
};
|
|
976
|
+
});
|
|
977
|
+
}
|
|
978
|
+
send(e) {
|
|
979
|
+
return this._webSocket && this._webSocket.readyState === this._webSocketConstructor.OPEN ? (this._logger.log(l.Trace, `(WebSockets transport) sending data. ${ie(e, this._logMessageContent)}.`), this._webSocket.send(e), Promise.resolve()) : Promise.reject("WebSocket is not in the OPEN state");
|
|
980
|
+
}
|
|
981
|
+
stop() {
|
|
982
|
+
return this._webSocket && this._close(void 0), Promise.resolve();
|
|
983
|
+
}
|
|
984
|
+
_close(e) {
|
|
985
|
+
this._webSocket && (this._webSocket.onclose = () => {
|
|
986
|
+
}, this._webSocket.onmessage = () => {
|
|
987
|
+
}, this._webSocket.onerror = () => {
|
|
988
|
+
}, this._webSocket.close(), this._webSocket = void 0), this._logger.log(l.Trace, "(WebSockets transport) socket closed."), this.onclose && (this._isCloseEvent(e) && (e.wasClean === !1 || e.code !== 1e3) ? this.onclose(new Error(`WebSocket closed with status code: ${e.code} (${e.reason || "no reason given"}).`)) : e instanceof Error ? this.onclose(e) : this.onclose());
|
|
989
|
+
}
|
|
990
|
+
_isCloseEvent(e) {
|
|
991
|
+
return e && typeof e.wasClean == "boolean" && typeof e.code == "number";
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
const Pe = 100;
|
|
995
|
+
class Rt {
|
|
996
|
+
constructor(e, n = {}) {
|
|
997
|
+
if (this._stopPromiseResolver = () => {
|
|
998
|
+
}, this.features = {}, this._negotiateVersion = 1, E.isRequired(e, "url"), this._logger = Xe(n.logger), this.baseUrl = this._resolveUrl(e), n = n || {}, n.logMessageContent = n.logMessageContent === void 0 ? !1 : n.logMessageContent, typeof n.withCredentials == "boolean" || n.withCredentials === void 0)
|
|
999
|
+
n.withCredentials = n.withCredentials === void 0 ? !0 : n.withCredentials;
|
|
1000
|
+
else
|
|
1001
|
+
throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");
|
|
1002
|
+
n.timeout = n.timeout === void 0 ? 100 * 1e3 : n.timeout;
|
|
1003
|
+
let s = null, o = null;
|
|
1004
|
+
if (R.isNode && typeof require < "u") {
|
|
1005
|
+
const r = typeof __webpack_require__ == "function" ? __non_webpack_require__ : require;
|
|
1006
|
+
s = r("ws"), o = r("eventsource");
|
|
1007
|
+
}
|
|
1008
|
+
!R.isNode && typeof WebSocket < "u" && !n.WebSocket ? n.WebSocket = WebSocket : R.isNode && !n.WebSocket && s && (n.WebSocket = s), !R.isNode && typeof EventSource < "u" && !n.EventSource ? n.EventSource = EventSource : R.isNode && !n.EventSource && typeof o < "u" && (n.EventSource = o), this._httpClient = new xt(n.httpClient || new Et(this._logger), n.accessTokenFactory), this._connectionState = "Disconnected", this._connectionStarted = !1, this._options = n, this.onreceive = null, this.onclose = null;
|
|
1009
|
+
}
|
|
1010
|
+
async start(e) {
|
|
1011
|
+
if (e = e || D.Binary, E.isIn(e, D, "transferFormat"), this._logger.log(l.Debug, `Starting connection with transfer format '${D[e]}'.`), this._connectionState !== "Disconnected")
|
|
1012
|
+
return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));
|
|
1013
|
+
if (this._connectionState = "Connecting", this._startInternalPromise = this._startInternal(e), await this._startInternalPromise, this._connectionState === "Disconnecting") {
|
|
1014
|
+
const n = "Failed to start the HttpConnection before stop() was called.";
|
|
1015
|
+
return this._logger.log(l.Error, n), await this._stopPromise, Promise.reject(new U(n));
|
|
1016
|
+
} else if (this._connectionState !== "Connected") {
|
|
1017
|
+
const n = "HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";
|
|
1018
|
+
return this._logger.log(l.Error, n), Promise.reject(new U(n));
|
|
1019
|
+
}
|
|
1020
|
+
this._connectionStarted = !0;
|
|
1021
|
+
}
|
|
1022
|
+
send(e) {
|
|
1023
|
+
return this._connectionState !== "Connected" ? Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")) : (this._sendQueue || (this._sendQueue = new _e(this.transport)), this._sendQueue.send(e));
|
|
1024
|
+
}
|
|
1025
|
+
async stop(e) {
|
|
1026
|
+
if (this._connectionState === "Disconnected")
|
|
1027
|
+
return this._logger.log(l.Debug, `Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnected state.`), Promise.resolve();
|
|
1028
|
+
if (this._connectionState === "Disconnecting")
|
|
1029
|
+
return this._logger.log(l.Debug, `Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`), this._stopPromise;
|
|
1030
|
+
this._connectionState = "Disconnecting", this._stopPromise = new Promise((n) => {
|
|
1031
|
+
this._stopPromiseResolver = n;
|
|
1032
|
+
}), await this._stopInternal(e), await this._stopPromise;
|
|
1033
|
+
}
|
|
1034
|
+
async _stopInternal(e) {
|
|
1035
|
+
this._stopError = e;
|
|
1036
|
+
try {
|
|
1037
|
+
await this._startInternalPromise;
|
|
1038
|
+
} catch {
|
|
1039
|
+
}
|
|
1040
|
+
if (this.transport) {
|
|
1041
|
+
try {
|
|
1042
|
+
await this.transport.stop();
|
|
1043
|
+
} catch (n) {
|
|
1044
|
+
this._logger.log(l.Error, `HttpConnection.transport.stop() threw error '${n}'.`), this._stopConnection();
|
|
1045
|
+
}
|
|
1046
|
+
this.transport = void 0;
|
|
1047
|
+
} else
|
|
1048
|
+
this._logger.log(l.Debug, "HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.");
|
|
1049
|
+
}
|
|
1050
|
+
async _startInternal(e) {
|
|
1051
|
+
let n = this.baseUrl;
|
|
1052
|
+
this._accessTokenFactory = this._options.accessTokenFactory, this._httpClient._accessTokenFactory = this._accessTokenFactory;
|
|
1053
|
+
try {
|
|
1054
|
+
if (this._options.skipNegotiation)
|
|
1055
|
+
if (this._options.transport === T.WebSockets)
|
|
1056
|
+
this.transport = this._constructTransport(T.WebSockets), await this._startTransport(n, e);
|
|
1057
|
+
else
|
|
1058
|
+
throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");
|
|
1059
|
+
else {
|
|
1060
|
+
let s = null, o = 0;
|
|
1061
|
+
do {
|
|
1062
|
+
if (s = await this._getNegotiationResponse(n), this._connectionState === "Disconnecting" || this._connectionState === "Disconnected")
|
|
1063
|
+
throw new U("The connection was stopped during negotiation.");
|
|
1064
|
+
if (s.error)
|
|
1065
|
+
throw new Error(s.error);
|
|
1066
|
+
if (s.ProtocolVersion)
|
|
1067
|
+
throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");
|
|
1068
|
+
if (s.url && (n = s.url), s.accessToken) {
|
|
1069
|
+
const r = s.accessToken;
|
|
1070
|
+
this._accessTokenFactory = () => r, this._httpClient._accessToken = r, this._httpClient._accessTokenFactory = void 0;
|
|
1071
|
+
}
|
|
1072
|
+
o++;
|
|
1073
|
+
} while (s.url && o < Pe);
|
|
1074
|
+
if (o === Pe && s.url)
|
|
1075
|
+
throw new Error("Negotiate redirection limit exceeded.");
|
|
1076
|
+
await this._createTransport(n, this._options.transport, s, e);
|
|
1077
|
+
}
|
|
1078
|
+
this.transport instanceof Ee && (this.features.inherentKeepAlive = !0), this._connectionState === "Connecting" && (this._logger.log(l.Debug, "The HttpConnection connected successfully."), this._connectionState = "Connected");
|
|
1079
|
+
} catch (s) {
|
|
1080
|
+
return this._logger.log(l.Error, "Failed to start the connection: " + s), this._connectionState = "Disconnected", this.transport = void 0, this._stopPromiseResolver(), Promise.reject(s);
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
async _getNegotiationResponse(e) {
|
|
1084
|
+
const n = {}, [s, o] = Q();
|
|
1085
|
+
n[s] = o;
|
|
1086
|
+
const r = this._resolveNegotiateUrl(e);
|
|
1087
|
+
this._logger.log(l.Debug, `Sending negotiation request: ${r}.`);
|
|
1088
|
+
try {
|
|
1089
|
+
const i = await this._httpClient.post(r, {
|
|
1090
|
+
content: "",
|
|
1091
|
+
headers: { ...n, ...this._options.headers },
|
|
1092
|
+
timeout: this._options.timeout,
|
|
1093
|
+
withCredentials: this._options.withCredentials
|
|
1094
|
+
});
|
|
1095
|
+
if (i.statusCode !== 200)
|
|
1096
|
+
return Promise.reject(new Error(`Unexpected status code returned from negotiate '${i.statusCode}'`));
|
|
1097
|
+
const a = JSON.parse(i.content);
|
|
1098
|
+
return (!a.negotiateVersion || a.negotiateVersion < 1) && (a.connectionToken = a.connectionId), a.useStatefulReconnect && this._options._useStatefulReconnect !== !0 ? Promise.reject(new we("Client didn't negotiate Stateful Reconnect but the server did.")) : a;
|
|
1099
|
+
} catch (i) {
|
|
1100
|
+
let a = "Failed to complete negotiation with the server: " + i;
|
|
1101
|
+
return i instanceof z && i.statusCode === 404 && (a = a + " Either this is not a SignalR endpoint or there is a proxy blocking the connection."), this._logger.log(l.Error, a), Promise.reject(new we(a));
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
_createConnectUrl(e, n) {
|
|
1105
|
+
return n ? e + (e.indexOf("?") === -1 ? "?" : "&") + `id=${n}` : e;
|
|
1106
|
+
}
|
|
1107
|
+
async _createTransport(e, n, s, o) {
|
|
1108
|
+
let r = this._createConnectUrl(e, s.connectionToken);
|
|
1109
|
+
if (this._isITransport(n)) {
|
|
1110
|
+
this._logger.log(l.Debug, "Connection was provided an instance of ITransport, using that directly."), this.transport = n, await this._startTransport(r, o), this.connectionId = s.connectionId;
|
|
1111
|
+
return;
|
|
1112
|
+
}
|
|
1113
|
+
const i = [], a = s.availableTransports || [];
|
|
1114
|
+
let c = s;
|
|
1115
|
+
for (const u of a) {
|
|
1116
|
+
const h = this._resolveTransportOrError(u, n, o, (c == null ? void 0 : c.useStatefulReconnect) === !0);
|
|
1117
|
+
if (h instanceof Error)
|
|
1118
|
+
i.push(`${u.transport} failed:`), i.push(h);
|
|
1119
|
+
else if (this._isITransport(h)) {
|
|
1120
|
+
if (this.transport = h, !c) {
|
|
1121
|
+
try {
|
|
1122
|
+
c = await this._getNegotiationResponse(e);
|
|
1123
|
+
} catch (g) {
|
|
1124
|
+
return Promise.reject(g);
|
|
1125
|
+
}
|
|
1126
|
+
r = this._createConnectUrl(e, c.connectionToken);
|
|
1127
|
+
}
|
|
1128
|
+
try {
|
|
1129
|
+
await this._startTransport(r, o), this.connectionId = c.connectionId;
|
|
1130
|
+
return;
|
|
1131
|
+
} catch (g) {
|
|
1132
|
+
if (this._logger.log(l.Error, `Failed to start the transport '${u.transport}': ${g}`), c = void 0, i.push(new Ke(`${u.transport} failed: ${g}`, T[u.transport])), this._connectionState !== "Connecting") {
|
|
1133
|
+
const p = "Failed to select transport before stop() was called.";
|
|
1134
|
+
return this._logger.log(l.Debug, p), Promise.reject(new U(p));
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
return i.length > 0 ? Promise.reject(new Je(`Unable to connect to the server with any of the available transports. ${i.join(" ")}`, i)) : Promise.reject(new Error("None of the transports supported by the client are supported by the server."));
|
|
1140
|
+
}
|
|
1141
|
+
_constructTransport(e) {
|
|
1142
|
+
switch (e) {
|
|
1143
|
+
case T.WebSockets:
|
|
1144
|
+
if (!this._options.WebSocket)
|
|
1145
|
+
throw new Error("'WebSocket' is not supported in your environment.");
|
|
1146
|
+
return new Lt(this._httpClient, this._accessTokenFactory, this._logger, this._options.logMessageContent, this._options.WebSocket, this._options.headers || {});
|
|
1147
|
+
case T.ServerSentEvents:
|
|
1148
|
+
if (!this._options.EventSource)
|
|
1149
|
+
throw new Error("'EventSource' is not supported in your environment.");
|
|
1150
|
+
return new Dt(this._httpClient, this._httpClient._accessToken, this._logger, this._options);
|
|
1151
|
+
case T.LongPolling:
|
|
1152
|
+
return new Ee(this._httpClient, this._logger, this._options);
|
|
1153
|
+
default:
|
|
1154
|
+
throw new Error(`Unknown transport: ${e}.`);
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
_startTransport(e, n) {
|
|
1158
|
+
return this.transport.onreceive = this.onreceive, this.features.reconnect ? this.transport.onclose = async (s) => {
|
|
1159
|
+
let o = !1;
|
|
1160
|
+
if (this.features.reconnect)
|
|
1161
|
+
try {
|
|
1162
|
+
this.features.disconnected(), await this.transport.connect(e, n), await this.features.resend();
|
|
1163
|
+
} catch {
|
|
1164
|
+
o = !0;
|
|
1165
|
+
}
|
|
1166
|
+
else {
|
|
1167
|
+
this._stopConnection(s);
|
|
1168
|
+
return;
|
|
1169
|
+
}
|
|
1170
|
+
o && this._stopConnection(s);
|
|
1171
|
+
} : this.transport.onclose = (s) => this._stopConnection(s), this.transport.connect(e, n);
|
|
1172
|
+
}
|
|
1173
|
+
_resolveTransportOrError(e, n, s, o) {
|
|
1174
|
+
const r = T[e.transport];
|
|
1175
|
+
if (r == null)
|
|
1176
|
+
return this._logger.log(l.Debug, `Skipping transport '${e.transport}' because it is not supported by this client.`), new Error(`Skipping transport '${e.transport}' because it is not supported by this client.`);
|
|
1177
|
+
if (It(n, r))
|
|
1178
|
+
if (e.transferFormats.map((a) => D[a]).indexOf(s) >= 0) {
|
|
1179
|
+
if (r === T.WebSockets && !this._options.WebSocket || r === T.ServerSentEvents && !this._options.EventSource)
|
|
1180
|
+
return this._logger.log(l.Debug, `Skipping transport '${T[r]}' because it is not supported in your environment.'`), new Qe(`'${T[r]}' is not supported in your environment.`, r);
|
|
1181
|
+
this._logger.log(l.Debug, `Selecting transport '${T[r]}'.`);
|
|
1182
|
+
try {
|
|
1183
|
+
return this.features.reconnect = r === T.WebSockets ? o : void 0, this._constructTransport(r);
|
|
1184
|
+
} catch (a) {
|
|
1185
|
+
return a;
|
|
1186
|
+
}
|
|
1187
|
+
} else
|
|
1188
|
+
return this._logger.log(l.Debug, `Skipping transport '${T[r]}' because it does not support the requested transfer format '${D[s]}'.`), new Error(`'${T[r]}' does not support ${D[s]}.`);
|
|
1189
|
+
else
|
|
1190
|
+
return this._logger.log(l.Debug, `Skipping transport '${T[r]}' because it was disabled by the client.`), new qe(`'${T[r]}' is disabled by the client.`, r);
|
|
1191
|
+
}
|
|
1192
|
+
_isITransport(e) {
|
|
1193
|
+
return e && typeof e == "object" && "connect" in e;
|
|
1194
|
+
}
|
|
1195
|
+
_stopConnection(e) {
|
|
1196
|
+
if (this._logger.log(l.Debug, `HttpConnection.stopConnection(${e}) called while in state ${this._connectionState}.`), this.transport = void 0, e = this._stopError || e, this._stopError = void 0, this._connectionState === "Disconnected") {
|
|
1197
|
+
this._logger.log(l.Debug, `Call to HttpConnection.stopConnection(${e}) was ignored because the connection is already in the disconnected state.`);
|
|
1198
|
+
return;
|
|
1199
|
+
}
|
|
1200
|
+
if (this._connectionState === "Connecting")
|
|
1201
|
+
throw this._logger.log(l.Warning, `Call to HttpConnection.stopConnection(${e}) was ignored because the connection is still in the connecting state.`), new Error(`HttpConnection.stopConnection(${e}) was called while the connection is still in the connecting state.`);
|
|
1202
|
+
if (this._connectionState === "Disconnecting" && this._stopPromiseResolver(), e ? this._logger.log(l.Error, `Connection disconnected with error '${e}'.`) : this._logger.log(l.Information, "Connection disconnected."), this._sendQueue && (this._sendQueue.stop().catch((n) => {
|
|
1203
|
+
this._logger.log(l.Error, `TransportSendQueue.stop() threw error '${n}'.`);
|
|
1204
|
+
}), this._sendQueue = void 0), this.connectionId = void 0, this._connectionState = "Disconnected", this._connectionStarted) {
|
|
1205
|
+
this._connectionStarted = !1;
|
|
1206
|
+
try {
|
|
1207
|
+
this.onclose && this.onclose(e);
|
|
1208
|
+
} catch (n) {
|
|
1209
|
+
this._logger.log(l.Error, `HttpConnection.onclose(${e}) threw error '${n}'.`);
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
_resolveUrl(e) {
|
|
1214
|
+
if (e.lastIndexOf("https://", 0) === 0 || e.lastIndexOf("http://", 0) === 0)
|
|
1215
|
+
return e;
|
|
1216
|
+
if (!R.isBrowser)
|
|
1217
|
+
throw new Error(`Cannot resolve '${e}'.`);
|
|
1218
|
+
const n = window.document.createElement("a");
|
|
1219
|
+
return n.href = e, this._logger.log(l.Information, `Normalizing '${e}' to '${n.href}'.`), n.href;
|
|
1220
|
+
}
|
|
1221
|
+
_resolveNegotiateUrl(e) {
|
|
1222
|
+
const n = new URL(e);
|
|
1223
|
+
n.pathname.endsWith("/") ? n.pathname += "negotiate" : n.pathname += "/negotiate";
|
|
1224
|
+
const s = new URLSearchParams(n.searchParams);
|
|
1225
|
+
return s.has("negotiateVersion") || s.append("negotiateVersion", this._negotiateVersion.toString()), s.has("useStatefulReconnect") ? s.get("useStatefulReconnect") === "true" && (this._options._useStatefulReconnect = !0) : this._options._useStatefulReconnect === !0 && s.append("useStatefulReconnect", "true"), n.search = s.toString(), n.toString();
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
function It(t, e) {
|
|
1229
|
+
return !t || (e & t) !== 0;
|
|
1230
|
+
}
|
|
1231
|
+
class _e {
|
|
1232
|
+
constructor(e) {
|
|
1233
|
+
this._transport = e, this._buffer = [], this._executing = !0, this._sendBufferedData = new oe(), this._transportResult = new oe(), this._sendLoopPromise = this._sendLoop();
|
|
1234
|
+
}
|
|
1235
|
+
send(e) {
|
|
1236
|
+
return this._bufferData(e), this._transportResult || (this._transportResult = new oe()), this._transportResult.promise;
|
|
1237
|
+
}
|
|
1238
|
+
stop() {
|
|
1239
|
+
return this._executing = !1, this._sendBufferedData.resolve(), this._sendLoopPromise;
|
|
1240
|
+
}
|
|
1241
|
+
_bufferData(e) {
|
|
1242
|
+
if (this._buffer.length && typeof this._buffer[0] != typeof e)
|
|
1243
|
+
throw new Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof e}`);
|
|
1244
|
+
this._buffer.push(e), this._sendBufferedData.resolve();
|
|
1245
|
+
}
|
|
1246
|
+
async _sendLoop() {
|
|
1247
|
+
for (; ; ) {
|
|
1248
|
+
if (await this._sendBufferedData.promise, !this._executing) {
|
|
1249
|
+
this._transportResult && this._transportResult.reject("Connection stopped.");
|
|
1250
|
+
break;
|
|
1251
|
+
}
|
|
1252
|
+
this._sendBufferedData = new oe();
|
|
1253
|
+
const e = this._transportResult;
|
|
1254
|
+
this._transportResult = void 0;
|
|
1255
|
+
const n = typeof this._buffer[0] == "string" ? this._buffer.join("") : _e._concatBuffers(this._buffer);
|
|
1256
|
+
this._buffer.length = 0;
|
|
1257
|
+
try {
|
|
1258
|
+
await this._transport.send(n), e.resolve();
|
|
1259
|
+
} catch (s) {
|
|
1260
|
+
e.reject(s);
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
static _concatBuffers(e) {
|
|
1265
|
+
const n = e.map((r) => r.byteLength).reduce((r, i) => r + i), s = new Uint8Array(n);
|
|
1266
|
+
let o = 0;
|
|
1267
|
+
for (const r of e)
|
|
1268
|
+
s.set(new Uint8Array(r), o), o += r.byteLength;
|
|
1269
|
+
return s.buffer;
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
class oe {
|
|
1273
|
+
constructor() {
|
|
1274
|
+
this.promise = new Promise((e, n) => [this._resolver, this._rejecter] = [e, n]);
|
|
1275
|
+
}
|
|
1276
|
+
resolve() {
|
|
1277
|
+
this._resolver();
|
|
1278
|
+
}
|
|
1279
|
+
reject(e) {
|
|
1280
|
+
this._rejecter(e);
|
|
1281
|
+
}
|
|
1282
|
+
}
|
|
1283
|
+
const Mt = "json";
|
|
1284
|
+
class $t {
|
|
1285
|
+
constructor() {
|
|
1286
|
+
this.name = Mt, this.version = 2, this.transferFormat = D.Text;
|
|
1287
|
+
}
|
|
1288
|
+
/** Creates an array of {@link @microsoft/signalr.HubMessage} objects from the specified serialized representation.
|
|
1289
|
+
*
|
|
1290
|
+
* @param {string} input A string containing the serialized representation.
|
|
1291
|
+
* @param {ILogger} logger A logger that will be used to log messages that occur during parsing.
|
|
1292
|
+
*/
|
|
1293
|
+
parseMessages(e, n) {
|
|
1294
|
+
if (typeof e != "string")
|
|
1295
|
+
throw new Error("Invalid input for JSON hub protocol. Expected a string.");
|
|
1296
|
+
if (!e)
|
|
1297
|
+
return [];
|
|
1298
|
+
n === null && (n = Ie.instance);
|
|
1299
|
+
const s = Se.parse(e), o = [];
|
|
1300
|
+
for (const r of s) {
|
|
1301
|
+
const i = JSON.parse(r);
|
|
1302
|
+
if (typeof i.type != "number")
|
|
1303
|
+
throw new Error("Invalid payload.");
|
|
1304
|
+
switch (i.type) {
|
|
1305
|
+
case B.Invocation:
|
|
1306
|
+
this._isInvocationMessage(i);
|
|
1307
|
+
break;
|
|
1308
|
+
case B.StreamItem:
|
|
1309
|
+
this._isStreamItemMessage(i);
|
|
1310
|
+
break;
|
|
1311
|
+
case B.Completion:
|
|
1312
|
+
this._isCompletionMessage(i);
|
|
1313
|
+
break;
|
|
1314
|
+
case B.Ping:
|
|
1315
|
+
break;
|
|
1316
|
+
case B.Close:
|
|
1317
|
+
break;
|
|
1318
|
+
case B.Ack:
|
|
1319
|
+
this._isAckMessage(i);
|
|
1320
|
+
break;
|
|
1321
|
+
case B.Sequence:
|
|
1322
|
+
this._isSequenceMessage(i);
|
|
1323
|
+
break;
|
|
1324
|
+
default:
|
|
1325
|
+
n.log(l.Information, "Unknown message type '" + i.type + "' ignored.");
|
|
1326
|
+
continue;
|
|
1327
|
+
}
|
|
1328
|
+
o.push(i);
|
|
1329
|
+
}
|
|
1330
|
+
return o;
|
|
1331
|
+
}
|
|
1332
|
+
/** Writes the specified {@link @microsoft/signalr.HubMessage} to a string and returns it.
|
|
1333
|
+
*
|
|
1334
|
+
* @param {HubMessage} message The message to write.
|
|
1335
|
+
* @returns {string} A string containing the serialized representation of the message.
|
|
1336
|
+
*/
|
|
1337
|
+
writeMessage(e) {
|
|
1338
|
+
return Se.write(JSON.stringify(e));
|
|
1339
|
+
}
|
|
1340
|
+
_isInvocationMessage(e) {
|
|
1341
|
+
this._assertNotEmptyString(e.target, "Invalid payload for Invocation message."), e.invocationId !== void 0 && this._assertNotEmptyString(e.invocationId, "Invalid payload for Invocation message.");
|
|
1342
|
+
}
|
|
1343
|
+
_isStreamItemMessage(e) {
|
|
1344
|
+
if (this._assertNotEmptyString(e.invocationId, "Invalid payload for StreamItem message."), e.item === void 0)
|
|
1345
|
+
throw new Error("Invalid payload for StreamItem message.");
|
|
1346
|
+
}
|
|
1347
|
+
_isCompletionMessage(e) {
|
|
1348
|
+
if (e.result && e.error)
|
|
1349
|
+
throw new Error("Invalid payload for Completion message.");
|
|
1350
|
+
!e.result && e.error && this._assertNotEmptyString(e.error, "Invalid payload for Completion message."), this._assertNotEmptyString(e.invocationId, "Invalid payload for Completion message.");
|
|
1351
|
+
}
|
|
1352
|
+
_isAckMessage(e) {
|
|
1353
|
+
if (typeof e.sequenceId != "number")
|
|
1354
|
+
throw new Error("Invalid SequenceId for Ack message.");
|
|
1355
|
+
}
|
|
1356
|
+
_isSequenceMessage(e) {
|
|
1357
|
+
if (typeof e.sequenceId != "number")
|
|
1358
|
+
throw new Error("Invalid SequenceId for Sequence message.");
|
|
1359
|
+
}
|
|
1360
|
+
_assertNotEmptyString(e, n) {
|
|
1361
|
+
if (typeof e != "string" || e === "")
|
|
1362
|
+
throw new Error(n);
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
const Nt = {
|
|
1366
|
+
trace: l.Trace,
|
|
1367
|
+
debug: l.Debug,
|
|
1368
|
+
info: l.Information,
|
|
1369
|
+
information: l.Information,
|
|
1370
|
+
warn: l.Warning,
|
|
1371
|
+
warning: l.Warning,
|
|
1372
|
+
error: l.Error,
|
|
1373
|
+
critical: l.Critical,
|
|
1374
|
+
none: l.None
|
|
1375
|
+
};
|
|
1376
|
+
function Ht(t) {
|
|
1377
|
+
const e = Nt[t.toLowerCase()];
|
|
1378
|
+
if (typeof e < "u")
|
|
1379
|
+
return e;
|
|
1380
|
+
throw new Error(`Unknown log level: ${t}`);
|
|
1381
|
+
}
|
|
1382
|
+
class Ot {
|
|
1383
|
+
configureLogging(e) {
|
|
1384
|
+
if (E.isRequired(e, "logging"), Ut(e))
|
|
1385
|
+
this.logger = e;
|
|
1386
|
+
else if (typeof e == "string") {
|
|
1387
|
+
const n = Ht(e);
|
|
1388
|
+
this.logger = new be(n);
|
|
1389
|
+
} else
|
|
1390
|
+
this.logger = new be(e);
|
|
1391
|
+
return this;
|
|
1392
|
+
}
|
|
1393
|
+
withUrl(e, n) {
|
|
1394
|
+
return E.isRequired(e, "url"), E.isNotEmpty(e, "url"), this.url = e, typeof n == "object" ? this.httpConnectionOptions = { ...this.httpConnectionOptions, ...n } : this.httpConnectionOptions = {
|
|
1395
|
+
...this.httpConnectionOptions,
|
|
1396
|
+
transport: n
|
|
1397
|
+
}, this;
|
|
1398
|
+
}
|
|
1399
|
+
/** Configures the {@link @microsoft/signalr.HubConnection} to use the specified Hub Protocol.
|
|
1400
|
+
*
|
|
1401
|
+
* @param {IHubProtocol} protocol The {@link @microsoft/signalr.IHubProtocol} implementation to use.
|
|
1402
|
+
*/
|
|
1403
|
+
withHubProtocol(e) {
|
|
1404
|
+
return E.isRequired(e, "protocol"), this.protocol = e, this;
|
|
1405
|
+
}
|
|
1406
|
+
withAutomaticReconnect(e) {
|
|
1407
|
+
if (this.reconnectPolicy)
|
|
1408
|
+
throw new Error("A reconnectPolicy has already been set.");
|
|
1409
|
+
return e ? Array.isArray(e) ? this.reconnectPolicy = new Te(e) : this.reconnectPolicy = e : this.reconnectPolicy = new Te(), this;
|
|
1410
|
+
}
|
|
1411
|
+
/** Configures {@link @microsoft/signalr.HubConnection.serverTimeoutInMilliseconds} for the {@link @microsoft/signalr.HubConnection}.
|
|
1412
|
+
*
|
|
1413
|
+
* @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.
|
|
1414
|
+
*/
|
|
1415
|
+
withServerTimeout(e) {
|
|
1416
|
+
return E.isRequired(e, "milliseconds"), this._serverTimeoutInMilliseconds = e, this;
|
|
1417
|
+
}
|
|
1418
|
+
/** Configures {@link @microsoft/signalr.HubConnection.keepAliveIntervalInMilliseconds} for the {@link @microsoft/signalr.HubConnection}.
|
|
1419
|
+
*
|
|
1420
|
+
* @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.
|
|
1421
|
+
*/
|
|
1422
|
+
withKeepAliveInterval(e) {
|
|
1423
|
+
return E.isRequired(e, "milliseconds"), this._keepAliveIntervalInMilliseconds = e, this;
|
|
1424
|
+
}
|
|
1425
|
+
/** Enables and configures options for the Stateful Reconnect feature.
|
|
1426
|
+
*
|
|
1427
|
+
* @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.
|
|
1428
|
+
*/
|
|
1429
|
+
withStatefulReconnect(e) {
|
|
1430
|
+
return this.httpConnectionOptions === void 0 && (this.httpConnectionOptions = {}), this.httpConnectionOptions._useStatefulReconnect = !0, this._statefulReconnectBufferSize = e == null ? void 0 : e.bufferSize, this;
|
|
1431
|
+
}
|
|
1432
|
+
/** Creates a {@link @microsoft/signalr.HubConnection} from the configuration options specified in this builder.
|
|
1433
|
+
*
|
|
1434
|
+
* @returns {HubConnection} The configured {@link @microsoft/signalr.HubConnection}.
|
|
1435
|
+
*/
|
|
1436
|
+
build() {
|
|
1437
|
+
const e = this.httpConnectionOptions || {};
|
|
1438
|
+
if (e.logger === void 0 && (e.logger = this.logger), !this.url)
|
|
1439
|
+
throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");
|
|
1440
|
+
const n = new Rt(this.url, e);
|
|
1441
|
+
return Ye.create(n, this.logger || Ie.instance, this.protocol || new $t(), this.reconnectPolicy, this._serverTimeoutInMilliseconds, this._keepAliveIntervalInMilliseconds, this._statefulReconnectBufferSize);
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
function Ut(t) {
|
|
1445
|
+
return t.log !== void 0;
|
|
1446
|
+
}
|
|
1447
|
+
const Wt = 15 * 1e3, ln = (t) => {
|
|
1448
|
+
const e = N.c(19), {
|
|
1449
|
+
children: n,
|
|
1450
|
+
apiUrl: s,
|
|
1451
|
+
endpoint: o
|
|
1452
|
+
} = t, {
|
|
1453
|
+
authState: r
|
|
1454
|
+
} = V(ge);
|
|
1455
|
+
let i;
|
|
1456
|
+
e[0] !== s || e[1] !== o ? (i = new Ot().withUrl(`${s}/${o}`).withAutomaticReconnect({
|
|
1457
|
+
nextRetryDelayInMilliseconds: jt
|
|
1458
|
+
}).build(), e[0] = s, e[1] = o, e[2] = i) : i = e[2];
|
|
1459
|
+
const [a] = L(i), [c, u] = L(a.state), [h, g] = L(!1);
|
|
1460
|
+
let p, f;
|
|
1461
|
+
e[3] !== r || e[4] !== a ? (p = () => {
|
|
1462
|
+
if (r !== "AUTH_OK")
|
|
1463
|
+
return;
|
|
1464
|
+
const C = () => u(a.state);
|
|
1465
|
+
a.on("Connected", Ft), a.onreconnecting((k) => {
|
|
1466
|
+
console.log("Reconnecting...", k), C(), g(!0);
|
|
1467
|
+
}), a.onreconnected(() => {
|
|
1468
|
+
console.log("Reconnected"), C(), g(!1);
|
|
1469
|
+
}), a.onclose((k) => {
|
|
1470
|
+
console.log("Connection closed", k), C(), g(!0);
|
|
1471
|
+
}), a.start().then(() => {
|
|
1472
|
+
console.log("Connection started"), C(), g(!1);
|
|
1473
|
+
}).catch((k) => {
|
|
1474
|
+
console.log("Error starting connection:", k), C(), g(!0);
|
|
1475
|
+
});
|
|
1476
|
+
}, f = [r, a], e[3] = r, e[4] = a, e[5] = p, e[6] = f) : (p = e[5], f = e[6]), W(p, f);
|
|
1477
|
+
let _, w;
|
|
1478
|
+
e[7] !== r || e[8] !== a ? (_ = () => {
|
|
1479
|
+
r !== "AUTH_OK" && a.stop();
|
|
1480
|
+
}, w = [r, a], e[7] = r, e[8] = a, e[9] = _, e[10] = w) : (_ = e[9], w = e[10]), W(_, w);
|
|
1481
|
+
const d = c === Ze.Connected, S = r === "AUTH_OK";
|
|
1482
|
+
let m;
|
|
1483
|
+
e[11] !== c || e[12] !== h || e[13] !== d || e[14] !== S ? (m = {
|
|
1484
|
+
isAlive: d,
|
|
1485
|
+
shouldBeAlive: S,
|
|
1486
|
+
connectionState: c,
|
|
1487
|
+
hasLastConnectionEnded: h
|
|
1488
|
+
}, e[11] = c, e[12] = h, e[13] = d, e[14] = S, e[15] = m) : m = e[15];
|
|
1489
|
+
const y = m;
|
|
1490
|
+
let b;
|
|
1491
|
+
return e[16] !== n || e[17] !== y ? (b = /* @__PURE__ */ v(et.Provider, { value: y, children: n }), e[16] = n, e[17] = y, e[18] = b) : b = e[18], b;
|
|
1492
|
+
};
|
|
1493
|
+
function jt(t) {
|
|
1494
|
+
return Math.min(1e3 * 2 ** t.previousRetryCount, Wt);
|
|
1495
|
+
}
|
|
1496
|
+
function Ft(t) {
|
|
1497
|
+
console.log("Server says:", t);
|
|
1498
|
+
}
|
|
1499
|
+
const xe = 50, Bt = () => {
|
|
1500
|
+
const t = N.c(22), {
|
|
602
1501
|
texts: e
|
|
603
|
-
} =
|
|
604
|
-
confirm:
|
|
1502
|
+
} = V(ce), {
|
|
1503
|
+
confirm: n
|
|
605
1504
|
} = e, {
|
|
606
|
-
onConfirm:
|
|
607
|
-
onCancel:
|
|
608
|
-
text:
|
|
609
|
-
show:
|
|
610
|
-
textSm:
|
|
611
|
-
} =
|
|
612
|
-
let
|
|
613
|
-
t[0] !==
|
|
614
|
-
if (
|
|
615
|
-
e: switch (
|
|
1505
|
+
onConfirm: s,
|
|
1506
|
+
onCancel: o,
|
|
1507
|
+
text: r,
|
|
1508
|
+
show: i,
|
|
1509
|
+
textSm: a
|
|
1510
|
+
} = tt(), c = a === void 0 ? r.length > xe : a, u = r.length > xe;
|
|
1511
|
+
let h;
|
|
1512
|
+
t[0] !== o || t[1] !== s || t[2] !== i ? (h = (m) => {
|
|
1513
|
+
if (i)
|
|
1514
|
+
e: switch (m.key) {
|
|
616
1515
|
case "Enter": {
|
|
617
|
-
|
|
1516
|
+
m.preventDefault(), m.stopPropagation(), s();
|
|
618
1517
|
break e;
|
|
619
1518
|
}
|
|
620
1519
|
case "Escape": {
|
|
621
|
-
|
|
1520
|
+
m.preventDefault(), m.stopPropagation(), o();
|
|
622
1521
|
break e;
|
|
623
1522
|
}
|
|
624
1523
|
}
|
|
625
|
-
}, t[0] =
|
|
626
|
-
const
|
|
627
|
-
let
|
|
628
|
-
t[4] !==
|
|
629
|
-
let
|
|
630
|
-
t[7] !==
|
|
631
|
-
let
|
|
632
|
-
t[10] !==
|
|
633
|
-
let
|
|
634
|
-
t[13] !==
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
] }) }), t[13] =
|
|
638
|
-
let
|
|
639
|
-
return t[16] !==
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
] }), t[16] =
|
|
1524
|
+
}, t[0] = o, t[1] = s, t[2] = i, t[3] = h) : h = t[3], nt(h);
|
|
1525
|
+
const p = u ? void 0 : "sm";
|
|
1526
|
+
let f;
|
|
1527
|
+
t[4] !== c || t[5] !== r ? (f = /* @__PURE__ */ v(O.Header, { className: "justify-content-center", children: c ? /* @__PURE__ */ v(ot, { variant: "body", children: r }) : /* @__PURE__ */ v(O.Title, { children: r }) }), t[4] = c, t[5] = r, t[6] = f) : f = t[6];
|
|
1528
|
+
let _;
|
|
1529
|
+
t[7] !== n.no || t[8] !== o ? (_ = /* @__PURE__ */ v(re, { type: "button", variant: "outlined", color: "secondary", className: "w-100", onClick: o, children: n.no }), t[7] = n.no, t[8] = o, t[9] = _) : _ = t[9];
|
|
1530
|
+
let w;
|
|
1531
|
+
t[10] !== n.yes || t[11] !== s ? (w = /* @__PURE__ */ v(re, { type: "button", color: "primary", onClick: s, className: "w-100 ml", children: n.yes }), t[10] = n.yes, t[11] = s, t[12] = w) : w = t[12];
|
|
1532
|
+
let d;
|
|
1533
|
+
t[13] !== _ || t[14] !== w ? (d = /* @__PURE__ */ v(O.Body, { children: /* @__PURE__ */ I("div", { className: "w-100 d-flex gap-5", children: [
|
|
1534
|
+
_,
|
|
1535
|
+
w
|
|
1536
|
+
] }) }), t[13] = _, t[14] = w, t[15] = d) : d = t[15];
|
|
1537
|
+
let S;
|
|
1538
|
+
return t[16] !== o || t[17] !== i || t[18] !== p || t[19] !== f || t[20] !== d ? (S = /* @__PURE__ */ I(O, { show: i, size: p, centered: !0, onHide: o, children: [
|
|
1539
|
+
f,
|
|
1540
|
+
d
|
|
1541
|
+
] }), t[16] = o, t[17] = i, t[18] = p, t[19] = f, t[20] = d, t[21] = S) : S = t[21], S;
|
|
643
1542
|
};
|
|
644
1543
|
export {
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
1544
|
+
et as ApiWebSocketContext,
|
|
1545
|
+
ln as ApiWebSocketProvider,
|
|
1546
|
+
ge as AuthContext,
|
|
1547
|
+
sn as AuthProvider,
|
|
1548
|
+
De as DelegationContext,
|
|
1549
|
+
rn as DelegationProvider,
|
|
1550
|
+
dn as FormDisabledContext,
|
|
1551
|
+
pn as FormDisabledProvider,
|
|
1552
|
+
Ge as HelmetContext,
|
|
1553
|
+
an as HelmetProvider,
|
|
1554
|
+
We as LoadingContext,
|
|
1555
|
+
nn as LoadingProvider,
|
|
1556
|
+
ce as LuminusComponentsContext,
|
|
1557
|
+
tn as LuminusComponentsProvider,
|
|
1558
|
+
Fe as UserContext,
|
|
1559
|
+
on as UserProvider,
|
|
1560
|
+
fn as useFormDisabledContext
|
|
660
1561
|
};
|