@ikonai/sdk-react-ui 1.0.70 → 1.0.72
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/ikon-ui.d.ts +3 -0
- package/index.d.ts +0 -1
- package/index.js +853 -942
- 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 _n, subscribeToLogEvents as jt, LogLevel as Je, parseUrlParams as In, 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:
|
|
@@ -64,136 +64,136 @@ function Wn() {
|
|
|
64
64
|
return "Suspense";
|
|
65
65
|
case ee:
|
|
66
66
|
return "SuspenseList";
|
|
67
|
-
case
|
|
67
|
+
case I:
|
|
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"), I = 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,48 +548,55 @@ 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();
|
|
588
|
+
// Boot/live-snapshot remap: render the first live update for a new stream into the existing seed
|
|
589
|
+
// stream's surface (React key), so React reconciles skeleton→live in place instead of unmounting
|
|
590
|
+
// the seed and mounting the live (which flashes white on slow devices before the live tree paints).
|
|
591
|
+
liveToSeedSurface = /* @__PURE__ */ new Map();
|
|
592
|
+
// live stream id -> seed surface key
|
|
593
|
+
adoptedSeedSurfaces = /* @__PURE__ */ new Set();
|
|
594
|
+
// seed surface keys taken over by a live stream
|
|
588
595
|
listeners = /* @__PURE__ */ new Set();
|
|
589
596
|
unsubscribeClears;
|
|
590
597
|
unsubscribeStoreChanges;
|
|
591
598
|
constructor(e) {
|
|
592
|
-
this.core = e?.core ?? new
|
|
599
|
+
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
600
|
}
|
|
594
601
|
dispose() {
|
|
595
602
|
this.unsubscribeClears(), this.unsubscribeStoreChanges(), this.ownsCore && this.core.dispose(), this.listeners.clear(), this.stores.clear();
|
|
@@ -618,21 +625,36 @@ class sr {
|
|
|
618
625
|
return this.core.subscribeToUiStyleDeletes(e);
|
|
619
626
|
}
|
|
620
627
|
handleUiStreamCleared = (e) => {
|
|
621
|
-
|
|
628
|
+
const n = this.liveToSeedSurface.get(e);
|
|
629
|
+
if (n) {
|
|
630
|
+
this.liveToSeedSurface.delete(e), this.adoptedSeedSurfaces.delete(n), this.stores.delete(n) && this.notify(n);
|
|
631
|
+
return;
|
|
632
|
+
}
|
|
633
|
+
this.adoptedSeedSurfaces.has(e) || this.stores.delete(e) && this.notify(e);
|
|
622
634
|
};
|
|
623
635
|
syncStreamSnapshot = (e) => {
|
|
624
636
|
const n = this.core.uiStore.getSnapshot(e);
|
|
625
|
-
if (!n || !n.rootViewId) {
|
|
626
|
-
this.handleUiStreamCleared(e);
|
|
627
|
-
return;
|
|
628
|
-
}
|
|
629
|
-
if (!n.views.get(n.rootViewId)) {
|
|
637
|
+
if (!n || !n.rootViewId || !n.views.get(n.rootViewId)) {
|
|
630
638
|
this.handleUiStreamCleared(e);
|
|
631
639
|
return;
|
|
632
640
|
}
|
|
633
|
-
const s = this.ensureStoreEntry(
|
|
634
|
-
(s || i) && this.notify(
|
|
641
|
+
const r = this.resolveSurfaceKey(e), s = this.ensureStoreEntry(r).store.replaceSnapshot(n), i = this.updateCategory(r, n.category);
|
|
642
|
+
(s || i) && this.notify(r);
|
|
635
643
|
};
|
|
644
|
+
// Resolve the surface (React key) a stream renders under. A new live stream adopts an existing,
|
|
645
|
+
// un-adopted seed surface so the boot snapshot → live swap reconciles in place rather than
|
|
646
|
+
// remounting (white flash). Seeds and already-mapped streams keep their own key.
|
|
647
|
+
resolveSurfaceKey(e) {
|
|
648
|
+
const n = this.liveToSeedSurface.get(e);
|
|
649
|
+
if (n)
|
|
650
|
+
return n;
|
|
651
|
+
if (this.stores.has(e) || this.core.isSeedStream(e))
|
|
652
|
+
return e;
|
|
653
|
+
for (const r of this.stores.keys())
|
|
654
|
+
if (this.core.isSeedStream(r) && !this.adoptedSeedSurfaces.has(r))
|
|
655
|
+
return this.liveToSeedSurface.set(e, r), this.adoptedSeedSurfaces.add(r), r;
|
|
656
|
+
return e;
|
|
657
|
+
}
|
|
636
658
|
syncAllStreams() {
|
|
637
659
|
const e = this.core.uiStore.getSnapshots(), n = /* @__PURE__ */ new Set();
|
|
638
660
|
for (const r of e)
|
|
@@ -645,8 +667,8 @@ class sr {
|
|
|
645
667
|
if (n)
|
|
646
668
|
return n;
|
|
647
669
|
const r = {
|
|
648
|
-
category:
|
|
649
|
-
store: new
|
|
670
|
+
category: Qe,
|
|
671
|
+
store: new wn()
|
|
650
672
|
};
|
|
651
673
|
return this.stores.set(e, r), r;
|
|
652
674
|
}
|
|
@@ -654,7 +676,7 @@ class sr {
|
|
|
654
676
|
const r = this.stores.get(e);
|
|
655
677
|
if (!r)
|
|
656
678
|
return !1;
|
|
657
|
-
const o = n ?? this.core.uiStore.getSnapshot(e)?.category ??
|
|
679
|
+
const o = n ?? this.core.uiStore.getSnapshot(e)?.category ?? Qe;
|
|
658
680
|
return r.category === o ? !1 : (this.stores.set(e, { ...r, category: o }), !0);
|
|
659
681
|
}
|
|
660
682
|
notify(e) {
|
|
@@ -662,7 +684,7 @@ class sr {
|
|
|
662
684
|
n(e);
|
|
663
685
|
}
|
|
664
686
|
}
|
|
665
|
-
function
|
|
687
|
+
function er(t) {
|
|
666
688
|
if (typeof t == "string") {
|
|
667
689
|
const e = t.trim();
|
|
668
690
|
return e.length > 0 ? e : void 0;
|
|
@@ -678,7 +700,7 @@ function de(t) {
|
|
|
678
700
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
679
701
|
}
|
|
680
702
|
}
|
|
681
|
-
function
|
|
703
|
+
function it(...t) {
|
|
682
704
|
let e = "";
|
|
683
705
|
for (const n of t)
|
|
684
706
|
if (n) {
|
|
@@ -687,19 +709,19 @@ function lt(...t) {
|
|
|
687
709
|
}
|
|
688
710
|
return e || void 0;
|
|
689
711
|
}
|
|
690
|
-
const
|
|
691
|
-
function
|
|
712
|
+
const St = /* @__PURE__ */ new WeakMap(), tr = {};
|
|
713
|
+
function at(t) {
|
|
692
714
|
if (!t)
|
|
693
|
-
return
|
|
694
|
-
const e =
|
|
715
|
+
return tr;
|
|
716
|
+
const e = St.get(t);
|
|
695
717
|
if (e)
|
|
696
718
|
return e;
|
|
697
719
|
const n = {};
|
|
698
720
|
for (const [r, o] of Object.entries(t))
|
|
699
721
|
o != null && (typeof o == "string" || typeof o == "number" || typeof o == "boolean") && (n[r] = o);
|
|
700
|
-
return
|
|
722
|
+
return St.set(t, n), n;
|
|
701
723
|
}
|
|
702
|
-
function
|
|
724
|
+
function nr(t) {
|
|
703
725
|
let e = t.parentElement;
|
|
704
726
|
for (; e; ) {
|
|
705
727
|
const r = window.getComputedStyle(e).overflowY;
|
|
@@ -709,32 +731,32 @@ function cr(t) {
|
|
|
709
731
|
}
|
|
710
732
|
return null;
|
|
711
733
|
}
|
|
712
|
-
const
|
|
713
|
-
function
|
|
734
|
+
const Ft = 1.5;
|
|
735
|
+
function Vt(t, e) {
|
|
714
736
|
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 *
|
|
737
|
+
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
738
|
"scrollBehavior" in document.documentElement.style ? t.scrollTo({ top: o, behavior: i }) : t.scrollTop = o;
|
|
717
739
|
});
|
|
718
740
|
}
|
|
719
|
-
const
|
|
720
|
-
function
|
|
721
|
-
return Math.max(t.clientHeight *
|
|
741
|
+
const et = "data-ikon-scroll-indicator", rr = 0.15, xe = "data-ikon-at-bottom";
|
|
742
|
+
function Wt(t) {
|
|
743
|
+
return Math.max(t.clientHeight * rr, 20);
|
|
722
744
|
}
|
|
723
|
-
function
|
|
745
|
+
function or(t) {
|
|
724
746
|
return t.getAttribute(xe) !== "false";
|
|
725
747
|
}
|
|
726
|
-
function
|
|
748
|
+
function sr(t) {
|
|
727
749
|
t.getAttribute(xe) === null && (t.setAttribute(xe, "true"), t.addEventListener("scroll", () => {
|
|
728
|
-
const { scrollTop: e, scrollHeight: n, clientHeight: r } = t, s = n - e - r <=
|
|
750
|
+
const { scrollTop: e, scrollHeight: n, clientHeight: r } = t, s = n - e - r <= Wt(t);
|
|
729
751
|
t.setAttribute(xe, s ? "true" : "false");
|
|
730
752
|
}, { passive: !0 }));
|
|
731
753
|
}
|
|
732
|
-
function
|
|
733
|
-
const e = t.parentElement ?? t, n = e.querySelector(`[${
|
|
754
|
+
function ir(t) {
|
|
755
|
+
const e = t.parentElement ?? t, n = e.querySelector(`[${et}]`);
|
|
734
756
|
if (n)
|
|
735
757
|
return n;
|
|
736
758
|
const r = document.createElement("button");
|
|
737
|
-
return r.setAttribute(
|
|
759
|
+
return r.setAttribute(et, "true"), r.setAttribute("aria-label", "Scroll to latest"), r.textContent = "↓", Object.assign(r.style, {
|
|
738
760
|
position: "absolute",
|
|
739
761
|
bottom: "12px",
|
|
740
762
|
left: "50%",
|
|
@@ -762,22 +784,22 @@ function fr(t) {
|
|
|
762
784
|
r.style.opacity = "0.9";
|
|
763
785
|
}), e.appendChild(r), r;
|
|
764
786
|
}
|
|
765
|
-
function
|
|
766
|
-
const n =
|
|
787
|
+
function ar(t, e) {
|
|
788
|
+
const n = ir(t);
|
|
767
789
|
n.style.display = "flex";
|
|
768
790
|
const r = () => {
|
|
769
|
-
|
|
791
|
+
Vt(t, e), n.style.display = "none";
|
|
770
792
|
}, o = () => {
|
|
771
793
|
const { scrollTop: s, scrollHeight: i, clientHeight: a } = t;
|
|
772
|
-
i - s - a <=
|
|
794
|
+
i - s - a <= Wt(t) && (n.style.display = "none");
|
|
773
795
|
};
|
|
774
796
|
return n.addEventListener("click", r), t.addEventListener("scroll", o, { passive: !0 }), () => {
|
|
775
797
|
n.removeEventListener("click", r), t.removeEventListener("scroll", o);
|
|
776
798
|
};
|
|
777
799
|
}
|
|
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,
|
|
800
|
+
function cr() {
|
|
801
|
+
const t = G(function({ nodeId: n, context: r }) {
|
|
802
|
+
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
803
|
return C(() => {
|
|
782
804
|
if (typeof document > "u")
|
|
783
805
|
return;
|
|
@@ -786,16 +808,16 @@ function pr() {
|
|
|
786
808
|
return;
|
|
787
809
|
let u;
|
|
788
810
|
if (l !== !0) {
|
|
789
|
-
const S =
|
|
811
|
+
const S = nr(c);
|
|
790
812
|
if (S)
|
|
791
|
-
if (
|
|
792
|
-
u =
|
|
813
|
+
if (sr(S), h === "Polite" && !or(S))
|
|
814
|
+
u = ar(S, c);
|
|
793
815
|
else {
|
|
794
|
-
const U = (S.parentElement ?? S).querySelector(`[${
|
|
795
|
-
U && (U.style.display = "none"),
|
|
816
|
+
const U = (S.parentElement ?? S).querySelector(`[${et}]`);
|
|
817
|
+
U && (U.style.display = "none"), Vt(S, c);
|
|
796
818
|
}
|
|
797
819
|
else typeof c.scrollIntoView == "function" && requestAnimationFrame(() => {
|
|
798
|
-
const R = c.getBoundingClientRect().top, v = typeof window < "u" ? window.innerHeight : 0, T = Math.abs(R) > v *
|
|
820
|
+
const R = c.getBoundingClientRect().top, v = typeof window < "u" ? window.innerHeight : 0, T = Math.abs(R) > v * Ft ? "auto" : "smooth";
|
|
799
821
|
try {
|
|
800
822
|
c.scrollIntoView({ behavior: T, block: "end", inline: "nearest" });
|
|
801
823
|
} catch {
|
|
@@ -811,7 +833,7 @@ function pr() {
|
|
|
811
833
|
c.focus();
|
|
812
834
|
}
|
|
813
835
|
return u;
|
|
814
|
-
}, [l,
|
|
836
|
+
}, [l, h, i, f, y]), o ? /* @__PURE__ */ w.jsx(
|
|
815
837
|
"span",
|
|
816
838
|
{
|
|
817
839
|
ref: s,
|
|
@@ -828,26 +850,26 @@ function pr() {
|
|
|
828
850
|
return t;
|
|
829
851
|
};
|
|
830
852
|
}
|
|
831
|
-
function
|
|
832
|
-
const t =
|
|
833
|
-
const s = Z(r.store, n), i =
|
|
853
|
+
function lr() {
|
|
854
|
+
const t = G(function({ nodeId: n, context: r, className: o }) {
|
|
855
|
+
const s = Z(r.store, n), i = er(s?.props?.onInvokeId), a = j(() => {
|
|
834
856
|
i && r.dispatchAction(i);
|
|
835
857
|
}, [i, r]);
|
|
836
858
|
if (!s)
|
|
837
859
|
return null;
|
|
838
|
-
const l =
|
|
860
|
+
const l = at(s.props);
|
|
839
861
|
delete l.onInvokeId;
|
|
840
|
-
const
|
|
862
|
+
const h = it(de(s.props?.className), o), f = s.children?.length ? r.renderChildren(s.children) : void 0;
|
|
841
863
|
return /* @__PURE__ */ w.jsx(
|
|
842
864
|
"div",
|
|
843
865
|
{
|
|
844
866
|
...l,
|
|
845
867
|
"data-ikon-node-id": s.id,
|
|
846
868
|
"data-ikon-source": s.sourceMarker,
|
|
847
|
-
className:
|
|
869
|
+
className: h,
|
|
848
870
|
onClick: i ? a : void 0,
|
|
849
871
|
style: i ? { cursor: "pointer" } : void 0,
|
|
850
|
-
children:
|
|
872
|
+
children: f
|
|
851
873
|
}
|
|
852
874
|
);
|
|
853
875
|
});
|
|
@@ -856,12 +878,12 @@ function mr() {
|
|
|
856
878
|
return t;
|
|
857
879
|
};
|
|
858
880
|
}
|
|
859
|
-
function
|
|
860
|
-
const t =
|
|
881
|
+
function ur() {
|
|
882
|
+
const t = G(function({ nodeId: n, context: r, className: o }) {
|
|
861
883
|
const s = Z(r.store, n);
|
|
862
884
|
if (!s)
|
|
863
885
|
return null;
|
|
864
|
-
const i =
|
|
886
|
+
const i = at(s.props), a = it("relative", de(s.props?.className), o), l = s.children?.length ? r.renderChildren(s.children) : void 0;
|
|
865
887
|
return /* @__PURE__ */ w.jsx("div", { ...i, "data-ikon-node-id": s.id, "data-ikon-source": s.sourceMarker, className: a, children: l });
|
|
866
888
|
});
|
|
867
889
|
return ({ type: e }) => {
|
|
@@ -869,12 +891,12 @@ function gr() {
|
|
|
869
891
|
return t;
|
|
870
892
|
};
|
|
871
893
|
}
|
|
872
|
-
function
|
|
873
|
-
const t =
|
|
894
|
+
function dr() {
|
|
895
|
+
const t = G(function({ nodeId: n, context: r, className: o }) {
|
|
874
896
|
const s = Z(r.store, n);
|
|
875
897
|
if (!s)
|
|
876
898
|
return null;
|
|
877
|
-
const i =
|
|
899
|
+
const i = at(s.props), a = it("absolute", de(s.props?.className), o), l = s.children?.length ? r.renderChildren(s.children) : void 0;
|
|
878
900
|
return /* @__PURE__ */ w.jsx("div", { ...i, "data-ikon-node-id": s.id, "data-ikon-source": s.sourceMarker, className: a, children: l });
|
|
879
901
|
});
|
|
880
902
|
return ({ type: e }) => {
|
|
@@ -882,19 +904,19 @@ function yr() {
|
|
|
882
904
|
return t;
|
|
883
905
|
};
|
|
884
906
|
}
|
|
885
|
-
function
|
|
907
|
+
function fr() {
|
|
886
908
|
return [
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
909
|
+
lr(),
|
|
910
|
+
ur(),
|
|
911
|
+
dr(),
|
|
912
|
+
cr()
|
|
891
913
|
];
|
|
892
914
|
}
|
|
893
|
-
const
|
|
894
|
-
function
|
|
895
|
-
t.registerModule(
|
|
915
|
+
const hr = "base", pr = async () => fr();
|
|
916
|
+
function mr(t) {
|
|
917
|
+
t.registerModule(hr, pr);
|
|
896
918
|
}
|
|
897
|
-
function
|
|
919
|
+
function gr(t) {
|
|
898
920
|
if (typeof t == "string") {
|
|
899
921
|
const e = t.trim();
|
|
900
922
|
return e.length > 0 ? e : void 0;
|
|
@@ -904,13 +926,13 @@ function Er(t) {
|
|
|
904
926
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
905
927
|
}
|
|
906
928
|
}
|
|
907
|
-
function
|
|
929
|
+
function yr(...t) {
|
|
908
930
|
const e = [];
|
|
909
931
|
for (const n of t)
|
|
910
932
|
n && n.trim() && e.push(n.trim());
|
|
911
933
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
912
934
|
}
|
|
913
|
-
function
|
|
935
|
+
function wt(t) {
|
|
914
936
|
if (typeof t != "string")
|
|
915
937
|
return;
|
|
916
938
|
const e = t.trim();
|
|
@@ -925,42 +947,42 @@ function _e(t) {
|
|
|
925
947
|
if (e === "false") return !1;
|
|
926
948
|
}
|
|
927
949
|
}
|
|
928
|
-
const
|
|
929
|
-
function
|
|
930
|
-
const t =
|
|
950
|
+
const br = "std.audio-url-player";
|
|
951
|
+
function Sr() {
|
|
952
|
+
const t = G(function({
|
|
931
953
|
nodeId: n,
|
|
932
954
|
context: r,
|
|
933
955
|
className: o
|
|
934
956
|
}) {
|
|
935
|
-
const s = Z(r.store, n), i = E(null), a = s ? _e(s.props?.autoplay) : void 0, l = s ?
|
|
957
|
+
const s = Z(r.store, n), i = E(null), a = s ? _e(s.props?.autoplay) : void 0, l = s ? wt(s.props?.src) : void 0;
|
|
936
958
|
if (C(() => {
|
|
937
959
|
a && i.current && i.current.play().catch(() => {
|
|
938
960
|
});
|
|
939
961
|
}, [a, l]), !s)
|
|
940
962
|
return null;
|
|
941
|
-
const
|
|
963
|
+
const h = yr(gr(s.props?.className), o), f = wt(s.props?.preload), y = _e(s.props?.controls), m = _e(s.props?.loop), c = _e(s.props?.muted);
|
|
942
964
|
return /* @__PURE__ */ w.jsx(
|
|
943
965
|
"audio",
|
|
944
966
|
{
|
|
945
967
|
ref: i,
|
|
946
968
|
src: l,
|
|
947
|
-
...
|
|
969
|
+
...f !== void 0 ? { preload: f } : {},
|
|
948
970
|
...y !== void 0 ? { controls: y } : {},
|
|
949
971
|
...a !== void 0 ? { autoPlay: a } : {},
|
|
950
972
|
...m !== void 0 ? { loop: m } : {},
|
|
951
973
|
...c !== void 0 ? { muted: c } : {},
|
|
952
974
|
"data-ikon-node-id": s.id,
|
|
953
975
|
"data-ikon-source": s.sourceMarker,
|
|
954
|
-
className:
|
|
976
|
+
className: h
|
|
955
977
|
}
|
|
956
978
|
);
|
|
957
979
|
});
|
|
958
980
|
return ({ type: e }) => {
|
|
959
|
-
if (e ===
|
|
981
|
+
if (e === br)
|
|
960
982
|
return t;
|
|
961
983
|
};
|
|
962
984
|
}
|
|
963
|
-
function
|
|
985
|
+
function Kt(t) {
|
|
964
986
|
if (typeof t == "string") {
|
|
965
987
|
const e = t.trim();
|
|
966
988
|
return e.length > 0 ? e : void 0;
|
|
@@ -970,13 +992,13 @@ function Ht(t) {
|
|
|
970
992
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
971
993
|
}
|
|
972
994
|
}
|
|
973
|
-
function
|
|
995
|
+
function Yt(...t) {
|
|
974
996
|
const e = [];
|
|
975
997
|
for (const n of t)
|
|
976
998
|
n && n.trim() && e.push(n.trim());
|
|
977
999
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
978
1000
|
}
|
|
979
|
-
function
|
|
1001
|
+
function Ne(t) {
|
|
980
1002
|
if (typeof t == "number" && Number.isFinite(t))
|
|
981
1003
|
return Math.floor(t);
|
|
982
1004
|
if (typeof t == "string" && t.trim().length > 0) {
|
|
@@ -985,33 +1007,33 @@ function Le(t) {
|
|
|
985
1007
|
return Math.floor(e);
|
|
986
1008
|
}
|
|
987
1009
|
}
|
|
988
|
-
function
|
|
1010
|
+
function tt(t) {
|
|
989
1011
|
if (typeof t != "string")
|
|
990
1012
|
return;
|
|
991
1013
|
const e = t.trim();
|
|
992
1014
|
return e.length > 0 ? e : void 0;
|
|
993
1015
|
}
|
|
994
|
-
const
|
|
995
|
-
function
|
|
996
|
-
const t =
|
|
997
|
-
const s = Z(r.store, n), i = E(null), a = E(null), l = r.video,
|
|
1016
|
+
const wr = "std.video-canvas", vr = "std.video-url-player";
|
|
1017
|
+
function Er() {
|
|
1018
|
+
const t = G(function({ nodeId: n, context: r, className: o }) {
|
|
1019
|
+
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
1020
|
C(() => {
|
|
999
|
-
if (!
|
|
1000
|
-
const p =
|
|
1001
|
-
return
|
|
1021
|
+
if (!h?.isWebRtcEnabled) return;
|
|
1022
|
+
const p = h.onWebRtcTrackMapChanged;
|
|
1023
|
+
return h.onWebRtcTrackMapChanged = (b) => {
|
|
1002
1024
|
p?.(b), b.kind === "video" && u((S) => S + 1);
|
|
1003
1025
|
}, () => {
|
|
1004
|
-
|
|
1026
|
+
h.onWebRtcTrackMapChanged = p;
|
|
1005
1027
|
};
|
|
1006
|
-
}, [
|
|
1007
|
-
const g =
|
|
1028
|
+
}, [h]);
|
|
1029
|
+
const g = h?.isWebRtcEnabled && f ? h.getWebRtcVideoStreamByStreamId(f) : null;
|
|
1008
1030
|
return C(() => {
|
|
1009
1031
|
const p = i.current;
|
|
1010
|
-
if (!(!l || !p || !
|
|
1011
|
-
return l.attachCanvas(
|
|
1012
|
-
l.detachCanvas(
|
|
1032
|
+
if (!(!l || !p || !f || g))
|
|
1033
|
+
return l.attachCanvas(f, p), () => {
|
|
1034
|
+
l.detachCanvas(f);
|
|
1013
1035
|
};
|
|
1014
|
-
}, [l,
|
|
1036
|
+
}, [l, f, g]), C(() => {
|
|
1015
1037
|
const p = a.current;
|
|
1016
1038
|
if (!(!p || !g))
|
|
1017
1039
|
return p.srcObject = g, () => {
|
|
@@ -1026,33 +1048,33 @@ function Ir() {
|
|
|
1026
1048
|
muted: !0,
|
|
1027
1049
|
"data-ikon-node-id": s.id,
|
|
1028
1050
|
"data-ikon-source": s.sourceMarker,
|
|
1029
|
-
"data-ikon-video-stream-id":
|
|
1051
|
+
"data-ikon-video-stream-id": f,
|
|
1030
1052
|
className: c,
|
|
1031
1053
|
...y ? { width: y } : {},
|
|
1032
1054
|
...m ? { height: m } : {}
|
|
1033
1055
|
},
|
|
1034
|
-
|
|
1056
|
+
f
|
|
1035
1057
|
) : /* @__PURE__ */ w.jsx(
|
|
1036
1058
|
"canvas",
|
|
1037
1059
|
{
|
|
1038
1060
|
ref: i,
|
|
1039
1061
|
"data-ikon-node-id": s.id,
|
|
1040
1062
|
"data-ikon-source": s.sourceMarker,
|
|
1041
|
-
"data-ikon-video-stream-id":
|
|
1063
|
+
"data-ikon-video-stream-id": f,
|
|
1042
1064
|
className: c,
|
|
1043
1065
|
...y ? { width: y } : {},
|
|
1044
1066
|
...m ? { height: m } : {}
|
|
1045
1067
|
},
|
|
1046
|
-
|
|
1068
|
+
f
|
|
1047
1069
|
) : null;
|
|
1048
1070
|
});
|
|
1049
1071
|
return ({ type: e }) => {
|
|
1050
|
-
if (e ===
|
|
1072
|
+
if (e === wr)
|
|
1051
1073
|
return t;
|
|
1052
1074
|
};
|
|
1053
1075
|
}
|
|
1054
|
-
function
|
|
1055
|
-
return [
|
|
1076
|
+
function Rr() {
|
|
1077
|
+
return [Er(), Ar(), Sr()];
|
|
1056
1078
|
}
|
|
1057
1079
|
function be(t) {
|
|
1058
1080
|
if (typeof t == "boolean")
|
|
@@ -1063,25 +1085,25 @@ function be(t) {
|
|
|
1063
1085
|
if (e === "false") return !1;
|
|
1064
1086
|
}
|
|
1065
1087
|
}
|
|
1066
|
-
function
|
|
1067
|
-
const t =
|
|
1088
|
+
function Ar() {
|
|
1089
|
+
const t = G(function({
|
|
1068
1090
|
nodeId: n,
|
|
1069
1091
|
context: r,
|
|
1070
1092
|
className: o
|
|
1071
1093
|
}) {
|
|
1072
|
-
const s = Z(r.store, n), i = E(null), a = s ? be(s.props?.autoplay) : void 0, l = s ?
|
|
1094
|
+
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
1095
|
if (C(() => {
|
|
1074
1096
|
a && i.current && i.current.play().catch(() => {
|
|
1075
1097
|
});
|
|
1076
1098
|
}, [a, l]), !s)
|
|
1077
1099
|
return null;
|
|
1078
|
-
const
|
|
1100
|
+
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
1101
|
return /* @__PURE__ */ w.jsx(
|
|
1080
1102
|
"video",
|
|
1081
1103
|
{
|
|
1082
1104
|
ref: i,
|
|
1083
1105
|
src: l,
|
|
1084
|
-
poster:
|
|
1106
|
+
poster: f,
|
|
1085
1107
|
...y !== void 0 ? { controls: y } : {},
|
|
1086
1108
|
...a !== void 0 ? { autoPlay: a } : {},
|
|
1087
1109
|
...m !== void 0 ? { loop: m } : {},
|
|
@@ -1091,33 +1113,33 @@ function Or() {
|
|
|
1091
1113
|
...p ? { height: p } : {},
|
|
1092
1114
|
"data-ikon-node-id": s.id,
|
|
1093
1115
|
"data-ikon-source": s.sourceMarker,
|
|
1094
|
-
className:
|
|
1116
|
+
className: h,
|
|
1095
1117
|
children: b
|
|
1096
1118
|
}
|
|
1097
1119
|
);
|
|
1098
1120
|
});
|
|
1099
1121
|
return ({ type: e }) => {
|
|
1100
|
-
if (e ===
|
|
1122
|
+
if (e === vr)
|
|
1101
1123
|
return t;
|
|
1102
1124
|
};
|
|
1103
1125
|
}
|
|
1104
|
-
const
|
|
1105
|
-
function
|
|
1106
|
-
t.registerModule(
|
|
1126
|
+
const Tr = "media", kr = async () => Rr();
|
|
1127
|
+
function Cr(t) {
|
|
1128
|
+
t.registerModule(Tr, kr);
|
|
1107
1129
|
}
|
|
1108
|
-
const
|
|
1130
|
+
const _r = `#version 300 es
|
|
1109
1131
|
in vec4 a_position;
|
|
1110
1132
|
void main() {
|
|
1111
1133
|
gl_Position = a_position;
|
|
1112
1134
|
}
|
|
1113
1135
|
`, le = 4;
|
|
1114
|
-
function
|
|
1136
|
+
function Ir(t, e) {
|
|
1115
1137
|
return new RegExp(`\\buniform\\s+\\w+\\s+${e}\\s*;`, "g").test(t);
|
|
1116
1138
|
}
|
|
1117
|
-
function
|
|
1139
|
+
function Or(t, e) {
|
|
1118
1140
|
const n = [];
|
|
1119
1141
|
for (const [r, o] of Object.entries(e)) {
|
|
1120
|
-
if (
|
|
1142
|
+
if (Ir(t, r))
|
|
1121
1143
|
continue;
|
|
1122
1144
|
let s;
|
|
1123
1145
|
switch (o.type) {
|
|
@@ -1178,7 +1200,7 @@ void main() {
|
|
|
1178
1200
|
}
|
|
1179
1201
|
`;
|
|
1180
1202
|
}
|
|
1181
|
-
class
|
|
1203
|
+
class xr {
|
|
1182
1204
|
gl;
|
|
1183
1205
|
program = null;
|
|
1184
1206
|
positionBuffer = null;
|
|
@@ -1253,10 +1275,10 @@ class jr {
|
|
|
1253
1275
|
}
|
|
1254
1276
|
compile(e, n = {}) {
|
|
1255
1277
|
this.lastError = null, this.customUniforms = n, this.currentShaderSource = e;
|
|
1256
|
-
const r = this.gl, o = this.compileShader(r.VERTEX_SHADER,
|
|
1278
|
+
const r = this.gl, o = this.compileShader(r.VERTEX_SHADER, _r);
|
|
1257
1279
|
if (!o)
|
|
1258
1280
|
return !1;
|
|
1259
|
-
const s =
|
|
1281
|
+
const s = Or(e, n), i = this.compileShader(r.FRAGMENT_SHADER, s);
|
|
1260
1282
|
if (!i)
|
|
1261
1283
|
return r.deleteShader(o), !1;
|
|
1262
1284
|
const a = r.createProgram();
|
|
@@ -1295,10 +1317,10 @@ class jr {
|
|
|
1295
1317
|
(n.width !== o || n.height !== s) && (n.width = o, n.height = s, e.viewport(0, 0, o, s));
|
|
1296
1318
|
const i = performance.now(), a = (i - this.startTime) / 1e3, l = (i - this.lastFrameTime) / 1e3;
|
|
1297
1319
|
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
|
-
|
|
1320
|
+
const h = this.uniformLocations.get("iResolution");
|
|
1321
|
+
h && e.uniform3f(h, o, s, 1);
|
|
1322
|
+
const f = this.uniformLocations.get("iTime");
|
|
1323
|
+
f && e.uniform1f(f, a);
|
|
1302
1324
|
const y = this.uniformLocations.get("iTimeDelta");
|
|
1303
1325
|
y && e.uniform1f(y, l);
|
|
1304
1326
|
const m = this.uniformLocations.get("iFrame");
|
|
@@ -1362,7 +1384,7 @@ class jr {
|
|
|
1362
1384
|
this.channels = [], this.uniformLocations.clear();
|
|
1363
1385
|
}
|
|
1364
1386
|
}
|
|
1365
|
-
function
|
|
1387
|
+
function Nr(t) {
|
|
1366
1388
|
if (typeof t == "string") {
|
|
1367
1389
|
const e = t.trim();
|
|
1368
1390
|
return e.length > 0 ? e : void 0;
|
|
@@ -1372,13 +1394,13 @@ function Dr(t) {
|
|
|
1372
1394
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
1373
1395
|
}
|
|
1374
1396
|
}
|
|
1375
|
-
function
|
|
1397
|
+
function Lr(...t) {
|
|
1376
1398
|
const e = [];
|
|
1377
1399
|
for (const n of t)
|
|
1378
1400
|
n && n.trim() && e.push(n.trim());
|
|
1379
1401
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
1380
1402
|
}
|
|
1381
|
-
function
|
|
1403
|
+
function Ke(t) {
|
|
1382
1404
|
if (typeof t == "number" && Number.isFinite(t))
|
|
1383
1405
|
return Math.floor(t);
|
|
1384
1406
|
if (typeof t == "string" && t.trim().length > 0) {
|
|
@@ -1387,10 +1409,10 @@ function Ye(t) {
|
|
|
1387
1409
|
return Math.floor(e);
|
|
1388
1410
|
}
|
|
1389
1411
|
}
|
|
1390
|
-
function
|
|
1412
|
+
function Pr(t) {
|
|
1391
1413
|
return typeof t == "string" ? t : "";
|
|
1392
1414
|
}
|
|
1393
|
-
function
|
|
1415
|
+
function Ur(t) {
|
|
1394
1416
|
if (typeof t == "boolean")
|
|
1395
1417
|
return t;
|
|
1396
1418
|
if (typeof t == "string") {
|
|
@@ -1399,7 +1421,7 @@ function Fr(t) {
|
|
|
1399
1421
|
if (e === "false") return !1;
|
|
1400
1422
|
}
|
|
1401
1423
|
}
|
|
1402
|
-
function
|
|
1424
|
+
function Mr(t) {
|
|
1403
1425
|
if (!t || typeof t != "object")
|
|
1404
1426
|
return {};
|
|
1405
1427
|
const e = {}, n = t;
|
|
@@ -1414,10 +1436,10 @@ function Vr(t) {
|
|
|
1414
1436
|
}
|
|
1415
1437
|
return e;
|
|
1416
1438
|
}
|
|
1417
|
-
function
|
|
1439
|
+
function Dr(t) {
|
|
1418
1440
|
return Array.isArray(t) ? t.map((e) => typeof e == "string" ? e : null) : [];
|
|
1419
1441
|
}
|
|
1420
|
-
function
|
|
1442
|
+
function jr(t, e) {
|
|
1421
1443
|
const n = Object.keys(t), r = Object.keys(e);
|
|
1422
1444
|
if (n.length !== r.length)
|
|
1423
1445
|
return !1;
|
|
@@ -1438,21 +1460,21 @@ function Kr(t, e) {
|
|
|
1438
1460
|
}
|
|
1439
1461
|
return !0;
|
|
1440
1462
|
}
|
|
1441
|
-
const
|
|
1442
|
-
function
|
|
1443
|
-
const t =
|
|
1444
|
-
const s = Z(r.store, n), i = E(null), a = E(null), l = E(null),
|
|
1463
|
+
const $r = "std.shadertoy-canvas";
|
|
1464
|
+
function Br() {
|
|
1465
|
+
const t = G(function({ nodeId: n, context: r, className: o }) {
|
|
1466
|
+
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
1467
|
x: 0,
|
|
1446
1468
|
y: 0,
|
|
1447
1469
|
clickX: 0,
|
|
1448
1470
|
clickY: 0,
|
|
1449
1471
|
isDown: !1
|
|
1450
|
-
}), c = s ?
|
|
1472
|
+
}), 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
1473
|
C(() => {
|
|
1452
|
-
const
|
|
1453
|
-
if (
|
|
1474
|
+
const I = i.current;
|
|
1475
|
+
if (I) {
|
|
1454
1476
|
try {
|
|
1455
|
-
const P = new
|
|
1477
|
+
const P = new xr(I);
|
|
1456
1478
|
a.current = P;
|
|
1457
1479
|
} catch (P) {
|
|
1458
1480
|
console.error("[ShadertoyRenderer] Failed to create WebGL2 context:", P);
|
|
@@ -1462,50 +1484,50 @@ function Yr() {
|
|
|
1462
1484
|
};
|
|
1463
1485
|
}
|
|
1464
1486
|
}, []), C(() => {
|
|
1465
|
-
const
|
|
1466
|
-
if (!(!
|
|
1467
|
-
if (
|
|
1468
|
-
|
|
1487
|
+
const I = a.current;
|
|
1488
|
+
if (!(!I || !c) && f.current !== c)
|
|
1489
|
+
if (I.compile(c, p))
|
|
1490
|
+
f.current = c, y.current = p;
|
|
1469
1491
|
else {
|
|
1470
|
-
const M =
|
|
1492
|
+
const M = I.getError();
|
|
1471
1493
|
console.error("[ShadertoyRenderer] Shader compilation failed:", M);
|
|
1472
1494
|
}
|
|
1473
1495
|
}, [c, p]), C(() => {
|
|
1474
|
-
const
|
|
1475
|
-
!
|
|
1496
|
+
const I = a.current;
|
|
1497
|
+
!I || !f.current || jr(y.current, p) || (I.setCustomUniforms(p), y.current = p);
|
|
1476
1498
|
}, [p]), C(() => {
|
|
1477
|
-
const
|
|
1478
|
-
|
|
1499
|
+
const I = a.current;
|
|
1500
|
+
I && I.setChannels(S);
|
|
1479
1501
|
}, [S]), C(() => {
|
|
1480
|
-
const
|
|
1481
|
-
if (!
|
|
1502
|
+
const I = a.current;
|
|
1503
|
+
if (!I || !f.current) return;
|
|
1482
1504
|
const P = 1e3 / u, M = (B) => {
|
|
1483
|
-
const $ = B -
|
|
1484
|
-
$ >= P && (
|
|
1505
|
+
const $ = B - h.current;
|
|
1506
|
+
$ >= P && (h.current = B - $ % P, I.draw()), l.current = requestAnimationFrame(M);
|
|
1485
1507
|
};
|
|
1486
1508
|
return l.current = requestAnimationFrame(M), () => {
|
|
1487
1509
|
l.current !== null && (cancelAnimationFrame(l.current), l.current = null);
|
|
1488
1510
|
};
|
|
1489
1511
|
}, [u]);
|
|
1490
|
-
const ee =
|
|
1491
|
-
(
|
|
1512
|
+
const ee = j(
|
|
1513
|
+
(I) => {
|
|
1492
1514
|
if (!R) return;
|
|
1493
1515
|
const P = i.current, M = a.current;
|
|
1494
1516
|
if (!P || !M) return;
|
|
1495
|
-
const B = window.devicePixelRatio || 1, $ = P.getBoundingClientRect(), V = (
|
|
1517
|
+
const B = window.devicePixelRatio || 1, $ = P.getBoundingClientRect(), V = (I.clientX - $.left) * B, K = ($.height - (I.clientY - $.top)) * B;
|
|
1496
1518
|
m.current.x = V, m.current.y = K, M.setMouse(V, K, m.current.clickX, m.current.clickY);
|
|
1497
1519
|
},
|
|
1498
1520
|
[R]
|
|
1499
|
-
), te =
|
|
1500
|
-
(
|
|
1521
|
+
), te = j(
|
|
1522
|
+
(I) => {
|
|
1501
1523
|
if (!R) return;
|
|
1502
1524
|
const P = i.current, M = a.current;
|
|
1503
1525
|
if (!P || !M) return;
|
|
1504
|
-
const B = window.devicePixelRatio || 1, $ = P.getBoundingClientRect(), V = (
|
|
1526
|
+
const B = window.devicePixelRatio || 1, $ = P.getBoundingClientRect(), V = (I.clientX - $.left) * B, K = ($.height - (I.clientY - $.top)) * B;
|
|
1505
1527
|
m.current.isDown = !0, m.current.clickX = V, m.current.clickY = K, M.setMouse(V, K, V, K);
|
|
1506
1528
|
},
|
|
1507
1529
|
[R]
|
|
1508
|
-
), z =
|
|
1530
|
+
), z = j(() => {
|
|
1509
1531
|
R && (m.current.isDown = !1, m.current.clickX = -Math.abs(m.current.clickX));
|
|
1510
1532
|
}, [R]);
|
|
1511
1533
|
return s ? /* @__PURE__ */ w.jsx(
|
|
@@ -1525,16 +1547,16 @@ function Yr() {
|
|
|
1525
1547
|
) : null;
|
|
1526
1548
|
});
|
|
1527
1549
|
return ({ type: e }) => {
|
|
1528
|
-
if (e ===
|
|
1550
|
+
if (e === $r)
|
|
1529
1551
|
return t;
|
|
1530
1552
|
};
|
|
1531
1553
|
}
|
|
1532
|
-
const
|
|
1533
|
-
function
|
|
1534
|
-
t.registerModule(
|
|
1554
|
+
const Fr = "shadertoy", Vr = async () => Br();
|
|
1555
|
+
function Wr(t) {
|
|
1556
|
+
t.registerModule(Fr, Vr);
|
|
1535
1557
|
}
|
|
1536
|
-
const
|
|
1537
|
-
class
|
|
1558
|
+
const vt = oe("UIRegistry");
|
|
1559
|
+
class Kr {
|
|
1538
1560
|
baseResolvers = [];
|
|
1539
1561
|
moduleLoaders = /* @__PURE__ */ new Map();
|
|
1540
1562
|
moduleResolvers = /* @__PURE__ */ new Map();
|
|
@@ -1556,15 +1578,15 @@ class qr {
|
|
|
1556
1578
|
for (const [r, o] of this.moduleLoaders.entries())
|
|
1557
1579
|
if (!this.moduleResolvers.has(r))
|
|
1558
1580
|
try {
|
|
1559
|
-
const s = await o(), i =
|
|
1581
|
+
const s = await o(), i = zr(s);
|
|
1560
1582
|
this.moduleResolvers.set(r, i), e = !0;
|
|
1561
1583
|
} catch (s) {
|
|
1562
|
-
|
|
1584
|
+
vt.error(`[IkonUiRegistry] Failed to load module '${r}'.`, s);
|
|
1563
1585
|
}
|
|
1564
1586
|
const n = [];
|
|
1565
1587
|
for (const r of this.moduleLoaders.keys())
|
|
1566
1588
|
this.moduleResolvers.has(r) && n.push(r);
|
|
1567
|
-
return
|
|
1589
|
+
return Xr(n, this.activeModuleOrder) || (this.activeModuleOrder = n, e = !0), e;
|
|
1568
1590
|
}
|
|
1569
1591
|
resolve(e) {
|
|
1570
1592
|
for (const n of this.baseResolvers) {
|
|
@@ -1574,7 +1596,7 @@ class qr {
|
|
|
1574
1596
|
for (const n of this.activeModuleOrder) {
|
|
1575
1597
|
const r = this.moduleResolvers.get(n);
|
|
1576
1598
|
if (!r) {
|
|
1577
|
-
|
|
1599
|
+
vt.warn(`Missing resolvers for module ${n}`);
|
|
1578
1600
|
continue;
|
|
1579
1601
|
}
|
|
1580
1602
|
for (const o of r) {
|
|
@@ -1584,17 +1606,17 @@ class qr {
|
|
|
1584
1606
|
}
|
|
1585
1607
|
}
|
|
1586
1608
|
}
|
|
1587
|
-
function
|
|
1588
|
-
const t = new
|
|
1589
|
-
return
|
|
1609
|
+
function Yr() {
|
|
1610
|
+
const t = new Kr();
|
|
1611
|
+
return mr(t), Cr(t), Wr(t), t.loadRegisteredModules(), t;
|
|
1590
1612
|
}
|
|
1591
|
-
function
|
|
1613
|
+
function Gr(t) {
|
|
1592
1614
|
return Array.isArray(t) ? t : [t];
|
|
1593
1615
|
}
|
|
1594
|
-
function
|
|
1595
|
-
return t ?
|
|
1616
|
+
function zr(t) {
|
|
1617
|
+
return t ? Gr(t).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
|
|
1596
1618
|
}
|
|
1597
|
-
function
|
|
1619
|
+
function Xr(t, e) {
|
|
1598
1620
|
if (t.length !== e.length)
|
|
1599
1621
|
return !1;
|
|
1600
1622
|
for (let n = 0; n < t.length; n += 1)
|
|
@@ -1602,9 +1624,9 @@ function eo(t, e) {
|
|
|
1602
1624
|
return !1;
|
|
1603
1625
|
return !0;
|
|
1604
1626
|
}
|
|
1605
|
-
function
|
|
1627
|
+
function Cs({ mount: t, stores: e, registry: n, client: r, onAction: o }) {
|
|
1606
1628
|
return /* @__PURE__ */ w.jsx(
|
|
1607
|
-
|
|
1629
|
+
Bt,
|
|
1608
1630
|
{
|
|
1609
1631
|
stores: e,
|
|
1610
1632
|
registry: n,
|
|
@@ -1614,7 +1636,7 @@ function Js({ mount: t, stores: e, registry: n, client: r, onAction: o }) {
|
|
|
1614
1636
|
}
|
|
1615
1637
|
);
|
|
1616
1638
|
}
|
|
1617
|
-
const
|
|
1639
|
+
const Ye = oe("MotionController"), Et = {
|
|
1618
1640
|
ease: [0.25, 0.1, 0.25, 1],
|
|
1619
1641
|
"ease-in": [0.42, 0, 1, 1],
|
|
1620
1642
|
"ease-out": [0, 0, 0.58, 1],
|
|
@@ -1647,18 +1669,18 @@ const ze = oe("MotionController"), Tt = {
|
|
|
1647
1669
|
function F(t) {
|
|
1648
1670
|
return t <= 0 ? 0 : t >= 1 ? 1 : t;
|
|
1649
1671
|
}
|
|
1650
|
-
function
|
|
1672
|
+
function Rt(t) {
|
|
1651
1673
|
if (t == null) return;
|
|
1652
1674
|
const e = `${t}`.trim();
|
|
1653
1675
|
if (!e) return;
|
|
1654
1676
|
const n = Number.parseFloat(e);
|
|
1655
1677
|
return Number.isFinite(n) ? n : void 0;
|
|
1656
1678
|
}
|
|
1657
|
-
function
|
|
1679
|
+
function At(t) {
|
|
1658
1680
|
return typeof CSS < "u" && CSS.escape ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
1659
1681
|
}
|
|
1660
|
-
function
|
|
1661
|
-
const
|
|
1682
|
+
function Tt(t, e, n, r) {
|
|
1683
|
+
const f = new Float32Array(11);
|
|
1662
1684
|
function y(p, b, S) {
|
|
1663
1685
|
return ((3 * b - 3 * S + 1) * p + (3 * S - 6 * b)) * p * p + 3 * b * p;
|
|
1664
1686
|
}
|
|
@@ -1685,47 +1707,47 @@ function It(t, e, n, r) {
|
|
|
1685
1707
|
function g(p) {
|
|
1686
1708
|
let b = 0, S = 1;
|
|
1687
1709
|
const R = 10;
|
|
1688
|
-
for (; S !== R &&
|
|
1710
|
+
for (; S !== R && f[S] <= p; S += 1)
|
|
1689
1711
|
b += 0.1;
|
|
1690
1712
|
S -= 1;
|
|
1691
|
-
const v = (p -
|
|
1713
|
+
const v = (p - f[S]) / (f[S + 1] - f[S]), T = b + v * 0.1, U = m(T, t, n);
|
|
1692
1714
|
return U >= 1e-3 ? c(p, T) : U === 0 ? T : u(p, b, b + 0.1);
|
|
1693
1715
|
}
|
|
1694
1716
|
for (let p = 0; p < 11; p += 1)
|
|
1695
|
-
|
|
1717
|
+
f[p] = y(p * 0.1, t, n);
|
|
1696
1718
|
return (p) => p <= 0 ? 0 : p >= 1 ? 1 : y(g(p), e, r);
|
|
1697
1719
|
}
|
|
1698
|
-
function
|
|
1720
|
+
function Hr(t) {
|
|
1699
1721
|
const e = /steps\(\s*([0-9]+)\s*(?:,\s*([a-z-]+)\s*)?\)/i.exec(t);
|
|
1700
1722
|
if (!e)
|
|
1701
1723
|
return (o) => F(o);
|
|
1702
1724
|
const n = Math.max(1, parseInt(e[1], 10)), r = (e[2] ?? "end").toLowerCase();
|
|
1703
1725
|
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
1726
|
}
|
|
1705
|
-
function
|
|
1727
|
+
function qr(t) {
|
|
1706
1728
|
if (!t)
|
|
1707
1729
|
return (n) => F(n);
|
|
1708
1730
|
const e = t.trim().toLowerCase();
|
|
1709
1731
|
if (!e || e === "linear")
|
|
1710
1732
|
return (n) => F(n);
|
|
1711
|
-
if (
|
|
1712
|
-
const [n, r, o, s] =
|
|
1733
|
+
if (Et[e]) {
|
|
1734
|
+
const [n, r, o, s] = Et[e], i = Tt(n, r, o, s);
|
|
1713
1735
|
return (a) => F(i(F(a)));
|
|
1714
1736
|
}
|
|
1715
1737
|
if (e.startsWith("cubic-bezier(") && e.endsWith(")")) {
|
|
1716
1738
|
const r = e.slice(13, -1).split(",").map((o) => Number.parseFloat(o.trim()));
|
|
1717
1739
|
if (r.length === 4 && r.every((o) => Number.isFinite(o))) {
|
|
1718
|
-
const [o, s, i, a] = r, l =
|
|
1719
|
-
return (
|
|
1740
|
+
const [o, s, i, a] = r, l = Tt(o, s, i, a);
|
|
1741
|
+
return (h) => F(l(F(h)));
|
|
1720
1742
|
}
|
|
1721
1743
|
}
|
|
1722
1744
|
if (e.startsWith("steps(") && e.endsWith(")")) {
|
|
1723
|
-
const n =
|
|
1745
|
+
const n = Hr(e);
|
|
1724
1746
|
return (r) => n(F(r));
|
|
1725
1747
|
}
|
|
1726
1748
|
return (n) => F(n);
|
|
1727
1749
|
}
|
|
1728
|
-
function
|
|
1750
|
+
function Jr(t) {
|
|
1729
1751
|
if (!t)
|
|
1730
1752
|
return;
|
|
1731
1753
|
const e = /(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)\s*->\s*(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)/.exec(t);
|
|
@@ -1735,7 +1757,7 @@ function ro(t) {
|
|
|
1735
1757
|
if (![n, r, o, s].some((i) => !Number.isFinite(i)))
|
|
1736
1758
|
return { inStart: n, inEnd: r, outStart: o, outEnd: s };
|
|
1737
1759
|
}
|
|
1738
|
-
class
|
|
1760
|
+
class Zr {
|
|
1739
1761
|
bindingsByStyle = /* @__PURE__ */ new Map();
|
|
1740
1762
|
observer;
|
|
1741
1763
|
observeScheduled = !1;
|
|
@@ -1762,7 +1784,7 @@ class oo {
|
|
|
1762
1784
|
try {
|
|
1763
1785
|
e();
|
|
1764
1786
|
} catch (n) {
|
|
1765
|
-
|
|
1787
|
+
Ye.warn("Failed to cleanup binding listener", n);
|
|
1766
1788
|
}
|
|
1767
1789
|
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
1790
|
}
|
|
@@ -1772,7 +1794,7 @@ class oo {
|
|
|
1772
1794
|
const r = (JSON.parse(e).motionBindings ?? []).map((o) => this.parseBinding(o)).filter((o) => o !== void 0);
|
|
1773
1795
|
return r.length === 0 ? void 0 : { bindings: r };
|
|
1774
1796
|
} catch (n) {
|
|
1775
|
-
|
|
1797
|
+
Ye.warn("Failed to parse motion metadata", n);
|
|
1776
1798
|
return;
|
|
1777
1799
|
}
|
|
1778
1800
|
}
|
|
@@ -1780,7 +1802,7 @@ class oo {
|
|
|
1780
1802
|
const n = e.source?.trim();
|
|
1781
1803
|
if (!n)
|
|
1782
1804
|
return;
|
|
1783
|
-
const r =
|
|
1805
|
+
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
1806
|
return Number.isNaN(r) || Number.isNaN(s) ? void 0 : {
|
|
1785
1807
|
source: n.toLowerCase(),
|
|
1786
1808
|
min: r,
|
|
@@ -1788,8 +1810,8 @@ class oo {
|
|
|
1788
1810
|
clamp: i === "freeze-start" || i === "freeze-end" || i === "unclamped" ? i : "clamp",
|
|
1789
1811
|
reverse: a,
|
|
1790
1812
|
ease: l,
|
|
1791
|
-
map:
|
|
1792
|
-
targetId:
|
|
1813
|
+
map: h,
|
|
1814
|
+
targetId: f
|
|
1793
1815
|
};
|
|
1794
1816
|
}
|
|
1795
1817
|
ensureObserver() {
|
|
@@ -1838,7 +1860,7 @@ class oo {
|
|
|
1838
1860
|
const n = this.bindingsByStyle.get(e);
|
|
1839
1861
|
if (!n || typeof document > "u")
|
|
1840
1862
|
return;
|
|
1841
|
-
const r = `.${
|
|
1863
|
+
const r = `.${At(e)}`;
|
|
1842
1864
|
document.querySelectorAll(r).forEach((s) => this.applyStyleToElement(s, e, n));
|
|
1843
1865
|
}
|
|
1844
1866
|
applyStyleToElement(e, n, r) {
|
|
@@ -1878,7 +1900,7 @@ class oo {
|
|
|
1878
1900
|
}
|
|
1879
1901
|
resolveScrollContainer(e, n) {
|
|
1880
1902
|
if (n.targetId) {
|
|
1881
|
-
const r = `[data-ikon-motion-source="${
|
|
1903
|
+
const r = `[data-ikon-motion-source="${At(n.targetId)}"]`, o = typeof document < "u" ? document.querySelector(r) : null;
|
|
1882
1904
|
if (o)
|
|
1883
1905
|
return o;
|
|
1884
1906
|
}
|
|
@@ -1888,10 +1910,10 @@ class oo {
|
|
|
1888
1910
|
const o = n.max - n.min, s = o === 0 ? r > n.min ? 1 : 0 : (r - n.min) / o;
|
|
1889
1911
|
let i = this.applyClamp(s, n.clamp);
|
|
1890
1912
|
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
|
-
|
|
1913
|
+
const a = n.ease(i), l = Number.isFinite(a) ? a : 0, h = l * 100;
|
|
1914
|
+
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) {
|
|
1915
|
+
const f = this.applyMap(h, n.map);
|
|
1916
|
+
f !== void 0 && e.style.setProperty("--tw-motion-bind-value", `${f}`);
|
|
1895
1917
|
} else
|
|
1896
1918
|
e.style.removeProperty("--tw-motion-bind-value");
|
|
1897
1919
|
}
|
|
@@ -1948,7 +1970,7 @@ class oo {
|
|
|
1948
1970
|
try {
|
|
1949
1971
|
i();
|
|
1950
1972
|
} catch (a) {
|
|
1951
|
-
|
|
1973
|
+
Ye.warn("Failed to cleanup listener", a);
|
|
1952
1974
|
}
|
|
1953
1975
|
this.globalCleanups.delete(i);
|
|
1954
1976
|
}
|
|
@@ -1993,29 +2015,29 @@ class oo {
|
|
|
1993
2015
|
}
|
|
1994
2016
|
}
|
|
1995
2017
|
}
|
|
1996
|
-
const
|
|
1997
|
-
function
|
|
1998
|
-
const e = E(/* @__PURE__ */ new Map()), n =
|
|
2018
|
+
const Ge = new Zr();
|
|
2019
|
+
function Qr(t) {
|
|
2020
|
+
const e = E(/* @__PURE__ */ new Map()), n = j(({ styleId: s, css: i, common: a }) => {
|
|
1999
2021
|
if (!(!s || typeof document > "u")) {
|
|
2000
2022
|
if (i) {
|
|
2001
2023
|
let l = e.current.get(s);
|
|
2002
2024
|
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
2025
|
}
|
|
2004
|
-
|
|
2026
|
+
Ge.registerStyle(s, a);
|
|
2005
2027
|
}
|
|
2006
|
-
}, []), r =
|
|
2028
|
+
}, []), r = j((s) => {
|
|
2007
2029
|
if (!(typeof document > "u"))
|
|
2008
2030
|
for (const i of s) {
|
|
2009
2031
|
const a = e.current.get(i);
|
|
2010
|
-
a && (a.remove(), e.current.delete(i)),
|
|
2032
|
+
a && (a.remove(), e.current.delete(i)), Ge.unregisterStyle(i);
|
|
2011
2033
|
}
|
|
2012
|
-
}, []), o =
|
|
2034
|
+
}, []), o = j(() => {
|
|
2013
2035
|
if (typeof document < "u") {
|
|
2014
2036
|
for (const s of e.current.values())
|
|
2015
2037
|
s.remove();
|
|
2016
2038
|
e.current.clear();
|
|
2017
2039
|
}
|
|
2018
|
-
|
|
2040
|
+
Ge.reset();
|
|
2019
2041
|
}, []);
|
|
2020
2042
|
return C(() => {
|
|
2021
2043
|
if (!t) return;
|
|
@@ -2027,7 +2049,7 @@ function so(t) {
|
|
|
2027
2049
|
};
|
|
2028
2050
|
}, [t, o, n, r]), C(() => () => o(), [o]), { setStyle: n, deleteStyles: r, reset: o };
|
|
2029
2051
|
}
|
|
2030
|
-
function
|
|
2052
|
+
function eo(t) {
|
|
2031
2053
|
const e = [];
|
|
2032
2054
|
for (const [n, r] of t) {
|
|
2033
2055
|
const o = r.store.getSnapshot(), s = o.rootViewId && o.views.has(o.rootViewId);
|
|
@@ -2035,126 +2057,20 @@ function io(t) {
|
|
|
2035
2057
|
}
|
|
2036
2058
|
return e.sort(), e.join(",");
|
|
2037
2059
|
}
|
|
2038
|
-
function
|
|
2039
|
-
const [e, n] =
|
|
2060
|
+
function to(t) {
|
|
2061
|
+
const [e, n] = x(), r = E("");
|
|
2040
2062
|
return C(() => {
|
|
2041
2063
|
if (!t) {
|
|
2042
2064
|
n(void 0), r.current = "";
|
|
2043
2065
|
return;
|
|
2044
2066
|
}
|
|
2045
2067
|
const o = () => {
|
|
2046
|
-
const s = t.getStores(), i =
|
|
2068
|
+
const s = t.getStores(), i = eo(s);
|
|
2047
2069
|
i !== r.current && (r.current = i, n(s));
|
|
2048
2070
|
};
|
|
2049
2071
|
return o(), t.subscribe(o);
|
|
2050
2072
|
}, [t]), e;
|
|
2051
2073
|
}
|
|
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
2074
|
const k = {
|
|
2159
2075
|
None: 0,
|
|
2160
2076
|
Letter: 1,
|
|
@@ -2162,7 +2078,7 @@ const k = {
|
|
|
2162
2078
|
Line: 4,
|
|
2163
2079
|
Paragraph: 8,
|
|
2164
2080
|
Emoji: 16
|
|
2165
|
-
},
|
|
2081
|
+
}, no = [
|
|
2166
2082
|
{
|
|
2167
2083
|
flag: k.Letter,
|
|
2168
2084
|
hints: [
|
|
@@ -2211,32 +2127,32 @@ const k = {
|
|
|
2211
2127
|
"[data-emoji]"
|
|
2212
2128
|
]
|
|
2213
2129
|
}
|
|
2214
|
-
],
|
|
2215
|
-
function
|
|
2216
|
-
if (!t || t.length >
|
|
2130
|
+
], 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;
|
|
2131
|
+
function _s(t, e) {
|
|
2132
|
+
if (!t || t.length > oo)
|
|
2217
2133
|
return t;
|
|
2218
|
-
const n =
|
|
2134
|
+
const n = Eo(e), r = fe(n, k.Emoji), o = n & ro;
|
|
2219
2135
|
if (o === k.None && !r)
|
|
2220
2136
|
return t;
|
|
2221
2137
|
const s = t.replace(/\r\n/g, `
|
|
2222
2138
|
`).replace(/\r/g, `
|
|
2223
2139
|
`);
|
|
2224
2140
|
if (o === k.None)
|
|
2225
|
-
return
|
|
2226
|
-
const i =
|
|
2141
|
+
return Ot(s);
|
|
2142
|
+
const i = wo(s);
|
|
2227
2143
|
if (i.length === 0)
|
|
2228
|
-
return r ?
|
|
2229
|
-
const a =
|
|
2230
|
-
for (const
|
|
2231
|
-
const y =
|
|
2232
|
-
|
|
2144
|
+
return r ? Ot(s) : t;
|
|
2145
|
+
const a = vo(i), l = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, h = [];
|
|
2146
|
+
for (const f of a) {
|
|
2147
|
+
const y = so(f, n, l);
|
|
2148
|
+
h.push(...y);
|
|
2233
2149
|
}
|
|
2234
|
-
return
|
|
2150
|
+
return h;
|
|
2235
2151
|
}
|
|
2236
|
-
function
|
|
2152
|
+
function so(t, e, n) {
|
|
2237
2153
|
const r = [];
|
|
2238
2154
|
for (const o of t) {
|
|
2239
|
-
const s =
|
|
2155
|
+
const s = io(o, e, n);
|
|
2240
2156
|
r.push(...s);
|
|
2241
2157
|
}
|
|
2242
2158
|
if (fe(e, k.Paragraph)) {
|
|
@@ -2246,7 +2162,7 @@ function Oo(t, e, n) {
|
|
|
2246
2162
|
"span",
|
|
2247
2163
|
{
|
|
2248
2164
|
"data-motion-paragraph": !0,
|
|
2249
|
-
style:
|
|
2165
|
+
style: Ue(o),
|
|
2250
2166
|
children: r
|
|
2251
2167
|
},
|
|
2252
2168
|
`motion-paragraph-${o}`
|
|
@@ -2255,12 +2171,12 @@ function Oo(t, e, n) {
|
|
|
2255
2171
|
}
|
|
2256
2172
|
return r;
|
|
2257
2173
|
}
|
|
2258
|
-
function
|
|
2259
|
-
const r =
|
|
2174
|
+
function io(t, e, n) {
|
|
2175
|
+
const r = ao(t.text, e, n), o = [];
|
|
2260
2176
|
if (fe(e, k.Line)) {
|
|
2261
2177
|
const s = n.line++;
|
|
2262
2178
|
o.push(
|
|
2263
|
-
/* @__PURE__ */ w.jsx("span", { "data-motion-line": !0, style:
|
|
2179
|
+
/* @__PURE__ */ w.jsx("span", { "data-motion-line": !0, style: Ue(s), children: r }, `motion-line-${s}`)
|
|
2264
2180
|
);
|
|
2265
2181
|
} else
|
|
2266
2182
|
o.push(...r);
|
|
@@ -2268,7 +2184,7 @@ function No(t, e, n) {
|
|
|
2268
2184
|
o.push(/* @__PURE__ */ w.jsx("br", {}, `motion-break-${n.br++}`));
|
|
2269
2185
|
return o;
|
|
2270
2186
|
}
|
|
2271
|
-
function
|
|
2187
|
+
function ao(t, e, n) {
|
|
2272
2188
|
if (!t)
|
|
2273
2189
|
return [];
|
|
2274
2190
|
const r = fe(e, k.Word), o = [], s = /(\s+)/g;
|
|
@@ -2276,95 +2192,95 @@ function xo(t, e, n) {
|
|
|
2276
2192
|
for (; (a = s.exec(t)) !== null; ) {
|
|
2277
2193
|
if (a.index > i) {
|
|
2278
2194
|
const l = t.slice(i, a.index);
|
|
2279
|
-
o.push(
|
|
2195
|
+
o.push(Ct(l, n, e, r));
|
|
2280
2196
|
}
|
|
2281
2197
|
o.push(a[0]), i = a.index + a[0].length;
|
|
2282
2198
|
}
|
|
2283
2199
|
if (i < t.length) {
|
|
2284
2200
|
const l = t.slice(i);
|
|
2285
|
-
o.push(
|
|
2201
|
+
o.push(Ct(l, n, e, r));
|
|
2286
2202
|
}
|
|
2287
2203
|
return o;
|
|
2288
2204
|
}
|
|
2289
|
-
function
|
|
2290
|
-
const o = e.word++, s =
|
|
2205
|
+
function Ct(t, e, n, r) {
|
|
2206
|
+
const o = e.word++, s = lo(t, n, e), i = `motion-word-${o}`, a = co(o, r);
|
|
2291
2207
|
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
2208
|
}
|
|
2293
|
-
function
|
|
2294
|
-
return e ? { ...
|
|
2209
|
+
function co(t, e) {
|
|
2210
|
+
return e ? { ...Ue(t), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
|
|
2295
2211
|
}
|
|
2296
|
-
function
|
|
2212
|
+
function lo(t, e, n) {
|
|
2297
2213
|
if (!t)
|
|
2298
2214
|
return [];
|
|
2299
2215
|
const r = fe(e, k.Letter), o = fe(e, k.Emoji);
|
|
2300
2216
|
if (!r) {
|
|
2301
2217
|
if (!o)
|
|
2302
2218
|
return [t];
|
|
2303
|
-
const a =
|
|
2219
|
+
const a = rt(t);
|
|
2304
2220
|
if (a.length === 0)
|
|
2305
2221
|
return [t];
|
|
2306
|
-
const { nodes: l } =
|
|
2222
|
+
const { nodes: l } = zt(a, n);
|
|
2307
2223
|
return l;
|
|
2308
2224
|
}
|
|
2309
|
-
const s = [], i =
|
|
2225
|
+
const s = [], i = rt(t);
|
|
2310
2226
|
for (const a of i) {
|
|
2311
|
-
const l = n.letter++,
|
|
2227
|
+
const l = n.letter++, h = `motion-letter-${l}`, f = Ue(l);
|
|
2312
2228
|
if (a === `
|
|
2313
2229
|
`) {
|
|
2314
2230
|
s.push(
|
|
2315
|
-
/* @__PURE__ */ w.jsx("span", { "data-motion-letter": !0, style:
|
|
2231
|
+
/* @__PURE__ */ w.jsx("span", { "data-motion-letter": !0, style: f, children: /* @__PURE__ */ w.jsx("br", {}) }, h)
|
|
2316
2232
|
);
|
|
2317
2233
|
continue;
|
|
2318
2234
|
}
|
|
2319
|
-
const m = o &&
|
|
2235
|
+
const m = o && Gt(a) ? { "data-motion-emoji": !0 } : void 0, c = a === " " ? " " : a;
|
|
2320
2236
|
s.push(
|
|
2321
|
-
/* @__PURE__ */ w.jsx("span", { "data-motion-letter": !0, style:
|
|
2237
|
+
/* @__PURE__ */ w.jsx("span", { "data-motion-letter": !0, style: f, ...m, children: c }, h)
|
|
2322
2238
|
);
|
|
2323
2239
|
}
|
|
2324
2240
|
return s;
|
|
2325
2241
|
}
|
|
2326
|
-
function
|
|
2242
|
+
function rt(t) {
|
|
2327
2243
|
if (!t)
|
|
2328
2244
|
return [];
|
|
2329
|
-
const e =
|
|
2330
|
-
return e ? Array.from(e.segment(t), (n) => n.segment) :
|
|
2245
|
+
const e = uo();
|
|
2246
|
+
return e ? Array.from(e.segment(t), (n) => n.segment) : fo(t);
|
|
2331
2247
|
}
|
|
2332
|
-
let
|
|
2333
|
-
function
|
|
2334
|
-
return
|
|
2248
|
+
let Se;
|
|
2249
|
+
function uo() {
|
|
2250
|
+
return Se !== void 0 || (typeof Intl < "u" && typeof Intl.Segmenter == "function" ? Se = new Intl.Segmenter(void 0, { granularity: "grapheme" }) : Se = null), Se;
|
|
2335
2251
|
}
|
|
2336
|
-
function
|
|
2252
|
+
function fo(t) {
|
|
2337
2253
|
const e = [], n = Array.from(t);
|
|
2338
2254
|
let r = "";
|
|
2339
2255
|
for (let o = 0; o < n.length; o++) {
|
|
2340
2256
|
const s = n[o], i = n[o + 1];
|
|
2341
|
-
r += s, !(i &&
|
|
2257
|
+
r += s, !(i && ho(s, i)) && (e.push(r), r = "");
|
|
2342
2258
|
}
|
|
2343
2259
|
return r && e.push(r), e;
|
|
2344
2260
|
}
|
|
2345
|
-
function
|
|
2346
|
-
return e ? !!(
|
|
2261
|
+
function ho(t, e) {
|
|
2262
|
+
return e ? !!(_t(t) || _t(e) || go(e) || po(e) || mo(e) || It(t) && It(e)) : !1;
|
|
2347
2263
|
}
|
|
2348
|
-
function
|
|
2264
|
+
function _t(t) {
|
|
2349
2265
|
return t.codePointAt(0) === 8205;
|
|
2350
2266
|
}
|
|
2351
|
-
function
|
|
2267
|
+
function po(t) {
|
|
2352
2268
|
const e = t.codePointAt(0);
|
|
2353
2269
|
return e === void 0 ? !1 : e >= 65024 && e <= 65039 || e >= 917760 && e <= 917999;
|
|
2354
2270
|
}
|
|
2355
|
-
function
|
|
2271
|
+
function mo(t) {
|
|
2356
2272
|
const e = t.codePointAt(0);
|
|
2357
2273
|
return e === void 0 ? !1 : e >= 127995 && e <= 127999;
|
|
2358
2274
|
}
|
|
2359
|
-
function
|
|
2275
|
+
function It(t) {
|
|
2360
2276
|
const e = t.codePointAt(0);
|
|
2361
2277
|
return e === void 0 ? !1 : e >= 127462 && e <= 127487;
|
|
2362
2278
|
}
|
|
2363
|
-
let
|
|
2364
|
-
function
|
|
2365
|
-
return t ? (
|
|
2279
|
+
let ze;
|
|
2280
|
+
function go(t) {
|
|
2281
|
+
return t ? (ze || (ze = yo()), ze(t)) : !1;
|
|
2366
2282
|
}
|
|
2367
|
-
function
|
|
2283
|
+
function yo() {
|
|
2368
2284
|
try {
|
|
2369
2285
|
const t = new RegExp("\\p{Mark}", "u");
|
|
2370
2286
|
return (e) => t.test(e);
|
|
@@ -2375,19 +2291,19 @@ function Fo() {
|
|
|
2375
2291
|
};
|
|
2376
2292
|
}
|
|
2377
2293
|
}
|
|
2378
|
-
let
|
|
2379
|
-
function
|
|
2380
|
-
return t ? (
|
|
2294
|
+
let Xe;
|
|
2295
|
+
function Gt(t) {
|
|
2296
|
+
return t ? (Xe || (Xe = bo()), Xe(t)) : !1;
|
|
2381
2297
|
}
|
|
2382
|
-
function
|
|
2298
|
+
function bo() {
|
|
2383
2299
|
try {
|
|
2384
2300
|
const t = new RegExp("\\p{Extended_Pictographic}", "u");
|
|
2385
2301
|
return (e) => t.test(e);
|
|
2386
2302
|
} catch {
|
|
2387
|
-
return
|
|
2303
|
+
return So;
|
|
2388
2304
|
}
|
|
2389
2305
|
}
|
|
2390
|
-
function
|
|
2306
|
+
function So(t) {
|
|
2391
2307
|
if (!t)
|
|
2392
2308
|
return !1;
|
|
2393
2309
|
for (const e of Array.from(t)) {
|
|
@@ -2397,7 +2313,7 @@ function Wo(t) {
|
|
|
2397
2313
|
}
|
|
2398
2314
|
return !1;
|
|
2399
2315
|
}
|
|
2400
|
-
function
|
|
2316
|
+
function wo(t) {
|
|
2401
2317
|
const e = [];
|
|
2402
2318
|
let n = "", r = 0;
|
|
2403
2319
|
for (let o = 0; o < t.length; o++) {
|
|
@@ -2411,7 +2327,7 @@ function Ko(t) {
|
|
|
2411
2327
|
}
|
|
2412
2328
|
return (r > 0 || n.length > 0) && e.push({ text: n, breaks: r }), e;
|
|
2413
2329
|
}
|
|
2414
|
-
function
|
|
2330
|
+
function vo(t) {
|
|
2415
2331
|
if (t.length === 0)
|
|
2416
2332
|
return [];
|
|
2417
2333
|
const e = [];
|
|
@@ -2423,7 +2339,7 @@ function Go(t) {
|
|
|
2423
2339
|
function fe(t, e) {
|
|
2424
2340
|
return (t & e) === e;
|
|
2425
2341
|
}
|
|
2426
|
-
function
|
|
2342
|
+
function Ue(t) {
|
|
2427
2343
|
return {
|
|
2428
2344
|
"--tw-motion-seq-index": t.toString(),
|
|
2429
2345
|
backgroundColor: "inherit",
|
|
@@ -2440,27 +2356,27 @@ function je(t) {
|
|
|
2440
2356
|
WebkitTextFillColor: "inherit"
|
|
2441
2357
|
};
|
|
2442
2358
|
}
|
|
2443
|
-
function
|
|
2359
|
+
function Ot(t) {
|
|
2444
2360
|
if (!t)
|
|
2445
2361
|
return t;
|
|
2446
|
-
const e =
|
|
2362
|
+
const e = rt(t);
|
|
2447
2363
|
if (e.length === 0)
|
|
2448
2364
|
return t;
|
|
2449
|
-
const { nodes: n, sawEmoji: r } =
|
|
2365
|
+
const { nodes: n, sawEmoji: r } = zt(e);
|
|
2450
2366
|
return r ? n.length === 1 ? n[0] ?? t : n : t;
|
|
2451
2367
|
}
|
|
2452
|
-
function
|
|
2368
|
+
function zt(t, e) {
|
|
2453
2369
|
const n = [];
|
|
2454
2370
|
let r = "", o = !1, s = e?.emoji ?? 0;
|
|
2455
2371
|
const i = () => {
|
|
2456
2372
|
r && (n.push(r), r = "");
|
|
2457
2373
|
};
|
|
2458
2374
|
for (const a of t) {
|
|
2459
|
-
if (
|
|
2375
|
+
if (Gt(a)) {
|
|
2460
2376
|
o = !0, i();
|
|
2461
|
-
const
|
|
2377
|
+
const h = `motion-emoji-${e ? e.emoji++ : s++}`;
|
|
2462
2378
|
n.push(
|
|
2463
|
-
/* @__PURE__ */ w.jsx("span", { "data-motion-emoji": !0, children: a },
|
|
2379
|
+
/* @__PURE__ */ w.jsx("span", { "data-motion-emoji": !0, children: a }, h)
|
|
2464
2380
|
);
|
|
2465
2381
|
continue;
|
|
2466
2382
|
}
|
|
@@ -2468,13 +2384,13 @@ function Qt(t, e) {
|
|
|
2468
2384
|
}
|
|
2469
2385
|
return i(), o ? { nodes: n, sawEmoji: !0 } : { nodes: [t.join("")], sawEmoji: !1 };
|
|
2470
2386
|
}
|
|
2471
|
-
function
|
|
2387
|
+
function Eo(t) {
|
|
2472
2388
|
if (!t)
|
|
2473
2389
|
return k.None;
|
|
2474
2390
|
const e = t.trim();
|
|
2475
2391
|
if (!e)
|
|
2476
2392
|
return k.None;
|
|
2477
|
-
const n =
|
|
2393
|
+
const n = kt.get(e);
|
|
2478
2394
|
if (typeof n == "number")
|
|
2479
2395
|
return n;
|
|
2480
2396
|
if (typeof document > "u")
|
|
@@ -2482,25 +2398,25 @@ function Yo(t) {
|
|
|
2482
2398
|
const r = e.split(/\s+/).filter(Boolean);
|
|
2483
2399
|
if (r.length === 0)
|
|
2484
2400
|
return k.None;
|
|
2485
|
-
const s = r.map((l) => `.${
|
|
2486
|
-
(l) => new RegExp(`(^|[^a-zA-Z0-9_-])${
|
|
2401
|
+
const s = r.map((l) => `.${Ro(l)}`).map(
|
|
2402
|
+
(l) => new RegExp(`(^|[^a-zA-Z0-9_-])${Ao(l)}(?![a-zA-Z0-9_-])`)
|
|
2487
2403
|
);
|
|
2488
2404
|
let i = k.None, a = !1;
|
|
2489
2405
|
for (const l of Array.from(document.styleSheets)) {
|
|
2490
|
-
let
|
|
2406
|
+
let h;
|
|
2491
2407
|
try {
|
|
2492
|
-
|
|
2408
|
+
h = l.cssRules;
|
|
2493
2409
|
} catch {
|
|
2494
2410
|
continue;
|
|
2495
2411
|
}
|
|
2496
|
-
const
|
|
2497
|
-
if (
|
|
2412
|
+
const f = Xt(h, s);
|
|
2413
|
+
if (f.mask && (i |= f.mask, i === nt))
|
|
2498
2414
|
break;
|
|
2499
|
-
a ||=
|
|
2415
|
+
a ||= f.sawStyleRule;
|
|
2500
2416
|
}
|
|
2501
|
-
return (i !== k.None || a) &&
|
|
2417
|
+
return (i !== k.None || a) && kt.set(e, i), i;
|
|
2502
2418
|
}
|
|
2503
|
-
function
|
|
2419
|
+
function Xt(t, e) {
|
|
2504
2420
|
if (!t)
|
|
2505
2421
|
return { mask: k.None, sawStyleRule: !1 };
|
|
2506
2422
|
let n = k.None, r = !1;
|
|
@@ -2509,15 +2425,15 @@ function en(t, e) {
|
|
|
2509
2425
|
if (s) {
|
|
2510
2426
|
if (s.type === CSSRule.STYLE_RULE) {
|
|
2511
2427
|
const a = s.selectorText ?? "";
|
|
2512
|
-
if (!a || !e.some((
|
|
2428
|
+
if (!a || !e.some((h) => h.test(a))) continue;
|
|
2513
2429
|
r = !0;
|
|
2514
|
-
for (const
|
|
2515
|
-
|
|
2516
|
-
if (n ===
|
|
2430
|
+
for (const h of no)
|
|
2431
|
+
h.hints.some((f) => a.includes(f)) && (n |= h.flag);
|
|
2432
|
+
if (n === nt)
|
|
2517
2433
|
return { mask: n, sawStyleRule: !0 };
|
|
2518
2434
|
} else if ("cssRules" in s) {
|
|
2519
|
-
const i =
|
|
2520
|
-
if (i.mask && (n |= i.mask, n ===
|
|
2435
|
+
const i = Xt(s.cssRules, e);
|
|
2436
|
+
if (i.mask && (n |= i.mask, n === nt))
|
|
2521
2437
|
return { mask: n, sawStyleRule: !0 };
|
|
2522
2438
|
r ||= i.sawStyleRule;
|
|
2523
2439
|
}
|
|
@@ -2525,58 +2441,58 @@ function en(t, e) {
|
|
|
2525
2441
|
}
|
|
2526
2442
|
return { mask: n, sawStyleRule: r };
|
|
2527
2443
|
}
|
|
2528
|
-
function
|
|
2444
|
+
function Ro(t) {
|
|
2529
2445
|
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
2530
2446
|
}
|
|
2531
|
-
function
|
|
2447
|
+
function Ao(t) {
|
|
2532
2448
|
return t.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
|
|
2533
2449
|
}
|
|
2534
|
-
const
|
|
2535
|
-
function
|
|
2450
|
+
const ct = "ikon-auth-session", Ht = "ikon-auth-auto-login-attempted-run", To = 10080 * 60 * 1e3, ko = 60 * 1e3;
|
|
2451
|
+
function qt(t) {
|
|
2536
2452
|
try {
|
|
2537
2453
|
const e = t.split(".");
|
|
2538
2454
|
if (e.length !== 3) return !0;
|
|
2539
2455
|
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 -
|
|
2456
|
+
return typeof o.exp != "number" ? !1 : Date.now() >= o.exp * 1e3 - ko;
|
|
2541
2457
|
} catch {
|
|
2542
2458
|
return !0;
|
|
2543
2459
|
}
|
|
2544
2460
|
}
|
|
2545
2461
|
function he(t) {
|
|
2546
2462
|
try {
|
|
2547
|
-
localStorage.setItem(
|
|
2463
|
+
localStorage.setItem(ct, JSON.stringify(t));
|
|
2548
2464
|
} catch {
|
|
2549
2465
|
console.warn("Failed to save auth session to localStorage");
|
|
2550
2466
|
}
|
|
2551
2467
|
}
|
|
2552
|
-
function
|
|
2468
|
+
function Jt() {
|
|
2553
2469
|
try {
|
|
2554
|
-
const t = localStorage.getItem(
|
|
2470
|
+
const t = localStorage.getItem(ct);
|
|
2555
2471
|
if (!t) return null;
|
|
2556
2472
|
const e = JSON.parse(t);
|
|
2557
|
-
return Date.now() - e.authenticatedAt >
|
|
2473
|
+
return Date.now() - e.authenticatedAt > To || qt(e.token) ? (Le(), null) : e;
|
|
2558
2474
|
} catch {
|
|
2559
2475
|
return console.warn("Failed to load auth session from localStorage"), null;
|
|
2560
2476
|
}
|
|
2561
2477
|
}
|
|
2562
|
-
function
|
|
2478
|
+
function Le() {
|
|
2563
2479
|
try {
|
|
2564
|
-
localStorage.removeItem(
|
|
2480
|
+
localStorage.removeItem(ct);
|
|
2565
2481
|
} catch {
|
|
2566
2482
|
console.warn("Failed to clear auth session from localStorage");
|
|
2567
2483
|
}
|
|
2568
2484
|
}
|
|
2569
|
-
function
|
|
2485
|
+
function Co(t) {
|
|
2570
2486
|
if (t)
|
|
2571
2487
|
try {
|
|
2572
|
-
sessionStorage.setItem(
|
|
2488
|
+
sessionStorage.setItem(Ht, t);
|
|
2573
2489
|
} catch {
|
|
2574
2490
|
console.warn("Failed to record auto-login attempt in sessionStorage");
|
|
2575
2491
|
}
|
|
2576
2492
|
}
|
|
2577
|
-
function
|
|
2493
|
+
function _o() {
|
|
2578
2494
|
try {
|
|
2579
|
-
return sessionStorage.getItem(
|
|
2495
|
+
return sessionStorage.getItem(Ht);
|
|
2580
2496
|
} catch {
|
|
2581
2497
|
return null;
|
|
2582
2498
|
}
|
|
@@ -2589,42 +2505,42 @@ function ne(t) {
|
|
|
2589
2505
|
authenticatedAt: t.authenticatedAt
|
|
2590
2506
|
};
|
|
2591
2507
|
}
|
|
2592
|
-
const
|
|
2593
|
-
async function
|
|
2508
|
+
const Zt = 15e3, we = oe("AuthService");
|
|
2509
|
+
async function xt(t) {
|
|
2594
2510
|
try {
|
|
2595
2511
|
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
2512
|
} catch (e) {
|
|
2597
2513
|
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
2514
|
}
|
|
2599
2515
|
}
|
|
2600
|
-
async function
|
|
2601
|
-
const n =
|
|
2516
|
+
async function Qt(t, e) {
|
|
2517
|
+
const n = kn(), r = {
|
|
2602
2518
|
method: "POST",
|
|
2603
2519
|
headers: { "Content-Type": "application/json" },
|
|
2604
2520
|
body: JSON.stringify({ deviceId: n, space: t })
|
|
2605
2521
|
}, o = typeof window < "u" ? window.location.origin : "?", s = `${e}/anonymous`;
|
|
2606
|
-
|
|
2522
|
+
we.info(`Anonymous auth: POST ${s} (space=${t}, origin=${o})`);
|
|
2607
2523
|
let i;
|
|
2608
2524
|
try {
|
|
2609
2525
|
i = await fetch(s, r);
|
|
2610
|
-
} catch (
|
|
2611
|
-
const
|
|
2526
|
+
} catch (h) {
|
|
2527
|
+
const f = h instanceof Error ? `${h.name}: ${h.message}` : String(h), y = Cn(), m = y ? `${y}/anonymous` : null;
|
|
2612
2528
|
if (m && m !== s) {
|
|
2613
|
-
|
|
2529
|
+
we.warn(`Anonymous auth could not reach ${s} (${f}); falling back to same-origin ${m}`);
|
|
2614
2530
|
try {
|
|
2615
2531
|
i = await fetch(m, r);
|
|
2616
2532
|
} catch (c) {
|
|
2617
|
-
const u = c instanceof Error ? `${c.name}: ${c.message}` : String(c), g = await
|
|
2618
|
-
throw
|
|
2533
|
+
const u = c instanceof Error ? `${c.name}: ${c.message}` : String(c), g = await xt(e);
|
|
2534
|
+
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
2535
|
}
|
|
2620
2536
|
} else {
|
|
2621
|
-
const c = await
|
|
2622
|
-
throw
|
|
2537
|
+
const c = await xt(e);
|
|
2538
|
+
throw we.error(`Anonymous auth fetch threw for ${s} — ${f}. ${c}`), new Error(`Anonymous auth could not reach ${s} (${f}). ${c}`);
|
|
2623
2539
|
}
|
|
2624
2540
|
}
|
|
2625
2541
|
if (!i.ok) {
|
|
2626
|
-
const
|
|
2627
|
-
throw
|
|
2542
|
+
const h = await i.text().catch(() => "Unknown error");
|
|
2543
|
+
throw we.error(`Anonymous auth HTTP ${i.status} from ${i.url}: ${h}`), new Error(`Anonymous auth failed: ${i.status} ${h}`);
|
|
2628
2544
|
}
|
|
2629
2545
|
const { token: a } = await i.json(), l = {
|
|
2630
2546
|
token: a,
|
|
@@ -2633,7 +2549,7 @@ async function sn(t, e) {
|
|
|
2633
2549
|
};
|
|
2634
2550
|
return he(l), l;
|
|
2635
2551
|
}
|
|
2636
|
-
async function
|
|
2552
|
+
async function Io({ email: t, spaceId: e, authUrl: n }) {
|
|
2637
2553
|
const r = await fetch(`${n}/email/send`, {
|
|
2638
2554
|
method: "POST",
|
|
2639
2555
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2641,14 +2557,14 @@ async function Qo({ email: t, spaceId: e, authUrl: n }) {
|
|
|
2641
2557
|
email: t.trim(),
|
|
2642
2558
|
space: e
|
|
2643
2559
|
}),
|
|
2644
|
-
signal:
|
|
2560
|
+
signal: Dt(Zt)
|
|
2645
2561
|
});
|
|
2646
2562
|
if (!r.ok) {
|
|
2647
2563
|
const o = await r.text().catch(() => "Failed to send login code");
|
|
2648
2564
|
throw new Error(o);
|
|
2649
2565
|
}
|
|
2650
2566
|
}
|
|
2651
|
-
async function
|
|
2567
|
+
async function Oo({ email: t, code: e, authUrl: n }) {
|
|
2652
2568
|
const r = await fetch(`${n}/email/code`, {
|
|
2653
2569
|
method: "POST",
|
|
2654
2570
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2656,7 +2572,7 @@ async function es({ email: t, code: e, authUrl: n }) {
|
|
|
2656
2572
|
email: t.trim(),
|
|
2657
2573
|
code: e.trim()
|
|
2658
2574
|
}),
|
|
2659
|
-
signal:
|
|
2575
|
+
signal: Dt(Zt)
|
|
2660
2576
|
});
|
|
2661
2577
|
if (!r.ok) {
|
|
2662
2578
|
const i = await r.text().catch(() => "Invalid code");
|
|
@@ -2669,21 +2585,21 @@ async function es({ email: t, code: e, authUrl: n }) {
|
|
|
2669
2585
|
};
|
|
2670
2586
|
return he(s), s;
|
|
2671
2587
|
}
|
|
2672
|
-
function
|
|
2588
|
+
function xo() {
|
|
2673
2589
|
const t = new URLSearchParams(window.location.search), e = t.get("ikon_token"), n = t.get("ikon_provider");
|
|
2674
2590
|
return e && n ? { token: e, provider: n } : null;
|
|
2675
2591
|
}
|
|
2676
|
-
function
|
|
2592
|
+
function No() {
|
|
2677
2593
|
return new URLSearchParams(window.location.search).get("error");
|
|
2678
2594
|
}
|
|
2679
|
-
function
|
|
2595
|
+
function Nt() {
|
|
2680
2596
|
window.history.replaceState({}, "", window.location.pathname);
|
|
2681
2597
|
}
|
|
2682
|
-
function
|
|
2598
|
+
function Lo(t, e, n, r) {
|
|
2683
2599
|
const o = r ?? window.location.origin + window.location.pathname + window.location.search;
|
|
2684
2600
|
return `${n}/oauth/${t}?space=${encodeURIComponent(e)}&return=${encodeURIComponent(o)}`;
|
|
2685
2601
|
}
|
|
2686
|
-
async function
|
|
2602
|
+
async function Po(t) {
|
|
2687
2603
|
const e = await fetch(`${t}/passkey/registration/options`, {
|
|
2688
2604
|
method: "POST",
|
|
2689
2605
|
headers: { "Content-Type": "application/json" }
|
|
@@ -2694,7 +2610,7 @@ async function os(t) {
|
|
|
2694
2610
|
}
|
|
2695
2611
|
return e.json();
|
|
2696
2612
|
}
|
|
2697
|
-
async function
|
|
2613
|
+
async function Uo(t, e, n) {
|
|
2698
2614
|
const r = await fetch(`${t}/passkey/registration/verify`, {
|
|
2699
2615
|
method: "POST",
|
|
2700
2616
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2711,7 +2627,7 @@ async function ss(t, e, n) {
|
|
|
2711
2627
|
};
|
|
2712
2628
|
return he(s), s;
|
|
2713
2629
|
}
|
|
2714
|
-
async function
|
|
2630
|
+
async function Mo(t, e) {
|
|
2715
2631
|
const n = await fetch(`${t}/passkey/authentication/options`, {
|
|
2716
2632
|
method: "POST",
|
|
2717
2633
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2723,7 +2639,7 @@ async function is(t, e) {
|
|
|
2723
2639
|
}
|
|
2724
2640
|
return n.json();
|
|
2725
2641
|
}
|
|
2726
|
-
async function
|
|
2642
|
+
async function Do(t, e) {
|
|
2727
2643
|
const n = await fetch(`${t}/passkey/authentication/verify`, {
|
|
2728
2644
|
method: "POST",
|
|
2729
2645
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2747,23 +2663,23 @@ function X(t) {
|
|
|
2747
2663
|
n += String.fromCharCode(o);
|
|
2748
2664
|
return btoa(n).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
2749
2665
|
}
|
|
2750
|
-
function
|
|
2666
|
+
function Pe(t) {
|
|
2751
2667
|
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
2668
|
for (let a = 0; a < o.length; a++)
|
|
2753
2669
|
i[a] = o.charCodeAt(a);
|
|
2754
2670
|
return s;
|
|
2755
2671
|
}
|
|
2756
|
-
function
|
|
2757
|
-
return
|
|
2672
|
+
function lt() {
|
|
2673
|
+
return jo.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
|
|
2758
2674
|
}
|
|
2759
|
-
const
|
|
2675
|
+
const jo = {
|
|
2760
2676
|
stubThis: (t) => t
|
|
2761
2677
|
};
|
|
2762
|
-
function
|
|
2678
|
+
function en(t) {
|
|
2763
2679
|
const { id: e } = t;
|
|
2764
2680
|
return {
|
|
2765
2681
|
...t,
|
|
2766
|
-
id:
|
|
2682
|
+
id: Pe(e),
|
|
2767
2683
|
/**
|
|
2768
2684
|
* `descriptor.transports` is an array of our `AuthenticatorTransportFuture` that includes newer
|
|
2769
2685
|
* transports that TypeScript's DOM lib is ignorant of. Convince TS that our list of transports
|
|
@@ -2772,14 +2688,14 @@ function an(t) {
|
|
|
2772
2688
|
transports: t.transports
|
|
2773
2689
|
};
|
|
2774
2690
|
}
|
|
2775
|
-
function
|
|
2691
|
+
function tn(t) {
|
|
2776
2692
|
return (
|
|
2777
2693
|
// Consider localhost valid as well since it's okay wrt Secure Contexts
|
|
2778
2694
|
t === "localhost" || // Support punycode (ACE) or ascii labels and domains
|
|
2779
2695
|
/^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(t)
|
|
2780
2696
|
);
|
|
2781
2697
|
}
|
|
2782
|
-
class
|
|
2698
|
+
class D extends Error {
|
|
2783
2699
|
constructor({ message: e, code: n, cause: r, name: o }) {
|
|
2784
2700
|
super(e, { cause: r }), Object.defineProperty(this, "code", {
|
|
2785
2701
|
enumerable: !0,
|
|
@@ -2789,20 +2705,20 @@ class j extends Error {
|
|
|
2789
2705
|
}), this.name = o ?? r.name, this.code = n;
|
|
2790
2706
|
}
|
|
2791
2707
|
}
|
|
2792
|
-
function
|
|
2708
|
+
function $o({ error: t, options: e }) {
|
|
2793
2709
|
const { publicKey: n } = e;
|
|
2794
2710
|
if (!n)
|
|
2795
2711
|
throw Error("options was missing required publicKey property");
|
|
2796
2712
|
if (t.name === "AbortError") {
|
|
2797
2713
|
if (e.signal instanceof AbortSignal)
|
|
2798
|
-
return new
|
|
2714
|
+
return new D({
|
|
2799
2715
|
message: "Registration ceremony was sent an abort signal",
|
|
2800
2716
|
code: "ERROR_CEREMONY_ABORTED",
|
|
2801
2717
|
cause: t
|
|
2802
2718
|
});
|
|
2803
2719
|
} else if (t.name === "ConstraintError") {
|
|
2804
2720
|
if (n.authenticatorSelection?.requireResidentKey === !0)
|
|
2805
|
-
return new
|
|
2721
|
+
return new D({
|
|
2806
2722
|
message: "Discoverable credentials were required but no available authenticator supported it",
|
|
2807
2723
|
code: "ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",
|
|
2808
2724
|
cause: t
|
|
@@ -2811,63 +2727,63 @@ function ls({ error: t, options: e }) {
|
|
|
2811
2727
|
// @ts-ignore: `mediation` doesn't yet exist on CredentialCreationOptions but it's possible as of Sept 2024
|
|
2812
2728
|
e.mediation === "conditional" && n.authenticatorSelection?.userVerification === "required"
|
|
2813
2729
|
)
|
|
2814
|
-
return new
|
|
2730
|
+
return new D({
|
|
2815
2731
|
message: "User verification was required during automatic registration but it could not be performed",
|
|
2816
2732
|
code: "ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",
|
|
2817
2733
|
cause: t
|
|
2818
2734
|
});
|
|
2819
2735
|
if (n.authenticatorSelection?.userVerification === "required")
|
|
2820
|
-
return new
|
|
2736
|
+
return new D({
|
|
2821
2737
|
message: "User verification was required but no available authenticator supported it",
|
|
2822
2738
|
code: "ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",
|
|
2823
2739
|
cause: t
|
|
2824
2740
|
});
|
|
2825
2741
|
} else {
|
|
2826
2742
|
if (t.name === "InvalidStateError")
|
|
2827
|
-
return new
|
|
2743
|
+
return new D({
|
|
2828
2744
|
message: "The authenticator was previously registered",
|
|
2829
2745
|
code: "ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",
|
|
2830
2746
|
cause: t
|
|
2831
2747
|
});
|
|
2832
2748
|
if (t.name === "NotAllowedError")
|
|
2833
|
-
return new
|
|
2749
|
+
return new D({
|
|
2834
2750
|
message: t.message,
|
|
2835
2751
|
code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
|
|
2836
2752
|
cause: t
|
|
2837
2753
|
});
|
|
2838
2754
|
if (t.name === "NotSupportedError")
|
|
2839
|
-
return n.pubKeyCredParams.filter((o) => o.type === "public-key").length === 0 ? new
|
|
2755
|
+
return n.pubKeyCredParams.filter((o) => o.type === "public-key").length === 0 ? new D({
|
|
2840
2756
|
message: 'No entry in pubKeyCredParams was of type "public-key"',
|
|
2841
2757
|
code: "ERROR_MALFORMED_PUBKEYCREDPARAMS",
|
|
2842
2758
|
cause: t
|
|
2843
|
-
}) : new
|
|
2759
|
+
}) : new D({
|
|
2844
2760
|
message: "No available authenticator supported any of the specified pubKeyCredParams algorithms",
|
|
2845
2761
|
code: "ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",
|
|
2846
2762
|
cause: t
|
|
2847
2763
|
});
|
|
2848
2764
|
if (t.name === "SecurityError") {
|
|
2849
2765
|
const r = globalThis.location.hostname;
|
|
2850
|
-
if (
|
|
2766
|
+
if (tn(r)) {
|
|
2851
2767
|
if (n.rp.id !== r)
|
|
2852
|
-
return new
|
|
2768
|
+
return new D({
|
|
2853
2769
|
message: `The RP ID "${n.rp.id}" is invalid for this domain`,
|
|
2854
2770
|
code: "ERROR_INVALID_RP_ID",
|
|
2855
2771
|
cause: t
|
|
2856
2772
|
});
|
|
2857
|
-
} else return new
|
|
2773
|
+
} else return new D({
|
|
2858
2774
|
message: `${globalThis.location.hostname} is an invalid domain`,
|
|
2859
2775
|
code: "ERROR_INVALID_DOMAIN",
|
|
2860
2776
|
cause: t
|
|
2861
2777
|
});
|
|
2862
2778
|
} else if (t.name === "TypeError") {
|
|
2863
2779
|
if (n.user.id.byteLength < 1 || n.user.id.byteLength > 64)
|
|
2864
|
-
return new
|
|
2780
|
+
return new D({
|
|
2865
2781
|
message: "User ID was not between 1 and 64 characters",
|
|
2866
2782
|
code: "ERROR_INVALID_USER_ID_LENGTH",
|
|
2867
2783
|
cause: t
|
|
2868
2784
|
});
|
|
2869
2785
|
} else if (t.name === "UnknownError")
|
|
2870
|
-
return new
|
|
2786
|
+
return new D({
|
|
2871
2787
|
message: "The authenticator was unable to process the specified options, or could not create a new credential",
|
|
2872
2788
|
code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
|
|
2873
2789
|
cause: t
|
|
@@ -2875,7 +2791,7 @@ function ls({ error: t, options: e }) {
|
|
|
2875
2791
|
}
|
|
2876
2792
|
return t;
|
|
2877
2793
|
}
|
|
2878
|
-
class
|
|
2794
|
+
class Bo {
|
|
2879
2795
|
constructor() {
|
|
2880
2796
|
Object.defineProperty(this, "controller", {
|
|
2881
2797
|
enumerable: !0,
|
|
@@ -2899,43 +2815,43 @@ class us {
|
|
|
2899
2815
|
}
|
|
2900
2816
|
}
|
|
2901
2817
|
}
|
|
2902
|
-
const
|
|
2903
|
-
function
|
|
2904
|
-
if (t && !(
|
|
2818
|
+
const nn = new Bo(), Fo = ["cross-platform", "platform"];
|
|
2819
|
+
function rn(t) {
|
|
2820
|
+
if (t && !(Fo.indexOf(t) < 0))
|
|
2905
2821
|
return t;
|
|
2906
2822
|
}
|
|
2907
|
-
async function
|
|
2823
|
+
async function Vo(t) {
|
|
2908
2824
|
!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
2825
|
const { optionsJSON: e, useAutoRegister: n = !1 } = t;
|
|
2910
|
-
if (!
|
|
2826
|
+
if (!lt())
|
|
2911
2827
|
throw new Error("WebAuthn is not supported in this browser");
|
|
2912
2828
|
const r = {
|
|
2913
2829
|
...e,
|
|
2914
|
-
challenge:
|
|
2830
|
+
challenge: Pe(e.challenge),
|
|
2915
2831
|
user: {
|
|
2916
2832
|
...e.user,
|
|
2917
|
-
id:
|
|
2833
|
+
id: Pe(e.user.id)
|
|
2918
2834
|
},
|
|
2919
|
-
excludeCredentials: e.excludeCredentials?.map(
|
|
2835
|
+
excludeCredentials: e.excludeCredentials?.map(en)
|
|
2920
2836
|
}, o = {};
|
|
2921
|
-
n && (o.mediation = "conditional"), o.publicKey = r, o.signal =
|
|
2837
|
+
n && (o.mediation = "conditional"), o.publicKey = r, o.signal = nn.createNewAbortSignal();
|
|
2922
2838
|
let s;
|
|
2923
2839
|
try {
|
|
2924
2840
|
s = await navigator.credentials.create(o);
|
|
2925
2841
|
} catch (u) {
|
|
2926
|
-
throw
|
|
2842
|
+
throw $o({ error: u, options: o });
|
|
2927
2843
|
}
|
|
2928
2844
|
if (!s)
|
|
2929
2845
|
throw new Error("Registration was not completed");
|
|
2930
|
-
const { id: i, rawId: a, response: l, type:
|
|
2931
|
-
let
|
|
2932
|
-
typeof l.getTransports == "function" && (
|
|
2846
|
+
const { id: i, rawId: a, response: l, type: h } = s;
|
|
2847
|
+
let f;
|
|
2848
|
+
typeof l.getTransports == "function" && (f = l.getTransports());
|
|
2933
2849
|
let y;
|
|
2934
2850
|
if (typeof l.getPublicKeyAlgorithm == "function")
|
|
2935
2851
|
try {
|
|
2936
2852
|
y = l.getPublicKeyAlgorithm();
|
|
2937
2853
|
} catch (u) {
|
|
2938
|
-
|
|
2854
|
+
He("getPublicKeyAlgorithm()", u);
|
|
2939
2855
|
}
|
|
2940
2856
|
let m;
|
|
2941
2857
|
if (typeof l.getPublicKey == "function")
|
|
@@ -2943,14 +2859,14 @@ async function fs(t) {
|
|
|
2943
2859
|
const u = l.getPublicKey();
|
|
2944
2860
|
u !== null && (m = X(u));
|
|
2945
2861
|
} catch (u) {
|
|
2946
|
-
|
|
2862
|
+
He("getPublicKey()", u);
|
|
2947
2863
|
}
|
|
2948
2864
|
let c;
|
|
2949
2865
|
if (typeof l.getAuthenticatorData == "function")
|
|
2950
2866
|
try {
|
|
2951
2867
|
c = X(l.getAuthenticatorData());
|
|
2952
2868
|
} catch (u) {
|
|
2953
|
-
|
|
2869
|
+
He("getAuthenticatorData()", u);
|
|
2954
2870
|
}
|
|
2955
2871
|
return {
|
|
2956
2872
|
id: i,
|
|
@@ -2958,63 +2874,63 @@ async function fs(t) {
|
|
|
2958
2874
|
response: {
|
|
2959
2875
|
attestationObject: X(l.attestationObject),
|
|
2960
2876
|
clientDataJSON: X(l.clientDataJSON),
|
|
2961
|
-
transports:
|
|
2877
|
+
transports: f,
|
|
2962
2878
|
publicKeyAlgorithm: y,
|
|
2963
2879
|
publicKey: m,
|
|
2964
2880
|
authenticatorData: c
|
|
2965
2881
|
},
|
|
2966
|
-
type:
|
|
2882
|
+
type: h,
|
|
2967
2883
|
clientExtensionResults: s.getClientExtensionResults(),
|
|
2968
|
-
authenticatorAttachment:
|
|
2884
|
+
authenticatorAttachment: rn(s.authenticatorAttachment)
|
|
2969
2885
|
};
|
|
2970
2886
|
}
|
|
2971
|
-
function
|
|
2887
|
+
function He(t, e) {
|
|
2972
2888
|
console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${t}. You should report this error to them.
|
|
2973
2889
|
`, e);
|
|
2974
2890
|
}
|
|
2975
|
-
function
|
|
2976
|
-
if (!
|
|
2977
|
-
return
|
|
2891
|
+
function Wo() {
|
|
2892
|
+
if (!lt())
|
|
2893
|
+
return qe.stubThis(new Promise((e) => e(!1)));
|
|
2978
2894
|
const t = globalThis.PublicKeyCredential;
|
|
2979
|
-
return t?.isConditionalMediationAvailable === void 0 ?
|
|
2895
|
+
return t?.isConditionalMediationAvailable === void 0 ? qe.stubThis(new Promise((e) => e(!1))) : qe.stubThis(t.isConditionalMediationAvailable());
|
|
2980
2896
|
}
|
|
2981
|
-
const
|
|
2897
|
+
const qe = {
|
|
2982
2898
|
stubThis: (t) => t
|
|
2983
2899
|
};
|
|
2984
|
-
function
|
|
2900
|
+
function Ko({ error: t, options: e }) {
|
|
2985
2901
|
const { publicKey: n } = e;
|
|
2986
2902
|
if (!n)
|
|
2987
2903
|
throw Error("options was missing required publicKey property");
|
|
2988
2904
|
if (t.name === "AbortError") {
|
|
2989
2905
|
if (e.signal instanceof AbortSignal)
|
|
2990
|
-
return new
|
|
2906
|
+
return new D({
|
|
2991
2907
|
message: "Authentication ceremony was sent an abort signal",
|
|
2992
2908
|
code: "ERROR_CEREMONY_ABORTED",
|
|
2993
2909
|
cause: t
|
|
2994
2910
|
});
|
|
2995
2911
|
} else {
|
|
2996
2912
|
if (t.name === "NotAllowedError")
|
|
2997
|
-
return new
|
|
2913
|
+
return new D({
|
|
2998
2914
|
message: t.message,
|
|
2999
2915
|
code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
|
|
3000
2916
|
cause: t
|
|
3001
2917
|
});
|
|
3002
2918
|
if (t.name === "SecurityError") {
|
|
3003
2919
|
const r = globalThis.location.hostname;
|
|
3004
|
-
if (
|
|
2920
|
+
if (tn(r)) {
|
|
3005
2921
|
if (n.rpId !== r)
|
|
3006
|
-
return new
|
|
2922
|
+
return new D({
|
|
3007
2923
|
message: `The RP ID "${n.rpId}" is invalid for this domain`,
|
|
3008
2924
|
code: "ERROR_INVALID_RP_ID",
|
|
3009
2925
|
cause: t
|
|
3010
2926
|
});
|
|
3011
|
-
} else return new
|
|
2927
|
+
} else return new D({
|
|
3012
2928
|
message: `${globalThis.location.hostname} is an invalid domain`,
|
|
3013
2929
|
code: "ERROR_INVALID_DOMAIN",
|
|
3014
2930
|
cause: t
|
|
3015
2931
|
});
|
|
3016
2932
|
} else if (t.name === "UnknownError")
|
|
3017
|
-
return new
|
|
2933
|
+
return new D({
|
|
3018
2934
|
message: "The authenticator was unable to process the specified options, or could not create a new assertion signature",
|
|
3019
2935
|
code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
|
|
3020
2936
|
cause: t
|
|
@@ -3022,53 +2938,53 @@ function ps({ error: t, options: e }) {
|
|
|
3022
2938
|
}
|
|
3023
2939
|
return t;
|
|
3024
2940
|
}
|
|
3025
|
-
async function
|
|
2941
|
+
async function Yo(t) {
|
|
3026
2942
|
!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
2943
|
const { optionsJSON: e, useBrowserAutofill: n = !1, verifyBrowserAutofillInput: r = !0 } = t;
|
|
3028
|
-
if (!
|
|
2944
|
+
if (!lt())
|
|
3029
2945
|
throw new Error("WebAuthn is not supported in this browser");
|
|
3030
2946
|
let o;
|
|
3031
|
-
e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(
|
|
2947
|
+
e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(en));
|
|
3032
2948
|
const s = {
|
|
3033
2949
|
...e,
|
|
3034
|
-
challenge:
|
|
2950
|
+
challenge: Pe(e.challenge),
|
|
3035
2951
|
allowCredentials: o
|
|
3036
2952
|
}, i = {};
|
|
3037
2953
|
if (n) {
|
|
3038
|
-
if (!await
|
|
2954
|
+
if (!await Wo())
|
|
3039
2955
|
throw Error("Browser does not support WebAuthn autofill");
|
|
3040
2956
|
if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 && r)
|
|
3041
2957
|
throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
|
|
3042
2958
|
i.mediation = "conditional", s.allowCredentials = [];
|
|
3043
2959
|
}
|
|
3044
|
-
i.publicKey = s, i.signal =
|
|
2960
|
+
i.publicKey = s, i.signal = nn.createNewAbortSignal();
|
|
3045
2961
|
let a;
|
|
3046
2962
|
try {
|
|
3047
2963
|
a = await navigator.credentials.get(i);
|
|
3048
2964
|
} catch (c) {
|
|
3049
|
-
throw
|
|
2965
|
+
throw Ko({ error: c, options: i });
|
|
3050
2966
|
}
|
|
3051
2967
|
if (!a)
|
|
3052
2968
|
throw new Error("Authentication was not completed");
|
|
3053
|
-
const { id: l, rawId:
|
|
2969
|
+
const { id: l, rawId: h, response: f, type: y } = a;
|
|
3054
2970
|
let m;
|
|
3055
|
-
return
|
|
2971
|
+
return f.userHandle && (m = X(f.userHandle)), {
|
|
3056
2972
|
id: l,
|
|
3057
|
-
rawId: X(
|
|
2973
|
+
rawId: X(h),
|
|
3058
2974
|
response: {
|
|
3059
|
-
authenticatorData: X(
|
|
3060
|
-
clientDataJSON: X(
|
|
3061
|
-
signature: X(
|
|
2975
|
+
authenticatorData: X(f.authenticatorData),
|
|
2976
|
+
clientDataJSON: X(f.clientDataJSON),
|
|
2977
|
+
signature: X(f.signature),
|
|
3062
2978
|
userHandle: m
|
|
3063
2979
|
},
|
|
3064
2980
|
type: y,
|
|
3065
2981
|
clientExtensionResults: a.getClientExtensionResults(),
|
|
3066
|
-
authenticatorAttachment:
|
|
2982
|
+
authenticatorAttachment: rn(a.authenticatorAttachment)
|
|
3067
2983
|
};
|
|
3068
2984
|
}
|
|
3069
|
-
const
|
|
3070
|
-
function
|
|
3071
|
-
const [n, r] =
|
|
2985
|
+
const ut = Mt(null);
|
|
2986
|
+
function Is({ children: t, config: e }) {
|
|
2987
|
+
const [n, r] = x({
|
|
3072
2988
|
isAuthenticated: !1,
|
|
3073
2989
|
isLoading: !0,
|
|
3074
2990
|
user: null,
|
|
@@ -3076,11 +2992,11 @@ function ni({ children: t, config: e }) {
|
|
|
3076
2992
|
});
|
|
3077
2993
|
C(() => {
|
|
3078
2994
|
(() => {
|
|
3079
|
-
const m = e.devLoginRunId, c = !!m &&
|
|
3080
|
-
m &&
|
|
3081
|
-
const u =
|
|
2995
|
+
const m = e.devLoginRunId, c = !!m && _o() === m;
|
|
2996
|
+
m && Co(m);
|
|
2997
|
+
const u = No();
|
|
3082
2998
|
if (u) {
|
|
3083
|
-
|
|
2999
|
+
Nt(), r({
|
|
3084
3000
|
isAuthenticated: !1,
|
|
3085
3001
|
isLoading: !1,
|
|
3086
3002
|
user: null,
|
|
@@ -3088,14 +3004,14 @@ function ni({ children: t, config: e }) {
|
|
|
3088
3004
|
});
|
|
3089
3005
|
return;
|
|
3090
3006
|
}
|
|
3091
|
-
const g =
|
|
3007
|
+
const g = xo();
|
|
3092
3008
|
if (g) {
|
|
3093
3009
|
const b = {
|
|
3094
3010
|
token: g.token,
|
|
3095
3011
|
provider: g.provider,
|
|
3096
3012
|
authenticatedAt: Date.now()
|
|
3097
3013
|
};
|
|
3098
|
-
he(b),
|
|
3014
|
+
he(b), Nt(), r({
|
|
3099
3015
|
isAuthenticated: !0,
|
|
3100
3016
|
isLoading: !1,
|
|
3101
3017
|
user: ne(b),
|
|
@@ -3103,7 +3019,7 @@ function ni({ children: t, config: e }) {
|
|
|
3103
3019
|
});
|
|
3104
3020
|
return;
|
|
3105
3021
|
}
|
|
3106
|
-
const p =
|
|
3022
|
+
const p = Jt();
|
|
3107
3023
|
if (p) {
|
|
3108
3024
|
r({
|
|
3109
3025
|
isAuthenticated: !0,
|
|
@@ -3113,7 +3029,7 @@ function ni({ children: t, config: e }) {
|
|
|
3113
3029
|
});
|
|
3114
3030
|
return;
|
|
3115
3031
|
}
|
|
3116
|
-
if (e.devLoginToken && m && !c && !
|
|
3032
|
+
if (e.devLoginToken && m && !c && !qt(e.devLoginToken)) {
|
|
3117
3033
|
const b = {
|
|
3118
3034
|
token: e.devLoginToken,
|
|
3119
3035
|
provider: "dev",
|
|
@@ -3135,7 +3051,7 @@ function ni({ children: t, config: e }) {
|
|
|
3135
3051
|
});
|
|
3136
3052
|
})();
|
|
3137
3053
|
}, [e.devLoginToken, e.devLoginRunId]);
|
|
3138
|
-
const o =
|
|
3054
|
+
const o = j(
|
|
3139
3055
|
async (y) => {
|
|
3140
3056
|
if (!e.spaceId) {
|
|
3141
3057
|
r((c) => ({
|
|
@@ -3144,11 +3060,11 @@ function ni({ children: t, config: e }) {
|
|
|
3144
3060
|
}));
|
|
3145
3061
|
return;
|
|
3146
3062
|
}
|
|
3147
|
-
const m = await
|
|
3063
|
+
const m = await ve(e.authUrl);
|
|
3148
3064
|
if (y === "guest") {
|
|
3149
3065
|
r((c) => ({ ...c, isLoading: !0 }));
|
|
3150
3066
|
try {
|
|
3151
|
-
const c = await
|
|
3067
|
+
const c = await Qt(e.spaceId, m);
|
|
3152
3068
|
r({
|
|
3153
3069
|
isAuthenticated: !0,
|
|
3154
3070
|
isLoading: !1,
|
|
@@ -3167,7 +3083,7 @@ function ni({ children: t, config: e }) {
|
|
|
3167
3083
|
if (y === "passkey") {
|
|
3168
3084
|
r((c) => ({ ...c, isLoading: !0, error: null }));
|
|
3169
3085
|
try {
|
|
3170
|
-
const c = await
|
|
3086
|
+
const c = await Mo(m), u = await Yo({ optionsJSON: c }), g = await Do(m, u);
|
|
3171
3087
|
r({
|
|
3172
3088
|
isAuthenticated: !0,
|
|
3173
3089
|
isLoading: !1,
|
|
@@ -3185,22 +3101,22 @@ function ni({ children: t, config: e }) {
|
|
|
3185
3101
|
}
|
|
3186
3102
|
if (y === "email")
|
|
3187
3103
|
throw new Error("login('email') is not supported. Use requestEmailCode()/submitEmailCode() from useAuth() instead.");
|
|
3188
|
-
window.location.href =
|
|
3104
|
+
window.location.href = Lo(y, e.spaceId, m);
|
|
3189
3105
|
},
|
|
3190
3106
|
[e.authUrl, e.spaceId]
|
|
3191
|
-
), s =
|
|
3107
|
+
), s = j(
|
|
3192
3108
|
async (y) => {
|
|
3193
3109
|
if (!e.spaceId)
|
|
3194
3110
|
throw r((c) => ({ ...c, error: "Space ID is not configured" })), new Error("Space ID is not configured");
|
|
3195
|
-
const m = await
|
|
3196
|
-
await
|
|
3111
|
+
const m = await ve(e.authUrl);
|
|
3112
|
+
await Io({ email: y, spaceId: e.spaceId, authUrl: m });
|
|
3197
3113
|
},
|
|
3198
3114
|
[e.authUrl, e.spaceId]
|
|
3199
|
-
), i =
|
|
3115
|
+
), i = j(
|
|
3200
3116
|
async (y, m) => {
|
|
3201
3117
|
r((c) => ({ ...c, isLoading: !0, error: null }));
|
|
3202
3118
|
try {
|
|
3203
|
-
const c = await
|
|
3119
|
+
const c = await ve(e.authUrl), u = await Oo({ email: y, code: m, authUrl: c });
|
|
3204
3120
|
r({
|
|
3205
3121
|
isAuthenticated: !0,
|
|
3206
3122
|
isLoading: !1,
|
|
@@ -3213,19 +3129,19 @@ function ni({ children: t, config: e }) {
|
|
|
3213
3129
|
}
|
|
3214
3130
|
},
|
|
3215
3131
|
[e.authUrl]
|
|
3216
|
-
), a =
|
|
3217
|
-
|
|
3132
|
+
), a = j(() => {
|
|
3133
|
+
Le(), Ut.clearAll(), r({
|
|
3218
3134
|
isAuthenticated: !1,
|
|
3219
3135
|
isLoading: !1,
|
|
3220
3136
|
user: null,
|
|
3221
3137
|
error: null
|
|
3222
3138
|
});
|
|
3223
|
-
}, []), l =
|
|
3139
|
+
}, []), l = j(
|
|
3224
3140
|
async (y) => {
|
|
3225
|
-
const m = await
|
|
3141
|
+
const m = await ve(e.authUrl);
|
|
3226
3142
|
r((c) => ({ ...c, isLoading: !0, error: null }));
|
|
3227
3143
|
try {
|
|
3228
|
-
const c = await
|
|
3144
|
+
const c = await Po(m), u = await Vo({ optionsJSON: c }), g = await Uo(m, u, y);
|
|
3229
3145
|
r({
|
|
3230
3146
|
isAuthenticated: !0,
|
|
3231
3147
|
isLoading: !1,
|
|
@@ -3241,39 +3157,39 @@ function ni({ children: t, config: e }) {
|
|
|
3241
3157
|
}
|
|
3242
3158
|
},
|
|
3243
3159
|
[e.authUrl]
|
|
3244
|
-
),
|
|
3160
|
+
), h = j(() => n.user?.token ?? null, [n.user]), f = W(
|
|
3245
3161
|
() => ({
|
|
3246
3162
|
state: n,
|
|
3247
3163
|
login: o,
|
|
3248
3164
|
logout: a,
|
|
3249
|
-
getToken:
|
|
3165
|
+
getToken: h,
|
|
3250
3166
|
registerPasskey: l,
|
|
3251
3167
|
requestEmailCode: s,
|
|
3252
3168
|
submitEmailCode: i
|
|
3253
3169
|
}),
|
|
3254
|
-
[n, o, a,
|
|
3170
|
+
[n, o, a, h, l, s, i]
|
|
3255
3171
|
);
|
|
3256
|
-
return /* @__PURE__ */ w.jsx(
|
|
3172
|
+
return /* @__PURE__ */ w.jsx(ut, { value: f, children: t });
|
|
3257
3173
|
}
|
|
3258
|
-
function
|
|
3259
|
-
const t =
|
|
3174
|
+
function Go() {
|
|
3175
|
+
const t = st(ut);
|
|
3260
3176
|
if (!t)
|
|
3261
3177
|
throw new Error("useAuth must be used within an AuthProvider");
|
|
3262
3178
|
return t;
|
|
3263
3179
|
}
|
|
3264
|
-
function
|
|
3265
|
-
return
|
|
3180
|
+
function zo() {
|
|
3181
|
+
return st(ut);
|
|
3266
3182
|
}
|
|
3267
|
-
function
|
|
3268
|
-
const { config: e, guestUrlParam: n } = t, { state: r, login: o } =
|
|
3183
|
+
function Os(t) {
|
|
3184
|
+
const { config: e, guestUrlParam: n } = t, { state: r, login: o } = Go(), s = E(!1);
|
|
3269
3185
|
return C(() => {
|
|
3270
3186
|
if (!n || r.isAuthenticated || r.isLoading || s.current || !e.methods.includes("guest"))
|
|
3271
3187
|
return;
|
|
3272
3188
|
const i = new URLSearchParams(window.location.search), a = i.get(n);
|
|
3273
3189
|
if (a === "true" || a === "1" || a === "") {
|
|
3274
3190
|
i.delete(n);
|
|
3275
|
-
const l = i.toString(),
|
|
3276
|
-
window.history.replaceState({}, "",
|
|
3191
|
+
const l = i.toString(), h = window.location.pathname + (l ? `?${l}` : "");
|
|
3192
|
+
window.history.replaceState({}, "", h), s.current = !0, o("guest");
|
|
3277
3193
|
}
|
|
3278
3194
|
}, [n, r.isAuthenticated, r.isLoading, e.methods, o]), {
|
|
3279
3195
|
shouldRenderChildren: r.isAuthenticated,
|
|
@@ -3282,17 +3198,17 @@ function ri(t) {
|
|
|
3282
3198
|
error: r.error
|
|
3283
3199
|
};
|
|
3284
3200
|
}
|
|
3285
|
-
const
|
|
3201
|
+
const on = (() => {
|
|
3286
3202
|
try {
|
|
3287
|
-
return
|
|
3203
|
+
return _n();
|
|
3288
3204
|
} catch {
|
|
3289
3205
|
return !1;
|
|
3290
3206
|
}
|
|
3291
|
-
})(),
|
|
3292
|
-
function
|
|
3293
|
-
re.push(`[+${((Date.now() -
|
|
3207
|
+
})(), sn = Date.now(), re = [], Xo = 300;
|
|
3208
|
+
function Ie(t) {
|
|
3209
|
+
re.push(`[+${((Date.now() - sn) / 1e3).toFixed(1)}s] ${t}`), re.length > Xo && re.shift();
|
|
3294
3210
|
}
|
|
3295
|
-
function
|
|
3211
|
+
function Lt(t) {
|
|
3296
3212
|
if (typeof t == "string")
|
|
3297
3213
|
return t;
|
|
3298
3214
|
if (t instanceof Error)
|
|
@@ -3303,30 +3219,30 @@ function Dt(t) {
|
|
|
3303
3219
|
return String(t);
|
|
3304
3220
|
}
|
|
3305
3221
|
}
|
|
3306
|
-
let
|
|
3307
|
-
function
|
|
3308
|
-
if (
|
|
3222
|
+
let Pt = !1;
|
|
3223
|
+
function an() {
|
|
3224
|
+
if (Pt || typeof window > "u")
|
|
3309
3225
|
return;
|
|
3310
|
-
|
|
3226
|
+
Pt = !0, window.addEventListener("error", (e) => Ie(`window.error: ${e.message} @ ${e.filename ?? "?"}:${e.lineno ?? "?"}:${e.colno ?? "?"}`)), window.addEventListener("unhandledrejection", (e) => Ie(`unhandledRejection: ${Lt(e.reason)}`));
|
|
3311
3227
|
const t = console;
|
|
3312
3228
|
for (const e of ["error", "warn", "log", "info"]) {
|
|
3313
3229
|
const n = t[e]?.bind(console) ?? (() => {
|
|
3314
3230
|
});
|
|
3315
3231
|
t[e] = (...r) => {
|
|
3316
3232
|
try {
|
|
3317
|
-
|
|
3233
|
+
Ie(`console.${e}: ${r.map(Lt).join(" ")}`);
|
|
3318
3234
|
} catch {
|
|
3319
3235
|
}
|
|
3320
3236
|
n(...r);
|
|
3321
3237
|
};
|
|
3322
3238
|
}
|
|
3323
3239
|
try {
|
|
3324
|
-
|
|
3240
|
+
jt((e) => Ie(`${e.levelName} [${e.component}] ${e.message}`), { minLevel: Je.DEBUG });
|
|
3325
3241
|
} catch {
|
|
3326
3242
|
}
|
|
3327
3243
|
}
|
|
3328
|
-
|
|
3329
|
-
function
|
|
3244
|
+
on && an();
|
|
3245
|
+
function Ho() {
|
|
3330
3246
|
let t = !1;
|
|
3331
3247
|
try {
|
|
3332
3248
|
const e = URL.createObjectURL(new Blob([""]));
|
|
@@ -3337,11 +3253,11 @@ function Ss() {
|
|
|
3337
3253
|
}
|
|
3338
3254
|
return t;
|
|
3339
3255
|
}
|
|
3340
|
-
function
|
|
3256
|
+
function qo() {
|
|
3341
3257
|
const t = globalThis;
|
|
3342
3258
|
return [
|
|
3343
3259
|
`Worker=${typeof Worker < "u"}`,
|
|
3344
|
-
`moduleWorker=${
|
|
3260
|
+
`moduleWorker=${Ho()}`,
|
|
3345
3261
|
`WebSocket=${typeof WebSocket < "u"}`,
|
|
3346
3262
|
`WebTransport=${typeof t.WebTransport < "u"}`,
|
|
3347
3263
|
`RTCPeerConnection=${typeof RTCPeerConnection < "u"}`,
|
|
@@ -3354,15 +3270,15 @@ function ws() {
|
|
|
3354
3270
|
`online=${typeof navigator < "u" ? navigator.onLine : "?"}`
|
|
3355
3271
|
].join(" ");
|
|
3356
3272
|
}
|
|
3357
|
-
function
|
|
3273
|
+
function Jo(t) {
|
|
3358
3274
|
return /ERROR|error:|Rejection/.test(t) ? "#f88" : /WARN|warn:/.test(t) ? "#fc6" : "#9d9";
|
|
3359
3275
|
}
|
|
3360
|
-
function
|
|
3361
|
-
const n =
|
|
3276
|
+
function cn({ state: t = "", forceVisible: e = !1 }) {
|
|
3277
|
+
const n = on || e, r = t === "connected" || t === "reconnecting", [, o] = An((l) => l + 1, 0), [s, i] = x(!0);
|
|
3362
3278
|
if (C(() => {
|
|
3363
3279
|
if (!n)
|
|
3364
3280
|
return;
|
|
3365
|
-
|
|
3281
|
+
an();
|
|
3366
3282
|
const l = setInterval(o, 1e3);
|
|
3367
3283
|
return () => clearInterval(l);
|
|
3368
3284
|
}, [n]), !n)
|
|
@@ -3387,7 +3303,7 @@ function pn({ state: t = "", forceVisible: e = !1 }) {
|
|
|
3387
3303
|
"Ikon debug overlay — state: ",
|
|
3388
3304
|
t || "?",
|
|
3389
3305
|
", +",
|
|
3390
|
-
Math.round((Date.now() -
|
|
3306
|
+
Math.round((Date.now() - sn) / 1e3),
|
|
3391
3307
|
"s, ",
|
|
3392
3308
|
re.length,
|
|
3393
3309
|
" entries",
|
|
@@ -3395,12 +3311,12 @@ function pn({ state: t = "", forceVisible: e = !1 }) {
|
|
|
3395
3311
|
] }),
|
|
3396
3312
|
/* @__PURE__ */ w.jsx("div", { style: { color: "#9cf", wordBreak: "break-all", marginBottom: "4px" }, children: typeof window < "u" ? window.location.href : "" }),
|
|
3397
3313
|
/* @__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:
|
|
3314
|
+
/* @__PURE__ */ w.jsx("div", { style: { color: "#8cf", marginBottom: "4px" }, children: qo() }),
|
|
3399
3315
|
/* @__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,
|
|
3316
|
+
/* @__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
3317
|
] });
|
|
3402
3318
|
}
|
|
3403
|
-
function
|
|
3319
|
+
function xs({
|
|
3404
3320
|
connectionState: t,
|
|
3405
3321
|
error: e,
|
|
3406
3322
|
isReady: n,
|
|
@@ -3412,8 +3328,8 @@ function oi({
|
|
|
3412
3328
|
// renderIdle prop is intentionally accepted but never invoked — the runtime no longer
|
|
3413
3329
|
// emits the deprecated 'idle' state. Kept on the props for source compatibility.
|
|
3414
3330
|
renderIdle: l,
|
|
3415
|
-
renderConnecting:
|
|
3416
|
-
renderConnectingSlow:
|
|
3331
|
+
renderConnecting: h,
|
|
3332
|
+
renderConnectingSlow: f,
|
|
3417
3333
|
renderConnected: y,
|
|
3418
3334
|
renderOffline: m,
|
|
3419
3335
|
renderError: c
|
|
@@ -3422,7 +3338,7 @@ function oi({
|
|
|
3422
3338
|
switch (t) {
|
|
3423
3339
|
case "waitingForExternalConnectUrl":
|
|
3424
3340
|
case "connecting":
|
|
3425
|
-
return r ?
|
|
3341
|
+
return r ? f() : h();
|
|
3426
3342
|
case "connected":
|
|
3427
3343
|
case "reconnecting": {
|
|
3428
3344
|
if (!n || !o || !s) return null;
|
|
@@ -3449,51 +3365,51 @@ function oi({
|
|
|
3449
3365
|
})();
|
|
3450
3366
|
return /* @__PURE__ */ w.jsxs(w.Fragment, { children: [
|
|
3451
3367
|
g,
|
|
3452
|
-
/* @__PURE__ */ w.jsx(
|
|
3368
|
+
/* @__PURE__ */ w.jsx(cn, { state: t })
|
|
3453
3369
|
] });
|
|
3454
3370
|
}
|
|
3455
|
-
const
|
|
3456
|
-
function
|
|
3371
|
+
const Oe = oe("useIkonApp");
|
|
3372
|
+
function Zo() {
|
|
3457
3373
|
if (typeof window < "u" && window.__IKON_AUTH_CONFIG__)
|
|
3458
3374
|
return window.__IKON_AUTH_CONFIG__;
|
|
3459
3375
|
}
|
|
3460
|
-
function
|
|
3376
|
+
function Qo() {
|
|
3461
3377
|
if (typeof window < "u" && window.__IKON_LOCAL_IKON_SERVER_CONFIG__)
|
|
3462
3378
|
return window.__IKON_LOCAL_IKON_SERVER_CONFIG__;
|
|
3463
3379
|
}
|
|
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,
|
|
3467
|
-
const [H,
|
|
3380
|
+
function Ns(t) {
|
|
3381
|
+
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), I = E(l), P = E(h), M = E(f), B = E(y), $ = E(m), V = E("local"), K = E(void 0);
|
|
3382
|
+
T.current = o, U.current = r, ee.current = s, te.current = i, z.current = a, I.current = l, P.current = h, M.current = f, B.current = y, $.current = m;
|
|
3383
|
+
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
3384
|
try {
|
|
3469
|
-
const
|
|
3470
|
-
return (
|
|
3385
|
+
const _ = In();
|
|
3386
|
+
return (_.sessionId || _.channelKey) && On(), _;
|
|
3471
3387
|
} catch {
|
|
3472
3388
|
return { parameters: {} };
|
|
3473
3389
|
}
|
|
3474
3390
|
}, []);
|
|
3475
|
-
m !== !1 &&
|
|
3476
|
-
const ce = W(() => c?.enabled ?
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
}).catch((
|
|
3480
|
-
|
|
3391
|
+
m !== !1 && vn();
|
|
3392
|
+
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);
|
|
3393
|
+
Fe && !ae && !De && !je.current && (je.current = !0, ve(c.authUrl).then((_) => Qt(c.spaceId, _)).then((_) => {
|
|
3394
|
+
un(_.token), dt(!0);
|
|
3395
|
+
}).catch((_) => {
|
|
3396
|
+
Oe.error("Anonymous auth failed:", _), je.current = !1, Ae ? dt(!0) : N(_ instanceof Error ? _.message : "Anonymous auth failed");
|
|
3481
3397
|
}));
|
|
3482
|
-
const
|
|
3483
|
-
if (
|
|
3484
|
-
if (
|
|
3398
|
+
const Ve = W(() => {
|
|
3399
|
+
if (Ae) {
|
|
3400
|
+
if (Fe && !De)
|
|
3485
3401
|
return null;
|
|
3486
|
-
const
|
|
3402
|
+
const _ = ce?.token ?? ae ?? void 0, q = _ ? pt(_) ?? void 0 : void 0;
|
|
3487
3403
|
return {
|
|
3488
3404
|
local: {
|
|
3489
|
-
host:
|
|
3490
|
-
httpsPort:
|
|
3405
|
+
host: $e,
|
|
3406
|
+
httpsPort: Be,
|
|
3491
3407
|
userId: q,
|
|
3492
3408
|
token: ce?.token ?? void 0,
|
|
3493
3409
|
spaceId: c?.spaceId,
|
|
3494
3410
|
backendUrl: c?.backendUrl,
|
|
3495
3411
|
authUrl: c?.authUrl,
|
|
3496
|
-
parameters:
|
|
3412
|
+
parameters: Y.parameters
|
|
3497
3413
|
}
|
|
3498
3414
|
};
|
|
3499
3415
|
}
|
|
@@ -3501,46 +3417,46 @@ function si(t) {
|
|
|
3501
3417
|
sessionToken: {
|
|
3502
3418
|
token: ce.token,
|
|
3503
3419
|
spaceId: c.spaceId,
|
|
3504
|
-
backendType:
|
|
3505
|
-
sessionId:
|
|
3506
|
-
channelKey:
|
|
3507
|
-
parameters:
|
|
3420
|
+
backendType: mt(),
|
|
3421
|
+
sessionId: Y.sessionId,
|
|
3422
|
+
channelKey: Y.channelKey,
|
|
3423
|
+
parameters: Y.parameters
|
|
3508
3424
|
}
|
|
3509
3425
|
} : ae && c?.spaceId ? {
|
|
3510
3426
|
sessionToken: {
|
|
3511
3427
|
token: ae,
|
|
3512
3428
|
spaceId: c.spaceId,
|
|
3513
|
-
backendType:
|
|
3514
|
-
sessionId:
|
|
3515
|
-
channelKey:
|
|
3516
|
-
parameters:
|
|
3429
|
+
backendType: mt(),
|
|
3430
|
+
sessionId: Y.sessionId,
|
|
3431
|
+
channelKey: Y.channelKey,
|
|
3432
|
+
parameters: Y.parameters
|
|
3517
3433
|
}
|
|
3518
|
-
} :
|
|
3434
|
+
} : ht() ? null : {
|
|
3519
3435
|
local: {
|
|
3520
|
-
host:
|
|
3521
|
-
httpsPort:
|
|
3436
|
+
host: $e,
|
|
3437
|
+
httpsPort: Be,
|
|
3522
3438
|
spaceId: c?.spaceId,
|
|
3523
3439
|
backendUrl: c?.backendUrl,
|
|
3524
3440
|
authUrl: c?.authUrl,
|
|
3525
|
-
parameters:
|
|
3441
|
+
parameters: Y.parameters
|
|
3526
3442
|
}
|
|
3527
3443
|
};
|
|
3528
|
-
}, [
|
|
3529
|
-
V.current = c?.spaceId ?? "local", K.current = ce?.token ?? ae ?? void 0,
|
|
3530
|
-
const
|
|
3444
|
+
}, [Ae, $e, Be, ce?.token, c?.spaceId, c?.backendUrl, c?.authUrl, ae, Fe, De, Y.sessionId, Y.channelKey, Y.parameters]);
|
|
3445
|
+
V.current = c?.spaceId ?? "local", K.current = ce?.token ?? ae ?? void 0, Qr(ie);
|
|
3446
|
+
const hn = to(ie);
|
|
3531
3447
|
C(() => {
|
|
3532
3448
|
if (!R.current) {
|
|
3533
|
-
if (R.current = !0, S.current =
|
|
3534
|
-
for (const
|
|
3535
|
-
|
|
3536
|
-
S.current.loadRegisteredModules().catch((
|
|
3537
|
-
|
|
3449
|
+
if (R.current = !0, S.current = Yr(), n)
|
|
3450
|
+
for (const _ of n)
|
|
3451
|
+
_(S.current);
|
|
3452
|
+
S.current.loadRegisteredModules().catch((_) => {
|
|
3453
|
+
Oe.error("Failed to load UI modules", _);
|
|
3538
3454
|
});
|
|
3539
3455
|
}
|
|
3540
3456
|
}, []), C(() => {
|
|
3541
|
-
if (!
|
|
3542
|
-
const
|
|
3543
|
-
...
|
|
3457
|
+
if (!Ve) return;
|
|
3458
|
+
const _ = new xn({
|
|
3459
|
+
...Ve,
|
|
3544
3460
|
timeouts: U.current,
|
|
3545
3461
|
audio: te.current !== void 0 || T.current ? {
|
|
3546
3462
|
enabled: te.current,
|
|
@@ -3549,104 +3465,104 @@ function si(t) {
|
|
|
3549
3465
|
video: z.current !== void 0 ? { enabled: z.current } : void 0,
|
|
3550
3466
|
mediaSession: { title: document.title || void 0, artist: document.title || void 0 },
|
|
3551
3467
|
webRtc: ee.current === !1 ? { enabled: !1 } : void 0,
|
|
3552
|
-
websocket:
|
|
3468
|
+
websocket: I.current,
|
|
3553
3469
|
webtransport: P.current,
|
|
3554
3470
|
proxy: M.current,
|
|
3555
3471
|
onConnectionStateChange: (J) => {
|
|
3556
|
-
|
|
3472
|
+
Ee(J);
|
|
3557
3473
|
},
|
|
3558
3474
|
onError: (J) => {
|
|
3559
|
-
|
|
3475
|
+
N(J.message);
|
|
3560
3476
|
}
|
|
3561
3477
|
});
|
|
3562
|
-
p.current =
|
|
3563
|
-
const q = B.current ?? !0,
|
|
3564
|
-
b.current =
|
|
3565
|
-
const
|
|
3478
|
+
p.current = _;
|
|
3479
|
+
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: _, liveSnapshot: gn, bootSnapshot: $.current });
|
|
3480
|
+
b.current = ke, Me(ke), A(!1);
|
|
3481
|
+
const yn = ke.subscribeToUiUpdates(() => {
|
|
3566
3482
|
A(!0);
|
|
3567
3483
|
});
|
|
3568
|
-
return
|
|
3569
|
-
if (
|
|
3484
|
+
return _.connect().catch((J) => {
|
|
3485
|
+
if (Oe.error("Connection failed:", J), J instanceof Nn) {
|
|
3570
3486
|
me(J.reason);
|
|
3571
3487
|
return;
|
|
3572
3488
|
}
|
|
3573
|
-
if (J instanceof
|
|
3489
|
+
if (J instanceof Ln) {
|
|
3574
3490
|
Q(!0);
|
|
3575
3491
|
return;
|
|
3576
3492
|
}
|
|
3577
|
-
J instanceof
|
|
3493
|
+
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
3494
|
}), () => {
|
|
3579
|
-
|
|
3495
|
+
yn(), _.disconnect(), p.current = null, ke.dispose(), b.current = null;
|
|
3580
3496
|
};
|
|
3581
|
-
}, [
|
|
3582
|
-
const
|
|
3583
|
-
const
|
|
3584
|
-
p.current?.sendActionCall(
|
|
3497
|
+
}, [Ve]);
|
|
3498
|
+
const pn = j((_, q) => {
|
|
3499
|
+
const Te = typeof q == "string" ? q : JSON.stringify(q ?? {});
|
|
3500
|
+
p.current?.sendActionCall(_, Te);
|
|
3585
3501
|
}, []);
|
|
3586
3502
|
C(() => {
|
|
3587
3503
|
if (H !== "connecting") {
|
|
3588
3504
|
pe(!1);
|
|
3589
3505
|
return;
|
|
3590
3506
|
}
|
|
3591
|
-
const
|
|
3507
|
+
const _ = p.current?.slowConnectionThresholdMs ?? 5e3, q = setTimeout(() => pe(!0), _);
|
|
3592
3508
|
return () => clearTimeout(q);
|
|
3593
3509
|
}, [H]);
|
|
3594
|
-
const
|
|
3510
|
+
const mn = H === "connected" || H === "reconnecting", We = d && H !== "offline";
|
|
3595
3511
|
return C(() => {
|
|
3596
|
-
typeof document > "u" || (document.documentElement.dataset.ikonLive = String(
|
|
3597
|
-
}, [
|
|
3512
|
+
typeof document > "u" || (document.documentElement.dataset.ikonLive = String(We));
|
|
3513
|
+
}, [We]), {
|
|
3598
3514
|
connectionState: H,
|
|
3599
3515
|
error: O,
|
|
3600
3516
|
accessDeniedReason: se,
|
|
3601
3517
|
isServerFull: L,
|
|
3602
|
-
stores:
|
|
3518
|
+
stores: hn,
|
|
3603
3519
|
client: p.current,
|
|
3604
3520
|
registry: S.current,
|
|
3605
3521
|
clientRef: p,
|
|
3606
3522
|
uiRef: b,
|
|
3607
3523
|
registryRef: S,
|
|
3608
|
-
onAction:
|
|
3609
|
-
isReady:
|
|
3610
|
-
isLive:
|
|
3524
|
+
onAction: pn,
|
|
3525
|
+
isReady: mn,
|
|
3526
|
+
isLive: We,
|
|
3611
3527
|
brandingRequired: p.current?.brandingRequired ?? !1,
|
|
3612
|
-
isConnectingSlow:
|
|
3528
|
+
isConnectingSlow: Re,
|
|
3613
3529
|
webRtcVideoStreams: p.current?.webRtcVideoStreams ?? /* @__PURE__ */ new Map(),
|
|
3614
3530
|
webRtcTrackMap: p.current?.webRtcTrackMap ?? /* @__PURE__ */ new Map()
|
|
3615
3531
|
};
|
|
3616
3532
|
}
|
|
3617
|
-
function
|
|
3533
|
+
function Ls(t) {
|
|
3618
3534
|
const e = E(!1);
|
|
3619
|
-
return
|
|
3535
|
+
return j(() => {
|
|
3620
3536
|
if (e.current) return;
|
|
3621
3537
|
e.current = !0;
|
|
3622
3538
|
const n = document.createElement("link");
|
|
3623
3539
|
n.rel = "stylesheet", n.href = t, document.head.appendChild(n);
|
|
3624
3540
|
}, [t]);
|
|
3625
3541
|
}
|
|
3626
|
-
let
|
|
3627
|
-
function
|
|
3628
|
-
const [n, r] =
|
|
3542
|
+
let es = 0;
|
|
3543
|
+
function ts(t = 5, e = 5e3) {
|
|
3544
|
+
const [n, r] = x([]), o = E(/* @__PURE__ */ new Map()), s = j((i) => {
|
|
3629
3545
|
const a = o.current.get(i);
|
|
3630
|
-
a && (clearTimeout(a), o.current.delete(i)), r((l) => l.filter((
|
|
3546
|
+
a && (clearTimeout(a), o.current.delete(i)), r((l) => l.filter((h) => h.id !== i));
|
|
3631
3547
|
}, []);
|
|
3632
3548
|
return C(() => {
|
|
3633
|
-
const i = o.current, a =
|
|
3549
|
+
const i = o.current, a = jt(
|
|
3634
3550
|
(l) => {
|
|
3635
|
-
if (
|
|
3551
|
+
if (!$t())
|
|
3636
3552
|
return;
|
|
3637
|
-
const
|
|
3638
|
-
id:
|
|
3639
|
-
level:
|
|
3553
|
+
const h = `toast-${++es}`, f = l.level === Je.ERROR ? "error" : "warn", y = {
|
|
3554
|
+
id: h,
|
|
3555
|
+
level: f,
|
|
3640
3556
|
message: l.message,
|
|
3641
3557
|
component: l.component
|
|
3642
3558
|
};
|
|
3643
3559
|
r((c) => [...c, y].slice(-t));
|
|
3644
3560
|
const m = setTimeout(() => {
|
|
3645
|
-
s(
|
|
3561
|
+
s(h);
|
|
3646
3562
|
}, e);
|
|
3647
|
-
i.set(
|
|
3563
|
+
i.set(h, m);
|
|
3648
3564
|
},
|
|
3649
|
-
{ minLevel:
|
|
3565
|
+
{ minLevel: Je.WARN }
|
|
3650
3566
|
);
|
|
3651
3567
|
return () => {
|
|
3652
3568
|
a();
|
|
@@ -3656,8 +3572,8 @@ function Ts(t = 5, e = 5e3) {
|
|
|
3656
3572
|
};
|
|
3657
3573
|
}, [t, e, s]), { toasts: n, dismissToast: s };
|
|
3658
3574
|
}
|
|
3659
|
-
function
|
|
3660
|
-
const [r, o] =
|
|
3575
|
+
function ns(t, e, n) {
|
|
3576
|
+
const [r, o] = x(n);
|
|
3661
3577
|
return C(() => {
|
|
3662
3578
|
if (!t)
|
|
3663
3579
|
return;
|
|
@@ -3673,8 +3589,8 @@ function ks(t, e, n) {
|
|
|
3673
3589
|
};
|
|
3674
3590
|
}, [t, e]), r;
|
|
3675
3591
|
}
|
|
3676
|
-
function
|
|
3677
|
-
const [r, o] =
|
|
3592
|
+
function Ps(t, e, n) {
|
|
3593
|
+
const [r, o] = x(null);
|
|
3678
3594
|
return C(() => {
|
|
3679
3595
|
if (!t)
|
|
3680
3596
|
return;
|
|
@@ -3686,18 +3602,18 @@ function ai(t, e, n) {
|
|
|
3686
3602
|
}), () => {
|
|
3687
3603
|
s = !1;
|
|
3688
3604
|
};
|
|
3689
|
-
}, [t, e]),
|
|
3605
|
+
}, [t, e]), ns(r ? t : null, r ?? "", n);
|
|
3690
3606
|
}
|
|
3691
|
-
const ue = oe("IkonDebug"),
|
|
3607
|
+
const ue = oe("IkonDebug"), rs = {
|
|
3692
3608
|
Digit1: "connecting",
|
|
3693
3609
|
Digit2: "connected",
|
|
3694
3610
|
Digit3: "reconnecting",
|
|
3695
3611
|
Digit4: "offline",
|
|
3696
3612
|
Digit5: "offline",
|
|
3697
3613
|
Digit0: "clear"
|
|
3698
|
-
},
|
|
3699
|
-
function
|
|
3700
|
-
const e =
|
|
3614
|
+
}, os = "Digit5", ss = "Digit6", is = "Synthetic debug error (Ctrl+Shift+5)", as = "Synthetic debug access-denied (Ctrl+Shift+6)", cs = 5e3;
|
|
3615
|
+
function ls(t) {
|
|
3616
|
+
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
3617
|
return C(() => {
|
|
3702
3618
|
if (!e)
|
|
3703
3619
|
return;
|
|
@@ -3716,19 +3632,19 @@ function Ls(t) {
|
|
|
3716
3632
|
S.preventDefault(), g((T) => (ue.warn(`Debug-overlay override: ${T ? "off" : "on"}`), !T));
|
|
3717
3633
|
return;
|
|
3718
3634
|
}
|
|
3719
|
-
if (S.code ===
|
|
3720
|
-
S.preventDefault(),
|
|
3635
|
+
if (S.code === ss) {
|
|
3636
|
+
S.preventDefault(), h(as), r(null), a(null), ue.warn("Forced access denied");
|
|
3721
3637
|
return;
|
|
3722
3638
|
}
|
|
3723
|
-
const R =
|
|
3639
|
+
const R = rs[S.code];
|
|
3724
3640
|
if (R === void 0)
|
|
3725
3641
|
return;
|
|
3726
3642
|
if (S.preventDefault(), R === "clear") {
|
|
3727
|
-
r(null), a(null),
|
|
3643
|
+
r(null), a(null), h(null), ue.warn("Cleared forced state");
|
|
3728
3644
|
return;
|
|
3729
3645
|
}
|
|
3730
|
-
const v = S.code ===
|
|
3731
|
-
r(R), a(v ?
|
|
3646
|
+
const v = S.code === os;
|
|
3647
|
+
r(R), a(v ? is : null), h(null), ue.warn(`Forced state: ${R}${v ? " (with error)" : ""}`);
|
|
3732
3648
|
};
|
|
3733
3649
|
return window.addEventListener("keydown", b), () => window.removeEventListener("keydown", b);
|
|
3734
3650
|
}, [e]), C(() => {
|
|
@@ -3736,52 +3652,52 @@ function Ls(t) {
|
|
|
3736
3652
|
s(!1);
|
|
3737
3653
|
return;
|
|
3738
3654
|
}
|
|
3739
|
-
const b = setTimeout(() => s(!0),
|
|
3655
|
+
const b = setTimeout(() => s(!0), cs);
|
|
3740
3656
|
return () => clearTimeout(b);
|
|
3741
|
-
}, [n]), !e || n === null && !
|
|
3657
|
+
}, [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
3658
|
...t,
|
|
3743
3659
|
connectionState: n ?? t.connectionState,
|
|
3744
3660
|
isConnectingSlow: n === "connecting" ? o : t.isConnectingSlow,
|
|
3745
3661
|
error: n === "offline" && i ? i : n ? null : t.error,
|
|
3746
|
-
stores:
|
|
3662
|
+
stores: f ? /* @__PURE__ */ new Map() : t.stores,
|
|
3747
3663
|
accessDeniedReason: l ?? t.accessDeniedReason
|
|
3748
|
-
}, forcedState: n, emptyStores:
|
|
3664
|
+
}, forcedState: n, emptyStores: f, forcedError: i, forcedAccessDenied: l, forcedBranding: m, forcedDebugOverlay: u, debugEnabled: e };
|
|
3749
3665
|
}
|
|
3750
|
-
function
|
|
3666
|
+
function us(t, e) {
|
|
3751
3667
|
return t === void 0 ? null : typeof t == "function" ? t(e) : t;
|
|
3752
3668
|
}
|
|
3753
|
-
function
|
|
3669
|
+
function ds(t) {
|
|
3754
3670
|
return t === void 0 ? null : typeof t == "function" ? t() : t;
|
|
3755
3671
|
}
|
|
3756
|
-
function
|
|
3672
|
+
function fs(t, e) {
|
|
3757
3673
|
return t === void 0 ? null : typeof t == "function" ? t(e) : t;
|
|
3758
3674
|
}
|
|
3759
|
-
function
|
|
3675
|
+
function hs(t, e) {
|
|
3760
3676
|
return t === void 0 ? null : typeof t == "function" ? t(e) : t;
|
|
3761
3677
|
}
|
|
3762
|
-
function
|
|
3763
|
-
const { connectingOverlay: e, reconnectingOverlay: n, offlineOverlay: r, accessDeniedScreen: o, ...s } = t, i =
|
|
3764
|
-
if (
|
|
3765
|
-
return
|
|
3678
|
+
function Us(t) {
|
|
3679
|
+
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);
|
|
3680
|
+
if (f && y && (u || f.size > 0) && (R.current = { stores: f, registry: y, client: m }), p)
|
|
3681
|
+
return hs(o, p);
|
|
3766
3682
|
const v = R.current;
|
|
3767
3683
|
let T = null;
|
|
3768
3684
|
switch (l) {
|
|
3769
3685
|
case "waitingForExternalConnectUrl":
|
|
3770
3686
|
case "connecting":
|
|
3771
|
-
T =
|
|
3687
|
+
T = us(e, h);
|
|
3772
3688
|
break;
|
|
3773
3689
|
case "reconnecting":
|
|
3774
|
-
T =
|
|
3690
|
+
T = ds(n);
|
|
3775
3691
|
break;
|
|
3776
3692
|
case "offline":
|
|
3777
|
-
T =
|
|
3693
|
+
T = fs(r, g);
|
|
3778
3694
|
break;
|
|
3779
3695
|
default:
|
|
3780
3696
|
T = null;
|
|
3781
3697
|
}
|
|
3782
3698
|
return /* @__PURE__ */ w.jsxs(w.Fragment, { children: [
|
|
3783
3699
|
v && /* @__PURE__ */ w.jsx(
|
|
3784
|
-
|
|
3700
|
+
Bt,
|
|
3785
3701
|
{
|
|
3786
3702
|
stores: v.stores,
|
|
3787
3703
|
registry: v.registry,
|
|
@@ -3790,18 +3706,18 @@ function ci(t) {
|
|
|
3790
3706
|
}
|
|
3791
3707
|
),
|
|
3792
3708
|
T,
|
|
3793
|
-
S && /* @__PURE__ */ w.jsx(
|
|
3794
|
-
/* @__PURE__ */ w.jsx(
|
|
3795
|
-
/* @__PURE__ */ w.jsx(
|
|
3709
|
+
S && /* @__PURE__ */ w.jsx(ms, {}),
|
|
3710
|
+
/* @__PURE__ */ w.jsx(gs, {}),
|
|
3711
|
+
/* @__PURE__ */ w.jsx(cn, { state: l, forceVisible: i.forcedDebugOverlay })
|
|
3796
3712
|
] });
|
|
3797
3713
|
}
|
|
3798
|
-
const
|
|
3799
|
-
function
|
|
3714
|
+
const ps = "https://ikonai.com";
|
|
3715
|
+
function ms() {
|
|
3800
3716
|
return /* @__PURE__ */ w.jsxs(
|
|
3801
3717
|
"a",
|
|
3802
3718
|
{
|
|
3803
3719
|
className: "ikon-branding-banner",
|
|
3804
|
-
href:
|
|
3720
|
+
href: ps,
|
|
3805
3721
|
target: "_blank",
|
|
3806
3722
|
rel: "noopener noreferrer",
|
|
3807
3723
|
style: {
|
|
@@ -3829,11 +3745,11 @@ function $s() {
|
|
|
3829
3745
|
}
|
|
3830
3746
|
);
|
|
3831
3747
|
}
|
|
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(
|
|
3748
|
+
function gs() {
|
|
3749
|
+
const { toasts: t, dismissToast: e } = ts();
|
|
3750
|
+
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
3751
|
}
|
|
3836
|
-
function
|
|
3752
|
+
function ys({ toast: t, onDismiss: e }) {
|
|
3837
3753
|
return /* @__PURE__ */ w.jsxs(
|
|
3838
3754
|
"div",
|
|
3839
3755
|
{
|
|
@@ -3854,110 +3770,105 @@ function Fs({ toast: t, onDismiss: e }) {
|
|
|
3854
3770
|
}
|
|
3855
3771
|
);
|
|
3856
3772
|
}
|
|
3857
|
-
const
|
|
3858
|
-
function
|
|
3773
|
+
const ln = Mt(null);
|
|
3774
|
+
function bs(t, e) {
|
|
3859
3775
|
return e ? t.replace(/\{(\w+)\}/g, (n, r) => e[r] ?? `{${r}}`) : t;
|
|
3860
3776
|
}
|
|
3861
|
-
function
|
|
3862
|
-
const n =
|
|
3777
|
+
function Ss(t, e) {
|
|
3778
|
+
const n = Un();
|
|
3863
3779
|
if (n && t.includes(n))
|
|
3864
3780
|
return n;
|
|
3865
3781
|
const r = navigator.language.split("-")[0];
|
|
3866
3782
|
return t.includes(r) ? r : e && t.includes(e) ? e : "en";
|
|
3867
3783
|
}
|
|
3868
|
-
function
|
|
3869
|
-
return e ?
|
|
3784
|
+
function ws(t, e, n) {
|
|
3785
|
+
return e ? Ss(t, n) : n && t.includes(n) ? n : "en";
|
|
3870
3786
|
}
|
|
3871
|
-
function
|
|
3787
|
+
function Ms({
|
|
3872
3788
|
children: t,
|
|
3873
3789
|
translations: e,
|
|
3874
3790
|
defaultLanguage: n,
|
|
3875
3791
|
detectLanguage: r = !1
|
|
3876
3792
|
}) {
|
|
3877
|
-
const o = Object.keys(e), s =
|
|
3793
|
+
const o = Object.keys(e), s = ws(o, r, n), i = e[s] ?? e.en, a = W(
|
|
3878
3794
|
() => ({
|
|
3879
|
-
t: (l,
|
|
3880
|
-
const
|
|
3881
|
-
return
|
|
3795
|
+
t: (l, h) => {
|
|
3796
|
+
const f = i[l];
|
|
3797
|
+
return bs(f, h);
|
|
3882
3798
|
},
|
|
3883
3799
|
locale: s,
|
|
3884
3800
|
translations: i
|
|
3885
3801
|
}),
|
|
3886
3802
|
[i, s]
|
|
3887
3803
|
);
|
|
3888
|
-
return /* @__PURE__ */ w.jsx(
|
|
3804
|
+
return /* @__PURE__ */ w.jsx(ln, { value: a, children: t });
|
|
3889
3805
|
}
|
|
3890
|
-
function
|
|
3891
|
-
const t =
|
|
3806
|
+
function Ds() {
|
|
3807
|
+
const t = st(ln);
|
|
3892
3808
|
if (!t)
|
|
3893
3809
|
throw new Error("useI18n must be used within an I18nProvider");
|
|
3894
3810
|
return t;
|
|
3895
3811
|
}
|
|
3896
3812
|
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,
|
|
3813
|
+
Is as AuthProvider,
|
|
3814
|
+
xs as ConnectionStateRenderer,
|
|
3815
|
+
on as DEBUG_OVERLAY_ENABLED,
|
|
3816
|
+
cn as DebugOverlay,
|
|
3817
|
+
Ms as I18nProvider,
|
|
3818
|
+
hr as IKON_UI_BASE_MODULE,
|
|
3819
|
+
Tr as IKON_UI_MEDIA_MODULE,
|
|
3820
|
+
Fr as IKON_UI_SHADERTOY_MODULE,
|
|
3821
|
+
$r as IKON_UI_SHADERTOY_TYPE,
|
|
3822
|
+
Qe as IKON_UI_STREAM_CATEGORY,
|
|
3823
|
+
wr as IKON_UI_VIDEO_CANVAS_TYPE,
|
|
3824
|
+
vr as IKON_UI_VIDEO_URL_PLAYER_TYPE,
|
|
3825
|
+
Us as IkonApp,
|
|
3826
|
+
Qn as IkonUi,
|
|
3827
|
+
Kr as IkonUiRegistry,
|
|
3828
|
+
Bt as IkonUiSurface,
|
|
3829
|
+
qn as InspectOverlay,
|
|
3830
|
+
Cs as ParallaxView,
|
|
3831
|
+
Hn as UiComponentRegistry,
|
|
3832
|
+
Xn as UiRenderer,
|
|
3833
|
+
Bs as UiStreamStore,
|
|
3834
|
+
Qt as authenticateAnonymous,
|
|
3835
|
+
Lo as buildOAuthRedirectUrl,
|
|
3836
|
+
Le as clearAuthSession,
|
|
3837
|
+
Nt as clearOAuthParams,
|
|
3838
|
+
fr as createBaseResolvers,
|
|
3839
|
+
Ts as createComponentLibrary,
|
|
3840
|
+
Yr as createIkonUiRegistry,
|
|
3841
|
+
Rr as createMediaResolvers,
|
|
3842
|
+
Br as createShadertoyRendererResolver,
|
|
3843
|
+
Zn as isIkonUiCategoryMatch,
|
|
3844
|
+
Jt as loadAuthSession,
|
|
3845
|
+
pr as loadBaseModule,
|
|
3846
|
+
kr as loadMediaModule,
|
|
3847
|
+
Vr as loadShadertoyModule,
|
|
3848
|
+
xo as parseOAuthCallback,
|
|
3849
|
+
No as parseOAuthError,
|
|
3850
|
+
Vs as randomUuid,
|
|
3851
|
+
mr as registerBaseModule,
|
|
3852
|
+
Cr as registerMediaModule,
|
|
3853
|
+
Wr as registerShadertoyModule,
|
|
3854
|
+
Gn as renderChildren,
|
|
3855
|
+
_s as renderMotionLetters,
|
|
3945
3856
|
he as saveAuthSession,
|
|
3946
|
-
|
|
3857
|
+
Io as sendLoginCode,
|
|
3947
3858
|
ne as sessionToUser,
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3859
|
+
Go as useAuth,
|
|
3860
|
+
Os as useAuthGuard,
|
|
3861
|
+
zo as useAuthOptional,
|
|
3862
|
+
Ds as useI18n,
|
|
3863
|
+
Ns as useIkonApp,
|
|
3864
|
+
ls as useIkonDebug,
|
|
3865
|
+
ns as useIkonReactive,
|
|
3866
|
+
Qr as useIkonStyles,
|
|
3867
|
+
to as useIkonUiStores,
|
|
3868
|
+
Ls as useLazyFont,
|
|
3869
|
+
Ps as useReactive,
|
|
3870
|
+
ts as useToasts,
|
|
3960
3871
|
Z as useUiNode,
|
|
3961
|
-
|
|
3962
|
-
|
|
3872
|
+
ks as useUiStore,
|
|
3873
|
+
Oo as verifyLoginCode
|
|
3963
3874
|
};
|