@ikonai/sdk-react-ui 1.0.66 → 1.0.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,9 +1,9 @@
1
- import { IkonUiCore as rn, UiStreamStore as on } from "@ikonai/sdk-ui";
2
- import { UiStreamStore as Gs } from "@ikonai/sdk-ui";
3
- import sn, { useSyncExternalStore as Je, useMemo as W, memo as z, useRef as A, useCallback as D, Fragment as an, useEffect as _, useState as N, use as Ze, createContext as Ct, useReducer as cn } from "react";
4
- import { createLogger as ne, isInspectModeEnabled as ln, getOrCreateDeviceId as un, getSameOriginAuthUrl as dn, abortSignalTimeout as _t, deriveAuthUrl as ye, getDebugOverlayParam as fn, subscribeToLogEvents as It, LogLevel as We, parseUrlParams as hn, clearSessionParamsFromUrl as pn, isCloudEnvironment as ot, extractUserIdFromToken as mn, deriveBackendType as st, IkonClient as gn, AccessDeniedError as yn, ServerFullError as bn, AuthenticationError as wn, isDebugModeEnabled as Ot, getLangParam as Sn } from "@ikonai/sdk";
5
- import { randomUuid as zs } from "@ikonai/sdk";
6
- var Re = { exports: {} }, de = {};
1
+ import { IkonUiCore as fn, UiStreamStore as hn, prefetchBootSnapshot as pn } from "@ikonai/sdk-ui";
2
+ import { UiStreamStore as Qs } from "@ikonai/sdk-ui";
3
+ import mn, { useSyncExternalStore as nt, useMemo as W, memo as Y, useRef as v, useCallback as D, Fragment as gn, useEffect as C, useState as x, use as rt, createContext as Pt, useReducer as yn } from "react";
4
+ import { createLogger as se, isInspectModeEnabled as bn, getOrCreateDeviceId as wn, getSameOriginAuthUrl as Sn, abortSignalTimeout as Lt, deriveAuthUrl as Se, getDebugOverlayParam as En, subscribeToLogEvents as Mt, LogLevel as Xe, parseUrlParams as vn, clearSessionParamsFromUrl as Rn, isCloudEnvironment as lt, extractUserIdFromToken as ut, deriveBackendType as dt, IkonClient as An, AccessDeniedError as Tn, ServerFullError as kn, AuthenticationError as Cn, isDebugModeEnabled as Ut, getLangParam as _n } from "@ikonai/sdk";
5
+ import { randomUuid as ti } from "@ikonai/sdk";
6
+ var Te = { exports: {} }, pe = {};
7
7
  /**
8
8
  * @license React
9
9
  * react-jsx-runtime.production.js
@@ -13,10 +13,10 @@ var Re = { exports: {} }, de = {};
13
13
  * This source code is licensed under the MIT license found in the
14
14
  * LICENSE file in the root directory of this source tree.
15
15
  */
16
- var it;
17
- function En() {
18
- if (it) return de;
19
- it = 1;
16
+ var ft;
17
+ function In() {
18
+ if (ft) return pe;
19
+ ft = 1;
20
20
  var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
21
21
  function n(r, o, s) {
22
22
  var i = null;
@@ -33,9 +33,9 @@ function En() {
33
33
  props: s
34
34
  };
35
35
  }
36
- return de.Fragment = e, de.jsx = n, de.jsxs = n, de;
36
+ return pe.Fragment = e, pe.jsx = n, pe.jsxs = n, pe;
37
37
  }
38
- var fe = {};
38
+ var me = {};
39
39
  /**
40
40
  * @license React
41
41
  * react-jsx-runtime.development.js
@@ -45,15 +45,15 @@ var fe = {};
45
45
  * This source code is licensed under the MIT license found in the
46
46
  * LICENSE file in the root directory of this source tree.
47
47
  */
48
- var at;
49
- function vn() {
50
- return at || (at = 1, process.env.NODE_ENV !== "production" && (function() {
51
- function t(f) {
52
- if (f == null) return null;
53
- if (typeof f == "function")
54
- return f.$$typeof === x ? null : f.displayName || f.name || null;
55
- if (typeof f == "string") return f;
56
- switch (f) {
48
+ var ht;
49
+ function On() {
50
+ return ht || (ht = 1, process.env.NODE_ENV !== "production" && (function() {
51
+ function t(h) {
52
+ if (h == null) return null;
53
+ if (typeof h == "function")
54
+ return h.$$typeof === L ? null : h.displayName || h.name || null;
55
+ if (typeof h == "string") return h;
56
+ switch (h) {
57
57
  case g:
58
58
  return "Fragment";
59
59
  case w:
@@ -62,150 +62,150 @@ function vn() {
62
62
  return "StrictMode";
63
63
  case M:
64
64
  return "Suspense";
65
- case Q:
65
+ case J:
66
66
  return "SuspenseList";
67
- case I:
67
+ case _:
68
68
  return "Activity";
69
69
  }
70
- if (typeof f == "object")
71
- switch (typeof f.tag == "number" && console.error(
70
+ if (typeof h == "object")
71
+ switch (typeof h.tag == "number" && console.error(
72
72
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
73
- ), f.$$typeof) {
74
- case y:
73
+ ), h.$$typeof) {
74
+ case m:
75
75
  return "Portal";
76
76
  case E:
77
- return f.displayName || "Context";
78
- case v:
79
- return (f._context.displayName || "Context") + ".Consumer";
77
+ return h.displayName || "Context";
78
+ case R:
79
+ return (h._context.displayName || "Context") + ".Consumer";
80
80
  case T:
81
- var R = f.render;
82
- return f = f.displayName, f || (f = R.displayName || R.name || "", f = f !== "" ? "ForwardRef(" + f + ")" : "ForwardRef"), f;
83
- case re:
84
- return R = f.displayName || null, R !== null ? R : t(f.type) || "Memo";
85
- case q:
86
- R = f._payload, f = f._init;
81
+ var A = h.render;
82
+ return h = h.displayName, h || (h = A.displayName || A.name || "", h = h !== "" ? "ForwardRef(" + h + ")" : "ForwardRef"), h;
83
+ case Q:
84
+ return A = h.displayName || null, A !== null ? A : t(h.type) || "Memo";
85
+ case X:
86
+ A = h._payload, h = h._init;
87
87
  try {
88
- return t(f(R));
88
+ return t(h(A));
89
89
  } catch {
90
90
  }
91
91
  }
92
92
  return null;
93
93
  }
94
- function e(f) {
95
- return "" + f;
94
+ function e(h) {
95
+ return "" + h;
96
96
  }
97
- function n(f) {
97
+ function n(h) {
98
98
  try {
99
- e(f);
100
- var R = !1;
99
+ e(h);
100
+ var A = !1;
101
101
  } catch {
102
- R = !0;
102
+ A = !0;
103
103
  }
104
- if (R) {
105
- R = console;
106
- var C = R.error, P = typeof Symbol == "function" && Symbol.toStringTag && f[Symbol.toStringTag] || f.constructor.name || "Object";
107
- return C.call(
108
- R,
104
+ if (A) {
105
+ A = console;
106
+ var N = A.error, P = typeof Symbol == "function" && Symbol.toStringTag && h[Symbol.toStringTag] || h.constructor.name || "Object";
107
+ return N.call(
108
+ A,
109
109
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
110
110
  P
111
- ), e(f);
111
+ ), e(h);
112
112
  }
113
113
  }
114
- function r(f) {
115
- if (f === g) return "<>";
116
- if (typeof f == "object" && f !== null && f.$$typeof === q)
114
+ function r(h) {
115
+ if (h === g) return "<>";
116
+ if (typeof h == "object" && h !== null && h.$$typeof === X)
117
117
  return "<...>";
118
118
  try {
119
- var R = t(f);
120
- return R ? "<" + R + ">" : "<...>";
119
+ var A = t(h);
120
+ return A ? "<" + A + ">" : "<...>";
121
121
  } catch {
122
122
  return "<...>";
123
123
  }
124
124
  }
125
125
  function o() {
126
- var f = $.A;
127
- return f === null ? null : f.getOwner();
126
+ var h = U.A;
127
+ return h === null ? null : h.getOwner();
128
128
  }
129
129
  function s() {
130
130
  return Error("react-stack-top-frame");
131
131
  }
132
- function i(f) {
133
- if (V.call(f, "key")) {
134
- var R = Object.getOwnPropertyDescriptor(f, "key").get;
135
- if (R && R.isReactWarning) return !1;
132
+ function i(h) {
133
+ if (F.call(h, "key")) {
134
+ var A = Object.getOwnPropertyDescriptor(h, "key").get;
135
+ if (A && A.isReactWarning) return !1;
136
136
  }
137
- return f.key !== void 0;
137
+ return h.key !== void 0;
138
138
  }
139
- function a(f, R) {
140
- function C() {
141
- G || (G = !0, console.error(
139
+ function a(h, A) {
140
+ function N() {
141
+ K || (K = !0, console.error(
142
142
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
143
- R
143
+ A
144
144
  ));
145
145
  }
146
- C.isReactWarning = !0, Object.defineProperty(f, "key", {
147
- get: C,
146
+ N.isReactWarning = !0, Object.defineProperty(h, "key", {
147
+ get: N,
148
148
  configurable: !0
149
149
  });
150
150
  }
151
151
  function l() {
152
- var f = t(this.type);
153
- return we[f] || (we[f] = !0, console.error(
152
+ var h = t(this.type);
153
+ return ve[h] || (ve[h] = !0, console.error(
154
154
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
155
- )), f = this.props.ref, f !== void 0 ? f : null;
156
- }
157
- function d(f, R, C, P, ee, le) {
158
- var L = C.ref;
159
- return f = {
160
- $$typeof: u,
161
- type: f,
162
- key: R,
163
- props: C,
155
+ )), h = this.props.ref, h !== void 0 ? h : null;
156
+ }
157
+ function f(h, A, N, P, ee, he) {
158
+ var O = N.ref;
159
+ return h = {
160
+ $$typeof: d,
161
+ type: h,
162
+ key: A,
163
+ props: N,
164
164
  _owner: P
165
- }, (L !== void 0 ? L : null) !== null ? Object.defineProperty(f, "ref", {
165
+ }, (O !== void 0 ? O : null) !== null ? Object.defineProperty(h, "ref", {
166
166
  enumerable: !1,
167
167
  get: l
168
- }) : Object.defineProperty(f, "ref", { enumerable: !1, value: null }), f._store = {}, Object.defineProperty(f._store, "validated", {
168
+ }) : Object.defineProperty(h, "ref", { enumerable: !1, value: null }), h._store = {}, Object.defineProperty(h._store, "validated", {
169
169
  configurable: !1,
170
170
  enumerable: !1,
171
171
  writable: !0,
172
172
  value: 0
173
- }), Object.defineProperty(f, "_debugInfo", {
173
+ }), Object.defineProperty(h, "_debugInfo", {
174
174
  configurable: !1,
175
175
  enumerable: !1,
176
176
  writable: !0,
177
177
  value: null
178
- }), Object.defineProperty(f, "_debugStack", {
178
+ }), Object.defineProperty(h, "_debugStack", {
179
179
  configurable: !1,
180
180
  enumerable: !1,
181
181
  writable: !0,
182
182
  value: ee
183
- }), Object.defineProperty(f, "_debugTask", {
183
+ }), Object.defineProperty(h, "_debugTask", {
184
184
  configurable: !1,
185
185
  enumerable: !1,
186
186
  writable: !0,
187
- value: le
188
- }), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
187
+ value: he
188
+ }), Object.freeze && (Object.freeze(h.props), Object.freeze(h)), h;
189
189
  }
190
- function h(f, R, C, P, ee, le) {
191
- var L = R.children;
192
- if (L !== void 0)
190
+ function p(h, A, N, P, ee, he) {
191
+ var O = A.children;
192
+ if (O !== void 0)
193
193
  if (P)
194
- if (B(L)) {
195
- for (P = 0; P < L.length; P++)
196
- p(L[P]);
197
- Object.freeze && Object.freeze(L);
194
+ if (B(O)) {
195
+ for (P = 0; P < O.length; P++)
196
+ y(O[P]);
197
+ Object.freeze && Object.freeze(O);
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 p(L);
203
- if (V.call(R, "key")) {
204
- L = t(f);
205
- var U = Object.keys(R).filter(function(ue) {
206
- return ue !== "key";
202
+ else y(O);
203
+ if (F.call(A, "key")) {
204
+ O = t(h);
205
+ var Z = Object.keys(A).filter(function(Me) {
206
+ return Me !== "key";
207
207
  });
208
- P = 0 < U.length ? "{key: someKey, " + U.join(": ..., ") + ": ...}" : "{key: someKey}", ve[L + P] || (U = 0 < U.length ? "{" + U.join(": ..., ") + ": ...}" : "{}", console.error(
208
+ P = 0 < Z.length ? "{key: someKey, " + Z.join(": ..., ") + ": ...}" : "{key: someKey}", fe[O + P] || (Z = 0 < Z.length ? "{" + Z.join(": ..., ") + ": ...}" : "{}", console.error(
209
209
  `A props object containing a "key" prop is being spread into JSX:
210
210
  let props = %s;
211
211
  <%s {...props} />
@@ -213,76 +213,76 @@ React keys must be passed directly to JSX without using spread:
213
213
  let props = %s;
214
214
  <%s key={someKey} {...props} />`,
215
215
  P,
216
- L,
217
- U,
218
- L
219
- ), ve[L + P] = !0);
216
+ O,
217
+ Z,
218
+ O
219
+ ), fe[O + P] = !0);
220
220
  }
221
- if (L = null, C !== void 0 && (n(C), L = "" + C), i(R) && (n(R.key), L = "" + R.key), "key" in R) {
222
- C = {};
223
- for (var X in R)
224
- X !== "key" && (C[X] = R[X]);
225
- } else C = R;
226
- return L && a(
227
- C,
228
- typeof f == "function" ? f.displayName || f.name || "Unknown" : f
229
- ), d(
230
- f,
231
- L,
232
- C,
221
+ if (O = null, N !== void 0 && (n(N), O = "" + N), i(A) && (n(A.key), O = "" + A.key), "key" in A) {
222
+ N = {};
223
+ for (var te in A)
224
+ te !== "key" && (N[te] = A[te]);
225
+ } else N = A;
226
+ return O && a(
227
+ N,
228
+ typeof h == "function" ? h.displayName || h.name || "Unknown" : h
229
+ ), f(
230
+ h,
231
+ O,
232
+ N,
233
233
  o(),
234
234
  ee,
235
- le
235
+ he
236
236
  );
237
237
  }
238
- function p(f) {
239
- m(f) ? f._store && (f._store.validated = 1) : typeof f == "object" && f !== null && f.$$typeof === q && (f._payload.status === "fulfilled" ? m(f._payload.value) && f._payload.value._store && (f._payload.value._store.validated = 1) : f._store && (f._store.validated = 1));
238
+ function y(h) {
239
+ u(h) ? h._store && (h._store.validated = 1) : typeof h == "object" && h !== null && h.$$typeof === X && (h._payload.status === "fulfilled" ? u(h._payload.value) && h._payload.value._store && (h._payload.value._store.validated = 1) : h._store && (h._store.validated = 1));
240
240
  }
241
- function m(f) {
242
- return typeof f == "object" && f !== null && f.$$typeof === u;
241
+ function u(h) {
242
+ return typeof h == "object" && h !== null && h.$$typeof === d;
243
243
  }
244
- var c = sn, u = Symbol.for("react.transitional.element"), y = Symbol.for("react.portal"), g = Symbol.for("react.fragment"), b = Symbol.for("react.strict_mode"), w = Symbol.for("react.profiler"), v = Symbol.for("react.consumer"), E = Symbol.for("react.context"), T = Symbol.for("react.forward_ref"), M = Symbol.for("react.suspense"), Q = Symbol.for("react.suspense_list"), re = Symbol.for("react.memo"), q = Symbol.for("react.lazy"), I = Symbol.for("react.activity"), x = Symbol.for("react.client.reference"), $ = c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, V = Object.prototype.hasOwnProperty, B = Array.isArray, K = console.createTask ? console.createTask : function() {
244
+ var c = mn, d = Symbol.for("react.transitional.element"), m = Symbol.for("react.portal"), g = Symbol.for("react.fragment"), b = Symbol.for("react.strict_mode"), w = Symbol.for("react.profiler"), R = Symbol.for("react.consumer"), E = Symbol.for("react.context"), T = Symbol.for("react.forward_ref"), M = Symbol.for("react.suspense"), J = Symbol.for("react.suspense_list"), Q = Symbol.for("react.memo"), X = Symbol.for("react.lazy"), _ = Symbol.for("react.activity"), L = Symbol.for("react.client.reference"), U = c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, F = Object.prototype.hasOwnProperty, B = Array.isArray, $ = console.createTask ? console.createTask : function() {
245
245
  return null;
246
246
  };
247
247
  c = {
248
- react_stack_bottom_frame: function(f) {
249
- return f();
248
+ react_stack_bottom_frame: function(h) {
249
+ return h();
250
250
  }
251
251
  };
252
- var G, we = {}, Se = c.react_stack_bottom_frame.bind(
252
+ var K, ve = {}, de = c.react_stack_bottom_frame.bind(
253
253
  c,
254
254
  s
255
- )(), Ee = K(r(s)), ve = {};
256
- fe.Fragment = g, fe.jsx = function(f, R, C) {
257
- var P = 1e4 > $.recentlyCreatedOwnerStacks++;
258
- return h(
259
- f,
260
- R,
261
- C,
255
+ )(), Re = $(r(s)), fe = {};
256
+ me.Fragment = g, me.jsx = function(h, A, N) {
257
+ var P = 1e4 > U.recentlyCreatedOwnerStacks++;
258
+ return p(
259
+ h,
260
+ A,
261
+ N,
262
262
  !1,
263
- P ? Error("react-stack-top-frame") : Se,
264
- P ? K(r(f)) : Ee
263
+ P ? Error("react-stack-top-frame") : de,
264
+ P ? $(r(h)) : Re
265
265
  );
266
- }, fe.jsxs = function(f, R, C) {
267
- var P = 1e4 > $.recentlyCreatedOwnerStacks++;
268
- return h(
269
- f,
270
- R,
271
- C,
266
+ }, me.jsxs = function(h, A, N) {
267
+ var P = 1e4 > U.recentlyCreatedOwnerStacks++;
268
+ return p(
269
+ h,
270
+ A,
271
+ N,
272
272
  !0,
273
- P ? Error("react-stack-top-frame") : Se,
274
- P ? K(r(f)) : Ee
273
+ P ? Error("react-stack-top-frame") : de,
274
+ P ? $(r(h)) : Re
275
275
  );
276
276
  };
277
- })()), fe;
277
+ })()), me;
278
278
  }
279
- var ct;
280
- function Rn() {
281
- return ct || (ct = 1, process.env.NODE_ENV === "production" ? Re.exports = En() : Re.exports = vn()), Re.exports;
279
+ var pt;
280
+ function Nn() {
281
+ return pt || (pt = 1, process.env.NODE_ENV === "production" ? Te.exports = In() : Te.exports = On()), Te.exports;
282
282
  }
283
- var S = Rn();
284
- function An(t, e) {
285
- const n = Je(
283
+ var S = Nn();
284
+ function xn(t, e) {
285
+ const n = nt(
286
286
  (r) => t.subscribe(r),
287
287
  () => {
288
288
  const r = t.getSnapshot(), o = e ?? r.rootViewId, s = o ? r.views.get(o) : void 0;
@@ -301,16 +301,16 @@ function An(t, e) {
301
301
  };
302
302
  }, [n]);
303
303
  }
304
- function Z(t, e) {
305
- const n = Je(
304
+ function q(t, e) {
305
+ const n = nt(
306
306
  (r) => t.subscribeNode(e, r),
307
307
  () => t.getNodeVersion(e),
308
308
  () => t.getNodeVersion(e)
309
309
  );
310
310
  return W(() => t.getNode(e), [t, e, n]);
311
311
  }
312
- const Tn = ne("UIRenderer");
313
- function kn(t) {
312
+ const Pn = se("UIRenderer");
313
+ function Ln(t) {
314
314
  if (t === void 0)
315
315
  return "{}";
316
316
  if (typeof t == "string")
@@ -321,18 +321,18 @@ function kn(t) {
321
321
  return "{}";
322
322
  }
323
323
  }
324
- function Cn(t) {
324
+ function Mn(t) {
325
325
  const e = t.styleIds;
326
326
  return Array.isArray(e) ? e : [];
327
327
  }
328
- function _n(t) {
328
+ function Un(t) {
329
329
  const e = t.children;
330
330
  return Array.isArray(e) ? e : [];
331
331
  }
332
- function In(t, e) {
332
+ function jn(t, e) {
333
333
  return t.nodeId === e.nodeId && t.context === e.context;
334
334
  }
335
- function On(t) {
335
+ function Dn(t) {
336
336
  if (t.length === 0) return "";
337
337
  if (t.length === 1) return t[0].id;
338
338
  let e = t[0].id;
@@ -340,66 +340,66 @@ function On(t) {
340
340
  e += "," + t[n].id;
341
341
  return e;
342
342
  }
343
- const Ke = z(function t({ nodeId: e, context: n }) {
344
- const r = Z(n.store, e), o = r ? _n(r) : [], s = On(o), i = W(
345
- () => o.length === 0 ? null : o.map((p) => /* @__PURE__ */ S.jsx(t, { nodeId: p.id, context: n }, p.id)),
343
+ const He = Y(function t({ nodeId: e, context: n }) {
344
+ const r = q(n.store, e), o = r ? Un(r) : [], s = Dn(o), i = W(
345
+ () => o.length === 0 ? null : o.map((y) => /* @__PURE__ */ S.jsx(t, { nodeId: y.id, context: n }, y.id)),
346
346
  // eslint-disable-next-line react-hooks/exhaustive-deps
347
347
  [s, n]
348
348
  );
349
349
  if (!r)
350
350
  return null;
351
351
  if (r.type === "root")
352
- return /* @__PURE__ */ S.jsx(an, { children: i }, r.id);
352
+ return /* @__PURE__ */ S.jsx(gn, { children: i }, r.id);
353
353
  const a = n.library.resolve(r);
354
354
  if (!a)
355
- return Tn.warn(`No renderer for node type ${r.type}`), null;
356
- const l = Cn(r), d = l.length > 0 ? l.join(" ") : void 0, h = a;
357
- return /* @__PURE__ */ S.jsx(h, { nodeId: e, context: n, className: d });
358
- }, In);
359
- function Nn(t, e) {
360
- return !Array.isArray(t) || t.length === 0 ? null : t.map((n) => /* @__PURE__ */ S.jsx(Ke, { nodeId: n.id, context: e }, n.id));
361
- }
362
- function xn(t, e) {
355
+ return Pn.warn(`No renderer for node type ${r.type}`), null;
356
+ const l = Mn(r), f = l.length > 0 ? l.join(" ") : void 0, p = a;
357
+ return /* @__PURE__ */ S.jsx(p, { nodeId: e, context: n, className: f });
358
+ }, jn);
359
+ function $n(t, e) {
360
+ return !Array.isArray(t) || t.length === 0 ? null : t.map((n) => /* @__PURE__ */ S.jsx(He, { nodeId: n.id, context: e }, n.id));
361
+ }
362
+ function Bn(t, e) {
363
363
  return t.store === e.store && t.library === e.library && t.viewId === e.viewId && t.emptyFallback === e.emptyFallback;
364
364
  }
365
- const Pn = z(function({ store: e, library: n, viewId: r, emptyFallback: o = null, onAction: s, client: i, video: a }) {
366
- const { rootViewId: l, rootNodeId: d } = An(e, r), h = A(s);
367
- h.current = s;
368
- const p = A(i);
369
- p.current = i;
370
- const m = A(a);
371
- m.current = a;
372
- const c = D((y, g) => {
373
- if (!y)
365
+ const Fn = Y(function({ store: e, library: n, viewId: r, emptyFallback: o = null, onAction: s, client: i, video: a }) {
366
+ const { rootViewId: l, rootNodeId: f } = xn(e, r), p = v(s);
367
+ p.current = s;
368
+ const y = v(i);
369
+ y.current = i;
370
+ const u = v(a);
371
+ u.current = a;
372
+ const c = D((m, g) => {
373
+ if (!m)
374
374
  return;
375
- const b = kn(g);
376
- h.current?.(y, b);
377
- }, []), u = W(() => {
378
- const y = {
375
+ const b = Ln(g);
376
+ p.current?.(m, b);
377
+ }, []), d = W(() => {
378
+ const m = {
379
379
  store: e,
380
380
  library: n,
381
381
  handlerCache: e.handlerCache,
382
382
  // Access payloads from store at call time, not captured snapshot
383
383
  getPayload: (g) => e.getSnapshot().payloads.get(g),
384
- renderChildren: (g) => Nn(g, y),
384
+ renderChildren: (g) => $n(g, m),
385
385
  renderView: (g) => {
386
386
  const b = e.getSnapshot().views.get(g);
387
- return b ? /* @__PURE__ */ S.jsx(Ke, { nodeId: b.id, context: y }) : null;
387
+ return b ? /* @__PURE__ */ S.jsx(He, { nodeId: b.id, context: m }) : null;
388
388
  },
389
389
  dispatchAction: c,
390
390
  // Access client/video via refs to avoid context recreation
391
391
  get client() {
392
- return p.current;
392
+ return y.current;
393
393
  },
394
394
  get video() {
395
- return m.current;
395
+ return u.current;
396
396
  }
397
397
  };
398
- return y;
398
+ return m;
399
399
  }, [e, n, c]);
400
- return !l || !d ? o : /* @__PURE__ */ S.jsx("div", { "data-ikon-view-id": l, style: { display: "contents" }, children: /* @__PURE__ */ S.jsx(Ke, { nodeId: d, context: u }) });
401
- }, xn);
402
- class Ln {
400
+ return !l || !f ? o : /* @__PURE__ */ S.jsx("div", { "data-ikon-view-id": l, style: { display: "contents" }, children: /* @__PURE__ */ S.jsx(He, { nodeId: f, context: d }) });
401
+ }, Bn);
402
+ class Vn {
403
403
  constructor(e, n) {
404
404
  if (this.fallback = n, e)
405
405
  for (const [r, o] of e)
@@ -416,20 +416,20 @@ class Ln {
416
416
  return this.renderers.get(e.type) ?? this.fallback;
417
417
  }
418
418
  }
419
- function Cs(t, e) {
419
+ function Ms(t, e) {
420
420
  const n = Object.entries(t);
421
- return new Ln(n, e);
421
+ return new Vn(n, e);
422
422
  }
423
- function _s(t) {
424
- return Je(
423
+ function Us(t) {
424
+ return nt(
425
425
  (e) => t.subscribe(e),
426
426
  () => t.getSnapshot(),
427
427
  () => t.getSnapshot()
428
428
  );
429
429
  }
430
- function Mn() {
431
- const t = ln();
432
- return _(() => {
430
+ function Wn() {
431
+ const t = bn();
432
+ return C(() => {
433
433
  if (!t)
434
434
  return;
435
435
  let e = window.parent === window, n = null, r = [];
@@ -439,25 +439,25 @@ function Mn() {
439
439
  n && !r.includes(n) && (n.style.outline = "", n.style.outlineOffset = ""), n = null, o.style.display = "none";
440
440
  }
441
441
  function i(c) {
442
- for (const y of r)
443
- y !== n && (y.style.outline = "", y.style.outlineOffset = "");
442
+ for (const m of r)
443
+ m !== n && (m.style.outline = "", m.style.outlineOffset = "");
444
444
  r = [];
445
- const u = new Set(c);
446
- for (const y of Array.from(document.querySelectorAll("[data-ikon-source]"))) {
447
- const g = y.getAttribute("data-ikon-source") ?? "";
448
- u.has(g) && (y.style.outline = "2px solid #a6e3a1", y.style.outlineOffset = "1px", r.push(y));
445
+ const d = new Set(c);
446
+ for (const m of Array.from(document.querySelectorAll("[data-ikon-source]"))) {
447
+ const g = m.getAttribute("data-ikon-source") ?? "";
448
+ d.has(g) && (m.style.outline = "2px solid #a6e3a1", m.style.outlineOffset = "1px", r.push(m));
449
449
  }
450
450
  }
451
451
  function a(c) {
452
452
  if (!e)
453
453
  return;
454
- const u = c.target.closest?.("[data-ikon-source]");
455
- if (!u || u === n)
454
+ const d = c.target.closest?.("[data-ikon-source]");
455
+ if (!d || d === n)
456
456
  return;
457
- s(), n = u, n.style.outline = "2px solid #89b4fa", n.style.outlineOffset = "1px";
458
- const y = u.getAttribute("data-ikon-source") ?? "";
459
- o.textContent = y, o.style.display = "block";
460
- const g = u.getBoundingClientRect();
457
+ s(), n = d, n.style.outline = "2px solid #89b4fa", n.style.outlineOffset = "1px";
458
+ const m = d.getAttribute("data-ikon-source") ?? "";
459
+ o.textContent = m, o.style.display = "block";
460
+ const g = d.getBoundingClientRect();
461
461
  o.style.left = `${g.left}px`, o.style.top = `${Math.max(0, g.top - 24)}px`;
462
462
  }
463
463
  function l(c) {
@@ -465,77 +465,77 @@ function Mn() {
465
465
  return;
466
466
  c.relatedTarget?.closest?.("[data-ikon-source]") !== n && s();
467
467
  }
468
- function d(c) {
468
+ function f(c) {
469
469
  if (!e)
470
470
  return;
471
- const u = c.target.closest?.("[data-ikon-source]");
472
- if (!u)
471
+ const d = c.target.closest?.("[data-ikon-source]");
472
+ if (!d)
473
473
  return;
474
474
  c.preventDefault(), c.stopPropagation();
475
- const y = {
476
- sourceMarker: u.getAttribute("data-ikon-source") ?? "",
477
- tagName: u.tagName.toLowerCase(),
478
- textContent: (u.textContent ?? "").trim().substring(0, 200)
475
+ const m = {
476
+ sourceMarker: d.getAttribute("data-ikon-source") ?? "",
477
+ tagName: d.tagName.toLowerCase(),
478
+ textContent: (d.textContent ?? "").trim().substring(0, 200)
479
479
  };
480
- window.dispatchEvent(new CustomEvent("ikon-inspect-select", { detail: y })), window.parent.postMessage({ type: "ikon-element-selected", payload: y }, "*");
480
+ window.dispatchEvent(new CustomEvent("ikon-inspect-select", { detail: m })), window.parent.postMessage({ type: "ikon-element-selected", payload: m }, "*");
481
481
  }
482
- function h(c, u) {
483
- return document.elementFromPoint(c, u)?.closest?.("[data-ikon-source]");
482
+ function p(c, d) {
483
+ return document.elementFromPoint(c, d)?.closest?.("[data-ikon-source]");
484
484
  }
485
- function p(c) {
485
+ function y(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";
489
- const u = c.getAttribute("data-ikon-source") ?? "";
490
- o.textContent = u, o.style.display = "block";
491
- const y = c.getBoundingClientRect();
492
- o.style.left = `${y.left}px`, o.style.top = `${Math.max(0, y.top - 24)}px`;
489
+ const d = c.getAttribute("data-ikon-source") ?? "";
490
+ o.textContent = d, o.style.display = "block";
491
+ const m = c.getBoundingClientRect();
492
+ o.style.left = `${m.left}px`, o.style.top = `${Math.max(0, m.top - 24)}px`;
493
493
  }
494
- function m(c) {
494
+ function u(c) {
495
495
  if (c.data?.type === "ikon-inspect-mode") {
496
- const u = !!c.data.enabled;
497
- !u && e && s(), e = u;
496
+ const d = !!c.data.enabled;
497
+ !d && e && s(), e = d;
498
498
  return;
499
499
  }
500
500
  if (c.data?.type === "ikon-inspect-at") {
501
- const u = h(c.data.x, c.data.y);
502
- p(u);
503
- const y = u?.getAttribute("data-ikon-source") ?? "";
501
+ const d = p(c.data.x, c.data.y);
502
+ y(d);
503
+ const m = d?.getAttribute("data-ikon-source") ?? "";
504
504
  window.parent.postMessage({
505
505
  type: "ikon-inspect-hover-result",
506
- payload: { sourceMarker: y }
506
+ payload: { sourceMarker: m }
507
507
  }, "*");
508
508
  }
509
509
  if (c.data?.type === "ikon-inspect-click") {
510
- const u = h(c.data.x, c.data.y);
511
- if (u) {
512
- const y = {
513
- sourceMarker: u.getAttribute("data-ikon-source") ?? "",
514
- tagName: u.tagName.toLowerCase(),
515
- textContent: (u.textContent ?? "").trim().substring(0, 200)
510
+ const d = p(c.data.x, c.data.y);
511
+ if (d) {
512
+ const m = {
513
+ sourceMarker: d.getAttribute("data-ikon-source") ?? "",
514
+ tagName: d.tagName.toLowerCase(),
515
+ textContent: (d.textContent ?? "").trim().substring(0, 200)
516
516
  };
517
- window.dispatchEvent(new CustomEvent("ikon-inspect-select", { detail: y })), window.parent.postMessage({ type: "ikon-element-selected", payload: y }, "*");
517
+ window.dispatchEvent(new CustomEvent("ikon-inspect-select", { detail: m })), window.parent.postMessage({ type: "ikon-element-selected", payload: m }, "*");
518
518
  }
519
519
  }
520
520
  if (c.data?.type === "ikon-inspect-click-add") {
521
- const u = h(c.data.x, c.data.y);
522
- if (u) {
523
- const y = {
524
- sourceMarker: u.getAttribute("data-ikon-source") ?? "",
525
- tagName: u.tagName.toLowerCase(),
526
- textContent: (u.textContent ?? "").trim().substring(0, 200)
521
+ const d = p(c.data.x, c.data.y);
522
+ if (d) {
523
+ const m = {
524
+ sourceMarker: d.getAttribute("data-ikon-source") ?? "",
525
+ tagName: d.tagName.toLowerCase(),
526
+ textContent: (d.textContent ?? "").trim().substring(0, 200)
527
527
  };
528
528
  window.parent.postMessage({
529
529
  type: "ikon-inspect-rect-result",
530
- payload: { elements: [y], append: !0 }
530
+ payload: { elements: [m], append: !0 }
531
531
  }, "*");
532
532
  }
533
533
  }
534
534
  if (c.data?.type === "ikon-inspect-rect") {
535
- const { x1: u, y1: y, x2: g, y2: b, append: w } = c.data, v = document.querySelectorAll("[data-ikon-source]"), E = [];
536
- for (const T of Array.from(v)) {
535
+ const { x1: d, y1: m, x2: g, y2: b, append: w } = c.data, R = document.querySelectorAll("[data-ikon-source]"), E = [];
536
+ for (const T of Array.from(R)) {
537
537
  const M = T.getBoundingClientRect();
538
- M.right > u && M.left < g && M.bottom > y && M.top < b && E.push({
538
+ M.right > d && M.left < g && M.bottom > m && M.top < b && E.push({
539
539
  sourceMarker: T.getAttribute("data-ikon-source") ?? "",
540
540
  tagName: T.tagName.toLowerCase(),
541
541
  textContent: (T.textContent ?? "").trim().substring(0, 200)
@@ -548,40 +548,40 @@ function Mn() {
548
548
  }
549
549
  c.data?.type === "ikon-inspect-highlight" && i(c.data.markers ?? []), c.data?.type === "ikon-inspect-clear" && s();
550
550
  }
551
- return document.addEventListener("mouseover", a, !0), document.addEventListener("mouseout", l, !0), document.addEventListener("click", d, !0), window.addEventListener("message", m), () => {
552
- document.removeEventListener("mouseover", a, !0), document.removeEventListener("mouseout", l, !0), document.removeEventListener("click", d, !0), window.removeEventListener("message", m), s(), i([]), o.remove();
551
+ return document.addEventListener("mouseover", a, !0), document.addEventListener("mouseout", l, !0), document.addEventListener("click", f, !0), window.addEventListener("message", u), () => {
552
+ document.removeEventListener("mouseover", a, !0), document.removeEventListener("mouseout", l, !0), document.removeEventListener("click", f, !0), window.removeEventListener("message", u), s(), i([]), o.remove();
553
553
  };
554
554
  }, [t]), null;
555
555
  }
556
- const Un = ne("IkonUiSurface"), Ge = "ikon-ui";
557
- function jn(t, e) {
556
+ const Kn = se("IkonUiSurface"), qe = "ikon-ui";
557
+ function Gn(t, e) {
558
558
  return t === e;
559
559
  }
560
- const Nt = z(function({ stores: e, registry: n, category: r = Ge, onAction: o, client: s }) {
561
- const i = W(() => Array.from(e.keys()).sort().join(","), [e]), a = A(o);
560
+ const jt = Y(function({ stores: e, registry: n, category: r = qe, onAction: o, client: s }) {
561
+ const i = W(() => Array.from(e.keys()).sort().join(","), [e]), a = v(o);
562
562
  a.current = o;
563
- const l = A(s);
563
+ const l = v(s);
564
564
  l.current = s;
565
- const d = W(
565
+ const f = W(
566
566
  () => {
567
- const m = [];
568
- for (const [c, u] of e) {
569
- const y = u.store.getSnapshot();
570
- jn(u.category, r) && (!y.rootViewId || !y.views.has(y.rootViewId) || m.push({ key: c, store: u.store }));
567
+ const u = [];
568
+ for (const [c, d] of e) {
569
+ const m = d.store.getSnapshot();
570
+ Gn(d.category, r) && (!m.rootViewId || !m.views.has(m.rootViewId) || u.push({ key: c, store: d.store }));
571
571
  }
572
- return m;
572
+ return u;
573
573
  },
574
574
  // eslint-disable-next-line react-hooks/exhaustive-deps
575
575
  [e, r, i]
576
- ), h = A(!1), p = d.length > 0;
577
- return _(() => {
578
- p && !h.current && (h.current = !0, Un.debug("First UI render"));
579
- }, [p]), p ? /* @__PURE__ */ S.jsxs(S.Fragment, { children: [
580
- /* @__PURE__ */ S.jsx(Mn, {}),
581
- d.map(({ key: m, store: c }) => /* @__PURE__ */ S.jsx(Pn, { store: c, library: n, onAction: a.current, client: l.current, video: l.current?.media?.video }, m))
576
+ ), p = v(!1), y = f.length > 0;
577
+ return C(() => {
578
+ y && !p.current && (p.current = !0, Kn.debug("First UI render"));
579
+ }, [y]), y ? /* @__PURE__ */ S.jsxs(S.Fragment, { children: [
580
+ /* @__PURE__ */ S.jsx(Wn, {}),
581
+ f.map(({ key: u, store: c }) => /* @__PURE__ */ S.jsx(Fn, { store: c, library: n, onAction: a.current, client: l.current, video: l.current?.media?.video }, u))
582
582
  ] }) : null;
583
583
  });
584
- class Dn {
584
+ class Yn {
585
585
  core;
586
586
  ownsCore;
587
587
  stores = /* @__PURE__ */ new Map();
@@ -589,7 +589,7 @@ class Dn {
589
589
  unsubscribeClears;
590
590
  unsubscribeStoreChanges;
591
591
  constructor(e) {
592
- this.core = e?.core ?? new rn({ client: e?.client }), this.ownsCore = !e?.core, this.unsubscribeClears = this.core.subscribeToUiStreamCleared(this.handleUiStreamCleared), this.unsubscribeStoreChanges = this.core.uiStore.subscribe(this.syncStreamSnapshot), this.syncAllStreams();
592
+ this.core = e?.core ?? new fn({ client: e?.client, cache: e?.cache }), this.ownsCore = !e?.core, this.unsubscribeClears = this.core.subscribeToUiStreamCleared(this.handleUiStreamCleared), this.unsubscribeStoreChanges = this.core.uiStore.subscribe(this.syncStreamSnapshot), this.syncAllStreams();
593
593
  }
594
594
  dispose() {
595
595
  this.unsubscribeClears(), this.unsubscribeStoreChanges(), this.ownsCore && this.core.dispose(), this.listeners.clear(), this.stores.clear();
@@ -639,8 +639,8 @@ class Dn {
639
639
  if (n)
640
640
  return n;
641
641
  const r = {
642
- category: Ge,
643
- store: new on()
642
+ category: qe,
643
+ store: new hn()
644
644
  };
645
645
  return this.stores.set(e, r), r;
646
646
  }
@@ -648,7 +648,7 @@ class Dn {
648
648
  const r = this.stores.get(e);
649
649
  if (!r)
650
650
  return !1;
651
- const o = n ?? this.core.uiStore.getSnapshot(e)?.category ?? Ge;
651
+ const o = n ?? this.core.uiStore.getSnapshot(e)?.category ?? qe;
652
652
  return r.category === o ? !1 : (this.stores.set(e, { ...r, category: o }), !0);
653
653
  }
654
654
  notify(e) {
@@ -656,13 +656,13 @@ class Dn {
656
656
  n(e);
657
657
  }
658
658
  }
659
- function $n(t) {
659
+ function zn(t) {
660
660
  if (typeof t == "string") {
661
661
  const e = t.trim();
662
662
  return e.length > 0 ? e : void 0;
663
663
  }
664
664
  }
665
- function ae(t) {
665
+ function le(t) {
666
666
  if (typeof t == "string") {
667
667
  const e = t.trim();
668
668
  return e.length > 0 ? e : void 0;
@@ -672,7 +672,7 @@ function ae(t) {
672
672
  return e.length > 0 ? e.join(" ") : void 0;
673
673
  }
674
674
  }
675
- function Qe(...t) {
675
+ function ot(...t) {
676
676
  let e = "";
677
677
  for (const n of t)
678
678
  if (n) {
@@ -681,19 +681,19 @@ function Qe(...t) {
681
681
  }
682
682
  return e || void 0;
683
683
  }
684
- const lt = /* @__PURE__ */ new WeakMap(), Bn = {};
685
- function et(t) {
684
+ const mt = /* @__PURE__ */ new WeakMap(), Xn = {};
685
+ function st(t) {
686
686
  if (!t)
687
- return Bn;
688
- const e = lt.get(t);
687
+ return Xn;
688
+ const e = mt.get(t);
689
689
  if (e)
690
690
  return e;
691
691
  const n = {};
692
692
  for (const [r, o] of Object.entries(t))
693
693
  o != null && (typeof o == "string" || typeof o == "number" || typeof o == "boolean") && (n[r] = o);
694
- return lt.set(t, n), n;
694
+ return mt.set(t, n), n;
695
695
  }
696
- function Fn(t) {
696
+ function Hn(t) {
697
697
  let e = t.parentElement;
698
698
  for (; e; ) {
699
699
  const r = window.getComputedStyle(e).overflowY;
@@ -703,32 +703,32 @@ function Fn(t) {
703
703
  }
704
704
  return null;
705
705
  }
706
- const xt = 1.5;
707
- function Pt(t, e) {
706
+ const Dt = 1.5;
707
+ function $t(t, e) {
708
708
  requestAnimationFrame(() => {
709
- const n = t.getBoundingClientRect(), r = e.getBoundingClientRect(), o = t.scrollTop + (r.bottom - n.bottom) + 16, i = Math.abs(o - t.scrollTop) > t.clientHeight * xt ? "auto" : "smooth";
709
+ const n = t.getBoundingClientRect(), r = e.getBoundingClientRect(), o = t.scrollTop + (r.bottom - n.bottom) + 16, i = Math.abs(o - t.scrollTop) > t.clientHeight * Dt ? "auto" : "smooth";
710
710
  "scrollBehavior" in document.documentElement.style ? t.scrollTo({ top: o, behavior: i }) : t.scrollTop = o;
711
711
  });
712
712
  }
713
- const Ye = "data-ikon-scroll-indicator", Vn = 0.15, Ce = "data-ikon-at-bottom";
714
- function Lt(t) {
715
- return Math.max(t.clientHeight * Vn, 20);
713
+ const Je = "data-ikon-scroll-indicator", qn = 0.15, Ie = "data-ikon-at-bottom";
714
+ function Bt(t) {
715
+ return Math.max(t.clientHeight * qn, 20);
716
716
  }
717
- function Wn(t) {
718
- return t.getAttribute(Ce) !== "false";
717
+ function Jn(t) {
718
+ return t.getAttribute(Ie) !== "false";
719
719
  }
720
- function Kn(t) {
721
- t.getAttribute(Ce) === null && (t.setAttribute(Ce, "true"), t.addEventListener("scroll", () => {
722
- const { scrollTop: e, scrollHeight: n, clientHeight: r } = t, s = n - e - r <= Lt(t);
723
- t.setAttribute(Ce, s ? "true" : "false");
720
+ function Zn(t) {
721
+ t.getAttribute(Ie) === null && (t.setAttribute(Ie, "true"), t.addEventListener("scroll", () => {
722
+ const { scrollTop: e, scrollHeight: n, clientHeight: r } = t, s = n - e - r <= Bt(t);
723
+ t.setAttribute(Ie, s ? "true" : "false");
724
724
  }, { passive: !0 }));
725
725
  }
726
- function Gn(t) {
727
- const e = t.parentElement ?? t, n = e.querySelector(`[${Ye}]`);
726
+ function Qn(t) {
727
+ const e = t.parentElement ?? t, n = e.querySelector(`[${Je}]`);
728
728
  if (n)
729
729
  return n;
730
730
  const r = document.createElement("button");
731
- return r.setAttribute(Ye, "true"), r.setAttribute("aria-label", "Scroll to latest"), r.textContent = "↓", Object.assign(r.style, {
731
+ return r.setAttribute(Je, "true"), r.setAttribute("aria-label", "Scroll to latest"), r.textContent = "↓", Object.assign(r.style, {
732
732
  position: "absolute",
733
733
  bottom: "12px",
734
734
  left: "50%",
@@ -756,40 +756,40 @@ function Gn(t) {
756
756
  r.style.opacity = "0.9";
757
757
  }), e.appendChild(r), r;
758
758
  }
759
- function Yn(t, e) {
760
- const n = Gn(t);
759
+ function er(t, e) {
760
+ const n = Qn(t);
761
761
  n.style.display = "flex";
762
762
  const r = () => {
763
- Pt(t, e), n.style.display = "none";
763
+ $t(t, e), n.style.display = "none";
764
764
  }, o = () => {
765
765
  const { scrollTop: s, scrollHeight: i, clientHeight: a } = t;
766
- i - s - a <= Lt(t) && (n.style.display = "none");
766
+ i - s - a <= Bt(t) && (n.style.display = "none");
767
767
  };
768
768
  return n.addEventListener("click", r), t.addEventListener("scroll", o, { passive: !0 }), () => {
769
769
  n.removeEventListener("click", r), t.removeEventListener("scroll", o);
770
770
  };
771
771
  }
772
- function zn() {
773
- const t = z(function({ nodeId: n, context: r }) {
774
- const o = Z(r.store, n), s = A(null), i = ae(o?.props?.targetViewId), a = o?.props?.focusOnly, l = typeof a == "boolean" ? a : void 0, d = ae(o?.props?.priority), h = ae(o?.props?.key), p = o?.props?.preciseGeneratedAt;
775
- return _(() => {
772
+ function tr() {
773
+ const t = Y(function({ nodeId: n, context: r }) {
774
+ const o = q(r.store, n), s = v(null), i = le(o?.props?.targetViewId), a = o?.props?.focusOnly, l = typeof a == "boolean" ? a : void 0, f = le(o?.props?.priority), p = le(o?.props?.key), y = o?.props?.preciseGeneratedAt;
775
+ return C(() => {
776
776
  if (typeof document > "u")
777
777
  return;
778
778
  const c = s.current;
779
779
  if (!c || i && c.closest("[data-ikon-view-id]")?.getAttribute("data-ikon-view-id") !== i)
780
780
  return;
781
- let u;
781
+ let d;
782
782
  if (l !== !0) {
783
- const w = Fn(c);
783
+ const w = Hn(c);
784
784
  if (w)
785
- if (Kn(w), d === "Polite" && !Wn(w))
786
- u = Yn(w, c);
785
+ if (Zn(w), f === "Polite" && !Jn(w))
786
+ d = er(w, c);
787
787
  else {
788
- const M = (w.parentElement ?? w).querySelector(`[${Ye}]`);
789
- M && (M.style.display = "none"), Pt(w, c);
788
+ const M = (w.parentElement ?? w).querySelector(`[${Je}]`);
789
+ M && (M.style.display = "none"), $t(w, c);
790
790
  }
791
791
  else typeof c.scrollIntoView == "function" && requestAnimationFrame(() => {
792
- const v = c.getBoundingClientRect().top, E = typeof window < "u" ? window.innerHeight : 0, T = Math.abs(v) > E * xt ? "auto" : "smooth";
792
+ const R = c.getBoundingClientRect().top, E = typeof window < "u" ? window.innerHeight : 0, T = Math.abs(R) > E * Dt ? "auto" : "smooth";
793
793
  try {
794
794
  c.scrollIntoView({ behavior: T, block: "end", inline: "nearest" });
795
795
  } catch {
@@ -804,8 +804,8 @@ function zn() {
804
804
  } catch {
805
805
  c.focus();
806
806
  }
807
- return u;
808
- }, [l, d, i, h, p]), o ? /* @__PURE__ */ S.jsx(
807
+ return d;
808
+ }, [l, f, i, p, y]), o ? /* @__PURE__ */ S.jsx(
809
809
  "span",
810
810
  {
811
811
  ref: s,
@@ -822,26 +822,26 @@ function zn() {
822
822
  return t;
823
823
  };
824
824
  }
825
- function Xn() {
826
- const t = z(function({ nodeId: n, context: r, className: o }) {
827
- const s = Z(r.store, n), i = $n(s?.props?.onInvokeId), a = D(() => {
825
+ function nr() {
826
+ const t = Y(function({ nodeId: n, context: r, className: o }) {
827
+ const s = q(r.store, n), i = zn(s?.props?.onInvokeId), a = D(() => {
828
828
  i && r.dispatchAction(i);
829
829
  }, [i, r]);
830
830
  if (!s)
831
831
  return null;
832
- const l = et(s.props);
832
+ const l = st(s.props);
833
833
  delete l.onInvokeId;
834
- const d = Qe(ae(s.props?.className), o), h = s.children?.length ? r.renderChildren(s.children) : void 0;
834
+ const f = ot(le(s.props?.className), o), p = s.children?.length ? r.renderChildren(s.children) : void 0;
835
835
  return /* @__PURE__ */ S.jsx(
836
836
  "div",
837
837
  {
838
838
  ...l,
839
839
  "data-ikon-node-id": s.id,
840
840
  "data-ikon-source": s.sourceMarker,
841
- className: d,
841
+ className: f,
842
842
  onClick: i ? a : void 0,
843
843
  style: i ? { cursor: "pointer" } : void 0,
844
- children: h
844
+ children: p
845
845
  }
846
846
  );
847
847
  });
@@ -850,12 +850,12 @@ function Xn() {
850
850
  return t;
851
851
  };
852
852
  }
853
- function Hn() {
854
- const t = z(function({ nodeId: n, context: r, className: o }) {
855
- const s = Z(r.store, n);
853
+ function rr() {
854
+ const t = Y(function({ nodeId: n, context: r, className: o }) {
855
+ const s = q(r.store, n);
856
856
  if (!s)
857
857
  return null;
858
- const i = et(s.props), a = Qe("relative", ae(s.props?.className), o), l = s.children?.length ? r.renderChildren(s.children) : void 0;
858
+ const i = st(s.props), a = ot("relative", le(s.props?.className), o), l = s.children?.length ? r.renderChildren(s.children) : void 0;
859
859
  return /* @__PURE__ */ S.jsx("div", { ...i, "data-ikon-node-id": s.id, "data-ikon-source": s.sourceMarker, className: a, children: l });
860
860
  });
861
861
  return ({ type: e }) => {
@@ -863,12 +863,12 @@ function Hn() {
863
863
  return t;
864
864
  };
865
865
  }
866
- function qn() {
867
- const t = z(function({ nodeId: n, context: r, className: o }) {
868
- const s = Z(r.store, n);
866
+ function or() {
867
+ const t = Y(function({ nodeId: n, context: r, className: o }) {
868
+ const s = q(r.store, n);
869
869
  if (!s)
870
870
  return null;
871
- const i = et(s.props), a = Qe("absolute", ae(s.props?.className), o), l = s.children?.length ? r.renderChildren(s.children) : void 0;
871
+ const i = st(s.props), a = ot("absolute", le(s.props?.className), o), l = s.children?.length ? r.renderChildren(s.children) : void 0;
872
872
  return /* @__PURE__ */ S.jsx("div", { ...i, "data-ikon-node-id": s.id, "data-ikon-source": s.sourceMarker, className: a, children: l });
873
873
  });
874
874
  return ({ type: e }) => {
@@ -876,19 +876,19 @@ function qn() {
876
876
  return t;
877
877
  };
878
878
  }
879
- function Jn() {
879
+ function sr() {
880
880
  return [
881
- Xn(),
882
- Hn(),
883
- qn(),
884
- zn()
881
+ nr(),
882
+ rr(),
883
+ or(),
884
+ tr()
885
885
  ];
886
886
  }
887
- const Zn = "base", Qn = async () => Jn();
888
- function er(t) {
889
- t.registerModule(Zn, Qn);
887
+ const ir = "base", ar = async () => sr();
888
+ function cr(t) {
889
+ t.registerModule(ir, ar);
890
890
  }
891
- function tr(t) {
891
+ function lr(t) {
892
892
  if (typeof t == "string") {
893
893
  const e = t.trim();
894
894
  return e.length > 0 ? e : void 0;
@@ -898,19 +898,19 @@ function tr(t) {
898
898
  return e.length > 0 ? e.join(" ") : void 0;
899
899
  }
900
900
  }
901
- function nr(...t) {
901
+ function ur(...t) {
902
902
  const e = [];
903
903
  for (const n of t)
904
904
  n && n.trim() && e.push(n.trim());
905
905
  return e.length > 0 ? e.join(" ") : void 0;
906
906
  }
907
- function ut(t) {
907
+ function gt(t) {
908
908
  if (typeof t != "string")
909
909
  return;
910
910
  const e = t.trim();
911
911
  return e.length > 0 ? e : void 0;
912
912
  }
913
- function Ae(t) {
913
+ function ke(t) {
914
914
  if (typeof t == "boolean")
915
915
  return t;
916
916
  if (typeof t == "string") {
@@ -919,42 +919,42 @@ function Ae(t) {
919
919
  if (e === "false") return !1;
920
920
  }
921
921
  }
922
- const rr = "std.audio-url-player";
923
- function or() {
924
- const t = z(function({
922
+ const dr = "std.audio-url-player";
923
+ function fr() {
924
+ const t = Y(function({
925
925
  nodeId: n,
926
926
  context: r,
927
927
  className: o
928
928
  }) {
929
- const s = Z(r.store, n), i = A(null), a = s ? Ae(s.props?.autoplay) : void 0, l = s ? ut(s.props?.src) : void 0;
930
- if (_(() => {
929
+ const s = q(r.store, n), i = v(null), a = s ? ke(s.props?.autoplay) : void 0, l = s ? gt(s.props?.src) : void 0;
930
+ if (C(() => {
931
931
  a && i.current && i.current.play().catch(() => {
932
932
  });
933
933
  }, [a, l]), !s)
934
934
  return null;
935
- const d = nr(tr(s.props?.className), o), h = ut(s.props?.preload), p = Ae(s.props?.controls), m = Ae(s.props?.loop), c = Ae(s.props?.muted);
935
+ const f = ur(lr(s.props?.className), o), p = gt(s.props?.preload), y = ke(s.props?.controls), u = ke(s.props?.loop), c = ke(s.props?.muted);
936
936
  return /* @__PURE__ */ S.jsx(
937
937
  "audio",
938
938
  {
939
939
  ref: i,
940
940
  src: l,
941
- ...h !== void 0 ? { preload: h } : {},
942
- ...p !== void 0 ? { controls: p } : {},
941
+ ...p !== void 0 ? { preload: p } : {},
942
+ ...y !== void 0 ? { controls: y } : {},
943
943
  ...a !== void 0 ? { autoPlay: a } : {},
944
- ...m !== void 0 ? { loop: m } : {},
944
+ ...u !== void 0 ? { loop: u } : {},
945
945
  ...c !== void 0 ? { muted: c } : {},
946
946
  "data-ikon-node-id": s.id,
947
947
  "data-ikon-source": s.sourceMarker,
948
- className: d
948
+ className: f
949
949
  }
950
950
  );
951
951
  });
952
952
  return ({ type: e }) => {
953
- if (e === rr)
953
+ if (e === dr)
954
954
  return t;
955
955
  };
956
956
  }
957
- function Mt(t) {
957
+ function Ft(t) {
958
958
  if (typeof t == "string") {
959
959
  const e = t.trim();
960
960
  return e.length > 0 ? e : void 0;
@@ -964,13 +964,13 @@ function Mt(t) {
964
964
  return e.length > 0 ? e.join(" ") : void 0;
965
965
  }
966
966
  }
967
- function Ut(...t) {
967
+ function Vt(...t) {
968
968
  const e = [];
969
969
  for (const n of t)
970
970
  n && n.trim() && e.push(n.trim());
971
971
  return e.length > 0 ? e.join(" ") : void 0;
972
972
  }
973
- function _e(t) {
973
+ function Oe(t) {
974
974
  if (typeof t == "number" && Number.isFinite(t))
975
975
  return Math.floor(t);
976
976
  if (typeof t == "string" && t.trim().length > 0) {
@@ -979,39 +979,39 @@ function _e(t) {
979
979
  return Math.floor(e);
980
980
  }
981
981
  }
982
- function ze(t) {
982
+ function Ze(t) {
983
983
  if (typeof t != "string")
984
984
  return;
985
985
  const e = t.trim();
986
986
  return e.length > 0 ? e : void 0;
987
987
  }
988
- const sr = "std.video-canvas", ir = "std.video-url-player";
989
- function ar() {
990
- const t = z(function({ nodeId: n, context: r, className: o }) {
991
- const s = Z(r.store, n), i = A(null), a = A(null), l = r.video, d = r.client, h = s ? ze(s.props?.streamId) : void 0, p = s ? _e(s.props?.width) : void 0, m = s ? _e(s.props?.height) : void 0, c = s ? Ut(Mt(s.props?.className), o) : o, [, u] = N(0);
992
- _(() => {
993
- if (!d?.isWebRtcEnabled) return;
994
- const g = d.onWebRtcTrackMapChanged;
995
- return d.onWebRtcTrackMapChanged = (b) => {
996
- g?.(b), b.kind === "video" && u((w) => w + 1);
988
+ const hr = "std.video-canvas", pr = "std.video-url-player";
989
+ function mr() {
990
+ const t = Y(function({ nodeId: n, context: r, className: o }) {
991
+ const s = q(r.store, n), i = v(null), a = v(null), l = r.video, f = r.client, p = s ? Ze(s.props?.streamId) : void 0, y = s ? Oe(s.props?.width) : void 0, u = s ? Oe(s.props?.height) : void 0, c = s ? Vt(Ft(s.props?.className), o) : o, [, d] = x(0);
992
+ C(() => {
993
+ if (!f?.isWebRtcEnabled) return;
994
+ const g = f.onWebRtcTrackMapChanged;
995
+ return f.onWebRtcTrackMapChanged = (b) => {
996
+ g?.(b), b.kind === "video" && d((w) => w + 1);
997
997
  }, () => {
998
- d.onWebRtcTrackMapChanged = g;
998
+ f.onWebRtcTrackMapChanged = g;
999
999
  };
1000
- }, [d]);
1001
- const y = d?.isWebRtcEnabled && h ? d.getWebRtcVideoStreamByStreamId(h) : null;
1002
- return _(() => {
1000
+ }, [f]);
1001
+ const m = f?.isWebRtcEnabled && p ? f.getWebRtcVideoStreamByStreamId(p) : null;
1002
+ return C(() => {
1003
1003
  const g = i.current;
1004
- if (!(!l || !g || !h || y))
1005
- return l.attachCanvas(h, g), () => {
1006
- l.detachCanvas(h);
1004
+ if (!(!l || !g || !p || m))
1005
+ return l.attachCanvas(p, g), () => {
1006
+ l.detachCanvas(p);
1007
1007
  };
1008
- }, [l, h, y]), _(() => {
1008
+ }, [l, p, m]), C(() => {
1009
1009
  const g = a.current;
1010
- if (!(!g || !y))
1011
- return g.srcObject = y, () => {
1010
+ if (!(!g || !m))
1011
+ return g.srcObject = m, () => {
1012
1012
  g.srcObject = null;
1013
1013
  };
1014
- }, [y]), s ? y ? /* @__PURE__ */ S.jsx(
1014
+ }, [m]), s ? m ? /* @__PURE__ */ S.jsx(
1015
1015
  "video",
1016
1016
  {
1017
1017
  ref: a,
@@ -1020,35 +1020,35 @@ function ar() {
1020
1020
  muted: !0,
1021
1021
  "data-ikon-node-id": s.id,
1022
1022
  "data-ikon-source": s.sourceMarker,
1023
- "data-ikon-video-stream-id": h,
1023
+ "data-ikon-video-stream-id": p,
1024
1024
  className: c,
1025
- ...p ? { width: p } : {},
1026
- ...m ? { height: m } : {}
1025
+ ...y ? { width: y } : {},
1026
+ ...u ? { height: u } : {}
1027
1027
  },
1028
- h
1028
+ p
1029
1029
  ) : /* @__PURE__ */ S.jsx(
1030
1030
  "canvas",
1031
1031
  {
1032
1032
  ref: i,
1033
1033
  "data-ikon-node-id": s.id,
1034
1034
  "data-ikon-source": s.sourceMarker,
1035
- "data-ikon-video-stream-id": h,
1035
+ "data-ikon-video-stream-id": p,
1036
1036
  className: c,
1037
- ...p ? { width: p } : {},
1038
- ...m ? { height: m } : {}
1037
+ ...y ? { width: y } : {},
1038
+ ...u ? { height: u } : {}
1039
1039
  },
1040
- h
1040
+ p
1041
1041
  ) : null;
1042
1042
  });
1043
1043
  return ({ type: e }) => {
1044
- if (e === sr)
1044
+ if (e === hr)
1045
1045
  return t;
1046
1046
  };
1047
1047
  }
1048
- function cr() {
1049
- return [ar(), lr(), or()];
1048
+ function gr() {
1049
+ return [mr(), yr(), fr()];
1050
1050
  }
1051
- function he(t) {
1051
+ function ge(t) {
1052
1052
  if (typeof t == "boolean")
1053
1053
  return t;
1054
1054
  if (typeof t == "string") {
@@ -1057,61 +1057,61 @@ function he(t) {
1057
1057
  if (e === "false") return !1;
1058
1058
  }
1059
1059
  }
1060
- function lr() {
1061
- const t = z(function({
1060
+ function yr() {
1061
+ const t = Y(function({
1062
1062
  nodeId: n,
1063
1063
  context: r,
1064
1064
  className: o
1065
1065
  }) {
1066
- const s = Z(r.store, n), i = A(null), a = s ? he(s.props?.autoplay) : void 0, l = s ? ze(s.props?.src) : void 0;
1067
- if (_(() => {
1066
+ const s = q(r.store, n), i = v(null), a = s ? ge(s.props?.autoplay) : void 0, l = s ? Ze(s.props?.src) : void 0;
1067
+ if (C(() => {
1068
1068
  a && i.current && i.current.play().catch(() => {
1069
1069
  });
1070
1070
  }, [a, l]), !s)
1071
1071
  return null;
1072
- const d = Ut(Mt(s.props?.className), o), h = ze(s.props?.poster), p = he(s.props?.controls), m = he(s.props?.loop), c = he(s.props?.muted), u = he(s.props?.playsInline), y = _e(s.props?.width), g = _e(s.props?.height), b = s.children?.length ? r.renderChildren(s.children) : void 0;
1072
+ const f = Vt(Ft(s.props?.className), o), p = Ze(s.props?.poster), y = ge(s.props?.controls), u = ge(s.props?.loop), c = ge(s.props?.muted), d = ge(s.props?.playsInline), m = Oe(s.props?.width), g = Oe(s.props?.height), b = s.children?.length ? r.renderChildren(s.children) : void 0;
1073
1073
  return /* @__PURE__ */ S.jsx(
1074
1074
  "video",
1075
1075
  {
1076
1076
  ref: i,
1077
1077
  src: l,
1078
- poster: h,
1079
- ...p !== void 0 ? { controls: p } : {},
1078
+ poster: p,
1079
+ ...y !== void 0 ? { controls: y } : {},
1080
1080
  ...a !== void 0 ? { autoPlay: a } : {},
1081
- ...m !== void 0 ? { loop: m } : {},
1081
+ ...u !== void 0 ? { loop: u } : {},
1082
1082
  ...c !== void 0 ? { muted: c } : {},
1083
- ...u !== void 0 ? { playsInline: u } : {},
1084
- ...y ? { width: y } : {},
1083
+ ...d !== void 0 ? { playsInline: d } : {},
1084
+ ...m ? { width: m } : {},
1085
1085
  ...g ? { height: g } : {},
1086
1086
  "data-ikon-node-id": s.id,
1087
1087
  "data-ikon-source": s.sourceMarker,
1088
- className: d,
1088
+ className: f,
1089
1089
  children: b
1090
1090
  }
1091
1091
  );
1092
1092
  });
1093
1093
  return ({ type: e }) => {
1094
- if (e === ir)
1094
+ if (e === pr)
1095
1095
  return t;
1096
1096
  };
1097
1097
  }
1098
- const ur = "media", dr = async () => cr();
1099
- function fr(t) {
1100
- t.registerModule(ur, dr);
1098
+ const br = "media", wr = async () => gr();
1099
+ function Sr(t) {
1100
+ t.registerModule(br, wr);
1101
1101
  }
1102
- const hr = `#version 300 es
1102
+ const Er = `#version 300 es
1103
1103
  in vec4 a_position;
1104
1104
  void main() {
1105
1105
  gl_Position = a_position;
1106
1106
  }
1107
- `, oe = 4;
1108
- function pr(t, e) {
1107
+ `, ie = 4;
1108
+ function vr(t, e) {
1109
1109
  return new RegExp(`\\buniform\\s+\\w+\\s+${e}\\s*;`, "g").test(t);
1110
1110
  }
1111
- function mr(t, e) {
1111
+ function Rr(t, e) {
1112
1112
  const n = [];
1113
1113
  for (const [r, o] of Object.entries(e)) {
1114
- if (pr(t, r))
1114
+ if (vr(t, r))
1115
1115
  continue;
1116
1116
  let s;
1117
1117
  switch (o.type) {
@@ -1172,7 +1172,7 @@ void main() {
1172
1172
  }
1173
1173
  `;
1174
1174
  }
1175
- class gr {
1175
+ class Ar {
1176
1176
  gl;
1177
1177
  program = null;
1178
1178
  positionBuffer = null;
@@ -1187,8 +1187,8 @@ class gr {
1187
1187
  mouseClickX = 0;
1188
1188
  mouseClickY = 0;
1189
1189
  channels = [];
1190
- channelResolution = new Float32Array(oe * 3);
1191
- channelTime = new Float32Array(oe);
1190
+ channelResolution = new Float32Array(ie * 3);
1191
+ channelTime = new Float32Array(ie);
1192
1192
  lastError = null;
1193
1193
  currentShaderSource = "";
1194
1194
  constructor(e) {
@@ -1211,7 +1211,7 @@ class gr {
1211
1211
  }
1212
1212
  initializeChannels() {
1213
1213
  const e = this.gl;
1214
- for (let n = 0; n < oe; n++) {
1214
+ for (let n = 0; n < ie; n++) {
1215
1215
  const r = e.createTexture();
1216
1216
  e.bindTexture(e.TEXTURE_2D, r), e.texImage2D(e.TEXTURE_2D, 0, e.RGBA, 1, 1, 0, e.RGBA, e.UNSIGNED_BYTE, new Uint8Array([0, 0, 0, 255])), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, e.LINEAR), this.channels.push({ texture: r, width: 0, height: 0, url: null });
1217
1217
  }
@@ -1221,7 +1221,7 @@ class gr {
1221
1221
  // settings (vflip on, repeat wrap, mipmap filtering) so copy-pasted ShaderToy texture shaders render
1222
1222
  // the same way. Only channels whose URL changed are reloaded.
1223
1223
  setChannels(e) {
1224
- for (let n = 0; n < oe; n++) {
1224
+ for (let n = 0; n < ie; n++) {
1225
1225
  const r = e[n] ?? null, o = this.channels[n];
1226
1226
  if (o.url !== r) {
1227
1227
  if (o.url = r, !r) {
@@ -1247,10 +1247,10 @@ class gr {
1247
1247
  }
1248
1248
  compile(e, n = {}) {
1249
1249
  this.lastError = null, this.customUniforms = n, this.currentShaderSource = e;
1250
- const r = this.gl, o = this.compileShader(r.VERTEX_SHADER, hr);
1250
+ const r = this.gl, o = this.compileShader(r.VERTEX_SHADER, Er);
1251
1251
  if (!o)
1252
1252
  return !1;
1253
- const s = mr(e, n), i = this.compileShader(r.FRAGMENT_SHADER, s);
1253
+ const s = Rr(e, n), i = this.compileShader(r.FRAGMENT_SHADER, s);
1254
1254
  if (!i)
1255
1255
  return r.deleteShader(o), !1;
1256
1256
  const a = r.createProgram();
@@ -1270,7 +1270,7 @@ class gr {
1270
1270
  const n = ["iResolution", "iTime", "iTimeDelta", "iFrame", "iMouse", "iDate"];
1271
1271
  for (const r of n)
1272
1272
  this.uniformLocations.set(r, e.getUniformLocation(this.program, r));
1273
- for (let r = 0; r < oe; r++)
1273
+ for (let r = 0; r < ie; r++)
1274
1274
  this.uniformLocations.set(`iChannel${r}`, e.getUniformLocation(this.program, `iChannel${r}`));
1275
1275
  this.uniformLocations.set("iChannelResolution", e.getUniformLocation(this.program, "iChannelResolution[0]")), this.uniformLocations.set("iChannelTime", e.getUniformLocation(this.program, "iChannelTime[0]"));
1276
1276
  for (const r of Object.keys(this.customUniforms))
@@ -1289,57 +1289,57 @@ class gr {
1289
1289
  (n.width !== o || n.height !== s) && (n.width = o, n.height = s, e.viewport(0, 0, o, s));
1290
1290
  const i = performance.now(), a = (i - this.startTime) / 1e3, l = (i - this.lastFrameTime) / 1e3;
1291
1291
  this.lastFrameTime = i, this.frameCount++, e.clearColor(0, 0, 0, 1), e.clear(e.COLOR_BUFFER_BIT), e.useProgram(this.program), e.bindVertexArray(this.vao);
1292
- const d = this.uniformLocations.get("iResolution");
1293
- d && e.uniform3f(d, o, s, 1);
1294
- const h = this.uniformLocations.get("iTime");
1295
- h && e.uniform1f(h, a);
1296
- const p = this.uniformLocations.get("iTimeDelta");
1297
- p && e.uniform1f(p, l);
1298
- const m = this.uniformLocations.get("iFrame");
1299
- m && e.uniform1i(m, this.frameCount);
1292
+ const f = this.uniformLocations.get("iResolution");
1293
+ f && e.uniform3f(f, o, s, 1);
1294
+ const p = this.uniformLocations.get("iTime");
1295
+ p && e.uniform1f(p, a);
1296
+ const y = this.uniformLocations.get("iTimeDelta");
1297
+ y && e.uniform1f(y, l);
1298
+ const u = this.uniformLocations.get("iFrame");
1299
+ u && e.uniform1i(u, this.frameCount);
1300
1300
  const c = this.uniformLocations.get("iMouse");
1301
1301
  c && e.uniform4f(c, this.mouseX, this.mouseY, this.mouseClickX, this.mouseClickY);
1302
- const u = this.uniformLocations.get("iDate");
1303
- if (u) {
1302
+ const d = this.uniformLocations.get("iDate");
1303
+ if (d) {
1304
1304
  const b = /* @__PURE__ */ new Date();
1305
- e.uniform4f(u, b.getFullYear(), b.getMonth(), b.getDate(), b.getHours() * 3600 + b.getMinutes() * 60 + b.getSeconds() + b.getMilliseconds() / 1e3);
1305
+ e.uniform4f(d, b.getFullYear(), b.getMonth(), b.getDate(), b.getHours() * 3600 + b.getMinutes() * 60 + b.getSeconds() + b.getMilliseconds() / 1e3);
1306
1306
  }
1307
- for (let b = 0; b < oe; b++) {
1307
+ for (let b = 0; b < ie; b++) {
1308
1308
  e.activeTexture(e.TEXTURE0 + b), e.bindTexture(e.TEXTURE_2D, this.channels[b].texture);
1309
1309
  const w = this.uniformLocations.get(`iChannel${b}`);
1310
1310
  w && e.uniform1i(w, b);
1311
1311
  }
1312
- const y = this.uniformLocations.get("iChannelResolution");
1313
- y && e.uniform3fv(y, this.channelResolution);
1312
+ const m = this.uniformLocations.get("iChannelResolution");
1313
+ m && e.uniform3fv(m, this.channelResolution);
1314
1314
  const g = this.uniformLocations.get("iChannelTime");
1315
1315
  g && e.uniform1fv(g, this.channelTime);
1316
1316
  for (const [b, w] of Object.entries(this.customUniforms)) {
1317
- const v = this.uniformLocations.get(b);
1318
- if (v)
1317
+ const R = this.uniformLocations.get(b);
1318
+ if (R)
1319
1319
  switch (w.type) {
1320
1320
  case "float":
1321
- e.uniform1f(v, w.value);
1321
+ e.uniform1f(R, w.value);
1322
1322
  break;
1323
1323
  case "vec2": {
1324
1324
  const E = w.value;
1325
- e.uniform2f(v, E[0], E[1]);
1325
+ e.uniform2f(R, E[0], E[1]);
1326
1326
  break;
1327
1327
  }
1328
1328
  case "vec3": {
1329
1329
  const E = w.value;
1330
- e.uniform3f(v, E[0], E[1], E[2]);
1330
+ e.uniform3f(R, E[0], E[1], E[2]);
1331
1331
  break;
1332
1332
  }
1333
1333
  case "vec4": {
1334
1334
  const E = w.value;
1335
- e.uniform4f(v, E[0], E[1], E[2], E[3]);
1335
+ e.uniform4f(R, E[0], E[1], E[2], E[3]);
1336
1336
  break;
1337
1337
  }
1338
1338
  case "int":
1339
- e.uniform1i(v, w.value);
1339
+ e.uniform1i(R, w.value);
1340
1340
  break;
1341
1341
  case "bool":
1342
- e.uniform1i(v, w.value ? 1 : 0);
1342
+ e.uniform1i(R, w.value ? 1 : 0);
1343
1343
  break;
1344
1344
  }
1345
1345
  }
@@ -1356,7 +1356,7 @@ class gr {
1356
1356
  this.channels = [], this.uniformLocations.clear();
1357
1357
  }
1358
1358
  }
1359
- function yr(t) {
1359
+ function Tr(t) {
1360
1360
  if (typeof t == "string") {
1361
1361
  const e = t.trim();
1362
1362
  return e.length > 0 ? e : void 0;
@@ -1366,13 +1366,13 @@ function yr(t) {
1366
1366
  return e.length > 0 ? e.join(" ") : void 0;
1367
1367
  }
1368
1368
  }
1369
- function br(...t) {
1369
+ function kr(...t) {
1370
1370
  const e = [];
1371
1371
  for (const n of t)
1372
1372
  n && n.trim() && e.push(n.trim());
1373
1373
  return e.length > 0 ? e.join(" ") : void 0;
1374
1374
  }
1375
- function Ue(t) {
1375
+ function Fe(t) {
1376
1376
  if (typeof t == "number" && Number.isFinite(t))
1377
1377
  return Math.floor(t);
1378
1378
  if (typeof t == "string" && t.trim().length > 0) {
@@ -1381,10 +1381,10 @@ function Ue(t) {
1381
1381
  return Math.floor(e);
1382
1382
  }
1383
1383
  }
1384
- function wr(t) {
1384
+ function Cr(t) {
1385
1385
  return typeof t == "string" ? t : "";
1386
1386
  }
1387
- function Sr(t) {
1387
+ function _r(t) {
1388
1388
  if (typeof t == "boolean")
1389
1389
  return t;
1390
1390
  if (typeof t == "string") {
@@ -1393,7 +1393,7 @@ function Sr(t) {
1393
1393
  if (e === "false") return !1;
1394
1394
  }
1395
1395
  }
1396
- function Er(t) {
1396
+ function Ir(t) {
1397
1397
  if (!t || typeof t != "object")
1398
1398
  return {};
1399
1399
  const e = {}, n = t;
@@ -1408,10 +1408,10 @@ function Er(t) {
1408
1408
  }
1409
1409
  return e;
1410
1410
  }
1411
- function vr(t) {
1411
+ function Or(t) {
1412
1412
  return Array.isArray(t) ? t.map((e) => typeof e == "string" ? e : null) : [];
1413
1413
  }
1414
- function Rr(t, e) {
1414
+ function Nr(t, e) {
1415
1415
  const n = Object.keys(t), r = Object.keys(e);
1416
1416
  if (n.length !== r.length)
1417
1417
  return !1;
@@ -1432,76 +1432,76 @@ function Rr(t, e) {
1432
1432
  }
1433
1433
  return !0;
1434
1434
  }
1435
- const Ar = "std.shadertoy-canvas";
1436
- function Tr() {
1437
- const t = z(function({ nodeId: n, context: r, className: o }) {
1438
- const s = Z(r.store, n), i = A(null), a = A(null), l = A(null), d = A(0), h = A(""), p = A({}), m = A({
1435
+ const xr = "std.shadertoy-canvas";
1436
+ function Pr() {
1437
+ const t = Y(function({ nodeId: n, context: r, className: o }) {
1438
+ const s = q(r.store, n), i = v(null), a = v(null), l = v(null), f = v(0), p = v(""), y = v({}), u = v({
1439
1439
  x: 0,
1440
1440
  y: 0,
1441
1441
  clickX: 0,
1442
1442
  clickY: 0,
1443
1443
  isDown: !1
1444
- }), c = s ? wr(s.props?.shaderSource) : "", u = s ? Ue(s.props?.fps) ?? 60 : 60, y = s?.props?.uniforms, g = W(() => Er(y), [y]), b = s?.props?.channels, w = W(() => vr(b), [b]), v = s ? Sr(s.props?.enableMouse) ?? !0 : !0, E = s ? Ue(s.props?.width) : void 0, T = s ? Ue(s.props?.height) : void 0, M = s ? br(yr(s.props?.className), o) : o;
1445
- _(() => {
1446
- const I = i.current;
1447
- if (I) {
1444
+ }), c = s ? Cr(s.props?.shaderSource) : "", d = s ? Fe(s.props?.fps) ?? 60 : 60, m = s?.props?.uniforms, g = W(() => Ir(m), [m]), b = s?.props?.channels, w = W(() => Or(b), [b]), R = s ? _r(s.props?.enableMouse) ?? !0 : !0, E = s ? Fe(s.props?.width) : void 0, T = s ? Fe(s.props?.height) : void 0, M = s ? kr(Tr(s.props?.className), o) : o;
1445
+ C(() => {
1446
+ const _ = i.current;
1447
+ if (_) {
1448
1448
  try {
1449
- const x = new gr(I);
1450
- a.current = x;
1451
- } catch (x) {
1452
- console.error("[ShadertoyRenderer] Failed to create WebGL2 context:", x);
1449
+ const L = new Ar(_);
1450
+ a.current = L;
1451
+ } catch (L) {
1452
+ console.error("[ShadertoyRenderer] Failed to create WebGL2 context:", L);
1453
1453
  }
1454
1454
  return () => {
1455
1455
  a.current && (a.current.destroy(), a.current = null);
1456
1456
  };
1457
1457
  }
1458
- }, []), _(() => {
1459
- const I = a.current;
1460
- if (!(!I || !c) && h.current !== c)
1461
- if (I.compile(c, g))
1462
- h.current = c, p.current = g;
1458
+ }, []), C(() => {
1459
+ const _ = a.current;
1460
+ if (!(!_ || !c) && p.current !== c)
1461
+ if (_.compile(c, g))
1462
+ p.current = c, y.current = g;
1463
1463
  else {
1464
- const $ = I.getError();
1465
- console.error("[ShadertoyRenderer] Shader compilation failed:", $);
1464
+ const U = _.getError();
1465
+ console.error("[ShadertoyRenderer] Shader compilation failed:", U);
1466
1466
  }
1467
- }, [c, g]), _(() => {
1468
- const I = a.current;
1469
- !I || !h.current || Rr(p.current, g) || (I.setCustomUniforms(g), p.current = g);
1470
- }, [g]), _(() => {
1471
- const I = a.current;
1472
- I && I.setChannels(w);
1473
- }, [w]), _(() => {
1474
- const I = a.current;
1475
- if (!I || !h.current) return;
1476
- const x = 1e3 / u, $ = (V) => {
1477
- const B = V - d.current;
1478
- B >= x && (d.current = V - B % x, I.draw()), l.current = requestAnimationFrame($);
1467
+ }, [c, g]), C(() => {
1468
+ const _ = a.current;
1469
+ !_ || !p.current || Nr(y.current, g) || (_.setCustomUniforms(g), y.current = g);
1470
+ }, [g]), C(() => {
1471
+ const _ = a.current;
1472
+ _ && _.setChannels(w);
1473
+ }, [w]), C(() => {
1474
+ const _ = a.current;
1475
+ if (!_ || !p.current) return;
1476
+ const L = 1e3 / d, U = (F) => {
1477
+ const B = F - f.current;
1478
+ B >= L && (f.current = F - B % L, _.draw()), l.current = requestAnimationFrame(U);
1479
1479
  };
1480
- return l.current = requestAnimationFrame($), () => {
1480
+ return l.current = requestAnimationFrame(U), () => {
1481
1481
  l.current !== null && (cancelAnimationFrame(l.current), l.current = null);
1482
1482
  };
1483
- }, [u]);
1484
- const Q = D(
1485
- (I) => {
1486
- if (!v) return;
1487
- const x = i.current, $ = a.current;
1488
- if (!x || !$) return;
1489
- const V = window.devicePixelRatio || 1, B = x.getBoundingClientRect(), K = (I.clientX - B.left) * V, G = (B.height - (I.clientY - B.top)) * V;
1490
- m.current.x = K, m.current.y = G, $.setMouse(K, G, m.current.clickX, m.current.clickY);
1483
+ }, [d]);
1484
+ const J = D(
1485
+ (_) => {
1486
+ if (!R) return;
1487
+ const L = i.current, U = a.current;
1488
+ if (!L || !U) return;
1489
+ const F = window.devicePixelRatio || 1, B = L.getBoundingClientRect(), $ = (_.clientX - B.left) * F, K = (B.height - (_.clientY - B.top)) * F;
1490
+ u.current.x = $, u.current.y = K, U.setMouse($, K, u.current.clickX, u.current.clickY);
1491
1491
  },
1492
- [v]
1493
- ), re = D(
1494
- (I) => {
1495
- if (!v) return;
1496
- const x = i.current, $ = a.current;
1497
- if (!x || !$) return;
1498
- const V = window.devicePixelRatio || 1, B = x.getBoundingClientRect(), K = (I.clientX - B.left) * V, G = (B.height - (I.clientY - B.top)) * V;
1499
- m.current.isDown = !0, m.current.clickX = K, m.current.clickY = G, $.setMouse(K, G, K, G);
1492
+ [R]
1493
+ ), Q = D(
1494
+ (_) => {
1495
+ if (!R) return;
1496
+ const L = i.current, U = a.current;
1497
+ if (!L || !U) return;
1498
+ const F = window.devicePixelRatio || 1, B = L.getBoundingClientRect(), $ = (_.clientX - B.left) * F, K = (B.height - (_.clientY - B.top)) * F;
1499
+ u.current.isDown = !0, u.current.clickX = $, u.current.clickY = K, U.setMouse($, K, $, K);
1500
1500
  },
1501
- [v]
1502
- ), q = D(() => {
1503
- v && (m.current.isDown = !1, m.current.clickX = -Math.abs(m.current.clickX));
1504
- }, [v]);
1501
+ [R]
1502
+ ), X = D(() => {
1503
+ R && (u.current.isDown = !1, u.current.clickX = -Math.abs(u.current.clickX));
1504
+ }, [R]);
1505
1505
  return s ? /* @__PURE__ */ S.jsx(
1506
1506
  "canvas",
1507
1507
  {
@@ -1511,24 +1511,24 @@ function Tr() {
1511
1511
  className: M,
1512
1512
  ...E ? { width: E } : {},
1513
1513
  ...T ? { height: T } : {},
1514
- onMouseMove: Q,
1515
- onMouseDown: re,
1516
- onMouseUp: q,
1517
- onMouseLeave: q
1514
+ onMouseMove: J,
1515
+ onMouseDown: Q,
1516
+ onMouseUp: X,
1517
+ onMouseLeave: X
1518
1518
  }
1519
1519
  ) : null;
1520
1520
  });
1521
1521
  return ({ type: e }) => {
1522
- if (e === Ar)
1522
+ if (e === xr)
1523
1523
  return t;
1524
1524
  };
1525
1525
  }
1526
- const kr = "shadertoy", Cr = async () => Tr();
1527
- function _r(t) {
1528
- t.registerModule(kr, Cr);
1526
+ const Lr = "shadertoy", Mr = async () => Pr();
1527
+ function Ur(t) {
1528
+ t.registerModule(Lr, Mr);
1529
1529
  }
1530
- const dt = ne("UIRegistry");
1531
- class Ir {
1530
+ const yt = se("UIRegistry");
1531
+ class jr {
1532
1532
  baseResolvers = [];
1533
1533
  moduleLoaders = /* @__PURE__ */ new Map();
1534
1534
  moduleResolvers = /* @__PURE__ */ new Map();
@@ -1550,15 +1550,15 @@ class Ir {
1550
1550
  for (const [r, o] of this.moduleLoaders.entries())
1551
1551
  if (!this.moduleResolvers.has(r))
1552
1552
  try {
1553
- const s = await o(), i = xr(s);
1553
+ const s = await o(), i = Br(s);
1554
1554
  this.moduleResolvers.set(r, i), e = !0;
1555
1555
  } catch (s) {
1556
- dt.error(`[IkonUiRegistry] Failed to load module '${r}'.`, s);
1556
+ yt.error(`[IkonUiRegistry] Failed to load module '${r}'.`, s);
1557
1557
  }
1558
1558
  const n = [];
1559
1559
  for (const r of this.moduleLoaders.keys())
1560
1560
  this.moduleResolvers.has(r) && n.push(r);
1561
- return Pr(n, this.activeModuleOrder) || (this.activeModuleOrder = n, e = !0), e;
1561
+ return Fr(n, this.activeModuleOrder) || (this.activeModuleOrder = n, e = !0), e;
1562
1562
  }
1563
1563
  resolve(e) {
1564
1564
  for (const n of this.baseResolvers) {
@@ -1568,7 +1568,7 @@ class Ir {
1568
1568
  for (const n of this.activeModuleOrder) {
1569
1569
  const r = this.moduleResolvers.get(n);
1570
1570
  if (!r) {
1571
- dt.warn(`Missing resolvers for module ${n}`);
1571
+ yt.warn(`Missing resolvers for module ${n}`);
1572
1572
  continue;
1573
1573
  }
1574
1574
  for (const o of r) {
@@ -1578,17 +1578,17 @@ class Ir {
1578
1578
  }
1579
1579
  }
1580
1580
  }
1581
- function Or() {
1582
- const t = new Ir();
1583
- return er(t), fr(t), _r(t), t.loadRegisteredModules(), t;
1581
+ function Dr() {
1582
+ const t = new jr();
1583
+ return cr(t), Sr(t), Ur(t), t.loadRegisteredModules(), t;
1584
1584
  }
1585
- function Nr(t) {
1585
+ function $r(t) {
1586
1586
  return Array.isArray(t) ? t : [t];
1587
1587
  }
1588
- function xr(t) {
1589
- return t ? Nr(t).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
1588
+ function Br(t) {
1589
+ return t ? $r(t).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
1590
1590
  }
1591
- function Pr(t, e) {
1591
+ function Fr(t, e) {
1592
1592
  if (t.length !== e.length)
1593
1593
  return !1;
1594
1594
  for (let n = 0; n < t.length; n += 1)
@@ -1596,9 +1596,9 @@ function Pr(t, e) {
1596
1596
  return !1;
1597
1597
  return !0;
1598
1598
  }
1599
- function Is({ mount: t, stores: e, registry: n, client: r, onAction: o }) {
1599
+ function js({ mount: t, stores: e, registry: n, client: r, onAction: o }) {
1600
1600
  return /* @__PURE__ */ S.jsx(
1601
- Nt,
1601
+ jt,
1602
1602
  {
1603
1603
  stores: e,
1604
1604
  registry: n,
@@ -1608,7 +1608,7 @@ function Is({ mount: t, stores: e, registry: n, client: r, onAction: o }) {
1608
1608
  }
1609
1609
  );
1610
1610
  }
1611
- const je = ne("MotionController"), ft = {
1611
+ const Ve = se("MotionController"), bt = {
1612
1612
  ease: [0.25, 0.1, 0.25, 1],
1613
1613
  "ease-in": [0.42, 0, 1, 1],
1614
1614
  "ease-out": [0, 0, 0.58, 1],
@@ -1638,88 +1638,88 @@ const je = ne("MotionController"), ft = {
1638
1638
  "ease-out-back": [0.175, 0.885, 0.32, 1.275],
1639
1639
  "ease-in-out-back": [0.68, -0.55, 0.265, 1.55]
1640
1640
  };
1641
- function F(t) {
1641
+ function V(t) {
1642
1642
  return t <= 0 ? 0 : t >= 1 ? 1 : t;
1643
1643
  }
1644
- function ht(t) {
1644
+ function wt(t) {
1645
1645
  if (t == null) return;
1646
1646
  const e = `${t}`.trim();
1647
1647
  if (!e) return;
1648
1648
  const n = Number.parseFloat(e);
1649
1649
  return Number.isFinite(n) ? n : void 0;
1650
1650
  }
1651
- function pt(t) {
1651
+ function St(t) {
1652
1652
  return typeof CSS < "u" && CSS.escape ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
1653
1653
  }
1654
- function mt(t, e, n, r) {
1655
- const h = new Float32Array(11);
1656
- function p(g, b, w) {
1654
+ function Et(t, e, n, r) {
1655
+ const p = new Float32Array(11);
1656
+ function y(g, b, w) {
1657
1657
  return ((3 * b - 3 * w + 1) * g + (3 * w - 6 * b)) * g * g + 3 * b * g;
1658
1658
  }
1659
- function m(g, b, w) {
1659
+ function u(g, b, w) {
1660
1660
  return 3 * (3 * b - 3 * w + 1) * g * g + 2 * (3 * w - 6 * b) * g + 3 * b;
1661
1661
  }
1662
1662
  function c(g, b) {
1663
1663
  for (let w = 0; w < 4; w += 1) {
1664
- const v = m(b, t, n);
1665
- if (v === 0)
1664
+ const R = u(b, t, n);
1665
+ if (R === 0)
1666
1666
  return b;
1667
- const E = p(b, t, n) - g;
1668
- b -= E / v;
1667
+ const E = y(b, t, n) - g;
1668
+ b -= E / R;
1669
1669
  }
1670
1670
  return b;
1671
1671
  }
1672
- function u(g, b, w) {
1673
- let v = 0, E = 0, T = 0;
1672
+ function d(g, b, w) {
1673
+ let R = 0, E = 0, T = 0;
1674
1674
  do
1675
- E = b + (w - b) / 2, v = p(E, t, n) - g, v > 0 ? w = E : b = E;
1676
- while (Math.abs(v) > 1e-7 && ++T < 10);
1675
+ E = b + (w - b) / 2, R = y(E, t, n) - g, R > 0 ? w = E : b = E;
1676
+ while (Math.abs(R) > 1e-7 && ++T < 10);
1677
1677
  return E;
1678
1678
  }
1679
- function y(g) {
1679
+ function m(g) {
1680
1680
  let b = 0, w = 1;
1681
- const v = 10;
1682
- for (; w !== v && h[w] <= g; w += 1)
1681
+ const R = 10;
1682
+ for (; w !== R && p[w] <= g; w += 1)
1683
1683
  b += 0.1;
1684
1684
  w -= 1;
1685
- const E = (g - h[w]) / (h[w + 1] - h[w]), T = b + E * 0.1, M = m(T, t, n);
1686
- return M >= 1e-3 ? c(g, T) : M === 0 ? T : u(g, b, b + 0.1);
1685
+ const E = (g - p[w]) / (p[w + 1] - p[w]), T = b + E * 0.1, M = u(T, t, n);
1686
+ return M >= 1e-3 ? c(g, T) : M === 0 ? T : d(g, b, b + 0.1);
1687
1687
  }
1688
1688
  for (let g = 0; g < 11; g += 1)
1689
- h[g] = p(g * 0.1, t, n);
1690
- return (g) => g <= 0 ? 0 : g >= 1 ? 1 : p(y(g), e, r);
1689
+ p[g] = y(g * 0.1, t, n);
1690
+ return (g) => g <= 0 ? 0 : g >= 1 ? 1 : y(m(g), e, r);
1691
1691
  }
1692
- function Lr(t) {
1692
+ function Vr(t) {
1693
1693
  const e = /steps\(\s*([0-9]+)\s*(?:,\s*([a-z-]+)\s*)?\)/i.exec(t);
1694
1694
  if (!e)
1695
- return (o) => F(o);
1695
+ return (o) => V(o);
1696
1696
  const n = Math.max(1, parseInt(e[1], 10)), r = (e[2] ?? "end").toLowerCase();
1697
- 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);
1697
+ return r === "start" || r === "jump-start" ? (o) => V(Math.ceil(o * n) / n) : r === "none" || r === "jump-none" ? (o) => V(Math.round(o * n) / n) : r === "both" || r === "jump-both" ? (o) => V((Math.floor(o * n) + 0.5) / n) : (o) => V(Math.floor(o * n) / n);
1698
1698
  }
1699
- function Mr(t) {
1699
+ function Wr(t) {
1700
1700
  if (!t)
1701
- return (n) => F(n);
1701
+ return (n) => V(n);
1702
1702
  const e = t.trim().toLowerCase();
1703
1703
  if (!e || e === "linear")
1704
- return (n) => F(n);
1705
- if (ft[e]) {
1706
- const [n, r, o, s] = ft[e], i = mt(n, r, o, s);
1707
- return (a) => F(i(F(a)));
1704
+ return (n) => V(n);
1705
+ if (bt[e]) {
1706
+ const [n, r, o, s] = bt[e], i = Et(n, r, o, s);
1707
+ return (a) => V(i(V(a)));
1708
1708
  }
1709
1709
  if (e.startsWith("cubic-bezier(") && e.endsWith(")")) {
1710
1710
  const r = e.slice(13, -1).split(",").map((o) => Number.parseFloat(o.trim()));
1711
1711
  if (r.length === 4 && r.every((o) => Number.isFinite(o))) {
1712
- const [o, s, i, a] = r, l = mt(o, s, i, a);
1713
- return (d) => F(l(F(d)));
1712
+ const [o, s, i, a] = r, l = Et(o, s, i, a);
1713
+ return (f) => V(l(V(f)));
1714
1714
  }
1715
1715
  }
1716
1716
  if (e.startsWith("steps(") && e.endsWith(")")) {
1717
- const n = Lr(e);
1718
- return (r) => n(F(r));
1717
+ const n = Vr(e);
1718
+ return (r) => n(V(r));
1719
1719
  }
1720
- return (n) => F(n);
1720
+ return (n) => V(n);
1721
1721
  }
1722
- function Ur(t) {
1722
+ function Kr(t) {
1723
1723
  if (!t)
1724
1724
  return;
1725
1725
  const e = /(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)\s*->\s*(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)/.exec(t);
@@ -1729,7 +1729,7 @@ function Ur(t) {
1729
1729
  if (![n, r, o, s].some((i) => !Number.isFinite(i)))
1730
1730
  return { inStart: n, inEnd: r, outStart: o, outEnd: s };
1731
1731
  }
1732
- class jr {
1732
+ class Gr {
1733
1733
  bindingsByStyle = /* @__PURE__ */ new Map();
1734
1734
  observer;
1735
1735
  observeScheduled = !1;
@@ -1756,7 +1756,7 @@ class jr {
1756
1756
  try {
1757
1757
  e();
1758
1758
  } catch (n) {
1759
- je.warn("Failed to cleanup binding listener", n);
1759
+ Ve.warn("Failed to cleanup binding listener", n);
1760
1760
  }
1761
1761
  this.globalCleanups.clear(), this.elementStates.clear(), this.styleToElements.clear(), this.bindingsByStyle.clear(), this.pendingScanStyles.clear(), this.scanScheduled = !1, this.observer && (this.observer.disconnect(), this.observer = void 0);
1762
1762
  }
@@ -1766,7 +1766,7 @@ class jr {
1766
1766
  const r = (JSON.parse(e).motionBindings ?? []).map((o) => this.parseBinding(o)).filter((o) => o !== void 0);
1767
1767
  return r.length === 0 ? void 0 : { bindings: r };
1768
1768
  } catch (n) {
1769
- je.warn("Failed to parse motion metadata", n);
1769
+ Ve.warn("Failed to parse motion metadata", n);
1770
1770
  return;
1771
1771
  }
1772
1772
  }
@@ -1774,7 +1774,7 @@ class jr {
1774
1774
  const n = e.source?.trim();
1775
1775
  if (!n)
1776
1776
  return;
1777
- const r = ht(e.min) ?? 0, o = ht(e.max), s = o === void 0 ? r + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, l = Mr(e.ease), d = Ur(e.map), h = e.targetId?.trim() || void 0;
1777
+ const r = wt(e.min) ?? 0, o = wt(e.max), s = o === void 0 ? r + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, l = Wr(e.ease), f = Kr(e.map), p = e.targetId?.trim() || void 0;
1778
1778
  return Number.isNaN(r) || Number.isNaN(s) ? void 0 : {
1779
1779
  source: n.toLowerCase(),
1780
1780
  min: r,
@@ -1782,8 +1782,8 @@ class jr {
1782
1782
  clamp: i === "freeze-start" || i === "freeze-end" || i === "unclamped" ? i : "clamp",
1783
1783
  reverse: a,
1784
1784
  ease: l,
1785
- map: d,
1786
- targetId: h
1785
+ map: f,
1786
+ targetId: p
1787
1787
  };
1788
1788
  }
1789
1789
  ensureObserver() {
@@ -1832,7 +1832,7 @@ class jr {
1832
1832
  const n = this.bindingsByStyle.get(e);
1833
1833
  if (!n || typeof document > "u")
1834
1834
  return;
1835
- const r = `.${pt(e)}`;
1835
+ const r = `.${St(e)}`;
1836
1836
  document.querySelectorAll(r).forEach((s) => this.applyStyleToElement(s, e, n));
1837
1837
  }
1838
1838
  applyStyleToElement(e, n, r) {
@@ -1872,7 +1872,7 @@ class jr {
1872
1872
  }
1873
1873
  resolveScrollContainer(e, n) {
1874
1874
  if (n.targetId) {
1875
- const r = `[data-ikon-motion-source="${pt(n.targetId)}"]`, o = typeof document < "u" ? document.querySelector(r) : null;
1875
+ const r = `[data-ikon-motion-source="${St(n.targetId)}"]`, o = typeof document < "u" ? document.querySelector(r) : null;
1876
1876
  if (o)
1877
1877
  return o;
1878
1878
  }
@@ -1882,10 +1882,10 @@ class jr {
1882
1882
  const o = n.max - n.min, s = o === 0 ? r > n.min ? 1 : 0 : (r - n.min) / o;
1883
1883
  let i = this.applyClamp(s, n.clamp);
1884
1884
  n.reverse && (i = 1 - i);
1885
- const a = n.ease(i), l = Number.isFinite(a) ? a : 0, d = l * 100;
1886
- if (e.style.setProperty("--tw-motion-bind-source-value", `${r}`), e.style.setProperty("--tw-motion-bind-progress-ratio", `${l}`), e.style.setProperty("--tw-motion-bind-progress", `${d}`), n.map) {
1887
- const h = this.applyMap(d, n.map);
1888
- h !== void 0 && e.style.setProperty("--tw-motion-bind-value", `${h}`);
1885
+ const a = n.ease(i), l = Number.isFinite(a) ? a : 0, f = l * 100;
1886
+ if (e.style.setProperty("--tw-motion-bind-source-value", `${r}`), e.style.setProperty("--tw-motion-bind-progress-ratio", `${l}`), e.style.setProperty("--tw-motion-bind-progress", `${f}`), n.map) {
1887
+ const p = this.applyMap(f, n.map);
1888
+ p !== void 0 && e.style.setProperty("--tw-motion-bind-value", `${p}`);
1889
1889
  } else
1890
1890
  e.style.removeProperty("--tw-motion-bind-value");
1891
1891
  }
@@ -1900,7 +1900,7 @@ class jr {
1900
1900
  case "unclamped":
1901
1901
  return e;
1902
1902
  default:
1903
- return F(e);
1903
+ return V(e);
1904
1904
  }
1905
1905
  }
1906
1906
  applyMap(e, n) {
@@ -1942,7 +1942,7 @@ class jr {
1942
1942
  try {
1943
1943
  i();
1944
1944
  } catch (a) {
1945
- je.warn("Failed to cleanup listener", a);
1945
+ Ve.warn("Failed to cleanup listener", a);
1946
1946
  }
1947
1947
  this.globalCleanups.delete(i);
1948
1948
  }
@@ -1987,21 +1987,21 @@ class jr {
1987
1987
  }
1988
1988
  }
1989
1989
  }
1990
- const De = new jr();
1991
- function Dr(t) {
1992
- const e = A(/* @__PURE__ */ new Map()), n = D(({ styleId: s, css: i, common: a }) => {
1990
+ const We = new Gr();
1991
+ function Yr(t) {
1992
+ const e = v(/* @__PURE__ */ new Map()), n = D(({ styleId: s, css: i, common: a }) => {
1993
1993
  if (!(!s || typeof document > "u")) {
1994
1994
  if (i) {
1995
1995
  let l = e.current.get(s);
1996
1996
  l || (l = document.createElement("style"), l.setAttribute("data-ikon-style-id", s), document.head.appendChild(l), e.current.set(s, l)), l.textContent = i;
1997
1997
  }
1998
- De.registerStyle(s, a);
1998
+ We.registerStyle(s, a);
1999
1999
  }
2000
2000
  }, []), r = D((s) => {
2001
2001
  if (!(typeof document > "u"))
2002
2002
  for (const i of s) {
2003
2003
  const a = e.current.get(i);
2004
- a && (a.remove(), e.current.delete(i)), De.unregisterStyle(i);
2004
+ a && (a.remove(), e.current.delete(i)), We.unregisterStyle(i);
2005
2005
  }
2006
2006
  }, []), o = D(() => {
2007
2007
  if (typeof document < "u") {
@@ -2009,9 +2009,9 @@ function Dr(t) {
2009
2009
  s.remove();
2010
2010
  e.current.clear();
2011
2011
  }
2012
- De.reset();
2012
+ We.reset();
2013
2013
  }, []);
2014
- return _(() => {
2014
+ return C(() => {
2015
2015
  if (!t) return;
2016
2016
  for (const a of t.getUiStyles())
2017
2017
  n(a);
@@ -2019,9 +2019,9 @@ function Dr(t) {
2019
2019
  return () => {
2020
2020
  s?.(), i?.(), o();
2021
2021
  };
2022
- }, [t, o, n, r]), _(() => () => o(), [o]), { setStyle: n, deleteStyles: r, reset: o };
2022
+ }, [t, o, n, r]), C(() => () => o(), [o]), { setStyle: n, deleteStyles: r, reset: o };
2023
2023
  }
2024
- function $r(t) {
2024
+ function zr(t) {
2025
2025
  const e = [];
2026
2026
  for (const [n, r] of t) {
2027
2027
  const o = r.store.getSnapshot(), s = o.rootViewId && o.views.has(o.rootViewId);
@@ -2029,62 +2029,62 @@ function $r(t) {
2029
2029
  }
2030
2030
  return e.sort(), e.join(",");
2031
2031
  }
2032
- function Br(t) {
2033
- const [e, n] = N(), r = A("");
2034
- return _(() => {
2032
+ function Xr(t) {
2033
+ const [e, n] = x(), r = v("");
2034
+ return C(() => {
2035
2035
  if (!t) {
2036
2036
  n(void 0), r.current = "";
2037
2037
  return;
2038
2038
  }
2039
2039
  const o = () => {
2040
- const s = t.getStores(), i = $r(s);
2040
+ const s = t.getStores(), i = zr(s);
2041
2041
  i !== r.current && (r.current = i, n(s));
2042
2042
  };
2043
2043
  return o(), t.subscribe(o);
2044
2044
  }, [t]), e;
2045
2045
  }
2046
- var Fr = typeof global == "object" && global && global.Object === Object && global, Vr = typeof self == "object" && self && self.Object === Object && self, Wr = Fr || Vr || Function("return this")(), Ie = Wr.Symbol, jt = Object.prototype, Kr = jt.hasOwnProperty, Gr = jt.toString, pe = Ie ? Ie.toStringTag : void 0;
2047
- function Yr(t) {
2048
- var e = Kr.call(t, pe), n = t[pe];
2046
+ var Hr = typeof global == "object" && global && global.Object === Object && global, qr = typeof self == "object" && self && self.Object === Object && self, Jr = Hr || qr || Function("return this")(), Ne = Jr.Symbol, Wt = Object.prototype, Zr = Wt.hasOwnProperty, Qr = Wt.toString, ye = Ne ? Ne.toStringTag : void 0;
2047
+ function eo(t) {
2048
+ var e = Zr.call(t, ye), n = t[ye];
2049
2049
  try {
2050
- t[pe] = void 0;
2050
+ t[ye] = void 0;
2051
2051
  var r = !0;
2052
2052
  } catch {
2053
2053
  }
2054
- var o = Gr.call(t);
2055
- return r && (e ? t[pe] = n : delete t[pe]), o;
2054
+ var o = Qr.call(t);
2055
+ return r && (e ? t[ye] = n : delete t[ye]), o;
2056
2056
  }
2057
- var zr = Object.prototype, Xr = zr.toString;
2058
- function Hr(t) {
2059
- return Xr.call(t);
2057
+ var to = Object.prototype, no = to.toString;
2058
+ function ro(t) {
2059
+ return no.call(t);
2060
2060
  }
2061
- var qr = "[object Null]", Jr = "[object Undefined]", gt = Ie ? Ie.toStringTag : void 0;
2062
- function Zr(t) {
2063
- return t == null ? t === void 0 ? Jr : qr : gt && gt in Object(t) ? Yr(t) : Hr(t);
2061
+ var oo = "[object Null]", so = "[object Undefined]", vt = Ne ? Ne.toStringTag : void 0;
2062
+ function io(t) {
2063
+ return t == null ? t === void 0 ? so : oo : vt && vt in Object(t) ? eo(t) : ro(t);
2064
2064
  }
2065
- function Qr(t) {
2065
+ function ao(t) {
2066
2066
  return t != null && typeof t == "object";
2067
2067
  }
2068
- var eo = Array.isArray, to = "[object String]";
2069
- function no(t) {
2070
- return typeof t == "string" || !eo(t) && Qr(t) && Zr(t) == to;
2068
+ var co = Array.isArray, lo = "[object String]";
2069
+ function uo(t) {
2070
+ return typeof t == "string" || !co(t) && ao(t) && io(t) == lo;
2071
2071
  }
2072
- const yt = "ikonUiModules";
2073
- function Xe(t) {
2072
+ const Rt = "ikonUiModules";
2073
+ function Qe(t) {
2074
2074
  return typeof t == "object" && t !== null && !Array.isArray(t);
2075
2075
  }
2076
- function ro(t) {
2076
+ function fo(t) {
2077
2077
  if (!Array.isArray(t))
2078
2078
  return;
2079
2079
  const e = /* @__PURE__ */ new Set();
2080
2080
  for (const n of t) {
2081
- if (!no(n)) continue;
2081
+ if (!uo(n)) continue;
2082
2082
  const r = n.trim();
2083
2083
  r && (e.has(r) || e.add(r));
2084
2084
  }
2085
2085
  return Array.from(e);
2086
2086
  }
2087
- function Os(t, e) {
2087
+ function Ds(t, e) {
2088
2088
  if (t === e)
2089
2089
  return !0;
2090
2090
  if (!t || !e)
@@ -2096,19 +2096,19 @@ function Os(t, e) {
2096
2096
  return !1;
2097
2097
  return !0;
2098
2098
  }
2099
- function oo(t) {
2100
- if (!(!Xe(t) || !Object.prototype.hasOwnProperty.call(t, yt)))
2101
- return ro(t[yt]);
2099
+ function ho(t) {
2100
+ if (!(!Qe(t) || !Object.prototype.hasOwnProperty.call(t, Rt)))
2101
+ return fo(t[Rt]);
2102
2102
  }
2103
- function Ns(...t) {
2103
+ function $s(...t) {
2104
2104
  for (const e of t) {
2105
- const n = oo(e);
2105
+ const n = ho(e);
2106
2106
  if (n !== void 0)
2107
2107
  return n;
2108
2108
  }
2109
2109
  }
2110
- function xs(t) {
2111
- if (!Xe(t))
2110
+ function Bs(t) {
2111
+ if (!Qe(t))
2112
2112
  return;
2113
2113
  const e = t, n = Object.keys(e).find((l) => l.toLowerCase() === "modules");
2114
2114
  if (!n)
@@ -2121,31 +2121,31 @@ function xs(t) {
2121
2121
  const o = [], s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set();
2122
2122
  for (const l of r) {
2123
2123
  if (typeof l == "string") {
2124
- const y = l.trim();
2125
- if (!y || i.has(y))
2124
+ const m = l.trim();
2125
+ if (!m || i.has(m))
2126
2126
  continue;
2127
- o.push(y), i.add(y);
2127
+ o.push(m), i.add(m);
2128
2128
  continue;
2129
2129
  }
2130
- if (!Xe(l))
2130
+ if (!Qe(l))
2131
2131
  continue;
2132
- const d = l, h = Object.keys(d).find((y) => y.toLowerCase() === "name");
2133
- if (!h)
2132
+ const f = l, p = Object.keys(f).find((m) => m.toLowerCase() === "name");
2133
+ if (!p)
2134
2134
  continue;
2135
- const p = d[h];
2136
- if (typeof p != "string")
2135
+ const y = f[p];
2136
+ if (typeof y != "string")
2137
2137
  continue;
2138
- const m = p.trim();
2139
- if (!m)
2138
+ const u = y.trim();
2139
+ if (!u)
2140
2140
  continue;
2141
- const c = Object.keys(d).find((y) => y.toLowerCase() === "javascript"), u = c ? d[c] : void 0;
2142
- typeof u == "string" && s.set(m, u), i.has(m) || (o.push(m), i.add(m));
2141
+ const c = Object.keys(f).find((m) => m.toLowerCase() === "javascript"), d = c ? f[c] : void 0;
2142
+ typeof d == "string" && s.set(u, d), i.has(u) || (o.push(u), i.add(u));
2143
2143
  }
2144
2144
  if (!o.length && s.size === 0)
2145
2145
  return { modules: [] };
2146
- const a = Array.from(s.entries()).map(([l, d]) => ({
2146
+ const a = Array.from(s.entries()).map(([l, f]) => ({
2147
2147
  name: l,
2148
- javascript: d
2148
+ javascript: f
2149
2149
  }));
2150
2150
  return a.length > 0 ? { modules: o, inlineModules: a } : { modules: o };
2151
2151
  }
@@ -2156,7 +2156,7 @@ const k = {
2156
2156
  Line: 4,
2157
2157
  Paragraph: 8,
2158
2158
  Emoji: 16
2159
- }, so = [
2159
+ }, po = [
2160
2160
  {
2161
2161
  flag: k.Letter,
2162
2162
  hints: [
@@ -2205,42 +2205,42 @@ const k = {
2205
2205
  "[data-emoji]"
2206
2206
  ]
2207
2207
  }
2208
- ], He = k.Letter | k.Word | k.Line | k.Paragraph | k.Emoji, io = k.Letter | k.Word | k.Line | k.Paragraph, bt = /* @__PURE__ */ new Map(), ao = 16384;
2209
- function Ps(t, e) {
2210
- if (!t || t.length > ao)
2208
+ ], et = k.Letter | k.Word | k.Line | k.Paragraph | k.Emoji, mo = k.Letter | k.Word | k.Line | k.Paragraph, At = /* @__PURE__ */ new Map(), go = 16384;
2209
+ function Fs(t, e) {
2210
+ if (!t || t.length > go)
2211
2211
  return t;
2212
- const n = To(e), r = ce(n, k.Emoji), o = n & io;
2212
+ const n = Po(e), r = ue(n, k.Emoji), o = n & mo;
2213
2213
  if (o === k.None && !r)
2214
2214
  return t;
2215
2215
  const s = t.replace(/\r\n/g, `
2216
2216
  `).replace(/\r/g, `
2217
2217
  `);
2218
2218
  if (o === k.None)
2219
- return vt(s);
2220
- const i = Ro(s);
2219
+ return _t(s);
2220
+ const i = No(s);
2221
2221
  if (i.length === 0)
2222
- return r ? vt(s) : t;
2223
- const a = Ao(i), l = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, d = [];
2224
- for (const h of a) {
2225
- const p = co(h, n, l);
2226
- d.push(...p);
2222
+ return r ? _t(s) : t;
2223
+ const a = xo(i), l = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, f = [];
2224
+ for (const p of a) {
2225
+ const y = yo(p, n, l);
2226
+ f.push(...y);
2227
2227
  }
2228
- return d;
2228
+ return f;
2229
2229
  }
2230
- function co(t, e, n) {
2230
+ function yo(t, e, n) {
2231
2231
  const r = [];
2232
2232
  for (const o of t) {
2233
- const s = lo(o, e, n);
2233
+ const s = bo(o, e, n);
2234
2234
  r.push(...s);
2235
2235
  }
2236
- if (ce(e, k.Paragraph)) {
2236
+ if (ue(e, k.Paragraph)) {
2237
2237
  const o = n.paragraph++;
2238
2238
  return [
2239
2239
  /* @__PURE__ */ S.jsx(
2240
2240
  "span",
2241
2241
  {
2242
2242
  "data-motion-paragraph": !0,
2243
- style: xe(o),
2243
+ style: Le(o),
2244
2244
  children: r
2245
2245
  },
2246
2246
  `motion-paragraph-${o}`
@@ -2249,12 +2249,12 @@ function co(t, e, n) {
2249
2249
  }
2250
2250
  return r;
2251
2251
  }
2252
- function lo(t, e, n) {
2253
- const r = uo(t.text, e, n), o = [];
2254
- if (ce(e, k.Line)) {
2252
+ function bo(t, e, n) {
2253
+ const r = wo(t.text, e, n), o = [];
2254
+ if (ue(e, k.Line)) {
2255
2255
  const s = n.line++;
2256
2256
  o.push(
2257
- /* @__PURE__ */ S.jsx("span", { "data-motion-line": !0, style: xe(s), children: r }, `motion-line-${s}`)
2257
+ /* @__PURE__ */ S.jsx("span", { "data-motion-line": !0, style: Le(s), children: r }, `motion-line-${s}`)
2258
2258
  );
2259
2259
  } else
2260
2260
  o.push(...r);
@@ -2262,103 +2262,103 @@ function lo(t, e, n) {
2262
2262
  o.push(/* @__PURE__ */ S.jsx("br", {}, `motion-break-${n.br++}`));
2263
2263
  return o;
2264
2264
  }
2265
- function uo(t, e, n) {
2265
+ function wo(t, e, n) {
2266
2266
  if (!t)
2267
2267
  return [];
2268
- const r = ce(e, k.Word), o = [], s = /(\s+)/g;
2268
+ const r = ue(e, k.Word), o = [], s = /(\s+)/g;
2269
2269
  let i = 0, a;
2270
2270
  for (; (a = s.exec(t)) !== null; ) {
2271
2271
  if (a.index > i) {
2272
2272
  const l = t.slice(i, a.index);
2273
- o.push(wt(l, n, e, r));
2273
+ o.push(Tt(l, n, e, r));
2274
2274
  }
2275
2275
  o.push(a[0]), i = a.index + a[0].length;
2276
2276
  }
2277
2277
  if (i < t.length) {
2278
2278
  const l = t.slice(i);
2279
- o.push(wt(l, n, e, r));
2279
+ o.push(Tt(l, n, e, r));
2280
2280
  }
2281
2281
  return o;
2282
2282
  }
2283
- function wt(t, e, n, r) {
2284
- const o = e.word++, s = ho(t, n, e), i = `motion-word-${o}`, a = fo(o, r);
2283
+ function Tt(t, e, n, r) {
2284
+ const o = e.word++, s = Eo(t, n, e), i = `motion-word-${o}`, a = So(o, r);
2285
2285
  return r ? /* @__PURE__ */ S.jsx("span", { "data-motion-word": !0, style: a, children: s }, i) : /* @__PURE__ */ S.jsx("span", { style: a, children: s }, i);
2286
2286
  }
2287
- function fo(t, e) {
2288
- return e ? { ...xe(t), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
2287
+ function So(t, e) {
2288
+ return e ? { ...Le(t), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
2289
2289
  }
2290
- function ho(t, e, n) {
2290
+ function Eo(t, e, n) {
2291
2291
  if (!t)
2292
2292
  return [];
2293
- const r = ce(e, k.Letter), o = ce(e, k.Emoji);
2293
+ const r = ue(e, k.Letter), o = ue(e, k.Emoji);
2294
2294
  if (!r) {
2295
2295
  if (!o)
2296
2296
  return [t];
2297
- const a = qe(t);
2297
+ const a = tt(t);
2298
2298
  if (a.length === 0)
2299
2299
  return [t];
2300
- const { nodes: l } = $t(a, n);
2300
+ const { nodes: l } = Gt(a, n);
2301
2301
  return l;
2302
2302
  }
2303
- const s = [], i = qe(t);
2303
+ const s = [], i = tt(t);
2304
2304
  for (const a of i) {
2305
- const l = n.letter++, d = `motion-letter-${l}`, h = xe(l);
2305
+ const l = n.letter++, f = `motion-letter-${l}`, p = Le(l);
2306
2306
  if (a === `
2307
2307
  `) {
2308
2308
  s.push(
2309
- /* @__PURE__ */ S.jsx("span", { "data-motion-letter": !0, style: h, children: /* @__PURE__ */ S.jsx("br", {}) }, d)
2309
+ /* @__PURE__ */ S.jsx("span", { "data-motion-letter": !0, style: p, children: /* @__PURE__ */ S.jsx("br", {}) }, f)
2310
2310
  );
2311
2311
  continue;
2312
2312
  }
2313
- const m = o && Dt(a) ? { "data-motion-emoji": !0 } : void 0, c = a === " " ? " " : a;
2313
+ const u = o && Kt(a) ? { "data-motion-emoji": !0 } : void 0, c = a === " " ? " " : a;
2314
2314
  s.push(
2315
- /* @__PURE__ */ S.jsx("span", { "data-motion-letter": !0, style: h, ...m, children: c }, d)
2315
+ /* @__PURE__ */ S.jsx("span", { "data-motion-letter": !0, style: p, ...u, children: c }, f)
2316
2316
  );
2317
2317
  }
2318
2318
  return s;
2319
2319
  }
2320
- function qe(t) {
2320
+ function tt(t) {
2321
2321
  if (!t)
2322
2322
  return [];
2323
- const e = po();
2324
- return e ? Array.from(e.segment(t), (n) => n.segment) : mo(t);
2323
+ const e = vo();
2324
+ return e ? Array.from(e.segment(t), (n) => n.segment) : Ro(t);
2325
2325
  }
2326
- let me;
2327
- function po() {
2328
- return me !== void 0 || (typeof Intl < "u" && typeof Intl.Segmenter == "function" ? me = new Intl.Segmenter(void 0, { granularity: "grapheme" }) : me = null), me;
2326
+ let be;
2327
+ function vo() {
2328
+ return be !== void 0 || (typeof Intl < "u" && typeof Intl.Segmenter == "function" ? be = new Intl.Segmenter(void 0, { granularity: "grapheme" }) : be = null), be;
2329
2329
  }
2330
- function mo(t) {
2330
+ function Ro(t) {
2331
2331
  const e = [], n = Array.from(t);
2332
2332
  let r = "";
2333
2333
  for (let o = 0; o < n.length; o++) {
2334
2334
  const s = n[o], i = n[o + 1];
2335
- r += s, !(i && go(s, i)) && (e.push(r), r = "");
2335
+ r += s, !(i && Ao(s, i)) && (e.push(r), r = "");
2336
2336
  }
2337
2337
  return r && e.push(r), e;
2338
2338
  }
2339
- function go(t, e) {
2340
- return e ? !!(St(t) || St(e) || wo(e) || yo(e) || bo(e) || Et(t) && Et(e)) : !1;
2339
+ function Ao(t, e) {
2340
+ return e ? !!(kt(t) || kt(e) || Co(e) || To(e) || ko(e) || Ct(t) && Ct(e)) : !1;
2341
2341
  }
2342
- function St(t) {
2342
+ function kt(t) {
2343
2343
  return t.codePointAt(0) === 8205;
2344
2344
  }
2345
- function yo(t) {
2345
+ function To(t) {
2346
2346
  const e = t.codePointAt(0);
2347
2347
  return e === void 0 ? !1 : e >= 65024 && e <= 65039 || e >= 917760 && e <= 917999;
2348
2348
  }
2349
- function bo(t) {
2349
+ function ko(t) {
2350
2350
  const e = t.codePointAt(0);
2351
2351
  return e === void 0 ? !1 : e >= 127995 && e <= 127999;
2352
2352
  }
2353
- function Et(t) {
2353
+ function Ct(t) {
2354
2354
  const e = t.codePointAt(0);
2355
2355
  return e === void 0 ? !1 : e >= 127462 && e <= 127487;
2356
2356
  }
2357
- let $e;
2358
- function wo(t) {
2359
- return t ? ($e || ($e = So()), $e(t)) : !1;
2357
+ let Ke;
2358
+ function Co(t) {
2359
+ return t ? (Ke || (Ke = _o()), Ke(t)) : !1;
2360
2360
  }
2361
- function So() {
2361
+ function _o() {
2362
2362
  try {
2363
2363
  const t = new RegExp("\\p{Mark}", "u");
2364
2364
  return (e) => t.test(e);
@@ -2369,19 +2369,19 @@ function So() {
2369
2369
  };
2370
2370
  }
2371
2371
  }
2372
- let Be;
2373
- function Dt(t) {
2374
- return t ? (Be || (Be = Eo()), Be(t)) : !1;
2372
+ let Ge;
2373
+ function Kt(t) {
2374
+ return t ? (Ge || (Ge = Io()), Ge(t)) : !1;
2375
2375
  }
2376
- function Eo() {
2376
+ function Io() {
2377
2377
  try {
2378
2378
  const t = new RegExp("\\p{Extended_Pictographic}", "u");
2379
2379
  return (e) => t.test(e);
2380
2380
  } catch {
2381
- return vo;
2381
+ return Oo;
2382
2382
  }
2383
2383
  }
2384
- function vo(t) {
2384
+ function Oo(t) {
2385
2385
  if (!t)
2386
2386
  return !1;
2387
2387
  for (const e of Array.from(t)) {
@@ -2391,7 +2391,7 @@ function vo(t) {
2391
2391
  }
2392
2392
  return !1;
2393
2393
  }
2394
- function Ro(t) {
2394
+ function No(t) {
2395
2395
  const e = [];
2396
2396
  let n = "", r = 0;
2397
2397
  for (let o = 0; o < t.length; o++) {
@@ -2405,7 +2405,7 @@ function Ro(t) {
2405
2405
  }
2406
2406
  return (r > 0 || n.length > 0) && e.push({ text: n, breaks: r }), e;
2407
2407
  }
2408
- function Ao(t) {
2408
+ function xo(t) {
2409
2409
  if (t.length === 0)
2410
2410
  return [];
2411
2411
  const e = [];
@@ -2414,10 +2414,10 @@ function Ao(t) {
2414
2414
  n.push(r), r.breaks >= 2 && (e.push(n), n = []);
2415
2415
  return n.length > 0 && e.push(n), e;
2416
2416
  }
2417
- function ce(t, e) {
2417
+ function ue(t, e) {
2418
2418
  return (t & e) === e;
2419
2419
  }
2420
- function xe(t) {
2420
+ function Le(t) {
2421
2421
  return {
2422
2422
  "--tw-motion-seq-index": t.toString(),
2423
2423
  backgroundColor: "inherit",
@@ -2434,27 +2434,27 @@ function xe(t) {
2434
2434
  WebkitTextFillColor: "inherit"
2435
2435
  };
2436
2436
  }
2437
- function vt(t) {
2437
+ function _t(t) {
2438
2438
  if (!t)
2439
2439
  return t;
2440
- const e = qe(t);
2440
+ const e = tt(t);
2441
2441
  if (e.length === 0)
2442
2442
  return t;
2443
- const { nodes: n, sawEmoji: r } = $t(e);
2443
+ const { nodes: n, sawEmoji: r } = Gt(e);
2444
2444
  return r ? n.length === 1 ? n[0] ?? t : n : t;
2445
2445
  }
2446
- function $t(t, e) {
2446
+ function Gt(t, e) {
2447
2447
  const n = [];
2448
2448
  let r = "", o = !1, s = e?.emoji ?? 0;
2449
2449
  const i = () => {
2450
2450
  r && (n.push(r), r = "");
2451
2451
  };
2452
2452
  for (const a of t) {
2453
- if (Dt(a)) {
2453
+ if (Kt(a)) {
2454
2454
  o = !0, i();
2455
- const d = `motion-emoji-${e ? e.emoji++ : s++}`;
2455
+ const f = `motion-emoji-${e ? e.emoji++ : s++}`;
2456
2456
  n.push(
2457
- /* @__PURE__ */ S.jsx("span", { "data-motion-emoji": !0, children: a }, d)
2457
+ /* @__PURE__ */ S.jsx("span", { "data-motion-emoji": !0, children: a }, f)
2458
2458
  );
2459
2459
  continue;
2460
2460
  }
@@ -2462,13 +2462,13 @@ function $t(t, e) {
2462
2462
  }
2463
2463
  return i(), o ? { nodes: n, sawEmoji: !0 } : { nodes: [t.join("")], sawEmoji: !1 };
2464
2464
  }
2465
- function To(t) {
2465
+ function Po(t) {
2466
2466
  if (!t)
2467
2467
  return k.None;
2468
2468
  const e = t.trim();
2469
2469
  if (!e)
2470
2470
  return k.None;
2471
- const n = bt.get(e);
2471
+ const n = At.get(e);
2472
2472
  if (typeof n == "number")
2473
2473
  return n;
2474
2474
  if (typeof document > "u")
@@ -2476,25 +2476,25 @@ function To(t) {
2476
2476
  const r = e.split(/\s+/).filter(Boolean);
2477
2477
  if (r.length === 0)
2478
2478
  return k.None;
2479
- const s = r.map((l) => `.${ko(l)}`).map(
2480
- (l) => new RegExp(`(^|[^a-zA-Z0-9_-])${Co(l)}(?![a-zA-Z0-9_-])`)
2479
+ const s = r.map((l) => `.${Lo(l)}`).map(
2480
+ (l) => new RegExp(`(^|[^a-zA-Z0-9_-])${Mo(l)}(?![a-zA-Z0-9_-])`)
2481
2481
  );
2482
2482
  let i = k.None, a = !1;
2483
2483
  for (const l of Array.from(document.styleSheets)) {
2484
- let d;
2484
+ let f;
2485
2485
  try {
2486
- d = l.cssRules;
2486
+ f = l.cssRules;
2487
2487
  } catch {
2488
2488
  continue;
2489
2489
  }
2490
- const h = Bt(d, s);
2491
- if (h.mask && (i |= h.mask, i === He))
2490
+ const p = Yt(f, s);
2491
+ if (p.mask && (i |= p.mask, i === et))
2492
2492
  break;
2493
- a ||= h.sawStyleRule;
2493
+ a ||= p.sawStyleRule;
2494
2494
  }
2495
- return (i !== k.None || a) && bt.set(e, i), i;
2495
+ return (i !== k.None || a) && At.set(e, i), i;
2496
2496
  }
2497
- function Bt(t, e) {
2497
+ function Yt(t, e) {
2498
2498
  if (!t)
2499
2499
  return { mask: k.None, sawStyleRule: !1 };
2500
2500
  let n = k.None, r = !1;
@@ -2503,15 +2503,15 @@ function Bt(t, e) {
2503
2503
  if (s) {
2504
2504
  if (s.type === CSSRule.STYLE_RULE) {
2505
2505
  const a = s.selectorText ?? "";
2506
- if (!a || !e.some((d) => d.test(a))) continue;
2506
+ if (!a || !e.some((f) => f.test(a))) continue;
2507
2507
  r = !0;
2508
- for (const d of so)
2509
- d.hints.some((h) => a.includes(h)) && (n |= d.flag);
2510
- if (n === He)
2508
+ for (const f of po)
2509
+ f.hints.some((p) => a.includes(p)) && (n |= f.flag);
2510
+ if (n === et)
2511
2511
  return { mask: n, sawStyleRule: !0 };
2512
2512
  } else if ("cssRules" in s) {
2513
- const i = Bt(s.cssRules, e);
2514
- if (i.mask && (n |= i.mask, n === He))
2513
+ const i = Yt(s.cssRules, e);
2514
+ if (i.mask && (n |= i.mask, n === et))
2515
2515
  return { mask: n, sawStyleRule: !0 };
2516
2516
  r ||= i.sawStyleRule;
2517
2517
  }
@@ -2519,48 +2519,48 @@ function Bt(t, e) {
2519
2519
  }
2520
2520
  return { mask: n, sawStyleRule: r };
2521
2521
  }
2522
- function ko(t) {
2522
+ function Lo(t) {
2523
2523
  return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
2524
2524
  }
2525
- function Co(t) {
2525
+ function Mo(t) {
2526
2526
  return t.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
2527
2527
  }
2528
- const tt = "ikon_auth_session", _o = 10080 * 60 * 1e3, Io = 60 * 1e3;
2529
- function Oo(t) {
2528
+ const it = "ikon_auth_session", Uo = 10080 * 60 * 1e3, jo = 60 * 1e3;
2529
+ function Do(t) {
2530
2530
  try {
2531
2531
  const e = t.split(".");
2532
2532
  if (e.length !== 3) return !0;
2533
2533
  const n = e[1].replace(/-/g, "+").replace(/_/g, "/"), r = n + "=".repeat((4 - n.length % 4) % 4), o = JSON.parse(atob(r));
2534
- return typeof o.exp != "number" ? !1 : Date.now() >= o.exp * 1e3 - Io;
2534
+ return typeof o.exp != "number" ? !1 : Date.now() >= o.exp * 1e3 - jo;
2535
2535
  } catch {
2536
2536
  return !0;
2537
2537
  }
2538
2538
  }
2539
- function be(t) {
2539
+ function Ee(t) {
2540
2540
  try {
2541
- localStorage.setItem(tt, JSON.stringify(t));
2541
+ localStorage.setItem(it, JSON.stringify(t));
2542
2542
  } catch {
2543
2543
  console.warn("Failed to save auth session to localStorage");
2544
2544
  }
2545
2545
  }
2546
- function Ft() {
2546
+ function zt() {
2547
2547
  try {
2548
- const t = localStorage.getItem(tt);
2548
+ const t = localStorage.getItem(it);
2549
2549
  if (!t) return null;
2550
2550
  const e = JSON.parse(t);
2551
- return Date.now() - e.authenticatedAt > _o || Oo(e.token) ? (Oe(), null) : e;
2551
+ return Date.now() - e.authenticatedAt > Uo || Do(e.token) ? (xe(), null) : e;
2552
2552
  } catch {
2553
2553
  return console.warn("Failed to load auth session from localStorage"), null;
2554
2554
  }
2555
2555
  }
2556
- function Oe() {
2556
+ function xe() {
2557
2557
  try {
2558
- localStorage.removeItem(tt);
2558
+ localStorage.removeItem(it);
2559
2559
  } catch {
2560
2560
  console.warn("Failed to clear auth session from localStorage");
2561
2561
  }
2562
2562
  }
2563
- function se(t) {
2563
+ function ae(t) {
2564
2564
  return {
2565
2565
  id: "",
2566
2566
  provider: t.provider,
@@ -2568,51 +2568,51 @@ function se(t) {
2568
2568
  authenticatedAt: t.authenticatedAt
2569
2569
  };
2570
2570
  }
2571
- const Vt = 15e3, ge = ne("AuthService");
2572
- async function Rt(t) {
2571
+ const Xt = 15e3, we = se("AuthService");
2572
+ async function It(t) {
2573
2573
  try {
2574
2574
  return await fetch(t, { method: "GET", mode: "no-cors" }), "no-cors probe SUCCEEDED → origin is reachable; the failure is most likely CORS (missing/!allowed Access-Control headers)";
2575
2575
  } catch (e) {
2576
2576
  return `no-cors probe ALSO FAILED (${e instanceof Error ? e.name : "Error"}) → origin is unreachable: TLS handshake / certificate, DNS, or network (old browser may not trust this host's cert)`;
2577
2577
  }
2578
2578
  }
2579
- async function Wt(t, e) {
2580
- const n = un(), r = {
2579
+ async function Ht(t, e) {
2580
+ const n = wn(), r = {
2581
2581
  method: "POST",
2582
2582
  headers: { "Content-Type": "application/json" },
2583
2583
  body: JSON.stringify({ deviceId: n, space: t })
2584
2584
  }, o = typeof window < "u" ? window.location.origin : "?", s = `${e}/anonymous`;
2585
- ge.info(`Anonymous auth: POST ${s} (space=${t}, origin=${o})`);
2585
+ we.info(`Anonymous auth: POST ${s} (space=${t}, origin=${o})`);
2586
2586
  let i;
2587
2587
  try {
2588
2588
  i = await fetch(s, r);
2589
- } catch (d) {
2590
- const h = d instanceof Error ? `${d.name}: ${d.message}` : String(d), p = dn(), m = p ? `${p}/anonymous` : null;
2591
- if (m && m !== s) {
2592
- ge.warn(`Anonymous auth could not reach ${s} (${h}); falling back to same-origin ${m}`);
2589
+ } catch (f) {
2590
+ const p = f instanceof Error ? `${f.name}: ${f.message}` : String(f), y = Sn(), u = y ? `${y}/anonymous` : null;
2591
+ if (u && u !== s) {
2592
+ we.warn(`Anonymous auth could not reach ${s} (${p}); falling back to same-origin ${u}`);
2593
2593
  try {
2594
- i = await fetch(m, r);
2594
+ i = await fetch(u, r);
2595
2595
  } catch (c) {
2596
- const u = c instanceof Error ? `${c.name}: ${c.message}` : String(c), y = await Rt(e);
2597
- throw ge.error(`Anonymous auth failed on both direct (${s}: ${h}) and same-origin (${m}: ${u}). ${y}`), new Error(`Anonymous auth unreachable: direct ${s} (${h}) and same-origin ${m} (${u})`);
2596
+ const d = c instanceof Error ? `${c.name}: ${c.message}` : String(c), m = await It(e);
2597
+ throw we.error(`Anonymous auth failed on both direct (${s}: ${p}) and same-origin (${u}: ${d}). ${m}`), new Error(`Anonymous auth unreachable: direct ${s} (${p}) and same-origin ${u} (${d})`);
2598
2598
  }
2599
2599
  } else {
2600
- const c = await Rt(e);
2601
- throw ge.error(`Anonymous auth fetch threw for ${s} — ${h}. ${c}`), new Error(`Anonymous auth could not reach ${s} (${h}). ${c}`);
2600
+ const c = await It(e);
2601
+ throw we.error(`Anonymous auth fetch threw for ${s} — ${p}. ${c}`), new Error(`Anonymous auth could not reach ${s} (${p}). ${c}`);
2602
2602
  }
2603
2603
  }
2604
2604
  if (!i.ok) {
2605
- const d = await i.text().catch(() => "Unknown error");
2606
- throw ge.error(`Anonymous auth HTTP ${i.status} from ${i.url}: ${d}`), new Error(`Anonymous auth failed: ${i.status} ${d}`);
2605
+ const f = await i.text().catch(() => "Unknown error");
2606
+ throw we.error(`Anonymous auth HTTP ${i.status} from ${i.url}: ${f}`), new Error(`Anonymous auth failed: ${i.status} ${f}`);
2607
2607
  }
2608
2608
  const { token: a } = await i.json(), l = {
2609
2609
  token: a,
2610
2610
  provider: "anonymous",
2611
2611
  authenticatedAt: Date.now()
2612
2612
  };
2613
- return be(l), l;
2613
+ return Ee(l), l;
2614
2614
  }
2615
- async function No({ email: t, spaceId: e, authUrl: n }) {
2615
+ async function $o({ email: t, spaceId: e, authUrl: n }) {
2616
2616
  const r = await fetch(`${n}/email/send`, {
2617
2617
  method: "POST",
2618
2618
  headers: { "Content-Type": "application/json" },
@@ -2620,14 +2620,14 @@ async function No({ email: t, spaceId: e, authUrl: n }) {
2620
2620
  email: t.trim(),
2621
2621
  space: e
2622
2622
  }),
2623
- signal: _t(Vt)
2623
+ signal: Lt(Xt)
2624
2624
  });
2625
2625
  if (!r.ok) {
2626
2626
  const o = await r.text().catch(() => "Failed to send login code");
2627
2627
  throw new Error(o);
2628
2628
  }
2629
2629
  }
2630
- async function xo({ email: t, code: e, authUrl: n }) {
2630
+ async function Bo({ email: t, code: e, authUrl: n }) {
2631
2631
  const r = await fetch(`${n}/email/code`, {
2632
2632
  method: "POST",
2633
2633
  headers: { "Content-Type": "application/json" },
@@ -2635,7 +2635,7 @@ async function xo({ email: t, code: e, authUrl: n }) {
2635
2635
  email: t.trim(),
2636
2636
  code: e.trim()
2637
2637
  }),
2638
- signal: _t(Vt)
2638
+ signal: Lt(Xt)
2639
2639
  });
2640
2640
  if (!r.ok) {
2641
2641
  const i = await r.text().catch(() => "Invalid code");
@@ -2646,23 +2646,23 @@ async function xo({ email: t, code: e, authUrl: n }) {
2646
2646
  provider: "email",
2647
2647
  authenticatedAt: Date.now()
2648
2648
  };
2649
- return be(s), s;
2649
+ return Ee(s), s;
2650
2650
  }
2651
- function Po() {
2651
+ function Fo() {
2652
2652
  const t = new URLSearchParams(window.location.search), e = t.get("ikon_token"), n = t.get("ikon_provider");
2653
2653
  return e && n ? { token: e, provider: n } : null;
2654
2654
  }
2655
- function Lo() {
2655
+ function Vo() {
2656
2656
  return new URLSearchParams(window.location.search).get("error");
2657
2657
  }
2658
- function At() {
2658
+ function Ot() {
2659
2659
  window.history.replaceState({}, "", window.location.pathname);
2660
2660
  }
2661
- function Mo(t, e, n, r) {
2661
+ function Wo(t, e, n, r) {
2662
2662
  const o = r ?? window.location.origin + window.location.pathname + window.location.search;
2663
2663
  return `${n}/oauth/${t}?space=${encodeURIComponent(e)}&return=${encodeURIComponent(o)}`;
2664
2664
  }
2665
- async function Uo(t) {
2665
+ async function Ko(t) {
2666
2666
  const e = await fetch(`${t}/passkey/registration/options`, {
2667
2667
  method: "POST",
2668
2668
  headers: { "Content-Type": "application/json" }
@@ -2673,7 +2673,7 @@ async function Uo(t) {
2673
2673
  }
2674
2674
  return e.json();
2675
2675
  }
2676
- async function jo(t, e, n) {
2676
+ async function Go(t, e, n) {
2677
2677
  const r = await fetch(`${t}/passkey/registration/verify`, {
2678
2678
  method: "POST",
2679
2679
  headers: { "Content-Type": "application/json" },
@@ -2688,9 +2688,9 @@ async function jo(t, e, n) {
2688
2688
  provider: "passkey",
2689
2689
  authenticatedAt: Date.now()
2690
2690
  };
2691
- return be(s), s;
2691
+ return Ee(s), s;
2692
2692
  }
2693
- async function Do(t, e) {
2693
+ async function Yo(t, e) {
2694
2694
  const n = await fetch(`${t}/passkey/authentication/options`, {
2695
2695
  method: "POST",
2696
2696
  headers: { "Content-Type": "application/json" },
@@ -2702,7 +2702,7 @@ async function Do(t, e) {
2702
2702
  }
2703
2703
  return n.json();
2704
2704
  }
2705
- async function $o(t, e) {
2705
+ async function zo(t, e) {
2706
2706
  const n = await fetch(`${t}/passkey/authentication/verify`, {
2707
2707
  method: "POST",
2708
2708
  headers: { "Content-Type": "application/json" },
@@ -2717,32 +2717,32 @@ async function $o(t, e) {
2717
2717
  provider: "passkey",
2718
2718
  authenticatedAt: Date.now()
2719
2719
  };
2720
- return be(o), o;
2720
+ return Ee(o), o;
2721
2721
  }
2722
- function H(t) {
2722
+ function z(t) {
2723
2723
  const e = new Uint8Array(t);
2724
2724
  let n = "";
2725
2725
  for (const o of e)
2726
2726
  n += String.fromCharCode(o);
2727
2727
  return btoa(n).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
2728
2728
  }
2729
- function Ne(t) {
2729
+ function Pe(t) {
2730
2730
  const e = t.replace(/-/g, "+").replace(/_/g, "/"), n = (4 - e.length % 4) % 4, r = e.padEnd(e.length + n, "="), o = atob(r), s = new ArrayBuffer(o.length), i = new Uint8Array(s);
2731
2731
  for (let a = 0; a < o.length; a++)
2732
2732
  i[a] = o.charCodeAt(a);
2733
2733
  return s;
2734
2734
  }
2735
- function nt() {
2736
- return Bo.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
2735
+ function at() {
2736
+ return Xo.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
2737
2737
  }
2738
- const Bo = {
2738
+ const Xo = {
2739
2739
  stubThis: (t) => t
2740
2740
  };
2741
- function Kt(t) {
2741
+ function qt(t) {
2742
2742
  const { id: e } = t;
2743
2743
  return {
2744
2744
  ...t,
2745
- id: Ne(e),
2745
+ id: Pe(e),
2746
2746
  /**
2747
2747
  * `descriptor.transports` is an array of our `AuthenticatorTransportFuture` that includes newer
2748
2748
  * transports that TypeScript's DOM lib is ignorant of. Convince TS that our list of transports
@@ -2751,7 +2751,7 @@ function Kt(t) {
2751
2751
  transports: t.transports
2752
2752
  };
2753
2753
  }
2754
- function Gt(t) {
2754
+ function Jt(t) {
2755
2755
  return (
2756
2756
  // Consider localhost valid as well since it's okay wrt Secure Contexts
2757
2757
  t === "localhost" || // Support punycode (ACE) or ascii labels and domains
@@ -2768,7 +2768,7 @@ class j extends Error {
2768
2768
  }), this.name = o ?? r.name, this.code = n;
2769
2769
  }
2770
2770
  }
2771
- function Fo({ error: t, options: e }) {
2771
+ function Ho({ error: t, options: e }) {
2772
2772
  const { publicKey: n } = e;
2773
2773
  if (!n)
2774
2774
  throw Error("options was missing required publicKey property");
@@ -2826,7 +2826,7 @@ function Fo({ error: t, options: e }) {
2826
2826
  });
2827
2827
  if (t.name === "SecurityError") {
2828
2828
  const r = globalThis.location.hostname;
2829
- if (Gt(r)) {
2829
+ if (Jt(r)) {
2830
2830
  if (n.rp.id !== r)
2831
2831
  return new j({
2832
2832
  message: `The RP ID "${n.rp.id}" is invalid for this domain`,
@@ -2854,7 +2854,7 @@ function Fo({ error: t, options: e }) {
2854
2854
  }
2855
2855
  return t;
2856
2856
  }
2857
- class Vo {
2857
+ class qo {
2858
2858
  constructor() {
2859
2859
  Object.defineProperty(this, "controller", {
2860
2860
  enumerable: !0,
@@ -2878,89 +2878,89 @@ class Vo {
2878
2878
  }
2879
2879
  }
2880
2880
  }
2881
- const Yt = new Vo(), Wo = ["cross-platform", "platform"];
2882
- function zt(t) {
2883
- if (t && !(Wo.indexOf(t) < 0))
2881
+ const Zt = new qo(), Jo = ["cross-platform", "platform"];
2882
+ function Qt(t) {
2883
+ if (t && !(Jo.indexOf(t) < 0))
2884
2884
  return t;
2885
2885
  }
2886
- async function Ko(t) {
2886
+ async function Zo(t) {
2887
2887
  !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 });
2888
2888
  const { optionsJSON: e, useAutoRegister: n = !1 } = t;
2889
- if (!nt())
2889
+ if (!at())
2890
2890
  throw new Error("WebAuthn is not supported in this browser");
2891
2891
  const r = {
2892
2892
  ...e,
2893
- challenge: Ne(e.challenge),
2893
+ challenge: Pe(e.challenge),
2894
2894
  user: {
2895
2895
  ...e.user,
2896
- id: Ne(e.user.id)
2896
+ id: Pe(e.user.id)
2897
2897
  },
2898
- excludeCredentials: e.excludeCredentials?.map(Kt)
2898
+ excludeCredentials: e.excludeCredentials?.map(qt)
2899
2899
  }, o = {};
2900
- n && (o.mediation = "conditional"), o.publicKey = r, o.signal = Yt.createNewAbortSignal();
2900
+ n && (o.mediation = "conditional"), o.publicKey = r, o.signal = Zt.createNewAbortSignal();
2901
2901
  let s;
2902
2902
  try {
2903
2903
  s = await navigator.credentials.create(o);
2904
- } catch (u) {
2905
- throw Fo({ error: u, options: o });
2904
+ } catch (d) {
2905
+ throw Ho({ error: d, options: o });
2906
2906
  }
2907
2907
  if (!s)
2908
2908
  throw new Error("Registration was not completed");
2909
- const { id: i, rawId: a, response: l, type: d } = s;
2910
- let h;
2911
- typeof l.getTransports == "function" && (h = l.getTransports());
2909
+ const { id: i, rawId: a, response: l, type: f } = s;
2912
2910
  let p;
2911
+ typeof l.getTransports == "function" && (p = l.getTransports());
2912
+ let y;
2913
2913
  if (typeof l.getPublicKeyAlgorithm == "function")
2914
2914
  try {
2915
- p = l.getPublicKeyAlgorithm();
2916
- } catch (u) {
2917
- Fe("getPublicKeyAlgorithm()", u);
2915
+ y = l.getPublicKeyAlgorithm();
2916
+ } catch (d) {
2917
+ Ye("getPublicKeyAlgorithm()", d);
2918
2918
  }
2919
- let m;
2919
+ let u;
2920
2920
  if (typeof l.getPublicKey == "function")
2921
2921
  try {
2922
- const u = l.getPublicKey();
2923
- u !== null && (m = H(u));
2924
- } catch (u) {
2925
- Fe("getPublicKey()", u);
2922
+ const d = l.getPublicKey();
2923
+ d !== null && (u = z(d));
2924
+ } catch (d) {
2925
+ Ye("getPublicKey()", d);
2926
2926
  }
2927
2927
  let c;
2928
2928
  if (typeof l.getAuthenticatorData == "function")
2929
2929
  try {
2930
- c = H(l.getAuthenticatorData());
2931
- } catch (u) {
2932
- Fe("getAuthenticatorData()", u);
2930
+ c = z(l.getAuthenticatorData());
2931
+ } catch (d) {
2932
+ Ye("getAuthenticatorData()", d);
2933
2933
  }
2934
2934
  return {
2935
2935
  id: i,
2936
- rawId: H(a),
2936
+ rawId: z(a),
2937
2937
  response: {
2938
- attestationObject: H(l.attestationObject),
2939
- clientDataJSON: H(l.clientDataJSON),
2940
- transports: h,
2941
- publicKeyAlgorithm: p,
2942
- publicKey: m,
2938
+ attestationObject: z(l.attestationObject),
2939
+ clientDataJSON: z(l.clientDataJSON),
2940
+ transports: p,
2941
+ publicKeyAlgorithm: y,
2942
+ publicKey: u,
2943
2943
  authenticatorData: c
2944
2944
  },
2945
- type: d,
2945
+ type: f,
2946
2946
  clientExtensionResults: s.getClientExtensionResults(),
2947
- authenticatorAttachment: zt(s.authenticatorAttachment)
2947
+ authenticatorAttachment: Qt(s.authenticatorAttachment)
2948
2948
  };
2949
2949
  }
2950
- function Fe(t, e) {
2950
+ function Ye(t, e) {
2951
2951
  console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${t}. You should report this error to them.
2952
2952
  `, e);
2953
2953
  }
2954
- function Go() {
2955
- if (!nt())
2956
- return Ve.stubThis(new Promise((e) => e(!1)));
2954
+ function Qo() {
2955
+ if (!at())
2956
+ return ze.stubThis(new Promise((e) => e(!1)));
2957
2957
  const t = globalThis.PublicKeyCredential;
2958
- return t?.isConditionalMediationAvailable === void 0 ? Ve.stubThis(new Promise((e) => e(!1))) : Ve.stubThis(t.isConditionalMediationAvailable());
2958
+ return t?.isConditionalMediationAvailable === void 0 ? ze.stubThis(new Promise((e) => e(!1))) : ze.stubThis(t.isConditionalMediationAvailable());
2959
2959
  }
2960
- const Ve = {
2960
+ const ze = {
2961
2961
  stubThis: (t) => t
2962
2962
  };
2963
- function Yo({ error: t, options: e }) {
2963
+ function es({ error: t, options: e }) {
2964
2964
  const { publicKey: n } = e;
2965
2965
  if (!n)
2966
2966
  throw Error("options was missing required publicKey property");
@@ -2980,7 +2980,7 @@ function Yo({ error: t, options: e }) {
2980
2980
  });
2981
2981
  if (t.name === "SecurityError") {
2982
2982
  const r = globalThis.location.hostname;
2983
- if (Gt(r)) {
2983
+ if (Jt(r)) {
2984
2984
  if (n.rpId !== r)
2985
2985
  return new j({
2986
2986
  message: `The RP ID "${n.rpId}" is invalid for this domain`,
@@ -3001,91 +3001,91 @@ function Yo({ error: t, options: e }) {
3001
3001
  }
3002
3002
  return t;
3003
3003
  }
3004
- async function zo(t) {
3004
+ async function ts(t) {
3005
3005
  !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 });
3006
3006
  const { optionsJSON: e, useBrowserAutofill: n = !1, verifyBrowserAutofillInput: r = !0 } = t;
3007
- if (!nt())
3007
+ if (!at())
3008
3008
  throw new Error("WebAuthn is not supported in this browser");
3009
3009
  let o;
3010
- e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(Kt));
3010
+ e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(qt));
3011
3011
  const s = {
3012
3012
  ...e,
3013
- challenge: Ne(e.challenge),
3013
+ challenge: Pe(e.challenge),
3014
3014
  allowCredentials: o
3015
3015
  }, i = {};
3016
3016
  if (n) {
3017
- if (!await Go())
3017
+ if (!await Qo())
3018
3018
  throw Error("Browser does not support WebAuthn autofill");
3019
3019
  if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 && r)
3020
3020
  throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
3021
3021
  i.mediation = "conditional", s.allowCredentials = [];
3022
3022
  }
3023
- i.publicKey = s, i.signal = Yt.createNewAbortSignal();
3023
+ i.publicKey = s, i.signal = Zt.createNewAbortSignal();
3024
3024
  let a;
3025
3025
  try {
3026
3026
  a = await navigator.credentials.get(i);
3027
3027
  } catch (c) {
3028
- throw Yo({ error: c, options: i });
3028
+ throw es({ error: c, options: i });
3029
3029
  }
3030
3030
  if (!a)
3031
3031
  throw new Error("Authentication was not completed");
3032
- const { id: l, rawId: d, response: h, type: p } = a;
3033
- let m;
3034
- return h.userHandle && (m = H(h.userHandle)), {
3032
+ const { id: l, rawId: f, response: p, type: y } = a;
3033
+ let u;
3034
+ return p.userHandle && (u = z(p.userHandle)), {
3035
3035
  id: l,
3036
- rawId: H(d),
3036
+ rawId: z(f),
3037
3037
  response: {
3038
- authenticatorData: H(h.authenticatorData),
3039
- clientDataJSON: H(h.clientDataJSON),
3040
- signature: H(h.signature),
3041
- userHandle: m
3038
+ authenticatorData: z(p.authenticatorData),
3039
+ clientDataJSON: z(p.clientDataJSON),
3040
+ signature: z(p.signature),
3041
+ userHandle: u
3042
3042
  },
3043
- type: p,
3043
+ type: y,
3044
3044
  clientExtensionResults: a.getClientExtensionResults(),
3045
- authenticatorAttachment: zt(a.authenticatorAttachment)
3045
+ authenticatorAttachment: Qt(a.authenticatorAttachment)
3046
3046
  };
3047
3047
  }
3048
- const rt = Ct(null);
3049
- function Ls({ children: t, config: e }) {
3050
- const [n, r] = N({
3048
+ const ct = Pt(null);
3049
+ function Vs({ children: t, config: e }) {
3050
+ const [n, r] = x({
3051
3051
  isAuthenticated: !1,
3052
3052
  isLoading: !0,
3053
3053
  user: null,
3054
3054
  error: null
3055
3055
  });
3056
- _(() => {
3056
+ C(() => {
3057
3057
  (() => {
3058
- const m = Lo();
3059
- if (m) {
3060
- At(), r({
3058
+ const u = Vo();
3059
+ if (u) {
3060
+ Ot(), r({
3061
3061
  isAuthenticated: !1,
3062
3062
  isLoading: !1,
3063
3063
  user: null,
3064
- error: m
3064
+ error: u
3065
3065
  });
3066
3066
  return;
3067
3067
  }
3068
- const c = Po();
3068
+ const c = Fo();
3069
3069
  if (c) {
3070
- const y = {
3070
+ const m = {
3071
3071
  token: c.token,
3072
3072
  provider: c.provider,
3073
3073
  authenticatedAt: Date.now()
3074
3074
  };
3075
- be(y), At(), r({
3075
+ Ee(m), Ot(), r({
3076
3076
  isAuthenticated: !0,
3077
3077
  isLoading: !1,
3078
- user: se(y),
3078
+ user: ae(m),
3079
3079
  error: null
3080
3080
  });
3081
3081
  return;
3082
3082
  }
3083
- const u = Ft();
3084
- if (u) {
3083
+ const d = zt();
3084
+ if (d) {
3085
3085
  r({
3086
3086
  isAuthenticated: !0,
3087
3087
  isLoading: !1,
3088
- user: se(u),
3088
+ user: ae(d),
3089
3089
  error: null
3090
3090
  });
3091
3091
  return;
@@ -3099,7 +3099,7 @@ function Ls({ children: t, config: e }) {
3099
3099
  })();
3100
3100
  }, []);
3101
3101
  const o = D(
3102
- async (p) => {
3102
+ async (y) => {
3103
3103
  if (!e.spaceId) {
3104
3104
  r((c) => ({
3105
3105
  ...c,
@@ -3107,136 +3107,136 @@ function Ls({ children: t, config: e }) {
3107
3107
  }));
3108
3108
  return;
3109
3109
  }
3110
- const m = await ye(e.authUrl);
3111
- if (p === "guest") {
3110
+ const u = await Se(e.authUrl);
3111
+ if (y === "guest") {
3112
3112
  r((c) => ({ ...c, isLoading: !0 }));
3113
3113
  try {
3114
- const c = await Wt(e.spaceId, m);
3114
+ const c = await Ht(e.spaceId, u);
3115
3115
  r({
3116
3116
  isAuthenticated: !0,
3117
3117
  isLoading: !1,
3118
- user: se(c),
3118
+ user: ae(c),
3119
3119
  error: null
3120
3120
  });
3121
3121
  } catch (c) {
3122
- r((u) => ({
3123
- ...u,
3122
+ r((d) => ({
3123
+ ...d,
3124
3124
  isLoading: !1,
3125
3125
  error: c instanceof Error ? c.message : "Guest login failed"
3126
3126
  }));
3127
3127
  }
3128
3128
  return;
3129
3129
  }
3130
- if (p === "passkey") {
3130
+ if (y === "passkey") {
3131
3131
  r((c) => ({ ...c, isLoading: !0, error: null }));
3132
3132
  try {
3133
- const c = await Do(m), u = await zo({ optionsJSON: c }), y = await $o(m, u);
3133
+ const c = await Yo(u), d = await ts({ optionsJSON: c }), m = await zo(u, d);
3134
3134
  r({
3135
3135
  isAuthenticated: !0,
3136
3136
  isLoading: !1,
3137
- user: se(y),
3137
+ user: ae(m),
3138
3138
  error: null
3139
3139
  });
3140
3140
  } catch (c) {
3141
- r((u) => ({
3142
- ...u,
3141
+ r((d) => ({
3142
+ ...d,
3143
3143
  isLoading: !1,
3144
3144
  error: c instanceof Error ? c.message : "Passkey login failed"
3145
3145
  }));
3146
3146
  }
3147
3147
  return;
3148
3148
  }
3149
- if (p === "email")
3149
+ if (y === "email")
3150
3150
  throw new Error("login('email') is not supported. Use requestEmailCode()/submitEmailCode() from useAuth() instead.");
3151
- window.location.href = Mo(p, e.spaceId, m);
3151
+ window.location.href = Wo(y, e.spaceId, u);
3152
3152
  },
3153
3153
  [e.authUrl, e.spaceId]
3154
3154
  ), s = D(
3155
- async (p) => {
3155
+ async (y) => {
3156
3156
  if (!e.spaceId)
3157
3157
  throw r((c) => ({ ...c, error: "Space ID is not configured" })), new Error("Space ID is not configured");
3158
- const m = await ye(e.authUrl);
3159
- await No({ email: p, spaceId: e.spaceId, authUrl: m });
3158
+ const u = await Se(e.authUrl);
3159
+ await $o({ email: y, spaceId: e.spaceId, authUrl: u });
3160
3160
  },
3161
3161
  [e.authUrl, e.spaceId]
3162
3162
  ), i = D(
3163
- async (p, m) => {
3163
+ async (y, u) => {
3164
3164
  r((c) => ({ ...c, isLoading: !0, error: null }));
3165
3165
  try {
3166
- const c = await ye(e.authUrl), u = await xo({ email: p, code: m, authUrl: c });
3166
+ const c = await Se(e.authUrl), d = await Bo({ email: y, code: u, authUrl: c });
3167
3167
  r({
3168
3168
  isAuthenticated: !0,
3169
3169
  isLoading: !1,
3170
- user: se(u),
3170
+ user: ae(d),
3171
3171
  error: null
3172
3172
  });
3173
3173
  } catch (c) {
3174
- const u = c instanceof Error ? c.message : "Code verification failed";
3175
- throw r((y) => ({ ...y, isLoading: !1, error: u })), c;
3174
+ const d = c instanceof Error ? c.message : "Code verification failed";
3175
+ throw r((m) => ({ ...m, isLoading: !1, error: d })), c;
3176
3176
  }
3177
3177
  },
3178
3178
  [e.authUrl]
3179
3179
  ), a = D(() => {
3180
- Oe(), r({
3180
+ xe(), r({
3181
3181
  isAuthenticated: !1,
3182
3182
  isLoading: !1,
3183
3183
  user: null,
3184
3184
  error: null
3185
3185
  });
3186
3186
  }, []), l = D(
3187
- async (p) => {
3188
- const m = await ye(e.authUrl);
3187
+ async (y) => {
3188
+ const u = await Se(e.authUrl);
3189
3189
  r((c) => ({ ...c, isLoading: !0, error: null }));
3190
3190
  try {
3191
- const c = await Uo(m), u = await Ko({ optionsJSON: c }), y = await jo(m, u, p);
3191
+ const c = await Ko(u), d = await Zo({ optionsJSON: c }), m = await Go(u, d, y);
3192
3192
  r({
3193
3193
  isAuthenticated: !0,
3194
3194
  isLoading: !1,
3195
- user: se(y),
3195
+ user: ae(m),
3196
3196
  error: null
3197
3197
  });
3198
3198
  } catch (c) {
3199
- r((u) => ({
3200
- ...u,
3199
+ r((d) => ({
3200
+ ...d,
3201
3201
  isLoading: !1,
3202
3202
  error: c instanceof Error ? c.message : "Passkey registration failed"
3203
3203
  }));
3204
3204
  }
3205
3205
  },
3206
3206
  [e.authUrl]
3207
- ), d = D(() => n.user?.token ?? null, [n.user]), h = W(
3207
+ ), f = D(() => n.user?.token ?? null, [n.user]), p = W(
3208
3208
  () => ({
3209
3209
  state: n,
3210
3210
  login: o,
3211
3211
  logout: a,
3212
- getToken: d,
3212
+ getToken: f,
3213
3213
  registerPasskey: l,
3214
3214
  requestEmailCode: s,
3215
3215
  submitEmailCode: i
3216
3216
  }),
3217
- [n, o, a, d, l, s, i]
3217
+ [n, o, a, f, l, s, i]
3218
3218
  );
3219
- return /* @__PURE__ */ S.jsx(rt, { value: h, children: t });
3219
+ return /* @__PURE__ */ S.jsx(ct, { value: p, children: t });
3220
3220
  }
3221
- function Xo() {
3222
- const t = Ze(rt);
3221
+ function ns() {
3222
+ const t = rt(ct);
3223
3223
  if (!t)
3224
3224
  throw new Error("useAuth must be used within an AuthProvider");
3225
3225
  return t;
3226
3226
  }
3227
- function Ho() {
3228
- return Ze(rt);
3227
+ function rs() {
3228
+ return rt(ct);
3229
3229
  }
3230
- function Ms(t) {
3231
- const { config: e, guestUrlParam: n } = t, { state: r, login: o } = Xo(), s = A(!1);
3232
- return _(() => {
3230
+ function Ws(t) {
3231
+ const { config: e, guestUrlParam: n } = t, { state: r, login: o } = ns(), s = v(!1);
3232
+ return C(() => {
3233
3233
  if (!n || r.isAuthenticated || r.isLoading || s.current || !e.methods.includes("guest"))
3234
3234
  return;
3235
3235
  const i = new URLSearchParams(window.location.search), a = i.get(n);
3236
3236
  if (a === "true" || a === "1" || a === "") {
3237
3237
  i.delete(n);
3238
- const l = i.toString(), d = window.location.pathname + (l ? `?${l}` : "");
3239
- window.history.replaceState({}, "", d), s.current = !0, o("guest");
3238
+ const l = i.toString(), f = window.location.pathname + (l ? `?${l}` : "");
3239
+ window.history.replaceState({}, "", f), s.current = !0, o("guest");
3240
3240
  }
3241
3241
  }, [n, r.isAuthenticated, r.isLoading, e.methods, o]), {
3242
3242
  shouldRenderChildren: r.isAuthenticated,
@@ -3245,17 +3245,17 @@ function Ms(t) {
3245
3245
  error: r.error
3246
3246
  };
3247
3247
  }
3248
- const Xt = (() => {
3248
+ const en = (() => {
3249
3249
  try {
3250
- return fn();
3250
+ return En();
3251
3251
  } catch {
3252
3252
  return !1;
3253
3253
  }
3254
- })(), Ht = Date.now(), te = [], qo = 300;
3255
- function Te(t) {
3256
- te.push(`[+${((Date.now() - Ht) / 1e3).toFixed(1)}s] ${t}`), te.length > qo && te.shift();
3254
+ })(), tn = Date.now(), oe = [], os = 300;
3255
+ function Ce(t) {
3256
+ oe.push(`[+${((Date.now() - tn) / 1e3).toFixed(1)}s] ${t}`), oe.length > os && oe.shift();
3257
3257
  }
3258
- function Tt(t) {
3258
+ function Nt(t) {
3259
3259
  if (typeof t == "string")
3260
3260
  return t;
3261
3261
  if (t instanceof Error)
@@ -3266,30 +3266,30 @@ function Tt(t) {
3266
3266
  return String(t);
3267
3267
  }
3268
3268
  }
3269
- let kt = !1;
3270
- function qt() {
3271
- if (kt || typeof window > "u")
3269
+ let xt = !1;
3270
+ function nn() {
3271
+ if (xt || typeof window > "u")
3272
3272
  return;
3273
- kt = !0, window.addEventListener("error", (e) => Te(`window.error: ${e.message} @ ${e.filename ?? "?"}:${e.lineno ?? "?"}:${e.colno ?? "?"}`)), window.addEventListener("unhandledrejection", (e) => Te(`unhandledRejection: ${Tt(e.reason)}`));
3273
+ xt = !0, window.addEventListener("error", (e) => Ce(`window.error: ${e.message} @ ${e.filename ?? "?"}:${e.lineno ?? "?"}:${e.colno ?? "?"}`)), window.addEventListener("unhandledrejection", (e) => Ce(`unhandledRejection: ${Nt(e.reason)}`));
3274
3274
  const t = console;
3275
3275
  for (const e of ["error", "warn", "log", "info"]) {
3276
3276
  const n = t[e]?.bind(console) ?? (() => {
3277
3277
  });
3278
3278
  t[e] = (...r) => {
3279
3279
  try {
3280
- Te(`console.${e}: ${r.map(Tt).join(" ")}`);
3280
+ Ce(`console.${e}: ${r.map(Nt).join(" ")}`);
3281
3281
  } catch {
3282
3282
  }
3283
3283
  n(...r);
3284
3284
  };
3285
3285
  }
3286
3286
  try {
3287
- It((e) => Te(`${e.levelName} [${e.component}] ${e.message}`), { minLevel: We.DEBUG });
3287
+ Mt((e) => Ce(`${e.levelName} [${e.component}] ${e.message}`), { minLevel: Xe.DEBUG });
3288
3288
  } catch {
3289
3289
  }
3290
3290
  }
3291
- Xt && qt();
3292
- function Jo() {
3291
+ en && nn();
3292
+ function ss() {
3293
3293
  let t = !1;
3294
3294
  try {
3295
3295
  const e = URL.createObjectURL(new Blob([""]));
@@ -3300,11 +3300,11 @@ function Jo() {
3300
3300
  }
3301
3301
  return t;
3302
3302
  }
3303
- function Zo() {
3303
+ function is() {
3304
3304
  const t = globalThis;
3305
3305
  return [
3306
3306
  `Worker=${typeof Worker < "u"}`,
3307
- `moduleWorker=${Jo()}`,
3307
+ `moduleWorker=${ss()}`,
3308
3308
  `WebSocket=${typeof WebSocket < "u"}`,
3309
3309
  `WebTransport=${typeof t.WebTransport < "u"}`,
3310
3310
  `RTCPeerConnection=${typeof RTCPeerConnection < "u"}`,
@@ -3317,15 +3317,15 @@ function Zo() {
3317
3317
  `online=${typeof navigator < "u" ? navigator.onLine : "?"}`
3318
3318
  ].join(" ");
3319
3319
  }
3320
- function Qo(t) {
3320
+ function as(t) {
3321
3321
  return /ERROR|error:|Rejection/.test(t) ? "#f88" : /WARN|warn:/.test(t) ? "#fc6" : "#9d9";
3322
3322
  }
3323
- function Jt({ state: t = "", forceVisible: e = !1 }) {
3324
- const n = Xt || e, r = t === "connected" || t === "reconnecting", [, o] = cn((l) => l + 1, 0), [s, i] = N(!0);
3325
- if (_(() => {
3323
+ function rn({ state: t = "", forceVisible: e = !1 }) {
3324
+ const n = en || e, r = t === "connected" || t === "reconnecting", [, o] = yn((l) => l + 1, 0), [s, i] = x(!0);
3325
+ if (C(() => {
3326
3326
  if (!n)
3327
3327
  return;
3328
- qt();
3328
+ nn();
3329
3329
  const l = setInterval(o, 1e3);
3330
3330
  return () => clearInterval(l);
3331
3331
  }, [n]), !n)
@@ -3339,7 +3339,7 @@ function Jt({ state: t = "", forceVisible: e = !1 }) {
3339
3339
  style: { position: "fixed", bottom: 8, left: 8, zIndex: 2147483647, background: "#000", color: "#0f0", font: "13px monospace", padding: "6px 10px", border: "1px solid #0f0", borderRadius: 6 },
3340
3340
  children: [
3341
3341
  "🐞 debug (",
3342
- te.length,
3342
+ oe.length,
3343
3343
  ")"
3344
3344
  ]
3345
3345
  }
@@ -3350,20 +3350,20 @@ function Jt({ state: t = "", forceVisible: e = !1 }) {
3350
3350
  "Ikon debug overlay — state: ",
3351
3351
  t || "?",
3352
3352
  ", +",
3353
- Math.round((Date.now() - Ht) / 1e3),
3353
+ Math.round((Date.now() - tn) / 1e3),
3354
3354
  "s, ",
3355
- te.length,
3355
+ oe.length,
3356
3356
  " entries",
3357
3357
  r && /* @__PURE__ */ S.jsx("button", { type: "button", onClick: () => i(!0), style: { marginLeft: 12, font: "12px monospace", background: "#0f0", color: "#000", border: "none", borderRadius: 4, padding: "2px 8px" }, children: "hide" })
3358
3358
  ] }),
3359
3359
  /* @__PURE__ */ S.jsx("div", { style: { color: "#9cf", wordBreak: "break-all", marginBottom: "4px" }, children: typeof window < "u" ? window.location.href : "" }),
3360
3360
  /* @__PURE__ */ S.jsx("div", { style: { color: "#ff0", wordBreak: "break-all", marginBottom: "4px" }, children: typeof navigator < "u" ? navigator.userAgent : "no navigator" }),
3361
- /* @__PURE__ */ S.jsx("div", { style: { color: "#8cf", marginBottom: "4px" }, children: Zo() }),
3361
+ /* @__PURE__ */ S.jsx("div", { style: { color: "#8cf", marginBottom: "4px" }, children: is() }),
3362
3362
  /* @__PURE__ */ S.jsx("div", { style: { color: "#8cf", marginBottom: "10px" }, children: typeof window < "u" ? `viewport=${window.innerWidth}x${window.innerHeight} dpr=${window.devicePixelRatio}` : "" }),
3363
- /* @__PURE__ */ S.jsx("div", { children: te.length === 0 ? "(nothing captured yet)" : te.map((l, d) => /* @__PURE__ */ S.jsx("div", { style: { color: Qo(l), wordBreak: "break-all" }, children: l }, d)) })
3363
+ /* @__PURE__ */ S.jsx("div", { children: oe.length === 0 ? "(nothing captured yet)" : oe.map((l, f) => /* @__PURE__ */ S.jsx("div", { style: { color: as(l), wordBreak: "break-all" }, children: l }, f)) })
3364
3364
  ] });
3365
3365
  }
3366
- function Us({
3366
+ function Ks({
3367
3367
  connectionState: t,
3368
3368
  error: e,
3369
3369
  isReady: n,
@@ -3375,34 +3375,34 @@ function Us({
3375
3375
  // renderIdle prop is intentionally accepted but never invoked — the runtime no longer
3376
3376
  // emits the deprecated 'idle' state. Kept on the props for source compatibility.
3377
3377
  renderIdle: l,
3378
- renderConnecting: d,
3379
- renderConnectingSlow: h,
3380
- renderConnected: p,
3381
- renderOffline: m,
3378
+ renderConnecting: f,
3379
+ renderConnectingSlow: p,
3380
+ renderConnected: y,
3381
+ renderOffline: u,
3382
3382
  renderError: c
3383
3383
  }) {
3384
- const u = A(!1), y = (() => {
3384
+ const d = v(!1), m = (() => {
3385
3385
  switch (t) {
3386
3386
  case "waitingForExternalConnectUrl":
3387
3387
  case "connecting":
3388
- return r ? h() : d();
3388
+ return r ? p() : f();
3389
3389
  case "connected":
3390
3390
  case "reconnecting": {
3391
3391
  if (!n || !o || !s) return null;
3392
- t === "reconnecting" && (u.current = !0);
3392
+ t === "reconnecting" && (d.current = !0);
3393
3393
  const g = o.size > 0;
3394
- return g && (u.current = !1), p({
3394
+ return g && (d.current = !1), y({
3395
3395
  stores: o,
3396
3396
  registry: s,
3397
3397
  client: i,
3398
3398
  onAction: a,
3399
- isReconnecting: t === "reconnecting" || u.current && !g
3399
+ isReconnecting: t === "reconnecting" || d.current && !g
3400
3400
  });
3401
3401
  }
3402
3402
  case "offline": {
3403
- u.current = !1;
3403
+ d.current = !1;
3404
3404
  const g = e ?? i?.lastError?.message ?? null;
3405
- return g ? c(g) : m();
3405
+ return g ? c(g) : u();
3406
3406
  }
3407
3407
  // 'idle' / 'connectingSlow' / 'offlineError' remain in the type union for back-compat
3408
3408
  // string-equality checks in caller code but are no longer emitted — no case needed.
@@ -3411,163 +3411,165 @@ function Us({
3411
3411
  }
3412
3412
  })();
3413
3413
  return /* @__PURE__ */ S.jsxs(S.Fragment, { children: [
3414
- y,
3415
- /* @__PURE__ */ S.jsx(Jt, { state: t })
3414
+ m,
3415
+ /* @__PURE__ */ S.jsx(rn, { state: t })
3416
3416
  ] });
3417
3417
  }
3418
- const ke = ne("useIkonApp");
3419
- function es() {
3418
+ const _e = se("useIkonApp");
3419
+ function cs() {
3420
3420
  if (typeof window < "u" && window.__IKON_AUTH_CONFIG__)
3421
3421
  return window.__IKON_AUTH_CONFIG__;
3422
3422
  }
3423
- function ts() {
3423
+ function ls() {
3424
3424
  if (typeof window < "u" && window.__IKON_LOCAL_IKON_SERVER_CONFIG__)
3425
3425
  return window.__IKON_LOCAL_IKON_SERVER_CONFIG__;
3426
3426
  }
3427
- function js(t) {
3428
- const { authConfig: e, modules: n, timeouts: r, backgroundAudio: o, webRtc: s, audio: i, video: a, websocket: l, webtransport: d, proxy: h } = t, p = e === void 0 ? es() ?? null : e, m = ts(), c = Ho(), u = A(null), y = A(null), g = A(null), b = A(!1), w = A(!1), v = A(o), E = A(r), T = A(s), M = A(i), Q = A(a), re = A(l), q = A(d), I = A(h);
3429
- v.current = o, E.current = r, T.current = s, M.current = i, Q.current = a, re.current = l, q.current = d, I.current = h;
3430
- const [x, $] = N("connecting"), [V, B] = N(!1), [K, G] = N(null), [we, Se] = N(null), [Ee, ve] = N(!1), [f, R] = N(null), [C, P] = N(null), ee = A(!1), [le, L] = N(0), U = W(() => {
3427
+ function Gs(t) {
3428
+ const { authConfig: e, modules: n, timeouts: r, backgroundAudio: o, webRtc: s, audio: i, video: a, websocket: l, webtransport: f, proxy: p, uiCache: y } = t, u = e === void 0 ? cs() ?? null : e, c = ls(), d = rs(), m = v(null), g = v(null), b = v(null), w = v(!1), R = v(!1), E = v(o), T = v(r), M = v(s), J = v(i), Q = v(a), X = v(l), _ = v(f), L = v(p), U = v(y), F = v("local"), B = v(void 0);
3429
+ E.current = o, T.current = r, M.current = s, J.current = i, Q.current = a, X.current = l, _.current = f, L.current = p, U.current = y;
3430
+ const [$, K] = x("connecting"), [ve, de] = x(!1), [Re, fe] = x(null), [h, A] = x(null), [N, P] = x(!1), [ee, he] = x(null), [O, Z] = x(null), te = v(!1), [Me, sn] = x(0), G = W(() => {
3431
3431
  try {
3432
- const O = hn();
3433
- return (O.sessionId || O.channelKey) && pn(), O;
3432
+ const I = vn();
3433
+ return (I.sessionId || I.channelKey) && Rn(), I;
3434
3434
  } catch {
3435
3435
  return { parameters: {} };
3436
3436
  }
3437
- }, []), X = W(() => p?.enabled ? Ft() : null, [p?.enabled, le]), ue = m?.enabled ?? !1, Pe = m?.host ?? "localhost", Le = m?.port ?? 8443;
3438
- !ue && ot() && p && !p.enabled && p.spaceId && !C && !ee.current && (ee.current = !0, ye(p.authUrl).then((O) => Wt(p.spaceId, O)).then((O) => {
3439
- P(O.token);
3440
- }).catch((O) => {
3441
- ke.error("Anonymous auth failed:", O), G(O instanceof Error ? O.message : "Anonymous auth failed"), ee.current = !1;
3437
+ }, []);
3438
+ pn();
3439
+ const ne = W(() => u?.enabled ? zt() : null, [u?.enabled, Me]), Ue = c?.enabled ?? !1, je = c?.host ?? "localhost", De = c?.port ?? 8443;
3440
+ !Ue && lt() && u && !u.enabled && u.spaceId && !O && !te.current && (te.current = !0, Se(u.authUrl).then((I) => Ht(u.spaceId, I)).then((I) => {
3441
+ Z(I.token);
3442
+ }).catch((I) => {
3443
+ _e.error("Anonymous auth failed:", I), fe(I instanceof Error ? I.message : "Anonymous auth failed"), te.current = !1;
3442
3444
  }));
3443
- const Me = W(() => {
3444
- if (ue) {
3445
- const O = X?.token ? mn(X.token) ?? void 0 : void 0;
3445
+ const $e = W(() => {
3446
+ if (Ue) {
3447
+ const I = ne?.token ? ut(ne.token) ?? void 0 : void 0;
3446
3448
  return {
3447
3449
  local: {
3448
- host: Pe,
3449
- httpsPort: Le,
3450
- userId: O,
3451
- token: X?.token ?? void 0,
3452
- spaceId: p?.spaceId,
3453
- backendUrl: p?.backendUrl,
3454
- authUrl: p?.authUrl,
3455
- parameters: U.parameters
3450
+ host: je,
3451
+ httpsPort: De,
3452
+ userId: I,
3453
+ token: ne?.token ?? void 0,
3454
+ spaceId: u?.spaceId,
3455
+ backendUrl: u?.backendUrl,
3456
+ authUrl: u?.authUrl,
3457
+ parameters: G.parameters
3456
3458
  }
3457
3459
  };
3458
3460
  }
3459
- return X?.token && p?.spaceId ? {
3461
+ return ne?.token && u?.spaceId ? {
3460
3462
  sessionToken: {
3461
- token: X.token,
3462
- spaceId: p.spaceId,
3463
- backendType: st(),
3464
- sessionId: U.sessionId,
3465
- channelKey: U.channelKey,
3466
- parameters: U.parameters
3463
+ token: ne.token,
3464
+ spaceId: u.spaceId,
3465
+ backendType: dt(),
3466
+ sessionId: G.sessionId,
3467
+ channelKey: G.channelKey,
3468
+ parameters: G.parameters
3467
3469
  }
3468
- } : C && p?.spaceId ? {
3470
+ } : O && u?.spaceId ? {
3469
3471
  sessionToken: {
3470
- token: C,
3471
- spaceId: p.spaceId,
3472
- backendType: st(),
3473
- sessionId: U.sessionId,
3474
- channelKey: U.channelKey,
3475
- parameters: U.parameters
3472
+ token: O,
3473
+ spaceId: u.spaceId,
3474
+ backendType: dt(),
3475
+ sessionId: G.sessionId,
3476
+ channelKey: G.channelKey,
3477
+ parameters: G.parameters
3476
3478
  }
3477
- } : ot() ? null : {
3479
+ } : lt() ? null : {
3478
3480
  local: {
3479
- host: Pe,
3480
- httpsPort: Le,
3481
- spaceId: p?.spaceId,
3482
- backendUrl: p?.backendUrl,
3483
- authUrl: p?.authUrl,
3484
- parameters: U.parameters
3481
+ host: je,
3482
+ httpsPort: De,
3483
+ spaceId: u?.spaceId,
3484
+ backendUrl: u?.backendUrl,
3485
+ authUrl: u?.authUrl,
3486
+ parameters: G.parameters
3485
3487
  }
3486
3488
  };
3487
- }, [ue, Pe, Le, X?.token, p?.spaceId, p?.backendUrl, p?.authUrl, C, U.sessionId, U.channelKey, U.parameters]);
3488
- Dr(f);
3489
- const Qt = Br(f);
3490
- _(() => {
3491
- if (!b.current) {
3492
- if (b.current = !0, g.current = Or(), n)
3493
- for (const O of n)
3494
- O(g.current);
3495
- g.current.loadRegisteredModules().catch((O) => {
3496
- ke.error("Failed to load UI modules", O);
3489
+ }, [Ue, je, De, ne?.token, u?.spaceId, u?.backendUrl, u?.authUrl, O, G.sessionId, G.channelKey, G.parameters]);
3490
+ F.current = u?.spaceId ?? "local", B.current = ne?.token ?? O ?? void 0, Yr(ee);
3491
+ const an = Xr(ee);
3492
+ C(() => {
3493
+ if (!w.current) {
3494
+ if (w.current = !0, b.current = Dr(), n)
3495
+ for (const I of n)
3496
+ I(b.current);
3497
+ b.current.loadRegisteredModules().catch((I) => {
3498
+ _e.error("Failed to load UI modules", I);
3497
3499
  });
3498
3500
  }
3499
- }, []), _(() => {
3500
- if (!Me) return;
3501
- const O = new gn({
3502
- ...Me,
3503
- timeouts: E.current,
3504
- audio: M.current !== void 0 || v.current ? {
3505
- enabled: M.current,
3506
- ...v.current ? { background: { allowOnDesktop: !0, allowOnMobile: !0 } } : {}
3501
+ }, []), C(() => {
3502
+ if (!$e) return;
3503
+ const I = new An({
3504
+ ...$e,
3505
+ timeouts: T.current,
3506
+ audio: J.current !== void 0 || E.current ? {
3507
+ enabled: J.current,
3508
+ ...E.current ? { background: { allowOnDesktop: !0, allowOnMobile: !0 } } : {}
3507
3509
  } : void 0,
3508
3510
  video: Q.current !== void 0 ? { enabled: Q.current } : void 0,
3509
3511
  mediaSession: { title: document.title || void 0, artist: document.title || void 0 },
3510
- webRtc: T.current === !1 ? { enabled: !1 } : void 0,
3511
- websocket: re.current,
3512
- webtransport: q.current,
3513
- proxy: I.current,
3514
- onConnectionStateChange: (Y) => {
3515
- $(Y);
3512
+ webRtc: M.current === !1 ? { enabled: !1 } : void 0,
3513
+ websocket: X.current,
3514
+ webtransport: _.current,
3515
+ proxy: L.current,
3516
+ onConnectionStateChange: (H) => {
3517
+ K(H);
3516
3518
  },
3517
- onError: (Y) => {
3518
- G(Y.message);
3519
+ onError: (H) => {
3520
+ fe(H.message);
3519
3521
  }
3520
3522
  });
3521
- u.current = O;
3522
- const J = new Dn({ client: O });
3523
- return y.current = J, R(J), O.connect().catch((Y) => {
3524
- if (ke.error("Connection failed:", Y), Y instanceof yn) {
3525
- Se(Y.reason);
3523
+ m.current = I;
3524
+ const re = U.current ?? !0, Ae = B.current, un = re ? { enabled: !0, appId: F.current, userId: Ae ? ut(Ae) ?? null : null } : void 0, Be = new Yn({ client: I, cache: un });
3525
+ return g.current = Be, he(Be), I.connect().catch((H) => {
3526
+ if (_e.error("Connection failed:", H), H instanceof Tn) {
3527
+ A(H.reason);
3526
3528
  return;
3527
3529
  }
3528
- if (Y instanceof bn) {
3529
- ve(!0);
3530
+ if (H instanceof kn) {
3531
+ P(!0);
3530
3532
  return;
3531
3533
  }
3532
- Y instanceof wn && !w.current && (w.current = !0, ke.warn("Auth session appears stale, clearing and retrying"), c ? c.logout() : (Oe(), L((nn) => nn + 1)));
3534
+ H instanceof Cn && !R.current && (R.current = !0, _e.warn("Auth session appears stale, clearing and retrying"), d ? d.logout() : (xe(), sn((dn) => dn + 1)));
3533
3535
  }), () => {
3534
- O.disconnect(), u.current = null, J.dispose(), y.current = null;
3536
+ I.disconnect(), m.current = null, Be.dispose(), g.current = null;
3535
3537
  };
3536
- }, [Me]);
3537
- const en = D((O, J) => {
3538
- const Y = typeof J == "string" ? J : JSON.stringify(J ?? {});
3539
- u.current?.sendActionCall(O, Y);
3538
+ }, [$e]);
3539
+ const cn = D((I, re) => {
3540
+ const Ae = typeof re == "string" ? re : JSON.stringify(re ?? {});
3541
+ m.current?.sendActionCall(I, Ae);
3540
3542
  }, []);
3541
- _(() => {
3542
- if (x !== "connecting") {
3543
- B(!1);
3543
+ C(() => {
3544
+ if ($ !== "connecting") {
3545
+ de(!1);
3544
3546
  return;
3545
3547
  }
3546
- const O = u.current?.slowConnectionThresholdMs ?? 5e3, J = setTimeout(() => B(!0), O);
3547
- return () => clearTimeout(J);
3548
- }, [x]);
3549
- const tn = x === "connected" || x === "reconnecting";
3548
+ const I = m.current?.slowConnectionThresholdMs ?? 5e3, re = setTimeout(() => de(!0), I);
3549
+ return () => clearTimeout(re);
3550
+ }, [$]);
3551
+ const ln = $ === "connected" || $ === "reconnecting";
3550
3552
  return {
3551
- connectionState: x,
3552
- error: K,
3553
- accessDeniedReason: we,
3554
- isServerFull: Ee,
3555
- stores: Qt,
3556
- client: u.current,
3557
- registry: g.current,
3558
- clientRef: u,
3559
- uiRef: y,
3560
- registryRef: g,
3561
- onAction: en,
3562
- isReady: tn,
3563
- brandingRequired: u.current?.brandingRequired ?? !1,
3564
- isConnectingSlow: V,
3565
- webRtcVideoStreams: u.current?.webRtcVideoStreams ?? /* @__PURE__ */ new Map(),
3566
- webRtcTrackMap: u.current?.webRtcTrackMap ?? /* @__PURE__ */ new Map()
3553
+ connectionState: $,
3554
+ error: Re,
3555
+ accessDeniedReason: h,
3556
+ isServerFull: N,
3557
+ stores: an,
3558
+ client: m.current,
3559
+ registry: b.current,
3560
+ clientRef: m,
3561
+ uiRef: g,
3562
+ registryRef: b,
3563
+ onAction: cn,
3564
+ isReady: ln,
3565
+ brandingRequired: m.current?.brandingRequired ?? !1,
3566
+ isConnectingSlow: ve,
3567
+ webRtcVideoStreams: m.current?.webRtcVideoStreams ?? /* @__PURE__ */ new Map(),
3568
+ webRtcTrackMap: m.current?.webRtcTrackMap ?? /* @__PURE__ */ new Map()
3567
3569
  };
3568
3570
  }
3569
- function Ds(t) {
3570
- const e = A(!1);
3571
+ function Ys(t) {
3572
+ const e = v(!1);
3571
3573
  return D(() => {
3572
3574
  if (e.current) return;
3573
3575
  e.current = !0;
@@ -3575,30 +3577,30 @@ function Ds(t) {
3575
3577
  n.rel = "stylesheet", n.href = t, document.head.appendChild(n);
3576
3578
  }, [t]);
3577
3579
  }
3578
- let ns = 0;
3579
- function rs(t = 5, e = 5e3) {
3580
- const [n, r] = N([]), o = A(/* @__PURE__ */ new Map()), s = D((i) => {
3580
+ let us = 0;
3581
+ function ds(t = 5, e = 5e3) {
3582
+ const [n, r] = x([]), o = v(/* @__PURE__ */ new Map()), s = D((i) => {
3581
3583
  const a = o.current.get(i);
3582
- a && (clearTimeout(a), o.current.delete(i)), r((l) => l.filter((d) => d.id !== i));
3584
+ a && (clearTimeout(a), o.current.delete(i)), r((l) => l.filter((f) => f.id !== i));
3583
3585
  }, []);
3584
- return _(() => {
3585
- const i = o.current, a = It(
3586
+ return C(() => {
3587
+ const i = o.current, a = Mt(
3586
3588
  (l) => {
3587
- if (!Ot())
3589
+ if (!Ut())
3588
3590
  return;
3589
- const d = `toast-${++ns}`, h = l.level === We.ERROR ? "error" : "warn", p = {
3590
- id: d,
3591
- level: h,
3591
+ const f = `toast-${++us}`, p = l.level === Xe.ERROR ? "error" : "warn", y = {
3592
+ id: f,
3593
+ level: p,
3592
3594
  message: l.message,
3593
3595
  component: l.component
3594
3596
  };
3595
- r((c) => [...c, p].slice(-t));
3596
- const m = setTimeout(() => {
3597
- s(d);
3597
+ r((c) => [...c, y].slice(-t));
3598
+ const u = setTimeout(() => {
3599
+ s(f);
3598
3600
  }, e);
3599
- i.set(d, m);
3601
+ i.set(f, u);
3600
3602
  },
3601
- { minLevel: We.WARN }
3603
+ { minLevel: Xe.WARN }
3602
3604
  );
3603
3605
  return () => {
3604
3606
  a();
@@ -3608,9 +3610,9 @@ function rs(t = 5, e = 5e3) {
3608
3610
  };
3609
3611
  }, [t, e, s]), { toasts: n, dismissToast: s };
3610
3612
  }
3611
- function os(t, e, n) {
3612
- const [r, o] = N(n);
3613
- return _(() => {
3613
+ function fs(t, e, n) {
3614
+ const [r, o] = x(n);
3615
+ return C(() => {
3614
3616
  if (!t)
3615
3617
  return;
3616
3618
  let s = !0, i = null;
@@ -3625,9 +3627,9 @@ function os(t, e, n) {
3625
3627
  };
3626
3628
  }, [t, e]), r;
3627
3629
  }
3628
- function $s(t, e, n) {
3629
- const [r, o] = N(null);
3630
- return _(() => {
3630
+ function zs(t, e, n) {
3631
+ const [r, o] = x(null);
3632
+ return C(() => {
3631
3633
  if (!t)
3632
3634
  return;
3633
3635
  let s = !0;
@@ -3638,102 +3640,102 @@ function $s(t, e, n) {
3638
3640
  }), () => {
3639
3641
  s = !1;
3640
3642
  };
3641
- }, [t, e]), os(r ? t : null, r ?? "", n);
3643
+ }, [t, e]), fs(r ? t : null, r ?? "", n);
3642
3644
  }
3643
- const ie = ne("IkonDebug"), ss = {
3645
+ const ce = se("IkonDebug"), hs = {
3644
3646
  Digit1: "connecting",
3645
3647
  Digit2: "connected",
3646
3648
  Digit3: "reconnecting",
3647
3649
  Digit4: "offline",
3648
3650
  Digit5: "offline",
3649
3651
  Digit0: "clear"
3650
- }, is = "Digit5", as = "Digit6", cs = "Synthetic debug error (Ctrl+Shift+5)", ls = "Synthetic debug access-denied (Ctrl+Shift+6)", us = 5e3;
3651
- function ds(t) {
3652
- const e = Ot(), [n, r] = N(null), [o, s] = N(!1), [i, a] = N(null), [l, d] = N(null), [h, p] = N(!1), [m, c] = N(!1), [u, y] = N(!1);
3653
- return _(() => {
3652
+ }, ps = "Digit5", ms = "Digit6", gs = "Synthetic debug error (Ctrl+Shift+5)", ys = "Synthetic debug access-denied (Ctrl+Shift+6)", bs = 5e3;
3653
+ function ws(t) {
3654
+ const e = Ut(), [n, r] = x(null), [o, s] = x(!1), [i, a] = x(null), [l, f] = x(null), [p, y] = x(!1), [u, c] = x(!1), [d, m] = x(!1);
3655
+ return C(() => {
3654
3656
  if (!e)
3655
3657
  return;
3656
3658
  const b = (w) => {
3657
3659
  if (!w.ctrlKey || !w.shiftKey)
3658
3660
  return;
3659
3661
  if (w.code === "KeyE") {
3660
- w.preventDefault(), p((T) => (ie.warn(`Empty-stores override: ${T ? "off" : "on"}`), !T));
3662
+ w.preventDefault(), y((T) => (ce.warn(`Empty-stores override: ${T ? "off" : "on"}`), !T));
3661
3663
  return;
3662
3664
  }
3663
3665
  if (w.code === "Digit7") {
3664
- w.preventDefault(), c((T) => (ie.warn(`Branding-banner override: ${T ? "off" : "on"}`), !T));
3666
+ w.preventDefault(), c((T) => (ce.warn(`Branding-banner override: ${T ? "off" : "on"}`), !T));
3665
3667
  return;
3666
3668
  }
3667
3669
  if (w.code === "Digit8") {
3668
- w.preventDefault(), y((T) => (ie.warn(`Debug-overlay override: ${T ? "off" : "on"}`), !T));
3670
+ w.preventDefault(), m((T) => (ce.warn(`Debug-overlay override: ${T ? "off" : "on"}`), !T));
3669
3671
  return;
3670
3672
  }
3671
- if (w.code === as) {
3672
- w.preventDefault(), d(ls), r(null), a(null), ie.warn("Forced access denied");
3673
+ if (w.code === ms) {
3674
+ w.preventDefault(), f(ys), r(null), a(null), ce.warn("Forced access denied");
3673
3675
  return;
3674
3676
  }
3675
- const v = ss[w.code];
3676
- if (v === void 0)
3677
+ const R = hs[w.code];
3678
+ if (R === void 0)
3677
3679
  return;
3678
- if (w.preventDefault(), v === "clear") {
3679
- r(null), a(null), d(null), ie.warn("Cleared forced state");
3680
+ if (w.preventDefault(), R === "clear") {
3681
+ r(null), a(null), f(null), ce.warn("Cleared forced state");
3680
3682
  return;
3681
3683
  }
3682
- const E = w.code === is;
3683
- r(v), a(E ? cs : null), d(null), ie.warn(`Forced state: ${v}${E ? " (with error)" : ""}`);
3684
+ const E = w.code === ps;
3685
+ r(R), a(E ? gs : null), f(null), ce.warn(`Forced state: ${R}${E ? " (with error)" : ""}`);
3684
3686
  };
3685
3687
  return window.addEventListener("keydown", b), () => window.removeEventListener("keydown", b);
3686
- }, [e]), _(() => {
3688
+ }, [e]), C(() => {
3687
3689
  if (n !== "connecting") {
3688
3690
  s(!1);
3689
3691
  return;
3690
3692
  }
3691
- const b = setTimeout(() => s(!0), us);
3693
+ const b = setTimeout(() => s(!0), bs);
3692
3694
  return () => clearTimeout(b);
3693
- }, [n]), !e || n === null && !h && l === null && !m && !u ? { app: t, forcedState: null, emptyStores: !1, forcedError: null, forcedAccessDenied: null, forcedBranding: !1, forcedDebugOverlay: !1, debugEnabled: e } : { app: {
3695
+ }, [n]), !e || n === null && !p && l === null && !u && !d ? { app: t, forcedState: null, emptyStores: !1, forcedError: null, forcedAccessDenied: null, forcedBranding: !1, forcedDebugOverlay: !1, debugEnabled: e } : { app: {
3694
3696
  ...t,
3695
3697
  connectionState: n ?? t.connectionState,
3696
3698
  isConnectingSlow: n === "connecting" ? o : t.isConnectingSlow,
3697
3699
  error: n === "offline" && i ? i : n ? null : t.error,
3698
- stores: h ? /* @__PURE__ */ new Map() : t.stores,
3700
+ stores: p ? /* @__PURE__ */ new Map() : t.stores,
3699
3701
  accessDeniedReason: l ?? t.accessDeniedReason
3700
- }, forcedState: n, emptyStores: h, forcedError: i, forcedAccessDenied: l, forcedBranding: m, forcedDebugOverlay: u, debugEnabled: e };
3702
+ }, forcedState: n, emptyStores: p, forcedError: i, forcedAccessDenied: l, forcedBranding: u, forcedDebugOverlay: d, debugEnabled: e };
3701
3703
  }
3702
- function fs(t, e) {
3704
+ function Ss(t, e) {
3703
3705
  return t === void 0 ? null : typeof t == "function" ? t(e) : t;
3704
3706
  }
3705
- function hs(t) {
3707
+ function Es(t) {
3706
3708
  return t === void 0 ? null : typeof t == "function" ? t() : t;
3707
3709
  }
3708
- function ps(t, e) {
3710
+ function vs(t, e) {
3709
3711
  return t === void 0 ? null : typeof t == "function" ? t(e) : t;
3710
3712
  }
3711
- function ms(t, e) {
3713
+ function Rs(t, e) {
3712
3714
  return t === void 0 ? null : typeof t == "function" ? t(e) : t;
3713
3715
  }
3714
- function Bs(t) {
3715
- const { connectingOverlay: e, reconnectingOverlay: n, offlineOverlay: r, accessDeniedScreen: o, ...s } = t, i = ds(s), { app: a } = i, { connectionState: l, isConnectingSlow: d, stores: h, registry: p, client: m, onAction: c, isReady: u, error: y, accessDeniedReason: g, brandingRequired: b } = a, w = b || i.forcedBranding, v = A(null);
3716
- if (u && h && p && (v.current = { stores: h, registry: p, client: m }), g)
3717
- return ms(o, g);
3718
- const E = v.current;
3716
+ function Xs(t) {
3717
+ const { connectingOverlay: e, reconnectingOverlay: n, offlineOverlay: r, accessDeniedScreen: o, ...s } = t, i = ws(s), { app: a } = i, { connectionState: l, isConnectingSlow: f, stores: p, registry: y, client: u, onAction: c, isReady: d, error: m, accessDeniedReason: g, brandingRequired: b } = a, w = b || i.forcedBranding, R = v(null);
3718
+ if (p && y && (d || p.size > 0) && (R.current = { stores: p, registry: y, client: u }), g)
3719
+ return Rs(o, g);
3720
+ const E = R.current;
3719
3721
  let T = null;
3720
3722
  switch (l) {
3721
3723
  case "waitingForExternalConnectUrl":
3722
3724
  case "connecting":
3723
- T = fs(e, d);
3725
+ T = Ss(e, f);
3724
3726
  break;
3725
3727
  case "reconnecting":
3726
- T = hs(n);
3728
+ T = Es(n);
3727
3729
  break;
3728
3730
  case "offline":
3729
- T = ps(r, y);
3731
+ T = vs(r, m);
3730
3732
  break;
3731
3733
  default:
3732
3734
  T = null;
3733
3735
  }
3734
3736
  return /* @__PURE__ */ S.jsxs(S.Fragment, { children: [
3735
3737
  E && /* @__PURE__ */ S.jsx(
3736
- Nt,
3738
+ jt,
3737
3739
  {
3738
3740
  stores: E.stores,
3739
3741
  registry: E.registry,
@@ -3742,18 +3744,18 @@ function Bs(t) {
3742
3744
  }
3743
3745
  ),
3744
3746
  T,
3745
- w && /* @__PURE__ */ S.jsx(ys, {}),
3746
- /* @__PURE__ */ S.jsx(bs, {}),
3747
- /* @__PURE__ */ S.jsx(Jt, { state: l, forceVisible: i.forcedDebugOverlay })
3747
+ w && /* @__PURE__ */ S.jsx(Ts, {}),
3748
+ /* @__PURE__ */ S.jsx(ks, {}),
3749
+ /* @__PURE__ */ S.jsx(rn, { state: l, forceVisible: i.forcedDebugOverlay })
3748
3750
  ] });
3749
3751
  }
3750
- const gs = "https://ikonai.com";
3751
- function ys() {
3752
+ const As = "https://ikonai.com";
3753
+ function Ts() {
3752
3754
  return /* @__PURE__ */ S.jsxs(
3753
3755
  "a",
3754
3756
  {
3755
3757
  className: "ikon-branding-banner",
3756
- href: gs,
3758
+ href: As,
3757
3759
  target: "_blank",
3758
3760
  rel: "noopener noreferrer",
3759
3761
  style: {
@@ -3781,11 +3783,11 @@ function ys() {
3781
3783
  }
3782
3784
  );
3783
3785
  }
3784
- function bs() {
3785
- const { toasts: t, dismissToast: e } = rs();
3786
- return t.length === 0 ? null : /* @__PURE__ */ S.jsx("div", { className: "ikon-toast-overlay", children: t.map((n) => /* @__PURE__ */ S.jsx(ws, { toast: n, onDismiss: e }, n.id)) });
3786
+ function ks() {
3787
+ const { toasts: t, dismissToast: e } = ds();
3788
+ return t.length === 0 ? null : /* @__PURE__ */ S.jsx("div", { className: "ikon-toast-overlay", children: t.map((n) => /* @__PURE__ */ S.jsx(Cs, { toast: n, onDismiss: e }, n.id)) });
3787
3789
  }
3788
- function ws({ toast: t, onDismiss: e }) {
3790
+ function Cs({ toast: t, onDismiss: e }) {
3789
3791
  return /* @__PURE__ */ S.jsxs(
3790
3792
  "div",
3791
3793
  {
@@ -3806,110 +3808,110 @@ function ws({ toast: t, onDismiss: e }) {
3806
3808
  }
3807
3809
  );
3808
3810
  }
3809
- const Zt = Ct(null);
3810
- function Ss(t, e) {
3811
+ const on = Pt(null);
3812
+ function _s(t, e) {
3811
3813
  return e ? t.replace(/\{(\w+)\}/g, (n, r) => e[r] ?? `{${r}}`) : t;
3812
3814
  }
3813
- function Es(t, e) {
3814
- const n = Sn();
3815
+ function Is(t, e) {
3816
+ const n = _n();
3815
3817
  if (n && t.includes(n))
3816
3818
  return n;
3817
3819
  const r = navigator.language.split("-")[0];
3818
3820
  return t.includes(r) ? r : e && t.includes(e) ? e : "en";
3819
3821
  }
3820
- function vs(t, e, n) {
3821
- return e ? Es(t, n) : n && t.includes(n) ? n : "en";
3822
+ function Os(t, e, n) {
3823
+ return e ? Is(t, n) : n && t.includes(n) ? n : "en";
3822
3824
  }
3823
- function Fs({
3825
+ function Hs({
3824
3826
  children: t,
3825
3827
  translations: e,
3826
3828
  defaultLanguage: n,
3827
3829
  detectLanguage: r = !1
3828
3830
  }) {
3829
- const o = Object.keys(e), s = vs(o, r, n), i = e[s] ?? e.en, a = W(
3831
+ const o = Object.keys(e), s = Os(o, r, n), i = e[s] ?? e.en, a = W(
3830
3832
  () => ({
3831
- t: (l, d) => {
3832
- const h = i[l];
3833
- return Ss(h, d);
3833
+ t: (l, f) => {
3834
+ const p = i[l];
3835
+ return _s(p, f);
3834
3836
  },
3835
3837
  locale: s,
3836
3838
  translations: i
3837
3839
  }),
3838
3840
  [i, s]
3839
3841
  );
3840
- return /* @__PURE__ */ S.jsx(Zt, { value: a, children: t });
3842
+ return /* @__PURE__ */ S.jsx(on, { value: a, children: t });
3841
3843
  }
3842
- function Vs() {
3843
- const t = Ze(Zt);
3844
+ function qs() {
3845
+ const t = rt(on);
3844
3846
  if (!t)
3845
3847
  throw new Error("useI18n must be used within an I18nProvider");
3846
3848
  return t;
3847
3849
  }
3848
3850
  export {
3849
- Ls as AuthProvider,
3850
- Us as ConnectionStateRenderer,
3851
- Xt as DEBUG_OVERLAY_ENABLED,
3852
- Jt as DebugOverlay,
3853
- Fs as I18nProvider,
3854
- Zn as IKON_UI_BASE_MODULE,
3855
- ur as IKON_UI_MEDIA_MODULE,
3856
- kr as IKON_UI_SHADERTOY_MODULE,
3857
- Ar as IKON_UI_SHADERTOY_TYPE,
3858
- Ge as IKON_UI_STREAM_CATEGORY,
3859
- sr as IKON_UI_VIDEO_CANVAS_TYPE,
3860
- ir as IKON_UI_VIDEO_URL_PLAYER_TYPE,
3861
- Bs as IkonApp,
3862
- Dn as IkonUi,
3863
- Ir as IkonUiRegistry,
3864
- Nt as IkonUiSurface,
3865
- Mn as InspectOverlay,
3866
- Is as ParallaxView,
3867
- Ln as UiComponentRegistry,
3868
- Pn as UiRenderer,
3869
- Gs as UiStreamStore,
3870
- Os as areIkonUiModuleListsEqual,
3871
- Wt as authenticateAnonymous,
3872
- Mo as buildOAuthRedirectUrl,
3873
- Oe as clearAuthSession,
3874
- At as clearOAuthParams,
3875
- Jn as createBaseResolvers,
3876
- Cs as createComponentLibrary,
3877
- Or as createIkonUiRegistry,
3878
- cr as createMediaResolvers,
3879
- Tr as createShadertoyRendererResolver,
3880
- jn as isIkonUiCategoryMatch,
3881
- Ft as loadAuthSession,
3882
- Qn as loadBaseModule,
3883
- dr as loadMediaModule,
3884
- Cr as loadShadertoyModule,
3885
- ro as normalizeIkonUiModuleList,
3886
- xs as parseIkonUiInitPayload,
3887
- Po as parseOAuthCallback,
3888
- Lo as parseOAuthError,
3889
- zs as randomUuid,
3890
- oo as readIkonUiModules,
3891
- Ns as readIkonUiModulesFromSources,
3892
- er as registerBaseModule,
3893
- fr as registerMediaModule,
3894
- _r as registerShadertoyModule,
3895
- Nn as renderChildren,
3896
- Ps as renderMotionLetters,
3897
- be as saveAuthSession,
3898
- No as sendLoginCode,
3899
- se as sessionToUser,
3900
- Xo as useAuth,
3901
- Ms as useAuthGuard,
3902
- Ho as useAuthOptional,
3903
- Vs as useI18n,
3904
- js as useIkonApp,
3905
- ds as useIkonDebug,
3906
- os as useIkonReactive,
3907
- Dr as useIkonStyles,
3908
- Br as useIkonUiStores,
3909
- Ds as useLazyFont,
3910
- $s as useReactive,
3911
- rs as useToasts,
3912
- Z as useUiNode,
3913
- _s as useUiStore,
3914
- xo as verifyLoginCode
3851
+ Vs as AuthProvider,
3852
+ Ks as ConnectionStateRenderer,
3853
+ en as DEBUG_OVERLAY_ENABLED,
3854
+ rn as DebugOverlay,
3855
+ Hs as I18nProvider,
3856
+ ir as IKON_UI_BASE_MODULE,
3857
+ br as IKON_UI_MEDIA_MODULE,
3858
+ Lr as IKON_UI_SHADERTOY_MODULE,
3859
+ xr as IKON_UI_SHADERTOY_TYPE,
3860
+ qe as IKON_UI_STREAM_CATEGORY,
3861
+ hr as IKON_UI_VIDEO_CANVAS_TYPE,
3862
+ pr as IKON_UI_VIDEO_URL_PLAYER_TYPE,
3863
+ Xs as IkonApp,
3864
+ Yn as IkonUi,
3865
+ jr as IkonUiRegistry,
3866
+ jt as IkonUiSurface,
3867
+ Wn as InspectOverlay,
3868
+ js as ParallaxView,
3869
+ Vn as UiComponentRegistry,
3870
+ Fn as UiRenderer,
3871
+ Qs as UiStreamStore,
3872
+ Ds as areIkonUiModuleListsEqual,
3873
+ Ht as authenticateAnonymous,
3874
+ Wo as buildOAuthRedirectUrl,
3875
+ xe as clearAuthSession,
3876
+ Ot as clearOAuthParams,
3877
+ sr as createBaseResolvers,
3878
+ Ms as createComponentLibrary,
3879
+ Dr as createIkonUiRegistry,
3880
+ gr as createMediaResolvers,
3881
+ Pr as createShadertoyRendererResolver,
3882
+ Gn as isIkonUiCategoryMatch,
3883
+ zt as loadAuthSession,
3884
+ ar as loadBaseModule,
3885
+ wr as loadMediaModule,
3886
+ Mr as loadShadertoyModule,
3887
+ fo as normalizeIkonUiModuleList,
3888
+ Bs as parseIkonUiInitPayload,
3889
+ Fo as parseOAuthCallback,
3890
+ Vo as parseOAuthError,
3891
+ ti as randomUuid,
3892
+ ho as readIkonUiModules,
3893
+ $s as readIkonUiModulesFromSources,
3894
+ cr as registerBaseModule,
3895
+ Sr as registerMediaModule,
3896
+ Ur as registerShadertoyModule,
3897
+ $n as renderChildren,
3898
+ Fs as renderMotionLetters,
3899
+ Ee as saveAuthSession,
3900
+ $o as sendLoginCode,
3901
+ ae as sessionToUser,
3902
+ ns as useAuth,
3903
+ Ws as useAuthGuard,
3904
+ rs as useAuthOptional,
3905
+ qs as useI18n,
3906
+ Gs as useIkonApp,
3907
+ ws as useIkonDebug,
3908
+ fs as useIkonReactive,
3909
+ Yr as useIkonStyles,
3910
+ Xr as useIkonUiStores,
3911
+ Ys as useLazyFont,
3912
+ zs as useReactive,
3913
+ ds as useToasts,
3914
+ q as useUiNode,
3915
+ Us as useUiStore,
3916
+ Bo as verifyLoginCode
3915
3917
  };