@ikonai/sdk-react-ui 1.0.33 → 1.0.35
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 +5 -0
- package/index.js +1010 -1005
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { IkonUiCore as
|
|
2
|
-
import { UiStreamStore as
|
|
3
|
-
import
|
|
4
|
-
import { createLogger as
|
|
5
|
-
var
|
|
1
|
+
import { IkonUiCore as _t, UiStreamStore as Nt } from "@ikonai/sdk-ui";
|
|
2
|
+
import { UiStreamStore as Uo } from "@ikonai/sdk-ui";
|
|
3
|
+
import Pt, { useSyncExternalStore as $e, useMemo as K, memo as Y, useRef as w, useCallback as F, Fragment as Mt, useEffect as j, useState as G, createContext as pt, use as Ve } from "react";
|
|
4
|
+
import { createLogger as Ee, getOrCreateDeviceId as jt, deriveAuthUrl as je, parseUrlParams as Ut, clearSessionParamsFromUrl as Lt, isCloudEnvironment as Ge, extractUserIdFromToken as xt, deriveBackendType as He, IkonClient as Dt, AuthenticationError as Ft, subscribeToLogEvents as Bt, isDebugModeEnabled as $t, LogLevel as Je, getLangParam as Vt } from "@ikonai/sdk";
|
|
5
|
+
var ge = { exports: {} }, ae = {};
|
|
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
|
|
16
|
-
function
|
|
17
|
-
if (
|
|
18
|
-
|
|
15
|
+
var Xe;
|
|
16
|
+
function Kt() {
|
|
17
|
+
if (Xe) return ae;
|
|
18
|
+
Xe = 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 $t() {
|
|
|
32
32
|
props: s
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
return
|
|
35
|
+
return ae.Fragment = e, ae.jsx = r, ae.jsxs = r, ae;
|
|
36
36
|
}
|
|
37
|
-
var
|
|
37
|
+
var ce = {};
|
|
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
|
|
48
|
-
function
|
|
49
|
-
return
|
|
50
|
-
function t(
|
|
51
|
-
if (
|
|
52
|
-
if (typeof
|
|
53
|
-
return
|
|
54
|
-
if (typeof
|
|
55
|
-
switch (
|
|
56
|
-
case
|
|
47
|
+
var Ze;
|
|
48
|
+
function Yt() {
|
|
49
|
+
return Ze || (Ze = 1, process.env.NODE_ENV !== "production" && function() {
|
|
50
|
+
function t(d) {
|
|
51
|
+
if (d == null) return null;
|
|
52
|
+
if (typeof d == "function")
|
|
53
|
+
return d.$$typeof === L ? null : d.displayName || d.name || null;
|
|
54
|
+
if (typeof d == "string") return d;
|
|
55
|
+
switch (d) {
|
|
56
|
+
case b:
|
|
57
57
|
return "Fragment";
|
|
58
58
|
case g:
|
|
59
59
|
return "Profiler";
|
|
60
60
|
case m:
|
|
61
61
|
return "StrictMode";
|
|
62
|
-
case
|
|
62
|
+
case U:
|
|
63
63
|
return "Suspense";
|
|
64
64
|
case z:
|
|
65
65
|
return "SuspenseList";
|
|
66
66
|
case _:
|
|
67
67
|
return "Activity";
|
|
68
68
|
}
|
|
69
|
-
if (typeof
|
|
70
|
-
switch (typeof
|
|
69
|
+
if (typeof d == "object")
|
|
70
|
+
switch (typeof d.tag == "number" && console.error(
|
|
71
71
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
72
|
-
),
|
|
73
|
-
case
|
|
72
|
+
), d.$$typeof) {
|
|
73
|
+
case p:
|
|
74
74
|
return "Portal";
|
|
75
75
|
case k:
|
|
76
|
-
return (
|
|
77
|
-
case
|
|
78
|
-
return (
|
|
79
|
-
case
|
|
80
|
-
var
|
|
81
|
-
return
|
|
82
|
-
case
|
|
83
|
-
return
|
|
84
|
-
case
|
|
85
|
-
|
|
76
|
+
return (d.displayName || "Context") + ".Provider";
|
|
77
|
+
case v:
|
|
78
|
+
return (d._context.displayName || "Context") + ".Consumer";
|
|
79
|
+
case I:
|
|
80
|
+
var S = d.render;
|
|
81
|
+
return d = d.displayName, d || (d = S.displayName || S.name || "", d = d !== "" ? "ForwardRef(" + d + ")" : "ForwardRef"), d;
|
|
82
|
+
case J:
|
|
83
|
+
return S = d.displayName || null, S !== null ? S : t(d.type) || "Memo";
|
|
84
|
+
case C:
|
|
85
|
+
S = d._payload, d = d._init;
|
|
86
86
|
try {
|
|
87
|
-
return t(
|
|
87
|
+
return t(d(S));
|
|
88
88
|
} catch {
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
return null;
|
|
92
92
|
}
|
|
93
|
-
function e(
|
|
94
|
-
return "" +
|
|
93
|
+
function e(d) {
|
|
94
|
+
return "" + d;
|
|
95
95
|
}
|
|
96
|
-
function r(
|
|
96
|
+
function r(d) {
|
|
97
97
|
try {
|
|
98
|
-
e(
|
|
99
|
-
var
|
|
98
|
+
e(d);
|
|
99
|
+
var 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, A = typeof Symbol == "function" && Symbol.toStringTag && d[Symbol.toStringTag] || d.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
|
+
A
|
|
110
|
+
), e(d);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
function n(
|
|
114
|
-
if (
|
|
115
|
-
if (typeof
|
|
113
|
+
function n(d) {
|
|
114
|
+
if (d === b) return "<>";
|
|
115
|
+
if (typeof d == "object" && d !== null && d.$$typeof === C)
|
|
116
116
|
return "<...>";
|
|
117
117
|
try {
|
|
118
|
-
var
|
|
119
|
-
return
|
|
118
|
+
var S = t(d);
|
|
119
|
+
return S ? "<" + S + ">" : "<...>";
|
|
120
120
|
} catch {
|
|
121
121
|
return "<...>";
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
function o() {
|
|
125
|
-
var
|
|
126
|
-
return
|
|
125
|
+
var d = N.A;
|
|
126
|
+
return d === null ? null : d.getOwner();
|
|
127
127
|
}
|
|
128
128
|
function s() {
|
|
129
129
|
return Error("react-stack-top-frame");
|
|
130
130
|
}
|
|
131
|
-
function i(
|
|
132
|
-
if (
|
|
133
|
-
var
|
|
134
|
-
if (
|
|
131
|
+
function i(d) {
|
|
132
|
+
if (B.call(d, "key")) {
|
|
133
|
+
var S = Object.getOwnPropertyDescriptor(d, "key").get;
|
|
134
|
+
if (S && S.isReactWarning) return !1;
|
|
135
135
|
}
|
|
136
|
-
return
|
|
136
|
+
return d.key !== void 0;
|
|
137
137
|
}
|
|
138
|
-
function a(
|
|
139
|
-
function
|
|
140
|
-
|
|
138
|
+
function a(d, S) {
|
|
139
|
+
function T() {
|
|
140
|
+
oe || (oe = !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(d, "key", {
|
|
146
|
+
get: T,
|
|
147
147
|
configurable: !0
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
150
|
function c() {
|
|
151
|
-
var
|
|
152
|
-
return
|
|
151
|
+
var d = t(this.type);
|
|
152
|
+
return me[d] || (me[d] = !0, console.error(
|
|
153
153
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
154
|
-
)),
|
|
154
|
+
)), d = this.props.ref, d !== void 0 ? d : null;
|
|
155
155
|
}
|
|
156
|
-
function d
|
|
157
|
-
return
|
|
158
|
-
$$typeof:
|
|
159
|
-
type:
|
|
160
|
-
key:
|
|
161
|
-
props:
|
|
162
|
-
_owner:
|
|
163
|
-
}, (
|
|
156
|
+
function f(d, S, T, A, x, D, ee, te) {
|
|
157
|
+
return T = D.ref, d = {
|
|
158
|
+
$$typeof: y,
|
|
159
|
+
type: d,
|
|
160
|
+
key: S,
|
|
161
|
+
props: D,
|
|
162
|
+
_owner: x
|
|
163
|
+
}, (T !== void 0 ? T : null) !== null ? Object.defineProperty(d, "ref", {
|
|
164
164
|
enumerable: !1,
|
|
165
165
|
get: c
|
|
166
|
-
}) : Object.defineProperty(
|
|
166
|
+
}) : Object.defineProperty(d, "ref", { enumerable: !1, value: null }), d._store = {}, Object.defineProperty(d._store, "validated", {
|
|
167
167
|
configurable: !1,
|
|
168
168
|
enumerable: !1,
|
|
169
169
|
writable: !0,
|
|
170
170
|
value: 0
|
|
171
|
-
}), Object.defineProperty(
|
|
171
|
+
}), Object.defineProperty(d, "_debugInfo", {
|
|
172
172
|
configurable: !1,
|
|
173
173
|
enumerable: !1,
|
|
174
174
|
writable: !0,
|
|
175
175
|
value: null
|
|
176
|
-
}), Object.defineProperty(
|
|
176
|
+
}), Object.defineProperty(d, "_debugStack", {
|
|
177
177
|
configurable: !1,
|
|
178
178
|
enumerable: !1,
|
|
179
179
|
writable: !0,
|
|
180
180
|
value: ee
|
|
181
|
-
}), Object.defineProperty(
|
|
181
|
+
}), Object.defineProperty(d, "_debugTask", {
|
|
182
182
|
configurable: !1,
|
|
183
183
|
enumerable: !1,
|
|
184
184
|
writable: !0,
|
|
185
|
-
value:
|
|
186
|
-
}), Object.freeze && (Object.freeze(
|
|
185
|
+
value: te
|
|
186
|
+
}), Object.freeze && (Object.freeze(d.props), Object.freeze(d)), d;
|
|
187
187
|
}
|
|
188
|
-
function
|
|
189
|
-
var
|
|
190
|
-
if (
|
|
191
|
-
if (
|
|
192
|
-
if (
|
|
193
|
-
for (
|
|
194
|
-
|
|
195
|
-
Object.freeze && Object.freeze(
|
|
188
|
+
function l(d, S, T, A, x, D, ee, te) {
|
|
189
|
+
var O = S.children;
|
|
190
|
+
if (O !== void 0)
|
|
191
|
+
if (A)
|
|
192
|
+
if (W(O)) {
|
|
193
|
+
for (A = 0; A < O.length; A++)
|
|
194
|
+
u(O[A]);
|
|
195
|
+
Object.freeze && Object.freeze(O);
|
|
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
|
|
201
|
-
if (
|
|
202
|
-
|
|
203
|
-
var
|
|
204
|
-
return
|
|
200
|
+
else u(O);
|
|
201
|
+
if (B.call(S, "key")) {
|
|
202
|
+
O = t(d);
|
|
203
|
+
var Z = Object.keys(S).filter(function(Te) {
|
|
204
|
+
return Te !== "key";
|
|
205
205
|
});
|
|
206
|
-
|
|
206
|
+
A = 0 < Z.length ? "{key: someKey, " + Z.join(": ..., ") + ": ...}" : "{key: someKey}", se[O + A] || (Z = 0 < Z.length ? "{" + Z.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
|
+
A,
|
|
214
|
+
O,
|
|
215
|
+
Z,
|
|
216
|
+
O
|
|
217
|
+
), se[O + A] = !0);
|
|
218
218
|
}
|
|
219
|
-
if (
|
|
220
|
-
|
|
221
|
-
for (var
|
|
222
|
-
|
|
223
|
-
} else
|
|
224
|
-
return
|
|
225
|
-
|
|
226
|
-
typeof
|
|
227
|
-
),
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
219
|
+
if (O = null, T !== void 0 && (r(T), O = "" + T), i(S) && (r(S.key), O = "" + S.key), "key" in S) {
|
|
220
|
+
T = {};
|
|
221
|
+
for (var ie in S)
|
|
222
|
+
ie !== "key" && (T[ie] = S[ie]);
|
|
223
|
+
} else T = S;
|
|
224
|
+
return O && a(
|
|
225
|
+
T,
|
|
226
|
+
typeof d == "function" ? d.displayName || d.name || "Unknown" : d
|
|
227
|
+
), f(
|
|
228
|
+
d,
|
|
229
|
+
O,
|
|
230
|
+
D,
|
|
231
|
+
x,
|
|
232
232
|
o(),
|
|
233
|
-
|
|
233
|
+
T,
|
|
234
234
|
ee,
|
|
235
|
-
|
|
235
|
+
te
|
|
236
236
|
);
|
|
237
237
|
}
|
|
238
|
-
function
|
|
239
|
-
typeof
|
|
238
|
+
function u(d) {
|
|
239
|
+
typeof d == "object" && d !== null && d.$$typeof === y && d._store && (d._store.validated = 1);
|
|
240
240
|
}
|
|
241
|
-
var
|
|
241
|
+
var h = Pt, y = Symbol.for("react.transitional.element"), p = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), g = Symbol.for("react.profiler"), v = Symbol.for("react.consumer"), k = Symbol.for("react.context"), I = Symbol.for("react.forward_ref"), U = Symbol.for("react.suspense"), z = Symbol.for("react.suspense_list"), J = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), _ = Symbol.for("react.activity"), L = Symbol.for("react.client.reference"), N = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, B = Object.prototype.hasOwnProperty, W = Array.isArray, re = console.createTask ? console.createTask : function() {
|
|
242
242
|
return null;
|
|
243
243
|
};
|
|
244
|
-
|
|
245
|
-
"react-stack-bottom-frame": function(
|
|
246
|
-
return
|
|
244
|
+
h = {
|
|
245
|
+
"react-stack-bottom-frame": function(d) {
|
|
246
|
+
return d();
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
|
-
var
|
|
250
|
-
|
|
249
|
+
var oe, me = {}, X = h["react-stack-bottom-frame"].bind(
|
|
250
|
+
h,
|
|
251
251
|
s
|
|
252
|
-
)(),
|
|
253
|
-
|
|
254
|
-
var
|
|
255
|
-
return
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
252
|
+
)(), pe = re(n(s)), se = {};
|
|
253
|
+
ce.Fragment = b, ce.jsx = function(d, S, T, A, x) {
|
|
254
|
+
var D = 1e4 > N.recentlyCreatedOwnerStacks++;
|
|
255
|
+
return l(
|
|
256
|
+
d,
|
|
257
|
+
S,
|
|
258
|
+
T,
|
|
259
259
|
!1,
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
260
|
+
A,
|
|
261
|
+
x,
|
|
262
|
+
D ? Error("react-stack-top-frame") : X,
|
|
263
|
+
D ? re(n(d)) : pe
|
|
264
264
|
);
|
|
265
|
-
},
|
|
266
|
-
var
|
|
267
|
-
return
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
265
|
+
}, ce.jsxs = function(d, S, T, A, x) {
|
|
266
|
+
var D = 1e4 > N.recentlyCreatedOwnerStacks++;
|
|
267
|
+
return l(
|
|
268
|
+
d,
|
|
269
|
+
S,
|
|
270
|
+
T,
|
|
271
271
|
!0,
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
272
|
+
A,
|
|
273
|
+
x,
|
|
274
|
+
D ? Error("react-stack-top-frame") : X,
|
|
275
|
+
D ? re(n(d)) : pe
|
|
276
276
|
);
|
|
277
277
|
};
|
|
278
|
-
}()),
|
|
278
|
+
}()), ce;
|
|
279
279
|
}
|
|
280
|
-
var
|
|
281
|
-
function
|
|
282
|
-
return
|
|
280
|
+
var Qe;
|
|
281
|
+
function zt() {
|
|
282
|
+
return Qe || (Qe = 1, process.env.NODE_ENV === "production" ? ge.exports = Kt() : ge.exports = Yt()), ge.exports;
|
|
283
283
|
}
|
|
284
|
-
var
|
|
285
|
-
function
|
|
286
|
-
const r =
|
|
284
|
+
var E = zt();
|
|
285
|
+
function Wt(t, e) {
|
|
286
|
+
const r = $e(
|
|
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;
|
|
@@ -303,15 +303,15 @@ function Yt(t, e) {
|
|
|
303
303
|
}, [r]);
|
|
304
304
|
}
|
|
305
305
|
function H(t, e) {
|
|
306
|
-
const r =
|
|
306
|
+
const r = $e(
|
|
307
307
|
(n) => t.subscribeNode(e, n),
|
|
308
308
|
() => t.getNodeVersion(e),
|
|
309
309
|
() => t.getNodeVersion(e)
|
|
310
310
|
);
|
|
311
311
|
return K(() => t.getNode(e), [t, e, r]);
|
|
312
312
|
}
|
|
313
|
-
const
|
|
314
|
-
function
|
|
313
|
+
const qt = Ee("UIRenderer");
|
|
314
|
+
function Gt(t) {
|
|
315
315
|
if (t === void 0)
|
|
316
316
|
return "{}";
|
|
317
317
|
if (typeof t == "string")
|
|
@@ -322,18 +322,18 @@ function zt(t) {
|
|
|
322
322
|
return "{}";
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
|
-
function
|
|
325
|
+
function Ht(t) {
|
|
326
326
|
const e = t.styleIds;
|
|
327
327
|
return Array.isArray(e) ? e : [];
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function Jt(t) {
|
|
330
330
|
const e = t.children;
|
|
331
331
|
return Array.isArray(e) ? e : [];
|
|
332
332
|
}
|
|
333
|
-
function
|
|
333
|
+
function Xt(t, e) {
|
|
334
334
|
return t.nodeId === e.nodeId && t.context === e.context;
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function Zt(t) {
|
|
337
337
|
if (t.length === 0) return "";
|
|
338
338
|
if (t.length === 1) return t[0].id;
|
|
339
339
|
let e = t[0].id;
|
|
@@ -341,66 +341,66 @@ function Jt(t) {
|
|
|
341
341
|
e += "," + t[r].id;
|
|
342
342
|
return e;
|
|
343
343
|
}
|
|
344
|
-
const
|
|
345
|
-
const n = H(r.store, e), o = n ?
|
|
346
|
-
() => o.length === 0 ? null : o.map((
|
|
344
|
+
const Ue = Y(function t({ nodeId: e, context: r }) {
|
|
345
|
+
const n = H(r.store, e), o = n ? Jt(n) : [], s = Zt(o), i = K(
|
|
346
|
+
() => o.length === 0 ? null : o.map((u) => /* @__PURE__ */ E.jsx(t, { nodeId: u.id, context: r }, u.id)),
|
|
347
347
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
348
348
|
[s, r]
|
|
349
349
|
);
|
|
350
350
|
if (!n)
|
|
351
351
|
return null;
|
|
352
352
|
if (n.type === "root")
|
|
353
|
-
return /* @__PURE__ */
|
|
353
|
+
return /* @__PURE__ */ E.jsx(Mt, { children: i }, n.id);
|
|
354
354
|
const a = r.library.resolve(n);
|
|
355
355
|
if (!a)
|
|
356
|
-
return
|
|
357
|
-
const c =
|
|
358
|
-
return /* @__PURE__ */
|
|
359
|
-
},
|
|
360
|
-
function
|
|
361
|
-
return !Array.isArray(t) || t.length === 0 ? null : t.map((r) => /* @__PURE__ */
|
|
362
|
-
}
|
|
363
|
-
function
|
|
356
|
+
return qt.warn(`No renderer for node type ${n.type}`), null;
|
|
357
|
+
const c = Ht(n), f = c.length > 0 ? c.join(" ") : void 0, l = a;
|
|
358
|
+
return /* @__PURE__ */ E.jsx(l, { nodeId: e, context: r, className: f });
|
|
359
|
+
}, Xt);
|
|
360
|
+
function Qt(t, e) {
|
|
361
|
+
return !Array.isArray(t) || t.length === 0 ? null : t.map((r) => /* @__PURE__ */ E.jsx(Ue, { nodeId: r.id, context: e }, r.id));
|
|
362
|
+
}
|
|
363
|
+
function er(t, e) {
|
|
364
364
|
return t.store === e.store && t.library === e.library && t.viewId === e.viewId && t.emptyFallback === e.emptyFallback;
|
|
365
365
|
}
|
|
366
|
-
const
|
|
367
|
-
const { rootViewId: c, rootNodeId:
|
|
368
|
-
|
|
369
|
-
const
|
|
370
|
-
|
|
371
|
-
const
|
|
372
|
-
|
|
373
|
-
const
|
|
374
|
-
if (!
|
|
366
|
+
const tr = Y(function({ store: e, library: r, viewId: n, emptyFallback: o = null, onAction: s, client: i, video: a }) {
|
|
367
|
+
const { rootViewId: c, rootNodeId: f } = Wt(e, n), l = w(s);
|
|
368
|
+
l.current = s;
|
|
369
|
+
const u = w(i);
|
|
370
|
+
u.current = i;
|
|
371
|
+
const h = w(a);
|
|
372
|
+
h.current = a;
|
|
373
|
+
const y = F((b, m) => {
|
|
374
|
+
if (!b)
|
|
375
375
|
return;
|
|
376
|
-
const g =
|
|
377
|
-
|
|
378
|
-
}, []),
|
|
379
|
-
const
|
|
376
|
+
const g = Gt(m);
|
|
377
|
+
l.current?.(b, g);
|
|
378
|
+
}, []), p = K(() => {
|
|
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
384
|
getPayload: (m) => e.getSnapshot().payloads.get(m),
|
|
385
|
-
renderChildren: (m) =>
|
|
385
|
+
renderChildren: (m) => Qt(m, b),
|
|
386
386
|
renderView: (m) => {
|
|
387
387
|
const g = e.getSnapshot().views.get(m);
|
|
388
|
-
return g ? /* @__PURE__ */
|
|
388
|
+
return g ? /* @__PURE__ */ E.jsx(Ue, { nodeId: g.id, context: b }) : null;
|
|
389
389
|
},
|
|
390
|
-
dispatchAction:
|
|
390
|
+
dispatchAction: y,
|
|
391
391
|
// Access client/video via refs to avoid context recreation
|
|
392
392
|
get client() {
|
|
393
|
-
return
|
|
393
|
+
return u.current;
|
|
394
394
|
},
|
|
395
395
|
get video() {
|
|
396
|
-
return
|
|
396
|
+
return h.current;
|
|
397
397
|
}
|
|
398
398
|
};
|
|
399
|
-
return
|
|
400
|
-
}, [e, r,
|
|
401
|
-
return !c || !
|
|
402
|
-
},
|
|
403
|
-
class
|
|
399
|
+
return b;
|
|
400
|
+
}, [e, r, y]);
|
|
401
|
+
return !c || !f ? o : /* @__PURE__ */ E.jsx("div", { "data-ikon-view-id": c, style: { display: "contents" }, children: /* @__PURE__ */ E.jsx(Ue, { nodeId: f, context: p }) });
|
|
402
|
+
}, er);
|
|
403
|
+
class rr {
|
|
404
404
|
constructor(e, r) {
|
|
405
405
|
if (this.fallback = r, e)
|
|
406
406
|
for (const [n, o] of e)
|
|
@@ -417,41 +417,41 @@ class er {
|
|
|
417
417
|
return this.renderers.get(e.type) ?? this.fallback;
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
|
-
function
|
|
420
|
+
function yo(t, e) {
|
|
421
421
|
const r = Object.entries(t);
|
|
422
|
-
return new
|
|
422
|
+
return new rr(r, e);
|
|
423
423
|
}
|
|
424
|
-
function
|
|
425
|
-
return
|
|
424
|
+
function bo(t) {
|
|
425
|
+
return $e(
|
|
426
426
|
(e) => t.subscribe(e),
|
|
427
427
|
() => t.getSnapshot(),
|
|
428
428
|
() => t.getSnapshot()
|
|
429
429
|
);
|
|
430
430
|
}
|
|
431
|
-
const
|
|
432
|
-
function
|
|
431
|
+
const Le = "ikon-ui";
|
|
432
|
+
function nr(t, e) {
|
|
433
433
|
return t === e;
|
|
434
434
|
}
|
|
435
|
-
const
|
|
436
|
-
const i = K(() => Array.from(e.keys()).sort().join(","), [e]), a =
|
|
435
|
+
const So = Y(function({ stores: e, registry: r, category: n = Le, onAction: o, client: s }) {
|
|
436
|
+
const i = K(() => Array.from(e.keys()).sort().join(","), [e]), a = w(o);
|
|
437
437
|
a.current = o;
|
|
438
|
-
const c =
|
|
438
|
+
const c = w(s);
|
|
439
439
|
c.current = s;
|
|
440
|
-
const
|
|
440
|
+
const f = K(
|
|
441
441
|
() => {
|
|
442
|
-
const
|
|
443
|
-
for (const [
|
|
444
|
-
const
|
|
445
|
-
|
|
442
|
+
const l = [];
|
|
443
|
+
for (const [u, h] of e) {
|
|
444
|
+
const y = h.store.getSnapshot();
|
|
445
|
+
nr(h.category, n) && (!y.rootViewId || !y.views.has(y.rootViewId) || l.push({ key: u, store: h.store }));
|
|
446
446
|
}
|
|
447
|
-
return
|
|
447
|
+
return l;
|
|
448
448
|
},
|
|
449
449
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
450
450
|
[e, n, i]
|
|
451
451
|
);
|
|
452
|
-
return
|
|
452
|
+
return f.length === 0 ? null : /* @__PURE__ */ E.jsx(E.Fragment, { children: f.map(({ key: l, store: u }) => /* @__PURE__ */ E.jsx(tr, { store: u, library: r, onAction: a.current, client: c.current, video: c.current?.media?.video }, l)) });
|
|
453
453
|
});
|
|
454
|
-
class
|
|
454
|
+
class or {
|
|
455
455
|
core;
|
|
456
456
|
ownsCore;
|
|
457
457
|
stores = /* @__PURE__ */ new Map();
|
|
@@ -459,7 +459,7 @@ class rr {
|
|
|
459
459
|
unsubscribeClears;
|
|
460
460
|
unsubscribeStoreChanges;
|
|
461
461
|
constructor(e) {
|
|
462
|
-
this.core = e?.core ?? new
|
|
462
|
+
this.core = e?.core ?? new _t({ 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 rr {
|
|
|
509
509
|
if (r)
|
|
510
510
|
return r;
|
|
511
511
|
const n = {
|
|
512
|
-
category:
|
|
513
|
-
store: new
|
|
512
|
+
category: Le,
|
|
513
|
+
store: new Nt()
|
|
514
514
|
};
|
|
515
515
|
return this.stores.set(e, n), n;
|
|
516
516
|
}
|
|
@@ -518,7 +518,7 @@ class rr {
|
|
|
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 ?? Le;
|
|
522
522
|
return n.category === o ? !1 : (this.stores.set(e, { ...n, category: o }), !0);
|
|
523
523
|
}
|
|
524
524
|
notify(e) {
|
|
@@ -526,13 +526,13 @@ class rr {
|
|
|
526
526
|
r(e);
|
|
527
527
|
}
|
|
528
528
|
}
|
|
529
|
-
function
|
|
529
|
+
function sr(t) {
|
|
530
530
|
if (typeof t == "string") {
|
|
531
531
|
const e = t.trim();
|
|
532
532
|
return e.length > 0 ? e : void 0;
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
|
-
function
|
|
535
|
+
function he(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 Ke(...t) {
|
|
546
546
|
let e = "";
|
|
547
547
|
for (const r of t)
|
|
548
548
|
if (r) {
|
|
@@ -551,58 +551,57 @@ function $e(...t) {
|
|
|
551
551
|
}
|
|
552
552
|
return e || void 0;
|
|
553
553
|
}
|
|
554
|
-
const
|
|
555
|
-
function
|
|
554
|
+
const et = /* @__PURE__ */ new WeakMap(), ir = {};
|
|
555
|
+
function Ye(t) {
|
|
556
556
|
if (!t)
|
|
557
|
-
return
|
|
558
|
-
const e =
|
|
557
|
+
return ir;
|
|
558
|
+
const e = et.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 et.set(t, r), r;
|
|
565
565
|
}
|
|
566
|
-
function
|
|
567
|
-
const t =
|
|
568
|
-
const o = H(n.store, r), s =
|
|
569
|
-
return
|
|
566
|
+
function ar() {
|
|
567
|
+
const t = Y(function({ nodeId: r, context: n }) {
|
|
568
|
+
const o = H(n.store, r), s = w(null), i = he(o?.props?.targetViewId), a = o?.props?.focusOnly, c = typeof a == "boolean" ? a : void 0, f = he(o?.props?.key), l = o?.props?.preciseGeneratedAt;
|
|
569
|
+
return j(() => {
|
|
570
570
|
if (typeof document > "u")
|
|
571
571
|
return;
|
|
572
|
-
const
|
|
573
|
-
if (!
|
|
572
|
+
const h = s.current;
|
|
573
|
+
if (!h || i && h.closest("[data-ikon-view-id]")?.getAttribute("data-ikon-view-id") !== i)
|
|
574
574
|
return;
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
let k = w.parentElement;
|
|
575
|
+
if (c !== !0) {
|
|
576
|
+
const g = ((v) => {
|
|
577
|
+
let k = v.parentElement;
|
|
579
578
|
for (; k; ) {
|
|
580
|
-
const
|
|
581
|
-
if (
|
|
579
|
+
const U = window.getComputedStyle(k).overflowY;
|
|
580
|
+
if (U === "auto" || U === "scroll" || k.hasAttribute("data-radix-scroll-area-viewport"))
|
|
582
581
|
return k;
|
|
583
582
|
k = k.parentElement;
|
|
584
583
|
}
|
|
585
584
|
return null;
|
|
586
|
-
})(
|
|
585
|
+
})(h);
|
|
587
586
|
g ? requestAnimationFrame(() => {
|
|
588
|
-
const
|
|
589
|
-
"scrollBehavior" in document.documentElement.style ? g.scrollTo({ top:
|
|
590
|
-
}) : typeof
|
|
587
|
+
const v = g.getBoundingClientRect(), k = h.getBoundingClientRect(), I = g.scrollTop + (k.bottom - v.bottom) + 16;
|
|
588
|
+
"scrollBehavior" in document.documentElement.style ? g.scrollTo({ top: I, behavior: "smooth" }) : g.scrollTop = I;
|
|
589
|
+
}) : typeof h.scrollIntoView == "function" && requestAnimationFrame(() => {
|
|
591
590
|
try {
|
|
592
|
-
|
|
591
|
+
h.scrollIntoView({ behavior: "smooth", block: "end", inline: "nearest" });
|
|
593
592
|
} catch {
|
|
594
|
-
|
|
593
|
+
h.scrollIntoView(!1);
|
|
595
594
|
}
|
|
596
595
|
});
|
|
597
596
|
}
|
|
598
|
-
const
|
|
599
|
-
if (!(
|
|
597
|
+
const p = document.activeElement;
|
|
598
|
+
if (!(p instanceof HTMLInputElement || p instanceof HTMLTextAreaElement || p?.getAttribute("contenteditable") === "true") && typeof h.focus == "function")
|
|
600
599
|
try {
|
|
601
|
-
|
|
600
|
+
h.focus({ preventScroll: !0 });
|
|
602
601
|
} catch {
|
|
603
|
-
|
|
602
|
+
h.focus();
|
|
604
603
|
}
|
|
605
|
-
}, [c, i,
|
|
604
|
+
}, [c, i, f, l]), o ? /* @__PURE__ */ E.jsx(
|
|
606
605
|
"span",
|
|
607
606
|
{
|
|
608
607
|
ref: s,
|
|
@@ -619,25 +618,25 @@ function sr() {
|
|
|
619
618
|
return t;
|
|
620
619
|
};
|
|
621
620
|
}
|
|
622
|
-
function
|
|
623
|
-
const t =
|
|
624
|
-
const s = H(n.store, r), i =
|
|
621
|
+
function cr() {
|
|
622
|
+
const t = Y(function({ nodeId: r, context: n, className: o }) {
|
|
623
|
+
const s = H(n.store, r), i = sr(s?.props?.onInvokeId), a = F(() => {
|
|
625
624
|
i && n.dispatchAction(i);
|
|
626
625
|
}, [i, n]);
|
|
627
626
|
if (!s)
|
|
628
627
|
return null;
|
|
629
|
-
const c =
|
|
628
|
+
const c = Ye(s.props);
|
|
630
629
|
delete c.onInvokeId;
|
|
631
|
-
const
|
|
632
|
-
return /* @__PURE__ */
|
|
630
|
+
const f = Ke(he(s.props?.className), o), l = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
631
|
+
return /* @__PURE__ */ E.jsx(
|
|
633
632
|
"div",
|
|
634
633
|
{
|
|
635
634
|
...c,
|
|
636
635
|
"data-ikon-node-id": s.id,
|
|
637
|
-
className:
|
|
636
|
+
className: f,
|
|
638
637
|
onClick: i ? a : void 0,
|
|
639
638
|
style: i ? { cursor: "pointer" } : void 0,
|
|
640
|
-
children:
|
|
639
|
+
children: l
|
|
641
640
|
}
|
|
642
641
|
);
|
|
643
642
|
});
|
|
@@ -646,45 +645,45 @@ function ir() {
|
|
|
646
645
|
return t;
|
|
647
646
|
};
|
|
648
647
|
}
|
|
649
|
-
function
|
|
650
|
-
const t =
|
|
648
|
+
function ur() {
|
|
649
|
+
const t = Y(function({ nodeId: r, context: n, className: o }) {
|
|
651
650
|
const s = H(n.store, r);
|
|
652
651
|
if (!s)
|
|
653
652
|
return null;
|
|
654
|
-
const i =
|
|
655
|
-
return /* @__PURE__ */
|
|
653
|
+
const i = Ye(s.props), a = Ke("relative", he(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
654
|
+
return /* @__PURE__ */ E.jsx("div", { ...i, "data-ikon-node-id": s.id, className: a, children: c });
|
|
656
655
|
});
|
|
657
656
|
return ({ type: e }) => {
|
|
658
657
|
if (e === "std.stack")
|
|
659
658
|
return t;
|
|
660
659
|
};
|
|
661
660
|
}
|
|
662
|
-
function
|
|
663
|
-
const t =
|
|
661
|
+
function lr() {
|
|
662
|
+
const t = Y(function({ nodeId: r, context: n, className: o }) {
|
|
664
663
|
const s = H(n.store, r);
|
|
665
664
|
if (!s)
|
|
666
665
|
return null;
|
|
667
|
-
const i =
|
|
668
|
-
return /* @__PURE__ */
|
|
666
|
+
const i = Ye(s.props), a = Ke("absolute", he(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
667
|
+
return /* @__PURE__ */ E.jsx("div", { ...i, "data-ikon-node-id": s.id, className: a, children: c });
|
|
669
668
|
});
|
|
670
669
|
return ({ type: e }) => {
|
|
671
670
|
if (e === "std.layer")
|
|
672
671
|
return t;
|
|
673
672
|
};
|
|
674
673
|
}
|
|
675
|
-
function
|
|
674
|
+
function dr() {
|
|
676
675
|
return [
|
|
677
|
-
ir(),
|
|
678
|
-
ar(),
|
|
679
676
|
cr(),
|
|
680
|
-
|
|
677
|
+
ur(),
|
|
678
|
+
lr(),
|
|
679
|
+
ar()
|
|
681
680
|
];
|
|
682
681
|
}
|
|
683
|
-
const
|
|
684
|
-
function
|
|
685
|
-
t.registerModule(
|
|
682
|
+
const fr = "base", hr = async () => dr();
|
|
683
|
+
function mr(t) {
|
|
684
|
+
t.registerModule(fr, hr);
|
|
686
685
|
}
|
|
687
|
-
function
|
|
686
|
+
function pr(t) {
|
|
688
687
|
if (typeof t == "string") {
|
|
689
688
|
const e = t.trim();
|
|
690
689
|
return e.length > 0 ? e : void 0;
|
|
@@ -694,19 +693,19 @@ function hr(t) {
|
|
|
694
693
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
695
694
|
}
|
|
696
695
|
}
|
|
697
|
-
function
|
|
696
|
+
function gr(...t) {
|
|
698
697
|
const e = [];
|
|
699
698
|
for (const r of t)
|
|
700
699
|
r && r.trim() && e.push(r.trim());
|
|
701
700
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
702
701
|
}
|
|
703
|
-
function
|
|
702
|
+
function tt(t) {
|
|
704
703
|
if (typeof t != "string")
|
|
705
704
|
return;
|
|
706
705
|
const e = t.trim();
|
|
707
706
|
return e.length > 0 ? e : void 0;
|
|
708
707
|
}
|
|
709
|
-
function
|
|
708
|
+
function ye(t) {
|
|
710
709
|
if (typeof t == "boolean")
|
|
711
710
|
return t;
|
|
712
711
|
if (typeof t == "string") {
|
|
@@ -715,9 +714,9 @@ function ge(t) {
|
|
|
715
714
|
if (e === "false") return !1;
|
|
716
715
|
}
|
|
717
716
|
}
|
|
718
|
-
const
|
|
719
|
-
function
|
|
720
|
-
const t =
|
|
717
|
+
const yr = "std.audio-url-player";
|
|
718
|
+
function br() {
|
|
719
|
+
const t = Y(function({
|
|
721
720
|
nodeId: r,
|
|
722
721
|
context: n,
|
|
723
722
|
className: o
|
|
@@ -725,27 +724,27 @@ function gr() {
|
|
|
725
724
|
const s = H(n.store, r);
|
|
726
725
|
if (!s)
|
|
727
726
|
return null;
|
|
728
|
-
const i =
|
|
729
|
-
return /* @__PURE__ */
|
|
727
|
+
const i = gr(pr(s.props?.className), o), a = tt(s.props?.src), c = tt(s.props?.preload), f = ye(s.props?.controls), l = ye(s.props?.autoplay), u = ye(s.props?.loop), h = ye(s.props?.muted);
|
|
728
|
+
return /* @__PURE__ */ E.jsx(
|
|
730
729
|
"audio",
|
|
731
730
|
{
|
|
732
731
|
src: a,
|
|
733
732
|
...c !== void 0 ? { preload: c } : {},
|
|
734
|
-
...
|
|
735
|
-
...
|
|
736
|
-
...
|
|
737
|
-
...
|
|
733
|
+
...f !== void 0 ? { controls: f } : {},
|
|
734
|
+
...l !== void 0 ? { autoPlay: l } : {},
|
|
735
|
+
...u !== void 0 ? { loop: u } : {},
|
|
736
|
+
...h !== void 0 ? { muted: h } : {},
|
|
738
737
|
"data-ikon-node-id": s.id,
|
|
739
738
|
className: i
|
|
740
739
|
}
|
|
741
740
|
);
|
|
742
741
|
});
|
|
743
742
|
return ({ type: e }) => {
|
|
744
|
-
if (e ===
|
|
743
|
+
if (e === yr)
|
|
745
744
|
return t;
|
|
746
745
|
};
|
|
747
746
|
}
|
|
748
|
-
function
|
|
747
|
+
function gt(t) {
|
|
749
748
|
if (typeof t == "string") {
|
|
750
749
|
const e = t.trim();
|
|
751
750
|
return e.length > 0 ? e : void 0;
|
|
@@ -755,13 +754,13 @@ function mt(t) {
|
|
|
755
754
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
756
755
|
}
|
|
757
756
|
}
|
|
758
|
-
function
|
|
757
|
+
function yt(...t) {
|
|
759
758
|
const e = [];
|
|
760
759
|
for (const r of t)
|
|
761
760
|
r && r.trim() && e.push(r.trim());
|
|
762
761
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
763
762
|
}
|
|
764
|
-
function
|
|
763
|
+
function Se(t) {
|
|
765
764
|
if (typeof t == "number" && Number.isFinite(t))
|
|
766
765
|
return Math.floor(t);
|
|
767
766
|
if (typeof t == "string" && t.trim().length > 0) {
|
|
@@ -770,29 +769,29 @@ function be(t) {
|
|
|
770
769
|
return Math.floor(e);
|
|
771
770
|
}
|
|
772
771
|
}
|
|
773
|
-
function
|
|
772
|
+
function xe(t) {
|
|
774
773
|
if (typeof t != "string")
|
|
775
774
|
return;
|
|
776
775
|
const e = t.trim();
|
|
777
776
|
return e.length > 0 ? e : void 0;
|
|
778
777
|
}
|
|
779
|
-
const
|
|
780
|
-
function
|
|
781
|
-
const t =
|
|
782
|
-
const s = H(n.store, r), i =
|
|
783
|
-
return
|
|
784
|
-
const
|
|
785
|
-
if (!(!c || !
|
|
786
|
-
return c.attachCanvas(
|
|
787
|
-
c.detachCanvas(
|
|
778
|
+
const Sr = "std.video-canvas", wr = "std.video-url-player";
|
|
779
|
+
function vr() {
|
|
780
|
+
const t = Y(function({ nodeId: r, context: n, className: o }) {
|
|
781
|
+
const s = H(n.store, r), i = w(null), a = w(null), c = n.video, f = n.client, l = s ? xe(s.props?.streamId) : void 0, u = s ? Se(s.props?.width) : void 0, h = s ? Se(s.props?.height) : void 0, y = s ? yt(gt(s.props?.className), o) : o, p = f?.isWebRtcEnabled && l ? f.getWebRtcVideoStreamByStreamId(l) : null;
|
|
782
|
+
return j(() => {
|
|
783
|
+
const b = i.current;
|
|
784
|
+
if (!(!c || !b || !l || p))
|
|
785
|
+
return c.attachCanvas(l, b), () => {
|
|
786
|
+
c.detachCanvas(l);
|
|
788
787
|
};
|
|
789
|
-
}, [c,
|
|
790
|
-
const
|
|
791
|
-
if (!(!
|
|
792
|
-
return
|
|
793
|
-
|
|
788
|
+
}, [c, l, p]), j(() => {
|
|
789
|
+
const b = a.current;
|
|
790
|
+
if (!(!b || !p))
|
|
791
|
+
return b.srcObject = p, () => {
|
|
792
|
+
b.srcObject = null;
|
|
794
793
|
};
|
|
795
|
-
}, [
|
|
794
|
+
}, [p]), s ? p ? /* @__PURE__ */ E.jsx(
|
|
796
795
|
"video",
|
|
797
796
|
{
|
|
798
797
|
ref: a,
|
|
@@ -800,34 +799,34 @@ function Sr() {
|
|
|
800
799
|
playsInline: !0,
|
|
801
800
|
muted: !0,
|
|
802
801
|
"data-ikon-node-id": s.id,
|
|
803
|
-
"data-ikon-video-stream-id":
|
|
804
|
-
className:
|
|
805
|
-
...
|
|
806
|
-
...
|
|
802
|
+
"data-ikon-video-stream-id": l,
|
|
803
|
+
className: y,
|
|
804
|
+
...u ? { width: u } : {},
|
|
805
|
+
...h ? { height: h } : {}
|
|
807
806
|
},
|
|
808
|
-
|
|
809
|
-
) : /* @__PURE__ */
|
|
807
|
+
l
|
|
808
|
+
) : /* @__PURE__ */ E.jsx(
|
|
810
809
|
"canvas",
|
|
811
810
|
{
|
|
812
811
|
ref: i,
|
|
813
812
|
"data-ikon-node-id": s.id,
|
|
814
|
-
"data-ikon-video-stream-id":
|
|
815
|
-
className:
|
|
816
|
-
...
|
|
817
|
-
...
|
|
813
|
+
"data-ikon-video-stream-id": l,
|
|
814
|
+
className: y,
|
|
815
|
+
...u ? { width: u } : {},
|
|
816
|
+
...h ? { height: h } : {}
|
|
818
817
|
},
|
|
819
|
-
|
|
818
|
+
l
|
|
820
819
|
) : null;
|
|
821
820
|
});
|
|
822
821
|
return ({ type: e }) => {
|
|
823
|
-
if (e ===
|
|
822
|
+
if (e === Sr)
|
|
824
823
|
return t;
|
|
825
824
|
};
|
|
826
825
|
}
|
|
827
|
-
function
|
|
828
|
-
return [
|
|
826
|
+
function Rr() {
|
|
827
|
+
return [vr(), Er(), br()];
|
|
829
828
|
}
|
|
830
|
-
function
|
|
829
|
+
function ue(t) {
|
|
831
830
|
if (typeof t == "boolean")
|
|
832
831
|
return t;
|
|
833
832
|
if (typeof t == "string") {
|
|
@@ -836,8 +835,8 @@ function ce(t) {
|
|
|
836
835
|
if (e === "false") return !1;
|
|
837
836
|
}
|
|
838
837
|
}
|
|
839
|
-
function
|
|
840
|
-
const t =
|
|
838
|
+
function Er() {
|
|
839
|
+
const t = Y(function({
|
|
841
840
|
nodeId: r,
|
|
842
841
|
context: n,
|
|
843
842
|
className: o
|
|
@@ -845,19 +844,19 @@ function vr() {
|
|
|
845
844
|
const s = H(n.store, r);
|
|
846
845
|
if (!s)
|
|
847
846
|
return null;
|
|
848
|
-
const i =
|
|
849
|
-
return /* @__PURE__ */
|
|
847
|
+
const i = yt(gt(s.props?.className), o), a = xe(s.props?.src), c = xe(s.props?.poster), f = ue(s.props?.controls), l = ue(s.props?.autoplay), u = ue(s.props?.loop), h = ue(s.props?.muted), y = ue(s.props?.playsInline), p = Se(s.props?.width), b = Se(s.props?.height), m = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
848
|
+
return /* @__PURE__ */ E.jsx(
|
|
850
849
|
"video",
|
|
851
850
|
{
|
|
852
851
|
src: a,
|
|
853
852
|
poster: c,
|
|
854
|
-
...
|
|
855
|
-
...
|
|
856
|
-
...
|
|
857
|
-
...
|
|
858
|
-
...
|
|
859
|
-
...
|
|
860
|
-
...
|
|
853
|
+
...f !== void 0 ? { controls: f } : {},
|
|
854
|
+
...l !== void 0 ? { autoPlay: l } : {},
|
|
855
|
+
...u !== void 0 ? { loop: u } : {},
|
|
856
|
+
...h !== void 0 ? { muted: h } : {},
|
|
857
|
+
...y !== void 0 ? { playsInline: y } : {},
|
|
858
|
+
...p ? { width: p } : {},
|
|
859
|
+
...b ? { height: b } : {},
|
|
861
860
|
"data-ikon-node-id": s.id,
|
|
862
861
|
className: i,
|
|
863
862
|
children: m
|
|
@@ -865,27 +864,27 @@ function vr() {
|
|
|
865
864
|
);
|
|
866
865
|
});
|
|
867
866
|
return ({ type: e }) => {
|
|
868
|
-
if (e ===
|
|
867
|
+
if (e === wr)
|
|
869
868
|
return t;
|
|
870
869
|
};
|
|
871
870
|
}
|
|
872
|
-
const
|
|
873
|
-
function
|
|
874
|
-
t.registerModule(
|
|
871
|
+
const Ar = "media", kr = async () => Rr();
|
|
872
|
+
function Tr(t) {
|
|
873
|
+
t.registerModule(Ar, kr);
|
|
875
874
|
}
|
|
876
|
-
const
|
|
875
|
+
const Cr = `#version 300 es
|
|
877
876
|
in vec4 a_position;
|
|
878
877
|
void main() {
|
|
879
878
|
gl_Position = a_position;
|
|
880
879
|
}
|
|
881
880
|
`;
|
|
882
|
-
function
|
|
881
|
+
function Ir(t, e) {
|
|
883
882
|
return new RegExp(`\\buniform\\s+\\w+\\s+${e}\\s*;`, "g").test(t);
|
|
884
883
|
}
|
|
885
|
-
function
|
|
884
|
+
function Or(t, e) {
|
|
886
885
|
const r = [];
|
|
887
886
|
for (const [n, o] of Object.entries(e)) {
|
|
888
|
-
if (
|
|
887
|
+
if (Ir(t, n))
|
|
889
888
|
continue;
|
|
890
889
|
let s;
|
|
891
890
|
switch (o.type) {
|
|
@@ -938,7 +937,7 @@ void main() {
|
|
|
938
937
|
}
|
|
939
938
|
`;
|
|
940
939
|
}
|
|
941
|
-
class
|
|
940
|
+
class _r {
|
|
942
941
|
gl;
|
|
943
942
|
program = null;
|
|
944
943
|
positionBuffer = null;
|
|
@@ -974,10 +973,10 @@ class Ir {
|
|
|
974
973
|
}
|
|
975
974
|
compile(e, r = {}) {
|
|
976
975
|
this.lastError = null, this.customUniforms = r, this.currentShaderSource = e;
|
|
977
|
-
const n = this.gl, o = this.compileShader(n.VERTEX_SHADER,
|
|
976
|
+
const n = this.gl, o = this.compileShader(n.VERTEX_SHADER, Cr);
|
|
978
977
|
if (!o)
|
|
979
978
|
return !1;
|
|
980
|
-
const s =
|
|
979
|
+
const s = Or(e, r), i = this.compileShader(n.FRAGMENT_SHADER, s);
|
|
981
980
|
if (!i)
|
|
982
981
|
return n.deleteShader(o), !1;
|
|
983
982
|
const a = n.createProgram();
|
|
@@ -1015,46 +1014,46 @@ class Ir {
|
|
|
1015
1014
|
this.lastFrameTime = s, this.frameCount++, e.clearColor(0, 0, 0, 1), e.clear(e.COLOR_BUFFER_BIT), e.useProgram(this.program), e.bindVertexArray(this.vao);
|
|
1016
1015
|
const c = this.uniformLocations.get("iResolution");
|
|
1017
1016
|
c && e.uniform3f(c, n, o, 1);
|
|
1018
|
-
const
|
|
1019
|
-
|
|
1020
|
-
const
|
|
1021
|
-
|
|
1022
|
-
const
|
|
1023
|
-
|
|
1024
|
-
const
|
|
1025
|
-
|
|
1026
|
-
const
|
|
1027
|
-
if (
|
|
1028
|
-
const
|
|
1029
|
-
e.uniform4f(
|
|
1017
|
+
const f = this.uniformLocations.get("iTime");
|
|
1018
|
+
f && e.uniform1f(f, i);
|
|
1019
|
+
const l = this.uniformLocations.get("iTimeDelta");
|
|
1020
|
+
l && e.uniform1f(l, a);
|
|
1021
|
+
const u = this.uniformLocations.get("iFrame");
|
|
1022
|
+
u && e.uniform1i(u, this.frameCount);
|
|
1023
|
+
const h = this.uniformLocations.get("iMouse");
|
|
1024
|
+
h && e.uniform4f(h, this.mouseX, this.mouseY, this.mouseClickX, this.mouseClickY);
|
|
1025
|
+
const y = this.uniformLocations.get("iDate");
|
|
1026
|
+
if (y) {
|
|
1027
|
+
const p = /* @__PURE__ */ new Date();
|
|
1028
|
+
e.uniform4f(y, p.getFullYear(), p.getMonth(), p.getDate(), p.getHours() * 3600 + p.getMinutes() * 60 + p.getSeconds() + p.getMilliseconds() / 1e3);
|
|
1030
1029
|
}
|
|
1031
|
-
for (const [
|
|
1032
|
-
const m = this.uniformLocations.get(
|
|
1030
|
+
for (const [p, b] of Object.entries(this.customUniforms)) {
|
|
1031
|
+
const m = this.uniformLocations.get(p);
|
|
1033
1032
|
if (m)
|
|
1034
|
-
switch (
|
|
1033
|
+
switch (b.type) {
|
|
1035
1034
|
case "float":
|
|
1036
|
-
e.uniform1f(m,
|
|
1035
|
+
e.uniform1f(m, b.value);
|
|
1037
1036
|
break;
|
|
1038
1037
|
case "vec2": {
|
|
1039
|
-
const g =
|
|
1038
|
+
const g = b.value;
|
|
1040
1039
|
e.uniform2f(m, g[0], g[1]);
|
|
1041
1040
|
break;
|
|
1042
1041
|
}
|
|
1043
1042
|
case "vec3": {
|
|
1044
|
-
const g =
|
|
1043
|
+
const g = b.value;
|
|
1045
1044
|
e.uniform3f(m, g[0], g[1], g[2]);
|
|
1046
1045
|
break;
|
|
1047
1046
|
}
|
|
1048
1047
|
case "vec4": {
|
|
1049
|
-
const g =
|
|
1048
|
+
const g = b.value;
|
|
1050
1049
|
e.uniform4f(m, g[0], g[1], g[2], g[3]);
|
|
1051
1050
|
break;
|
|
1052
1051
|
}
|
|
1053
1052
|
case "int":
|
|
1054
|
-
e.uniform1i(m,
|
|
1053
|
+
e.uniform1i(m, b.value);
|
|
1055
1054
|
break;
|
|
1056
1055
|
case "bool":
|
|
1057
|
-
e.uniform1i(m,
|
|
1056
|
+
e.uniform1i(m, b.value ? 1 : 0);
|
|
1058
1057
|
break;
|
|
1059
1058
|
}
|
|
1060
1059
|
}
|
|
@@ -1068,7 +1067,7 @@ class Ir {
|
|
|
1068
1067
|
this.program && (e.deleteProgram(this.program), this.program = null), this.positionBuffer && (e.deleteBuffer(this.positionBuffer), this.positionBuffer = null), this.vao && (e.deleteVertexArray(this.vao), this.vao = null), this.uniformLocations.clear();
|
|
1069
1068
|
}
|
|
1070
1069
|
}
|
|
1071
|
-
function
|
|
1070
|
+
function Nr(t) {
|
|
1072
1071
|
if (typeof t == "string") {
|
|
1073
1072
|
const e = t.trim();
|
|
1074
1073
|
return e.length > 0 ? e : void 0;
|
|
@@ -1078,13 +1077,13 @@ function Or(t) {
|
|
|
1078
1077
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
1079
1078
|
}
|
|
1080
1079
|
}
|
|
1081
|
-
function
|
|
1080
|
+
function Pr(...t) {
|
|
1082
1081
|
const e = [];
|
|
1083
1082
|
for (const r of t)
|
|
1084
1083
|
r && r.trim() && e.push(r.trim());
|
|
1085
1084
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
1086
1085
|
}
|
|
1087
|
-
function
|
|
1086
|
+
function Ce(t) {
|
|
1088
1087
|
if (typeof t == "number" && Number.isFinite(t))
|
|
1089
1088
|
return Math.floor(t);
|
|
1090
1089
|
if (typeof t == "string" && t.trim().length > 0) {
|
|
@@ -1093,10 +1092,10 @@ function ke(t) {
|
|
|
1093
1092
|
return Math.floor(e);
|
|
1094
1093
|
}
|
|
1095
1094
|
}
|
|
1096
|
-
function
|
|
1095
|
+
function Mr(t) {
|
|
1097
1096
|
return typeof t == "string" ? t : "";
|
|
1098
1097
|
}
|
|
1099
|
-
function
|
|
1098
|
+
function jr(t) {
|
|
1100
1099
|
if (typeof t == "boolean")
|
|
1101
1100
|
return t;
|
|
1102
1101
|
if (typeof t == "string") {
|
|
@@ -1105,7 +1104,7 @@ function Pr(t) {
|
|
|
1105
1104
|
if (e === "false") return !1;
|
|
1106
1105
|
}
|
|
1107
1106
|
}
|
|
1108
|
-
function
|
|
1107
|
+
function Ur(t) {
|
|
1109
1108
|
if (!t || typeof t != "object")
|
|
1110
1109
|
return {};
|
|
1111
1110
|
const e = {}, r = t;
|
|
@@ -1120,7 +1119,7 @@ function Mr(t) {
|
|
|
1120
1119
|
}
|
|
1121
1120
|
return e;
|
|
1122
1121
|
}
|
|
1123
|
-
function
|
|
1122
|
+
function Lr(t, e) {
|
|
1124
1123
|
const r = Object.keys(t), n = Object.keys(e);
|
|
1125
1124
|
if (r.length !== n.length)
|
|
1126
1125
|
return !1;
|
|
@@ -1141,21 +1140,21 @@ function jr(t, e) {
|
|
|
1141
1140
|
}
|
|
1142
1141
|
return !0;
|
|
1143
1142
|
}
|
|
1144
|
-
const
|
|
1145
|
-
function
|
|
1146
|
-
const t =
|
|
1147
|
-
const s = H(n.store, r), i =
|
|
1143
|
+
const xr = "std.shadertoy-canvas";
|
|
1144
|
+
function Dr() {
|
|
1145
|
+
const t = Y(function({ nodeId: r, context: n, className: o }) {
|
|
1146
|
+
const s = H(n.store, r), i = w(null), a = w(null), c = w(null), f = w(0), l = w(""), u = w({}), h = w({
|
|
1148
1147
|
x: 0,
|
|
1149
1148
|
y: 0,
|
|
1150
1149
|
clickX: 0,
|
|
1151
1150
|
clickY: 0,
|
|
1152
1151
|
isDown: !1
|
|
1153
|
-
}),
|
|
1154
|
-
|
|
1155
|
-
const
|
|
1156
|
-
if (
|
|
1152
|
+
}), y = s ? Mr(s.props?.shaderSource) : "", p = s ? Ce(s.props?.fps) ?? 60 : 60, b = s?.props?.uniforms, m = K(() => Ur(b), [b]), g = s ? jr(s.props?.enableMouse) ?? !0 : !0, v = s ? Ce(s.props?.width) : void 0, k = s ? Ce(s.props?.height) : void 0, I = s ? Pr(Nr(s.props?.className), o) : o;
|
|
1153
|
+
j(() => {
|
|
1154
|
+
const C = i.current;
|
|
1155
|
+
if (C) {
|
|
1157
1156
|
try {
|
|
1158
|
-
const _ = new
|
|
1157
|
+
const _ = new _r(C);
|
|
1159
1158
|
a.current = _;
|
|
1160
1159
|
} catch (_) {
|
|
1161
1160
|
console.error("[ShadertoyRenderer] Failed to create WebGL2 context:", _);
|
|
@@ -1164,76 +1163,76 @@ function Lr() {
|
|
|
1164
1163
|
a.current && (a.current.destroy(), a.current = null);
|
|
1165
1164
|
};
|
|
1166
1165
|
}
|
|
1167
|
-
}, []),
|
|
1168
|
-
const
|
|
1169
|
-
if (!(!
|
|
1170
|
-
if (
|
|
1171
|
-
|
|
1166
|
+
}, []), j(() => {
|
|
1167
|
+
const C = a.current;
|
|
1168
|
+
if (!(!C || !y) && l.current !== y)
|
|
1169
|
+
if (C.compile(y, m))
|
|
1170
|
+
l.current = y, u.current = m;
|
|
1172
1171
|
else {
|
|
1173
|
-
const
|
|
1174
|
-
console.error("[ShadertoyRenderer] Shader compilation failed:",
|
|
1172
|
+
const L = C.getError();
|
|
1173
|
+
console.error("[ShadertoyRenderer] Shader compilation failed:", L);
|
|
1175
1174
|
}
|
|
1176
|
-
}, [
|
|
1177
|
-
const
|
|
1178
|
-
!
|
|
1179
|
-
}, [m]),
|
|
1180
|
-
const
|
|
1181
|
-
if (!
|
|
1182
|
-
const _ = 1e3 /
|
|
1183
|
-
const
|
|
1184
|
-
|
|
1175
|
+
}, [y, m]), j(() => {
|
|
1176
|
+
const C = a.current;
|
|
1177
|
+
!C || !l.current || Lr(u.current, m) || (C.setCustomUniforms(m), u.current = m);
|
|
1178
|
+
}, [m]), j(() => {
|
|
1179
|
+
const C = a.current;
|
|
1180
|
+
if (!C || !l.current) return;
|
|
1181
|
+
const _ = 1e3 / p, L = (N) => {
|
|
1182
|
+
const B = N - f.current;
|
|
1183
|
+
B >= _ && (f.current = N - B % _, C.draw()), c.current = requestAnimationFrame(L);
|
|
1185
1184
|
};
|
|
1186
|
-
return c.current = requestAnimationFrame(
|
|
1185
|
+
return c.current = requestAnimationFrame(L), () => {
|
|
1187
1186
|
c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
|
|
1188
1187
|
};
|
|
1189
|
-
}, [
|
|
1190
|
-
const
|
|
1191
|
-
(
|
|
1188
|
+
}, [p]);
|
|
1189
|
+
const U = F(
|
|
1190
|
+
(C) => {
|
|
1192
1191
|
if (!g) return;
|
|
1193
|
-
const _ = i.current,
|
|
1194
|
-
if (!_ || !
|
|
1195
|
-
const
|
|
1196
|
-
|
|
1192
|
+
const _ = i.current, L = a.current;
|
|
1193
|
+
if (!_ || !L) return;
|
|
1194
|
+
const N = _.getBoundingClientRect(), B = C.clientX - N.left, W = N.height - (C.clientY - N.top);
|
|
1195
|
+
h.current.x = B, h.current.y = W, L.setMouse(B, W, h.current.clickX, h.current.clickY);
|
|
1197
1196
|
},
|
|
1198
1197
|
[g]
|
|
1199
|
-
), z =
|
|
1200
|
-
(
|
|
1198
|
+
), z = F(
|
|
1199
|
+
(C) => {
|
|
1201
1200
|
if (!g) return;
|
|
1202
|
-
const _ = i.current,
|
|
1203
|
-
if (!_ || !
|
|
1204
|
-
const
|
|
1205
|
-
|
|
1201
|
+
const _ = i.current, L = a.current;
|
|
1202
|
+
if (!_ || !L) return;
|
|
1203
|
+
const N = _.getBoundingClientRect(), B = C.clientX - N.left, W = N.height - (C.clientY - N.top);
|
|
1204
|
+
h.current.isDown = !0, h.current.clickX = B, h.current.clickY = W, L.setMouse(B, W, B, W);
|
|
1206
1205
|
},
|
|
1207
1206
|
[g]
|
|
1208
|
-
),
|
|
1209
|
-
g && (
|
|
1207
|
+
), J = F(() => {
|
|
1208
|
+
g && (h.current.isDown = !1, h.current.clickX = -Math.abs(h.current.clickX));
|
|
1210
1209
|
}, [g]);
|
|
1211
|
-
return s ? /* @__PURE__ */
|
|
1210
|
+
return s ? /* @__PURE__ */ E.jsx(
|
|
1212
1211
|
"canvas",
|
|
1213
1212
|
{
|
|
1214
1213
|
ref: i,
|
|
1215
1214
|
"data-ikon-node-id": s.id,
|
|
1216
|
-
className:
|
|
1217
|
-
...
|
|
1215
|
+
className: I,
|
|
1216
|
+
...v ? { width: v } : {},
|
|
1218
1217
|
...k ? { height: k } : {},
|
|
1219
|
-
onMouseMove:
|
|
1218
|
+
onMouseMove: U,
|
|
1220
1219
|
onMouseDown: z,
|
|
1221
|
-
onMouseUp:
|
|
1222
|
-
onMouseLeave:
|
|
1220
|
+
onMouseUp: J,
|
|
1221
|
+
onMouseLeave: J
|
|
1223
1222
|
}
|
|
1224
1223
|
) : null;
|
|
1225
1224
|
});
|
|
1226
1225
|
return ({ type: e }) => {
|
|
1227
|
-
if (e ===
|
|
1226
|
+
if (e === xr)
|
|
1228
1227
|
return t;
|
|
1229
1228
|
};
|
|
1230
1229
|
}
|
|
1231
|
-
const
|
|
1232
|
-
function
|
|
1233
|
-
t.registerModule(
|
|
1230
|
+
const Fr = "shadertoy", Br = async () => Dr();
|
|
1231
|
+
function $r(t) {
|
|
1232
|
+
t.registerModule(Fr, Br);
|
|
1234
1233
|
}
|
|
1235
|
-
const
|
|
1236
|
-
class
|
|
1234
|
+
const rt = Ee("UIRegistry");
|
|
1235
|
+
class Vr {
|
|
1237
1236
|
baseResolvers = [];
|
|
1238
1237
|
moduleLoaders = /* @__PURE__ */ new Map();
|
|
1239
1238
|
moduleResolvers = /* @__PURE__ */ new Map();
|
|
@@ -1255,15 +1254,15 @@ class Br {
|
|
|
1255
1254
|
for (const [n, o] of this.moduleLoaders.entries())
|
|
1256
1255
|
if (!this.moduleResolvers.has(n))
|
|
1257
1256
|
try {
|
|
1258
|
-
const s = await o(), i =
|
|
1257
|
+
const s = await o(), i = zr(s);
|
|
1259
1258
|
this.moduleResolvers.set(n, i), e = !0;
|
|
1260
1259
|
} catch (s) {
|
|
1261
|
-
|
|
1260
|
+
rt.error(`[IkonUiRegistry] Failed to load module '${n}'.`, s);
|
|
1262
1261
|
}
|
|
1263
1262
|
const r = [];
|
|
1264
1263
|
for (const n of this.moduleLoaders.keys())
|
|
1265
1264
|
this.moduleResolvers.has(n) && r.push(n);
|
|
1266
|
-
return
|
|
1265
|
+
return Wr(r, this.activeModuleOrder) || (this.activeModuleOrder = r, e = !0), e;
|
|
1267
1266
|
}
|
|
1268
1267
|
resolve(e) {
|
|
1269
1268
|
for (const r of this.baseResolvers) {
|
|
@@ -1273,7 +1272,7 @@ class Br {
|
|
|
1273
1272
|
for (const r of this.activeModuleOrder) {
|
|
1274
1273
|
const n = this.moduleResolvers.get(r);
|
|
1275
1274
|
if (!n) {
|
|
1276
|
-
|
|
1275
|
+
rt.warn(`Missing resolvers for module ${r}`);
|
|
1277
1276
|
continue;
|
|
1278
1277
|
}
|
|
1279
1278
|
for (const o of n) {
|
|
@@ -1283,17 +1282,17 @@ class Br {
|
|
|
1283
1282
|
}
|
|
1284
1283
|
}
|
|
1285
1284
|
}
|
|
1286
|
-
function
|
|
1287
|
-
const t = new
|
|
1288
|
-
return
|
|
1285
|
+
function Kr() {
|
|
1286
|
+
const t = new Vr();
|
|
1287
|
+
return mr(t), Tr(t), $r(t), t.loadRegisteredModules(), t;
|
|
1289
1288
|
}
|
|
1290
|
-
function
|
|
1289
|
+
function Yr(t) {
|
|
1291
1290
|
return Array.isArray(t) ? t : [t];
|
|
1292
1291
|
}
|
|
1293
|
-
function
|
|
1294
|
-
return t ?
|
|
1292
|
+
function zr(t) {
|
|
1293
|
+
return t ? Yr(t).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
|
|
1295
1294
|
}
|
|
1296
|
-
function
|
|
1295
|
+
function Wr(t, e) {
|
|
1297
1296
|
if (t.length !== e.length)
|
|
1298
1297
|
return !1;
|
|
1299
1298
|
for (let r = 0; r < t.length; r += 1)
|
|
@@ -1301,7 +1300,7 @@ function Yr(t, e) {
|
|
|
1301
1300
|
return !1;
|
|
1302
1301
|
return !0;
|
|
1303
1302
|
}
|
|
1304
|
-
const
|
|
1303
|
+
const Ie = Ee("MotionController"), nt = {
|
|
1305
1304
|
ease: [0.25, 0.1, 0.25, 1],
|
|
1306
1305
|
"ease-in": [0.42, 0, 1, 1],
|
|
1307
1306
|
"ease-out": [0, 0, 0.58, 1],
|
|
@@ -1334,85 +1333,85 @@ const Te = Re("MotionController"), tt = {
|
|
|
1334
1333
|
function $(t) {
|
|
1335
1334
|
return t <= 0 ? 0 : t >= 1 ? 1 : t;
|
|
1336
1335
|
}
|
|
1337
|
-
function
|
|
1336
|
+
function ot(t) {
|
|
1338
1337
|
if (t == null) return;
|
|
1339
1338
|
const e = `${t}`.trim();
|
|
1340
1339
|
if (!e) return;
|
|
1341
1340
|
const r = Number.parseFloat(e);
|
|
1342
1341
|
return Number.isFinite(r) ? r : void 0;
|
|
1343
1342
|
}
|
|
1344
|
-
function
|
|
1343
|
+
function st(t) {
|
|
1345
1344
|
return typeof CSS < "u" && CSS.escape ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
1346
1345
|
}
|
|
1347
|
-
function
|
|
1348
|
-
const
|
|
1349
|
-
function
|
|
1350
|
-
return ((3 * g - 3 *
|
|
1346
|
+
function it(t, e, r, n) {
|
|
1347
|
+
const l = new Float32Array(11);
|
|
1348
|
+
function u(m, g, v) {
|
|
1349
|
+
return ((3 * g - 3 * v + 1) * m + (3 * v - 6 * g)) * m * m + 3 * g * m;
|
|
1351
1350
|
}
|
|
1352
|
-
function
|
|
1353
|
-
return 3 * (3 * g - 3 *
|
|
1351
|
+
function h(m, g, v) {
|
|
1352
|
+
return 3 * (3 * g - 3 * v + 1) * m * m + 2 * (3 * v - 6 * g) * m + 3 * g;
|
|
1354
1353
|
}
|
|
1355
|
-
function
|
|
1356
|
-
for (let
|
|
1357
|
-
const k =
|
|
1354
|
+
function y(m, g) {
|
|
1355
|
+
for (let v = 0; v < 4; v += 1) {
|
|
1356
|
+
const k = h(g, t, r);
|
|
1358
1357
|
if (k === 0)
|
|
1359
1358
|
return g;
|
|
1360
|
-
const
|
|
1361
|
-
g -=
|
|
1359
|
+
const I = u(g, t, r) - m;
|
|
1360
|
+
g -= I / k;
|
|
1362
1361
|
}
|
|
1363
1362
|
return g;
|
|
1364
1363
|
}
|
|
1365
|
-
function
|
|
1366
|
-
let k = 0,
|
|
1364
|
+
function p(m, g, v) {
|
|
1365
|
+
let k = 0, I = 0, U = 0;
|
|
1367
1366
|
do
|
|
1368
|
-
|
|
1369
|
-
while (Math.abs(k) > 1e-7 && ++
|
|
1370
|
-
return
|
|
1367
|
+
I = g + (v - g) / 2, k = u(I, t, r) - m, k > 0 ? v = I : g = I;
|
|
1368
|
+
while (Math.abs(k) > 1e-7 && ++U < 10);
|
|
1369
|
+
return I;
|
|
1371
1370
|
}
|
|
1372
|
-
function
|
|
1373
|
-
let g = 0,
|
|
1371
|
+
function b(m) {
|
|
1372
|
+
let g = 0, v = 1;
|
|
1374
1373
|
const k = 10;
|
|
1375
|
-
for (;
|
|
1374
|
+
for (; v !== k && l[v] <= m; v += 1)
|
|
1376
1375
|
g += 0.1;
|
|
1377
|
-
|
|
1378
|
-
const
|
|
1379
|
-
return z >= 1e-3 ?
|
|
1376
|
+
v -= 1;
|
|
1377
|
+
const I = (m - l[v]) / (l[v + 1] - l[v]), U = g + I * 0.1, z = h(U, t, r);
|
|
1378
|
+
return z >= 1e-3 ? y(m, U) : z === 0 ? U : p(m, g, g + 0.1);
|
|
1380
1379
|
}
|
|
1381
1380
|
for (let m = 0; m < 11; m += 1)
|
|
1382
|
-
|
|
1383
|
-
return (m) => m <= 0 ? 0 : m >= 1 ? 1 :
|
|
1381
|
+
l[m] = u(m * 0.1, t, r);
|
|
1382
|
+
return (m) => m <= 0 ? 0 : m >= 1 ? 1 : u(b(m), e, n);
|
|
1384
1383
|
}
|
|
1385
|
-
function
|
|
1384
|
+
function qr(t) {
|
|
1386
1385
|
const e = /steps\(\s*([0-9]+)\s*(?:,\s*([a-z-]+)\s*)?\)/i.exec(t);
|
|
1387
1386
|
if (!e)
|
|
1388
1387
|
return (o) => $(o);
|
|
1389
1388
|
const r = Math.max(1, parseInt(e[1], 10)), n = (e[2] ?? "end").toLowerCase();
|
|
1390
1389
|
return n === "start" || n === "jump-start" ? (o) => $(Math.ceil(o * r) / r) : n === "none" || n === "jump-none" ? (o) => $(Math.round(o * r) / r) : n === "both" || n === "jump-both" ? (o) => $((Math.floor(o * r) + 0.5) / r) : (o) => $(Math.floor(o * r) / r);
|
|
1391
1390
|
}
|
|
1392
|
-
function
|
|
1391
|
+
function Gr(t) {
|
|
1393
1392
|
if (!t)
|
|
1394
1393
|
return (r) => $(r);
|
|
1395
1394
|
const e = t.trim().toLowerCase();
|
|
1396
1395
|
if (!e || e === "linear")
|
|
1397
1396
|
return (r) => $(r);
|
|
1398
|
-
if (
|
|
1399
|
-
const [r, n, o, s] =
|
|
1397
|
+
if (nt[e]) {
|
|
1398
|
+
const [r, n, o, s] = nt[e], i = it(r, n, o, s);
|
|
1400
1399
|
return (a) => $(i($(a)));
|
|
1401
1400
|
}
|
|
1402
1401
|
if (e.startsWith("cubic-bezier(") && e.endsWith(")")) {
|
|
1403
1402
|
const n = e.slice(13, -1).split(",").map((o) => Number.parseFloat(o.trim()));
|
|
1404
1403
|
if (n.length === 4 && n.every((o) => Number.isFinite(o))) {
|
|
1405
|
-
const [o, s, i, a] = n, c =
|
|
1406
|
-
return (
|
|
1404
|
+
const [o, s, i, a] = n, c = it(o, s, i, a);
|
|
1405
|
+
return (f) => $(c($(f)));
|
|
1407
1406
|
}
|
|
1408
1407
|
}
|
|
1409
1408
|
if (e.startsWith("steps(") && e.endsWith(")")) {
|
|
1410
|
-
const r =
|
|
1409
|
+
const r = qr(e);
|
|
1411
1410
|
return (n) => r($(n));
|
|
1412
1411
|
}
|
|
1413
1412
|
return (r) => $(r);
|
|
1414
1413
|
}
|
|
1415
|
-
function
|
|
1414
|
+
function Hr(t) {
|
|
1416
1415
|
if (!t)
|
|
1417
1416
|
return;
|
|
1418
1417
|
const e = /(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)\s*->\s*(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)/.exec(t);
|
|
@@ -1422,7 +1421,7 @@ function qr(t) {
|
|
|
1422
1421
|
if (![r, n, o, s].some((i) => !Number.isFinite(i)))
|
|
1423
1422
|
return { inStart: r, inEnd: n, outStart: o, outEnd: s };
|
|
1424
1423
|
}
|
|
1425
|
-
class
|
|
1424
|
+
class Jr {
|
|
1426
1425
|
bindingsByStyle = /* @__PURE__ */ new Map();
|
|
1427
1426
|
observer;
|
|
1428
1427
|
observeScheduled = !1;
|
|
@@ -1449,7 +1448,7 @@ class Gr {
|
|
|
1449
1448
|
try {
|
|
1450
1449
|
e();
|
|
1451
1450
|
} catch (r) {
|
|
1452
|
-
|
|
1451
|
+
Ie.warn("Failed to cleanup binding listener", r);
|
|
1453
1452
|
}
|
|
1454
1453
|
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);
|
|
1455
1454
|
}
|
|
@@ -1459,7 +1458,7 @@ class Gr {
|
|
|
1459
1458
|
const n = (JSON.parse(e).motionBindings ?? []).map((o) => this.parseBinding(o)).filter((o) => o !== void 0);
|
|
1460
1459
|
return n.length === 0 ? void 0 : { bindings: n };
|
|
1461
1460
|
} catch (r) {
|
|
1462
|
-
|
|
1461
|
+
Ie.warn("Failed to parse motion metadata", r);
|
|
1463
1462
|
return;
|
|
1464
1463
|
}
|
|
1465
1464
|
}
|
|
@@ -1467,7 +1466,7 @@ class Gr {
|
|
|
1467
1466
|
const r = e.source?.trim();
|
|
1468
1467
|
if (!r)
|
|
1469
1468
|
return;
|
|
1470
|
-
const n =
|
|
1469
|
+
const n = ot(e.min) ?? 0, o = ot(e.max), s = o === void 0 ? n + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, c = Gr(e.ease), f = Hr(e.map), l = e.targetId?.trim() || void 0;
|
|
1471
1470
|
return Number.isNaN(n) || Number.isNaN(s) ? void 0 : {
|
|
1472
1471
|
source: r.toLowerCase(),
|
|
1473
1472
|
min: n,
|
|
@@ -1475,8 +1474,8 @@ class Gr {
|
|
|
1475
1474
|
clamp: i === "freeze-start" || i === "freeze-end" || i === "unclamped" ? i : "clamp",
|
|
1476
1475
|
reverse: a,
|
|
1477
1476
|
ease: c,
|
|
1478
|
-
map:
|
|
1479
|
-
targetId:
|
|
1477
|
+
map: f,
|
|
1478
|
+
targetId: l
|
|
1480
1479
|
};
|
|
1481
1480
|
}
|
|
1482
1481
|
ensureObserver() {
|
|
@@ -1525,7 +1524,7 @@ class Gr {
|
|
|
1525
1524
|
const r = this.bindingsByStyle.get(e);
|
|
1526
1525
|
if (!r || typeof document > "u")
|
|
1527
1526
|
return;
|
|
1528
|
-
const n = `.${
|
|
1527
|
+
const n = `.${st(e)}`;
|
|
1529
1528
|
document.querySelectorAll(n).forEach((s) => this.applyStyleToElement(s, e, r));
|
|
1530
1529
|
}
|
|
1531
1530
|
applyStyleToElement(e, r, n) {
|
|
@@ -1565,7 +1564,7 @@ class Gr {
|
|
|
1565
1564
|
}
|
|
1566
1565
|
resolveScrollContainer(e, r) {
|
|
1567
1566
|
if (r.targetId) {
|
|
1568
|
-
const n = `[data-ikon-motion-source="${
|
|
1567
|
+
const n = `[data-ikon-motion-source="${st(r.targetId)}"]`, o = typeof document < "u" ? document.querySelector(n) : null;
|
|
1569
1568
|
if (o)
|
|
1570
1569
|
return o;
|
|
1571
1570
|
}
|
|
@@ -1575,10 +1574,10 @@ class Gr {
|
|
|
1575
1574
|
const o = r.max - r.min, s = o === 0 ? n > r.min ? 1 : 0 : (n - r.min) / o;
|
|
1576
1575
|
let i = this.applyClamp(s, r.clamp);
|
|
1577
1576
|
r.reverse && (i = 1 - i);
|
|
1578
|
-
const a = r.ease(i), c = Number.isFinite(a) ? a : 0,
|
|
1579
|
-
if (e.style.setProperty("--tw-motion-bind-source-value", `${n}`), e.style.setProperty("--tw-motion-bind-progress-ratio", `${c}`), e.style.setProperty("--tw-motion-bind-progress", `${
|
|
1580
|
-
const
|
|
1581
|
-
|
|
1577
|
+
const a = r.ease(i), c = Number.isFinite(a) ? a : 0, f = c * 100;
|
|
1578
|
+
if (e.style.setProperty("--tw-motion-bind-source-value", `${n}`), e.style.setProperty("--tw-motion-bind-progress-ratio", `${c}`), e.style.setProperty("--tw-motion-bind-progress", `${f}`), r.map) {
|
|
1579
|
+
const l = this.applyMap(f, r.map);
|
|
1580
|
+
l !== void 0 && e.style.setProperty("--tw-motion-bind-value", `${l}`);
|
|
1582
1581
|
} else
|
|
1583
1582
|
e.style.removeProperty("--tw-motion-bind-value");
|
|
1584
1583
|
}
|
|
@@ -1635,7 +1634,7 @@ class Gr {
|
|
|
1635
1634
|
try {
|
|
1636
1635
|
i();
|
|
1637
1636
|
} catch (a) {
|
|
1638
|
-
|
|
1637
|
+
Ie.warn("Failed to cleanup listener", a);
|
|
1639
1638
|
}
|
|
1640
1639
|
this.globalCleanups.delete(i);
|
|
1641
1640
|
}
|
|
@@ -1680,31 +1679,31 @@ class Gr {
|
|
|
1680
1679
|
}
|
|
1681
1680
|
}
|
|
1682
1681
|
}
|
|
1683
|
-
const
|
|
1684
|
-
function
|
|
1685
|
-
const e =
|
|
1682
|
+
const Oe = new Jr();
|
|
1683
|
+
function Xr(t) {
|
|
1684
|
+
const e = w(/* @__PURE__ */ new Map()), r = F(({ styleId: s, css: i, common: a }) => {
|
|
1686
1685
|
if (!(!s || typeof document > "u")) {
|
|
1687
1686
|
if (i) {
|
|
1688
1687
|
let c = e.current.get(s);
|
|
1689
1688
|
c || (c = document.createElement("style"), c.setAttribute("data-ikon-style-id", s), document.head.appendChild(c), e.current.set(s, c)), c.textContent = i;
|
|
1690
1689
|
}
|
|
1691
|
-
|
|
1690
|
+
Oe.registerStyle(s, a);
|
|
1692
1691
|
}
|
|
1693
|
-
}, []), n =
|
|
1692
|
+
}, []), n = F((s) => {
|
|
1694
1693
|
if (!(typeof document > "u"))
|
|
1695
1694
|
for (const i of s) {
|
|
1696
1695
|
const a = e.current.get(i);
|
|
1697
|
-
a && (a.remove(), e.current.delete(i)),
|
|
1696
|
+
a && (a.remove(), e.current.delete(i)), Oe.unregisterStyle(i);
|
|
1698
1697
|
}
|
|
1699
|
-
}, []), o =
|
|
1698
|
+
}, []), o = F(() => {
|
|
1700
1699
|
if (typeof document < "u") {
|
|
1701
1700
|
for (const s of e.current.values())
|
|
1702
1701
|
s.remove();
|
|
1703
1702
|
e.current.clear();
|
|
1704
1703
|
}
|
|
1705
|
-
|
|
1704
|
+
Oe.reset();
|
|
1706
1705
|
}, []);
|
|
1707
|
-
return
|
|
1706
|
+
return j(() => {
|
|
1708
1707
|
if (!t) return;
|
|
1709
1708
|
for (const a of t.getUiStyles())
|
|
1710
1709
|
r(a);
|
|
@@ -1712,9 +1711,9 @@ function Hr(t) {
|
|
|
1712
1711
|
return () => {
|
|
1713
1712
|
s?.(), i?.(), o();
|
|
1714
1713
|
};
|
|
1715
|
-
}, [t, o, r, n]),
|
|
1714
|
+
}, [t, o, r, n]), j(() => () => o(), [o]), { setStyle: r, deleteStyles: n, reset: o };
|
|
1716
1715
|
}
|
|
1717
|
-
function
|
|
1716
|
+
function Zr(t) {
|
|
1718
1717
|
const e = [];
|
|
1719
1718
|
for (const [r, n] of t) {
|
|
1720
1719
|
const o = n.store.getSnapshot(), s = o.rootViewId && o.views.has(o.rootViewId);
|
|
@@ -1722,62 +1721,62 @@ function Jr(t) {
|
|
|
1722
1721
|
}
|
|
1723
1722
|
return e.sort(), e.join(",");
|
|
1724
1723
|
}
|
|
1725
|
-
function
|
|
1726
|
-
const [e, r] = G(), n =
|
|
1727
|
-
return
|
|
1724
|
+
function Qr(t) {
|
|
1725
|
+
const [e, r] = G(), n = w("");
|
|
1726
|
+
return j(() => {
|
|
1728
1727
|
if (!t) {
|
|
1729
1728
|
r(void 0), n.current = "";
|
|
1730
1729
|
return;
|
|
1731
1730
|
}
|
|
1732
1731
|
const o = () => {
|
|
1733
|
-
const s = t.getStores(), i =
|
|
1732
|
+
const s = t.getStores(), i = Zr(s);
|
|
1734
1733
|
i !== n.current && (n.current = i, r(s));
|
|
1735
1734
|
};
|
|
1736
1735
|
return o(), t.subscribe(o);
|
|
1737
1736
|
}, [t]), e;
|
|
1738
1737
|
}
|
|
1739
|
-
var
|
|
1740
|
-
function
|
|
1741
|
-
var e =
|
|
1738
|
+
var en = typeof global == "object" && global && global.Object === Object && global, tn = typeof self == "object" && self && self.Object === Object && self, rn = en || tn || Function("return this")(), we = rn.Symbol, bt = Object.prototype, nn = bt.hasOwnProperty, on = bt.toString, le = we ? we.toStringTag : void 0;
|
|
1739
|
+
function sn(t) {
|
|
1740
|
+
var e = nn.call(t, le), r = t[le];
|
|
1742
1741
|
try {
|
|
1743
|
-
t[
|
|
1742
|
+
t[le] = void 0;
|
|
1744
1743
|
var n = !0;
|
|
1745
1744
|
} catch {
|
|
1746
1745
|
}
|
|
1747
|
-
var o =
|
|
1748
|
-
return n && (e ? t[
|
|
1746
|
+
var o = on.call(t);
|
|
1747
|
+
return n && (e ? t[le] = r : delete t[le]), o;
|
|
1749
1748
|
}
|
|
1750
|
-
var
|
|
1751
|
-
function
|
|
1752
|
-
return
|
|
1749
|
+
var an = Object.prototype, cn = an.toString;
|
|
1750
|
+
function un(t) {
|
|
1751
|
+
return cn.call(t);
|
|
1753
1752
|
}
|
|
1754
|
-
var
|
|
1755
|
-
function
|
|
1756
|
-
return t == null ? t === void 0 ?
|
|
1753
|
+
var ln = "[object Null]", dn = "[object Undefined]", at = we ? we.toStringTag : void 0;
|
|
1754
|
+
function fn(t) {
|
|
1755
|
+
return t == null ? t === void 0 ? dn : ln : at && at in Object(t) ? sn(t) : un(t);
|
|
1757
1756
|
}
|
|
1758
|
-
function
|
|
1757
|
+
function hn(t) {
|
|
1759
1758
|
return t != null && typeof t == "object";
|
|
1760
1759
|
}
|
|
1761
|
-
var
|
|
1762
|
-
function
|
|
1763
|
-
return typeof t == "string" || !
|
|
1760
|
+
var mn = Array.isArray, pn = "[object String]";
|
|
1761
|
+
function gn(t) {
|
|
1762
|
+
return typeof t == "string" || !mn(t) && hn(t) && fn(t) == pn;
|
|
1764
1763
|
}
|
|
1765
|
-
const
|
|
1766
|
-
function
|
|
1764
|
+
const ct = "ikonUiModules";
|
|
1765
|
+
function De(t) {
|
|
1767
1766
|
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
1768
1767
|
}
|
|
1769
|
-
function
|
|
1768
|
+
function yn(t) {
|
|
1770
1769
|
if (!Array.isArray(t))
|
|
1771
1770
|
return;
|
|
1772
1771
|
const e = /* @__PURE__ */ new Set();
|
|
1773
1772
|
for (const r of t) {
|
|
1774
|
-
if (!
|
|
1773
|
+
if (!gn(r)) continue;
|
|
1775
1774
|
const n = r.trim();
|
|
1776
1775
|
n && (e.has(n) || e.add(n));
|
|
1777
1776
|
}
|
|
1778
1777
|
return Array.from(e);
|
|
1779
1778
|
}
|
|
1780
|
-
function
|
|
1779
|
+
function wo(t, e) {
|
|
1781
1780
|
if (t === e)
|
|
1782
1781
|
return !0;
|
|
1783
1782
|
if (!t || !e)
|
|
@@ -1789,19 +1788,19 @@ function bo(t, e) {
|
|
|
1789
1788
|
return !1;
|
|
1790
1789
|
return !0;
|
|
1791
1790
|
}
|
|
1792
|
-
function
|
|
1793
|
-
if (!(!
|
|
1794
|
-
return
|
|
1791
|
+
function bn(t) {
|
|
1792
|
+
if (!(!De(t) || !Object.prototype.hasOwnProperty.call(t, ct)))
|
|
1793
|
+
return yn(t[ct]);
|
|
1795
1794
|
}
|
|
1796
|
-
function
|
|
1795
|
+
function vo(...t) {
|
|
1797
1796
|
for (const e of t) {
|
|
1798
|
-
const r =
|
|
1797
|
+
const r = bn(e);
|
|
1799
1798
|
if (r !== void 0)
|
|
1800
1799
|
return r;
|
|
1801
1800
|
}
|
|
1802
1801
|
}
|
|
1803
|
-
function
|
|
1804
|
-
if (!
|
|
1802
|
+
function Ro(t) {
|
|
1803
|
+
if (!De(t))
|
|
1805
1804
|
return;
|
|
1806
1805
|
const e = t, r = Object.keys(e).find((c) => c.toLowerCase() === "modules");
|
|
1807
1806
|
if (!r)
|
|
@@ -1814,44 +1813,44 @@ function wo(t) {
|
|
|
1814
1813
|
const o = [], s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set();
|
|
1815
1814
|
for (const c of n) {
|
|
1816
1815
|
if (typeof c == "string") {
|
|
1817
|
-
const
|
|
1818
|
-
if (!
|
|
1816
|
+
const b = c.trim();
|
|
1817
|
+
if (!b || i.has(b))
|
|
1819
1818
|
continue;
|
|
1820
|
-
o.push(
|
|
1819
|
+
o.push(b), i.add(b);
|
|
1821
1820
|
continue;
|
|
1822
1821
|
}
|
|
1823
|
-
if (!
|
|
1822
|
+
if (!De(c))
|
|
1824
1823
|
continue;
|
|
1825
|
-
const
|
|
1826
|
-
if (!
|
|
1824
|
+
const f = c, l = Object.keys(f).find((b) => b.toLowerCase() === "name");
|
|
1825
|
+
if (!l)
|
|
1827
1826
|
continue;
|
|
1828
|
-
const
|
|
1829
|
-
if (typeof
|
|
1827
|
+
const u = f[l];
|
|
1828
|
+
if (typeof u != "string")
|
|
1830
1829
|
continue;
|
|
1831
|
-
const
|
|
1832
|
-
if (!
|
|
1830
|
+
const h = u.trim();
|
|
1831
|
+
if (!h)
|
|
1833
1832
|
continue;
|
|
1834
|
-
const
|
|
1835
|
-
typeof
|
|
1833
|
+
const y = Object.keys(f).find((b) => b.toLowerCase() === "javascript"), p = y ? f[y] : void 0;
|
|
1834
|
+
typeof p == "string" && s.set(h, p), i.has(h) || (o.push(h), i.add(h));
|
|
1836
1835
|
}
|
|
1837
1836
|
if (!o.length && s.size === 0)
|
|
1838
1837
|
return { modules: [] };
|
|
1839
|
-
const a = Array.from(s.entries()).map(([c,
|
|
1838
|
+
const a = Array.from(s.entries()).map(([c, f]) => ({
|
|
1840
1839
|
name: c,
|
|
1841
|
-
javascript:
|
|
1840
|
+
javascript: f
|
|
1842
1841
|
}));
|
|
1843
1842
|
return a.length > 0 ? { modules: o, inlineModules: a } : { modules: o };
|
|
1844
1843
|
}
|
|
1845
|
-
const
|
|
1844
|
+
const R = {
|
|
1846
1845
|
None: 0,
|
|
1847
1846
|
Letter: 1,
|
|
1848
1847
|
Word: 2,
|
|
1849
1848
|
Line: 4,
|
|
1850
1849
|
Paragraph: 8,
|
|
1851
1850
|
Emoji: 16
|
|
1852
|
-
},
|
|
1851
|
+
}, Sn = [
|
|
1853
1852
|
{
|
|
1854
|
-
flag:
|
|
1853
|
+
flag: R.Letter,
|
|
1855
1854
|
hints: [
|
|
1856
1855
|
"[data-motion-letter]",
|
|
1857
1856
|
"[data-letter]",
|
|
@@ -1860,7 +1859,7 @@ const E = {
|
|
|
1860
1859
|
]
|
|
1861
1860
|
},
|
|
1862
1861
|
{
|
|
1863
|
-
flag:
|
|
1862
|
+
flag: R.Word,
|
|
1864
1863
|
hints: [
|
|
1865
1864
|
"[data-motion-word]",
|
|
1866
1865
|
"[data-word]",
|
|
@@ -1869,7 +1868,7 @@ const E = {
|
|
|
1869
1868
|
]
|
|
1870
1869
|
},
|
|
1871
1870
|
{
|
|
1872
|
-
flag:
|
|
1871
|
+
flag: R.Line,
|
|
1873
1872
|
hints: [
|
|
1874
1873
|
"[data-motion-line]",
|
|
1875
1874
|
"[data-line]",
|
|
@@ -1878,7 +1877,7 @@ const E = {
|
|
|
1878
1877
|
]
|
|
1879
1878
|
},
|
|
1880
1879
|
{
|
|
1881
|
-
flag:
|
|
1880
|
+
flag: R.Paragraph,
|
|
1882
1881
|
hints: [
|
|
1883
1882
|
"[data-motion-paragraph]",
|
|
1884
1883
|
"[data-paragraph]",
|
|
@@ -1889,7 +1888,7 @@ const E = {
|
|
|
1889
1888
|
]
|
|
1890
1889
|
},
|
|
1891
1890
|
{
|
|
1892
|
-
flag:
|
|
1891
|
+
flag: R.Emoji,
|
|
1893
1892
|
hints: [
|
|
1894
1893
|
":is([data-motion-emoji],[data-emoji],.tw-motion-emoji,.tw-emoji)",
|
|
1895
1894
|
"[data-motion-emoji]",
|
|
@@ -1898,42 +1897,42 @@ const E = {
|
|
|
1898
1897
|
"[data-emoji]"
|
|
1899
1898
|
]
|
|
1900
1899
|
}
|
|
1901
|
-
],
|
|
1902
|
-
function
|
|
1903
|
-
if (!t || t.length >
|
|
1900
|
+
], Fe = R.Letter | R.Word | R.Line | R.Paragraph | R.Emoji, wn = R.Letter | R.Word | R.Line | R.Paragraph, ut = /* @__PURE__ */ new Map(), vn = 16384;
|
|
1901
|
+
function Eo(t, e) {
|
|
1902
|
+
if (!t || t.length > vn)
|
|
1904
1903
|
return t;
|
|
1905
|
-
const r =
|
|
1906
|
-
if (o ===
|
|
1904
|
+
const r = Dn(e), n = ne(r, R.Emoji), o = r & wn;
|
|
1905
|
+
if (o === R.None && !n)
|
|
1907
1906
|
return t;
|
|
1908
1907
|
const s = t.replace(/\r\n/g, `
|
|
1909
1908
|
`).replace(/\r/g, `
|
|
1910
1909
|
`);
|
|
1911
|
-
if (o ===
|
|
1912
|
-
return
|
|
1913
|
-
const i =
|
|
1910
|
+
if (o === R.None)
|
|
1911
|
+
return ht(s);
|
|
1912
|
+
const i = Ln(s);
|
|
1914
1913
|
if (i.length === 0)
|
|
1915
|
-
return n ?
|
|
1916
|
-
const a =
|
|
1917
|
-
for (const
|
|
1918
|
-
const
|
|
1919
|
-
|
|
1914
|
+
return n ? ht(s) : t;
|
|
1915
|
+
const a = xn(i), c = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, f = [];
|
|
1916
|
+
for (const l of a) {
|
|
1917
|
+
const u = Rn(l, r, c);
|
|
1918
|
+
f.push(...u);
|
|
1920
1919
|
}
|
|
1921
|
-
return
|
|
1920
|
+
return f;
|
|
1922
1921
|
}
|
|
1923
|
-
function
|
|
1922
|
+
function Rn(t, e, r) {
|
|
1924
1923
|
const n = [];
|
|
1925
1924
|
for (const o of t) {
|
|
1926
|
-
const s =
|
|
1925
|
+
const s = En(o, e, r);
|
|
1927
1926
|
n.push(...s);
|
|
1928
1927
|
}
|
|
1929
|
-
if (
|
|
1928
|
+
if (ne(e, R.Paragraph)) {
|
|
1930
1929
|
const o = r.paragraph++;
|
|
1931
1930
|
return [
|
|
1932
|
-
/* @__PURE__ */
|
|
1931
|
+
/* @__PURE__ */ E.jsx(
|
|
1933
1932
|
"span",
|
|
1934
1933
|
{
|
|
1935
1934
|
"data-motion-paragraph": !0,
|
|
1936
|
-
style:
|
|
1935
|
+
style: Ae(o),
|
|
1937
1936
|
children: n
|
|
1938
1937
|
},
|
|
1939
1938
|
`motion-paragraph-${o}`
|
|
@@ -1942,116 +1941,116 @@ function wn(t, e, r) {
|
|
|
1942
1941
|
}
|
|
1943
1942
|
return n;
|
|
1944
1943
|
}
|
|
1945
|
-
function
|
|
1946
|
-
const n =
|
|
1947
|
-
if (
|
|
1944
|
+
function En(t, e, r) {
|
|
1945
|
+
const n = An(t.text, e, r), o = [];
|
|
1946
|
+
if (ne(e, R.Line)) {
|
|
1948
1947
|
const s = r.line++;
|
|
1949
1948
|
o.push(
|
|
1950
|
-
/* @__PURE__ */
|
|
1949
|
+
/* @__PURE__ */ E.jsx("span", { "data-motion-line": !0, style: Ae(s), children: n }, `motion-line-${s}`)
|
|
1951
1950
|
);
|
|
1952
1951
|
} else
|
|
1953
1952
|
o.push(...n);
|
|
1954
1953
|
for (let s = 0; s < t.breaks; s++)
|
|
1955
|
-
o.push(/* @__PURE__ */
|
|
1954
|
+
o.push(/* @__PURE__ */ E.jsx("br", {}, `motion-break-${r.br++}`));
|
|
1956
1955
|
return o;
|
|
1957
1956
|
}
|
|
1958
|
-
function
|
|
1957
|
+
function An(t, e, r) {
|
|
1959
1958
|
if (!t)
|
|
1960
1959
|
return [];
|
|
1961
|
-
const n =
|
|
1960
|
+
const n = ne(e, R.Word), o = [], s = /(\s+)/g;
|
|
1962
1961
|
let i = 0, a;
|
|
1963
1962
|
for (; (a = s.exec(t)) !== null; ) {
|
|
1964
1963
|
if (a.index > i) {
|
|
1965
1964
|
const c = t.slice(i, a.index);
|
|
1966
|
-
o.push(
|
|
1965
|
+
o.push(lt(c, r, e, n));
|
|
1967
1966
|
}
|
|
1968
1967
|
o.push(a[0]), i = a.index + a[0].length;
|
|
1969
1968
|
}
|
|
1970
1969
|
if (i < t.length) {
|
|
1971
1970
|
const c = t.slice(i);
|
|
1972
|
-
o.push(
|
|
1971
|
+
o.push(lt(c, r, e, n));
|
|
1973
1972
|
}
|
|
1974
1973
|
return o;
|
|
1975
1974
|
}
|
|
1976
|
-
function
|
|
1977
|
-
const o = e.word++, s =
|
|
1978
|
-
return n ? /* @__PURE__ */
|
|
1975
|
+
function lt(t, e, r, n) {
|
|
1976
|
+
const o = e.word++, s = Tn(t, r, e), i = `motion-word-${o}`, a = kn(o, n);
|
|
1977
|
+
return n ? /* @__PURE__ */ E.jsx("span", { "data-motion-word": !0, style: a, children: s }, i) : /* @__PURE__ */ E.jsx("span", { style: a, children: s }, i);
|
|
1979
1978
|
}
|
|
1980
|
-
function
|
|
1981
|
-
return e ? { ...
|
|
1979
|
+
function kn(t, e) {
|
|
1980
|
+
return e ? { ...Ae(t), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
|
|
1982
1981
|
}
|
|
1983
|
-
function
|
|
1982
|
+
function Tn(t, e, r) {
|
|
1984
1983
|
if (!t)
|
|
1985
1984
|
return [];
|
|
1986
|
-
const n =
|
|
1985
|
+
const n = ne(e, R.Letter), o = ne(e, R.Emoji);
|
|
1987
1986
|
if (!n) {
|
|
1988
1987
|
if (!o)
|
|
1989
1988
|
return [t];
|
|
1990
|
-
const a =
|
|
1989
|
+
const a = Be(t);
|
|
1991
1990
|
if (a.length === 0)
|
|
1992
1991
|
return [t];
|
|
1993
|
-
const { nodes: c } =
|
|
1992
|
+
const { nodes: c } = wt(a, r);
|
|
1994
1993
|
return c;
|
|
1995
1994
|
}
|
|
1996
|
-
const s = [], i =
|
|
1995
|
+
const s = [], i = Be(t);
|
|
1997
1996
|
for (const a of i) {
|
|
1998
|
-
const c = r.letter++,
|
|
1997
|
+
const c = r.letter++, f = `motion-letter-${c}`, l = Ae(c);
|
|
1999
1998
|
if (a === `
|
|
2000
1999
|
`) {
|
|
2001
2000
|
s.push(
|
|
2002
|
-
/* @__PURE__ */
|
|
2001
|
+
/* @__PURE__ */ E.jsx("span", { "data-motion-letter": !0, style: l, children: /* @__PURE__ */ E.jsx("br", {}) }, f)
|
|
2003
2002
|
);
|
|
2004
2003
|
continue;
|
|
2005
2004
|
}
|
|
2006
|
-
const
|
|
2005
|
+
const h = o && St(a) ? { "data-motion-emoji": !0 } : void 0, y = a === " " ? " " : a;
|
|
2007
2006
|
s.push(
|
|
2008
|
-
/* @__PURE__ */
|
|
2007
|
+
/* @__PURE__ */ E.jsx("span", { "data-motion-letter": !0, style: l, ...h, children: y }, f)
|
|
2009
2008
|
);
|
|
2010
2009
|
}
|
|
2011
2010
|
return s;
|
|
2012
2011
|
}
|
|
2013
|
-
function
|
|
2012
|
+
function Be(t) {
|
|
2014
2013
|
if (!t)
|
|
2015
2014
|
return [];
|
|
2016
|
-
const e =
|
|
2017
|
-
return e ? Array.from(e.segment(t), (r) => r.segment) :
|
|
2015
|
+
const e = Cn();
|
|
2016
|
+
return e ? Array.from(e.segment(t), (r) => r.segment) : In(t);
|
|
2018
2017
|
}
|
|
2019
|
-
let
|
|
2020
|
-
function
|
|
2021
|
-
return
|
|
2018
|
+
let de;
|
|
2019
|
+
function Cn() {
|
|
2020
|
+
return de !== void 0 || (typeof Intl < "u" && typeof Intl.Segmenter == "function" ? de = new Intl.Segmenter(void 0, { granularity: "grapheme" }) : de = null), de;
|
|
2022
2021
|
}
|
|
2023
|
-
function
|
|
2022
|
+
function In(t) {
|
|
2024
2023
|
const e = [], r = Array.from(t);
|
|
2025
2024
|
let n = "";
|
|
2026
2025
|
for (let o = 0; o < r.length; o++) {
|
|
2027
2026
|
const s = r[o], i = r[o + 1];
|
|
2028
|
-
n += s, !(i &&
|
|
2027
|
+
n += s, !(i && On(s, i)) && (e.push(n), n = "");
|
|
2029
2028
|
}
|
|
2030
2029
|
return n && e.push(n), e;
|
|
2031
2030
|
}
|
|
2032
|
-
function
|
|
2033
|
-
return e ? !!(
|
|
2031
|
+
function On(t, e) {
|
|
2032
|
+
return e ? !!(dt(t) || dt(e) || Pn(e) || _n(e) || Nn(e) || ft(t) && ft(e)) : !1;
|
|
2034
2033
|
}
|
|
2035
|
-
function
|
|
2034
|
+
function dt(t) {
|
|
2036
2035
|
return t.codePointAt(0) === 8205;
|
|
2037
2036
|
}
|
|
2038
|
-
function
|
|
2037
|
+
function _n(t) {
|
|
2039
2038
|
const e = t.codePointAt(0);
|
|
2040
2039
|
return e === void 0 ? !1 : e >= 65024 && e <= 65039 || e >= 917760 && e <= 917999;
|
|
2041
2040
|
}
|
|
2042
|
-
function
|
|
2041
|
+
function Nn(t) {
|
|
2043
2042
|
const e = t.codePointAt(0);
|
|
2044
2043
|
return e === void 0 ? !1 : e >= 127995 && e <= 127999;
|
|
2045
2044
|
}
|
|
2046
|
-
function
|
|
2045
|
+
function ft(t) {
|
|
2047
2046
|
const e = t.codePointAt(0);
|
|
2048
2047
|
return e === void 0 ? !1 : e >= 127462 && e <= 127487;
|
|
2049
2048
|
}
|
|
2050
|
-
let
|
|
2051
|
-
function
|
|
2052
|
-
return t ? (
|
|
2049
|
+
let _e;
|
|
2050
|
+
function Pn(t) {
|
|
2051
|
+
return t ? (_e || (_e = Mn()), _e(t)) : !1;
|
|
2053
2052
|
}
|
|
2054
|
-
function
|
|
2053
|
+
function Mn() {
|
|
2055
2054
|
try {
|
|
2056
2055
|
const t = new RegExp("\\p{Mark}", "u");
|
|
2057
2056
|
return (e) => t.test(e);
|
|
@@ -2062,19 +2061,19 @@ function Nn() {
|
|
|
2062
2061
|
};
|
|
2063
2062
|
}
|
|
2064
2063
|
}
|
|
2065
|
-
let
|
|
2066
|
-
function
|
|
2067
|
-
return t ? (
|
|
2064
|
+
let Ne;
|
|
2065
|
+
function St(t) {
|
|
2066
|
+
return t ? (Ne || (Ne = jn()), Ne(t)) : !1;
|
|
2068
2067
|
}
|
|
2069
|
-
function
|
|
2068
|
+
function jn() {
|
|
2070
2069
|
try {
|
|
2071
2070
|
const t = new RegExp("\\p{Extended_Pictographic}", "u");
|
|
2072
2071
|
return (e) => t.test(e);
|
|
2073
2072
|
} catch {
|
|
2074
|
-
return
|
|
2073
|
+
return Un;
|
|
2075
2074
|
}
|
|
2076
2075
|
}
|
|
2077
|
-
function
|
|
2076
|
+
function Un(t) {
|
|
2078
2077
|
if (!t)
|
|
2079
2078
|
return !1;
|
|
2080
2079
|
for (const e of Array.from(t)) {
|
|
@@ -2084,7 +2083,7 @@ function Mn(t) {
|
|
|
2084
2083
|
}
|
|
2085
2084
|
return !1;
|
|
2086
2085
|
}
|
|
2087
|
-
function
|
|
2086
|
+
function Ln(t) {
|
|
2088
2087
|
const e = [];
|
|
2089
2088
|
let r = "", n = 0;
|
|
2090
2089
|
for (let o = 0; o < t.length; o++) {
|
|
@@ -2098,7 +2097,7 @@ function jn(t) {
|
|
|
2098
2097
|
}
|
|
2099
2098
|
return (n > 0 || r.length > 0) && e.push({ text: r, breaks: n }), e;
|
|
2100
2099
|
}
|
|
2101
|
-
function
|
|
2100
|
+
function xn(t) {
|
|
2102
2101
|
if (t.length === 0)
|
|
2103
2102
|
return [];
|
|
2104
2103
|
const e = [];
|
|
@@ -2107,10 +2106,10 @@ function Un(t) {
|
|
|
2107
2106
|
r.push(n), n.breaks >= 2 && (e.push(r), r = []);
|
|
2108
2107
|
return r.length > 0 && e.push(r), e;
|
|
2109
2108
|
}
|
|
2110
|
-
function
|
|
2109
|
+
function ne(t, e) {
|
|
2111
2110
|
return (t & e) === e;
|
|
2112
2111
|
}
|
|
2113
|
-
function
|
|
2112
|
+
function Ae(t) {
|
|
2114
2113
|
return {
|
|
2115
2114
|
"--tw-motion-seq-index": t.toString(),
|
|
2116
2115
|
backgroundColor: "inherit",
|
|
@@ -2127,27 +2126,27 @@ function Ee(t) {
|
|
|
2127
2126
|
WebkitTextFillColor: "inherit"
|
|
2128
2127
|
};
|
|
2129
2128
|
}
|
|
2130
|
-
function
|
|
2129
|
+
function ht(t) {
|
|
2131
2130
|
if (!t)
|
|
2132
2131
|
return t;
|
|
2133
|
-
const e =
|
|
2132
|
+
const e = Be(t);
|
|
2134
2133
|
if (e.length === 0)
|
|
2135
2134
|
return t;
|
|
2136
|
-
const { nodes: r, sawEmoji: n } =
|
|
2135
|
+
const { nodes: r, sawEmoji: n } = wt(e);
|
|
2137
2136
|
return n ? r.length === 1 ? r[0] ?? t : r : t;
|
|
2138
2137
|
}
|
|
2139
|
-
function
|
|
2138
|
+
function wt(t, e) {
|
|
2140
2139
|
const r = [];
|
|
2141
2140
|
let n = "", o = !1, s = e?.emoji ?? 0;
|
|
2142
2141
|
const i = () => {
|
|
2143
2142
|
n && (r.push(n), n = "");
|
|
2144
2143
|
};
|
|
2145
2144
|
for (const a of t) {
|
|
2146
|
-
if (
|
|
2145
|
+
if (St(a)) {
|
|
2147
2146
|
o = !0, i();
|
|
2148
|
-
const
|
|
2147
|
+
const f = `motion-emoji-${e ? e.emoji++ : s++}`;
|
|
2149
2148
|
r.push(
|
|
2150
|
-
/* @__PURE__ */
|
|
2149
|
+
/* @__PURE__ */ E.jsx("span", { "data-motion-emoji": !0, children: a }, f)
|
|
2151
2150
|
);
|
|
2152
2151
|
continue;
|
|
2153
2152
|
}
|
|
@@ -2155,56 +2154,56 @@ function bt(t, e) {
|
|
|
2155
2154
|
}
|
|
2156
2155
|
return i(), o ? { nodes: r, sawEmoji: !0 } : { nodes: [t.join("")], sawEmoji: !1 };
|
|
2157
2156
|
}
|
|
2158
|
-
function
|
|
2157
|
+
function Dn(t) {
|
|
2159
2158
|
if (!t)
|
|
2160
|
-
return
|
|
2159
|
+
return R.None;
|
|
2161
2160
|
const e = t.trim();
|
|
2162
2161
|
if (!e)
|
|
2163
|
-
return
|
|
2164
|
-
const r =
|
|
2162
|
+
return R.None;
|
|
2163
|
+
const r = ut.get(e);
|
|
2165
2164
|
if (typeof r == "number")
|
|
2166
2165
|
return r;
|
|
2167
2166
|
if (typeof document > "u")
|
|
2168
|
-
return
|
|
2167
|
+
return R.None;
|
|
2169
2168
|
const n = e.split(/\s+/).filter(Boolean);
|
|
2170
2169
|
if (n.length === 0)
|
|
2171
|
-
return
|
|
2172
|
-
const s = n.map((c) => `.${
|
|
2173
|
-
(c) => new RegExp(`(^|[^a-zA-Z0-9_-])${
|
|
2170
|
+
return R.None;
|
|
2171
|
+
const s = n.map((c) => `.${Fn(c)}`).map(
|
|
2172
|
+
(c) => new RegExp(`(^|[^a-zA-Z0-9_-])${Bn(c)}(?![a-zA-Z0-9_-])`)
|
|
2174
2173
|
);
|
|
2175
|
-
let i =
|
|
2174
|
+
let i = R.None, a = !1;
|
|
2176
2175
|
for (const c of Array.from(document.styleSheets)) {
|
|
2177
|
-
let
|
|
2176
|
+
let f;
|
|
2178
2177
|
try {
|
|
2179
|
-
|
|
2178
|
+
f = c.cssRules;
|
|
2180
2179
|
} catch {
|
|
2181
2180
|
continue;
|
|
2182
2181
|
}
|
|
2183
|
-
const
|
|
2184
|
-
if (
|
|
2182
|
+
const l = vt(f, s);
|
|
2183
|
+
if (l.mask && (i |= l.mask, i === Fe))
|
|
2185
2184
|
break;
|
|
2186
|
-
a ||=
|
|
2185
|
+
a ||= l.sawStyleRule;
|
|
2187
2186
|
}
|
|
2188
|
-
return (i !==
|
|
2187
|
+
return (i !== R.None || a) && ut.set(e, i), i;
|
|
2189
2188
|
}
|
|
2190
|
-
function
|
|
2189
|
+
function vt(t, e) {
|
|
2191
2190
|
if (!t)
|
|
2192
|
-
return { mask:
|
|
2193
|
-
let r =
|
|
2191
|
+
return { mask: R.None, sawStyleRule: !1 };
|
|
2192
|
+
let r = R.None, n = !1;
|
|
2194
2193
|
for (let o = 0; o < t.length; o++) {
|
|
2195
2194
|
const s = t[o];
|
|
2196
2195
|
if (s) {
|
|
2197
2196
|
if (s.type === CSSRule.STYLE_RULE) {
|
|
2198
2197
|
const a = s.selectorText ?? "";
|
|
2199
|
-
if (!a || !e.some((
|
|
2198
|
+
if (!a || !e.some((f) => f.test(a))) continue;
|
|
2200
2199
|
n = !0;
|
|
2201
|
-
for (const
|
|
2202
|
-
|
|
2203
|
-
if (r ===
|
|
2200
|
+
for (const f of Sn)
|
|
2201
|
+
f.hints.some((l) => a.includes(l)) && (r |= f.flag);
|
|
2202
|
+
if (r === Fe)
|
|
2204
2203
|
return { mask: r, sawStyleRule: !0 };
|
|
2205
2204
|
} else if ("cssRules" in s) {
|
|
2206
|
-
const i =
|
|
2207
|
-
if (i.mask && (r |= i.mask, r ===
|
|
2205
|
+
const i = vt(s.cssRules, e);
|
|
2206
|
+
if (i.mask && (r |= i.mask, r === Fe))
|
|
2208
2207
|
return { mask: r, sawStyleRule: !0 };
|
|
2209
2208
|
n ||= i.sawStyleRule;
|
|
2210
2209
|
}
|
|
@@ -2212,48 +2211,48 @@ function St(t, e) {
|
|
|
2212
2211
|
}
|
|
2213
2212
|
return { mask: r, sawStyleRule: n };
|
|
2214
2213
|
}
|
|
2215
|
-
function
|
|
2214
|
+
function Fn(t) {
|
|
2216
2215
|
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
2217
2216
|
}
|
|
2218
|
-
function
|
|
2217
|
+
function Bn(t) {
|
|
2219
2218
|
return t.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
|
|
2220
2219
|
}
|
|
2221
|
-
const
|
|
2222
|
-
function
|
|
2220
|
+
const ze = "ikon_auth_session", $n = 7 * 24 * 60 * 60 * 1e3, Vn = 60 * 1e3;
|
|
2221
|
+
function Kn(t) {
|
|
2223
2222
|
try {
|
|
2224
2223
|
const e = t.split(".");
|
|
2225
2224
|
if (e.length !== 3) return !0;
|
|
2226
2225
|
const r = JSON.parse(atob(e[1]));
|
|
2227
|
-
return typeof r.exp != "number" ? !1 : Date.now() >= r.exp * 1e3 -
|
|
2226
|
+
return typeof r.exp != "number" ? !1 : Date.now() >= r.exp * 1e3 - Vn;
|
|
2228
2227
|
} catch {
|
|
2229
2228
|
return !0;
|
|
2230
2229
|
}
|
|
2231
2230
|
}
|
|
2232
|
-
function
|
|
2231
|
+
function ke(t) {
|
|
2233
2232
|
try {
|
|
2234
|
-
localStorage.setItem(
|
|
2233
|
+
localStorage.setItem(ze, JSON.stringify(t));
|
|
2235
2234
|
} catch {
|
|
2236
2235
|
console.warn("Failed to save auth session to localStorage");
|
|
2237
2236
|
}
|
|
2238
2237
|
}
|
|
2239
|
-
function
|
|
2238
|
+
function Rt() {
|
|
2240
2239
|
try {
|
|
2241
|
-
const t = localStorage.getItem(
|
|
2240
|
+
const t = localStorage.getItem(ze);
|
|
2242
2241
|
if (!t) return null;
|
|
2243
2242
|
const e = JSON.parse(t);
|
|
2244
|
-
return Date.now() - e.authenticatedAt >
|
|
2243
|
+
return Date.now() - e.authenticatedAt > $n || Kn(e.token) ? (ve(), null) : e;
|
|
2245
2244
|
} catch {
|
|
2246
2245
|
return console.warn("Failed to load auth session from localStorage"), null;
|
|
2247
2246
|
}
|
|
2248
2247
|
}
|
|
2249
|
-
function
|
|
2248
|
+
function ve() {
|
|
2250
2249
|
try {
|
|
2251
|
-
localStorage.removeItem(
|
|
2250
|
+
localStorage.removeItem(ze);
|
|
2252
2251
|
} catch {
|
|
2253
2252
|
console.warn("Failed to clear auth session from localStorage");
|
|
2254
2253
|
}
|
|
2255
2254
|
}
|
|
2256
|
-
function
|
|
2255
|
+
function fe(t) {
|
|
2257
2256
|
return {
|
|
2258
2257
|
id: "",
|
|
2259
2258
|
provider: t.provider,
|
|
@@ -2261,8 +2260,8 @@ function de(t) {
|
|
|
2261
2260
|
authenticatedAt: t.authenticatedAt
|
|
2262
2261
|
};
|
|
2263
2262
|
}
|
|
2264
|
-
async function
|
|
2265
|
-
const r =
|
|
2263
|
+
async function Et(t, e) {
|
|
2264
|
+
const r = jt(), n = await fetch(`${e}/anonymous`, {
|
|
2266
2265
|
method: "POST",
|
|
2267
2266
|
headers: { "Content-Type": "application/json" },
|
|
2268
2267
|
body: JSON.stringify({ deviceId: r, space: t })
|
|
@@ -2276,9 +2275,9 @@ async function vt(t, e) {
|
|
|
2276
2275
|
provider: "anonymous",
|
|
2277
2276
|
authenticatedAt: Date.now()
|
|
2278
2277
|
};
|
|
2279
|
-
return
|
|
2278
|
+
return ke(s), s;
|
|
2280
2279
|
}
|
|
2281
|
-
async function
|
|
2280
|
+
async function Ao(t) {
|
|
2282
2281
|
const { email: e, spaceId: r, authUrl: n, returnUrl: o = window.location.origin + window.location.pathname } = t, s = await fetch(`${n}/email/send`, {
|
|
2283
2282
|
method: "POST",
|
|
2284
2283
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2293,22 +2292,22 @@ async function Ro(t) {
|
|
|
2293
2292
|
throw new Error(i);
|
|
2294
2293
|
}
|
|
2295
2294
|
}
|
|
2296
|
-
function
|
|
2295
|
+
function Yn() {
|
|
2297
2296
|
const t = new URLSearchParams(window.location.search), e = t.get("ikon_token"), r = t.get("ikon_provider");
|
|
2298
2297
|
return e && r ? { token: e, provider: r } : null;
|
|
2299
2298
|
}
|
|
2300
|
-
function
|
|
2299
|
+
function zn() {
|
|
2301
2300
|
const e = new URLSearchParams(window.location.search).get("error");
|
|
2302
2301
|
return e ? decodeURIComponent(e) : null;
|
|
2303
2302
|
}
|
|
2304
|
-
function
|
|
2303
|
+
function mt() {
|
|
2305
2304
|
window.history.replaceState({}, "", window.location.pathname);
|
|
2306
2305
|
}
|
|
2307
|
-
function
|
|
2306
|
+
function Wn(t, e, r, n) {
|
|
2308
2307
|
const o = n ?? window.location.origin + window.location.pathname + window.location.search;
|
|
2309
2308
|
return `${r}/oauth/${t}?space=${encodeURIComponent(e)}&return=${encodeURIComponent(o)}`;
|
|
2310
2309
|
}
|
|
2311
|
-
async function
|
|
2310
|
+
async function qn(t) {
|
|
2312
2311
|
const e = await fetch(`${t}/passkey/registration/options`, {
|
|
2313
2312
|
method: "POST",
|
|
2314
2313
|
headers: { "Content-Type": "application/json" }
|
|
@@ -2319,7 +2318,7 @@ async function Wn(t) {
|
|
|
2319
2318
|
}
|
|
2320
2319
|
return e.json();
|
|
2321
2320
|
}
|
|
2322
|
-
async function
|
|
2321
|
+
async function Gn(t, e, r) {
|
|
2323
2322
|
const n = await fetch(`${t}/passkey/registration/verify`, {
|
|
2324
2323
|
method: "POST",
|
|
2325
2324
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2334,9 +2333,9 @@ async function zn(t, e, r) {
|
|
|
2334
2333
|
provider: "passkey",
|
|
2335
2334
|
authenticatedAt: Date.now()
|
|
2336
2335
|
};
|
|
2337
|
-
return
|
|
2336
|
+
return ke(s), s;
|
|
2338
2337
|
}
|
|
2339
|
-
async function
|
|
2338
|
+
async function Hn(t, e) {
|
|
2340
2339
|
const r = await fetch(`${t}/passkey/authentication/options`, {
|
|
2341
2340
|
method: "POST",
|
|
2342
2341
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2348,7 +2347,7 @@ async function qn(t, e) {
|
|
|
2348
2347
|
}
|
|
2349
2348
|
return r.json();
|
|
2350
2349
|
}
|
|
2351
|
-
async function
|
|
2350
|
+
async function Jn(t, e) {
|
|
2352
2351
|
const r = await fetch(`${t}/passkey/authentication/verify`, {
|
|
2353
2352
|
method: "POST",
|
|
2354
2353
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2363,7 +2362,7 @@ async function Gn(t, e) {
|
|
|
2363
2362
|
provider: "passkey",
|
|
2364
2363
|
authenticatedAt: Date.now()
|
|
2365
2364
|
};
|
|
2366
|
-
return
|
|
2365
|
+
return ke(o), o;
|
|
2367
2366
|
}
|
|
2368
2367
|
function q(t) {
|
|
2369
2368
|
const e = new Uint8Array(t);
|
|
@@ -2372,23 +2371,23 @@ function q(t) {
|
|
|
2372
2371
|
r += String.fromCharCode(o);
|
|
2373
2372
|
return btoa(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
2374
2373
|
}
|
|
2375
|
-
function
|
|
2374
|
+
function Re(t) {
|
|
2376
2375
|
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);
|
|
2377
2376
|
for (let a = 0; a < o.length; a++)
|
|
2378
2377
|
i[a] = o.charCodeAt(a);
|
|
2379
2378
|
return s;
|
|
2380
2379
|
}
|
|
2381
|
-
function
|
|
2382
|
-
return
|
|
2380
|
+
function We() {
|
|
2381
|
+
return Xn.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
|
|
2383
2382
|
}
|
|
2384
|
-
const
|
|
2383
|
+
const Xn = {
|
|
2385
2384
|
stubThis: (t) => t
|
|
2386
2385
|
};
|
|
2387
|
-
function
|
|
2386
|
+
function At(t) {
|
|
2388
2387
|
const { id: e } = t;
|
|
2389
2388
|
return {
|
|
2390
2389
|
...t,
|
|
2391
|
-
id:
|
|
2390
|
+
id: Re(e),
|
|
2392
2391
|
/**
|
|
2393
2392
|
* `descriptor.transports` is an array of our `AuthenticatorTransportFuture` that includes newer
|
|
2394
2393
|
* transports that TypeScript's DOM lib is ignorant of. Convince TS that our list of transports
|
|
@@ -2397,13 +2396,13 @@ function Rt(t) {
|
|
|
2397
2396
|
transports: t.transports
|
|
2398
2397
|
};
|
|
2399
2398
|
}
|
|
2400
|
-
function
|
|
2399
|
+
function kt(t) {
|
|
2401
2400
|
return (
|
|
2402
2401
|
// Consider localhost valid as well since it's okay wrt Secure Contexts
|
|
2403
2402
|
t === "localhost" || /^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)
|
|
2404
2403
|
);
|
|
2405
2404
|
}
|
|
2406
|
-
class
|
|
2405
|
+
class M extends Error {
|
|
2407
2406
|
constructor({ message: e, code: r, cause: n, name: o }) {
|
|
2408
2407
|
super(e, { cause: n }), Object.defineProperty(this, "code", {
|
|
2409
2408
|
enumerable: !0,
|
|
@@ -2413,20 +2412,20 @@ class P extends Error {
|
|
|
2413
2412
|
}), this.name = o ?? n.name, this.code = r;
|
|
2414
2413
|
}
|
|
2415
2414
|
}
|
|
2416
|
-
function
|
|
2415
|
+
function Zn({ error: t, options: e }) {
|
|
2417
2416
|
const { publicKey: r } = e;
|
|
2418
2417
|
if (!r)
|
|
2419
2418
|
throw Error("options was missing required publicKey property");
|
|
2420
2419
|
if (t.name === "AbortError") {
|
|
2421
2420
|
if (e.signal instanceof AbortSignal)
|
|
2422
|
-
return new
|
|
2421
|
+
return new M({
|
|
2423
2422
|
message: "Registration ceremony was sent an abort signal",
|
|
2424
2423
|
code: "ERROR_CEREMONY_ABORTED",
|
|
2425
2424
|
cause: t
|
|
2426
2425
|
});
|
|
2427
2426
|
} else if (t.name === "ConstraintError") {
|
|
2428
2427
|
if (r.authenticatorSelection?.requireResidentKey === !0)
|
|
2429
|
-
return new
|
|
2428
|
+
return new M({
|
|
2430
2429
|
message: "Discoverable credentials were required but no available authenticator supported it",
|
|
2431
2430
|
code: "ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",
|
|
2432
2431
|
cause: t
|
|
@@ -2435,63 +2434,63 @@ function Jn({ error: t, options: e }) {
|
|
|
2435
2434
|
// @ts-ignore: `mediation` doesn't yet exist on CredentialCreationOptions but it's possible as of Sept 2024
|
|
2436
2435
|
e.mediation === "conditional" && r.authenticatorSelection?.userVerification === "required"
|
|
2437
2436
|
)
|
|
2438
|
-
return new
|
|
2437
|
+
return new M({
|
|
2439
2438
|
message: "User verification was required during automatic registration but it could not be performed",
|
|
2440
2439
|
code: "ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",
|
|
2441
2440
|
cause: t
|
|
2442
2441
|
});
|
|
2443
2442
|
if (r.authenticatorSelection?.userVerification === "required")
|
|
2444
|
-
return new
|
|
2443
|
+
return new M({
|
|
2445
2444
|
message: "User verification was required but no available authenticator supported it",
|
|
2446
2445
|
code: "ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",
|
|
2447
2446
|
cause: t
|
|
2448
2447
|
});
|
|
2449
2448
|
} else {
|
|
2450
2449
|
if (t.name === "InvalidStateError")
|
|
2451
|
-
return new
|
|
2450
|
+
return new M({
|
|
2452
2451
|
message: "The authenticator was previously registered",
|
|
2453
2452
|
code: "ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",
|
|
2454
2453
|
cause: t
|
|
2455
2454
|
});
|
|
2456
2455
|
if (t.name === "NotAllowedError")
|
|
2457
|
-
return new
|
|
2456
|
+
return new M({
|
|
2458
2457
|
message: t.message,
|
|
2459
2458
|
code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
|
|
2460
2459
|
cause: t
|
|
2461
2460
|
});
|
|
2462
2461
|
if (t.name === "NotSupportedError")
|
|
2463
|
-
return r.pubKeyCredParams.filter((o) => o.type === "public-key").length === 0 ? new
|
|
2462
|
+
return r.pubKeyCredParams.filter((o) => o.type === "public-key").length === 0 ? new M({
|
|
2464
2463
|
message: 'No entry in pubKeyCredParams was of type "public-key"',
|
|
2465
2464
|
code: "ERROR_MALFORMED_PUBKEYCREDPARAMS",
|
|
2466
2465
|
cause: t
|
|
2467
|
-
}) : new
|
|
2466
|
+
}) : new M({
|
|
2468
2467
|
message: "No available authenticator supported any of the specified pubKeyCredParams algorithms",
|
|
2469
2468
|
code: "ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",
|
|
2470
2469
|
cause: t
|
|
2471
2470
|
});
|
|
2472
2471
|
if (t.name === "SecurityError") {
|
|
2473
2472
|
const n = globalThis.location.hostname;
|
|
2474
|
-
if (
|
|
2473
|
+
if (kt(n)) {
|
|
2475
2474
|
if (r.rp.id !== n)
|
|
2476
|
-
return new
|
|
2475
|
+
return new M({
|
|
2477
2476
|
message: `The RP ID "${r.rp.id}" is invalid for this domain`,
|
|
2478
2477
|
code: "ERROR_INVALID_RP_ID",
|
|
2479
2478
|
cause: t
|
|
2480
2479
|
});
|
|
2481
|
-
} else return new
|
|
2480
|
+
} else return new M({
|
|
2482
2481
|
message: `${globalThis.location.hostname} is an invalid domain`,
|
|
2483
2482
|
code: "ERROR_INVALID_DOMAIN",
|
|
2484
2483
|
cause: t
|
|
2485
2484
|
});
|
|
2486
2485
|
} else if (t.name === "TypeError") {
|
|
2487
2486
|
if (r.user.id.byteLength < 1 || r.user.id.byteLength > 64)
|
|
2488
|
-
return new
|
|
2487
|
+
return new M({
|
|
2489
2488
|
message: "User ID was not between 1 and 64 characters",
|
|
2490
2489
|
code: "ERROR_INVALID_USER_ID_LENGTH",
|
|
2491
2490
|
cause: t
|
|
2492
2491
|
});
|
|
2493
2492
|
} else if (t.name === "UnknownError")
|
|
2494
|
-
return new
|
|
2493
|
+
return new M({
|
|
2495
2494
|
message: "The authenticator was unable to process the specified options, or could not create a new credential",
|
|
2496
2495
|
code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
|
|
2497
2496
|
cause: t
|
|
@@ -2499,7 +2498,7 @@ function Jn({ error: t, options: e }) {
|
|
|
2499
2498
|
}
|
|
2500
2499
|
return t;
|
|
2501
2500
|
}
|
|
2502
|
-
class
|
|
2501
|
+
class Qn {
|
|
2503
2502
|
constructor() {
|
|
2504
2503
|
Object.defineProperty(this, "controller", {
|
|
2505
2504
|
enumerable: !0,
|
|
@@ -2523,58 +2522,58 @@ class Xn {
|
|
|
2523
2522
|
}
|
|
2524
2523
|
}
|
|
2525
2524
|
}
|
|
2526
|
-
const
|
|
2527
|
-
function
|
|
2528
|
-
if (t && !(
|
|
2525
|
+
const Tt = new Qn(), eo = ["cross-platform", "platform"];
|
|
2526
|
+
function Ct(t) {
|
|
2527
|
+
if (t && !(eo.indexOf(t) < 0))
|
|
2529
2528
|
return t;
|
|
2530
2529
|
}
|
|
2531
|
-
async function
|
|
2530
|
+
async function to(t) {
|
|
2532
2531
|
!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 });
|
|
2533
2532
|
const { optionsJSON: e, useAutoRegister: r = !1 } = t;
|
|
2534
|
-
if (!
|
|
2533
|
+
if (!We())
|
|
2535
2534
|
throw new Error("WebAuthn is not supported in this browser");
|
|
2536
2535
|
const n = {
|
|
2537
2536
|
...e,
|
|
2538
|
-
challenge:
|
|
2537
|
+
challenge: Re(e.challenge),
|
|
2539
2538
|
user: {
|
|
2540
2539
|
...e.user,
|
|
2541
|
-
id:
|
|
2540
|
+
id: Re(e.user.id)
|
|
2542
2541
|
},
|
|
2543
|
-
excludeCredentials: e.excludeCredentials?.map(
|
|
2542
|
+
excludeCredentials: e.excludeCredentials?.map(At)
|
|
2544
2543
|
}, o = {};
|
|
2545
|
-
r && (o.mediation = "conditional"), o.publicKey = n, o.signal =
|
|
2544
|
+
r && (o.mediation = "conditional"), o.publicKey = n, o.signal = Tt.createNewAbortSignal();
|
|
2546
2545
|
let s;
|
|
2547
2546
|
try {
|
|
2548
2547
|
s = await navigator.credentials.create(o);
|
|
2549
|
-
} catch (
|
|
2550
|
-
throw
|
|
2548
|
+
} catch (p) {
|
|
2549
|
+
throw Zn({ error: p, options: o });
|
|
2551
2550
|
}
|
|
2552
2551
|
if (!s)
|
|
2553
2552
|
throw new Error("Registration was not completed");
|
|
2554
|
-
const { id: i, rawId: a, response: c, type:
|
|
2553
|
+
const { id: i, rawId: a, response: c, type: f } = s;
|
|
2554
|
+
let l;
|
|
2555
|
+
typeof c.getTransports == "function" && (l = c.getTransports());
|
|
2555
2556
|
let u;
|
|
2556
|
-
typeof c.getTransports == "function" && (u = c.getTransports());
|
|
2557
|
-
let h;
|
|
2558
2557
|
if (typeof c.getPublicKeyAlgorithm == "function")
|
|
2559
2558
|
try {
|
|
2560
|
-
|
|
2561
|
-
} catch (
|
|
2562
|
-
|
|
2559
|
+
u = c.getPublicKeyAlgorithm();
|
|
2560
|
+
} catch (p) {
|
|
2561
|
+
Pe("getPublicKeyAlgorithm()", p);
|
|
2563
2562
|
}
|
|
2564
|
-
let
|
|
2563
|
+
let h;
|
|
2565
2564
|
if (typeof c.getPublicKey == "function")
|
|
2566
2565
|
try {
|
|
2567
|
-
const
|
|
2568
|
-
|
|
2569
|
-
} catch (
|
|
2570
|
-
|
|
2566
|
+
const p = c.getPublicKey();
|
|
2567
|
+
p !== null && (h = q(p));
|
|
2568
|
+
} catch (p) {
|
|
2569
|
+
Pe("getPublicKey()", p);
|
|
2571
2570
|
}
|
|
2572
|
-
let
|
|
2571
|
+
let y;
|
|
2573
2572
|
if (typeof c.getAuthenticatorData == "function")
|
|
2574
2573
|
try {
|
|
2575
|
-
|
|
2576
|
-
} catch (
|
|
2577
|
-
|
|
2574
|
+
y = q(c.getAuthenticatorData());
|
|
2575
|
+
} catch (p) {
|
|
2576
|
+
Pe("getAuthenticatorData()", p);
|
|
2578
2577
|
}
|
|
2579
2578
|
return {
|
|
2580
2579
|
id: i,
|
|
@@ -2582,63 +2581,63 @@ async function Qn(t) {
|
|
|
2582
2581
|
response: {
|
|
2583
2582
|
attestationObject: q(c.attestationObject),
|
|
2584
2583
|
clientDataJSON: q(c.clientDataJSON),
|
|
2585
|
-
transports:
|
|
2586
|
-
publicKeyAlgorithm:
|
|
2587
|
-
publicKey:
|
|
2588
|
-
authenticatorData:
|
|
2584
|
+
transports: l,
|
|
2585
|
+
publicKeyAlgorithm: u,
|
|
2586
|
+
publicKey: h,
|
|
2587
|
+
authenticatorData: y
|
|
2589
2588
|
},
|
|
2590
|
-
type:
|
|
2589
|
+
type: f,
|
|
2591
2590
|
clientExtensionResults: s.getClientExtensionResults(),
|
|
2592
|
-
authenticatorAttachment:
|
|
2591
|
+
authenticatorAttachment: Ct(s.authenticatorAttachment)
|
|
2593
2592
|
};
|
|
2594
2593
|
}
|
|
2595
|
-
function
|
|
2594
|
+
function Pe(t, e) {
|
|
2596
2595
|
console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${t}. You should report this error to them.
|
|
2597
2596
|
`, e);
|
|
2598
2597
|
}
|
|
2599
|
-
function
|
|
2600
|
-
if (!
|
|
2601
|
-
return
|
|
2598
|
+
function ro() {
|
|
2599
|
+
if (!We())
|
|
2600
|
+
return Me.stubThis(new Promise((e) => e(!1)));
|
|
2602
2601
|
const t = globalThis.PublicKeyCredential;
|
|
2603
|
-
return t?.isConditionalMediationAvailable === void 0 ?
|
|
2602
|
+
return t?.isConditionalMediationAvailable === void 0 ? Me.stubThis(new Promise((e) => e(!1))) : Me.stubThis(t.isConditionalMediationAvailable());
|
|
2604
2603
|
}
|
|
2605
|
-
const
|
|
2604
|
+
const Me = {
|
|
2606
2605
|
stubThis: (t) => t
|
|
2607
2606
|
};
|
|
2608
|
-
function
|
|
2607
|
+
function no({ error: t, options: e }) {
|
|
2609
2608
|
const { publicKey: r } = e;
|
|
2610
2609
|
if (!r)
|
|
2611
2610
|
throw Error("options was missing required publicKey property");
|
|
2612
2611
|
if (t.name === "AbortError") {
|
|
2613
2612
|
if (e.signal instanceof AbortSignal)
|
|
2614
|
-
return new
|
|
2613
|
+
return new M({
|
|
2615
2614
|
message: "Authentication ceremony was sent an abort signal",
|
|
2616
2615
|
code: "ERROR_CEREMONY_ABORTED",
|
|
2617
2616
|
cause: t
|
|
2618
2617
|
});
|
|
2619
2618
|
} else {
|
|
2620
2619
|
if (t.name === "NotAllowedError")
|
|
2621
|
-
return new
|
|
2620
|
+
return new M({
|
|
2622
2621
|
message: t.message,
|
|
2623
2622
|
code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
|
|
2624
2623
|
cause: t
|
|
2625
2624
|
});
|
|
2626
2625
|
if (t.name === "SecurityError") {
|
|
2627
2626
|
const n = globalThis.location.hostname;
|
|
2628
|
-
if (
|
|
2627
|
+
if (kt(n)) {
|
|
2629
2628
|
if (r.rpId !== n)
|
|
2630
|
-
return new
|
|
2629
|
+
return new M({
|
|
2631
2630
|
message: `The RP ID "${r.rpId}" is invalid for this domain`,
|
|
2632
2631
|
code: "ERROR_INVALID_RP_ID",
|
|
2633
2632
|
cause: t
|
|
2634
2633
|
});
|
|
2635
|
-
} else return new
|
|
2634
|
+
} else return new M({
|
|
2636
2635
|
message: `${globalThis.location.hostname} is an invalid domain`,
|
|
2637
2636
|
code: "ERROR_INVALID_DOMAIN",
|
|
2638
2637
|
cause: t
|
|
2639
2638
|
});
|
|
2640
2639
|
} else if (t.name === "UnknownError")
|
|
2641
|
-
return new
|
|
2640
|
+
return new M({
|
|
2642
2641
|
message: "The authenticator was unable to process the specified options, or could not create a new assertion signature",
|
|
2643
2642
|
code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
|
|
2644
2643
|
cause: t
|
|
@@ -2646,91 +2645,91 @@ function to({ error: t, options: e }) {
|
|
|
2646
2645
|
}
|
|
2647
2646
|
return t;
|
|
2648
2647
|
}
|
|
2649
|
-
async function
|
|
2648
|
+
async function oo(t) {
|
|
2650
2649
|
!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 });
|
|
2651
2650
|
const { optionsJSON: e, useBrowserAutofill: r = !1, verifyBrowserAutofillInput: n = !0 } = t;
|
|
2652
|
-
if (!
|
|
2651
|
+
if (!We())
|
|
2653
2652
|
throw new Error("WebAuthn is not supported in this browser");
|
|
2654
2653
|
let o;
|
|
2655
|
-
e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(
|
|
2654
|
+
e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(At));
|
|
2656
2655
|
const s = {
|
|
2657
2656
|
...e,
|
|
2658
|
-
challenge:
|
|
2657
|
+
challenge: Re(e.challenge),
|
|
2659
2658
|
allowCredentials: o
|
|
2660
2659
|
}, i = {};
|
|
2661
2660
|
if (r) {
|
|
2662
|
-
if (!await
|
|
2661
|
+
if (!await ro())
|
|
2663
2662
|
throw Error("Browser does not support WebAuthn autofill");
|
|
2664
2663
|
if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 && n)
|
|
2665
2664
|
throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
|
|
2666
2665
|
i.mediation = "conditional", s.allowCredentials = [];
|
|
2667
2666
|
}
|
|
2668
|
-
i.publicKey = s, i.signal =
|
|
2667
|
+
i.publicKey = s, i.signal = Tt.createNewAbortSignal();
|
|
2669
2668
|
let a;
|
|
2670
2669
|
try {
|
|
2671
2670
|
a = await navigator.credentials.get(i);
|
|
2672
|
-
} catch (
|
|
2673
|
-
throw
|
|
2671
|
+
} catch (y) {
|
|
2672
|
+
throw no({ error: y, options: i });
|
|
2674
2673
|
}
|
|
2675
2674
|
if (!a)
|
|
2676
2675
|
throw new Error("Authentication was not completed");
|
|
2677
|
-
const { id: c, rawId:
|
|
2678
|
-
let
|
|
2679
|
-
return
|
|
2676
|
+
const { id: c, rawId: f, response: l, type: u } = a;
|
|
2677
|
+
let h;
|
|
2678
|
+
return l.userHandle && (h = q(l.userHandle)), {
|
|
2680
2679
|
id: c,
|
|
2681
|
-
rawId: q(
|
|
2680
|
+
rawId: q(f),
|
|
2682
2681
|
response: {
|
|
2683
|
-
authenticatorData: q(
|
|
2684
|
-
clientDataJSON: q(
|
|
2685
|
-
signature: q(
|
|
2686
|
-
userHandle:
|
|
2682
|
+
authenticatorData: q(l.authenticatorData),
|
|
2683
|
+
clientDataJSON: q(l.clientDataJSON),
|
|
2684
|
+
signature: q(l.signature),
|
|
2685
|
+
userHandle: h
|
|
2687
2686
|
},
|
|
2688
|
-
type:
|
|
2687
|
+
type: u,
|
|
2689
2688
|
clientExtensionResults: a.getClientExtensionResults(),
|
|
2690
|
-
authenticatorAttachment:
|
|
2689
|
+
authenticatorAttachment: Ct(a.authenticatorAttachment)
|
|
2691
2690
|
};
|
|
2692
2691
|
}
|
|
2693
|
-
const
|
|
2694
|
-
function
|
|
2692
|
+
const qe = pt(null);
|
|
2693
|
+
function ko({ children: t, config: e }) {
|
|
2695
2694
|
const [r, n] = G({
|
|
2696
2695
|
isAuthenticated: !1,
|
|
2697
2696
|
isLoading: !0,
|
|
2698
2697
|
user: null,
|
|
2699
2698
|
error: null
|
|
2700
2699
|
});
|
|
2701
|
-
|
|
2700
|
+
j(() => {
|
|
2702
2701
|
(() => {
|
|
2703
|
-
const
|
|
2704
|
-
if (
|
|
2705
|
-
|
|
2702
|
+
const l = zn();
|
|
2703
|
+
if (l) {
|
|
2704
|
+
mt(), n({
|
|
2706
2705
|
isAuthenticated: !1,
|
|
2707
2706
|
isLoading: !1,
|
|
2708
2707
|
user: null,
|
|
2709
|
-
error:
|
|
2708
|
+
error: l
|
|
2710
2709
|
});
|
|
2711
2710
|
return;
|
|
2712
2711
|
}
|
|
2713
|
-
const
|
|
2714
|
-
if (
|
|
2715
|
-
const
|
|
2716
|
-
token:
|
|
2717
|
-
provider:
|
|
2712
|
+
const u = Yn();
|
|
2713
|
+
if (u) {
|
|
2714
|
+
const y = {
|
|
2715
|
+
token: u.token,
|
|
2716
|
+
provider: u.provider,
|
|
2718
2717
|
authenticatedAt: Date.now()
|
|
2719
2718
|
};
|
|
2720
|
-
|
|
2719
|
+
ke(y), mt(), n({
|
|
2721
2720
|
isAuthenticated: !0,
|
|
2722
2721
|
isLoading: !1,
|
|
2723
|
-
user:
|
|
2722
|
+
user: fe(y),
|
|
2724
2723
|
error: null
|
|
2725
2724
|
});
|
|
2726
2725
|
return;
|
|
2727
2726
|
}
|
|
2728
|
-
const
|
|
2729
|
-
if (
|
|
2727
|
+
const h = Rt();
|
|
2728
|
+
if (h) {
|
|
2730
2729
|
n({
|
|
2731
2730
|
isAuthenticated: !0,
|
|
2732
2731
|
isLoading: !1,
|
|
2733
|
-
user:
|
|
2732
|
+
user: fe(h),
|
|
2734
2733
|
error: null
|
|
2735
2734
|
});
|
|
2736
2735
|
return;
|
|
@@ -2743,86 +2742,86 @@ function Eo({ children: t, config: e }) {
|
|
|
2743
2742
|
});
|
|
2744
2743
|
})();
|
|
2745
2744
|
}, []);
|
|
2746
|
-
const o =
|
|
2747
|
-
async (
|
|
2745
|
+
const o = F(
|
|
2746
|
+
async (f) => {
|
|
2748
2747
|
if (!e.spaceId) {
|
|
2749
|
-
n((
|
|
2750
|
-
...
|
|
2748
|
+
n((u) => ({
|
|
2749
|
+
...u,
|
|
2751
2750
|
error: "Space ID is not configured"
|
|
2752
2751
|
}));
|
|
2753
2752
|
return;
|
|
2754
2753
|
}
|
|
2755
|
-
const
|
|
2756
|
-
if (
|
|
2757
|
-
n((
|
|
2754
|
+
const l = je(e.authUrl);
|
|
2755
|
+
if (f === "guest") {
|
|
2756
|
+
n((u) => ({ ...u, isLoading: !0 }));
|
|
2758
2757
|
try {
|
|
2759
|
-
const
|
|
2758
|
+
const u = await Et(e.spaceId, l);
|
|
2760
2759
|
n({
|
|
2761
2760
|
isAuthenticated: !0,
|
|
2762
2761
|
isLoading: !1,
|
|
2763
|
-
user:
|
|
2762
|
+
user: fe(u),
|
|
2764
2763
|
error: null
|
|
2765
2764
|
});
|
|
2766
|
-
} catch (
|
|
2767
|
-
n((
|
|
2768
|
-
...
|
|
2765
|
+
} catch (u) {
|
|
2766
|
+
n((h) => ({
|
|
2767
|
+
...h,
|
|
2769
2768
|
isLoading: !1,
|
|
2770
|
-
error:
|
|
2769
|
+
error: u instanceof Error ? u.message : "Guest login failed"
|
|
2771
2770
|
}));
|
|
2772
2771
|
}
|
|
2773
2772
|
return;
|
|
2774
2773
|
}
|
|
2775
|
-
if (
|
|
2776
|
-
n((
|
|
2774
|
+
if (f === "passkey") {
|
|
2775
|
+
n((u) => ({ ...u, isLoading: !0, error: null }));
|
|
2777
2776
|
try {
|
|
2778
|
-
const
|
|
2777
|
+
const u = await Hn(l), h = await oo({ optionsJSON: u }), y = await Jn(l, h);
|
|
2779
2778
|
n({
|
|
2780
2779
|
isAuthenticated: !0,
|
|
2781
2780
|
isLoading: !1,
|
|
2782
|
-
user:
|
|
2781
|
+
user: fe(y),
|
|
2783
2782
|
error: null
|
|
2784
2783
|
});
|
|
2785
|
-
} catch (
|
|
2786
|
-
n((
|
|
2787
|
-
...
|
|
2784
|
+
} catch (u) {
|
|
2785
|
+
n((h) => ({
|
|
2786
|
+
...h,
|
|
2788
2787
|
isLoading: !1,
|
|
2789
|
-
error:
|
|
2788
|
+
error: u instanceof Error ? u.message : "Passkey login failed"
|
|
2790
2789
|
}));
|
|
2791
2790
|
}
|
|
2792
2791
|
return;
|
|
2793
2792
|
}
|
|
2794
|
-
window.location.href =
|
|
2793
|
+
window.location.href = Wn(f, e.spaceId, l);
|
|
2795
2794
|
},
|
|
2796
2795
|
[e.authUrl, e.spaceId]
|
|
2797
|
-
), s =
|
|
2798
|
-
|
|
2796
|
+
), s = F(() => {
|
|
2797
|
+
ve(), n({
|
|
2799
2798
|
isAuthenticated: !1,
|
|
2800
2799
|
isLoading: !1,
|
|
2801
2800
|
user: null,
|
|
2802
2801
|
error: null
|
|
2803
2802
|
});
|
|
2804
|
-
}, []), i =
|
|
2805
|
-
async (
|
|
2806
|
-
const
|
|
2807
|
-
n((
|
|
2803
|
+
}, []), i = F(
|
|
2804
|
+
async (f) => {
|
|
2805
|
+
const l = je(e.authUrl);
|
|
2806
|
+
n((u) => ({ ...u, isLoading: !0, error: null }));
|
|
2808
2807
|
try {
|
|
2809
|
-
const
|
|
2808
|
+
const u = await qn(l), h = await to({ optionsJSON: u }), y = await Gn(l, h, f);
|
|
2810
2809
|
n({
|
|
2811
2810
|
isAuthenticated: !0,
|
|
2812
2811
|
isLoading: !1,
|
|
2813
|
-
user:
|
|
2812
|
+
user: fe(y),
|
|
2814
2813
|
error: null
|
|
2815
2814
|
});
|
|
2816
|
-
} catch (
|
|
2817
|
-
n((
|
|
2818
|
-
...
|
|
2815
|
+
} catch (u) {
|
|
2816
|
+
n((h) => ({
|
|
2817
|
+
...h,
|
|
2819
2818
|
isLoading: !1,
|
|
2820
|
-
error:
|
|
2819
|
+
error: u instanceof Error ? u.message : "Passkey registration failed"
|
|
2821
2820
|
}));
|
|
2822
2821
|
}
|
|
2823
2822
|
},
|
|
2824
2823
|
[e.authUrl]
|
|
2825
|
-
), a =
|
|
2824
|
+
), a = F(() => r.user?.token ?? null, [r.user]), c = K(
|
|
2826
2825
|
() => ({
|
|
2827
2826
|
state: r,
|
|
2828
2827
|
login: o,
|
|
@@ -2832,27 +2831,27 @@ function Eo({ children: t, config: e }) {
|
|
|
2832
2831
|
}),
|
|
2833
2832
|
[r, o, s, a, i]
|
|
2834
2833
|
);
|
|
2835
|
-
return /* @__PURE__ */
|
|
2834
|
+
return /* @__PURE__ */ E.jsx(qe, { value: c, children: t });
|
|
2836
2835
|
}
|
|
2837
|
-
function
|
|
2838
|
-
const t =
|
|
2836
|
+
function so() {
|
|
2837
|
+
const t = Ve(qe);
|
|
2839
2838
|
if (!t)
|
|
2840
2839
|
throw new Error("useAuth must be used within an AuthProvider");
|
|
2841
2840
|
return t;
|
|
2842
2841
|
}
|
|
2843
|
-
function
|
|
2844
|
-
return
|
|
2842
|
+
function io() {
|
|
2843
|
+
return Ve(qe);
|
|
2845
2844
|
}
|
|
2846
|
-
function
|
|
2847
|
-
const { config: e, guestUrlParam: r } = t, { state: n, login: o } =
|
|
2848
|
-
return
|
|
2845
|
+
function To(t) {
|
|
2846
|
+
const { config: e, guestUrlParam: r } = t, { state: n, login: o } = so(), s = w(!1);
|
|
2847
|
+
return j(() => {
|
|
2849
2848
|
if (!r || n.isAuthenticated || n.isLoading || s.current || !e.methods.includes("guest"))
|
|
2850
2849
|
return;
|
|
2851
2850
|
const i = new URLSearchParams(window.location.search), a = i.get(r);
|
|
2852
2851
|
if (a === "true" || a === "1" || a === "") {
|
|
2853
2852
|
i.delete(r);
|
|
2854
|
-
const c = i.toString(),
|
|
2855
|
-
window.history.replaceState({}, "",
|
|
2853
|
+
const c = i.toString(), f = window.location.pathname + (c ? `?${c}` : "");
|
|
2854
|
+
window.history.replaceState({}, "", f), s.current = !0, o("guest");
|
|
2856
2855
|
}
|
|
2857
2856
|
}, [r, n.isAuthenticated, n.isLoading, e.methods, o]), {
|
|
2858
2857
|
shouldRenderChildren: n.isAuthenticated,
|
|
@@ -2861,7 +2860,7 @@ function Ao(t) {
|
|
|
2861
2860
|
error: n.error
|
|
2862
2861
|
};
|
|
2863
2862
|
}
|
|
2864
|
-
function
|
|
2863
|
+
function Co({
|
|
2865
2864
|
connectionState: t,
|
|
2866
2865
|
error: e,
|
|
2867
2866
|
isReady: r,
|
|
@@ -2871,201 +2870,207 @@ function ko({
|
|
|
2871
2870
|
onAction: i,
|
|
2872
2871
|
renderIdle: a,
|
|
2873
2872
|
renderConnecting: c,
|
|
2874
|
-
renderConnectingSlow:
|
|
2875
|
-
renderConnected:
|
|
2876
|
-
renderOffline:
|
|
2877
|
-
renderError:
|
|
2873
|
+
renderConnectingSlow: f,
|
|
2874
|
+
renderConnected: l,
|
|
2875
|
+
renderOffline: u,
|
|
2876
|
+
renderError: h
|
|
2878
2877
|
}) {
|
|
2878
|
+
const y = w(!1);
|
|
2879
2879
|
switch (t) {
|
|
2880
2880
|
case "idle":
|
|
2881
2881
|
return a();
|
|
2882
2882
|
case "connecting":
|
|
2883
2883
|
return c();
|
|
2884
2884
|
case "connectingSlow":
|
|
2885
|
-
return
|
|
2885
|
+
return f();
|
|
2886
2886
|
case "connected":
|
|
2887
|
-
case "reconnecting":
|
|
2888
|
-
|
|
2887
|
+
case "reconnecting": {
|
|
2888
|
+
if (!r || !n || !o) return null;
|
|
2889
|
+
t === "reconnecting" && (y.current = !0);
|
|
2890
|
+
const p = n.size > 0;
|
|
2891
|
+
return p && (y.current = !1), l({
|
|
2889
2892
|
stores: n,
|
|
2890
2893
|
registry: o,
|
|
2891
2894
|
client: s,
|
|
2892
2895
|
onAction: i,
|
|
2893
|
-
isReconnecting: t === "reconnecting"
|
|
2896
|
+
isReconnecting: t === "reconnecting" || y.current && !p
|
|
2894
2897
|
});
|
|
2898
|
+
}
|
|
2895
2899
|
case "offline":
|
|
2896
|
-
return
|
|
2900
|
+
return y.current = !1, u();
|
|
2897
2901
|
case "offlineError":
|
|
2898
|
-
return
|
|
2902
|
+
return y.current = !1, h(e ?? s?.lastError?.message ?? null);
|
|
2899
2903
|
default:
|
|
2900
2904
|
return null;
|
|
2901
2905
|
}
|
|
2902
2906
|
}
|
|
2903
|
-
const
|
|
2904
|
-
function
|
|
2907
|
+
const be = Ee("useIkonApp");
|
|
2908
|
+
function ao() {
|
|
2905
2909
|
if (typeof window < "u" && window.__IKON_AUTH_CONFIG__)
|
|
2906
2910
|
return window.__IKON_AUTH_CONFIG__;
|
|
2907
2911
|
}
|
|
2908
|
-
function
|
|
2912
|
+
function co() {
|
|
2909
2913
|
if (typeof window < "u" && window.__IKON_LOCAL_IKON_SERVER_CONFIG__)
|
|
2910
2914
|
return window.__IKON_LOCAL_IKON_SERVER_CONFIG__;
|
|
2911
2915
|
}
|
|
2912
|
-
function
|
|
2913
|
-
const { authConfig: e, modules: r, timeouts: n, backgroundAudio: o, webRtc: s, audio: i, video: a, websocket: c, webtransport:
|
|
2914
|
-
|
|
2915
|
-
const [
|
|
2916
|
+
function Io(t) {
|
|
2917
|
+
const { authConfig: e, modules: r, timeouts: n, backgroundAudio: o, webRtc: s, audio: i, video: a, websocket: c, webtransport: f, proxy: l } = t, u = e === void 0 ? ao() ?? null : e, h = co(), y = io(), p = w(null), b = w(null), m = w(null), g = w(!1), v = w(!1), k = w(o), I = w(n), U = w(s), z = w(i), J = w(a), C = w(c), _ = w(f), L = w(l);
|
|
2918
|
+
k.current = o, I.current = n, U.current = s, z.current = i, J.current = a, C.current = c, _.current = f, L.current = l;
|
|
2919
|
+
const [N, B] = G("idle"), [W, re] = G(null), [oe, me] = G(null), [X, pe] = G(null), [se, d] = G(!1), [S, T] = G(0), A = K(() => {
|
|
2916
2920
|
try {
|
|
2917
|
-
const
|
|
2918
|
-
return (
|
|
2921
|
+
const P = Ut();
|
|
2922
|
+
return (P.sessionId || P.channelKey) && Lt(), P;
|
|
2919
2923
|
} catch {
|
|
2920
2924
|
return { parameters: {} };
|
|
2921
2925
|
}
|
|
2922
|
-
}, []),
|
|
2923
|
-
|
|
2924
|
-
!
|
|
2925
|
-
|
|
2926
|
-
}).catch((
|
|
2927
|
-
|
|
2926
|
+
}, []), x = K(() => u?.enabled ? Rt() : null, [u?.enabled, S]), D = h?.enabled ?? !1, ee = h?.host ?? "localhost", te = h?.port ?? 8443;
|
|
2927
|
+
j(() => {
|
|
2928
|
+
!D && Ge() && u && !u.enabled && u.spaceId && !X && !se && (d(!0), Et(u.spaceId, je(u.authUrl)).then((V) => {
|
|
2929
|
+
pe(V.token);
|
|
2930
|
+
}).catch((V) => {
|
|
2931
|
+
be.error("Anonymous auth failed:", V), re(V instanceof Error ? V.message : "Anonymous auth failed");
|
|
2928
2932
|
}).finally(() => {
|
|
2929
|
-
|
|
2933
|
+
d(!1);
|
|
2930
2934
|
}));
|
|
2931
|
-
}, [
|
|
2932
|
-
const
|
|
2933
|
-
if (
|
|
2934
|
-
const
|
|
2935
|
+
}, [D, u, X, se]);
|
|
2936
|
+
const O = K(() => {
|
|
2937
|
+
if (D) {
|
|
2938
|
+
const P = x?.token ? xt(x.token) ?? void 0 : void 0;
|
|
2935
2939
|
return {
|
|
2936
2940
|
local: {
|
|
2937
|
-
host:
|
|
2938
|
-
httpsPort:
|
|
2939
|
-
userId:
|
|
2940
|
-
token:
|
|
2941
|
+
host: ee,
|
|
2942
|
+
httpsPort: te,
|
|
2943
|
+
userId: P,
|
|
2944
|
+
token: x?.token ?? void 0,
|
|
2941
2945
|
spaceId: u?.spaceId,
|
|
2942
2946
|
backendUrl: u?.backendUrl,
|
|
2943
2947
|
authUrl: u?.authUrl,
|
|
2944
|
-
parameters:
|
|
2948
|
+
parameters: A.parameters
|
|
2945
2949
|
}
|
|
2946
2950
|
};
|
|
2947
2951
|
}
|
|
2948
|
-
return
|
|
2952
|
+
return x?.token && u?.spaceId ? {
|
|
2949
2953
|
sessionToken: {
|
|
2950
|
-
token:
|
|
2954
|
+
token: x.token,
|
|
2951
2955
|
spaceId: u.spaceId,
|
|
2952
|
-
backendType:
|
|
2953
|
-
sessionId:
|
|
2954
|
-
channelKey:
|
|
2955
|
-
parameters:
|
|
2956
|
+
backendType: He(),
|
|
2957
|
+
sessionId: A.sessionId,
|
|
2958
|
+
channelKey: A.channelKey,
|
|
2959
|
+
parameters: A.parameters
|
|
2956
2960
|
}
|
|
2957
|
-
} :
|
|
2961
|
+
} : X && u?.spaceId ? {
|
|
2958
2962
|
sessionToken: {
|
|
2959
|
-
token:
|
|
2963
|
+
token: X,
|
|
2960
2964
|
spaceId: u.spaceId,
|
|
2961
|
-
backendType:
|
|
2962
|
-
sessionId:
|
|
2963
|
-
channelKey:
|
|
2964
|
-
parameters:
|
|
2965
|
+
backendType: He(),
|
|
2966
|
+
sessionId: A.sessionId,
|
|
2967
|
+
channelKey: A.channelKey,
|
|
2968
|
+
parameters: A.parameters
|
|
2965
2969
|
}
|
|
2966
|
-
} :
|
|
2970
|
+
} : Ge() ? null : {
|
|
2967
2971
|
local: {
|
|
2968
|
-
host:
|
|
2969
|
-
httpsPort:
|
|
2972
|
+
host: ee,
|
|
2973
|
+
httpsPort: te,
|
|
2970
2974
|
spaceId: u?.spaceId,
|
|
2971
2975
|
backendUrl: u?.backendUrl,
|
|
2972
2976
|
authUrl: u?.authUrl,
|
|
2973
|
-
parameters:
|
|
2977
|
+
parameters: A.parameters
|
|
2974
2978
|
}
|
|
2975
2979
|
};
|
|
2976
|
-
}, [
|
|
2977
|
-
|
|
2978
|
-
const
|
|
2979
|
-
|
|
2980
|
-
if (!
|
|
2981
|
-
if (
|
|
2982
|
-
for (const
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2980
|
+
}, [D, ee, te, x?.token, u?.spaceId, u?.backendUrl, u?.authUrl, X, A.sessionId, A.channelKey, A.parameters]);
|
|
2981
|
+
Xr(oe);
|
|
2982
|
+
const Z = Qr(oe);
|
|
2983
|
+
j(() => {
|
|
2984
|
+
if (!g.current) {
|
|
2985
|
+
if (g.current = !0, m.current = Kr(), r)
|
|
2986
|
+
for (const P of r)
|
|
2987
|
+
P(m.current);
|
|
2988
|
+
m.current.loadRegisteredModules().catch((P) => {
|
|
2989
|
+
be.error("Failed to load UI modules", P);
|
|
2986
2990
|
});
|
|
2987
2991
|
}
|
|
2988
|
-
}, []),
|
|
2989
|
-
if (!
|
|
2990
|
-
const
|
|
2991
|
-
...
|
|
2992
|
-
timeouts:
|
|
2993
|
-
audio:
|
|
2994
|
-
enabled:
|
|
2995
|
-
...
|
|
2992
|
+
}, []), j(() => {
|
|
2993
|
+
if (!O) return;
|
|
2994
|
+
const P = new Dt({
|
|
2995
|
+
...O,
|
|
2996
|
+
timeouts: I.current,
|
|
2997
|
+
audio: z.current !== void 0 || k.current ? {
|
|
2998
|
+
enabled: z.current,
|
|
2999
|
+
...k.current ? { background: { allowOnDesktop: !0, allowOnMobile: !0 } } : {}
|
|
2996
3000
|
} : void 0,
|
|
2997
|
-
video:
|
|
3001
|
+
video: J.current !== void 0 ? { enabled: J.current } : void 0,
|
|
2998
3002
|
mediaSession: { title: document.title || void 0, artist: document.title || void 0 },
|
|
2999
|
-
webRtc:
|
|
3000
|
-
websocket:
|
|
3001
|
-
webtransport:
|
|
3002
|
-
|
|
3003
|
-
|
|
3003
|
+
webRtc: U.current ? { enabled: !0 } : void 0,
|
|
3004
|
+
websocket: C.current,
|
|
3005
|
+
webtransport: _.current,
|
|
3006
|
+
proxy: L.current,
|
|
3007
|
+
onConnectionStateChange: (Q) => {
|
|
3008
|
+
B(Q);
|
|
3004
3009
|
},
|
|
3005
|
-
onError: (
|
|
3006
|
-
|
|
3010
|
+
onError: (Q) => {
|
|
3011
|
+
re(Q.message);
|
|
3007
3012
|
}
|
|
3008
3013
|
});
|
|
3009
|
-
p.current =
|
|
3010
|
-
const
|
|
3011
|
-
return
|
|
3012
|
-
|
|
3014
|
+
p.current = P;
|
|
3015
|
+
const V = new or({ client: P });
|
|
3016
|
+
return b.current = V, me(V), P.connect().catch((Q) => {
|
|
3017
|
+
be.error("Connection failed:", Q), Q instanceof Ft && !v.current && (v.current = !0, be.warn("Auth session appears stale, clearing and retrying"), y ? y.logout() : (ve(), T((Ot) => Ot + 1)));
|
|
3013
3018
|
}), () => {
|
|
3014
|
-
|
|
3019
|
+
P.disconnect(), p.current = null, V.dispose(), b.current = null;
|
|
3015
3020
|
};
|
|
3016
|
-
}, [
|
|
3017
|
-
const
|
|
3018
|
-
const
|
|
3019
|
-
p.current?.sendActionCall(
|
|
3020
|
-
}, []),
|
|
3021
|
+
}, [O]);
|
|
3022
|
+
const ie = F((P, V) => {
|
|
3023
|
+
const Q = typeof V == "string" ? V : JSON.stringify(V ?? {});
|
|
3024
|
+
p.current?.sendActionCall(P, Q);
|
|
3025
|
+
}, []), Te = N === "connected" || N === "reconnecting";
|
|
3021
3026
|
return {
|
|
3022
|
-
connectionState:
|
|
3023
|
-
error:
|
|
3024
|
-
stores:
|
|
3027
|
+
connectionState: N,
|
|
3028
|
+
error: W,
|
|
3029
|
+
stores: Z,
|
|
3025
3030
|
client: p.current,
|
|
3026
|
-
registry:
|
|
3031
|
+
registry: m.current,
|
|
3027
3032
|
clientRef: p,
|
|
3028
|
-
uiRef:
|
|
3029
|
-
registryRef:
|
|
3030
|
-
onAction:
|
|
3031
|
-
isReady:
|
|
3033
|
+
uiRef: b,
|
|
3034
|
+
registryRef: m,
|
|
3035
|
+
onAction: ie,
|
|
3036
|
+
isReady: Te,
|
|
3032
3037
|
webRtcVideoStreams: p.current?.webRtcVideoStreams ?? /* @__PURE__ */ new Map(),
|
|
3033
3038
|
webRtcTrackMap: p.current?.webRtcTrackMap ?? /* @__PURE__ */ new Map()
|
|
3034
3039
|
};
|
|
3035
3040
|
}
|
|
3036
|
-
function
|
|
3037
|
-
const e =
|
|
3038
|
-
return
|
|
3041
|
+
function Oo(t) {
|
|
3042
|
+
const e = w(!1);
|
|
3043
|
+
return F(() => {
|
|
3039
3044
|
if (e.current) return;
|
|
3040
3045
|
e.current = !0;
|
|
3041
3046
|
const r = document.createElement("link");
|
|
3042
3047
|
r.rel = "stylesheet", r.href = t, document.head.appendChild(r);
|
|
3043
3048
|
}, [t]);
|
|
3044
3049
|
}
|
|
3045
|
-
let
|
|
3046
|
-
function
|
|
3047
|
-
const [r, n] = G([]), o =
|
|
3050
|
+
let uo = 0;
|
|
3051
|
+
function _o(t = 5, e = 5e3) {
|
|
3052
|
+
const [r, n] = G([]), o = w(/* @__PURE__ */ new Map()), s = F((i) => {
|
|
3048
3053
|
const a = o.current.get(i);
|
|
3049
|
-
a && (clearTimeout(a), o.current.delete(i)), n((c) => c.filter((
|
|
3054
|
+
a && (clearTimeout(a), o.current.delete(i)), n((c) => c.filter((f) => f.id !== i));
|
|
3050
3055
|
}, []);
|
|
3051
|
-
return
|
|
3052
|
-
const i = o.current, a =
|
|
3056
|
+
return j(() => {
|
|
3057
|
+
const i = o.current, a = Bt(
|
|
3053
3058
|
(c) => {
|
|
3054
|
-
if (
|
|
3059
|
+
if (!$t())
|
|
3055
3060
|
return;
|
|
3056
|
-
const
|
|
3057
|
-
id:
|
|
3058
|
-
level:
|
|
3061
|
+
const f = `toast-${++uo}`, l = c.level === Je.ERROR ? "error" : "warn", u = {
|
|
3062
|
+
id: f,
|
|
3063
|
+
level: l,
|
|
3059
3064
|
message: c.message,
|
|
3060
3065
|
component: c.component
|
|
3061
3066
|
};
|
|
3062
|
-
n((
|
|
3063
|
-
const
|
|
3064
|
-
s(
|
|
3067
|
+
n((y) => [...y, u].slice(-t));
|
|
3068
|
+
const h = setTimeout(() => {
|
|
3069
|
+
s(f);
|
|
3065
3070
|
}, e);
|
|
3066
|
-
i.set(
|
|
3071
|
+
i.set(f, h);
|
|
3067
3072
|
},
|
|
3068
|
-
{ minLevel:
|
|
3073
|
+
{ minLevel: Je.WARN }
|
|
3069
3074
|
);
|
|
3070
3075
|
return () => {
|
|
3071
3076
|
a();
|
|
@@ -3075,100 +3080,100 @@ function Io(t = 5, e = 5e3) {
|
|
|
3075
3080
|
};
|
|
3076
3081
|
}, [t, e, s]), { toasts: r, dismissToast: s };
|
|
3077
3082
|
}
|
|
3078
|
-
const
|
|
3079
|
-
function
|
|
3083
|
+
const It = pt(null);
|
|
3084
|
+
function lo(t, e) {
|
|
3080
3085
|
return e ? t.replace(/\{(\w+)\}/g, (r, n) => e[n] ?? `{${n}}`) : t;
|
|
3081
3086
|
}
|
|
3082
|
-
function
|
|
3083
|
-
const r =
|
|
3087
|
+
function fo(t, e) {
|
|
3088
|
+
const r = Vt();
|
|
3084
3089
|
if (r && t.includes(r))
|
|
3085
3090
|
return r;
|
|
3086
3091
|
const n = navigator.language.split("-")[0];
|
|
3087
3092
|
return t.includes(n) ? n : e && t.includes(e) ? e : "en";
|
|
3088
3093
|
}
|
|
3089
|
-
function
|
|
3090
|
-
return e ?
|
|
3094
|
+
function ho(t, e, r) {
|
|
3095
|
+
return e ? fo(t, r) : r && t.includes(r) ? r : "en";
|
|
3091
3096
|
}
|
|
3092
|
-
function
|
|
3097
|
+
function No({
|
|
3093
3098
|
children: t,
|
|
3094
3099
|
translations: e,
|
|
3095
3100
|
defaultLanguage: r,
|
|
3096
3101
|
detectLanguage: n = !1
|
|
3097
3102
|
}) {
|
|
3098
|
-
const o = Object.keys(e), s =
|
|
3103
|
+
const o = Object.keys(e), s = ho(o, n, r), i = e[s] ?? e.en, a = K(
|
|
3099
3104
|
() => ({
|
|
3100
|
-
t: (c,
|
|
3101
|
-
const
|
|
3102
|
-
return
|
|
3105
|
+
t: (c, f) => {
|
|
3106
|
+
const l = i[c];
|
|
3107
|
+
return lo(l, f);
|
|
3103
3108
|
},
|
|
3104
3109
|
locale: s,
|
|
3105
3110
|
translations: i
|
|
3106
3111
|
}),
|
|
3107
3112
|
[i, s]
|
|
3108
3113
|
);
|
|
3109
|
-
return /* @__PURE__ */
|
|
3114
|
+
return /* @__PURE__ */ E.jsx(It, { value: a, children: t });
|
|
3110
3115
|
}
|
|
3111
|
-
function
|
|
3112
|
-
const t =
|
|
3116
|
+
function Po() {
|
|
3117
|
+
const t = Ve(It);
|
|
3113
3118
|
if (!t)
|
|
3114
3119
|
throw new Error("useI18n must be used within an I18nProvider");
|
|
3115
3120
|
return t;
|
|
3116
3121
|
}
|
|
3117
3122
|
export {
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3123
|
+
ko as AuthProvider,
|
|
3124
|
+
Co as ConnectionStateRenderer,
|
|
3125
|
+
No as I18nProvider,
|
|
3126
|
+
fr as IKON_UI_BASE_MODULE,
|
|
3127
|
+
Ar as IKON_UI_MEDIA_MODULE,
|
|
3128
|
+
Fr as IKON_UI_SHADERTOY_MODULE,
|
|
3129
|
+
xr as IKON_UI_SHADERTOY_TYPE,
|
|
3130
|
+
Le as IKON_UI_STREAM_CATEGORY,
|
|
3131
|
+
Sr as IKON_UI_VIDEO_CANVAS_TYPE,
|
|
3132
|
+
wr as IKON_UI_VIDEO_URL_PLAYER_TYPE,
|
|
3133
|
+
or as IkonUi,
|
|
3134
|
+
Vr as IkonUiRegistry,
|
|
3135
|
+
So as IkonUiSurface,
|
|
3136
|
+
rr as UiComponentRegistry,
|
|
3137
|
+
tr as UiRenderer,
|
|
3138
|
+
Uo as UiStreamStore,
|
|
3139
|
+
wo as areIkonUiModuleListsEqual,
|
|
3140
|
+
Et as authenticateAnonymous,
|
|
3141
|
+
Wn as buildOAuthRedirectUrl,
|
|
3142
|
+
ve as clearAuthSession,
|
|
3143
|
+
mt as clearOAuthParams,
|
|
3144
|
+
dr as createBaseResolvers,
|
|
3145
|
+
yo as createComponentLibrary,
|
|
3146
|
+
Kr as createIkonUiRegistry,
|
|
3147
|
+
Rr as createMediaResolvers,
|
|
3148
|
+
Dr as createShadertoyRendererResolver,
|
|
3149
|
+
nr as isIkonUiCategoryMatch,
|
|
3150
|
+
Rt as loadAuthSession,
|
|
3151
|
+
hr as loadBaseModule,
|
|
3152
|
+
kr as loadMediaModule,
|
|
3153
|
+
Br as loadShadertoyModule,
|
|
3154
|
+
yn as normalizeIkonUiModuleList,
|
|
3155
|
+
Ro as parseIkonUiInitPayload,
|
|
3156
|
+
Yn as parseOAuthCallback,
|
|
3157
|
+
zn as parseOAuthError,
|
|
3158
|
+
bn as readIkonUiModules,
|
|
3159
|
+
vo as readIkonUiModulesFromSources,
|
|
3160
|
+
mr as registerBaseModule,
|
|
3161
|
+
Tr as registerMediaModule,
|
|
3162
|
+
$r as registerShadertoyModule,
|
|
3163
|
+
Qt as renderChildren,
|
|
3164
|
+
Eo as renderMotionLetters,
|
|
3165
|
+
ke as saveAuthSession,
|
|
3166
|
+
Ao as sendMagicLink,
|
|
3167
|
+
fe as sessionToUser,
|
|
3168
|
+
so as useAuth,
|
|
3169
|
+
To as useAuthGuard,
|
|
3170
|
+
io as useAuthOptional,
|
|
3171
|
+
Po as useI18n,
|
|
3172
|
+
Io as useIkonApp,
|
|
3173
|
+
Xr as useIkonStyles,
|
|
3174
|
+
Qr as useIkonUiStores,
|
|
3175
|
+
Oo as useLazyFont,
|
|
3176
|
+
_o as useToasts,
|
|
3172
3177
|
H as useUiNode,
|
|
3173
|
-
|
|
3178
|
+
bo as useUiStore
|
|
3174
3179
|
};
|