@ikonai/sdk-react-ui 1.0.7 → 1.0.8
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/app/use-ikon-app.d.ts +20 -10
- package/hooks/index.d.ts +1 -0
- package/hooks/use-toasts.d.ts +10 -0
- package/index.d.ts +1 -1
- package/index.js +833 -791
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { IkonUiCore as kt, UiStreamStore as
|
|
2
|
-
import { UiStreamStore as
|
|
3
|
-
import
|
|
4
|
-
import { createLogger as
|
|
5
|
-
var
|
|
1
|
+
import { IkonUiCore as kt, UiStreamStore as Ct } from "@ikonai/sdk-ui";
|
|
2
|
+
import { UiStreamStore as wo } from "@ikonai/sdk-ui";
|
|
3
|
+
import It, { useSyncExternalStore as De, useMemo as Y, memo as q, useRef as v, useCallback as $, Fragment as Ot, useEffect as x, useState as X, createContext as dt, use as Fe } from "react";
|
|
4
|
+
import { createLogger as we, getOrCreateDeviceId as ge, deriveAuthUrl as Ne, parseUrlParams as _t, isCloudEnvironment as ze, extractUserIdFromToken as Nt, deriveBackendType as We, IkonClient as Pt, subscribeToLogEvents as Mt, isDebugModeEnabled as jt, LogLevel as qe } from "@ikonai/sdk";
|
|
5
|
+
var pe = { exports: {} }, ie = {};
|
|
6
6
|
/**
|
|
7
7
|
* @license React
|
|
8
8
|
* react-jsx-runtime.production.js
|
|
@@ -12,10 +12,10 @@ var me = { exports: {} }, ie = {};
|
|
|
12
12
|
* This source code is licensed under the MIT license found in the
|
|
13
13
|
* LICENSE file in the root directory of this source tree.
|
|
14
14
|
*/
|
|
15
|
-
var
|
|
16
|
-
function
|
|
17
|
-
if (
|
|
18
|
-
|
|
15
|
+
var Ge;
|
|
16
|
+
function Lt() {
|
|
17
|
+
if (Ge) return ie;
|
|
18
|
+
Ge = 1;
|
|
19
19
|
var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
|
|
20
20
|
function r(n, o, s) {
|
|
21
21
|
var i = null;
|
|
@@ -44,42 +44,42 @@ var ae = {};
|
|
|
44
44
|
* This source code is licensed under the MIT license found in the
|
|
45
45
|
* LICENSE file in the root directory of this source tree.
|
|
46
46
|
*/
|
|
47
|
-
var
|
|
48
|
-
function
|
|
49
|
-
return
|
|
47
|
+
var He;
|
|
48
|
+
function Ut() {
|
|
49
|
+
return He || (He = 1, process.env.NODE_ENV !== "production" && function() {
|
|
50
50
|
function t(u) {
|
|
51
51
|
if (u == null) return null;
|
|
52
52
|
if (typeof u == "function")
|
|
53
|
-
return u.$$typeof ===
|
|
53
|
+
return u.$$typeof === L ? null : u.displayName || u.name || null;
|
|
54
54
|
if (typeof u == "string") return u;
|
|
55
55
|
switch (u) {
|
|
56
|
-
case
|
|
56
|
+
case b:
|
|
57
57
|
return "Fragment";
|
|
58
|
-
case
|
|
58
|
+
case p:
|
|
59
59
|
return "Profiler";
|
|
60
|
-
case
|
|
60
|
+
case g:
|
|
61
61
|
return "StrictMode";
|
|
62
|
-
case
|
|
62
|
+
case j:
|
|
63
63
|
return "Suspense";
|
|
64
|
-
case
|
|
64
|
+
case G:
|
|
65
65
|
return "SuspenseList";
|
|
66
|
-
case
|
|
66
|
+
case O:
|
|
67
67
|
return "Activity";
|
|
68
68
|
}
|
|
69
69
|
if (typeof u == "object")
|
|
70
70
|
switch (typeof u.tag == "number" && console.error(
|
|
71
71
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
72
72
|
), u.$$typeof) {
|
|
73
|
-
case
|
|
73
|
+
case S:
|
|
74
74
|
return "Portal";
|
|
75
|
-
case
|
|
75
|
+
case T:
|
|
76
76
|
return (u.displayName || "Context") + ".Provider";
|
|
77
|
-
case
|
|
77
|
+
case w:
|
|
78
78
|
return (u._context.displayName || "Context") + ".Consumer";
|
|
79
|
-
case
|
|
79
|
+
case I:
|
|
80
80
|
var y = u.render;
|
|
81
81
|
return u = u.displayName, u || (u = y.displayName || y.name || "", u = u !== "" ? "ForwardRef(" + u + ")" : "ForwardRef"), u;
|
|
82
|
-
case
|
|
82
|
+
case Q:
|
|
83
83
|
return y = u.displayName || null, y !== null ? y : t(u.type) || "Memo";
|
|
84
84
|
case k:
|
|
85
85
|
y = u._payload, u = u._init;
|
|
@@ -102,16 +102,16 @@ function jt() {
|
|
|
102
102
|
}
|
|
103
103
|
if (y) {
|
|
104
104
|
y = console;
|
|
105
|
-
var R = y.error,
|
|
105
|
+
var R = y.error, C = typeof Symbol == "function" && Symbol.toStringTag && u[Symbol.toStringTag] || u.constructor.name || "Object";
|
|
106
106
|
return R.call(
|
|
107
107
|
y,
|
|
108
108
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
109
|
-
|
|
109
|
+
C
|
|
110
110
|
), e(u);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
function n(u) {
|
|
114
|
-
if (u ===
|
|
114
|
+
if (u === b) return "<>";
|
|
115
115
|
if (typeof u == "object" && u !== null && u.$$typeof === k)
|
|
116
116
|
return "<...>";
|
|
117
117
|
try {
|
|
@@ -122,14 +122,14 @@ function jt() {
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
function o() {
|
|
125
|
-
var u =
|
|
125
|
+
var u = _.A;
|
|
126
126
|
return u === null ? null : u.getOwner();
|
|
127
127
|
}
|
|
128
128
|
function s() {
|
|
129
129
|
return Error("react-stack-top-frame");
|
|
130
130
|
}
|
|
131
131
|
function i(u) {
|
|
132
|
-
if (
|
|
132
|
+
if (D.call(u, "key")) {
|
|
133
133
|
var y = Object.getOwnPropertyDescriptor(u, "key").get;
|
|
134
134
|
if (y && y.isReactWarning) return !1;
|
|
135
135
|
}
|
|
@@ -149,16 +149,16 @@ function jt() {
|
|
|
149
149
|
}
|
|
150
150
|
function c() {
|
|
151
151
|
var u = t(this.type);
|
|
152
|
-
return
|
|
152
|
+
return he[u] || (he[u] = !0, console.error(
|
|
153
153
|
"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."
|
|
154
154
|
)), u = this.props.ref, u !== void 0 ? u : null;
|
|
155
155
|
}
|
|
156
|
-
function f(u, y, R,
|
|
157
|
-
return R =
|
|
158
|
-
$$typeof:
|
|
156
|
+
function f(u, y, R, C, K, F, ee, se) {
|
|
157
|
+
return R = F.ref, u = {
|
|
158
|
+
$$typeof: h,
|
|
159
159
|
type: u,
|
|
160
160
|
key: y,
|
|
161
|
-
props:
|
|
161
|
+
props: F,
|
|
162
162
|
_owner: K
|
|
163
163
|
}, (R !== void 0 ? R : null) !== null ? Object.defineProperty(u, "ref", {
|
|
164
164
|
enumerable: !1,
|
|
@@ -177,7 +177,7 @@ function jt() {
|
|
|
177
177
|
configurable: !1,
|
|
178
178
|
enumerable: !1,
|
|
179
179
|
writable: !0,
|
|
180
|
-
value:
|
|
180
|
+
value: ee
|
|
181
181
|
}), Object.defineProperty(u, "_debugTask", {
|
|
182
182
|
configurable: !1,
|
|
183
183
|
enumerable: !1,
|
|
@@ -185,104 +185,104 @@ function jt() {
|
|
|
185
185
|
value: se
|
|
186
186
|
}), Object.freeze && (Object.freeze(u.props), Object.freeze(u)), u;
|
|
187
187
|
}
|
|
188
|
-
function
|
|
189
|
-
var
|
|
190
|
-
if (
|
|
191
|
-
if (
|
|
192
|
-
if (z(
|
|
193
|
-
for (
|
|
194
|
-
m(
|
|
195
|
-
Object.freeze && Object.freeze(
|
|
188
|
+
function d(u, y, R, C, K, F, ee, se) {
|
|
189
|
+
var N = y.children;
|
|
190
|
+
if (N !== void 0)
|
|
191
|
+
if (C)
|
|
192
|
+
if (z(N)) {
|
|
193
|
+
for (C = 0; C < N.length; C++)
|
|
194
|
+
m(N[C]);
|
|
195
|
+
Object.freeze && Object.freeze(N);
|
|
196
196
|
} else
|
|
197
197
|
console.error(
|
|
198
198
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
199
199
|
);
|
|
200
|
-
else m(
|
|
201
|
-
if (
|
|
202
|
-
|
|
203
|
-
var
|
|
200
|
+
else m(N);
|
|
201
|
+
if (D.call(y, "key")) {
|
|
202
|
+
N = t(u);
|
|
203
|
+
var J = Object.keys(y).filter(function(U) {
|
|
204
204
|
return U !== "key";
|
|
205
205
|
});
|
|
206
|
-
|
|
206
|
+
C = 0 < J.length ? "{key: someKey, " + J.join(": ..., ") + ": ...}" : "{key: someKey}", oe[N + C] || (J = 0 < J.length ? "{" + J.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
207
207
|
`A props object containing a "key" prop is being spread into JSX:
|
|
208
208
|
let props = %s;
|
|
209
209
|
<%s {...props} />
|
|
210
210
|
React keys must be passed directly to JSX without using spread:
|
|
211
211
|
let props = %s;
|
|
212
212
|
<%s key={someKey} {...props} />`,
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
), oe[
|
|
213
|
+
C,
|
|
214
|
+
N,
|
|
215
|
+
J,
|
|
216
|
+
N
|
|
217
|
+
), oe[N + C] = !0);
|
|
218
218
|
}
|
|
219
|
-
if (
|
|
219
|
+
if (N = null, R !== void 0 && (r(R), N = "" + R), i(y) && (r(y.key), N = "" + y.key), "key" in y) {
|
|
220
220
|
R = {};
|
|
221
|
-
for (var
|
|
222
|
-
|
|
221
|
+
for (var P in y)
|
|
222
|
+
P !== "key" && (R[P] = y[P]);
|
|
223
223
|
} else R = y;
|
|
224
|
-
return
|
|
224
|
+
return N && a(
|
|
225
225
|
R,
|
|
226
226
|
typeof u == "function" ? u.displayName || u.name || "Unknown" : u
|
|
227
227
|
), f(
|
|
228
228
|
u,
|
|
229
|
-
|
|
230
|
-
|
|
229
|
+
N,
|
|
230
|
+
F,
|
|
231
231
|
K,
|
|
232
232
|
o(),
|
|
233
233
|
R,
|
|
234
|
-
|
|
234
|
+
ee,
|
|
235
235
|
se
|
|
236
236
|
);
|
|
237
237
|
}
|
|
238
238
|
function m(u) {
|
|
239
|
-
typeof u == "object" && u !== null && u.$$typeof ===
|
|
239
|
+
typeof u == "object" && u !== null && u.$$typeof === h && u._store && (u._store.validated = 1);
|
|
240
240
|
}
|
|
241
|
-
var
|
|
241
|
+
var l = It, h = Symbol.for("react.transitional.element"), S = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), g = Symbol.for("react.strict_mode"), p = Symbol.for("react.profiler"), w = Symbol.for("react.consumer"), T = Symbol.for("react.context"), I = Symbol.for("react.forward_ref"), j = Symbol.for("react.suspense"), G = Symbol.for("react.suspense_list"), Q = Symbol.for("react.memo"), k = Symbol.for("react.lazy"), O = Symbol.for("react.activity"), L = Symbol.for("react.client.reference"), _ = l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, D = Object.prototype.hasOwnProperty, z = Array.isArray, te = console.createTask ? console.createTask : function() {
|
|
242
242
|
return null;
|
|
243
243
|
};
|
|
244
|
-
|
|
244
|
+
l = {
|
|
245
245
|
"react-stack-bottom-frame": function(u) {
|
|
246
246
|
return u();
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
|
-
var ne,
|
|
250
|
-
|
|
249
|
+
var ne, he = {}, H = l["react-stack-bottom-frame"].bind(
|
|
250
|
+
l,
|
|
251
251
|
s
|
|
252
|
-
)(),
|
|
253
|
-
ae.Fragment =
|
|
254
|
-
var
|
|
255
|
-
return
|
|
252
|
+
)(), me = te(n(s)), oe = {};
|
|
253
|
+
ae.Fragment = b, ae.jsx = function(u, y, R, C, K) {
|
|
254
|
+
var F = 1e4 > _.recentlyCreatedOwnerStacks++;
|
|
255
|
+
return d(
|
|
256
256
|
u,
|
|
257
257
|
y,
|
|
258
258
|
R,
|
|
259
259
|
!1,
|
|
260
|
-
|
|
260
|
+
C,
|
|
261
261
|
K,
|
|
262
|
-
|
|
263
|
-
|
|
262
|
+
F ? Error("react-stack-top-frame") : H,
|
|
263
|
+
F ? te(n(u)) : me
|
|
264
264
|
);
|
|
265
|
-
}, ae.jsxs = function(u, y, R,
|
|
266
|
-
var
|
|
267
|
-
return
|
|
265
|
+
}, ae.jsxs = function(u, y, R, C, K) {
|
|
266
|
+
var F = 1e4 > _.recentlyCreatedOwnerStacks++;
|
|
267
|
+
return d(
|
|
268
268
|
u,
|
|
269
269
|
y,
|
|
270
270
|
R,
|
|
271
271
|
!0,
|
|
272
|
-
|
|
272
|
+
C,
|
|
273
273
|
K,
|
|
274
|
-
|
|
275
|
-
|
|
274
|
+
F ? Error("react-stack-top-frame") : H,
|
|
275
|
+
F ? te(n(u)) : me
|
|
276
276
|
);
|
|
277
277
|
};
|
|
278
278
|
}()), ae;
|
|
279
279
|
}
|
|
280
|
-
var
|
|
281
|
-
function
|
|
282
|
-
return
|
|
280
|
+
var Je;
|
|
281
|
+
function xt() {
|
|
282
|
+
return Je || (Je = 1, process.env.NODE_ENV === "production" ? pe.exports = Lt() : pe.exports = Ut()), pe.exports;
|
|
283
283
|
}
|
|
284
|
-
var
|
|
285
|
-
function
|
|
284
|
+
var A = xt();
|
|
285
|
+
function Dt(t, e) {
|
|
286
286
|
const r = De(
|
|
287
287
|
(n) => t.subscribe(n),
|
|
288
288
|
() => {
|
|
@@ -302,7 +302,7 @@ function Ut(t, e) {
|
|
|
302
302
|
};
|
|
303
303
|
}, [r]);
|
|
304
304
|
}
|
|
305
|
-
function
|
|
305
|
+
function Z(t, e) {
|
|
306
306
|
const r = De(
|
|
307
307
|
(n) => t.subscribeNode(e, n),
|
|
308
308
|
() => t.getNodeVersion(e),
|
|
@@ -310,8 +310,8 @@ function X(t, e) {
|
|
|
310
310
|
);
|
|
311
311
|
return Y(() => t.getNode(e), [t, e, r]);
|
|
312
312
|
}
|
|
313
|
-
const
|
|
314
|
-
function
|
|
313
|
+
const Ft = we("UIRenderer");
|
|
314
|
+
function Bt(t) {
|
|
315
315
|
if (t === void 0)
|
|
316
316
|
return "{}";
|
|
317
317
|
if (typeof t == "string")
|
|
@@ -322,18 +322,18 @@ function xt(t) {
|
|
|
322
322
|
return "{}";
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
|
-
function
|
|
325
|
+
function $t(t) {
|
|
326
326
|
const e = t.styleIds;
|
|
327
327
|
return Array.isArray(e) ? e : [];
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function Vt(t) {
|
|
330
330
|
const e = t.children;
|
|
331
331
|
return Array.isArray(e) ? e : [];
|
|
332
332
|
}
|
|
333
|
-
function
|
|
333
|
+
function Kt(t, e) {
|
|
334
334
|
return t.nodeId === e.nodeId && t.context === e.context;
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function Yt(t) {
|
|
337
337
|
if (t.length === 0) return "";
|
|
338
338
|
if (t.length === 1) return t[0].id;
|
|
339
339
|
let e = t[0].id;
|
|
@@ -342,65 +342,65 @@ function $t(t) {
|
|
|
342
342
|
return e;
|
|
343
343
|
}
|
|
344
344
|
const Pe = q(function t({ nodeId: e, context: r }) {
|
|
345
|
-
const n =
|
|
346
|
-
() => o.length === 0 ? null : o.map((m) => /* @__PURE__ */
|
|
345
|
+
const n = Z(r.store, e), o = n ? Vt(n) : [], s = Yt(o), i = Y(
|
|
346
|
+
() => o.length === 0 ? null : o.map((m) => /* @__PURE__ */ A.jsx(t, { nodeId: m.id, context: r }, m.id)),
|
|
347
347
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
348
348
|
[s, r]
|
|
349
349
|
);
|
|
350
350
|
if (!n)
|
|
351
351
|
return null;
|
|
352
352
|
if (n.type === "root")
|
|
353
|
-
return /* @__PURE__ */
|
|
353
|
+
return /* @__PURE__ */ A.jsx(Ot, { children: i }, n.id);
|
|
354
354
|
const a = r.library.resolve(n);
|
|
355
355
|
if (!a)
|
|
356
|
-
return
|
|
357
|
-
const c =
|
|
358
|
-
return /* @__PURE__ */
|
|
359
|
-
},
|
|
360
|
-
function
|
|
361
|
-
return !Array.isArray(t) || t.length === 0 ? null : t.map((r) => /* @__PURE__ */
|
|
356
|
+
return Ft.warn(`No renderer for node type ${n.type}`), null;
|
|
357
|
+
const c = $t(n), f = c.length > 0 ? c.join(" ") : void 0, d = a;
|
|
358
|
+
return /* @__PURE__ */ A.jsx(d, { nodeId: e, context: r, className: f });
|
|
359
|
+
}, Kt);
|
|
360
|
+
function zt(t, e) {
|
|
361
|
+
return !Array.isArray(t) || t.length === 0 ? null : t.map((r) => /* @__PURE__ */ A.jsx(Pe, { nodeId: r.id, context: e }, r.id));
|
|
362
362
|
}
|
|
363
|
-
function
|
|
363
|
+
function Wt(t, e) {
|
|
364
364
|
return t.store === e.store && t.library === e.library && t.viewId === e.viewId && t.emptyFallback === e.emptyFallback;
|
|
365
365
|
}
|
|
366
|
-
const
|
|
367
|
-
const { rootViewId: c, rootNodeId: f } =
|
|
368
|
-
|
|
369
|
-
const m =
|
|
366
|
+
const qt = q(function({ store: e, library: r, viewId: n, emptyFallback: o = null, onAction: s, client: i, video: a }) {
|
|
367
|
+
const { rootViewId: c, rootNodeId: f } = Dt(e, n), d = v(s);
|
|
368
|
+
d.current = s;
|
|
369
|
+
const m = v(i);
|
|
370
370
|
m.current = i;
|
|
371
|
-
const
|
|
372
|
-
|
|
373
|
-
const
|
|
374
|
-
if (!
|
|
371
|
+
const l = v(a);
|
|
372
|
+
l.current = a;
|
|
373
|
+
const h = $((b, g) => {
|
|
374
|
+
if (!b)
|
|
375
375
|
return;
|
|
376
|
-
const
|
|
377
|
-
|
|
378
|
-
}, []),
|
|
379
|
-
const
|
|
376
|
+
const p = Bt(g);
|
|
377
|
+
d.current?.(b, p);
|
|
378
|
+
}, []), S = Y(() => {
|
|
379
|
+
const b = {
|
|
380
380
|
store: e,
|
|
381
381
|
library: r,
|
|
382
382
|
handlerCache: e.handlerCache,
|
|
383
383
|
// Access payloads from store at call time, not captured snapshot
|
|
384
|
-
getPayload: (
|
|
385
|
-
renderChildren: (
|
|
386
|
-
renderView: (
|
|
387
|
-
const
|
|
388
|
-
return
|
|
384
|
+
getPayload: (g) => e.getSnapshot().payloads.get(g),
|
|
385
|
+
renderChildren: (g) => zt(g, b),
|
|
386
|
+
renderView: (g) => {
|
|
387
|
+
const p = e.getSnapshot().views.get(g);
|
|
388
|
+
return p ? /* @__PURE__ */ A.jsx(Pe, { nodeId: p.id, context: b }) : null;
|
|
389
389
|
},
|
|
390
|
-
dispatchAction:
|
|
390
|
+
dispatchAction: h,
|
|
391
391
|
// Access client/video via refs to avoid context recreation
|
|
392
392
|
get client() {
|
|
393
393
|
return m.current;
|
|
394
394
|
},
|
|
395
395
|
get video() {
|
|
396
|
-
return
|
|
396
|
+
return l.current;
|
|
397
397
|
}
|
|
398
398
|
};
|
|
399
|
-
return
|
|
400
|
-
}, [e, r,
|
|
401
|
-
return !c || !f ? o : /* @__PURE__ */
|
|
402
|
-
},
|
|
403
|
-
class
|
|
399
|
+
return b;
|
|
400
|
+
}, [e, r, h]);
|
|
401
|
+
return !c || !f ? o : /* @__PURE__ */ A.jsx("div", { "data-ikon-view-id": c, style: { display: "contents" }, children: /* @__PURE__ */ A.jsx(Pe, { nodeId: f, context: S }) });
|
|
402
|
+
}, Wt);
|
|
403
|
+
class Gt {
|
|
404
404
|
constructor(e, r) {
|
|
405
405
|
if (this.fallback = r, e)
|
|
406
406
|
for (const [n, o] of e)
|
|
@@ -417,41 +417,41 @@ class zt {
|
|
|
417
417
|
return this.renderers.get(e.type) ?? this.fallback;
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
|
-
function
|
|
420
|
+
function eo(t, e) {
|
|
421
421
|
const r = Object.entries(t);
|
|
422
|
-
return new
|
|
422
|
+
return new Gt(r, e);
|
|
423
423
|
}
|
|
424
|
-
function
|
|
424
|
+
function to(t) {
|
|
425
425
|
return De(
|
|
426
426
|
(e) => t.subscribe(e),
|
|
427
427
|
() => t.getSnapshot(),
|
|
428
428
|
() => t.getSnapshot()
|
|
429
429
|
);
|
|
430
430
|
}
|
|
431
|
-
const
|
|
432
|
-
function
|
|
431
|
+
const Me = "ikon-ui";
|
|
432
|
+
function Ht(t, e) {
|
|
433
433
|
return t === e;
|
|
434
434
|
}
|
|
435
|
-
const
|
|
436
|
-
const i = Y(() => Array.from(e.keys()).sort().join(","), [e]), a =
|
|
435
|
+
const ro = q(function({ stores: e, registry: r, category: n = Me, onAction: o, client: s }) {
|
|
436
|
+
const i = Y(() => Array.from(e.keys()).sort().join(","), [e]), a = v(o);
|
|
437
437
|
a.current = o;
|
|
438
|
-
const c =
|
|
438
|
+
const c = v(s);
|
|
439
439
|
c.current = s;
|
|
440
440
|
const f = Y(
|
|
441
441
|
() => {
|
|
442
|
-
const
|
|
443
|
-
for (const [m,
|
|
444
|
-
const
|
|
445
|
-
|
|
442
|
+
const d = [];
|
|
443
|
+
for (const [m, l] of e) {
|
|
444
|
+
const h = l.store.getSnapshot();
|
|
445
|
+
Ht(l.category, n) && (!h.rootViewId || !h.views.has(h.rootViewId) || d.push({ key: m, store: l.store }));
|
|
446
446
|
}
|
|
447
|
-
return
|
|
447
|
+
return d;
|
|
448
448
|
},
|
|
449
449
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
450
450
|
[e, n, i]
|
|
451
451
|
);
|
|
452
|
-
return f.length === 0 ? null : /* @__PURE__ */
|
|
452
|
+
return f.length === 0 ? null : /* @__PURE__ */ A.jsx(A.Fragment, { children: f.map(({ key: d, store: m }) => /* @__PURE__ */ A.jsx(qt, { store: m, library: r, onAction: a.current, client: c.current, video: c.current?.media?.video }, d)) });
|
|
453
453
|
});
|
|
454
|
-
class
|
|
454
|
+
class Jt {
|
|
455
455
|
core;
|
|
456
456
|
ownsCore;
|
|
457
457
|
stores = /* @__PURE__ */ new Map();
|
|
@@ -509,8 +509,8 @@ class qt {
|
|
|
509
509
|
if (r)
|
|
510
510
|
return r;
|
|
511
511
|
const n = {
|
|
512
|
-
category:
|
|
513
|
-
store: new
|
|
512
|
+
category: Me,
|
|
513
|
+
store: new Ct()
|
|
514
514
|
};
|
|
515
515
|
return this.stores.set(e, n), n;
|
|
516
516
|
}
|
|
@@ -518,7 +518,7 @@ class qt {
|
|
|
518
518
|
const n = this.stores.get(e);
|
|
519
519
|
if (!n)
|
|
520
520
|
return !1;
|
|
521
|
-
const o = r ?? this.core.uiStore.getSnapshot(e)?.category ??
|
|
521
|
+
const o = r ?? this.core.uiStore.getSnapshot(e)?.category ?? Me;
|
|
522
522
|
return n.category === o ? !1 : (this.stores.set(e, { ...n, category: o }), !0);
|
|
523
523
|
}
|
|
524
524
|
notify(e) {
|
|
@@ -526,7 +526,7 @@ class qt {
|
|
|
526
526
|
r(e);
|
|
527
527
|
}
|
|
528
528
|
}
|
|
529
|
-
function
|
|
529
|
+
function fe(t) {
|
|
530
530
|
if (typeof t == "string") {
|
|
531
531
|
const e = t.trim();
|
|
532
532
|
return e.length > 0 ? e : void 0;
|
|
@@ -545,42 +545,42 @@ function Be(...t) {
|
|
|
545
545
|
}
|
|
546
546
|
return e || void 0;
|
|
547
547
|
}
|
|
548
|
-
const
|
|
548
|
+
const Xe = /* @__PURE__ */ new WeakMap(), Xt = {};
|
|
549
549
|
function $e(t) {
|
|
550
550
|
if (!t)
|
|
551
|
-
return
|
|
552
|
-
const e =
|
|
551
|
+
return Xt;
|
|
552
|
+
const e = Xe.get(t);
|
|
553
553
|
if (e)
|
|
554
554
|
return e;
|
|
555
555
|
const r = {};
|
|
556
556
|
for (const [n, o] of Object.entries(t))
|
|
557
557
|
o != null && (typeof o == "string" || typeof o == "number" || typeof o == "boolean") && (r[n] = o);
|
|
558
|
-
return
|
|
558
|
+
return Xe.set(t, r), r;
|
|
559
559
|
}
|
|
560
|
-
function
|
|
560
|
+
function Zt() {
|
|
561
561
|
const t = q(function({ nodeId: r, context: n }) {
|
|
562
|
-
const o =
|
|
563
|
-
return
|
|
562
|
+
const o = Z(n.store, r), s = v(null), i = fe(o?.props?.targetViewId), a = o?.props?.focusOnly, c = typeof a == "boolean" ? a : void 0, f = fe(o?.props?.key), d = o?.props?.preciseGeneratedAt;
|
|
563
|
+
return x(() => {
|
|
564
564
|
if (typeof document > "u")
|
|
565
565
|
return;
|
|
566
566
|
const l = s.current;
|
|
567
567
|
if (!l || i && l.closest("[data-ikon-view-id]")?.getAttribute("data-ikon-view-id") !== i)
|
|
568
568
|
return;
|
|
569
|
-
const
|
|
570
|
-
if (
|
|
571
|
-
const p = ((
|
|
572
|
-
let
|
|
573
|
-
for (;
|
|
574
|
-
const
|
|
575
|
-
if (
|
|
576
|
-
return
|
|
577
|
-
|
|
569
|
+
const h = c !== !0;
|
|
570
|
+
if (h) {
|
|
571
|
+
const p = ((w) => {
|
|
572
|
+
let T = w.parentElement;
|
|
573
|
+
for (; T; ) {
|
|
574
|
+
const j = window.getComputedStyle(T).overflowY;
|
|
575
|
+
if (j === "auto" || j === "scroll" || T.hasAttribute("data-radix-scroll-area-viewport"))
|
|
576
|
+
return T;
|
|
577
|
+
T = T.parentElement;
|
|
578
578
|
}
|
|
579
579
|
return null;
|
|
580
580
|
})(l);
|
|
581
581
|
p ? requestAnimationFrame(() => {
|
|
582
|
-
const
|
|
583
|
-
"scrollBehavior" in document.documentElement.style ? p.scrollTo({ top:
|
|
582
|
+
const w = p.getBoundingClientRect(), T = l.getBoundingClientRect(), I = p.scrollTop + (T.bottom - w.bottom) + 16;
|
|
583
|
+
"scrollBehavior" in document.documentElement.style ? p.scrollTo({ top: I, behavior: "smooth" }) : p.scrollTop = I;
|
|
584
584
|
}) : typeof l.scrollIntoView == "function" && requestAnimationFrame(() => {
|
|
585
585
|
try {
|
|
586
586
|
l.scrollIntoView({ behavior: "smooth", block: "end", inline: "nearest" });
|
|
@@ -589,13 +589,14 @@ function Gt() {
|
|
|
589
589
|
}
|
|
590
590
|
});
|
|
591
591
|
}
|
|
592
|
-
|
|
592
|
+
const S = document.activeElement;
|
|
593
|
+
if (!(S instanceof HTMLInputElement || S instanceof HTMLTextAreaElement || S?.getAttribute("contenteditable") === "true") && typeof l.focus == "function")
|
|
593
594
|
try {
|
|
594
|
-
l.focus({ preventScroll: !
|
|
595
|
+
l.focus({ preventScroll: !h });
|
|
595
596
|
} catch {
|
|
596
597
|
l.focus();
|
|
597
598
|
}
|
|
598
|
-
}, [c, i]), o ? /* @__PURE__ */
|
|
599
|
+
}, [c, i, f, d]), o ? /* @__PURE__ */ A.jsx(
|
|
599
600
|
"span",
|
|
600
601
|
{
|
|
601
602
|
ref: s,
|
|
@@ -612,58 +613,58 @@ function Gt() {
|
|
|
612
613
|
return t;
|
|
613
614
|
};
|
|
614
615
|
}
|
|
615
|
-
function
|
|
616
|
+
function Qt() {
|
|
616
617
|
const t = q(function({ nodeId: r, context: n, className: o }) {
|
|
617
|
-
const s =
|
|
618
|
+
const s = Z(n.store, r);
|
|
618
619
|
if (!s)
|
|
619
620
|
return null;
|
|
620
|
-
const i = $e(s.props), a = Be(
|
|
621
|
-
return /* @__PURE__ */
|
|
621
|
+
const i = $e(s.props), a = Be(fe(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
622
|
+
return /* @__PURE__ */ A.jsx("div", { ...i, "data-ikon-node-id": s.id, className: a, children: c });
|
|
622
623
|
});
|
|
623
624
|
return ({ type: e }) => {
|
|
624
625
|
if (e === "std.div")
|
|
625
626
|
return t;
|
|
626
627
|
};
|
|
627
628
|
}
|
|
628
|
-
function
|
|
629
|
+
function er() {
|
|
629
630
|
const t = q(function({ nodeId: r, context: n, className: o }) {
|
|
630
|
-
const s =
|
|
631
|
+
const s = Z(n.store, r);
|
|
631
632
|
if (!s)
|
|
632
633
|
return null;
|
|
633
|
-
const i = $e(s.props), a = Be("relative",
|
|
634
|
-
return /* @__PURE__ */
|
|
634
|
+
const i = $e(s.props), a = Be("relative", fe(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
635
|
+
return /* @__PURE__ */ A.jsx("div", { ...i, "data-ikon-node-id": s.id, className: a, children: c });
|
|
635
636
|
});
|
|
636
637
|
return ({ type: e }) => {
|
|
637
638
|
if (e === "std.stack")
|
|
638
639
|
return t;
|
|
639
640
|
};
|
|
640
641
|
}
|
|
641
|
-
function
|
|
642
|
+
function tr() {
|
|
642
643
|
const t = q(function({ nodeId: r, context: n, className: o }) {
|
|
643
|
-
const s =
|
|
644
|
+
const s = Z(n.store, r);
|
|
644
645
|
if (!s)
|
|
645
646
|
return null;
|
|
646
|
-
const i = $e(s.props), a = Be("absolute",
|
|
647
|
-
return /* @__PURE__ */
|
|
647
|
+
const i = $e(s.props), a = Be("absolute", fe(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
648
|
+
return /* @__PURE__ */ A.jsx("div", { ...i, "data-ikon-node-id": s.id, className: a, children: c });
|
|
648
649
|
});
|
|
649
650
|
return ({ type: e }) => {
|
|
650
651
|
if (e === "std.layer")
|
|
651
652
|
return t;
|
|
652
653
|
};
|
|
653
654
|
}
|
|
654
|
-
function
|
|
655
|
+
function rr() {
|
|
655
656
|
return [
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
657
|
+
Qt(),
|
|
658
|
+
er(),
|
|
659
|
+
tr(),
|
|
660
|
+
Zt()
|
|
660
661
|
];
|
|
661
662
|
}
|
|
662
|
-
const
|
|
663
|
-
function
|
|
664
|
-
t.registerModule(
|
|
663
|
+
const nr = "base", or = async () => rr();
|
|
664
|
+
function sr(t) {
|
|
665
|
+
t.registerModule(nr, or);
|
|
665
666
|
}
|
|
666
|
-
function
|
|
667
|
+
function ft(t) {
|
|
667
668
|
if (typeof t == "string") {
|
|
668
669
|
const e = t.trim();
|
|
669
670
|
return e.length > 0 ? e : void 0;
|
|
@@ -673,13 +674,13 @@ function dt(t) {
|
|
|
673
674
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
674
675
|
}
|
|
675
676
|
}
|
|
676
|
-
function
|
|
677
|
+
function ht(...t) {
|
|
677
678
|
const e = [];
|
|
678
679
|
for (const r of t)
|
|
679
680
|
r && r.trim() && e.push(r.trim());
|
|
680
681
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
681
682
|
}
|
|
682
|
-
function
|
|
683
|
+
function ye(t) {
|
|
683
684
|
if (typeof t == "number" && Number.isFinite(t))
|
|
684
685
|
return Math.floor(t);
|
|
685
686
|
if (typeof t == "string" && t.trim().length > 0) {
|
|
@@ -688,23 +689,23 @@ function ge(t) {
|
|
|
688
689
|
return Math.floor(e);
|
|
689
690
|
}
|
|
690
691
|
}
|
|
691
|
-
function
|
|
692
|
+
function je(t) {
|
|
692
693
|
if (typeof t != "string")
|
|
693
694
|
return;
|
|
694
695
|
const e = t.trim();
|
|
695
696
|
return e.length > 0 ? e : void 0;
|
|
696
697
|
}
|
|
697
|
-
const
|
|
698
|
-
function
|
|
698
|
+
const ir = "std.video-canvas", ar = "std.video-url-player";
|
|
699
|
+
function cr() {
|
|
699
700
|
const t = q(function({ nodeId: r, context: n, className: o }) {
|
|
700
|
-
const s =
|
|
701
|
-
return
|
|
702
|
-
const
|
|
703
|
-
if (!(!a || !
|
|
704
|
-
return a.attachCanvas(c,
|
|
701
|
+
const s = Z(n.store, r), i = v(null), a = n.video, c = s ? je(s.props?.streamId) : void 0, f = s ? ye(s.props?.width) : void 0, d = s ? ye(s.props?.height) : void 0, m = s ? ht(ft(s.props?.className), o) : o;
|
|
702
|
+
return x(() => {
|
|
703
|
+
const l = i.current;
|
|
704
|
+
if (!(!a || !l || !c))
|
|
705
|
+
return a.attachCanvas(c, l), () => {
|
|
705
706
|
a.detachCanvas(c);
|
|
706
707
|
};
|
|
707
|
-
}, [a, c]), s ? /* @__PURE__ */
|
|
708
|
+
}, [a, c]), s ? /* @__PURE__ */ A.jsx(
|
|
708
709
|
"canvas",
|
|
709
710
|
{
|
|
710
711
|
ref: i,
|
|
@@ -712,18 +713,18 @@ function sr() {
|
|
|
712
713
|
"data-ikon-video-stream-id": c,
|
|
713
714
|
className: m,
|
|
714
715
|
...f ? { width: f } : {},
|
|
715
|
-
...
|
|
716
|
+
...d ? { height: d } : {}
|
|
716
717
|
},
|
|
717
718
|
c
|
|
718
719
|
) : null;
|
|
719
720
|
});
|
|
720
721
|
return ({ type: e }) => {
|
|
721
|
-
if (e ===
|
|
722
|
+
if (e === ir)
|
|
722
723
|
return t;
|
|
723
724
|
};
|
|
724
725
|
}
|
|
725
|
-
function
|
|
726
|
-
return [
|
|
726
|
+
function ur() {
|
|
727
|
+
return [cr(), lr()];
|
|
727
728
|
}
|
|
728
729
|
function ce(t) {
|
|
729
730
|
if (typeof t == "boolean")
|
|
@@ -734,56 +735,56 @@ function ce(t) {
|
|
|
734
735
|
if (e === "false") return !1;
|
|
735
736
|
}
|
|
736
737
|
}
|
|
737
|
-
function
|
|
738
|
+
function lr() {
|
|
738
739
|
const t = q(function({
|
|
739
740
|
nodeId: r,
|
|
740
741
|
context: n,
|
|
741
742
|
className: o
|
|
742
743
|
}) {
|
|
743
|
-
const s =
|
|
744
|
+
const s = Z(n.store, r);
|
|
744
745
|
if (!s)
|
|
745
746
|
return null;
|
|
746
|
-
const i = ft(
|
|
747
|
-
return /* @__PURE__ */
|
|
747
|
+
const i = ht(ft(s.props?.className), o), a = je(s.props?.src), c = je(s.props?.poster), f = ce(s.props?.controls), d = ce(s.props?.autoplay), m = ce(s.props?.loop), l = ce(s.props?.muted), h = ce(s.props?.playsInline), S = ye(s.props?.width), b = ye(s.props?.height), g = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
748
|
+
return /* @__PURE__ */ A.jsx(
|
|
748
749
|
"video",
|
|
749
750
|
{
|
|
750
751
|
src: a,
|
|
751
752
|
poster: c,
|
|
752
753
|
...f !== void 0 ? { controls: f } : {},
|
|
753
|
-
...
|
|
754
|
+
...d !== void 0 ? { autoPlay: d } : {},
|
|
754
755
|
...m !== void 0 ? { loop: m } : {},
|
|
755
|
-
...
|
|
756
|
-
...
|
|
757
|
-
...
|
|
758
|
-
...
|
|
756
|
+
...l !== void 0 ? { muted: l } : {},
|
|
757
|
+
...h !== void 0 ? { playsInline: h } : {},
|
|
758
|
+
...S ? { width: S } : {},
|
|
759
|
+
...b ? { height: b } : {},
|
|
759
760
|
"data-ikon-node-id": s.id,
|
|
760
761
|
className: i,
|
|
761
|
-
children:
|
|
762
|
+
children: g
|
|
762
763
|
}
|
|
763
764
|
);
|
|
764
765
|
});
|
|
765
766
|
return ({ type: e }) => {
|
|
766
|
-
if (e ===
|
|
767
|
+
if (e === ar)
|
|
767
768
|
return t;
|
|
768
769
|
};
|
|
769
770
|
}
|
|
770
|
-
const
|
|
771
|
-
function
|
|
772
|
-
t.registerModule(
|
|
771
|
+
const dr = "media", fr = async () => ur();
|
|
772
|
+
function hr(t) {
|
|
773
|
+
t.registerModule(dr, fr);
|
|
773
774
|
}
|
|
774
|
-
const
|
|
775
|
+
const mr = `#version 300 es
|
|
775
776
|
in vec4 a_position;
|
|
776
777
|
void main() {
|
|
777
778
|
gl_Position = a_position;
|
|
778
779
|
}
|
|
779
780
|
`;
|
|
780
|
-
function
|
|
781
|
+
function pr(t, e) {
|
|
781
782
|
return new RegExp(`\\buniform\\s+\\w+\\s+${e}\\s*;`, "g").test(t);
|
|
782
783
|
}
|
|
783
|
-
function
|
|
784
|
+
function gr(t, e) {
|
|
784
785
|
const r = [];
|
|
785
786
|
for (const [n, o] of Object.entries(e)) {
|
|
786
|
-
if (
|
|
787
|
+
if (pr(t, n))
|
|
787
788
|
continue;
|
|
788
789
|
let s;
|
|
789
790
|
switch (o.type) {
|
|
@@ -836,7 +837,7 @@ void main() {
|
|
|
836
837
|
}
|
|
837
838
|
`;
|
|
838
839
|
}
|
|
839
|
-
class
|
|
840
|
+
class yr {
|
|
840
841
|
gl;
|
|
841
842
|
program = null;
|
|
842
843
|
positionBuffer = null;
|
|
@@ -872,10 +873,10 @@ class mr {
|
|
|
872
873
|
}
|
|
873
874
|
compile(e, r = {}) {
|
|
874
875
|
this.lastError = null, this.customUniforms = r, this.currentShaderSource = e;
|
|
875
|
-
const n = this.gl, o = this.compileShader(n.VERTEX_SHADER,
|
|
876
|
+
const n = this.gl, o = this.compileShader(n.VERTEX_SHADER, mr);
|
|
876
877
|
if (!o)
|
|
877
878
|
return !1;
|
|
878
|
-
const s =
|
|
879
|
+
const s = gr(e, r), i = this.compileShader(n.FRAGMENT_SHADER, s);
|
|
879
880
|
if (!i)
|
|
880
881
|
return n.deleteShader(o), !1;
|
|
881
882
|
const a = n.createProgram();
|
|
@@ -915,44 +916,44 @@ class mr {
|
|
|
915
916
|
c && e.uniform3f(c, n, o, 1);
|
|
916
917
|
const f = this.uniformLocations.get("iTime");
|
|
917
918
|
f && e.uniform1f(f, i);
|
|
918
|
-
const
|
|
919
|
-
|
|
919
|
+
const d = this.uniformLocations.get("iTimeDelta");
|
|
920
|
+
d && e.uniform1f(d, a);
|
|
920
921
|
const m = this.uniformLocations.get("iFrame");
|
|
921
922
|
m && e.uniform1i(m, this.frameCount);
|
|
922
|
-
const
|
|
923
|
-
|
|
924
|
-
const
|
|
925
|
-
if (
|
|
926
|
-
const
|
|
927
|
-
e.uniform4f(
|
|
923
|
+
const l = this.uniformLocations.get("iMouse");
|
|
924
|
+
l && e.uniform4f(l, this.mouseX, this.mouseY, this.mouseClickX, this.mouseClickY);
|
|
925
|
+
const h = this.uniformLocations.get("iDate");
|
|
926
|
+
if (h) {
|
|
927
|
+
const S = /* @__PURE__ */ new Date();
|
|
928
|
+
e.uniform4f(h, S.getFullYear(), S.getMonth(), S.getDate(), S.getHours() * 3600 + S.getMinutes() * 60 + S.getSeconds() + S.getMilliseconds() / 1e3);
|
|
928
929
|
}
|
|
929
|
-
for (const [
|
|
930
|
-
const
|
|
931
|
-
if (
|
|
932
|
-
switch (
|
|
930
|
+
for (const [S, b] of Object.entries(this.customUniforms)) {
|
|
931
|
+
const g = this.uniformLocations.get(S);
|
|
932
|
+
if (g)
|
|
933
|
+
switch (b.type) {
|
|
933
934
|
case "float":
|
|
934
|
-
e.uniform1f(
|
|
935
|
+
e.uniform1f(g, b.value);
|
|
935
936
|
break;
|
|
936
937
|
case "vec2": {
|
|
937
|
-
const
|
|
938
|
-
e.uniform2f(
|
|
938
|
+
const p = b.value;
|
|
939
|
+
e.uniform2f(g, p[0], p[1]);
|
|
939
940
|
break;
|
|
940
941
|
}
|
|
941
942
|
case "vec3": {
|
|
942
|
-
const
|
|
943
|
-
e.uniform3f(
|
|
943
|
+
const p = b.value;
|
|
944
|
+
e.uniform3f(g, p[0], p[1], p[2]);
|
|
944
945
|
break;
|
|
945
946
|
}
|
|
946
947
|
case "vec4": {
|
|
947
|
-
const
|
|
948
|
-
e.uniform4f(
|
|
948
|
+
const p = b.value;
|
|
949
|
+
e.uniform4f(g, p[0], p[1], p[2], p[3]);
|
|
949
950
|
break;
|
|
950
951
|
}
|
|
951
952
|
case "int":
|
|
952
|
-
e.uniform1i(
|
|
953
|
+
e.uniform1i(g, b.value);
|
|
953
954
|
break;
|
|
954
955
|
case "bool":
|
|
955
|
-
e.uniform1i(
|
|
956
|
+
e.uniform1i(g, b.value ? 1 : 0);
|
|
956
957
|
break;
|
|
957
958
|
}
|
|
958
959
|
}
|
|
@@ -966,7 +967,7 @@ class mr {
|
|
|
966
967
|
this.program && (e.deleteProgram(this.program), this.program = null), this.positionBuffer && (e.deleteBuffer(this.positionBuffer), this.positionBuffer = null), this.vao && (e.deleteVertexArray(this.vao), this.vao = null), this.uniformLocations.clear();
|
|
967
968
|
}
|
|
968
969
|
}
|
|
969
|
-
function
|
|
970
|
+
function Sr(t) {
|
|
970
971
|
if (typeof t == "string") {
|
|
971
972
|
const e = t.trim();
|
|
972
973
|
return e.length > 0 ? e : void 0;
|
|
@@ -976,13 +977,13 @@ function pr(t) {
|
|
|
976
977
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
977
978
|
}
|
|
978
979
|
}
|
|
979
|
-
function
|
|
980
|
+
function br(...t) {
|
|
980
981
|
const e = [];
|
|
981
982
|
for (const r of t)
|
|
982
983
|
r && r.trim() && e.push(r.trim());
|
|
983
984
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
984
985
|
}
|
|
985
|
-
function
|
|
986
|
+
function Re(t) {
|
|
986
987
|
if (typeof t == "number" && Number.isFinite(t))
|
|
987
988
|
return Math.floor(t);
|
|
988
989
|
if (typeof t == "string" && t.trim().length > 0) {
|
|
@@ -991,10 +992,10 @@ function Ee(t) {
|
|
|
991
992
|
return Math.floor(e);
|
|
992
993
|
}
|
|
993
994
|
}
|
|
994
|
-
function
|
|
995
|
+
function wr(t) {
|
|
995
996
|
return typeof t == "string" ? t : "";
|
|
996
997
|
}
|
|
997
|
-
function
|
|
998
|
+
function vr(t) {
|
|
998
999
|
if (typeof t == "boolean")
|
|
999
1000
|
return t;
|
|
1000
1001
|
if (typeof t == "string") {
|
|
@@ -1003,7 +1004,7 @@ function Sr(t) {
|
|
|
1003
1004
|
if (e === "false") return !1;
|
|
1004
1005
|
}
|
|
1005
1006
|
}
|
|
1006
|
-
function
|
|
1007
|
+
function Er(t) {
|
|
1007
1008
|
if (!t || typeof t != "object")
|
|
1008
1009
|
return {};
|
|
1009
1010
|
const e = {}, r = t;
|
|
@@ -1018,7 +1019,7 @@ function br(t) {
|
|
|
1018
1019
|
}
|
|
1019
1020
|
return e;
|
|
1020
1021
|
}
|
|
1021
|
-
function
|
|
1022
|
+
function Rr(t, e) {
|
|
1022
1023
|
const r = Object.keys(t), n = Object.keys(e);
|
|
1023
1024
|
if (r.length !== n.length)
|
|
1024
1025
|
return !1;
|
|
@@ -1039,99 +1040,99 @@ function wr(t, e) {
|
|
|
1039
1040
|
}
|
|
1040
1041
|
return !0;
|
|
1041
1042
|
}
|
|
1042
|
-
const
|
|
1043
|
-
function
|
|
1043
|
+
const Ar = "std.shader-canvas";
|
|
1044
|
+
function Tr() {
|
|
1044
1045
|
const t = q(function({ nodeId: r, context: n, className: o }) {
|
|
1045
|
-
const s =
|
|
1046
|
+
const s = Z(n.store, r), i = v(null), a = v(null), c = v(null), f = v(0), d = v(""), m = v({}), l = v({
|
|
1046
1047
|
x: 0,
|
|
1047
1048
|
y: 0,
|
|
1048
1049
|
clickX: 0,
|
|
1049
1050
|
clickY: 0,
|
|
1050
1051
|
isDown: !1
|
|
1051
|
-
}),
|
|
1052
|
-
|
|
1052
|
+
}), h = s ? wr(s.props?.shaderSource) : "", S = s ? Re(s.props?.fps) ?? 60 : 60, b = s?.props?.uniforms, g = Y(() => Er(b), [b]), p = s ? vr(s.props?.enableMouse) ?? !0 : !0, w = s ? Re(s.props?.width) : void 0, T = s ? Re(s.props?.height) : void 0, I = s ? br(Sr(s.props?.className), o) : o;
|
|
1053
|
+
x(() => {
|
|
1053
1054
|
const k = i.current;
|
|
1054
1055
|
if (k) {
|
|
1055
1056
|
try {
|
|
1056
|
-
const
|
|
1057
|
-
a.current =
|
|
1058
|
-
} catch (
|
|
1059
|
-
console.error("[ShaderRenderer] Failed to create WebGL2 context:",
|
|
1057
|
+
const O = new yr(k);
|
|
1058
|
+
a.current = O;
|
|
1059
|
+
} catch (O) {
|
|
1060
|
+
console.error("[ShaderRenderer] Failed to create WebGL2 context:", O);
|
|
1060
1061
|
}
|
|
1061
1062
|
return () => {
|
|
1062
1063
|
a.current && (a.current.destroy(), a.current = null);
|
|
1063
1064
|
};
|
|
1064
1065
|
}
|
|
1065
|
-
}, []),
|
|
1066
|
+
}, []), x(() => {
|
|
1066
1067
|
const k = a.current;
|
|
1067
|
-
if (!(!k || !
|
|
1068
|
-
if (k.compile(
|
|
1069
|
-
|
|
1068
|
+
if (!(!k || !h) && d.current !== h)
|
|
1069
|
+
if (k.compile(h, g))
|
|
1070
|
+
d.current = h, m.current = g;
|
|
1070
1071
|
else {
|
|
1071
|
-
const
|
|
1072
|
-
console.error("[ShaderRenderer] Shader compilation failed:",
|
|
1072
|
+
const L = k.getError();
|
|
1073
|
+
console.error("[ShaderRenderer] Shader compilation failed:", L);
|
|
1073
1074
|
}
|
|
1074
|
-
}, [
|
|
1075
|
+
}, [h, g]), x(() => {
|
|
1075
1076
|
const k = a.current;
|
|
1076
|
-
!k || !
|
|
1077
|
-
}, [
|
|
1077
|
+
!k || !d.current || Rr(m.current, g) || (k.setCustomUniforms(g), m.current = g);
|
|
1078
|
+
}, [g]), x(() => {
|
|
1078
1079
|
const k = a.current;
|
|
1079
|
-
if (!k || !
|
|
1080
|
-
const
|
|
1081
|
-
const
|
|
1082
|
-
|
|
1080
|
+
if (!k || !d.current) return;
|
|
1081
|
+
const O = 1e3 / S, L = (_) => {
|
|
1082
|
+
const D = _ - f.current;
|
|
1083
|
+
D >= O && (f.current = _ - D % O, k.draw()), c.current = requestAnimationFrame(L);
|
|
1083
1084
|
};
|
|
1084
|
-
return c.current = requestAnimationFrame(
|
|
1085
|
+
return c.current = requestAnimationFrame(L), () => {
|
|
1085
1086
|
c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
|
|
1086
1087
|
};
|
|
1087
|
-
}, [
|
|
1088
|
-
const
|
|
1088
|
+
}, [S]);
|
|
1089
|
+
const j = $(
|
|
1089
1090
|
(k) => {
|
|
1090
|
-
if (!
|
|
1091
|
-
const
|
|
1092
|
-
if (!
|
|
1093
|
-
const
|
|
1094
|
-
|
|
1091
|
+
if (!p) return;
|
|
1092
|
+
const O = i.current, L = a.current;
|
|
1093
|
+
if (!O || !L) return;
|
|
1094
|
+
const _ = O.getBoundingClientRect(), D = k.clientX - _.left, z = _.height - (k.clientY - _.top);
|
|
1095
|
+
l.current.x = D, l.current.y = z, L.setMouse(D, z, l.current.clickX, l.current.clickY);
|
|
1095
1096
|
},
|
|
1096
|
-
[
|
|
1097
|
-
),
|
|
1097
|
+
[p]
|
|
1098
|
+
), G = $(
|
|
1098
1099
|
(k) => {
|
|
1099
|
-
if (!
|
|
1100
|
-
const
|
|
1101
|
-
if (!
|
|
1102
|
-
const
|
|
1103
|
-
|
|
1100
|
+
if (!p) return;
|
|
1101
|
+
const O = i.current, L = a.current;
|
|
1102
|
+
if (!O || !L) return;
|
|
1103
|
+
const _ = O.getBoundingClientRect(), D = k.clientX - _.left, z = _.height - (k.clientY - _.top);
|
|
1104
|
+
l.current.isDown = !0, l.current.clickX = D, l.current.clickY = z, L.setMouse(D, z, D, z);
|
|
1104
1105
|
},
|
|
1105
|
-
[
|
|
1106
|
-
),
|
|
1107
|
-
|
|
1108
|
-
}, [
|
|
1109
|
-
return s ? /* @__PURE__ */
|
|
1106
|
+
[p]
|
|
1107
|
+
), Q = $(() => {
|
|
1108
|
+
p && (l.current.isDown = !1, l.current.clickX = -Math.abs(l.current.clickX));
|
|
1109
|
+
}, [p]);
|
|
1110
|
+
return s ? /* @__PURE__ */ A.jsx(
|
|
1110
1111
|
"canvas",
|
|
1111
1112
|
{
|
|
1112
1113
|
ref: i,
|
|
1113
1114
|
"data-ikon-node-id": s.id,
|
|
1114
|
-
className:
|
|
1115
|
-
...
|
|
1116
|
-
...
|
|
1117
|
-
onMouseMove:
|
|
1118
|
-
onMouseDown:
|
|
1119
|
-
onMouseUp:
|
|
1120
|
-
onMouseLeave:
|
|
1115
|
+
className: I,
|
|
1116
|
+
...w ? { width: w } : {},
|
|
1117
|
+
...T ? { height: T } : {},
|
|
1118
|
+
onMouseMove: j,
|
|
1119
|
+
onMouseDown: G,
|
|
1120
|
+
onMouseUp: Q,
|
|
1121
|
+
onMouseLeave: Q
|
|
1121
1122
|
}
|
|
1122
1123
|
) : null;
|
|
1123
1124
|
});
|
|
1124
1125
|
return ({ type: e }) => {
|
|
1125
|
-
if (e ===
|
|
1126
|
+
if (e === Ar)
|
|
1126
1127
|
return t;
|
|
1127
1128
|
};
|
|
1128
1129
|
}
|
|
1129
|
-
const
|
|
1130
|
-
function
|
|
1131
|
-
t.registerModule(
|
|
1130
|
+
const kr = "shader", Cr = async () => Tr();
|
|
1131
|
+
function Ir(t) {
|
|
1132
|
+
t.registerModule(kr, Cr);
|
|
1132
1133
|
}
|
|
1133
|
-
const
|
|
1134
|
-
class
|
|
1134
|
+
const Ze = we("UIRegistry");
|
|
1135
|
+
class Or {
|
|
1135
1136
|
baseResolvers = [];
|
|
1136
1137
|
moduleLoaders = /* @__PURE__ */ new Map();
|
|
1137
1138
|
moduleResolvers = /* @__PURE__ */ new Map();
|
|
@@ -1153,15 +1154,15 @@ class Tr {
|
|
|
1153
1154
|
for (const [n, o] of this.moduleLoaders.entries())
|
|
1154
1155
|
if (!this.moduleResolvers.has(n))
|
|
1155
1156
|
try {
|
|
1156
|
-
const s = await o(), i =
|
|
1157
|
+
const s = await o(), i = Pr(s);
|
|
1157
1158
|
this.moduleResolvers.set(n, i), e = !0;
|
|
1158
1159
|
} catch (s) {
|
|
1159
|
-
|
|
1160
|
+
Ze.error(`[IkonUiRegistry] Failed to load module '${n}'.`, s);
|
|
1160
1161
|
}
|
|
1161
1162
|
const r = [];
|
|
1162
1163
|
for (const n of this.moduleLoaders.keys())
|
|
1163
1164
|
this.moduleResolvers.has(n) && r.push(n);
|
|
1164
|
-
return
|
|
1165
|
+
return Mr(r, this.activeModuleOrder) || (this.activeModuleOrder = r, e = !0), e;
|
|
1165
1166
|
}
|
|
1166
1167
|
resolve(e) {
|
|
1167
1168
|
for (const r of this.baseResolvers) {
|
|
@@ -1171,7 +1172,7 @@ class Tr {
|
|
|
1171
1172
|
for (const r of this.activeModuleOrder) {
|
|
1172
1173
|
const n = this.moduleResolvers.get(r);
|
|
1173
1174
|
if (!n) {
|
|
1174
|
-
|
|
1175
|
+
Ze.warn(`Missing resolvers for module ${r}`);
|
|
1175
1176
|
continue;
|
|
1176
1177
|
}
|
|
1177
1178
|
for (const o of n) {
|
|
@@ -1181,17 +1182,17 @@ class Tr {
|
|
|
1181
1182
|
}
|
|
1182
1183
|
}
|
|
1183
1184
|
}
|
|
1184
|
-
function
|
|
1185
|
-
const t = new
|
|
1186
|
-
return
|
|
1185
|
+
function _r() {
|
|
1186
|
+
const t = new Or();
|
|
1187
|
+
return sr(t), hr(t), Ir(t), t.loadRegisteredModules(), t;
|
|
1187
1188
|
}
|
|
1188
|
-
function
|
|
1189
|
+
function Nr(t) {
|
|
1189
1190
|
return Array.isArray(t) ? t : [t];
|
|
1190
1191
|
}
|
|
1191
|
-
function
|
|
1192
|
-
return t ?
|
|
1192
|
+
function Pr(t) {
|
|
1193
|
+
return t ? Nr(t).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
|
|
1193
1194
|
}
|
|
1194
|
-
function
|
|
1195
|
+
function Mr(t, e) {
|
|
1195
1196
|
if (t.length !== e.length)
|
|
1196
1197
|
return !1;
|
|
1197
1198
|
for (let r = 0; r < t.length; r += 1)
|
|
@@ -1199,7 +1200,7 @@ function Nr(t, e) {
|
|
|
1199
1200
|
return !1;
|
|
1200
1201
|
return !0;
|
|
1201
1202
|
}
|
|
1202
|
-
const Ae =
|
|
1203
|
+
const Ae = we("MotionController"), Qe = {
|
|
1203
1204
|
ease: [0.25, 0.1, 0.25, 1],
|
|
1204
1205
|
"ease-in": [0.42, 0, 1, 1],
|
|
1205
1206
|
"ease-out": [0, 0, 0.58, 1],
|
|
@@ -1229,88 +1230,88 @@ const Ae = be("MotionController"), Ze = {
|
|
|
1229
1230
|
"ease-out-back": [0.175, 0.885, 0.32, 1.275],
|
|
1230
1231
|
"ease-in-out-back": [0.68, -0.55, 0.265, 1.55]
|
|
1231
1232
|
};
|
|
1232
|
-
function
|
|
1233
|
+
function B(t) {
|
|
1233
1234
|
return t <= 0 ? 0 : t >= 1 ? 1 : t;
|
|
1234
1235
|
}
|
|
1235
|
-
function
|
|
1236
|
+
function et(t) {
|
|
1236
1237
|
if (t == null) return;
|
|
1237
1238
|
const e = `${t}`.trim();
|
|
1238
1239
|
if (!e) return;
|
|
1239
1240
|
const r = Number.parseFloat(e);
|
|
1240
1241
|
return Number.isFinite(r) ? r : void 0;
|
|
1241
1242
|
}
|
|
1242
|
-
function
|
|
1243
|
+
function tt(t) {
|
|
1243
1244
|
return typeof CSS < "u" && CSS.escape ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
1244
1245
|
}
|
|
1245
|
-
function
|
|
1246
|
-
const
|
|
1247
|
-
function m(
|
|
1248
|
-
return ((3 *
|
|
1249
|
-
}
|
|
1250
|
-
function
|
|
1251
|
-
return 3 * (3 *
|
|
1252
|
-
}
|
|
1253
|
-
function
|
|
1254
|
-
for (let
|
|
1255
|
-
const
|
|
1256
|
-
if (
|
|
1257
|
-
return
|
|
1258
|
-
const
|
|
1259
|
-
|
|
1246
|
+
function rt(t, e, r, n) {
|
|
1247
|
+
const d = new Float32Array(11);
|
|
1248
|
+
function m(g, p, w) {
|
|
1249
|
+
return ((3 * p - 3 * w + 1) * g + (3 * w - 6 * p)) * g * g + 3 * p * g;
|
|
1250
|
+
}
|
|
1251
|
+
function l(g, p, w) {
|
|
1252
|
+
return 3 * (3 * p - 3 * w + 1) * g * g + 2 * (3 * w - 6 * p) * g + 3 * p;
|
|
1253
|
+
}
|
|
1254
|
+
function h(g, p) {
|
|
1255
|
+
for (let w = 0; w < 4; w += 1) {
|
|
1256
|
+
const T = l(p, t, r);
|
|
1257
|
+
if (T === 0)
|
|
1258
|
+
return p;
|
|
1259
|
+
const I = m(p, t, r) - g;
|
|
1260
|
+
p -= I / T;
|
|
1260
1261
|
}
|
|
1261
|
-
return
|
|
1262
|
+
return p;
|
|
1262
1263
|
}
|
|
1263
|
-
function
|
|
1264
|
-
let
|
|
1264
|
+
function S(g, p, w) {
|
|
1265
|
+
let T = 0, I = 0, j = 0;
|
|
1265
1266
|
do
|
|
1266
|
-
|
|
1267
|
-
while (Math.abs(
|
|
1268
|
-
return
|
|
1269
|
-
}
|
|
1270
|
-
function
|
|
1271
|
-
let
|
|
1272
|
-
const
|
|
1273
|
-
for (;
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
const
|
|
1277
|
-
return
|
|
1278
|
-
}
|
|
1279
|
-
for (let
|
|
1280
|
-
|
|
1281
|
-
return (
|
|
1282
|
-
}
|
|
1283
|
-
function
|
|
1267
|
+
I = p + (w - p) / 2, T = m(I, t, r) - g, T > 0 ? w = I : p = I;
|
|
1268
|
+
while (Math.abs(T) > 1e-7 && ++j < 10);
|
|
1269
|
+
return I;
|
|
1270
|
+
}
|
|
1271
|
+
function b(g) {
|
|
1272
|
+
let p = 0, w = 1;
|
|
1273
|
+
const T = 10;
|
|
1274
|
+
for (; w !== T && d[w] <= g; w += 1)
|
|
1275
|
+
p += 0.1;
|
|
1276
|
+
w -= 1;
|
|
1277
|
+
const I = (g - d[w]) / (d[w + 1] - d[w]), j = p + I * 0.1, G = l(j, t, r);
|
|
1278
|
+
return G >= 1e-3 ? h(g, j) : G === 0 ? j : S(g, p, p + 0.1);
|
|
1279
|
+
}
|
|
1280
|
+
for (let g = 0; g < 11; g += 1)
|
|
1281
|
+
d[g] = m(g * 0.1, t, r);
|
|
1282
|
+
return (g) => g <= 0 ? 0 : g >= 1 ? 1 : m(b(g), e, n);
|
|
1283
|
+
}
|
|
1284
|
+
function jr(t) {
|
|
1284
1285
|
const e = /steps\(\s*([0-9]+)\s*(?:,\s*([a-z-]+)\s*)?\)/i.exec(t);
|
|
1285
1286
|
if (!e)
|
|
1286
|
-
return (o) =>
|
|
1287
|
+
return (o) => B(o);
|
|
1287
1288
|
const r = Math.max(1, parseInt(e[1], 10)), n = (e[2] ?? "end").toLowerCase();
|
|
1288
|
-
return n === "start" || n === "jump-start" ? (o) =>
|
|
1289
|
+
return n === "start" || n === "jump-start" ? (o) => B(Math.ceil(o * r) / r) : n === "none" || n === "jump-none" ? (o) => B(Math.round(o * r) / r) : n === "both" || n === "jump-both" ? (o) => B((Math.floor(o * r) + 0.5) / r) : (o) => B(Math.floor(o * r) / r);
|
|
1289
1290
|
}
|
|
1290
|
-
function
|
|
1291
|
+
function Lr(t) {
|
|
1291
1292
|
if (!t)
|
|
1292
|
-
return (r) =>
|
|
1293
|
+
return (r) => B(r);
|
|
1293
1294
|
const e = t.trim().toLowerCase();
|
|
1294
1295
|
if (!e || e === "linear")
|
|
1295
|
-
return (r) =>
|
|
1296
|
-
if (
|
|
1297
|
-
const [r, n, o, s] =
|
|
1298
|
-
return (a) =>
|
|
1296
|
+
return (r) => B(r);
|
|
1297
|
+
if (Qe[e]) {
|
|
1298
|
+
const [r, n, o, s] = Qe[e], i = rt(r, n, o, s);
|
|
1299
|
+
return (a) => B(i(B(a)));
|
|
1299
1300
|
}
|
|
1300
1301
|
if (e.startsWith("cubic-bezier(") && e.endsWith(")")) {
|
|
1301
1302
|
const n = e.slice(13, -1).split(",").map((o) => Number.parseFloat(o.trim()));
|
|
1302
1303
|
if (n.length === 4 && n.every((o) => Number.isFinite(o))) {
|
|
1303
|
-
const [o, s, i, a] = n, c =
|
|
1304
|
-
return (f) =>
|
|
1304
|
+
const [o, s, i, a] = n, c = rt(o, s, i, a);
|
|
1305
|
+
return (f) => B(c(B(f)));
|
|
1305
1306
|
}
|
|
1306
1307
|
}
|
|
1307
1308
|
if (e.startsWith("steps(") && e.endsWith(")")) {
|
|
1308
|
-
const r =
|
|
1309
|
-
return (n) => r(
|
|
1309
|
+
const r = jr(e);
|
|
1310
|
+
return (n) => r(B(n));
|
|
1310
1311
|
}
|
|
1311
|
-
return (r) =>
|
|
1312
|
+
return (r) => B(r);
|
|
1312
1313
|
}
|
|
1313
|
-
function
|
|
1314
|
+
function Ur(t) {
|
|
1314
1315
|
if (!t)
|
|
1315
1316
|
return;
|
|
1316
1317
|
const e = /(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)\s*->\s*(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)/.exec(t);
|
|
@@ -1320,7 +1321,7 @@ function jr(t) {
|
|
|
1320
1321
|
if (![r, n, o, s].some((i) => !Number.isFinite(i)))
|
|
1321
1322
|
return { inStart: r, inEnd: n, outStart: o, outEnd: s };
|
|
1322
1323
|
}
|
|
1323
|
-
class
|
|
1324
|
+
class xr {
|
|
1324
1325
|
bindingsByStyle = /* @__PURE__ */ new Map();
|
|
1325
1326
|
observer;
|
|
1326
1327
|
observeScheduled = !1;
|
|
@@ -1365,7 +1366,7 @@ class Mr {
|
|
|
1365
1366
|
const r = e.source?.trim();
|
|
1366
1367
|
if (!r)
|
|
1367
1368
|
return;
|
|
1368
|
-
const n =
|
|
1369
|
+
const n = et(e.min) ?? 0, o = et(e.max), s = o === void 0 ? n + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, c = Lr(e.ease), f = Ur(e.map), d = e.targetId?.trim() || void 0;
|
|
1369
1370
|
return Number.isNaN(n) || Number.isNaN(s) ? void 0 : {
|
|
1370
1371
|
source: r.toLowerCase(),
|
|
1371
1372
|
min: n,
|
|
@@ -1374,7 +1375,7 @@ class Mr {
|
|
|
1374
1375
|
reverse: a,
|
|
1375
1376
|
ease: c,
|
|
1376
1377
|
map: f,
|
|
1377
|
-
targetId:
|
|
1378
|
+
targetId: d
|
|
1378
1379
|
};
|
|
1379
1380
|
}
|
|
1380
1381
|
ensureObserver() {
|
|
@@ -1423,7 +1424,7 @@ class Mr {
|
|
|
1423
1424
|
const r = this.bindingsByStyle.get(e);
|
|
1424
1425
|
if (!r || typeof document > "u")
|
|
1425
1426
|
return;
|
|
1426
|
-
const n = `.${
|
|
1427
|
+
const n = `.${tt(e)}`;
|
|
1427
1428
|
document.querySelectorAll(n).forEach((s) => this.applyStyleToElement(s, e, r));
|
|
1428
1429
|
}
|
|
1429
1430
|
applyStyleToElement(e, r, n) {
|
|
@@ -1463,7 +1464,7 @@ class Mr {
|
|
|
1463
1464
|
}
|
|
1464
1465
|
resolveScrollContainer(e, r) {
|
|
1465
1466
|
if (r.targetId) {
|
|
1466
|
-
const n = `[data-ikon-motion-source="${
|
|
1467
|
+
const n = `[data-ikon-motion-source="${tt(r.targetId)}"]`, o = typeof document < "u" ? document.querySelector(n) : null;
|
|
1467
1468
|
if (o)
|
|
1468
1469
|
return o;
|
|
1469
1470
|
}
|
|
@@ -1475,8 +1476,8 @@ class Mr {
|
|
|
1475
1476
|
r.reverse && (i = 1 - i);
|
|
1476
1477
|
const a = r.ease(i), c = Number.isFinite(a) ? a : 0, f = c * 100;
|
|
1477
1478
|
if (e.style.setProperty("--tw-motion-bind-source-value", `${n}`), e.style.setProperty("--tw-motion-bind-progress-ratio", `${c}`), e.style.setProperty("--tw-motion-bind-progress", `${f}`), r.map) {
|
|
1478
|
-
const
|
|
1479
|
-
|
|
1479
|
+
const d = this.applyMap(f, r.map);
|
|
1480
|
+
d !== void 0 && e.style.setProperty("--tw-motion-bind-value", `${d}`);
|
|
1480
1481
|
} else
|
|
1481
1482
|
e.style.removeProperty("--tw-motion-bind-value");
|
|
1482
1483
|
}
|
|
@@ -1491,7 +1492,7 @@ class Mr {
|
|
|
1491
1492
|
case "unclamped":
|
|
1492
1493
|
return e;
|
|
1493
1494
|
default:
|
|
1494
|
-
return
|
|
1495
|
+
return B(e);
|
|
1495
1496
|
}
|
|
1496
1497
|
}
|
|
1497
1498
|
applyMap(e, r) {
|
|
@@ -1578,21 +1579,21 @@ class Mr {
|
|
|
1578
1579
|
}
|
|
1579
1580
|
}
|
|
1580
1581
|
}
|
|
1581
|
-
const
|
|
1582
|
-
function
|
|
1583
|
-
const e =
|
|
1582
|
+
const Te = new xr();
|
|
1583
|
+
function Dr(t) {
|
|
1584
|
+
const e = v(/* @__PURE__ */ new Map()), r = $(({ styleId: s, css: i, common: a }) => {
|
|
1584
1585
|
if (!(!s || typeof document > "u")) {
|
|
1585
1586
|
if (i) {
|
|
1586
1587
|
let c = e.current.get(s);
|
|
1587
1588
|
c || (c = document.createElement("style"), c.setAttribute("data-ikon-style-id", s), document.head.appendChild(c), e.current.set(s, c)), c.textContent = i;
|
|
1588
1589
|
}
|
|
1589
|
-
|
|
1590
|
+
Te.registerStyle(s, a);
|
|
1590
1591
|
}
|
|
1591
1592
|
}, []), n = $((s) => {
|
|
1592
1593
|
if (!(typeof document > "u"))
|
|
1593
1594
|
for (const i of s) {
|
|
1594
1595
|
const a = e.current.get(i);
|
|
1595
|
-
a && (a.remove(), e.current.delete(i)),
|
|
1596
|
+
a && (a.remove(), e.current.delete(i)), Te.unregisterStyle(i);
|
|
1596
1597
|
}
|
|
1597
1598
|
}, []), o = $(() => {
|
|
1598
1599
|
if (typeof document < "u") {
|
|
@@ -1600,9 +1601,9 @@ function Ur(t) {
|
|
|
1600
1601
|
s.remove();
|
|
1601
1602
|
e.current.clear();
|
|
1602
1603
|
}
|
|
1603
|
-
|
|
1604
|
+
Te.reset();
|
|
1604
1605
|
}, []);
|
|
1605
|
-
return
|
|
1606
|
+
return x(() => {
|
|
1606
1607
|
if (!t) return;
|
|
1607
1608
|
for (const a of t.getUiStyles())
|
|
1608
1609
|
r(a);
|
|
@@ -1610,9 +1611,9 @@ function Ur(t) {
|
|
|
1610
1611
|
return () => {
|
|
1611
1612
|
s?.(), i?.(), o();
|
|
1612
1613
|
};
|
|
1613
|
-
}, [t, o, r, n]),
|
|
1614
|
+
}, [t, o, r, n]), x(() => () => o(), [o]), { setStyle: r, deleteStyles: n, reset: o };
|
|
1614
1615
|
}
|
|
1615
|
-
function
|
|
1616
|
+
function Fr(t) {
|
|
1616
1617
|
const e = [];
|
|
1617
1618
|
for (const [r, n] of t) {
|
|
1618
1619
|
const o = n.store.getSnapshot(), s = o.rootViewId && o.views.has(o.rootViewId);
|
|
@@ -1620,62 +1621,62 @@ function Lr(t) {
|
|
|
1620
1621
|
}
|
|
1621
1622
|
return e.sort(), e.join(",");
|
|
1622
1623
|
}
|
|
1623
|
-
function
|
|
1624
|
-
const [e, r] =
|
|
1625
|
-
return
|
|
1624
|
+
function Br(t) {
|
|
1625
|
+
const [e, r] = X(), n = v("");
|
|
1626
|
+
return x(() => {
|
|
1626
1627
|
if (!t) {
|
|
1627
1628
|
r(void 0), n.current = "";
|
|
1628
1629
|
return;
|
|
1629
1630
|
}
|
|
1630
1631
|
const o = () => {
|
|
1631
|
-
const s = t.getStores(), i =
|
|
1632
|
+
const s = t.getStores(), i = Fr(s);
|
|
1632
1633
|
i !== n.current && (n.current = i, r(s));
|
|
1633
1634
|
};
|
|
1634
1635
|
return o(), t.subscribe(o);
|
|
1635
1636
|
}, [t]), e;
|
|
1636
1637
|
}
|
|
1637
|
-
var
|
|
1638
|
-
function
|
|
1639
|
-
var e =
|
|
1638
|
+
var $r = typeof global == "object" && global && global.Object === Object && global, Vr = typeof self == "object" && self && self.Object === Object && self, Kr = $r || Vr || Function("return this")(), Se = Kr.Symbol, mt = Object.prototype, Yr = mt.hasOwnProperty, zr = mt.toString, ue = Se ? Se.toStringTag : void 0;
|
|
1639
|
+
function Wr(t) {
|
|
1640
|
+
var e = Yr.call(t, ue), r = t[ue];
|
|
1640
1641
|
try {
|
|
1641
1642
|
t[ue] = void 0;
|
|
1642
1643
|
var n = !0;
|
|
1643
1644
|
} catch {
|
|
1644
1645
|
}
|
|
1645
|
-
var o =
|
|
1646
|
+
var o = zr.call(t);
|
|
1646
1647
|
return n && (e ? t[ue] = r : delete t[ue]), o;
|
|
1647
1648
|
}
|
|
1648
|
-
var
|
|
1649
|
-
function
|
|
1650
|
-
return
|
|
1649
|
+
var qr = Object.prototype, Gr = qr.toString;
|
|
1650
|
+
function Hr(t) {
|
|
1651
|
+
return Gr.call(t);
|
|
1651
1652
|
}
|
|
1652
|
-
var
|
|
1653
|
-
function
|
|
1654
|
-
return t == null ? t === void 0 ?
|
|
1653
|
+
var Jr = "[object Null]", Xr = "[object Undefined]", nt = Se ? Se.toStringTag : void 0;
|
|
1654
|
+
function Zr(t) {
|
|
1655
|
+
return t == null ? t === void 0 ? Xr : Jr : nt && nt in Object(t) ? Wr(t) : Hr(t);
|
|
1655
1656
|
}
|
|
1656
|
-
function
|
|
1657
|
+
function Qr(t) {
|
|
1657
1658
|
return t != null && typeof t == "object";
|
|
1658
1659
|
}
|
|
1659
|
-
var
|
|
1660
|
-
function
|
|
1661
|
-
return typeof t == "string" || !
|
|
1660
|
+
var en = Array.isArray, tn = "[object String]";
|
|
1661
|
+
function rn(t) {
|
|
1662
|
+
return typeof t == "string" || !en(t) && Qr(t) && Zr(t) == tn;
|
|
1662
1663
|
}
|
|
1663
|
-
const
|
|
1664
|
-
function
|
|
1664
|
+
const ot = "ikonUiModules";
|
|
1665
|
+
function Le(t) {
|
|
1665
1666
|
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
1666
1667
|
}
|
|
1667
|
-
function
|
|
1668
|
+
function nn(t) {
|
|
1668
1669
|
if (!Array.isArray(t))
|
|
1669
1670
|
return;
|
|
1670
1671
|
const e = /* @__PURE__ */ new Set();
|
|
1671
1672
|
for (const r of t) {
|
|
1672
|
-
if (!
|
|
1673
|
+
if (!rn(r)) continue;
|
|
1673
1674
|
const n = r.trim();
|
|
1674
1675
|
n && (e.has(n) || e.add(n));
|
|
1675
1676
|
}
|
|
1676
1677
|
return Array.from(e);
|
|
1677
1678
|
}
|
|
1678
|
-
function
|
|
1679
|
+
function no(t, e) {
|
|
1679
1680
|
if (t === e)
|
|
1680
1681
|
return !0;
|
|
1681
1682
|
if (!t || !e)
|
|
@@ -1687,19 +1688,19 @@ function Xn(t, e) {
|
|
|
1687
1688
|
return !1;
|
|
1688
1689
|
return !0;
|
|
1689
1690
|
}
|
|
1690
|
-
function
|
|
1691
|
-
if (!(!
|
|
1692
|
-
return
|
|
1691
|
+
function on(t) {
|
|
1692
|
+
if (!(!Le(t) || !Object.prototype.hasOwnProperty.call(t, ot)))
|
|
1693
|
+
return nn(t[ot]);
|
|
1693
1694
|
}
|
|
1694
|
-
function
|
|
1695
|
+
function oo(...t) {
|
|
1695
1696
|
for (const e of t) {
|
|
1696
|
-
const r =
|
|
1697
|
+
const r = on(e);
|
|
1697
1698
|
if (r !== void 0)
|
|
1698
1699
|
return r;
|
|
1699
1700
|
}
|
|
1700
1701
|
}
|
|
1701
|
-
function
|
|
1702
|
-
if (!
|
|
1702
|
+
function so(t) {
|
|
1703
|
+
if (!Le(t))
|
|
1703
1704
|
return;
|
|
1704
1705
|
const e = t, r = Object.keys(e).find((c) => c.toLowerCase() === "modules");
|
|
1705
1706
|
if (!r)
|
|
@@ -1712,25 +1713,25 @@ function Qn(t) {
|
|
|
1712
1713
|
const o = [], s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set();
|
|
1713
1714
|
for (const c of n) {
|
|
1714
1715
|
if (typeof c == "string") {
|
|
1715
|
-
const
|
|
1716
|
-
if (!
|
|
1716
|
+
const b = c.trim();
|
|
1717
|
+
if (!b || i.has(b))
|
|
1717
1718
|
continue;
|
|
1718
|
-
o.push(
|
|
1719
|
+
o.push(b), i.add(b);
|
|
1719
1720
|
continue;
|
|
1720
1721
|
}
|
|
1721
|
-
if (!
|
|
1722
|
+
if (!Le(c))
|
|
1722
1723
|
continue;
|
|
1723
|
-
const f = c,
|
|
1724
|
-
if (!
|
|
1724
|
+
const f = c, d = Object.keys(f).find((b) => b.toLowerCase() === "name");
|
|
1725
|
+
if (!d)
|
|
1725
1726
|
continue;
|
|
1726
|
-
const m = f[
|
|
1727
|
+
const m = f[d];
|
|
1727
1728
|
if (typeof m != "string")
|
|
1728
1729
|
continue;
|
|
1729
|
-
const
|
|
1730
|
-
if (!
|
|
1730
|
+
const l = m.trim();
|
|
1731
|
+
if (!l)
|
|
1731
1732
|
continue;
|
|
1732
|
-
const
|
|
1733
|
-
typeof
|
|
1733
|
+
const h = Object.keys(f).find((b) => b.toLowerCase() === "javascript"), S = h ? f[h] : void 0;
|
|
1734
|
+
typeof S == "string" && s.set(l, S), i.has(l) || (o.push(l), i.add(l));
|
|
1734
1735
|
}
|
|
1735
1736
|
if (!o.length && s.size === 0)
|
|
1736
1737
|
return { modules: [] };
|
|
@@ -1740,16 +1741,16 @@ function Qn(t) {
|
|
|
1740
1741
|
}));
|
|
1741
1742
|
return a.length > 0 ? { modules: o, inlineModules: a } : { modules: o };
|
|
1742
1743
|
}
|
|
1743
|
-
const
|
|
1744
|
+
const E = {
|
|
1744
1745
|
None: 0,
|
|
1745
1746
|
Letter: 1,
|
|
1746
1747
|
Word: 2,
|
|
1747
1748
|
Line: 4,
|
|
1748
1749
|
Paragraph: 8,
|
|
1749
1750
|
Emoji: 16
|
|
1750
|
-
},
|
|
1751
|
+
}, sn = [
|
|
1751
1752
|
{
|
|
1752
|
-
flag:
|
|
1753
|
+
flag: E.Letter,
|
|
1753
1754
|
hints: [
|
|
1754
1755
|
"[data-motion-letter]",
|
|
1755
1756
|
"[data-letter]",
|
|
@@ -1758,7 +1759,7 @@ const v = {
|
|
|
1758
1759
|
]
|
|
1759
1760
|
},
|
|
1760
1761
|
{
|
|
1761
|
-
flag:
|
|
1762
|
+
flag: E.Word,
|
|
1762
1763
|
hints: [
|
|
1763
1764
|
"[data-motion-word]",
|
|
1764
1765
|
"[data-word]",
|
|
@@ -1767,7 +1768,7 @@ const v = {
|
|
|
1767
1768
|
]
|
|
1768
1769
|
},
|
|
1769
1770
|
{
|
|
1770
|
-
flag:
|
|
1771
|
+
flag: E.Line,
|
|
1771
1772
|
hints: [
|
|
1772
1773
|
"[data-motion-line]",
|
|
1773
1774
|
"[data-line]",
|
|
@@ -1776,7 +1777,7 @@ const v = {
|
|
|
1776
1777
|
]
|
|
1777
1778
|
},
|
|
1778
1779
|
{
|
|
1779
|
-
flag:
|
|
1780
|
+
flag: E.Paragraph,
|
|
1780
1781
|
hints: [
|
|
1781
1782
|
"[data-motion-paragraph]",
|
|
1782
1783
|
"[data-paragraph]",
|
|
@@ -1787,7 +1788,7 @@ const v = {
|
|
|
1787
1788
|
]
|
|
1788
1789
|
},
|
|
1789
1790
|
{
|
|
1790
|
-
flag:
|
|
1791
|
+
flag: E.Emoji,
|
|
1791
1792
|
hints: [
|
|
1792
1793
|
":is([data-motion-emoji],[data-emoji],.tw-motion-emoji,.tw-emoji)",
|
|
1793
1794
|
"[data-motion-emoji]",
|
|
@@ -1796,38 +1797,38 @@ const v = {
|
|
|
1796
1797
|
"[data-emoji]"
|
|
1797
1798
|
]
|
|
1798
1799
|
}
|
|
1799
|
-
],
|
|
1800
|
-
function
|
|
1801
|
-
if (!t || t.length >
|
|
1800
|
+
], Ue = E.Letter | E.Word | E.Line | E.Paragraph | E.Emoji, an = E.Letter | E.Word | E.Line | E.Paragraph, st = /* @__PURE__ */ new Map(), cn = 16384;
|
|
1801
|
+
function io(t, e) {
|
|
1802
|
+
if (!t || t.length > cn)
|
|
1802
1803
|
return t;
|
|
1803
|
-
const r =
|
|
1804
|
-
if (o ===
|
|
1804
|
+
const r = Tn(e), n = re(r, E.Emoji), o = r & an;
|
|
1805
|
+
if (o === E.None && !n)
|
|
1805
1806
|
return t;
|
|
1806
1807
|
const s = t.replace(/\r\n/g, `
|
|
1807
1808
|
`).replace(/\r/g, `
|
|
1808
1809
|
`);
|
|
1809
|
-
if (o ===
|
|
1810
|
-
return
|
|
1811
|
-
const i =
|
|
1810
|
+
if (o === E.None)
|
|
1811
|
+
return ut(s);
|
|
1812
|
+
const i = Rn(s);
|
|
1812
1813
|
if (i.length === 0)
|
|
1813
|
-
return n ?
|
|
1814
|
-
const a =
|
|
1815
|
-
for (const
|
|
1816
|
-
const m =
|
|
1814
|
+
return n ? ut(s) : t;
|
|
1815
|
+
const a = An(i), c = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, f = [];
|
|
1816
|
+
for (const d of a) {
|
|
1817
|
+
const m = un(d, r, c);
|
|
1817
1818
|
f.push(...m);
|
|
1818
1819
|
}
|
|
1819
1820
|
return f;
|
|
1820
1821
|
}
|
|
1821
|
-
function
|
|
1822
|
+
function un(t, e, r) {
|
|
1822
1823
|
const n = [];
|
|
1823
1824
|
for (const o of t) {
|
|
1824
|
-
const s =
|
|
1825
|
+
const s = ln(o, e, r);
|
|
1825
1826
|
n.push(...s);
|
|
1826
1827
|
}
|
|
1827
|
-
if (re(e,
|
|
1828
|
+
if (re(e, E.Paragraph)) {
|
|
1828
1829
|
const o = r.paragraph++;
|
|
1829
1830
|
return [
|
|
1830
|
-
/* @__PURE__ */
|
|
1831
|
+
/* @__PURE__ */ A.jsx(
|
|
1831
1832
|
"span",
|
|
1832
1833
|
{
|
|
1833
1834
|
"data-motion-paragraph": !0,
|
|
@@ -1840,70 +1841,70 @@ function sn(t, e, r) {
|
|
|
1840
1841
|
}
|
|
1841
1842
|
return n;
|
|
1842
1843
|
}
|
|
1843
|
-
function
|
|
1844
|
-
const n =
|
|
1845
|
-
if (re(e,
|
|
1844
|
+
function ln(t, e, r) {
|
|
1845
|
+
const n = dn(t.text, e, r), o = [];
|
|
1846
|
+
if (re(e, E.Line)) {
|
|
1846
1847
|
const s = r.line++;
|
|
1847
1848
|
o.push(
|
|
1848
|
-
/* @__PURE__ */
|
|
1849
|
+
/* @__PURE__ */ A.jsx("span", { "data-motion-line": !0, style: ve(s), children: n }, `motion-line-${s}`)
|
|
1849
1850
|
);
|
|
1850
1851
|
} else
|
|
1851
1852
|
o.push(...n);
|
|
1852
1853
|
for (let s = 0; s < t.breaks; s++)
|
|
1853
|
-
o.push(/* @__PURE__ */
|
|
1854
|
+
o.push(/* @__PURE__ */ A.jsx("br", {}, `motion-break-${r.br++}`));
|
|
1854
1855
|
return o;
|
|
1855
1856
|
}
|
|
1856
|
-
function
|
|
1857
|
+
function dn(t, e, r) {
|
|
1857
1858
|
if (!t)
|
|
1858
1859
|
return [];
|
|
1859
|
-
const n = re(e,
|
|
1860
|
+
const n = re(e, E.Word), o = [], s = /(\s+)/g;
|
|
1860
1861
|
let i = 0, a;
|
|
1861
1862
|
for (; (a = s.exec(t)) !== null; ) {
|
|
1862
1863
|
if (a.index > i) {
|
|
1863
1864
|
const c = t.slice(i, a.index);
|
|
1864
|
-
o.push(
|
|
1865
|
+
o.push(it(c, r, e, n));
|
|
1865
1866
|
}
|
|
1866
1867
|
o.push(a[0]), i = a.index + a[0].length;
|
|
1867
1868
|
}
|
|
1868
1869
|
if (i < t.length) {
|
|
1869
1870
|
const c = t.slice(i);
|
|
1870
|
-
o.push(
|
|
1871
|
+
o.push(it(c, r, e, n));
|
|
1871
1872
|
}
|
|
1872
1873
|
return o;
|
|
1873
1874
|
}
|
|
1874
|
-
function
|
|
1875
|
-
const o = e.word++, s =
|
|
1876
|
-
return n ? /* @__PURE__ */
|
|
1875
|
+
function it(t, e, r, n) {
|
|
1876
|
+
const o = e.word++, s = hn(t, r, e), i = `motion-word-${o}`, a = fn(o, n);
|
|
1877
|
+
return n ? /* @__PURE__ */ A.jsx("span", { "data-motion-word": !0, style: a, children: s }, i) : /* @__PURE__ */ A.jsx("span", { style: a, children: s }, i);
|
|
1877
1878
|
}
|
|
1878
|
-
function
|
|
1879
|
+
function fn(t, e) {
|
|
1879
1880
|
return e ? { ...ve(t), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
|
|
1880
1881
|
}
|
|
1881
|
-
function
|
|
1882
|
+
function hn(t, e, r) {
|
|
1882
1883
|
if (!t)
|
|
1883
1884
|
return [];
|
|
1884
|
-
const n = re(e,
|
|
1885
|
+
const n = re(e, E.Letter), o = re(e, E.Emoji);
|
|
1885
1886
|
if (!n) {
|
|
1886
1887
|
if (!o)
|
|
1887
1888
|
return [t];
|
|
1888
1889
|
const a = xe(t);
|
|
1889
1890
|
if (a.length === 0)
|
|
1890
1891
|
return [t];
|
|
1891
|
-
const { nodes: c } =
|
|
1892
|
+
const { nodes: c } = gt(a, r);
|
|
1892
1893
|
return c;
|
|
1893
1894
|
}
|
|
1894
1895
|
const s = [], i = xe(t);
|
|
1895
1896
|
for (const a of i) {
|
|
1896
|
-
const c = r.letter++, f = `motion-letter-${c}`,
|
|
1897
|
+
const c = r.letter++, f = `motion-letter-${c}`, d = ve(c);
|
|
1897
1898
|
if (a === `
|
|
1898
1899
|
`) {
|
|
1899
1900
|
s.push(
|
|
1900
|
-
/* @__PURE__ */
|
|
1901
|
+
/* @__PURE__ */ A.jsx("span", { "data-motion-letter": !0, style: d, children: /* @__PURE__ */ A.jsx("br", {}) }, f)
|
|
1901
1902
|
);
|
|
1902
1903
|
continue;
|
|
1903
1904
|
}
|
|
1904
|
-
const
|
|
1905
|
+
const l = o && pt(a) ? { "data-motion-emoji": !0 } : void 0, h = a === " " ? " " : a;
|
|
1905
1906
|
s.push(
|
|
1906
|
-
/* @__PURE__ */
|
|
1907
|
+
/* @__PURE__ */ A.jsx("span", { "data-motion-letter": !0, style: d, ...l, children: h }, f)
|
|
1907
1908
|
);
|
|
1908
1909
|
}
|
|
1909
1910
|
return s;
|
|
@@ -1911,45 +1912,45 @@ function ln(t, e, r) {
|
|
|
1911
1912
|
function xe(t) {
|
|
1912
1913
|
if (!t)
|
|
1913
1914
|
return [];
|
|
1914
|
-
const e =
|
|
1915
|
-
return e ? Array.from(e.segment(t), (r) => r.segment) :
|
|
1915
|
+
const e = mn();
|
|
1916
|
+
return e ? Array.from(e.segment(t), (r) => r.segment) : pn(t);
|
|
1916
1917
|
}
|
|
1917
1918
|
let le;
|
|
1918
|
-
function
|
|
1919
|
+
function mn() {
|
|
1919
1920
|
return le !== void 0 || (typeof Intl < "u" && typeof Intl.Segmenter == "function" ? le = new Intl.Segmenter(void 0, { granularity: "grapheme" }) : le = null), le;
|
|
1920
1921
|
}
|
|
1921
|
-
function
|
|
1922
|
+
function pn(t) {
|
|
1922
1923
|
const e = [], r = Array.from(t);
|
|
1923
1924
|
let n = "";
|
|
1924
1925
|
for (let o = 0; o < r.length; o++) {
|
|
1925
1926
|
const s = r[o], i = r[o + 1];
|
|
1926
|
-
n += s, !(i &&
|
|
1927
|
+
n += s, !(i && gn(s, i)) && (e.push(n), n = "");
|
|
1927
1928
|
}
|
|
1928
1929
|
return n && e.push(n), e;
|
|
1929
1930
|
}
|
|
1930
|
-
function
|
|
1931
|
-
return e ? !!(
|
|
1931
|
+
function gn(t, e) {
|
|
1932
|
+
return e ? !!(at(t) || at(e) || bn(e) || yn(e) || Sn(e) || ct(t) && ct(e)) : !1;
|
|
1932
1933
|
}
|
|
1933
|
-
function
|
|
1934
|
+
function at(t) {
|
|
1934
1935
|
return t.codePointAt(0) === 8205;
|
|
1935
1936
|
}
|
|
1936
|
-
function
|
|
1937
|
+
function yn(t) {
|
|
1937
1938
|
const e = t.codePointAt(0);
|
|
1938
1939
|
return e === void 0 ? !1 : e >= 65024 && e <= 65039 || e >= 917760 && e <= 917999;
|
|
1939
1940
|
}
|
|
1940
|
-
function
|
|
1941
|
+
function Sn(t) {
|
|
1941
1942
|
const e = t.codePointAt(0);
|
|
1942
1943
|
return e === void 0 ? !1 : e >= 127995 && e <= 127999;
|
|
1943
1944
|
}
|
|
1944
|
-
function
|
|
1945
|
+
function ct(t) {
|
|
1945
1946
|
const e = t.codePointAt(0);
|
|
1946
1947
|
return e === void 0 ? !1 : e >= 127462 && e <= 127487;
|
|
1947
1948
|
}
|
|
1948
|
-
let
|
|
1949
|
-
function
|
|
1950
|
-
return t ? (
|
|
1949
|
+
let ke;
|
|
1950
|
+
function bn(t) {
|
|
1951
|
+
return t ? (ke || (ke = wn()), ke(t)) : !1;
|
|
1951
1952
|
}
|
|
1952
|
-
function
|
|
1953
|
+
function wn() {
|
|
1953
1954
|
try {
|
|
1954
1955
|
const t = new RegExp("\\p{Mark}", "u");
|
|
1955
1956
|
return (e) => t.test(e);
|
|
@@ -1961,18 +1962,18 @@ function yn() {
|
|
|
1961
1962
|
}
|
|
1962
1963
|
}
|
|
1963
1964
|
let Ce;
|
|
1964
|
-
function
|
|
1965
|
-
return t ? (Ce || (Ce =
|
|
1965
|
+
function pt(t) {
|
|
1966
|
+
return t ? (Ce || (Ce = vn()), Ce(t)) : !1;
|
|
1966
1967
|
}
|
|
1967
|
-
function
|
|
1968
|
+
function vn() {
|
|
1968
1969
|
try {
|
|
1969
1970
|
const t = new RegExp("\\p{Extended_Pictographic}", "u");
|
|
1970
1971
|
return (e) => t.test(e);
|
|
1971
1972
|
} catch {
|
|
1972
|
-
return
|
|
1973
|
+
return En;
|
|
1973
1974
|
}
|
|
1974
1975
|
}
|
|
1975
|
-
function
|
|
1976
|
+
function En(t) {
|
|
1976
1977
|
if (!t)
|
|
1977
1978
|
return !1;
|
|
1978
1979
|
for (const e of Array.from(t)) {
|
|
@@ -1982,7 +1983,7 @@ function bn(t) {
|
|
|
1982
1983
|
}
|
|
1983
1984
|
return !1;
|
|
1984
1985
|
}
|
|
1985
|
-
function
|
|
1986
|
+
function Rn(t) {
|
|
1986
1987
|
const e = [];
|
|
1987
1988
|
let r = "", n = 0;
|
|
1988
1989
|
for (let o = 0; o < t.length; o++) {
|
|
@@ -1996,7 +1997,7 @@ function wn(t) {
|
|
|
1996
1997
|
}
|
|
1997
1998
|
return (n > 0 || r.length > 0) && e.push({ text: r, breaks: n }), e;
|
|
1998
1999
|
}
|
|
1999
|
-
function
|
|
2000
|
+
function An(t) {
|
|
2000
2001
|
if (t.length === 0)
|
|
2001
2002
|
return [];
|
|
2002
2003
|
const e = [];
|
|
@@ -2025,27 +2026,27 @@ function ve(t) {
|
|
|
2025
2026
|
WebkitTextFillColor: "inherit"
|
|
2026
2027
|
};
|
|
2027
2028
|
}
|
|
2028
|
-
function
|
|
2029
|
+
function ut(t) {
|
|
2029
2030
|
if (!t)
|
|
2030
2031
|
return t;
|
|
2031
2032
|
const e = xe(t);
|
|
2032
2033
|
if (e.length === 0)
|
|
2033
2034
|
return t;
|
|
2034
|
-
const { nodes: r, sawEmoji: n } =
|
|
2035
|
+
const { nodes: r, sawEmoji: n } = gt(e);
|
|
2035
2036
|
return n ? r.length === 1 ? r[0] ?? t : r : t;
|
|
2036
2037
|
}
|
|
2037
|
-
function
|
|
2038
|
+
function gt(t, e) {
|
|
2038
2039
|
const r = [];
|
|
2039
2040
|
let n = "", o = !1, s = e?.emoji ?? 0;
|
|
2040
2041
|
const i = () => {
|
|
2041
2042
|
n && (r.push(n), n = "");
|
|
2042
2043
|
};
|
|
2043
2044
|
for (const a of t) {
|
|
2044
|
-
if (
|
|
2045
|
+
if (pt(a)) {
|
|
2045
2046
|
o = !0, i();
|
|
2046
2047
|
const f = `motion-emoji-${e ? e.emoji++ : s++}`;
|
|
2047
2048
|
r.push(
|
|
2048
|
-
/* @__PURE__ */
|
|
2049
|
+
/* @__PURE__ */ A.jsx("span", { "data-motion-emoji": !0, children: a }, f)
|
|
2049
2050
|
);
|
|
2050
2051
|
continue;
|
|
2051
2052
|
}
|
|
@@ -2053,24 +2054,24 @@ function pt(t, e) {
|
|
|
2053
2054
|
}
|
|
2054
2055
|
return i(), o ? { nodes: r, sawEmoji: !0 } : { nodes: [t.join("")], sawEmoji: !1 };
|
|
2055
2056
|
}
|
|
2056
|
-
function
|
|
2057
|
+
function Tn(t) {
|
|
2057
2058
|
if (!t)
|
|
2058
|
-
return
|
|
2059
|
+
return E.None;
|
|
2059
2060
|
const e = t.trim();
|
|
2060
2061
|
if (!e)
|
|
2061
|
-
return
|
|
2062
|
-
const r =
|
|
2062
|
+
return E.None;
|
|
2063
|
+
const r = st.get(e);
|
|
2063
2064
|
if (typeof r == "number")
|
|
2064
2065
|
return r;
|
|
2065
2066
|
if (typeof document > "u")
|
|
2066
|
-
return
|
|
2067
|
+
return E.None;
|
|
2067
2068
|
const n = e.split(/\s+/).filter(Boolean);
|
|
2068
2069
|
if (n.length === 0)
|
|
2069
|
-
return
|
|
2070
|
-
const s = n.map((c) => `.${
|
|
2071
|
-
(c) => new RegExp(`(^|[^a-zA-Z0-9_-])${
|
|
2070
|
+
return E.None;
|
|
2071
|
+
const s = n.map((c) => `.${kn(c)}`).map(
|
|
2072
|
+
(c) => new RegExp(`(^|[^a-zA-Z0-9_-])${Cn(c)}(?![a-zA-Z0-9_-])`)
|
|
2072
2073
|
);
|
|
2073
|
-
let i =
|
|
2074
|
+
let i = E.None, a = !1;
|
|
2074
2075
|
for (const c of Array.from(document.styleSheets)) {
|
|
2075
2076
|
let f;
|
|
2076
2077
|
try {
|
|
@@ -2078,17 +2079,17 @@ function Rn(t) {
|
|
|
2078
2079
|
} catch {
|
|
2079
2080
|
continue;
|
|
2080
2081
|
}
|
|
2081
|
-
const
|
|
2082
|
-
if (
|
|
2082
|
+
const d = yt(f, s);
|
|
2083
|
+
if (d.mask && (i |= d.mask, i === Ue))
|
|
2083
2084
|
break;
|
|
2084
|
-
a ||=
|
|
2085
|
+
a ||= d.sawStyleRule;
|
|
2085
2086
|
}
|
|
2086
|
-
return (i !==
|
|
2087
|
+
return (i !== E.None || a) && st.set(e, i), i;
|
|
2087
2088
|
}
|
|
2088
|
-
function
|
|
2089
|
+
function yt(t, e) {
|
|
2089
2090
|
if (!t)
|
|
2090
|
-
return { mask:
|
|
2091
|
-
let r =
|
|
2091
|
+
return { mask: E.None, sawStyleRule: !1 };
|
|
2092
|
+
let r = E.None, n = !1;
|
|
2092
2093
|
for (let o = 0; o < t.length; o++) {
|
|
2093
2094
|
const s = t[o];
|
|
2094
2095
|
if (s) {
|
|
@@ -2096,13 +2097,13 @@ function gt(t, e) {
|
|
|
2096
2097
|
const a = s.selectorText ?? "";
|
|
2097
2098
|
if (!a || !e.some((f) => f.test(a))) continue;
|
|
2098
2099
|
n = !0;
|
|
2099
|
-
for (const f of
|
|
2100
|
-
f.hints.some((
|
|
2101
|
-
if (r ===
|
|
2100
|
+
for (const f of sn)
|
|
2101
|
+
f.hints.some((d) => a.includes(d)) && (r |= f.flag);
|
|
2102
|
+
if (r === Ue)
|
|
2102
2103
|
return { mask: r, sawStyleRule: !0 };
|
|
2103
2104
|
} else if ("cssRules" in s) {
|
|
2104
|
-
const i =
|
|
2105
|
-
if (i.mask && (r |= i.mask, r ===
|
|
2105
|
+
const i = yt(s.cssRules, e);
|
|
2106
|
+
if (i.mask && (r |= i.mask, r === Ue))
|
|
2106
2107
|
return { mask: r, sawStyleRule: !0 };
|
|
2107
2108
|
n ||= i.sawStyleRule;
|
|
2108
2109
|
}
|
|
@@ -2110,31 +2111,31 @@ function gt(t, e) {
|
|
|
2110
2111
|
}
|
|
2111
2112
|
return { mask: r, sawStyleRule: n };
|
|
2112
2113
|
}
|
|
2113
|
-
function
|
|
2114
|
+
function kn(t) {
|
|
2114
2115
|
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
2115
2116
|
}
|
|
2116
|
-
function
|
|
2117
|
+
function Cn(t) {
|
|
2117
2118
|
return t.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
|
|
2118
2119
|
}
|
|
2119
|
-
const Ve = "ikon_auth_session",
|
|
2120
|
-
function
|
|
2120
|
+
const Ve = "ikon_auth_session", In = 7 * 24 * 60 * 60 * 1e3;
|
|
2121
|
+
function Ee(t) {
|
|
2121
2122
|
try {
|
|
2122
2123
|
localStorage.setItem(Ve, JSON.stringify(t));
|
|
2123
2124
|
} catch {
|
|
2124
2125
|
console.warn("Failed to save auth session to localStorage");
|
|
2125
2126
|
}
|
|
2126
2127
|
}
|
|
2127
|
-
function
|
|
2128
|
+
function St() {
|
|
2128
2129
|
try {
|
|
2129
2130
|
const t = localStorage.getItem(Ve);
|
|
2130
2131
|
if (!t) return null;
|
|
2131
2132
|
const e = JSON.parse(t);
|
|
2132
|
-
return Date.now() - e.authenticatedAt >
|
|
2133
|
+
return Date.now() - e.authenticatedAt > In ? (bt(), null) : e;
|
|
2133
2134
|
} catch {
|
|
2134
2135
|
return console.warn("Failed to load auth session from localStorage"), null;
|
|
2135
2136
|
}
|
|
2136
2137
|
}
|
|
2137
|
-
function
|
|
2138
|
+
function bt() {
|
|
2138
2139
|
try {
|
|
2139
2140
|
localStorage.removeItem(Ve);
|
|
2140
2141
|
} catch {
|
|
@@ -2149,8 +2150,8 @@ function de(t) {
|
|
|
2149
2150
|
authenticatedAt: t.authenticatedAt
|
|
2150
2151
|
};
|
|
2151
2152
|
}
|
|
2152
|
-
async function
|
|
2153
|
-
const r =
|
|
2153
|
+
async function wt(t, e) {
|
|
2154
|
+
const r = ge(), n = await fetch(`${e}/anonymous`, {
|
|
2154
2155
|
method: "POST",
|
|
2155
2156
|
headers: { "Content-Type": "application/json" },
|
|
2156
2157
|
body: JSON.stringify({ deviceId: r, space: t })
|
|
@@ -2164,9 +2165,9 @@ async function bt(t, e) {
|
|
|
2164
2165
|
provider: "anonymous",
|
|
2165
2166
|
authenticatedAt: Date.now()
|
|
2166
2167
|
};
|
|
2167
|
-
return
|
|
2168
|
+
return Ee(s), s;
|
|
2168
2169
|
}
|
|
2169
|
-
async function
|
|
2170
|
+
async function ao(t) {
|
|
2170
2171
|
const { email: e, spaceId: r, authUrl: n, returnUrl: o = window.location.origin + window.location.pathname } = t, s = await fetch(`${n}/email/send`, {
|
|
2171
2172
|
method: "POST",
|
|
2172
2173
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2181,22 +2182,22 @@ async function to(t) {
|
|
|
2181
2182
|
throw new Error(i);
|
|
2182
2183
|
}
|
|
2183
2184
|
}
|
|
2184
|
-
function
|
|
2185
|
+
function On() {
|
|
2185
2186
|
const t = new URLSearchParams(window.location.search), e = t.get("ikon_token"), r = t.get("ikon_provider");
|
|
2186
2187
|
return e && r ? { token: e, provider: r } : null;
|
|
2187
2188
|
}
|
|
2188
|
-
function
|
|
2189
|
+
function _n() {
|
|
2189
2190
|
const e = new URLSearchParams(window.location.search).get("error");
|
|
2190
2191
|
return e ? decodeURIComponent(e) : null;
|
|
2191
2192
|
}
|
|
2192
|
-
function
|
|
2193
|
+
function lt() {
|
|
2193
2194
|
window.history.replaceState({}, "", window.location.pathname);
|
|
2194
2195
|
}
|
|
2195
|
-
function
|
|
2196
|
+
function Nn(t, e, r, n) {
|
|
2196
2197
|
const o = n ?? window.location.origin + window.location.pathname + window.location.search;
|
|
2197
2198
|
return `${r}/oauth/${t}?space=${encodeURIComponent(e)}&return=${encodeURIComponent(o)}`;
|
|
2198
2199
|
}
|
|
2199
|
-
async function
|
|
2200
|
+
async function Pn(t) {
|
|
2200
2201
|
const e = await fetch(`${t}/passkey/registration/options`, {
|
|
2201
2202
|
method: "POST",
|
|
2202
2203
|
headers: { "Content-Type": "application/json" }
|
|
@@ -2207,7 +2208,7 @@ async function On(t) {
|
|
|
2207
2208
|
}
|
|
2208
2209
|
return e.json();
|
|
2209
2210
|
}
|
|
2210
|
-
async function
|
|
2211
|
+
async function Mn(t, e, r) {
|
|
2211
2212
|
const n = await fetch(`${t}/passkey/registration/verify`, {
|
|
2212
2213
|
method: "POST",
|
|
2213
2214
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2222,9 +2223,9 @@ async function Nn(t, e, r) {
|
|
|
2222
2223
|
provider: "passkey",
|
|
2223
2224
|
authenticatedAt: Date.now()
|
|
2224
2225
|
};
|
|
2225
|
-
return
|
|
2226
|
+
return Ee(s), s;
|
|
2226
2227
|
}
|
|
2227
|
-
async function
|
|
2228
|
+
async function jn(t, e) {
|
|
2228
2229
|
const r = await fetch(`${t}/passkey/authentication/options`, {
|
|
2229
2230
|
method: "POST",
|
|
2230
2231
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2236,7 +2237,7 @@ async function _n(t, e) {
|
|
|
2236
2237
|
}
|
|
2237
2238
|
return r.json();
|
|
2238
2239
|
}
|
|
2239
|
-
async function
|
|
2240
|
+
async function Ln(t, e) {
|
|
2240
2241
|
const r = await fetch(`${t}/passkey/authentication/verify`, {
|
|
2241
2242
|
method: "POST",
|
|
2242
2243
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2251,7 +2252,7 @@ async function Pn(t, e) {
|
|
|
2251
2252
|
provider: "passkey",
|
|
2252
2253
|
authenticatedAt: Date.now()
|
|
2253
2254
|
};
|
|
2254
|
-
return
|
|
2255
|
+
return Ee(o), o;
|
|
2255
2256
|
}
|
|
2256
2257
|
function W(t) {
|
|
2257
2258
|
const e = new Uint8Array(t);
|
|
@@ -2260,23 +2261,23 @@ function W(t) {
|
|
|
2260
2261
|
r += String.fromCharCode(o);
|
|
2261
2262
|
return btoa(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
2262
2263
|
}
|
|
2263
|
-
function
|
|
2264
|
+
function be(t) {
|
|
2264
2265
|
const e = t.replace(/-/g, "+").replace(/_/g, "/"), r = (4 - e.length % 4) % 4, n = e.padEnd(e.length + r, "="), o = atob(n), s = new ArrayBuffer(o.length), i = new Uint8Array(s);
|
|
2265
2266
|
for (let a = 0; a < o.length; a++)
|
|
2266
2267
|
i[a] = o.charCodeAt(a);
|
|
2267
2268
|
return s;
|
|
2268
2269
|
}
|
|
2269
2270
|
function Ke() {
|
|
2270
|
-
return
|
|
2271
|
+
return Un.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
|
|
2271
2272
|
}
|
|
2272
|
-
const
|
|
2273
|
+
const Un = {
|
|
2273
2274
|
stubThis: (t) => t
|
|
2274
2275
|
};
|
|
2275
|
-
function
|
|
2276
|
+
function vt(t) {
|
|
2276
2277
|
const { id: e } = t;
|
|
2277
2278
|
return {
|
|
2278
2279
|
...t,
|
|
2279
|
-
id:
|
|
2280
|
+
id: be(e),
|
|
2280
2281
|
/**
|
|
2281
2282
|
* `descriptor.transports` is an array of our `AuthenticatorTransportFuture` that includes newer
|
|
2282
2283
|
* transports that TypeScript's DOM lib is ignorant of. Convince TS that our list of transports
|
|
@@ -2285,13 +2286,13 @@ function wt(t) {
|
|
|
2285
2286
|
transports: t.transports
|
|
2286
2287
|
};
|
|
2287
2288
|
}
|
|
2288
|
-
function
|
|
2289
|
+
function Et(t) {
|
|
2289
2290
|
return (
|
|
2290
2291
|
// Consider localhost valid as well since it's okay wrt Secure Contexts
|
|
2291
2292
|
t === "localhost" || /^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)
|
|
2292
2293
|
);
|
|
2293
2294
|
}
|
|
2294
|
-
class
|
|
2295
|
+
class M extends Error {
|
|
2295
2296
|
constructor({ message: e, code: r, cause: n, name: o }) {
|
|
2296
2297
|
super(e, { cause: n }), Object.defineProperty(this, "code", {
|
|
2297
2298
|
enumerable: !0,
|
|
@@ -2301,20 +2302,20 @@ class _ extends Error {
|
|
|
2301
2302
|
}), this.name = o ?? n.name, this.code = r;
|
|
2302
2303
|
}
|
|
2303
2304
|
}
|
|
2304
|
-
function
|
|
2305
|
+
function xn({ error: t, options: e }) {
|
|
2305
2306
|
const { publicKey: r } = e;
|
|
2306
2307
|
if (!r)
|
|
2307
2308
|
throw Error("options was missing required publicKey property");
|
|
2308
2309
|
if (t.name === "AbortError") {
|
|
2309
2310
|
if (e.signal instanceof AbortSignal)
|
|
2310
|
-
return new
|
|
2311
|
+
return new M({
|
|
2311
2312
|
message: "Registration ceremony was sent an abort signal",
|
|
2312
2313
|
code: "ERROR_CEREMONY_ABORTED",
|
|
2313
2314
|
cause: t
|
|
2314
2315
|
});
|
|
2315
2316
|
} else if (t.name === "ConstraintError") {
|
|
2316
2317
|
if (r.authenticatorSelection?.requireResidentKey === !0)
|
|
2317
|
-
return new
|
|
2318
|
+
return new M({
|
|
2318
2319
|
message: "Discoverable credentials were required but no available authenticator supported it",
|
|
2319
2320
|
code: "ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",
|
|
2320
2321
|
cause: t
|
|
@@ -2323,63 +2324,63 @@ function Mn({ error: t, options: e }) {
|
|
|
2323
2324
|
// @ts-ignore: `mediation` doesn't yet exist on CredentialCreationOptions but it's possible as of Sept 2024
|
|
2324
2325
|
e.mediation === "conditional" && r.authenticatorSelection?.userVerification === "required"
|
|
2325
2326
|
)
|
|
2326
|
-
return new
|
|
2327
|
+
return new M({
|
|
2327
2328
|
message: "User verification was required during automatic registration but it could not be performed",
|
|
2328
2329
|
code: "ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",
|
|
2329
2330
|
cause: t
|
|
2330
2331
|
});
|
|
2331
2332
|
if (r.authenticatorSelection?.userVerification === "required")
|
|
2332
|
-
return new
|
|
2333
|
+
return new M({
|
|
2333
2334
|
message: "User verification was required but no available authenticator supported it",
|
|
2334
2335
|
code: "ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",
|
|
2335
2336
|
cause: t
|
|
2336
2337
|
});
|
|
2337
2338
|
} else {
|
|
2338
2339
|
if (t.name === "InvalidStateError")
|
|
2339
|
-
return new
|
|
2340
|
+
return new M({
|
|
2340
2341
|
message: "The authenticator was previously registered",
|
|
2341
2342
|
code: "ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",
|
|
2342
2343
|
cause: t
|
|
2343
2344
|
});
|
|
2344
2345
|
if (t.name === "NotAllowedError")
|
|
2345
|
-
return new
|
|
2346
|
+
return new M({
|
|
2346
2347
|
message: t.message,
|
|
2347
2348
|
code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
|
|
2348
2349
|
cause: t
|
|
2349
2350
|
});
|
|
2350
2351
|
if (t.name === "NotSupportedError")
|
|
2351
|
-
return r.pubKeyCredParams.filter((o) => o.type === "public-key").length === 0 ? new
|
|
2352
|
+
return r.pubKeyCredParams.filter((o) => o.type === "public-key").length === 0 ? new M({
|
|
2352
2353
|
message: 'No entry in pubKeyCredParams was of type "public-key"',
|
|
2353
2354
|
code: "ERROR_MALFORMED_PUBKEYCREDPARAMS",
|
|
2354
2355
|
cause: t
|
|
2355
|
-
}) : new
|
|
2356
|
+
}) : new M({
|
|
2356
2357
|
message: "No available authenticator supported any of the specified pubKeyCredParams algorithms",
|
|
2357
2358
|
code: "ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",
|
|
2358
2359
|
cause: t
|
|
2359
2360
|
});
|
|
2360
2361
|
if (t.name === "SecurityError") {
|
|
2361
2362
|
const n = globalThis.location.hostname;
|
|
2362
|
-
if (
|
|
2363
|
+
if (Et(n)) {
|
|
2363
2364
|
if (r.rp.id !== n)
|
|
2364
|
-
return new
|
|
2365
|
+
return new M({
|
|
2365
2366
|
message: `The RP ID "${r.rp.id}" is invalid for this domain`,
|
|
2366
2367
|
code: "ERROR_INVALID_RP_ID",
|
|
2367
2368
|
cause: t
|
|
2368
2369
|
});
|
|
2369
|
-
} else return new
|
|
2370
|
+
} else return new M({
|
|
2370
2371
|
message: `${globalThis.location.hostname} is an invalid domain`,
|
|
2371
2372
|
code: "ERROR_INVALID_DOMAIN",
|
|
2372
2373
|
cause: t
|
|
2373
2374
|
});
|
|
2374
2375
|
} else if (t.name === "TypeError") {
|
|
2375
2376
|
if (r.user.id.byteLength < 1 || r.user.id.byteLength > 64)
|
|
2376
|
-
return new
|
|
2377
|
+
return new M({
|
|
2377
2378
|
message: "User ID was not between 1 and 64 characters",
|
|
2378
2379
|
code: "ERROR_INVALID_USER_ID_LENGTH",
|
|
2379
2380
|
cause: t
|
|
2380
2381
|
});
|
|
2381
2382
|
} else if (t.name === "UnknownError")
|
|
2382
|
-
return new
|
|
2383
|
+
return new M({
|
|
2383
2384
|
message: "The authenticator was unable to process the specified options, or could not create a new credential",
|
|
2384
2385
|
code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
|
|
2385
2386
|
cause: t
|
|
@@ -2387,7 +2388,7 @@ function Mn({ error: t, options: e }) {
|
|
|
2387
2388
|
}
|
|
2388
2389
|
return t;
|
|
2389
2390
|
}
|
|
2390
|
-
class
|
|
2391
|
+
class Dn {
|
|
2391
2392
|
constructor() {
|
|
2392
2393
|
Object.defineProperty(this, "controller", {
|
|
2393
2394
|
enumerable: !0,
|
|
@@ -2411,58 +2412,58 @@ class Un {
|
|
|
2411
2412
|
}
|
|
2412
2413
|
}
|
|
2413
2414
|
}
|
|
2414
|
-
const Rt = new
|
|
2415
|
-
function
|
|
2416
|
-
if (t && !(
|
|
2415
|
+
const Rt = new Dn(), Fn = ["cross-platform", "platform"];
|
|
2416
|
+
function At(t) {
|
|
2417
|
+
if (t && !(Fn.indexOf(t) < 0))
|
|
2417
2418
|
return t;
|
|
2418
2419
|
}
|
|
2419
|
-
async function
|
|
2420
|
+
async function Bn(t) {
|
|
2420
2421
|
!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 });
|
|
2421
2422
|
const { optionsJSON: e, useAutoRegister: r = !1 } = t;
|
|
2422
2423
|
if (!Ke())
|
|
2423
2424
|
throw new Error("WebAuthn is not supported in this browser");
|
|
2424
2425
|
const n = {
|
|
2425
2426
|
...e,
|
|
2426
|
-
challenge:
|
|
2427
|
+
challenge: be(e.challenge),
|
|
2427
2428
|
user: {
|
|
2428
2429
|
...e.user,
|
|
2429
|
-
id:
|
|
2430
|
+
id: be(e.user.id)
|
|
2430
2431
|
},
|
|
2431
|
-
excludeCredentials: e.excludeCredentials?.map(
|
|
2432
|
+
excludeCredentials: e.excludeCredentials?.map(vt)
|
|
2432
2433
|
}, o = {};
|
|
2433
2434
|
r && (o.mediation = "conditional"), o.publicKey = n, o.signal = Rt.createNewAbortSignal();
|
|
2434
2435
|
let s;
|
|
2435
2436
|
try {
|
|
2436
2437
|
s = await navigator.credentials.create(o);
|
|
2437
|
-
} catch (
|
|
2438
|
-
throw
|
|
2438
|
+
} catch (S) {
|
|
2439
|
+
throw xn({ error: S, options: o });
|
|
2439
2440
|
}
|
|
2440
2441
|
if (!s)
|
|
2441
2442
|
throw new Error("Registration was not completed");
|
|
2442
2443
|
const { id: i, rawId: a, response: c, type: f } = s;
|
|
2443
|
-
let
|
|
2444
|
-
typeof c.getTransports == "function" && (
|
|
2444
|
+
let d;
|
|
2445
|
+
typeof c.getTransports == "function" && (d = c.getTransports());
|
|
2445
2446
|
let m;
|
|
2446
2447
|
if (typeof c.getPublicKeyAlgorithm == "function")
|
|
2447
2448
|
try {
|
|
2448
2449
|
m = c.getPublicKeyAlgorithm();
|
|
2449
|
-
} catch (
|
|
2450
|
-
Ie("getPublicKeyAlgorithm()",
|
|
2450
|
+
} catch (S) {
|
|
2451
|
+
Ie("getPublicKeyAlgorithm()", S);
|
|
2451
2452
|
}
|
|
2452
|
-
let
|
|
2453
|
+
let l;
|
|
2453
2454
|
if (typeof c.getPublicKey == "function")
|
|
2454
2455
|
try {
|
|
2455
|
-
const
|
|
2456
|
-
|
|
2457
|
-
} catch (
|
|
2458
|
-
Ie("getPublicKey()",
|
|
2456
|
+
const S = c.getPublicKey();
|
|
2457
|
+
S !== null && (l = W(S));
|
|
2458
|
+
} catch (S) {
|
|
2459
|
+
Ie("getPublicKey()", S);
|
|
2459
2460
|
}
|
|
2460
|
-
let
|
|
2461
|
+
let h;
|
|
2461
2462
|
if (typeof c.getAuthenticatorData == "function")
|
|
2462
2463
|
try {
|
|
2463
|
-
|
|
2464
|
-
} catch (
|
|
2465
|
-
Ie("getAuthenticatorData()",
|
|
2464
|
+
h = W(c.getAuthenticatorData());
|
|
2465
|
+
} catch (S) {
|
|
2466
|
+
Ie("getAuthenticatorData()", S);
|
|
2466
2467
|
}
|
|
2467
2468
|
return {
|
|
2468
2469
|
id: i,
|
|
@@ -2470,21 +2471,21 @@ async function xn(t) {
|
|
|
2470
2471
|
response: {
|
|
2471
2472
|
attestationObject: W(c.attestationObject),
|
|
2472
2473
|
clientDataJSON: W(c.clientDataJSON),
|
|
2473
|
-
transports:
|
|
2474
|
+
transports: d,
|
|
2474
2475
|
publicKeyAlgorithm: m,
|
|
2475
|
-
publicKey:
|
|
2476
|
-
authenticatorData:
|
|
2476
|
+
publicKey: l,
|
|
2477
|
+
authenticatorData: h
|
|
2477
2478
|
},
|
|
2478
2479
|
type: f,
|
|
2479
2480
|
clientExtensionResults: s.getClientExtensionResults(),
|
|
2480
|
-
authenticatorAttachment:
|
|
2481
|
+
authenticatorAttachment: At(s.authenticatorAttachment)
|
|
2481
2482
|
};
|
|
2482
2483
|
}
|
|
2483
2484
|
function Ie(t, e) {
|
|
2484
2485
|
console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${t}. You should report this error to them.
|
|
2485
2486
|
`, e);
|
|
2486
2487
|
}
|
|
2487
|
-
function
|
|
2488
|
+
function $n() {
|
|
2488
2489
|
if (!Ke())
|
|
2489
2490
|
return Oe.stubThis(new Promise((e) => e(!1)));
|
|
2490
2491
|
const t = globalThis.PublicKeyCredential;
|
|
@@ -2493,40 +2494,40 @@ function Dn() {
|
|
|
2493
2494
|
const Oe = {
|
|
2494
2495
|
stubThis: (t) => t
|
|
2495
2496
|
};
|
|
2496
|
-
function
|
|
2497
|
+
function Vn({ error: t, options: e }) {
|
|
2497
2498
|
const { publicKey: r } = e;
|
|
2498
2499
|
if (!r)
|
|
2499
2500
|
throw Error("options was missing required publicKey property");
|
|
2500
2501
|
if (t.name === "AbortError") {
|
|
2501
2502
|
if (e.signal instanceof AbortSignal)
|
|
2502
|
-
return new
|
|
2503
|
+
return new M({
|
|
2503
2504
|
message: "Authentication ceremony was sent an abort signal",
|
|
2504
2505
|
code: "ERROR_CEREMONY_ABORTED",
|
|
2505
2506
|
cause: t
|
|
2506
2507
|
});
|
|
2507
2508
|
} else {
|
|
2508
2509
|
if (t.name === "NotAllowedError")
|
|
2509
|
-
return new
|
|
2510
|
+
return new M({
|
|
2510
2511
|
message: t.message,
|
|
2511
2512
|
code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
|
|
2512
2513
|
cause: t
|
|
2513
2514
|
});
|
|
2514
2515
|
if (t.name === "SecurityError") {
|
|
2515
2516
|
const n = globalThis.location.hostname;
|
|
2516
|
-
if (
|
|
2517
|
+
if (Et(n)) {
|
|
2517
2518
|
if (r.rpId !== n)
|
|
2518
|
-
return new
|
|
2519
|
+
return new M({
|
|
2519
2520
|
message: `The RP ID "${r.rpId}" is invalid for this domain`,
|
|
2520
2521
|
code: "ERROR_INVALID_RP_ID",
|
|
2521
2522
|
cause: t
|
|
2522
2523
|
});
|
|
2523
|
-
} else return new
|
|
2524
|
+
} else return new M({
|
|
2524
2525
|
message: `${globalThis.location.hostname} is an invalid domain`,
|
|
2525
2526
|
code: "ERROR_INVALID_DOMAIN",
|
|
2526
2527
|
cause: t
|
|
2527
2528
|
});
|
|
2528
2529
|
} else if (t.name === "UnknownError")
|
|
2529
|
-
return new
|
|
2530
|
+
return new M({
|
|
2530
2531
|
message: "The authenticator was unable to process the specified options, or could not create a new assertion signature",
|
|
2531
2532
|
code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
|
|
2532
2533
|
cause: t
|
|
@@ -2534,20 +2535,20 @@ function Fn({ error: t, options: e }) {
|
|
|
2534
2535
|
}
|
|
2535
2536
|
return t;
|
|
2536
2537
|
}
|
|
2537
|
-
async function
|
|
2538
|
+
async function Kn(t) {
|
|
2538
2539
|
!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 });
|
|
2539
2540
|
const { optionsJSON: e, useBrowserAutofill: r = !1, verifyBrowserAutofillInput: n = !0 } = t;
|
|
2540
2541
|
if (!Ke())
|
|
2541
2542
|
throw new Error("WebAuthn is not supported in this browser");
|
|
2542
2543
|
let o;
|
|
2543
|
-
e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(
|
|
2544
|
+
e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(vt));
|
|
2544
2545
|
const s = {
|
|
2545
2546
|
...e,
|
|
2546
|
-
challenge:
|
|
2547
|
+
challenge: be(e.challenge),
|
|
2547
2548
|
allowCredentials: o
|
|
2548
2549
|
}, i = {};
|
|
2549
2550
|
if (r) {
|
|
2550
|
-
if (!await
|
|
2551
|
+
if (!await $n())
|
|
2551
2552
|
throw Error("Browser does not support WebAuthn autofill");
|
|
2552
2553
|
if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 && n)
|
|
2553
2554
|
throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
|
|
@@ -2557,68 +2558,68 @@ async function Bn(t) {
|
|
|
2557
2558
|
let a;
|
|
2558
2559
|
try {
|
|
2559
2560
|
a = await navigator.credentials.get(i);
|
|
2560
|
-
} catch (
|
|
2561
|
-
throw
|
|
2561
|
+
} catch (h) {
|
|
2562
|
+
throw Vn({ error: h, options: i });
|
|
2562
2563
|
}
|
|
2563
2564
|
if (!a)
|
|
2564
2565
|
throw new Error("Authentication was not completed");
|
|
2565
|
-
const { id: c, rawId: f, response:
|
|
2566
|
-
let
|
|
2567
|
-
return
|
|
2566
|
+
const { id: c, rawId: f, response: d, type: m } = a;
|
|
2567
|
+
let l;
|
|
2568
|
+
return d.userHandle && (l = W(d.userHandle)), {
|
|
2568
2569
|
id: c,
|
|
2569
2570
|
rawId: W(f),
|
|
2570
2571
|
response: {
|
|
2571
|
-
authenticatorData: W(
|
|
2572
|
-
clientDataJSON: W(
|
|
2573
|
-
signature: W(
|
|
2574
|
-
userHandle:
|
|
2572
|
+
authenticatorData: W(d.authenticatorData),
|
|
2573
|
+
clientDataJSON: W(d.clientDataJSON),
|
|
2574
|
+
signature: W(d.signature),
|
|
2575
|
+
userHandle: l
|
|
2575
2576
|
},
|
|
2576
2577
|
type: m,
|
|
2577
2578
|
clientExtensionResults: a.getClientExtensionResults(),
|
|
2578
|
-
authenticatorAttachment:
|
|
2579
|
+
authenticatorAttachment: At(a.authenticatorAttachment)
|
|
2579
2580
|
};
|
|
2580
2581
|
}
|
|
2581
|
-
const Ye =
|
|
2582
|
-
function
|
|
2583
|
-
const [r, n] =
|
|
2582
|
+
const Ye = dt(null);
|
|
2583
|
+
function co({ children: t, config: e }) {
|
|
2584
|
+
const [r, n] = X({
|
|
2584
2585
|
isAuthenticated: !1,
|
|
2585
2586
|
isLoading: !0,
|
|
2586
2587
|
user: null,
|
|
2587
2588
|
error: null
|
|
2588
2589
|
});
|
|
2589
|
-
|
|
2590
|
+
x(() => {
|
|
2590
2591
|
(() => {
|
|
2591
|
-
const
|
|
2592
|
-
if (
|
|
2593
|
-
|
|
2592
|
+
const d = _n();
|
|
2593
|
+
if (d) {
|
|
2594
|
+
lt(), n({
|
|
2594
2595
|
isAuthenticated: !1,
|
|
2595
2596
|
isLoading: !1,
|
|
2596
2597
|
user: null,
|
|
2597
|
-
error:
|
|
2598
|
+
error: d
|
|
2598
2599
|
});
|
|
2599
2600
|
return;
|
|
2600
2601
|
}
|
|
2601
|
-
const m =
|
|
2602
|
+
const m = On();
|
|
2602
2603
|
if (m) {
|
|
2603
|
-
const
|
|
2604
|
+
const h = {
|
|
2604
2605
|
token: m.token,
|
|
2605
2606
|
provider: m.provider,
|
|
2606
2607
|
authenticatedAt: Date.now()
|
|
2607
2608
|
};
|
|
2608
|
-
|
|
2609
|
+
Ee(h), lt(), n({
|
|
2609
2610
|
isAuthenticated: !0,
|
|
2610
2611
|
isLoading: !1,
|
|
2611
|
-
user: de(
|
|
2612
|
+
user: de(h),
|
|
2612
2613
|
error: null
|
|
2613
2614
|
});
|
|
2614
2615
|
return;
|
|
2615
2616
|
}
|
|
2616
|
-
const
|
|
2617
|
-
if (
|
|
2617
|
+
const l = St();
|
|
2618
|
+
if (l) {
|
|
2618
2619
|
n({
|
|
2619
2620
|
isAuthenticated: !0,
|
|
2620
2621
|
isLoading: !1,
|
|
2621
|
-
user: de(
|
|
2622
|
+
user: de(l),
|
|
2622
2623
|
error: null
|
|
2623
2624
|
});
|
|
2624
2625
|
return;
|
|
@@ -2634,57 +2635,57 @@ function ro({ children: t, config: e }) {
|
|
|
2634
2635
|
const o = $(
|
|
2635
2636
|
async (f) => {
|
|
2636
2637
|
if (!e.spaceId) {
|
|
2637
|
-
n((
|
|
2638
|
-
...
|
|
2638
|
+
n((l) => ({
|
|
2639
|
+
...l,
|
|
2639
2640
|
error: "Space ID is not configured"
|
|
2640
2641
|
}));
|
|
2641
2642
|
return;
|
|
2642
2643
|
}
|
|
2643
|
-
const
|
|
2644
|
+
const d = e.authUrl ?? Ne();
|
|
2644
2645
|
if (f === "guest") {
|
|
2645
|
-
n((
|
|
2646
|
+
n((l) => ({ ...l, isLoading: !0 }));
|
|
2646
2647
|
try {
|
|
2647
|
-
const
|
|
2648
|
+
const l = await wt(e.spaceId, d);
|
|
2648
2649
|
n({
|
|
2649
2650
|
isAuthenticated: !0,
|
|
2650
2651
|
isLoading: !1,
|
|
2651
|
-
user: de(
|
|
2652
|
+
user: de(l),
|
|
2652
2653
|
error: null
|
|
2653
2654
|
});
|
|
2654
|
-
} catch (
|
|
2655
|
-
n((
|
|
2656
|
-
...
|
|
2655
|
+
} catch (l) {
|
|
2656
|
+
n((h) => ({
|
|
2657
|
+
...h,
|
|
2657
2658
|
isLoading: !1,
|
|
2658
|
-
error:
|
|
2659
|
+
error: l instanceof Error ? l.message : "Guest login failed"
|
|
2659
2660
|
}));
|
|
2660
2661
|
}
|
|
2661
2662
|
return;
|
|
2662
2663
|
}
|
|
2663
2664
|
if (f === "passkey") {
|
|
2664
|
-
n((
|
|
2665
|
+
n((l) => ({ ...l, isLoading: !0, error: null }));
|
|
2665
2666
|
try {
|
|
2666
|
-
const
|
|
2667
|
+
const l = await jn(d), h = await Kn({ optionsJSON: l }), S = await Ln(d, h);
|
|
2667
2668
|
n({
|
|
2668
2669
|
isAuthenticated: !0,
|
|
2669
2670
|
isLoading: !1,
|
|
2670
|
-
user: de(
|
|
2671
|
+
user: de(S),
|
|
2671
2672
|
error: null
|
|
2672
2673
|
});
|
|
2673
|
-
} catch (
|
|
2674
|
-
n((
|
|
2675
|
-
...
|
|
2674
|
+
} catch (l) {
|
|
2675
|
+
n((h) => ({
|
|
2676
|
+
...h,
|
|
2676
2677
|
isLoading: !1,
|
|
2677
|
-
error:
|
|
2678
|
+
error: l instanceof Error ? l.message : "Passkey login failed"
|
|
2678
2679
|
}));
|
|
2679
2680
|
}
|
|
2680
2681
|
return;
|
|
2681
2682
|
}
|
|
2682
|
-
const m =
|
|
2683
|
+
const m = Nn(f, e.spaceId, d);
|
|
2683
2684
|
window.location.href = m;
|
|
2684
2685
|
},
|
|
2685
2686
|
[e.authUrl, e.spaceId]
|
|
2686
2687
|
), s = $(() => {
|
|
2687
|
-
|
|
2688
|
+
bt(), n({
|
|
2688
2689
|
isAuthenticated: !1,
|
|
2689
2690
|
isLoading: !1,
|
|
2690
2691
|
user: null,
|
|
@@ -2692,19 +2693,19 @@ function ro({ children: t, config: e }) {
|
|
|
2692
2693
|
});
|
|
2693
2694
|
}, []), i = $(
|
|
2694
2695
|
async (f) => {
|
|
2695
|
-
const
|
|
2696
|
+
const d = e.authUrl ?? Ne();
|
|
2696
2697
|
n((m) => ({ ...m, isLoading: !0, error: null }));
|
|
2697
2698
|
try {
|
|
2698
|
-
const m = await
|
|
2699
|
+
const m = await Pn(d), l = await Bn({ optionsJSON: m }), h = await Mn(d, l, f);
|
|
2699
2700
|
n({
|
|
2700
2701
|
isAuthenticated: !0,
|
|
2701
2702
|
isLoading: !1,
|
|
2702
|
-
user: de(
|
|
2703
|
+
user: de(h),
|
|
2703
2704
|
error: null
|
|
2704
2705
|
});
|
|
2705
2706
|
} catch (m) {
|
|
2706
|
-
n((
|
|
2707
|
-
...
|
|
2707
|
+
n((l) => ({
|
|
2708
|
+
...l,
|
|
2708
2709
|
isLoading: !1,
|
|
2709
2710
|
error: m instanceof Error ? m.message : "Passkey registration failed"
|
|
2710
2711
|
}));
|
|
@@ -2721,20 +2722,20 @@ function ro({ children: t, config: e }) {
|
|
|
2721
2722
|
}),
|
|
2722
2723
|
[r, o, s, a, i]
|
|
2723
2724
|
);
|
|
2724
|
-
return /* @__PURE__ */
|
|
2725
|
+
return /* @__PURE__ */ A.jsx(Ye, { value: c, children: t });
|
|
2725
2726
|
}
|
|
2726
|
-
function
|
|
2727
|
+
function Yn() {
|
|
2727
2728
|
const t = Fe(Ye);
|
|
2728
2729
|
if (!t)
|
|
2729
2730
|
throw new Error("useAuth must be used within an AuthProvider");
|
|
2730
2731
|
return t;
|
|
2731
2732
|
}
|
|
2732
|
-
function
|
|
2733
|
+
function uo() {
|
|
2733
2734
|
return Fe(Ye);
|
|
2734
2735
|
}
|
|
2735
|
-
function
|
|
2736
|
-
const { config: e, guestUrlParam: r } = t, { state: n, login: o } =
|
|
2737
|
-
return
|
|
2736
|
+
function lo(t) {
|
|
2737
|
+
const { config: e, guestUrlParam: r } = t, { state: n, login: o } = Yn(), s = v(!1);
|
|
2738
|
+
return x(() => {
|
|
2738
2739
|
if (!r || n.isAuthenticated || n.isLoading || s.current || !e.methods.includes("guest"))
|
|
2739
2740
|
return;
|
|
2740
2741
|
const i = new URLSearchParams(window.location.search), a = i.get(r);
|
|
@@ -2750,7 +2751,7 @@ function oo(t) {
|
|
|
2750
2751
|
error: n.error
|
|
2751
2752
|
};
|
|
2752
2753
|
}
|
|
2753
|
-
function
|
|
2754
|
+
function fo({
|
|
2754
2755
|
connectionState: t,
|
|
2755
2756
|
error: e,
|
|
2756
2757
|
isReady: r,
|
|
@@ -2761,9 +2762,9 @@ function so({
|
|
|
2761
2762
|
renderIdle: a,
|
|
2762
2763
|
renderConnecting: c,
|
|
2763
2764
|
renderConnectingSlow: f,
|
|
2764
|
-
renderConnected:
|
|
2765
|
+
renderConnected: d,
|
|
2765
2766
|
renderOffline: m,
|
|
2766
|
-
renderError:
|
|
2767
|
+
renderError: l
|
|
2767
2768
|
}) {
|
|
2768
2769
|
switch (t) {
|
|
2769
2770
|
case "idle":
|
|
@@ -2774,7 +2775,7 @@ function so({
|
|
|
2774
2775
|
return f();
|
|
2775
2776
|
case "connected":
|
|
2776
2777
|
case "reconnecting":
|
|
2777
|
-
return !r || !n || !o ? null :
|
|
2778
|
+
return !r || !n || !o ? null : d({
|
|
2778
2779
|
stores: n,
|
|
2779
2780
|
registry: o,
|
|
2780
2781
|
client: s,
|
|
@@ -2784,56 +2785,64 @@ function so({
|
|
|
2784
2785
|
case "offline":
|
|
2785
2786
|
return m();
|
|
2786
2787
|
case "offlineError":
|
|
2787
|
-
return
|
|
2788
|
+
return l(e ?? s?.lastError?.message ?? null);
|
|
2788
2789
|
default:
|
|
2789
2790
|
return null;
|
|
2790
2791
|
}
|
|
2791
2792
|
}
|
|
2792
|
-
const
|
|
2793
|
-
function
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2793
|
+
const _e = we("useIkonApp");
|
|
2794
|
+
function zn() {
|
|
2795
|
+
if (typeof window < "u" && window.__IKON_AUTH_CONFIG__)
|
|
2796
|
+
return window.__IKON_AUTH_CONFIG__;
|
|
2797
|
+
}
|
|
2798
|
+
function Wn() {
|
|
2799
|
+
if (typeof window < "u" && window.__IKON_LOCAL_IKON_SERVER_CONFIG__)
|
|
2800
|
+
return window.__IKON_LOCAL_IKON_SERVER_CONFIG__;
|
|
2801
|
+
}
|
|
2802
|
+
function ho(t) {
|
|
2803
|
+
const { authConfig: e, localServer: r, modules: n, registerModules: o, onJoined: s, onConnectionStateChange: i, onError: a, updateUrlOnJoin: c = !0, timeouts: f, audio: d, video: m, mediaSession: l } = t, h = e === void 0 ? zn() ?? null : e, S = r ?? Wn(), b = v(null), g = v(null), p = v(null), w = v(!1), T = v(d), I = v(m), j = v(l), G = v(f), Q = v(i), k = v(a), O = v(s), L = v(c);
|
|
2804
|
+
T.current = d, I.current = m, j.current = l, G.current = f, Q.current = i, k.current = a, O.current = s, L.current = c;
|
|
2805
|
+
const [_, D] = X("idle"), [z, te] = X(null), [ne, he] = X(null), [H, me] = X(null), [oe, u] = X(!1), y = Y(() => {
|
|
2797
2806
|
try {
|
|
2798
|
-
return
|
|
2807
|
+
return _t();
|
|
2799
2808
|
} catch {
|
|
2800
2809
|
return { parameters: {} };
|
|
2801
2810
|
}
|
|
2802
|
-
}, []), R = Y(() =>
|
|
2803
|
-
|
|
2804
|
-
!
|
|
2805
|
-
|
|
2811
|
+
}, []), R = Y(() => h?.enabled ? St() : null, [h?.enabled]), C = S?.enabled ?? !1, K = S?.host ?? "localhost", F = S?.port ?? 8443;
|
|
2812
|
+
x(() => {
|
|
2813
|
+
!C && ze() && h && !h.enabled && h.spaceId && !H && !oe && (u(!0), wt(h.spaceId, h.authUrl ?? Ne()).then((U) => {
|
|
2814
|
+
me(U.token);
|
|
2806
2815
|
}).catch((U) => {
|
|
2807
|
-
|
|
2816
|
+
_e.error("Anonymous auth failed:", U), te(U instanceof Error ? U.message : "Anonymous auth failed");
|
|
2808
2817
|
}).finally(() => {
|
|
2809
2818
|
u(!1);
|
|
2810
2819
|
}));
|
|
2811
|
-
}, [
|
|
2812
|
-
const
|
|
2813
|
-
if (
|
|
2814
|
-
const
|
|
2820
|
+
}, [C, h, H, oe]);
|
|
2821
|
+
const ee = Y(() => {
|
|
2822
|
+
if (C) {
|
|
2823
|
+
const P = R?.token ? Nt(R.token) ?? ge() : ge();
|
|
2815
2824
|
return {
|
|
2816
2825
|
local: {
|
|
2817
2826
|
host: K,
|
|
2818
|
-
httpsPort:
|
|
2819
|
-
userId:
|
|
2827
|
+
httpsPort: F,
|
|
2828
|
+
userId: P,
|
|
2820
2829
|
parameters: y.parameters
|
|
2821
2830
|
}
|
|
2822
2831
|
};
|
|
2823
2832
|
}
|
|
2824
|
-
return R?.token &&
|
|
2833
|
+
return R?.token && h?.spaceId ? {
|
|
2825
2834
|
sessionToken: {
|
|
2826
2835
|
token: R.token,
|
|
2827
|
-
spaceId:
|
|
2836
|
+
spaceId: h.spaceId,
|
|
2828
2837
|
backendType: We(),
|
|
2829
2838
|
sessionId: y.sessionId,
|
|
2830
2839
|
channelKey: y.channelKey,
|
|
2831
2840
|
parameters: y.parameters
|
|
2832
2841
|
}
|
|
2833
|
-
} :
|
|
2842
|
+
} : H && h?.spaceId ? {
|
|
2834
2843
|
sessionToken: {
|
|
2835
|
-
token:
|
|
2836
|
-
spaceId:
|
|
2844
|
+
token: H,
|
|
2845
|
+
spaceId: h.spaceId,
|
|
2837
2846
|
backendType: We(),
|
|
2838
2847
|
sessionId: y.sessionId,
|
|
2839
2848
|
channelKey: y.channelKey,
|
|
@@ -2842,70 +2851,69 @@ function io(t) {
|
|
|
2842
2851
|
} : ze() ? null : {
|
|
2843
2852
|
local: {
|
|
2844
2853
|
host: K,
|
|
2845
|
-
httpsPort:
|
|
2846
|
-
userId:
|
|
2854
|
+
httpsPort: F,
|
|
2855
|
+
userId: ge(),
|
|
2847
2856
|
parameters: y.parameters
|
|
2848
2857
|
}
|
|
2849
2858
|
};
|
|
2850
|
-
}, [
|
|
2851
|
-
|
|
2852
|
-
const se =
|
|
2853
|
-
|
|
2854
|
-
if (!
|
|
2855
|
-
if (
|
|
2856
|
-
for (const
|
|
2857
|
-
|
|
2858
|
-
o?.(
|
|
2859
|
-
|
|
2859
|
+
}, [C, K, F, R?.token, h?.spaceId, H, y.sessionId, y.channelKey, y.parameters]);
|
|
2860
|
+
Dr(ne);
|
|
2861
|
+
const se = Br(ne);
|
|
2862
|
+
x(() => {
|
|
2863
|
+
if (!w.current) {
|
|
2864
|
+
if (w.current = !0, p.current = _r(), n)
|
|
2865
|
+
for (const P of n)
|
|
2866
|
+
P(p.current);
|
|
2867
|
+
o?.(p.current), p.current.loadRegisteredModules().catch((P) => {
|
|
2868
|
+
_e.error("Failed to load UI modules", P);
|
|
2860
2869
|
});
|
|
2861
2870
|
}
|
|
2862
|
-
}, []),
|
|
2863
|
-
if (!
|
|
2864
|
-
const
|
|
2865
|
-
...
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
video: P.current,
|
|
2871
|
+
}, []), x(() => {
|
|
2872
|
+
if (!ee) return;
|
|
2873
|
+
const P = new Pt({
|
|
2874
|
+
...ee,
|
|
2875
|
+
timeouts: G.current,
|
|
2876
|
+
audio: T.current,
|
|
2877
|
+
video: I.current,
|
|
2870
2878
|
mediaSession: j.current,
|
|
2871
|
-
onConnectionStateChange: (
|
|
2872
|
-
|
|
2879
|
+
onConnectionStateChange: (V) => {
|
|
2880
|
+
D(V), Q.current?.(V);
|
|
2873
2881
|
},
|
|
2874
|
-
onError: (
|
|
2875
|
-
te(
|
|
2882
|
+
onError: (V) => {
|
|
2883
|
+
te(V.message), k.current?.(V);
|
|
2876
2884
|
},
|
|
2877
2885
|
onJoined: () => {
|
|
2878
|
-
const
|
|
2879
|
-
|
|
2886
|
+
const V = P.globalState?.SessionId;
|
|
2887
|
+
L.current && V && window.history.replaceState(null, "", `/s/${V}${window.location.search}`), O.current?.(V);
|
|
2880
2888
|
}
|
|
2881
2889
|
});
|
|
2882
|
-
b.current =
|
|
2883
|
-
const U = new
|
|
2884
|
-
return
|
|
2885
|
-
|
|
2890
|
+
b.current = P;
|
|
2891
|
+
const U = new Jt({ client: P });
|
|
2892
|
+
return g.current = U, he(U), P.connect().catch((V) => {
|
|
2893
|
+
_e.error("Connection failed:", V);
|
|
2886
2894
|
}), () => {
|
|
2887
|
-
|
|
2895
|
+
P.disconnect(), b.current = null, U.dispose(), g.current = null;
|
|
2888
2896
|
};
|
|
2889
|
-
}, [
|
|
2890
|
-
const
|
|
2891
|
-
const
|
|
2892
|
-
b.current?.sendActionCall(
|
|
2893
|
-
}, []),
|
|
2897
|
+
}, [ee]);
|
|
2898
|
+
const N = $((P, U) => {
|
|
2899
|
+
const V = typeof U == "string" ? U : JSON.stringify(U ?? {});
|
|
2900
|
+
b.current?.sendActionCall(P, V);
|
|
2901
|
+
}, []), J = _ === "connected" || _ === "reconnecting";
|
|
2894
2902
|
return {
|
|
2895
|
-
connectionState:
|
|
2903
|
+
connectionState: _,
|
|
2896
2904
|
error: z,
|
|
2897
2905
|
stores: se,
|
|
2898
2906
|
client: b.current,
|
|
2899
|
-
registry:
|
|
2907
|
+
registry: p.current,
|
|
2900
2908
|
clientRef: b,
|
|
2901
|
-
uiRef:
|
|
2902
|
-
registryRef:
|
|
2903
|
-
onAction:
|
|
2904
|
-
isReady:
|
|
2909
|
+
uiRef: g,
|
|
2910
|
+
registryRef: p,
|
|
2911
|
+
onAction: N,
|
|
2912
|
+
isReady: J
|
|
2905
2913
|
};
|
|
2906
2914
|
}
|
|
2907
|
-
function
|
|
2908
|
-
const e =
|
|
2915
|
+
function mo(t) {
|
|
2916
|
+
const e = v(!1);
|
|
2909
2917
|
return $(() => {
|
|
2910
2918
|
if (e.current) return;
|
|
2911
2919
|
e.current = !0;
|
|
@@ -2913,99 +2921,133 @@ function ao(t) {
|
|
|
2913
2921
|
r.rel = "stylesheet", r.href = t, document.head.appendChild(r);
|
|
2914
2922
|
}, [t]);
|
|
2915
2923
|
}
|
|
2916
|
-
|
|
2917
|
-
function
|
|
2924
|
+
let qn = 0;
|
|
2925
|
+
function po(t = 5, e = 5e3) {
|
|
2926
|
+
const [r, n] = X([]), o = v(/* @__PURE__ */ new Map()), s = $((i) => {
|
|
2927
|
+
const a = o.current.get(i);
|
|
2928
|
+
a && (clearTimeout(a), o.current.delete(i)), n((c) => c.filter((f) => f.id !== i));
|
|
2929
|
+
}, []);
|
|
2930
|
+
return x(() => {
|
|
2931
|
+
const i = o.current, a = Mt(
|
|
2932
|
+
(c) => {
|
|
2933
|
+
if (!jt())
|
|
2934
|
+
return;
|
|
2935
|
+
const f = `toast-${++qn}`, d = c.level === qe.ERROR ? "error" : "warn", m = {
|
|
2936
|
+
id: f,
|
|
2937
|
+
level: d,
|
|
2938
|
+
message: c.message,
|
|
2939
|
+
component: c.component
|
|
2940
|
+
};
|
|
2941
|
+
n((h) => [...h, m].slice(-t));
|
|
2942
|
+
const l = setTimeout(() => {
|
|
2943
|
+
s(f);
|
|
2944
|
+
}, e);
|
|
2945
|
+
i.set(f, l);
|
|
2946
|
+
},
|
|
2947
|
+
{ minLevel: qe.WARN }
|
|
2948
|
+
);
|
|
2949
|
+
return () => {
|
|
2950
|
+
a();
|
|
2951
|
+
for (const c of i.values())
|
|
2952
|
+
clearTimeout(c);
|
|
2953
|
+
i.clear();
|
|
2954
|
+
};
|
|
2955
|
+
}, [t, e, s]), { toasts: r, dismissToast: s };
|
|
2956
|
+
}
|
|
2957
|
+
const Tt = dt(null);
|
|
2958
|
+
function Gn(t, e) {
|
|
2918
2959
|
return e ? t.replace(/\{(\w+)\}/g, (r, n) => e[n] ?? `{${n}}`) : t;
|
|
2919
2960
|
}
|
|
2920
|
-
function
|
|
2961
|
+
function Hn(t, e) {
|
|
2921
2962
|
const n = new URLSearchParams(window.location.search).get("lang");
|
|
2922
2963
|
if (n && t.includes(n))
|
|
2923
2964
|
return n;
|
|
2924
2965
|
const o = navigator.language.split("-")[0];
|
|
2925
2966
|
return t.includes(o) ? o : e && t.includes(e) ? e : "en";
|
|
2926
2967
|
}
|
|
2927
|
-
function
|
|
2928
|
-
return e ?
|
|
2968
|
+
function Jn(t, e, r) {
|
|
2969
|
+
return e ? Hn(t, r) : r && t.includes(r) ? r : "en";
|
|
2929
2970
|
}
|
|
2930
|
-
function
|
|
2971
|
+
function go({
|
|
2931
2972
|
children: t,
|
|
2932
2973
|
translations: e,
|
|
2933
2974
|
defaultLanguage: r,
|
|
2934
2975
|
detectLanguage: n = !1
|
|
2935
2976
|
}) {
|
|
2936
|
-
const o = Object.keys(e), s =
|
|
2977
|
+
const o = Object.keys(e), s = Jn(o, n, r), i = e[s] ?? e.en, a = Y(
|
|
2937
2978
|
() => ({
|
|
2938
2979
|
t: (c, f) => {
|
|
2939
|
-
const
|
|
2940
|
-
return
|
|
2980
|
+
const d = i[c];
|
|
2981
|
+
return Gn(d, f);
|
|
2941
2982
|
},
|
|
2942
2983
|
locale: s,
|
|
2943
2984
|
translations: i
|
|
2944
2985
|
}),
|
|
2945
2986
|
[i, s]
|
|
2946
2987
|
);
|
|
2947
|
-
return /* @__PURE__ */
|
|
2988
|
+
return /* @__PURE__ */ A.jsx(Tt, { value: a, children: t });
|
|
2948
2989
|
}
|
|
2949
|
-
function
|
|
2950
|
-
const t = Fe(
|
|
2990
|
+
function yo() {
|
|
2991
|
+
const t = Fe(Tt);
|
|
2951
2992
|
if (!t)
|
|
2952
2993
|
throw new Error("useI18n must be used within an I18nProvider");
|
|
2953
2994
|
return t;
|
|
2954
2995
|
}
|
|
2955
2996
|
export {
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
2997
|
+
co as AuthProvider,
|
|
2998
|
+
fo as ConnectionStateRenderer,
|
|
2999
|
+
go as I18nProvider,
|
|
3000
|
+
nr as IKON_UI_BASE_MODULE,
|
|
3001
|
+
dr as IKON_UI_MEDIA_MODULE,
|
|
3002
|
+
kr as IKON_UI_SHADER_MODULE,
|
|
3003
|
+
Ar as IKON_UI_SHADER_TYPE,
|
|
3004
|
+
Me as IKON_UI_STREAM_CATEGORY,
|
|
3005
|
+
ir as IKON_UI_VIDEO_CANVAS_TYPE,
|
|
3006
|
+
ar as IKON_UI_VIDEO_URL_PLAYER_TYPE,
|
|
3007
|
+
Jt as IkonUi,
|
|
3008
|
+
Or as IkonUiRegistry,
|
|
3009
|
+
ro as IkonUiSurface,
|
|
3010
|
+
Gt as UiComponentRegistry,
|
|
3011
|
+
qt as UiRenderer,
|
|
3012
|
+
wo as UiStreamStore,
|
|
3013
|
+
no as areIkonUiModuleListsEqual,
|
|
3014
|
+
wt as authenticateAnonymous,
|
|
3015
|
+
Nn as buildOAuthRedirectUrl,
|
|
3016
|
+
bt as clearAuthSession,
|
|
3017
|
+
lt as clearOAuthParams,
|
|
3018
|
+
rr as createBaseResolvers,
|
|
3019
|
+
eo as createComponentLibrary,
|
|
3020
|
+
_r as createIkonUiRegistry,
|
|
3021
|
+
ur as createMediaResolvers,
|
|
3022
|
+
Tr as createShaderRendererResolver,
|
|
3023
|
+
Ht as isIkonUiCategoryMatch,
|
|
3024
|
+
St as loadAuthSession,
|
|
3025
|
+
or as loadBaseModule,
|
|
3026
|
+
fr as loadMediaModule,
|
|
3027
|
+
Cr as loadShaderModule,
|
|
3028
|
+
nn as normalizeIkonUiModuleList,
|
|
3029
|
+
so as parseIkonUiInitPayload,
|
|
3030
|
+
On as parseOAuthCallback,
|
|
3031
|
+
_n as parseOAuthError,
|
|
3032
|
+
on as readIkonUiModules,
|
|
3033
|
+
oo as readIkonUiModulesFromSources,
|
|
3034
|
+
sr as registerBaseModule,
|
|
3035
|
+
hr as registerMediaModule,
|
|
3036
|
+
Ir as registerShaderModule,
|
|
3037
|
+
zt as renderChildren,
|
|
3038
|
+
io as renderMotionLetters,
|
|
3039
|
+
Ee as saveAuthSession,
|
|
3040
|
+
ao as sendMagicLink,
|
|
3000
3041
|
de as sessionToUser,
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3042
|
+
Yn as useAuth,
|
|
3043
|
+
lo as useAuthGuard,
|
|
3044
|
+
uo as useAuthOptional,
|
|
3045
|
+
yo as useI18n,
|
|
3046
|
+
ho as useIkonApp,
|
|
3047
|
+
Dr as useIkonStyles,
|
|
3048
|
+
Br as useIkonUiStores,
|
|
3049
|
+
mo as useLazyFont,
|
|
3050
|
+
po as useToasts,
|
|
3051
|
+
Z as useUiNode,
|
|
3052
|
+
to as useUiStore
|
|
3011
3053
|
};
|