@weavix/sdk-react 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -28
- package/dist/index.mjs +528 -835
- package/dist/index.mjs.map +1 -1
- package/dist/plugin-sdk-react/src/__tests__/setup.d.ts +1 -0
- package/dist/plugin-sdk-react/src/__tests__/setup.d.ts.map +1 -0
- package/dist/plugin-sdk-react/src/components/ErrorBoundary.d.ts +17 -0
- package/dist/plugin-sdk-react/src/components/ErrorBoundary.d.ts.map +1 -0
- package/dist/plugin-sdk-react/src/components/PluginError.d.ts +9 -0
- package/dist/plugin-sdk-react/src/components/PluginError.d.ts.map +1 -0
- package/dist/plugin-sdk-react/src/components/PluginLoader.d.ts +6 -0
- package/dist/plugin-sdk-react/src/components/PluginLoader.d.ts.map +1 -0
- package/dist/plugin-sdk-react/src/components/PluginProvider.d.ts +107 -0
- package/dist/plugin-sdk-react/src/components/PluginProvider.d.ts.map +1 -0
- package/dist/plugin-sdk-react/src/hooks/useConfirm.d.ts +6 -0
- package/dist/plugin-sdk-react/src/hooks/useConfirm.d.ts.map +1 -0
- package/dist/plugin-sdk-react/src/hooks/useContext.d.ts +20 -0
- package/dist/plugin-sdk-react/src/hooks/useContext.d.ts.map +1 -0
- package/dist/plugin-sdk-react/src/hooks/useIsYateam.d.ts +13 -0
- package/dist/plugin-sdk-react/src/hooks/useIsYateam.d.ts.map +1 -0
- package/dist/plugin-sdk-react/src/hooks/useLanguage.d.ts +13 -0
- package/dist/plugin-sdk-react/src/hooks/useLanguage.d.ts.map +1 -0
- package/dist/plugin-sdk-react/src/hooks/useLocalizedString.d.ts +6 -0
- package/dist/plugin-sdk-react/src/hooks/useLocalizedString.d.ts.map +1 -0
- package/dist/plugin-sdk-react/src/hooks/useTheme.d.ts +14 -0
- package/dist/plugin-sdk-react/src/hooks/useTheme.d.ts.map +1 -0
- package/dist/plugin-sdk-react/src/hooks/useToaster.d.ts +8 -0
- package/dist/plugin-sdk-react/src/hooks/useToaster.d.ts.map +1 -0
- package/dist/plugin-sdk-react/src/hooks/useUserId.d.ts +13 -0
- package/dist/plugin-sdk-react/src/hooks/useUserId.d.ts.map +1 -0
- package/dist/plugin-sdk-react/src/index.d.ts +16 -0
- package/dist/plugin-sdk-react/src/index.d.ts.map +1 -0
- package/package.json +7 -13
- package/dist/index.d.ts +0 -265
package/dist/index.mjs
CHANGED
|
@@ -1,121 +1,121 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { on as
|
|
3
|
-
import { METHOD_NOT_SUPPORTED as
|
|
4
|
-
class
|
|
5
|
-
static getDerivedStateFromError(
|
|
6
|
-
return { hasError: !0, error:
|
|
1
|
+
import Ye, { Component as Er, useState as A, useEffect as Y, createContext as Rr, useRef as xr, useMemo as Pr, useContext as Cr, useCallback as $e } from "react";
|
|
2
|
+
import { on as q, hostApi as m, setHandler as Tr, uiApi as le, dispatchHostEvent as V, getLocalizedString as Or } from "@weavix/sdk-core";
|
|
3
|
+
import { METHOD_NOT_SUPPORTED as Qr, MISSING_REQUIRED_SCOPE as Zr, PLUGIN_ID_IS_NOT_CORRECT as et, PLUGIN_ID_OR_SLOT_NOT_PROVIDED as rt, PluginActionError as tt, UNKNOWN_ERROR as nt, VALIDATION_ERROR as at, dispatchHostEvent as it, getField as ot, getLocalizedString as st, hostApi as ut, on as lt, uiApi as ct } from "@weavix/sdk-core";
|
|
4
|
+
class wr extends Er {
|
|
5
|
+
static getDerivedStateFromError(a) {
|
|
6
|
+
return { hasError: !0, error: a };
|
|
7
7
|
}
|
|
8
|
-
constructor(
|
|
9
|
-
super(
|
|
8
|
+
constructor(a) {
|
|
9
|
+
super(a), this.state = { hasError: !1, error: null };
|
|
10
10
|
}
|
|
11
|
-
componentDidCatch(
|
|
12
|
-
console.error("ErrorBoundary caught an error:",
|
|
11
|
+
componentDidCatch(a, c) {
|
|
12
|
+
console.error("ErrorBoundary caught an error:", a, c);
|
|
13
13
|
}
|
|
14
14
|
render() {
|
|
15
15
|
return this.state.hasError && this.state.error ? this.props.fallback(this.state.error) : this.props.children;
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
var
|
|
19
|
-
var
|
|
20
|
-
function
|
|
21
|
-
if (
|
|
22
|
-
|
|
23
|
-
var
|
|
24
|
-
function
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
for (
|
|
28
|
-
if (
|
|
29
|
-
return { $$typeof:
|
|
30
|
-
}
|
|
31
|
-
return
|
|
18
|
+
var ee = { exports: {} }, H = {};
|
|
19
|
+
var Le;
|
|
20
|
+
function Sr() {
|
|
21
|
+
if (Le) return H;
|
|
22
|
+
Le = 1;
|
|
23
|
+
var u = Ye, a = /* @__PURE__ */ Symbol.for("react.element"), c = /* @__PURE__ */ Symbol.for("react.fragment"), f = Object.prototype.hasOwnProperty, _ = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, j = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
24
|
+
function I(P, v, k) {
|
|
25
|
+
var b, O = {}, w = null, C = null;
|
|
26
|
+
k !== void 0 && (w = "" + k), v.key !== void 0 && (w = "" + v.key), v.ref !== void 0 && (C = v.ref);
|
|
27
|
+
for (b in v) f.call(v, b) && !j.hasOwnProperty(b) && (O[b] = v[b]);
|
|
28
|
+
if (P && P.defaultProps) for (b in v = P.defaultProps, v) O[b] === void 0 && (O[b] = v[b]);
|
|
29
|
+
return { $$typeof: a, type: P, key: w, ref: C, props: O, _owner: _.current };
|
|
30
|
+
}
|
|
31
|
+
return H.Fragment = c, H.jsx = I, H.jsxs = I, H;
|
|
32
32
|
}
|
|
33
|
-
var
|
|
34
|
-
var
|
|
35
|
-
function
|
|
36
|
-
return
|
|
37
|
-
var
|
|
38
|
-
function
|
|
33
|
+
var G = {};
|
|
34
|
+
var Fe;
|
|
35
|
+
function jr() {
|
|
36
|
+
return Fe || (Fe = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
37
|
+
var u = Ye, a = /* @__PURE__ */ Symbol.for("react.element"), c = /* @__PURE__ */ Symbol.for("react.portal"), f = /* @__PURE__ */ Symbol.for("react.fragment"), _ = /* @__PURE__ */ Symbol.for("react.strict_mode"), j = /* @__PURE__ */ Symbol.for("react.profiler"), I = /* @__PURE__ */ Symbol.for("react.provider"), P = /* @__PURE__ */ Symbol.for("react.context"), v = /* @__PURE__ */ Symbol.for("react.forward_ref"), k = /* @__PURE__ */ Symbol.for("react.suspense"), b = /* @__PURE__ */ Symbol.for("react.suspense_list"), O = /* @__PURE__ */ Symbol.for("react.memo"), w = /* @__PURE__ */ Symbol.for("react.lazy"), C = /* @__PURE__ */ Symbol.for("react.offscreen"), x = Symbol.iterator, $ = "@@iterator";
|
|
38
|
+
function S(e) {
|
|
39
39
|
if (e === null || typeof e != "object")
|
|
40
40
|
return null;
|
|
41
|
-
var
|
|
42
|
-
return typeof
|
|
41
|
+
var r = x && e[x] || e[$];
|
|
42
|
+
return typeof r == "function" ? r : null;
|
|
43
43
|
}
|
|
44
|
-
var
|
|
45
|
-
function
|
|
44
|
+
var y = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
45
|
+
function h(e) {
|
|
46
46
|
{
|
|
47
|
-
for (var
|
|
48
|
-
n
|
|
49
|
-
|
|
47
|
+
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
|
|
48
|
+
t[n - 1] = arguments[n];
|
|
49
|
+
L("error", e, t);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function L(e, r, t) {
|
|
53
53
|
{
|
|
54
|
-
var
|
|
55
|
-
|
|
56
|
-
var
|
|
57
|
-
return String(
|
|
54
|
+
var n = y.ReactDebugCurrentFrame, s = n.getStackAddendum();
|
|
55
|
+
s !== "" && (r += "%s", t = t.concat([s]));
|
|
56
|
+
var l = t.map(function(o) {
|
|
57
|
+
return String(o);
|
|
58
58
|
});
|
|
59
|
-
|
|
59
|
+
l.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, l);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
var
|
|
63
|
-
|
|
64
|
-
function
|
|
65
|
-
return !!(typeof e == "string" || typeof e == "function" || e ===
|
|
62
|
+
var F = !1, B = !1, Ve = !1, qe = !1, Be = !1, ce;
|
|
63
|
+
ce = /* @__PURE__ */ Symbol.for("react.module.reference");
|
|
64
|
+
function ze(e) {
|
|
65
|
+
return !!(typeof e == "string" || typeof e == "function" || e === f || e === j || Be || e === _ || e === k || e === b || qe || e === C || F || B || Ve || typeof e == "object" && e !== null && (e.$$typeof === w || e.$$typeof === O || e.$$typeof === I || e.$$typeof === P || e.$$typeof === v || // This needs to include all possible module reference object
|
|
66
66
|
// types supported by any Flight configuration anywhere since
|
|
67
67
|
// we don't know which Flight build this will end up being used
|
|
68
68
|
// with.
|
|
69
|
-
e.$$typeof ===
|
|
69
|
+
e.$$typeof === ce || e.getModuleId !== void 0));
|
|
70
70
|
}
|
|
71
|
-
function
|
|
72
|
-
var
|
|
73
|
-
if (
|
|
74
|
-
return
|
|
75
|
-
var
|
|
76
|
-
return
|
|
71
|
+
function Je(e, r, t) {
|
|
72
|
+
var n = e.displayName;
|
|
73
|
+
if (n)
|
|
74
|
+
return n;
|
|
75
|
+
var s = r.displayName || r.name || "";
|
|
76
|
+
return s !== "" ? t + "(" + s + ")" : t;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function fe(e) {
|
|
79
79
|
return e.displayName || "Context";
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function D(e) {
|
|
82
82
|
if (e == null)
|
|
83
83
|
return null;
|
|
84
|
-
if (typeof e.tag == "number" &&
|
|
84
|
+
if (typeof e.tag == "number" && h("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
85
85
|
return e.displayName || e.name || null;
|
|
86
86
|
if (typeof e == "string")
|
|
87
87
|
return e;
|
|
88
88
|
switch (e) {
|
|
89
|
-
case
|
|
89
|
+
case f:
|
|
90
90
|
return "Fragment";
|
|
91
|
-
case
|
|
91
|
+
case c:
|
|
92
92
|
return "Portal";
|
|
93
|
-
case
|
|
93
|
+
case j:
|
|
94
94
|
return "Profiler";
|
|
95
|
-
case
|
|
95
|
+
case _:
|
|
96
96
|
return "StrictMode";
|
|
97
|
-
case
|
|
97
|
+
case k:
|
|
98
98
|
return "Suspense";
|
|
99
|
-
case
|
|
99
|
+
case b:
|
|
100
100
|
return "SuspenseList";
|
|
101
101
|
}
|
|
102
102
|
if (typeof e == "object")
|
|
103
103
|
switch (e.$$typeof) {
|
|
104
|
-
case
|
|
104
|
+
case P:
|
|
105
|
+
var r = e;
|
|
106
|
+
return fe(r) + ".Consumer";
|
|
107
|
+
case I:
|
|
105
108
|
var t = e;
|
|
106
|
-
return
|
|
107
|
-
case
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
return
|
|
112
|
-
case w:
|
|
113
|
-
var
|
|
114
|
-
return o !== null ? o : L(e.type) || "Memo";
|
|
115
|
-
case O: {
|
|
116
|
-
var g = e, h = g._payload, c = g._init;
|
|
109
|
+
return fe(t._context) + ".Provider";
|
|
110
|
+
case v:
|
|
111
|
+
return Je(e, e.render, "ForwardRef");
|
|
112
|
+
case O:
|
|
113
|
+
var n = e.displayName || null;
|
|
114
|
+
return n !== null ? n : D(e.type) || "Memo";
|
|
115
|
+
case w: {
|
|
116
|
+
var s = e, l = s._payload, o = s._init;
|
|
117
117
|
try {
|
|
118
|
-
return
|
|
118
|
+
return D(o(l));
|
|
119
119
|
} catch {
|
|
120
120
|
return null;
|
|
121
121
|
}
|
|
@@ -123,18 +123,18 @@ function Ut() {
|
|
|
123
123
|
}
|
|
124
124
|
return null;
|
|
125
125
|
}
|
|
126
|
-
var
|
|
127
|
-
function
|
|
126
|
+
var N = Object.assign, z = 0, de, ve, ge, he, pe, me, be;
|
|
127
|
+
function _e() {
|
|
128
128
|
}
|
|
129
|
-
|
|
130
|
-
function
|
|
129
|
+
_e.__reactDisabledLog = !0;
|
|
130
|
+
function He() {
|
|
131
131
|
{
|
|
132
|
-
if (
|
|
133
|
-
|
|
132
|
+
if (z === 0) {
|
|
133
|
+
de = console.log, ve = console.info, ge = console.warn, he = console.error, pe = console.group, me = console.groupCollapsed, be = console.groupEnd;
|
|
134
134
|
var e = {
|
|
135
135
|
configurable: !0,
|
|
136
136
|
enumerable: !0,
|
|
137
|
-
value:
|
|
137
|
+
value: _e,
|
|
138
138
|
writable: !0
|
|
139
139
|
};
|
|
140
140
|
Object.defineProperties(console, {
|
|
@@ -147,332 +147,332 @@ function Ut() {
|
|
|
147
147
|
groupEnd: e
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
|
-
|
|
150
|
+
z++;
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function Ge() {
|
|
154
154
|
{
|
|
155
|
-
if (
|
|
155
|
+
if (z--, z === 0) {
|
|
156
156
|
var e = {
|
|
157
157
|
configurable: !0,
|
|
158
158
|
enumerable: !0,
|
|
159
159
|
writable: !0
|
|
160
160
|
};
|
|
161
161
|
Object.defineProperties(console, {
|
|
162
|
-
log:
|
|
163
|
-
value:
|
|
162
|
+
log: N({}, e, {
|
|
163
|
+
value: de
|
|
164
164
|
}),
|
|
165
|
-
info:
|
|
165
|
+
info: N({}, e, {
|
|
166
166
|
value: ve
|
|
167
167
|
}),
|
|
168
|
-
warn:
|
|
169
|
-
value:
|
|
168
|
+
warn: N({}, e, {
|
|
169
|
+
value: ge
|
|
170
170
|
}),
|
|
171
|
-
error:
|
|
172
|
-
value:
|
|
171
|
+
error: N({}, e, {
|
|
172
|
+
value: he
|
|
173
173
|
}),
|
|
174
|
-
group:
|
|
175
|
-
value:
|
|
174
|
+
group: N({}, e, {
|
|
175
|
+
value: pe
|
|
176
176
|
}),
|
|
177
|
-
groupCollapsed:
|
|
178
|
-
value:
|
|
177
|
+
groupCollapsed: N({}, e, {
|
|
178
|
+
value: me
|
|
179
179
|
}),
|
|
180
|
-
groupEnd:
|
|
180
|
+
groupEnd: N({}, e, {
|
|
181
181
|
value: be
|
|
182
182
|
})
|
|
183
183
|
});
|
|
184
184
|
}
|
|
185
|
-
|
|
185
|
+
z < 0 && h("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
var re =
|
|
189
|
-
function
|
|
188
|
+
var re = y.ReactCurrentDispatcher, te;
|
|
189
|
+
function K(e, r, t) {
|
|
190
190
|
{
|
|
191
|
-
if (
|
|
191
|
+
if (te === void 0)
|
|
192
192
|
try {
|
|
193
193
|
throw Error();
|
|
194
|
-
} catch (
|
|
195
|
-
var
|
|
196
|
-
|
|
194
|
+
} catch (s) {
|
|
195
|
+
var n = s.stack.trim().match(/\n( *(at )?)/);
|
|
196
|
+
te = n && n[1] || "";
|
|
197
197
|
}
|
|
198
198
|
return `
|
|
199
|
-
` +
|
|
199
|
+
` + te + e;
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
|
-
var
|
|
202
|
+
var ne = !1, X;
|
|
203
203
|
{
|
|
204
|
-
var
|
|
205
|
-
|
|
204
|
+
var Ke = typeof WeakMap == "function" ? WeakMap : Map;
|
|
205
|
+
X = new Ke();
|
|
206
206
|
}
|
|
207
|
-
function
|
|
208
|
-
if (!e ||
|
|
207
|
+
function ye(e, r) {
|
|
208
|
+
if (!e || ne)
|
|
209
209
|
return "";
|
|
210
210
|
{
|
|
211
|
-
var
|
|
212
|
-
if (
|
|
213
|
-
return
|
|
211
|
+
var t = X.get(e);
|
|
212
|
+
if (t !== void 0)
|
|
213
|
+
return t;
|
|
214
214
|
}
|
|
215
|
-
var
|
|
216
|
-
|
|
217
|
-
var
|
|
215
|
+
var n;
|
|
216
|
+
ne = !0;
|
|
217
|
+
var s = Error.prepareStackTrace;
|
|
218
218
|
Error.prepareStackTrace = void 0;
|
|
219
|
-
var
|
|
220
|
-
|
|
219
|
+
var l;
|
|
220
|
+
l = re.current, re.current = null, He();
|
|
221
221
|
try {
|
|
222
|
-
if (
|
|
223
|
-
var
|
|
222
|
+
if (r) {
|
|
223
|
+
var o = function() {
|
|
224
224
|
throw Error();
|
|
225
225
|
};
|
|
226
|
-
if (Object.defineProperty(
|
|
226
|
+
if (Object.defineProperty(o.prototype, "props", {
|
|
227
227
|
set: function() {
|
|
228
228
|
throw Error();
|
|
229
229
|
}
|
|
230
230
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
231
231
|
try {
|
|
232
|
-
Reflect.construct(
|
|
233
|
-
} catch (
|
|
234
|
-
|
|
232
|
+
Reflect.construct(o, []);
|
|
233
|
+
} catch (R) {
|
|
234
|
+
n = R;
|
|
235
235
|
}
|
|
236
|
-
Reflect.construct(e, [],
|
|
236
|
+
Reflect.construct(e, [], o);
|
|
237
237
|
} else {
|
|
238
238
|
try {
|
|
239
|
-
|
|
240
|
-
} catch (
|
|
241
|
-
|
|
239
|
+
o.call();
|
|
240
|
+
} catch (R) {
|
|
241
|
+
n = R;
|
|
242
242
|
}
|
|
243
|
-
e.call(
|
|
243
|
+
e.call(o.prototype);
|
|
244
244
|
}
|
|
245
245
|
} else {
|
|
246
246
|
try {
|
|
247
247
|
throw Error();
|
|
248
|
-
} catch (
|
|
249
|
-
|
|
248
|
+
} catch (R) {
|
|
249
|
+
n = R;
|
|
250
250
|
}
|
|
251
251
|
e();
|
|
252
252
|
}
|
|
253
|
-
} catch (
|
|
254
|
-
if (
|
|
255
|
-
for (var
|
|
256
|
-
`),
|
|
257
|
-
`),
|
|
258
|
-
|
|
259
|
-
for (;
|
|
260
|
-
if (
|
|
261
|
-
if (
|
|
253
|
+
} catch (R) {
|
|
254
|
+
if (R && n && typeof R.stack == "string") {
|
|
255
|
+
for (var i = R.stack.split(`
|
|
256
|
+
`), E = n.stack.split(`
|
|
257
|
+
`), g = i.length - 1, p = E.length - 1; g >= 1 && p >= 0 && i[g] !== E[p]; )
|
|
258
|
+
p--;
|
|
259
|
+
for (; g >= 1 && p >= 0; g--, p--)
|
|
260
|
+
if (i[g] !== E[p]) {
|
|
261
|
+
if (g !== 1 || p !== 1)
|
|
262
262
|
do
|
|
263
|
-
if (
|
|
264
|
-
var
|
|
265
|
-
` +
|
|
266
|
-
return e.displayName &&
|
|
263
|
+
if (g--, p--, p < 0 || i[g] !== E[p]) {
|
|
264
|
+
var T = `
|
|
265
|
+
` + i[g].replace(" at new ", " at ");
|
|
266
|
+
return e.displayName && T.includes("<anonymous>") && (T = T.replace("<anonymous>", e.displayName)), typeof e == "function" && X.set(e, T), T;
|
|
267
267
|
}
|
|
268
|
-
while (
|
|
268
|
+
while (g >= 1 && p >= 0);
|
|
269
269
|
break;
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
272
|
} finally {
|
|
273
|
-
|
|
273
|
+
ne = !1, re.current = l, Ge(), Error.prepareStackTrace = s;
|
|
274
274
|
}
|
|
275
|
-
var
|
|
276
|
-
return typeof e == "function" &&
|
|
275
|
+
var W = e ? e.displayName || e.name : "", U = W ? K(W) : "";
|
|
276
|
+
return typeof e == "function" && X.set(e, U), U;
|
|
277
277
|
}
|
|
278
|
-
function
|
|
279
|
-
return
|
|
278
|
+
function Xe(e, r, t) {
|
|
279
|
+
return ye(e, !1);
|
|
280
280
|
}
|
|
281
|
-
function
|
|
282
|
-
var
|
|
283
|
-
return !!(
|
|
281
|
+
function Qe(e) {
|
|
282
|
+
var r = e.prototype;
|
|
283
|
+
return !!(r && r.isReactComponent);
|
|
284
284
|
}
|
|
285
|
-
function
|
|
285
|
+
function Q(e, r, t) {
|
|
286
286
|
if (e == null)
|
|
287
287
|
return "";
|
|
288
288
|
if (typeof e == "function")
|
|
289
|
-
return
|
|
289
|
+
return ye(e, Qe(e));
|
|
290
290
|
if (typeof e == "string")
|
|
291
|
-
return
|
|
291
|
+
return K(e);
|
|
292
292
|
switch (e) {
|
|
293
|
-
case
|
|
294
|
-
return
|
|
295
|
-
case
|
|
296
|
-
return
|
|
293
|
+
case k:
|
|
294
|
+
return K("Suspense");
|
|
295
|
+
case b:
|
|
296
|
+
return K("SuspenseList");
|
|
297
297
|
}
|
|
298
298
|
if (typeof e == "object")
|
|
299
299
|
switch (e.$$typeof) {
|
|
300
|
-
case
|
|
301
|
-
return
|
|
302
|
-
case
|
|
303
|
-
return
|
|
304
|
-
case
|
|
305
|
-
var
|
|
300
|
+
case v:
|
|
301
|
+
return Xe(e.render);
|
|
302
|
+
case O:
|
|
303
|
+
return Q(e.type, r, t);
|
|
304
|
+
case w: {
|
|
305
|
+
var n = e, s = n._payload, l = n._init;
|
|
306
306
|
try {
|
|
307
|
-
return
|
|
307
|
+
return Q(l(s), r, t);
|
|
308
308
|
} catch {
|
|
309
309
|
}
|
|
310
310
|
}
|
|
311
311
|
}
|
|
312
312
|
return "";
|
|
313
313
|
}
|
|
314
|
-
var
|
|
315
|
-
function
|
|
314
|
+
var J = Object.prototype.hasOwnProperty, Ee = {}, Re = y.ReactDebugCurrentFrame;
|
|
315
|
+
function Z(e) {
|
|
316
316
|
if (e) {
|
|
317
|
-
var
|
|
318
|
-
|
|
317
|
+
var r = e._owner, t = Q(e.type, e._source, r ? r.type : null);
|
|
318
|
+
Re.setExtraStackFrame(t);
|
|
319
319
|
} else
|
|
320
|
-
|
|
320
|
+
Re.setExtraStackFrame(null);
|
|
321
321
|
}
|
|
322
|
-
function
|
|
322
|
+
function Ze(e, r, t, n, s) {
|
|
323
323
|
{
|
|
324
|
-
var
|
|
325
|
-
for (var
|
|
326
|
-
if (
|
|
327
|
-
var
|
|
324
|
+
var l = Function.call.bind(J);
|
|
325
|
+
for (var o in e)
|
|
326
|
+
if (l(e, o)) {
|
|
327
|
+
var i = void 0;
|
|
328
328
|
try {
|
|
329
|
-
if (typeof e[
|
|
330
|
-
var
|
|
331
|
-
throw
|
|
329
|
+
if (typeof e[o] != "function") {
|
|
330
|
+
var E = Error((n || "React class") + ": " + t + " 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`.");
|
|
331
|
+
throw E.name = "Invariant Violation", E;
|
|
332
332
|
}
|
|
333
|
-
|
|
334
|
-
} catch (
|
|
335
|
-
|
|
333
|
+
i = e[o](r, o, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
334
|
+
} catch (g) {
|
|
335
|
+
i = g;
|
|
336
336
|
}
|
|
337
|
-
|
|
337
|
+
i && !(i instanceof Error) && (Z(s), h("%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).", n || "React class", t, o, typeof i), Z(null)), i instanceof Error && !(i.message in Ee) && (Ee[i.message] = !0, Z(s), h("Failed %s type: %s", t, i.message), Z(null));
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
|
-
var
|
|
342
|
-
function
|
|
343
|
-
return
|
|
341
|
+
var er = Array.isArray;
|
|
342
|
+
function ae(e) {
|
|
343
|
+
return er(e);
|
|
344
344
|
}
|
|
345
|
-
function
|
|
345
|
+
function rr(e) {
|
|
346
346
|
{
|
|
347
|
-
var
|
|
348
|
-
return
|
|
347
|
+
var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
348
|
+
return t;
|
|
349
349
|
}
|
|
350
350
|
}
|
|
351
|
-
function
|
|
351
|
+
function tr(e) {
|
|
352
352
|
try {
|
|
353
|
-
return
|
|
353
|
+
return xe(e), !1;
|
|
354
354
|
} catch {
|
|
355
355
|
return !0;
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
|
-
function
|
|
358
|
+
function xe(e) {
|
|
359
359
|
return "" + e;
|
|
360
360
|
}
|
|
361
|
-
function
|
|
362
|
-
if (
|
|
363
|
-
return
|
|
361
|
+
function Pe(e) {
|
|
362
|
+
if (tr(e))
|
|
363
|
+
return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", rr(e)), xe(e);
|
|
364
364
|
}
|
|
365
|
-
var Ce =
|
|
365
|
+
var Ce = y.ReactCurrentOwner, nr = {
|
|
366
366
|
key: !0,
|
|
367
367
|
ref: !0,
|
|
368
368
|
__self: !0,
|
|
369
369
|
__source: !0
|
|
370
|
-
},
|
|
371
|
-
function
|
|
372
|
-
if (
|
|
373
|
-
var
|
|
374
|
-
if (
|
|
370
|
+
}, Te, Oe;
|
|
371
|
+
function ar(e) {
|
|
372
|
+
if (J.call(e, "ref")) {
|
|
373
|
+
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
374
|
+
if (r && r.isReactWarning)
|
|
375
375
|
return !1;
|
|
376
376
|
}
|
|
377
377
|
return e.ref !== void 0;
|
|
378
378
|
}
|
|
379
|
-
function
|
|
380
|
-
if (
|
|
381
|
-
var
|
|
382
|
-
if (
|
|
379
|
+
function ir(e) {
|
|
380
|
+
if (J.call(e, "key")) {
|
|
381
|
+
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
382
|
+
if (r && r.isReactWarning)
|
|
383
383
|
return !1;
|
|
384
384
|
}
|
|
385
385
|
return e.key !== void 0;
|
|
386
386
|
}
|
|
387
|
-
function
|
|
387
|
+
function or(e, r) {
|
|
388
388
|
typeof e.ref == "string" && Ce.current;
|
|
389
389
|
}
|
|
390
|
-
function
|
|
390
|
+
function sr(e, r) {
|
|
391
391
|
{
|
|
392
|
-
var
|
|
393
|
-
|
|
392
|
+
var t = function() {
|
|
393
|
+
Te || (Te = !0, h("%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)", r));
|
|
394
394
|
};
|
|
395
|
-
|
|
396
|
-
get:
|
|
395
|
+
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
396
|
+
get: t,
|
|
397
397
|
configurable: !0
|
|
398
398
|
});
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
|
-
function
|
|
401
|
+
function ur(e, r) {
|
|
402
402
|
{
|
|
403
|
-
var
|
|
404
|
-
Oe || (Oe = !0,
|
|
403
|
+
var t = function() {
|
|
404
|
+
Oe || (Oe = !0, h("%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)", r));
|
|
405
405
|
};
|
|
406
|
-
|
|
407
|
-
get:
|
|
406
|
+
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
407
|
+
get: t,
|
|
408
408
|
configurable: !0
|
|
409
409
|
});
|
|
410
410
|
}
|
|
411
411
|
}
|
|
412
|
-
var
|
|
413
|
-
var
|
|
412
|
+
var lr = function(e, r, t, n, s, l, o) {
|
|
413
|
+
var i = {
|
|
414
414
|
// This tag allows us to uniquely identify this as a React Element
|
|
415
|
-
$$typeof:
|
|
415
|
+
$$typeof: a,
|
|
416
416
|
// Built-in properties that belong on the element
|
|
417
417
|
type: e,
|
|
418
|
-
key:
|
|
419
|
-
ref:
|
|
420
|
-
props:
|
|
418
|
+
key: r,
|
|
419
|
+
ref: t,
|
|
420
|
+
props: o,
|
|
421
421
|
// Record the component responsible for creating this element.
|
|
422
|
-
_owner:
|
|
422
|
+
_owner: l
|
|
423
423
|
};
|
|
424
|
-
return
|
|
424
|
+
return i._store = {}, Object.defineProperty(i._store, "validated", {
|
|
425
425
|
configurable: !1,
|
|
426
426
|
enumerable: !1,
|
|
427
427
|
writable: !0,
|
|
428
428
|
value: !1
|
|
429
|
-
}), Object.defineProperty(
|
|
429
|
+
}), Object.defineProperty(i, "_self", {
|
|
430
430
|
configurable: !1,
|
|
431
431
|
enumerable: !1,
|
|
432
432
|
writable: !1,
|
|
433
|
-
value:
|
|
434
|
-
}), Object.defineProperty(
|
|
433
|
+
value: n
|
|
434
|
+
}), Object.defineProperty(i, "_source", {
|
|
435
435
|
configurable: !1,
|
|
436
436
|
enumerable: !1,
|
|
437
437
|
writable: !1,
|
|
438
|
-
value:
|
|
439
|
-
}), Object.freeze && (Object.freeze(
|
|
438
|
+
value: s
|
|
439
|
+
}), Object.freeze && (Object.freeze(i.props), Object.freeze(i)), i;
|
|
440
440
|
};
|
|
441
|
-
function
|
|
441
|
+
function cr(e, r, t, n, s) {
|
|
442
442
|
{
|
|
443
|
-
var
|
|
444
|
-
|
|
445
|
-
for (
|
|
446
|
-
|
|
443
|
+
var l, o = {}, i = null, E = null;
|
|
444
|
+
t !== void 0 && (Pe(t), i = "" + t), ir(r) && (Pe(r.key), i = "" + r.key), ar(r) && (E = r.ref, or(r, s));
|
|
445
|
+
for (l in r)
|
|
446
|
+
J.call(r, l) && !nr.hasOwnProperty(l) && (o[l] = r[l]);
|
|
447
447
|
if (e && e.defaultProps) {
|
|
448
|
-
var
|
|
449
|
-
for (
|
|
450
|
-
|
|
448
|
+
var g = e.defaultProps;
|
|
449
|
+
for (l in g)
|
|
450
|
+
o[l] === void 0 && (o[l] = g[l]);
|
|
451
451
|
}
|
|
452
|
-
if (
|
|
453
|
-
var
|
|
454
|
-
|
|
452
|
+
if (i || E) {
|
|
453
|
+
var p = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
454
|
+
i && sr(o, p), E && ur(o, p);
|
|
455
455
|
}
|
|
456
|
-
return
|
|
456
|
+
return lr(e, i, E, s, n, Ce.current, o);
|
|
457
457
|
}
|
|
458
458
|
}
|
|
459
|
-
var
|
|
460
|
-
function
|
|
459
|
+
var ie = y.ReactCurrentOwner, we = y.ReactDebugCurrentFrame;
|
|
460
|
+
function M(e) {
|
|
461
461
|
if (e) {
|
|
462
|
-
var
|
|
463
|
-
|
|
462
|
+
var r = e._owner, t = Q(e.type, e._source, r ? r.type : null);
|
|
463
|
+
we.setExtraStackFrame(t);
|
|
464
464
|
} else
|
|
465
|
-
|
|
465
|
+
we.setExtraStackFrame(null);
|
|
466
466
|
}
|
|
467
467
|
var oe;
|
|
468
468
|
oe = !1;
|
|
469
|
-
function
|
|
470
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
469
|
+
function se(e) {
|
|
470
|
+
return typeof e == "object" && e !== null && e.$$typeof === a;
|
|
471
471
|
}
|
|
472
|
-
function
|
|
472
|
+
function Se() {
|
|
473
473
|
{
|
|
474
|
-
if (
|
|
475
|
-
var e =
|
|
474
|
+
if (ie.current) {
|
|
475
|
+
var e = D(ie.current.type);
|
|
476
476
|
if (e)
|
|
477
477
|
return `
|
|
478
478
|
|
|
@@ -481,154 +481,154 @@ Check the render method of \`` + e + "`.";
|
|
|
481
481
|
return "";
|
|
482
482
|
}
|
|
483
483
|
}
|
|
484
|
-
function
|
|
484
|
+
function fr(e) {
|
|
485
485
|
return "";
|
|
486
486
|
}
|
|
487
487
|
var je = {};
|
|
488
|
-
function
|
|
488
|
+
function dr(e) {
|
|
489
489
|
{
|
|
490
|
-
var
|
|
491
|
-
if (!
|
|
492
|
-
var
|
|
493
|
-
|
|
490
|
+
var r = Se();
|
|
491
|
+
if (!r) {
|
|
492
|
+
var t = typeof e == "string" ? e : e.displayName || e.name;
|
|
493
|
+
t && (r = `
|
|
494
494
|
|
|
495
|
-
Check the top-level render call using <` +
|
|
495
|
+
Check the top-level render call using <` + t + ">.");
|
|
496
496
|
}
|
|
497
|
-
return
|
|
497
|
+
return r;
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
|
-
function
|
|
500
|
+
function Ie(e, r) {
|
|
501
501
|
{
|
|
502
502
|
if (!e._store || e._store.validated || e.key != null)
|
|
503
503
|
return;
|
|
504
504
|
e._store.validated = !0;
|
|
505
|
-
var
|
|
506
|
-
if (je[
|
|
505
|
+
var t = dr(r);
|
|
506
|
+
if (je[t])
|
|
507
507
|
return;
|
|
508
|
-
je[
|
|
509
|
-
var
|
|
510
|
-
e && e._owner && e._owner !==
|
|
508
|
+
je[t] = !0;
|
|
509
|
+
var n = "";
|
|
510
|
+
e && e._owner && e._owner !== ie.current && (n = " It was passed a child from " + D(e._owner.type) + "."), M(e), h('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), M(null);
|
|
511
511
|
}
|
|
512
512
|
}
|
|
513
|
-
function
|
|
513
|
+
function ke(e, r) {
|
|
514
514
|
{
|
|
515
515
|
if (typeof e != "object")
|
|
516
516
|
return;
|
|
517
|
-
if (
|
|
518
|
-
for (var
|
|
519
|
-
var
|
|
520
|
-
|
|
517
|
+
if (ae(e))
|
|
518
|
+
for (var t = 0; t < e.length; t++) {
|
|
519
|
+
var n = e[t];
|
|
520
|
+
se(n) && Ie(n, r);
|
|
521
521
|
}
|
|
522
|
-
else if (
|
|
522
|
+
else if (se(e))
|
|
523
523
|
e._store && (e._store.validated = !0);
|
|
524
524
|
else if (e) {
|
|
525
|
-
var
|
|
526
|
-
if (typeof
|
|
527
|
-
for (var
|
|
528
|
-
|
|
525
|
+
var s = S(e);
|
|
526
|
+
if (typeof s == "function" && s !== e.entries)
|
|
527
|
+
for (var l = s.call(e), o; !(o = l.next()).done; )
|
|
528
|
+
se(o.value) && Ie(o.value, r);
|
|
529
529
|
}
|
|
530
530
|
}
|
|
531
531
|
}
|
|
532
|
-
function
|
|
532
|
+
function vr(e) {
|
|
533
533
|
{
|
|
534
|
-
var
|
|
535
|
-
if (
|
|
534
|
+
var r = e.type;
|
|
535
|
+
if (r == null || typeof r == "string")
|
|
536
536
|
return;
|
|
537
|
-
var
|
|
538
|
-
if (typeof
|
|
539
|
-
|
|
540
|
-
else if (typeof
|
|
537
|
+
var t;
|
|
538
|
+
if (typeof r == "function")
|
|
539
|
+
t = r.propTypes;
|
|
540
|
+
else if (typeof r == "object" && (r.$$typeof === v || // Note: Memo only checks outer props here.
|
|
541
541
|
// Inner props are checked in the reconciler.
|
|
542
|
-
|
|
543
|
-
|
|
542
|
+
r.$$typeof === O))
|
|
543
|
+
t = r.propTypes;
|
|
544
544
|
else
|
|
545
545
|
return;
|
|
546
|
-
if (
|
|
547
|
-
var
|
|
548
|
-
|
|
549
|
-
} else if (
|
|
546
|
+
if (t) {
|
|
547
|
+
var n = D(r);
|
|
548
|
+
Ze(t, e.props, "prop", n, e);
|
|
549
|
+
} else if (r.PropTypes !== void 0 && !oe) {
|
|
550
550
|
oe = !0;
|
|
551
|
-
var
|
|
552
|
-
|
|
551
|
+
var s = D(r);
|
|
552
|
+
h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", s || "Unknown");
|
|
553
553
|
}
|
|
554
|
-
typeof
|
|
554
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
|
-
function
|
|
557
|
+
function gr(e) {
|
|
558
558
|
{
|
|
559
|
-
for (var
|
|
560
|
-
var
|
|
561
|
-
if (
|
|
562
|
-
|
|
559
|
+
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
|
560
|
+
var n = r[t];
|
|
561
|
+
if (n !== "children" && n !== "key") {
|
|
562
|
+
M(e), h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), M(null);
|
|
563
563
|
break;
|
|
564
564
|
}
|
|
565
565
|
}
|
|
566
|
-
e.ref !== null && (
|
|
566
|
+
e.ref !== null && (M(e), h("Invalid attribute `ref` supplied to `React.Fragment`."), M(null));
|
|
567
567
|
}
|
|
568
568
|
}
|
|
569
569
|
var De = {};
|
|
570
|
-
function
|
|
570
|
+
function Ae(e, r, t, n, s, l) {
|
|
571
571
|
{
|
|
572
|
-
var
|
|
573
|
-
if (!
|
|
574
|
-
var
|
|
575
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (
|
|
576
|
-
var
|
|
577
|
-
|
|
578
|
-
var
|
|
579
|
-
e === null ?
|
|
572
|
+
var o = ze(e);
|
|
573
|
+
if (!o) {
|
|
574
|
+
var i = "";
|
|
575
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (i += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
576
|
+
var E = fr();
|
|
577
|
+
E ? i += E : i += Se();
|
|
578
|
+
var g;
|
|
579
|
+
e === null ? g = "null" : ae(e) ? g = "array" : e !== void 0 && e.$$typeof === a ? (g = "<" + (D(e.type) || "Unknown") + " />", i = " Did you accidentally export a JSX literal instead of a component?") : g = typeof e, h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", g, i);
|
|
580
580
|
}
|
|
581
|
-
var
|
|
582
|
-
if (
|
|
583
|
-
return
|
|
584
|
-
if (
|
|
585
|
-
var
|
|
586
|
-
if (
|
|
587
|
-
if (
|
|
588
|
-
if (
|
|
589
|
-
for (var
|
|
590
|
-
|
|
591
|
-
Object.freeze && Object.freeze(
|
|
581
|
+
var p = cr(e, r, t, s, l);
|
|
582
|
+
if (p == null)
|
|
583
|
+
return p;
|
|
584
|
+
if (o) {
|
|
585
|
+
var T = r.children;
|
|
586
|
+
if (T !== void 0)
|
|
587
|
+
if (n)
|
|
588
|
+
if (ae(T)) {
|
|
589
|
+
for (var W = 0; W < T.length; W++)
|
|
590
|
+
ke(T[W], e);
|
|
591
|
+
Object.freeze && Object.freeze(T);
|
|
592
592
|
} else
|
|
593
|
-
|
|
593
|
+
h("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
594
594
|
else
|
|
595
|
-
|
|
595
|
+
ke(T, e);
|
|
596
596
|
}
|
|
597
|
-
if (
|
|
598
|
-
var U =
|
|
599
|
-
return
|
|
600
|
-
}),
|
|
601
|
-
if (!De[U +
|
|
602
|
-
var
|
|
603
|
-
|
|
597
|
+
if (J.call(r, "key")) {
|
|
598
|
+
var U = D(e), R = Object.keys(r).filter(function(yr) {
|
|
599
|
+
return yr !== "key";
|
|
600
|
+
}), ue = R.length > 0 ? "{key: someKey, " + R.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
601
|
+
if (!De[U + ue]) {
|
|
602
|
+
var _r = R.length > 0 ? "{" + R.join(": ..., ") + ": ...}" : "{}";
|
|
603
|
+
h(`A props object containing a "key" prop is being spread into JSX:
|
|
604
604
|
let props = %s;
|
|
605
605
|
<%s {...props} />
|
|
606
606
|
React keys must be passed directly to JSX without using spread:
|
|
607
607
|
let props = %s;
|
|
608
|
-
<%s key={someKey} {...props} />`,
|
|
608
|
+
<%s key={someKey} {...props} />`, ue, U, _r, U), De[U + ue] = !0;
|
|
609
609
|
}
|
|
610
610
|
}
|
|
611
|
-
return e ===
|
|
611
|
+
return e === f ? gr(p) : vr(p), p;
|
|
612
612
|
}
|
|
613
613
|
}
|
|
614
|
-
function
|
|
615
|
-
return
|
|
614
|
+
function hr(e, r, t) {
|
|
615
|
+
return Ae(e, r, t, !0);
|
|
616
616
|
}
|
|
617
|
-
function
|
|
618
|
-
return
|
|
617
|
+
function pr(e, r, t) {
|
|
618
|
+
return Ae(e, r, t, !1);
|
|
619
619
|
}
|
|
620
|
-
var
|
|
621
|
-
|
|
622
|
-
})()),
|
|
620
|
+
var mr = pr, br = hr;
|
|
621
|
+
G.Fragment = f, G.jsx = mr, G.jsxs = br;
|
|
622
|
+
})()), G;
|
|
623
623
|
}
|
|
624
|
-
var
|
|
625
|
-
function
|
|
626
|
-
return
|
|
624
|
+
var Ne;
|
|
625
|
+
function Ir() {
|
|
626
|
+
return Ne || (Ne = 1, process.env.NODE_ENV === "production" ? ee.exports = Sr() : ee.exports = jr()), ee.exports;
|
|
627
627
|
}
|
|
628
|
-
var
|
|
629
|
-
const
|
|
630
|
-
/* @__PURE__ */
|
|
631
|
-
/* @__PURE__ */
|
|
628
|
+
var d = Ir();
|
|
629
|
+
const kr = ({ error: u }) => /* @__PURE__ */ d.jsx("div", { className: "plugin-error", children: /* @__PURE__ */ d.jsxs("div", { className: "plugin-error__container", children: [
|
|
630
|
+
/* @__PURE__ */ d.jsxs("div", { className: "plugin-error__header", children: [
|
|
631
|
+
/* @__PURE__ */ d.jsxs(
|
|
632
632
|
"svg",
|
|
633
633
|
{
|
|
634
634
|
className: "plugin-error__icon",
|
|
@@ -637,8 +637,8 @@ const Ft = ({ error: s }) => /* @__PURE__ */ E.jsx("div", { className: "plugin-e
|
|
|
637
637
|
viewBox: "0 0 24 24",
|
|
638
638
|
fill: "none",
|
|
639
639
|
children: [
|
|
640
|
-
/* @__PURE__ */
|
|
641
|
-
/* @__PURE__ */
|
|
640
|
+
/* @__PURE__ */ d.jsx("circle", { cx: "12", cy: "12", r: "10", fill: "#f44336" }),
|
|
641
|
+
/* @__PURE__ */ d.jsx(
|
|
642
642
|
"path",
|
|
643
643
|
{
|
|
644
644
|
d: "M12 7v6m0 4h.01",
|
|
@@ -650,549 +650,242 @@ const Ft = ({ error: s }) => /* @__PURE__ */ E.jsx("div", { className: "plugin-e
|
|
|
650
650
|
]
|
|
651
651
|
}
|
|
652
652
|
),
|
|
653
|
-
/* @__PURE__ */
|
|
653
|
+
/* @__PURE__ */ d.jsx("h3", { className: "plugin-error__title", children: "Ошибка инициализации плагина" })
|
|
654
654
|
] }),
|
|
655
|
-
/* @__PURE__ */
|
|
656
|
-
/* @__PURE__ */
|
|
657
|
-
/* @__PURE__ */
|
|
658
|
-
/* @__PURE__ */
|
|
659
|
-
|
|
660
|
-
|
|
655
|
+
/* @__PURE__ */ d.jsx("div", { className: "plugin-error__message", children: "Не удалось инициализировать плагин. Проверьте параметры запуска и попробуйте перезагрузить страницу." }),
|
|
656
|
+
/* @__PURE__ */ d.jsxs("details", { className: "plugin-error__details", children: [
|
|
657
|
+
/* @__PURE__ */ d.jsx("summary", { className: "plugin-error__summary", children: "Детали ошибки" }),
|
|
658
|
+
/* @__PURE__ */ d.jsxs("pre", { className: "plugin-error__stack", children: [
|
|
659
|
+
u.message,
|
|
660
|
+
u.stack && `
|
|
661
661
|
|
|
662
|
-
${
|
|
662
|
+
${u.stack}`
|
|
663
663
|
] })
|
|
664
664
|
] })
|
|
665
|
-
] }) }),
|
|
666
|
-
/* @__PURE__ */
|
|
667
|
-
/* @__PURE__ */
|
|
668
|
-
] }) }),
|
|
669
|
-
function
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
return () => {
|
|
680
|
-
a.delete(i), a.size === 0 && Z.delete(s);
|
|
681
|
-
};
|
|
682
|
-
}
|
|
683
|
-
function qt(s) {
|
|
684
|
-
const r = s.method;
|
|
685
|
-
ce.set(r, s.result);
|
|
686
|
-
const a = Z.get(r);
|
|
687
|
-
if (a)
|
|
688
|
-
for (const i of a)
|
|
689
|
-
try {
|
|
690
|
-
i(s.result);
|
|
691
|
-
} catch (u) {
|
|
692
|
-
console.error(`[EventBus] Error in subscriber for "${s.method}":`, u);
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
const $t = {};
|
|
696
|
-
function Ht(s) {
|
|
697
|
-
return $t[s];
|
|
698
|
-
}
|
|
699
|
-
const qe = 6666;
|
|
700
|
-
class $e extends Error {
|
|
701
|
-
constructor(r, a, i) {
|
|
702
|
-
super(a), this.name = "PluginActionError", this.code = r, this.errorData = i;
|
|
703
|
-
}
|
|
704
|
-
}
|
|
705
|
-
class Yt {
|
|
706
|
-
constructor(r, a, i, u, d, m) {
|
|
707
|
-
this.pendingRequests = /* @__PURE__ */ new Map(), this.messageListener = null, this.requestTimeout = 1e4, this.pluginId = r, this.elementId = a, this.targetOrigin = d, this.entityId = u, this.entityMeta = m, this.slot = i, this.initListener();
|
|
708
|
-
}
|
|
709
|
-
request(r, a, i) {
|
|
710
|
-
return new Promise((u, d) => {
|
|
711
|
-
const m = this.generateMessageId(), p = i?.timeout ?? this.requestTimeout, f = {
|
|
712
|
-
messageId: m,
|
|
713
|
-
method: r,
|
|
714
|
-
payload: a
|
|
715
|
-
}, y = setTimeout(() => {
|
|
716
|
-
this.pendingRequests.get(m) && (this.pendingRequests.delete(m), d(new Error(`Request timeout: ${r} exceeded ${p}ms`)));
|
|
717
|
-
}, p);
|
|
718
|
-
this.pendingRequests.set(m, { resolve: u, reject: d, timeoutId: y });
|
|
719
|
-
try {
|
|
720
|
-
this.send(f);
|
|
721
|
-
} catch (v) {
|
|
722
|
-
clearTimeout(y), this.pendingRequests.delete(m), d(v);
|
|
723
|
-
}
|
|
724
|
-
});
|
|
725
|
-
}
|
|
726
|
-
send(r) {
|
|
727
|
-
window.parent.postMessage(
|
|
728
|
-
{
|
|
729
|
-
pluginId: this.pluginId,
|
|
730
|
-
elementId: this.elementId,
|
|
731
|
-
slot: this.slot,
|
|
732
|
-
entityId: this.entityId,
|
|
733
|
-
entityMeta: this.entityMeta,
|
|
734
|
-
...r
|
|
735
|
-
},
|
|
736
|
-
this.targetOrigin
|
|
737
|
-
);
|
|
738
|
-
}
|
|
739
|
-
destroy() {
|
|
740
|
-
this.messageListener && (window.removeEventListener("message", this.messageListener), this.messageListener = null), this.pendingRequests.forEach((r) => {
|
|
741
|
-
clearTimeout(r.timeoutId);
|
|
742
|
-
}), this.pendingRequests.clear();
|
|
743
|
-
}
|
|
744
|
-
initListener() {
|
|
745
|
-
this.messageListener = async (r) => {
|
|
746
|
-
if (r.origin !== this.targetOrigin) {
|
|
747
|
-
console.info(
|
|
748
|
-
"[Bridge] Ignored message from origin:",
|
|
749
|
-
r.origin,
|
|
750
|
-
"(expected:",
|
|
751
|
-
this.targetOrigin,
|
|
752
|
-
")"
|
|
753
|
-
);
|
|
754
|
-
return;
|
|
755
|
-
}
|
|
756
|
-
const a = r.data;
|
|
757
|
-
if (console.info("[Bridge] Received message:", a), a.type === "event") {
|
|
758
|
-
console.info("[Bridge] Dispatching host event:", a.method, a.result), qt(a);
|
|
759
|
-
return;
|
|
760
|
-
}
|
|
761
|
-
if (console.info("[Bridge] Received message:", r.data), !a.messageId) {
|
|
762
|
-
console.info("[Bridge] Ignored message without messageId:", a);
|
|
763
|
-
return;
|
|
764
|
-
}
|
|
765
|
-
const i = a, u = this.pendingRequests.get(i.messageId);
|
|
766
|
-
if (!u) {
|
|
767
|
-
if (i.type === "request") {
|
|
768
|
-
const p = i.result.method, f = Ht(p);
|
|
769
|
-
if (!f) {
|
|
770
|
-
this.send({
|
|
771
|
-
messageId: i.messageId,
|
|
772
|
-
type: "response",
|
|
773
|
-
result: null,
|
|
774
|
-
errorCode: qe,
|
|
775
|
-
error: `No handler for method ${p}`
|
|
776
|
-
});
|
|
777
|
-
return;
|
|
778
|
-
}
|
|
779
|
-
try {
|
|
780
|
-
const y = f();
|
|
781
|
-
this.send({
|
|
782
|
-
messageId: i.messageId,
|
|
783
|
-
payload: y,
|
|
784
|
-
method: "responseData",
|
|
785
|
-
type: "response"
|
|
786
|
-
});
|
|
787
|
-
} catch (y) {
|
|
788
|
-
const v = y instanceof Error ? y : new Error(String(y)), w = v instanceof $e ? v.code : qe;
|
|
789
|
-
this.send({
|
|
790
|
-
messageId: i.messageId,
|
|
791
|
-
type: "response",
|
|
792
|
-
result: null,
|
|
793
|
-
errorCode: w,
|
|
794
|
-
error: v.message
|
|
795
|
-
});
|
|
796
|
-
}
|
|
797
|
-
}
|
|
798
|
-
return;
|
|
799
|
-
}
|
|
800
|
-
clearTimeout(u.timeoutId), this.pendingRequests.delete(i.messageId);
|
|
801
|
-
const d = i;
|
|
802
|
-
d.type === "response" && d.errorCode ? u.reject(
|
|
803
|
-
new $e(
|
|
804
|
-
d.errorCode,
|
|
805
|
-
d.error ?? "Unknown error",
|
|
806
|
-
d.errorData
|
|
807
|
-
)
|
|
808
|
-
) : u.resolve(d.result);
|
|
809
|
-
}, window.addEventListener("message", this.messageListener);
|
|
810
|
-
}
|
|
811
|
-
generateMessageId() {
|
|
812
|
-
return crypto.randomUUID();
|
|
813
|
-
}
|
|
814
|
-
}
|
|
815
|
-
let $ = null;
|
|
816
|
-
function Bt(s, r, a, i, u, d) {
|
|
817
|
-
return $ && $.destroy(), $ = new Yt(
|
|
818
|
-
s,
|
|
819
|
-
r,
|
|
820
|
-
a,
|
|
821
|
-
i,
|
|
822
|
-
u,
|
|
823
|
-
d
|
|
824
|
-
), $;
|
|
825
|
-
}
|
|
826
|
-
function Wt() {
|
|
827
|
-
if (!$)
|
|
828
|
-
throw new Error("Bridge not initialized. Call initBridge first.");
|
|
829
|
-
return $;
|
|
665
|
+
] }) }), Ue = kr, Dr = () => /* @__PURE__ */ d.jsx("div", { className: "plugin-loader", children: /* @__PURE__ */ d.jsxs("div", { className: "plugin-loader__content", children: [
|
|
666
|
+
/* @__PURE__ */ d.jsx("div", { className: "plugin-loader__spinner" }),
|
|
667
|
+
/* @__PURE__ */ d.jsx("div", { className: "plugin-loader__text", children: "Загрузка плагина..." })
|
|
668
|
+
] }) }), qr = Dr;
|
|
669
|
+
function Ar() {
|
|
670
|
+
const [u, a] = A(() => {
|
|
671
|
+
let c;
|
|
672
|
+
return q("context.changed", (_) => {
|
|
673
|
+
c = _;
|
|
674
|
+
})(), c;
|
|
675
|
+
});
|
|
676
|
+
return Y(() => q("context.changed", (f) => {
|
|
677
|
+
a(f);
|
|
678
|
+
}), []), u;
|
|
830
679
|
}
|
|
831
|
-
function
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
const Vt = 3e5;
|
|
835
|
-
class Jt {
|
|
836
|
-
show(r) {
|
|
837
|
-
return j("confirm.show", r, {
|
|
838
|
-
timeout: Vt
|
|
839
|
-
});
|
|
840
|
-
}
|
|
841
|
-
}
|
|
842
|
-
class Kt {
|
|
843
|
-
constructor() {
|
|
844
|
-
this.callbackMap = /* @__PURE__ */ new Map(), this.toastActionIds = /* @__PURE__ */ new Map(), this.eventSubscribed = !1;
|
|
845
|
-
}
|
|
846
|
-
async add(r) {
|
|
847
|
-
this.ensureEventSubscription();
|
|
848
|
-
const a = [], i = r.actions?.map((m) => {
|
|
849
|
-
const p = crypto.randomUUID();
|
|
850
|
-
return this.callbackMap.set(p, m.onClick), a.push(p), { id: p, label: m.label };
|
|
851
|
-
}), u = await j("toast.add", {
|
|
852
|
-
name: r.name,
|
|
853
|
-
title: r.title,
|
|
854
|
-
content: r.content,
|
|
855
|
-
theme: r.theme,
|
|
856
|
-
autoHiding: r.autoHiding,
|
|
857
|
-
isClosable: r.isClosable,
|
|
858
|
-
actions: i
|
|
859
|
-
});
|
|
860
|
-
a.length > 0 && this.toastActionIds.set(u.name, a);
|
|
861
|
-
const d = r.autoHiding ?? 5e3;
|
|
862
|
-
return setTimeout(() => this.cleanupCallbacksForToast(u.name), d + 1e3), u;
|
|
863
|
-
}
|
|
864
|
-
ensureEventSubscription() {
|
|
865
|
-
this.eventSubscribed || (this.eventSubscribed = !0, de("toast.action.clicked", ({ name: r, actionId: a }) => {
|
|
866
|
-
this.callbackMap.get(a)?.(), this.cleanupCallbacksForToast(r);
|
|
867
|
-
}));
|
|
868
|
-
}
|
|
869
|
-
cleanupCallbacksForToast(r) {
|
|
870
|
-
const a = this.toastActionIds.get(r);
|
|
871
|
-
if (a) {
|
|
872
|
-
for (const i of a)
|
|
873
|
-
this.callbackMap.delete(i);
|
|
874
|
-
this.toastActionIds.delete(r);
|
|
875
|
-
}
|
|
876
|
-
}
|
|
877
|
-
}
|
|
878
|
-
class Gt {
|
|
879
|
-
constructor() {
|
|
880
|
-
this.toaster = new Kt(), this.confirm = new Jt();
|
|
881
|
-
}
|
|
882
|
-
}
|
|
883
|
-
const Be = new Gt();
|
|
884
|
-
function Xt(s, r, a = "ru") {
|
|
885
|
-
if (typeof s == "string")
|
|
886
|
-
return s;
|
|
887
|
-
const i = (r ?? a).toLowerCase(), u = a.toLowerCase();
|
|
888
|
-
return s[i] || s[u] || s.ru || s.en || "";
|
|
889
|
-
}
|
|
890
|
-
class Qt {
|
|
891
|
-
constructor(r) {
|
|
892
|
-
this.lastHeight = 0, this.isUpdating = !1, this.consecutiveSmallIncreases = 0, this.MAX_CONSECUTIVE_SMALL_INCREASES = 5, this.SMALL_INCREASE_THRESHOLD_PX = 10, this.resizeCallback = r;
|
|
893
|
-
}
|
|
894
|
-
enable() {
|
|
895
|
-
if (!document.body) {
|
|
896
|
-
console.error("[AutoResize] document.body does not exist yet");
|
|
897
|
-
return;
|
|
898
|
-
}
|
|
899
|
-
const r = async () => {
|
|
900
|
-
if (this.isUpdating)
|
|
901
|
-
return;
|
|
902
|
-
const i = document.getElementById("root"), u = window.getComputedStyle(document.body), d = parseInt(u.marginTop, 10) || 0, m = parseInt(u.marginBottom, 10) || 0, f = Math.max(
|
|
903
|
-
document.body.scrollHeight,
|
|
904
|
-
document.body.offsetHeight,
|
|
905
|
-
i ? i.scrollHeight + d + m : 0
|
|
906
|
-
) + 4;
|
|
907
|
-
if (f !== this.lastHeight) {
|
|
908
|
-
if (f > this.lastHeight)
|
|
909
|
-
if (f - this.lastHeight <= this.SMALL_INCREASE_THRESHOLD_PX) {
|
|
910
|
-
if (this.consecutiveSmallIncreases++, this.consecutiveSmallIncreases > this.MAX_CONSECUTIVE_SMALL_INCREASES) {
|
|
911
|
-
console.warn(
|
|
912
|
-
"[AutoResize] Infinite loop detected. Stopping auto-resize. This may be caused by elements with viewport-relative units (vh, %)."
|
|
913
|
-
), this.disable();
|
|
914
|
-
return;
|
|
915
|
-
}
|
|
916
|
-
} else
|
|
917
|
-
this.consecutiveSmallIncreases = 0;
|
|
918
|
-
else
|
|
919
|
-
this.consecutiveSmallIncreases = 0;
|
|
920
|
-
this.isUpdating = !0, this.lastHeight = f;
|
|
921
|
-
try {
|
|
922
|
-
await this.resizeCallback(f);
|
|
923
|
-
} catch (y) {
|
|
924
|
-
console.error("[AutoResize] Failed to update content size:", y);
|
|
925
|
-
} finally {
|
|
926
|
-
this.isUpdating = !1;
|
|
927
|
-
}
|
|
928
|
-
}
|
|
929
|
-
}, a = () => {
|
|
930
|
-
clearTimeout(this.resizeTimeout), this.resizeTimeout = setTimeout(r, 100);
|
|
931
|
-
};
|
|
932
|
-
this.resizeObserver = new ResizeObserver(a), this.resizeObserver.observe(document.body), r();
|
|
933
|
-
}
|
|
934
|
-
disable() {
|
|
935
|
-
this.resizeObserver?.disconnect(), clearTimeout(this.resizeTimeout), this.isUpdating = !1, this.consecutiveSmallIncreases = 0;
|
|
936
|
-
}
|
|
937
|
-
}
|
|
938
|
-
class Zt {
|
|
939
|
-
constructor() {
|
|
940
|
-
this.slot = null, this.service = null, this.origin = null, this.innerUrl = null, this.queryParams = null;
|
|
941
|
-
}
|
|
942
|
-
getTheme() {
|
|
943
|
-
return j("theme.get");
|
|
944
|
-
}
|
|
945
|
-
getLanguage() {
|
|
946
|
-
return j("language.get");
|
|
947
|
-
}
|
|
948
|
-
getUserId() {
|
|
949
|
-
return j("userId.get");
|
|
950
|
-
}
|
|
951
|
-
getIsYateam() {
|
|
952
|
-
return j("isYateam.get");
|
|
953
|
-
}
|
|
954
|
-
getContext() {
|
|
955
|
-
return j("context.get");
|
|
956
|
-
}
|
|
957
|
-
updateContentSize(r) {
|
|
958
|
-
return j("contentSize.update", r);
|
|
959
|
-
}
|
|
960
|
-
notifyReady() {
|
|
961
|
-
return j("plugin.ready");
|
|
962
|
-
}
|
|
963
|
-
close(r) {
|
|
964
|
-
return j("plugin.close", r);
|
|
965
|
-
}
|
|
966
|
-
navigate(r) {
|
|
967
|
-
return j("navigate", r);
|
|
968
|
-
}
|
|
969
|
-
init(r) {
|
|
970
|
-
const { autoResize: a = !0 } = r, i = new URLSearchParams(location.search);
|
|
971
|
-
if (this.service = i.get("service"), this.service === null)
|
|
972
|
-
throw new Error("Service is not defined");
|
|
973
|
-
const u = i.get("slot");
|
|
974
|
-
if (!u)
|
|
975
|
-
throw new Error("Slot is not defined");
|
|
976
|
-
const d = i.get("parentOrigin");
|
|
977
|
-
if (!d)
|
|
978
|
-
throw new Error("Target origin is not defined");
|
|
979
|
-
const m = i.get("id");
|
|
980
|
-
if (!m)
|
|
981
|
-
throw new Error("Plugin id is not defined");
|
|
982
|
-
const p = i.get("elementId");
|
|
983
|
-
if (!p)
|
|
984
|
-
throw new Error("Element id is not defined");
|
|
985
|
-
const f = i.get("entityId"), y = i.get("entityMeta"), v = y ? JSON.parse(y) : void 0;
|
|
986
|
-
Bt(m, p, u, f, d, v), this.slot = u, this.origin = d, this.innerUrl = i.get("innerUrl") ?? "";
|
|
987
|
-
const w = i.get("queryParams");
|
|
988
|
-
this.queryParams = w ? JSON.parse(decodeURIComponent(w)) : {}, a && (this.autoResizeManager = new Qt(
|
|
989
|
-
(O) => this.updateContentSize({ height: O })
|
|
990
|
-
), this.autoResizeManager.enable());
|
|
991
|
-
}
|
|
992
|
-
getSlot() {
|
|
993
|
-
if (this.slot === null)
|
|
994
|
-
throw new Error("Plugin not initialized. Call init() first.");
|
|
995
|
-
return this.slot;
|
|
996
|
-
}
|
|
997
|
-
getService() {
|
|
998
|
-
if (this.service === null)
|
|
999
|
-
throw new Error("Service not initialized. Call init() first.");
|
|
1000
|
-
return this.service;
|
|
1001
|
-
}
|
|
1002
|
-
getOrigin() {
|
|
1003
|
-
if (this.origin === null)
|
|
1004
|
-
throw new Error("Origin not initialized. Call init() first.");
|
|
1005
|
-
return this.origin;
|
|
1006
|
-
}
|
|
1007
|
-
getInnerUrl() {
|
|
1008
|
-
if (this.innerUrl === null)
|
|
1009
|
-
throw new Error("Plugin not initialized. Call init() first.");
|
|
1010
|
-
return this.innerUrl;
|
|
1011
|
-
}
|
|
1012
|
-
getQueryParams() {
|
|
1013
|
-
if (this.queryParams === null)
|
|
1014
|
-
throw new Error("Plugin not initialized. Call init() first.");
|
|
1015
|
-
return this.queryParams;
|
|
1016
|
-
}
|
|
1017
|
-
disableAutoResize() {
|
|
1018
|
-
this.autoResizeManager?.disable();
|
|
1019
|
-
}
|
|
1020
|
-
}
|
|
1021
|
-
const We = new Zt(), er = () => ({ show: Ye((r) => Be.confirm.show(r), []) }), dr = er;
|
|
1022
|
-
function tr() {
|
|
1023
|
-
const [s, r] = D(void 0);
|
|
1024
|
-
return N(() => {
|
|
680
|
+
function Lr() {
|
|
681
|
+
const [u, a] = A(void 0);
|
|
682
|
+
return Y(() => {
|
|
1025
683
|
(async () => {
|
|
1026
|
-
const
|
|
1027
|
-
|
|
684
|
+
const f = await m.getIsYateam();
|
|
685
|
+
a(f);
|
|
1028
686
|
})();
|
|
1029
|
-
}, []),
|
|
687
|
+
}, []), u;
|
|
1030
688
|
}
|
|
1031
|
-
function
|
|
1032
|
-
const [
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
689
|
+
function Me() {
|
|
690
|
+
const [u, a] = A(() => {
|
|
691
|
+
let c;
|
|
692
|
+
return q("language.changed", (_) => {
|
|
693
|
+
c = _;
|
|
694
|
+
})(), c;
|
|
695
|
+
});
|
|
696
|
+
return Y(() => q("language.changed", (f) => {
|
|
697
|
+
a(f);
|
|
698
|
+
}), []), u;
|
|
1036
699
|
}
|
|
1037
|
-
|
|
1038
|
-
const
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
700
|
+
function Fr() {
|
|
701
|
+
const [u, a] = A(() => {
|
|
702
|
+
let c;
|
|
703
|
+
return q("theme.changed", (_) => {
|
|
704
|
+
c = _;
|
|
705
|
+
})(), c;
|
|
706
|
+
});
|
|
707
|
+
return Y(() => q("theme.changed", (f) => {
|
|
708
|
+
a(f);
|
|
709
|
+
}), []), u;
|
|
1046
710
|
}
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
return N(() => {
|
|
711
|
+
function Nr() {
|
|
712
|
+
const [u, a] = A(void 0);
|
|
713
|
+
return Y(() => {
|
|
1051
714
|
(async () => {
|
|
1052
|
-
const
|
|
1053
|
-
|
|
715
|
+
const f = await m.getUserId();
|
|
716
|
+
a(f);
|
|
1054
717
|
})();
|
|
1055
|
-
}, []),
|
|
1056
|
-
}
|
|
1057
|
-
function ar() {
|
|
1058
|
-
const [s, r] = D(void 0);
|
|
1059
|
-
return N(() => At("context.changed", (i) => {
|
|
1060
|
-
r(i);
|
|
1061
|
-
}), []), s;
|
|
718
|
+
}, []), u;
|
|
1062
719
|
}
|
|
1063
|
-
const
|
|
1064
|
-
function
|
|
1065
|
-
const
|
|
1066
|
-
if (!
|
|
1067
|
-
throw new Error("
|
|
1068
|
-
|
|
720
|
+
const We = Rr(null);
|
|
721
|
+
function Br(u = "basic") {
|
|
722
|
+
const a = Cr(We);
|
|
723
|
+
if (!a)
|
|
724
|
+
throw new Error("usePluginContext must be used within PluginProvider");
|
|
725
|
+
if (u === "full" && a.contextLevel !== "full")
|
|
726
|
+
throw new Error(
|
|
727
|
+
"🛑 [Security] Code requests 'full' context, but manifest declares 'basic'. Change the contextLevel in your manifest to get full access."
|
|
728
|
+
);
|
|
729
|
+
const c = Fr(), f = Me(), _ = Lr(), j = Nr(), I = Ar(), P = {
|
|
730
|
+
service: m.getService(),
|
|
731
|
+
origin: m.getOrigin(),
|
|
732
|
+
slot: a.slot,
|
|
733
|
+
innerUrl: a.innerUrl,
|
|
734
|
+
queryParams: a.queryParams,
|
|
735
|
+
registerHandler: a.registerHandler,
|
|
736
|
+
theme: c,
|
|
737
|
+
language: f,
|
|
738
|
+
isYateam: _,
|
|
739
|
+
userId: j
|
|
740
|
+
};
|
|
741
|
+
if (u === "basic") {
|
|
742
|
+
const v = a.entityId ? { entityId: a.entityId, ...a.entityMeta ? { entityMeta: a.entityMeta } : {} } : void 0;
|
|
743
|
+
return {
|
|
744
|
+
...P,
|
|
745
|
+
contextLevel: "basic",
|
|
746
|
+
slotContext: v
|
|
747
|
+
};
|
|
748
|
+
}
|
|
1069
749
|
return {
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
innerUrl: s.innerUrl,
|
|
1074
|
-
queryParams: s.queryParams,
|
|
1075
|
-
registerHandler: s.registerHandler,
|
|
1076
|
-
theme: r,
|
|
1077
|
-
language: a,
|
|
1078
|
-
slotContext: d,
|
|
1079
|
-
isYateam: i,
|
|
1080
|
-
userId: u
|
|
750
|
+
...P,
|
|
751
|
+
contextLevel: "full",
|
|
752
|
+
slotContext: I
|
|
1081
753
|
};
|
|
1082
754
|
}
|
|
1083
|
-
const
|
|
755
|
+
const Ur = (u) => {
|
|
1084
756
|
try {
|
|
1085
|
-
return new URL(
|
|
757
|
+
return new URL(u, window.location.href).origin === window.location.origin;
|
|
1086
758
|
} catch {
|
|
1087
759
|
return !0;
|
|
1088
760
|
}
|
|
1089
761
|
};
|
|
1090
|
-
function
|
|
1091
|
-
children:
|
|
1092
|
-
autoResize:
|
|
1093
|
-
fallback:
|
|
1094
|
-
errorFallback:
|
|
1095
|
-
autoNotifyReady:
|
|
762
|
+
function zr({
|
|
763
|
+
children: u,
|
|
764
|
+
autoResize: a = !0,
|
|
765
|
+
fallback: c,
|
|
766
|
+
errorFallback: f,
|
|
767
|
+
autoNotifyReady: _ = !0
|
|
1096
768
|
}) {
|
|
1097
|
-
const
|
|
1098
|
-
return
|
|
1099
|
-
const
|
|
1100
|
-
const
|
|
1101
|
-
if (!
|
|
1102
|
-
const
|
|
1103
|
-
if (!
|
|
769
|
+
const j = xr(!1), [I, P] = A(!1), [v, k] = A(null), [b, O] = A(null), w = Pr(() => (C, x) => Tr(C, x), []);
|
|
770
|
+
return Y(() => {
|
|
771
|
+
const C = (x) => {
|
|
772
|
+
const S = x.target.closest("[href], [data-href]");
|
|
773
|
+
if (!S) return;
|
|
774
|
+
const y = S.getAttribute("href") || S.getAttribute("data-href");
|
|
775
|
+
if (!y || Ur(y))
|
|
1104
776
|
return;
|
|
1105
|
-
|
|
1106
|
-
const
|
|
1107
|
-
|
|
1108
|
-
path:
|
|
777
|
+
x.preventDefault();
|
|
778
|
+
const L = S.getAttribute("target") === "_blank";
|
|
779
|
+
le.navigate({
|
|
780
|
+
path: y,
|
|
1109
781
|
options: {
|
|
1110
|
-
newTab:
|
|
782
|
+
newTab: L
|
|
1111
783
|
}
|
|
1112
784
|
}).then(() => {
|
|
1113
|
-
console.info(`Navigation: ${
|
|
1114
|
-
}).catch((
|
|
1115
|
-
console.error("Navigation error:",
|
|
785
|
+
console.info(`Navigation: ${y}`);
|
|
786
|
+
}).catch((F) => {
|
|
787
|
+
console.error("Navigation error:", F);
|
|
1116
788
|
});
|
|
1117
789
|
};
|
|
1118
|
-
return document.addEventListener("click",
|
|
1119
|
-
document.removeEventListener("click",
|
|
790
|
+
return document.addEventListener("click", C), () => {
|
|
791
|
+
document.removeEventListener("click", C);
|
|
1120
792
|
};
|
|
1121
|
-
}, []),
|
|
1122
|
-
if (
|
|
793
|
+
}, []), Y(() => {
|
|
794
|
+
if (j.current)
|
|
1123
795
|
return;
|
|
1124
796
|
(async () => {
|
|
1125
797
|
try {
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
798
|
+
m.init({ autoResize: a }), j.current = !0;
|
|
799
|
+
const x = m.getContextLevel(), $ = m.getEntityId(), S = m.getEntityMeta();
|
|
800
|
+
O({
|
|
801
|
+
slot: m.getSlot(),
|
|
802
|
+
innerUrl: m.getInnerUrl(),
|
|
803
|
+
queryParams: m.getQueryParams(),
|
|
804
|
+
contextLevel: x,
|
|
805
|
+
entityId: $,
|
|
806
|
+
entityMeta: S,
|
|
807
|
+
registerHandler: w
|
|
808
|
+
}), _ && await m.notifyReady();
|
|
809
|
+
const [y, h, L, F, B] = await Promise.allSettled([
|
|
810
|
+
m.getTheme(),
|
|
811
|
+
m.getLanguage(),
|
|
812
|
+
x === "full" ? m.getContext() : Promise.resolve(null),
|
|
813
|
+
m.getIsYateam(),
|
|
814
|
+
m.getUserId()
|
|
1138
815
|
]);
|
|
1139
|
-
|
|
816
|
+
y.status === "fulfilled" && y.value && V({
|
|
1140
817
|
messageId: "",
|
|
1141
818
|
type: "event",
|
|
1142
819
|
method: "theme.changed",
|
|
1143
|
-
result:
|
|
1144
|
-
}),
|
|
820
|
+
result: y.value
|
|
821
|
+
}), h.status === "fulfilled" && h.value && V({
|
|
1145
822
|
messageId: "",
|
|
1146
823
|
type: "event",
|
|
1147
824
|
method: "language.changed",
|
|
1148
|
-
result:
|
|
1149
|
-
}),
|
|
825
|
+
result: h.value
|
|
826
|
+
}), F.status === "fulfilled" && F.value && V({
|
|
1150
827
|
messageId: "",
|
|
1151
828
|
type: "event",
|
|
1152
829
|
method: "isYateam.changed",
|
|
1153
|
-
result:
|
|
1154
|
-
}),
|
|
830
|
+
result: F.value
|
|
831
|
+
}), B.status === "fulfilled" && B.value && V({
|
|
1155
832
|
messageId: "",
|
|
1156
833
|
type: "event",
|
|
1157
834
|
method: "userId.changed",
|
|
1158
|
-
result:
|
|
1159
|
-
}),
|
|
835
|
+
result: B.value
|
|
836
|
+
}), x === "basic" ? $ && V({
|
|
837
|
+
messageId: "",
|
|
838
|
+
type: "event",
|
|
839
|
+
method: "context.changed",
|
|
840
|
+
result: { entityId: $, ...S ? { entityMeta: S } : {} }
|
|
841
|
+
}) : L.status === "fulfilled" && L.value && V({
|
|
1160
842
|
messageId: "",
|
|
1161
843
|
type: "event",
|
|
1162
844
|
method: "context.changed",
|
|
1163
|
-
result:
|
|
1164
|
-
}),
|
|
1165
|
-
} catch (
|
|
1166
|
-
|
|
845
|
+
result: L.value
|
|
846
|
+
}), P(!0);
|
|
847
|
+
} catch (x) {
|
|
848
|
+
k(x);
|
|
1167
849
|
}
|
|
1168
850
|
})();
|
|
1169
|
-
}, [
|
|
1170
|
-
|
|
851
|
+
}, [a, w, _]), v ? f ? /* @__PURE__ */ d.jsx(d.Fragment, { children: f(v) }) : /* @__PURE__ */ d.jsx(Ue, { error: v }) : !I || !b ? /* @__PURE__ */ d.jsx(d.Fragment, { children: c }) : /* @__PURE__ */ d.jsx(
|
|
852
|
+
wr,
|
|
1171
853
|
{
|
|
1172
|
-
fallback:
|
|
1173
|
-
children: /* @__PURE__ */
|
|
854
|
+
fallback: f || ((C) => /* @__PURE__ */ d.jsx(Ue, { error: C })),
|
|
855
|
+
children: /* @__PURE__ */ d.jsx(We.Provider, { value: b, children: u })
|
|
1174
856
|
}
|
|
1175
857
|
);
|
|
1176
858
|
}
|
|
859
|
+
const Yr = () => ({ show: $e((a) => le.confirm.show(a), []) }), Jr = Yr, $r = (u = "ru") => {
|
|
860
|
+
const a = Me();
|
|
861
|
+
return (c) => Or(c, a, u);
|
|
862
|
+
}, Hr = $r, Mr = () => ({ add: $e((a) => le.toaster.add(a), []) }), Gr = Mr;
|
|
1177
863
|
export {
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
864
|
+
wr as ErrorBoundary,
|
|
865
|
+
Qr as METHOD_NOT_SUPPORTED,
|
|
866
|
+
Zr as MISSING_REQUIRED_SCOPE,
|
|
867
|
+
et as PLUGIN_ID_IS_NOT_CORRECT,
|
|
868
|
+
rt as PLUGIN_ID_OR_SLOT_NOT_PROVIDED,
|
|
869
|
+
tt as PluginActionError,
|
|
870
|
+
Ue as PluginError,
|
|
871
|
+
qr as PluginLoader,
|
|
872
|
+
zr as PluginProvider,
|
|
873
|
+
nt as UNKNOWN_ERROR,
|
|
874
|
+
at as VALIDATION_ERROR,
|
|
875
|
+
it as dispatchHostEvent,
|
|
876
|
+
ot as getField,
|
|
877
|
+
st as getLocalizedString,
|
|
878
|
+
ut as hostApi,
|
|
879
|
+
Ur as isInternalUrl,
|
|
880
|
+
lt as on,
|
|
881
|
+
ct as uiApi,
|
|
882
|
+
Jr as useConfirm,
|
|
883
|
+
Lr as useIsYateam,
|
|
884
|
+
Me as useLanguage,
|
|
885
|
+
Hr as useLocalizedString,
|
|
886
|
+
Br as usePluginContext,
|
|
887
|
+
Fr as useTheme,
|
|
888
|
+
Gr as useToaster,
|
|
889
|
+
Nr as useUserId
|
|
1197
890
|
};
|
|
1198
891
|
//# sourceMappingURL=index.mjs.map
|