@weavix/sdk-react 0.0.11 → 0.0.12
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.mjs +77 -549
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { Component as e, createContext as t, useCallback as n, useContext as r, useEffect as i, useMemo as a, useRef as o, useState as s } from "react";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
7
|
-
}), T = class extends e {
|
|
2
|
+
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
3
|
+
import { METHOD_NOT_SUPPORTED as d, MISSING_REQUIRED_SCOPE as f, PLUGIN_ID_IS_NOT_CORRECT as p, PLUGIN_ID_OR_SLOT_NOT_PROVIDED as m, PluginActionError as h, UNKNOWN_ERROR as g, VALIDATION_ERROR as _, dispatchHostEvent as v, dispatchHostEvent as y, getField as b, getLocalizedString as x, getLocalizedString as S, hostApi as C, hostApi as w, on as T, on as E, setHandler as D, uiApi as O, uiApi as k } from "@weavix/sdk-core";
|
|
4
|
+
//#region src/components/ErrorBoundary.tsx
|
|
5
|
+
var A = class extends e {
|
|
8
6
|
static getDerivedStateFromError(e) {
|
|
9
7
|
return {
|
|
10
8
|
hasError: !0,
|
|
@@ -23,526 +21,56 @@ var C = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
23
21
|
render() {
|
|
24
22
|
return this.state.hasError && this.state.error ? this.props.fallback(this.state.error) : this.props.children;
|
|
25
23
|
}
|
|
26
|
-
},
|
|
27
|
-
var t = w("react"), n = Symbol.for("react.element"), r = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, a = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, o = {
|
|
28
|
-
key: !0,
|
|
29
|
-
ref: !0,
|
|
30
|
-
__self: !0,
|
|
31
|
-
__source: !0
|
|
32
|
-
};
|
|
33
|
-
function s(e, t, r) {
|
|
34
|
-
var s, c = {}, l = null, u = null;
|
|
35
|
-
for (s in r !== void 0 && (l = "" + r), t.key !== void 0 && (l = "" + t.key), t.ref !== void 0 && (u = t.ref), t) i.call(t, s) && !o.hasOwnProperty(s) && (c[s] = t[s]);
|
|
36
|
-
if (e && e.defaultProps) for (s in t = e.defaultProps, t) c[s] === void 0 && (c[s] = t[s]);
|
|
37
|
-
return {
|
|
38
|
-
$$typeof: n,
|
|
39
|
-
type: e,
|
|
40
|
-
key: l,
|
|
41
|
-
ref: u,
|
|
42
|
-
props: c,
|
|
43
|
-
_owner: a.current
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
e.Fragment = r, e.jsx = s, e.jsxs = s;
|
|
47
|
-
})), D = /* @__PURE__ */ C(((e) => {
|
|
48
|
-
process.env.NODE_ENV !== "production" && (function() {
|
|
49
|
-
var t = w("react"), n = Symbol.for("react.element"), r = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), s = Symbol.for("react.provider"), c = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), u = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), f = Symbol.for("react.memo"), p = Symbol.for("react.lazy"), m = Symbol.for("react.offscreen"), h = Symbol.iterator, g = "@@iterator";
|
|
50
|
-
function _(e) {
|
|
51
|
-
if (typeof e != "object" || !e) return null;
|
|
52
|
-
var t = h && e[h] || e[g];
|
|
53
|
-
return typeof t == "function" ? t : null;
|
|
54
|
-
}
|
|
55
|
-
var v = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
56
|
-
function y(e) {
|
|
57
|
-
ee("error", e, [...arguments].slice(1));
|
|
58
|
-
}
|
|
59
|
-
function ee(e, t, n) {
|
|
60
|
-
var r = v.ReactDebugCurrentFrame.getStackAddendum();
|
|
61
|
-
r !== "" && (t += "%s", n = n.concat([r]));
|
|
62
|
-
var i = n.map(function(e) {
|
|
63
|
-
return String(e);
|
|
64
|
-
});
|
|
65
|
-
i.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, i);
|
|
66
|
-
}
|
|
67
|
-
var b = !1, te = !1, x = !1, ne = !1, re = !1, S = Symbol.for("react.module.reference");
|
|
68
|
-
function C(e) {
|
|
69
|
-
return !!(typeof e == "string" || typeof e == "function" || e === i || e === o || re || e === a || e === u || e === d || ne || e === m || b || te || x || typeof e == "object" && e && (e.$$typeof === p || e.$$typeof === f || e.$$typeof === s || e.$$typeof === c || e.$$typeof === l || e.$$typeof === S || e.getModuleId !== void 0));
|
|
70
|
-
}
|
|
71
|
-
function T(e, t, n) {
|
|
72
|
-
var r = e.displayName;
|
|
73
|
-
if (r) return r;
|
|
74
|
-
var i = t.displayName || t.name || "";
|
|
75
|
-
return i === "" ? n : n + "(" + i + ")";
|
|
76
|
-
}
|
|
77
|
-
function E(e) {
|
|
78
|
-
return e.displayName || "Context";
|
|
79
|
-
}
|
|
80
|
-
function D(e) {
|
|
81
|
-
if (e == null) return null;
|
|
82
|
-
if (typeof e.tag == "number" && y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function") return e.displayName || e.name || null;
|
|
83
|
-
if (typeof e == "string") return e;
|
|
84
|
-
switch (e) {
|
|
85
|
-
case i: return "Fragment";
|
|
86
|
-
case r: return "Portal";
|
|
87
|
-
case o: return "Profiler";
|
|
88
|
-
case a: return "StrictMode";
|
|
89
|
-
case u: return "Suspense";
|
|
90
|
-
case d: return "SuspenseList";
|
|
91
|
-
}
|
|
92
|
-
if (typeof e == "object") switch (e.$$typeof) {
|
|
93
|
-
case c: return E(e) + ".Consumer";
|
|
94
|
-
case s: return E(e._context) + ".Provider";
|
|
95
|
-
case l: return T(e, e.render, "ForwardRef");
|
|
96
|
-
case f:
|
|
97
|
-
var t = e.displayName || null;
|
|
98
|
-
return t === null ? D(e.type) || "Memo" : t;
|
|
99
|
-
case p:
|
|
100
|
-
var n = e, m = n._payload, h = n._init;
|
|
101
|
-
try {
|
|
102
|
-
return D(h(m));
|
|
103
|
-
} catch {
|
|
104
|
-
return null;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
return null;
|
|
108
|
-
}
|
|
109
|
-
var O = Object.assign, k = 0, A, j, M, N, P, F, I;
|
|
110
|
-
function L() {}
|
|
111
|
-
L.__reactDisabledLog = !0;
|
|
112
|
-
function R() {
|
|
113
|
-
if (k === 0) {
|
|
114
|
-
A = console.log, j = console.info, M = console.warn, N = console.error, P = console.group, F = console.groupCollapsed, I = console.groupEnd;
|
|
115
|
-
var e = {
|
|
116
|
-
configurable: !0,
|
|
117
|
-
enumerable: !0,
|
|
118
|
-
value: L,
|
|
119
|
-
writable: !0
|
|
120
|
-
};
|
|
121
|
-
Object.defineProperties(console, {
|
|
122
|
-
info: e,
|
|
123
|
-
log: e,
|
|
124
|
-
warn: e,
|
|
125
|
-
error: e,
|
|
126
|
-
group: e,
|
|
127
|
-
groupCollapsed: e,
|
|
128
|
-
groupEnd: e
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
k++;
|
|
132
|
-
}
|
|
133
|
-
function ie() {
|
|
134
|
-
if (k--, k === 0) {
|
|
135
|
-
var e = {
|
|
136
|
-
configurable: !0,
|
|
137
|
-
enumerable: !0,
|
|
138
|
-
writable: !0
|
|
139
|
-
};
|
|
140
|
-
Object.defineProperties(console, {
|
|
141
|
-
log: O({}, e, { value: A }),
|
|
142
|
-
info: O({}, e, { value: j }),
|
|
143
|
-
warn: O({}, e, { value: M }),
|
|
144
|
-
error: O({}, e, { value: N }),
|
|
145
|
-
group: O({}, e, { value: P }),
|
|
146
|
-
groupCollapsed: O({}, e, { value: F }),
|
|
147
|
-
groupEnd: O({}, e, { value: I })
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
k < 0 && y("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
151
|
-
}
|
|
152
|
-
var z = v.ReactCurrentDispatcher, B;
|
|
153
|
-
function V(e, t, n) {
|
|
154
|
-
if (B === void 0) try {
|
|
155
|
-
throw Error();
|
|
156
|
-
} catch (e) {
|
|
157
|
-
var r = e.stack.trim().match(/\n( *(at )?)/);
|
|
158
|
-
B = r && r[1] || "";
|
|
159
|
-
}
|
|
160
|
-
return "\n" + B + e;
|
|
161
|
-
}
|
|
162
|
-
var H = !1, U = new (typeof WeakMap == "function" ? WeakMap : Map)();
|
|
163
|
-
function ae(e, t) {
|
|
164
|
-
if (!e || H) return "";
|
|
165
|
-
var n = U.get(e);
|
|
166
|
-
if (n !== void 0) return n;
|
|
167
|
-
var r;
|
|
168
|
-
H = !0;
|
|
169
|
-
var i = Error.prepareStackTrace;
|
|
170
|
-
Error.prepareStackTrace = void 0;
|
|
171
|
-
var a = z.current;
|
|
172
|
-
z.current = null, R();
|
|
173
|
-
try {
|
|
174
|
-
if (t) {
|
|
175
|
-
var o = function() {
|
|
176
|
-
throw Error();
|
|
177
|
-
};
|
|
178
|
-
if (Object.defineProperty(o.prototype, "props", { set: function() {
|
|
179
|
-
throw Error();
|
|
180
|
-
} }), typeof Reflect == "object" && Reflect.construct) {
|
|
181
|
-
try {
|
|
182
|
-
Reflect.construct(o, []);
|
|
183
|
-
} catch (e) {
|
|
184
|
-
r = e;
|
|
185
|
-
}
|
|
186
|
-
Reflect.construct(e, [], o);
|
|
187
|
-
} else {
|
|
188
|
-
try {
|
|
189
|
-
o.call();
|
|
190
|
-
} catch (e) {
|
|
191
|
-
r = e;
|
|
192
|
-
}
|
|
193
|
-
e.call(o.prototype);
|
|
194
|
-
}
|
|
195
|
-
} else {
|
|
196
|
-
try {
|
|
197
|
-
throw Error();
|
|
198
|
-
} catch (e) {
|
|
199
|
-
r = e;
|
|
200
|
-
}
|
|
201
|
-
e();
|
|
202
|
-
}
|
|
203
|
-
} catch (t) {
|
|
204
|
-
if (t && r && typeof t.stack == "string") {
|
|
205
|
-
for (var s = t.stack.split("\n"), c = r.stack.split("\n"), l = s.length - 1, u = c.length - 1; l >= 1 && u >= 0 && s[l] !== c[u];) u--;
|
|
206
|
-
for (; l >= 1 && u >= 0; l--, u--) if (s[l] !== c[u]) {
|
|
207
|
-
if (l !== 1 || u !== 1) do
|
|
208
|
-
if (l--, u--, u < 0 || s[l] !== c[u]) {
|
|
209
|
-
var d = "\n" + s[l].replace(" at new ", " at ");
|
|
210
|
-
return e.displayName && d.includes("<anonymous>") && (d = d.replace("<anonymous>", e.displayName)), typeof e == "function" && U.set(e, d), d;
|
|
211
|
-
}
|
|
212
|
-
while (l >= 1 && u >= 0);
|
|
213
|
-
break;
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
} finally {
|
|
217
|
-
H = !1, z.current = a, ie(), Error.prepareStackTrace = i;
|
|
218
|
-
}
|
|
219
|
-
var f = e ? e.displayName || e.name : "", p = f ? V(f) : "";
|
|
220
|
-
return typeof e == "function" && U.set(e, p), p;
|
|
221
|
-
}
|
|
222
|
-
function oe(e, t, n) {
|
|
223
|
-
return ae(e, !1);
|
|
224
|
-
}
|
|
225
|
-
function se(e) {
|
|
226
|
-
var t = e.prototype;
|
|
227
|
-
return !!(t && t.isReactComponent);
|
|
228
|
-
}
|
|
229
|
-
function W(e, t, n) {
|
|
230
|
-
if (e == null) return "";
|
|
231
|
-
if (typeof e == "function") return ae(e, se(e));
|
|
232
|
-
if (typeof e == "string") return V(e);
|
|
233
|
-
switch (e) {
|
|
234
|
-
case u: return V("Suspense");
|
|
235
|
-
case d: return V("SuspenseList");
|
|
236
|
-
}
|
|
237
|
-
if (typeof e == "object") switch (e.$$typeof) {
|
|
238
|
-
case l: return oe(e.render);
|
|
239
|
-
case f: return W(e.type, t, n);
|
|
240
|
-
case p:
|
|
241
|
-
var r = e, i = r._payload, a = r._init;
|
|
242
|
-
try {
|
|
243
|
-
return W(a(i), t, n);
|
|
244
|
-
} catch {}
|
|
245
|
-
}
|
|
246
|
-
return "";
|
|
247
|
-
}
|
|
248
|
-
var G = Object.prototype.hasOwnProperty, K = {}, ce = v.ReactDebugCurrentFrame;
|
|
249
|
-
function q(e) {
|
|
250
|
-
if (e) {
|
|
251
|
-
var t = e._owner, n = W(e.type, e._source, t ? t.type : null);
|
|
252
|
-
ce.setExtraStackFrame(n);
|
|
253
|
-
} else ce.setExtraStackFrame(null);
|
|
254
|
-
}
|
|
255
|
-
function le(e, t, n, r, i) {
|
|
256
|
-
var a = Function.call.bind(G);
|
|
257
|
-
for (var o in e) if (a(e, o)) {
|
|
258
|
-
var s = void 0;
|
|
259
|
-
try {
|
|
260
|
-
if (typeof e[o] != "function") {
|
|
261
|
-
var c = Error((r || "React class") + ": " + n + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
262
|
-
throw c.name = "Invariant Violation", c;
|
|
263
|
-
}
|
|
264
|
-
s = e[o](t, o, r, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
265
|
-
} catch (e) {
|
|
266
|
-
s = e;
|
|
267
|
-
}
|
|
268
|
-
s && !(s instanceof Error) && (q(i), y("%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).", r || "React class", n, o, typeof s), q(null)), s instanceof Error && !(s.message in K) && (K[s.message] = !0, q(i), y("Failed %s type: %s", n, s.message), q(null));
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
var ue = Array.isArray;
|
|
272
|
-
function J(e) {
|
|
273
|
-
return ue(e);
|
|
274
|
-
}
|
|
275
|
-
function de(e) {
|
|
276
|
-
return typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
277
|
-
}
|
|
278
|
-
function fe(e) {
|
|
279
|
-
try {
|
|
280
|
-
return pe(e), !1;
|
|
281
|
-
} catch {
|
|
282
|
-
return !0;
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
function pe(e) {
|
|
286
|
-
return "" + e;
|
|
287
|
-
}
|
|
288
|
-
function me(e) {
|
|
289
|
-
if (fe(e)) return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", de(e)), pe(e);
|
|
290
|
-
}
|
|
291
|
-
var Y = v.ReactCurrentOwner, he = {
|
|
292
|
-
key: !0,
|
|
293
|
-
ref: !0,
|
|
294
|
-
__self: !0,
|
|
295
|
-
__source: !0
|
|
296
|
-
}, ge, _e, ve = {};
|
|
297
|
-
function ye(e) {
|
|
298
|
-
if (G.call(e, "ref")) {
|
|
299
|
-
var t = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
300
|
-
if (t && t.isReactWarning) return !1;
|
|
301
|
-
}
|
|
302
|
-
return e.ref !== void 0;
|
|
303
|
-
}
|
|
304
|
-
function be(e) {
|
|
305
|
-
if (G.call(e, "key")) {
|
|
306
|
-
var t = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
307
|
-
if (t && t.isReactWarning) return !1;
|
|
308
|
-
}
|
|
309
|
-
return e.key !== void 0;
|
|
310
|
-
}
|
|
311
|
-
function xe(e, t) {
|
|
312
|
-
if (typeof e.ref == "string" && Y.current && t && Y.current.stateNode !== t) {
|
|
313
|
-
var n = D(Y.current.type);
|
|
314
|
-
ve[n] || (y("Component \"%s\" contains the string ref \"%s\". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref", D(Y.current.type), e.ref), ve[n] = !0);
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
function Se(e, t) {
|
|
318
|
-
var n = function() {
|
|
319
|
-
ge || (ge = !0, y("%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)", t));
|
|
320
|
-
};
|
|
321
|
-
n.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
322
|
-
get: n,
|
|
323
|
-
configurable: !0
|
|
324
|
-
});
|
|
325
|
-
}
|
|
326
|
-
function Ce(e, t) {
|
|
327
|
-
var n = function() {
|
|
328
|
-
_e || (_e = !0, y("%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)", t));
|
|
329
|
-
};
|
|
330
|
-
n.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
331
|
-
get: n,
|
|
332
|
-
configurable: !0
|
|
333
|
-
});
|
|
334
|
-
}
|
|
335
|
-
var we = function(e, t, r, i, a, o, s) {
|
|
336
|
-
var c = {
|
|
337
|
-
$$typeof: n,
|
|
338
|
-
type: e,
|
|
339
|
-
key: t,
|
|
340
|
-
ref: r,
|
|
341
|
-
props: s,
|
|
342
|
-
_owner: o
|
|
343
|
-
};
|
|
344
|
-
return c._store = {}, Object.defineProperty(c._store, "validated", {
|
|
345
|
-
configurable: !1,
|
|
346
|
-
enumerable: !1,
|
|
347
|
-
writable: !0,
|
|
348
|
-
value: !1
|
|
349
|
-
}), Object.defineProperty(c, "_self", {
|
|
350
|
-
configurable: !1,
|
|
351
|
-
enumerable: !1,
|
|
352
|
-
writable: !1,
|
|
353
|
-
value: i
|
|
354
|
-
}), Object.defineProperty(c, "_source", {
|
|
355
|
-
configurable: !1,
|
|
356
|
-
enumerable: !1,
|
|
357
|
-
writable: !1,
|
|
358
|
-
value: a
|
|
359
|
-
}), Object.freeze && (Object.freeze(c.props), Object.freeze(c)), c;
|
|
360
|
-
};
|
|
361
|
-
function Te(e, t, n, r, i) {
|
|
362
|
-
var a, o = {}, s = null, c = null;
|
|
363
|
-
for (a in n !== void 0 && (me(n), s = "" + n), be(t) && (me(t.key), s = "" + t.key), ye(t) && (c = t.ref, xe(t, i)), t) G.call(t, a) && !he.hasOwnProperty(a) && (o[a] = t[a]);
|
|
364
|
-
if (e && e.defaultProps) {
|
|
365
|
-
var l = e.defaultProps;
|
|
366
|
-
for (a in l) o[a] === void 0 && (o[a] = l[a]);
|
|
367
|
-
}
|
|
368
|
-
if (s || c) {
|
|
369
|
-
var u = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
370
|
-
s && Se(o, u), c && Ce(o, u);
|
|
371
|
-
}
|
|
372
|
-
return we(e, s, c, i, r, Y.current, o);
|
|
373
|
-
}
|
|
374
|
-
var X = v.ReactCurrentOwner, Ee = v.ReactDebugCurrentFrame;
|
|
375
|
-
function Z(e) {
|
|
376
|
-
if (e) {
|
|
377
|
-
var t = e._owner, n = W(e.type, e._source, t ? t.type : null);
|
|
378
|
-
Ee.setExtraStackFrame(n);
|
|
379
|
-
} else Ee.setExtraStackFrame(null);
|
|
380
|
-
}
|
|
381
|
-
var De = !1;
|
|
382
|
-
function Q(e) {
|
|
383
|
-
return typeof e == "object" && !!e && e.$$typeof === n;
|
|
384
|
-
}
|
|
385
|
-
function Oe() {
|
|
386
|
-
if (X.current) {
|
|
387
|
-
var e = D(X.current.type);
|
|
388
|
-
if (e) return "\n\nCheck the render method of `" + e + "`.";
|
|
389
|
-
}
|
|
390
|
-
return "";
|
|
391
|
-
}
|
|
392
|
-
function ke(e) {
|
|
393
|
-
if (e !== void 0) {
|
|
394
|
-
var t = e.fileName.replace(/^.*[\\\/]/, ""), n = e.lineNumber;
|
|
395
|
-
return "\n\nCheck your code at " + t + ":" + n + ".";
|
|
396
|
-
}
|
|
397
|
-
return "";
|
|
398
|
-
}
|
|
399
|
-
var $ = {};
|
|
400
|
-
function Ae(e) {
|
|
401
|
-
var t = Oe();
|
|
402
|
-
if (!t) {
|
|
403
|
-
var n = typeof e == "string" ? e : e.displayName || e.name;
|
|
404
|
-
n && (t = "\n\nCheck the top-level render call using <" + n + ">.");
|
|
405
|
-
}
|
|
406
|
-
return t;
|
|
407
|
-
}
|
|
408
|
-
function je(e, t) {
|
|
409
|
-
if (!(!e._store || e._store.validated || e.key != null)) {
|
|
410
|
-
e._store.validated = !0;
|
|
411
|
-
var n = Ae(t);
|
|
412
|
-
if (!$[n]) {
|
|
413
|
-
$[n] = !0;
|
|
414
|
-
var r = "";
|
|
415
|
-
e && e._owner && e._owner !== X.current && (r = " It was passed a child from " + D(e._owner.type) + "."), Z(e), y("Each child in a list should have a unique \"key\" prop.%s%s See https://reactjs.org/link/warning-keys for more information.", n, r), Z(null);
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
function Me(e, t) {
|
|
420
|
-
if (typeof e == "object") {
|
|
421
|
-
if (J(e)) for (var n = 0; n < e.length; n++) {
|
|
422
|
-
var r = e[n];
|
|
423
|
-
Q(r) && je(r, t);
|
|
424
|
-
}
|
|
425
|
-
else if (Q(e)) e._store && (e._store.validated = !0);
|
|
426
|
-
else if (e) {
|
|
427
|
-
var i = _(e);
|
|
428
|
-
if (typeof i == "function" && i !== e.entries) for (var a = i.call(e), o; !(o = a.next()).done;) Q(o.value) && je(o.value, t);
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
function Ne(e) {
|
|
433
|
-
var t = e.type;
|
|
434
|
-
if (!(t == null || typeof t == "string")) {
|
|
435
|
-
var n;
|
|
436
|
-
if (typeof t == "function") n = t.propTypes;
|
|
437
|
-
else if (typeof t == "object" && (t.$$typeof === l || t.$$typeof === f)) n = t.propTypes;
|
|
438
|
-
else return;
|
|
439
|
-
if (n) {
|
|
440
|
-
var r = D(t);
|
|
441
|
-
le(n, e.props, "prop", r, e);
|
|
442
|
-
} else t.PropTypes !== void 0 && !De && (De = !0, y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", D(t) || "Unknown"));
|
|
443
|
-
typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved && y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
function Pe(e) {
|
|
447
|
-
for (var t = Object.keys(e.props), n = 0; n < t.length; n++) {
|
|
448
|
-
var r = t[n];
|
|
449
|
-
if (r !== "children" && r !== "key") {
|
|
450
|
-
Z(e), y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", r), Z(null);
|
|
451
|
-
break;
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
e.ref !== null && (Z(e), y("Invalid attribute `ref` supplied to `React.Fragment`."), Z(null));
|
|
455
|
-
}
|
|
456
|
-
var Fe = {};
|
|
457
|
-
function Ie(e, t, r, a, o, s) {
|
|
458
|
-
var c = C(e);
|
|
459
|
-
if (!c) {
|
|
460
|
-
var l = "";
|
|
461
|
-
(e === void 0 || typeof e == "object" && e && Object.keys(e).length === 0) && (l += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
462
|
-
var u = ke(o);
|
|
463
|
-
u ? l += u : l += Oe();
|
|
464
|
-
var d;
|
|
465
|
-
e === null ? d = "null" : J(e) ? d = "array" : e !== void 0 && e.$$typeof === n ? (d = "<" + (D(e.type) || "Unknown") + " />", l = " Did you accidentally export a JSX literal instead of a component?") : d = typeof e, y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", d, l);
|
|
466
|
-
}
|
|
467
|
-
var f = Te(e, t, r, o, s);
|
|
468
|
-
if (f == null) return f;
|
|
469
|
-
if (c) {
|
|
470
|
-
var p = t.children;
|
|
471
|
-
if (p !== void 0) if (a) if (J(p)) {
|
|
472
|
-
for (var m = 0; m < p.length; m++) Me(p[m], e);
|
|
473
|
-
Object.freeze && Object.freeze(p);
|
|
474
|
-
} else y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
475
|
-
else Me(p, e);
|
|
476
|
-
}
|
|
477
|
-
if (G.call(t, "key")) {
|
|
478
|
-
var h = D(e), g = Object.keys(t).filter(function(e) {
|
|
479
|
-
return e !== "key";
|
|
480
|
-
}), _ = g.length > 0 ? "{key: someKey, " + g.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
481
|
-
Fe[h + _] || (y("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", _, h, g.length > 0 ? "{" + g.join(": ..., ") + ": ...}" : "{}", h), Fe[h + _] = !0);
|
|
482
|
-
}
|
|
483
|
-
return e === i ? Pe(f) : Ne(f), f;
|
|
484
|
-
}
|
|
485
|
-
function Le(e, t, n) {
|
|
486
|
-
return Ie(e, t, n, !0);
|
|
487
|
-
}
|
|
488
|
-
function Re(e, t, n) {
|
|
489
|
-
return Ie(e, t, n, !1);
|
|
490
|
-
}
|
|
491
|
-
var ze = Re, Be = Le;
|
|
492
|
-
e.Fragment = i, e.jsx = ze, e.jsxs = Be;
|
|
493
|
-
})();
|
|
494
|
-
})), O = (/* @__PURE__ */ C(((e, t) => {
|
|
495
|
-
process.env.NODE_ENV === "production" ? t.exports = E() : t.exports = D();
|
|
496
|
-
})))(), k = ({ error: e }) => /* @__PURE__ */ (0, O.jsx)("div", {
|
|
24
|
+
}, j = ({ error: e }) => /* @__PURE__ */ l("div", {
|
|
497
25
|
className: "plugin-error",
|
|
498
|
-
children: /* @__PURE__ */ (
|
|
26
|
+
children: /* @__PURE__ */ u("div", {
|
|
499
27
|
className: "plugin-error__container",
|
|
500
28
|
children: [
|
|
501
|
-
/* @__PURE__ */ (
|
|
29
|
+
/* @__PURE__ */ u("div", {
|
|
502
30
|
className: "plugin-error__header",
|
|
503
|
-
children: [/* @__PURE__ */ (
|
|
31
|
+
children: [/* @__PURE__ */ u("svg", {
|
|
504
32
|
className: "plugin-error__icon",
|
|
505
33
|
width: "24",
|
|
506
34
|
height: "24",
|
|
507
35
|
viewBox: "0 0 24 24",
|
|
508
36
|
fill: "none",
|
|
509
|
-
children: [/* @__PURE__ */ (
|
|
37
|
+
children: [/* @__PURE__ */ l("circle", {
|
|
510
38
|
cx: "12",
|
|
511
39
|
cy: "12",
|
|
512
40
|
r: "10",
|
|
513
41
|
fill: "#f44336"
|
|
514
|
-
}), /* @__PURE__ */ (
|
|
42
|
+
}), /* @__PURE__ */ l("path", {
|
|
515
43
|
d: "M12 7v6m0 4h.01",
|
|
516
44
|
stroke: "white",
|
|
517
45
|
strokeWidth: "2",
|
|
518
46
|
strokeLinecap: "round"
|
|
519
47
|
})]
|
|
520
|
-
}), /* @__PURE__ */ (
|
|
48
|
+
}), /* @__PURE__ */ l("h3", {
|
|
521
49
|
className: "plugin-error__title",
|
|
522
50
|
children: "Ошибка инициализации плагина"
|
|
523
51
|
})]
|
|
524
52
|
}),
|
|
525
|
-
/* @__PURE__ */ (
|
|
53
|
+
/* @__PURE__ */ l("div", {
|
|
526
54
|
className: "plugin-error__message",
|
|
527
55
|
children: "Не удалось инициализировать плагин. Проверьте параметры запуска и попробуйте перезагрузить страницу."
|
|
528
56
|
}),
|
|
529
|
-
/* @__PURE__ */ (
|
|
57
|
+
/* @__PURE__ */ u("details", {
|
|
530
58
|
className: "plugin-error__details",
|
|
531
|
-
children: [/* @__PURE__ */ (
|
|
59
|
+
children: [/* @__PURE__ */ l("summary", {
|
|
532
60
|
className: "plugin-error__summary",
|
|
533
61
|
children: "Детали ошибки"
|
|
534
|
-
}), /* @__PURE__ */ (
|
|
62
|
+
}), /* @__PURE__ */ u("pre", {
|
|
535
63
|
className: "plugin-error__stack",
|
|
536
64
|
children: [e.message, e.stack && `\n\n${e.stack}`]
|
|
537
65
|
})]
|
|
538
66
|
})
|
|
539
67
|
]
|
|
540
68
|
})
|
|
541
|
-
}),
|
|
69
|
+
}), M = () => /* @__PURE__ */ l("div", {
|
|
542
70
|
className: "plugin-loader",
|
|
543
|
-
children: /* @__PURE__ */ (
|
|
71
|
+
children: /* @__PURE__ */ u("div", {
|
|
544
72
|
className: "plugin-loader__content",
|
|
545
|
-
children: [/* @__PURE__ */ (
|
|
73
|
+
children: [/* @__PURE__ */ l("div", { className: "plugin-loader__spinner" }), /* @__PURE__ */ l("div", {
|
|
546
74
|
className: "plugin-loader__text",
|
|
547
75
|
children: "Загрузка плагина..."
|
|
548
76
|
})]
|
|
@@ -550,73 +78,73 @@ var C = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
550
78
|
});
|
|
551
79
|
//#endregion
|
|
552
80
|
//#region src/hooks/useContext.ts
|
|
553
|
-
function
|
|
81
|
+
function N() {
|
|
554
82
|
let [e, t] = s(() => {
|
|
555
83
|
let e;
|
|
556
|
-
return
|
|
84
|
+
return E("context.changed", (t) => {
|
|
557
85
|
e = t;
|
|
558
86
|
})(), e;
|
|
559
87
|
});
|
|
560
|
-
return i(() =>
|
|
88
|
+
return i(() => E("context.changed", (e) => {
|
|
561
89
|
t(e);
|
|
562
90
|
}), []), e;
|
|
563
91
|
}
|
|
564
92
|
//#endregion
|
|
565
93
|
//#region src/hooks/useIsYateam.ts
|
|
566
|
-
function
|
|
94
|
+
function P() {
|
|
567
95
|
let [e, t] = s(void 0);
|
|
568
96
|
return i(() => {
|
|
569
97
|
(async () => {
|
|
570
|
-
t(await
|
|
98
|
+
t(await w.getIsYateam());
|
|
571
99
|
})();
|
|
572
100
|
}, []), e;
|
|
573
101
|
}
|
|
574
102
|
//#endregion
|
|
575
103
|
//#region src/hooks/useLanguage.ts
|
|
576
|
-
function
|
|
104
|
+
function F() {
|
|
577
105
|
let [e, t] = s(() => {
|
|
578
106
|
let e;
|
|
579
|
-
return
|
|
107
|
+
return E("language.changed", (t) => {
|
|
580
108
|
e = t;
|
|
581
109
|
})(), e;
|
|
582
110
|
});
|
|
583
|
-
return i(() =>
|
|
111
|
+
return i(() => E("language.changed", (e) => {
|
|
584
112
|
t(e);
|
|
585
113
|
}), []), e;
|
|
586
114
|
}
|
|
587
115
|
//#endregion
|
|
588
116
|
//#region src/hooks/useTheme.ts
|
|
589
|
-
function
|
|
117
|
+
function I() {
|
|
590
118
|
let [e, t] = s(() => {
|
|
591
119
|
let e;
|
|
592
|
-
return
|
|
120
|
+
return E("theme.changed", (t) => {
|
|
593
121
|
e = t;
|
|
594
122
|
})(), e;
|
|
595
123
|
});
|
|
596
|
-
return i(() =>
|
|
124
|
+
return i(() => E("theme.changed", (e) => {
|
|
597
125
|
t(e);
|
|
598
126
|
}), []), e;
|
|
599
127
|
}
|
|
600
128
|
//#endregion
|
|
601
129
|
//#region src/hooks/useUserId.ts
|
|
602
|
-
function
|
|
130
|
+
function L() {
|
|
603
131
|
let [e, t] = s(void 0);
|
|
604
132
|
return i(() => {
|
|
605
133
|
(async () => {
|
|
606
|
-
t(await
|
|
134
|
+
t(await w.getUserId());
|
|
607
135
|
})();
|
|
608
136
|
}, []), e;
|
|
609
137
|
}
|
|
610
138
|
//#endregion
|
|
611
139
|
//#region src/components/PluginProvider.tsx
|
|
612
|
-
var
|
|
613
|
-
function
|
|
614
|
-
let t = r(
|
|
140
|
+
var R = t(null);
|
|
141
|
+
function z(e = "basic") {
|
|
142
|
+
let t = r(R);
|
|
615
143
|
if (!t) throw Error("usePluginContext must be used within PluginProvider");
|
|
616
144
|
if (e === "full" && t.contextLevel !== "full") throw Error("🛑 [Security] Code requests 'full' context, but manifest declares 'basic'. Change the contextLevel in your manifest to get full access.");
|
|
617
|
-
let n =
|
|
618
|
-
service:
|
|
619
|
-
origin:
|
|
145
|
+
let n = I(), i = F(), a = P(), o = L(), s = N(), c = {
|
|
146
|
+
service: w.getService(),
|
|
147
|
+
origin: w.getOrigin(),
|
|
620
148
|
slot: t.slot,
|
|
621
149
|
innerUrl: t.innerUrl,
|
|
622
150
|
queryParams: t.queryParams,
|
|
@@ -643,24 +171,24 @@ function L(e = "basic") {
|
|
|
643
171
|
slotContext: s
|
|
644
172
|
};
|
|
645
173
|
}
|
|
646
|
-
var
|
|
174
|
+
var B = (e) => {
|
|
647
175
|
try {
|
|
648
176
|
return new URL(e, window.location.href).origin === window.location.origin;
|
|
649
177
|
} catch {
|
|
650
178
|
return !0;
|
|
651
179
|
}
|
|
652
180
|
};
|
|
653
|
-
function
|
|
654
|
-
let
|
|
181
|
+
function V({ children: e, autoResize: t = !0, fallback: n, errorFallback: r, autoNotifyReady: u = !0 }) {
|
|
182
|
+
let d = o(!1), [f, p] = s(!1), [m, h] = s(null), [g, _] = s(null), v = a(() => (e, t) => D(e, t), []);
|
|
655
183
|
return i(() => {
|
|
656
184
|
let e = (e) => {
|
|
657
185
|
let t = e.target.closest("[href], [data-href]");
|
|
658
186
|
if (!t) return;
|
|
659
187
|
let n = t.getAttribute("href") || t.getAttribute("data-href");
|
|
660
|
-
if (!n ||
|
|
188
|
+
if (!n || B(n)) return;
|
|
661
189
|
e.preventDefault();
|
|
662
190
|
let r = t.getAttribute("target") === "_blank";
|
|
663
|
-
|
|
191
|
+
k.navigate({
|
|
664
192
|
path: n,
|
|
665
193
|
options: { newTab: r }
|
|
666
194
|
}).then(() => {
|
|
@@ -673,47 +201,47 @@ function ie({ children: e, autoResize: t = !0, fallback: n, errorFallback: r, au
|
|
|
673
201
|
document.removeEventListener("click", e);
|
|
674
202
|
};
|
|
675
203
|
}, []), i(() => {
|
|
676
|
-
|
|
204
|
+
d.current || (async () => {
|
|
677
205
|
try {
|
|
678
|
-
|
|
679
|
-
let e =
|
|
680
|
-
|
|
681
|
-
slot:
|
|
682
|
-
innerUrl:
|
|
683
|
-
queryParams:
|
|
206
|
+
w.init({ autoResize: t }), d.current = !0;
|
|
207
|
+
let e = w.getContextLevel(), n = w.getEntityId(), r = w.getEntityMeta();
|
|
208
|
+
_({
|
|
209
|
+
slot: w.getSlot(),
|
|
210
|
+
innerUrl: w.getInnerUrl(),
|
|
211
|
+
queryParams: w.getQueryParams(),
|
|
684
212
|
contextLevel: e,
|
|
685
213
|
entityId: n,
|
|
686
214
|
entityMeta: r,
|
|
687
|
-
registerHandler:
|
|
688
|
-
}),
|
|
689
|
-
let [i, a, o, s,
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
e === "full" ?
|
|
693
|
-
|
|
694
|
-
|
|
215
|
+
registerHandler: v
|
|
216
|
+
}), u && await w.notifyReady();
|
|
217
|
+
let [i, a, o, s, c] = await Promise.allSettled([
|
|
218
|
+
w.getTheme(),
|
|
219
|
+
w.getLanguage(),
|
|
220
|
+
e === "full" ? w.getContext() : Promise.resolve(null),
|
|
221
|
+
w.getIsYateam(),
|
|
222
|
+
w.getUserId()
|
|
695
223
|
]);
|
|
696
|
-
i.status === "fulfilled" && i.value &&
|
|
224
|
+
i.status === "fulfilled" && i.value && y({
|
|
697
225
|
messageId: "",
|
|
698
226
|
type: "event",
|
|
699
227
|
method: "theme.changed",
|
|
700
228
|
result: i.value
|
|
701
|
-
}), a.status === "fulfilled" && a.value &&
|
|
229
|
+
}), a.status === "fulfilled" && a.value && y({
|
|
702
230
|
messageId: "",
|
|
703
231
|
type: "event",
|
|
704
232
|
method: "language.changed",
|
|
705
233
|
result: a.value
|
|
706
|
-
}), s.status === "fulfilled" && s.value &&
|
|
234
|
+
}), s.status === "fulfilled" && s.value && y({
|
|
707
235
|
messageId: "",
|
|
708
236
|
type: "event",
|
|
709
237
|
method: "isYateam.changed",
|
|
710
238
|
result: s.value
|
|
711
|
-
}),
|
|
239
|
+
}), c.status === "fulfilled" && c.value && y({
|
|
712
240
|
messageId: "",
|
|
713
241
|
type: "event",
|
|
714
242
|
method: "userId.changed",
|
|
715
|
-
result:
|
|
716
|
-
}), e === "basic" ? n &&
|
|
243
|
+
result: c.value
|
|
244
|
+
}), e === "basic" ? n && y({
|
|
717
245
|
messageId: "",
|
|
718
246
|
type: "event",
|
|
719
247
|
method: "context.changed",
|
|
@@ -721,33 +249,33 @@ function ie({ children: e, autoResize: t = !0, fallback: n, errorFallback: r, au
|
|
|
721
249
|
entityId: n,
|
|
722
250
|
...r ? { entityMeta: r } : {}
|
|
723
251
|
}
|
|
724
|
-
}) : o.status === "fulfilled" && o.value &&
|
|
252
|
+
}) : o.status === "fulfilled" && o.value && y({
|
|
725
253
|
messageId: "",
|
|
726
254
|
type: "event",
|
|
727
255
|
method: "context.changed",
|
|
728
256
|
result: o.value
|
|
729
|
-
}),
|
|
257
|
+
}), p(!0);
|
|
730
258
|
} catch (e) {
|
|
731
|
-
|
|
259
|
+
h(e);
|
|
732
260
|
}
|
|
733
261
|
})();
|
|
734
262
|
}, [
|
|
735
263
|
t,
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
]),
|
|
739
|
-
fallback: r || ((e) => /* @__PURE__ */ (
|
|
740
|
-
children: /* @__PURE__ */ (
|
|
741
|
-
value:
|
|
264
|
+
v,
|
|
265
|
+
u
|
|
266
|
+
]), m ? r ? /* @__PURE__ */ l(c, { children: r(m) }) : /* @__PURE__ */ l(j, { error: m }) : !f || !g ? /* @__PURE__ */ l(c, { children: n }) : /* @__PURE__ */ l(A, {
|
|
267
|
+
fallback: r || ((e) => /* @__PURE__ */ l(j, { error: e })),
|
|
268
|
+
children: /* @__PURE__ */ l(R.Provider, {
|
|
269
|
+
value: g,
|
|
742
270
|
children: e
|
|
743
271
|
})
|
|
744
272
|
});
|
|
745
273
|
}
|
|
746
|
-
var
|
|
747
|
-
let t =
|
|
748
|
-
return (n) =>
|
|
749
|
-
},
|
|
274
|
+
var H = () => ({ show: n((e) => k.confirm.show(e), []) }), U = (e = "ru") => {
|
|
275
|
+
let t = F();
|
|
276
|
+
return (n) => S(n, t, e);
|
|
277
|
+
}, W = () => ({ add: n((e) => k.toaster.add(e), []) });
|
|
750
278
|
//#endregion
|
|
751
|
-
export {
|
|
279
|
+
export { A as ErrorBoundary, d as METHOD_NOT_SUPPORTED, f as MISSING_REQUIRED_SCOPE, p as PLUGIN_ID_IS_NOT_CORRECT, m as PLUGIN_ID_OR_SLOT_NOT_PROVIDED, h as PluginActionError, j as PluginError, M as PluginLoader, V as PluginProvider, g as UNKNOWN_ERROR, _ as VALIDATION_ERROR, v as dispatchHostEvent, b as getField, x as getLocalizedString, C as hostApi, B as isInternalUrl, T as on, O as uiApi, H as useConfirm, P as useIsYateam, F as useLanguage, U as useLocalizedString, z as usePluginContext, I as useTheme, W as useToaster, L as useUserId };
|
|
752
280
|
|
|
753
281
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["context","provider"],"sources":["../src/components/ErrorBoundary.tsx","../../../../../../../../../../../../home/sandbox/.pnpm/virtual-store-tracker-cli/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.production.min.js","../../../../../../../../../../../../home/sandbox/.pnpm/virtual-store-tracker-cli/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.development.js","../../../../../../../../../../../../home/sandbox/.pnpm/virtual-store-tracker-cli/react@18.3.1/node_modules/react/jsx-runtime.js","../src/components/PluginError.tsx","../src/components/PluginLoader.tsx","../src/hooks/useContext.ts","../src/hooks/useIsYateam.ts","../src/hooks/useLanguage.ts","../src/hooks/useTheme.ts","../src/hooks/useUserId.ts","../src/components/PluginProvider.tsx","../src/hooks/useConfirm.ts","../src/hooks/useLocalizedString.ts","../src/hooks/useToaster.ts"],"sourcesContent":["import { Component, ReactNode } from 'react';\n\ninterface ErrorBoundaryProps {\n children: ReactNode;\n fallback: (error: Error) => ReactNode;\n}\n\ninterface ErrorBoundaryState {\n hasError: boolean;\n error: Error | null;\n}\n\nexport class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {\n static getDerivedStateFromError(error: Error): ErrorBoundaryState {\n return { hasError: true, error };\n }\n\n constructor(props: ErrorBoundaryProps) {\n super(props);\n this.state = { hasError: false, error: null };\n }\n\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\n console.error('ErrorBoundary caught an error:', error, errorInfo);\n }\n\n render() {\n if (this.state.hasError && this.state.error) {\n return this.props.fallback(this.state.error);\n }\n\n return this.props.children;\n }\n}\n","/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar assign = Object.assign;\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"<anonymous>\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('<anonymous>')) {\n _frame = _frame.replace('<anonymous>', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%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).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingKey = function () {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%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)', displayName);\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingRef = function () {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%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)', displayName);\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n // issue if key is also explicitly declared (ie. <div {...props} key=\"Hi\" />\n // or <div key=\"Hi\" {...props} /> ). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n // <div {...props} key=\"Hi\" />, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n {\n checkKeyStringCoercion(maybeKey);\n }\n\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nvar didWarnAboutKeySpread = {};\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n {\n if (hasOwnProperty.call(props, 'key')) {\n var componentName = getComponentNameFromType(type);\n var keys = Object.keys(props).filter(function (k) {\n return k !== 'key';\n });\n var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';\n\n if (!didWarnAboutKeySpread[componentName + beforeExample]) {\n var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';\n\n error('A props object containing a \"key\" prop is being spread into JSX:\\n' + ' let props = %s;\\n' + ' <%s {...props} />\\n' + 'React keys must be passed directly to JSX without using spread:\\n' + ' let props = %s;\\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);\n\n didWarnAboutKeySpread[componentName + beforeExample] = true;\n }\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, false);\n }\n}\n\nvar jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs = jsxWithValidationStatic ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","import type { FC } from 'react';\nimport './PluginError.scss';\n\nexport interface PluginErrorProps {\n error: Error;\n}\n\nconst PluginErrorImpl = ({ error }: PluginErrorProps) => (\n <div className=\"plugin-error\">\n <div className=\"plugin-error__container\">\n <div className=\"plugin-error__header\">\n <svg\n className=\"plugin-error__icon\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" fill=\"#f44336\" />\n <path\n d=\"M12 7v6m0 4h.01\"\n stroke=\"white\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n />\n </svg>\n <h3 className=\"plugin-error__title\">Ошибка инициализации плагина</h3>\n </div>\n <div className=\"plugin-error__message\">\n Не удалось инициализировать плагин. Проверьте параметры запуска и попробуйте\n перезагрузить страницу.\n </div>\n <details className=\"plugin-error__details\">\n <summary className=\"plugin-error__summary\">Детали ошибки</summary>\n <pre className=\"plugin-error__stack\">\n {error.message}\n {error.stack && `\\n\\n${error.stack}`}\n </pre>\n </details>\n </div>\n </div>\n);\n\n/**\n * Дефолтный компонент для отображения ошибки инициализации плагина\n */\nexport const PluginError = PluginErrorImpl as FC<PluginErrorProps>;\n","import type { FC } from 'react';\nimport './PluginLoader.scss';\n\nconst PluginLoaderImpl = () => (\n <div className=\"plugin-loader\">\n <div className=\"plugin-loader__content\">\n <div className=\"plugin-loader__spinner\" />\n <div className=\"plugin-loader__text\">Загрузка плагина...</div>\n </div>\n </div>\n);\n\n/**\n * Простой лоадер для отображения во время инициализации плагина\n */\nexport const PluginLoader = PluginLoaderImpl as FC;\n","import { on } from '@weavix/sdk-core';\nimport { useEffect, useState } from 'react';\n\n/**\n * Reactive hook for receiving the current slot context pushed by the host.\n * @template T - Type of the context object (defaults to `unknown`)\n * @returns Current context, or `undefined` until the first event arrives from the host.\n * @example\n * ```tsx\n * interface IssueContext {\n * key: string;\n * summary: string;\n * }\n *\n * function App() {\n * const context = useContext<IssueContext>();\n * if (!context) return <Loader />;\n * return <div>{context.summary}</div>;\n * }\n * ```\n */\nexport function useContext<T = unknown>(): T | undefined {\n const [context, setContext] = useState<T | undefined>(() => {\n let initial: T | undefined;\n const unsubscribe = on('context.changed', (value) => {\n initial = value as T;\n });\n unsubscribe();\n return initial;\n });\n\n useEffect(() => {\n const unsubscribe = on('context.changed', (value) => {\n setContext(value as T);\n });\n\n return unsubscribe;\n }, []);\n\n return context;\n}\n","import { hostApi } from '@weavix/sdk-core';\nimport { useEffect, useState } from 'react';\n\n/**\n * Реактивный хук для получения текущей сборки приложения.\n * @returns Является ли ятимом приложение (например, 'true'), или `undefined` до получения первого события.\n * @example\n * ```tsx\n * function App() {\n * const isYateam = useIsYateam();\n * return <span>Ятим ли сейчас?: {isYateam}</span>;\n * }\n * ```\n */\nexport function useIsYateam(): boolean | undefined {\n const [isYateam, setIsYateam] = useState<boolean | undefined>(undefined);\n\n useEffect(() => {\n const init = async () => {\n const yateam = (await hostApi.getIsYateam()) as boolean | undefined;\n setIsYateam(yateam);\n };\n\n init();\n }, []);\n\n return isYateam;\n}\n","import { on } from '@weavix/sdk-core';\nimport { useEffect, useState } from 'react';\n\n/**\n * Реактивный хук для получения текущего языка хоста.\n * @returns Код текущего языка (например, `'ru'`, `'en'`), или `undefined` до получения первого события.\n * @example\n * ```tsx\n * function App() {\n * const language = useLanguage();\n * return <span>Текущий язык: {language}</span>;\n * }\n * ```\n */\nexport function useLanguage(): string | undefined {\n const [language, setLanguage] = useState<string | undefined>(() => {\n let initial: string | undefined;\n const unsubscribe = on('language.changed', (value) => {\n initial = value;\n });\n unsubscribe();\n return initial;\n });\n\n useEffect(() => {\n const unsubscribe = on('language.changed', (value) => {\n setLanguage(value);\n });\n\n return unsubscribe;\n }, []);\n\n return language;\n}\n","import { type Theme, on } from '@weavix/sdk-core';\nimport { useEffect, useState } from 'react';\n\n/**\n * Реактивный хук для получения текущей темы хоста.\n * @returns Текущая тема (`'light'` | `'dark'` и т.д.), или `undefined` до получения первого события.\n * @example\n * ```tsx\n * function App() {\n * const theme = useTheme();\n * return <div className={theme}>...</div>;\n * }\n * ```\n */\nexport function useTheme(): Theme | undefined {\n const [theme, setTheme] = useState<Theme | undefined>(() => {\n let initial: Theme | undefined;\n const unsubscribe = on('theme.changed', (value) => {\n initial = value;\n });\n unsubscribe();\n return initial;\n });\n\n useEffect(() => {\n const unsubscribe = on('theme.changed', (value) => {\n setTheme(value);\n });\n\n return unsubscribe;\n }, []);\n\n return theme;\n}\n","import { hostApi } from '@weavix/sdk-core';\nimport { useEffect, useState } from 'react';\n\n/**\n * Реактивный хук для получения айди текущего пользователя.\n * @returns Айди пользователя (например, `'qwertyu'`), или `undefined` до получения первого события.\n * @example\n * ```tsx\n * function App() {\n * const userId = useUserId();\n * return <span>Айди: {userId}</span>;\n * }\n * ```\n */\nexport function useUserId(): string | undefined {\n const [userId, setUserId] = useState<string | undefined>(undefined);\n\n useEffect(() => {\n const init = async () => {\n const id = (await hostApi.getUserId()) as string | undefined;\n\n setUserId(id);\n };\n\n init();\n }, []);\n\n return userId;\n}\n","import {\n type BasicContext,\n type ContextLevel,\n type Theme,\n dispatchHostEvent,\n hostApi,\n setHandler,\n uiApi,\n} from '@weavix/sdk-core';\nimport {\n type ReactNode,\n createContext,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useContext as useSlotContext } from '../hooks/useContext';\nimport { useIsYateam } from '../hooks/useIsYateam';\nimport { useLanguage } from '../hooks/useLanguage';\nimport { useTheme } from '../hooks/useTheme';\nimport { useUserId } from '../hooks/useUserId';\nimport { ErrorBoundary } from './ErrorBoundary';\nimport { PluginError } from './PluginError';\n\n/**\n * Generic registerHandler — no Tracker-specific types.\n */\nexport type RegisterHandlerFunction = (\n methodName: string,\n handler: (...args: unknown[]) => unknown,\n) => void;\n\ninterface CommonPluginContextValue {\n /** Current host theme. Updated reactively on theme.changed. */\n theme: Theme | undefined;\n /** Current host language. Updated reactively on language.changed. */\n language: string | undefined;\n /** Service in which the plugin was opened. */\n service: string;\n /** User ID. */\n userId?: string;\n /** Is this a yateam environment? */\n isYateam?: boolean;\n /** Origin of the parent window (host). */\n origin: string;\n /** Slot in which the plugin is opened. */\n slot: string;\n /** URL inside the plugin. */\n innerUrl: string;\n /** Plugin query parameters. */\n queryParams: Record<string, string>;\n /** Register a handler for responding to host requests. */\n registerHandler: RegisterHandlerFunction;\n}\n\n/**\n * Plugin context at contextLevel = 'basic'.\n * slotContext contains only entityId.\n */\nexport interface BasicPluginContextValue extends CommonPluginContextValue {\n /** Page context — only entityId at basic level. */\n slotContext: BasicContext | undefined;\n\n /** Context level declared in the manifest. */\n contextLevel: 'basic';\n}\n\n/**\n * Plugin context at contextLevel = 'full'.\n * slotContext contains the full slot object.\n */\nexport interface FullPluginContextValue extends CommonPluginContextValue {\n /** Page context — full slot object at full level. */\n slotContext: unknown;\n\n /** Context level declared in the manifest. */\n contextLevel: 'full';\n}\n\nexport type PluginContextValue = BasicPluginContextValue | FullPluginContextValue;\n\n/** Internal context type — only stable data (slot + registerHandler) */\ntype InternalContextValue = {\n slot: string;\n registerHandler: RegisterHandlerFunction;\n innerUrl: string;\n queryParams: Record<string, string>;\n contextLevel: ContextLevel;\n entityId: string | null;\n entityMeta: Record<string, string> | undefined;\n};\n\nconst PluginContext = createContext<InternalContextValue | null>(null);\n\n/**\n * Hook for getting theme, language, slot and slot context from PluginProvider.\n *\n * All values are reactive — updated automatically on push events from the host:\n * - `theme` — on `theme.changed`\n * - `language` — on `language.changed`\n * - `slotContext` — on `context.changed`\n *\n * Supports two context levels:\n * - `'basic'` (default) — slotContext contains only `{ entityId }`.\n * - `'full'` — slotContext contains the full slot object.\n * Requires `contextLevel: \"full\"` in the plugin manifest.\n */\nexport function usePluginContext(): BasicPluginContextValue;\nexport function usePluginContext(level: 'basic'): BasicPluginContextValue;\nexport function usePluginContext(level: 'full'): FullPluginContextValue;\nexport function usePluginContext(\n level: ContextLevel = 'basic',\n): BasicPluginContextValue | FullPluginContextValue {\n const ctx = useContext(PluginContext);\n if (!ctx) {\n throw new Error('usePluginContext must be used within PluginProvider');\n }\n\n // Runtime guard: code requests more than manifest allows\n if (level === 'full' && ctx.contextLevel !== 'full') {\n throw new Error(\n \"🛑 [Security] Code requests 'full' context, but manifest declares 'basic'. \" +\n 'Change the contextLevel in your manifest to get full access.',\n );\n }\n\n // Reactive values — each hook subscribes to its own event\n const theme = useTheme();\n const language = useLanguage();\n const isYateam = useIsYateam();\n const userId = useUserId();\n const fullSlotContext = useSlotContext();\n\n const commonContextValue = {\n service: hostApi.getService(),\n origin: hostApi.getOrigin(),\n slot: ctx.slot,\n innerUrl: ctx.innerUrl,\n queryParams: ctx.queryParams,\n registerHandler: ctx.registerHandler,\n theme,\n language,\n isYateam,\n userId,\n };\n\n if (level === 'basic') {\n const basicSlotContext: BasicContext | undefined = ctx.entityId\n ? { entityId: ctx.entityId, ...(ctx.entityMeta ? { entityMeta: ctx.entityMeta } : {}) }\n : undefined;\n\n return {\n ...commonContextValue,\n contextLevel: 'basic',\n slotContext: basicSlotContext,\n } as BasicPluginContextValue;\n }\n\n return {\n ...commonContextValue,\n contextLevel: 'full',\n slotContext: fullSlotContext,\n } as FullPluginContextValue;\n}\n\nexport interface PluginProviderProps {\n children: ReactNode;\n /**\n * Automatically resize the plugin container when content changes.\n * @default true\n */\n autoResize?: boolean;\n /**\n * Component to display during initialization.\n * @default undefined (nothing shown)\n */\n fallback?: ReactNode;\n /**\n * Component to display on initialization error.\n * @default <PluginError error={error} />\n */\n errorFallback?: (error: Error) => ReactNode;\n /**\n * Automatically notify the host that the plugin is ready after initialization.\n * @default true\n */\n autoNotifyReady?: boolean;\n}\n\nexport const isInternalUrl = (url: string) => {\n try {\n const urlObj = new URL(url, window.location.href);\n return urlObj.origin === window.location.origin;\n } catch {\n return true;\n }\n};\n\n/**\n * Generic plugin provider.\n * Wraps the application and manages the plugin lifecycle.\n *\n * After initialization, theme, language and slot context are available via\n * `usePluginContext()` and update reactively on push events from the host.\n * @example\n * ```tsx\n * root.render(\n * <PluginProvider>\n * <App />\n * </PluginProvider>\n * );\n * ```\n */\nexport function PluginProvider({\n children,\n autoResize = true,\n fallback,\n errorFallback,\n autoNotifyReady = true,\n}: PluginProviderProps) {\n const initializedRef = useRef(false);\n const [initialized, setInitialized] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n const [internalValue, setInternalValue] = useState<InternalContextValue | null>(null);\n\n const registerHandler = useMemo<RegisterHandlerFunction>(() => {\n return (methodName: string, handler: (...args: unknown[]) => unknown) =>\n setHandler(methodName as never, handler as never);\n }, []);\n\n useEffect(() => {\n const handleLinkClick = (event: MouseEvent) => {\n const target = event.target as HTMLElement;\n const linkElement = target.closest<HTMLElement>('[href], [data-href]');\n\n if (!linkElement) return;\n\n const href = linkElement.getAttribute('href') || linkElement.getAttribute('data-href');\n if (!href) return;\n\n if (isInternalUrl(href)) {\n return;\n }\n\n event.preventDefault();\n\n const targetAttr = linkElement.getAttribute('target');\n const newTab = targetAttr === '_blank';\n\n uiApi\n .navigate({\n path: href,\n options: {\n newTab,\n },\n })\n .then(() => {\n console.info(`Navigation: ${href}`);\n })\n .catch((err) => {\n console.error('Navigation error:', err);\n });\n };\n\n document.addEventListener('click', handleLinkClick);\n\n return () => {\n document.removeEventListener('click', handleLinkClick);\n };\n }, []);\n\n useEffect(() => {\n // Prevent double initialization in React StrictMode\n if (initializedRef.current) {\n return;\n }\n\n const initPlugin = async () => {\n try {\n hostApi.init({ autoResize });\n initializedRef.current = true;\n\n const contextLevel = hostApi.getContextLevel();\n const entityId = hostApi.getEntityId();\n const entityMeta = hostApi.getEntityMeta();\n\n setInternalValue({\n slot: hostApi.getSlot(),\n innerUrl: hostApi.getInnerUrl(),\n queryParams: hostApi.getQueryParams(),\n contextLevel,\n entityId,\n entityMeta,\n registerHandler,\n });\n\n if (autoNotifyReady) {\n await hostApi.notifyReady();\n }\n\n // Fetch initial values and prime the eventBus cache so that\n // hooks subscribing after these responses arrive still get the values.\n // For basic contextLevel, skip the context.get postMessage call.\n const [theme, language, context, isYateam, userId] = await Promise.allSettled([\n hostApi.getTheme(),\n hostApi.getLanguage(),\n contextLevel === 'full' ? hostApi.getContext() : Promise.resolve(null),\n hostApi.getIsYateam(),\n hostApi.getUserId(),\n ]);\n\n if (theme.status === 'fulfilled' && theme.value) {\n dispatchHostEvent({\n messageId: '',\n type: 'event',\n method: 'theme.changed',\n result: theme.value,\n });\n }\n if (language.status === 'fulfilled' && language.value) {\n dispatchHostEvent({\n messageId: '',\n type: 'event',\n method: 'language.changed',\n result: language.value,\n });\n }\n\n if (isYateam.status === 'fulfilled' && isYateam.value) {\n dispatchHostEvent({\n messageId: '',\n type: 'event',\n method: 'isYateam.changed',\n result: isYateam.value,\n });\n }\n\n if (userId.status === 'fulfilled' && userId.value) {\n dispatchHostEvent({\n messageId: '',\n type: 'event',\n method: 'userId.changed',\n result: userId.value,\n });\n }\n\n // For basic level, dispatch entityId as context.\n // For full level, dispatch the full context from host.\n if (contextLevel === 'basic') {\n if (entityId) {\n dispatchHostEvent({\n messageId: '',\n type: 'event',\n method: 'context.changed',\n result: { entityId, ...(entityMeta ? { entityMeta } : {}) },\n });\n }\n } else if (context.status === 'fulfilled' && context.value) {\n dispatchHostEvent({\n messageId: '',\n type: 'event',\n method: 'context.changed',\n result: context.value,\n });\n }\n\n setInitialized(true);\n } catch (err) {\n setError(err as Error);\n }\n };\n\n initPlugin();\n }, [autoResize, registerHandler, autoNotifyReady]);\n\n if (error) {\n if (errorFallback) {\n return <>{errorFallback(error)}</>;\n }\n\n return <PluginError error={error} />;\n }\n\n if (!initialized || !internalValue) {\n return <>{fallback}</>;\n }\n\n return (\n <ErrorBoundary\n fallback={errorFallback || ((pluginError) => <PluginError error={pluginError} />)}\n >\n <PluginContext.Provider value={internalValue}>{children}</PluginContext.Provider>\n </ErrorBoundary>\n );\n}\n","import { type ConfirmOptions, type ConfirmResult, uiApi } from '@weavix/sdk-core';\nimport { useCallback } from 'react';\n\nexport type UseConfirmReturn = {\n show: (options: ConfirmOptions) => Promise<ConfirmResult>;\n};\n\nconst useConfirmImpl = () => {\n const show = useCallback((options: ConfirmOptions) => uiApi.confirm.show(options), []);\n\n return { show };\n};\n\nexport const useConfirm = useConfirmImpl as () => UseConfirmReturn;\n","import { type LocalizedString, getLocalizedString } from '@weavix/sdk-core';\nimport { useLanguage } from './useLanguage';\n\nconst useLocalizedStringImpl = (fallbackLanguage = 'ru') => {\n const language = useLanguage();\n\n return (value: LocalizedString): string => {\n return getLocalizedString(value, language, fallbackLanguage);\n };\n};\n\n/**\n * Хук для получения локализованной строки на основе текущего языка из контекста.\n */\nexport const useLocalizedString = useLocalizedStringImpl as (\n fallbackLanguage?: string,\n) => (value: LocalizedString) => string;\n","import { type ToastOptions, uiApi } from '@weavix/sdk-core';\nimport { useCallback } from 'react';\n\nexport type UseToasterReturn = {\n add: (options: ToastOptions) => Promise<{ name: string }>;\n};\n\nconst useToasterImpl = () => {\n const add = useCallback((options: ToastOptions) => uiApi.toaster.add(options), []);\n\n return { add };\n};\n\nexport const useToaster = useToasterImpl as () => UseToasterReturn;\n"],"x_google_ignoreList":[1,2,3],"mappings":";;;;;;IAYa,IAAb,cAAmC,EAAkD;CACjF,OAAO,yBAAyB,GAAkC;EAC9D,OAAO;GAAE,UAAU;GAAM;GAAO;;CAGpC,YAAY,GAA2B;EAEnC,AADA,MAAM,EAAM,EACZ,KAAK,QAAQ;GAAE,UAAU;GAAO,OAAO;GAAM;;CAGjD,kBAAkB,GAAc,GAA4B;EACxD,QAAQ,MAAM,kCAAkC,GAAO,EAAU;;CAGrE,SAAS;EAKL,OAJI,KAAK,MAAM,YAAY,KAAK,MAAM,QAC3B,KAAK,MAAM,SAAS,KAAK,MAAM,MAAM,GAGzC,KAAK,MAAM;;;CCtBb,IAAI,IAAA,EAAU,QAAQ,EAAC,IAAE,OAAO,IAAI,gBAAgB,EAAC,IAAE,OAAO,IAAI,iBAAiB,EAAC,IAAE,OAAO,UAAU,gBAAe,IAAE,EAAE,mDAAmD,mBAAkB,IAAE;EAAC,KAAI,CAAC;EAAE,KAAI,CAAC;EAAE,QAAO,CAAC;EAAE,UAAS,CAAC;EAAE;CACnP,SAAS,EAAE,GAAE,GAAE,GAAE;EAAC,IAAI,GAAE,IAAE,EAAE,EAAC,IAAE,MAAK,IAAE;EAAiF,KAAI,KAAvE,MAAT,KAAK,MAAQ,IAAE,KAAG,IAAY,EAAE,QAAX,KAAK,MAAY,IAAE,KAAG,EAAE,MAAc,EAAE,QAAX,KAAK,MAAY,IAAE,EAAE,MAAc,GAAE,EAAE,KAAK,GAAE,EAAE,IAAE,CAAC,EAAE,eAAe,EAAE,KAAG,EAAE,KAAG,EAAE;EAAI,IAAG,KAAG,EAAE,cAAa,KAAI,KAAK,IAAE,EAAE,cAAa,GAAE,AAAS,EAAE,OAAX,KAAK,MAAW,EAAE,KAAG,EAAE;EAAI,OAAM;GAAC,UAAS;GAAE,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PluginError.tsx","../src/components/PluginLoader.tsx","../src/hooks/useContext.ts","../src/hooks/useIsYateam.ts","../src/hooks/useLanguage.ts","../src/hooks/useTheme.ts","../src/hooks/useUserId.ts","../src/components/PluginProvider.tsx","../src/hooks/useConfirm.ts","../src/hooks/useLocalizedString.ts","../src/hooks/useToaster.ts"],"sourcesContent":["import { Component, ReactNode } from 'react';\n\ninterface ErrorBoundaryProps {\n children: ReactNode;\n fallback: (error: Error) => ReactNode;\n}\n\ninterface ErrorBoundaryState {\n hasError: boolean;\n error: Error | null;\n}\n\nexport class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {\n static getDerivedStateFromError(error: Error): ErrorBoundaryState {\n return { hasError: true, error };\n }\n\n constructor(props: ErrorBoundaryProps) {\n super(props);\n this.state = { hasError: false, error: null };\n }\n\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\n console.error('ErrorBoundary caught an error:', error, errorInfo);\n }\n\n render() {\n if (this.state.hasError && this.state.error) {\n return this.props.fallback(this.state.error);\n }\n\n return this.props.children;\n }\n}\n","import type { FC } from 'react';\nimport './PluginError.scss';\n\nexport interface PluginErrorProps {\n error: Error;\n}\n\nconst PluginErrorImpl = ({ error }: PluginErrorProps) => (\n <div className=\"plugin-error\">\n <div className=\"plugin-error__container\">\n <div className=\"plugin-error__header\">\n <svg\n className=\"plugin-error__icon\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" fill=\"#f44336\" />\n <path\n d=\"M12 7v6m0 4h.01\"\n stroke=\"white\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n />\n </svg>\n <h3 className=\"plugin-error__title\">Ошибка инициализации плагина</h3>\n </div>\n <div className=\"plugin-error__message\">\n Не удалось инициализировать плагин. Проверьте параметры запуска и попробуйте\n перезагрузить страницу.\n </div>\n <details className=\"plugin-error__details\">\n <summary className=\"plugin-error__summary\">Детали ошибки</summary>\n <pre className=\"plugin-error__stack\">\n {error.message}\n {error.stack && `\\n\\n${error.stack}`}\n </pre>\n </details>\n </div>\n </div>\n);\n\n/**\n * Дефолтный компонент для отображения ошибки инициализации плагина\n */\nexport const PluginError = PluginErrorImpl as FC<PluginErrorProps>;\n","import type { FC } from 'react';\nimport './PluginLoader.scss';\n\nconst PluginLoaderImpl = () => (\n <div className=\"plugin-loader\">\n <div className=\"plugin-loader__content\">\n <div className=\"plugin-loader__spinner\" />\n <div className=\"plugin-loader__text\">Загрузка плагина...</div>\n </div>\n </div>\n);\n\n/**\n * Простой лоадер для отображения во время инициализации плагина\n */\nexport const PluginLoader = PluginLoaderImpl as FC;\n","import { on } from '@weavix/sdk-core';\nimport { useEffect, useState } from 'react';\n\n/**\n * Reactive hook for receiving the current slot context pushed by the host.\n * @template T - Type of the context object (defaults to `unknown`)\n * @returns Current context, or `undefined` until the first event arrives from the host.\n * @example\n * ```tsx\n * interface IssueContext {\n * key: string;\n * summary: string;\n * }\n *\n * function App() {\n * const context = useContext<IssueContext>();\n * if (!context) return <Loader />;\n * return <div>{context.summary}</div>;\n * }\n * ```\n */\nexport function useContext<T = unknown>(): T | undefined {\n const [context, setContext] = useState<T | undefined>(() => {\n let initial: T | undefined;\n const unsubscribe = on('context.changed', (value) => {\n initial = value as T;\n });\n unsubscribe();\n return initial;\n });\n\n useEffect(() => {\n const unsubscribe = on('context.changed', (value) => {\n setContext(value as T);\n });\n\n return unsubscribe;\n }, []);\n\n return context;\n}\n","import { hostApi } from '@weavix/sdk-core';\nimport { useEffect, useState } from 'react';\n\n/**\n * Реактивный хук для получения текущей сборки приложения.\n * @returns Является ли ятимом приложение (например, 'true'), или `undefined` до получения первого события.\n * @example\n * ```tsx\n * function App() {\n * const isYateam = useIsYateam();\n * return <span>Ятим ли сейчас?: {isYateam}</span>;\n * }\n * ```\n */\nexport function useIsYateam(): boolean | undefined {\n const [isYateam, setIsYateam] = useState<boolean | undefined>(undefined);\n\n useEffect(() => {\n const init = async () => {\n const yateam = (await hostApi.getIsYateam()) as boolean | undefined;\n setIsYateam(yateam);\n };\n\n init();\n }, []);\n\n return isYateam;\n}\n","import { on } from '@weavix/sdk-core';\nimport { useEffect, useState } from 'react';\n\n/**\n * Реактивный хук для получения текущего языка хоста.\n * @returns Код текущего языка (например, `'ru'`, `'en'`), или `undefined` до получения первого события.\n * @example\n * ```tsx\n * function App() {\n * const language = useLanguage();\n * return <span>Текущий язык: {language}</span>;\n * }\n * ```\n */\nexport function useLanguage(): string | undefined {\n const [language, setLanguage] = useState<string | undefined>(() => {\n let initial: string | undefined;\n const unsubscribe = on('language.changed', (value) => {\n initial = value;\n });\n unsubscribe();\n return initial;\n });\n\n useEffect(() => {\n const unsubscribe = on('language.changed', (value) => {\n setLanguage(value);\n });\n\n return unsubscribe;\n }, []);\n\n return language;\n}\n","import { type Theme, on } from '@weavix/sdk-core';\nimport { useEffect, useState } from 'react';\n\n/**\n * Реактивный хук для получения текущей темы хоста.\n * @returns Текущая тема (`'light'` | `'dark'` и т.д.), или `undefined` до получения первого события.\n * @example\n * ```tsx\n * function App() {\n * const theme = useTheme();\n * return <div className={theme}>...</div>;\n * }\n * ```\n */\nexport function useTheme(): Theme | undefined {\n const [theme, setTheme] = useState<Theme | undefined>(() => {\n let initial: Theme | undefined;\n const unsubscribe = on('theme.changed', (value) => {\n initial = value;\n });\n unsubscribe();\n return initial;\n });\n\n useEffect(() => {\n const unsubscribe = on('theme.changed', (value) => {\n setTheme(value);\n });\n\n return unsubscribe;\n }, []);\n\n return theme;\n}\n","import { hostApi } from '@weavix/sdk-core';\nimport { useEffect, useState } from 'react';\n\n/**\n * Реактивный хук для получения айди текущего пользователя.\n * @returns Айди пользователя (например, `'qwertyu'`), или `undefined` до получения первого события.\n * @example\n * ```tsx\n * function App() {\n * const userId = useUserId();\n * return <span>Айди: {userId}</span>;\n * }\n * ```\n */\nexport function useUserId(): string | undefined {\n const [userId, setUserId] = useState<string | undefined>(undefined);\n\n useEffect(() => {\n const init = async () => {\n const id = (await hostApi.getUserId()) as string | undefined;\n\n setUserId(id);\n };\n\n init();\n }, []);\n\n return userId;\n}\n","import {\n type BasicContext,\n type ContextLevel,\n type Theme,\n dispatchHostEvent,\n hostApi,\n setHandler,\n uiApi,\n} from '@weavix/sdk-core';\nimport {\n type ReactNode,\n createContext,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useContext as useSlotContext } from '../hooks/useContext';\nimport { useIsYateam } from '../hooks/useIsYateam';\nimport { useLanguage } from '../hooks/useLanguage';\nimport { useTheme } from '../hooks/useTheme';\nimport { useUserId } from '../hooks/useUserId';\nimport { ErrorBoundary } from './ErrorBoundary';\nimport { PluginError } from './PluginError';\n\n/**\n * Generic registerHandler — no Tracker-specific types.\n */\nexport type RegisterHandlerFunction = (\n methodName: string,\n handler: (...args: unknown[]) => unknown,\n) => void;\n\ninterface CommonPluginContextValue {\n /** Current host theme. Updated reactively on theme.changed. */\n theme: Theme | undefined;\n /** Current host language. Updated reactively on language.changed. */\n language: string | undefined;\n /** Service in which the plugin was opened. */\n service: string;\n /** User ID. */\n userId?: string;\n /** Is this a yateam environment? */\n isYateam?: boolean;\n /** Origin of the parent window (host). */\n origin: string;\n /** Slot in which the plugin is opened. */\n slot: string;\n /** URL inside the plugin. */\n innerUrl: string;\n /** Plugin query parameters. */\n queryParams: Record<string, string>;\n /** Register a handler for responding to host requests. */\n registerHandler: RegisterHandlerFunction;\n}\n\n/**\n * Plugin context at contextLevel = 'basic'.\n * slotContext contains only entityId.\n */\nexport interface BasicPluginContextValue extends CommonPluginContextValue {\n /** Page context — only entityId at basic level. */\n slotContext: BasicContext | undefined;\n\n /** Context level declared in the manifest. */\n contextLevel: 'basic';\n}\n\n/**\n * Plugin context at contextLevel = 'full'.\n * slotContext contains the full slot object.\n */\nexport interface FullPluginContextValue extends CommonPluginContextValue {\n /** Page context — full slot object at full level. */\n slotContext: unknown;\n\n /** Context level declared in the manifest. */\n contextLevel: 'full';\n}\n\nexport type PluginContextValue = BasicPluginContextValue | FullPluginContextValue;\n\n/** Internal context type — only stable data (slot + registerHandler) */\ntype InternalContextValue = {\n slot: string;\n registerHandler: RegisterHandlerFunction;\n innerUrl: string;\n queryParams: Record<string, string>;\n contextLevel: ContextLevel;\n entityId: string | null;\n entityMeta: Record<string, string> | undefined;\n};\n\nconst PluginContext = createContext<InternalContextValue | null>(null);\n\n/**\n * Hook for getting theme, language, slot and slot context from PluginProvider.\n *\n * All values are reactive — updated automatically on push events from the host:\n * - `theme` — on `theme.changed`\n * - `language` — on `language.changed`\n * - `slotContext` — on `context.changed`\n *\n * Supports two context levels:\n * - `'basic'` (default) — slotContext contains only `{ entityId }`.\n * - `'full'` — slotContext contains the full slot object.\n * Requires `contextLevel: \"full\"` in the plugin manifest.\n */\nexport function usePluginContext(): BasicPluginContextValue;\nexport function usePluginContext(level: 'basic'): BasicPluginContextValue;\nexport function usePluginContext(level: 'full'): FullPluginContextValue;\nexport function usePluginContext(\n level: ContextLevel = 'basic',\n): BasicPluginContextValue | FullPluginContextValue {\n const ctx = useContext(PluginContext);\n if (!ctx) {\n throw new Error('usePluginContext must be used within PluginProvider');\n }\n\n // Runtime guard: code requests more than manifest allows\n if (level === 'full' && ctx.contextLevel !== 'full') {\n throw new Error(\n \"🛑 [Security] Code requests 'full' context, but manifest declares 'basic'. \" +\n 'Change the contextLevel in your manifest to get full access.',\n );\n }\n\n // Reactive values — each hook subscribes to its own event\n const theme = useTheme();\n const language = useLanguage();\n const isYateam = useIsYateam();\n const userId = useUserId();\n const fullSlotContext = useSlotContext();\n\n const commonContextValue = {\n service: hostApi.getService(),\n origin: hostApi.getOrigin(),\n slot: ctx.slot,\n innerUrl: ctx.innerUrl,\n queryParams: ctx.queryParams,\n registerHandler: ctx.registerHandler,\n theme,\n language,\n isYateam,\n userId,\n };\n\n if (level === 'basic') {\n const basicSlotContext: BasicContext | undefined = ctx.entityId\n ? { entityId: ctx.entityId, ...(ctx.entityMeta ? { entityMeta: ctx.entityMeta } : {}) }\n : undefined;\n\n return {\n ...commonContextValue,\n contextLevel: 'basic',\n slotContext: basicSlotContext,\n } as BasicPluginContextValue;\n }\n\n return {\n ...commonContextValue,\n contextLevel: 'full',\n slotContext: fullSlotContext,\n } as FullPluginContextValue;\n}\n\nexport interface PluginProviderProps {\n children: ReactNode;\n /**\n * Automatically resize the plugin container when content changes.\n * @default true\n */\n autoResize?: boolean;\n /**\n * Component to display during initialization.\n * @default undefined (nothing shown)\n */\n fallback?: ReactNode;\n /**\n * Component to display on initialization error.\n * @default <PluginError error={error} />\n */\n errorFallback?: (error: Error) => ReactNode;\n /**\n * Automatically notify the host that the plugin is ready after initialization.\n * @default true\n */\n autoNotifyReady?: boolean;\n}\n\nexport const isInternalUrl = (url: string) => {\n try {\n const urlObj = new URL(url, window.location.href);\n return urlObj.origin === window.location.origin;\n } catch {\n return true;\n }\n};\n\n/**\n * Generic plugin provider.\n * Wraps the application and manages the plugin lifecycle.\n *\n * After initialization, theme, language and slot context are available via\n * `usePluginContext()` and update reactively on push events from the host.\n * @example\n * ```tsx\n * root.render(\n * <PluginProvider>\n * <App />\n * </PluginProvider>\n * );\n * ```\n */\nexport function PluginProvider({\n children,\n autoResize = true,\n fallback,\n errorFallback,\n autoNotifyReady = true,\n}: PluginProviderProps) {\n const initializedRef = useRef(false);\n const [initialized, setInitialized] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n const [internalValue, setInternalValue] = useState<InternalContextValue | null>(null);\n\n const registerHandler = useMemo<RegisterHandlerFunction>(() => {\n return (methodName: string, handler: (...args: unknown[]) => unknown) =>\n setHandler(methodName as never, handler as never);\n }, []);\n\n useEffect(() => {\n const handleLinkClick = (event: MouseEvent) => {\n const target = event.target as HTMLElement;\n const linkElement = target.closest<HTMLElement>('[href], [data-href]');\n\n if (!linkElement) return;\n\n const href = linkElement.getAttribute('href') || linkElement.getAttribute('data-href');\n if (!href) return;\n\n if (isInternalUrl(href)) {\n return;\n }\n\n event.preventDefault();\n\n const targetAttr = linkElement.getAttribute('target');\n const newTab = targetAttr === '_blank';\n\n uiApi\n .navigate({\n path: href,\n options: {\n newTab,\n },\n })\n .then(() => {\n console.info(`Navigation: ${href}`);\n })\n .catch((err) => {\n console.error('Navigation error:', err);\n });\n };\n\n document.addEventListener('click', handleLinkClick);\n\n return () => {\n document.removeEventListener('click', handleLinkClick);\n };\n }, []);\n\n useEffect(() => {\n // Prevent double initialization in React StrictMode\n if (initializedRef.current) {\n return;\n }\n\n const initPlugin = async () => {\n try {\n hostApi.init({ autoResize });\n initializedRef.current = true;\n\n const contextLevel = hostApi.getContextLevel();\n const entityId = hostApi.getEntityId();\n const entityMeta = hostApi.getEntityMeta();\n\n setInternalValue({\n slot: hostApi.getSlot(),\n innerUrl: hostApi.getInnerUrl(),\n queryParams: hostApi.getQueryParams(),\n contextLevel,\n entityId,\n entityMeta,\n registerHandler,\n });\n\n if (autoNotifyReady) {\n await hostApi.notifyReady();\n }\n\n // Fetch initial values and prime the eventBus cache so that\n // hooks subscribing after these responses arrive still get the values.\n // For basic contextLevel, skip the context.get postMessage call.\n const [theme, language, context, isYateam, userId] = await Promise.allSettled([\n hostApi.getTheme(),\n hostApi.getLanguage(),\n contextLevel === 'full' ? hostApi.getContext() : Promise.resolve(null),\n hostApi.getIsYateam(),\n hostApi.getUserId(),\n ]);\n\n if (theme.status === 'fulfilled' && theme.value) {\n dispatchHostEvent({\n messageId: '',\n type: 'event',\n method: 'theme.changed',\n result: theme.value,\n });\n }\n if (language.status === 'fulfilled' && language.value) {\n dispatchHostEvent({\n messageId: '',\n type: 'event',\n method: 'language.changed',\n result: language.value,\n });\n }\n\n if (isYateam.status === 'fulfilled' && isYateam.value) {\n dispatchHostEvent({\n messageId: '',\n type: 'event',\n method: 'isYateam.changed',\n result: isYateam.value,\n });\n }\n\n if (userId.status === 'fulfilled' && userId.value) {\n dispatchHostEvent({\n messageId: '',\n type: 'event',\n method: 'userId.changed',\n result: userId.value,\n });\n }\n\n // For basic level, dispatch entityId as context.\n // For full level, dispatch the full context from host.\n if (contextLevel === 'basic') {\n if (entityId) {\n dispatchHostEvent({\n messageId: '',\n type: 'event',\n method: 'context.changed',\n result: { entityId, ...(entityMeta ? { entityMeta } : {}) },\n });\n }\n } else if (context.status === 'fulfilled' && context.value) {\n dispatchHostEvent({\n messageId: '',\n type: 'event',\n method: 'context.changed',\n result: context.value,\n });\n }\n\n setInitialized(true);\n } catch (err) {\n setError(err as Error);\n }\n };\n\n initPlugin();\n }, [autoResize, registerHandler, autoNotifyReady]);\n\n if (error) {\n if (errorFallback) {\n return <>{errorFallback(error)}</>;\n }\n\n return <PluginError error={error} />;\n }\n\n if (!initialized || !internalValue) {\n return <>{fallback}</>;\n }\n\n return (\n <ErrorBoundary\n fallback={errorFallback || ((pluginError) => <PluginError error={pluginError} />)}\n >\n <PluginContext.Provider value={internalValue}>{children}</PluginContext.Provider>\n </ErrorBoundary>\n );\n}\n","import { type ConfirmOptions, type ConfirmResult, uiApi } from '@weavix/sdk-core';\nimport { useCallback } from 'react';\n\nexport type UseConfirmReturn = {\n show: (options: ConfirmOptions) => Promise<ConfirmResult>;\n};\n\nconst useConfirmImpl = () => {\n const show = useCallback((options: ConfirmOptions) => uiApi.confirm.show(options), []);\n\n return { show };\n};\n\nexport const useConfirm = useConfirmImpl as () => UseConfirmReturn;\n","import { type LocalizedString, getLocalizedString } from '@weavix/sdk-core';\nimport { useLanguage } from './useLanguage';\n\nconst useLocalizedStringImpl = (fallbackLanguage = 'ru') => {\n const language = useLanguage();\n\n return (value: LocalizedString): string => {\n return getLocalizedString(value, language, fallbackLanguage);\n };\n};\n\n/**\n * Хук для получения локализованной строки на основе текущего языка из контекста.\n */\nexport const useLocalizedString = useLocalizedStringImpl as (\n fallbackLanguage?: string,\n) => (value: LocalizedString) => string;\n","import { type ToastOptions, uiApi } from '@weavix/sdk-core';\nimport { useCallback } from 'react';\n\nexport type UseToasterReturn = {\n add: (options: ToastOptions) => Promise<{ name: string }>;\n};\n\nconst useToasterImpl = () => {\n const add = useCallback((options: ToastOptions) => uiApi.toaster.add(options), []);\n\n return { add };\n};\n\nexport const useToaster = useToasterImpl as () => UseToasterReturn;\n"],"mappings":";;;;AAYA,IAAa,IAAb,cAAmC,EAAkD;CACjF,OAAO,yBAAyB,GAAkC;EAC9D,OAAO;GAAE,UAAU;GAAM;GAAO;;CAGpC,YAAY,GAA2B;EAEnC,AADA,MAAM,EAAM,EACZ,KAAK,QAAQ;GAAE,UAAU;GAAO,OAAO;GAAM;;CAGjD,kBAAkB,GAAc,GAA4B;EACxD,QAAQ,MAAM,kCAAkC,GAAO,EAAU;;CAGrE,SAAS;EAKL,OAJI,KAAK,MAAM,YAAY,KAAK,MAAM,QAC3B,KAAK,MAAM,SAAS,KAAK,MAAM,MAAM,GAGzC,KAAK,MAAM;;GCeb,KAvCY,EAAE,eACvB,kBAAC,OAAD;CAAK,WAAU;WACX,kBAAC,OAAD;EAAK,WAAU;YAAf;GACI,kBAAC,OAAD;IAAK,WAAU;cAAf,CACI,kBAAC,OAAD;KACI,WAAU;KACV,OAAM;KACN,QAAO;KACP,SAAQ;KACR,MAAK;eALT,CAOI,kBAAC,UAAD;MAAQ,IAAG;MAAK,IAAG;MAAK,GAAE;MAAK,MAAK;MAAY,CAAA,EAChD,kBAAC,QAAD;MACI,GAAE;MACF,QAAO;MACP,aAAY;MACZ,eAAc;MAChB,CAAA,CACA;QACN,kBAAC,MAAD;KAAI,WAAU;eAAsB;KAAiC,CAAA,CACnE;;GACN,kBAAC,OAAD;IAAK,WAAU;cAAwB;IAGjC,CAAA;GACN,kBAAC,WAAD;IAAS,WAAU;cAAnB,CACI,kBAAC,WAAD;KAAS,WAAU;eAAwB;KAAuB,CAAA,EAClE,kBAAC,OAAD;KAAK,WAAU;eAAf,CACK,EAAM,SACN,EAAM,SAAS,OAAO,EAAM,QAC3B;OACA;;GACR;;CACJ,CAAA,ECzBG,UAXT,kBAAC,OAAD;CAAK,WAAU;WACX,kBAAC,OAAD;EAA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react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": {
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"README.md"
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@weavix/sdk-core": "0.0.
|
|
15
|
+
"@weavix/sdk-core": "0.0.12"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
18
|
"react": "^18.0.0"
|