@ikonai/sdk-react-ui 1.0.73 → 1.0.74

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.
Files changed (2) hide show
  1. package/index.js +460 -438
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { IkonUiCore as Sn, UiStreamStore as wn, LiveSnapshotCache as Ut, prefetchBootSnapshot as vn } from "@ikonai/sdk-ui";
2
- import { UiStreamStore as Fs } from "@ikonai/sdk-ui";
3
- import En, { useSyncExternalStore as ot, useMemo as W, memo as G, useRef as E, useCallback as j, Fragment as Rn, useEffect as C, useState as x, use as st, createContext as Mt, useReducer as An } from "react";
2
+ import { UiStreamStore as Vs } from "@ikonai/sdk-ui";
3
+ import En, { useSyncExternalStore as ot, useMemo as V, memo as G, useRef as E, useCallback as j, Fragment as Rn, useEffect as C, useState as x, use as st, createContext as Mt, useReducer as An } from "react";
4
4
  import { createLogger as oe, isInspectModeEnabled as Tn, getOrCreateDeviceId as kn, getSameOriginAuthUrl as Cn, abortSignalTimeout as Dt, deriveAuthUrl as ve, getDebugOverlayParam as _n, subscribeToLogEvents as jt, LogLevel as Je, parseUrlParams as In, clearSessionParamsFromUrl as On, isCloudEnvironment as ht, extractUserIdFromToken as pt, deriveBackendType as mt, IkonClient as xn, reportConnectTimeline as Nn, AccessDeniedError as Ln, ServerFullError as Pn, AuthenticationError as Un, isDebugModeEnabled as $t, getLangParam as Mn } from "@ikonai/sdk";
5
- import { randomUuid as Ws } from "@ikonai/sdk";
5
+ import { randomUuid as Ys } from "@ikonai/sdk";
6
6
  var Ce = { exports: {} }, ge = {};
7
7
  /**
8
8
  * @license React
@@ -56,9 +56,9 @@ function jn() {
56
56
  switch (d) {
57
57
  case p:
58
58
  return "Fragment";
59
- case S:
59
+ case y:
60
60
  return "Profiler";
61
- case b:
61
+ case S:
62
62
  return "StrictMode";
63
63
  case U:
64
64
  return "Suspense";
@@ -193,13 +193,13 @@ function jn() {
193
193
  if (N)
194
194
  if ($(L)) {
195
195
  for (N = 0; N < L.length; N++)
196
- y(L[N]);
196
+ b(L[N]);
197
197
  Object.freeze && Object.freeze(L);
198
198
  } else
199
199
  console.error(
200
200
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
201
201
  );
202
- else y(L);
202
+ else b(L);
203
203
  if (B.call(A, "key")) {
204
204
  L = t(d);
205
205
  var Q = Object.keys(A).filter(function(Me) {
@@ -235,13 +235,13 @@ React keys must be passed directly to JSX without using spread:
235
235
  me
236
236
  );
237
237
  }
238
- function y(d) {
238
+ function b(d) {
239
239
  m(d) ? d._store && (d._store.validated = 1) : typeof d == "object" && d !== null && d.$$typeof === z && (d._payload.status === "fulfilled" ? m(d._payload.value) && d._payload.value._store && (d._payload.value._store.validated = 1) : d._store && (d._store.validated = 1));
240
240
  }
241
241
  function m(d) {
242
242
  return typeof d == "object" && d !== null && d.$$typeof === u;
243
243
  }
244
- var c = En, u = Symbol.for("react.transitional.element"), g = Symbol.for("react.portal"), p = Symbol.for("react.fragment"), b = Symbol.for("react.strict_mode"), S = Symbol.for("react.profiler"), R = Symbol.for("react.consumer"), v = Symbol.for("react.context"), T = Symbol.for("react.forward_ref"), U = Symbol.for("react.suspense"), ee = Symbol.for("react.suspense_list"), te = Symbol.for("react.memo"), z = Symbol.for("react.lazy"), I = Symbol.for("react.activity"), P = Symbol.for("react.client.reference"), M = c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, B = Object.prototype.hasOwnProperty, $ = Array.isArray, V = console.createTask ? console.createTask : function() {
244
+ var c = En, u = Symbol.for("react.transitional.element"), g = Symbol.for("react.portal"), p = Symbol.for("react.fragment"), S = Symbol.for("react.strict_mode"), y = Symbol.for("react.profiler"), R = Symbol.for("react.consumer"), v = Symbol.for("react.context"), T = Symbol.for("react.forward_ref"), U = Symbol.for("react.suspense"), ee = Symbol.for("react.suspense_list"), te = Symbol.for("react.memo"), z = Symbol.for("react.lazy"), I = Symbol.for("react.activity"), P = Symbol.for("react.client.reference"), M = c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, B = Object.prototype.hasOwnProperty, $ = Array.isArray, W = console.createTask ? console.createTask : function() {
245
245
  return null;
246
246
  };
247
247
  c = {
@@ -252,7 +252,7 @@ React keys must be passed directly to JSX without using spread:
252
252
  var K, H = {}, Ee = c.react_stack_bottom_frame.bind(
253
253
  c,
254
254
  s
255
- )(), Re = V(r(s)), pe = {};
255
+ )(), Re = W(r(s)), pe = {};
256
256
  ye.Fragment = p, ye.jsx = function(d, A, O) {
257
257
  var N = 1e4 > M.recentlyCreatedOwnerStacks++;
258
258
  return f(
@@ -261,7 +261,7 @@ React keys must be passed directly to JSX without using spread:
261
261
  O,
262
262
  !1,
263
263
  N ? Error("react-stack-top-frame") : Ee,
264
- N ? V(r(d)) : Re
264
+ N ? W(r(d)) : Re
265
265
  );
266
266
  }, ye.jsxs = function(d, A, O) {
267
267
  var N = 1e4 > M.recentlyCreatedOwnerStacks++;
@@ -271,7 +271,7 @@ React keys must be passed directly to JSX without using spread:
271
271
  O,
272
272
  !0,
273
273
  N ? Error("react-stack-top-frame") : Ee,
274
- N ? V(r(d)) : Re
274
+ N ? W(r(d)) : Re
275
275
  );
276
276
  };
277
277
  })()), ye;
@@ -293,7 +293,7 @@ function Bn(t, e) {
293
293
  return `${o ?? ""}:${s?.id ?? ""}`;
294
294
  }
295
295
  );
296
- return W(() => {
296
+ return V(() => {
297
297
  const [r, o] = n.split(":");
298
298
  return {
299
299
  rootViewId: r || void 0,
@@ -307,10 +307,10 @@ function Z(t, e) {
307
307
  () => t.getNodeVersion(e),
308
308
  () => t.getNodeVersion(e)
309
309
  );
310
- return W(() => t.getNode(e), [t, e, n]);
310
+ return V(() => t.getNode(e), [t, e, n]);
311
311
  }
312
312
  const Fn = oe("UIRenderer");
313
- function Vn(t) {
313
+ function Wn(t) {
314
314
  if (t === void 0)
315
315
  return "{}";
316
316
  if (typeof t == "string")
@@ -321,7 +321,7 @@ function Vn(t) {
321
321
  return "{}";
322
322
  }
323
323
  }
324
- function Wn(t) {
324
+ function Vn(t) {
325
325
  const e = t.styleIds;
326
326
  return Array.isArray(e) ? e : [];
327
327
  }
@@ -341,8 +341,8 @@ function Gn(t) {
341
341
  return e;
342
342
  }
343
343
  const Ze = G(function t({ nodeId: e, context: n }) {
344
- const r = Z(n.store, e), o = r ? Kn(r) : [], s = Gn(o), i = W(
345
- () => o.length === 0 ? null : o.map((y) => /* @__PURE__ */ w.jsx(t, { nodeId: y.id, context: n }, y.id)),
344
+ const r = Z(n.store, e), o = r ? Kn(r) : [], s = Gn(o), i = V(
345
+ () => o.length === 0 ? null : o.map((b) => /* @__PURE__ */ w.jsx(t, { nodeId: b.id, context: n }, b.id)),
346
346
  // eslint-disable-next-line react-hooks/exhaustive-deps
347
347
  [s, n]
348
348
  );
@@ -353,7 +353,7 @@ const Ze = G(function t({ nodeId: e, context: n }) {
353
353
  const a = n.library.resolve(r);
354
354
  if (!a)
355
355
  return Fn.warn(`No renderer for node type ${r.type}`), null;
356
- const l = Wn(r), h = l.length > 0 ? l.join(" ") : void 0, f = a;
356
+ const l = Vn(r), h = l.length > 0 ? l.join(" ") : void 0, f = a;
357
357
  return /* @__PURE__ */ w.jsx(f, { nodeId: e, context: n, className: h });
358
358
  }, Yn);
359
359
  function zn(t, e) {
@@ -365,16 +365,16 @@ function Xn(t, e) {
365
365
  const Hn = G(function({ store: e, library: n, viewId: r, emptyFallback: o = null, onAction: s, client: i, video: a }) {
366
366
  const { rootViewId: l, rootNodeId: h } = Bn(e, r), f = E(s);
367
367
  f.current = s;
368
- const y = E(i);
369
- y.current = i;
368
+ const b = E(i);
369
+ b.current = i;
370
370
  const m = E(a);
371
371
  m.current = a;
372
372
  const c = j((g, p) => {
373
373
  if (!g)
374
374
  return;
375
- const b = Vn(p);
376
- f.current?.(g, b);
377
- }, []), u = W(() => {
375
+ const S = Wn(p);
376
+ f.current?.(g, S);
377
+ }, []), u = V(() => {
378
378
  const g = {
379
379
  store: e,
380
380
  library: n,
@@ -383,13 +383,13 @@ const Hn = G(function({ store: e, library: n, viewId: r, emptyFallback: o = null
383
383
  getPayload: (p) => e.getSnapshot().payloads.get(p),
384
384
  renderChildren: (p) => zn(p, g),
385
385
  renderView: (p) => {
386
- const b = e.getSnapshot().views.get(p);
387
- return b ? /* @__PURE__ */ w.jsx(Ze, { nodeId: b.id, context: g }) : null;
386
+ const S = e.getSnapshot().views.get(p);
387
+ return S ? /* @__PURE__ */ w.jsx(Ze, { nodeId: S.id, context: g }) : null;
388
388
  },
389
389
  dispatchAction: c,
390
390
  // Access client/video via refs to avoid context recreation
391
391
  get client() {
392
- return y.current;
392
+ return b.current;
393
393
  },
394
394
  get video() {
395
395
  return m.current;
@@ -416,11 +416,11 @@ class qn {
416
416
  return this.renderers.get(e.type) ?? this.fallback;
417
417
  }
418
418
  }
419
- function ks(t, e) {
419
+ function _s(t, e) {
420
420
  const n = Object.entries(t);
421
421
  return new qn(n, e);
422
422
  }
423
- function Cs(t) {
423
+ function Is(t) {
424
424
  return ot(
425
425
  (e) => t.subscribe(e),
426
426
  () => t.getSnapshot(),
@@ -482,7 +482,7 @@ function Jn() {
482
482
  function f(c, u) {
483
483
  return document.elementFromPoint(c, u)?.closest?.("[data-ikon-source]");
484
484
  }
485
- function y(c) {
485
+ function b(c) {
486
486
  if (c === n || (s(), !c))
487
487
  return;
488
488
  n = c, n.style.outline = `2px solid ${r.includes(c) ? "#a6e3a1" : "#89b4fa"}`, n.style.outlineOffset = "1px";
@@ -499,7 +499,7 @@ function Jn() {
499
499
  }
500
500
  if (c.data?.type === "ikon-inspect-at") {
501
501
  const u = f(c.data.x, c.data.y);
502
- y(u);
502
+ b(u);
503
503
  const g = u?.getAttribute("data-ikon-source") ?? "";
504
504
  window.parent.postMessage({
505
505
  type: "ikon-inspect-hover-result",
@@ -532,10 +532,10 @@ function Jn() {
532
532
  }
533
533
  }
534
534
  if (c.data?.type === "ikon-inspect-rect") {
535
- const { x1: u, y1: g, x2: p, y2: b, append: S } = c.data, R = document.querySelectorAll("[data-ikon-source]"), v = [];
535
+ const { x1: u, y1: g, x2: p, y2: S, append: y } = c.data, R = document.querySelectorAll("[data-ikon-source]"), v = [];
536
536
  for (const T of Array.from(R)) {
537
537
  const U = T.getBoundingClientRect();
538
- U.right > u && U.left < p && U.bottom > g && U.top < b && v.push({
538
+ U.right > u && U.left < p && U.bottom > g && U.top < S && v.push({
539
539
  sourceMarker: T.getAttribute("data-ikon-source") ?? "",
540
540
  tagName: T.tagName.toLowerCase(),
541
541
  textContent: (T.textContent ?? "").trim().substring(0, 200)
@@ -543,7 +543,7 @@ function Jn() {
543
543
  }
544
544
  v.length > 0 && window.parent.postMessage({
545
545
  type: "ikon-inspect-rect-result",
546
- payload: { elements: v, append: S ?? !1 }
546
+ payload: { elements: v, append: y ?? !1 }
547
547
  }, "*");
548
548
  }
549
549
  c.data?.type === "ikon-inspect-highlight" && i(c.data.markers ?? []), c.data?.type === "ikon-inspect-clear" && s();
@@ -558,11 +558,11 @@ function Qn(t, e) {
558
558
  return t === e;
559
559
  }
560
560
  const Bt = G(function({ stores: e, registry: n, category: r = Qe, onAction: o, client: s }) {
561
- const i = W(() => Array.from(e.keys()).sort().join(","), [e]), a = E(o);
561
+ const i = V(() => Array.from(e.keys()).sort().join(","), [e]), a = E(o);
562
562
  a.current = o;
563
563
  const l = E(s);
564
564
  l.current = s;
565
- const h = W(
565
+ const h = V(
566
566
  () => {
567
567
  const m = [];
568
568
  for (const [c, u] of e) {
@@ -573,10 +573,10 @@ const Bt = G(function({ stores: e, registry: n, category: r = Qe, onAction: o, c
573
573
  },
574
574
  // eslint-disable-next-line react-hooks/exhaustive-deps
575
575
  [e, r, i]
576
- ), f = E(!1), y = h.length > 0;
576
+ ), f = E(!1), b = h.length > 0;
577
577
  return C(() => {
578
- y && !f.current && (f.current = !0, Zn.debug("First UI render"));
579
- }, [y]), y ? /* @__PURE__ */ w.jsxs(w.Fragment, { children: [
578
+ b && !f.current && (f.current = !0, Zn.debug("First UI render"));
579
+ }, [b]), b ? /* @__PURE__ */ w.jsxs(w.Fragment, { children: [
580
580
  /* @__PURE__ */ w.jsx(Jn, {}),
581
581
  h.map(({ key: m, store: c }) => /* @__PURE__ */ w.jsx(Hn, { store: c, library: n, onAction: a.current, client: l.current, video: l.current?.media?.video }, m))
582
582
  ] }) : null;
@@ -710,6 +710,22 @@ function it(...t) {
710
710
  return e || void 0;
711
711
  }
712
712
  const St = /* @__PURE__ */ new WeakMap(), nr = {};
713
+ function rr(t) {
714
+ const e = {};
715
+ for (const n of t.split(";")) {
716
+ const r = n.indexOf(":");
717
+ if (r <= 0) continue;
718
+ const o = n.slice(0, r).trim(), s = n.slice(r + 1).trim();
719
+ if (!o || !s) continue;
720
+ const i = o.startsWith("--") ? o : o.replace(/-([a-z])/g, (a, l) => l.toUpperCase());
721
+ e[i] = s;
722
+ }
723
+ return e;
724
+ }
725
+ function or(t, e) {
726
+ const n = t && typeof t == "object" ? t : void 0;
727
+ return e ? { ...n ?? {}, cursor: e } : n;
728
+ }
713
729
  function at(t) {
714
730
  if (!t)
715
731
  return nr;
@@ -718,10 +734,16 @@ function at(t) {
718
734
  return e;
719
735
  const n = {};
720
736
  for (const [r, o] of Object.entries(t))
721
- o != null && (typeof o == "string" || typeof o == "number" || typeof o == "boolean") && (n[r] = o);
737
+ if (o != null) {
738
+ if (r === "style" && typeof o == "string") {
739
+ n[r] = rr(o);
740
+ continue;
741
+ }
742
+ (typeof o == "string" || typeof o == "number" || typeof o == "boolean") && (n[r] = o);
743
+ }
722
744
  return St.set(t, n), n;
723
745
  }
724
- function rr(t) {
746
+ function sr(t) {
725
747
  let e = t.parentElement;
726
748
  for (; e; ) {
727
749
  const r = window.getComputedStyle(e).overflowY;
@@ -732,26 +754,26 @@ function rr(t) {
732
754
  return null;
733
755
  }
734
756
  const Ft = 1.5;
735
- function Vt(t, e) {
757
+ function Wt(t, e) {
736
758
  requestAnimationFrame(() => {
737
759
  const n = t.getBoundingClientRect(), r = e.getBoundingClientRect(), o = t.scrollTop + (r.bottom - n.bottom) + 16, i = Math.abs(o - t.scrollTop) > t.clientHeight * Ft ? "auto" : "smooth";
738
760
  "scrollBehavior" in document.documentElement.style ? t.scrollTo({ top: o, behavior: i }) : t.scrollTop = o;
739
761
  });
740
762
  }
741
- const et = "data-ikon-scroll-indicator", or = 0.15, xe = "data-ikon-at-bottom";
742
- function Wt(t) {
743
- return Math.max(t.clientHeight * or, 20);
763
+ const et = "data-ikon-scroll-indicator", ir = 0.15, xe = "data-ikon-at-bottom";
764
+ function Vt(t) {
765
+ return Math.max(t.clientHeight * ir, 20);
744
766
  }
745
- function sr(t) {
767
+ function ar(t) {
746
768
  return t.getAttribute(xe) !== "false";
747
769
  }
748
- function ir(t) {
770
+ function cr(t) {
749
771
  t.getAttribute(xe) === null && (t.setAttribute(xe, "true"), t.addEventListener("scroll", () => {
750
- const { scrollTop: e, scrollHeight: n, clientHeight: r } = t, s = n - e - r <= Wt(t);
772
+ const { scrollTop: e, scrollHeight: n, clientHeight: r } = t, s = n - e - r <= Vt(t);
751
773
  t.setAttribute(xe, s ? "true" : "false");
752
774
  }, { passive: !0 }));
753
775
  }
754
- function ar(t) {
776
+ function lr(t) {
755
777
  const e = t.parentElement ?? t, n = e.querySelector(`[${et}]`);
756
778
  if (n)
757
779
  return n;
@@ -784,22 +806,22 @@ function ar(t) {
784
806
  r.style.opacity = "0.9";
785
807
  }), e.appendChild(r), r;
786
808
  }
787
- function cr(t, e) {
788
- const n = ar(t);
809
+ function ur(t, e) {
810
+ const n = lr(t);
789
811
  n.style.display = "flex";
790
812
  const r = () => {
791
- Vt(t, e), n.style.display = "none";
813
+ Wt(t, e), n.style.display = "none";
792
814
  }, o = () => {
793
815
  const { scrollTop: s, scrollHeight: i, clientHeight: a } = t;
794
- i - s - a <= Wt(t) && (n.style.display = "none");
816
+ i - s - a <= Vt(t) && (n.style.display = "none");
795
817
  };
796
818
  return n.addEventListener("click", r), t.addEventListener("scroll", o, { passive: !0 }), () => {
797
819
  n.removeEventListener("click", r), t.removeEventListener("scroll", o);
798
820
  };
799
821
  }
800
- function lr() {
822
+ function dr() {
801
823
  const t = G(function({ nodeId: n, context: r }) {
802
- const o = Z(r.store, n), s = E(null), i = de(o?.props?.targetViewId), a = o?.props?.focusOnly, l = typeof a == "boolean" ? a : void 0, h = de(o?.props?.priority), f = de(o?.props?.key), y = o?.props?.preciseGeneratedAt;
824
+ const o = Z(r.store, n), s = E(null), i = de(o?.props?.targetViewId), a = o?.props?.focusOnly, l = typeof a == "boolean" ? a : void 0, h = de(o?.props?.priority), f = de(o?.props?.key), b = o?.props?.preciseGeneratedAt;
803
825
  return C(() => {
804
826
  if (typeof document > "u")
805
827
  return;
@@ -808,13 +830,13 @@ function lr() {
808
830
  return;
809
831
  let u;
810
832
  if (l !== !0) {
811
- const S = rr(c);
812
- if (S)
813
- if (ir(S), h === "Polite" && !sr(S))
814
- u = cr(S, c);
833
+ const y = sr(c);
834
+ if (y)
835
+ if (cr(y), h === "Polite" && !ar(y))
836
+ u = ur(y, c);
815
837
  else {
816
- const U = (S.parentElement ?? S).querySelector(`[${et}]`);
817
- U && (U.style.display = "none"), Vt(S, c);
838
+ const U = (y.parentElement ?? y).querySelector(`[${et}]`);
839
+ U && (U.style.display = "none"), Wt(y, c);
818
840
  }
819
841
  else typeof c.scrollIntoView == "function" && requestAnimationFrame(() => {
820
842
  const R = c.getBoundingClientRect().top, v = typeof window < "u" ? window.innerHeight : 0, T = Math.abs(R) > v * Ft ? "auto" : "smooth";
@@ -833,7 +855,7 @@ function lr() {
833
855
  c.focus();
834
856
  }
835
857
  return u;
836
- }, [l, h, i, f, y]), o ? /* @__PURE__ */ w.jsx(
858
+ }, [l, h, i, f, b]), o ? /* @__PURE__ */ w.jsx(
837
859
  "span",
838
860
  {
839
861
  ref: s,
@@ -850,7 +872,7 @@ function lr() {
850
872
  return t;
851
873
  };
852
874
  }
853
- function ur() {
875
+ function fr() {
854
876
  const t = G(function({ nodeId: n, context: r, className: o }) {
855
877
  const s = Z(r.store, n), i = tr(s?.props?.onInvokeId), a = j(() => {
856
878
  i && r.dispatchAction(i);
@@ -868,7 +890,7 @@ function ur() {
868
890
  "data-ikon-source": s.sourceMarker,
869
891
  className: h,
870
892
  onClick: i ? a : void 0,
871
- style: i ? { cursor: "pointer" } : void 0,
893
+ style: or(l.style, i ? "pointer" : void 0),
872
894
  children: f
873
895
  }
874
896
  );
@@ -878,7 +900,7 @@ function ur() {
878
900
  return t;
879
901
  };
880
902
  }
881
- function dr() {
903
+ function hr() {
882
904
  const t = G(function({ nodeId: n, context: r, className: o }) {
883
905
  const s = Z(r.store, n);
884
906
  if (!s)
@@ -891,7 +913,7 @@ function dr() {
891
913
  return t;
892
914
  };
893
915
  }
894
- function fr() {
916
+ function pr() {
895
917
  const t = G(function({ nodeId: n, context: r, className: o }) {
896
918
  const s = Z(r.store, n);
897
919
  if (!s)
@@ -904,19 +926,19 @@ function fr() {
904
926
  return t;
905
927
  };
906
928
  }
907
- function hr() {
929
+ function mr() {
908
930
  return [
909
- ur(),
910
- dr(),
911
931
  fr(),
912
- lr()
932
+ hr(),
933
+ pr(),
934
+ dr()
913
935
  ];
914
936
  }
915
- const pr = "base", mr = async () => hr();
916
- function gr(t) {
917
- t.registerModule(pr, mr);
937
+ const gr = "base", yr = async () => mr();
938
+ function br(t) {
939
+ t.registerModule(gr, yr);
918
940
  }
919
- function yr(t) {
941
+ function Sr(t) {
920
942
  if (typeof t == "string") {
921
943
  const e = t.trim();
922
944
  return e.length > 0 ? e : void 0;
@@ -926,7 +948,7 @@ function yr(t) {
926
948
  return e.length > 0 ? e.join(" ") : void 0;
927
949
  }
928
950
  }
929
- function br(...t) {
951
+ function wr(...t) {
930
952
  const e = [];
931
953
  for (const n of t)
932
954
  n && n.trim() && e.push(n.trim());
@@ -947,8 +969,8 @@ function _e(t) {
947
969
  if (e === "false") return !1;
948
970
  }
949
971
  }
950
- const Sr = "std.audio-url-player";
951
- function wr() {
972
+ const vr = "std.audio-url-player";
973
+ function Er() {
952
974
  const t = G(function({
953
975
  nodeId: n,
954
976
  context: r,
@@ -960,14 +982,14 @@ function wr() {
960
982
  });
961
983
  }, [a, l]), !s)
962
984
  return null;
963
- const h = br(yr(s.props?.className), o), f = wt(s.props?.preload), y = _e(s.props?.controls), m = _e(s.props?.loop), c = _e(s.props?.muted);
985
+ const h = wr(Sr(s.props?.className), o), f = wt(s.props?.preload), b = _e(s.props?.controls), m = _e(s.props?.loop), c = _e(s.props?.muted);
964
986
  return /* @__PURE__ */ w.jsx(
965
987
  "audio",
966
988
  {
967
989
  ref: i,
968
990
  src: l,
969
991
  ...f !== void 0 ? { preload: f } : {},
970
- ...y !== void 0 ? { controls: y } : {},
992
+ ...b !== void 0 ? { controls: b } : {},
971
993
  ...a !== void 0 ? { autoPlay: a } : {},
972
994
  ...m !== void 0 ? { loop: m } : {},
973
995
  ...c !== void 0 ? { muted: c } : {},
@@ -978,7 +1000,7 @@ function wr() {
978
1000
  );
979
1001
  });
980
1002
  return ({ type: e }) => {
981
- if (e === Sr)
1003
+ if (e === vr)
982
1004
  return t;
983
1005
  };
984
1006
  }
@@ -1013,15 +1035,15 @@ function tt(t) {
1013
1035
  const e = t.trim();
1014
1036
  return e.length > 0 ? e : void 0;
1015
1037
  }
1016
- const vr = "std.video-canvas", Er = "std.video-url-player";
1017
- function Rr() {
1038
+ const Rr = "std.video-canvas", Ar = "std.video-url-player";
1039
+ function Tr() {
1018
1040
  const t = G(function({ nodeId: n, context: r, className: o }) {
1019
- const s = Z(r.store, n), i = E(null), a = E(null), l = r.video, h = r.client, f = s ? tt(s.props?.streamId) : void 0, y = s ? Ne(s.props?.width) : void 0, m = s ? Ne(s.props?.height) : void 0, c = s ? Yt(Kt(s.props?.className), o) : o, [, u] = x(0);
1041
+ const s = Z(r.store, n), i = E(null), a = E(null), l = r.video, h = r.client, f = s ? tt(s.props?.streamId) : void 0, b = s ? Ne(s.props?.width) : void 0, m = s ? Ne(s.props?.height) : void 0, c = s ? Yt(Kt(s.props?.className), o) : o, [, u] = x(0);
1020
1042
  C(() => {
1021
1043
  if (!h?.isWebRtcEnabled) return;
1022
1044
  const p = h.onWebRtcTrackMapChanged;
1023
- return h.onWebRtcTrackMapChanged = (b) => {
1024
- p?.(b), b.kind === "video" && u((S) => S + 1);
1045
+ return h.onWebRtcTrackMapChanged = (S) => {
1046
+ p?.(S), S.kind === "video" && u((y) => y + 1);
1025
1047
  }, () => {
1026
1048
  h.onWebRtcTrackMapChanged = p;
1027
1049
  };
@@ -1050,7 +1072,7 @@ function Rr() {
1050
1072
  "data-ikon-source": s.sourceMarker,
1051
1073
  "data-ikon-video-stream-id": f,
1052
1074
  className: c,
1053
- ...y ? { width: y } : {},
1075
+ ...b ? { width: b } : {},
1054
1076
  ...m ? { height: m } : {}
1055
1077
  },
1056
1078
  f
@@ -1062,19 +1084,19 @@ function Rr() {
1062
1084
  "data-ikon-source": s.sourceMarker,
1063
1085
  "data-ikon-video-stream-id": f,
1064
1086
  className: c,
1065
- ...y ? { width: y } : {},
1087
+ ...b ? { width: b } : {},
1066
1088
  ...m ? { height: m } : {}
1067
1089
  },
1068
1090
  f
1069
1091
  ) : null;
1070
1092
  });
1071
1093
  return ({ type: e }) => {
1072
- if (e === vr)
1094
+ if (e === Rr)
1073
1095
  return t;
1074
1096
  };
1075
1097
  }
1076
- function Ar() {
1077
- return [Rr(), Tr(), wr()];
1098
+ function kr() {
1099
+ return [Tr(), Cr(), Er()];
1078
1100
  }
1079
1101
  function be(t) {
1080
1102
  if (typeof t == "boolean")
@@ -1085,7 +1107,7 @@ function be(t) {
1085
1107
  if (e === "false") return !1;
1086
1108
  }
1087
1109
  }
1088
- function Tr() {
1110
+ function Cr() {
1089
1111
  const t = G(function({
1090
1112
  nodeId: n,
1091
1113
  context: r,
@@ -1097,14 +1119,14 @@ function Tr() {
1097
1119
  });
1098
1120
  }, [a, l]), !s)
1099
1121
  return null;
1100
- const h = Yt(Kt(s.props?.className), o), f = tt(s.props?.poster), y = be(s.props?.controls), m = be(s.props?.loop), c = be(s.props?.muted), u = be(s.props?.playsInline), g = Ne(s.props?.width), p = Ne(s.props?.height), b = s.children?.length ? r.renderChildren(s.children) : void 0;
1122
+ const h = Yt(Kt(s.props?.className), o), f = tt(s.props?.poster), b = be(s.props?.controls), m = be(s.props?.loop), c = be(s.props?.muted), u = be(s.props?.playsInline), g = Ne(s.props?.width), p = Ne(s.props?.height), S = s.children?.length ? r.renderChildren(s.children) : void 0;
1101
1123
  return /* @__PURE__ */ w.jsx(
1102
1124
  "video",
1103
1125
  {
1104
1126
  ref: i,
1105
1127
  src: l,
1106
1128
  poster: f,
1107
- ...y !== void 0 ? { controls: y } : {},
1129
+ ...b !== void 0 ? { controls: b } : {},
1108
1130
  ...a !== void 0 ? { autoPlay: a } : {},
1109
1131
  ...m !== void 0 ? { loop: m } : {},
1110
1132
  ...c !== void 0 ? { muted: c } : {},
@@ -1114,32 +1136,32 @@ function Tr() {
1114
1136
  "data-ikon-node-id": s.id,
1115
1137
  "data-ikon-source": s.sourceMarker,
1116
1138
  className: h,
1117
- children: b
1139
+ children: S
1118
1140
  }
1119
1141
  );
1120
1142
  });
1121
1143
  return ({ type: e }) => {
1122
- if (e === Er)
1144
+ if (e === Ar)
1123
1145
  return t;
1124
1146
  };
1125
1147
  }
1126
- const kr = "media", Cr = async () => Ar();
1127
- function _r(t) {
1128
- t.registerModule(kr, Cr);
1148
+ const _r = "media", Ir = async () => kr();
1149
+ function Or(t) {
1150
+ t.registerModule(_r, Ir);
1129
1151
  }
1130
- const Ir = `#version 300 es
1152
+ const xr = `#version 300 es
1131
1153
  in vec4 a_position;
1132
1154
  void main() {
1133
1155
  gl_Position = a_position;
1134
1156
  }
1135
1157
  `, le = 4;
1136
- function Or(t, e) {
1158
+ function Nr(t, e) {
1137
1159
  return new RegExp(`\\buniform\\s+\\w+\\s+${e}\\s*;`, "g").test(t);
1138
1160
  }
1139
- function xr(t, e) {
1161
+ function Lr(t, e) {
1140
1162
  const n = [];
1141
1163
  for (const [r, o] of Object.entries(e)) {
1142
- if (Or(t, r))
1164
+ if (Nr(t, r))
1143
1165
  continue;
1144
1166
  let s;
1145
1167
  switch (o.type) {
@@ -1200,7 +1222,7 @@ void main() {
1200
1222
  }
1201
1223
  `;
1202
1224
  }
1203
- class Nr {
1225
+ class Pr {
1204
1226
  gl;
1205
1227
  program = null;
1206
1228
  positionBuffer = null;
@@ -1275,10 +1297,10 @@ class Nr {
1275
1297
  }
1276
1298
  compile(e, n = {}) {
1277
1299
  this.lastError = null, this.customUniforms = n, this.currentShaderSource = e;
1278
- const r = this.gl, o = this.compileShader(r.VERTEX_SHADER, Ir);
1300
+ const r = this.gl, o = this.compileShader(r.VERTEX_SHADER, xr);
1279
1301
  if (!o)
1280
1302
  return !1;
1281
- const s = xr(e, n), i = this.compileShader(r.FRAGMENT_SHADER, s);
1303
+ const s = Lr(e, n), i = this.compileShader(r.FRAGMENT_SHADER, s);
1282
1304
  if (!i)
1283
1305
  return r.deleteShader(o), !1;
1284
1306
  const a = r.createProgram();
@@ -1321,53 +1343,53 @@ class Nr {
1321
1343
  h && e.uniform3f(h, o, s, 1);
1322
1344
  const f = this.uniformLocations.get("iTime");
1323
1345
  f && e.uniform1f(f, a);
1324
- const y = this.uniformLocations.get("iTimeDelta");
1325
- y && e.uniform1f(y, l);
1346
+ const b = this.uniformLocations.get("iTimeDelta");
1347
+ b && e.uniform1f(b, l);
1326
1348
  const m = this.uniformLocations.get("iFrame");
1327
1349
  m && e.uniform1i(m, this.frameCount);
1328
1350
  const c = this.uniformLocations.get("iMouse");
1329
1351
  c && e.uniform4f(c, this.mouseX, this.mouseY, this.mouseClickX, this.mouseClickY);
1330
1352
  const u = this.uniformLocations.get("iDate");
1331
1353
  if (u) {
1332
- const b = /* @__PURE__ */ new Date();
1333
- e.uniform4f(u, b.getFullYear(), b.getMonth(), b.getDate(), b.getHours() * 3600 + b.getMinutes() * 60 + b.getSeconds() + b.getMilliseconds() / 1e3);
1354
+ const S = /* @__PURE__ */ new Date();
1355
+ e.uniform4f(u, S.getFullYear(), S.getMonth(), S.getDate(), S.getHours() * 3600 + S.getMinutes() * 60 + S.getSeconds() + S.getMilliseconds() / 1e3);
1334
1356
  }
1335
- for (let b = 0; b < le; b++) {
1336
- e.activeTexture(e.TEXTURE0 + b), e.bindTexture(e.TEXTURE_2D, this.channels[b].texture);
1337
- const S = this.uniformLocations.get(`iChannel${b}`);
1338
- S && e.uniform1i(S, b);
1357
+ for (let S = 0; S < le; S++) {
1358
+ e.activeTexture(e.TEXTURE0 + S), e.bindTexture(e.TEXTURE_2D, this.channels[S].texture);
1359
+ const y = this.uniformLocations.get(`iChannel${S}`);
1360
+ y && e.uniform1i(y, S);
1339
1361
  }
1340
1362
  const g = this.uniformLocations.get("iChannelResolution");
1341
1363
  g && e.uniform3fv(g, this.channelResolution);
1342
1364
  const p = this.uniformLocations.get("iChannelTime");
1343
1365
  p && e.uniform1fv(p, this.channelTime);
1344
- for (const [b, S] of Object.entries(this.customUniforms)) {
1345
- const R = this.uniformLocations.get(b);
1366
+ for (const [S, y] of Object.entries(this.customUniforms)) {
1367
+ const R = this.uniformLocations.get(S);
1346
1368
  if (R)
1347
- switch (S.type) {
1369
+ switch (y.type) {
1348
1370
  case "float":
1349
- e.uniform1f(R, S.value);
1371
+ e.uniform1f(R, y.value);
1350
1372
  break;
1351
1373
  case "vec2": {
1352
- const v = S.value;
1374
+ const v = y.value;
1353
1375
  e.uniform2f(R, v[0], v[1]);
1354
1376
  break;
1355
1377
  }
1356
1378
  case "vec3": {
1357
- const v = S.value;
1379
+ const v = y.value;
1358
1380
  e.uniform3f(R, v[0], v[1], v[2]);
1359
1381
  break;
1360
1382
  }
1361
1383
  case "vec4": {
1362
- const v = S.value;
1384
+ const v = y.value;
1363
1385
  e.uniform4f(R, v[0], v[1], v[2], v[3]);
1364
1386
  break;
1365
1387
  }
1366
1388
  case "int":
1367
- e.uniform1i(R, S.value);
1389
+ e.uniform1i(R, y.value);
1368
1390
  break;
1369
1391
  case "bool":
1370
- e.uniform1i(R, S.value ? 1 : 0);
1392
+ e.uniform1i(R, y.value ? 1 : 0);
1371
1393
  break;
1372
1394
  }
1373
1395
  }
@@ -1384,7 +1406,7 @@ class Nr {
1384
1406
  this.channels = [], this.uniformLocations.clear();
1385
1407
  }
1386
1408
  }
1387
- function Lr(t) {
1409
+ function Ur(t) {
1388
1410
  if (typeof t == "string") {
1389
1411
  const e = t.trim();
1390
1412
  return e.length > 0 ? e : void 0;
@@ -1394,7 +1416,7 @@ function Lr(t) {
1394
1416
  return e.length > 0 ? e.join(" ") : void 0;
1395
1417
  }
1396
1418
  }
1397
- function Pr(...t) {
1419
+ function Mr(...t) {
1398
1420
  const e = [];
1399
1421
  for (const n of t)
1400
1422
  n && n.trim() && e.push(n.trim());
@@ -1409,10 +1431,10 @@ function Ke(t) {
1409
1431
  return Math.floor(e);
1410
1432
  }
1411
1433
  }
1412
- function Ur(t) {
1434
+ function Dr(t) {
1413
1435
  return typeof t == "string" ? t : "";
1414
1436
  }
1415
- function Mr(t) {
1437
+ function jr(t) {
1416
1438
  if (typeof t == "boolean")
1417
1439
  return t;
1418
1440
  if (typeof t == "string") {
@@ -1421,7 +1443,7 @@ function Mr(t) {
1421
1443
  if (e === "false") return !1;
1422
1444
  }
1423
1445
  }
1424
- function Dr(t) {
1446
+ function $r(t) {
1425
1447
  if (!t || typeof t != "object")
1426
1448
  return {};
1427
1449
  const e = {}, n = t;
@@ -1436,10 +1458,10 @@ function Dr(t) {
1436
1458
  }
1437
1459
  return e;
1438
1460
  }
1439
- function jr(t) {
1461
+ function Br(t) {
1440
1462
  return Array.isArray(t) ? t.map((e) => typeof e == "string" ? e : null) : [];
1441
1463
  }
1442
- function $r(t, e) {
1464
+ function Fr(t, e) {
1443
1465
  const n = Object.keys(t), r = Object.keys(e);
1444
1466
  if (n.length !== r.length)
1445
1467
  return !1;
@@ -1460,21 +1482,21 @@ function $r(t, e) {
1460
1482
  }
1461
1483
  return !0;
1462
1484
  }
1463
- const Br = "std.shadertoy-canvas";
1464
- function Fr() {
1485
+ const Wr = "std.shadertoy-canvas";
1486
+ function Vr() {
1465
1487
  const t = G(function({ nodeId: n, context: r, className: o }) {
1466
- const s = Z(r.store, n), i = E(null), a = E(null), l = E(null), h = E(0), f = E(""), y = E({}), m = E({
1488
+ const s = Z(r.store, n), i = E(null), a = E(null), l = E(null), h = E(0), f = E(""), b = E({}), m = E({
1467
1489
  x: 0,
1468
1490
  y: 0,
1469
1491
  clickX: 0,
1470
1492
  clickY: 0,
1471
1493
  isDown: !1
1472
- }), c = s ? Ur(s.props?.shaderSource) : "", u = s ? Ke(s.props?.fps) ?? 60 : 60, g = s?.props?.uniforms, p = W(() => Dr(g), [g]), b = s?.props?.channels, S = W(() => jr(b), [b]), R = s ? Mr(s.props?.enableMouse) ?? !0 : !0, v = s ? Ke(s.props?.width) : void 0, T = s ? Ke(s.props?.height) : void 0, U = s ? Pr(Lr(s.props?.className), o) : o;
1494
+ }), c = s ? Dr(s.props?.shaderSource) : "", u = s ? Ke(s.props?.fps) ?? 60 : 60, g = s?.props?.uniforms, p = V(() => $r(g), [g]), S = s?.props?.channels, y = V(() => Br(S), [S]), R = s ? jr(s.props?.enableMouse) ?? !0 : !0, v = s ? Ke(s.props?.width) : void 0, T = s ? Ke(s.props?.height) : void 0, U = s ? Mr(Ur(s.props?.className), o) : o;
1473
1495
  C(() => {
1474
1496
  const I = i.current;
1475
1497
  if (I) {
1476
1498
  try {
1477
- const P = new Nr(I);
1499
+ const P = new Pr(I);
1478
1500
  a.current = P;
1479
1501
  } catch (P) {
1480
1502
  console.error("[ShadertoyRenderer] Failed to create WebGL2 context:", P);
@@ -1487,18 +1509,18 @@ function Fr() {
1487
1509
  const I = a.current;
1488
1510
  if (!(!I || !c) && f.current !== c)
1489
1511
  if (I.compile(c, p))
1490
- f.current = c, y.current = p;
1512
+ f.current = c, b.current = p;
1491
1513
  else {
1492
1514
  const M = I.getError();
1493
1515
  console.error("[ShadertoyRenderer] Shader compilation failed:", M);
1494
1516
  }
1495
1517
  }, [c, p]), C(() => {
1496
1518
  const I = a.current;
1497
- !I || !f.current || $r(y.current, p) || (I.setCustomUniforms(p), y.current = p);
1519
+ !I || !f.current || Fr(b.current, p) || (I.setCustomUniforms(p), b.current = p);
1498
1520
  }, [p]), C(() => {
1499
1521
  const I = a.current;
1500
- I && I.setChannels(S);
1501
- }, [S]), C(() => {
1522
+ I && I.setChannels(y);
1523
+ }, [y]), C(() => {
1502
1524
  const I = a.current;
1503
1525
  if (!I || !f.current) return;
1504
1526
  const P = 1e3 / u, M = (B) => {
@@ -1514,8 +1536,8 @@ function Fr() {
1514
1536
  if (!R) return;
1515
1537
  const P = i.current, M = a.current;
1516
1538
  if (!P || !M) return;
1517
- const B = window.devicePixelRatio || 1, $ = P.getBoundingClientRect(), V = (I.clientX - $.left) * B, K = ($.height - (I.clientY - $.top)) * B;
1518
- m.current.x = V, m.current.y = K, M.setMouse(V, K, m.current.clickX, m.current.clickY);
1539
+ const B = window.devicePixelRatio || 1, $ = P.getBoundingClientRect(), W = (I.clientX - $.left) * B, K = ($.height - (I.clientY - $.top)) * B;
1540
+ m.current.x = W, m.current.y = K, M.setMouse(W, K, m.current.clickX, m.current.clickY);
1519
1541
  },
1520
1542
  [R]
1521
1543
  ), te = j(
@@ -1523,8 +1545,8 @@ function Fr() {
1523
1545
  if (!R) return;
1524
1546
  const P = i.current, M = a.current;
1525
1547
  if (!P || !M) return;
1526
- const B = window.devicePixelRatio || 1, $ = P.getBoundingClientRect(), V = (I.clientX - $.left) * B, K = ($.height - (I.clientY - $.top)) * B;
1527
- m.current.isDown = !0, m.current.clickX = V, m.current.clickY = K, M.setMouse(V, K, V, K);
1548
+ const B = window.devicePixelRatio || 1, $ = P.getBoundingClientRect(), W = (I.clientX - $.left) * B, K = ($.height - (I.clientY - $.top)) * B;
1549
+ m.current.isDown = !0, m.current.clickX = W, m.current.clickY = K, M.setMouse(W, K, W, K);
1528
1550
  },
1529
1551
  [R]
1530
1552
  ), z = j(() => {
@@ -1547,16 +1569,16 @@ function Fr() {
1547
1569
  ) : null;
1548
1570
  });
1549
1571
  return ({ type: e }) => {
1550
- if (e === Br)
1572
+ if (e === Wr)
1551
1573
  return t;
1552
1574
  };
1553
1575
  }
1554
- const Vr = "shadertoy", Wr = async () => Fr();
1555
- function Kr(t) {
1556
- t.registerModule(Vr, Wr);
1576
+ const Kr = "shadertoy", Yr = async () => Vr();
1577
+ function Gr(t) {
1578
+ t.registerModule(Kr, Yr);
1557
1579
  }
1558
1580
  const vt = oe("UIRegistry");
1559
- class Yr {
1581
+ class zr {
1560
1582
  baseResolvers = [];
1561
1583
  moduleLoaders = /* @__PURE__ */ new Map();
1562
1584
  moduleResolvers = /* @__PURE__ */ new Map();
@@ -1578,7 +1600,7 @@ class Yr {
1578
1600
  for (const [r, o] of this.moduleLoaders.entries())
1579
1601
  if (!this.moduleResolvers.has(r))
1580
1602
  try {
1581
- const s = await o(), i = Xr(s);
1603
+ const s = await o(), i = qr(s);
1582
1604
  this.moduleResolvers.set(r, i), e = !0;
1583
1605
  } catch (s) {
1584
1606
  vt.error(`[IkonUiRegistry] Failed to load module '${r}'.`, s);
@@ -1586,7 +1608,7 @@ class Yr {
1586
1608
  const n = [];
1587
1609
  for (const r of this.moduleLoaders.keys())
1588
1610
  this.moduleResolvers.has(r) && n.push(r);
1589
- return Hr(n, this.activeModuleOrder) || (this.activeModuleOrder = n, e = !0), e;
1611
+ return Jr(n, this.activeModuleOrder) || (this.activeModuleOrder = n, e = !0), e;
1590
1612
  }
1591
1613
  resolve(e) {
1592
1614
  for (const n of this.baseResolvers) {
@@ -1606,17 +1628,17 @@ class Yr {
1606
1628
  }
1607
1629
  }
1608
1630
  }
1609
- function Gr() {
1610
- const t = new Yr();
1611
- return gr(t), _r(t), Kr(t), t.loadRegisteredModules(), t;
1631
+ function Xr() {
1632
+ const t = new zr();
1633
+ return br(t), Or(t), Gr(t), t.loadRegisteredModules(), t;
1612
1634
  }
1613
- function zr(t) {
1635
+ function Hr(t) {
1614
1636
  return Array.isArray(t) ? t : [t];
1615
1637
  }
1616
- function Xr(t) {
1617
- return t ? zr(t).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
1638
+ function qr(t) {
1639
+ return t ? Hr(t).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
1618
1640
  }
1619
- function Hr(t, e) {
1641
+ function Jr(t, e) {
1620
1642
  if (t.length !== e.length)
1621
1643
  return !1;
1622
1644
  for (let n = 0; n < t.length; n += 1)
@@ -1624,7 +1646,7 @@ function Hr(t, e) {
1624
1646
  return !1;
1625
1647
  return !0;
1626
1648
  }
1627
- function _s({ mount: t, stores: e, registry: n, client: r, onAction: o }) {
1649
+ function Os({ mount: t, stores: e, registry: n, client: r, onAction: o }) {
1628
1650
  return /* @__PURE__ */ w.jsx(
1629
1651
  Bt,
1630
1652
  {
@@ -1681,50 +1703,50 @@ function At(t) {
1681
1703
  }
1682
1704
  function Tt(t, e, n, r) {
1683
1705
  const f = new Float32Array(11);
1684
- function y(p, b, S) {
1685
- return ((3 * b - 3 * S + 1) * p + (3 * S - 6 * b)) * p * p + 3 * b * p;
1706
+ function b(p, S, y) {
1707
+ return ((3 * S - 3 * y + 1) * p + (3 * y - 6 * S)) * p * p + 3 * S * p;
1686
1708
  }
1687
- function m(p, b, S) {
1688
- return 3 * (3 * b - 3 * S + 1) * p * p + 2 * (3 * S - 6 * b) * p + 3 * b;
1709
+ function m(p, S, y) {
1710
+ return 3 * (3 * S - 3 * y + 1) * p * p + 2 * (3 * y - 6 * S) * p + 3 * S;
1689
1711
  }
1690
- function c(p, b) {
1691
- for (let S = 0; S < 4; S += 1) {
1692
- const R = m(b, t, n);
1712
+ function c(p, S) {
1713
+ for (let y = 0; y < 4; y += 1) {
1714
+ const R = m(S, t, n);
1693
1715
  if (R === 0)
1694
- return b;
1695
- const v = y(b, t, n) - p;
1696
- b -= v / R;
1716
+ return S;
1717
+ const v = b(S, t, n) - p;
1718
+ S -= v / R;
1697
1719
  }
1698
- return b;
1720
+ return S;
1699
1721
  }
1700
- function u(p, b, S) {
1722
+ function u(p, S, y) {
1701
1723
  let R = 0, v = 0, T = 0;
1702
1724
  do
1703
- v = b + (S - b) / 2, R = y(v, t, n) - p, R > 0 ? S = v : b = v;
1725
+ v = S + (y - S) / 2, R = b(v, t, n) - p, R > 0 ? y = v : S = v;
1704
1726
  while (Math.abs(R) > 1e-7 && ++T < 10);
1705
1727
  return v;
1706
1728
  }
1707
1729
  function g(p) {
1708
- let b = 0, S = 1;
1730
+ let S = 0, y = 1;
1709
1731
  const R = 10;
1710
- for (; S !== R && f[S] <= p; S += 1)
1711
- b += 0.1;
1712
- S -= 1;
1713
- const v = (p - f[S]) / (f[S + 1] - f[S]), T = b + v * 0.1, U = m(T, t, n);
1714
- return U >= 1e-3 ? c(p, T) : U === 0 ? T : u(p, b, b + 0.1);
1732
+ for (; y !== R && f[y] <= p; y += 1)
1733
+ S += 0.1;
1734
+ y -= 1;
1735
+ const v = (p - f[y]) / (f[y + 1] - f[y]), T = S + v * 0.1, U = m(T, t, n);
1736
+ return U >= 1e-3 ? c(p, T) : U === 0 ? T : u(p, S, S + 0.1);
1715
1737
  }
1716
1738
  for (let p = 0; p < 11; p += 1)
1717
- f[p] = y(p * 0.1, t, n);
1718
- return (p) => p <= 0 ? 0 : p >= 1 ? 1 : y(g(p), e, r);
1739
+ f[p] = b(p * 0.1, t, n);
1740
+ return (p) => p <= 0 ? 0 : p >= 1 ? 1 : b(g(p), e, r);
1719
1741
  }
1720
- function qr(t) {
1742
+ function Zr(t) {
1721
1743
  const e = /steps\(\s*([0-9]+)\s*(?:,\s*([a-z-]+)\s*)?\)/i.exec(t);
1722
1744
  if (!e)
1723
1745
  return (o) => F(o);
1724
1746
  const n = Math.max(1, parseInt(e[1], 10)), r = (e[2] ?? "end").toLowerCase();
1725
1747
  return r === "start" || r === "jump-start" ? (o) => F(Math.ceil(o * n) / n) : r === "none" || r === "jump-none" ? (o) => F(Math.round(o * n) / n) : r === "both" || r === "jump-both" ? (o) => F((Math.floor(o * n) + 0.5) / n) : (o) => F(Math.floor(o * n) / n);
1726
1748
  }
1727
- function Jr(t) {
1749
+ function Qr(t) {
1728
1750
  if (!t)
1729
1751
  return (n) => F(n);
1730
1752
  const e = t.trim().toLowerCase();
@@ -1742,12 +1764,12 @@ function Jr(t) {
1742
1764
  }
1743
1765
  }
1744
1766
  if (e.startsWith("steps(") && e.endsWith(")")) {
1745
- const n = qr(e);
1767
+ const n = Zr(e);
1746
1768
  return (r) => n(F(r));
1747
1769
  }
1748
1770
  return (n) => F(n);
1749
1771
  }
1750
- function Zr(t) {
1772
+ function eo(t) {
1751
1773
  if (!t)
1752
1774
  return;
1753
1775
  const e = /(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)\s*->\s*(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)/.exec(t);
@@ -1757,7 +1779,7 @@ function Zr(t) {
1757
1779
  if (![n, r, o, s].some((i) => !Number.isFinite(i)))
1758
1780
  return { inStart: n, inEnd: r, outStart: o, outEnd: s };
1759
1781
  }
1760
- class Qr {
1782
+ class to {
1761
1783
  bindingsByStyle = /* @__PURE__ */ new Map();
1762
1784
  observer;
1763
1785
  observeScheduled = !1;
@@ -1802,7 +1824,7 @@ class Qr {
1802
1824
  const n = e.source?.trim();
1803
1825
  if (!n)
1804
1826
  return;
1805
- const r = Rt(e.min) ?? 0, o = Rt(e.max), s = o === void 0 ? r + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, l = Jr(e.ease), h = Zr(e.map), f = e.targetId?.trim() || void 0;
1827
+ const r = Rt(e.min) ?? 0, o = Rt(e.max), s = o === void 0 ? r + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, l = Qr(e.ease), h = eo(e.map), f = e.targetId?.trim() || void 0;
1806
1828
  return Number.isNaN(r) || Number.isNaN(s) ? void 0 : {
1807
1829
  source: n.toLowerCase(),
1808
1830
  min: r,
@@ -2015,8 +2037,8 @@ class Qr {
2015
2037
  }
2016
2038
  }
2017
2039
  }
2018
- const Ge = new Qr();
2019
- function eo(t) {
2040
+ const Ge = new to();
2041
+ function no(t) {
2020
2042
  const e = E(/* @__PURE__ */ new Map()), n = j(({ styleId: s, css: i, common: a }) => {
2021
2043
  if (!(!s || typeof document > "u")) {
2022
2044
  if (i) {
@@ -2049,7 +2071,7 @@ function eo(t) {
2049
2071
  };
2050
2072
  }, [t, o, n, r]), C(() => () => o(), [o]), { setStyle: n, deleteStyles: r, reset: o };
2051
2073
  }
2052
- function to(t) {
2074
+ function ro(t) {
2053
2075
  const e = [];
2054
2076
  for (const [n, r] of t) {
2055
2077
  const o = r.store.getSnapshot(), s = o.rootViewId && o.views.has(o.rootViewId);
@@ -2057,7 +2079,7 @@ function to(t) {
2057
2079
  }
2058
2080
  return e.sort(), e.join(",");
2059
2081
  }
2060
- function no(t) {
2082
+ function oo(t) {
2061
2083
  const [e, n] = x(), r = E("");
2062
2084
  return C(() => {
2063
2085
  if (!t) {
@@ -2065,7 +2087,7 @@ function no(t) {
2065
2087
  return;
2066
2088
  }
2067
2089
  const o = () => {
2068
- const s = t.getStores(), i = to(s);
2090
+ const s = t.getStores(), i = ro(s);
2069
2091
  i !== r.current && (r.current = i, n(s));
2070
2092
  };
2071
2093
  return o(), t.subscribe(o);
@@ -2078,7 +2100,7 @@ const k = {
2078
2100
  Line: 4,
2079
2101
  Paragraph: 8,
2080
2102
  Emoji: 16
2081
- }, ro = [
2103
+ }, so = [
2082
2104
  {
2083
2105
  flag: k.Letter,
2084
2106
  hints: [
@@ -2127,11 +2149,11 @@ const k = {
2127
2149
  "[data-emoji]"
2128
2150
  ]
2129
2151
  }
2130
- ], nt = k.Letter | k.Word | k.Line | k.Paragraph | k.Emoji, oo = k.Letter | k.Word | k.Line | k.Paragraph, kt = /* @__PURE__ */ new Map(), so = 16384;
2131
- function Is(t, e) {
2132
- if (!t || t.length > so)
2152
+ ], nt = k.Letter | k.Word | k.Line | k.Paragraph | k.Emoji, io = k.Letter | k.Word | k.Line | k.Paragraph, kt = /* @__PURE__ */ new Map(), ao = 16384;
2153
+ function xs(t, e) {
2154
+ if (!t || t.length > ao)
2133
2155
  return t;
2134
- const n = Ro(e), r = fe(n, k.Emoji), o = n & oo;
2156
+ const n = To(e), r = fe(n, k.Emoji), o = n & io;
2135
2157
  if (o === k.None && !r)
2136
2158
  return t;
2137
2159
  const s = t.replace(/\r\n/g, `
@@ -2139,20 +2161,20 @@ function Is(t, e) {
2139
2161
  `);
2140
2162
  if (o === k.None)
2141
2163
  return Ot(s);
2142
- const i = vo(s);
2164
+ const i = Ro(s);
2143
2165
  if (i.length === 0)
2144
2166
  return r ? Ot(s) : t;
2145
- const a = Eo(i), l = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, h = [];
2167
+ const a = Ao(i), l = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, h = [];
2146
2168
  for (const f of a) {
2147
- const y = io(f, n, l);
2148
- h.push(...y);
2169
+ const b = co(f, n, l);
2170
+ h.push(...b);
2149
2171
  }
2150
2172
  return h;
2151
2173
  }
2152
- function io(t, e, n) {
2174
+ function co(t, e, n) {
2153
2175
  const r = [];
2154
2176
  for (const o of t) {
2155
- const s = ao(o, e, n);
2177
+ const s = lo(o, e, n);
2156
2178
  r.push(...s);
2157
2179
  }
2158
2180
  if (fe(e, k.Paragraph)) {
@@ -2171,8 +2193,8 @@ function io(t, e, n) {
2171
2193
  }
2172
2194
  return r;
2173
2195
  }
2174
- function ao(t, e, n) {
2175
- const r = co(t.text, e, n), o = [];
2196
+ function lo(t, e, n) {
2197
+ const r = uo(t.text, e, n), o = [];
2176
2198
  if (fe(e, k.Line)) {
2177
2199
  const s = n.line++;
2178
2200
  o.push(
@@ -2184,7 +2206,7 @@ function ao(t, e, n) {
2184
2206
  o.push(/* @__PURE__ */ w.jsx("br", {}, `motion-break-${n.br++}`));
2185
2207
  return o;
2186
2208
  }
2187
- function co(t, e, n) {
2209
+ function uo(t, e, n) {
2188
2210
  if (!t)
2189
2211
  return [];
2190
2212
  const r = fe(e, k.Word), o = [], s = /(\s+)/g;
@@ -2203,13 +2225,13 @@ function co(t, e, n) {
2203
2225
  return o;
2204
2226
  }
2205
2227
  function Ct(t, e, n, r) {
2206
- const o = e.word++, s = uo(t, n, e), i = `motion-word-${o}`, a = lo(o, r);
2228
+ const o = e.word++, s = ho(t, n, e), i = `motion-word-${o}`, a = fo(o, r);
2207
2229
  return r ? /* @__PURE__ */ w.jsx("span", { "data-motion-word": !0, style: a, children: s }, i) : /* @__PURE__ */ w.jsx("span", { style: a, children: s }, i);
2208
2230
  }
2209
- function lo(t, e) {
2231
+ function fo(t, e) {
2210
2232
  return e ? { ...Ue(t), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
2211
2233
  }
2212
- function uo(t, e, n) {
2234
+ function ho(t, e, n) {
2213
2235
  if (!t)
2214
2236
  return [];
2215
2237
  const r = fe(e, k.Letter), o = fe(e, k.Emoji);
@@ -2242,33 +2264,33 @@ function uo(t, e, n) {
2242
2264
  function rt(t) {
2243
2265
  if (!t)
2244
2266
  return [];
2245
- const e = fo();
2246
- return e ? Array.from(e.segment(t), (n) => n.segment) : ho(t);
2267
+ const e = po();
2268
+ return e ? Array.from(e.segment(t), (n) => n.segment) : mo(t);
2247
2269
  }
2248
2270
  let Se;
2249
- function fo() {
2271
+ function po() {
2250
2272
  return Se !== void 0 || (typeof Intl < "u" && typeof Intl.Segmenter == "function" ? Se = new Intl.Segmenter(void 0, { granularity: "grapheme" }) : Se = null), Se;
2251
2273
  }
2252
- function ho(t) {
2274
+ function mo(t) {
2253
2275
  const e = [], n = Array.from(t);
2254
2276
  let r = "";
2255
2277
  for (let o = 0; o < n.length; o++) {
2256
2278
  const s = n[o], i = n[o + 1];
2257
- r += s, !(i && po(s, i)) && (e.push(r), r = "");
2279
+ r += s, !(i && go(s, i)) && (e.push(r), r = "");
2258
2280
  }
2259
2281
  return r && e.push(r), e;
2260
2282
  }
2261
- function po(t, e) {
2262
- return e ? !!(_t(t) || _t(e) || yo(e) || mo(e) || go(e) || It(t) && It(e)) : !1;
2283
+ function go(t, e) {
2284
+ return e ? !!(_t(t) || _t(e) || So(e) || yo(e) || bo(e) || It(t) && It(e)) : !1;
2263
2285
  }
2264
2286
  function _t(t) {
2265
2287
  return t.codePointAt(0) === 8205;
2266
2288
  }
2267
- function mo(t) {
2289
+ function yo(t) {
2268
2290
  const e = t.codePointAt(0);
2269
2291
  return e === void 0 ? !1 : e >= 65024 && e <= 65039 || e >= 917760 && e <= 917999;
2270
2292
  }
2271
- function go(t) {
2293
+ function bo(t) {
2272
2294
  const e = t.codePointAt(0);
2273
2295
  return e === void 0 ? !1 : e >= 127995 && e <= 127999;
2274
2296
  }
@@ -2277,10 +2299,10 @@ function It(t) {
2277
2299
  return e === void 0 ? !1 : e >= 127462 && e <= 127487;
2278
2300
  }
2279
2301
  let ze;
2280
- function yo(t) {
2281
- return t ? (ze || (ze = bo()), ze(t)) : !1;
2302
+ function So(t) {
2303
+ return t ? (ze || (ze = wo()), ze(t)) : !1;
2282
2304
  }
2283
- function bo() {
2305
+ function wo() {
2284
2306
  try {
2285
2307
  const t = new RegExp("\\p{Mark}", "u");
2286
2308
  return (e) => t.test(e);
@@ -2293,17 +2315,17 @@ function bo() {
2293
2315
  }
2294
2316
  let Xe;
2295
2317
  function Gt(t) {
2296
- return t ? (Xe || (Xe = So()), Xe(t)) : !1;
2318
+ return t ? (Xe || (Xe = vo()), Xe(t)) : !1;
2297
2319
  }
2298
- function So() {
2320
+ function vo() {
2299
2321
  try {
2300
2322
  const t = new RegExp("\\p{Extended_Pictographic}", "u");
2301
2323
  return (e) => t.test(e);
2302
2324
  } catch {
2303
- return wo;
2325
+ return Eo;
2304
2326
  }
2305
2327
  }
2306
- function wo(t) {
2328
+ function Eo(t) {
2307
2329
  if (!t)
2308
2330
  return !1;
2309
2331
  for (const e of Array.from(t)) {
@@ -2313,7 +2335,7 @@ function wo(t) {
2313
2335
  }
2314
2336
  return !1;
2315
2337
  }
2316
- function vo(t) {
2338
+ function Ro(t) {
2317
2339
  const e = [];
2318
2340
  let n = "", r = 0;
2319
2341
  for (let o = 0; o < t.length; o++) {
@@ -2327,7 +2349,7 @@ function vo(t) {
2327
2349
  }
2328
2350
  return (r > 0 || n.length > 0) && e.push({ text: n, breaks: r }), e;
2329
2351
  }
2330
- function Eo(t) {
2352
+ function Ao(t) {
2331
2353
  if (t.length === 0)
2332
2354
  return [];
2333
2355
  const e = [];
@@ -2384,7 +2406,7 @@ function zt(t, e) {
2384
2406
  }
2385
2407
  return i(), o ? { nodes: n, sawEmoji: !0 } : { nodes: [t.join("")], sawEmoji: !1 };
2386
2408
  }
2387
- function Ro(t) {
2409
+ function To(t) {
2388
2410
  if (!t)
2389
2411
  return k.None;
2390
2412
  const e = t.trim();
@@ -2398,8 +2420,8 @@ function Ro(t) {
2398
2420
  const r = e.split(/\s+/).filter(Boolean);
2399
2421
  if (r.length === 0)
2400
2422
  return k.None;
2401
- const s = r.map((l) => `.${Ao(l)}`).map(
2402
- (l) => new RegExp(`(^|[^a-zA-Z0-9_-])${To(l)}(?![a-zA-Z0-9_-])`)
2423
+ const s = r.map((l) => `.${ko(l)}`).map(
2424
+ (l) => new RegExp(`(^|[^a-zA-Z0-9_-])${Co(l)}(?![a-zA-Z0-9_-])`)
2403
2425
  );
2404
2426
  let i = k.None, a = !1;
2405
2427
  for (const l of Array.from(document.styleSheets)) {
@@ -2427,7 +2449,7 @@ function Xt(t, e) {
2427
2449
  const a = s.selectorText ?? "";
2428
2450
  if (!a || !e.some((h) => h.test(a))) continue;
2429
2451
  r = !0;
2430
- for (const h of ro)
2452
+ for (const h of so)
2431
2453
  h.hints.some((f) => a.includes(f)) && (n |= h.flag);
2432
2454
  if (n === nt)
2433
2455
  return { mask: n, sawStyleRule: !0 };
@@ -2441,19 +2463,19 @@ function Xt(t, e) {
2441
2463
  }
2442
2464
  return { mask: n, sawStyleRule: r };
2443
2465
  }
2444
- function Ao(t) {
2466
+ function ko(t) {
2445
2467
  return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
2446
2468
  }
2447
- function To(t) {
2469
+ function Co(t) {
2448
2470
  return t.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
2449
2471
  }
2450
- const ct = "ikon-auth-session", Ht = "ikon-auth-auto-login-attempted-run", ko = 10080 * 60 * 1e3, Co = 60 * 1e3;
2472
+ const ct = "ikon-auth-session", Ht = "ikon-auth-auto-login-attempted-run", _o = 10080 * 60 * 1e3, Io = 60 * 1e3;
2451
2473
  function qt(t) {
2452
2474
  try {
2453
2475
  const e = t.split(".");
2454
2476
  if (e.length !== 3) return !0;
2455
2477
  const n = e[1].replace(/-/g, "+").replace(/_/g, "/"), r = n + "=".repeat((4 - n.length % 4) % 4), o = JSON.parse(atob(r));
2456
- return typeof o.exp != "number" ? !1 : Date.now() >= o.exp * 1e3 - Co;
2478
+ return typeof o.exp != "number" ? !1 : Date.now() >= o.exp * 1e3 - Io;
2457
2479
  } catch {
2458
2480
  return !0;
2459
2481
  }
@@ -2470,7 +2492,7 @@ function Jt() {
2470
2492
  const t = localStorage.getItem(ct);
2471
2493
  if (!t) return null;
2472
2494
  const e = JSON.parse(t);
2473
- return Date.now() - e.authenticatedAt > ko || qt(e.token) ? (Le(), null) : e;
2495
+ return Date.now() - e.authenticatedAt > _o || qt(e.token) ? (Le(), null) : e;
2474
2496
  } catch {
2475
2497
  return console.warn("Failed to load auth session from localStorage"), null;
2476
2498
  }
@@ -2482,7 +2504,7 @@ function Le() {
2482
2504
  console.warn("Failed to clear auth session from localStorage");
2483
2505
  }
2484
2506
  }
2485
- function _o(t) {
2507
+ function Oo(t) {
2486
2508
  if (t)
2487
2509
  try {
2488
2510
  sessionStorage.setItem(Ht, t);
@@ -2490,7 +2512,7 @@ function _o(t) {
2490
2512
  console.warn("Failed to record auto-login attempt in sessionStorage");
2491
2513
  }
2492
2514
  }
2493
- function Io() {
2515
+ function xo() {
2494
2516
  try {
2495
2517
  return sessionStorage.getItem(Ht);
2496
2518
  } catch {
@@ -2524,7 +2546,7 @@ async function Qt(t, e) {
2524
2546
  try {
2525
2547
  i = await fetch(s, r);
2526
2548
  } catch (h) {
2527
- const f = h instanceof Error ? `${h.name}: ${h.message}` : String(h), y = Cn(), m = y ? `${y}/anonymous` : null;
2549
+ const f = h instanceof Error ? `${h.name}: ${h.message}` : String(h), b = Cn(), m = b ? `${b}/anonymous` : null;
2528
2550
  if (m && m !== s) {
2529
2551
  we.warn(`Anonymous auth could not reach ${s} (${f}); falling back to same-origin ${m}`);
2530
2552
  try {
@@ -2549,7 +2571,7 @@ async function Qt(t, e) {
2549
2571
  };
2550
2572
  return he(l), l;
2551
2573
  }
2552
- async function Oo({ email: t, spaceId: e, authUrl: n }) {
2574
+ async function No({ email: t, spaceId: e, authUrl: n }) {
2553
2575
  const r = await fetch(`${n}/email/send`, {
2554
2576
  method: "POST",
2555
2577
  headers: { "Content-Type": "application/json" },
@@ -2564,7 +2586,7 @@ async function Oo({ email: t, spaceId: e, authUrl: n }) {
2564
2586
  throw new Error(o);
2565
2587
  }
2566
2588
  }
2567
- async function xo({ email: t, code: e, authUrl: n }) {
2589
+ async function Lo({ email: t, code: e, authUrl: n }) {
2568
2590
  const r = await fetch(`${n}/email/code`, {
2569
2591
  method: "POST",
2570
2592
  headers: { "Content-Type": "application/json" },
@@ -2585,21 +2607,21 @@ async function xo({ email: t, code: e, authUrl: n }) {
2585
2607
  };
2586
2608
  return he(s), s;
2587
2609
  }
2588
- function No() {
2610
+ function Po() {
2589
2611
  const t = new URLSearchParams(window.location.search), e = t.get("ikon_token"), n = t.get("ikon_provider");
2590
2612
  return e && n ? { token: e, provider: n } : null;
2591
2613
  }
2592
- function Lo() {
2614
+ function Uo() {
2593
2615
  return new URLSearchParams(window.location.search).get("error");
2594
2616
  }
2595
2617
  function Nt() {
2596
2618
  window.history.replaceState({}, "", window.location.pathname);
2597
2619
  }
2598
- function Po(t, e, n, r) {
2620
+ function Mo(t, e, n, r) {
2599
2621
  const o = r ?? window.location.origin + window.location.pathname + window.location.search;
2600
2622
  return `${n}/oauth/${t}?space=${encodeURIComponent(e)}&return=${encodeURIComponent(o)}`;
2601
2623
  }
2602
- async function Uo(t) {
2624
+ async function Do(t) {
2603
2625
  const e = await fetch(`${t}/passkey/registration/options`, {
2604
2626
  method: "POST",
2605
2627
  headers: { "Content-Type": "application/json" }
@@ -2610,7 +2632,7 @@ async function Uo(t) {
2610
2632
  }
2611
2633
  return e.json();
2612
2634
  }
2613
- async function Mo(t, e, n) {
2635
+ async function jo(t, e, n) {
2614
2636
  const r = await fetch(`${t}/passkey/registration/verify`, {
2615
2637
  method: "POST",
2616
2638
  headers: { "Content-Type": "application/json" },
@@ -2627,7 +2649,7 @@ async function Mo(t, e, n) {
2627
2649
  };
2628
2650
  return he(s), s;
2629
2651
  }
2630
- async function Do(t, e) {
2652
+ async function $o(t, e) {
2631
2653
  const n = await fetch(`${t}/passkey/authentication/options`, {
2632
2654
  method: "POST",
2633
2655
  headers: { "Content-Type": "application/json" },
@@ -2639,7 +2661,7 @@ async function Do(t, e) {
2639
2661
  }
2640
2662
  return n.json();
2641
2663
  }
2642
- async function jo(t, e) {
2664
+ async function Bo(t, e) {
2643
2665
  const n = await fetch(`${t}/passkey/authentication/verify`, {
2644
2666
  method: "POST",
2645
2667
  headers: { "Content-Type": "application/json" },
@@ -2670,9 +2692,9 @@ function Pe(t) {
2670
2692
  return s;
2671
2693
  }
2672
2694
  function lt() {
2673
- return $o.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
2695
+ return Fo.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
2674
2696
  }
2675
- const $o = {
2697
+ const Fo = {
2676
2698
  stubThis: (t) => t
2677
2699
  };
2678
2700
  function en(t) {
@@ -2705,7 +2727,7 @@ class D extends Error {
2705
2727
  }), this.name = o ?? r.name, this.code = n;
2706
2728
  }
2707
2729
  }
2708
- function Bo({ error: t, options: e }) {
2730
+ function Wo({ error: t, options: e }) {
2709
2731
  const { publicKey: n } = e;
2710
2732
  if (!n)
2711
2733
  throw Error("options was missing required publicKey property");
@@ -2791,7 +2813,7 @@ function Bo({ error: t, options: e }) {
2791
2813
  }
2792
2814
  return t;
2793
2815
  }
2794
- class Fo {
2816
+ class Vo {
2795
2817
  constructor() {
2796
2818
  Object.defineProperty(this, "controller", {
2797
2819
  enumerable: !0,
@@ -2815,12 +2837,12 @@ class Fo {
2815
2837
  }
2816
2838
  }
2817
2839
  }
2818
- const nn = new Fo(), Vo = ["cross-platform", "platform"];
2840
+ const nn = new Vo(), Ko = ["cross-platform", "platform"];
2819
2841
  function rn(t) {
2820
- if (t && !(Vo.indexOf(t) < 0))
2842
+ if (t && !(Ko.indexOf(t) < 0))
2821
2843
  return t;
2822
2844
  }
2823
- async function Wo(t) {
2845
+ async function Yo(t) {
2824
2846
  !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 });
2825
2847
  const { optionsJSON: e, useAutoRegister: n = !1 } = t;
2826
2848
  if (!lt())
@@ -2839,17 +2861,17 @@ async function Wo(t) {
2839
2861
  try {
2840
2862
  s = await navigator.credentials.create(o);
2841
2863
  } catch (u) {
2842
- throw Bo({ error: u, options: o });
2864
+ throw Wo({ error: u, options: o });
2843
2865
  }
2844
2866
  if (!s)
2845
2867
  throw new Error("Registration was not completed");
2846
2868
  const { id: i, rawId: a, response: l, type: h } = s;
2847
2869
  let f;
2848
2870
  typeof l.getTransports == "function" && (f = l.getTransports());
2849
- let y;
2871
+ let b;
2850
2872
  if (typeof l.getPublicKeyAlgorithm == "function")
2851
2873
  try {
2852
- y = l.getPublicKeyAlgorithm();
2874
+ b = l.getPublicKeyAlgorithm();
2853
2875
  } catch (u) {
2854
2876
  He("getPublicKeyAlgorithm()", u);
2855
2877
  }
@@ -2875,7 +2897,7 @@ async function Wo(t) {
2875
2897
  attestationObject: X(l.attestationObject),
2876
2898
  clientDataJSON: X(l.clientDataJSON),
2877
2899
  transports: f,
2878
- publicKeyAlgorithm: y,
2900
+ publicKeyAlgorithm: b,
2879
2901
  publicKey: m,
2880
2902
  authenticatorData: c
2881
2903
  },
@@ -2888,7 +2910,7 @@ function He(t, e) {
2888
2910
  console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${t}. You should report this error to them.
2889
2911
  `, e);
2890
2912
  }
2891
- function Ko() {
2913
+ function Go() {
2892
2914
  if (!lt())
2893
2915
  return qe.stubThis(new Promise((e) => e(!1)));
2894
2916
  const t = globalThis.PublicKeyCredential;
@@ -2897,7 +2919,7 @@ function Ko() {
2897
2919
  const qe = {
2898
2920
  stubThis: (t) => t
2899
2921
  };
2900
- function Yo({ error: t, options: e }) {
2922
+ function zo({ error: t, options: e }) {
2901
2923
  const { publicKey: n } = e;
2902
2924
  if (!n)
2903
2925
  throw Error("options was missing required publicKey property");
@@ -2938,7 +2960,7 @@ function Yo({ error: t, options: e }) {
2938
2960
  }
2939
2961
  return t;
2940
2962
  }
2941
- async function Go(t) {
2963
+ async function Xo(t) {
2942
2964
  !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 });
2943
2965
  const { optionsJSON: e, useBrowserAutofill: n = !1, verifyBrowserAutofillInput: r = !0 } = t;
2944
2966
  if (!lt())
@@ -2951,7 +2973,7 @@ async function Go(t) {
2951
2973
  allowCredentials: o
2952
2974
  }, i = {};
2953
2975
  if (n) {
2954
- if (!await Ko())
2976
+ if (!await Go())
2955
2977
  throw Error("Browser does not support WebAuthn autofill");
2956
2978
  if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 && r)
2957
2979
  throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
@@ -2962,11 +2984,11 @@ async function Go(t) {
2962
2984
  try {
2963
2985
  a = await navigator.credentials.get(i);
2964
2986
  } catch (c) {
2965
- throw Yo({ error: c, options: i });
2987
+ throw zo({ error: c, options: i });
2966
2988
  }
2967
2989
  if (!a)
2968
2990
  throw new Error("Authentication was not completed");
2969
- const { id: l, rawId: h, response: f, type: y } = a;
2991
+ const { id: l, rawId: h, response: f, type: b } = a;
2970
2992
  let m;
2971
2993
  return f.userHandle && (m = X(f.userHandle)), {
2972
2994
  id: l,
@@ -2977,13 +2999,13 @@ async function Go(t) {
2977
2999
  signature: X(f.signature),
2978
3000
  userHandle: m
2979
3001
  },
2980
- type: y,
3002
+ type: b,
2981
3003
  clientExtensionResults: a.getClientExtensionResults(),
2982
3004
  authenticatorAttachment: rn(a.authenticatorAttachment)
2983
3005
  };
2984
3006
  }
2985
3007
  const ut = Mt(null);
2986
- function Os({ children: t, config: e }) {
3008
+ function Ns({ children: t, config: e }) {
2987
3009
  const [n, r] = x({
2988
3010
  isAuthenticated: !1,
2989
3011
  isLoading: !0,
@@ -2992,53 +3014,53 @@ function Os({ children: t, config: e }) {
2992
3014
  });
2993
3015
  C(() => {
2994
3016
  (() => {
2995
- const m = e.devLoginRunId, c = !!m && Io() === m;
2996
- m && _o(m);
2997
- const u = Lo();
2998
- if (u) {
3017
+ const m = e.devLoginRunId, c = !!m && xo() === m;
3018
+ m && Oo(m);
3019
+ const u = !!e.devLoginToken && !!m && !c && !qt(e.devLoginToken), g = Uo();
3020
+ if (g) {
2999
3021
  Nt(), r({
3000
3022
  isAuthenticated: !1,
3001
3023
  isLoading: !1,
3002
3024
  user: null,
3003
- error: u
3025
+ error: g
3004
3026
  });
3005
3027
  return;
3006
3028
  }
3007
- const g = No();
3008
- if (g) {
3009
- const b = {
3010
- token: g.token,
3011
- provider: g.provider,
3029
+ const p = Po();
3030
+ if (p) {
3031
+ const y = {
3032
+ token: p.token,
3033
+ provider: p.provider,
3012
3034
  authenticatedAt: Date.now()
3013
3035
  };
3014
- he(b), Nt(), r({
3036
+ he(y), Nt(), r({
3015
3037
  isAuthenticated: !0,
3016
3038
  isLoading: !1,
3017
- user: ne(b),
3039
+ user: ne(y),
3018
3040
  error: null
3019
3041
  });
3020
3042
  return;
3021
3043
  }
3022
- const p = Jt();
3023
- if (p) {
3044
+ const S = Jt();
3045
+ if (S && !(u && S.provider === "anonymous")) {
3024
3046
  r({
3025
3047
  isAuthenticated: !0,
3026
3048
  isLoading: !1,
3027
- user: ne(p),
3049
+ user: ne(S),
3028
3050
  error: null
3029
3051
  });
3030
3052
  return;
3031
3053
  }
3032
- if (e.devLoginToken && m && !c && !qt(e.devLoginToken)) {
3033
- const b = {
3054
+ if (u && e.devLoginToken) {
3055
+ const y = {
3034
3056
  token: e.devLoginToken,
3035
3057
  provider: "dev",
3036
3058
  authenticatedAt: Date.now()
3037
3059
  };
3038
- he(b), r({
3060
+ he(y), r({
3039
3061
  isAuthenticated: !0,
3040
3062
  isLoading: !1,
3041
- user: ne(b),
3063
+ user: ne(y),
3042
3064
  error: null
3043
3065
  });
3044
3066
  return;
@@ -3052,7 +3074,7 @@ function Os({ children: t, config: e }) {
3052
3074
  })();
3053
3075
  }, [e.devLoginToken, e.devLoginRunId]);
3054
3076
  const o = j(
3055
- async (y) => {
3077
+ async (b) => {
3056
3078
  if (!e.spaceId) {
3057
3079
  r((c) => ({
3058
3080
  ...c,
@@ -3061,7 +3083,7 @@ function Os({ children: t, config: e }) {
3061
3083
  return;
3062
3084
  }
3063
3085
  const m = await ve(e.authUrl);
3064
- if (y === "guest") {
3086
+ if (b === "guest") {
3065
3087
  r((c) => ({ ...c, isLoading: !0 }));
3066
3088
  try {
3067
3089
  const c = await Qt(e.spaceId, m);
@@ -3080,10 +3102,10 @@ function Os({ children: t, config: e }) {
3080
3102
  }
3081
3103
  return;
3082
3104
  }
3083
- if (y === "passkey") {
3105
+ if (b === "passkey") {
3084
3106
  r((c) => ({ ...c, isLoading: !0, error: null }));
3085
3107
  try {
3086
- const c = await Do(m), u = await Go({ optionsJSON: c }), g = await jo(m, u);
3108
+ const c = await $o(m), u = await Xo({ optionsJSON: c }), g = await Bo(m, u);
3087
3109
  r({
3088
3110
  isAuthenticated: !0,
3089
3111
  isLoading: !1,
@@ -3099,24 +3121,24 @@ function Os({ children: t, config: e }) {
3099
3121
  }
3100
3122
  return;
3101
3123
  }
3102
- if (y === "email")
3124
+ if (b === "email")
3103
3125
  throw new Error("login('email') is not supported. Use requestEmailCode()/submitEmailCode() from useAuth() instead.");
3104
- window.location.href = Po(y, e.spaceId, m);
3126
+ window.location.href = Mo(b, e.spaceId, m);
3105
3127
  },
3106
3128
  [e.authUrl, e.spaceId]
3107
3129
  ), s = j(
3108
- async (y) => {
3130
+ async (b) => {
3109
3131
  if (!e.spaceId)
3110
3132
  throw r((c) => ({ ...c, error: "Space ID is not configured" })), new Error("Space ID is not configured");
3111
3133
  const m = await ve(e.authUrl);
3112
- await Oo({ email: y, spaceId: e.spaceId, authUrl: m });
3134
+ await No({ email: b, spaceId: e.spaceId, authUrl: m });
3113
3135
  },
3114
3136
  [e.authUrl, e.spaceId]
3115
3137
  ), i = j(
3116
- async (y, m) => {
3138
+ async (b, m) => {
3117
3139
  r((c) => ({ ...c, isLoading: !0, error: null }));
3118
3140
  try {
3119
- const c = await ve(e.authUrl), u = await xo({ email: y, code: m, authUrl: c });
3141
+ const c = await ve(e.authUrl), u = await Lo({ email: b, code: m, authUrl: c });
3120
3142
  r({
3121
3143
  isAuthenticated: !0,
3122
3144
  isLoading: !1,
@@ -3137,11 +3159,11 @@ function Os({ children: t, config: e }) {
3137
3159
  error: null
3138
3160
  });
3139
3161
  }, []), l = j(
3140
- async (y) => {
3162
+ async (b) => {
3141
3163
  const m = await ve(e.authUrl);
3142
3164
  r((c) => ({ ...c, isLoading: !0, error: null }));
3143
3165
  try {
3144
- const c = await Uo(m), u = await Wo({ optionsJSON: c }), g = await Mo(m, u, y);
3166
+ const c = await Do(m), u = await Yo({ optionsJSON: c }), g = await jo(m, u, b);
3145
3167
  r({
3146
3168
  isAuthenticated: !0,
3147
3169
  isLoading: !1,
@@ -3157,7 +3179,7 @@ function Os({ children: t, config: e }) {
3157
3179
  }
3158
3180
  },
3159
3181
  [e.authUrl]
3160
- ), h = j(() => n.user?.token ?? null, [n.user]), f = W(
3182
+ ), h = j(() => n.user?.token ?? null, [n.user]), f = V(
3161
3183
  () => ({
3162
3184
  state: n,
3163
3185
  login: o,
@@ -3171,17 +3193,17 @@ function Os({ children: t, config: e }) {
3171
3193
  );
3172
3194
  return /* @__PURE__ */ w.jsx(ut, { value: f, children: t });
3173
3195
  }
3174
- function zo() {
3196
+ function Ho() {
3175
3197
  const t = st(ut);
3176
3198
  if (!t)
3177
3199
  throw new Error("useAuth must be used within an AuthProvider");
3178
3200
  return t;
3179
3201
  }
3180
- function Xo() {
3202
+ function qo() {
3181
3203
  return st(ut);
3182
3204
  }
3183
- function xs(t) {
3184
- const { config: e, guestUrlParam: n } = t, { state: r, login: o } = zo(), s = E(!1);
3205
+ function Ls(t) {
3206
+ const { config: e, guestUrlParam: n } = t, { state: r, login: o } = Ho(), s = E(!1);
3185
3207
  return C(() => {
3186
3208
  if (!n || r.isAuthenticated || r.isLoading || s.current || !e.methods.includes("guest"))
3187
3209
  return;
@@ -3204,9 +3226,9 @@ const on = (() => {
3204
3226
  } catch {
3205
3227
  return !1;
3206
3228
  }
3207
- })(), sn = Date.now(), re = [], Ho = 300;
3229
+ })(), sn = Date.now(), re = [], Jo = 300;
3208
3230
  function Ie(t) {
3209
- re.push(`[+${((Date.now() - sn) / 1e3).toFixed(1)}s] ${t}`), re.length > Ho && re.shift();
3231
+ re.push(`[+${((Date.now() - sn) / 1e3).toFixed(1)}s] ${t}`), re.length > Jo && re.shift();
3210
3232
  }
3211
3233
  function Lt(t) {
3212
3234
  if (typeof t == "string")
@@ -3242,7 +3264,7 @@ function an() {
3242
3264
  }
3243
3265
  }
3244
3266
  on && an();
3245
- function qo() {
3267
+ function Zo() {
3246
3268
  let t = !1;
3247
3269
  try {
3248
3270
  const e = URL.createObjectURL(new Blob([""]));
@@ -3253,11 +3275,11 @@ function qo() {
3253
3275
  }
3254
3276
  return t;
3255
3277
  }
3256
- function Jo() {
3278
+ function Qo() {
3257
3279
  const t = globalThis;
3258
3280
  return [
3259
3281
  `Worker=${typeof Worker < "u"}`,
3260
- `moduleWorker=${qo()}`,
3282
+ `moduleWorker=${Zo()}`,
3261
3283
  `WebSocket=${typeof WebSocket < "u"}`,
3262
3284
  `WebTransport=${typeof t.WebTransport < "u"}`,
3263
3285
  `RTCPeerConnection=${typeof RTCPeerConnection < "u"}`,
@@ -3270,7 +3292,7 @@ function Jo() {
3270
3292
  `online=${typeof navigator < "u" ? navigator.onLine : "?"}`
3271
3293
  ].join(" ");
3272
3294
  }
3273
- function Zo(t) {
3295
+ function es(t) {
3274
3296
  return /ERROR|error:|Rejection/.test(t) ? "#f88" : /WARN|warn:/.test(t) ? "#fc6" : "#9d9";
3275
3297
  }
3276
3298
  function cn({ state: t = "", forceVisible: e = !1 }) {
@@ -3311,12 +3333,12 @@ function cn({ state: t = "", forceVisible: e = !1 }) {
3311
3333
  ] }),
3312
3334
  /* @__PURE__ */ w.jsx("div", { style: { color: "#9cf", wordBreak: "break-all", marginBottom: "4px" }, children: typeof window < "u" ? window.location.href : "" }),
3313
3335
  /* @__PURE__ */ w.jsx("div", { style: { color: "#ff0", wordBreak: "break-all", marginBottom: "4px" }, children: typeof navigator < "u" ? navigator.userAgent : "no navigator" }),
3314
- /* @__PURE__ */ w.jsx("div", { style: { color: "#8cf", marginBottom: "4px" }, children: Jo() }),
3336
+ /* @__PURE__ */ w.jsx("div", { style: { color: "#8cf", marginBottom: "4px" }, children: Qo() }),
3315
3337
  /* @__PURE__ */ w.jsx("div", { style: { color: "#8cf", marginBottom: "10px" }, children: typeof window < "u" ? `viewport=${window.innerWidth}x${window.innerHeight} dpr=${window.devicePixelRatio}` : "" }),
3316
- /* @__PURE__ */ w.jsx("div", { children: re.length === 0 ? "(nothing captured yet)" : re.map((l, h) => /* @__PURE__ */ w.jsx("div", { style: { color: Zo(l), wordBreak: "break-all" }, children: l }, h)) })
3338
+ /* @__PURE__ */ w.jsx("div", { children: re.length === 0 ? "(nothing captured yet)" : re.map((l, h) => /* @__PURE__ */ w.jsx("div", { style: { color: es(l), wordBreak: "break-all" }, children: l }, h)) })
3317
3339
  ] });
3318
3340
  }
3319
- function Ns({
3341
+ function Ps({
3320
3342
  connectionState: t,
3321
3343
  error: e,
3322
3344
  isReady: n,
@@ -3330,7 +3352,7 @@ function Ns({
3330
3352
  renderIdle: l,
3331
3353
  renderConnecting: h,
3332
3354
  renderConnectingSlow: f,
3333
- renderConnected: y,
3355
+ renderConnected: b,
3334
3356
  renderOffline: m,
3335
3357
  renderError: c
3336
3358
  }) {
@@ -3344,7 +3366,7 @@ function Ns({
3344
3366
  if (!n || !o || !s) return null;
3345
3367
  t === "reconnecting" && (u.current = !0);
3346
3368
  const p = o.size > 0;
3347
- return p && (u.current = !1), y({
3369
+ return p && (u.current = !1), b({
3348
3370
  stores: o,
3349
3371
  registry: s,
3350
3372
  client: i,
@@ -3369,18 +3391,18 @@ function Ns({
3369
3391
  ] });
3370
3392
  }
3371
3393
  const Oe = oe("useIkonApp");
3372
- function Qo() {
3394
+ function ts() {
3373
3395
  if (typeof window < "u" && window.__IKON_AUTH_CONFIG__)
3374
3396
  return window.__IKON_AUTH_CONFIG__;
3375
3397
  }
3376
- function es() {
3398
+ function ns() {
3377
3399
  if (typeof window < "u" && window.__IKON_LOCAL_IKON_SERVER_CONFIG__)
3378
3400
  return window.__IKON_LOCAL_IKON_SERVER_CONFIG__;
3379
3401
  }
3380
- function Ls(t) {
3381
- const { authConfig: e, modules: n, timeouts: r, backgroundAudio: o, webRtc: s, audio: i, video: a, websocket: l, webtransport: h, proxy: f, liveSnapshot: y, bootSnapshot: m } = t, c = e === void 0 ? Qo() ?? null : e, u = es(), g = Xo(), p = E(null), b = E(null), S = E(null), R = E(!1), v = E(!1), T = E(o), U = E(r), ee = E(s), te = E(i), z = E(a), I = E(l), P = E(h), M = E(f), B = E(y), $ = E(m), V = E("local"), K = E(void 0);
3382
- T.current = o, U.current = r, ee.current = s, te.current = i, z.current = a, I.current = l, P.current = h, M.current = f, B.current = y, $.current = m;
3383
- const [H, Ee] = x("connecting"), [Re, pe] = x(!1), [d, A] = x(!1), [O, N] = x(null), [se, me] = x(null), [L, Q] = x(!1), [ie, Me] = x(null), [ae, un] = x(null), [De, dt] = x(!1), je = E(!1), [dn, fn] = x(0), Y = W(() => {
3402
+ function Us(t) {
3403
+ const { authConfig: e, modules: n, timeouts: r, backgroundAudio: o, webRtc: s, audio: i, video: a, websocket: l, webtransport: h, proxy: f, liveSnapshot: b, bootSnapshot: m } = t, c = e === void 0 ? ts() ?? null : e, u = ns(), g = qo(), p = E(null), S = E(null), y = E(null), R = E(!1), v = E(!1), T = E(o), U = E(r), ee = E(s), te = E(i), z = E(a), I = E(l), P = E(h), M = E(f), B = E(b), $ = E(m), W = E("local"), K = E(void 0);
3404
+ T.current = o, U.current = r, ee.current = s, te.current = i, z.current = a, I.current = l, P.current = h, M.current = f, B.current = b, $.current = m;
3405
+ const [H, Ee] = x("connecting"), [Re, pe] = x(!1), [d, A] = x(!1), [O, N] = x(null), [se, me] = x(null), [L, Q] = x(!1), [ie, Me] = x(null), [ae, un] = x(null), [De, dt] = x(!1), je = E(!1), [dn, fn] = x(0), Y = V(() => {
3384
3406
  try {
3385
3407
  const _ = In();
3386
3408
  return (_.sessionId || _.channelKey) && On(), _;
@@ -3389,13 +3411,13 @@ function Ls(t) {
3389
3411
  }
3390
3412
  }, []);
3391
3413
  m !== !1 && vn();
3392
- const ce = W(() => c?.enabled ? Jt() : null, [c?.enabled, dn]), Ae = u?.enabled ?? !1, $e = u?.host ?? "localhost", Be = u?.port ?? 8443, Fe = !!c && !c.enabled && !!c.spaceId && (ht() || Ae);
3414
+ const ce = V(() => c?.enabled ? Jt() : null, [c?.enabled, dn]), Ae = u?.enabled ?? !1, $e = u?.host ?? "localhost", Be = u?.port ?? 8443, Fe = !!c && !c.enabled && !!c.spaceId && (ht() || Ae);
3393
3415
  Fe && !ae && !De && !je.current && (je.current = !0, ve(c.authUrl).then((_) => Qt(c.spaceId, _)).then((_) => {
3394
3416
  un(_.token), dt(!0);
3395
3417
  }).catch((_) => {
3396
3418
  Oe.error("Anonymous auth failed:", _), je.current = !1, Ae ? dt(!0) : N(_ instanceof Error ? _.message : "Anonymous auth failed");
3397
3419
  }));
3398
- const Ve = W(() => {
3420
+ const We = V(() => {
3399
3421
  if (Ae) {
3400
3422
  if (Fe && !De)
3401
3423
  return null;
@@ -3442,21 +3464,21 @@ function Ls(t) {
3442
3464
  }
3443
3465
  };
3444
3466
  }, [Ae, $e, Be, ce?.token, c?.spaceId, c?.backendUrl, c?.authUrl, ae, Fe, De, Y.sessionId, Y.channelKey, Y.parameters]);
3445
- V.current = c?.spaceId ?? "local", K.current = ce?.token ?? ae ?? void 0, eo(ie);
3446
- const hn = no(ie);
3467
+ W.current = c?.spaceId ?? "local", K.current = ce?.token ?? ae ?? void 0, no(ie);
3468
+ const hn = oo(ie);
3447
3469
  C(() => {
3448
3470
  if (!R.current) {
3449
- if (R.current = !0, S.current = Gr(), n)
3471
+ if (R.current = !0, y.current = Xr(), n)
3450
3472
  for (const _ of n)
3451
- _(S.current);
3452
- S.current.loadRegisteredModules().catch((_) => {
3473
+ _(y.current);
3474
+ y.current.loadRegisteredModules().catch((_) => {
3453
3475
  Oe.error("Failed to load UI modules", _);
3454
3476
  });
3455
3477
  }
3456
3478
  }, []), C(() => {
3457
- if (!Ve) return;
3479
+ if (!We) return;
3458
3480
  const _ = new xn({
3459
- ...Ve,
3481
+ ...We,
3460
3482
  timeouts: U.current,
3461
3483
  audio: te.current !== void 0 || T.current ? {
3462
3484
  enabled: te.current,
@@ -3476,8 +3498,8 @@ function Ls(t) {
3476
3498
  }
3477
3499
  });
3478
3500
  p.current = _;
3479
- const q = B.current ?? !0, Te = K.current, ft = Te ? pt(Te) ?? null : null, gn = q && ft ? { enabled: !0, appId: V.current, userId: ft } : void 0, ke = new er({ client: _, liveSnapshot: gn, bootSnapshot: $.current });
3480
- b.current = ke, Me(ke), A(!1);
3501
+ const q = B.current ?? !0, Te = K.current, ft = Te ? pt(Te) ?? null : null, gn = q && ft ? { enabled: !0, appId: W.current, userId: ft } : void 0, ke = new er({ client: _, liveSnapshot: gn, bootSnapshot: $.current });
3502
+ S.current = ke, Me(ke), A(!1);
3481
3503
  const yn = ke.subscribeToUiUpdates(() => {
3482
3504
  A(!0), Nn();
3483
3505
  });
@@ -3492,9 +3514,9 @@ function Ls(t) {
3492
3514
  }
3493
3515
  J instanceof Un && !v.current && (v.current = !0, Oe.warn("Auth session appears stale, clearing and retrying"), Ut.clearAll(), g ? g.logout() : (Le(), fn((bn) => bn + 1)));
3494
3516
  }), () => {
3495
- yn(), _.disconnect(), p.current = null, ke.dispose(), b.current = null;
3517
+ yn(), _.disconnect(), p.current = null, ke.dispose(), S.current = null;
3496
3518
  };
3497
- }, [Ve]);
3519
+ }, [We]);
3498
3520
  const pn = j((_, q) => {
3499
3521
  const Te = typeof q == "string" ? q : JSON.stringify(q ?? {});
3500
3522
  p.current?.sendActionCall(_, Te);
@@ -3507,30 +3529,30 @@ function Ls(t) {
3507
3529
  const _ = p.current?.slowConnectionThresholdMs ?? 5e3, q = setTimeout(() => pe(!0), _);
3508
3530
  return () => clearTimeout(q);
3509
3531
  }, [H]);
3510
- const mn = H === "connected" || H === "reconnecting", We = d && H !== "offline";
3532
+ const mn = H === "connected" || H === "reconnecting", Ve = d && H !== "offline";
3511
3533
  return C(() => {
3512
- typeof document > "u" || (document.documentElement.dataset.ikonLive = String(We));
3513
- }, [We]), {
3534
+ typeof document > "u" || (document.documentElement.dataset.ikonLive = String(Ve));
3535
+ }, [Ve]), {
3514
3536
  connectionState: H,
3515
3537
  error: O,
3516
3538
  accessDeniedReason: se,
3517
3539
  isServerFull: L,
3518
3540
  stores: hn,
3519
3541
  client: p.current,
3520
- registry: S.current,
3542
+ registry: y.current,
3521
3543
  clientRef: p,
3522
- uiRef: b,
3523
- registryRef: S,
3544
+ uiRef: S,
3545
+ registryRef: y,
3524
3546
  onAction: pn,
3525
3547
  isReady: mn,
3526
- isLive: We,
3548
+ isLive: Ve,
3527
3549
  brandingRequired: p.current?.brandingRequired ?? !1,
3528
3550
  isConnectingSlow: Re,
3529
3551
  webRtcVideoStreams: p.current?.webRtcVideoStreams ?? /* @__PURE__ */ new Map(),
3530
3552
  webRtcTrackMap: p.current?.webRtcTrackMap ?? /* @__PURE__ */ new Map()
3531
3553
  };
3532
3554
  }
3533
- function Ps(t) {
3555
+ function Ms(t) {
3534
3556
  const e = E(!1);
3535
3557
  return j(() => {
3536
3558
  if (e.current) return;
@@ -3539,8 +3561,8 @@ function Ps(t) {
3539
3561
  n.rel = "stylesheet", n.href = t, document.head.appendChild(n);
3540
3562
  }, [t]);
3541
3563
  }
3542
- let ts = 0;
3543
- function ns(t = 5, e = 5e3) {
3564
+ let rs = 0;
3565
+ function os(t = 5, e = 5e3) {
3544
3566
  const [n, r] = x([]), o = E(/* @__PURE__ */ new Map()), s = j((i) => {
3545
3567
  const a = o.current.get(i);
3546
3568
  a && (clearTimeout(a), o.current.delete(i)), r((l) => l.filter((h) => h.id !== i));
@@ -3550,13 +3572,13 @@ function ns(t = 5, e = 5e3) {
3550
3572
  (l) => {
3551
3573
  if (!$t())
3552
3574
  return;
3553
- const h = `toast-${++ts}`, f = l.level === Je.ERROR ? "error" : "warn", y = {
3575
+ const h = `toast-${++rs}`, f = l.level === Je.ERROR ? "error" : "warn", b = {
3554
3576
  id: h,
3555
3577
  level: f,
3556
3578
  message: l.message,
3557
3579
  component: l.component
3558
3580
  };
3559
- r((c) => [...c, y].slice(-t));
3581
+ r((c) => [...c, b].slice(-t));
3560
3582
  const m = setTimeout(() => {
3561
3583
  s(h);
3562
3584
  }, e);
@@ -3572,7 +3594,7 @@ function ns(t = 5, e = 5e3) {
3572
3594
  };
3573
3595
  }, [t, e, s]), { toasts: n, dismissToast: s };
3574
3596
  }
3575
- function rs(t, e, n) {
3597
+ function ss(t, e, n) {
3576
3598
  const [r, o] = x(n);
3577
3599
  return C(() => {
3578
3600
  if (!t)
@@ -3589,7 +3611,7 @@ function rs(t, e, n) {
3589
3611
  };
3590
3612
  }, [t, e]), r;
3591
3613
  }
3592
- function Us(t, e, n) {
3614
+ function Ds(t, e, n) {
3593
3615
  const [r, o] = x(null);
3594
3616
  return C(() => {
3595
3617
  if (!t)
@@ -3602,58 +3624,58 @@ function Us(t, e, n) {
3602
3624
  }), () => {
3603
3625
  s = !1;
3604
3626
  };
3605
- }, [t, e]), rs(r ? t : null, r ?? "", n);
3627
+ }, [t, e]), ss(r ? t : null, r ?? "", n);
3606
3628
  }
3607
- const ue = oe("IkonDebug"), os = {
3629
+ const ue = oe("IkonDebug"), is = {
3608
3630
  Digit1: "connecting",
3609
3631
  Digit2: "connected",
3610
3632
  Digit3: "reconnecting",
3611
3633
  Digit4: "offline",
3612
3634
  Digit5: "offline",
3613
3635
  Digit0: "clear"
3614
- }, ss = "Digit5", is = "Digit6", as = "Synthetic debug error (Ctrl+Shift+5)", cs = "Synthetic debug access-denied (Ctrl+Shift+6)", ls = 5e3;
3615
- function us(t) {
3616
- const e = $t(), [n, r] = x(null), [o, s] = x(!1), [i, a] = x(null), [l, h] = x(null), [f, y] = x(!1), [m, c] = x(!1), [u, g] = x(!1);
3636
+ }, as = "Digit5", cs = "Digit6", ls = "Synthetic debug error (Ctrl+Shift+5)", us = "Synthetic debug access-denied (Ctrl+Shift+6)", ds = 5e3;
3637
+ function fs(t) {
3638
+ const e = $t(), [n, r] = x(null), [o, s] = x(!1), [i, a] = x(null), [l, h] = x(null), [f, b] = x(!1), [m, c] = x(!1), [u, g] = x(!1);
3617
3639
  return C(() => {
3618
3640
  if (!e)
3619
3641
  return;
3620
- const b = (S) => {
3621
- if (!S.ctrlKey || !S.shiftKey)
3642
+ const S = (y) => {
3643
+ if (!y.ctrlKey || !y.shiftKey)
3622
3644
  return;
3623
- if (S.code === "KeyE") {
3624
- S.preventDefault(), y((T) => (ue.warn(`Empty-stores override: ${T ? "off" : "on"}`), !T));
3645
+ if (y.code === "KeyE") {
3646
+ y.preventDefault(), b((T) => (ue.warn(`Empty-stores override: ${T ? "off" : "on"}`), !T));
3625
3647
  return;
3626
3648
  }
3627
- if (S.code === "Digit7") {
3628
- S.preventDefault(), c((T) => (ue.warn(`Branding-banner override: ${T ? "off" : "on"}`), !T));
3649
+ if (y.code === "Digit7") {
3650
+ y.preventDefault(), c((T) => (ue.warn(`Branding-banner override: ${T ? "off" : "on"}`), !T));
3629
3651
  return;
3630
3652
  }
3631
- if (S.code === "Digit8") {
3632
- S.preventDefault(), g((T) => (ue.warn(`Debug-overlay override: ${T ? "off" : "on"}`), !T));
3653
+ if (y.code === "Digit8") {
3654
+ y.preventDefault(), g((T) => (ue.warn(`Debug-overlay override: ${T ? "off" : "on"}`), !T));
3633
3655
  return;
3634
3656
  }
3635
- if (S.code === is) {
3636
- S.preventDefault(), h(cs), r(null), a(null), ue.warn("Forced access denied");
3657
+ if (y.code === cs) {
3658
+ y.preventDefault(), h(us), r(null), a(null), ue.warn("Forced access denied");
3637
3659
  return;
3638
3660
  }
3639
- const R = os[S.code];
3661
+ const R = is[y.code];
3640
3662
  if (R === void 0)
3641
3663
  return;
3642
- if (S.preventDefault(), R === "clear") {
3664
+ if (y.preventDefault(), R === "clear") {
3643
3665
  r(null), a(null), h(null), ue.warn("Cleared forced state");
3644
3666
  return;
3645
3667
  }
3646
- const v = S.code === ss;
3647
- r(R), a(v ? as : null), h(null), ue.warn(`Forced state: ${R}${v ? " (with error)" : ""}`);
3668
+ const v = y.code === as;
3669
+ r(R), a(v ? ls : null), h(null), ue.warn(`Forced state: ${R}${v ? " (with error)" : ""}`);
3648
3670
  };
3649
- return window.addEventListener("keydown", b), () => window.removeEventListener("keydown", b);
3671
+ return window.addEventListener("keydown", S), () => window.removeEventListener("keydown", S);
3650
3672
  }, [e]), C(() => {
3651
3673
  if (n !== "connecting") {
3652
3674
  s(!1);
3653
3675
  return;
3654
3676
  }
3655
- const b = setTimeout(() => s(!0), ls);
3656
- return () => clearTimeout(b);
3677
+ const S = setTimeout(() => s(!0), ds);
3678
+ return () => clearTimeout(S);
3657
3679
  }, [n]), !e || n === null && !f && l === null && !m && !u ? { app: t, forcedState: null, emptyStores: !1, forcedError: null, forcedAccessDenied: null, forcedBranding: !1, forcedDebugOverlay: !1, debugEnabled: e } : { app: {
3658
3680
  ...t,
3659
3681
  connectionState: n ?? t.connectionState,
@@ -3663,34 +3685,34 @@ function us(t) {
3663
3685
  accessDeniedReason: l ?? t.accessDeniedReason
3664
3686
  }, forcedState: n, emptyStores: f, forcedError: i, forcedAccessDenied: l, forcedBranding: m, forcedDebugOverlay: u, debugEnabled: e };
3665
3687
  }
3666
- function ds(t, e) {
3688
+ function hs(t, e) {
3667
3689
  return t === void 0 ? null : typeof t == "function" ? t(e) : t;
3668
3690
  }
3669
- function fs(t) {
3691
+ function ps(t) {
3670
3692
  return t === void 0 ? null : typeof t == "function" ? t() : t;
3671
3693
  }
3672
- function hs(t, e) {
3694
+ function ms(t, e) {
3673
3695
  return t === void 0 ? null : typeof t == "function" ? t(e) : t;
3674
3696
  }
3675
- function ps(t, e) {
3697
+ function gs(t, e) {
3676
3698
  return t === void 0 ? null : typeof t == "function" ? t(e) : t;
3677
3699
  }
3678
- function Ms(t) {
3679
- const { connectingOverlay: e, reconnectingOverlay: n, offlineOverlay: r, accessDeniedScreen: o, ...s } = t, i = us(s), { app: a } = i, { connectionState: l, isConnectingSlow: h, stores: f, registry: y, client: m, onAction: c, isReady: u, error: g, accessDeniedReason: p, brandingRequired: b } = a, S = b || i.forcedBranding, R = E(null);
3680
- if (f && y && (u || f.size > 0) && (R.current = { stores: f, registry: y, client: m }), p)
3681
- return ps(o, p);
3700
+ function js(t) {
3701
+ const { connectingOverlay: e, reconnectingOverlay: n, offlineOverlay: r, accessDeniedScreen: o, ...s } = t, i = fs(s), { app: a } = i, { connectionState: l, isConnectingSlow: h, stores: f, registry: b, client: m, onAction: c, isReady: u, error: g, accessDeniedReason: p, brandingRequired: S } = a, y = S || i.forcedBranding, R = E(null);
3702
+ if (f && b && (u || f.size > 0) && (R.current = { stores: f, registry: b, client: m }), p)
3703
+ return gs(o, p);
3682
3704
  const v = R.current;
3683
3705
  let T = null;
3684
3706
  switch (l) {
3685
3707
  case "waitingForExternalConnectUrl":
3686
3708
  case "connecting":
3687
- T = ds(e, h);
3709
+ T = hs(e, h);
3688
3710
  break;
3689
3711
  case "reconnecting":
3690
- T = fs(n);
3712
+ T = ps(n);
3691
3713
  break;
3692
3714
  case "offline":
3693
- T = hs(r, g);
3715
+ T = ms(r, g);
3694
3716
  break;
3695
3717
  default:
3696
3718
  T = null;
@@ -3706,18 +3728,18 @@ function Ms(t) {
3706
3728
  }
3707
3729
  ),
3708
3730
  T,
3709
- S && /* @__PURE__ */ w.jsx(gs, {}),
3710
- /* @__PURE__ */ w.jsx(ys, {}),
3731
+ y && /* @__PURE__ */ w.jsx(bs, {}),
3732
+ /* @__PURE__ */ w.jsx(Ss, {}),
3711
3733
  /* @__PURE__ */ w.jsx(cn, { state: l, forceVisible: i.forcedDebugOverlay })
3712
3734
  ] });
3713
3735
  }
3714
- const ms = "https://ikonai.com";
3715
- function gs() {
3736
+ const ys = "https://ikonai.com";
3737
+ function bs() {
3716
3738
  return /* @__PURE__ */ w.jsxs(
3717
3739
  "a",
3718
3740
  {
3719
3741
  className: "ikon-branding-banner",
3720
- href: ms,
3742
+ href: ys,
3721
3743
  target: "_blank",
3722
3744
  rel: "noopener noreferrer",
3723
3745
  style: {
@@ -3745,11 +3767,11 @@ function gs() {
3745
3767
  }
3746
3768
  );
3747
3769
  }
3748
- function ys() {
3749
- const { toasts: t, dismissToast: e } = ns();
3750
- return t.length === 0 ? null : /* @__PURE__ */ w.jsx("div", { className: "ikon-toast-overlay", children: t.map((n) => /* @__PURE__ */ w.jsx(bs, { toast: n, onDismiss: e }, n.id)) });
3770
+ function Ss() {
3771
+ const { toasts: t, dismissToast: e } = os();
3772
+ return t.length === 0 ? null : /* @__PURE__ */ w.jsx("div", { className: "ikon-toast-overlay", children: t.map((n) => /* @__PURE__ */ w.jsx(ws, { toast: n, onDismiss: e }, n.id)) });
3751
3773
  }
3752
- function bs({ toast: t, onDismiss: e }) {
3774
+ function ws({ toast: t, onDismiss: e }) {
3753
3775
  return /* @__PURE__ */ w.jsxs(
3754
3776
  "div",
3755
3777
  {
@@ -3771,30 +3793,30 @@ function bs({ toast: t, onDismiss: e }) {
3771
3793
  );
3772
3794
  }
3773
3795
  const ln = Mt(null);
3774
- function Ss(t, e) {
3796
+ function vs(t, e) {
3775
3797
  return e ? t.replace(/\{(\w+)\}/g, (n, r) => e[r] ?? `{${r}}`) : t;
3776
3798
  }
3777
- function ws(t, e) {
3799
+ function Es(t, e) {
3778
3800
  const n = Mn();
3779
3801
  if (n && t.includes(n))
3780
3802
  return n;
3781
3803
  const r = navigator.language.split("-")[0];
3782
3804
  return t.includes(r) ? r : e && t.includes(e) ? e : "en";
3783
3805
  }
3784
- function vs(t, e, n) {
3785
- return e ? ws(t, n) : n && t.includes(n) ? n : "en";
3806
+ function Rs(t, e, n) {
3807
+ return e ? Es(t, n) : n && t.includes(n) ? n : "en";
3786
3808
  }
3787
- function Ds({
3809
+ function $s({
3788
3810
  children: t,
3789
3811
  translations: e,
3790
3812
  defaultLanguage: n,
3791
3813
  detectLanguage: r = !1
3792
3814
  }) {
3793
- const o = Object.keys(e), s = vs(o, r, n), i = e[s] ?? e.en, a = W(
3815
+ const o = Object.keys(e), s = Rs(o, r, n), i = e[s] ?? e.en, a = V(
3794
3816
  () => ({
3795
3817
  t: (l, h) => {
3796
3818
  const f = i[l];
3797
- return Ss(f, h);
3819
+ return vs(f, h);
3798
3820
  },
3799
3821
  locale: s,
3800
3822
  translations: i
@@ -3803,72 +3825,72 @@ function Ds({
3803
3825
  );
3804
3826
  return /* @__PURE__ */ w.jsx(ln, { value: a, children: t });
3805
3827
  }
3806
- function js() {
3828
+ function Bs() {
3807
3829
  const t = st(ln);
3808
3830
  if (!t)
3809
3831
  throw new Error("useI18n must be used within an I18nProvider");
3810
3832
  return t;
3811
3833
  }
3812
3834
  export {
3813
- Os as AuthProvider,
3814
- Ns as ConnectionStateRenderer,
3835
+ Ns as AuthProvider,
3836
+ Ps as ConnectionStateRenderer,
3815
3837
  on as DEBUG_OVERLAY_ENABLED,
3816
3838
  cn as DebugOverlay,
3817
- Ds as I18nProvider,
3818
- pr as IKON_UI_BASE_MODULE,
3819
- kr as IKON_UI_MEDIA_MODULE,
3820
- Vr as IKON_UI_SHADERTOY_MODULE,
3821
- Br as IKON_UI_SHADERTOY_TYPE,
3839
+ $s as I18nProvider,
3840
+ gr as IKON_UI_BASE_MODULE,
3841
+ _r as IKON_UI_MEDIA_MODULE,
3842
+ Kr as IKON_UI_SHADERTOY_MODULE,
3843
+ Wr as IKON_UI_SHADERTOY_TYPE,
3822
3844
  Qe as IKON_UI_STREAM_CATEGORY,
3823
- vr as IKON_UI_VIDEO_CANVAS_TYPE,
3824
- Er as IKON_UI_VIDEO_URL_PLAYER_TYPE,
3825
- Ms as IkonApp,
3845
+ Rr as IKON_UI_VIDEO_CANVAS_TYPE,
3846
+ Ar as IKON_UI_VIDEO_URL_PLAYER_TYPE,
3847
+ js as IkonApp,
3826
3848
  er as IkonUi,
3827
- Yr as IkonUiRegistry,
3849
+ zr as IkonUiRegistry,
3828
3850
  Bt as IkonUiSurface,
3829
3851
  Jn as InspectOverlay,
3830
- _s as ParallaxView,
3852
+ Os as ParallaxView,
3831
3853
  qn as UiComponentRegistry,
3832
3854
  Hn as UiRenderer,
3833
- Fs as UiStreamStore,
3855
+ Vs as UiStreamStore,
3834
3856
  Qt as authenticateAnonymous,
3835
- Po as buildOAuthRedirectUrl,
3857
+ Mo as buildOAuthRedirectUrl,
3836
3858
  Le as clearAuthSession,
3837
3859
  Nt as clearOAuthParams,
3838
- hr as createBaseResolvers,
3839
- ks as createComponentLibrary,
3840
- Gr as createIkonUiRegistry,
3841
- Ar as createMediaResolvers,
3842
- Fr as createShadertoyRendererResolver,
3860
+ mr as createBaseResolvers,
3861
+ _s as createComponentLibrary,
3862
+ Xr as createIkonUiRegistry,
3863
+ kr as createMediaResolvers,
3864
+ Vr as createShadertoyRendererResolver,
3843
3865
  Qn as isIkonUiCategoryMatch,
3844
3866
  Jt as loadAuthSession,
3845
- mr as loadBaseModule,
3846
- Cr as loadMediaModule,
3847
- Wr as loadShadertoyModule,
3848
- No as parseOAuthCallback,
3849
- Lo as parseOAuthError,
3850
- Ws as randomUuid,
3851
- gr as registerBaseModule,
3852
- _r as registerMediaModule,
3853
- Kr as registerShadertoyModule,
3867
+ yr as loadBaseModule,
3868
+ Ir as loadMediaModule,
3869
+ Yr as loadShadertoyModule,
3870
+ Po as parseOAuthCallback,
3871
+ Uo as parseOAuthError,
3872
+ Ys as randomUuid,
3873
+ br as registerBaseModule,
3874
+ Or as registerMediaModule,
3875
+ Gr as registerShadertoyModule,
3854
3876
  zn as renderChildren,
3855
- Is as renderMotionLetters,
3877
+ xs as renderMotionLetters,
3856
3878
  he as saveAuthSession,
3857
- Oo as sendLoginCode,
3879
+ No as sendLoginCode,
3858
3880
  ne as sessionToUser,
3859
- zo as useAuth,
3860
- xs as useAuthGuard,
3861
- Xo as useAuthOptional,
3862
- js as useI18n,
3863
- Ls as useIkonApp,
3864
- us as useIkonDebug,
3865
- rs as useIkonReactive,
3866
- eo as useIkonStyles,
3867
- no as useIkonUiStores,
3868
- Ps as useLazyFont,
3869
- Us as useReactive,
3870
- ns as useToasts,
3881
+ Ho as useAuth,
3882
+ Ls as useAuthGuard,
3883
+ qo as useAuthOptional,
3884
+ Bs as useI18n,
3885
+ Us as useIkonApp,
3886
+ fs as useIkonDebug,
3887
+ ss as useIkonReactive,
3888
+ no as useIkonStyles,
3889
+ oo as useIkonUiStores,
3890
+ Ms as useLazyFont,
3891
+ Ds as useReactive,
3892
+ os as useToasts,
3871
3893
  Z as useUiNode,
3872
- Cs as useUiStore,
3873
- xo as verifyLoginCode
3894
+ Is as useUiStore,
3895
+ Lo as verifyLoginCode
3874
3896
  };