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