@ikonai/sdk-react-ui 1.11.3 → 1.13.0
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/{feedback-form-BSy2olwD.js → feedback-form-2zrRPOiE.js} +10 -10
- package/index.d.ts +1 -1
- package/index.d.ts.map +1 -1
- package/index.js +1032 -980
- package/media/use-sibling-client.d.ts.map +1 -1
- package/media/video-canvas.d.ts.map +1 -1
- package/media/video-stream-view.d.ts +17 -3
- package/media/video-stream-view.d.ts.map +1 -1
- package/package.json +1 -1
- package/{shadertoy-renderer-Cq1lOXBs.js → shadertoy-renderer-Qdk-bdwO.js} +3 -3
package/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { n as e, t } from "./shadertoy-type-Cs2WeCWV.js";
|
|
2
2
|
import { IKON_PLATFORM_STREAM_CATEGORY as n, IKON_PLATFORM_STREAM_CATEGORY as r, IKON_UI_STREAM_CATEGORY as i, IKON_UI_STREAM_CATEGORY as a, IkonUiCore as o, LiveSnapshotCache as s, UiStreamStore as c, UiStreamStore as l, isPrerenderVisible as u, prefetchBootSnapshot as d, seedStreamCategory as f } from "@ikonai/sdk-ui";
|
|
3
|
-
import { AccessDeniedError as p, AppStartupFailedError as m, AuthenticationError as h, DEFAULT_LOCAL_SERVER_HOST as g, DEFAULT_LOCAL_SERVER_PORT as _, DEFAULT_SLOW_CONNECTION_THRESHOLD_MS as v, FEEDBACK_OPEN_FUNCTION_NAME as
|
|
4
|
-
import { Fragment as
|
|
5
|
-
import { Fragment as
|
|
3
|
+
import { AccessDeniedError as p, AppStartupFailedError as m, AuthenticationError as h, DEFAULT_LOCAL_SERVER_HOST as g, DEFAULT_LOCAL_SERVER_PORT as _, DEFAULT_SLOW_CONNECTION_THRESHOLD_MS as v, FEEDBACK_OPEN_FUNCTION_NAME as y, IKON_CAPTURE_EXCLUDE_ATTRIBUTE as b, IKON_INSPECT_MODE_CHANGED_EVENT as x, IKON_INSPECT_OUTLINE_ATTRIBUTE as S, IKON_PARAM_OAUTH_CODE as C, IKON_PARAM_OAUTH_PKCE as w, IKON_PARAM_OAUTH_PROVIDER as T, IKON_PARAM_OAUTH_TOKEN as E, IkonClient as ee, LogLevel as te, ProvisioningTimeoutError as ne, SSO_PROVIDER_PREFIX as D, ServerFullError as re, ServerUnavailableError as ie, SessionNotFoundError as ae, SsoRequiredError as oe, USER_REMOVAL_GRACE_DAYS as se, abortSignalTimeout as O, adoptPkceVerifierFromUrl as ce, buildOAuthStartUrl as le, cancelOwnRemoval as ue, captureViewAtTap as de, clearFeedbackParam as fe, clearLoginPrompt as pe, consentFor as me, createLogger as k, createPkceChallenge as he, deriveAuthUrl as A, deriveBackendType as ge, deriveCrossOriginAuthUrl as _e, extractUserIdFromToken as ve, getCurrentUser as ye, getDebugOverlayParam as be, getFeedbackParam as xe, getLangParam as Se, getLoginPromptState as Ce, getOrCreateDeviceId as we, getSameOriginAuthUrl as Te, getSignedOutParam as Ee, getTestLinkParam as De, getUrlWithoutSession as j, grantConsent as Oe, isCloudEnvironment as ke, isConsentGranted as Ae, isDebugModeEnabled as je, isEmbedded as Me, isInspectModeEnabled as Ne, onEmbeddedOAuthResult as Pe, parseUrlParams as Fe, randomUuid as Ie, readConsent as Le, reportConnectTimeline as Re, requestOwnRemoval as ze, restorePkceVerifier as Be, revokeConsent as Ve, setLoginPromptRequired as He, startEmbeddedOAuthSignIn as Ue, subscribeLoginPrompt as We, subscribeToLogEvents as Ge, takePkceVerifier as Ke } from "@ikonai/sdk";
|
|
4
|
+
import { Fragment as qe, Suspense as Je, createContext as Ye, createElement as Xe, lazy as Ze, memo as M, use as Qe, useCallback as N, useEffect as P, useLayoutEffect as $e, useMemo as F, useReducer as et, useRef as I, useState as L, useSyncExternalStore as tt } from "react";
|
|
5
|
+
import { Fragment as nt, jsx as R, jsxs as z } from "react/jsx-runtime";
|
|
6
6
|
//#region src/ikon-ui.ts
|
|
7
|
-
var
|
|
7
|
+
var rt = class {
|
|
8
8
|
core;
|
|
9
9
|
ownsCore;
|
|
10
10
|
stores = /* @__PURE__ */ new Map();
|
|
@@ -93,7 +93,7 @@ var it = class {
|
|
|
93
93
|
notify(e) {
|
|
94
94
|
for (let t of this.listeners) t(e);
|
|
95
95
|
}
|
|
96
|
-
},
|
|
96
|
+
}, it = 500, at = 500, ot = 150, st = 7e3, ct = "data-ikon-live-announcer", B = [], V = null, H = /* @__PURE__ */ new WeakMap(), lt = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakMap(), ut = /* @__PURE__ */ new WeakMap(), W = 0;
|
|
97
97
|
function dt(e) {
|
|
98
98
|
wt();
|
|
99
99
|
let t = {
|
|
@@ -195,8 +195,8 @@ function yt(e, t, n) {
|
|
|
195
195
|
return e ? e.text && n.length > e.text.length && n.startsWith(e.text) ? n.slice(e.text.length).trim() : n === e.text && t === e.hintKey ? "" : n : n;
|
|
196
196
|
}
|
|
197
197
|
function bt(e) {
|
|
198
|
-
if (e.length <=
|
|
199
|
-
let t = e.length -
|
|
198
|
+
if (e.length <= it) return e;
|
|
199
|
+
let t = e.length - it, n = e.indexOf(" ", t);
|
|
200
200
|
return `…${e.slice(n >= 0 && n < e.length - 1 ? n + 1 : t)}`;
|
|
201
201
|
}
|
|
202
202
|
function xt(e, t) {
|
|
@@ -327,7 +327,7 @@ function Lt(e, t) {
|
|
|
327
327
|
e.addEventListener("wheel", r, i), e.addEventListener("touchmove", r, i), e.addEventListener("keydown", r, i);
|
|
328
328
|
let a = e.scrollHeight, o = new ResizeObserver(() => {
|
|
329
329
|
let r = e.scrollHeight > a;
|
|
330
|
-
a = e.scrollHeight,
|
|
330
|
+
a = e.scrollHeight, r && !n && Ht(e) && Ft(e, t, "auto");
|
|
331
331
|
});
|
|
332
332
|
for (let t of Array.from(e.children)) o.observe(t);
|
|
333
333
|
let s = setTimeout(r, It);
|
|
@@ -424,9 +424,9 @@ function Jt(e) {
|
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
426
|
function Yt() {
|
|
427
|
-
let t =
|
|
428
|
-
let r = e(n.store, t), i =
|
|
429
|
-
return
|
|
427
|
+
let t = M(function({ nodeId: t, context: n }) {
|
|
428
|
+
let r = e(n.store, t), i = I(null), a = Et(r?.props?.targetViewId), o = r?.props?.focusOnly === !0, s = Et(r?.props?.priority), c = Kt(r?.props?.ranking), l = Math.max(0, Kt(r?.props?.cooldownMs)), u = Et(r?.props?.key), d = r?.props?.preciseGeneratedAt;
|
|
429
|
+
return P(() => {
|
|
430
430
|
if (typeof document > "u") return;
|
|
431
431
|
let e = i.current;
|
|
432
432
|
if (!e || a && e.closest("[data-ikon-view-id]")?.getAttribute("data-ikon-view-id") !== a) return;
|
|
@@ -449,7 +449,7 @@ function Yt() {
|
|
|
449
449
|
a,
|
|
450
450
|
u,
|
|
451
451
|
d
|
|
452
|
-
]), r ? /* @__PURE__ */
|
|
452
|
+
]), r ? /* @__PURE__ */ R("span", {
|
|
453
453
|
ref: i,
|
|
454
454
|
"data-ikon-node-id": r.id,
|
|
455
455
|
"data-ikon-source": r.sourceMarker,
|
|
@@ -468,15 +468,15 @@ function Yt() {
|
|
|
468
468
|
};
|
|
469
469
|
}
|
|
470
470
|
function Xt() {
|
|
471
|
-
let t =
|
|
472
|
-
let i = e(n.store, t), a = Tt(i?.props?.onInvokeId), o =
|
|
471
|
+
let t = M(function({ nodeId: t, context: n, className: r }) {
|
|
472
|
+
let i = e(n.store, t), a = Tt(i?.props?.onInvokeId), o = N(() => {
|
|
473
473
|
a && n.dispatchAction(a);
|
|
474
474
|
}, [a, n]);
|
|
475
475
|
if (!i) return null;
|
|
476
476
|
let s = Mt(i.props);
|
|
477
477
|
delete s.onInvokeId;
|
|
478
478
|
let c = Dt(Et(i.props?.className), r), l = i.children?.length ? n.renderChildren(i.children) : void 0;
|
|
479
|
-
return /* @__PURE__ */
|
|
479
|
+
return /* @__PURE__ */ R("div", {
|
|
480
480
|
...s,
|
|
481
481
|
"data-ikon-node-id": i.id,
|
|
482
482
|
"data-ikon-source": i.sourceMarker,
|
|
@@ -496,11 +496,11 @@ function Xt() {
|
|
|
496
496
|
};
|
|
497
497
|
}
|
|
498
498
|
function Zt() {
|
|
499
|
-
let t =
|
|
499
|
+
let t = M(function({ nodeId: t, context: n, className: r }) {
|
|
500
500
|
let i = e(n.store, t);
|
|
501
501
|
if (!i) return null;
|
|
502
502
|
let a = Mt(i.props), o = Dt("relative", Et(i.props?.className), r), s = i.children?.length ? n.renderChildren(i.children) : void 0;
|
|
503
|
-
return /* @__PURE__ */
|
|
503
|
+
return /* @__PURE__ */ R("div", {
|
|
504
504
|
...a,
|
|
505
505
|
"data-ikon-node-id": i.id,
|
|
506
506
|
"data-ikon-source": i.sourceMarker,
|
|
@@ -513,11 +513,11 @@ function Zt() {
|
|
|
513
513
|
};
|
|
514
514
|
}
|
|
515
515
|
function Qt() {
|
|
516
|
-
let t =
|
|
516
|
+
let t = M(function({ nodeId: t, context: n, className: r }) {
|
|
517
517
|
let i = e(n.store, t);
|
|
518
518
|
if (!i) return null;
|
|
519
519
|
let a = Mt(i.props), o = Dt("absolute", Et(i.props?.className), r), s = i.children?.length ? n.renderChildren(i.children) : void 0;
|
|
520
|
-
return /* @__PURE__ */
|
|
520
|
+
return /* @__PURE__ */ R("div", {
|
|
521
521
|
...a,
|
|
522
522
|
"data-ikon-node-id": i.id,
|
|
523
523
|
"data-ikon-source": i.sourceMarker,
|
|
@@ -574,13 +574,13 @@ function sn(e) {
|
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
576
|
function cn() {
|
|
577
|
-
let t =
|
|
578
|
-
let i = e(n.store, t), a =
|
|
579
|
-
if (
|
|
577
|
+
let t = M(function({ nodeId: t, context: n, className: r }) {
|
|
578
|
+
let i = e(n.store, t), a = I(null), o = i ? sn(i.props?.autoplay) : void 0, s = i ? on(i.props?.src) : void 0;
|
|
579
|
+
if (P(() => {
|
|
580
580
|
o && a.current && a.current.play().catch(() => {});
|
|
581
581
|
}, [o, s]), !i) return null;
|
|
582
582
|
let c = an(rn(i.props?.className), r), l = on(i.props?.preload), u = sn(i.props?.controls), d = sn(i.props?.loop), f = sn(i.props?.muted);
|
|
583
|
-
return /* @__PURE__ */
|
|
583
|
+
return /* @__PURE__ */ R("audio", {
|
|
584
584
|
ref: a,
|
|
585
585
|
src: s,
|
|
586
586
|
...l === void 0 ? {} : { preload: l },
|
|
@@ -599,72 +599,117 @@ function cn() {
|
|
|
599
599
|
}
|
|
600
600
|
//#endregion
|
|
601
601
|
//#region src/media/video-stream-view.tsx
|
|
602
|
-
var ln =
|
|
603
|
-
|
|
604
|
-
|
|
602
|
+
var ln = k("IkonVideoStreamView"), un = {
|
|
603
|
+
position: "absolute",
|
|
604
|
+
inset: 0,
|
|
605
|
+
display: "flex",
|
|
606
|
+
alignItems: "center",
|
|
607
|
+
justifyContent: "center"
|
|
608
|
+
}, dn = M(function({ client: e, streamId: t, className: n, style: r, width: i, height: a, attributes: o, getPlayback: s, fit: c, localStreamId: l, placeholder: u }) {
|
|
609
|
+
let d = I(null), f = I(null), [p, m] = L(null), [, h] = L(0);
|
|
610
|
+
P(() => {
|
|
611
|
+
if (e && l) return e.addLocalVideoCaptureListener(() => {
|
|
612
|
+
h((e) => e + 1);
|
|
613
|
+
});
|
|
614
|
+
}, [e, l]);
|
|
615
|
+
let [, g] = L(0);
|
|
616
|
+
P(() => {
|
|
605
617
|
if (e?.isWebRtcEnabled) return e.addWebRtcTrackMapListener((e) => {
|
|
606
|
-
e.kind === "video" &&
|
|
618
|
+
e.kind === "video" && g((e) => e + 1);
|
|
607
619
|
});
|
|
608
620
|
}, [e]);
|
|
609
|
-
let
|
|
610
|
-
|
|
611
|
-
let n =
|
|
612
|
-
if (!n || !t ||
|
|
613
|
-
let r = !1, i, a = 0,
|
|
621
|
+
let _ = e && l ? e.getLocalVideoCaptureStreamByStreamId(l) : null, v = _ ?? (e?.isWebRtcEnabled && t ? e.getWebRtcVideoStreamByStreamId(t) : null), y = t ? `canvas:${t}` : null, b = u != null && u !== !1;
|
|
622
|
+
P(() => {
|
|
623
|
+
let n = d.current;
|
|
624
|
+
if (!n || !t || v) return;
|
|
625
|
+
let r = !1, i, a, o = `canvas:${t}`, c = 0, l = !1, u = () => s ? s() : e?.media?.video, f = () => {
|
|
614
626
|
if (r) return;
|
|
615
|
-
let s =
|
|
627
|
+
let s = u();
|
|
616
628
|
if (!s && e?.isWebRtcMediaActive) {
|
|
617
|
-
|
|
629
|
+
l || (l = !0, ln.debug(`Stream ${t} has no WebRTC track yet; its canvas waits for one or for a fallback to custom playback`)), i = setTimeout(f, 500);
|
|
618
630
|
return;
|
|
619
631
|
}
|
|
620
632
|
if (!s) {
|
|
621
|
-
if (
|
|
633
|
+
if (c++ >= 50) {
|
|
622
634
|
ln.warn(`Gave up attaching the canvas for stream ${t}: video playback never became available`);
|
|
623
635
|
return;
|
|
624
636
|
}
|
|
625
|
-
i = setTimeout(
|
|
637
|
+
i = setTimeout(f, 100);
|
|
626
638
|
return;
|
|
627
639
|
}
|
|
628
|
-
s.
|
|
640
|
+
a = s.addStreamListener?.(t, (e) => {
|
|
641
|
+
m((t) => e === "firstFrame" ? o : t === o ? null : t);
|
|
642
|
+
}), s.attachCanvas(t, n).catch((e) => {
|
|
629
643
|
ln.error(`Failed to attach the canvas for stream ${t}, it will stay blank: ${String(e)}`);
|
|
630
644
|
});
|
|
631
645
|
};
|
|
632
|
-
return
|
|
633
|
-
r = !0, i !== void 0 && clearTimeout(i),
|
|
646
|
+
return f(), () => {
|
|
647
|
+
r = !0, i !== void 0 && clearTimeout(i), a?.(), u()?.detachCanvas(t), m((e) => e === o ? null : e);
|
|
634
648
|
};
|
|
635
649
|
}, [
|
|
636
650
|
e,
|
|
637
651
|
t,
|
|
638
|
-
|
|
639
|
-
s
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
652
|
+
v,
|
|
653
|
+
s,
|
|
654
|
+
b
|
|
655
|
+
]), P(() => {
|
|
656
|
+
let e = f.current;
|
|
657
|
+
if (e && v) return e.srcObject = v, () => {
|
|
643
658
|
e.srcObject = null;
|
|
644
659
|
};
|
|
645
|
-
}, [
|
|
646
|
-
let
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
style: r,
|
|
651
|
-
...i ? { width: i } : {},
|
|
652
|
-
...a ? { height: a } : {}
|
|
653
|
-
};
|
|
654
|
-
return d ? /* @__PURE__ */ L("video", {
|
|
655
|
-
ref: l,
|
|
660
|
+
}, [v, b]);
|
|
661
|
+
let x = () => {
|
|
662
|
+
v && m(v);
|
|
663
|
+
}, S = t ? { "data-ikon-video-stream-id": t } : {}, C = (e) => v ? /* @__PURE__ */ R("video", {
|
|
664
|
+
ref: f,
|
|
656
665
|
autoPlay: !0,
|
|
657
666
|
playsInline: !0,
|
|
658
667
|
muted: !0,
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
668
|
+
onLoadedData: x,
|
|
669
|
+
onPlaying: x,
|
|
670
|
+
...e
|
|
671
|
+
}, _ ? `local:${l}` : t) : /* @__PURE__ */ R("canvas", {
|
|
672
|
+
ref: d,
|
|
673
|
+
...e
|
|
663
674
|
}, t);
|
|
675
|
+
if (!b) return C({
|
|
676
|
+
...o,
|
|
677
|
+
...S,
|
|
678
|
+
className: n,
|
|
679
|
+
style: c ? {
|
|
680
|
+
...r,
|
|
681
|
+
objectFit: c
|
|
682
|
+
} : r,
|
|
683
|
+
...i ? { width: i } : {},
|
|
684
|
+
...a ? { height: a } : {}
|
|
685
|
+
});
|
|
686
|
+
let w = p !== null && p === (v ?? y);
|
|
687
|
+
return /* @__PURE__ */ z("div", {
|
|
688
|
+
...o,
|
|
689
|
+
...S,
|
|
690
|
+
className: n,
|
|
691
|
+
style: {
|
|
692
|
+
position: "relative",
|
|
693
|
+
...i ? { width: i } : {},
|
|
694
|
+
...a ? { height: a } : {},
|
|
695
|
+
...r
|
|
696
|
+
},
|
|
697
|
+
children: [C({ style: {
|
|
698
|
+
display: "block",
|
|
699
|
+
width: "100%",
|
|
700
|
+
height: "100%",
|
|
701
|
+
...c ? { objectFit: c } : {},
|
|
702
|
+
...w ? {} : { visibility: "hidden" }
|
|
703
|
+
} }), w ? null : /* @__PURE__ */ R("div", {
|
|
704
|
+
"data-ikon-video-placeholder": "",
|
|
705
|
+
style: un,
|
|
706
|
+
children: u
|
|
707
|
+
})]
|
|
708
|
+
});
|
|
664
709
|
});
|
|
665
710
|
//#endregion
|
|
666
711
|
//#region src/media/video-canvas.tsx
|
|
667
|
-
function
|
|
712
|
+
function fn(e) {
|
|
668
713
|
if (typeof e == "string") {
|
|
669
714
|
let t = e.trim();
|
|
670
715
|
return t.length > 0 ? t : void 0;
|
|
@@ -674,68 +719,74 @@ function dn(e) {
|
|
|
674
719
|
return t.length > 0 ? t.join(" ") : void 0;
|
|
675
720
|
}
|
|
676
721
|
}
|
|
677
|
-
function
|
|
722
|
+
function pn(...e) {
|
|
678
723
|
let t = [];
|
|
679
724
|
for (let n of e) n && n.trim() && t.push(n.trim());
|
|
680
725
|
return t.length > 0 ? t.join(" ") : void 0;
|
|
681
726
|
}
|
|
682
|
-
function
|
|
727
|
+
function mn(e) {
|
|
683
728
|
if (typeof e == "number" && Number.isFinite(e)) return Math.floor(e);
|
|
684
729
|
if (typeof e == "string" && e.trim().length > 0) {
|
|
685
730
|
let t = Number(e);
|
|
686
731
|
if (Number.isFinite(t)) return Math.floor(t);
|
|
687
732
|
}
|
|
688
733
|
}
|
|
689
|
-
function
|
|
734
|
+
function hn(e) {
|
|
690
735
|
if (typeof e != "string") return;
|
|
691
736
|
let t = e.trim();
|
|
692
737
|
return t.length > 0 ? t : void 0;
|
|
693
738
|
}
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
739
|
+
function gn(e) {
|
|
740
|
+
return e === "contain" || e === "cover" ? e : void 0;
|
|
741
|
+
}
|
|
742
|
+
var _n = "std.video-canvas", vn = "std.video-url-player";
|
|
743
|
+
function yn() {
|
|
744
|
+
let t = M(function({ nodeId: t, context: n, className: r }) {
|
|
745
|
+
let i = e(n.store, t), a = i ? hn(i.props?.streamId) : void 0, o = i ? hn(i.props?.onTapId) : void 0, s = i ? mn(i.props?.width) : void 0, c = i ? mn(i.props?.height) : void 0, l = i ? pn(fn(i.props?.className), r) : r, u = i ? gn(i.props?.fit) : void 0, d = i ? hn(i.props?.localStreamId) : void 0, f = N(() => n.video ?? n.client?.media?.video, [n]), p = N((e) => {
|
|
698
746
|
if (!o) return;
|
|
699
|
-
let t = e.target.getBoundingClientRect();
|
|
700
|
-
|
|
701
|
-
x: Math.min(1, Math.max(0, (e.clientX -
|
|
702
|
-
y: Math.min(1, Math.max(0, (e.clientY -
|
|
747
|
+
let t = e.target, r = (t.closest("[data-ikon-video-stream-id]") ?? t).getBoundingClientRect();
|
|
748
|
+
r.width <= 0 || r.height <= 0 || n.dispatchAction(o, {
|
|
749
|
+
x: Math.min(1, Math.max(0, (e.clientX - r.left) / r.width)),
|
|
750
|
+
y: Math.min(1, Math.max(0, (e.clientY - r.top) / r.height))
|
|
703
751
|
});
|
|
704
752
|
}, [o, n]);
|
|
705
753
|
if (!i) return null;
|
|
706
|
-
let
|
|
754
|
+
let m = /* @__PURE__ */ R(dn, {
|
|
707
755
|
client: n.client,
|
|
708
756
|
streamId: a,
|
|
709
757
|
className: l,
|
|
710
758
|
width: s,
|
|
711
759
|
height: c,
|
|
712
|
-
getPlayback:
|
|
760
|
+
getPlayback: f,
|
|
761
|
+
fit: u,
|
|
762
|
+
localStreamId: d,
|
|
763
|
+
placeholder: i.children?.length ? n.renderChildren(i.children) : void 0,
|
|
713
764
|
attributes: {
|
|
714
765
|
"data-ikon-node-id": i.id,
|
|
715
766
|
...i.sourceMarker ? { "data-ikon-source": i.sourceMarker } : {}
|
|
716
767
|
}
|
|
717
768
|
});
|
|
718
|
-
return o ? /* @__PURE__ */
|
|
769
|
+
return o ? /* @__PURE__ */ R("div", {
|
|
719
770
|
style: {
|
|
720
771
|
display: "contents",
|
|
721
772
|
cursor: "pointer"
|
|
722
773
|
},
|
|
723
|
-
onPointerUp:
|
|
724
|
-
children:
|
|
725
|
-
}) :
|
|
774
|
+
onPointerUp: p,
|
|
775
|
+
children: m
|
|
776
|
+
}) : m;
|
|
726
777
|
});
|
|
727
778
|
return ({ type: e }) => {
|
|
728
779
|
if (e === "std.video-canvas") return t;
|
|
729
780
|
};
|
|
730
781
|
}
|
|
731
|
-
function
|
|
782
|
+
function bn() {
|
|
732
783
|
return [
|
|
733
|
-
|
|
734
|
-
|
|
784
|
+
yn(),
|
|
785
|
+
Sn(),
|
|
735
786
|
cn()
|
|
736
787
|
];
|
|
737
788
|
}
|
|
738
|
-
function
|
|
789
|
+
function xn(e) {
|
|
739
790
|
if (typeof e == "boolean") return e;
|
|
740
791
|
if (typeof e == "string") {
|
|
741
792
|
let t = e.trim().toLowerCase();
|
|
@@ -743,14 +794,14 @@ function yn(e) {
|
|
|
743
794
|
if (t === "false") return !1;
|
|
744
795
|
}
|
|
745
796
|
}
|
|
746
|
-
function
|
|
747
|
-
let t =
|
|
748
|
-
let i = e(n.store, t), a =
|
|
749
|
-
if (
|
|
797
|
+
function Sn() {
|
|
798
|
+
let t = M(function({ nodeId: t, context: n, className: r }) {
|
|
799
|
+
let i = e(n.store, t), a = I(null), o = i ? xn(i.props?.autoplay) : void 0, s = i ? hn(i.props?.src) : void 0;
|
|
800
|
+
if (P(() => {
|
|
750
801
|
o && a.current && a.current.play().catch(() => {});
|
|
751
802
|
}, [o, s]), !i) return null;
|
|
752
|
-
let c = fn(
|
|
753
|
-
return /* @__PURE__ */
|
|
803
|
+
let c = pn(fn(i.props?.className), r), l = hn(i.props?.poster), u = xn(i.props?.controls), d = xn(i.props?.loop), f = xn(i.props?.muted), p = xn(i.props?.playsInline), m = mn(i.props?.width), h = mn(i.props?.height), g = i.children?.length ? n.renderChildren(i.children) : void 0;
|
|
804
|
+
return /* @__PURE__ */ R("video", {
|
|
754
805
|
ref: a,
|
|
755
806
|
src: s,
|
|
756
807
|
poster: l,
|
|
@@ -773,30 +824,30 @@ function bn() {
|
|
|
773
824
|
}
|
|
774
825
|
//#endregion
|
|
775
826
|
//#region src/media/media-module.ts
|
|
776
|
-
var
|
|
777
|
-
function
|
|
778
|
-
e.registerModule(
|
|
827
|
+
var Cn = "media", wn = async () => bn();
|
|
828
|
+
function Tn(e) {
|
|
829
|
+
e.registerModule(Cn, wn);
|
|
779
830
|
}
|
|
780
831
|
//#endregion
|
|
781
832
|
//#region src/renderer/lazy-resolver.ts
|
|
782
|
-
var
|
|
783
|
-
function
|
|
784
|
-
let r =
|
|
833
|
+
var En = () => null;
|
|
834
|
+
function Dn(e, t, n) {
|
|
835
|
+
let r = Ze(async () => ({ default: n(await t())()({ type: e }) ?? En })), i = (e) => Xe(Je, { fallback: null }, Xe(r, e));
|
|
785
836
|
return (t) => t.type === e ? i : void 0;
|
|
786
837
|
}
|
|
787
838
|
//#endregion
|
|
788
839
|
//#region src/shadertoy/shadertoy-module.ts
|
|
789
|
-
var
|
|
790
|
-
function
|
|
791
|
-
return
|
|
840
|
+
var On = "shadertoy";
|
|
841
|
+
function kn() {
|
|
842
|
+
return Dn(t, () => import("./shadertoy-renderer-Qdk-bdwO.js"), (e) => e.createShadertoyRendererResolver);
|
|
792
843
|
}
|
|
793
|
-
var
|
|
794
|
-
function
|
|
795
|
-
e.registerModule(
|
|
844
|
+
var An = async () => kn();
|
|
845
|
+
function jn(e) {
|
|
846
|
+
e.registerModule(On, An);
|
|
796
847
|
}
|
|
797
848
|
//#endregion
|
|
798
849
|
//#region src/ikon-ui-registry.ts
|
|
799
|
-
var
|
|
850
|
+
var Mn = k("UIRegistry"), Nn = class {
|
|
800
851
|
baseResolvers = [];
|
|
801
852
|
moduleLoaders = /* @__PURE__ */ new Map();
|
|
802
853
|
moduleResolvers = /* @__PURE__ */ new Map();
|
|
@@ -822,14 +873,14 @@ var An = D("UIRegistry"), jn = class {
|
|
|
822
873
|
async loadRegisteredModules() {
|
|
823
874
|
let e = !1;
|
|
824
875
|
for (let [t, n] of this.moduleLoaders.entries()) if (!this.moduleResolvers.has(t)) try {
|
|
825
|
-
let r =
|
|
876
|
+
let r = In(await n());
|
|
826
877
|
this.moduleResolvers.set(t, r), e = !0;
|
|
827
878
|
} catch (e) {
|
|
828
|
-
|
|
879
|
+
Mn.error(`[IkonUiRegistry] Failed to load module '${t}'.`, e);
|
|
829
880
|
}
|
|
830
881
|
let t = [];
|
|
831
882
|
for (let e of this.moduleLoaders.keys()) this.moduleResolvers.has(e) && t.push(e);
|
|
832
|
-
return
|
|
883
|
+
return Ln(t, this.activeModuleOrder) || (this.activeModuleOrder = t, e = !0), e && this.notify(), e;
|
|
833
884
|
}
|
|
834
885
|
resolve(e) {
|
|
835
886
|
for (let t of this.baseResolvers) {
|
|
@@ -839,7 +890,7 @@ var An = D("UIRegistry"), jn = class {
|
|
|
839
890
|
for (let t of this.activeModuleOrder) {
|
|
840
891
|
let n = this.moduleResolvers.get(t);
|
|
841
892
|
if (!n) {
|
|
842
|
-
|
|
893
|
+
Mn.warn(`Missing resolvers for module ${t}`);
|
|
843
894
|
continue;
|
|
844
895
|
}
|
|
845
896
|
for (let t of n) {
|
|
@@ -852,32 +903,32 @@ var An = D("UIRegistry"), jn = class {
|
|
|
852
903
|
for (let e of this.listeners) e();
|
|
853
904
|
}
|
|
854
905
|
};
|
|
855
|
-
function
|
|
856
|
-
let e = new
|
|
857
|
-
return nn(e),
|
|
906
|
+
function Pn() {
|
|
907
|
+
let e = new Nn();
|
|
908
|
+
return nn(e), Tn(e), jn(e), e.loadRegisteredModules(), e;
|
|
858
909
|
}
|
|
859
|
-
function
|
|
910
|
+
function Fn(e) {
|
|
860
911
|
return Array.isArray(e) ? e : [e];
|
|
861
912
|
}
|
|
862
|
-
function
|
|
863
|
-
return e ?
|
|
913
|
+
function In(e) {
|
|
914
|
+
return e ? Fn(e).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
|
|
864
915
|
}
|
|
865
|
-
function
|
|
916
|
+
function Ln(e, t) {
|
|
866
917
|
if (e.length !== t.length) return !1;
|
|
867
918
|
for (let n = 0; n < e.length; n += 1) if (e[n] !== t[n]) return !1;
|
|
868
919
|
return !0;
|
|
869
920
|
}
|
|
870
921
|
//#endregion
|
|
871
922
|
//#region src/renderer/use-root-view.ts
|
|
872
|
-
function
|
|
873
|
-
let n =
|
|
923
|
+
function Rn(e, t) {
|
|
924
|
+
let n = tt((t) => e.subscribe(t), () => {
|
|
874
925
|
let n = e.getSnapshot(), r = t ?? n.rootViewId, i = r ? n.views.get(r) : void 0;
|
|
875
926
|
return `${r ?? ""}:${i?.id ?? ""}`;
|
|
876
927
|
}, () => {
|
|
877
928
|
let n = e.getSnapshot(), r = t ?? n.rootViewId, i = r ? n.views.get(r) : void 0;
|
|
878
929
|
return `${r ?? ""}:${i?.id ?? ""}`;
|
|
879
930
|
});
|
|
880
|
-
return
|
|
931
|
+
return F(() => {
|
|
881
932
|
let [e, t] = n.split(":");
|
|
882
933
|
return {
|
|
883
934
|
rootViewId: e || void 0,
|
|
@@ -887,8 +938,8 @@ function In(e, t) {
|
|
|
887
938
|
}
|
|
888
939
|
//#endregion
|
|
889
940
|
//#region src/renderer/ui-renderer.tsx
|
|
890
|
-
var
|
|
891
|
-
function
|
|
941
|
+
var zn = k("UIRenderer");
|
|
942
|
+
function Bn(e) {
|
|
892
943
|
if (e === void 0) return "{}";
|
|
893
944
|
if (typeof e == "string") return e;
|
|
894
945
|
try {
|
|
@@ -897,39 +948,39 @@ function Rn(e) {
|
|
|
897
948
|
return "{}";
|
|
898
949
|
}
|
|
899
950
|
}
|
|
900
|
-
function
|
|
951
|
+
function Vn(e) {
|
|
901
952
|
let t = e.styleIds;
|
|
902
953
|
return Array.isArray(t) ? t : [];
|
|
903
954
|
}
|
|
904
|
-
var
|
|
905
|
-
function
|
|
906
|
-
let [t, n] =
|
|
907
|
-
return
|
|
955
|
+
var Hn = 1500, Un = 8e3;
|
|
956
|
+
function Wn(e) {
|
|
957
|
+
let [t, n] = L(0);
|
|
958
|
+
return P(() => {
|
|
908
959
|
if (e.subscribe) return e.subscribe(() => n((e) => e + 1));
|
|
909
960
|
}, [e]), t;
|
|
910
961
|
}
|
|
911
|
-
function
|
|
912
|
-
let [a, o] =
|
|
962
|
+
function Gn({ nodeType: t, nodeId: n, context: r, className: i }) {
|
|
963
|
+
let [a, o] = L(!1), [s, c] = L(!1), l = e(r.store, n), u = Wn(r.library), d = F(() => l ? r.library.resolve(l) : void 0, [
|
|
913
964
|
r.library,
|
|
914
965
|
l,
|
|
915
966
|
u
|
|
916
967
|
]);
|
|
917
|
-
return
|
|
918
|
-
let e = setTimeout(() => o(!0),
|
|
968
|
+
return P(() => {
|
|
969
|
+
let e = setTimeout(() => o(!0), Hn), t = setTimeout(() => c(!0), Un);
|
|
919
970
|
return () => {
|
|
920
971
|
clearTimeout(e), clearTimeout(t);
|
|
921
972
|
};
|
|
922
|
-
}, [t]),
|
|
923
|
-
|
|
973
|
+
}, [t]), P(() => {
|
|
974
|
+
s && !d && zn.error(`No React resolver is registered for node type '${t}', so it renders as an error placeholder instead of the component you expected. A custom node needs all four parts: (1) the React component, (2) a resolver that matches '${t}', (3) a registerModule(...) call for it in app.tsx, and (4) the C# view.AddNode("${t}", ...) extension. Prefer native view.* components where they fit.`);
|
|
924
975
|
}, [
|
|
925
976
|
s,
|
|
926
977
|
d,
|
|
927
978
|
t
|
|
928
|
-
]), d ? /* @__PURE__ */
|
|
979
|
+
]), d ? /* @__PURE__ */ R(d, {
|
|
929
980
|
nodeId: n,
|
|
930
981
|
context: r,
|
|
931
982
|
className: i
|
|
932
|
-
}) : a ? /* @__PURE__ */
|
|
983
|
+
}) : a ? /* @__PURE__ */ R("div", {
|
|
933
984
|
"data-ikon-node-id": n,
|
|
934
985
|
"data-ikon-unresolved-node": t,
|
|
935
986
|
role: "alert",
|
|
@@ -946,69 +997,69 @@ function Un({ nodeType: t, nodeId: n, context: r, className: i }) {
|
|
|
946
997
|
children: `Unregistered node type: ${t}\nNo React resolver is registered for it — register the component's module in app.tsx (see the console for details).`
|
|
947
998
|
}) : null;
|
|
948
999
|
}
|
|
949
|
-
function
|
|
1000
|
+
function Kn(e) {
|
|
950
1001
|
let t = e.children;
|
|
951
1002
|
return Array.isArray(t) ? t : [];
|
|
952
1003
|
}
|
|
953
|
-
function
|
|
1004
|
+
function qn(e, t) {
|
|
954
1005
|
return e.nodeId === t.nodeId && e.context === t.context;
|
|
955
1006
|
}
|
|
956
|
-
function
|
|
1007
|
+
function Jn(e) {
|
|
957
1008
|
if (e.length === 0) return "";
|
|
958
1009
|
if (e.length === 1) return e[0].id;
|
|
959
1010
|
let t = e[0].id;
|
|
960
1011
|
for (let n = 1; n < e.length; n++) t += "," + e[n].id;
|
|
961
1012
|
return t;
|
|
962
1013
|
}
|
|
963
|
-
var
|
|
964
|
-
let i = e(r.store, n), a = i ?
|
|
1014
|
+
var Yn = M(function t({ nodeId: n, context: r }) {
|
|
1015
|
+
let i = e(r.store, n), a = i ? Kn(i) : [], o = Jn(a), s = F(() => a.length === 0 ? null : a.map((e) => /* @__PURE__ */ R(t, {
|
|
965
1016
|
nodeId: e.id,
|
|
966
1017
|
context: r
|
|
967
1018
|
}, e.id)), [o, r]);
|
|
968
1019
|
if (!i) return null;
|
|
969
|
-
if (i.type === "root") return /* @__PURE__ */
|
|
970
|
-
let c =
|
|
971
|
-
return u ? /* @__PURE__ */
|
|
1020
|
+
if (i.type === "root") return /* @__PURE__ */ R(qe, { children: s }, i.id);
|
|
1021
|
+
let c = Vn(i), l = c.length > 0 ? c.join(" ") : void 0, u = r.library.resolve(i);
|
|
1022
|
+
return u ? /* @__PURE__ */ R(u, {
|
|
972
1023
|
nodeId: n,
|
|
973
1024
|
context: r,
|
|
974
1025
|
className: l
|
|
975
|
-
}) : /* @__PURE__ */
|
|
1026
|
+
}) : /* @__PURE__ */ R(Gn, {
|
|
976
1027
|
nodeType: i.type,
|
|
977
1028
|
nodeId: i.id,
|
|
978
1029
|
context: r,
|
|
979
1030
|
className: l
|
|
980
1031
|
});
|
|
981
|
-
},
|
|
982
|
-
function
|
|
983
|
-
return !Array.isArray(e) || e.length === 0 ? null : e.map((e) => /* @__PURE__ */
|
|
1032
|
+
}, qn);
|
|
1033
|
+
function Xn(e, t) {
|
|
1034
|
+
return !Array.isArray(e) || e.length === 0 ? null : e.map((e) => /* @__PURE__ */ R(Yn, {
|
|
984
1035
|
nodeId: e.id,
|
|
985
1036
|
context: t
|
|
986
1037
|
}, e.id));
|
|
987
1038
|
}
|
|
988
|
-
function
|
|
1039
|
+
function Zn(e, t) {
|
|
989
1040
|
return e.store === t.store && e.library === t.library && e.viewId === t.viewId && e.emptyFallback === t.emptyFallback;
|
|
990
1041
|
}
|
|
991
|
-
var
|
|
992
|
-
let { rootViewId: s, rootNodeId: c } =
|
|
1042
|
+
var Qn = M(function({ store: e, library: t, viewId: n, emptyFallback: r = null, onAction: i, client: a, video: o }) {
|
|
1043
|
+
let { rootViewId: s, rootNodeId: c } = Rn(e, n), l = I(i);
|
|
993
1044
|
l.current = i;
|
|
994
|
-
let u =
|
|
1045
|
+
let u = I(a);
|
|
995
1046
|
u.current = a;
|
|
996
|
-
let d =
|
|
1047
|
+
let d = I(o);
|
|
997
1048
|
d.current = o;
|
|
998
|
-
let f =
|
|
1049
|
+
let f = N((e, t, n) => {
|
|
999
1050
|
if (!e) return;
|
|
1000
|
-
let r =
|
|
1051
|
+
let r = Bn(t);
|
|
1001
1052
|
l.current?.(e, r, n);
|
|
1002
|
-
}, []), p =
|
|
1053
|
+
}, []), p = F(() => {
|
|
1003
1054
|
let n = {
|
|
1004
1055
|
store: e,
|
|
1005
1056
|
library: t,
|
|
1006
1057
|
handlerCache: e.handlerCache,
|
|
1007
1058
|
getPayload: (t) => e.getSnapshot().payloads.get(t),
|
|
1008
|
-
renderChildren: (e) =>
|
|
1059
|
+
renderChildren: (e) => Xn(e, n),
|
|
1009
1060
|
renderView: (t) => {
|
|
1010
1061
|
let r = e.getSnapshot().views.get(t);
|
|
1011
|
-
return r ? /* @__PURE__ */
|
|
1062
|
+
return r ? /* @__PURE__ */ R(Yn, {
|
|
1012
1063
|
nodeId: r.id,
|
|
1013
1064
|
context: n
|
|
1014
1065
|
}) : null;
|
|
@@ -1027,15 +1078,15 @@ var Xn = j(function({ store: e, library: t, viewId: n, emptyFallback: r = null,
|
|
|
1027
1078
|
t,
|
|
1028
1079
|
f
|
|
1029
1080
|
]);
|
|
1030
|
-
return !s || !c ? r : /* @__PURE__ */
|
|
1081
|
+
return !s || !c ? r : /* @__PURE__ */ R("div", {
|
|
1031
1082
|
"data-ikon-view-id": s,
|
|
1032
1083
|
style: { display: "contents" },
|
|
1033
|
-
children: /* @__PURE__ */
|
|
1084
|
+
children: /* @__PURE__ */ R(Yn, {
|
|
1034
1085
|
nodeId: c,
|
|
1035
1086
|
context: p
|
|
1036
1087
|
})
|
|
1037
1088
|
});
|
|
1038
|
-
},
|
|
1089
|
+
}, Zn), $n = class {
|
|
1039
1090
|
fallback;
|
|
1040
1091
|
renderers = /* @__PURE__ */ new Map();
|
|
1041
1092
|
listeners = /* @__PURE__ */ new Set();
|
|
@@ -1060,55 +1111,55 @@ var Xn = j(function({ store: e, library: t, viewId: n, emptyFallback: r = null,
|
|
|
1060
1111
|
for (let e of this.listeners) e();
|
|
1061
1112
|
}
|
|
1062
1113
|
};
|
|
1063
|
-
function
|
|
1064
|
-
return new
|
|
1114
|
+
function er(e, t) {
|
|
1115
|
+
return new $n(Object.entries(e), t);
|
|
1065
1116
|
}
|
|
1066
1117
|
//#endregion
|
|
1067
1118
|
//#region src/renderer/use-ui-store.ts
|
|
1068
|
-
function
|
|
1069
|
-
return
|
|
1119
|
+
function tr(e) {
|
|
1120
|
+
return tt((t) => e.subscribe(t), () => e.getSnapshot(), () => e.getSnapshot());
|
|
1070
1121
|
}
|
|
1071
1122
|
//#endregion
|
|
1072
1123
|
//#region src/inspect/inspect-overlay.tsx
|
|
1073
|
-
function
|
|
1074
|
-
e.style.outline = `2px solid ${t}`, e.style.outlineOffset = "1px", e.setAttribute(
|
|
1124
|
+
function nr(e, t) {
|
|
1125
|
+
e.style.outline = `2px solid ${t}`, e.style.outlineOffset = "1px", e.setAttribute(S, "");
|
|
1075
1126
|
}
|
|
1076
|
-
function
|
|
1077
|
-
e.style.outline = "", e.style.outlineOffset = "", e.removeAttribute(
|
|
1127
|
+
function rr(e) {
|
|
1128
|
+
e.style.outline = "", e.style.outlineOffset = "", e.removeAttribute(S);
|
|
1078
1129
|
}
|
|
1079
|
-
function
|
|
1080
|
-
let [e, t] =
|
|
1081
|
-
return
|
|
1130
|
+
function ir() {
|
|
1131
|
+
let [e, t] = L(Ne), n = I(!1);
|
|
1132
|
+
return P(() => {
|
|
1082
1133
|
if (e) return;
|
|
1083
1134
|
let r = () => {
|
|
1084
|
-
|
|
1135
|
+
Ne() && t(!0);
|
|
1085
1136
|
}, i = (e) => {
|
|
1086
1137
|
e.data?.type === "ikon-inspect-mode" && e.data.enabled && (n.current = !0, t(!0));
|
|
1087
1138
|
};
|
|
1088
|
-
return window.addEventListener(
|
|
1089
|
-
window.removeEventListener(
|
|
1139
|
+
return window.addEventListener(x, r), window.addEventListener("message", i), () => {
|
|
1140
|
+
window.removeEventListener(x, r), window.removeEventListener("message", i);
|
|
1090
1141
|
};
|
|
1091
|
-
}, [e]),
|
|
1142
|
+
}, [e]), P(() => {
|
|
1092
1143
|
if (!e) return;
|
|
1093
1144
|
let t = window.parent === window || n.current, r = null, i = [], a = document.createElement("div");
|
|
1094
|
-
a.setAttribute(
|
|
1145
|
+
a.setAttribute(b, ""), a.style.cssText = "position:fixed;z-index:99999;pointer-events:none;padding:2px 6px;background:#1e1e2e;color:#cdd6f4;font-size:11px;border-radius:4px;border:1px solid #45475a;white-space:nowrap;display:none;font-family:monospace;", document.body.appendChild(a);
|
|
1095
1146
|
function o() {
|
|
1096
|
-
r && !i.includes(r) &&
|
|
1147
|
+
r && !i.includes(r) && rr(r), r = null, a.style.display = "none";
|
|
1097
1148
|
}
|
|
1098
1149
|
function s(e) {
|
|
1099
|
-
for (let e of i) e !== r &&
|
|
1150
|
+
for (let e of i) e !== r && rr(e);
|
|
1100
1151
|
i = [];
|
|
1101
1152
|
let t = new Set(e);
|
|
1102
1153
|
for (let e of Array.from(document.querySelectorAll("[data-ikon-source]"))) {
|
|
1103
1154
|
let n = e.getAttribute("data-ikon-source") ?? "";
|
|
1104
|
-
t.has(n) && (
|
|
1155
|
+
t.has(n) && (nr(e, "#a6e3a1"), i.push(e));
|
|
1105
1156
|
}
|
|
1106
1157
|
}
|
|
1107
1158
|
function c(e) {
|
|
1108
1159
|
if (!t) return;
|
|
1109
1160
|
let n = e.target.closest?.("[data-ikon-source]");
|
|
1110
1161
|
if (!n || n === r) return;
|
|
1111
|
-
o(), r = n,
|
|
1162
|
+
o(), r = n, nr(r, "#89b4fa");
|
|
1112
1163
|
let i = n.getAttribute("data-ikon-source") ?? "";
|
|
1113
1164
|
a.textContent = i, a.style.display = "block";
|
|
1114
1165
|
let s = n.getBoundingClientRect();
|
|
@@ -1137,7 +1188,7 @@ function nr() {
|
|
|
1137
1188
|
}
|
|
1138
1189
|
function f(e) {
|
|
1139
1190
|
if (e === r || (o(), !e)) return;
|
|
1140
|
-
r = e,
|
|
1191
|
+
r = e, nr(r, i.includes(e) ? "#a6e3a1" : "#89b4fa");
|
|
1141
1192
|
let t = e.getAttribute("data-ikon-source") ?? "";
|
|
1142
1193
|
a.textContent = t, a.style.display = "block";
|
|
1143
1194
|
let n = e.getBoundingClientRect();
|
|
@@ -1216,33 +1267,33 @@ function nr() {
|
|
|
1216
1267
|
}
|
|
1217
1268
|
//#endregion
|
|
1218
1269
|
//#region src/surface.tsx
|
|
1219
|
-
var
|
|
1220
|
-
function
|
|
1270
|
+
var ar = k("IkonUiSurface");
|
|
1271
|
+
function or(e, t) {
|
|
1221
1272
|
return e === t;
|
|
1222
1273
|
}
|
|
1223
|
-
var
|
|
1224
|
-
let s =
|
|
1274
|
+
var sr = M(function({ stores: e, registry: t, category: n = a, onAction: r, client: i, inspect: o = !0 }) {
|
|
1275
|
+
let s = F(() => Array.from(e.keys()).sort().join(","), [e]), c = I(r);
|
|
1225
1276
|
c.current = r;
|
|
1226
|
-
let l =
|
|
1277
|
+
let l = I(i);
|
|
1227
1278
|
l.current = i;
|
|
1228
|
-
let u =
|
|
1279
|
+
let u = F(() => {
|
|
1229
1280
|
let t = [];
|
|
1230
1281
|
for (let [r, i] of e) {
|
|
1231
1282
|
let e = i.store.getSnapshot();
|
|
1232
|
-
|
|
1283
|
+
or(i.category, n) && e.rootViewId && e.views.has(e.rootViewId) && t.push({
|
|
1233
1284
|
key: r,
|
|
1234
1285
|
store: i.store
|
|
1235
|
-
})
|
|
1286
|
+
});
|
|
1236
1287
|
}
|
|
1237
1288
|
return t;
|
|
1238
1289
|
}, [
|
|
1239
1290
|
e,
|
|
1240
1291
|
n,
|
|
1241
1292
|
s
|
|
1242
|
-
]), d =
|
|
1243
|
-
return
|
|
1244
|
-
f && !d.current && (d.current = !0,
|
|
1245
|
-
}, [f]), f ? /* @__PURE__ */
|
|
1293
|
+
]), d = I(!1), f = u.length > 0;
|
|
1294
|
+
return P(() => {
|
|
1295
|
+
f && !d.current && (d.current = !0, ar.debug("First UI render"));
|
|
1296
|
+
}, [f]), f ? /* @__PURE__ */ z(nt, { children: [o && /* @__PURE__ */ R(ir, {}), u.map(({ key: e, store: n }) => /* @__PURE__ */ R(Qn, {
|
|
1246
1297
|
store: n,
|
|
1247
1298
|
library: t,
|
|
1248
1299
|
onAction: c.current,
|
|
@@ -1252,8 +1303,8 @@ var ar = j(function({ stores: e, registry: t, category: n = a, onAction: r, clie
|
|
|
1252
1303
|
});
|
|
1253
1304
|
//#endregion
|
|
1254
1305
|
//#region src/parallax-view.tsx
|
|
1255
|
-
function
|
|
1256
|
-
return /* @__PURE__ */
|
|
1306
|
+
function cr({ mount: e, stores: t, registry: n, client: r, onAction: i }) {
|
|
1307
|
+
return /* @__PURE__ */ R(sr, {
|
|
1257
1308
|
stores: t,
|
|
1258
1309
|
registry: n,
|
|
1259
1310
|
category: e,
|
|
@@ -1263,7 +1314,7 @@ function or({ mount: e, stores: t, registry: n, client: r, onAction: i }) {
|
|
|
1263
1314
|
}
|
|
1264
1315
|
//#endregion
|
|
1265
1316
|
//#region src/motion/motion-controller.ts
|
|
1266
|
-
var
|
|
1317
|
+
var lr = k("MotionController"), ur = {
|
|
1267
1318
|
ease: [
|
|
1268
1319
|
.25,
|
|
1269
1320
|
.1,
|
|
@@ -1436,17 +1487,17 @@ var sr = D("MotionController"), cr = {
|
|
|
1436
1487
|
function G(e) {
|
|
1437
1488
|
return e <= 0 ? 0 : e >= 1 ? 1 : e;
|
|
1438
1489
|
}
|
|
1439
|
-
function
|
|
1490
|
+
function dr(e) {
|
|
1440
1491
|
if (e == null) return;
|
|
1441
1492
|
let t = e.trim();
|
|
1442
1493
|
if (!t) return;
|
|
1443
1494
|
let n = Number.parseFloat(t);
|
|
1444
1495
|
return Number.isFinite(n) ? n : void 0;
|
|
1445
1496
|
}
|
|
1446
|
-
function
|
|
1497
|
+
function fr(e) {
|
|
1447
1498
|
return typeof CSS < "u" && CSS.escape ? CSS.escape(e) : e.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
1448
1499
|
}
|
|
1449
|
-
function
|
|
1500
|
+
function pr(e, t, n, r) {
|
|
1450
1501
|
let i = 1 / 10, a = /* @__PURE__ */ new Float32Array(11);
|
|
1451
1502
|
function o(e, t, n) {
|
|
1452
1503
|
return ((3 * t - 3 * n + 1) * e + (3 * n - 6 * t)) * e * e + 3 * t * e;
|
|
@@ -1480,34 +1531,34 @@ function dr(e, t, n, r) {
|
|
|
1480
1531
|
for (let t = 0; t < 11; t += 1) a[t] = o(t * i, e, n);
|
|
1481
1532
|
return (e) => e <= 0 ? 0 : e >= 1 ? 1 : o(u(e), t, r);
|
|
1482
1533
|
}
|
|
1483
|
-
function
|
|
1534
|
+
function mr(e) {
|
|
1484
1535
|
let t = /steps\(\s*([0-9]+)\s*(?:,\s*([a-z-]+)\s*)?\)/i.exec(e);
|
|
1485
1536
|
if (!t) return (e) => G(e);
|
|
1486
1537
|
let n = Math.max(1, parseInt(t[1], 10)), r = (t[2] ?? "end").toLowerCase();
|
|
1487
1538
|
return r === "start" || r === "jump-start" ? (e) => G(Math.ceil(e * n) / n) : r === "none" || r === "jump-none" ? (e) => G(Math.round(e * n) / n) : r === "both" || r === "jump-both" ? (e) => G((Math.floor(e * n) + .5) / n) : (e) => G(Math.floor(e * n) / n);
|
|
1488
1539
|
}
|
|
1489
|
-
function
|
|
1540
|
+
function hr(e) {
|
|
1490
1541
|
if (!e) return (e) => G(e);
|
|
1491
1542
|
let t = e.trim().toLowerCase();
|
|
1492
1543
|
if (!t || t === "linear") return (e) => G(e);
|
|
1493
|
-
if (
|
|
1494
|
-
let [e, n, r, i] =
|
|
1544
|
+
if (ur[t]) {
|
|
1545
|
+
let [e, n, r, i] = ur[t], a = pr(e, n, r, i);
|
|
1495
1546
|
return (e) => G(a(G(e)));
|
|
1496
1547
|
}
|
|
1497
1548
|
if (t.startsWith("cubic-bezier(") && t.endsWith(")")) {
|
|
1498
1549
|
let e = t.slice(13, -1).split(",").map((e) => Number.parseFloat(e.trim()));
|
|
1499
1550
|
if (e.length === 4 && e.every((e) => Number.isFinite(e))) {
|
|
1500
|
-
let [t, n, r, i] = e, a =
|
|
1551
|
+
let [t, n, r, i] = e, a = pr(t, n, r, i);
|
|
1501
1552
|
return (e) => G(a(G(e)));
|
|
1502
1553
|
}
|
|
1503
1554
|
}
|
|
1504
1555
|
if (t.startsWith("steps(") && t.endsWith(")")) {
|
|
1505
|
-
let e =
|
|
1556
|
+
let e = mr(t);
|
|
1506
1557
|
return (t) => e(G(t));
|
|
1507
1558
|
}
|
|
1508
1559
|
return (e) => G(e);
|
|
1509
1560
|
}
|
|
1510
|
-
function
|
|
1561
|
+
function gr(e) {
|
|
1511
1562
|
if (!e) return;
|
|
1512
1563
|
let t = /(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)\s*->\s*(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)/.exec(e);
|
|
1513
1564
|
if (!t) return;
|
|
@@ -1524,7 +1575,7 @@ function mr(e) {
|
|
|
1524
1575
|
outEnd: a
|
|
1525
1576
|
};
|
|
1526
1577
|
}
|
|
1527
|
-
var
|
|
1578
|
+
var _r = new class {
|
|
1528
1579
|
bindingsByStyle = /* @__PURE__ */ new Map();
|
|
1529
1580
|
observer;
|
|
1530
1581
|
observeScheduled = !1;
|
|
@@ -1549,7 +1600,7 @@ var hr = new class {
|
|
|
1549
1600
|
for (let e of Array.from(this.globalCleanups)) try {
|
|
1550
1601
|
e();
|
|
1551
1602
|
} catch (e) {
|
|
1552
|
-
|
|
1603
|
+
lr.warn("Failed to cleanup binding listener", e);
|
|
1553
1604
|
}
|
|
1554
1605
|
this.globalCleanups.clear(), this.elementStates.clear(), this.styleToElements.clear(), this.bindingsByStyle.clear(), this.pendingScanStyles.clear(), this.scanScheduled = !1, this.observer &&= (this.observer.disconnect(), void 0);
|
|
1555
1606
|
}
|
|
@@ -1557,24 +1608,24 @@ var hr = new class {
|
|
|
1557
1608
|
if (t) try {
|
|
1558
1609
|
let n = JSON.parse(t).motionBindings ?? [], r = n.map((t) => this.parseBinding(e, t)).filter((e) => e !== void 0);
|
|
1559
1610
|
if (r.length === 0) {
|
|
1560
|
-
n.length > 0 &&
|
|
1611
|
+
n.length > 0 && lr.warn(`Style ${e} declares ${n.length} motion binding(s) but none are usable; it will not animate`);
|
|
1561
1612
|
return;
|
|
1562
1613
|
}
|
|
1563
1614
|
return { bindings: r };
|
|
1564
1615
|
} catch (e) {
|
|
1565
|
-
|
|
1616
|
+
lr.warn("Failed to parse motion metadata", e);
|
|
1566
1617
|
return;
|
|
1567
1618
|
}
|
|
1568
1619
|
}
|
|
1569
1620
|
parseBinding(e, t) {
|
|
1570
1621
|
let n = t.source?.trim();
|
|
1571
1622
|
if (!n) {
|
|
1572
|
-
|
|
1623
|
+
lr.warn(`Style ${e} has a motion binding with no source; discarding it`);
|
|
1573
1624
|
return;
|
|
1574
1625
|
}
|
|
1575
|
-
let r =
|
|
1626
|
+
let r = dr(t.min) ?? 0, i = dr(t.max), a = i === void 0 ? r + 100 : i, o = (t.clamp ?? "clamp").trim().toLowerCase(), s = !!t.reverse, c = hr(t.ease), l = gr(t.map), u = t.targetId?.trim() || void 0;
|
|
1576
1627
|
if (Number.isNaN(r) || Number.isNaN(a)) {
|
|
1577
|
-
|
|
1628
|
+
lr.warn(`Style ${e} has a motion binding on '${n}' with an unreadable range; discarding it`);
|
|
1578
1629
|
return;
|
|
1579
1630
|
}
|
|
1580
1631
|
return {
|
|
@@ -1622,7 +1673,7 @@ var hr = new class {
|
|
|
1622
1673
|
scanExistingNodes(e) {
|
|
1623
1674
|
let t = this.bindingsByStyle.get(e);
|
|
1624
1675
|
if (!t || typeof document > "u") return;
|
|
1625
|
-
let n = `.${
|
|
1676
|
+
let n = `.${fr(e)}`;
|
|
1626
1677
|
document.querySelectorAll(n).forEach((n) => this.applyStyleToElement(n, e, t));
|
|
1627
1678
|
}
|
|
1628
1679
|
applyStyleToElement(e, t, n) {
|
|
@@ -1658,7 +1709,7 @@ var hr = new class {
|
|
|
1658
1709
|
}
|
|
1659
1710
|
resolveScrollContainer(e, t) {
|
|
1660
1711
|
if (t.targetId) {
|
|
1661
|
-
let e = `[data-ikon-motion-source="${
|
|
1712
|
+
let e = `[data-ikon-motion-source="${fr(t.targetId)}"]`, n = typeof document < "u" ? document.querySelector(e) : null;
|
|
1662
1713
|
if (n) return n;
|
|
1663
1714
|
}
|
|
1664
1715
|
return e.closest("[data-ikon-view-type=\"scroll-view\"]");
|
|
@@ -1713,7 +1764,7 @@ var hr = new class {
|
|
|
1713
1764
|
try {
|
|
1714
1765
|
e();
|
|
1715
1766
|
} catch (e) {
|
|
1716
|
-
|
|
1767
|
+
lr.warn("Failed to cleanup listener", e);
|
|
1717
1768
|
}
|
|
1718
1769
|
this.globalCleanups.delete(e);
|
|
1719
1770
|
}
|
|
@@ -1753,28 +1804,28 @@ var hr = new class {
|
|
|
1753
1804
|
}();
|
|
1754
1805
|
//#endregion
|
|
1755
1806
|
//#region src/use-ikon-styles.ts
|
|
1756
|
-
function
|
|
1757
|
-
let t =
|
|
1758
|
-
if (
|
|
1807
|
+
function vr(e) {
|
|
1808
|
+
let t = I(/* @__PURE__ */ new Map()), n = N(({ styleId: e, css: n, common: r }) => {
|
|
1809
|
+
if (e && typeof document < "u") {
|
|
1759
1810
|
if (n) {
|
|
1760
1811
|
let r = t.current.get(e);
|
|
1761
1812
|
r || (r = document.createElement("style"), r.setAttribute("data-ikon-style-id", e), document.head.appendChild(r), t.current.set(e, r)), r.textContent = n;
|
|
1762
1813
|
}
|
|
1763
|
-
|
|
1814
|
+
_r.registerStyle(e, r);
|
|
1764
1815
|
}
|
|
1765
|
-
}, []), r =
|
|
1766
|
-
if (
|
|
1816
|
+
}, []), r = N((e) => {
|
|
1817
|
+
if (typeof document < "u") for (let n of e) {
|
|
1767
1818
|
let e = t.current.get(n);
|
|
1768
|
-
e && (e.remove(), t.current.delete(n)),
|
|
1819
|
+
e && (e.remove(), t.current.delete(n)), _r.unregisterStyle(n);
|
|
1769
1820
|
}
|
|
1770
|
-
}, []), i =
|
|
1821
|
+
}, []), i = N(() => {
|
|
1771
1822
|
if (typeof document < "u") {
|
|
1772
1823
|
for (let e of t.current.values()) e.remove();
|
|
1773
1824
|
t.current.clear();
|
|
1774
1825
|
}
|
|
1775
|
-
|
|
1826
|
+
_r.reset();
|
|
1776
1827
|
}, []);
|
|
1777
|
-
return
|
|
1828
|
+
return P(() => {
|
|
1778
1829
|
if (!e) return;
|
|
1779
1830
|
for (let t of e.getUiStyles()) n(t);
|
|
1780
1831
|
let t = e.subscribeToStyles(n), a = e.subscribeToStyleDeletes?.(r);
|
|
@@ -1786,7 +1837,7 @@ function gr(e) {
|
|
|
1786
1837
|
i,
|
|
1787
1838
|
n,
|
|
1788
1839
|
r
|
|
1789
|
-
]),
|
|
1840
|
+
]), P(() => () => i(), [i]), {
|
|
1790
1841
|
setStyle: n,
|
|
1791
1842
|
deleteStyles: r,
|
|
1792
1843
|
reset: i
|
|
@@ -1794,7 +1845,7 @@ function gr(e) {
|
|
|
1794
1845
|
}
|
|
1795
1846
|
//#endregion
|
|
1796
1847
|
//#region src/use-ikon-ui-stores.ts
|
|
1797
|
-
function
|
|
1848
|
+
function yr(e) {
|
|
1798
1849
|
let t = [];
|
|
1799
1850
|
for (let [n, r] of e) {
|
|
1800
1851
|
let e = r.store.getSnapshot(), i = e.rootViewId && e.views.has(e.rootViewId);
|
|
@@ -1802,15 +1853,15 @@ function _r(e) {
|
|
|
1802
1853
|
}
|
|
1803
1854
|
return t.sort(), t.join(",");
|
|
1804
1855
|
}
|
|
1805
|
-
function
|
|
1806
|
-
let [t, n] =
|
|
1807
|
-
return
|
|
1856
|
+
function br(e) {
|
|
1857
|
+
let [t, n] = L(), r = I("");
|
|
1858
|
+
return P(() => {
|
|
1808
1859
|
if (!e) {
|
|
1809
1860
|
n(void 0), r.current = "";
|
|
1810
1861
|
return;
|
|
1811
1862
|
}
|
|
1812
1863
|
let t = () => {
|
|
1813
|
-
let t = e.getStores(), i =
|
|
1864
|
+
let t = e.getStores(), i = yr(t);
|
|
1814
1865
|
i !== r.current && (r.current = i, n(t));
|
|
1815
1866
|
};
|
|
1816
1867
|
return t(), e.subscribe(t);
|
|
@@ -1818,17 +1869,18 @@ function vr(e) {
|
|
|
1818
1869
|
}
|
|
1819
1870
|
//#endregion
|
|
1820
1871
|
//#region src/media/use-sibling-client.ts
|
|
1821
|
-
|
|
1822
|
-
|
|
1872
|
+
var xr = k("useSiblingClient");
|
|
1873
|
+
function Sr(e, t, n) {
|
|
1874
|
+
let [r, i] = L(null), [a, o] = L(null), s = I(n);
|
|
1823
1875
|
s.current = n;
|
|
1824
1876
|
let c = t ? JSON.stringify(Object.entries(t).sort(([e], [t]) => e < t ? -1 : +(e > t))) : null;
|
|
1825
|
-
return
|
|
1877
|
+
return P(() => {
|
|
1826
1878
|
if (!e || c === null) return;
|
|
1827
1879
|
let t = Object.fromEntries(JSON.parse(c)), n = e.createSibling(t, s.current), r = !1;
|
|
1828
1880
|
return o(null), n.connect().then(() => {
|
|
1829
1881
|
r || i(n);
|
|
1830
1882
|
}).catch((e) => {
|
|
1831
|
-
r || o(e instanceof Error ? e : Error(String(e)));
|
|
1883
|
+
r || (xr.error("Sibling connection failed:", e), o(e instanceof Error ? e : Error(String(e))));
|
|
1832
1884
|
}), () => {
|
|
1833
1885
|
r = !0, i(null), n.disconnect();
|
|
1834
1886
|
};
|
|
@@ -1839,10 +1891,10 @@ function yr(e, t, n) {
|
|
|
1839
1891
|
}
|
|
1840
1892
|
//#endregion
|
|
1841
1893
|
//#region src/media/use-media-capture.ts
|
|
1842
|
-
var
|
|
1843
|
-
function
|
|
1844
|
-
let [i, a] =
|
|
1845
|
-
return o.current = r,
|
|
1894
|
+
var Cr = k("IkonMediaCaptureHooks");
|
|
1895
|
+
function wr(e, t, n, r) {
|
|
1896
|
+
let [i, a] = L(null), o = I(r);
|
|
1897
|
+
return o.current = r, P(() => {
|
|
1846
1898
|
if (!e || !t) return;
|
|
1847
1899
|
let r = !1, i = null;
|
|
1848
1900
|
return a(null), (async () => {
|
|
@@ -1855,7 +1907,7 @@ function xr(e, t, n, r) {
|
|
|
1855
1907
|
try {
|
|
1856
1908
|
i = await o.current(t);
|
|
1857
1909
|
} catch (e) {
|
|
1858
|
-
r || (
|
|
1910
|
+
r || (Cr.error(`${n} capture start failed: ${String(e)}`), a(e instanceof Error ? e : Error(String(e))));
|
|
1859
1911
|
return;
|
|
1860
1912
|
}
|
|
1861
1913
|
r && i.stop();
|
|
@@ -1869,17 +1921,17 @@ function xr(e, t, n, r) {
|
|
|
1869
1921
|
n
|
|
1870
1922
|
]), { error: i };
|
|
1871
1923
|
}
|
|
1872
|
-
function
|
|
1873
|
-
let r =
|
|
1874
|
-
return r.current = n,
|
|
1924
|
+
function Tr(e, t, n) {
|
|
1925
|
+
let r = I(n);
|
|
1926
|
+
return r.current = n, wr(e, t, "microphone", N((e) => e.audio.startMic(r.current ?? {}), []));
|
|
1875
1927
|
}
|
|
1876
|
-
function
|
|
1877
|
-
let r =
|
|
1878
|
-
return r.current = n,
|
|
1928
|
+
function Er(e, t, n) {
|
|
1929
|
+
let r = I(n);
|
|
1930
|
+
return r.current = n, wr(e, t, "camera", N((e) => e.video.startCamera(r.current), []));
|
|
1879
1931
|
}
|
|
1880
|
-
function
|
|
1881
|
-
let r =
|
|
1882
|
-
return r.current = n,
|
|
1932
|
+
function Dr(e, t, n) {
|
|
1933
|
+
let r = I(n);
|
|
1934
|
+
return r.current = n, wr(e, t, "screen", N((e) => e.video.startScreen(r.current), []));
|
|
1883
1935
|
}
|
|
1884
1936
|
//#endregion
|
|
1885
1937
|
//#region src/shared/render-motion-letters.tsx
|
|
@@ -1893,7 +1945,7 @@ var K = {
|
|
|
1893
1945
|
LetterReverse: 32,
|
|
1894
1946
|
WordReverse: 64,
|
|
1895
1947
|
LineReverse: 128
|
|
1896
|
-
},
|
|
1948
|
+
}, Or = [
|
|
1897
1949
|
{
|
|
1898
1950
|
flag: K.Letter,
|
|
1899
1951
|
hints: [
|
|
@@ -1942,7 +1994,7 @@ var K = {
|
|
|
1942
1994
|
"[data-emoji]"
|
|
1943
1995
|
]
|
|
1944
1996
|
}
|
|
1945
|
-
],
|
|
1997
|
+
], kr = [
|
|
1946
1998
|
{
|
|
1947
1999
|
flag: K.LetterReverse,
|
|
1948
2000
|
hint: "[data-motion-letter]"
|
|
@@ -1955,8 +2007,8 @@ var K = {
|
|
|
1955
2007
|
flag: K.LineReverse,
|
|
1956
2008
|
hint: "[data-motion-line]"
|
|
1957
2009
|
}
|
|
1958
|
-
],
|
|
1959
|
-
function
|
|
2010
|
+
], Ar = ":nth-last-child(", jr = K.Letter | K.Word | K.Line | K.Paragraph | K.Emoji | K.LetterReverse | K.WordReverse | K.LineReverse, Mr = K.LetterReverse | K.WordReverse | K.LineReverse, Nr = K.Letter | K.Word | K.Line | K.Paragraph, Pr = /* @__PURE__ */ new Map(), Fr = 16384;
|
|
2011
|
+
function Ir(e) {
|
|
1960
2012
|
return {
|
|
1961
2013
|
letter: 0,
|
|
1962
2014
|
word: 0,
|
|
@@ -1967,119 +2019,119 @@ function Nr(e) {
|
|
|
1967
2019
|
reverseTotals: e
|
|
1968
2020
|
};
|
|
1969
2021
|
}
|
|
1970
|
-
function
|
|
2022
|
+
function Lr(e, t, n) {
|
|
1971
2023
|
let r = e.reverseTotals?.[t];
|
|
1972
2024
|
return r === void 0 ? n : r - 1 - n;
|
|
1973
2025
|
}
|
|
1974
|
-
function
|
|
1975
|
-
if (!e || e.length >
|
|
1976
|
-
let n =
|
|
2026
|
+
function Rr(e, t) {
|
|
2027
|
+
if (!e || e.length > Fr) return e;
|
|
2028
|
+
let n = mi(t), r = q(n, K.Emoji), i = n & Nr;
|
|
1977
2029
|
if (i === K.None && !r) return e;
|
|
1978
2030
|
let a = e.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
|
|
1979
|
-
if (i === K.None) return
|
|
1980
|
-
let o =
|
|
1981
|
-
return o.length === 0 ? r ?
|
|
2031
|
+
if (i === K.None) return fi(a);
|
|
2032
|
+
let o = li(a);
|
|
2033
|
+
return o.length === 0 ? r ? fi(a) : e : zr(ui(o), n, Ir(Br(o, n)));
|
|
1982
2034
|
}
|
|
1983
|
-
function
|
|
2035
|
+
function zr(e, t, n) {
|
|
1984
2036
|
let r = [];
|
|
1985
|
-
for (let i of e) r.push(...
|
|
2037
|
+
for (let i of e) r.push(...Vr(i, t, n));
|
|
1986
2038
|
return r;
|
|
1987
2039
|
}
|
|
1988
|
-
function
|
|
1989
|
-
if ((t &
|
|
2040
|
+
function Br(e, t) {
|
|
2041
|
+
if ((t & Mr) === K.None) return;
|
|
1990
2042
|
let n = q(t, K.LetterReverse), r = q(t, K.WordReverse), i = 0, a = 0;
|
|
1991
|
-
if (n || r) for (let t of e) for (let e of t.text.split(/\s+/)) e && (a += 1, n && (i +=
|
|
2043
|
+
if (n || r) for (let t of e) for (let e of t.text.split(/\s+/)) e && (a += 1, n && (i += qr(e).length));
|
|
1992
2044
|
return {
|
|
1993
2045
|
letter: n ? i : void 0,
|
|
1994
2046
|
word: r ? a : void 0,
|
|
1995
2047
|
line: q(t, K.LineReverse) ? e.length : void 0
|
|
1996
2048
|
};
|
|
1997
2049
|
}
|
|
1998
|
-
function
|
|
2050
|
+
function Vr(e, t, n) {
|
|
1999
2051
|
let r = [];
|
|
2000
2052
|
for (let i of e) {
|
|
2001
|
-
let e =
|
|
2053
|
+
let e = Hr(i, t, n);
|
|
2002
2054
|
r.push(...e);
|
|
2003
2055
|
}
|
|
2004
2056
|
if (q(t, K.Paragraph)) {
|
|
2005
2057
|
let e = n.paragraph++;
|
|
2006
|
-
return [/* @__PURE__ */
|
|
2058
|
+
return [/* @__PURE__ */ R("span", {
|
|
2007
2059
|
"data-motion-paragraph": !0,
|
|
2008
|
-
style:
|
|
2060
|
+
style: di(e),
|
|
2009
2061
|
children: r
|
|
2010
2062
|
}, `motion-paragraph-${e}`)];
|
|
2011
2063
|
}
|
|
2012
2064
|
return r;
|
|
2013
2065
|
}
|
|
2014
|
-
function
|
|
2015
|
-
let r =
|
|
2066
|
+
function Hr(e, t, n) {
|
|
2067
|
+
let r = Ur(e.text, t, n), i = [];
|
|
2016
2068
|
if (q(t, K.Line)) {
|
|
2017
2069
|
let e = n.line++;
|
|
2018
|
-
i.push(/* @__PURE__ */
|
|
2070
|
+
i.push(/* @__PURE__ */ R("span", {
|
|
2019
2071
|
"data-motion-line": !0,
|
|
2020
|
-
style:
|
|
2072
|
+
style: di(Lr(n, "line", e)),
|
|
2021
2073
|
children: r
|
|
2022
2074
|
}, `motion-line-${e}`));
|
|
2023
2075
|
} else i.push(...r);
|
|
2024
|
-
for (let t = 0; t < e.breaks; t++) i.push(/* @__PURE__ */
|
|
2076
|
+
for (let t = 0; t < e.breaks; t++) i.push(/* @__PURE__ */ R("br", {}, `motion-break-${n.br++}`));
|
|
2025
2077
|
return i;
|
|
2026
2078
|
}
|
|
2027
|
-
function
|
|
2079
|
+
function Ur(e, t, n) {
|
|
2028
2080
|
if (!e) return [];
|
|
2029
2081
|
let r = q(t, K.Word), i = [], a = /(\s+)/g, o = 0, s;
|
|
2030
2082
|
for (; (s = a.exec(e)) !== null;) {
|
|
2031
2083
|
if (s.index > o) {
|
|
2032
2084
|
let a = e.slice(o, s.index);
|
|
2033
|
-
i.push(
|
|
2085
|
+
i.push(Wr(a, n, t, r));
|
|
2034
2086
|
}
|
|
2035
2087
|
i.push(s[0]), o = s.index + s[0].length;
|
|
2036
2088
|
}
|
|
2037
2089
|
if (o < e.length) {
|
|
2038
2090
|
let a = e.slice(o);
|
|
2039
|
-
i.push(
|
|
2091
|
+
i.push(Wr(a, n, t, r));
|
|
2040
2092
|
}
|
|
2041
2093
|
return i;
|
|
2042
2094
|
}
|
|
2043
|
-
function
|
|
2044
|
-
let i = t.word++, a =
|
|
2045
|
-
return r ? /* @__PURE__ */
|
|
2095
|
+
function Wr(e, t, n, r) {
|
|
2096
|
+
let i = t.word++, a = Kr(e, n, t), o = `motion-word-${i}`, s = Gr(Lr(t, "word", i), r);
|
|
2097
|
+
return r ? /* @__PURE__ */ R("span", {
|
|
2046
2098
|
"data-motion-word": !0,
|
|
2047
2099
|
style: s,
|
|
2048
2100
|
children: a
|
|
2049
|
-
}, o) : /* @__PURE__ */
|
|
2101
|
+
}, o) : /* @__PURE__ */ R("span", {
|
|
2050
2102
|
style: s,
|
|
2051
2103
|
children: a
|
|
2052
2104
|
}, o);
|
|
2053
2105
|
}
|
|
2054
|
-
function
|
|
2106
|
+
function Gr(e, t) {
|
|
2055
2107
|
return t ? {
|
|
2056
|
-
...
|
|
2108
|
+
...di(e),
|
|
2057
2109
|
whiteSpace: "nowrap"
|
|
2058
2110
|
} : { whiteSpace: "nowrap" };
|
|
2059
2111
|
}
|
|
2060
|
-
function
|
|
2112
|
+
function Kr(e, t, n) {
|
|
2061
2113
|
if (!e) return [];
|
|
2062
2114
|
let r = q(t, K.Letter), i = q(t, K.Emoji);
|
|
2063
2115
|
if (!r) {
|
|
2064
2116
|
if (!i) return [e];
|
|
2065
|
-
let t =
|
|
2117
|
+
let t = qr(e);
|
|
2066
2118
|
if (t.length === 0) return [e];
|
|
2067
|
-
let { nodes: r } =
|
|
2119
|
+
let { nodes: r } = pi(t, n);
|
|
2068
2120
|
return r;
|
|
2069
2121
|
}
|
|
2070
|
-
let a = [], o =
|
|
2122
|
+
let a = [], o = qr(e);
|
|
2071
2123
|
for (let e of o) {
|
|
2072
|
-
let t = n.letter++, r = `motion-letter-${t}`, o =
|
|
2124
|
+
let t = n.letter++, r = `motion-letter-${t}`, o = di(Lr(n, "letter", t));
|
|
2073
2125
|
if (e === "\n") {
|
|
2074
|
-
a.push(/* @__PURE__ */
|
|
2126
|
+
a.push(/* @__PURE__ */ R("span", {
|
|
2075
2127
|
"data-motion-letter": !0,
|
|
2076
2128
|
style: o,
|
|
2077
|
-
children: /* @__PURE__ */
|
|
2129
|
+
children: /* @__PURE__ */ R("br", {})
|
|
2078
2130
|
}, r));
|
|
2079
2131
|
continue;
|
|
2080
2132
|
}
|
|
2081
|
-
let s = i &&
|
|
2082
|
-
a.push(/* @__PURE__ */
|
|
2133
|
+
let s = i && oi(e) ? { "data-motion-emoji": !0 } : void 0, c = e === " " ? "\xA0" : e;
|
|
2134
|
+
a.push(/* @__PURE__ */ R("span", {
|
|
2083
2135
|
"data-motion-letter": !0,
|
|
2084
2136
|
style: o,
|
|
2085
2137
|
...s,
|
|
@@ -2088,46 +2140,46 @@ function Ur(e, t, n) {
|
|
|
2088
2140
|
}
|
|
2089
2141
|
return a;
|
|
2090
2142
|
}
|
|
2091
|
-
function
|
|
2143
|
+
function qr(e) {
|
|
2092
2144
|
if (!e) return [];
|
|
2093
|
-
let t =
|
|
2094
|
-
return t ? Array.from(t.segment(e), (e) => e.segment) :
|
|
2145
|
+
let t = Yr();
|
|
2146
|
+
return t ? Array.from(t.segment(e), (e) => e.segment) : Xr(e);
|
|
2095
2147
|
}
|
|
2096
|
-
var
|
|
2097
|
-
function
|
|
2098
|
-
return
|
|
2148
|
+
var Jr;
|
|
2149
|
+
function Yr() {
|
|
2150
|
+
return Jr === void 0 && (Jr = typeof Intl < "u" && typeof Intl.Segmenter == "function" ? new Intl.Segmenter(void 0, { granularity: "grapheme" }) : null), Jr;
|
|
2099
2151
|
}
|
|
2100
|
-
function
|
|
2152
|
+
function Xr(e) {
|
|
2101
2153
|
let t = [], n = Array.from(e), r = "";
|
|
2102
2154
|
for (let e = 0; e < n.length; e++) {
|
|
2103
2155
|
let i = n[e], a = n[e + 1];
|
|
2104
|
-
r += i, !(a &&
|
|
2156
|
+
r += i, !(a && Zr(i, a)) && (t.push(r), r = "");
|
|
2105
2157
|
}
|
|
2106
2158
|
return r && t.push(r), t;
|
|
2107
2159
|
}
|
|
2108
|
-
function
|
|
2109
|
-
return t ? !!(
|
|
2160
|
+
function Zr(e, t) {
|
|
2161
|
+
return t ? !!(Qr(e) || Qr(t) || ri(t) || $r(t) || ei(t) || ti(e) && ti(t)) : !1;
|
|
2110
2162
|
}
|
|
2111
|
-
function
|
|
2163
|
+
function Qr(e) {
|
|
2112
2164
|
return e.codePointAt(0) === 8205;
|
|
2113
2165
|
}
|
|
2114
|
-
function
|
|
2166
|
+
function $r(e) {
|
|
2115
2167
|
let t = e.codePointAt(0);
|
|
2116
2168
|
return t === void 0 ? !1 : t >= 65024 && t <= 65039 || t >= 917760 && t <= 917999;
|
|
2117
2169
|
}
|
|
2118
|
-
function
|
|
2170
|
+
function ei(e) {
|
|
2119
2171
|
let t = e.codePointAt(0);
|
|
2120
2172
|
return t !== void 0 && t >= 127995 && t <= 127999;
|
|
2121
2173
|
}
|
|
2122
|
-
function
|
|
2174
|
+
function ti(e) {
|
|
2123
2175
|
let t = e.codePointAt(0);
|
|
2124
2176
|
return t !== void 0 && t >= 127462 && t <= 127487;
|
|
2125
2177
|
}
|
|
2126
|
-
var
|
|
2127
|
-
function
|
|
2128
|
-
return e ? (
|
|
2178
|
+
var ni;
|
|
2179
|
+
function ri(e) {
|
|
2180
|
+
return e ? (ni ||= ii(), ni(e)) : !1;
|
|
2129
2181
|
}
|
|
2130
|
-
function
|
|
2182
|
+
function ii() {
|
|
2131
2183
|
try {
|
|
2132
2184
|
let e = /\p{Mark}/u;
|
|
2133
2185
|
return (t) => e.test(t);
|
|
@@ -2138,19 +2190,19 @@ function ti() {
|
|
|
2138
2190
|
};
|
|
2139
2191
|
}
|
|
2140
2192
|
}
|
|
2141
|
-
var
|
|
2142
|
-
function
|
|
2143
|
-
return e ? (
|
|
2193
|
+
var ai;
|
|
2194
|
+
function oi(e) {
|
|
2195
|
+
return e ? (ai ||= si(), ai(e)) : !1;
|
|
2144
2196
|
}
|
|
2145
|
-
function
|
|
2197
|
+
function si() {
|
|
2146
2198
|
try {
|
|
2147
2199
|
let e = /\p{Extended_Pictographic}/u;
|
|
2148
2200
|
return (t) => e.test(t);
|
|
2149
2201
|
} catch {
|
|
2150
|
-
return
|
|
2202
|
+
return ci;
|
|
2151
2203
|
}
|
|
2152
2204
|
}
|
|
2153
|
-
function
|
|
2205
|
+
function ci(e) {
|
|
2154
2206
|
if (!e) return !1;
|
|
2155
2207
|
for (let t of Array.from(e)) {
|
|
2156
2208
|
let e = t.codePointAt(0);
|
|
@@ -2158,7 +2210,7 @@ function ai(e) {
|
|
|
2158
2210
|
}
|
|
2159
2211
|
return !1;
|
|
2160
2212
|
}
|
|
2161
|
-
function
|
|
2213
|
+
function li(e) {
|
|
2162
2214
|
let t = [], n = "", r = 0;
|
|
2163
2215
|
for (let i = 0; i < e.length; i++) {
|
|
2164
2216
|
let a = e[i];
|
|
@@ -2176,7 +2228,7 @@ function oi(e) {
|
|
|
2176
2228
|
breaks: r
|
|
2177
2229
|
}), t;
|
|
2178
2230
|
}
|
|
2179
|
-
function
|
|
2231
|
+
function ui(e) {
|
|
2180
2232
|
if (e.length === 0) return [];
|
|
2181
2233
|
let t = [], n = [];
|
|
2182
2234
|
for (let r of e) n.push(r), r.breaks >= 2 && (t.push(n), n = []);
|
|
@@ -2185,7 +2237,7 @@ function si(e) {
|
|
|
2185
2237
|
function q(e, t) {
|
|
2186
2238
|
return (e & t) === t;
|
|
2187
2239
|
}
|
|
2188
|
-
function
|
|
2240
|
+
function di(e) {
|
|
2189
2241
|
return {
|
|
2190
2242
|
"--tw-motion-seq-index": e.toString(),
|
|
2191
2243
|
backgroundColor: "inherit",
|
|
@@ -2202,22 +2254,22 @@ function ci(e) {
|
|
|
2202
2254
|
WebkitTextFillColor: "inherit"
|
|
2203
2255
|
};
|
|
2204
2256
|
}
|
|
2205
|
-
function
|
|
2257
|
+
function fi(e) {
|
|
2206
2258
|
if (!e) return e;
|
|
2207
|
-
let t =
|
|
2259
|
+
let t = qr(e);
|
|
2208
2260
|
if (t.length === 0) return e;
|
|
2209
|
-
let { nodes: n, sawEmoji: r } =
|
|
2261
|
+
let { nodes: n, sawEmoji: r } = pi(t);
|
|
2210
2262
|
return r ? n.length === 1 ? n[0] ?? e : n : e;
|
|
2211
2263
|
}
|
|
2212
|
-
function
|
|
2264
|
+
function pi(e, t) {
|
|
2213
2265
|
let n = [], r = "", i = !1, a = t?.emoji ?? 0, o = () => {
|
|
2214
2266
|
r &&= (n.push(r), "");
|
|
2215
2267
|
};
|
|
2216
2268
|
for (let s of e) {
|
|
2217
|
-
if (
|
|
2269
|
+
if (oi(s)) {
|
|
2218
2270
|
i = !0, o();
|
|
2219
2271
|
let e = `motion-emoji-${t ? t.emoji++ : a++}`;
|
|
2220
|
-
n.push(/* @__PURE__ */
|
|
2272
|
+
n.push(/* @__PURE__ */ R("span", {
|
|
2221
2273
|
"data-motion-emoji": !0,
|
|
2222
2274
|
children: s
|
|
2223
2275
|
}, e));
|
|
@@ -2233,16 +2285,16 @@ function ui(e, t) {
|
|
|
2233
2285
|
sawEmoji: !1
|
|
2234
2286
|
};
|
|
2235
2287
|
}
|
|
2236
|
-
function
|
|
2288
|
+
function mi(e) {
|
|
2237
2289
|
if (!e) return K.None;
|
|
2238
2290
|
let t = e.trim();
|
|
2239
2291
|
if (!t) return K.None;
|
|
2240
|
-
let n =
|
|
2292
|
+
let n = Pr.get(t);
|
|
2241
2293
|
if (typeof n == "number") return n;
|
|
2242
2294
|
if (typeof document > "u") return K.None;
|
|
2243
2295
|
let r = t.split(/\s+/).filter(Boolean);
|
|
2244
2296
|
if (r.length === 0) return K.None;
|
|
2245
|
-
let i = r.map((e) => `.${
|
|
2297
|
+
let i = r.map((e) => `.${vi(e)}`), a = i.map((e) => RegExp(`(^|[^a-zA-Z0-9_-])${yi(e)}(?![a-zA-Z0-9_-])`)), o = K.None, s = !1;
|
|
2246
2298
|
for (let e of Array.from(document.styleSheets)) {
|
|
2247
2299
|
let t;
|
|
2248
2300
|
try {
|
|
@@ -2250,13 +2302,13 @@ function di(e) {
|
|
|
2250
2302
|
} catch {
|
|
2251
2303
|
continue;
|
|
2252
2304
|
}
|
|
2253
|
-
let n =
|
|
2254
|
-
if (n.mask && (o |= n.mask, o ===
|
|
2305
|
+
let n = hi(t, a, i, !1);
|
|
2306
|
+
if (n.mask && (o |= n.mask, o === jr)) break;
|
|
2255
2307
|
s ||= n.sawStyleRule;
|
|
2256
2308
|
}
|
|
2257
|
-
return (o !== K.None || s) &&
|
|
2309
|
+
return (o !== K.None || s) && Pr.set(t, o), o;
|
|
2258
2310
|
}
|
|
2259
|
-
function
|
|
2311
|
+
function hi(e, t, n, r) {
|
|
2260
2312
|
if (!e) return {
|
|
2261
2313
|
mask: K.None,
|
|
2262
2314
|
sawStyleRule: !1
|
|
@@ -2269,15 +2321,15 @@ function fi(e, t, n, r) {
|
|
|
2269
2321
|
let e = s.selectorText ?? "";
|
|
2270
2322
|
if (!e || !t.some((t) => t.test(e))) continue;
|
|
2271
2323
|
a = !0;
|
|
2272
|
-
for (let t of
|
|
2273
|
-
if (!r && e.includes(
|
|
2274
|
-
if (i ===
|
|
2324
|
+
for (let t of Or) t.hints.some((t) => e.includes(t)) && (i |= t.flag);
|
|
2325
|
+
if (!r && e.includes(Ar) && gi(e, n)) for (let t of kr) e.includes(t.hint) && (i |= t.flag);
|
|
2326
|
+
if (i === jr) return {
|
|
2275
2327
|
mask: i,
|
|
2276
2328
|
sawStyleRule: !0
|
|
2277
2329
|
};
|
|
2278
2330
|
} else if ("cssRules" in s) {
|
|
2279
|
-
let e =
|
|
2280
|
-
if (e.mask && (i |= e.mask, i ===
|
|
2331
|
+
let e = hi(s.cssRules, t, n, r || !_i(s));
|
|
2332
|
+
if (e.mask && (i |= e.mask, i === jr)) return {
|
|
2281
2333
|
mask: i,
|
|
2282
2334
|
sawStyleRule: !0
|
|
2283
2335
|
};
|
|
@@ -2290,23 +2342,23 @@ function fi(e, t, n, r) {
|
|
|
2290
2342
|
sawStyleRule: a
|
|
2291
2343
|
};
|
|
2292
2344
|
}
|
|
2293
|
-
function
|
|
2345
|
+
function gi(e, t) {
|
|
2294
2346
|
let n = e.trimStart().split(/\s/, 1)[0] ?? "";
|
|
2295
2347
|
return t.includes(n);
|
|
2296
2348
|
}
|
|
2297
|
-
function
|
|
2349
|
+
function _i(e) {
|
|
2298
2350
|
return typeof CSSLayerBlockRule < "u" && e instanceof CSSLayerBlockRule;
|
|
2299
2351
|
}
|
|
2300
|
-
function
|
|
2352
|
+
function vi(e) {
|
|
2301
2353
|
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
2302
2354
|
}
|
|
2303
|
-
function
|
|
2355
|
+
function yi(e) {
|
|
2304
2356
|
return e.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
|
|
2305
2357
|
}
|
|
2306
2358
|
//#endregion
|
|
2307
2359
|
//#region src/auth/storage.ts
|
|
2308
|
-
var
|
|
2309
|
-
function
|
|
2360
|
+
var bi = "ikon-auth-session", xi = "ikon-auth-refreshable", Si = "ikon-auth-auto-login-attempted-run", Ci = 6048e5, wi = 6e4;
|
|
2361
|
+
function Ti(e) {
|
|
2310
2362
|
try {
|
|
2311
2363
|
let t = e.split(".");
|
|
2312
2364
|
if (t.length !== 3) return;
|
|
@@ -2316,100 +2368,100 @@ function Si(e) {
|
|
|
2316
2368
|
return;
|
|
2317
2369
|
}
|
|
2318
2370
|
}
|
|
2319
|
-
function
|
|
2320
|
-
let t =
|
|
2321
|
-
return !t || typeof t.exp == "number" && Date.now() >= t.exp * 1e3 -
|
|
2371
|
+
function Ei(e) {
|
|
2372
|
+
let t = Ti(e);
|
|
2373
|
+
return !t || typeof t.exp == "number" && Date.now() >= t.exp * 1e3 - wi;
|
|
2322
2374
|
}
|
|
2323
|
-
function
|
|
2324
|
-
let t =
|
|
2375
|
+
function Di(e) {
|
|
2376
|
+
let t = Ti(e)?.exp;
|
|
2325
2377
|
return typeof t == "number" ? (/* @__PURE__ */ new Date(t * 1e3)).toISOString() : void 0;
|
|
2326
2378
|
}
|
|
2327
2379
|
function J(e) {
|
|
2328
2380
|
try {
|
|
2329
|
-
localStorage.setItem(
|
|
2381
|
+
localStorage.setItem(bi, JSON.stringify(e));
|
|
2330
2382
|
} catch {
|
|
2331
2383
|
console.warn("Failed to save auth session to localStorage");
|
|
2332
2384
|
}
|
|
2333
2385
|
}
|
|
2334
|
-
function
|
|
2386
|
+
function Oi() {
|
|
2335
2387
|
try {
|
|
2336
|
-
let e = localStorage.getItem(
|
|
2388
|
+
let e = localStorage.getItem(bi);
|
|
2337
2389
|
if (!e) return null;
|
|
2338
2390
|
let t = JSON.parse(e);
|
|
2339
|
-
return Date.now() - t.authenticatedAt >
|
|
2391
|
+
return Date.now() - t.authenticatedAt > Ci || Ei(t.token) ? (Ii(), null) : t;
|
|
2340
2392
|
} catch {
|
|
2341
2393
|
return console.warn("Failed to load auth session from localStorage"), null;
|
|
2342
2394
|
}
|
|
2343
2395
|
}
|
|
2344
|
-
function
|
|
2396
|
+
function ki() {
|
|
2345
2397
|
try {
|
|
2346
|
-
let e = localStorage.getItem(
|
|
2398
|
+
let e = localStorage.getItem(bi);
|
|
2347
2399
|
if (!e) return !1;
|
|
2348
2400
|
let t = JSON.parse(e);
|
|
2349
|
-
return t.provider === "dev" &&
|
|
2401
|
+
return t.provider === "dev" && Ei(t.token);
|
|
2350
2402
|
} catch {
|
|
2351
2403
|
return !1;
|
|
2352
2404
|
}
|
|
2353
2405
|
}
|
|
2354
|
-
function
|
|
2406
|
+
function Ai(e) {
|
|
2355
2407
|
try {
|
|
2356
|
-
localStorage.removeItem(
|
|
2408
|
+
localStorage.removeItem(bi), localStorage.setItem(xi, JSON.stringify(e));
|
|
2357
2409
|
} catch {
|
|
2358
2410
|
console.warn("Failed to save the auth session marker to localStorage");
|
|
2359
2411
|
}
|
|
2360
2412
|
}
|
|
2361
|
-
function
|
|
2413
|
+
function ji() {
|
|
2362
2414
|
try {
|
|
2363
|
-
let e = localStorage.getItem(
|
|
2415
|
+
let e = localStorage.getItem(xi);
|
|
2364
2416
|
if (!e) return null;
|
|
2365
2417
|
let t = JSON.parse(e);
|
|
2366
|
-
return Date.now() - t.renewedAt >
|
|
2418
|
+
return Date.now() - t.renewedAt > Ci ? (Ni(), null) : t;
|
|
2367
2419
|
} catch {
|
|
2368
2420
|
return console.warn("Failed to load the auth session marker from localStorage"), null;
|
|
2369
2421
|
}
|
|
2370
2422
|
}
|
|
2371
|
-
function
|
|
2372
|
-
let e =
|
|
2373
|
-
e &&
|
|
2423
|
+
function Mi() {
|
|
2424
|
+
let e = ji();
|
|
2425
|
+
e && Ai({
|
|
2374
2426
|
...e,
|
|
2375
2427
|
renewedAt: Date.now()
|
|
2376
2428
|
});
|
|
2377
2429
|
}
|
|
2378
|
-
function
|
|
2430
|
+
function Ni() {
|
|
2379
2431
|
try {
|
|
2380
|
-
localStorage.removeItem(
|
|
2432
|
+
localStorage.removeItem(xi);
|
|
2381
2433
|
} catch {
|
|
2382
2434
|
console.warn("Failed to clear the auth session marker from localStorage");
|
|
2383
2435
|
}
|
|
2384
2436
|
}
|
|
2385
|
-
function
|
|
2386
|
-
|
|
2437
|
+
function Pi() {
|
|
2438
|
+
Oi()?.provider === "anonymous" && Ii(), ji()?.provider === "anonymous" && Ni();
|
|
2387
2439
|
}
|
|
2388
|
-
function
|
|
2440
|
+
function Fi() {
|
|
2389
2441
|
try {
|
|
2390
2442
|
let e = typeof window < "u" ? new URLSearchParams(window.location.search) : void 0;
|
|
2391
2443
|
if (e?.get("ikon_token") || e?.get("ikon_code")) return !0;
|
|
2392
2444
|
} catch {}
|
|
2393
|
-
let e =
|
|
2445
|
+
let e = Oi()?.provider ?? ji()?.provider;
|
|
2394
2446
|
return e !== void 0 && e !== "anonymous";
|
|
2395
2447
|
}
|
|
2396
|
-
function
|
|
2448
|
+
function Ii() {
|
|
2397
2449
|
try {
|
|
2398
|
-
localStorage.removeItem(
|
|
2450
|
+
localStorage.removeItem(bi);
|
|
2399
2451
|
} catch {
|
|
2400
2452
|
console.warn("Failed to clear auth session from localStorage");
|
|
2401
2453
|
}
|
|
2402
2454
|
}
|
|
2403
|
-
function
|
|
2455
|
+
function Li(e) {
|
|
2404
2456
|
if (e) try {
|
|
2405
|
-
sessionStorage.setItem(
|
|
2457
|
+
sessionStorage.setItem(Si, e);
|
|
2406
2458
|
} catch {
|
|
2407
2459
|
console.warn("Failed to record auto-login attempt in sessionStorage");
|
|
2408
2460
|
}
|
|
2409
2461
|
}
|
|
2410
|
-
function
|
|
2462
|
+
function Ri() {
|
|
2411
2463
|
try {
|
|
2412
|
-
return sessionStorage.getItem(
|
|
2464
|
+
return sessionStorage.getItem(Si);
|
|
2413
2465
|
} catch {
|
|
2414
2466
|
return null;
|
|
2415
2467
|
}
|
|
@@ -2425,8 +2477,8 @@ function Y(e) {
|
|
|
2425
2477
|
}
|
|
2426
2478
|
//#endregion
|
|
2427
2479
|
//#region src/auth/auth-service.ts
|
|
2428
|
-
var
|
|
2429
|
-
async function
|
|
2480
|
+
var zi = 15e3, Bi = 15e3, X = k("AuthService");
|
|
2481
|
+
async function Vi(e) {
|
|
2430
2482
|
try {
|
|
2431
2483
|
return await fetch(e, {
|
|
2432
2484
|
method: "GET",
|
|
@@ -2436,34 +2488,34 @@ async function Ri(e) {
|
|
|
2436
2488
|
return `no-cors probe ALSO FAILED (${e instanceof Error ? e.name : "Error"}) → origin is unreachable: TLS handshake / certificate, DNS, or network (old browser may not trust this host's cert)`;
|
|
2437
2489
|
}
|
|
2438
2490
|
}
|
|
2439
|
-
var
|
|
2440
|
-
function
|
|
2441
|
-
if (e.headers.get(
|
|
2491
|
+
var Hi = "x-ikon-auth-service";
|
|
2492
|
+
function Ui(e) {
|
|
2493
|
+
if (e.headers.get(Hi) !== null) return !1;
|
|
2442
2494
|
if (e.status === 404 || e.status === 405) return !0;
|
|
2443
2495
|
let t = e.headers.get("content-type") ?? "";
|
|
2444
2496
|
return e.status === 200 && t.includes("text/html");
|
|
2445
2497
|
}
|
|
2446
2498
|
async function Z(e, t, n) {
|
|
2447
|
-
let r = `${e}${t}`, i =
|
|
2499
|
+
let r = `${e}${t}`, i = Te(), a = i !== null && e === i, o = a ? await _e() : i, s = o !== null && o !== e ? `${o}${t}` : null, c;
|
|
2448
2500
|
try {
|
|
2449
2501
|
c = await fetch(r, n);
|
|
2450
2502
|
} catch (i) {
|
|
2451
2503
|
let a = i instanceof Error ? `${i.name}: ${i.message}` : String(i);
|
|
2452
2504
|
if (!s) {
|
|
2453
|
-
let n = await
|
|
2505
|
+
let n = await Vi(e);
|
|
2454
2506
|
throw X.error(`Auth request ${t} could not reach ${r} — ${a}. ${n}`), Error(`Auth request could not reach ${r} (${a}). ${n}`, { cause: i });
|
|
2455
2507
|
}
|
|
2456
2508
|
X.warn(`Auth request ${t} could not reach ${r} (${a}); falling back to ${s}`);
|
|
2457
2509
|
try {
|
|
2458
2510
|
return await fetch(s, n);
|
|
2459
2511
|
} catch (n) {
|
|
2460
|
-
let i = n instanceof Error ? `${n.name}: ${n.message}` : String(n), o = await
|
|
2512
|
+
let i = n instanceof Error ? `${n.name}: ${n.message}` : String(n), o = await Vi(e);
|
|
2461
2513
|
throw X.error(`Auth request ${t} failed on both ${r} (${a}) and ${s} (${i}). ${o}`), Error(`Auth request unreachable: ${r} (${a}) and ${s} (${i})`, { cause: n });
|
|
2462
2514
|
}
|
|
2463
2515
|
}
|
|
2464
|
-
return a && s !== null &&
|
|
2516
|
+
return a && s !== null && Ui(c) ? (X.warn(`Auth request ${t} got a non-auth-service answer from ${r} (${c.status}); this LB has no /ikon/auth route, falling back to ${s}`), fetch(s, n)) : c;
|
|
2465
2517
|
}
|
|
2466
|
-
async function
|
|
2518
|
+
async function Wi(e, t) {
|
|
2467
2519
|
let n;
|
|
2468
2520
|
try {
|
|
2469
2521
|
n = await e.json();
|
|
@@ -2476,15 +2528,15 @@ async function Vi(e, t) {
|
|
|
2476
2528
|
...typeof n.expiresAt == "string" && n.expiresAt.length > 0 ? { expiresAt: n.expiresAt } : {}
|
|
2477
2529
|
};
|
|
2478
2530
|
}
|
|
2479
|
-
async function
|
|
2480
|
-
let r =
|
|
2531
|
+
async function Gi(e, t, n) {
|
|
2532
|
+
let r = we(), i = n === "guest" ? "anonymous" : n, a = {
|
|
2481
2533
|
method: "POST",
|
|
2482
2534
|
headers: { "Content-Type": "application/json" },
|
|
2483
2535
|
body: JSON.stringify({
|
|
2484
2536
|
deviceId: r,
|
|
2485
2537
|
space: e,
|
|
2486
2538
|
...i ? { method: i } : {},
|
|
2487
|
-
testLink:
|
|
2539
|
+
testLink: De() ?? void 0
|
|
2488
2540
|
})
|
|
2489
2541
|
}, o = typeof window < "u" ? window.location.origin : "?";
|
|
2490
2542
|
X.debug(`Anonymous auth: POST ${t}/anonymous (space=${e}, origin=${o})`);
|
|
@@ -2493,14 +2545,14 @@ async function Hi(e, t, n) {
|
|
|
2493
2545
|
let e = await s.text().catch(() => "Unknown error");
|
|
2494
2546
|
throw X.error(`Anonymous auth HTTP ${s.status} from ${s.url}: ${e}`), Error(`Anonymous auth failed: ${s.status} ${e}`);
|
|
2495
2547
|
}
|
|
2496
|
-
let { token: c } = await
|
|
2548
|
+
let { token: c } = await Wi(s, `Anonymous auth for space ${e}`), l = {
|
|
2497
2549
|
token: c,
|
|
2498
2550
|
provider: "anonymous",
|
|
2499
2551
|
authenticatedAt: Date.now()
|
|
2500
2552
|
};
|
|
2501
2553
|
return J(l), l;
|
|
2502
2554
|
}
|
|
2503
|
-
async function
|
|
2555
|
+
async function Ki({ email: e, spaceId: t, authUrl: n }) {
|
|
2504
2556
|
let r = await Z(n, "/email/send", {
|
|
2505
2557
|
method: "POST",
|
|
2506
2558
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2508,14 +2560,14 @@ async function Ui({ email: e, spaceId: t, authUrl: n }) {
|
|
|
2508
2560
|
email: e.trim(),
|
|
2509
2561
|
space: t
|
|
2510
2562
|
}),
|
|
2511
|
-
signal:
|
|
2563
|
+
signal: O(zi)
|
|
2512
2564
|
});
|
|
2513
2565
|
if (!r.ok) {
|
|
2514
2566
|
let e = await r.text().catch(() => "Failed to send login code");
|
|
2515
2567
|
throw Error(e);
|
|
2516
2568
|
}
|
|
2517
2569
|
}
|
|
2518
|
-
async function
|
|
2570
|
+
async function qi({ email: e, code: t, authUrl: n }) {
|
|
2519
2571
|
let r = await Z(n, "/email/code", {
|
|
2520
2572
|
method: "POST",
|
|
2521
2573
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2523,37 +2575,37 @@ async function Wi({ email: e, code: t, authUrl: n }) {
|
|
|
2523
2575
|
email: e.trim(),
|
|
2524
2576
|
code: t.trim()
|
|
2525
2577
|
}),
|
|
2526
|
-
signal:
|
|
2578
|
+
signal: O(zi)
|
|
2527
2579
|
});
|
|
2528
2580
|
if (!r.ok) {
|
|
2529
2581
|
let e = await r.text().catch(() => "Invalid code");
|
|
2530
2582
|
throw Error(e);
|
|
2531
2583
|
}
|
|
2532
|
-
let { token: i } = await
|
|
2584
|
+
let { token: i } = await Wi(r, "Login-code verification"), a = {
|
|
2533
2585
|
token: i,
|
|
2534
2586
|
provider: "email",
|
|
2535
2587
|
authenticatedAt: Date.now()
|
|
2536
2588
|
};
|
|
2537
2589
|
return J(a), a;
|
|
2538
2590
|
}
|
|
2539
|
-
function
|
|
2540
|
-
let e = new URLSearchParams(window.location.search), t = e.get(
|
|
2591
|
+
function Ji() {
|
|
2592
|
+
let e = new URLSearchParams(window.location.search), t = e.get(E), n = e.get(T);
|
|
2541
2593
|
return t && n ? {
|
|
2542
2594
|
token: t,
|
|
2543
2595
|
provider: n
|
|
2544
2596
|
} : null;
|
|
2545
2597
|
}
|
|
2546
|
-
function
|
|
2547
|
-
let e = new URLSearchParams(window.location.search), t = e.get(
|
|
2598
|
+
function Yi() {
|
|
2599
|
+
let e = new URLSearchParams(window.location.search), t = e.get(C), n = e.get(T);
|
|
2548
2600
|
return t && n ? {
|
|
2549
2601
|
code: t,
|
|
2550
2602
|
provider: n
|
|
2551
2603
|
} : null;
|
|
2552
2604
|
}
|
|
2553
|
-
async function
|
|
2554
|
-
let r =
|
|
2605
|
+
async function Xi(e, t, n) {
|
|
2606
|
+
let r = Ke();
|
|
2555
2607
|
if (!r) throw Error("This sign-in was started in a different browser or tab");
|
|
2556
|
-
let i = await Z(await
|
|
2608
|
+
let i = await Z(await A(n), "/oauth/exchange", {
|
|
2557
2609
|
method: "POST",
|
|
2558
2610
|
headers: { "Content-Type": "application/json" },
|
|
2559
2611
|
body: JSON.stringify({
|
|
@@ -2561,29 +2613,29 @@ async function qi(e, t, n) {
|
|
|
2561
2613
|
codeVerifier: r,
|
|
2562
2614
|
supportsRefresh: !0
|
|
2563
2615
|
}),
|
|
2564
|
-
signal:
|
|
2616
|
+
signal: O(zi)
|
|
2565
2617
|
});
|
|
2566
2618
|
if (!i.ok) throw Error("Could not complete the sign-in");
|
|
2567
|
-
let { token: a, expiresAt: o } = await
|
|
2619
|
+
let { token: a, expiresAt: o } = await Wi(i, `OAuth code exchange for ${t}`), s = {
|
|
2568
2620
|
token: a,
|
|
2569
2621
|
provider: t,
|
|
2570
2622
|
authenticatedAt: Date.now(),
|
|
2571
2623
|
expiresAt: o
|
|
2572
2624
|
};
|
|
2573
|
-
return o ?
|
|
2625
|
+
return o ? Ai({
|
|
2574
2626
|
provider: t,
|
|
2575
2627
|
authenticatedAt: s.authenticatedAt,
|
|
2576
2628
|
renewedAt: s.authenticatedAt
|
|
2577
2629
|
}) : J(s), s;
|
|
2578
2630
|
}
|
|
2579
|
-
async function
|
|
2580
|
-
let t =
|
|
2631
|
+
async function Zi(e) {
|
|
2632
|
+
let t = Te();
|
|
2581
2633
|
if (t === null) return null;
|
|
2582
2634
|
let n;
|
|
2583
2635
|
try {
|
|
2584
2636
|
n = await fetch(`${t}/session/refresh`, {
|
|
2585
2637
|
method: "POST",
|
|
2586
|
-
signal:
|
|
2638
|
+
signal: O(Bi)
|
|
2587
2639
|
});
|
|
2588
2640
|
} catch (e) {
|
|
2589
2641
|
let n = e instanceof Error ? `${e.name}: ${e.message}` : String(e);
|
|
@@ -2591,7 +2643,7 @@ async function Ji(e) {
|
|
|
2591
2643
|
}
|
|
2592
2644
|
if (n.status === 401) return null;
|
|
2593
2645
|
if (!n.ok) throw Error(`Session renewal failed: ${n.status}`);
|
|
2594
|
-
let { token: r, expiresAt: i } = await
|
|
2646
|
+
let { token: r, expiresAt: i } = await Wi(n, "Session renewal");
|
|
2595
2647
|
if (!i) throw Error("Session renewal returned a token with no expiry");
|
|
2596
2648
|
return {
|
|
2597
2649
|
token: r,
|
|
@@ -2600,17 +2652,17 @@ async function Ji(e) {
|
|
|
2600
2652
|
expiresAt: i
|
|
2601
2653
|
};
|
|
2602
2654
|
}
|
|
2603
|
-
function
|
|
2655
|
+
function Qi() {
|
|
2604
2656
|
let e = new URLSearchParams(window.location.search), t = e.get("error");
|
|
2605
2657
|
return t ? {
|
|
2606
2658
|
code: t,
|
|
2607
|
-
provider: e.get(
|
|
2659
|
+
provider: e.get(T)
|
|
2608
2660
|
} : null;
|
|
2609
2661
|
}
|
|
2610
|
-
function
|
|
2611
|
-
return
|
|
2662
|
+
function $i() {
|
|
2663
|
+
return Ee();
|
|
2612
2664
|
}
|
|
2613
|
-
var
|
|
2665
|
+
var ea = {
|
|
2614
2666
|
google: "Google",
|
|
2615
2667
|
facebook: "Facebook",
|
|
2616
2668
|
apple: "Apple",
|
|
@@ -2618,8 +2670,8 @@ var Zi = {
|
|
|
2618
2670
|
signicat: "eID",
|
|
2619
2671
|
sso: "organisation"
|
|
2620
2672
|
};
|
|
2621
|
-
function
|
|
2622
|
-
let r = t ?
|
|
2673
|
+
function ta(e, t, n) {
|
|
2674
|
+
let r = t ? ea[t] ?? t : "this provider";
|
|
2623
2675
|
switch (e) {
|
|
2624
2676
|
case "account_exists_unverified_email": {
|
|
2625
2677
|
let e = `This email address already has an account on this app that uses a different sign-in method. For security, ${r} sign-in can't be connected to it automatically.`;
|
|
@@ -2640,21 +2692,21 @@ function Qi(e, t, n) {
|
|
|
2640
2692
|
default: return e;
|
|
2641
2693
|
}
|
|
2642
2694
|
}
|
|
2643
|
-
function
|
|
2695
|
+
function na() {
|
|
2644
2696
|
let e = new URLSearchParams(window.location.search);
|
|
2645
2697
|
for (let t of [
|
|
2646
|
-
|
|
2647
|
-
te,
|
|
2698
|
+
E,
|
|
2648
2699
|
C,
|
|
2700
|
+
T,
|
|
2649
2701
|
"error",
|
|
2650
|
-
|
|
2702
|
+
w
|
|
2651
2703
|
]) e.delete(t);
|
|
2652
2704
|
let t = e.toString();
|
|
2653
2705
|
window.history.replaceState({}, "", t.length > 0 ? `${window.location.pathname}?${t}` : window.location.pathname);
|
|
2654
2706
|
}
|
|
2655
|
-
async function
|
|
2656
|
-
let i = r ?? window.location.origin + window.location.pathname + window.location.search, a = await
|
|
2657
|
-
return
|
|
2707
|
+
async function ra(e, t, n, r) {
|
|
2708
|
+
let i = r ?? window.location.origin + window.location.pathname + window.location.search, a = await he();
|
|
2709
|
+
return le({
|
|
2658
2710
|
authUrl: n,
|
|
2659
2711
|
provider: e,
|
|
2660
2712
|
spaceId: t,
|
|
@@ -2662,20 +2714,20 @@ async function ea(e, t, n, r) {
|
|
|
2662
2714
|
codeChallenge: a ?? void 0
|
|
2663
2715
|
});
|
|
2664
2716
|
}
|
|
2665
|
-
async function
|
|
2666
|
-
let i = await
|
|
2717
|
+
async function ia(e, t, n, r = {}) {
|
|
2718
|
+
let i = await he();
|
|
2667
2719
|
if (!i) return null;
|
|
2668
|
-
let a = r.returnUrl ?? window.location.origin + window.location.pathname + window.location.search, o = r.linkSessionToken ? await
|
|
2669
|
-
return
|
|
2720
|
+
let a = r.returnUrl ?? window.location.origin + window.location.pathname + window.location.search, o = r.linkSessionToken ? await sa(n, r.linkSessionToken, e, i) : void 0;
|
|
2721
|
+
return le({
|
|
2670
2722
|
authUrl: n,
|
|
2671
|
-
provider: `${
|
|
2723
|
+
provider: `${D}${e}`,
|
|
2672
2724
|
spaceId: t,
|
|
2673
2725
|
returnUrl: a,
|
|
2674
2726
|
codeChallenge: i,
|
|
2675
2727
|
linkTicket: o
|
|
2676
2728
|
});
|
|
2677
2729
|
}
|
|
2678
|
-
async function
|
|
2730
|
+
async function aa(e, t) {
|
|
2679
2731
|
try {
|
|
2680
2732
|
let n = await Z(e, `/sso/connections?host=${encodeURIComponent(t)}`, { method: "GET" });
|
|
2681
2733
|
return n.ok ? await n.json() : [];
|
|
@@ -2683,7 +2735,7 @@ async function na(e, t) {
|
|
|
2683
2735
|
return X.warn(`Could not look up the SSO connections of ${t}: ${e instanceof Error ? e.message : String(e)}`), [];
|
|
2684
2736
|
}
|
|
2685
2737
|
}
|
|
2686
|
-
async function
|
|
2738
|
+
async function oa(e, t, n) {
|
|
2687
2739
|
let r = await Z(e, "/sso/discover", {
|
|
2688
2740
|
method: "POST",
|
|
2689
2741
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2695,7 +2747,7 @@ async function ra(e, t, n) {
|
|
|
2695
2747
|
if (!r.ok) throw Error(r.status === 429 ? "Too many attempts. Please wait a minute and try again." : "Could not look up your organisation sign-in.");
|
|
2696
2748
|
return (await r.json()).connection ?? null;
|
|
2697
2749
|
}
|
|
2698
|
-
async function
|
|
2750
|
+
async function sa(e, t, n, r) {
|
|
2699
2751
|
try {
|
|
2700
2752
|
let i = await Z(e, "/oauth/sso/link-intent", {
|
|
2701
2753
|
method: "POST",
|
|
@@ -2714,7 +2766,7 @@ async function ia(e, t, n, r) {
|
|
|
2714
2766
|
return;
|
|
2715
2767
|
}
|
|
2716
2768
|
}
|
|
2717
|
-
async function
|
|
2769
|
+
async function ca(e) {
|
|
2718
2770
|
let t = await Z(e, "/passkey/registration/options", {
|
|
2719
2771
|
method: "POST",
|
|
2720
2772
|
headers: { "Content-Type": "application/json" }
|
|
@@ -2725,7 +2777,7 @@ async function aa(e) {
|
|
|
2725
2777
|
}
|
|
2726
2778
|
return t.json();
|
|
2727
2779
|
}
|
|
2728
|
-
async function
|
|
2780
|
+
async function la(e, t, n) {
|
|
2729
2781
|
let r = await Z(e, "/passkey/registration/verify", {
|
|
2730
2782
|
method: "POST",
|
|
2731
2783
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2738,14 +2790,14 @@ async function oa(e, t, n) {
|
|
|
2738
2790
|
let e = await r.text().catch(() => "Registration verification failed");
|
|
2739
2791
|
throw Error(e);
|
|
2740
2792
|
}
|
|
2741
|
-
let { token: i } = await
|
|
2793
|
+
let { token: i } = await Wi(r, "Passkey registration verification"), a = {
|
|
2742
2794
|
token: i,
|
|
2743
2795
|
provider: "passkey",
|
|
2744
2796
|
authenticatedAt: Date.now()
|
|
2745
2797
|
};
|
|
2746
2798
|
return J(a), a;
|
|
2747
2799
|
}
|
|
2748
|
-
async function
|
|
2800
|
+
async function ua(e, t) {
|
|
2749
2801
|
let n = await Z(e, "/passkey/authentication/options", {
|
|
2750
2802
|
method: "POST",
|
|
2751
2803
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2757,7 +2809,7 @@ async function sa(e, t) {
|
|
|
2757
2809
|
}
|
|
2758
2810
|
return n.json();
|
|
2759
2811
|
}
|
|
2760
|
-
async function
|
|
2812
|
+
async function da(e, t) {
|
|
2761
2813
|
let n = await Z(e, "/passkey/authentication/verify", {
|
|
2762
2814
|
method: "POST",
|
|
2763
2815
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2767,19 +2819,19 @@ async function ca(e, t) {
|
|
|
2767
2819
|
let e = await n.text().catch(() => "Authentication verification failed");
|
|
2768
2820
|
throw Error(e);
|
|
2769
2821
|
}
|
|
2770
|
-
let { token: r } = await
|
|
2822
|
+
let { token: r } = await Wi(n, "Passkey authentication verification"), i = {
|
|
2771
2823
|
token: r,
|
|
2772
2824
|
provider: "passkey",
|
|
2773
2825
|
authenticatedAt: Date.now()
|
|
2774
2826
|
};
|
|
2775
2827
|
return J(i), i;
|
|
2776
2828
|
}
|
|
2777
|
-
async function
|
|
2829
|
+
async function fa(e, t) {
|
|
2778
2830
|
try {
|
|
2779
|
-
await Z(await
|
|
2831
|
+
await Z(await A(t), "/logout", {
|
|
2780
2832
|
method: "POST",
|
|
2781
2833
|
headers: { Authorization: `Bearer ${e}` },
|
|
2782
|
-
signal:
|
|
2834
|
+
signal: O(zi)
|
|
2783
2835
|
});
|
|
2784
2836
|
} catch {}
|
|
2785
2837
|
}
|
|
@@ -2792,31 +2844,31 @@ function Q(e) {
|
|
|
2792
2844
|
}
|
|
2793
2845
|
//#endregion
|
|
2794
2846
|
//#region ../../node_modules/@simplewebauthn/browser/esm/helpers/base64URLStringToBuffer.js
|
|
2795
|
-
function
|
|
2847
|
+
function pa(e) {
|
|
2796
2848
|
let t = e.replace(/-/g, "+").replace(/_/g, "/"), n = (4 - t.length % 4) % 4, r = t.padEnd(t.length + n, "="), i = atob(r), a = new ArrayBuffer(i.length), o = new Uint8Array(a);
|
|
2797
2849
|
for (let e = 0; e < i.length; e++) o[e] = i.charCodeAt(e);
|
|
2798
2850
|
return a;
|
|
2799
2851
|
}
|
|
2800
2852
|
//#endregion
|
|
2801
2853
|
//#region ../../node_modules/@simplewebauthn/browser/esm/helpers/browserSupportsWebAuthn.js
|
|
2802
|
-
function
|
|
2803
|
-
return
|
|
2854
|
+
function ma() {
|
|
2855
|
+
return ha.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
|
|
2804
2856
|
}
|
|
2805
|
-
var
|
|
2857
|
+
var ha = { stubThis: (e) => e };
|
|
2806
2858
|
//#endregion
|
|
2807
2859
|
//#region ../../node_modules/@simplewebauthn/browser/esm/helpers/toPublicKeyCredentialDescriptor.js
|
|
2808
|
-
function
|
|
2860
|
+
function ga(e) {
|
|
2809
2861
|
let { id: t } = e;
|
|
2810
2862
|
return {
|
|
2811
2863
|
...e,
|
|
2812
|
-
id:
|
|
2864
|
+
id: pa(t),
|
|
2813
2865
|
transports: e.transports,
|
|
2814
2866
|
type: e.type
|
|
2815
2867
|
};
|
|
2816
2868
|
}
|
|
2817
2869
|
//#endregion
|
|
2818
2870
|
//#region ../../node_modules/@simplewebauthn/browser/esm/helpers/isValidDomain.js
|
|
2819
|
-
function
|
|
2871
|
+
function _a(e) {
|
|
2820
2872
|
return e === "localhost" || /^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(e);
|
|
2821
2873
|
}
|
|
2822
2874
|
//#endregion
|
|
@@ -2833,7 +2885,7 @@ var $ = class extends Error {
|
|
|
2833
2885
|
};
|
|
2834
2886
|
//#endregion
|
|
2835
2887
|
//#region ../../node_modules/@simplewebauthn/browser/esm/helpers/identifyRegistrationError.js
|
|
2836
|
-
function
|
|
2888
|
+
function va({ error: e, options: t }) {
|
|
2837
2889
|
let { publicKey: n } = t;
|
|
2838
2890
|
if (!n) throw Error("options was missing required publicKey property");
|
|
2839
2891
|
if (e.name === "AbortError") {
|
|
@@ -2879,7 +2931,7 @@ function ha({ error: e, options: t }) {
|
|
|
2879
2931
|
});
|
|
2880
2932
|
else if (e.name === "SecurityError") {
|
|
2881
2933
|
let t = globalThis.location.hostname;
|
|
2882
|
-
if (!
|
|
2934
|
+
if (!_a(t)) return new $({
|
|
2883
2935
|
message: `${globalThis.location.hostname} is an invalid domain`,
|
|
2884
2936
|
code: "ERROR_INVALID_DOMAIN",
|
|
2885
2937
|
cause: e
|
|
@@ -2902,7 +2954,7 @@ function ha({ error: e, options: t }) {
|
|
|
2902
2954
|
});
|
|
2903
2955
|
return e;
|
|
2904
2956
|
}
|
|
2905
|
-
var
|
|
2957
|
+
var ya = new class {
|
|
2906
2958
|
constructor() {
|
|
2907
2959
|
Object.defineProperty(this, "controller", {
|
|
2908
2960
|
enumerable: !0,
|
|
@@ -2925,31 +2977,31 @@ var ga = new class {
|
|
|
2925
2977
|
e.name = "AbortError", this.controller.abort(e), this.controller = void 0;
|
|
2926
2978
|
}
|
|
2927
2979
|
}
|
|
2928
|
-
}(),
|
|
2929
|
-
function
|
|
2930
|
-
if (e && !(
|
|
2980
|
+
}(), ba = ["cross-platform", "platform"];
|
|
2981
|
+
function xa(e) {
|
|
2982
|
+
if (e && !(ba.indexOf(e) < 0)) return e;
|
|
2931
2983
|
}
|
|
2932
2984
|
//#endregion
|
|
2933
2985
|
//#region ../../node_modules/@simplewebauthn/browser/esm/methods/startRegistration.js
|
|
2934
|
-
async function
|
|
2986
|
+
async function Sa(e) {
|
|
2935
2987
|
!e.optionsJSON && e.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."), e = { optionsJSON: e });
|
|
2936
2988
|
let { optionsJSON: t, useAutoRegister: n = !1 } = e;
|
|
2937
|
-
if (!
|
|
2989
|
+
if (!ma()) throw Error("WebAuthn is not supported in this browser");
|
|
2938
2990
|
let r = {
|
|
2939
2991
|
...t,
|
|
2940
|
-
challenge:
|
|
2992
|
+
challenge: pa(t.challenge),
|
|
2941
2993
|
user: {
|
|
2942
2994
|
...t.user,
|
|
2943
|
-
id:
|
|
2995
|
+
id: pa(t.user.id)
|
|
2944
2996
|
},
|
|
2945
|
-
excludeCredentials: t.excludeCredentials?.map(
|
|
2997
|
+
excludeCredentials: t.excludeCredentials?.map(ga)
|
|
2946
2998
|
}, i = {};
|
|
2947
|
-
n && (i.mediation = "conditional"), i.publicKey = r, i.signal =
|
|
2999
|
+
n && (i.mediation = "conditional"), i.publicKey = r, i.signal = ya.createNewAbortSignal();
|
|
2948
3000
|
let a;
|
|
2949
3001
|
try {
|
|
2950
3002
|
a = await navigator.credentials.create(i);
|
|
2951
3003
|
} catch (e) {
|
|
2952
|
-
throw
|
|
3004
|
+
throw va({
|
|
2953
3005
|
error: e,
|
|
2954
3006
|
options: i
|
|
2955
3007
|
});
|
|
@@ -2961,20 +3013,20 @@ async function ya(e) {
|
|
|
2961
3013
|
if (typeof c.getPublicKeyAlgorithm == "function") try {
|
|
2962
3014
|
d = c.getPublicKeyAlgorithm();
|
|
2963
3015
|
} catch (e) {
|
|
2964
|
-
|
|
3016
|
+
Ca("getPublicKeyAlgorithm()", e);
|
|
2965
3017
|
}
|
|
2966
3018
|
let f;
|
|
2967
3019
|
if (typeof c.getPublicKey == "function") try {
|
|
2968
3020
|
let e = c.getPublicKey();
|
|
2969
3021
|
e !== null && (f = Q(e));
|
|
2970
3022
|
} catch (e) {
|
|
2971
|
-
|
|
3023
|
+
Ca("getPublicKey()", e);
|
|
2972
3024
|
}
|
|
2973
3025
|
let p;
|
|
2974
3026
|
if (typeof c.getAuthenticatorData == "function") try {
|
|
2975
3027
|
p = Q(c.getAuthenticatorData());
|
|
2976
3028
|
} catch (e) {
|
|
2977
|
-
|
|
3029
|
+
Ca("getAuthenticatorData()", e);
|
|
2978
3030
|
}
|
|
2979
3031
|
return {
|
|
2980
3032
|
id: o,
|
|
@@ -2989,23 +3041,23 @@ async function ya(e) {
|
|
|
2989
3041
|
},
|
|
2990
3042
|
type: l,
|
|
2991
3043
|
clientExtensionResults: a.getClientExtensionResults(),
|
|
2992
|
-
authenticatorAttachment:
|
|
3044
|
+
authenticatorAttachment: xa(a.authenticatorAttachment)
|
|
2993
3045
|
};
|
|
2994
3046
|
}
|
|
2995
|
-
function
|
|
3047
|
+
function Ca(e, t) {
|
|
2996
3048
|
console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.\n`, t);
|
|
2997
3049
|
}
|
|
2998
3050
|
//#endregion
|
|
2999
3051
|
//#region ../../node_modules/@simplewebauthn/browser/esm/helpers/browserSupportsWebAuthnAutofill.js
|
|
3000
|
-
function
|
|
3001
|
-
if (!
|
|
3052
|
+
function wa() {
|
|
3053
|
+
if (!ma()) return Ta.stubThis(new Promise((e) => e(!1)));
|
|
3002
3054
|
let e = globalThis.PublicKeyCredential;
|
|
3003
|
-
return e?.isConditionalMediationAvailable === void 0 ?
|
|
3055
|
+
return e?.isConditionalMediationAvailable === void 0 ? Ta.stubThis(new Promise((e) => e(!1))) : Ta.stubThis(e.isConditionalMediationAvailable());
|
|
3004
3056
|
}
|
|
3005
|
-
var
|
|
3057
|
+
var Ta = { stubThis: (e) => e };
|
|
3006
3058
|
//#endregion
|
|
3007
3059
|
//#region ../../node_modules/@simplewebauthn/browser/esm/helpers/identifyAuthenticationError.js
|
|
3008
|
-
function
|
|
3060
|
+
function Ea({ error: e, options: t }) {
|
|
3009
3061
|
let { publicKey: n } = t;
|
|
3010
3062
|
if (!n) throw Error("options was missing required publicKey property");
|
|
3011
3063
|
if (e.name === "AbortError") {
|
|
@@ -3021,7 +3073,7 @@ function Ca({ error: e, options: t }) {
|
|
|
3021
3073
|
});
|
|
3022
3074
|
else if (e.name === "SecurityError") {
|
|
3023
3075
|
let t = globalThis.location.hostname;
|
|
3024
|
-
if (!
|
|
3076
|
+
if (!_a(t)) return new $({
|
|
3025
3077
|
message: `${globalThis.location.hostname} is an invalid domain`,
|
|
3026
3078
|
code: "ERROR_INVALID_DOMAIN",
|
|
3027
3079
|
cause: e
|
|
@@ -3040,28 +3092,28 @@ function Ca({ error: e, options: t }) {
|
|
|
3040
3092
|
}
|
|
3041
3093
|
//#endregion
|
|
3042
3094
|
//#region ../../node_modules/@simplewebauthn/browser/esm/methods/startAuthentication.js
|
|
3043
|
-
async function
|
|
3095
|
+
async function Da(e) {
|
|
3044
3096
|
!e.optionsJSON && e.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."), e = { optionsJSON: e });
|
|
3045
3097
|
let { optionsJSON: t, useBrowserAutofill: n = !1, verifyBrowserAutofillInput: r = !0 } = e;
|
|
3046
|
-
if (!
|
|
3098
|
+
if (!ma()) throw Error("WebAuthn is not supported in this browser");
|
|
3047
3099
|
let i;
|
|
3048
|
-
t.allowCredentials?.length !== 0 && (i = t.allowCredentials?.map(
|
|
3100
|
+
t.allowCredentials?.length !== 0 && (i = t.allowCredentials?.map(ga));
|
|
3049
3101
|
let a = {
|
|
3050
3102
|
...t,
|
|
3051
|
-
challenge:
|
|
3103
|
+
challenge: pa(t.challenge),
|
|
3052
3104
|
allowCredentials: i
|
|
3053
3105
|
}, o = {};
|
|
3054
3106
|
if (n) {
|
|
3055
|
-
if (!await
|
|
3107
|
+
if (!await wa()) throw Error("Browser does not support WebAuthn autofill");
|
|
3056
3108
|
if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 && r) throw Error("No <input> with \"webauthn\" as the only or last value in its `autocomplete` attribute was detected");
|
|
3057
3109
|
o.mediation = "conditional", a.allowCredentials = [];
|
|
3058
3110
|
}
|
|
3059
|
-
o.publicKey = a, o.signal =
|
|
3111
|
+
o.publicKey = a, o.signal = ya.createNewAbortSignal();
|
|
3060
3112
|
let s;
|
|
3061
3113
|
try {
|
|
3062
3114
|
s = await navigator.credentials.get(o);
|
|
3063
3115
|
} catch (e) {
|
|
3064
|
-
throw
|
|
3116
|
+
throw Ea({
|
|
3065
3117
|
error: e,
|
|
3066
3118
|
options: o
|
|
3067
3119
|
});
|
|
@@ -3079,38 +3131,38 @@ async function wa(e) {
|
|
|
3079
3131
|
},
|
|
3080
3132
|
type: d,
|
|
3081
3133
|
clientExtensionResults: s.getClientExtensionResults(),
|
|
3082
|
-
authenticatorAttachment:
|
|
3134
|
+
authenticatorAttachment: xa(s.authenticatorAttachment)
|
|
3083
3135
|
};
|
|
3084
3136
|
}
|
|
3085
3137
|
//#endregion
|
|
3086
3138
|
//#region src/auth/auth-context.tsx
|
|
3087
|
-
var
|
|
3088
|
-
async function
|
|
3139
|
+
var Oa = "/dev-login-token", ka = "X-Ikon-Dev-Login-Run";
|
|
3140
|
+
async function Aa(e) {
|
|
3089
3141
|
let t = typeof window < "u" ? window.__IKON_LOCAL_IKON_SERVER_CONFIG__ : void 0;
|
|
3090
|
-
if (
|
|
3091
|
-
let n = await fetch(`https://${t.host}:${t.port}${
|
|
3142
|
+
if (t?.enabled && t.host && t.port) try {
|
|
3143
|
+
let n = await fetch(`https://${t.host}:${t.port}${Oa}`, {
|
|
3092
3144
|
cache: "no-store",
|
|
3093
|
-
headers: { [
|
|
3145
|
+
headers: { [ka]: e }
|
|
3094
3146
|
});
|
|
3095
3147
|
return n.ok && (await n.json()).token || void 0;
|
|
3096
3148
|
} catch {
|
|
3097
3149
|
return;
|
|
3098
3150
|
}
|
|
3099
3151
|
}
|
|
3100
|
-
var
|
|
3101
|
-
function
|
|
3102
|
-
let [n, r] =
|
|
3152
|
+
var ja = Ye(null), Ma = 12e4, Na = 6e4;
|
|
3153
|
+
function Pa({ children: e, config: t }) {
|
|
3154
|
+
let [n, r] = L({
|
|
3103
3155
|
isAuthenticated: !1,
|
|
3104
3156
|
isLoading: !0,
|
|
3105
3157
|
user: null,
|
|
3106
3158
|
error: null
|
|
3107
|
-
}), i = t.methods.includes("email"), a =
|
|
3159
|
+
}), i = t.methods.includes("email"), a = De() !== null, o = !t.requireSignIn || t.methods.includes("guest") || t.methods.includes("global") || a, c = I(!1), l = I(!1), u = N(async (e) => {
|
|
3108
3160
|
if (!l.current) {
|
|
3109
3161
|
l.current = !0;
|
|
3110
3162
|
try {
|
|
3111
|
-
let t = await
|
|
3163
|
+
let t = await Zi(e);
|
|
3112
3164
|
if (t === null) {
|
|
3113
|
-
|
|
3165
|
+
Ni(), r({
|
|
3114
3166
|
isAuthenticated: !1,
|
|
3115
3167
|
isLoading: !1,
|
|
3116
3168
|
user: null,
|
|
@@ -3118,7 +3170,7 @@ function ja({ children: e, config: t }) {
|
|
|
3118
3170
|
});
|
|
3119
3171
|
return;
|
|
3120
3172
|
}
|
|
3121
|
-
|
|
3173
|
+
Mi(), r({
|
|
3122
3174
|
isAuthenticated: !0,
|
|
3123
3175
|
isLoading: !1,
|
|
3124
3176
|
user: Y(t),
|
|
@@ -3129,27 +3181,27 @@ function ja({ children: e, config: t }) {
|
|
|
3129
3181
|
}
|
|
3130
3182
|
}
|
|
3131
3183
|
}, []);
|
|
3132
|
-
|
|
3184
|
+
P(() => {
|
|
3133
3185
|
(() => {
|
|
3134
3186
|
if (c.current) return;
|
|
3135
|
-
let e = t.devLoginRunId, n = !!e &&
|
|
3136
|
-
e &&
|
|
3137
|
-
let s = !!t.devLoginToken && !!e && !n &&
|
|
3138
|
-
o ||
|
|
3139
|
-
let l =
|
|
3187
|
+
let e = t.devLoginRunId, n = !!e && Ri() === e && !ki();
|
|
3188
|
+
e && !$i() && Li(e);
|
|
3189
|
+
let s = !!t.devLoginToken && !!e && !n && !$i();
|
|
3190
|
+
o || Pi();
|
|
3191
|
+
let l = Qi();
|
|
3140
3192
|
if (l) {
|
|
3141
|
-
|
|
3193
|
+
na(), r({
|
|
3142
3194
|
isAuthenticated: !1,
|
|
3143
3195
|
isLoading: !1,
|
|
3144
3196
|
user: null,
|
|
3145
|
-
error:
|
|
3197
|
+
error: ta(l.code, l.provider, { emailSignInAvailable: i })
|
|
3146
3198
|
});
|
|
3147
3199
|
return;
|
|
3148
3200
|
}
|
|
3149
|
-
|
|
3150
|
-
let u =
|
|
3201
|
+
ce();
|
|
3202
|
+
let u = Yi();
|
|
3151
3203
|
if (u) {
|
|
3152
|
-
c.current = !0,
|
|
3204
|
+
c.current = !0, na(), Xi(u.code, u.provider, t.authUrl).then((e) => {
|
|
3153
3205
|
r({
|
|
3154
3206
|
isAuthenticated: !0,
|
|
3155
3207
|
isLoading: !1,
|
|
@@ -3166,14 +3218,14 @@ function ja({ children: e, config: t }) {
|
|
|
3166
3218
|
});
|
|
3167
3219
|
return;
|
|
3168
3220
|
}
|
|
3169
|
-
let d =
|
|
3221
|
+
let d = Ji();
|
|
3170
3222
|
if (d) {
|
|
3171
3223
|
let e = {
|
|
3172
3224
|
token: d.token,
|
|
3173
3225
|
provider: d.provider,
|
|
3174
3226
|
authenticatedAt: Date.now()
|
|
3175
3227
|
};
|
|
3176
|
-
J(e),
|
|
3228
|
+
J(e), na(), r({
|
|
3177
3229
|
isAuthenticated: !0,
|
|
3178
3230
|
isLoading: !1,
|
|
3179
3231
|
user: Y(e),
|
|
@@ -3181,11 +3233,11 @@ function ja({ children: e, config: t }) {
|
|
|
3181
3233
|
});
|
|
3182
3234
|
return;
|
|
3183
3235
|
}
|
|
3184
|
-
let f =
|
|
3236
|
+
let f = ji();
|
|
3185
3237
|
if (f) {
|
|
3186
|
-
c.current = !0,
|
|
3238
|
+
c.current = !0, Zi(f).then((e) => {
|
|
3187
3239
|
if (e === null) {
|
|
3188
|
-
|
|
3240
|
+
Ni(), r({
|
|
3189
3241
|
isAuthenticated: !1,
|
|
3190
3242
|
isLoading: !1,
|
|
3191
3243
|
user: null,
|
|
@@ -3193,7 +3245,7 @@ function ja({ children: e, config: t }) {
|
|
|
3193
3245
|
});
|
|
3194
3246
|
return;
|
|
3195
3247
|
}
|
|
3196
|
-
|
|
3248
|
+
Mi(), r({
|
|
3197
3249
|
isAuthenticated: !0,
|
|
3198
3250
|
isLoading: !1,
|
|
3199
3251
|
user: Y(e),
|
|
@@ -3209,7 +3261,7 @@ function ja({ children: e, config: t }) {
|
|
|
3209
3261
|
});
|
|
3210
3262
|
return;
|
|
3211
3263
|
}
|
|
3212
|
-
let p =
|
|
3264
|
+
let p = Oi();
|
|
3213
3265
|
if (p && !(s && p.provider === "anonymous")) {
|
|
3214
3266
|
r({
|
|
3215
3267
|
isAuthenticated: !0,
|
|
@@ -3225,7 +3277,7 @@ function ja({ children: e, config: t }) {
|
|
|
3225
3277
|
token: e,
|
|
3226
3278
|
provider: "dev",
|
|
3227
3279
|
authenticatedAt: Date.now(),
|
|
3228
|
-
expiresAt:
|
|
3280
|
+
expiresAt: Di(e)
|
|
3229
3281
|
};
|
|
3230
3282
|
J(t), r({
|
|
3231
3283
|
isAuthenticated: !0,
|
|
@@ -3234,12 +3286,12 @@ function ja({ children: e, config: t }) {
|
|
|
3234
3286
|
error: null
|
|
3235
3287
|
});
|
|
3236
3288
|
};
|
|
3237
|
-
if (!
|
|
3289
|
+
if (!Ei(t.devLoginToken)) {
|
|
3238
3290
|
n(t.devLoginToken);
|
|
3239
3291
|
return;
|
|
3240
3292
|
}
|
|
3241
|
-
|
|
3242
|
-
if (e && !
|
|
3293
|
+
Aa(e).then((e) => {
|
|
3294
|
+
if (e && !Ei(e)) {
|
|
3243
3295
|
n(e);
|
|
3244
3296
|
return;
|
|
3245
3297
|
}
|
|
@@ -3254,7 +3306,7 @@ function ja({ children: e, config: t }) {
|
|
|
3254
3306
|
}
|
|
3255
3307
|
if (a && t.spaceId) {
|
|
3256
3308
|
let e = t.spaceId;
|
|
3257
|
-
|
|
3309
|
+
A(t.authUrl).then((t) => Gi(e, t, "guest")).then((e) => r({
|
|
3258
3310
|
isAuthenticated: !0,
|
|
3259
3311
|
isLoading: !1,
|
|
3260
3312
|
user: Y(e),
|
|
@@ -3282,9 +3334,9 @@ function ja({ children: e, config: t }) {
|
|
|
3282
3334
|
i,
|
|
3283
3335
|
o,
|
|
3284
3336
|
a
|
|
3285
|
-
]),
|
|
3286
|
-
if (t.spaceId) return
|
|
3287
|
-
c.current = !0, e.codeVerifier &&
|
|
3337
|
+
]), P(() => {
|
|
3338
|
+
if (t.spaceId) return Pe(t.spaceId, (e) => {
|
|
3339
|
+
c.current = !0, e.codeVerifier && Be(e.codeVerifier), Xi(e.code, e.provider, t.authUrl).then((e) => {
|
|
3288
3340
|
r({
|
|
3289
3341
|
isAuthenticated: !0,
|
|
3290
3342
|
isLoading: !1,
|
|
@@ -3300,12 +3352,12 @@ function ja({ children: e, config: t }) {
|
|
|
3300
3352
|
});
|
|
3301
3353
|
});
|
|
3302
3354
|
});
|
|
3303
|
-
}, [t.spaceId, t.authUrl]),
|
|
3355
|
+
}, [t.spaceId, t.authUrl]), P(() => {
|
|
3304
3356
|
let e = n.user?.expiresAt;
|
|
3305
3357
|
if (!e || n.user?.provider === "dev") return;
|
|
3306
|
-
let t =
|
|
3358
|
+
let t = ji();
|
|
3307
3359
|
if (!t) return;
|
|
3308
|
-
let r = Date.parse(e) -
|
|
3360
|
+
let r = Date.parse(e) - Ma, i = setTimeout(() => void u(t), Math.max(0, r - Date.now())), a = () => {
|
|
3309
3361
|
document.visibilityState === "visible" && Date.now() >= r && u(t);
|
|
3310
3362
|
};
|
|
3311
3363
|
return document.addEventListener("visibilitychange", a), () => {
|
|
@@ -3315,26 +3367,26 @@ function ja({ children: e, config: t }) {
|
|
|
3315
3367
|
n.user?.expiresAt,
|
|
3316
3368
|
n.user?.provider,
|
|
3317
3369
|
u
|
|
3318
|
-
]),
|
|
3370
|
+
]), P(() => {
|
|
3319
3371
|
if (n.user?.provider !== "dev") return;
|
|
3320
3372
|
let e = t.devLoginRunId;
|
|
3321
3373
|
if (!e) return;
|
|
3322
3374
|
let i = n.user.expiresAt;
|
|
3323
3375
|
if (!i) return;
|
|
3324
|
-
let a = n.user.token, o = Date.parse(i) -
|
|
3376
|
+
let a = n.user.token, o = Date.parse(i) - Ma, s, c = !1, l = !1, u = async () => {
|
|
3325
3377
|
if (c || l) return;
|
|
3326
3378
|
l = !0;
|
|
3327
|
-
let t = await
|
|
3379
|
+
let t = await Aa(e);
|
|
3328
3380
|
if (l = !1, c) return;
|
|
3329
|
-
if (!t || t === a ||
|
|
3330
|
-
s = setTimeout(() => void u(),
|
|
3381
|
+
if (!t || t === a || Ei(t)) {
|
|
3382
|
+
s = setTimeout(() => void u(), Na);
|
|
3331
3383
|
return;
|
|
3332
3384
|
}
|
|
3333
3385
|
let n = {
|
|
3334
3386
|
token: t,
|
|
3335
3387
|
provider: "dev",
|
|
3336
3388
|
authenticatedAt: Date.now(),
|
|
3337
|
-
expiresAt:
|
|
3389
|
+
expiresAt: Di(t)
|
|
3338
3390
|
};
|
|
3339
3391
|
J(n), r({
|
|
3340
3392
|
isAuthenticated: !0,
|
|
@@ -3356,7 +3408,7 @@ function ja({ children: e, config: t }) {
|
|
|
3356
3408
|
n.user?.expiresAt,
|
|
3357
3409
|
n.user?.token
|
|
3358
3410
|
]);
|
|
3359
|
-
let d =
|
|
3411
|
+
let d = N(async (e) => {
|
|
3360
3412
|
if (!t.spaceId) {
|
|
3361
3413
|
r((e) => ({
|
|
3362
3414
|
...e,
|
|
@@ -3366,7 +3418,7 @@ function ja({ children: e, config: t }) {
|
|
|
3366
3418
|
}
|
|
3367
3419
|
let n;
|
|
3368
3420
|
try {
|
|
3369
|
-
n = await
|
|
3421
|
+
n = await A(t.authUrl);
|
|
3370
3422
|
} catch (e) {
|
|
3371
3423
|
r((t) => ({
|
|
3372
3424
|
...t,
|
|
@@ -3381,7 +3433,7 @@ function ja({ children: e, config: t }) {
|
|
|
3381
3433
|
isLoading: !0
|
|
3382
3434
|
}));
|
|
3383
3435
|
try {
|
|
3384
|
-
let i = await
|
|
3436
|
+
let i = await Gi(t.spaceId, n, e);
|
|
3385
3437
|
r({
|
|
3386
3438
|
isAuthenticated: !0,
|
|
3387
3439
|
isLoading: !1,
|
|
@@ -3404,7 +3456,7 @@ function ja({ children: e, config: t }) {
|
|
|
3404
3456
|
error: null
|
|
3405
3457
|
}));
|
|
3406
3458
|
try {
|
|
3407
|
-
let e = await
|
|
3459
|
+
let e = await Da({ optionsJSON: await ua(n) }), t = await da(n, e);
|
|
3408
3460
|
r({
|
|
3409
3461
|
isAuthenticated: !0,
|
|
3410
3462
|
isLoading: !1,
|
|
@@ -3421,16 +3473,16 @@ function ja({ children: e, config: t }) {
|
|
|
3421
3473
|
return;
|
|
3422
3474
|
}
|
|
3423
3475
|
if (e === "email") throw Error("login('email') is not supported. Use requestEmailCode()/submitEmailCode() from useAuth() instead.");
|
|
3424
|
-
if (
|
|
3425
|
-
await
|
|
3476
|
+
if (Me()) {
|
|
3477
|
+
await Ue(e, t.spaceId) || r((e) => ({
|
|
3426
3478
|
...e,
|
|
3427
3479
|
isLoading: !1,
|
|
3428
3480
|
error: "The sign-in window did not complete. Allow pop-ups for this site and try again."
|
|
3429
3481
|
}));
|
|
3430
3482
|
return;
|
|
3431
3483
|
}
|
|
3432
|
-
window.location.href = await
|
|
3433
|
-
}, [t.authUrl, t.spaceId]), f =
|
|
3484
|
+
window.location.href = await ra(e, t.spaceId, n);
|
|
3485
|
+
}, [t.authUrl, t.spaceId]), f = N(async (e, n = {}) => {
|
|
3434
3486
|
if (!t.spaceId) {
|
|
3435
3487
|
r((e) => ({
|
|
3436
3488
|
...e,
|
|
@@ -3438,7 +3490,7 @@ function ja({ children: e, config: t }) {
|
|
|
3438
3490
|
}));
|
|
3439
3491
|
return;
|
|
3440
3492
|
}
|
|
3441
|
-
if (
|
|
3493
|
+
if (Me()) {
|
|
3442
3494
|
r((e) => ({
|
|
3443
3495
|
...e,
|
|
3444
3496
|
isLoading: !1,
|
|
@@ -3447,7 +3499,7 @@ function ja({ children: e, config: t }) {
|
|
|
3447
3499
|
return;
|
|
3448
3500
|
}
|
|
3449
3501
|
try {
|
|
3450
|
-
let i = await
|
|
3502
|
+
let i = await A(t.authUrl), a = await ia(e, t.spaceId, i, { linkSessionToken: n.linkSessionToken });
|
|
3451
3503
|
if (!a) {
|
|
3452
3504
|
r((e) => ({
|
|
3453
3505
|
...e,
|
|
@@ -3464,28 +3516,28 @@ function ja({ children: e, config: t }) {
|
|
|
3464
3516
|
error: e instanceof Error ? e.message : "Organisation sign-in failed"
|
|
3465
3517
|
}));
|
|
3466
3518
|
}
|
|
3467
|
-
}, [t.authUrl, t.spaceId]), p =
|
|
3519
|
+
}, [t.authUrl, t.spaceId]), p = N(async (e) => {
|
|
3468
3520
|
if (!t.spaceId) throw r((e) => ({
|
|
3469
3521
|
...e,
|
|
3470
3522
|
error: "Space ID is not configured"
|
|
3471
3523
|
})), Error("Space ID is not configured");
|
|
3472
|
-
let n = await
|
|
3473
|
-
await
|
|
3524
|
+
let n = await A(t.authUrl);
|
|
3525
|
+
await Ki({
|
|
3474
3526
|
email: e,
|
|
3475
3527
|
spaceId: t.spaceId,
|
|
3476
3528
|
authUrl: n
|
|
3477
3529
|
});
|
|
3478
|
-
}, [t.authUrl, t.spaceId]), m =
|
|
3530
|
+
}, [t.authUrl, t.spaceId]), m = N(async (e, n) => {
|
|
3479
3531
|
r((e) => ({
|
|
3480
3532
|
...e,
|
|
3481
3533
|
isLoading: !0,
|
|
3482
3534
|
error: null
|
|
3483
3535
|
}));
|
|
3484
3536
|
try {
|
|
3485
|
-
let i = await
|
|
3537
|
+
let i = await qi({
|
|
3486
3538
|
email: e,
|
|
3487
3539
|
code: n,
|
|
3488
|
-
authUrl: await
|
|
3540
|
+
authUrl: await A(t.authUrl)
|
|
3489
3541
|
});
|
|
3490
3542
|
r({
|
|
3491
3543
|
isAuthenticated: !0,
|
|
@@ -3501,23 +3553,23 @@ function ja({ children: e, config: t }) {
|
|
|
3501
3553
|
error: t
|
|
3502
3554
|
})), e;
|
|
3503
3555
|
}
|
|
3504
|
-
}, [t.authUrl]), h =
|
|
3556
|
+
}, [t.authUrl]), h = N(() => {
|
|
3505
3557
|
let e = n.user?.token;
|
|
3506
|
-
e &&
|
|
3558
|
+
e && fa(e, t.authUrl), Ii(), Ni(), s.clearAll(), r({
|
|
3507
3559
|
isAuthenticated: !1,
|
|
3508
3560
|
isLoading: !1,
|
|
3509
3561
|
user: null,
|
|
3510
3562
|
error: null
|
|
3511
3563
|
});
|
|
3512
|
-
}, [n.user?.token, t.authUrl]), g =
|
|
3513
|
-
let n = await
|
|
3564
|
+
}, [n.user?.token, t.authUrl]), g = N(async (e) => {
|
|
3565
|
+
let n = await A(t.authUrl);
|
|
3514
3566
|
r((e) => ({
|
|
3515
3567
|
...e,
|
|
3516
3568
|
isLoading: !0,
|
|
3517
3569
|
error: null
|
|
3518
3570
|
}));
|
|
3519
3571
|
try {
|
|
3520
|
-
let t = await
|
|
3572
|
+
let t = await la(n, await Sa({ optionsJSON: await ca(n) }), e);
|
|
3521
3573
|
r({
|
|
3522
3574
|
isAuthenticated: !0,
|
|
3523
3575
|
isLoading: !1,
|
|
@@ -3531,7 +3583,7 @@ function ja({ children: e, config: t }) {
|
|
|
3531
3583
|
error: e instanceof Error ? e.message : "Passkey registration failed"
|
|
3532
3584
|
}));
|
|
3533
3585
|
}
|
|
3534
|
-
}, [t.authUrl]), _ =
|
|
3586
|
+
}, [t.authUrl]), _ = N(() => n.user?.token ?? null, [n.user]), v = F(() => ({
|
|
3535
3587
|
state: n,
|
|
3536
3588
|
login: d,
|
|
3537
3589
|
loginWithSso: f,
|
|
@@ -3550,38 +3602,38 @@ function ja({ children: e, config: t }) {
|
|
|
3550
3602
|
p,
|
|
3551
3603
|
m
|
|
3552
3604
|
]);
|
|
3553
|
-
return /* @__PURE__ */
|
|
3605
|
+
return /* @__PURE__ */ R(ja, {
|
|
3554
3606
|
value: v,
|
|
3555
3607
|
children: e
|
|
3556
3608
|
});
|
|
3557
3609
|
}
|
|
3558
|
-
function
|
|
3559
|
-
let e =
|
|
3610
|
+
function Fa() {
|
|
3611
|
+
let e = Qe(ja);
|
|
3560
3612
|
if (!e) throw Error("useAuth must be used within an AuthProvider");
|
|
3561
3613
|
return e;
|
|
3562
3614
|
}
|
|
3563
|
-
function
|
|
3564
|
-
return
|
|
3615
|
+
function Ia() {
|
|
3616
|
+
return Qe(ja);
|
|
3565
3617
|
}
|
|
3566
3618
|
//#endregion
|
|
3567
3619
|
//#region src/auth/oauth-continuation.ts
|
|
3568
|
-
var
|
|
3569
|
-
function
|
|
3620
|
+
var La = "ikon-oauth", Ra = "ikon-oauth-continue", za = "ikon-oauth-continue-attempts", Ba = 5, Va = 6e5;
|
|
3621
|
+
function Ha() {
|
|
3570
3622
|
if (typeof window > "u") return !1;
|
|
3571
|
-
let e = new URL(window.location.href).searchParams.get(
|
|
3572
|
-
return e ? (
|
|
3623
|
+
let e = new URL(window.location.href).searchParams.get(La);
|
|
3624
|
+
return e ? (Xa(e), !0) : Ya() !== null;
|
|
3573
3625
|
}
|
|
3574
|
-
function
|
|
3575
|
-
return
|
|
3626
|
+
function Ua() {
|
|
3627
|
+
return Wa() !== null;
|
|
3576
3628
|
}
|
|
3577
|
-
function
|
|
3578
|
-
return typeof window > "u" ? null : new URL(window.location.href).searchParams.get("ikon-oauth") ??
|
|
3629
|
+
function Wa() {
|
|
3630
|
+
return typeof window > "u" ? null : new URL(window.location.href).searchParams.get("ikon-oauth") ?? Ya();
|
|
3579
3631
|
}
|
|
3580
|
-
var
|
|
3581
|
-
async function
|
|
3582
|
-
let t =
|
|
3632
|
+
var Ga = "You are not allowed to connect an application to this app with this account.";
|
|
3633
|
+
async function Ka(e) {
|
|
3634
|
+
let t = Wa();
|
|
3583
3635
|
if (!t) return { status: "pending" };
|
|
3584
|
-
if (!e) return
|
|
3636
|
+
if (!e) return Ja() < Ba ? (console.warn("[ikon] Waiting for the signed-in session before continuing the authorization that sent you here."), { status: "pending" }) : (Za(), console.warn("[ikon] Gave up continuing the authorization that sent you here: no signed-in session became readable. Start the connection again from the application."), { status: "pending" });
|
|
3585
3637
|
try {
|
|
3586
3638
|
let n = await fetch("/ikon/oauth/continue", {
|
|
3587
3639
|
method: "POST",
|
|
@@ -3592,8 +3644,8 @@ async function Ua(e) {
|
|
|
3592
3644
|
body: JSON.stringify({ continueId: t })
|
|
3593
3645
|
});
|
|
3594
3646
|
if (!n.ok) {
|
|
3595
|
-
if (
|
|
3596
|
-
let e = await
|
|
3647
|
+
if (Za(), n.status === 403) {
|
|
3648
|
+
let e = await qa(n);
|
|
3597
3649
|
return console.warn(`[ikon] The authorization that sent you here was refused: ${e}`), {
|
|
3598
3650
|
status: "refused",
|
|
3599
3651
|
message: e
|
|
@@ -3602,72 +3654,72 @@ async function Ua(e) {
|
|
|
3602
3654
|
return console.warn(`[ikon] Could not continue the authorization that sent you here (${n.status}). Start the connection again from the application.`), { status: "pending" };
|
|
3603
3655
|
}
|
|
3604
3656
|
let { consentUrl: r } = await n.json();
|
|
3605
|
-
return r ? (
|
|
3657
|
+
return r ? (Za(), window.location.href = r, { status: "handed-off" }) : (Za(), console.warn("[ikon] The authorization that sent you here returned no consent step. Start the connection again from the application."), { status: "pending" });
|
|
3606
3658
|
} catch {
|
|
3607
3659
|
return { status: "pending" };
|
|
3608
3660
|
}
|
|
3609
3661
|
}
|
|
3610
|
-
async function
|
|
3662
|
+
async function qa(e) {
|
|
3611
3663
|
try {
|
|
3612
3664
|
let t = await e.json(), n = Array.isArray(t?.message) ? t.message.join(", ") : t?.message;
|
|
3613
|
-
return typeof n == "string" && n.trim().length > 0 ? n :
|
|
3665
|
+
return typeof n == "string" && n.trim().length > 0 ? n : Ga;
|
|
3614
3666
|
} catch {
|
|
3615
|
-
return
|
|
3667
|
+
return Ga;
|
|
3616
3668
|
}
|
|
3617
3669
|
}
|
|
3618
|
-
function
|
|
3670
|
+
function Ja() {
|
|
3619
3671
|
try {
|
|
3620
|
-
let e = Number(sessionStorage.getItem(
|
|
3621
|
-
return sessionStorage.setItem(
|
|
3672
|
+
let e = Number(sessionStorage.getItem(za) ?? "0") + 1;
|
|
3673
|
+
return sessionStorage.setItem(za, String(e)), e;
|
|
3622
3674
|
} catch {
|
|
3623
|
-
return
|
|
3675
|
+
return Ba;
|
|
3624
3676
|
}
|
|
3625
3677
|
}
|
|
3626
|
-
function
|
|
3678
|
+
function Ya() {
|
|
3627
3679
|
try {
|
|
3628
|
-
let e = sessionStorage.getItem(
|
|
3680
|
+
let e = sessionStorage.getItem(Ra);
|
|
3629
3681
|
if (!e) return null;
|
|
3630
3682
|
let { id: t, at: n } = JSON.parse(e);
|
|
3631
|
-
return !t || typeof n != "number" || Date.now() - n >
|
|
3683
|
+
return !t || typeof n != "number" || Date.now() - n > Va ? (Za(), null) : t;
|
|
3632
3684
|
} catch {
|
|
3633
|
-
return
|
|
3685
|
+
return Za(), null;
|
|
3634
3686
|
}
|
|
3635
3687
|
}
|
|
3636
|
-
function
|
|
3688
|
+
function Xa(e) {
|
|
3637
3689
|
try {
|
|
3638
|
-
sessionStorage.setItem(
|
|
3690
|
+
sessionStorage.setItem(Ra, JSON.stringify({
|
|
3639
3691
|
id: e,
|
|
3640
3692
|
at: Date.now()
|
|
3641
3693
|
}));
|
|
3642
3694
|
} catch {}
|
|
3643
3695
|
}
|
|
3644
|
-
function
|
|
3696
|
+
function Za() {
|
|
3645
3697
|
try {
|
|
3646
|
-
sessionStorage.removeItem(
|
|
3698
|
+
sessionStorage.removeItem(Ra), sessionStorage.removeItem(za);
|
|
3647
3699
|
} catch {}
|
|
3648
3700
|
try {
|
|
3649
3701
|
let e = new URL(window.location.href);
|
|
3650
|
-
e.searchParams.has("ikon-oauth") && (e.searchParams.delete(
|
|
3702
|
+
e.searchParams.has("ikon-oauth") && (e.searchParams.delete(La), window.history.replaceState(null, "", e.toString()));
|
|
3651
3703
|
} catch {}
|
|
3652
3704
|
}
|
|
3653
3705
|
//#endregion
|
|
3654
3706
|
//#region src/auth/use-auth-guard.ts
|
|
3655
|
-
function
|
|
3656
|
-
let { config: t, guestUrlParam: n } = e, { state: r, login: i, getToken: a } =
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
}, []),
|
|
3660
|
-
if (
|
|
3661
|
-
if (!
|
|
3662
|
-
c.current ||
|
|
3707
|
+
function Qa(e) {
|
|
3708
|
+
let { config: t, guestUrlParam: n } = e, { state: r, login: i, getToken: a } = Fa(), o = I(!1), s = I(!1), c = I(null), l = tt(We, Ce, Ce), u = l.required;
|
|
3709
|
+
P(() => {
|
|
3710
|
+
Ha() && He("An application is asking to act as you. Sign in to review what it wants.");
|
|
3711
|
+
}, []), P(() => {
|
|
3712
|
+
if (u && r.isAuthenticated && r.user && r.user.provider !== "anonymous") {
|
|
3713
|
+
if (!Ua()) {
|
|
3714
|
+
c.current || pe();
|
|
3663
3715
|
return;
|
|
3664
3716
|
}
|
|
3665
|
-
s.current || (s.current = !0,
|
|
3717
|
+
s.current || (s.current = !0, Ka(a()).then((e) => {
|
|
3666
3718
|
if (e.status === "refused") {
|
|
3667
|
-
c.current = e.message,
|
|
3719
|
+
c.current = e.message, He(e.message);
|
|
3668
3720
|
return;
|
|
3669
3721
|
}
|
|
3670
|
-
(e.status === "handed-off" || !
|
|
3722
|
+
(e.status === "handed-off" || !Ua()) && pe();
|
|
3671
3723
|
}).finally(() => {
|
|
3672
3724
|
s.current = !1;
|
|
3673
3725
|
}));
|
|
@@ -3677,12 +3729,12 @@ function Ya(e) {
|
|
|
3677
3729
|
r.isAuthenticated,
|
|
3678
3730
|
r.user,
|
|
3679
3731
|
a
|
|
3680
|
-
]),
|
|
3732
|
+
]), P(() => {
|
|
3681
3733
|
if (!n || r.isAuthenticated || r.isLoading || o.current) return;
|
|
3682
3734
|
let e = t.methods.includes("global") ? "global" : t.methods.includes("guest") ? "guest" : null;
|
|
3683
3735
|
if (!e) return;
|
|
3684
3736
|
let a = new URLSearchParams(window.location.search), s = a.get(n);
|
|
3685
|
-
if (s === "true" || s === "1" || s === "" ||
|
|
3737
|
+
if (s === "true" || s === "1" || s === "" || $i()) {
|
|
3686
3738
|
a.delete(n);
|
|
3687
3739
|
let t = a.toString(), r = window.location.pathname + (t ? `?${t}` : "");
|
|
3688
3740
|
window.history.replaceState({}, "", r), o.current = !0, i(e);
|
|
@@ -3701,32 +3753,32 @@ function Ya(e) {
|
|
|
3701
3753
|
isAuthenticated: r.isAuthenticated,
|
|
3702
3754
|
error: r.error,
|
|
3703
3755
|
isLoginPrompt: u && !p,
|
|
3704
|
-
dismissLoginPrompt:
|
|
3756
|
+
dismissLoginPrompt: pe,
|
|
3705
3757
|
loginPromptReason: u ? l.reason : null
|
|
3706
3758
|
};
|
|
3707
3759
|
}
|
|
3708
3760
|
//#endregion
|
|
3709
3761
|
//#region src/auth/use-sso-sign-in.ts
|
|
3710
|
-
function
|
|
3711
|
-
let { loginWithSso: t } =
|
|
3712
|
-
|
|
3762
|
+
function $a(e) {
|
|
3763
|
+
let { loginWithSso: t } = Fa(), n = e.methods.includes("sso"), [r, i] = L([]), [a, o] = L(!1), [s, c] = L(null);
|
|
3764
|
+
P(() => {
|
|
3713
3765
|
if (!n || typeof window > "u") return;
|
|
3714
3766
|
let t = !1;
|
|
3715
|
-
return
|
|
3767
|
+
return A(e.authUrl).then((e) => aa(e, window.location.host)).then((e) => {
|
|
3716
3768
|
t || i(e);
|
|
3717
3769
|
}).catch(() => void 0), () => {
|
|
3718
3770
|
t = !0;
|
|
3719
3771
|
};
|
|
3720
3772
|
}, [n, e.authUrl]);
|
|
3721
|
-
let l =
|
|
3773
|
+
let l = N((e) => t(e), [t]);
|
|
3722
3774
|
return {
|
|
3723
3775
|
hostConnections: r,
|
|
3724
3776
|
isDiscovering: a,
|
|
3725
3777
|
discoverError: s,
|
|
3726
|
-
discover:
|
|
3778
|
+
discover: N(async (n) => {
|
|
3727
3779
|
c(null), o(!0);
|
|
3728
3780
|
try {
|
|
3729
|
-
let r = await
|
|
3781
|
+
let r = await oa(await A(e.authUrl), e.spaceId, n.trim());
|
|
3730
3782
|
if (!r) {
|
|
3731
3783
|
c("There is no organisation sign-in for this address. Choose another way to sign in.");
|
|
3732
3784
|
return;
|
|
@@ -3747,17 +3799,17 @@ function Xa(e) {
|
|
|
3747
3799
|
}
|
|
3748
3800
|
//#endregion
|
|
3749
3801
|
//#region src/debug/debug-overlay.tsx
|
|
3750
|
-
var
|
|
3802
|
+
var eo = (() => {
|
|
3751
3803
|
try {
|
|
3752
|
-
return
|
|
3804
|
+
return be();
|
|
3753
3805
|
} catch {
|
|
3754
3806
|
return !1;
|
|
3755
3807
|
}
|
|
3756
|
-
})(),
|
|
3757
|
-
function
|
|
3758
|
-
|
|
3808
|
+
})(), to = Date.now(), no = [], ro = 300;
|
|
3809
|
+
function io(e) {
|
|
3810
|
+
no.push(`[+${((Date.now() - to) / 1e3).toFixed(1)}s] ${e}`), no.length > ro && no.shift();
|
|
3759
3811
|
}
|
|
3760
|
-
function
|
|
3812
|
+
function ao(e) {
|
|
3761
3813
|
if (typeof e == "string") return e;
|
|
3762
3814
|
if (e instanceof Error) return `${e.name}: ${e.message}`;
|
|
3763
3815
|
try {
|
|
@@ -3766,10 +3818,10 @@ function no(e) {
|
|
|
3766
3818
|
return String(e);
|
|
3767
3819
|
}
|
|
3768
3820
|
}
|
|
3769
|
-
var
|
|
3770
|
-
function
|
|
3771
|
-
if (
|
|
3772
|
-
|
|
3821
|
+
var oo = !1;
|
|
3822
|
+
function so() {
|
|
3823
|
+
if (oo || typeof window > "u") return;
|
|
3824
|
+
oo = !0, window.addEventListener("error", (e) => io(`window.error: ${e.message} @ ${e.filename ?? "?"}:${e.lineno ?? "?"}:${e.colno ?? "?"}`)), window.addEventListener("unhandledrejection", (e) => io(`unhandledRejection: ${ao(e.reason)}`));
|
|
3773
3825
|
let e = console;
|
|
3774
3826
|
for (let t of [
|
|
3775
3827
|
"error",
|
|
@@ -3780,17 +3832,17 @@ function io() {
|
|
|
3780
3832
|
let n = e[t]?.bind(console) ?? (() => void 0);
|
|
3781
3833
|
e[t] = (...e) => {
|
|
3782
3834
|
try {
|
|
3783
|
-
|
|
3835
|
+
io(`console.${t}: ${e.map(ao).join(" ")}`);
|
|
3784
3836
|
} catch {}
|
|
3785
3837
|
n(...e);
|
|
3786
3838
|
};
|
|
3787
3839
|
}
|
|
3788
3840
|
try {
|
|
3789
|
-
|
|
3841
|
+
Ge((e) => io(`${e.levelName} [${e.component}] ${e.message}`), { minLevel: te.DEBUG });
|
|
3790
3842
|
} catch {}
|
|
3791
3843
|
}
|
|
3792
|
-
|
|
3793
|
-
function
|
|
3844
|
+
eo && so();
|
|
3845
|
+
function co() {
|
|
3794
3846
|
let e = !1;
|
|
3795
3847
|
try {
|
|
3796
3848
|
let t = URL.createObjectURL(new Blob([""]));
|
|
@@ -3800,11 +3852,11 @@ function ao() {
|
|
|
3800
3852
|
} catch {}
|
|
3801
3853
|
return e;
|
|
3802
3854
|
}
|
|
3803
|
-
function
|
|
3855
|
+
function lo() {
|
|
3804
3856
|
let e = globalThis;
|
|
3805
3857
|
return [
|
|
3806
3858
|
`Worker=${typeof Worker < "u"}`,
|
|
3807
|
-
`moduleWorker=${
|
|
3859
|
+
`moduleWorker=${co()}`,
|
|
3808
3860
|
`WebSocket=${typeof WebSocket < "u"}`,
|
|
3809
3861
|
`WebTransport=${e.WebTransport !== void 0}`,
|
|
3810
3862
|
`RTCPeerConnection=${typeof RTCPeerConnection < "u"}`,
|
|
@@ -3817,17 +3869,17 @@ function oo() {
|
|
|
3817
3869
|
`online=${typeof navigator < "u" ? navigator.onLine : "?"}`
|
|
3818
3870
|
].join(" ");
|
|
3819
3871
|
}
|
|
3820
|
-
function
|
|
3872
|
+
function uo(e) {
|
|
3821
3873
|
return /ERROR|error:|Rejection/.test(e) ? "#f88" : /WARN|warn:/.test(e) ? "#fc6" : "#9d9";
|
|
3822
3874
|
}
|
|
3823
|
-
function
|
|
3824
|
-
let n =
|
|
3825
|
-
return
|
|
3875
|
+
function fo({ state: e = "", forceVisible: t = !1 }) {
|
|
3876
|
+
let n = eo || t, r = e === "connected" || e === "reconnecting", [, i] = et((e) => e + 1, 0), [a, o] = L(!0);
|
|
3877
|
+
return P(() => {
|
|
3826
3878
|
if (!n) return;
|
|
3827
|
-
|
|
3879
|
+
so();
|
|
3828
3880
|
let e = setInterval(i, 1e3);
|
|
3829
3881
|
return () => clearInterval(e);
|
|
3830
|
-
}, [n]), n ? r && a ? /* @__PURE__ */
|
|
3882
|
+
}, [n]), n ? r && a ? /* @__PURE__ */ z("button", {
|
|
3831
3883
|
type: "button",
|
|
3832
3884
|
onClick: () => o(!1),
|
|
3833
3885
|
style: {
|
|
@@ -3844,10 +3896,10 @@ function co({ state: e = "", forceVisible: t = !1 }) {
|
|
|
3844
3896
|
},
|
|
3845
3897
|
children: [
|
|
3846
3898
|
"🐞 debug (",
|
|
3847
|
-
|
|
3899
|
+
no.length,
|
|
3848
3900
|
")"
|
|
3849
3901
|
]
|
|
3850
|
-
}) : /* @__PURE__ */
|
|
3902
|
+
}) : /* @__PURE__ */ z("div", {
|
|
3851
3903
|
style: {
|
|
3852
3904
|
...r ? {
|
|
3853
3905
|
position: "fixed",
|
|
@@ -3868,7 +3920,7 @@ function co({ state: e = "", forceVisible: t = !1 }) {
|
|
|
3868
3920
|
zIndex: 2147483647
|
|
3869
3921
|
},
|
|
3870
3922
|
children: [
|
|
3871
|
-
/* @__PURE__ */
|
|
3923
|
+
/* @__PURE__ */ z("div", {
|
|
3872
3924
|
style: {
|
|
3873
3925
|
color: "#fff",
|
|
3874
3926
|
fontSize: "18px",
|
|
@@ -3878,11 +3930,11 @@ function co({ state: e = "", forceVisible: t = !1 }) {
|
|
|
3878
3930
|
"Ikon debug overlay — state: ",
|
|
3879
3931
|
e || "?",
|
|
3880
3932
|
", +",
|
|
3881
|
-
Math.round((Date.now() -
|
|
3933
|
+
Math.round((Date.now() - to) / 1e3),
|
|
3882
3934
|
"s, ",
|
|
3883
|
-
|
|
3935
|
+
no.length,
|
|
3884
3936
|
" entries",
|
|
3885
|
-
r && /* @__PURE__ */
|
|
3937
|
+
r && /* @__PURE__ */ R("button", {
|
|
3886
3938
|
type: "button",
|
|
3887
3939
|
onClick: () => o(!0),
|
|
3888
3940
|
style: {
|
|
@@ -3898,7 +3950,7 @@ function co({ state: e = "", forceVisible: t = !1 }) {
|
|
|
3898
3950
|
})
|
|
3899
3951
|
]
|
|
3900
3952
|
}),
|
|
3901
|
-
/* @__PURE__ */
|
|
3953
|
+
/* @__PURE__ */ R("div", {
|
|
3902
3954
|
style: {
|
|
3903
3955
|
color: "#9cf",
|
|
3904
3956
|
wordBreak: "break-all",
|
|
@@ -3906,7 +3958,7 @@ function co({ state: e = "", forceVisible: t = !1 }) {
|
|
|
3906
3958
|
},
|
|
3907
3959
|
children: typeof window < "u" ? window.location.href : ""
|
|
3908
3960
|
}),
|
|
3909
|
-
/* @__PURE__ */
|
|
3961
|
+
/* @__PURE__ */ R("div", {
|
|
3910
3962
|
style: {
|
|
3911
3963
|
color: "#ff0",
|
|
3912
3964
|
wordBreak: "break-all",
|
|
@@ -3914,23 +3966,23 @@ function co({ state: e = "", forceVisible: t = !1 }) {
|
|
|
3914
3966
|
},
|
|
3915
3967
|
children: typeof navigator < "u" ? navigator.userAgent : "no navigator"
|
|
3916
3968
|
}),
|
|
3917
|
-
/* @__PURE__ */
|
|
3969
|
+
/* @__PURE__ */ R("div", {
|
|
3918
3970
|
style: {
|
|
3919
3971
|
color: "#8cf",
|
|
3920
3972
|
marginBottom: "4px"
|
|
3921
3973
|
},
|
|
3922
|
-
children:
|
|
3974
|
+
children: lo()
|
|
3923
3975
|
}),
|
|
3924
|
-
/* @__PURE__ */
|
|
3976
|
+
/* @__PURE__ */ R("div", {
|
|
3925
3977
|
style: {
|
|
3926
3978
|
color: "#8cf",
|
|
3927
3979
|
marginBottom: "10px"
|
|
3928
3980
|
},
|
|
3929
3981
|
children: typeof window < "u" ? `viewport=${window.innerWidth}x${window.innerHeight} dpr=${window.devicePixelRatio}` : ""
|
|
3930
3982
|
}),
|
|
3931
|
-
/* @__PURE__ */
|
|
3983
|
+
/* @__PURE__ */ R("div", { children: no.length === 0 ? "(nothing captured yet)" : no.map((e, t) => /* @__PURE__ */ R("div", {
|
|
3932
3984
|
style: {
|
|
3933
|
-
color:
|
|
3985
|
+
color: uo(e),
|
|
3934
3986
|
wordBreak: "break-all"
|
|
3935
3987
|
},
|
|
3936
3988
|
children: e
|
|
@@ -3940,8 +3992,8 @@ function co({ state: e = "", forceVisible: t = !1 }) {
|
|
|
3940
3992
|
}
|
|
3941
3993
|
//#endregion
|
|
3942
3994
|
//#region src/app/connection-state-renderer.tsx
|
|
3943
|
-
function
|
|
3944
|
-
let m =
|
|
3995
|
+
function po({ connectionState: e, error: t, isReady: n, isConnectingSlow: r, stores: i, registry: a, client: o, onAction: s, renderIdle: c, renderConnecting: l, renderConnectingSlow: u, renderConnected: d, renderOffline: f, renderError: p }) {
|
|
3996
|
+
let m = I(!1), h = (() => {
|
|
3945
3997
|
switch (e) {
|
|
3946
3998
|
case "waitingForExternalConnectUrl":
|
|
3947
3999
|
case "connecting": return r ? u() : l();
|
|
@@ -3966,286 +4018,286 @@ function lo({ connectionState: e, error: t, isReady: n, isConnectingSlow: r, sto
|
|
|
3966
4018
|
default: return null;
|
|
3967
4019
|
}
|
|
3968
4020
|
})();
|
|
3969
|
-
return /* @__PURE__ */
|
|
4021
|
+
return /* @__PURE__ */ z(nt, { children: [h, /* @__PURE__ */ R(fo, { state: e })] });
|
|
3970
4022
|
}
|
|
3971
4023
|
//#endregion
|
|
3972
4024
|
//#region src/app/boot-snapshot-variant.ts
|
|
3973
|
-
function
|
|
4025
|
+
function mo(e, t) {
|
|
3974
4026
|
return e === !1 ? !1 : t ? "signed-in" : "guest";
|
|
3975
4027
|
}
|
|
3976
4028
|
//#endregion
|
|
3977
4029
|
//#region src/app/use-ikon-app.ts
|
|
3978
|
-
var
|
|
3979
|
-
function
|
|
4030
|
+
var ho = k("useIkonApp");
|
|
4031
|
+
function go() {
|
|
3980
4032
|
if (typeof window < "u" && window.__IKON_AUTH_CONFIG__) return window.__IKON_AUTH_CONFIG__;
|
|
3981
4033
|
}
|
|
3982
|
-
function
|
|
4034
|
+
function _o() {
|
|
3983
4035
|
if (typeof window < "u" && window.__IKON_LOCAL_IKON_SERVER_CONFIG__) return window.__IKON_LOCAL_IKON_SERVER_CONFIG__;
|
|
3984
4036
|
}
|
|
3985
|
-
function
|
|
4037
|
+
function vo(e, t) {
|
|
3986
4038
|
return {
|
|
3987
4039
|
...e,
|
|
3988
4040
|
...t ?? {}
|
|
3989
4041
|
};
|
|
3990
4042
|
}
|
|
3991
|
-
var
|
|
3992
|
-
function
|
|
4043
|
+
var yo = "ikon-sso-required-redirect:", bo = 3e5;
|
|
4044
|
+
function xo(e, t = Date.now()) {
|
|
3993
4045
|
try {
|
|
3994
|
-
let n = `${
|
|
3995
|
-
return t - Number(window.sessionStorage.getItem(n) ?? 0) <
|
|
4046
|
+
let n = `${yo}${e}`;
|
|
4047
|
+
return t - Number(window.sessionStorage.getItem(n) ?? 0) < bo ? !1 : (window.sessionStorage.setItem(n, String(t)), !0);
|
|
3996
4048
|
} catch {
|
|
3997
4049
|
return !1;
|
|
3998
4050
|
}
|
|
3999
4051
|
}
|
|
4000
|
-
function
|
|
4052
|
+
function So() {
|
|
4001
4053
|
try {
|
|
4002
4054
|
let e = [];
|
|
4003
4055
|
for (let t = 0; t < window.sessionStorage.length; t++) {
|
|
4004
4056
|
let n = window.sessionStorage.key(t);
|
|
4005
|
-
n?.startsWith(
|
|
4057
|
+
n?.startsWith(yo) && e.push(n);
|
|
4006
4058
|
}
|
|
4007
4059
|
for (let t of e) window.sessionStorage.removeItem(t);
|
|
4008
4060
|
} catch {}
|
|
4009
4061
|
}
|
|
4010
|
-
function
|
|
4011
|
-
return e?.token ? `${e.provider}:${
|
|
4062
|
+
function Co(e) {
|
|
4063
|
+
return e?.token ? `${e.provider}:${ve(e.token) ?? e.token}` : null;
|
|
4012
4064
|
}
|
|
4013
|
-
function
|
|
4014
|
-
let { authConfig: t, modules: n, parameters: r, timeouts: i, backgroundAudio: a, disableBrowserFunctions: o, disableSoundFunctions: c, webRtc: l, audio: f, video:
|
|
4015
|
-
|
|
4016
|
-
let [
|
|
4065
|
+
function wo(e) {
|
|
4066
|
+
let { authConfig: t, modules: n, parameters: r, timeouts: i, backgroundAudio: a, disableBrowserFunctions: o, disableSoundFunctions: c, webRtc: l, audio: f, video: y, websocket: b, webtransport: x, httpstream: S, proxy: C, liveSnapshot: w, bootSnapshot: T } = e, E = t === void 0 ? go() ?? null : t, te = _o(), D = Ia(), se = !!D && D.state.isLoading, O = I(null), ce = I(null), le = I(null), ue = I(!1), de = I(!1), fe = I(a), pe = I(o), me = I(c), k = I(i), he = I(l), _e = I(f), ye = I(y), be = I(b), xe = I(x), Se = I(S), Ce = I(C), we = I(w), Te = I(T), Ee = I("local"), De = I(void 0);
|
|
4067
|
+
fe.current = a, pe.current = o, me.current = c, k.current = i, he.current = l, _e.current = f, ye.current = y, be.current = b, xe.current = x, Se.current = S, Ce.current = C, we.current = w, Te.current = T;
|
|
4068
|
+
let [j, Oe] = L("connecting"), [Ae, je] = L(!1), [Ne, Pe] = L(!1), [Ie, Le] = L(null), [ze, Be] = L(null), [Ve, He] = L(null), [Ue, We] = L(!1), [Ge, Ke] = L(!1), [qe, Je] = L(!1), [Ye, Xe] = L(null), [Ze, M] = L(null), [Qe, $e] = L(!1), et = I(!1), [tt, nt] = L(0), [R, z] = L(0), it = F(() => {
|
|
4017
4069
|
try {
|
|
4018
|
-
return
|
|
4070
|
+
return Fe();
|
|
4019
4071
|
} catch {
|
|
4020
4072
|
return { parameters: {} };
|
|
4021
4073
|
}
|
|
4022
|
-
}, []), at = JSON.stringify(r ?? {}), ot =
|
|
4074
|
+
}, []), at = JSON.stringify(r ?? {}), ot = F(() => vo(it.parameters, r), [it.parameters, at]), st = (E?.methods?.length ?? 0) > 0, ct = mo(T, st && Fi());
|
|
4023
4075
|
ct !== !1 && !u() && d(ct);
|
|
4024
|
-
let B =
|
|
4025
|
-
if (!
|
|
4026
|
-
let e =
|
|
4076
|
+
let B = F(() => {
|
|
4077
|
+
if (!E?.spaceId) return null;
|
|
4078
|
+
let e = D?.state.user;
|
|
4027
4079
|
return e ? {
|
|
4028
4080
|
token: e.token,
|
|
4029
4081
|
provider: e.provider,
|
|
4030
4082
|
authenticatedAt: e.authenticatedAt
|
|
4031
|
-
} :
|
|
4083
|
+
} : Oi();
|
|
4032
4084
|
}, [
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
]), V =
|
|
4039
|
-
U && !
|
|
4040
|
-
|
|
4085
|
+
E?.spaceId,
|
|
4086
|
+
tt,
|
|
4087
|
+
D?.state.isLoading,
|
|
4088
|
+
D?.state.isAuthenticated,
|
|
4089
|
+
D?.state.user?.token
|
|
4090
|
+
]), V = te?.enabled ?? !1, H = te?.host ?? g, lt = te?.port ?? _, U = !se && !!E && !B && !E.requireSignIn && !!E.spaceId && (ke() || V);
|
|
4091
|
+
U && !Ze && !Qe && !et.current && (et.current = !0, A(E.authUrl).then((e) => Gi(E.spaceId, e)).then((e) => {
|
|
4092
|
+
M(e.token), $e(!0);
|
|
4041
4093
|
}).catch((e) => {
|
|
4042
|
-
|
|
4094
|
+
ho.error("Anonymous auth failed:", e), et.current = !1, V ? $e(!0) : Be(e instanceof Error ? e.message : "Anonymous auth failed");
|
|
4043
4095
|
}));
|
|
4044
|
-
let ut =
|
|
4096
|
+
let ut = Co(B), W = I(void 0);
|
|
4045
4097
|
W.current = B?.token ?? void 0;
|
|
4046
|
-
let dt =
|
|
4047
|
-
if (
|
|
4098
|
+
let dt = F(() => {
|
|
4099
|
+
if (se) return null;
|
|
4048
4100
|
if (V) {
|
|
4049
|
-
if (U &&
|
|
4050
|
-
let e = W.current ??
|
|
4101
|
+
if (U && !Qe) return null;
|
|
4102
|
+
let e = W.current ?? Ze ?? void 0, t = e ? ve(e) ?? void 0 : void 0;
|
|
4051
4103
|
return { local: {
|
|
4052
4104
|
host: H,
|
|
4053
4105
|
httpsPort: lt,
|
|
4054
4106
|
userId: t,
|
|
4055
4107
|
token: W.current,
|
|
4056
4108
|
identityToken: e,
|
|
4057
|
-
spaceId:
|
|
4058
|
-
backendUrl:
|
|
4059
|
-
authUrl:
|
|
4109
|
+
spaceId: E?.spaceId,
|
|
4110
|
+
backendUrl: E?.backendUrl,
|
|
4111
|
+
authUrl: E?.authUrl,
|
|
4060
4112
|
parameters: ot
|
|
4061
4113
|
} };
|
|
4062
4114
|
}
|
|
4063
|
-
return W.current &&
|
|
4115
|
+
return W.current && E?.spaceId ? { sessionToken: {
|
|
4064
4116
|
token: W.current,
|
|
4065
|
-
spaceId:
|
|
4066
|
-
backendType:
|
|
4067
|
-
sessionIdentityHash:
|
|
4117
|
+
spaceId: E.spaceId,
|
|
4118
|
+
backendType: ge(),
|
|
4119
|
+
sessionIdentityHash: it.sessionIdentityHash,
|
|
4068
4120
|
parameters: ot
|
|
4069
|
-
} } :
|
|
4070
|
-
token:
|
|
4071
|
-
spaceId:
|
|
4072
|
-
backendType:
|
|
4073
|
-
sessionIdentityHash:
|
|
4121
|
+
} } : Ze && E?.spaceId ? { sessionToken: {
|
|
4122
|
+
token: Ze,
|
|
4123
|
+
spaceId: E.spaceId,
|
|
4124
|
+
backendType: ge(),
|
|
4125
|
+
sessionIdentityHash: it.sessionIdentityHash,
|
|
4074
4126
|
parameters: ot
|
|
4075
|
-
} } :
|
|
4127
|
+
} } : ke() ? null : { local: {
|
|
4076
4128
|
host: H,
|
|
4077
4129
|
httpsPort: lt,
|
|
4078
|
-
spaceId:
|
|
4079
|
-
backendUrl:
|
|
4080
|
-
authUrl:
|
|
4130
|
+
spaceId: E?.spaceId,
|
|
4131
|
+
backendUrl: E?.backendUrl,
|
|
4132
|
+
authUrl: E?.authUrl,
|
|
4081
4133
|
parameters: ot
|
|
4082
4134
|
} };
|
|
4083
4135
|
}, [
|
|
4084
|
-
|
|
4136
|
+
se,
|
|
4085
4137
|
V,
|
|
4086
4138
|
H,
|
|
4087
4139
|
lt,
|
|
4088
4140
|
ut,
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4141
|
+
E?.spaceId,
|
|
4142
|
+
E?.backendUrl,
|
|
4143
|
+
E?.authUrl,
|
|
4144
|
+
Ze,
|
|
4093
4145
|
U,
|
|
4094
|
-
|
|
4095
|
-
|
|
4146
|
+
Qe,
|
|
4147
|
+
it.sessionIdentityHash,
|
|
4096
4148
|
ot
|
|
4097
4149
|
]);
|
|
4098
|
-
|
|
4099
|
-
let ft =
|
|
4100
|
-
|
|
4101
|
-
if (!
|
|
4102
|
-
if (
|
|
4103
|
-
|
|
4104
|
-
|
|
4150
|
+
Ee.current = E?.spaceId ?? "local", De.current = B?.token ?? Ze ?? void 0, vr(Ye);
|
|
4151
|
+
let ft = br(Ye);
|
|
4152
|
+
P(() => {
|
|
4153
|
+
if (!ue.current) {
|
|
4154
|
+
if (ue.current = !0, le.current = Pn(), n) for (let e of n) e(le.current);
|
|
4155
|
+
le.current.loadRegisteredModules().catch((e) => {
|
|
4156
|
+
ho.error("Failed to load UI modules", e);
|
|
4105
4157
|
});
|
|
4106
4158
|
}
|
|
4107
|
-
}, []),
|
|
4159
|
+
}, []), P(() => {
|
|
4108
4160
|
if (!dt) return;
|
|
4109
|
-
let e = new
|
|
4161
|
+
let e = new ee({
|
|
4110
4162
|
...dt,
|
|
4111
|
-
timeouts:
|
|
4112
|
-
disableBrowserFunctions:
|
|
4113
|
-
disableSoundFunctions:
|
|
4114
|
-
audio:
|
|
4115
|
-
enabled:
|
|
4116
|
-
...
|
|
4163
|
+
timeouts: k.current,
|
|
4164
|
+
disableBrowserFunctions: pe.current,
|
|
4165
|
+
disableSoundFunctions: me.current,
|
|
4166
|
+
audio: _e.current !== void 0 || fe.current ? {
|
|
4167
|
+
enabled: _e.current,
|
|
4168
|
+
...fe.current ? { background: {
|
|
4117
4169
|
allowOnDesktop: !0,
|
|
4118
4170
|
allowOnMobile: !0
|
|
4119
4171
|
} } : {}
|
|
4120
4172
|
} : void 0,
|
|
4121
|
-
video:
|
|
4173
|
+
video: ye.current === void 0 ? void 0 : { enabled: ye.current },
|
|
4122
4174
|
mediaSession: {
|
|
4123
4175
|
title: document.title || void 0,
|
|
4124
4176
|
artist: document.title || void 0
|
|
4125
4177
|
},
|
|
4126
|
-
webRtc:
|
|
4127
|
-
websocket:
|
|
4128
|
-
webtransport:
|
|
4129
|
-
httpstream:
|
|
4130
|
-
proxy:
|
|
4178
|
+
webRtc: he.current === !1 ? { enabled: !1 } : void 0,
|
|
4179
|
+
websocket: be.current,
|
|
4180
|
+
webtransport: xe.current,
|
|
4181
|
+
httpstream: Se.current,
|
|
4182
|
+
proxy: Ce.current,
|
|
4131
4183
|
onConnectionStateChange: (e) => {
|
|
4132
|
-
|
|
4184
|
+
Oe(e);
|
|
4133
4185
|
},
|
|
4134
4186
|
onError: (e) => {
|
|
4135
|
-
|
|
4187
|
+
Be(e.message);
|
|
4136
4188
|
}
|
|
4137
4189
|
});
|
|
4138
|
-
|
|
4139
|
-
let t =
|
|
4190
|
+
O.current = e;
|
|
4191
|
+
let t = we.current ?? !0, n = De.current, r = n ? ve(n) ?? null : null, i = t && r ? {
|
|
4140
4192
|
enabled: !0,
|
|
4141
|
-
appId:
|
|
4193
|
+
appId: Ee.current,
|
|
4142
4194
|
userId: r
|
|
4143
|
-
} : void 0, a = B != null && B.provider !== "anonymous", o = st && (a ||
|
|
4195
|
+
} : void 0, a = B != null && B.provider !== "anonymous", o = st && (a || Fi()), c = new rt({
|
|
4144
4196
|
client: e,
|
|
4145
4197
|
liveSnapshot: i,
|
|
4146
|
-
bootSnapshot:
|
|
4198
|
+
bootSnapshot: mo(Te.current, o)
|
|
4147
4199
|
});
|
|
4148
|
-
|
|
4149
|
-
let l = e.subscribeToFeedback(
|
|
4150
|
-
|
|
4200
|
+
ce.current = c, Xe(c), Pe(!1), Le(e.feedback);
|
|
4201
|
+
let l = e.subscribeToFeedback(Le), u = c.subscribeToUiUpdates(() => {
|
|
4202
|
+
Pe(!0), Re();
|
|
4151
4203
|
});
|
|
4152
|
-
return e.connect().then(
|
|
4153
|
-
if (
|
|
4154
|
-
let t =
|
|
4155
|
-
|
|
4156
|
-
let i = await
|
|
4204
|
+
return e.connect().then(So, (e) => {
|
|
4205
|
+
if (ho.error("Connection failed:", e), e instanceof oe && E?.spaceId && !Me() && xo(e.connectionId)) {
|
|
4206
|
+
let t = E.spaceId, n = W.current;
|
|
4207
|
+
A(E.authUrl).then(async (r) => {
|
|
4208
|
+
let i = await ia(e.connectionId, t, r, { linkSessionToken: n ?? void 0 });
|
|
4157
4209
|
if (!i) {
|
|
4158
|
-
|
|
4210
|
+
He(e.reason);
|
|
4159
4211
|
return;
|
|
4160
4212
|
}
|
|
4161
4213
|
window.location.href = i;
|
|
4162
|
-
}).catch(() =>
|
|
4214
|
+
}).catch(() => He(e.reason));
|
|
4163
4215
|
return;
|
|
4164
4216
|
}
|
|
4165
4217
|
if (e instanceof p) {
|
|
4166
|
-
|
|
4218
|
+
He(e.reason);
|
|
4167
4219
|
return;
|
|
4168
4220
|
}
|
|
4169
|
-
if (e instanceof
|
|
4170
|
-
|
|
4221
|
+
if (e instanceof re) {
|
|
4222
|
+
We(!0);
|
|
4171
4223
|
return;
|
|
4172
4224
|
}
|
|
4173
|
-
if (e instanceof
|
|
4174
|
-
|
|
4225
|
+
if (e instanceof ae) {
|
|
4226
|
+
Ke(!0);
|
|
4175
4227
|
return;
|
|
4176
4228
|
}
|
|
4177
|
-
if (!(e instanceof
|
|
4229
|
+
if (!(e instanceof ie)) {
|
|
4178
4230
|
if (e instanceof m) {
|
|
4179
|
-
|
|
4231
|
+
Je(!0);
|
|
4180
4232
|
return;
|
|
4181
4233
|
}
|
|
4182
|
-
e instanceof
|
|
4234
|
+
e instanceof ne || e instanceof h && !de.current && (de.current = !0, ho.warn("Auth session appears stale, clearing and retrying"), s.clearAll(), D ? D.logout() : (Ii(), nt((e) => e + 1)));
|
|
4183
4235
|
}
|
|
4184
4236
|
}), () => {
|
|
4185
|
-
u(), l(), e.disconnect(),
|
|
4237
|
+
u(), l(), e.disconnect(), O.current = null, c.dispose(), ce.current = null;
|
|
4186
4238
|
};
|
|
4187
|
-
}, [dt,
|
|
4188
|
-
let e = B?.token, t =
|
|
4189
|
-
if (
|
|
4239
|
+
}, [dt, R]), P(() => {
|
|
4240
|
+
let e = B?.token, t = O.current;
|
|
4241
|
+
if (e && t) {
|
|
4190
4242
|
if (t.connectionState === "offline" && !t.serverStopped) {
|
|
4191
|
-
|
|
4243
|
+
z((e) => e + 1);
|
|
4192
4244
|
return;
|
|
4193
4245
|
}
|
|
4194
4246
|
t.updateAuthToken(e);
|
|
4195
4247
|
}
|
|
4196
4248
|
}, [B?.token]);
|
|
4197
|
-
let pt =
|
|
4249
|
+
let pt = N((e, t, n) => {
|
|
4198
4250
|
let r = typeof t == "string" ? t : JSON.stringify(t ?? {});
|
|
4199
|
-
|
|
4251
|
+
O.current?.sendActionCall(e, r, n);
|
|
4200
4252
|
}, []);
|
|
4201
|
-
|
|
4202
|
-
if (
|
|
4203
|
-
|
|
4253
|
+
P(() => {
|
|
4254
|
+
if (j !== "connecting" && j !== "waitingForExternalConnectUrl") {
|
|
4255
|
+
je(!1);
|
|
4204
4256
|
return;
|
|
4205
4257
|
}
|
|
4206
|
-
let e =
|
|
4258
|
+
let e = O.current?.slowConnectionThresholdMs ?? v, t = setTimeout(() => je(!0), e);
|
|
4207
4259
|
return () => clearTimeout(t);
|
|
4208
|
-
}, [
|
|
4209
|
-
let mt =
|
|
4210
|
-
return
|
|
4211
|
-
typeof document
|
|
4260
|
+
}, [j]);
|
|
4261
|
+
let mt = j === "connected" || j === "reconnecting", ht = Ne && j !== "offline";
|
|
4262
|
+
return P(() => {
|
|
4263
|
+
typeof document < "u" && (document.documentElement.dataset.ikonLive = String(ht));
|
|
4212
4264
|
}, [ht]), {
|
|
4213
|
-
connectionState:
|
|
4214
|
-
error:
|
|
4215
|
-
accessDeniedReason:
|
|
4216
|
-
isServerFull:
|
|
4217
|
-
isSessionExpired:
|
|
4218
|
-
isStartupFailed:
|
|
4265
|
+
connectionState: j,
|
|
4266
|
+
error: ze,
|
|
4267
|
+
accessDeniedReason: Ve,
|
|
4268
|
+
isServerFull: Ue,
|
|
4269
|
+
isSessionExpired: Ge,
|
|
4270
|
+
isStartupFailed: qe,
|
|
4219
4271
|
stores: ft,
|
|
4220
|
-
client:
|
|
4221
|
-
registry:
|
|
4222
|
-
clientRef:
|
|
4223
|
-
uiRef:
|
|
4224
|
-
registryRef:
|
|
4272
|
+
client: O.current,
|
|
4273
|
+
registry: le.current,
|
|
4274
|
+
clientRef: O,
|
|
4275
|
+
uiRef: ce,
|
|
4276
|
+
registryRef: le,
|
|
4225
4277
|
onAction: pt,
|
|
4226
4278
|
isReady: mt,
|
|
4227
4279
|
isLive: ht,
|
|
4228
|
-
brandingRequired:
|
|
4229
|
-
feedback:
|
|
4230
|
-
isConnectingSlow:
|
|
4231
|
-
webRtcVideoStreams:
|
|
4232
|
-
webRtcTrackMap:
|
|
4280
|
+
brandingRequired: O.current?.brandingRequired ?? !1,
|
|
4281
|
+
feedback: Ie,
|
|
4282
|
+
isConnectingSlow: Ae,
|
|
4283
|
+
webRtcVideoStreams: O.current?.webRtcVideoStreams ?? /* @__PURE__ */ new Map(),
|
|
4284
|
+
webRtcTrackMap: O.current?.webRtcTrackMap ?? /* @__PURE__ */ new Map()
|
|
4233
4285
|
};
|
|
4234
4286
|
}
|
|
4235
4287
|
//#endregion
|
|
4236
4288
|
//#region src/hooks/use-toasts.ts
|
|
4237
|
-
var
|
|
4238
|
-
function
|
|
4239
|
-
let [n, r] =
|
|
4289
|
+
var To = 0;
|
|
4290
|
+
function Eo(e = 5, t = 5e3) {
|
|
4291
|
+
let [n, r] = L([]), i = I(/* @__PURE__ */ new Map()), a = N((e) => {
|
|
4240
4292
|
let t = i.current.get(e);
|
|
4241
4293
|
t && (clearTimeout(t), i.current.delete(e)), r((t) => t.filter((t) => t.id !== e));
|
|
4242
4294
|
}, []);
|
|
4243
|
-
return
|
|
4244
|
-
let n = i.current, o =
|
|
4245
|
-
if (!
|
|
4246
|
-
let o = `toast-${++
|
|
4295
|
+
return P(() => {
|
|
4296
|
+
let n = i.current, o = Ge((i) => {
|
|
4297
|
+
if (!je()) return;
|
|
4298
|
+
let o = `toast-${++To}`, s = {
|
|
4247
4299
|
id: o,
|
|
4248
|
-
level: i.level ===
|
|
4300
|
+
level: i.level === te.ERROR ? "error" : "warn",
|
|
4249
4301
|
message: i.message,
|
|
4250
4302
|
component: i.component
|
|
4251
4303
|
};
|
|
@@ -4254,7 +4306,7 @@ function Co(e = 5, t = 5e3) {
|
|
|
4254
4306
|
a(o);
|
|
4255
4307
|
}, t);
|
|
4256
4308
|
n.set(o, c);
|
|
4257
|
-
}, { minLevel:
|
|
4309
|
+
}, { minLevel: te.WARN });
|
|
4258
4310
|
return () => {
|
|
4259
4311
|
o();
|
|
4260
4312
|
for (let e of n.values()) clearTimeout(e);
|
|
@@ -4271,9 +4323,9 @@ function Co(e = 5, t = 5e3) {
|
|
|
4271
4323
|
}
|
|
4272
4324
|
//#endregion
|
|
4273
4325
|
//#region src/hooks/use-ikon-reactive.ts
|
|
4274
|
-
function
|
|
4275
|
-
let [r, i] =
|
|
4276
|
-
return
|
|
4326
|
+
function Do(e, t, n) {
|
|
4327
|
+
let [r, i] = L(n);
|
|
4328
|
+
return P(() => {
|
|
4277
4329
|
if (!e) return;
|
|
4278
4330
|
let n = !0, r = null;
|
|
4279
4331
|
return e.reactiveRegistry.subscribe(t, (e) => {
|
|
@@ -4289,9 +4341,9 @@ function wo(e, t, n) {
|
|
|
4289
4341
|
}
|
|
4290
4342
|
//#endregion
|
|
4291
4343
|
//#region src/hooks/use-reactive.ts
|
|
4292
|
-
function
|
|
4293
|
-
let [r, i] =
|
|
4294
|
-
return
|
|
4344
|
+
function Oo(e, t, n) {
|
|
4345
|
+
let [r, i] = L(null);
|
|
4346
|
+
return P(() => {
|
|
4295
4347
|
if (!e) return;
|
|
4296
4348
|
let n = !0;
|
|
4297
4349
|
return e.call("Ikon.Reactive.GetStableIdByName", [t]).then((e) => {
|
|
@@ -4301,56 +4353,56 @@ function To(e, t, n) {
|
|
|
4301
4353
|
}), () => {
|
|
4302
4354
|
n = !1;
|
|
4303
4355
|
};
|
|
4304
|
-
}, [e, t]),
|
|
4356
|
+
}, [e, t]), Do(r ? e : null, r ?? "", n);
|
|
4305
4357
|
}
|
|
4306
4358
|
//#endregion
|
|
4307
4359
|
//#region src/app/use-ikon-debug.ts
|
|
4308
|
-
var
|
|
4360
|
+
var ko = k("IkonDebug"), Ao = {
|
|
4309
4361
|
Digit1: "connecting",
|
|
4310
4362
|
Digit2: "connected",
|
|
4311
4363
|
Digit3: "reconnecting",
|
|
4312
4364
|
Digit4: "offline",
|
|
4313
4365
|
Digit5: "offline",
|
|
4314
4366
|
Digit0: "clear"
|
|
4315
|
-
},
|
|
4316
|
-
function
|
|
4317
|
-
let t =
|
|
4318
|
-
return
|
|
4367
|
+
}, jo = "Digit5", Mo = "Digit6", No = "Synthetic debug error (Ctrl+Shift+5)", Po = "Synthetic debug access-denied (Ctrl+Shift+6)", Fo = 5e3;
|
|
4368
|
+
function Io(e) {
|
|
4369
|
+
let t = je(), [n, r] = L(null), [i, a] = L(!1), [o, s] = L(null), [c, l] = L(null), [u, d] = L(!1), [f, p] = L(!1), [m, h] = L(!1);
|
|
4370
|
+
return P(() => {
|
|
4319
4371
|
if (!t) return;
|
|
4320
4372
|
let e = (e) => {
|
|
4321
4373
|
if (!e.ctrlKey || !e.shiftKey) return;
|
|
4322
4374
|
if (e.code === "KeyE") {
|
|
4323
|
-
e.preventDefault(), d((e) => (
|
|
4375
|
+
e.preventDefault(), d((e) => (ko.warn(`Empty-stores override: ${e ? "off" : "on"}`), !e));
|
|
4324
4376
|
return;
|
|
4325
4377
|
}
|
|
4326
4378
|
if (e.code === "Digit7") {
|
|
4327
|
-
e.preventDefault(), p((e) => (
|
|
4379
|
+
e.preventDefault(), p((e) => (ko.warn(`Branding-banner override: ${e ? "off" : "on"}`), !e));
|
|
4328
4380
|
return;
|
|
4329
4381
|
}
|
|
4330
4382
|
if (e.code === "Digit8") {
|
|
4331
|
-
e.preventDefault(), h((e) => (
|
|
4383
|
+
e.preventDefault(), h((e) => (ko.warn(`Debug-overlay override: ${e ? "off" : "on"}`), !e));
|
|
4332
4384
|
return;
|
|
4333
4385
|
}
|
|
4334
|
-
if (e.code ===
|
|
4335
|
-
e.preventDefault(), l(
|
|
4386
|
+
if (e.code === Mo) {
|
|
4387
|
+
e.preventDefault(), l(Po), r(null), s(null), ko.warn("Forced access denied");
|
|
4336
4388
|
return;
|
|
4337
4389
|
}
|
|
4338
|
-
let t =
|
|
4390
|
+
let t = Ao[e.code];
|
|
4339
4391
|
if (t === void 0) return;
|
|
4340
4392
|
if (e.preventDefault(), t === "clear") {
|
|
4341
|
-
r(null), s(null), l(null),
|
|
4393
|
+
r(null), s(null), l(null), ko.warn("Cleared forced state");
|
|
4342
4394
|
return;
|
|
4343
4395
|
}
|
|
4344
|
-
let n = e.code ===
|
|
4345
|
-
r(t), s(n ?
|
|
4396
|
+
let n = e.code === jo;
|
|
4397
|
+
r(t), s(n ? No : null), l(null), ko.warn(`Forced state: ${t}${n ? " (with error)" : ""}`);
|
|
4346
4398
|
};
|
|
4347
4399
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
4348
|
-
}, [t]),
|
|
4400
|
+
}, [t]), P(() => {
|
|
4349
4401
|
if (n !== "connecting") {
|
|
4350
4402
|
a(!1);
|
|
4351
4403
|
return;
|
|
4352
4404
|
}
|
|
4353
|
-
let e = setTimeout(() => a(!0),
|
|
4405
|
+
let e = setTimeout(() => a(!0), Fo);
|
|
4354
4406
|
return () => clearTimeout(e);
|
|
4355
4407
|
}, [n]), !t || n === null && !u && c === null && !f && !m ? {
|
|
4356
4408
|
app: e,
|
|
@@ -4381,112 +4433,112 @@ function No(e) {
|
|
|
4381
4433
|
}
|
|
4382
4434
|
//#endregion
|
|
4383
4435
|
//#region src/app/feedback/feedback-controls.tsx
|
|
4384
|
-
var
|
|
4385
|
-
function
|
|
4386
|
-
return import("./feedback-form-
|
|
4387
|
-
}
|
|
4388
|
-
var
|
|
4389
|
-
function
|
|
4390
|
-
let [o, s] =
|
|
4391
|
-
p.current = o !== null,
|
|
4436
|
+
var Lo = k("FeedbackControls"), Ro = null;
|
|
4437
|
+
function zo() {
|
|
4438
|
+
return import("./feedback-form-2zrRPOiE.js").then((e) => Ro = e);
|
|
4439
|
+
}
|
|
4440
|
+
var Bo = 4e3, Vo = 1e4, Ho = 16, Uo = 52, Wo = "ikon-feedback-control", Go = `.${Wo}:focus-visible{outline:2px solid var(--ikon-focus-ring,#f5277f);outline-offset:2px}`;
|
|
4441
|
+
function Ko({ client: e, feedback: t, connectionState: n, isLive: r, sheetOpen: i, brandingShown: a }) {
|
|
4442
|
+
let [o, s] = L(null), [c, l] = L(Ro), u = I(null), d = I(i), f = I(!1), p = I(!1), m = I(!1), h = I(null), g = I(!1);
|
|
4443
|
+
p.current = o !== null, P(() => {
|
|
4392
4444
|
if (!o || c) return;
|
|
4393
4445
|
let e = !1;
|
|
4394
|
-
return
|
|
4446
|
+
return zo().then((t) => {
|
|
4395
4447
|
e || l(t);
|
|
4396
4448
|
}).catch((e) => {
|
|
4397
|
-
|
|
4449
|
+
Lo.error("Loading the feedback form failed, feedback cannot be sent from this page:", e);
|
|
4398
4450
|
}), () => {
|
|
4399
4451
|
e = !0;
|
|
4400
4452
|
};
|
|
4401
4453
|
}, [o, c]);
|
|
4402
|
-
let _ =
|
|
4454
|
+
let _ = N(() => {
|
|
4403
4455
|
u.current &&= (clearTimeout(u.current.timer), null);
|
|
4404
|
-
}, []), v =
|
|
4456
|
+
}, []), v = N((e) => {
|
|
4405
4457
|
_(), f.current = !1, s({ screenshot: e });
|
|
4406
4458
|
}, [_]);
|
|
4407
|
-
|
|
4459
|
+
P(() => {
|
|
4408
4460
|
d.current = i, i && (_(), p.current && !f.current && s(null));
|
|
4409
|
-
}, [i, _]),
|
|
4410
|
-
let
|
|
4461
|
+
}, [i, _]), P(() => _, [_]);
|
|
4462
|
+
let x = N(() => {
|
|
4411
4463
|
if (u.current || p.current || d.current) return;
|
|
4412
|
-
|
|
4413
|
-
|
|
4464
|
+
zo().catch((e) => {
|
|
4465
|
+
Lo.debug("Preloading the feedback form failed:", e);
|
|
4414
4466
|
});
|
|
4415
|
-
let t =
|
|
4467
|
+
let t = de();
|
|
4416
4468
|
if (t.catch((e) => {
|
|
4417
|
-
|
|
4469
|
+
Lo.warn("Capturing the view for a feedback report failed, the report goes without a screenshot:", e);
|
|
4418
4470
|
}), !e || e.connectionState !== "connected") {
|
|
4419
4471
|
v(t);
|
|
4420
4472
|
return;
|
|
4421
4473
|
}
|
|
4422
4474
|
let n = { timer: setTimeout(() => {
|
|
4423
|
-
u.current === n && !d.current && (
|
|
4424
|
-
},
|
|
4425
|
-
u.current = n, e.call(
|
|
4426
|
-
e !== !0 && u.current === n && (
|
|
4475
|
+
u.current === n && !d.current && (Lo.warn(`The feedback sheet did not open within ${Bo} ms, showing the built-in form`), v(t));
|
|
4476
|
+
}, Bo) };
|
|
4477
|
+
u.current = n, e.call(y, [""]).then((e) => {
|
|
4478
|
+
e !== !0 && u.current === n && (Lo.warn(`The app declined ${y}, showing the built-in form`), v(t));
|
|
4427
4479
|
}, (e) => {
|
|
4428
|
-
u.current === n && (
|
|
4480
|
+
u.current === n && (Lo.warn(`Calling ${y} failed, showing the built-in form:`, e), v(t));
|
|
4429
4481
|
});
|
|
4430
4482
|
}, [e, v]);
|
|
4431
|
-
|
|
4432
|
-
m.current
|
|
4483
|
+
P(() => {
|
|
4484
|
+
!m.current && t && r && n === "connected" && xe() && (m.current = !0, fe(), x());
|
|
4433
4485
|
}, [
|
|
4434
4486
|
t,
|
|
4435
4487
|
r,
|
|
4436
4488
|
n,
|
|
4437
|
-
|
|
4489
|
+
x
|
|
4438
4490
|
]);
|
|
4439
|
-
let
|
|
4491
|
+
let S = N(() => {
|
|
4440
4492
|
g.current = !0, s(null);
|
|
4441
4493
|
}, []);
|
|
4442
|
-
|
|
4443
|
-
o
|
|
4494
|
+
P(() => {
|
|
4495
|
+
!o && g.current && (g.current = !1, h.current?.focus());
|
|
4444
4496
|
}, [o]);
|
|
4445
|
-
let
|
|
4497
|
+
let C = N((e) => {
|
|
4446
4498
|
f.current = e;
|
|
4447
4499
|
}, []);
|
|
4448
|
-
if (
|
|
4449
|
-
if (
|
|
4500
|
+
if (P(() => {
|
|
4501
|
+
if (e && t) return e.setFeedbackRequestHandler(x);
|
|
4450
4502
|
}, [
|
|
4451
4503
|
e,
|
|
4452
4504
|
t,
|
|
4453
|
-
|
|
4505
|
+
x
|
|
4454
4506
|
]), !t) return null;
|
|
4455
|
-
let
|
|
4456
|
-
return /* @__PURE__ */
|
|
4457
|
-
...
|
|
4507
|
+
let w = { [b]: "" }, T = `calc(${a ? Uo : Ho}px + env(safe-area-inset-bottom, 0px))`, E = t.showButton && !i && !o;
|
|
4508
|
+
return /* @__PURE__ */ z(nt, { children: [E && /* @__PURE__ */ z("div", {
|
|
4509
|
+
...w,
|
|
4458
4510
|
"data-ikon-feedback-controls": "",
|
|
4459
4511
|
style: {
|
|
4460
|
-
...
|
|
4461
|
-
bottom:
|
|
4512
|
+
...Yo.dock,
|
|
4513
|
+
bottom: T
|
|
4462
4514
|
},
|
|
4463
|
-
children: [/* @__PURE__ */
|
|
4515
|
+
children: [/* @__PURE__ */ R("style", { children: Go }), /* @__PURE__ */ R(qo, {
|
|
4464
4516
|
buttonRef: h,
|
|
4465
|
-
onPress:
|
|
4517
|
+
onPress: x
|
|
4466
4518
|
})]
|
|
4467
|
-
}), o && c && /* @__PURE__ */
|
|
4519
|
+
}), o && c && /* @__PURE__ */ R(c.FeedbackForm, {
|
|
4468
4520
|
access: e?.backendAccess ?? null,
|
|
4469
4521
|
screenshot: o.screenshot,
|
|
4470
4522
|
appSession: e?.appSessionId,
|
|
4471
4523
|
clientSession: e?.sessionId === void 0 ? void 0 : String(e.sessionId),
|
|
4472
|
-
onClose:
|
|
4473
|
-
onDirtyChange:
|
|
4524
|
+
onClose: S,
|
|
4525
|
+
onDirtyChange: C
|
|
4474
4526
|
})] });
|
|
4475
4527
|
}
|
|
4476
|
-
function
|
|
4477
|
-
return /* @__PURE__ */
|
|
4528
|
+
function qo({ buttonRef: e, onPress: t }) {
|
|
4529
|
+
return /* @__PURE__ */ R("button", {
|
|
4478
4530
|
ref: e,
|
|
4479
4531
|
type: "button",
|
|
4480
|
-
className:
|
|
4532
|
+
className: Wo,
|
|
4481
4533
|
"aria-label": "Send feedback",
|
|
4482
4534
|
title: "Send feedback",
|
|
4483
|
-
style:
|
|
4535
|
+
style: Yo.feedbackButton,
|
|
4484
4536
|
onClick: t,
|
|
4485
|
-
children: /* @__PURE__ */
|
|
4537
|
+
children: /* @__PURE__ */ R(Jo, {})
|
|
4486
4538
|
});
|
|
4487
4539
|
}
|
|
4488
|
-
function
|
|
4489
|
-
return /* @__PURE__ */
|
|
4540
|
+
function Jo() {
|
|
4541
|
+
return /* @__PURE__ */ z("svg", {
|
|
4490
4542
|
width: "22",
|
|
4491
4543
|
height: "22",
|
|
4492
4544
|
viewBox: "0 0 24 24",
|
|
@@ -4497,14 +4549,14 @@ function Go() {
|
|
|
4497
4549
|
strokeLinejoin: "round",
|
|
4498
4550
|
"aria-hidden": "true",
|
|
4499
4551
|
focusable: "false",
|
|
4500
|
-
children: [/* @__PURE__ */
|
|
4552
|
+
children: [/* @__PURE__ */ R("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }), /* @__PURE__ */ R("path", { d: "M8 9h8M8 13h5" })]
|
|
4501
4553
|
});
|
|
4502
4554
|
}
|
|
4503
|
-
var
|
|
4555
|
+
var Yo = {
|
|
4504
4556
|
dock: {
|
|
4505
4557
|
position: "fixed",
|
|
4506
4558
|
right: "max(16px, env(safe-area-inset-right, 0px))",
|
|
4507
|
-
zIndex:
|
|
4559
|
+
zIndex: Vo,
|
|
4508
4560
|
display: "flex",
|
|
4509
4561
|
alignItems: "center",
|
|
4510
4562
|
font: "14px/1.4 var(--ikon-font-body, system-ui, -apple-system, \"Segoe UI\", sans-serif)"
|
|
@@ -4526,31 +4578,31 @@ var Ko = {
|
|
|
4526
4578
|
WebkitTouchCallout: "none",
|
|
4527
4579
|
userSelect: "none"
|
|
4528
4580
|
}
|
|
4529
|
-
},
|
|
4530
|
-
function
|
|
4581
|
+
}, Xo = 9990, Zo = "ikon-platform-layer", Qo = `.${Zo}>*{pointer-events:auto}`;
|
|
4582
|
+
function $o(e) {
|
|
4531
4583
|
if (!e) return !1;
|
|
4532
|
-
for (let t of e.values()) if (t.category === r &&
|
|
4584
|
+
for (let t of e.values()) if (t.category === r && ts(t.store)?.children.some((e) => e.children.length > 0)) return !0;
|
|
4533
4585
|
return !1;
|
|
4534
4586
|
}
|
|
4535
|
-
function
|
|
4536
|
-
let [t, n] =
|
|
4537
|
-
return
|
|
4538
|
-
let t = () => n(
|
|
4587
|
+
function es(e) {
|
|
4588
|
+
let [t, n] = L(() => $o(e));
|
|
4589
|
+
return P(() => {
|
|
4590
|
+
let t = () => n($o(e));
|
|
4539
4591
|
if (t(), !e) return;
|
|
4540
4592
|
let i = [];
|
|
4541
|
-
for (let n of e.values()) n.category === r && i.push(
|
|
4593
|
+
for (let n of e.values()) n.category === r && i.push(ns(n.store, t));
|
|
4542
4594
|
return () => {
|
|
4543
4595
|
for (let e of i) e();
|
|
4544
4596
|
};
|
|
4545
4597
|
}, [e]), t;
|
|
4546
4598
|
}
|
|
4547
|
-
function
|
|
4599
|
+
function ts(e) {
|
|
4548
4600
|
let t = e.getSnapshot();
|
|
4549
4601
|
return t.rootViewId ? t.views.get(t.rootViewId) : void 0;
|
|
4550
4602
|
}
|
|
4551
|
-
function
|
|
4603
|
+
function ns(e, t) {
|
|
4552
4604
|
let n = /* @__PURE__ */ new Map(), r = () => {
|
|
4553
|
-
let t =
|
|
4605
|
+
let t = ts(e), r = new Set(t ? [t.id, ...t.children.map((e) => e.id)] : []);
|
|
4554
4606
|
for (let [e, t] of n) r.has(e) || (t(), n.delete(e));
|
|
4555
4607
|
for (let t of r) n.has(t) || n.set(t, e.subscribeNode(t, i));
|
|
4556
4608
|
};
|
|
@@ -4564,10 +4616,10 @@ function $o(e, t) {
|
|
|
4564
4616
|
n.clear(), a();
|
|
4565
4617
|
};
|
|
4566
4618
|
}
|
|
4567
|
-
function
|
|
4568
|
-
return /* @__PURE__ */
|
|
4569
|
-
[
|
|
4570
|
-
className:
|
|
4619
|
+
function rs({ stores: e, registry: t, client: n, onAction: i, open: a }) {
|
|
4620
|
+
return /* @__PURE__ */ z("div", {
|
|
4621
|
+
[b]: "",
|
|
4622
|
+
className: Zo,
|
|
4571
4623
|
"data-ikon-platform-layer": "",
|
|
4572
4624
|
style: {
|
|
4573
4625
|
position: "fixed",
|
|
@@ -4575,11 +4627,11 @@ function es({ stores: e, registry: t, client: n, onAction: i, open: a }) {
|
|
|
4575
4627
|
right: 0,
|
|
4576
4628
|
bottom: 0,
|
|
4577
4629
|
left: 0,
|
|
4578
|
-
zIndex:
|
|
4630
|
+
zIndex: Xo,
|
|
4579
4631
|
pointerEvents: "none",
|
|
4580
4632
|
display: a ? "block" : "none"
|
|
4581
4633
|
},
|
|
4582
|
-
children: [/* @__PURE__ */
|
|
4634
|
+
children: [/* @__PURE__ */ R("style", { children: Qo }), /* @__PURE__ */ R(sr, {
|
|
4583
4635
|
stores: e,
|
|
4584
4636
|
registry: t,
|
|
4585
4637
|
client: n,
|
|
@@ -4591,89 +4643,89 @@ function es({ stores: e, registry: t, client: n, onAction: i, open: a }) {
|
|
|
4591
4643
|
}
|
|
4592
4644
|
//#endregion
|
|
4593
4645
|
//#region src/app/ikon-app.tsx
|
|
4594
|
-
var
|
|
4595
|
-
function
|
|
4646
|
+
var is = { [b]: "" };
|
|
4647
|
+
function as(e, t) {
|
|
4596
4648
|
return e === void 0 ? null : typeof e == "function" ? e(t) : e;
|
|
4597
4649
|
}
|
|
4598
|
-
function
|
|
4650
|
+
function os(e) {
|
|
4599
4651
|
return e === void 0 ? null : typeof e == "function" ? e() : e;
|
|
4600
4652
|
}
|
|
4601
|
-
function
|
|
4653
|
+
function ss(e, t) {
|
|
4602
4654
|
return e === void 0 ? null : typeof e == "function" ? e(t) : e;
|
|
4603
4655
|
}
|
|
4604
|
-
function
|
|
4656
|
+
function cs(e, t) {
|
|
4605
4657
|
return e === void 0 ? null : typeof e == "function" ? e(t) : e;
|
|
4606
4658
|
}
|
|
4607
|
-
function
|
|
4608
|
-
let { connectingOverlay: t, reconnectingOverlay: n, offlineOverlay: r, accessDeniedScreen: i, ...a } = e, o =
|
|
4609
|
-
u && d && (m || u.size > 0) && (
|
|
4659
|
+
function ls(e) {
|
|
4660
|
+
let { connectingOverlay: t, reconnectingOverlay: n, offlineOverlay: r, accessDeniedScreen: i, ...a } = e, o = Io(a), { app: s } = o, { connectionState: c, isConnectingSlow: l, stores: u, registry: d, client: f, onAction: p, isReady: m, isLive: h, error: g, accessDeniedReason: _, brandingRequired: v, feedback: y } = s, b = v || o.forcedBranding, x = I(null);
|
|
4661
|
+
u && d && (m || u.size > 0) && (x.current = {
|
|
4610
4662
|
stores: u,
|
|
4611
4663
|
registry: d,
|
|
4612
4664
|
client: f
|
|
4613
4665
|
});
|
|
4614
|
-
let
|
|
4615
|
-
if (
|
|
4616
|
-
|
|
4617
|
-
}, [
|
|
4618
|
-
let
|
|
4666
|
+
let S = x.current != null || !!_, C = es(x.current?.stores) && c === "connected";
|
|
4667
|
+
if ($e(() => {
|
|
4668
|
+
S && typeof document < "u" && document.querySelectorAll("[data-ikon-prerender]").forEach((e) => e.remove());
|
|
4669
|
+
}, [S]), _) return cs(i, _);
|
|
4670
|
+
let w = x.current, T;
|
|
4619
4671
|
switch (c) {
|
|
4620
4672
|
case "waitingForExternalConnectUrl":
|
|
4621
4673
|
case "connecting":
|
|
4622
|
-
|
|
4674
|
+
T = as(t, l);
|
|
4623
4675
|
break;
|
|
4624
4676
|
case "reconnecting":
|
|
4625
|
-
|
|
4677
|
+
T = os(n);
|
|
4626
4678
|
break;
|
|
4627
4679
|
case "offline":
|
|
4628
|
-
|
|
4680
|
+
T = ss(r, g);
|
|
4629
4681
|
break;
|
|
4630
|
-
default:
|
|
4682
|
+
default: T = null;
|
|
4631
4683
|
}
|
|
4632
|
-
return /* @__PURE__ */
|
|
4633
|
-
|
|
4634
|
-
stores:
|
|
4635
|
-
registry:
|
|
4636
|
-
client:
|
|
4684
|
+
return /* @__PURE__ */ z(nt, { children: [
|
|
4685
|
+
w && /* @__PURE__ */ R(sr, {
|
|
4686
|
+
stores: w.stores,
|
|
4687
|
+
registry: w.registry,
|
|
4688
|
+
client: w.client,
|
|
4637
4689
|
onAction: p
|
|
4638
4690
|
}),
|
|
4639
|
-
|
|
4640
|
-
stores:
|
|
4641
|
-
registry:
|
|
4642
|
-
client:
|
|
4691
|
+
w && /* @__PURE__ */ R(rs, {
|
|
4692
|
+
stores: w.stores,
|
|
4693
|
+
registry: w.registry,
|
|
4694
|
+
client: w.client,
|
|
4643
4695
|
onAction: p,
|
|
4644
|
-
open:
|
|
4696
|
+
open: C
|
|
4645
4697
|
}),
|
|
4646
|
-
|
|
4647
|
-
...
|
|
4698
|
+
T != null && /* @__PURE__ */ R("div", {
|
|
4699
|
+
...is,
|
|
4648
4700
|
style: { display: "contents" },
|
|
4649
|
-
children:
|
|
4701
|
+
children: T
|
|
4650
4702
|
}),
|
|
4651
|
-
|
|
4652
|
-
/* @__PURE__ */
|
|
4703
|
+
b && /* @__PURE__ */ R(ds, {}),
|
|
4704
|
+
/* @__PURE__ */ R(Ko, {
|
|
4653
4705
|
client: f,
|
|
4654
|
-
feedback:
|
|
4706
|
+
feedback: y,
|
|
4655
4707
|
connectionState: c,
|
|
4656
4708
|
isLive: h,
|
|
4657
|
-
sheetOpen:
|
|
4658
|
-
brandingShown:
|
|
4709
|
+
sheetOpen: C,
|
|
4710
|
+
brandingShown: b
|
|
4659
4711
|
}),
|
|
4660
|
-
/* @__PURE__ */
|
|
4661
|
-
/* @__PURE__ */
|
|
4662
|
-
...
|
|
4712
|
+
/* @__PURE__ */ R(fs, {}),
|
|
4713
|
+
/* @__PURE__ */ R("div", {
|
|
4714
|
+
...is,
|
|
4663
4715
|
style: { display: "contents" },
|
|
4664
|
-
children: /* @__PURE__ */
|
|
4716
|
+
children: /* @__PURE__ */ R(fo, {
|
|
4665
4717
|
state: c,
|
|
4666
4718
|
forceVisible: o.forcedDebugOverlay
|
|
4667
4719
|
})
|
|
4668
4720
|
})
|
|
4669
4721
|
] });
|
|
4670
4722
|
}
|
|
4671
|
-
var
|
|
4672
|
-
function
|
|
4673
|
-
return /* @__PURE__ */
|
|
4674
|
-
...
|
|
4723
|
+
var us = "https://ikonai.com";
|
|
4724
|
+
function ds() {
|
|
4725
|
+
return /* @__PURE__ */ z("a", {
|
|
4726
|
+
...is,
|
|
4675
4727
|
className: "ikon-branding-banner",
|
|
4676
|
-
href:
|
|
4728
|
+
href: us,
|
|
4677
4729
|
target: "_blank",
|
|
4678
4730
|
rel: "noopener noreferrer",
|
|
4679
4731
|
style: {
|
|
@@ -4694,44 +4746,44 @@ function cs() {
|
|
|
4694
4746
|
boxShadow: "0 -1px 8px rgba(0, 0, 0, 0.25)",
|
|
4695
4747
|
pointerEvents: "auto"
|
|
4696
4748
|
},
|
|
4697
|
-
children: [/* @__PURE__ */
|
|
4749
|
+
children: [/* @__PURE__ */ R("span", {
|
|
4698
4750
|
style: { opacity: .75 },
|
|
4699
4751
|
children: "Powered by"
|
|
4700
|
-
}), /* @__PURE__ */
|
|
4752
|
+
}), /* @__PURE__ */ R("span", {
|
|
4701
4753
|
style: { fontWeight: 700 },
|
|
4702
4754
|
children: "Ikon"
|
|
4703
4755
|
})]
|
|
4704
4756
|
});
|
|
4705
4757
|
}
|
|
4706
|
-
function
|
|
4707
|
-
let { toasts: e, dismissToast: t } =
|
|
4708
|
-
return e.length === 0 ? null : /* @__PURE__ */
|
|
4709
|
-
...
|
|
4758
|
+
function fs() {
|
|
4759
|
+
let { toasts: e, dismissToast: t } = Eo();
|
|
4760
|
+
return e.length === 0 ? null : /* @__PURE__ */ R("div", {
|
|
4761
|
+
...is,
|
|
4710
4762
|
className: "ikon-toast-overlay",
|
|
4711
|
-
children: e.map((e) => /* @__PURE__ */
|
|
4763
|
+
children: e.map((e) => /* @__PURE__ */ R(ps, {
|
|
4712
4764
|
toast: e,
|
|
4713
4765
|
onDismiss: t
|
|
4714
4766
|
}, e.id))
|
|
4715
4767
|
});
|
|
4716
4768
|
}
|
|
4717
|
-
function
|
|
4718
|
-
return /* @__PURE__ */
|
|
4769
|
+
function ps({ toast: e, onDismiss: t }) {
|
|
4770
|
+
return /* @__PURE__ */ z("div", {
|
|
4719
4771
|
className: `ikon-toast-overlay-chip ikon-toast-overlay-chip--${e.level}`,
|
|
4720
4772
|
onClick: () => t(e.id),
|
|
4721
4773
|
role: "alert",
|
|
4722
|
-
children: [/* @__PURE__ */
|
|
4774
|
+
children: [/* @__PURE__ */ R("span", {
|
|
4723
4775
|
className: "ikon-toast-overlay-icon",
|
|
4724
4776
|
children: e.level === "error" ? "🚨" : "⚠️"
|
|
4725
|
-
}), /* @__PURE__ */
|
|
4777
|
+
}), /* @__PURE__ */ z("div", {
|
|
4726
4778
|
className: "ikon-toast-overlay-content",
|
|
4727
|
-
children: [/* @__PURE__ */
|
|
4779
|
+
children: [/* @__PURE__ */ z("span", {
|
|
4728
4780
|
className: "ikon-toast-overlay-component",
|
|
4729
4781
|
children: [
|
|
4730
4782
|
"[",
|
|
4731
4783
|
e.component,
|
|
4732
4784
|
"]"
|
|
4733
4785
|
]
|
|
4734
|
-
}), /* @__PURE__ */
|
|
4786
|
+
}), /* @__PURE__ */ R("span", {
|
|
4735
4787
|
className: "ikon-toast-overlay-message",
|
|
4736
4788
|
children: e.message
|
|
4737
4789
|
})]
|
|
@@ -4740,19 +4792,19 @@ function us({ toast: e, onDismiss: t }) {
|
|
|
4740
4792
|
}
|
|
4741
4793
|
//#endregion
|
|
4742
4794
|
//#region src/app/feedback/use-ikon-feedback.ts
|
|
4743
|
-
function
|
|
4744
|
-
let t =
|
|
4795
|
+
function ms(e) {
|
|
4796
|
+
let t = N((t) => e?.subscribeToFeedback(t) ?? hs, [e]);
|
|
4745
4797
|
return {
|
|
4746
|
-
available:
|
|
4747
|
-
open:
|
|
4798
|
+
available: tt(t, () => e?.feedback != null, () => !1),
|
|
4799
|
+
open: N(() => e?.requestFeedback() ?? !1, [e])
|
|
4748
4800
|
};
|
|
4749
4801
|
}
|
|
4750
|
-
function
|
|
4802
|
+
function hs() {}
|
|
4751
4803
|
//#endregion
|
|
4752
4804
|
//#region src/app/connection-recovery.ts
|
|
4753
|
-
function
|
|
4805
|
+
function gs({ isSessionExpired: e }) {
|
|
4754
4806
|
if (e) {
|
|
4755
|
-
let e =
|
|
4807
|
+
let e = j();
|
|
4756
4808
|
if (e) return {
|
|
4757
4809
|
kind: "freshSession",
|
|
4758
4810
|
run: () => {
|
|
@@ -4769,31 +4821,31 @@ function ps({ isSessionExpired: e }) {
|
|
|
4769
4821
|
}
|
|
4770
4822
|
//#endregion
|
|
4771
4823
|
//#region src/account/use-account-removal.ts
|
|
4772
|
-
function
|
|
4824
|
+
function _s(e) {
|
|
4773
4825
|
return e instanceof Error && e.message ? e.message : String(e);
|
|
4774
4826
|
}
|
|
4775
|
-
function
|
|
4776
|
-
let { backendUrl: t, loadOnMount: n = !0 } = e, { state: r, getToken: i } =
|
|
4777
|
-
|
|
4827
|
+
function vs(e = {}) {
|
|
4828
|
+
let { backendUrl: t, loadOnMount: n = !0 } = e, { state: r, getToken: i } = Fa(), [a, o] = L(null), [s, c] = L(!1), [l, u] = L(!1), [d, f] = L(null), p = I(!0);
|
|
4829
|
+
P(() => (p.current = !0, () => {
|
|
4778
4830
|
p.current = !1;
|
|
4779
4831
|
}), []);
|
|
4780
|
-
let m = r.isAuthenticated && r.user !== null && r.user.provider !== "anonymous" && r.user.provider !== "dev", h =
|
|
4832
|
+
let m = r.isAuthenticated && r.user !== null && r.user.provider !== "anonymous" && r.user.provider !== "dev", h = N(async () => {
|
|
4781
4833
|
let e = i();
|
|
4782
4834
|
if (e) {
|
|
4783
4835
|
c(!0), f(null);
|
|
4784
4836
|
try {
|
|
4785
|
-
let n = await
|
|
4837
|
+
let n = await ye({
|
|
4786
4838
|
authToken: e,
|
|
4787
4839
|
backendUrl: t
|
|
4788
4840
|
});
|
|
4789
4841
|
p.current && o(n.removal ?? null);
|
|
4790
4842
|
} catch (e) {
|
|
4791
|
-
p.current && f(
|
|
4843
|
+
p.current && f(_s(e));
|
|
4792
4844
|
} finally {
|
|
4793
4845
|
p.current && c(!1);
|
|
4794
4846
|
}
|
|
4795
4847
|
}
|
|
4796
|
-
}, [t, i]), g =
|
|
4848
|
+
}, [t, i]), g = N(async (e) => {
|
|
4797
4849
|
let n = i();
|
|
4798
4850
|
if (!n) {
|
|
4799
4851
|
f("You are not signed in");
|
|
@@ -4807,13 +4859,13 @@ function hs(e = {}) {
|
|
|
4807
4859
|
});
|
|
4808
4860
|
p.current && o(r.removal ?? null);
|
|
4809
4861
|
} catch (e) {
|
|
4810
|
-
p.current && f(
|
|
4862
|
+
p.current && f(_s(e));
|
|
4811
4863
|
} finally {
|
|
4812
4864
|
p.current && u(!1);
|
|
4813
4865
|
}
|
|
4814
|
-
}, [t, i]), _ =
|
|
4815
|
-
return
|
|
4816
|
-
|
|
4866
|
+
}, [t, i]), _ = N(() => g(ze), [g]), v = N(() => g(ue), [g]);
|
|
4867
|
+
return P(() => {
|
|
4868
|
+
n && m && h();
|
|
4817
4869
|
}, [
|
|
4818
4870
|
n,
|
|
4819
4871
|
m,
|
|
@@ -4824,7 +4876,7 @@ function hs(e = {}) {
|
|
|
4824
4876
|
isSubmittingRemoval: l,
|
|
4825
4877
|
removalError: d,
|
|
4826
4878
|
canRequestRemoval: m,
|
|
4827
|
-
removalGraceDays:
|
|
4879
|
+
removalGraceDays: se,
|
|
4828
4880
|
requestAccountRemoval: _,
|
|
4829
4881
|
cancelAccountRemoval: v,
|
|
4830
4882
|
reloadAccountRemoval: h
|
|
@@ -4832,27 +4884,27 @@ function hs(e = {}) {
|
|
|
4832
4884
|
}
|
|
4833
4885
|
//#endregion
|
|
4834
4886
|
//#region src/consent/use-consent.ts
|
|
4835
|
-
function
|
|
4887
|
+
function ys(e) {
|
|
4836
4888
|
return e instanceof Error && e.message ? e.message : String(e);
|
|
4837
4889
|
}
|
|
4838
|
-
function
|
|
4839
|
-
let [n, r] =
|
|
4840
|
-
|
|
4890
|
+
function bs({ client: e, purposes: t }) {
|
|
4891
|
+
let [n, r] = L({}), [i, a] = L(!1), [o, s] = L(!1), [c, l] = L(null), u = I(!0);
|
|
4892
|
+
P(() => (u.current = !0, () => {
|
|
4841
4893
|
u.current = !1;
|
|
4842
4894
|
}), []);
|
|
4843
|
-
let d =
|
|
4895
|
+
let d = N(async () => {
|
|
4844
4896
|
if (e) {
|
|
4845
4897
|
a(!0), l(null);
|
|
4846
4898
|
try {
|
|
4847
|
-
let t = await
|
|
4899
|
+
let t = await Le(e);
|
|
4848
4900
|
u.current && r(t);
|
|
4849
4901
|
} catch (e) {
|
|
4850
|
-
u.current && l(
|
|
4902
|
+
u.current && l(ys(e));
|
|
4851
4903
|
} finally {
|
|
4852
4904
|
u.current && a(!1);
|
|
4853
4905
|
}
|
|
4854
4906
|
}
|
|
4855
|
-
}, [e]), f =
|
|
4907
|
+
}, [e]), f = N(async (t, n) => {
|
|
4856
4908
|
if (!e) {
|
|
4857
4909
|
l("The app is not connected, so your answer was not recorded");
|
|
4858
4910
|
return;
|
|
@@ -4865,20 +4917,20 @@ function _s({ client: e, purposes: t }) {
|
|
|
4865
4917
|
[i.purpose]: i
|
|
4866
4918
|
}));
|
|
4867
4919
|
} catch (e) {
|
|
4868
|
-
u.current && l(
|
|
4920
|
+
u.current && l(ys(e));
|
|
4869
4921
|
} finally {
|
|
4870
4922
|
u.current && s(!1);
|
|
4871
4923
|
}
|
|
4872
|
-
}, [e]), p =
|
|
4873
|
-
return
|
|
4924
|
+
}, [e]), p = N((e) => f(e, Oe), [f]), m = N((e) => f(e, Ve), [f]), h = t.join("\0");
|
|
4925
|
+
return P(() => {
|
|
4874
4926
|
d();
|
|
4875
4927
|
}, [d, h]), {
|
|
4876
4928
|
answers: n,
|
|
4877
4929
|
isLoading: i,
|
|
4878
4930
|
isSubmitting: o,
|
|
4879
4931
|
error: c,
|
|
4880
|
-
consentFor: (e) =>
|
|
4881
|
-
isGranted: (e) =>
|
|
4932
|
+
consentFor: (e) => me(n, e),
|
|
4933
|
+
isGranted: (e) => Ae(n, e),
|
|
4882
4934
|
grant: p,
|
|
4883
4935
|
revoke: m,
|
|
4884
4936
|
reload: d
|
|
@@ -4886,37 +4938,37 @@ function _s({ client: e, purposes: t }) {
|
|
|
4886
4938
|
}
|
|
4887
4939
|
//#endregion
|
|
4888
4940
|
//#region src/i18n/i18n.tsx
|
|
4889
|
-
var
|
|
4890
|
-
function
|
|
4941
|
+
var xs = Ye(null);
|
|
4942
|
+
function Ss(e, t) {
|
|
4891
4943
|
return t ? e.replace(/\{(\w+)\}/g, (e, n) => t[n] ?? `{${n}}`) : e;
|
|
4892
4944
|
}
|
|
4893
|
-
function
|
|
4894
|
-
let n =
|
|
4945
|
+
function Cs(e, t) {
|
|
4946
|
+
let n = Se();
|
|
4895
4947
|
if (n && e.includes(n)) return n;
|
|
4896
4948
|
let r = navigator.language.split("-")[0];
|
|
4897
4949
|
return e.includes(r) ? r : t && e.includes(t) ? t : "en";
|
|
4898
4950
|
}
|
|
4899
|
-
function
|
|
4900
|
-
return t ?
|
|
4951
|
+
function ws(e, t, n) {
|
|
4952
|
+
return t ? Cs(e, n) : n && e.includes(n) ? n : "en";
|
|
4901
4953
|
}
|
|
4902
|
-
function
|
|
4903
|
-
let i =
|
|
4954
|
+
function Ts({ children: e, translations: t, defaultLanguage: n, detectLanguage: r = !1 }) {
|
|
4955
|
+
let i = ws(Object.keys(t), r, n), a = t[i] ?? t.en, o = F(() => ({
|
|
4904
4956
|
t: (e, t) => {
|
|
4905
4957
|
let n = a[e];
|
|
4906
|
-
return
|
|
4958
|
+
return Ss(n, t);
|
|
4907
4959
|
},
|
|
4908
4960
|
locale: i,
|
|
4909
4961
|
translations: a
|
|
4910
4962
|
}), [a, i]);
|
|
4911
|
-
return /* @__PURE__ */
|
|
4963
|
+
return /* @__PURE__ */ R(xs, {
|
|
4912
4964
|
value: o,
|
|
4913
4965
|
children: e
|
|
4914
4966
|
});
|
|
4915
4967
|
}
|
|
4916
|
-
function
|
|
4917
|
-
let e =
|
|
4968
|
+
function Es() {
|
|
4969
|
+
let e = Qe(xs);
|
|
4918
4970
|
if (!e) throw Error("useI18n must be used within an I18nProvider");
|
|
4919
4971
|
return e;
|
|
4920
4972
|
}
|
|
4921
4973
|
//#endregion
|
|
4922
|
-
export {
|
|
4974
|
+
export { Pa as AuthProvider, po as ConnectionStateRenderer, eo as DEBUG_OVERLAY_ENABLED, fo as DebugOverlay, Ts as I18nProvider, n as IKON_PLATFORM_STREAM_CATEGORY, en as IKON_UI_BASE_MODULE, Cn as IKON_UI_MEDIA_MODULE, On as IKON_UI_SHADERTOY_MODULE, t as IKON_UI_SHADERTOY_TYPE, i as IKON_UI_STREAM_CATEGORY, _n as IKON_UI_VIDEO_CANVAS_TYPE, vn as IKON_UI_VIDEO_URL_PLAYER_TYPE, ls as IkonApp, rt as IkonUi, Nn as IkonUiRegistry, sr as IkonUiSurface, ir as InspectOverlay, cr as ParallaxView, $n as UiComponentRegistry, Qn as UiRenderer, c as UiStreamStore, dn as VideoStreamView, Gi as authenticateAnonymous, ra as buildOAuthRedirectUrl, ia as buildSsoRedirectUrl, Ii as clearAuthSession, na as clearOAuthParams, $t as createBaseResolvers, er as createComponentLibrary, Pn as createIkonUiRegistry, Dn as createLazyResolver, bn as createMediaResolvers, kn as createShadertoyRendererResolver, oa as discoverSsoConnection, aa as findSsoConnectionsForHost, gs as getConnectionRecovery, or as isIkonUiCategoryMatch, Oi as loadAuthSession, tn as loadBaseModule, wn as loadMediaModule, An as loadShadertoyModule, Ji as parseOAuthCallback, Qi as parseOAuthError, Ie as randomUuid, nn as registerBaseModule, Tn as registerMediaModule, jn as registerShadertoyModule, Xn as renderChildren, Rr as renderMotionLetters, sa as requestSsoLinkTicket, J as saveAuthSession, Ki as sendLoginCode, Y as sessionToUser, vs as useAccountRemoval, Fa as useAuth, Qa as useAuthGuard, Ia as useAuthOptional, Er as useCameraCapture, bs as useConsent, Es as useI18n, wo as useIkonApp, Io as useIkonDebug, ms as useIkonFeedback, Do as useIkonReactive, vr as useIkonStyles, br as useIkonUiStores, Tr as useMicrophoneCapture, Oo as useReactive, Dr as useScreenCapture, Sr as useSiblingClient, $a as useSsoSignIn, Eo as useToasts, e as useUiNode, tr as useUiStore, qi as verifyLoginCode };
|