@ikonai/sdk-react-ui 1.0.12 → 1.0.13
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 +0 -5
- package/index.js +625 -624
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { IkonUiCore as
|
|
1
|
+
import { IkonUiCore as Tt, UiStreamStore as kt } from "@ikonai/sdk-ui";
|
|
2
2
|
import { UiStreamStore as vo } from "@ikonai/sdk-ui";
|
|
3
|
-
import
|
|
4
|
-
import { createLogger as
|
|
5
|
-
var
|
|
3
|
+
import Ct, { useSyncExternalStore as Ue, useMemo as Y, memo as q, useRef as E, useCallback as x, Fragment as It, useEffect as D, useState as J, createContext as ut, use as xe } from "react";
|
|
4
|
+
import { createLogger as Se, getOrCreateDeviceId as me, deriveAuthUrl as Oe, parseUrlParams as Ot, clearSessionParamsFromUrl as _t, isCloudEnvironment as Ke, extractUserIdFromToken as Nt, deriveBackendType as Ye, IkonClient as Pt, subscribeToLogEvents as Mt, isDebugModeEnabled as jt, LogLevel as ze } from "@ikonai/sdk";
|
|
5
|
+
var he = { exports: {} }, se = {};
|
|
6
6
|
/**
|
|
7
7
|
* @license React
|
|
8
8
|
* react-jsx-runtime.production.js
|
|
@@ -12,10 +12,10 @@ var pe = { exports: {} }, ie = {};
|
|
|
12
12
|
* This source code is licensed under the MIT license found in the
|
|
13
13
|
* LICENSE file in the root directory of this source tree.
|
|
14
14
|
*/
|
|
15
|
-
var
|
|
15
|
+
var We;
|
|
16
16
|
function Lt() {
|
|
17
|
-
if (
|
|
18
|
-
|
|
17
|
+
if (We) return se;
|
|
18
|
+
We = 1;
|
|
19
19
|
var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
|
|
20
20
|
function r(n, o, s) {
|
|
21
21
|
var i = null;
|
|
@@ -32,9 +32,9 @@ function Lt() {
|
|
|
32
32
|
props: s
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
return
|
|
35
|
+
return se.Fragment = e, se.jsx = r, se.jsxs = r, se;
|
|
36
36
|
}
|
|
37
|
-
var
|
|
37
|
+
var ie = {};
|
|
38
38
|
/**
|
|
39
39
|
* @license React
|
|
40
40
|
* react-jsx-runtime.development.js
|
|
@@ -44,246 +44,246 @@ var ae = {};
|
|
|
44
44
|
* This source code is licensed under the MIT license found in the
|
|
45
45
|
* LICENSE file in the root directory of this source tree.
|
|
46
46
|
*/
|
|
47
|
-
var
|
|
47
|
+
var qe;
|
|
48
48
|
function Ut() {
|
|
49
|
-
return
|
|
50
|
-
function t(
|
|
51
|
-
if (
|
|
52
|
-
if (typeof
|
|
53
|
-
return
|
|
54
|
-
if (typeof
|
|
55
|
-
switch (
|
|
49
|
+
return qe || (qe = 1, process.env.NODE_ENV !== "production" && function() {
|
|
50
|
+
function t(l) {
|
|
51
|
+
if (l == null) return null;
|
|
52
|
+
if (typeof l == "function")
|
|
53
|
+
return l.$$typeof === F ? null : l.displayName || l.name || null;
|
|
54
|
+
if (typeof l == "string") return l;
|
|
55
|
+
switch (l) {
|
|
56
56
|
case b:
|
|
57
57
|
return "Fragment";
|
|
58
58
|
case p:
|
|
59
59
|
return "Profiler";
|
|
60
|
-
case
|
|
60
|
+
case h:
|
|
61
61
|
return "StrictMode";
|
|
62
62
|
case j:
|
|
63
63
|
return "Suspense";
|
|
64
64
|
case G:
|
|
65
65
|
return "SuspenseList";
|
|
66
|
-
case
|
|
66
|
+
case N:
|
|
67
67
|
return "Activity";
|
|
68
68
|
}
|
|
69
|
-
if (typeof
|
|
70
|
-
switch (typeof
|
|
69
|
+
if (typeof l == "object")
|
|
70
|
+
switch (typeof l.tag == "number" && console.error(
|
|
71
71
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
72
|
-
),
|
|
73
|
-
case
|
|
72
|
+
), l.$$typeof) {
|
|
73
|
+
case y:
|
|
74
74
|
return "Portal";
|
|
75
|
-
case T:
|
|
76
|
-
return (u.displayName || "Context") + ".Provider";
|
|
77
|
-
case w:
|
|
78
|
-
return (u._context.displayName || "Context") + ".Consumer";
|
|
79
|
-
case I:
|
|
80
|
-
var y = u.render;
|
|
81
|
-
return u = u.displayName, u || (u = y.displayName || y.name || "", u = u !== "" ? "ForwardRef(" + u + ")" : "ForwardRef"), u;
|
|
82
|
-
case Q:
|
|
83
|
-
return y = u.displayName || null, y !== null ? y : t(u.type) || "Memo";
|
|
84
75
|
case k:
|
|
85
|
-
|
|
76
|
+
return (l.displayName || "Context") + ".Provider";
|
|
77
|
+
case v:
|
|
78
|
+
return (l._context.displayName || "Context") + ".Consumer";
|
|
79
|
+
case I:
|
|
80
|
+
var S = l.render;
|
|
81
|
+
return l = l.displayName, l || (l = S.displayName || S.name || "", l = l !== "" ? "ForwardRef(" + l + ")" : "ForwardRef"), l;
|
|
82
|
+
case Z:
|
|
83
|
+
return S = l.displayName || null, S !== null ? S : t(l.type) || "Memo";
|
|
84
|
+
case C:
|
|
85
|
+
S = l._payload, l = l._init;
|
|
86
86
|
try {
|
|
87
|
-
return t(
|
|
87
|
+
return t(l(S));
|
|
88
88
|
} catch {
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
return null;
|
|
92
92
|
}
|
|
93
|
-
function e(
|
|
94
|
-
return "" +
|
|
93
|
+
function e(l) {
|
|
94
|
+
return "" + l;
|
|
95
95
|
}
|
|
96
|
-
function r(
|
|
96
|
+
function r(l) {
|
|
97
97
|
try {
|
|
98
|
-
e(
|
|
99
|
-
var
|
|
98
|
+
e(l);
|
|
99
|
+
var S = !1;
|
|
100
100
|
} catch {
|
|
101
|
-
|
|
101
|
+
S = !0;
|
|
102
102
|
}
|
|
103
|
-
if (
|
|
104
|
-
|
|
105
|
-
var
|
|
106
|
-
return
|
|
107
|
-
|
|
103
|
+
if (S) {
|
|
104
|
+
S = console;
|
|
105
|
+
var T = S.error, O = typeof Symbol == "function" && Symbol.toStringTag && l[Symbol.toStringTag] || l.constructor.name || "Object";
|
|
106
|
+
return T.call(
|
|
107
|
+
S,
|
|
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
|
+
O
|
|
110
|
+
), e(l);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
function n(
|
|
114
|
-
if (
|
|
115
|
-
if (typeof
|
|
113
|
+
function n(l) {
|
|
114
|
+
if (l === b) return "<>";
|
|
115
|
+
if (typeof l == "object" && l !== null && l.$$typeof === C)
|
|
116
116
|
return "<...>";
|
|
117
117
|
try {
|
|
118
|
-
var
|
|
119
|
-
return
|
|
118
|
+
var S = t(l);
|
|
119
|
+
return S ? "<" + S + ">" : "<...>";
|
|
120
120
|
} catch {
|
|
121
121
|
return "<...>";
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
function o() {
|
|
125
|
-
var
|
|
126
|
-
return
|
|
125
|
+
var l = M.A;
|
|
126
|
+
return l === null ? null : l.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(l) {
|
|
132
|
+
if (L.call(l, "key")) {
|
|
133
|
+
var S = Object.getOwnPropertyDescriptor(l, "key").get;
|
|
134
|
+
if (S && S.isReactWarning) return !1;
|
|
135
135
|
}
|
|
136
|
-
return
|
|
136
|
+
return l.key !== void 0;
|
|
137
137
|
}
|
|
138
|
-
function a(
|
|
139
|
-
function
|
|
140
|
-
|
|
138
|
+
function a(l, S) {
|
|
139
|
+
function T() {
|
|
140
|
+
H || (H = !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
|
+
S
|
|
143
143
|
));
|
|
144
144
|
}
|
|
145
|
-
|
|
146
|
-
get:
|
|
145
|
+
T.isReactWarning = !0, Object.defineProperty(l, "key", {
|
|
146
|
+
get: T,
|
|
147
147
|
configurable: !0
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
150
|
function c() {
|
|
151
|
-
var
|
|
152
|
-
return
|
|
151
|
+
var l = t(this.type);
|
|
152
|
+
return fe[l] || (fe[l] = !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
|
+
)), l = this.props.ref, l !== void 0 ? l : null;
|
|
155
155
|
}
|
|
156
|
-
function f(
|
|
157
|
-
return
|
|
158
|
-
$$typeof:
|
|
159
|
-
type:
|
|
160
|
-
key:
|
|
161
|
-
props:
|
|
162
|
-
_owner:
|
|
163
|
-
}, (
|
|
156
|
+
function f(l, S, T, O, V, K, ne, oe) {
|
|
157
|
+
return T = K.ref, l = {
|
|
158
|
+
$$typeof: g,
|
|
159
|
+
type: l,
|
|
160
|
+
key: S,
|
|
161
|
+
props: K,
|
|
162
|
+
_owner: V
|
|
163
|
+
}, (T !== void 0 ? T : null) !== null ? Object.defineProperty(l, "ref", {
|
|
164
164
|
enumerable: !1,
|
|
165
165
|
get: c
|
|
166
|
-
}) : Object.defineProperty(
|
|
166
|
+
}) : Object.defineProperty(l, "ref", { enumerable: !1, value: null }), l._store = {}, Object.defineProperty(l._store, "validated", {
|
|
167
167
|
configurable: !1,
|
|
168
168
|
enumerable: !1,
|
|
169
169
|
writable: !0,
|
|
170
170
|
value: 0
|
|
171
|
-
}), Object.defineProperty(
|
|
171
|
+
}), Object.defineProperty(l, "_debugInfo", {
|
|
172
172
|
configurable: !1,
|
|
173
173
|
enumerable: !1,
|
|
174
174
|
writable: !0,
|
|
175
175
|
value: null
|
|
176
|
-
}), Object.defineProperty(
|
|
176
|
+
}), Object.defineProperty(l, "_debugStack", {
|
|
177
177
|
configurable: !1,
|
|
178
178
|
enumerable: !1,
|
|
179
179
|
writable: !0,
|
|
180
|
-
value:
|
|
181
|
-
}), Object.defineProperty(
|
|
180
|
+
value: ne
|
|
181
|
+
}), Object.defineProperty(l, "_debugTask", {
|
|
182
182
|
configurable: !1,
|
|
183
183
|
enumerable: !1,
|
|
184
184
|
writable: !0,
|
|
185
|
-
value:
|
|
186
|
-
}), Object.freeze && (Object.freeze(
|
|
185
|
+
value: oe
|
|
186
|
+
}), Object.freeze && (Object.freeze(l.props), Object.freeze(l)), l;
|
|
187
187
|
}
|
|
188
|
-
function d(
|
|
189
|
-
var
|
|
190
|
-
if (
|
|
191
|
-
if (
|
|
192
|
-
if (z(
|
|
193
|
-
for (
|
|
194
|
-
m(
|
|
195
|
-
Object.freeze && Object.freeze(
|
|
188
|
+
function d(l, S, T, O, V, K, ne, oe) {
|
|
189
|
+
var w = S.children;
|
|
190
|
+
if (w !== void 0)
|
|
191
|
+
if (O)
|
|
192
|
+
if (z(w)) {
|
|
193
|
+
for (O = 0; O < w.length; O++)
|
|
194
|
+
m(w[O]);
|
|
195
|
+
Object.freeze && Object.freeze(w);
|
|
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 m(
|
|
201
|
-
if (
|
|
202
|
-
|
|
203
|
-
var
|
|
204
|
-
return
|
|
200
|
+
else m(w);
|
|
201
|
+
if (L.call(S, "key")) {
|
|
202
|
+
w = t(l);
|
|
203
|
+
var _ = Object.keys(S).filter(function(At) {
|
|
204
|
+
return At !== "key";
|
|
205
205
|
});
|
|
206
|
-
|
|
206
|
+
O = 0 < _.length ? "{key: someKey, " + _.join(": ..., ") + ": ...}" : "{key: someKey}", B[w + O] || (_ = 0 < _.length ? "{" + _.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
|
+
O,
|
|
214
|
+
w,
|
|
215
|
+
_,
|
|
216
|
+
w
|
|
217
|
+
), B[w + O] = !0);
|
|
218
218
|
}
|
|
219
|
-
if (
|
|
220
|
-
|
|
221
|
-
for (var
|
|
222
|
-
|
|
223
|
-
} else
|
|
224
|
-
return
|
|
225
|
-
|
|
226
|
-
typeof
|
|
219
|
+
if (w = null, T !== void 0 && (r(T), w = "" + T), i(S) && (r(S.key), w = "" + S.key), "key" in S) {
|
|
220
|
+
T = {};
|
|
221
|
+
for (var U in S)
|
|
222
|
+
U !== "key" && (T[U] = S[U]);
|
|
223
|
+
} else T = S;
|
|
224
|
+
return w && a(
|
|
225
|
+
T,
|
|
226
|
+
typeof l == "function" ? l.displayName || l.name || "Unknown" : l
|
|
227
227
|
), f(
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
B,
|
|
228
|
+
l,
|
|
229
|
+
w,
|
|
231
230
|
K,
|
|
231
|
+
V,
|
|
232
232
|
o(),
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
233
|
+
T,
|
|
234
|
+
ne,
|
|
235
|
+
oe
|
|
236
236
|
);
|
|
237
237
|
}
|
|
238
|
-
function m(
|
|
239
|
-
typeof
|
|
238
|
+
function m(l) {
|
|
239
|
+
typeof l == "object" && l !== null && l.$$typeof === g && l._store && (l._store.validated = 1);
|
|
240
240
|
}
|
|
241
|
-
var
|
|
241
|
+
var u = Ct, g = Symbol.for("react.transitional.element"), y = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), h = Symbol.for("react.strict_mode"), p = Symbol.for("react.profiler"), v = Symbol.for("react.consumer"), k = Symbol.for("react.context"), I = Symbol.for("react.forward_ref"), j = Symbol.for("react.suspense"), G = Symbol.for("react.suspense_list"), Z = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), N = Symbol.for("react.activity"), F = Symbol.for("react.client.reference"), M = u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, L = Object.prototype.hasOwnProperty, z = Array.isArray, ee = console.createTask ? console.createTask : function() {
|
|
242
242
|
return null;
|
|
243
243
|
};
|
|
244
|
-
|
|
245
|
-
"react-stack-bottom-frame": function(
|
|
246
|
-
return
|
|
244
|
+
u = {
|
|
245
|
+
"react-stack-bottom-frame": function(l) {
|
|
246
|
+
return l();
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
|
-
var
|
|
250
|
-
|
|
249
|
+
var H, fe = {}, te = u["react-stack-bottom-frame"].bind(
|
|
250
|
+
u,
|
|
251
251
|
s
|
|
252
|
-
)(),
|
|
253
|
-
|
|
254
|
-
var
|
|
252
|
+
)(), re = ee(n(s)), B = {};
|
|
253
|
+
ie.Fragment = b, ie.jsx = function(l, S, T, O, V) {
|
|
254
|
+
var K = 1e4 > M.recentlyCreatedOwnerStacks++;
|
|
255
255
|
return d(
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
256
|
+
l,
|
|
257
|
+
S,
|
|
258
|
+
T,
|
|
259
259
|
!1,
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
260
|
+
O,
|
|
261
|
+
V,
|
|
262
|
+
K ? Error("react-stack-top-frame") : te,
|
|
263
|
+
K ? ee(n(l)) : re
|
|
264
264
|
);
|
|
265
|
-
},
|
|
266
|
-
var
|
|
265
|
+
}, ie.jsxs = function(l, S, T, O, V) {
|
|
266
|
+
var K = 1e4 > M.recentlyCreatedOwnerStacks++;
|
|
267
267
|
return d(
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
268
|
+
l,
|
|
269
|
+
S,
|
|
270
|
+
T,
|
|
271
271
|
!0,
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
272
|
+
O,
|
|
273
|
+
V,
|
|
274
|
+
K ? Error("react-stack-top-frame") : te,
|
|
275
|
+
K ? ee(n(l)) : re
|
|
276
276
|
);
|
|
277
277
|
};
|
|
278
|
-
}()),
|
|
278
|
+
}()), ie;
|
|
279
279
|
}
|
|
280
|
-
var
|
|
280
|
+
var Ge;
|
|
281
281
|
function xt() {
|
|
282
|
-
return
|
|
282
|
+
return Ge || (Ge = 1, process.env.NODE_ENV === "production" ? he.exports = Lt() : he.exports = Ut()), he.exports;
|
|
283
283
|
}
|
|
284
284
|
var A = xt();
|
|
285
285
|
function Dt(t, e) {
|
|
286
|
-
const r =
|
|
286
|
+
const r = Ue(
|
|
287
287
|
(n) => t.subscribe(n),
|
|
288
288
|
() => {
|
|
289
289
|
const n = t.getSnapshot(), o = e ?? n.rootViewId, s = o ? n.views.get(o) : void 0;
|
|
@@ -302,15 +302,15 @@ function Dt(t, e) {
|
|
|
302
302
|
};
|
|
303
303
|
}, [r]);
|
|
304
304
|
}
|
|
305
|
-
function
|
|
306
|
-
const r =
|
|
305
|
+
function X(t, e) {
|
|
306
|
+
const r = Ue(
|
|
307
307
|
(n) => t.subscribeNode(e, n),
|
|
308
308
|
() => t.getNodeVersion(e),
|
|
309
309
|
() => t.getNodeVersion(e)
|
|
310
310
|
);
|
|
311
311
|
return Y(() => t.getNode(e), [t, e, r]);
|
|
312
312
|
}
|
|
313
|
-
const Ft =
|
|
313
|
+
const Ft = Se("UIRenderer");
|
|
314
314
|
function Bt(t) {
|
|
315
315
|
if (t === void 0)
|
|
316
316
|
return "{}";
|
|
@@ -341,8 +341,8 @@ function Yt(t) {
|
|
|
341
341
|
e += "," + t[r].id;
|
|
342
342
|
return e;
|
|
343
343
|
}
|
|
344
|
-
const
|
|
345
|
-
const n =
|
|
344
|
+
const _e = q(function t({ nodeId: e, context: r }) {
|
|
345
|
+
const n = X(r.store, e), o = n ? Vt(n) : [], s = Yt(o), i = Y(
|
|
346
346
|
() => o.length === 0 ? null : o.map((m) => /* @__PURE__ */ A.jsx(t, { nodeId: m.id, context: r }, m.id)),
|
|
347
347
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
348
348
|
[s, r]
|
|
@@ -350,7 +350,7 @@ const Pe = q(function t({ nodeId: e, context: r }) {
|
|
|
350
350
|
if (!n)
|
|
351
351
|
return null;
|
|
352
352
|
if (n.type === "root")
|
|
353
|
-
return /* @__PURE__ */ A.jsx(
|
|
353
|
+
return /* @__PURE__ */ A.jsx(It, { children: i }, n.id);
|
|
354
354
|
const a = r.library.resolve(n);
|
|
355
355
|
if (!a)
|
|
356
356
|
return Ft.warn(`No renderer for node type ${n.type}`), null;
|
|
@@ -358,47 +358,47 @@ const Pe = q(function t({ nodeId: e, context: r }) {
|
|
|
358
358
|
return /* @__PURE__ */ A.jsx(d, { nodeId: e, context: r, className: f });
|
|
359
359
|
}, Kt);
|
|
360
360
|
function zt(t, e) {
|
|
361
|
-
return !Array.isArray(t) || t.length === 0 ? null : t.map((r) => /* @__PURE__ */ A.jsx(
|
|
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 Wt(t, e) {
|
|
364
364
|
return t.store === e.store && t.library === e.library && t.viewId === e.viewId && t.emptyFallback === e.emptyFallback;
|
|
365
365
|
}
|
|
366
366
|
const qt = q(function({ store: e, library: r, viewId: n, emptyFallback: o = null, onAction: s, client: i, video: a }) {
|
|
367
|
-
const { rootViewId: c, rootNodeId: f } = Dt(e, n), d =
|
|
367
|
+
const { rootViewId: c, rootNodeId: f } = Dt(e, n), d = E(s);
|
|
368
368
|
d.current = s;
|
|
369
|
-
const m =
|
|
369
|
+
const m = E(i);
|
|
370
370
|
m.current = i;
|
|
371
|
-
const
|
|
372
|
-
|
|
373
|
-
const
|
|
371
|
+
const u = E(a);
|
|
372
|
+
u.current = a;
|
|
373
|
+
const g = x((b, h) => {
|
|
374
374
|
if (!b)
|
|
375
375
|
return;
|
|
376
|
-
const p = Bt(
|
|
376
|
+
const p = Bt(h);
|
|
377
377
|
d.current?.(b, p);
|
|
378
|
-
}, []),
|
|
378
|
+
}, []), y = Y(() => {
|
|
379
379
|
const b = {
|
|
380
380
|
store: e,
|
|
381
381
|
library: r,
|
|
382
382
|
handlerCache: e.handlerCache,
|
|
383
383
|
// Access payloads from store at call time, not captured snapshot
|
|
384
|
-
getPayload: (
|
|
385
|
-
renderChildren: (
|
|
386
|
-
renderView: (
|
|
387
|
-
const p = e.getSnapshot().views.get(
|
|
388
|
-
return p ? /* @__PURE__ */ A.jsx(
|
|
384
|
+
getPayload: (h) => e.getSnapshot().payloads.get(h),
|
|
385
|
+
renderChildren: (h) => zt(h, b),
|
|
386
|
+
renderView: (h) => {
|
|
387
|
+
const p = e.getSnapshot().views.get(h);
|
|
388
|
+
return p ? /* @__PURE__ */ A.jsx(_e, { nodeId: p.id, context: b }) : 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 m.current;
|
|
394
394
|
},
|
|
395
395
|
get video() {
|
|
396
|
-
return
|
|
396
|
+
return u.current;
|
|
397
397
|
}
|
|
398
398
|
};
|
|
399
399
|
return b;
|
|
400
|
-
}, [e, r,
|
|
401
|
-
return !c || !f ? o : /* @__PURE__ */ A.jsx("div", { "data-ikon-view-id": c, style: { display: "contents" }, children: /* @__PURE__ */ A.jsx(
|
|
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
|
}, Wt);
|
|
403
403
|
class Gt {
|
|
404
404
|
constructor(e, r) {
|
|
@@ -422,27 +422,27 @@ function to(t, e) {
|
|
|
422
422
|
return new Gt(r, e);
|
|
423
423
|
}
|
|
424
424
|
function ro(t) {
|
|
425
|
-
return
|
|
425
|
+
return Ue(
|
|
426
426
|
(e) => t.subscribe(e),
|
|
427
427
|
() => t.getSnapshot(),
|
|
428
428
|
() => t.getSnapshot()
|
|
429
429
|
);
|
|
430
430
|
}
|
|
431
|
-
const
|
|
431
|
+
const Ne = "ikon-ui";
|
|
432
432
|
function Ht(t, e) {
|
|
433
433
|
return t === e;
|
|
434
434
|
}
|
|
435
|
-
const no = q(function({ stores: e, registry: r, category: n =
|
|
436
|
-
const i = Y(() => Array.from(e.keys()).sort().join(","), [e]), a =
|
|
435
|
+
const no = q(function({ stores: e, registry: r, category: n = Ne, onAction: o, client: s }) {
|
|
436
|
+
const i = Y(() => Array.from(e.keys()).sort().join(","), [e]), a = E(o);
|
|
437
437
|
a.current = o;
|
|
438
|
-
const c =
|
|
438
|
+
const c = E(s);
|
|
439
439
|
c.current = s;
|
|
440
440
|
const f = Y(
|
|
441
441
|
() => {
|
|
442
442
|
const d = [];
|
|
443
|
-
for (const [m,
|
|
444
|
-
const
|
|
445
|
-
Ht(
|
|
443
|
+
for (const [m, u] of e) {
|
|
444
|
+
const g = u.store.getSnapshot();
|
|
445
|
+
Ht(u.category, n) && (!g.rootViewId || !g.views.has(g.rootViewId) || d.push({ key: m, store: u.store }));
|
|
446
446
|
}
|
|
447
447
|
return d;
|
|
448
448
|
},
|
|
@@ -459,7 +459,7 @@ class Jt {
|
|
|
459
459
|
unsubscribeClears;
|
|
460
460
|
unsubscribeStoreChanges;
|
|
461
461
|
constructor(e) {
|
|
462
|
-
this.core = e?.core ?? new
|
|
462
|
+
this.core = e?.core ?? new Tt({ client: e?.client }), this.ownsCore = !e?.core, this.unsubscribeClears = this.core.subscribeToUiStreamCleared(this.handleUiStreamCleared), this.unsubscribeStoreChanges = this.core.uiStore.subscribe(this.syncStreamSnapshot), this.syncAllStreams();
|
|
463
463
|
}
|
|
464
464
|
dispose() {
|
|
465
465
|
this.unsubscribeClears(), this.unsubscribeStoreChanges(), this.ownsCore && this.core.dispose(), this.listeners.clear(), this.stores.clear();
|
|
@@ -509,8 +509,8 @@ class Jt {
|
|
|
509
509
|
if (r)
|
|
510
510
|
return r;
|
|
511
511
|
const n = {
|
|
512
|
-
category:
|
|
513
|
-
store: new
|
|
512
|
+
category: Ne,
|
|
513
|
+
store: new kt()
|
|
514
514
|
};
|
|
515
515
|
return this.stores.set(e, n), n;
|
|
516
516
|
}
|
|
@@ -518,7 +518,7 @@ class Jt {
|
|
|
518
518
|
const n = this.stores.get(e);
|
|
519
519
|
if (!n)
|
|
520
520
|
return !1;
|
|
521
|
-
const o = r ?? this.core.uiStore.getSnapshot(e)?.category ??
|
|
521
|
+
const o = r ?? this.core.uiStore.getSnapshot(e)?.category ?? Ne;
|
|
522
522
|
return n.category === o ? !1 : (this.stores.set(e, { ...n, category: o }), !0);
|
|
523
523
|
}
|
|
524
524
|
notify(e) {
|
|
@@ -532,7 +532,7 @@ function Xt(t) {
|
|
|
532
532
|
return e.length > 0 ? e : void 0;
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
|
-
function
|
|
535
|
+
function de(t) {
|
|
536
536
|
if (typeof t == "string") {
|
|
537
537
|
const e = t.trim();
|
|
538
538
|
return e.length > 0 ? e : void 0;
|
|
@@ -542,7 +542,7 @@ function fe(t) {
|
|
|
542
542
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
|
-
function
|
|
545
|
+
function De(...t) {
|
|
546
546
|
let e = "";
|
|
547
547
|
for (const r of t)
|
|
548
548
|
if (r) {
|
|
@@ -551,56 +551,56 @@ function Be(...t) {
|
|
|
551
551
|
}
|
|
552
552
|
return e || void 0;
|
|
553
553
|
}
|
|
554
|
-
const
|
|
555
|
-
function
|
|
554
|
+
const He = /* @__PURE__ */ new WeakMap(), Zt = {};
|
|
555
|
+
function Fe(t) {
|
|
556
556
|
if (!t)
|
|
557
557
|
return Zt;
|
|
558
|
-
const e =
|
|
558
|
+
const e = He.get(t);
|
|
559
559
|
if (e)
|
|
560
560
|
return e;
|
|
561
561
|
const r = {};
|
|
562
562
|
for (const [n, o] of Object.entries(t))
|
|
563
563
|
o != null && (typeof o == "string" || typeof o == "number" || typeof o == "boolean") && (r[n] = o);
|
|
564
|
-
return
|
|
564
|
+
return He.set(t, r), r;
|
|
565
565
|
}
|
|
566
566
|
function Qt() {
|
|
567
567
|
const t = q(function({ nodeId: r, context: n }) {
|
|
568
|
-
const o =
|
|
568
|
+
const o = X(n.store, r), s = E(null), i = de(o?.props?.targetViewId), a = o?.props?.focusOnly, c = typeof a == "boolean" ? a : void 0, f = de(o?.props?.key), d = o?.props?.preciseGeneratedAt;
|
|
569
569
|
return D(() => {
|
|
570
570
|
if (typeof document > "u")
|
|
571
571
|
return;
|
|
572
|
-
const
|
|
573
|
-
if (!
|
|
572
|
+
const u = s.current;
|
|
573
|
+
if (!u || i && u.closest("[data-ikon-view-id]")?.getAttribute("data-ikon-view-id") !== i)
|
|
574
574
|
return;
|
|
575
|
-
const
|
|
576
|
-
if (
|
|
577
|
-
const p = ((
|
|
578
|
-
let
|
|
579
|
-
for (;
|
|
580
|
-
const j = window.getComputedStyle(
|
|
581
|
-
if (j === "auto" || j === "scroll" ||
|
|
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 j = window.getComputedStyle(k).overflowY;
|
|
581
|
+
if (j === "auto" || j === "scroll" || k.hasAttribute("data-radix-scroll-area-viewport"))
|
|
582
|
+
return k;
|
|
583
|
+
k = k.parentElement;
|
|
584
584
|
}
|
|
585
585
|
return null;
|
|
586
|
-
})(
|
|
586
|
+
})(u);
|
|
587
587
|
p ? requestAnimationFrame(() => {
|
|
588
|
-
const
|
|
588
|
+
const v = p.getBoundingClientRect(), k = u.getBoundingClientRect(), I = p.scrollTop + (k.bottom - v.bottom) + 16;
|
|
589
589
|
"scrollBehavior" in document.documentElement.style ? p.scrollTo({ top: I, behavior: "smooth" }) : p.scrollTop = I;
|
|
590
|
-
}) : typeof
|
|
590
|
+
}) : typeof u.scrollIntoView == "function" && requestAnimationFrame(() => {
|
|
591
591
|
try {
|
|
592
|
-
|
|
592
|
+
u.scrollIntoView({ behavior: "smooth", block: "end", inline: "nearest" });
|
|
593
593
|
} catch {
|
|
594
|
-
|
|
594
|
+
u.scrollIntoView(!1);
|
|
595
595
|
}
|
|
596
596
|
});
|
|
597
597
|
}
|
|
598
|
-
const
|
|
599
|
-
if (!(
|
|
598
|
+
const y = document.activeElement;
|
|
599
|
+
if (!(y instanceof HTMLInputElement || y instanceof HTMLTextAreaElement || y?.getAttribute("contenteditable") === "true") && typeof u.focus == "function")
|
|
600
600
|
try {
|
|
601
|
-
|
|
601
|
+
u.focus({ preventScroll: !g });
|
|
602
602
|
} catch {
|
|
603
|
-
|
|
603
|
+
u.focus();
|
|
604
604
|
}
|
|
605
605
|
}, [c, i, f, d]), o ? /* @__PURE__ */ A.jsx(
|
|
606
606
|
"span",
|
|
@@ -621,14 +621,14 @@ function Qt() {
|
|
|
621
621
|
}
|
|
622
622
|
function er() {
|
|
623
623
|
const t = q(function({ nodeId: r, context: n, className: o }) {
|
|
624
|
-
const s =
|
|
624
|
+
const s = X(n.store, r), i = Xt(s?.props?.onInvokeId), a = x(() => {
|
|
625
625
|
i && n.dispatchAction(i);
|
|
626
626
|
}, [i, n]);
|
|
627
627
|
if (!s)
|
|
628
628
|
return null;
|
|
629
|
-
const c =
|
|
629
|
+
const c = Fe(s.props);
|
|
630
630
|
delete c.onInvokeId;
|
|
631
|
-
const f =
|
|
631
|
+
const f = De(de(s.props?.className), o), d = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
632
632
|
return /* @__PURE__ */ A.jsx(
|
|
633
633
|
"div",
|
|
634
634
|
{
|
|
@@ -648,10 +648,10 @@ function er() {
|
|
|
648
648
|
}
|
|
649
649
|
function tr() {
|
|
650
650
|
const t = q(function({ nodeId: r, context: n, className: o }) {
|
|
651
|
-
const s =
|
|
651
|
+
const s = X(n.store, r);
|
|
652
652
|
if (!s)
|
|
653
653
|
return null;
|
|
654
|
-
const i =
|
|
654
|
+
const i = Fe(s.props), a = De("relative", de(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
655
655
|
return /* @__PURE__ */ A.jsx("div", { ...i, "data-ikon-node-id": s.id, className: a, children: c });
|
|
656
656
|
});
|
|
657
657
|
return ({ type: e }) => {
|
|
@@ -661,10 +661,10 @@ function tr() {
|
|
|
661
661
|
}
|
|
662
662
|
function rr() {
|
|
663
663
|
const t = q(function({ nodeId: r, context: n, className: o }) {
|
|
664
|
-
const s =
|
|
664
|
+
const s = X(n.store, r);
|
|
665
665
|
if (!s)
|
|
666
666
|
return null;
|
|
667
|
-
const i =
|
|
667
|
+
const i = Fe(s.props), a = De("absolute", de(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
668
668
|
return /* @__PURE__ */ A.jsx("div", { ...i, "data-ikon-node-id": s.id, className: a, children: c });
|
|
669
669
|
});
|
|
670
670
|
return ({ type: e }) => {
|
|
@@ -684,7 +684,7 @@ const or = "base", sr = async () => nr();
|
|
|
684
684
|
function ir(t) {
|
|
685
685
|
t.registerModule(or, sr);
|
|
686
686
|
}
|
|
687
|
-
function
|
|
687
|
+
function lt(t) {
|
|
688
688
|
if (typeof t == "string") {
|
|
689
689
|
const e = t.trim();
|
|
690
690
|
return e.length > 0 ? e : void 0;
|
|
@@ -694,13 +694,13 @@ function ft(t) {
|
|
|
694
694
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
695
695
|
}
|
|
696
696
|
}
|
|
697
|
-
function
|
|
697
|
+
function dt(...t) {
|
|
698
698
|
const e = [];
|
|
699
699
|
for (const r of t)
|
|
700
700
|
r && r.trim() && e.push(r.trim());
|
|
701
701
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
702
702
|
}
|
|
703
|
-
function
|
|
703
|
+
function pe(t) {
|
|
704
704
|
if (typeof t == "number" && Number.isFinite(t))
|
|
705
705
|
return Math.floor(t);
|
|
706
706
|
if (typeof t == "string" && t.trim().length > 0) {
|
|
@@ -709,7 +709,7 @@ function ye(t) {
|
|
|
709
709
|
return Math.floor(e);
|
|
710
710
|
}
|
|
711
711
|
}
|
|
712
|
-
function
|
|
712
|
+
function Pe(t) {
|
|
713
713
|
if (typeof t != "string")
|
|
714
714
|
return;
|
|
715
715
|
const e = t.trim();
|
|
@@ -718,11 +718,11 @@ function je(t) {
|
|
|
718
718
|
const ar = "std.video-canvas", cr = "std.video-url-player";
|
|
719
719
|
function ur() {
|
|
720
720
|
const t = q(function({ nodeId: r, context: n, className: o }) {
|
|
721
|
-
const s =
|
|
721
|
+
const s = X(n.store, r), i = E(null), a = n.video, c = s ? Pe(s.props?.streamId) : void 0, f = s ? pe(s.props?.width) : void 0, d = s ? pe(s.props?.height) : void 0, m = s ? dt(lt(s.props?.className), o) : o;
|
|
722
722
|
return D(() => {
|
|
723
|
-
const
|
|
724
|
-
if (!(!a || !
|
|
725
|
-
return a.attachCanvas(c,
|
|
723
|
+
const u = i.current;
|
|
724
|
+
if (!(!a || !u || !c))
|
|
725
|
+
return a.attachCanvas(c, u), () => {
|
|
726
726
|
a.detachCanvas(c);
|
|
727
727
|
};
|
|
728
728
|
}, [a, c]), s ? /* @__PURE__ */ A.jsx(
|
|
@@ -746,7 +746,7 @@ function ur() {
|
|
|
746
746
|
function lr() {
|
|
747
747
|
return [ur(), dr()];
|
|
748
748
|
}
|
|
749
|
-
function
|
|
749
|
+
function ae(t) {
|
|
750
750
|
if (typeof t == "boolean")
|
|
751
751
|
return t;
|
|
752
752
|
if (typeof t == "string") {
|
|
@@ -761,10 +761,10 @@ function dr() {
|
|
|
761
761
|
context: n,
|
|
762
762
|
className: o
|
|
763
763
|
}) {
|
|
764
|
-
const s =
|
|
764
|
+
const s = X(n.store, r);
|
|
765
765
|
if (!s)
|
|
766
766
|
return null;
|
|
767
|
-
const i =
|
|
767
|
+
const i = dt(lt(s.props?.className), o), a = Pe(s.props?.src), c = Pe(s.props?.poster), f = ae(s.props?.controls), d = ae(s.props?.autoplay), m = ae(s.props?.loop), u = ae(s.props?.muted), g = ae(s.props?.playsInline), y = pe(s.props?.width), b = pe(s.props?.height), h = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
768
768
|
return /* @__PURE__ */ A.jsx(
|
|
769
769
|
"video",
|
|
770
770
|
{
|
|
@@ -773,13 +773,13 @@ function dr() {
|
|
|
773
773
|
...f !== void 0 ? { controls: f } : {},
|
|
774
774
|
...d !== void 0 ? { autoPlay: d } : {},
|
|
775
775
|
...m !== void 0 ? { loop: m } : {},
|
|
776
|
-
...
|
|
777
|
-
...
|
|
778
|
-
...
|
|
776
|
+
...u !== void 0 ? { muted: u } : {},
|
|
777
|
+
...g !== void 0 ? { playsInline: g } : {},
|
|
778
|
+
...y ? { width: y } : {},
|
|
779
779
|
...b ? { height: b } : {},
|
|
780
780
|
"data-ikon-node-id": s.id,
|
|
781
781
|
className: i,
|
|
782
|
-
children:
|
|
782
|
+
children: h
|
|
783
783
|
}
|
|
784
784
|
);
|
|
785
785
|
});
|
|
@@ -940,40 +940,40 @@ class Sr {
|
|
|
940
940
|
d && e.uniform1f(d, a);
|
|
941
941
|
const m = this.uniformLocations.get("iFrame");
|
|
942
942
|
m && e.uniform1i(m, this.frameCount);
|
|
943
|
-
const
|
|
944
|
-
|
|
945
|
-
const
|
|
946
|
-
if (
|
|
947
|
-
const
|
|
948
|
-
e.uniform4f(
|
|
943
|
+
const u = this.uniformLocations.get("iMouse");
|
|
944
|
+
u && e.uniform4f(u, this.mouseX, this.mouseY, this.mouseClickX, this.mouseClickY);
|
|
945
|
+
const g = this.uniformLocations.get("iDate");
|
|
946
|
+
if (g) {
|
|
947
|
+
const y = /* @__PURE__ */ new Date();
|
|
948
|
+
e.uniform4f(g, y.getFullYear(), y.getMonth(), y.getDate(), y.getHours() * 3600 + y.getMinutes() * 60 + y.getSeconds() + y.getMilliseconds() / 1e3);
|
|
949
949
|
}
|
|
950
|
-
for (const [
|
|
951
|
-
const
|
|
952
|
-
if (
|
|
950
|
+
for (const [y, b] of Object.entries(this.customUniforms)) {
|
|
951
|
+
const h = this.uniformLocations.get(y);
|
|
952
|
+
if (h)
|
|
953
953
|
switch (b.type) {
|
|
954
954
|
case "float":
|
|
955
|
-
e.uniform1f(
|
|
955
|
+
e.uniform1f(h, b.value);
|
|
956
956
|
break;
|
|
957
957
|
case "vec2": {
|
|
958
958
|
const p = b.value;
|
|
959
|
-
e.uniform2f(
|
|
959
|
+
e.uniform2f(h, p[0], p[1]);
|
|
960
960
|
break;
|
|
961
961
|
}
|
|
962
962
|
case "vec3": {
|
|
963
963
|
const p = b.value;
|
|
964
|
-
e.uniform3f(
|
|
964
|
+
e.uniform3f(h, p[0], p[1], p[2]);
|
|
965
965
|
break;
|
|
966
966
|
}
|
|
967
967
|
case "vec4": {
|
|
968
968
|
const p = b.value;
|
|
969
|
-
e.uniform4f(
|
|
969
|
+
e.uniform4f(h, p[0], p[1], p[2], p[3]);
|
|
970
970
|
break;
|
|
971
971
|
}
|
|
972
972
|
case "int":
|
|
973
|
-
e.uniform1i(
|
|
973
|
+
e.uniform1i(h, b.value);
|
|
974
974
|
break;
|
|
975
975
|
case "bool":
|
|
976
|
-
e.uniform1i(
|
|
976
|
+
e.uniform1i(h, b.value ? 1 : 0);
|
|
977
977
|
break;
|
|
978
978
|
}
|
|
979
979
|
}
|
|
@@ -1003,7 +1003,7 @@ function wr(...t) {
|
|
|
1003
1003
|
r && r.trim() && e.push(r.trim());
|
|
1004
1004
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
1005
1005
|
}
|
|
1006
|
-
function
|
|
1006
|
+
function ve(t) {
|
|
1007
1007
|
if (typeof t == "number" && Number.isFinite(t))
|
|
1008
1008
|
return Math.floor(t);
|
|
1009
1009
|
if (typeof t == "string" && t.trim().length > 0) {
|
|
@@ -1063,69 +1063,69 @@ function Ar(t, e) {
|
|
|
1063
1063
|
const Tr = "std.shader-canvas";
|
|
1064
1064
|
function kr() {
|
|
1065
1065
|
const t = q(function({ nodeId: r, context: n, className: o }) {
|
|
1066
|
-
const s =
|
|
1066
|
+
const s = X(n.store, r), i = E(null), a = E(null), c = E(null), f = E(0), d = E(""), m = E({}), u = E({
|
|
1067
1067
|
x: 0,
|
|
1068
1068
|
y: 0,
|
|
1069
1069
|
clickX: 0,
|
|
1070
1070
|
clickY: 0,
|
|
1071
1071
|
isDown: !1
|
|
1072
|
-
}),
|
|
1072
|
+
}), g = s ? vr(s.props?.shaderSource) : "", y = s ? ve(s.props?.fps) ?? 60 : 60, b = s?.props?.uniforms, h = Y(() => Rr(b), [b]), p = s ? Er(s.props?.enableMouse) ?? !0 : !0, v = s ? ve(s.props?.width) : void 0, k = s ? ve(s.props?.height) : void 0, I = s ? wr(br(s.props?.className), o) : o;
|
|
1073
1073
|
D(() => {
|
|
1074
|
-
const
|
|
1075
|
-
if (
|
|
1074
|
+
const C = i.current;
|
|
1075
|
+
if (C) {
|
|
1076
1076
|
try {
|
|
1077
|
-
const
|
|
1078
|
-
a.current =
|
|
1079
|
-
} catch (
|
|
1080
|
-
console.error("[ShaderRenderer] Failed to create WebGL2 context:",
|
|
1077
|
+
const N = new Sr(C);
|
|
1078
|
+
a.current = N;
|
|
1079
|
+
} catch (N) {
|
|
1080
|
+
console.error("[ShaderRenderer] Failed to create WebGL2 context:", N);
|
|
1081
1081
|
}
|
|
1082
1082
|
return () => {
|
|
1083
1083
|
a.current && (a.current.destroy(), a.current = null);
|
|
1084
1084
|
};
|
|
1085
1085
|
}
|
|
1086
1086
|
}, []), D(() => {
|
|
1087
|
-
const
|
|
1088
|
-
if (!(!
|
|
1089
|
-
if (
|
|
1090
|
-
d.current =
|
|
1087
|
+
const C = a.current;
|
|
1088
|
+
if (!(!C || !g) && d.current !== g)
|
|
1089
|
+
if (C.compile(g, h))
|
|
1090
|
+
d.current = g, m.current = h;
|
|
1091
1091
|
else {
|
|
1092
|
-
const
|
|
1093
|
-
console.error("[ShaderRenderer] Shader compilation failed:",
|
|
1092
|
+
const F = C.getError();
|
|
1093
|
+
console.error("[ShaderRenderer] Shader compilation failed:", F);
|
|
1094
1094
|
}
|
|
1095
|
-
}, [
|
|
1096
|
-
const
|
|
1097
|
-
!
|
|
1098
|
-
}, [
|
|
1099
|
-
const
|
|
1100
|
-
if (!
|
|
1101
|
-
const
|
|
1102
|
-
const
|
|
1103
|
-
|
|
1095
|
+
}, [g, h]), D(() => {
|
|
1096
|
+
const C = a.current;
|
|
1097
|
+
!C || !d.current || Ar(m.current, h) || (C.setCustomUniforms(h), m.current = h);
|
|
1098
|
+
}, [h]), D(() => {
|
|
1099
|
+
const C = a.current;
|
|
1100
|
+
if (!C || !d.current) return;
|
|
1101
|
+
const N = 1e3 / y, F = (M) => {
|
|
1102
|
+
const L = M - f.current;
|
|
1103
|
+
L >= N && (f.current = M - L % N, C.draw()), c.current = requestAnimationFrame(F);
|
|
1104
1104
|
};
|
|
1105
|
-
return c.current = requestAnimationFrame(
|
|
1105
|
+
return c.current = requestAnimationFrame(F), () => {
|
|
1106
1106
|
c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
|
|
1107
1107
|
};
|
|
1108
|
-
}, [
|
|
1108
|
+
}, [y]);
|
|
1109
1109
|
const j = x(
|
|
1110
|
-
(
|
|
1110
|
+
(C) => {
|
|
1111
1111
|
if (!p) return;
|
|
1112
|
-
const
|
|
1113
|
-
if (!
|
|
1114
|
-
const
|
|
1115
|
-
|
|
1112
|
+
const N = i.current, F = a.current;
|
|
1113
|
+
if (!N || !F) return;
|
|
1114
|
+
const M = N.getBoundingClientRect(), L = C.clientX - M.left, z = M.height - (C.clientY - M.top);
|
|
1115
|
+
u.current.x = L, u.current.y = z, F.setMouse(L, z, u.current.clickX, u.current.clickY);
|
|
1116
1116
|
},
|
|
1117
1117
|
[p]
|
|
1118
1118
|
), G = x(
|
|
1119
|
-
(
|
|
1119
|
+
(C) => {
|
|
1120
1120
|
if (!p) return;
|
|
1121
|
-
const
|
|
1122
|
-
if (!
|
|
1123
|
-
const
|
|
1124
|
-
|
|
1121
|
+
const N = i.current, F = a.current;
|
|
1122
|
+
if (!N || !F) return;
|
|
1123
|
+
const M = N.getBoundingClientRect(), L = C.clientX - M.left, z = M.height - (C.clientY - M.top);
|
|
1124
|
+
u.current.isDown = !0, u.current.clickX = L, u.current.clickY = z, F.setMouse(L, z, L, z);
|
|
1125
1125
|
},
|
|
1126
1126
|
[p]
|
|
1127
|
-
),
|
|
1128
|
-
p && (
|
|
1127
|
+
), Z = x(() => {
|
|
1128
|
+
p && (u.current.isDown = !1, u.current.clickX = -Math.abs(u.current.clickX));
|
|
1129
1129
|
}, [p]);
|
|
1130
1130
|
return s ? /* @__PURE__ */ A.jsx(
|
|
1131
1131
|
"canvas",
|
|
@@ -1133,12 +1133,12 @@ function kr() {
|
|
|
1133
1133
|
ref: i,
|
|
1134
1134
|
"data-ikon-node-id": s.id,
|
|
1135
1135
|
className: I,
|
|
1136
|
-
...
|
|
1137
|
-
...
|
|
1136
|
+
...v ? { width: v } : {},
|
|
1137
|
+
...k ? { height: k } : {},
|
|
1138
1138
|
onMouseMove: j,
|
|
1139
1139
|
onMouseDown: G,
|
|
1140
|
-
onMouseUp:
|
|
1141
|
-
onMouseLeave:
|
|
1140
|
+
onMouseUp: Z,
|
|
1141
|
+
onMouseLeave: Z
|
|
1142
1142
|
}
|
|
1143
1143
|
) : null;
|
|
1144
1144
|
});
|
|
@@ -1151,7 +1151,7 @@ const Cr = "shader", Ir = async () => kr();
|
|
|
1151
1151
|
function Or(t) {
|
|
1152
1152
|
t.registerModule(Cr, Ir);
|
|
1153
1153
|
}
|
|
1154
|
-
const
|
|
1154
|
+
const Je = Se("UIRegistry");
|
|
1155
1155
|
class _r {
|
|
1156
1156
|
baseResolvers = [];
|
|
1157
1157
|
moduleLoaders = /* @__PURE__ */ new Map();
|
|
@@ -1177,7 +1177,7 @@ class _r {
|
|
|
1177
1177
|
const s = await o(), i = Mr(s);
|
|
1178
1178
|
this.moduleResolvers.set(n, i), e = !0;
|
|
1179
1179
|
} catch (s) {
|
|
1180
|
-
|
|
1180
|
+
Je.error(`[IkonUiRegistry] Failed to load module '${n}'.`, s);
|
|
1181
1181
|
}
|
|
1182
1182
|
const r = [];
|
|
1183
1183
|
for (const n of this.moduleLoaders.keys())
|
|
@@ -1192,7 +1192,7 @@ class _r {
|
|
|
1192
1192
|
for (const r of this.activeModuleOrder) {
|
|
1193
1193
|
const n = this.moduleResolvers.get(r);
|
|
1194
1194
|
if (!n) {
|
|
1195
|
-
|
|
1195
|
+
Je.warn(`Missing resolvers for module ${r}`);
|
|
1196
1196
|
continue;
|
|
1197
1197
|
}
|
|
1198
1198
|
for (const o of n) {
|
|
@@ -1220,7 +1220,7 @@ function jr(t, e) {
|
|
|
1220
1220
|
return !1;
|
|
1221
1221
|
return !0;
|
|
1222
1222
|
}
|
|
1223
|
-
const
|
|
1223
|
+
const Ee = Se("MotionController"), Xe = {
|
|
1224
1224
|
ease: [0.25, 0.1, 0.25, 1],
|
|
1225
1225
|
"ease-in": [0.42, 0, 1, 1],
|
|
1226
1226
|
"ease-out": [0, 0, 0.58, 1],
|
|
@@ -1253,53 +1253,53 @@ const Ae = we("MotionController"), Qe = {
|
|
|
1253
1253
|
function $(t) {
|
|
1254
1254
|
return t <= 0 ? 0 : t >= 1 ? 1 : t;
|
|
1255
1255
|
}
|
|
1256
|
-
function
|
|
1256
|
+
function Ze(t) {
|
|
1257
1257
|
if (t == null) return;
|
|
1258
1258
|
const e = `${t}`.trim();
|
|
1259
1259
|
if (!e) return;
|
|
1260
1260
|
const r = Number.parseFloat(e);
|
|
1261
1261
|
return Number.isFinite(r) ? r : void 0;
|
|
1262
1262
|
}
|
|
1263
|
-
function
|
|
1263
|
+
function Qe(t) {
|
|
1264
1264
|
return typeof CSS < "u" && CSS.escape ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
1265
1265
|
}
|
|
1266
|
-
function
|
|
1266
|
+
function et(t, e, r, n) {
|
|
1267
1267
|
const d = new Float32Array(11);
|
|
1268
|
-
function m(
|
|
1269
|
-
return ((3 * p - 3 *
|
|
1268
|
+
function m(h, p, v) {
|
|
1269
|
+
return ((3 * p - 3 * v + 1) * h + (3 * v - 6 * p)) * h * h + 3 * p * h;
|
|
1270
1270
|
}
|
|
1271
|
-
function
|
|
1272
|
-
return 3 * (3 * p - 3 *
|
|
1271
|
+
function u(h, p, v) {
|
|
1272
|
+
return 3 * (3 * p - 3 * v + 1) * h * h + 2 * (3 * v - 6 * p) * h + 3 * p;
|
|
1273
1273
|
}
|
|
1274
|
-
function h
|
|
1275
|
-
for (let
|
|
1276
|
-
const
|
|
1277
|
-
if (
|
|
1274
|
+
function g(h, p) {
|
|
1275
|
+
for (let v = 0; v < 4; v += 1) {
|
|
1276
|
+
const k = u(p, t, r);
|
|
1277
|
+
if (k === 0)
|
|
1278
1278
|
return p;
|
|
1279
|
-
const I = m(p, t, r) -
|
|
1280
|
-
p -= I /
|
|
1279
|
+
const I = m(p, t, r) - h;
|
|
1280
|
+
p -= I / k;
|
|
1281
1281
|
}
|
|
1282
1282
|
return p;
|
|
1283
1283
|
}
|
|
1284
|
-
function
|
|
1285
|
-
let
|
|
1284
|
+
function y(h, p, v) {
|
|
1285
|
+
let k = 0, I = 0, j = 0;
|
|
1286
1286
|
do
|
|
1287
|
-
I = p + (
|
|
1288
|
-
while (Math.abs(
|
|
1287
|
+
I = p + (v - p) / 2, k = m(I, t, r) - h, k > 0 ? v = I : p = I;
|
|
1288
|
+
while (Math.abs(k) > 1e-7 && ++j < 10);
|
|
1289
1289
|
return I;
|
|
1290
1290
|
}
|
|
1291
|
-
function b(
|
|
1292
|
-
let p = 0,
|
|
1293
|
-
const
|
|
1294
|
-
for (;
|
|
1291
|
+
function b(h) {
|
|
1292
|
+
let p = 0, v = 1;
|
|
1293
|
+
const k = 10;
|
|
1294
|
+
for (; v !== k && d[v] <= h; v += 1)
|
|
1295
1295
|
p += 0.1;
|
|
1296
|
-
|
|
1297
|
-
const I = (
|
|
1298
|
-
return G >= 1e-3 ? h
|
|
1296
|
+
v -= 1;
|
|
1297
|
+
const I = (h - d[v]) / (d[v + 1] - d[v]), j = p + I * 0.1, G = u(j, t, r);
|
|
1298
|
+
return G >= 1e-3 ? g(h, j) : G === 0 ? j : y(h, p, p + 0.1);
|
|
1299
1299
|
}
|
|
1300
|
-
for (let
|
|
1301
|
-
d[
|
|
1302
|
-
return (
|
|
1300
|
+
for (let h = 0; h < 11; h += 1)
|
|
1301
|
+
d[h] = m(h * 0.1, t, r);
|
|
1302
|
+
return (h) => h <= 0 ? 0 : h >= 1 ? 1 : m(b(h), e, n);
|
|
1303
1303
|
}
|
|
1304
1304
|
function Lr(t) {
|
|
1305
1305
|
const e = /steps\(\s*([0-9]+)\s*(?:,\s*([a-z-]+)\s*)?\)/i.exec(t);
|
|
@@ -1314,14 +1314,14 @@ function Ur(t) {
|
|
|
1314
1314
|
const e = t.trim().toLowerCase();
|
|
1315
1315
|
if (!e || e === "linear")
|
|
1316
1316
|
return (r) => $(r);
|
|
1317
|
-
if (
|
|
1318
|
-
const [r, n, o, s] =
|
|
1317
|
+
if (Xe[e]) {
|
|
1318
|
+
const [r, n, o, s] = Xe[e], i = et(r, n, o, s);
|
|
1319
1319
|
return (a) => $(i($(a)));
|
|
1320
1320
|
}
|
|
1321
1321
|
if (e.startsWith("cubic-bezier(") && e.endsWith(")")) {
|
|
1322
1322
|
const n = e.slice(13, -1).split(",").map((o) => Number.parseFloat(o.trim()));
|
|
1323
1323
|
if (n.length === 4 && n.every((o) => Number.isFinite(o))) {
|
|
1324
|
-
const [o, s, i, a] = n, c =
|
|
1324
|
+
const [o, s, i, a] = n, c = et(o, s, i, a);
|
|
1325
1325
|
return (f) => $(c($(f)));
|
|
1326
1326
|
}
|
|
1327
1327
|
}
|
|
@@ -1368,7 +1368,7 @@ class Dr {
|
|
|
1368
1368
|
try {
|
|
1369
1369
|
e();
|
|
1370
1370
|
} catch (r) {
|
|
1371
|
-
|
|
1371
|
+
Ee.warn("Failed to cleanup binding listener", r);
|
|
1372
1372
|
}
|
|
1373
1373
|
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);
|
|
1374
1374
|
}
|
|
@@ -1378,7 +1378,7 @@ class Dr {
|
|
|
1378
1378
|
const n = (JSON.parse(e).motionBindings ?? []).map((o) => this.parseBinding(o)).filter((o) => o !== void 0);
|
|
1379
1379
|
return n.length === 0 ? void 0 : { bindings: n };
|
|
1380
1380
|
} catch (r) {
|
|
1381
|
-
|
|
1381
|
+
Ee.warn("Failed to parse motion metadata", r);
|
|
1382
1382
|
return;
|
|
1383
1383
|
}
|
|
1384
1384
|
}
|
|
@@ -1386,7 +1386,7 @@ class Dr {
|
|
|
1386
1386
|
const r = e.source?.trim();
|
|
1387
1387
|
if (!r)
|
|
1388
1388
|
return;
|
|
1389
|
-
const n =
|
|
1389
|
+
const n = Ze(e.min) ?? 0, o = Ze(e.max), s = o === void 0 ? n + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, c = Ur(e.ease), f = xr(e.map), d = e.targetId?.trim() || void 0;
|
|
1390
1390
|
return Number.isNaN(n) || Number.isNaN(s) ? void 0 : {
|
|
1391
1391
|
source: r.toLowerCase(),
|
|
1392
1392
|
min: n,
|
|
@@ -1444,7 +1444,7 @@ class Dr {
|
|
|
1444
1444
|
const r = this.bindingsByStyle.get(e);
|
|
1445
1445
|
if (!r || typeof document > "u")
|
|
1446
1446
|
return;
|
|
1447
|
-
const n = `.${
|
|
1447
|
+
const n = `.${Qe(e)}`;
|
|
1448
1448
|
document.querySelectorAll(n).forEach((s) => this.applyStyleToElement(s, e, r));
|
|
1449
1449
|
}
|
|
1450
1450
|
applyStyleToElement(e, r, n) {
|
|
@@ -1484,7 +1484,7 @@ class Dr {
|
|
|
1484
1484
|
}
|
|
1485
1485
|
resolveScrollContainer(e, r) {
|
|
1486
1486
|
if (r.targetId) {
|
|
1487
|
-
const n = `[data-ikon-motion-source="${
|
|
1487
|
+
const n = `[data-ikon-motion-source="${Qe(r.targetId)}"]`, o = typeof document < "u" ? document.querySelector(n) : null;
|
|
1488
1488
|
if (o)
|
|
1489
1489
|
return o;
|
|
1490
1490
|
}
|
|
@@ -1554,7 +1554,7 @@ class Dr {
|
|
|
1554
1554
|
try {
|
|
1555
1555
|
i();
|
|
1556
1556
|
} catch (a) {
|
|
1557
|
-
|
|
1557
|
+
Ee.warn("Failed to cleanup listener", a);
|
|
1558
1558
|
}
|
|
1559
1559
|
this.globalCleanups.delete(i);
|
|
1560
1560
|
}
|
|
@@ -1599,21 +1599,21 @@ class Dr {
|
|
|
1599
1599
|
}
|
|
1600
1600
|
}
|
|
1601
1601
|
}
|
|
1602
|
-
const
|
|
1602
|
+
const Re = new Dr();
|
|
1603
1603
|
function Fr(t) {
|
|
1604
|
-
const e =
|
|
1604
|
+
const e = E(/* @__PURE__ */ new Map()), r = x(({ styleId: s, css: i, common: a }) => {
|
|
1605
1605
|
if (!(!s || typeof document > "u")) {
|
|
1606
1606
|
if (i) {
|
|
1607
1607
|
let c = e.current.get(s);
|
|
1608
1608
|
c || (c = document.createElement("style"), c.setAttribute("data-ikon-style-id", s), document.head.appendChild(c), e.current.set(s, c)), c.textContent = i;
|
|
1609
1609
|
}
|
|
1610
|
-
|
|
1610
|
+
Re.registerStyle(s, a);
|
|
1611
1611
|
}
|
|
1612
1612
|
}, []), n = x((s) => {
|
|
1613
1613
|
if (!(typeof document > "u"))
|
|
1614
1614
|
for (const i of s) {
|
|
1615
1615
|
const a = e.current.get(i);
|
|
1616
|
-
a && (a.remove(), e.current.delete(i)),
|
|
1616
|
+
a && (a.remove(), e.current.delete(i)), Re.unregisterStyle(i);
|
|
1617
1617
|
}
|
|
1618
1618
|
}, []), o = x(() => {
|
|
1619
1619
|
if (typeof document < "u") {
|
|
@@ -1621,7 +1621,7 @@ function Fr(t) {
|
|
|
1621
1621
|
s.remove();
|
|
1622
1622
|
e.current.clear();
|
|
1623
1623
|
}
|
|
1624
|
-
|
|
1624
|
+
Re.reset();
|
|
1625
1625
|
}, []);
|
|
1626
1626
|
return D(() => {
|
|
1627
1627
|
if (!t) return;
|
|
@@ -1642,7 +1642,7 @@ function Br(t) {
|
|
|
1642
1642
|
return e.sort(), e.join(",");
|
|
1643
1643
|
}
|
|
1644
1644
|
function $r(t) {
|
|
1645
|
-
const [e, r] =
|
|
1645
|
+
const [e, r] = J(), n = E("");
|
|
1646
1646
|
return D(() => {
|
|
1647
1647
|
if (!t) {
|
|
1648
1648
|
r(void 0), n.current = "";
|
|
@@ -1655,24 +1655,24 @@ function $r(t) {
|
|
|
1655
1655
|
return o(), t.subscribe(o);
|
|
1656
1656
|
}, [t]), e;
|
|
1657
1657
|
}
|
|
1658
|
-
var Vr = typeof global == "object" && global && global.Object === Object && global, Kr = typeof self == "object" && self && self.Object === Object && self, Yr = Vr || Kr || Function("return this")(),
|
|
1658
|
+
var Vr = typeof global == "object" && global && global.Object === Object && global, Kr = typeof self == "object" && self && self.Object === Object && self, Yr = Vr || Kr || Function("return this")(), ge = Yr.Symbol, ft = Object.prototype, zr = ft.hasOwnProperty, Wr = ft.toString, ce = ge ? ge.toStringTag : void 0;
|
|
1659
1659
|
function qr(t) {
|
|
1660
|
-
var e = zr.call(t,
|
|
1660
|
+
var e = zr.call(t, ce), r = t[ce];
|
|
1661
1661
|
try {
|
|
1662
|
-
t[
|
|
1662
|
+
t[ce] = void 0;
|
|
1663
1663
|
var n = !0;
|
|
1664
1664
|
} catch {
|
|
1665
1665
|
}
|
|
1666
1666
|
var o = Wr.call(t);
|
|
1667
|
-
return n && (e ? t[
|
|
1667
|
+
return n && (e ? t[ce] = r : delete t[ce]), o;
|
|
1668
1668
|
}
|
|
1669
1669
|
var Gr = Object.prototype, Hr = Gr.toString;
|
|
1670
1670
|
function Jr(t) {
|
|
1671
1671
|
return Hr.call(t);
|
|
1672
1672
|
}
|
|
1673
|
-
var Xr = "[object Null]", Zr = "[object Undefined]",
|
|
1673
|
+
var Xr = "[object Null]", Zr = "[object Undefined]", tt = ge ? ge.toStringTag : void 0;
|
|
1674
1674
|
function Qr(t) {
|
|
1675
|
-
return t == null ? t === void 0 ? Zr : Xr :
|
|
1675
|
+
return t == null ? t === void 0 ? Zr : Xr : tt && tt in Object(t) ? qr(t) : Jr(t);
|
|
1676
1676
|
}
|
|
1677
1677
|
function en(t) {
|
|
1678
1678
|
return t != null && typeof t == "object";
|
|
@@ -1681,8 +1681,8 @@ var tn = Array.isArray, rn = "[object String]";
|
|
|
1681
1681
|
function nn(t) {
|
|
1682
1682
|
return typeof t == "string" || !tn(t) && en(t) && Qr(t) == rn;
|
|
1683
1683
|
}
|
|
1684
|
-
const
|
|
1685
|
-
function
|
|
1684
|
+
const rt = "ikonUiModules";
|
|
1685
|
+
function Me(t) {
|
|
1686
1686
|
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
1687
1687
|
}
|
|
1688
1688
|
function on(t) {
|
|
@@ -1709,8 +1709,8 @@ function oo(t, e) {
|
|
|
1709
1709
|
return !0;
|
|
1710
1710
|
}
|
|
1711
1711
|
function sn(t) {
|
|
1712
|
-
if (!(!
|
|
1713
|
-
return on(t[
|
|
1712
|
+
if (!(!Me(t) || !Object.prototype.hasOwnProperty.call(t, rt)))
|
|
1713
|
+
return on(t[rt]);
|
|
1714
1714
|
}
|
|
1715
1715
|
function so(...t) {
|
|
1716
1716
|
for (const e of t) {
|
|
@@ -1720,7 +1720,7 @@ function so(...t) {
|
|
|
1720
1720
|
}
|
|
1721
1721
|
}
|
|
1722
1722
|
function io(t) {
|
|
1723
|
-
if (!
|
|
1723
|
+
if (!Me(t))
|
|
1724
1724
|
return;
|
|
1725
1725
|
const e = t, r = Object.keys(e).find((c) => c.toLowerCase() === "modules");
|
|
1726
1726
|
if (!r)
|
|
@@ -1739,7 +1739,7 @@ function io(t) {
|
|
|
1739
1739
|
o.push(b), i.add(b);
|
|
1740
1740
|
continue;
|
|
1741
1741
|
}
|
|
1742
|
-
if (!
|
|
1742
|
+
if (!Me(c))
|
|
1743
1743
|
continue;
|
|
1744
1744
|
const f = c, d = Object.keys(f).find((b) => b.toLowerCase() === "name");
|
|
1745
1745
|
if (!d)
|
|
@@ -1747,11 +1747,11 @@ function io(t) {
|
|
|
1747
1747
|
const m = f[d];
|
|
1748
1748
|
if (typeof m != "string")
|
|
1749
1749
|
continue;
|
|
1750
|
-
const
|
|
1751
|
-
if (!
|
|
1750
|
+
const u = m.trim();
|
|
1751
|
+
if (!u)
|
|
1752
1752
|
continue;
|
|
1753
|
-
const
|
|
1754
|
-
typeof
|
|
1753
|
+
const g = Object.keys(f).find((b) => b.toLowerCase() === "javascript"), y = g ? f[g] : void 0;
|
|
1754
|
+
typeof y == "string" && s.set(u, y), i.has(u) || (o.push(u), i.add(u));
|
|
1755
1755
|
}
|
|
1756
1756
|
if (!o.length && s.size === 0)
|
|
1757
1757
|
return { modules: [] };
|
|
@@ -1761,7 +1761,7 @@ function io(t) {
|
|
|
1761
1761
|
}));
|
|
1762
1762
|
return a.length > 0 ? { modules: o, inlineModules: a } : { modules: o };
|
|
1763
1763
|
}
|
|
1764
|
-
const
|
|
1764
|
+
const R = {
|
|
1765
1765
|
None: 0,
|
|
1766
1766
|
Letter: 1,
|
|
1767
1767
|
Word: 2,
|
|
@@ -1770,7 +1770,7 @@ const E = {
|
|
|
1770
1770
|
Emoji: 16
|
|
1771
1771
|
}, an = [
|
|
1772
1772
|
{
|
|
1773
|
-
flag:
|
|
1773
|
+
flag: R.Letter,
|
|
1774
1774
|
hints: [
|
|
1775
1775
|
"[data-motion-letter]",
|
|
1776
1776
|
"[data-letter]",
|
|
@@ -1779,7 +1779,7 @@ const E = {
|
|
|
1779
1779
|
]
|
|
1780
1780
|
},
|
|
1781
1781
|
{
|
|
1782
|
-
flag:
|
|
1782
|
+
flag: R.Word,
|
|
1783
1783
|
hints: [
|
|
1784
1784
|
"[data-motion-word]",
|
|
1785
1785
|
"[data-word]",
|
|
@@ -1788,7 +1788,7 @@ const E = {
|
|
|
1788
1788
|
]
|
|
1789
1789
|
},
|
|
1790
1790
|
{
|
|
1791
|
-
flag:
|
|
1791
|
+
flag: R.Line,
|
|
1792
1792
|
hints: [
|
|
1793
1793
|
"[data-motion-line]",
|
|
1794
1794
|
"[data-line]",
|
|
@@ -1797,7 +1797,7 @@ const E = {
|
|
|
1797
1797
|
]
|
|
1798
1798
|
},
|
|
1799
1799
|
{
|
|
1800
|
-
flag:
|
|
1800
|
+
flag: R.Paragraph,
|
|
1801
1801
|
hints: [
|
|
1802
1802
|
"[data-motion-paragraph]",
|
|
1803
1803
|
"[data-paragraph]",
|
|
@@ -1808,7 +1808,7 @@ const E = {
|
|
|
1808
1808
|
]
|
|
1809
1809
|
},
|
|
1810
1810
|
{
|
|
1811
|
-
flag:
|
|
1811
|
+
flag: R.Emoji,
|
|
1812
1812
|
hints: [
|
|
1813
1813
|
":is([data-motion-emoji],[data-emoji],.tw-motion-emoji,.tw-emoji)",
|
|
1814
1814
|
"[data-motion-emoji]",
|
|
@@ -1817,21 +1817,21 @@ const E = {
|
|
|
1817
1817
|
"[data-emoji]"
|
|
1818
1818
|
]
|
|
1819
1819
|
}
|
|
1820
|
-
],
|
|
1820
|
+
], je = R.Letter | R.Word | R.Line | R.Paragraph | R.Emoji, cn = R.Letter | R.Word | R.Line | R.Paragraph, nt = /* @__PURE__ */ new Map(), un = 16384;
|
|
1821
1821
|
function ao(t, e) {
|
|
1822
1822
|
if (!t || t.length > un)
|
|
1823
1823
|
return t;
|
|
1824
|
-
const r = kn(e), n =
|
|
1825
|
-
if (o ===
|
|
1824
|
+
const r = kn(e), n = Q(r, R.Emoji), o = r & cn;
|
|
1825
|
+
if (o === R.None && !n)
|
|
1826
1826
|
return t;
|
|
1827
1827
|
const s = t.replace(/\r\n/g, `
|
|
1828
1828
|
`).replace(/\r/g, `
|
|
1829
1829
|
`);
|
|
1830
|
-
if (o ===
|
|
1831
|
-
return
|
|
1830
|
+
if (o === R.None)
|
|
1831
|
+
return at(s);
|
|
1832
1832
|
const i = An(s);
|
|
1833
1833
|
if (i.length === 0)
|
|
1834
|
-
return n ?
|
|
1834
|
+
return n ? at(s) : t;
|
|
1835
1835
|
const a = Tn(i), c = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, f = [];
|
|
1836
1836
|
for (const d of a) {
|
|
1837
1837
|
const m = ln(d, r, c);
|
|
@@ -1845,14 +1845,14 @@ function ln(t, e, r) {
|
|
|
1845
1845
|
const s = dn(o, e, r);
|
|
1846
1846
|
n.push(...s);
|
|
1847
1847
|
}
|
|
1848
|
-
if (
|
|
1848
|
+
if (Q(e, R.Paragraph)) {
|
|
1849
1849
|
const o = r.paragraph++;
|
|
1850
1850
|
return [
|
|
1851
1851
|
/* @__PURE__ */ A.jsx(
|
|
1852
1852
|
"span",
|
|
1853
1853
|
{
|
|
1854
1854
|
"data-motion-paragraph": !0,
|
|
1855
|
-
style:
|
|
1855
|
+
style: be(o),
|
|
1856
1856
|
children: n
|
|
1857
1857
|
},
|
|
1858
1858
|
`motion-paragraph-${o}`
|
|
@@ -1863,10 +1863,10 @@ function ln(t, e, r) {
|
|
|
1863
1863
|
}
|
|
1864
1864
|
function dn(t, e, r) {
|
|
1865
1865
|
const n = fn(t.text, e, r), o = [];
|
|
1866
|
-
if (
|
|
1866
|
+
if (Q(e, R.Line)) {
|
|
1867
1867
|
const s = r.line++;
|
|
1868
1868
|
o.push(
|
|
1869
|
-
/* @__PURE__ */ A.jsx("span", { "data-motion-line": !0, style:
|
|
1869
|
+
/* @__PURE__ */ A.jsx("span", { "data-motion-line": !0, style: be(s), children: n }, `motion-line-${s}`)
|
|
1870
1870
|
);
|
|
1871
1871
|
} else
|
|
1872
1872
|
o.push(...n);
|
|
@@ -1877,44 +1877,44 @@ function dn(t, e, r) {
|
|
|
1877
1877
|
function fn(t, e, r) {
|
|
1878
1878
|
if (!t)
|
|
1879
1879
|
return [];
|
|
1880
|
-
const n =
|
|
1880
|
+
const n = Q(e, R.Word), o = [], s = /(\s+)/g;
|
|
1881
1881
|
let i = 0, a;
|
|
1882
1882
|
for (; (a = s.exec(t)) !== null; ) {
|
|
1883
1883
|
if (a.index > i) {
|
|
1884
1884
|
const c = t.slice(i, a.index);
|
|
1885
|
-
o.push(
|
|
1885
|
+
o.push(ot(c, r, e, n));
|
|
1886
1886
|
}
|
|
1887
1887
|
o.push(a[0]), i = a.index + a[0].length;
|
|
1888
1888
|
}
|
|
1889
1889
|
if (i < t.length) {
|
|
1890
1890
|
const c = t.slice(i);
|
|
1891
|
-
o.push(
|
|
1891
|
+
o.push(ot(c, r, e, n));
|
|
1892
1892
|
}
|
|
1893
1893
|
return o;
|
|
1894
1894
|
}
|
|
1895
|
-
function
|
|
1895
|
+
function ot(t, e, r, n) {
|
|
1896
1896
|
const o = e.word++, s = mn(t, r, e), i = `motion-word-${o}`, a = hn(o, n);
|
|
1897
1897
|
return n ? /* @__PURE__ */ A.jsx("span", { "data-motion-word": !0, style: a, children: s }, i) : /* @__PURE__ */ A.jsx("span", { style: a, children: s }, i);
|
|
1898
1898
|
}
|
|
1899
1899
|
function hn(t, e) {
|
|
1900
|
-
return e ? { ...
|
|
1900
|
+
return e ? { ...be(t), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
|
|
1901
1901
|
}
|
|
1902
1902
|
function mn(t, e, r) {
|
|
1903
1903
|
if (!t)
|
|
1904
1904
|
return [];
|
|
1905
|
-
const n =
|
|
1905
|
+
const n = Q(e, R.Letter), o = Q(e, R.Emoji);
|
|
1906
1906
|
if (!n) {
|
|
1907
1907
|
if (!o)
|
|
1908
1908
|
return [t];
|
|
1909
|
-
const a =
|
|
1909
|
+
const a = Le(t);
|
|
1910
1910
|
if (a.length === 0)
|
|
1911
1911
|
return [t];
|
|
1912
|
-
const { nodes: c } =
|
|
1912
|
+
const { nodes: c } = mt(a, r);
|
|
1913
1913
|
return c;
|
|
1914
1914
|
}
|
|
1915
|
-
const s = [], i =
|
|
1915
|
+
const s = [], i = Le(t);
|
|
1916
1916
|
for (const a of i) {
|
|
1917
|
-
const c = r.letter++, f = `motion-letter-${c}`, d =
|
|
1917
|
+
const c = r.letter++, f = `motion-letter-${c}`, d = be(c);
|
|
1918
1918
|
if (a === `
|
|
1919
1919
|
`) {
|
|
1920
1920
|
s.push(
|
|
@@ -1922,22 +1922,22 @@ function mn(t, e, r) {
|
|
|
1922
1922
|
);
|
|
1923
1923
|
continue;
|
|
1924
1924
|
}
|
|
1925
|
-
const
|
|
1925
|
+
const u = o && ht(a) ? { "data-motion-emoji": !0 } : void 0, g = a === " " ? " " : a;
|
|
1926
1926
|
s.push(
|
|
1927
|
-
/* @__PURE__ */ A.jsx("span", { "data-motion-letter": !0, style: d, ...
|
|
1927
|
+
/* @__PURE__ */ A.jsx("span", { "data-motion-letter": !0, style: d, ...u, children: g }, f)
|
|
1928
1928
|
);
|
|
1929
1929
|
}
|
|
1930
1930
|
return s;
|
|
1931
1931
|
}
|
|
1932
|
-
function
|
|
1932
|
+
function Le(t) {
|
|
1933
1933
|
if (!t)
|
|
1934
1934
|
return [];
|
|
1935
1935
|
const e = pn();
|
|
1936
1936
|
return e ? Array.from(e.segment(t), (r) => r.segment) : gn(t);
|
|
1937
1937
|
}
|
|
1938
|
-
let
|
|
1938
|
+
let ue;
|
|
1939
1939
|
function pn() {
|
|
1940
|
-
return
|
|
1940
|
+
return ue !== void 0 || (typeof Intl < "u" && typeof Intl.Segmenter == "function" ? ue = new Intl.Segmenter(void 0, { granularity: "grapheme" }) : ue = null), ue;
|
|
1941
1941
|
}
|
|
1942
1942
|
function gn(t) {
|
|
1943
1943
|
const e = [], r = Array.from(t);
|
|
@@ -1949,9 +1949,9 @@ function gn(t) {
|
|
|
1949
1949
|
return n && e.push(n), e;
|
|
1950
1950
|
}
|
|
1951
1951
|
function yn(t, e) {
|
|
1952
|
-
return e ? !!(
|
|
1952
|
+
return e ? !!(st(t) || st(e) || wn(e) || Sn(e) || bn(e) || it(t) && it(e)) : !1;
|
|
1953
1953
|
}
|
|
1954
|
-
function
|
|
1954
|
+
function st(t) {
|
|
1955
1955
|
return t.codePointAt(0) === 8205;
|
|
1956
1956
|
}
|
|
1957
1957
|
function Sn(t) {
|
|
@@ -1962,13 +1962,13 @@ function bn(t) {
|
|
|
1962
1962
|
const e = t.codePointAt(0);
|
|
1963
1963
|
return e === void 0 ? !1 : e >= 127995 && e <= 127999;
|
|
1964
1964
|
}
|
|
1965
|
-
function
|
|
1965
|
+
function it(t) {
|
|
1966
1966
|
const e = t.codePointAt(0);
|
|
1967
1967
|
return e === void 0 ? !1 : e >= 127462 && e <= 127487;
|
|
1968
1968
|
}
|
|
1969
|
-
let
|
|
1969
|
+
let Ae;
|
|
1970
1970
|
function wn(t) {
|
|
1971
|
-
return t ? (
|
|
1971
|
+
return t ? (Ae || (Ae = vn()), Ae(t)) : !1;
|
|
1972
1972
|
}
|
|
1973
1973
|
function vn() {
|
|
1974
1974
|
try {
|
|
@@ -1981,9 +1981,9 @@ function vn() {
|
|
|
1981
1981
|
};
|
|
1982
1982
|
}
|
|
1983
1983
|
}
|
|
1984
|
-
let
|
|
1985
|
-
function
|
|
1986
|
-
return t ? (
|
|
1984
|
+
let Te;
|
|
1985
|
+
function ht(t) {
|
|
1986
|
+
return t ? (Te || (Te = En()), Te(t)) : !1;
|
|
1987
1987
|
}
|
|
1988
1988
|
function En() {
|
|
1989
1989
|
try {
|
|
@@ -2026,10 +2026,10 @@ function Tn(t) {
|
|
|
2026
2026
|
r.push(n), n.breaks >= 2 && (e.push(r), r = []);
|
|
2027
2027
|
return r.length > 0 && e.push(r), e;
|
|
2028
2028
|
}
|
|
2029
|
-
function
|
|
2029
|
+
function Q(t, e) {
|
|
2030
2030
|
return (t & e) === e;
|
|
2031
2031
|
}
|
|
2032
|
-
function
|
|
2032
|
+
function be(t) {
|
|
2033
2033
|
return {
|
|
2034
2034
|
"--tw-motion-seq-index": t.toString(),
|
|
2035
2035
|
backgroundColor: "inherit",
|
|
@@ -2046,23 +2046,23 @@ function ve(t) {
|
|
|
2046
2046
|
WebkitTextFillColor: "inherit"
|
|
2047
2047
|
};
|
|
2048
2048
|
}
|
|
2049
|
-
function
|
|
2049
|
+
function at(t) {
|
|
2050
2050
|
if (!t)
|
|
2051
2051
|
return t;
|
|
2052
|
-
const e =
|
|
2052
|
+
const e = Le(t);
|
|
2053
2053
|
if (e.length === 0)
|
|
2054
2054
|
return t;
|
|
2055
|
-
const { nodes: r, sawEmoji: n } =
|
|
2055
|
+
const { nodes: r, sawEmoji: n } = mt(e);
|
|
2056
2056
|
return n ? r.length === 1 ? r[0] ?? t : r : t;
|
|
2057
2057
|
}
|
|
2058
|
-
function
|
|
2058
|
+
function mt(t, e) {
|
|
2059
2059
|
const r = [];
|
|
2060
2060
|
let n = "", o = !1, s = e?.emoji ?? 0;
|
|
2061
2061
|
const i = () => {
|
|
2062
2062
|
n && (r.push(n), n = "");
|
|
2063
2063
|
};
|
|
2064
2064
|
for (const a of t) {
|
|
2065
|
-
if (
|
|
2065
|
+
if (ht(a)) {
|
|
2066
2066
|
o = !0, i();
|
|
2067
2067
|
const f = `motion-emoji-${e ? e.emoji++ : s++}`;
|
|
2068
2068
|
r.push(
|
|
@@ -2076,22 +2076,22 @@ function gt(t, e) {
|
|
|
2076
2076
|
}
|
|
2077
2077
|
function kn(t) {
|
|
2078
2078
|
if (!t)
|
|
2079
|
-
return
|
|
2079
|
+
return R.None;
|
|
2080
2080
|
const e = t.trim();
|
|
2081
2081
|
if (!e)
|
|
2082
|
-
return
|
|
2083
|
-
const r =
|
|
2082
|
+
return R.None;
|
|
2083
|
+
const r = nt.get(e);
|
|
2084
2084
|
if (typeof r == "number")
|
|
2085
2085
|
return r;
|
|
2086
2086
|
if (typeof document > "u")
|
|
2087
|
-
return
|
|
2087
|
+
return R.None;
|
|
2088
2088
|
const n = e.split(/\s+/).filter(Boolean);
|
|
2089
2089
|
if (n.length === 0)
|
|
2090
|
-
return
|
|
2090
|
+
return R.None;
|
|
2091
2091
|
const s = n.map((c) => `.${Cn(c)}`).map(
|
|
2092
2092
|
(c) => new RegExp(`(^|[^a-zA-Z0-9_-])${In(c)}(?![a-zA-Z0-9_-])`)
|
|
2093
2093
|
);
|
|
2094
|
-
let i =
|
|
2094
|
+
let i = R.None, a = !1;
|
|
2095
2095
|
for (const c of Array.from(document.styleSheets)) {
|
|
2096
2096
|
let f;
|
|
2097
2097
|
try {
|
|
@@ -2099,17 +2099,17 @@ function kn(t) {
|
|
|
2099
2099
|
} catch {
|
|
2100
2100
|
continue;
|
|
2101
2101
|
}
|
|
2102
|
-
const d =
|
|
2103
|
-
if (d.mask && (i |= d.mask, i ===
|
|
2102
|
+
const d = pt(f, s);
|
|
2103
|
+
if (d.mask && (i |= d.mask, i === je))
|
|
2104
2104
|
break;
|
|
2105
2105
|
a ||= d.sawStyleRule;
|
|
2106
2106
|
}
|
|
2107
|
-
return (i !==
|
|
2107
|
+
return (i !== R.None || a) && nt.set(e, i), i;
|
|
2108
2108
|
}
|
|
2109
|
-
function
|
|
2109
|
+
function pt(t, e) {
|
|
2110
2110
|
if (!t)
|
|
2111
|
-
return { mask:
|
|
2112
|
-
let r =
|
|
2111
|
+
return { mask: R.None, sawStyleRule: !1 };
|
|
2112
|
+
let r = R.None, n = !1;
|
|
2113
2113
|
for (let o = 0; o < t.length; o++) {
|
|
2114
2114
|
const s = t[o];
|
|
2115
2115
|
if (s) {
|
|
@@ -2119,11 +2119,11 @@ function yt(t, e) {
|
|
|
2119
2119
|
n = !0;
|
|
2120
2120
|
for (const f of an)
|
|
2121
2121
|
f.hints.some((d) => a.includes(d)) && (r |= f.flag);
|
|
2122
|
-
if (r ===
|
|
2122
|
+
if (r === je)
|
|
2123
2123
|
return { mask: r, sawStyleRule: !0 };
|
|
2124
2124
|
} else if ("cssRules" in s) {
|
|
2125
|
-
const i =
|
|
2126
|
-
if (i.mask && (r |= i.mask, r ===
|
|
2125
|
+
const i = pt(s.cssRules, e);
|
|
2126
|
+
if (i.mask && (r |= i.mask, r === je))
|
|
2127
2127
|
return { mask: r, sawStyleRule: !0 };
|
|
2128
2128
|
n ||= i.sawStyleRule;
|
|
2129
2129
|
}
|
|
@@ -2137,32 +2137,32 @@ function Cn(t) {
|
|
|
2137
2137
|
function In(t) {
|
|
2138
2138
|
return t.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
|
|
2139
2139
|
}
|
|
2140
|
-
const
|
|
2141
|
-
function
|
|
2140
|
+
const Be = "ikon_auth_session", On = 7 * 24 * 60 * 60 * 1e3;
|
|
2141
|
+
function we(t) {
|
|
2142
2142
|
try {
|
|
2143
|
-
localStorage.setItem(
|
|
2143
|
+
localStorage.setItem(Be, JSON.stringify(t));
|
|
2144
2144
|
} catch {
|
|
2145
2145
|
console.warn("Failed to save auth session to localStorage");
|
|
2146
2146
|
}
|
|
2147
2147
|
}
|
|
2148
|
-
function
|
|
2148
|
+
function gt() {
|
|
2149
2149
|
try {
|
|
2150
|
-
const t = localStorage.getItem(
|
|
2150
|
+
const t = localStorage.getItem(Be);
|
|
2151
2151
|
if (!t) return null;
|
|
2152
2152
|
const e = JSON.parse(t);
|
|
2153
|
-
return Date.now() - e.authenticatedAt > On ? (
|
|
2153
|
+
return Date.now() - e.authenticatedAt > On ? (yt(), null) : e;
|
|
2154
2154
|
} catch {
|
|
2155
2155
|
return console.warn("Failed to load auth session from localStorage"), null;
|
|
2156
2156
|
}
|
|
2157
2157
|
}
|
|
2158
|
-
function
|
|
2158
|
+
function yt() {
|
|
2159
2159
|
try {
|
|
2160
|
-
localStorage.removeItem(
|
|
2160
|
+
localStorage.removeItem(Be);
|
|
2161
2161
|
} catch {
|
|
2162
2162
|
console.warn("Failed to clear auth session from localStorage");
|
|
2163
2163
|
}
|
|
2164
2164
|
}
|
|
2165
|
-
function
|
|
2165
|
+
function le(t) {
|
|
2166
2166
|
return {
|
|
2167
2167
|
id: "",
|
|
2168
2168
|
provider: t.provider,
|
|
@@ -2170,8 +2170,8 @@ function de(t) {
|
|
|
2170
2170
|
authenticatedAt: t.authenticatedAt
|
|
2171
2171
|
};
|
|
2172
2172
|
}
|
|
2173
|
-
async function
|
|
2174
|
-
const r =
|
|
2173
|
+
async function St(t, e) {
|
|
2174
|
+
const r = me(), n = await fetch(`${e}/anonymous`, {
|
|
2175
2175
|
method: "POST",
|
|
2176
2176
|
headers: { "Content-Type": "application/json" },
|
|
2177
2177
|
body: JSON.stringify({ deviceId: r, space: t })
|
|
@@ -2185,7 +2185,7 @@ async function wt(t, e) {
|
|
|
2185
2185
|
provider: "anonymous",
|
|
2186
2186
|
authenticatedAt: Date.now()
|
|
2187
2187
|
};
|
|
2188
|
-
return
|
|
2188
|
+
return we(s), s;
|
|
2189
2189
|
}
|
|
2190
2190
|
async function co(t) {
|
|
2191
2191
|
const { email: e, spaceId: r, authUrl: n, returnUrl: o = window.location.origin + window.location.pathname } = t, s = await fetch(`${n}/email/send`, {
|
|
@@ -2210,7 +2210,7 @@ function Nn() {
|
|
|
2210
2210
|
const e = new URLSearchParams(window.location.search).get("error");
|
|
2211
2211
|
return e ? decodeURIComponent(e) : null;
|
|
2212
2212
|
}
|
|
2213
|
-
function
|
|
2213
|
+
function ct() {
|
|
2214
2214
|
window.history.replaceState({}, "", window.location.pathname);
|
|
2215
2215
|
}
|
|
2216
2216
|
function Pn(t, e, r, n) {
|
|
@@ -2243,7 +2243,7 @@ async function jn(t, e, r) {
|
|
|
2243
2243
|
provider: "passkey",
|
|
2244
2244
|
authenticatedAt: Date.now()
|
|
2245
2245
|
};
|
|
2246
|
-
return
|
|
2246
|
+
return we(s), s;
|
|
2247
2247
|
}
|
|
2248
2248
|
async function Ln(t, e) {
|
|
2249
2249
|
const r = await fetch(`${t}/passkey/authentication/options`, {
|
|
@@ -2272,7 +2272,7 @@ async function Un(t, e) {
|
|
|
2272
2272
|
provider: "passkey",
|
|
2273
2273
|
authenticatedAt: Date.now()
|
|
2274
2274
|
};
|
|
2275
|
-
return
|
|
2275
|
+
return we(o), o;
|
|
2276
2276
|
}
|
|
2277
2277
|
function W(t) {
|
|
2278
2278
|
const e = new Uint8Array(t);
|
|
@@ -2281,23 +2281,23 @@ function W(t) {
|
|
|
2281
2281
|
r += String.fromCharCode(o);
|
|
2282
2282
|
return btoa(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
2283
2283
|
}
|
|
2284
|
-
function
|
|
2284
|
+
function ye(t) {
|
|
2285
2285
|
const e = t.replace(/-/g, "+").replace(/_/g, "/"), r = (4 - e.length % 4) % 4, n = e.padEnd(e.length + r, "="), o = atob(n), s = new ArrayBuffer(o.length), i = new Uint8Array(s);
|
|
2286
2286
|
for (let a = 0; a < o.length; a++)
|
|
2287
2287
|
i[a] = o.charCodeAt(a);
|
|
2288
2288
|
return s;
|
|
2289
2289
|
}
|
|
2290
|
-
function
|
|
2290
|
+
function $e() {
|
|
2291
2291
|
return xn.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
|
|
2292
2292
|
}
|
|
2293
2293
|
const xn = {
|
|
2294
2294
|
stubThis: (t) => t
|
|
2295
2295
|
};
|
|
2296
|
-
function
|
|
2296
|
+
function bt(t) {
|
|
2297
2297
|
const { id: e } = t;
|
|
2298
2298
|
return {
|
|
2299
2299
|
...t,
|
|
2300
|
-
id:
|
|
2300
|
+
id: ye(e),
|
|
2301
2301
|
/**
|
|
2302
2302
|
* `descriptor.transports` is an array of our `AuthenticatorTransportFuture` that includes newer
|
|
2303
2303
|
* transports that TypeScript's DOM lib is ignorant of. Convince TS that our list of transports
|
|
@@ -2306,13 +2306,13 @@ function vt(t) {
|
|
|
2306
2306
|
transports: t.transports
|
|
2307
2307
|
};
|
|
2308
2308
|
}
|
|
2309
|
-
function
|
|
2309
|
+
function wt(t) {
|
|
2310
2310
|
return (
|
|
2311
2311
|
// Consider localhost valid as well since it's okay wrt Secure Contexts
|
|
2312
2312
|
t === "localhost" || /^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)
|
|
2313
2313
|
);
|
|
2314
2314
|
}
|
|
2315
|
-
class
|
|
2315
|
+
class P extends Error {
|
|
2316
2316
|
constructor({ message: e, code: r, cause: n, name: o }) {
|
|
2317
2317
|
super(e, { cause: n }), Object.defineProperty(this, "code", {
|
|
2318
2318
|
enumerable: !0,
|
|
@@ -2328,14 +2328,14 @@ function Dn({ error: t, options: e }) {
|
|
|
2328
2328
|
throw Error("options was missing required publicKey property");
|
|
2329
2329
|
if (t.name === "AbortError") {
|
|
2330
2330
|
if (e.signal instanceof AbortSignal)
|
|
2331
|
-
return new
|
|
2331
|
+
return new P({
|
|
2332
2332
|
message: "Registration ceremony was sent an abort signal",
|
|
2333
2333
|
code: "ERROR_CEREMONY_ABORTED",
|
|
2334
2334
|
cause: t
|
|
2335
2335
|
});
|
|
2336
2336
|
} else if (t.name === "ConstraintError") {
|
|
2337
2337
|
if (r.authenticatorSelection?.requireResidentKey === !0)
|
|
2338
|
-
return new
|
|
2338
|
+
return new P({
|
|
2339
2339
|
message: "Discoverable credentials were required but no available authenticator supported it",
|
|
2340
2340
|
code: "ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",
|
|
2341
2341
|
cause: t
|
|
@@ -2344,63 +2344,63 @@ function Dn({ error: t, options: e }) {
|
|
|
2344
2344
|
// @ts-ignore: `mediation` doesn't yet exist on CredentialCreationOptions but it's possible as of Sept 2024
|
|
2345
2345
|
e.mediation === "conditional" && r.authenticatorSelection?.userVerification === "required"
|
|
2346
2346
|
)
|
|
2347
|
-
return new
|
|
2347
|
+
return new P({
|
|
2348
2348
|
message: "User verification was required during automatic registration but it could not be performed",
|
|
2349
2349
|
code: "ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",
|
|
2350
2350
|
cause: t
|
|
2351
2351
|
});
|
|
2352
2352
|
if (r.authenticatorSelection?.userVerification === "required")
|
|
2353
|
-
return new
|
|
2353
|
+
return new P({
|
|
2354
2354
|
message: "User verification was required but no available authenticator supported it",
|
|
2355
2355
|
code: "ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",
|
|
2356
2356
|
cause: t
|
|
2357
2357
|
});
|
|
2358
2358
|
} else {
|
|
2359
2359
|
if (t.name === "InvalidStateError")
|
|
2360
|
-
return new
|
|
2360
|
+
return new P({
|
|
2361
2361
|
message: "The authenticator was previously registered",
|
|
2362
2362
|
code: "ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",
|
|
2363
2363
|
cause: t
|
|
2364
2364
|
});
|
|
2365
2365
|
if (t.name === "NotAllowedError")
|
|
2366
|
-
return new
|
|
2366
|
+
return new P({
|
|
2367
2367
|
message: t.message,
|
|
2368
2368
|
code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
|
|
2369
2369
|
cause: t
|
|
2370
2370
|
});
|
|
2371
2371
|
if (t.name === "NotSupportedError")
|
|
2372
|
-
return r.pubKeyCredParams.filter((o) => o.type === "public-key").length === 0 ? new
|
|
2372
|
+
return r.pubKeyCredParams.filter((o) => o.type === "public-key").length === 0 ? new P({
|
|
2373
2373
|
message: 'No entry in pubKeyCredParams was of type "public-key"',
|
|
2374
2374
|
code: "ERROR_MALFORMED_PUBKEYCREDPARAMS",
|
|
2375
2375
|
cause: t
|
|
2376
|
-
}) : new
|
|
2376
|
+
}) : new P({
|
|
2377
2377
|
message: "No available authenticator supported any of the specified pubKeyCredParams algorithms",
|
|
2378
2378
|
code: "ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",
|
|
2379
2379
|
cause: t
|
|
2380
2380
|
});
|
|
2381
2381
|
if (t.name === "SecurityError") {
|
|
2382
2382
|
const n = globalThis.location.hostname;
|
|
2383
|
-
if (
|
|
2383
|
+
if (wt(n)) {
|
|
2384
2384
|
if (r.rp.id !== n)
|
|
2385
|
-
return new
|
|
2385
|
+
return new P({
|
|
2386
2386
|
message: `The RP ID "${r.rp.id}" is invalid for this domain`,
|
|
2387
2387
|
code: "ERROR_INVALID_RP_ID",
|
|
2388
2388
|
cause: t
|
|
2389
2389
|
});
|
|
2390
|
-
} else return new
|
|
2390
|
+
} else return new P({
|
|
2391
2391
|
message: `${globalThis.location.hostname} is an invalid domain`,
|
|
2392
2392
|
code: "ERROR_INVALID_DOMAIN",
|
|
2393
2393
|
cause: t
|
|
2394
2394
|
});
|
|
2395
2395
|
} else if (t.name === "TypeError") {
|
|
2396
2396
|
if (r.user.id.byteLength < 1 || r.user.id.byteLength > 64)
|
|
2397
|
-
return new
|
|
2397
|
+
return new P({
|
|
2398
2398
|
message: "User ID was not between 1 and 64 characters",
|
|
2399
2399
|
code: "ERROR_INVALID_USER_ID_LENGTH",
|
|
2400
2400
|
cause: t
|
|
2401
2401
|
});
|
|
2402
2402
|
} else if (t.name === "UnknownError")
|
|
2403
|
-
return new
|
|
2403
|
+
return new P({
|
|
2404
2404
|
message: "The authenticator was unable to process the specified options, or could not create a new credential",
|
|
2405
2405
|
code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
|
|
2406
2406
|
cause: t
|
|
@@ -2432,31 +2432,31 @@ class Fn {
|
|
|
2432
2432
|
}
|
|
2433
2433
|
}
|
|
2434
2434
|
}
|
|
2435
|
-
const
|
|
2436
|
-
function
|
|
2435
|
+
const vt = new Fn(), Bn = ["cross-platform", "platform"];
|
|
2436
|
+
function Et(t) {
|
|
2437
2437
|
if (t && !(Bn.indexOf(t) < 0))
|
|
2438
2438
|
return t;
|
|
2439
2439
|
}
|
|
2440
2440
|
async function $n(t) {
|
|
2441
2441
|
!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 });
|
|
2442
2442
|
const { optionsJSON: e, useAutoRegister: r = !1 } = t;
|
|
2443
|
-
if (
|
|
2443
|
+
if (!$e())
|
|
2444
2444
|
throw new Error("WebAuthn is not supported in this browser");
|
|
2445
2445
|
const n = {
|
|
2446
2446
|
...e,
|
|
2447
|
-
challenge:
|
|
2447
|
+
challenge: ye(e.challenge),
|
|
2448
2448
|
user: {
|
|
2449
2449
|
...e.user,
|
|
2450
|
-
id:
|
|
2450
|
+
id: ye(e.user.id)
|
|
2451
2451
|
},
|
|
2452
|
-
excludeCredentials: e.excludeCredentials?.map(
|
|
2452
|
+
excludeCredentials: e.excludeCredentials?.map(bt)
|
|
2453
2453
|
}, o = {};
|
|
2454
|
-
r && (o.mediation = "conditional"), o.publicKey = n, o.signal =
|
|
2454
|
+
r && (o.mediation = "conditional"), o.publicKey = n, o.signal = vt.createNewAbortSignal();
|
|
2455
2455
|
let s;
|
|
2456
2456
|
try {
|
|
2457
2457
|
s = await navigator.credentials.create(o);
|
|
2458
|
-
} catch (
|
|
2459
|
-
throw Dn({ error:
|
|
2458
|
+
} catch (y) {
|
|
2459
|
+
throw Dn({ error: y, options: o });
|
|
2460
2460
|
}
|
|
2461
2461
|
if (!s)
|
|
2462
2462
|
throw new Error("Registration was not completed");
|
|
@@ -2467,23 +2467,23 @@ async function $n(t) {
|
|
|
2467
2467
|
if (typeof c.getPublicKeyAlgorithm == "function")
|
|
2468
2468
|
try {
|
|
2469
2469
|
m = c.getPublicKeyAlgorithm();
|
|
2470
|
-
} catch (
|
|
2471
|
-
|
|
2470
|
+
} catch (y) {
|
|
2471
|
+
ke("getPublicKeyAlgorithm()", y);
|
|
2472
2472
|
}
|
|
2473
|
-
let
|
|
2473
|
+
let u;
|
|
2474
2474
|
if (typeof c.getPublicKey == "function")
|
|
2475
2475
|
try {
|
|
2476
|
-
const
|
|
2477
|
-
|
|
2478
|
-
} catch (
|
|
2479
|
-
|
|
2476
|
+
const y = c.getPublicKey();
|
|
2477
|
+
y !== null && (u = W(y));
|
|
2478
|
+
} catch (y) {
|
|
2479
|
+
ke("getPublicKey()", y);
|
|
2480
2480
|
}
|
|
2481
|
-
let
|
|
2481
|
+
let g;
|
|
2482
2482
|
if (typeof c.getAuthenticatorData == "function")
|
|
2483
2483
|
try {
|
|
2484
|
-
|
|
2485
|
-
} catch (
|
|
2486
|
-
|
|
2484
|
+
g = W(c.getAuthenticatorData());
|
|
2485
|
+
} catch (y) {
|
|
2486
|
+
ke("getAuthenticatorData()", y);
|
|
2487
2487
|
}
|
|
2488
2488
|
return {
|
|
2489
2489
|
id: i,
|
|
@@ -2493,25 +2493,25 @@ async function $n(t) {
|
|
|
2493
2493
|
clientDataJSON: W(c.clientDataJSON),
|
|
2494
2494
|
transports: d,
|
|
2495
2495
|
publicKeyAlgorithm: m,
|
|
2496
|
-
publicKey:
|
|
2497
|
-
authenticatorData:
|
|
2496
|
+
publicKey: u,
|
|
2497
|
+
authenticatorData: g
|
|
2498
2498
|
},
|
|
2499
2499
|
type: f,
|
|
2500
2500
|
clientExtensionResults: s.getClientExtensionResults(),
|
|
2501
|
-
authenticatorAttachment:
|
|
2501
|
+
authenticatorAttachment: Et(s.authenticatorAttachment)
|
|
2502
2502
|
};
|
|
2503
2503
|
}
|
|
2504
|
-
function
|
|
2504
|
+
function ke(t, e) {
|
|
2505
2505
|
console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${t}. You should report this error to them.
|
|
2506
2506
|
`, e);
|
|
2507
2507
|
}
|
|
2508
2508
|
function Vn() {
|
|
2509
|
-
if (
|
|
2510
|
-
return
|
|
2509
|
+
if (!$e())
|
|
2510
|
+
return Ce.stubThis(new Promise((e) => e(!1)));
|
|
2511
2511
|
const t = globalThis.PublicKeyCredential;
|
|
2512
|
-
return t?.isConditionalMediationAvailable === void 0 ?
|
|
2512
|
+
return t?.isConditionalMediationAvailable === void 0 ? Ce.stubThis(new Promise((e) => e(!1))) : Ce.stubThis(t.isConditionalMediationAvailable());
|
|
2513
2513
|
}
|
|
2514
|
-
const
|
|
2514
|
+
const Ce = {
|
|
2515
2515
|
stubThis: (t) => t
|
|
2516
2516
|
};
|
|
2517
2517
|
function Kn({ error: t, options: e }) {
|
|
@@ -2520,34 +2520,34 @@ function Kn({ error: t, options: e }) {
|
|
|
2520
2520
|
throw Error("options was missing required publicKey property");
|
|
2521
2521
|
if (t.name === "AbortError") {
|
|
2522
2522
|
if (e.signal instanceof AbortSignal)
|
|
2523
|
-
return new
|
|
2523
|
+
return new P({
|
|
2524
2524
|
message: "Authentication ceremony was sent an abort signal",
|
|
2525
2525
|
code: "ERROR_CEREMONY_ABORTED",
|
|
2526
2526
|
cause: t
|
|
2527
2527
|
});
|
|
2528
2528
|
} else {
|
|
2529
2529
|
if (t.name === "NotAllowedError")
|
|
2530
|
-
return new
|
|
2530
|
+
return new P({
|
|
2531
2531
|
message: t.message,
|
|
2532
2532
|
code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
|
|
2533
2533
|
cause: t
|
|
2534
2534
|
});
|
|
2535
2535
|
if (t.name === "SecurityError") {
|
|
2536
2536
|
const n = globalThis.location.hostname;
|
|
2537
|
-
if (
|
|
2537
|
+
if (wt(n)) {
|
|
2538
2538
|
if (r.rpId !== n)
|
|
2539
|
-
return new
|
|
2539
|
+
return new P({
|
|
2540
2540
|
message: `The RP ID "${r.rpId}" is invalid for this domain`,
|
|
2541
2541
|
code: "ERROR_INVALID_RP_ID",
|
|
2542
2542
|
cause: t
|
|
2543
2543
|
});
|
|
2544
|
-
} else return new
|
|
2544
|
+
} else return new P({
|
|
2545
2545
|
message: `${globalThis.location.hostname} is an invalid domain`,
|
|
2546
2546
|
code: "ERROR_INVALID_DOMAIN",
|
|
2547
2547
|
cause: t
|
|
2548
2548
|
});
|
|
2549
2549
|
} else if (t.name === "UnknownError")
|
|
2550
|
-
return new
|
|
2550
|
+
return new P({
|
|
2551
2551
|
message: "The authenticator was unable to process the specified options, or could not create a new assertion signature",
|
|
2552
2552
|
code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
|
|
2553
2553
|
cause: t
|
|
@@ -2558,13 +2558,13 @@ function Kn({ error: t, options: e }) {
|
|
|
2558
2558
|
async function Yn(t) {
|
|
2559
2559
|
!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 });
|
|
2560
2560
|
const { optionsJSON: e, useBrowserAutofill: r = !1, verifyBrowserAutofillInput: n = !0 } = t;
|
|
2561
|
-
if (
|
|
2561
|
+
if (!$e())
|
|
2562
2562
|
throw new Error("WebAuthn is not supported in this browser");
|
|
2563
2563
|
let o;
|
|
2564
|
-
e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(
|
|
2564
|
+
e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(bt));
|
|
2565
2565
|
const s = {
|
|
2566
2566
|
...e,
|
|
2567
|
-
challenge:
|
|
2567
|
+
challenge: ye(e.challenge),
|
|
2568
2568
|
allowCredentials: o
|
|
2569
2569
|
}, i = {};
|
|
2570
2570
|
if (r) {
|
|
@@ -2574,34 +2574,34 @@ async function Yn(t) {
|
|
|
2574
2574
|
throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
|
|
2575
2575
|
i.mediation = "conditional", s.allowCredentials = [];
|
|
2576
2576
|
}
|
|
2577
|
-
i.publicKey = s, i.signal =
|
|
2577
|
+
i.publicKey = s, i.signal = vt.createNewAbortSignal();
|
|
2578
2578
|
let a;
|
|
2579
2579
|
try {
|
|
2580
2580
|
a = await navigator.credentials.get(i);
|
|
2581
|
-
} catch (
|
|
2582
|
-
throw Kn({ error:
|
|
2581
|
+
} catch (g) {
|
|
2582
|
+
throw Kn({ error: g, options: i });
|
|
2583
2583
|
}
|
|
2584
2584
|
if (!a)
|
|
2585
2585
|
throw new Error("Authentication was not completed");
|
|
2586
2586
|
const { id: c, rawId: f, response: d, type: m } = a;
|
|
2587
|
-
let
|
|
2588
|
-
return d.userHandle && (
|
|
2587
|
+
let u;
|
|
2588
|
+
return d.userHandle && (u = W(d.userHandle)), {
|
|
2589
2589
|
id: c,
|
|
2590
2590
|
rawId: W(f),
|
|
2591
2591
|
response: {
|
|
2592
2592
|
authenticatorData: W(d.authenticatorData),
|
|
2593
2593
|
clientDataJSON: W(d.clientDataJSON),
|
|
2594
2594
|
signature: W(d.signature),
|
|
2595
|
-
userHandle:
|
|
2595
|
+
userHandle: u
|
|
2596
2596
|
},
|
|
2597
2597
|
type: m,
|
|
2598
2598
|
clientExtensionResults: a.getClientExtensionResults(),
|
|
2599
|
-
authenticatorAttachment:
|
|
2599
|
+
authenticatorAttachment: Et(a.authenticatorAttachment)
|
|
2600
2600
|
};
|
|
2601
2601
|
}
|
|
2602
|
-
const
|
|
2602
|
+
const Ve = ut(null);
|
|
2603
2603
|
function uo({ children: t, config: e }) {
|
|
2604
|
-
const [r, n] =
|
|
2604
|
+
const [r, n] = J({
|
|
2605
2605
|
isAuthenticated: !1,
|
|
2606
2606
|
isLoading: !0,
|
|
2607
2607
|
user: null,
|
|
@@ -2611,7 +2611,7 @@ function uo({ children: t, config: e }) {
|
|
|
2611
2611
|
(() => {
|
|
2612
2612
|
const d = Nn();
|
|
2613
2613
|
if (d) {
|
|
2614
|
-
|
|
2614
|
+
ct(), n({
|
|
2615
2615
|
isAuthenticated: !1,
|
|
2616
2616
|
isLoading: !1,
|
|
2617
2617
|
user: null,
|
|
@@ -2621,25 +2621,25 @@ function uo({ children: t, config: e }) {
|
|
|
2621
2621
|
}
|
|
2622
2622
|
const m = _n();
|
|
2623
2623
|
if (m) {
|
|
2624
|
-
const
|
|
2624
|
+
const g = {
|
|
2625
2625
|
token: m.token,
|
|
2626
2626
|
provider: m.provider,
|
|
2627
2627
|
authenticatedAt: Date.now()
|
|
2628
2628
|
};
|
|
2629
|
-
|
|
2629
|
+
we(g), ct(), n({
|
|
2630
2630
|
isAuthenticated: !0,
|
|
2631
2631
|
isLoading: !1,
|
|
2632
|
-
user:
|
|
2632
|
+
user: le(g),
|
|
2633
2633
|
error: null
|
|
2634
2634
|
});
|
|
2635
2635
|
return;
|
|
2636
2636
|
}
|
|
2637
|
-
const
|
|
2638
|
-
if (
|
|
2637
|
+
const u = gt();
|
|
2638
|
+
if (u) {
|
|
2639
2639
|
n({
|
|
2640
2640
|
isAuthenticated: !0,
|
|
2641
2641
|
isLoading: !1,
|
|
2642
|
-
user:
|
|
2642
|
+
user: le(u),
|
|
2643
2643
|
error: null
|
|
2644
2644
|
});
|
|
2645
2645
|
return;
|
|
@@ -2655,47 +2655,47 @@ function uo({ children: t, config: e }) {
|
|
|
2655
2655
|
const o = x(
|
|
2656
2656
|
async (f) => {
|
|
2657
2657
|
if (!e.spaceId) {
|
|
2658
|
-
n((
|
|
2659
|
-
...
|
|
2658
|
+
n((u) => ({
|
|
2659
|
+
...u,
|
|
2660
2660
|
error: "Space ID is not configured"
|
|
2661
2661
|
}));
|
|
2662
2662
|
return;
|
|
2663
2663
|
}
|
|
2664
|
-
const d = e.authUrl ??
|
|
2664
|
+
const d = e.authUrl ?? Oe();
|
|
2665
2665
|
if (f === "guest") {
|
|
2666
|
-
n((
|
|
2666
|
+
n((u) => ({ ...u, isLoading: !0 }));
|
|
2667
2667
|
try {
|
|
2668
|
-
const
|
|
2668
|
+
const u = await St(e.spaceId, d);
|
|
2669
2669
|
n({
|
|
2670
2670
|
isAuthenticated: !0,
|
|
2671
2671
|
isLoading: !1,
|
|
2672
|
-
user:
|
|
2672
|
+
user: le(u),
|
|
2673
2673
|
error: null
|
|
2674
2674
|
});
|
|
2675
|
-
} catch (
|
|
2676
|
-
n((
|
|
2677
|
-
...
|
|
2675
|
+
} catch (u) {
|
|
2676
|
+
n((g) => ({
|
|
2677
|
+
...g,
|
|
2678
2678
|
isLoading: !1,
|
|
2679
|
-
error:
|
|
2679
|
+
error: u instanceof Error ? u.message : "Guest login failed"
|
|
2680
2680
|
}));
|
|
2681
2681
|
}
|
|
2682
2682
|
return;
|
|
2683
2683
|
}
|
|
2684
2684
|
if (f === "passkey") {
|
|
2685
|
-
n((
|
|
2685
|
+
n((u) => ({ ...u, isLoading: !0, error: null }));
|
|
2686
2686
|
try {
|
|
2687
|
-
const
|
|
2687
|
+
const u = await Ln(d), g = await Yn({ optionsJSON: u }), y = await Un(d, g);
|
|
2688
2688
|
n({
|
|
2689
2689
|
isAuthenticated: !0,
|
|
2690
2690
|
isLoading: !1,
|
|
2691
|
-
user:
|
|
2691
|
+
user: le(y),
|
|
2692
2692
|
error: null
|
|
2693
2693
|
});
|
|
2694
|
-
} catch (
|
|
2695
|
-
n((
|
|
2696
|
-
...
|
|
2694
|
+
} catch (u) {
|
|
2695
|
+
n((g) => ({
|
|
2696
|
+
...g,
|
|
2697
2697
|
isLoading: !1,
|
|
2698
|
-
error:
|
|
2698
|
+
error: u instanceof Error ? u.message : "Passkey login failed"
|
|
2699
2699
|
}));
|
|
2700
2700
|
}
|
|
2701
2701
|
return;
|
|
@@ -2705,7 +2705,7 @@ function uo({ children: t, config: e }) {
|
|
|
2705
2705
|
},
|
|
2706
2706
|
[e.authUrl, e.spaceId]
|
|
2707
2707
|
), s = x(() => {
|
|
2708
|
-
|
|
2708
|
+
yt(), n({
|
|
2709
2709
|
isAuthenticated: !1,
|
|
2710
2710
|
isLoading: !1,
|
|
2711
2711
|
user: null,
|
|
@@ -2713,19 +2713,19 @@ function uo({ children: t, config: e }) {
|
|
|
2713
2713
|
});
|
|
2714
2714
|
}, []), i = x(
|
|
2715
2715
|
async (f) => {
|
|
2716
|
-
const d = e.authUrl ??
|
|
2716
|
+
const d = e.authUrl ?? Oe();
|
|
2717
2717
|
n((m) => ({ ...m, isLoading: !0, error: null }));
|
|
2718
2718
|
try {
|
|
2719
|
-
const m = await Mn(d),
|
|
2719
|
+
const m = await Mn(d), u = await $n({ optionsJSON: m }), g = await jn(d, u, f);
|
|
2720
2720
|
n({
|
|
2721
2721
|
isAuthenticated: !0,
|
|
2722
2722
|
isLoading: !1,
|
|
2723
|
-
user:
|
|
2723
|
+
user: le(g),
|
|
2724
2724
|
error: null
|
|
2725
2725
|
});
|
|
2726
2726
|
} catch (m) {
|
|
2727
|
-
n((
|
|
2728
|
-
...
|
|
2727
|
+
n((u) => ({
|
|
2728
|
+
...u,
|
|
2729
2729
|
isLoading: !1,
|
|
2730
2730
|
error: m instanceof Error ? m.message : "Passkey registration failed"
|
|
2731
2731
|
}));
|
|
@@ -2742,19 +2742,19 @@ function uo({ children: t, config: e }) {
|
|
|
2742
2742
|
}),
|
|
2743
2743
|
[r, o, s, a, i]
|
|
2744
2744
|
);
|
|
2745
|
-
return /* @__PURE__ */ A.jsx(
|
|
2745
|
+
return /* @__PURE__ */ A.jsx(Ve, { value: c, children: t });
|
|
2746
2746
|
}
|
|
2747
2747
|
function zn() {
|
|
2748
|
-
const t =
|
|
2748
|
+
const t = xe(Ve);
|
|
2749
2749
|
if (!t)
|
|
2750
2750
|
throw new Error("useAuth must be used within an AuthProvider");
|
|
2751
2751
|
return t;
|
|
2752
2752
|
}
|
|
2753
2753
|
function lo() {
|
|
2754
|
-
return
|
|
2754
|
+
return xe(Ve);
|
|
2755
2755
|
}
|
|
2756
2756
|
function fo(t) {
|
|
2757
|
-
const { config: e, guestUrlParam: r } = t, { state: n, login: o } = zn(), s =
|
|
2757
|
+
const { config: e, guestUrlParam: r } = t, { state: n, login: o } = zn(), s = E(!1);
|
|
2758
2758
|
return D(() => {
|
|
2759
2759
|
if (!r || n.isAuthenticated || n.isLoading || s.current || !e.methods.includes("guest"))
|
|
2760
2760
|
return;
|
|
@@ -2784,7 +2784,7 @@ function ho({
|
|
|
2784
2784
|
renderConnectingSlow: f,
|
|
2785
2785
|
renderConnected: d,
|
|
2786
2786
|
renderOffline: m,
|
|
2787
|
-
renderError:
|
|
2787
|
+
renderError: u
|
|
2788
2788
|
}) {
|
|
2789
2789
|
switch (t) {
|
|
2790
2790
|
case "idle":
|
|
@@ -2805,12 +2805,12 @@ function ho({
|
|
|
2805
2805
|
case "offline":
|
|
2806
2806
|
return m();
|
|
2807
2807
|
case "offlineError":
|
|
2808
|
-
return
|
|
2808
|
+
return u(e ?? s?.lastError?.message ?? null);
|
|
2809
2809
|
default:
|
|
2810
2810
|
return null;
|
|
2811
2811
|
}
|
|
2812
2812
|
}
|
|
2813
|
-
const
|
|
2813
|
+
const Ie = Se("useIkonApp");
|
|
2814
2814
|
function Wn() {
|
|
2815
2815
|
if (typeof window < "u" && window.__IKON_AUTH_CONFIG__)
|
|
2816
2816
|
return window.__IKON_AUTH_CONFIG__;
|
|
@@ -2820,120 +2820,121 @@ function qn() {
|
|
|
2820
2820
|
return window.__IKON_LOCAL_IKON_SERVER_CONFIG__;
|
|
2821
2821
|
}
|
|
2822
2822
|
function mo(t) {
|
|
2823
|
-
const { authConfig: e, localServer: r, modules: n, registerModules: o, onJoined: s, onConnectionStateChange: i, onError: a,
|
|
2824
|
-
|
|
2825
|
-
const [
|
|
2823
|
+
const { authConfig: e, localServer: r, modules: n, registerModules: o, onJoined: s, onConnectionStateChange: i, onError: a, timeouts: c, audio: f, video: d, mediaSession: m } = t, u = e === void 0 ? Wn() ?? null : e, g = r ?? qn(), y = E(null), b = E(null), h = E(null), p = E(!1), v = E(f), k = E(d), I = E(m), j = E(c), G = E(i), Z = E(a), C = E(s);
|
|
2824
|
+
v.current = f, k.current = d, I.current = m, j.current = c, G.current = i, Z.current = a, C.current = s;
|
|
2825
|
+
const [N, F] = J("idle"), [M, L] = J(null), [z, ee] = J(null), [H, fe] = J(null), [te, re] = J(!1), B = Y(() => {
|
|
2826
2826
|
try {
|
|
2827
|
-
|
|
2827
|
+
const w = Ot();
|
|
2828
|
+
return (w.sessionId || w.channelKey) && _t(), w;
|
|
2828
2829
|
} catch {
|
|
2829
2830
|
return { parameters: {} };
|
|
2830
2831
|
}
|
|
2831
|
-
}, []),
|
|
2832
|
+
}, []), l = Y(() => u?.enabled ? gt() : null, [u?.enabled]), S = g?.enabled ?? !1, T = g?.host ?? "localhost", O = g?.port ?? 8443;
|
|
2832
2833
|
D(() => {
|
|
2833
|
-
!
|
|
2834
|
-
|
|
2835
|
-
}).catch((
|
|
2836
|
-
|
|
2834
|
+
!S && Ke() && u && !u.enabled && u.spaceId && !H && !te && (re(!0), St(u.spaceId, u.authUrl ?? Oe()).then((_) => {
|
|
2835
|
+
fe(_.token);
|
|
2836
|
+
}).catch((_) => {
|
|
2837
|
+
Ie.error("Anonymous auth failed:", _), L(_ instanceof Error ? _.message : "Anonymous auth failed");
|
|
2837
2838
|
}).finally(() => {
|
|
2838
|
-
|
|
2839
|
+
re(!1);
|
|
2839
2840
|
}));
|
|
2840
|
-
}, [
|
|
2841
|
-
const
|
|
2842
|
-
if (
|
|
2843
|
-
const
|
|
2841
|
+
}, [S, u, H, te]);
|
|
2842
|
+
const V = Y(() => {
|
|
2843
|
+
if (S) {
|
|
2844
|
+
const w = l?.token ? Nt(l.token) ?? me() : me();
|
|
2844
2845
|
return {
|
|
2845
2846
|
local: {
|
|
2846
|
-
host:
|
|
2847
|
-
httpsPort:
|
|
2848
|
-
userId:
|
|
2849
|
-
parameters:
|
|
2847
|
+
host: T,
|
|
2848
|
+
httpsPort: O,
|
|
2849
|
+
userId: w,
|
|
2850
|
+
parameters: B.parameters
|
|
2850
2851
|
}
|
|
2851
2852
|
};
|
|
2852
2853
|
}
|
|
2853
|
-
return
|
|
2854
|
+
return l?.token && u?.spaceId ? {
|
|
2854
2855
|
sessionToken: {
|
|
2855
|
-
token:
|
|
2856
|
-
spaceId:
|
|
2857
|
-
backendType:
|
|
2858
|
-
sessionId:
|
|
2859
|
-
channelKey:
|
|
2860
|
-
parameters:
|
|
2856
|
+
token: l.token,
|
|
2857
|
+
spaceId: u.spaceId,
|
|
2858
|
+
backendType: Ye(),
|
|
2859
|
+
sessionId: B.sessionId,
|
|
2860
|
+
channelKey: B.channelKey,
|
|
2861
|
+
parameters: B.parameters
|
|
2861
2862
|
}
|
|
2862
|
-
} : H &&
|
|
2863
|
+
} : H && u?.spaceId ? {
|
|
2863
2864
|
sessionToken: {
|
|
2864
2865
|
token: H,
|
|
2865
|
-
spaceId:
|
|
2866
|
-
backendType:
|
|
2867
|
-
sessionId:
|
|
2868
|
-
channelKey:
|
|
2869
|
-
parameters:
|
|
2866
|
+
spaceId: u.spaceId,
|
|
2867
|
+
backendType: Ye(),
|
|
2868
|
+
sessionId: B.sessionId,
|
|
2869
|
+
channelKey: B.channelKey,
|
|
2870
|
+
parameters: B.parameters
|
|
2870
2871
|
}
|
|
2871
|
-
} :
|
|
2872
|
+
} : Ke() ? null : {
|
|
2872
2873
|
local: {
|
|
2873
|
-
host:
|
|
2874
|
-
httpsPort:
|
|
2875
|
-
userId:
|
|
2876
|
-
parameters:
|
|
2874
|
+
host: T,
|
|
2875
|
+
httpsPort: O,
|
|
2876
|
+
userId: me(),
|
|
2877
|
+
parameters: B.parameters
|
|
2877
2878
|
}
|
|
2878
2879
|
};
|
|
2879
|
-
}, [
|
|
2880
|
-
Fr(
|
|
2881
|
-
const
|
|
2880
|
+
}, [S, T, O, l?.token, u?.spaceId, H, B.sessionId, B.channelKey, B.parameters]);
|
|
2881
|
+
Fr(z);
|
|
2882
|
+
const K = $r(z);
|
|
2882
2883
|
D(() => {
|
|
2883
|
-
if (!
|
|
2884
|
-
if (
|
|
2885
|
-
for (const
|
|
2886
|
-
|
|
2887
|
-
o?.(
|
|
2888
|
-
|
|
2884
|
+
if (!p.current) {
|
|
2885
|
+
if (p.current = !0, h.current = Nr(), n)
|
|
2886
|
+
for (const w of n)
|
|
2887
|
+
w(h.current);
|
|
2888
|
+
o?.(h.current), h.current.loadRegisteredModules().catch((w) => {
|
|
2889
|
+
Ie.error("Failed to load UI modules", w);
|
|
2889
2890
|
});
|
|
2890
2891
|
}
|
|
2891
2892
|
}, []), D(() => {
|
|
2892
|
-
if (!
|
|
2893
|
-
const
|
|
2894
|
-
...
|
|
2895
|
-
timeouts:
|
|
2896
|
-
audio:
|
|
2897
|
-
video:
|
|
2898
|
-
mediaSession:
|
|
2899
|
-
onConnectionStateChange: (
|
|
2900
|
-
F(
|
|
2893
|
+
if (!V) return;
|
|
2894
|
+
const w = new Pt({
|
|
2895
|
+
...V,
|
|
2896
|
+
timeouts: j.current,
|
|
2897
|
+
audio: v.current,
|
|
2898
|
+
video: k.current,
|
|
2899
|
+
mediaSession: I.current,
|
|
2900
|
+
onConnectionStateChange: (U) => {
|
|
2901
|
+
F(U), G.current?.(U);
|
|
2901
2902
|
},
|
|
2902
|
-
onError: (
|
|
2903
|
-
|
|
2903
|
+
onError: (U) => {
|
|
2904
|
+
L(U.message), Z.current?.(U);
|
|
2904
2905
|
},
|
|
2905
2906
|
onJoined: () => {
|
|
2906
|
-
const
|
|
2907
|
-
|
|
2907
|
+
const U = w.globalState?.SessionId;
|
|
2908
|
+
C.current?.(U);
|
|
2908
2909
|
}
|
|
2909
2910
|
});
|
|
2910
|
-
|
|
2911
|
-
const
|
|
2912
|
-
return
|
|
2913
|
-
|
|
2911
|
+
y.current = w;
|
|
2912
|
+
const _ = new Jt({ client: w });
|
|
2913
|
+
return b.current = _, ee(_), w.connect().catch((U) => {
|
|
2914
|
+
Ie.error("Connection failed:", U);
|
|
2914
2915
|
}), () => {
|
|
2915
|
-
|
|
2916
|
+
w.disconnect(), y.current = null, _.dispose(), b.current = null;
|
|
2916
2917
|
};
|
|
2917
|
-
}, [
|
|
2918
|
-
const
|
|
2919
|
-
const
|
|
2920
|
-
|
|
2921
|
-
}, []),
|
|
2918
|
+
}, [V]);
|
|
2919
|
+
const ne = x((w, _) => {
|
|
2920
|
+
const U = typeof _ == "string" ? _ : JSON.stringify(_ ?? {});
|
|
2921
|
+
y.current?.sendActionCall(w, U);
|
|
2922
|
+
}, []), oe = N === "connected" || N === "reconnecting";
|
|
2922
2923
|
return {
|
|
2923
|
-
connectionState:
|
|
2924
|
-
error:
|
|
2925
|
-
stores:
|
|
2926
|
-
client:
|
|
2927
|
-
registry:
|
|
2928
|
-
clientRef:
|
|
2929
|
-
uiRef:
|
|
2930
|
-
registryRef:
|
|
2931
|
-
onAction:
|
|
2932
|
-
isReady:
|
|
2924
|
+
connectionState: N,
|
|
2925
|
+
error: M,
|
|
2926
|
+
stores: K,
|
|
2927
|
+
client: y.current,
|
|
2928
|
+
registry: h.current,
|
|
2929
|
+
clientRef: y,
|
|
2930
|
+
uiRef: b,
|
|
2931
|
+
registryRef: h,
|
|
2932
|
+
onAction: ne,
|
|
2933
|
+
isReady: oe
|
|
2933
2934
|
};
|
|
2934
2935
|
}
|
|
2935
2936
|
function po(t) {
|
|
2936
|
-
const e =
|
|
2937
|
+
const e = E(!1);
|
|
2937
2938
|
return x(() => {
|
|
2938
2939
|
if (e.current) return;
|
|
2939
2940
|
e.current = !0;
|
|
@@ -2943,7 +2944,7 @@ function po(t) {
|
|
|
2943
2944
|
}
|
|
2944
2945
|
let Gn = 0;
|
|
2945
2946
|
function go(t = 5, e = 5e3) {
|
|
2946
|
-
const [r, n] =
|
|
2947
|
+
const [r, n] = J([]), o = E(/* @__PURE__ */ new Map()), s = x((i) => {
|
|
2947
2948
|
const a = o.current.get(i);
|
|
2948
2949
|
a && (clearTimeout(a), o.current.delete(i)), n((c) => c.filter((f) => f.id !== i));
|
|
2949
2950
|
}, []);
|
|
@@ -2952,19 +2953,19 @@ function go(t = 5, e = 5e3) {
|
|
|
2952
2953
|
(c) => {
|
|
2953
2954
|
if (!jt())
|
|
2954
2955
|
return;
|
|
2955
|
-
const f = `toast-${++Gn}`, d = c.level ===
|
|
2956
|
+
const f = `toast-${++Gn}`, d = c.level === ze.ERROR ? "error" : "warn", m = {
|
|
2956
2957
|
id: f,
|
|
2957
2958
|
level: d,
|
|
2958
2959
|
message: c.message,
|
|
2959
2960
|
component: c.component
|
|
2960
2961
|
};
|
|
2961
|
-
n((
|
|
2962
|
-
const
|
|
2962
|
+
n((g) => [...g, m].slice(-t));
|
|
2963
|
+
const u = setTimeout(() => {
|
|
2963
2964
|
s(f);
|
|
2964
2965
|
}, e);
|
|
2965
|
-
i.set(f,
|
|
2966
|
+
i.set(f, u);
|
|
2966
2967
|
},
|
|
2967
|
-
{ minLevel:
|
|
2968
|
+
{ minLevel: ze.WARN }
|
|
2968
2969
|
);
|
|
2969
2970
|
return () => {
|
|
2970
2971
|
a();
|
|
@@ -2974,7 +2975,7 @@ function go(t = 5, e = 5e3) {
|
|
|
2974
2975
|
};
|
|
2975
2976
|
}, [t, e, s]), { toasts: r, dismissToast: s };
|
|
2976
2977
|
}
|
|
2977
|
-
const
|
|
2978
|
+
const Rt = ut(null);
|
|
2978
2979
|
function Hn(t, e) {
|
|
2979
2980
|
return e ? t.replace(/\{(\w+)\}/g, (r, n) => e[n] ?? `{${n}}`) : t;
|
|
2980
2981
|
}
|
|
@@ -3005,10 +3006,10 @@ function yo({
|
|
|
3005
3006
|
}),
|
|
3006
3007
|
[i, s]
|
|
3007
3008
|
);
|
|
3008
|
-
return /* @__PURE__ */ A.jsx(
|
|
3009
|
+
return /* @__PURE__ */ A.jsx(Rt, { value: a, children: t });
|
|
3009
3010
|
}
|
|
3010
3011
|
function So() {
|
|
3011
|
-
const t =
|
|
3012
|
+
const t = xe(Rt);
|
|
3012
3013
|
if (!t)
|
|
3013
3014
|
throw new Error("useI18n must be used within an I18nProvider");
|
|
3014
3015
|
return t;
|
|
@@ -3021,7 +3022,7 @@ export {
|
|
|
3021
3022
|
fr as IKON_UI_MEDIA_MODULE,
|
|
3022
3023
|
Cr as IKON_UI_SHADER_MODULE,
|
|
3023
3024
|
Tr as IKON_UI_SHADER_TYPE,
|
|
3024
|
-
|
|
3025
|
+
Ne as IKON_UI_STREAM_CATEGORY,
|
|
3025
3026
|
ar as IKON_UI_VIDEO_CANVAS_TYPE,
|
|
3026
3027
|
cr as IKON_UI_VIDEO_URL_PLAYER_TYPE,
|
|
3027
3028
|
Jt as IkonUi,
|
|
@@ -3031,17 +3032,17 @@ export {
|
|
|
3031
3032
|
qt as UiRenderer,
|
|
3032
3033
|
vo as UiStreamStore,
|
|
3033
3034
|
oo as areIkonUiModuleListsEqual,
|
|
3034
|
-
|
|
3035
|
+
St as authenticateAnonymous,
|
|
3035
3036
|
Pn as buildOAuthRedirectUrl,
|
|
3036
|
-
|
|
3037
|
-
|
|
3037
|
+
yt as clearAuthSession,
|
|
3038
|
+
ct as clearOAuthParams,
|
|
3038
3039
|
nr as createBaseResolvers,
|
|
3039
3040
|
to as createComponentLibrary,
|
|
3040
3041
|
Nr as createIkonUiRegistry,
|
|
3041
3042
|
lr as createMediaResolvers,
|
|
3042
3043
|
kr as createShaderRendererResolver,
|
|
3043
3044
|
Ht as isIkonUiCategoryMatch,
|
|
3044
|
-
|
|
3045
|
+
gt as loadAuthSession,
|
|
3045
3046
|
sr as loadBaseModule,
|
|
3046
3047
|
hr as loadMediaModule,
|
|
3047
3048
|
Ir as loadShaderModule,
|
|
@@ -3056,9 +3057,9 @@ export {
|
|
|
3056
3057
|
Or as registerShaderModule,
|
|
3057
3058
|
zt as renderChildren,
|
|
3058
3059
|
ao as renderMotionLetters,
|
|
3059
|
-
|
|
3060
|
+
we as saveAuthSession,
|
|
3060
3061
|
co as sendMagicLink,
|
|
3061
|
-
|
|
3062
|
+
le as sessionToUser,
|
|
3062
3063
|
zn as useAuth,
|
|
3063
3064
|
fo as useAuthGuard,
|
|
3064
3065
|
lo as useAuthOptional,
|
|
@@ -3068,6 +3069,6 @@ export {
|
|
|
3068
3069
|
$r as useIkonUiStores,
|
|
3069
3070
|
po as useLazyFont,
|
|
3070
3071
|
go as useToasts,
|
|
3071
|
-
|
|
3072
|
+
X as useUiNode,
|
|
3072
3073
|
ro as useUiStore
|
|
3073
3074
|
};
|