@ikonai/sdk-react-ui 1.0.19 → 1.0.21
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 +1 -1
- package/index.d.ts +1 -1
- package/index.js +238 -236
- package/package.json +1 -1
- package/{shader/shader-gl.d.ts → shadertoy/shadertoy-gl.d.ts} +1 -1
- package/shadertoy/shadertoy-module.d.ts +7 -0
- package/shadertoy/shadertoy-renderer.d.ts +3 -0
- package/shader/shader-module.d.ts +0 -7
- package/shader/shader-renderer.d.ts +0 -3
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { IkonUiCore as
|
|
1
|
+
import { IkonUiCore as kt, UiStreamStore as Ct } from "@ikonai/sdk-ui";
|
|
2
2
|
import { UiStreamStore as Co } from "@ikonai/sdk-ui";
|
|
3
|
-
import
|
|
4
|
-
import { createLogger as
|
|
3
|
+
import It, { useSyncExternalStore as Ue, useMemo as K, memo as z, useRef as A, useCallback as x, Fragment as Ot, useEffect as M, useState as W, createContext as lt, use as xe } from "react";
|
|
4
|
+
import { createLogger as ge, getOrCreateDeviceId as _t, deriveAuthUrl as Oe, parseUrlParams as Nt, clearSessionParamsFromUrl as Pt, isCloudEnvironment as Ke, extractUserIdFromToken as jt, deriveBackendType as Ye, IkonClient as Lt, subscribeToLogEvents as Mt, isDebugModeEnabled as Ut, LogLevel as We } from "@ikonai/sdk";
|
|
5
5
|
var de = { exports: {} }, oe = {};
|
|
6
6
|
/**
|
|
7
7
|
* @license React
|
|
@@ -12,10 +12,10 @@ var de = { exports: {} }, oe = {};
|
|
|
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
|
|
15
|
+
var ze;
|
|
16
16
|
function xt() {
|
|
17
|
-
if (
|
|
18
|
-
|
|
17
|
+
if (ze) return oe;
|
|
18
|
+
ze = 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,9 +44,9 @@ var se = {};
|
|
|
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
|
|
47
|
+
var qe;
|
|
48
48
|
function Dt() {
|
|
49
|
-
return
|
|
49
|
+
return qe || (qe = 1, process.env.NODE_ENV !== "production" && function() {
|
|
50
50
|
function t(l) {
|
|
51
51
|
if (l == null) return null;
|
|
52
52
|
if (typeof l == "function")
|
|
@@ -149,11 +149,11 @@ function Dt() {
|
|
|
149
149
|
}
|
|
150
150
|
function c() {
|
|
151
151
|
var l = t(this.type);
|
|
152
|
-
return
|
|
152
|
+
return H[l] || (H[l] = !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
|
)), l = this.props.ref, l !== void 0 ? l : null;
|
|
155
155
|
}
|
|
156
|
-
function f(l, b, k, N, E, I, V,
|
|
156
|
+
function f(l, b, k, N, E, I, V, be) {
|
|
157
157
|
return k = I.ref, l = {
|
|
158
158
|
$$typeof: g,
|
|
159
159
|
type: l,
|
|
@@ -182,14 +182,14 @@ function Dt() {
|
|
|
182
182
|
configurable: !1,
|
|
183
183
|
enumerable: !1,
|
|
184
184
|
writable: !0,
|
|
185
|
-
value:
|
|
185
|
+
value: be
|
|
186
186
|
}), Object.freeze && (Object.freeze(l.props), Object.freeze(l)), l;
|
|
187
187
|
}
|
|
188
|
-
function d(l, b, k, N, E, I, V,
|
|
188
|
+
function d(l, b, k, N, E, I, V, be) {
|
|
189
189
|
var L = b.children;
|
|
190
190
|
if (L !== void 0)
|
|
191
191
|
if (N)
|
|
192
|
-
if (
|
|
192
|
+
if (Y(L)) {
|
|
193
193
|
for (N = 0; N < L.length; N++)
|
|
194
194
|
h(L[N]);
|
|
195
195
|
Object.freeze && Object.freeze(L);
|
|
@@ -200,8 +200,8 @@ function Dt() {
|
|
|
200
200
|
else h(L);
|
|
201
201
|
if (F.call(b, "key")) {
|
|
202
202
|
L = t(l);
|
|
203
|
-
var re = Object.keys(b).filter(function(
|
|
204
|
-
return
|
|
203
|
+
var re = Object.keys(b).filter(function(Tt) {
|
|
204
|
+
return Tt !== "key";
|
|
205
205
|
});
|
|
206
206
|
N = 0 < re.length ? "{key: someKey, " + re.join(": ..., ") + ": ...}" : "{key: someKey}", te[L + N] || (re = 0 < re.length ? "{" + re.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
207
207
|
`A props object containing a "key" prop is being spread into JSX:
|
|
@@ -218,8 +218,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
218
218
|
}
|
|
219
219
|
if (L = null, k !== void 0 && (r(k), L = "" + k), i(b) && (r(b.key), L = "" + b.key), "key" in b) {
|
|
220
220
|
k = {};
|
|
221
|
-
for (var
|
|
222
|
-
|
|
221
|
+
for (var we in b)
|
|
222
|
+
we !== "key" && (k[we] = b[we]);
|
|
223
223
|
} else k = b;
|
|
224
224
|
return L && a(
|
|
225
225
|
k,
|
|
@@ -232,13 +232,13 @@ React keys must be passed directly to JSX without using spread:
|
|
|
232
232
|
o(),
|
|
233
233
|
k,
|
|
234
234
|
V,
|
|
235
|
-
|
|
235
|
+
be
|
|
236
236
|
);
|
|
237
237
|
}
|
|
238
238
|
function h(l) {
|
|
239
239
|
typeof l == "object" && l !== null && l.$$typeof === g && l._store && (l._store.validated = 1);
|
|
240
240
|
}
|
|
241
|
-
var u =
|
|
241
|
+
var u = It, g = Symbol.for("react.transitional.element"), y = Symbol.for("react.portal"), S = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), p = Symbol.for("react.profiler"), w = Symbol.for("react.consumer"), T = Symbol.for("react.context"), _ = Symbol.for("react.forward_ref"), D = Symbol.for("react.suspense"), G = Symbol.for("react.suspense_list"), Z = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), P = Symbol.for("react.activity"), U = Symbol.for("react.client.reference"), O = u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, F = Object.prototype.hasOwnProperty, Y = Array.isArray, Q = console.createTask ? console.createTask : function() {
|
|
242
242
|
return null;
|
|
243
243
|
};
|
|
244
244
|
u = {
|
|
@@ -246,7 +246,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
246
246
|
return l();
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
|
-
var B,
|
|
249
|
+
var B, H = {}, X = u["react-stack-bottom-frame"].bind(
|
|
250
250
|
u,
|
|
251
251
|
s
|
|
252
252
|
)(), ee = Q(n(s)), te = {};
|
|
@@ -277,13 +277,13 @@ React keys must be passed directly to JSX without using spread:
|
|
|
277
277
|
};
|
|
278
278
|
}()), se;
|
|
279
279
|
}
|
|
280
|
-
var
|
|
280
|
+
var Ge;
|
|
281
281
|
function Ft() {
|
|
282
|
-
return
|
|
282
|
+
return Ge || (Ge = 1, process.env.NODE_ENV === "production" ? de.exports = xt() : de.exports = Dt()), de.exports;
|
|
283
283
|
}
|
|
284
284
|
var R = Ft();
|
|
285
285
|
function Bt(t, e) {
|
|
286
|
-
const r =
|
|
286
|
+
const r = Ue(
|
|
287
287
|
(n) => t.subscribe(n),
|
|
288
288
|
() => {
|
|
289
289
|
const n = t.getSnapshot(), o = e ?? n.rootViewId, s = o ? n.views.get(o) : void 0;
|
|
@@ -302,15 +302,15 @@ function Bt(t, e) {
|
|
|
302
302
|
};
|
|
303
303
|
}, [r]);
|
|
304
304
|
}
|
|
305
|
-
function
|
|
306
|
-
const r =
|
|
305
|
+
function J(t, e) {
|
|
306
|
+
const r = Ue(
|
|
307
307
|
(n) => t.subscribeNode(e, n),
|
|
308
308
|
() => t.getNodeVersion(e),
|
|
309
309
|
() => t.getNodeVersion(e)
|
|
310
310
|
);
|
|
311
311
|
return K(() => t.getNode(e), [t, e, r]);
|
|
312
312
|
}
|
|
313
|
-
const $t =
|
|
313
|
+
const $t = ge("UIRenderer");
|
|
314
314
|
function Vt(t) {
|
|
315
315
|
if (t === void 0)
|
|
316
316
|
return "{}";
|
|
@@ -326,11 +326,11 @@ function Kt(t) {
|
|
|
326
326
|
const e = t.styleIds;
|
|
327
327
|
return Array.isArray(e) ? e : [];
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function Yt(t) {
|
|
330
330
|
const e = t.children;
|
|
331
331
|
return Array.isArray(e) ? e : [];
|
|
332
332
|
}
|
|
333
|
-
function
|
|
333
|
+
function Wt(t, e) {
|
|
334
334
|
return t.nodeId === e.nodeId && t.context === e.context;
|
|
335
335
|
}
|
|
336
336
|
function zt(t) {
|
|
@@ -341,8 +341,8 @@ function zt(t) {
|
|
|
341
341
|
e += "," + t[r].id;
|
|
342
342
|
return e;
|
|
343
343
|
}
|
|
344
|
-
const
|
|
345
|
-
const n =
|
|
344
|
+
const _e = z(function t({ nodeId: e, context: r }) {
|
|
345
|
+
const n = J(r.store, e), o = n ? Yt(n) : [], s = zt(o), i = K(
|
|
346
346
|
() => o.length === 0 ? null : o.map((h) => /* @__PURE__ */ R.jsx(t, { nodeId: h.id, context: r }, h.id)),
|
|
347
347
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
348
348
|
[s, r]
|
|
@@ -350,15 +350,15 @@ const Ne = z(function t({ nodeId: e, context: r }) {
|
|
|
350
350
|
if (!n)
|
|
351
351
|
return null;
|
|
352
352
|
if (n.type === "root")
|
|
353
|
-
return /* @__PURE__ */ R.jsx(
|
|
353
|
+
return /* @__PURE__ */ R.jsx(Ot, { children: i }, n.id);
|
|
354
354
|
const a = r.library.resolve(n);
|
|
355
355
|
if (!a)
|
|
356
356
|
return $t.warn(`No renderer for node type ${n.type}`), null;
|
|
357
357
|
const c = Kt(n), f = c.length > 0 ? c.join(" ") : void 0, d = a;
|
|
358
358
|
return /* @__PURE__ */ R.jsx(d, { nodeId: e, context: r, className: f });
|
|
359
|
-
},
|
|
359
|
+
}, Wt);
|
|
360
360
|
function qt(t, e) {
|
|
361
|
-
return !Array.isArray(t) || t.length === 0 ? null : t.map((r) => /* @__PURE__ */ R.jsx(
|
|
361
|
+
return !Array.isArray(t) || t.length === 0 ? null : t.map((r) => /* @__PURE__ */ R.jsx(_e, { nodeId: r.id, context: e }, r.id));
|
|
362
362
|
}
|
|
363
363
|
function Gt(t, e) {
|
|
364
364
|
return t.store === e.store && t.library === e.library && t.viewId === e.viewId && t.emptyFallback === e.emptyFallback;
|
|
@@ -385,7 +385,7 @@ const Ht = z(function({ store: e, library: r, viewId: n, emptyFallback: o = null
|
|
|
385
385
|
renderChildren: (m) => qt(m, S),
|
|
386
386
|
renderView: (m) => {
|
|
387
387
|
const p = e.getSnapshot().views.get(m);
|
|
388
|
-
return p ? /* @__PURE__ */ R.jsx(
|
|
388
|
+
return p ? /* @__PURE__ */ R.jsx(_e, { nodeId: p.id, context: S }) : null;
|
|
389
389
|
},
|
|
390
390
|
dispatchAction: g,
|
|
391
391
|
// Access client/video via refs to avoid context recreation
|
|
@@ -398,7 +398,7 @@ const Ht = z(function({ store: e, library: r, viewId: n, emptyFallback: o = null
|
|
|
398
398
|
};
|
|
399
399
|
return S;
|
|
400
400
|
}, [e, r, g]);
|
|
401
|
-
return !c || !f ? o : /* @__PURE__ */ R.jsx("div", { "data-ikon-view-id": c, style: { display: "contents" }, children: /* @__PURE__ */ R.jsx(
|
|
401
|
+
return !c || !f ? o : /* @__PURE__ */ R.jsx("div", { "data-ikon-view-id": c, style: { display: "contents" }, children: /* @__PURE__ */ R.jsx(_e, { nodeId: f, context: y }) });
|
|
402
402
|
}, Gt);
|
|
403
403
|
class Jt {
|
|
404
404
|
constructor(e, r) {
|
|
@@ -422,17 +422,17 @@ function ao(t, e) {
|
|
|
422
422
|
return new Jt(r, e);
|
|
423
423
|
}
|
|
424
424
|
function co(t) {
|
|
425
|
-
return
|
|
425
|
+
return Ue(
|
|
426
426
|
(e) => t.subscribe(e),
|
|
427
427
|
() => t.getSnapshot(),
|
|
428
428
|
() => t.getSnapshot()
|
|
429
429
|
);
|
|
430
430
|
}
|
|
431
|
-
const
|
|
431
|
+
const Ne = "ikon-ui";
|
|
432
432
|
function Xt(t, e) {
|
|
433
433
|
return t === e;
|
|
434
434
|
}
|
|
435
|
-
const uo = z(function({ stores: e, registry: r, category: n =
|
|
435
|
+
const uo = z(function({ stores: e, registry: r, category: n = Ne, onAction: o, client: s }) {
|
|
436
436
|
const i = K(() => Array.from(e.keys()).sort().join(","), [e]), a = A(o);
|
|
437
437
|
a.current = o;
|
|
438
438
|
const c = A(s);
|
|
@@ -459,7 +459,7 @@ class Zt {
|
|
|
459
459
|
unsubscribeClears;
|
|
460
460
|
unsubscribeStoreChanges;
|
|
461
461
|
constructor(e) {
|
|
462
|
-
this.core = e?.core ?? new
|
|
462
|
+
this.core = e?.core ?? new kt({ client: e?.client }), this.ownsCore = !e?.core, this.unsubscribeClears = this.core.subscribeToUiStreamCleared(this.handleUiStreamCleared), this.unsubscribeStoreChanges = this.core.uiStore.subscribe(this.syncStreamSnapshot), this.syncAllStreams();
|
|
463
463
|
}
|
|
464
464
|
dispose() {
|
|
465
465
|
this.unsubscribeClears(), this.unsubscribeStoreChanges(), this.ownsCore && this.core.dispose(), this.listeners.clear(), this.stores.clear();
|
|
@@ -509,8 +509,8 @@ class Zt {
|
|
|
509
509
|
if (r)
|
|
510
510
|
return r;
|
|
511
511
|
const n = {
|
|
512
|
-
category:
|
|
513
|
-
store: new
|
|
512
|
+
category: Ne,
|
|
513
|
+
store: new Ct()
|
|
514
514
|
};
|
|
515
515
|
return this.stores.set(e, n), n;
|
|
516
516
|
}
|
|
@@ -518,7 +518,7 @@ class Zt {
|
|
|
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 ?? Ne;
|
|
522
522
|
return n.category === o ? !1 : (this.stores.set(e, { ...n, category: o }), !0);
|
|
523
523
|
}
|
|
524
524
|
notify(e) {
|
|
@@ -542,7 +542,7 @@ function le(t) {
|
|
|
542
542
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
|
-
function
|
|
545
|
+
function De(...t) {
|
|
546
546
|
let e = "";
|
|
547
547
|
for (const r of t)
|
|
548
548
|
if (r) {
|
|
@@ -551,21 +551,21 @@ function Fe(...t) {
|
|
|
551
551
|
}
|
|
552
552
|
return e || void 0;
|
|
553
553
|
}
|
|
554
|
-
const
|
|
555
|
-
function
|
|
554
|
+
const He = /* @__PURE__ */ new WeakMap(), er = {};
|
|
555
|
+
function Fe(t) {
|
|
556
556
|
if (!t)
|
|
557
557
|
return er;
|
|
558
|
-
const e =
|
|
558
|
+
const e = He.get(t);
|
|
559
559
|
if (e)
|
|
560
560
|
return e;
|
|
561
561
|
const r = {};
|
|
562
562
|
for (const [n, o] of Object.entries(t))
|
|
563
563
|
o != null && (typeof o == "string" || typeof o == "number" || typeof o == "boolean") && (r[n] = o);
|
|
564
|
-
return
|
|
564
|
+
return He.set(t, r), r;
|
|
565
565
|
}
|
|
566
566
|
function tr() {
|
|
567
567
|
const t = z(function({ nodeId: r, context: n }) {
|
|
568
|
-
const o =
|
|
568
|
+
const o = J(n.store, r), s = A(null), i = le(o?.props?.targetViewId), a = o?.props?.focusOnly, c = typeof a == "boolean" ? a : void 0, f = le(o?.props?.key), d = o?.props?.preciseGeneratedAt;
|
|
569
569
|
return M(() => {
|
|
570
570
|
if (typeof document > "u")
|
|
571
571
|
return;
|
|
@@ -621,14 +621,14 @@ function tr() {
|
|
|
621
621
|
}
|
|
622
622
|
function rr() {
|
|
623
623
|
const t = z(function({ nodeId: r, context: n, className: o }) {
|
|
624
|
-
const s =
|
|
624
|
+
const s = J(n.store, r), i = Qt(s?.props?.onInvokeId), a = x(() => {
|
|
625
625
|
i && n.dispatchAction(i);
|
|
626
626
|
}, [i, n]);
|
|
627
627
|
if (!s)
|
|
628
628
|
return null;
|
|
629
|
-
const c =
|
|
629
|
+
const c = Fe(s.props);
|
|
630
630
|
delete c.onInvokeId;
|
|
631
|
-
const f =
|
|
631
|
+
const f = De(le(s.props?.className), o), d = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
632
632
|
return /* @__PURE__ */ R.jsx(
|
|
633
633
|
"div",
|
|
634
634
|
{
|
|
@@ -648,10 +648,10 @@ function rr() {
|
|
|
648
648
|
}
|
|
649
649
|
function nr() {
|
|
650
650
|
const t = z(function({ nodeId: r, context: n, className: o }) {
|
|
651
|
-
const s =
|
|
651
|
+
const s = J(n.store, r);
|
|
652
652
|
if (!s)
|
|
653
653
|
return null;
|
|
654
|
-
const i =
|
|
654
|
+
const i = Fe(s.props), a = De("relative", le(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
655
655
|
return /* @__PURE__ */ R.jsx("div", { ...i, "data-ikon-node-id": s.id, className: a, children: c });
|
|
656
656
|
});
|
|
657
657
|
return ({ type: e }) => {
|
|
@@ -661,10 +661,10 @@ function nr() {
|
|
|
661
661
|
}
|
|
662
662
|
function or() {
|
|
663
663
|
const t = z(function({ nodeId: r, context: n, className: o }) {
|
|
664
|
-
const s =
|
|
664
|
+
const s = J(n.store, r);
|
|
665
665
|
if (!s)
|
|
666
666
|
return null;
|
|
667
|
-
const i =
|
|
667
|
+
const i = Fe(s.props), a = De("absolute", le(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
668
668
|
return /* @__PURE__ */ R.jsx("div", { ...i, "data-ikon-node-id": s.id, className: a, children: c });
|
|
669
669
|
});
|
|
670
670
|
return ({ type: e }) => {
|
|
@@ -700,7 +700,7 @@ function lr(...t) {
|
|
|
700
700
|
r && r.trim() && e.push(r.trim());
|
|
701
701
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
702
702
|
}
|
|
703
|
-
function
|
|
703
|
+
function Je(t) {
|
|
704
704
|
if (typeof t != "string")
|
|
705
705
|
return;
|
|
706
706
|
const e = t.trim();
|
|
@@ -722,10 +722,10 @@ function fr() {
|
|
|
722
722
|
context: n,
|
|
723
723
|
className: o
|
|
724
724
|
}) {
|
|
725
|
-
const s =
|
|
725
|
+
const s = J(n.store, r);
|
|
726
726
|
if (!s)
|
|
727
727
|
return null;
|
|
728
|
-
const i = lr(ur(s.props?.className), o), a =
|
|
728
|
+
const i = lr(ur(s.props?.className), o), a = Je(s.props?.src), c = Je(s.props?.preload), f = fe(s.props?.controls), d = fe(s.props?.autoplay), h = fe(s.props?.loop), u = fe(s.props?.muted);
|
|
729
729
|
return /* @__PURE__ */ R.jsx(
|
|
730
730
|
"audio",
|
|
731
731
|
{
|
|
@@ -745,7 +745,7 @@ function fr() {
|
|
|
745
745
|
return t;
|
|
746
746
|
};
|
|
747
747
|
}
|
|
748
|
-
function
|
|
748
|
+
function dt(t) {
|
|
749
749
|
if (typeof t == "string") {
|
|
750
750
|
const e = t.trim();
|
|
751
751
|
return e.length > 0 ? e : void 0;
|
|
@@ -755,13 +755,13 @@ function ft(t) {
|
|
|
755
755
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
756
756
|
}
|
|
757
757
|
}
|
|
758
|
-
function
|
|
758
|
+
function ft(...t) {
|
|
759
759
|
const e = [];
|
|
760
760
|
for (const r of t)
|
|
761
761
|
r && r.trim() && e.push(r.trim());
|
|
762
762
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
763
763
|
}
|
|
764
|
-
function
|
|
764
|
+
function he(t) {
|
|
765
765
|
if (typeof t == "number" && Number.isFinite(t))
|
|
766
766
|
return Math.floor(t);
|
|
767
767
|
if (typeof t == "string" && t.trim().length > 0) {
|
|
@@ -770,7 +770,7 @@ function me(t) {
|
|
|
770
770
|
return Math.floor(e);
|
|
771
771
|
}
|
|
772
772
|
}
|
|
773
|
-
function
|
|
773
|
+
function Pe(t) {
|
|
774
774
|
if (typeof t != "string")
|
|
775
775
|
return;
|
|
776
776
|
const e = t.trim();
|
|
@@ -779,7 +779,7 @@ function je(t) {
|
|
|
779
779
|
const hr = "std.video-canvas", mr = "std.video-url-player";
|
|
780
780
|
function pr() {
|
|
781
781
|
const t = z(function({ nodeId: r, context: n, className: o }) {
|
|
782
|
-
const s =
|
|
782
|
+
const s = J(n.store, r), i = A(null), a = A(null), c = n.video, f = n.client, d = f?.isWebRtcEnabled ? f.webRtcVideoStream : null, h = f?.isWebRtcEnabled ? f.webRtcScreenStream : null, u = s ? Pe(s.props?.streamId) : void 0, g = s ? he(s.props?.width) : void 0, y = s ? he(s.props?.height) : void 0, S = s ? ft(dt(s.props?.className), o) : o, m = u?.includes("screen") ? h : d;
|
|
783
783
|
return M(() => {
|
|
784
784
|
const p = i.current;
|
|
785
785
|
if (!(!c || !p || !u || m))
|
|
@@ -842,10 +842,10 @@ function yr() {
|
|
|
842
842
|
context: n,
|
|
843
843
|
className: o
|
|
844
844
|
}) {
|
|
845
|
-
const s =
|
|
845
|
+
const s = J(n.store, r);
|
|
846
846
|
if (!s)
|
|
847
847
|
return null;
|
|
848
|
-
const i =
|
|
848
|
+
const i = ft(dt(s.props?.className), o), a = Pe(s.props?.src), c = Pe(s.props?.poster), f = ie(s.props?.controls), d = ie(s.props?.autoplay), h = ie(s.props?.loop), u = ie(s.props?.muted), g = ie(s.props?.playsInline), y = he(s.props?.width), S = he(s.props?.height), m = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
849
849
|
return /* @__PURE__ */ R.jsx(
|
|
850
850
|
"video",
|
|
851
851
|
{
|
|
@@ -1084,7 +1084,7 @@ function kr(...t) {
|
|
|
1084
1084
|
r && r.trim() && e.push(r.trim());
|
|
1085
1085
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
1086
1086
|
}
|
|
1087
|
-
function
|
|
1087
|
+
function ve(t) {
|
|
1088
1088
|
if (typeof t == "number" && Number.isFinite(t))
|
|
1089
1089
|
return Math.floor(t);
|
|
1090
1090
|
if (typeof t == "string" && t.trim().length > 0) {
|
|
@@ -1141,16 +1141,16 @@ function _r(t, e) {
|
|
|
1141
1141
|
}
|
|
1142
1142
|
return !0;
|
|
1143
1143
|
}
|
|
1144
|
-
const Nr = "std.
|
|
1144
|
+
const Nr = "std.shadertoy-canvas";
|
|
1145
1145
|
function Pr() {
|
|
1146
1146
|
const t = z(function({ nodeId: r, context: n, className: o }) {
|
|
1147
|
-
const s =
|
|
1147
|
+
const s = J(n.store, r), i = A(null), a = A(null), c = A(null), f = A(0), d = A(""), h = A({}), u = A({
|
|
1148
1148
|
x: 0,
|
|
1149
1149
|
y: 0,
|
|
1150
1150
|
clickX: 0,
|
|
1151
1151
|
clickY: 0,
|
|
1152
1152
|
isDown: !1
|
|
1153
|
-
}), g = s ? Cr(s.props?.shaderSource) : "", y = s ?
|
|
1153
|
+
}), g = s ? Cr(s.props?.shaderSource) : "", y = s ? ve(s.props?.fps) ?? 60 : 60, S = s?.props?.uniforms, m = K(() => Or(S), [S]), p = s ? Ir(s.props?.enableMouse) ?? !0 : !0, w = s ? ve(s.props?.width) : void 0, T = s ? ve(s.props?.height) : void 0, _ = s ? kr(Tr(s.props?.className), o) : o;
|
|
1154
1154
|
M(() => {
|
|
1155
1155
|
const C = i.current;
|
|
1156
1156
|
if (C) {
|
|
@@ -1158,7 +1158,7 @@ function Pr() {
|
|
|
1158
1158
|
const P = new Ar(C);
|
|
1159
1159
|
a.current = P;
|
|
1160
1160
|
} catch (P) {
|
|
1161
|
-
console.error("[
|
|
1161
|
+
console.error("[ShadertoyRenderer] Failed to create WebGL2 context:", P);
|
|
1162
1162
|
}
|
|
1163
1163
|
return () => {
|
|
1164
1164
|
a.current && (a.current.destroy(), a.current = null);
|
|
@@ -1171,7 +1171,7 @@ function Pr() {
|
|
|
1171
1171
|
d.current = g, h.current = m;
|
|
1172
1172
|
else {
|
|
1173
1173
|
const U = C.getError();
|
|
1174
|
-
console.error("[
|
|
1174
|
+
console.error("[ShadertoyRenderer] Shader compilation failed:", U);
|
|
1175
1175
|
}
|
|
1176
1176
|
}, [g, m]), M(() => {
|
|
1177
1177
|
const C = a.current;
|
|
@@ -1192,8 +1192,8 @@ function Pr() {
|
|
|
1192
1192
|
if (!p) return;
|
|
1193
1193
|
const P = i.current, U = a.current;
|
|
1194
1194
|
if (!P || !U) return;
|
|
1195
|
-
const O = P.getBoundingClientRect(), F = C.clientX - O.left,
|
|
1196
|
-
u.current.x = F, u.current.y =
|
|
1195
|
+
const O = P.getBoundingClientRect(), F = C.clientX - O.left, Y = O.height - (C.clientY - O.top);
|
|
1196
|
+
u.current.x = F, u.current.y = Y, U.setMouse(F, Y, u.current.clickX, u.current.clickY);
|
|
1197
1197
|
},
|
|
1198
1198
|
[p]
|
|
1199
1199
|
), G = x(
|
|
@@ -1201,8 +1201,8 @@ function Pr() {
|
|
|
1201
1201
|
if (!p) return;
|
|
1202
1202
|
const P = i.current, U = a.current;
|
|
1203
1203
|
if (!P || !U) return;
|
|
1204
|
-
const O = P.getBoundingClientRect(), F = C.clientX - O.left,
|
|
1205
|
-
u.current.isDown = !0, u.current.clickX = F, u.current.clickY =
|
|
1204
|
+
const O = P.getBoundingClientRect(), F = C.clientX - O.left, Y = O.height - (C.clientY - O.top);
|
|
1205
|
+
u.current.isDown = !0, u.current.clickX = F, u.current.clickY = Y, U.setMouse(F, Y, F, Y);
|
|
1206
1206
|
},
|
|
1207
1207
|
[p]
|
|
1208
1208
|
), Z = x(() => {
|
|
@@ -1228,11 +1228,11 @@ function Pr() {
|
|
|
1228
1228
|
return t;
|
|
1229
1229
|
};
|
|
1230
1230
|
}
|
|
1231
|
-
const jr = "
|
|
1231
|
+
const jr = "shadertoy", Lr = async () => Pr();
|
|
1232
1232
|
function Mr(t) {
|
|
1233
1233
|
t.registerModule(jr, Lr);
|
|
1234
1234
|
}
|
|
1235
|
-
const
|
|
1235
|
+
const Xe = ge("UIRegistry");
|
|
1236
1236
|
class Ur {
|
|
1237
1237
|
baseResolvers = [];
|
|
1238
1238
|
moduleLoaders = /* @__PURE__ */ new Map();
|
|
@@ -1258,7 +1258,7 @@ class Ur {
|
|
|
1258
1258
|
const s = await o(), i = Fr(s);
|
|
1259
1259
|
this.moduleResolvers.set(n, i), e = !0;
|
|
1260
1260
|
} catch (s) {
|
|
1261
|
-
|
|
1261
|
+
Xe.error(`[IkonUiRegistry] Failed to load module '${n}'.`, s);
|
|
1262
1262
|
}
|
|
1263
1263
|
const r = [];
|
|
1264
1264
|
for (const n of this.moduleLoaders.keys())
|
|
@@ -1273,7 +1273,7 @@ class Ur {
|
|
|
1273
1273
|
for (const r of this.activeModuleOrder) {
|
|
1274
1274
|
const n = this.moduleResolvers.get(r);
|
|
1275
1275
|
if (!n) {
|
|
1276
|
-
|
|
1276
|
+
Xe.warn(`Missing resolvers for module ${r}`);
|
|
1277
1277
|
continue;
|
|
1278
1278
|
}
|
|
1279
1279
|
for (const o of n) {
|
|
@@ -1301,7 +1301,7 @@ function Br(t, e) {
|
|
|
1301
1301
|
return !1;
|
|
1302
1302
|
return !0;
|
|
1303
1303
|
}
|
|
1304
|
-
const
|
|
1304
|
+
const Re = ge("MotionController"), Ze = {
|
|
1305
1305
|
ease: [0.25, 0.1, 0.25, 1],
|
|
1306
1306
|
"ease-in": [0.42, 0, 1, 1],
|
|
1307
1307
|
"ease-out": [0, 0, 0.58, 1],
|
|
@@ -1334,17 +1334,17 @@ const Ee = ye("MotionController"), Qe = {
|
|
|
1334
1334
|
function $(t) {
|
|
1335
1335
|
return t <= 0 ? 0 : t >= 1 ? 1 : t;
|
|
1336
1336
|
}
|
|
1337
|
-
function
|
|
1337
|
+
function Qe(t) {
|
|
1338
1338
|
if (t == null) return;
|
|
1339
1339
|
const e = `${t}`.trim();
|
|
1340
1340
|
if (!e) return;
|
|
1341
1341
|
const r = Number.parseFloat(e);
|
|
1342
1342
|
return Number.isFinite(r) ? r : void 0;
|
|
1343
1343
|
}
|
|
1344
|
-
function
|
|
1344
|
+
function et(t) {
|
|
1345
1345
|
return typeof CSS < "u" && CSS.escape ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
1346
1346
|
}
|
|
1347
|
-
function
|
|
1347
|
+
function tt(t, e, r, n) {
|
|
1348
1348
|
const d = new Float32Array(11);
|
|
1349
1349
|
function h(m, p, w) {
|
|
1350
1350
|
return ((3 * p - 3 * w + 1) * m + (3 * w - 6 * p)) * m * m + 3 * p * m;
|
|
@@ -1395,14 +1395,14 @@ function Vr(t) {
|
|
|
1395
1395
|
const e = t.trim().toLowerCase();
|
|
1396
1396
|
if (!e || e === "linear")
|
|
1397
1397
|
return (r) => $(r);
|
|
1398
|
-
if (
|
|
1399
|
-
const [r, n, o, s] =
|
|
1398
|
+
if (Ze[e]) {
|
|
1399
|
+
const [r, n, o, s] = Ze[e], i = tt(r, n, o, s);
|
|
1400
1400
|
return (a) => $(i($(a)));
|
|
1401
1401
|
}
|
|
1402
1402
|
if (e.startsWith("cubic-bezier(") && e.endsWith(")")) {
|
|
1403
1403
|
const n = e.slice(13, -1).split(",").map((o) => Number.parseFloat(o.trim()));
|
|
1404
1404
|
if (n.length === 4 && n.every((o) => Number.isFinite(o))) {
|
|
1405
|
-
const [o, s, i, a] = n, c =
|
|
1405
|
+
const [o, s, i, a] = n, c = tt(o, s, i, a);
|
|
1406
1406
|
return (f) => $(c($(f)));
|
|
1407
1407
|
}
|
|
1408
1408
|
}
|
|
@@ -1422,7 +1422,7 @@ function Kr(t) {
|
|
|
1422
1422
|
if (![r, n, o, s].some((i) => !Number.isFinite(i)))
|
|
1423
1423
|
return { inStart: r, inEnd: n, outStart: o, outEnd: s };
|
|
1424
1424
|
}
|
|
1425
|
-
class
|
|
1425
|
+
class Yr {
|
|
1426
1426
|
bindingsByStyle = /* @__PURE__ */ new Map();
|
|
1427
1427
|
observer;
|
|
1428
1428
|
observeScheduled = !1;
|
|
@@ -1449,7 +1449,7 @@ class Wr {
|
|
|
1449
1449
|
try {
|
|
1450
1450
|
e();
|
|
1451
1451
|
} catch (r) {
|
|
1452
|
-
|
|
1452
|
+
Re.warn("Failed to cleanup binding listener", r);
|
|
1453
1453
|
}
|
|
1454
1454
|
this.globalCleanups.clear(), this.elementStates.clear(), this.styleToElements.clear(), this.bindingsByStyle.clear(), this.pendingScanStyles.clear(), this.scanScheduled = !1, this.observer && (this.observer.disconnect(), this.observer = void 0);
|
|
1455
1455
|
}
|
|
@@ -1459,7 +1459,7 @@ class Wr {
|
|
|
1459
1459
|
const n = (JSON.parse(e).motionBindings ?? []).map((o) => this.parseBinding(o)).filter((o) => o !== void 0);
|
|
1460
1460
|
return n.length === 0 ? void 0 : { bindings: n };
|
|
1461
1461
|
} catch (r) {
|
|
1462
|
-
|
|
1462
|
+
Re.warn("Failed to parse motion metadata", r);
|
|
1463
1463
|
return;
|
|
1464
1464
|
}
|
|
1465
1465
|
}
|
|
@@ -1467,7 +1467,7 @@ class Wr {
|
|
|
1467
1467
|
const r = e.source?.trim();
|
|
1468
1468
|
if (!r)
|
|
1469
1469
|
return;
|
|
1470
|
-
const n =
|
|
1470
|
+
const n = Qe(e.min) ?? 0, o = Qe(e.max), s = o === void 0 ? n + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, c = Vr(e.ease), f = Kr(e.map), d = e.targetId?.trim() || void 0;
|
|
1471
1471
|
return Number.isNaN(n) || Number.isNaN(s) ? void 0 : {
|
|
1472
1472
|
source: r.toLowerCase(),
|
|
1473
1473
|
min: n,
|
|
@@ -1525,7 +1525,7 @@ class Wr {
|
|
|
1525
1525
|
const r = this.bindingsByStyle.get(e);
|
|
1526
1526
|
if (!r || typeof document > "u")
|
|
1527
1527
|
return;
|
|
1528
|
-
const n = `.${
|
|
1528
|
+
const n = `.${et(e)}`;
|
|
1529
1529
|
document.querySelectorAll(n).forEach((s) => this.applyStyleToElement(s, e, r));
|
|
1530
1530
|
}
|
|
1531
1531
|
applyStyleToElement(e, r, n) {
|
|
@@ -1565,7 +1565,7 @@ class Wr {
|
|
|
1565
1565
|
}
|
|
1566
1566
|
resolveScrollContainer(e, r) {
|
|
1567
1567
|
if (r.targetId) {
|
|
1568
|
-
const n = `[data-ikon-motion-source="${
|
|
1568
|
+
const n = `[data-ikon-motion-source="${et(r.targetId)}"]`, o = typeof document < "u" ? document.querySelector(n) : null;
|
|
1569
1569
|
if (o)
|
|
1570
1570
|
return o;
|
|
1571
1571
|
}
|
|
@@ -1635,7 +1635,7 @@ class Wr {
|
|
|
1635
1635
|
try {
|
|
1636
1636
|
i();
|
|
1637
1637
|
} catch (a) {
|
|
1638
|
-
|
|
1638
|
+
Re.warn("Failed to cleanup listener", a);
|
|
1639
1639
|
}
|
|
1640
1640
|
this.globalCleanups.delete(i);
|
|
1641
1641
|
}
|
|
@@ -1680,21 +1680,21 @@ class Wr {
|
|
|
1680
1680
|
}
|
|
1681
1681
|
}
|
|
1682
1682
|
}
|
|
1683
|
-
const
|
|
1684
|
-
function
|
|
1683
|
+
const Ee = new Yr();
|
|
1684
|
+
function Wr(t) {
|
|
1685
1685
|
const e = A(/* @__PURE__ */ new Map()), r = x(({ styleId: s, css: i, common: a }) => {
|
|
1686
1686
|
if (!(!s || typeof document > "u")) {
|
|
1687
1687
|
if (i) {
|
|
1688
1688
|
let c = e.current.get(s);
|
|
1689
1689
|
c || (c = document.createElement("style"), c.setAttribute("data-ikon-style-id", s), document.head.appendChild(c), e.current.set(s, c)), c.textContent = i;
|
|
1690
1690
|
}
|
|
1691
|
-
|
|
1691
|
+
Ee.registerStyle(s, a);
|
|
1692
1692
|
}
|
|
1693
1693
|
}, []), n = x((s) => {
|
|
1694
1694
|
if (!(typeof document > "u"))
|
|
1695
1695
|
for (const i of s) {
|
|
1696
1696
|
const a = e.current.get(i);
|
|
1697
|
-
a && (a.remove(), e.current.delete(i)),
|
|
1697
|
+
a && (a.remove(), e.current.delete(i)), Ee.unregisterStyle(i);
|
|
1698
1698
|
}
|
|
1699
1699
|
}, []), o = x(() => {
|
|
1700
1700
|
if (typeof document < "u") {
|
|
@@ -1702,7 +1702,7 @@ function Yr(t) {
|
|
|
1702
1702
|
s.remove();
|
|
1703
1703
|
e.current.clear();
|
|
1704
1704
|
}
|
|
1705
|
-
|
|
1705
|
+
Ee.reset();
|
|
1706
1706
|
}, []);
|
|
1707
1707
|
return M(() => {
|
|
1708
1708
|
if (!t) return;
|
|
@@ -1723,7 +1723,7 @@ function zr(t) {
|
|
|
1723
1723
|
return e.sort(), e.join(",");
|
|
1724
1724
|
}
|
|
1725
1725
|
function qr(t) {
|
|
1726
|
-
const [e, r] =
|
|
1726
|
+
const [e, r] = W(), n = A("");
|
|
1727
1727
|
return M(() => {
|
|
1728
1728
|
if (!t) {
|
|
1729
1729
|
r(void 0), n.current = "";
|
|
@@ -1736,7 +1736,7 @@ function qr(t) {
|
|
|
1736
1736
|
return o(), t.subscribe(o);
|
|
1737
1737
|
}, [t]), e;
|
|
1738
1738
|
}
|
|
1739
|
-
var Gr = typeof global == "object" && global && global.Object === Object && global, Hr = typeof self == "object" && self && self.Object === Object && self, Jr = Gr || Hr || Function("return this")(),
|
|
1739
|
+
var Gr = typeof global == "object" && global && global.Object === Object && global, Hr = typeof self == "object" && self && self.Object === Object && self, Jr = Gr || Hr || Function("return this")(), me = Jr.Symbol, ht = Object.prototype, Xr = ht.hasOwnProperty, Zr = ht.toString, ae = me ? me.toStringTag : void 0;
|
|
1740
1740
|
function Qr(t) {
|
|
1741
1741
|
var e = Xr.call(t, ae), r = t[ae];
|
|
1742
1742
|
try {
|
|
@@ -1751,9 +1751,9 @@ var en = Object.prototype, tn = en.toString;
|
|
|
1751
1751
|
function rn(t) {
|
|
1752
1752
|
return tn.call(t);
|
|
1753
1753
|
}
|
|
1754
|
-
var nn = "[object Null]", on = "[object Undefined]",
|
|
1754
|
+
var nn = "[object Null]", on = "[object Undefined]", rt = me ? me.toStringTag : void 0;
|
|
1755
1755
|
function sn(t) {
|
|
1756
|
-
return t == null ? t === void 0 ? on : nn :
|
|
1756
|
+
return t == null ? t === void 0 ? on : nn : rt && rt in Object(t) ? Qr(t) : rn(t);
|
|
1757
1757
|
}
|
|
1758
1758
|
function an(t) {
|
|
1759
1759
|
return t != null && typeof t == "object";
|
|
@@ -1762,8 +1762,8 @@ var cn = Array.isArray, un = "[object String]";
|
|
|
1762
1762
|
function ln(t) {
|
|
1763
1763
|
return typeof t == "string" || !cn(t) && an(t) && sn(t) == un;
|
|
1764
1764
|
}
|
|
1765
|
-
const
|
|
1766
|
-
function
|
|
1765
|
+
const nt = "ikonUiModules";
|
|
1766
|
+
function je(t) {
|
|
1767
1767
|
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
1768
1768
|
}
|
|
1769
1769
|
function dn(t) {
|
|
@@ -1790,8 +1790,8 @@ function lo(t, e) {
|
|
|
1790
1790
|
return !0;
|
|
1791
1791
|
}
|
|
1792
1792
|
function fn(t) {
|
|
1793
|
-
if (!(!
|
|
1794
|
-
return dn(t[
|
|
1793
|
+
if (!(!je(t) || !Object.prototype.hasOwnProperty.call(t, nt)))
|
|
1794
|
+
return dn(t[nt]);
|
|
1795
1795
|
}
|
|
1796
1796
|
function fo(...t) {
|
|
1797
1797
|
for (const e of t) {
|
|
@@ -1801,7 +1801,7 @@ function fo(...t) {
|
|
|
1801
1801
|
}
|
|
1802
1802
|
}
|
|
1803
1803
|
function ho(t) {
|
|
1804
|
-
if (!
|
|
1804
|
+
if (!je(t))
|
|
1805
1805
|
return;
|
|
1806
1806
|
const e = t, r = Object.keys(e).find((c) => c.toLowerCase() === "modules");
|
|
1807
1807
|
if (!r)
|
|
@@ -1820,7 +1820,7 @@ function ho(t) {
|
|
|
1820
1820
|
o.push(S), i.add(S);
|
|
1821
1821
|
continue;
|
|
1822
1822
|
}
|
|
1823
|
-
if (!
|
|
1823
|
+
if (!je(c))
|
|
1824
1824
|
continue;
|
|
1825
1825
|
const f = c, d = Object.keys(f).find((S) => S.toLowerCase() === "name");
|
|
1826
1826
|
if (!d)
|
|
@@ -1898,7 +1898,7 @@ const v = {
|
|
|
1898
1898
|
"[data-emoji]"
|
|
1899
1899
|
]
|
|
1900
1900
|
}
|
|
1901
|
-
],
|
|
1901
|
+
], Le = v.Letter | v.Word | v.Line | v.Paragraph | v.Emoji, mn = v.Letter | v.Word | v.Line | v.Paragraph, ot = /* @__PURE__ */ new Map(), pn = 16384;
|
|
1902
1902
|
function mo(t, e) {
|
|
1903
1903
|
if (!t || t.length > pn)
|
|
1904
1904
|
return t;
|
|
@@ -1909,10 +1909,10 @@ function mo(t, e) {
|
|
|
1909
1909
|
`).replace(/\r/g, `
|
|
1910
1910
|
`);
|
|
1911
1911
|
if (o === v.None)
|
|
1912
|
-
return
|
|
1912
|
+
return ct(s);
|
|
1913
1913
|
const i = _n(s);
|
|
1914
1914
|
if (i.length === 0)
|
|
1915
|
-
return n ?
|
|
1915
|
+
return n ? ct(s) : t;
|
|
1916
1916
|
const a = Nn(i), c = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, f = [];
|
|
1917
1917
|
for (const d of a) {
|
|
1918
1918
|
const h = gn(d, r, c);
|
|
@@ -1933,7 +1933,7 @@ function gn(t, e, r) {
|
|
|
1933
1933
|
"span",
|
|
1934
1934
|
{
|
|
1935
1935
|
"data-motion-paragraph": !0,
|
|
1936
|
-
style:
|
|
1936
|
+
style: ye(o),
|
|
1937
1937
|
children: n
|
|
1938
1938
|
},
|
|
1939
1939
|
`motion-paragraph-${o}`
|
|
@@ -1947,7 +1947,7 @@ function yn(t, e, r) {
|
|
|
1947
1947
|
if (ne(e, v.Line)) {
|
|
1948
1948
|
const s = r.line++;
|
|
1949
1949
|
o.push(
|
|
1950
|
-
/* @__PURE__ */ R.jsx("span", { "data-motion-line": !0, style:
|
|
1950
|
+
/* @__PURE__ */ R.jsx("span", { "data-motion-line": !0, style: ye(s), children: n }, `motion-line-${s}`)
|
|
1951
1951
|
);
|
|
1952
1952
|
} else
|
|
1953
1953
|
o.push(...n);
|
|
@@ -1963,22 +1963,22 @@ function Sn(t, e, r) {
|
|
|
1963
1963
|
for (; (a = s.exec(t)) !== null; ) {
|
|
1964
1964
|
if (a.index > i) {
|
|
1965
1965
|
const c = t.slice(i, a.index);
|
|
1966
|
-
o.push(
|
|
1966
|
+
o.push(st(c, r, e, n));
|
|
1967
1967
|
}
|
|
1968
1968
|
o.push(a[0]), i = a.index + a[0].length;
|
|
1969
1969
|
}
|
|
1970
1970
|
if (i < t.length) {
|
|
1971
1971
|
const c = t.slice(i);
|
|
1972
|
-
o.push(
|
|
1972
|
+
o.push(st(c, r, e, n));
|
|
1973
1973
|
}
|
|
1974
1974
|
return o;
|
|
1975
1975
|
}
|
|
1976
|
-
function
|
|
1976
|
+
function st(t, e, r, n) {
|
|
1977
1977
|
const o = e.word++, s = wn(t, r, e), i = `motion-word-${o}`, a = bn(o, n);
|
|
1978
1978
|
return n ? /* @__PURE__ */ R.jsx("span", { "data-motion-word": !0, style: a, children: s }, i) : /* @__PURE__ */ R.jsx("span", { style: a, children: s }, i);
|
|
1979
1979
|
}
|
|
1980
1980
|
function bn(t, e) {
|
|
1981
|
-
return e ? { ...
|
|
1981
|
+
return e ? { ...ye(t), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
|
|
1982
1982
|
}
|
|
1983
1983
|
function wn(t, e, r) {
|
|
1984
1984
|
if (!t)
|
|
@@ -1987,15 +1987,15 @@ function wn(t, e, r) {
|
|
|
1987
1987
|
if (!n) {
|
|
1988
1988
|
if (!o)
|
|
1989
1989
|
return [t];
|
|
1990
|
-
const a =
|
|
1990
|
+
const a = Me(t);
|
|
1991
1991
|
if (a.length === 0)
|
|
1992
1992
|
return [t];
|
|
1993
|
-
const { nodes: c } =
|
|
1993
|
+
const { nodes: c } = pt(a, r);
|
|
1994
1994
|
return c;
|
|
1995
1995
|
}
|
|
1996
|
-
const s = [], i =
|
|
1996
|
+
const s = [], i = Me(t);
|
|
1997
1997
|
for (const a of i) {
|
|
1998
|
-
const c = r.letter++, f = `motion-letter-${c}`, d =
|
|
1998
|
+
const c = r.letter++, f = `motion-letter-${c}`, d = ye(c);
|
|
1999
1999
|
if (a === `
|
|
2000
2000
|
`) {
|
|
2001
2001
|
s.push(
|
|
@@ -2003,14 +2003,14 @@ function wn(t, e, r) {
|
|
|
2003
2003
|
);
|
|
2004
2004
|
continue;
|
|
2005
2005
|
}
|
|
2006
|
-
const u = o &&
|
|
2006
|
+
const u = o && mt(a) ? { "data-motion-emoji": !0 } : void 0, g = a === " " ? " " : a;
|
|
2007
2007
|
s.push(
|
|
2008
2008
|
/* @__PURE__ */ R.jsx("span", { "data-motion-letter": !0, style: d, ...u, children: g }, f)
|
|
2009
2009
|
);
|
|
2010
2010
|
}
|
|
2011
2011
|
return s;
|
|
2012
2012
|
}
|
|
2013
|
-
function
|
|
2013
|
+
function Me(t) {
|
|
2014
2014
|
if (!t)
|
|
2015
2015
|
return [];
|
|
2016
2016
|
const e = vn();
|
|
@@ -2030,9 +2030,9 @@ function Rn(t) {
|
|
|
2030
2030
|
return n && e.push(n), e;
|
|
2031
2031
|
}
|
|
2032
2032
|
function En(t, e) {
|
|
2033
|
-
return e ? !!(
|
|
2033
|
+
return e ? !!(it(t) || it(e) || kn(e) || An(e) || Tn(e) || at(t) && at(e)) : !1;
|
|
2034
2034
|
}
|
|
2035
|
-
function
|
|
2035
|
+
function it(t) {
|
|
2036
2036
|
return t.codePointAt(0) === 8205;
|
|
2037
2037
|
}
|
|
2038
2038
|
function An(t) {
|
|
@@ -2043,13 +2043,13 @@ function Tn(t) {
|
|
|
2043
2043
|
const e = t.codePointAt(0);
|
|
2044
2044
|
return e === void 0 ? !1 : e >= 127995 && e <= 127999;
|
|
2045
2045
|
}
|
|
2046
|
-
function
|
|
2046
|
+
function at(t) {
|
|
2047
2047
|
const e = t.codePointAt(0);
|
|
2048
2048
|
return e === void 0 ? !1 : e >= 127462 && e <= 127487;
|
|
2049
2049
|
}
|
|
2050
|
-
let
|
|
2050
|
+
let Ae;
|
|
2051
2051
|
function kn(t) {
|
|
2052
|
-
return t ? (
|
|
2052
|
+
return t ? (Ae || (Ae = Cn()), Ae(t)) : !1;
|
|
2053
2053
|
}
|
|
2054
2054
|
function Cn() {
|
|
2055
2055
|
try {
|
|
@@ -2062,9 +2062,9 @@ function Cn() {
|
|
|
2062
2062
|
};
|
|
2063
2063
|
}
|
|
2064
2064
|
}
|
|
2065
|
-
let
|
|
2066
|
-
function
|
|
2067
|
-
return t ? (
|
|
2065
|
+
let Te;
|
|
2066
|
+
function mt(t) {
|
|
2067
|
+
return t ? (Te || (Te = In()), Te(t)) : !1;
|
|
2068
2068
|
}
|
|
2069
2069
|
function In() {
|
|
2070
2070
|
try {
|
|
@@ -2110,7 +2110,7 @@ function Nn(t) {
|
|
|
2110
2110
|
function ne(t, e) {
|
|
2111
2111
|
return (t & e) === e;
|
|
2112
2112
|
}
|
|
2113
|
-
function
|
|
2113
|
+
function ye(t) {
|
|
2114
2114
|
return {
|
|
2115
2115
|
"--tw-motion-seq-index": t.toString(),
|
|
2116
2116
|
backgroundColor: "inherit",
|
|
@@ -2127,23 +2127,23 @@ function Se(t) {
|
|
|
2127
2127
|
WebkitTextFillColor: "inherit"
|
|
2128
2128
|
};
|
|
2129
2129
|
}
|
|
2130
|
-
function
|
|
2130
|
+
function ct(t) {
|
|
2131
2131
|
if (!t)
|
|
2132
2132
|
return t;
|
|
2133
|
-
const e =
|
|
2133
|
+
const e = Me(t);
|
|
2134
2134
|
if (e.length === 0)
|
|
2135
2135
|
return t;
|
|
2136
|
-
const { nodes: r, sawEmoji: n } =
|
|
2136
|
+
const { nodes: r, sawEmoji: n } = pt(e);
|
|
2137
2137
|
return n ? r.length === 1 ? r[0] ?? t : r : t;
|
|
2138
2138
|
}
|
|
2139
|
-
function
|
|
2139
|
+
function pt(t, e) {
|
|
2140
2140
|
const r = [];
|
|
2141
2141
|
let n = "", o = !1, s = e?.emoji ?? 0;
|
|
2142
2142
|
const i = () => {
|
|
2143
2143
|
n && (r.push(n), n = "");
|
|
2144
2144
|
};
|
|
2145
2145
|
for (const a of t) {
|
|
2146
|
-
if (
|
|
2146
|
+
if (mt(a)) {
|
|
2147
2147
|
o = !0, i();
|
|
2148
2148
|
const f = `motion-emoji-${e ? e.emoji++ : s++}`;
|
|
2149
2149
|
r.push(
|
|
@@ -2161,7 +2161,7 @@ function Pn(t) {
|
|
|
2161
2161
|
const e = t.trim();
|
|
2162
2162
|
if (!e)
|
|
2163
2163
|
return v.None;
|
|
2164
|
-
const r =
|
|
2164
|
+
const r = ot.get(e);
|
|
2165
2165
|
if (typeof r == "number")
|
|
2166
2166
|
return r;
|
|
2167
2167
|
if (typeof document > "u")
|
|
@@ -2180,14 +2180,14 @@ function Pn(t) {
|
|
|
2180
2180
|
} catch {
|
|
2181
2181
|
continue;
|
|
2182
2182
|
}
|
|
2183
|
-
const d =
|
|
2184
|
-
if (d.mask && (i |= d.mask, i ===
|
|
2183
|
+
const d = gt(f, s);
|
|
2184
|
+
if (d.mask && (i |= d.mask, i === Le))
|
|
2185
2185
|
break;
|
|
2186
2186
|
a ||= d.sawStyleRule;
|
|
2187
2187
|
}
|
|
2188
|
-
return (i !== v.None || a) &&
|
|
2188
|
+
return (i !== v.None || a) && ot.set(e, i), i;
|
|
2189
2189
|
}
|
|
2190
|
-
function
|
|
2190
|
+
function gt(t, e) {
|
|
2191
2191
|
if (!t)
|
|
2192
2192
|
return { mask: v.None, sawStyleRule: !1 };
|
|
2193
2193
|
let r = v.None, n = !1;
|
|
@@ -2200,11 +2200,11 @@ function yt(t, e) {
|
|
|
2200
2200
|
n = !0;
|
|
2201
2201
|
for (const f of hn)
|
|
2202
2202
|
f.hints.some((d) => a.includes(d)) && (r |= f.flag);
|
|
2203
|
-
if (r ===
|
|
2203
|
+
if (r === Le)
|
|
2204
2204
|
return { mask: r, sawStyleRule: !0 };
|
|
2205
2205
|
} else if ("cssRules" in s) {
|
|
2206
|
-
const i =
|
|
2207
|
-
if (i.mask && (r |= i.mask, r ===
|
|
2206
|
+
const i = gt(s.cssRules, e);
|
|
2207
|
+
if (i.mask && (r |= i.mask, r === Le))
|
|
2208
2208
|
return { mask: r, sawStyleRule: !0 };
|
|
2209
2209
|
n ||= i.sawStyleRule;
|
|
2210
2210
|
}
|
|
@@ -2218,27 +2218,27 @@ function jn(t) {
|
|
|
2218
2218
|
function Ln(t) {
|
|
2219
2219
|
return t.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
|
|
2220
2220
|
}
|
|
2221
|
-
const
|
|
2222
|
-
function
|
|
2221
|
+
const Be = "ikon_auth_session", Mn = 7 * 24 * 60 * 60 * 1e3;
|
|
2222
|
+
function Se(t) {
|
|
2223
2223
|
try {
|
|
2224
|
-
localStorage.setItem(
|
|
2224
|
+
localStorage.setItem(Be, JSON.stringify(t));
|
|
2225
2225
|
} catch {
|
|
2226
2226
|
console.warn("Failed to save auth session to localStorage");
|
|
2227
2227
|
}
|
|
2228
2228
|
}
|
|
2229
|
-
function
|
|
2229
|
+
function yt() {
|
|
2230
2230
|
try {
|
|
2231
|
-
const t = localStorage.getItem(
|
|
2231
|
+
const t = localStorage.getItem(Be);
|
|
2232
2232
|
if (!t) return null;
|
|
2233
2233
|
const e = JSON.parse(t);
|
|
2234
|
-
return Date.now() - e.authenticatedAt > Mn ? (
|
|
2234
|
+
return Date.now() - e.authenticatedAt > Mn ? (St(), null) : e;
|
|
2235
2235
|
} catch {
|
|
2236
2236
|
return console.warn("Failed to load auth session from localStorage"), null;
|
|
2237
2237
|
}
|
|
2238
2238
|
}
|
|
2239
|
-
function
|
|
2239
|
+
function St() {
|
|
2240
2240
|
try {
|
|
2241
|
-
localStorage.removeItem(
|
|
2241
|
+
localStorage.removeItem(Be);
|
|
2242
2242
|
} catch {
|
|
2243
2243
|
console.warn("Failed to clear auth session from localStorage");
|
|
2244
2244
|
}
|
|
@@ -2251,8 +2251,8 @@ function ue(t) {
|
|
|
2251
2251
|
authenticatedAt: t.authenticatedAt
|
|
2252
2252
|
};
|
|
2253
2253
|
}
|
|
2254
|
-
async function
|
|
2255
|
-
const r =
|
|
2254
|
+
async function bt(t, e) {
|
|
2255
|
+
const r = _t(), n = await fetch(`${e}/anonymous`, {
|
|
2256
2256
|
method: "POST",
|
|
2257
2257
|
headers: { "Content-Type": "application/json" },
|
|
2258
2258
|
body: JSON.stringify({ deviceId: r, space: t })
|
|
@@ -2266,7 +2266,7 @@ async function wt(t, e) {
|
|
|
2266
2266
|
provider: "anonymous",
|
|
2267
2267
|
authenticatedAt: Date.now()
|
|
2268
2268
|
};
|
|
2269
|
-
return
|
|
2269
|
+
return Se(s), s;
|
|
2270
2270
|
}
|
|
2271
2271
|
async function po(t) {
|
|
2272
2272
|
const { email: e, spaceId: r, authUrl: n, returnUrl: o = window.location.origin + window.location.pathname } = t, s = await fetch(`${n}/email/send`, {
|
|
@@ -2291,7 +2291,7 @@ function xn() {
|
|
|
2291
2291
|
const e = new URLSearchParams(window.location.search).get("error");
|
|
2292
2292
|
return e ? decodeURIComponent(e) : null;
|
|
2293
2293
|
}
|
|
2294
|
-
function
|
|
2294
|
+
function ut() {
|
|
2295
2295
|
window.history.replaceState({}, "", window.location.pathname);
|
|
2296
2296
|
}
|
|
2297
2297
|
function Dn(t, e, r, n) {
|
|
@@ -2324,7 +2324,7 @@ async function Bn(t, e, r) {
|
|
|
2324
2324
|
provider: "passkey",
|
|
2325
2325
|
authenticatedAt: Date.now()
|
|
2326
2326
|
};
|
|
2327
|
-
return
|
|
2327
|
+
return Se(s), s;
|
|
2328
2328
|
}
|
|
2329
2329
|
async function $n(t, e) {
|
|
2330
2330
|
const r = await fetch(`${t}/passkey/authentication/options`, {
|
|
@@ -2353,7 +2353,7 @@ async function Vn(t, e) {
|
|
|
2353
2353
|
provider: "passkey",
|
|
2354
2354
|
authenticatedAt: Date.now()
|
|
2355
2355
|
};
|
|
2356
|
-
return
|
|
2356
|
+
return Se(o), o;
|
|
2357
2357
|
}
|
|
2358
2358
|
function q(t) {
|
|
2359
2359
|
const e = new Uint8Array(t);
|
|
@@ -2362,23 +2362,23 @@ function q(t) {
|
|
|
2362
2362
|
r += String.fromCharCode(o);
|
|
2363
2363
|
return btoa(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
2364
2364
|
}
|
|
2365
|
-
function
|
|
2365
|
+
function pe(t) {
|
|
2366
2366
|
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);
|
|
2367
2367
|
for (let a = 0; a < o.length; a++)
|
|
2368
2368
|
i[a] = o.charCodeAt(a);
|
|
2369
2369
|
return s;
|
|
2370
2370
|
}
|
|
2371
|
-
function
|
|
2371
|
+
function $e() {
|
|
2372
2372
|
return Kn.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
|
|
2373
2373
|
}
|
|
2374
2374
|
const Kn = {
|
|
2375
2375
|
stubThis: (t) => t
|
|
2376
2376
|
};
|
|
2377
|
-
function
|
|
2377
|
+
function wt(t) {
|
|
2378
2378
|
const { id: e } = t;
|
|
2379
2379
|
return {
|
|
2380
2380
|
...t,
|
|
2381
|
-
id:
|
|
2381
|
+
id: pe(e),
|
|
2382
2382
|
/**
|
|
2383
2383
|
* `descriptor.transports` is an array of our `AuthenticatorTransportFuture` that includes newer
|
|
2384
2384
|
* transports that TypeScript's DOM lib is ignorant of. Convince TS that our list of transports
|
|
@@ -2387,7 +2387,7 @@ function vt(t) {
|
|
|
2387
2387
|
transports: t.transports
|
|
2388
2388
|
};
|
|
2389
2389
|
}
|
|
2390
|
-
function
|
|
2390
|
+
function vt(t) {
|
|
2391
2391
|
return (
|
|
2392
2392
|
// Consider localhost valid as well since it's okay wrt Secure Contexts
|
|
2393
2393
|
t === "localhost" || /^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)
|
|
@@ -2403,7 +2403,7 @@ class j extends Error {
|
|
|
2403
2403
|
}), this.name = o ?? n.name, this.code = r;
|
|
2404
2404
|
}
|
|
2405
2405
|
}
|
|
2406
|
-
function
|
|
2406
|
+
function Yn({ error: t, options: e }) {
|
|
2407
2407
|
const { publicKey: r } = e;
|
|
2408
2408
|
if (!r)
|
|
2409
2409
|
throw Error("options was missing required publicKey property");
|
|
@@ -2461,7 +2461,7 @@ function Wn({ error: t, options: e }) {
|
|
|
2461
2461
|
});
|
|
2462
2462
|
if (t.name === "SecurityError") {
|
|
2463
2463
|
const n = globalThis.location.hostname;
|
|
2464
|
-
if (
|
|
2464
|
+
if (vt(n)) {
|
|
2465
2465
|
if (r.rp.id !== n)
|
|
2466
2466
|
return new j({
|
|
2467
2467
|
message: `The RP ID "${r.rp.id}" is invalid for this domain`,
|
|
@@ -2489,7 +2489,7 @@ function Wn({ error: t, options: e }) {
|
|
|
2489
2489
|
}
|
|
2490
2490
|
return t;
|
|
2491
2491
|
}
|
|
2492
|
-
class
|
|
2492
|
+
class Wn {
|
|
2493
2493
|
constructor() {
|
|
2494
2494
|
Object.defineProperty(this, "controller", {
|
|
2495
2495
|
enumerable: !0,
|
|
@@ -2513,31 +2513,31 @@ class Yn {
|
|
|
2513
2513
|
}
|
|
2514
2514
|
}
|
|
2515
2515
|
}
|
|
2516
|
-
const
|
|
2517
|
-
function
|
|
2516
|
+
const Rt = new Wn(), zn = ["cross-platform", "platform"];
|
|
2517
|
+
function Et(t) {
|
|
2518
2518
|
if (t && !(zn.indexOf(t) < 0))
|
|
2519
2519
|
return t;
|
|
2520
2520
|
}
|
|
2521
2521
|
async function qn(t) {
|
|
2522
2522
|
!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 });
|
|
2523
2523
|
const { optionsJSON: e, useAutoRegister: r = !1 } = t;
|
|
2524
|
-
if (
|
|
2524
|
+
if (!$e())
|
|
2525
2525
|
throw new Error("WebAuthn is not supported in this browser");
|
|
2526
2526
|
const n = {
|
|
2527
2527
|
...e,
|
|
2528
|
-
challenge:
|
|
2528
|
+
challenge: pe(e.challenge),
|
|
2529
2529
|
user: {
|
|
2530
2530
|
...e.user,
|
|
2531
|
-
id:
|
|
2531
|
+
id: pe(e.user.id)
|
|
2532
2532
|
},
|
|
2533
|
-
excludeCredentials: e.excludeCredentials?.map(
|
|
2533
|
+
excludeCredentials: e.excludeCredentials?.map(wt)
|
|
2534
2534
|
}, o = {};
|
|
2535
|
-
r && (o.mediation = "conditional"), o.publicKey = n, o.signal =
|
|
2535
|
+
r && (o.mediation = "conditional"), o.publicKey = n, o.signal = Rt.createNewAbortSignal();
|
|
2536
2536
|
let s;
|
|
2537
2537
|
try {
|
|
2538
2538
|
s = await navigator.credentials.create(o);
|
|
2539
2539
|
} catch (y) {
|
|
2540
|
-
throw
|
|
2540
|
+
throw Yn({ error: y, options: o });
|
|
2541
2541
|
}
|
|
2542
2542
|
if (!s)
|
|
2543
2543
|
throw new Error("Registration was not completed");
|
|
@@ -2549,7 +2549,7 @@ async function qn(t) {
|
|
|
2549
2549
|
try {
|
|
2550
2550
|
h = c.getPublicKeyAlgorithm();
|
|
2551
2551
|
} catch (y) {
|
|
2552
|
-
|
|
2552
|
+
ke("getPublicKeyAlgorithm()", y);
|
|
2553
2553
|
}
|
|
2554
2554
|
let u;
|
|
2555
2555
|
if (typeof c.getPublicKey == "function")
|
|
@@ -2557,14 +2557,14 @@ async function qn(t) {
|
|
|
2557
2557
|
const y = c.getPublicKey();
|
|
2558
2558
|
y !== null && (u = q(y));
|
|
2559
2559
|
} catch (y) {
|
|
2560
|
-
|
|
2560
|
+
ke("getPublicKey()", y);
|
|
2561
2561
|
}
|
|
2562
2562
|
let g;
|
|
2563
2563
|
if (typeof c.getAuthenticatorData == "function")
|
|
2564
2564
|
try {
|
|
2565
2565
|
g = q(c.getAuthenticatorData());
|
|
2566
2566
|
} catch (y) {
|
|
2567
|
-
|
|
2567
|
+
ke("getAuthenticatorData()", y);
|
|
2568
2568
|
}
|
|
2569
2569
|
return {
|
|
2570
2570
|
id: i,
|
|
@@ -2579,20 +2579,20 @@ async function qn(t) {
|
|
|
2579
2579
|
},
|
|
2580
2580
|
type: f,
|
|
2581
2581
|
clientExtensionResults: s.getClientExtensionResults(),
|
|
2582
|
-
authenticatorAttachment:
|
|
2582
|
+
authenticatorAttachment: Et(s.authenticatorAttachment)
|
|
2583
2583
|
};
|
|
2584
2584
|
}
|
|
2585
|
-
function
|
|
2585
|
+
function ke(t, e) {
|
|
2586
2586
|
console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${t}. You should report this error to them.
|
|
2587
2587
|
`, e);
|
|
2588
2588
|
}
|
|
2589
2589
|
function Gn() {
|
|
2590
|
-
if (
|
|
2591
|
-
return
|
|
2590
|
+
if (!$e())
|
|
2591
|
+
return Ce.stubThis(new Promise((e) => e(!1)));
|
|
2592
2592
|
const t = globalThis.PublicKeyCredential;
|
|
2593
|
-
return t?.isConditionalMediationAvailable === void 0 ?
|
|
2593
|
+
return t?.isConditionalMediationAvailable === void 0 ? Ce.stubThis(new Promise((e) => e(!1))) : Ce.stubThis(t.isConditionalMediationAvailable());
|
|
2594
2594
|
}
|
|
2595
|
-
const
|
|
2595
|
+
const Ce = {
|
|
2596
2596
|
stubThis: (t) => t
|
|
2597
2597
|
};
|
|
2598
2598
|
function Hn({ error: t, options: e }) {
|
|
@@ -2615,7 +2615,7 @@ function Hn({ error: t, options: e }) {
|
|
|
2615
2615
|
});
|
|
2616
2616
|
if (t.name === "SecurityError") {
|
|
2617
2617
|
const n = globalThis.location.hostname;
|
|
2618
|
-
if (
|
|
2618
|
+
if (vt(n)) {
|
|
2619
2619
|
if (r.rpId !== n)
|
|
2620
2620
|
return new j({
|
|
2621
2621
|
message: `The RP ID "${r.rpId}" is invalid for this domain`,
|
|
@@ -2639,13 +2639,13 @@ function Hn({ error: t, options: e }) {
|
|
|
2639
2639
|
async function Jn(t) {
|
|
2640
2640
|
!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 });
|
|
2641
2641
|
const { optionsJSON: e, useBrowserAutofill: r = !1, verifyBrowserAutofillInput: n = !0 } = t;
|
|
2642
|
-
if (
|
|
2642
|
+
if (!$e())
|
|
2643
2643
|
throw new Error("WebAuthn is not supported in this browser");
|
|
2644
2644
|
let o;
|
|
2645
|
-
e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(
|
|
2645
|
+
e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(wt));
|
|
2646
2646
|
const s = {
|
|
2647
2647
|
...e,
|
|
2648
|
-
challenge:
|
|
2648
|
+
challenge: pe(e.challenge),
|
|
2649
2649
|
allowCredentials: o
|
|
2650
2650
|
}, i = {};
|
|
2651
2651
|
if (r) {
|
|
@@ -2655,7 +2655,7 @@ async function Jn(t) {
|
|
|
2655
2655
|
throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
|
|
2656
2656
|
i.mediation = "conditional", s.allowCredentials = [];
|
|
2657
2657
|
}
|
|
2658
|
-
i.publicKey = s, i.signal =
|
|
2658
|
+
i.publicKey = s, i.signal = Rt.createNewAbortSignal();
|
|
2659
2659
|
let a;
|
|
2660
2660
|
try {
|
|
2661
2661
|
a = await navigator.credentials.get(i);
|
|
@@ -2677,12 +2677,12 @@ async function Jn(t) {
|
|
|
2677
2677
|
},
|
|
2678
2678
|
type: h,
|
|
2679
2679
|
clientExtensionResults: a.getClientExtensionResults(),
|
|
2680
|
-
authenticatorAttachment:
|
|
2680
|
+
authenticatorAttachment: Et(a.authenticatorAttachment)
|
|
2681
2681
|
};
|
|
2682
2682
|
}
|
|
2683
|
-
const
|
|
2683
|
+
const Ve = lt(null);
|
|
2684
2684
|
function go({ children: t, config: e }) {
|
|
2685
|
-
const [r, n] =
|
|
2685
|
+
const [r, n] = W({
|
|
2686
2686
|
isAuthenticated: !1,
|
|
2687
2687
|
isLoading: !0,
|
|
2688
2688
|
user: null,
|
|
@@ -2692,7 +2692,7 @@ function go({ children: t, config: e }) {
|
|
|
2692
2692
|
(() => {
|
|
2693
2693
|
const d = xn();
|
|
2694
2694
|
if (d) {
|
|
2695
|
-
|
|
2695
|
+
ut(), n({
|
|
2696
2696
|
isAuthenticated: !1,
|
|
2697
2697
|
isLoading: !1,
|
|
2698
2698
|
user: null,
|
|
@@ -2707,7 +2707,7 @@ function go({ children: t, config: e }) {
|
|
|
2707
2707
|
provider: h.provider,
|
|
2708
2708
|
authenticatedAt: Date.now()
|
|
2709
2709
|
};
|
|
2710
|
-
|
|
2710
|
+
Se(g), ut(), n({
|
|
2711
2711
|
isAuthenticated: !0,
|
|
2712
2712
|
isLoading: !1,
|
|
2713
2713
|
user: ue(g),
|
|
@@ -2715,7 +2715,7 @@ function go({ children: t, config: e }) {
|
|
|
2715
2715
|
});
|
|
2716
2716
|
return;
|
|
2717
2717
|
}
|
|
2718
|
-
const u =
|
|
2718
|
+
const u = yt();
|
|
2719
2719
|
if (u) {
|
|
2720
2720
|
n({
|
|
2721
2721
|
isAuthenticated: !0,
|
|
@@ -2742,11 +2742,11 @@ function go({ children: t, config: e }) {
|
|
|
2742
2742
|
}));
|
|
2743
2743
|
return;
|
|
2744
2744
|
}
|
|
2745
|
-
const d = e.authUrl ??
|
|
2745
|
+
const d = e.authUrl ?? Oe();
|
|
2746
2746
|
if (f === "guest") {
|
|
2747
2747
|
n((u) => ({ ...u, isLoading: !0 }));
|
|
2748
2748
|
try {
|
|
2749
|
-
const u = await
|
|
2749
|
+
const u = await bt(e.spaceId, d);
|
|
2750
2750
|
n({
|
|
2751
2751
|
isAuthenticated: !0,
|
|
2752
2752
|
isLoading: !1,
|
|
@@ -2786,7 +2786,7 @@ function go({ children: t, config: e }) {
|
|
|
2786
2786
|
},
|
|
2787
2787
|
[e.authUrl, e.spaceId]
|
|
2788
2788
|
), s = x(() => {
|
|
2789
|
-
|
|
2789
|
+
St(), n({
|
|
2790
2790
|
isAuthenticated: !1,
|
|
2791
2791
|
isLoading: !1,
|
|
2792
2792
|
user: null,
|
|
@@ -2794,7 +2794,7 @@ function go({ children: t, config: e }) {
|
|
|
2794
2794
|
});
|
|
2795
2795
|
}, []), i = x(
|
|
2796
2796
|
async (f) => {
|
|
2797
|
-
const d = e.authUrl ??
|
|
2797
|
+
const d = e.authUrl ?? Oe();
|
|
2798
2798
|
n((h) => ({ ...h, isLoading: !0, error: null }));
|
|
2799
2799
|
try {
|
|
2800
2800
|
const h = await Fn(d), u = await qn({ optionsJSON: h }), g = await Bn(d, u, f);
|
|
@@ -2823,16 +2823,16 @@ function go({ children: t, config: e }) {
|
|
|
2823
2823
|
}),
|
|
2824
2824
|
[r, o, s, a, i]
|
|
2825
2825
|
);
|
|
2826
|
-
return /* @__PURE__ */ R.jsx(
|
|
2826
|
+
return /* @__PURE__ */ R.jsx(Ve, { value: c, children: t });
|
|
2827
2827
|
}
|
|
2828
2828
|
function Xn() {
|
|
2829
|
-
const t =
|
|
2829
|
+
const t = xe(Ve);
|
|
2830
2830
|
if (!t)
|
|
2831
2831
|
throw new Error("useAuth must be used within an AuthProvider");
|
|
2832
2832
|
return t;
|
|
2833
2833
|
}
|
|
2834
2834
|
function yo() {
|
|
2835
|
-
return
|
|
2835
|
+
return xe(Ve);
|
|
2836
2836
|
}
|
|
2837
2837
|
function So(t) {
|
|
2838
2838
|
const { config: e, guestUrlParam: r } = t, { state: n, login: o } = Xn(), s = A(!1);
|
|
@@ -2891,7 +2891,7 @@ function bo({
|
|
|
2891
2891
|
return null;
|
|
2892
2892
|
}
|
|
2893
2893
|
}
|
|
2894
|
-
const
|
|
2894
|
+
const Ie = ge("useIkonApp");
|
|
2895
2895
|
function Zn() {
|
|
2896
2896
|
if (typeof window < "u" && window.__IKON_AUTH_CONFIG__)
|
|
2897
2897
|
return window.__IKON_AUTH_CONFIG__;
|
|
@@ -2903,38 +2903,40 @@ function Qn() {
|
|
|
2903
2903
|
function wo(t) {
|
|
2904
2904
|
const { authConfig: e, modules: r, timeouts: n, backgroundAudio: o, webRtc: s } = t, i = e === void 0 ? Zn() ?? null : e, a = Qn(), c = A(null), f = A(null), d = A(null), h = A(!1), u = A(o), g = A(n), y = A(s);
|
|
2905
2905
|
u.current = o, g.current = n, y.current = s;
|
|
2906
|
-
const [S, m] =
|
|
2906
|
+
const [S, m] = W("idle"), [p, w] = W(null), [T, _] = W(null), [D, G] = W(null), [Z, C] = W(null), [P, U] = W(null), [O, F] = W(null), [Y, Q] = W(!1), B = K(() => {
|
|
2907
2907
|
try {
|
|
2908
2908
|
const E = Nt();
|
|
2909
2909
|
return (E.sessionId || E.channelKey) && Pt(), E;
|
|
2910
2910
|
} catch {
|
|
2911
2911
|
return { parameters: {} };
|
|
2912
2912
|
}
|
|
2913
|
-
}, []),
|
|
2913
|
+
}, []), H = K(() => i?.enabled ? yt() : null, [i?.enabled]), X = a?.enabled ?? !1, ee = a?.host ?? "localhost", te = a?.port ?? 8443;
|
|
2914
2914
|
M(() => {
|
|
2915
|
-
!X &&
|
|
2915
|
+
!X && Ke() && i && !i.enabled && i.spaceId && !O && !Y && (Q(!0), bt(i.spaceId, i.authUrl ?? Oe()).then((I) => {
|
|
2916
2916
|
F(I.token);
|
|
2917
2917
|
}).catch((I) => {
|
|
2918
|
-
|
|
2918
|
+
Ie.error("Anonymous auth failed:", I), w(I instanceof Error ? I.message : "Anonymous auth failed");
|
|
2919
2919
|
}).finally(() => {
|
|
2920
2920
|
Q(!1);
|
|
2921
2921
|
}));
|
|
2922
|
-
}, [X, i, O,
|
|
2922
|
+
}, [X, i, O, Y]);
|
|
2923
2923
|
const l = K(() => {
|
|
2924
2924
|
if (X) {
|
|
2925
|
-
const E =
|
|
2925
|
+
const E = H?.token ? jt(H.token) ?? void 0 : void 0;
|
|
2926
2926
|
return {
|
|
2927
2927
|
local: {
|
|
2928
2928
|
host: ee,
|
|
2929
2929
|
httpsPort: te,
|
|
2930
2930
|
userId: E,
|
|
2931
|
+
token: H?.token ?? void 0,
|
|
2932
|
+
spaceId: i?.spaceId,
|
|
2931
2933
|
parameters: B.parameters
|
|
2932
2934
|
}
|
|
2933
2935
|
};
|
|
2934
2936
|
}
|
|
2935
|
-
return
|
|
2937
|
+
return H?.token && i?.spaceId ? {
|
|
2936
2938
|
sessionToken: {
|
|
2937
|
-
token:
|
|
2939
|
+
token: H.token,
|
|
2938
2940
|
spaceId: i.spaceId,
|
|
2939
2941
|
backendType: Ye(),
|
|
2940
2942
|
sessionId: B.sessionId,
|
|
@@ -2950,16 +2952,16 @@ function wo(t) {
|
|
|
2950
2952
|
channelKey: B.channelKey,
|
|
2951
2953
|
parameters: B.parameters
|
|
2952
2954
|
}
|
|
2953
|
-
} :
|
|
2955
|
+
} : Ke() ? null : {
|
|
2954
2956
|
local: {
|
|
2955
2957
|
host: ee,
|
|
2956
2958
|
httpsPort: te,
|
|
2957
|
-
|
|
2959
|
+
spaceId: i?.spaceId,
|
|
2958
2960
|
parameters: B.parameters
|
|
2959
2961
|
}
|
|
2960
2962
|
};
|
|
2961
|
-
}, [X, ee, te,
|
|
2962
|
-
|
|
2963
|
+
}, [X, ee, te, H?.token, i?.spaceId, O, B.sessionId, B.channelKey, B.parameters]);
|
|
2964
|
+
Wr(T);
|
|
2963
2965
|
const b = qr(T);
|
|
2964
2966
|
M(() => {
|
|
2965
2967
|
if (!h.current) {
|
|
@@ -2967,7 +2969,7 @@ function wo(t) {
|
|
|
2967
2969
|
for (const E of r)
|
|
2968
2970
|
E(d.current);
|
|
2969
2971
|
d.current.loadRegisteredModules().catch((E) => {
|
|
2970
|
-
|
|
2972
|
+
Ie.error("Failed to load UI modules", E);
|
|
2971
2973
|
});
|
|
2972
2974
|
}
|
|
2973
2975
|
}, []), M(() => {
|
|
@@ -2988,7 +2990,7 @@ function wo(t) {
|
|
|
2988
2990
|
c.current = E;
|
|
2989
2991
|
const I = new Zt({ client: E });
|
|
2990
2992
|
return f.current = I, _(I), E.connect().catch((V) => {
|
|
2991
|
-
|
|
2993
|
+
Ie.error("Connection failed:", V);
|
|
2992
2994
|
}), () => {
|
|
2993
2995
|
E.disconnect(), c.current = null, I.dispose(), f.current = null, G(null), C(null), U(null);
|
|
2994
2996
|
};
|
|
@@ -3024,7 +3026,7 @@ function vo(t) {
|
|
|
3024
3026
|
}
|
|
3025
3027
|
let eo = 0;
|
|
3026
3028
|
function Ro(t = 5, e = 5e3) {
|
|
3027
|
-
const [r, n] =
|
|
3029
|
+
const [r, n] = W([]), o = A(/* @__PURE__ */ new Map()), s = x((i) => {
|
|
3028
3030
|
const a = o.current.get(i);
|
|
3029
3031
|
a && (clearTimeout(a), o.current.delete(i)), n((c) => c.filter((f) => f.id !== i));
|
|
3030
3032
|
}, []);
|
|
@@ -3033,7 +3035,7 @@ function Ro(t = 5, e = 5e3) {
|
|
|
3033
3035
|
(c) => {
|
|
3034
3036
|
if (!Ut())
|
|
3035
3037
|
return;
|
|
3036
|
-
const f = `toast-${++eo}`, d = c.level ===
|
|
3038
|
+
const f = `toast-${++eo}`, d = c.level === We.ERROR ? "error" : "warn", h = {
|
|
3037
3039
|
id: f,
|
|
3038
3040
|
level: d,
|
|
3039
3041
|
message: c.message,
|
|
@@ -3045,7 +3047,7 @@ function Ro(t = 5, e = 5e3) {
|
|
|
3045
3047
|
}, e);
|
|
3046
3048
|
i.set(f, u);
|
|
3047
3049
|
},
|
|
3048
|
-
{ minLevel:
|
|
3050
|
+
{ minLevel: We.WARN }
|
|
3049
3051
|
);
|
|
3050
3052
|
return () => {
|
|
3051
3053
|
a();
|
|
@@ -3055,7 +3057,7 @@ function Ro(t = 5, e = 5e3) {
|
|
|
3055
3057
|
};
|
|
3056
3058
|
}, [t, e, s]), { toasts: r, dismissToast: s };
|
|
3057
3059
|
}
|
|
3058
|
-
const
|
|
3060
|
+
const At = lt(null);
|
|
3059
3061
|
function to(t, e) {
|
|
3060
3062
|
return e ? t.replace(/\{(\w+)\}/g, (r, n) => e[n] ?? `{${n}}`) : t;
|
|
3061
3063
|
}
|
|
@@ -3086,10 +3088,10 @@ function Eo({
|
|
|
3086
3088
|
}),
|
|
3087
3089
|
[i, s]
|
|
3088
3090
|
);
|
|
3089
|
-
return /* @__PURE__ */ R.jsx(
|
|
3091
|
+
return /* @__PURE__ */ R.jsx(At, { value: a, children: t });
|
|
3090
3092
|
}
|
|
3091
3093
|
function Ao() {
|
|
3092
|
-
const t =
|
|
3094
|
+
const t = xe(At);
|
|
3093
3095
|
if (!t)
|
|
3094
3096
|
throw new Error("useI18n must be used within an I18nProvider");
|
|
3095
3097
|
return t;
|
|
@@ -3100,9 +3102,9 @@ export {
|
|
|
3100
3102
|
Eo as I18nProvider,
|
|
3101
3103
|
ir as IKON_UI_BASE_MODULE,
|
|
3102
3104
|
Sr as IKON_UI_MEDIA_MODULE,
|
|
3103
|
-
jr as
|
|
3104
|
-
Nr as
|
|
3105
|
-
|
|
3105
|
+
jr as IKON_UI_SHADERTOY_MODULE,
|
|
3106
|
+
Nr as IKON_UI_SHADERTOY_TYPE,
|
|
3107
|
+
Ne as IKON_UI_STREAM_CATEGORY,
|
|
3106
3108
|
hr as IKON_UI_VIDEO_CANVAS_TYPE,
|
|
3107
3109
|
mr as IKON_UI_VIDEO_URL_PLAYER_TYPE,
|
|
3108
3110
|
Zt as IkonUi,
|
|
@@ -3112,20 +3114,20 @@ export {
|
|
|
3112
3114
|
Ht as UiRenderer,
|
|
3113
3115
|
Co as UiStreamStore,
|
|
3114
3116
|
lo as areIkonUiModuleListsEqual,
|
|
3115
|
-
|
|
3117
|
+
bt as authenticateAnonymous,
|
|
3116
3118
|
Dn as buildOAuthRedirectUrl,
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
+
St as clearAuthSession,
|
|
3120
|
+
ut as clearOAuthParams,
|
|
3119
3121
|
sr as createBaseResolvers,
|
|
3120
3122
|
ao as createComponentLibrary,
|
|
3121
3123
|
xr as createIkonUiRegistry,
|
|
3122
3124
|
gr as createMediaResolvers,
|
|
3123
|
-
Pr as
|
|
3125
|
+
Pr as createShadertoyRendererResolver,
|
|
3124
3126
|
Xt as isIkonUiCategoryMatch,
|
|
3125
|
-
|
|
3127
|
+
yt as loadAuthSession,
|
|
3126
3128
|
ar as loadBaseModule,
|
|
3127
3129
|
br as loadMediaModule,
|
|
3128
|
-
Lr as
|
|
3130
|
+
Lr as loadShadertoyModule,
|
|
3129
3131
|
dn as normalizeIkonUiModuleList,
|
|
3130
3132
|
ho as parseIkonUiInitPayload,
|
|
3131
3133
|
Un as parseOAuthCallback,
|
|
@@ -3134,10 +3136,10 @@ export {
|
|
|
3134
3136
|
fo as readIkonUiModulesFromSources,
|
|
3135
3137
|
cr as registerBaseModule,
|
|
3136
3138
|
wr as registerMediaModule,
|
|
3137
|
-
Mr as
|
|
3139
|
+
Mr as registerShadertoyModule,
|
|
3138
3140
|
qt as renderChildren,
|
|
3139
3141
|
mo as renderMotionLetters,
|
|
3140
|
-
|
|
3142
|
+
Se as saveAuthSession,
|
|
3141
3143
|
po as sendMagicLink,
|
|
3142
3144
|
ue as sessionToUser,
|
|
3143
3145
|
Xn as useAuth,
|
|
@@ -3145,10 +3147,10 @@ export {
|
|
|
3145
3147
|
yo as useAuthOptional,
|
|
3146
3148
|
Ao as useI18n,
|
|
3147
3149
|
wo as useIkonApp,
|
|
3148
|
-
|
|
3150
|
+
Wr as useIkonStyles,
|
|
3149
3151
|
qr as useIkonUiStores,
|
|
3150
3152
|
vo as useLazyFont,
|
|
3151
3153
|
Ro as useToasts,
|
|
3152
|
-
|
|
3154
|
+
J as useUiNode,
|
|
3153
3155
|
co as useUiStore
|
|
3154
3156
|
};
|