@ikonai/sdk-react-ui 1.0.10 → 1.0.11
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.js +316 -296
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IkonUiCore as kt, UiStreamStore as Ct } from "@ikonai/sdk-ui";
|
|
2
|
-
import { UiStreamStore as
|
|
3
|
-
import It, { useSyncExternalStore as De, useMemo as Y, memo as q, useRef as v, useCallback as
|
|
2
|
+
import { UiStreamStore as vo } from "@ikonai/sdk-ui";
|
|
3
|
+
import It, { useSyncExternalStore as De, useMemo as Y, memo as q, useRef as v, useCallback as x, Fragment as Ot, useEffect as D, useState as X, createContext as dt, use as Fe } from "react";
|
|
4
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
5
|
var pe = { exports: {} }, ie = {};
|
|
6
6
|
/**
|
|
@@ -129,7 +129,7 @@ function Ut() {
|
|
|
129
129
|
return Error("react-stack-top-frame");
|
|
130
130
|
}
|
|
131
131
|
function i(u) {
|
|
132
|
-
if (
|
|
132
|
+
if (F.call(u, "key")) {
|
|
133
133
|
var y = Object.getOwnPropertyDescriptor(u, "key").get;
|
|
134
134
|
if (y && y.isReactWarning) return !1;
|
|
135
135
|
}
|
|
@@ -153,12 +153,12 @@ function Ut() {
|
|
|
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, C, K,
|
|
157
|
-
return R =
|
|
156
|
+
function f(u, y, R, C, K, B, ee, se) {
|
|
157
|
+
return R = B.ref, u = {
|
|
158
158
|
$$typeof: h,
|
|
159
159
|
type: u,
|
|
160
160
|
key: y,
|
|
161
|
-
props:
|
|
161
|
+
props: B,
|
|
162
162
|
_owner: K
|
|
163
163
|
}, (R !== void 0 ? R : null) !== null ? Object.defineProperty(u, "ref", {
|
|
164
164
|
enumerable: !1,
|
|
@@ -185,7 +185,7 @@ function Ut() {
|
|
|
185
185
|
value: se
|
|
186
186
|
}), Object.freeze && (Object.freeze(u.props), Object.freeze(u)), u;
|
|
187
187
|
}
|
|
188
|
-
function d(u, y, R, C, K,
|
|
188
|
+
function d(u, y, R, C, K, B, ee, se) {
|
|
189
189
|
var N = y.children;
|
|
190
190
|
if (N !== void 0)
|
|
191
191
|
if (C)
|
|
@@ -198,7 +198,7 @@ function Ut() {
|
|
|
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
200
|
else m(N);
|
|
201
|
-
if (
|
|
201
|
+
if (F.call(y, "key")) {
|
|
202
202
|
N = t(u);
|
|
203
203
|
var J = Object.keys(y).filter(function(U) {
|
|
204
204
|
return U !== "key";
|
|
@@ -227,7 +227,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
227
227
|
), f(
|
|
228
228
|
u,
|
|
229
229
|
N,
|
|
230
|
-
|
|
230
|
+
B,
|
|
231
231
|
K,
|
|
232
232
|
o(),
|
|
233
233
|
R,
|
|
@@ -238,7 +238,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
238
238
|
function m(u) {
|
|
239
239
|
typeof u == "object" && u !== null && u.$$typeof === h && u._store && (u._store.validated = 1);
|
|
240
240
|
}
|
|
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,
|
|
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, F = Object.prototype.hasOwnProperty, z = Array.isArray, te = console.createTask ? console.createTask : function() {
|
|
242
242
|
return null;
|
|
243
243
|
};
|
|
244
244
|
l = {
|
|
@@ -251,7 +251,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
251
251
|
s
|
|
252
252
|
)(), me = te(n(s)), oe = {};
|
|
253
253
|
ae.Fragment = b, ae.jsx = function(u, y, R, C, K) {
|
|
254
|
-
var
|
|
254
|
+
var B = 1e4 > _.recentlyCreatedOwnerStacks++;
|
|
255
255
|
return d(
|
|
256
256
|
u,
|
|
257
257
|
y,
|
|
@@ -259,11 +259,11 @@ React keys must be passed directly to JSX without using spread:
|
|
|
259
259
|
!1,
|
|
260
260
|
C,
|
|
261
261
|
K,
|
|
262
|
-
|
|
263
|
-
|
|
262
|
+
B ? Error("react-stack-top-frame") : H,
|
|
263
|
+
B ? te(n(u)) : me
|
|
264
264
|
);
|
|
265
265
|
}, ae.jsxs = function(u, y, R, C, K) {
|
|
266
|
-
var
|
|
266
|
+
var B = 1e4 > _.recentlyCreatedOwnerStacks++;
|
|
267
267
|
return d(
|
|
268
268
|
u,
|
|
269
269
|
y,
|
|
@@ -271,8 +271,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
271
271
|
!0,
|
|
272
272
|
C,
|
|
273
273
|
K,
|
|
274
|
-
|
|
275
|
-
|
|
274
|
+
B ? Error("react-stack-top-frame") : H,
|
|
275
|
+
B ? te(n(u)) : me
|
|
276
276
|
);
|
|
277
277
|
};
|
|
278
278
|
}()), ae;
|
|
@@ -370,7 +370,7 @@ const qt = q(function({ store: e, library: r, viewId: n, emptyFallback: o = null
|
|
|
370
370
|
m.current = i;
|
|
371
371
|
const l = v(a);
|
|
372
372
|
l.current = a;
|
|
373
|
-
const h =
|
|
373
|
+
const h = x((b, g) => {
|
|
374
374
|
if (!b)
|
|
375
375
|
return;
|
|
376
376
|
const p = Bt(g);
|
|
@@ -417,11 +417,11 @@ class Gt {
|
|
|
417
417
|
return this.renderers.get(e.type) ?? this.fallback;
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
|
-
function
|
|
420
|
+
function to(t, e) {
|
|
421
421
|
const r = Object.entries(t);
|
|
422
422
|
return new Gt(r, e);
|
|
423
423
|
}
|
|
424
|
-
function
|
|
424
|
+
function ro(t) {
|
|
425
425
|
return De(
|
|
426
426
|
(e) => t.subscribe(e),
|
|
427
427
|
() => t.getSnapshot(),
|
|
@@ -432,7 +432,7 @@ const Me = "ikon-ui";
|
|
|
432
432
|
function Ht(t, e) {
|
|
433
433
|
return t === e;
|
|
434
434
|
}
|
|
435
|
-
const
|
|
435
|
+
const no = q(function({ stores: e, registry: r, category: n = Me, onAction: o, client: s }) {
|
|
436
436
|
const i = Y(() => Array.from(e.keys()).sort().join(","), [e]), a = v(o);
|
|
437
437
|
a.current = o;
|
|
438
438
|
const c = v(s);
|
|
@@ -526,6 +526,12 @@ class Jt {
|
|
|
526
526
|
r(e);
|
|
527
527
|
}
|
|
528
528
|
}
|
|
529
|
+
function Xt(t) {
|
|
530
|
+
if (typeof t == "string") {
|
|
531
|
+
const e = t.trim();
|
|
532
|
+
return e.length > 0 ? e : void 0;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
529
535
|
function fe(t) {
|
|
530
536
|
if (typeof t == "string") {
|
|
531
537
|
const e = t.trim();
|
|
@@ -545,10 +551,10 @@ function Be(...t) {
|
|
|
545
551
|
}
|
|
546
552
|
return e || void 0;
|
|
547
553
|
}
|
|
548
|
-
const Xe = /* @__PURE__ */ new WeakMap(),
|
|
554
|
+
const Xe = /* @__PURE__ */ new WeakMap(), Zt = {};
|
|
549
555
|
function $e(t) {
|
|
550
556
|
if (!t)
|
|
551
|
-
return
|
|
557
|
+
return Zt;
|
|
552
558
|
const e = Xe.get(t);
|
|
553
559
|
if (e)
|
|
554
560
|
return e;
|
|
@@ -557,10 +563,10 @@ function $e(t) {
|
|
|
557
563
|
o != null && (typeof o == "string" || typeof o == "number" || typeof o == "boolean") && (r[n] = o);
|
|
558
564
|
return Xe.set(t, r), r;
|
|
559
565
|
}
|
|
560
|
-
function
|
|
566
|
+
function Qt() {
|
|
561
567
|
const t = q(function({ nodeId: r, context: n }) {
|
|
562
568
|
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
|
|
569
|
+
return D(() => {
|
|
564
570
|
if (typeof document > "u")
|
|
565
571
|
return;
|
|
566
572
|
const l = s.current;
|
|
@@ -613,20 +619,34 @@ function Zt() {
|
|
|
613
619
|
return t;
|
|
614
620
|
};
|
|
615
621
|
}
|
|
616
|
-
function
|
|
622
|
+
function er() {
|
|
617
623
|
const t = q(function({ nodeId: r, context: n, className: o }) {
|
|
618
|
-
const s = Z(n.store, r)
|
|
624
|
+
const s = Z(n.store, r), i = Xt(s?.props?.onInvokeId), a = x(() => {
|
|
625
|
+
i && n.dispatchAction(i);
|
|
626
|
+
}, [i, n]);
|
|
619
627
|
if (!s)
|
|
620
628
|
return null;
|
|
621
|
-
const
|
|
622
|
-
|
|
629
|
+
const c = $e(s.props);
|
|
630
|
+
delete c.onInvokeId;
|
|
631
|
+
const f = Be(fe(s.props?.className), o), d = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
632
|
+
return /* @__PURE__ */ A.jsx(
|
|
633
|
+
"div",
|
|
634
|
+
{
|
|
635
|
+
...c,
|
|
636
|
+
"data-ikon-node-id": s.id,
|
|
637
|
+
className: f,
|
|
638
|
+
onClick: i ? a : void 0,
|
|
639
|
+
style: i ? { cursor: "pointer" } : void 0,
|
|
640
|
+
children: d
|
|
641
|
+
}
|
|
642
|
+
);
|
|
623
643
|
});
|
|
624
644
|
return ({ type: e }) => {
|
|
625
645
|
if (e === "std.div")
|
|
626
646
|
return t;
|
|
627
647
|
};
|
|
628
648
|
}
|
|
629
|
-
function
|
|
649
|
+
function tr() {
|
|
630
650
|
const t = q(function({ nodeId: r, context: n, className: o }) {
|
|
631
651
|
const s = Z(n.store, r);
|
|
632
652
|
if (!s)
|
|
@@ -639,7 +659,7 @@ function er() {
|
|
|
639
659
|
return t;
|
|
640
660
|
};
|
|
641
661
|
}
|
|
642
|
-
function
|
|
662
|
+
function rr() {
|
|
643
663
|
const t = q(function({ nodeId: r, context: n, className: o }) {
|
|
644
664
|
const s = Z(n.store, r);
|
|
645
665
|
if (!s)
|
|
@@ -652,17 +672,17 @@ function tr() {
|
|
|
652
672
|
return t;
|
|
653
673
|
};
|
|
654
674
|
}
|
|
655
|
-
function
|
|
675
|
+
function nr() {
|
|
656
676
|
return [
|
|
657
|
-
Qt(),
|
|
658
677
|
er(),
|
|
659
678
|
tr(),
|
|
660
|
-
|
|
679
|
+
rr(),
|
|
680
|
+
Qt()
|
|
661
681
|
];
|
|
662
682
|
}
|
|
663
|
-
const
|
|
664
|
-
function
|
|
665
|
-
t.registerModule(
|
|
683
|
+
const or = "base", sr = async () => nr();
|
|
684
|
+
function ir(t) {
|
|
685
|
+
t.registerModule(or, sr);
|
|
666
686
|
}
|
|
667
687
|
function ft(t) {
|
|
668
688
|
if (typeof t == "string") {
|
|
@@ -695,11 +715,11 @@ function je(t) {
|
|
|
695
715
|
const e = t.trim();
|
|
696
716
|
return e.length > 0 ? e : void 0;
|
|
697
717
|
}
|
|
698
|
-
const
|
|
699
|
-
function
|
|
718
|
+
const ar = "std.video-canvas", cr = "std.video-url-player";
|
|
719
|
+
function ur() {
|
|
700
720
|
const t = q(function({ nodeId: r, context: n, className: o }) {
|
|
701
721
|
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
|
|
722
|
+
return D(() => {
|
|
703
723
|
const l = i.current;
|
|
704
724
|
if (!(!a || !l || !c))
|
|
705
725
|
return a.attachCanvas(c, l), () => {
|
|
@@ -719,12 +739,12 @@ function cr() {
|
|
|
719
739
|
) : null;
|
|
720
740
|
});
|
|
721
741
|
return ({ type: e }) => {
|
|
722
|
-
if (e ===
|
|
742
|
+
if (e === ar)
|
|
723
743
|
return t;
|
|
724
744
|
};
|
|
725
745
|
}
|
|
726
|
-
function
|
|
727
|
-
return [
|
|
746
|
+
function lr() {
|
|
747
|
+
return [ur(), dr()];
|
|
728
748
|
}
|
|
729
749
|
function ce(t) {
|
|
730
750
|
if (typeof t == "boolean")
|
|
@@ -735,7 +755,7 @@ function ce(t) {
|
|
|
735
755
|
if (e === "false") return !1;
|
|
736
756
|
}
|
|
737
757
|
}
|
|
738
|
-
function
|
|
758
|
+
function dr() {
|
|
739
759
|
const t = q(function({
|
|
740
760
|
nodeId: r,
|
|
741
761
|
context: n,
|
|
@@ -764,27 +784,27 @@ function lr() {
|
|
|
764
784
|
);
|
|
765
785
|
});
|
|
766
786
|
return ({ type: e }) => {
|
|
767
|
-
if (e ===
|
|
787
|
+
if (e === cr)
|
|
768
788
|
return t;
|
|
769
789
|
};
|
|
770
790
|
}
|
|
771
|
-
const
|
|
772
|
-
function
|
|
773
|
-
t.registerModule(
|
|
791
|
+
const fr = "media", hr = async () => lr();
|
|
792
|
+
function mr(t) {
|
|
793
|
+
t.registerModule(fr, hr);
|
|
774
794
|
}
|
|
775
|
-
const
|
|
795
|
+
const pr = `#version 300 es
|
|
776
796
|
in vec4 a_position;
|
|
777
797
|
void main() {
|
|
778
798
|
gl_Position = a_position;
|
|
779
799
|
}
|
|
780
800
|
`;
|
|
781
|
-
function
|
|
801
|
+
function gr(t, e) {
|
|
782
802
|
return new RegExp(`\\buniform\\s+\\w+\\s+${e}\\s*;`, "g").test(t);
|
|
783
803
|
}
|
|
784
|
-
function
|
|
804
|
+
function yr(t, e) {
|
|
785
805
|
const r = [];
|
|
786
806
|
for (const [n, o] of Object.entries(e)) {
|
|
787
|
-
if (
|
|
807
|
+
if (gr(t, n))
|
|
788
808
|
continue;
|
|
789
809
|
let s;
|
|
790
810
|
switch (o.type) {
|
|
@@ -837,7 +857,7 @@ void main() {
|
|
|
837
857
|
}
|
|
838
858
|
`;
|
|
839
859
|
}
|
|
840
|
-
class
|
|
860
|
+
class Sr {
|
|
841
861
|
gl;
|
|
842
862
|
program = null;
|
|
843
863
|
positionBuffer = null;
|
|
@@ -873,10 +893,10 @@ class yr {
|
|
|
873
893
|
}
|
|
874
894
|
compile(e, r = {}) {
|
|
875
895
|
this.lastError = null, this.customUniforms = r, this.currentShaderSource = e;
|
|
876
|
-
const n = this.gl, o = this.compileShader(n.VERTEX_SHADER,
|
|
896
|
+
const n = this.gl, o = this.compileShader(n.VERTEX_SHADER, pr);
|
|
877
897
|
if (!o)
|
|
878
898
|
return !1;
|
|
879
|
-
const s =
|
|
899
|
+
const s = yr(e, r), i = this.compileShader(n.FRAGMENT_SHADER, s);
|
|
880
900
|
if (!i)
|
|
881
901
|
return n.deleteShader(o), !1;
|
|
882
902
|
const a = n.createProgram();
|
|
@@ -967,7 +987,7 @@ class yr {
|
|
|
967
987
|
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();
|
|
968
988
|
}
|
|
969
989
|
}
|
|
970
|
-
function
|
|
990
|
+
function br(t) {
|
|
971
991
|
if (typeof t == "string") {
|
|
972
992
|
const e = t.trim();
|
|
973
993
|
return e.length > 0 ? e : void 0;
|
|
@@ -977,7 +997,7 @@ function Sr(t) {
|
|
|
977
997
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
978
998
|
}
|
|
979
999
|
}
|
|
980
|
-
function
|
|
1000
|
+
function wr(...t) {
|
|
981
1001
|
const e = [];
|
|
982
1002
|
for (const r of t)
|
|
983
1003
|
r && r.trim() && e.push(r.trim());
|
|
@@ -992,10 +1012,10 @@ function Re(t) {
|
|
|
992
1012
|
return Math.floor(e);
|
|
993
1013
|
}
|
|
994
1014
|
}
|
|
995
|
-
function
|
|
1015
|
+
function vr(t) {
|
|
996
1016
|
return typeof t == "string" ? t : "";
|
|
997
1017
|
}
|
|
998
|
-
function
|
|
1018
|
+
function Er(t) {
|
|
999
1019
|
if (typeof t == "boolean")
|
|
1000
1020
|
return t;
|
|
1001
1021
|
if (typeof t == "string") {
|
|
@@ -1004,7 +1024,7 @@ function vr(t) {
|
|
|
1004
1024
|
if (e === "false") return !1;
|
|
1005
1025
|
}
|
|
1006
1026
|
}
|
|
1007
|
-
function
|
|
1027
|
+
function Rr(t) {
|
|
1008
1028
|
if (!t || typeof t != "object")
|
|
1009
1029
|
return {};
|
|
1010
1030
|
const e = {}, r = t;
|
|
@@ -1019,7 +1039,7 @@ function Er(t) {
|
|
|
1019
1039
|
}
|
|
1020
1040
|
return e;
|
|
1021
1041
|
}
|
|
1022
|
-
function
|
|
1042
|
+
function Ar(t, e) {
|
|
1023
1043
|
const r = Object.keys(t), n = Object.keys(e);
|
|
1024
1044
|
if (r.length !== n.length)
|
|
1025
1045
|
return !1;
|
|
@@ -1040,8 +1060,8 @@ function Rr(t, e) {
|
|
|
1040
1060
|
}
|
|
1041
1061
|
return !0;
|
|
1042
1062
|
}
|
|
1043
|
-
const
|
|
1044
|
-
function
|
|
1063
|
+
const Tr = "std.shader-canvas";
|
|
1064
|
+
function kr() {
|
|
1045
1065
|
const t = q(function({ nodeId: r, context: n, className: o }) {
|
|
1046
1066
|
const s = Z(n.store, r), i = v(null), a = v(null), c = v(null), f = v(0), d = v(""), m = v({}), l = v({
|
|
1047
1067
|
x: 0,
|
|
@@ -1049,12 +1069,12 @@ function Tr() {
|
|
|
1049
1069
|
clickX: 0,
|
|
1050
1070
|
clickY: 0,
|
|
1051
1071
|
isDown: !1
|
|
1052
|
-
}), h = s ?
|
|
1053
|
-
|
|
1072
|
+
}), h = s ? vr(s.props?.shaderSource) : "", S = s ? Re(s.props?.fps) ?? 60 : 60, b = s?.props?.uniforms, g = Y(() => Rr(b), [b]), p = s ? Er(s.props?.enableMouse) ?? !0 : !0, w = s ? Re(s.props?.width) : void 0, T = s ? Re(s.props?.height) : void 0, I = s ? wr(br(s.props?.className), o) : o;
|
|
1073
|
+
D(() => {
|
|
1054
1074
|
const k = i.current;
|
|
1055
1075
|
if (k) {
|
|
1056
1076
|
try {
|
|
1057
|
-
const O = new
|
|
1077
|
+
const O = new Sr(k);
|
|
1058
1078
|
a.current = O;
|
|
1059
1079
|
} catch (O) {
|
|
1060
1080
|
console.error("[ShaderRenderer] Failed to create WebGL2 context:", O);
|
|
@@ -1063,7 +1083,7 @@ function Tr() {
|
|
|
1063
1083
|
a.current && (a.current.destroy(), a.current = null);
|
|
1064
1084
|
};
|
|
1065
1085
|
}
|
|
1066
|
-
}, []),
|
|
1086
|
+
}, []), D(() => {
|
|
1067
1087
|
const k = a.current;
|
|
1068
1088
|
if (!(!k || !h) && d.current !== h)
|
|
1069
1089
|
if (k.compile(h, g))
|
|
@@ -1072,39 +1092,39 @@ function Tr() {
|
|
|
1072
1092
|
const L = k.getError();
|
|
1073
1093
|
console.error("[ShaderRenderer] Shader compilation failed:", L);
|
|
1074
1094
|
}
|
|
1075
|
-
}, [h, g]),
|
|
1095
|
+
}, [h, g]), D(() => {
|
|
1076
1096
|
const k = a.current;
|
|
1077
|
-
!k || !d.current ||
|
|
1078
|
-
}, [g]),
|
|
1097
|
+
!k || !d.current || Ar(m.current, g) || (k.setCustomUniforms(g), m.current = g);
|
|
1098
|
+
}, [g]), D(() => {
|
|
1079
1099
|
const k = a.current;
|
|
1080
1100
|
if (!k || !d.current) return;
|
|
1081
1101
|
const O = 1e3 / S, L = (_) => {
|
|
1082
|
-
const
|
|
1083
|
-
|
|
1102
|
+
const F = _ - f.current;
|
|
1103
|
+
F >= O && (f.current = _ - F % O, k.draw()), c.current = requestAnimationFrame(L);
|
|
1084
1104
|
};
|
|
1085
1105
|
return c.current = requestAnimationFrame(L), () => {
|
|
1086
1106
|
c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
|
|
1087
1107
|
};
|
|
1088
1108
|
}, [S]);
|
|
1089
|
-
const j =
|
|
1109
|
+
const j = x(
|
|
1090
1110
|
(k) => {
|
|
1091
1111
|
if (!p) return;
|
|
1092
1112
|
const O = i.current, L = a.current;
|
|
1093
1113
|
if (!O || !L) return;
|
|
1094
|
-
const _ = O.getBoundingClientRect(),
|
|
1095
|
-
l.current.x =
|
|
1114
|
+
const _ = O.getBoundingClientRect(), F = k.clientX - _.left, z = _.height - (k.clientY - _.top);
|
|
1115
|
+
l.current.x = F, l.current.y = z, L.setMouse(F, z, l.current.clickX, l.current.clickY);
|
|
1096
1116
|
},
|
|
1097
1117
|
[p]
|
|
1098
|
-
), G =
|
|
1118
|
+
), G = x(
|
|
1099
1119
|
(k) => {
|
|
1100
1120
|
if (!p) return;
|
|
1101
1121
|
const O = i.current, L = a.current;
|
|
1102
1122
|
if (!O || !L) return;
|
|
1103
|
-
const _ = O.getBoundingClientRect(),
|
|
1104
|
-
l.current.isDown = !0, l.current.clickX =
|
|
1123
|
+
const _ = O.getBoundingClientRect(), F = k.clientX - _.left, z = _.height - (k.clientY - _.top);
|
|
1124
|
+
l.current.isDown = !0, l.current.clickX = F, l.current.clickY = z, L.setMouse(F, z, F, z);
|
|
1105
1125
|
},
|
|
1106
1126
|
[p]
|
|
1107
|
-
), Q =
|
|
1127
|
+
), Q = x(() => {
|
|
1108
1128
|
p && (l.current.isDown = !1, l.current.clickX = -Math.abs(l.current.clickX));
|
|
1109
1129
|
}, [p]);
|
|
1110
1130
|
return s ? /* @__PURE__ */ A.jsx(
|
|
@@ -1123,16 +1143,16 @@ function Tr() {
|
|
|
1123
1143
|
) : null;
|
|
1124
1144
|
});
|
|
1125
1145
|
return ({ type: e }) => {
|
|
1126
|
-
if (e ===
|
|
1146
|
+
if (e === Tr)
|
|
1127
1147
|
return t;
|
|
1128
1148
|
};
|
|
1129
1149
|
}
|
|
1130
|
-
const
|
|
1131
|
-
function
|
|
1132
|
-
t.registerModule(
|
|
1150
|
+
const Cr = "shader", Ir = async () => kr();
|
|
1151
|
+
function Or(t) {
|
|
1152
|
+
t.registerModule(Cr, Ir);
|
|
1133
1153
|
}
|
|
1134
1154
|
const Ze = we("UIRegistry");
|
|
1135
|
-
class
|
|
1155
|
+
class _r {
|
|
1136
1156
|
baseResolvers = [];
|
|
1137
1157
|
moduleLoaders = /* @__PURE__ */ new Map();
|
|
1138
1158
|
moduleResolvers = /* @__PURE__ */ new Map();
|
|
@@ -1154,7 +1174,7 @@ class Or {
|
|
|
1154
1174
|
for (const [n, o] of this.moduleLoaders.entries())
|
|
1155
1175
|
if (!this.moduleResolvers.has(n))
|
|
1156
1176
|
try {
|
|
1157
|
-
const s = await o(), i =
|
|
1177
|
+
const s = await o(), i = Mr(s);
|
|
1158
1178
|
this.moduleResolvers.set(n, i), e = !0;
|
|
1159
1179
|
} catch (s) {
|
|
1160
1180
|
Ze.error(`[IkonUiRegistry] Failed to load module '${n}'.`, s);
|
|
@@ -1162,7 +1182,7 @@ class Or {
|
|
|
1162
1182
|
const r = [];
|
|
1163
1183
|
for (const n of this.moduleLoaders.keys())
|
|
1164
1184
|
this.moduleResolvers.has(n) && r.push(n);
|
|
1165
|
-
return
|
|
1185
|
+
return jr(r, this.activeModuleOrder) || (this.activeModuleOrder = r, e = !0), e;
|
|
1166
1186
|
}
|
|
1167
1187
|
resolve(e) {
|
|
1168
1188
|
for (const r of this.baseResolvers) {
|
|
@@ -1182,17 +1202,17 @@ class Or {
|
|
|
1182
1202
|
}
|
|
1183
1203
|
}
|
|
1184
1204
|
}
|
|
1185
|
-
function
|
|
1186
|
-
const t = new
|
|
1187
|
-
return
|
|
1205
|
+
function Nr() {
|
|
1206
|
+
const t = new _r();
|
|
1207
|
+
return ir(t), mr(t), Or(t), t.loadRegisteredModules(), t;
|
|
1188
1208
|
}
|
|
1189
|
-
function
|
|
1209
|
+
function Pr(t) {
|
|
1190
1210
|
return Array.isArray(t) ? t : [t];
|
|
1191
1211
|
}
|
|
1192
|
-
function
|
|
1193
|
-
return t ?
|
|
1212
|
+
function Mr(t) {
|
|
1213
|
+
return t ? Pr(t).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
|
|
1194
1214
|
}
|
|
1195
|
-
function
|
|
1215
|
+
function jr(t, e) {
|
|
1196
1216
|
if (t.length !== e.length)
|
|
1197
1217
|
return !1;
|
|
1198
1218
|
for (let r = 0; r < t.length; r += 1)
|
|
@@ -1230,7 +1250,7 @@ const Ae = we("MotionController"), Qe = {
|
|
|
1230
1250
|
"ease-out-back": [0.175, 0.885, 0.32, 1.275],
|
|
1231
1251
|
"ease-in-out-back": [0.68, -0.55, 0.265, 1.55]
|
|
1232
1252
|
};
|
|
1233
|
-
function
|
|
1253
|
+
function $(t) {
|
|
1234
1254
|
return t <= 0 ? 0 : t >= 1 ? 1 : t;
|
|
1235
1255
|
}
|
|
1236
1256
|
function et(t) {
|
|
@@ -1281,37 +1301,37 @@ function rt(t, e, r, n) {
|
|
|
1281
1301
|
d[g] = m(g * 0.1, t, r);
|
|
1282
1302
|
return (g) => g <= 0 ? 0 : g >= 1 ? 1 : m(b(g), e, n);
|
|
1283
1303
|
}
|
|
1284
|
-
function
|
|
1304
|
+
function Lr(t) {
|
|
1285
1305
|
const e = /steps\(\s*([0-9]+)\s*(?:,\s*([a-z-]+)\s*)?\)/i.exec(t);
|
|
1286
1306
|
if (!e)
|
|
1287
|
-
return (o) =>
|
|
1307
|
+
return (o) => $(o);
|
|
1288
1308
|
const r = Math.max(1, parseInt(e[1], 10)), n = (e[2] ?? "end").toLowerCase();
|
|
1289
|
-
return n === "start" || n === "jump-start" ? (o) =>
|
|
1309
|
+
return n === "start" || n === "jump-start" ? (o) => $(Math.ceil(o * r) / r) : n === "none" || n === "jump-none" ? (o) => $(Math.round(o * r) / r) : n === "both" || n === "jump-both" ? (o) => $((Math.floor(o * r) + 0.5) / r) : (o) => $(Math.floor(o * r) / r);
|
|
1290
1310
|
}
|
|
1291
|
-
function
|
|
1311
|
+
function Ur(t) {
|
|
1292
1312
|
if (!t)
|
|
1293
|
-
return (r) =>
|
|
1313
|
+
return (r) => $(r);
|
|
1294
1314
|
const e = t.trim().toLowerCase();
|
|
1295
1315
|
if (!e || e === "linear")
|
|
1296
|
-
return (r) =>
|
|
1316
|
+
return (r) => $(r);
|
|
1297
1317
|
if (Qe[e]) {
|
|
1298
1318
|
const [r, n, o, s] = Qe[e], i = rt(r, n, o, s);
|
|
1299
|
-
return (a) =>
|
|
1319
|
+
return (a) => $(i($(a)));
|
|
1300
1320
|
}
|
|
1301
1321
|
if (e.startsWith("cubic-bezier(") && e.endsWith(")")) {
|
|
1302
1322
|
const n = e.slice(13, -1).split(",").map((o) => Number.parseFloat(o.trim()));
|
|
1303
1323
|
if (n.length === 4 && n.every((o) => Number.isFinite(o))) {
|
|
1304
1324
|
const [o, s, i, a] = n, c = rt(o, s, i, a);
|
|
1305
|
-
return (f) =>
|
|
1325
|
+
return (f) => $(c($(f)));
|
|
1306
1326
|
}
|
|
1307
1327
|
}
|
|
1308
1328
|
if (e.startsWith("steps(") && e.endsWith(")")) {
|
|
1309
|
-
const r =
|
|
1310
|
-
return (n) => r(
|
|
1329
|
+
const r = Lr(e);
|
|
1330
|
+
return (n) => r($(n));
|
|
1311
1331
|
}
|
|
1312
|
-
return (r) =>
|
|
1332
|
+
return (r) => $(r);
|
|
1313
1333
|
}
|
|
1314
|
-
function
|
|
1334
|
+
function xr(t) {
|
|
1315
1335
|
if (!t)
|
|
1316
1336
|
return;
|
|
1317
1337
|
const e = /(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)\s*->\s*(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)/.exec(t);
|
|
@@ -1321,7 +1341,7 @@ function Ur(t) {
|
|
|
1321
1341
|
if (![r, n, o, s].some((i) => !Number.isFinite(i)))
|
|
1322
1342
|
return { inStart: r, inEnd: n, outStart: o, outEnd: s };
|
|
1323
1343
|
}
|
|
1324
|
-
class
|
|
1344
|
+
class Dr {
|
|
1325
1345
|
bindingsByStyle = /* @__PURE__ */ new Map();
|
|
1326
1346
|
observer;
|
|
1327
1347
|
observeScheduled = !1;
|
|
@@ -1366,7 +1386,7 @@ class xr {
|
|
|
1366
1386
|
const r = e.source?.trim();
|
|
1367
1387
|
if (!r)
|
|
1368
1388
|
return;
|
|
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 =
|
|
1389
|
+
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 = Ur(e.ease), f = xr(e.map), d = e.targetId?.trim() || void 0;
|
|
1370
1390
|
return Number.isNaN(n) || Number.isNaN(s) ? void 0 : {
|
|
1371
1391
|
source: r.toLowerCase(),
|
|
1372
1392
|
min: n,
|
|
@@ -1492,7 +1512,7 @@ class xr {
|
|
|
1492
1512
|
case "unclamped":
|
|
1493
1513
|
return e;
|
|
1494
1514
|
default:
|
|
1495
|
-
return
|
|
1515
|
+
return $(e);
|
|
1496
1516
|
}
|
|
1497
1517
|
}
|
|
1498
1518
|
applyMap(e, r) {
|
|
@@ -1579,9 +1599,9 @@ class xr {
|
|
|
1579
1599
|
}
|
|
1580
1600
|
}
|
|
1581
1601
|
}
|
|
1582
|
-
const Te = new
|
|
1583
|
-
function
|
|
1584
|
-
const e = v(/* @__PURE__ */ new Map()), r =
|
|
1602
|
+
const Te = new Dr();
|
|
1603
|
+
function Fr(t) {
|
|
1604
|
+
const e = v(/* @__PURE__ */ new Map()), r = x(({ styleId: s, css: i, common: a }) => {
|
|
1585
1605
|
if (!(!s || typeof document > "u")) {
|
|
1586
1606
|
if (i) {
|
|
1587
1607
|
let c = e.current.get(s);
|
|
@@ -1589,13 +1609,13 @@ function Dr(t) {
|
|
|
1589
1609
|
}
|
|
1590
1610
|
Te.registerStyle(s, a);
|
|
1591
1611
|
}
|
|
1592
|
-
}, []), n =
|
|
1612
|
+
}, []), n = x((s) => {
|
|
1593
1613
|
if (!(typeof document > "u"))
|
|
1594
1614
|
for (const i of s) {
|
|
1595
1615
|
const a = e.current.get(i);
|
|
1596
1616
|
a && (a.remove(), e.current.delete(i)), Te.unregisterStyle(i);
|
|
1597
1617
|
}
|
|
1598
|
-
}, []), o =
|
|
1618
|
+
}, []), o = x(() => {
|
|
1599
1619
|
if (typeof document < "u") {
|
|
1600
1620
|
for (const s of e.current.values())
|
|
1601
1621
|
s.remove();
|
|
@@ -1603,7 +1623,7 @@ function Dr(t) {
|
|
|
1603
1623
|
}
|
|
1604
1624
|
Te.reset();
|
|
1605
1625
|
}, []);
|
|
1606
|
-
return
|
|
1626
|
+
return D(() => {
|
|
1607
1627
|
if (!t) return;
|
|
1608
1628
|
for (const a of t.getUiStyles())
|
|
1609
1629
|
r(a);
|
|
@@ -1611,9 +1631,9 @@ function Dr(t) {
|
|
|
1611
1631
|
return () => {
|
|
1612
1632
|
s?.(), i?.(), o();
|
|
1613
1633
|
};
|
|
1614
|
-
}, [t, o, r, n]),
|
|
1634
|
+
}, [t, o, r, n]), D(() => () => o(), [o]), { setStyle: r, deleteStyles: n, reset: o };
|
|
1615
1635
|
}
|
|
1616
|
-
function
|
|
1636
|
+
function Br(t) {
|
|
1617
1637
|
const e = [];
|
|
1618
1638
|
for (const [r, n] of t) {
|
|
1619
1639
|
const o = n.store.getSnapshot(), s = o.rootViewId && o.views.has(o.rootViewId);
|
|
@@ -1621,62 +1641,62 @@ function Fr(t) {
|
|
|
1621
1641
|
}
|
|
1622
1642
|
return e.sort(), e.join(",");
|
|
1623
1643
|
}
|
|
1624
|
-
function
|
|
1644
|
+
function $r(t) {
|
|
1625
1645
|
const [e, r] = X(), n = v("");
|
|
1626
|
-
return
|
|
1646
|
+
return D(() => {
|
|
1627
1647
|
if (!t) {
|
|
1628
1648
|
r(void 0), n.current = "";
|
|
1629
1649
|
return;
|
|
1630
1650
|
}
|
|
1631
1651
|
const o = () => {
|
|
1632
|
-
const s = t.getStores(), i =
|
|
1652
|
+
const s = t.getStores(), i = Br(s);
|
|
1633
1653
|
i !== n.current && (n.current = i, r(s));
|
|
1634
1654
|
};
|
|
1635
1655
|
return o(), t.subscribe(o);
|
|
1636
1656
|
}, [t]), e;
|
|
1637
1657
|
}
|
|
1638
|
-
var
|
|
1639
|
-
function
|
|
1640
|
-
var e =
|
|
1658
|
+
var Vr = typeof global == "object" && global && global.Object === Object && global, Kr = typeof self == "object" && self && self.Object === Object && self, Yr = Vr || Kr || Function("return this")(), Se = Yr.Symbol, mt = Object.prototype, zr = mt.hasOwnProperty, Wr = mt.toString, ue = Se ? Se.toStringTag : void 0;
|
|
1659
|
+
function qr(t) {
|
|
1660
|
+
var e = zr.call(t, ue), r = t[ue];
|
|
1641
1661
|
try {
|
|
1642
1662
|
t[ue] = void 0;
|
|
1643
1663
|
var n = !0;
|
|
1644
1664
|
} catch {
|
|
1645
1665
|
}
|
|
1646
|
-
var o =
|
|
1666
|
+
var o = Wr.call(t);
|
|
1647
1667
|
return n && (e ? t[ue] = r : delete t[ue]), o;
|
|
1648
1668
|
}
|
|
1649
|
-
var
|
|
1650
|
-
function
|
|
1651
|
-
return
|
|
1652
|
-
}
|
|
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);
|
|
1669
|
+
var Gr = Object.prototype, Hr = Gr.toString;
|
|
1670
|
+
function Jr(t) {
|
|
1671
|
+
return Hr.call(t);
|
|
1656
1672
|
}
|
|
1673
|
+
var Xr = "[object Null]", Zr = "[object Undefined]", nt = Se ? Se.toStringTag : void 0;
|
|
1657
1674
|
function Qr(t) {
|
|
1675
|
+
return t == null ? t === void 0 ? Zr : Xr : nt && nt in Object(t) ? qr(t) : Jr(t);
|
|
1676
|
+
}
|
|
1677
|
+
function en(t) {
|
|
1658
1678
|
return t != null && typeof t == "object";
|
|
1659
1679
|
}
|
|
1660
|
-
var
|
|
1661
|
-
function
|
|
1662
|
-
return typeof t == "string" || !
|
|
1680
|
+
var tn = Array.isArray, rn = "[object String]";
|
|
1681
|
+
function nn(t) {
|
|
1682
|
+
return typeof t == "string" || !tn(t) && en(t) && Qr(t) == rn;
|
|
1663
1683
|
}
|
|
1664
1684
|
const ot = "ikonUiModules";
|
|
1665
1685
|
function Le(t) {
|
|
1666
1686
|
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
1667
1687
|
}
|
|
1668
|
-
function
|
|
1688
|
+
function on(t) {
|
|
1669
1689
|
if (!Array.isArray(t))
|
|
1670
1690
|
return;
|
|
1671
1691
|
const e = /* @__PURE__ */ new Set();
|
|
1672
1692
|
for (const r of t) {
|
|
1673
|
-
if (!
|
|
1693
|
+
if (!nn(r)) continue;
|
|
1674
1694
|
const n = r.trim();
|
|
1675
1695
|
n && (e.has(n) || e.add(n));
|
|
1676
1696
|
}
|
|
1677
1697
|
return Array.from(e);
|
|
1678
1698
|
}
|
|
1679
|
-
function
|
|
1699
|
+
function oo(t, e) {
|
|
1680
1700
|
if (t === e)
|
|
1681
1701
|
return !0;
|
|
1682
1702
|
if (!t || !e)
|
|
@@ -1688,18 +1708,18 @@ function no(t, e) {
|
|
|
1688
1708
|
return !1;
|
|
1689
1709
|
return !0;
|
|
1690
1710
|
}
|
|
1691
|
-
function
|
|
1711
|
+
function sn(t) {
|
|
1692
1712
|
if (!(!Le(t) || !Object.prototype.hasOwnProperty.call(t, ot)))
|
|
1693
|
-
return
|
|
1713
|
+
return on(t[ot]);
|
|
1694
1714
|
}
|
|
1695
|
-
function
|
|
1715
|
+
function so(...t) {
|
|
1696
1716
|
for (const e of t) {
|
|
1697
|
-
const r =
|
|
1717
|
+
const r = sn(e);
|
|
1698
1718
|
if (r !== void 0)
|
|
1699
1719
|
return r;
|
|
1700
1720
|
}
|
|
1701
1721
|
}
|
|
1702
|
-
function
|
|
1722
|
+
function io(t) {
|
|
1703
1723
|
if (!Le(t))
|
|
1704
1724
|
return;
|
|
1705
1725
|
const e = t, r = Object.keys(e).find((c) => c.toLowerCase() === "modules");
|
|
@@ -1748,7 +1768,7 @@ const E = {
|
|
|
1748
1768
|
Line: 4,
|
|
1749
1769
|
Paragraph: 8,
|
|
1750
1770
|
Emoji: 16
|
|
1751
|
-
},
|
|
1771
|
+
}, an = [
|
|
1752
1772
|
{
|
|
1753
1773
|
flag: E.Letter,
|
|
1754
1774
|
hints: [
|
|
@@ -1797,11 +1817,11 @@ const E = {
|
|
|
1797
1817
|
"[data-emoji]"
|
|
1798
1818
|
]
|
|
1799
1819
|
}
|
|
1800
|
-
], Ue = E.Letter | E.Word | E.Line | E.Paragraph | E.Emoji,
|
|
1801
|
-
function
|
|
1802
|
-
if (!t || t.length >
|
|
1820
|
+
], Ue = E.Letter | E.Word | E.Line | E.Paragraph | E.Emoji, cn = E.Letter | E.Word | E.Line | E.Paragraph, st = /* @__PURE__ */ new Map(), un = 16384;
|
|
1821
|
+
function ao(t, e) {
|
|
1822
|
+
if (!t || t.length > un)
|
|
1803
1823
|
return t;
|
|
1804
|
-
const r =
|
|
1824
|
+
const r = kn(e), n = re(r, E.Emoji), o = r & cn;
|
|
1805
1825
|
if (o === E.None && !n)
|
|
1806
1826
|
return t;
|
|
1807
1827
|
const s = t.replace(/\r\n/g, `
|
|
@@ -1809,20 +1829,20 @@ function io(t, e) {
|
|
|
1809
1829
|
`);
|
|
1810
1830
|
if (o === E.None)
|
|
1811
1831
|
return ut(s);
|
|
1812
|
-
const i =
|
|
1832
|
+
const i = An(s);
|
|
1813
1833
|
if (i.length === 0)
|
|
1814
1834
|
return n ? ut(s) : t;
|
|
1815
|
-
const a =
|
|
1835
|
+
const a = Tn(i), c = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, f = [];
|
|
1816
1836
|
for (const d of a) {
|
|
1817
|
-
const m =
|
|
1837
|
+
const m = ln(d, r, c);
|
|
1818
1838
|
f.push(...m);
|
|
1819
1839
|
}
|
|
1820
1840
|
return f;
|
|
1821
1841
|
}
|
|
1822
|
-
function
|
|
1842
|
+
function ln(t, e, r) {
|
|
1823
1843
|
const n = [];
|
|
1824
1844
|
for (const o of t) {
|
|
1825
|
-
const s =
|
|
1845
|
+
const s = dn(o, e, r);
|
|
1826
1846
|
n.push(...s);
|
|
1827
1847
|
}
|
|
1828
1848
|
if (re(e, E.Paragraph)) {
|
|
@@ -1841,8 +1861,8 @@ function un(t, e, r) {
|
|
|
1841
1861
|
}
|
|
1842
1862
|
return n;
|
|
1843
1863
|
}
|
|
1844
|
-
function
|
|
1845
|
-
const n =
|
|
1864
|
+
function dn(t, e, r) {
|
|
1865
|
+
const n = fn(t.text, e, r), o = [];
|
|
1846
1866
|
if (re(e, E.Line)) {
|
|
1847
1867
|
const s = r.line++;
|
|
1848
1868
|
o.push(
|
|
@@ -1854,7 +1874,7 @@ function ln(t, e, r) {
|
|
|
1854
1874
|
o.push(/* @__PURE__ */ A.jsx("br", {}, `motion-break-${r.br++}`));
|
|
1855
1875
|
return o;
|
|
1856
1876
|
}
|
|
1857
|
-
function
|
|
1877
|
+
function fn(t, e, r) {
|
|
1858
1878
|
if (!t)
|
|
1859
1879
|
return [];
|
|
1860
1880
|
const n = re(e, E.Word), o = [], s = /(\s+)/g;
|
|
@@ -1873,13 +1893,13 @@ function dn(t, e, r) {
|
|
|
1873
1893
|
return o;
|
|
1874
1894
|
}
|
|
1875
1895
|
function it(t, e, r, n) {
|
|
1876
|
-
const o = e.word++, s =
|
|
1896
|
+
const o = e.word++, s = mn(t, r, e), i = `motion-word-${o}`, a = hn(o, n);
|
|
1877
1897
|
return n ? /* @__PURE__ */ A.jsx("span", { "data-motion-word": !0, style: a, children: s }, i) : /* @__PURE__ */ A.jsx("span", { style: a, children: s }, i);
|
|
1878
1898
|
}
|
|
1879
|
-
function
|
|
1899
|
+
function hn(t, e) {
|
|
1880
1900
|
return e ? { ...ve(t), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
|
|
1881
1901
|
}
|
|
1882
|
-
function
|
|
1902
|
+
function mn(t, e, r) {
|
|
1883
1903
|
if (!t)
|
|
1884
1904
|
return [];
|
|
1885
1905
|
const n = re(e, E.Letter), o = re(e, E.Emoji);
|
|
@@ -1912,33 +1932,33 @@ function hn(t, e, r) {
|
|
|
1912
1932
|
function xe(t) {
|
|
1913
1933
|
if (!t)
|
|
1914
1934
|
return [];
|
|
1915
|
-
const e =
|
|
1916
|
-
return e ? Array.from(e.segment(t), (r) => r.segment) :
|
|
1935
|
+
const e = pn();
|
|
1936
|
+
return e ? Array.from(e.segment(t), (r) => r.segment) : gn(t);
|
|
1917
1937
|
}
|
|
1918
1938
|
let le;
|
|
1919
|
-
function
|
|
1939
|
+
function pn() {
|
|
1920
1940
|
return le !== void 0 || (typeof Intl < "u" && typeof Intl.Segmenter == "function" ? le = new Intl.Segmenter(void 0, { granularity: "grapheme" }) : le = null), le;
|
|
1921
1941
|
}
|
|
1922
|
-
function
|
|
1942
|
+
function gn(t) {
|
|
1923
1943
|
const e = [], r = Array.from(t);
|
|
1924
1944
|
let n = "";
|
|
1925
1945
|
for (let o = 0; o < r.length; o++) {
|
|
1926
1946
|
const s = r[o], i = r[o + 1];
|
|
1927
|
-
n += s, !(i &&
|
|
1947
|
+
n += s, !(i && yn(s, i)) && (e.push(n), n = "");
|
|
1928
1948
|
}
|
|
1929
1949
|
return n && e.push(n), e;
|
|
1930
1950
|
}
|
|
1931
|
-
function
|
|
1932
|
-
return e ? !!(at(t) || at(e) ||
|
|
1951
|
+
function yn(t, e) {
|
|
1952
|
+
return e ? !!(at(t) || at(e) || wn(e) || Sn(e) || bn(e) || ct(t) && ct(e)) : !1;
|
|
1933
1953
|
}
|
|
1934
1954
|
function at(t) {
|
|
1935
1955
|
return t.codePointAt(0) === 8205;
|
|
1936
1956
|
}
|
|
1937
|
-
function
|
|
1957
|
+
function Sn(t) {
|
|
1938
1958
|
const e = t.codePointAt(0);
|
|
1939
1959
|
return e === void 0 ? !1 : e >= 65024 && e <= 65039 || e >= 917760 && e <= 917999;
|
|
1940
1960
|
}
|
|
1941
|
-
function
|
|
1961
|
+
function bn(t) {
|
|
1942
1962
|
const e = t.codePointAt(0);
|
|
1943
1963
|
return e === void 0 ? !1 : e >= 127995 && e <= 127999;
|
|
1944
1964
|
}
|
|
@@ -1947,10 +1967,10 @@ function ct(t) {
|
|
|
1947
1967
|
return e === void 0 ? !1 : e >= 127462 && e <= 127487;
|
|
1948
1968
|
}
|
|
1949
1969
|
let ke;
|
|
1950
|
-
function
|
|
1951
|
-
return t ? (ke || (ke =
|
|
1970
|
+
function wn(t) {
|
|
1971
|
+
return t ? (ke || (ke = vn()), ke(t)) : !1;
|
|
1952
1972
|
}
|
|
1953
|
-
function
|
|
1973
|
+
function vn() {
|
|
1954
1974
|
try {
|
|
1955
1975
|
const t = new RegExp("\\p{Mark}", "u");
|
|
1956
1976
|
return (e) => t.test(e);
|
|
@@ -1963,17 +1983,17 @@ function wn() {
|
|
|
1963
1983
|
}
|
|
1964
1984
|
let Ce;
|
|
1965
1985
|
function pt(t) {
|
|
1966
|
-
return t ? (Ce || (Ce =
|
|
1986
|
+
return t ? (Ce || (Ce = En()), Ce(t)) : !1;
|
|
1967
1987
|
}
|
|
1968
|
-
function
|
|
1988
|
+
function En() {
|
|
1969
1989
|
try {
|
|
1970
1990
|
const t = new RegExp("\\p{Extended_Pictographic}", "u");
|
|
1971
1991
|
return (e) => t.test(e);
|
|
1972
1992
|
} catch {
|
|
1973
|
-
return
|
|
1993
|
+
return Rn;
|
|
1974
1994
|
}
|
|
1975
1995
|
}
|
|
1976
|
-
function
|
|
1996
|
+
function Rn(t) {
|
|
1977
1997
|
if (!t)
|
|
1978
1998
|
return !1;
|
|
1979
1999
|
for (const e of Array.from(t)) {
|
|
@@ -1983,7 +2003,7 @@ function En(t) {
|
|
|
1983
2003
|
}
|
|
1984
2004
|
return !1;
|
|
1985
2005
|
}
|
|
1986
|
-
function
|
|
2006
|
+
function An(t) {
|
|
1987
2007
|
const e = [];
|
|
1988
2008
|
let r = "", n = 0;
|
|
1989
2009
|
for (let o = 0; o < t.length; o++) {
|
|
@@ -1997,7 +2017,7 @@ function Rn(t) {
|
|
|
1997
2017
|
}
|
|
1998
2018
|
return (n > 0 || r.length > 0) && e.push({ text: r, breaks: n }), e;
|
|
1999
2019
|
}
|
|
2000
|
-
function
|
|
2020
|
+
function Tn(t) {
|
|
2001
2021
|
if (t.length === 0)
|
|
2002
2022
|
return [];
|
|
2003
2023
|
const e = [];
|
|
@@ -2054,7 +2074,7 @@ function gt(t, e) {
|
|
|
2054
2074
|
}
|
|
2055
2075
|
return i(), o ? { nodes: r, sawEmoji: !0 } : { nodes: [t.join("")], sawEmoji: !1 };
|
|
2056
2076
|
}
|
|
2057
|
-
function
|
|
2077
|
+
function kn(t) {
|
|
2058
2078
|
if (!t)
|
|
2059
2079
|
return E.None;
|
|
2060
2080
|
const e = t.trim();
|
|
@@ -2068,8 +2088,8 @@ function Tn(t) {
|
|
|
2068
2088
|
const n = e.split(/\s+/).filter(Boolean);
|
|
2069
2089
|
if (n.length === 0)
|
|
2070
2090
|
return E.None;
|
|
2071
|
-
const s = n.map((c) => `.${
|
|
2072
|
-
(c) => new RegExp(`(^|[^a-zA-Z0-9_-])${
|
|
2091
|
+
const s = n.map((c) => `.${Cn(c)}`).map(
|
|
2092
|
+
(c) => new RegExp(`(^|[^a-zA-Z0-9_-])${In(c)}(?![a-zA-Z0-9_-])`)
|
|
2073
2093
|
);
|
|
2074
2094
|
let i = E.None, a = !1;
|
|
2075
2095
|
for (const c of Array.from(document.styleSheets)) {
|
|
@@ -2097,7 +2117,7 @@ function yt(t, e) {
|
|
|
2097
2117
|
const a = s.selectorText ?? "";
|
|
2098
2118
|
if (!a || !e.some((f) => f.test(a))) continue;
|
|
2099
2119
|
n = !0;
|
|
2100
|
-
for (const f of
|
|
2120
|
+
for (const f of an)
|
|
2101
2121
|
f.hints.some((d) => a.includes(d)) && (r |= f.flag);
|
|
2102
2122
|
if (r === Ue)
|
|
2103
2123
|
return { mask: r, sawStyleRule: !0 };
|
|
@@ -2111,13 +2131,13 @@ function yt(t, e) {
|
|
|
2111
2131
|
}
|
|
2112
2132
|
return { mask: r, sawStyleRule: n };
|
|
2113
2133
|
}
|
|
2114
|
-
function
|
|
2134
|
+
function Cn(t) {
|
|
2115
2135
|
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
2116
2136
|
}
|
|
2117
|
-
function
|
|
2137
|
+
function In(t) {
|
|
2118
2138
|
return t.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
|
|
2119
2139
|
}
|
|
2120
|
-
const Ve = "ikon_auth_session",
|
|
2140
|
+
const Ve = "ikon_auth_session", On = 7 * 24 * 60 * 60 * 1e3;
|
|
2121
2141
|
function Ee(t) {
|
|
2122
2142
|
try {
|
|
2123
2143
|
localStorage.setItem(Ve, JSON.stringify(t));
|
|
@@ -2130,7 +2150,7 @@ function St() {
|
|
|
2130
2150
|
const t = localStorage.getItem(Ve);
|
|
2131
2151
|
if (!t) return null;
|
|
2132
2152
|
const e = JSON.parse(t);
|
|
2133
|
-
return Date.now() - e.authenticatedAt >
|
|
2153
|
+
return Date.now() - e.authenticatedAt > On ? (bt(), null) : e;
|
|
2134
2154
|
} catch {
|
|
2135
2155
|
return console.warn("Failed to load auth session from localStorage"), null;
|
|
2136
2156
|
}
|
|
@@ -2167,7 +2187,7 @@ async function wt(t, e) {
|
|
|
2167
2187
|
};
|
|
2168
2188
|
return Ee(s), s;
|
|
2169
2189
|
}
|
|
2170
|
-
async function
|
|
2190
|
+
async function co(t) {
|
|
2171
2191
|
const { email: e, spaceId: r, authUrl: n, returnUrl: o = window.location.origin + window.location.pathname } = t, s = await fetch(`${n}/email/send`, {
|
|
2172
2192
|
method: "POST",
|
|
2173
2193
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2182,22 +2202,22 @@ async function ao(t) {
|
|
|
2182
2202
|
throw new Error(i);
|
|
2183
2203
|
}
|
|
2184
2204
|
}
|
|
2185
|
-
function
|
|
2205
|
+
function _n() {
|
|
2186
2206
|
const t = new URLSearchParams(window.location.search), e = t.get("ikon_token"), r = t.get("ikon_provider");
|
|
2187
2207
|
return e && r ? { token: e, provider: r } : null;
|
|
2188
2208
|
}
|
|
2189
|
-
function
|
|
2209
|
+
function Nn() {
|
|
2190
2210
|
const e = new URLSearchParams(window.location.search).get("error");
|
|
2191
2211
|
return e ? decodeURIComponent(e) : null;
|
|
2192
2212
|
}
|
|
2193
2213
|
function lt() {
|
|
2194
2214
|
window.history.replaceState({}, "", window.location.pathname);
|
|
2195
2215
|
}
|
|
2196
|
-
function
|
|
2216
|
+
function Pn(t, e, r, n) {
|
|
2197
2217
|
const o = n ?? window.location.origin + window.location.pathname + window.location.search;
|
|
2198
2218
|
return `${r}/oauth/${t}?space=${encodeURIComponent(e)}&return=${encodeURIComponent(o)}`;
|
|
2199
2219
|
}
|
|
2200
|
-
async function
|
|
2220
|
+
async function Mn(t) {
|
|
2201
2221
|
const e = await fetch(`${t}/passkey/registration/options`, {
|
|
2202
2222
|
method: "POST",
|
|
2203
2223
|
headers: { "Content-Type": "application/json" }
|
|
@@ -2208,7 +2228,7 @@ async function Pn(t) {
|
|
|
2208
2228
|
}
|
|
2209
2229
|
return e.json();
|
|
2210
2230
|
}
|
|
2211
|
-
async function
|
|
2231
|
+
async function jn(t, e, r) {
|
|
2212
2232
|
const n = await fetch(`${t}/passkey/registration/verify`, {
|
|
2213
2233
|
method: "POST",
|
|
2214
2234
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2225,7 +2245,7 @@ async function Mn(t, e, r) {
|
|
|
2225
2245
|
};
|
|
2226
2246
|
return Ee(s), s;
|
|
2227
2247
|
}
|
|
2228
|
-
async function
|
|
2248
|
+
async function Ln(t, e) {
|
|
2229
2249
|
const r = await fetch(`${t}/passkey/authentication/options`, {
|
|
2230
2250
|
method: "POST",
|
|
2231
2251
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2237,7 +2257,7 @@ async function jn(t, e) {
|
|
|
2237
2257
|
}
|
|
2238
2258
|
return r.json();
|
|
2239
2259
|
}
|
|
2240
|
-
async function
|
|
2260
|
+
async function Un(t, e) {
|
|
2241
2261
|
const r = await fetch(`${t}/passkey/authentication/verify`, {
|
|
2242
2262
|
method: "POST",
|
|
2243
2263
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2268,9 +2288,9 @@ function be(t) {
|
|
|
2268
2288
|
return s;
|
|
2269
2289
|
}
|
|
2270
2290
|
function Ke() {
|
|
2271
|
-
return
|
|
2291
|
+
return xn.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
|
|
2272
2292
|
}
|
|
2273
|
-
const
|
|
2293
|
+
const xn = {
|
|
2274
2294
|
stubThis: (t) => t
|
|
2275
2295
|
};
|
|
2276
2296
|
function vt(t) {
|
|
@@ -2302,7 +2322,7 @@ class M extends Error {
|
|
|
2302
2322
|
}), this.name = o ?? n.name, this.code = r;
|
|
2303
2323
|
}
|
|
2304
2324
|
}
|
|
2305
|
-
function
|
|
2325
|
+
function Dn({ error: t, options: e }) {
|
|
2306
2326
|
const { publicKey: r } = e;
|
|
2307
2327
|
if (!r)
|
|
2308
2328
|
throw Error("options was missing required publicKey property");
|
|
@@ -2388,7 +2408,7 @@ function xn({ error: t, options: e }) {
|
|
|
2388
2408
|
}
|
|
2389
2409
|
return t;
|
|
2390
2410
|
}
|
|
2391
|
-
class
|
|
2411
|
+
class Fn {
|
|
2392
2412
|
constructor() {
|
|
2393
2413
|
Object.defineProperty(this, "controller", {
|
|
2394
2414
|
enumerable: !0,
|
|
@@ -2412,12 +2432,12 @@ class Dn {
|
|
|
2412
2432
|
}
|
|
2413
2433
|
}
|
|
2414
2434
|
}
|
|
2415
|
-
const Rt = new
|
|
2435
|
+
const Rt = new Fn(), Bn = ["cross-platform", "platform"];
|
|
2416
2436
|
function At(t) {
|
|
2417
|
-
if (t && !(
|
|
2437
|
+
if (t && !(Bn.indexOf(t) < 0))
|
|
2418
2438
|
return t;
|
|
2419
2439
|
}
|
|
2420
|
-
async function
|
|
2440
|
+
async function $n(t) {
|
|
2421
2441
|
!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 });
|
|
2422
2442
|
const { optionsJSON: e, useAutoRegister: r = !1 } = t;
|
|
2423
2443
|
if (!Ke())
|
|
@@ -2436,7 +2456,7 @@ async function Bn(t) {
|
|
|
2436
2456
|
try {
|
|
2437
2457
|
s = await navigator.credentials.create(o);
|
|
2438
2458
|
} catch (S) {
|
|
2439
|
-
throw
|
|
2459
|
+
throw Dn({ error: S, options: o });
|
|
2440
2460
|
}
|
|
2441
2461
|
if (!s)
|
|
2442
2462
|
throw new Error("Registration was not completed");
|
|
@@ -2485,7 +2505,7 @@ function Ie(t, e) {
|
|
|
2485
2505
|
console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${t}. You should report this error to them.
|
|
2486
2506
|
`, e);
|
|
2487
2507
|
}
|
|
2488
|
-
function
|
|
2508
|
+
function Vn() {
|
|
2489
2509
|
if (!Ke())
|
|
2490
2510
|
return Oe.stubThis(new Promise((e) => e(!1)));
|
|
2491
2511
|
const t = globalThis.PublicKeyCredential;
|
|
@@ -2494,7 +2514,7 @@ function $n() {
|
|
|
2494
2514
|
const Oe = {
|
|
2495
2515
|
stubThis: (t) => t
|
|
2496
2516
|
};
|
|
2497
|
-
function
|
|
2517
|
+
function Kn({ error: t, options: e }) {
|
|
2498
2518
|
const { publicKey: r } = e;
|
|
2499
2519
|
if (!r)
|
|
2500
2520
|
throw Error("options was missing required publicKey property");
|
|
@@ -2535,7 +2555,7 @@ function Vn({ error: t, options: e }) {
|
|
|
2535
2555
|
}
|
|
2536
2556
|
return t;
|
|
2537
2557
|
}
|
|
2538
|
-
async function
|
|
2558
|
+
async function Yn(t) {
|
|
2539
2559
|
!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 });
|
|
2540
2560
|
const { optionsJSON: e, useBrowserAutofill: r = !1, verifyBrowserAutofillInput: n = !0 } = t;
|
|
2541
2561
|
if (!Ke())
|
|
@@ -2548,7 +2568,7 @@ async function Kn(t) {
|
|
|
2548
2568
|
allowCredentials: o
|
|
2549
2569
|
}, i = {};
|
|
2550
2570
|
if (r) {
|
|
2551
|
-
if (!await
|
|
2571
|
+
if (!await Vn())
|
|
2552
2572
|
throw Error("Browser does not support WebAuthn autofill");
|
|
2553
2573
|
if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 && n)
|
|
2554
2574
|
throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
|
|
@@ -2559,7 +2579,7 @@ async function Kn(t) {
|
|
|
2559
2579
|
try {
|
|
2560
2580
|
a = await navigator.credentials.get(i);
|
|
2561
2581
|
} catch (h) {
|
|
2562
|
-
throw
|
|
2582
|
+
throw Kn({ error: h, options: i });
|
|
2563
2583
|
}
|
|
2564
2584
|
if (!a)
|
|
2565
2585
|
throw new Error("Authentication was not completed");
|
|
@@ -2580,16 +2600,16 @@ async function Kn(t) {
|
|
|
2580
2600
|
};
|
|
2581
2601
|
}
|
|
2582
2602
|
const Ye = dt(null);
|
|
2583
|
-
function
|
|
2603
|
+
function uo({ children: t, config: e }) {
|
|
2584
2604
|
const [r, n] = X({
|
|
2585
2605
|
isAuthenticated: !1,
|
|
2586
2606
|
isLoading: !0,
|
|
2587
2607
|
user: null,
|
|
2588
2608
|
error: null
|
|
2589
2609
|
});
|
|
2590
|
-
|
|
2610
|
+
D(() => {
|
|
2591
2611
|
(() => {
|
|
2592
|
-
const d =
|
|
2612
|
+
const d = Nn();
|
|
2593
2613
|
if (d) {
|
|
2594
2614
|
lt(), n({
|
|
2595
2615
|
isAuthenticated: !1,
|
|
@@ -2599,7 +2619,7 @@ function co({ children: t, config: e }) {
|
|
|
2599
2619
|
});
|
|
2600
2620
|
return;
|
|
2601
2621
|
}
|
|
2602
|
-
const m =
|
|
2622
|
+
const m = _n();
|
|
2603
2623
|
if (m) {
|
|
2604
2624
|
const h = {
|
|
2605
2625
|
token: m.token,
|
|
@@ -2632,7 +2652,7 @@ function co({ children: t, config: e }) {
|
|
|
2632
2652
|
});
|
|
2633
2653
|
})();
|
|
2634
2654
|
}, []);
|
|
2635
|
-
const o =
|
|
2655
|
+
const o = x(
|
|
2636
2656
|
async (f) => {
|
|
2637
2657
|
if (!e.spaceId) {
|
|
2638
2658
|
n((l) => ({
|
|
@@ -2664,7 +2684,7 @@ function co({ children: t, config: e }) {
|
|
|
2664
2684
|
if (f === "passkey") {
|
|
2665
2685
|
n((l) => ({ ...l, isLoading: !0, error: null }));
|
|
2666
2686
|
try {
|
|
2667
|
-
const l = await
|
|
2687
|
+
const l = await Ln(d), h = await Yn({ optionsJSON: l }), S = await Un(d, h);
|
|
2668
2688
|
n({
|
|
2669
2689
|
isAuthenticated: !0,
|
|
2670
2690
|
isLoading: !1,
|
|
@@ -2680,23 +2700,23 @@ function co({ children: t, config: e }) {
|
|
|
2680
2700
|
}
|
|
2681
2701
|
return;
|
|
2682
2702
|
}
|
|
2683
|
-
const m =
|
|
2703
|
+
const m = Pn(f, e.spaceId, d);
|
|
2684
2704
|
window.location.href = m;
|
|
2685
2705
|
},
|
|
2686
2706
|
[e.authUrl, e.spaceId]
|
|
2687
|
-
), s =
|
|
2707
|
+
), s = x(() => {
|
|
2688
2708
|
bt(), n({
|
|
2689
2709
|
isAuthenticated: !1,
|
|
2690
2710
|
isLoading: !1,
|
|
2691
2711
|
user: null,
|
|
2692
2712
|
error: null
|
|
2693
2713
|
});
|
|
2694
|
-
}, []), i =
|
|
2714
|
+
}, []), i = x(
|
|
2695
2715
|
async (f) => {
|
|
2696
2716
|
const d = e.authUrl ?? Ne();
|
|
2697
2717
|
n((m) => ({ ...m, isLoading: !0, error: null }));
|
|
2698
2718
|
try {
|
|
2699
|
-
const m = await
|
|
2719
|
+
const m = await Mn(d), l = await $n({ optionsJSON: m }), h = await jn(d, l, f);
|
|
2700
2720
|
n({
|
|
2701
2721
|
isAuthenticated: !0,
|
|
2702
2722
|
isLoading: !1,
|
|
@@ -2712,7 +2732,7 @@ function co({ children: t, config: e }) {
|
|
|
2712
2732
|
}
|
|
2713
2733
|
},
|
|
2714
2734
|
[e.authUrl]
|
|
2715
|
-
), a =
|
|
2735
|
+
), a = x(() => r.user?.token ?? null, [r.user]), c = Y(
|
|
2716
2736
|
() => ({
|
|
2717
2737
|
state: r,
|
|
2718
2738
|
login: o,
|
|
@@ -2724,18 +2744,18 @@ function co({ children: t, config: e }) {
|
|
|
2724
2744
|
);
|
|
2725
2745
|
return /* @__PURE__ */ A.jsx(Ye, { value: c, children: t });
|
|
2726
2746
|
}
|
|
2727
|
-
function
|
|
2747
|
+
function zn() {
|
|
2728
2748
|
const t = Fe(Ye);
|
|
2729
2749
|
if (!t)
|
|
2730
2750
|
throw new Error("useAuth must be used within an AuthProvider");
|
|
2731
2751
|
return t;
|
|
2732
2752
|
}
|
|
2733
|
-
function
|
|
2753
|
+
function lo() {
|
|
2734
2754
|
return Fe(Ye);
|
|
2735
2755
|
}
|
|
2736
|
-
function
|
|
2737
|
-
const { config: e, guestUrlParam: r } = t, { state: n, login: o } =
|
|
2738
|
-
return
|
|
2756
|
+
function fo(t) {
|
|
2757
|
+
const { config: e, guestUrlParam: r } = t, { state: n, login: o } = zn(), s = v(!1);
|
|
2758
|
+
return D(() => {
|
|
2739
2759
|
if (!r || n.isAuthenticated || n.isLoading || s.current || !e.methods.includes("guest"))
|
|
2740
2760
|
return;
|
|
2741
2761
|
const i = new URLSearchParams(window.location.search), a = i.get(r);
|
|
@@ -2751,7 +2771,7 @@ function lo(t) {
|
|
|
2751
2771
|
error: n.error
|
|
2752
2772
|
};
|
|
2753
2773
|
}
|
|
2754
|
-
function
|
|
2774
|
+
function ho({
|
|
2755
2775
|
connectionState: t,
|
|
2756
2776
|
error: e,
|
|
2757
2777
|
isReady: r,
|
|
@@ -2791,25 +2811,25 @@ function fo({
|
|
|
2791
2811
|
}
|
|
2792
2812
|
}
|
|
2793
2813
|
const _e = we("useIkonApp");
|
|
2794
|
-
function
|
|
2814
|
+
function Wn() {
|
|
2795
2815
|
if (typeof window < "u" && window.__IKON_AUTH_CONFIG__)
|
|
2796
2816
|
return window.__IKON_AUTH_CONFIG__;
|
|
2797
2817
|
}
|
|
2798
|
-
function
|
|
2818
|
+
function qn() {
|
|
2799
2819
|
if (typeof window < "u" && window.__IKON_LOCAL_IKON_SERVER_CONFIG__)
|
|
2800
2820
|
return window.__IKON_LOCAL_IKON_SERVER_CONFIG__;
|
|
2801
2821
|
}
|
|
2802
|
-
function
|
|
2803
|
-
const { authConfig: e, localServer: r, modules: n, registerModules: o, onJoined: s, onConnectionStateChange: i, onError: a, updateUrlOnJoin: c = !
|
|
2822
|
+
function mo(t) {
|
|
2823
|
+
const { authConfig: e, localServer: r, modules: n, registerModules: o, onJoined: s, onConnectionStateChange: i, onError: a, updateUrlOnJoin: c = !1, timeouts: f, audio: d, video: m, mediaSession: l } = t, h = e === void 0 ? Wn() ?? null : e, S = r ?? qn(), 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
2824
|
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 [_,
|
|
2825
|
+
const [_, F] = X("idle"), [z, te] = X(null), [ne, he] = X(null), [H, me] = X(null), [oe, u] = X(!1), y = Y(() => {
|
|
2806
2826
|
try {
|
|
2807
2827
|
return _t();
|
|
2808
2828
|
} catch {
|
|
2809
2829
|
return { parameters: {} };
|
|
2810
2830
|
}
|
|
2811
|
-
}, []), R = Y(() => h?.enabled ? St() : null, [h?.enabled]), C = S?.enabled ?? !1, K = S?.host ?? "localhost",
|
|
2812
|
-
|
|
2831
|
+
}, []), R = Y(() => h?.enabled ? St() : null, [h?.enabled]), C = S?.enabled ?? !1, K = S?.host ?? "localhost", B = S?.port ?? 8443;
|
|
2832
|
+
D(() => {
|
|
2813
2833
|
!C && ze() && h && !h.enabled && h.spaceId && !H && !oe && (u(!0), wt(h.spaceId, h.authUrl ?? Ne()).then((U) => {
|
|
2814
2834
|
me(U.token);
|
|
2815
2835
|
}).catch((U) => {
|
|
@@ -2824,7 +2844,7 @@ function ho(t) {
|
|
|
2824
2844
|
return {
|
|
2825
2845
|
local: {
|
|
2826
2846
|
host: K,
|
|
2827
|
-
httpsPort:
|
|
2847
|
+
httpsPort: B,
|
|
2828
2848
|
userId: P,
|
|
2829
2849
|
parameters: y.parameters
|
|
2830
2850
|
}
|
|
@@ -2851,24 +2871,24 @@ function ho(t) {
|
|
|
2851
2871
|
} : ze() ? null : {
|
|
2852
2872
|
local: {
|
|
2853
2873
|
host: K,
|
|
2854
|
-
httpsPort:
|
|
2874
|
+
httpsPort: B,
|
|
2855
2875
|
userId: ge(),
|
|
2856
2876
|
parameters: y.parameters
|
|
2857
2877
|
}
|
|
2858
2878
|
};
|
|
2859
|
-
}, [C, K,
|
|
2860
|
-
|
|
2861
|
-
const se =
|
|
2862
|
-
|
|
2879
|
+
}, [C, K, B, R?.token, h?.spaceId, H, y.sessionId, y.channelKey, y.parameters]);
|
|
2880
|
+
Fr(ne);
|
|
2881
|
+
const se = $r(ne);
|
|
2882
|
+
D(() => {
|
|
2863
2883
|
if (!w.current) {
|
|
2864
|
-
if (w.current = !0, p.current =
|
|
2884
|
+
if (w.current = !0, p.current = Nr(), n)
|
|
2865
2885
|
for (const P of n)
|
|
2866
2886
|
P(p.current);
|
|
2867
2887
|
o?.(p.current), p.current.loadRegisteredModules().catch((P) => {
|
|
2868
2888
|
_e.error("Failed to load UI modules", P);
|
|
2869
2889
|
});
|
|
2870
2890
|
}
|
|
2871
|
-
}, []),
|
|
2891
|
+
}, []), D(() => {
|
|
2872
2892
|
if (!ee) return;
|
|
2873
2893
|
const P = new Pt({
|
|
2874
2894
|
...ee,
|
|
@@ -2877,7 +2897,7 @@ function ho(t) {
|
|
|
2877
2897
|
video: I.current,
|
|
2878
2898
|
mediaSession: j.current,
|
|
2879
2899
|
onConnectionStateChange: (V) => {
|
|
2880
|
-
|
|
2900
|
+
F(V), Q.current?.(V);
|
|
2881
2901
|
},
|
|
2882
2902
|
onError: (V) => {
|
|
2883
2903
|
te(V.message), k.current?.(V);
|
|
@@ -2895,7 +2915,7 @@ function ho(t) {
|
|
|
2895
2915
|
P.disconnect(), b.current = null, U.dispose(), g.current = null;
|
|
2896
2916
|
};
|
|
2897
2917
|
}, [ee]);
|
|
2898
|
-
const N =
|
|
2918
|
+
const N = x((P, U) => {
|
|
2899
2919
|
const V = typeof U == "string" ? U : JSON.stringify(U ?? {});
|
|
2900
2920
|
b.current?.sendActionCall(P, V);
|
|
2901
2921
|
}, []), J = _ === "connected" || _ === "reconnecting";
|
|
@@ -2912,27 +2932,27 @@ function ho(t) {
|
|
|
2912
2932
|
isReady: J
|
|
2913
2933
|
};
|
|
2914
2934
|
}
|
|
2915
|
-
function
|
|
2935
|
+
function po(t) {
|
|
2916
2936
|
const e = v(!1);
|
|
2917
|
-
return
|
|
2937
|
+
return x(() => {
|
|
2918
2938
|
if (e.current) return;
|
|
2919
2939
|
e.current = !0;
|
|
2920
2940
|
const r = document.createElement("link");
|
|
2921
2941
|
r.rel = "stylesheet", r.href = t, document.head.appendChild(r);
|
|
2922
2942
|
}, [t]);
|
|
2923
2943
|
}
|
|
2924
|
-
let
|
|
2925
|
-
function
|
|
2926
|
-
const [r, n] = X([]), o = v(/* @__PURE__ */ new Map()), s =
|
|
2944
|
+
let Gn = 0;
|
|
2945
|
+
function go(t = 5, e = 5e3) {
|
|
2946
|
+
const [r, n] = X([]), o = v(/* @__PURE__ */ new Map()), s = x((i) => {
|
|
2927
2947
|
const a = o.current.get(i);
|
|
2928
2948
|
a && (clearTimeout(a), o.current.delete(i)), n((c) => c.filter((f) => f.id !== i));
|
|
2929
2949
|
}, []);
|
|
2930
|
-
return
|
|
2950
|
+
return D(() => {
|
|
2931
2951
|
const i = o.current, a = Mt(
|
|
2932
2952
|
(c) => {
|
|
2933
2953
|
if (!jt())
|
|
2934
2954
|
return;
|
|
2935
|
-
const f = `toast-${++
|
|
2955
|
+
const f = `toast-${++Gn}`, d = c.level === qe.ERROR ? "error" : "warn", m = {
|
|
2936
2956
|
id: f,
|
|
2937
2957
|
level: d,
|
|
2938
2958
|
message: c.message,
|
|
@@ -2955,30 +2975,30 @@ function po(t = 5, e = 5e3) {
|
|
|
2955
2975
|
}, [t, e, s]), { toasts: r, dismissToast: s };
|
|
2956
2976
|
}
|
|
2957
2977
|
const Tt = dt(null);
|
|
2958
|
-
function
|
|
2978
|
+
function Hn(t, e) {
|
|
2959
2979
|
return e ? t.replace(/\{(\w+)\}/g, (r, n) => e[n] ?? `{${n}}`) : t;
|
|
2960
2980
|
}
|
|
2961
|
-
function
|
|
2981
|
+
function Jn(t, e) {
|
|
2962
2982
|
const n = new URLSearchParams(window.location.search).get("lang");
|
|
2963
2983
|
if (n && t.includes(n))
|
|
2964
2984
|
return n;
|
|
2965
2985
|
const o = navigator.language.split("-")[0];
|
|
2966
2986
|
return t.includes(o) ? o : e && t.includes(e) ? e : "en";
|
|
2967
2987
|
}
|
|
2968
|
-
function
|
|
2969
|
-
return e ?
|
|
2988
|
+
function Xn(t, e, r) {
|
|
2989
|
+
return e ? Jn(t, r) : r && t.includes(r) ? r : "en";
|
|
2970
2990
|
}
|
|
2971
|
-
function
|
|
2991
|
+
function yo({
|
|
2972
2992
|
children: t,
|
|
2973
2993
|
translations: e,
|
|
2974
2994
|
defaultLanguage: r,
|
|
2975
2995
|
detectLanguage: n = !1
|
|
2976
2996
|
}) {
|
|
2977
|
-
const o = Object.keys(e), s =
|
|
2997
|
+
const o = Object.keys(e), s = Xn(o, n, r), i = e[s] ?? e.en, a = Y(
|
|
2978
2998
|
() => ({
|
|
2979
2999
|
t: (c, f) => {
|
|
2980
3000
|
const d = i[c];
|
|
2981
|
-
return
|
|
3001
|
+
return Hn(d, f);
|
|
2982
3002
|
},
|
|
2983
3003
|
locale: s,
|
|
2984
3004
|
translations: i
|
|
@@ -2987,67 +3007,67 @@ function go({
|
|
|
2987
3007
|
);
|
|
2988
3008
|
return /* @__PURE__ */ A.jsx(Tt, { value: a, children: t });
|
|
2989
3009
|
}
|
|
2990
|
-
function
|
|
3010
|
+
function So() {
|
|
2991
3011
|
const t = Fe(Tt);
|
|
2992
3012
|
if (!t)
|
|
2993
3013
|
throw new Error("useI18n must be used within an I18nProvider");
|
|
2994
3014
|
return t;
|
|
2995
3015
|
}
|
|
2996
3016
|
export {
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3017
|
+
uo as AuthProvider,
|
|
3018
|
+
ho as ConnectionStateRenderer,
|
|
3019
|
+
yo as I18nProvider,
|
|
3020
|
+
or as IKON_UI_BASE_MODULE,
|
|
3021
|
+
fr as IKON_UI_MEDIA_MODULE,
|
|
3022
|
+
Cr as IKON_UI_SHADER_MODULE,
|
|
3023
|
+
Tr as IKON_UI_SHADER_TYPE,
|
|
3004
3024
|
Me as IKON_UI_STREAM_CATEGORY,
|
|
3005
|
-
|
|
3006
|
-
|
|
3025
|
+
ar as IKON_UI_VIDEO_CANVAS_TYPE,
|
|
3026
|
+
cr as IKON_UI_VIDEO_URL_PLAYER_TYPE,
|
|
3007
3027
|
Jt as IkonUi,
|
|
3008
|
-
|
|
3009
|
-
|
|
3028
|
+
_r as IkonUiRegistry,
|
|
3029
|
+
no as IkonUiSurface,
|
|
3010
3030
|
Gt as UiComponentRegistry,
|
|
3011
3031
|
qt as UiRenderer,
|
|
3012
|
-
|
|
3013
|
-
|
|
3032
|
+
vo as UiStreamStore,
|
|
3033
|
+
oo as areIkonUiModuleListsEqual,
|
|
3014
3034
|
wt as authenticateAnonymous,
|
|
3015
|
-
|
|
3035
|
+
Pn as buildOAuthRedirectUrl,
|
|
3016
3036
|
bt as clearAuthSession,
|
|
3017
3037
|
lt as clearOAuthParams,
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3038
|
+
nr as createBaseResolvers,
|
|
3039
|
+
to as createComponentLibrary,
|
|
3040
|
+
Nr as createIkonUiRegistry,
|
|
3041
|
+
lr as createMediaResolvers,
|
|
3042
|
+
kr as createShaderRendererResolver,
|
|
3023
3043
|
Ht as isIkonUiCategoryMatch,
|
|
3024
3044
|
St as loadAuthSession,
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3045
|
+
sr as loadBaseModule,
|
|
3046
|
+
hr as loadMediaModule,
|
|
3047
|
+
Ir as loadShaderModule,
|
|
3048
|
+
on as normalizeIkonUiModuleList,
|
|
3049
|
+
io as parseIkonUiInitPayload,
|
|
3050
|
+
_n as parseOAuthCallback,
|
|
3051
|
+
Nn as parseOAuthError,
|
|
3052
|
+
sn as readIkonUiModules,
|
|
3053
|
+
so as readIkonUiModulesFromSources,
|
|
3054
|
+
ir as registerBaseModule,
|
|
3055
|
+
mr as registerMediaModule,
|
|
3056
|
+
Or as registerShaderModule,
|
|
3037
3057
|
zt as renderChildren,
|
|
3038
|
-
|
|
3058
|
+
ao as renderMotionLetters,
|
|
3039
3059
|
Ee as saveAuthSession,
|
|
3040
|
-
|
|
3060
|
+
co as sendMagicLink,
|
|
3041
3061
|
de as sessionToUser,
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3062
|
+
zn as useAuth,
|
|
3063
|
+
fo as useAuthGuard,
|
|
3064
|
+
lo as useAuthOptional,
|
|
3065
|
+
So as useI18n,
|
|
3066
|
+
mo as useIkonApp,
|
|
3067
|
+
Fr as useIkonStyles,
|
|
3068
|
+
$r as useIkonUiStores,
|
|
3069
|
+
po as useLazyFont,
|
|
3070
|
+
go as useToasts,
|
|
3051
3071
|
Z as useUiNode,
|
|
3052
|
-
|
|
3072
|
+
ro as useUiStore
|
|
3053
3073
|
};
|