@linkurious/ogma-annotations-react 1.1.20 → 1.1.23
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.js +25 -26
- package/dist/index.mjs +1933 -1754
- package/package.json +8 -7
package/dist/index.mjs
CHANGED
|
@@ -1,454 +1,642 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Ir, { createContext as jr, useContext as Kr, useReducer as Zr, useState as Nt, useEffect as rr } from "react";
|
|
2
2
|
import { useOgma as Qr } from "@linkurious/ogma-react";
|
|
3
|
-
var
|
|
3
|
+
var Pe = { exports: {} }, he = {};
|
|
4
4
|
/**
|
|
5
5
|
* @license React
|
|
6
|
-
* react-jsx-runtime.production.js
|
|
6
|
+
* react-jsx-runtime.production.min.js
|
|
7
7
|
*
|
|
8
|
-
* Copyright (c)
|
|
8
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
9
9
|
*
|
|
10
10
|
* This source code is licensed under the MIT license found in the
|
|
11
11
|
* LICENSE file in the root directory of this source tree.
|
|
12
12
|
*/
|
|
13
|
-
var
|
|
13
|
+
var fr;
|
|
14
14
|
function tn() {
|
|
15
|
-
if (
|
|
16
|
-
|
|
17
|
-
var
|
|
18
|
-
function
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
$$typeof: a,
|
|
27
|
-
type: r,
|
|
28
|
-
key: d,
|
|
29
|
-
ref: o !== void 0 ? o : null,
|
|
30
|
-
props: u
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
return ue.Fragment = t, ue.jsx = i, ue.jsxs = i, ue;
|
|
15
|
+
if (fr) return he;
|
|
16
|
+
fr = 1;
|
|
17
|
+
var u = Ir, e = Symbol.for("react.element"), o = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, l = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, h = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
18
|
+
function f(g, d, v) {
|
|
19
|
+
var y, A = {}, _ = null, S = null;
|
|
20
|
+
v !== void 0 && (_ = "" + v), d.key !== void 0 && (_ = "" + d.key), d.ref !== void 0 && (S = d.ref);
|
|
21
|
+
for (y in d) n.call(d, y) && !h.hasOwnProperty(y) && (A[y] = d[y]);
|
|
22
|
+
if (g && g.defaultProps) for (y in d = g.defaultProps, d) A[y] === void 0 && (A[y] = d[y]);
|
|
23
|
+
return { $$typeof: e, type: g, key: _, ref: S, props: A, _owner: l.current };
|
|
24
|
+
}
|
|
25
|
+
return he.Fragment = o, he.jsx = f, he.jsxs = f, he;
|
|
34
26
|
}
|
|
35
27
|
var ce = {};
|
|
36
28
|
/**
|
|
37
29
|
* @license React
|
|
38
30
|
* react-jsx-runtime.development.js
|
|
39
31
|
*
|
|
40
|
-
* Copyright (c)
|
|
32
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
41
33
|
*
|
|
42
34
|
* This source code is licensed under the MIT license found in the
|
|
43
35
|
* LICENSE file in the root directory of this source tree.
|
|
44
36
|
*/
|
|
45
|
-
var
|
|
37
|
+
var gr;
|
|
46
38
|
function en() {
|
|
47
|
-
return
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if (typeof
|
|
51
|
-
return
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
39
|
+
return gr || (gr = 1, process.env.NODE_ENV !== "production" && function() {
|
|
40
|
+
var u = Ir, e = Symbol.for("react.element"), o = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), l = Symbol.for("react.strict_mode"), h = Symbol.for("react.profiler"), f = Symbol.for("react.provider"), g = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), v = Symbol.for("react.suspense"), y = Symbol.for("react.suspense_list"), A = Symbol.for("react.memo"), _ = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), R = Symbol.iterator, C = "@@iterator";
|
|
41
|
+
function L(t) {
|
|
42
|
+
if (t === null || typeof t != "object")
|
|
43
|
+
return null;
|
|
44
|
+
var s = R && t[R] || t[C];
|
|
45
|
+
return typeof s == "function" ? s : null;
|
|
46
|
+
}
|
|
47
|
+
var I = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
48
|
+
function k(t) {
|
|
49
|
+
{
|
|
50
|
+
for (var s = arguments.length, c = new Array(s > 1 ? s - 1 : 0), p = 1; p < s; p++)
|
|
51
|
+
c[p - 1] = arguments[p];
|
|
52
|
+
z("error", t, c);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function z(t, s, c) {
|
|
56
|
+
{
|
|
57
|
+
var p = I.ReactDebugCurrentFrame, m = p.getStackAddendum();
|
|
58
|
+
m !== "" && (s += "%s", c = c.concat([m]));
|
|
59
|
+
var w = c.map(function(b) {
|
|
60
|
+
return String(b);
|
|
61
|
+
});
|
|
62
|
+
w.unshift("Warning: " + s), Function.prototype.apply.call(console[t], console, w);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
var B = !1, tt = !1, rt = !1, Yt = !1, Vt = !1, ge;
|
|
66
|
+
ge = Symbol.for("react.module.reference");
|
|
67
|
+
function Dt(t) {
|
|
68
|
+
return !!(typeof t == "string" || typeof t == "function" || t === n || t === h || Vt || t === l || t === v || t === y || Yt || t === S || B || tt || rt || typeof t == "object" && t !== null && (t.$$typeof === _ || t.$$typeof === A || t.$$typeof === f || t.$$typeof === g || t.$$typeof === d || // This needs to include all possible module reference object
|
|
69
|
+
// types supported by any Flight configuration anywhere since
|
|
70
|
+
// we don't know which Flight build this will end up being used
|
|
71
|
+
// with.
|
|
72
|
+
t.$$typeof === ge || t.getModuleId !== void 0));
|
|
73
|
+
}
|
|
74
|
+
function Pt(t, s, c) {
|
|
75
|
+
var p = t.displayName;
|
|
76
|
+
if (p)
|
|
77
|
+
return p;
|
|
78
|
+
var m = s.displayName || s.name || "";
|
|
79
|
+
return m !== "" ? c + "(" + m + ")" : c;
|
|
80
|
+
}
|
|
81
|
+
function pe(t) {
|
|
82
|
+
return t.displayName || "Context";
|
|
83
|
+
}
|
|
84
|
+
function it(t) {
|
|
85
|
+
if (t == null)
|
|
86
|
+
return null;
|
|
87
|
+
if (typeof t.tag == "number" && k("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof t == "function")
|
|
88
|
+
return t.displayName || t.name || null;
|
|
89
|
+
if (typeof t == "string")
|
|
90
|
+
return t;
|
|
91
|
+
switch (t) {
|
|
92
|
+
case n:
|
|
55
93
|
return "Fragment";
|
|
56
|
-
case
|
|
94
|
+
case o:
|
|
57
95
|
return "Portal";
|
|
58
|
-
case
|
|
96
|
+
case h:
|
|
59
97
|
return "Profiler";
|
|
60
|
-
case
|
|
98
|
+
case l:
|
|
61
99
|
return "StrictMode";
|
|
62
|
-
case
|
|
100
|
+
case v:
|
|
63
101
|
return "Suspense";
|
|
64
|
-
case
|
|
102
|
+
case y:
|
|
65
103
|
return "SuspenseList";
|
|
66
104
|
}
|
|
67
|
-
if (typeof
|
|
68
|
-
switch (typeof
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return (
|
|
75
|
-
case
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
return
|
|
80
|
-
case
|
|
81
|
-
|
|
105
|
+
if (typeof t == "object")
|
|
106
|
+
switch (t.$$typeof) {
|
|
107
|
+
case g:
|
|
108
|
+
var s = t;
|
|
109
|
+
return pe(s) + ".Consumer";
|
|
110
|
+
case f:
|
|
111
|
+
var c = t;
|
|
112
|
+
return pe(c._context) + ".Provider";
|
|
113
|
+
case d:
|
|
114
|
+
return Pt(t, t.render, "ForwardRef");
|
|
115
|
+
case A:
|
|
116
|
+
var p = t.displayName || null;
|
|
117
|
+
return p !== null ? p : it(t.type) || "Memo";
|
|
118
|
+
case _: {
|
|
119
|
+
var m = t, w = m._payload, b = m._init;
|
|
82
120
|
try {
|
|
83
|
-
return
|
|
121
|
+
return it(b(w));
|
|
84
122
|
} catch {
|
|
123
|
+
return null;
|
|
85
124
|
}
|
|
125
|
+
}
|
|
86
126
|
}
|
|
87
127
|
return null;
|
|
88
128
|
}
|
|
89
|
-
|
|
90
|
-
|
|
129
|
+
var M = Object.assign, lt = 0, X, ut, Lt, ye, Xt, ve, me;
|
|
130
|
+
function kt() {
|
|
91
131
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
132
|
+
kt.__reactDisabledLog = !0;
|
|
133
|
+
function be() {
|
|
134
|
+
{
|
|
135
|
+
if (lt === 0) {
|
|
136
|
+
X = console.log, ut = console.info, Lt = console.warn, ye = console.error, Xt = console.group, ve = console.groupCollapsed, me = console.groupEnd;
|
|
137
|
+
var t = {
|
|
138
|
+
configurable: !0,
|
|
139
|
+
enumerable: !0,
|
|
140
|
+
value: kt,
|
|
141
|
+
writable: !0
|
|
142
|
+
};
|
|
143
|
+
Object.defineProperties(console, {
|
|
144
|
+
info: t,
|
|
145
|
+
log: t,
|
|
146
|
+
warn: t,
|
|
147
|
+
error: t,
|
|
148
|
+
group: t,
|
|
149
|
+
groupCollapsed: t,
|
|
150
|
+
groupEnd: t
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
lt++;
|
|
107
154
|
}
|
|
108
155
|
}
|
|
109
|
-
function
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
156
|
+
function He() {
|
|
157
|
+
{
|
|
158
|
+
if (lt--, lt === 0) {
|
|
159
|
+
var t = {
|
|
160
|
+
configurable: !0,
|
|
161
|
+
enumerable: !0,
|
|
162
|
+
writable: !0
|
|
163
|
+
};
|
|
164
|
+
Object.defineProperties(console, {
|
|
165
|
+
log: M({}, t, {
|
|
166
|
+
value: X
|
|
167
|
+
}),
|
|
168
|
+
info: M({}, t, {
|
|
169
|
+
value: ut
|
|
170
|
+
}),
|
|
171
|
+
warn: M({}, t, {
|
|
172
|
+
value: Lt
|
|
173
|
+
}),
|
|
174
|
+
error: M({}, t, {
|
|
175
|
+
value: ye
|
|
176
|
+
}),
|
|
177
|
+
group: M({}, t, {
|
|
178
|
+
value: Xt
|
|
179
|
+
}),
|
|
180
|
+
groupCollapsed: M({}, t, {
|
|
181
|
+
value: ve
|
|
182
|
+
}),
|
|
183
|
+
groupEnd: M({}, t, {
|
|
184
|
+
value: me
|
|
185
|
+
})
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
lt < 0 && k("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
129
189
|
}
|
|
130
|
-
Dt++;
|
|
131
190
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
191
|
+
var Gt = I.ReactCurrentDispatcher, Jt;
|
|
192
|
+
function $t(t, s, c) {
|
|
193
|
+
{
|
|
194
|
+
if (Jt === void 0)
|
|
195
|
+
try {
|
|
196
|
+
throw Error();
|
|
197
|
+
} catch (m) {
|
|
198
|
+
var p = m.stack.trim().match(/\n( *(at )?)/);
|
|
199
|
+
Jt = p && p[1] || "";
|
|
200
|
+
}
|
|
201
|
+
return `
|
|
202
|
+
` + Jt + t;
|
|
144
203
|
}
|
|
145
|
-
0 > Dt && console.error(
|
|
146
|
-
"disabledDepth fell below zero. This is a bug in React. Please file an issue."
|
|
147
|
-
);
|
|
148
204
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
} catch (v) {
|
|
154
|
-
var A = v.stack.trim().match(/\n( *(at )?)/);
|
|
155
|
-
Wt = A && A[1] || "", xe = -1 < v.stack.indexOf(`
|
|
156
|
-
at`) ? " (<anonymous>)" : -1 < v.stack.indexOf("@") ? "@unknown:0:0" : "";
|
|
157
|
-
}
|
|
158
|
-
return `
|
|
159
|
-
` + Wt + h + xe;
|
|
205
|
+
var Kt = !1, _t;
|
|
206
|
+
{
|
|
207
|
+
var Be = typeof WeakMap == "function" ? WeakMap : Map;
|
|
208
|
+
_t = new Be();
|
|
160
209
|
}
|
|
161
|
-
function
|
|
162
|
-
if (!
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
210
|
+
function Zt(t, s) {
|
|
211
|
+
if (!t || Kt)
|
|
212
|
+
return "";
|
|
213
|
+
{
|
|
214
|
+
var c = _t.get(t);
|
|
215
|
+
if (c !== void 0)
|
|
216
|
+
return c;
|
|
217
|
+
}
|
|
218
|
+
var p;
|
|
219
|
+
Kt = !0;
|
|
220
|
+
var m = Error.prepareStackTrace;
|
|
221
|
+
Error.prepareStackTrace = void 0;
|
|
222
|
+
var w;
|
|
223
|
+
w = Gt.current, Gt.current = null, be();
|
|
168
224
|
try {
|
|
169
|
-
|
|
170
|
-
|
|
225
|
+
if (s) {
|
|
226
|
+
var b = function() {
|
|
227
|
+
throw Error();
|
|
228
|
+
};
|
|
229
|
+
if (Object.defineProperty(b.prototype, "props", {
|
|
230
|
+
set: function() {
|
|
231
|
+
throw Error();
|
|
232
|
+
}
|
|
233
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
171
234
|
try {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
Reflect.construct(vt, []);
|
|
183
|
-
} catch (pt) {
|
|
184
|
-
var Ut = pt;
|
|
185
|
-
}
|
|
186
|
-
Reflect.construct(h, [], vt);
|
|
187
|
-
} else {
|
|
188
|
-
try {
|
|
189
|
-
vt.call();
|
|
190
|
-
} catch (pt) {
|
|
191
|
-
Ut = pt;
|
|
192
|
-
}
|
|
193
|
-
h.call(vt.prototype);
|
|
194
|
-
}
|
|
195
|
-
} else {
|
|
196
|
-
try {
|
|
197
|
-
throw Error();
|
|
198
|
-
} catch (pt) {
|
|
199
|
-
Ut = pt;
|
|
200
|
-
}
|
|
201
|
-
(vt = h()) && typeof vt.catch == "function" && vt.catch(function() {
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
} catch (pt) {
|
|
205
|
-
if (pt && Ut && typeof pt.stack == "string")
|
|
206
|
-
return [pt.stack, Ut.stack];
|
|
235
|
+
Reflect.construct(b, []);
|
|
236
|
+
} catch (P) {
|
|
237
|
+
p = P;
|
|
238
|
+
}
|
|
239
|
+
Reflect.construct(t, [], b);
|
|
240
|
+
} else {
|
|
241
|
+
try {
|
|
242
|
+
b.call();
|
|
243
|
+
} catch (P) {
|
|
244
|
+
p = P;
|
|
207
245
|
}
|
|
208
|
-
|
|
246
|
+
t.call(b.prototype);
|
|
209
247
|
}
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
"DetermineComponentFrameRoot"
|
|
228
|
-
); )
|
|
229
|
-
B++;
|
|
230
|
-
for (; L < At.length && !At[L].includes(
|
|
231
|
-
"DetermineComponentFrameRoot"
|
|
232
|
-
); )
|
|
233
|
-
L++;
|
|
234
|
-
if (B === Q.length || L === At.length)
|
|
235
|
-
for (B = Q.length - 1, L = At.length - 1; 1 <= B && 0 <= L && Q[B] !== At[L]; )
|
|
236
|
-
L--;
|
|
237
|
-
for (; 1 <= B && 0 <= L; B--, L--)
|
|
238
|
-
if (Q[B] !== At[L]) {
|
|
239
|
-
if (B !== 1 || L !== 1)
|
|
248
|
+
} else {
|
|
249
|
+
try {
|
|
250
|
+
throw Error();
|
|
251
|
+
} catch (P) {
|
|
252
|
+
p = P;
|
|
253
|
+
}
|
|
254
|
+
t();
|
|
255
|
+
}
|
|
256
|
+
} catch (P) {
|
|
257
|
+
if (P && p && typeof P.stack == "string") {
|
|
258
|
+
for (var E = P.stack.split(`
|
|
259
|
+
`), D = p.stack.split(`
|
|
260
|
+
`), T = E.length - 1, O = D.length - 1; T >= 1 && O >= 0 && E[T] !== D[O]; )
|
|
261
|
+
O--;
|
|
262
|
+
for (; T >= 1 && O >= 0; T--, O--)
|
|
263
|
+
if (E[T] !== D[O]) {
|
|
264
|
+
if (T !== 1 || O !== 1)
|
|
240
265
|
do
|
|
241
|
-
if (
|
|
242
|
-
var
|
|
243
|
-
` +
|
|
244
|
-
|
|
245
|
-
" at "
|
|
246
|
-
);
|
|
247
|
-
return h.displayName && kt.includes("<anonymous>") && (kt = kt.replace("<anonymous>", h.displayName)), typeof h == "function" && se.set(h, kt), kt;
|
|
266
|
+
if (T--, O--, O < 0 || E[T] !== D[O]) {
|
|
267
|
+
var j = `
|
|
268
|
+
` + E[T].replace(" at new ", " at ");
|
|
269
|
+
return t.displayName && j.includes("<anonymous>") && (j = j.replace("<anonymous>", t.displayName)), typeof t == "function" && _t.set(t, j), j;
|
|
248
270
|
}
|
|
249
|
-
while (
|
|
271
|
+
while (T >= 1 && O >= 0);
|
|
250
272
|
break;
|
|
251
273
|
}
|
|
252
274
|
}
|
|
253
275
|
} finally {
|
|
254
|
-
|
|
276
|
+
Kt = !1, Gt.current = w, He(), Error.prepareStackTrace = m;
|
|
255
277
|
}
|
|
256
|
-
|
|
278
|
+
var W = t ? t.displayName || t.name : "", F = W ? $t(W) : "";
|
|
279
|
+
return typeof t == "function" && _t.set(t, F), F;
|
|
257
280
|
}
|
|
258
|
-
function
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
281
|
+
function qe(t, s, c) {
|
|
282
|
+
return Zt(t, !1);
|
|
283
|
+
}
|
|
284
|
+
function We(t) {
|
|
285
|
+
var s = t.prototype;
|
|
286
|
+
return !!(s && s.isReactComponent);
|
|
287
|
+
}
|
|
288
|
+
function It(t, s, c) {
|
|
289
|
+
if (t == null)
|
|
290
|
+
return "";
|
|
291
|
+
if (typeof t == "function")
|
|
292
|
+
return Zt(t, We(t));
|
|
293
|
+
if (typeof t == "string")
|
|
294
|
+
return $t(t);
|
|
295
|
+
switch (t) {
|
|
296
|
+
case v:
|
|
297
|
+
return $t("Suspense");
|
|
298
|
+
case y:
|
|
299
|
+
return $t("SuspenseList");
|
|
266
300
|
}
|
|
267
|
-
if (typeof
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
switch (h.$$typeof) {
|
|
276
|
-
case Lt:
|
|
277
|
-
return h = f(h.render, !1), h;
|
|
278
|
-
case U:
|
|
279
|
-
return g(h.type);
|
|
280
|
-
case bt:
|
|
281
|
-
A = h._payload, h = h._init;
|
|
301
|
+
if (typeof t == "object")
|
|
302
|
+
switch (t.$$typeof) {
|
|
303
|
+
case d:
|
|
304
|
+
return qe(t.render);
|
|
305
|
+
case A:
|
|
306
|
+
return It(t.type, s, c);
|
|
307
|
+
case _: {
|
|
308
|
+
var p = t, m = p._payload, w = p._init;
|
|
282
309
|
try {
|
|
283
|
-
return
|
|
310
|
+
return It(w(m), s, c);
|
|
284
311
|
} catch {
|
|
285
312
|
}
|
|
313
|
+
}
|
|
286
314
|
}
|
|
287
315
|
return "";
|
|
288
316
|
}
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
317
|
+
var bt = Object.prototype.hasOwnProperty, we = {}, xe = I.ReactDebugCurrentFrame;
|
|
318
|
+
function jt(t) {
|
|
319
|
+
if (t) {
|
|
320
|
+
var s = t._owner, c = It(t.type, t._source, s ? s.type : null);
|
|
321
|
+
xe.setExtraStackFrame(c);
|
|
322
|
+
} else
|
|
323
|
+
xe.setExtraStackFrame(null);
|
|
292
324
|
}
|
|
293
|
-
function
|
|
294
|
-
|
|
295
|
-
var
|
|
296
|
-
|
|
325
|
+
function Ue(t, s, c, p, m) {
|
|
326
|
+
{
|
|
327
|
+
var w = Function.call.bind(bt);
|
|
328
|
+
for (var b in t)
|
|
329
|
+
if (w(t, b)) {
|
|
330
|
+
var E = void 0;
|
|
331
|
+
try {
|
|
332
|
+
if (typeof t[b] != "function") {
|
|
333
|
+
var D = Error((p || "React class") + ": " + c + " type `" + b + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof t[b] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
334
|
+
throw D.name = "Invariant Violation", D;
|
|
335
|
+
}
|
|
336
|
+
E = t[b](s, b, p, c, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
337
|
+
} catch (T) {
|
|
338
|
+
E = T;
|
|
339
|
+
}
|
|
340
|
+
E && !(E instanceof Error) && (jt(m), k("%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).", p || "React class", c, b, typeof E), jt(null)), E instanceof Error && !(E.message in we) && (we[E.message] = !0, jt(m), k("Failed %s type: %s", c, E.message), jt(null));
|
|
341
|
+
}
|
|
297
342
|
}
|
|
298
|
-
return h.key !== void 0;
|
|
299
343
|
}
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
304
|
-
A
|
|
305
|
-
));
|
|
306
|
-
}
|
|
307
|
-
v.isReactWarning = !0, Object.defineProperty(h, "key", {
|
|
308
|
-
get: v,
|
|
309
|
-
configurable: !0
|
|
310
|
-
});
|
|
344
|
+
var Ye = Array.isArray;
|
|
345
|
+
function Qt(t) {
|
|
346
|
+
return Ye(t);
|
|
311
347
|
}
|
|
312
|
-
function
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
348
|
+
function q(t) {
|
|
349
|
+
{
|
|
350
|
+
var s = typeof Symbol == "function" && Symbol.toStringTag, c = s && t[Symbol.toStringTag] || t.constructor.name || "Object";
|
|
351
|
+
return c;
|
|
352
|
+
}
|
|
317
353
|
}
|
|
318
|
-
function
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
354
|
+
function Ve(t) {
|
|
355
|
+
try {
|
|
356
|
+
return Ee(t), !1;
|
|
357
|
+
} catch {
|
|
358
|
+
return !0;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
function Ee(t) {
|
|
362
|
+
return "" + t;
|
|
363
|
+
}
|
|
364
|
+
function te(t) {
|
|
365
|
+
if (Ve(t))
|
|
366
|
+
return k("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", q(t)), Ee(t);
|
|
367
|
+
}
|
|
368
|
+
var ct = I.ReactCurrentOwner, Ae = {
|
|
369
|
+
key: !0,
|
|
370
|
+
ref: !0,
|
|
371
|
+
__self: !0,
|
|
372
|
+
__source: !0
|
|
373
|
+
}, Ft, ke;
|
|
374
|
+
function Xe(t) {
|
|
375
|
+
if (bt.call(t, "ref")) {
|
|
376
|
+
var s = Object.getOwnPropertyDescriptor(t, "ref").get;
|
|
377
|
+
if (s && s.isReactWarning)
|
|
378
|
+
return !1;
|
|
379
|
+
}
|
|
380
|
+
return t.ref !== void 0;
|
|
381
|
+
}
|
|
382
|
+
function ee(t) {
|
|
383
|
+
if (bt.call(t, "key")) {
|
|
384
|
+
var s = Object.getOwnPropertyDescriptor(t, "key").get;
|
|
385
|
+
if (s && s.isReactWarning)
|
|
386
|
+
return !1;
|
|
387
|
+
}
|
|
388
|
+
return t.key !== void 0;
|
|
389
|
+
}
|
|
390
|
+
function Ge(t, s) {
|
|
391
|
+
typeof t.ref == "string" && ct.current;
|
|
392
|
+
}
|
|
393
|
+
function Je(t, s) {
|
|
394
|
+
{
|
|
395
|
+
var c = function() {
|
|
396
|
+
Ft || (Ft = !0, k("%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)", s));
|
|
397
|
+
};
|
|
398
|
+
c.isReactWarning = !0, Object.defineProperty(t, "key", {
|
|
399
|
+
get: c,
|
|
400
|
+
configurable: !0
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
function Ke(t, s) {
|
|
405
|
+
{
|
|
406
|
+
var c = function() {
|
|
407
|
+
ke || (ke = !0, k("%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)", s));
|
|
408
|
+
};
|
|
409
|
+
c.isReactWarning = !0, Object.defineProperty(t, "ref", {
|
|
410
|
+
get: c,
|
|
411
|
+
configurable: !0
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
var re = function(t, s, c, p, m, w, b) {
|
|
416
|
+
var E = {
|
|
417
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
418
|
+
$$typeof: e,
|
|
419
|
+
// Built-in properties that belong on the element
|
|
420
|
+
type: t,
|
|
421
|
+
key: s,
|
|
422
|
+
ref: c,
|
|
423
|
+
props: b,
|
|
424
|
+
// Record the component responsible for creating this element.
|
|
425
|
+
_owner: w
|
|
426
|
+
};
|
|
427
|
+
return E._store = {}, Object.defineProperty(E._store, "validated", {
|
|
329
428
|
configurable: !1,
|
|
330
429
|
enumerable: !1,
|
|
331
430
|
writable: !0,
|
|
332
|
-
value:
|
|
333
|
-
}), Object.defineProperty(
|
|
431
|
+
value: !1
|
|
432
|
+
}), Object.defineProperty(E, "_self", {
|
|
334
433
|
configurable: !1,
|
|
335
434
|
enumerable: !1,
|
|
336
|
-
writable: !
|
|
337
|
-
value:
|
|
338
|
-
}), Object.
|
|
435
|
+
writable: !1,
|
|
436
|
+
value: p
|
|
437
|
+
}), Object.defineProperty(E, "_source", {
|
|
438
|
+
configurable: !1,
|
|
439
|
+
enumerable: !1,
|
|
440
|
+
writable: !1,
|
|
441
|
+
value: m
|
|
442
|
+
}), Object.freeze && (Object.freeze(E.props), Object.freeze(E)), E;
|
|
443
|
+
};
|
|
444
|
+
function _e(t, s, c, p, m) {
|
|
445
|
+
{
|
|
446
|
+
var w, b = {}, E = null, D = null;
|
|
447
|
+
c !== void 0 && (te(c), E = "" + c), ee(s) && (te(s.key), E = "" + s.key), Xe(s) && (D = s.ref, Ge(s, m));
|
|
448
|
+
for (w in s)
|
|
449
|
+
bt.call(s, w) && !Ae.hasOwnProperty(w) && (b[w] = s[w]);
|
|
450
|
+
if (t && t.defaultProps) {
|
|
451
|
+
var T = t.defaultProps;
|
|
452
|
+
for (w in T)
|
|
453
|
+
b[w] === void 0 && (b[w] = T[w]);
|
|
454
|
+
}
|
|
455
|
+
if (E || D) {
|
|
456
|
+
var O = typeof t == "function" ? t.displayName || t.name || "Unknown" : t;
|
|
457
|
+
E && Je(b, O), D && Ke(b, O);
|
|
458
|
+
}
|
|
459
|
+
return re(t, E, D, m, p, ct.current, b);
|
|
460
|
+
}
|
|
339
461
|
}
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
if (Mt(L)) {
|
|
346
|
-
for (I = 0; I < L.length; I++)
|
|
347
|
-
x(L[I], h);
|
|
348
|
-
Object.freeze && Object.freeze(L);
|
|
349
|
-
} else
|
|
350
|
-
console.error(
|
|
351
|
-
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
352
|
-
);
|
|
353
|
-
else x(L, h);
|
|
462
|
+
var dt = I.ReactCurrentOwner, Se = I.ReactDebugCurrentFrame;
|
|
463
|
+
function wt(t) {
|
|
464
|
+
if (t) {
|
|
465
|
+
var s = t._owner, c = It(t.type, t._source, s ? s.type : null);
|
|
466
|
+
Se.setExtraStackFrame(c);
|
|
354
467
|
} else
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
468
|
+
Se.setExtraStackFrame(null);
|
|
469
|
+
}
|
|
470
|
+
var St;
|
|
471
|
+
St = !1;
|
|
472
|
+
function G(t) {
|
|
473
|
+
return typeof t == "object" && t !== null && t.$$typeof === e;
|
|
474
|
+
}
|
|
475
|
+
function xt() {
|
|
476
|
+
{
|
|
477
|
+
if (dt.current) {
|
|
478
|
+
var t = it(dt.current.type);
|
|
479
|
+
if (t)
|
|
480
|
+
return `
|
|
481
|
+
|
|
482
|
+
Check the render method of \`` + t + "`.";
|
|
483
|
+
}
|
|
484
|
+
return "";
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
function ne(t) {
|
|
488
|
+
return "";
|
|
489
|
+
}
|
|
490
|
+
var Ce = {};
|
|
491
|
+
function Te(t) {
|
|
492
|
+
{
|
|
493
|
+
var s = xt();
|
|
494
|
+
if (!s) {
|
|
495
|
+
var c = typeof t == "string" ? t : t.displayName || t.name;
|
|
496
|
+
c && (s = `
|
|
497
|
+
|
|
498
|
+
Check the top-level render call using <` + c + ">.");
|
|
499
|
+
}
|
|
500
|
+
return s;
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
function ie(t, s) {
|
|
504
|
+
{
|
|
505
|
+
if (!t._store || t._store.validated || t.key != null)
|
|
506
|
+
return;
|
|
507
|
+
t._store.validated = !0;
|
|
508
|
+
var c = Te(s);
|
|
509
|
+
if (Ce[c])
|
|
510
|
+
return;
|
|
511
|
+
Ce[c] = !0;
|
|
512
|
+
var p = "";
|
|
513
|
+
t && t._owner && t._owner !== dt.current && (p = " It was passed a child from " + it(t._owner.type) + "."), wt(t), k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', c, p), wt(null);
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
function Re(t, s) {
|
|
517
|
+
{
|
|
518
|
+
if (typeof t != "object")
|
|
519
|
+
return;
|
|
520
|
+
if (Qt(t))
|
|
521
|
+
for (var c = 0; c < t.length; c++) {
|
|
522
|
+
var p = t[c];
|
|
523
|
+
G(p) && ie(p, s);
|
|
524
|
+
}
|
|
525
|
+
else if (G(t))
|
|
526
|
+
t._store && (t._store.validated = !0);
|
|
527
|
+
else if (t) {
|
|
528
|
+
var m = L(t);
|
|
529
|
+
if (typeof m == "function" && m !== t.entries)
|
|
530
|
+
for (var w = m.call(t), b; !(b = w.next()).done; )
|
|
531
|
+
G(b.value) && ie(b.value, s);
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
function oe(t) {
|
|
536
|
+
{
|
|
537
|
+
var s = t.type;
|
|
538
|
+
if (s == null || typeof s == "string")
|
|
539
|
+
return;
|
|
540
|
+
var c;
|
|
541
|
+
if (typeof s == "function")
|
|
542
|
+
c = s.propTypes;
|
|
543
|
+
else if (typeof s == "object" && (s.$$typeof === d || // Note: Memo only checks outer props here.
|
|
544
|
+
// Inner props are checked in the reconciler.
|
|
545
|
+
s.$$typeof === A))
|
|
546
|
+
c = s.propTypes;
|
|
547
|
+
else
|
|
548
|
+
return;
|
|
549
|
+
if (c) {
|
|
550
|
+
var p = it(s);
|
|
551
|
+
Ue(c, t.props, "prop", p, t);
|
|
552
|
+
} else if (s.PropTypes !== void 0 && !St) {
|
|
553
|
+
St = !0;
|
|
554
|
+
var m = it(s);
|
|
555
|
+
k("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", m || "Unknown");
|
|
556
|
+
}
|
|
557
|
+
typeof s.getDefaultProps == "function" && !s.getDefaultProps.isReactClassApproved && k("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
function Ze(t) {
|
|
561
|
+
{
|
|
562
|
+
for (var s = Object.keys(t.props), c = 0; c < s.length; c++) {
|
|
563
|
+
var p = s[c];
|
|
564
|
+
if (p !== "children" && p !== "key") {
|
|
565
|
+
wt(t), k("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", p), wt(null);
|
|
566
|
+
break;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
t.ref !== null && (wt(t), k("Invalid attribute `ref` supplied to `React.Fragment`."), wt(null));
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
var se = {};
|
|
573
|
+
function ae(t, s, c, p, m, w) {
|
|
574
|
+
{
|
|
575
|
+
var b = Dt(t);
|
|
576
|
+
if (!b) {
|
|
577
|
+
var E = "";
|
|
578
|
+
(t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (E += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
579
|
+
var D = ne();
|
|
580
|
+
D ? E += D : E += xt();
|
|
581
|
+
var T;
|
|
582
|
+
t === null ? T = "null" : Qt(t) ? T = "array" : t !== void 0 && t.$$typeof === e ? (T = "<" + (it(t.type) || "Unknown") + " />", E = " Did you accidentally export a JSX literal instead of a component?") : T = typeof t, k("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", T, E);
|
|
583
|
+
}
|
|
584
|
+
var O = _e(t, s, c, m, w);
|
|
585
|
+
if (O == null)
|
|
586
|
+
return O;
|
|
587
|
+
if (b) {
|
|
588
|
+
var j = s.children;
|
|
589
|
+
if (j !== void 0)
|
|
590
|
+
if (p)
|
|
591
|
+
if (Qt(j)) {
|
|
592
|
+
for (var W = 0; W < j.length; W++)
|
|
593
|
+
Re(j[W], t);
|
|
594
|
+
Object.freeze && Object.freeze(j);
|
|
595
|
+
} else
|
|
596
|
+
k("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
597
|
+
else
|
|
598
|
+
Re(j, t);
|
|
599
|
+
}
|
|
600
|
+
if (bt.call(s, "key")) {
|
|
601
|
+
var F = it(t), P = Object.keys(s).filter(function(J) {
|
|
602
|
+
return J !== "key";
|
|
603
|
+
}), H = P.length > 0 ? "{key: someKey, " + P.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
604
|
+
if (!se[F + H]) {
|
|
605
|
+
var N = P.length > 0 ? "{" + P.join(": ..., ") + ": ...}" : "{}";
|
|
606
|
+
k(`A props object containing a "key" prop is being spread into JSX:
|
|
367
607
|
let props = %s;
|
|
368
608
|
<%s {...props} />
|
|
369
609
|
React keys must be passed directly to JSX without using spread:
|
|
370
610
|
let props = %s;
|
|
371
|
-
<%s key={someKey} {...props} />`,
|
|
372
|
-
I,
|
|
373
|
-
L,
|
|
374
|
-
dt,
|
|
375
|
-
L
|
|
376
|
-
), Se[L + I] = !0);
|
|
377
|
-
}
|
|
378
|
-
if (L = null, v !== void 0 && (i(v), L = "" + v), y(A) && (i(A.key), L = "" + A.key), "key" in A) {
|
|
379
|
-
v = {};
|
|
380
|
-
for (var mt in A)
|
|
381
|
-
mt !== "key" && (v[mt] = A[mt]);
|
|
382
|
-
} else v = A;
|
|
383
|
-
return L && C(
|
|
384
|
-
v,
|
|
385
|
-
typeof h == "function" ? h.displayName || h.name || "Unknown" : h
|
|
386
|
-
), E(h, L, B, K, p(), v);
|
|
387
|
-
}
|
|
388
|
-
function x(h, A) {
|
|
389
|
-
if (typeof h == "object" && h && h.$$typeof !== Ee) {
|
|
390
|
-
if (Mt(h))
|
|
391
|
-
for (var v = 0; v < h.length; v++) {
|
|
392
|
-
var I = h[v];
|
|
393
|
-
j(I) && R(I, A);
|
|
611
|
+
<%s key={someKey} {...props} />`, H, F, N, F), se[F + H] = !0;
|
|
394
612
|
}
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
else if (h === null || typeof h != "object" ? v = null : (v = yt && h[yt] || h["@@iterator"], v = typeof v == "function" ? v : null), typeof v == "function" && v !== h.entries && (v = v.call(h), v !== h))
|
|
398
|
-
for (; !(h = v.next()).done; )
|
|
399
|
-
j(h.value) && R(h.value, A);
|
|
613
|
+
}
|
|
614
|
+
return t === n ? Ze(O) : oe(O), O;
|
|
400
615
|
}
|
|
401
616
|
}
|
|
402
|
-
function
|
|
403
|
-
return
|
|
404
|
-
}
|
|
405
|
-
function R(h, A) {
|
|
406
|
-
if (h._store && !h._store.validated && h.key == null && (h._store.validated = 1, A = T(A), !_e[A])) {
|
|
407
|
-
_e[A] = !0;
|
|
408
|
-
var v = "";
|
|
409
|
-
h && h._owner != null && h._owner !== p() && (v = null, typeof h._owner.tag == "number" ? v = a(h._owner.type) : typeof h._owner.name == "string" && (v = h._owner.name), v = " It was passed a child from " + v + ".");
|
|
410
|
-
var I = xt.getCurrentStack;
|
|
411
|
-
xt.getCurrentStack = function() {
|
|
412
|
-
var K = g(h.type);
|
|
413
|
-
return I && (K += I() || ""), K;
|
|
414
|
-
}, console.error(
|
|
415
|
-
'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',
|
|
416
|
-
A,
|
|
417
|
-
v
|
|
418
|
-
), xt.getCurrentStack = I;
|
|
419
|
-
}
|
|
617
|
+
function Qe(t, s, c) {
|
|
618
|
+
return ae(t, s, c, !0);
|
|
420
619
|
}
|
|
421
|
-
function
|
|
422
|
-
|
|
423
|
-
return v && (v = a(v.type)) && (A = `
|
|
424
|
-
|
|
425
|
-
Check the render method of \`` + v + "`."), A || (h = a(h)) && (A = `
|
|
426
|
-
|
|
427
|
-
Check the top-level render call using <` + h + ">."), A;
|
|
620
|
+
function r(t, s, c) {
|
|
621
|
+
return ae(t, s, c, !1);
|
|
428
622
|
}
|
|
429
|
-
var
|
|
430
|
-
|
|
431
|
-
var Wt, xe, ie = !1, se = new (typeof WeakMap == "function" ? WeakMap : Map)(), Ee = Symbol.for("react.client.reference"), Ae, ke = {}, Se = {}, _e = {};
|
|
432
|
-
ce.Fragment = tt, ce.jsx = function(h, A, v, I, K) {
|
|
433
|
-
return _(h, A, v, !1, I, K);
|
|
434
|
-
}, ce.jsxs = function(h, A, v, I, K) {
|
|
435
|
-
return _(h, A, v, !0, I, K);
|
|
436
|
-
};
|
|
623
|
+
var i = r, a = Qe;
|
|
624
|
+
ce.Fragment = n, ce.jsx = i, ce.jsxs = a;
|
|
437
625
|
}()), ce;
|
|
438
626
|
}
|
|
439
|
-
var
|
|
627
|
+
var pr;
|
|
440
628
|
function rn() {
|
|
441
|
-
return
|
|
629
|
+
return pr || (pr = 1, process.env.NODE_ENV === "production" ? Pe.exports = tn() : Pe.exports = en()), Pe.exports;
|
|
442
630
|
}
|
|
443
|
-
var nn = rn(),
|
|
444
|
-
let
|
|
631
|
+
var nn = rn(), on = Object.defineProperty, sn = (u, e, o) => e in u ? on(u, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : u[e] = o, x = (u, e, o) => sn(u, typeof e != "symbol" ? e + "" : e, o);
|
|
632
|
+
let Ne = (u = 21) => crypto.getRandomValues(new Uint8Array(u)).reduce((e, o) => (o &= 63, o < 36 ? e += o.toString(36) : o < 62 ? e += (o - 26).toString(36).toUpperCase() : o > 62 ? e += "-" : e += "_", e), "");
|
|
445
633
|
const fe = {
|
|
446
634
|
strokeType: "plain",
|
|
447
635
|
strokeColor: "#202020",
|
|
448
636
|
strokeWidth: 1,
|
|
449
637
|
head: "none",
|
|
450
638
|
tail: "none"
|
|
451
|
-
},
|
|
639
|
+
}, yr = {
|
|
452
640
|
id: 0,
|
|
453
641
|
type: "Feature",
|
|
454
642
|
properties: {
|
|
@@ -474,318 +662,310 @@ const fe = {
|
|
|
474
662
|
// tail: 'arrow-plain',
|
|
475
663
|
// start: { x: 0, y: 0 },
|
|
476
664
|
// end: { x: 100, y: 100 }
|
|
477
|
-
}, an = (
|
|
478
|
-
id:
|
|
665
|
+
}, an = (u = 0, e = 0, o = 0, n = 0, l = { ...fe }) => ({
|
|
666
|
+
id: Ne(),
|
|
479
667
|
type: "Feature",
|
|
480
668
|
properties: {
|
|
481
669
|
type: "arrow",
|
|
482
670
|
style: {
|
|
483
671
|
...fe,
|
|
484
|
-
...
|
|
672
|
+
...l
|
|
485
673
|
}
|
|
486
674
|
},
|
|
487
675
|
geometry: {
|
|
488
676
|
type: "LineString",
|
|
489
677
|
coordinates: [
|
|
490
|
-
[
|
|
491
|
-
[
|
|
678
|
+
[u, e],
|
|
679
|
+
[o, n]
|
|
492
680
|
]
|
|
493
681
|
}
|
|
494
682
|
}), ln = "http://www.w3.org/2000/svg";
|
|
495
|
-
function
|
|
496
|
-
return document.createElementNS(ln,
|
|
683
|
+
function Rt(u) {
|
|
684
|
+
return document.createElementNS(ln, u);
|
|
497
685
|
}
|
|
498
|
-
function
|
|
499
|
-
return
|
|
686
|
+
function Fr(u) {
|
|
687
|
+
return u.geometry.bbox || un(u), u.geometry.bbox;
|
|
500
688
|
}
|
|
501
|
-
function
|
|
502
|
-
const
|
|
689
|
+
function mt(u) {
|
|
690
|
+
const e = Fr(u);
|
|
503
691
|
return {
|
|
504
|
-
width:
|
|
505
|
-
height:
|
|
692
|
+
width: e[2] - e[0],
|
|
693
|
+
height: e[3] - e[1]
|
|
506
694
|
};
|
|
507
695
|
}
|
|
508
|
-
function
|
|
509
|
-
const
|
|
510
|
-
return { x:
|
|
696
|
+
function vt(u) {
|
|
697
|
+
const e = Fr(u);
|
|
698
|
+
return { x: e[0], y: e[1] };
|
|
511
699
|
}
|
|
512
|
-
function
|
|
513
|
-
const [
|
|
514
|
-
|
|
700
|
+
function un(u) {
|
|
701
|
+
const [e, o] = u.geometry.coordinates[0][0], [n, l] = u.geometry.coordinates[0][2];
|
|
702
|
+
u.geometry.bbox = [e, o, n, l];
|
|
515
703
|
}
|
|
516
|
-
function
|
|
517
|
-
|
|
704
|
+
function hn(u, e, o, n, l) {
|
|
705
|
+
u.geometry.bbox = [e, o, e + n, o + l], u.geometry.coordinates = [
|
|
518
706
|
[
|
|
519
|
-
[
|
|
520
|
-
[
|
|
521
|
-
[
|
|
522
|
-
[
|
|
523
|
-
[
|
|
707
|
+
[e, o],
|
|
708
|
+
[e + n, o],
|
|
709
|
+
[e + n, o + l],
|
|
710
|
+
[e, o + l],
|
|
711
|
+
[e, o]
|
|
524
712
|
]
|
|
525
713
|
];
|
|
526
714
|
}
|
|
527
|
-
function de(
|
|
528
|
-
const [
|
|
529
|
-
return { x:
|
|
715
|
+
function de(u) {
|
|
716
|
+
const [e, o] = u.geometry.coordinates[0];
|
|
717
|
+
return { x: e, y: o };
|
|
530
718
|
}
|
|
531
|
-
function
|
|
532
|
-
const [
|
|
533
|
-
return { x:
|
|
719
|
+
function Le(u, e) {
|
|
720
|
+
const [o, n] = u.geometry.coordinates[e === "start" ? 0 : 1];
|
|
721
|
+
return { x: o, y: n };
|
|
534
722
|
}
|
|
535
|
-
function
|
|
536
|
-
const [
|
|
537
|
-
return { x:
|
|
723
|
+
function je(u) {
|
|
724
|
+
const [e, o] = u.geometry.coordinates[1];
|
|
725
|
+
return { x: e, y: o };
|
|
538
726
|
}
|
|
539
|
-
function
|
|
540
|
-
|
|
727
|
+
function Mr(u, e, o) {
|
|
728
|
+
u.geometry.coordinates[0] = [e, o];
|
|
541
729
|
}
|
|
542
|
-
function
|
|
543
|
-
|
|
730
|
+
function zr(u, e, o) {
|
|
731
|
+
u.geometry.coordinates[1] = [e, o];
|
|
544
732
|
}
|
|
545
|
-
function
|
|
546
|
-
return { start: de(
|
|
733
|
+
function Fe(u) {
|
|
734
|
+
return { start: de(u), end: je(u) };
|
|
547
735
|
}
|
|
548
|
-
function
|
|
549
|
-
|
|
736
|
+
function Ht(u, e, o, n) {
|
|
737
|
+
e === "start" ? Mr(u, o, n) : zr(u, o, n);
|
|
550
738
|
}
|
|
551
|
-
const
|
|
552
|
-
function cn(
|
|
553
|
-
return Array.isArray(
|
|
739
|
+
const Nr = (u) => parseInt(u.getAttribute("data-handle-id") || "-1");
|
|
740
|
+
function cn(u) {
|
|
741
|
+
return Array.isArray(u) && u.length === 2 && u.every(isFinite);
|
|
554
742
|
}
|
|
555
|
-
function dn(
|
|
556
|
-
for (let
|
|
557
|
-
const
|
|
558
|
-
if (cn(
|
|
559
|
-
|
|
743
|
+
function dn(u, e, o, n) {
|
|
744
|
+
for (let l = 0; l < u.coordinates.length; l++) {
|
|
745
|
+
const h = u.coordinates[l];
|
|
746
|
+
if (cn(h))
|
|
747
|
+
h[0] = o + (h[0] - o) * e, h[1] = n + (h[1] - n) * e;
|
|
560
748
|
else
|
|
561
|
-
for (let
|
|
562
|
-
const
|
|
563
|
-
|
|
749
|
+
for (let f = 0; f < h.length; f++) {
|
|
750
|
+
const g = h[f];
|
|
751
|
+
g[0] = o + (g[0] - o) * e, g[1] = n + (g[1] - n) * e;
|
|
564
752
|
}
|
|
565
753
|
}
|
|
566
|
-
return
|
|
754
|
+
return u;
|
|
567
755
|
}
|
|
568
|
-
function
|
|
569
|
-
const
|
|
756
|
+
function $e(u, e, o) {
|
|
757
|
+
const n = Math.atan2(u.y - e.y, u.x - e.x);
|
|
570
758
|
return {
|
|
571
|
-
x:
|
|
572
|
-
y:
|
|
759
|
+
x: e.x + o * Math.cos(n),
|
|
760
|
+
y: e.y + o * Math.sin(n)
|
|
573
761
|
};
|
|
574
762
|
}
|
|
575
|
-
function
|
|
576
|
-
if (!
|
|
577
|
-
const
|
|
763
|
+
function sr(u, e) {
|
|
764
|
+
if (!e) return { x: u.clientX, y: u.clientY };
|
|
765
|
+
const o = e.getBoundingClientRect();
|
|
578
766
|
return {
|
|
579
|
-
x:
|
|
580
|
-
y:
|
|
767
|
+
x: u.clientX - o.left - e.clientLeft,
|
|
768
|
+
y: u.clientY - o.top - e.clientTop
|
|
581
769
|
};
|
|
582
770
|
}
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
const
|
|
591
|
-
return
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
const [i, r, o] = a.match(/\d+/g).map((u) => parseInt(u, 10));
|
|
595
|
-
return `rgba(${i}, ${r}, ${o}, ${t})`;
|
|
596
|
-
}
|
|
597
|
-
const Ht = (a, t) => ({
|
|
598
|
-
x: a.x - t.x,
|
|
599
|
-
y: a.y - t.y
|
|
600
|
-
}), Zt = (a) => Math.sqrt(a.x * a.x + a.y * a.y), Dr = (a) => ({
|
|
601
|
-
x: -a.x,
|
|
602
|
-
y: -a.y
|
|
603
|
-
}), Nr = (a) => {
|
|
604
|
-
const t = Zt(a);
|
|
605
|
-
return t === 0 ? { x: 0, y: 0 } : {
|
|
606
|
-
x: a.x / t,
|
|
607
|
-
y: a.y / t
|
|
771
|
+
const Ot = (u, e) => ({
|
|
772
|
+
x: u.x - e.x,
|
|
773
|
+
y: u.y - e.y
|
|
774
|
+
}), qt = (u) => Math.sqrt(u.x * u.x + u.y * u.y), Hr = (u) => ({
|
|
775
|
+
x: -u.x,
|
|
776
|
+
y: -u.y
|
|
777
|
+
}), Br = (u) => {
|
|
778
|
+
const e = qt(u);
|
|
779
|
+
return e === 0 ? { x: 0, y: 0 } : {
|
|
780
|
+
x: u.x / e,
|
|
781
|
+
y: u.y / e
|
|
608
782
|
};
|
|
609
|
-
},
|
|
610
|
-
x:
|
|
611
|
-
y:
|
|
612
|
-
}),
|
|
613
|
-
x:
|
|
614
|
-
y:
|
|
615
|
-
}),
|
|
616
|
-
x:
|
|
617
|
-
y:
|
|
618
|
-
}),
|
|
619
|
-
const
|
|
783
|
+
}, Bt = (u, e) => ({
|
|
784
|
+
x: u.x + e.x,
|
|
785
|
+
y: u.y + e.y
|
|
786
|
+
}), qr = (u, e) => ({
|
|
787
|
+
x: u.x * e,
|
|
788
|
+
y: u.y * e
|
|
789
|
+
}), Ie = (u, e) => ({
|
|
790
|
+
x: u.x * e.x,
|
|
791
|
+
y: u.y * e.y
|
|
792
|
+
}), st = (u, e) => {
|
|
793
|
+
const o = Math.sin(e), n = Math.cos(e);
|
|
620
794
|
return {
|
|
621
|
-
x:
|
|
622
|
-
y:
|
|
795
|
+
x: u.x * n - u.y * o,
|
|
796
|
+
y: u.x * o + u.y * n
|
|
623
797
|
};
|
|
624
|
-
},
|
|
625
|
-
x:
|
|
626
|
-
y:
|
|
627
|
-
}),
|
|
628
|
-
function
|
|
629
|
-
var
|
|
630
|
-
const { start:
|
|
631
|
-
return Math.min(
|
|
798
|
+
}, fn = (u, e) => ({
|
|
799
|
+
x: u.x / e,
|
|
800
|
+
y: u.y / e
|
|
801
|
+
}), vr = (u, e) => u.x * e.x + u.y * e.y, gn = 0.5;
|
|
802
|
+
function Wr(u, e = 5, o = 30) {
|
|
803
|
+
var n;
|
|
804
|
+
const { start: l, end: h } = Fe(u), f = Ot(h, l), g = u.properties.style && u.properties.style.strokeWidth ? (n = u.properties.style) == null ? void 0 : n.strokeWidth : 0;
|
|
805
|
+
return Math.min(o, Math.max(3 * g, qt(f) * 0.01, e));
|
|
632
806
|
}
|
|
633
|
-
function
|
|
634
|
-
const
|
|
635
|
-
if (!
|
|
636
|
-
const
|
|
637
|
-
return `M ${
|
|
807
|
+
function mr(u, e, o, n) {
|
|
808
|
+
const l = qr(Hr(Br(e)), n);
|
|
809
|
+
if (!o || o !== "arrow" && o !== "arrow-plain") return "";
|
|
810
|
+
const h = Bt(u, st(l, Math.PI / 10)), f = Bt(u, st(l, -Math.PI / 10)), g = `${u.x} ${u.y}`;
|
|
811
|
+
return `M ${h.x} ${h.y} L ${g} ${f.x} ${f.y} ${o === "arrow" ? "" : `${h.x} ${h.y}`}`;
|
|
638
812
|
}
|
|
639
|
-
function
|
|
640
|
-
const { start:
|
|
641
|
-
tail:
|
|
642
|
-
head:
|
|
643
|
-
strokeColor:
|
|
813
|
+
function pn(u, e, o, n, l) {
|
|
814
|
+
const { start: h, end: f } = Fe(u), {
|
|
815
|
+
tail: g,
|
|
816
|
+
head: d,
|
|
817
|
+
strokeColor: v,
|
|
644
818
|
strokeWidth: y = 0
|
|
645
|
-
} =
|
|
646
|
-
|
|
647
|
-
const
|
|
648
|
-
|
|
649
|
-
const
|
|
650
|
-
|
|
819
|
+
} = u.properties.style || o, A = Ot(f, h), _ = Wr(u, n, l), S = Rt("g"), R = Rt("path");
|
|
820
|
+
S.setAttribute("data-annotation", `${u.id}`), S.setAttribute("data-annotation-type", "arrow");
|
|
821
|
+
const C = d === "arrow-plain" || g === "arrow", L = v || "none";
|
|
822
|
+
R.setAttribute("stroke", L), R.setAttribute("stroke-width", `${y}`), R.setAttribute("fill", C ? v || "" : "none"), R.setAttribute("stroke-linecap", "round"), R.setAttribute("stroke-linejoin", "round");
|
|
823
|
+
const I = mr(h, Hr(A), g, _), k = mr(f, A, d, _), z = I + `M ${h.x} ${h.y} ${f.x} ${f.y}` + k;
|
|
824
|
+
R.setAttribute("d", z), S.appendChild(R), br(S, h, L, g, y), br(S, f, L, d, y), e.appendChild(S);
|
|
651
825
|
}
|
|
652
|
-
function
|
|
653
|
-
|
|
826
|
+
function br(u, e, o, n, l) {
|
|
827
|
+
n === "halo-dot" && wr(
|
|
828
|
+
u,
|
|
829
|
+
e,
|
|
830
|
+
yn(o),
|
|
831
|
+
gn,
|
|
832
|
+
l * 4
|
|
833
|
+
), (n === "dot" || n === "halo-dot") && wr(u, e, o, 1, l * 2);
|
|
654
834
|
}
|
|
655
|
-
function
|
|
656
|
-
return
|
|
835
|
+
function yn(u) {
|
|
836
|
+
return u === "none" ? "none" : u;
|
|
657
837
|
}
|
|
658
|
-
function
|
|
659
|
-
const
|
|
660
|
-
|
|
838
|
+
function wr(u, e, o, n, l) {
|
|
839
|
+
const h = Rt("circle");
|
|
840
|
+
h.setAttribute("cx", `${e.x}`), h.setAttribute("cy", `${e.y}`), h.setAttribute("r", `${l}`), h.setAttribute("fill-opacity", `${n}`), h.setAttribute("fill", o), u.appendChild(h);
|
|
661
841
|
}
|
|
662
|
-
const
|
|
663
|
-
function
|
|
664
|
-
return
|
|
842
|
+
const V = -1, Me = "dragging", ze = "dragstart", Ut = "dragend", ar = "select", lr = "unselect", vn = "hover", mn = "unhover", ur = "remove", hr = "add", bn = "cancelDrawing", cr = "update", wn = "link";
|
|
843
|
+
function Ur(u) {
|
|
844
|
+
return u && u.__esModule && Object.prototype.hasOwnProperty.call(u, "default") ? u.default : u;
|
|
665
845
|
}
|
|
666
|
-
var
|
|
667
|
-
function
|
|
668
|
-
return
|
|
669
|
-
var
|
|
670
|
-
function
|
|
846
|
+
var xr = { exports: {} }, Er;
|
|
847
|
+
function xn() {
|
|
848
|
+
return Er || (Er = 1, function(u) {
|
|
849
|
+
var e = Object.prototype.hasOwnProperty, o = "~";
|
|
850
|
+
function n() {
|
|
671
851
|
}
|
|
672
|
-
Object.create && (
|
|
673
|
-
function
|
|
674
|
-
this.fn =
|
|
852
|
+
Object.create && (n.prototype = /* @__PURE__ */ Object.create(null), new n().__proto__ || (o = !1));
|
|
853
|
+
function l(d, v, y) {
|
|
854
|
+
this.fn = d, this.context = v, this.once = y || !1;
|
|
675
855
|
}
|
|
676
|
-
function
|
|
856
|
+
function h(d, v, y, A, _) {
|
|
677
857
|
if (typeof y != "function")
|
|
678
858
|
throw new TypeError("The listener must be a function");
|
|
679
|
-
var
|
|
680
|
-
return
|
|
859
|
+
var S = new l(y, A || d, _), R = o ? o + v : v;
|
|
860
|
+
return d._events[R] ? d._events[R].fn ? d._events[R] = [d._events[R], S] : d._events[R].push(S) : (d._events[R] = S, d._eventsCount++), d;
|
|
681
861
|
}
|
|
682
|
-
function d
|
|
683
|
-
--
|
|
862
|
+
function f(d, v) {
|
|
863
|
+
--d._eventsCount === 0 ? d._events = new n() : delete d._events[v];
|
|
684
864
|
}
|
|
685
|
-
function
|
|
686
|
-
this._events = new
|
|
865
|
+
function g() {
|
|
866
|
+
this._events = new n(), this._eventsCount = 0;
|
|
687
867
|
}
|
|
688
|
-
|
|
689
|
-
var
|
|
690
|
-
if (this._eventsCount === 0) return
|
|
691
|
-
for (y in
|
|
692
|
-
|
|
693
|
-
return Object.getOwnPropertySymbols ?
|
|
694
|
-
},
|
|
695
|
-
var
|
|
868
|
+
g.prototype.eventNames = function() {
|
|
869
|
+
var d = [], v, y;
|
|
870
|
+
if (this._eventsCount === 0) return d;
|
|
871
|
+
for (y in v = this._events)
|
|
872
|
+
e.call(v, y) && d.push(o ? y.slice(1) : y);
|
|
873
|
+
return Object.getOwnPropertySymbols ? d.concat(Object.getOwnPropertySymbols(v)) : d;
|
|
874
|
+
}, g.prototype.listeners = function(d) {
|
|
875
|
+
var v = o ? o + d : d, y = this._events[v];
|
|
696
876
|
if (!y) return [];
|
|
697
877
|
if (y.fn) return [y.fn];
|
|
698
|
-
for (var
|
|
699
|
-
|
|
700
|
-
return
|
|
701
|
-
},
|
|
702
|
-
var
|
|
878
|
+
for (var A = 0, _ = y.length, S = new Array(_); A < _; A++)
|
|
879
|
+
S[A] = y[A].fn;
|
|
880
|
+
return S;
|
|
881
|
+
}, g.prototype.listenerCount = function(d) {
|
|
882
|
+
var v = o ? o + d : d, y = this._events[v];
|
|
703
883
|
return y ? y.fn ? 1 : y.length : 0;
|
|
704
|
-
},
|
|
705
|
-
var
|
|
706
|
-
if (!this._events[
|
|
707
|
-
var
|
|
708
|
-
if (
|
|
709
|
-
switch (
|
|
884
|
+
}, g.prototype.emit = function(d, v, y, A, _, S) {
|
|
885
|
+
var R = o ? o + d : d;
|
|
886
|
+
if (!this._events[R]) return !1;
|
|
887
|
+
var C = this._events[R], L = arguments.length, I, k;
|
|
888
|
+
if (C.fn) {
|
|
889
|
+
switch (C.once && this.removeListener(d, C.fn, void 0, !0), L) {
|
|
710
890
|
case 1:
|
|
711
|
-
return
|
|
891
|
+
return C.fn.call(C.context), !0;
|
|
712
892
|
case 2:
|
|
713
|
-
return
|
|
893
|
+
return C.fn.call(C.context, v), !0;
|
|
714
894
|
case 3:
|
|
715
|
-
return
|
|
895
|
+
return C.fn.call(C.context, v, y), !0;
|
|
716
896
|
case 4:
|
|
717
|
-
return
|
|
897
|
+
return C.fn.call(C.context, v, y, A), !0;
|
|
718
898
|
case 5:
|
|
719
|
-
return
|
|
899
|
+
return C.fn.call(C.context, v, y, A, _), !0;
|
|
720
900
|
case 6:
|
|
721
|
-
return
|
|
901
|
+
return C.fn.call(C.context, v, y, A, _, S), !0;
|
|
722
902
|
}
|
|
723
|
-
for (
|
|
724
|
-
|
|
725
|
-
|
|
903
|
+
for (k = 1, I = new Array(L - 1); k < L; k++)
|
|
904
|
+
I[k - 1] = arguments[k];
|
|
905
|
+
C.fn.apply(C.context, I);
|
|
726
906
|
} else {
|
|
727
|
-
var
|
|
728
|
-
for (
|
|
729
|
-
switch (
|
|
907
|
+
var z = C.length, B;
|
|
908
|
+
for (k = 0; k < z; k++)
|
|
909
|
+
switch (C[k].once && this.removeListener(d, C[k].fn, void 0, !0), L) {
|
|
730
910
|
case 1:
|
|
731
|
-
|
|
911
|
+
C[k].fn.call(C[k].context);
|
|
732
912
|
break;
|
|
733
913
|
case 2:
|
|
734
|
-
|
|
914
|
+
C[k].fn.call(C[k].context, v);
|
|
735
915
|
break;
|
|
736
916
|
case 3:
|
|
737
|
-
|
|
917
|
+
C[k].fn.call(C[k].context, v, y);
|
|
738
918
|
break;
|
|
739
919
|
case 4:
|
|
740
|
-
|
|
920
|
+
C[k].fn.call(C[k].context, v, y, A);
|
|
741
921
|
break;
|
|
742
922
|
default:
|
|
743
|
-
if (!
|
|
744
|
-
|
|
745
|
-
|
|
923
|
+
if (!I) for (B = 1, I = new Array(L - 1); B < L; B++)
|
|
924
|
+
I[B - 1] = arguments[B];
|
|
925
|
+
C[k].fn.apply(C[k].context, I);
|
|
746
926
|
}
|
|
747
927
|
}
|
|
748
928
|
return !0;
|
|
749
|
-
},
|
|
750
|
-
return
|
|
751
|
-
},
|
|
752
|
-
return
|
|
753
|
-
},
|
|
754
|
-
var
|
|
755
|
-
if (!this._events[
|
|
756
|
-
if (!
|
|
757
|
-
return
|
|
758
|
-
var
|
|
759
|
-
if (
|
|
760
|
-
|
|
929
|
+
}, g.prototype.on = function(d, v, y) {
|
|
930
|
+
return h(this, d, v, y, !1);
|
|
931
|
+
}, g.prototype.once = function(d, v, y) {
|
|
932
|
+
return h(this, d, v, y, !0);
|
|
933
|
+
}, g.prototype.removeListener = function(d, v, y, A) {
|
|
934
|
+
var _ = o ? o + d : d;
|
|
935
|
+
if (!this._events[_]) return this;
|
|
936
|
+
if (!v)
|
|
937
|
+
return f(this, _), this;
|
|
938
|
+
var S = this._events[_];
|
|
939
|
+
if (S.fn)
|
|
940
|
+
S.fn === v && (!A || S.once) && (!y || S.context === y) && f(this, _);
|
|
761
941
|
else {
|
|
762
|
-
for (var
|
|
763
|
-
(
|
|
764
|
-
|
|
942
|
+
for (var R = 0, C = [], L = S.length; R < L; R++)
|
|
943
|
+
(S[R].fn !== v || A && !S[R].once || y && S[R].context !== y) && C.push(S[R]);
|
|
944
|
+
C.length ? this._events[_] = C.length === 1 ? C[0] : C : f(this, _);
|
|
765
945
|
}
|
|
766
946
|
return this;
|
|
767
|
-
},
|
|
768
|
-
var
|
|
769
|
-
return
|
|
770
|
-
},
|
|
771
|
-
}(
|
|
947
|
+
}, g.prototype.removeAllListeners = function(d) {
|
|
948
|
+
var v;
|
|
949
|
+
return d ? (v = o ? o + d : d, this._events[v] && f(this, v)) : (this._events = new n(), this._eventsCount = 0), this;
|
|
950
|
+
}, g.prototype.off = g.prototype.removeListener, g.prototype.addListener = g.prototype.on, g.prefixed = o, g.EventEmitter = g, u.exports = g;
|
|
951
|
+
}(xr)), xr.exports;
|
|
772
952
|
}
|
|
773
|
-
var
|
|
774
|
-
const
|
|
775
|
-
class
|
|
776
|
-
constructor(
|
|
777
|
-
super(),
|
|
778
|
-
|
|
779
|
-
}),
|
|
780
|
-
if (!
|
|
953
|
+
var En = xn();
|
|
954
|
+
const Yr = /* @__PURE__ */ Ur(En);
|
|
955
|
+
class Vr extends Yr {
|
|
956
|
+
constructor(e, o) {
|
|
957
|
+
super(), x(this, "ogma"), x(this, "elements"), x(this, "layer"), x(this, "editor"), x(this, "selectedId", V), x(this, "hoveredId", V), x(this, "ogmaOptions"), x(this, "shouldDetect"), x(this, "isDragging"), x(this, "showeditorOnHover"), x(this, "_onKeyUp", (n) => {
|
|
958
|
+
n.code === 27 && this.selectedId !== V ? this.unselect() : (n.code === 46 || n.code === 8) && this.selectedId !== V && this._canRemove() && this.remove(this.selectedId);
|
|
959
|
+
}), x(this, "_onClickMouseMove", (n) => {
|
|
960
|
+
if (!n.domEvent || this.isDragging || !this.shouldDetect || n.domEvent.type !== "mousemove" && n.domEvent.target && n.domEvent.target.tagName === "a")
|
|
781
961
|
return;
|
|
782
|
-
const
|
|
783
|
-
|
|
784
|
-
}), this.ogma =
|
|
962
|
+
const l = this.ogma.view.screenToGraphCoordinates(n), h = this.shouldDetect || !this.shouldDetect && +this.selectedId > -1 ? this.detect(l, 0) : void 0;
|
|
963
|
+
n.domEvent.type === "mousemove" ? h ? this.hover(h.id) : this.hoveredId !== V && this.unhover() : h ? this.select(h.id) : this.selectedId !== V && this.unselect();
|
|
964
|
+
}), this.ogma = e, this.elements = [], this.shouldDetect = !0, this.isDragging = !1, this.showeditorOnHover = !0, this.ogmaOptions = e.getOptions(), e.events.on(["click", "mousemove"], this._onClickMouseMove).on("keyup", this._onKeyUp).on("frame", () => {
|
|
785
965
|
this.refreshEditor(), this.refreshDrawing();
|
|
786
|
-
}), this.layer =
|
|
787
|
-
draw: (
|
|
788
|
-
}), this.layer.moveToTop(), this.editor =
|
|
966
|
+
}), this.layer = e.layers.addSVGLayer({
|
|
967
|
+
draw: (n) => this.draw(n)
|
|
968
|
+
}), this.layer.moveToTop(), this.editor = e.layers.addLayer(o), this.editor.hide();
|
|
789
969
|
}
|
|
790
970
|
_canRemove() {
|
|
791
971
|
return !0;
|
|
@@ -795,39 +975,39 @@ class Fr extends zr {
|
|
|
795
975
|
* @param options Params for the annotation (merged with default)
|
|
796
976
|
* @returns the added annotation
|
|
797
977
|
*/
|
|
798
|
-
add(
|
|
799
|
-
const
|
|
800
|
-
id:
|
|
801
|
-
type:
|
|
978
|
+
add(e) {
|
|
979
|
+
const o = this.getDefaultOptions(), n = Object.assign(e, {
|
|
980
|
+
id: e.id === void 0 ? Ne() : e.id,
|
|
981
|
+
type: e.type,
|
|
802
982
|
properties: {
|
|
803
|
-
...
|
|
804
|
-
...
|
|
983
|
+
...o.properties,
|
|
984
|
+
...e.properties || {},
|
|
805
985
|
// styles need to be merged
|
|
806
|
-
style: { ...
|
|
986
|
+
style: { ...o.properties.style, ...e.properties.style || {} }
|
|
807
987
|
},
|
|
808
988
|
geometry: {
|
|
809
|
-
...
|
|
810
|
-
...
|
|
989
|
+
...o.geometry,
|
|
990
|
+
...e.geometry
|
|
811
991
|
}
|
|
812
992
|
});
|
|
813
|
-
return this.elements.push(
|
|
993
|
+
return this.elements.push(n), this.layer.refresh(), this.emit(hr, n), n;
|
|
814
994
|
}
|
|
815
|
-
updateStyle(
|
|
816
|
-
this.updateAnnotation(
|
|
995
|
+
updateStyle(e, o) {
|
|
996
|
+
this.updateAnnotation(e, {
|
|
817
997
|
properties: {
|
|
818
|
-
style:
|
|
998
|
+
style: o
|
|
819
999
|
}
|
|
820
1000
|
});
|
|
821
1001
|
}
|
|
822
|
-
updateGeometry(
|
|
823
|
-
this.updateAnnotation(
|
|
824
|
-
geometry:
|
|
1002
|
+
updateGeometry(e, o) {
|
|
1003
|
+
this.updateAnnotation(e, {
|
|
1004
|
+
geometry: o
|
|
825
1005
|
});
|
|
826
1006
|
}
|
|
827
|
-
scale(
|
|
1007
|
+
scale(e, o, n, l) {
|
|
828
1008
|
this.updateGeometry(
|
|
829
|
-
|
|
830
|
-
dn(
|
|
1009
|
+
e,
|
|
1010
|
+
dn(e.geometry, o, n, l)
|
|
831
1011
|
);
|
|
832
1012
|
}
|
|
833
1013
|
/**
|
|
@@ -836,37 +1016,37 @@ class Fr extends zr {
|
|
|
836
1016
|
* @param id Id of the annotation to update
|
|
837
1017
|
* @param element params of the annotation
|
|
838
1018
|
*/
|
|
839
|
-
update(
|
|
840
|
-
const
|
|
841
|
-
this.updateAnnotation(
|
|
842
|
-
}
|
|
843
|
-
updateAnnotation(
|
|
844
|
-
if (!
|
|
845
|
-
const
|
|
846
|
-
Object.keys(
|
|
847
|
-
if (
|
|
848
|
-
if (
|
|
849
|
-
const
|
|
850
|
-
|
|
851
|
-
...
|
|
852
|
-
...
|
|
1019
|
+
update(e, o) {
|
|
1020
|
+
const n = this.getById(e);
|
|
1021
|
+
this.updateAnnotation(n, o);
|
|
1022
|
+
}
|
|
1023
|
+
updateAnnotation(e, o) {
|
|
1024
|
+
if (!e) return;
|
|
1025
|
+
const n = e.id;
|
|
1026
|
+
Object.keys(o).forEach((l) => {
|
|
1027
|
+
if (l !== "id")
|
|
1028
|
+
if (l === "properties") {
|
|
1029
|
+
const h = o.properties || { style: {} };
|
|
1030
|
+
e.properties = {
|
|
1031
|
+
...e.properties || {},
|
|
1032
|
+
...h || {},
|
|
853
1033
|
style: {
|
|
854
|
-
...
|
|
855
|
-
...
|
|
1034
|
+
...e.properties.style || {},
|
|
1035
|
+
...h.style || {}
|
|
856
1036
|
}
|
|
857
1037
|
};
|
|
858
|
-
} else
|
|
859
|
-
...
|
|
860
|
-
...
|
|
861
|
-
} :
|
|
862
|
-
}),
|
|
863
|
-
}
|
|
864
|
-
getById(
|
|
865
|
-
const
|
|
866
|
-
for (let
|
|
867
|
-
const
|
|
868
|
-
if (!(
|
|
869
|
-
return
|
|
1038
|
+
} else l === "geometry" ? e.geometry = {
|
|
1039
|
+
...e.geometry,
|
|
1040
|
+
...o.geometry
|
|
1041
|
+
} : e[l] = o[l];
|
|
1042
|
+
}), n === this.selectedId && this.refreshEditor(), this.layer.refresh();
|
|
1043
|
+
}
|
|
1044
|
+
getById(e) {
|
|
1045
|
+
const o = Number(e);
|
|
1046
|
+
for (let n = 0; n < this.elements.length; n++) {
|
|
1047
|
+
const l = this.elements[n];
|
|
1048
|
+
if (!(l.id !== e && l.id !== o))
|
|
1049
|
+
return l;
|
|
870
1050
|
}
|
|
871
1051
|
}
|
|
872
1052
|
/**
|
|
@@ -874,33 +1054,33 @@ class Fr extends zr {
|
|
|
874
1054
|
* @param id id of the element to select
|
|
875
1055
|
* Select element, show editor, disable Ogma dragging and fire event
|
|
876
1056
|
*/
|
|
877
|
-
select(
|
|
878
|
-
const
|
|
879
|
-
|
|
1057
|
+
select(e) {
|
|
1058
|
+
const o = this.getById(e);
|
|
1059
|
+
o && (this.editor.show(), this.selectedId = e, this.refreshEditor(), this.layer.refresh(), this.emit(ar, o));
|
|
880
1060
|
}
|
|
881
|
-
hover(
|
|
882
|
-
const
|
|
883
|
-
|
|
1061
|
+
hover(e) {
|
|
1062
|
+
const o = this.getById(e);
|
|
1063
|
+
o && (this.showeditorOnHover && this.editor.show(), this.hoveredId = e, this.refreshEditor(), this.layer.refresh(), this.emit(vn, o));
|
|
884
1064
|
}
|
|
885
1065
|
getSelectedFeature() {
|
|
886
|
-
return this.selectedId ===
|
|
1066
|
+
return this.selectedId === V ? null : this.getById(this.selectedId);
|
|
887
1067
|
}
|
|
888
1068
|
unselect() {
|
|
889
|
-
const
|
|
890
|
-
return
|
|
1069
|
+
const e = this.getById(this.selectedId);
|
|
1070
|
+
return e && this.emit(lr, e), this.selectedId = V, this.hoveredId === V && this.editor.hide(), this.layer.refresh(), this;
|
|
891
1071
|
}
|
|
892
1072
|
unhover() {
|
|
893
|
-
const
|
|
894
|
-
return this.emit(
|
|
1073
|
+
const e = this.getById(this.hoveredId);
|
|
1074
|
+
return this.emit(mn, e), this.hoveredId = V, this.selectedId === V && this.editor.hide(), this.layer.refresh(), this;
|
|
895
1075
|
}
|
|
896
1076
|
/**
|
|
897
1077
|
* @method remove
|
|
898
1078
|
* @param id Id of the annotation to remove
|
|
899
1079
|
* Removes annotation with the given id
|
|
900
1080
|
*/
|
|
901
|
-
remove(
|
|
902
|
-
const
|
|
903
|
-
|
|
1081
|
+
remove(e) {
|
|
1082
|
+
const o = this.getById(e);
|
|
1083
|
+
e === this.hoveredId && this.unhover(), e === this.selectedId && this.unselect(), this.elements = this.elements.filter((n) => n.id !== e), o && this.emit(ur, o), this.layer.refresh();
|
|
904
1084
|
}
|
|
905
1085
|
/**
|
|
906
1086
|
* @method disableDragging
|
|
@@ -950,43 +1130,43 @@ class Fr extends zr {
|
|
|
950
1130
|
this.ogma.events.off(this._onClickMouseMove).off(this._onKeyUp), this.layer.destroy();
|
|
951
1131
|
}
|
|
952
1132
|
}
|
|
953
|
-
const
|
|
954
|
-
class
|
|
955
|
-
constructor(
|
|
1133
|
+
const Ar = "handle-line", kr = "handle-start", _r = "handle-end";
|
|
1134
|
+
class An extends Vr {
|
|
1135
|
+
constructor(e, o = {}) {
|
|
956
1136
|
super(
|
|
957
|
-
|
|
1137
|
+
e,
|
|
958
1138
|
`
|
|
959
1139
|
<div class="arrow-handle">
|
|
960
|
-
<div id="${
|
|
961
|
-
<div id="${
|
|
962
|
-
<div id="${
|
|
1140
|
+
<div id="${Ar}" data-handle-id="0" class="handle line"></div>
|
|
1141
|
+
<div id="${kr}" data-handle-id="1" class="handle point"></div>
|
|
1142
|
+
<div id="${_r}" data-handle-id="2" class="handle point"></div>
|
|
963
1143
|
</div>
|
|
964
1144
|
`
|
|
965
|
-
),
|
|
966
|
-
const
|
|
967
|
-
if (!
|
|
968
|
-
const { x:
|
|
969
|
-
this.startDragging(
|
|
970
|
-
}),
|
|
971
|
-
this.draggedHandle !== -1 && (this.restoreDragging(), this.isDragging = !1, this.draggedHandle =
|
|
972
|
-
}),
|
|
973
|
-
if (!this.isDragging || this.draggedHandle ===
|
|
974
|
-
const
|
|
975
|
-
|
|
976
|
-
{ x:
|
|
1145
|
+
), x(this, "draggedHandle", V), x(this, "start", { x: 0, y: 0 }), x(this, "end", { x: 0, y: 0 }), x(this, "arrow", { ...yr }), x(this, "startX", 0), x(this, "startY", 0), x(this, "minArrowHeight", 0), x(this, "maxArrowHeight", 0), x(this, "handles", []), x(this, "onHandleMouseDown", (n) => {
|
|
1146
|
+
const l = this.getById(this.selectedId) || this.getById(this.hoveredId);
|
|
1147
|
+
if (!l) return;
|
|
1148
|
+
const { x: h, y: f } = sr(n, this.ogma.getContainer());
|
|
1149
|
+
this.startDragging(l, h, f), this.draggedHandle = Nr(n.target);
|
|
1150
|
+
}), x(this, "onMouseUp", () => {
|
|
1151
|
+
this.draggedHandle !== -1 && (this.restoreDragging(), this.isDragging = !1, this.draggedHandle = V, this.emit(Ut, this.arrow));
|
|
1152
|
+
}), x(this, "onMouseMove", (n) => {
|
|
1153
|
+
if (!this.isDragging || this.draggedHandle === V) return;
|
|
1154
|
+
const l = this.handles[this.draggedHandle], h = this.ogma.view.getAngle(), { x: f, y: g } = st(
|
|
1155
|
+
fn(
|
|
1156
|
+
{ x: n.x - this.startX, y: n.y - this.startY },
|
|
977
1157
|
this.ogma.view.getZoom()
|
|
978
1158
|
),
|
|
979
|
-
|
|
980
|
-
),
|
|
981
|
-
(
|
|
982
|
-
|
|
1159
|
+
h
|
|
1160
|
+
), d = l.id === Ar, v = l.id === kr, y = l.id === _r;
|
|
1161
|
+
(d || v) && Mr(this.arrow, this.start.x + f, this.start.y + g), (d || y) && zr(this.arrow, this.end.x + f, this.end.y + g), this.emit(
|
|
1162
|
+
Me,
|
|
983
1163
|
this.arrow,
|
|
984
|
-
|
|
1164
|
+
d ? "line" : v ? "start" : "end"
|
|
985
1165
|
), this.refreshEditor(), this.layer.refresh();
|
|
986
|
-
}), this.minArrowHeight =
|
|
1166
|
+
}), this.minArrowHeight = o.minArrowHeight || 0, this.maxArrowHeight = o.maxArrowHeight || 1e6, this.handles = Array.prototype.slice.call(
|
|
987
1167
|
this.editor.element.querySelectorAll(".arrow-handle>.handle")
|
|
988
1168
|
), this.handles.forEach(
|
|
989
|
-
(
|
|
1169
|
+
(n) => n.addEventListener("mousedown", this.onHandleMouseDown)
|
|
990
1170
|
), document.addEventListener("mousemove", this.onMouseMove, !0), document.addEventListener("mouseup", this.onMouseUp);
|
|
991
1171
|
}
|
|
992
1172
|
/**
|
|
@@ -995,68 +1175,68 @@ class Cn extends Fr {
|
|
|
995
1175
|
* @param y
|
|
996
1176
|
* @param arrow
|
|
997
1177
|
*/
|
|
998
|
-
startDrawing(
|
|
999
|
-
var
|
|
1000
|
-
this.disableDragging(), this.add(
|
|
1001
|
-
const
|
|
1178
|
+
startDrawing(e, o, n = an(e, o, e, o, fe)) {
|
|
1179
|
+
var l;
|
|
1180
|
+
this.disableDragging(), this.add(n), this.hoveredId = n.id;
|
|
1181
|
+
const h = this.ogma.view.graphToScreenCoordinates({ x: e, y: o }), f = ((l = this.ogma.getContainer()) == null ? void 0 : l.getBoundingClientRect()) || {
|
|
1002
1182
|
left: 0,
|
|
1003
1183
|
top: 0
|
|
1004
1184
|
};
|
|
1005
1185
|
this.startDragging(
|
|
1006
|
-
this.getById(
|
|
1007
|
-
|
|
1008
|
-
|
|
1186
|
+
this.getById(n.id),
|
|
1187
|
+
h.x + (f == null ? void 0 : f.left),
|
|
1188
|
+
h.y + f.top
|
|
1009
1189
|
), this.draggedHandle = 2;
|
|
1010
1190
|
}
|
|
1011
1191
|
cancelDrawing() {
|
|
1012
|
-
this.isDragging && (this.remove(this.arrow.id), this.emit(
|
|
1013
|
-
}
|
|
1014
|
-
startDragging(
|
|
1015
|
-
this.selectedId !==
|
|
1016
|
-
}
|
|
1017
|
-
detect(
|
|
1018
|
-
return this.elements.find((
|
|
1019
|
-
const { start:
|
|
1020
|
-
x: (
|
|
1021
|
-
y: (
|
|
1022
|
-
}),
|
|
1023
|
-
return Math.abs(
|
|
1192
|
+
this.isDragging && (this.remove(this.arrow.id), this.emit(Ut, this.arrow), this.restoreDragging(), this.isDragging = !1, this.draggedHandle = V);
|
|
1193
|
+
}
|
|
1194
|
+
startDragging(e, o, n) {
|
|
1195
|
+
this.selectedId !== e.id && this.select(this.hoveredId), this.arrow = e, this.startX = o, this.startY = n, this.start = de(this.arrow), this.end = je(this.arrow), this.disableDragging(), this.emit(ze, this.arrow), this.isDragging = !0;
|
|
1196
|
+
}
|
|
1197
|
+
detect(e, o = 0) {
|
|
1198
|
+
return this.elements.find((n) => {
|
|
1199
|
+
const { start: l, end: h } = Fe(n), f = Ot(e, {
|
|
1200
|
+
x: (l.x + h.x) / 2,
|
|
1201
|
+
y: (l.y + h.y) / 2
|
|
1202
|
+
}), g = Ot(h, l), d = qt(g), v = Br(g), y = Wr(n);
|
|
1203
|
+
return Math.abs(vr(v, f)) < d / 2 + o && Math.abs(vr(st(v, Math.PI / 2), f)) < y / 2 + o;
|
|
1024
1204
|
});
|
|
1025
1205
|
}
|
|
1026
1206
|
refreshEditor() {
|
|
1027
1207
|
if (+this.selectedId < 0 && +this.hoveredId < 0) return;
|
|
1028
|
-
const
|
|
1208
|
+
const e = this.selectedId !== V ? this.getById(this.selectedId) : this.getById(this.hoveredId), o = Fe(e), n = this.ogma.view.graphToScreenCoordinates(o.start), l = this.ogma.view.graphToScreenCoordinates(o.end), [h, f, g] = Array.prototype.slice.call(
|
|
1029
1209
|
this.editor.element.querySelectorAll(".handle")
|
|
1030
1210
|
);
|
|
1031
|
-
|
|
1032
|
-
const
|
|
1033
|
-
x: (
|
|
1034
|
-
y: (
|
|
1035
|
-
},
|
|
1036
|
-
|
|
1211
|
+
f.style.transform = `translate(${n.x}px, ${n.y}px) translate(-50%, -50%)`, g.style.transform = `translate(${l.x}px, ${l.y}px) translate(-50%, -50%)`;
|
|
1212
|
+
const d = {
|
|
1213
|
+
x: (l.x + n.x) / 2,
|
|
1214
|
+
y: (l.y + n.y) / 2
|
|
1215
|
+
}, v = Ot(l, n), y = qr(v, 1 / qt(v)), A = Math.atan2(y.y, y.x);
|
|
1216
|
+
h.style.width = `${qt(v)}px`, h.style.left = `${d.x}px`, h.style.top = `${d.y}px`, h.style.transform = `translate(-50%, -50%) rotate(${A}rad)`;
|
|
1037
1217
|
}
|
|
1038
1218
|
getDefaultOptions() {
|
|
1039
|
-
return
|
|
1219
|
+
return yr;
|
|
1040
1220
|
}
|
|
1041
|
-
draw(
|
|
1042
|
-
|
|
1043
|
-
const
|
|
1044
|
-
|
|
1045
|
-
(
|
|
1046
|
-
),
|
|
1221
|
+
draw(e) {
|
|
1222
|
+
e.innerHTML = "";
|
|
1223
|
+
const o = Rt("g"), n = this.ogma.view.getAngle();
|
|
1224
|
+
n !== 0 && o.setAttribute("transform", `rotate(${-n * (180 / Math.PI)})`), this.elements.forEach(
|
|
1225
|
+
(l) => pn(l, o, fe, this.minArrowHeight, this.maxArrowHeight)
|
|
1226
|
+
), e.appendChild(o);
|
|
1047
1227
|
}
|
|
1048
1228
|
refreshDrawing() {
|
|
1049
|
-
const
|
|
1050
|
-
this.layer.element !== null &&
|
|
1229
|
+
const e = this.ogma.view.getAngle();
|
|
1230
|
+
this.layer.element !== null && e !== 0 && this.layer.element.children[0].setAttribute(
|
|
1051
1231
|
"transform",
|
|
1052
|
-
`rotate(${-
|
|
1232
|
+
`rotate(${-e * (180 / Math.PI)})`
|
|
1053
1233
|
);
|
|
1054
1234
|
}
|
|
1055
1235
|
destroy() {
|
|
1056
1236
|
super.destroy(), document.removeEventListener("mousemove", this.onMouseMove, !0), document.removeEventListener("mouseup", this.onMouseUp);
|
|
1057
1237
|
}
|
|
1058
1238
|
}
|
|
1059
|
-
const
|
|
1239
|
+
const Wt = {
|
|
1060
1240
|
font: "sans-serif",
|
|
1061
1241
|
fontSize: 18,
|
|
1062
1242
|
color: "#505050",
|
|
@@ -1065,13 +1245,13 @@ const Kt = {
|
|
|
1065
1245
|
borderRadius: 8,
|
|
1066
1246
|
padding: 16,
|
|
1067
1247
|
strokeType: "plain"
|
|
1068
|
-
},
|
|
1248
|
+
}, nr = {
|
|
1069
1249
|
id: 0,
|
|
1070
1250
|
type: "Feature",
|
|
1071
1251
|
properties: {
|
|
1072
1252
|
type: "text",
|
|
1073
1253
|
content: "",
|
|
1074
|
-
style: { ...
|
|
1254
|
+
style: { ...Wt }
|
|
1075
1255
|
},
|
|
1076
1256
|
geometry: {
|
|
1077
1257
|
type: "Polygon",
|
|
@@ -1087,122 +1267,122 @@ const Kt = {
|
|
|
1087
1267
|
}
|
|
1088
1268
|
// position: { x: 0, y: 0 },
|
|
1089
1269
|
// size: { width: 100, height: 50 }
|
|
1090
|
-
},
|
|
1270
|
+
}, Sr = {
|
|
1091
1271
|
handleSize: 3.5,
|
|
1092
1272
|
placeholder: "Your text..."
|
|
1093
|
-
},
|
|
1094
|
-
id:
|
|
1273
|
+
}, kn = (u = 0, e = 0, o = 100, n = 50, l = "", h = { ...Wt }) => ({
|
|
1274
|
+
id: Ne(),
|
|
1095
1275
|
type: "Feature",
|
|
1096
1276
|
properties: {
|
|
1097
1277
|
type: "text",
|
|
1098
|
-
content:
|
|
1099
|
-
style: { ...
|
|
1278
|
+
content: l,
|
|
1279
|
+
style: { ...Wt, ...h }
|
|
1100
1280
|
},
|
|
1101
1281
|
geometry: {
|
|
1102
1282
|
type: "Polygon",
|
|
1103
1283
|
coordinates: [
|
|
1104
1284
|
[
|
|
1105
|
-
[
|
|
1106
|
-
[
|
|
1107
|
-
[
|
|
1108
|
-
[
|
|
1109
|
-
[
|
|
1285
|
+
[u, e],
|
|
1286
|
+
[u + o, e],
|
|
1287
|
+
[u + o, e + n],
|
|
1288
|
+
[u, e + n],
|
|
1289
|
+
[u, e]
|
|
1110
1290
|
]
|
|
1111
1291
|
]
|
|
1112
1292
|
}
|
|
1113
1293
|
});
|
|
1114
|
-
var
|
|
1115
|
-
function
|
|
1116
|
-
return
|
|
1117
|
-
(function(
|
|
1118
|
-
|
|
1119
|
-
})(
|
|
1120
|
-
var
|
|
1121
|
-
for (var
|
|
1122
|
-
}, o: (
|
|
1123
|
-
function
|
|
1124
|
-
return
|
|
1125
|
-
return typeof
|
|
1126
|
-
} : function(
|
|
1127
|
-
return
|
|
1128
|
-
},
|
|
1129
|
-
}
|
|
1130
|
-
|
|
1131
|
-
var
|
|
1132
|
-
function
|
|
1133
|
-
var
|
|
1134
|
-
return
|
|
1135
|
-
}
|
|
1136
|
-
var
|
|
1137
|
-
function
|
|
1138
|
-
var
|
|
1139
|
-
|
|
1140
|
-
var
|
|
1141
|
-
|
|
1142
|
-
var
|
|
1143
|
-
if (
|
|
1294
|
+
var dr = { exports: {} }, _n = dr.exports, Cr;
|
|
1295
|
+
function Sn() {
|
|
1296
|
+
return Cr || (Cr = 1, function(u, e) {
|
|
1297
|
+
(function(o, n) {
|
|
1298
|
+
u.exports = n();
|
|
1299
|
+
})(_n, () => (() => {
|
|
1300
|
+
var o = { d: (r, i) => {
|
|
1301
|
+
for (var a in i) o.o(i, a) && !o.o(r, a) && Object.defineProperty(r, a, { enumerable: !0, get: i[a] });
|
|
1302
|
+
}, o: (r, i) => Object.prototype.hasOwnProperty.call(r, i) }, n = {};
|
|
1303
|
+
function l(r) {
|
|
1304
|
+
return l = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(i) {
|
|
1305
|
+
return typeof i;
|
|
1306
|
+
} : function(i) {
|
|
1307
|
+
return i && typeof Symbol == "function" && i.constructor === Symbol && i !== Symbol.prototype ? "symbol" : typeof i;
|
|
1308
|
+
}, l(r);
|
|
1309
|
+
}
|
|
1310
|
+
o.d(n, { default: () => Qe });
|
|
1311
|
+
var h = /^((?:[a-z\d-]+\s+)*)([\d.]+(%|em|px)|(?:x+-)?large|(?:x+-)?small|medium)(?:\s*\/\s*(normal|[\d.]+(%|px|em)?))?(\s.+)?$/, f = /\bsmall-caps\b/, g = /\b(?:italic|oblique)\b/, d = /\bbold(?:er)?\b/, v = 13.3333333, y = { "xx-small": 9, "x-small": 10, smaller: 13.3333, small: 13, medium: 16, large: 18, larger: 19.2, "x-large": 24, "xx-large": 32 };
|
|
1312
|
+
function A(r) {
|
|
1313
|
+
var i = "", a = this;
|
|
1314
|
+
return a.style && a.style !== "normal" && (i += a.style), a.variant && a.variant !== "normal" && (i += (i ? " " : "") + a.variant), a.weight && a.weight !== "normal" && (i += (i ? " " : "") + a.weight), a.size && (i += (i ? " " : "") + a.size + "px", a.height !== a.size && (i += "/" + a.height + "px")), a.family && (i += (i ? " " : "") + a.family), r && (i += "::" + a.baseline), r && (i += "::" + a.color), i;
|
|
1315
|
+
}
|
|
1316
|
+
var _ = { id: "", family: "sans-serif", height: 14, size: 12, variant: "", style: "", weight: "", baseline: "", color: null, toString: A, valueOf: A };
|
|
1317
|
+
function S(r) {
|
|
1318
|
+
var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = h.exec(r);
|
|
1319
|
+
i.family = (a[6] || "").trim();
|
|
1320
|
+
var t = y[a[2]] || parseFloat(a[2]);
|
|
1321
|
+
a[3] === "%" ? t *= 0.16 : a[3] === "em" ? t *= 16 : a[3] === "pt" && (t *= v), i.size = t;
|
|
1322
|
+
var s = parseFloat(a[4]);
|
|
1323
|
+
if (s !== "normal" && s !== "inherit" && s ? a[5] && a[5] !== "em" ? a[5] === "pt" ? i.height = s * v : a[5] === "%" ? i.height = 0.01 * t : i.height = s : i.height = s * t : i.height = Math.round(t * (7 / 6)), f.test(a[1]) && (i.variant = "small-caps"), g.test(a[1]) && (i.style = "italic"), d.test(a[1])) i.weight = "bold";
|
|
1144
1324
|
else {
|
|
1145
|
-
var
|
|
1146
|
-
|
|
1325
|
+
var c = parseInt(/\b(\d+)\b/.exec(a[1]), 10);
|
|
1326
|
+
c >= 100 && c !== 400 && (i.weight = c);
|
|
1147
1327
|
}
|
|
1148
|
-
return
|
|
1149
|
-
}
|
|
1150
|
-
function
|
|
1151
|
-
var
|
|
1152
|
-
if (
|
|
1153
|
-
var
|
|
1154
|
-
|
|
1155
|
-
} else if (typeof
|
|
1156
|
-
var
|
|
1157
|
-
|
|
1158
|
-
} else
|
|
1159
|
-
|
|
1160
|
-
var
|
|
1161
|
-
return
|
|
1162
|
-
}
|
|
1163
|
-
const
|
|
1164
|
-
var
|
|
1165
|
-
var
|
|
1166
|
-
if (
|
|
1167
|
-
var
|
|
1168
|
-
if (
|
|
1169
|
-
return
|
|
1328
|
+
return i;
|
|
1329
|
+
}
|
|
1330
|
+
function R() {
|
|
1331
|
+
var r, i, a, t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "12px/14px sans-serif", s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, c = 14, p = 12, m = null, w = null, b = "";
|
|
1332
|
+
if (t && t.nodeType) {
|
|
1333
|
+
var E = t && (t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView), D = E.getComputedStyle(t, null);
|
|
1334
|
+
r = D.getPropertyValue("font-family") || "", p = parseFloat(D.getPropertyValue("font-size")), c = D.getPropertyValue("line-height"), m = D.getPropertyValue("font-weight"), w = D.getPropertyValue("font-style"), b = D.getPropertyValue("font-variant") || "";
|
|
1335
|
+
} else if (typeof t == "string") {
|
|
1336
|
+
var T = S(t);
|
|
1337
|
+
r = T.family, p = T.size, c = T.height, b = T.variant, w = T.style, m = T.weight;
|
|
1338
|
+
} else l(t) === "object" && (r = t.family, p = t.size, c = t.height, b = t.variant, m = t.weight, w = t.style, i = t.baseline, a = t.color);
|
|
1339
|
+
s.size && s.size < 3 && (p *= s.size), c = c !== "normal" && c ? parseFloat(c) : p * (7 / 6), s.height && s.height < 3 && (c *= s.height);
|
|
1340
|
+
var O = Object.create(_);
|
|
1341
|
+
return O.family = s.family || r || "sans-serif", O.height = c ?? 14, O.size = p ?? 12, O.variant = s.variant || b || "", O.style = s.style || w || "", O.weight = s.weight || m || "", O.baseline = i || 0, s.baseline != null && (O.baseline = s.baseline), O.color = s.color || a || "", O.id = A.call(O, !0), O;
|
|
1342
|
+
}
|
|
1343
|
+
const C = { "\n": 0.28, "\r": 0.28, " ": 0.28, " ": 0.28, " ": 0.28, "": 0, " ": 0.5, " ": 1, " ": 0.5, " ": 1, " ": 0.33, " ": 0.25, " ": 0.16, " ": 0.56, " ": 0.28, " ": 0.2, " ": 0.15, "": 0, " ": 0.16, " ": 0.22, " ": 1, "\uFEFF": 0 };
|
|
1344
|
+
var L, I = function(r) {
|
|
1345
|
+
var i = typeof OffscreenCanvas < "u" && new OffscreenCanvas(100, 100) || r && r.createElement("canvas");
|
|
1346
|
+
if (i && i.getContext) {
|
|
1347
|
+
var a = i.getContext("2d");
|
|
1348
|
+
if (a && typeof a.measureText == "function") return function(t, s) {
|
|
1349
|
+
return a.font = String(s), a.measureText(t).width;
|
|
1170
1350
|
};
|
|
1171
1351
|
}
|
|
1172
|
-
}(typeof document < "u" ? document : null) || (
|
|
1173
|
-
if (!
|
|
1174
|
-
var
|
|
1175
|
-
|
|
1352
|
+
}(typeof document < "u" ? document : null) || (L = {}, function(r, i) {
|
|
1353
|
+
if (!L[i]) {
|
|
1354
|
+
var a = R(i);
|
|
1355
|
+
L[i] = a, /\bmonospace\b/.test(a.family) ? a.size *= 0.6 : (a.size *= 0.45, a.weight && (a.size *= 1.18));
|
|
1176
1356
|
}
|
|
1177
|
-
return
|
|
1178
|
-
}),
|
|
1179
|
-
function
|
|
1180
|
-
var
|
|
1181
|
-
if (!
|
|
1182
|
-
if (
|
|
1183
|
-
var
|
|
1184
|
-
return
|
|
1357
|
+
return r.length * L[i].size;
|
|
1358
|
+
}), k = {}, z = { trim: !0, collapse: !0 };
|
|
1359
|
+
function B(r, i, a) {
|
|
1360
|
+
var t = Object.assign({}, z, a), s = String(r);
|
|
1361
|
+
if (!s) return 0;
|
|
1362
|
+
if (s in C) {
|
|
1363
|
+
var c = i.id + "/" + s;
|
|
1364
|
+
return c in k || (k[c] = I("_".concat(s, "_"), i) - I("__", i)), k[c];
|
|
1185
1365
|
}
|
|
1186
|
-
return
|
|
1187
|
-
}
|
|
1188
|
-
function
|
|
1189
|
-
return
|
|
1190
|
-
return typeof
|
|
1191
|
-
} : function(
|
|
1192
|
-
return
|
|
1193
|
-
},
|
|
1194
|
-
}
|
|
1195
|
-
function
|
|
1196
|
-
if (typeof
|
|
1197
|
-
|
|
1198
|
-
}
|
|
1199
|
-
function
|
|
1200
|
-
return
|
|
1201
|
-
return
|
|
1202
|
-
},
|
|
1203
|
-
}
|
|
1204
|
-
function
|
|
1205
|
-
var
|
|
1366
|
+
return t.trim && t.collapse ? t.trim ? s = s.trim() : t.collapse && (s = s.replace(/\s+/g, " ")) : s = s.replace(/\n/g, " "), I(s, i) + i.size * (r.tracking || 0);
|
|
1367
|
+
}
|
|
1368
|
+
function tt(r) {
|
|
1369
|
+
return tt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(i) {
|
|
1370
|
+
return typeof i;
|
|
1371
|
+
} : function(i) {
|
|
1372
|
+
return i && typeof Symbol == "function" && i.constructor === Symbol && i !== Symbol.prototype ? "symbol" : typeof i;
|
|
1373
|
+
}, tt(r);
|
|
1374
|
+
}
|
|
1375
|
+
function rt(r, i) {
|
|
1376
|
+
if (typeof i != "function" && i !== null) throw new TypeError("Super expression must either be null or a function");
|
|
1377
|
+
r.prototype = Object.create(i && i.prototype, { constructor: { value: r, writable: !0, configurable: !0 } }), Object.defineProperty(r, "prototype", { writable: !1 }), i && Yt(r, i);
|
|
1378
|
+
}
|
|
1379
|
+
function Yt(r, i) {
|
|
1380
|
+
return Yt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(a, t) {
|
|
1381
|
+
return a.__proto__ = t, a;
|
|
1382
|
+
}, Yt(r, i);
|
|
1383
|
+
}
|
|
1384
|
+
function Vt(r) {
|
|
1385
|
+
var i = function() {
|
|
1206
1386
|
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
|
|
1207
1387
|
if (typeof Proxy == "function") return !0;
|
|
1208
1388
|
try {
|
|
@@ -1213,696 +1393,696 @@ function $n() {
|
|
|
1213
1393
|
}
|
|
1214
1394
|
}();
|
|
1215
1395
|
return function() {
|
|
1216
|
-
var
|
|
1217
|
-
if (
|
|
1218
|
-
var
|
|
1219
|
-
|
|
1220
|
-
} else
|
|
1221
|
-
return ge(this,
|
|
1396
|
+
var a, t = Dt(r);
|
|
1397
|
+
if (i) {
|
|
1398
|
+
var s = Dt(this).constructor;
|
|
1399
|
+
a = Reflect.construct(t, arguments, s);
|
|
1400
|
+
} else a = t.apply(this, arguments);
|
|
1401
|
+
return ge(this, a);
|
|
1222
1402
|
};
|
|
1223
1403
|
}
|
|
1224
|
-
function ge(
|
|
1225
|
-
if (
|
|
1226
|
-
if (
|
|
1227
|
-
return function(
|
|
1228
|
-
if (
|
|
1229
|
-
return
|
|
1230
|
-
}(
|
|
1231
|
-
}
|
|
1232
|
-
function
|
|
1233
|
-
return
|
|
1234
|
-
return
|
|
1235
|
-
},
|
|
1236
|
-
}
|
|
1237
|
-
function
|
|
1238
|
-
if (!(
|
|
1239
|
-
}
|
|
1240
|
-
function
|
|
1241
|
-
for (var
|
|
1242
|
-
var
|
|
1243
|
-
|
|
1244
|
-
if (
|
|
1245
|
-
var
|
|
1246
|
-
if (
|
|
1247
|
-
var
|
|
1248
|
-
if (
|
|
1404
|
+
function ge(r, i) {
|
|
1405
|
+
if (i && (tt(i) === "object" || typeof i == "function")) return i;
|
|
1406
|
+
if (i !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
|
|
1407
|
+
return function(a) {
|
|
1408
|
+
if (a === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1409
|
+
return a;
|
|
1410
|
+
}(r);
|
|
1411
|
+
}
|
|
1412
|
+
function Dt(r) {
|
|
1413
|
+
return Dt = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(i) {
|
|
1414
|
+
return i.__proto__ || Object.getPrototypeOf(i);
|
|
1415
|
+
}, Dt(r);
|
|
1416
|
+
}
|
|
1417
|
+
function Pt(r, i) {
|
|
1418
|
+
if (!(r instanceof i)) throw new TypeError("Cannot call a class as a function");
|
|
1419
|
+
}
|
|
1420
|
+
function pe(r, i) {
|
|
1421
|
+
for (var a = 0; a < i.length; a++) {
|
|
1422
|
+
var t = i[a];
|
|
1423
|
+
t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(r, (s = function(c, p) {
|
|
1424
|
+
if (tt(c) !== "object" || c === null) return c;
|
|
1425
|
+
var m = c[Symbol.toPrimitive];
|
|
1426
|
+
if (m !== void 0) {
|
|
1427
|
+
var w = m.call(c, p);
|
|
1428
|
+
if (tt(w) !== "object") return w;
|
|
1249
1429
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1250
1430
|
}
|
|
1251
|
-
return String(
|
|
1252
|
-
}(
|
|
1431
|
+
return String(c);
|
|
1432
|
+
}(t.key, "string"), tt(s) === "symbol" ? s : String(s)), t);
|
|
1253
1433
|
}
|
|
1254
|
-
var
|
|
1434
|
+
var s;
|
|
1255
1435
|
}
|
|
1256
|
-
function
|
|
1257
|
-
return
|
|
1436
|
+
function it(r, i, a) {
|
|
1437
|
+
return i && pe(r.prototype, i), Object.defineProperty(r, "prototype", { writable: !1 }), r;
|
|
1258
1438
|
}
|
|
1259
|
-
var
|
|
1260
|
-
function
|
|
1261
|
-
var
|
|
1262
|
-
|
|
1439
|
+
var M = function() {
|
|
1440
|
+
function r() {
|
|
1441
|
+
var i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
1442
|
+
Pt(this, r), this.value = i, this.weight = null, this.style = null, this.font = null, this.href = null, this.sub = !1, this.sup = !1;
|
|
1263
1443
|
}
|
|
1264
|
-
return
|
|
1265
|
-
var
|
|
1266
|
-
return
|
|
1444
|
+
return it(r, [{ key: "clone", value: function() {
|
|
1445
|
+
var i = new r(this.value);
|
|
1446
|
+
return i.value = this.value, i.weight = this.weight, i.style = this.style, i.font = this.font, i.href = this.href, i.sub = this.sub, i.sup = this.sup, i;
|
|
1267
1447
|
} }, { key: "valueOf", value: function() {
|
|
1268
1448
|
return this.value;
|
|
1269
1449
|
} }, { key: "toString", value: function() {
|
|
1270
1450
|
return this.value;
|
|
1271
|
-
} }]),
|
|
1272
|
-
}(),
|
|
1273
|
-
|
|
1274
|
-
var
|
|
1275
|
-
function
|
|
1276
|
-
return
|
|
1451
|
+
} }]), r;
|
|
1452
|
+
}(), lt = function(r) {
|
|
1453
|
+
rt(a, r);
|
|
1454
|
+
var i = Vt(a);
|
|
1455
|
+
function a() {
|
|
1456
|
+
return Pt(this, a), i.apply(this, arguments);
|
|
1277
1457
|
}
|
|
1278
|
-
return
|
|
1279
|
-
}(
|
|
1280
|
-
|
|
1281
|
-
var
|
|
1282
|
-
function
|
|
1283
|
-
return
|
|
1458
|
+
return it(a);
|
|
1459
|
+
}(M), X = function(r) {
|
|
1460
|
+
rt(a, r);
|
|
1461
|
+
var i = Vt(a);
|
|
1462
|
+
function a() {
|
|
1463
|
+
return Pt(this, a), i.apply(this, arguments);
|
|
1284
1464
|
}
|
|
1285
|
-
return
|
|
1286
|
-
}(
|
|
1287
|
-
|
|
1288
|
-
var
|
|
1289
|
-
function
|
|
1290
|
-
return
|
|
1465
|
+
return it(a);
|
|
1466
|
+
}(M), ut = function(r) {
|
|
1467
|
+
rt(a, r);
|
|
1468
|
+
var i = Vt(a);
|
|
1469
|
+
function a() {
|
|
1470
|
+
return Pt(this, a), i.apply(this, arguments);
|
|
1291
1471
|
}
|
|
1292
|
-
return
|
|
1293
|
-
}(
|
|
1294
|
-
function
|
|
1295
|
-
|
|
1296
|
-
for (var
|
|
1297
|
-
|
|
1298
|
-
var
|
|
1299
|
-
if ((
|
|
1300
|
-
var
|
|
1301
|
-
/\u00AD$/.test(
|
|
1472
|
+
return it(a);
|
|
1473
|
+
}(M), Lt = /^[\n\r\t\x20\xA0\u2000-\u200B\u205F\u3000]/, ye = /^[^\n\r\t\u0020\u2000-\u200B\u205F\u3000]{2,}/, Xt = /^[\xA0\u2011\u202F\u2060\uFEFF]/, ve = /^(?:[;\xAD%?…]|,(?!\d))/, me = /^[´±°¢£¤$¥\u2212]/;
|
|
1474
|
+
function kt(r, i) {
|
|
1475
|
+
i !== !1 && (r = r.trim());
|
|
1476
|
+
for (var a, t, s = [], c = r.charAt(0), p = 0, m = 1, w = r.length; m < w; m++) {
|
|
1477
|
+
a = r.charAt(m), t = r.charAt(m + 1);
|
|
1478
|
+
var b = Lt.test(c), E = Lt.test(a), D = E || b, T = void 0;
|
|
1479
|
+
if ((me.test(a) && !Xt.test(c) || ve.test(c + t) && !Xt.test(a)) && (D = !0), c !== "-" && c !== "‐" && c !== "–" && c !== "—" || ((T = Lt.test(r.charAt(m - 2))) && !E && (D = !1), !T && ye.test(a + t) && (D = !0)), D) {
|
|
1480
|
+
var O = r.slice(p, m);
|
|
1481
|
+
/\u00AD$/.test(O) ? (s.push(new M(O.slice(0, -1))), s.push(new ut())) : (s.push(new M(O)), s.push(new lt())), p = m;
|
|
1302
1482
|
}
|
|
1303
|
-
|
|
1483
|
+
c = a;
|
|
1304
1484
|
}
|
|
1305
|
-
return
|
|
1306
|
-
}
|
|
1307
|
-
const
|
|
1308
|
-
var
|
|
1309
|
-
|
|
1310
|
-
}, strong: function(
|
|
1311
|
-
|
|
1312
|
-
}, i: function(
|
|
1313
|
-
|
|
1314
|
-
}, em: function(
|
|
1315
|
-
|
|
1316
|
-
}, dfn: function(
|
|
1317
|
-
|
|
1318
|
-
}, cite: function(
|
|
1319
|
-
|
|
1320
|
-
}, code: function(
|
|
1321
|
-
|
|
1322
|
-
}, kbd: function(
|
|
1323
|
-
|
|
1324
|
-
}, samp: function(
|
|
1325
|
-
|
|
1326
|
-
}, var: function(
|
|
1327
|
-
|
|
1328
|
-
}, tt: function(
|
|
1329
|
-
|
|
1330
|
-
}, sub: function(
|
|
1331
|
-
|
|
1332
|
-
}, sup: function(
|
|
1333
|
-
|
|
1334
|
-
} },
|
|
1335
|
-
function
|
|
1336
|
-
return
|
|
1337
|
-
if (
|
|
1338
|
-
var
|
|
1339
|
-
return String.fromCharCode(parseInt(
|
|
1485
|
+
return s.push(new M(r.slice(p))), s;
|
|
1486
|
+
}
|
|
1487
|
+
const be = { nbsp: " ", iexcl: "¡", cent: "¢", pound: "£", curren: "¤", yen: "¥", brvbar: "¦", sect: "§", uml: "¨", copy: "©", ordf: "ª", laquo: "«", not: "¬", shy: "", reg: "®", macr: "¯", deg: "°", plusmn: "±", sup2: "²", sup3: "³", acute: "´", micro: "µ", para: "¶", middot: "·", cedil: "¸", sup1: "¹", ordm: "º", raquo: "»", frac14: "¼", frac12: "½", frac34: "¾", iquest: "¿", Agrave: "À", Aacute: "Á", Acirc: "Â", Atilde: "Ã", Auml: "Ä", Aring: "Å", AElig: "Æ", Ccedil: "Ç", Egrave: "È", Eacute: "É", Ecirc: "Ê", Euml: "Ë", Igrave: "Ì", Iacute: "Í", Icirc: "Î", Iuml: "Ï", ETH: "Ð", Ntilde: "Ñ", Ograve: "Ò", Oacute: "Ó", Ocirc: "Ô", Otilde: "Õ", Ouml: "Ö", times: "×", Oslash: "Ø", Ugrave: "Ù", Uacute: "Ú", Ucirc: "Û", Uuml: "Ü", Yacute: "Ý", THORN: "Þ", szlig: "ß", agrave: "à", aacute: "á", acirc: "â", atilde: "ã", auml: "ä", aring: "å", aelig: "æ", ccedil: "ç", egrave: "è", eacute: "é", ecirc: "ê", euml: "ë", igrave: "ì", iacute: "í", icirc: "î", iuml: "ï", eth: "ð", ntilde: "ñ", ograve: "ò", oacute: "ó", ocirc: "ô", otilde: "õ", ouml: "ö", divide: "÷", oslash: "ø", ugrave: "ù", uacute: "ú", ucirc: "û", uuml: "ü", yacute: "ý", thorn: "þ", yuml: "ÿ", fnof: "ƒ", Alpha: "Α", Beta: "Β", Gamma: "Γ", Delta: "Δ", Epsilon: "Ε", Zeta: "Ζ", Eta: "Η", Theta: "Θ", Iota: "Ι", Kappa: "Κ", Lambda: "Λ", Mu: "Μ", Nu: "Ν", Xi: "Ξ", Omicron: "Ο", Pi: "Π", Rho: "Ρ", Sigma: "Σ", Tau: "Τ", Upsilon: "Υ", Phi: "Φ", Chi: "Χ", Psi: "Ψ", Omega: "Ω", alpha: "α", beta: "β", gamma: "γ", delta: "δ", epsilon: "ε", zeta: "ζ", eta: "η", theta: "θ", iota: "ι", kappa: "κ", lambda: "λ", mu: "μ", nu: "ν", xi: "ξ", omicron: "ο", pi: "π", rho: "ρ", sigmaf: "ς", sigma: "σ", tau: "τ", upsilon: "υ", phi: "φ", chi: "χ", psi: "ψ", omega: "ω", thetasym: "ϑ", upsih: "ϒ", piv: "ϖ", bull: "•", hellip: "…", prime: "′", Prime: "″", oline: "‾", frasl: "⁄", weierp: "℘", image: "ℑ", real: "ℜ", trade: "™", alefsym: "ℵ", larr: "←", uarr: "↑", rarr: "→", darr: "↓", harr: "↔", crarr: "↵", lArr: "⇐", uArr: "⇑", rArr: "⇒", dArr: "⇓", hArr: "⇔", forall: "∀", part: "∂", exist: "∃", empty: "∅", nabla: "∇", isin: "∈", notin: "∉", ni: "∋", prod: "∏", sum: "∑", minus: "−", lowast: "∗", radic: "√", prop: "∝", infin: "∞", ang: "∠", and: "⊥", or: "⊦", cap: "∩", cup: "∪", int: "∫", there4: "∴", sim: "∼", cong: "≅", asymp: "≈", ne: "≠", equiv: "≡", le: "≤", ge: "≥", sub: "⊂", sup: "⊃", nsub: "⊄", sube: "⊆", supe: "⊇", oplus: "⊕", otimes: "⊗", perp: "⊥", sdot: "⋅", lceil: "⌈", rceil: "⌉", lfloor: "⌊", rfloor: "⌋", lang: "〈", rang: "〉", loz: "◊", spades: "♠", clubs: "♣", hearts: "♥", diams: "♦", quot: '"', amp: "&", lt: "<", gt: ">", OElig: "Œ", oelig: "œ", Scaron: "Š", scaron: "š", Yuml: "Ÿ", circ: "ˆ", tilde: "˜", ensp: " ", emsp: " ", thinsp: " ", zwnj: "", zwj: "", lrm: "", rlm: "", ndash: "–", mdash: "—", lsquo: "‘", rsquo: "’", sbquo: "‚", ldquo: "“", rdquo: "”", bdquo: "„", dagger: "†", Dagger: "‡", permil: "‰", lsaquo: "‹", rsaquo: "›" };
|
|
1488
|
+
var He = /^[\n\r\x20\u2000-\u200B\u205F\u3000]/, Gt = /^<\/([a-zA-Z0-9]+)([^>]*)>/, Jt = /^<([a-zA-Z0-9]+)((?:\s[^=\s/]+(?:\s*=\s*(?:"[^"]+"|'[^']+'|[^>\\s]+))?)+)?\s*(\/?)>(\n*)/, $t = /^<!--(.+?)-->/, Kt = /&(?:#(\d\d{2,})|#x([\da-fA-F]{2,})|([a-zA-Z][a-zA-Z1-4]{1,8}));/g, _t = { b: function(r) {
|
|
1489
|
+
r.weight = "bold";
|
|
1490
|
+
}, strong: function(r) {
|
|
1491
|
+
r.weight = "bold";
|
|
1492
|
+
}, i: function(r) {
|
|
1493
|
+
r.style = "italic";
|
|
1494
|
+
}, em: function(r) {
|
|
1495
|
+
r.style = "italic";
|
|
1496
|
+
}, dfn: function(r) {
|
|
1497
|
+
r.style = "italic";
|
|
1498
|
+
}, cite: function(r) {
|
|
1499
|
+
r.style = "italic";
|
|
1500
|
+
}, code: function(r) {
|
|
1501
|
+
r.family = "monospace";
|
|
1502
|
+
}, kbd: function(r) {
|
|
1503
|
+
r.family = "monospace";
|
|
1504
|
+
}, samp: function(r) {
|
|
1505
|
+
r.family = "monospace";
|
|
1506
|
+
}, var: function(r) {
|
|
1507
|
+
r.family = "monospace";
|
|
1508
|
+
}, tt: function(r) {
|
|
1509
|
+
r.family = "monospace";
|
|
1510
|
+
}, sub: function(r) {
|
|
1511
|
+
r.sub = !0;
|
|
1512
|
+
}, sup: function(r) {
|
|
1513
|
+
r.sup = !0;
|
|
1514
|
+
} }, Be = { div: 1, li: 1, blockquote: 2, h1: 2, h2: 2, h3: 2, h4: 2, h5: 2, h6: 2, ul: 2, ol: 2, hr: 2, p: 2 };
|
|
1515
|
+
function Zt(r) {
|
|
1516
|
+
return r.replace(Kt, function(i, a, t, s) {
|
|
1517
|
+
if (a || t) {
|
|
1518
|
+
var c = a ? 10 : 16;
|
|
1519
|
+
return String.fromCharCode(parseInt(a || t, c));
|
|
1340
1520
|
}
|
|
1341
|
-
return
|
|
1521
|
+
return s in be ? be[s] : i;
|
|
1342
1522
|
});
|
|
1343
1523
|
}
|
|
1344
|
-
function
|
|
1345
|
-
return
|
|
1524
|
+
function qe(r) {
|
|
1525
|
+
return r && r.length > 1 && (r[0] === '"' && r[r.length - 1] === '"' || r[0] === "'" && r[r.length - 1] === "'") ? r.slice(1, -1) : r;
|
|
1346
1526
|
}
|
|
1347
|
-
var
|
|
1348
|
-
function
|
|
1349
|
-
var
|
|
1350
|
-
if (
|
|
1527
|
+
var We = /^\s*([^=\s&]+)(?:\s*=\s*("[^"]+"|'[^']+'|[^>\s]+))?/;
|
|
1528
|
+
function It(r) {
|
|
1529
|
+
var i, a = {};
|
|
1530
|
+
if (r) {
|
|
1351
1531
|
do
|
|
1352
|
-
if (
|
|
1353
|
-
var
|
|
1354
|
-
if (
|
|
1532
|
+
if (i = We.exec(r)) {
|
|
1533
|
+
var t = Zt(qe(i[2] || "")).replace(/[ \r\n\t]+/g, " ").trim();
|
|
1534
|
+
if (a[i[1]] = t, (r = r.slice(i[0].length)).length && /^\S/.test(r[0])) throw new Error("Attribute error");
|
|
1355
1535
|
}
|
|
1356
|
-
while (
|
|
1357
|
-
if (/\S/.test(
|
|
1536
|
+
while (i && r.length);
|
|
1537
|
+
if (/\S/.test(r)) throw new Error("Attribute error");
|
|
1358
1538
|
}
|
|
1359
|
-
return
|
|
1539
|
+
return a;
|
|
1360
1540
|
}
|
|
1361
|
-
const
|
|
1362
|
-
var
|
|
1363
|
-
|
|
1364
|
-
}, it: function(
|
|
1365
|
-
|
|
1366
|
-
}, sl: function(
|
|
1367
|
-
|
|
1368
|
-
}, color: function(
|
|
1369
|
-
|
|
1370
|
-
}, href: function(
|
|
1371
|
-
|
|
1372
|
-
}, "^": function(
|
|
1373
|
-
|
|
1374
|
-
}, _: function(
|
|
1375
|
-
|
|
1376
|
-
}, par: function(
|
|
1377
|
-
this.tokens.push(new
|
|
1378
|
-
}, newline: function(
|
|
1379
|
-
this.tokens.push(new
|
|
1380
|
-
}, url: function(
|
|
1381
|
-
this.open_context().href =
|
|
1541
|
+
const bt = { copyright: "©", textcopyright: "©", dag: "†", textdagger: "†", ddag: "‡", textdaggerdbl: "‡", guillemotleft: "«", guillemotright: "»", guilsinglleft: "‹", guilsinglright: "›", ldots: "…", dots: "…", textellipsis: "…", lq: "‘", P: "¶", textparagraph: "¶", pounds: "£", textsterling: "£", quotedblbase: "„", quotesinglbase: "‚", rq: "’", S: "§", sim: "~", textasciicircum: "^", textasciitilde: "˜", texttildelow: "~", textasteriskcentered: "*", textbackslash: "'", textbar: "|", textbardbl: "╎", textbigcircle: "◯", textbraceleft: "{", textbraceright: "}", textbullet: "•", textdollar: "$", textemdash: "—", textendash: "—", texteuro: "€", eurosym: "€", euro: "€", textexclamdown: "¡", textgreater: ">", textless: "<", textordfeminine: "ª", textordmasculine: "º", textperiodcentered: "·", cdot: "·", textquestiondown: "¿", textquotedblleft: "“", textquotedblright: "”", textquoteleft: "‘", textquoteright: "’", textquotestraightbase: "‚", textquotestraightdblbase: "„", textregistered: "®", textthreequartersemdash: "-", texttrademark: "™", texttwelveudash: "-", textunderscore: "_", textvisiblespace: "␣", gets: "←", textleftarrow: "←", to: "→", textrightarrow: "→", textdegree: "°", infty: "∞", triangle: "△", triangledown: "▽", blacktriangle: "▲", blacktriangledown: "▼", angle: "∠", sphericalangle: "∢", aleph: "ℵ", hbar: "ħ", imath: "𝚤", jmath: "𝚥", ell: "ℓ", wp: "℘", Re: "ℜ", Im: "ℑ", mho: "℧", prime: "′", emptyset: "∅", nabla: "∇", surd: "√", partial: "∂", top: "⟙", bot: "⟂", vdash: "⟝", dashv: "⟞", forall: "∀", exists: "∃", nexists: "∄", neg: "¬", lnot: "¬", flat: "♭", natural: "♮", sharp: "♯", backslash: "\\", Box: "□", Diamond: "♢", clubsuit: "♣", diamondsuit: "♦", heartsuit: "♥", spadesuit: "♠", Join: "⨝", blacksquare: "■", bigstar: "★", diagdown: "╲", diagup: "╱", blacklozenge: "⧫", rfloor: "⌋", lfloor: "⌊", rceil: "⌉", lceil: "⌈", rangle: "⟩", langle: "⟨", sum: "∑", int: "∫", oint: "∮", prod: "∏", coprod: "∏", bigcap: "∩", bigcup: "∪", bigsqcup: "⊔", bigvee: "∨", bigwedge: "∧", bigodot: "⊙", bigotimes: "⊗", bigoplus: "⊕", biguplus: "⊎", alpha: "α", beta: "β", chi: "χ", delta: "δ", epsilon: "ε", eta: "η", gamma: "γ", iota: "ι", kappa: "κ", lambda: "λ", mu: "μ", nu: "ν", omega: "ω", phi: "φ", pi: "π", psi: "ψ", rho: "ρ", sigma: "σ", tau: "τ", theta: "θ", upsilon: "υ", xi: "ξ", zeta: "ζ", Alpha: "Α", Beta: "Β", Chi: "Χ", Delta: "Δ", Epsilon: "Ε", Eta: "Η", Gamma: "Γ", Iota: "Ι", Kappa: "Κ", Lambda: "Λ", Mu: "Μ", Nu: "Ν", Omega: "Ω", Phi: "Φ", Pi: "Π", Psi: "Ψ", Rho: "Ρ", Sigma: "Σ", Tau: "Τ", Theta: "Θ", Upsilon: "Υ", Xi: "Ξ", Zeta: "Ζ", aa: "å", AA: "Å", ae: "æ", AE: "Æ", dh: "ð", DH: "Ð", dj: "đ", DJ: "Đ", ij: "ij", IJ: "IJ", l: "ł", L: "Ł", ng: "ŋ", NG: "Ŋ", o: "ø", O: "Ø", oe: "œ", OE: "Œ", ss: "ß", SS: "SS", th: "þ", TH: "Þ" };
|
|
1542
|
+
var we = /^(\^|_|\\[^#$%&~_^\\{}()\s]+)(\{)?/, xe = /^%[^\n]+(?:\n|$)/, jt = /^[^#$%&~_^\\{}]+/, Ue = /^\\([&{}$%#_])/, Ye = /(?:\\[\\@,!:;-]|-{2,3}|[!?]`|``?|,,|''?|~|<<|>>)/g, Qt = { "---": "—", "--": "–", "!`": "¡", "?`": "¿", "``": "“", ",,": "„", "''": "”", "`": "‘", "'": "’", "<<": "«", ">>": "»", "~": " ", "\\-": "", "\\,": " ", "\\;": " ", "\\:": " ", "\\!": " ", "\\@": "\uFEFF", "\\\\": "\\newline{}" }, q = { bf: function(r) {
|
|
1543
|
+
r.weight = "bold";
|
|
1544
|
+
}, it: function(r) {
|
|
1545
|
+
r.style = "italic";
|
|
1546
|
+
}, sl: function(r) {
|
|
1547
|
+
r.style = "italic";
|
|
1548
|
+
}, color: function(r, i) {
|
|
1549
|
+
r.color = i;
|
|
1550
|
+
}, href: function(r, i) {
|
|
1551
|
+
r.href = i;
|
|
1552
|
+
}, "^": function(r) {
|
|
1553
|
+
r.sup = !0;
|
|
1554
|
+
}, _: function(r) {
|
|
1555
|
+
r.sub = !0;
|
|
1556
|
+
}, par: function(r) {
|
|
1557
|
+
this.tokens.push(new X(), new X());
|
|
1558
|
+
}, newline: function(r) {
|
|
1559
|
+
this.tokens.push(new X());
|
|
1560
|
+
}, url: function(r, i) {
|
|
1561
|
+
this.open_context().href = i, this.add_token(new M(i)), this.close_context();
|
|
1382
1562
|
} };
|
|
1383
|
-
|
|
1384
|
-
var
|
|
1385
|
-
function
|
|
1386
|
-
|
|
1387
|
-
var
|
|
1388
|
-
return (
|
|
1389
|
-
}
|
|
1390
|
-
function
|
|
1391
|
-
for (var s, c
|
|
1392
|
-
|
|
1393
|
-
}
|
|
1394
|
-
function
|
|
1395
|
-
return Math.round(1e6 *
|
|
1396
|
-
}
|
|
1397
|
-
function
|
|
1398
|
-
return function(
|
|
1399
|
-
if (Array.isArray(
|
|
1400
|
-
}(
|
|
1401
|
-
if (typeof Symbol < "u" &&
|
|
1402
|
-
}(
|
|
1403
|
-
if (
|
|
1404
|
-
if (typeof
|
|
1405
|
-
var
|
|
1406
|
-
return
|
|
1563
|
+
q.textsuperscript = q["^"], q.textsubscript = q._, q.textsl = q.sl, q.mathbf = q.bf, q.mathit = q.it, q.textbf = q.bf, q.textit = q.it, q.textcolor = q.color;
|
|
1564
|
+
var Ve = /[\r\n\xA0]+/g;
|
|
1565
|
+
function Ee(r, i) {
|
|
1566
|
+
r.sup && (r.baseline = 0.45, r.size = 0.7), r.sub && (r.baseline = -0.3, r.size = 0.7);
|
|
1567
|
+
var a = i;
|
|
1568
|
+
return (r.style || r.weight || r.baseline || r.color || r.size || r.family) && (a = R(i, r)), a;
|
|
1569
|
+
}
|
|
1570
|
+
function te(r, i, a) {
|
|
1571
|
+
for (var t, s, c = r.width; c + a.width > i && r.length; ) s = (t = r[r.length - 1]).width, t.width > a.width ? (t.value = t.value.slice(0, -1), t.width = B(t, t.font), c += t.width) : r.pop(), c -= s;
|
|
1572
|
+
r[r.length - 1] instanceof ut && r.pop(), t = r[r.length - 1] || t || {}, a.font = R(a.font, t.bold, t.italic, ""), a.href = r.length ? t.href : null, a.rel = r.length ? t.rel : null, a.target = r.length ? t.target : null, r.push(a);
|
|
1573
|
+
}
|
|
1574
|
+
function ct(r) {
|
|
1575
|
+
return Math.round(1e6 * r) / 1e6;
|
|
1576
|
+
}
|
|
1577
|
+
function Ae(r) {
|
|
1578
|
+
return function(i) {
|
|
1579
|
+
if (Array.isArray(i)) return Ft(i);
|
|
1580
|
+
}(r) || function(i) {
|
|
1581
|
+
if (typeof Symbol < "u" && i[Symbol.iterator] != null || i["@@iterator"] != null) return Array.from(i);
|
|
1582
|
+
}(r) || function(i, a) {
|
|
1583
|
+
if (i) {
|
|
1584
|
+
if (typeof i == "string") return Ft(i, a);
|
|
1585
|
+
var t = Object.prototype.toString.call(i).slice(8, -1);
|
|
1586
|
+
return t === "Object" && i.constructor && (t = i.constructor.name), t === "Map" || t === "Set" ? Array.from(i) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? Ft(i, a) : void 0;
|
|
1407
1587
|
}
|
|
1408
|
-
}(
|
|
1588
|
+
}(r) || function() {
|
|
1409
1589
|
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1410
1590
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
1411
1591
|
}();
|
|
1412
1592
|
}
|
|
1413
|
-
function
|
|
1414
|
-
(
|
|
1415
|
-
for (var
|
|
1416
|
-
return
|
|
1593
|
+
function Ft(r, i) {
|
|
1594
|
+
(i == null || i > r.length) && (i = r.length);
|
|
1595
|
+
for (var a = 0, t = new Array(i); a < i; a++) t[a] = r[a];
|
|
1596
|
+
return t;
|
|
1417
1597
|
}
|
|
1418
|
-
var
|
|
1419
|
-
return !
|
|
1598
|
+
var ke = { center: "middle", right: "end" }, Xe = { middle: 0.5, center: 0.5, bottom: 1, end: 1 }, ee = function(r, i) {
|
|
1599
|
+
return !r && !i || r === i;
|
|
1420
1600
|
};
|
|
1421
|
-
function
|
|
1422
|
-
var
|
|
1423
|
-
if (
|
|
1424
|
-
var
|
|
1425
|
-
if (
|
|
1426
|
-
var
|
|
1427
|
-
|
|
1601
|
+
function Ge(r, i) {
|
|
1602
|
+
var a = [], t = i.font(), s = t.size, c = t.family, p = i.align(), m = i.createElement();
|
|
1603
|
+
if (r.length) {
|
|
1604
|
+
var w = t.height, b = i.valign(), E = i.height()(), D = i.width()(0), T = !isFinite(D) && r.length === 1, O = T ? null : i.x(), j = ct(w / s), W = T ? null : ct(w / (1.15 * s + (w - s) / 2));
|
|
1605
|
+
if (Xe[b] && isFinite(E)) {
|
|
1606
|
+
var F = b === "bottom" ? 1 : 0.5;
|
|
1607
|
+
W += (E * F - w * r.length * F) / s;
|
|
1428
1608
|
}
|
|
1429
|
-
var
|
|
1430
|
-
|
|
1431
|
-
for (var
|
|
1432
|
-
if (
|
|
1433
|
-
var
|
|
1434
|
-
|
|
1609
|
+
var P = p === "justify", H = 0;
|
|
1610
|
+
p === "right" ? H = D : p === "center" && (H = D / 2);
|
|
1611
|
+
for (var N = [], J = "tspan", K = null, U = "", $ = function() {
|
|
1612
|
+
if (U) {
|
|
1613
|
+
var Ct = m(J, K, U);
|
|
1614
|
+
N.push(Ct);
|
|
1435
1615
|
}
|
|
1436
|
-
|
|
1437
|
-
},
|
|
1438
|
-
var
|
|
1439
|
-
if (
|
|
1440
|
-
|
|
1441
|
-
for (var
|
|
1442
|
-
var
|
|
1443
|
-
|
|
1616
|
+
J = "tspan", K = null, U = "";
|
|
1617
|
+
}, ot = 0, nt = r.length; ot < nt; ot++) {
|
|
1618
|
+
var ft = "", Et = "", ht = 0, gt = r[ot];
|
|
1619
|
+
if (gt.length) {
|
|
1620
|
+
N = [];
|
|
1621
|
+
for (var Mt = 0, le = 0, pt = void 0, Z = 0, Oe = gt.length; Z < Oe; Z++) {
|
|
1622
|
+
var Y = gt[Z], Q = Y.font;
|
|
1623
|
+
Y.whitespace && Mt++, le += Y.width, Z && !Y.tracking && !ht && ee(Q.id, ft) && ee(Y.class, Et) && ee(pt, Y.href) ? U += Y.value : ($(), U = Y.value, K = { fontFamily: Q.family !== c ? Q.family : null, fontSize: Q.size !== s ? Q.size : null, fontWeight: Q.weight || null, fontStyle: Q.style || null, fontVariant: Q.variant !== "normal" && Q.variant || null, fill: Q.color || null, baselineShift: Q.baseline ? 100 * Q.baseline + "%" : null, className: Y.class || null }, ht && (K.dx = ct(ht), ht = 0), Y.tracking && (ht = Q.size * Y.tracking), Y.href && !pt ? (pt = Y.href, J = "a", K.href = pt, K.rel = Y.rel, K.target = Y.target) : pt = null, ft = Q.id, Et = Y.class);
|
|
1444
1624
|
}
|
|
1445
|
-
if (
|
|
1625
|
+
if ($(), T) a.push.apply(a, Ae(N));
|
|
1446
1626
|
else {
|
|
1447
|
-
var
|
|
1448
|
-
|
|
1627
|
+
var De = null, ue = ot === nt - 1 || gt[gt.length - 1] instanceof X;
|
|
1628
|
+
P && gt.length > 1 && !ue && (De = ct((D - le) / Mt)), a.push(m.apply(void 0, ["tspan", { wordSpacing: De, x: O(ot) + H, dy: ct(ot ? j : W) + "em" }].concat(Ae(N))));
|
|
1449
1629
|
}
|
|
1450
|
-
} else
|
|
1630
|
+
} else a.push(m("tspan", { x: O(ot), dy: ct(ot ? j : W) + "em" }, " "));
|
|
1451
1631
|
}
|
|
1452
1632
|
}
|
|
1453
|
-
return
|
|
1454
|
-
}
|
|
1455
|
-
var
|
|
1456
|
-
function
|
|
1457
|
-
if (
|
|
1458
|
-
|
|
1459
|
-
var
|
|
1460
|
-
if (
|
|
1461
|
-
var
|
|
1462
|
-
|
|
1633
|
+
return m.apply(void 0, ["text", { fontFamily: c, fontSize: s, textAnchor: ke[p] || "start" }].concat(a));
|
|
1634
|
+
}
|
|
1635
|
+
var Je = { middle: 0.5, center: 0.5, bottom: 1, end: 1 };
|
|
1636
|
+
function Ke(r, i, a) {
|
|
1637
|
+
if (r.length) {
|
|
1638
|
+
a.textBaseline = "middle";
|
|
1639
|
+
var t = i.font(), s = t.height, c = t.size, p = i.valign(), m = i.height()(), w = i.width()(0), b = i.align(), E = b === "justify", D = 0.5 * s, T = Je[p];
|
|
1640
|
+
if (T && isFinite(m)) {
|
|
1641
|
+
var O = r.length * s;
|
|
1642
|
+
D += m * T - O * T;
|
|
1463
1643
|
}
|
|
1464
|
-
|
|
1465
|
-
var
|
|
1466
|
-
|
|
1467
|
-
|
|
1644
|
+
r.forEach(function(j, W) {
|
|
1645
|
+
var F = i.x()(W), P = W * s + D, H = 0, N = 0;
|
|
1646
|
+
j.forEach(function(U) {
|
|
1647
|
+
U.whitespace && H++, N += U.width;
|
|
1468
1648
|
});
|
|
1469
|
-
var
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
var
|
|
1473
|
-
|
|
1474
|
-
return
|
|
1475
|
-
}(
|
|
1476
|
-
var
|
|
1477
|
-
if (
|
|
1478
|
-
|
|
1479
|
-
var
|
|
1480
|
-
|
|
1649
|
+
var J = 0, K = W === r.length - 1 || j[j.length - 1] instanceof X;
|
|
1650
|
+
E && j.length > 1 && !K && (J = (w - N) / H), j.forEach(function(U) {
|
|
1651
|
+
a.font = U.font;
|
|
1652
|
+
var $ = U.font, ot = $.baseline ? c * -$.baseline + 0.15 * c : 0;
|
|
1653
|
+
a.fillStyle = function(Et, ht) {
|
|
1654
|
+
return Et.color ? Et.color : ht.href ? "#00C" : "#000";
|
|
1655
|
+
}($, U);
|
|
1656
|
+
var nt = 0;
|
|
1657
|
+
if (b === "right" ? nt += w - N : b === "center" ? nt += w / 2 - N / 2 : b === "justify" && (U.whitespace || U instanceof X) && (F += J), a.fillText(U.value, F + nt, P + ot), U.href) {
|
|
1658
|
+
a.beginPath(), a.strokeStyle = a.fillStyle;
|
|
1659
|
+
var ft = Math.floor(P + 0.45 * c) + 0.5;
|
|
1660
|
+
a.moveTo(F + nt, ft), a.lineTo(F + nt + U.width, ft), a.stroke();
|
|
1481
1661
|
}
|
|
1482
|
-
|
|
1662
|
+
F += U.width;
|
|
1483
1663
|
});
|
|
1484
1664
|
});
|
|
1485
1665
|
}
|
|
1486
1666
|
}
|
|
1487
|
-
function
|
|
1488
|
-
return
|
|
1489
|
-
return typeof
|
|
1490
|
-
} : function(
|
|
1491
|
-
return
|
|
1492
|
-
},
|
|
1493
|
-
}
|
|
1494
|
-
function
|
|
1495
|
-
for (var
|
|
1496
|
-
var
|
|
1497
|
-
typeof
|
|
1667
|
+
function re(r) {
|
|
1668
|
+
return re = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(i) {
|
|
1669
|
+
return typeof i;
|
|
1670
|
+
} : function(i) {
|
|
1671
|
+
return i && typeof Symbol == "function" && i.constructor === Symbol && i !== Symbol.prototype ? "symbol" : typeof i;
|
|
1672
|
+
}, re(r);
|
|
1673
|
+
}
|
|
1674
|
+
function _e(r) {
|
|
1675
|
+
for (var i = {}, a = 0; a < r.length; a++) {
|
|
1676
|
+
var t = r[a];
|
|
1677
|
+
typeof t != "number" && t != null && (typeof t == "string" ? i.text = t : typeof t == "function" ? i.fn = t : re(t) === "object" && t._groups ? i.d3 = t : t && t.nodeType && t.getContext ? i.ctx = t.getContext("2d") : t && t.fillText && t.beginPath ? i.ctx = t : t && (i.text = t));
|
|
1498
1678
|
}
|
|
1499
|
-
return
|
|
1500
|
-
}
|
|
1501
|
-
function
|
|
1502
|
-
return
|
|
1503
|
-
return typeof
|
|
1504
|
-
} : function(
|
|
1505
|
-
return
|
|
1506
|
-
},
|
|
1507
|
-
}
|
|
1508
|
-
function
|
|
1509
|
-
for (var
|
|
1510
|
-
var
|
|
1511
|
-
|
|
1512
|
-
if (
|
|
1513
|
-
var
|
|
1514
|
-
if (
|
|
1515
|
-
var
|
|
1516
|
-
if (
|
|
1679
|
+
return i;
|
|
1680
|
+
}
|
|
1681
|
+
function dt(r) {
|
|
1682
|
+
return dt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(i) {
|
|
1683
|
+
return typeof i;
|
|
1684
|
+
} : function(i) {
|
|
1685
|
+
return i && typeof Symbol == "function" && i.constructor === Symbol && i !== Symbol.prototype ? "symbol" : typeof i;
|
|
1686
|
+
}, dt(r);
|
|
1687
|
+
}
|
|
1688
|
+
function Se(r, i) {
|
|
1689
|
+
for (var a = 0; a < i.length; a++) {
|
|
1690
|
+
var t = i[a];
|
|
1691
|
+
t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(r, (s = function(c, p) {
|
|
1692
|
+
if (dt(c) !== "object" || c === null) return c;
|
|
1693
|
+
var m = c[Symbol.toPrimitive];
|
|
1694
|
+
if (m !== void 0) {
|
|
1695
|
+
var w = m.call(c, p);
|
|
1696
|
+
if (dt(w) !== "object") return w;
|
|
1517
1697
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1518
1698
|
}
|
|
1519
|
-
return String(
|
|
1520
|
-
}(
|
|
1699
|
+
return String(c);
|
|
1700
|
+
}(t.key, "string"), dt(s) === "symbol" ? s : String(s)), t);
|
|
1521
1701
|
}
|
|
1522
|
-
var
|
|
1702
|
+
var s;
|
|
1523
1703
|
}
|
|
1524
|
-
var
|
|
1525
|
-
return typeof
|
|
1526
|
-
return
|
|
1704
|
+
var wt = R(), St = function(r) {
|
|
1705
|
+
return typeof r == "function" ? r : function() {
|
|
1706
|
+
return r;
|
|
1527
1707
|
};
|
|
1528
|
-
},
|
|
1529
|
-
function
|
|
1530
|
-
if (function(
|
|
1531
|
-
if (!(
|
|
1532
|
-
}(this,
|
|
1708
|
+
}, G = function() {
|
|
1709
|
+
function r(t) {
|
|
1710
|
+
if (function(c, p) {
|
|
1711
|
+
if (!(c instanceof p)) throw new TypeError("Cannot call a class as a function");
|
|
1712
|
+
}(this, r), this.props = { overflow: "ellipsis", lineclamp: null, align: "left", wordBreak: null, valign: "top", width: function() {
|
|
1533
1713
|
return 1 / 0;
|
|
1534
1714
|
}, height: function() {
|
|
1535
1715
|
return 1 / 0;
|
|
1536
1716
|
}, x: function() {
|
|
1537
1717
|
return 0;
|
|
1538
|
-
}, font: null, tAnchor: 0, parser:
|
|
1718
|
+
}, font: null, tAnchor: 0, parser: r.defaultparser }, t) for (var s in t) typeof this[s] == "function" && this[s](t[s]);
|
|
1539
1719
|
}
|
|
1540
|
-
var
|
|
1541
|
-
return
|
|
1542
|
-
var
|
|
1543
|
-
if (!
|
|
1544
|
-
var
|
|
1545
|
-
if (!
|
|
1546
|
-
for (var
|
|
1547
|
-
var
|
|
1548
|
-
if (
|
|
1549
|
-
else if (
|
|
1550
|
-
else if (
|
|
1551
|
-
else if (
|
|
1552
|
-
var
|
|
1720
|
+
var i, a;
|
|
1721
|
+
return i = r, a = [{ key: "linebreak", value: function(t) {
|
|
1722
|
+
var s = this, c = this.props.parser(String(t)), p = this.font(), m = function(w, b, E) {
|
|
1723
|
+
if (!w.length) return [];
|
|
1724
|
+
var D = b.height(), T = b.width(), O = b.overflowLine(), j = b.overflowWrap(), W = R(E, !0, !1), F = isFinite(D()) ? Math.floor(D() / E.height) : 1 / 0;
|
|
1725
|
+
if (!D() && !T(0) || !F) return [];
|
|
1726
|
+
for (var P = 0, H = 0, N = 0, J = [], K = [], U = !1; P < w.length && H < F; ) {
|
|
1727
|
+
var $ = w[P], ot = Ee($, E);
|
|
1728
|
+
if ($.width = B($, ot), $.font = ot, $.line = H, $.whitespace = $.value in C, $.value && ($.value = $.value.replace(Ve, " ")), !(!N && $.whitespace || U && $.whitespace)) if ($ instanceof X) N = 0, K = [], J.push(P + 1), H++;
|
|
1729
|
+
else if ($ instanceof lt || $ instanceof ut) K.push({ index: P, width: N });
|
|
1730
|
+
else if ($.whitespace || N + $.width < T(H)) N += $.width;
|
|
1731
|
+
else if (K.length) {
|
|
1732
|
+
var nt = void 0, ft = void 0;
|
|
1553
1733
|
do {
|
|
1554
|
-
|
|
1555
|
-
var
|
|
1556
|
-
|
|
1557
|
-
} while (!
|
|
1558
|
-
|
|
1559
|
-
} else if (
|
|
1560
|
-
var
|
|
1561
|
-
if (
|
|
1562
|
-
var
|
|
1734
|
+
ft = !0, nt = K.pop();
|
|
1735
|
+
var Et = w[nt.index], ht = void 0;
|
|
1736
|
+
Et instanceof ut && (ht = B("-", Et.font), nt.width + ht > T(H) && (ft = !K.length));
|
|
1737
|
+
} while (!ft);
|
|
1738
|
+
J.push(nt.index + 1), N = 0, H++, P = nt.index, K = [];
|
|
1739
|
+
} else if (j === "break-word") {
|
|
1740
|
+
var gt = T(H);
|
|
1741
|
+
if (N + $.width > gt) {
|
|
1742
|
+
var Mt = $.clone();
|
|
1563
1743
|
do
|
|
1564
|
-
|
|
1565
|
-
while (
|
|
1566
|
-
|
|
1744
|
+
$.value = $.value.slice(0, -1), $.width = B($, $.font), N += $.width;
|
|
1745
|
+
while ($.value && $.width > gt);
|
|
1746
|
+
Mt.value = Mt.value.slice($.value.length), w.splice(P + 1, 0, new lt(), Mt);
|
|
1567
1747
|
}
|
|
1568
|
-
|
|
1569
|
-
} else
|
|
1570
|
-
|
|
1748
|
+
J.push(P + 1), N = 0, H++;
|
|
1749
|
+
} else N += $.width;
|
|
1750
|
+
P++, U = $.whitespace;
|
|
1571
1751
|
}
|
|
1572
|
-
|
|
1573
|
-
var le = 0,
|
|
1574
|
-
for (var
|
|
1575
|
-
for (var
|
|
1576
|
-
|
|
1577
|
-
var
|
|
1578
|
-
return
|
|
1752
|
+
P !== J[J.length - 1] && J.push(P);
|
|
1753
|
+
var le = 0, pt = 0, Z = J.map(function(Ct) {
|
|
1754
|
+
for (var et, Tt = le; (et = w[Tt]) && (et.whitespace || !et.value); ) Tt++;
|
|
1755
|
+
for (var At = Ct, tr = null; At > Tt && (et = w[At - 1]) && (et.whitespace || !(et.value || et instanceof ut)); ) et instanceof X && (tr = et), At--;
|
|
1756
|
+
et instanceof ut && (et.value = "-", et.width = B("-", et.font)), le = Ct;
|
|
1757
|
+
var zt = w.slice(Tt, At).filter(function(er) {
|
|
1758
|
+
return er.value;
|
|
1579
1759
|
});
|
|
1580
|
-
return
|
|
1581
|
-
return
|
|
1582
|
-
}, 0),
|
|
1760
|
+
return tr && zt.push(tr), zt.width = zt.reduce(function(er, Jr) {
|
|
1761
|
+
return er + Jr.width;
|
|
1762
|
+
}, 0), zt.width > pt && (pt = zt.width), zt;
|
|
1583
1763
|
});
|
|
1584
|
-
if (
|
|
1585
|
-
var
|
|
1586
|
-
|
|
1587
|
-
var
|
|
1588
|
-
if (
|
|
1589
|
-
var
|
|
1590
|
-
|
|
1764
|
+
if (Z.hasLineOverflow = !1, O) {
|
|
1765
|
+
var Oe = O === "ellipsis" ? "…" : O;
|
|
1766
|
+
Z.forEach(function(Ct, et) {
|
|
1767
|
+
var Tt = T(et);
|
|
1768
|
+
if (Ct.width > Tt) {
|
|
1769
|
+
var At = new M(Oe);
|
|
1770
|
+
At.font = E, At.width = B(Oe, W), te(Ct, Tt, At), Z.hasLineOverflow = !0;
|
|
1591
1771
|
}
|
|
1592
1772
|
});
|
|
1593
1773
|
}
|
|
1594
|
-
var
|
|
1595
|
-
if (
|
|
1596
|
-
var
|
|
1597
|
-
|
|
1598
|
-
} else
|
|
1599
|
-
return
|
|
1600
|
-
}(
|
|
1601
|
-
return
|
|
1602
|
-
return
|
|
1603
|
-
},
|
|
1604
|
-
} }, { key: "font", value: function(
|
|
1605
|
-
return arguments.length ? (this.props.font =
|
|
1606
|
-
} }, { key: "overflow", value: function(
|
|
1607
|
-
return arguments.length ? (this.props.overflow = String(
|
|
1608
|
-
} }, { key: "overflowLine", value: function(
|
|
1609
|
-
return arguments.length ? (this.props.lineclamp = String(
|
|
1610
|
-
} }, { key: "valign", value: function(
|
|
1611
|
-
return arguments.length ? (this.props.valign =
|
|
1612
|
-
} }, { key: "align", value: function(
|
|
1774
|
+
var Y = b.overflow() === "ellipsis" ? "…" : b.overflow();
|
|
1775
|
+
if (Y && P !== w.length) {
|
|
1776
|
+
var Q = T(Z.length - 1), De = Z[Z.length - 1], ue = new M(Y);
|
|
1777
|
+
ue.font = E, ue.width = B(Y, W), te(De, Q, ue), Z.hasOverflow = !0;
|
|
1778
|
+
} else Z.hasOverflow = !1;
|
|
1779
|
+
return Z.font = E, Z.width = pt, Z;
|
|
1780
|
+
}(c, this, p);
|
|
1781
|
+
return m.height = m.length * p.height, m.render = function(w) {
|
|
1782
|
+
return s.render(m, w);
|
|
1783
|
+
}, m.svg = m.render, m.draw = m.render, m;
|
|
1784
|
+
} }, { key: "font", value: function(t) {
|
|
1785
|
+
return arguments.length ? (this.props.font = R(t), this) : this.props.font || R(wt);
|
|
1786
|
+
} }, { key: "overflow", value: function(t) {
|
|
1787
|
+
return arguments.length ? (this.props.overflow = String(t), this) : this.props.overflow;
|
|
1788
|
+
} }, { key: "overflowLine", value: function(t) {
|
|
1789
|
+
return arguments.length ? (this.props.lineclamp = String(t), this) : this.props.lineclamp;
|
|
1790
|
+
} }, { key: "valign", value: function(t) {
|
|
1791
|
+
return arguments.length ? (this.props.valign = t, this) : this.props.valign;
|
|
1792
|
+
} }, { key: "align", value: function(t) {
|
|
1613
1793
|
if (!arguments.length) return this.props.align;
|
|
1614
|
-
var
|
|
1615
|
-
return
|
|
1616
|
-
} }, { key: "overflowWrap", value: function(
|
|
1794
|
+
var s = String(t).toLowerCase();
|
|
1795
|
+
return s === "left" || s === "start" ? (this.props.align = "left", this.props.tAnchor = 0) : s === "center" || s === "middle" ? (this.props.align = "center", this.props.tAnchor = -0.5) : s === "end" || s === "right" ? (this.props.align = "right", this.props.tAnchor = -1) : s === "justify" && (this.props.align = t, this.props.tAnchor = 0), this;
|
|
1796
|
+
} }, { key: "overflowWrap", value: function(t) {
|
|
1617
1797
|
if (!arguments.length) return this.props.overflowWrap || "normal";
|
|
1618
|
-
var
|
|
1619
|
-
return
|
|
1620
|
-
} }, { key: "width", value: function(
|
|
1621
|
-
return arguments.length ? (this.props.width =
|
|
1622
|
-
} }, { key: "height", value: function(
|
|
1623
|
-
return arguments.length ? (this.props.height =
|
|
1624
|
-
} }, { key: "x", value: function(
|
|
1625
|
-
return arguments.length ? (this.props.x =
|
|
1626
|
-
} }, { key: "parser", value: function(
|
|
1798
|
+
var s = String(t).toLowerCase();
|
|
1799
|
+
return s === "break-word" ? this.props.overflowWrap = "break-word" : s !== "normal" && t != null || (this.props.overflowWrap = null), this;
|
|
1800
|
+
} }, { key: "width", value: function(t) {
|
|
1801
|
+
return arguments.length ? (this.props.width = St(t), this) : this.props.width;
|
|
1802
|
+
} }, { key: "height", value: function(t) {
|
|
1803
|
+
return arguments.length ? (this.props.height = St(t), this) : this.props.height;
|
|
1804
|
+
} }, { key: "x", value: function(t) {
|
|
1805
|
+
return arguments.length ? (this.props.x = St(t), this) : this.props.x;
|
|
1806
|
+
} }, { key: "parser", value: function(t) {
|
|
1627
1807
|
if (!arguments.length) return this.props.parser;
|
|
1628
|
-
if (typeof
|
|
1629
|
-
var
|
|
1630
|
-
typeof
|
|
1808
|
+
if (typeof t == "string") {
|
|
1809
|
+
var s = r[t] || r[t + "parser"];
|
|
1810
|
+
typeof s == "function" && (t = s);
|
|
1631
1811
|
}
|
|
1632
|
-
if (typeof
|
|
1633
|
-
return this.props.parser =
|
|
1634
|
-
} }, { key: "createElement", value: function(
|
|
1635
|
-
return arguments.length ? (this.props.createElement =
|
|
1812
|
+
if (typeof t != "function") throw new Error("Unknown parser: " + t);
|
|
1813
|
+
return this.props.parser = t, this;
|
|
1814
|
+
} }, { key: "createElement", value: function(t) {
|
|
1815
|
+
return arguments.length ? (this.props.createElement = t, this) : this.props.createElement || r.createElement;
|
|
1636
1816
|
} }, { key: "render", value: function() {
|
|
1637
|
-
var
|
|
1638
|
-
return typeof
|
|
1639
|
-
} }],
|
|
1817
|
+
var t = _e(arguments);
|
|
1818
|
+
return typeof t.text == "string" && (t.text = this.linebreak(t.text)), t.ctx ? Ke(t.text, this, t.ctx) : Ge(t.text, this);
|
|
1819
|
+
} }], a && Se(i.prototype, a), Object.defineProperty(i, "prototype", { writable: !1 }), r;
|
|
1640
1820
|
}();
|
|
1641
|
-
function
|
|
1642
|
-
return
|
|
1643
|
-
return typeof
|
|
1644
|
-
} : function(
|
|
1645
|
-
return
|
|
1646
|
-
},
|
|
1647
|
-
}
|
|
1648
|
-
function
|
|
1649
|
-
(
|
|
1650
|
-
for (var
|
|
1651
|
-
return
|
|
1821
|
+
function xt(r) {
|
|
1822
|
+
return xt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(i) {
|
|
1823
|
+
return typeof i;
|
|
1824
|
+
} : function(i) {
|
|
1825
|
+
return i && typeof Symbol == "function" && i.constructor === Symbol && i !== Symbol.prototype ? "symbol" : typeof i;
|
|
1826
|
+
}, xt(r);
|
|
1827
|
+
}
|
|
1828
|
+
function ne(r, i) {
|
|
1829
|
+
(i == null || i > r.length) && (i = r.length);
|
|
1830
|
+
for (var a = 0, t = new Array(i); a < i; a++) t[a] = r[a];
|
|
1831
|
+
return t;
|
|
1652
1832
|
}
|
|
1653
|
-
function
|
|
1654
|
-
for (var
|
|
1655
|
-
var
|
|
1656
|
-
|
|
1657
|
-
if (
|
|
1658
|
-
var
|
|
1659
|
-
if (
|
|
1660
|
-
var
|
|
1661
|
-
if (
|
|
1833
|
+
function Ce(r, i) {
|
|
1834
|
+
for (var a = 0; a < i.length; a++) {
|
|
1835
|
+
var t = i[a];
|
|
1836
|
+
t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(r, (s = function(c, p) {
|
|
1837
|
+
if (xt(c) !== "object" || c === null) return c;
|
|
1838
|
+
var m = c[Symbol.toPrimitive];
|
|
1839
|
+
if (m !== void 0) {
|
|
1840
|
+
var w = m.call(c, p);
|
|
1841
|
+
if (xt(w) !== "object") return w;
|
|
1662
1842
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1663
1843
|
}
|
|
1664
|
-
return String(
|
|
1665
|
-
}(
|
|
1844
|
+
return String(c);
|
|
1845
|
+
}(t.key, "string"), xt(s) === "symbol" ? s : String(s)), t);
|
|
1666
1846
|
}
|
|
1667
|
-
var
|
|
1847
|
+
var s;
|
|
1668
1848
|
}
|
|
1669
|
-
var
|
|
1670
|
-
return typeof
|
|
1671
|
-
return
|
|
1849
|
+
var Te = function(r) {
|
|
1850
|
+
return typeof r == "function" ? r : function() {
|
|
1851
|
+
return r;
|
|
1672
1852
|
};
|
|
1673
|
-
},
|
|
1674
|
-
function
|
|
1675
|
-
if (function(
|
|
1676
|
-
if (!(
|
|
1677
|
-
}(this,
|
|
1853
|
+
}, ie = function() {
|
|
1854
|
+
function r(t) {
|
|
1855
|
+
if (function(c, p) {
|
|
1856
|
+
if (!(c instanceof p)) throw new TypeError("Cannot call a class as a function");
|
|
1857
|
+
}(this, r), this.props = { width: function() {
|
|
1678
1858
|
return 1 / 0;
|
|
1679
1859
|
}, height: function() {
|
|
1680
1860
|
return 1 / 0;
|
|
1681
|
-
}, rotation: 0, vAnchor: 0, hAnchor: 0 },
|
|
1861
|
+
}, rotation: 0, vAnchor: 0, hAnchor: 0 }, t) for (var s in t) typeof this[s] == "function" && this[s](t[s]);
|
|
1682
1862
|
this.render = this.render.bind(this);
|
|
1683
1863
|
}
|
|
1684
|
-
var
|
|
1685
|
-
return
|
|
1686
|
-
var
|
|
1687
|
-
if (!arguments.length) return [
|
|
1688
|
-
if (typeof
|
|
1689
|
-
var
|
|
1690
|
-
|
|
1691
|
-
|
|
1864
|
+
var i, a;
|
|
1865
|
+
return i = r, a = [{ key: "anchor", value: function(t) {
|
|
1866
|
+
var s = this.props, c = s.hAnchor, p = s.vAnchor, m = s.width, w = s.height;
|
|
1867
|
+
if (!arguments.length) return [c * m(0), p * w(0)];
|
|
1868
|
+
if (typeof t == "string") {
|
|
1869
|
+
var b = this.props;
|
|
1870
|
+
t.toLowerCase().trim().split(/\s+/).forEach(function(E) {
|
|
1871
|
+
E === "top" && (b.vAnchor = -0), E === "middle" && (b.vAnchor = -0.5), E === "bottom" && (b.vAnchor = -1), E === "left" && (b.hAnchor = -0), E === "center" && (b.hAnchor = -0.5), E === "right" && (b.hAnchor = -1);
|
|
1692
1872
|
});
|
|
1693
1873
|
}
|
|
1694
1874
|
return this;
|
|
1695
|
-
} }, { key: "width", value: function(
|
|
1696
|
-
return arguments.length ? (this.props.width =
|
|
1697
|
-
} }, { key: "height", value: function(
|
|
1698
|
-
return arguments.length ? (this.props.height =
|
|
1699
|
-
} }, { key: "rotate", value: function(
|
|
1700
|
-
return arguments.length ? (this.props.rotation =
|
|
1701
|
-
} }, { key: "createElement", value: function(
|
|
1702
|
-
return arguments.length ? (this.props.createElement =
|
|
1703
|
-
} }, { key: "canvas", value: function(
|
|
1704
|
-
var
|
|
1705
|
-
return
|
|
1706
|
-
if (Array.isArray(
|
|
1707
|
-
}(
|
|
1708
|
-
if (typeof Symbol < "u" &&
|
|
1709
|
-
}(
|
|
1710
|
-
if (
|
|
1711
|
-
if (typeof
|
|
1712
|
-
var
|
|
1713
|
-
return
|
|
1875
|
+
} }, { key: "width", value: function(t) {
|
|
1876
|
+
return arguments.length ? (this.props.width = Te(t), this) : this.props.width;
|
|
1877
|
+
} }, { key: "height", value: function(t) {
|
|
1878
|
+
return arguments.length ? (this.props.height = Te(t), this) : this.props.height;
|
|
1879
|
+
} }, { key: "rotate", value: function(t) {
|
|
1880
|
+
return arguments.length ? (this.props.rotation = t, this) : this.props.rotation;
|
|
1881
|
+
} }, { key: "createElement", value: function(t) {
|
|
1882
|
+
return arguments.length ? (this.props.createElement = t, this) : this.props.createElement || r.createElement;
|
|
1883
|
+
} }, { key: "canvas", value: function(t, s) {
|
|
1884
|
+
var c, p = t.getContext ? t.getContext("2d") : t;
|
|
1885
|
+
return p.save(), p.rotate(this.rotate() * Math.PI / 180), p.translate.apply(p, function(m) {
|
|
1886
|
+
if (Array.isArray(m)) return ne(m);
|
|
1887
|
+
}(c = this.anchor()) || function(m) {
|
|
1888
|
+
if (typeof Symbol < "u" && m[Symbol.iterator] != null || m["@@iterator"] != null) return Array.from(m);
|
|
1889
|
+
}(c) || function(m, w) {
|
|
1890
|
+
if (m) {
|
|
1891
|
+
if (typeof m == "string") return ne(m, w);
|
|
1892
|
+
var b = Object.prototype.toString.call(m).slice(8, -1);
|
|
1893
|
+
return b === "Object" && m.constructor && (b = m.constructor.name), b === "Map" || b === "Set" ? Array.from(m) : b === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(b) ? ne(m, w) : void 0;
|
|
1714
1894
|
}
|
|
1715
|
-
}(
|
|
1895
|
+
}(c) || function() {
|
|
1716
1896
|
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1717
1897
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
1718
|
-
}()),
|
|
1898
|
+
}()), s(p), p.restore(), p;
|
|
1719
1899
|
} }, { key: "render", value: function() {
|
|
1720
|
-
var
|
|
1721
|
-
if (
|
|
1722
|
-
if (
|
|
1723
|
-
if (
|
|
1724
|
-
var
|
|
1725
|
-
return this.createElement()("g", { transform: "rotate(".concat(this.rotate(), ") translate(").concat(this.anchor(), ")") },
|
|
1900
|
+
var t = _e(arguments);
|
|
1901
|
+
if (t.d3) return t.d3.attr("transform", "rotate(".concat(this.rotate(), ") translate(").concat(this.anchor(), ")"));
|
|
1902
|
+
if (t.ctx) return this.canvas(t.ctx, t.fn);
|
|
1903
|
+
if (t.text) {
|
|
1904
|
+
var s = typeof t.text.render == "function" ? t.text.render() : t.text;
|
|
1905
|
+
return this.createElement()("g", { transform: "rotate(".concat(this.rotate(), ") translate(").concat(this.anchor(), ")") }, s);
|
|
1726
1906
|
}
|
|
1727
|
-
} }],
|
|
1728
|
-
}(),
|
|
1729
|
-
function
|
|
1730
|
-
return
|
|
1731
|
-
return
|
|
1732
|
-
})),
|
|
1733
|
-
}
|
|
1734
|
-
function
|
|
1735
|
-
if (Array.isArray(
|
|
1736
|
-
return
|
|
1907
|
+
} }], a && Ce(i.prototype, a), Object.defineProperty(i, "prototype", { writable: !1 }), r;
|
|
1908
|
+
}(), Re = Object.prototype.hasOwnProperty, oe = {};
|
|
1909
|
+
function Ze(r) {
|
|
1910
|
+
return oe[r] || (oe[r] = r.replace(/([a-z])([A-Z])/g, function(i, a, t) {
|
|
1911
|
+
return a + "-" + t.toLowerCase();
|
|
1912
|
+
})), oe[r];
|
|
1913
|
+
}
|
|
1914
|
+
function se(r, i) {
|
|
1915
|
+
if (Array.isArray(i)) return i.forEach(function(a) {
|
|
1916
|
+
return se(r, a);
|
|
1737
1917
|
});
|
|
1738
|
-
typeof
|
|
1918
|
+
typeof i == "string" && (i = document.createTextNode(i)), r.appendChild(i);
|
|
1739
1919
|
}
|
|
1740
|
-
function
|
|
1920
|
+
function ae(r, i) {
|
|
1741
1921
|
if (typeof document < "u") {
|
|
1742
|
-
var
|
|
1743
|
-
if (
|
|
1744
|
-
for (var
|
|
1745
|
-
return
|
|
1746
|
-
|
|
1747
|
-
}),
|
|
1922
|
+
var a = typeof r == "string" ? document.createElementNS("http://www.w3.org/2000/svg", r) : r;
|
|
1923
|
+
if (i && a.setAttribute) for (var t in i) Re.call(i, t) && i[t] != null && a.setAttribute(t === "className" ? "class" : Ze(t), i[t]);
|
|
1924
|
+
for (var s = arguments.length, c = new Array(s > 2 ? s - 2 : 0), p = 2; p < s; p++) c[p - 2] = arguments[p];
|
|
1925
|
+
return c != null && c.length && c.forEach(function(m) {
|
|
1926
|
+
se(a, m);
|
|
1927
|
+
}), a;
|
|
1748
1928
|
}
|
|
1749
1929
|
}
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
for (var
|
|
1753
|
-
for (var
|
|
1754
|
-
|
|
1755
|
-
},
|
|
1756
|
-
var
|
|
1757
|
-
if (
|
|
1758
|
-
for (var
|
|
1759
|
-
for (;
|
|
1760
|
-
for (;
|
|
1930
|
+
G.createElement = ae, G.textparser = kt, G.defaultparser = kt, G.htmlparser = function(r) {
|
|
1931
|
+
r = String(r || "").trim();
|
|
1932
|
+
for (var i, a, t = { weight: null, style: null, sub: !1, sup: !1, href: null, color: null, rel: null, target: null }, s = [], c = [], p = function(D) {
|
|
1933
|
+
for (var T in t) t[T] && (D[T] = t[T]);
|
|
1934
|
+
s.push(D);
|
|
1935
|
+
}, m = function(D) {
|
|
1936
|
+
var T = s.length, O = Be[D];
|
|
1937
|
+
if (T && O) {
|
|
1938
|
+
for (var j = T - 1; s[j] && (s[j] instanceof lt || He.test(s[j].value)); ) j--;
|
|
1939
|
+
for (; O && s[j] && s[j] instanceof X; ) j--, O--;
|
|
1940
|
+
for (; O-- > 0; ) s.push(new X());
|
|
1761
1941
|
}
|
|
1762
|
-
};
|
|
1763
|
-
if (
|
|
1764
|
-
else if (!(
|
|
1765
|
-
else if (
|
|
1766
|
-
var
|
|
1767
|
-
|
|
1768
|
-
var
|
|
1769
|
-
|
|
1770
|
-
} else
|
|
1771
|
-
|
|
1942
|
+
}; r.length; ) {
|
|
1943
|
+
if (i = /^[^<]+/.exec(r)) kt(Zt(i[0]), !1).forEach(p);
|
|
1944
|
+
else if (!(i = $t.exec(r))) if (i = Gt.exec(r)) c.length && (t = c.pop()), m(i[1]);
|
|
1945
|
+
else if (i = Jt.exec(r)) {
|
|
1946
|
+
var w = i[1];
|
|
1947
|
+
m(w), c.push(t), t = Object.create(t), _t[w] && _t[w](t, "");
|
|
1948
|
+
var b = It(i[2]);
|
|
1949
|
+
w === "a" && (b.href && (t.href = b.href), b.rel && (t.rel = b.rel), b.target && (t.target = b.target)), b.class && (t.class = t.class ? t.class + " " + b.class : b.class), b.style && (a = /(?:^|\s|;)color\s*:\s*([^;\s"']+)/.exec(b.style)) && a[1] && (t.color = a[1]), w === "br" && s.push(new X());
|
|
1950
|
+
} else i = [r.slice(0, 1)], p(new M(i[0]));
|
|
1951
|
+
r = r.slice(i[0].length);
|
|
1772
1952
|
}
|
|
1773
|
-
for (var
|
|
1774
|
-
return
|
|
1775
|
-
},
|
|
1776
|
-
|
|
1777
|
-
var
|
|
1778
|
-
|
|
1779
|
-
return
|
|
1953
|
+
for (var E = s[s.length - 1]; E instanceof X; ) s.pop(), E = s[s.length - 1];
|
|
1954
|
+
return s;
|
|
1955
|
+
}, G.latexparser = function(r) {
|
|
1956
|
+
r = String(r || "").trim();
|
|
1957
|
+
var i = [0];
|
|
1958
|
+
r = r.replace(/\\verb,(.*?),/, function(F, P) {
|
|
1959
|
+
return i.push(P), "\\verb," + (i.length - 1) + ",";
|
|
1780
1960
|
}).replace(/\\\\\n/g, function() {
|
|
1781
1961
|
return "\\\\";
|
|
1782
|
-
}).replace(
|
|
1783
|
-
return
|
|
1784
|
-
}).replace(/\n\s+/g, function(
|
|
1785
|
-
return /\n/.test(
|
|
1786
|
-
}).replace(/\\symbol\{(\d+)\}/, function(
|
|
1787
|
-
return
|
|
1788
|
-
}).replace(/(^|[^\\])(\^|_)(\d|[^{]\S*)/g, function(
|
|
1789
|
-
return
|
|
1790
|
-
}).replace(/\\verb,(.*?),/, function(
|
|
1791
|
-
return "\\verb,".concat(
|
|
1962
|
+
}).replace(Ye, function(F, P, H) {
|
|
1963
|
+
return H.charAt(P - 1) === "\\" ? F : Qt[F];
|
|
1964
|
+
}).replace(/\n\s+/g, function(F) {
|
|
1965
|
+
return /\n/.test(F.slice(1)) ? "\\par " : F;
|
|
1966
|
+
}).replace(/\\symbol\{(\d+)\}/, function(F, P, H, N) {
|
|
1967
|
+
return N.charAt(H - 1) === "\\" ? F : String.fromCharCode(1 * P);
|
|
1968
|
+
}).replace(/(^|[^\\])(\^|_)(\d|[^{]\S*)/g, function(F, P, H, N) {
|
|
1969
|
+
return P + H + "{" + N + "}";
|
|
1970
|
+
}).replace(/\\verb,(.*?),/, function(F, P) {
|
|
1971
|
+
return "\\verb,".concat(i[+P], ",");
|
|
1792
1972
|
});
|
|
1793
|
-
for (var
|
|
1794
|
-
for (var
|
|
1795
|
-
return
|
|
1796
|
-
},
|
|
1797
|
-
|
|
1798
|
-
},
|
|
1799
|
-
if (!
|
|
1800
|
-
|
|
1801
|
-
},
|
|
1802
|
-
if (
|
|
1803
|
-
else if (
|
|
1804
|
-
else if (!(
|
|
1805
|
-
if (
|
|
1806
|
-
else if (
|
|
1807
|
-
else if (!(
|
|
1808
|
-
else if (
|
|
1809
|
-
var
|
|
1810
|
-
if (/^(La)?TeX$/i.test(
|
|
1811
|
-
|
|
1812
|
-
var
|
|
1813
|
-
|
|
1814
|
-
} else if (
|
|
1815
|
-
else if (
|
|
1816
|
-
var
|
|
1817
|
-
if (
|
|
1818
|
-
for (
|
|
1819
|
-
if (!(
|
|
1820
|
-
|
|
1973
|
+
for (var a, t = { weight: null, italic: null, variant: null, sub: !1, sup: !1, href: null }, s = [], c = [], p = function(F) {
|
|
1974
|
+
for (var P in t) t[P] && (F[P] = t[P]);
|
|
1975
|
+
return s.push(F), F;
|
|
1976
|
+
}, m = function() {
|
|
1977
|
+
c.push(t), t = Object.create(t);
|
|
1978
|
+
}, w = function() {
|
|
1979
|
+
if (!c.length) throw new Error("Unexpected }");
|
|
1980
|
+
t = c.pop();
|
|
1981
|
+
}, b = { tokens: s, open_context: m, close_context: w, add_token: p }; r.length; ) {
|
|
1982
|
+
if (a = jt.exec(r)) kt(a[0], !1).forEach(p);
|
|
1983
|
+
else if (a = Ue.exec(r)) p(new M(a[1]));
|
|
1984
|
+
else if (!(a = xe.exec(r))) {
|
|
1985
|
+
if (a = /^\{/.exec(r)) m();
|
|
1986
|
+
else if (a = /^\}/.exec(r)) w();
|
|
1987
|
+
else if (!(a = /^\$/.exec(r))) if (a = /^\\verb,([^,]+),/.exec(r)) p(new M(a[1]));
|
|
1988
|
+
else if (a = we.exec(r)) {
|
|
1989
|
+
var E = a[1].slice(1) || a[1], D = !!a[2];
|
|
1990
|
+
if (/^(La)?TeX$/i.test(E)) {
|
|
1991
|
+
m(), t.family = "serif";
|
|
1992
|
+
var T = void 0;
|
|
1993
|
+
E === "LaTeX" && ((T = p(new M("L"))).tracking = -0.25, (T = p(new M("A"))).size = 0.7, T.baseline = 0.3, T.tracking = -0.1), (T = p(new M("T"))).tracking = -0.17, (T = p(new M("E"))).baseline = -0.22, T.tracking = -0.13, T = p(new M("X")), w();
|
|
1994
|
+
} else if (E in bt) p(new M(bt[E])), D && m();
|
|
1995
|
+
else if (E in q) {
|
|
1996
|
+
var O = [], j = q[E].length - 1, W = void 0;
|
|
1997
|
+
if (j) {
|
|
1998
|
+
for (D = !1, r = r.slice(a[0].length - 1); j--; ) {
|
|
1999
|
+
if (!(W = /^\{([^}]+)\}/.exec(r))) throw new Error(E + " is missing an argument");
|
|
2000
|
+
O.push(W[1]), r = r.slice(W[0].length);
|
|
1821
2001
|
}
|
|
1822
|
-
|
|
2002
|
+
a[0] = /^\{/.exec(r) ? "{" : "", D = !!a[0];
|
|
1823
2003
|
}
|
|
1824
|
-
|
|
1825
|
-
} else console.warn("unknown latex command",
|
|
1826
|
-
} else
|
|
2004
|
+
D && m(), q[E].apply(b, [t].concat(O));
|
|
2005
|
+
} else console.warn("unknown latex command", E), p(new M(a[1])), D && m();
|
|
2006
|
+
} else a = [r.slice(0, 1)], p(new M(a[0]));
|
|
1827
2007
|
}
|
|
1828
|
-
|
|
2008
|
+
r = r.slice(a[0].length);
|
|
1829
2009
|
}
|
|
1830
|
-
return
|
|
1831
|
-
},
|
|
1832
|
-
return
|
|
1833
|
-
},
|
|
1834
|
-
const
|
|
1835
|
-
return
|
|
2010
|
+
return s;
|
|
2011
|
+
}, G.measureText = function(r, i, a) {
|
|
2012
|
+
return B(r, R(i), a);
|
|
2013
|
+
}, G.Token = M, G.Break = lt, G.LineBreak = X, G.SoftHyphen = ut, G.Rotator = ie, ie.createElement = ae;
|
|
2014
|
+
const Qe = G;
|
|
2015
|
+
return n.default;
|
|
1836
2016
|
})());
|
|
1837
|
-
}(
|
|
2017
|
+
}(dr)), dr.exports;
|
|
1838
2018
|
}
|
|
1839
|
-
var
|
|
1840
|
-
const
|
|
1841
|
-
function
|
|
1842
|
-
return
|
|
2019
|
+
var Cn = Sn();
|
|
2020
|
+
const Tr = /* @__PURE__ */ Ur(Cn);
|
|
2021
|
+
function ir(u) {
|
|
2022
|
+
return u.replace(/…$/, "");
|
|
1843
2023
|
}
|
|
1844
|
-
function
|
|
1845
|
-
return
|
|
2024
|
+
function or(u) {
|
|
2025
|
+
return u.children[0].innerHTML;
|
|
1846
2026
|
}
|
|
1847
|
-
function
|
|
1848
|
-
const
|
|
1849
|
-
if (
|
|
1850
|
-
const
|
|
1851
|
-
font: `${
|
|
1852
|
-
width:
|
|
1853
|
-
height:
|
|
2027
|
+
function Tn(u, e) {
|
|
2028
|
+
const o = mt(u), { fontSize: n, font: l, padding: h = 0 } = u.properties.style || {};
|
|
2029
|
+
if (o.width === o.height && o.width === 0) return;
|
|
2030
|
+
const f = new Tr({
|
|
2031
|
+
font: `${n}px/${n}px ${l}`.replace(/(px)+/g, "px"),
|
|
2032
|
+
width: o.width - h * 2,
|
|
2033
|
+
height: o.height - h * 2,
|
|
1854
2034
|
align: "left",
|
|
1855
2035
|
valign: "top",
|
|
1856
2036
|
x: 0,
|
|
1857
2037
|
overflow: "ellipsis",
|
|
1858
2038
|
parser: "html",
|
|
1859
|
-
createElement:
|
|
2039
|
+
createElement: Tr.createElement
|
|
1860
2040
|
});
|
|
1861
|
-
|
|
1862
|
-
const
|
|
1863
|
-
|
|
2041
|
+
f.overflowWrap("break-word");
|
|
2042
|
+
const g = f.linebreak(
|
|
2043
|
+
u.properties.content.replaceAll(`
|
|
1864
2044
|
`, "<br>")
|
|
1865
|
-
).render(),
|
|
1866
|
-
let
|
|
2045
|
+
).render(), d = [...g.children];
|
|
2046
|
+
let v = 0;
|
|
1867
2047
|
const y = [];
|
|
1868
|
-
|
|
1869
|
-
`).forEach((
|
|
1870
|
-
let
|
|
1871
|
-
for (;
|
|
1872
|
-
if (
|
|
1873
|
-
|
|
1874
|
-
`) || y.push(
|
|
2048
|
+
u.properties.content.split(`
|
|
2049
|
+
`).forEach((S) => {
|
|
2050
|
+
let R = S;
|
|
2051
|
+
for (; R.length && v < d.length; ) {
|
|
2052
|
+
if (d[v].innerHTML === " ") {
|
|
2053
|
+
R.startsWith(`
|
|
2054
|
+
`) || y.push(v), v++;
|
|
1875
2055
|
break;
|
|
1876
2056
|
}
|
|
1877
|
-
const
|
|
1878
|
-
|
|
2057
|
+
const C = ir(or(d[v]));
|
|
2058
|
+
R.startsWith(C) && (R = R.slice(C.length).trim()), v++;
|
|
1879
2059
|
}
|
|
1880
|
-
}), y.forEach((
|
|
1881
|
-
const
|
|
1882
|
-
|
|
1883
|
-
let
|
|
1884
|
-
const
|
|
1885
|
-
for (;
|
|
1886
|
-
const
|
|
1887
|
-
(
|
|
2060
|
+
}), y.forEach((S) => g.removeChild(d[S]));
|
|
2061
|
+
const A = u.properties.content.match(/(https?:\/\/.*)/gm), _ = A ? A.map((S) => S.split(" ")[0]) : [];
|
|
2062
|
+
g.setAttribute("transform", `translate(${h}, ${h})`), _.forEach((S) => {
|
|
2063
|
+
let R = S;
|
|
2064
|
+
const C = [];
|
|
2065
|
+
for (; R.length > 0; ) {
|
|
2066
|
+
const L = d.find(
|
|
2067
|
+
(k) => !!k.children[0] && k.children[0].tagName === "tspan" && R.startsWith(ir(or(k)))
|
|
1888
2068
|
);
|
|
1889
|
-
if (!
|
|
1890
|
-
|
|
1891
|
-
const
|
|
1892
|
-
if (!
|
|
1893
|
-
|
|
2069
|
+
if (!L) break;
|
|
2070
|
+
C.push(L);
|
|
2071
|
+
const I = ir(L.children[0].innerHTML).length;
|
|
2072
|
+
if (!I) break;
|
|
2073
|
+
R = R.slice(I);
|
|
1894
2074
|
}
|
|
1895
|
-
|
|
1896
|
-
const
|
|
1897
|
-
|
|
2075
|
+
C.forEach((L) => {
|
|
2076
|
+
const I = document.createElementNS("http://www.w3.org/2000/svg", "a");
|
|
2077
|
+
I.setAttribute("href", S), I.setAttribute("target", "_blank"), I.innerHTML = or(L), L.children[0].innerHTML = "", L.children[0].appendChild(I);
|
|
1898
2078
|
});
|
|
1899
|
-
}),
|
|
2079
|
+
}), e.appendChild(g);
|
|
1900
2080
|
}
|
|
1901
|
-
const
|
|
1902
|
-
class
|
|
1903
|
-
constructor(
|
|
2081
|
+
const Rr = 20;
|
|
2082
|
+
class Rn extends Vr {
|
|
2083
|
+
constructor(e, o = {}) {
|
|
1904
2084
|
super(
|
|
1905
|
-
|
|
2085
|
+
e,
|
|
1906
2086
|
`
|
|
1907
2087
|
<div class="annotation-text-handle" data-handle-id="8">
|
|
1908
2088
|
<span class="handle line-handle top" data-handle-id="0"></span>
|
|
@@ -1916,187 +2096,187 @@ class Mn extends Fr {
|
|
|
1916
2096
|
<textarea wrap="on"></textarea>
|
|
1917
2097
|
</div>
|
|
1918
2098
|
`
|
|
1919
|
-
),
|
|
2099
|
+
), x(this, "textArea"), x(this, "handleSize"), x(this, "rect", { x: 0, y: 0, width: 0, height: 0 }), x(this, "annotation", { ...nr }), x(this, "startX", 0), x(this, "startY", 0), x(this, "handles", []), x(this, "draggedHandle", V), x(this, "isFocused", !1), x(this, "placeholder", "Type your text here..."), x(this, "_onFocus", () => {
|
|
1920
2100
|
this.textArea.value === this.placeholder && (this.textArea.value = ""), this.isFocused = !0;
|
|
1921
|
-
}),
|
|
2101
|
+
}), x(this, "_onBlur", () => {
|
|
1922
2102
|
this.isFocused = !1;
|
|
1923
|
-
}),
|
|
1924
|
-
this.add(
|
|
1925
|
-
const
|
|
1926
|
-
this.select(
|
|
1927
|
-
}),
|
|
1928
|
-
this.isDragging && (this.remove(this.annotation.id), this.annotation = { ...
|
|
1929
|
-
}),
|
|
1930
|
-
this.annotation =
|
|
1931
|
-
const
|
|
1932
|
-
this.rect.x =
|
|
1933
|
-
}),
|
|
1934
|
-
const
|
|
1935
|
-
if (!
|
|
1936
|
-
this.selectedId !==
|
|
1937
|
-
const { x:
|
|
1938
|
-
this.startDragging(
|
|
1939
|
-
}),
|
|
1940
|
-
requestAnimationFrame(() => this._onMouseMove(
|
|
1941
|
-
}),
|
|
2103
|
+
}), x(this, "startDrawing", (l, h, f = kn(l, h, 0, 0, "", Wt)) => {
|
|
2104
|
+
this.add(f);
|
|
2105
|
+
const g = this.ogma.view.graphToScreenCoordinates({ x: l, y: h });
|
|
2106
|
+
this.select(f.id), this.startDragging(this.getById(f.id), g.x, g.y), this.draggedHandle = 6;
|
|
2107
|
+
}), x(this, "cancelDrawing", () => {
|
|
2108
|
+
this.isDragging && (this.remove(this.annotation.id), this.annotation = { ...nr }, this.draggedHandle = V, this.isDragging = !1, this.emit(Ut, this.annotation));
|
|
2109
|
+
}), x(this, "startDragging", (l, h, f) => {
|
|
2110
|
+
this.annotation = l;
|
|
2111
|
+
const g = vt(this.annotation), d = mt(this.annotation);
|
|
2112
|
+
this.rect.x = g.x, this.rect.y = g.y, this.rect.width = d.width, this.rect.height = d.height, this.startX = h, this.startY = f, this.disableDragging(), this.textArea.classList.add("noevents"), this.textArea.setAttribute("disabled", "disabled"), this.emit(ze, this.annotation), this.isDragging = !0;
|
|
2113
|
+
}), x(this, "onHandleMouseDown", (l) => {
|
|
2114
|
+
const h = this.getById(this.selectedId) || this.getById(this.hoveredId);
|
|
2115
|
+
if (!h) return;
|
|
2116
|
+
this.selectedId !== h.id && this.select(this.hoveredId);
|
|
2117
|
+
const { x: f, y: g } = sr(l, this.ogma.getContainer());
|
|
2118
|
+
this.startDragging(h, f, g), this.draggedHandle = Nr(l.target);
|
|
2119
|
+
}), x(this, "onMouseMove", (l) => {
|
|
2120
|
+
requestAnimationFrame(() => this._onMouseMove(l));
|
|
2121
|
+
}), x(this, "_onMouseMove", (l) => {
|
|
1942
2122
|
if (!this.isDragging) return;
|
|
1943
|
-
|
|
1944
|
-
const
|
|
1945
|
-
let
|
|
1946
|
-
const
|
|
1947
|
-
let y =
|
|
1948
|
-
!y && !
|
|
1949
|
-
const { x:
|
|
1950
|
-
|
|
2123
|
+
l.stopPropagation(), l.preventDefault();
|
|
2124
|
+
const h = this.handles[this.draggedHandle];
|
|
2125
|
+
let f = h.classList.contains("top");
|
|
2126
|
+
const g = h.classList.contains("left"), d = h.classList.contains("right"), v = h.classList.contains("bottom");
|
|
2127
|
+
let y = h.classList.contains("line-handle");
|
|
2128
|
+
!y && !f && !v && !g && !d && (f = !0, y = !0);
|
|
2129
|
+
const { x: A, y: _ } = sr(
|
|
2130
|
+
l,
|
|
1951
2131
|
this.ogma.getContainer()
|
|
1952
2132
|
);
|
|
1953
|
-
let
|
|
1954
|
-
const
|
|
1955
|
-
y ? (
|
|
1956
|
-
}),
|
|
1957
|
-
!this.isDragging || this.draggedHandle ===
|
|
1958
|
-
}),
|
|
1959
|
-
|
|
1960
|
-
}),
|
|
1961
|
-
const
|
|
1962
|
-
document.documentElement.style.setProperty("--handle-scale", `${1 /
|
|
1963
|
-
}),
|
|
1964
|
-
const
|
|
1965
|
-
|
|
1966
|
-
}), this.showeditorOnHover = !1, this.handleSize =
|
|
1967
|
-
const
|
|
1968
|
-
|
|
2133
|
+
let S = this.rect.x, R = this.rect.y, C = Math.max(this.rect.width, Rr), L = Math.max(this.rect.height, Rr);
|
|
2134
|
+
const I = this.ogma.view.getZoom(), k = (A - this.startX) / I, z = (_ - this.startY) / I, B = this.ogma.view.getAngle(), tt = st({ x: k, y: z }, B), rt = st({ x: k, y: z }, -B);
|
|
2135
|
+
y ? (S = this.rect.x + tt.x, R = this.rect.y + tt.y) : g && f ? (S += tt.x, R += tt.y, C -= k, L -= z) : d && v ? (C += k, L += z) : g && v ? (S += rt.x, C -= rt.x, L += rt.y) : d && f && (R += rt.y, C += rt.x, L -= rt.y), hn(this.annotation, S, R, C, L), this.emit(Me, this.annotation, "text"), this.refreshEditor(), this.layer.refresh();
|
|
2136
|
+
}), x(this, "onMouseUp", () => {
|
|
2137
|
+
!this.isDragging || this.draggedHandle === V || (this.restoreDragging(), this.textArea.classList.remove("noevents"), this.textArea.removeAttribute("disabled"), this.emit(Ut, this.annotation), this.isDragging = !1, this.draggedHandle = V);
|
|
2138
|
+
}), x(this, "_onMousedown", (l) => {
|
|
2139
|
+
l.stopPropagation();
|
|
2140
|
+
}), x(this, "onViewChanged", () => {
|
|
2141
|
+
const l = Math.max(2, this.handleSize / this.ogma.view.getZoom());
|
|
2142
|
+
document.documentElement.style.setProperty("--handle-scale", `${1 / l}`), this.ogma.view.getAngle() === 0 ? this.editor.element.classList.remove("rotated") : this.editor.element.classList.add("rotated");
|
|
2143
|
+
}), x(this, "_onInput", () => {
|
|
2144
|
+
const l = this.getById(this.selectedId);
|
|
2145
|
+
l && (this.textArea.value = this.textArea.value.replace(/ +(?= )/g, ""), this.textArea.focus(), l.properties.content = this.textArea.value, this.emit(cr, l), this.layer.refresh());
|
|
2146
|
+
}), this.showeditorOnHover = !1, this.handleSize = Sr.handleSize, this.placeholder = Sr.placeholder;
|
|
2147
|
+
const n = this.textArea = this.editor.element.querySelector("textarea");
|
|
2148
|
+
n.addEventListener("input", this._onInput), n.addEventListener("focus", this._onFocus), n.addEventListener("blur", this._onBlur), n.addEventListener("mousedown", this._onMousedown), n.spellcheck = !1, this.handles = Array.prototype.slice.call(
|
|
1969
2149
|
this.editor.element.querySelectorAll(".annotation-text-handle > .handle")
|
|
1970
2150
|
), this.handles.push(this.editor.element), this.handles.forEach(
|
|
1971
|
-
(
|
|
1972
|
-
), document.addEventListener("mouseup", this.onMouseUp), document.addEventListener("mousemove", this.onMouseMove, !0),
|
|
2151
|
+
(l) => l.addEventListener("mousedown", this.onHandleMouseDown)
|
|
2152
|
+
), document.addEventListener("mouseup", this.onMouseUp), document.addEventListener("mousemove", this.onMouseMove, !0), e.events.on(["viewChanged", "zoom"], this.onViewChanged);
|
|
1973
2153
|
}
|
|
1974
2154
|
_canRemove() {
|
|
1975
2155
|
return !this.isFocused;
|
|
1976
2156
|
}
|
|
1977
|
-
detect({ x:
|
|
1978
|
-
const
|
|
1979
|
-
return this.elements.find((
|
|
1980
|
-
const { x:
|
|
1981
|
-
return
|
|
2157
|
+
detect({ x: e, y: o }, n = 0) {
|
|
2158
|
+
const l = { x: e, y: o }, h = this.ogma.view.getAngle();
|
|
2159
|
+
return this.elements.find((f) => {
|
|
2160
|
+
const { x: g, y: d } = vt(f), { width: v, height: y } = mt(f), A = { x: g, y: d }, { x: _, y: S } = st(Ot(l, A), -h);
|
|
2161
|
+
return _ > -n && _ < v + n && S > -n && S < y + n;
|
|
1982
2162
|
});
|
|
1983
2163
|
}
|
|
1984
|
-
draw(
|
|
1985
|
-
|
|
1986
|
-
const
|
|
1987
|
-
for (let
|
|
1988
|
-
const
|
|
1989
|
-
if (
|
|
2164
|
+
draw(e) {
|
|
2165
|
+
e.innerHTML = "";
|
|
2166
|
+
const o = "", n = this.ogma.view.getAngle();
|
|
2167
|
+
for (let h = 0; h < this.elements.length; h++) {
|
|
2168
|
+
const f = this.elements[h], g = `class${h}`, d = mt(f), v = vt(f);
|
|
2169
|
+
if (f.id === this.selectedId) continue;
|
|
1990
2170
|
const {
|
|
1991
2171
|
color: y,
|
|
1992
|
-
fontSize:
|
|
1993
|
-
font:
|
|
1994
|
-
strokeColor:
|
|
1995
|
-
strokeWidth:
|
|
1996
|
-
strokeType:
|
|
1997
|
-
background:
|
|
1998
|
-
borderRadius:
|
|
1999
|
-
} =
|
|
2000
|
-
|
|
2001
|
-
const
|
|
2002
|
-
|
|
2003
|
-
let
|
|
2004
|
-
|
|
2005
|
-
const { x:
|
|
2006
|
-
|
|
2172
|
+
fontSize: A,
|
|
2173
|
+
font: _,
|
|
2174
|
+
strokeColor: S,
|
|
2175
|
+
strokeWidth: R,
|
|
2176
|
+
strokeType: C,
|
|
2177
|
+
background: L,
|
|
2178
|
+
borderRadius: I
|
|
2179
|
+
} = f.properties.style || Wt, k = Rt("g");
|
|
2180
|
+
k.classList.add("annotation-text"), k.setAttribute("fill", `${y}`), k.setAttribute("font-size", `${A}px`), k.setAttribute("font-family", `${_}`);
|
|
2181
|
+
const z = Rt("rect");
|
|
2182
|
+
I && (z.setAttribute("rx", `${I}`), z.setAttribute("ry", `${I}`));
|
|
2183
|
+
let B = !1;
|
|
2184
|
+
C && C !== "none" && (B = !0, z.setAttribute("stroke", S || "black"), z.setAttribute("stroke-width", `${R}`), C === "dashed" && z.setAttribute("stroke-dasharray", "5,5")), (L && L.length || B) && (B = !0, z.setAttribute("fill", L || "transparent")), B && (z.setAttribute("width", `${d.width}`), z.setAttribute("height", `${d.height}`)), k.appendChild(z), Tn(f, k);
|
|
2185
|
+
const { x: tt, y: rt } = st(v, -n);
|
|
2186
|
+
k.setAttribute("transform", `translate(${tt},${rt})`), k.classList.add(g), k.setAttribute("data-annotation", `${f.id}`), k.setAttribute("data-annotation-type", "text"), e.appendChild(k);
|
|
2007
2187
|
}
|
|
2008
|
-
const
|
|
2009
|
-
|
|
2188
|
+
const l = Rt("style");
|
|
2189
|
+
l.innerHTML = o, e.firstChild && e.insertBefore(l, e.firstChild);
|
|
2010
2190
|
}
|
|
2011
2191
|
refreshDrawing() {
|
|
2012
|
-
const
|
|
2013
|
-
for (let
|
|
2014
|
-
const
|
|
2015
|
-
if (!
|
|
2016
|
-
const
|
|
2017
|
-
|
|
2192
|
+
const e = this.ogma.view.getAngle(), o = this.layer.element.children;
|
|
2193
|
+
for (let n = 0; n < o.length; n++) {
|
|
2194
|
+
const l = o[n];
|
|
2195
|
+
if (!l.hasAttribute("data-annotation")) continue;
|
|
2196
|
+
const h = l.getAttribute("data-annotation"), f = vt(this.getById(h)), { x: g, y: d } = st(f, -e);
|
|
2197
|
+
l.setAttribute("transform", `translate(${g},${d})`);
|
|
2018
2198
|
}
|
|
2019
2199
|
}
|
|
2020
2200
|
getDefaultOptions() {
|
|
2021
|
-
return
|
|
2201
|
+
return nr;
|
|
2022
2202
|
}
|
|
2023
2203
|
refreshEditor() {
|
|
2024
2204
|
if (+this.selectedId < 0 && +this.hoveredId < 0) return;
|
|
2025
|
-
const
|
|
2026
|
-
|
|
2027
|
-
),
|
|
2028
|
-
font:
|
|
2029
|
-
fontSize:
|
|
2030
|
-
color:
|
|
2031
|
-
background:
|
|
2032
|
-
padding:
|
|
2033
|
-
} =
|
|
2034
|
-
this.textArea.value =
|
|
2035
|
-
const
|
|
2036
|
-
|
|
2037
|
-
const
|
|
2038
|
-
|
|
2039
|
-
}
|
|
2040
|
-
select(
|
|
2041
|
-
super.select(
|
|
2205
|
+
const e = this.getById(this.selectedId) || this.getById(this.hoveredId), o = mt(e), n = this.ogma.view.graphToScreenCoordinates(
|
|
2206
|
+
vt(e)
|
|
2207
|
+
), l = this.ogma.view.getZoom(), {
|
|
2208
|
+
font: h,
|
|
2209
|
+
fontSize: f,
|
|
2210
|
+
color: g,
|
|
2211
|
+
background: d,
|
|
2212
|
+
padding: v = 0
|
|
2213
|
+
} = e.properties.style || Wt, y = (f || 1) * l;
|
|
2214
|
+
this.textArea.value = e.properties.content;
|
|
2215
|
+
const A = this.editor.element.style;
|
|
2216
|
+
A.transform = `translate(${n.x}px, ${n.y}px)translate(-50%, -50%)translate(${o.width / 2 * l}px, ${o.height / 2 * l}px)`, A.width = `${o.width * l}px`, A.height = `${o.height * l}px`;
|
|
2217
|
+
const _ = this.textArea.style;
|
|
2218
|
+
_.font = `${y} ${h}`, _.fontFamily = h || "sans-serif", _.fontSize = `${y}px`, _.padding = `${l * v}px`, _.lineHeight = `${y}px`, _.boxSizing = "border-box", _.color = g || "black", _.background = d || "transparent", this.textArea.placeholder = this.placeholder, this.layer.refresh();
|
|
2219
|
+
}
|
|
2220
|
+
select(e) {
|
|
2221
|
+
super.select(e), this.textArea.classList.add("noevents");
|
|
2042
2222
|
}
|
|
2043
2223
|
destroy() {
|
|
2044
2224
|
super.destroy(), document.removeEventListener("mouseup", this.onMouseUp), document.removeEventListener("mousemove", this.onMouseMove, !0), this.ogma.events.off(this.onViewChanged);
|
|
2045
2225
|
}
|
|
2046
2226
|
}
|
|
2047
|
-
class
|
|
2227
|
+
class On {
|
|
2048
2228
|
constructor() {
|
|
2049
|
-
|
|
2050
|
-
}
|
|
2051
|
-
add(
|
|
2052
|
-
const
|
|
2053
|
-
id:
|
|
2054
|
-
arrow:
|
|
2055
|
-
target:
|
|
2056
|
-
targetType:
|
|
2057
|
-
connectionPoint:
|
|
2058
|
-
side:
|
|
2229
|
+
x(this, "links", {}), x(this, "linksByTargetId", {}), x(this, "linksByArrowId", {});
|
|
2230
|
+
}
|
|
2231
|
+
add(e, o, n, l, h) {
|
|
2232
|
+
const f = Ne(), g = e.id, d = {
|
|
2233
|
+
id: f,
|
|
2234
|
+
arrow: g,
|
|
2235
|
+
target: n,
|
|
2236
|
+
targetType: l,
|
|
2237
|
+
connectionPoint: h,
|
|
2238
|
+
side: o
|
|
2059
2239
|
};
|
|
2060
|
-
return this.links[
|
|
2061
|
-
id:
|
|
2062
|
-
side:
|
|
2063
|
-
type:
|
|
2064
|
-
magnet:
|
|
2240
|
+
return this.links[f] = d, this.linksByTargetId[n] || (this.linksByTargetId[n] = []), this.linksByTargetId[n].push(f), this.linksByArrowId[g] || (this.linksByArrowId[g] = {}), this.linksByArrowId[g][o] = f, e.properties.link = e.properties.link || {}, e.properties.link[o] = {
|
|
2241
|
+
id: n,
|
|
2242
|
+
side: o,
|
|
2243
|
+
type: l,
|
|
2244
|
+
magnet: h
|
|
2065
2245
|
}, this;
|
|
2066
2246
|
}
|
|
2067
|
-
arrowIsLinked(
|
|
2068
|
-
var
|
|
2069
|
-
return !!((
|
|
2247
|
+
arrowIsLinked(e, o) {
|
|
2248
|
+
var n;
|
|
2249
|
+
return !!((n = this.linksByArrowId[e]) != null && n[o]);
|
|
2070
2250
|
}
|
|
2071
2251
|
// remove the link between the arrow and the target by arrow id and side
|
|
2072
|
-
remove(
|
|
2073
|
-
var
|
|
2074
|
-
const
|
|
2075
|
-
if ((
|
|
2076
|
-
const
|
|
2077
|
-
delete this.links[
|
|
2078
|
-
const
|
|
2079
|
-
for (let
|
|
2080
|
-
if (
|
|
2081
|
-
|
|
2252
|
+
remove(e, o) {
|
|
2253
|
+
var n, l;
|
|
2254
|
+
const h = e.id, f = (n = this.linksByArrowId[h]) == null ? void 0 : n[o];
|
|
2255
|
+
if ((l = e.properties.link) == null || delete l[o], !f) return this;
|
|
2256
|
+
const g = this.links[f];
|
|
2257
|
+
delete this.links[f];
|
|
2258
|
+
const d = this.linksByTargetId[g.target];
|
|
2259
|
+
for (let v = 0; v < d.length; v++)
|
|
2260
|
+
if (d[v] === f) {
|
|
2261
|
+
d.splice(v, 1);
|
|
2082
2262
|
break;
|
|
2083
2263
|
}
|
|
2084
|
-
return delete this.linksByArrowId[
|
|
2264
|
+
return delete this.linksByArrowId[h][o], this;
|
|
2085
2265
|
}
|
|
2086
|
-
getArrowLink(
|
|
2087
|
-
var
|
|
2088
|
-
const
|
|
2089
|
-
return
|
|
2266
|
+
getArrowLink(e, o) {
|
|
2267
|
+
var n;
|
|
2268
|
+
const l = (n = this.linksByArrowId[e]) == null ? void 0 : n[o];
|
|
2269
|
+
return l ? this.links[l] : null;
|
|
2090
2270
|
}
|
|
2091
|
-
getTargetLinks(
|
|
2092
|
-
var
|
|
2093
|
-
return ((
|
|
2271
|
+
getTargetLinks(e, o) {
|
|
2272
|
+
var n;
|
|
2273
|
+
return ((n = this.linksByTargetId[e]) == null ? void 0 : n.map((l) => this.links[l]).filter((l) => l.targetType === o)) ?? [];
|
|
2094
2274
|
}
|
|
2095
|
-
forEach(
|
|
2096
|
-
Object.values(this.links).forEach(
|
|
2275
|
+
forEach(e) {
|
|
2276
|
+
Object.values(this.links).forEach(e);
|
|
2097
2277
|
}
|
|
2098
2278
|
}
|
|
2099
|
-
const
|
|
2279
|
+
const at = (u) => u.properties.type === "arrow", yt = (u) => u.properties.type === "text", Or = (u) => u.type === "FeatureCollection", Dn = {
|
|
2100
2280
|
magnetColor: "#3e8",
|
|
2101
2281
|
detectMargin: 20,
|
|
2102
2282
|
magnetHandleRadius: 5,
|
|
@@ -2106,7 +2286,7 @@ const gt = (a) => a.properties.type === "arrow", Tt = (a) => a.properties.type =
|
|
|
2106
2286
|
textHandleSize: 3.5,
|
|
2107
2287
|
minArrowHeight: 20,
|
|
2108
2288
|
maxArrowHeight: 30
|
|
2109
|
-
},
|
|
2289
|
+
}, Dr = ["start", "end"], Pr = [
|
|
2110
2290
|
{ x: 0, y: 0 },
|
|
2111
2291
|
{ x: 0.5, y: 0 },
|
|
2112
2292
|
{ x: 1, y: 0 },
|
|
@@ -2116,126 +2296,126 @@ const gt = (a) => a.properties.type === "arrow", Tt = (a) => a.properties.type =
|
|
|
2116
2296
|
{ x: 0.5, y: 1 },
|
|
2117
2297
|
{ x: 1, y: 1 }
|
|
2118
2298
|
];
|
|
2119
|
-
class Pn extends
|
|
2120
|
-
constructor(
|
|
2121
|
-
super(),
|
|
2299
|
+
class Pn extends Yr {
|
|
2300
|
+
constructor(e, o = {}) {
|
|
2301
|
+
super(), x(this, "arrows"), x(this, "texts"), x(this, "links", new On()), x(this, "layer"), x(this, "annotations"), x(this, "ogma"), x(this, "options"), x(this, "selected", null), x(this, "updateTimeout", 0), x(this, "hoveredNode", null), x(this, "dragged", null), x(this, "textToMagnet"), x(this, "activeLinks", []), x(this, "_render", (n) => {
|
|
2122
2302
|
if (!this.dragged || this.textToMagnet === void 0) return;
|
|
2123
|
-
|
|
2124
|
-
const
|
|
2125
|
-
|
|
2303
|
+
n.beginPath(), n.fillStyle = "green";
|
|
2304
|
+
const l = this.ogma.view.getZoom();
|
|
2305
|
+
Pr.forEach((h) => {
|
|
2126
2306
|
if (!this.textToMagnet) return;
|
|
2127
|
-
const
|
|
2128
|
-
|
|
2129
|
-
}),
|
|
2130
|
-
}),
|
|
2131
|
-
const
|
|
2132
|
-
if (
|
|
2133
|
-
["start", "end"].find((
|
|
2134
|
-
const
|
|
2135
|
-
return this._snapToText(
|
|
2307
|
+
const f = mt(this.textToMagnet), g = vt(this.textToMagnet), d = Ie(h, { x: f.width, y: f.height }), v = st(d, this.ogma.view.getAngle()), { x: y, y: A } = Bt(v, g);
|
|
2308
|
+
n.moveTo(y, A), n.arc(y, A, this.options.magnetHandleRadius / l, 0, Math.PI * 2);
|
|
2309
|
+
}), n.fill(), n.closePath();
|
|
2310
|
+
}), x(this, "_onFeatureDrag", (n, l) => {
|
|
2311
|
+
const h = l;
|
|
2312
|
+
if (at(n) && h === "line")
|
|
2313
|
+
["start", "end"].find((f) => {
|
|
2314
|
+
const g = f === "start" ? de(n) : je(n);
|
|
2315
|
+
return this._snapToText(n, h, g) || this._findAndSnapToNode(n, f, g);
|
|
2136
2316
|
});
|
|
2137
|
-
else if (
|
|
2138
|
-
const
|
|
2139
|
-
this._snapToText(
|
|
2140
|
-
} else
|
|
2141
|
-
const
|
|
2142
|
-
|
|
2317
|
+
else if (at(n) && h !== "line") {
|
|
2318
|
+
const f = h === "start" ? de(n) : je(n);
|
|
2319
|
+
this._snapToText(n, h, f) || this._findAndSnapToNode(n, h, f);
|
|
2320
|
+
} else yt(n) && (this.activeLinks.forEach(({ arrow: f, side: g, connectionPoint: d }) => {
|
|
2321
|
+
const v = this.getAnnotation(f), y = mt(n), A = vt(n), _ = Ie(d, { x: y.width, y: y.height }), S = st(_, this.ogma.view.getAngle()), R = Bt(S, A);
|
|
2322
|
+
v.geometry.coordinates[g === "start" ? 0 : 1] = [R.x, R.y];
|
|
2143
2323
|
}), this.activeLinks.length && this.arrows.refreshLayer());
|
|
2144
|
-
this.layer.refresh(), this.emit(
|
|
2145
|
-
}),
|
|
2146
|
-
this.dragged !== null &&
|
|
2147
|
-
this.links.getArrowLink(
|
|
2148
|
-
arrow:
|
|
2149
|
-
link: this.links.getArrowLink(
|
|
2324
|
+
this.layer.refresh(), this.emit(Me, n, l);
|
|
2325
|
+
}), x(this, "_onFeatureDragEnd", (n) => {
|
|
2326
|
+
this.dragged !== null && at(n) && de(this.dragged) && Dr.forEach((l) => {
|
|
2327
|
+
this.links.getArrowLink(n.id, l) && this.emit(wn, {
|
|
2328
|
+
arrow: n,
|
|
2329
|
+
link: this.links.getArrowLink(n.id, l)
|
|
2150
2330
|
});
|
|
2151
|
-
}), (
|
|
2152
|
-
}),
|
|
2153
|
-
this.textToMagnet = void 0,
|
|
2154
|
-
const
|
|
2155
|
-
|
|
2156
|
-
}), this.emit(
|
|
2157
|
-
}),
|
|
2331
|
+
}), (yt(n) || at(n)) && this.onUpdate(n), this.dragged = null, this.activeLinks = [], this.textToMagnet = void 0, this.annotations.forEach((l) => l.enableDetection()), this.layer.refresh(), this.emit(Ut, n);
|
|
2332
|
+
}), x(this, "_onFeatureDragStart", (n) => {
|
|
2333
|
+
this.textToMagnet = void 0, at(n) ? this.dragged = n : yt(n) && this.activeLinks.push(...this.links.getTargetLinks(n.id, "text")), this.annotations.forEach((l) => {
|
|
2334
|
+
const h = l.getSelectedFeature();
|
|
2335
|
+
h && h !== n && l.unhover().unselect(), l.disableDetection();
|
|
2336
|
+
}), this.emit(ze, n);
|
|
2337
|
+
}), x(this, "_onNodesDragStart", () => {
|
|
2158
2338
|
this.arrows.unhover().unselect(), this.texts.unhover().unselect();
|
|
2159
|
-
}),
|
|
2160
|
-
const { dx:
|
|
2161
|
-
this._moveNodes(
|
|
2162
|
-
}),
|
|
2163
|
-
|
|
2164
|
-
this.links.getTargetLinks(
|
|
2165
|
-
const
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
), y =
|
|
2169
|
-
|
|
2339
|
+
}), x(this, "_onNodesDrag", (n) => {
|
|
2340
|
+
const { dx: l, dy: h } = n;
|
|
2341
|
+
this._moveNodes(n.nodes, l, h);
|
|
2342
|
+
}), x(this, "_onLayoutEnd", (n) => {
|
|
2343
|
+
n.ids.forEach((l, h) => {
|
|
2344
|
+
this.links.getTargetLinks(l, "node").forEach((f) => {
|
|
2345
|
+
const g = this.getAnnotation(f.arrow), d = f.side, v = Le(
|
|
2346
|
+
g,
|
|
2347
|
+
d === "start" ? "end" : "start"
|
|
2348
|
+
), y = n.positions.current[h], A = this.ogma.getNode(l).getAttribute("radius"), _ = $e(v, y, +A);
|
|
2349
|
+
Ht(g, d, _.x, _.y);
|
|
2170
2350
|
});
|
|
2171
2351
|
}), this.arrows.refreshLayer(), this.texts.refreshLayer();
|
|
2172
|
-
}),
|
|
2173
|
-
this.emit(
|
|
2174
|
-
}),
|
|
2175
|
-
this.emit(
|
|
2176
|
-
}),
|
|
2177
|
-
this.selected = null, this.emit(
|
|
2178
|
-
}),
|
|
2179
|
-
this.selected !==
|
|
2180
|
-
}),
|
|
2352
|
+
}), x(this, "_onAdded", (n) => {
|
|
2353
|
+
this.emit(hr, n);
|
|
2354
|
+
}), x(this, "_onRemoved", (n) => {
|
|
2355
|
+
this.emit(ur, n);
|
|
2356
|
+
}), x(this, "_onUnselect", (n) => {
|
|
2357
|
+
this.selected = null, this.emit(lr, n);
|
|
2358
|
+
}), x(this, "_onSelect", (n) => {
|
|
2359
|
+
this.selected !== n && (this.selected = n, this.emit(ar, this.selected));
|
|
2360
|
+
}), x(this, "onUpdate", (n) => {
|
|
2181
2361
|
cancelAnimationFrame(this.updateTimeout), this.updateTimeout = requestAnimationFrame(
|
|
2182
|
-
() => this._onUpdate(
|
|
2362
|
+
() => this._onUpdate(n)
|
|
2183
2363
|
);
|
|
2184
|
-
}),
|
|
2185
|
-
this.emit(
|
|
2186
|
-
}), this.options = this.setOptions({ ...
|
|
2187
|
-
|
|
2364
|
+
}), x(this, "_onUpdate", (n) => {
|
|
2365
|
+
this.emit(cr, n);
|
|
2366
|
+
}), this.options = this.setOptions({ ...Dn, ...o }), this.ogma = e, this.arrows = new An(e, this.options), this.texts = new Rn(e, this.options), this.annotations = [this.arrows, this.texts], this.annotations.forEach((n) => {
|
|
2367
|
+
n.on(ze, this._onFeatureDragStart).on(Me, this._onFeatureDrag).on(Ut, this._onFeatureDragEnd).on(cr, this.onUpdate).on(lr, this._onUnselect).on(ar, this._onSelect).on(hr, this._onAdded).on(ur, this._onRemoved);
|
|
2188
2368
|
}), this.ogma.events.on("nodesDragStart", this._onNodesDragStart).on("nodesDragProgress", this._onNodesDrag).on("layoutEnd", this._onLayoutEnd).on(["viewChanged", "rotate"], () => {
|
|
2189
2369
|
this.refreshTextLinks();
|
|
2190
|
-
}), this.layer =
|
|
2191
|
-
}
|
|
2192
|
-
_moveNodes(
|
|
2193
|
-
|
|
2194
|
-
const
|
|
2195
|
-
|
|
2196
|
-
const
|
|
2197
|
-
|
|
2198
|
-
|
|
2370
|
+
}), this.layer = e.layers.addCanvasLayer(this._render), this.layer.moveToBottom();
|
|
2371
|
+
}
|
|
2372
|
+
_moveNodes(e, o, n) {
|
|
2373
|
+
e.forEach((l) => {
|
|
2374
|
+
const h = this.links.getTargetLinks(l.getId(), "node"), f = l.getPosition();
|
|
2375
|
+
h.forEach((g) => {
|
|
2376
|
+
const d = this.getAnnotation(g.arrow), v = g.side, y = Le(
|
|
2377
|
+
d,
|
|
2378
|
+
v === "start" ? "end" : "start"
|
|
2199
2379
|
);
|
|
2200
|
-
let
|
|
2201
|
-
const
|
|
2202
|
-
(
|
|
2380
|
+
let A = f;
|
|
2381
|
+
const _ = +l.getAttribute("radius"), S = 1e-6;
|
|
2382
|
+
(g.connectionPoint.x - (f.x - o) > S || g.connectionPoint.y - (f.y - n) > S) && (A = $e(y, f, _)), Ht(d, v, A.x, A.y);
|
|
2203
2383
|
});
|
|
2204
2384
|
}), this.arrows.refreshLayer();
|
|
2205
2385
|
}
|
|
2206
|
-
_snapToText(
|
|
2207
|
-
const
|
|
2208
|
-
if (this.links.remove(
|
|
2209
|
-
this.textToMagnet =
|
|
2210
|
-
const
|
|
2211
|
-
return
|
|
2212
|
-
}
|
|
2213
|
-
_findAndSnapToNode(
|
|
2214
|
-
var
|
|
2215
|
-
const
|
|
2216
|
-
this.links.remove(
|
|
2217
|
-
}
|
|
2218
|
-
_snapToNode(
|
|
2219
|
-
const
|
|
2220
|
-
if (y <
|
|
2221
|
-
let
|
|
2222
|
-
if (y >
|
|
2223
|
-
const
|
|
2224
|
-
|
|
2225
|
-
}
|
|
2226
|
-
|
|
2386
|
+
_snapToText(e, o, n) {
|
|
2387
|
+
const l = this.texts.detect(n, this.options.detectMargin);
|
|
2388
|
+
if (this.links.remove(e, o), !l) return !1;
|
|
2389
|
+
this.textToMagnet = l;
|
|
2390
|
+
const h = this.findMagnetPoint(Pr, l, n);
|
|
2391
|
+
return h ? (Ht(e, o, h.point.x, h.point.y), this.links.add(e, o, l.id, "text", h.magnet), !0) : !1;
|
|
2392
|
+
}
|
|
2393
|
+
_findAndSnapToNode(e, o, n) {
|
|
2394
|
+
var l, h;
|
|
2395
|
+
const f = this.ogma.view.graphToScreenCoordinates(n), g = this.ogma.view.getElementAt(f);
|
|
2396
|
+
this.links.remove(e, o), g && g.isNode ? ((l = this.hoveredNode) == null || l.setSelected(!1), this.hoveredNode = g, g.setSelected(!0), this._snapToNode(e, o, g, f)) : ((h = this.hoveredNode) == null || h.setSelected(!1), this.hoveredNode = null);
|
|
2397
|
+
}
|
|
2398
|
+
_snapToNode(e, o, n, l) {
|
|
2399
|
+
const h = n.getPositionOnScreen(), f = +n.getAttribute("radius"), g = f * this.ogma.view.getZoom(), d = l.x - h.x, v = l.y - h.y, y = Math.sqrt(d * d + v * v), A = n.getPosition();
|
|
2400
|
+
if (y < g + this.options.detectMargin) {
|
|
2401
|
+
let _ = A;
|
|
2402
|
+
if (y > g / 2) {
|
|
2403
|
+
const S = Le(e, o === "end" ? "start" : "end");
|
|
2404
|
+
_ = $e(S, _, f);
|
|
2405
|
+
}
|
|
2406
|
+
Ht(e, o, _.x, _.y), this.links.add(e, o, n.getId(), "node", _);
|
|
2227
2407
|
}
|
|
2228
2408
|
}
|
|
2229
2409
|
refreshTextLinks() {
|
|
2230
|
-
let
|
|
2410
|
+
let e = !1;
|
|
2231
2411
|
this.links.forEach(
|
|
2232
|
-
({ connectionPoint:
|
|
2233
|
-
if (
|
|
2234
|
-
|
|
2235
|
-
const
|
|
2236
|
-
|
|
2412
|
+
({ connectionPoint: o, targetType: n, target: l, arrow: h, side: f }) => {
|
|
2413
|
+
if (n !== "text") return;
|
|
2414
|
+
e = !0;
|
|
2415
|
+
const g = this.getAnnotation(l), d = this.getAnnotation(h), v = mt(g), y = vt(g), A = Ie(o, { x: v.width, y: v.height }), _ = st(A, this.ogma.view.getAngle()), S = Bt(_, y);
|
|
2416
|
+
Ht(d, f, S.x, S.y);
|
|
2237
2417
|
}
|
|
2238
|
-
),
|
|
2418
|
+
), e && this.arrows.refreshLayer();
|
|
2239
2419
|
}
|
|
2240
2420
|
/**
|
|
2241
2421
|
* @returns the currently selected annotation
|
|
@@ -2243,69 +2423,69 @@ class Pn extends zr {
|
|
|
2243
2423
|
getSelected() {
|
|
2244
2424
|
return this.selected;
|
|
2245
2425
|
}
|
|
2246
|
-
findMagnetPoint(
|
|
2247
|
-
let
|
|
2248
|
-
for (const
|
|
2249
|
-
const
|
|
2426
|
+
findMagnetPoint(e, o, n) {
|
|
2427
|
+
let l;
|
|
2428
|
+
for (const h of e) {
|
|
2429
|
+
const f = mt(o), g = vt(o), d = Ie(h, { x: f.width, y: f.height }), v = st(d, this.ogma.view.getAngle()), y = Bt(v, g), A = qt(Ot(y, n)), _ = Math.min(
|
|
2250
2430
|
this.options.magnetRadius * this.ogma.view.getZoom(),
|
|
2251
2431
|
// when really zoomed in: avoid to snap on too far away magnets
|
|
2252
|
-
|
|
2253
|
-
|
|
2432
|
+
f.width / 2,
|
|
2433
|
+
f.height / 2
|
|
2254
2434
|
);
|
|
2255
|
-
if (
|
|
2256
|
-
|
|
2435
|
+
if (A < Math.max(_, this.options.magnetHandleRadius)) {
|
|
2436
|
+
l = {
|
|
2257
2437
|
point: y,
|
|
2258
|
-
magnet:
|
|
2438
|
+
magnet: h
|
|
2259
2439
|
};
|
|
2260
2440
|
break;
|
|
2261
2441
|
}
|
|
2262
2442
|
}
|
|
2263
|
-
return
|
|
2443
|
+
return l;
|
|
2264
2444
|
}
|
|
2265
2445
|
/**
|
|
2266
2446
|
* Set the options for the controller
|
|
2267
2447
|
* @param options new Options
|
|
2268
2448
|
* @returns the updated options
|
|
2269
2449
|
*/
|
|
2270
|
-
setOptions(
|
|
2450
|
+
setOptions(e = {}) {
|
|
2271
2451
|
return this.options = {
|
|
2272
2452
|
...this.options || {},
|
|
2273
|
-
...
|
|
2453
|
+
...e
|
|
2274
2454
|
}, this.options;
|
|
2275
2455
|
}
|
|
2276
2456
|
/**
|
|
2277
2457
|
* Selects the annotation with the given id
|
|
2278
2458
|
* @param id the id of the annotation to select
|
|
2279
2459
|
*/
|
|
2280
|
-
select(
|
|
2281
|
-
const
|
|
2282
|
-
return
|
|
2460
|
+
select(e) {
|
|
2461
|
+
const o = this.getAnnotations().features.find((n) => n.id === e);
|
|
2462
|
+
return o ? (at(o) ? this.arrows.select(o.id) : yt(o) && this.texts.select(o.id), this) : this;
|
|
2283
2463
|
}
|
|
2284
2464
|
/**
|
|
2285
2465
|
* Unselects the currently selected annotation
|
|
2286
2466
|
*/
|
|
2287
2467
|
unselect() {
|
|
2288
|
-
return this.selected ? (
|
|
2468
|
+
return this.selected ? (at(this.selected) ? this.arrows.unselect() : yt(this.selected) && this.texts.unselect(), this) : this;
|
|
2289
2469
|
}
|
|
2290
2470
|
/**
|
|
2291
2471
|
* Add an annotation to the controller
|
|
2292
2472
|
* @param annotation The annotation to add
|
|
2293
2473
|
*/
|
|
2294
|
-
add(
|
|
2295
|
-
if (
|
|
2296
|
-
const [
|
|
2297
|
-
(
|
|
2474
|
+
add(e) {
|
|
2475
|
+
if (Or(e)) {
|
|
2476
|
+
const [o, n] = e.features.reduce(
|
|
2477
|
+
(l, h) => (at(h) ? l[1].push(h) : yt(h) && l[0].push(h), l),
|
|
2298
2478
|
[[], []]
|
|
2299
2479
|
);
|
|
2300
|
-
return
|
|
2480
|
+
return o.forEach((l) => this.add(l)), n.forEach((l) => this.add(l)), this.arrows.refreshLayer(), this;
|
|
2301
2481
|
}
|
|
2302
|
-
switch (
|
|
2482
|
+
switch (e.properties.type) {
|
|
2303
2483
|
case "text":
|
|
2304
|
-
this.texts.add(
|
|
2484
|
+
this.texts.add(e);
|
|
2305
2485
|
break;
|
|
2306
2486
|
// more to follow
|
|
2307
2487
|
default:
|
|
2308
|
-
this.arrows.add(
|
|
2488
|
+
this.arrows.add(e), this.loadLink(e);
|
|
2309
2489
|
break;
|
|
2310
2490
|
}
|
|
2311
2491
|
return this;
|
|
@@ -2314,28 +2494,28 @@ class Pn extends zr {
|
|
|
2314
2494
|
* Remove an annotation or an array of annotations from the controller
|
|
2315
2495
|
* @param annotation The annotation(s) to remove
|
|
2316
2496
|
*/
|
|
2317
|
-
remove(
|
|
2318
|
-
return
|
|
2319
|
-
(
|
|
2320
|
-
), this) : (
|
|
2321
|
-
}
|
|
2322
|
-
loadLink(
|
|
2323
|
-
if (
|
|
2324
|
-
for (const
|
|
2325
|
-
const
|
|
2326
|
-
if (!
|
|
2327
|
-
const
|
|
2328
|
-
if (
|
|
2329
|
-
this.links.add(
|
|
2330
|
-
else if (
|
|
2331
|
-
const
|
|
2332
|
-
if (!
|
|
2333
|
-
this.links.add(
|
|
2334
|
-
const
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
),
|
|
2338
|
-
|
|
2497
|
+
remove(e) {
|
|
2498
|
+
return Or(e) ? (e.features.forEach(
|
|
2499
|
+
(o) => this.remove(o)
|
|
2500
|
+
), this) : (at(e) ? (this.links.remove(e, "start"), this.links.remove(e, "end"), this.arrows.remove(e.id)) : this.texts.remove(e.id), this);
|
|
2501
|
+
}
|
|
2502
|
+
loadLink(e) {
|
|
2503
|
+
if (e.properties.link)
|
|
2504
|
+
for (const o of Dr) {
|
|
2505
|
+
const n = e.properties.link[o];
|
|
2506
|
+
if (!n) continue;
|
|
2507
|
+
const l = this.getAnnotation(n.id);
|
|
2508
|
+
if (n.type === "text" && l)
|
|
2509
|
+
this.links.add(e, o, n.id, n.type, n.magnet);
|
|
2510
|
+
else if (n.type === "node") {
|
|
2511
|
+
const h = this.ogma.getNode(n.id);
|
|
2512
|
+
if (!h) continue;
|
|
2513
|
+
this.links.add(e, o, n.id, n.type, n.magnet);
|
|
2514
|
+
const f = h.getPosition(), g = h.getAttribute("radius") || 0, d = Le(
|
|
2515
|
+
e,
|
|
2516
|
+
o === "start" ? "end" : "start"
|
|
2517
|
+
), v = $e(d, f, +g);
|
|
2518
|
+
Ht(e, o, v.x, v.y);
|
|
2339
2519
|
}
|
|
2340
2520
|
}
|
|
2341
2521
|
}
|
|
@@ -2345,8 +2525,8 @@ class Pn extends zr {
|
|
|
2345
2525
|
* @param y coord of the first point
|
|
2346
2526
|
* @param arrow The arrow to add
|
|
2347
2527
|
*/
|
|
2348
|
-
startArrow(
|
|
2349
|
-
this.cancelDrawing(), this.arrows.startDrawing(
|
|
2528
|
+
startArrow(e, o, n) {
|
|
2529
|
+
this.cancelDrawing(), this.arrows.startDrawing(e, o, n);
|
|
2350
2530
|
}
|
|
2351
2531
|
/**
|
|
2352
2532
|
* Start adding a text (add it, and give control to the user)
|
|
@@ -2354,57 +2534,56 @@ class Pn extends zr {
|
|
|
2354
2534
|
* @param y coord of the top left point
|
|
2355
2535
|
* @param text The text to add
|
|
2356
2536
|
*/
|
|
2357
|
-
startText(
|
|
2358
|
-
this.cancelDrawing(), this.texts.startDrawing(
|
|
2537
|
+
startText(e, o, n) {
|
|
2538
|
+
this.cancelDrawing(), this.texts.startDrawing(e, o, n);
|
|
2359
2539
|
}
|
|
2360
2540
|
/**
|
|
2361
2541
|
* Cancel drawing on the current frame
|
|
2362
2542
|
*/
|
|
2363
2543
|
cancelDrawing() {
|
|
2364
|
-
this.annotations.forEach((
|
|
2544
|
+
this.annotations.forEach((e) => e.cancelDrawing()), this.emit(bn);
|
|
2365
2545
|
}
|
|
2366
2546
|
/**
|
|
2367
2547
|
* Update the style of the annotation with the given id
|
|
2368
2548
|
* @param id The id of the annotation to update
|
|
2369
2549
|
* @param style The new style
|
|
2370
2550
|
*/
|
|
2371
|
-
updateStyle(
|
|
2372
|
-
const
|
|
2373
|
-
return
|
|
2551
|
+
updateStyle(e, o) {
|
|
2552
|
+
const n = this.getAnnotations().features.find((l) => l.id === e);
|
|
2553
|
+
return n ? (at(n) ? this.arrows.updateStyle(n, o) : yt(n) && this.texts.updateStyle(n, o), this.onUpdate(n), this) : this;
|
|
2374
2554
|
}
|
|
2375
|
-
setScale(
|
|
2376
|
-
const
|
|
2377
|
-
return
|
|
2555
|
+
setScale(e, o, n, l) {
|
|
2556
|
+
const h = this.getAnnotations().features.find((f) => f.id === e);
|
|
2557
|
+
return h ? (at(h) ? this.arrows.scale(h, o, n, l) : yt(h) && this.texts.scale(h, o, n, l), this.onUpdate(h), this) : this;
|
|
2378
2558
|
}
|
|
2379
2559
|
/**
|
|
2380
|
-
*
|
|
2381
2560
|
* @returns the annotations in the controller
|
|
2382
2561
|
*/
|
|
2383
2562
|
getAnnotations() {
|
|
2384
|
-
const
|
|
2563
|
+
const e = {
|
|
2385
2564
|
type: "FeatureCollection",
|
|
2386
2565
|
features: []
|
|
2387
2566
|
};
|
|
2388
|
-
return this.annotations.forEach((
|
|
2389
|
-
|
|
2390
|
-
}),
|
|
2567
|
+
return this.annotations.forEach((o) => {
|
|
2568
|
+
e.features = [...e.features, ...o.getElements()];
|
|
2569
|
+
}), e;
|
|
2391
2570
|
}
|
|
2392
2571
|
/**
|
|
2393
2572
|
* Retrieve the annotation with the given id
|
|
2394
2573
|
* @param id the id of the annotation to get
|
|
2395
2574
|
* @returns The annotation with the given id
|
|
2396
2575
|
*/
|
|
2397
|
-
getAnnotation(
|
|
2398
|
-
return this.getAnnotations().features.find((
|
|
2576
|
+
getAnnotation(e) {
|
|
2577
|
+
return this.getAnnotations().features.find((o) => o.id === e);
|
|
2399
2578
|
}
|
|
2400
2579
|
/**
|
|
2401
2580
|
* Destroy the controller and its elements
|
|
2402
2581
|
*/
|
|
2403
2582
|
destroy() {
|
|
2404
|
-
this.annotations.forEach((
|
|
2583
|
+
this.annotations.forEach((e) => e.destroy()), this.layer.destroy();
|
|
2405
2584
|
}
|
|
2406
2585
|
}
|
|
2407
|
-
const
|
|
2586
|
+
const Lr = [8, 10, 12, 14, 16, 24, 32, 48, 64, 72], $r = "none", Xr = "#333333", Nn = [
|
|
2408
2587
|
"#FFFFFF",
|
|
2409
2588
|
"#F44E3B",
|
|
2410
2589
|
"#FE9200",
|
|
@@ -2417,7 +2596,7 @@ const Cr = [8, 10, 12, 14, 16, 24, 32, 48, 64, 72], Tr = "none", Hr = "#333333",
|
|
|
2417
2596
|
"#333333",
|
|
2418
2597
|
"#808080",
|
|
2419
2598
|
"#cccccc"
|
|
2420
|
-
],
|
|
2599
|
+
], Hn = [
|
|
2421
2600
|
"Roboto",
|
|
2422
2601
|
"Helvetica Neue",
|
|
2423
2602
|
"Helvetica",
|
|
@@ -2429,119 +2608,119 @@ const Cr = [8, 10, 12, 14, 16, 24, 32, 48, 64, 72], Tr = "none", Hr = "#333333",
|
|
|
2429
2608
|
"Consolas",
|
|
2430
2609
|
"Courier New",
|
|
2431
2610
|
"monospace"
|
|
2432
|
-
].sort((
|
|
2611
|
+
].sort((u, e) => u.toLocaleLowerCase().localeCompare(e.toLocaleLowerCase())), Ln = {
|
|
2433
2612
|
head: "arrow",
|
|
2434
|
-
strokeColor:
|
|
2613
|
+
strokeColor: Xr,
|
|
2435
2614
|
strokeWidth: 5
|
|
2436
|
-
},
|
|
2615
|
+
}, $n = 0.25, In = {
|
|
2437
2616
|
font: "Roboto",
|
|
2438
|
-
fontSize:
|
|
2439
|
-
padding:
|
|
2440
|
-
color:
|
|
2441
|
-
strokeType:
|
|
2442
|
-
background:
|
|
2617
|
+
fontSize: Lr[2],
|
|
2618
|
+
padding: Lr[2] * $n,
|
|
2619
|
+
color: Xr,
|
|
2620
|
+
strokeType: $r,
|
|
2621
|
+
background: $r
|
|
2443
2622
|
};
|
|
2444
|
-
function
|
|
2445
|
-
return
|
|
2623
|
+
function jn(u) {
|
|
2624
|
+
return u.reduce((e, o) => e + o, 0) / u.length;
|
|
2446
2625
|
}
|
|
2447
|
-
function
|
|
2448
|
-
return
|
|
2626
|
+
function Bn(u, e = 0, o = 1) {
|
|
2627
|
+
return e + (o - e) * u;
|
|
2449
2628
|
}
|
|
2450
|
-
function
|
|
2451
|
-
return (
|
|
2629
|
+
function qn(u, e = 0, o = 1) {
|
|
2630
|
+
return (u - e) / (o - e);
|
|
2452
2631
|
}
|
|
2453
|
-
function
|
|
2454
|
-
return
|
|
2632
|
+
function Wn() {
|
|
2633
|
+
return jr(null);
|
|
2455
2634
|
}
|
|
2456
|
-
const
|
|
2635
|
+
const Gr = jr(
|
|
2457
2636
|
void 0
|
|
2458
|
-
),
|
|
2459
|
-
switch (
|
|
2637
|
+
), Un = () => Kr(Gr), Fn = (u, e) => {
|
|
2638
|
+
switch (e.type) {
|
|
2460
2639
|
case "add":
|
|
2461
2640
|
return {
|
|
2462
|
-
...
|
|
2463
|
-
features: [...
|
|
2641
|
+
...u,
|
|
2642
|
+
features: [...u.features, e.payload]
|
|
2464
2643
|
};
|
|
2465
2644
|
case "remove":
|
|
2466
2645
|
return {
|
|
2467
|
-
...
|
|
2468
|
-
features:
|
|
2646
|
+
...u,
|
|
2647
|
+
features: u.features.filter((o) => o.id !== e.payload.id)
|
|
2469
2648
|
};
|
|
2470
2649
|
case "update":
|
|
2471
2650
|
return {
|
|
2472
|
-
...
|
|
2473
|
-
features:
|
|
2474
|
-
(
|
|
2651
|
+
...u,
|
|
2652
|
+
features: u.features.map(
|
|
2653
|
+
(o) => o.id === e.payload.id ? e.payload : o
|
|
2475
2654
|
)
|
|
2476
2655
|
};
|
|
2477
2656
|
default:
|
|
2478
|
-
return
|
|
2657
|
+
return u;
|
|
2479
2658
|
}
|
|
2480
|
-
},
|
|
2481
|
-
const
|
|
2659
|
+
}, Yn = ({ children: u }) => {
|
|
2660
|
+
const e = Qr(), [o, n] = Zr(Fn, {
|
|
2482
2661
|
type: "FeatureCollection",
|
|
2483
2662
|
features: []
|
|
2484
|
-
}), [
|
|
2485
|
-
return
|
|
2486
|
-
if (!
|
|
2487
|
-
const
|
|
2663
|
+
}), [l, h] = Nt(null), [f, g] = Nt(Ln), [d, v] = Nt(In), [y, A] = Nt(), [_, S] = Nt(1), [R, C] = Nt(1);
|
|
2664
|
+
return rr(() => {
|
|
2665
|
+
if (!e) return;
|
|
2666
|
+
const L = new Pn(e, {
|
|
2488
2667
|
minArrowHeight: 1
|
|
2489
|
-
}),
|
|
2490
|
-
return
|
|
2491
|
-
...
|
|
2492
|
-
strokeWidth: (
|
|
2493
|
-
}),
|
|
2494
|
-
|
|
2495
|
-
...
|
|
2496
|
-
}) :
|
|
2497
|
-
...
|
|
2498
|
-
}),
|
|
2668
|
+
}), I = jn(e.getNodes().getAttribute("radius")) / 5, k = _;
|
|
2669
|
+
return g({
|
|
2670
|
+
...f,
|
|
2671
|
+
strokeWidth: (f.strokeWidth || 1) * k
|
|
2672
|
+
}), S(k), C(I), L.on("select", (z) => {
|
|
2673
|
+
at(z) ? g({
|
|
2674
|
+
...z.properties.style || {}
|
|
2675
|
+
}) : yt(z) && v({
|
|
2676
|
+
...z.properties.style || {}
|
|
2677
|
+
}), h(z);
|
|
2499
2678
|
}).on("unselect", () => {
|
|
2500
|
-
|
|
2501
|
-
}),
|
|
2679
|
+
h(null);
|
|
2680
|
+
}), A(L), () => {
|
|
2502
2681
|
y == null || y.destroy();
|
|
2503
2682
|
};
|
|
2504
|
-
}, [
|
|
2505
|
-
y &&
|
|
2506
|
-
}, [y,
|
|
2507
|
-
y &&
|
|
2508
|
-
}, [y,
|
|
2509
|
-
|
|
2683
|
+
}, [e]), rr(() => {
|
|
2684
|
+
y && l && (l == null ? void 0 : l.properties.type) === "arrow" && y.updateStyle(l.id, f);
|
|
2685
|
+
}, [y, f, l]), rr(() => {
|
|
2686
|
+
y && l && (l == null ? void 0 : l.properties.type) === "text" && y.updateStyle(l.id, d);
|
|
2687
|
+
}, [y, d, l]), /* @__PURE__ */ nn.jsx(
|
|
2688
|
+
Gr.Provider,
|
|
2510
2689
|
{
|
|
2511
2690
|
value: {
|
|
2512
|
-
annotations:
|
|
2513
|
-
updateAnnotations:
|
|
2514
|
-
currentAnnotation:
|
|
2515
|
-
setCurrentAnnotation:
|
|
2516
|
-
textStyle:
|
|
2517
|
-
setTextStyle:
|
|
2518
|
-
arrowStyle:
|
|
2519
|
-
setArrowStyle:
|
|
2520
|
-
arrowWidthFactor:
|
|
2521
|
-
setArrowWidthFactor:
|
|
2522
|
-
textSizeFactor:
|
|
2523
|
-
setTextSizeFactor:
|
|
2691
|
+
annotations: o,
|
|
2692
|
+
updateAnnotations: n,
|
|
2693
|
+
currentAnnotation: l,
|
|
2694
|
+
setCurrentAnnotation: h,
|
|
2695
|
+
textStyle: d,
|
|
2696
|
+
setTextStyle: v,
|
|
2697
|
+
arrowStyle: f,
|
|
2698
|
+
setArrowStyle: g,
|
|
2699
|
+
arrowWidthFactor: _,
|
|
2700
|
+
setArrowWidthFactor: S,
|
|
2701
|
+
textSizeFactor: R,
|
|
2702
|
+
setTextSizeFactor: C,
|
|
2524
2703
|
editor: y,
|
|
2525
|
-
setEditor:
|
|
2704
|
+
setEditor: A
|
|
2526
2705
|
},
|
|
2527
|
-
children:
|
|
2706
|
+
children: u
|
|
2528
2707
|
}
|
|
2529
2708
|
);
|
|
2530
2709
|
};
|
|
2531
2710
|
export {
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2711
|
+
Gr as AnnotationsContext,
|
|
2712
|
+
Yn as AnnotationsContextProvider,
|
|
2713
|
+
Xr as BLACK,
|
|
2714
|
+
$n as RELATIVE_PADDING,
|
|
2715
|
+
$r as TRANSPARENT,
|
|
2716
|
+
Wn as createAnnotationsContext,
|
|
2717
|
+
Ln as defaultArrowStyle,
|
|
2718
|
+
Nn as defaultColors,
|
|
2719
|
+
In as defaultTextStyle,
|
|
2720
|
+
Lr as fontSizes,
|
|
2721
|
+
Hn as fonts,
|
|
2722
|
+
Bn as interpolate,
|
|
2723
|
+
jn as mean,
|
|
2724
|
+
qn as normalize,
|
|
2725
|
+
Un as useAnnotationsContext
|
|
2547
2726
|
};
|