@machinemetrics/mm-react-embeddable 1.4.0-8 → 2.0.0-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import g, { createContext as oe, useContext as K, useState as U, useRef as R, useCallback as h, useEffect as k, useMemo as ue } from "react";
|
|
2
|
+
import T from "prop-types";
|
|
3
3
|
import D from "styled-components";
|
|
4
4
|
const Y = oe(null), J = oe({
|
|
5
5
|
pending: [],
|
|
@@ -14,32 +14,32 @@ const Y = oe(null), J = oe({
|
|
|
14
14
|
originEpochs: {},
|
|
15
15
|
credentials: {},
|
|
16
16
|
unsupported: {}
|
|
17
|
-
}),
|
|
18
|
-
kind:
|
|
17
|
+
}), ae = "access_token", re = (r) => r ? r.kind ? r : r.accessToken ? {
|
|
18
|
+
kind: ae,
|
|
19
19
|
accessToken: r.accessToken,
|
|
20
20
|
expiresAt: r.expiresAt || null
|
|
21
|
-
} : null : null,
|
|
21
|
+
} : null : null, le = /* @__PURE__ */ new Set(["host_not_allowed", "invalid_token", "provider_unavailable"]), X = typeof window != "undefined" && window.location.protocol === "https:", de = 8e3, Q = (r) => {
|
|
22
22
|
try {
|
|
23
23
|
return new URL(r).origin;
|
|
24
24
|
} catch {
|
|
25
25
|
return null;
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
const
|
|
29
|
-
return !
|
|
30
|
-
},
|
|
27
|
+
}, ne = (r, s) => {
|
|
28
|
+
const c = s == null ? void 0 : s.origin;
|
|
29
|
+
return !c || Q(r == null ? void 0 : r.authUrl) !== c ? null : c;
|
|
30
|
+
}, se = (r) => {
|
|
31
31
|
if (!r || /^\d{1,3}(?:\.\d{1,3}){3}$/.test(r) || r.includes(":"))
|
|
32
32
|
return r;
|
|
33
33
|
const s = r.split(".");
|
|
34
34
|
return s.length <= 2 ? r : s.slice(-2).join(".");
|
|
35
35
|
}, fe = (r, s) => {
|
|
36
36
|
try {
|
|
37
|
-
const
|
|
38
|
-
return
|
|
37
|
+
const c = new URL(r), d = new URL(s);
|
|
38
|
+
return c.protocol !== d.protocol ? !0 : se(c.hostname) !== se(d.hostname);
|
|
39
39
|
} catch {
|
|
40
40
|
return !0;
|
|
41
41
|
}
|
|
42
|
-
}, pe = (r, { onBlocked: s, onClosed:
|
|
42
|
+
}, pe = (r, { onBlocked: s, onClosed: c }) => {
|
|
43
43
|
const d = window.open(
|
|
44
44
|
r.authUrl,
|
|
45
45
|
"mm-embed-auth",
|
|
@@ -48,33 +48,35 @@ const Y = oe(null), J = oe({
|
|
|
48
48
|
if (!d)
|
|
49
49
|
return s(), () => {
|
|
50
50
|
};
|
|
51
|
-
const
|
|
52
|
-
d.closed && (clearInterval(
|
|
51
|
+
const p = setInterval(() => {
|
|
52
|
+
d.closed && (clearInterval(p), c());
|
|
53
53
|
}, 1e3);
|
|
54
|
-
return () => clearInterval(
|
|
55
|
-
}, ie = ({ children: r, launcher: s, broker:
|
|
56
|
-
const d =
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
|
|
54
|
+
return () => clearInterval(p);
|
|
55
|
+
}, ie = ({ children: r, launcher: s, broker: c }) => {
|
|
56
|
+
const d = K(Y), [p, b] = U({}), [j, I] = U({}), [_, A] = U({}), [F, y] = U({}), H = R(_);
|
|
57
|
+
H.current = _;
|
|
58
|
+
const E = R(p);
|
|
59
|
+
E.current = p;
|
|
60
|
+
const O = R(null), G = R({}), C = R({}), v = R({}), S = R(c);
|
|
61
|
+
S.current = c;
|
|
62
|
+
const z = h((e) => {
|
|
63
|
+
const t = C.current[e];
|
|
62
64
|
if (!t)
|
|
63
65
|
return;
|
|
64
|
-
const n = (
|
|
65
|
-
|
|
66
|
-
}, []),
|
|
66
|
+
const n = (i) => !i[e] || i[e].clientId ? i : { ...i, [e]: { ...i[e], clientId: t } };
|
|
67
|
+
b(n), y(n);
|
|
68
|
+
}, []), u = h(
|
|
67
69
|
(e, t) => {
|
|
68
|
-
e && (
|
|
70
|
+
e && (y((n) => n[e] ? n : {
|
|
69
71
|
...n,
|
|
70
|
-
[e]: { origin: e, reason: t, clientId:
|
|
71
|
-
}),
|
|
72
|
+
[e]: { origin: e, reason: t, clientId: C.current[e] || null }
|
|
73
|
+
}), z(e));
|
|
72
74
|
},
|
|
73
|
-
[
|
|
74
|
-
),
|
|
75
|
+
[z]
|
|
76
|
+
), a = h(
|
|
75
77
|
(e, { v2: t = !1, origin: n = null } = {}) => {
|
|
76
|
-
n && (t &&
|
|
77
|
-
...
|
|
78
|
+
n && (t && H.current[n] || (b((i) => i[n] ? i : {
|
|
79
|
+
...i,
|
|
78
80
|
[n]: {
|
|
79
81
|
origin: n,
|
|
80
82
|
authUrl: e.authUrl,
|
|
@@ -82,58 +84,58 @@ const Y = oe(null), J = oe({
|
|
|
82
84
|
// v2 entries try the invisible silent resolver first — but only on a host that can
|
|
83
85
|
// frame login (https). Otherwise (and for legacy signals) go straight to interactive,
|
|
84
86
|
// so an http host doesn't wait out a silent frame that can never load login.
|
|
85
|
-
status: t &&
|
|
87
|
+
status: t && S.current ? "broker" : t && e.silentUrl && X ? "silent" : "interactive",
|
|
86
88
|
v2: t,
|
|
87
89
|
// v1.9: the scope the guest asked for; forwarded verbatim to the broker.
|
|
88
90
|
scope: e.scope || null,
|
|
89
|
-
acceptsCredentials:
|
|
91
|
+
acceptsCredentials: v.current[n] || null,
|
|
90
92
|
consent: null,
|
|
91
93
|
error: null,
|
|
92
94
|
// clientId from the request payload (v2) or the cached init (legacy);
|
|
93
95
|
// the host resolves the display name from it.
|
|
94
|
-
clientId: e.clientId ||
|
|
96
|
+
clientId: e.clientId || C.current[n] || null,
|
|
95
97
|
popupBlocked: !1
|
|
96
98
|
}
|
|
97
|
-
}),
|
|
99
|
+
}), z(n)));
|
|
98
100
|
},
|
|
99
|
-
[
|
|
100
|
-
),
|
|
101
|
-
|
|
101
|
+
[z]
|
|
102
|
+
), o = h((e) => {
|
|
103
|
+
b((t) => {
|
|
102
104
|
if (!t[e])
|
|
103
105
|
return t;
|
|
104
106
|
const n = { ...t };
|
|
105
107
|
return delete n[e], n;
|
|
106
108
|
});
|
|
107
|
-
}, []),
|
|
109
|
+
}, []), l = h(
|
|
108
110
|
(e) => {
|
|
109
|
-
e && (
|
|
111
|
+
e && (o(e), I((t) => ({
|
|
110
112
|
...t,
|
|
111
113
|
[e]: (t[e] || 0) + 1
|
|
112
114
|
})));
|
|
113
115
|
},
|
|
114
|
-
[
|
|
115
|
-
),
|
|
116
|
-
|
|
116
|
+
[o]
|
|
117
|
+
), w = h((e) => {
|
|
118
|
+
b((t) => !t[e] || t[e].status === "interactive" ? t : {
|
|
117
119
|
...t,
|
|
118
120
|
[e]: { ...t[e], status: "interactive" }
|
|
119
121
|
});
|
|
120
|
-
}, []),
|
|
122
|
+
}, []), x = h(
|
|
121
123
|
(e) => {
|
|
122
|
-
|
|
124
|
+
o(e.origin);
|
|
123
125
|
},
|
|
124
|
-
[
|
|
125
|
-
),
|
|
126
|
+
[o]
|
|
127
|
+
), L = h(
|
|
126
128
|
(e, t) => {
|
|
127
|
-
const n =
|
|
129
|
+
const n = ne(e, t);
|
|
128
130
|
if (n) {
|
|
129
131
|
if (fe(n, window.location.origin)) {
|
|
130
|
-
|
|
132
|
+
u(n, "cross-site-legacy");
|
|
131
133
|
return;
|
|
132
134
|
}
|
|
133
|
-
|
|
135
|
+
a(e, { origin: n });
|
|
134
136
|
}
|
|
135
137
|
},
|
|
136
|
-
[
|
|
138
|
+
[a, u]
|
|
137
139
|
);
|
|
138
140
|
k(() => {
|
|
139
141
|
if (!d)
|
|
@@ -146,162 +148,167 @@ const Y = oe(null), J = oe({
|
|
|
146
148
|
// clientId is only a lookup key: the host resolves the display name from
|
|
147
149
|
// it, and a broker binds it to the attested origin server-side.
|
|
148
150
|
d.addListener("*", "init", (t, n) => {
|
|
149
|
-
n != null && n.origin && (t != null && t.clientId) && (
|
|
151
|
+
n != null && n.origin && (t != null && t.clientId) && (C.current[n.origin] = t.clientId, z(n.origin)), n != null && n.origin && Array.isArray(t == null ? void 0 : t.acceptsCredentials) && (v.current[n.origin] = t.acceptsCredentials);
|
|
150
152
|
}),
|
|
151
|
-
d.addListener("*", "authorize",
|
|
152
|
-
d.addListener("*", "login",
|
|
153
|
+
d.addListener("*", "authorize", L),
|
|
154
|
+
d.addListener("*", "login", L),
|
|
153
155
|
d.addListener(
|
|
154
156
|
"*",
|
|
155
157
|
"credential-request",
|
|
156
|
-
(t, n) =>
|
|
158
|
+
(t, n) => a(t, { v2: !0, origin: ne(t, n) })
|
|
157
159
|
)
|
|
158
160
|
];
|
|
159
161
|
return () => e.forEach((t) => t());
|
|
160
|
-
}, [d,
|
|
162
|
+
}, [d, L, a, z]), k(() => {
|
|
161
163
|
const e = (t) => {
|
|
162
164
|
const n = t == null ? void 0 : t.data;
|
|
163
165
|
if (!n || n.type !== "authorized" && n.type !== "authorize-failed")
|
|
164
166
|
return;
|
|
165
|
-
const
|
|
166
|
-
if (!(!
|
|
167
|
+
const i = Q(n.authUrl);
|
|
168
|
+
if (!(!i || t.origin !== i)) {
|
|
167
169
|
if (n.type === "authorized") {
|
|
168
|
-
n.accessToken
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
170
|
+
if (n.accessToken) {
|
|
171
|
+
if (!E.current[i])
|
|
172
|
+
return;
|
|
173
|
+
A((f) => ({
|
|
174
|
+
...f,
|
|
175
|
+
[i]: re({ accessToken: n.accessToken })
|
|
176
|
+
})), o(i);
|
|
177
|
+
} else
|
|
178
|
+
l(i);
|
|
172
179
|
return;
|
|
173
180
|
}
|
|
174
|
-
|
|
181
|
+
w(i);
|
|
175
182
|
}
|
|
176
183
|
};
|
|
177
184
|
return window.addEventListener("message", e), () => window.removeEventListener("message", e);
|
|
178
|
-
}, [
|
|
179
|
-
const
|
|
185
|
+
}, [o, l, w]);
|
|
186
|
+
const M = h(
|
|
180
187
|
(e, t) => {
|
|
181
|
-
const n = e == null ? void 0 : e.origin,
|
|
182
|
-
!n || !
|
|
188
|
+
const n = e == null ? void 0 : e.origin, i = re(t);
|
|
189
|
+
!n || !i || (A((f) => ({ ...f, [n]: i })), o(n));
|
|
183
190
|
},
|
|
184
|
-
[
|
|
185
|
-
),
|
|
186
|
-
|
|
187
|
-
}, []),
|
|
191
|
+
[o]
|
|
192
|
+
), m = h((e, t) => {
|
|
193
|
+
b((n) => n[e] ? { ...n, [e]: { ...n[e], ...t } } : n);
|
|
194
|
+
}, []), $ = h(
|
|
188
195
|
async (e, { approve: t } = {}) => {
|
|
189
|
-
const n =
|
|
190
|
-
let
|
|
196
|
+
const n = S.current, { origin: i } = e;
|
|
197
|
+
let f;
|
|
191
198
|
try {
|
|
192
|
-
|
|
193
|
-
{ origin:
|
|
199
|
+
f = await n(
|
|
200
|
+
{ origin: i, clientId: e.clientId, scope: e.scope, authUrl: e.authUrl },
|
|
194
201
|
{ approve: t }
|
|
195
202
|
);
|
|
196
203
|
} catch {
|
|
197
|
-
t ?
|
|
204
|
+
t ? m(i, { error: { reason: "broker_unavailable" } }) : m(i, {
|
|
198
205
|
status: e.silentUrl && X ? "silent" : "interactive"
|
|
199
206
|
});
|
|
200
207
|
return;
|
|
201
208
|
}
|
|
202
|
-
if ((
|
|
203
|
-
|
|
209
|
+
if ((f == null ? void 0 : f.status) === 200 && f.credential) {
|
|
210
|
+
M(e, f.credential);
|
|
204
211
|
return;
|
|
205
212
|
}
|
|
206
|
-
if ((
|
|
207
|
-
|
|
213
|
+
if ((f == null ? void 0 : f.status) === 409 && f.consentRequired) {
|
|
214
|
+
m(i, {
|
|
208
215
|
status: "interactive",
|
|
209
216
|
consent: {
|
|
210
|
-
client:
|
|
211
|
-
stepUp: !!
|
|
212
|
-
scope:
|
|
217
|
+
client: f.client || null,
|
|
218
|
+
stepUp: !!f.stepUp,
|
|
219
|
+
scope: f.scope || e.scope
|
|
213
220
|
},
|
|
214
221
|
error: null
|
|
215
222
|
});
|
|
216
223
|
return;
|
|
217
224
|
}
|
|
218
|
-
const
|
|
219
|
-
if (!t &&
|
|
220
|
-
|
|
225
|
+
const N = (f == null ? void 0 : f.error) || "broker_error";
|
|
226
|
+
if (!t && le.has(N)) {
|
|
227
|
+
m(i, {
|
|
221
228
|
status: e.silentUrl && X ? "silent" : "interactive"
|
|
222
229
|
});
|
|
223
230
|
return;
|
|
224
231
|
}
|
|
225
|
-
if (t &&
|
|
226
|
-
|
|
232
|
+
if (t && N === "consent_denied") {
|
|
233
|
+
m(i, { error: null });
|
|
227
234
|
return;
|
|
228
235
|
}
|
|
229
|
-
|
|
230
|
-
...
|
|
231
|
-
[
|
|
232
|
-
origin:
|
|
233
|
-
reason: `broker:${
|
|
234
|
-
detail:
|
|
235
|
-
clientId: e.clientId ||
|
|
236
|
+
o(i), y((te) => ({
|
|
237
|
+
...te,
|
|
238
|
+
[i]: {
|
|
239
|
+
origin: i,
|
|
240
|
+
reason: `broker:${N}`,
|
|
241
|
+
detail: f || null,
|
|
242
|
+
clientId: e.clientId || C.current[i] || null
|
|
236
243
|
}
|
|
237
244
|
}));
|
|
238
245
|
},
|
|
239
|
-
[
|
|
240
|
-
),
|
|
246
|
+
[M, m, o]
|
|
247
|
+
), B = R({});
|
|
241
248
|
k(() => {
|
|
242
|
-
Object.values(
|
|
243
|
-
e.status !== "broker" ||
|
|
244
|
-
delete
|
|
249
|
+
Object.values(p).forEach((e) => {
|
|
250
|
+
e.status !== "broker" || B.current[e.origin] || (B.current[e.origin] = !0, $(e).finally(() => {
|
|
251
|
+
delete B.current[e.origin];
|
|
245
252
|
}));
|
|
246
253
|
});
|
|
247
|
-
}, [
|
|
248
|
-
const
|
|
249
|
-
(e) => !
|
|
250
|
-
[
|
|
254
|
+
}, [p, $]);
|
|
255
|
+
const P = h(
|
|
256
|
+
(e) => !S.current || !(e != null && e.consent) ? Promise.resolve() : $(e, { approve: !0 }),
|
|
257
|
+
[$]
|
|
251
258
|
);
|
|
252
259
|
k(() => {
|
|
253
|
-
const e =
|
|
254
|
-
Object.values(
|
|
260
|
+
const e = G.current;
|
|
261
|
+
Object.values(p).forEach((t) => {
|
|
255
262
|
t.status === "silent" && !e[t.origin] && (e[t.origin] = setTimeout(() => {
|
|
256
|
-
delete e[t.origin],
|
|
263
|
+
delete e[t.origin], w(t.origin);
|
|
257
264
|
}, de));
|
|
258
265
|
}), Object.keys(e).forEach((t) => {
|
|
259
|
-
(!
|
|
266
|
+
(!p[t] || p[t].status !== "silent") && (clearTimeout(e[t]), delete e[t]);
|
|
260
267
|
});
|
|
261
|
-
}, [
|
|
262
|
-
|
|
268
|
+
}, [p, w]), k(() => () => {
|
|
269
|
+
O.current && O.current(), Object.values(G.current).forEach(clearTimeout);
|
|
263
270
|
}, []);
|
|
264
|
-
const
|
|
271
|
+
const q = h(
|
|
265
272
|
(e) => {
|
|
266
|
-
|
|
273
|
+
O.current && (O.current(), O.current = null);
|
|
267
274
|
const t = s || pe;
|
|
268
|
-
|
|
275
|
+
O.current = t(e, {
|
|
269
276
|
onBlocked: () => {
|
|
270
|
-
|
|
277
|
+
b((n) => n[e.origin] ? {
|
|
271
278
|
...n,
|
|
272
279
|
[e.origin]: { ...n[e.origin], popupBlocked: !0 }
|
|
273
280
|
} : n);
|
|
274
281
|
},
|
|
275
282
|
onClosed: () => {
|
|
276
283
|
if (e.v2) {
|
|
277
|
-
X &&
|
|
284
|
+
X && b((n) => !n[e.origin] || !n[e.origin].silentUrl ? n : {
|
|
278
285
|
...n,
|
|
279
286
|
[e.origin]: { ...n[e.origin], status: "silent" }
|
|
280
287
|
});
|
|
281
288
|
return;
|
|
282
289
|
}
|
|
283
|
-
|
|
290
|
+
l(e.origin);
|
|
284
291
|
}
|
|
285
292
|
});
|
|
286
293
|
},
|
|
287
|
-
[s,
|
|
294
|
+
[s, l]
|
|
288
295
|
), Z = {
|
|
289
296
|
// Hosts render UI for interactive entries only; silent resolution is
|
|
290
297
|
// invisible by design.
|
|
291
|
-
pending: Object.values(
|
|
298
|
+
pending: Object.values(p).filter(
|
|
292
299
|
(e) => e.status === "interactive"
|
|
293
300
|
),
|
|
294
|
-
authorize:
|
|
295
|
-
approve:
|
|
296
|
-
complete:
|
|
297
|
-
dismiss:
|
|
298
|
-
originEpochs:
|
|
299
|
-
credentials:
|
|
300
|
-
unsupported:
|
|
301
|
-
},
|
|
301
|
+
authorize: q,
|
|
302
|
+
approve: P,
|
|
303
|
+
complete: M,
|
|
304
|
+
dismiss: x,
|
|
305
|
+
originEpochs: j,
|
|
306
|
+
credentials: _,
|
|
307
|
+
unsupported: F
|
|
308
|
+
}, W = Object.values(p).filter(
|
|
302
309
|
(e) => e.status === "silent" && e.silentUrl
|
|
303
310
|
);
|
|
304
|
-
return /* @__PURE__ */
|
|
311
|
+
return /* @__PURE__ */ g.createElement(J.Provider, { value: Z }, r, W.map((e) => /* @__PURE__ */ g.createElement(
|
|
305
312
|
"iframe",
|
|
306
313
|
{
|
|
307
314
|
key: `mm-silent-auth-${e.origin}`,
|
|
@@ -314,8 +321,8 @@ const Y = oe(null), J = oe({
|
|
|
314
321
|
)));
|
|
315
322
|
};
|
|
316
323
|
ie.propTypes = {
|
|
317
|
-
children:
|
|
318
|
-
launcher:
|
|
324
|
+
children: T.node,
|
|
325
|
+
launcher: T.func,
|
|
319
326
|
/**
|
|
320
327
|
* `async (request, { approve }) => result` where request =
|
|
321
328
|
* `{ origin, clientId, scope, authUrl }` (origin is the zone-attested frame origin) and result
|
|
@@ -323,167 +330,169 @@ ie.propTypes = {
|
|
|
323
330
|
* client }`, `{ status: 409, consentRequired: true, client: { name, hostname }, stepUp }`, or
|
|
324
331
|
* `{ status, error }`. Provided only by hosts that are themselves first-party clients.
|
|
325
332
|
*/
|
|
326
|
-
broker:
|
|
333
|
+
broker: T.func
|
|
327
334
|
};
|
|
328
|
-
const
|
|
329
|
-
const { originEpochs: s } =
|
|
330
|
-
return
|
|
335
|
+
const he = () => K(J), ge = (r) => {
|
|
336
|
+
const { originEpochs: s } = K(J), c = Q(r);
|
|
337
|
+
return c && s[c] || 0;
|
|
331
338
|
}, me = (r) => {
|
|
332
|
-
const { credentials: s } =
|
|
333
|
-
return
|
|
339
|
+
const { credentials: s } = K(J), c = Q(r);
|
|
340
|
+
return c && s[c] || null;
|
|
334
341
|
}, be = (r) => {
|
|
335
|
-
const { unsupported: s } =
|
|
336
|
-
return
|
|
337
|
-
}, Ee = ({ children: r, authorizationLauncher: s, credentialBroker:
|
|
338
|
-
const [d,
|
|
339
|
-
var
|
|
340
|
-
return !!((
|
|
341
|
-
}, []),
|
|
342
|
-
|
|
343
|
-
}, []),
|
|
344
|
-
|
|
345
|
-
const
|
|
346
|
-
return delete
|
|
347
|
-
}),
|
|
348
|
-
const
|
|
349
|
-
return delete
|
|
350
|
-
}), delete
|
|
342
|
+
const { unsupported: s } = K(J), c = Q(r);
|
|
343
|
+
return c && s[c] || null;
|
|
344
|
+
}, Ee = ({ children: r, authorizationLauncher: s, credentialBroker: c }) => {
|
|
345
|
+
const [d, p] = U({}), [b, j] = U({}), I = R({}), _ = R({}), A = R({}), F = h((u, a) => {
|
|
346
|
+
var o;
|
|
347
|
+
return !!((o = A.current[u]) != null && o.has(a));
|
|
348
|
+
}, []), y = h((u, a, o) => {
|
|
349
|
+
p((l) => ({ ...l, [u]: { origin: a, frameRef: o } }));
|
|
350
|
+
}, []), H = h((u) => {
|
|
351
|
+
p((a) => {
|
|
352
|
+
const o = { ...a };
|
|
353
|
+
return delete o[u], o;
|
|
354
|
+
}), j((a) => {
|
|
355
|
+
const o = { ...a };
|
|
356
|
+
return delete o[u], o;
|
|
357
|
+
}), delete A.current[u];
|
|
351
358
|
}, []);
|
|
352
359
|
k(() => {
|
|
353
|
-
const
|
|
354
|
-
|
|
355
|
-
},
|
|
356
|
-
var
|
|
357
|
-
if (!((
|
|
360
|
+
const u = (o = [], l, w) => {
|
|
361
|
+
o.forEach((x) => x(l, w));
|
|
362
|
+
}, a = (o) => {
|
|
363
|
+
var $, B, P, q, Z, W, e;
|
|
364
|
+
if (!(($ = o == null ? void 0 : o.data) != null && $.instanceId))
|
|
358
365
|
return;
|
|
359
|
-
const { instanceId:
|
|
360
|
-
if (!
|
|
366
|
+
const { instanceId: l, type: w } = o.data, x = d[l], L = (P = (B = x == null ? void 0 : x.frameRef) == null ? void 0 : B.current) == null ? void 0 : P.contentWindow;
|
|
367
|
+
if (!L || o.source !== L || o.origin !== x.origin)
|
|
361
368
|
return;
|
|
362
|
-
const
|
|
363
|
-
if (
|
|
364
|
-
const { callbackId:
|
|
365
|
-
|
|
369
|
+
const M = { origin: o.origin }, m = I.current;
|
|
370
|
+
if (w === "response") {
|
|
371
|
+
const { callbackId: t, response: n, error: i } = o.data, f = _.current[t];
|
|
372
|
+
f && (f(n, i), delete _.current[t]);
|
|
366
373
|
return;
|
|
367
374
|
}
|
|
368
|
-
if (
|
|
369
|
-
const { requestType:
|
|
370
|
-
|
|
375
|
+
if (w === "mark-registered") {
|
|
376
|
+
const { requestType: t } = o.data;
|
|
377
|
+
A.current[l] || (A.current[l] = /* @__PURE__ */ new Set()), A.current[l].add(t);
|
|
371
378
|
return;
|
|
372
379
|
}
|
|
373
|
-
|
|
380
|
+
w === "ready" && j((t) => ({ ...t, [l]: !0 })), u((q = m[l]) == null ? void 0 : q[w], o.data, M), u((Z = m["*"]) == null ? void 0 : Z[w], o.data, M), u((W = m[l]) == null ? void 0 : W["*"], o.data, M), u((e = m["*"]) == null ? void 0 : e["*"], o.data, M);
|
|
374
381
|
};
|
|
375
|
-
return window.addEventListener("message",
|
|
376
|
-
window.removeEventListener("message",
|
|
382
|
+
return window.addEventListener("message", a), () => {
|
|
383
|
+
window.removeEventListener("message", a);
|
|
377
384
|
};
|
|
378
385
|
}, [d]);
|
|
379
|
-
const
|
|
380
|
-
(
|
|
381
|
-
var
|
|
382
|
-
const
|
|
383
|
-
if (!
|
|
384
|
-
console.warn(`Origin not set for id: ${
|
|
386
|
+
const E = h(
|
|
387
|
+
(u, a, o) => {
|
|
388
|
+
var w, x;
|
|
389
|
+
const l = d[u];
|
|
390
|
+
if (!l) {
|
|
391
|
+
console.warn(`Origin not set for id: ${u}. Unable to send message.`);
|
|
385
392
|
return;
|
|
386
393
|
}
|
|
387
|
-
(
|
|
388
|
-
{ type:
|
|
389
|
-
|
|
394
|
+
(x = (w = l == null ? void 0 : l.frameRef) == null ? void 0 : w.current) != null && x.contentWindow && l.frameRef.current.contentWindow.postMessage(
|
|
395
|
+
{ type: a, ...o, instanceId: u },
|
|
396
|
+
l.origin
|
|
390
397
|
);
|
|
391
398
|
},
|
|
392
399
|
[d]
|
|
393
|
-
),
|
|
394
|
-
async (
|
|
395
|
-
const
|
|
396
|
-
delete
|
|
400
|
+
), O = R(0), G = h(() => `${Date.now()}-${++O.current}`, []), C = h(
|
|
401
|
+
async (u, a, o = {}) => new Promise((l, w) => {
|
|
402
|
+
const x = G(), L = (M, m) => {
|
|
403
|
+
delete _.current[x], m ? w(m) : l(M);
|
|
397
404
|
};
|
|
398
|
-
|
|
405
|
+
_.current[x] = L, E(u, "request", { callbackId: x, requestType: a, data: o });
|
|
399
406
|
}),
|
|
400
|
-
[
|
|
401
|
-
),
|
|
402
|
-
(
|
|
403
|
-
|
|
407
|
+
[E]
|
|
408
|
+
), v = h(
|
|
409
|
+
(u, a) => {
|
|
410
|
+
E(u, "load-options", a);
|
|
404
411
|
},
|
|
405
|
-
[
|
|
406
|
-
),
|
|
407
|
-
(
|
|
408
|
-
|
|
412
|
+
[E]
|
|
413
|
+
), S = h(
|
|
414
|
+
(u, a) => {
|
|
415
|
+
E(u, "validate", a);
|
|
409
416
|
},
|
|
410
|
-
[
|
|
411
|
-
),
|
|
417
|
+
[E]
|
|
418
|
+
), z = ue(
|
|
412
419
|
() => ({
|
|
413
|
-
registerFrame:
|
|
414
|
-
unregisterFrame:
|
|
415
|
-
sendMessage:
|
|
416
|
-
sendRequest:
|
|
417
|
-
loadOptions:
|
|
418
|
-
validate:
|
|
419
|
-
hasHandler:
|
|
420
|
-
readyFrames:
|
|
421
|
-
addListener: (
|
|
422
|
-
|
|
420
|
+
registerFrame: y,
|
|
421
|
+
unregisterFrame: H,
|
|
422
|
+
sendMessage: E,
|
|
423
|
+
sendRequest: C,
|
|
424
|
+
loadOptions: v,
|
|
425
|
+
validate: S,
|
|
426
|
+
hasHandler: F,
|
|
427
|
+
readyFrames: b,
|
|
428
|
+
addListener: (u, a, o) => (I.current[u] || (I.current[u] = {}), I.current[u][a] || (I.current[u][a] = []), I.current[u][a].push(o), () => {
|
|
429
|
+
I.current[u][a] = I.current[u][a].filter((l) => l !== o);
|
|
423
430
|
})
|
|
424
431
|
}),
|
|
425
432
|
[
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
433
|
+
y,
|
|
434
|
+
H,
|
|
435
|
+
E,
|
|
436
|
+
C,
|
|
437
|
+
v,
|
|
438
|
+
S,
|
|
439
|
+
F,
|
|
440
|
+
b
|
|
434
441
|
]
|
|
435
442
|
);
|
|
436
|
-
return /* @__PURE__ */
|
|
437
|
-
}, V = (r, s,
|
|
438
|
-
const d =
|
|
443
|
+
return /* @__PURE__ */ g.createElement(Y.Provider, { value: z }, /* @__PURE__ */ g.createElement(ie, { launcher: s, broker: c }, r));
|
|
444
|
+
}, V = (r, s, c) => {
|
|
445
|
+
const d = K(Y);
|
|
439
446
|
if (d === null)
|
|
440
447
|
throw new Error(
|
|
441
448
|
"useEmbeddedEffect must be used within a MMEmbeddableZoneProvider"
|
|
442
449
|
);
|
|
443
|
-
const
|
|
450
|
+
const p = R(c);
|
|
444
451
|
k(() => {
|
|
445
|
-
|
|
446
|
-
}, [
|
|
452
|
+
p.current = c;
|
|
453
|
+
}, [c]), k(() => {
|
|
447
454
|
if (!(!r || !s)) {
|
|
448
455
|
if (s.startsWith("key:")) {
|
|
449
|
-
const
|
|
450
|
-
return d.readyFrames[r] && d.sendMessage(r, "subscribe-key", { keyChord:
|
|
456
|
+
const b = s.substring(4);
|
|
457
|
+
return d.readyFrames[r] && d.sendMessage(r, "subscribe-key", { keyChord: b }), d.addListener(
|
|
451
458
|
r,
|
|
452
|
-
`key-pressed:${
|
|
453
|
-
(...
|
|
459
|
+
`key-pressed:${b}`,
|
|
460
|
+
(...I) => p.current(...I)
|
|
454
461
|
);
|
|
455
462
|
}
|
|
456
463
|
return d.addListener(
|
|
457
464
|
r,
|
|
458
465
|
s,
|
|
459
|
-
(...
|
|
466
|
+
(...b) => p.current(...b)
|
|
460
467
|
);
|
|
461
468
|
}
|
|
462
469
|
}, [d, r, s]);
|
|
463
470
|
};
|
|
464
471
|
Ee.propTypes = {
|
|
465
|
-
children:
|
|
472
|
+
children: T.node.isRequired,
|
|
466
473
|
/**
|
|
467
474
|
* Optional interactive-step launcher for embedded authorizations,
|
|
468
475
|
* `(entry, { onBlocked, onClosed }) => cleanup`. Defaults to a top-level
|
|
469
476
|
* popup. Hosts that cannot open windows (Android WebView shells) drive
|
|
470
477
|
* their own UI from useEmbeddedAuthorizations() instead.
|
|
471
478
|
*/
|
|
472
|
-
authorizationLauncher:
|
|
479
|
+
authorizationLauncher: T.func,
|
|
473
480
|
/**
|
|
474
481
|
* Optional credential broker for hosts that are first-party MachineMetrics clients
|
|
475
482
|
* (`async (request, { approve }) => result`, see EmbeddedAuthorizationManager). When present,
|
|
476
483
|
* v2 credential requests are brokered server-side (no popup, no hidden frame) and consent is
|
|
477
484
|
* rendered natively by the host from the broker's `client` identity.
|
|
478
485
|
*/
|
|
479
|
-
credentialBroker:
|
|
486
|
+
credentialBroker: T.func
|
|
480
487
|
};
|
|
481
|
-
const
|
|
488
|
+
const ee = D.default || D, we = 1e4, ke = "credentials", Re = (r, s) => `${r}/mm-embedded-interop?id=${encodeURIComponent(s)}&origin=${encodeURIComponent(
|
|
489
|
+
window.location.origin
|
|
490
|
+
)}&caps=${ke}`, xe = ee.iframe`
|
|
482
491
|
width: 100%;
|
|
483
492
|
height: 100%;
|
|
484
493
|
border: none;
|
|
485
494
|
visibility: ${(r) => r.$isReady ? "visible" : "hidden"};
|
|
486
|
-
`,
|
|
495
|
+
`, Te = ee.div`
|
|
487
496
|
width: 100%;
|
|
488
497
|
height: 100%;
|
|
489
498
|
display: flex;
|
|
@@ -496,9 +505,9 @@ const N = D.default || D, we = 1e4, ke = "credentials", se = (r, s) => `${r}/mm-
|
|
|
496
505
|
text-align: center;
|
|
497
506
|
color: #555;
|
|
498
507
|
font-size: 14px;
|
|
499
|
-
`,
|
|
500
|
-
const s = r && r.origin || "This app",
|
|
501
|
-
switch (
|
|
508
|
+
`, Ie = (r) => {
|
|
509
|
+
const s = r && r.origin || "This app", c = r && r.reason || "";
|
|
510
|
+
switch (c) {
|
|
502
511
|
case "broker:scope_above_ceiling":
|
|
503
512
|
return {
|
|
504
513
|
title: `${s} can’t be authorized here`,
|
|
@@ -516,7 +525,7 @@ const N = D.default || D, we = 1e4, ke = "credentials", se = (r, s) => `${r}/mm-
|
|
|
516
525
|
detail: "It can’t be authorized for this account."
|
|
517
526
|
};
|
|
518
527
|
default:
|
|
519
|
-
return
|
|
528
|
+
return c.startsWith("broker:") ? {
|
|
520
529
|
title: `${s} can’t be authorized here`,
|
|
521
530
|
detail: "Authorization was refused."
|
|
522
531
|
} : {
|
|
@@ -525,143 +534,141 @@ const N = D.default || D, we = 1e4, ke = "credentials", se = (r, s) => `${r}/mm-
|
|
|
525
534
|
};
|
|
526
535
|
}
|
|
527
536
|
}, ce = ({ entry: r }) => {
|
|
528
|
-
const s =
|
|
529
|
-
return /* @__PURE__ */
|
|
537
|
+
const s = Ie(r);
|
|
538
|
+
return /* @__PURE__ */ g.createElement(Te, { "data-reason": r && r.reason || void 0 }, /* @__PURE__ */ g.createElement("div", { style: { fontWeight: 600 } }, s.title), /* @__PURE__ */ g.createElement("div", { style: { fontSize: 12, color: "#888" } }, s.detail));
|
|
530
539
|
};
|
|
531
540
|
ce.propTypes = {
|
|
532
|
-
entry:
|
|
533
|
-
origin:
|
|
534
|
-
name:
|
|
535
|
-
reason:
|
|
536
|
-
detail:
|
|
541
|
+
entry: T.shape({
|
|
542
|
+
origin: T.string,
|
|
543
|
+
name: T.string,
|
|
544
|
+
reason: T.string,
|
|
545
|
+
detail: T.object
|
|
537
546
|
})
|
|
538
547
|
};
|
|
539
|
-
const
|
|
548
|
+
const ze = ee.div`
|
|
540
549
|
height: 100%;
|
|
541
550
|
display: flex;
|
|
542
551
|
flex: 1;
|
|
543
552
|
align-items: center;
|
|
544
553
|
justify-content: center;
|
|
545
|
-
`,
|
|
554
|
+
`, Ue = () => /* @__PURE__ */ g.createElement(ze, null, /* @__PURE__ */ g.createElement("div", { style: { textAlign: "center" } }, "This app couldn’t be loaded as an embeddable widget.")), Ce = ({
|
|
546
555
|
id: r,
|
|
547
556
|
src: s,
|
|
548
|
-
path:
|
|
557
|
+
path: c,
|
|
549
558
|
onInit: d = () => {
|
|
550
559
|
},
|
|
551
|
-
onTimeout:
|
|
552
|
-
context:
|
|
553
|
-
params:
|
|
554
|
-
renderUnsupported:
|
|
555
|
-
renderTimeout:
|
|
556
|
-
...
|
|
560
|
+
onTimeout: p,
|
|
561
|
+
context: b = {},
|
|
562
|
+
params: j = {},
|
|
563
|
+
renderUnsupported: I,
|
|
564
|
+
renderTimeout: _,
|
|
565
|
+
...A
|
|
557
566
|
}) => {
|
|
558
|
-
if ("isConfiguring" in
|
|
567
|
+
if ("isConfiguring" in A)
|
|
559
568
|
return console.error(
|
|
560
569
|
"isConfiguring must be passed via the params prop to MMEmbeddableZone"
|
|
561
570
|
), null;
|
|
562
|
-
if ("colorMode" in
|
|
571
|
+
if ("colorMode" in b)
|
|
563
572
|
return console.error(
|
|
564
573
|
"colorMode must be passed via the params prop to MMEmbeddableZone"
|
|
565
574
|
), null;
|
|
566
|
-
if ("isFullScreen" in
|
|
575
|
+
if ("isFullScreen" in b)
|
|
567
576
|
return console.error(
|
|
568
577
|
"isFullScreen must be passed via the params prop to MMEmbeddableZone"
|
|
569
578
|
), null;
|
|
570
|
-
const
|
|
571
|
-
k(() => {
|
|
572
|
-
v > 0 && q(0);
|
|
573
|
-
}, [v]);
|
|
574
|
-
const { registerFrame: c, unregisterFrame: a, sendMessage: b } = H(
|
|
579
|
+
const F = R(), [y, H] = U(), [E, O] = U(0), [G, C] = U(!1), [v, S] = U(!1), z = ge(s), u = me(s), a = be(s), [o, l] = U(0), [w, x] = U(null), { registerFrame: L, unregisterFrame: M, sendMessage: m } = K(
|
|
575
580
|
Y
|
|
576
|
-
), [
|
|
581
|
+
), [$, B] = U(), P = R(), q = R(p), Z = R(d), W = R(!1), e = h(() => {
|
|
582
|
+
W.current = !1, clearTimeout(P.current), O(0), C(!1), S(!1), x(null);
|
|
583
|
+
}, []);
|
|
577
584
|
k(() => {
|
|
578
|
-
|
|
579
|
-
}, [
|
|
580
|
-
|
|
585
|
+
(z > 0 || o > 0) && e();
|
|
586
|
+
}, [z, o, e]), k(() => {
|
|
587
|
+
q.current = p;
|
|
588
|
+
}, [p]), k(() => {
|
|
589
|
+
Z.current = d;
|
|
581
590
|
}, [d]), k(() => {
|
|
582
|
-
|
|
591
|
+
E && m(r, "set-context", {
|
|
583
592
|
context: {
|
|
584
|
-
...
|
|
593
|
+
...b
|
|
585
594
|
}
|
|
586
595
|
});
|
|
587
|
-
}, [
|
|
588
|
-
|
|
589
|
-
}, [
|
|
590
|
-
|
|
591
|
-
}, [
|
|
592
|
-
|
|
593
|
-
}, [E,
|
|
594
|
-
if (!s || !r || !
|
|
596
|
+
}, [b, r, E]), k(() => {
|
|
597
|
+
E && m(r, "set-params", { params: j });
|
|
598
|
+
}, [j, r, E]), k(() => {
|
|
599
|
+
c !== void 0 && B((c == null ? void 0 : c.indexOf("/")) === 0 ? c : `/${c}`);
|
|
600
|
+
}, [c]), k(() => {
|
|
601
|
+
$ === void 0 || !E || m(r, "navigate", { path: $ });
|
|
602
|
+
}, [$, E, r, m]), k(() => {
|
|
603
|
+
if (!s || !r || !F)
|
|
595
604
|
return;
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
605
|
+
e();
|
|
606
|
+
const i = new URL(s);
|
|
607
|
+
return L(r, i.origin, F), Z.current(), H(Re(i.origin, r)), () => {
|
|
608
|
+
M(r);
|
|
599
609
|
};
|
|
600
|
-
}, [s, r,
|
|
601
|
-
if (!(!
|
|
602
|
-
return
|
|
603
|
-
|
|
604
|
-
}, we), () => clearTimeout(
|
|
605
|
-
}, [
|
|
606
|
-
const
|
|
607
|
-
W.current = !0, clearTimeout(
|
|
608
|
-
}, [])
|
|
609
|
-
V(r, "init", (
|
|
610
|
-
|
|
611
|
-
}), V(r, "authorize",
|
|
612
|
-
|
|
610
|
+
}, [s, r, L, F, e]), k(() => {
|
|
611
|
+
if (!(!y || W.current))
|
|
612
|
+
return P.current = setTimeout(() => {
|
|
613
|
+
C(!0), q.current && q.current();
|
|
614
|
+
}, we), () => clearTimeout(P.current);
|
|
615
|
+
}, [y, s, z, o]);
|
|
616
|
+
const t = h(() => {
|
|
617
|
+
W.current = !0, clearTimeout(P.current), C(!1);
|
|
618
|
+
}, []);
|
|
619
|
+
V(r, "init", (i) => {
|
|
620
|
+
t(), Array.isArray(i == null ? void 0 : i.acceptsCredentials) && x(i.acceptsCredentials);
|
|
621
|
+
}), V(r, "authorize", t), V(r, "login", t), V(r, "credential-request", () => {
|
|
622
|
+
t(), S(!0);
|
|
613
623
|
}), k(() => {
|
|
614
|
-
if (!
|
|
624
|
+
if (!v || !u)
|
|
615
625
|
return;
|
|
616
|
-
const
|
|
617
|
-
if (Array.isArray(
|
|
626
|
+
const i = w;
|
|
627
|
+
if (Array.isArray(i) && !i.includes(u.kind))
|
|
618
628
|
return;
|
|
619
|
-
const
|
|
620
|
-
|
|
621
|
-
}, [
|
|
622
|
-
|
|
629
|
+
const f = u.kind === "access_token" ? { accessToken: u.accessToken } : {};
|
|
630
|
+
m(r, "credential", { ...f, credential: u });
|
|
631
|
+
}, [v, u, w, r, m]), V(r, "ready", () => {
|
|
632
|
+
t(), O((i) => i + 1);
|
|
623
633
|
});
|
|
624
|
-
const
|
|
634
|
+
const n = R();
|
|
625
635
|
return V(r, "heartbeat", () => {
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
const t = new URL(s);
|
|
629
|
-
_.current.src = se(t.origin, r);
|
|
630
|
-
}
|
|
636
|
+
n.current && clearTimeout(n.current), n.current = setTimeout(() => {
|
|
637
|
+
l((i) => i + 1);
|
|
631
638
|
}, 6e3);
|
|
632
639
|
}), k(() => () => {
|
|
633
|
-
|
|
634
|
-
}, []),
|
|
635
|
-
|
|
640
|
+
n.current && clearTimeout(n.current);
|
|
641
|
+
}, []), a ? I ? I(a) : /* @__PURE__ */ g.createElement(ce, { entry: a }) : G && !E ? _ ? _() : /* @__PURE__ */ g.createElement(Ue, null) : /* @__PURE__ */ g.createElement(
|
|
642
|
+
xe,
|
|
636
643
|
{
|
|
637
|
-
key: `auth-epoch-${
|
|
638
|
-
$isReady:
|
|
639
|
-
ref:
|
|
640
|
-
src:
|
|
641
|
-
...
|
|
644
|
+
key: `auth-epoch-${z}-frame-${o}`,
|
|
645
|
+
$isReady: E,
|
|
646
|
+
ref: F,
|
|
647
|
+
src: y,
|
|
648
|
+
...A
|
|
642
649
|
}
|
|
643
650
|
);
|
|
644
651
|
};
|
|
645
|
-
|
|
646
|
-
id:
|
|
647
|
-
src:
|
|
648
|
-
path:
|
|
649
|
-
onInit:
|
|
650
|
-
onTimeout:
|
|
652
|
+
Ce.propTypes = {
|
|
653
|
+
id: T.string,
|
|
654
|
+
src: T.string.isRequired,
|
|
655
|
+
path: T.string,
|
|
656
|
+
onInit: T.func,
|
|
657
|
+
onTimeout: T.func,
|
|
651
658
|
/**
|
|
652
659
|
* Optional host-styled renderer for the structurally-unsupported embed
|
|
653
660
|
* state (legacy app on a cross-site origin), `(entry) => ReactNode`. Falls
|
|
654
661
|
* back to a minimal built-in placeholder.
|
|
655
662
|
*/
|
|
656
|
-
renderUnsupported:
|
|
663
|
+
renderUnsupported: T.func,
|
|
657
664
|
/**
|
|
658
665
|
* Optional host-styled renderer for the handshake-timeout failure state
|
|
659
666
|
* (the app is not embeddable / could not load), `() => ReactNode`. Falls
|
|
660
667
|
* back to a minimal centered message.
|
|
661
668
|
*/
|
|
662
|
-
renderTimeout:
|
|
669
|
+
renderTimeout: T.func
|
|
663
670
|
};
|
|
664
|
-
const
|
|
671
|
+
const Me = D.div`
|
|
665
672
|
position: fixed;
|
|
666
673
|
inset: 0;
|
|
667
674
|
background: rgba(0, 0, 0, 0.45);
|
|
@@ -669,7 +676,7 @@ const Ce = D.div`
|
|
|
669
676
|
align-items: center;
|
|
670
677
|
justify-content: center;
|
|
671
678
|
z-index: 10000;
|
|
672
|
-
`,
|
|
679
|
+
`, _e = D.div`
|
|
673
680
|
background: #fff;
|
|
674
681
|
border-radius: 8px;
|
|
675
682
|
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
|
|
@@ -678,13 +685,13 @@ const Ce = D.div`
|
|
|
678
685
|
max-width: calc(100vw - 32px);
|
|
679
686
|
font-family: sans-serif;
|
|
680
687
|
color: #222;
|
|
681
|
-
`,
|
|
688
|
+
`, Ae = D.div`
|
|
682
689
|
display: flex;
|
|
683
690
|
align-items: center;
|
|
684
691
|
justify-content: space-between;
|
|
685
692
|
padding: 10px 0;
|
|
686
693
|
gap: 16px;
|
|
687
|
-
`,
|
|
694
|
+
`, Oe = D.button`
|
|
688
695
|
background: #16a500;
|
|
689
696
|
color: #fff;
|
|
690
697
|
border: none;
|
|
@@ -697,24 +704,24 @@ const Ce = D.div`
|
|
|
697
704
|
color: #b3261e;
|
|
698
705
|
font-size: 13px;
|
|
699
706
|
margin: 4px 0 0;
|
|
700
|
-
`,
|
|
701
|
-
const { pending: r, authorize: s } =
|
|
702
|
-
return r.length === 0 ? null : /* @__PURE__ */
|
|
707
|
+
`, Fe = () => {
|
|
708
|
+
const { pending: r, authorize: s } = he();
|
|
709
|
+
return r.length === 0 ? null : /* @__PURE__ */ g.createElement(Me, null, /* @__PURE__ */ g.createElement(_e, null, /* @__PURE__ */ g.createElement("h3", { style: { margin: "0 0 8px" } }, "Authorization Required"), /* @__PURE__ */ g.createElement("p", { style: { margin: "0 0 12px", fontSize: 14, color: "#555" } }, "The following apps need you to sign in and authorize them before they can load."), r.map((c) => /* @__PURE__ */ g.createElement("div", { key: c.origin }, /* @__PURE__ */ g.createElement(Ae, null, /* @__PURE__ */ g.createElement("div", null, /* @__PURE__ */ g.createElement("div", { style: { fontWeight: 600 } }, c.origin)), /* @__PURE__ */ g.createElement(Oe, { onClick: () => s(c) }, "Authorize")), c.popupBlocked && /* @__PURE__ */ g.createElement(Le, null, "The sign-in window was blocked. Allow popups for this site, then try again.")))));
|
|
703
710
|
};
|
|
704
711
|
export {
|
|
705
|
-
|
|
712
|
+
ae as CREDENTIAL_KIND_ACCESS_TOKEN,
|
|
706
713
|
J as EmbeddedAuthorizationContext,
|
|
707
|
-
|
|
708
|
-
|
|
714
|
+
Fe as EmbeddedAuthorizationPrompt,
|
|
715
|
+
Ce as MMEmbeddableZone,
|
|
709
716
|
Y as MMEmbeddableZoneContext,
|
|
710
717
|
Ee as MMEmbeddableZoneProvider,
|
|
711
718
|
fe as isCrossSite,
|
|
712
|
-
|
|
719
|
+
re as normalizeCredential,
|
|
713
720
|
pe as popupAuthorizationLauncher,
|
|
714
|
-
|
|
715
|
-
|
|
721
|
+
Ie as unsupportedCopy,
|
|
722
|
+
he as useEmbeddedAuthorizations,
|
|
716
723
|
me as useEmbeddedCredential,
|
|
717
724
|
V as useEmbeddedEffect,
|
|
718
|
-
|
|
725
|
+
ge as useEmbeddedOriginEpoch,
|
|
719
726
|
be as useEmbeddedUnsupported
|
|
720
727
|
};
|