@ikonai/sdk-react-ui 1.0.23 → 1.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/use-ikon-app.d.ts +8 -0
- package/index.js +524 -520
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { IkonUiCore as kt, UiStreamStore as Ct } from "@ikonai/sdk-ui";
|
|
2
2
|
import { UiStreamStore as Co } from "@ikonai/sdk-ui";
|
|
3
|
-
import It, { useSyncExternalStore as Ue, useMemo as
|
|
3
|
+
import It, { useSyncExternalStore as Ue, useMemo as $, memo as V, useRef as T, useCallback as x, Fragment as Ot, useEffect as L, useState as G, createContext as lt, use as xe } from "react";
|
|
4
4
|
import { createLogger as pe, getOrCreateDeviceId as _t, deriveAuthUrl as Oe, parseUrlParams as Nt, clearSessionParamsFromUrl as Pt, isCloudEnvironment as Ke, extractUserIdFromToken as jt, deriveBackendType as Ye, IkonClient as Mt, subscribeToLogEvents as Lt, isDebugModeEnabled as Ut, LogLevel as We } from "@ikonai/sdk";
|
|
5
|
-
var le = { exports: {} },
|
|
5
|
+
var le = { exports: {} }, re = {};
|
|
6
6
|
/**
|
|
7
7
|
* @license React
|
|
8
8
|
* react-jsx-runtime.production.js
|
|
@@ -14,7 +14,7 @@ var le = { exports: {} }, ee = {};
|
|
|
14
14
|
*/
|
|
15
15
|
var ze;
|
|
16
16
|
function xt() {
|
|
17
|
-
if (ze) return
|
|
17
|
+
if (ze) return re;
|
|
18
18
|
ze = 1;
|
|
19
19
|
var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
|
|
20
20
|
function r(n, o, s) {
|
|
@@ -32,9 +32,9 @@ function xt() {
|
|
|
32
32
|
props: s
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
return
|
|
35
|
+
return re.Fragment = e, re.jsx = r, re.jsxs = r, re;
|
|
36
36
|
}
|
|
37
|
-
var
|
|
37
|
+
var ne = {};
|
|
38
38
|
/**
|
|
39
39
|
* @license React
|
|
40
40
|
* react-jsx-runtime.development.js
|
|
@@ -47,241 +47,241 @@ var te = {};
|
|
|
47
47
|
var qe;
|
|
48
48
|
function Dt() {
|
|
49
49
|
return qe || (qe = 1, process.env.NODE_ENV !== "production" && function() {
|
|
50
|
-
function t(
|
|
51
|
-
if (
|
|
52
|
-
if (typeof
|
|
53
|
-
return
|
|
54
|
-
if (typeof
|
|
55
|
-
switch (
|
|
50
|
+
function t(d) {
|
|
51
|
+
if (d == null) return null;
|
|
52
|
+
if (typeof d == "function")
|
|
53
|
+
return d.$$typeof === F ? null : d.displayName || d.name || null;
|
|
54
|
+
if (typeof d == "string") return d;
|
|
55
|
+
switch (d) {
|
|
56
56
|
case S:
|
|
57
57
|
return "Fragment";
|
|
58
|
-
case
|
|
58
|
+
case p:
|
|
59
59
|
return "Profiler";
|
|
60
60
|
case m:
|
|
61
61
|
return "StrictMode";
|
|
62
|
-
case
|
|
62
|
+
case D:
|
|
63
63
|
return "Suspense";
|
|
64
|
-
case
|
|
64
|
+
case z:
|
|
65
65
|
return "SuspenseList";
|
|
66
|
-
case
|
|
66
|
+
case I:
|
|
67
67
|
return "Activity";
|
|
68
68
|
}
|
|
69
|
-
if (typeof
|
|
70
|
-
switch (typeof
|
|
69
|
+
if (typeof d == "object")
|
|
70
|
+
switch (typeof d.tag == "number" && console.error(
|
|
71
71
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
72
|
-
),
|
|
72
|
+
), d.$$typeof) {
|
|
73
73
|
case y:
|
|
74
74
|
return "Portal";
|
|
75
|
-
case T:
|
|
76
|
-
return (l.displayName || "Context") + ".Provider";
|
|
77
|
-
case w:
|
|
78
|
-
return (l._context.displayName || "Context") + ".Consumer";
|
|
79
|
-
case O:
|
|
80
|
-
var b = l.render;
|
|
81
|
-
return l = l.displayName, l || (l = b.displayName || b.name || "", l = l !== "" ? "ForwardRef(" + l + ")" : "ForwardRef"), l;
|
|
82
|
-
case J:
|
|
83
|
-
return b = l.displayName || null, b !== null ? b : t(l.type) || "Memo";
|
|
84
75
|
case k:
|
|
85
|
-
|
|
76
|
+
return (d.displayName || "Context") + ".Provider";
|
|
77
|
+
case v:
|
|
78
|
+
return (d._context.displayName || "Context") + ".Consumer";
|
|
79
|
+
case _:
|
|
80
|
+
var w = d.render;
|
|
81
|
+
return d = d.displayName, d || (d = w.displayName || w.name || "", d = d !== "" ? "ForwardRef(" + d + ")" : "ForwardRef"), d;
|
|
82
|
+
case H:
|
|
83
|
+
return w = d.displayName || null, w !== null ? w : t(d.type) || "Memo";
|
|
84
|
+
case C:
|
|
85
|
+
w = d._payload, d = d._init;
|
|
86
86
|
try {
|
|
87
|
-
return t(
|
|
87
|
+
return t(d(w));
|
|
88
88
|
} catch {
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
return null;
|
|
92
92
|
}
|
|
93
|
-
function e(
|
|
94
|
-
return "" +
|
|
93
|
+
function e(d) {
|
|
94
|
+
return "" + d;
|
|
95
95
|
}
|
|
96
|
-
function r(
|
|
96
|
+
function r(d) {
|
|
97
97
|
try {
|
|
98
|
-
e(
|
|
99
|
-
var
|
|
98
|
+
e(d);
|
|
99
|
+
var w = !1;
|
|
100
100
|
} catch {
|
|
101
|
-
|
|
101
|
+
w = !0;
|
|
102
102
|
}
|
|
103
|
-
if (
|
|
104
|
-
|
|
105
|
-
var
|
|
106
|
-
return
|
|
107
|
-
|
|
103
|
+
if (w) {
|
|
104
|
+
w = console;
|
|
105
|
+
var b = w.error, R = typeof Symbol == "function" && Symbol.toStringTag && d[Symbol.toStringTag] || d.constructor.name || "Object";
|
|
106
|
+
return b.call(
|
|
107
|
+
w,
|
|
108
108
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
109
|
-
|
|
110
|
-
), e(
|
|
109
|
+
R
|
|
110
|
+
), e(d);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
function n(
|
|
114
|
-
if (
|
|
115
|
-
if (typeof
|
|
113
|
+
function n(d) {
|
|
114
|
+
if (d === S) return "<>";
|
|
115
|
+
if (typeof d == "object" && d !== null && d.$$typeof === C)
|
|
116
116
|
return "<...>";
|
|
117
117
|
try {
|
|
118
|
-
var
|
|
119
|
-
return
|
|
118
|
+
var w = t(d);
|
|
119
|
+
return w ? "<" + w + ">" : "<...>";
|
|
120
120
|
} catch {
|
|
121
121
|
return "<...>";
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
function o() {
|
|
125
|
-
var
|
|
126
|
-
return
|
|
125
|
+
var d = N.A;
|
|
126
|
+
return d === null ? null : d.getOwner();
|
|
127
127
|
}
|
|
128
128
|
function s() {
|
|
129
129
|
return Error("react-stack-top-frame");
|
|
130
130
|
}
|
|
131
|
-
function i(
|
|
132
|
-
if (
|
|
133
|
-
var
|
|
134
|
-
if (
|
|
131
|
+
function i(d) {
|
|
132
|
+
if (U.call(d, "key")) {
|
|
133
|
+
var w = Object.getOwnPropertyDescriptor(d, "key").get;
|
|
134
|
+
if (w && w.isReactWarning) return !1;
|
|
135
135
|
}
|
|
136
|
-
return
|
|
136
|
+
return d.key !== void 0;
|
|
137
137
|
}
|
|
138
|
-
function a(
|
|
139
|
-
function
|
|
140
|
-
|
|
138
|
+
function a(d, w) {
|
|
139
|
+
function b() {
|
|
140
|
+
J || (J = !0, console.error(
|
|
141
141
|
"%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)",
|
|
142
|
-
|
|
142
|
+
w
|
|
143
143
|
));
|
|
144
144
|
}
|
|
145
|
-
|
|
146
|
-
get:
|
|
145
|
+
b.isReactWarning = !0, Object.defineProperty(d, "key", {
|
|
146
|
+
get: b,
|
|
147
147
|
configurable: !0
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
150
|
function c() {
|
|
151
|
-
var
|
|
152
|
-
return
|
|
151
|
+
var d = t(this.type);
|
|
152
|
+
return X[d] || (X[d] = !0, console.error(
|
|
153
153
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
154
|
-
)),
|
|
154
|
+
)), d = this.props.ref, d !== void 0 ? d : null;
|
|
155
155
|
}
|
|
156
|
-
function f(
|
|
157
|
-
return
|
|
158
|
-
$$typeof:
|
|
159
|
-
type:
|
|
160
|
-
key:
|
|
156
|
+
function f(d, w, b, R, j, Y, Se, be) {
|
|
157
|
+
return b = Y.ref, d = {
|
|
158
|
+
$$typeof: g,
|
|
159
|
+
type: d,
|
|
160
|
+
key: w,
|
|
161
161
|
props: Y,
|
|
162
|
-
_owner:
|
|
163
|
-
}, (
|
|
162
|
+
_owner: j
|
|
163
|
+
}, (b !== void 0 ? b : null) !== null ? Object.defineProperty(d, "ref", {
|
|
164
164
|
enumerable: !1,
|
|
165
165
|
get: c
|
|
166
|
-
}) : Object.defineProperty(
|
|
166
|
+
}) : Object.defineProperty(d, "ref", { enumerable: !1, value: null }), d._store = {}, Object.defineProperty(d._store, "validated", {
|
|
167
167
|
configurable: !1,
|
|
168
168
|
enumerable: !1,
|
|
169
169
|
writable: !0,
|
|
170
170
|
value: 0
|
|
171
|
-
}), Object.defineProperty(
|
|
171
|
+
}), Object.defineProperty(d, "_debugInfo", {
|
|
172
172
|
configurable: !1,
|
|
173
173
|
enumerable: !1,
|
|
174
174
|
writable: !0,
|
|
175
175
|
value: null
|
|
176
|
-
}), Object.defineProperty(
|
|
176
|
+
}), Object.defineProperty(d, "_debugStack", {
|
|
177
177
|
configurable: !1,
|
|
178
178
|
enumerable: !1,
|
|
179
179
|
writable: !0,
|
|
180
180
|
value: Se
|
|
181
|
-
}), Object.defineProperty(
|
|
181
|
+
}), Object.defineProperty(d, "_debugTask", {
|
|
182
182
|
configurable: !1,
|
|
183
183
|
enumerable: !1,
|
|
184
184
|
writable: !0,
|
|
185
185
|
value: be
|
|
186
|
-
}), Object.freeze && (Object.freeze(
|
|
186
|
+
}), Object.freeze && (Object.freeze(d.props), Object.freeze(d)), d;
|
|
187
187
|
}
|
|
188
|
-
function u(
|
|
189
|
-
var
|
|
190
|
-
if (
|
|
191
|
-
if (
|
|
192
|
-
if (
|
|
193
|
-
for (
|
|
194
|
-
h(
|
|
195
|
-
Object.freeze && Object.freeze(
|
|
188
|
+
function u(d, w, b, R, j, Y, Se, be) {
|
|
189
|
+
var M = w.children;
|
|
190
|
+
if (M !== void 0)
|
|
191
|
+
if (R)
|
|
192
|
+
if (O(M)) {
|
|
193
|
+
for (R = 0; R < M.length; R++)
|
|
194
|
+
h(M[R]);
|
|
195
|
+
Object.freeze && Object.freeze(M);
|
|
196
196
|
} else
|
|
197
197
|
console.error(
|
|
198
198
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
199
199
|
);
|
|
200
|
-
else h(
|
|
201
|
-
if (
|
|
202
|
-
|
|
203
|
-
var
|
|
200
|
+
else h(M);
|
|
201
|
+
if (U.call(w, "key")) {
|
|
202
|
+
M = t(d);
|
|
203
|
+
var ee = Object.keys(w).filter(function(Tt) {
|
|
204
204
|
return Tt !== "key";
|
|
205
205
|
});
|
|
206
|
-
|
|
206
|
+
R = 0 < ee.length ? "{key: someKey, " + ee.join(": ..., ") + ": ...}" : "{key: someKey}", ue[M + R] || (ee = 0 < ee.length ? "{" + ee.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
207
207
|
`A props object containing a "key" prop is being spread into JSX:
|
|
208
208
|
let props = %s;
|
|
209
209
|
<%s {...props} />
|
|
210
210
|
React keys must be passed directly to JSX without using spread:
|
|
211
211
|
let props = %s;
|
|
212
212
|
<%s key={someKey} {...props} />`,
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
),
|
|
213
|
+
R,
|
|
214
|
+
M,
|
|
215
|
+
ee,
|
|
216
|
+
M
|
|
217
|
+
), ue[M + R] = !0);
|
|
218
218
|
}
|
|
219
|
-
if (
|
|
220
|
-
|
|
221
|
-
for (var we in
|
|
222
|
-
we !== "key" && (
|
|
223
|
-
} else
|
|
224
|
-
return
|
|
225
|
-
|
|
226
|
-
typeof
|
|
219
|
+
if (M = null, b !== void 0 && (r(b), M = "" + b), i(w) && (r(w.key), M = "" + w.key), "key" in w) {
|
|
220
|
+
b = {};
|
|
221
|
+
for (var we in w)
|
|
222
|
+
we !== "key" && (b[we] = w[we]);
|
|
223
|
+
} else b = w;
|
|
224
|
+
return M && a(
|
|
225
|
+
b,
|
|
226
|
+
typeof d == "function" ? d.displayName || d.name || "Unknown" : d
|
|
227
227
|
), f(
|
|
228
|
-
|
|
229
|
-
|
|
228
|
+
d,
|
|
229
|
+
M,
|
|
230
230
|
Y,
|
|
231
|
-
|
|
231
|
+
j,
|
|
232
232
|
o(),
|
|
233
|
-
|
|
233
|
+
b,
|
|
234
234
|
Se,
|
|
235
235
|
be
|
|
236
236
|
);
|
|
237
237
|
}
|
|
238
|
-
function h(
|
|
239
|
-
typeof
|
|
238
|
+
function h(d) {
|
|
239
|
+
typeof d == "object" && d !== null && d.$$typeof === g && d._store && (d._store.validated = 1);
|
|
240
240
|
}
|
|
241
|
-
var
|
|
241
|
+
var l = It, g = Symbol.for("react.transitional.element"), y = Symbol.for("react.portal"), S = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), p = Symbol.for("react.profiler"), v = Symbol.for("react.consumer"), k = Symbol.for("react.context"), _ = Symbol.for("react.forward_ref"), D = Symbol.for("react.suspense"), z = Symbol.for("react.suspense_list"), H = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), I = Symbol.for("react.activity"), F = Symbol.for("react.client.reference"), N = l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, U = Object.prototype.hasOwnProperty, O = Array.isArray, K = console.createTask ? console.createTask : function() {
|
|
242
242
|
return null;
|
|
243
243
|
};
|
|
244
|
-
|
|
245
|
-
"react-stack-bottom-frame": function(
|
|
246
|
-
return
|
|
244
|
+
l = {
|
|
245
|
+
"react-stack-bottom-frame": function(d) {
|
|
246
|
+
return d();
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
|
-
var
|
|
250
|
-
|
|
249
|
+
var J, X = {}, Z = l["react-stack-bottom-frame"].bind(
|
|
250
|
+
l,
|
|
251
251
|
s
|
|
252
|
-
)(),
|
|
253
|
-
|
|
252
|
+
)(), Q = K(n(s)), ue = {};
|
|
253
|
+
ne.Fragment = S, ne.jsx = function(d, w, b, R, j) {
|
|
254
254
|
var Y = 1e4 > N.recentlyCreatedOwnerStacks++;
|
|
255
255
|
return u(
|
|
256
|
-
|
|
256
|
+
d,
|
|
257
|
+
w,
|
|
257
258
|
b,
|
|
258
|
-
C,
|
|
259
259
|
!1,
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
Y ? Error("react-stack-top-frame") :
|
|
263
|
-
Y ?
|
|
260
|
+
R,
|
|
261
|
+
j,
|
|
262
|
+
Y ? Error("react-stack-top-frame") : Z,
|
|
263
|
+
Y ? K(n(d)) : Q
|
|
264
264
|
);
|
|
265
|
-
},
|
|
265
|
+
}, ne.jsxs = function(d, w, b, R, j) {
|
|
266
266
|
var Y = 1e4 > N.recentlyCreatedOwnerStacks++;
|
|
267
267
|
return u(
|
|
268
|
-
|
|
268
|
+
d,
|
|
269
|
+
w,
|
|
269
270
|
b,
|
|
270
|
-
C,
|
|
271
271
|
!0,
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
Y ? Error("react-stack-top-frame") :
|
|
275
|
-
Y ?
|
|
272
|
+
R,
|
|
273
|
+
j,
|
|
274
|
+
Y ? Error("react-stack-top-frame") : Z,
|
|
275
|
+
Y ? K(n(d)) : Q
|
|
276
276
|
);
|
|
277
277
|
};
|
|
278
|
-
}()),
|
|
278
|
+
}()), ne;
|
|
279
279
|
}
|
|
280
280
|
var Ge;
|
|
281
281
|
function Ft() {
|
|
282
282
|
return Ge || (Ge = 1, process.env.NODE_ENV === "production" ? le.exports = xt() : le.exports = Dt()), le.exports;
|
|
283
283
|
}
|
|
284
|
-
var
|
|
284
|
+
var A = Ft();
|
|
285
285
|
function Bt(t, e) {
|
|
286
286
|
const r = Ue(
|
|
287
287
|
(n) => t.subscribe(n),
|
|
@@ -294,7 +294,7 @@ function Bt(t, e) {
|
|
|
294
294
|
return `${o ?? ""}:${s?.id ?? ""}`;
|
|
295
295
|
}
|
|
296
296
|
);
|
|
297
|
-
return
|
|
297
|
+
return $(() => {
|
|
298
298
|
const [n, o] = r.split(":");
|
|
299
299
|
return {
|
|
300
300
|
rootViewId: n || void 0,
|
|
@@ -302,13 +302,13 @@ function Bt(t, e) {
|
|
|
302
302
|
};
|
|
303
303
|
}, [r]);
|
|
304
304
|
}
|
|
305
|
-
function
|
|
305
|
+
function q(t, e) {
|
|
306
306
|
const r = Ue(
|
|
307
307
|
(n) => t.subscribeNode(e, n),
|
|
308
308
|
() => t.getNodeVersion(e),
|
|
309
309
|
() => t.getNodeVersion(e)
|
|
310
310
|
);
|
|
311
|
-
return
|
|
311
|
+
return $(() => t.getNode(e), [t, e, r]);
|
|
312
312
|
}
|
|
313
313
|
const $t = pe("UIRenderer");
|
|
314
314
|
function Vt(t) {
|
|
@@ -341,41 +341,41 @@ function zt(t) {
|
|
|
341
341
|
e += "," + t[r].id;
|
|
342
342
|
return e;
|
|
343
343
|
}
|
|
344
|
-
const _e =
|
|
345
|
-
const n =
|
|
346
|
-
() => o.length === 0 ? null : o.map((h) => /* @__PURE__ */
|
|
344
|
+
const _e = V(function t({ nodeId: e, context: r }) {
|
|
345
|
+
const n = q(r.store, e), o = n ? Yt(n) : [], s = zt(o), i = $(
|
|
346
|
+
() => o.length === 0 ? null : o.map((h) => /* @__PURE__ */ A.jsx(t, { nodeId: h.id, context: r }, h.id)),
|
|
347
347
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
348
348
|
[s, r]
|
|
349
349
|
);
|
|
350
350
|
if (!n)
|
|
351
351
|
return null;
|
|
352
352
|
if (n.type === "root")
|
|
353
|
-
return /* @__PURE__ */
|
|
353
|
+
return /* @__PURE__ */ A.jsx(Ot, { children: i }, n.id);
|
|
354
354
|
const a = r.library.resolve(n);
|
|
355
355
|
if (!a)
|
|
356
356
|
return $t.warn(`No renderer for node type ${n.type}`), null;
|
|
357
357
|
const c = Kt(n), f = c.length > 0 ? c.join(" ") : void 0, u = a;
|
|
358
|
-
return /* @__PURE__ */
|
|
358
|
+
return /* @__PURE__ */ A.jsx(u, { nodeId: e, context: r, className: f });
|
|
359
359
|
}, Wt);
|
|
360
360
|
function qt(t, e) {
|
|
361
|
-
return !Array.isArray(t) || t.length === 0 ? null : t.map((r) => /* @__PURE__ */
|
|
361
|
+
return !Array.isArray(t) || t.length === 0 ? null : t.map((r) => /* @__PURE__ */ A.jsx(_e, { nodeId: r.id, context: e }, r.id));
|
|
362
362
|
}
|
|
363
363
|
function Gt(t, e) {
|
|
364
364
|
return t.store === e.store && t.library === e.library && t.viewId === e.viewId && t.emptyFallback === e.emptyFallback;
|
|
365
365
|
}
|
|
366
|
-
const Ht =
|
|
367
|
-
const { rootViewId: c, rootNodeId: f } = Bt(e, n), u =
|
|
366
|
+
const Ht = V(function({ store: e, library: r, viewId: n, emptyFallback: o = null, onAction: s, client: i, video: a }) {
|
|
367
|
+
const { rootViewId: c, rootNodeId: f } = Bt(e, n), u = T(s);
|
|
368
368
|
u.current = s;
|
|
369
|
-
const h =
|
|
369
|
+
const h = T(i);
|
|
370
370
|
h.current = i;
|
|
371
|
-
const
|
|
372
|
-
|
|
373
|
-
const
|
|
371
|
+
const l = T(a);
|
|
372
|
+
l.current = a;
|
|
373
|
+
const g = x((S, m) => {
|
|
374
374
|
if (!S)
|
|
375
375
|
return;
|
|
376
|
-
const
|
|
377
|
-
u.current?.(S,
|
|
378
|
-
}, []), y =
|
|
376
|
+
const p = Vt(m);
|
|
377
|
+
u.current?.(S, p);
|
|
378
|
+
}, []), y = $(() => {
|
|
379
379
|
const S = {
|
|
380
380
|
store: e,
|
|
381
381
|
library: r,
|
|
@@ -384,21 +384,21 @@ const Ht = K(function({ store: e, library: r, viewId: n, emptyFallback: o = null
|
|
|
384
384
|
getPayload: (m) => e.getSnapshot().payloads.get(m),
|
|
385
385
|
renderChildren: (m) => qt(m, S),
|
|
386
386
|
renderView: (m) => {
|
|
387
|
-
const
|
|
388
|
-
return
|
|
387
|
+
const p = e.getSnapshot().views.get(m);
|
|
388
|
+
return p ? /* @__PURE__ */ A.jsx(_e, { nodeId: p.id, context: S }) : null;
|
|
389
389
|
},
|
|
390
|
-
dispatchAction:
|
|
390
|
+
dispatchAction: g,
|
|
391
391
|
// Access client/video via refs to avoid context recreation
|
|
392
392
|
get client() {
|
|
393
393
|
return h.current;
|
|
394
394
|
},
|
|
395
395
|
get video() {
|
|
396
|
-
return
|
|
396
|
+
return l.current;
|
|
397
397
|
}
|
|
398
398
|
};
|
|
399
399
|
return S;
|
|
400
|
-
}, [e, r,
|
|
401
|
-
return !c || !f ? o : /* @__PURE__ */
|
|
400
|
+
}, [e, r, g]);
|
|
401
|
+
return !c || !f ? o : /* @__PURE__ */ A.jsx("div", { "data-ikon-view-id": c, style: { display: "contents" }, children: /* @__PURE__ */ A.jsx(_e, { nodeId: f, context: y }) });
|
|
402
402
|
}, Gt);
|
|
403
403
|
class Jt {
|
|
404
404
|
constructor(e, r) {
|
|
@@ -432,24 +432,24 @@ const Ne = "ikon-ui";
|
|
|
432
432
|
function Xt(t, e) {
|
|
433
433
|
return t === e;
|
|
434
434
|
}
|
|
435
|
-
const uo =
|
|
436
|
-
const i =
|
|
435
|
+
const uo = V(function({ stores: e, registry: r, category: n = Ne, onAction: o, client: s }) {
|
|
436
|
+
const i = $(() => Array.from(e.keys()).sort().join(","), [e]), a = T(o);
|
|
437
437
|
a.current = o;
|
|
438
|
-
const c =
|
|
438
|
+
const c = T(s);
|
|
439
439
|
c.current = s;
|
|
440
|
-
const f =
|
|
440
|
+
const f = $(
|
|
441
441
|
() => {
|
|
442
442
|
const u = [];
|
|
443
|
-
for (const [h,
|
|
444
|
-
const
|
|
445
|
-
Xt(
|
|
443
|
+
for (const [h, l] of e) {
|
|
444
|
+
const g = l.store.getSnapshot();
|
|
445
|
+
Xt(l.category, n) && (!g.rootViewId || !g.views.has(g.rootViewId) || u.push({ key: h, store: l.store }));
|
|
446
446
|
}
|
|
447
447
|
return u;
|
|
448
448
|
},
|
|
449
449
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
450
450
|
[e, n, i]
|
|
451
451
|
);
|
|
452
|
-
return f.length === 0 ? null : /* @__PURE__ */
|
|
452
|
+
return f.length === 0 ? null : /* @__PURE__ */ A.jsx(A.Fragment, { children: f.map(({ key: u, store: h }) => /* @__PURE__ */ A.jsx(Ht, { store: h, library: r, onAction: a.current, client: c.current, video: c.current?.media?.video }, u)) });
|
|
453
453
|
});
|
|
454
454
|
class Zt {
|
|
455
455
|
core;
|
|
@@ -532,7 +532,7 @@ function Qt(t) {
|
|
|
532
532
|
return e.length > 0 ? e : void 0;
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
|
-
function
|
|
535
|
+
function ce(t) {
|
|
536
536
|
if (typeof t == "string") {
|
|
537
537
|
const e = t.trim();
|
|
538
538
|
return e.length > 0 ? e : void 0;
|
|
@@ -564,45 +564,45 @@ function Fe(t) {
|
|
|
564
564
|
return He.set(t, r), r;
|
|
565
565
|
}
|
|
566
566
|
function tr() {
|
|
567
|
-
const t =
|
|
568
|
-
const o =
|
|
569
|
-
return
|
|
567
|
+
const t = V(function({ nodeId: r, context: n }) {
|
|
568
|
+
const o = q(n.store, r), s = T(null), i = ce(o?.props?.targetViewId), a = o?.props?.focusOnly, c = typeof a == "boolean" ? a : void 0, f = ce(o?.props?.key), u = o?.props?.preciseGeneratedAt;
|
|
569
|
+
return L(() => {
|
|
570
570
|
if (typeof document > "u")
|
|
571
571
|
return;
|
|
572
|
-
const
|
|
573
|
-
if (!
|
|
572
|
+
const l = s.current;
|
|
573
|
+
if (!l || i && l.closest("[data-ikon-view-id]")?.getAttribute("data-ikon-view-id") !== i)
|
|
574
574
|
return;
|
|
575
|
-
const
|
|
576
|
-
if (
|
|
577
|
-
const
|
|
578
|
-
let
|
|
579
|
-
for (;
|
|
580
|
-
const
|
|
581
|
-
if (
|
|
582
|
-
return
|
|
583
|
-
|
|
575
|
+
const g = c !== !0;
|
|
576
|
+
if (g) {
|
|
577
|
+
const p = ((v) => {
|
|
578
|
+
let k = v.parentElement;
|
|
579
|
+
for (; k; ) {
|
|
580
|
+
const D = window.getComputedStyle(k).overflowY;
|
|
581
|
+
if (D === "auto" || D === "scroll" || k.hasAttribute("data-radix-scroll-area-viewport"))
|
|
582
|
+
return k;
|
|
583
|
+
k = k.parentElement;
|
|
584
584
|
}
|
|
585
585
|
return null;
|
|
586
|
-
})(
|
|
587
|
-
|
|
588
|
-
const
|
|
589
|
-
"scrollBehavior" in document.documentElement.style ?
|
|
590
|
-
}) : typeof
|
|
586
|
+
})(l);
|
|
587
|
+
p ? requestAnimationFrame(() => {
|
|
588
|
+
const v = p.getBoundingClientRect(), k = l.getBoundingClientRect(), _ = p.scrollTop + (k.bottom - v.bottom) + 16;
|
|
589
|
+
"scrollBehavior" in document.documentElement.style ? p.scrollTo({ top: _, behavior: "smooth" }) : p.scrollTop = _;
|
|
590
|
+
}) : typeof l.scrollIntoView == "function" && requestAnimationFrame(() => {
|
|
591
591
|
try {
|
|
592
|
-
|
|
592
|
+
l.scrollIntoView({ behavior: "smooth", block: "end", inline: "nearest" });
|
|
593
593
|
} catch {
|
|
594
|
-
|
|
594
|
+
l.scrollIntoView(!1);
|
|
595
595
|
}
|
|
596
596
|
});
|
|
597
597
|
}
|
|
598
598
|
const y = document.activeElement;
|
|
599
|
-
if (!(y instanceof HTMLInputElement || y instanceof HTMLTextAreaElement || y?.getAttribute("contenteditable") === "true") && typeof
|
|
599
|
+
if (!(y instanceof HTMLInputElement || y instanceof HTMLTextAreaElement || y?.getAttribute("contenteditable") === "true") && typeof l.focus == "function")
|
|
600
600
|
try {
|
|
601
|
-
|
|
601
|
+
l.focus({ preventScroll: !g });
|
|
602
602
|
} catch {
|
|
603
|
-
|
|
603
|
+
l.focus();
|
|
604
604
|
}
|
|
605
|
-
}, [c, i, f, u]), o ? /* @__PURE__ */
|
|
605
|
+
}, [c, i, f, u]), o ? /* @__PURE__ */ A.jsx(
|
|
606
606
|
"span",
|
|
607
607
|
{
|
|
608
608
|
ref: s,
|
|
@@ -620,16 +620,16 @@ function tr() {
|
|
|
620
620
|
};
|
|
621
621
|
}
|
|
622
622
|
function rr() {
|
|
623
|
-
const t =
|
|
624
|
-
const s =
|
|
623
|
+
const t = V(function({ nodeId: r, context: n, className: o }) {
|
|
624
|
+
const s = q(n.store, r), i = Qt(s?.props?.onInvokeId), a = x(() => {
|
|
625
625
|
i && n.dispatchAction(i);
|
|
626
626
|
}, [i, n]);
|
|
627
627
|
if (!s)
|
|
628
628
|
return null;
|
|
629
629
|
const c = Fe(s.props);
|
|
630
630
|
delete c.onInvokeId;
|
|
631
|
-
const f = De(
|
|
632
|
-
return /* @__PURE__ */
|
|
631
|
+
const f = De(ce(s.props?.className), o), u = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
632
|
+
return /* @__PURE__ */ A.jsx(
|
|
633
633
|
"div",
|
|
634
634
|
{
|
|
635
635
|
...c,
|
|
@@ -647,12 +647,12 @@ function rr() {
|
|
|
647
647
|
};
|
|
648
648
|
}
|
|
649
649
|
function nr() {
|
|
650
|
-
const t =
|
|
651
|
-
const s =
|
|
650
|
+
const t = V(function({ nodeId: r, context: n, className: o }) {
|
|
651
|
+
const s = q(n.store, r);
|
|
652
652
|
if (!s)
|
|
653
653
|
return null;
|
|
654
|
-
const i = Fe(s.props), a = De("relative",
|
|
655
|
-
return /* @__PURE__ */
|
|
654
|
+
const i = Fe(s.props), a = De("relative", ce(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
655
|
+
return /* @__PURE__ */ A.jsx("div", { ...i, "data-ikon-node-id": s.id, className: a, children: c });
|
|
656
656
|
});
|
|
657
657
|
return ({ type: e }) => {
|
|
658
658
|
if (e === "std.stack")
|
|
@@ -660,12 +660,12 @@ function nr() {
|
|
|
660
660
|
};
|
|
661
661
|
}
|
|
662
662
|
function or() {
|
|
663
|
-
const t =
|
|
664
|
-
const s =
|
|
663
|
+
const t = V(function({ nodeId: r, context: n, className: o }) {
|
|
664
|
+
const s = q(n.store, r);
|
|
665
665
|
if (!s)
|
|
666
666
|
return null;
|
|
667
|
-
const i = Fe(s.props), a = De("absolute",
|
|
668
|
-
return /* @__PURE__ */
|
|
667
|
+
const i = Fe(s.props), a = De("absolute", ce(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
668
|
+
return /* @__PURE__ */ A.jsx("div", { ...i, "data-ikon-node-id": s.id, className: a, children: c });
|
|
669
669
|
});
|
|
670
670
|
return ({ type: e }) => {
|
|
671
671
|
if (e === "std.layer")
|
|
@@ -717,16 +717,16 @@ function de(t) {
|
|
|
717
717
|
}
|
|
718
718
|
const dr = "std.audio-url-player";
|
|
719
719
|
function fr() {
|
|
720
|
-
const t =
|
|
720
|
+
const t = V(function({
|
|
721
721
|
nodeId: r,
|
|
722
722
|
context: n,
|
|
723
723
|
className: o
|
|
724
724
|
}) {
|
|
725
|
-
const s =
|
|
725
|
+
const s = q(n.store, r);
|
|
726
726
|
if (!s)
|
|
727
727
|
return null;
|
|
728
|
-
const i = lr(ur(s.props?.className), o), a = Je(s.props?.src), c = Je(s.props?.preload), f = de(s.props?.controls), u = de(s.props?.autoplay), h = de(s.props?.loop),
|
|
729
|
-
return /* @__PURE__ */
|
|
728
|
+
const i = lr(ur(s.props?.className), o), a = Je(s.props?.src), c = Je(s.props?.preload), f = de(s.props?.controls), u = de(s.props?.autoplay), h = de(s.props?.loop), l = de(s.props?.muted);
|
|
729
|
+
return /* @__PURE__ */ A.jsx(
|
|
730
730
|
"audio",
|
|
731
731
|
{
|
|
732
732
|
src: a,
|
|
@@ -734,7 +734,7 @@ function fr() {
|
|
|
734
734
|
...f !== void 0 ? { controls: f } : {},
|
|
735
735
|
...u !== void 0 ? { autoPlay: u } : {},
|
|
736
736
|
...h !== void 0 ? { loop: h } : {},
|
|
737
|
-
...
|
|
737
|
+
...l !== void 0 ? { muted: l } : {},
|
|
738
738
|
"data-ikon-node-id": s.id,
|
|
739
739
|
className: i
|
|
740
740
|
}
|
|
@@ -778,21 +778,21 @@ function Pe(t) {
|
|
|
778
778
|
}
|
|
779
779
|
const hr = "std.video-canvas", mr = "std.video-url-player";
|
|
780
780
|
function pr() {
|
|
781
|
-
const t =
|
|
782
|
-
const s =
|
|
783
|
-
return
|
|
781
|
+
const t = V(function({ nodeId: r, context: n, className: o }) {
|
|
782
|
+
const s = q(n.store, r), i = T(null), a = T(null), c = n.video, f = n.client, u = s ? Pe(s.props?.streamId) : void 0, h = s ? fe(s.props?.width) : void 0, l = s ? fe(s.props?.height) : void 0, g = s ? ft(dt(s.props?.className), o) : o, y = f?.isWebRtcEnabled && u ? f.getWebRtcVideoStreamByStreamId(u) : null;
|
|
783
|
+
return L(() => {
|
|
784
784
|
const S = i.current;
|
|
785
785
|
if (!(!c || !S || !u || y))
|
|
786
786
|
return c.attachCanvas(u, S), () => {
|
|
787
787
|
c.detachCanvas(u);
|
|
788
788
|
};
|
|
789
|
-
}, [c, u, y]),
|
|
789
|
+
}, [c, u, y]), L(() => {
|
|
790
790
|
const S = a.current;
|
|
791
791
|
if (!(!S || !y))
|
|
792
792
|
return S.srcObject = y, () => {
|
|
793
793
|
S.srcObject = null;
|
|
794
794
|
};
|
|
795
|
-
}, [y]), s ? y ? /* @__PURE__ */
|
|
795
|
+
}, [y]), s ? y ? /* @__PURE__ */ A.jsx(
|
|
796
796
|
"video",
|
|
797
797
|
{
|
|
798
798
|
ref: a,
|
|
@@ -801,20 +801,20 @@ function pr() {
|
|
|
801
801
|
muted: !0,
|
|
802
802
|
"data-ikon-node-id": s.id,
|
|
803
803
|
"data-ikon-video-stream-id": u,
|
|
804
|
-
className:
|
|
804
|
+
className: g,
|
|
805
805
|
...h ? { width: h } : {},
|
|
806
|
-
...
|
|
806
|
+
...l ? { height: l } : {}
|
|
807
807
|
},
|
|
808
808
|
u
|
|
809
|
-
) : /* @__PURE__ */
|
|
809
|
+
) : /* @__PURE__ */ A.jsx(
|
|
810
810
|
"canvas",
|
|
811
811
|
{
|
|
812
812
|
ref: i,
|
|
813
813
|
"data-ikon-node-id": s.id,
|
|
814
814
|
"data-ikon-video-stream-id": u,
|
|
815
|
-
className:
|
|
815
|
+
className: g,
|
|
816
816
|
...h ? { width: h } : {},
|
|
817
|
-
...
|
|
817
|
+
...l ? { height: l } : {}
|
|
818
818
|
},
|
|
819
819
|
u
|
|
820
820
|
) : null;
|
|
@@ -827,7 +827,7 @@ function pr() {
|
|
|
827
827
|
function gr() {
|
|
828
828
|
return [pr(), yr(), fr()];
|
|
829
829
|
}
|
|
830
|
-
function
|
|
830
|
+
function oe(t) {
|
|
831
831
|
if (typeof t == "boolean")
|
|
832
832
|
return t;
|
|
833
833
|
if (typeof t == "string") {
|
|
@@ -837,16 +837,16 @@ function re(t) {
|
|
|
837
837
|
}
|
|
838
838
|
}
|
|
839
839
|
function yr() {
|
|
840
|
-
const t =
|
|
840
|
+
const t = V(function({
|
|
841
841
|
nodeId: r,
|
|
842
842
|
context: n,
|
|
843
843
|
className: o
|
|
844
844
|
}) {
|
|
845
|
-
const s =
|
|
845
|
+
const s = q(n.store, r);
|
|
846
846
|
if (!s)
|
|
847
847
|
return null;
|
|
848
|
-
const i = ft(dt(s.props?.className), o), a = Pe(s.props?.src), c = Pe(s.props?.poster), f =
|
|
849
|
-
return /* @__PURE__ */
|
|
848
|
+
const i = ft(dt(s.props?.className), o), a = Pe(s.props?.src), c = Pe(s.props?.poster), f = oe(s.props?.controls), u = oe(s.props?.autoplay), h = oe(s.props?.loop), l = oe(s.props?.muted), g = oe(s.props?.playsInline), y = fe(s.props?.width), S = fe(s.props?.height), m = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
849
|
+
return /* @__PURE__ */ A.jsx(
|
|
850
850
|
"video",
|
|
851
851
|
{
|
|
852
852
|
src: a,
|
|
@@ -854,8 +854,8 @@ function yr() {
|
|
|
854
854
|
...f !== void 0 ? { controls: f } : {},
|
|
855
855
|
...u !== void 0 ? { autoPlay: u } : {},
|
|
856
856
|
...h !== void 0 ? { loop: h } : {},
|
|
857
|
-
...
|
|
858
|
-
...
|
|
857
|
+
...l !== void 0 ? { muted: l } : {},
|
|
858
|
+
...g !== void 0 ? { playsInline: g } : {},
|
|
859
859
|
...y ? { width: y } : {},
|
|
860
860
|
...S ? { height: S } : {},
|
|
861
861
|
"data-ikon-node-id": s.id,
|
|
@@ -1021,12 +1021,12 @@ class Ar {
|
|
|
1021
1021
|
u && e.uniform1f(u, a);
|
|
1022
1022
|
const h = this.uniformLocations.get("iFrame");
|
|
1023
1023
|
h && e.uniform1i(h, this.frameCount);
|
|
1024
|
-
const
|
|
1025
|
-
|
|
1026
|
-
const
|
|
1027
|
-
if (
|
|
1024
|
+
const l = this.uniformLocations.get("iMouse");
|
|
1025
|
+
l && e.uniform4f(l, this.mouseX, this.mouseY, this.mouseClickX, this.mouseClickY);
|
|
1026
|
+
const g = this.uniformLocations.get("iDate");
|
|
1027
|
+
if (g) {
|
|
1028
1028
|
const y = /* @__PURE__ */ new Date();
|
|
1029
|
-
e.uniform4f(
|
|
1029
|
+
e.uniform4f(g, y.getFullYear(), y.getMonth(), y.getDate(), y.getHours() * 3600 + y.getMinutes() * 60 + y.getSeconds() + y.getMilliseconds() / 1e3);
|
|
1030
1030
|
}
|
|
1031
1031
|
for (const [y, S] of Object.entries(this.customUniforms)) {
|
|
1032
1032
|
const m = this.uniformLocations.get(y);
|
|
@@ -1036,18 +1036,18 @@ class Ar {
|
|
|
1036
1036
|
e.uniform1f(m, S.value);
|
|
1037
1037
|
break;
|
|
1038
1038
|
case "vec2": {
|
|
1039
|
-
const
|
|
1040
|
-
e.uniform2f(m,
|
|
1039
|
+
const p = S.value;
|
|
1040
|
+
e.uniform2f(m, p[0], p[1]);
|
|
1041
1041
|
break;
|
|
1042
1042
|
}
|
|
1043
1043
|
case "vec3": {
|
|
1044
|
-
const
|
|
1045
|
-
e.uniform3f(m,
|
|
1044
|
+
const p = S.value;
|
|
1045
|
+
e.uniform3f(m, p[0], p[1], p[2]);
|
|
1046
1046
|
break;
|
|
1047
1047
|
}
|
|
1048
1048
|
case "vec4": {
|
|
1049
|
-
const
|
|
1050
|
-
e.uniform4f(m,
|
|
1049
|
+
const p = S.value;
|
|
1050
|
+
e.uniform4f(m, p[0], p[1], p[2], p[3]);
|
|
1051
1051
|
break;
|
|
1052
1052
|
}
|
|
1053
1053
|
case "int":
|
|
@@ -1143,83 +1143,83 @@ function _r(t, e) {
|
|
|
1143
1143
|
}
|
|
1144
1144
|
const Nr = "std.shadertoy-canvas";
|
|
1145
1145
|
function Pr() {
|
|
1146
|
-
const t =
|
|
1147
|
-
const s =
|
|
1146
|
+
const t = V(function({ nodeId: r, context: n, className: o }) {
|
|
1147
|
+
const s = q(n.store, r), i = T(null), a = T(null), c = T(null), f = T(0), u = T(""), h = T({}), l = T({
|
|
1148
1148
|
x: 0,
|
|
1149
1149
|
y: 0,
|
|
1150
1150
|
clickX: 0,
|
|
1151
1151
|
clickY: 0,
|
|
1152
1152
|
isDown: !1
|
|
1153
|
-
}),
|
|
1154
|
-
|
|
1155
|
-
const
|
|
1156
|
-
if (
|
|
1153
|
+
}), g = s ? Cr(s.props?.shaderSource) : "", y = s ? ve(s.props?.fps) ?? 60 : 60, S = s?.props?.uniforms, m = $(() => Or(S), [S]), p = s ? Ir(s.props?.enableMouse) ?? !0 : !0, v = s ? ve(s.props?.width) : void 0, k = s ? ve(s.props?.height) : void 0, _ = s ? kr(Tr(s.props?.className), o) : o;
|
|
1154
|
+
L(() => {
|
|
1155
|
+
const C = i.current;
|
|
1156
|
+
if (C) {
|
|
1157
1157
|
try {
|
|
1158
|
-
const
|
|
1159
|
-
a.current =
|
|
1160
|
-
} catch (
|
|
1161
|
-
console.error("[ShadertoyRenderer] Failed to create WebGL2 context:",
|
|
1158
|
+
const I = new Ar(C);
|
|
1159
|
+
a.current = I;
|
|
1160
|
+
} catch (I) {
|
|
1161
|
+
console.error("[ShadertoyRenderer] Failed to create WebGL2 context:", I);
|
|
1162
1162
|
}
|
|
1163
1163
|
return () => {
|
|
1164
1164
|
a.current && (a.current.destroy(), a.current = null);
|
|
1165
1165
|
};
|
|
1166
1166
|
}
|
|
1167
|
-
}, []),
|
|
1168
|
-
const
|
|
1169
|
-
if (!(!
|
|
1170
|
-
if (
|
|
1171
|
-
u.current =
|
|
1167
|
+
}, []), L(() => {
|
|
1168
|
+
const C = a.current;
|
|
1169
|
+
if (!(!C || !g) && u.current !== g)
|
|
1170
|
+
if (C.compile(g, m))
|
|
1171
|
+
u.current = g, h.current = m;
|
|
1172
1172
|
else {
|
|
1173
|
-
const
|
|
1174
|
-
console.error("[ShadertoyRenderer] Shader compilation failed:",
|
|
1173
|
+
const F = C.getError();
|
|
1174
|
+
console.error("[ShadertoyRenderer] Shader compilation failed:", F);
|
|
1175
1175
|
}
|
|
1176
|
-
}, [
|
|
1177
|
-
const
|
|
1178
|
-
!
|
|
1179
|
-
}, [m]),
|
|
1180
|
-
const
|
|
1181
|
-
if (!
|
|
1182
|
-
const
|
|
1183
|
-
const
|
|
1184
|
-
|
|
1176
|
+
}, [g, m]), L(() => {
|
|
1177
|
+
const C = a.current;
|
|
1178
|
+
!C || !u.current || _r(h.current, m) || (C.setCustomUniforms(m), h.current = m);
|
|
1179
|
+
}, [m]), L(() => {
|
|
1180
|
+
const C = a.current;
|
|
1181
|
+
if (!C || !u.current) return;
|
|
1182
|
+
const I = 1e3 / y, F = (N) => {
|
|
1183
|
+
const U = N - f.current;
|
|
1184
|
+
U >= I && (f.current = N - U % I, C.draw()), c.current = requestAnimationFrame(F);
|
|
1185
1185
|
};
|
|
1186
|
-
return c.current = requestAnimationFrame(
|
|
1186
|
+
return c.current = requestAnimationFrame(F), () => {
|
|
1187
1187
|
c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
|
|
1188
1188
|
};
|
|
1189
1189
|
}, [y]);
|
|
1190
|
-
const
|
|
1191
|
-
(
|
|
1192
|
-
if (!
|
|
1193
|
-
const
|
|
1194
|
-
if (!
|
|
1195
|
-
const N =
|
|
1196
|
-
|
|
1190
|
+
const D = x(
|
|
1191
|
+
(C) => {
|
|
1192
|
+
if (!p) return;
|
|
1193
|
+
const I = i.current, F = a.current;
|
|
1194
|
+
if (!I || !F) return;
|
|
1195
|
+
const N = I.getBoundingClientRect(), U = C.clientX - N.left, O = N.height - (C.clientY - N.top);
|
|
1196
|
+
l.current.x = U, l.current.y = O, F.setMouse(U, O, l.current.clickX, l.current.clickY);
|
|
1197
1197
|
},
|
|
1198
|
-
[
|
|
1199
|
-
),
|
|
1200
|
-
(
|
|
1201
|
-
if (!
|
|
1202
|
-
const
|
|
1203
|
-
if (!
|
|
1204
|
-
const N =
|
|
1205
|
-
|
|
1198
|
+
[p]
|
|
1199
|
+
), z = x(
|
|
1200
|
+
(C) => {
|
|
1201
|
+
if (!p) return;
|
|
1202
|
+
const I = i.current, F = a.current;
|
|
1203
|
+
if (!I || !F) return;
|
|
1204
|
+
const N = I.getBoundingClientRect(), U = C.clientX - N.left, O = N.height - (C.clientY - N.top);
|
|
1205
|
+
l.current.isDown = !0, l.current.clickX = U, l.current.clickY = O, F.setMouse(U, O, U, O);
|
|
1206
1206
|
},
|
|
1207
|
-
[
|
|
1208
|
-
),
|
|
1209
|
-
|
|
1210
|
-
}, [
|
|
1211
|
-
return s ? /* @__PURE__ */
|
|
1207
|
+
[p]
|
|
1208
|
+
), H = x(() => {
|
|
1209
|
+
p && (l.current.isDown = !1, l.current.clickX = -Math.abs(l.current.clickX));
|
|
1210
|
+
}, [p]);
|
|
1211
|
+
return s ? /* @__PURE__ */ A.jsx(
|
|
1212
1212
|
"canvas",
|
|
1213
1213
|
{
|
|
1214
1214
|
ref: i,
|
|
1215
1215
|
"data-ikon-node-id": s.id,
|
|
1216
|
-
className:
|
|
1217
|
-
...
|
|
1218
|
-
...
|
|
1219
|
-
onMouseMove:
|
|
1220
|
-
onMouseDown:
|
|
1221
|
-
onMouseUp:
|
|
1222
|
-
onMouseLeave:
|
|
1216
|
+
className: _,
|
|
1217
|
+
...v ? { width: v } : {},
|
|
1218
|
+
...k ? { height: k } : {},
|
|
1219
|
+
onMouseMove: D,
|
|
1220
|
+
onMouseDown: z,
|
|
1221
|
+
onMouseUp: H,
|
|
1222
|
+
onMouseLeave: H
|
|
1223
1223
|
}
|
|
1224
1224
|
) : null;
|
|
1225
1225
|
});
|
|
@@ -1346,37 +1346,37 @@ function et(t) {
|
|
|
1346
1346
|
}
|
|
1347
1347
|
function tt(t, e, r, n) {
|
|
1348
1348
|
const u = new Float32Array(11);
|
|
1349
|
-
function h(m,
|
|
1350
|
-
return ((3 *
|
|
1351
|
-
}
|
|
1352
|
-
function
|
|
1353
|
-
return 3 * (3 *
|
|
1354
|
-
}
|
|
1355
|
-
function
|
|
1356
|
-
for (let
|
|
1357
|
-
const
|
|
1358
|
-
if (
|
|
1359
|
-
return
|
|
1360
|
-
const
|
|
1361
|
-
|
|
1349
|
+
function h(m, p, v) {
|
|
1350
|
+
return ((3 * p - 3 * v + 1) * m + (3 * v - 6 * p)) * m * m + 3 * p * m;
|
|
1351
|
+
}
|
|
1352
|
+
function l(m, p, v) {
|
|
1353
|
+
return 3 * (3 * p - 3 * v + 1) * m * m + 2 * (3 * v - 6 * p) * m + 3 * p;
|
|
1354
|
+
}
|
|
1355
|
+
function g(m, p) {
|
|
1356
|
+
for (let v = 0; v < 4; v += 1) {
|
|
1357
|
+
const k = l(p, t, r);
|
|
1358
|
+
if (k === 0)
|
|
1359
|
+
return p;
|
|
1360
|
+
const _ = h(p, t, r) - m;
|
|
1361
|
+
p -= _ / k;
|
|
1362
1362
|
}
|
|
1363
|
-
return
|
|
1363
|
+
return p;
|
|
1364
1364
|
}
|
|
1365
|
-
function y(m,
|
|
1366
|
-
let
|
|
1365
|
+
function y(m, p, v) {
|
|
1366
|
+
let k = 0, _ = 0, D = 0;
|
|
1367
1367
|
do
|
|
1368
|
-
|
|
1369
|
-
while (Math.abs(
|
|
1370
|
-
return
|
|
1368
|
+
_ = p + (v - p) / 2, k = h(_, t, r) - m, k > 0 ? v = _ : p = _;
|
|
1369
|
+
while (Math.abs(k) > 1e-7 && ++D < 10);
|
|
1370
|
+
return _;
|
|
1371
1371
|
}
|
|
1372
1372
|
function S(m) {
|
|
1373
|
-
let
|
|
1374
|
-
const
|
|
1375
|
-
for (;
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
const
|
|
1379
|
-
return
|
|
1373
|
+
let p = 0, v = 1;
|
|
1374
|
+
const k = 10;
|
|
1375
|
+
for (; v !== k && u[v] <= m; v += 1)
|
|
1376
|
+
p += 0.1;
|
|
1377
|
+
v -= 1;
|
|
1378
|
+
const _ = (m - u[v]) / (u[v + 1] - u[v]), D = p + _ * 0.1, z = l(D, t, r);
|
|
1379
|
+
return z >= 1e-3 ? g(m, D) : z === 0 ? D : y(m, p, p + 0.1);
|
|
1380
1380
|
}
|
|
1381
1381
|
for (let m = 0; m < 11; m += 1)
|
|
1382
1382
|
u[m] = h(m * 0.1, t, r);
|
|
@@ -1682,7 +1682,7 @@ class Yr {
|
|
|
1682
1682
|
}
|
|
1683
1683
|
const Ee = new Yr();
|
|
1684
1684
|
function Wr(t) {
|
|
1685
|
-
const e =
|
|
1685
|
+
const e = T(/* @__PURE__ */ new Map()), r = x(({ styleId: s, css: i, common: a }) => {
|
|
1686
1686
|
if (!(!s || typeof document > "u")) {
|
|
1687
1687
|
if (i) {
|
|
1688
1688
|
let c = e.current.get(s);
|
|
@@ -1690,13 +1690,13 @@ function Wr(t) {
|
|
|
1690
1690
|
}
|
|
1691
1691
|
Ee.registerStyle(s, a);
|
|
1692
1692
|
}
|
|
1693
|
-
}, []), n =
|
|
1693
|
+
}, []), n = x((s) => {
|
|
1694
1694
|
if (!(typeof document > "u"))
|
|
1695
1695
|
for (const i of s) {
|
|
1696
1696
|
const a = e.current.get(i);
|
|
1697
1697
|
a && (a.remove(), e.current.delete(i)), Ee.unregisterStyle(i);
|
|
1698
1698
|
}
|
|
1699
|
-
}, []), o =
|
|
1699
|
+
}, []), o = x(() => {
|
|
1700
1700
|
if (typeof document < "u") {
|
|
1701
1701
|
for (const s of e.current.values())
|
|
1702
1702
|
s.remove();
|
|
@@ -1704,7 +1704,7 @@ function Wr(t) {
|
|
|
1704
1704
|
}
|
|
1705
1705
|
Ee.reset();
|
|
1706
1706
|
}, []);
|
|
1707
|
-
return
|
|
1707
|
+
return L(() => {
|
|
1708
1708
|
if (!t) return;
|
|
1709
1709
|
for (const a of t.getUiStyles())
|
|
1710
1710
|
r(a);
|
|
@@ -1712,7 +1712,7 @@ function Wr(t) {
|
|
|
1712
1712
|
return () => {
|
|
1713
1713
|
s?.(), i?.(), o();
|
|
1714
1714
|
};
|
|
1715
|
-
}, [t, o, r, n]),
|
|
1715
|
+
}, [t, o, r, n]), L(() => () => o(), [o]), { setStyle: r, deleteStyles: n, reset: o };
|
|
1716
1716
|
}
|
|
1717
1717
|
function zr(t) {
|
|
1718
1718
|
const e = [];
|
|
@@ -1723,8 +1723,8 @@ function zr(t) {
|
|
|
1723
1723
|
return e.sort(), e.join(",");
|
|
1724
1724
|
}
|
|
1725
1725
|
function qr(t) {
|
|
1726
|
-
const [e, r] =
|
|
1727
|
-
return
|
|
1726
|
+
const [e, r] = G(), n = T("");
|
|
1727
|
+
return L(() => {
|
|
1728
1728
|
if (!t) {
|
|
1729
1729
|
r(void 0), n.current = "";
|
|
1730
1730
|
return;
|
|
@@ -1736,16 +1736,16 @@ function qr(t) {
|
|
|
1736
1736
|
return o(), t.subscribe(o);
|
|
1737
1737
|
}, [t]), e;
|
|
1738
1738
|
}
|
|
1739
|
-
var Gr = typeof global == "object" && global && global.Object === Object && global, Hr = typeof self == "object" && self && self.Object === Object && self, Jr = Gr || Hr || Function("return this")(), he = Jr.Symbol, ht = Object.prototype, Xr = ht.hasOwnProperty, Zr = ht.toString,
|
|
1739
|
+
var Gr = typeof global == "object" && global && global.Object === Object && global, Hr = typeof self == "object" && self && self.Object === Object && self, Jr = Gr || Hr || Function("return this")(), he = Jr.Symbol, ht = Object.prototype, Xr = ht.hasOwnProperty, Zr = ht.toString, se = he ? he.toStringTag : void 0;
|
|
1740
1740
|
function Qr(t) {
|
|
1741
|
-
var e = Xr.call(t,
|
|
1741
|
+
var e = Xr.call(t, se), r = t[se];
|
|
1742
1742
|
try {
|
|
1743
|
-
t[
|
|
1743
|
+
t[se] = void 0;
|
|
1744
1744
|
var n = !0;
|
|
1745
1745
|
} catch {
|
|
1746
1746
|
}
|
|
1747
1747
|
var o = Zr.call(t);
|
|
1748
|
-
return n && (e ? t[
|
|
1748
|
+
return n && (e ? t[se] = r : delete t[se]), o;
|
|
1749
1749
|
}
|
|
1750
1750
|
var en = Object.prototype, tn = en.toString;
|
|
1751
1751
|
function rn(t) {
|
|
@@ -1828,11 +1828,11 @@ function ho(t) {
|
|
|
1828
1828
|
const h = f[u];
|
|
1829
1829
|
if (typeof h != "string")
|
|
1830
1830
|
continue;
|
|
1831
|
-
const
|
|
1832
|
-
if (!
|
|
1831
|
+
const l = h.trim();
|
|
1832
|
+
if (!l)
|
|
1833
1833
|
continue;
|
|
1834
|
-
const
|
|
1835
|
-
typeof y == "string" && s.set(
|
|
1834
|
+
const g = Object.keys(f).find((S) => S.toLowerCase() === "javascript"), y = g ? f[g] : void 0;
|
|
1835
|
+
typeof y == "string" && s.set(l, y), i.has(l) || (o.push(l), i.add(l));
|
|
1836
1836
|
}
|
|
1837
1837
|
if (!o.length && s.size === 0)
|
|
1838
1838
|
return { modules: [] };
|
|
@@ -1842,7 +1842,7 @@ function ho(t) {
|
|
|
1842
1842
|
}));
|
|
1843
1843
|
return a.length > 0 ? { modules: o, inlineModules: a } : { modules: o };
|
|
1844
1844
|
}
|
|
1845
|
-
const
|
|
1845
|
+
const E = {
|
|
1846
1846
|
None: 0,
|
|
1847
1847
|
Letter: 1,
|
|
1848
1848
|
Word: 2,
|
|
@@ -1851,7 +1851,7 @@ const v = {
|
|
|
1851
1851
|
Emoji: 16
|
|
1852
1852
|
}, hn = [
|
|
1853
1853
|
{
|
|
1854
|
-
flag:
|
|
1854
|
+
flag: E.Letter,
|
|
1855
1855
|
hints: [
|
|
1856
1856
|
"[data-motion-letter]",
|
|
1857
1857
|
"[data-letter]",
|
|
@@ -1860,7 +1860,7 @@ const v = {
|
|
|
1860
1860
|
]
|
|
1861
1861
|
},
|
|
1862
1862
|
{
|
|
1863
|
-
flag:
|
|
1863
|
+
flag: E.Word,
|
|
1864
1864
|
hints: [
|
|
1865
1865
|
"[data-motion-word]",
|
|
1866
1866
|
"[data-word]",
|
|
@@ -1869,7 +1869,7 @@ const v = {
|
|
|
1869
1869
|
]
|
|
1870
1870
|
},
|
|
1871
1871
|
{
|
|
1872
|
-
flag:
|
|
1872
|
+
flag: E.Line,
|
|
1873
1873
|
hints: [
|
|
1874
1874
|
"[data-motion-line]",
|
|
1875
1875
|
"[data-line]",
|
|
@@ -1878,7 +1878,7 @@ const v = {
|
|
|
1878
1878
|
]
|
|
1879
1879
|
},
|
|
1880
1880
|
{
|
|
1881
|
-
flag:
|
|
1881
|
+
flag: E.Paragraph,
|
|
1882
1882
|
hints: [
|
|
1883
1883
|
"[data-motion-paragraph]",
|
|
1884
1884
|
"[data-paragraph]",
|
|
@@ -1889,7 +1889,7 @@ const v = {
|
|
|
1889
1889
|
]
|
|
1890
1890
|
},
|
|
1891
1891
|
{
|
|
1892
|
-
flag:
|
|
1892
|
+
flag: E.Emoji,
|
|
1893
1893
|
hints: [
|
|
1894
1894
|
":is([data-motion-emoji],[data-emoji],.tw-motion-emoji,.tw-emoji)",
|
|
1895
1895
|
"[data-motion-emoji]",
|
|
@@ -1898,17 +1898,17 @@ const v = {
|
|
|
1898
1898
|
"[data-emoji]"
|
|
1899
1899
|
]
|
|
1900
1900
|
}
|
|
1901
|
-
], Me =
|
|
1901
|
+
], Me = E.Letter | E.Word | E.Line | E.Paragraph | E.Emoji, mn = E.Letter | E.Word | E.Line | E.Paragraph, ot = /* @__PURE__ */ new Map(), pn = 16384;
|
|
1902
1902
|
function mo(t, e) {
|
|
1903
1903
|
if (!t || t.length > pn)
|
|
1904
1904
|
return t;
|
|
1905
|
-
const r = Pn(e), n =
|
|
1906
|
-
if (o ===
|
|
1905
|
+
const r = Pn(e), n = te(r, E.Emoji), o = r & mn;
|
|
1906
|
+
if (o === E.None && !n)
|
|
1907
1907
|
return t;
|
|
1908
1908
|
const s = t.replace(/\r\n/g, `
|
|
1909
1909
|
`).replace(/\r/g, `
|
|
1910
1910
|
`);
|
|
1911
|
-
if (o ===
|
|
1911
|
+
if (o === E.None)
|
|
1912
1912
|
return ct(s);
|
|
1913
1913
|
const i = _n(s);
|
|
1914
1914
|
if (i.length === 0)
|
|
@@ -1926,10 +1926,10 @@ function gn(t, e, r) {
|
|
|
1926
1926
|
const s = yn(o, e, r);
|
|
1927
1927
|
n.push(...s);
|
|
1928
1928
|
}
|
|
1929
|
-
if (
|
|
1929
|
+
if (te(e, E.Paragraph)) {
|
|
1930
1930
|
const o = r.paragraph++;
|
|
1931
1931
|
return [
|
|
1932
|
-
/* @__PURE__ */
|
|
1932
|
+
/* @__PURE__ */ A.jsx(
|
|
1933
1933
|
"span",
|
|
1934
1934
|
{
|
|
1935
1935
|
"data-motion-paragraph": !0,
|
|
@@ -1944,21 +1944,21 @@ function gn(t, e, r) {
|
|
|
1944
1944
|
}
|
|
1945
1945
|
function yn(t, e, r) {
|
|
1946
1946
|
const n = Sn(t.text, e, r), o = [];
|
|
1947
|
-
if (
|
|
1947
|
+
if (te(e, E.Line)) {
|
|
1948
1948
|
const s = r.line++;
|
|
1949
1949
|
o.push(
|
|
1950
|
-
/* @__PURE__ */
|
|
1950
|
+
/* @__PURE__ */ A.jsx("span", { "data-motion-line": !0, style: ge(s), children: n }, `motion-line-${s}`)
|
|
1951
1951
|
);
|
|
1952
1952
|
} else
|
|
1953
1953
|
o.push(...n);
|
|
1954
1954
|
for (let s = 0; s < t.breaks; s++)
|
|
1955
|
-
o.push(/* @__PURE__ */
|
|
1955
|
+
o.push(/* @__PURE__ */ A.jsx("br", {}, `motion-break-${r.br++}`));
|
|
1956
1956
|
return o;
|
|
1957
1957
|
}
|
|
1958
1958
|
function Sn(t, e, r) {
|
|
1959
1959
|
if (!t)
|
|
1960
1960
|
return [];
|
|
1961
|
-
const n =
|
|
1961
|
+
const n = te(e, E.Word), o = [], s = /(\s+)/g;
|
|
1962
1962
|
let i = 0, a;
|
|
1963
1963
|
for (; (a = s.exec(t)) !== null; ) {
|
|
1964
1964
|
if (a.index > i) {
|
|
@@ -1975,7 +1975,7 @@ function Sn(t, e, r) {
|
|
|
1975
1975
|
}
|
|
1976
1976
|
function st(t, e, r, n) {
|
|
1977
1977
|
const o = e.word++, s = wn(t, r, e), i = `motion-word-${o}`, a = bn(o, n);
|
|
1978
|
-
return n ? /* @__PURE__ */
|
|
1978
|
+
return n ? /* @__PURE__ */ A.jsx("span", { "data-motion-word": !0, style: a, children: s }, i) : /* @__PURE__ */ A.jsx("span", { style: a, children: s }, i);
|
|
1979
1979
|
}
|
|
1980
1980
|
function bn(t, e) {
|
|
1981
1981
|
return e ? { ...ge(t), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
|
|
@@ -1983,7 +1983,7 @@ function bn(t, e) {
|
|
|
1983
1983
|
function wn(t, e, r) {
|
|
1984
1984
|
if (!t)
|
|
1985
1985
|
return [];
|
|
1986
|
-
const n =
|
|
1986
|
+
const n = te(e, E.Letter), o = te(e, E.Emoji);
|
|
1987
1987
|
if (!n) {
|
|
1988
1988
|
if (!o)
|
|
1989
1989
|
return [t];
|
|
@@ -1999,13 +1999,13 @@ function wn(t, e, r) {
|
|
|
1999
1999
|
if (a === `
|
|
2000
2000
|
`) {
|
|
2001
2001
|
s.push(
|
|
2002
|
-
/* @__PURE__ */
|
|
2002
|
+
/* @__PURE__ */ A.jsx("span", { "data-motion-letter": !0, style: u, children: /* @__PURE__ */ A.jsx("br", {}) }, f)
|
|
2003
2003
|
);
|
|
2004
2004
|
continue;
|
|
2005
2005
|
}
|
|
2006
|
-
const
|
|
2006
|
+
const l = o && mt(a) ? { "data-motion-emoji": !0 } : void 0, g = a === " " ? " " : a;
|
|
2007
2007
|
s.push(
|
|
2008
|
-
/* @__PURE__ */
|
|
2008
|
+
/* @__PURE__ */ A.jsx("span", { "data-motion-letter": !0, style: u, ...l, children: g }, f)
|
|
2009
2009
|
);
|
|
2010
2010
|
}
|
|
2011
2011
|
return s;
|
|
@@ -2016,9 +2016,9 @@ function Le(t) {
|
|
|
2016
2016
|
const e = vn();
|
|
2017
2017
|
return e ? Array.from(e.segment(t), (r) => r.segment) : Rn(t);
|
|
2018
2018
|
}
|
|
2019
|
-
let
|
|
2019
|
+
let ie;
|
|
2020
2020
|
function vn() {
|
|
2021
|
-
return
|
|
2021
|
+
return ie !== void 0 || (typeof Intl < "u" && typeof Intl.Segmenter == "function" ? ie = new Intl.Segmenter(void 0, { granularity: "grapheme" }) : ie = null), ie;
|
|
2022
2022
|
}
|
|
2023
2023
|
function Rn(t) {
|
|
2024
2024
|
const e = [], r = Array.from(t);
|
|
@@ -2107,7 +2107,7 @@ function Nn(t) {
|
|
|
2107
2107
|
r.push(n), n.breaks >= 2 && (e.push(r), r = []);
|
|
2108
2108
|
return r.length > 0 && e.push(r), e;
|
|
2109
2109
|
}
|
|
2110
|
-
function
|
|
2110
|
+
function te(t, e) {
|
|
2111
2111
|
return (t & e) === e;
|
|
2112
2112
|
}
|
|
2113
2113
|
function ge(t) {
|
|
@@ -2147,7 +2147,7 @@ function pt(t, e) {
|
|
|
2147
2147
|
o = !0, i();
|
|
2148
2148
|
const f = `motion-emoji-${e ? e.emoji++ : s++}`;
|
|
2149
2149
|
r.push(
|
|
2150
|
-
/* @__PURE__ */
|
|
2150
|
+
/* @__PURE__ */ A.jsx("span", { "data-motion-emoji": !0, children: a }, f)
|
|
2151
2151
|
);
|
|
2152
2152
|
continue;
|
|
2153
2153
|
}
|
|
@@ -2157,22 +2157,22 @@ function pt(t, e) {
|
|
|
2157
2157
|
}
|
|
2158
2158
|
function Pn(t) {
|
|
2159
2159
|
if (!t)
|
|
2160
|
-
return
|
|
2160
|
+
return E.None;
|
|
2161
2161
|
const e = t.trim();
|
|
2162
2162
|
if (!e)
|
|
2163
|
-
return
|
|
2163
|
+
return E.None;
|
|
2164
2164
|
const r = ot.get(e);
|
|
2165
2165
|
if (typeof r == "number")
|
|
2166
2166
|
return r;
|
|
2167
2167
|
if (typeof document > "u")
|
|
2168
|
-
return
|
|
2168
|
+
return E.None;
|
|
2169
2169
|
const n = e.split(/\s+/).filter(Boolean);
|
|
2170
2170
|
if (n.length === 0)
|
|
2171
|
-
return
|
|
2171
|
+
return E.None;
|
|
2172
2172
|
const s = n.map((c) => `.${jn(c)}`).map(
|
|
2173
2173
|
(c) => new RegExp(`(^|[^a-zA-Z0-9_-])${Mn(c)}(?![a-zA-Z0-9_-])`)
|
|
2174
2174
|
);
|
|
2175
|
-
let i =
|
|
2175
|
+
let i = E.None, a = !1;
|
|
2176
2176
|
for (const c of Array.from(document.styleSheets)) {
|
|
2177
2177
|
let f;
|
|
2178
2178
|
try {
|
|
@@ -2185,12 +2185,12 @@ function Pn(t) {
|
|
|
2185
2185
|
break;
|
|
2186
2186
|
a ||= u.sawStyleRule;
|
|
2187
2187
|
}
|
|
2188
|
-
return (i !==
|
|
2188
|
+
return (i !== E.None || a) && ot.set(e, i), i;
|
|
2189
2189
|
}
|
|
2190
2190
|
function gt(t, e) {
|
|
2191
2191
|
if (!t)
|
|
2192
|
-
return { mask:
|
|
2193
|
-
let r =
|
|
2192
|
+
return { mask: E.None, sawStyleRule: !1 };
|
|
2193
|
+
let r = E.None, n = !1;
|
|
2194
2194
|
for (let o = 0; o < t.length; o++) {
|
|
2195
2195
|
const s = t[o];
|
|
2196
2196
|
if (s) {
|
|
@@ -2243,7 +2243,7 @@ function St() {
|
|
|
2243
2243
|
console.warn("Failed to clear auth session from localStorage");
|
|
2244
2244
|
}
|
|
2245
2245
|
}
|
|
2246
|
-
function
|
|
2246
|
+
function ae(t) {
|
|
2247
2247
|
return {
|
|
2248
2248
|
id: "",
|
|
2249
2249
|
provider: t.provider,
|
|
@@ -2393,7 +2393,7 @@ function vt(t) {
|
|
|
2393
2393
|
t === "localhost" || /^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)
|
|
2394
2394
|
);
|
|
2395
2395
|
}
|
|
2396
|
-
class
|
|
2396
|
+
class P extends Error {
|
|
2397
2397
|
constructor({ message: e, code: r, cause: n, name: o }) {
|
|
2398
2398
|
super(e, { cause: n }), Object.defineProperty(this, "code", {
|
|
2399
2399
|
enumerable: !0,
|
|
@@ -2409,14 +2409,14 @@ function Yn({ error: t, options: e }) {
|
|
|
2409
2409
|
throw Error("options was missing required publicKey property");
|
|
2410
2410
|
if (t.name === "AbortError") {
|
|
2411
2411
|
if (e.signal instanceof AbortSignal)
|
|
2412
|
-
return new
|
|
2412
|
+
return new P({
|
|
2413
2413
|
message: "Registration ceremony was sent an abort signal",
|
|
2414
2414
|
code: "ERROR_CEREMONY_ABORTED",
|
|
2415
2415
|
cause: t
|
|
2416
2416
|
});
|
|
2417
2417
|
} else if (t.name === "ConstraintError") {
|
|
2418
2418
|
if (r.authenticatorSelection?.requireResidentKey === !0)
|
|
2419
|
-
return new
|
|
2419
|
+
return new P({
|
|
2420
2420
|
message: "Discoverable credentials were required but no available authenticator supported it",
|
|
2421
2421
|
code: "ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",
|
|
2422
2422
|
cause: t
|
|
@@ -2425,36 +2425,36 @@ function Yn({ error: t, options: e }) {
|
|
|
2425
2425
|
// @ts-ignore: `mediation` doesn't yet exist on CredentialCreationOptions but it's possible as of Sept 2024
|
|
2426
2426
|
e.mediation === "conditional" && r.authenticatorSelection?.userVerification === "required"
|
|
2427
2427
|
)
|
|
2428
|
-
return new
|
|
2428
|
+
return new P({
|
|
2429
2429
|
message: "User verification was required during automatic registration but it could not be performed",
|
|
2430
2430
|
code: "ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",
|
|
2431
2431
|
cause: t
|
|
2432
2432
|
});
|
|
2433
2433
|
if (r.authenticatorSelection?.userVerification === "required")
|
|
2434
|
-
return new
|
|
2434
|
+
return new P({
|
|
2435
2435
|
message: "User verification was required but no available authenticator supported it",
|
|
2436
2436
|
code: "ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",
|
|
2437
2437
|
cause: t
|
|
2438
2438
|
});
|
|
2439
2439
|
} else {
|
|
2440
2440
|
if (t.name === "InvalidStateError")
|
|
2441
|
-
return new
|
|
2441
|
+
return new P({
|
|
2442
2442
|
message: "The authenticator was previously registered",
|
|
2443
2443
|
code: "ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",
|
|
2444
2444
|
cause: t
|
|
2445
2445
|
});
|
|
2446
2446
|
if (t.name === "NotAllowedError")
|
|
2447
|
-
return new
|
|
2447
|
+
return new P({
|
|
2448
2448
|
message: t.message,
|
|
2449
2449
|
code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
|
|
2450
2450
|
cause: t
|
|
2451
2451
|
});
|
|
2452
2452
|
if (t.name === "NotSupportedError")
|
|
2453
|
-
return r.pubKeyCredParams.filter((o) => o.type === "public-key").length === 0 ? new
|
|
2453
|
+
return r.pubKeyCredParams.filter((o) => o.type === "public-key").length === 0 ? new P({
|
|
2454
2454
|
message: 'No entry in pubKeyCredParams was of type "public-key"',
|
|
2455
2455
|
code: "ERROR_MALFORMED_PUBKEYCREDPARAMS",
|
|
2456
2456
|
cause: t
|
|
2457
|
-
}) : new
|
|
2457
|
+
}) : new P({
|
|
2458
2458
|
message: "No available authenticator supported any of the specified pubKeyCredParams algorithms",
|
|
2459
2459
|
code: "ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",
|
|
2460
2460
|
cause: t
|
|
@@ -2463,25 +2463,25 @@ function Yn({ error: t, options: e }) {
|
|
|
2463
2463
|
const n = globalThis.location.hostname;
|
|
2464
2464
|
if (vt(n)) {
|
|
2465
2465
|
if (r.rp.id !== n)
|
|
2466
|
-
return new
|
|
2466
|
+
return new P({
|
|
2467
2467
|
message: `The RP ID "${r.rp.id}" is invalid for this domain`,
|
|
2468
2468
|
code: "ERROR_INVALID_RP_ID",
|
|
2469
2469
|
cause: t
|
|
2470
2470
|
});
|
|
2471
|
-
} else return new
|
|
2471
|
+
} else return new P({
|
|
2472
2472
|
message: `${globalThis.location.hostname} is an invalid domain`,
|
|
2473
2473
|
code: "ERROR_INVALID_DOMAIN",
|
|
2474
2474
|
cause: t
|
|
2475
2475
|
});
|
|
2476
2476
|
} else if (t.name === "TypeError") {
|
|
2477
2477
|
if (r.user.id.byteLength < 1 || r.user.id.byteLength > 64)
|
|
2478
|
-
return new
|
|
2478
|
+
return new P({
|
|
2479
2479
|
message: "User ID was not between 1 and 64 characters",
|
|
2480
2480
|
code: "ERROR_INVALID_USER_ID_LENGTH",
|
|
2481
2481
|
cause: t
|
|
2482
2482
|
});
|
|
2483
2483
|
} else if (t.name === "UnknownError")
|
|
2484
|
-
return new
|
|
2484
|
+
return new P({
|
|
2485
2485
|
message: "The authenticator was unable to process the specified options, or could not create a new credential",
|
|
2486
2486
|
code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
|
|
2487
2487
|
cause: t
|
|
@@ -2551,18 +2551,18 @@ async function qn(t) {
|
|
|
2551
2551
|
} catch (y) {
|
|
2552
2552
|
ke("getPublicKeyAlgorithm()", y);
|
|
2553
2553
|
}
|
|
2554
|
-
let
|
|
2554
|
+
let l;
|
|
2555
2555
|
if (typeof c.getPublicKey == "function")
|
|
2556
2556
|
try {
|
|
2557
2557
|
const y = c.getPublicKey();
|
|
2558
|
-
y !== null && (
|
|
2558
|
+
y !== null && (l = W(y));
|
|
2559
2559
|
} catch (y) {
|
|
2560
2560
|
ke("getPublicKey()", y);
|
|
2561
2561
|
}
|
|
2562
|
-
let
|
|
2562
|
+
let g;
|
|
2563
2563
|
if (typeof c.getAuthenticatorData == "function")
|
|
2564
2564
|
try {
|
|
2565
|
-
|
|
2565
|
+
g = W(c.getAuthenticatorData());
|
|
2566
2566
|
} catch (y) {
|
|
2567
2567
|
ke("getAuthenticatorData()", y);
|
|
2568
2568
|
}
|
|
@@ -2574,8 +2574,8 @@ async function qn(t) {
|
|
|
2574
2574
|
clientDataJSON: W(c.clientDataJSON),
|
|
2575
2575
|
transports: u,
|
|
2576
2576
|
publicKeyAlgorithm: h,
|
|
2577
|
-
publicKey:
|
|
2578
|
-
authenticatorData:
|
|
2577
|
+
publicKey: l,
|
|
2578
|
+
authenticatorData: g
|
|
2579
2579
|
},
|
|
2580
2580
|
type: f,
|
|
2581
2581
|
clientExtensionResults: s.getClientExtensionResults(),
|
|
@@ -2601,14 +2601,14 @@ function Hn({ error: t, options: e }) {
|
|
|
2601
2601
|
throw Error("options was missing required publicKey property");
|
|
2602
2602
|
if (t.name === "AbortError") {
|
|
2603
2603
|
if (e.signal instanceof AbortSignal)
|
|
2604
|
-
return new
|
|
2604
|
+
return new P({
|
|
2605
2605
|
message: "Authentication ceremony was sent an abort signal",
|
|
2606
2606
|
code: "ERROR_CEREMONY_ABORTED",
|
|
2607
2607
|
cause: t
|
|
2608
2608
|
});
|
|
2609
2609
|
} else {
|
|
2610
2610
|
if (t.name === "NotAllowedError")
|
|
2611
|
-
return new
|
|
2611
|
+
return new P({
|
|
2612
2612
|
message: t.message,
|
|
2613
2613
|
code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
|
|
2614
2614
|
cause: t
|
|
@@ -2617,18 +2617,18 @@ function Hn({ error: t, options: e }) {
|
|
|
2617
2617
|
const n = globalThis.location.hostname;
|
|
2618
2618
|
if (vt(n)) {
|
|
2619
2619
|
if (r.rpId !== n)
|
|
2620
|
-
return new
|
|
2620
|
+
return new P({
|
|
2621
2621
|
message: `The RP ID "${r.rpId}" is invalid for this domain`,
|
|
2622
2622
|
code: "ERROR_INVALID_RP_ID",
|
|
2623
2623
|
cause: t
|
|
2624
2624
|
});
|
|
2625
|
-
} else return new
|
|
2625
|
+
} else return new P({
|
|
2626
2626
|
message: `${globalThis.location.hostname} is an invalid domain`,
|
|
2627
2627
|
code: "ERROR_INVALID_DOMAIN",
|
|
2628
2628
|
cause: t
|
|
2629
2629
|
});
|
|
2630
2630
|
} else if (t.name === "UnknownError")
|
|
2631
|
-
return new
|
|
2631
|
+
return new P({
|
|
2632
2632
|
message: "The authenticator was unable to process the specified options, or could not create a new assertion signature",
|
|
2633
2633
|
code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
|
|
2634
2634
|
cause: t
|
|
@@ -2659,21 +2659,21 @@ async function Jn(t) {
|
|
|
2659
2659
|
let a;
|
|
2660
2660
|
try {
|
|
2661
2661
|
a = await navigator.credentials.get(i);
|
|
2662
|
-
} catch (
|
|
2663
|
-
throw Hn({ error:
|
|
2662
|
+
} catch (g) {
|
|
2663
|
+
throw Hn({ error: g, options: i });
|
|
2664
2664
|
}
|
|
2665
2665
|
if (!a)
|
|
2666
2666
|
throw new Error("Authentication was not completed");
|
|
2667
2667
|
const { id: c, rawId: f, response: u, type: h } = a;
|
|
2668
|
-
let
|
|
2669
|
-
return u.userHandle && (
|
|
2668
|
+
let l;
|
|
2669
|
+
return u.userHandle && (l = W(u.userHandle)), {
|
|
2670
2670
|
id: c,
|
|
2671
2671
|
rawId: W(f),
|
|
2672
2672
|
response: {
|
|
2673
2673
|
authenticatorData: W(u.authenticatorData),
|
|
2674
2674
|
clientDataJSON: W(u.clientDataJSON),
|
|
2675
2675
|
signature: W(u.signature),
|
|
2676
|
-
userHandle:
|
|
2676
|
+
userHandle: l
|
|
2677
2677
|
},
|
|
2678
2678
|
type: h,
|
|
2679
2679
|
clientExtensionResults: a.getClientExtensionResults(),
|
|
@@ -2682,13 +2682,13 @@ async function Jn(t) {
|
|
|
2682
2682
|
}
|
|
2683
2683
|
const Ve = lt(null);
|
|
2684
2684
|
function go({ children: t, config: e }) {
|
|
2685
|
-
const [r, n] =
|
|
2685
|
+
const [r, n] = G({
|
|
2686
2686
|
isAuthenticated: !1,
|
|
2687
2687
|
isLoading: !0,
|
|
2688
2688
|
user: null,
|
|
2689
2689
|
error: null
|
|
2690
2690
|
});
|
|
2691
|
-
|
|
2691
|
+
L(() => {
|
|
2692
2692
|
(() => {
|
|
2693
2693
|
const u = xn();
|
|
2694
2694
|
if (u) {
|
|
@@ -2702,25 +2702,25 @@ function go({ children: t, config: e }) {
|
|
|
2702
2702
|
}
|
|
2703
2703
|
const h = Un();
|
|
2704
2704
|
if (h) {
|
|
2705
|
-
const
|
|
2705
|
+
const g = {
|
|
2706
2706
|
token: h.token,
|
|
2707
2707
|
provider: h.provider,
|
|
2708
2708
|
authenticatedAt: Date.now()
|
|
2709
2709
|
};
|
|
2710
|
-
ye(
|
|
2710
|
+
ye(g), ut(), n({
|
|
2711
2711
|
isAuthenticated: !0,
|
|
2712
2712
|
isLoading: !1,
|
|
2713
|
-
user:
|
|
2713
|
+
user: ae(g),
|
|
2714
2714
|
error: null
|
|
2715
2715
|
});
|
|
2716
2716
|
return;
|
|
2717
2717
|
}
|
|
2718
|
-
const
|
|
2719
|
-
if (
|
|
2718
|
+
const l = yt();
|
|
2719
|
+
if (l) {
|
|
2720
2720
|
n({
|
|
2721
2721
|
isAuthenticated: !0,
|
|
2722
2722
|
isLoading: !1,
|
|
2723
|
-
user:
|
|
2723
|
+
user: ae(l),
|
|
2724
2724
|
error: null
|
|
2725
2725
|
});
|
|
2726
2726
|
return;
|
|
@@ -2733,50 +2733,50 @@ function go({ children: t, config: e }) {
|
|
|
2733
2733
|
});
|
|
2734
2734
|
})();
|
|
2735
2735
|
}, []);
|
|
2736
|
-
const o =
|
|
2736
|
+
const o = x(
|
|
2737
2737
|
async (f) => {
|
|
2738
2738
|
if (!e.spaceId) {
|
|
2739
|
-
n((
|
|
2740
|
-
...
|
|
2739
|
+
n((l) => ({
|
|
2740
|
+
...l,
|
|
2741
2741
|
error: "Space ID is not configured"
|
|
2742
2742
|
}));
|
|
2743
2743
|
return;
|
|
2744
2744
|
}
|
|
2745
2745
|
const u = e.authUrl ?? Oe();
|
|
2746
2746
|
if (f === "guest") {
|
|
2747
|
-
n((
|
|
2747
|
+
n((l) => ({ ...l, isLoading: !0 }));
|
|
2748
2748
|
try {
|
|
2749
|
-
const
|
|
2749
|
+
const l = await bt(e.spaceId, u);
|
|
2750
2750
|
n({
|
|
2751
2751
|
isAuthenticated: !0,
|
|
2752
2752
|
isLoading: !1,
|
|
2753
|
-
user:
|
|
2753
|
+
user: ae(l),
|
|
2754
2754
|
error: null
|
|
2755
2755
|
});
|
|
2756
|
-
} catch (
|
|
2757
|
-
n((
|
|
2758
|
-
...
|
|
2756
|
+
} catch (l) {
|
|
2757
|
+
n((g) => ({
|
|
2758
|
+
...g,
|
|
2759
2759
|
isLoading: !1,
|
|
2760
|
-
error:
|
|
2760
|
+
error: l instanceof Error ? l.message : "Guest login failed"
|
|
2761
2761
|
}));
|
|
2762
2762
|
}
|
|
2763
2763
|
return;
|
|
2764
2764
|
}
|
|
2765
2765
|
if (f === "passkey") {
|
|
2766
|
-
n((
|
|
2766
|
+
n((l) => ({ ...l, isLoading: !0, error: null }));
|
|
2767
2767
|
try {
|
|
2768
|
-
const
|
|
2768
|
+
const l = await $n(u), g = await Jn({ optionsJSON: l }), y = await Vn(u, g);
|
|
2769
2769
|
n({
|
|
2770
2770
|
isAuthenticated: !0,
|
|
2771
2771
|
isLoading: !1,
|
|
2772
|
-
user:
|
|
2772
|
+
user: ae(y),
|
|
2773
2773
|
error: null
|
|
2774
2774
|
});
|
|
2775
|
-
} catch (
|
|
2776
|
-
n((
|
|
2777
|
-
...
|
|
2775
|
+
} catch (l) {
|
|
2776
|
+
n((g) => ({
|
|
2777
|
+
...g,
|
|
2778
2778
|
isLoading: !1,
|
|
2779
|
-
error:
|
|
2779
|
+
error: l instanceof Error ? l.message : "Passkey login failed"
|
|
2780
2780
|
}));
|
|
2781
2781
|
}
|
|
2782
2782
|
return;
|
|
@@ -2785,35 +2785,35 @@ function go({ children: t, config: e }) {
|
|
|
2785
2785
|
window.location.href = h;
|
|
2786
2786
|
},
|
|
2787
2787
|
[e.authUrl, e.spaceId]
|
|
2788
|
-
), s =
|
|
2788
|
+
), s = x(() => {
|
|
2789
2789
|
St(), n({
|
|
2790
2790
|
isAuthenticated: !1,
|
|
2791
2791
|
isLoading: !1,
|
|
2792
2792
|
user: null,
|
|
2793
2793
|
error: null
|
|
2794
2794
|
});
|
|
2795
|
-
}, []), i =
|
|
2795
|
+
}, []), i = x(
|
|
2796
2796
|
async (f) => {
|
|
2797
2797
|
const u = e.authUrl ?? Oe();
|
|
2798
2798
|
n((h) => ({ ...h, isLoading: !0, error: null }));
|
|
2799
2799
|
try {
|
|
2800
|
-
const h = await Fn(u),
|
|
2800
|
+
const h = await Fn(u), l = await qn({ optionsJSON: h }), g = await Bn(u, l, f);
|
|
2801
2801
|
n({
|
|
2802
2802
|
isAuthenticated: !0,
|
|
2803
2803
|
isLoading: !1,
|
|
2804
|
-
user:
|
|
2804
|
+
user: ae(g),
|
|
2805
2805
|
error: null
|
|
2806
2806
|
});
|
|
2807
2807
|
} catch (h) {
|
|
2808
|
-
n((
|
|
2809
|
-
...
|
|
2808
|
+
n((l) => ({
|
|
2809
|
+
...l,
|
|
2810
2810
|
isLoading: !1,
|
|
2811
2811
|
error: h instanceof Error ? h.message : "Passkey registration failed"
|
|
2812
2812
|
}));
|
|
2813
2813
|
}
|
|
2814
2814
|
},
|
|
2815
2815
|
[e.authUrl]
|
|
2816
|
-
), a =
|
|
2816
|
+
), a = x(() => r.user?.token ?? null, [r.user]), c = $(
|
|
2817
2817
|
() => ({
|
|
2818
2818
|
state: r,
|
|
2819
2819
|
login: o,
|
|
@@ -2823,7 +2823,7 @@ function go({ children: t, config: e }) {
|
|
|
2823
2823
|
}),
|
|
2824
2824
|
[r, o, s, a, i]
|
|
2825
2825
|
);
|
|
2826
|
-
return /* @__PURE__ */
|
|
2826
|
+
return /* @__PURE__ */ A.jsx(Ve, { value: c, children: t });
|
|
2827
2827
|
}
|
|
2828
2828
|
function Xn() {
|
|
2829
2829
|
const t = xe(Ve);
|
|
@@ -2835,8 +2835,8 @@ function yo() {
|
|
|
2835
2835
|
return xe(Ve);
|
|
2836
2836
|
}
|
|
2837
2837
|
function So(t) {
|
|
2838
|
-
const { config: e, guestUrlParam: r } = t, { state: n, login: o } = Xn(), s =
|
|
2839
|
-
return
|
|
2838
|
+
const { config: e, guestUrlParam: r } = t, { state: n, login: o } = Xn(), s = T(!1);
|
|
2839
|
+
return L(() => {
|
|
2840
2840
|
if (!r || n.isAuthenticated || n.isLoading || s.current || !e.methods.includes("guest"))
|
|
2841
2841
|
return;
|
|
2842
2842
|
const i = new URLSearchParams(window.location.search), a = i.get(r);
|
|
@@ -2865,7 +2865,7 @@ function bo({
|
|
|
2865
2865
|
renderConnectingSlow: f,
|
|
2866
2866
|
renderConnected: u,
|
|
2867
2867
|
renderOffline: h,
|
|
2868
|
-
renderError:
|
|
2868
|
+
renderError: l
|
|
2869
2869
|
}) {
|
|
2870
2870
|
switch (t) {
|
|
2871
2871
|
case "idle":
|
|
@@ -2886,7 +2886,7 @@ function bo({
|
|
|
2886
2886
|
case "offline":
|
|
2887
2887
|
return h();
|
|
2888
2888
|
case "offlineError":
|
|
2889
|
-
return
|
|
2889
|
+
return l(e ?? s?.lastError?.message ?? null);
|
|
2890
2890
|
default:
|
|
2891
2891
|
return null;
|
|
2892
2892
|
}
|
|
@@ -2901,122 +2901,126 @@ function Qn() {
|
|
|
2901
2901
|
return window.__IKON_LOCAL_IKON_SERVER_CONFIG__;
|
|
2902
2902
|
}
|
|
2903
2903
|
function wo(t) {
|
|
2904
|
-
const { authConfig: e, modules: r, timeouts: n, backgroundAudio: o, webRtc: s } = t,
|
|
2905
|
-
|
|
2906
|
-
const [
|
|
2904
|
+
const { authConfig: e, modules: r, timeouts: n, backgroundAudio: o, webRtc: s, audio: i, video: a } = t, c = e === void 0 ? Zn() ?? null : e, f = Qn(), u = T(null), h = T(null), l = T(null), g = T(!1), y = T(o), S = T(n), m = T(s), p = T(i), v = T(a);
|
|
2905
|
+
y.current = o, S.current = n, m.current = s, p.current = i, v.current = a;
|
|
2906
|
+
const [k, _] = G("idle"), [D, z] = G(null), [H, C] = G(null), [I, F] = G(null), [N, U] = G(!1), O = $(() => {
|
|
2907
2907
|
try {
|
|
2908
|
-
const
|
|
2909
|
-
return (
|
|
2908
|
+
const b = Nt();
|
|
2909
|
+
return (b.sessionId || b.channelKey) && Pt(), b;
|
|
2910
2910
|
} catch {
|
|
2911
2911
|
return { parameters: {} };
|
|
2912
2912
|
}
|
|
2913
|
-
}, []),
|
|
2914
|
-
|
|
2915
|
-
!
|
|
2916
|
-
|
|
2917
|
-
}).catch((
|
|
2918
|
-
Ie.error("Anonymous auth failed:",
|
|
2913
|
+
}, []), K = $(() => c?.enabled ? yt() : null, [c?.enabled]), J = f?.enabled ?? !1, X = f?.host ?? "localhost", Z = f?.port ?? 8443;
|
|
2914
|
+
L(() => {
|
|
2915
|
+
!J && Ke() && c && !c.enabled && c.spaceId && !I && !N && (U(!0), bt(c.spaceId, c.authUrl ?? Oe()).then((R) => {
|
|
2916
|
+
F(R.token);
|
|
2917
|
+
}).catch((R) => {
|
|
2918
|
+
Ie.error("Anonymous auth failed:", R), z(R instanceof Error ? R.message : "Anonymous auth failed");
|
|
2919
2919
|
}).finally(() => {
|
|
2920
|
-
|
|
2920
|
+
U(!1);
|
|
2921
2921
|
}));
|
|
2922
|
-
}, [
|
|
2923
|
-
const
|
|
2924
|
-
if (
|
|
2925
|
-
const
|
|
2922
|
+
}, [J, c, I, N]);
|
|
2923
|
+
const Q = $(() => {
|
|
2924
|
+
if (J) {
|
|
2925
|
+
const b = K?.token ? jt(K.token) ?? void 0 : void 0;
|
|
2926
2926
|
return {
|
|
2927
2927
|
local: {
|
|
2928
|
-
host:
|
|
2929
|
-
httpsPort:
|
|
2930
|
-
userId:
|
|
2931
|
-
token:
|
|
2932
|
-
spaceId:
|
|
2933
|
-
parameters:
|
|
2928
|
+
host: X,
|
|
2929
|
+
httpsPort: Z,
|
|
2930
|
+
userId: b,
|
|
2931
|
+
token: K?.token ?? void 0,
|
|
2932
|
+
spaceId: c?.spaceId,
|
|
2933
|
+
parameters: O.parameters
|
|
2934
2934
|
}
|
|
2935
2935
|
};
|
|
2936
2936
|
}
|
|
2937
|
-
return
|
|
2937
|
+
return K?.token && c?.spaceId ? {
|
|
2938
2938
|
sessionToken: {
|
|
2939
|
-
token:
|
|
2940
|
-
spaceId:
|
|
2939
|
+
token: K.token,
|
|
2940
|
+
spaceId: c.spaceId,
|
|
2941
2941
|
backendType: Ye(),
|
|
2942
|
-
sessionId:
|
|
2943
|
-
channelKey:
|
|
2944
|
-
parameters:
|
|
2942
|
+
sessionId: O.sessionId,
|
|
2943
|
+
channelKey: O.channelKey,
|
|
2944
|
+
parameters: O.parameters
|
|
2945
2945
|
}
|
|
2946
|
-
} :
|
|
2946
|
+
} : I && c?.spaceId ? {
|
|
2947
2947
|
sessionToken: {
|
|
2948
|
-
token:
|
|
2949
|
-
spaceId:
|
|
2948
|
+
token: I,
|
|
2949
|
+
spaceId: c.spaceId,
|
|
2950
2950
|
backendType: Ye(),
|
|
2951
|
-
sessionId:
|
|
2952
|
-
channelKey:
|
|
2953
|
-
parameters:
|
|
2951
|
+
sessionId: O.sessionId,
|
|
2952
|
+
channelKey: O.channelKey,
|
|
2953
|
+
parameters: O.parameters
|
|
2954
2954
|
}
|
|
2955
2955
|
} : Ke() ? null : {
|
|
2956
2956
|
local: {
|
|
2957
|
-
host:
|
|
2958
|
-
httpsPort:
|
|
2959
|
-
spaceId:
|
|
2960
|
-
parameters:
|
|
2957
|
+
host: X,
|
|
2958
|
+
httpsPort: Z,
|
|
2959
|
+
spaceId: c?.spaceId,
|
|
2960
|
+
parameters: O.parameters
|
|
2961
2961
|
}
|
|
2962
2962
|
};
|
|
2963
|
-
}, [
|
|
2964
|
-
Wr(
|
|
2965
|
-
const
|
|
2966
|
-
|
|
2967
|
-
if (!
|
|
2968
|
-
if (
|
|
2969
|
-
for (const
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
Ie.error("Failed to load UI modules",
|
|
2963
|
+
}, [J, X, Z, K?.token, c?.spaceId, I, O.sessionId, O.channelKey, O.parameters]);
|
|
2964
|
+
Wr(H);
|
|
2965
|
+
const ue = qr(H);
|
|
2966
|
+
L(() => {
|
|
2967
|
+
if (!g.current) {
|
|
2968
|
+
if (g.current = !0, l.current = xr(), r)
|
|
2969
|
+
for (const b of r)
|
|
2970
|
+
b(l.current);
|
|
2971
|
+
l.current.loadRegisteredModules().catch((b) => {
|
|
2972
|
+
Ie.error("Failed to load UI modules", b);
|
|
2973
2973
|
});
|
|
2974
2974
|
}
|
|
2975
|
-
}, []),
|
|
2976
|
-
if (!
|
|
2977
|
-
const
|
|
2978
|
-
...
|
|
2979
|
-
timeouts:
|
|
2980
|
-
audio:
|
|
2975
|
+
}, []), L(() => {
|
|
2976
|
+
if (!Q) return;
|
|
2977
|
+
const b = new Mt({
|
|
2978
|
+
...Q,
|
|
2979
|
+
timeouts: S.current,
|
|
2980
|
+
audio: p.current !== void 0 || y.current ? {
|
|
2981
|
+
enabled: p.current,
|
|
2982
|
+
...y.current ? { background: { allowOnDesktop: !0, allowOnMobile: !0 } } : {}
|
|
2983
|
+
} : void 0,
|
|
2984
|
+
video: v.current !== void 0 ? { enabled: v.current } : void 0,
|
|
2981
2985
|
mediaSession: { title: document.title || void 0, artist: document.title || void 0 },
|
|
2982
|
-
webRtc:
|
|
2983
|
-
onConnectionStateChange: (
|
|
2984
|
-
|
|
2986
|
+
webRtc: m.current ? { enabled: !0 } : void 0,
|
|
2987
|
+
onConnectionStateChange: (j) => {
|
|
2988
|
+
_(j);
|
|
2985
2989
|
},
|
|
2986
|
-
onError: (
|
|
2987
|
-
|
|
2990
|
+
onError: (j) => {
|
|
2991
|
+
z(j.message);
|
|
2988
2992
|
}
|
|
2989
2993
|
});
|
|
2990
|
-
|
|
2991
|
-
const
|
|
2992
|
-
return
|
|
2993
|
-
Ie.error("Connection failed:",
|
|
2994
|
+
u.current = b;
|
|
2995
|
+
const R = new Zt({ client: b });
|
|
2996
|
+
return h.current = R, C(R), b.connect().catch((j) => {
|
|
2997
|
+
Ie.error("Connection failed:", j);
|
|
2994
2998
|
}), () => {
|
|
2995
|
-
|
|
2999
|
+
b.disconnect(), u.current = null, R.dispose(), h.current = null;
|
|
2996
3000
|
};
|
|
2997
|
-
}, [
|
|
2998
|
-
const
|
|
2999
|
-
const
|
|
3000
|
-
|
|
3001
|
-
}, []),
|
|
3001
|
+
}, [Q]);
|
|
3002
|
+
const d = x((b, R) => {
|
|
3003
|
+
const j = typeof R == "string" ? R : JSON.stringify(R ?? {});
|
|
3004
|
+
u.current?.sendActionCall(b, j);
|
|
3005
|
+
}, []), w = k === "connected" || k === "reconnecting";
|
|
3002
3006
|
return {
|
|
3003
|
-
connectionState:
|
|
3004
|
-
error:
|
|
3005
|
-
stores:
|
|
3006
|
-
client:
|
|
3007
|
-
registry:
|
|
3008
|
-
clientRef:
|
|
3009
|
-
uiRef:
|
|
3010
|
-
registryRef:
|
|
3011
|
-
onAction:
|
|
3012
|
-
isReady:
|
|
3013
|
-
webRtcVideoStreams:
|
|
3014
|
-
webRtcTrackMap:
|
|
3007
|
+
connectionState: k,
|
|
3008
|
+
error: D,
|
|
3009
|
+
stores: ue,
|
|
3010
|
+
client: u.current,
|
|
3011
|
+
registry: l.current,
|
|
3012
|
+
clientRef: u,
|
|
3013
|
+
uiRef: h,
|
|
3014
|
+
registryRef: l,
|
|
3015
|
+
onAction: d,
|
|
3016
|
+
isReady: w,
|
|
3017
|
+
webRtcVideoStreams: u.current?.webRtcVideoStreams ?? /* @__PURE__ */ new Map(),
|
|
3018
|
+
webRtcTrackMap: u.current?.webRtcTrackMap ?? /* @__PURE__ */ new Map()
|
|
3015
3019
|
};
|
|
3016
3020
|
}
|
|
3017
3021
|
function vo(t) {
|
|
3018
|
-
const e =
|
|
3019
|
-
return
|
|
3022
|
+
const e = T(!1);
|
|
3023
|
+
return x(() => {
|
|
3020
3024
|
if (e.current) return;
|
|
3021
3025
|
e.current = !0;
|
|
3022
3026
|
const r = document.createElement("link");
|
|
@@ -3025,11 +3029,11 @@ function vo(t) {
|
|
|
3025
3029
|
}
|
|
3026
3030
|
let eo = 0;
|
|
3027
3031
|
function Ro(t = 5, e = 5e3) {
|
|
3028
|
-
const [r, n] =
|
|
3032
|
+
const [r, n] = G([]), o = T(/* @__PURE__ */ new Map()), s = x((i) => {
|
|
3029
3033
|
const a = o.current.get(i);
|
|
3030
3034
|
a && (clearTimeout(a), o.current.delete(i)), n((c) => c.filter((f) => f.id !== i));
|
|
3031
3035
|
}, []);
|
|
3032
|
-
return
|
|
3036
|
+
return L(() => {
|
|
3033
3037
|
const i = o.current, a = Lt(
|
|
3034
3038
|
(c) => {
|
|
3035
3039
|
if (!Ut())
|
|
@@ -3040,11 +3044,11 @@ function Ro(t = 5, e = 5e3) {
|
|
|
3040
3044
|
message: c.message,
|
|
3041
3045
|
component: c.component
|
|
3042
3046
|
};
|
|
3043
|
-
n((
|
|
3044
|
-
const
|
|
3047
|
+
n((g) => [...g, h].slice(-t));
|
|
3048
|
+
const l = setTimeout(() => {
|
|
3045
3049
|
s(f);
|
|
3046
3050
|
}, e);
|
|
3047
|
-
i.set(f,
|
|
3051
|
+
i.set(f, l);
|
|
3048
3052
|
},
|
|
3049
3053
|
{ minLevel: We.WARN }
|
|
3050
3054
|
);
|
|
@@ -3076,7 +3080,7 @@ function Eo({
|
|
|
3076
3080
|
defaultLanguage: r,
|
|
3077
3081
|
detectLanguage: n = !1
|
|
3078
3082
|
}) {
|
|
3079
|
-
const o = Object.keys(e), s = no(o, n, r), i = e[s] ?? e.en, a =
|
|
3083
|
+
const o = Object.keys(e), s = no(o, n, r), i = e[s] ?? e.en, a = $(
|
|
3080
3084
|
() => ({
|
|
3081
3085
|
t: (c, f) => {
|
|
3082
3086
|
const u = i[c];
|
|
@@ -3087,7 +3091,7 @@ function Eo({
|
|
|
3087
3091
|
}),
|
|
3088
3092
|
[i, s]
|
|
3089
3093
|
);
|
|
3090
|
-
return /* @__PURE__ */
|
|
3094
|
+
return /* @__PURE__ */ A.jsx(At, { value: a, children: t });
|
|
3091
3095
|
}
|
|
3092
3096
|
function Ao() {
|
|
3093
3097
|
const t = xe(At);
|
|
@@ -3140,7 +3144,7 @@ export {
|
|
|
3140
3144
|
mo as renderMotionLetters,
|
|
3141
3145
|
ye as saveAuthSession,
|
|
3142
3146
|
po as sendMagicLink,
|
|
3143
|
-
|
|
3147
|
+
ae as sessionToUser,
|
|
3144
3148
|
Xn as useAuth,
|
|
3145
3149
|
So as useAuthGuard,
|
|
3146
3150
|
yo as useAuthOptional,
|
|
@@ -3150,6 +3154,6 @@ export {
|
|
|
3150
3154
|
qr as useIkonUiStores,
|
|
3151
3155
|
vo as useLazyFont,
|
|
3152
3156
|
Ro as useToasts,
|
|
3153
|
-
|
|
3157
|
+
q as useUiNode,
|
|
3154
3158
|
co as useUiStore
|
|
3155
3159
|
};
|