@capytale/iframe-react 1.0.1 → 1.0.3

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/dist/index.es.js CHANGED
@@ -1,675 +1,47 @@
1
- import K, { useEffect as A, useMemo as se, useRef as Rt } from "react";
2
- import { getSocket as _t } from "@capytale/app-agent";
3
- var B = { exports: {} }, q = {};
4
- /**
5
- * @license React
6
- * react-jsx-runtime.production.min.js
7
- *
8
- * Copyright (c) Facebook, Inc. and its affiliates.
9
- *
10
- * This source code is licensed under the MIT license found in the
11
- * LICENSE file in the root directory of this source tree.
12
- */
13
- var Fe;
14
- function Tt() {
15
- if (Fe) return q;
16
- Fe = 1;
17
- var t = K, r = Symbol.for("react.element"), a = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, l = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, h = { key: !0, ref: !0, __self: !0, __source: !0 };
18
- function y(m, c, g) {
19
- var E, S = {}, x = null, P = null;
20
- g !== void 0 && (x = "" + g), c.key !== void 0 && (x = "" + c.key), c.ref !== void 0 && (P = c.ref);
21
- for (E in c) s.call(c, E) && !h.hasOwnProperty(E) && (S[E] = c[E]);
22
- if (m && m.defaultProps) for (E in c = m.defaultProps, c) S[E] === void 0 && (S[E] = c[E]);
23
- return { $$typeof: r, type: m, key: x, ref: P, props: S, _owner: l.current };
24
- }
25
- return q.Fragment = a, q.jsx = y, q.jsxs = y, q;
26
- }
27
- var J = {};
28
- /**
29
- * @license React
30
- * react-jsx-runtime.development.js
31
- *
32
- * Copyright (c) Facebook, Inc. and its affiliates.
33
- *
34
- * This source code is licensed under the MIT license found in the
35
- * LICENSE file in the root directory of this source tree.
36
- */
37
- var De;
38
- function wt() {
39
- return De || (De = 1, process.env.NODE_ENV !== "production" && function() {
40
- var t = K, r = Symbol.for("react.element"), a = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), l = Symbol.for("react.strict_mode"), h = Symbol.for("react.profiler"), y = Symbol.for("react.provider"), m = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), g = Symbol.for("react.suspense"), E = Symbol.for("react.suspense_list"), S = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), P = Symbol.for("react.offscreen"), L = Symbol.iterator, Je = "@@iterator";
41
- function Le(e) {
42
- if (e === null || typeof e != "object")
43
- return null;
44
- var n = L && e[L] || e[Je];
45
- return typeof n == "function" ? n : null;
46
- }
47
- var D = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
48
- function R(e) {
49
- {
50
- for (var n = arguments.length, o = new Array(n > 1 ? n - 1 : 0), i = 1; i < n; i++)
51
- o[i - 1] = arguments[i];
52
- Ye("error", e, o);
53
- }
54
- }
55
- function Ye(e, n, o) {
56
- {
57
- var i = D.ReactDebugCurrentFrame, v = i.getStackAddendum();
58
- v !== "" && (n += "%s", o = o.concat([v]));
59
- var p = o.map(function(d) {
60
- return String(d);
61
- });
62
- p.unshift("Warning: " + n), Function.prototype.apply.call(console[e], console, p);
63
- }
64
- }
65
- var Ue = !1, Ne = !1, Ve = !1, Be = !1, Ge = !1, ue;
66
- ue = Symbol.for("react.module.reference");
67
- function He(e) {
68
- return !!(typeof e == "string" || typeof e == "function" || e === s || e === h || Ge || e === l || e === g || e === E || Be || e === P || Ue || Ne || Ve || typeof e == "object" && e !== null && (e.$$typeof === x || e.$$typeof === S || e.$$typeof === y || e.$$typeof === m || e.$$typeof === c || // This needs to include all possible module reference object
69
- // types supported by any Flight configuration anywhere since
70
- // we don't know which Flight build this will end up being used
71
- // with.
72
- e.$$typeof === ue || e.getModuleId !== void 0));
73
- }
74
- function Qe(e, n, o) {
75
- var i = e.displayName;
76
- if (i)
77
- return i;
78
- var v = n.displayName || n.name || "";
79
- return v !== "" ? o + "(" + v + ")" : o;
80
- }
81
- function ce(e) {
82
- return e.displayName || "Context";
83
- }
84
- function O(e) {
85
- if (e == null)
86
- return null;
87
- if (typeof e.tag == "number" && R("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
88
- return e.displayName || e.name || null;
89
- if (typeof e == "string")
90
- return e;
91
- switch (e) {
92
- case s:
93
- return "Fragment";
94
- case a:
95
- return "Portal";
96
- case h:
97
- return "Profiler";
98
- case l:
99
- return "StrictMode";
100
- case g:
101
- return "Suspense";
102
- case E:
103
- return "SuspenseList";
104
- }
105
- if (typeof e == "object")
106
- switch (e.$$typeof) {
107
- case m:
108
- var n = e;
109
- return ce(n) + ".Consumer";
110
- case y:
111
- var o = e;
112
- return ce(o._context) + ".Provider";
113
- case c:
114
- return Qe(e, e.render, "ForwardRef");
115
- case S:
116
- var i = e.displayName || null;
117
- return i !== null ? i : O(e.type) || "Memo";
118
- case x: {
119
- var v = e, p = v._payload, d = v._init;
120
- try {
121
- return O(d(p));
122
- } catch {
123
- return null;
124
- }
125
- }
126
- }
127
- return null;
128
- }
129
- var j = Object.assign, M = 0, le, fe, de, ve, pe, ge, ye;
130
- function me() {
131
- }
132
- me.__reactDisabledLog = !0;
133
- function Ke() {
134
- {
135
- if (M === 0) {
136
- le = console.log, fe = console.info, de = console.warn, ve = console.error, pe = console.group, ge = console.groupCollapsed, ye = console.groupEnd;
137
- var e = {
138
- configurable: !0,
139
- enumerable: !0,
140
- value: me,
141
- writable: !0
142
- };
143
- Object.defineProperties(console, {
144
- info: e,
145
- log: e,
146
- warn: e,
147
- error: e,
148
- group: e,
149
- groupCollapsed: e,
150
- groupEnd: e
151
- });
152
- }
153
- M++;
154
- }
155
- }
156
- function ze() {
157
- {
158
- if (M--, M === 0) {
159
- var e = {
160
- configurable: !0,
161
- enumerable: !0,
162
- writable: !0
163
- };
164
- Object.defineProperties(console, {
165
- log: j({}, e, {
166
- value: le
167
- }),
168
- info: j({}, e, {
169
- value: fe
170
- }),
171
- warn: j({}, e, {
172
- value: de
173
- }),
174
- error: j({}, e, {
175
- value: ve
176
- }),
177
- group: j({}, e, {
178
- value: pe
179
- }),
180
- groupCollapsed: j({}, e, {
181
- value: ge
182
- }),
183
- groupEnd: j({}, e, {
184
- value: ye
185
- })
186
- });
187
- }
188
- M < 0 && R("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
189
- }
190
- }
191
- var z = D.ReactCurrentDispatcher, X;
192
- function Y(e, n, o) {
193
- {
194
- if (X === void 0)
195
- try {
196
- throw Error();
197
- } catch (v) {
198
- var i = v.stack.trim().match(/\n( *(at )?)/);
199
- X = i && i[1] || "";
200
- }
201
- return `
202
- ` + X + e;
203
- }
204
- }
205
- var Z = !1, U;
206
- {
207
- var Xe = typeof WeakMap == "function" ? WeakMap : Map;
208
- U = new Xe();
209
- }
210
- function Se(e, n) {
211
- if (!e || Z)
212
- return "";
213
- {
214
- var o = U.get(e);
215
- if (o !== void 0)
216
- return o;
217
- }
218
- var i;
219
- Z = !0;
220
- var v = Error.prepareStackTrace;
221
- Error.prepareStackTrace = void 0;
222
- var p;
223
- p = z.current, z.current = null, Ke();
224
- try {
225
- if (n) {
226
- var d = function() {
227
- throw Error();
228
- };
229
- if (Object.defineProperty(d.prototype, "props", {
230
- set: function() {
231
- throw Error();
232
- }
233
- }), typeof Reflect == "object" && Reflect.construct) {
234
- try {
235
- Reflect.construct(d, []);
236
- } catch (T) {
237
- i = T;
238
- }
239
- Reflect.construct(e, [], d);
240
- } else {
241
- try {
242
- d.call();
243
- } catch (T) {
244
- i = T;
245
- }
246
- e.call(d.prototype);
247
- }
248
- } else {
249
- try {
250
- throw Error();
251
- } catch (T) {
252
- i = T;
253
- }
254
- e();
255
- }
256
- } catch (T) {
257
- if (T && i && typeof T.stack == "string") {
258
- for (var f = T.stack.split(`
259
- `), _ = i.stack.split(`
260
- `), b = f.length - 1, C = _.length - 1; b >= 1 && C >= 0 && f[b] !== _[C]; )
261
- C--;
262
- for (; b >= 1 && C >= 0; b--, C--)
263
- if (f[b] !== _[C]) {
264
- if (b !== 1 || C !== 1)
265
- do
266
- if (b--, C--, C < 0 || f[b] !== _[C]) {
267
- var w = `
268
- ` + f[b].replace(" at new ", " at ");
269
- return e.displayName && w.includes("<anonymous>") && (w = w.replace("<anonymous>", e.displayName)), typeof e == "function" && U.set(e, w), w;
270
- }
271
- while (b >= 1 && C >= 0);
272
- break;
273
- }
274
- }
275
- } finally {
276
- Z = !1, z.current = p, ze(), Error.prepareStackTrace = v;
277
- }
278
- var $ = e ? e.displayName || e.name : "", F = $ ? Y($) : "";
279
- return typeof e == "function" && U.set(e, F), F;
280
- }
281
- function Ze(e, n, o) {
282
- return Se(e, !1);
283
- }
284
- function et(e) {
285
- var n = e.prototype;
286
- return !!(n && n.isReactComponent);
287
- }
288
- function N(e, n, o) {
289
- if (e == null)
290
- return "";
291
- if (typeof e == "function")
292
- return Se(e, et(e));
293
- if (typeof e == "string")
294
- return Y(e);
295
- switch (e) {
296
- case g:
297
- return Y("Suspense");
298
- case E:
299
- return Y("SuspenseList");
300
- }
301
- if (typeof e == "object")
302
- switch (e.$$typeof) {
303
- case c:
304
- return Ze(e.render);
305
- case S:
306
- return N(e.type, n, o);
307
- case x: {
308
- var i = e, v = i._payload, p = i._init;
309
- try {
310
- return N(p(v), n, o);
311
- } catch {
312
- }
313
- }
314
- }
315
- return "";
316
- }
317
- var W = Object.prototype.hasOwnProperty, be = {}, Ce = D.ReactDebugCurrentFrame;
318
- function V(e) {
319
- if (e) {
320
- var n = e._owner, o = N(e.type, e._source, n ? n.type : null);
321
- Ce.setExtraStackFrame(o);
322
- } else
323
- Ce.setExtraStackFrame(null);
324
- }
325
- function tt(e, n, o, i, v) {
326
- {
327
- var p = Function.call.bind(W);
328
- for (var d in e)
329
- if (p(e, d)) {
330
- var f = void 0;
331
- try {
332
- if (typeof e[d] != "function") {
333
- var _ = Error((i || "React class") + ": " + o + " type `" + d + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[d] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
334
- throw _.name = "Invariant Violation", _;
335
- }
336
- f = e[d](n, d, i, o, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
337
- } catch (b) {
338
- f = b;
339
- }
340
- f && !(f instanceof Error) && (V(v), R("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", i || "React class", o, d, typeof f), V(null)), f instanceof Error && !(f.message in be) && (be[f.message] = !0, V(v), R("Failed %s type: %s", o, f.message), V(null));
341
- }
342
- }
343
- }
344
- var nt = Array.isArray;
345
- function ee(e) {
346
- return nt(e);
347
- }
348
- function rt(e) {
349
- {
350
- var n = typeof Symbol == "function" && Symbol.toStringTag, o = n && e[Symbol.toStringTag] || e.constructor.name || "Object";
351
- return o;
352
- }
353
- }
354
- function ot(e) {
355
- try {
356
- return he(e), !1;
357
- } catch {
358
- return !0;
359
- }
360
- }
361
- function he(e) {
362
- return "" + e;
363
- }
364
- function Ee(e) {
365
- if (ot(e))
366
- return R("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", rt(e)), he(e);
367
- }
368
- var Re = D.ReactCurrentOwner, at = {
369
- key: !0,
370
- ref: !0,
371
- __self: !0,
372
- __source: !0
373
- }, _e, Te;
374
- function it(e) {
375
- if (W.call(e, "ref")) {
376
- var n = Object.getOwnPropertyDescriptor(e, "ref").get;
377
- if (n && n.isReactWarning)
378
- return !1;
379
- }
380
- return e.ref !== void 0;
381
- }
382
- function st(e) {
383
- if (W.call(e, "key")) {
384
- var n = Object.getOwnPropertyDescriptor(e, "key").get;
385
- if (n && n.isReactWarning)
386
- return !1;
387
- }
388
- return e.key !== void 0;
389
- }
390
- function ut(e, n) {
391
- typeof e.ref == "string" && Re.current;
392
- }
393
- function ct(e, n) {
394
- {
395
- var o = function() {
396
- _e || (_e = !0, R("%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://reactjs.org/link/special-props)", n));
397
- };
398
- o.isReactWarning = !0, Object.defineProperty(e, "key", {
399
- get: o,
400
- configurable: !0
401
- });
402
- }
403
- }
404
- function lt(e, n) {
405
- {
406
- var o = function() {
407
- Te || (Te = !0, R("%s: `ref` 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://reactjs.org/link/special-props)", n));
408
- };
409
- o.isReactWarning = !0, Object.defineProperty(e, "ref", {
410
- get: o,
411
- configurable: !0
412
- });
413
- }
414
- }
415
- var ft = function(e, n, o, i, v, p, d) {
416
- var f = {
417
- // This tag allows us to uniquely identify this as a React Element
418
- $$typeof: r,
419
- // Built-in properties that belong on the element
420
- type: e,
421
- key: n,
422
- ref: o,
423
- props: d,
424
- // Record the component responsible for creating this element.
425
- _owner: p
426
- };
427
- return f._store = {}, Object.defineProperty(f._store, "validated", {
428
- configurable: !1,
429
- enumerable: !1,
430
- writable: !0,
431
- value: !1
432
- }), Object.defineProperty(f, "_self", {
433
- configurable: !1,
434
- enumerable: !1,
435
- writable: !1,
436
- value: i
437
- }), Object.defineProperty(f, "_source", {
438
- configurable: !1,
439
- enumerable: !1,
440
- writable: !1,
441
- value: v
442
- }), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
443
- };
444
- function dt(e, n, o, i, v) {
445
- {
446
- var p, d = {}, f = null, _ = null;
447
- o !== void 0 && (Ee(o), f = "" + o), st(n) && (Ee(n.key), f = "" + n.key), it(n) && (_ = n.ref, ut(n, v));
448
- for (p in n)
449
- W.call(n, p) && !at.hasOwnProperty(p) && (d[p] = n[p]);
450
- if (e && e.defaultProps) {
451
- var b = e.defaultProps;
452
- for (p in b)
453
- d[p] === void 0 && (d[p] = b[p]);
454
- }
455
- if (f || _) {
456
- var C = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
457
- f && ct(d, C), _ && lt(d, C);
458
- }
459
- return ft(e, f, _, v, i, Re.current, d);
460
- }
461
- }
462
- var te = D.ReactCurrentOwner, we = D.ReactDebugCurrentFrame;
463
- function I(e) {
464
- if (e) {
465
- var n = e._owner, o = N(e.type, e._source, n ? n.type : null);
466
- we.setExtraStackFrame(o);
467
- } else
468
- we.setExtraStackFrame(null);
469
- }
470
- var ne;
471
- ne = !1;
472
- function re(e) {
473
- return typeof e == "object" && e !== null && e.$$typeof === r;
474
- }
475
- function xe() {
476
- {
477
- if (te.current) {
478
- var e = O(te.current.type);
479
- if (e)
480
- return `
481
-
482
- Check the render method of \`` + e + "`.";
483
- }
484
- return "";
485
- }
486
- }
487
- function vt(e) {
488
- return "";
489
- }
490
- var ke = {};
491
- function pt(e) {
492
- {
493
- var n = xe();
494
- if (!n) {
495
- var o = typeof e == "string" ? e : e.displayName || e.name;
496
- o && (n = `
497
-
498
- Check the top-level render call using <` + o + ">.");
499
- }
500
- return n;
501
- }
502
- }
503
- function Ae(e, n) {
504
- {
505
- if (!e._store || e._store.validated || e.key != null)
506
- return;
507
- e._store.validated = !0;
508
- var o = pt(n);
509
- if (ke[o])
510
- return;
511
- ke[o] = !0;
512
- var i = "";
513
- e && e._owner && e._owner !== te.current && (i = " It was passed a child from " + O(e._owner.type) + "."), I(e), R('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', o, i), I(null);
514
- }
515
- }
516
- function Pe(e, n) {
517
- {
518
- if (typeof e != "object")
519
- return;
520
- if (ee(e))
521
- for (var o = 0; o < e.length; o++) {
522
- var i = e[o];
523
- re(i) && Ae(i, n);
524
- }
525
- else if (re(e))
526
- e._store && (e._store.validated = !0);
527
- else if (e) {
528
- var v = Le(e);
529
- if (typeof v == "function" && v !== e.entries)
530
- for (var p = v.call(e), d; !(d = p.next()).done; )
531
- re(d.value) && Ae(d.value, n);
532
- }
533
- }
534
- }
535
- function gt(e) {
536
- {
537
- var n = e.type;
538
- if (n == null || typeof n == "string")
539
- return;
540
- var o;
541
- if (typeof n == "function")
542
- o = n.propTypes;
543
- else if (typeof n == "object" && (n.$$typeof === c || // Note: Memo only checks outer props here.
544
- // Inner props are checked in the reconciler.
545
- n.$$typeof === S))
546
- o = n.propTypes;
547
- else
548
- return;
549
- if (o) {
550
- var i = O(n);
551
- tt(o, e.props, "prop", i, e);
552
- } else if (n.PropTypes !== void 0 && !ne) {
553
- ne = !0;
554
- var v = O(n);
555
- R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", v || "Unknown");
556
- }
557
- typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved && R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
558
- }
559
- }
560
- function yt(e) {
561
- {
562
- for (var n = Object.keys(e.props), o = 0; o < n.length; o++) {
563
- var i = n[o];
564
- if (i !== "children" && i !== "key") {
565
- I(e), R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", i), I(null);
566
- break;
567
- }
568
- }
569
- e.ref !== null && (I(e), R("Invalid attribute `ref` supplied to `React.Fragment`."), I(null));
570
- }
571
- }
572
- var Oe = {};
573
- function je(e, n, o, i, v, p) {
574
- {
575
- var d = He(e);
576
- if (!d) {
577
- var f = "";
578
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (f += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
579
- var _ = vt();
580
- _ ? f += _ : f += xe();
581
- var b;
582
- e === null ? b = "null" : ee(e) ? b = "array" : e !== void 0 && e.$$typeof === r ? (b = "<" + (O(e.type) || "Unknown") + " />", f = " Did you accidentally export a JSX literal instead of a component?") : b = typeof e, R("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", b, f);
583
- }
584
- var C = dt(e, n, o, v, p);
585
- if (C == null)
586
- return C;
587
- if (d) {
588
- var w = n.children;
589
- if (w !== void 0)
590
- if (i)
591
- if (ee(w)) {
592
- for (var $ = 0; $ < w.length; $++)
593
- Pe(w[$], e);
594
- Object.freeze && Object.freeze(w);
595
- } else
596
- R("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
597
- else
598
- Pe(w, e);
599
- }
600
- if (W.call(n, "key")) {
601
- var F = O(e), T = Object.keys(n).filter(function(Et) {
602
- return Et !== "key";
603
- }), oe = T.length > 0 ? "{key: someKey, " + T.join(": ..., ") + ": ...}" : "{key: someKey}";
604
- if (!Oe[F + oe]) {
605
- var ht = T.length > 0 ? "{" + T.join(": ..., ") + ": ...}" : "{}";
606
- R(`A props object containing a "key" prop is being spread into JSX:
607
- let props = %s;
608
- <%s {...props} />
609
- React keys must be passed directly to JSX without using spread:
610
- let props = %s;
611
- <%s key={someKey} {...props} />`, oe, F, ht, F), Oe[F + oe] = !0;
612
- }
613
- }
614
- return e === s ? yt(C) : gt(C), C;
615
- }
616
- }
617
- function mt(e, n, o) {
618
- return je(e, n, o, !0);
619
- }
620
- function St(e, n, o) {
621
- return je(e, n, o, !1);
622
- }
623
- var bt = St, Ct = mt;
624
- J.Fragment = s, J.jsx = bt, J.jsxs = Ct;
625
- }()), J;
626
- }
627
- var Ie;
628
- function xt() {
629
- return Ie || (Ie = 1, process.env.NODE_ENV === "production" ? B.exports = Tt() : B.exports = wt()), B.exports;
630
- }
631
- var $e = xt();
632
- const Me = (t) => {
633
- let r;
634
- const a = /* @__PURE__ */ new Set(), s = (g, E) => {
635
- const S = typeof g == "function" ? g(r) : g;
636
- if (!Object.is(S, r)) {
637
- const x = r;
638
- r = E ?? (typeof S != "object" || S === null) ? S : Object.assign({}, r, S), a.forEach((P) => P(r, x));
639
- }
640
- }, l = () => r, m = { setState: s, getState: l, getInitialState: () => c, subscribe: (g) => (a.add(g), () => a.delete(g)) }, c = r = t(s, l, m);
641
- return m;
642
- }, kt = (t) => t ? Me(t) : Me, At = (t) => t;
643
- function Pt(t, r = At) {
644
- const a = K.useSyncExternalStore(
1
+ import { jsx as x } from "react/jsx-runtime";
2
+ import h, { useEffect as S, useMemo as w, useRef as E } from "react";
3
+ import { getSocket as J } from "@capytale/app-agent";
4
+ const k = (t) => {
5
+ let e;
6
+ const n = /* @__PURE__ */ new Set(), s = (c, g) => {
7
+ const d = typeof c == "function" ? c(e) : c;
8
+ if (!Object.is(d, e)) {
9
+ const y = e;
10
+ e = g ?? (typeof d != "object" || d === null) ? d : Object.assign({}, e, d), n.forEach((f) => f(e, y));
11
+ }
12
+ }, i = () => e, l = { setState: s, getState: i, getInitialState: () => r, subscribe: (c) => (n.add(c), () => n.delete(c)) }, r = e = t(s, i, l);
13
+ return l;
14
+ }, $ = (t) => t ? k(t) : k, j = (t) => t;
15
+ function q(t, e = j) {
16
+ const n = h.useSyncExternalStore(
645
17
  t.subscribe,
646
- () => r(t.getState()),
647
- () => r(t.getInitialState())
18
+ () => e(t.getState()),
19
+ () => e(t.getInitialState())
648
20
  );
649
- return K.useDebugValue(a), a;
21
+ return h.useDebugValue(n), n;
650
22
  }
651
- const We = (t) => {
652
- const r = kt(t), a = (s) => Pt(r, s);
653
- return Object.assign(a, r), a;
654
- }, Ot = (t) => t ? We(t) : We, jt = (t) => (r, a, s) => {
655
- const l = s.subscribe;
656
- return s.subscribe = (y, m, c) => {
657
- let g = y;
658
- if (m) {
659
- const E = (c == null ? void 0 : c.equalityFn) || Object.is;
660
- let S = y(s.getState());
661
- g = (x) => {
662
- const P = y(x);
663
- if (!E(S, P)) {
664
- const L = S;
665
- m(S = P, L);
23
+ const T = (t) => {
24
+ const e = $(t), n = (s) => q(e, s);
25
+ return Object.assign(n, e), n;
26
+ }, I = (t) => t ? T(t) : T, P = (t) => (e, n, s) => {
27
+ const i = s.subscribe;
28
+ return s.subscribe = (a, l, r) => {
29
+ let c = a;
30
+ if (l) {
31
+ const g = (r == null ? void 0 : r.equalityFn) || Object.is;
32
+ let d = a(s.getState());
33
+ c = (y) => {
34
+ const f = a(y);
35
+ if (!g(d, f)) {
36
+ const M = d;
37
+ l(d = f, M);
666
38
  }
667
- }, c != null && c.fireImmediately && m(S, S);
39
+ }, r != null && r.fireImmediately && l(d, d);
668
40
  }
669
- return l(g);
670
- }, t(r, a, s);
671
- }, Ft = jt, u = Ot()(
672
- Ft((t) => ({
41
+ return i(c);
42
+ }, t(e, n, s);
43
+ }, D = P, o = I()(
44
+ D((t) => ({
673
45
  ready: !1,
674
46
  workflow: "current",
675
47
  mode: "assignment",
@@ -684,27 +56,27 @@ const We = (t) => {
684
56
  sidebarActions: {},
685
57
  quickActions: {},
686
58
  activitySettings: null,
687
- setGetTextContentFunction: (r) => {
688
- t({ getTextContentFunction: r });
59
+ setGetTextContentFunction: (e) => {
60
+ t({ getTextContentFunction: e });
689
61
  },
690
- setGetJsonContentFunction: (r) => {
691
- t({ getJsonContentFunction: r });
62
+ setGetJsonContentFunction: (e) => {
63
+ t({ getJsonContentFunction: e });
692
64
  },
693
- setSidebarActions: (r) => {
694
- t({ sidebarActions: r });
65
+ setSidebarActions: (e) => {
66
+ t({ sidebarActions: e });
695
67
  },
696
- setQuickActions: (r) => {
697
- t({ quickActions: r });
68
+ setQuickActions: (e) => {
69
+ t({ quickActions: e });
698
70
  },
699
- setActivitySettings: (r) => {
700
- t({ activitySettings: r });
71
+ setActivitySettings: (e) => {
72
+ t({ activitySettings: e });
701
73
  },
702
- incSaveCount: () => t((r) => ({
703
- saveCount: r.saveCount + 1
74
+ incSaveCount: () => t((e) => ({
75
+ saveCount: e.saveCount + 1
704
76
  })),
705
- incDirtyCount: () => t((r) => ({ isDirtyCount: r.isDirtyCount + 1 }))
77
+ incDirtyCount: () => t((e) => ({ isDirtyCount: e.isDirtyCount + 1 }))
706
78
  }))
707
- ), Dt = [
79
+ ), L = [
708
80
  "meta-player-events:1",
709
81
  "meta-player-ui:1",
710
82
  "mode:1",
@@ -716,10 +88,10 @@ const We = (t) => {
716
88
  "simple-binary-data(text):1",
717
89
  "simple-content-eval(text):1",
718
90
  "simple-content-eval(json):1"
719
- ], qe = {
91
+ ], F = {
720
92
  "mode:1": {
721
93
  setMode: (t) => {
722
- u.setState({ mode: t });
94
+ o.setState({ mode: t });
723
95
  }
724
96
  },
725
97
  "reload:1": {
@@ -730,65 +102,65 @@ const We = (t) => {
730
102
  "theme:1": {
731
103
  setTheme: (t) => {
732
104
  if (t === null) {
733
- u.setState({ theme: null });
105
+ o.setState({ theme: null });
734
106
  return;
735
107
  }
736
108
  if (t !== "light" && t !== "dark") {
737
109
  console.warn(
738
110
  `Invalid theme: ${t}. Expected 'light' or 'dark'.`
739
- ), u.setState({ theme: null });
111
+ ), o.setState({ theme: null });
740
112
  return;
741
113
  }
742
- u.setState({ theme: t });
114
+ o.setState({ theme: t });
743
115
  }
744
116
  },
745
117
  "workflow:1": {
746
118
  setWorkflow: (t) => {
747
- u.setState({ workflow: t });
119
+ o.setState({ workflow: t });
748
120
  }
749
121
  },
750
122
  "simple-content(text):1": {
751
123
  contentSaved: () => {
752
- u.setState((t) => ({
124
+ o.setState((t) => ({
753
125
  afterSaveCount: t.afterSaveCount + 1
754
126
  }));
755
127
  },
756
- getContent: () => u.getState().getTextContentFunction(),
128
+ getContent: () => o.getState().getTextContentFunction(),
757
129
  loadContent: (t) => {
758
- u.setState({ loadedTextContent: t });
130
+ o.setState({ loadedTextContent: t });
759
131
  }
760
132
  },
761
133
  "simple-content(json):1": {
762
134
  contentSaved: () => {
763
- u.setState((t) => ({
135
+ o.setState((t) => ({
764
136
  afterSaveCount: t.afterSaveCount + 1
765
137
  }));
766
138
  },
767
- getContent: () => u.getState().getJsonContentFunction(),
139
+ getContent: () => o.getState().getJsonContentFunction(),
768
140
  loadContent: (t) => {
769
- u.setState({ loadedJsonContent: t });
141
+ o.setState({ loadedJsonContent: t });
770
142
  }
771
143
  },
772
144
  "simple-binary-data(text):1": {
773
145
  contentSaved: () => {
774
- u.setState((t) => ({
146
+ o.setState((t) => ({
775
147
  afterSaveCount: t.afterSaveCount + 1
776
148
  }));
777
149
  },
778
- getContent: () => u.getState().getTextContentFunction(),
150
+ getContent: () => o.getState().getTextContentFunction(),
779
151
  loadContent: (t) => {
780
- u.setState({ loadedTextContent: t });
152
+ o.setState({ loadedTextContent: t });
781
153
  }
782
154
  },
783
155
  "simple-content-eval(text):1": {
784
156
  contentSaved: () => {
785
- u.setState((t) => ({
157
+ o.setState((t) => ({
786
158
  afterSaveCount: t.afterSaveCount + 1
787
159
  }));
788
160
  },
789
- getContent: () => u.getState().getTextContentFunction(),
161
+ getContent: () => o.getState().getTextContentFunction(),
790
162
  loadContent: (t) => {
791
- u.setState({ loadedTextContent: t });
163
+ o.setState({ loadedTextContent: t });
792
164
  },
793
165
  getAssignmentContent: () => {
794
166
  throw new Error(
@@ -798,13 +170,13 @@ const We = (t) => {
798
170
  },
799
171
  "simple-content-eval(json):1": {
800
172
  contentSaved: () => {
801
- u.setState((t) => ({
173
+ o.setState((t) => ({
802
174
  afterSaveCount: t.afterSaveCount + 1
803
175
  }));
804
176
  },
805
- getContent: () => u.getState().getJsonContentFunction(),
177
+ getContent: () => o.getState().getJsonContentFunction(),
806
178
  loadContent: (t) => {
807
- u.setState({ loadedJsonContent: t });
179
+ o.setState({ loadedJsonContent: t });
808
180
  },
809
181
  getAssignmentContent: () => {
810
182
  throw new Error(
@@ -812,242 +184,277 @@ const We = (t) => {
812
184
  );
813
185
  }
814
186
  },
187
+ "simple-content-eval(json):2": {
188
+ contentSaved: () => {
189
+ o.setState((t) => ({
190
+ afterSaveCount: t.afterSaveCount + 1
191
+ }));
192
+ },
193
+ getContent: () => o.getState().getJsonContentFunction(),
194
+ loadContent: (t) => {
195
+ o.setState({ loadedJsonContent: t });
196
+ },
197
+ getAssignmentContent: () => {
198
+ throw new Error(
199
+ "getAssignmentContent is not implemented for simple-content-eval(json)"
200
+ );
201
+ }
202
+ },
203
+ "simple-content-eval(text):2": {
204
+ contentSaved: () => {
205
+ o.setState((t) => ({
206
+ afterSaveCount: t.afterSaveCount + 1
207
+ }));
208
+ },
209
+ getContent: () => o.getState().getTextContentFunction(),
210
+ loadContent: (t) => {
211
+ o.setState({ loadedTextContent: t });
212
+ },
213
+ getAssignmentContent: () => {
214
+ throw new Error(
215
+ "getAssignmentContent is not implemented for simple-content-eval(text)"
216
+ );
217
+ }
218
+ },
815
219
  "meta-player-ui:1": {
816
220
  executeAction(t) {
817
221
  if (t.startsWith("qa")) {
818
- const a = u.getState().quickActions[t];
819
- a ? a() : console.error(`Quick action not found: ${t}`);
222
+ const n = o.getState().quickActions[t];
223
+ n ? n() : console.error(`Quick action not found: ${t}`);
820
224
  } else {
821
- const a = u.getState().sidebarActions[t];
822
- a ? a() : console.error(`Sidebar action not found: ${t}`);
225
+ const n = o.getState().sidebarActions[t];
226
+ n ? n() : console.error(`Sidebar action not found: ${t}`);
823
227
  }
824
228
  },
825
- executeFileUpload(t, r) {
229
+ executeFileUpload(t, e) {
826
230
  if (t.startsWith("qa")) {
827
- const s = u.getState().quickActions[t];
828
- s ? s(r) : console.error(`Quick action not found: ${t}`);
231
+ const s = o.getState().quickActions[t];
232
+ s ? s(e) : console.error(`Quick action not found: ${t}`);
829
233
  } else {
830
- const s = u.getState().sidebarActions[t];
831
- s ? s(r) : console.error(`Sidebar action not found: ${t}`);
234
+ const s = o.getState().sidebarActions[t];
235
+ s ? s(e) : console.error(`Sidebar action not found: ${t}`);
832
236
  }
833
237
  },
834
238
  updateSettings(t) {
835
- u.setState({ activitySettings: t });
239
+ o.setState({ activitySettings: t });
836
240
  }
837
241
  },
838
242
  "meta-player-events:1": {
839
243
  handleEvent(t) {
840
- t === "all-loaded" && u.setState({ ready: !0 });
244
+ t === "all-loaded" && o.setState({ ready: !0 });
841
245
  }
842
246
  }
843
- }, k = _t();
844
- function It(t) {
845
- for (const r of t) {
846
- if (!Dt.includes(r)) {
247
+ }, p = J();
248
+ function R(t) {
249
+ for (const e of t) {
250
+ if (!L.includes(e)) {
847
251
  console.warn(
848
- `Contract ${r} is not implemented in Capytale. Skipping plug.`
252
+ `Contract ${e} is not implemented in Capytale. Skipping plug.`
849
253
  );
850
254
  continue;
851
255
  }
852
- if (!(r in qe)) {
256
+ if (!(e in F)) {
853
257
  console.warn(
854
- `Contract handler for ${r} is not defined. Skipping plug.`
258
+ `Contract handler for ${e} is not defined. Skipping plug.`
855
259
  );
856
260
  continue;
857
261
  }
858
- const a = qe[r];
859
- k.plug([r], ([]) => [a]);
262
+ const n = F[e];
263
+ p.plug([e], ([]) => [n]);
860
264
  }
861
- k.plugsDone();
862
- for (const r of [
265
+ p.plugsDone();
266
+ for (const e of [
863
267
  "simple-content(text):1",
864
268
  "simple-content(json):1",
865
269
  "simple-binary-data(text):1",
866
- "simple-content-eval(text):1"
270
+ "simple-content-eval(text):1",
271
+ "simple-content-eval(json):1",
272
+ "simple-content-eval(json):2",
273
+ "simple-content-eval(text):2"
867
274
  ])
868
- if (console.log(`Contract ${r} is being subscribed to content changes.`), t.includes(r)) {
869
- console.log(`Subscribing to content changes for contract ${r}`);
870
- const a = r.split(":")[0];
871
- k.use([a], ([s]) => {
872
- u.subscribe((l) => l.isDirtyCount, () => {
873
- var l;
874
- (l = s.i) == null || l.contentChanged(), console.log(`Content changed for contract ${a}`);
275
+ if (console.log(`Contract ${e} is being subscribed to content changes.`), t.includes(e)) {
276
+ console.log(`Subscribing to content changes for contract ${e}`);
277
+ const n = e.split(":")[0];
278
+ p.use([n], ([s]) => {
279
+ o.subscribe((i) => i.isDirtyCount, () => {
280
+ var i;
281
+ (i = s.i) == null || i.contentChanged(), console.log(`Content changed for contract ${n}`);
875
282
  });
876
283
  });
877
284
  }
878
285
  }
879
- function Wt({
286
+ function G({
880
287
  children: t,
881
- contracts: r,
882
- loadOnlyWhenReady: a = !0
288
+ contracts: e,
289
+ loadOnlyWhenReady: n = !0
883
290
  }) {
884
- const s = u((l) => l.ready);
885
- return A(() => {
886
- const l = r.includes("meta-player-events:1") ? r : [...r, "meta-player-events:1"];
887
- It(l);
888
- }, []), a && !s ? /* @__PURE__ */ $e.jsx("div", { className: "container", children: "Chargement en cours..." }) : /* @__PURE__ */ $e.jsx("div", { className: "container", children: t });
291
+ const s = o((i) => i.ready);
292
+ return S(() => {
293
+ const i = e.includes("meta-player-events:1") ? e : [...e, "meta-player-events:1"];
294
+ R(i);
295
+ }, []), n && !s ? /* @__PURE__ */ x("div", { className: "container", children: "Chargement en cours..." }) : /* @__PURE__ */ x("div", { className: "container", children: t });
889
296
  }
890
- const qt = () => u((t) => {
297
+ const H = () => o((t) => {
891
298
  if (t.mode === null)
892
299
  throw new Error("Mode is not set. Have you used contract 'mode'?");
893
300
  return t.mode;
894
- }), Jt = () => u((t) => {
301
+ }), O = () => o((t) => {
895
302
  if (t.workflow === null)
896
303
  throw new Error("Workflow is not set. Have you used contract 'workflow'?");
897
304
  return t.workflow;
898
- }), Lt = () => u((t) => {
305
+ }), U = () => o((t) => {
899
306
  if (t.theme === null)
900
307
  throw new Error("Theme is not set. Have you used contract 'theme'?");
901
308
  return t.theme;
902
- }), Yt = () => u((t) => t.incSaveCount), Ut = () => u((t) => t.incDirtyCount), Nt = () => u((t) => t.loadedTextContent), Vt = () => u((t) => t.loadedJsonContent), Bt = (t) => {
903
- const r = u(
904
- (a) => a.setGetTextContentFunction
309
+ }), B = () => o((t) => t.incSaveCount), V = () => o((t) => t.incDirtyCount), _ = () => o((t) => t.loadedTextContent), z = () => o((t) => t.loadedJsonContent), K = (t) => {
310
+ const e = o(
311
+ (n) => n.setGetTextContentFunction
905
312
  );
906
- A(() => {
907
- r(t);
908
- }, [t, r]);
909
- }, Gt = (t) => {
910
- const r = u(
911
- (a) => a.setGetJsonContentFunction
313
+ S(() => {
314
+ e(t);
315
+ }, [t, e]);
316
+ }, X = (t) => {
317
+ const e = o(
318
+ (n) => n.setGetJsonContentFunction
912
319
  );
913
- A(() => {
914
- r(t);
915
- }, [t, r]);
916
- }, Ht = (t) => {
917
- const r = u((a) => a.afterSaveCount);
918
- A(() => {
919
- r > 0 && t();
920
- }, [r]);
921
- }, Qt = () => (t, r) => {
922
- k.use(["meta-player-ui"], ([a]) => {
320
+ S(() => {
321
+ e(t);
322
+ }, [t, e]);
323
+ }, Y = (t) => {
324
+ const e = o((n) => n.afterSaveCount);
325
+ S(() => {
326
+ e > 0 && t();
327
+ }, [e]);
328
+ }, Z = () => (t, e) => {
329
+ p.use(["meta-player-ui"], ([n]) => {
923
330
  var s;
924
- if (a.version === 0) {
331
+ if (n.version === 0) {
925
332
  console.error("Le MétaPlayer ne supporte pas le contrat meta-player-ui");
926
333
  return;
927
334
  }
928
- (s = a.i) == null || s.previewTextFile(t, r);
335
+ (s = n.i) == null || s.previewTextFile(t, e);
929
336
  });
930
- }, Kt = () => (t, r) => {
931
- k.use(["meta-player-ui"], ([a]) => {
337
+ }, tt = () => (t, e) => {
338
+ p.use(["meta-player-ui"], ([n]) => {
932
339
  var s;
933
- if (a.version === 0) {
340
+ if (n.version === 0) {
934
341
  console.error("Le MétaPlayer ne supporte pas le contrat meta-player-ui");
935
342
  return;
936
343
  }
937
- (s = a.i) == null || s.previewImageFile(t, r);
344
+ (s = n.i) == null || s.previewImageFile(t, e);
938
345
  });
939
346
  };
940
- let G = 0, ae = 0;
941
- const zt = (t, r) => {
942
- const a = se(t, r), s = u((l) => l.setSidebarActions);
943
- A(() => (G++, G > 1 && console.error("Capytale iframe React: Multiple sidebar actions registered: ", G), () => {
944
- G--;
945
- }), []), A(() => (k.use(["meta-player-ui"], ([l]) => {
946
- var m;
947
- if (l.version === 0) {
347
+ let C = 0, b = 0;
348
+ const et = (t, e) => {
349
+ const n = w(t, e), s = o((i) => i.setSidebarActions);
350
+ S(() => (C++, C > 1 && console.error("Capytale iframe React: Multiple sidebar actions registered: ", C), () => {
351
+ C--;
352
+ }), []), S(() => (p.use(["meta-player-ui"], ([i]) => {
353
+ var l;
354
+ if (i.version === 0) {
948
355
  console.error("Le MétaPlayer ne supporte pas le contrat meta-player-ui");
949
356
  return;
950
357
  }
951
- ae++;
952
- const h = a.map((c, g) => ({
953
- type: c.type,
954
- title: c.title,
955
- icon: c.icon,
956
- id: `sa-${ae}-${g}`,
957
- ...c.type === "file-upload" ? { accept: c.accept } : {}
958
- })), y = {};
959
- a.forEach((c, g) => {
960
- y[`sa-${ae}-${g}`] = c.action;
961
- }), (m = l.i) == null || m.setSidebarActionButtons(h), s(y);
358
+ b++;
359
+ const u = n.map((r, c) => ({
360
+ type: r.type,
361
+ title: r.title,
362
+ icon: r.icon,
363
+ id: `sa-${b}-${c}`,
364
+ ...r.type === "file-upload" ? { accept: r.accept } : {}
365
+ })), a = {};
366
+ n.forEach((r, c) => {
367
+ a[`sa-${b}-${c}`] = r.action;
368
+ }), (l = i.i) == null || l.setSidebarActionButtons(u), s(a);
962
369
  }), () => {
963
- s({}), k.use(["meta-player-ui"], ([l]) => {
964
- var h;
965
- if (l.version === 0) {
370
+ s({}), p.use(["meta-player-ui"], ([i]) => {
371
+ var u;
372
+ if (i.version === 0) {
966
373
  console.error("Le MétaPlayer ne supporte pas le contrat meta-player-ui");
967
374
  return;
968
375
  }
969
- (h = l.i) == null || h.setSidebarActionButtons([]);
376
+ (u = i.i) == null || u.setSidebarActionButtons([]);
970
377
  });
971
- }), [a]);
378
+ }), [n]);
972
379
  };
973
- let H = 0, ie = 0;
974
- const Xt = (t, r) => {
975
- const a = se(t, r), s = u((l) => l.setQuickActions);
976
- A(() => (H++, H > 1 && console.error("Capytale iframe React: Multiple quick actions registered: ", H), () => {
977
- H--;
978
- }), []), A(() => (k.use(["meta-player-ui"], ([l]) => {
979
- var m;
980
- if (l.version === 0) {
380
+ let m = 0, A = 0;
381
+ const nt = (t, e) => {
382
+ const n = w(t, e), s = o((i) => i.setQuickActions);
383
+ S(() => (m++, m > 1 && console.error("Capytale iframe React: Multiple quick actions registered: ", m), () => {
384
+ m--;
385
+ }), []), S(() => (p.use(["meta-player-ui"], ([i]) => {
386
+ var l;
387
+ if (i.version === 0) {
981
388
  console.error("Le MétaPlayer ne supporte pas le contrat meta-player-ui");
982
389
  return;
983
390
  }
984
- ie++;
985
- const h = a.map((c, g) => ({
986
- type: c.type,
987
- title: c.title,
988
- icon: c.icon,
989
- id: `qa-${ie}-${g}`,
990
- ...c.type === "file-upload" ? { accept: c.accept } : {}
991
- })), y = {};
992
- a.forEach((c, g) => {
993
- y[`qa-${ie}-${g}`] = c.action;
994
- }), (m = l.i) == null || m.setQuickActionButtons(h), s(y);
391
+ A++;
392
+ const u = n.map((r, c) => ({
393
+ type: r.type,
394
+ title: r.title,
395
+ icon: r.icon,
396
+ id: `qa-${A}-${c}`,
397
+ ...r.type === "file-upload" ? { accept: r.accept } : {}
398
+ })), a = {};
399
+ n.forEach((r, c) => {
400
+ a[`qa-${A}-${c}`] = r.action;
401
+ }), (l = i.i) == null || l.setQuickActionButtons(u), s(a);
995
402
  }), () => {
996
- s({}), k.use(["meta-player-ui"], ([l]) => {
997
- var h;
998
- if (l.version === 0) {
403
+ s({}), p.use(["meta-player-ui"], ([i]) => {
404
+ var u;
405
+ if (i.version === 0) {
999
406
  console.error("Le MétaPlayer ne supporte pas le contrat meta-player-ui");
1000
407
  return;
1001
408
  }
1002
- (h = l.i) == null || h.setQuickActionButtons([]);
409
+ (u = i.i) == null || u.setQuickActionButtons([]);
1003
410
  });
1004
- }), [a]);
411
+ }), [n]);
1005
412
  };
1006
- let Q = 0;
1007
- const Zt = (t, r) => {
1008
- const a = se(t, r), s = u((y) => y.setActivitySettings), l = u((y) => y.activitySettings), h = Rt("");
1009
- return A(() => (console.log("Mounting useSettings"), Q++, Q > 1 && console.error("Capytale iframe React: Multiple settings registered: ", Q), () => {
1010
- Q--;
1011
- }), []), A(() => {
1012
- const y = JSON.stringify(a);
1013
- if (y !== h.current)
1014
- return h.current = y, k.use(["meta-player-ui"], ([m]) => {
1015
- var c;
1016
- if (m.version === 0) {
413
+ let v = 0;
414
+ const ot = (t, e) => {
415
+ const n = w(t, e), s = o((a) => a.setActivitySettings), i = o((a) => a.activitySettings), u = E("");
416
+ return S(() => (console.log("Mounting useSettings"), v++, v > 1 && console.error("Capytale iframe React: Multiple settings registered: ", v), () => {
417
+ v--;
418
+ }), []), S(() => {
419
+ const a = JSON.stringify(n);
420
+ if (a !== u.current)
421
+ return u.current = a, p.use(["meta-player-ui"], ([l]) => {
422
+ var r;
423
+ if (l.version === 0) {
1017
424
  console.error("Le MétaPlayer ne supporte pas le contrat meta-player-ui");
1018
425
  return;
1019
426
  }
1020
- console.log("Updating settings UI in MetaPlayer", a), (c = m.i) == null || c.setSettingsUI(a);
427
+ console.log("Updating settings UI in MetaPlayer", n), (r = l.i) == null || r.setSettingsUI(n);
1021
428
  }), () => {
1022
429
  s(null);
1023
430
  };
1024
- }, [a]), l;
1025
- }, en = () => (r) => {
1026
- k.use(["meta-player-ui"], ([a]) => {
431
+ }, [n]), i;
432
+ }, st = () => (e) => {
433
+ p.use(["meta-player-ui"], ([n]) => {
1027
434
  var s;
1028
- if (a.version === 0) {
435
+ if (n.version === 0) {
1029
436
  console.error("Le MétaPlayer ne supporte pas le contrat meta-player-ui");
1030
437
  return;
1031
438
  }
1032
- (s = a.i) == null || s.showToast(r);
439
+ (s = n.i) == null || s.showToast(e);
1033
440
  });
1034
441
  };
1035
442
  export {
1036
- Wt as Capytale,
1037
- Ht as useAfterSaveAction,
1038
- Gt as useJsonContentSaveFunction,
1039
- Vt as useLoadedJsonContent,
1040
- Nt as useLoadedTextContent,
1041
- qt as useMode,
1042
- Ut as useNotifyIsDirty,
1043
- Kt as usePreviewImageFile,
1044
- Qt as usePreviewTextFile,
1045
- Xt as useQuickActions,
1046
- Yt as useRequestSave,
1047
- Zt as useSettings,
1048
- en as useShowToast,
1049
- zt as useSidebarActions,
1050
- Bt as useTextContentSaveFunction,
1051
- Lt as useTheme,
1052
- Jt as useWorkflow
443
+ G as Capytale,
444
+ Y as useAfterSaveAction,
445
+ X as useJsonContentSaveFunction,
446
+ z as useLoadedJsonContent,
447
+ _ as useLoadedTextContent,
448
+ H as useMode,
449
+ V as useNotifyIsDirty,
450
+ tt as usePreviewImageFile,
451
+ Z as usePreviewTextFile,
452
+ nt as useQuickActions,
453
+ B as useRequestSave,
454
+ ot as useSettings,
455
+ st as useShowToast,
456
+ et as useSidebarActions,
457
+ K as useTextContentSaveFunction,
458
+ U as useTheme,
459
+ O as useWorkflow
1053
460
  };