@ikonai/sdk-react-ui 1.0.41 → 1.0.43
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 +1 -1
- package/index.d.ts +1 -1
- package/index.js +1424 -1334
- package/package.json +1 -1
- package/renderer/index.d.ts +1 -1
- package/renderer/types.d.ts +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 ge = { exports: {} },
|
|
1
|
+
import { IkonUiCore as jt, UiStreamStore as Ut } from "@ikonai/sdk-ui";
|
|
2
|
+
import { UiStreamStore as Jo } from "@ikonai/sdk-ui";
|
|
3
|
+
import Dt, { useSyncExternalStore as Ke, useMemo as K, memo as z, useRef as v, useCallback as D, Fragment as Bt, useEffect as N, useState as Y, createContext as yt, use as Ye } from "react";
|
|
4
|
+
import { createLogger as ke, isInspectModeEnabled as Ft, getOrCreateDeviceId as $t, deriveAuthUrl as xe, parseUrlParams as Vt, clearSessionParamsFromUrl as Kt, isCloudEnvironment as Je, extractUserIdFromToken as Yt, deriveBackendType as Xe, IkonClient as zt, AccessDeniedError as Wt, AuthenticationError as qt, subscribeToLogEvents as Ht, isDebugModeEnabled as Gt, LogLevel as Ze, getLangParam as Jt } from "@ikonai/sdk";
|
|
5
|
+
var ge = { exports: {} }, ae = {};
|
|
6
6
|
/**
|
|
7
7
|
* @license React
|
|
8
8
|
* react-jsx-runtime.production.js
|
|
@@ -12,12 +12,12 @@ var ge = { 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 Qe;
|
|
16
|
+
function Xt() {
|
|
17
|
+
if (Qe) return ae;
|
|
18
|
+
Qe = 1;
|
|
19
19
|
var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
|
|
20
|
-
function r
|
|
20
|
+
function n(r, o, s) {
|
|
21
21
|
var i = null;
|
|
22
22
|
if (s !== void 0 && (i = "" + s), o.key !== void 0 && (i = "" + o.key), "key" in o) {
|
|
23
23
|
s = {};
|
|
@@ -26,15 +26,15 @@ function qt() {
|
|
|
26
26
|
} else s = o;
|
|
27
27
|
return o = s.ref, {
|
|
28
28
|
$$typeof: t,
|
|
29
|
-
type:
|
|
29
|
+
type: r,
|
|
30
30
|
key: i,
|
|
31
31
|
ref: o !== void 0 ? o : null,
|
|
32
32
|
props: s
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
return
|
|
35
|
+
return ae.Fragment = e, ae.jsx = n, ae.jsxs = n, ae;
|
|
36
36
|
}
|
|
37
|
-
var
|
|
37
|
+
var ce = {};
|
|
38
38
|
/**
|
|
39
39
|
* @license React
|
|
40
40
|
* react-jsx-runtime.development.js
|
|
@@ -44,274 +44,274 @@ 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 (
|
|
47
|
+
var et;
|
|
48
|
+
function Zt() {
|
|
49
|
+
return et || (et = 1, process.env.NODE_ENV !== "production" && function() {
|
|
50
|
+
function t(h) {
|
|
51
|
+
if (h == null) return null;
|
|
52
|
+
if (typeof h == "function")
|
|
53
|
+
return h.$$typeof === U ? null : h.displayName || h.name || null;
|
|
54
|
+
if (typeof h == "string") return h;
|
|
55
|
+
switch (h) {
|
|
56
56
|
case b:
|
|
57
57
|
return "Fragment";
|
|
58
58
|
case y:
|
|
59
59
|
return "Profiler";
|
|
60
60
|
case g:
|
|
61
61
|
return "StrictMode";
|
|
62
|
-
case
|
|
62
|
+
case _:
|
|
63
63
|
return "Suspense";
|
|
64
|
-
case
|
|
64
|
+
case B:
|
|
65
65
|
return "SuspenseList";
|
|
66
|
-
case
|
|
66
|
+
case P:
|
|
67
67
|
return "Activity";
|
|
68
68
|
}
|
|
69
|
-
if (typeof
|
|
70
|
-
switch (typeof
|
|
69
|
+
if (typeof h == "object")
|
|
70
|
+
switch (typeof h.tag == "number" && console.error(
|
|
71
71
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
72
|
-
),
|
|
72
|
+
), h.$$typeof) {
|
|
73
73
|
case m:
|
|
74
74
|
return "Portal";
|
|
75
|
-
case E:
|
|
76
|
-
return (f.displayName || "Context") + ".Provider";
|
|
77
|
-
case v:
|
|
78
|
-
return (f._context.displayName || "Context") + ".Consumer";
|
|
79
75
|
case T:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
return S = f.displayName || null, S !== null ? S : t(f.type) || "Memo";
|
|
76
|
+
return (h.displayName || "Context") + ".Provider";
|
|
77
|
+
case w:
|
|
78
|
+
return (h._context.displayName || "Context") + ".Consumer";
|
|
84
79
|
case C:
|
|
85
|
-
S =
|
|
80
|
+
var S = h.render;
|
|
81
|
+
return h = h.displayName, h || (h = S.displayName || S.name || "", h = h !== "" ? "ForwardRef(" + h + ")" : "ForwardRef"), h;
|
|
82
|
+
case Q:
|
|
83
|
+
return S = h.displayName || null, S !== null ? S : t(h.type) || "Memo";
|
|
84
|
+
case A:
|
|
85
|
+
S = h._payload, h = h._init;
|
|
86
86
|
try {
|
|
87
|
-
return t(
|
|
87
|
+
return t(h(S));
|
|
88
88
|
} catch {
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
return null;
|
|
92
92
|
}
|
|
93
|
-
function e(
|
|
94
|
-
return "" +
|
|
93
|
+
function e(h) {
|
|
94
|
+
return "" + h;
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function n(h) {
|
|
97
97
|
try {
|
|
98
|
-
e(
|
|
98
|
+
e(h);
|
|
99
99
|
var S = !1;
|
|
100
100
|
} catch {
|
|
101
101
|
S = !0;
|
|
102
102
|
}
|
|
103
103
|
if (S) {
|
|
104
104
|
S = console;
|
|
105
|
-
var
|
|
106
|
-
return
|
|
105
|
+
var k = S.error, L = typeof Symbol == "function" && Symbol.toStringTag && h[Symbol.toStringTag] || h.constructor.name || "Object";
|
|
106
|
+
return k.call(
|
|
107
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
|
+
L
|
|
110
|
+
), e(h);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
function
|
|
114
|
-
if (
|
|
115
|
-
if (typeof
|
|
113
|
+
function r(h) {
|
|
114
|
+
if (h === b) return "<>";
|
|
115
|
+
if (typeof h == "object" && h !== null && h.$$typeof === A)
|
|
116
116
|
return "<...>";
|
|
117
117
|
try {
|
|
118
|
-
var S = t(
|
|
118
|
+
var S = t(h);
|
|
119
119
|
return S ? "<" + S + ">" : "<...>";
|
|
120
120
|
} catch {
|
|
121
121
|
return "<...>";
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
function o() {
|
|
125
|
-
var
|
|
126
|
-
return
|
|
125
|
+
var h = M.A;
|
|
126
|
+
return h === null ? null : h.getOwner();
|
|
127
127
|
}
|
|
128
128
|
function s() {
|
|
129
129
|
return Error("react-stack-top-frame");
|
|
130
130
|
}
|
|
131
|
-
function i(
|
|
132
|
-
if (F.call(
|
|
133
|
-
var S = Object.getOwnPropertyDescriptor(
|
|
131
|
+
function i(h) {
|
|
132
|
+
if (F.call(h, "key")) {
|
|
133
|
+
var S = Object.getOwnPropertyDescriptor(h, "key").get;
|
|
134
134
|
if (S && S.isReactWarning) return !1;
|
|
135
135
|
}
|
|
136
|
-
return
|
|
136
|
+
return h.key !== void 0;
|
|
137
137
|
}
|
|
138
|
-
function a(
|
|
139
|
-
function
|
|
140
|
-
|
|
138
|
+
function a(h, S) {
|
|
139
|
+
function k() {
|
|
140
|
+
pe || (pe = !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
|
+
k.isReactWarning = !0, Object.defineProperty(h, "key", {
|
|
146
|
+
get: k,
|
|
147
147
|
configurable: !0
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
150
|
function c() {
|
|
151
|
-
var
|
|
152
|
-
return
|
|
151
|
+
var h = t(this.type);
|
|
152
|
+
return he[h] || (he[h] = !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
|
+
)), h = this.props.ref, h !== void 0 ? h : null;
|
|
155
155
|
}
|
|
156
|
-
function h
|
|
157
|
-
return
|
|
158
|
-
$$typeof:
|
|
159
|
-
type:
|
|
156
|
+
function p(h, S, k, L, q, I, H, te) {
|
|
157
|
+
return k = I.ref, h = {
|
|
158
|
+
$$typeof: d,
|
|
159
|
+
type: h,
|
|
160
160
|
key: S,
|
|
161
161
|
props: I,
|
|
162
|
-
_owner:
|
|
163
|
-
}, (
|
|
162
|
+
_owner: q
|
|
163
|
+
}, (k !== void 0 ? k : null) !== null ? Object.defineProperty(h, "ref", {
|
|
164
164
|
enumerable: !1,
|
|
165
165
|
get: c
|
|
166
|
-
}) : Object.defineProperty(
|
|
166
|
+
}) : Object.defineProperty(h, "ref", { enumerable: !1, value: null }), h._store = {}, Object.defineProperty(h._store, "validated", {
|
|
167
167
|
configurable: !1,
|
|
168
168
|
enumerable: !1,
|
|
169
169
|
writable: !0,
|
|
170
170
|
value: 0
|
|
171
|
-
}), Object.defineProperty(
|
|
171
|
+
}), Object.defineProperty(h, "_debugInfo", {
|
|
172
172
|
configurable: !1,
|
|
173
173
|
enumerable: !1,
|
|
174
174
|
writable: !0,
|
|
175
175
|
value: null
|
|
176
|
-
}), Object.defineProperty(
|
|
176
|
+
}), Object.defineProperty(h, "_debugStack", {
|
|
177
177
|
configurable: !1,
|
|
178
178
|
enumerable: !1,
|
|
179
179
|
writable: !0,
|
|
180
|
-
value:
|
|
181
|
-
}), Object.defineProperty(
|
|
180
|
+
value: H
|
|
181
|
+
}), Object.defineProperty(h, "_debugTask", {
|
|
182
182
|
configurable: !1,
|
|
183
183
|
enumerable: !1,
|
|
184
184
|
writable: !0,
|
|
185
185
|
value: te
|
|
186
|
-
}), Object.freeze && (Object.freeze(
|
|
186
|
+
}), Object.freeze && (Object.freeze(h.props), Object.freeze(h)), h;
|
|
187
187
|
}
|
|
188
|
-
function
|
|
189
|
-
var
|
|
190
|
-
if (
|
|
191
|
-
if (
|
|
192
|
-
if (
|
|
193
|
-
for (
|
|
194
|
-
l(
|
|
195
|
-
Object.freeze && Object.freeze(
|
|
188
|
+
function f(h, S, k, L, q, I, H, te) {
|
|
189
|
+
var O = S.children;
|
|
190
|
+
if (O !== void 0)
|
|
191
|
+
if (L)
|
|
192
|
+
if (W(O)) {
|
|
193
|
+
for (L = 0; L < O.length; L++)
|
|
194
|
+
l(O[L]);
|
|
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 l(
|
|
200
|
+
else l(O);
|
|
201
201
|
if (F.call(S, "key")) {
|
|
202
|
-
|
|
203
|
-
var G = Object.keys(S).filter(function(
|
|
204
|
-
return
|
|
202
|
+
O = t(h);
|
|
203
|
+
var G = Object.keys(S).filter(function(Ce) {
|
|
204
|
+
return Ce !== "key";
|
|
205
205
|
});
|
|
206
|
-
|
|
206
|
+
L = 0 < G.length ? "{key: someKey, " + G.join(": ..., ") + ": ...}" : "{key: someKey}", ee[O + L] || (G = 0 < G.length ? "{" + G.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
|
-
|
|
213
|
+
L,
|
|
214
|
+
O,
|
|
215
215
|
G,
|
|
216
|
-
|
|
217
|
-
), ee[
|
|
216
|
+
O
|
|
217
|
+
), ee[O + L] = !0);
|
|
218
218
|
}
|
|
219
|
-
if (
|
|
220
|
-
|
|
221
|
-
for (var
|
|
222
|
-
|
|
223
|
-
} else
|
|
224
|
-
return
|
|
225
|
-
|
|
226
|
-
typeof
|
|
227
|
-
),
|
|
228
|
-
|
|
229
|
-
|
|
219
|
+
if (O = null, k !== void 0 && (n(k), O = "" + k), i(S) && (n(S.key), O = "" + S.key), "key" in S) {
|
|
220
|
+
k = {};
|
|
221
|
+
for (var ne in S)
|
|
222
|
+
ne !== "key" && (k[ne] = S[ne]);
|
|
223
|
+
} else k = S;
|
|
224
|
+
return O && a(
|
|
225
|
+
k,
|
|
226
|
+
typeof h == "function" ? h.displayName || h.name || "Unknown" : h
|
|
227
|
+
), p(
|
|
228
|
+
h,
|
|
229
|
+
O,
|
|
230
230
|
I,
|
|
231
|
-
W,
|
|
232
|
-
o(),
|
|
233
|
-
A,
|
|
234
231
|
q,
|
|
232
|
+
o(),
|
|
233
|
+
k,
|
|
234
|
+
H,
|
|
235
235
|
te
|
|
236
236
|
);
|
|
237
237
|
}
|
|
238
|
-
function l(
|
|
239
|
-
typeof
|
|
238
|
+
function l(h) {
|
|
239
|
+
typeof h == "object" && h !== null && h.$$typeof === d && h._store && (h._store.validated = 1);
|
|
240
240
|
}
|
|
241
|
-
var u =
|
|
241
|
+
var u = Dt, d = Symbol.for("react.transitional.element"), m = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), g = Symbol.for("react.strict_mode"), y = Symbol.for("react.profiler"), w = Symbol.for("react.consumer"), T = Symbol.for("react.context"), C = Symbol.for("react.forward_ref"), _ = Symbol.for("react.suspense"), B = Symbol.for("react.suspense_list"), Q = Symbol.for("react.memo"), A = Symbol.for("react.lazy"), P = Symbol.for("react.activity"), U = Symbol.for("react.client.reference"), M = u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, F = Object.prototype.hasOwnProperty, W = Array.isArray, re = console.createTask ? console.createTask : function() {
|
|
242
242
|
return null;
|
|
243
243
|
};
|
|
244
244
|
u = {
|
|
245
|
-
"react-stack-bottom-frame": function(
|
|
246
|
-
return
|
|
245
|
+
"react-stack-bottom-frame": function(h) {
|
|
246
|
+
return h();
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
|
-
var
|
|
249
|
+
var pe, he = {}, ie = u["react-stack-bottom-frame"].bind(
|
|
250
250
|
u,
|
|
251
251
|
s
|
|
252
|
-
)(), me =
|
|
253
|
-
|
|
254
|
-
var I = 1e4 >
|
|
255
|
-
return
|
|
256
|
-
|
|
252
|
+
)(), me = re(r(s)), ee = {};
|
|
253
|
+
ce.Fragment = b, ce.jsx = function(h, S, k, L, q) {
|
|
254
|
+
var I = 1e4 > M.recentlyCreatedOwnerStacks++;
|
|
255
|
+
return f(
|
|
256
|
+
h,
|
|
257
257
|
S,
|
|
258
|
-
|
|
258
|
+
k,
|
|
259
259
|
!1,
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
I ? Error("react-stack-top-frame") :
|
|
263
|
-
I ?
|
|
260
|
+
L,
|
|
261
|
+
q,
|
|
262
|
+
I ? Error("react-stack-top-frame") : ie,
|
|
263
|
+
I ? re(r(h)) : me
|
|
264
264
|
);
|
|
265
|
-
},
|
|
266
|
-
var I = 1e4 >
|
|
267
|
-
return
|
|
268
|
-
|
|
265
|
+
}, ce.jsxs = function(h, S, k, L, q) {
|
|
266
|
+
var I = 1e4 > M.recentlyCreatedOwnerStacks++;
|
|
267
|
+
return f(
|
|
268
|
+
h,
|
|
269
269
|
S,
|
|
270
|
-
|
|
270
|
+
k,
|
|
271
271
|
!0,
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
I ? Error("react-stack-top-frame") :
|
|
275
|
-
I ?
|
|
272
|
+
L,
|
|
273
|
+
q,
|
|
274
|
+
I ? Error("react-stack-top-frame") : ie,
|
|
275
|
+
I ? re(r(h)) : me
|
|
276
276
|
);
|
|
277
277
|
};
|
|
278
|
-
}()),
|
|
278
|
+
}()), ce;
|
|
279
279
|
}
|
|
280
|
-
var
|
|
281
|
-
function
|
|
282
|
-
return
|
|
280
|
+
var tt;
|
|
281
|
+
function Qt() {
|
|
282
|
+
return tt || (tt = 1, process.env.NODE_ENV === "production" ? ge.exports = Xt() : ge.exports = Zt()), ge.exports;
|
|
283
283
|
}
|
|
284
|
-
var
|
|
285
|
-
function
|
|
286
|
-
const
|
|
287
|
-
(
|
|
284
|
+
var E = Qt();
|
|
285
|
+
function en(t, e) {
|
|
286
|
+
const n = Ke(
|
|
287
|
+
(r) => t.subscribe(r),
|
|
288
288
|
() => {
|
|
289
|
-
const
|
|
289
|
+
const r = t.getSnapshot(), o = e ?? r.rootViewId, s = o ? r.views.get(o) : void 0;
|
|
290
290
|
return `${o ?? ""}:${s?.id ?? ""}`;
|
|
291
291
|
},
|
|
292
292
|
() => {
|
|
293
|
-
const
|
|
293
|
+
const r = t.getSnapshot(), o = e ?? r.rootViewId, s = o ? r.views.get(o) : void 0;
|
|
294
294
|
return `${o ?? ""}:${s?.id ?? ""}`;
|
|
295
295
|
}
|
|
296
296
|
);
|
|
297
|
-
return
|
|
298
|
-
const [
|
|
297
|
+
return K(() => {
|
|
298
|
+
const [r, o] = n.split(":");
|
|
299
299
|
return {
|
|
300
|
-
rootViewId:
|
|
300
|
+
rootViewId: r || void 0,
|
|
301
301
|
rootNodeId: o || void 0
|
|
302
302
|
};
|
|
303
|
-
}, [
|
|
303
|
+
}, [n]);
|
|
304
304
|
}
|
|
305
305
|
function Z(t, e) {
|
|
306
|
-
const
|
|
307
|
-
(
|
|
306
|
+
const n = Ke(
|
|
307
|
+
(r) => t.subscribeNode(e, r),
|
|
308
308
|
() => t.getNodeVersion(e),
|
|
309
309
|
() => t.getNodeVersion(e)
|
|
310
310
|
);
|
|
311
|
-
return
|
|
311
|
+
return K(() => t.getNode(e), [t, e, n]);
|
|
312
312
|
}
|
|
313
|
-
const
|
|
314
|
-
function
|
|
313
|
+
const tn = ke("UIRenderer");
|
|
314
|
+
function nn(t) {
|
|
315
315
|
if (t === void 0)
|
|
316
316
|
return "{}";
|
|
317
317
|
if (typeof t == "string")
|
|
@@ -322,72 +322,72 @@ function Zt(t) {
|
|
|
322
322
|
return "{}";
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
|
-
function
|
|
325
|
+
function rn(t) {
|
|
326
326
|
const e = t.styleIds;
|
|
327
327
|
return Array.isArray(e) ? e : [];
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function on(t) {
|
|
330
330
|
const e = t.children;
|
|
331
331
|
return Array.isArray(e) ? e : [];
|
|
332
332
|
}
|
|
333
|
-
function
|
|
333
|
+
function sn(t, e) {
|
|
334
334
|
return t.nodeId === e.nodeId && t.context === e.context;
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function an(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;
|
|
340
|
-
for (let
|
|
341
|
-
e += "," + t[
|
|
340
|
+
for (let n = 1; n < t.length; n++)
|
|
341
|
+
e += "," + t[n].id;
|
|
342
342
|
return e;
|
|
343
343
|
}
|
|
344
|
-
const je =
|
|
345
|
-
const
|
|
346
|
-
() => o.length === 0 ? null : o.map((l) => /* @__PURE__ */
|
|
344
|
+
const je = z(function t({ nodeId: e, context: n }) {
|
|
345
|
+
const r = Z(n.store, e), o = r ? on(r) : [], s = an(o), i = K(
|
|
346
|
+
() => o.length === 0 ? null : o.map((l) => /* @__PURE__ */ E.jsx(t, { nodeId: l.id, context: n }, l.id)),
|
|
347
347
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
348
|
-
[s,
|
|
348
|
+
[s, n]
|
|
349
349
|
);
|
|
350
|
-
if (!
|
|
350
|
+
if (!r)
|
|
351
351
|
return null;
|
|
352
|
-
if (
|
|
353
|
-
return /* @__PURE__ */
|
|
354
|
-
const a =
|
|
352
|
+
if (r.type === "root")
|
|
353
|
+
return /* @__PURE__ */ E.jsx(Bt, { children: i }, r.id);
|
|
354
|
+
const a = n.library.resolve(r);
|
|
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((
|
|
362
|
-
}
|
|
363
|
-
function
|
|
356
|
+
return tn.warn(`No renderer for node type ${r.type}`), null;
|
|
357
|
+
const c = rn(r), p = c.length > 0 ? c.join(" ") : void 0, f = a;
|
|
358
|
+
return /* @__PURE__ */ E.jsx(f, { nodeId: e, context: n, className: p });
|
|
359
|
+
}, sn);
|
|
360
|
+
function cn(t, e) {
|
|
361
|
+
return !Array.isArray(t) || t.length === 0 ? null : t.map((n) => /* @__PURE__ */ E.jsx(je, { nodeId: n.id, context: e }, n.id));
|
|
362
|
+
}
|
|
363
|
+
function un(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 l =
|
|
366
|
+
const ln = z(function({ store: e, library: n, viewId: r, emptyFallback: o = null, onAction: s, client: i, video: a }) {
|
|
367
|
+
const { rootViewId: c, rootNodeId: p } = en(e, r), f = v(s);
|
|
368
|
+
f.current = s;
|
|
369
|
+
const l = v(i);
|
|
370
370
|
l.current = i;
|
|
371
|
-
const u =
|
|
371
|
+
const u = v(a);
|
|
372
372
|
u.current = a;
|
|
373
|
-
const
|
|
373
|
+
const d = D((b, g) => {
|
|
374
374
|
if (!b)
|
|
375
375
|
return;
|
|
376
|
-
const y =
|
|
377
|
-
|
|
378
|
-
}, []), m =
|
|
376
|
+
const y = nn(g);
|
|
377
|
+
f.current?.(b, y);
|
|
378
|
+
}, []), m = K(() => {
|
|
379
379
|
const b = {
|
|
380
380
|
store: e,
|
|
381
|
-
library:
|
|
381
|
+
library: n,
|
|
382
382
|
handlerCache: e.handlerCache,
|
|
383
383
|
// Access payloads from store at call time, not captured snapshot
|
|
384
384
|
getPayload: (g) => e.getSnapshot().payloads.get(g),
|
|
385
|
-
renderChildren: (g) =>
|
|
385
|
+
renderChildren: (g) => cn(g, b),
|
|
386
386
|
renderView: (g) => {
|
|
387
387
|
const y = e.getSnapshot().views.get(g);
|
|
388
|
-
return y ? /* @__PURE__ */
|
|
388
|
+
return y ? /* @__PURE__ */ E.jsx(je, { nodeId: y.id, context: b }) : null;
|
|
389
389
|
},
|
|
390
|
-
dispatchAction:
|
|
390
|
+
dispatchAction: d,
|
|
391
391
|
// Access client/video via refs to avoid context recreation
|
|
392
392
|
get client() {
|
|
393
393
|
return l.current;
|
|
@@ -397,18 +397,18 @@ const sr = Y(function({ store: e, library: r, viewId: n, emptyFallback: o = null
|
|
|
397
397
|
}
|
|
398
398
|
};
|
|
399
399
|
return b;
|
|
400
|
-
}, [e,
|
|
401
|
-
return !c || !
|
|
402
|
-
},
|
|
403
|
-
class
|
|
404
|
-
constructor(e,
|
|
405
|
-
if (this.fallback =
|
|
406
|
-
for (const [
|
|
407
|
-
this.renderers.set(
|
|
400
|
+
}, [e, n, d]);
|
|
401
|
+
return !c || !p ? o : /* @__PURE__ */ E.jsx("div", { "data-ikon-view-id": c, style: { display: "contents" }, children: /* @__PURE__ */ E.jsx(je, { nodeId: p, context: m }) });
|
|
402
|
+
}, un);
|
|
403
|
+
class dn {
|
|
404
|
+
constructor(e, n) {
|
|
405
|
+
if (this.fallback = n, e)
|
|
406
|
+
for (const [r, o] of e)
|
|
407
|
+
this.renderers.set(r, o);
|
|
408
408
|
}
|
|
409
409
|
renderers = /* @__PURE__ */ new Map();
|
|
410
|
-
register(e,
|
|
411
|
-
this.renderers.set(e,
|
|
410
|
+
register(e, n) {
|
|
411
|
+
this.renderers.set(e, n);
|
|
412
412
|
}
|
|
413
413
|
setFallback(e) {
|
|
414
414
|
this.fallback = e;
|
|
@@ -417,103 +417,103 @@ class ir {
|
|
|
417
417
|
return this.renderers.get(e.type) ?? this.fallback;
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
|
-
function
|
|
421
|
-
const
|
|
422
|
-
return new
|
|
420
|
+
function Po(t, e) {
|
|
421
|
+
const n = Object.entries(t);
|
|
422
|
+
return new dn(n, e);
|
|
423
423
|
}
|
|
424
|
-
function
|
|
425
|
-
return
|
|
424
|
+
function Mo(t) {
|
|
425
|
+
return Ke(
|
|
426
426
|
(e) => t.subscribe(e),
|
|
427
427
|
() => t.getSnapshot(),
|
|
428
428
|
() => t.getSnapshot()
|
|
429
429
|
);
|
|
430
430
|
}
|
|
431
|
-
function
|
|
432
|
-
const t =
|
|
433
|
-
return
|
|
431
|
+
function fn() {
|
|
432
|
+
const t = Ft();
|
|
433
|
+
return N(() => {
|
|
434
434
|
if (!t)
|
|
435
435
|
return;
|
|
436
|
-
let e = null,
|
|
437
|
-
const
|
|
438
|
-
|
|
436
|
+
let e = null, n = [];
|
|
437
|
+
const r = document.createElement("div");
|
|
438
|
+
r.style.cssText = "position:fixed;z-index:99999;pointer-events:none;padding:2px 6px;background:#1e1e2e;color:#cdd6f4;font-size:11px;border-radius:4px;border:1px solid #45475a;white-space:nowrap;display:none;font-family:monospace;", document.body.appendChild(r);
|
|
439
439
|
function o() {
|
|
440
|
-
e && !
|
|
440
|
+
e && !n.includes(e) && (e.style.outline = "", e.style.outlineOffset = ""), e = null, r.style.display = "none";
|
|
441
441
|
}
|
|
442
442
|
function s(u) {
|
|
443
|
-
for (const m of
|
|
443
|
+
for (const m of n)
|
|
444
444
|
m !== e && (m.style.outline = "", m.style.outlineOffset = "");
|
|
445
|
-
|
|
446
|
-
const
|
|
445
|
+
n = [];
|
|
446
|
+
const d = new Set(u);
|
|
447
447
|
for (const m of document.querySelectorAll("[data-ikon-source]")) {
|
|
448
448
|
const b = m.getAttribute("data-ikon-source") ?? "";
|
|
449
|
-
|
|
449
|
+
d.has(b) && (m.style.outline = "2px solid #a6e3a1", m.style.outlineOffset = "1px", n.push(m));
|
|
450
450
|
}
|
|
451
451
|
}
|
|
452
452
|
function i(u) {
|
|
453
|
-
const
|
|
454
|
-
if (!
|
|
453
|
+
const d = u.target.closest?.("[data-ikon-source]");
|
|
454
|
+
if (!d || d === e)
|
|
455
455
|
return;
|
|
456
|
-
o(), e =
|
|
457
|
-
const m =
|
|
458
|
-
|
|
459
|
-
const b =
|
|
460
|
-
|
|
456
|
+
o(), e = d, e.style.outline = "2px solid #89b4fa", e.style.outlineOffset = "1px";
|
|
457
|
+
const m = d.getAttribute("data-ikon-source") ?? "";
|
|
458
|
+
r.textContent = m, r.style.display = "block";
|
|
459
|
+
const b = d.getBoundingClientRect();
|
|
460
|
+
r.style.left = `${b.left}px`, r.style.top = `${Math.max(0, b.top - 24)}px`;
|
|
461
461
|
}
|
|
462
462
|
function a(u) {
|
|
463
463
|
u.relatedTarget?.closest?.("[data-ikon-source]") !== e && o();
|
|
464
464
|
}
|
|
465
465
|
function c(u) {
|
|
466
|
-
const
|
|
467
|
-
if (!
|
|
466
|
+
const d = u.target.closest?.("[data-ikon-source]");
|
|
467
|
+
if (!d)
|
|
468
468
|
return;
|
|
469
469
|
u.preventDefault(), u.stopPropagation();
|
|
470
470
|
const m = {
|
|
471
|
-
sourceMarker:
|
|
472
|
-
tagName:
|
|
473
|
-
textContent: (
|
|
471
|
+
sourceMarker: d.getAttribute("data-ikon-source") ?? "",
|
|
472
|
+
tagName: d.tagName.toLowerCase(),
|
|
473
|
+
textContent: (d.textContent ?? "").trim().substring(0, 200)
|
|
474
474
|
};
|
|
475
475
|
window.dispatchEvent(new CustomEvent("ikon-inspect-select", { detail: m })), window.parent.postMessage({ type: "ikon-element-selected", payload: m }, "*");
|
|
476
476
|
}
|
|
477
|
-
function
|
|
478
|
-
return document.elementFromPoint(u,
|
|
477
|
+
function p(u, d) {
|
|
478
|
+
return document.elementFromPoint(u, d)?.closest?.("[data-ikon-source]");
|
|
479
479
|
}
|
|
480
|
-
function
|
|
480
|
+
function f(u) {
|
|
481
481
|
if (u === e || (o(), !u))
|
|
482
482
|
return;
|
|
483
|
-
e = u, e.style.outline = `2px solid ${
|
|
484
|
-
const
|
|
485
|
-
|
|
483
|
+
e = u, e.style.outline = `2px solid ${n.includes(u) ? "#a6e3a1" : "#89b4fa"}`, e.style.outlineOffset = "1px";
|
|
484
|
+
const d = u.getAttribute("data-ikon-source") ?? "";
|
|
485
|
+
r.textContent = d, r.style.display = "block";
|
|
486
486
|
const m = u.getBoundingClientRect();
|
|
487
|
-
|
|
487
|
+
r.style.left = `${m.left}px`, r.style.top = `${Math.max(0, m.top - 24)}px`;
|
|
488
488
|
}
|
|
489
489
|
function l(u) {
|
|
490
490
|
if (u.data?.type === "ikon-inspect-at") {
|
|
491
|
-
const
|
|
492
|
-
d
|
|
493
|
-
const m =
|
|
491
|
+
const d = p(u.data.x, u.data.y);
|
|
492
|
+
f(d);
|
|
493
|
+
const m = d?.getAttribute("data-ikon-source") ?? "";
|
|
494
494
|
window.parent.postMessage({
|
|
495
495
|
type: "ikon-inspect-hover-result",
|
|
496
496
|
payload: { sourceMarker: m }
|
|
497
497
|
}, "*");
|
|
498
498
|
}
|
|
499
499
|
if (u.data?.type === "ikon-inspect-click") {
|
|
500
|
-
const
|
|
501
|
-
if (
|
|
500
|
+
const d = p(u.data.x, u.data.y);
|
|
501
|
+
if (d) {
|
|
502
502
|
const m = {
|
|
503
|
-
sourceMarker:
|
|
504
|
-
tagName:
|
|
505
|
-
textContent: (
|
|
503
|
+
sourceMarker: d.getAttribute("data-ikon-source") ?? "",
|
|
504
|
+
tagName: d.tagName.toLowerCase(),
|
|
505
|
+
textContent: (d.textContent ?? "").trim().substring(0, 200)
|
|
506
506
|
};
|
|
507
507
|
window.dispatchEvent(new CustomEvent("ikon-inspect-select", { detail: m })), window.parent.postMessage({ type: "ikon-element-selected", payload: m }, "*");
|
|
508
508
|
}
|
|
509
509
|
}
|
|
510
510
|
if (u.data?.type === "ikon-inspect-click-add") {
|
|
511
|
-
const
|
|
512
|
-
if (
|
|
511
|
+
const d = p(u.data.x, u.data.y);
|
|
512
|
+
if (d) {
|
|
513
513
|
const m = {
|
|
514
|
-
sourceMarker:
|
|
515
|
-
tagName:
|
|
516
|
-
textContent: (
|
|
514
|
+
sourceMarker: d.getAttribute("data-ikon-source") ?? "",
|
|
515
|
+
tagName: d.tagName.toLowerCase(),
|
|
516
|
+
textContent: (d.textContent ?? "").trim().substring(0, 200)
|
|
517
517
|
};
|
|
518
518
|
window.parent.postMessage({
|
|
519
519
|
type: "ikon-inspect-rect-result",
|
|
@@ -522,54 +522,54 @@ function ar() {
|
|
|
522
522
|
}
|
|
523
523
|
}
|
|
524
524
|
if (u.data?.type === "ikon-inspect-rect") {
|
|
525
|
-
const { x1:
|
|
526
|
-
for (const
|
|
527
|
-
const
|
|
528
|
-
|
|
529
|
-
sourceMarker:
|
|
530
|
-
tagName:
|
|
531
|
-
textContent: (
|
|
525
|
+
const { x1: d, y1: m, x2: b, y2: g, append: y } = u.data, w = document.querySelectorAll("[data-ikon-source]"), T = [];
|
|
526
|
+
for (const C of w) {
|
|
527
|
+
const _ = C.getBoundingClientRect();
|
|
528
|
+
_.right > d && _.left < b && _.bottom > m && _.top < g && T.push({
|
|
529
|
+
sourceMarker: C.getAttribute("data-ikon-source") ?? "",
|
|
530
|
+
tagName: C.tagName.toLowerCase(),
|
|
531
|
+
textContent: (C.textContent ?? "").trim().substring(0, 200)
|
|
532
532
|
});
|
|
533
533
|
}
|
|
534
|
-
|
|
534
|
+
T.length > 0 && window.parent.postMessage({
|
|
535
535
|
type: "ikon-inspect-rect-result",
|
|
536
|
-
payload: { elements:
|
|
536
|
+
payload: { elements: T, append: y ?? !1 }
|
|
537
537
|
}, "*");
|
|
538
538
|
}
|
|
539
539
|
u.data?.type === "ikon-inspect-highlight" && s(u.data.markers ?? []), u.data?.type === "ikon-inspect-clear" && o();
|
|
540
540
|
}
|
|
541
541
|
return document.addEventListener("mouseover", i, !0), document.addEventListener("mouseout", a, !0), document.addEventListener("click", c, !0), window.addEventListener("message", l), () => {
|
|
542
|
-
document.removeEventListener("mouseover", i, !0), document.removeEventListener("mouseout", a, !0), document.removeEventListener("click", c, !0), window.removeEventListener("message", l), o(), s([]),
|
|
542
|
+
document.removeEventListener("mouseover", i, !0), document.removeEventListener("mouseout", a, !0), document.removeEventListener("click", c, !0), window.removeEventListener("message", l), o(), s([]), r.remove();
|
|
543
543
|
};
|
|
544
544
|
}, [t]), null;
|
|
545
545
|
}
|
|
546
546
|
const Ue = "ikon-ui";
|
|
547
|
-
function
|
|
547
|
+
function pn(t, e) {
|
|
548
548
|
return t === e;
|
|
549
549
|
}
|
|
550
|
-
const
|
|
551
|
-
const i =
|
|
550
|
+
const Lo = z(function({ stores: e, registry: n, category: r = Ue, onAction: o, client: s }) {
|
|
551
|
+
const i = K(() => Array.from(e.keys()).sort().join(","), [e]), a = v(o);
|
|
552
552
|
a.current = o;
|
|
553
|
-
const c =
|
|
553
|
+
const c = v(s);
|
|
554
554
|
c.current = s;
|
|
555
|
-
const
|
|
555
|
+
const p = K(
|
|
556
556
|
() => {
|
|
557
|
-
const
|
|
557
|
+
const f = [];
|
|
558
558
|
for (const [l, u] of e) {
|
|
559
|
-
const
|
|
560
|
-
|
|
559
|
+
const d = u.store.getSnapshot();
|
|
560
|
+
pn(u.category, r) && (!d.rootViewId || !d.views.has(d.rootViewId) || f.push({ key: l, store: u.store }));
|
|
561
561
|
}
|
|
562
|
-
return
|
|
562
|
+
return f;
|
|
563
563
|
},
|
|
564
564
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
565
|
-
[e,
|
|
565
|
+
[e, r, i]
|
|
566
566
|
);
|
|
567
|
-
return
|
|
568
|
-
/* @__PURE__ */
|
|
569
|
-
|
|
567
|
+
return p.length === 0 ? null : /* @__PURE__ */ E.jsxs(E.Fragment, { children: [
|
|
568
|
+
/* @__PURE__ */ E.jsx(fn, {}),
|
|
569
|
+
p.map(({ key: f, store: l }) => /* @__PURE__ */ E.jsx(ln, { store: l, library: n, onAction: a.current, client: c.current, video: c.current?.media?.video }, f))
|
|
570
570
|
] });
|
|
571
571
|
});
|
|
572
|
-
class
|
|
572
|
+
class hn {
|
|
573
573
|
core;
|
|
574
574
|
ownsCore;
|
|
575
575
|
stores = /* @__PURE__ */ new Map();
|
|
@@ -577,7 +577,7 @@ class ur {
|
|
|
577
577
|
unsubscribeClears;
|
|
578
578
|
unsubscribeStoreChanges;
|
|
579
579
|
constructor(e) {
|
|
580
|
-
this.core = e?.core ?? new
|
|
580
|
+
this.core = e?.core ?? new jt({ client: e?.client }), this.ownsCore = !e?.core, this.unsubscribeClears = this.core.subscribeToUiStreamCleared(this.handleUiStreamCleared), this.unsubscribeStoreChanges = this.core.uiStore.subscribe(this.syncStreamSnapshot), this.syncAllStreams();
|
|
581
581
|
}
|
|
582
582
|
dispose() {
|
|
583
583
|
this.unsubscribeClears(), this.unsubscribeStoreChanges(), this.ownsCore && this.core.dispose(), this.listeners.clear(), this.stores.clear();
|
|
@@ -603,123 +603,195 @@ class ur {
|
|
|
603
603
|
this.stores.delete(e) && this.notify(e);
|
|
604
604
|
};
|
|
605
605
|
syncStreamSnapshot = (e) => {
|
|
606
|
-
const
|
|
607
|
-
if (!
|
|
606
|
+
const n = this.core.uiStore.getSnapshot(e);
|
|
607
|
+
if (!n || !n.rootViewId) {
|
|
608
608
|
this.handleUiStreamCleared(e);
|
|
609
609
|
return;
|
|
610
610
|
}
|
|
611
|
-
if (!
|
|
611
|
+
if (!n.views.get(n.rootViewId)) {
|
|
612
612
|
this.handleUiStreamCleared(e);
|
|
613
613
|
return;
|
|
614
614
|
}
|
|
615
|
-
const s = this.ensureStoreEntry(e).store.replaceSnapshot(
|
|
615
|
+
const s = this.ensureStoreEntry(e).store.replaceSnapshot(n), i = this.updateCategory(e, n.category);
|
|
616
616
|
(s || i) && this.notify(e);
|
|
617
617
|
};
|
|
618
618
|
syncAllStreams() {
|
|
619
|
-
const e = this.core.uiStore.getSnapshots(),
|
|
620
|
-
for (const
|
|
621
|
-
this.syncStreamSnapshot(
|
|
622
|
-
for (const
|
|
623
|
-
|
|
619
|
+
const e = this.core.uiStore.getSnapshots(), n = /* @__PURE__ */ new Set();
|
|
620
|
+
for (const r of e)
|
|
621
|
+
this.syncStreamSnapshot(r.streamId), n.add(r.streamId);
|
|
622
|
+
for (const r of this.stores.keys())
|
|
623
|
+
n.has(r) || (this.stores.delete(r), this.notify(r));
|
|
624
624
|
}
|
|
625
625
|
ensureStoreEntry(e) {
|
|
626
|
-
const
|
|
627
|
-
if (
|
|
628
|
-
return
|
|
629
|
-
const
|
|
626
|
+
const n = this.stores.get(e);
|
|
627
|
+
if (n)
|
|
628
|
+
return n;
|
|
629
|
+
const r = {
|
|
630
630
|
category: Ue,
|
|
631
|
-
store: new
|
|
631
|
+
store: new Ut()
|
|
632
632
|
};
|
|
633
|
-
return this.stores.set(e,
|
|
633
|
+
return this.stores.set(e, r), r;
|
|
634
634
|
}
|
|
635
|
-
updateCategory(e,
|
|
636
|
-
const
|
|
637
|
-
if (!
|
|
635
|
+
updateCategory(e, n) {
|
|
636
|
+
const r = this.stores.get(e);
|
|
637
|
+
if (!r)
|
|
638
638
|
return !1;
|
|
639
|
-
const o =
|
|
640
|
-
return
|
|
639
|
+
const o = n ?? this.core.uiStore.getSnapshot(e)?.category ?? Ue;
|
|
640
|
+
return r.category === o ? !1 : (this.stores.set(e, { ...r, category: o }), !0);
|
|
641
641
|
}
|
|
642
642
|
notify(e) {
|
|
643
|
-
for (const
|
|
644
|
-
|
|
643
|
+
for (const n of this.listeners)
|
|
644
|
+
n(e);
|
|
645
645
|
}
|
|
646
646
|
}
|
|
647
|
-
function
|
|
647
|
+
function mn(t) {
|
|
648
648
|
if (typeof t == "string") {
|
|
649
649
|
const e = t.trim();
|
|
650
650
|
return e.length > 0 ? e : void 0;
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
|
-
function
|
|
653
|
+
function oe(t) {
|
|
654
654
|
if (typeof t == "string") {
|
|
655
655
|
const e = t.trim();
|
|
656
656
|
return e.length > 0 ? e : void 0;
|
|
657
657
|
}
|
|
658
658
|
if (Array.isArray(t)) {
|
|
659
|
-
const e = t.filter((
|
|
659
|
+
const e = t.filter((n) => typeof n == "string").map((n) => n.trim()).filter(Boolean);
|
|
660
660
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
661
661
|
}
|
|
662
662
|
}
|
|
663
|
-
function
|
|
663
|
+
function ze(...t) {
|
|
664
664
|
let e = "";
|
|
665
|
-
for (const
|
|
666
|
-
if (
|
|
667
|
-
const
|
|
668
|
-
|
|
665
|
+
for (const n of t)
|
|
666
|
+
if (n) {
|
|
667
|
+
const r = n.trim();
|
|
668
|
+
r && (e = e ? e + " " + r : r);
|
|
669
669
|
}
|
|
670
670
|
return e || void 0;
|
|
671
671
|
}
|
|
672
|
-
const
|
|
673
|
-
function
|
|
672
|
+
const nt = /* @__PURE__ */ new WeakMap(), gn = {};
|
|
673
|
+
function We(t) {
|
|
674
674
|
if (!t)
|
|
675
|
-
return
|
|
676
|
-
const e =
|
|
675
|
+
return gn;
|
|
676
|
+
const e = nt.get(t);
|
|
677
677
|
if (e)
|
|
678
678
|
return e;
|
|
679
|
-
const
|
|
680
|
-
for (const [
|
|
681
|
-
o != null && (typeof o == "string" || typeof o == "number" || typeof o == "boolean") && (r
|
|
682
|
-
return
|
|
683
|
-
}
|
|
684
|
-
function
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
679
|
+
const n = {};
|
|
680
|
+
for (const [r, o] of Object.entries(t))
|
|
681
|
+
o != null && (typeof o == "string" || typeof o == "number" || typeof o == "boolean") && (n[r] = o);
|
|
682
|
+
return nt.set(t, n), n;
|
|
683
|
+
}
|
|
684
|
+
function yn(t) {
|
|
685
|
+
let e = t.parentElement;
|
|
686
|
+
for (; e; ) {
|
|
687
|
+
const r = window.getComputedStyle(e).overflowY;
|
|
688
|
+
if (r === "auto" || r === "scroll" || e.hasAttribute("data-radix-scroll-area-viewport"))
|
|
689
|
+
return e;
|
|
690
|
+
e = e.parentElement;
|
|
691
|
+
}
|
|
692
|
+
return null;
|
|
693
|
+
}
|
|
694
|
+
function bt(t, e) {
|
|
695
|
+
requestAnimationFrame(() => {
|
|
696
|
+
const n = t.getBoundingClientRect(), r = e.getBoundingClientRect(), o = t.scrollTop + (r.bottom - n.bottom) + 16;
|
|
697
|
+
"scrollBehavior" in document.documentElement.style ? t.scrollTo({ top: o, behavior: "smooth" }) : t.scrollTop = o;
|
|
698
|
+
});
|
|
699
|
+
}
|
|
700
|
+
const De = "data-ikon-scroll-indicator", bn = 0.15, Se = "data-ikon-at-bottom";
|
|
701
|
+
function St(t) {
|
|
702
|
+
return Math.max(t.clientHeight * bn, 20);
|
|
703
|
+
}
|
|
704
|
+
function Sn(t) {
|
|
705
|
+
return t.getAttribute(Se) !== "false";
|
|
706
|
+
}
|
|
707
|
+
function wn(t) {
|
|
708
|
+
t.getAttribute(Se) === null && (t.setAttribute(Se, "true"), t.addEventListener("scroll", () => {
|
|
709
|
+
const { scrollTop: e, scrollHeight: n, clientHeight: r } = t, s = n - e - r <= St(t);
|
|
710
|
+
t.setAttribute(Se, s ? "true" : "false");
|
|
711
|
+
}, { passive: !0 }));
|
|
712
|
+
}
|
|
713
|
+
function vn(t) {
|
|
714
|
+
const e = t.parentElement ?? t, n = e.querySelector(`[${De}]`);
|
|
715
|
+
if (n)
|
|
716
|
+
return n;
|
|
717
|
+
const r = document.createElement("button");
|
|
718
|
+
return r.setAttribute(De, "true"), r.setAttribute("aria-label", "Scroll to latest"), r.textContent = "↓", Object.assign(r.style, {
|
|
719
|
+
position: "absolute",
|
|
720
|
+
bottom: "12px",
|
|
721
|
+
left: "50%",
|
|
722
|
+
transform: "translateX(-50%)",
|
|
723
|
+
zIndex: "10",
|
|
724
|
+
width: "32px",
|
|
725
|
+
height: "32px",
|
|
726
|
+
borderRadius: "50%",
|
|
727
|
+
border: "1px solid var(--border-primary, #e5e5e5)",
|
|
728
|
+
backgroundColor: "var(--bg-primary, #ffffff)",
|
|
729
|
+
color: "var(--fg-primary, #0c0e12)",
|
|
730
|
+
cursor: "pointer",
|
|
731
|
+
display: "none",
|
|
732
|
+
alignItems: "center",
|
|
733
|
+
justifyContent: "center",
|
|
734
|
+
fontSize: "16px",
|
|
735
|
+
lineHeight: "1",
|
|
736
|
+
boxShadow: "0 2px 8px rgba(0,0,0,0.25)",
|
|
737
|
+
transition: "opacity 150ms",
|
|
738
|
+
opacity: "1",
|
|
739
|
+
padding: "0"
|
|
740
|
+
}), r.addEventListener("mouseenter", () => {
|
|
741
|
+
r.style.opacity = "1";
|
|
742
|
+
}), r.addEventListener("mouseleave", () => {
|
|
743
|
+
r.style.opacity = "0.9";
|
|
744
|
+
}), e.appendChild(r), r;
|
|
745
|
+
}
|
|
746
|
+
function En(t, e) {
|
|
747
|
+
const n = vn(t);
|
|
748
|
+
n.style.display = "flex";
|
|
749
|
+
const r = () => {
|
|
750
|
+
bt(t, e), n.style.display = "none";
|
|
751
|
+
}, o = () => {
|
|
752
|
+
const { scrollTop: s, scrollHeight: i, clientHeight: a } = t;
|
|
753
|
+
i - s - a <= St(t) && (n.style.display = "none");
|
|
754
|
+
};
|
|
755
|
+
return n.addEventListener("click", r), t.addEventListener("scroll", o, { passive: !0 }), () => {
|
|
756
|
+
n.removeEventListener("click", r), t.removeEventListener("scroll", o);
|
|
757
|
+
};
|
|
758
|
+
}
|
|
759
|
+
function Rn() {
|
|
760
|
+
const t = z(function({ nodeId: n, context: r }) {
|
|
761
|
+
const o = Z(r.store, n), s = v(null), i = oe(o?.props?.targetViewId), a = o?.props?.focusOnly, c = typeof a == "boolean" ? a : void 0, p = oe(o?.props?.priority), f = oe(o?.props?.key), l = o?.props?.preciseGeneratedAt;
|
|
762
|
+
return N(() => {
|
|
688
763
|
if (typeof document > "u")
|
|
689
764
|
return;
|
|
690
|
-
const
|
|
691
|
-
if (!
|
|
765
|
+
const d = s.current;
|
|
766
|
+
if (!d || i && d.closest("[data-ikon-view-id]")?.getAttribute("data-ikon-view-id") !== i)
|
|
692
767
|
return;
|
|
768
|
+
let m;
|
|
693
769
|
if (c !== !0) {
|
|
694
|
-
const
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
770
|
+
const w = yn(d);
|
|
771
|
+
if (w)
|
|
772
|
+
if (wn(w), p === "Polite" && !Sn(w))
|
|
773
|
+
m = En(w, d);
|
|
774
|
+
else {
|
|
775
|
+
const B = (w.parentElement ?? w).querySelector(`[${De}]`);
|
|
776
|
+
B && (B.style.display = "none"), bt(w, d);
|
|
701
777
|
}
|
|
702
|
-
|
|
703
|
-
})(u);
|
|
704
|
-
y ? requestAnimationFrame(() => {
|
|
705
|
-
const v = y.getBoundingClientRect(), E = u.getBoundingClientRect(), T = y.scrollTop + (E.bottom - v.bottom) + 16;
|
|
706
|
-
"scrollBehavior" in document.documentElement.style ? y.scrollTo({ top: T, behavior: "smooth" }) : y.scrollTop = T;
|
|
707
|
-
}) : typeof u.scrollIntoView == "function" && requestAnimationFrame(() => {
|
|
778
|
+
else typeof d.scrollIntoView == "function" && requestAnimationFrame(() => {
|
|
708
779
|
try {
|
|
709
|
-
|
|
780
|
+
d.scrollIntoView({ behavior: "smooth", block: "end", inline: "nearest" });
|
|
710
781
|
} catch {
|
|
711
|
-
|
|
782
|
+
d.scrollIntoView(!1);
|
|
712
783
|
}
|
|
713
784
|
});
|
|
714
785
|
}
|
|
715
|
-
const
|
|
716
|
-
if (!(
|
|
786
|
+
const g = document.activeElement;
|
|
787
|
+
if (!(g instanceof HTMLInputElement || g instanceof HTMLTextAreaElement || g?.getAttribute("contenteditable") === "true") && typeof d.focus == "function")
|
|
717
788
|
try {
|
|
718
|
-
|
|
789
|
+
d.focus({ preventScroll: !0 });
|
|
719
790
|
} catch {
|
|
720
|
-
|
|
791
|
+
d.focus();
|
|
721
792
|
}
|
|
722
|
-
|
|
793
|
+
return m;
|
|
794
|
+
}, [c, p, i, f, l]), o ? /* @__PURE__ */ E.jsx(
|
|
723
795
|
"span",
|
|
724
796
|
{
|
|
725
797
|
ref: s,
|
|
@@ -737,26 +809,26 @@ function fr() {
|
|
|
737
809
|
return t;
|
|
738
810
|
};
|
|
739
811
|
}
|
|
740
|
-
function
|
|
741
|
-
const t =
|
|
742
|
-
const s = Z(
|
|
743
|
-
i &&
|
|
744
|
-
}, [i,
|
|
812
|
+
function kn() {
|
|
813
|
+
const t = z(function({ nodeId: n, context: r, className: o }) {
|
|
814
|
+
const s = Z(r.store, n), i = mn(s?.props?.onInvokeId), a = D(() => {
|
|
815
|
+
i && r.dispatchAction(i);
|
|
816
|
+
}, [i, r]);
|
|
745
817
|
if (!s)
|
|
746
818
|
return null;
|
|
747
|
-
const c =
|
|
819
|
+
const c = We(s.props);
|
|
748
820
|
delete c.onInvokeId;
|
|
749
|
-
const
|
|
750
|
-
return /* @__PURE__ */
|
|
821
|
+
const p = ze(oe(s.props?.className), o), f = s.children?.length ? r.renderChildren(s.children) : void 0;
|
|
822
|
+
return /* @__PURE__ */ E.jsx(
|
|
751
823
|
"div",
|
|
752
824
|
{
|
|
753
825
|
...c,
|
|
754
826
|
"data-ikon-node-id": s.id,
|
|
755
827
|
"data-ikon-source": s.sourceMarker,
|
|
756
|
-
className:
|
|
828
|
+
className: p,
|
|
757
829
|
onClick: i ? a : void 0,
|
|
758
830
|
style: i ? { cursor: "pointer" } : void 0,
|
|
759
|
-
children:
|
|
831
|
+
children: f
|
|
760
832
|
}
|
|
761
833
|
);
|
|
762
834
|
});
|
|
@@ -765,61 +837,61 @@ function hr() {
|
|
|
765
837
|
return t;
|
|
766
838
|
};
|
|
767
839
|
}
|
|
768
|
-
function
|
|
769
|
-
const t =
|
|
770
|
-
const s = Z(
|
|
840
|
+
function An() {
|
|
841
|
+
const t = z(function({ nodeId: n, context: r, className: o }) {
|
|
842
|
+
const s = Z(r.store, n);
|
|
771
843
|
if (!s)
|
|
772
844
|
return null;
|
|
773
|
-
const i =
|
|
774
|
-
return /* @__PURE__ */
|
|
845
|
+
const i = We(s.props), a = ze("relative", oe(s.props?.className), o), c = s.children?.length ? r.renderChildren(s.children) : void 0;
|
|
846
|
+
return /* @__PURE__ */ E.jsx("div", { ...i, "data-ikon-node-id": s.id, "data-ikon-source": s.sourceMarker, className: a, children: c });
|
|
775
847
|
});
|
|
776
848
|
return ({ type: e }) => {
|
|
777
849
|
if (e === "std.stack")
|
|
778
850
|
return t;
|
|
779
851
|
};
|
|
780
852
|
}
|
|
781
|
-
function
|
|
782
|
-
const t =
|
|
783
|
-
const s = Z(
|
|
853
|
+
function Tn() {
|
|
854
|
+
const t = z(function({ nodeId: n, context: r, className: o }) {
|
|
855
|
+
const s = Z(r.store, n);
|
|
784
856
|
if (!s)
|
|
785
857
|
return null;
|
|
786
|
-
const i =
|
|
787
|
-
return /* @__PURE__ */
|
|
858
|
+
const i = We(s.props), a = ze("absolute", oe(s.props?.className), o), c = s.children?.length ? r.renderChildren(s.children) : void 0;
|
|
859
|
+
return /* @__PURE__ */ E.jsx("div", { ...i, "data-ikon-node-id": s.id, "data-ikon-source": s.sourceMarker, className: a, children: c });
|
|
788
860
|
});
|
|
789
861
|
return ({ type: e }) => {
|
|
790
862
|
if (e === "std.layer")
|
|
791
863
|
return t;
|
|
792
864
|
};
|
|
793
865
|
}
|
|
794
|
-
function
|
|
866
|
+
function Cn() {
|
|
795
867
|
return [
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
868
|
+
kn(),
|
|
869
|
+
An(),
|
|
870
|
+
Tn(),
|
|
871
|
+
Rn()
|
|
800
872
|
];
|
|
801
873
|
}
|
|
802
|
-
const
|
|
803
|
-
function
|
|
804
|
-
t.registerModule(
|
|
874
|
+
const In = "base", On = async () => Cn();
|
|
875
|
+
function Nn(t) {
|
|
876
|
+
t.registerModule(In, On);
|
|
805
877
|
}
|
|
806
|
-
function
|
|
878
|
+
function _n(t) {
|
|
807
879
|
if (typeof t == "string") {
|
|
808
880
|
const e = t.trim();
|
|
809
881
|
return e.length > 0 ? e : void 0;
|
|
810
882
|
}
|
|
811
883
|
if (Array.isArray(t)) {
|
|
812
|
-
const e = t.filter((
|
|
884
|
+
const e = t.filter((n) => typeof n == "string").map((n) => n.trim()).filter(Boolean);
|
|
813
885
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
814
886
|
}
|
|
815
887
|
}
|
|
816
|
-
function
|
|
888
|
+
function Pn(...t) {
|
|
817
889
|
const e = [];
|
|
818
|
-
for (const
|
|
819
|
-
|
|
890
|
+
for (const n of t)
|
|
891
|
+
n && n.trim() && e.push(n.trim());
|
|
820
892
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
821
893
|
}
|
|
822
|
-
function
|
|
894
|
+
function rt(t) {
|
|
823
895
|
if (typeof t != "string")
|
|
824
896
|
return;
|
|
825
897
|
const e = t.trim();
|
|
@@ -834,54 +906,58 @@ function ye(t) {
|
|
|
834
906
|
if (e === "false") return !1;
|
|
835
907
|
}
|
|
836
908
|
}
|
|
837
|
-
const
|
|
838
|
-
function
|
|
839
|
-
const t =
|
|
840
|
-
nodeId:
|
|
841
|
-
context:
|
|
909
|
+
const Mn = "std.audio-url-player";
|
|
910
|
+
function Ln() {
|
|
911
|
+
const t = z(function({
|
|
912
|
+
nodeId: n,
|
|
913
|
+
context: r,
|
|
842
914
|
className: o
|
|
843
915
|
}) {
|
|
844
|
-
const s = Z(
|
|
845
|
-
if (
|
|
916
|
+
const s = Z(r.store, n), i = v(null), a = s ? ye(s.props?.autoplay) : void 0, c = s ? rt(s.props?.src) : void 0;
|
|
917
|
+
if (N(() => {
|
|
918
|
+
a && i.current && i.current.play().catch(() => {
|
|
919
|
+
});
|
|
920
|
+
}, [a, c]), !s)
|
|
846
921
|
return null;
|
|
847
|
-
const
|
|
848
|
-
return /* @__PURE__ */
|
|
922
|
+
const p = Pn(_n(s.props?.className), o), f = rt(s.props?.preload), l = ye(s.props?.controls), u = ye(s.props?.loop), d = ye(s.props?.muted);
|
|
923
|
+
return /* @__PURE__ */ E.jsx(
|
|
849
924
|
"audio",
|
|
850
925
|
{
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
...
|
|
854
|
-
...
|
|
855
|
-
...
|
|
856
|
-
...u !== void 0 ? {
|
|
926
|
+
ref: i,
|
|
927
|
+
src: c,
|
|
928
|
+
...f !== void 0 ? { preload: f } : {},
|
|
929
|
+
...l !== void 0 ? { controls: l } : {},
|
|
930
|
+
...a !== void 0 ? { autoPlay: a } : {},
|
|
931
|
+
...u !== void 0 ? { loop: u } : {},
|
|
932
|
+
...d !== void 0 ? { muted: d } : {},
|
|
857
933
|
"data-ikon-node-id": s.id,
|
|
858
934
|
"data-ikon-source": s.sourceMarker,
|
|
859
|
-
className:
|
|
935
|
+
className: p
|
|
860
936
|
}
|
|
861
937
|
);
|
|
862
938
|
});
|
|
863
939
|
return ({ type: e }) => {
|
|
864
|
-
if (e ===
|
|
940
|
+
if (e === Mn)
|
|
865
941
|
return t;
|
|
866
942
|
};
|
|
867
943
|
}
|
|
868
|
-
function
|
|
944
|
+
function wt(t) {
|
|
869
945
|
if (typeof t == "string") {
|
|
870
946
|
const e = t.trim();
|
|
871
947
|
return e.length > 0 ? e : void 0;
|
|
872
948
|
}
|
|
873
949
|
if (Array.isArray(t)) {
|
|
874
|
-
const e = t.filter((
|
|
950
|
+
const e = t.filter((n) => typeof n == "string").map((n) => n.trim()).filter(Boolean);
|
|
875
951
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
876
952
|
}
|
|
877
953
|
}
|
|
878
|
-
function
|
|
954
|
+
function vt(...t) {
|
|
879
955
|
const e = [];
|
|
880
|
-
for (const
|
|
881
|
-
|
|
956
|
+
for (const n of t)
|
|
957
|
+
n && n.trim() && e.push(n.trim());
|
|
882
958
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
883
959
|
}
|
|
884
|
-
function
|
|
960
|
+
function we(t) {
|
|
885
961
|
if (typeof t == "number" && Number.isFinite(t))
|
|
886
962
|
return Math.floor(t);
|
|
887
963
|
if (typeof t == "string" && t.trim().length > 0) {
|
|
@@ -890,29 +966,39 @@ function Se(t) {
|
|
|
890
966
|
return Math.floor(e);
|
|
891
967
|
}
|
|
892
968
|
}
|
|
893
|
-
function
|
|
969
|
+
function Be(t) {
|
|
894
970
|
if (typeof t != "string")
|
|
895
971
|
return;
|
|
896
972
|
const e = t.trim();
|
|
897
973
|
return e.length > 0 ? e : void 0;
|
|
898
974
|
}
|
|
899
|
-
const
|
|
900
|
-
function
|
|
901
|
-
const t =
|
|
902
|
-
const s = Z(
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
975
|
+
const xn = "std.video-canvas", jn = "std.video-url-player";
|
|
976
|
+
function Un() {
|
|
977
|
+
const t = z(function({ nodeId: n, context: r, className: o }) {
|
|
978
|
+
const s = Z(r.store, n), i = v(null), a = v(null), c = r.video, p = r.client, f = s ? Be(s.props?.streamId) : void 0, l = s ? we(s.props?.width) : void 0, u = s ? we(s.props?.height) : void 0, d = s ? vt(wt(s.props?.className), o) : o, [, m] = Y(0);
|
|
979
|
+
N(() => {
|
|
980
|
+
if (!p?.isWebRtcEnabled) return;
|
|
981
|
+
const g = p.onWebRtcTrackMapChanged;
|
|
982
|
+
return p.onWebRtcTrackMapChanged = (y) => {
|
|
983
|
+
g?.(y), y.kind === "video" && m((w) => w + 1);
|
|
984
|
+
}, () => {
|
|
985
|
+
p.onWebRtcTrackMapChanged = g;
|
|
986
|
+
};
|
|
987
|
+
}, [p]);
|
|
988
|
+
const b = p?.isWebRtcEnabled && f ? p.getWebRtcVideoStreamByStreamId(f) : null;
|
|
989
|
+
return N(() => {
|
|
990
|
+
const g = i.current;
|
|
991
|
+
if (!(!c || !g || !f || b))
|
|
992
|
+
return c.attachCanvas(f, g), () => {
|
|
993
|
+
c.detachCanvas(f);
|
|
908
994
|
};
|
|
909
|
-
}, [c,
|
|
910
|
-
const
|
|
911
|
-
if (!(!
|
|
912
|
-
return
|
|
913
|
-
|
|
995
|
+
}, [c, f, b]), N(() => {
|
|
996
|
+
const g = a.current;
|
|
997
|
+
if (!(!g || !b))
|
|
998
|
+
return g.srcObject = b, () => {
|
|
999
|
+
g.srcObject = null;
|
|
914
1000
|
};
|
|
915
|
-
}, [
|
|
1001
|
+
}, [b]), s ? b ? /* @__PURE__ */ E.jsx(
|
|
916
1002
|
"video",
|
|
917
1003
|
{
|
|
918
1004
|
ref: a,
|
|
@@ -921,35 +1007,35 @@ function Tr() {
|
|
|
921
1007
|
muted: !0,
|
|
922
1008
|
"data-ikon-node-id": s.id,
|
|
923
1009
|
"data-ikon-source": s.sourceMarker,
|
|
924
|
-
"data-ikon-video-stream-id":
|
|
925
|
-
className:
|
|
1010
|
+
"data-ikon-video-stream-id": f,
|
|
1011
|
+
className: d,
|
|
926
1012
|
...l ? { width: l } : {},
|
|
927
1013
|
...u ? { height: u } : {}
|
|
928
1014
|
},
|
|
929
|
-
|
|
930
|
-
) : /* @__PURE__ */
|
|
1015
|
+
f
|
|
1016
|
+
) : /* @__PURE__ */ E.jsx(
|
|
931
1017
|
"canvas",
|
|
932
1018
|
{
|
|
933
1019
|
ref: i,
|
|
934
1020
|
"data-ikon-node-id": s.id,
|
|
935
1021
|
"data-ikon-source": s.sourceMarker,
|
|
936
|
-
"data-ikon-video-stream-id":
|
|
937
|
-
className:
|
|
1022
|
+
"data-ikon-video-stream-id": f,
|
|
1023
|
+
className: d,
|
|
938
1024
|
...l ? { width: l } : {},
|
|
939
1025
|
...u ? { height: u } : {}
|
|
940
1026
|
},
|
|
941
|
-
|
|
1027
|
+
f
|
|
942
1028
|
) : null;
|
|
943
1029
|
});
|
|
944
1030
|
return ({ type: e }) => {
|
|
945
|
-
if (e ===
|
|
1031
|
+
if (e === xn)
|
|
946
1032
|
return t;
|
|
947
1033
|
};
|
|
948
1034
|
}
|
|
949
|
-
function
|
|
950
|
-
return [
|
|
1035
|
+
function Dn() {
|
|
1036
|
+
return [Un(), Bn(), Ln()];
|
|
951
1037
|
}
|
|
952
|
-
function
|
|
1038
|
+
function ue(t) {
|
|
953
1039
|
if (typeof t == "boolean")
|
|
954
1040
|
return t;
|
|
955
1041
|
if (typeof t == "string") {
|
|
@@ -958,57 +1044,61 @@ function ce(t) {
|
|
|
958
1044
|
if (e === "false") return !1;
|
|
959
1045
|
}
|
|
960
1046
|
}
|
|
961
|
-
function
|
|
962
|
-
const t =
|
|
963
|
-
nodeId:
|
|
964
|
-
context:
|
|
1047
|
+
function Bn() {
|
|
1048
|
+
const t = z(function({
|
|
1049
|
+
nodeId: n,
|
|
1050
|
+
context: r,
|
|
965
1051
|
className: o
|
|
966
1052
|
}) {
|
|
967
|
-
const s = Z(
|
|
968
|
-
if (
|
|
1053
|
+
const s = Z(r.store, n), i = v(null), a = s ? ue(s.props?.autoplay) : void 0, c = s ? Be(s.props?.src) : void 0;
|
|
1054
|
+
if (N(() => {
|
|
1055
|
+
a && i.current && i.current.play().catch(() => {
|
|
1056
|
+
});
|
|
1057
|
+
}, [a, c]), !s)
|
|
969
1058
|
return null;
|
|
970
|
-
const
|
|
971
|
-
return /* @__PURE__ */
|
|
1059
|
+
const p = vt(wt(s.props?.className), o), f = Be(s.props?.poster), l = ue(s.props?.controls), u = ue(s.props?.loop), d = ue(s.props?.muted), m = ue(s.props?.playsInline), b = we(s.props?.width), g = we(s.props?.height), y = s.children?.length ? r.renderChildren(s.children) : void 0;
|
|
1060
|
+
return /* @__PURE__ */ E.jsx(
|
|
972
1061
|
"video",
|
|
973
1062
|
{
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
...
|
|
978
|
-
...
|
|
979
|
-
...u !== void 0 ? {
|
|
980
|
-
...
|
|
981
|
-
...m ? {
|
|
982
|
-
...b ? {
|
|
1063
|
+
ref: i,
|
|
1064
|
+
src: c,
|
|
1065
|
+
poster: f,
|
|
1066
|
+
...l !== void 0 ? { controls: l } : {},
|
|
1067
|
+
...a !== void 0 ? { autoPlay: a } : {},
|
|
1068
|
+
...u !== void 0 ? { loop: u } : {},
|
|
1069
|
+
...d !== void 0 ? { muted: d } : {},
|
|
1070
|
+
...m !== void 0 ? { playsInline: m } : {},
|
|
1071
|
+
...b ? { width: b } : {},
|
|
1072
|
+
...g ? { height: g } : {},
|
|
983
1073
|
"data-ikon-node-id": s.id,
|
|
984
1074
|
"data-ikon-source": s.sourceMarker,
|
|
985
|
-
className:
|
|
986
|
-
children:
|
|
1075
|
+
className: p,
|
|
1076
|
+
children: y
|
|
987
1077
|
}
|
|
988
1078
|
);
|
|
989
1079
|
});
|
|
990
1080
|
return ({ type: e }) => {
|
|
991
|
-
if (e ===
|
|
1081
|
+
if (e === jn)
|
|
992
1082
|
return t;
|
|
993
1083
|
};
|
|
994
1084
|
}
|
|
995
|
-
const
|
|
996
|
-
function
|
|
997
|
-
t.registerModule(
|
|
1085
|
+
const Fn = "media", $n = async () => Dn();
|
|
1086
|
+
function Vn(t) {
|
|
1087
|
+
t.registerModule(Fn, $n);
|
|
998
1088
|
}
|
|
999
|
-
const
|
|
1089
|
+
const Kn = `#version 300 es
|
|
1000
1090
|
in vec4 a_position;
|
|
1001
1091
|
void main() {
|
|
1002
1092
|
gl_Position = a_position;
|
|
1003
1093
|
}
|
|
1004
1094
|
`;
|
|
1005
|
-
function
|
|
1095
|
+
function Yn(t, e) {
|
|
1006
1096
|
return new RegExp(`\\buniform\\s+\\w+\\s+${e}\\s*;`, "g").test(t);
|
|
1007
1097
|
}
|
|
1008
|
-
function
|
|
1009
|
-
const
|
|
1010
|
-
for (const [
|
|
1011
|
-
if (
|
|
1098
|
+
function zn(t, e) {
|
|
1099
|
+
const n = [];
|
|
1100
|
+
for (const [r, o] of Object.entries(e)) {
|
|
1101
|
+
if (Yn(t, r))
|
|
1012
1102
|
continue;
|
|
1013
1103
|
let s;
|
|
1014
1104
|
switch (o.type) {
|
|
@@ -1033,7 +1123,7 @@ function Lr(t, e) {
|
|
|
1033
1123
|
default:
|
|
1034
1124
|
s = "float";
|
|
1035
1125
|
}
|
|
1036
|
-
|
|
1126
|
+
n.push(`uniform ${s} ${r};`);
|
|
1037
1127
|
}
|
|
1038
1128
|
return `#version 300 es
|
|
1039
1129
|
precision highp float;
|
|
@@ -1047,7 +1137,7 @@ uniform vec4 iMouse;
|
|
|
1047
1137
|
uniform vec4 iDate;
|
|
1048
1138
|
|
|
1049
1139
|
// Custom uniforms
|
|
1050
|
-
${
|
|
1140
|
+
${n.join(`
|
|
1051
1141
|
`)}
|
|
1052
1142
|
|
|
1053
1143
|
out vec4 frag_out_color;
|
|
@@ -1061,7 +1151,7 @@ void main() {
|
|
|
1061
1151
|
}
|
|
1062
1152
|
`;
|
|
1063
1153
|
}
|
|
1064
|
-
class
|
|
1154
|
+
class Wn {
|
|
1065
1155
|
gl;
|
|
1066
1156
|
program = null;
|
|
1067
1157
|
positionBuffer = null;
|
|
@@ -1078,78 +1168,78 @@ class jr {
|
|
|
1078
1168
|
lastError = null;
|
|
1079
1169
|
currentShaderSource = "";
|
|
1080
1170
|
constructor(e) {
|
|
1081
|
-
const
|
|
1171
|
+
const n = e.getContext("webgl2", {
|
|
1082
1172
|
alpha: !1,
|
|
1083
1173
|
antialias: !1,
|
|
1084
1174
|
depth: !1,
|
|
1085
1175
|
stencil: !1,
|
|
1086
1176
|
preserveDrawingBuffer: !1
|
|
1087
1177
|
});
|
|
1088
|
-
if (!
|
|
1178
|
+
if (!n)
|
|
1089
1179
|
throw new Error("WebGL2 is not supported");
|
|
1090
|
-
this.gl =
|
|
1180
|
+
this.gl = n, this.initializeGeometry();
|
|
1091
1181
|
}
|
|
1092
1182
|
initializeGeometry() {
|
|
1093
1183
|
const e = this.gl;
|
|
1094
1184
|
this.vao = e.createVertexArray(), e.bindVertexArray(this.vao), this.positionBuffer = e.createBuffer(), e.bindBuffer(e.ARRAY_BUFFER, this.positionBuffer);
|
|
1095
|
-
const
|
|
1096
|
-
e.bufferData(e.ARRAY_BUFFER,
|
|
1185
|
+
const n = new Float32Array([-1, -1, 1, -1, -1, 1, -1, 1, 1, -1, 1, 1]);
|
|
1186
|
+
e.bufferData(e.ARRAY_BUFFER, n, e.STATIC_DRAW), e.enableVertexAttribArray(0), e.vertexAttribPointer(0, 2, e.FLOAT, !1, 0, 0), e.bindVertexArray(null);
|
|
1097
1187
|
}
|
|
1098
|
-
compile(e,
|
|
1099
|
-
this.lastError = null, this.customUniforms =
|
|
1100
|
-
const
|
|
1188
|
+
compile(e, n = {}) {
|
|
1189
|
+
this.lastError = null, this.customUniforms = n, this.currentShaderSource = e;
|
|
1190
|
+
const r = this.gl, o = this.compileShader(r.VERTEX_SHADER, Kn);
|
|
1101
1191
|
if (!o)
|
|
1102
1192
|
return !1;
|
|
1103
|
-
const s =
|
|
1193
|
+
const s = zn(e, n), i = this.compileShader(r.FRAGMENT_SHADER, s);
|
|
1104
1194
|
if (!i)
|
|
1105
|
-
return
|
|
1106
|
-
const a =
|
|
1107
|
-
return a ? (
|
|
1195
|
+
return r.deleteShader(o), !1;
|
|
1196
|
+
const a = r.createProgram();
|
|
1197
|
+
return a ? (r.attachShader(a, o), r.attachShader(a, i), r.linkProgram(a), r.deleteShader(o), r.deleteShader(i), r.getProgramParameter(a, r.LINK_STATUS) ? (this.program && r.deleteProgram(this.program), this.program = a, this.cacheUniformLocations(), !0) : (this.lastError = r.getProgramInfoLog(a) || "Program link failed", r.deleteProgram(a), !1)) : (this.lastError = "Failed to create program", r.deleteShader(o), r.deleteShader(i), !1);
|
|
1108
1198
|
}
|
|
1109
1199
|
recompileWithUniforms(e) {
|
|
1110
1200
|
return this.currentShaderSource ? this.compile(this.currentShaderSource, e) : !1;
|
|
1111
1201
|
}
|
|
1112
|
-
compileShader(e,
|
|
1113
|
-
const
|
|
1114
|
-
return o ? (
|
|
1202
|
+
compileShader(e, n) {
|
|
1203
|
+
const r = this.gl, o = r.createShader(e);
|
|
1204
|
+
return o ? (r.shaderSource(o, n), r.compileShader(o), r.getShaderParameter(o, r.COMPILE_STATUS) ? o : (this.lastError = r.getShaderInfoLog(o) || "Shader compilation failed", r.deleteShader(o), null)) : (this.lastError = "Failed to create shader", null);
|
|
1115
1205
|
}
|
|
1116
1206
|
cacheUniformLocations() {
|
|
1117
1207
|
if (!this.program) return;
|
|
1118
1208
|
const e = this.gl;
|
|
1119
1209
|
this.uniformLocations.clear();
|
|
1120
|
-
const
|
|
1121
|
-
for (const
|
|
1122
|
-
this.uniformLocations.set(
|
|
1123
|
-
for (const
|
|
1124
|
-
this.uniformLocations.set(
|
|
1210
|
+
const n = ["iResolution", "iTime", "iTimeDelta", "iFrame", "iMouse", "iDate"];
|
|
1211
|
+
for (const r of n)
|
|
1212
|
+
this.uniformLocations.set(r, e.getUniformLocation(this.program, r));
|
|
1213
|
+
for (const r of Object.keys(this.customUniforms))
|
|
1214
|
+
this.uniformLocations.set(r, e.getUniformLocation(this.program, r));
|
|
1125
1215
|
}
|
|
1126
1216
|
setCustomUniforms(e) {
|
|
1127
|
-
const
|
|
1128
|
-
|
|
1217
|
+
const n = Object.keys(e).some((o) => !(o in this.customUniforms)), r = Object.keys(this.customUniforms).some((o) => !(o in e));
|
|
1218
|
+
n || r ? this.recompileWithUniforms(e) : this.customUniforms = e;
|
|
1129
1219
|
}
|
|
1130
|
-
setMouse(e,
|
|
1131
|
-
this.mouseX = e, this.mouseY =
|
|
1220
|
+
setMouse(e, n, r, o) {
|
|
1221
|
+
this.mouseX = e, this.mouseY = n, this.mouseClickX = r, this.mouseClickY = o;
|
|
1132
1222
|
}
|
|
1133
1223
|
draw() {
|
|
1134
1224
|
if (!this.program) return;
|
|
1135
|
-
const e = this.gl,
|
|
1136
|
-
(
|
|
1225
|
+
const e = this.gl, n = e.canvas, r = n.clientWidth, o = n.clientHeight;
|
|
1226
|
+
(n.width !== r || n.height !== o) && (n.width = r, n.height = o, e.viewport(0, 0, r, o));
|
|
1137
1227
|
const s = performance.now(), i = (s - this.startTime) / 1e3, a = (s - this.lastFrameTime) / 1e3;
|
|
1138
1228
|
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);
|
|
1139
1229
|
const c = this.uniformLocations.get("iResolution");
|
|
1140
|
-
c && e.uniform3f(c,
|
|
1141
|
-
const
|
|
1142
|
-
|
|
1143
|
-
const
|
|
1144
|
-
|
|
1230
|
+
c && e.uniform3f(c, r, o, 1);
|
|
1231
|
+
const p = this.uniformLocations.get("iTime");
|
|
1232
|
+
p && e.uniform1f(p, i);
|
|
1233
|
+
const f = this.uniformLocations.get("iTimeDelta");
|
|
1234
|
+
f && e.uniform1f(f, a);
|
|
1145
1235
|
const l = this.uniformLocations.get("iFrame");
|
|
1146
1236
|
l && e.uniform1i(l, this.frameCount);
|
|
1147
1237
|
const u = this.uniformLocations.get("iMouse");
|
|
1148
1238
|
u && e.uniform4f(u, this.mouseX, this.mouseY, this.mouseClickX, this.mouseClickY);
|
|
1149
|
-
const
|
|
1150
|
-
if (
|
|
1239
|
+
const d = this.uniformLocations.get("iDate");
|
|
1240
|
+
if (d) {
|
|
1151
1241
|
const m = /* @__PURE__ */ new Date();
|
|
1152
|
-
e.uniform4f(
|
|
1242
|
+
e.uniform4f(d, m.getFullYear(), m.getMonth(), m.getDate(), m.getHours() * 3600 + m.getMinutes() * 60 + m.getSeconds() + m.getMilliseconds() / 1e3);
|
|
1153
1243
|
}
|
|
1154
1244
|
for (const [m, b] of Object.entries(this.customUniforms)) {
|
|
1155
1245
|
const g = this.uniformLocations.get(m);
|
|
@@ -1191,23 +1281,23 @@ class jr {
|
|
|
1191
1281
|
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();
|
|
1192
1282
|
}
|
|
1193
1283
|
}
|
|
1194
|
-
function
|
|
1284
|
+
function qn(t) {
|
|
1195
1285
|
if (typeof t == "string") {
|
|
1196
1286
|
const e = t.trim();
|
|
1197
1287
|
return e.length > 0 ? e : void 0;
|
|
1198
1288
|
}
|
|
1199
1289
|
if (Array.isArray(t)) {
|
|
1200
|
-
const e = t.filter((
|
|
1290
|
+
const e = t.filter((n) => typeof n == "string").map((n) => n.trim()).filter(Boolean);
|
|
1201
1291
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
1202
1292
|
}
|
|
1203
1293
|
}
|
|
1204
|
-
function
|
|
1294
|
+
function Hn(...t) {
|
|
1205
1295
|
const e = [];
|
|
1206
|
-
for (const
|
|
1207
|
-
|
|
1296
|
+
for (const n of t)
|
|
1297
|
+
n && n.trim() && e.push(n.trim());
|
|
1208
1298
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
1209
1299
|
}
|
|
1210
|
-
function
|
|
1300
|
+
function Ie(t) {
|
|
1211
1301
|
if (typeof t == "number" && Number.isFinite(t))
|
|
1212
1302
|
return Math.floor(t);
|
|
1213
1303
|
if (typeof t == "string" && t.trim().length > 0) {
|
|
@@ -1216,10 +1306,10 @@ function Ce(t) {
|
|
|
1216
1306
|
return Math.floor(e);
|
|
1217
1307
|
}
|
|
1218
1308
|
}
|
|
1219
|
-
function
|
|
1309
|
+
function Gn(t) {
|
|
1220
1310
|
return typeof t == "string" ? t : "";
|
|
1221
1311
|
}
|
|
1222
|
-
function
|
|
1312
|
+
function Jn(t) {
|
|
1223
1313
|
if (typeof t == "boolean")
|
|
1224
1314
|
return t;
|
|
1225
1315
|
if (typeof t == "string") {
|
|
@@ -1228,26 +1318,26 @@ function Fr(t) {
|
|
|
1228
1318
|
if (e === "false") return !1;
|
|
1229
1319
|
}
|
|
1230
1320
|
}
|
|
1231
|
-
function
|
|
1321
|
+
function Xn(t) {
|
|
1232
1322
|
if (!t || typeof t != "object")
|
|
1233
1323
|
return {};
|
|
1234
|
-
const e = {},
|
|
1235
|
-
for (const [
|
|
1324
|
+
const e = {}, n = t;
|
|
1325
|
+
for (const [r, o] of Object.entries(n)) {
|
|
1236
1326
|
if (!o || typeof o != "object")
|
|
1237
1327
|
continue;
|
|
1238
1328
|
const s = o, i = s.value, a = s.type;
|
|
1239
|
-
i === void 0 || typeof a != "string" || !["float", "vec2", "vec3", "vec4", "int", "bool"].includes(a) || (e[
|
|
1329
|
+
i === void 0 || typeof a != "string" || !["float", "vec2", "vec3", "vec4", "int", "bool"].includes(a) || (e[r] = {
|
|
1240
1330
|
value: i,
|
|
1241
1331
|
type: a
|
|
1242
1332
|
});
|
|
1243
1333
|
}
|
|
1244
1334
|
return e;
|
|
1245
1335
|
}
|
|
1246
|
-
function
|
|
1247
|
-
const
|
|
1248
|
-
if (
|
|
1336
|
+
function Zn(t, e) {
|
|
1337
|
+
const n = Object.keys(t), r = Object.keys(e);
|
|
1338
|
+
if (n.length !== r.length)
|
|
1249
1339
|
return !1;
|
|
1250
|
-
for (const o of
|
|
1340
|
+
for (const o of n) {
|
|
1251
1341
|
if (!(o in e))
|
|
1252
1342
|
return !1;
|
|
1253
1343
|
const s = t[o], i = e[o];
|
|
@@ -1264,168 +1354,168 @@ function $r(t, e) {
|
|
|
1264
1354
|
}
|
|
1265
1355
|
return !0;
|
|
1266
1356
|
}
|
|
1267
|
-
const
|
|
1268
|
-
function
|
|
1269
|
-
const t =
|
|
1270
|
-
const s = Z(
|
|
1357
|
+
const Qn = "std.shadertoy-canvas";
|
|
1358
|
+
function er() {
|
|
1359
|
+
const t = z(function({ nodeId: n, context: r, className: o }) {
|
|
1360
|
+
const s = Z(r.store, n), i = v(null), a = v(null), c = v(null), p = v(0), f = v(""), l = v({}), u = v({
|
|
1271
1361
|
x: 0,
|
|
1272
1362
|
y: 0,
|
|
1273
1363
|
clickX: 0,
|
|
1274
1364
|
clickY: 0,
|
|
1275
1365
|
isDown: !1
|
|
1276
|
-
}),
|
|
1277
|
-
|
|
1278
|
-
const
|
|
1279
|
-
if (
|
|
1366
|
+
}), d = s ? Gn(s.props?.shaderSource) : "", m = s ? Ie(s.props?.fps) ?? 60 : 60, b = s?.props?.uniforms, g = K(() => Xn(b), [b]), y = s ? Jn(s.props?.enableMouse) ?? !0 : !0, w = s ? Ie(s.props?.width) : void 0, T = s ? Ie(s.props?.height) : void 0, C = s ? Hn(qn(s.props?.className), o) : o;
|
|
1367
|
+
N(() => {
|
|
1368
|
+
const A = i.current;
|
|
1369
|
+
if (A) {
|
|
1280
1370
|
try {
|
|
1281
|
-
const
|
|
1282
|
-
a.current =
|
|
1283
|
-
} catch (
|
|
1284
|
-
console.error("[ShadertoyRenderer] Failed to create WebGL2 context:",
|
|
1371
|
+
const P = new Wn(A);
|
|
1372
|
+
a.current = P;
|
|
1373
|
+
} catch (P) {
|
|
1374
|
+
console.error("[ShadertoyRenderer] Failed to create WebGL2 context:", P);
|
|
1285
1375
|
}
|
|
1286
1376
|
return () => {
|
|
1287
1377
|
a.current && (a.current.destroy(), a.current = null);
|
|
1288
1378
|
};
|
|
1289
1379
|
}
|
|
1290
|
-
}, []),
|
|
1291
|
-
const
|
|
1292
|
-
if (!(!
|
|
1293
|
-
if (
|
|
1294
|
-
|
|
1380
|
+
}, []), N(() => {
|
|
1381
|
+
const A = a.current;
|
|
1382
|
+
if (!(!A || !d) && f.current !== d)
|
|
1383
|
+
if (A.compile(d, g))
|
|
1384
|
+
f.current = d, l.current = g;
|
|
1295
1385
|
else {
|
|
1296
|
-
const
|
|
1297
|
-
console.error("[ShadertoyRenderer] Shader compilation failed:",
|
|
1386
|
+
const U = A.getError();
|
|
1387
|
+
console.error("[ShadertoyRenderer] Shader compilation failed:", U);
|
|
1298
1388
|
}
|
|
1299
|
-
}, [
|
|
1300
|
-
const
|
|
1301
|
-
!
|
|
1302
|
-
}, [g]),
|
|
1303
|
-
const
|
|
1304
|
-
if (!
|
|
1305
|
-
const
|
|
1306
|
-
const F =
|
|
1307
|
-
F >=
|
|
1389
|
+
}, [d, g]), N(() => {
|
|
1390
|
+
const A = a.current;
|
|
1391
|
+
!A || !f.current || Zn(l.current, g) || (A.setCustomUniforms(g), l.current = g);
|
|
1392
|
+
}, [g]), N(() => {
|
|
1393
|
+
const A = a.current;
|
|
1394
|
+
if (!A || !f.current) return;
|
|
1395
|
+
const P = 1e3 / m, U = (M) => {
|
|
1396
|
+
const F = M - p.current;
|
|
1397
|
+
F >= P && (p.current = M - F % P, A.draw()), c.current = requestAnimationFrame(U);
|
|
1308
1398
|
};
|
|
1309
|
-
return c.current = requestAnimationFrame(
|
|
1399
|
+
return c.current = requestAnimationFrame(U), () => {
|
|
1310
1400
|
c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
|
|
1311
1401
|
};
|
|
1312
1402
|
}, [m]);
|
|
1313
|
-
const
|
|
1314
|
-
(
|
|
1403
|
+
const _ = D(
|
|
1404
|
+
(A) => {
|
|
1315
1405
|
if (!y) return;
|
|
1316
|
-
const
|
|
1317
|
-
if (!
|
|
1318
|
-
const
|
|
1319
|
-
u.current.x = F, u.current.y =
|
|
1406
|
+
const P = i.current, U = a.current;
|
|
1407
|
+
if (!P || !U) return;
|
|
1408
|
+
const M = P.getBoundingClientRect(), F = A.clientX - M.left, W = M.height - (A.clientY - M.top);
|
|
1409
|
+
u.current.x = F, u.current.y = W, U.setMouse(F, W, u.current.clickX, u.current.clickY);
|
|
1320
1410
|
},
|
|
1321
1411
|
[y]
|
|
1322
|
-
),
|
|
1323
|
-
(
|
|
1412
|
+
), B = D(
|
|
1413
|
+
(A) => {
|
|
1324
1414
|
if (!y) return;
|
|
1325
|
-
const
|
|
1326
|
-
if (!
|
|
1327
|
-
const
|
|
1328
|
-
u.current.isDown = !0, u.current.clickX = F, u.current.clickY =
|
|
1415
|
+
const P = i.current, U = a.current;
|
|
1416
|
+
if (!P || !U) return;
|
|
1417
|
+
const M = P.getBoundingClientRect(), F = A.clientX - M.left, W = M.height - (A.clientY - M.top);
|
|
1418
|
+
u.current.isDown = !0, u.current.clickX = F, u.current.clickY = W, U.setMouse(F, W, F, W);
|
|
1329
1419
|
},
|
|
1330
1420
|
[y]
|
|
1331
1421
|
), Q = D(() => {
|
|
1332
1422
|
y && (u.current.isDown = !1, u.current.clickX = -Math.abs(u.current.clickX));
|
|
1333
1423
|
}, [y]);
|
|
1334
|
-
return s ? /* @__PURE__ */
|
|
1424
|
+
return s ? /* @__PURE__ */ E.jsx(
|
|
1335
1425
|
"canvas",
|
|
1336
1426
|
{
|
|
1337
1427
|
ref: i,
|
|
1338
1428
|
"data-ikon-node-id": s.id,
|
|
1339
1429
|
"data-ikon-source": s.sourceMarker,
|
|
1340
|
-
className:
|
|
1341
|
-
...
|
|
1342
|
-
...
|
|
1343
|
-
onMouseMove:
|
|
1344
|
-
onMouseDown:
|
|
1430
|
+
className: C,
|
|
1431
|
+
...w ? { width: w } : {},
|
|
1432
|
+
...T ? { height: T } : {},
|
|
1433
|
+
onMouseMove: _,
|
|
1434
|
+
onMouseDown: B,
|
|
1345
1435
|
onMouseUp: Q,
|
|
1346
1436
|
onMouseLeave: Q
|
|
1347
1437
|
}
|
|
1348
1438
|
) : null;
|
|
1349
1439
|
});
|
|
1350
1440
|
return ({ type: e }) => {
|
|
1351
|
-
if (e ===
|
|
1441
|
+
if (e === Qn)
|
|
1352
1442
|
return t;
|
|
1353
1443
|
};
|
|
1354
1444
|
}
|
|
1355
|
-
const
|
|
1356
|
-
function
|
|
1357
|
-
t.registerModule(
|
|
1445
|
+
const tr = "shadertoy", nr = async () => er();
|
|
1446
|
+
function rr(t) {
|
|
1447
|
+
t.registerModule(tr, nr);
|
|
1358
1448
|
}
|
|
1359
|
-
const
|
|
1360
|
-
class
|
|
1449
|
+
const ot = ke("UIRegistry");
|
|
1450
|
+
class or {
|
|
1361
1451
|
baseResolvers = [];
|
|
1362
1452
|
moduleLoaders = /* @__PURE__ */ new Map();
|
|
1363
1453
|
moduleResolvers = /* @__PURE__ */ new Map();
|
|
1364
1454
|
activeModuleOrder = [];
|
|
1365
1455
|
registerResolvers(e) {
|
|
1366
|
-
const
|
|
1367
|
-
this.baseResolvers.push(...
|
|
1456
|
+
const n = Array.isArray(e) ? e : [e];
|
|
1457
|
+
this.baseResolvers.push(...n.filter(Boolean));
|
|
1368
1458
|
}
|
|
1369
|
-
registerModule(e,
|
|
1370
|
-
const
|
|
1371
|
-
if (!
|
|
1372
|
-
this.moduleLoaders.set(e,
|
|
1459
|
+
registerModule(e, n) {
|
|
1460
|
+
const r = this.moduleLoaders.get(e);
|
|
1461
|
+
if (!r) {
|
|
1462
|
+
this.moduleLoaders.set(e, n);
|
|
1373
1463
|
return;
|
|
1374
1464
|
}
|
|
1375
|
-
|
|
1465
|
+
r !== n && (this.moduleLoaders.set(e, n), this.moduleResolvers.delete(e));
|
|
1376
1466
|
}
|
|
1377
1467
|
async loadRegisteredModules() {
|
|
1378
1468
|
let e = !1;
|
|
1379
|
-
for (const [
|
|
1380
|
-
if (!this.moduleResolvers.has(
|
|
1469
|
+
for (const [r, o] of this.moduleLoaders.entries())
|
|
1470
|
+
if (!this.moduleResolvers.has(r))
|
|
1381
1471
|
try {
|
|
1382
|
-
const s = await o(), i =
|
|
1383
|
-
this.moduleResolvers.set(
|
|
1472
|
+
const s = await o(), i = ar(s);
|
|
1473
|
+
this.moduleResolvers.set(r, i), e = !0;
|
|
1384
1474
|
} catch (s) {
|
|
1385
|
-
|
|
1475
|
+
ot.error(`[IkonUiRegistry] Failed to load module '${r}'.`, s);
|
|
1386
1476
|
}
|
|
1387
|
-
const
|
|
1388
|
-
for (const
|
|
1389
|
-
this.moduleResolvers.has(
|
|
1390
|
-
return
|
|
1477
|
+
const n = [];
|
|
1478
|
+
for (const r of this.moduleLoaders.keys())
|
|
1479
|
+
this.moduleResolvers.has(r) && n.push(r);
|
|
1480
|
+
return cr(n, this.activeModuleOrder) || (this.activeModuleOrder = n, e = !0), e;
|
|
1391
1481
|
}
|
|
1392
1482
|
resolve(e) {
|
|
1393
|
-
for (const
|
|
1394
|
-
const
|
|
1395
|
-
if (
|
|
1483
|
+
for (const n of this.baseResolvers) {
|
|
1484
|
+
const r = n(e);
|
|
1485
|
+
if (r) return r;
|
|
1396
1486
|
}
|
|
1397
|
-
for (const
|
|
1398
|
-
const
|
|
1399
|
-
if (!
|
|
1400
|
-
|
|
1487
|
+
for (const n of this.activeModuleOrder) {
|
|
1488
|
+
const r = this.moduleResolvers.get(n);
|
|
1489
|
+
if (!r) {
|
|
1490
|
+
ot.warn(`Missing resolvers for module ${n}`);
|
|
1401
1491
|
continue;
|
|
1402
1492
|
}
|
|
1403
|
-
for (const o of
|
|
1493
|
+
for (const o of r) {
|
|
1404
1494
|
const s = o(e);
|
|
1405
1495
|
if (s) return s;
|
|
1406
1496
|
}
|
|
1407
1497
|
}
|
|
1408
1498
|
}
|
|
1409
1499
|
}
|
|
1410
|
-
function
|
|
1411
|
-
const t = new
|
|
1412
|
-
return
|
|
1500
|
+
function sr() {
|
|
1501
|
+
const t = new or();
|
|
1502
|
+
return Nn(t), Vn(t), rr(t), t.loadRegisteredModules(), t;
|
|
1413
1503
|
}
|
|
1414
|
-
function
|
|
1504
|
+
function ir(t) {
|
|
1415
1505
|
return Array.isArray(t) ? t : [t];
|
|
1416
1506
|
}
|
|
1417
|
-
function
|
|
1418
|
-
return t ?
|
|
1507
|
+
function ar(t) {
|
|
1508
|
+
return t ? ir(t).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
|
|
1419
1509
|
}
|
|
1420
|
-
function
|
|
1510
|
+
function cr(t, e) {
|
|
1421
1511
|
if (t.length !== e.length)
|
|
1422
1512
|
return !1;
|
|
1423
|
-
for (let
|
|
1424
|
-
if (t[
|
|
1513
|
+
for (let n = 0; n < t.length; n += 1)
|
|
1514
|
+
if (t[n] !== e[n])
|
|
1425
1515
|
return !1;
|
|
1426
1516
|
return !0;
|
|
1427
1517
|
}
|
|
1428
|
-
const
|
|
1518
|
+
const Oe = ke("MotionController"), st = {
|
|
1429
1519
|
ease: [0.25, 0.1, 0.25, 1],
|
|
1430
1520
|
"ease-in": [0.42, 0, 1, 1],
|
|
1431
1521
|
"ease-out": [0, 0, 0.58, 1],
|
|
@@ -1455,98 +1545,98 @@ const Ie = Re("MotionController"), nt = {
|
|
|
1455
1545
|
"ease-out-back": [0.175, 0.885, 0.32, 1.275],
|
|
1456
1546
|
"ease-in-out-back": [0.68, -0.55, 0.265, 1.55]
|
|
1457
1547
|
};
|
|
1458
|
-
function
|
|
1548
|
+
function $(t) {
|
|
1459
1549
|
return t <= 0 ? 0 : t >= 1 ? 1 : t;
|
|
1460
1550
|
}
|
|
1461
|
-
function
|
|
1551
|
+
function it(t) {
|
|
1462
1552
|
if (t == null) return;
|
|
1463
1553
|
const e = `${t}`.trim();
|
|
1464
1554
|
if (!e) return;
|
|
1465
|
-
const
|
|
1466
|
-
return Number.isFinite(
|
|
1555
|
+
const n = Number.parseFloat(e);
|
|
1556
|
+
return Number.isFinite(n) ? n : void 0;
|
|
1467
1557
|
}
|
|
1468
|
-
function
|
|
1558
|
+
function at(t) {
|
|
1469
1559
|
return typeof CSS < "u" && CSS.escape ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
1470
1560
|
}
|
|
1471
|
-
function
|
|
1472
|
-
const
|
|
1473
|
-
function l(g, y,
|
|
1474
|
-
return ((3 * y - 3 *
|
|
1561
|
+
function ct(t, e, n, r) {
|
|
1562
|
+
const f = new Float32Array(11);
|
|
1563
|
+
function l(g, y, w) {
|
|
1564
|
+
return ((3 * y - 3 * w + 1) * g + (3 * w - 6 * y)) * g * g + 3 * y * g;
|
|
1475
1565
|
}
|
|
1476
|
-
function u(g, y,
|
|
1477
|
-
return 3 * (3 * y - 3 *
|
|
1566
|
+
function u(g, y, w) {
|
|
1567
|
+
return 3 * (3 * y - 3 * w + 1) * g * g + 2 * (3 * w - 6 * y) * g + 3 * y;
|
|
1478
1568
|
}
|
|
1479
|
-
function
|
|
1480
|
-
for (let
|
|
1481
|
-
const
|
|
1482
|
-
if (
|
|
1569
|
+
function d(g, y) {
|
|
1570
|
+
for (let w = 0; w < 4; w += 1) {
|
|
1571
|
+
const T = u(y, t, n);
|
|
1572
|
+
if (T === 0)
|
|
1483
1573
|
return y;
|
|
1484
|
-
const
|
|
1485
|
-
y -=
|
|
1574
|
+
const C = l(y, t, n) - g;
|
|
1575
|
+
y -= C / T;
|
|
1486
1576
|
}
|
|
1487
1577
|
return y;
|
|
1488
1578
|
}
|
|
1489
|
-
function m(g, y,
|
|
1490
|
-
let
|
|
1579
|
+
function m(g, y, w) {
|
|
1580
|
+
let T = 0, C = 0, _ = 0;
|
|
1491
1581
|
do
|
|
1492
|
-
|
|
1493
|
-
while (Math.abs(
|
|
1494
|
-
return
|
|
1582
|
+
C = y + (w - y) / 2, T = l(C, t, n) - g, T > 0 ? w = C : y = C;
|
|
1583
|
+
while (Math.abs(T) > 1e-7 && ++_ < 10);
|
|
1584
|
+
return C;
|
|
1495
1585
|
}
|
|
1496
1586
|
function b(g) {
|
|
1497
|
-
let y = 0,
|
|
1498
|
-
const
|
|
1499
|
-
for (;
|
|
1587
|
+
let y = 0, w = 1;
|
|
1588
|
+
const T = 10;
|
|
1589
|
+
for (; w !== T && f[w] <= g; w += 1)
|
|
1500
1590
|
y += 0.1;
|
|
1501
|
-
|
|
1502
|
-
const
|
|
1503
|
-
return
|
|
1591
|
+
w -= 1;
|
|
1592
|
+
const C = (g - f[w]) / (f[w + 1] - f[w]), _ = y + C * 0.1, B = u(_, t, n);
|
|
1593
|
+
return B >= 1e-3 ? d(g, _) : B === 0 ? _ : m(g, y, y + 0.1);
|
|
1504
1594
|
}
|
|
1505
1595
|
for (let g = 0; g < 11; g += 1)
|
|
1506
|
-
|
|
1507
|
-
return (g) => g <= 0 ? 0 : g >= 1 ? 1 : l(b(g), e,
|
|
1596
|
+
f[g] = l(g * 0.1, t, n);
|
|
1597
|
+
return (g) => g <= 0 ? 0 : g >= 1 ? 1 : l(b(g), e, r);
|
|
1508
1598
|
}
|
|
1509
|
-
function
|
|
1599
|
+
function ur(t) {
|
|
1510
1600
|
const e = /steps\(\s*([0-9]+)\s*(?:,\s*([a-z-]+)\s*)?\)/i.exec(t);
|
|
1511
1601
|
if (!e)
|
|
1512
|
-
return (o) =>
|
|
1513
|
-
const
|
|
1514
|
-
return
|
|
1602
|
+
return (o) => $(o);
|
|
1603
|
+
const n = Math.max(1, parseInt(e[1], 10)), r = (e[2] ?? "end").toLowerCase();
|
|
1604
|
+
return r === "start" || r === "jump-start" ? (o) => $(Math.ceil(o * n) / n) : r === "none" || r === "jump-none" ? (o) => $(Math.round(o * n) / n) : r === "both" || r === "jump-both" ? (o) => $((Math.floor(o * n) + 0.5) / n) : (o) => $(Math.floor(o * n) / n);
|
|
1515
1605
|
}
|
|
1516
|
-
function
|
|
1606
|
+
function lr(t) {
|
|
1517
1607
|
if (!t)
|
|
1518
|
-
return (
|
|
1608
|
+
return (n) => $(n);
|
|
1519
1609
|
const e = t.trim().toLowerCase();
|
|
1520
1610
|
if (!e || e === "linear")
|
|
1521
|
-
return (
|
|
1522
|
-
if (
|
|
1523
|
-
const [
|
|
1524
|
-
return (a) =>
|
|
1611
|
+
return (n) => $(n);
|
|
1612
|
+
if (st[e]) {
|
|
1613
|
+
const [n, r, o, s] = st[e], i = ct(n, r, o, s);
|
|
1614
|
+
return (a) => $(i($(a)));
|
|
1525
1615
|
}
|
|
1526
1616
|
if (e.startsWith("cubic-bezier(") && e.endsWith(")")) {
|
|
1527
|
-
const
|
|
1528
|
-
if (
|
|
1529
|
-
const [o, s, i, a] =
|
|
1530
|
-
return (
|
|
1617
|
+
const r = e.slice(13, -1).split(",").map((o) => Number.parseFloat(o.trim()));
|
|
1618
|
+
if (r.length === 4 && r.every((o) => Number.isFinite(o))) {
|
|
1619
|
+
const [o, s, i, a] = r, c = ct(o, s, i, a);
|
|
1620
|
+
return (p) => $(c($(p)));
|
|
1531
1621
|
}
|
|
1532
1622
|
}
|
|
1533
1623
|
if (e.startsWith("steps(") && e.endsWith(")")) {
|
|
1534
|
-
const
|
|
1535
|
-
return (
|
|
1624
|
+
const n = ur(e);
|
|
1625
|
+
return (r) => n($(r));
|
|
1536
1626
|
}
|
|
1537
|
-
return (
|
|
1627
|
+
return (n) => $(n);
|
|
1538
1628
|
}
|
|
1539
|
-
function
|
|
1629
|
+
function dr(t) {
|
|
1540
1630
|
if (!t)
|
|
1541
1631
|
return;
|
|
1542
1632
|
const e = /(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)\s*->\s*(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)/.exec(t);
|
|
1543
1633
|
if (!e)
|
|
1544
1634
|
return;
|
|
1545
|
-
const [
|
|
1546
|
-
if (![
|
|
1547
|
-
return { inStart:
|
|
1635
|
+
const [n, r, o, s] = e.slice(1).map((i) => Number.parseFloat(i));
|
|
1636
|
+
if (![n, r, o, s].some((i) => !Number.isFinite(i)))
|
|
1637
|
+
return { inStart: n, inEnd: r, outStart: o, outEnd: s };
|
|
1548
1638
|
}
|
|
1549
|
-
class
|
|
1639
|
+
class fr {
|
|
1550
1640
|
bindingsByStyle = /* @__PURE__ */ new Map();
|
|
1551
1641
|
observer;
|
|
1552
1642
|
observeScheduled = !1;
|
|
@@ -1555,15 +1645,15 @@ class tn {
|
|
|
1555
1645
|
elementStates = /* @__PURE__ */ new Map();
|
|
1556
1646
|
styleToElements = /* @__PURE__ */ new Map();
|
|
1557
1647
|
globalCleanups = /* @__PURE__ */ new Set();
|
|
1558
|
-
registerStyle(e,
|
|
1648
|
+
registerStyle(e, n) {
|
|
1559
1649
|
if (!e)
|
|
1560
1650
|
return;
|
|
1561
|
-
const
|
|
1562
|
-
if (!
|
|
1651
|
+
const r = this.parseMetadata(n);
|
|
1652
|
+
if (!r) {
|
|
1563
1653
|
this.bindingsByStyle.delete(e), this.cleanupStyle(e);
|
|
1564
1654
|
return;
|
|
1565
1655
|
}
|
|
1566
|
-
this.bindingsByStyle.set(e,
|
|
1656
|
+
this.bindingsByStyle.set(e, r), this.cleanupStyle(e), this.ensureObserver(), this.scheduleScan(e);
|
|
1567
1657
|
}
|
|
1568
1658
|
unregisterStyle(e) {
|
|
1569
1659
|
e && (this.bindingsByStyle.delete(e), this.cleanupStyle(e), this.pendingScanStyles.delete(e));
|
|
@@ -1572,42 +1662,42 @@ class tn {
|
|
|
1572
1662
|
for (const e of Array.from(this.globalCleanups))
|
|
1573
1663
|
try {
|
|
1574
1664
|
e();
|
|
1575
|
-
} catch (
|
|
1576
|
-
|
|
1665
|
+
} catch (n) {
|
|
1666
|
+
Oe.warn("Failed to cleanup binding listener", n);
|
|
1577
1667
|
}
|
|
1578
1668
|
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);
|
|
1579
1669
|
}
|
|
1580
1670
|
parseMetadata(e) {
|
|
1581
1671
|
if (e)
|
|
1582
1672
|
try {
|
|
1583
|
-
const
|
|
1584
|
-
return
|
|
1585
|
-
} catch (
|
|
1586
|
-
|
|
1673
|
+
const r = (JSON.parse(e).motionBindings ?? []).map((o) => this.parseBinding(o)).filter((o) => o !== void 0);
|
|
1674
|
+
return r.length === 0 ? void 0 : { bindings: r };
|
|
1675
|
+
} catch (n) {
|
|
1676
|
+
Oe.warn("Failed to parse motion metadata", n);
|
|
1587
1677
|
return;
|
|
1588
1678
|
}
|
|
1589
1679
|
}
|
|
1590
1680
|
parseBinding(e) {
|
|
1591
|
-
const
|
|
1592
|
-
if (!
|
|
1681
|
+
const n = e.source?.trim();
|
|
1682
|
+
if (!n)
|
|
1593
1683
|
return;
|
|
1594
|
-
const
|
|
1595
|
-
return Number.isNaN(
|
|
1596
|
-
source:
|
|
1597
|
-
min:
|
|
1684
|
+
const r = it(e.min) ?? 0, o = it(e.max), s = o === void 0 ? r + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, c = lr(e.ease), p = dr(e.map), f = e.targetId?.trim() || void 0;
|
|
1685
|
+
return Number.isNaN(r) || Number.isNaN(s) ? void 0 : {
|
|
1686
|
+
source: n.toLowerCase(),
|
|
1687
|
+
min: r,
|
|
1598
1688
|
max: s,
|
|
1599
1689
|
clamp: i === "freeze-start" || i === "freeze-end" || i === "unclamped" ? i : "clamp",
|
|
1600
1690
|
reverse: a,
|
|
1601
1691
|
ease: c,
|
|
1602
|
-
map:
|
|
1603
|
-
targetId:
|
|
1692
|
+
map: p,
|
|
1693
|
+
targetId: f
|
|
1604
1694
|
};
|
|
1605
1695
|
}
|
|
1606
1696
|
ensureObserver() {
|
|
1607
1697
|
if (typeof document > "u" || this.observer)
|
|
1608
1698
|
return;
|
|
1609
1699
|
const e = () => {
|
|
1610
|
-
this.observer || typeof document > "u" || (this.observer = new MutationObserver((
|
|
1700
|
+
this.observer || typeof document > "u" || (this.observer = new MutationObserver((n) => this.handleMutations(n)), this.observer.observe(document.body, {
|
|
1611
1701
|
childList: !0,
|
|
1612
1702
|
subtree: !0,
|
|
1613
1703
|
attributes: !0,
|
|
@@ -1625,7 +1715,7 @@ class tn {
|
|
|
1625
1715
|
scheduleScan(e) {
|
|
1626
1716
|
if (typeof document > "u" || (this.pendingScanStyles.add(e), this.scanScheduled))
|
|
1627
1717
|
return;
|
|
1628
|
-
const
|
|
1718
|
+
const n = () => {
|
|
1629
1719
|
if (this.pendingScanStyles.size === 0) {
|
|
1630
1720
|
this.scanScheduled = !1;
|
|
1631
1721
|
return;
|
|
@@ -1634,82 +1724,82 @@ class tn {
|
|
|
1634
1724
|
this.pendingScanStyles.clear(), this.scanScheduled = !1;
|
|
1635
1725
|
for (const s of o)
|
|
1636
1726
|
this.scanExistingNodes(s);
|
|
1637
|
-
},
|
|
1638
|
-
this.scanScheduled = !0, typeof queueMicrotask == "function" ? queueMicrotask(
|
|
1727
|
+
}, r = () => {
|
|
1728
|
+
this.scanScheduled = !0, typeof queueMicrotask == "function" ? queueMicrotask(n) : setTimeout(n, 0);
|
|
1639
1729
|
};
|
|
1640
1730
|
document.readyState === "loading" ? document.addEventListener(
|
|
1641
1731
|
"DOMContentLoaded",
|
|
1642
1732
|
() => {
|
|
1643
|
-
|
|
1733
|
+
r();
|
|
1644
1734
|
},
|
|
1645
1735
|
{ once: !0 }
|
|
1646
|
-
) :
|
|
1736
|
+
) : r();
|
|
1647
1737
|
}
|
|
1648
1738
|
scanExistingNodes(e) {
|
|
1649
|
-
const
|
|
1650
|
-
if (!
|
|
1739
|
+
const n = this.bindingsByStyle.get(e);
|
|
1740
|
+
if (!n || typeof document > "u")
|
|
1651
1741
|
return;
|
|
1652
|
-
const
|
|
1653
|
-
document.querySelectorAll(
|
|
1742
|
+
const r = `.${at(e)}`;
|
|
1743
|
+
document.querySelectorAll(r).forEach((s) => this.applyStyleToElement(s, e, n));
|
|
1654
1744
|
}
|
|
1655
|
-
applyStyleToElement(e,
|
|
1656
|
-
this.ensureStyleState(e,
|
|
1745
|
+
applyStyleToElement(e, n, r) {
|
|
1746
|
+
this.ensureStyleState(e, n) && this.attachBindings(e, n, r);
|
|
1657
1747
|
}
|
|
1658
|
-
ensureStyleState(e,
|
|
1659
|
-
let
|
|
1660
|
-
if (
|
|
1748
|
+
ensureStyleState(e, n) {
|
|
1749
|
+
let r = this.elementStates.get(e);
|
|
1750
|
+
if (r || (r = /* @__PURE__ */ new Map(), this.elementStates.set(e, r)), r.has(n))
|
|
1661
1751
|
return !1;
|
|
1662
|
-
|
|
1663
|
-
let o = this.styleToElements.get(
|
|
1664
|
-
return o || (o = /* @__PURE__ */ new Set(), this.styleToElements.set(
|
|
1752
|
+
r.set(n, /* @__PURE__ */ new Set());
|
|
1753
|
+
let o = this.styleToElements.get(n);
|
|
1754
|
+
return o || (o = /* @__PURE__ */ new Set(), this.styleToElements.set(n, o)), o.add(e), !0;
|
|
1665
1755
|
}
|
|
1666
|
-
attachBindings(e,
|
|
1667
|
-
for (const o of
|
|
1668
|
-
this.attachBinding(e,
|
|
1756
|
+
attachBindings(e, n, r) {
|
|
1757
|
+
for (const o of r.bindings)
|
|
1758
|
+
this.attachBinding(e, n, o);
|
|
1669
1759
|
}
|
|
1670
|
-
attachBinding(e,
|
|
1671
|
-
switch (
|
|
1760
|
+
attachBinding(e, n, r) {
|
|
1761
|
+
switch (r.source) {
|
|
1672
1762
|
case "scrolly":
|
|
1673
|
-
this.attachScrollBinding(e,
|
|
1763
|
+
this.attachScrollBinding(e, n, r);
|
|
1674
1764
|
break;
|
|
1675
1765
|
}
|
|
1676
1766
|
}
|
|
1677
|
-
attachScrollBinding(e,
|
|
1678
|
-
const o = this.resolveScrollContainer(e,
|
|
1767
|
+
attachScrollBinding(e, n, r) {
|
|
1768
|
+
const o = this.resolveScrollContainer(e, r);
|
|
1679
1769
|
if (!o)
|
|
1680
1770
|
return;
|
|
1681
1771
|
const s = () => {
|
|
1682
|
-
this.applyBindingValues(e,
|
|
1772
|
+
this.applyBindingValues(e, r, o.scrollTop);
|
|
1683
1773
|
};
|
|
1684
1774
|
s();
|
|
1685
1775
|
const i = new AbortController();
|
|
1686
|
-
o.addEventListener("scroll", s, { passive: !0, signal: i.signal }), this.registerCleanup(e,
|
|
1776
|
+
o.addEventListener("scroll", s, { passive: !0, signal: i.signal }), this.registerCleanup(e, n, () => i.abort());
|
|
1687
1777
|
const a = () => s();
|
|
1688
|
-
window.addEventListener("resize", a), this.registerCleanup(e,
|
|
1778
|
+
window.addEventListener("resize", a), this.registerCleanup(e, n, () => window.removeEventListener("resize", a));
|
|
1689
1779
|
}
|
|
1690
|
-
resolveScrollContainer(e,
|
|
1691
|
-
if (
|
|
1692
|
-
const
|
|
1780
|
+
resolveScrollContainer(e, n) {
|
|
1781
|
+
if (n.targetId) {
|
|
1782
|
+
const r = `[data-ikon-motion-source="${at(n.targetId)}"]`, o = typeof document < "u" ? document.querySelector(r) : null;
|
|
1693
1783
|
if (o)
|
|
1694
1784
|
return o;
|
|
1695
1785
|
}
|
|
1696
1786
|
return e.closest('[data-ikon-view-type="scroll-view"]');
|
|
1697
1787
|
}
|
|
1698
|
-
applyBindingValues(e,
|
|
1699
|
-
const o =
|
|
1700
|
-
let i = this.applyClamp(s,
|
|
1701
|
-
|
|
1702
|
-
const a =
|
|
1703
|
-
if (e.style.setProperty("--tw-motion-bind-source-value", `${
|
|
1704
|
-
const
|
|
1705
|
-
|
|
1788
|
+
applyBindingValues(e, n, r) {
|
|
1789
|
+
const o = n.max - n.min, s = o === 0 ? r > n.min ? 1 : 0 : (r - n.min) / o;
|
|
1790
|
+
let i = this.applyClamp(s, n.clamp);
|
|
1791
|
+
n.reverse && (i = 1 - i);
|
|
1792
|
+
const a = n.ease(i), c = Number.isFinite(a) ? a : 0, p = c * 100;
|
|
1793
|
+
if (e.style.setProperty("--tw-motion-bind-source-value", `${r}`), e.style.setProperty("--tw-motion-bind-progress-ratio", `${c}`), e.style.setProperty("--tw-motion-bind-progress", `${p}`), n.map) {
|
|
1794
|
+
const f = this.applyMap(p, n.map);
|
|
1795
|
+
f !== void 0 && e.style.setProperty("--tw-motion-bind-value", `${f}`);
|
|
1706
1796
|
} else
|
|
1707
1797
|
e.style.removeProperty("--tw-motion-bind-value");
|
|
1708
1798
|
}
|
|
1709
|
-
applyClamp(e,
|
|
1799
|
+
applyClamp(e, n) {
|
|
1710
1800
|
if (!Number.isFinite(e))
|
|
1711
1801
|
return 0;
|
|
1712
|
-
switch (
|
|
1802
|
+
switch (n) {
|
|
1713
1803
|
case "freeze-start":
|
|
1714
1804
|
return e < 0 ? 0 : e;
|
|
1715
1805
|
case "freeze-end":
|
|
@@ -1717,108 +1807,108 @@ class tn {
|
|
|
1717
1807
|
case "unclamped":
|
|
1718
1808
|
return e;
|
|
1719
1809
|
default:
|
|
1720
|
-
return
|
|
1810
|
+
return $(e);
|
|
1721
1811
|
}
|
|
1722
1812
|
}
|
|
1723
|
-
applyMap(e,
|
|
1724
|
-
const
|
|
1725
|
-
if (
|
|
1726
|
-
return
|
|
1727
|
-
const o = (e -
|
|
1728
|
-
return
|
|
1813
|
+
applyMap(e, n) {
|
|
1814
|
+
const r = n.inEnd - n.inStart;
|
|
1815
|
+
if (r === 0)
|
|
1816
|
+
return n.outEnd;
|
|
1817
|
+
const o = (e - n.inStart) / r;
|
|
1818
|
+
return n.outStart + o * (n.outEnd - n.outStart);
|
|
1729
1819
|
}
|
|
1730
|
-
registerCleanup(e,
|
|
1731
|
-
const s = this.elementStates.get(e)?.get(
|
|
1732
|
-
s && (s.add(
|
|
1820
|
+
registerCleanup(e, n, r) {
|
|
1821
|
+
const s = this.elementStates.get(e)?.get(n);
|
|
1822
|
+
s && (s.add(r), this.globalCleanups.add(r));
|
|
1733
1823
|
}
|
|
1734
1824
|
cleanupStyle(e) {
|
|
1735
|
-
const
|
|
1736
|
-
if (!
|
|
1825
|
+
const n = this.styleToElements.get(e);
|
|
1826
|
+
if (!n)
|
|
1737
1827
|
return;
|
|
1738
|
-
const
|
|
1739
|
-
for (const o of
|
|
1828
|
+
const r = Array.from(n);
|
|
1829
|
+
for (const o of r)
|
|
1740
1830
|
this.cleanupElementStyle(o, e);
|
|
1741
1831
|
this.styleToElements.delete(e);
|
|
1742
1832
|
}
|
|
1743
1833
|
cleanupElement(e) {
|
|
1744
|
-
const
|
|
1745
|
-
if (!
|
|
1834
|
+
const n = this.elementStates.get(e);
|
|
1835
|
+
if (!n)
|
|
1746
1836
|
return;
|
|
1747
|
-
const
|
|
1748
|
-
for (const o of
|
|
1837
|
+
const r = Array.from(n.keys());
|
|
1838
|
+
for (const o of r)
|
|
1749
1839
|
this.cleanupElementStyle(e, o);
|
|
1750
1840
|
}
|
|
1751
|
-
cleanupElementStyle(e,
|
|
1752
|
-
const
|
|
1753
|
-
if (!
|
|
1841
|
+
cleanupElementStyle(e, n) {
|
|
1842
|
+
const r = this.elementStates.get(e);
|
|
1843
|
+
if (!r)
|
|
1754
1844
|
return;
|
|
1755
|
-
const o =
|
|
1845
|
+
const o = r.get(n);
|
|
1756
1846
|
if (!o)
|
|
1757
1847
|
return;
|
|
1758
1848
|
for (const i of o) {
|
|
1759
1849
|
try {
|
|
1760
1850
|
i();
|
|
1761
1851
|
} catch (a) {
|
|
1762
|
-
|
|
1852
|
+
Oe.warn("Failed to cleanup listener", a);
|
|
1763
1853
|
}
|
|
1764
1854
|
this.globalCleanups.delete(i);
|
|
1765
1855
|
}
|
|
1766
|
-
o.clear(),
|
|
1767
|
-
const s = this.styleToElements.get(
|
|
1768
|
-
s && (s.delete(e), s.size === 0 && this.styleToElements.delete(
|
|
1856
|
+
o.clear(), r.delete(n);
|
|
1857
|
+
const s = this.styleToElements.get(n);
|
|
1858
|
+
s && (s.delete(e), s.size === 0 && this.styleToElements.delete(n)), r.size === 0 && (this.elementStates.delete(e), this.clearBindingProperties(e));
|
|
1769
1859
|
}
|
|
1770
1860
|
clearBindingProperties(e) {
|
|
1771
1861
|
e.style.removeProperty("--tw-motion-bind-source-value"), e.style.removeProperty("--tw-motion-bind-progress"), e.style.removeProperty("--tw-motion-bind-progress-ratio"), e.style.removeProperty("--tw-motion-bind-value");
|
|
1772
1862
|
}
|
|
1773
1863
|
handleMutations(e) {
|
|
1774
|
-
for (const
|
|
1775
|
-
|
|
1864
|
+
for (const n of e)
|
|
1865
|
+
n.type === "childList" ? (n.addedNodes.forEach((r) => this.scanNode(r)), n.removedNodes.forEach((r) => this.cleanupNode(r))) : n.type === "attributes" && n.target instanceof HTMLElement && this.handleClassMutation(n.target);
|
|
1776
1866
|
}
|
|
1777
1867
|
handleClassMutation(e) {
|
|
1778
|
-
const
|
|
1779
|
-
if (!
|
|
1868
|
+
const n = this.elementStates.get(e);
|
|
1869
|
+
if (!n) {
|
|
1780
1870
|
this.processElement(e);
|
|
1781
1871
|
return;
|
|
1782
1872
|
}
|
|
1783
|
-
for (const
|
|
1784
|
-
e.classList.contains(
|
|
1873
|
+
for (const r of n.keys())
|
|
1874
|
+
e.classList.contains(r) || this.cleanupElementStyle(e, r);
|
|
1785
1875
|
this.processElement(e);
|
|
1786
1876
|
}
|
|
1787
1877
|
scanNode(e) {
|
|
1788
1878
|
if (!(e instanceof HTMLElement))
|
|
1789
1879
|
return;
|
|
1790
|
-
this.processElement(e), e.querySelectorAll("[class]").forEach((
|
|
1880
|
+
this.processElement(e), e.querySelectorAll("[class]").forEach((r) => this.processElement(r));
|
|
1791
1881
|
}
|
|
1792
1882
|
cleanupNode(e) {
|
|
1793
1883
|
if (!(e instanceof HTMLElement))
|
|
1794
1884
|
return;
|
|
1795
|
-
this.cleanupElement(e), e.querySelectorAll("[class]").forEach((
|
|
1885
|
+
this.cleanupElement(e), e.querySelectorAll("[class]").forEach((r) => this.cleanupElement(r));
|
|
1796
1886
|
}
|
|
1797
1887
|
processElement(e) {
|
|
1798
1888
|
if (!e.classList || e.classList.length === 0)
|
|
1799
1889
|
return;
|
|
1800
|
-
const
|
|
1801
|
-
for (let
|
|
1802
|
-
const o = r
|
|
1890
|
+
const n = e.classList;
|
|
1891
|
+
for (let r = 0; r < n.length; r++) {
|
|
1892
|
+
const o = n[r], s = this.bindingsByStyle.get(o);
|
|
1803
1893
|
s && this.ensureStyleState(e, o) && this.attachBindings(e, o, s);
|
|
1804
1894
|
}
|
|
1805
1895
|
}
|
|
1806
1896
|
}
|
|
1807
|
-
const
|
|
1808
|
-
function
|
|
1809
|
-
const e =
|
|
1897
|
+
const Ne = new fr();
|
|
1898
|
+
function pr(t) {
|
|
1899
|
+
const e = v(/* @__PURE__ */ new Map()), n = D(({ styleId: s, css: i, common: a }) => {
|
|
1810
1900
|
if (!(!s || typeof document > "u")) {
|
|
1811
1901
|
if (i) {
|
|
1812
1902
|
let c = e.current.get(s);
|
|
1813
1903
|
c || (c = document.createElement("style"), c.setAttribute("data-ikon-style-id", s), document.head.appendChild(c), e.current.set(s, c)), c.textContent = i;
|
|
1814
1904
|
}
|
|
1815
|
-
|
|
1905
|
+
Ne.registerStyle(s, a);
|
|
1816
1906
|
}
|
|
1817
|
-
}, []),
|
|
1907
|
+
}, []), r = D((s) => {
|
|
1818
1908
|
if (!(typeof document > "u"))
|
|
1819
1909
|
for (const i of s) {
|
|
1820
1910
|
const a = e.current.get(i);
|
|
1821
|
-
a && (a.remove(), e.current.delete(i)),
|
|
1911
|
+
a && (a.remove(), e.current.delete(i)), Ne.unregisterStyle(i);
|
|
1822
1912
|
}
|
|
1823
1913
|
}, []), o = D(() => {
|
|
1824
1914
|
if (typeof document < "u") {
|
|
@@ -1826,117 +1916,117 @@ function rn(t) {
|
|
|
1826
1916
|
s.remove();
|
|
1827
1917
|
e.current.clear();
|
|
1828
1918
|
}
|
|
1829
|
-
|
|
1919
|
+
Ne.reset();
|
|
1830
1920
|
}, []);
|
|
1831
|
-
return
|
|
1921
|
+
return N(() => {
|
|
1832
1922
|
if (!t) return;
|
|
1833
1923
|
for (const a of t.getUiStyles())
|
|
1834
|
-
|
|
1835
|
-
const s = t.subscribeToStyles(
|
|
1924
|
+
n(a);
|
|
1925
|
+
const s = t.subscribeToStyles(n), i = t.subscribeToStyleDeletes?.(r);
|
|
1836
1926
|
return () => {
|
|
1837
1927
|
s?.(), i?.(), o();
|
|
1838
1928
|
};
|
|
1839
|
-
}, [t, o,
|
|
1929
|
+
}, [t, o, n, r]), N(() => () => o(), [o]), { setStyle: n, deleteStyles: r, reset: o };
|
|
1840
1930
|
}
|
|
1841
|
-
function
|
|
1931
|
+
function hr(t) {
|
|
1842
1932
|
const e = [];
|
|
1843
|
-
for (const [
|
|
1844
|
-
const o =
|
|
1845
|
-
e.push(`${
|
|
1933
|
+
for (const [n, r] of t) {
|
|
1934
|
+
const o = r.store.getSnapshot(), s = o.rootViewId && o.views.has(o.rootViewId);
|
|
1935
|
+
e.push(`${n}:${s ? "1" : "0"}`);
|
|
1846
1936
|
}
|
|
1847
1937
|
return e.sort(), e.join(",");
|
|
1848
1938
|
}
|
|
1849
|
-
function
|
|
1850
|
-
const [e,
|
|
1851
|
-
return
|
|
1939
|
+
function mr(t) {
|
|
1940
|
+
const [e, n] = Y(), r = v("");
|
|
1941
|
+
return N(() => {
|
|
1852
1942
|
if (!t) {
|
|
1853
|
-
|
|
1943
|
+
n(void 0), r.current = "";
|
|
1854
1944
|
return;
|
|
1855
1945
|
}
|
|
1856
1946
|
const o = () => {
|
|
1857
|
-
const s = t.getStores(), i =
|
|
1858
|
-
i !==
|
|
1947
|
+
const s = t.getStores(), i = hr(s);
|
|
1948
|
+
i !== r.current && (r.current = i, n(s));
|
|
1859
1949
|
};
|
|
1860
1950
|
return o(), t.subscribe(o);
|
|
1861
1951
|
}, [t]), e;
|
|
1862
1952
|
}
|
|
1863
|
-
var
|
|
1864
|
-
function
|
|
1865
|
-
var e =
|
|
1953
|
+
var gr = typeof global == "object" && global && global.Object === Object && global, yr = typeof self == "object" && self && self.Object === Object && self, br = gr || yr || Function("return this")(), ve = br.Symbol, Et = Object.prototype, Sr = Et.hasOwnProperty, wr = Et.toString, le = ve ? ve.toStringTag : void 0;
|
|
1954
|
+
function vr(t) {
|
|
1955
|
+
var e = Sr.call(t, le), n = t[le];
|
|
1866
1956
|
try {
|
|
1867
|
-
t[
|
|
1868
|
-
var
|
|
1957
|
+
t[le] = void 0;
|
|
1958
|
+
var r = !0;
|
|
1869
1959
|
} catch {
|
|
1870
1960
|
}
|
|
1871
|
-
var o =
|
|
1872
|
-
return
|
|
1961
|
+
var o = wr.call(t);
|
|
1962
|
+
return r && (e ? t[le] = n : delete t[le]), o;
|
|
1873
1963
|
}
|
|
1874
|
-
var
|
|
1875
|
-
function
|
|
1876
|
-
return
|
|
1964
|
+
var Er = Object.prototype, Rr = Er.toString;
|
|
1965
|
+
function kr(t) {
|
|
1966
|
+
return Rr.call(t);
|
|
1877
1967
|
}
|
|
1878
|
-
var
|
|
1879
|
-
function
|
|
1880
|
-
return t == null ? t === void 0 ?
|
|
1968
|
+
var Ar = "[object Null]", Tr = "[object Undefined]", ut = ve ? ve.toStringTag : void 0;
|
|
1969
|
+
function Cr(t) {
|
|
1970
|
+
return t == null ? t === void 0 ? Tr : Ar : ut && ut in Object(t) ? vr(t) : kr(t);
|
|
1881
1971
|
}
|
|
1882
|
-
function
|
|
1972
|
+
function Ir(t) {
|
|
1883
1973
|
return t != null && typeof t == "object";
|
|
1884
1974
|
}
|
|
1885
|
-
var
|
|
1886
|
-
function
|
|
1887
|
-
return typeof t == "string" || !
|
|
1975
|
+
var Or = Array.isArray, Nr = "[object String]";
|
|
1976
|
+
function _r(t) {
|
|
1977
|
+
return typeof t == "string" || !Or(t) && Ir(t) && Cr(t) == Nr;
|
|
1888
1978
|
}
|
|
1889
|
-
const
|
|
1890
|
-
function
|
|
1979
|
+
const lt = "ikonUiModules";
|
|
1980
|
+
function Fe(t) {
|
|
1891
1981
|
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
1892
1982
|
}
|
|
1893
|
-
function
|
|
1983
|
+
function Pr(t) {
|
|
1894
1984
|
if (!Array.isArray(t))
|
|
1895
1985
|
return;
|
|
1896
1986
|
const e = /* @__PURE__ */ new Set();
|
|
1897
|
-
for (const
|
|
1898
|
-
if (!
|
|
1899
|
-
const
|
|
1900
|
-
|
|
1987
|
+
for (const n of t) {
|
|
1988
|
+
if (!_r(n)) continue;
|
|
1989
|
+
const r = n.trim();
|
|
1990
|
+
r && (e.has(r) || e.add(r));
|
|
1901
1991
|
}
|
|
1902
1992
|
return Array.from(e);
|
|
1903
1993
|
}
|
|
1904
|
-
function
|
|
1994
|
+
function xo(t, e) {
|
|
1905
1995
|
if (t === e)
|
|
1906
1996
|
return !0;
|
|
1907
1997
|
if (!t || !e)
|
|
1908
1998
|
return !t && !e;
|
|
1909
1999
|
if (t.length !== e.length)
|
|
1910
2000
|
return !1;
|
|
1911
|
-
for (let
|
|
1912
|
-
if (t[
|
|
2001
|
+
for (let n = 0; n < t.length; n += 1)
|
|
2002
|
+
if (t[n] !== e[n])
|
|
1913
2003
|
return !1;
|
|
1914
2004
|
return !0;
|
|
1915
2005
|
}
|
|
1916
|
-
function
|
|
1917
|
-
if (!(!
|
|
1918
|
-
return
|
|
2006
|
+
function Mr(t) {
|
|
2007
|
+
if (!(!Fe(t) || !Object.prototype.hasOwnProperty.call(t, lt)))
|
|
2008
|
+
return Pr(t[lt]);
|
|
1919
2009
|
}
|
|
1920
|
-
function
|
|
2010
|
+
function jo(...t) {
|
|
1921
2011
|
for (const e of t) {
|
|
1922
|
-
const
|
|
1923
|
-
if (
|
|
1924
|
-
return
|
|
2012
|
+
const n = Mr(e);
|
|
2013
|
+
if (n !== void 0)
|
|
2014
|
+
return n;
|
|
1925
2015
|
}
|
|
1926
2016
|
}
|
|
1927
|
-
function
|
|
1928
|
-
if (!
|
|
2017
|
+
function Uo(t) {
|
|
2018
|
+
if (!Fe(t))
|
|
1929
2019
|
return;
|
|
1930
|
-
const e = t,
|
|
1931
|
-
if (!
|
|
2020
|
+
const e = t, n = Object.keys(e).find((c) => c.toLowerCase() === "modules");
|
|
2021
|
+
if (!n)
|
|
1932
2022
|
return;
|
|
1933
|
-
const
|
|
1934
|
-
if (
|
|
2023
|
+
const r = e[n];
|
|
2024
|
+
if (r === null)
|
|
1935
2025
|
return { resetToDefault: !0 };
|
|
1936
|
-
if (!Array.isArray(
|
|
2026
|
+
if (!Array.isArray(r))
|
|
1937
2027
|
return;
|
|
1938
2028
|
const o = [], s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set();
|
|
1939
|
-
for (const c of
|
|
2029
|
+
for (const c of r) {
|
|
1940
2030
|
if (typeof c == "string") {
|
|
1941
2031
|
const b = c.trim();
|
|
1942
2032
|
if (!b || i.has(b))
|
|
@@ -1944,38 +2034,38 @@ function Co(t) {
|
|
|
1944
2034
|
o.push(b), i.add(b);
|
|
1945
2035
|
continue;
|
|
1946
2036
|
}
|
|
1947
|
-
if (!
|
|
2037
|
+
if (!Fe(c))
|
|
1948
2038
|
continue;
|
|
1949
|
-
const
|
|
1950
|
-
if (!
|
|
2039
|
+
const p = c, f = Object.keys(p).find((b) => b.toLowerCase() === "name");
|
|
2040
|
+
if (!f)
|
|
1951
2041
|
continue;
|
|
1952
|
-
const l =
|
|
2042
|
+
const l = p[f];
|
|
1953
2043
|
if (typeof l != "string")
|
|
1954
2044
|
continue;
|
|
1955
2045
|
const u = l.trim();
|
|
1956
2046
|
if (!u)
|
|
1957
2047
|
continue;
|
|
1958
|
-
const
|
|
2048
|
+
const d = Object.keys(p).find((b) => b.toLowerCase() === "javascript"), m = d ? p[d] : void 0;
|
|
1959
2049
|
typeof m == "string" && s.set(u, m), i.has(u) || (o.push(u), i.add(u));
|
|
1960
2050
|
}
|
|
1961
2051
|
if (!o.length && s.size === 0)
|
|
1962
2052
|
return { modules: [] };
|
|
1963
|
-
const a = Array.from(s.entries()).map(([c,
|
|
2053
|
+
const a = Array.from(s.entries()).map(([c, p]) => ({
|
|
1964
2054
|
name: c,
|
|
1965
|
-
javascript:
|
|
2055
|
+
javascript: p
|
|
1966
2056
|
}));
|
|
1967
2057
|
return a.length > 0 ? { modules: o, inlineModules: a } : { modules: o };
|
|
1968
2058
|
}
|
|
1969
|
-
const
|
|
2059
|
+
const R = {
|
|
1970
2060
|
None: 0,
|
|
1971
2061
|
Letter: 1,
|
|
1972
2062
|
Word: 2,
|
|
1973
2063
|
Line: 4,
|
|
1974
2064
|
Paragraph: 8,
|
|
1975
2065
|
Emoji: 16
|
|
1976
|
-
},
|
|
2066
|
+
}, Lr = [
|
|
1977
2067
|
{
|
|
1978
|
-
flag:
|
|
2068
|
+
flag: R.Letter,
|
|
1979
2069
|
hints: [
|
|
1980
2070
|
"[data-motion-letter]",
|
|
1981
2071
|
"[data-letter]",
|
|
@@ -1984,7 +2074,7 @@ const k = {
|
|
|
1984
2074
|
]
|
|
1985
2075
|
},
|
|
1986
2076
|
{
|
|
1987
|
-
flag:
|
|
2077
|
+
flag: R.Word,
|
|
1988
2078
|
hints: [
|
|
1989
2079
|
"[data-motion-word]",
|
|
1990
2080
|
"[data-word]",
|
|
@@ -1993,7 +2083,7 @@ const k = {
|
|
|
1993
2083
|
]
|
|
1994
2084
|
},
|
|
1995
2085
|
{
|
|
1996
|
-
flag:
|
|
2086
|
+
flag: R.Line,
|
|
1997
2087
|
hints: [
|
|
1998
2088
|
"[data-motion-line]",
|
|
1999
2089
|
"[data-line]",
|
|
@@ -2002,7 +2092,7 @@ const k = {
|
|
|
2002
2092
|
]
|
|
2003
2093
|
},
|
|
2004
2094
|
{
|
|
2005
|
-
flag:
|
|
2095
|
+
flag: R.Paragraph,
|
|
2006
2096
|
hints: [
|
|
2007
2097
|
"[data-motion-paragraph]",
|
|
2008
2098
|
"[data-paragraph]",
|
|
@@ -2013,7 +2103,7 @@ const k = {
|
|
|
2013
2103
|
]
|
|
2014
2104
|
},
|
|
2015
2105
|
{
|
|
2016
|
-
flag:
|
|
2106
|
+
flag: R.Emoji,
|
|
2017
2107
|
hints: [
|
|
2018
2108
|
":is([data-motion-emoji],[data-emoji],.tw-motion-emoji,.tw-emoji)",
|
|
2019
2109
|
"[data-motion-emoji]",
|
|
@@ -2022,160 +2112,160 @@ const k = {
|
|
|
2022
2112
|
"[data-emoji]"
|
|
2023
2113
|
]
|
|
2024
2114
|
}
|
|
2025
|
-
],
|
|
2026
|
-
function
|
|
2027
|
-
if (!t || t.length >
|
|
2115
|
+
], $e = R.Letter | R.Word | R.Line | R.Paragraph | R.Emoji, xr = R.Letter | R.Word | R.Line | R.Paragraph, dt = /* @__PURE__ */ new Map(), jr = 16384;
|
|
2116
|
+
function Do(t, e) {
|
|
2117
|
+
if (!t || t.length > jr)
|
|
2028
2118
|
return t;
|
|
2029
|
-
const
|
|
2030
|
-
if (o ===
|
|
2119
|
+
const n = Qr(e), r = se(n, R.Emoji), o = n & xr;
|
|
2120
|
+
if (o === R.None && !r)
|
|
2031
2121
|
return t;
|
|
2032
2122
|
const s = t.replace(/\r\n/g, `
|
|
2033
2123
|
`).replace(/\r/g, `
|
|
2034
2124
|
`);
|
|
2035
|
-
if (o ===
|
|
2036
|
-
return
|
|
2037
|
-
const i =
|
|
2125
|
+
if (o === R.None)
|
|
2126
|
+
return mt(s);
|
|
2127
|
+
const i = Xr(s);
|
|
2038
2128
|
if (i.length === 0)
|
|
2039
|
-
return
|
|
2040
|
-
const a =
|
|
2041
|
-
for (const
|
|
2042
|
-
const l =
|
|
2043
|
-
|
|
2129
|
+
return r ? mt(s) : t;
|
|
2130
|
+
const a = Zr(i), c = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, p = [];
|
|
2131
|
+
for (const f of a) {
|
|
2132
|
+
const l = Ur(f, n, c);
|
|
2133
|
+
p.push(...l);
|
|
2044
2134
|
}
|
|
2045
|
-
return
|
|
2135
|
+
return p;
|
|
2046
2136
|
}
|
|
2047
|
-
function
|
|
2048
|
-
const
|
|
2137
|
+
function Ur(t, e, n) {
|
|
2138
|
+
const r = [];
|
|
2049
2139
|
for (const o of t) {
|
|
2050
|
-
const s =
|
|
2051
|
-
|
|
2140
|
+
const s = Dr(o, e, n);
|
|
2141
|
+
r.push(...s);
|
|
2052
2142
|
}
|
|
2053
|
-
if (
|
|
2054
|
-
const o =
|
|
2143
|
+
if (se(e, R.Paragraph)) {
|
|
2144
|
+
const o = n.paragraph++;
|
|
2055
2145
|
return [
|
|
2056
|
-
/* @__PURE__ */
|
|
2146
|
+
/* @__PURE__ */ E.jsx(
|
|
2057
2147
|
"span",
|
|
2058
2148
|
{
|
|
2059
2149
|
"data-motion-paragraph": !0,
|
|
2060
|
-
style:
|
|
2061
|
-
children:
|
|
2150
|
+
style: Ae(o),
|
|
2151
|
+
children: r
|
|
2062
2152
|
},
|
|
2063
2153
|
`motion-paragraph-${o}`
|
|
2064
2154
|
)
|
|
2065
2155
|
];
|
|
2066
2156
|
}
|
|
2067
|
-
return
|
|
2157
|
+
return r;
|
|
2068
2158
|
}
|
|
2069
|
-
function
|
|
2070
|
-
const
|
|
2071
|
-
if (
|
|
2072
|
-
const s =
|
|
2159
|
+
function Dr(t, e, n) {
|
|
2160
|
+
const r = Br(t.text, e, n), o = [];
|
|
2161
|
+
if (se(e, R.Line)) {
|
|
2162
|
+
const s = n.line++;
|
|
2073
2163
|
o.push(
|
|
2074
|
-
/* @__PURE__ */
|
|
2164
|
+
/* @__PURE__ */ E.jsx("span", { "data-motion-line": !0, style: Ae(s), children: r }, `motion-line-${s}`)
|
|
2075
2165
|
);
|
|
2076
2166
|
} else
|
|
2077
|
-
o.push(...
|
|
2167
|
+
o.push(...r);
|
|
2078
2168
|
for (let s = 0; s < t.breaks; s++)
|
|
2079
|
-
o.push(/* @__PURE__ */
|
|
2169
|
+
o.push(/* @__PURE__ */ E.jsx("br", {}, `motion-break-${n.br++}`));
|
|
2080
2170
|
return o;
|
|
2081
2171
|
}
|
|
2082
|
-
function
|
|
2172
|
+
function Br(t, e, n) {
|
|
2083
2173
|
if (!t)
|
|
2084
2174
|
return [];
|
|
2085
|
-
const
|
|
2175
|
+
const r = se(e, R.Word), o = [], s = /(\s+)/g;
|
|
2086
2176
|
let i = 0, a;
|
|
2087
2177
|
for (; (a = s.exec(t)) !== null; ) {
|
|
2088
2178
|
if (a.index > i) {
|
|
2089
2179
|
const c = t.slice(i, a.index);
|
|
2090
|
-
o.push(
|
|
2180
|
+
o.push(ft(c, n, e, r));
|
|
2091
2181
|
}
|
|
2092
2182
|
o.push(a[0]), i = a.index + a[0].length;
|
|
2093
2183
|
}
|
|
2094
2184
|
if (i < t.length) {
|
|
2095
2185
|
const c = t.slice(i);
|
|
2096
|
-
o.push(
|
|
2186
|
+
o.push(ft(c, n, e, r));
|
|
2097
2187
|
}
|
|
2098
2188
|
return o;
|
|
2099
2189
|
}
|
|
2100
|
-
function
|
|
2101
|
-
const o = e.word++, s =
|
|
2102
|
-
return
|
|
2190
|
+
function ft(t, e, n, r) {
|
|
2191
|
+
const o = e.word++, s = $r(t, n, e), i = `motion-word-${o}`, a = Fr(o, r);
|
|
2192
|
+
return r ? /* @__PURE__ */ E.jsx("span", { "data-motion-word": !0, style: a, children: s }, i) : /* @__PURE__ */ E.jsx("span", { style: a, children: s }, i);
|
|
2103
2193
|
}
|
|
2104
|
-
function
|
|
2105
|
-
return e ? { ...
|
|
2194
|
+
function Fr(t, e) {
|
|
2195
|
+
return e ? { ...Ae(t), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
|
|
2106
2196
|
}
|
|
2107
|
-
function
|
|
2197
|
+
function $r(t, e, n) {
|
|
2108
2198
|
if (!t)
|
|
2109
2199
|
return [];
|
|
2110
|
-
const
|
|
2111
|
-
if (!
|
|
2200
|
+
const r = se(e, R.Letter), o = se(e, R.Emoji);
|
|
2201
|
+
if (!r) {
|
|
2112
2202
|
if (!o)
|
|
2113
2203
|
return [t];
|
|
2114
|
-
const a =
|
|
2204
|
+
const a = Ve(t);
|
|
2115
2205
|
if (a.length === 0)
|
|
2116
2206
|
return [t];
|
|
2117
|
-
const { nodes: c } =
|
|
2207
|
+
const { nodes: c } = kt(a, n);
|
|
2118
2208
|
return c;
|
|
2119
2209
|
}
|
|
2120
|
-
const s = [], i =
|
|
2210
|
+
const s = [], i = Ve(t);
|
|
2121
2211
|
for (const a of i) {
|
|
2122
|
-
const c =
|
|
2212
|
+
const c = n.letter++, p = `motion-letter-${c}`, f = Ae(c);
|
|
2123
2213
|
if (a === `
|
|
2124
2214
|
`) {
|
|
2125
2215
|
s.push(
|
|
2126
|
-
/* @__PURE__ */
|
|
2216
|
+
/* @__PURE__ */ E.jsx("span", { "data-motion-letter": !0, style: f, children: /* @__PURE__ */ E.jsx("br", {}) }, p)
|
|
2127
2217
|
);
|
|
2128
2218
|
continue;
|
|
2129
2219
|
}
|
|
2130
|
-
const u = o &&
|
|
2220
|
+
const u = o && Rt(a) ? { "data-motion-emoji": !0 } : void 0, d = a === " " ? " " : a;
|
|
2131
2221
|
s.push(
|
|
2132
|
-
/* @__PURE__ */
|
|
2222
|
+
/* @__PURE__ */ E.jsx("span", { "data-motion-letter": !0, style: f, ...u, children: d }, p)
|
|
2133
2223
|
);
|
|
2134
2224
|
}
|
|
2135
2225
|
return s;
|
|
2136
2226
|
}
|
|
2137
|
-
function
|
|
2227
|
+
function Ve(t) {
|
|
2138
2228
|
if (!t)
|
|
2139
2229
|
return [];
|
|
2140
|
-
const e =
|
|
2141
|
-
return e ? Array.from(e.segment(t), (
|
|
2230
|
+
const e = Vr();
|
|
2231
|
+
return e ? Array.from(e.segment(t), (n) => n.segment) : Kr(t);
|
|
2142
2232
|
}
|
|
2143
|
-
let
|
|
2144
|
-
function
|
|
2145
|
-
return
|
|
2233
|
+
let de;
|
|
2234
|
+
function Vr() {
|
|
2235
|
+
return de !== void 0 || (typeof Intl < "u" && typeof Intl.Segmenter == "function" ? de = new Intl.Segmenter(void 0, { granularity: "grapheme" }) : de = null), de;
|
|
2146
2236
|
}
|
|
2147
|
-
function
|
|
2148
|
-
const e = [],
|
|
2149
|
-
let
|
|
2150
|
-
for (let o = 0; o <
|
|
2151
|
-
const s =
|
|
2152
|
-
|
|
2237
|
+
function Kr(t) {
|
|
2238
|
+
const e = [], n = Array.from(t);
|
|
2239
|
+
let r = "";
|
|
2240
|
+
for (let o = 0; o < n.length; o++) {
|
|
2241
|
+
const s = n[o], i = n[o + 1];
|
|
2242
|
+
r += s, !(i && Yr(s, i)) && (e.push(r), r = "");
|
|
2153
2243
|
}
|
|
2154
|
-
return
|
|
2244
|
+
return r && e.push(r), e;
|
|
2155
2245
|
}
|
|
2156
|
-
function
|
|
2157
|
-
return e ? !!(
|
|
2246
|
+
function Yr(t, e) {
|
|
2247
|
+
return e ? !!(pt(t) || pt(e) || qr(e) || zr(e) || Wr(e) || ht(t) && ht(e)) : !1;
|
|
2158
2248
|
}
|
|
2159
|
-
function
|
|
2249
|
+
function pt(t) {
|
|
2160
2250
|
return t.codePointAt(0) === 8205;
|
|
2161
2251
|
}
|
|
2162
|
-
function
|
|
2252
|
+
function zr(t) {
|
|
2163
2253
|
const e = t.codePointAt(0);
|
|
2164
2254
|
return e === void 0 ? !1 : e >= 65024 && e <= 65039 || e >= 917760 && e <= 917999;
|
|
2165
2255
|
}
|
|
2166
|
-
function
|
|
2256
|
+
function Wr(t) {
|
|
2167
2257
|
const e = t.codePointAt(0);
|
|
2168
2258
|
return e === void 0 ? !1 : e >= 127995 && e <= 127999;
|
|
2169
2259
|
}
|
|
2170
|
-
function
|
|
2260
|
+
function ht(t) {
|
|
2171
2261
|
const e = t.codePointAt(0);
|
|
2172
2262
|
return e === void 0 ? !1 : e >= 127462 && e <= 127487;
|
|
2173
2263
|
}
|
|
2174
|
-
let
|
|
2175
|
-
function
|
|
2176
|
-
return t ? (
|
|
2264
|
+
let _e;
|
|
2265
|
+
function qr(t) {
|
|
2266
|
+
return t ? (_e || (_e = Hr()), _e(t)) : !1;
|
|
2177
2267
|
}
|
|
2178
|
-
function
|
|
2268
|
+
function Hr() {
|
|
2179
2269
|
try {
|
|
2180
2270
|
const t = new RegExp("\\p{Mark}", "u");
|
|
2181
2271
|
return (e) => t.test(e);
|
|
@@ -2186,55 +2276,55 @@ function Dn() {
|
|
|
2186
2276
|
};
|
|
2187
2277
|
}
|
|
2188
2278
|
}
|
|
2189
|
-
let
|
|
2190
|
-
function
|
|
2191
|
-
return t ? (
|
|
2279
|
+
let Pe;
|
|
2280
|
+
function Rt(t) {
|
|
2281
|
+
return t ? (Pe || (Pe = Gr()), Pe(t)) : !1;
|
|
2192
2282
|
}
|
|
2193
|
-
function
|
|
2283
|
+
function Gr() {
|
|
2194
2284
|
try {
|
|
2195
2285
|
const t = new RegExp("\\p{Extended_Pictographic}", "u");
|
|
2196
2286
|
return (e) => t.test(e);
|
|
2197
2287
|
} catch {
|
|
2198
|
-
return
|
|
2288
|
+
return Jr;
|
|
2199
2289
|
}
|
|
2200
2290
|
}
|
|
2201
|
-
function
|
|
2291
|
+
function Jr(t) {
|
|
2202
2292
|
if (!t)
|
|
2203
2293
|
return !1;
|
|
2204
2294
|
for (const e of Array.from(t)) {
|
|
2205
|
-
const
|
|
2206
|
-
if (
|
|
2295
|
+
const n = e.codePointAt(0);
|
|
2296
|
+
if (n !== void 0 && (n >= 126976 && n <= 127231 || n >= 127232 && n <= 127487 || n >= 127488 && n <= 127743 || n >= 127744 && n <= 128511 || n >= 128512 && n <= 128591 || n >= 128640 && n <= 128767 || n >= 128768 && n <= 128895 || n >= 128896 && n <= 129023 || n >= 129024 && n <= 129279 || n >= 129280 && n <= 129535 || n >= 129536 && n <= 129791 || n >= 9728 && n <= 9983 || n >= 9984 && n <= 10175 || n === 8205 || n === 65039 || n === 8419))
|
|
2207
2297
|
return !0;
|
|
2208
2298
|
}
|
|
2209
2299
|
return !1;
|
|
2210
2300
|
}
|
|
2211
|
-
function
|
|
2301
|
+
function Xr(t) {
|
|
2212
2302
|
const e = [];
|
|
2213
|
-
let
|
|
2303
|
+
let n = "", r = 0;
|
|
2214
2304
|
for (let o = 0; o < t.length; o++) {
|
|
2215
2305
|
const s = t[o];
|
|
2216
2306
|
if (s === `
|
|
2217
2307
|
`) {
|
|
2218
|
-
|
|
2308
|
+
r += 1;
|
|
2219
2309
|
continue;
|
|
2220
2310
|
}
|
|
2221
|
-
|
|
2311
|
+
r > 0 && (e.push({ text: n, breaks: r }), n = "", r = 0), n += s;
|
|
2222
2312
|
}
|
|
2223
|
-
return (
|
|
2313
|
+
return (r > 0 || n.length > 0) && e.push({ text: n, breaks: r }), e;
|
|
2224
2314
|
}
|
|
2225
|
-
function
|
|
2315
|
+
function Zr(t) {
|
|
2226
2316
|
if (t.length === 0)
|
|
2227
2317
|
return [];
|
|
2228
2318
|
const e = [];
|
|
2229
|
-
let
|
|
2230
|
-
for (const
|
|
2231
|
-
|
|
2232
|
-
return
|
|
2319
|
+
let n = [];
|
|
2320
|
+
for (const r of t)
|
|
2321
|
+
n.push(r), r.breaks >= 2 && (e.push(n), n = []);
|
|
2322
|
+
return n.length > 0 && e.push(n), e;
|
|
2233
2323
|
}
|
|
2234
|
-
function
|
|
2324
|
+
function se(t, e) {
|
|
2235
2325
|
return (t & e) === e;
|
|
2236
2326
|
}
|
|
2237
|
-
function
|
|
2327
|
+
function Ae(t) {
|
|
2238
2328
|
return {
|
|
2239
2329
|
"--tw-motion-seq-index": t.toString(),
|
|
2240
2330
|
backgroundColor: "inherit",
|
|
@@ -2251,133 +2341,133 @@ function ke(t) {
|
|
|
2251
2341
|
WebkitTextFillColor: "inherit"
|
|
2252
2342
|
};
|
|
2253
2343
|
}
|
|
2254
|
-
function
|
|
2344
|
+
function mt(t) {
|
|
2255
2345
|
if (!t)
|
|
2256
2346
|
return t;
|
|
2257
|
-
const e =
|
|
2347
|
+
const e = Ve(t);
|
|
2258
2348
|
if (e.length === 0)
|
|
2259
2349
|
return t;
|
|
2260
|
-
const { nodes:
|
|
2261
|
-
return
|
|
2350
|
+
const { nodes: n, sawEmoji: r } = kt(e);
|
|
2351
|
+
return r ? n.length === 1 ? n[0] ?? t : n : t;
|
|
2262
2352
|
}
|
|
2263
|
-
function
|
|
2264
|
-
const
|
|
2265
|
-
let
|
|
2353
|
+
function kt(t, e) {
|
|
2354
|
+
const n = [];
|
|
2355
|
+
let r = "", o = !1, s = e?.emoji ?? 0;
|
|
2266
2356
|
const i = () => {
|
|
2267
|
-
|
|
2357
|
+
r && (n.push(r), r = "");
|
|
2268
2358
|
};
|
|
2269
2359
|
for (const a of t) {
|
|
2270
|
-
if (
|
|
2360
|
+
if (Rt(a)) {
|
|
2271
2361
|
o = !0, i();
|
|
2272
|
-
const
|
|
2273
|
-
|
|
2274
|
-
/* @__PURE__ */
|
|
2362
|
+
const p = `motion-emoji-${e ? e.emoji++ : s++}`;
|
|
2363
|
+
n.push(
|
|
2364
|
+
/* @__PURE__ */ E.jsx("span", { "data-motion-emoji": !0, children: a }, p)
|
|
2275
2365
|
);
|
|
2276
2366
|
continue;
|
|
2277
2367
|
}
|
|
2278
|
-
|
|
2368
|
+
r += a;
|
|
2279
2369
|
}
|
|
2280
|
-
return i(), o ? { nodes:
|
|
2370
|
+
return i(), o ? { nodes: n, sawEmoji: !0 } : { nodes: [t.join("")], sawEmoji: !1 };
|
|
2281
2371
|
}
|
|
2282
|
-
function
|
|
2372
|
+
function Qr(t) {
|
|
2283
2373
|
if (!t)
|
|
2284
|
-
return
|
|
2374
|
+
return R.None;
|
|
2285
2375
|
const e = t.trim();
|
|
2286
2376
|
if (!e)
|
|
2287
|
-
return
|
|
2288
|
-
const
|
|
2289
|
-
if (typeof
|
|
2290
|
-
return
|
|
2377
|
+
return R.None;
|
|
2378
|
+
const n = dt.get(e);
|
|
2379
|
+
if (typeof n == "number")
|
|
2380
|
+
return n;
|
|
2291
2381
|
if (typeof document > "u")
|
|
2292
|
-
return
|
|
2293
|
-
const
|
|
2294
|
-
if (
|
|
2295
|
-
return
|
|
2296
|
-
const s =
|
|
2297
|
-
(c) => new RegExp(`(^|[^a-zA-Z0-9_-])${
|
|
2382
|
+
return R.None;
|
|
2383
|
+
const r = e.split(/\s+/).filter(Boolean);
|
|
2384
|
+
if (r.length === 0)
|
|
2385
|
+
return R.None;
|
|
2386
|
+
const s = r.map((c) => `.${eo(c)}`).map(
|
|
2387
|
+
(c) => new RegExp(`(^|[^a-zA-Z0-9_-])${to(c)}(?![a-zA-Z0-9_-])`)
|
|
2298
2388
|
);
|
|
2299
|
-
let i =
|
|
2389
|
+
let i = R.None, a = !1;
|
|
2300
2390
|
for (const c of Array.from(document.styleSheets)) {
|
|
2301
|
-
let
|
|
2391
|
+
let p;
|
|
2302
2392
|
try {
|
|
2303
|
-
|
|
2393
|
+
p = c.cssRules;
|
|
2304
2394
|
} catch {
|
|
2305
2395
|
continue;
|
|
2306
2396
|
}
|
|
2307
|
-
const
|
|
2308
|
-
if (
|
|
2397
|
+
const f = At(p, s);
|
|
2398
|
+
if (f.mask && (i |= f.mask, i === $e))
|
|
2309
2399
|
break;
|
|
2310
|
-
a ||=
|
|
2400
|
+
a ||= f.sawStyleRule;
|
|
2311
2401
|
}
|
|
2312
|
-
return (i !==
|
|
2402
|
+
return (i !== R.None || a) && dt.set(e, i), i;
|
|
2313
2403
|
}
|
|
2314
|
-
function
|
|
2404
|
+
function At(t, e) {
|
|
2315
2405
|
if (!t)
|
|
2316
|
-
return { mask:
|
|
2317
|
-
let
|
|
2406
|
+
return { mask: R.None, sawStyleRule: !1 };
|
|
2407
|
+
let n = R.None, r = !1;
|
|
2318
2408
|
for (let o = 0; o < t.length; o++) {
|
|
2319
2409
|
const s = t[o];
|
|
2320
2410
|
if (s) {
|
|
2321
2411
|
if (s.type === CSSRule.STYLE_RULE) {
|
|
2322
2412
|
const a = s.selectorText ?? "";
|
|
2323
|
-
if (!a || !e.some((
|
|
2324
|
-
|
|
2325
|
-
for (const
|
|
2326
|
-
|
|
2327
|
-
if (
|
|
2328
|
-
return { mask:
|
|
2413
|
+
if (!a || !e.some((p) => p.test(a))) continue;
|
|
2414
|
+
r = !0;
|
|
2415
|
+
for (const p of Lr)
|
|
2416
|
+
p.hints.some((f) => a.includes(f)) && (n |= p.flag);
|
|
2417
|
+
if (n === $e)
|
|
2418
|
+
return { mask: n, sawStyleRule: !0 };
|
|
2329
2419
|
} else if ("cssRules" in s) {
|
|
2330
|
-
const i =
|
|
2331
|
-
if (i.mask && (
|
|
2332
|
-
return { mask:
|
|
2333
|
-
|
|
2420
|
+
const i = At(s.cssRules, e);
|
|
2421
|
+
if (i.mask && (n |= i.mask, n === $e))
|
|
2422
|
+
return { mask: n, sawStyleRule: !0 };
|
|
2423
|
+
r ||= i.sawStyleRule;
|
|
2334
2424
|
}
|
|
2335
2425
|
}
|
|
2336
2426
|
}
|
|
2337
|
-
return { mask:
|
|
2427
|
+
return { mask: n, sawStyleRule: r };
|
|
2338
2428
|
}
|
|
2339
|
-
function
|
|
2429
|
+
function eo(t) {
|
|
2340
2430
|
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
2341
2431
|
}
|
|
2342
|
-
function
|
|
2432
|
+
function to(t) {
|
|
2343
2433
|
return t.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
|
|
2344
2434
|
}
|
|
2345
|
-
const
|
|
2346
|
-
function
|
|
2435
|
+
const qe = "ikon_auth_session", no = 7 * 24 * 60 * 60 * 1e3, ro = 60 * 1e3;
|
|
2436
|
+
function oo(t) {
|
|
2347
2437
|
try {
|
|
2348
2438
|
const e = t.split(".");
|
|
2349
2439
|
if (e.length !== 3) return !0;
|
|
2350
|
-
const
|
|
2351
|
-
return typeof
|
|
2440
|
+
const n = JSON.parse(atob(e[1]));
|
|
2441
|
+
return typeof n.exp != "number" ? !1 : Date.now() >= n.exp * 1e3 - ro;
|
|
2352
2442
|
} catch {
|
|
2353
2443
|
return !0;
|
|
2354
2444
|
}
|
|
2355
2445
|
}
|
|
2356
|
-
function
|
|
2446
|
+
function Te(t) {
|
|
2357
2447
|
try {
|
|
2358
|
-
localStorage.setItem(
|
|
2448
|
+
localStorage.setItem(qe, JSON.stringify(t));
|
|
2359
2449
|
} catch {
|
|
2360
2450
|
console.warn("Failed to save auth session to localStorage");
|
|
2361
2451
|
}
|
|
2362
2452
|
}
|
|
2363
|
-
function
|
|
2453
|
+
function Tt() {
|
|
2364
2454
|
try {
|
|
2365
|
-
const t = localStorage.getItem(
|
|
2455
|
+
const t = localStorage.getItem(qe);
|
|
2366
2456
|
if (!t) return null;
|
|
2367
2457
|
const e = JSON.parse(t);
|
|
2368
|
-
return Date.now() - e.authenticatedAt >
|
|
2458
|
+
return Date.now() - e.authenticatedAt > no || oo(e.token) ? (Ee(), null) : e;
|
|
2369
2459
|
} catch {
|
|
2370
2460
|
return console.warn("Failed to load auth session from localStorage"), null;
|
|
2371
2461
|
}
|
|
2372
2462
|
}
|
|
2373
|
-
function
|
|
2463
|
+
function Ee() {
|
|
2374
2464
|
try {
|
|
2375
|
-
localStorage.removeItem(
|
|
2465
|
+
localStorage.removeItem(qe);
|
|
2376
2466
|
} catch {
|
|
2377
2467
|
console.warn("Failed to clear auth session from localStorage");
|
|
2378
2468
|
}
|
|
2379
2469
|
}
|
|
2380
|
-
function
|
|
2470
|
+
function fe(t) {
|
|
2381
2471
|
return {
|
|
2382
2472
|
id: "",
|
|
2383
2473
|
provider: t.provider,
|
|
@@ -2385,30 +2475,30 @@ function de(t) {
|
|
|
2385
2475
|
authenticatedAt: t.authenticatedAt
|
|
2386
2476
|
};
|
|
2387
2477
|
}
|
|
2388
|
-
async function
|
|
2389
|
-
const
|
|
2478
|
+
async function Ct(t, e) {
|
|
2479
|
+
const n = $t(), r = await fetch(`${e}/anonymous`, {
|
|
2390
2480
|
method: "POST",
|
|
2391
2481
|
headers: { "Content-Type": "application/json" },
|
|
2392
|
-
body: JSON.stringify({ deviceId:
|
|
2482
|
+
body: JSON.stringify({ deviceId: n, space: t })
|
|
2393
2483
|
});
|
|
2394
|
-
if (!
|
|
2395
|
-
const i = await
|
|
2396
|
-
throw new Error(`Anonymous auth failed: ${
|
|
2484
|
+
if (!r.ok) {
|
|
2485
|
+
const i = await r.text().catch(() => "Unknown error");
|
|
2486
|
+
throw new Error(`Anonymous auth failed: ${r.status} ${i}`);
|
|
2397
2487
|
}
|
|
2398
|
-
const { token: o } = await
|
|
2488
|
+
const { token: o } = await r.json(), s = {
|
|
2399
2489
|
token: o,
|
|
2400
2490
|
provider: "anonymous",
|
|
2401
2491
|
authenticatedAt: Date.now()
|
|
2402
2492
|
};
|
|
2403
|
-
return
|
|
2493
|
+
return Te(s), s;
|
|
2404
2494
|
}
|
|
2405
|
-
async function
|
|
2406
|
-
const { email: e, spaceId:
|
|
2495
|
+
async function Bo(t) {
|
|
2496
|
+
const { email: e, spaceId: n, authUrl: r, returnUrl: o = window.location.origin + window.location.pathname } = t, s = await fetch(`${r}/email/send`, {
|
|
2407
2497
|
method: "POST",
|
|
2408
2498
|
headers: { "Content-Type": "application/json" },
|
|
2409
2499
|
body: JSON.stringify({
|
|
2410
2500
|
email: e.trim(),
|
|
2411
|
-
space:
|
|
2501
|
+
space: n,
|
|
2412
2502
|
return: o
|
|
2413
2503
|
})
|
|
2414
2504
|
});
|
|
@@ -2417,102 +2507,102 @@ async function Oo(t) {
|
|
|
2417
2507
|
throw new Error(i);
|
|
2418
2508
|
}
|
|
2419
2509
|
}
|
|
2420
|
-
function
|
|
2421
|
-
const t = new URLSearchParams(window.location.search), e = t.get("ikon_token"),
|
|
2422
|
-
return e &&
|
|
2510
|
+
function so() {
|
|
2511
|
+
const t = new URLSearchParams(window.location.search), e = t.get("ikon_token"), n = t.get("ikon_provider");
|
|
2512
|
+
return e && n ? { token: e, provider: n } : null;
|
|
2423
2513
|
}
|
|
2424
|
-
function
|
|
2514
|
+
function io() {
|
|
2425
2515
|
const e = new URLSearchParams(window.location.search).get("error");
|
|
2426
2516
|
return e ? decodeURIComponent(e) : null;
|
|
2427
2517
|
}
|
|
2428
|
-
function
|
|
2518
|
+
function gt() {
|
|
2429
2519
|
window.history.replaceState({}, "", window.location.pathname);
|
|
2430
2520
|
}
|
|
2431
|
-
function
|
|
2432
|
-
const o =
|
|
2433
|
-
return `${
|
|
2521
|
+
function ao(t, e, n, r) {
|
|
2522
|
+
const o = r ?? window.location.origin + window.location.pathname + window.location.search;
|
|
2523
|
+
return `${n}/oauth/${t}?space=${encodeURIComponent(e)}&return=${encodeURIComponent(o)}`;
|
|
2434
2524
|
}
|
|
2435
|
-
async function
|
|
2525
|
+
async function co(t) {
|
|
2436
2526
|
const e = await fetch(`${t}/passkey/registration/options`, {
|
|
2437
2527
|
method: "POST",
|
|
2438
2528
|
headers: { "Content-Type": "application/json" }
|
|
2439
2529
|
});
|
|
2440
2530
|
if (!e.ok) {
|
|
2441
|
-
const
|
|
2442
|
-
throw new Error(
|
|
2531
|
+
const n = await e.text().catch(() => "Failed to get registration options");
|
|
2532
|
+
throw new Error(n);
|
|
2443
2533
|
}
|
|
2444
2534
|
return e.json();
|
|
2445
2535
|
}
|
|
2446
|
-
async function
|
|
2447
|
-
const
|
|
2536
|
+
async function uo(t, e, n) {
|
|
2537
|
+
const r = await fetch(`${t}/passkey/registration/verify`, {
|
|
2448
2538
|
method: "POST",
|
|
2449
2539
|
headers: { "Content-Type": "application/json" },
|
|
2450
|
-
body: JSON.stringify({ response: e, name:
|
|
2540
|
+
body: JSON.stringify({ response: e, name: n })
|
|
2451
2541
|
});
|
|
2452
|
-
if (!
|
|
2453
|
-
const i = await
|
|
2542
|
+
if (!r.ok) {
|
|
2543
|
+
const i = await r.text().catch(() => "Registration verification failed");
|
|
2454
2544
|
throw new Error(i);
|
|
2455
2545
|
}
|
|
2456
|
-
const { token: o } = await
|
|
2546
|
+
const { token: o } = await r.json(), s = {
|
|
2457
2547
|
token: o,
|
|
2458
2548
|
provider: "passkey",
|
|
2459
2549
|
authenticatedAt: Date.now()
|
|
2460
2550
|
};
|
|
2461
|
-
return
|
|
2551
|
+
return Te(s), s;
|
|
2462
2552
|
}
|
|
2463
|
-
async function
|
|
2464
|
-
const
|
|
2553
|
+
async function lo(t, e) {
|
|
2554
|
+
const n = await fetch(`${t}/passkey/authentication/options`, {
|
|
2465
2555
|
method: "POST",
|
|
2466
2556
|
headers: { "Content-Type": "application/json" },
|
|
2467
2557
|
body: JSON.stringify({ email: e })
|
|
2468
2558
|
});
|
|
2469
|
-
if (!
|
|
2470
|
-
const
|
|
2471
|
-
throw new Error(
|
|
2559
|
+
if (!n.ok) {
|
|
2560
|
+
const r = await n.text().catch(() => "Failed to get authentication options");
|
|
2561
|
+
throw new Error(r);
|
|
2472
2562
|
}
|
|
2473
|
-
return
|
|
2563
|
+
return n.json();
|
|
2474
2564
|
}
|
|
2475
|
-
async function
|
|
2476
|
-
const
|
|
2565
|
+
async function fo(t, e) {
|
|
2566
|
+
const n = await fetch(`${t}/passkey/authentication/verify`, {
|
|
2477
2567
|
method: "POST",
|
|
2478
2568
|
headers: { "Content-Type": "application/json" },
|
|
2479
2569
|
body: JSON.stringify({ response: e })
|
|
2480
2570
|
});
|
|
2481
|
-
if (!
|
|
2482
|
-
const s = await
|
|
2571
|
+
if (!n.ok) {
|
|
2572
|
+
const s = await n.text().catch(() => "Authentication verification failed");
|
|
2483
2573
|
throw new Error(s);
|
|
2484
2574
|
}
|
|
2485
|
-
const { token:
|
|
2486
|
-
token:
|
|
2575
|
+
const { token: r } = await n.json(), o = {
|
|
2576
|
+
token: r,
|
|
2487
2577
|
provider: "passkey",
|
|
2488
2578
|
authenticatedAt: Date.now()
|
|
2489
2579
|
};
|
|
2490
|
-
return
|
|
2580
|
+
return Te(o), o;
|
|
2491
2581
|
}
|
|
2492
2582
|
function X(t) {
|
|
2493
2583
|
const e = new Uint8Array(t);
|
|
2494
|
-
let
|
|
2584
|
+
let n = "";
|
|
2495
2585
|
for (const o of e)
|
|
2496
|
-
|
|
2497
|
-
return btoa(
|
|
2586
|
+
n += String.fromCharCode(o);
|
|
2587
|
+
return btoa(n).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
2498
2588
|
}
|
|
2499
|
-
function
|
|
2500
|
-
const e = t.replace(/-/g, "+").replace(/_/g, "/"),
|
|
2589
|
+
function Re(t) {
|
|
2590
|
+
const e = t.replace(/-/g, "+").replace(/_/g, "/"), n = (4 - e.length % 4) % 4, r = e.padEnd(e.length + n, "="), o = atob(r), s = new ArrayBuffer(o.length), i = new Uint8Array(s);
|
|
2501
2591
|
for (let a = 0; a < o.length; a++)
|
|
2502
2592
|
i[a] = o.charCodeAt(a);
|
|
2503
2593
|
return s;
|
|
2504
2594
|
}
|
|
2505
|
-
function
|
|
2506
|
-
return
|
|
2595
|
+
function He() {
|
|
2596
|
+
return po.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
|
|
2507
2597
|
}
|
|
2508
|
-
const
|
|
2598
|
+
const po = {
|
|
2509
2599
|
stubThis: (t) => t
|
|
2510
2600
|
};
|
|
2511
|
-
function
|
|
2601
|
+
function It(t) {
|
|
2512
2602
|
const { id: e } = t;
|
|
2513
2603
|
return {
|
|
2514
2604
|
...t,
|
|
2515
|
-
id:
|
|
2605
|
+
id: Re(e),
|
|
2516
2606
|
/**
|
|
2517
2607
|
* `descriptor.transports` is an array of our `AuthenticatorTransportFuture` that includes newer
|
|
2518
2608
|
* transports that TypeScript's DOM lib is ignorant of. Convince TS that our list of transports
|
|
@@ -2521,25 +2611,25 @@ function kt(t) {
|
|
|
2521
2611
|
transports: t.transports
|
|
2522
2612
|
};
|
|
2523
2613
|
}
|
|
2524
|
-
function
|
|
2614
|
+
function Ot(t) {
|
|
2525
2615
|
return (
|
|
2526
2616
|
// Consider localhost valid as well since it's okay wrt Secure Contexts
|
|
2527
2617
|
t === "localhost" || /^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)
|
|
2528
2618
|
);
|
|
2529
2619
|
}
|
|
2530
2620
|
class j extends Error {
|
|
2531
|
-
constructor({ message: e, code:
|
|
2532
|
-
super(e, { cause:
|
|
2621
|
+
constructor({ message: e, code: n, cause: r, name: o }) {
|
|
2622
|
+
super(e, { cause: r }), Object.defineProperty(this, "code", {
|
|
2533
2623
|
enumerable: !0,
|
|
2534
2624
|
configurable: !0,
|
|
2535
2625
|
writable: !0,
|
|
2536
2626
|
value: void 0
|
|
2537
|
-
}), this.name = o ??
|
|
2627
|
+
}), this.name = o ?? r.name, this.code = n;
|
|
2538
2628
|
}
|
|
2539
2629
|
}
|
|
2540
|
-
function
|
|
2541
|
-
const { publicKey:
|
|
2542
|
-
if (!
|
|
2630
|
+
function ho({ error: t, options: e }) {
|
|
2631
|
+
const { publicKey: n } = e;
|
|
2632
|
+
if (!n)
|
|
2543
2633
|
throw Error("options was missing required publicKey property");
|
|
2544
2634
|
if (t.name === "AbortError") {
|
|
2545
2635
|
if (e.signal instanceof AbortSignal)
|
|
@@ -2549,7 +2639,7 @@ function no({ error: t, options: e }) {
|
|
|
2549
2639
|
cause: t
|
|
2550
2640
|
});
|
|
2551
2641
|
} else if (t.name === "ConstraintError") {
|
|
2552
|
-
if (
|
|
2642
|
+
if (n.authenticatorSelection?.requireResidentKey === !0)
|
|
2553
2643
|
return new j({
|
|
2554
2644
|
message: "Discoverable credentials were required but no available authenticator supported it",
|
|
2555
2645
|
code: "ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",
|
|
@@ -2557,14 +2647,14 @@ function no({ error: t, options: e }) {
|
|
|
2557
2647
|
});
|
|
2558
2648
|
if (
|
|
2559
2649
|
// @ts-ignore: `mediation` doesn't yet exist on CredentialCreationOptions but it's possible as of Sept 2024
|
|
2560
|
-
e.mediation === "conditional" &&
|
|
2650
|
+
e.mediation === "conditional" && n.authenticatorSelection?.userVerification === "required"
|
|
2561
2651
|
)
|
|
2562
2652
|
return new j({
|
|
2563
2653
|
message: "User verification was required during automatic registration but it could not be performed",
|
|
2564
2654
|
code: "ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",
|
|
2565
2655
|
cause: t
|
|
2566
2656
|
});
|
|
2567
|
-
if (
|
|
2657
|
+
if (n.authenticatorSelection?.userVerification === "required")
|
|
2568
2658
|
return new j({
|
|
2569
2659
|
message: "User verification was required but no available authenticator supported it",
|
|
2570
2660
|
code: "ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",
|
|
@@ -2584,7 +2674,7 @@ function no({ error: t, options: e }) {
|
|
|
2584
2674
|
cause: t
|
|
2585
2675
|
});
|
|
2586
2676
|
if (t.name === "NotSupportedError")
|
|
2587
|
-
return
|
|
2677
|
+
return n.pubKeyCredParams.filter((o) => o.type === "public-key").length === 0 ? new j({
|
|
2588
2678
|
message: 'No entry in pubKeyCredParams was of type "public-key"',
|
|
2589
2679
|
code: "ERROR_MALFORMED_PUBKEYCREDPARAMS",
|
|
2590
2680
|
cause: t
|
|
@@ -2594,11 +2684,11 @@ function no({ error: t, options: e }) {
|
|
|
2594
2684
|
cause: t
|
|
2595
2685
|
});
|
|
2596
2686
|
if (t.name === "SecurityError") {
|
|
2597
|
-
const
|
|
2598
|
-
if (
|
|
2599
|
-
if (
|
|
2687
|
+
const r = globalThis.location.hostname;
|
|
2688
|
+
if (Ot(r)) {
|
|
2689
|
+
if (n.rp.id !== r)
|
|
2600
2690
|
return new j({
|
|
2601
|
-
message: `The RP ID "${
|
|
2691
|
+
message: `The RP ID "${n.rp.id}" is invalid for this domain`,
|
|
2602
2692
|
code: "ERROR_INVALID_RP_ID",
|
|
2603
2693
|
cause: t
|
|
2604
2694
|
});
|
|
@@ -2608,7 +2698,7 @@ function no({ error: t, options: e }) {
|
|
|
2608
2698
|
cause: t
|
|
2609
2699
|
});
|
|
2610
2700
|
} else if (t.name === "TypeError") {
|
|
2611
|
-
if (
|
|
2701
|
+
if (n.user.id.byteLength < 1 || n.user.id.byteLength > 64)
|
|
2612
2702
|
return new j({
|
|
2613
2703
|
message: "User ID was not between 1 and 64 characters",
|
|
2614
2704
|
code: "ERROR_INVALID_USER_ID_LENGTH",
|
|
@@ -2623,7 +2713,7 @@ function no({ error: t, options: e }) {
|
|
|
2623
2713
|
}
|
|
2624
2714
|
return t;
|
|
2625
2715
|
}
|
|
2626
|
-
class
|
|
2716
|
+
class mo {
|
|
2627
2717
|
constructor() {
|
|
2628
2718
|
Object.defineProperty(this, "controller", {
|
|
2629
2719
|
enumerable: !0,
|
|
@@ -2634,8 +2724,8 @@ class oo {
|
|
|
2634
2724
|
}
|
|
2635
2725
|
createNewAbortSignal() {
|
|
2636
2726
|
if (this.controller) {
|
|
2637
|
-
const
|
|
2638
|
-
|
|
2727
|
+
const n = new Error("Cancelling existing WebAuthn API call for new one");
|
|
2728
|
+
n.name = "AbortError", this.controller.abort(n);
|
|
2639
2729
|
}
|
|
2640
2730
|
const e = new AbortController();
|
|
2641
2731
|
return this.controller = e, e.signal;
|
|
@@ -2647,43 +2737,43 @@ class oo {
|
|
|
2647
2737
|
}
|
|
2648
2738
|
}
|
|
2649
2739
|
}
|
|
2650
|
-
const
|
|
2651
|
-
function
|
|
2652
|
-
if (t && !(
|
|
2740
|
+
const Nt = new mo(), go = ["cross-platform", "platform"];
|
|
2741
|
+
function _t(t) {
|
|
2742
|
+
if (t && !(go.indexOf(t) < 0))
|
|
2653
2743
|
return t;
|
|
2654
2744
|
}
|
|
2655
|
-
async function
|
|
2745
|
+
async function yo(t) {
|
|
2656
2746
|
!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 });
|
|
2657
|
-
const { optionsJSON: e, useAutoRegister:
|
|
2658
|
-
if (!
|
|
2747
|
+
const { optionsJSON: e, useAutoRegister: n = !1 } = t;
|
|
2748
|
+
if (!He())
|
|
2659
2749
|
throw new Error("WebAuthn is not supported in this browser");
|
|
2660
|
-
const
|
|
2750
|
+
const r = {
|
|
2661
2751
|
...e,
|
|
2662
|
-
challenge:
|
|
2752
|
+
challenge: Re(e.challenge),
|
|
2663
2753
|
user: {
|
|
2664
2754
|
...e.user,
|
|
2665
|
-
id:
|
|
2755
|
+
id: Re(e.user.id)
|
|
2666
2756
|
},
|
|
2667
|
-
excludeCredentials: e.excludeCredentials?.map(
|
|
2757
|
+
excludeCredentials: e.excludeCredentials?.map(It)
|
|
2668
2758
|
}, o = {};
|
|
2669
|
-
|
|
2759
|
+
n && (o.mediation = "conditional"), o.publicKey = r, o.signal = Nt.createNewAbortSignal();
|
|
2670
2760
|
let s;
|
|
2671
2761
|
try {
|
|
2672
2762
|
s = await navigator.credentials.create(o);
|
|
2673
2763
|
} catch (m) {
|
|
2674
|
-
throw
|
|
2764
|
+
throw ho({ error: m, options: o });
|
|
2675
2765
|
}
|
|
2676
2766
|
if (!s)
|
|
2677
2767
|
throw new Error("Registration was not completed");
|
|
2678
|
-
const { id: i, rawId: a, response: c, type:
|
|
2679
|
-
let
|
|
2680
|
-
typeof c.getTransports == "function" && (
|
|
2768
|
+
const { id: i, rawId: a, response: c, type: p } = s;
|
|
2769
|
+
let f;
|
|
2770
|
+
typeof c.getTransports == "function" && (f = c.getTransports());
|
|
2681
2771
|
let l;
|
|
2682
2772
|
if (typeof c.getPublicKeyAlgorithm == "function")
|
|
2683
2773
|
try {
|
|
2684
2774
|
l = c.getPublicKeyAlgorithm();
|
|
2685
2775
|
} catch (m) {
|
|
2686
|
-
|
|
2776
|
+
Me("getPublicKeyAlgorithm()", m);
|
|
2687
2777
|
}
|
|
2688
2778
|
let u;
|
|
2689
2779
|
if (typeof c.getPublicKey == "function")
|
|
@@ -2691,14 +2781,14 @@ async function io(t) {
|
|
|
2691
2781
|
const m = c.getPublicKey();
|
|
2692
2782
|
m !== null && (u = X(m));
|
|
2693
2783
|
} catch (m) {
|
|
2694
|
-
|
|
2784
|
+
Me("getPublicKey()", m);
|
|
2695
2785
|
}
|
|
2696
|
-
let
|
|
2786
|
+
let d;
|
|
2697
2787
|
if (typeof c.getAuthenticatorData == "function")
|
|
2698
2788
|
try {
|
|
2699
|
-
|
|
2789
|
+
d = X(c.getAuthenticatorData());
|
|
2700
2790
|
} catch (m) {
|
|
2701
|
-
|
|
2791
|
+
Me("getAuthenticatorData()", m);
|
|
2702
2792
|
}
|
|
2703
2793
|
return {
|
|
2704
2794
|
id: i,
|
|
@@ -2706,32 +2796,32 @@ async function io(t) {
|
|
|
2706
2796
|
response: {
|
|
2707
2797
|
attestationObject: X(c.attestationObject),
|
|
2708
2798
|
clientDataJSON: X(c.clientDataJSON),
|
|
2709
|
-
transports:
|
|
2799
|
+
transports: f,
|
|
2710
2800
|
publicKeyAlgorithm: l,
|
|
2711
2801
|
publicKey: u,
|
|
2712
|
-
authenticatorData:
|
|
2802
|
+
authenticatorData: d
|
|
2713
2803
|
},
|
|
2714
|
-
type:
|
|
2804
|
+
type: p,
|
|
2715
2805
|
clientExtensionResults: s.getClientExtensionResults(),
|
|
2716
|
-
authenticatorAttachment:
|
|
2806
|
+
authenticatorAttachment: _t(s.authenticatorAttachment)
|
|
2717
2807
|
};
|
|
2718
2808
|
}
|
|
2719
|
-
function
|
|
2809
|
+
function Me(t, e) {
|
|
2720
2810
|
console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${t}. You should report this error to them.
|
|
2721
2811
|
`, e);
|
|
2722
2812
|
}
|
|
2723
|
-
function
|
|
2724
|
-
if (!
|
|
2725
|
-
return
|
|
2813
|
+
function bo() {
|
|
2814
|
+
if (!He())
|
|
2815
|
+
return Le.stubThis(new Promise((e) => e(!1)));
|
|
2726
2816
|
const t = globalThis.PublicKeyCredential;
|
|
2727
|
-
return t?.isConditionalMediationAvailable === void 0 ?
|
|
2817
|
+
return t?.isConditionalMediationAvailable === void 0 ? Le.stubThis(new Promise((e) => e(!1))) : Le.stubThis(t.isConditionalMediationAvailable());
|
|
2728
2818
|
}
|
|
2729
|
-
const
|
|
2819
|
+
const Le = {
|
|
2730
2820
|
stubThis: (t) => t
|
|
2731
2821
|
};
|
|
2732
|
-
function
|
|
2733
|
-
const { publicKey:
|
|
2734
|
-
if (!
|
|
2822
|
+
function So({ error: t, options: e }) {
|
|
2823
|
+
const { publicKey: n } = e;
|
|
2824
|
+
if (!n)
|
|
2735
2825
|
throw Error("options was missing required publicKey property");
|
|
2736
2826
|
if (t.name === "AbortError") {
|
|
2737
2827
|
if (e.signal instanceof AbortSignal)
|
|
@@ -2748,11 +2838,11 @@ function co({ error: t, options: e }) {
|
|
|
2748
2838
|
cause: t
|
|
2749
2839
|
});
|
|
2750
2840
|
if (t.name === "SecurityError") {
|
|
2751
|
-
const
|
|
2752
|
-
if (
|
|
2753
|
-
if (
|
|
2841
|
+
const r = globalThis.location.hostname;
|
|
2842
|
+
if (Ot(r)) {
|
|
2843
|
+
if (n.rpId !== r)
|
|
2754
2844
|
return new j({
|
|
2755
|
-
message: `The RP ID "${
|
|
2845
|
+
message: `The RP ID "${n.rpId}" is invalid for this domain`,
|
|
2756
2846
|
code: "ERROR_INVALID_RP_ID",
|
|
2757
2847
|
cause: t
|
|
2758
2848
|
});
|
|
@@ -2770,96 +2860,96 @@ function co({ error: t, options: e }) {
|
|
|
2770
2860
|
}
|
|
2771
2861
|
return t;
|
|
2772
2862
|
}
|
|
2773
|
-
async function
|
|
2863
|
+
async function wo(t) {
|
|
2774
2864
|
!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 });
|
|
2775
|
-
const { optionsJSON: e, useBrowserAutofill:
|
|
2776
|
-
if (!
|
|
2865
|
+
const { optionsJSON: e, useBrowserAutofill: n = !1, verifyBrowserAutofillInput: r = !0 } = t;
|
|
2866
|
+
if (!He())
|
|
2777
2867
|
throw new Error("WebAuthn is not supported in this browser");
|
|
2778
2868
|
let o;
|
|
2779
|
-
e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(
|
|
2869
|
+
e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(It));
|
|
2780
2870
|
const s = {
|
|
2781
2871
|
...e,
|
|
2782
|
-
challenge:
|
|
2872
|
+
challenge: Re(e.challenge),
|
|
2783
2873
|
allowCredentials: o
|
|
2784
2874
|
}, i = {};
|
|
2785
|
-
if (
|
|
2786
|
-
if (!await
|
|
2875
|
+
if (n) {
|
|
2876
|
+
if (!await bo())
|
|
2787
2877
|
throw Error("Browser does not support WebAuthn autofill");
|
|
2788
|
-
if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 &&
|
|
2878
|
+
if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 && r)
|
|
2789
2879
|
throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
|
|
2790
2880
|
i.mediation = "conditional", s.allowCredentials = [];
|
|
2791
2881
|
}
|
|
2792
|
-
i.publicKey = s, i.signal =
|
|
2882
|
+
i.publicKey = s, i.signal = Nt.createNewAbortSignal();
|
|
2793
2883
|
let a;
|
|
2794
2884
|
try {
|
|
2795
2885
|
a = await navigator.credentials.get(i);
|
|
2796
|
-
} catch (
|
|
2797
|
-
throw
|
|
2886
|
+
} catch (d) {
|
|
2887
|
+
throw So({ error: d, options: i });
|
|
2798
2888
|
}
|
|
2799
2889
|
if (!a)
|
|
2800
2890
|
throw new Error("Authentication was not completed");
|
|
2801
|
-
const { id: c, rawId:
|
|
2891
|
+
const { id: c, rawId: p, response: f, type: l } = a;
|
|
2802
2892
|
let u;
|
|
2803
|
-
return
|
|
2893
|
+
return f.userHandle && (u = X(f.userHandle)), {
|
|
2804
2894
|
id: c,
|
|
2805
|
-
rawId: X(
|
|
2895
|
+
rawId: X(p),
|
|
2806
2896
|
response: {
|
|
2807
|
-
authenticatorData: X(
|
|
2808
|
-
clientDataJSON: X(
|
|
2809
|
-
signature: X(
|
|
2897
|
+
authenticatorData: X(f.authenticatorData),
|
|
2898
|
+
clientDataJSON: X(f.clientDataJSON),
|
|
2899
|
+
signature: X(f.signature),
|
|
2810
2900
|
userHandle: u
|
|
2811
2901
|
},
|
|
2812
2902
|
type: l,
|
|
2813
2903
|
clientExtensionResults: a.getClientExtensionResults(),
|
|
2814
|
-
authenticatorAttachment:
|
|
2904
|
+
authenticatorAttachment: _t(a.authenticatorAttachment)
|
|
2815
2905
|
};
|
|
2816
2906
|
}
|
|
2817
|
-
const
|
|
2818
|
-
function
|
|
2819
|
-
const [
|
|
2907
|
+
const Ge = yt(null);
|
|
2908
|
+
function Fo({ children: t, config: e }) {
|
|
2909
|
+
const [n, r] = Y({
|
|
2820
2910
|
isAuthenticated: !1,
|
|
2821
2911
|
isLoading: !0,
|
|
2822
2912
|
user: null,
|
|
2823
2913
|
error: null
|
|
2824
2914
|
});
|
|
2825
|
-
|
|
2915
|
+
N(() => {
|
|
2826
2916
|
(() => {
|
|
2827
|
-
const
|
|
2828
|
-
if (
|
|
2829
|
-
|
|
2917
|
+
const f = io();
|
|
2918
|
+
if (f) {
|
|
2919
|
+
gt(), r({
|
|
2830
2920
|
isAuthenticated: !1,
|
|
2831
2921
|
isLoading: !1,
|
|
2832
2922
|
user: null,
|
|
2833
|
-
error:
|
|
2923
|
+
error: f
|
|
2834
2924
|
});
|
|
2835
2925
|
return;
|
|
2836
2926
|
}
|
|
2837
|
-
const l =
|
|
2927
|
+
const l = so();
|
|
2838
2928
|
if (l) {
|
|
2839
|
-
const
|
|
2929
|
+
const d = {
|
|
2840
2930
|
token: l.token,
|
|
2841
2931
|
provider: l.provider,
|
|
2842
2932
|
authenticatedAt: Date.now()
|
|
2843
2933
|
};
|
|
2844
|
-
|
|
2934
|
+
Te(d), gt(), r({
|
|
2845
2935
|
isAuthenticated: !0,
|
|
2846
2936
|
isLoading: !1,
|
|
2847
|
-
user:
|
|
2937
|
+
user: fe(d),
|
|
2848
2938
|
error: null
|
|
2849
2939
|
});
|
|
2850
2940
|
return;
|
|
2851
2941
|
}
|
|
2852
|
-
const u =
|
|
2942
|
+
const u = Tt();
|
|
2853
2943
|
if (u) {
|
|
2854
|
-
|
|
2944
|
+
r({
|
|
2855
2945
|
isAuthenticated: !0,
|
|
2856
2946
|
isLoading: !1,
|
|
2857
|
-
user:
|
|
2947
|
+
user: fe(u),
|
|
2858
2948
|
error: null
|
|
2859
2949
|
});
|
|
2860
2950
|
return;
|
|
2861
2951
|
}
|
|
2862
|
-
|
|
2952
|
+
r({
|
|
2863
2953
|
isAuthenticated: !1,
|
|
2864
2954
|
isLoading: !1,
|
|
2865
2955
|
user: null,
|
|
@@ -2868,27 +2958,27 @@ function No({ children: t, config: e }) {
|
|
|
2868
2958
|
})();
|
|
2869
2959
|
}, []);
|
|
2870
2960
|
const o = D(
|
|
2871
|
-
async (
|
|
2961
|
+
async (p) => {
|
|
2872
2962
|
if (!e.spaceId) {
|
|
2873
|
-
|
|
2963
|
+
r((l) => ({
|
|
2874
2964
|
...l,
|
|
2875
2965
|
error: "Space ID is not configured"
|
|
2876
2966
|
}));
|
|
2877
2967
|
return;
|
|
2878
2968
|
}
|
|
2879
|
-
const
|
|
2880
|
-
if (
|
|
2881
|
-
|
|
2969
|
+
const f = xe(e.authUrl);
|
|
2970
|
+
if (p === "guest") {
|
|
2971
|
+
r((l) => ({ ...l, isLoading: !0 }));
|
|
2882
2972
|
try {
|
|
2883
|
-
const l = await
|
|
2884
|
-
|
|
2973
|
+
const l = await Ct(e.spaceId, f);
|
|
2974
|
+
r({
|
|
2885
2975
|
isAuthenticated: !0,
|
|
2886
2976
|
isLoading: !1,
|
|
2887
|
-
user:
|
|
2977
|
+
user: fe(l),
|
|
2888
2978
|
error: null
|
|
2889
2979
|
});
|
|
2890
2980
|
} catch (l) {
|
|
2891
|
-
|
|
2981
|
+
r((u) => ({
|
|
2892
2982
|
...u,
|
|
2893
2983
|
isLoading: !1,
|
|
2894
2984
|
error: l instanceof Error ? l.message : "Guest login failed"
|
|
@@ -2896,18 +2986,18 @@ function No({ children: t, config: e }) {
|
|
|
2896
2986
|
}
|
|
2897
2987
|
return;
|
|
2898
2988
|
}
|
|
2899
|
-
if (
|
|
2900
|
-
|
|
2989
|
+
if (p === "passkey") {
|
|
2990
|
+
r((l) => ({ ...l, isLoading: !0, error: null }));
|
|
2901
2991
|
try {
|
|
2902
|
-
const l = await
|
|
2903
|
-
|
|
2992
|
+
const l = await lo(f), u = await wo({ optionsJSON: l }), d = await fo(f, u);
|
|
2993
|
+
r({
|
|
2904
2994
|
isAuthenticated: !0,
|
|
2905
2995
|
isLoading: !1,
|
|
2906
|
-
user:
|
|
2996
|
+
user: fe(d),
|
|
2907
2997
|
error: null
|
|
2908
2998
|
});
|
|
2909
2999
|
} catch (l) {
|
|
2910
|
-
|
|
3000
|
+
r((u) => ({
|
|
2911
3001
|
...u,
|
|
2912
3002
|
isLoading: !1,
|
|
2913
3003
|
error: l instanceof Error ? l.message : "Passkey login failed"
|
|
@@ -2915,30 +3005,30 @@ function No({ children: t, config: e }) {
|
|
|
2915
3005
|
}
|
|
2916
3006
|
return;
|
|
2917
3007
|
}
|
|
2918
|
-
window.location.href =
|
|
3008
|
+
window.location.href = ao(p, e.spaceId, f);
|
|
2919
3009
|
},
|
|
2920
3010
|
[e.authUrl, e.spaceId]
|
|
2921
3011
|
), s = D(() => {
|
|
2922
|
-
|
|
3012
|
+
Ee(), r({
|
|
2923
3013
|
isAuthenticated: !1,
|
|
2924
3014
|
isLoading: !1,
|
|
2925
3015
|
user: null,
|
|
2926
3016
|
error: null
|
|
2927
3017
|
});
|
|
2928
3018
|
}, []), i = D(
|
|
2929
|
-
async (
|
|
2930
|
-
const
|
|
2931
|
-
|
|
3019
|
+
async (p) => {
|
|
3020
|
+
const f = xe(e.authUrl);
|
|
3021
|
+
r((l) => ({ ...l, isLoading: !0, error: null }));
|
|
2932
3022
|
try {
|
|
2933
|
-
const l = await
|
|
2934
|
-
|
|
3023
|
+
const l = await co(f), u = await yo({ optionsJSON: l }), d = await uo(f, u, p);
|
|
3024
|
+
r({
|
|
2935
3025
|
isAuthenticated: !0,
|
|
2936
3026
|
isLoading: !1,
|
|
2937
|
-
user:
|
|
3027
|
+
user: fe(d),
|
|
2938
3028
|
error: null
|
|
2939
3029
|
});
|
|
2940
3030
|
} catch (l) {
|
|
2941
|
-
|
|
3031
|
+
r((u) => ({
|
|
2942
3032
|
...u,
|
|
2943
3033
|
isLoading: !1,
|
|
2944
3034
|
error: l instanceof Error ? l.message : "Passkey registration failed"
|
|
@@ -2946,127 +3036,127 @@ function No({ children: t, config: e }) {
|
|
|
2946
3036
|
}
|
|
2947
3037
|
},
|
|
2948
3038
|
[e.authUrl]
|
|
2949
|
-
), a = D(() =>
|
|
3039
|
+
), a = D(() => n.user?.token ?? null, [n.user]), c = K(
|
|
2950
3040
|
() => ({
|
|
2951
|
-
state:
|
|
3041
|
+
state: n,
|
|
2952
3042
|
login: o,
|
|
2953
3043
|
logout: s,
|
|
2954
3044
|
getToken: a,
|
|
2955
3045
|
registerPasskey: i
|
|
2956
3046
|
}),
|
|
2957
|
-
[
|
|
3047
|
+
[n, o, s, a, i]
|
|
2958
3048
|
);
|
|
2959
|
-
return /* @__PURE__ */
|
|
3049
|
+
return /* @__PURE__ */ E.jsx(Ge, { value: c, children: t });
|
|
2960
3050
|
}
|
|
2961
|
-
function
|
|
2962
|
-
const t =
|
|
3051
|
+
function vo() {
|
|
3052
|
+
const t = Ye(Ge);
|
|
2963
3053
|
if (!t)
|
|
2964
3054
|
throw new Error("useAuth must be used within an AuthProvider");
|
|
2965
3055
|
return t;
|
|
2966
3056
|
}
|
|
2967
|
-
function
|
|
2968
|
-
return
|
|
3057
|
+
function Eo() {
|
|
3058
|
+
return Ye(Ge);
|
|
2969
3059
|
}
|
|
2970
|
-
function
|
|
2971
|
-
const { config: e, guestUrlParam:
|
|
2972
|
-
return
|
|
2973
|
-
if (!
|
|
3060
|
+
function $o(t) {
|
|
3061
|
+
const { config: e, guestUrlParam: n } = t, { state: r, login: o } = vo(), s = v(!1);
|
|
3062
|
+
return N(() => {
|
|
3063
|
+
if (!n || r.isAuthenticated || r.isLoading || s.current || !e.methods.includes("guest"))
|
|
2974
3064
|
return;
|
|
2975
|
-
const i = new URLSearchParams(window.location.search), a = i.get(
|
|
3065
|
+
const i = new URLSearchParams(window.location.search), a = i.get(n);
|
|
2976
3066
|
if (a === "true" || a === "1" || a === "") {
|
|
2977
|
-
i.delete(
|
|
2978
|
-
const c = i.toString(),
|
|
2979
|
-
window.history.replaceState({}, "",
|
|
3067
|
+
i.delete(n);
|
|
3068
|
+
const c = i.toString(), p = window.location.pathname + (c ? `?${c}` : "");
|
|
3069
|
+
window.history.replaceState({}, "", p), s.current = !0, o("guest");
|
|
2980
3070
|
}
|
|
2981
|
-
}, [
|
|
2982
|
-
shouldRenderChildren:
|
|
2983
|
-
isCheckingAuth:
|
|
2984
|
-
isAuthenticated:
|
|
2985
|
-
error:
|
|
3071
|
+
}, [n, r.isAuthenticated, r.isLoading, e.methods, o]), {
|
|
3072
|
+
shouldRenderChildren: r.isAuthenticated,
|
|
3073
|
+
isCheckingAuth: r.isLoading,
|
|
3074
|
+
isAuthenticated: r.isAuthenticated,
|
|
3075
|
+
error: r.error
|
|
2986
3076
|
};
|
|
2987
3077
|
}
|
|
2988
|
-
function
|
|
3078
|
+
function Vo({
|
|
2989
3079
|
connectionState: t,
|
|
2990
3080
|
error: e,
|
|
2991
|
-
isReady:
|
|
2992
|
-
stores:
|
|
3081
|
+
isReady: n,
|
|
3082
|
+
stores: r,
|
|
2993
3083
|
registry: o,
|
|
2994
3084
|
client: s,
|
|
2995
3085
|
onAction: i,
|
|
2996
3086
|
renderIdle: a,
|
|
2997
3087
|
renderConnecting: c,
|
|
2998
|
-
renderConnectingSlow:
|
|
2999
|
-
renderConnected:
|
|
3088
|
+
renderConnectingSlow: p,
|
|
3089
|
+
renderConnected: f,
|
|
3000
3090
|
renderOffline: l,
|
|
3001
3091
|
renderError: u
|
|
3002
3092
|
}) {
|
|
3003
|
-
const
|
|
3093
|
+
const d = v(!1);
|
|
3004
3094
|
switch (t) {
|
|
3005
3095
|
case "idle":
|
|
3006
3096
|
return a();
|
|
3007
3097
|
case "connecting":
|
|
3008
3098
|
return c();
|
|
3009
3099
|
case "connectingSlow":
|
|
3010
|
-
return
|
|
3100
|
+
return p();
|
|
3011
3101
|
case "connected":
|
|
3012
3102
|
case "reconnecting": {
|
|
3013
|
-
if (!
|
|
3014
|
-
t === "reconnecting" && (
|
|
3015
|
-
const m =
|
|
3016
|
-
return m && (
|
|
3017
|
-
stores:
|
|
3103
|
+
if (!n || !r || !o) return null;
|
|
3104
|
+
t === "reconnecting" && (d.current = !0);
|
|
3105
|
+
const m = r.size > 0;
|
|
3106
|
+
return m && (d.current = !1), f({
|
|
3107
|
+
stores: r,
|
|
3018
3108
|
registry: o,
|
|
3019
3109
|
client: s,
|
|
3020
3110
|
onAction: i,
|
|
3021
|
-
isReconnecting: t === "reconnecting" ||
|
|
3111
|
+
isReconnecting: t === "reconnecting" || d.current && !m
|
|
3022
3112
|
});
|
|
3023
3113
|
}
|
|
3024
3114
|
case "offline":
|
|
3025
|
-
return
|
|
3115
|
+
return d.current = !1, l();
|
|
3026
3116
|
case "offlineError":
|
|
3027
|
-
return
|
|
3117
|
+
return d.current = !1, u(e ?? s?.lastError?.message ?? null);
|
|
3028
3118
|
default:
|
|
3029
3119
|
return null;
|
|
3030
3120
|
}
|
|
3031
3121
|
}
|
|
3032
|
-
const be =
|
|
3033
|
-
function
|
|
3122
|
+
const be = ke("useIkonApp");
|
|
3123
|
+
function Ro() {
|
|
3034
3124
|
if (typeof window < "u" && window.__IKON_AUTH_CONFIG__)
|
|
3035
3125
|
return window.__IKON_AUTH_CONFIG__;
|
|
3036
3126
|
}
|
|
3037
|
-
function
|
|
3127
|
+
function ko() {
|
|
3038
3128
|
if (typeof window < "u" && window.__IKON_LOCAL_IKON_SERVER_CONFIG__)
|
|
3039
3129
|
return window.__IKON_LOCAL_IKON_SERVER_CONFIG__;
|
|
3040
3130
|
}
|
|
3041
|
-
function
|
|
3042
|
-
const { authConfig: e, modules:
|
|
3043
|
-
|
|
3044
|
-
const [
|
|
3131
|
+
function Ko(t) {
|
|
3132
|
+
const { authConfig: e, modules: n, timeouts: r, backgroundAudio: o, webRtc: s, audio: i, video: a, websocket: c, webtransport: p, proxy: f } = t, l = e === void 0 ? Ro() ?? null : e, u = ko(), d = Eo(), m = v(null), b = v(null), g = v(null), y = v(!1), w = v(!1), T = v(o), C = v(r), _ = v(s), B = v(i), Q = v(a), A = v(c), P = v(p), U = v(f);
|
|
3133
|
+
T.current = o, C.current = r, _.current = s, B.current = i, Q.current = a, A.current = c, P.current = p, U.current = f;
|
|
3134
|
+
const [M, F] = Y("idle"), [W, re] = Y(null), [pe, he] = Y(null), [ie, me] = Y(null), [ee, h] = Y(null), [S, k] = Y(!1), [L, q] = Y(0), I = K(() => {
|
|
3045
3135
|
try {
|
|
3046
|
-
const
|
|
3047
|
-
return (
|
|
3136
|
+
const x = Vt();
|
|
3137
|
+
return (x.sessionId || x.channelKey) && Kt(), x;
|
|
3048
3138
|
} catch {
|
|
3049
3139
|
return { parameters: {} };
|
|
3050
3140
|
}
|
|
3051
|
-
}, []),
|
|
3052
|
-
|
|
3053
|
-
!te &&
|
|
3054
|
-
|
|
3055
|
-
}).catch((
|
|
3056
|
-
be.error("Anonymous auth failed:",
|
|
3141
|
+
}, []), H = K(() => l?.enabled ? Tt() : null, [l?.enabled, L]), te = u?.enabled ?? !1, O = u?.host ?? "localhost", G = u?.port ?? 8443;
|
|
3142
|
+
N(() => {
|
|
3143
|
+
!te && Je() && l && !l.enabled && l.spaceId && !ee && !S && (k(!0), Ct(l.spaceId, xe(l.authUrl)).then((V) => {
|
|
3144
|
+
h(V.token);
|
|
3145
|
+
}).catch((V) => {
|
|
3146
|
+
be.error("Anonymous auth failed:", V), re(V instanceof Error ? V.message : "Anonymous auth failed");
|
|
3057
3147
|
}).finally(() => {
|
|
3058
|
-
|
|
3148
|
+
k(!1);
|
|
3059
3149
|
}));
|
|
3060
3150
|
}, [te, l, ee, S]);
|
|
3061
|
-
const
|
|
3151
|
+
const ne = K(() => {
|
|
3062
3152
|
if (te) {
|
|
3063
|
-
const
|
|
3153
|
+
const x = H?.token ? Yt(H.token) ?? void 0 : void 0;
|
|
3064
3154
|
return {
|
|
3065
3155
|
local: {
|
|
3066
|
-
host:
|
|
3156
|
+
host: O,
|
|
3067
3157
|
httpsPort: G,
|
|
3068
|
-
userId:
|
|
3069
|
-
token:
|
|
3158
|
+
userId: x,
|
|
3159
|
+
token: H?.token ?? void 0,
|
|
3070
3160
|
spaceId: l?.spaceId,
|
|
3071
3161
|
backendUrl: l?.backendUrl,
|
|
3072
3162
|
authUrl: l?.authUrl,
|
|
@@ -3074,11 +3164,11 @@ function Mo(t) {
|
|
|
3074
3164
|
}
|
|
3075
3165
|
};
|
|
3076
3166
|
}
|
|
3077
|
-
return
|
|
3167
|
+
return H?.token && l?.spaceId ? {
|
|
3078
3168
|
sessionToken: {
|
|
3079
|
-
token:
|
|
3169
|
+
token: H.token,
|
|
3080
3170
|
spaceId: l.spaceId,
|
|
3081
|
-
backendType:
|
|
3171
|
+
backendType: Xe(),
|
|
3082
3172
|
sessionId: I.sessionId,
|
|
3083
3173
|
channelKey: I.channelKey,
|
|
3084
3174
|
parameters: I.parameters
|
|
@@ -3087,14 +3177,14 @@ function Mo(t) {
|
|
|
3087
3177
|
sessionToken: {
|
|
3088
3178
|
token: ee,
|
|
3089
3179
|
spaceId: l.spaceId,
|
|
3090
|
-
backendType:
|
|
3180
|
+
backendType: Xe(),
|
|
3091
3181
|
sessionId: I.sessionId,
|
|
3092
3182
|
channelKey: I.channelKey,
|
|
3093
3183
|
parameters: I.parameters
|
|
3094
3184
|
}
|
|
3095
|
-
} :
|
|
3185
|
+
} : Je() ? null : {
|
|
3096
3186
|
local: {
|
|
3097
|
-
host:
|
|
3187
|
+
host: O,
|
|
3098
3188
|
httpsPort: G,
|
|
3099
3189
|
spaceId: l?.spaceId,
|
|
3100
3190
|
backendUrl: l?.backendUrl,
|
|
@@ -3102,105 +3192,105 @@ function Mo(t) {
|
|
|
3102
3192
|
parameters: I.parameters
|
|
3103
3193
|
}
|
|
3104
3194
|
};
|
|
3105
|
-
}, [te,
|
|
3106
|
-
|
|
3107
|
-
const
|
|
3108
|
-
|
|
3195
|
+
}, [te, O, G, H?.token, l?.spaceId, l?.backendUrl, l?.authUrl, ee, I.sessionId, I.channelKey, I.parameters]);
|
|
3196
|
+
pr(ie);
|
|
3197
|
+
const Ce = mr(ie);
|
|
3198
|
+
N(() => {
|
|
3109
3199
|
if (!y.current) {
|
|
3110
|
-
if (y.current = !0, g.current =
|
|
3111
|
-
for (const
|
|
3112
|
-
|
|
3113
|
-
g.current.loadRegisteredModules().catch((
|
|
3114
|
-
be.error("Failed to load UI modules",
|
|
3200
|
+
if (y.current = !0, g.current = sr(), n)
|
|
3201
|
+
for (const x of n)
|
|
3202
|
+
x(g.current);
|
|
3203
|
+
g.current.loadRegisteredModules().catch((x) => {
|
|
3204
|
+
be.error("Failed to load UI modules", x);
|
|
3115
3205
|
});
|
|
3116
3206
|
}
|
|
3117
|
-
}, []),
|
|
3118
|
-
if (!
|
|
3119
|
-
const
|
|
3120
|
-
...
|
|
3121
|
-
timeouts:
|
|
3122
|
-
audio:
|
|
3123
|
-
enabled:
|
|
3124
|
-
...
|
|
3207
|
+
}, []), N(() => {
|
|
3208
|
+
if (!ne) return;
|
|
3209
|
+
const x = new zt({
|
|
3210
|
+
...ne,
|
|
3211
|
+
timeouts: C.current,
|
|
3212
|
+
audio: B.current !== void 0 || T.current ? {
|
|
3213
|
+
enabled: B.current,
|
|
3214
|
+
...T.current ? { background: { allowOnDesktop: !0, allowOnMobile: !0 } } : {}
|
|
3125
3215
|
} : void 0,
|
|
3126
3216
|
video: Q.current !== void 0 ? { enabled: Q.current } : void 0,
|
|
3127
3217
|
mediaSession: { title: document.title || void 0, artist: document.title || void 0 },
|
|
3128
|
-
webRtc:
|
|
3129
|
-
websocket:
|
|
3130
|
-
webtransport:
|
|
3131
|
-
proxy:
|
|
3132
|
-
onConnectionStateChange: (
|
|
3133
|
-
F(
|
|
3218
|
+
webRtc: _.current === !1 ? { enabled: !1 } : void 0,
|
|
3219
|
+
websocket: A.current,
|
|
3220
|
+
webtransport: P.current,
|
|
3221
|
+
proxy: U.current,
|
|
3222
|
+
onConnectionStateChange: (J) => {
|
|
3223
|
+
F(J);
|
|
3134
3224
|
},
|
|
3135
|
-
onError: (
|
|
3136
|
-
|
|
3225
|
+
onError: (J) => {
|
|
3226
|
+
re(J.message);
|
|
3137
3227
|
}
|
|
3138
3228
|
});
|
|
3139
|
-
m.current =
|
|
3140
|
-
const
|
|
3141
|
-
return b.current =
|
|
3142
|
-
if (be.error("Connection failed:",
|
|
3143
|
-
|
|
3229
|
+
m.current = x;
|
|
3230
|
+
const V = new hn({ client: x });
|
|
3231
|
+
return b.current = V, me(V), x.connect().catch((J) => {
|
|
3232
|
+
if (be.error("Connection failed:", J), J instanceof Wt) {
|
|
3233
|
+
he(J.reason);
|
|
3144
3234
|
return;
|
|
3145
3235
|
}
|
|
3146
|
-
|
|
3236
|
+
J instanceof qt && !w.current && (w.current = !0, be.warn("Auth session appears stale, clearing and retrying"), d ? d.logout() : (Ee(), q((xt) => xt + 1)));
|
|
3147
3237
|
}), () => {
|
|
3148
|
-
|
|
3238
|
+
x.disconnect(), m.current = null, V.dispose(), b.current = null;
|
|
3149
3239
|
};
|
|
3150
|
-
}, [
|
|
3151
|
-
const
|
|
3152
|
-
const
|
|
3153
|
-
m.current?.sendActionCall(
|
|
3154
|
-
}, []),
|
|
3240
|
+
}, [ne]);
|
|
3241
|
+
const Mt = D((x, V) => {
|
|
3242
|
+
const J = typeof V == "string" ? V : JSON.stringify(V ?? {});
|
|
3243
|
+
m.current?.sendActionCall(x, J);
|
|
3244
|
+
}, []), Lt = M === "connected" || M === "reconnecting";
|
|
3155
3245
|
return {
|
|
3156
|
-
connectionState:
|
|
3157
|
-
error:
|
|
3158
|
-
accessDeniedReason:
|
|
3159
|
-
stores:
|
|
3246
|
+
connectionState: M,
|
|
3247
|
+
error: W,
|
|
3248
|
+
accessDeniedReason: pe,
|
|
3249
|
+
stores: Ce,
|
|
3160
3250
|
client: m.current,
|
|
3161
3251
|
registry: g.current,
|
|
3162
3252
|
clientRef: m,
|
|
3163
3253
|
uiRef: b,
|
|
3164
3254
|
registryRef: g,
|
|
3165
|
-
onAction:
|
|
3166
|
-
isReady:
|
|
3255
|
+
onAction: Mt,
|
|
3256
|
+
isReady: Lt,
|
|
3167
3257
|
webRtcVideoStreams: m.current?.webRtcVideoStreams ?? /* @__PURE__ */ new Map(),
|
|
3168
3258
|
webRtcTrackMap: m.current?.webRtcTrackMap ?? /* @__PURE__ */ new Map()
|
|
3169
3259
|
};
|
|
3170
3260
|
}
|
|
3171
|
-
function
|
|
3172
|
-
const e =
|
|
3261
|
+
function Yo(t) {
|
|
3262
|
+
const e = v(!1);
|
|
3173
3263
|
return D(() => {
|
|
3174
3264
|
if (e.current) return;
|
|
3175
3265
|
e.current = !0;
|
|
3176
|
-
const
|
|
3177
|
-
|
|
3266
|
+
const n = document.createElement("link");
|
|
3267
|
+
n.rel = "stylesheet", n.href = t, document.head.appendChild(n);
|
|
3178
3268
|
}, [t]);
|
|
3179
3269
|
}
|
|
3180
|
-
let
|
|
3181
|
-
function
|
|
3182
|
-
const [
|
|
3270
|
+
let Ao = 0;
|
|
3271
|
+
function zo(t = 5, e = 5e3) {
|
|
3272
|
+
const [n, r] = Y([]), o = v(/* @__PURE__ */ new Map()), s = D((i) => {
|
|
3183
3273
|
const a = o.current.get(i);
|
|
3184
|
-
a && (clearTimeout(a), o.current.delete(i)),
|
|
3274
|
+
a && (clearTimeout(a), o.current.delete(i)), r((c) => c.filter((p) => p.id !== i));
|
|
3185
3275
|
}, []);
|
|
3186
|
-
return
|
|
3187
|
-
const i = o.current, a =
|
|
3276
|
+
return N(() => {
|
|
3277
|
+
const i = o.current, a = Ht(
|
|
3188
3278
|
(c) => {
|
|
3189
|
-
if (!
|
|
3279
|
+
if (!Gt())
|
|
3190
3280
|
return;
|
|
3191
|
-
const
|
|
3192
|
-
id:
|
|
3193
|
-
level:
|
|
3281
|
+
const p = `toast-${++Ao}`, f = c.level === Ze.ERROR ? "error" : "warn", l = {
|
|
3282
|
+
id: p,
|
|
3283
|
+
level: f,
|
|
3194
3284
|
message: c.message,
|
|
3195
3285
|
component: c.component
|
|
3196
3286
|
};
|
|
3197
|
-
|
|
3287
|
+
r((d) => [...d, l].slice(-t));
|
|
3198
3288
|
const u = setTimeout(() => {
|
|
3199
|
-
s(
|
|
3289
|
+
s(p);
|
|
3200
3290
|
}, e);
|
|
3201
|
-
i.set(
|
|
3291
|
+
i.set(p, u);
|
|
3202
3292
|
},
|
|
3203
|
-
{ minLevel:
|
|
3293
|
+
{ minLevel: Ze.WARN }
|
|
3204
3294
|
);
|
|
3205
3295
|
return () => {
|
|
3206
3296
|
a();
|
|
@@ -3208,103 +3298,103 @@ function jo(t = 5, e = 5e3) {
|
|
|
3208
3298
|
clearTimeout(c);
|
|
3209
3299
|
i.clear();
|
|
3210
3300
|
};
|
|
3211
|
-
}, [t, e, s]), { toasts:
|
|
3301
|
+
}, [t, e, s]), { toasts: n, dismissToast: s };
|
|
3212
3302
|
}
|
|
3213
|
-
const
|
|
3214
|
-
function
|
|
3215
|
-
return e ? t.replace(/\{(\w+)\}/g, (
|
|
3303
|
+
const Pt = yt(null);
|
|
3304
|
+
function To(t, e) {
|
|
3305
|
+
return e ? t.replace(/\{(\w+)\}/g, (n, r) => e[r] ?? `{${r}}`) : t;
|
|
3216
3306
|
}
|
|
3217
|
-
function
|
|
3218
|
-
const
|
|
3219
|
-
if (
|
|
3220
|
-
return
|
|
3221
|
-
const
|
|
3222
|
-
return t.includes(
|
|
3307
|
+
function Co(t, e) {
|
|
3308
|
+
const n = Jt();
|
|
3309
|
+
if (n && t.includes(n))
|
|
3310
|
+
return n;
|
|
3311
|
+
const r = navigator.language.split("-")[0];
|
|
3312
|
+
return t.includes(r) ? r : e && t.includes(e) ? e : "en";
|
|
3223
3313
|
}
|
|
3224
|
-
function
|
|
3225
|
-
return e ?
|
|
3314
|
+
function Io(t, e, n) {
|
|
3315
|
+
return e ? Co(t, n) : n && t.includes(n) ? n : "en";
|
|
3226
3316
|
}
|
|
3227
|
-
function
|
|
3317
|
+
function Wo({
|
|
3228
3318
|
children: t,
|
|
3229
3319
|
translations: e,
|
|
3230
|
-
defaultLanguage:
|
|
3231
|
-
detectLanguage:
|
|
3320
|
+
defaultLanguage: n,
|
|
3321
|
+
detectLanguage: r = !1
|
|
3232
3322
|
}) {
|
|
3233
|
-
const o = Object.keys(e), s =
|
|
3323
|
+
const o = Object.keys(e), s = Io(o, r, n), i = e[s] ?? e.en, a = K(
|
|
3234
3324
|
() => ({
|
|
3235
|
-
t: (c,
|
|
3236
|
-
const
|
|
3237
|
-
return
|
|
3325
|
+
t: (c, p) => {
|
|
3326
|
+
const f = i[c];
|
|
3327
|
+
return To(f, p);
|
|
3238
3328
|
},
|
|
3239
3329
|
locale: s,
|
|
3240
3330
|
translations: i
|
|
3241
3331
|
}),
|
|
3242
3332
|
[i, s]
|
|
3243
3333
|
);
|
|
3244
|
-
return /* @__PURE__ */
|
|
3334
|
+
return /* @__PURE__ */ E.jsx(Pt, { value: a, children: t });
|
|
3245
3335
|
}
|
|
3246
|
-
function
|
|
3247
|
-
const t =
|
|
3336
|
+
function qo() {
|
|
3337
|
+
const t = Ye(Pt);
|
|
3248
3338
|
if (!t)
|
|
3249
3339
|
throw new Error("useI18n must be used within an I18nProvider");
|
|
3250
3340
|
return t;
|
|
3251
3341
|
}
|
|
3252
3342
|
export {
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3343
|
+
Fo as AuthProvider,
|
|
3344
|
+
Vo as ConnectionStateRenderer,
|
|
3345
|
+
Wo as I18nProvider,
|
|
3346
|
+
In as IKON_UI_BASE_MODULE,
|
|
3347
|
+
Fn as IKON_UI_MEDIA_MODULE,
|
|
3348
|
+
tr as IKON_UI_SHADERTOY_MODULE,
|
|
3349
|
+
Qn as IKON_UI_SHADERTOY_TYPE,
|
|
3260
3350
|
Ue as IKON_UI_STREAM_CATEGORY,
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3351
|
+
xn as IKON_UI_VIDEO_CANVAS_TYPE,
|
|
3352
|
+
jn as IKON_UI_VIDEO_URL_PLAYER_TYPE,
|
|
3353
|
+
hn as IkonUi,
|
|
3354
|
+
or as IkonUiRegistry,
|
|
3355
|
+
Lo as IkonUiSurface,
|
|
3356
|
+
fn as InspectOverlay,
|
|
3357
|
+
dn as UiComponentRegistry,
|
|
3358
|
+
ln as UiRenderer,
|
|
3359
|
+
Jo as UiStreamStore,
|
|
3360
|
+
xo as areIkonUiModuleListsEqual,
|
|
3361
|
+
Ct as authenticateAnonymous,
|
|
3362
|
+
ao as buildOAuthRedirectUrl,
|
|
3363
|
+
Ee as clearAuthSession,
|
|
3364
|
+
gt as clearOAuthParams,
|
|
3365
|
+
Cn as createBaseResolvers,
|
|
3366
|
+
Po as createComponentLibrary,
|
|
3367
|
+
sr as createIkonUiRegistry,
|
|
3368
|
+
Dn as createMediaResolvers,
|
|
3369
|
+
er as createShadertoyRendererResolver,
|
|
3370
|
+
pn as isIkonUiCategoryMatch,
|
|
3371
|
+
Tt as loadAuthSession,
|
|
3372
|
+
On as loadBaseModule,
|
|
3373
|
+
$n as loadMediaModule,
|
|
3374
|
+
nr as loadShadertoyModule,
|
|
3375
|
+
Pr as normalizeIkonUiModuleList,
|
|
3376
|
+
Uo as parseIkonUiInitPayload,
|
|
3377
|
+
so as parseOAuthCallback,
|
|
3378
|
+
io as parseOAuthError,
|
|
3379
|
+
Mr as readIkonUiModules,
|
|
3380
|
+
jo as readIkonUiModulesFromSources,
|
|
3381
|
+
Nn as registerBaseModule,
|
|
3382
|
+
Vn as registerMediaModule,
|
|
3383
|
+
rr as registerShadertoyModule,
|
|
3384
|
+
cn as renderChildren,
|
|
3385
|
+
Do as renderMotionLetters,
|
|
3386
|
+
Te as saveAuthSession,
|
|
3387
|
+
Bo as sendMagicLink,
|
|
3388
|
+
fe as sessionToUser,
|
|
3389
|
+
vo as useAuth,
|
|
3390
|
+
$o as useAuthGuard,
|
|
3391
|
+
Eo as useAuthOptional,
|
|
3392
|
+
qo as useI18n,
|
|
3393
|
+
Ko as useIkonApp,
|
|
3394
|
+
pr as useIkonStyles,
|
|
3395
|
+
mr as useIkonUiStores,
|
|
3396
|
+
Yo as useLazyFont,
|
|
3397
|
+
zo as useToasts,
|
|
3308
3398
|
Z as useUiNode,
|
|
3309
|
-
|
|
3399
|
+
Mo as useUiStore
|
|
3310
3400
|
};
|