@ikonai/sdk-react-ui 1.0.52 → 1.0.53
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/auth/types.d.ts +1 -1
- package/hooks/index.d.ts +1 -0
- package/hooks/use-ikon-reactive.d.ts +14 -0
- package/index.d.ts +2 -1
- package/index.js +422 -391
- package/package.json +1 -1
- package/parallax-view.d.ts +27 -0
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IkonUiCore as jt, UiStreamStore as Dt } from "@ikonai/sdk-ui";
|
|
2
|
-
import { UiStreamStore as
|
|
3
|
-
import Bt, { useSyncExternalStore as Ve, useMemo as $, memo as
|
|
2
|
+
import { UiStreamStore as ts } from "@ikonai/sdk-ui";
|
|
3
|
+
import Bt, { useSyncExternalStore as Ve, useMemo as $, memo as Y, useRef as v, useCallback as U, Fragment as Ft, useEffect as O, useState as z, use as Ke, createContext as gt } from "react";
|
|
4
4
|
import { createLogger as fe, isInspectModeEnabled as $t, getOrCreateDeviceId as Vt, deriveAuthUrl as de, parseUrlParams as Kt, clearSessionParamsFromUrl as zt, isCloudEnvironment as Ge, extractUserIdFromToken as Yt, deriveBackendType as Je, IkonClient as Wt, AccessDeniedError as qt, AuthenticationError as Ht, subscribeToLogEvents as Gt, isDebugModeEnabled as Jt, LogLevel as Xe, getLangParam as Xt } from "@ikonai/sdk";
|
|
5
5
|
var Se = { exports: {} }, ie = {};
|
|
6
6
|
/**
|
|
@@ -74,14 +74,14 @@ function Qt() {
|
|
|
74
74
|
return "Portal";
|
|
75
75
|
case _:
|
|
76
76
|
return d.displayName || "Context";
|
|
77
|
-
case
|
|
77
|
+
case N:
|
|
78
78
|
return (d._context.displayName || "Context") + ".Consumer";
|
|
79
79
|
case M:
|
|
80
80
|
var w = d.render;
|
|
81
81
|
return d = d.displayName, d || (d = w.displayName || w.name || "", d = d !== "" ? "ForwardRef(" + d + ")" : "ForwardRef"), d;
|
|
82
82
|
case T:
|
|
83
83
|
return w = d.displayName || null, w !== null ? w : t(d.type) || "Memo";
|
|
84
|
-
case
|
|
84
|
+
case P:
|
|
85
85
|
w = d._payload, d = d._init;
|
|
86
86
|
try {
|
|
87
87
|
return t(d(w));
|
|
@@ -102,17 +102,17 @@ function Qt() {
|
|
|
102
102
|
}
|
|
103
103
|
if (w) {
|
|
104
104
|
w = console;
|
|
105
|
-
var A = w.error,
|
|
105
|
+
var A = w.error, R = typeof Symbol == "function" && Symbol.toStringTag && d[Symbol.toStringTag] || d.constructor.name || "Object";
|
|
106
106
|
return A.call(
|
|
107
107
|
w,
|
|
108
108
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
109
|
-
|
|
109
|
+
R
|
|
110
110
|
), e(d);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
function n(d) {
|
|
114
114
|
if (d === g) return "<>";
|
|
115
|
-
if (typeof d == "object" && d !== null && d.$$typeof ===
|
|
115
|
+
if (typeof d == "object" && d !== null && d.$$typeof === P)
|
|
116
116
|
return "<...>";
|
|
117
117
|
try {
|
|
118
118
|
var w = t(d);
|
|
@@ -153,14 +153,14 @@ function Qt() {
|
|
|
153
153
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
154
154
|
)), d = this.props.ref, d !== void 0 ? d : null;
|
|
155
155
|
}
|
|
156
|
-
function f(d, w, A,
|
|
156
|
+
function f(d, w, A, R, K, Z) {
|
|
157
157
|
var C = A.ref;
|
|
158
158
|
return d = {
|
|
159
159
|
$$typeof: l,
|
|
160
160
|
type: d,
|
|
161
161
|
key: w,
|
|
162
162
|
props: A,
|
|
163
|
-
_owner:
|
|
163
|
+
_owner: R
|
|
164
164
|
}, (C !== void 0 ? C : null) !== null ? Object.defineProperty(d, "ref", {
|
|
165
165
|
enumerable: !1,
|
|
166
166
|
get: u
|
|
@@ -186,13 +186,13 @@ function Qt() {
|
|
|
186
186
|
value: Z
|
|
187
187
|
}), Object.freeze && (Object.freeze(d.props), Object.freeze(d)), d;
|
|
188
188
|
}
|
|
189
|
-
function h(d, w, A,
|
|
189
|
+
function h(d, w, A, R, K, Z) {
|
|
190
190
|
var C = w.children;
|
|
191
191
|
if (C !== void 0)
|
|
192
|
-
if (
|
|
192
|
+
if (R)
|
|
193
193
|
if (he(C)) {
|
|
194
|
-
for (
|
|
195
|
-
p(C[
|
|
194
|
+
for (R = 0; R < C.length; R++)
|
|
195
|
+
p(C[R]);
|
|
196
196
|
Object.freeze && Object.freeze(C);
|
|
197
197
|
} else
|
|
198
198
|
console.error(
|
|
@@ -201,21 +201,21 @@ function Qt() {
|
|
|
201
201
|
else p(C);
|
|
202
202
|
if (V.call(w, "key")) {
|
|
203
203
|
C = t(d);
|
|
204
|
-
var
|
|
204
|
+
var W = Object.keys(w).filter(function(se) {
|
|
205
205
|
return se !== "key";
|
|
206
206
|
});
|
|
207
|
-
|
|
207
|
+
R = 0 < W.length ? "{key: someKey, " + W.join(": ..., ") + ": ...}" : "{key: someKey}", ye[C + R] || (W = 0 < W.length ? "{" + W.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
208
208
|
`A props object containing a "key" prop is being spread into JSX:
|
|
209
209
|
let props = %s;
|
|
210
210
|
<%s {...props} />
|
|
211
211
|
React keys must be passed directly to JSX without using spread:
|
|
212
212
|
let props = %s;
|
|
213
213
|
<%s key={someKey} {...props} />`,
|
|
214
|
-
|
|
214
|
+
R,
|
|
215
215
|
C,
|
|
216
|
-
|
|
216
|
+
W,
|
|
217
217
|
C
|
|
218
|
-
), ye[C +
|
|
218
|
+
), ye[C + R] = !0);
|
|
219
219
|
}
|
|
220
220
|
if (C = null, A !== void 0 && (r(A), C = "" + A), i(w) && (r(w.key), C = "" + w.key), "key" in w) {
|
|
221
221
|
A = {};
|
|
@@ -235,12 +235,12 @@ React keys must be passed directly to JSX without using spread:
|
|
|
235
235
|
);
|
|
236
236
|
}
|
|
237
237
|
function p(d) {
|
|
238
|
-
y(d) ? d._store && (d._store.validated = 1) : typeof d == "object" && d !== null && d.$$typeof ===
|
|
238
|
+
y(d) ? d._store && (d._store.validated = 1) : typeof d == "object" && d !== null && d.$$typeof === P && (d._payload.status === "fulfilled" ? y(d._payload.value) && d._payload.value._store && (d._payload.value._store.validated = 1) : d._store && (d._store.validated = 1));
|
|
239
239
|
}
|
|
240
240
|
function y(d) {
|
|
241
241
|
return typeof d == "object" && d !== null && d.$$typeof === l;
|
|
242
242
|
}
|
|
243
|
-
var c = Bt, l = Symbol.for("react.transitional.element"), m = Symbol.for("react.portal"), g = Symbol.for("react.fragment"), b = Symbol.for("react.strict_mode"), S = Symbol.for("react.profiler"),
|
|
243
|
+
var c = Bt, l = Symbol.for("react.transitional.element"), m = Symbol.for("react.portal"), g = Symbol.for("react.fragment"), b = Symbol.for("react.strict_mode"), S = Symbol.for("react.profiler"), N = Symbol.for("react.consumer"), _ = Symbol.for("react.context"), M = Symbol.for("react.forward_ref"), L = Symbol.for("react.suspense"), G = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), D = Symbol.for("react.activity"), j = Symbol.for("react.client.reference"), B = c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, V = Object.prototype.hasOwnProperty, he = Array.isArray, ne = console.createTask ? console.createTask : function() {
|
|
244
244
|
return null;
|
|
245
245
|
};
|
|
246
246
|
c = {
|
|
@@ -253,24 +253,24 @@ React keys must be passed directly to JSX without using spread:
|
|
|
253
253
|
s
|
|
254
254
|
)(), X = ne(n(s)), ye = {};
|
|
255
255
|
ae.Fragment = g, ae.jsx = function(d, w, A) {
|
|
256
|
-
var
|
|
256
|
+
var R = 1e4 > B.recentlyCreatedOwnerStacks++;
|
|
257
257
|
return h(
|
|
258
258
|
d,
|
|
259
259
|
w,
|
|
260
260
|
A,
|
|
261
261
|
!1,
|
|
262
|
-
|
|
263
|
-
|
|
262
|
+
R ? Error("react-stack-top-frame") : ge,
|
|
263
|
+
R ? ne(n(d)) : X
|
|
264
264
|
);
|
|
265
265
|
}, ae.jsxs = function(d, w, A) {
|
|
266
|
-
var
|
|
266
|
+
var R = 1e4 > B.recentlyCreatedOwnerStacks++;
|
|
267
267
|
return h(
|
|
268
268
|
d,
|
|
269
269
|
w,
|
|
270
270
|
A,
|
|
271
271
|
!0,
|
|
272
|
-
|
|
273
|
-
|
|
272
|
+
R ? Error("react-stack-top-frame") : ge,
|
|
273
|
+
R ? ne(n(d)) : X
|
|
274
274
|
);
|
|
275
275
|
};
|
|
276
276
|
})()), ae;
|
|
@@ -279,7 +279,7 @@ var et;
|
|
|
279
279
|
function er() {
|
|
280
280
|
return et || (et = 1, process.env.NODE_ENV === "production" ? Se.exports = Zt() : Se.exports = Qt()), Se.exports;
|
|
281
281
|
}
|
|
282
|
-
var
|
|
282
|
+
var E = er();
|
|
283
283
|
function tr(t, e) {
|
|
284
284
|
const r = Ve(
|
|
285
285
|
(n) => t.subscribe(n),
|
|
@@ -339,29 +339,29 @@ function ar(t) {
|
|
|
339
339
|
e += "," + t[r].id;
|
|
340
340
|
return e;
|
|
341
341
|
}
|
|
342
|
-
const xe =
|
|
342
|
+
const xe = Y(function t({ nodeId: e, context: r }) {
|
|
343
343
|
const n = J(r.store, e), o = n ? sr(n) : [], s = ar(o), i = $(
|
|
344
|
-
() => o.length === 0 ? null : o.map((p) => /* @__PURE__ */
|
|
344
|
+
() => o.length === 0 ? null : o.map((p) => /* @__PURE__ */ E.jsx(t, { nodeId: p.id, context: r }, p.id)),
|
|
345
345
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
346
346
|
[s, r]
|
|
347
347
|
);
|
|
348
348
|
if (!n)
|
|
349
349
|
return null;
|
|
350
350
|
if (n.type === "root")
|
|
351
|
-
return /* @__PURE__ */
|
|
351
|
+
return /* @__PURE__ */ E.jsx(Ft, { children: i }, n.id);
|
|
352
352
|
const a = r.library.resolve(n);
|
|
353
353
|
if (!a)
|
|
354
354
|
return rr.warn(`No renderer for node type ${n.type}`), null;
|
|
355
355
|
const u = or(n), f = u.length > 0 ? u.join(" ") : void 0, h = a;
|
|
356
|
-
return /* @__PURE__ */
|
|
356
|
+
return /* @__PURE__ */ E.jsx(h, { nodeId: e, context: r, className: f });
|
|
357
357
|
}, ir);
|
|
358
358
|
function cr(t, e) {
|
|
359
|
-
return !Array.isArray(t) || t.length === 0 ? null : t.map((r) => /* @__PURE__ */
|
|
359
|
+
return !Array.isArray(t) || t.length === 0 ? null : t.map((r) => /* @__PURE__ */ E.jsx(xe, { nodeId: r.id, context: e }, r.id));
|
|
360
360
|
}
|
|
361
361
|
function ur(t, e) {
|
|
362
362
|
return t.store === e.store && t.library === e.library && t.viewId === e.viewId && t.emptyFallback === e.emptyFallback;
|
|
363
363
|
}
|
|
364
|
-
const lr =
|
|
364
|
+
const lr = Y(function({ store: e, library: r, viewId: n, emptyFallback: o = null, onAction: s, client: i, video: a }) {
|
|
365
365
|
const { rootViewId: u, rootNodeId: f } = tr(e, n), h = v(s);
|
|
366
366
|
h.current = s;
|
|
367
367
|
const p = v(i);
|
|
@@ -383,7 +383,7 @@ const lr = z(function({ store: e, library: r, viewId: n, emptyFallback: o = null
|
|
|
383
383
|
renderChildren: (g) => cr(g, m),
|
|
384
384
|
renderView: (g) => {
|
|
385
385
|
const b = e.getSnapshot().views.get(g);
|
|
386
|
-
return b ? /* @__PURE__ */
|
|
386
|
+
return b ? /* @__PURE__ */ E.jsx(xe, { nodeId: b.id, context: m }) : null;
|
|
387
387
|
},
|
|
388
388
|
dispatchAction: c,
|
|
389
389
|
// Access client/video via refs to avoid context recreation
|
|
@@ -396,7 +396,7 @@ const lr = z(function({ store: e, library: r, viewId: n, emptyFallback: o = null
|
|
|
396
396
|
};
|
|
397
397
|
return m;
|
|
398
398
|
}, [e, r, c]);
|
|
399
|
-
return !u || !f ? o : /* @__PURE__ */
|
|
399
|
+
return !u || !f ? o : /* @__PURE__ */ E.jsx("div", { "data-ikon-view-id": u, style: { display: "contents" }, children: /* @__PURE__ */ E.jsx(xe, { nodeId: f, context: l }) });
|
|
400
400
|
}, ur);
|
|
401
401
|
class dr {
|
|
402
402
|
constructor(e, r) {
|
|
@@ -415,11 +415,11 @@ class dr {
|
|
|
415
415
|
return this.renderers.get(e.type) ?? this.fallback;
|
|
416
416
|
}
|
|
417
417
|
}
|
|
418
|
-
function
|
|
418
|
+
function jo(t, e) {
|
|
419
419
|
const r = Object.entries(t);
|
|
420
420
|
return new dr(r, e);
|
|
421
421
|
}
|
|
422
|
-
function
|
|
422
|
+
function Do(t) {
|
|
423
423
|
return Ve(
|
|
424
424
|
(e) => t.subscribe(e),
|
|
425
425
|
() => t.getSnapshot(),
|
|
@@ -428,7 +428,7 @@ function jo(t) {
|
|
|
428
428
|
}
|
|
429
429
|
function fr() {
|
|
430
430
|
const t = $t();
|
|
431
|
-
return
|
|
431
|
+
return O(() => {
|
|
432
432
|
if (!t)
|
|
433
433
|
return;
|
|
434
434
|
let e = window.parent === window, r = null, n = [];
|
|
@@ -531,8 +531,8 @@ function fr() {
|
|
|
531
531
|
}
|
|
532
532
|
}
|
|
533
533
|
if (c.data?.type === "ikon-inspect-rect") {
|
|
534
|
-
const { x1: l, y1: m, x2: g, y2: b, append: S } = c.data,
|
|
535
|
-
for (const M of
|
|
534
|
+
const { x1: l, y1: m, x2: g, y2: b, append: S } = c.data, N = document.querySelectorAll("[data-ikon-source]"), _ = [];
|
|
535
|
+
for (const M of N) {
|
|
536
536
|
const L = M.getBoundingClientRect();
|
|
537
537
|
L.right > l && L.left < g && L.bottom > m && L.top < b && _.push({
|
|
538
538
|
sourceMarker: M.getAttribute("data-ikon-source") ?? "",
|
|
@@ -556,7 +556,7 @@ const pr = fe("IkonUiSurface"), Ue = "ikon-ui";
|
|
|
556
556
|
function hr(t, e) {
|
|
557
557
|
return t === e;
|
|
558
558
|
}
|
|
559
|
-
const
|
|
559
|
+
const mr = Y(function({ stores: e, registry: r, category: n = Ue, onAction: o, client: s }) {
|
|
560
560
|
const i = $(() => Array.from(e.keys()).sort().join(","), [e]), a = v(o);
|
|
561
561
|
a.current = o;
|
|
562
562
|
const u = v(s);
|
|
@@ -573,14 +573,14 @@ const Do = z(function({ stores: e, registry: r, category: n = Ue, onAction: o, c
|
|
|
573
573
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
574
574
|
[e, n, i]
|
|
575
575
|
), h = v(!1), p = f.length > 0;
|
|
576
|
-
return
|
|
576
|
+
return O(() => {
|
|
577
577
|
p && !h.current && (h.current = !0, pr.debug("First UI render"));
|
|
578
|
-
}, [p]), p ? /* @__PURE__ */
|
|
579
|
-
/* @__PURE__ */
|
|
580
|
-
f.map(({ key: y, store: c }) => /* @__PURE__ */
|
|
578
|
+
}, [p]), p ? /* @__PURE__ */ E.jsxs(E.Fragment, { children: [
|
|
579
|
+
/* @__PURE__ */ E.jsx(fr, {}),
|
|
580
|
+
f.map(({ key: y, store: c }) => /* @__PURE__ */ E.jsx(lr, { store: c, library: r, onAction: a.current, client: u.current, video: u.current?.media?.video }, y))
|
|
581
581
|
] }) : null;
|
|
582
582
|
});
|
|
583
|
-
class
|
|
583
|
+
class gr {
|
|
584
584
|
core;
|
|
585
585
|
ownsCore;
|
|
586
586
|
stores = /* @__PURE__ */ new Map();
|
|
@@ -655,7 +655,7 @@ class mr {
|
|
|
655
655
|
r(e);
|
|
656
656
|
}
|
|
657
657
|
}
|
|
658
|
-
function
|
|
658
|
+
function yr(t) {
|
|
659
659
|
if (typeof t == "string") {
|
|
660
660
|
const e = t.trim();
|
|
661
661
|
return e.length > 0 ? e : void 0;
|
|
@@ -680,10 +680,10 @@ function ze(...t) {
|
|
|
680
680
|
}
|
|
681
681
|
return e || void 0;
|
|
682
682
|
}
|
|
683
|
-
const tt = /* @__PURE__ */ new WeakMap(),
|
|
683
|
+
const tt = /* @__PURE__ */ new WeakMap(), br = {};
|
|
684
684
|
function Ye(t) {
|
|
685
685
|
if (!t)
|
|
686
|
-
return
|
|
686
|
+
return br;
|
|
687
687
|
const e = tt.get(t);
|
|
688
688
|
if (e)
|
|
689
689
|
return e;
|
|
@@ -692,7 +692,7 @@ function Ye(t) {
|
|
|
692
692
|
o != null && (typeof o == "string" || typeof o == "number" || typeof o == "boolean") && (r[n] = o);
|
|
693
693
|
return tt.set(t, r), r;
|
|
694
694
|
}
|
|
695
|
-
function
|
|
695
|
+
function Sr(t) {
|
|
696
696
|
let e = t.parentElement;
|
|
697
697
|
for (; e; ) {
|
|
698
698
|
const n = window.getComputedStyle(e).overflowY;
|
|
@@ -708,20 +708,20 @@ function yt(t, e) {
|
|
|
708
708
|
"scrollBehavior" in document.documentElement.style ? t.scrollTo({ top: o, behavior: "smooth" }) : t.scrollTop = o;
|
|
709
709
|
});
|
|
710
710
|
}
|
|
711
|
-
const je = "data-ikon-scroll-indicator",
|
|
711
|
+
const je = "data-ikon-scroll-indicator", wr = 0.15, Ee = "data-ikon-at-bottom";
|
|
712
712
|
function bt(t) {
|
|
713
|
-
return Math.max(t.clientHeight *
|
|
713
|
+
return Math.max(t.clientHeight * wr, 20);
|
|
714
714
|
}
|
|
715
|
-
function
|
|
715
|
+
function vr(t) {
|
|
716
716
|
return t.getAttribute(Ee) !== "false";
|
|
717
717
|
}
|
|
718
|
-
function
|
|
718
|
+
function Er(t) {
|
|
719
719
|
t.getAttribute(Ee) === null && (t.setAttribute(Ee, "true"), t.addEventListener("scroll", () => {
|
|
720
720
|
const { scrollTop: e, scrollHeight: r, clientHeight: n } = t, s = r - e - n <= bt(t);
|
|
721
721
|
t.setAttribute(Ee, s ? "true" : "false");
|
|
722
722
|
}, { passive: !0 }));
|
|
723
723
|
}
|
|
724
|
-
function
|
|
724
|
+
function Rr(t) {
|
|
725
725
|
const e = t.parentElement ?? t, r = e.querySelector(`[${je}]`);
|
|
726
726
|
if (r)
|
|
727
727
|
return r;
|
|
@@ -754,8 +754,8 @@ function Er(t) {
|
|
|
754
754
|
n.style.opacity = "0.9";
|
|
755
755
|
}), e.appendChild(n), n;
|
|
756
756
|
}
|
|
757
|
-
function
|
|
758
|
-
const r =
|
|
757
|
+
function kr(t, e) {
|
|
758
|
+
const r = Rr(t);
|
|
759
759
|
r.style.display = "flex";
|
|
760
760
|
const n = () => {
|
|
761
761
|
yt(t, e), r.style.display = "none";
|
|
@@ -767,10 +767,10 @@ function Rr(t, e) {
|
|
|
767
767
|
r.removeEventListener("click", n), t.removeEventListener("scroll", o);
|
|
768
768
|
};
|
|
769
769
|
}
|
|
770
|
-
function
|
|
771
|
-
const t =
|
|
770
|
+
function Ar() {
|
|
771
|
+
const t = Y(function({ nodeId: r, context: n }) {
|
|
772
772
|
const o = J(n.store, r), s = v(null), i = te(o?.props?.targetViewId), a = o?.props?.focusOnly, u = typeof a == "boolean" ? a : void 0, f = te(o?.props?.priority), h = te(o?.props?.key), p = o?.props?.preciseGeneratedAt;
|
|
773
|
-
return
|
|
773
|
+
return O(() => {
|
|
774
774
|
if (typeof document > "u")
|
|
775
775
|
return;
|
|
776
776
|
const c = s.current;
|
|
@@ -778,10 +778,10 @@ function kr() {
|
|
|
778
778
|
return;
|
|
779
779
|
let l;
|
|
780
780
|
if (u !== !0) {
|
|
781
|
-
const S =
|
|
781
|
+
const S = Sr(c);
|
|
782
782
|
if (S)
|
|
783
|
-
if (
|
|
784
|
-
l =
|
|
783
|
+
if (Er(S), f === "Polite" && !vr(S))
|
|
784
|
+
l = kr(S, c);
|
|
785
785
|
else {
|
|
786
786
|
const L = (S.parentElement ?? S).querySelector(`[${je}]`);
|
|
787
787
|
L && (L.style.display = "none"), yt(S, c);
|
|
@@ -802,7 +802,7 @@ function kr() {
|
|
|
802
802
|
c.focus();
|
|
803
803
|
}
|
|
804
804
|
return l;
|
|
805
|
-
}, [u, f, i, h, p]), o ? /* @__PURE__ */
|
|
805
|
+
}, [u, f, i, h, p]), o ? /* @__PURE__ */ E.jsx(
|
|
806
806
|
"span",
|
|
807
807
|
{
|
|
808
808
|
ref: s,
|
|
@@ -819,9 +819,9 @@ function kr() {
|
|
|
819
819
|
return t;
|
|
820
820
|
};
|
|
821
821
|
}
|
|
822
|
-
function
|
|
823
|
-
const t =
|
|
824
|
-
const s = J(n.store, r), i =
|
|
822
|
+
function Tr() {
|
|
823
|
+
const t = Y(function({ nodeId: r, context: n, className: o }) {
|
|
824
|
+
const s = J(n.store, r), i = yr(s?.props?.onInvokeId), a = U(() => {
|
|
825
825
|
i && n.dispatchAction(i);
|
|
826
826
|
}, [i, n]);
|
|
827
827
|
if (!s)
|
|
@@ -829,7 +829,7 @@ function Ar() {
|
|
|
829
829
|
const u = Ye(s.props);
|
|
830
830
|
delete u.onInvokeId;
|
|
831
831
|
const f = ze(te(s.props?.className), o), h = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
832
|
-
return /* @__PURE__ */
|
|
832
|
+
return /* @__PURE__ */ E.jsx(
|
|
833
833
|
"div",
|
|
834
834
|
{
|
|
835
835
|
...u,
|
|
@@ -847,45 +847,45 @@ function Ar() {
|
|
|
847
847
|
return t;
|
|
848
848
|
};
|
|
849
849
|
}
|
|
850
|
-
function
|
|
851
|
-
const t =
|
|
850
|
+
function Cr() {
|
|
851
|
+
const t = Y(function({ nodeId: r, context: n, className: o }) {
|
|
852
852
|
const s = J(n.store, r);
|
|
853
853
|
if (!s)
|
|
854
854
|
return null;
|
|
855
855
|
const i = Ye(s.props), a = ze("relative", te(s.props?.className), o), u = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
856
|
-
return /* @__PURE__ */
|
|
856
|
+
return /* @__PURE__ */ E.jsx("div", { ...i, "data-ikon-node-id": s.id, "data-ikon-source": s.sourceMarker, className: a, children: u });
|
|
857
857
|
});
|
|
858
858
|
return ({ type: e }) => {
|
|
859
859
|
if (e === "std.stack")
|
|
860
860
|
return t;
|
|
861
861
|
};
|
|
862
862
|
}
|
|
863
|
-
function
|
|
864
|
-
const t =
|
|
863
|
+
function Ir() {
|
|
864
|
+
const t = Y(function({ nodeId: r, context: n, className: o }) {
|
|
865
865
|
const s = J(n.store, r);
|
|
866
866
|
if (!s)
|
|
867
867
|
return null;
|
|
868
868
|
const i = Ye(s.props), a = ze("absolute", te(s.props?.className), o), u = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
869
|
-
return /* @__PURE__ */
|
|
869
|
+
return /* @__PURE__ */ E.jsx("div", { ...i, "data-ikon-node-id": s.id, "data-ikon-source": s.sourceMarker, className: a, children: u });
|
|
870
870
|
});
|
|
871
871
|
return ({ type: e }) => {
|
|
872
872
|
if (e === "std.layer")
|
|
873
873
|
return t;
|
|
874
874
|
};
|
|
875
875
|
}
|
|
876
|
-
function
|
|
876
|
+
function _r() {
|
|
877
877
|
return [
|
|
878
|
-
Ar(),
|
|
879
878
|
Tr(),
|
|
880
879
|
Cr(),
|
|
881
|
-
|
|
880
|
+
Ir(),
|
|
881
|
+
Ar()
|
|
882
882
|
];
|
|
883
883
|
}
|
|
884
|
-
const
|
|
885
|
-
function Nr(t) {
|
|
886
|
-
t.registerModule(_r, Or);
|
|
887
|
-
}
|
|
884
|
+
const Or = "base", Nr = async () => _r();
|
|
888
885
|
function Pr(t) {
|
|
886
|
+
t.registerModule(Or, Nr);
|
|
887
|
+
}
|
|
888
|
+
function Mr(t) {
|
|
889
889
|
if (typeof t == "string") {
|
|
890
890
|
const e = t.trim();
|
|
891
891
|
return e.length > 0 ? e : void 0;
|
|
@@ -895,7 +895,7 @@ function Pr(t) {
|
|
|
895
895
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
896
896
|
}
|
|
897
897
|
}
|
|
898
|
-
function
|
|
898
|
+
function Lr(...t) {
|
|
899
899
|
const e = [];
|
|
900
900
|
for (const r of t)
|
|
901
901
|
r && r.trim() && e.push(r.trim());
|
|
@@ -916,21 +916,21 @@ function we(t) {
|
|
|
916
916
|
if (e === "false") return !1;
|
|
917
917
|
}
|
|
918
918
|
}
|
|
919
|
-
const
|
|
920
|
-
function
|
|
921
|
-
const t =
|
|
919
|
+
const xr = "std.audio-url-player";
|
|
920
|
+
function Ur() {
|
|
921
|
+
const t = Y(function({
|
|
922
922
|
nodeId: r,
|
|
923
923
|
context: n,
|
|
924
924
|
className: o
|
|
925
925
|
}) {
|
|
926
926
|
const s = J(n.store, r), i = v(null), a = s ? we(s.props?.autoplay) : void 0, u = s ? rt(s.props?.src) : void 0;
|
|
927
|
-
if (
|
|
927
|
+
if (O(() => {
|
|
928
928
|
a && i.current && i.current.play().catch(() => {
|
|
929
929
|
});
|
|
930
930
|
}, [a, u]), !s)
|
|
931
931
|
return null;
|
|
932
|
-
const f = Mr(
|
|
933
|
-
return /* @__PURE__ */
|
|
932
|
+
const f = Lr(Mr(s.props?.className), o), h = rt(s.props?.preload), p = we(s.props?.controls), y = we(s.props?.loop), c = we(s.props?.muted);
|
|
933
|
+
return /* @__PURE__ */ E.jsx(
|
|
934
934
|
"audio",
|
|
935
935
|
{
|
|
936
936
|
ref: i,
|
|
@@ -947,7 +947,7 @@ function xr() {
|
|
|
947
947
|
);
|
|
948
948
|
});
|
|
949
949
|
return ({ type: e }) => {
|
|
950
|
-
if (e ===
|
|
950
|
+
if (e === xr)
|
|
951
951
|
return t;
|
|
952
952
|
};
|
|
953
953
|
}
|
|
@@ -982,11 +982,11 @@ function De(t) {
|
|
|
982
982
|
const e = t.trim();
|
|
983
983
|
return e.length > 0 ? e : void 0;
|
|
984
984
|
}
|
|
985
|
-
const
|
|
986
|
-
function
|
|
987
|
-
const t =
|
|
988
|
-
const s = J(n.store, r), i = v(null), a = v(null), u = n.video, f = n.client, h = s ? De(s.props?.streamId) : void 0, p = s ? Re(s.props?.width) : void 0, y = s ? Re(s.props?.height) : void 0, c = s ? wt(St(s.props?.className), o) : o, [, l] =
|
|
989
|
-
|
|
985
|
+
const jr = "std.video-canvas", Dr = "std.video-url-player";
|
|
986
|
+
function Br() {
|
|
987
|
+
const t = Y(function({ nodeId: r, context: n, className: o }) {
|
|
988
|
+
const s = J(n.store, r), i = v(null), a = v(null), u = n.video, f = n.client, h = s ? De(s.props?.streamId) : void 0, p = s ? Re(s.props?.width) : void 0, y = s ? Re(s.props?.height) : void 0, c = s ? wt(St(s.props?.className), o) : o, [, l] = z(0);
|
|
989
|
+
O(() => {
|
|
990
990
|
if (!f?.isWebRtcEnabled) return;
|
|
991
991
|
const g = f.onWebRtcTrackMapChanged;
|
|
992
992
|
return f.onWebRtcTrackMapChanged = (b) => {
|
|
@@ -996,19 +996,19 @@ function Dr() {
|
|
|
996
996
|
};
|
|
997
997
|
}, [f]);
|
|
998
998
|
const m = f?.isWebRtcEnabled && h ? f.getWebRtcVideoStreamByStreamId(h) : null;
|
|
999
|
-
return
|
|
999
|
+
return O(() => {
|
|
1000
1000
|
const g = i.current;
|
|
1001
1001
|
if (!(!u || !g || !h || m))
|
|
1002
1002
|
return u.attachCanvas(h, g), () => {
|
|
1003
1003
|
u.detachCanvas(h);
|
|
1004
1004
|
};
|
|
1005
|
-
}, [u, h, m]),
|
|
1005
|
+
}, [u, h, m]), O(() => {
|
|
1006
1006
|
const g = a.current;
|
|
1007
1007
|
if (!(!g || !m))
|
|
1008
1008
|
return g.srcObject = m, () => {
|
|
1009
1009
|
g.srcObject = null;
|
|
1010
1010
|
};
|
|
1011
|
-
}, [m]), s ? m ? /* @__PURE__ */
|
|
1011
|
+
}, [m]), s ? m ? /* @__PURE__ */ E.jsx(
|
|
1012
1012
|
"video",
|
|
1013
1013
|
{
|
|
1014
1014
|
ref: a,
|
|
@@ -1023,7 +1023,7 @@ function Dr() {
|
|
|
1023
1023
|
...y ? { height: y } : {}
|
|
1024
1024
|
},
|
|
1025
1025
|
h
|
|
1026
|
-
) : /* @__PURE__ */
|
|
1026
|
+
) : /* @__PURE__ */ E.jsx(
|
|
1027
1027
|
"canvas",
|
|
1028
1028
|
{
|
|
1029
1029
|
ref: i,
|
|
@@ -1038,12 +1038,12 @@ function Dr() {
|
|
|
1038
1038
|
) : null;
|
|
1039
1039
|
});
|
|
1040
1040
|
return ({ type: e }) => {
|
|
1041
|
-
if (e ===
|
|
1041
|
+
if (e === jr)
|
|
1042
1042
|
return t;
|
|
1043
1043
|
};
|
|
1044
1044
|
}
|
|
1045
|
-
function
|
|
1046
|
-
return [
|
|
1045
|
+
function Fr() {
|
|
1046
|
+
return [Br(), $r(), Ur()];
|
|
1047
1047
|
}
|
|
1048
1048
|
function ce(t) {
|
|
1049
1049
|
if (typeof t == "boolean")
|
|
@@ -1054,20 +1054,20 @@ function ce(t) {
|
|
|
1054
1054
|
if (e === "false") return !1;
|
|
1055
1055
|
}
|
|
1056
1056
|
}
|
|
1057
|
-
function
|
|
1058
|
-
const t =
|
|
1057
|
+
function $r() {
|
|
1058
|
+
const t = Y(function({
|
|
1059
1059
|
nodeId: r,
|
|
1060
1060
|
context: n,
|
|
1061
1061
|
className: o
|
|
1062
1062
|
}) {
|
|
1063
1063
|
const s = J(n.store, r), i = v(null), a = s ? ce(s.props?.autoplay) : void 0, u = s ? De(s.props?.src) : void 0;
|
|
1064
|
-
if (
|
|
1064
|
+
if (O(() => {
|
|
1065
1065
|
a && i.current && i.current.play().catch(() => {
|
|
1066
1066
|
});
|
|
1067
1067
|
}, [a, u]), !s)
|
|
1068
1068
|
return null;
|
|
1069
1069
|
const f = wt(St(s.props?.className), o), h = De(s.props?.poster), p = ce(s.props?.controls), y = ce(s.props?.loop), c = ce(s.props?.muted), l = ce(s.props?.playsInline), m = Re(s.props?.width), g = Re(s.props?.height), b = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
1070
|
-
return /* @__PURE__ */
|
|
1070
|
+
return /* @__PURE__ */ E.jsx(
|
|
1071
1071
|
"video",
|
|
1072
1072
|
{
|
|
1073
1073
|
ref: i,
|
|
@@ -1088,27 +1088,27 @@ function Fr() {
|
|
|
1088
1088
|
);
|
|
1089
1089
|
});
|
|
1090
1090
|
return ({ type: e }) => {
|
|
1091
|
-
if (e ===
|
|
1091
|
+
if (e === Dr)
|
|
1092
1092
|
return t;
|
|
1093
1093
|
};
|
|
1094
1094
|
}
|
|
1095
|
-
const
|
|
1096
|
-
function
|
|
1097
|
-
t.registerModule(
|
|
1095
|
+
const Vr = "media", Kr = async () => Fr();
|
|
1096
|
+
function zr(t) {
|
|
1097
|
+
t.registerModule(Vr, Kr);
|
|
1098
1098
|
}
|
|
1099
|
-
const
|
|
1099
|
+
const Yr = `#version 300 es
|
|
1100
1100
|
in vec4 a_position;
|
|
1101
1101
|
void main() {
|
|
1102
1102
|
gl_Position = a_position;
|
|
1103
1103
|
}
|
|
1104
1104
|
`;
|
|
1105
|
-
function
|
|
1105
|
+
function Wr(t, e) {
|
|
1106
1106
|
return new RegExp(`\\buniform\\s+\\w+\\s+${e}\\s*;`, "g").test(t);
|
|
1107
1107
|
}
|
|
1108
|
-
function
|
|
1108
|
+
function qr(t, e) {
|
|
1109
1109
|
const r = [];
|
|
1110
1110
|
for (const [n, o] of Object.entries(e)) {
|
|
1111
|
-
if (
|
|
1111
|
+
if (Wr(t, n))
|
|
1112
1112
|
continue;
|
|
1113
1113
|
let s;
|
|
1114
1114
|
switch (o.type) {
|
|
@@ -1161,7 +1161,7 @@ void main() {
|
|
|
1161
1161
|
}
|
|
1162
1162
|
`;
|
|
1163
1163
|
}
|
|
1164
|
-
class
|
|
1164
|
+
class Hr {
|
|
1165
1165
|
gl;
|
|
1166
1166
|
program = null;
|
|
1167
1167
|
positionBuffer = null;
|
|
@@ -1197,10 +1197,10 @@ class qr {
|
|
|
1197
1197
|
}
|
|
1198
1198
|
compile(e, r = {}) {
|
|
1199
1199
|
this.lastError = null, this.customUniforms = r, this.currentShaderSource = e;
|
|
1200
|
-
const n = this.gl, o = this.compileShader(n.VERTEX_SHADER,
|
|
1200
|
+
const n = this.gl, o = this.compileShader(n.VERTEX_SHADER, Yr);
|
|
1201
1201
|
if (!o)
|
|
1202
1202
|
return !1;
|
|
1203
|
-
const s =
|
|
1203
|
+
const s = qr(e, r), i = this.compileShader(n.FRAGMENT_SHADER, s);
|
|
1204
1204
|
if (!i)
|
|
1205
1205
|
return n.deleteShader(o), !1;
|
|
1206
1206
|
const a = n.createProgram();
|
|
@@ -1291,7 +1291,7 @@ class qr {
|
|
|
1291
1291
|
this.program && (e.deleteProgram(this.program), this.program = null), this.positionBuffer && (e.deleteBuffer(this.positionBuffer), this.positionBuffer = null), this.vao && (e.deleteVertexArray(this.vao), this.vao = null), this.uniformLocations.clear();
|
|
1292
1292
|
}
|
|
1293
1293
|
}
|
|
1294
|
-
function
|
|
1294
|
+
function Gr(t) {
|
|
1295
1295
|
if (typeof t == "string") {
|
|
1296
1296
|
const e = t.trim();
|
|
1297
1297
|
return e.length > 0 ? e : void 0;
|
|
@@ -1301,7 +1301,7 @@ function Hr(t) {
|
|
|
1301
1301
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
1302
1302
|
}
|
|
1303
1303
|
}
|
|
1304
|
-
function
|
|
1304
|
+
function Jr(...t) {
|
|
1305
1305
|
const e = [];
|
|
1306
1306
|
for (const r of t)
|
|
1307
1307
|
r && r.trim() && e.push(r.trim());
|
|
@@ -1316,10 +1316,10 @@ function Ie(t) {
|
|
|
1316
1316
|
return Math.floor(e);
|
|
1317
1317
|
}
|
|
1318
1318
|
}
|
|
1319
|
-
function
|
|
1319
|
+
function Xr(t) {
|
|
1320
1320
|
return typeof t == "string" ? t : "";
|
|
1321
1321
|
}
|
|
1322
|
-
function
|
|
1322
|
+
function Zr(t) {
|
|
1323
1323
|
if (typeof t == "boolean")
|
|
1324
1324
|
return t;
|
|
1325
1325
|
if (typeof t == "string") {
|
|
@@ -1328,7 +1328,7 @@ function Xr(t) {
|
|
|
1328
1328
|
if (e === "false") return !1;
|
|
1329
1329
|
}
|
|
1330
1330
|
}
|
|
1331
|
-
function
|
|
1331
|
+
function Qr(t) {
|
|
1332
1332
|
if (!t || typeof t != "object")
|
|
1333
1333
|
return {};
|
|
1334
1334
|
const e = {}, r = t;
|
|
@@ -1343,7 +1343,7 @@ function Zr(t) {
|
|
|
1343
1343
|
}
|
|
1344
1344
|
return e;
|
|
1345
1345
|
}
|
|
1346
|
-
function
|
|
1346
|
+
function en(t, e) {
|
|
1347
1347
|
const r = Object.keys(t), n = Object.keys(e);
|
|
1348
1348
|
if (r.length !== n.length)
|
|
1349
1349
|
return !1;
|
|
@@ -1364,30 +1364,30 @@ function Qr(t, e) {
|
|
|
1364
1364
|
}
|
|
1365
1365
|
return !0;
|
|
1366
1366
|
}
|
|
1367
|
-
const
|
|
1368
|
-
function
|
|
1369
|
-
const t =
|
|
1367
|
+
const tn = "std.shadertoy-canvas";
|
|
1368
|
+
function rn() {
|
|
1369
|
+
const t = Y(function({ nodeId: r, context: n, className: o }) {
|
|
1370
1370
|
const s = J(n.store, r), i = v(null), a = v(null), u = v(null), f = v(0), h = v(""), p = v({}), y = v({
|
|
1371
1371
|
x: 0,
|
|
1372
1372
|
y: 0,
|
|
1373
1373
|
clickX: 0,
|
|
1374
1374
|
clickY: 0,
|
|
1375
1375
|
isDown: !1
|
|
1376
|
-
}), c = s ?
|
|
1377
|
-
|
|
1376
|
+
}), c = s ? Xr(s.props?.shaderSource) : "", l = s ? Ie(s.props?.fps) ?? 60 : 60, m = s?.props?.uniforms, g = $(() => Qr(m), [m]), b = s ? Zr(s.props?.enableMouse) ?? !0 : !0, S = s ? Ie(s.props?.width) : void 0, N = s ? Ie(s.props?.height) : void 0, _ = s ? Jr(Gr(s.props?.className), o) : o;
|
|
1377
|
+
O(() => {
|
|
1378
1378
|
const T = i.current;
|
|
1379
1379
|
if (T) {
|
|
1380
1380
|
try {
|
|
1381
|
-
const
|
|
1382
|
-
a.current =
|
|
1383
|
-
} catch (
|
|
1384
|
-
console.error("[ShadertoyRenderer] Failed to create WebGL2 context:",
|
|
1381
|
+
const P = new Hr(T);
|
|
1382
|
+
a.current = P;
|
|
1383
|
+
} catch (P) {
|
|
1384
|
+
console.error("[ShadertoyRenderer] Failed to create WebGL2 context:", P);
|
|
1385
1385
|
}
|
|
1386
1386
|
return () => {
|
|
1387
1387
|
a.current && (a.current.destroy(), a.current = null);
|
|
1388
1388
|
};
|
|
1389
1389
|
}
|
|
1390
|
-
}, []),
|
|
1390
|
+
}, []), O(() => {
|
|
1391
1391
|
const T = a.current;
|
|
1392
1392
|
if (!(!T || !c) && h.current !== c)
|
|
1393
1393
|
if (T.compile(c, g))
|
|
@@ -1396,15 +1396,15 @@ function tn() {
|
|
|
1396
1396
|
const D = T.getError();
|
|
1397
1397
|
console.error("[ShadertoyRenderer] Shader compilation failed:", D);
|
|
1398
1398
|
}
|
|
1399
|
-
}, [c, g]),
|
|
1399
|
+
}, [c, g]), O(() => {
|
|
1400
1400
|
const T = a.current;
|
|
1401
|
-
!T || !h.current ||
|
|
1402
|
-
}, [g]),
|
|
1401
|
+
!T || !h.current || en(p.current, g) || (T.setCustomUniforms(g), p.current = g);
|
|
1402
|
+
}, [g]), O(() => {
|
|
1403
1403
|
const T = a.current;
|
|
1404
1404
|
if (!T || !h.current) return;
|
|
1405
|
-
const
|
|
1405
|
+
const P = 1e3 / l, D = (j) => {
|
|
1406
1406
|
const B = j - f.current;
|
|
1407
|
-
B >=
|
|
1407
|
+
B >= P && (f.current = j - B % P, T.draw()), u.current = requestAnimationFrame(D);
|
|
1408
1408
|
};
|
|
1409
1409
|
return u.current = requestAnimationFrame(D), () => {
|
|
1410
1410
|
u.current !== null && (cancelAnimationFrame(u.current), u.current = null);
|
|
@@ -1413,25 +1413,25 @@ function tn() {
|
|
|
1413
1413
|
const M = U(
|
|
1414
1414
|
(T) => {
|
|
1415
1415
|
if (!b) return;
|
|
1416
|
-
const
|
|
1417
|
-
if (!
|
|
1418
|
-
const j =
|
|
1416
|
+
const P = i.current, D = a.current;
|
|
1417
|
+
if (!P || !D) return;
|
|
1418
|
+
const j = P.getBoundingClientRect(), B = T.clientX - j.left, V = j.height - (T.clientY - j.top);
|
|
1419
1419
|
y.current.x = B, y.current.y = V, D.setMouse(B, V, y.current.clickX, y.current.clickY);
|
|
1420
1420
|
},
|
|
1421
1421
|
[b]
|
|
1422
1422
|
), L = U(
|
|
1423
1423
|
(T) => {
|
|
1424
1424
|
if (!b) return;
|
|
1425
|
-
const
|
|
1426
|
-
if (!
|
|
1427
|
-
const j =
|
|
1425
|
+
const P = i.current, D = a.current;
|
|
1426
|
+
if (!P || !D) return;
|
|
1427
|
+
const j = P.getBoundingClientRect(), B = T.clientX - j.left, V = j.height - (T.clientY - j.top);
|
|
1428
1428
|
y.current.isDown = !0, y.current.clickX = B, y.current.clickY = V, D.setMouse(B, V, B, V);
|
|
1429
1429
|
},
|
|
1430
1430
|
[b]
|
|
1431
1431
|
), G = U(() => {
|
|
1432
1432
|
b && (y.current.isDown = !1, y.current.clickX = -Math.abs(y.current.clickX));
|
|
1433
1433
|
}, [b]);
|
|
1434
|
-
return s ? /* @__PURE__ */
|
|
1434
|
+
return s ? /* @__PURE__ */ E.jsx(
|
|
1435
1435
|
"canvas",
|
|
1436
1436
|
{
|
|
1437
1437
|
ref: i,
|
|
@@ -1439,7 +1439,7 @@ function tn() {
|
|
|
1439
1439
|
"data-ikon-source": s.sourceMarker,
|
|
1440
1440
|
className: _,
|
|
1441
1441
|
...S ? { width: S } : {},
|
|
1442
|
-
...
|
|
1442
|
+
...N ? { height: N } : {},
|
|
1443
1443
|
onMouseMove: M,
|
|
1444
1444
|
onMouseDown: L,
|
|
1445
1445
|
onMouseUp: G,
|
|
@@ -1448,16 +1448,16 @@ function tn() {
|
|
|
1448
1448
|
) : null;
|
|
1449
1449
|
});
|
|
1450
1450
|
return ({ type: e }) => {
|
|
1451
|
-
if (e ===
|
|
1451
|
+
if (e === tn)
|
|
1452
1452
|
return t;
|
|
1453
1453
|
};
|
|
1454
1454
|
}
|
|
1455
|
-
const
|
|
1456
|
-
function
|
|
1457
|
-
t.registerModule(
|
|
1455
|
+
const nn = "shadertoy", on = async () => rn();
|
|
1456
|
+
function sn(t) {
|
|
1457
|
+
t.registerModule(nn, on);
|
|
1458
1458
|
}
|
|
1459
1459
|
const nt = fe("UIRegistry");
|
|
1460
|
-
class
|
|
1460
|
+
class an {
|
|
1461
1461
|
baseResolvers = [];
|
|
1462
1462
|
moduleLoaders = /* @__PURE__ */ new Map();
|
|
1463
1463
|
moduleResolvers = /* @__PURE__ */ new Map();
|
|
@@ -1479,7 +1479,7 @@ class sn {
|
|
|
1479
1479
|
for (const [n, o] of this.moduleLoaders.entries())
|
|
1480
1480
|
if (!this.moduleResolvers.has(n))
|
|
1481
1481
|
try {
|
|
1482
|
-
const s = await o(), i =
|
|
1482
|
+
const s = await o(), i = ln(s);
|
|
1483
1483
|
this.moduleResolvers.set(n, i), e = !0;
|
|
1484
1484
|
} catch (s) {
|
|
1485
1485
|
nt.error(`[IkonUiRegistry] Failed to load module '${n}'.`, s);
|
|
@@ -1487,7 +1487,7 @@ class sn {
|
|
|
1487
1487
|
const r = [];
|
|
1488
1488
|
for (const n of this.moduleLoaders.keys())
|
|
1489
1489
|
this.moduleResolvers.has(n) && r.push(n);
|
|
1490
|
-
return
|
|
1490
|
+
return dn(r, this.activeModuleOrder) || (this.activeModuleOrder = r, e = !0), e;
|
|
1491
1491
|
}
|
|
1492
1492
|
resolve(e) {
|
|
1493
1493
|
for (const r of this.baseResolvers) {
|
|
@@ -1507,17 +1507,17 @@ class sn {
|
|
|
1507
1507
|
}
|
|
1508
1508
|
}
|
|
1509
1509
|
}
|
|
1510
|
-
function
|
|
1511
|
-
const t = new
|
|
1512
|
-
return
|
|
1510
|
+
function cn() {
|
|
1511
|
+
const t = new an();
|
|
1512
|
+
return Pr(t), zr(t), sn(t), t.loadRegisteredModules(), t;
|
|
1513
1513
|
}
|
|
1514
|
-
function
|
|
1514
|
+
function un(t) {
|
|
1515
1515
|
return Array.isArray(t) ? t : [t];
|
|
1516
1516
|
}
|
|
1517
|
-
function
|
|
1518
|
-
return t ?
|
|
1517
|
+
function ln(t) {
|
|
1518
|
+
return t ? un(t).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
|
|
1519
1519
|
}
|
|
1520
|
-
function
|
|
1520
|
+
function dn(t, e) {
|
|
1521
1521
|
if (t.length !== e.length)
|
|
1522
1522
|
return !1;
|
|
1523
1523
|
for (let r = 0; r < t.length; r += 1)
|
|
@@ -1525,6 +1525,18 @@ function ln(t, e) {
|
|
|
1525
1525
|
return !1;
|
|
1526
1526
|
return !0;
|
|
1527
1527
|
}
|
|
1528
|
+
function Bo({ mount: t, stores: e, registry: r, client: n, onAction: o }) {
|
|
1529
|
+
return /* @__PURE__ */ E.jsx(
|
|
1530
|
+
mr,
|
|
1531
|
+
{
|
|
1532
|
+
stores: e,
|
|
1533
|
+
registry: r,
|
|
1534
|
+
category: t,
|
|
1535
|
+
client: n,
|
|
1536
|
+
onAction: o
|
|
1537
|
+
}
|
|
1538
|
+
);
|
|
1539
|
+
}
|
|
1528
1540
|
const _e = fe("MotionController"), ot = {
|
|
1529
1541
|
ease: [0.25, 0.1, 0.25, 1],
|
|
1530
1542
|
"ease-in": [0.42, 0, 1, 1],
|
|
@@ -1578,25 +1590,25 @@ function at(t, e, r, n) {
|
|
|
1578
1590
|
}
|
|
1579
1591
|
function c(g, b) {
|
|
1580
1592
|
for (let S = 0; S < 4; S += 1) {
|
|
1581
|
-
const
|
|
1582
|
-
if (
|
|
1593
|
+
const N = y(b, t, r);
|
|
1594
|
+
if (N === 0)
|
|
1583
1595
|
return b;
|
|
1584
1596
|
const _ = p(b, t, r) - g;
|
|
1585
|
-
b -= _ /
|
|
1597
|
+
b -= _ / N;
|
|
1586
1598
|
}
|
|
1587
1599
|
return b;
|
|
1588
1600
|
}
|
|
1589
1601
|
function l(g, b, S) {
|
|
1590
|
-
let
|
|
1602
|
+
let N = 0, _ = 0, M = 0;
|
|
1591
1603
|
do
|
|
1592
|
-
_ = b + (S - b) / 2,
|
|
1593
|
-
while (Math.abs(
|
|
1604
|
+
_ = b + (S - b) / 2, N = p(_, t, r) - g, N > 0 ? S = _ : b = _;
|
|
1605
|
+
while (Math.abs(N) > 1e-7 && ++M < 10);
|
|
1594
1606
|
return _;
|
|
1595
1607
|
}
|
|
1596
1608
|
function m(g) {
|
|
1597
1609
|
let b = 0, S = 1;
|
|
1598
|
-
const
|
|
1599
|
-
for (; S !==
|
|
1610
|
+
const N = 10;
|
|
1611
|
+
for (; S !== N && h[S] <= g; S += 1)
|
|
1600
1612
|
b += 0.1;
|
|
1601
1613
|
S -= 1;
|
|
1602
1614
|
const _ = (g - h[S]) / (h[S + 1] - h[S]), M = b + _ * 0.1, L = y(M, t, r);
|
|
@@ -1606,14 +1618,14 @@ function at(t, e, r, n) {
|
|
|
1606
1618
|
h[g] = p(g * 0.1, t, r);
|
|
1607
1619
|
return (g) => g <= 0 ? 0 : g >= 1 ? 1 : p(m(g), e, n);
|
|
1608
1620
|
}
|
|
1609
|
-
function
|
|
1621
|
+
function fn(t) {
|
|
1610
1622
|
const e = /steps\(\s*([0-9]+)\s*(?:,\s*([a-z-]+)\s*)?\)/i.exec(t);
|
|
1611
1623
|
if (!e)
|
|
1612
1624
|
return (o) => F(o);
|
|
1613
1625
|
const r = Math.max(1, parseInt(e[1], 10)), n = (e[2] ?? "end").toLowerCase();
|
|
1614
1626
|
return n === "start" || n === "jump-start" ? (o) => F(Math.ceil(o * r) / r) : n === "none" || n === "jump-none" ? (o) => F(Math.round(o * r) / r) : n === "both" || n === "jump-both" ? (o) => F((Math.floor(o * r) + 0.5) / r) : (o) => F(Math.floor(o * r) / r);
|
|
1615
1627
|
}
|
|
1616
|
-
function
|
|
1628
|
+
function pn(t) {
|
|
1617
1629
|
if (!t)
|
|
1618
1630
|
return (r) => F(r);
|
|
1619
1631
|
const e = t.trim().toLowerCase();
|
|
@@ -1631,12 +1643,12 @@ function fn(t) {
|
|
|
1631
1643
|
}
|
|
1632
1644
|
}
|
|
1633
1645
|
if (e.startsWith("steps(") && e.endsWith(")")) {
|
|
1634
|
-
const r =
|
|
1646
|
+
const r = fn(e);
|
|
1635
1647
|
return (n) => r(F(n));
|
|
1636
1648
|
}
|
|
1637
1649
|
return (r) => F(r);
|
|
1638
1650
|
}
|
|
1639
|
-
function
|
|
1651
|
+
function hn(t) {
|
|
1640
1652
|
if (!t)
|
|
1641
1653
|
return;
|
|
1642
1654
|
const e = /(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)\s*->\s*(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)/.exec(t);
|
|
@@ -1646,7 +1658,7 @@ function pn(t) {
|
|
|
1646
1658
|
if (![r, n, o, s].some((i) => !Number.isFinite(i)))
|
|
1647
1659
|
return { inStart: r, inEnd: n, outStart: o, outEnd: s };
|
|
1648
1660
|
}
|
|
1649
|
-
class
|
|
1661
|
+
class mn {
|
|
1650
1662
|
bindingsByStyle = /* @__PURE__ */ new Map();
|
|
1651
1663
|
observer;
|
|
1652
1664
|
observeScheduled = !1;
|
|
@@ -1691,7 +1703,7 @@ class hn {
|
|
|
1691
1703
|
const r = e.source?.trim();
|
|
1692
1704
|
if (!r)
|
|
1693
1705
|
return;
|
|
1694
|
-
const n = st(e.min) ?? 0, o = st(e.max), s = o === void 0 ? n + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, u =
|
|
1706
|
+
const n = st(e.min) ?? 0, o = st(e.max), s = o === void 0 ? n + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, u = pn(e.ease), f = hn(e.map), h = e.targetId?.trim() || void 0;
|
|
1695
1707
|
return Number.isNaN(n) || Number.isNaN(s) ? void 0 : {
|
|
1696
1708
|
source: r.toLowerCase(),
|
|
1697
1709
|
min: n,
|
|
@@ -1904,8 +1916,8 @@ class hn {
|
|
|
1904
1916
|
}
|
|
1905
1917
|
}
|
|
1906
1918
|
}
|
|
1907
|
-
const Oe = new
|
|
1908
|
-
function
|
|
1919
|
+
const Oe = new mn();
|
|
1920
|
+
function gn(t) {
|
|
1909
1921
|
const e = v(/* @__PURE__ */ new Map()), r = U(({ styleId: s, css: i, common: a }) => {
|
|
1910
1922
|
if (!(!s || typeof document > "u")) {
|
|
1911
1923
|
if (i) {
|
|
@@ -1928,7 +1940,7 @@ function mn(t) {
|
|
|
1928
1940
|
}
|
|
1929
1941
|
Oe.reset();
|
|
1930
1942
|
}, []);
|
|
1931
|
-
return
|
|
1943
|
+
return O(() => {
|
|
1932
1944
|
if (!t) return;
|
|
1933
1945
|
for (const a of t.getUiStyles())
|
|
1934
1946
|
r(a);
|
|
@@ -1936,9 +1948,9 @@ function mn(t) {
|
|
|
1936
1948
|
return () => {
|
|
1937
1949
|
s?.(), i?.(), o();
|
|
1938
1950
|
};
|
|
1939
|
-
}, [t, o, r, n]),
|
|
1951
|
+
}, [t, o, r, n]), O(() => () => o(), [o]), { setStyle: r, deleteStyles: n, reset: o };
|
|
1940
1952
|
}
|
|
1941
|
-
function
|
|
1953
|
+
function yn(t) {
|
|
1942
1954
|
const e = [];
|
|
1943
1955
|
for (const [r, n] of t) {
|
|
1944
1956
|
const o = n.store.getSnapshot(), s = o.rootViewId && o.views.has(o.rootViewId);
|
|
@@ -1946,62 +1958,62 @@ function gn(t) {
|
|
|
1946
1958
|
}
|
|
1947
1959
|
return e.sort(), e.join(",");
|
|
1948
1960
|
}
|
|
1949
|
-
function
|
|
1950
|
-
const [e, r] =
|
|
1951
|
-
return
|
|
1961
|
+
function bn(t) {
|
|
1962
|
+
const [e, r] = z(), n = v("");
|
|
1963
|
+
return O(() => {
|
|
1952
1964
|
if (!t) {
|
|
1953
1965
|
r(void 0), n.current = "";
|
|
1954
1966
|
return;
|
|
1955
1967
|
}
|
|
1956
1968
|
const o = () => {
|
|
1957
|
-
const s = t.getStores(), i =
|
|
1969
|
+
const s = t.getStores(), i = yn(s);
|
|
1958
1970
|
i !== n.current && (n.current = i, r(s));
|
|
1959
1971
|
};
|
|
1960
1972
|
return o(), t.subscribe(o);
|
|
1961
1973
|
}, [t]), e;
|
|
1962
1974
|
}
|
|
1963
|
-
var
|
|
1964
|
-
function
|
|
1965
|
-
var e =
|
|
1975
|
+
var Sn = typeof global == "object" && global && global.Object === Object && global, wn = typeof self == "object" && self && self.Object === Object && self, vn = Sn || wn || Function("return this")(), ke = vn.Symbol, vt = Object.prototype, En = vt.hasOwnProperty, Rn = vt.toString, ue = ke ? ke.toStringTag : void 0;
|
|
1976
|
+
function kn(t) {
|
|
1977
|
+
var e = En.call(t, ue), r = t[ue];
|
|
1966
1978
|
try {
|
|
1967
1979
|
t[ue] = void 0;
|
|
1968
1980
|
var n = !0;
|
|
1969
1981
|
} catch {
|
|
1970
1982
|
}
|
|
1971
|
-
var o =
|
|
1983
|
+
var o = Rn.call(t);
|
|
1972
1984
|
return n && (e ? t[ue] = r : delete t[ue]), o;
|
|
1973
1985
|
}
|
|
1974
|
-
var
|
|
1975
|
-
function
|
|
1976
|
-
return
|
|
1977
|
-
}
|
|
1978
|
-
var Cn = "[object Null]", In = "[object Undefined]", ct = ke ? ke.toStringTag : void 0;
|
|
1979
|
-
function _n(t) {
|
|
1980
|
-
return t == null ? t === void 0 ? In : Cn : ct && ct in Object(t) ? Rn(t) : Tn(t);
|
|
1986
|
+
var An = Object.prototype, Tn = An.toString;
|
|
1987
|
+
function Cn(t) {
|
|
1988
|
+
return Tn.call(t);
|
|
1981
1989
|
}
|
|
1990
|
+
var In = "[object Null]", _n = "[object Undefined]", ct = ke ? ke.toStringTag : void 0;
|
|
1982
1991
|
function On(t) {
|
|
1992
|
+
return t == null ? t === void 0 ? _n : In : ct && ct in Object(t) ? kn(t) : Cn(t);
|
|
1993
|
+
}
|
|
1994
|
+
function Nn(t) {
|
|
1983
1995
|
return t != null && typeof t == "object";
|
|
1984
1996
|
}
|
|
1985
|
-
var
|
|
1986
|
-
function
|
|
1987
|
-
return typeof t == "string" || !
|
|
1997
|
+
var Pn = Array.isArray, Mn = "[object String]";
|
|
1998
|
+
function Ln(t) {
|
|
1999
|
+
return typeof t == "string" || !Pn(t) && Nn(t) && On(t) == Mn;
|
|
1988
2000
|
}
|
|
1989
2001
|
const ut = "ikonUiModules";
|
|
1990
2002
|
function Be(t) {
|
|
1991
2003
|
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
1992
2004
|
}
|
|
1993
|
-
function
|
|
2005
|
+
function xn(t) {
|
|
1994
2006
|
if (!Array.isArray(t))
|
|
1995
2007
|
return;
|
|
1996
2008
|
const e = /* @__PURE__ */ new Set();
|
|
1997
2009
|
for (const r of t) {
|
|
1998
|
-
if (!
|
|
2010
|
+
if (!Ln(r)) continue;
|
|
1999
2011
|
const n = r.trim();
|
|
2000
2012
|
n && (e.has(n) || e.add(n));
|
|
2001
2013
|
}
|
|
2002
2014
|
return Array.from(e);
|
|
2003
2015
|
}
|
|
2004
|
-
function
|
|
2016
|
+
function Fo(t, e) {
|
|
2005
2017
|
if (t === e)
|
|
2006
2018
|
return !0;
|
|
2007
2019
|
if (!t || !e)
|
|
@@ -2013,18 +2025,18 @@ function Bo(t, e) {
|
|
|
2013
2025
|
return !1;
|
|
2014
2026
|
return !0;
|
|
2015
2027
|
}
|
|
2016
|
-
function
|
|
2028
|
+
function Un(t) {
|
|
2017
2029
|
if (!(!Be(t) || !Object.prototype.hasOwnProperty.call(t, ut)))
|
|
2018
|
-
return
|
|
2030
|
+
return xn(t[ut]);
|
|
2019
2031
|
}
|
|
2020
|
-
function
|
|
2032
|
+
function $o(...t) {
|
|
2021
2033
|
for (const e of t) {
|
|
2022
|
-
const r =
|
|
2034
|
+
const r = Un(e);
|
|
2023
2035
|
if (r !== void 0)
|
|
2024
2036
|
return r;
|
|
2025
2037
|
}
|
|
2026
2038
|
}
|
|
2027
|
-
function
|
|
2039
|
+
function Vo(t) {
|
|
2028
2040
|
if (!Be(t))
|
|
2029
2041
|
return;
|
|
2030
2042
|
const e = t, r = Object.keys(e).find((u) => u.toLowerCase() === "modules");
|
|
@@ -2073,7 +2085,7 @@ const k = {
|
|
|
2073
2085
|
Line: 4,
|
|
2074
2086
|
Paragraph: 8,
|
|
2075
2087
|
Emoji: 16
|
|
2076
|
-
},
|
|
2088
|
+
}, jn = [
|
|
2077
2089
|
{
|
|
2078
2090
|
flag: k.Letter,
|
|
2079
2091
|
hints: [
|
|
@@ -2122,11 +2134,11 @@ const k = {
|
|
|
2122
2134
|
"[data-emoji]"
|
|
2123
2135
|
]
|
|
2124
2136
|
}
|
|
2125
|
-
], Fe = k.Letter | k.Word | k.Line | k.Paragraph | k.Emoji,
|
|
2126
|
-
function
|
|
2127
|
-
if (!t || t.length >
|
|
2137
|
+
], Fe = k.Letter | k.Word | k.Line | k.Paragraph | k.Emoji, Dn = k.Letter | k.Word | k.Line | k.Paragraph, lt = /* @__PURE__ */ new Map(), Bn = 16384;
|
|
2138
|
+
function Ko(t, e) {
|
|
2139
|
+
if (!t || t.length > Bn)
|
|
2128
2140
|
return t;
|
|
2129
|
-
const r =
|
|
2141
|
+
const r = ro(e), n = re(r, k.Emoji), o = r & Dn;
|
|
2130
2142
|
if (o === k.None && !n)
|
|
2131
2143
|
return t;
|
|
2132
2144
|
const s = t.replace(/\r\n/g, `
|
|
@@ -2134,26 +2146,26 @@ function Vo(t, e) {
|
|
|
2134
2146
|
`);
|
|
2135
2147
|
if (o === k.None)
|
|
2136
2148
|
return ht(s);
|
|
2137
|
-
const i =
|
|
2149
|
+
const i = eo(s);
|
|
2138
2150
|
if (i.length === 0)
|
|
2139
2151
|
return n ? ht(s) : t;
|
|
2140
|
-
const a =
|
|
2152
|
+
const a = to(i), u = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, f = [];
|
|
2141
2153
|
for (const h of a) {
|
|
2142
|
-
const p =
|
|
2154
|
+
const p = Fn(h, r, u);
|
|
2143
2155
|
f.push(...p);
|
|
2144
2156
|
}
|
|
2145
2157
|
return f;
|
|
2146
2158
|
}
|
|
2147
|
-
function
|
|
2159
|
+
function Fn(t, e, r) {
|
|
2148
2160
|
const n = [];
|
|
2149
2161
|
for (const o of t) {
|
|
2150
|
-
const s =
|
|
2162
|
+
const s = $n(o, e, r);
|
|
2151
2163
|
n.push(...s);
|
|
2152
2164
|
}
|
|
2153
2165
|
if (re(e, k.Paragraph)) {
|
|
2154
2166
|
const o = r.paragraph++;
|
|
2155
2167
|
return [
|
|
2156
|
-
/* @__PURE__ */
|
|
2168
|
+
/* @__PURE__ */ E.jsx(
|
|
2157
2169
|
"span",
|
|
2158
2170
|
{
|
|
2159
2171
|
"data-motion-paragraph": !0,
|
|
@@ -2166,20 +2178,20 @@ function Bn(t, e, r) {
|
|
|
2166
2178
|
}
|
|
2167
2179
|
return n;
|
|
2168
2180
|
}
|
|
2169
|
-
function
|
|
2170
|
-
const n =
|
|
2181
|
+
function $n(t, e, r) {
|
|
2182
|
+
const n = Vn(t.text, e, r), o = [];
|
|
2171
2183
|
if (re(e, k.Line)) {
|
|
2172
2184
|
const s = r.line++;
|
|
2173
2185
|
o.push(
|
|
2174
|
-
/* @__PURE__ */
|
|
2186
|
+
/* @__PURE__ */ E.jsx("span", { "data-motion-line": !0, style: Ce(s), children: n }, `motion-line-${s}`)
|
|
2175
2187
|
);
|
|
2176
2188
|
} else
|
|
2177
2189
|
o.push(...n);
|
|
2178
2190
|
for (let s = 0; s < t.breaks; s++)
|
|
2179
|
-
o.push(/* @__PURE__ */
|
|
2191
|
+
o.push(/* @__PURE__ */ E.jsx("br", {}, `motion-break-${r.br++}`));
|
|
2180
2192
|
return o;
|
|
2181
2193
|
}
|
|
2182
|
-
function
|
|
2194
|
+
function Vn(t, e, r) {
|
|
2183
2195
|
if (!t)
|
|
2184
2196
|
return [];
|
|
2185
2197
|
const n = re(e, k.Word), o = [], s = /(\s+)/g;
|
|
@@ -2198,13 +2210,13 @@ function $n(t, e, r) {
|
|
|
2198
2210
|
return o;
|
|
2199
2211
|
}
|
|
2200
2212
|
function dt(t, e, r, n) {
|
|
2201
|
-
const o = e.word++, s =
|
|
2202
|
-
return n ? /* @__PURE__ */
|
|
2213
|
+
const o = e.word++, s = zn(t, r, e), i = `motion-word-${o}`, a = Kn(o, n);
|
|
2214
|
+
return n ? /* @__PURE__ */ E.jsx("span", { "data-motion-word": !0, style: a, children: s }, i) : /* @__PURE__ */ E.jsx("span", { style: a, children: s }, i);
|
|
2203
2215
|
}
|
|
2204
|
-
function
|
|
2216
|
+
function Kn(t, e) {
|
|
2205
2217
|
return e ? { ...Ce(t), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
|
|
2206
2218
|
}
|
|
2207
|
-
function
|
|
2219
|
+
function zn(t, e, r) {
|
|
2208
2220
|
if (!t)
|
|
2209
2221
|
return [];
|
|
2210
2222
|
const n = re(e, k.Letter), o = re(e, k.Emoji);
|
|
@@ -2223,13 +2235,13 @@ function Kn(t, e, r) {
|
|
|
2223
2235
|
if (a === `
|
|
2224
2236
|
`) {
|
|
2225
2237
|
s.push(
|
|
2226
|
-
/* @__PURE__ */
|
|
2238
|
+
/* @__PURE__ */ E.jsx("span", { "data-motion-letter": !0, style: h, children: /* @__PURE__ */ E.jsx("br", {}) }, f)
|
|
2227
2239
|
);
|
|
2228
2240
|
continue;
|
|
2229
2241
|
}
|
|
2230
2242
|
const y = o && Et(a) ? { "data-motion-emoji": !0 } : void 0, c = a === " " ? " " : a;
|
|
2231
2243
|
s.push(
|
|
2232
|
-
/* @__PURE__ */
|
|
2244
|
+
/* @__PURE__ */ E.jsx("span", { "data-motion-letter": !0, style: h, ...y, children: c }, f)
|
|
2233
2245
|
);
|
|
2234
2246
|
}
|
|
2235
2247
|
return s;
|
|
@@ -2237,33 +2249,33 @@ function Kn(t, e, r) {
|
|
|
2237
2249
|
function $e(t) {
|
|
2238
2250
|
if (!t)
|
|
2239
2251
|
return [];
|
|
2240
|
-
const e =
|
|
2241
|
-
return e ? Array.from(e.segment(t), (r) => r.segment) :
|
|
2252
|
+
const e = Yn();
|
|
2253
|
+
return e ? Array.from(e.segment(t), (r) => r.segment) : Wn(t);
|
|
2242
2254
|
}
|
|
2243
2255
|
let le;
|
|
2244
|
-
function
|
|
2256
|
+
function Yn() {
|
|
2245
2257
|
return le !== void 0 || (typeof Intl < "u" && typeof Intl.Segmenter == "function" ? le = new Intl.Segmenter(void 0, { granularity: "grapheme" }) : le = null), le;
|
|
2246
2258
|
}
|
|
2247
|
-
function
|
|
2259
|
+
function Wn(t) {
|
|
2248
2260
|
const e = [], r = Array.from(t);
|
|
2249
2261
|
let n = "";
|
|
2250
2262
|
for (let o = 0; o < r.length; o++) {
|
|
2251
2263
|
const s = r[o], i = r[o + 1];
|
|
2252
|
-
n += s, !(i &&
|
|
2264
|
+
n += s, !(i && qn(s, i)) && (e.push(n), n = "");
|
|
2253
2265
|
}
|
|
2254
2266
|
return n && e.push(n), e;
|
|
2255
2267
|
}
|
|
2256
|
-
function
|
|
2257
|
-
return e ? !!(ft(t) || ft(e) ||
|
|
2268
|
+
function qn(t, e) {
|
|
2269
|
+
return e ? !!(ft(t) || ft(e) || Jn(e) || Hn(e) || Gn(e) || pt(t) && pt(e)) : !1;
|
|
2258
2270
|
}
|
|
2259
2271
|
function ft(t) {
|
|
2260
2272
|
return t.codePointAt(0) === 8205;
|
|
2261
2273
|
}
|
|
2262
|
-
function
|
|
2274
|
+
function Hn(t) {
|
|
2263
2275
|
const e = t.codePointAt(0);
|
|
2264
2276
|
return e === void 0 ? !1 : e >= 65024 && e <= 65039 || e >= 917760 && e <= 917999;
|
|
2265
2277
|
}
|
|
2266
|
-
function
|
|
2278
|
+
function Gn(t) {
|
|
2267
2279
|
const e = t.codePointAt(0);
|
|
2268
2280
|
return e === void 0 ? !1 : e >= 127995 && e <= 127999;
|
|
2269
2281
|
}
|
|
@@ -2272,10 +2284,10 @@ function pt(t) {
|
|
|
2272
2284
|
return e === void 0 ? !1 : e >= 127462 && e <= 127487;
|
|
2273
2285
|
}
|
|
2274
2286
|
let Ne;
|
|
2275
|
-
function
|
|
2276
|
-
return t ? (Ne || (Ne =
|
|
2287
|
+
function Jn(t) {
|
|
2288
|
+
return t ? (Ne || (Ne = Xn()), Ne(t)) : !1;
|
|
2277
2289
|
}
|
|
2278
|
-
function
|
|
2290
|
+
function Xn() {
|
|
2279
2291
|
try {
|
|
2280
2292
|
const t = new RegExp("\\p{Mark}", "u");
|
|
2281
2293
|
return (e) => t.test(e);
|
|
@@ -2288,17 +2300,17 @@ function Jn() {
|
|
|
2288
2300
|
}
|
|
2289
2301
|
let Pe;
|
|
2290
2302
|
function Et(t) {
|
|
2291
|
-
return t ? (Pe || (Pe =
|
|
2303
|
+
return t ? (Pe || (Pe = Zn()), Pe(t)) : !1;
|
|
2292
2304
|
}
|
|
2293
|
-
function
|
|
2305
|
+
function Zn() {
|
|
2294
2306
|
try {
|
|
2295
2307
|
const t = new RegExp("\\p{Extended_Pictographic}", "u");
|
|
2296
2308
|
return (e) => t.test(e);
|
|
2297
2309
|
} catch {
|
|
2298
|
-
return
|
|
2310
|
+
return Qn;
|
|
2299
2311
|
}
|
|
2300
2312
|
}
|
|
2301
|
-
function
|
|
2313
|
+
function Qn(t) {
|
|
2302
2314
|
if (!t)
|
|
2303
2315
|
return !1;
|
|
2304
2316
|
for (const e of Array.from(t)) {
|
|
@@ -2308,7 +2320,7 @@ function Zn(t) {
|
|
|
2308
2320
|
}
|
|
2309
2321
|
return !1;
|
|
2310
2322
|
}
|
|
2311
|
-
function
|
|
2323
|
+
function eo(t) {
|
|
2312
2324
|
const e = [];
|
|
2313
2325
|
let r = "", n = 0;
|
|
2314
2326
|
for (let o = 0; o < t.length; o++) {
|
|
@@ -2322,7 +2334,7 @@ function Qn(t) {
|
|
|
2322
2334
|
}
|
|
2323
2335
|
return (n > 0 || r.length > 0) && e.push({ text: r, breaks: n }), e;
|
|
2324
2336
|
}
|
|
2325
|
-
function
|
|
2337
|
+
function to(t) {
|
|
2326
2338
|
if (t.length === 0)
|
|
2327
2339
|
return [];
|
|
2328
2340
|
const e = [];
|
|
@@ -2371,7 +2383,7 @@ function Rt(t, e) {
|
|
|
2371
2383
|
o = !0, i();
|
|
2372
2384
|
const f = `motion-emoji-${e ? e.emoji++ : s++}`;
|
|
2373
2385
|
r.push(
|
|
2374
|
-
/* @__PURE__ */
|
|
2386
|
+
/* @__PURE__ */ E.jsx("span", { "data-motion-emoji": !0, children: a }, f)
|
|
2375
2387
|
);
|
|
2376
2388
|
continue;
|
|
2377
2389
|
}
|
|
@@ -2379,7 +2391,7 @@ function Rt(t, e) {
|
|
|
2379
2391
|
}
|
|
2380
2392
|
return i(), o ? { nodes: r, sawEmoji: !0 } : { nodes: [t.join("")], sawEmoji: !1 };
|
|
2381
2393
|
}
|
|
2382
|
-
function
|
|
2394
|
+
function ro(t) {
|
|
2383
2395
|
if (!t)
|
|
2384
2396
|
return k.None;
|
|
2385
2397
|
const e = t.trim();
|
|
@@ -2393,8 +2405,8 @@ function to(t) {
|
|
|
2393
2405
|
const n = e.split(/\s+/).filter(Boolean);
|
|
2394
2406
|
if (n.length === 0)
|
|
2395
2407
|
return k.None;
|
|
2396
|
-
const s = n.map((u) => `.${
|
|
2397
|
-
(u) => new RegExp(`(^|[^a-zA-Z0-9_-])${
|
|
2408
|
+
const s = n.map((u) => `.${no(u)}`).map(
|
|
2409
|
+
(u) => new RegExp(`(^|[^a-zA-Z0-9_-])${oo(u)}(?![a-zA-Z0-9_-])`)
|
|
2398
2410
|
);
|
|
2399
2411
|
let i = k.None, a = !1;
|
|
2400
2412
|
for (const u of Array.from(document.styleSheets)) {
|
|
@@ -2422,7 +2434,7 @@ function kt(t, e) {
|
|
|
2422
2434
|
const a = s.selectorText ?? "";
|
|
2423
2435
|
if (!a || !e.some((f) => f.test(a))) continue;
|
|
2424
2436
|
n = !0;
|
|
2425
|
-
for (const f of
|
|
2437
|
+
for (const f of jn)
|
|
2426
2438
|
f.hints.some((h) => a.includes(h)) && (r |= f.flag);
|
|
2427
2439
|
if (r === Fe)
|
|
2428
2440
|
return { mask: r, sawStyleRule: !0 };
|
|
@@ -2436,19 +2448,19 @@ function kt(t, e) {
|
|
|
2436
2448
|
}
|
|
2437
2449
|
return { mask: r, sawStyleRule: n };
|
|
2438
2450
|
}
|
|
2439
|
-
function
|
|
2451
|
+
function no(t) {
|
|
2440
2452
|
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
2441
2453
|
}
|
|
2442
|
-
function
|
|
2454
|
+
function oo(t) {
|
|
2443
2455
|
return t.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
|
|
2444
2456
|
}
|
|
2445
|
-
const We = "ikon_auth_session",
|
|
2446
|
-
function
|
|
2457
|
+
const We = "ikon_auth_session", so = 10080 * 60 * 1e3, io = 60 * 1e3;
|
|
2458
|
+
function ao(t) {
|
|
2447
2459
|
try {
|
|
2448
2460
|
const e = t.split(".");
|
|
2449
2461
|
if (e.length !== 3) return !0;
|
|
2450
2462
|
const r = e[1].replace(/-/g, "+").replace(/_/g, "/"), n = r + "=".repeat((4 - r.length % 4) % 4), o = JSON.parse(atob(n));
|
|
2451
|
-
return typeof o.exp != "number" ? !1 : Date.now() >= o.exp * 1e3 -
|
|
2463
|
+
return typeof o.exp != "number" ? !1 : Date.now() >= o.exp * 1e3 - io;
|
|
2452
2464
|
} catch {
|
|
2453
2465
|
return !0;
|
|
2454
2466
|
}
|
|
@@ -2465,7 +2477,7 @@ function At() {
|
|
|
2465
2477
|
const t = localStorage.getItem(We);
|
|
2466
2478
|
if (!t) return null;
|
|
2467
2479
|
const e = JSON.parse(t);
|
|
2468
|
-
return Date.now() - e.authenticatedAt >
|
|
2480
|
+
return Date.now() - e.authenticatedAt > so || ao(e.token) ? (Ae(), null) : e;
|
|
2469
2481
|
} catch {
|
|
2470
2482
|
return console.warn("Failed to load auth session from localStorage"), null;
|
|
2471
2483
|
}
|
|
@@ -2503,7 +2515,7 @@ async function Ct(t, e) {
|
|
|
2503
2515
|
};
|
|
2504
2516
|
return pe(s), s;
|
|
2505
2517
|
}
|
|
2506
|
-
async function
|
|
2518
|
+
async function co({ email: t, spaceId: e, authUrl: r }) {
|
|
2507
2519
|
const n = await fetch(`${r}/email/send`, {
|
|
2508
2520
|
method: "POST",
|
|
2509
2521
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2518,7 +2530,7 @@ async function ao({ email: t, spaceId: e, authUrl: r }) {
|
|
|
2518
2530
|
throw new Error(o);
|
|
2519
2531
|
}
|
|
2520
2532
|
}
|
|
2521
|
-
async function
|
|
2533
|
+
async function uo({ email: t, code: e, authUrl: r }) {
|
|
2522
2534
|
const n = await fetch(`${r}/email/code`, {
|
|
2523
2535
|
method: "POST",
|
|
2524
2536
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2539,21 +2551,21 @@ async function co({ email: t, code: e, authUrl: r }) {
|
|
|
2539
2551
|
};
|
|
2540
2552
|
return pe(s), s;
|
|
2541
2553
|
}
|
|
2542
|
-
function
|
|
2554
|
+
function lo() {
|
|
2543
2555
|
const t = new URLSearchParams(window.location.search), e = t.get("ikon_token"), r = t.get("ikon_provider");
|
|
2544
2556
|
return e && r ? { token: e, provider: r } : null;
|
|
2545
2557
|
}
|
|
2546
|
-
function
|
|
2558
|
+
function fo() {
|
|
2547
2559
|
return new URLSearchParams(window.location.search).get("error");
|
|
2548
2560
|
}
|
|
2549
2561
|
function mt() {
|
|
2550
2562
|
window.history.replaceState({}, "", window.location.pathname);
|
|
2551
2563
|
}
|
|
2552
|
-
function
|
|
2564
|
+
function po(t, e, r, n) {
|
|
2553
2565
|
const o = n ?? window.location.origin + window.location.pathname + window.location.search;
|
|
2554
2566
|
return `${r}/oauth/${t}?space=${encodeURIComponent(e)}&return=${encodeURIComponent(o)}`;
|
|
2555
2567
|
}
|
|
2556
|
-
async function
|
|
2568
|
+
async function ho(t) {
|
|
2557
2569
|
const e = await fetch(`${t}/passkey/registration/options`, {
|
|
2558
2570
|
method: "POST",
|
|
2559
2571
|
headers: { "Content-Type": "application/json" }
|
|
@@ -2564,7 +2576,7 @@ async function po(t) {
|
|
|
2564
2576
|
}
|
|
2565
2577
|
return e.json();
|
|
2566
2578
|
}
|
|
2567
|
-
async function
|
|
2579
|
+
async function mo(t, e, r) {
|
|
2568
2580
|
const n = await fetch(`${t}/passkey/registration/verify`, {
|
|
2569
2581
|
method: "POST",
|
|
2570
2582
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2581,7 +2593,7 @@ async function ho(t, e, r) {
|
|
|
2581
2593
|
};
|
|
2582
2594
|
return pe(s), s;
|
|
2583
2595
|
}
|
|
2584
|
-
async function
|
|
2596
|
+
async function go(t, e) {
|
|
2585
2597
|
const r = await fetch(`${t}/passkey/authentication/options`, {
|
|
2586
2598
|
method: "POST",
|
|
2587
2599
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2593,7 +2605,7 @@ async function mo(t, e) {
|
|
|
2593
2605
|
}
|
|
2594
2606
|
return r.json();
|
|
2595
2607
|
}
|
|
2596
|
-
async function
|
|
2608
|
+
async function yo(t, e) {
|
|
2597
2609
|
const r = await fetch(`${t}/passkey/authentication/verify`, {
|
|
2598
2610
|
method: "POST",
|
|
2599
2611
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2624,9 +2636,9 @@ function Te(t) {
|
|
|
2624
2636
|
return s;
|
|
2625
2637
|
}
|
|
2626
2638
|
function qe() {
|
|
2627
|
-
return
|
|
2639
|
+
return bo.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
|
|
2628
2640
|
}
|
|
2629
|
-
const
|
|
2641
|
+
const bo = {
|
|
2630
2642
|
stubThis: (t) => t
|
|
2631
2643
|
};
|
|
2632
2644
|
function It(t) {
|
|
@@ -2659,7 +2671,7 @@ class x extends Error {
|
|
|
2659
2671
|
}), this.name = o ?? n.name, this.code = r;
|
|
2660
2672
|
}
|
|
2661
2673
|
}
|
|
2662
|
-
function
|
|
2674
|
+
function So({ error: t, options: e }) {
|
|
2663
2675
|
const { publicKey: r } = e;
|
|
2664
2676
|
if (!r)
|
|
2665
2677
|
throw Error("options was missing required publicKey property");
|
|
@@ -2745,7 +2757,7 @@ function bo({ error: t, options: e }) {
|
|
|
2745
2757
|
}
|
|
2746
2758
|
return t;
|
|
2747
2759
|
}
|
|
2748
|
-
class
|
|
2760
|
+
class wo {
|
|
2749
2761
|
constructor() {
|
|
2750
2762
|
Object.defineProperty(this, "controller", {
|
|
2751
2763
|
enumerable: !0,
|
|
@@ -2769,12 +2781,12 @@ class So {
|
|
|
2769
2781
|
}
|
|
2770
2782
|
}
|
|
2771
2783
|
}
|
|
2772
|
-
const Ot = new
|
|
2784
|
+
const Ot = new wo(), vo = ["cross-platform", "platform"];
|
|
2773
2785
|
function Nt(t) {
|
|
2774
|
-
if (t && !(
|
|
2786
|
+
if (t && !(vo.indexOf(t) < 0))
|
|
2775
2787
|
return t;
|
|
2776
2788
|
}
|
|
2777
|
-
async function
|
|
2789
|
+
async function Eo(t) {
|
|
2778
2790
|
!t.optionsJSON && t.challenge && (console.warn("startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."), t = { optionsJSON: t });
|
|
2779
2791
|
const { optionsJSON: e, useAutoRegister: r = !1 } = t;
|
|
2780
2792
|
if (!qe())
|
|
@@ -2793,7 +2805,7 @@ async function vo(t) {
|
|
|
2793
2805
|
try {
|
|
2794
2806
|
s = await navigator.credentials.create(o);
|
|
2795
2807
|
} catch (l) {
|
|
2796
|
-
throw
|
|
2808
|
+
throw So({ error: l, options: o });
|
|
2797
2809
|
}
|
|
2798
2810
|
if (!s)
|
|
2799
2811
|
throw new Error("Registration was not completed");
|
|
@@ -2842,7 +2854,7 @@ function Me(t, e) {
|
|
|
2842
2854
|
console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${t}. You should report this error to them.
|
|
2843
2855
|
`, e);
|
|
2844
2856
|
}
|
|
2845
|
-
function
|
|
2857
|
+
function Ro() {
|
|
2846
2858
|
if (!qe())
|
|
2847
2859
|
return Le.stubThis(new Promise((e) => e(!1)));
|
|
2848
2860
|
const t = globalThis.PublicKeyCredential;
|
|
@@ -2851,7 +2863,7 @@ function Eo() {
|
|
|
2851
2863
|
const Le = {
|
|
2852
2864
|
stubThis: (t) => t
|
|
2853
2865
|
};
|
|
2854
|
-
function
|
|
2866
|
+
function ko({ error: t, options: e }) {
|
|
2855
2867
|
const { publicKey: r } = e;
|
|
2856
2868
|
if (!r)
|
|
2857
2869
|
throw Error("options was missing required publicKey property");
|
|
@@ -2892,7 +2904,7 @@ function Ro({ error: t, options: e }) {
|
|
|
2892
2904
|
}
|
|
2893
2905
|
return t;
|
|
2894
2906
|
}
|
|
2895
|
-
async function
|
|
2907
|
+
async function Ao(t) {
|
|
2896
2908
|
!t.optionsJSON && t.challenge && (console.warn("startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."), t = { optionsJSON: t });
|
|
2897
2909
|
const { optionsJSON: e, useBrowserAutofill: r = !1, verifyBrowserAutofillInput: n = !0 } = t;
|
|
2898
2910
|
if (!qe())
|
|
@@ -2905,7 +2917,7 @@ async function ko(t) {
|
|
|
2905
2917
|
allowCredentials: o
|
|
2906
2918
|
}, i = {};
|
|
2907
2919
|
if (r) {
|
|
2908
|
-
if (!await
|
|
2920
|
+
if (!await Ro())
|
|
2909
2921
|
throw Error("Browser does not support WebAuthn autofill");
|
|
2910
2922
|
if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 && n)
|
|
2911
2923
|
throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
|
|
@@ -2916,7 +2928,7 @@ async function ko(t) {
|
|
|
2916
2928
|
try {
|
|
2917
2929
|
a = await navigator.credentials.get(i);
|
|
2918
2930
|
} catch (c) {
|
|
2919
|
-
throw
|
|
2931
|
+
throw ko({ error: c, options: i });
|
|
2920
2932
|
}
|
|
2921
2933
|
if (!a)
|
|
2922
2934
|
throw new Error("Authentication was not completed");
|
|
@@ -2937,16 +2949,16 @@ async function ko(t) {
|
|
|
2937
2949
|
};
|
|
2938
2950
|
}
|
|
2939
2951
|
const He = gt(null);
|
|
2940
|
-
function
|
|
2941
|
-
const [r, n] =
|
|
2952
|
+
function zo({ children: t, config: e }) {
|
|
2953
|
+
const [r, n] = z({
|
|
2942
2954
|
isAuthenticated: !1,
|
|
2943
2955
|
isLoading: !0,
|
|
2944
2956
|
user: null,
|
|
2945
2957
|
error: null
|
|
2946
2958
|
});
|
|
2947
|
-
|
|
2959
|
+
O(() => {
|
|
2948
2960
|
(() => {
|
|
2949
|
-
const y =
|
|
2961
|
+
const y = fo();
|
|
2950
2962
|
if (y) {
|
|
2951
2963
|
mt(), n({
|
|
2952
2964
|
isAuthenticated: !1,
|
|
@@ -2956,7 +2968,7 @@ function Ko({ children: t, config: e }) {
|
|
|
2956
2968
|
});
|
|
2957
2969
|
return;
|
|
2958
2970
|
}
|
|
2959
|
-
const c =
|
|
2971
|
+
const c = lo();
|
|
2960
2972
|
if (c) {
|
|
2961
2973
|
const m = {
|
|
2962
2974
|
token: c.token,
|
|
@@ -3021,7 +3033,7 @@ function Ko({ children: t, config: e }) {
|
|
|
3021
3033
|
if (p === "passkey") {
|
|
3022
3034
|
n((c) => ({ ...c, isLoading: !0, error: null }));
|
|
3023
3035
|
try {
|
|
3024
|
-
const c = await
|
|
3036
|
+
const c = await go(y), l = await Ao({ optionsJSON: c }), m = await yo(y, l);
|
|
3025
3037
|
n({
|
|
3026
3038
|
isAuthenticated: !0,
|
|
3027
3039
|
isLoading: !1,
|
|
@@ -3039,7 +3051,7 @@ function Ko({ children: t, config: e }) {
|
|
|
3039
3051
|
}
|
|
3040
3052
|
if (p === "email")
|
|
3041
3053
|
throw new Error("login('email') is not supported. Use requestEmailCode()/submitEmailCode() from useAuth() instead.");
|
|
3042
|
-
window.location.href =
|
|
3054
|
+
window.location.href = po(p, e.spaceId, y);
|
|
3043
3055
|
},
|
|
3044
3056
|
[e.authUrl, e.spaceId]
|
|
3045
3057
|
), s = U(
|
|
@@ -3047,14 +3059,14 @@ function Ko({ children: t, config: e }) {
|
|
|
3047
3059
|
if (!e.spaceId)
|
|
3048
3060
|
throw n((c) => ({ ...c, error: "Space ID is not configured" })), new Error("Space ID is not configured");
|
|
3049
3061
|
const y = de(e.authUrl);
|
|
3050
|
-
await
|
|
3062
|
+
await co({ email: p, spaceId: e.spaceId, authUrl: y });
|
|
3051
3063
|
},
|
|
3052
3064
|
[e.authUrl, e.spaceId]
|
|
3053
3065
|
), i = U(
|
|
3054
3066
|
async (p, y) => {
|
|
3055
3067
|
n((c) => ({ ...c, isLoading: !0, error: null }));
|
|
3056
3068
|
try {
|
|
3057
|
-
const c = de(e.authUrl), l = await
|
|
3069
|
+
const c = de(e.authUrl), l = await uo({ email: p, code: y, authUrl: c });
|
|
3058
3070
|
n({
|
|
3059
3071
|
isAuthenticated: !0,
|
|
3060
3072
|
isLoading: !1,
|
|
@@ -3079,7 +3091,7 @@ function Ko({ children: t, config: e }) {
|
|
|
3079
3091
|
const y = de(e.authUrl);
|
|
3080
3092
|
n((c) => ({ ...c, isLoading: !0, error: null }));
|
|
3081
3093
|
try {
|
|
3082
|
-
const c = await
|
|
3094
|
+
const c = await ho(y), l = await Eo({ optionsJSON: c }), m = await mo(y, l, p);
|
|
3083
3095
|
n({
|
|
3084
3096
|
isAuthenticated: !0,
|
|
3085
3097
|
isLoading: !1,
|
|
@@ -3107,20 +3119,20 @@ function Ko({ children: t, config: e }) {
|
|
|
3107
3119
|
}),
|
|
3108
3120
|
[r, o, a, f, u, s, i]
|
|
3109
3121
|
);
|
|
3110
|
-
return /* @__PURE__ */
|
|
3122
|
+
return /* @__PURE__ */ E.jsx(He, { value: h, children: t });
|
|
3111
3123
|
}
|
|
3112
|
-
function
|
|
3124
|
+
function To() {
|
|
3113
3125
|
const t = Ke(He);
|
|
3114
3126
|
if (!t)
|
|
3115
3127
|
throw new Error("useAuth must be used within an AuthProvider");
|
|
3116
3128
|
return t;
|
|
3117
3129
|
}
|
|
3118
|
-
function
|
|
3130
|
+
function Co() {
|
|
3119
3131
|
return Ke(He);
|
|
3120
3132
|
}
|
|
3121
|
-
function
|
|
3122
|
-
const { config: e, guestUrlParam: r } = t, { state: n, login: o } =
|
|
3123
|
-
return
|
|
3133
|
+
function Yo(t) {
|
|
3134
|
+
const { config: e, guestUrlParam: r } = t, { state: n, login: o } = To(), s = v(!1);
|
|
3135
|
+
return O(() => {
|
|
3124
3136
|
if (!r || n.isAuthenticated || n.isLoading || s.current || !e.methods.includes("guest"))
|
|
3125
3137
|
return;
|
|
3126
3138
|
const i = new URLSearchParams(window.location.search), a = i.get(r);
|
|
@@ -3136,7 +3148,7 @@ function zo(t) {
|
|
|
3136
3148
|
error: n.error
|
|
3137
3149
|
};
|
|
3138
3150
|
}
|
|
3139
|
-
function
|
|
3151
|
+
function Wo({
|
|
3140
3152
|
connectionState: t,
|
|
3141
3153
|
error: e,
|
|
3142
3154
|
isReady: r,
|
|
@@ -3181,25 +3193,25 @@ function Yo({
|
|
|
3181
3193
|
}
|
|
3182
3194
|
}
|
|
3183
3195
|
const ve = fe("useIkonApp");
|
|
3184
|
-
function
|
|
3196
|
+
function Io() {
|
|
3185
3197
|
if (typeof window < "u" && window.__IKON_AUTH_CONFIG__)
|
|
3186
3198
|
return window.__IKON_AUTH_CONFIG__;
|
|
3187
3199
|
}
|
|
3188
|
-
function
|
|
3200
|
+
function _o() {
|
|
3189
3201
|
if (typeof window < "u" && window.__IKON_LOCAL_IKON_SERVER_CONFIG__)
|
|
3190
3202
|
return window.__IKON_LOCAL_IKON_SERVER_CONFIG__;
|
|
3191
3203
|
}
|
|
3192
|
-
function
|
|
3193
|
-
const { authConfig: e, modules: r, timeouts: n, backgroundAudio: o, webRtc: s, audio: i, video: a, websocket: u, webtransport: f, proxy: h } = t, p = e === void 0 ?
|
|
3194
|
-
|
|
3195
|
-
const [j, B] =
|
|
3204
|
+
function qo(t) {
|
|
3205
|
+
const { authConfig: e, modules: r, timeouts: n, backgroundAudio: o, webRtc: s, audio: i, video: a, websocket: u, webtransport: f, proxy: h } = t, p = e === void 0 ? Io() ?? null : e, y = _o(), c = Co(), l = v(null), m = v(null), g = v(null), b = v(!1), S = v(!1), N = v(o), _ = v(n), M = v(s), L = v(i), G = v(a), T = v(u), P = v(f), D = v(h);
|
|
3206
|
+
N.current = o, _.current = n, M.current = s, L.current = i, G.current = a, T.current = u, P.current = f, D.current = h;
|
|
3207
|
+
const [j, B] = z("idle"), [V, he] = z(null), [ne, me] = z(null), [oe, ge] = z(null), [X, ye] = z(null), d = v(!1), [w, A] = z(0), R = $(() => {
|
|
3196
3208
|
try {
|
|
3197
3209
|
const I = Kt();
|
|
3198
3210
|
return (I.sessionId || I.channelKey) && zt(), I;
|
|
3199
3211
|
} catch {
|
|
3200
3212
|
return { parameters: {} };
|
|
3201
3213
|
}
|
|
3202
|
-
}, []), K = $(() => p?.enabled ? At() : null, [p?.enabled, w]), Z = y?.enabled ?? !1, C = y?.host ?? "localhost",
|
|
3214
|
+
}, []), K = $(() => p?.enabled ? At() : null, [p?.enabled, w]), Z = y?.enabled ?? !1, C = y?.host ?? "localhost", W = y?.port ?? 8443;
|
|
3203
3215
|
!Z && Ge() && p && !p.enabled && p.spaceId && !X && !d.current && (d.current = !0, Ct(p.spaceId, de(p.authUrl)).then((I) => {
|
|
3204
3216
|
ye(I.token);
|
|
3205
3217
|
}).catch((I) => {
|
|
@@ -3211,13 +3223,13 @@ function Wo(t) {
|
|
|
3211
3223
|
return {
|
|
3212
3224
|
local: {
|
|
3213
3225
|
host: C,
|
|
3214
|
-
httpsPort:
|
|
3226
|
+
httpsPort: W,
|
|
3215
3227
|
userId: I,
|
|
3216
3228
|
token: K?.token ?? void 0,
|
|
3217
3229
|
spaceId: p?.spaceId,
|
|
3218
3230
|
backendUrl: p?.backendUrl,
|
|
3219
3231
|
authUrl: p?.authUrl,
|
|
3220
|
-
parameters:
|
|
3232
|
+
parameters: R.parameters
|
|
3221
3233
|
}
|
|
3222
3234
|
};
|
|
3223
3235
|
}
|
|
@@ -3226,78 +3238,78 @@ function Wo(t) {
|
|
|
3226
3238
|
token: K.token,
|
|
3227
3239
|
spaceId: p.spaceId,
|
|
3228
3240
|
backendType: Je(),
|
|
3229
|
-
sessionId:
|
|
3230
|
-
channelKey:
|
|
3231
|
-
parameters:
|
|
3241
|
+
sessionId: R.sessionId,
|
|
3242
|
+
channelKey: R.channelKey,
|
|
3243
|
+
parameters: R.parameters
|
|
3232
3244
|
}
|
|
3233
3245
|
} : X && p?.spaceId ? {
|
|
3234
3246
|
sessionToken: {
|
|
3235
3247
|
token: X,
|
|
3236
3248
|
spaceId: p.spaceId,
|
|
3237
3249
|
backendType: Je(),
|
|
3238
|
-
sessionId:
|
|
3239
|
-
channelKey:
|
|
3240
|
-
parameters:
|
|
3250
|
+
sessionId: R.sessionId,
|
|
3251
|
+
channelKey: R.channelKey,
|
|
3252
|
+
parameters: R.parameters
|
|
3241
3253
|
}
|
|
3242
3254
|
} : Ge() ? null : {
|
|
3243
3255
|
local: {
|
|
3244
3256
|
host: C,
|
|
3245
|
-
httpsPort:
|
|
3257
|
+
httpsPort: W,
|
|
3246
3258
|
spaceId: p?.spaceId,
|
|
3247
3259
|
backendUrl: p?.backendUrl,
|
|
3248
3260
|
authUrl: p?.authUrl,
|
|
3249
|
-
parameters:
|
|
3261
|
+
parameters: R.parameters
|
|
3250
3262
|
}
|
|
3251
3263
|
};
|
|
3252
|
-
}, [Z, C,
|
|
3253
|
-
|
|
3254
|
-
const Mt =
|
|
3255
|
-
|
|
3264
|
+
}, [Z, C, W, K?.token, p?.spaceId, p?.backendUrl, p?.authUrl, X, R.sessionId, R.channelKey, R.parameters]);
|
|
3265
|
+
gn(oe);
|
|
3266
|
+
const Mt = bn(oe);
|
|
3267
|
+
O(() => {
|
|
3256
3268
|
if (!b.current) {
|
|
3257
|
-
if (b.current = !0, g.current =
|
|
3269
|
+
if (b.current = !0, g.current = cn(), r)
|
|
3258
3270
|
for (const I of r)
|
|
3259
3271
|
I(g.current);
|
|
3260
3272
|
g.current.loadRegisteredModules().catch((I) => {
|
|
3261
3273
|
ve.error("Failed to load UI modules", I);
|
|
3262
3274
|
});
|
|
3263
3275
|
}
|
|
3264
|
-
}, []),
|
|
3276
|
+
}, []), O(() => {
|
|
3265
3277
|
if (!se) return;
|
|
3266
3278
|
const I = new Wt({
|
|
3267
3279
|
...se,
|
|
3268
3280
|
timeouts: _.current,
|
|
3269
|
-
audio: L.current !== void 0 ||
|
|
3281
|
+
audio: L.current !== void 0 || N.current ? {
|
|
3270
3282
|
enabled: L.current,
|
|
3271
|
-
...
|
|
3283
|
+
...N.current ? { background: { allowOnDesktop: !0, allowOnMobile: !0 } } : {}
|
|
3272
3284
|
} : void 0,
|
|
3273
3285
|
video: G.current !== void 0 ? { enabled: G.current } : void 0,
|
|
3274
3286
|
mediaSession: { title: document.title || void 0, artist: document.title || void 0 },
|
|
3275
3287
|
webRtc: M.current === !1 ? { enabled: !1 } : void 0,
|
|
3276
3288
|
websocket: T.current,
|
|
3277
|
-
webtransport:
|
|
3289
|
+
webtransport: P.current,
|
|
3278
3290
|
proxy: D.current,
|
|
3279
|
-
onConnectionStateChange: (
|
|
3280
|
-
B(
|
|
3291
|
+
onConnectionStateChange: (q) => {
|
|
3292
|
+
B(q);
|
|
3281
3293
|
},
|
|
3282
|
-
onError: (
|
|
3283
|
-
he(
|
|
3294
|
+
onError: (q) => {
|
|
3295
|
+
he(q.message);
|
|
3284
3296
|
}
|
|
3285
3297
|
});
|
|
3286
3298
|
l.current = I;
|
|
3287
|
-
const Q = new
|
|
3288
|
-
return m.current = Q, ge(Q), I.connect().catch((
|
|
3289
|
-
if (ve.error("Connection failed:",
|
|
3290
|
-
me(
|
|
3299
|
+
const Q = new gr({ client: I });
|
|
3300
|
+
return m.current = Q, ge(Q), I.connect().catch((q) => {
|
|
3301
|
+
if (ve.error("Connection failed:", q), q instanceof qt) {
|
|
3302
|
+
me(q.reason);
|
|
3291
3303
|
return;
|
|
3292
3304
|
}
|
|
3293
|
-
|
|
3305
|
+
q instanceof Ht && !S.current && (S.current = !0, ve.warn("Auth session appears stale, clearing and retrying"), c ? c.logout() : (Ae(), A((Ut) => Ut + 1)));
|
|
3294
3306
|
}), () => {
|
|
3295
3307
|
I.disconnect(), l.current = null, Q.dispose(), m.current = null;
|
|
3296
3308
|
};
|
|
3297
3309
|
}, [se]);
|
|
3298
3310
|
const Lt = U((I, Q) => {
|
|
3299
|
-
const
|
|
3300
|
-
l.current?.sendActionCall(I,
|
|
3311
|
+
const q = typeof Q == "string" ? Q : JSON.stringify(Q ?? {});
|
|
3312
|
+
l.current?.sendActionCall(I, q);
|
|
3301
3313
|
}, []), xt = j === "connected" || j === "reconnecting";
|
|
3302
3314
|
return {
|
|
3303
3315
|
connectionState: j,
|
|
@@ -3315,7 +3327,7 @@ function Wo(t) {
|
|
|
3315
3327
|
webRtcTrackMap: l.current?.webRtcTrackMap ?? /* @__PURE__ */ new Map()
|
|
3316
3328
|
};
|
|
3317
3329
|
}
|
|
3318
|
-
function
|
|
3330
|
+
function Ho(t) {
|
|
3319
3331
|
const e = v(!1);
|
|
3320
3332
|
return U(() => {
|
|
3321
3333
|
if (e.current) return;
|
|
@@ -3324,18 +3336,18 @@ function qo(t) {
|
|
|
3324
3336
|
r.rel = "stylesheet", r.href = t, document.head.appendChild(r);
|
|
3325
3337
|
}, [t]);
|
|
3326
3338
|
}
|
|
3327
|
-
let
|
|
3328
|
-
function
|
|
3329
|
-
const [r, n] =
|
|
3339
|
+
let Oo = 0;
|
|
3340
|
+
function Go(t = 5, e = 5e3) {
|
|
3341
|
+
const [r, n] = z([]), o = v(/* @__PURE__ */ new Map()), s = U((i) => {
|
|
3330
3342
|
const a = o.current.get(i);
|
|
3331
3343
|
a && (clearTimeout(a), o.current.delete(i)), n((u) => u.filter((f) => f.id !== i));
|
|
3332
3344
|
}, []);
|
|
3333
|
-
return
|
|
3345
|
+
return O(() => {
|
|
3334
3346
|
const i = o.current, a = Gt(
|
|
3335
3347
|
(u) => {
|
|
3336
3348
|
if (!Jt())
|
|
3337
3349
|
return;
|
|
3338
|
-
const f = `toast-${++
|
|
3350
|
+
const f = `toast-${++Oo}`, h = u.level === Xe.ERROR ? "error" : "warn", p = {
|
|
3339
3351
|
id: f,
|
|
3340
3352
|
level: h,
|
|
3341
3353
|
message: u.message,
|
|
@@ -3357,102 +3369,121 @@ function Ho(t = 5, e = 5e3) {
|
|
|
3357
3369
|
};
|
|
3358
3370
|
}, [t, e, s]), { toasts: r, dismissToast: s };
|
|
3359
3371
|
}
|
|
3372
|
+
function Jo(t, e, r) {
|
|
3373
|
+
const [n, o] = z(r);
|
|
3374
|
+
return O(() => {
|
|
3375
|
+
if (!t)
|
|
3376
|
+
return;
|
|
3377
|
+
let s = !0, i = null;
|
|
3378
|
+
return t.reactiveRegistry.subscribe(e, (a) => {
|
|
3379
|
+
s && o(a);
|
|
3380
|
+
}).then((a) => {
|
|
3381
|
+
s ? i = a : a();
|
|
3382
|
+
}).catch((a) => {
|
|
3383
|
+
console.warn(`useIkonReactive: subscribe to '${e}' failed`, a);
|
|
3384
|
+
}), () => {
|
|
3385
|
+
s = !1, i?.();
|
|
3386
|
+
};
|
|
3387
|
+
}, [t, e]), n;
|
|
3388
|
+
}
|
|
3360
3389
|
const Pt = gt(null);
|
|
3361
|
-
function
|
|
3390
|
+
function No(t, e) {
|
|
3362
3391
|
return e ? t.replace(/\{(\w+)\}/g, (r, n) => e[n] ?? `{${n}}`) : t;
|
|
3363
3392
|
}
|
|
3364
|
-
function
|
|
3393
|
+
function Po(t, e) {
|
|
3365
3394
|
const r = Xt();
|
|
3366
3395
|
if (r && t.includes(r))
|
|
3367
3396
|
return r;
|
|
3368
3397
|
const n = navigator.language.split("-")[0];
|
|
3369
3398
|
return t.includes(n) ? n : e && t.includes(e) ? e : "en";
|
|
3370
3399
|
}
|
|
3371
|
-
function
|
|
3372
|
-
return e ?
|
|
3400
|
+
function Mo(t, e, r) {
|
|
3401
|
+
return e ? Po(t, r) : r && t.includes(r) ? r : "en";
|
|
3373
3402
|
}
|
|
3374
|
-
function
|
|
3403
|
+
function Xo({
|
|
3375
3404
|
children: t,
|
|
3376
3405
|
translations: e,
|
|
3377
3406
|
defaultLanguage: r,
|
|
3378
3407
|
detectLanguage: n = !1
|
|
3379
3408
|
}) {
|
|
3380
|
-
const o = Object.keys(e), s =
|
|
3409
|
+
const o = Object.keys(e), s = Mo(o, n, r), i = e[s] ?? e.en, a = $(
|
|
3381
3410
|
() => ({
|
|
3382
3411
|
t: (u, f) => {
|
|
3383
3412
|
const h = i[u];
|
|
3384
|
-
return
|
|
3413
|
+
return No(h, f);
|
|
3385
3414
|
},
|
|
3386
3415
|
locale: s,
|
|
3387
3416
|
translations: i
|
|
3388
3417
|
}),
|
|
3389
3418
|
[i, s]
|
|
3390
3419
|
);
|
|
3391
|
-
return /* @__PURE__ */
|
|
3420
|
+
return /* @__PURE__ */ E.jsx(Pt, { value: a, children: t });
|
|
3392
3421
|
}
|
|
3393
|
-
function
|
|
3422
|
+
function Zo() {
|
|
3394
3423
|
const t = Ke(Pt);
|
|
3395
3424
|
if (!t)
|
|
3396
3425
|
throw new Error("useI18n must be used within an I18nProvider");
|
|
3397
3426
|
return t;
|
|
3398
3427
|
}
|
|
3399
3428
|
export {
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3429
|
+
zo as AuthProvider,
|
|
3430
|
+
Wo as ConnectionStateRenderer,
|
|
3431
|
+
Xo as I18nProvider,
|
|
3432
|
+
Or as IKON_UI_BASE_MODULE,
|
|
3433
|
+
Vr as IKON_UI_MEDIA_MODULE,
|
|
3434
|
+
nn as IKON_UI_SHADERTOY_MODULE,
|
|
3435
|
+
tn as IKON_UI_SHADERTOY_TYPE,
|
|
3407
3436
|
Ue as IKON_UI_STREAM_CATEGORY,
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3437
|
+
jr as IKON_UI_VIDEO_CANVAS_TYPE,
|
|
3438
|
+
Dr as IKON_UI_VIDEO_URL_PLAYER_TYPE,
|
|
3439
|
+
gr as IkonUi,
|
|
3440
|
+
an as IkonUiRegistry,
|
|
3441
|
+
mr as IkonUiSurface,
|
|
3413
3442
|
fr as InspectOverlay,
|
|
3443
|
+
Bo as ParallaxView,
|
|
3414
3444
|
dr as UiComponentRegistry,
|
|
3415
3445
|
lr as UiRenderer,
|
|
3416
|
-
|
|
3417
|
-
|
|
3446
|
+
ts as UiStreamStore,
|
|
3447
|
+
Fo as areIkonUiModuleListsEqual,
|
|
3418
3448
|
Ct as authenticateAnonymous,
|
|
3419
|
-
|
|
3449
|
+
po as buildOAuthRedirectUrl,
|
|
3420
3450
|
Ae as clearAuthSession,
|
|
3421
3451
|
mt as clearOAuthParams,
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3452
|
+
_r as createBaseResolvers,
|
|
3453
|
+
jo as createComponentLibrary,
|
|
3454
|
+
cn as createIkonUiRegistry,
|
|
3455
|
+
Fr as createMediaResolvers,
|
|
3456
|
+
rn as createShadertoyRendererResolver,
|
|
3427
3457
|
hr as isIkonUiCategoryMatch,
|
|
3428
3458
|
At as loadAuthSession,
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3459
|
+
Nr as loadBaseModule,
|
|
3460
|
+
Kr as loadMediaModule,
|
|
3461
|
+
on as loadShadertoyModule,
|
|
3462
|
+
xn as normalizeIkonUiModuleList,
|
|
3463
|
+
Vo as parseIkonUiInitPayload,
|
|
3464
|
+
lo as parseOAuthCallback,
|
|
3465
|
+
fo as parseOAuthError,
|
|
3466
|
+
Un as readIkonUiModules,
|
|
3467
|
+
$o as readIkonUiModulesFromSources,
|
|
3468
|
+
Pr as registerBaseModule,
|
|
3469
|
+
zr as registerMediaModule,
|
|
3470
|
+
sn as registerShadertoyModule,
|
|
3441
3471
|
cr as renderChildren,
|
|
3442
|
-
|
|
3472
|
+
Ko as renderMotionLetters,
|
|
3443
3473
|
pe as saveAuthSession,
|
|
3444
|
-
|
|
3474
|
+
co as sendLoginCode,
|
|
3445
3475
|
ee as sessionToUser,
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
Ho as
|
|
3476
|
+
To as useAuth,
|
|
3477
|
+
Yo as useAuthGuard,
|
|
3478
|
+
Co as useAuthOptional,
|
|
3479
|
+
Zo as useI18n,
|
|
3480
|
+
qo as useIkonApp,
|
|
3481
|
+
Jo as useIkonReactive,
|
|
3482
|
+
gn as useIkonStyles,
|
|
3483
|
+
bn as useIkonUiStores,
|
|
3484
|
+
Ho as useLazyFont,
|
|
3485
|
+
Go as useToasts,
|
|
3455
3486
|
J as useUiNode,
|
|
3456
|
-
|
|
3457
|
-
|
|
3487
|
+
Do as useUiStore,
|
|
3488
|
+
uo as verifyLoginCode
|
|
3458
3489
|
};
|