@ikonai/sdk-react-ui 1.0.70 → 1.0.71
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/index.d.ts +0 -1
- package/index.js +802 -913
- package/package.json +1 -1
- package/modules.d.ts +0 -15
package/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { IkonUiCore as
|
|
2
|
-
import { UiStreamStore as
|
|
3
|
-
import
|
|
4
|
-
import { createLogger as oe, isInspectModeEnabled as
|
|
5
|
-
import { randomUuid as
|
|
6
|
-
var
|
|
1
|
+
import { IkonUiCore as Sn, UiStreamStore as wn, LiveSnapshotCache as Ut, prefetchBootSnapshot as vn } from "@ikonai/sdk-ui";
|
|
2
|
+
import { UiStreamStore as Bs } from "@ikonai/sdk-ui";
|
|
3
|
+
import En, { useSyncExternalStore as ot, useMemo as W, memo as G, useRef as E, useCallback as j, Fragment as Rn, useEffect as C, useState as x, use as st, createContext as Mt, useReducer as An } from "react";
|
|
4
|
+
import { createLogger as oe, isInspectModeEnabled as Tn, getOrCreateDeviceId as kn, getSameOriginAuthUrl as Cn, abortSignalTimeout as Dt, deriveAuthUrl as ve, getDebugOverlayParam as In, subscribeToLogEvents as jt, LogLevel as Je, parseUrlParams as _n, clearSessionParamsFromUrl as On, isCloudEnvironment as ht, extractUserIdFromToken as pt, deriveBackendType as mt, IkonClient as xn, AccessDeniedError as Nn, ServerFullError as Ln, AuthenticationError as Pn, isDebugModeEnabled as $t, getLangParam as Un } from "@ikonai/sdk";
|
|
5
|
+
import { randomUuid as Vs } from "@ikonai/sdk";
|
|
6
|
+
var Ce = { exports: {} }, ge = {};
|
|
7
7
|
/**
|
|
8
8
|
* @license React
|
|
9
9
|
* react-jsx-runtime.production.js
|
|
@@ -13,10 +13,10 @@ var Ie = { exports: {} }, ge = {};
|
|
|
13
13
|
* This source code is licensed under the MIT license found in the
|
|
14
14
|
* LICENSE file in the root directory of this source tree.
|
|
15
15
|
*/
|
|
16
|
-
var
|
|
17
|
-
function
|
|
18
|
-
if (
|
|
19
|
-
|
|
16
|
+
var gt;
|
|
17
|
+
function Mn() {
|
|
18
|
+
if (gt) return ge;
|
|
19
|
+
gt = 1;
|
|
20
20
|
var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
|
|
21
21
|
function n(r, o, s) {
|
|
22
22
|
var i = null;
|
|
@@ -45,15 +45,15 @@ var ye = {};
|
|
|
45
45
|
* This source code is licensed under the MIT license found in the
|
|
46
46
|
* LICENSE file in the root directory of this source tree.
|
|
47
47
|
*/
|
|
48
|
-
var
|
|
49
|
-
function
|
|
50
|
-
return
|
|
51
|
-
function t(
|
|
52
|
-
if (
|
|
53
|
-
if (typeof
|
|
54
|
-
return
|
|
55
|
-
if (typeof
|
|
56
|
-
switch (
|
|
48
|
+
var yt;
|
|
49
|
+
function Dn() {
|
|
50
|
+
return yt || (yt = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
51
|
+
function t(d) {
|
|
52
|
+
if (d == null) return null;
|
|
53
|
+
if (typeof d == "function")
|
|
54
|
+
return d.$$typeof === P ? null : d.displayName || d.name || null;
|
|
55
|
+
if (typeof d == "string") return d;
|
|
56
|
+
switch (d) {
|
|
57
57
|
case p:
|
|
58
58
|
return "Fragment";
|
|
59
59
|
case S:
|
|
@@ -67,133 +67,133 @@ function Wn() {
|
|
|
67
67
|
case _:
|
|
68
68
|
return "Activity";
|
|
69
69
|
}
|
|
70
|
-
if (typeof
|
|
71
|
-
switch (typeof
|
|
70
|
+
if (typeof d == "object")
|
|
71
|
+
switch (typeof d.tag == "number" && console.error(
|
|
72
72
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
73
|
-
),
|
|
73
|
+
), d.$$typeof) {
|
|
74
74
|
case g:
|
|
75
75
|
return "Portal";
|
|
76
76
|
case v:
|
|
77
|
-
return
|
|
77
|
+
return d.displayName || "Context";
|
|
78
78
|
case R:
|
|
79
|
-
return (
|
|
79
|
+
return (d._context.displayName || "Context") + ".Consumer";
|
|
80
80
|
case T:
|
|
81
|
-
var A =
|
|
82
|
-
return
|
|
81
|
+
var A = d.render;
|
|
82
|
+
return d = d.displayName, d || (d = A.displayName || A.name || "", d = d !== "" ? "ForwardRef(" + d + ")" : "ForwardRef"), d;
|
|
83
83
|
case te:
|
|
84
|
-
return A =
|
|
84
|
+
return A = d.displayName || null, A !== null ? A : t(d.type) || "Memo";
|
|
85
85
|
case z:
|
|
86
|
-
A =
|
|
86
|
+
A = d._payload, d = d._init;
|
|
87
87
|
try {
|
|
88
|
-
return t(
|
|
88
|
+
return t(d(A));
|
|
89
89
|
} catch {
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
return null;
|
|
93
93
|
}
|
|
94
|
-
function e(
|
|
95
|
-
return "" +
|
|
94
|
+
function e(d) {
|
|
95
|
+
return "" + d;
|
|
96
96
|
}
|
|
97
|
-
function n(
|
|
97
|
+
function n(d) {
|
|
98
98
|
try {
|
|
99
|
-
e(
|
|
99
|
+
e(d);
|
|
100
100
|
var A = !1;
|
|
101
101
|
} catch {
|
|
102
102
|
A = !0;
|
|
103
103
|
}
|
|
104
104
|
if (A) {
|
|
105
105
|
A = console;
|
|
106
|
-
var O = A.error,
|
|
106
|
+
var O = A.error, N = typeof Symbol == "function" && Symbol.toStringTag && d[Symbol.toStringTag] || d.constructor.name || "Object";
|
|
107
107
|
return O.call(
|
|
108
108
|
A,
|
|
109
109
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
110
|
-
|
|
111
|
-
), e(
|
|
110
|
+
N
|
|
111
|
+
), e(d);
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
function r(
|
|
115
|
-
if (
|
|
116
|
-
if (typeof
|
|
114
|
+
function r(d) {
|
|
115
|
+
if (d === p) return "<>";
|
|
116
|
+
if (typeof d == "object" && d !== null && d.$$typeof === z)
|
|
117
117
|
return "<...>";
|
|
118
118
|
try {
|
|
119
|
-
var A = t(
|
|
119
|
+
var A = t(d);
|
|
120
120
|
return A ? "<" + A + ">" : "<...>";
|
|
121
121
|
} catch {
|
|
122
122
|
return "<...>";
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
function o() {
|
|
126
|
-
var
|
|
127
|
-
return
|
|
126
|
+
var d = M.A;
|
|
127
|
+
return d === null ? null : d.getOwner();
|
|
128
128
|
}
|
|
129
129
|
function s() {
|
|
130
130
|
return Error("react-stack-top-frame");
|
|
131
131
|
}
|
|
132
|
-
function i(
|
|
133
|
-
if (B.call(
|
|
134
|
-
var A = Object.getOwnPropertyDescriptor(
|
|
132
|
+
function i(d) {
|
|
133
|
+
if (B.call(d, "key")) {
|
|
134
|
+
var A = Object.getOwnPropertyDescriptor(d, "key").get;
|
|
135
135
|
if (A && A.isReactWarning) return !1;
|
|
136
136
|
}
|
|
137
|
-
return
|
|
137
|
+
return d.key !== void 0;
|
|
138
138
|
}
|
|
139
|
-
function a(
|
|
139
|
+
function a(d, A) {
|
|
140
140
|
function O() {
|
|
141
141
|
K || (K = !0, console.error(
|
|
142
142
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
143
143
|
A
|
|
144
144
|
));
|
|
145
145
|
}
|
|
146
|
-
O.isReactWarning = !0, Object.defineProperty(
|
|
146
|
+
O.isReactWarning = !0, Object.defineProperty(d, "key", {
|
|
147
147
|
get: O,
|
|
148
148
|
configurable: !0
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
151
|
function l() {
|
|
152
|
-
var
|
|
153
|
-
return H[
|
|
152
|
+
var d = t(this.type);
|
|
153
|
+
return H[d] || (H[d] = !0, console.error(
|
|
154
154
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
155
|
-
)),
|
|
155
|
+
)), d = this.props.ref, d !== void 0 ? d : null;
|
|
156
156
|
}
|
|
157
|
-
function d
|
|
157
|
+
function h(d, A, O, N, se, me) {
|
|
158
158
|
var L = O.ref;
|
|
159
|
-
return
|
|
159
|
+
return d = {
|
|
160
160
|
$$typeof: u,
|
|
161
|
-
type:
|
|
161
|
+
type: d,
|
|
162
162
|
key: A,
|
|
163
163
|
props: O,
|
|
164
|
-
_owner:
|
|
165
|
-
}, (L !== void 0 ? L : null) !== null ? Object.defineProperty(
|
|
164
|
+
_owner: N
|
|
165
|
+
}, (L !== void 0 ? L : null) !== null ? Object.defineProperty(d, "ref", {
|
|
166
166
|
enumerable: !1,
|
|
167
167
|
get: l
|
|
168
|
-
}) : Object.defineProperty(
|
|
168
|
+
}) : Object.defineProperty(d, "ref", { enumerable: !1, value: null }), d._store = {}, Object.defineProperty(d._store, "validated", {
|
|
169
169
|
configurable: !1,
|
|
170
170
|
enumerable: !1,
|
|
171
171
|
writable: !0,
|
|
172
172
|
value: 0
|
|
173
|
-
}), Object.defineProperty(
|
|
173
|
+
}), Object.defineProperty(d, "_debugInfo", {
|
|
174
174
|
configurable: !1,
|
|
175
175
|
enumerable: !1,
|
|
176
176
|
writable: !0,
|
|
177
177
|
value: null
|
|
178
|
-
}), Object.defineProperty(
|
|
178
|
+
}), Object.defineProperty(d, "_debugStack", {
|
|
179
179
|
configurable: !1,
|
|
180
180
|
enumerable: !1,
|
|
181
181
|
writable: !0,
|
|
182
182
|
value: se
|
|
183
|
-
}), Object.defineProperty(
|
|
183
|
+
}), Object.defineProperty(d, "_debugTask", {
|
|
184
184
|
configurable: !1,
|
|
185
185
|
enumerable: !1,
|
|
186
186
|
writable: !0,
|
|
187
187
|
value: me
|
|
188
|
-
}), Object.freeze && (Object.freeze(
|
|
188
|
+
}), Object.freeze && (Object.freeze(d.props), Object.freeze(d)), d;
|
|
189
189
|
}
|
|
190
|
-
function
|
|
190
|
+
function f(d, A, O, N, se, me) {
|
|
191
191
|
var L = A.children;
|
|
192
192
|
if (L !== void 0)
|
|
193
|
-
if (
|
|
193
|
+
if (N)
|
|
194
194
|
if ($(L)) {
|
|
195
|
-
for (
|
|
196
|
-
y(L[
|
|
195
|
+
for (N = 0; N < L.length; N++)
|
|
196
|
+
y(L[N]);
|
|
197
197
|
Object.freeze && Object.freeze(L);
|
|
198
198
|
} else
|
|
199
199
|
console.error(
|
|
@@ -201,22 +201,22 @@ function Wn() {
|
|
|
201
201
|
);
|
|
202
202
|
else y(L);
|
|
203
203
|
if (B.call(A, "key")) {
|
|
204
|
-
L = t(
|
|
205
|
-
var Q = Object.keys(A).filter(function(
|
|
206
|
-
return
|
|
204
|
+
L = t(d);
|
|
205
|
+
var Q = Object.keys(A).filter(function(Me) {
|
|
206
|
+
return Me !== "key";
|
|
207
207
|
});
|
|
208
|
-
|
|
208
|
+
N = 0 < Q.length ? "{key: someKey, " + Q.join(": ..., ") + ": ...}" : "{key: someKey}", pe[L + N] || (Q = 0 < Q.length ? "{" + Q.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
209
209
|
`A props object containing a "key" prop is being spread into JSX:
|
|
210
210
|
let props = %s;
|
|
211
211
|
<%s {...props} />
|
|
212
212
|
React keys must be passed directly to JSX without using spread:
|
|
213
213
|
let props = %s;
|
|
214
214
|
<%s key={someKey} {...props} />`,
|
|
215
|
-
|
|
215
|
+
N,
|
|
216
216
|
L,
|
|
217
217
|
Q,
|
|
218
218
|
L
|
|
219
|
-
), pe[L +
|
|
219
|
+
), pe[L + N] = !0);
|
|
220
220
|
}
|
|
221
221
|
if (L = null, O !== void 0 && (n(O), L = "" + O), i(A) && (n(A.key), L = "" + A.key), "key" in A) {
|
|
222
222
|
O = {};
|
|
@@ -225,9 +225,9 @@ React keys must be passed directly to JSX without using spread:
|
|
|
225
225
|
} else O = A;
|
|
226
226
|
return L && a(
|
|
227
227
|
O,
|
|
228
|
-
typeof
|
|
229
|
-
),
|
|
230
|
-
|
|
228
|
+
typeof d == "function" ? d.displayName || d.name || "Unknown" : d
|
|
229
|
+
), h(
|
|
230
|
+
d,
|
|
231
231
|
L,
|
|
232
232
|
O,
|
|
233
233
|
o(),
|
|
@@ -235,54 +235,54 @@ React keys must be passed directly to JSX without using spread:
|
|
|
235
235
|
me
|
|
236
236
|
);
|
|
237
237
|
}
|
|
238
|
-
function y(
|
|
239
|
-
m(
|
|
238
|
+
function y(d) {
|
|
239
|
+
m(d) ? d._store && (d._store.validated = 1) : typeof d == "object" && d !== null && d.$$typeof === z && (d._payload.status === "fulfilled" ? m(d._payload.value) && d._payload.value._store && (d._payload.value._store.validated = 1) : d._store && (d._store.validated = 1));
|
|
240
240
|
}
|
|
241
|
-
function m(
|
|
242
|
-
return typeof
|
|
241
|
+
function m(d) {
|
|
242
|
+
return typeof d == "object" && d !== null && d.$$typeof === u;
|
|
243
243
|
}
|
|
244
|
-
var c =
|
|
244
|
+
var c = En, u = Symbol.for("react.transitional.element"), g = Symbol.for("react.portal"), p = Symbol.for("react.fragment"), b = Symbol.for("react.strict_mode"), S = Symbol.for("react.profiler"), R = Symbol.for("react.consumer"), v = Symbol.for("react.context"), T = Symbol.for("react.forward_ref"), U = Symbol.for("react.suspense"), ee = Symbol.for("react.suspense_list"), te = Symbol.for("react.memo"), z = Symbol.for("react.lazy"), _ = Symbol.for("react.activity"), P = Symbol.for("react.client.reference"), M = c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, B = Object.prototype.hasOwnProperty, $ = Array.isArray, V = console.createTask ? console.createTask : function() {
|
|
245
245
|
return null;
|
|
246
246
|
};
|
|
247
247
|
c = {
|
|
248
|
-
react_stack_bottom_frame: function(
|
|
249
|
-
return
|
|
248
|
+
react_stack_bottom_frame: function(d) {
|
|
249
|
+
return d();
|
|
250
250
|
}
|
|
251
251
|
};
|
|
252
|
-
var K, H = {},
|
|
252
|
+
var K, H = {}, Ee = c.react_stack_bottom_frame.bind(
|
|
253
253
|
c,
|
|
254
254
|
s
|
|
255
|
-
)(),
|
|
256
|
-
ye.Fragment = p, ye.jsx = function(
|
|
257
|
-
var
|
|
258
|
-
return
|
|
259
|
-
|
|
255
|
+
)(), Re = V(r(s)), pe = {};
|
|
256
|
+
ye.Fragment = p, ye.jsx = function(d, A, O) {
|
|
257
|
+
var N = 1e4 > M.recentlyCreatedOwnerStacks++;
|
|
258
|
+
return f(
|
|
259
|
+
d,
|
|
260
260
|
A,
|
|
261
261
|
O,
|
|
262
262
|
!1,
|
|
263
|
-
|
|
264
|
-
|
|
263
|
+
N ? Error("react-stack-top-frame") : Ee,
|
|
264
|
+
N ? V(r(d)) : Re
|
|
265
265
|
);
|
|
266
|
-
}, ye.jsxs = function(
|
|
267
|
-
var
|
|
268
|
-
return
|
|
269
|
-
|
|
266
|
+
}, ye.jsxs = function(d, A, O) {
|
|
267
|
+
var N = 1e4 > M.recentlyCreatedOwnerStacks++;
|
|
268
|
+
return f(
|
|
269
|
+
d,
|
|
270
270
|
A,
|
|
271
271
|
O,
|
|
272
272
|
!0,
|
|
273
|
-
|
|
274
|
-
|
|
273
|
+
N ? Error("react-stack-top-frame") : Ee,
|
|
274
|
+
N ? V(r(d)) : Re
|
|
275
275
|
);
|
|
276
276
|
};
|
|
277
277
|
})()), ye;
|
|
278
278
|
}
|
|
279
|
-
var
|
|
280
|
-
function
|
|
281
|
-
return
|
|
279
|
+
var bt;
|
|
280
|
+
function jn() {
|
|
281
|
+
return bt || (bt = 1, process.env.NODE_ENV === "production" ? Ce.exports = Mn() : Ce.exports = Dn()), Ce.exports;
|
|
282
282
|
}
|
|
283
|
-
var w =
|
|
284
|
-
function
|
|
285
|
-
const n =
|
|
283
|
+
var w = jn();
|
|
284
|
+
function $n(t, e) {
|
|
285
|
+
const n = ot(
|
|
286
286
|
(r) => t.subscribe(r),
|
|
287
287
|
() => {
|
|
288
288
|
const r = t.getSnapshot(), o = e ?? r.rootViewId, s = o ? r.views.get(o) : void 0;
|
|
@@ -302,15 +302,15 @@ function Gn(t, e) {
|
|
|
302
302
|
}, [n]);
|
|
303
303
|
}
|
|
304
304
|
function Z(t, e) {
|
|
305
|
-
const n =
|
|
305
|
+
const n = ot(
|
|
306
306
|
(r) => t.subscribeNode(e, r),
|
|
307
307
|
() => t.getNodeVersion(e),
|
|
308
308
|
() => t.getNodeVersion(e)
|
|
309
309
|
);
|
|
310
310
|
return W(() => t.getNode(e), [t, e, n]);
|
|
311
311
|
}
|
|
312
|
-
const
|
|
313
|
-
function
|
|
312
|
+
const Bn = oe("UIRenderer");
|
|
313
|
+
function Fn(t) {
|
|
314
314
|
if (t === void 0)
|
|
315
315
|
return "{}";
|
|
316
316
|
if (typeof t == "string")
|
|
@@ -321,18 +321,18 @@ function zn(t) {
|
|
|
321
321
|
return "{}";
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function Vn(t) {
|
|
325
325
|
const e = t.styleIds;
|
|
326
326
|
return Array.isArray(e) ? e : [];
|
|
327
327
|
}
|
|
328
|
-
function
|
|
328
|
+
function Wn(t) {
|
|
329
329
|
const e = t.children;
|
|
330
330
|
return Array.isArray(e) ? e : [];
|
|
331
331
|
}
|
|
332
|
-
function
|
|
332
|
+
function Kn(t, e) {
|
|
333
333
|
return t.nodeId === e.nodeId && t.context === e.context;
|
|
334
334
|
}
|
|
335
|
-
function
|
|
335
|
+
function Yn(t) {
|
|
336
336
|
if (t.length === 0) return "";
|
|
337
337
|
if (t.length === 1) return t[0].id;
|
|
338
338
|
let e = t[0].id;
|
|
@@ -340,8 +340,8 @@ function Jn(t) {
|
|
|
340
340
|
e += "," + t[n].id;
|
|
341
341
|
return e;
|
|
342
342
|
}
|
|
343
|
-
const
|
|
344
|
-
const r = Z(n.store, e), o = r ?
|
|
343
|
+
const Ze = G(function t({ nodeId: e, context: n }) {
|
|
344
|
+
const r = Z(n.store, e), o = r ? Wn(r) : [], s = Yn(o), i = W(
|
|
345
345
|
() => o.length === 0 ? null : o.map((y) => /* @__PURE__ */ w.jsx(t, { nodeId: y.id, context: n }, y.id)),
|
|
346
346
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
347
347
|
[s, n]
|
|
@@ -349,31 +349,31 @@ const et = Y(function t({ nodeId: e, context: n }) {
|
|
|
349
349
|
if (!r)
|
|
350
350
|
return null;
|
|
351
351
|
if (r.type === "root")
|
|
352
|
-
return /* @__PURE__ */ w.jsx(
|
|
352
|
+
return /* @__PURE__ */ w.jsx(Rn, { children: i }, r.id);
|
|
353
353
|
const a = n.library.resolve(r);
|
|
354
354
|
if (!a)
|
|
355
|
-
return
|
|
356
|
-
const l =
|
|
357
|
-
return /* @__PURE__ */ w.jsx(
|
|
358
|
-
},
|
|
359
|
-
function
|
|
360
|
-
return !Array.isArray(t) || t.length === 0 ? null : t.map((n) => /* @__PURE__ */ w.jsx(
|
|
355
|
+
return Bn.warn(`No renderer for node type ${r.type}`), null;
|
|
356
|
+
const l = Vn(r), h = l.length > 0 ? l.join(" ") : void 0, f = a;
|
|
357
|
+
return /* @__PURE__ */ w.jsx(f, { nodeId: e, context: n, className: h });
|
|
358
|
+
}, Kn);
|
|
359
|
+
function Gn(t, e) {
|
|
360
|
+
return !Array.isArray(t) || t.length === 0 ? null : t.map((n) => /* @__PURE__ */ w.jsx(Ze, { nodeId: n.id, context: e }, n.id));
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function zn(t, e) {
|
|
363
363
|
return t.store === e.store && t.library === e.library && t.viewId === e.viewId && t.emptyFallback === e.emptyFallback;
|
|
364
364
|
}
|
|
365
|
-
const
|
|
366
|
-
const { rootViewId: l, rootNodeId:
|
|
367
|
-
|
|
365
|
+
const Xn = G(function({ store: e, library: n, viewId: r, emptyFallback: o = null, onAction: s, client: i, video: a }) {
|
|
366
|
+
const { rootViewId: l, rootNodeId: h } = $n(e, r), f = E(s);
|
|
367
|
+
f.current = s;
|
|
368
368
|
const y = E(i);
|
|
369
369
|
y.current = i;
|
|
370
370
|
const m = E(a);
|
|
371
371
|
m.current = a;
|
|
372
|
-
const c =
|
|
372
|
+
const c = j((g, p) => {
|
|
373
373
|
if (!g)
|
|
374
374
|
return;
|
|
375
|
-
const b =
|
|
376
|
-
|
|
375
|
+
const b = Fn(p);
|
|
376
|
+
f.current?.(g, b);
|
|
377
377
|
}, []), u = W(() => {
|
|
378
378
|
const g = {
|
|
379
379
|
store: e,
|
|
@@ -381,10 +381,10 @@ const er = Y(function({ store: e, library: n, viewId: r, emptyFallback: o = null
|
|
|
381
381
|
handlerCache: e.handlerCache,
|
|
382
382
|
// Access payloads from store at call time, not captured snapshot
|
|
383
383
|
getPayload: (p) => e.getSnapshot().payloads.get(p),
|
|
384
|
-
renderChildren: (p) =>
|
|
384
|
+
renderChildren: (p) => Gn(p, g),
|
|
385
385
|
renderView: (p) => {
|
|
386
386
|
const b = e.getSnapshot().views.get(p);
|
|
387
|
-
return b ? /* @__PURE__ */ w.jsx(
|
|
387
|
+
return b ? /* @__PURE__ */ w.jsx(Ze, { nodeId: b.id, context: g }) : null;
|
|
388
388
|
},
|
|
389
389
|
dispatchAction: c,
|
|
390
390
|
// Access client/video via refs to avoid context recreation
|
|
@@ -397,9 +397,9 @@ const er = Y(function({ store: e, library: n, viewId: r, emptyFallback: o = null
|
|
|
397
397
|
};
|
|
398
398
|
return g;
|
|
399
399
|
}, [e, n, c]);
|
|
400
|
-
return !l || !
|
|
401
|
-
},
|
|
402
|
-
class
|
|
400
|
+
return !l || !h ? o : /* @__PURE__ */ w.jsx("div", { "data-ikon-view-id": l, style: { display: "contents" }, children: /* @__PURE__ */ w.jsx(Ze, { nodeId: h, context: u }) });
|
|
401
|
+
}, zn);
|
|
402
|
+
class Hn {
|
|
403
403
|
constructor(e, n) {
|
|
404
404
|
if (this.fallback = n, e)
|
|
405
405
|
for (const [r, o] of e)
|
|
@@ -416,19 +416,19 @@ class tr {
|
|
|
416
416
|
return this.renderers.get(e.type) ?? this.fallback;
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
|
-
function
|
|
419
|
+
function Ts(t, e) {
|
|
420
420
|
const n = Object.entries(t);
|
|
421
|
-
return new
|
|
421
|
+
return new Hn(n, e);
|
|
422
422
|
}
|
|
423
|
-
function
|
|
424
|
-
return
|
|
423
|
+
function ks(t) {
|
|
424
|
+
return ot(
|
|
425
425
|
(e) => t.subscribe(e),
|
|
426
426
|
() => t.getSnapshot(),
|
|
427
427
|
() => t.getSnapshot()
|
|
428
428
|
);
|
|
429
429
|
}
|
|
430
|
-
function
|
|
431
|
-
const t =
|
|
430
|
+
function qn() {
|
|
431
|
+
const t = Tn();
|
|
432
432
|
return C(() => {
|
|
433
433
|
if (!t)
|
|
434
434
|
return;
|
|
@@ -465,7 +465,7 @@ function nr() {
|
|
|
465
465
|
return;
|
|
466
466
|
c.relatedTarget?.closest?.("[data-ikon-source]") !== n && s();
|
|
467
467
|
}
|
|
468
|
-
function
|
|
468
|
+
function h(c) {
|
|
469
469
|
if (!e)
|
|
470
470
|
return;
|
|
471
471
|
const u = c.target.closest?.("[data-ikon-source]");
|
|
@@ -479,7 +479,7 @@ function nr() {
|
|
|
479
479
|
};
|
|
480
480
|
window.dispatchEvent(new CustomEvent("ikon-inspect-select", { detail: g })), window.parent.postMessage({ type: "ikon-element-selected", payload: g }, "*");
|
|
481
481
|
}
|
|
482
|
-
function
|
|
482
|
+
function f(c, u) {
|
|
483
483
|
return document.elementFromPoint(c, u)?.closest?.("[data-ikon-source]");
|
|
484
484
|
}
|
|
485
485
|
function y(c) {
|
|
@@ -498,7 +498,7 @@ function nr() {
|
|
|
498
498
|
return;
|
|
499
499
|
}
|
|
500
500
|
if (c.data?.type === "ikon-inspect-at") {
|
|
501
|
-
const u =
|
|
501
|
+
const u = f(c.data.x, c.data.y);
|
|
502
502
|
y(u);
|
|
503
503
|
const g = u?.getAttribute("data-ikon-source") ?? "";
|
|
504
504
|
window.parent.postMessage({
|
|
@@ -507,7 +507,7 @@ function nr() {
|
|
|
507
507
|
}, "*");
|
|
508
508
|
}
|
|
509
509
|
if (c.data?.type === "ikon-inspect-click") {
|
|
510
|
-
const u =
|
|
510
|
+
const u = f(c.data.x, c.data.y);
|
|
511
511
|
if (u) {
|
|
512
512
|
const g = {
|
|
513
513
|
sourceMarker: u.getAttribute("data-ikon-source") ?? "",
|
|
@@ -518,7 +518,7 @@ function nr() {
|
|
|
518
518
|
}
|
|
519
519
|
}
|
|
520
520
|
if (c.data?.type === "ikon-inspect-click-add") {
|
|
521
|
-
const u =
|
|
521
|
+
const u = f(c.data.x, c.data.y);
|
|
522
522
|
if (u) {
|
|
523
523
|
const g = {
|
|
524
524
|
sourceMarker: u.getAttribute("data-ikon-source") ?? "",
|
|
@@ -548,40 +548,40 @@ function nr() {
|
|
|
548
548
|
}
|
|
549
549
|
c.data?.type === "ikon-inspect-highlight" && i(c.data.markers ?? []), c.data?.type === "ikon-inspect-clear" && s();
|
|
550
550
|
}
|
|
551
|
-
return document.addEventListener("mouseover", a, !0), document.addEventListener("mouseout", l, !0), document.addEventListener("click",
|
|
552
|
-
document.removeEventListener("mouseover", a, !0), document.removeEventListener("mouseout", l, !0), document.removeEventListener("click",
|
|
551
|
+
return document.addEventListener("mouseover", a, !0), document.addEventListener("mouseout", l, !0), document.addEventListener("click", h, !0), window.addEventListener("message", m), () => {
|
|
552
|
+
document.removeEventListener("mouseover", a, !0), document.removeEventListener("mouseout", l, !0), document.removeEventListener("click", h, !0), window.removeEventListener("message", m), s(), i([]), o.remove();
|
|
553
553
|
};
|
|
554
554
|
}, [t]), null;
|
|
555
555
|
}
|
|
556
|
-
const
|
|
557
|
-
function
|
|
556
|
+
const Jn = oe("IkonUiSurface"), Qe = "ikon-ui";
|
|
557
|
+
function Zn(t, e) {
|
|
558
558
|
return t === e;
|
|
559
559
|
}
|
|
560
|
-
const
|
|
560
|
+
const Bt = G(function({ stores: e, registry: n, category: r = Qe, onAction: o, client: s }) {
|
|
561
561
|
const i = W(() => Array.from(e.keys()).sort().join(","), [e]), a = E(o);
|
|
562
562
|
a.current = o;
|
|
563
563
|
const l = E(s);
|
|
564
564
|
l.current = s;
|
|
565
|
-
const
|
|
565
|
+
const h = W(
|
|
566
566
|
() => {
|
|
567
567
|
const m = [];
|
|
568
568
|
for (const [c, u] of e) {
|
|
569
569
|
const g = u.store.getSnapshot();
|
|
570
|
-
|
|
570
|
+
Zn(u.category, r) && (!g.rootViewId || !g.views.has(g.rootViewId) || m.push({ key: c, store: u.store }));
|
|
571
571
|
}
|
|
572
572
|
return m;
|
|
573
573
|
},
|
|
574
574
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
575
575
|
[e, r, i]
|
|
576
|
-
),
|
|
576
|
+
), f = E(!1), y = h.length > 0;
|
|
577
577
|
return C(() => {
|
|
578
|
-
y && !
|
|
578
|
+
y && !f.current && (f.current = !0, Jn.debug("First UI render"));
|
|
579
579
|
}, [y]), y ? /* @__PURE__ */ w.jsxs(w.Fragment, { children: [
|
|
580
|
-
/* @__PURE__ */ w.jsx(
|
|
581
|
-
|
|
580
|
+
/* @__PURE__ */ w.jsx(qn, {}),
|
|
581
|
+
h.map(({ key: m, store: c }) => /* @__PURE__ */ w.jsx(Xn, { store: c, library: n, onAction: a.current, client: l.current, video: l.current?.media?.video }, m))
|
|
582
582
|
] }) : null;
|
|
583
583
|
});
|
|
584
|
-
class
|
|
584
|
+
class Qn {
|
|
585
585
|
core;
|
|
586
586
|
ownsCore;
|
|
587
587
|
stores = /* @__PURE__ */ new Map();
|
|
@@ -589,7 +589,7 @@ class sr {
|
|
|
589
589
|
unsubscribeClears;
|
|
590
590
|
unsubscribeStoreChanges;
|
|
591
591
|
constructor(e) {
|
|
592
|
-
this.core = e?.core ?? new
|
|
592
|
+
this.core = e?.core ?? new Sn({ client: e?.client, liveSnapshot: e?.liveSnapshot, bootSnapshot: e?.bootSnapshot }), this.ownsCore = !e?.core, this.unsubscribeClears = this.core.subscribeToUiStreamCleared(this.handleUiStreamCleared), this.unsubscribeStoreChanges = this.core.uiStore.subscribe(this.syncStreamSnapshot), this.syncAllStreams();
|
|
593
593
|
}
|
|
594
594
|
dispose() {
|
|
595
595
|
this.unsubscribeClears(), this.unsubscribeStoreChanges(), this.ownsCore && this.core.dispose(), this.listeners.clear(), this.stores.clear();
|
|
@@ -645,8 +645,8 @@ class sr {
|
|
|
645
645
|
if (n)
|
|
646
646
|
return n;
|
|
647
647
|
const r = {
|
|
648
|
-
category:
|
|
649
|
-
store: new
|
|
648
|
+
category: Qe,
|
|
649
|
+
store: new wn()
|
|
650
650
|
};
|
|
651
651
|
return this.stores.set(e, r), r;
|
|
652
652
|
}
|
|
@@ -654,7 +654,7 @@ class sr {
|
|
|
654
654
|
const r = this.stores.get(e);
|
|
655
655
|
if (!r)
|
|
656
656
|
return !1;
|
|
657
|
-
const o = n ?? this.core.uiStore.getSnapshot(e)?.category ??
|
|
657
|
+
const o = n ?? this.core.uiStore.getSnapshot(e)?.category ?? Qe;
|
|
658
658
|
return r.category === o ? !1 : (this.stores.set(e, { ...r, category: o }), !0);
|
|
659
659
|
}
|
|
660
660
|
notify(e) {
|
|
@@ -662,7 +662,7 @@ class sr {
|
|
|
662
662
|
n(e);
|
|
663
663
|
}
|
|
664
664
|
}
|
|
665
|
-
function
|
|
665
|
+
function er(t) {
|
|
666
666
|
if (typeof t == "string") {
|
|
667
667
|
const e = t.trim();
|
|
668
668
|
return e.length > 0 ? e : void 0;
|
|
@@ -678,7 +678,7 @@ function de(t) {
|
|
|
678
678
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
679
679
|
}
|
|
680
680
|
}
|
|
681
|
-
function
|
|
681
|
+
function it(...t) {
|
|
682
682
|
let e = "";
|
|
683
683
|
for (const n of t)
|
|
684
684
|
if (n) {
|
|
@@ -687,19 +687,19 @@ function lt(...t) {
|
|
|
687
687
|
}
|
|
688
688
|
return e || void 0;
|
|
689
689
|
}
|
|
690
|
-
const
|
|
691
|
-
function
|
|
690
|
+
const St = /* @__PURE__ */ new WeakMap(), tr = {};
|
|
691
|
+
function at(t) {
|
|
692
692
|
if (!t)
|
|
693
|
-
return
|
|
694
|
-
const e =
|
|
693
|
+
return tr;
|
|
694
|
+
const e = St.get(t);
|
|
695
695
|
if (e)
|
|
696
696
|
return e;
|
|
697
697
|
const n = {};
|
|
698
698
|
for (const [r, o] of Object.entries(t))
|
|
699
699
|
o != null && (typeof o == "string" || typeof o == "number" || typeof o == "boolean") && (n[r] = o);
|
|
700
|
-
return
|
|
700
|
+
return St.set(t, n), n;
|
|
701
701
|
}
|
|
702
|
-
function
|
|
702
|
+
function nr(t) {
|
|
703
703
|
let e = t.parentElement;
|
|
704
704
|
for (; e; ) {
|
|
705
705
|
const r = window.getComputedStyle(e).overflowY;
|
|
@@ -709,32 +709,32 @@ function cr(t) {
|
|
|
709
709
|
}
|
|
710
710
|
return null;
|
|
711
711
|
}
|
|
712
|
-
const
|
|
713
|
-
function
|
|
712
|
+
const Ft = 1.5;
|
|
713
|
+
function Vt(t, e) {
|
|
714
714
|
requestAnimationFrame(() => {
|
|
715
|
-
const n = t.getBoundingClientRect(), r = e.getBoundingClientRect(), o = t.scrollTop + (r.bottom - n.bottom) + 16, i = Math.abs(o - t.scrollTop) > t.clientHeight *
|
|
715
|
+
const n = t.getBoundingClientRect(), r = e.getBoundingClientRect(), o = t.scrollTop + (r.bottom - n.bottom) + 16, i = Math.abs(o - t.scrollTop) > t.clientHeight * Ft ? "auto" : "smooth";
|
|
716
716
|
"scrollBehavior" in document.documentElement.style ? t.scrollTo({ top: o, behavior: i }) : t.scrollTop = o;
|
|
717
717
|
});
|
|
718
718
|
}
|
|
719
|
-
const
|
|
720
|
-
function
|
|
721
|
-
return Math.max(t.clientHeight *
|
|
719
|
+
const et = "data-ikon-scroll-indicator", rr = 0.15, xe = "data-ikon-at-bottom";
|
|
720
|
+
function Wt(t) {
|
|
721
|
+
return Math.max(t.clientHeight * rr, 20);
|
|
722
722
|
}
|
|
723
|
-
function
|
|
723
|
+
function or(t) {
|
|
724
724
|
return t.getAttribute(xe) !== "false";
|
|
725
725
|
}
|
|
726
|
-
function
|
|
726
|
+
function sr(t) {
|
|
727
727
|
t.getAttribute(xe) === null && (t.setAttribute(xe, "true"), t.addEventListener("scroll", () => {
|
|
728
|
-
const { scrollTop: e, scrollHeight: n, clientHeight: r } = t, s = n - e - r <=
|
|
728
|
+
const { scrollTop: e, scrollHeight: n, clientHeight: r } = t, s = n - e - r <= Wt(t);
|
|
729
729
|
t.setAttribute(xe, s ? "true" : "false");
|
|
730
730
|
}, { passive: !0 }));
|
|
731
731
|
}
|
|
732
|
-
function
|
|
733
|
-
const e = t.parentElement ?? t, n = e.querySelector(`[${
|
|
732
|
+
function ir(t) {
|
|
733
|
+
const e = t.parentElement ?? t, n = e.querySelector(`[${et}]`);
|
|
734
734
|
if (n)
|
|
735
735
|
return n;
|
|
736
736
|
const r = document.createElement("button");
|
|
737
|
-
return r.setAttribute(
|
|
737
|
+
return r.setAttribute(et, "true"), r.setAttribute("aria-label", "Scroll to latest"), r.textContent = "↓", Object.assign(r.style, {
|
|
738
738
|
position: "absolute",
|
|
739
739
|
bottom: "12px",
|
|
740
740
|
left: "50%",
|
|
@@ -762,22 +762,22 @@ function fr(t) {
|
|
|
762
762
|
r.style.opacity = "0.9";
|
|
763
763
|
}), e.appendChild(r), r;
|
|
764
764
|
}
|
|
765
|
-
function
|
|
766
|
-
const n =
|
|
765
|
+
function ar(t, e) {
|
|
766
|
+
const n = ir(t);
|
|
767
767
|
n.style.display = "flex";
|
|
768
768
|
const r = () => {
|
|
769
|
-
|
|
769
|
+
Vt(t, e), n.style.display = "none";
|
|
770
770
|
}, o = () => {
|
|
771
771
|
const { scrollTop: s, scrollHeight: i, clientHeight: a } = t;
|
|
772
|
-
i - s - a <=
|
|
772
|
+
i - s - a <= Wt(t) && (n.style.display = "none");
|
|
773
773
|
};
|
|
774
774
|
return n.addEventListener("click", r), t.addEventListener("scroll", o, { passive: !0 }), () => {
|
|
775
775
|
n.removeEventListener("click", r), t.removeEventListener("scroll", o);
|
|
776
776
|
};
|
|
777
777
|
}
|
|
778
|
-
function
|
|
779
|
-
const t =
|
|
780
|
-
const o = Z(r.store, n), s = E(null), i = de(o?.props?.targetViewId), a = o?.props?.focusOnly, l = typeof a == "boolean" ? a : void 0,
|
|
778
|
+
function cr() {
|
|
779
|
+
const t = G(function({ nodeId: n, context: r }) {
|
|
780
|
+
const o = Z(r.store, n), s = E(null), i = de(o?.props?.targetViewId), a = o?.props?.focusOnly, l = typeof a == "boolean" ? a : void 0, h = de(o?.props?.priority), f = de(o?.props?.key), y = o?.props?.preciseGeneratedAt;
|
|
781
781
|
return C(() => {
|
|
782
782
|
if (typeof document > "u")
|
|
783
783
|
return;
|
|
@@ -786,16 +786,16 @@ function pr() {
|
|
|
786
786
|
return;
|
|
787
787
|
let u;
|
|
788
788
|
if (l !== !0) {
|
|
789
|
-
const S =
|
|
789
|
+
const S = nr(c);
|
|
790
790
|
if (S)
|
|
791
|
-
if (
|
|
792
|
-
u =
|
|
791
|
+
if (sr(S), h === "Polite" && !or(S))
|
|
792
|
+
u = ar(S, c);
|
|
793
793
|
else {
|
|
794
|
-
const U = (S.parentElement ?? S).querySelector(`[${
|
|
795
|
-
U && (U.style.display = "none"),
|
|
794
|
+
const U = (S.parentElement ?? S).querySelector(`[${et}]`);
|
|
795
|
+
U && (U.style.display = "none"), Vt(S, c);
|
|
796
796
|
}
|
|
797
797
|
else typeof c.scrollIntoView == "function" && requestAnimationFrame(() => {
|
|
798
|
-
const R = c.getBoundingClientRect().top, v = typeof window < "u" ? window.innerHeight : 0, T = Math.abs(R) > v *
|
|
798
|
+
const R = c.getBoundingClientRect().top, v = typeof window < "u" ? window.innerHeight : 0, T = Math.abs(R) > v * Ft ? "auto" : "smooth";
|
|
799
799
|
try {
|
|
800
800
|
c.scrollIntoView({ behavior: T, block: "end", inline: "nearest" });
|
|
801
801
|
} catch {
|
|
@@ -811,7 +811,7 @@ function pr() {
|
|
|
811
811
|
c.focus();
|
|
812
812
|
}
|
|
813
813
|
return u;
|
|
814
|
-
}, [l,
|
|
814
|
+
}, [l, h, i, f, y]), o ? /* @__PURE__ */ w.jsx(
|
|
815
815
|
"span",
|
|
816
816
|
{
|
|
817
817
|
ref: s,
|
|
@@ -828,26 +828,26 @@ function pr() {
|
|
|
828
828
|
return t;
|
|
829
829
|
};
|
|
830
830
|
}
|
|
831
|
-
function
|
|
832
|
-
const t =
|
|
833
|
-
const s = Z(r.store, n), i =
|
|
831
|
+
function lr() {
|
|
832
|
+
const t = G(function({ nodeId: n, context: r, className: o }) {
|
|
833
|
+
const s = Z(r.store, n), i = er(s?.props?.onInvokeId), a = j(() => {
|
|
834
834
|
i && r.dispatchAction(i);
|
|
835
835
|
}, [i, r]);
|
|
836
836
|
if (!s)
|
|
837
837
|
return null;
|
|
838
|
-
const l =
|
|
838
|
+
const l = at(s.props);
|
|
839
839
|
delete l.onInvokeId;
|
|
840
|
-
const
|
|
840
|
+
const h = it(de(s.props?.className), o), f = s.children?.length ? r.renderChildren(s.children) : void 0;
|
|
841
841
|
return /* @__PURE__ */ w.jsx(
|
|
842
842
|
"div",
|
|
843
843
|
{
|
|
844
844
|
...l,
|
|
845
845
|
"data-ikon-node-id": s.id,
|
|
846
846
|
"data-ikon-source": s.sourceMarker,
|
|
847
|
-
className:
|
|
847
|
+
className: h,
|
|
848
848
|
onClick: i ? a : void 0,
|
|
849
849
|
style: i ? { cursor: "pointer" } : void 0,
|
|
850
|
-
children:
|
|
850
|
+
children: f
|
|
851
851
|
}
|
|
852
852
|
);
|
|
853
853
|
});
|
|
@@ -856,12 +856,12 @@ function mr() {
|
|
|
856
856
|
return t;
|
|
857
857
|
};
|
|
858
858
|
}
|
|
859
|
-
function
|
|
860
|
-
const t =
|
|
859
|
+
function ur() {
|
|
860
|
+
const t = G(function({ nodeId: n, context: r, className: o }) {
|
|
861
861
|
const s = Z(r.store, n);
|
|
862
862
|
if (!s)
|
|
863
863
|
return null;
|
|
864
|
-
const i =
|
|
864
|
+
const i = at(s.props), a = it("relative", de(s.props?.className), o), l = s.children?.length ? r.renderChildren(s.children) : void 0;
|
|
865
865
|
return /* @__PURE__ */ w.jsx("div", { ...i, "data-ikon-node-id": s.id, "data-ikon-source": s.sourceMarker, className: a, children: l });
|
|
866
866
|
});
|
|
867
867
|
return ({ type: e }) => {
|
|
@@ -869,12 +869,12 @@ function gr() {
|
|
|
869
869
|
return t;
|
|
870
870
|
};
|
|
871
871
|
}
|
|
872
|
-
function
|
|
873
|
-
const t =
|
|
872
|
+
function dr() {
|
|
873
|
+
const t = G(function({ nodeId: n, context: r, className: o }) {
|
|
874
874
|
const s = Z(r.store, n);
|
|
875
875
|
if (!s)
|
|
876
876
|
return null;
|
|
877
|
-
const i =
|
|
877
|
+
const i = at(s.props), a = it("absolute", de(s.props?.className), o), l = s.children?.length ? r.renderChildren(s.children) : void 0;
|
|
878
878
|
return /* @__PURE__ */ w.jsx("div", { ...i, "data-ikon-node-id": s.id, "data-ikon-source": s.sourceMarker, className: a, children: l });
|
|
879
879
|
});
|
|
880
880
|
return ({ type: e }) => {
|
|
@@ -882,19 +882,19 @@ function yr() {
|
|
|
882
882
|
return t;
|
|
883
883
|
};
|
|
884
884
|
}
|
|
885
|
-
function
|
|
885
|
+
function fr() {
|
|
886
886
|
return [
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
887
|
+
lr(),
|
|
888
|
+
ur(),
|
|
889
|
+
dr(),
|
|
890
|
+
cr()
|
|
891
891
|
];
|
|
892
892
|
}
|
|
893
|
-
const
|
|
894
|
-
function
|
|
895
|
-
t.registerModule(
|
|
893
|
+
const hr = "base", pr = async () => fr();
|
|
894
|
+
function mr(t) {
|
|
895
|
+
t.registerModule(hr, pr);
|
|
896
896
|
}
|
|
897
|
-
function
|
|
897
|
+
function gr(t) {
|
|
898
898
|
if (typeof t == "string") {
|
|
899
899
|
const e = t.trim();
|
|
900
900
|
return e.length > 0 ? e : void 0;
|
|
@@ -904,19 +904,19 @@ function Er(t) {
|
|
|
904
904
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
905
905
|
}
|
|
906
906
|
}
|
|
907
|
-
function
|
|
907
|
+
function yr(...t) {
|
|
908
908
|
const e = [];
|
|
909
909
|
for (const n of t)
|
|
910
910
|
n && n.trim() && e.push(n.trim());
|
|
911
911
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
912
912
|
}
|
|
913
|
-
function
|
|
913
|
+
function wt(t) {
|
|
914
914
|
if (typeof t != "string")
|
|
915
915
|
return;
|
|
916
916
|
const e = t.trim();
|
|
917
917
|
return e.length > 0 ? e : void 0;
|
|
918
918
|
}
|
|
919
|
-
function
|
|
919
|
+
function Ie(t) {
|
|
920
920
|
if (typeof t == "boolean")
|
|
921
921
|
return t;
|
|
922
922
|
if (typeof t == "string") {
|
|
@@ -925,42 +925,42 @@ function _e(t) {
|
|
|
925
925
|
if (e === "false") return !1;
|
|
926
926
|
}
|
|
927
927
|
}
|
|
928
|
-
const
|
|
929
|
-
function
|
|
930
|
-
const t =
|
|
928
|
+
const br = "std.audio-url-player";
|
|
929
|
+
function Sr() {
|
|
930
|
+
const t = G(function({
|
|
931
931
|
nodeId: n,
|
|
932
932
|
context: r,
|
|
933
933
|
className: o
|
|
934
934
|
}) {
|
|
935
|
-
const s = Z(r.store, n), i = E(null), a = s ?
|
|
935
|
+
const s = Z(r.store, n), i = E(null), a = s ? Ie(s.props?.autoplay) : void 0, l = s ? wt(s.props?.src) : void 0;
|
|
936
936
|
if (C(() => {
|
|
937
937
|
a && i.current && i.current.play().catch(() => {
|
|
938
938
|
});
|
|
939
939
|
}, [a, l]), !s)
|
|
940
940
|
return null;
|
|
941
|
-
const
|
|
941
|
+
const h = yr(gr(s.props?.className), o), f = wt(s.props?.preload), y = Ie(s.props?.controls), m = Ie(s.props?.loop), c = Ie(s.props?.muted);
|
|
942
942
|
return /* @__PURE__ */ w.jsx(
|
|
943
943
|
"audio",
|
|
944
944
|
{
|
|
945
945
|
ref: i,
|
|
946
946
|
src: l,
|
|
947
|
-
...
|
|
947
|
+
...f !== void 0 ? { preload: f } : {},
|
|
948
948
|
...y !== void 0 ? { controls: y } : {},
|
|
949
949
|
...a !== void 0 ? { autoPlay: a } : {},
|
|
950
950
|
...m !== void 0 ? { loop: m } : {},
|
|
951
951
|
...c !== void 0 ? { muted: c } : {},
|
|
952
952
|
"data-ikon-node-id": s.id,
|
|
953
953
|
"data-ikon-source": s.sourceMarker,
|
|
954
|
-
className:
|
|
954
|
+
className: h
|
|
955
955
|
}
|
|
956
956
|
);
|
|
957
957
|
});
|
|
958
958
|
return ({ type: e }) => {
|
|
959
|
-
if (e ===
|
|
959
|
+
if (e === br)
|
|
960
960
|
return t;
|
|
961
961
|
};
|
|
962
962
|
}
|
|
963
|
-
function
|
|
963
|
+
function Kt(t) {
|
|
964
964
|
if (typeof t == "string") {
|
|
965
965
|
const e = t.trim();
|
|
966
966
|
return e.length > 0 ? e : void 0;
|
|
@@ -970,13 +970,13 @@ function Ht(t) {
|
|
|
970
970
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
971
971
|
}
|
|
972
972
|
}
|
|
973
|
-
function
|
|
973
|
+
function Yt(...t) {
|
|
974
974
|
const e = [];
|
|
975
975
|
for (const n of t)
|
|
976
976
|
n && n.trim() && e.push(n.trim());
|
|
977
977
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
978
978
|
}
|
|
979
|
-
function
|
|
979
|
+
function Ne(t) {
|
|
980
980
|
if (typeof t == "number" && Number.isFinite(t))
|
|
981
981
|
return Math.floor(t);
|
|
982
982
|
if (typeof t == "string" && t.trim().length > 0) {
|
|
@@ -985,33 +985,33 @@ function Le(t) {
|
|
|
985
985
|
return Math.floor(e);
|
|
986
986
|
}
|
|
987
987
|
}
|
|
988
|
-
function
|
|
988
|
+
function tt(t) {
|
|
989
989
|
if (typeof t != "string")
|
|
990
990
|
return;
|
|
991
991
|
const e = t.trim();
|
|
992
992
|
return e.length > 0 ? e : void 0;
|
|
993
993
|
}
|
|
994
|
-
const
|
|
995
|
-
function
|
|
996
|
-
const t =
|
|
997
|
-
const s = Z(r.store, n), i = E(null), a = E(null), l = r.video,
|
|
994
|
+
const wr = "std.video-canvas", vr = "std.video-url-player";
|
|
995
|
+
function Er() {
|
|
996
|
+
const t = G(function({ nodeId: n, context: r, className: o }) {
|
|
997
|
+
const s = Z(r.store, n), i = E(null), a = E(null), l = r.video, h = r.client, f = s ? tt(s.props?.streamId) : void 0, y = s ? Ne(s.props?.width) : void 0, m = s ? Ne(s.props?.height) : void 0, c = s ? Yt(Kt(s.props?.className), o) : o, [, u] = x(0);
|
|
998
998
|
C(() => {
|
|
999
|
-
if (!
|
|
1000
|
-
const p =
|
|
1001
|
-
return
|
|
999
|
+
if (!h?.isWebRtcEnabled) return;
|
|
1000
|
+
const p = h.onWebRtcTrackMapChanged;
|
|
1001
|
+
return h.onWebRtcTrackMapChanged = (b) => {
|
|
1002
1002
|
p?.(b), b.kind === "video" && u((S) => S + 1);
|
|
1003
1003
|
}, () => {
|
|
1004
|
-
|
|
1004
|
+
h.onWebRtcTrackMapChanged = p;
|
|
1005
1005
|
};
|
|
1006
|
-
}, [
|
|
1007
|
-
const g =
|
|
1006
|
+
}, [h]);
|
|
1007
|
+
const g = h?.isWebRtcEnabled && f ? h.getWebRtcVideoStreamByStreamId(f) : null;
|
|
1008
1008
|
return C(() => {
|
|
1009
1009
|
const p = i.current;
|
|
1010
|
-
if (!(!l || !p || !
|
|
1011
|
-
return l.attachCanvas(
|
|
1012
|
-
l.detachCanvas(
|
|
1010
|
+
if (!(!l || !p || !f || g))
|
|
1011
|
+
return l.attachCanvas(f, p), () => {
|
|
1012
|
+
l.detachCanvas(f);
|
|
1013
1013
|
};
|
|
1014
|
-
}, [l,
|
|
1014
|
+
}, [l, f, g]), C(() => {
|
|
1015
1015
|
const p = a.current;
|
|
1016
1016
|
if (!(!p || !g))
|
|
1017
1017
|
return p.srcObject = g, () => {
|
|
@@ -1026,33 +1026,33 @@ function Ir() {
|
|
|
1026
1026
|
muted: !0,
|
|
1027
1027
|
"data-ikon-node-id": s.id,
|
|
1028
1028
|
"data-ikon-source": s.sourceMarker,
|
|
1029
|
-
"data-ikon-video-stream-id":
|
|
1029
|
+
"data-ikon-video-stream-id": f,
|
|
1030
1030
|
className: c,
|
|
1031
1031
|
...y ? { width: y } : {},
|
|
1032
1032
|
...m ? { height: m } : {}
|
|
1033
1033
|
},
|
|
1034
|
-
|
|
1034
|
+
f
|
|
1035
1035
|
) : /* @__PURE__ */ w.jsx(
|
|
1036
1036
|
"canvas",
|
|
1037
1037
|
{
|
|
1038
1038
|
ref: i,
|
|
1039
1039
|
"data-ikon-node-id": s.id,
|
|
1040
1040
|
"data-ikon-source": s.sourceMarker,
|
|
1041
|
-
"data-ikon-video-stream-id":
|
|
1041
|
+
"data-ikon-video-stream-id": f,
|
|
1042
1042
|
className: c,
|
|
1043
1043
|
...y ? { width: y } : {},
|
|
1044
1044
|
...m ? { height: m } : {}
|
|
1045
1045
|
},
|
|
1046
|
-
|
|
1046
|
+
f
|
|
1047
1047
|
) : null;
|
|
1048
1048
|
});
|
|
1049
1049
|
return ({ type: e }) => {
|
|
1050
|
-
if (e ===
|
|
1050
|
+
if (e === wr)
|
|
1051
1051
|
return t;
|
|
1052
1052
|
};
|
|
1053
1053
|
}
|
|
1054
|
-
function
|
|
1055
|
-
return [
|
|
1054
|
+
function Rr() {
|
|
1055
|
+
return [Er(), Ar(), Sr()];
|
|
1056
1056
|
}
|
|
1057
1057
|
function be(t) {
|
|
1058
1058
|
if (typeof t == "boolean")
|
|
@@ -1063,25 +1063,25 @@ function be(t) {
|
|
|
1063
1063
|
if (e === "false") return !1;
|
|
1064
1064
|
}
|
|
1065
1065
|
}
|
|
1066
|
-
function
|
|
1067
|
-
const t =
|
|
1066
|
+
function Ar() {
|
|
1067
|
+
const t = G(function({
|
|
1068
1068
|
nodeId: n,
|
|
1069
1069
|
context: r,
|
|
1070
1070
|
className: o
|
|
1071
1071
|
}) {
|
|
1072
|
-
const s = Z(r.store, n), i = E(null), a = s ? be(s.props?.autoplay) : void 0, l = s ?
|
|
1072
|
+
const s = Z(r.store, n), i = E(null), a = s ? be(s.props?.autoplay) : void 0, l = s ? tt(s.props?.src) : void 0;
|
|
1073
1073
|
if (C(() => {
|
|
1074
1074
|
a && i.current && i.current.play().catch(() => {
|
|
1075
1075
|
});
|
|
1076
1076
|
}, [a, l]), !s)
|
|
1077
1077
|
return null;
|
|
1078
|
-
const
|
|
1078
|
+
const h = Yt(Kt(s.props?.className), o), f = tt(s.props?.poster), y = be(s.props?.controls), m = be(s.props?.loop), c = be(s.props?.muted), u = be(s.props?.playsInline), g = Ne(s.props?.width), p = Ne(s.props?.height), b = s.children?.length ? r.renderChildren(s.children) : void 0;
|
|
1079
1079
|
return /* @__PURE__ */ w.jsx(
|
|
1080
1080
|
"video",
|
|
1081
1081
|
{
|
|
1082
1082
|
ref: i,
|
|
1083
1083
|
src: l,
|
|
1084
|
-
poster:
|
|
1084
|
+
poster: f,
|
|
1085
1085
|
...y !== void 0 ? { controls: y } : {},
|
|
1086
1086
|
...a !== void 0 ? { autoPlay: a } : {},
|
|
1087
1087
|
...m !== void 0 ? { loop: m } : {},
|
|
@@ -1091,33 +1091,33 @@ function Or() {
|
|
|
1091
1091
|
...p ? { height: p } : {},
|
|
1092
1092
|
"data-ikon-node-id": s.id,
|
|
1093
1093
|
"data-ikon-source": s.sourceMarker,
|
|
1094
|
-
className:
|
|
1094
|
+
className: h,
|
|
1095
1095
|
children: b
|
|
1096
1096
|
}
|
|
1097
1097
|
);
|
|
1098
1098
|
});
|
|
1099
1099
|
return ({ type: e }) => {
|
|
1100
|
-
if (e ===
|
|
1100
|
+
if (e === vr)
|
|
1101
1101
|
return t;
|
|
1102
1102
|
};
|
|
1103
1103
|
}
|
|
1104
|
-
const
|
|
1105
|
-
function
|
|
1106
|
-
t.registerModule(
|
|
1104
|
+
const Tr = "media", kr = async () => Rr();
|
|
1105
|
+
function Cr(t) {
|
|
1106
|
+
t.registerModule(Tr, kr);
|
|
1107
1107
|
}
|
|
1108
|
-
const
|
|
1108
|
+
const Ir = `#version 300 es
|
|
1109
1109
|
in vec4 a_position;
|
|
1110
1110
|
void main() {
|
|
1111
1111
|
gl_Position = a_position;
|
|
1112
1112
|
}
|
|
1113
1113
|
`, le = 4;
|
|
1114
|
-
function
|
|
1114
|
+
function _r(t, e) {
|
|
1115
1115
|
return new RegExp(`\\buniform\\s+\\w+\\s+${e}\\s*;`, "g").test(t);
|
|
1116
1116
|
}
|
|
1117
|
-
function
|
|
1117
|
+
function Or(t, e) {
|
|
1118
1118
|
const n = [];
|
|
1119
1119
|
for (const [r, o] of Object.entries(e)) {
|
|
1120
|
-
if (
|
|
1120
|
+
if (_r(t, r))
|
|
1121
1121
|
continue;
|
|
1122
1122
|
let s;
|
|
1123
1123
|
switch (o.type) {
|
|
@@ -1178,7 +1178,7 @@ void main() {
|
|
|
1178
1178
|
}
|
|
1179
1179
|
`;
|
|
1180
1180
|
}
|
|
1181
|
-
class
|
|
1181
|
+
class xr {
|
|
1182
1182
|
gl;
|
|
1183
1183
|
program = null;
|
|
1184
1184
|
positionBuffer = null;
|
|
@@ -1253,10 +1253,10 @@ class jr {
|
|
|
1253
1253
|
}
|
|
1254
1254
|
compile(e, n = {}) {
|
|
1255
1255
|
this.lastError = null, this.customUniforms = n, this.currentShaderSource = e;
|
|
1256
|
-
const r = this.gl, o = this.compileShader(r.VERTEX_SHADER,
|
|
1256
|
+
const r = this.gl, o = this.compileShader(r.VERTEX_SHADER, Ir);
|
|
1257
1257
|
if (!o)
|
|
1258
1258
|
return !1;
|
|
1259
|
-
const s =
|
|
1259
|
+
const s = Or(e, n), i = this.compileShader(r.FRAGMENT_SHADER, s);
|
|
1260
1260
|
if (!i)
|
|
1261
1261
|
return r.deleteShader(o), !1;
|
|
1262
1262
|
const a = r.createProgram();
|
|
@@ -1295,10 +1295,10 @@ class jr {
|
|
|
1295
1295
|
(n.width !== o || n.height !== s) && (n.width = o, n.height = s, e.viewport(0, 0, o, s));
|
|
1296
1296
|
const i = performance.now(), a = (i - this.startTime) / 1e3, l = (i - this.lastFrameTime) / 1e3;
|
|
1297
1297
|
this.lastFrameTime = i, this.frameCount++, e.clearColor(0, 0, 0, 1), e.clear(e.COLOR_BUFFER_BIT), e.useProgram(this.program), e.bindVertexArray(this.vao);
|
|
1298
|
-
const
|
|
1299
|
-
|
|
1300
|
-
const
|
|
1301
|
-
|
|
1298
|
+
const h = this.uniformLocations.get("iResolution");
|
|
1299
|
+
h && e.uniform3f(h, o, s, 1);
|
|
1300
|
+
const f = this.uniformLocations.get("iTime");
|
|
1301
|
+
f && e.uniform1f(f, a);
|
|
1302
1302
|
const y = this.uniformLocations.get("iTimeDelta");
|
|
1303
1303
|
y && e.uniform1f(y, l);
|
|
1304
1304
|
const m = this.uniformLocations.get("iFrame");
|
|
@@ -1362,7 +1362,7 @@ class jr {
|
|
|
1362
1362
|
this.channels = [], this.uniformLocations.clear();
|
|
1363
1363
|
}
|
|
1364
1364
|
}
|
|
1365
|
-
function
|
|
1365
|
+
function Nr(t) {
|
|
1366
1366
|
if (typeof t == "string") {
|
|
1367
1367
|
const e = t.trim();
|
|
1368
1368
|
return e.length > 0 ? e : void 0;
|
|
@@ -1372,13 +1372,13 @@ function Dr(t) {
|
|
|
1372
1372
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
1373
1373
|
}
|
|
1374
1374
|
}
|
|
1375
|
-
function
|
|
1375
|
+
function Lr(...t) {
|
|
1376
1376
|
const e = [];
|
|
1377
1377
|
for (const n of t)
|
|
1378
1378
|
n && n.trim() && e.push(n.trim());
|
|
1379
1379
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
1380
1380
|
}
|
|
1381
|
-
function
|
|
1381
|
+
function Ke(t) {
|
|
1382
1382
|
if (typeof t == "number" && Number.isFinite(t))
|
|
1383
1383
|
return Math.floor(t);
|
|
1384
1384
|
if (typeof t == "string" && t.trim().length > 0) {
|
|
@@ -1387,10 +1387,10 @@ function Ye(t) {
|
|
|
1387
1387
|
return Math.floor(e);
|
|
1388
1388
|
}
|
|
1389
1389
|
}
|
|
1390
|
-
function
|
|
1390
|
+
function Pr(t) {
|
|
1391
1391
|
return typeof t == "string" ? t : "";
|
|
1392
1392
|
}
|
|
1393
|
-
function
|
|
1393
|
+
function Ur(t) {
|
|
1394
1394
|
if (typeof t == "boolean")
|
|
1395
1395
|
return t;
|
|
1396
1396
|
if (typeof t == "string") {
|
|
@@ -1399,7 +1399,7 @@ function Fr(t) {
|
|
|
1399
1399
|
if (e === "false") return !1;
|
|
1400
1400
|
}
|
|
1401
1401
|
}
|
|
1402
|
-
function
|
|
1402
|
+
function Mr(t) {
|
|
1403
1403
|
if (!t || typeof t != "object")
|
|
1404
1404
|
return {};
|
|
1405
1405
|
const e = {}, n = t;
|
|
@@ -1414,10 +1414,10 @@ function Vr(t) {
|
|
|
1414
1414
|
}
|
|
1415
1415
|
return e;
|
|
1416
1416
|
}
|
|
1417
|
-
function
|
|
1417
|
+
function Dr(t) {
|
|
1418
1418
|
return Array.isArray(t) ? t.map((e) => typeof e == "string" ? e : null) : [];
|
|
1419
1419
|
}
|
|
1420
|
-
function
|
|
1420
|
+
function jr(t, e) {
|
|
1421
1421
|
const n = Object.keys(t), r = Object.keys(e);
|
|
1422
1422
|
if (n.length !== r.length)
|
|
1423
1423
|
return !1;
|
|
@@ -1438,21 +1438,21 @@ function Kr(t, e) {
|
|
|
1438
1438
|
}
|
|
1439
1439
|
return !0;
|
|
1440
1440
|
}
|
|
1441
|
-
const
|
|
1442
|
-
function
|
|
1443
|
-
const t =
|
|
1444
|
-
const s = Z(r.store, n), i = E(null), a = E(null), l = E(null),
|
|
1441
|
+
const $r = "std.shadertoy-canvas";
|
|
1442
|
+
function Br() {
|
|
1443
|
+
const t = G(function({ nodeId: n, context: r, className: o }) {
|
|
1444
|
+
const s = Z(r.store, n), i = E(null), a = E(null), l = E(null), h = E(0), f = E(""), y = E({}), m = E({
|
|
1445
1445
|
x: 0,
|
|
1446
1446
|
y: 0,
|
|
1447
1447
|
clickX: 0,
|
|
1448
1448
|
clickY: 0,
|
|
1449
1449
|
isDown: !1
|
|
1450
|
-
}), c = s ?
|
|
1450
|
+
}), c = s ? Pr(s.props?.shaderSource) : "", u = s ? Ke(s.props?.fps) ?? 60 : 60, g = s?.props?.uniforms, p = W(() => Mr(g), [g]), b = s?.props?.channels, S = W(() => Dr(b), [b]), R = s ? Ur(s.props?.enableMouse) ?? !0 : !0, v = s ? Ke(s.props?.width) : void 0, T = s ? Ke(s.props?.height) : void 0, U = s ? Lr(Nr(s.props?.className), o) : o;
|
|
1451
1451
|
C(() => {
|
|
1452
1452
|
const _ = i.current;
|
|
1453
1453
|
if (_) {
|
|
1454
1454
|
try {
|
|
1455
|
-
const P = new
|
|
1455
|
+
const P = new xr(_);
|
|
1456
1456
|
a.current = P;
|
|
1457
1457
|
} catch (P) {
|
|
1458
1458
|
console.error("[ShadertoyRenderer] Failed to create WebGL2 context:", P);
|
|
@@ -1463,31 +1463,31 @@ function Yr() {
|
|
|
1463
1463
|
}
|
|
1464
1464
|
}, []), C(() => {
|
|
1465
1465
|
const _ = a.current;
|
|
1466
|
-
if (!(!_ || !c) &&
|
|
1466
|
+
if (!(!_ || !c) && f.current !== c)
|
|
1467
1467
|
if (_.compile(c, p))
|
|
1468
|
-
|
|
1468
|
+
f.current = c, y.current = p;
|
|
1469
1469
|
else {
|
|
1470
1470
|
const M = _.getError();
|
|
1471
1471
|
console.error("[ShadertoyRenderer] Shader compilation failed:", M);
|
|
1472
1472
|
}
|
|
1473
1473
|
}, [c, p]), C(() => {
|
|
1474
1474
|
const _ = a.current;
|
|
1475
|
-
!_ || !
|
|
1475
|
+
!_ || !f.current || jr(y.current, p) || (_.setCustomUniforms(p), y.current = p);
|
|
1476
1476
|
}, [p]), C(() => {
|
|
1477
1477
|
const _ = a.current;
|
|
1478
1478
|
_ && _.setChannels(S);
|
|
1479
1479
|
}, [S]), C(() => {
|
|
1480
1480
|
const _ = a.current;
|
|
1481
|
-
if (!_ || !
|
|
1481
|
+
if (!_ || !f.current) return;
|
|
1482
1482
|
const P = 1e3 / u, M = (B) => {
|
|
1483
|
-
const $ = B -
|
|
1484
|
-
$ >= P && (
|
|
1483
|
+
const $ = B - h.current;
|
|
1484
|
+
$ >= P && (h.current = B - $ % P, _.draw()), l.current = requestAnimationFrame(M);
|
|
1485
1485
|
};
|
|
1486
1486
|
return l.current = requestAnimationFrame(M), () => {
|
|
1487
1487
|
l.current !== null && (cancelAnimationFrame(l.current), l.current = null);
|
|
1488
1488
|
};
|
|
1489
1489
|
}, [u]);
|
|
1490
|
-
const ee =
|
|
1490
|
+
const ee = j(
|
|
1491
1491
|
(_) => {
|
|
1492
1492
|
if (!R) return;
|
|
1493
1493
|
const P = i.current, M = a.current;
|
|
@@ -1496,7 +1496,7 @@ function Yr() {
|
|
|
1496
1496
|
m.current.x = V, m.current.y = K, M.setMouse(V, K, m.current.clickX, m.current.clickY);
|
|
1497
1497
|
},
|
|
1498
1498
|
[R]
|
|
1499
|
-
), te =
|
|
1499
|
+
), te = j(
|
|
1500
1500
|
(_) => {
|
|
1501
1501
|
if (!R) return;
|
|
1502
1502
|
const P = i.current, M = a.current;
|
|
@@ -1505,7 +1505,7 @@ function Yr() {
|
|
|
1505
1505
|
m.current.isDown = !0, m.current.clickX = V, m.current.clickY = K, M.setMouse(V, K, V, K);
|
|
1506
1506
|
},
|
|
1507
1507
|
[R]
|
|
1508
|
-
), z =
|
|
1508
|
+
), z = j(() => {
|
|
1509
1509
|
R && (m.current.isDown = !1, m.current.clickX = -Math.abs(m.current.clickX));
|
|
1510
1510
|
}, [R]);
|
|
1511
1511
|
return s ? /* @__PURE__ */ w.jsx(
|
|
@@ -1525,16 +1525,16 @@ function Yr() {
|
|
|
1525
1525
|
) : null;
|
|
1526
1526
|
});
|
|
1527
1527
|
return ({ type: e }) => {
|
|
1528
|
-
if (e ===
|
|
1528
|
+
if (e === $r)
|
|
1529
1529
|
return t;
|
|
1530
1530
|
};
|
|
1531
1531
|
}
|
|
1532
|
-
const
|
|
1533
|
-
function
|
|
1534
|
-
t.registerModule(
|
|
1532
|
+
const Fr = "shadertoy", Vr = async () => Br();
|
|
1533
|
+
function Wr(t) {
|
|
1534
|
+
t.registerModule(Fr, Vr);
|
|
1535
1535
|
}
|
|
1536
|
-
const
|
|
1537
|
-
class
|
|
1536
|
+
const vt = oe("UIRegistry");
|
|
1537
|
+
class Kr {
|
|
1538
1538
|
baseResolvers = [];
|
|
1539
1539
|
moduleLoaders = /* @__PURE__ */ new Map();
|
|
1540
1540
|
moduleResolvers = /* @__PURE__ */ new Map();
|
|
@@ -1556,15 +1556,15 @@ class qr {
|
|
|
1556
1556
|
for (const [r, o] of this.moduleLoaders.entries())
|
|
1557
1557
|
if (!this.moduleResolvers.has(r))
|
|
1558
1558
|
try {
|
|
1559
|
-
const s = await o(), i =
|
|
1559
|
+
const s = await o(), i = zr(s);
|
|
1560
1560
|
this.moduleResolvers.set(r, i), e = !0;
|
|
1561
1561
|
} catch (s) {
|
|
1562
|
-
|
|
1562
|
+
vt.error(`[IkonUiRegistry] Failed to load module '${r}'.`, s);
|
|
1563
1563
|
}
|
|
1564
1564
|
const n = [];
|
|
1565
1565
|
for (const r of this.moduleLoaders.keys())
|
|
1566
1566
|
this.moduleResolvers.has(r) && n.push(r);
|
|
1567
|
-
return
|
|
1567
|
+
return Xr(n, this.activeModuleOrder) || (this.activeModuleOrder = n, e = !0), e;
|
|
1568
1568
|
}
|
|
1569
1569
|
resolve(e) {
|
|
1570
1570
|
for (const n of this.baseResolvers) {
|
|
@@ -1574,7 +1574,7 @@ class qr {
|
|
|
1574
1574
|
for (const n of this.activeModuleOrder) {
|
|
1575
1575
|
const r = this.moduleResolvers.get(n);
|
|
1576
1576
|
if (!r) {
|
|
1577
|
-
|
|
1577
|
+
vt.warn(`Missing resolvers for module ${n}`);
|
|
1578
1578
|
continue;
|
|
1579
1579
|
}
|
|
1580
1580
|
for (const o of r) {
|
|
@@ -1584,17 +1584,17 @@ class qr {
|
|
|
1584
1584
|
}
|
|
1585
1585
|
}
|
|
1586
1586
|
}
|
|
1587
|
-
function
|
|
1588
|
-
const t = new
|
|
1589
|
-
return
|
|
1587
|
+
function Yr() {
|
|
1588
|
+
const t = new Kr();
|
|
1589
|
+
return mr(t), Cr(t), Wr(t), t.loadRegisteredModules(), t;
|
|
1590
1590
|
}
|
|
1591
|
-
function
|
|
1591
|
+
function Gr(t) {
|
|
1592
1592
|
return Array.isArray(t) ? t : [t];
|
|
1593
1593
|
}
|
|
1594
|
-
function
|
|
1595
|
-
return t ?
|
|
1594
|
+
function zr(t) {
|
|
1595
|
+
return t ? Gr(t).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
|
|
1596
1596
|
}
|
|
1597
|
-
function
|
|
1597
|
+
function Xr(t, e) {
|
|
1598
1598
|
if (t.length !== e.length)
|
|
1599
1599
|
return !1;
|
|
1600
1600
|
for (let n = 0; n < t.length; n += 1)
|
|
@@ -1602,9 +1602,9 @@ function eo(t, e) {
|
|
|
1602
1602
|
return !1;
|
|
1603
1603
|
return !0;
|
|
1604
1604
|
}
|
|
1605
|
-
function
|
|
1605
|
+
function Cs({ mount: t, stores: e, registry: n, client: r, onAction: o }) {
|
|
1606
1606
|
return /* @__PURE__ */ w.jsx(
|
|
1607
|
-
|
|
1607
|
+
Bt,
|
|
1608
1608
|
{
|
|
1609
1609
|
stores: e,
|
|
1610
1610
|
registry: n,
|
|
@@ -1614,7 +1614,7 @@ function Js({ mount: t, stores: e, registry: n, client: r, onAction: o }) {
|
|
|
1614
1614
|
}
|
|
1615
1615
|
);
|
|
1616
1616
|
}
|
|
1617
|
-
const
|
|
1617
|
+
const Ye = oe("MotionController"), Et = {
|
|
1618
1618
|
ease: [0.25, 0.1, 0.25, 1],
|
|
1619
1619
|
"ease-in": [0.42, 0, 1, 1],
|
|
1620
1620
|
"ease-out": [0, 0, 0.58, 1],
|
|
@@ -1647,18 +1647,18 @@ const ze = oe("MotionController"), Tt = {
|
|
|
1647
1647
|
function F(t) {
|
|
1648
1648
|
return t <= 0 ? 0 : t >= 1 ? 1 : t;
|
|
1649
1649
|
}
|
|
1650
|
-
function
|
|
1650
|
+
function Rt(t) {
|
|
1651
1651
|
if (t == null) return;
|
|
1652
1652
|
const e = `${t}`.trim();
|
|
1653
1653
|
if (!e) return;
|
|
1654
1654
|
const n = Number.parseFloat(e);
|
|
1655
1655
|
return Number.isFinite(n) ? n : void 0;
|
|
1656
1656
|
}
|
|
1657
|
-
function
|
|
1657
|
+
function At(t) {
|
|
1658
1658
|
return typeof CSS < "u" && CSS.escape ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
1659
1659
|
}
|
|
1660
|
-
function
|
|
1661
|
-
const
|
|
1660
|
+
function Tt(t, e, n, r) {
|
|
1661
|
+
const f = new Float32Array(11);
|
|
1662
1662
|
function y(p, b, S) {
|
|
1663
1663
|
return ((3 * b - 3 * S + 1) * p + (3 * S - 6 * b)) * p * p + 3 * b * p;
|
|
1664
1664
|
}
|
|
@@ -1685,47 +1685,47 @@ function It(t, e, n, r) {
|
|
|
1685
1685
|
function g(p) {
|
|
1686
1686
|
let b = 0, S = 1;
|
|
1687
1687
|
const R = 10;
|
|
1688
|
-
for (; S !== R &&
|
|
1688
|
+
for (; S !== R && f[S] <= p; S += 1)
|
|
1689
1689
|
b += 0.1;
|
|
1690
1690
|
S -= 1;
|
|
1691
|
-
const v = (p -
|
|
1691
|
+
const v = (p - f[S]) / (f[S + 1] - f[S]), T = b + v * 0.1, U = m(T, t, n);
|
|
1692
1692
|
return U >= 1e-3 ? c(p, T) : U === 0 ? T : u(p, b, b + 0.1);
|
|
1693
1693
|
}
|
|
1694
1694
|
for (let p = 0; p < 11; p += 1)
|
|
1695
|
-
|
|
1695
|
+
f[p] = y(p * 0.1, t, n);
|
|
1696
1696
|
return (p) => p <= 0 ? 0 : p >= 1 ? 1 : y(g(p), e, r);
|
|
1697
1697
|
}
|
|
1698
|
-
function
|
|
1698
|
+
function Hr(t) {
|
|
1699
1699
|
const e = /steps\(\s*([0-9]+)\s*(?:,\s*([a-z-]+)\s*)?\)/i.exec(t);
|
|
1700
1700
|
if (!e)
|
|
1701
1701
|
return (o) => F(o);
|
|
1702
1702
|
const n = Math.max(1, parseInt(e[1], 10)), r = (e[2] ?? "end").toLowerCase();
|
|
1703
1703
|
return r === "start" || r === "jump-start" ? (o) => F(Math.ceil(o * n) / n) : r === "none" || r === "jump-none" ? (o) => F(Math.round(o * n) / n) : r === "both" || r === "jump-both" ? (o) => F((Math.floor(o * n) + 0.5) / n) : (o) => F(Math.floor(o * n) / n);
|
|
1704
1704
|
}
|
|
1705
|
-
function
|
|
1705
|
+
function qr(t) {
|
|
1706
1706
|
if (!t)
|
|
1707
1707
|
return (n) => F(n);
|
|
1708
1708
|
const e = t.trim().toLowerCase();
|
|
1709
1709
|
if (!e || e === "linear")
|
|
1710
1710
|
return (n) => F(n);
|
|
1711
|
-
if (
|
|
1712
|
-
const [n, r, o, s] =
|
|
1711
|
+
if (Et[e]) {
|
|
1712
|
+
const [n, r, o, s] = Et[e], i = Tt(n, r, o, s);
|
|
1713
1713
|
return (a) => F(i(F(a)));
|
|
1714
1714
|
}
|
|
1715
1715
|
if (e.startsWith("cubic-bezier(") && e.endsWith(")")) {
|
|
1716
1716
|
const r = e.slice(13, -1).split(",").map((o) => Number.parseFloat(o.trim()));
|
|
1717
1717
|
if (r.length === 4 && r.every((o) => Number.isFinite(o))) {
|
|
1718
|
-
const [o, s, i, a] = r, l =
|
|
1719
|
-
return (
|
|
1718
|
+
const [o, s, i, a] = r, l = Tt(o, s, i, a);
|
|
1719
|
+
return (h) => F(l(F(h)));
|
|
1720
1720
|
}
|
|
1721
1721
|
}
|
|
1722
1722
|
if (e.startsWith("steps(") && e.endsWith(")")) {
|
|
1723
|
-
const n =
|
|
1723
|
+
const n = Hr(e);
|
|
1724
1724
|
return (r) => n(F(r));
|
|
1725
1725
|
}
|
|
1726
1726
|
return (n) => F(n);
|
|
1727
1727
|
}
|
|
1728
|
-
function
|
|
1728
|
+
function Jr(t) {
|
|
1729
1729
|
if (!t)
|
|
1730
1730
|
return;
|
|
1731
1731
|
const e = /(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)\s*->\s*(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)/.exec(t);
|
|
@@ -1735,7 +1735,7 @@ function ro(t) {
|
|
|
1735
1735
|
if (![n, r, o, s].some((i) => !Number.isFinite(i)))
|
|
1736
1736
|
return { inStart: n, inEnd: r, outStart: o, outEnd: s };
|
|
1737
1737
|
}
|
|
1738
|
-
class
|
|
1738
|
+
class Zr {
|
|
1739
1739
|
bindingsByStyle = /* @__PURE__ */ new Map();
|
|
1740
1740
|
observer;
|
|
1741
1741
|
observeScheduled = !1;
|
|
@@ -1762,7 +1762,7 @@ class oo {
|
|
|
1762
1762
|
try {
|
|
1763
1763
|
e();
|
|
1764
1764
|
} catch (n) {
|
|
1765
|
-
|
|
1765
|
+
Ye.warn("Failed to cleanup binding listener", n);
|
|
1766
1766
|
}
|
|
1767
1767
|
this.globalCleanups.clear(), this.elementStates.clear(), this.styleToElements.clear(), this.bindingsByStyle.clear(), this.pendingScanStyles.clear(), this.scanScheduled = !1, this.observer && (this.observer.disconnect(), this.observer = void 0);
|
|
1768
1768
|
}
|
|
@@ -1772,7 +1772,7 @@ class oo {
|
|
|
1772
1772
|
const r = (JSON.parse(e).motionBindings ?? []).map((o) => this.parseBinding(o)).filter((o) => o !== void 0);
|
|
1773
1773
|
return r.length === 0 ? void 0 : { bindings: r };
|
|
1774
1774
|
} catch (n) {
|
|
1775
|
-
|
|
1775
|
+
Ye.warn("Failed to parse motion metadata", n);
|
|
1776
1776
|
return;
|
|
1777
1777
|
}
|
|
1778
1778
|
}
|
|
@@ -1780,7 +1780,7 @@ class oo {
|
|
|
1780
1780
|
const n = e.source?.trim();
|
|
1781
1781
|
if (!n)
|
|
1782
1782
|
return;
|
|
1783
|
-
const r =
|
|
1783
|
+
const r = Rt(e.min) ?? 0, o = Rt(e.max), s = o === void 0 ? r + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, l = qr(e.ease), h = Jr(e.map), f = e.targetId?.trim() || void 0;
|
|
1784
1784
|
return Number.isNaN(r) || Number.isNaN(s) ? void 0 : {
|
|
1785
1785
|
source: n.toLowerCase(),
|
|
1786
1786
|
min: r,
|
|
@@ -1788,8 +1788,8 @@ class oo {
|
|
|
1788
1788
|
clamp: i === "freeze-start" || i === "freeze-end" || i === "unclamped" ? i : "clamp",
|
|
1789
1789
|
reverse: a,
|
|
1790
1790
|
ease: l,
|
|
1791
|
-
map:
|
|
1792
|
-
targetId:
|
|
1791
|
+
map: h,
|
|
1792
|
+
targetId: f
|
|
1793
1793
|
};
|
|
1794
1794
|
}
|
|
1795
1795
|
ensureObserver() {
|
|
@@ -1838,7 +1838,7 @@ class oo {
|
|
|
1838
1838
|
const n = this.bindingsByStyle.get(e);
|
|
1839
1839
|
if (!n || typeof document > "u")
|
|
1840
1840
|
return;
|
|
1841
|
-
const r = `.${
|
|
1841
|
+
const r = `.${At(e)}`;
|
|
1842
1842
|
document.querySelectorAll(r).forEach((s) => this.applyStyleToElement(s, e, n));
|
|
1843
1843
|
}
|
|
1844
1844
|
applyStyleToElement(e, n, r) {
|
|
@@ -1878,7 +1878,7 @@ class oo {
|
|
|
1878
1878
|
}
|
|
1879
1879
|
resolveScrollContainer(e, n) {
|
|
1880
1880
|
if (n.targetId) {
|
|
1881
|
-
const r = `[data-ikon-motion-source="${
|
|
1881
|
+
const r = `[data-ikon-motion-source="${At(n.targetId)}"]`, o = typeof document < "u" ? document.querySelector(r) : null;
|
|
1882
1882
|
if (o)
|
|
1883
1883
|
return o;
|
|
1884
1884
|
}
|
|
@@ -1888,10 +1888,10 @@ class oo {
|
|
|
1888
1888
|
const o = n.max - n.min, s = o === 0 ? r > n.min ? 1 : 0 : (r - n.min) / o;
|
|
1889
1889
|
let i = this.applyClamp(s, n.clamp);
|
|
1890
1890
|
n.reverse && (i = 1 - i);
|
|
1891
|
-
const a = n.ease(i), l = Number.isFinite(a) ? a : 0,
|
|
1892
|
-
if (e.style.setProperty("--tw-motion-bind-source-value", `${r}`), e.style.setProperty("--tw-motion-bind-progress-ratio", `${l}`), e.style.setProperty("--tw-motion-bind-progress", `${
|
|
1893
|
-
const
|
|
1894
|
-
|
|
1891
|
+
const a = n.ease(i), l = Number.isFinite(a) ? a : 0, h = l * 100;
|
|
1892
|
+
if (e.style.setProperty("--tw-motion-bind-source-value", `${r}`), e.style.setProperty("--tw-motion-bind-progress-ratio", `${l}`), e.style.setProperty("--tw-motion-bind-progress", `${h}`), n.map) {
|
|
1893
|
+
const f = this.applyMap(h, n.map);
|
|
1894
|
+
f !== void 0 && e.style.setProperty("--tw-motion-bind-value", `${f}`);
|
|
1895
1895
|
} else
|
|
1896
1896
|
e.style.removeProperty("--tw-motion-bind-value");
|
|
1897
1897
|
}
|
|
@@ -1948,7 +1948,7 @@ class oo {
|
|
|
1948
1948
|
try {
|
|
1949
1949
|
i();
|
|
1950
1950
|
} catch (a) {
|
|
1951
|
-
|
|
1951
|
+
Ye.warn("Failed to cleanup listener", a);
|
|
1952
1952
|
}
|
|
1953
1953
|
this.globalCleanups.delete(i);
|
|
1954
1954
|
}
|
|
@@ -1993,29 +1993,29 @@ class oo {
|
|
|
1993
1993
|
}
|
|
1994
1994
|
}
|
|
1995
1995
|
}
|
|
1996
|
-
const
|
|
1997
|
-
function
|
|
1998
|
-
const e = E(/* @__PURE__ */ new Map()), n =
|
|
1996
|
+
const Ge = new Zr();
|
|
1997
|
+
function Qr(t) {
|
|
1998
|
+
const e = E(/* @__PURE__ */ new Map()), n = j(({ styleId: s, css: i, common: a }) => {
|
|
1999
1999
|
if (!(!s || typeof document > "u")) {
|
|
2000
2000
|
if (i) {
|
|
2001
2001
|
let l = e.current.get(s);
|
|
2002
2002
|
l || (l = document.createElement("style"), l.setAttribute("data-ikon-style-id", s), document.head.appendChild(l), e.current.set(s, l)), l.textContent = i;
|
|
2003
2003
|
}
|
|
2004
|
-
|
|
2004
|
+
Ge.registerStyle(s, a);
|
|
2005
2005
|
}
|
|
2006
|
-
}, []), r =
|
|
2006
|
+
}, []), r = j((s) => {
|
|
2007
2007
|
if (!(typeof document > "u"))
|
|
2008
2008
|
for (const i of s) {
|
|
2009
2009
|
const a = e.current.get(i);
|
|
2010
|
-
a && (a.remove(), e.current.delete(i)),
|
|
2010
|
+
a && (a.remove(), e.current.delete(i)), Ge.unregisterStyle(i);
|
|
2011
2011
|
}
|
|
2012
|
-
}, []), o =
|
|
2012
|
+
}, []), o = j(() => {
|
|
2013
2013
|
if (typeof document < "u") {
|
|
2014
2014
|
for (const s of e.current.values())
|
|
2015
2015
|
s.remove();
|
|
2016
2016
|
e.current.clear();
|
|
2017
2017
|
}
|
|
2018
|
-
|
|
2018
|
+
Ge.reset();
|
|
2019
2019
|
}, []);
|
|
2020
2020
|
return C(() => {
|
|
2021
2021
|
if (!t) return;
|
|
@@ -2027,7 +2027,7 @@ function so(t) {
|
|
|
2027
2027
|
};
|
|
2028
2028
|
}, [t, o, n, r]), C(() => () => o(), [o]), { setStyle: n, deleteStyles: r, reset: o };
|
|
2029
2029
|
}
|
|
2030
|
-
function
|
|
2030
|
+
function eo(t) {
|
|
2031
2031
|
const e = [];
|
|
2032
2032
|
for (const [n, r] of t) {
|
|
2033
2033
|
const o = r.store.getSnapshot(), s = o.rootViewId && o.views.has(o.rootViewId);
|
|
@@ -2035,126 +2035,20 @@ function io(t) {
|
|
|
2035
2035
|
}
|
|
2036
2036
|
return e.sort(), e.join(",");
|
|
2037
2037
|
}
|
|
2038
|
-
function
|
|
2039
|
-
const [e, n] =
|
|
2038
|
+
function to(t) {
|
|
2039
|
+
const [e, n] = x(), r = E("");
|
|
2040
2040
|
return C(() => {
|
|
2041
2041
|
if (!t) {
|
|
2042
2042
|
n(void 0), r.current = "";
|
|
2043
2043
|
return;
|
|
2044
2044
|
}
|
|
2045
2045
|
const o = () => {
|
|
2046
|
-
const s = t.getStores(), i =
|
|
2046
|
+
const s = t.getStores(), i = eo(s);
|
|
2047
2047
|
i !== r.current && (r.current = i, n(s));
|
|
2048
2048
|
};
|
|
2049
2049
|
return o(), t.subscribe(o);
|
|
2050
2050
|
}, [t]), e;
|
|
2051
2051
|
}
|
|
2052
|
-
var co = typeof global == "object" && global && global.Object === Object && global, lo = typeof self == "object" && self && self.Object === Object && self, uo = co || lo || Function("return this")(), Pe = uo.Symbol, Jt = Object.prototype, fo = Jt.hasOwnProperty, ho = Jt.toString, Se = Pe ? Pe.toStringTag : void 0;
|
|
2053
|
-
function po(t) {
|
|
2054
|
-
var e = fo.call(t, Se), n = t[Se];
|
|
2055
|
-
try {
|
|
2056
|
-
t[Se] = void 0;
|
|
2057
|
-
var r = !0;
|
|
2058
|
-
} catch {
|
|
2059
|
-
}
|
|
2060
|
-
var o = ho.call(t);
|
|
2061
|
-
return r && (e ? t[Se] = n : delete t[Se]), o;
|
|
2062
|
-
}
|
|
2063
|
-
var mo = Object.prototype, go = mo.toString;
|
|
2064
|
-
function yo(t) {
|
|
2065
|
-
return go.call(t);
|
|
2066
|
-
}
|
|
2067
|
-
var bo = "[object Null]", So = "[object Undefined]", _t = Pe ? Pe.toStringTag : void 0;
|
|
2068
|
-
function wo(t) {
|
|
2069
|
-
return t == null ? t === void 0 ? So : bo : _t && _t in Object(t) ? po(t) : yo(t);
|
|
2070
|
-
}
|
|
2071
|
-
function vo(t) {
|
|
2072
|
-
return t != null && typeof t == "object";
|
|
2073
|
-
}
|
|
2074
|
-
var Eo = Array.isArray, Ro = "[object String]";
|
|
2075
|
-
function Ao(t) {
|
|
2076
|
-
return typeof t == "string" || !Eo(t) && vo(t) && wo(t) == Ro;
|
|
2077
|
-
}
|
|
2078
|
-
const Ot = "ikon-ui-modules";
|
|
2079
|
-
function ot(t) {
|
|
2080
|
-
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
2081
|
-
}
|
|
2082
|
-
function To(t) {
|
|
2083
|
-
if (!Array.isArray(t))
|
|
2084
|
-
return;
|
|
2085
|
-
const e = /* @__PURE__ */ new Set();
|
|
2086
|
-
for (const n of t) {
|
|
2087
|
-
if (!Ao(n)) continue;
|
|
2088
|
-
const r = n.trim();
|
|
2089
|
-
r && (e.has(r) || e.add(r));
|
|
2090
|
-
}
|
|
2091
|
-
return Array.from(e);
|
|
2092
|
-
}
|
|
2093
|
-
function Zs(t, e) {
|
|
2094
|
-
if (t === e)
|
|
2095
|
-
return !0;
|
|
2096
|
-
if (!t || !e)
|
|
2097
|
-
return !t && !e;
|
|
2098
|
-
if (t.length !== e.length)
|
|
2099
|
-
return !1;
|
|
2100
|
-
for (let n = 0; n < t.length; n += 1)
|
|
2101
|
-
if (t[n] !== e[n])
|
|
2102
|
-
return !1;
|
|
2103
|
-
return !0;
|
|
2104
|
-
}
|
|
2105
|
-
function ko(t) {
|
|
2106
|
-
if (!(!ot(t) || !Object.prototype.hasOwnProperty.call(t, Ot)))
|
|
2107
|
-
return To(t[Ot]);
|
|
2108
|
-
}
|
|
2109
|
-
function Qs(...t) {
|
|
2110
|
-
for (const e of t) {
|
|
2111
|
-
const n = ko(e);
|
|
2112
|
-
if (n !== void 0)
|
|
2113
|
-
return n;
|
|
2114
|
-
}
|
|
2115
|
-
}
|
|
2116
|
-
function ei(t) {
|
|
2117
|
-
if (!ot(t))
|
|
2118
|
-
return;
|
|
2119
|
-
const e = t, n = Object.keys(e).find((l) => l.toLowerCase() === "modules");
|
|
2120
|
-
if (!n)
|
|
2121
|
-
return;
|
|
2122
|
-
const r = e[n];
|
|
2123
|
-
if (r === null)
|
|
2124
|
-
return { resetToDefault: !0 };
|
|
2125
|
-
if (!Array.isArray(r))
|
|
2126
|
-
return;
|
|
2127
|
-
const o = [], s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set();
|
|
2128
|
-
for (const l of r) {
|
|
2129
|
-
if (typeof l == "string") {
|
|
2130
|
-
const g = l.trim();
|
|
2131
|
-
if (!g || i.has(g))
|
|
2132
|
-
continue;
|
|
2133
|
-
o.push(g), i.add(g);
|
|
2134
|
-
continue;
|
|
2135
|
-
}
|
|
2136
|
-
if (!ot(l))
|
|
2137
|
-
continue;
|
|
2138
|
-
const d = l, h = Object.keys(d).find((g) => g.toLowerCase() === "name");
|
|
2139
|
-
if (!h)
|
|
2140
|
-
continue;
|
|
2141
|
-
const y = d[h];
|
|
2142
|
-
if (typeof y != "string")
|
|
2143
|
-
continue;
|
|
2144
|
-
const m = y.trim();
|
|
2145
|
-
if (!m)
|
|
2146
|
-
continue;
|
|
2147
|
-
const c = Object.keys(d).find((g) => g.toLowerCase() === "javascript"), u = c ? d[c] : void 0;
|
|
2148
|
-
typeof u == "string" && s.set(m, u), i.has(m) || (o.push(m), i.add(m));
|
|
2149
|
-
}
|
|
2150
|
-
if (!o.length && s.size === 0)
|
|
2151
|
-
return { modules: [] };
|
|
2152
|
-
const a = Array.from(s.entries()).map(([l, d]) => ({
|
|
2153
|
-
name: l,
|
|
2154
|
-
javascript: d
|
|
2155
|
-
}));
|
|
2156
|
-
return a.length > 0 ? { modules: o, inlineModules: a } : { modules: o };
|
|
2157
|
-
}
|
|
2158
2052
|
const k = {
|
|
2159
2053
|
None: 0,
|
|
2160
2054
|
Letter: 1,
|
|
@@ -2162,7 +2056,7 @@ const k = {
|
|
|
2162
2056
|
Line: 4,
|
|
2163
2057
|
Paragraph: 8,
|
|
2164
2058
|
Emoji: 16
|
|
2165
|
-
},
|
|
2059
|
+
}, no = [
|
|
2166
2060
|
{
|
|
2167
2061
|
flag: k.Letter,
|
|
2168
2062
|
hints: [
|
|
@@ -2211,32 +2105,32 @@ const k = {
|
|
|
2211
2105
|
"[data-emoji]"
|
|
2212
2106
|
]
|
|
2213
2107
|
}
|
|
2214
|
-
],
|
|
2215
|
-
function
|
|
2216
|
-
if (!t || t.length >
|
|
2108
|
+
], nt = k.Letter | k.Word | k.Line | k.Paragraph | k.Emoji, ro = k.Letter | k.Word | k.Line | k.Paragraph, kt = /* @__PURE__ */ new Map(), oo = 16384;
|
|
2109
|
+
function Is(t, e) {
|
|
2110
|
+
if (!t || t.length > oo)
|
|
2217
2111
|
return t;
|
|
2218
|
-
const n =
|
|
2112
|
+
const n = Eo(e), r = fe(n, k.Emoji), o = n & ro;
|
|
2219
2113
|
if (o === k.None && !r)
|
|
2220
2114
|
return t;
|
|
2221
2115
|
const s = t.replace(/\r\n/g, `
|
|
2222
2116
|
`).replace(/\r/g, `
|
|
2223
2117
|
`);
|
|
2224
2118
|
if (o === k.None)
|
|
2225
|
-
return
|
|
2226
|
-
const i =
|
|
2119
|
+
return Ot(s);
|
|
2120
|
+
const i = wo(s);
|
|
2227
2121
|
if (i.length === 0)
|
|
2228
|
-
return r ?
|
|
2229
|
-
const a =
|
|
2230
|
-
for (const
|
|
2231
|
-
const y =
|
|
2232
|
-
|
|
2122
|
+
return r ? Ot(s) : t;
|
|
2123
|
+
const a = vo(i), l = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, h = [];
|
|
2124
|
+
for (const f of a) {
|
|
2125
|
+
const y = so(f, n, l);
|
|
2126
|
+
h.push(...y);
|
|
2233
2127
|
}
|
|
2234
|
-
return
|
|
2128
|
+
return h;
|
|
2235
2129
|
}
|
|
2236
|
-
function
|
|
2130
|
+
function so(t, e, n) {
|
|
2237
2131
|
const r = [];
|
|
2238
2132
|
for (const o of t) {
|
|
2239
|
-
const s =
|
|
2133
|
+
const s = io(o, e, n);
|
|
2240
2134
|
r.push(...s);
|
|
2241
2135
|
}
|
|
2242
2136
|
if (fe(e, k.Paragraph)) {
|
|
@@ -2246,7 +2140,7 @@ function Oo(t, e, n) {
|
|
|
2246
2140
|
"span",
|
|
2247
2141
|
{
|
|
2248
2142
|
"data-motion-paragraph": !0,
|
|
2249
|
-
style:
|
|
2143
|
+
style: Ue(o),
|
|
2250
2144
|
children: r
|
|
2251
2145
|
},
|
|
2252
2146
|
`motion-paragraph-${o}`
|
|
@@ -2255,12 +2149,12 @@ function Oo(t, e, n) {
|
|
|
2255
2149
|
}
|
|
2256
2150
|
return r;
|
|
2257
2151
|
}
|
|
2258
|
-
function
|
|
2259
|
-
const r =
|
|
2152
|
+
function io(t, e, n) {
|
|
2153
|
+
const r = ao(t.text, e, n), o = [];
|
|
2260
2154
|
if (fe(e, k.Line)) {
|
|
2261
2155
|
const s = n.line++;
|
|
2262
2156
|
o.push(
|
|
2263
|
-
/* @__PURE__ */ w.jsx("span", { "data-motion-line": !0, style:
|
|
2157
|
+
/* @__PURE__ */ w.jsx("span", { "data-motion-line": !0, style: Ue(s), children: r }, `motion-line-${s}`)
|
|
2264
2158
|
);
|
|
2265
2159
|
} else
|
|
2266
2160
|
o.push(...r);
|
|
@@ -2268,7 +2162,7 @@ function No(t, e, n) {
|
|
|
2268
2162
|
o.push(/* @__PURE__ */ w.jsx("br", {}, `motion-break-${n.br++}`));
|
|
2269
2163
|
return o;
|
|
2270
2164
|
}
|
|
2271
|
-
function
|
|
2165
|
+
function ao(t, e, n) {
|
|
2272
2166
|
if (!t)
|
|
2273
2167
|
return [];
|
|
2274
2168
|
const r = fe(e, k.Word), o = [], s = /(\s+)/g;
|
|
@@ -2276,95 +2170,95 @@ function xo(t, e, n) {
|
|
|
2276
2170
|
for (; (a = s.exec(t)) !== null; ) {
|
|
2277
2171
|
if (a.index > i) {
|
|
2278
2172
|
const l = t.slice(i, a.index);
|
|
2279
|
-
o.push(
|
|
2173
|
+
o.push(Ct(l, n, e, r));
|
|
2280
2174
|
}
|
|
2281
2175
|
o.push(a[0]), i = a.index + a[0].length;
|
|
2282
2176
|
}
|
|
2283
2177
|
if (i < t.length) {
|
|
2284
2178
|
const l = t.slice(i);
|
|
2285
|
-
o.push(
|
|
2179
|
+
o.push(Ct(l, n, e, r));
|
|
2286
2180
|
}
|
|
2287
2181
|
return o;
|
|
2288
2182
|
}
|
|
2289
|
-
function
|
|
2290
|
-
const o = e.word++, s =
|
|
2183
|
+
function Ct(t, e, n, r) {
|
|
2184
|
+
const o = e.word++, s = lo(t, n, e), i = `motion-word-${o}`, a = co(o, r);
|
|
2291
2185
|
return r ? /* @__PURE__ */ w.jsx("span", { "data-motion-word": !0, style: a, children: s }, i) : /* @__PURE__ */ w.jsx("span", { style: a, children: s }, i);
|
|
2292
2186
|
}
|
|
2293
|
-
function
|
|
2294
|
-
return e ? { ...
|
|
2187
|
+
function co(t, e) {
|
|
2188
|
+
return e ? { ...Ue(t), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
|
|
2295
2189
|
}
|
|
2296
|
-
function
|
|
2190
|
+
function lo(t, e, n) {
|
|
2297
2191
|
if (!t)
|
|
2298
2192
|
return [];
|
|
2299
2193
|
const r = fe(e, k.Letter), o = fe(e, k.Emoji);
|
|
2300
2194
|
if (!r) {
|
|
2301
2195
|
if (!o)
|
|
2302
2196
|
return [t];
|
|
2303
|
-
const a =
|
|
2197
|
+
const a = rt(t);
|
|
2304
2198
|
if (a.length === 0)
|
|
2305
2199
|
return [t];
|
|
2306
|
-
const { nodes: l } =
|
|
2200
|
+
const { nodes: l } = zt(a, n);
|
|
2307
2201
|
return l;
|
|
2308
2202
|
}
|
|
2309
|
-
const s = [], i =
|
|
2203
|
+
const s = [], i = rt(t);
|
|
2310
2204
|
for (const a of i) {
|
|
2311
|
-
const l = n.letter++,
|
|
2205
|
+
const l = n.letter++, h = `motion-letter-${l}`, f = Ue(l);
|
|
2312
2206
|
if (a === `
|
|
2313
2207
|
`) {
|
|
2314
2208
|
s.push(
|
|
2315
|
-
/* @__PURE__ */ w.jsx("span", { "data-motion-letter": !0, style:
|
|
2209
|
+
/* @__PURE__ */ w.jsx("span", { "data-motion-letter": !0, style: f, children: /* @__PURE__ */ w.jsx("br", {}) }, h)
|
|
2316
2210
|
);
|
|
2317
2211
|
continue;
|
|
2318
2212
|
}
|
|
2319
|
-
const m = o &&
|
|
2213
|
+
const m = o && Gt(a) ? { "data-motion-emoji": !0 } : void 0, c = a === " " ? " " : a;
|
|
2320
2214
|
s.push(
|
|
2321
|
-
/* @__PURE__ */ w.jsx("span", { "data-motion-letter": !0, style:
|
|
2215
|
+
/* @__PURE__ */ w.jsx("span", { "data-motion-letter": !0, style: f, ...m, children: c }, h)
|
|
2322
2216
|
);
|
|
2323
2217
|
}
|
|
2324
2218
|
return s;
|
|
2325
2219
|
}
|
|
2326
|
-
function
|
|
2220
|
+
function rt(t) {
|
|
2327
2221
|
if (!t)
|
|
2328
2222
|
return [];
|
|
2329
|
-
const e =
|
|
2330
|
-
return e ? Array.from(e.segment(t), (n) => n.segment) :
|
|
2223
|
+
const e = uo();
|
|
2224
|
+
return e ? Array.from(e.segment(t), (n) => n.segment) : fo(t);
|
|
2331
2225
|
}
|
|
2332
|
-
let
|
|
2333
|
-
function
|
|
2334
|
-
return
|
|
2226
|
+
let Se;
|
|
2227
|
+
function uo() {
|
|
2228
|
+
return Se !== void 0 || (typeof Intl < "u" && typeof Intl.Segmenter == "function" ? Se = new Intl.Segmenter(void 0, { granularity: "grapheme" }) : Se = null), Se;
|
|
2335
2229
|
}
|
|
2336
|
-
function
|
|
2230
|
+
function fo(t) {
|
|
2337
2231
|
const e = [], n = Array.from(t);
|
|
2338
2232
|
let r = "";
|
|
2339
2233
|
for (let o = 0; o < n.length; o++) {
|
|
2340
2234
|
const s = n[o], i = n[o + 1];
|
|
2341
|
-
r += s, !(i &&
|
|
2235
|
+
r += s, !(i && ho(s, i)) && (e.push(r), r = "");
|
|
2342
2236
|
}
|
|
2343
2237
|
return r && e.push(r), e;
|
|
2344
2238
|
}
|
|
2345
|
-
function
|
|
2346
|
-
return e ? !!(
|
|
2239
|
+
function ho(t, e) {
|
|
2240
|
+
return e ? !!(It(t) || It(e) || go(e) || po(e) || mo(e) || _t(t) && _t(e)) : !1;
|
|
2347
2241
|
}
|
|
2348
|
-
function
|
|
2242
|
+
function It(t) {
|
|
2349
2243
|
return t.codePointAt(0) === 8205;
|
|
2350
2244
|
}
|
|
2351
|
-
function
|
|
2245
|
+
function po(t) {
|
|
2352
2246
|
const e = t.codePointAt(0);
|
|
2353
2247
|
return e === void 0 ? !1 : e >= 65024 && e <= 65039 || e >= 917760 && e <= 917999;
|
|
2354
2248
|
}
|
|
2355
|
-
function
|
|
2249
|
+
function mo(t) {
|
|
2356
2250
|
const e = t.codePointAt(0);
|
|
2357
2251
|
return e === void 0 ? !1 : e >= 127995 && e <= 127999;
|
|
2358
2252
|
}
|
|
2359
|
-
function
|
|
2253
|
+
function _t(t) {
|
|
2360
2254
|
const e = t.codePointAt(0);
|
|
2361
2255
|
return e === void 0 ? !1 : e >= 127462 && e <= 127487;
|
|
2362
2256
|
}
|
|
2363
|
-
let
|
|
2364
|
-
function
|
|
2365
|
-
return t ? (
|
|
2257
|
+
let ze;
|
|
2258
|
+
function go(t) {
|
|
2259
|
+
return t ? (ze || (ze = yo()), ze(t)) : !1;
|
|
2366
2260
|
}
|
|
2367
|
-
function
|
|
2261
|
+
function yo() {
|
|
2368
2262
|
try {
|
|
2369
2263
|
const t = new RegExp("\\p{Mark}", "u");
|
|
2370
2264
|
return (e) => t.test(e);
|
|
@@ -2375,19 +2269,19 @@ function Fo() {
|
|
|
2375
2269
|
};
|
|
2376
2270
|
}
|
|
2377
2271
|
}
|
|
2378
|
-
let
|
|
2379
|
-
function
|
|
2380
|
-
return t ? (
|
|
2272
|
+
let Xe;
|
|
2273
|
+
function Gt(t) {
|
|
2274
|
+
return t ? (Xe || (Xe = bo()), Xe(t)) : !1;
|
|
2381
2275
|
}
|
|
2382
|
-
function
|
|
2276
|
+
function bo() {
|
|
2383
2277
|
try {
|
|
2384
2278
|
const t = new RegExp("\\p{Extended_Pictographic}", "u");
|
|
2385
2279
|
return (e) => t.test(e);
|
|
2386
2280
|
} catch {
|
|
2387
|
-
return
|
|
2281
|
+
return So;
|
|
2388
2282
|
}
|
|
2389
2283
|
}
|
|
2390
|
-
function
|
|
2284
|
+
function So(t) {
|
|
2391
2285
|
if (!t)
|
|
2392
2286
|
return !1;
|
|
2393
2287
|
for (const e of Array.from(t)) {
|
|
@@ -2397,7 +2291,7 @@ function Wo(t) {
|
|
|
2397
2291
|
}
|
|
2398
2292
|
return !1;
|
|
2399
2293
|
}
|
|
2400
|
-
function
|
|
2294
|
+
function wo(t) {
|
|
2401
2295
|
const e = [];
|
|
2402
2296
|
let n = "", r = 0;
|
|
2403
2297
|
for (let o = 0; o < t.length; o++) {
|
|
@@ -2411,7 +2305,7 @@ function Ko(t) {
|
|
|
2411
2305
|
}
|
|
2412
2306
|
return (r > 0 || n.length > 0) && e.push({ text: n, breaks: r }), e;
|
|
2413
2307
|
}
|
|
2414
|
-
function
|
|
2308
|
+
function vo(t) {
|
|
2415
2309
|
if (t.length === 0)
|
|
2416
2310
|
return [];
|
|
2417
2311
|
const e = [];
|
|
@@ -2423,7 +2317,7 @@ function Go(t) {
|
|
|
2423
2317
|
function fe(t, e) {
|
|
2424
2318
|
return (t & e) === e;
|
|
2425
2319
|
}
|
|
2426
|
-
function
|
|
2320
|
+
function Ue(t) {
|
|
2427
2321
|
return {
|
|
2428
2322
|
"--tw-motion-seq-index": t.toString(),
|
|
2429
2323
|
backgroundColor: "inherit",
|
|
@@ -2440,27 +2334,27 @@ function je(t) {
|
|
|
2440
2334
|
WebkitTextFillColor: "inherit"
|
|
2441
2335
|
};
|
|
2442
2336
|
}
|
|
2443
|
-
function
|
|
2337
|
+
function Ot(t) {
|
|
2444
2338
|
if (!t)
|
|
2445
2339
|
return t;
|
|
2446
|
-
const e =
|
|
2340
|
+
const e = rt(t);
|
|
2447
2341
|
if (e.length === 0)
|
|
2448
2342
|
return t;
|
|
2449
|
-
const { nodes: n, sawEmoji: r } =
|
|
2343
|
+
const { nodes: n, sawEmoji: r } = zt(e);
|
|
2450
2344
|
return r ? n.length === 1 ? n[0] ?? t : n : t;
|
|
2451
2345
|
}
|
|
2452
|
-
function
|
|
2346
|
+
function zt(t, e) {
|
|
2453
2347
|
const n = [];
|
|
2454
2348
|
let r = "", o = !1, s = e?.emoji ?? 0;
|
|
2455
2349
|
const i = () => {
|
|
2456
2350
|
r && (n.push(r), r = "");
|
|
2457
2351
|
};
|
|
2458
2352
|
for (const a of t) {
|
|
2459
|
-
if (
|
|
2353
|
+
if (Gt(a)) {
|
|
2460
2354
|
o = !0, i();
|
|
2461
|
-
const
|
|
2355
|
+
const h = `motion-emoji-${e ? e.emoji++ : s++}`;
|
|
2462
2356
|
n.push(
|
|
2463
|
-
/* @__PURE__ */ w.jsx("span", { "data-motion-emoji": !0, children: a },
|
|
2357
|
+
/* @__PURE__ */ w.jsx("span", { "data-motion-emoji": !0, children: a }, h)
|
|
2464
2358
|
);
|
|
2465
2359
|
continue;
|
|
2466
2360
|
}
|
|
@@ -2468,13 +2362,13 @@ function Qt(t, e) {
|
|
|
2468
2362
|
}
|
|
2469
2363
|
return i(), o ? { nodes: n, sawEmoji: !0 } : { nodes: [t.join("")], sawEmoji: !1 };
|
|
2470
2364
|
}
|
|
2471
|
-
function
|
|
2365
|
+
function Eo(t) {
|
|
2472
2366
|
if (!t)
|
|
2473
2367
|
return k.None;
|
|
2474
2368
|
const e = t.trim();
|
|
2475
2369
|
if (!e)
|
|
2476
2370
|
return k.None;
|
|
2477
|
-
const n =
|
|
2371
|
+
const n = kt.get(e);
|
|
2478
2372
|
if (typeof n == "number")
|
|
2479
2373
|
return n;
|
|
2480
2374
|
if (typeof document > "u")
|
|
@@ -2482,25 +2376,25 @@ function Yo(t) {
|
|
|
2482
2376
|
const r = e.split(/\s+/).filter(Boolean);
|
|
2483
2377
|
if (r.length === 0)
|
|
2484
2378
|
return k.None;
|
|
2485
|
-
const s = r.map((l) => `.${
|
|
2486
|
-
(l) => new RegExp(`(^|[^a-zA-Z0-9_-])${
|
|
2379
|
+
const s = r.map((l) => `.${Ro(l)}`).map(
|
|
2380
|
+
(l) => new RegExp(`(^|[^a-zA-Z0-9_-])${Ao(l)}(?![a-zA-Z0-9_-])`)
|
|
2487
2381
|
);
|
|
2488
2382
|
let i = k.None, a = !1;
|
|
2489
2383
|
for (const l of Array.from(document.styleSheets)) {
|
|
2490
|
-
let
|
|
2384
|
+
let h;
|
|
2491
2385
|
try {
|
|
2492
|
-
|
|
2386
|
+
h = l.cssRules;
|
|
2493
2387
|
} catch {
|
|
2494
2388
|
continue;
|
|
2495
2389
|
}
|
|
2496
|
-
const
|
|
2497
|
-
if (
|
|
2390
|
+
const f = Xt(h, s);
|
|
2391
|
+
if (f.mask && (i |= f.mask, i === nt))
|
|
2498
2392
|
break;
|
|
2499
|
-
a ||=
|
|
2393
|
+
a ||= f.sawStyleRule;
|
|
2500
2394
|
}
|
|
2501
|
-
return (i !== k.None || a) &&
|
|
2395
|
+
return (i !== k.None || a) && kt.set(e, i), i;
|
|
2502
2396
|
}
|
|
2503
|
-
function
|
|
2397
|
+
function Xt(t, e) {
|
|
2504
2398
|
if (!t)
|
|
2505
2399
|
return { mask: k.None, sawStyleRule: !1 };
|
|
2506
2400
|
let n = k.None, r = !1;
|
|
@@ -2509,15 +2403,15 @@ function en(t, e) {
|
|
|
2509
2403
|
if (s) {
|
|
2510
2404
|
if (s.type === CSSRule.STYLE_RULE) {
|
|
2511
2405
|
const a = s.selectorText ?? "";
|
|
2512
|
-
if (!a || !e.some((
|
|
2406
|
+
if (!a || !e.some((h) => h.test(a))) continue;
|
|
2513
2407
|
r = !0;
|
|
2514
|
-
for (const
|
|
2515
|
-
|
|
2516
|
-
if (n ===
|
|
2408
|
+
for (const h of no)
|
|
2409
|
+
h.hints.some((f) => a.includes(f)) && (n |= h.flag);
|
|
2410
|
+
if (n === nt)
|
|
2517
2411
|
return { mask: n, sawStyleRule: !0 };
|
|
2518
2412
|
} else if ("cssRules" in s) {
|
|
2519
|
-
const i =
|
|
2520
|
-
if (i.mask && (n |= i.mask, n ===
|
|
2413
|
+
const i = Xt(s.cssRules, e);
|
|
2414
|
+
if (i.mask && (n |= i.mask, n === nt))
|
|
2521
2415
|
return { mask: n, sawStyleRule: !0 };
|
|
2522
2416
|
r ||= i.sawStyleRule;
|
|
2523
2417
|
}
|
|
@@ -2525,58 +2419,58 @@ function en(t, e) {
|
|
|
2525
2419
|
}
|
|
2526
2420
|
return { mask: n, sawStyleRule: r };
|
|
2527
2421
|
}
|
|
2528
|
-
function
|
|
2422
|
+
function Ro(t) {
|
|
2529
2423
|
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
2530
2424
|
}
|
|
2531
|
-
function
|
|
2425
|
+
function Ao(t) {
|
|
2532
2426
|
return t.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
|
|
2533
2427
|
}
|
|
2534
|
-
const
|
|
2535
|
-
function
|
|
2428
|
+
const ct = "ikon-auth-session", Ht = "ikon-auth-auto-login-attempted-run", To = 10080 * 60 * 1e3, ko = 60 * 1e3;
|
|
2429
|
+
function qt(t) {
|
|
2536
2430
|
try {
|
|
2537
2431
|
const e = t.split(".");
|
|
2538
2432
|
if (e.length !== 3) return !0;
|
|
2539
2433
|
const n = e[1].replace(/-/g, "+").replace(/_/g, "/"), r = n + "=".repeat((4 - n.length % 4) % 4), o = JSON.parse(atob(r));
|
|
2540
|
-
return typeof o.exp != "number" ? !1 : Date.now() >= o.exp * 1e3 -
|
|
2434
|
+
return typeof o.exp != "number" ? !1 : Date.now() >= o.exp * 1e3 - ko;
|
|
2541
2435
|
} catch {
|
|
2542
2436
|
return !0;
|
|
2543
2437
|
}
|
|
2544
2438
|
}
|
|
2545
2439
|
function he(t) {
|
|
2546
2440
|
try {
|
|
2547
|
-
localStorage.setItem(
|
|
2441
|
+
localStorage.setItem(ct, JSON.stringify(t));
|
|
2548
2442
|
} catch {
|
|
2549
2443
|
console.warn("Failed to save auth session to localStorage");
|
|
2550
2444
|
}
|
|
2551
2445
|
}
|
|
2552
|
-
function
|
|
2446
|
+
function Jt() {
|
|
2553
2447
|
try {
|
|
2554
|
-
const t = localStorage.getItem(
|
|
2448
|
+
const t = localStorage.getItem(ct);
|
|
2555
2449
|
if (!t) return null;
|
|
2556
2450
|
const e = JSON.parse(t);
|
|
2557
|
-
return Date.now() - e.authenticatedAt >
|
|
2451
|
+
return Date.now() - e.authenticatedAt > To || qt(e.token) ? (Le(), null) : e;
|
|
2558
2452
|
} catch {
|
|
2559
2453
|
return console.warn("Failed to load auth session from localStorage"), null;
|
|
2560
2454
|
}
|
|
2561
2455
|
}
|
|
2562
|
-
function
|
|
2456
|
+
function Le() {
|
|
2563
2457
|
try {
|
|
2564
|
-
localStorage.removeItem(
|
|
2458
|
+
localStorage.removeItem(ct);
|
|
2565
2459
|
} catch {
|
|
2566
2460
|
console.warn("Failed to clear auth session from localStorage");
|
|
2567
2461
|
}
|
|
2568
2462
|
}
|
|
2569
|
-
function
|
|
2463
|
+
function Co(t) {
|
|
2570
2464
|
if (t)
|
|
2571
2465
|
try {
|
|
2572
|
-
sessionStorage.setItem(
|
|
2466
|
+
sessionStorage.setItem(Ht, t);
|
|
2573
2467
|
} catch {
|
|
2574
2468
|
console.warn("Failed to record auto-login attempt in sessionStorage");
|
|
2575
2469
|
}
|
|
2576
2470
|
}
|
|
2577
|
-
function
|
|
2471
|
+
function Io() {
|
|
2578
2472
|
try {
|
|
2579
|
-
return sessionStorage.getItem(
|
|
2473
|
+
return sessionStorage.getItem(Ht);
|
|
2580
2474
|
} catch {
|
|
2581
2475
|
return null;
|
|
2582
2476
|
}
|
|
@@ -2589,42 +2483,42 @@ function ne(t) {
|
|
|
2589
2483
|
authenticatedAt: t.authenticatedAt
|
|
2590
2484
|
};
|
|
2591
2485
|
}
|
|
2592
|
-
const
|
|
2593
|
-
async function
|
|
2486
|
+
const Zt = 15e3, we = oe("AuthService");
|
|
2487
|
+
async function xt(t) {
|
|
2594
2488
|
try {
|
|
2595
2489
|
return await fetch(t, { method: "GET", mode: "no-cors" }), "no-cors probe SUCCEEDED → origin is reachable; the failure is most likely CORS (missing/!allowed Access-Control headers)";
|
|
2596
2490
|
} catch (e) {
|
|
2597
2491
|
return `no-cors probe ALSO FAILED (${e instanceof Error ? e.name : "Error"}) → origin is unreachable: TLS handshake / certificate, DNS, or network (old browser may not trust this host's cert)`;
|
|
2598
2492
|
}
|
|
2599
2493
|
}
|
|
2600
|
-
async function
|
|
2601
|
-
const n =
|
|
2494
|
+
async function Qt(t, e) {
|
|
2495
|
+
const n = kn(), r = {
|
|
2602
2496
|
method: "POST",
|
|
2603
2497
|
headers: { "Content-Type": "application/json" },
|
|
2604
2498
|
body: JSON.stringify({ deviceId: n, space: t })
|
|
2605
2499
|
}, o = typeof window < "u" ? window.location.origin : "?", s = `${e}/anonymous`;
|
|
2606
|
-
|
|
2500
|
+
we.info(`Anonymous auth: POST ${s} (space=${t}, origin=${o})`);
|
|
2607
2501
|
let i;
|
|
2608
2502
|
try {
|
|
2609
2503
|
i = await fetch(s, r);
|
|
2610
|
-
} catch (
|
|
2611
|
-
const
|
|
2504
|
+
} catch (h) {
|
|
2505
|
+
const f = h instanceof Error ? `${h.name}: ${h.message}` : String(h), y = Cn(), m = y ? `${y}/anonymous` : null;
|
|
2612
2506
|
if (m && m !== s) {
|
|
2613
|
-
|
|
2507
|
+
we.warn(`Anonymous auth could not reach ${s} (${f}); falling back to same-origin ${m}`);
|
|
2614
2508
|
try {
|
|
2615
2509
|
i = await fetch(m, r);
|
|
2616
2510
|
} catch (c) {
|
|
2617
|
-
const u = c instanceof Error ? `${c.name}: ${c.message}` : String(c), g = await
|
|
2618
|
-
throw
|
|
2511
|
+
const u = c instanceof Error ? `${c.name}: ${c.message}` : String(c), g = await xt(e);
|
|
2512
|
+
throw we.error(`Anonymous auth failed on both direct (${s}: ${f}) and same-origin (${m}: ${u}). ${g}`), new Error(`Anonymous auth unreachable: direct ${s} (${f}) and same-origin ${m} (${u})`);
|
|
2619
2513
|
}
|
|
2620
2514
|
} else {
|
|
2621
|
-
const c = await
|
|
2622
|
-
throw
|
|
2515
|
+
const c = await xt(e);
|
|
2516
|
+
throw we.error(`Anonymous auth fetch threw for ${s} — ${f}. ${c}`), new Error(`Anonymous auth could not reach ${s} (${f}). ${c}`);
|
|
2623
2517
|
}
|
|
2624
2518
|
}
|
|
2625
2519
|
if (!i.ok) {
|
|
2626
|
-
const
|
|
2627
|
-
throw
|
|
2520
|
+
const h = await i.text().catch(() => "Unknown error");
|
|
2521
|
+
throw we.error(`Anonymous auth HTTP ${i.status} from ${i.url}: ${h}`), new Error(`Anonymous auth failed: ${i.status} ${h}`);
|
|
2628
2522
|
}
|
|
2629
2523
|
const { token: a } = await i.json(), l = {
|
|
2630
2524
|
token: a,
|
|
@@ -2633,7 +2527,7 @@ async function sn(t, e) {
|
|
|
2633
2527
|
};
|
|
2634
2528
|
return he(l), l;
|
|
2635
2529
|
}
|
|
2636
|
-
async function
|
|
2530
|
+
async function _o({ email: t, spaceId: e, authUrl: n }) {
|
|
2637
2531
|
const r = await fetch(`${n}/email/send`, {
|
|
2638
2532
|
method: "POST",
|
|
2639
2533
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2641,14 +2535,14 @@ async function Qo({ email: t, spaceId: e, authUrl: n }) {
|
|
|
2641
2535
|
email: t.trim(),
|
|
2642
2536
|
space: e
|
|
2643
2537
|
}),
|
|
2644
|
-
signal:
|
|
2538
|
+
signal: Dt(Zt)
|
|
2645
2539
|
});
|
|
2646
2540
|
if (!r.ok) {
|
|
2647
2541
|
const o = await r.text().catch(() => "Failed to send login code");
|
|
2648
2542
|
throw new Error(o);
|
|
2649
2543
|
}
|
|
2650
2544
|
}
|
|
2651
|
-
async function
|
|
2545
|
+
async function Oo({ email: t, code: e, authUrl: n }) {
|
|
2652
2546
|
const r = await fetch(`${n}/email/code`, {
|
|
2653
2547
|
method: "POST",
|
|
2654
2548
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2656,7 +2550,7 @@ async function es({ email: t, code: e, authUrl: n }) {
|
|
|
2656
2550
|
email: t.trim(),
|
|
2657
2551
|
code: e.trim()
|
|
2658
2552
|
}),
|
|
2659
|
-
signal:
|
|
2553
|
+
signal: Dt(Zt)
|
|
2660
2554
|
});
|
|
2661
2555
|
if (!r.ok) {
|
|
2662
2556
|
const i = await r.text().catch(() => "Invalid code");
|
|
@@ -2669,21 +2563,21 @@ async function es({ email: t, code: e, authUrl: n }) {
|
|
|
2669
2563
|
};
|
|
2670
2564
|
return he(s), s;
|
|
2671
2565
|
}
|
|
2672
|
-
function
|
|
2566
|
+
function xo() {
|
|
2673
2567
|
const t = new URLSearchParams(window.location.search), e = t.get("ikon_token"), n = t.get("ikon_provider");
|
|
2674
2568
|
return e && n ? { token: e, provider: n } : null;
|
|
2675
2569
|
}
|
|
2676
|
-
function
|
|
2570
|
+
function No() {
|
|
2677
2571
|
return new URLSearchParams(window.location.search).get("error");
|
|
2678
2572
|
}
|
|
2679
|
-
function
|
|
2573
|
+
function Nt() {
|
|
2680
2574
|
window.history.replaceState({}, "", window.location.pathname);
|
|
2681
2575
|
}
|
|
2682
|
-
function
|
|
2576
|
+
function Lo(t, e, n, r) {
|
|
2683
2577
|
const o = r ?? window.location.origin + window.location.pathname + window.location.search;
|
|
2684
2578
|
return `${n}/oauth/${t}?space=${encodeURIComponent(e)}&return=${encodeURIComponent(o)}`;
|
|
2685
2579
|
}
|
|
2686
|
-
async function
|
|
2580
|
+
async function Po(t) {
|
|
2687
2581
|
const e = await fetch(`${t}/passkey/registration/options`, {
|
|
2688
2582
|
method: "POST",
|
|
2689
2583
|
headers: { "Content-Type": "application/json" }
|
|
@@ -2694,7 +2588,7 @@ async function os(t) {
|
|
|
2694
2588
|
}
|
|
2695
2589
|
return e.json();
|
|
2696
2590
|
}
|
|
2697
|
-
async function
|
|
2591
|
+
async function Uo(t, e, n) {
|
|
2698
2592
|
const r = await fetch(`${t}/passkey/registration/verify`, {
|
|
2699
2593
|
method: "POST",
|
|
2700
2594
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2711,7 +2605,7 @@ async function ss(t, e, n) {
|
|
|
2711
2605
|
};
|
|
2712
2606
|
return he(s), s;
|
|
2713
2607
|
}
|
|
2714
|
-
async function
|
|
2608
|
+
async function Mo(t, e) {
|
|
2715
2609
|
const n = await fetch(`${t}/passkey/authentication/options`, {
|
|
2716
2610
|
method: "POST",
|
|
2717
2611
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2723,7 +2617,7 @@ async function is(t, e) {
|
|
|
2723
2617
|
}
|
|
2724
2618
|
return n.json();
|
|
2725
2619
|
}
|
|
2726
|
-
async function
|
|
2620
|
+
async function Do(t, e) {
|
|
2727
2621
|
const n = await fetch(`${t}/passkey/authentication/verify`, {
|
|
2728
2622
|
method: "POST",
|
|
2729
2623
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2747,23 +2641,23 @@ function X(t) {
|
|
|
2747
2641
|
n += String.fromCharCode(o);
|
|
2748
2642
|
return btoa(n).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
2749
2643
|
}
|
|
2750
|
-
function
|
|
2644
|
+
function Pe(t) {
|
|
2751
2645
|
const e = t.replace(/-/g, "+").replace(/_/g, "/"), n = (4 - e.length % 4) % 4, r = e.padEnd(e.length + n, "="), o = atob(r), s = new ArrayBuffer(o.length), i = new Uint8Array(s);
|
|
2752
2646
|
for (let a = 0; a < o.length; a++)
|
|
2753
2647
|
i[a] = o.charCodeAt(a);
|
|
2754
2648
|
return s;
|
|
2755
2649
|
}
|
|
2756
|
-
function
|
|
2757
|
-
return
|
|
2650
|
+
function lt() {
|
|
2651
|
+
return jo.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
|
|
2758
2652
|
}
|
|
2759
|
-
const
|
|
2653
|
+
const jo = {
|
|
2760
2654
|
stubThis: (t) => t
|
|
2761
2655
|
};
|
|
2762
|
-
function
|
|
2656
|
+
function en(t) {
|
|
2763
2657
|
const { id: e } = t;
|
|
2764
2658
|
return {
|
|
2765
2659
|
...t,
|
|
2766
|
-
id:
|
|
2660
|
+
id: Pe(e),
|
|
2767
2661
|
/**
|
|
2768
2662
|
* `descriptor.transports` is an array of our `AuthenticatorTransportFuture` that includes newer
|
|
2769
2663
|
* transports that TypeScript's DOM lib is ignorant of. Convince TS that our list of transports
|
|
@@ -2772,14 +2666,14 @@ function an(t) {
|
|
|
2772
2666
|
transports: t.transports
|
|
2773
2667
|
};
|
|
2774
2668
|
}
|
|
2775
|
-
function
|
|
2669
|
+
function tn(t) {
|
|
2776
2670
|
return (
|
|
2777
2671
|
// Consider localhost valid as well since it's okay wrt Secure Contexts
|
|
2778
2672
|
t === "localhost" || // Support punycode (ACE) or ascii labels and domains
|
|
2779
2673
|
/^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(t)
|
|
2780
2674
|
);
|
|
2781
2675
|
}
|
|
2782
|
-
class
|
|
2676
|
+
class D extends Error {
|
|
2783
2677
|
constructor({ message: e, code: n, cause: r, name: o }) {
|
|
2784
2678
|
super(e, { cause: r }), Object.defineProperty(this, "code", {
|
|
2785
2679
|
enumerable: !0,
|
|
@@ -2789,20 +2683,20 @@ class j extends Error {
|
|
|
2789
2683
|
}), this.name = o ?? r.name, this.code = n;
|
|
2790
2684
|
}
|
|
2791
2685
|
}
|
|
2792
|
-
function
|
|
2686
|
+
function $o({ error: t, options: e }) {
|
|
2793
2687
|
const { publicKey: n } = e;
|
|
2794
2688
|
if (!n)
|
|
2795
2689
|
throw Error("options was missing required publicKey property");
|
|
2796
2690
|
if (t.name === "AbortError") {
|
|
2797
2691
|
if (e.signal instanceof AbortSignal)
|
|
2798
|
-
return new
|
|
2692
|
+
return new D({
|
|
2799
2693
|
message: "Registration ceremony was sent an abort signal",
|
|
2800
2694
|
code: "ERROR_CEREMONY_ABORTED",
|
|
2801
2695
|
cause: t
|
|
2802
2696
|
});
|
|
2803
2697
|
} else if (t.name === "ConstraintError") {
|
|
2804
2698
|
if (n.authenticatorSelection?.requireResidentKey === !0)
|
|
2805
|
-
return new
|
|
2699
|
+
return new D({
|
|
2806
2700
|
message: "Discoverable credentials were required but no available authenticator supported it",
|
|
2807
2701
|
code: "ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",
|
|
2808
2702
|
cause: t
|
|
@@ -2811,63 +2705,63 @@ function ls({ error: t, options: e }) {
|
|
|
2811
2705
|
// @ts-ignore: `mediation` doesn't yet exist on CredentialCreationOptions but it's possible as of Sept 2024
|
|
2812
2706
|
e.mediation === "conditional" && n.authenticatorSelection?.userVerification === "required"
|
|
2813
2707
|
)
|
|
2814
|
-
return new
|
|
2708
|
+
return new D({
|
|
2815
2709
|
message: "User verification was required during automatic registration but it could not be performed",
|
|
2816
2710
|
code: "ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",
|
|
2817
2711
|
cause: t
|
|
2818
2712
|
});
|
|
2819
2713
|
if (n.authenticatorSelection?.userVerification === "required")
|
|
2820
|
-
return new
|
|
2714
|
+
return new D({
|
|
2821
2715
|
message: "User verification was required but no available authenticator supported it",
|
|
2822
2716
|
code: "ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",
|
|
2823
2717
|
cause: t
|
|
2824
2718
|
});
|
|
2825
2719
|
} else {
|
|
2826
2720
|
if (t.name === "InvalidStateError")
|
|
2827
|
-
return new
|
|
2721
|
+
return new D({
|
|
2828
2722
|
message: "The authenticator was previously registered",
|
|
2829
2723
|
code: "ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",
|
|
2830
2724
|
cause: t
|
|
2831
2725
|
});
|
|
2832
2726
|
if (t.name === "NotAllowedError")
|
|
2833
|
-
return new
|
|
2727
|
+
return new D({
|
|
2834
2728
|
message: t.message,
|
|
2835
2729
|
code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
|
|
2836
2730
|
cause: t
|
|
2837
2731
|
});
|
|
2838
2732
|
if (t.name === "NotSupportedError")
|
|
2839
|
-
return n.pubKeyCredParams.filter((o) => o.type === "public-key").length === 0 ? new
|
|
2733
|
+
return n.pubKeyCredParams.filter((o) => o.type === "public-key").length === 0 ? new D({
|
|
2840
2734
|
message: 'No entry in pubKeyCredParams was of type "public-key"',
|
|
2841
2735
|
code: "ERROR_MALFORMED_PUBKEYCREDPARAMS",
|
|
2842
2736
|
cause: t
|
|
2843
|
-
}) : new
|
|
2737
|
+
}) : new D({
|
|
2844
2738
|
message: "No available authenticator supported any of the specified pubKeyCredParams algorithms",
|
|
2845
2739
|
code: "ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",
|
|
2846
2740
|
cause: t
|
|
2847
2741
|
});
|
|
2848
2742
|
if (t.name === "SecurityError") {
|
|
2849
2743
|
const r = globalThis.location.hostname;
|
|
2850
|
-
if (
|
|
2744
|
+
if (tn(r)) {
|
|
2851
2745
|
if (n.rp.id !== r)
|
|
2852
|
-
return new
|
|
2746
|
+
return new D({
|
|
2853
2747
|
message: `The RP ID "${n.rp.id}" is invalid for this domain`,
|
|
2854
2748
|
code: "ERROR_INVALID_RP_ID",
|
|
2855
2749
|
cause: t
|
|
2856
2750
|
});
|
|
2857
|
-
} else return new
|
|
2751
|
+
} else return new D({
|
|
2858
2752
|
message: `${globalThis.location.hostname} is an invalid domain`,
|
|
2859
2753
|
code: "ERROR_INVALID_DOMAIN",
|
|
2860
2754
|
cause: t
|
|
2861
2755
|
});
|
|
2862
2756
|
} else if (t.name === "TypeError") {
|
|
2863
2757
|
if (n.user.id.byteLength < 1 || n.user.id.byteLength > 64)
|
|
2864
|
-
return new
|
|
2758
|
+
return new D({
|
|
2865
2759
|
message: "User ID was not between 1 and 64 characters",
|
|
2866
2760
|
code: "ERROR_INVALID_USER_ID_LENGTH",
|
|
2867
2761
|
cause: t
|
|
2868
2762
|
});
|
|
2869
2763
|
} else if (t.name === "UnknownError")
|
|
2870
|
-
return new
|
|
2764
|
+
return new D({
|
|
2871
2765
|
message: "The authenticator was unable to process the specified options, or could not create a new credential",
|
|
2872
2766
|
code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
|
|
2873
2767
|
cause: t
|
|
@@ -2875,7 +2769,7 @@ function ls({ error: t, options: e }) {
|
|
|
2875
2769
|
}
|
|
2876
2770
|
return t;
|
|
2877
2771
|
}
|
|
2878
|
-
class
|
|
2772
|
+
class Bo {
|
|
2879
2773
|
constructor() {
|
|
2880
2774
|
Object.defineProperty(this, "controller", {
|
|
2881
2775
|
enumerable: !0,
|
|
@@ -2899,43 +2793,43 @@ class us {
|
|
|
2899
2793
|
}
|
|
2900
2794
|
}
|
|
2901
2795
|
}
|
|
2902
|
-
const
|
|
2903
|
-
function
|
|
2904
|
-
if (t && !(
|
|
2796
|
+
const nn = new Bo(), Fo = ["cross-platform", "platform"];
|
|
2797
|
+
function rn(t) {
|
|
2798
|
+
if (t && !(Fo.indexOf(t) < 0))
|
|
2905
2799
|
return t;
|
|
2906
2800
|
}
|
|
2907
|
-
async function
|
|
2801
|
+
async function Vo(t) {
|
|
2908
2802
|
!t.optionsJSON && t.challenge && (console.warn("startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."), t = { optionsJSON: t });
|
|
2909
2803
|
const { optionsJSON: e, useAutoRegister: n = !1 } = t;
|
|
2910
|
-
if (!
|
|
2804
|
+
if (!lt())
|
|
2911
2805
|
throw new Error("WebAuthn is not supported in this browser");
|
|
2912
2806
|
const r = {
|
|
2913
2807
|
...e,
|
|
2914
|
-
challenge:
|
|
2808
|
+
challenge: Pe(e.challenge),
|
|
2915
2809
|
user: {
|
|
2916
2810
|
...e.user,
|
|
2917
|
-
id:
|
|
2811
|
+
id: Pe(e.user.id)
|
|
2918
2812
|
},
|
|
2919
|
-
excludeCredentials: e.excludeCredentials?.map(
|
|
2813
|
+
excludeCredentials: e.excludeCredentials?.map(en)
|
|
2920
2814
|
}, o = {};
|
|
2921
|
-
n && (o.mediation = "conditional"), o.publicKey = r, o.signal =
|
|
2815
|
+
n && (o.mediation = "conditional"), o.publicKey = r, o.signal = nn.createNewAbortSignal();
|
|
2922
2816
|
let s;
|
|
2923
2817
|
try {
|
|
2924
2818
|
s = await navigator.credentials.create(o);
|
|
2925
2819
|
} catch (u) {
|
|
2926
|
-
throw
|
|
2820
|
+
throw $o({ error: u, options: o });
|
|
2927
2821
|
}
|
|
2928
2822
|
if (!s)
|
|
2929
2823
|
throw new Error("Registration was not completed");
|
|
2930
|
-
const { id: i, rawId: a, response: l, type:
|
|
2931
|
-
let
|
|
2932
|
-
typeof l.getTransports == "function" && (
|
|
2824
|
+
const { id: i, rawId: a, response: l, type: h } = s;
|
|
2825
|
+
let f;
|
|
2826
|
+
typeof l.getTransports == "function" && (f = l.getTransports());
|
|
2933
2827
|
let y;
|
|
2934
2828
|
if (typeof l.getPublicKeyAlgorithm == "function")
|
|
2935
2829
|
try {
|
|
2936
2830
|
y = l.getPublicKeyAlgorithm();
|
|
2937
2831
|
} catch (u) {
|
|
2938
|
-
|
|
2832
|
+
He("getPublicKeyAlgorithm()", u);
|
|
2939
2833
|
}
|
|
2940
2834
|
let m;
|
|
2941
2835
|
if (typeof l.getPublicKey == "function")
|
|
@@ -2943,14 +2837,14 @@ async function fs(t) {
|
|
|
2943
2837
|
const u = l.getPublicKey();
|
|
2944
2838
|
u !== null && (m = X(u));
|
|
2945
2839
|
} catch (u) {
|
|
2946
|
-
|
|
2840
|
+
He("getPublicKey()", u);
|
|
2947
2841
|
}
|
|
2948
2842
|
let c;
|
|
2949
2843
|
if (typeof l.getAuthenticatorData == "function")
|
|
2950
2844
|
try {
|
|
2951
2845
|
c = X(l.getAuthenticatorData());
|
|
2952
2846
|
} catch (u) {
|
|
2953
|
-
|
|
2847
|
+
He("getAuthenticatorData()", u);
|
|
2954
2848
|
}
|
|
2955
2849
|
return {
|
|
2956
2850
|
id: i,
|
|
@@ -2958,63 +2852,63 @@ async function fs(t) {
|
|
|
2958
2852
|
response: {
|
|
2959
2853
|
attestationObject: X(l.attestationObject),
|
|
2960
2854
|
clientDataJSON: X(l.clientDataJSON),
|
|
2961
|
-
transports:
|
|
2855
|
+
transports: f,
|
|
2962
2856
|
publicKeyAlgorithm: y,
|
|
2963
2857
|
publicKey: m,
|
|
2964
2858
|
authenticatorData: c
|
|
2965
2859
|
},
|
|
2966
|
-
type:
|
|
2860
|
+
type: h,
|
|
2967
2861
|
clientExtensionResults: s.getClientExtensionResults(),
|
|
2968
|
-
authenticatorAttachment:
|
|
2862
|
+
authenticatorAttachment: rn(s.authenticatorAttachment)
|
|
2969
2863
|
};
|
|
2970
2864
|
}
|
|
2971
|
-
function
|
|
2865
|
+
function He(t, e) {
|
|
2972
2866
|
console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${t}. You should report this error to them.
|
|
2973
2867
|
`, e);
|
|
2974
2868
|
}
|
|
2975
|
-
function
|
|
2976
|
-
if (!
|
|
2977
|
-
return
|
|
2869
|
+
function Wo() {
|
|
2870
|
+
if (!lt())
|
|
2871
|
+
return qe.stubThis(new Promise((e) => e(!1)));
|
|
2978
2872
|
const t = globalThis.PublicKeyCredential;
|
|
2979
|
-
return t?.isConditionalMediationAvailable === void 0 ?
|
|
2873
|
+
return t?.isConditionalMediationAvailable === void 0 ? qe.stubThis(new Promise((e) => e(!1))) : qe.stubThis(t.isConditionalMediationAvailable());
|
|
2980
2874
|
}
|
|
2981
|
-
const
|
|
2875
|
+
const qe = {
|
|
2982
2876
|
stubThis: (t) => t
|
|
2983
2877
|
};
|
|
2984
|
-
function
|
|
2878
|
+
function Ko({ error: t, options: e }) {
|
|
2985
2879
|
const { publicKey: n } = e;
|
|
2986
2880
|
if (!n)
|
|
2987
2881
|
throw Error("options was missing required publicKey property");
|
|
2988
2882
|
if (t.name === "AbortError") {
|
|
2989
2883
|
if (e.signal instanceof AbortSignal)
|
|
2990
|
-
return new
|
|
2884
|
+
return new D({
|
|
2991
2885
|
message: "Authentication ceremony was sent an abort signal",
|
|
2992
2886
|
code: "ERROR_CEREMONY_ABORTED",
|
|
2993
2887
|
cause: t
|
|
2994
2888
|
});
|
|
2995
2889
|
} else {
|
|
2996
2890
|
if (t.name === "NotAllowedError")
|
|
2997
|
-
return new
|
|
2891
|
+
return new D({
|
|
2998
2892
|
message: t.message,
|
|
2999
2893
|
code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
|
|
3000
2894
|
cause: t
|
|
3001
2895
|
});
|
|
3002
2896
|
if (t.name === "SecurityError") {
|
|
3003
2897
|
const r = globalThis.location.hostname;
|
|
3004
|
-
if (
|
|
2898
|
+
if (tn(r)) {
|
|
3005
2899
|
if (n.rpId !== r)
|
|
3006
|
-
return new
|
|
2900
|
+
return new D({
|
|
3007
2901
|
message: `The RP ID "${n.rpId}" is invalid for this domain`,
|
|
3008
2902
|
code: "ERROR_INVALID_RP_ID",
|
|
3009
2903
|
cause: t
|
|
3010
2904
|
});
|
|
3011
|
-
} else return new
|
|
2905
|
+
} else return new D({
|
|
3012
2906
|
message: `${globalThis.location.hostname} is an invalid domain`,
|
|
3013
2907
|
code: "ERROR_INVALID_DOMAIN",
|
|
3014
2908
|
cause: t
|
|
3015
2909
|
});
|
|
3016
2910
|
} else if (t.name === "UnknownError")
|
|
3017
|
-
return new
|
|
2911
|
+
return new D({
|
|
3018
2912
|
message: "The authenticator was unable to process the specified options, or could not create a new assertion signature",
|
|
3019
2913
|
code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
|
|
3020
2914
|
cause: t
|
|
@@ -3022,53 +2916,53 @@ function ps({ error: t, options: e }) {
|
|
|
3022
2916
|
}
|
|
3023
2917
|
return t;
|
|
3024
2918
|
}
|
|
3025
|
-
async function
|
|
2919
|
+
async function Yo(t) {
|
|
3026
2920
|
!t.optionsJSON && t.challenge && (console.warn("startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."), t = { optionsJSON: t });
|
|
3027
2921
|
const { optionsJSON: e, useBrowserAutofill: n = !1, verifyBrowserAutofillInput: r = !0 } = t;
|
|
3028
|
-
if (!
|
|
2922
|
+
if (!lt())
|
|
3029
2923
|
throw new Error("WebAuthn is not supported in this browser");
|
|
3030
2924
|
let o;
|
|
3031
|
-
e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(
|
|
2925
|
+
e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(en));
|
|
3032
2926
|
const s = {
|
|
3033
2927
|
...e,
|
|
3034
|
-
challenge:
|
|
2928
|
+
challenge: Pe(e.challenge),
|
|
3035
2929
|
allowCredentials: o
|
|
3036
2930
|
}, i = {};
|
|
3037
2931
|
if (n) {
|
|
3038
|
-
if (!await
|
|
2932
|
+
if (!await Wo())
|
|
3039
2933
|
throw Error("Browser does not support WebAuthn autofill");
|
|
3040
2934
|
if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 && r)
|
|
3041
2935
|
throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
|
|
3042
2936
|
i.mediation = "conditional", s.allowCredentials = [];
|
|
3043
2937
|
}
|
|
3044
|
-
i.publicKey = s, i.signal =
|
|
2938
|
+
i.publicKey = s, i.signal = nn.createNewAbortSignal();
|
|
3045
2939
|
let a;
|
|
3046
2940
|
try {
|
|
3047
2941
|
a = await navigator.credentials.get(i);
|
|
3048
2942
|
} catch (c) {
|
|
3049
|
-
throw
|
|
2943
|
+
throw Ko({ error: c, options: i });
|
|
3050
2944
|
}
|
|
3051
2945
|
if (!a)
|
|
3052
2946
|
throw new Error("Authentication was not completed");
|
|
3053
|
-
const { id: l, rawId:
|
|
2947
|
+
const { id: l, rawId: h, response: f, type: y } = a;
|
|
3054
2948
|
let m;
|
|
3055
|
-
return
|
|
2949
|
+
return f.userHandle && (m = X(f.userHandle)), {
|
|
3056
2950
|
id: l,
|
|
3057
|
-
rawId: X(
|
|
2951
|
+
rawId: X(h),
|
|
3058
2952
|
response: {
|
|
3059
|
-
authenticatorData: X(
|
|
3060
|
-
clientDataJSON: X(
|
|
3061
|
-
signature: X(
|
|
2953
|
+
authenticatorData: X(f.authenticatorData),
|
|
2954
|
+
clientDataJSON: X(f.clientDataJSON),
|
|
2955
|
+
signature: X(f.signature),
|
|
3062
2956
|
userHandle: m
|
|
3063
2957
|
},
|
|
3064
2958
|
type: y,
|
|
3065
2959
|
clientExtensionResults: a.getClientExtensionResults(),
|
|
3066
|
-
authenticatorAttachment:
|
|
2960
|
+
authenticatorAttachment: rn(a.authenticatorAttachment)
|
|
3067
2961
|
};
|
|
3068
2962
|
}
|
|
3069
|
-
const
|
|
3070
|
-
function
|
|
3071
|
-
const [n, r] =
|
|
2963
|
+
const ut = Mt(null);
|
|
2964
|
+
function _s({ children: t, config: e }) {
|
|
2965
|
+
const [n, r] = x({
|
|
3072
2966
|
isAuthenticated: !1,
|
|
3073
2967
|
isLoading: !0,
|
|
3074
2968
|
user: null,
|
|
@@ -3076,11 +2970,11 @@ function ni({ children: t, config: e }) {
|
|
|
3076
2970
|
});
|
|
3077
2971
|
C(() => {
|
|
3078
2972
|
(() => {
|
|
3079
|
-
const m = e.devLoginRunId, c = !!m &&
|
|
3080
|
-
m &&
|
|
3081
|
-
const u =
|
|
2973
|
+
const m = e.devLoginRunId, c = !!m && Io() === m;
|
|
2974
|
+
m && Co(m);
|
|
2975
|
+
const u = No();
|
|
3082
2976
|
if (u) {
|
|
3083
|
-
|
|
2977
|
+
Nt(), r({
|
|
3084
2978
|
isAuthenticated: !1,
|
|
3085
2979
|
isLoading: !1,
|
|
3086
2980
|
user: null,
|
|
@@ -3088,14 +2982,14 @@ function ni({ children: t, config: e }) {
|
|
|
3088
2982
|
});
|
|
3089
2983
|
return;
|
|
3090
2984
|
}
|
|
3091
|
-
const g =
|
|
2985
|
+
const g = xo();
|
|
3092
2986
|
if (g) {
|
|
3093
2987
|
const b = {
|
|
3094
2988
|
token: g.token,
|
|
3095
2989
|
provider: g.provider,
|
|
3096
2990
|
authenticatedAt: Date.now()
|
|
3097
2991
|
};
|
|
3098
|
-
he(b),
|
|
2992
|
+
he(b), Nt(), r({
|
|
3099
2993
|
isAuthenticated: !0,
|
|
3100
2994
|
isLoading: !1,
|
|
3101
2995
|
user: ne(b),
|
|
@@ -3103,7 +2997,7 @@ function ni({ children: t, config: e }) {
|
|
|
3103
2997
|
});
|
|
3104
2998
|
return;
|
|
3105
2999
|
}
|
|
3106
|
-
const p =
|
|
3000
|
+
const p = Jt();
|
|
3107
3001
|
if (p) {
|
|
3108
3002
|
r({
|
|
3109
3003
|
isAuthenticated: !0,
|
|
@@ -3113,7 +3007,7 @@ function ni({ children: t, config: e }) {
|
|
|
3113
3007
|
});
|
|
3114
3008
|
return;
|
|
3115
3009
|
}
|
|
3116
|
-
if (e.devLoginToken && m && !c && !
|
|
3010
|
+
if (e.devLoginToken && m && !c && !qt(e.devLoginToken)) {
|
|
3117
3011
|
const b = {
|
|
3118
3012
|
token: e.devLoginToken,
|
|
3119
3013
|
provider: "dev",
|
|
@@ -3135,7 +3029,7 @@ function ni({ children: t, config: e }) {
|
|
|
3135
3029
|
});
|
|
3136
3030
|
})();
|
|
3137
3031
|
}, [e.devLoginToken, e.devLoginRunId]);
|
|
3138
|
-
const o =
|
|
3032
|
+
const o = j(
|
|
3139
3033
|
async (y) => {
|
|
3140
3034
|
if (!e.spaceId) {
|
|
3141
3035
|
r((c) => ({
|
|
@@ -3144,11 +3038,11 @@ function ni({ children: t, config: e }) {
|
|
|
3144
3038
|
}));
|
|
3145
3039
|
return;
|
|
3146
3040
|
}
|
|
3147
|
-
const m = await
|
|
3041
|
+
const m = await ve(e.authUrl);
|
|
3148
3042
|
if (y === "guest") {
|
|
3149
3043
|
r((c) => ({ ...c, isLoading: !0 }));
|
|
3150
3044
|
try {
|
|
3151
|
-
const c = await
|
|
3045
|
+
const c = await Qt(e.spaceId, m);
|
|
3152
3046
|
r({
|
|
3153
3047
|
isAuthenticated: !0,
|
|
3154
3048
|
isLoading: !1,
|
|
@@ -3167,7 +3061,7 @@ function ni({ children: t, config: e }) {
|
|
|
3167
3061
|
if (y === "passkey") {
|
|
3168
3062
|
r((c) => ({ ...c, isLoading: !0, error: null }));
|
|
3169
3063
|
try {
|
|
3170
|
-
const c = await
|
|
3064
|
+
const c = await Mo(m), u = await Yo({ optionsJSON: c }), g = await Do(m, u);
|
|
3171
3065
|
r({
|
|
3172
3066
|
isAuthenticated: !0,
|
|
3173
3067
|
isLoading: !1,
|
|
@@ -3185,22 +3079,22 @@ function ni({ children: t, config: e }) {
|
|
|
3185
3079
|
}
|
|
3186
3080
|
if (y === "email")
|
|
3187
3081
|
throw new Error("login('email') is not supported. Use requestEmailCode()/submitEmailCode() from useAuth() instead.");
|
|
3188
|
-
window.location.href =
|
|
3082
|
+
window.location.href = Lo(y, e.spaceId, m);
|
|
3189
3083
|
},
|
|
3190
3084
|
[e.authUrl, e.spaceId]
|
|
3191
|
-
), s =
|
|
3085
|
+
), s = j(
|
|
3192
3086
|
async (y) => {
|
|
3193
3087
|
if (!e.spaceId)
|
|
3194
3088
|
throw r((c) => ({ ...c, error: "Space ID is not configured" })), new Error("Space ID is not configured");
|
|
3195
|
-
const m = await
|
|
3196
|
-
await
|
|
3089
|
+
const m = await ve(e.authUrl);
|
|
3090
|
+
await _o({ email: y, spaceId: e.spaceId, authUrl: m });
|
|
3197
3091
|
},
|
|
3198
3092
|
[e.authUrl, e.spaceId]
|
|
3199
|
-
), i =
|
|
3093
|
+
), i = j(
|
|
3200
3094
|
async (y, m) => {
|
|
3201
3095
|
r((c) => ({ ...c, isLoading: !0, error: null }));
|
|
3202
3096
|
try {
|
|
3203
|
-
const c = await
|
|
3097
|
+
const c = await ve(e.authUrl), u = await Oo({ email: y, code: m, authUrl: c });
|
|
3204
3098
|
r({
|
|
3205
3099
|
isAuthenticated: !0,
|
|
3206
3100
|
isLoading: !1,
|
|
@@ -3213,19 +3107,19 @@ function ni({ children: t, config: e }) {
|
|
|
3213
3107
|
}
|
|
3214
3108
|
},
|
|
3215
3109
|
[e.authUrl]
|
|
3216
|
-
), a =
|
|
3217
|
-
|
|
3110
|
+
), a = j(() => {
|
|
3111
|
+
Le(), Ut.clearAll(), r({
|
|
3218
3112
|
isAuthenticated: !1,
|
|
3219
3113
|
isLoading: !1,
|
|
3220
3114
|
user: null,
|
|
3221
3115
|
error: null
|
|
3222
3116
|
});
|
|
3223
|
-
}, []), l =
|
|
3117
|
+
}, []), l = j(
|
|
3224
3118
|
async (y) => {
|
|
3225
|
-
const m = await
|
|
3119
|
+
const m = await ve(e.authUrl);
|
|
3226
3120
|
r((c) => ({ ...c, isLoading: !0, error: null }));
|
|
3227
3121
|
try {
|
|
3228
|
-
const c = await
|
|
3122
|
+
const c = await Po(m), u = await Vo({ optionsJSON: c }), g = await Uo(m, u, y);
|
|
3229
3123
|
r({
|
|
3230
3124
|
isAuthenticated: !0,
|
|
3231
3125
|
isLoading: !1,
|
|
@@ -3241,39 +3135,39 @@ function ni({ children: t, config: e }) {
|
|
|
3241
3135
|
}
|
|
3242
3136
|
},
|
|
3243
3137
|
[e.authUrl]
|
|
3244
|
-
),
|
|
3138
|
+
), h = j(() => n.user?.token ?? null, [n.user]), f = W(
|
|
3245
3139
|
() => ({
|
|
3246
3140
|
state: n,
|
|
3247
3141
|
login: o,
|
|
3248
3142
|
logout: a,
|
|
3249
|
-
getToken:
|
|
3143
|
+
getToken: h,
|
|
3250
3144
|
registerPasskey: l,
|
|
3251
3145
|
requestEmailCode: s,
|
|
3252
3146
|
submitEmailCode: i
|
|
3253
3147
|
}),
|
|
3254
|
-
[n, o, a,
|
|
3148
|
+
[n, o, a, h, l, s, i]
|
|
3255
3149
|
);
|
|
3256
|
-
return /* @__PURE__ */ w.jsx(
|
|
3150
|
+
return /* @__PURE__ */ w.jsx(ut, { value: f, children: t });
|
|
3257
3151
|
}
|
|
3258
|
-
function
|
|
3259
|
-
const t =
|
|
3152
|
+
function Go() {
|
|
3153
|
+
const t = st(ut);
|
|
3260
3154
|
if (!t)
|
|
3261
3155
|
throw new Error("useAuth must be used within an AuthProvider");
|
|
3262
3156
|
return t;
|
|
3263
3157
|
}
|
|
3264
|
-
function
|
|
3265
|
-
return
|
|
3158
|
+
function zo() {
|
|
3159
|
+
return st(ut);
|
|
3266
3160
|
}
|
|
3267
|
-
function
|
|
3268
|
-
const { config: e, guestUrlParam: n } = t, { state: r, login: o } =
|
|
3161
|
+
function Os(t) {
|
|
3162
|
+
const { config: e, guestUrlParam: n } = t, { state: r, login: o } = Go(), s = E(!1);
|
|
3269
3163
|
return C(() => {
|
|
3270
3164
|
if (!n || r.isAuthenticated || r.isLoading || s.current || !e.methods.includes("guest"))
|
|
3271
3165
|
return;
|
|
3272
3166
|
const i = new URLSearchParams(window.location.search), a = i.get(n);
|
|
3273
3167
|
if (a === "true" || a === "1" || a === "") {
|
|
3274
3168
|
i.delete(n);
|
|
3275
|
-
const l = i.toString(),
|
|
3276
|
-
window.history.replaceState({}, "",
|
|
3169
|
+
const l = i.toString(), h = window.location.pathname + (l ? `?${l}` : "");
|
|
3170
|
+
window.history.replaceState({}, "", h), s.current = !0, o("guest");
|
|
3277
3171
|
}
|
|
3278
3172
|
}, [n, r.isAuthenticated, r.isLoading, e.methods, o]), {
|
|
3279
3173
|
shouldRenderChildren: r.isAuthenticated,
|
|
@@ -3282,17 +3176,17 @@ function ri(t) {
|
|
|
3282
3176
|
error: r.error
|
|
3283
3177
|
};
|
|
3284
3178
|
}
|
|
3285
|
-
const
|
|
3179
|
+
const on = (() => {
|
|
3286
3180
|
try {
|
|
3287
|
-
return
|
|
3181
|
+
return In();
|
|
3288
3182
|
} catch {
|
|
3289
3183
|
return !1;
|
|
3290
3184
|
}
|
|
3291
|
-
})(),
|
|
3292
|
-
function
|
|
3293
|
-
re.push(`[+${((Date.now() -
|
|
3185
|
+
})(), sn = Date.now(), re = [], Xo = 300;
|
|
3186
|
+
function _e(t) {
|
|
3187
|
+
re.push(`[+${((Date.now() - sn) / 1e3).toFixed(1)}s] ${t}`), re.length > Xo && re.shift();
|
|
3294
3188
|
}
|
|
3295
|
-
function
|
|
3189
|
+
function Lt(t) {
|
|
3296
3190
|
if (typeof t == "string")
|
|
3297
3191
|
return t;
|
|
3298
3192
|
if (t instanceof Error)
|
|
@@ -3303,30 +3197,30 @@ function Dt(t) {
|
|
|
3303
3197
|
return String(t);
|
|
3304
3198
|
}
|
|
3305
3199
|
}
|
|
3306
|
-
let
|
|
3307
|
-
function
|
|
3308
|
-
if (
|
|
3200
|
+
let Pt = !1;
|
|
3201
|
+
function an() {
|
|
3202
|
+
if (Pt || typeof window > "u")
|
|
3309
3203
|
return;
|
|
3310
|
-
|
|
3204
|
+
Pt = !0, window.addEventListener("error", (e) => _e(`window.error: ${e.message} @ ${e.filename ?? "?"}:${e.lineno ?? "?"}:${e.colno ?? "?"}`)), window.addEventListener("unhandledrejection", (e) => _e(`unhandledRejection: ${Lt(e.reason)}`));
|
|
3311
3205
|
const t = console;
|
|
3312
3206
|
for (const e of ["error", "warn", "log", "info"]) {
|
|
3313
3207
|
const n = t[e]?.bind(console) ?? (() => {
|
|
3314
3208
|
});
|
|
3315
3209
|
t[e] = (...r) => {
|
|
3316
3210
|
try {
|
|
3317
|
-
|
|
3211
|
+
_e(`console.${e}: ${r.map(Lt).join(" ")}`);
|
|
3318
3212
|
} catch {
|
|
3319
3213
|
}
|
|
3320
3214
|
n(...r);
|
|
3321
3215
|
};
|
|
3322
3216
|
}
|
|
3323
3217
|
try {
|
|
3324
|
-
|
|
3218
|
+
jt((e) => _e(`${e.levelName} [${e.component}] ${e.message}`), { minLevel: Je.DEBUG });
|
|
3325
3219
|
} catch {
|
|
3326
3220
|
}
|
|
3327
3221
|
}
|
|
3328
|
-
|
|
3329
|
-
function
|
|
3222
|
+
on && an();
|
|
3223
|
+
function Ho() {
|
|
3330
3224
|
let t = !1;
|
|
3331
3225
|
try {
|
|
3332
3226
|
const e = URL.createObjectURL(new Blob([""]));
|
|
@@ -3337,11 +3231,11 @@ function Ss() {
|
|
|
3337
3231
|
}
|
|
3338
3232
|
return t;
|
|
3339
3233
|
}
|
|
3340
|
-
function
|
|
3234
|
+
function qo() {
|
|
3341
3235
|
const t = globalThis;
|
|
3342
3236
|
return [
|
|
3343
3237
|
`Worker=${typeof Worker < "u"}`,
|
|
3344
|
-
`moduleWorker=${
|
|
3238
|
+
`moduleWorker=${Ho()}`,
|
|
3345
3239
|
`WebSocket=${typeof WebSocket < "u"}`,
|
|
3346
3240
|
`WebTransport=${typeof t.WebTransport < "u"}`,
|
|
3347
3241
|
`RTCPeerConnection=${typeof RTCPeerConnection < "u"}`,
|
|
@@ -3354,15 +3248,15 @@ function ws() {
|
|
|
3354
3248
|
`online=${typeof navigator < "u" ? navigator.onLine : "?"}`
|
|
3355
3249
|
].join(" ");
|
|
3356
3250
|
}
|
|
3357
|
-
function
|
|
3251
|
+
function Jo(t) {
|
|
3358
3252
|
return /ERROR|error:|Rejection/.test(t) ? "#f88" : /WARN|warn:/.test(t) ? "#fc6" : "#9d9";
|
|
3359
3253
|
}
|
|
3360
|
-
function
|
|
3361
|
-
const n =
|
|
3254
|
+
function cn({ state: t = "", forceVisible: e = !1 }) {
|
|
3255
|
+
const n = on || e, r = t === "connected" || t === "reconnecting", [, o] = An((l) => l + 1, 0), [s, i] = x(!0);
|
|
3362
3256
|
if (C(() => {
|
|
3363
3257
|
if (!n)
|
|
3364
3258
|
return;
|
|
3365
|
-
|
|
3259
|
+
an();
|
|
3366
3260
|
const l = setInterval(o, 1e3);
|
|
3367
3261
|
return () => clearInterval(l);
|
|
3368
3262
|
}, [n]), !n)
|
|
@@ -3387,7 +3281,7 @@ function pn({ state: t = "", forceVisible: e = !1 }) {
|
|
|
3387
3281
|
"Ikon debug overlay — state: ",
|
|
3388
3282
|
t || "?",
|
|
3389
3283
|
", +",
|
|
3390
|
-
Math.round((Date.now() -
|
|
3284
|
+
Math.round((Date.now() - sn) / 1e3),
|
|
3391
3285
|
"s, ",
|
|
3392
3286
|
re.length,
|
|
3393
3287
|
" entries",
|
|
@@ -3395,12 +3289,12 @@ function pn({ state: t = "", forceVisible: e = !1 }) {
|
|
|
3395
3289
|
] }),
|
|
3396
3290
|
/* @__PURE__ */ w.jsx("div", { style: { color: "#9cf", wordBreak: "break-all", marginBottom: "4px" }, children: typeof window < "u" ? window.location.href : "" }),
|
|
3397
3291
|
/* @__PURE__ */ w.jsx("div", { style: { color: "#ff0", wordBreak: "break-all", marginBottom: "4px" }, children: typeof navigator < "u" ? navigator.userAgent : "no navigator" }),
|
|
3398
|
-
/* @__PURE__ */ w.jsx("div", { style: { color: "#8cf", marginBottom: "4px" }, children:
|
|
3292
|
+
/* @__PURE__ */ w.jsx("div", { style: { color: "#8cf", marginBottom: "4px" }, children: qo() }),
|
|
3399
3293
|
/* @__PURE__ */ w.jsx("div", { style: { color: "#8cf", marginBottom: "10px" }, children: typeof window < "u" ? `viewport=${window.innerWidth}x${window.innerHeight} dpr=${window.devicePixelRatio}` : "" }),
|
|
3400
|
-
/* @__PURE__ */ w.jsx("div", { children: re.length === 0 ? "(nothing captured yet)" : re.map((l,
|
|
3294
|
+
/* @__PURE__ */ w.jsx("div", { children: re.length === 0 ? "(nothing captured yet)" : re.map((l, h) => /* @__PURE__ */ w.jsx("div", { style: { color: Jo(l), wordBreak: "break-all" }, children: l }, h)) })
|
|
3401
3295
|
] });
|
|
3402
3296
|
}
|
|
3403
|
-
function
|
|
3297
|
+
function xs({
|
|
3404
3298
|
connectionState: t,
|
|
3405
3299
|
error: e,
|
|
3406
3300
|
isReady: n,
|
|
@@ -3412,8 +3306,8 @@ function oi({
|
|
|
3412
3306
|
// renderIdle prop is intentionally accepted but never invoked — the runtime no longer
|
|
3413
3307
|
// emits the deprecated 'idle' state. Kept on the props for source compatibility.
|
|
3414
3308
|
renderIdle: l,
|
|
3415
|
-
renderConnecting:
|
|
3416
|
-
renderConnectingSlow:
|
|
3309
|
+
renderConnecting: h,
|
|
3310
|
+
renderConnectingSlow: f,
|
|
3417
3311
|
renderConnected: y,
|
|
3418
3312
|
renderOffline: m,
|
|
3419
3313
|
renderError: c
|
|
@@ -3422,7 +3316,7 @@ function oi({
|
|
|
3422
3316
|
switch (t) {
|
|
3423
3317
|
case "waitingForExternalConnectUrl":
|
|
3424
3318
|
case "connecting":
|
|
3425
|
-
return r ?
|
|
3319
|
+
return r ? f() : h();
|
|
3426
3320
|
case "connected":
|
|
3427
3321
|
case "reconnecting": {
|
|
3428
3322
|
if (!n || !o || !s) return null;
|
|
@@ -3449,51 +3343,51 @@ function oi({
|
|
|
3449
3343
|
})();
|
|
3450
3344
|
return /* @__PURE__ */ w.jsxs(w.Fragment, { children: [
|
|
3451
3345
|
g,
|
|
3452
|
-
/* @__PURE__ */ w.jsx(
|
|
3346
|
+
/* @__PURE__ */ w.jsx(cn, { state: t })
|
|
3453
3347
|
] });
|
|
3454
3348
|
}
|
|
3455
|
-
const
|
|
3456
|
-
function
|
|
3349
|
+
const Oe = oe("useIkonApp");
|
|
3350
|
+
function Zo() {
|
|
3457
3351
|
if (typeof window < "u" && window.__IKON_AUTH_CONFIG__)
|
|
3458
3352
|
return window.__IKON_AUTH_CONFIG__;
|
|
3459
3353
|
}
|
|
3460
|
-
function
|
|
3354
|
+
function Qo() {
|
|
3461
3355
|
if (typeof window < "u" && window.__IKON_LOCAL_IKON_SERVER_CONFIG__)
|
|
3462
3356
|
return window.__IKON_LOCAL_IKON_SERVER_CONFIG__;
|
|
3463
3357
|
}
|
|
3464
|
-
function
|
|
3465
|
-
const { authConfig: e, modules: n, timeouts: r, backgroundAudio: o, webRtc: s, audio: i, video: a, websocket: l, webtransport:
|
|
3466
|
-
T.current = o, U.current = r, ee.current = s, te.current = i, z.current = a, _.current = l, P.current =
|
|
3467
|
-
const [H,
|
|
3358
|
+
function Ns(t) {
|
|
3359
|
+
const { authConfig: e, modules: n, timeouts: r, backgroundAudio: o, webRtc: s, audio: i, video: a, websocket: l, webtransport: h, proxy: f, liveSnapshot: y, bootSnapshot: m } = t, c = e === void 0 ? Zo() ?? null : e, u = Qo(), g = zo(), p = E(null), b = E(null), S = E(null), R = E(!1), v = E(!1), T = E(o), U = E(r), ee = E(s), te = E(i), z = E(a), _ = E(l), P = E(h), M = E(f), B = E(y), $ = E(m), V = E("local"), K = E(void 0);
|
|
3360
|
+
T.current = o, U.current = r, ee.current = s, te.current = i, z.current = a, _.current = l, P.current = h, M.current = f, B.current = y, $.current = m;
|
|
3361
|
+
const [H, Ee] = x("connecting"), [Re, pe] = x(!1), [d, A] = x(!1), [O, N] = x(null), [se, me] = x(null), [L, Q] = x(!1), [ie, Me] = x(null), [ae, un] = x(null), [De, dt] = x(!1), je = E(!1), [dn, fn] = x(0), Y = W(() => {
|
|
3468
3362
|
try {
|
|
3469
|
-
const I =
|
|
3470
|
-
return (I.sessionId || I.channelKey) &&
|
|
3363
|
+
const I = _n();
|
|
3364
|
+
return (I.sessionId || I.channelKey) && On(), I;
|
|
3471
3365
|
} catch {
|
|
3472
3366
|
return { parameters: {} };
|
|
3473
3367
|
}
|
|
3474
3368
|
}, []);
|
|
3475
|
-
m !== !1 &&
|
|
3476
|
-
const ce = W(() => c?.enabled ?
|
|
3477
|
-
|
|
3478
|
-
|
|
3369
|
+
m !== !1 && vn();
|
|
3370
|
+
const ce = W(() => c?.enabled ? Jt() : null, [c?.enabled, dn]), Ae = u?.enabled ?? !1, $e = u?.host ?? "localhost", Be = u?.port ?? 8443, Fe = !!c && !c.enabled && !!c.spaceId && (ht() || Ae);
|
|
3371
|
+
Fe && !ae && !De && !je.current && (je.current = !0, ve(c.authUrl).then((I) => Qt(c.spaceId, I)).then((I) => {
|
|
3372
|
+
un(I.token), dt(!0);
|
|
3479
3373
|
}).catch((I) => {
|
|
3480
|
-
|
|
3374
|
+
Oe.error("Anonymous auth failed:", I), je.current = !1, Ae ? dt(!0) : N(I instanceof Error ? I.message : "Anonymous auth failed");
|
|
3481
3375
|
}));
|
|
3482
|
-
const
|
|
3483
|
-
if (
|
|
3484
|
-
if (
|
|
3376
|
+
const Ve = W(() => {
|
|
3377
|
+
if (Ae) {
|
|
3378
|
+
if (Fe && !De)
|
|
3485
3379
|
return null;
|
|
3486
|
-
const I = ce?.token ?? ae ?? void 0, q = I ?
|
|
3380
|
+
const I = ce?.token ?? ae ?? void 0, q = I ? pt(I) ?? void 0 : void 0;
|
|
3487
3381
|
return {
|
|
3488
3382
|
local: {
|
|
3489
|
-
host:
|
|
3490
|
-
httpsPort:
|
|
3383
|
+
host: $e,
|
|
3384
|
+
httpsPort: Be,
|
|
3491
3385
|
userId: q,
|
|
3492
3386
|
token: ce?.token ?? void 0,
|
|
3493
3387
|
spaceId: c?.spaceId,
|
|
3494
3388
|
backendUrl: c?.backendUrl,
|
|
3495
3389
|
authUrl: c?.authUrl,
|
|
3496
|
-
parameters:
|
|
3390
|
+
parameters: Y.parameters
|
|
3497
3391
|
}
|
|
3498
3392
|
};
|
|
3499
3393
|
}
|
|
@@ -3501,46 +3395,46 @@ function si(t) {
|
|
|
3501
3395
|
sessionToken: {
|
|
3502
3396
|
token: ce.token,
|
|
3503
3397
|
spaceId: c.spaceId,
|
|
3504
|
-
backendType:
|
|
3505
|
-
sessionId:
|
|
3506
|
-
channelKey:
|
|
3507
|
-
parameters:
|
|
3398
|
+
backendType: mt(),
|
|
3399
|
+
sessionId: Y.sessionId,
|
|
3400
|
+
channelKey: Y.channelKey,
|
|
3401
|
+
parameters: Y.parameters
|
|
3508
3402
|
}
|
|
3509
3403
|
} : ae && c?.spaceId ? {
|
|
3510
3404
|
sessionToken: {
|
|
3511
3405
|
token: ae,
|
|
3512
3406
|
spaceId: c.spaceId,
|
|
3513
|
-
backendType:
|
|
3514
|
-
sessionId:
|
|
3515
|
-
channelKey:
|
|
3516
|
-
parameters:
|
|
3407
|
+
backendType: mt(),
|
|
3408
|
+
sessionId: Y.sessionId,
|
|
3409
|
+
channelKey: Y.channelKey,
|
|
3410
|
+
parameters: Y.parameters
|
|
3517
3411
|
}
|
|
3518
|
-
} :
|
|
3412
|
+
} : ht() ? null : {
|
|
3519
3413
|
local: {
|
|
3520
|
-
host:
|
|
3521
|
-
httpsPort:
|
|
3414
|
+
host: $e,
|
|
3415
|
+
httpsPort: Be,
|
|
3522
3416
|
spaceId: c?.spaceId,
|
|
3523
3417
|
backendUrl: c?.backendUrl,
|
|
3524
3418
|
authUrl: c?.authUrl,
|
|
3525
|
-
parameters:
|
|
3419
|
+
parameters: Y.parameters
|
|
3526
3420
|
}
|
|
3527
3421
|
};
|
|
3528
|
-
}, [
|
|
3529
|
-
V.current = c?.spaceId ?? "local", K.current = ce?.token ?? ae ?? void 0,
|
|
3530
|
-
const
|
|
3422
|
+
}, [Ae, $e, Be, ce?.token, c?.spaceId, c?.backendUrl, c?.authUrl, ae, Fe, De, Y.sessionId, Y.channelKey, Y.parameters]);
|
|
3423
|
+
V.current = c?.spaceId ?? "local", K.current = ce?.token ?? ae ?? void 0, Qr(ie);
|
|
3424
|
+
const hn = to(ie);
|
|
3531
3425
|
C(() => {
|
|
3532
3426
|
if (!R.current) {
|
|
3533
|
-
if (R.current = !0, S.current =
|
|
3427
|
+
if (R.current = !0, S.current = Yr(), n)
|
|
3534
3428
|
for (const I of n)
|
|
3535
3429
|
I(S.current);
|
|
3536
3430
|
S.current.loadRegisteredModules().catch((I) => {
|
|
3537
|
-
|
|
3431
|
+
Oe.error("Failed to load UI modules", I);
|
|
3538
3432
|
});
|
|
3539
3433
|
}
|
|
3540
3434
|
}, []), C(() => {
|
|
3541
|
-
if (!
|
|
3542
|
-
const I = new
|
|
3543
|
-
...
|
|
3435
|
+
if (!Ve) return;
|
|
3436
|
+
const I = new xn({
|
|
3437
|
+
...Ve,
|
|
3544
3438
|
timeouts: U.current,
|
|
3545
3439
|
audio: te.current !== void 0 || T.current ? {
|
|
3546
3440
|
enabled: te.current,
|
|
@@ -3553,35 +3447,35 @@ function si(t) {
|
|
|
3553
3447
|
webtransport: P.current,
|
|
3554
3448
|
proxy: M.current,
|
|
3555
3449
|
onConnectionStateChange: (J) => {
|
|
3556
|
-
|
|
3450
|
+
Ee(J);
|
|
3557
3451
|
},
|
|
3558
3452
|
onError: (J) => {
|
|
3559
|
-
|
|
3453
|
+
N(J.message);
|
|
3560
3454
|
}
|
|
3561
3455
|
});
|
|
3562
3456
|
p.current = I;
|
|
3563
|
-
const q = B.current ?? !0,
|
|
3564
|
-
b.current =
|
|
3565
|
-
const
|
|
3457
|
+
const q = B.current ?? !0, Te = K.current, ft = Te ? pt(Te) ?? null : null, gn = q && ft ? { enabled: !0, appId: V.current, userId: ft } : void 0, ke = new Qn({ client: I, liveSnapshot: gn, bootSnapshot: $.current });
|
|
3458
|
+
b.current = ke, Me(ke), A(!1);
|
|
3459
|
+
const yn = ke.subscribeToUiUpdates(() => {
|
|
3566
3460
|
A(!0);
|
|
3567
3461
|
});
|
|
3568
3462
|
return I.connect().catch((J) => {
|
|
3569
|
-
if (
|
|
3463
|
+
if (Oe.error("Connection failed:", J), J instanceof Nn) {
|
|
3570
3464
|
me(J.reason);
|
|
3571
3465
|
return;
|
|
3572
3466
|
}
|
|
3573
|
-
if (J instanceof
|
|
3467
|
+
if (J instanceof Ln) {
|
|
3574
3468
|
Q(!0);
|
|
3575
3469
|
return;
|
|
3576
3470
|
}
|
|
3577
|
-
J instanceof
|
|
3471
|
+
J instanceof Pn && !v.current && (v.current = !0, Oe.warn("Auth session appears stale, clearing and retrying"), Ut.clearAll(), g ? g.logout() : (Le(), fn((bn) => bn + 1)));
|
|
3578
3472
|
}), () => {
|
|
3579
|
-
|
|
3473
|
+
yn(), I.disconnect(), p.current = null, ke.dispose(), b.current = null;
|
|
3580
3474
|
};
|
|
3581
|
-
}, [
|
|
3582
|
-
const
|
|
3583
|
-
const
|
|
3584
|
-
p.current?.sendActionCall(I,
|
|
3475
|
+
}, [Ve]);
|
|
3476
|
+
const pn = j((I, q) => {
|
|
3477
|
+
const Te = typeof q == "string" ? q : JSON.stringify(q ?? {});
|
|
3478
|
+
p.current?.sendActionCall(I, Te);
|
|
3585
3479
|
}, []);
|
|
3586
3480
|
C(() => {
|
|
3587
3481
|
if (H !== "connecting") {
|
|
@@ -3591,62 +3485,62 @@ function si(t) {
|
|
|
3591
3485
|
const I = p.current?.slowConnectionThresholdMs ?? 5e3, q = setTimeout(() => pe(!0), I);
|
|
3592
3486
|
return () => clearTimeout(q);
|
|
3593
3487
|
}, [H]);
|
|
3594
|
-
const
|
|
3488
|
+
const mn = H === "connected" || H === "reconnecting", We = d && H !== "offline";
|
|
3595
3489
|
return C(() => {
|
|
3596
|
-
typeof document > "u" || (document.documentElement.dataset.ikonLive = String(
|
|
3597
|
-
}, [
|
|
3490
|
+
typeof document > "u" || (document.documentElement.dataset.ikonLive = String(We));
|
|
3491
|
+
}, [We]), {
|
|
3598
3492
|
connectionState: H,
|
|
3599
3493
|
error: O,
|
|
3600
3494
|
accessDeniedReason: se,
|
|
3601
3495
|
isServerFull: L,
|
|
3602
|
-
stores:
|
|
3496
|
+
stores: hn,
|
|
3603
3497
|
client: p.current,
|
|
3604
3498
|
registry: S.current,
|
|
3605
3499
|
clientRef: p,
|
|
3606
3500
|
uiRef: b,
|
|
3607
3501
|
registryRef: S,
|
|
3608
|
-
onAction:
|
|
3609
|
-
isReady:
|
|
3610
|
-
isLive:
|
|
3502
|
+
onAction: pn,
|
|
3503
|
+
isReady: mn,
|
|
3504
|
+
isLive: We,
|
|
3611
3505
|
brandingRequired: p.current?.brandingRequired ?? !1,
|
|
3612
|
-
isConnectingSlow:
|
|
3506
|
+
isConnectingSlow: Re,
|
|
3613
3507
|
webRtcVideoStreams: p.current?.webRtcVideoStreams ?? /* @__PURE__ */ new Map(),
|
|
3614
3508
|
webRtcTrackMap: p.current?.webRtcTrackMap ?? /* @__PURE__ */ new Map()
|
|
3615
3509
|
};
|
|
3616
3510
|
}
|
|
3617
|
-
function
|
|
3511
|
+
function Ls(t) {
|
|
3618
3512
|
const e = E(!1);
|
|
3619
|
-
return
|
|
3513
|
+
return j(() => {
|
|
3620
3514
|
if (e.current) return;
|
|
3621
3515
|
e.current = !0;
|
|
3622
3516
|
const n = document.createElement("link");
|
|
3623
3517
|
n.rel = "stylesheet", n.href = t, document.head.appendChild(n);
|
|
3624
3518
|
}, [t]);
|
|
3625
3519
|
}
|
|
3626
|
-
let
|
|
3627
|
-
function
|
|
3628
|
-
const [n, r] =
|
|
3520
|
+
let es = 0;
|
|
3521
|
+
function ts(t = 5, e = 5e3) {
|
|
3522
|
+
const [n, r] = x([]), o = E(/* @__PURE__ */ new Map()), s = j((i) => {
|
|
3629
3523
|
const a = o.current.get(i);
|
|
3630
|
-
a && (clearTimeout(a), o.current.delete(i)), r((l) => l.filter((
|
|
3524
|
+
a && (clearTimeout(a), o.current.delete(i)), r((l) => l.filter((h) => h.id !== i));
|
|
3631
3525
|
}, []);
|
|
3632
3526
|
return C(() => {
|
|
3633
|
-
const i = o.current, a =
|
|
3527
|
+
const i = o.current, a = jt(
|
|
3634
3528
|
(l) => {
|
|
3635
|
-
if (
|
|
3529
|
+
if (!$t())
|
|
3636
3530
|
return;
|
|
3637
|
-
const
|
|
3638
|
-
id:
|
|
3639
|
-
level:
|
|
3531
|
+
const h = `toast-${++es}`, f = l.level === Je.ERROR ? "error" : "warn", y = {
|
|
3532
|
+
id: h,
|
|
3533
|
+
level: f,
|
|
3640
3534
|
message: l.message,
|
|
3641
3535
|
component: l.component
|
|
3642
3536
|
};
|
|
3643
3537
|
r((c) => [...c, y].slice(-t));
|
|
3644
3538
|
const m = setTimeout(() => {
|
|
3645
|
-
s(
|
|
3539
|
+
s(h);
|
|
3646
3540
|
}, e);
|
|
3647
|
-
i.set(
|
|
3541
|
+
i.set(h, m);
|
|
3648
3542
|
},
|
|
3649
|
-
{ minLevel:
|
|
3543
|
+
{ minLevel: Je.WARN }
|
|
3650
3544
|
);
|
|
3651
3545
|
return () => {
|
|
3652
3546
|
a();
|
|
@@ -3656,8 +3550,8 @@ function Ts(t = 5, e = 5e3) {
|
|
|
3656
3550
|
};
|
|
3657
3551
|
}, [t, e, s]), { toasts: n, dismissToast: s };
|
|
3658
3552
|
}
|
|
3659
|
-
function
|
|
3660
|
-
const [r, o] =
|
|
3553
|
+
function ns(t, e, n) {
|
|
3554
|
+
const [r, o] = x(n);
|
|
3661
3555
|
return C(() => {
|
|
3662
3556
|
if (!t)
|
|
3663
3557
|
return;
|
|
@@ -3673,8 +3567,8 @@ function ks(t, e, n) {
|
|
|
3673
3567
|
};
|
|
3674
3568
|
}, [t, e]), r;
|
|
3675
3569
|
}
|
|
3676
|
-
function
|
|
3677
|
-
const [r, o] =
|
|
3570
|
+
function Ps(t, e, n) {
|
|
3571
|
+
const [r, o] = x(null);
|
|
3678
3572
|
return C(() => {
|
|
3679
3573
|
if (!t)
|
|
3680
3574
|
return;
|
|
@@ -3686,18 +3580,18 @@ function ai(t, e, n) {
|
|
|
3686
3580
|
}), () => {
|
|
3687
3581
|
s = !1;
|
|
3688
3582
|
};
|
|
3689
|
-
}, [t, e]),
|
|
3583
|
+
}, [t, e]), ns(r ? t : null, r ?? "", n);
|
|
3690
3584
|
}
|
|
3691
|
-
const ue = oe("IkonDebug"),
|
|
3585
|
+
const ue = oe("IkonDebug"), rs = {
|
|
3692
3586
|
Digit1: "connecting",
|
|
3693
3587
|
Digit2: "connected",
|
|
3694
3588
|
Digit3: "reconnecting",
|
|
3695
3589
|
Digit4: "offline",
|
|
3696
3590
|
Digit5: "offline",
|
|
3697
3591
|
Digit0: "clear"
|
|
3698
|
-
},
|
|
3699
|
-
function
|
|
3700
|
-
const e =
|
|
3592
|
+
}, os = "Digit5", ss = "Digit6", is = "Synthetic debug error (Ctrl+Shift+5)", as = "Synthetic debug access-denied (Ctrl+Shift+6)", cs = 5e3;
|
|
3593
|
+
function ls(t) {
|
|
3594
|
+
const e = $t(), [n, r] = x(null), [o, s] = x(!1), [i, a] = x(null), [l, h] = x(null), [f, y] = x(!1), [m, c] = x(!1), [u, g] = x(!1);
|
|
3701
3595
|
return C(() => {
|
|
3702
3596
|
if (!e)
|
|
3703
3597
|
return;
|
|
@@ -3716,19 +3610,19 @@ function Ls(t) {
|
|
|
3716
3610
|
S.preventDefault(), g((T) => (ue.warn(`Debug-overlay override: ${T ? "off" : "on"}`), !T));
|
|
3717
3611
|
return;
|
|
3718
3612
|
}
|
|
3719
|
-
if (S.code ===
|
|
3720
|
-
S.preventDefault(),
|
|
3613
|
+
if (S.code === ss) {
|
|
3614
|
+
S.preventDefault(), h(as), r(null), a(null), ue.warn("Forced access denied");
|
|
3721
3615
|
return;
|
|
3722
3616
|
}
|
|
3723
|
-
const R =
|
|
3617
|
+
const R = rs[S.code];
|
|
3724
3618
|
if (R === void 0)
|
|
3725
3619
|
return;
|
|
3726
3620
|
if (S.preventDefault(), R === "clear") {
|
|
3727
|
-
r(null), a(null),
|
|
3621
|
+
r(null), a(null), h(null), ue.warn("Cleared forced state");
|
|
3728
3622
|
return;
|
|
3729
3623
|
}
|
|
3730
|
-
const v = S.code ===
|
|
3731
|
-
r(R), a(v ?
|
|
3624
|
+
const v = S.code === os;
|
|
3625
|
+
r(R), a(v ? is : null), h(null), ue.warn(`Forced state: ${R}${v ? " (with error)" : ""}`);
|
|
3732
3626
|
};
|
|
3733
3627
|
return window.addEventListener("keydown", b), () => window.removeEventListener("keydown", b);
|
|
3734
3628
|
}, [e]), C(() => {
|
|
@@ -3736,52 +3630,52 @@ function Ls(t) {
|
|
|
3736
3630
|
s(!1);
|
|
3737
3631
|
return;
|
|
3738
3632
|
}
|
|
3739
|
-
const b = setTimeout(() => s(!0),
|
|
3633
|
+
const b = setTimeout(() => s(!0), cs);
|
|
3740
3634
|
return () => clearTimeout(b);
|
|
3741
|
-
}, [n]), !e || n === null && !
|
|
3635
|
+
}, [n]), !e || n === null && !f && l === null && !m && !u ? { app: t, forcedState: null, emptyStores: !1, forcedError: null, forcedAccessDenied: null, forcedBranding: !1, forcedDebugOverlay: !1, debugEnabled: e } : { app: {
|
|
3742
3636
|
...t,
|
|
3743
3637
|
connectionState: n ?? t.connectionState,
|
|
3744
3638
|
isConnectingSlow: n === "connecting" ? o : t.isConnectingSlow,
|
|
3745
3639
|
error: n === "offline" && i ? i : n ? null : t.error,
|
|
3746
|
-
stores:
|
|
3640
|
+
stores: f ? /* @__PURE__ */ new Map() : t.stores,
|
|
3747
3641
|
accessDeniedReason: l ?? t.accessDeniedReason
|
|
3748
|
-
}, forcedState: n, emptyStores:
|
|
3642
|
+
}, forcedState: n, emptyStores: f, forcedError: i, forcedAccessDenied: l, forcedBranding: m, forcedDebugOverlay: u, debugEnabled: e };
|
|
3749
3643
|
}
|
|
3750
|
-
function
|
|
3644
|
+
function us(t, e) {
|
|
3751
3645
|
return t === void 0 ? null : typeof t == "function" ? t(e) : t;
|
|
3752
3646
|
}
|
|
3753
|
-
function
|
|
3647
|
+
function ds(t) {
|
|
3754
3648
|
return t === void 0 ? null : typeof t == "function" ? t() : t;
|
|
3755
3649
|
}
|
|
3756
|
-
function
|
|
3650
|
+
function fs(t, e) {
|
|
3757
3651
|
return t === void 0 ? null : typeof t == "function" ? t(e) : t;
|
|
3758
3652
|
}
|
|
3759
|
-
function
|
|
3653
|
+
function hs(t, e) {
|
|
3760
3654
|
return t === void 0 ? null : typeof t == "function" ? t(e) : t;
|
|
3761
3655
|
}
|
|
3762
|
-
function
|
|
3763
|
-
const { connectingOverlay: e, reconnectingOverlay: n, offlineOverlay: r, accessDeniedScreen: o, ...s } = t, i =
|
|
3764
|
-
if (
|
|
3765
|
-
return
|
|
3656
|
+
function Us(t) {
|
|
3657
|
+
const { connectingOverlay: e, reconnectingOverlay: n, offlineOverlay: r, accessDeniedScreen: o, ...s } = t, i = ls(s), { app: a } = i, { connectionState: l, isConnectingSlow: h, stores: f, registry: y, client: m, onAction: c, isReady: u, error: g, accessDeniedReason: p, brandingRequired: b } = a, S = b || i.forcedBranding, R = E(null);
|
|
3658
|
+
if (f && y && (u || f.size > 0) && (R.current = { stores: f, registry: y, client: m }), p)
|
|
3659
|
+
return hs(o, p);
|
|
3766
3660
|
const v = R.current;
|
|
3767
3661
|
let T = null;
|
|
3768
3662
|
switch (l) {
|
|
3769
3663
|
case "waitingForExternalConnectUrl":
|
|
3770
3664
|
case "connecting":
|
|
3771
|
-
T =
|
|
3665
|
+
T = us(e, h);
|
|
3772
3666
|
break;
|
|
3773
3667
|
case "reconnecting":
|
|
3774
|
-
T =
|
|
3668
|
+
T = ds(n);
|
|
3775
3669
|
break;
|
|
3776
3670
|
case "offline":
|
|
3777
|
-
T =
|
|
3671
|
+
T = fs(r, g);
|
|
3778
3672
|
break;
|
|
3779
3673
|
default:
|
|
3780
3674
|
T = null;
|
|
3781
3675
|
}
|
|
3782
3676
|
return /* @__PURE__ */ w.jsxs(w.Fragment, { children: [
|
|
3783
3677
|
v && /* @__PURE__ */ w.jsx(
|
|
3784
|
-
|
|
3678
|
+
Bt,
|
|
3785
3679
|
{
|
|
3786
3680
|
stores: v.stores,
|
|
3787
3681
|
registry: v.registry,
|
|
@@ -3790,18 +3684,18 @@ function ci(t) {
|
|
|
3790
3684
|
}
|
|
3791
3685
|
),
|
|
3792
3686
|
T,
|
|
3793
|
-
S && /* @__PURE__ */ w.jsx(
|
|
3794
|
-
/* @__PURE__ */ w.jsx(
|
|
3795
|
-
/* @__PURE__ */ w.jsx(
|
|
3687
|
+
S && /* @__PURE__ */ w.jsx(ms, {}),
|
|
3688
|
+
/* @__PURE__ */ w.jsx(gs, {}),
|
|
3689
|
+
/* @__PURE__ */ w.jsx(cn, { state: l, forceVisible: i.forcedDebugOverlay })
|
|
3796
3690
|
] });
|
|
3797
3691
|
}
|
|
3798
|
-
const
|
|
3799
|
-
function
|
|
3692
|
+
const ps = "https://ikonai.com";
|
|
3693
|
+
function ms() {
|
|
3800
3694
|
return /* @__PURE__ */ w.jsxs(
|
|
3801
3695
|
"a",
|
|
3802
3696
|
{
|
|
3803
3697
|
className: "ikon-branding-banner",
|
|
3804
|
-
href:
|
|
3698
|
+
href: ps,
|
|
3805
3699
|
target: "_blank",
|
|
3806
3700
|
rel: "noopener noreferrer",
|
|
3807
3701
|
style: {
|
|
@@ -3829,11 +3723,11 @@ function $s() {
|
|
|
3829
3723
|
}
|
|
3830
3724
|
);
|
|
3831
3725
|
}
|
|
3832
|
-
function
|
|
3833
|
-
const { toasts: t, dismissToast: e } =
|
|
3834
|
-
return t.length === 0 ? null : /* @__PURE__ */ w.jsx("div", { className: "ikon-toast-overlay", children: t.map((n) => /* @__PURE__ */ w.jsx(
|
|
3726
|
+
function gs() {
|
|
3727
|
+
const { toasts: t, dismissToast: e } = ts();
|
|
3728
|
+
return t.length === 0 ? null : /* @__PURE__ */ w.jsx("div", { className: "ikon-toast-overlay", children: t.map((n) => /* @__PURE__ */ w.jsx(ys, { toast: n, onDismiss: e }, n.id)) });
|
|
3835
3729
|
}
|
|
3836
|
-
function
|
|
3730
|
+
function ys({ toast: t, onDismiss: e }) {
|
|
3837
3731
|
return /* @__PURE__ */ w.jsxs(
|
|
3838
3732
|
"div",
|
|
3839
3733
|
{
|
|
@@ -3854,110 +3748,105 @@ function Fs({ toast: t, onDismiss: e }) {
|
|
|
3854
3748
|
}
|
|
3855
3749
|
);
|
|
3856
3750
|
}
|
|
3857
|
-
const
|
|
3858
|
-
function
|
|
3751
|
+
const ln = Mt(null);
|
|
3752
|
+
function bs(t, e) {
|
|
3859
3753
|
return e ? t.replace(/\{(\w+)\}/g, (n, r) => e[r] ?? `{${r}}`) : t;
|
|
3860
3754
|
}
|
|
3861
|
-
function
|
|
3862
|
-
const n =
|
|
3755
|
+
function Ss(t, e) {
|
|
3756
|
+
const n = Un();
|
|
3863
3757
|
if (n && t.includes(n))
|
|
3864
3758
|
return n;
|
|
3865
3759
|
const r = navigator.language.split("-")[0];
|
|
3866
3760
|
return t.includes(r) ? r : e && t.includes(e) ? e : "en";
|
|
3867
3761
|
}
|
|
3868
|
-
function
|
|
3869
|
-
return e ?
|
|
3762
|
+
function ws(t, e, n) {
|
|
3763
|
+
return e ? Ss(t, n) : n && t.includes(n) ? n : "en";
|
|
3870
3764
|
}
|
|
3871
|
-
function
|
|
3765
|
+
function Ms({
|
|
3872
3766
|
children: t,
|
|
3873
3767
|
translations: e,
|
|
3874
3768
|
defaultLanguage: n,
|
|
3875
3769
|
detectLanguage: r = !1
|
|
3876
3770
|
}) {
|
|
3877
|
-
const o = Object.keys(e), s =
|
|
3771
|
+
const o = Object.keys(e), s = ws(o, r, n), i = e[s] ?? e.en, a = W(
|
|
3878
3772
|
() => ({
|
|
3879
|
-
t: (l,
|
|
3880
|
-
const
|
|
3881
|
-
return
|
|
3773
|
+
t: (l, h) => {
|
|
3774
|
+
const f = i[l];
|
|
3775
|
+
return bs(f, h);
|
|
3882
3776
|
},
|
|
3883
3777
|
locale: s,
|
|
3884
3778
|
translations: i
|
|
3885
3779
|
}),
|
|
3886
3780
|
[i, s]
|
|
3887
3781
|
);
|
|
3888
|
-
return /* @__PURE__ */ w.jsx(
|
|
3782
|
+
return /* @__PURE__ */ w.jsx(ln, { value: a, children: t });
|
|
3889
3783
|
}
|
|
3890
|
-
function
|
|
3891
|
-
const t =
|
|
3784
|
+
function Ds() {
|
|
3785
|
+
const t = st(ln);
|
|
3892
3786
|
if (!t)
|
|
3893
3787
|
throw new Error("useI18n must be used within an I18nProvider");
|
|
3894
3788
|
return t;
|
|
3895
3789
|
}
|
|
3896
3790
|
export {
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
vr as registerBaseModule,
|
|
3941
|
-
Lr as registerMediaModule,
|
|
3942
|
-
Hr as registerShadertoyModule,
|
|
3943
|
-
Zn as renderChildren,
|
|
3944
|
-
ti as renderMotionLetters,
|
|
3791
|
+
_s as AuthProvider,
|
|
3792
|
+
xs as ConnectionStateRenderer,
|
|
3793
|
+
on as DEBUG_OVERLAY_ENABLED,
|
|
3794
|
+
cn as DebugOverlay,
|
|
3795
|
+
Ms as I18nProvider,
|
|
3796
|
+
hr as IKON_UI_BASE_MODULE,
|
|
3797
|
+
Tr as IKON_UI_MEDIA_MODULE,
|
|
3798
|
+
Fr as IKON_UI_SHADERTOY_MODULE,
|
|
3799
|
+
$r as IKON_UI_SHADERTOY_TYPE,
|
|
3800
|
+
Qe as IKON_UI_STREAM_CATEGORY,
|
|
3801
|
+
wr as IKON_UI_VIDEO_CANVAS_TYPE,
|
|
3802
|
+
vr as IKON_UI_VIDEO_URL_PLAYER_TYPE,
|
|
3803
|
+
Us as IkonApp,
|
|
3804
|
+
Qn as IkonUi,
|
|
3805
|
+
Kr as IkonUiRegistry,
|
|
3806
|
+
Bt as IkonUiSurface,
|
|
3807
|
+
qn as InspectOverlay,
|
|
3808
|
+
Cs as ParallaxView,
|
|
3809
|
+
Hn as UiComponentRegistry,
|
|
3810
|
+
Xn as UiRenderer,
|
|
3811
|
+
Bs as UiStreamStore,
|
|
3812
|
+
Qt as authenticateAnonymous,
|
|
3813
|
+
Lo as buildOAuthRedirectUrl,
|
|
3814
|
+
Le as clearAuthSession,
|
|
3815
|
+
Nt as clearOAuthParams,
|
|
3816
|
+
fr as createBaseResolvers,
|
|
3817
|
+
Ts as createComponentLibrary,
|
|
3818
|
+
Yr as createIkonUiRegistry,
|
|
3819
|
+
Rr as createMediaResolvers,
|
|
3820
|
+
Br as createShadertoyRendererResolver,
|
|
3821
|
+
Zn as isIkonUiCategoryMatch,
|
|
3822
|
+
Jt as loadAuthSession,
|
|
3823
|
+
pr as loadBaseModule,
|
|
3824
|
+
kr as loadMediaModule,
|
|
3825
|
+
Vr as loadShadertoyModule,
|
|
3826
|
+
xo as parseOAuthCallback,
|
|
3827
|
+
No as parseOAuthError,
|
|
3828
|
+
Vs as randomUuid,
|
|
3829
|
+
mr as registerBaseModule,
|
|
3830
|
+
Cr as registerMediaModule,
|
|
3831
|
+
Wr as registerShadertoyModule,
|
|
3832
|
+
Gn as renderChildren,
|
|
3833
|
+
Is as renderMotionLetters,
|
|
3945
3834
|
he as saveAuthSession,
|
|
3946
|
-
|
|
3835
|
+
_o as sendLoginCode,
|
|
3947
3836
|
ne as sessionToUser,
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3837
|
+
Go as useAuth,
|
|
3838
|
+
Os as useAuthGuard,
|
|
3839
|
+
zo as useAuthOptional,
|
|
3840
|
+
Ds as useI18n,
|
|
3841
|
+
Ns as useIkonApp,
|
|
3842
|
+
ls as useIkonDebug,
|
|
3843
|
+
ns as useIkonReactive,
|
|
3844
|
+
Qr as useIkonStyles,
|
|
3845
|
+
to as useIkonUiStores,
|
|
3846
|
+
Ls as useLazyFont,
|
|
3847
|
+
Ps as useReactive,
|
|
3848
|
+
ts as useToasts,
|
|
3960
3849
|
Z as useUiNode,
|
|
3961
|
-
|
|
3962
|
-
|
|
3850
|
+
ks as useUiStore,
|
|
3851
|
+
Oo as verifyLoginCode
|
|
3963
3852
|
};
|