@linkurious/ogma-annotations-react 1.1.13 → 1.1.15
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 +20 -20
- package/dist/index.mjs +1444 -1865
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useOgma as
|
|
3
|
-
var
|
|
1
|
+
import Cr, { createContext as Or, useContext as qr, useReducer as Yr, useState as Nt, useEffect as er } from "react";
|
|
2
|
+
import { useOgma as Gr } from "@linkurious/ogma-react";
|
|
3
|
+
var or = { exports: {} }, he = {};
|
|
4
4
|
/**
|
|
5
5
|
* @license React
|
|
6
6
|
* react-jsx-runtime.production.min.js
|
|
@@ -10,25 +10,25 @@ var er = { exports: {} }, ae = {};
|
|
|
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
|
|
14
|
-
function
|
|
15
|
-
if (
|
|
16
|
-
return
|
|
17
|
-
|
|
18
|
-
var
|
|
19
|
-
function g
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
for (
|
|
23
|
-
i.call(
|
|
24
|
-
if (
|
|
25
|
-
for (
|
|
26
|
-
|
|
27
|
-
return { $$typeof: e, type:
|
|
28
|
-
}
|
|
29
|
-
return
|
|
13
|
+
var dr;
|
|
14
|
+
function Xr() {
|
|
15
|
+
if (dr)
|
|
16
|
+
return he;
|
|
17
|
+
dr = 1;
|
|
18
|
+
var u = Cr, e = Symbol.for("react.element"), o = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, l = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, c = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
19
|
+
function f(g, d, v) {
|
|
20
|
+
var y, _ = {}, C = null, E = null;
|
|
21
|
+
v !== void 0 && (C = "" + v), d.key !== void 0 && (C = "" + d.key), d.ref !== void 0 && (E = d.ref);
|
|
22
|
+
for (y in d)
|
|
23
|
+
i.call(d, y) && !c.hasOwnProperty(y) && (_[y] = d[y]);
|
|
24
|
+
if (g && g.defaultProps)
|
|
25
|
+
for (y in d = g.defaultProps, d)
|
|
26
|
+
_[y] === void 0 && (_[y] = d[y]);
|
|
27
|
+
return { $$typeof: e, type: g, key: C, ref: E, props: _, _owner: l.current };
|
|
28
|
+
}
|
|
29
|
+
return he.Fragment = o, he.jsx = f, he.jsxs = f, he;
|
|
30
30
|
}
|
|
31
|
-
var
|
|
31
|
+
var ce = {};
|
|
32
32
|
/**
|
|
33
33
|
* @license React
|
|
34
34
|
* react-jsx-runtime.development.js
|
|
@@ -38,91 +38,91 @@ var le = {};
|
|
|
38
38
|
* This source code is licensed under the MIT license found in the
|
|
39
39
|
* LICENSE file in the root directory of this source tree.
|
|
40
40
|
*/
|
|
41
|
-
var
|
|
42
|
-
function
|
|
43
|
-
return
|
|
44
|
-
var
|
|
45
|
-
function
|
|
41
|
+
var fr;
|
|
42
|
+
function Jr() {
|
|
43
|
+
return fr || (fr = 1, process.env.NODE_ENV !== "production" && function() {
|
|
44
|
+
var u = Cr, e = Symbol.for("react.element"), o = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), l = Symbol.for("react.strict_mode"), c = 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"), _ = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), E = Symbol.for("react.offscreen"), P = Symbol.iterator, S = "@@iterator";
|
|
45
|
+
function $(t) {
|
|
46
46
|
if (t === null || typeof t != "object")
|
|
47
47
|
return null;
|
|
48
|
-
var
|
|
49
|
-
return typeof
|
|
48
|
+
var s = P && t[P] || t[S];
|
|
49
|
+
return typeof s == "function" ? s : null;
|
|
50
50
|
}
|
|
51
|
-
var
|
|
52
|
-
function
|
|
51
|
+
var L = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
52
|
+
function T(t) {
|
|
53
53
|
{
|
|
54
|
-
for (var
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
for (var s = arguments.length, h = new Array(s > 1 ? s - 1 : 0), p = 1; p < s; p++)
|
|
55
|
+
h[p - 1] = arguments[p];
|
|
56
|
+
B("error", t, h);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function B(t, s, h) {
|
|
60
60
|
{
|
|
61
|
-
var
|
|
62
|
-
|
|
63
|
-
var w =
|
|
61
|
+
var p = L.ReactDebugCurrentFrame, m = p.getStackAddendum();
|
|
62
|
+
m !== "" && (s += "%s", h = h.concat([m]));
|
|
63
|
+
var w = h.map(function(b) {
|
|
64
64
|
return String(b);
|
|
65
65
|
});
|
|
66
|
-
w.unshift("Warning: " +
|
|
66
|
+
w.unshift("Warning: " + s), Function.prototype.apply.call(console[t], console, w);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
var
|
|
70
|
-
|
|
71
|
-
function
|
|
72
|
-
return !!(typeof t == "string" || typeof t == "function" || t === i || t === c ||
|
|
69
|
+
var N = !1, it = !1, xt = !1, qt = !1, Yt = !1, pe;
|
|
70
|
+
pe = Symbol.for("react.module.reference");
|
|
71
|
+
function Ot(t) {
|
|
72
|
+
return !!(typeof t == "string" || typeof t == "function" || t === i || t === c || Yt || t === l || t === v || t === y || qt || t === E || N || it || xt || typeof t == "object" && t !== null && (t.$$typeof === C || t.$$typeof === _ || t.$$typeof === f || t.$$typeof === g || t.$$typeof === d || // This needs to include all possible module reference object
|
|
73
73
|
// types supported by any Flight configuration anywhere since
|
|
74
74
|
// we don't know which Flight build this will end up being used
|
|
75
75
|
// with.
|
|
76
|
-
t.$$typeof ===
|
|
76
|
+
t.$$typeof === pe || t.getModuleId !== void 0));
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
var
|
|
80
|
-
if (
|
|
81
|
-
return
|
|
82
|
-
var
|
|
83
|
-
return
|
|
78
|
+
function Pt(t, s, h) {
|
|
79
|
+
var p = t.displayName;
|
|
80
|
+
if (p)
|
|
81
|
+
return p;
|
|
82
|
+
var m = s.displayName || s.name || "";
|
|
83
|
+
return m !== "" ? h + "(" + m + ")" : h;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function Gt(t) {
|
|
86
86
|
return t.displayName || "Context";
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function tt(t) {
|
|
89
89
|
if (t == null)
|
|
90
90
|
return null;
|
|
91
|
-
if (typeof t.tag == "number" &&
|
|
91
|
+
if (typeof t.tag == "number" && T("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof t == "function")
|
|
92
92
|
return t.displayName || t.name || null;
|
|
93
93
|
if (typeof t == "string")
|
|
94
94
|
return t;
|
|
95
95
|
switch (t) {
|
|
96
96
|
case i:
|
|
97
97
|
return "Fragment";
|
|
98
|
-
case
|
|
98
|
+
case o:
|
|
99
99
|
return "Portal";
|
|
100
100
|
case c:
|
|
101
101
|
return "Profiler";
|
|
102
|
-
case
|
|
102
|
+
case l:
|
|
103
103
|
return "StrictMode";
|
|
104
|
-
case
|
|
104
|
+
case v:
|
|
105
105
|
return "Suspense";
|
|
106
|
-
case
|
|
106
|
+
case y:
|
|
107
107
|
return "SuspenseList";
|
|
108
108
|
}
|
|
109
109
|
if (typeof t == "object")
|
|
110
110
|
switch (t.$$typeof) {
|
|
111
|
-
case m:
|
|
112
|
-
var o = t;
|
|
113
|
-
return Yt(o) + ".Consumer";
|
|
114
111
|
case g:
|
|
115
|
-
var
|
|
116
|
-
return
|
|
112
|
+
var s = t;
|
|
113
|
+
return Gt(s) + ".Consumer";
|
|
117
114
|
case f:
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
return
|
|
122
|
-
case _:
|
|
123
|
-
var
|
|
115
|
+
var h = t;
|
|
116
|
+
return Gt(h._context) + ".Provider";
|
|
117
|
+
case d:
|
|
118
|
+
return Pt(t, t.render, "ForwardRef");
|
|
119
|
+
case _:
|
|
120
|
+
var p = t.displayName || null;
|
|
121
|
+
return p !== null ? p : tt(t.type) || "Memo";
|
|
122
|
+
case C: {
|
|
123
|
+
var m = t, w = m._payload, b = m._init;
|
|
124
124
|
try {
|
|
125
|
-
return
|
|
125
|
+
return tt(b(w));
|
|
126
126
|
} catch {
|
|
127
127
|
return null;
|
|
128
128
|
}
|
|
@@ -130,18 +130,18 @@ function Ur() {
|
|
|
130
130
|
}
|
|
131
131
|
return null;
|
|
132
132
|
}
|
|
133
|
-
var
|
|
134
|
-
function
|
|
133
|
+
var D = Object.assign, lt = 0, G, ut, Rt, ye, Xt, ve, me;
|
|
134
|
+
function At() {
|
|
135
135
|
}
|
|
136
|
-
|
|
137
|
-
function
|
|
136
|
+
At.__reactDisabledLog = !0;
|
|
137
|
+
function be() {
|
|
138
138
|
{
|
|
139
|
-
if (
|
|
140
|
-
|
|
139
|
+
if (lt === 0) {
|
|
140
|
+
G = console.log, ut = console.info, Rt = console.warn, ye = console.error, Xt = console.group, ve = console.groupCollapsed, me = console.groupEnd;
|
|
141
141
|
var t = {
|
|
142
142
|
configurable: !0,
|
|
143
143
|
enumerable: !0,
|
|
144
|
-
value:
|
|
144
|
+
value: At,
|
|
145
145
|
writable: !0
|
|
146
146
|
};
|
|
147
147
|
Object.defineProperties(console, {
|
|
@@ -154,79 +154,79 @@ function Ur() {
|
|
|
154
154
|
groupEnd: t
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
|
-
|
|
157
|
+
lt++;
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
function
|
|
160
|
+
function Ne() {
|
|
161
161
|
{
|
|
162
|
-
if (
|
|
162
|
+
if (lt--, lt === 0) {
|
|
163
163
|
var t = {
|
|
164
164
|
configurable: !0,
|
|
165
165
|
enumerable: !0,
|
|
166
166
|
writable: !0
|
|
167
167
|
};
|
|
168
168
|
Object.defineProperties(console, {
|
|
169
|
-
log:
|
|
170
|
-
value:
|
|
169
|
+
log: D({}, t, {
|
|
170
|
+
value: G
|
|
171
171
|
}),
|
|
172
|
-
info:
|
|
173
|
-
value:
|
|
172
|
+
info: D({}, t, {
|
|
173
|
+
value: ut
|
|
174
174
|
}),
|
|
175
|
-
warn:
|
|
176
|
-
value:
|
|
175
|
+
warn: D({}, t, {
|
|
176
|
+
value: Rt
|
|
177
177
|
}),
|
|
178
|
-
error:
|
|
179
|
-
value:
|
|
178
|
+
error: D({}, t, {
|
|
179
|
+
value: ye
|
|
180
180
|
}),
|
|
181
|
-
group:
|
|
182
|
-
value:
|
|
181
|
+
group: D({}, t, {
|
|
182
|
+
value: Xt
|
|
183
183
|
}),
|
|
184
|
-
groupCollapsed:
|
|
185
|
-
value:
|
|
184
|
+
groupCollapsed: D({}, t, {
|
|
185
|
+
value: ve
|
|
186
186
|
}),
|
|
187
|
-
groupEnd:
|
|
188
|
-
value:
|
|
187
|
+
groupEnd: D({}, t, {
|
|
188
|
+
value: me
|
|
189
189
|
})
|
|
190
190
|
});
|
|
191
191
|
}
|
|
192
|
-
|
|
192
|
+
lt < 0 && T("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
|
-
var
|
|
196
|
-
function It(t,
|
|
195
|
+
var Jt = L.ReactCurrentDispatcher, Zt;
|
|
196
|
+
function It(t, s, h) {
|
|
197
197
|
{
|
|
198
|
-
if (
|
|
198
|
+
if (Zt === void 0)
|
|
199
199
|
try {
|
|
200
200
|
throw Error();
|
|
201
|
-
} catch (
|
|
202
|
-
var
|
|
203
|
-
|
|
201
|
+
} catch (m) {
|
|
202
|
+
var p = m.stack.trim().match(/\n( *(at )?)/);
|
|
203
|
+
Zt = p && p[1] || "";
|
|
204
204
|
}
|
|
205
205
|
return `
|
|
206
|
-
` +
|
|
206
|
+
` + Zt + t;
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
|
-
var
|
|
209
|
+
var Kt = !1, Et;
|
|
210
210
|
{
|
|
211
|
-
var
|
|
212
|
-
|
|
211
|
+
var Be = typeof WeakMap == "function" ? WeakMap : Map;
|
|
212
|
+
Et = new Be();
|
|
213
213
|
}
|
|
214
|
-
function
|
|
215
|
-
if (!t ||
|
|
214
|
+
function Qt(t, s) {
|
|
215
|
+
if (!t || Kt)
|
|
216
216
|
return "";
|
|
217
217
|
{
|
|
218
|
-
var
|
|
219
|
-
if (
|
|
220
|
-
return
|
|
218
|
+
var h = Et.get(t);
|
|
219
|
+
if (h !== void 0)
|
|
220
|
+
return h;
|
|
221
221
|
}
|
|
222
|
-
var
|
|
223
|
-
|
|
224
|
-
var
|
|
222
|
+
var p;
|
|
223
|
+
Kt = !0;
|
|
224
|
+
var m = Error.prepareStackTrace;
|
|
225
225
|
Error.prepareStackTrace = void 0;
|
|
226
226
|
var w;
|
|
227
|
-
w =
|
|
227
|
+
w = Jt.current, Jt.current = null, be();
|
|
228
228
|
try {
|
|
229
|
-
if (
|
|
229
|
+
if (s) {
|
|
230
230
|
var b = function() {
|
|
231
231
|
throw Error();
|
|
232
232
|
};
|
|
@@ -237,253 +237,253 @@ function Ur() {
|
|
|
237
237
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
238
238
|
try {
|
|
239
239
|
Reflect.construct(b, []);
|
|
240
|
-
} catch (
|
|
241
|
-
|
|
240
|
+
} catch (I) {
|
|
241
|
+
p = I;
|
|
242
242
|
}
|
|
243
243
|
Reflect.construct(t, [], b);
|
|
244
244
|
} else {
|
|
245
245
|
try {
|
|
246
246
|
b.call();
|
|
247
|
-
} catch (
|
|
248
|
-
|
|
247
|
+
} catch (I) {
|
|
248
|
+
p = I;
|
|
249
249
|
}
|
|
250
250
|
t.call(b.prototype);
|
|
251
251
|
}
|
|
252
252
|
} else {
|
|
253
253
|
try {
|
|
254
254
|
throw Error();
|
|
255
|
-
} catch (
|
|
256
|
-
|
|
255
|
+
} catch (I) {
|
|
256
|
+
p = I;
|
|
257
257
|
}
|
|
258
258
|
t();
|
|
259
259
|
}
|
|
260
|
-
} catch (
|
|
261
|
-
if (
|
|
262
|
-
for (var
|
|
263
|
-
`),
|
|
264
|
-
`),
|
|
265
|
-
|
|
266
|
-
for (;
|
|
267
|
-
if (
|
|
268
|
-
if (
|
|
260
|
+
} catch (I) {
|
|
261
|
+
if (I && p && typeof I.stack == "string") {
|
|
262
|
+
for (var A = I.stack.split(`
|
|
263
|
+
`), R = p.stack.split(`
|
|
264
|
+
`), k = A.length - 1, O = R.length - 1; k >= 1 && O >= 0 && A[k] !== R[O]; )
|
|
265
|
+
O--;
|
|
266
|
+
for (; k >= 1 && O >= 0; k--, O--)
|
|
267
|
+
if (A[k] !== R[O]) {
|
|
268
|
+
if (k !== 1 || O !== 1)
|
|
269
269
|
do
|
|
270
|
-
if (
|
|
271
|
-
var
|
|
272
|
-
` +
|
|
273
|
-
return t.displayName &&
|
|
270
|
+
if (k--, O--, O < 0 || A[k] !== R[O]) {
|
|
271
|
+
var j = `
|
|
272
|
+
` + A[k].replace(" at new ", " at ");
|
|
273
|
+
return t.displayName && j.includes("<anonymous>") && (j = j.replace("<anonymous>", t.displayName)), typeof t == "function" && Et.set(t, j), j;
|
|
274
274
|
}
|
|
275
|
-
while (
|
|
275
|
+
while (k >= 1 && O >= 0);
|
|
276
276
|
break;
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
279
|
} finally {
|
|
280
|
-
|
|
280
|
+
Kt = !1, Jt.current = w, Ne(), Error.prepareStackTrace = m;
|
|
281
281
|
}
|
|
282
|
-
var U = t ? t.displayName || t.name : "",
|
|
283
|
-
return typeof t == "function" &&
|
|
282
|
+
var U = t ? t.displayName || t.name : "", M = U ? It(U) : "";
|
|
283
|
+
return typeof t == "function" && Et.set(t, M), M;
|
|
284
284
|
}
|
|
285
|
-
function
|
|
286
|
-
return
|
|
285
|
+
function He(t, s, h) {
|
|
286
|
+
return Qt(t, !1);
|
|
287
287
|
}
|
|
288
|
-
function
|
|
289
|
-
var
|
|
290
|
-
return !!(
|
|
288
|
+
function Ue(t) {
|
|
289
|
+
var s = t.prototype;
|
|
290
|
+
return !!(s && s.isReactComponent);
|
|
291
291
|
}
|
|
292
|
-
function
|
|
292
|
+
function Lt(t, s, h) {
|
|
293
293
|
if (t == null)
|
|
294
294
|
return "";
|
|
295
295
|
if (typeof t == "function")
|
|
296
|
-
return
|
|
296
|
+
return Qt(t, Ue(t));
|
|
297
297
|
if (typeof t == "string")
|
|
298
298
|
return It(t);
|
|
299
299
|
switch (t) {
|
|
300
|
-
case
|
|
300
|
+
case v:
|
|
301
301
|
return It("Suspense");
|
|
302
|
-
case
|
|
302
|
+
case y:
|
|
303
303
|
return It("SuspenseList");
|
|
304
304
|
}
|
|
305
305
|
if (typeof t == "object")
|
|
306
306
|
switch (t.$$typeof) {
|
|
307
|
-
case
|
|
308
|
-
return
|
|
309
|
-
case
|
|
310
|
-
return
|
|
311
|
-
case
|
|
312
|
-
var
|
|
307
|
+
case d:
|
|
308
|
+
return He(t.render);
|
|
309
|
+
case _:
|
|
310
|
+
return Lt(t.type, s, h);
|
|
311
|
+
case C: {
|
|
312
|
+
var p = t, m = p._payload, w = p._init;
|
|
313
313
|
try {
|
|
314
|
-
return
|
|
314
|
+
return Lt(w(m), s, h);
|
|
315
315
|
} catch {
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
319
|
return "";
|
|
320
320
|
}
|
|
321
|
-
var
|
|
322
|
-
function
|
|
321
|
+
var _t = Object.prototype.hasOwnProperty, we = {}, xe = L.ReactDebugCurrentFrame;
|
|
322
|
+
function Ft(t) {
|
|
323
323
|
if (t) {
|
|
324
|
-
var
|
|
325
|
-
|
|
324
|
+
var s = t._owner, h = Lt(t.type, t._source, s ? s.type : null);
|
|
325
|
+
xe.setExtraStackFrame(h);
|
|
326
326
|
} else
|
|
327
|
-
|
|
327
|
+
xe.setExtraStackFrame(null);
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function We(t, s, h, p, m) {
|
|
330
330
|
{
|
|
331
|
-
var w = Function.call.bind(
|
|
331
|
+
var w = Function.call.bind(_t);
|
|
332
332
|
for (var b in t)
|
|
333
333
|
if (w(t, b)) {
|
|
334
|
-
var
|
|
334
|
+
var A = void 0;
|
|
335
335
|
try {
|
|
336
336
|
if (typeof t[b] != "function") {
|
|
337
|
-
var
|
|
338
|
-
throw
|
|
337
|
+
var R = Error((p || "React class") + ": " + h + " 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`.");
|
|
338
|
+
throw R.name = "Invariant Violation", R;
|
|
339
339
|
}
|
|
340
|
-
|
|
341
|
-
} catch (
|
|
342
|
-
|
|
340
|
+
A = t[b](s, b, p, h, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
341
|
+
} catch (k) {
|
|
342
|
+
A = k;
|
|
343
343
|
}
|
|
344
|
-
|
|
344
|
+
A && !(A instanceof Error) && (Ft(m), T("%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", h, b, typeof A), Ft(null)), A instanceof Error && !(A.message in we) && (we[A.message] = !0, Ft(m), T("Failed %s type: %s", h, A.message), Ft(null));
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
|
-
var
|
|
349
|
-
function
|
|
350
|
-
return
|
|
348
|
+
var Ve = Array.isArray;
|
|
349
|
+
function te(t) {
|
|
350
|
+
return Ve(t);
|
|
351
351
|
}
|
|
352
|
-
function
|
|
352
|
+
function H(t) {
|
|
353
353
|
{
|
|
354
|
-
var
|
|
355
|
-
return
|
|
354
|
+
var s = typeof Symbol == "function" && Symbol.toStringTag, h = s && t[Symbol.toStringTag] || t.constructor.name || "Object";
|
|
355
|
+
return h;
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
|
-
function
|
|
358
|
+
function qe(t) {
|
|
359
359
|
try {
|
|
360
|
-
return
|
|
360
|
+
return Ae(t), !1;
|
|
361
361
|
} catch {
|
|
362
362
|
return !0;
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
|
-
function
|
|
365
|
+
function Ae(t) {
|
|
366
366
|
return "" + t;
|
|
367
367
|
}
|
|
368
|
-
function
|
|
369
|
-
if (
|
|
370
|
-
return
|
|
368
|
+
function ee(t) {
|
|
369
|
+
if (qe(t))
|
|
370
|
+
return T("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", H(t)), Ae(t);
|
|
371
371
|
}
|
|
372
|
-
var ot =
|
|
372
|
+
var ot = L.ReactCurrentOwner, Ee = {
|
|
373
373
|
key: !0,
|
|
374
374
|
ref: !0,
|
|
375
375
|
__self: !0,
|
|
376
376
|
__source: !0
|
|
377
|
-
}, $t,
|
|
378
|
-
|
|
379
|
-
function
|
|
380
|
-
if (
|
|
381
|
-
var
|
|
382
|
-
if (
|
|
377
|
+
}, $t, _e, re;
|
|
378
|
+
re = {};
|
|
379
|
+
function ne(t) {
|
|
380
|
+
if (_t.call(t, "ref")) {
|
|
381
|
+
var s = Object.getOwnPropertyDescriptor(t, "ref").get;
|
|
382
|
+
if (s && s.isReactWarning)
|
|
383
383
|
return !1;
|
|
384
384
|
}
|
|
385
385
|
return t.ref !== void 0;
|
|
386
386
|
}
|
|
387
|
-
function
|
|
388
|
-
if (
|
|
389
|
-
var
|
|
390
|
-
if (
|
|
387
|
+
function Ye(t) {
|
|
388
|
+
if (_t.call(t, "key")) {
|
|
389
|
+
var s = Object.getOwnPropertyDescriptor(t, "key").get;
|
|
390
|
+
if (s && s.isReactWarning)
|
|
391
391
|
return !1;
|
|
392
392
|
}
|
|
393
393
|
return t.key !== void 0;
|
|
394
394
|
}
|
|
395
|
-
function
|
|
396
|
-
if (typeof t.ref == "string" && ot.current &&
|
|
397
|
-
var
|
|
398
|
-
|
|
395
|
+
function Ge(t, s) {
|
|
396
|
+
if (typeof t.ref == "string" && ot.current && s && ot.current.stateNode !== s) {
|
|
397
|
+
var h = tt(ot.current.type);
|
|
398
|
+
re[h] || (T('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', tt(ot.current.type), t.ref), re[h] = !0);
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
|
-
function
|
|
401
|
+
function Xe(t, s) {
|
|
402
402
|
{
|
|
403
|
-
var
|
|
404
|
-
$t || ($t = !0,
|
|
403
|
+
var h = function() {
|
|
404
|
+
$t || ($t = !0, T("%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));
|
|
405
405
|
};
|
|
406
|
-
|
|
407
|
-
get:
|
|
406
|
+
h.isReactWarning = !0, Object.defineProperty(t, "key", {
|
|
407
|
+
get: h,
|
|
408
408
|
configurable: !0
|
|
409
409
|
});
|
|
410
410
|
}
|
|
411
411
|
}
|
|
412
|
-
function
|
|
412
|
+
function ie(t, s) {
|
|
413
413
|
{
|
|
414
|
-
var
|
|
415
|
-
|
|
414
|
+
var h = function() {
|
|
415
|
+
_e || (_e = !0, T("%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));
|
|
416
416
|
};
|
|
417
|
-
|
|
418
|
-
get:
|
|
417
|
+
h.isReactWarning = !0, Object.defineProperty(t, "ref", {
|
|
418
|
+
get: h,
|
|
419
419
|
configurable: !0
|
|
420
420
|
});
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
|
-
var
|
|
424
|
-
var
|
|
423
|
+
var ke = function(t, s, h, p, m, w, b) {
|
|
424
|
+
var A = {
|
|
425
425
|
// This tag allows us to uniquely identify this as a React Element
|
|
426
426
|
$$typeof: e,
|
|
427
427
|
// Built-in properties that belong on the element
|
|
428
428
|
type: t,
|
|
429
|
-
key:
|
|
430
|
-
ref:
|
|
429
|
+
key: s,
|
|
430
|
+
ref: h,
|
|
431
431
|
props: b,
|
|
432
432
|
// Record the component responsible for creating this element.
|
|
433
433
|
_owner: w
|
|
434
434
|
};
|
|
435
|
-
return
|
|
435
|
+
return A._store = {}, Object.defineProperty(A._store, "validated", {
|
|
436
436
|
configurable: !1,
|
|
437
437
|
enumerable: !1,
|
|
438
438
|
writable: !0,
|
|
439
439
|
value: !1
|
|
440
|
-
}), Object.defineProperty(
|
|
440
|
+
}), Object.defineProperty(A, "_self", {
|
|
441
441
|
configurable: !1,
|
|
442
442
|
enumerable: !1,
|
|
443
443
|
writable: !1,
|
|
444
|
-
value:
|
|
445
|
-
}), Object.defineProperty(
|
|
444
|
+
value: p
|
|
445
|
+
}), Object.defineProperty(A, "_source", {
|
|
446
446
|
configurable: !1,
|
|
447
447
|
enumerable: !1,
|
|
448
448
|
writable: !1,
|
|
449
|
-
value:
|
|
450
|
-
}), Object.freeze && (Object.freeze(
|
|
449
|
+
value: m
|
|
450
|
+
}), Object.freeze && (Object.freeze(A.props), Object.freeze(A)), A;
|
|
451
451
|
};
|
|
452
|
-
function
|
|
452
|
+
function kt(t, s, h, p, m) {
|
|
453
453
|
{
|
|
454
|
-
var w, b = {},
|
|
455
|
-
|
|
456
|
-
for (w in
|
|
457
|
-
|
|
454
|
+
var w, b = {}, A = null, R = null;
|
|
455
|
+
h !== void 0 && (ee(h), A = "" + h), Ye(s) && (ee(s.key), A = "" + s.key), ne(s) && (R = s.ref, Ge(s, m));
|
|
456
|
+
for (w in s)
|
|
457
|
+
_t.call(s, w) && !Ee.hasOwnProperty(w) && (b[w] = s[w]);
|
|
458
458
|
if (t && t.defaultProps) {
|
|
459
|
-
var
|
|
460
|
-
for (w in
|
|
461
|
-
b[w] === void 0 && (b[w] =
|
|
459
|
+
var k = t.defaultProps;
|
|
460
|
+
for (w in k)
|
|
461
|
+
b[w] === void 0 && (b[w] = k[w]);
|
|
462
462
|
}
|
|
463
|
-
if (
|
|
464
|
-
var
|
|
465
|
-
|
|
463
|
+
if (A || R) {
|
|
464
|
+
var O = typeof t == "function" ? t.displayName || t.name || "Unknown" : t;
|
|
465
|
+
A && Xe(b, O), R && ie(b, O);
|
|
466
466
|
}
|
|
467
|
-
return
|
|
467
|
+
return ke(t, A, R, m, p, ot.current, b);
|
|
468
468
|
}
|
|
469
469
|
}
|
|
470
|
-
var
|
|
471
|
-
function
|
|
470
|
+
var oe = L.ReactCurrentOwner, Te = L.ReactDebugCurrentFrame;
|
|
471
|
+
function ht(t) {
|
|
472
472
|
if (t) {
|
|
473
|
-
var
|
|
474
|
-
|
|
473
|
+
var s = t._owner, h = Lt(t.type, t._source, s ? s.type : null);
|
|
474
|
+
Te.setExtraStackFrame(h);
|
|
475
475
|
} else
|
|
476
|
-
|
|
476
|
+
Te.setExtraStackFrame(null);
|
|
477
477
|
}
|
|
478
|
-
var
|
|
479
|
-
|
|
480
|
-
function
|
|
478
|
+
var X;
|
|
479
|
+
X = !1;
|
|
480
|
+
function dt(t) {
|
|
481
481
|
return typeof t == "object" && t !== null && t.$$typeof === e;
|
|
482
482
|
}
|
|
483
|
-
function
|
|
483
|
+
function jt() {
|
|
484
484
|
{
|
|
485
|
-
if (
|
|
486
|
-
var t =
|
|
485
|
+
if (oe.current) {
|
|
486
|
+
var t = tt(oe.current.type);
|
|
487
487
|
if (t)
|
|
488
488
|
return `
|
|
489
489
|
|
|
@@ -492,638 +492,155 @@ Check the render method of \`` + t + "`.";
|
|
|
492
492
|
return "";
|
|
493
493
|
}
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function Je(t) {
|
|
496
496
|
{
|
|
497
497
|
if (t !== void 0) {
|
|
498
|
-
var
|
|
498
|
+
var s = t.fileName.replace(/^.*[\\\/]/, ""), h = t.lineNumber;
|
|
499
499
|
return `
|
|
500
500
|
|
|
501
|
-
Check your code at ` +
|
|
501
|
+
Check your code at ` + s + ":" + h + ".";
|
|
502
502
|
}
|
|
503
503
|
return "";
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
|
-
var
|
|
507
|
-
function
|
|
506
|
+
var se = {};
|
|
507
|
+
function Se(t) {
|
|
508
508
|
{
|
|
509
|
-
var
|
|
510
|
-
if (!
|
|
511
|
-
var
|
|
512
|
-
|
|
509
|
+
var s = jt();
|
|
510
|
+
if (!s) {
|
|
511
|
+
var h = typeof t == "string" ? t : t.displayName || t.name;
|
|
512
|
+
h && (s = `
|
|
513
513
|
|
|
514
|
-
Check the top-level render call using <` +
|
|
514
|
+
Check the top-level render call using <` + h + ">.");
|
|
515
515
|
}
|
|
516
|
-
return
|
|
516
|
+
return s;
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
|
-
function
|
|
519
|
+
function Ce(t, s) {
|
|
520
520
|
{
|
|
521
521
|
if (!t._store || t._store.validated || t.key != null)
|
|
522
522
|
return;
|
|
523
523
|
t._store.validated = !0;
|
|
524
|
-
var
|
|
525
|
-
if (
|
|
524
|
+
var h = Se(s);
|
|
525
|
+
if (se[h])
|
|
526
526
|
return;
|
|
527
|
-
|
|
528
|
-
var
|
|
529
|
-
t && t._owner && t._owner !==
|
|
527
|
+
se[h] = !0;
|
|
528
|
+
var p = "";
|
|
529
|
+
t && t._owner && t._owner !== oe.current && (p = " It was passed a child from " + tt(t._owner.type) + "."), ht(t), T('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', h, p), ht(null);
|
|
530
530
|
}
|
|
531
531
|
}
|
|
532
|
-
function Dt(t,
|
|
532
|
+
function Dt(t, s) {
|
|
533
533
|
{
|
|
534
534
|
if (typeof t != "object")
|
|
535
535
|
return;
|
|
536
|
-
if (
|
|
537
|
-
for (var
|
|
538
|
-
var
|
|
539
|
-
|
|
536
|
+
if (te(t))
|
|
537
|
+
for (var h = 0; h < t.length; h++) {
|
|
538
|
+
var p = t[h];
|
|
539
|
+
dt(p) && Ce(p, s);
|
|
540
540
|
}
|
|
541
|
-
else if (
|
|
541
|
+
else if (dt(t))
|
|
542
542
|
t._store && (t._store.validated = !0);
|
|
543
543
|
else if (t) {
|
|
544
|
-
var
|
|
545
|
-
if (typeof
|
|
546
|
-
for (var w =
|
|
547
|
-
|
|
544
|
+
var m = $(t);
|
|
545
|
+
if (typeof m == "function" && m !== t.entries)
|
|
546
|
+
for (var w = m.call(t), b; !(b = w.next()).done; )
|
|
547
|
+
dt(b.value) && Ce(b.value, s);
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
550
|
}
|
|
551
|
-
function
|
|
551
|
+
function Ze(t) {
|
|
552
552
|
{
|
|
553
|
-
var
|
|
554
|
-
if (
|
|
553
|
+
var s = t.type;
|
|
554
|
+
if (s == null || typeof s == "string")
|
|
555
555
|
return;
|
|
556
|
-
var
|
|
557
|
-
if (typeof
|
|
558
|
-
|
|
559
|
-
else if (typeof
|
|
556
|
+
var h;
|
|
557
|
+
if (typeof s == "function")
|
|
558
|
+
h = s.propTypes;
|
|
559
|
+
else if (typeof s == "object" && (s.$$typeof === d || // Note: Memo only checks outer props here.
|
|
560
560
|
// Inner props are checked in the reconciler.
|
|
561
|
-
|
|
562
|
-
|
|
561
|
+
s.$$typeof === _))
|
|
562
|
+
h = s.propTypes;
|
|
563
563
|
else
|
|
564
564
|
return;
|
|
565
|
-
if (
|
|
566
|
-
var
|
|
567
|
-
|
|
568
|
-
} else if (
|
|
569
|
-
|
|
570
|
-
var
|
|
571
|
-
|
|
565
|
+
if (h) {
|
|
566
|
+
var p = tt(s);
|
|
567
|
+
We(h, t.props, "prop", p, t);
|
|
568
|
+
} else if (s.PropTypes !== void 0 && !X) {
|
|
569
|
+
X = !0;
|
|
570
|
+
var m = tt(s);
|
|
571
|
+
T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", m || "Unknown");
|
|
572
572
|
}
|
|
573
|
-
typeof
|
|
573
|
+
typeof s.getDefaultProps == "function" && !s.getDefaultProps.isReactClassApproved && T("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
|
-
function
|
|
576
|
+
function Oe(t) {
|
|
577
577
|
{
|
|
578
|
-
for (var
|
|
579
|
-
var
|
|
580
|
-
if (
|
|
581
|
-
|
|
578
|
+
for (var s = Object.keys(t.props), h = 0; h < s.length; h++) {
|
|
579
|
+
var p = s[h];
|
|
580
|
+
if (p !== "children" && p !== "key") {
|
|
581
|
+
ht(t), T("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", p), ht(null);
|
|
582
582
|
break;
|
|
583
583
|
}
|
|
584
584
|
}
|
|
585
|
-
t.ref !== null && (
|
|
585
|
+
t.ref !== null && (ht(t), T("Invalid attribute `ref` supplied to `React.Fragment`."), ht(null));
|
|
586
586
|
}
|
|
587
587
|
}
|
|
588
|
-
function
|
|
588
|
+
function ae(t, s, h, p, m, w) {
|
|
589
589
|
{
|
|
590
|
-
var b =
|
|
590
|
+
var b = Ot(t);
|
|
591
591
|
if (!b) {
|
|
592
|
-
var
|
|
593
|
-
(t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (
|
|
594
|
-
var
|
|
595
|
-
|
|
596
|
-
var
|
|
597
|
-
t === null ?
|
|
592
|
+
var A = "";
|
|
593
|
+
(t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (A += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
594
|
+
var R = Je(m);
|
|
595
|
+
R ? A += R : A += jt();
|
|
596
|
+
var k;
|
|
597
|
+
t === null ? k = "null" : te(t) ? k = "array" : t !== void 0 && t.$$typeof === e ? (k = "<" + (tt(t.type) || "Unknown") + " />", A = " Did you accidentally export a JSX literal instead of a component?") : k = typeof t, T("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", k, A);
|
|
598
598
|
}
|
|
599
|
-
var
|
|
600
|
-
if (
|
|
601
|
-
return
|
|
599
|
+
var O = kt(t, s, h, m, w);
|
|
600
|
+
if (O == null)
|
|
601
|
+
return O;
|
|
602
602
|
if (b) {
|
|
603
|
-
var
|
|
604
|
-
if (
|
|
605
|
-
if (
|
|
606
|
-
if (
|
|
607
|
-
for (var U = 0; U <
|
|
608
|
-
Dt(
|
|
609
|
-
Object.freeze && Object.freeze(
|
|
603
|
+
var j = s.children;
|
|
604
|
+
if (j !== void 0)
|
|
605
|
+
if (p)
|
|
606
|
+
if (te(j)) {
|
|
607
|
+
for (var U = 0; U < j.length; U++)
|
|
608
|
+
Dt(j[U], t);
|
|
609
|
+
Object.freeze && Object.freeze(j);
|
|
610
610
|
} else
|
|
611
|
-
|
|
611
|
+
T("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
612
612
|
else
|
|
613
|
-
Dt(
|
|
613
|
+
Dt(j, t);
|
|
614
614
|
}
|
|
615
|
-
return t === i ?
|
|
615
|
+
return t === i ? Oe(O) : Ze(O), O;
|
|
616
616
|
}
|
|
617
617
|
}
|
|
618
|
-
function
|
|
619
|
-
return
|
|
618
|
+
function Ke(t, s, h) {
|
|
619
|
+
return ae(t, s, h, !0);
|
|
620
620
|
}
|
|
621
|
-
function r(t,
|
|
622
|
-
return
|
|
621
|
+
function r(t, s, h) {
|
|
622
|
+
return ae(t, s, h, !1);
|
|
623
623
|
}
|
|
624
|
-
var n = r,
|
|
625
|
-
|
|
626
|
-
}()),
|
|
627
|
-
}
|
|
628
|
-
process.env.NODE_ENV === "production" ? er.exports = Br() : er.exports = Ur();
|
|
629
|
-
var Wr = er.exports, Yr = Object.defineProperty, Vr = (p, e, a) => e in p ? Yr(p, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : p[e] = a, x = (p, e, a) => (Vr(p, typeof e != "symbol" ? e + "" : e, a), a), qr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
630
|
-
function lr(p) {
|
|
631
|
-
return p && p.__esModule && Object.prototype.hasOwnProperty.call(p, "default") ? p.default : p;
|
|
624
|
+
var n = r, a = Ke;
|
|
625
|
+
ce.Fragment = i, ce.jsx = n, ce.jsxs = a;
|
|
626
|
+
}()), ce;
|
|
632
627
|
}
|
|
633
|
-
|
|
634
|
-
(
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
})("Vector", function() {
|
|
638
|
-
var e = function() {
|
|
639
|
-
var a = Math.PI * 2, i = 180 / Math.PI, h = Math.PI / 180;
|
|
640
|
-
function c(s) {
|
|
641
|
-
return Math.round(s * 1e8) / 1e8;
|
|
642
|
-
}
|
|
643
|
-
function g(s, d) {
|
|
644
|
-
var A = d.x - s.x, _ = d.y - s.y;
|
|
645
|
-
return Math.sqrt(A * A + _ * _);
|
|
646
|
-
}
|
|
647
|
-
function m(s, d, A) {
|
|
648
|
-
var _ = d.y - s.y, R = d.x - s.x, P = Math.atan2(_, R);
|
|
649
|
-
if (A)
|
|
650
|
-
for (; P < 0; )
|
|
651
|
-
P += a;
|
|
652
|
-
return P;
|
|
653
|
-
}
|
|
654
|
-
function f(s, d) {
|
|
655
|
-
this.x = s !== void 0 ? s : 0, this.y = d !== void 0 ? d : 0;
|
|
656
|
-
}
|
|
657
|
-
return f.fromRadians = function(s) {
|
|
658
|
-
var d = Math.cos(s), A = Math.sin(s);
|
|
659
|
-
return new f(d, A);
|
|
660
|
-
}, f.fromDegrees = function(s) {
|
|
661
|
-
var d = s * (Math.PI / 180);
|
|
662
|
-
return f.fromRadians(d);
|
|
663
|
-
}, f.fromString = function(s) {
|
|
664
|
-
var d = s.split(",");
|
|
665
|
-
return new f(parseFloat(d[0]), parseFloat(d[1]));
|
|
666
|
-
}, f.fromArray = function(s) {
|
|
667
|
-
return new f(s[0], s[1]);
|
|
668
|
-
}, f.prototype = {
|
|
669
|
-
// version
|
|
670
|
-
version: "2.0.1",
|
|
671
|
-
// [API]
|
|
672
|
-
// [chainable, clone]
|
|
673
|
-
// clone the vector and return the cloned instance.
|
|
674
|
-
// @return cloned vector.
|
|
675
|
-
clone: function() {
|
|
676
|
-
return new f(this.x, this.y);
|
|
677
|
-
},
|
|
678
|
-
// [API]
|
|
679
|
-
// []
|
|
680
|
-
// Get if equal to another vector
|
|
681
|
-
// @param vector - other vector to compare with.
|
|
682
|
-
// @return if vectors are equal.
|
|
683
|
-
equals: function(s) {
|
|
684
|
-
return this.prototype === s.prototype && this.x === s.x && this.y === s.y;
|
|
685
|
-
},
|
|
686
|
-
// [API]
|
|
687
|
-
// [chainable, changeSelf]
|
|
688
|
-
// set values from another vector. this changes value of self.
|
|
689
|
-
// @param vector - other vector to get values from.
|
|
690
|
-
// @return self.
|
|
691
|
-
copy: function(s) {
|
|
692
|
-
return this.x = s.x, this.y = s.y, this;
|
|
693
|
-
},
|
|
694
|
-
// [API]
|
|
695
|
-
// [chainable, changeSelf]
|
|
696
|
-
// set only the x component from another vector.
|
|
697
|
-
// @return self.
|
|
698
|
-
copyX: function(s) {
|
|
699
|
-
return this.x = s.x, this;
|
|
700
|
-
},
|
|
701
|
-
// [API]
|
|
702
|
-
// [chainable, changeSelf]
|
|
703
|
-
// set only the y component from another vector.
|
|
704
|
-
// @return self.
|
|
705
|
-
copyY: function(s) {
|
|
706
|
-
return this.y = s.y, this;
|
|
707
|
-
},
|
|
708
|
-
// [API]
|
|
709
|
-
// []
|
|
710
|
-
// convert to a dictionary with {x, y}.
|
|
711
|
-
// @return a dictionary representation of the vector.
|
|
712
|
-
toDict: function() {
|
|
713
|
-
return { x: this.x, y: this.y };
|
|
714
|
-
},
|
|
715
|
-
// [API]
|
|
716
|
-
// []
|
|
717
|
-
// convert to array with [x, y].
|
|
718
|
-
// @return an array representation of the vector.
|
|
719
|
-
toArray: function() {
|
|
720
|
-
return [this.x, this.y];
|
|
721
|
-
},
|
|
722
|
-
// [API]
|
|
723
|
-
// [chainable, changeSelf]
|
|
724
|
-
// set values from x, y.
|
|
725
|
-
// @param x - optional x component to set.
|
|
726
|
-
// @param y - optional y component to set.
|
|
727
|
-
// @return self.
|
|
728
|
-
set: function(s, d) {
|
|
729
|
-
return s !== void 0 && (this.x = s), d !== void 0 && (this.y = d), this;
|
|
730
|
-
},
|
|
731
|
-
// [API]
|
|
732
|
-
// [chainable, clone]
|
|
733
|
-
// clone and flip between x and y values.
|
|
734
|
-
// @return cloned vector with flipped x and y components.
|
|
735
|
-
flipXY: function() {
|
|
736
|
-
return new f(this.y, this.x);
|
|
737
|
-
},
|
|
738
|
-
// [API]
|
|
739
|
-
// [chainable, changeSelf]
|
|
740
|
-
// flip between x and y values.
|
|
741
|
-
// @return self.
|
|
742
|
-
flipXYSelf: function() {
|
|
743
|
-
return this.y = [this.x, this.x = this.y][0], this;
|
|
744
|
-
},
|
|
745
|
-
// [API]
|
|
746
|
-
// [chainable, clone]
|
|
747
|
-
// clone and invert x and y values (like multiply with -1, eg x, y => -x, -y)
|
|
748
|
-
// @return cloned vector with inverted values.
|
|
749
|
-
invert: function() {
|
|
750
|
-
return this.mulScalar(-1);
|
|
751
|
-
},
|
|
752
|
-
// [API]
|
|
753
|
-
// [chainable, changeSelf]
|
|
754
|
-
// invert x and y values (like multiply with -1, eg x, y => -x, -y)
|
|
755
|
-
// @return self.
|
|
756
|
-
invertSelf: function() {
|
|
757
|
-
return this.mulScalarSelf(-1), this;
|
|
758
|
-
},
|
|
759
|
-
// [API]
|
|
760
|
-
// []
|
|
761
|
-
// get the distance from another vector.
|
|
762
|
-
// @param other - vector to get distance from.
|
|
763
|
-
// @return distance between vectors.
|
|
764
|
-
distanceFrom: function(s) {
|
|
765
|
-
return g(this, s);
|
|
766
|
-
},
|
|
767
|
-
// [API]
|
|
768
|
-
// []
|
|
769
|
-
// get angle from another vector in radians.
|
|
770
|
-
// @return angle in radians from this to other.
|
|
771
|
-
radiansTo: function(s) {
|
|
772
|
-
return m(this, s, !0);
|
|
773
|
-
},
|
|
774
|
-
// [API]
|
|
775
|
-
// []
|
|
776
|
-
// get degrees from another vector in degrees.
|
|
777
|
-
// @return angle in degrees from this to other.
|
|
778
|
-
degreesTo: function(s) {
|
|
779
|
-
return m(this, s, !0) * i;
|
|
780
|
-
},
|
|
781
|
-
// [API]
|
|
782
|
-
// []
|
|
783
|
-
// convert this vector to a radian angle.
|
|
784
|
-
// this is equivalent to doing Vector.zero.radiansTo(this).
|
|
785
|
-
// @return angle in radians.
|
|
786
|
-
toRadians: function(s) {
|
|
787
|
-
return m(f.zero, this, !0);
|
|
788
|
-
},
|
|
789
|
-
// [API]
|
|
790
|
-
// []
|
|
791
|
-
// convert this vector to degree.
|
|
792
|
-
// this is equivalent to doing Vector.zero.degreeTo(this).
|
|
793
|
-
// @return angle in degrees (0-360).
|
|
794
|
-
toDegrees: function(s) {
|
|
795
|
-
return this.toRadians() * i;
|
|
796
|
-
},
|
|
797
|
-
// [API]
|
|
798
|
-
// [chainable, changeSelf]
|
|
799
|
-
// rotate this vector by a given degree.
|
|
800
|
-
// @param degrees - degrees to rotate this vector by (can be positive or negative).
|
|
801
|
-
// @return self.
|
|
802
|
-
rotateDegreesSelf: function(s) {
|
|
803
|
-
return this.rotateRadiansSelf(s * h);
|
|
804
|
-
},
|
|
805
|
-
// [API]
|
|
806
|
-
// [chainable]
|
|
807
|
-
// clone and rotate the vector by a given degree.
|
|
808
|
-
// @param degrees - degree to rotate this vector by (can be positive or negative).
|
|
809
|
-
// @return cloned rotated vector.
|
|
810
|
-
rotateDegrees: function(s) {
|
|
811
|
-
return this.clone().rotateDegreesSelf(s);
|
|
812
|
-
},
|
|
813
|
-
// [API]
|
|
814
|
-
// [chainable, changeSelf]
|
|
815
|
-
// rotate this vector by a given radian.
|
|
816
|
-
// @param radians - radians to rotate this vector by (can be positive or negative).
|
|
817
|
-
// @return self.
|
|
818
|
-
rotateRadiansSelf: function(s) {
|
|
819
|
-
var d = Math.cos(s), A = Math.sin(s), _ = this.x * d - this.y * A, R = this.x * A + this.y * d;
|
|
820
|
-
return this.x = c(_), this.y = c(R), this;
|
|
821
|
-
},
|
|
822
|
-
// [API]
|
|
823
|
-
// [chainable]
|
|
824
|
-
// clone and rotate the vector by a given degree.
|
|
825
|
-
// @param radians - radians to rotate this vector by (can be positive or negative).
|
|
826
|
-
// @return cloned rotated vector.
|
|
827
|
-
rotateRadians: function(s) {
|
|
828
|
-
return this.clone().rotateRadiansSelf(s);
|
|
829
|
-
},
|
|
830
|
-
// [API]
|
|
831
|
-
// []
|
|
832
|
-
// calculate the length of this vector (aka magnitude).
|
|
833
|
-
// @return vector length.
|
|
834
|
-
length: function() {
|
|
835
|
-
return Math.sqrt(this.x * this.x + this.y * this.y);
|
|
836
|
-
},
|
|
837
|
-
// [API]
|
|
838
|
-
// [chainable, changeSelf]
|
|
839
|
-
// normalize this vector, eg make length equal 1.
|
|
840
|
-
// @return self.
|
|
841
|
-
normalizeSelf: function() {
|
|
842
|
-
var s = Math.sqrt(this.x * this.x + this.y * this.y);
|
|
843
|
-
return s === 0 ? this : (this.x /= s, this.y /= s, this);
|
|
844
|
-
},
|
|
845
|
-
// [API]
|
|
846
|
-
// [chainable, clone]
|
|
847
|
-
// clone and normalize the vector.
|
|
848
|
-
// @return normalized vector.
|
|
849
|
-
normalize: function() {
|
|
850
|
-
return this.clone().normalizeSelf();
|
|
851
|
-
},
|
|
852
|
-
// [API]
|
|
853
|
-
// [chainable, changeSelf]
|
|
854
|
-
// add other vector to self.
|
|
855
|
-
// for example, v(10, 11) + v(5, 6) = v(15, 17).
|
|
856
|
-
// @param other - vector to add components to self.
|
|
857
|
-
// @return self.
|
|
858
|
-
addSelf: function(s) {
|
|
859
|
-
return typeof s == "number" ? this.addScalarSelf(s) : (this.x += s.x, this.y += s.y, this);
|
|
860
|
-
},
|
|
861
|
-
// [API]
|
|
862
|
-
// [chainable, changeSelf]
|
|
863
|
-
// subtract other vector from self.
|
|
864
|
-
// for example, v(10, 10) - v(2, 3) = v(8, 7).
|
|
865
|
-
// @param other - vector to subtract components from self.
|
|
866
|
-
// @return self.
|
|
867
|
-
subSelf: function(s) {
|
|
868
|
-
return typeof s == "number" ? this.subScalarSelf(s) : (this.x -= s.x, this.y -= s.y, this);
|
|
869
|
-
},
|
|
870
|
-
// [API]
|
|
871
|
-
// [chainable, changeSelf]
|
|
872
|
-
// divide self by other vector.
|
|
873
|
-
// for example, v(10, 20) / v(2, 5) = v(5, 4).
|
|
874
|
-
// @param other - vector to divide components from self.
|
|
875
|
-
// @return self.
|
|
876
|
-
divSelf: function(s) {
|
|
877
|
-
return typeof s == "number" ? this.divScalarSelf(s) : (this.x /= s.x, this.y /= s.y, this);
|
|
878
|
-
},
|
|
879
|
-
// [API]
|
|
880
|
-
// [chainable, changeSelf]
|
|
881
|
-
// multiply self vector by other vector.
|
|
882
|
-
// for example, v(2, 3) * v(3, 4) = v(6, 12).
|
|
883
|
-
// @param other - vector to multiply components with self.
|
|
884
|
-
// @return self.
|
|
885
|
-
mulSelf: function(s) {
|
|
886
|
-
return typeof s == "number" ? this.mulScalarSelf(s) : (this.x *= s.x, this.y *= s.y, this);
|
|
887
|
-
},
|
|
888
|
-
// [API]
|
|
889
|
-
// [chainable, changeSelf]
|
|
890
|
-
// add scalar value to self.
|
|
891
|
-
// for example, v(2, 3) + 5 = v(7, 8).
|
|
892
|
-
// @param val - value to add to components.
|
|
893
|
-
// @return self.
|
|
894
|
-
addScalarSelf: function(s) {
|
|
895
|
-
return this.x += s, this.y += s, this;
|
|
896
|
-
},
|
|
897
|
-
// [API]
|
|
898
|
-
// [chainable, changeSelf]
|
|
899
|
-
// subtract scalar from self.
|
|
900
|
-
// for example, v(7, 9) - 5 = v(3, 4).
|
|
901
|
-
// @param val - value to subtract from components.
|
|
902
|
-
// @return self.
|
|
903
|
-
subScalarSelf: function(s) {
|
|
904
|
-
return this.x -= s, this.y -= s, this;
|
|
905
|
-
},
|
|
906
|
-
// [API]
|
|
907
|
-
// [chainable, changeSelf]
|
|
908
|
-
// divide self by scalar.
|
|
909
|
-
// for example, v(6, 8) / 5 = v(3, 4).
|
|
910
|
-
// @param val - value to divide components by.
|
|
911
|
-
// @return self.
|
|
912
|
-
divScalarSelf: function(s) {
|
|
913
|
-
return this.x /= s, this.y /= s, this;
|
|
914
|
-
},
|
|
915
|
-
// [API]
|
|
916
|
-
// [chainable, changeSelf]
|
|
917
|
-
// multiply self by scalar.
|
|
918
|
-
// for example, v(2, 3) * 2 = v(4, 6).
|
|
919
|
-
// @param val - value to multiply components with.
|
|
920
|
-
// @return self.
|
|
921
|
-
mulScalarSelf: function(s) {
|
|
922
|
-
return this.x *= s, this.y *= s, this;
|
|
923
|
-
},
|
|
924
|
-
// [API]
|
|
925
|
-
// [chainable, clone]
|
|
926
|
-
// clone self and add other vector to it.
|
|
927
|
-
// @param other - vector to add with.
|
|
928
|
-
// @return cloned vector.
|
|
929
|
-
add: function(s) {
|
|
930
|
-
return this.clone().addSelf(s);
|
|
931
|
-
},
|
|
932
|
-
// [API]
|
|
933
|
-
// [chainable, clone]
|
|
934
|
-
// clone self and subtract other vector from it.
|
|
935
|
-
// @param other - vector to subtract with.
|
|
936
|
-
// @return cloned vector.
|
|
937
|
-
sub: function(s) {
|
|
938
|
-
return this.clone().subSelf(s);
|
|
939
|
-
},
|
|
940
|
-
// [API]
|
|
941
|
-
// [chainable, clone]
|
|
942
|
-
// clone self and multiply by other vector.
|
|
943
|
-
// @param other - vector to multiply with.
|
|
944
|
-
// @return cloned vector.
|
|
945
|
-
mul: function(s) {
|
|
946
|
-
return this.clone().mulSelf(s);
|
|
947
|
-
},
|
|
948
|
-
// [API]
|
|
949
|
-
// [chainable, clone]
|
|
950
|
-
// clone self and divide by other vector.
|
|
951
|
-
// @param other - vector to divide with.
|
|
952
|
-
// @param scalar - value to divide by.
|
|
953
|
-
// @return cloned vector.
|
|
954
|
-
div: function(s) {
|
|
955
|
-
return this.clone().divSelf(s);
|
|
956
|
-
},
|
|
957
|
-
// [API]
|
|
958
|
-
// [chainable, clone]
|
|
959
|
-
// clone self and add scalar to it.
|
|
960
|
-
// @param scalar - value to add.
|
|
961
|
-
// @return cloned vector.
|
|
962
|
-
addScalar: function(s) {
|
|
963
|
-
return this.clone().addScalarSelf(s);
|
|
964
|
-
},
|
|
965
|
-
// [API]
|
|
966
|
-
// [chainable, clone]
|
|
967
|
-
// clone self and substract scalar from it.
|
|
968
|
-
// @param scalar - value to subtract.
|
|
969
|
-
// @return cloned vector.
|
|
970
|
-
subScalar: function(s) {
|
|
971
|
-
return this.clone().subScalarSelf(s);
|
|
972
|
-
},
|
|
973
|
-
// [API]
|
|
974
|
-
// [chainable, clone]
|
|
975
|
-
// clone self and multiply by scalar.
|
|
976
|
-
// @param scalar - value to multiply with.
|
|
977
|
-
// @return cloned vector.
|
|
978
|
-
mulScalar: function(s) {
|
|
979
|
-
return this.clone().mulScalarSelf(s);
|
|
980
|
-
},
|
|
981
|
-
// [API]
|
|
982
|
-
// [chainable, clone]
|
|
983
|
-
// clone self and divide by scalar.
|
|
984
|
-
// @param scalar - value to divide by.
|
|
985
|
-
// @return cloned vector.
|
|
986
|
-
divScalar: function(s) {
|
|
987
|
-
return this.clone().divScalarSelf(s);
|
|
988
|
-
},
|
|
989
|
-
// [API]
|
|
990
|
-
// [chainable, changeSelf]
|
|
991
|
-
// clamp vector values into range.
|
|
992
|
-
// note: this function does not validate that min < max.
|
|
993
|
-
// @param min - min value for x, y components.
|
|
994
|
-
// @param max - max value for x, y components.
|
|
995
|
-
// @return self.
|
|
996
|
-
clampSelf: function(s, d) {
|
|
997
|
-
return this.x < s.x && (this.x = s.x), this.y < s.y && (this.y = s.y), this.x > d.x && (this.x = d.x), this.y > d.y && (this.y = d.y), this;
|
|
998
|
-
},
|
|
999
|
-
// [API]
|
|
1000
|
-
// [chainable, clone]
|
|
1001
|
-
// clone vector and clamp its values.
|
|
1002
|
-
// note: this function does not validate that min < max.
|
|
1003
|
-
// @param min - min value for x, y components.
|
|
1004
|
-
// @param max - max value for x, y components.
|
|
1005
|
-
// @return cloned vector in range.
|
|
1006
|
-
clamp: function(s, d) {
|
|
1007
|
-
return this.clone().clampSelf(s, d);
|
|
1008
|
-
},
|
|
1009
|
-
// [API]
|
|
1010
|
-
// [chainable, changeSelf]
|
|
1011
|
-
// apply a function on x and y components of the vector.
|
|
1012
|
-
// for example, you can use Math.round to round the vector x, y values.
|
|
1013
|
-
// @param func - function to apply on components.
|
|
1014
|
-
// @return self.
|
|
1015
|
-
applySelf: function(s) {
|
|
1016
|
-
return this.x = s(this.x), this.y = s(this.y), this;
|
|
1017
|
-
},
|
|
1018
|
-
// [API]
|
|
1019
|
-
// [chainable, clone]
|
|
1020
|
-
// clone self and apply a function on x and y components of the clone vector.
|
|
1021
|
-
// for example, you can use Math.round to round the vector x, y values.
|
|
1022
|
-
// @param func - function to apply on components.
|
|
1023
|
-
// @return cloned vector.
|
|
1024
|
-
apply: function(s) {
|
|
1025
|
-
return this.clone().applySelf(s);
|
|
1026
|
-
},
|
|
1027
|
-
// [API]
|
|
1028
|
-
// [chainable, changeSelf]
|
|
1029
|
-
// turn self to absolute values (eg turn x, y positive).
|
|
1030
|
-
// @return self.
|
|
1031
|
-
absSelf: function() {
|
|
1032
|
-
return this.applySelf(Math.abs);
|
|
1033
|
-
},
|
|
1034
|
-
// [API]
|
|
1035
|
-
// [chainable, clone]
|
|
1036
|
-
// clone and turn to absolute values (eg turn x, y positive).
|
|
1037
|
-
// @return cloned vector.
|
|
1038
|
-
abs: function() {
|
|
1039
|
-
return this.clone().absSelf();
|
|
1040
|
-
},
|
|
1041
|
-
// [API]
|
|
1042
|
-
// [chainable, changeSelf]
|
|
1043
|
-
// turn self to round values (eg turn x, y positive).
|
|
1044
|
-
// @return self.
|
|
1045
|
-
roundSelf: function() {
|
|
1046
|
-
return this.applySelf(Math.round);
|
|
1047
|
-
},
|
|
1048
|
-
// [API]
|
|
1049
|
-
// [chainable, clone]
|
|
1050
|
-
// clone and turn to round values (eg turn x, y positive).
|
|
1051
|
-
// @return cloned vector.
|
|
1052
|
-
round: function() {
|
|
1053
|
-
return this.clone().roundSelf();
|
|
1054
|
-
},
|
|
1055
|
-
// [API]
|
|
1056
|
-
// []
|
|
1057
|
-
// calculate dot-product of this vector with another vector.
|
|
1058
|
-
// @param other - other vector to calculate dot-product with.
|
|
1059
|
-
// @return dot product.
|
|
1060
|
-
dot: function(s) {
|
|
1061
|
-
return this.x * s.x + this.y * s.y;
|
|
1062
|
-
},
|
|
1063
|
-
// [API]
|
|
1064
|
-
// []
|
|
1065
|
-
// calculate cross-product of this vector with another vector.
|
|
1066
|
-
// @param other - other vector to calculate cross-product with.
|
|
1067
|
-
// @return dot product.
|
|
1068
|
-
cross: function(s) {
|
|
1069
|
-
return this.x * s.y - this.y * s.x;
|
|
1070
|
-
},
|
|
1071
|
-
// [API]
|
|
1072
|
-
// [chainable, changeSelf]
|
|
1073
|
-
// if any of the components of this vector are NaN, null, undefined, etc. set them to defaults.
|
|
1074
|
-
// note: 0's are considered to be a valid number and will not be replaced with a default value.
|
|
1075
|
-
// @param x - default value for x if undefined (0 if not defined).
|
|
1076
|
-
// @param y - default value for y if undefined (0 if not defined).
|
|
1077
|
-
// @return self.
|
|
1078
|
-
repairSelf: function(s, d) {
|
|
1079
|
-
return (typeof this.x != "number" || isNaN(this.x + 1)) && (this.x = s || 0), (typeof this.y != "number" || isNaN(this.y + 1)) && (this.y = d || 0), this;
|
|
1080
|
-
},
|
|
1081
|
-
// [API]
|
|
1082
|
-
// [chainable, clone]
|
|
1083
|
-
// create a clone and if any of the components of the vector are NaN, null, undefined, etc. set them to default.
|
|
1084
|
-
// note: 0's are considered to be a valid number and will not be replaced with a default value.
|
|
1085
|
-
// @param x - default value for x if undefined (0 if not defined).
|
|
1086
|
-
// @param y - default value for y if undefined (0 if not defined).
|
|
1087
|
-
// @return repaired clone.
|
|
1088
|
-
repair: function(s, d) {
|
|
1089
|
-
return this.clone().repairSelf(s, d);
|
|
1090
|
-
},
|
|
1091
|
-
// [API]
|
|
1092
|
-
// []
|
|
1093
|
-
// convert to string in the form of "x,y".
|
|
1094
|
-
// @return string representation of the vector.
|
|
1095
|
-
toString: function() {
|
|
1096
|
-
return this.x + "," + this.y;
|
|
1097
|
-
},
|
|
1098
|
-
// [API]
|
|
1099
|
-
// []
|
|
1100
|
-
// convert to a string with a given format.
|
|
1101
|
-
// @param format - a string in which %x and %y will be replaced with the vector values.
|
|
1102
|
-
// @return formatted string representing the vector.
|
|
1103
|
-
format: function(s) {
|
|
1104
|
-
return s = s || "%x,%y", s = s.replace(new RegExp("%x", "g"), this.x), s = s.replace(new RegExp("%y", "g"), this.y), s;
|
|
1105
|
-
}
|
|
1106
|
-
}, f;
|
|
1107
|
-
}();
|
|
1108
|
-
return e.zero = new e(0, 0), e.one = new e(1, 1), e.up = new e(0, -1), e.down = new e(0, 1), e.left = new e(-1, 0), e.right = new e(1, 0), e.upLeft = new e(-1, -1), e.downLeft = new e(-1, 1), e.upRight = new e(1, -1), e.downRight = new e(1, 1), e.prototype.magnitude = e.prototype.length, Object.freeze && (Object.freeze(e.zero), Object.freeze(e.one), Object.freeze(e.up), Object.freeze(e.down), Object.freeze(e.left), Object.freeze(e.right), Object.freeze(e.upLeft), Object.freeze(e.downLeft), Object.freeze(e.upRight), Object.freeze(e.downRight)), e;
|
|
1109
|
-
});
|
|
1110
|
-
})(kr);
|
|
1111
|
-
var Xr = kr.exports;
|
|
1112
|
-
const X = /* @__PURE__ */ lr(Xr);
|
|
1113
|
-
let Me = (p = 21) => crypto.getRandomValues(new Uint8Array(p)).reduce((e, a) => (a &= 63, a < 36 ? e += a.toString(36) : a < 62 ? e += (a - 26).toString(36).toUpperCase() : a > 62 ? e += "-" : e += "_", e), "");
|
|
1114
|
-
const ce = {
|
|
628
|
+
process.env.NODE_ENV === "production" ? or.exports = Xr() : or.exports = Jr();
|
|
629
|
+
var Zr = or.exports, Kr = Object.defineProperty, Qr = (u, e, o) => e in u ? Kr(u, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : u[e] = o, x = (u, e, o) => (Qr(u, typeof e != "symbol" ? e + "" : e, o), o);
|
|
630
|
+
let ze = (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), "");
|
|
631
|
+
const ge = {
|
|
1115
632
|
strokeType: "plain",
|
|
1116
633
|
strokeColor: "black",
|
|
1117
634
|
strokeWidth: 1,
|
|
1118
635
|
head: "none",
|
|
1119
636
|
tail: "none"
|
|
1120
|
-
},
|
|
637
|
+
}, gr = {
|
|
1121
638
|
id: 0,
|
|
1122
639
|
type: "Feature",
|
|
1123
640
|
properties: {
|
|
1124
641
|
type: "arrow",
|
|
1125
642
|
style: {
|
|
1126
|
-
...
|
|
643
|
+
...ge
|
|
1127
644
|
}
|
|
1128
645
|
},
|
|
1129
646
|
geometry: {
|
|
@@ -1143,245 +660,296 @@ const ce = {
|
|
|
1143
660
|
// tail: 'arrow-plain',
|
|
1144
661
|
// start: { x: 0, y: 0 },
|
|
1145
662
|
// end: { x: 100, y: 100 }
|
|
1146
|
-
},
|
|
1147
|
-
id:
|
|
663
|
+
}, tn = (u = 0, e = 0, o = 0, i = 0, l = { ...ge }) => ({
|
|
664
|
+
id: ze(),
|
|
1148
665
|
type: "Feature",
|
|
1149
666
|
properties: {
|
|
1150
667
|
type: "arrow",
|
|
1151
668
|
style: {
|
|
1152
|
-
...
|
|
1153
|
-
...
|
|
669
|
+
...ge,
|
|
670
|
+
...l
|
|
1154
671
|
}
|
|
1155
672
|
},
|
|
1156
673
|
geometry: {
|
|
1157
674
|
type: "LineString",
|
|
1158
675
|
coordinates: [
|
|
1159
|
-
[
|
|
1160
|
-
[
|
|
676
|
+
[u, e],
|
|
677
|
+
[o, i]
|
|
1161
678
|
]
|
|
1162
679
|
}
|
|
1163
|
-
}),
|
|
1164
|
-
function
|
|
1165
|
-
return document.createElementNS(
|
|
680
|
+
}), en = "http://www.w3.org/2000/svg";
|
|
681
|
+
function de(u) {
|
|
682
|
+
return document.createElementNS(en, u);
|
|
1166
683
|
}
|
|
1167
|
-
function
|
|
1168
|
-
return
|
|
684
|
+
function Pr(u) {
|
|
685
|
+
return u.geometry.bbox || rn(u), u.geometry.bbox;
|
|
1169
686
|
}
|
|
1170
|
-
function mt(
|
|
1171
|
-
const e =
|
|
687
|
+
function mt(u) {
|
|
688
|
+
const e = Pr(u);
|
|
1172
689
|
return {
|
|
1173
690
|
width: e[2] - e[0],
|
|
1174
691
|
height: e[3] - e[1]
|
|
1175
692
|
};
|
|
1176
693
|
}
|
|
1177
|
-
function
|
|
1178
|
-
const e =
|
|
694
|
+
function vt(u) {
|
|
695
|
+
const e = Pr(u);
|
|
1179
696
|
return { x: e[0], y: e[1] };
|
|
1180
697
|
}
|
|
1181
|
-
function
|
|
1182
|
-
const [e,
|
|
1183
|
-
|
|
698
|
+
function rn(u) {
|
|
699
|
+
const [e, o] = u.geometry.coordinates[0][0], [i, l] = u.geometry.coordinates[0][2];
|
|
700
|
+
u.geometry.bbox = [e, o, i, l];
|
|
1184
701
|
}
|
|
1185
|
-
function
|
|
1186
|
-
|
|
702
|
+
function nn(u, e, o, i, l) {
|
|
703
|
+
u.geometry.bbox = [e, o, e + i, o + l], u.geometry.coordinates = [
|
|
1187
704
|
[
|
|
1188
|
-
[e,
|
|
1189
|
-
[e + i,
|
|
1190
|
-
[e + i,
|
|
1191
|
-
[e,
|
|
1192
|
-
[e,
|
|
705
|
+
[e, o],
|
|
706
|
+
[e + i, o],
|
|
707
|
+
[e + i, o + l],
|
|
708
|
+
[e, o + l],
|
|
709
|
+
[e, o]
|
|
1193
710
|
]
|
|
1194
711
|
];
|
|
1195
712
|
}
|
|
1196
|
-
function
|
|
1197
|
-
const [e,
|
|
1198
|
-
return { x: e, y:
|
|
713
|
+
function fe(u) {
|
|
714
|
+
const [e, o] = u.geometry.coordinates[0];
|
|
715
|
+
return { x: e, y: o };
|
|
1199
716
|
}
|
|
1200
|
-
function
|
|
1201
|
-
const [
|
|
1202
|
-
return { x:
|
|
717
|
+
function Ie(u, e) {
|
|
718
|
+
const [o, i] = u.geometry.coordinates[e === "start" ? 0 : 1];
|
|
719
|
+
return { x: o, y: i };
|
|
1203
720
|
}
|
|
1204
|
-
function
|
|
1205
|
-
const [e,
|
|
1206
|
-
return { x: e, y:
|
|
721
|
+
function $e(u) {
|
|
722
|
+
const [e, o] = u.geometry.coordinates[1];
|
|
723
|
+
return { x: e, y: o };
|
|
1207
724
|
}
|
|
1208
|
-
function Rr(
|
|
1209
|
-
|
|
725
|
+
function Rr(u, e, o) {
|
|
726
|
+
u.geometry.coordinates[0] = [e, o];
|
|
1210
727
|
}
|
|
1211
|
-
function
|
|
1212
|
-
|
|
728
|
+
function Ir(u, e, o) {
|
|
729
|
+
u.geometry.coordinates[1] = [e, o];
|
|
1213
730
|
}
|
|
1214
|
-
function
|
|
1215
|
-
return { start:
|
|
731
|
+
function je(u) {
|
|
732
|
+
return { start: fe(u), end: $e(u) };
|
|
1216
733
|
}
|
|
1217
|
-
function
|
|
1218
|
-
e === "start" ? Rr(
|
|
734
|
+
function Bt(u, e, o, i) {
|
|
735
|
+
e === "start" ? Rr(u, o, i) : Ir(u, o, i);
|
|
1219
736
|
}
|
|
1220
|
-
const
|
|
1221
|
-
function
|
|
1222
|
-
|
|
737
|
+
const Lr = (u) => parseInt(u.getAttribute("data-handle-id") || "-1");
|
|
738
|
+
function on(u) {
|
|
739
|
+
return Array.isArray(u) && u.length === 2 && u.every(isFinite);
|
|
740
|
+
}
|
|
741
|
+
function sn(u, e, o, i) {
|
|
742
|
+
for (let l = 0; l < u.coordinates.length; l++) {
|
|
743
|
+
const c = u.coordinates[l];
|
|
744
|
+
if (on(c))
|
|
745
|
+
c[0] = o + (c[0] - o) * e, c[1] = i + (c[1] - i) * e;
|
|
746
|
+
else
|
|
747
|
+
for (let f = 0; f < c.length; f++) {
|
|
748
|
+
const g = c[f];
|
|
749
|
+
g[0] = o + (g[0] - o) * e, g[1] = i + (g[1] - i) * e;
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
return u;
|
|
753
|
+
}
|
|
754
|
+
function Le(u, e, o) {
|
|
755
|
+
const i = Math.atan2(u.y - e.y, u.x - e.x);
|
|
1223
756
|
return {
|
|
1224
|
-
x: e.x +
|
|
1225
|
-
y: e.y +
|
|
757
|
+
x: e.x + o * Math.cos(i),
|
|
758
|
+
y: e.y + o * Math.sin(i)
|
|
1226
759
|
};
|
|
1227
760
|
}
|
|
1228
|
-
function
|
|
761
|
+
function sr(u, e) {
|
|
1229
762
|
if (!e)
|
|
1230
|
-
return { x:
|
|
1231
|
-
const
|
|
763
|
+
return { x: u.clientX, y: u.clientY };
|
|
764
|
+
const o = e.getBoundingClientRect();
|
|
1232
765
|
return {
|
|
1233
|
-
x:
|
|
1234
|
-
y:
|
|
766
|
+
x: u.clientX - o.left - e.clientLeft,
|
|
767
|
+
y: u.clientY - o.top - e.clientTop
|
|
1235
768
|
};
|
|
1236
769
|
}
|
|
1237
|
-
|
|
770
|
+
const Ct = (u, e) => ({
|
|
771
|
+
x: u.x - e.x,
|
|
772
|
+
y: u.y - e.y
|
|
773
|
+
}), Ut = (u) => Math.sqrt(u.x * u.x + u.y * u.y), Fr = (u) => ({
|
|
774
|
+
x: -u.x,
|
|
775
|
+
y: -u.y
|
|
776
|
+
}), $r = (u) => {
|
|
777
|
+
const e = Ut(u);
|
|
778
|
+
return e === 0 ? { x: 0, y: 0 } : {
|
|
779
|
+
x: u.x / e,
|
|
780
|
+
y: u.y / e
|
|
781
|
+
};
|
|
782
|
+
}, Ht = (u, e) => ({
|
|
783
|
+
x: u.x + e.x,
|
|
784
|
+
y: u.y + e.y
|
|
785
|
+
}), jr = (u, e) => ({
|
|
786
|
+
x: u.x * e,
|
|
787
|
+
y: u.y * e
|
|
788
|
+
}), Fe = (u, e) => ({
|
|
789
|
+
x: u.x * e.x,
|
|
790
|
+
y: u.y * e.y
|
|
791
|
+
}), at = (u, e) => {
|
|
792
|
+
const o = Math.sin(e), i = Math.cos(e);
|
|
793
|
+
return {
|
|
794
|
+
x: u.x * i - u.y * o,
|
|
795
|
+
y: u.x * o + u.y * i
|
|
796
|
+
};
|
|
797
|
+
}, an = (u, e) => ({
|
|
798
|
+
x: u.x / e,
|
|
799
|
+
y: u.y / e
|
|
800
|
+
}), pr = (u, e) => u.x * e.x + u.y * e.y;
|
|
801
|
+
function Dr(u, e = 5, o = 30) {
|
|
1238
802
|
var i;
|
|
1239
|
-
const { start:
|
|
1240
|
-
return Math.min(
|
|
803
|
+
const { start: l, end: c } = je(u), f = Ct(c, l), g = u.properties.style && u.properties.style.strokeWidth ? (i = u.properties.style) == null ? void 0 : i.strokeWidth : 0;
|
|
804
|
+
return Math.min(o, Math.max(3 * g, Ut(f) * 0.1, e));
|
|
1241
805
|
}
|
|
1242
|
-
function
|
|
1243
|
-
const
|
|
1244
|
-
if (!
|
|
806
|
+
function yr(u, e, o, i) {
|
|
807
|
+
const l = jr(Fr($r(e)), i);
|
|
808
|
+
if (!o || o === "none")
|
|
1245
809
|
return "";
|
|
1246
|
-
const c =
|
|
1247
|
-
return `M ${c.x} ${c.y} L ${
|
|
810
|
+
const c = Ht(u, at(l, Math.PI / 8)), f = Ht(u, at(l, -Math.PI / 8)), g = `${u.x} ${u.y}`;
|
|
811
|
+
return `M ${c.x} ${c.y} L ${g} ${f.x} ${f.y} ${o === "arrow" ? "" : `${c.x} ${c.y}`}`;
|
|
1248
812
|
}
|
|
1249
|
-
function
|
|
1250
|
-
const { start: c, end:
|
|
1251
|
-
E.setAttribute("data-annotation", `${
|
|
1252
|
-
const
|
|
1253
|
-
E.setAttribute("stroke",
|
|
1254
|
-
const
|
|
1255
|
-
E.setAttribute("d",
|
|
813
|
+
function ln(u, e, o, i, l) {
|
|
814
|
+
const { start: c, end: f } = je(u), { tail: g, head: d, strokeColor: v, strokeWidth: y } = u.properties.style || o, _ = Ct(f, c), C = Dr(u, i, l), E = de("path");
|
|
815
|
+
E.setAttribute("data-annotation", `${u.id}`), E.setAttribute("data-annotation-type", "arrow");
|
|
816
|
+
const P = d === "arrow-plain" || g === "arrow";
|
|
817
|
+
E.setAttribute("stroke", v || "none"), E.setAttribute("stroke-width", `${y}`), E.setAttribute("fill", P ? v || "" : "none"), E.setAttribute("stroke-linecap", "round"), E.setAttribute("stroke-linejoin", "round");
|
|
818
|
+
const S = yr(c, Fr(_), g, C), $ = yr(f, _, d, C), L = S + `M ${c.x} ${c.y} ${f.x} ${f.y}` + $;
|
|
819
|
+
E.setAttribute("d", L), e.appendChild(E);
|
|
1256
820
|
}
|
|
1257
|
-
const
|
|
1258
|
-
var
|
|
1259
|
-
|
|
1260
|
-
|
|
821
|
+
const Y = -1, De = "dragging", Me = "dragstart", Vt = "dragend", ar = "select", lr = "unselect", un = "hover", hn = "unhover", ur = "remove", hr = "add", cn = "cancelDrawing", cr = "update", dn = "link";
|
|
822
|
+
var fn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
823
|
+
function Mr(u) {
|
|
824
|
+
return u && u.__esModule && Object.prototype.hasOwnProperty.call(u, "default") ? u.default : u;
|
|
825
|
+
}
|
|
826
|
+
var zr = { exports: {} };
|
|
827
|
+
(function(u) {
|
|
828
|
+
var e = Object.prototype.hasOwnProperty, o = "~";
|
|
1261
829
|
function i() {
|
|
1262
830
|
}
|
|
1263
|
-
Object.create && (i.prototype = /* @__PURE__ */ Object.create(null), new i().__proto__ || (
|
|
1264
|
-
function
|
|
1265
|
-
this.fn =
|
|
831
|
+
Object.create && (i.prototype = /* @__PURE__ */ Object.create(null), new i().__proto__ || (o = !1));
|
|
832
|
+
function l(d, v, y) {
|
|
833
|
+
this.fn = d, this.context = v, this.once = y || !1;
|
|
1266
834
|
}
|
|
1267
|
-
function c(
|
|
1268
|
-
if (typeof
|
|
835
|
+
function c(d, v, y, _, C) {
|
|
836
|
+
if (typeof y != "function")
|
|
1269
837
|
throw new TypeError("The listener must be a function");
|
|
1270
|
-
var
|
|
1271
|
-
return
|
|
838
|
+
var E = new l(y, _ || d, C), P = o ? o + v : v;
|
|
839
|
+
return d._events[P] ? d._events[P].fn ? d._events[P] = [d._events[P], E] : d._events[P].push(E) : (d._events[P] = E, d._eventsCount++), d;
|
|
1272
840
|
}
|
|
1273
|
-
function
|
|
1274
|
-
--
|
|
841
|
+
function f(d, v) {
|
|
842
|
+
--d._eventsCount === 0 ? d._events = new i() : delete d._events[v];
|
|
1275
843
|
}
|
|
1276
|
-
function
|
|
844
|
+
function g() {
|
|
1277
845
|
this._events = new i(), this._eventsCount = 0;
|
|
1278
846
|
}
|
|
1279
|
-
|
|
1280
|
-
var
|
|
847
|
+
g.prototype.eventNames = function() {
|
|
848
|
+
var d = [], v, y;
|
|
1281
849
|
if (this._eventsCount === 0)
|
|
1282
|
-
return
|
|
1283
|
-
for (
|
|
1284
|
-
e.call(
|
|
1285
|
-
return Object.getOwnPropertySymbols ?
|
|
1286
|
-
},
|
|
1287
|
-
var
|
|
1288
|
-
if (!
|
|
850
|
+
return d;
|
|
851
|
+
for (y in v = this._events)
|
|
852
|
+
e.call(v, y) && d.push(o ? y.slice(1) : y);
|
|
853
|
+
return Object.getOwnPropertySymbols ? d.concat(Object.getOwnPropertySymbols(v)) : d;
|
|
854
|
+
}, g.prototype.listeners = function(d) {
|
|
855
|
+
var v = o ? o + d : d, y = this._events[v];
|
|
856
|
+
if (!y)
|
|
1289
857
|
return [];
|
|
1290
|
-
if (
|
|
1291
|
-
return [
|
|
1292
|
-
for (var
|
|
1293
|
-
|
|
1294
|
-
return
|
|
1295
|
-
},
|
|
1296
|
-
var
|
|
1297
|
-
return
|
|
1298
|
-
},
|
|
1299
|
-
var P =
|
|
858
|
+
if (y.fn)
|
|
859
|
+
return [y.fn];
|
|
860
|
+
for (var _ = 0, C = y.length, E = new Array(C); _ < C; _++)
|
|
861
|
+
E[_] = y[_].fn;
|
|
862
|
+
return E;
|
|
863
|
+
}, g.prototype.listenerCount = function(d) {
|
|
864
|
+
var v = o ? o + d : d, y = this._events[v];
|
|
865
|
+
return y ? y.fn ? 1 : y.length : 0;
|
|
866
|
+
}, g.prototype.emit = function(d, v, y, _, C, E) {
|
|
867
|
+
var P = o ? o + d : d;
|
|
1300
868
|
if (!this._events[P])
|
|
1301
869
|
return !1;
|
|
1302
|
-
var
|
|
1303
|
-
if (
|
|
1304
|
-
switch (
|
|
870
|
+
var S = this._events[P], $ = arguments.length, L, T;
|
|
871
|
+
if (S.fn) {
|
|
872
|
+
switch (S.once && this.removeListener(d, S.fn, void 0, !0), $) {
|
|
1305
873
|
case 1:
|
|
1306
|
-
return
|
|
874
|
+
return S.fn.call(S.context), !0;
|
|
1307
875
|
case 2:
|
|
1308
|
-
return
|
|
876
|
+
return S.fn.call(S.context, v), !0;
|
|
1309
877
|
case 3:
|
|
1310
|
-
return
|
|
878
|
+
return S.fn.call(S.context, v, y), !0;
|
|
1311
879
|
case 4:
|
|
1312
|
-
return
|
|
880
|
+
return S.fn.call(S.context, v, y, _), !0;
|
|
1313
881
|
case 5:
|
|
1314
|
-
return
|
|
882
|
+
return S.fn.call(S.context, v, y, _, C), !0;
|
|
1315
883
|
case 6:
|
|
1316
|
-
return
|
|
884
|
+
return S.fn.call(S.context, v, y, _, C, E), !0;
|
|
1317
885
|
}
|
|
1318
|
-
for (
|
|
1319
|
-
|
|
1320
|
-
|
|
886
|
+
for (T = 1, L = new Array($ - 1); T < $; T++)
|
|
887
|
+
L[T - 1] = arguments[T];
|
|
888
|
+
S.fn.apply(S.context, L);
|
|
1321
889
|
} else {
|
|
1322
|
-
var
|
|
1323
|
-
for (
|
|
1324
|
-
switch (
|
|
890
|
+
var B = S.length, N;
|
|
891
|
+
for (T = 0; T < B; T++)
|
|
892
|
+
switch (S[T].once && this.removeListener(d, S[T].fn, void 0, !0), $) {
|
|
1325
893
|
case 1:
|
|
1326
|
-
|
|
894
|
+
S[T].fn.call(S[T].context);
|
|
1327
895
|
break;
|
|
1328
896
|
case 2:
|
|
1329
|
-
|
|
897
|
+
S[T].fn.call(S[T].context, v);
|
|
1330
898
|
break;
|
|
1331
899
|
case 3:
|
|
1332
|
-
|
|
900
|
+
S[T].fn.call(S[T].context, v, y);
|
|
1333
901
|
break;
|
|
1334
902
|
case 4:
|
|
1335
|
-
|
|
903
|
+
S[T].fn.call(S[T].context, v, y, _);
|
|
1336
904
|
break;
|
|
1337
905
|
default:
|
|
1338
|
-
if (!
|
|
1339
|
-
for (
|
|
1340
|
-
|
|
1341
|
-
|
|
906
|
+
if (!L)
|
|
907
|
+
for (N = 1, L = new Array($ - 1); N < $; N++)
|
|
908
|
+
L[N - 1] = arguments[N];
|
|
909
|
+
S[T].fn.apply(S[T].context, L);
|
|
1342
910
|
}
|
|
1343
911
|
}
|
|
1344
912
|
return !0;
|
|
1345
|
-
},
|
|
1346
|
-
return c(this,
|
|
1347
|
-
},
|
|
1348
|
-
return c(this,
|
|
1349
|
-
},
|
|
1350
|
-
var
|
|
1351
|
-
if (!this._events[
|
|
913
|
+
}, g.prototype.on = function(d, v, y) {
|
|
914
|
+
return c(this, d, v, y, !1);
|
|
915
|
+
}, g.prototype.once = function(d, v, y) {
|
|
916
|
+
return c(this, d, v, y, !0);
|
|
917
|
+
}, g.prototype.removeListener = function(d, v, y, _) {
|
|
918
|
+
var C = o ? o + d : d;
|
|
919
|
+
if (!this._events[C])
|
|
1352
920
|
return this;
|
|
1353
|
-
if (!
|
|
1354
|
-
return
|
|
1355
|
-
var
|
|
1356
|
-
if (
|
|
1357
|
-
|
|
921
|
+
if (!v)
|
|
922
|
+
return f(this, C), this;
|
|
923
|
+
var E = this._events[C];
|
|
924
|
+
if (E.fn)
|
|
925
|
+
E.fn === v && (!_ || E.once) && (!y || E.context === y) && f(this, C);
|
|
1358
926
|
else {
|
|
1359
|
-
for (var P = 0,
|
|
1360
|
-
(
|
|
1361
|
-
|
|
927
|
+
for (var P = 0, S = [], $ = E.length; P < $; P++)
|
|
928
|
+
(E[P].fn !== v || _ && !E[P].once || y && E[P].context !== y) && S.push(E[P]);
|
|
929
|
+
S.length ? this._events[C] = S.length === 1 ? S[0] : S : f(this, C);
|
|
1362
930
|
}
|
|
1363
931
|
return this;
|
|
1364
|
-
},
|
|
1365
|
-
var
|
|
1366
|
-
return
|
|
1367
|
-
},
|
|
1368
|
-
})(
|
|
1369
|
-
var
|
|
1370
|
-
const
|
|
1371
|
-
class
|
|
1372
|
-
constructor(e,
|
|
1373
|
-
super(), x(this, "ogma"), x(this, "elements"), x(this, "layer"), x(this, "editor"), x(this, "selectedId",
|
|
1374
|
-
i.code === 27 && this.selectedId !==
|
|
932
|
+
}, g.prototype.removeAllListeners = function(d) {
|
|
933
|
+
var v;
|
|
934
|
+
return d ? (v = o ? o + d : d, this._events[v] && f(this, v)) : (this._events = new i(), this._eventsCount = 0), this;
|
|
935
|
+
}, g.prototype.off = g.prototype.removeListener, g.prototype.addListener = g.prototype.on, g.prefixed = o, g.EventEmitter = g, u.exports = g;
|
|
936
|
+
})(zr);
|
|
937
|
+
var gn = zr.exports;
|
|
938
|
+
const Nr = /* @__PURE__ */ Mr(gn);
|
|
939
|
+
class Br extends Nr {
|
|
940
|
+
constructor(e, o) {
|
|
941
|
+
super(), x(this, "ogma"), x(this, "elements"), x(this, "layer"), x(this, "editor"), x(this, "selectedId", Y), x(this, "hoveredId", Y), x(this, "ogmaOptions"), x(this, "shouldDetect"), x(this, "isDragging"), x(this, "showeditorOnHover"), x(this, "_onKeyUp", (i) => {
|
|
942
|
+
i.code === 27 && this.selectedId !== Y ? this.unselect() : (i.code === 46 || i.code === 8) && this.selectedId !== Y && this._canRemove() && this.remove(this.selectedId);
|
|
1375
943
|
}), x(this, "_onClickMouseMove", (i) => {
|
|
1376
944
|
if (!i.domEvent || this.isDragging || !this.shouldDetect || i.domEvent.type !== "mousemove" && i.domEvent.target && i.domEvent.target.tagName === "a")
|
|
1377
945
|
return;
|
|
1378
|
-
const
|
|
1379
|
-
i.domEvent.type === "mousemove" ? c ? this.hover(c.id) : this.hoveredId !==
|
|
946
|
+
const l = this.ogma.view.screenToGraphCoordinates(i), c = this.shouldDetect || !this.shouldDetect && +this.selectedId > -1 ? this.detect(l, 0) : void 0;
|
|
947
|
+
i.domEvent.type === "mousemove" ? c ? this.hover(c.id) : this.hoveredId !== Y && this.unhover() : c ? this.select(c.id) : this.selectedId !== Y && this.unselect();
|
|
1380
948
|
}), 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", () => {
|
|
1381
949
|
this.refreshEditor(), this.refreshDrawing();
|
|
1382
950
|
}), this.layer = e.layers.addSVGLayer({
|
|
1383
951
|
draw: (i) => this.draw(i)
|
|
1384
|
-
}), this.layer.moveToTop(), this.editor = e.layers.addLayer(
|
|
952
|
+
}), this.layer.moveToTop(), this.editor = e.layers.addLayer(o), this.editor.hide();
|
|
1385
953
|
}
|
|
1386
954
|
_canRemove() {
|
|
1387
955
|
return !0;
|
|
@@ -1392,52 +960,58 @@ class $r extends jr {
|
|
|
1392
960
|
* @returns the added annotation
|
|
1393
961
|
*/
|
|
1394
962
|
add(e) {
|
|
1395
|
-
const
|
|
1396
|
-
id: e.id === void 0 ?
|
|
963
|
+
const o = this.getDefaultOptions(), i = Object.assign(e, {
|
|
964
|
+
id: e.id === void 0 ? ze() : e.id,
|
|
1397
965
|
type: e.type,
|
|
1398
966
|
properties: {
|
|
1399
|
-
...
|
|
967
|
+
...o.properties,
|
|
1400
968
|
...e.properties || {},
|
|
1401
969
|
// styles need to be merged
|
|
1402
|
-
style: { ...
|
|
970
|
+
style: { ...o.properties.style, ...e.properties.style || {} }
|
|
1403
971
|
},
|
|
1404
972
|
geometry: {
|
|
1405
|
-
...
|
|
973
|
+
...o.geometry,
|
|
1406
974
|
...e.geometry
|
|
1407
975
|
}
|
|
1408
976
|
});
|
|
1409
|
-
return this.elements.push(i), this.layer.refresh(), this.emit(
|
|
977
|
+
return this.elements.push(i), this.layer.refresh(), this.emit(hr, i), i;
|
|
1410
978
|
}
|
|
1411
|
-
updateStyle(e,
|
|
979
|
+
updateStyle(e, o) {
|
|
1412
980
|
this.updateAnnotation(e, {
|
|
1413
981
|
properties: {
|
|
1414
|
-
style:
|
|
982
|
+
style: o
|
|
1415
983
|
}
|
|
1416
984
|
});
|
|
1417
985
|
}
|
|
1418
|
-
updateGeometry(e,
|
|
986
|
+
updateGeometry(e, o) {
|
|
1419
987
|
this.updateAnnotation(e, {
|
|
1420
|
-
geometry:
|
|
988
|
+
geometry: o
|
|
1421
989
|
});
|
|
1422
990
|
}
|
|
991
|
+
scale(e, o, i, l) {
|
|
992
|
+
this.updateGeometry(
|
|
993
|
+
e,
|
|
994
|
+
sn(e.geometry, o, i, l)
|
|
995
|
+
);
|
|
996
|
+
}
|
|
1423
997
|
/**
|
|
1424
998
|
* @method update
|
|
1425
999
|
* Updates an annotation (position, color etc)
|
|
1426
1000
|
* @param id Id of the annotation to update
|
|
1427
1001
|
* @param element params of the annotation
|
|
1428
1002
|
*/
|
|
1429
|
-
update(e,
|
|
1003
|
+
update(e, o) {
|
|
1430
1004
|
const i = this.getById(e);
|
|
1431
|
-
this.updateAnnotation(i,
|
|
1005
|
+
this.updateAnnotation(i, o);
|
|
1432
1006
|
}
|
|
1433
|
-
updateAnnotation(e,
|
|
1007
|
+
updateAnnotation(e, o) {
|
|
1434
1008
|
if (!e)
|
|
1435
1009
|
return;
|
|
1436
1010
|
const i = e.id;
|
|
1437
|
-
Object.keys(
|
|
1438
|
-
if (
|
|
1439
|
-
if (
|
|
1440
|
-
const c =
|
|
1011
|
+
Object.keys(o).forEach((l) => {
|
|
1012
|
+
if (l !== "id")
|
|
1013
|
+
if (l === "properties") {
|
|
1014
|
+
const c = o.properties || { style: {} };
|
|
1441
1015
|
e.properties = {
|
|
1442
1016
|
...e.properties || {},
|
|
1443
1017
|
...c || {},
|
|
@@ -1447,18 +1021,18 @@ class $r extends jr {
|
|
|
1447
1021
|
}
|
|
1448
1022
|
};
|
|
1449
1023
|
} else
|
|
1450
|
-
|
|
1024
|
+
l === "geometry" ? e.geometry = {
|
|
1451
1025
|
...e.geometry,
|
|
1452
|
-
...
|
|
1453
|
-
} : e[
|
|
1026
|
+
...o.geometry
|
|
1027
|
+
} : e[l] = o[l];
|
|
1454
1028
|
}), i === this.selectedId && this.refreshEditor(), this.layer.refresh();
|
|
1455
1029
|
}
|
|
1456
1030
|
getById(e) {
|
|
1457
|
-
const
|
|
1031
|
+
const o = Number(e);
|
|
1458
1032
|
for (let i = 0; i < this.elements.length; i++) {
|
|
1459
|
-
const
|
|
1460
|
-
if (!(
|
|
1461
|
-
return
|
|
1033
|
+
const l = this.elements[i];
|
|
1034
|
+
if (!(l.id !== e && l.id !== o))
|
|
1035
|
+
return l;
|
|
1462
1036
|
}
|
|
1463
1037
|
}
|
|
1464
1038
|
/**
|
|
@@ -1467,23 +1041,23 @@ class $r extends jr {
|
|
|
1467
1041
|
* Select element, show editor, disable Ogma dragging and fire event
|
|
1468
1042
|
*/
|
|
1469
1043
|
select(e) {
|
|
1470
|
-
const
|
|
1471
|
-
|
|
1044
|
+
const o = this.getById(e);
|
|
1045
|
+
o && (this.editor.show(), this.selectedId = e, this.refreshEditor(), this.layer.refresh(), this.emit(ar, o));
|
|
1472
1046
|
}
|
|
1473
1047
|
hover(e) {
|
|
1474
|
-
const
|
|
1475
|
-
|
|
1048
|
+
const o = this.getById(e);
|
|
1049
|
+
o && (this.showeditorOnHover && this.editor.show(), this.hoveredId = e, this.refreshEditor(), this.layer.refresh(), this.emit(un, o));
|
|
1476
1050
|
}
|
|
1477
1051
|
getSelectedFeature() {
|
|
1478
|
-
return this.selectedId ===
|
|
1052
|
+
return this.selectedId === Y ? null : this.getById(this.selectedId);
|
|
1479
1053
|
}
|
|
1480
1054
|
unselect() {
|
|
1481
1055
|
const e = this.getById(this.selectedId);
|
|
1482
|
-
return e && this.emit(
|
|
1056
|
+
return e && this.emit(lr, e), this.selectedId = Y, this.hoveredId === Y && this.editor.hide(), this.layer.refresh(), this;
|
|
1483
1057
|
}
|
|
1484
1058
|
unhover() {
|
|
1485
1059
|
const e = this.getById(this.hoveredId);
|
|
1486
|
-
return this.emit(
|
|
1060
|
+
return this.emit(hn, e), this.hoveredId = Y, this.selectedId === Y && this.editor.hide(), this.layer.refresh(), this;
|
|
1487
1061
|
}
|
|
1488
1062
|
/**
|
|
1489
1063
|
* @method remove
|
|
@@ -1491,8 +1065,8 @@ class $r extends jr {
|
|
|
1491
1065
|
* Removes annotation with the given id
|
|
1492
1066
|
*/
|
|
1493
1067
|
remove(e) {
|
|
1494
|
-
const
|
|
1495
|
-
e === this.hoveredId && this.unhover(), e === this.selectedId && this.unselect(), this.elements = this.elements.filter((i) => i.id !== e),
|
|
1068
|
+
const o = this.getById(e);
|
|
1069
|
+
e === this.hoveredId && this.unhover(), e === this.selectedId && this.unselect(), this.elements = this.elements.filter((i) => i.id !== e), o && this.emit(ur, o), this.layer.refresh();
|
|
1496
1070
|
}
|
|
1497
1071
|
/**
|
|
1498
1072
|
* @method disableDragging
|
|
@@ -1542,39 +1116,42 @@ class $r extends jr {
|
|
|
1542
1116
|
this.ogma.events.off(this._onClickMouseMove).off(this._onKeyUp), this.layer.destroy();
|
|
1543
1117
|
}
|
|
1544
1118
|
}
|
|
1545
|
-
const
|
|
1546
|
-
class
|
|
1547
|
-
constructor(e,
|
|
1119
|
+
const vr = "handle-line", mr = "handle-start", br = "handle-end";
|
|
1120
|
+
class pn extends Br {
|
|
1121
|
+
constructor(e, o = {}) {
|
|
1548
1122
|
super(
|
|
1549
1123
|
e,
|
|
1550
1124
|
`
|
|
1551
1125
|
<div class="arrow-handle">
|
|
1552
|
-
<div id="${
|
|
1553
|
-
<div id="${
|
|
1554
|
-
<div id="${
|
|
1126
|
+
<div id="${vr}" data-handle-id="0" class="handle line"></div>
|
|
1127
|
+
<div id="${mr}" data-handle-id="1" class="handle point"></div>
|
|
1128
|
+
<div id="${br}" data-handle-id="2" class="handle point"></div>
|
|
1555
1129
|
</div>
|
|
1556
1130
|
`
|
|
1557
|
-
), x(this, "draggedHandle",
|
|
1558
|
-
const
|
|
1559
|
-
if (!
|
|
1131
|
+
), x(this, "draggedHandle", Y), x(this, "start", { x: 0, y: 0 }), x(this, "end", { x: 0, y: 0 }), x(this, "arrow", { ...gr }), x(this, "startX", 0), x(this, "startY", 0), x(this, "minArrowHeight", 0), x(this, "maxArrowHeight", 0), x(this, "handles", []), x(this, "onHandleMouseDown", (i) => {
|
|
1132
|
+
const l = this.getById(this.selectedId) || this.getById(this.hoveredId);
|
|
1133
|
+
if (!l)
|
|
1560
1134
|
return;
|
|
1561
|
-
const { x: c, y:
|
|
1562
|
-
this.startDragging(
|
|
1135
|
+
const { x: c, y: f } = sr(i, this.ogma.getContainer());
|
|
1136
|
+
this.startDragging(l, c, f), this.draggedHandle = Lr(i.target);
|
|
1563
1137
|
}), x(this, "onMouseUp", () => {
|
|
1564
|
-
this.draggedHandle !== -1 && (this.restoreDragging(), this.isDragging = !1, this.draggedHandle =
|
|
1138
|
+
this.draggedHandle !== -1 && (this.restoreDragging(), this.isDragging = !1, this.draggedHandle = Y, this.emit(Vt, this.arrow));
|
|
1565
1139
|
}), x(this, "onMouseMove", (i) => {
|
|
1566
|
-
if (!this.isDragging || this.draggedHandle ===
|
|
1140
|
+
if (!this.isDragging || this.draggedHandle === Y)
|
|
1567
1141
|
return;
|
|
1568
|
-
const
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1142
|
+
const l = this.handles[this.draggedHandle], c = this.ogma.view.getAngle(), { x: f, y: g } = at(
|
|
1143
|
+
an(
|
|
1144
|
+
{ x: i.clientX - this.startX, y: i.clientY - this.startY },
|
|
1145
|
+
this.ogma.view.getZoom()
|
|
1146
|
+
),
|
|
1147
|
+
c
|
|
1148
|
+
), d = l.id === vr, v = l.id === mr, y = l.id === br;
|
|
1149
|
+
(d || v) && Rr(this.arrow, this.start.x + f, this.start.y + g), (d || y) && Ir(this.arrow, this.end.x + f, this.end.y + g), this.emit(
|
|
1150
|
+
De,
|
|
1574
1151
|
this.arrow,
|
|
1575
|
-
|
|
1152
|
+
d ? "line" : v ? "start" : "end"
|
|
1576
1153
|
), this.refreshEditor(), this.layer.refresh();
|
|
1577
|
-
}), this.minArrowHeight =
|
|
1154
|
+
}), this.minArrowHeight = o.minArrowHeight || 0, this.maxArrowHeight = o.maxArrowHeight || 1e6, this.handles = Array.prototype.slice.call(
|
|
1578
1155
|
this.editor.element.querySelectorAll(".arrow-handle>.handle")
|
|
1579
1156
|
), this.handles.forEach(
|
|
1580
1157
|
(i) => i.addEventListener("mousedown", this.onHandleMouseDown)
|
|
@@ -1586,59 +1163,60 @@ class on extends $r {
|
|
|
1586
1163
|
* @param y
|
|
1587
1164
|
* @param arrow
|
|
1588
1165
|
*/
|
|
1589
|
-
startDrawing(e,
|
|
1590
|
-
var
|
|
1166
|
+
startDrawing(e, o, i = tn(e, o, e, o, ge)) {
|
|
1167
|
+
var l;
|
|
1591
1168
|
this.disableDragging(), this.add(i), this.hoveredId = i.id;
|
|
1592
|
-
const c = this.ogma.view.graphToScreenCoordinates({ x: e, y:
|
|
1169
|
+
const c = this.ogma.view.graphToScreenCoordinates({ x: e, y: o }), f = ((l = this.ogma.getContainer()) == null ? void 0 : l.getBoundingClientRect()) || {
|
|
1593
1170
|
left: 0,
|
|
1594
1171
|
top: 0
|
|
1595
1172
|
};
|
|
1596
1173
|
this.startDragging(
|
|
1597
1174
|
this.getById(i.id),
|
|
1598
|
-
c.x + (
|
|
1599
|
-
c.y +
|
|
1175
|
+
c.x + (f == null ? void 0 : f.left),
|
|
1176
|
+
c.y + f.top
|
|
1600
1177
|
), this.draggedHandle = 2;
|
|
1601
1178
|
}
|
|
1602
1179
|
cancelDrawing() {
|
|
1603
|
-
this.isDragging && (this.remove(this.arrow.id), this.emit(
|
|
1180
|
+
this.isDragging && (this.remove(this.arrow.id), this.emit(Vt, this.arrow), this.restoreDragging(), this.isDragging = !1, this.draggedHandle = Y);
|
|
1604
1181
|
}
|
|
1605
|
-
startDragging(e,
|
|
1606
|
-
this.selectedId !== e.id && this.select(this.hoveredId), this.arrow = e, this.startX =
|
|
1182
|
+
startDragging(e, o, i) {
|
|
1183
|
+
this.selectedId !== e.id && this.select(this.hoveredId), this.arrow = e, this.startX = o, this.startY = i, this.start = fe(this.arrow), this.end = $e(this.arrow), this.disableDragging(), this.emit(Me, this.arrow), this.isDragging = !0;
|
|
1607
1184
|
}
|
|
1608
|
-
detect(e,
|
|
1185
|
+
detect(e, o = 0) {
|
|
1609
1186
|
return this.elements.find((i) => {
|
|
1610
|
-
const { start:
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1187
|
+
const { start: l, end: c } = je(i), f = Ct(e, {
|
|
1188
|
+
x: (l.x + c.x) / 2,
|
|
1189
|
+
y: (l.y + c.y) / 2
|
|
1190
|
+
}), g = Ct(c, l), d = Ut(g), v = $r(g), y = Dr(i);
|
|
1191
|
+
return Math.abs(pr(v, f)) < d / 2 + o && Math.abs(pr(at(v, Math.PI / 2), f)) < y / 2 + o;
|
|
1614
1192
|
});
|
|
1615
1193
|
}
|
|
1616
1194
|
refreshEditor() {
|
|
1617
1195
|
if (+this.selectedId < 0 && +this.hoveredId < 0)
|
|
1618
1196
|
return;
|
|
1619
|
-
const e = this.selectedId !==
|
|
1197
|
+
const e = this.selectedId !== Y ? this.getById(this.selectedId) : this.getById(this.hoveredId), o = je(e), i = this.ogma.view.graphToScreenCoordinates(o.start), l = this.ogma.view.graphToScreenCoordinates(o.end), [c, f, g] = Array.prototype.slice.call(
|
|
1620
1198
|
this.editor.element.querySelectorAll(".handle")
|
|
1621
1199
|
);
|
|
1622
|
-
|
|
1623
|
-
const
|
|
1624
|
-
x: (
|
|
1625
|
-
y: (
|
|
1626
|
-
},
|
|
1627
|
-
|
|
1200
|
+
f.style.transform = `translate(${i.x}px, ${i.y}px) translate(-50%, -50%)`, g.style.transform = `translate(${l.x}px, ${l.y}px) translate(-50%, -50%)`;
|
|
1201
|
+
const d = {
|
|
1202
|
+
x: (l.x + i.x) / 2,
|
|
1203
|
+
y: (l.y + i.y) / 2
|
|
1204
|
+
}, v = Ct(l, i), y = jr(v, 1 / Ut(v)), _ = Math.atan2(y.y, y.x);
|
|
1205
|
+
c.style.width = `${Ut(v)}px`, c.style.left = `${d.x}px`, c.style.top = `${d.y}px`, c.style.transform = `translate(-50%, -50%) rotate(${_}rad)`;
|
|
1628
1206
|
}
|
|
1629
1207
|
getDefaultOptions() {
|
|
1630
|
-
return
|
|
1208
|
+
return gr;
|
|
1631
1209
|
}
|
|
1632
1210
|
draw(e) {
|
|
1633
1211
|
e.innerHTML = "";
|
|
1634
|
-
const
|
|
1635
|
-
|
|
1636
|
-
(
|
|
1637
|
-
), e.appendChild(
|
|
1212
|
+
const o = de("g"), i = this.ogma.view.getAngle();
|
|
1213
|
+
o.setAttribute("transform", `rotate(${-i * (180 / Math.PI)})`), this.elements.forEach(
|
|
1214
|
+
(l) => ln(l, o, ge, this.minArrowHeight, this.maxArrowHeight)
|
|
1215
|
+
), e.appendChild(o);
|
|
1638
1216
|
}
|
|
1639
1217
|
refreshDrawing() {
|
|
1640
1218
|
const e = this.ogma.view.getAngle();
|
|
1641
|
-
this.layer.element.children[0].setAttribute(
|
|
1219
|
+
this.layer.element !== null && this.layer.element.children[0].setAttribute(
|
|
1642
1220
|
"transform",
|
|
1643
1221
|
`rotate(${-e * (180 / Math.PI)})`
|
|
1644
1222
|
);
|
|
@@ -1647,7 +1225,7 @@ class on extends $r {
|
|
|
1647
1225
|
super.destroy(), document.removeEventListener("mousemove", this.onMouseMove, !0), document.removeEventListener("mouseup", this.onMouseUp);
|
|
1648
1226
|
}
|
|
1649
1227
|
}
|
|
1650
|
-
const
|
|
1228
|
+
const Wt = {
|
|
1651
1229
|
font: "sans-serif",
|
|
1652
1230
|
fontSize: 12,
|
|
1653
1231
|
color: "black",
|
|
@@ -1655,13 +1233,13 @@ const Ht = {
|
|
|
1655
1233
|
strokeWidth: 1,
|
|
1656
1234
|
strokeColor: "#000",
|
|
1657
1235
|
strokeType: "plain"
|
|
1658
|
-
},
|
|
1236
|
+
}, rr = {
|
|
1659
1237
|
id: 0,
|
|
1660
1238
|
type: "Feature",
|
|
1661
1239
|
properties: {
|
|
1662
1240
|
type: "text",
|
|
1663
1241
|
content: "",
|
|
1664
|
-
style: { ...
|
|
1242
|
+
style: { ...Wt }
|
|
1665
1243
|
},
|
|
1666
1244
|
geometry: {
|
|
1667
1245
|
type: "Polygon",
|
|
@@ -1677,126 +1255,126 @@ const Ht = {
|
|
|
1677
1255
|
}
|
|
1678
1256
|
// position: { x: 0, y: 0 },
|
|
1679
1257
|
// size: { width: 100, height: 50 }
|
|
1680
|
-
},
|
|
1258
|
+
}, wr = {
|
|
1681
1259
|
handleSize: 3.5,
|
|
1682
1260
|
placeholder: "Your text..."
|
|
1683
|
-
},
|
|
1684
|
-
id:
|
|
1261
|
+
}, yn = (u = 0, e = 0, o = 100, i = 50, l = "", c = { ...Wt }) => ({
|
|
1262
|
+
id: ze(),
|
|
1685
1263
|
type: "Feature",
|
|
1686
1264
|
properties: {
|
|
1687
1265
|
type: "text",
|
|
1688
|
-
content:
|
|
1689
|
-
style: { ...
|
|
1266
|
+
content: l,
|
|
1267
|
+
style: { ...Wt, ...c }
|
|
1690
1268
|
},
|
|
1691
1269
|
geometry: {
|
|
1692
1270
|
type: "Polygon",
|
|
1693
1271
|
coordinates: [
|
|
1694
1272
|
[
|
|
1695
|
-
[
|
|
1696
|
-
[
|
|
1697
|
-
[
|
|
1698
|
-
[
|
|
1699
|
-
[
|
|
1273
|
+
[u, e],
|
|
1274
|
+
[u + o, e],
|
|
1275
|
+
[u + o, e + i],
|
|
1276
|
+
[u, e + i],
|
|
1277
|
+
[u, e]
|
|
1700
1278
|
]
|
|
1701
1279
|
]
|
|
1702
1280
|
}
|
|
1703
1281
|
});
|
|
1704
|
-
var
|
|
1705
|
-
(function(
|
|
1706
|
-
(function(
|
|
1707
|
-
|
|
1708
|
-
})(
|
|
1709
|
-
var
|
|
1710
|
-
for (var
|
|
1711
|
-
|
|
1282
|
+
var Hr = { exports: {} };
|
|
1283
|
+
(function(u, e) {
|
|
1284
|
+
(function(o, i) {
|
|
1285
|
+
u.exports = i();
|
|
1286
|
+
})(fn, () => (() => {
|
|
1287
|
+
var o = { d: (r, n) => {
|
|
1288
|
+
for (var a in n)
|
|
1289
|
+
o.o(n, a) && !o.o(r, a) && Object.defineProperty(r, a, { enumerable: !0, get: n[a] });
|
|
1712
1290
|
}, o: (r, n) => Object.prototype.hasOwnProperty.call(r, n) }, i = {};
|
|
1713
|
-
function
|
|
1714
|
-
return
|
|
1291
|
+
function l(r) {
|
|
1292
|
+
return l = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
|
|
1715
1293
|
return typeof n;
|
|
1716
1294
|
} : function(n) {
|
|
1717
1295
|
return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
|
|
1718
|
-
},
|
|
1719
|
-
}
|
|
1720
|
-
|
|
1721
|
-
var c = /^((?:[a-z\d-]+\s+)*)([\d.]+(%|em|px)|(?:x+-)?large|(?:x+-)?small|medium)(?:\s*\/\s*(normal|[\d.]+(%|px|em)?))?(\s.+)?$/,
|
|
1722
|
-
function
|
|
1723
|
-
var n = "",
|
|
1724
|
-
return
|
|
1725
|
-
}
|
|
1726
|
-
var
|
|
1727
|
-
function
|
|
1728
|
-
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {},
|
|
1729
|
-
n.family = (
|
|
1730
|
-
var t =
|
|
1731
|
-
|
|
1732
|
-
var
|
|
1733
|
-
if (
|
|
1296
|
+
}, l(r);
|
|
1297
|
+
}
|
|
1298
|
+
o.d(i, { default: () => Ke });
|
|
1299
|
+
var c = /^((?:[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 };
|
|
1300
|
+
function _(r) {
|
|
1301
|
+
var n = "", a = this;
|
|
1302
|
+
return a.style && a.style !== "normal" && (n += a.style), a.variant && a.variant !== "normal" && (n += (n ? " " : "") + a.variant), a.weight && a.weight !== "normal" && (n += (n ? " " : "") + a.weight), a.size && (n += (n ? " " : "") + a.size + "px", a.height !== a.size && (n += "/" + a.height + "px")), a.family && (n += (n ? " " : "") + a.family), r && (n += "::" + a.baseline), r && (n += "::" + a.color), n;
|
|
1303
|
+
}
|
|
1304
|
+
var C = { id: "", family: "sans-serif", height: 14, size: 12, variant: "", style: "", weight: "", baseline: "", color: null, toString: _, valueOf: _ };
|
|
1305
|
+
function E(r) {
|
|
1306
|
+
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = c.exec(r);
|
|
1307
|
+
n.family = (a[6] || "").trim();
|
|
1308
|
+
var t = y[a[2]] || parseFloat(a[2]);
|
|
1309
|
+
a[3] === "%" ? t *= 0.16 : a[3] === "em" ? t *= 16 : a[3] === "pt" && (t *= v), n.size = t;
|
|
1310
|
+
var s = parseFloat(a[4]);
|
|
1311
|
+
if (s !== "normal" && s !== "inherit" && s ? a[5] && a[5] !== "em" ? a[5] === "pt" ? n.height = s * v : a[5] === "%" ? n.height = 0.01 * t : n.height = s : n.height = s * t : n.height = Math.round(t * (7 / 6)), f.test(a[1]) && (n.variant = "small-caps"), g.test(a[1]) && (n.style = "italic"), d.test(a[1]))
|
|
1734
1312
|
n.weight = "bold";
|
|
1735
1313
|
else {
|
|
1736
|
-
var
|
|
1737
|
-
|
|
1314
|
+
var h = parseInt(/\b(\d+)\b/.exec(a[1]), 10);
|
|
1315
|
+
h >= 100 && h !== 400 && (n.weight = h);
|
|
1738
1316
|
}
|
|
1739
1317
|
return n;
|
|
1740
1318
|
}
|
|
1741
1319
|
function P() {
|
|
1742
|
-
var r, n,
|
|
1320
|
+
var r, n, 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] : {}, h = 14, p = 12, m = null, w = null, b = "";
|
|
1743
1321
|
if (t && t.nodeType) {
|
|
1744
|
-
var
|
|
1745
|
-
r =
|
|
1322
|
+
var A = t && (t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView), R = A.getComputedStyle(t, null);
|
|
1323
|
+
r = R.getPropertyValue("font-family") || "", p = parseFloat(R.getPropertyValue("font-size")), h = R.getPropertyValue("line-height"), m = R.getPropertyValue("font-weight"), w = R.getPropertyValue("font-style"), b = R.getPropertyValue("font-variant") || "";
|
|
1746
1324
|
} else if (typeof t == "string") {
|
|
1747
|
-
var
|
|
1748
|
-
r =
|
|
1325
|
+
var k = E(t);
|
|
1326
|
+
r = k.family, p = k.size, h = k.height, b = k.variant, w = k.style, m = k.weight;
|
|
1749
1327
|
} else
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
var
|
|
1753
|
-
return
|
|
1328
|
+
l(t) === "object" && (r = t.family, p = t.size, h = t.height, b = t.variant, m = t.weight, w = t.style, n = t.baseline, a = t.color);
|
|
1329
|
+
s.size && s.size < 3 && (p *= s.size), h = h !== "normal" && h ? parseFloat(h) : p * (7 / 6), s.height && s.height < 3 && (h *= s.height);
|
|
1330
|
+
var O = Object.create(C);
|
|
1331
|
+
return O.family = s.family || r || "sans-serif", O.height = h ?? 14, O.size = p ?? 12, O.variant = s.variant || b || "", O.style = s.style || w || "", O.weight = s.weight || m || "", O.baseline = n || 0, s.baseline != null && (O.baseline = s.baseline), O.color = s.color || a || "", O.id = _.call(O, !0), O;
|
|
1754
1332
|
}
|
|
1755
|
-
const
|
|
1756
|
-
var
|
|
1333
|
+
const S = { "\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 };
|
|
1334
|
+
var $, L = function(r) {
|
|
1757
1335
|
var n = typeof OffscreenCanvas < "u" && new OffscreenCanvas(100, 100) || r && r.createElement("canvas");
|
|
1758
1336
|
if (n && n.getContext) {
|
|
1759
|
-
var
|
|
1760
|
-
if (
|
|
1761
|
-
return function(t,
|
|
1762
|
-
return
|
|
1337
|
+
var a = n.getContext("2d");
|
|
1338
|
+
if (a && typeof a.measureText == "function")
|
|
1339
|
+
return function(t, s) {
|
|
1340
|
+
return a.font = String(s), a.measureText(t).width;
|
|
1763
1341
|
};
|
|
1764
1342
|
}
|
|
1765
|
-
}(typeof document < "u" ? document : null) || (
|
|
1766
|
-
if (
|
|
1767
|
-
var
|
|
1768
|
-
|
|
1343
|
+
}(typeof document < "u" ? document : null) || ($ = {}, function(r, n) {
|
|
1344
|
+
if (!$[n]) {
|
|
1345
|
+
var a = P(n);
|
|
1346
|
+
$[n] = a, /\bmonospace\b/.test(a.family) ? a.size *= 0.6 : (a.size *= 0.45, a.weight && (a.size *= 1.18));
|
|
1769
1347
|
}
|
|
1770
|
-
return r.length *
|
|
1771
|
-
}),
|
|
1772
|
-
function
|
|
1773
|
-
var t = Object.assign({},
|
|
1774
|
-
if (!
|
|
1348
|
+
return r.length * $[n].size;
|
|
1349
|
+
}), T = {}, B = { trim: !0, collapse: !0 };
|
|
1350
|
+
function N(r, n, a) {
|
|
1351
|
+
var t = Object.assign({}, B, a), s = String(r);
|
|
1352
|
+
if (!s)
|
|
1775
1353
|
return 0;
|
|
1776
|
-
if (
|
|
1777
|
-
var
|
|
1778
|
-
return
|
|
1354
|
+
if (s in S) {
|
|
1355
|
+
var h = n.id + "/" + s;
|
|
1356
|
+
return h in T || (T[h] = L("_".concat(s, "_"), n) - L("__", n)), T[h];
|
|
1779
1357
|
}
|
|
1780
|
-
return t.trim && t.collapse ? t.trim ?
|
|
1358
|
+
return t.trim && t.collapse ? t.trim ? s = s.trim() : t.collapse && (s = s.replace(/\s+/g, " ")) : s = s.replace(/\n/g, " "), L(s, n) + n.size * (r.tracking || 0);
|
|
1781
1359
|
}
|
|
1782
|
-
function
|
|
1783
|
-
return
|
|
1360
|
+
function it(r) {
|
|
1361
|
+
return it = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
|
|
1784
1362
|
return typeof n;
|
|
1785
1363
|
} : function(n) {
|
|
1786
1364
|
return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
|
|
1787
|
-
},
|
|
1365
|
+
}, it(r);
|
|
1788
1366
|
}
|
|
1789
1367
|
function xt(r, n) {
|
|
1790
1368
|
if (typeof n != "function" && n !== null)
|
|
1791
1369
|
throw new TypeError("Super expression must either be null or a function");
|
|
1792
|
-
r.prototype = Object.create(n && n.prototype, { constructor: { value: r, writable: !0, configurable: !0 } }), Object.defineProperty(r, "prototype", { writable: !1 }), n &&
|
|
1370
|
+
r.prototype = Object.create(n && n.prototype, { constructor: { value: r, writable: !0, configurable: !0 } }), Object.defineProperty(r, "prototype", { writable: !1 }), n && qt(r, n);
|
|
1793
1371
|
}
|
|
1794
|
-
function
|
|
1795
|
-
return
|
|
1796
|
-
return
|
|
1797
|
-
},
|
|
1372
|
+
function qt(r, n) {
|
|
1373
|
+
return qt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(a, t) {
|
|
1374
|
+
return a.__proto__ = t, a;
|
|
1375
|
+
}, qt(r, n);
|
|
1798
1376
|
}
|
|
1799
|
-
function
|
|
1377
|
+
function Yt(r) {
|
|
1800
1378
|
var n = function() {
|
|
1801
1379
|
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
|
|
1802
1380
|
return !1;
|
|
@@ -1810,62 +1388,62 @@ var Mr = { exports: {} };
|
|
|
1810
1388
|
}
|
|
1811
1389
|
}();
|
|
1812
1390
|
return function() {
|
|
1813
|
-
var
|
|
1391
|
+
var a, t = Ot(r);
|
|
1814
1392
|
if (n) {
|
|
1815
|
-
var
|
|
1816
|
-
|
|
1393
|
+
var s = Ot(this).constructor;
|
|
1394
|
+
a = Reflect.construct(t, arguments, s);
|
|
1817
1395
|
} else
|
|
1818
|
-
|
|
1819
|
-
return
|
|
1396
|
+
a = t.apply(this, arguments);
|
|
1397
|
+
return pe(this, a);
|
|
1820
1398
|
};
|
|
1821
1399
|
}
|
|
1822
|
-
function
|
|
1823
|
-
if (n && (
|
|
1400
|
+
function pe(r, n) {
|
|
1401
|
+
if (n && (it(n) === "object" || typeof n == "function"))
|
|
1824
1402
|
return n;
|
|
1825
1403
|
if (n !== void 0)
|
|
1826
1404
|
throw new TypeError("Derived constructors may only return object or undefined");
|
|
1827
|
-
return function(
|
|
1828
|
-
if (
|
|
1405
|
+
return function(a) {
|
|
1406
|
+
if (a === void 0)
|
|
1829
1407
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1830
|
-
return
|
|
1408
|
+
return a;
|
|
1831
1409
|
}(r);
|
|
1832
1410
|
}
|
|
1833
|
-
function
|
|
1834
|
-
return
|
|
1411
|
+
function Ot(r) {
|
|
1412
|
+
return Ot = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(n) {
|
|
1835
1413
|
return n.__proto__ || Object.getPrototypeOf(n);
|
|
1836
|
-
},
|
|
1414
|
+
}, Ot(r);
|
|
1837
1415
|
}
|
|
1838
|
-
function
|
|
1416
|
+
function Pt(r, n) {
|
|
1839
1417
|
if (!(r instanceof n))
|
|
1840
1418
|
throw new TypeError("Cannot call a class as a function");
|
|
1841
1419
|
}
|
|
1842
|
-
function
|
|
1843
|
-
for (var
|
|
1844
|
-
var t = n[
|
|
1845
|
-
t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(r, (
|
|
1846
|
-
if (
|
|
1847
|
-
return
|
|
1848
|
-
var
|
|
1849
|
-
if (
|
|
1850
|
-
var w =
|
|
1851
|
-
if (
|
|
1420
|
+
function Gt(r, n) {
|
|
1421
|
+
for (var a = 0; a < n.length; a++) {
|
|
1422
|
+
var t = n[a];
|
|
1423
|
+
t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(r, (s = function(h, p) {
|
|
1424
|
+
if (it(h) !== "object" || h === null)
|
|
1425
|
+
return h;
|
|
1426
|
+
var m = h[Symbol.toPrimitive];
|
|
1427
|
+
if (m !== void 0) {
|
|
1428
|
+
var w = m.call(h, p);
|
|
1429
|
+
if (it(w) !== "object")
|
|
1852
1430
|
return w;
|
|
1853
1431
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1854
1432
|
}
|
|
1855
|
-
return String(
|
|
1856
|
-
}(t.key, "string"),
|
|
1433
|
+
return String(h);
|
|
1434
|
+
}(t.key, "string"), it(s) === "symbol" ? s : String(s)), t);
|
|
1857
1435
|
}
|
|
1858
|
-
var
|
|
1436
|
+
var s;
|
|
1859
1437
|
}
|
|
1860
|
-
function
|
|
1861
|
-
return n &&
|
|
1438
|
+
function tt(r, n, a) {
|
|
1439
|
+
return n && Gt(r.prototype, n), a && Gt(r, a), Object.defineProperty(r, "prototype", { writable: !1 }), r;
|
|
1862
1440
|
}
|
|
1863
|
-
var
|
|
1441
|
+
var D = function() {
|
|
1864
1442
|
function r() {
|
|
1865
1443
|
var n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
1866
|
-
|
|
1444
|
+
Pt(this, r), this.value = n, this.weight = null, this.style = null, this.font = null, this.href = null, this.sub = !1, this.sup = !1;
|
|
1867
1445
|
}
|
|
1868
|
-
return
|
|
1446
|
+
return tt(r, [{ key: "clone", value: function() {
|
|
1869
1447
|
var n = new r(this.value);
|
|
1870
1448
|
return n.value = this.value, n.weight = this.weight, n.style = this.style, n.font = this.font, n.href = this.href, n.sub = this.sub, n.sup = this.sup, n;
|
|
1871
1449
|
} }, { key: "valueOf", value: function() {
|
|
@@ -1873,43 +1451,43 @@ var Mr = { exports: {} };
|
|
|
1873
1451
|
} }, { key: "toString", value: function() {
|
|
1874
1452
|
return this.value;
|
|
1875
1453
|
} }]), r;
|
|
1876
|
-
}(),
|
|
1877
|
-
xt(
|
|
1878
|
-
var n =
|
|
1879
|
-
function
|
|
1880
|
-
return
|
|
1454
|
+
}(), lt = function(r) {
|
|
1455
|
+
xt(a, r);
|
|
1456
|
+
var n = Yt(a);
|
|
1457
|
+
function a() {
|
|
1458
|
+
return Pt(this, a), n.apply(this, arguments);
|
|
1881
1459
|
}
|
|
1882
|
-
return
|
|
1883
|
-
}(
|
|
1884
|
-
xt(
|
|
1885
|
-
var n =
|
|
1886
|
-
function
|
|
1887
|
-
return
|
|
1460
|
+
return tt(a);
|
|
1461
|
+
}(D), G = function(r) {
|
|
1462
|
+
xt(a, r);
|
|
1463
|
+
var n = Yt(a);
|
|
1464
|
+
function a() {
|
|
1465
|
+
return Pt(this, a), n.apply(this, arguments);
|
|
1888
1466
|
}
|
|
1889
|
-
return
|
|
1890
|
-
}(
|
|
1891
|
-
xt(
|
|
1892
|
-
var n =
|
|
1893
|
-
function
|
|
1894
|
-
return
|
|
1467
|
+
return tt(a);
|
|
1468
|
+
}(D), ut = function(r) {
|
|
1469
|
+
xt(a, r);
|
|
1470
|
+
var n = Yt(a);
|
|
1471
|
+
function a() {
|
|
1472
|
+
return Pt(this, a), n.apply(this, arguments);
|
|
1895
1473
|
}
|
|
1896
|
-
return
|
|
1897
|
-
}(
|
|
1898
|
-
function
|
|
1474
|
+
return tt(a);
|
|
1475
|
+
}(D), Rt = /^[\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]/;
|
|
1476
|
+
function At(r, n) {
|
|
1899
1477
|
n !== !1 && (r = r.trim());
|
|
1900
|
-
for (var
|
|
1901
|
-
|
|
1902
|
-
var b =
|
|
1903
|
-
if ((
|
|
1904
|
-
var
|
|
1905
|
-
/\u00AD$/.test(
|
|
1478
|
+
for (var a, t, s = [], h = r.charAt(0), p = 0, m = 1, w = r.length; m < w; m++) {
|
|
1479
|
+
a = r.charAt(m), t = r.charAt(m + 1);
|
|
1480
|
+
var b = Rt.test(h), A = Rt.test(a), R = A || b, k = void 0;
|
|
1481
|
+
if ((me.test(a) && !Xt.test(h) || ve.test(h + t) && !Xt.test(a)) && (R = !0), h !== "-" && h !== "‐" && h !== "–" && h !== "—" || ((k = Rt.test(r.charAt(m - 2))) && !A && (R = !1), !k && ye.test(a + t) && (R = !0)), R) {
|
|
1482
|
+
var O = r.slice(p, m);
|
|
1483
|
+
/\u00AD$/.test(O) ? (s.push(new D(O.slice(0, -1))), s.push(new ut())) : (s.push(new D(O)), s.push(new lt())), p = m;
|
|
1906
1484
|
}
|
|
1907
|
-
|
|
1485
|
+
h = a;
|
|
1908
1486
|
}
|
|
1909
|
-
return
|
|
1487
|
+
return s.push(new D(r.slice(p))), s;
|
|
1910
1488
|
}
|
|
1911
|
-
const
|
|
1912
|
-
var
|
|
1489
|
+
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: "›" };
|
|
1490
|
+
var Ne = /^[\n\r\x20\u2000-\u200B\u205F\u3000]/, Jt = /^<\/([a-zA-Z0-9]+)([^>]*)>/, Zt = /^<([a-zA-Z0-9]+)((?:\s[^=\s/]+(?:\s*=\s*(?:"[^"]+"|'[^']+'|[^>\\s]+))?)+)?\s*(\/?)>(\n*)/, It = /^<!--(.+?)-->/, Kt = /&(?:#(\d\d{2,})|#x([\da-fA-F]{2,})|([a-zA-Z][a-zA-Z1-4]{1,8}));/g, Et = { b: function(r) {
|
|
1913
1491
|
r.weight = "bold";
|
|
1914
1492
|
}, strong: function(r) {
|
|
1915
1493
|
r.weight = "bold";
|
|
@@ -1935,37 +1513,37 @@ var Mr = { exports: {} };
|
|
|
1935
1513
|
r.sub = !0;
|
|
1936
1514
|
}, sup: function(r) {
|
|
1937
1515
|
r.sup = !0;
|
|
1938
|
-
} },
|
|
1939
|
-
function
|
|
1940
|
-
return r.replace(
|
|
1941
|
-
if (
|
|
1942
|
-
var
|
|
1943
|
-
return String.fromCharCode(parseInt(
|
|
1516
|
+
} }, 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 };
|
|
1517
|
+
function Qt(r) {
|
|
1518
|
+
return r.replace(Kt, function(n, a, t, s) {
|
|
1519
|
+
if (a || t) {
|
|
1520
|
+
var h = a ? 10 : 16;
|
|
1521
|
+
return String.fromCharCode(parseInt(a || t, h));
|
|
1944
1522
|
}
|
|
1945
|
-
return
|
|
1523
|
+
return s in be ? be[s] : n;
|
|
1946
1524
|
});
|
|
1947
1525
|
}
|
|
1948
|
-
function
|
|
1526
|
+
function He(r) {
|
|
1949
1527
|
return r && r.length > 1 && (r[0] === '"' && r[r.length - 1] === '"' || r[0] === "'" && r[r.length - 1] === "'") ? r.slice(1, -1) : r;
|
|
1950
1528
|
}
|
|
1951
|
-
var
|
|
1952
|
-
function
|
|
1953
|
-
var n,
|
|
1529
|
+
var Ue = /^\s*([^=\s&]+)(?:\s*=\s*("[^"]+"|'[^']+'|[^>\s]+))?/;
|
|
1530
|
+
function Lt(r) {
|
|
1531
|
+
var n, a = {};
|
|
1954
1532
|
if (r) {
|
|
1955
1533
|
do
|
|
1956
|
-
if (n =
|
|
1957
|
-
var t =
|
|
1958
|
-
if (
|
|
1534
|
+
if (n = Ue.exec(r)) {
|
|
1535
|
+
var t = Qt(He(n[2] || "")).replace(/[ \r\n\t]+/g, " ").trim();
|
|
1536
|
+
if (a[n[1]] = t, (r = r.slice(n[0].length)).length && /^\S/.test(r[0]))
|
|
1959
1537
|
throw new Error("Attribute error");
|
|
1960
1538
|
}
|
|
1961
1539
|
while (n && r.length);
|
|
1962
1540
|
if (/\S/.test(r))
|
|
1963
1541
|
throw new Error("Attribute error");
|
|
1964
1542
|
}
|
|
1965
|
-
return
|
|
1543
|
+
return a;
|
|
1966
1544
|
}
|
|
1967
|
-
const
|
|
1968
|
-
var
|
|
1545
|
+
const _t = { 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: "Þ" };
|
|
1546
|
+
var we = /^(\^|_|\\[^#$%&~_^\\{}()\s]+)(\{)?/, xe = /^%[^\n]+(?:\n|$)/, Ft = /^[^#$%&~_^\\{}]+/, We = /^\\([&{}$%#_])/, Ve = /(?:\\[\\@,!:;-]|-{2,3}|[!?]`|``?|,,|''?|~|<<|>>)/g, te = { "---": "—", "--": "–", "!`": "¡", "?`": "¿", "``": "“", ",,": "„", "''": "”", "`": "‘", "'": "’", "<<": "«", ">>": "»", "~": " ", "\\-": "", "\\,": " ", "\\;": " ", "\\:": " ", "\\!": " ", "\\@": "\uFEFF", "\\\\": "\\newline{}" }, H = { bf: function(r) {
|
|
1969
1547
|
r.weight = "bold";
|
|
1970
1548
|
}, it: function(r) {
|
|
1971
1549
|
r.style = "italic";
|
|
@@ -1980,40 +1558,40 @@ var Mr = { exports: {} };
|
|
|
1980
1558
|
}, _: function(r) {
|
|
1981
1559
|
r.sub = !0;
|
|
1982
1560
|
}, par: function(r) {
|
|
1983
|
-
this.tokens.push(new
|
|
1561
|
+
this.tokens.push(new G(), new G());
|
|
1984
1562
|
}, newline: function(r) {
|
|
1985
|
-
this.tokens.push(new
|
|
1563
|
+
this.tokens.push(new G());
|
|
1986
1564
|
}, url: function(r, n) {
|
|
1987
|
-
this.open_context().href = n, this.add_token(new
|
|
1565
|
+
this.open_context().href = n, this.add_token(new D(n)), this.close_context();
|
|
1988
1566
|
} };
|
|
1989
|
-
|
|
1990
|
-
var
|
|
1991
|
-
function
|
|
1567
|
+
H.textsuperscript = H["^"], H.textsubscript = H._, H.textsl = H.sl, H.mathbf = H.bf, H.mathit = H.it, H.textbf = H.bf, H.textit = H.it, H.textcolor = H.color;
|
|
1568
|
+
var qe = /[\r\n\xA0]+/g;
|
|
1569
|
+
function Ae(r, n) {
|
|
1992
1570
|
r.sup && (r.baseline = 0.45, r.size = 0.7), r.sub && (r.baseline = -0.3, r.size = 0.7);
|
|
1993
|
-
var
|
|
1994
|
-
return (r.style || r.weight || r.baseline || r.color || r.size || r.family) && (
|
|
1571
|
+
var a = n;
|
|
1572
|
+
return (r.style || r.weight || r.baseline || r.color || r.size || r.family) && (a = P(n, r)), a;
|
|
1995
1573
|
}
|
|
1996
|
-
function
|
|
1997
|
-
for (var t,
|
|
1998
|
-
|
|
1999
|
-
r[r.length - 1] instanceof
|
|
1574
|
+
function ee(r, n, a) {
|
|
1575
|
+
for (var t, s, h = r.width; h + a.width > n && r.length; )
|
|
1576
|
+
s = (t = r[r.length - 1]).width, t.width > a.width ? (t.value = t.value.slice(0, -1), t.width = N(t, t.font), h += t.width) : r.pop(), h -= s;
|
|
1577
|
+
r[r.length - 1] instanceof ut && r.pop(), t = r[r.length - 1] || t || {}, a.font = P(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);
|
|
2000
1578
|
}
|
|
2001
1579
|
function ot(r) {
|
|
2002
1580
|
return Math.round(1e6 * r) / 1e6;
|
|
2003
1581
|
}
|
|
2004
|
-
function
|
|
1582
|
+
function Ee(r) {
|
|
2005
1583
|
return function(n) {
|
|
2006
1584
|
if (Array.isArray(n))
|
|
2007
1585
|
return $t(n);
|
|
2008
1586
|
}(r) || function(n) {
|
|
2009
1587
|
if (typeof Symbol < "u" && n[Symbol.iterator] != null || n["@@iterator"] != null)
|
|
2010
1588
|
return Array.from(n);
|
|
2011
|
-
}(r) || function(n,
|
|
1589
|
+
}(r) || function(n, a) {
|
|
2012
1590
|
if (n) {
|
|
2013
1591
|
if (typeof n == "string")
|
|
2014
|
-
return $t(n,
|
|
1592
|
+
return $t(n, a);
|
|
2015
1593
|
var t = Object.prototype.toString.call(n).slice(8, -1);
|
|
2016
|
-
return t === "Object" && n.constructor && (t = n.constructor.name), t === "Map" || t === "Set" ? Array.from(n) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? $t(n,
|
|
1594
|
+
return t === "Object" && n.constructor && (t = n.constructor.name), t === "Map" || t === "Set" ? Array.from(n) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? $t(n, a) : void 0;
|
|
2017
1595
|
}
|
|
2018
1596
|
}(r) || function() {
|
|
2019
1597
|
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
@@ -2022,128 +1600,128 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2022
1600
|
}
|
|
2023
1601
|
function $t(r, n) {
|
|
2024
1602
|
(n == null || n > r.length) && (n = r.length);
|
|
2025
|
-
for (var
|
|
2026
|
-
t[
|
|
1603
|
+
for (var a = 0, t = new Array(n); a < n; a++)
|
|
1604
|
+
t[a] = r[a];
|
|
2027
1605
|
return t;
|
|
2028
1606
|
}
|
|
2029
|
-
var
|
|
1607
|
+
var _e = { center: "middle", right: "end" }, re = { middle: 0.5, center: 0.5, bottom: 1, end: 1 }, ne = function(r, n) {
|
|
2030
1608
|
return !r && !n || r === n;
|
|
2031
1609
|
};
|
|
2032
|
-
function
|
|
2033
|
-
var
|
|
1610
|
+
function Ye(r, n) {
|
|
1611
|
+
var a = [], t = n.font(), s = t.size, h = t.family, p = n.align(), m = n.createElement();
|
|
2034
1612
|
if (r.length) {
|
|
2035
|
-
var w = t.height, b = n.valign(),
|
|
2036
|
-
if (
|
|
2037
|
-
var
|
|
2038
|
-
U += (
|
|
1613
|
+
var w = t.height, b = n.valign(), A = n.height()(), R = n.width()(0), k = !isFinite(R) && r.length === 1, O = k ? null : n.x(), j = ot(w / s), U = k ? null : ot(w / (1.15 * s + (w - s) / 2));
|
|
1614
|
+
if (re[b] && isFinite(A)) {
|
|
1615
|
+
var M = b === "bottom" ? 1 : 0.5;
|
|
1616
|
+
U += (A * M - w * r.length * M) / s;
|
|
2039
1617
|
}
|
|
2040
|
-
var
|
|
2041
|
-
|
|
2042
|
-
for (var z = [],
|
|
2043
|
-
if (
|
|
2044
|
-
var
|
|
2045
|
-
z.push(
|
|
1618
|
+
var I = p === "justify", W = 0;
|
|
1619
|
+
p === "right" ? W = R : p === "center" && (W = R / 2);
|
|
1620
|
+
for (var z = [], et = "tspan", J = null, V = "", F = function() {
|
|
1621
|
+
if (V) {
|
|
1622
|
+
var Tt = m(et, J, V);
|
|
1623
|
+
z.push(Tt);
|
|
2046
1624
|
}
|
|
2047
|
-
|
|
2048
|
-
},
|
|
2049
|
-
var
|
|
2050
|
-
if (
|
|
1625
|
+
et = "tspan", J = null, V = "";
|
|
1626
|
+
}, nt = 0, rt = r.length; nt < rt; nt++) {
|
|
1627
|
+
var ft = "", bt = "", ct = 0, gt = r[nt];
|
|
1628
|
+
if (gt.length) {
|
|
2051
1629
|
z = [];
|
|
2052
|
-
for (var
|
|
2053
|
-
var
|
|
2054
|
-
|
|
1630
|
+
for (var Mt = 0, le = 0, pt = void 0, Z = 0, Pe = gt.length; Z < Pe; Z++) {
|
|
1631
|
+
var q = gt[Z], K = q.font;
|
|
1632
|
+
q.whitespace && Mt++, le += q.width, Z && !q.tracking && !ct && ne(K.id, ft) && ne(q.class, bt) && ne(pt, q.href) ? V += q.value : (F(), V = q.value, J = { fontFamily: K.family !== h ? K.family : null, fontSize: K.size !== s ? K.size : null, fontWeight: K.weight || null, fontStyle: K.style || null, fontVariant: K.variant !== "normal" && K.variant || null, fill: K.color || null, baselineShift: K.baseline ? 100 * K.baseline + "%" : null, className: q.class || null }, ct && (J.dx = ot(ct), ct = 0), q.tracking && (ct = K.size * q.tracking), q.href && !pt ? (pt = q.href, et = "a", J.href = pt, J.rel = q.rel, J.target = q.target) : pt = null, ft = K.id, bt = q.class);
|
|
2055
1633
|
}
|
|
2056
|
-
if (
|
|
2057
|
-
|
|
1634
|
+
if (F(), k)
|
|
1635
|
+
a.push.apply(a, Ee(z));
|
|
2058
1636
|
else {
|
|
2059
|
-
var Re = null,
|
|
2060
|
-
|
|
1637
|
+
var Re = null, ue = nt === rt - 1 || gt[gt.length - 1] instanceof G;
|
|
1638
|
+
I && gt.length > 1 && !ue && (Re = ot((R - le) / Mt)), a.push(m.apply(void 0, ["tspan", { wordSpacing: Re, x: O(nt) + W, dy: ot(nt ? j : U) + "em" }].concat(Ee(z))));
|
|
2061
1639
|
}
|
|
2062
1640
|
} else
|
|
2063
|
-
|
|
1641
|
+
a.push(m("tspan", { x: O(nt), dy: ot(nt ? j : U) + "em" }, " "));
|
|
2064
1642
|
}
|
|
2065
1643
|
}
|
|
2066
|
-
return
|
|
1644
|
+
return m.apply(void 0, ["text", { fontFamily: h, fontSize: s, textAnchor: _e[p] || "start" }].concat(a));
|
|
2067
1645
|
}
|
|
2068
|
-
var
|
|
2069
|
-
function
|
|
1646
|
+
var Ge = { middle: 0.5, center: 0.5, bottom: 1, end: 1 };
|
|
1647
|
+
function Xe(r, n, a) {
|
|
2070
1648
|
if (r.length) {
|
|
2071
|
-
|
|
2072
|
-
var t = n.font(),
|
|
2073
|
-
if (
|
|
2074
|
-
var
|
|
2075
|
-
|
|
1649
|
+
a.textBaseline = "middle";
|
|
1650
|
+
var t = n.font(), s = t.height, h = t.size, p = n.valign(), m = n.height()(), w = n.width()(0), b = n.align(), A = b === "justify", R = 0.5 * s, k = Ge[p];
|
|
1651
|
+
if (k && isFinite(m)) {
|
|
1652
|
+
var O = r.length * s;
|
|
1653
|
+
R += m * k - O * k;
|
|
2076
1654
|
}
|
|
2077
|
-
r.forEach(function(
|
|
2078
|
-
var
|
|
2079
|
-
|
|
2080
|
-
|
|
1655
|
+
r.forEach(function(j, U) {
|
|
1656
|
+
var M = n.x()(U), I = U * s + R, W = 0, z = 0;
|
|
1657
|
+
j.forEach(function(V) {
|
|
1658
|
+
V.whitespace && W++, z += V.width;
|
|
2081
1659
|
});
|
|
2082
|
-
var
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
var
|
|
2086
|
-
|
|
2087
|
-
return
|
|
2088
|
-
}(
|
|
2089
|
-
var
|
|
2090
|
-
if (b === "right" ?
|
|
2091
|
-
|
|
2092
|
-
var
|
|
2093
|
-
|
|
1660
|
+
var et = 0, J = U === r.length - 1 || j[j.length - 1] instanceof G;
|
|
1661
|
+
A && j.length > 1 && !J && (et = (w - z) / W), j.forEach(function(V) {
|
|
1662
|
+
a.font = V.font;
|
|
1663
|
+
var F = V.font, nt = F.baseline ? h * -F.baseline + 0.15 * h : 0;
|
|
1664
|
+
a.fillStyle = function(bt, ct) {
|
|
1665
|
+
return bt.color ? bt.color : ct.href ? "#00C" : "#000";
|
|
1666
|
+
}(F, V);
|
|
1667
|
+
var rt = 0;
|
|
1668
|
+
if (b === "right" ? rt += w - z : b === "center" ? rt += w / 2 - z / 2 : b === "justify" && (V.whitespace || V instanceof G) && (M += et), a.fillText(V.value, M + rt, I + nt), V.href) {
|
|
1669
|
+
a.beginPath(), a.strokeStyle = a.fillStyle;
|
|
1670
|
+
var ft = Math.floor(I + 0.45 * h) + 0.5;
|
|
1671
|
+
a.moveTo(M + rt, ft), a.lineTo(M + rt + V.width, ft), a.stroke();
|
|
2094
1672
|
}
|
|
2095
|
-
|
|
1673
|
+
M += V.width;
|
|
2096
1674
|
});
|
|
2097
1675
|
});
|
|
2098
1676
|
}
|
|
2099
1677
|
}
|
|
2100
|
-
function
|
|
2101
|
-
return
|
|
1678
|
+
function ie(r) {
|
|
1679
|
+
return ie = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
|
|
2102
1680
|
return typeof n;
|
|
2103
1681
|
} : function(n) {
|
|
2104
1682
|
return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
|
|
2105
|
-
},
|
|
1683
|
+
}, ie(r);
|
|
2106
1684
|
}
|
|
2107
|
-
function
|
|
2108
|
-
for (var n = {},
|
|
2109
|
-
var t = r[
|
|
2110
|
-
typeof t != "number" && t != null && (typeof t == "string" ? n.text = t : typeof t == "function" ? n.fn = t :
|
|
1685
|
+
function ke(r) {
|
|
1686
|
+
for (var n = {}, a = 0; a < r.length; a++) {
|
|
1687
|
+
var t = r[a];
|
|
1688
|
+
typeof t != "number" && t != null && (typeof t == "string" ? n.text = t : typeof t == "function" ? n.fn = t : ie(t) === "object" && t._groups ? n.d3 = t : t && t.nodeType && t.getContext ? n.ctx = t.getContext("2d") : t && t.fillText && t.beginPath ? n.ctx = t : t && (n.text = t));
|
|
2111
1689
|
}
|
|
2112
1690
|
return n;
|
|
2113
1691
|
}
|
|
2114
|
-
function
|
|
2115
|
-
return
|
|
1692
|
+
function kt(r) {
|
|
1693
|
+
return kt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
|
|
2116
1694
|
return typeof n;
|
|
2117
1695
|
} : function(n) {
|
|
2118
1696
|
return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
|
|
2119
|
-
},
|
|
2120
|
-
}
|
|
2121
|
-
function
|
|
2122
|
-
for (var
|
|
2123
|
-
var t = n[
|
|
2124
|
-
t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(r, (
|
|
2125
|
-
if (
|
|
2126
|
-
return
|
|
2127
|
-
var
|
|
2128
|
-
if (
|
|
2129
|
-
var w =
|
|
2130
|
-
if (
|
|
1697
|
+
}, kt(r);
|
|
1698
|
+
}
|
|
1699
|
+
function oe(r, n) {
|
|
1700
|
+
for (var a = 0; a < n.length; a++) {
|
|
1701
|
+
var t = n[a];
|
|
1702
|
+
t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(r, (s = function(h, p) {
|
|
1703
|
+
if (kt(h) !== "object" || h === null)
|
|
1704
|
+
return h;
|
|
1705
|
+
var m = h[Symbol.toPrimitive];
|
|
1706
|
+
if (m !== void 0) {
|
|
1707
|
+
var w = m.call(h, p);
|
|
1708
|
+
if (kt(w) !== "object")
|
|
2131
1709
|
return w;
|
|
2132
1710
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2133
1711
|
}
|
|
2134
|
-
return String(
|
|
2135
|
-
}(t.key, "string"),
|
|
1712
|
+
return String(h);
|
|
1713
|
+
}(t.key, "string"), kt(s) === "symbol" ? s : String(s)), t);
|
|
2136
1714
|
}
|
|
2137
|
-
var
|
|
1715
|
+
var s;
|
|
2138
1716
|
}
|
|
2139
|
-
var
|
|
1717
|
+
var Te = P(), ht = function(r) {
|
|
2140
1718
|
return typeof r == "function" ? r : function() {
|
|
2141
1719
|
return r;
|
|
2142
1720
|
};
|
|
2143
|
-
},
|
|
1721
|
+
}, X = function() {
|
|
2144
1722
|
function r(t) {
|
|
2145
|
-
if (function(
|
|
2146
|
-
if (!(
|
|
1723
|
+
if (function(h, p) {
|
|
1724
|
+
if (!(h instanceof p))
|
|
2147
1725
|
throw new TypeError("Cannot call a class as a function");
|
|
2148
1726
|
}(this, r), this.props = { overflow: "ellipsis", lineclamp: null, align: "left", wordBreak: null, valign: "top", width: function() {
|
|
2149
1727
|
return 1 / 0;
|
|
@@ -2152,85 +1730,85 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2152
1730
|
}, x: function() {
|
|
2153
1731
|
return 0;
|
|
2154
1732
|
}, font: null, tAnchor: 0, parser: r.defaultparser }, t)
|
|
2155
|
-
for (var
|
|
2156
|
-
typeof this[
|
|
1733
|
+
for (var s in t)
|
|
1734
|
+
typeof this[s] == "function" && this[s](t[s]);
|
|
2157
1735
|
}
|
|
2158
|
-
var n,
|
|
2159
|
-
return n = r,
|
|
2160
|
-
var
|
|
1736
|
+
var n, a;
|
|
1737
|
+
return n = r, a = [{ key: "linebreak", value: function(t) {
|
|
1738
|
+
var s = this, h = this.props.parser(String(t)), p = this.font(), m = function(w, b, A) {
|
|
2161
1739
|
if (!w.length)
|
|
2162
1740
|
return [];
|
|
2163
|
-
var
|
|
2164
|
-
if (!
|
|
1741
|
+
var R = b.height(), k = b.width(), O = b.overflowLine(), j = b.overflowWrap(), U = P(A, !0, !1), M = isFinite(R()) ? Math.floor(R() / A.height) : 1 / 0;
|
|
1742
|
+
if (!R() && !k(0) || !M)
|
|
2165
1743
|
return [];
|
|
2166
|
-
for (var
|
|
2167
|
-
var
|
|
2168
|
-
if (
|
|
2169
|
-
if (
|
|
2170
|
-
z = 0, J = [],
|
|
2171
|
-
else if (
|
|
2172
|
-
J.push({ index:
|
|
2173
|
-
else if (
|
|
2174
|
-
z +=
|
|
1744
|
+
for (var I = 0, W = 0, z = 0, et = [], J = [], V = !1; I < w.length && W < M; ) {
|
|
1745
|
+
var F = w[I], nt = Ae(F, A);
|
|
1746
|
+
if (F.width = N(F, nt), F.font = nt, F.line = W, F.whitespace = F.value in S, F.value && (F.value = F.value.replace(qe, " ")), !(!z && F.whitespace || V && F.whitespace))
|
|
1747
|
+
if (F instanceof G)
|
|
1748
|
+
z = 0, J = [], et.push(I + 1), W++;
|
|
1749
|
+
else if (F instanceof lt || F instanceof ut)
|
|
1750
|
+
J.push({ index: I, width: z });
|
|
1751
|
+
else if (F.whitespace || z + F.width < k(W))
|
|
1752
|
+
z += F.width;
|
|
2175
1753
|
else if (J.length) {
|
|
2176
|
-
var
|
|
1754
|
+
var rt = void 0, ft = void 0;
|
|
2177
1755
|
do {
|
|
2178
|
-
|
|
2179
|
-
var
|
|
2180
|
-
|
|
2181
|
-
} while (!
|
|
2182
|
-
|
|
2183
|
-
} else if (
|
|
2184
|
-
var
|
|
2185
|
-
if (z +
|
|
2186
|
-
var
|
|
1756
|
+
ft = !0, rt = J.pop();
|
|
1757
|
+
var bt = w[rt.index], ct = void 0;
|
|
1758
|
+
bt instanceof ut && (ct = N("-", bt.font), rt.width + ct > k(W) && (ft = !J.length));
|
|
1759
|
+
} while (!ft);
|
|
1760
|
+
et.push(rt.index + 1), z = 0, W++, I = rt.index, J = [];
|
|
1761
|
+
} else if (j === "break-word") {
|
|
1762
|
+
var gt = k(W);
|
|
1763
|
+
if (z + F.width > gt) {
|
|
1764
|
+
var Mt = F.clone();
|
|
2187
1765
|
do
|
|
2188
|
-
|
|
2189
|
-
while (
|
|
2190
|
-
|
|
1766
|
+
F.value = F.value.slice(0, -1), F.width = N(F, F.font), z += F.width;
|
|
1767
|
+
while (F.value && F.width > gt);
|
|
1768
|
+
Mt.value = Mt.value.slice(F.value.length), w.splice(I + 1, 0, new lt(), Mt);
|
|
2191
1769
|
}
|
|
2192
|
-
|
|
1770
|
+
et.push(I + 1), z = 0, W++;
|
|
2193
1771
|
} else
|
|
2194
|
-
z +=
|
|
2195
|
-
|
|
1772
|
+
z += F.width;
|
|
1773
|
+
I++, V = F.whitespace;
|
|
2196
1774
|
}
|
|
2197
|
-
|
|
2198
|
-
var
|
|
2199
|
-
for (var
|
|
2200
|
-
|
|
2201
|
-
for (var
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
var
|
|
2205
|
-
return
|
|
1775
|
+
I !== et[et.length - 1] && et.push(I);
|
|
1776
|
+
var le = 0, pt = 0, Z = et.map(function(Tt) {
|
|
1777
|
+
for (var Q, St = le; (Q = w[St]) && (Q.whitespace || !Q.value); )
|
|
1778
|
+
St++;
|
|
1779
|
+
for (var wt = Tt, Qe = null; wt > St && (Q = w[wt - 1]) && (Q.whitespace || !(Q.value || Q instanceof ut)); )
|
|
1780
|
+
Q instanceof G && (Qe = Q), wt--;
|
|
1781
|
+
Q instanceof ut && (Q.value = "-", Q.width = N("-", Q.font)), le = Tt;
|
|
1782
|
+
var zt = w.slice(St, wt).filter(function(tr) {
|
|
1783
|
+
return tr.value;
|
|
2206
1784
|
});
|
|
2207
|
-
return
|
|
2208
|
-
return
|
|
2209
|
-
}, 0),
|
|
1785
|
+
return Qe && zt.push(Qe), zt.width = zt.reduce(function(tr, Vr) {
|
|
1786
|
+
return tr + Vr.width;
|
|
1787
|
+
}, 0), zt.width > pt && (pt = zt.width), zt;
|
|
2210
1788
|
});
|
|
2211
|
-
if (
|
|
2212
|
-
var
|
|
2213
|
-
|
|
2214
|
-
var
|
|
2215
|
-
if (
|
|
2216
|
-
var
|
|
2217
|
-
|
|
1789
|
+
if (Z.hasLineOverflow = !1, O) {
|
|
1790
|
+
var Pe = O === "ellipsis" ? "…" : O;
|
|
1791
|
+
Z.forEach(function(Tt, Q) {
|
|
1792
|
+
var St = k(Q);
|
|
1793
|
+
if (Tt.width > St) {
|
|
1794
|
+
var wt = new D(Pe);
|
|
1795
|
+
wt.font = A, wt.width = N(Pe, U), ee(Tt, St, wt), Z.hasLineOverflow = !0;
|
|
2218
1796
|
}
|
|
2219
1797
|
});
|
|
2220
1798
|
}
|
|
2221
|
-
var
|
|
2222
|
-
if (
|
|
2223
|
-
var
|
|
2224
|
-
|
|
1799
|
+
var q = b.overflow() === "ellipsis" ? "…" : b.overflow();
|
|
1800
|
+
if (q && I !== w.length) {
|
|
1801
|
+
var K = k(Z.length - 1), Re = Z[Z.length - 1], ue = new D(q);
|
|
1802
|
+
ue.font = A, ue.width = N(q, U), ee(Re, K, ue), Z.hasOverflow = !0;
|
|
2225
1803
|
} else
|
|
2226
|
-
|
|
2227
|
-
return
|
|
2228
|
-
}(
|
|
2229
|
-
return
|
|
2230
|
-
return
|
|
2231
|
-
},
|
|
1804
|
+
Z.hasOverflow = !1;
|
|
1805
|
+
return Z.font = A, Z.width = pt, Z;
|
|
1806
|
+
}(h, this, p);
|
|
1807
|
+
return m.height = m.length * p.height, m.render = function(w) {
|
|
1808
|
+
return s.render(m, w);
|
|
1809
|
+
}, m.svg = m.render, m.draw = m.render, m;
|
|
2232
1810
|
} }, { key: "font", value: function(t) {
|
|
2233
|
-
return arguments.length ? (this.props.font = P(t), this) : this.props.font || P(
|
|
1811
|
+
return arguments.length ? (this.props.font = P(t), this) : this.props.font || P(Te);
|
|
2234
1812
|
} }, { key: "overflow", value: function(t) {
|
|
2235
1813
|
return arguments.length ? (this.props.overflow = String(t), this) : this.props.overflow;
|
|
2236
1814
|
} }, { key: "overflowLine", value: function(t) {
|
|
@@ -2240,25 +1818,25 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2240
1818
|
} }, { key: "align", value: function(t) {
|
|
2241
1819
|
if (!arguments.length)
|
|
2242
1820
|
return this.props.align;
|
|
2243
|
-
var
|
|
2244
|
-
return
|
|
1821
|
+
var s = String(t).toLowerCase();
|
|
1822
|
+
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;
|
|
2245
1823
|
} }, { key: "overflowWrap", value: function(t) {
|
|
2246
1824
|
if (!arguments.length)
|
|
2247
1825
|
return this.props.overflowWrap || "normal";
|
|
2248
|
-
var
|
|
2249
|
-
return
|
|
1826
|
+
var s = String(t).toLowerCase();
|
|
1827
|
+
return s === "break-word" ? this.props.overflowWrap = "break-word" : s !== "normal" && t != null || (this.props.overflowWrap = null), this;
|
|
2250
1828
|
} }, { key: "width", value: function(t) {
|
|
2251
|
-
return arguments.length ? (this.props.width =
|
|
1829
|
+
return arguments.length ? (this.props.width = ht(t), this) : this.props.width;
|
|
2252
1830
|
} }, { key: "height", value: function(t) {
|
|
2253
|
-
return arguments.length ? (this.props.height =
|
|
1831
|
+
return arguments.length ? (this.props.height = ht(t), this) : this.props.height;
|
|
2254
1832
|
} }, { key: "x", value: function(t) {
|
|
2255
|
-
return arguments.length ? (this.props.x =
|
|
1833
|
+
return arguments.length ? (this.props.x = ht(t), this) : this.props.x;
|
|
2256
1834
|
} }, { key: "parser", value: function(t) {
|
|
2257
1835
|
if (!arguments.length)
|
|
2258
1836
|
return this.props.parser;
|
|
2259
1837
|
if (typeof t == "string") {
|
|
2260
|
-
var
|
|
2261
|
-
typeof
|
|
1838
|
+
var s = r[t] || r[t + "parser"];
|
|
1839
|
+
typeof s == "function" && (t = s);
|
|
2262
1840
|
}
|
|
2263
1841
|
if (typeof t != "function")
|
|
2264
1842
|
throw new Error("Unknown parser: " + t);
|
|
@@ -2266,310 +1844,310 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2266
1844
|
} }, { key: "createElement", value: function(t) {
|
|
2267
1845
|
return arguments.length ? (this.props.createElement = t, this) : this.props.createElement || r.createElement;
|
|
2268
1846
|
} }, { key: "render", value: function() {
|
|
2269
|
-
var t =
|
|
2270
|
-
return typeof t.text == "string" && (t.text = this.linebreak(t.text)), t.ctx ?
|
|
2271
|
-
} }],
|
|
1847
|
+
var t = ke(arguments);
|
|
1848
|
+
return typeof t.text == "string" && (t.text = this.linebreak(t.text)), t.ctx ? Xe(t.text, this, t.ctx) : Ye(t.text, this);
|
|
1849
|
+
} }], a && oe(n.prototype, a), Object.defineProperty(n, "prototype", { writable: !1 }), r;
|
|
2272
1850
|
}();
|
|
2273
|
-
function
|
|
2274
|
-
return
|
|
1851
|
+
function dt(r) {
|
|
1852
|
+
return dt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
|
|
2275
1853
|
return typeof n;
|
|
2276
1854
|
} : function(n) {
|
|
2277
1855
|
return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
|
|
2278
|
-
},
|
|
1856
|
+
}, dt(r);
|
|
2279
1857
|
}
|
|
2280
|
-
function
|
|
1858
|
+
function jt(r, n) {
|
|
2281
1859
|
(n == null || n > r.length) && (n = r.length);
|
|
2282
|
-
for (var
|
|
2283
|
-
t[
|
|
1860
|
+
for (var a = 0, t = new Array(n); a < n; a++)
|
|
1861
|
+
t[a] = r[a];
|
|
2284
1862
|
return t;
|
|
2285
1863
|
}
|
|
2286
|
-
function
|
|
2287
|
-
for (var
|
|
2288
|
-
var t = n[
|
|
2289
|
-
t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(r, (
|
|
2290
|
-
if (
|
|
2291
|
-
return
|
|
2292
|
-
var
|
|
2293
|
-
if (
|
|
2294
|
-
var w =
|
|
2295
|
-
if (
|
|
1864
|
+
function Je(r, n) {
|
|
1865
|
+
for (var a = 0; a < n.length; a++) {
|
|
1866
|
+
var t = n[a];
|
|
1867
|
+
t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(r, (s = function(h, p) {
|
|
1868
|
+
if (dt(h) !== "object" || h === null)
|
|
1869
|
+
return h;
|
|
1870
|
+
var m = h[Symbol.toPrimitive];
|
|
1871
|
+
if (m !== void 0) {
|
|
1872
|
+
var w = m.call(h, p);
|
|
1873
|
+
if (dt(w) !== "object")
|
|
2296
1874
|
return w;
|
|
2297
1875
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2298
1876
|
}
|
|
2299
|
-
return String(
|
|
2300
|
-
}(t.key, "string"),
|
|
1877
|
+
return String(h);
|
|
1878
|
+
}(t.key, "string"), dt(s) === "symbol" ? s : String(s)), t);
|
|
2301
1879
|
}
|
|
2302
|
-
var
|
|
1880
|
+
var s;
|
|
2303
1881
|
}
|
|
2304
|
-
var
|
|
1882
|
+
var se = function(r) {
|
|
2305
1883
|
return typeof r == "function" ? r : function() {
|
|
2306
1884
|
return r;
|
|
2307
1885
|
};
|
|
2308
|
-
},
|
|
1886
|
+
}, Se = function() {
|
|
2309
1887
|
function r(t) {
|
|
2310
|
-
if (function(
|
|
2311
|
-
if (!(
|
|
1888
|
+
if (function(h, p) {
|
|
1889
|
+
if (!(h instanceof p))
|
|
2312
1890
|
throw new TypeError("Cannot call a class as a function");
|
|
2313
1891
|
}(this, r), this.props = { width: function() {
|
|
2314
1892
|
return 1 / 0;
|
|
2315
1893
|
}, height: function() {
|
|
2316
1894
|
return 1 / 0;
|
|
2317
1895
|
}, rotation: 0, vAnchor: 0, hAnchor: 0 }, t)
|
|
2318
|
-
for (var
|
|
2319
|
-
typeof this[
|
|
1896
|
+
for (var s in t)
|
|
1897
|
+
typeof this[s] == "function" && this[s](t[s]);
|
|
2320
1898
|
this.render = this.render.bind(this);
|
|
2321
1899
|
}
|
|
2322
|
-
var n,
|
|
2323
|
-
return n = r,
|
|
2324
|
-
var
|
|
1900
|
+
var n, a;
|
|
1901
|
+
return n = r, a = [{ key: "anchor", value: function(t) {
|
|
1902
|
+
var s = this.props, h = s.hAnchor, p = s.vAnchor, m = s.width, w = s.height;
|
|
2325
1903
|
if (!arguments.length)
|
|
2326
|
-
return [
|
|
1904
|
+
return [h * m(0), p * w(0)];
|
|
2327
1905
|
if (typeof t == "string") {
|
|
2328
1906
|
var b = this.props;
|
|
2329
|
-
t.toLowerCase().trim().split(/\s+/).forEach(function(
|
|
2330
|
-
|
|
1907
|
+
t.toLowerCase().trim().split(/\s+/).forEach(function(A) {
|
|
1908
|
+
A === "top" && (b.vAnchor = -0), A === "middle" && (b.vAnchor = -0.5), A === "bottom" && (b.vAnchor = -1), A === "left" && (b.hAnchor = -0), A === "center" && (b.hAnchor = -0.5), A === "right" && (b.hAnchor = -1);
|
|
2331
1909
|
});
|
|
2332
1910
|
}
|
|
2333
1911
|
return this;
|
|
2334
1912
|
} }, { key: "width", value: function(t) {
|
|
2335
|
-
return arguments.length ? (this.props.width =
|
|
1913
|
+
return arguments.length ? (this.props.width = se(t), this) : this.props.width;
|
|
2336
1914
|
} }, { key: "height", value: function(t) {
|
|
2337
|
-
return arguments.length ? (this.props.height =
|
|
1915
|
+
return arguments.length ? (this.props.height = se(t), this) : this.props.height;
|
|
2338
1916
|
} }, { key: "rotate", value: function(t) {
|
|
2339
1917
|
return arguments.length ? (this.props.rotation = t, this) : this.props.rotation;
|
|
2340
1918
|
} }, { key: "createElement", value: function(t) {
|
|
2341
1919
|
return arguments.length ? (this.props.createElement = t, this) : this.props.createElement || r.createElement;
|
|
2342
|
-
} }, { key: "canvas", value: function(t,
|
|
2343
|
-
var
|
|
2344
|
-
return
|
|
2345
|
-
if (Array.isArray(
|
|
2346
|
-
return
|
|
2347
|
-
}(
|
|
2348
|
-
if (typeof Symbol < "u" &&
|
|
2349
|
-
return Array.from(
|
|
2350
|
-
}(
|
|
2351
|
-
if (
|
|
2352
|
-
if (typeof
|
|
2353
|
-
return
|
|
2354
|
-
var b = Object.prototype.toString.call(
|
|
2355
|
-
return b === "Object" &&
|
|
1920
|
+
} }, { key: "canvas", value: function(t, s) {
|
|
1921
|
+
var h, p = t.getContext ? t.getContext("2d") : t;
|
|
1922
|
+
return p.save(), p.rotate(this.rotate() * Math.PI / 180), p.translate.apply(p, function(m) {
|
|
1923
|
+
if (Array.isArray(m))
|
|
1924
|
+
return jt(m);
|
|
1925
|
+
}(h = this.anchor()) || function(m) {
|
|
1926
|
+
if (typeof Symbol < "u" && m[Symbol.iterator] != null || m["@@iterator"] != null)
|
|
1927
|
+
return Array.from(m);
|
|
1928
|
+
}(h) || function(m, w) {
|
|
1929
|
+
if (m) {
|
|
1930
|
+
if (typeof m == "string")
|
|
1931
|
+
return jt(m, w);
|
|
1932
|
+
var b = Object.prototype.toString.call(m).slice(8, -1);
|
|
1933
|
+
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) ? jt(m, w) : void 0;
|
|
2356
1934
|
}
|
|
2357
|
-
}(
|
|
1935
|
+
}(h) || function() {
|
|
2358
1936
|
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2359
1937
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
2360
|
-
}()),
|
|
1938
|
+
}()), s(p), p.restore(), p;
|
|
2361
1939
|
} }, { key: "render", value: function() {
|
|
2362
|
-
var t =
|
|
1940
|
+
var t = ke(arguments);
|
|
2363
1941
|
if (t.d3)
|
|
2364
1942
|
return t.d3.attr("transform", "rotate(".concat(this.rotate(), ") translate(").concat(this.anchor(), ")"));
|
|
2365
1943
|
if (t.ctx)
|
|
2366
1944
|
return this.canvas(t.ctx, t.fn);
|
|
2367
1945
|
if (t.text) {
|
|
2368
|
-
var
|
|
2369
|
-
return this.createElement()("g", { transform: "rotate(".concat(this.rotate(), ") translate(").concat(this.anchor(), ")") },
|
|
1946
|
+
var s = typeof t.text.render == "function" ? t.text.render() : t.text;
|
|
1947
|
+
return this.createElement()("g", { transform: "rotate(".concat(this.rotate(), ") translate(").concat(this.anchor(), ")") }, s);
|
|
2370
1948
|
}
|
|
2371
|
-
} }],
|
|
2372
|
-
}(),
|
|
2373
|
-
function
|
|
2374
|
-
return Dt[r] || (Dt[r] = r.replace(/([a-z])([A-Z])/g, function(n,
|
|
2375
|
-
return
|
|
1949
|
+
} }], a && Je(n.prototype, a), Object.defineProperty(n, "prototype", { writable: !1 }), r;
|
|
1950
|
+
}(), Ce = Object.prototype.hasOwnProperty, Dt = {};
|
|
1951
|
+
function Ze(r) {
|
|
1952
|
+
return Dt[r] || (Dt[r] = r.replace(/([a-z])([A-Z])/g, function(n, a, t) {
|
|
1953
|
+
return a + "-" + t.toLowerCase();
|
|
2376
1954
|
})), Dt[r];
|
|
2377
1955
|
}
|
|
2378
|
-
function
|
|
1956
|
+
function Oe(r, n) {
|
|
2379
1957
|
if (Array.isArray(n))
|
|
2380
|
-
return n.forEach(function(
|
|
2381
|
-
return
|
|
1958
|
+
return n.forEach(function(a) {
|
|
1959
|
+
return Oe(r, a);
|
|
2382
1960
|
});
|
|
2383
1961
|
typeof n == "string" && (n = document.createTextNode(n)), r.appendChild(n);
|
|
2384
1962
|
}
|
|
2385
|
-
function
|
|
1963
|
+
function ae(r, n) {
|
|
2386
1964
|
if (typeof document < "u") {
|
|
2387
|
-
var
|
|
2388
|
-
if (n &&
|
|
1965
|
+
var a = typeof r == "string" ? document.createElementNS("http://www.w3.org/2000/svg", r) : r;
|
|
1966
|
+
if (n && a.setAttribute)
|
|
2389
1967
|
for (var t in n)
|
|
2390
|
-
|
|
2391
|
-
for (var
|
|
2392
|
-
|
|
2393
|
-
return
|
|
2394
|
-
|
|
2395
|
-
}),
|
|
1968
|
+
Ce.call(n, t) && n[t] != null && a.setAttribute(t === "className" ? "class" : Ze(t), n[t]);
|
|
1969
|
+
for (var s = arguments.length, h = new Array(s > 2 ? s - 2 : 0), p = 2; p < s; p++)
|
|
1970
|
+
h[p - 2] = arguments[p];
|
|
1971
|
+
return h != null && h.length && h.forEach(function(m) {
|
|
1972
|
+
Oe(a, m);
|
|
1973
|
+
}), a;
|
|
2396
1974
|
}
|
|
2397
1975
|
}
|
|
2398
|
-
|
|
1976
|
+
X.createElement = ae, X.textparser = At, X.defaultparser = At, X.htmlparser = function(r) {
|
|
2399
1977
|
r = String(r || "").trim();
|
|
2400
|
-
for (var n,
|
|
2401
|
-
for (var
|
|
2402
|
-
t[
|
|
2403
|
-
|
|
2404
|
-
},
|
|
2405
|
-
var
|
|
2406
|
-
if (
|
|
2407
|
-
for (var
|
|
2408
|
-
|
|
2409
|
-
for (;
|
|
2410
|
-
|
|
2411
|
-
for (;
|
|
2412
|
-
|
|
1978
|
+
for (var n, a, t = { weight: null, style: null, sub: !1, sup: !1, href: null, color: null, rel: null, target: null }, s = [], h = [], p = function(R) {
|
|
1979
|
+
for (var k in t)
|
|
1980
|
+
t[k] && (R[k] = t[k]);
|
|
1981
|
+
s.push(R);
|
|
1982
|
+
}, m = function(R) {
|
|
1983
|
+
var k = s.length, O = Be[R];
|
|
1984
|
+
if (k && O) {
|
|
1985
|
+
for (var j = k - 1; s[j] && (s[j] instanceof lt || Ne.test(s[j].value)); )
|
|
1986
|
+
j--;
|
|
1987
|
+
for (; O && s[j] && s[j] instanceof G; )
|
|
1988
|
+
j--, O--;
|
|
1989
|
+
for (; O-- > 0; )
|
|
1990
|
+
s.push(new G());
|
|
2413
1991
|
}
|
|
2414
1992
|
}; r.length; ) {
|
|
2415
1993
|
if (n = /^[^<]+/.exec(r))
|
|
2416
|
-
|
|
1994
|
+
At(Qt(n[0]), !1).forEach(p);
|
|
2417
1995
|
else if (!(n = It.exec(r)))
|
|
2418
|
-
if (n =
|
|
2419
|
-
|
|
2420
|
-
else if (n =
|
|
1996
|
+
if (n = Jt.exec(r))
|
|
1997
|
+
h.length && (t = h.pop()), m(n[1]);
|
|
1998
|
+
else if (n = Zt.exec(r)) {
|
|
2421
1999
|
var w = n[1];
|
|
2422
|
-
|
|
2423
|
-
var b =
|
|
2424
|
-
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 && (
|
|
2000
|
+
m(w), h.push(t), t = Object.create(t), Et[w] && Et[w](t, "");
|
|
2001
|
+
var b = Lt(n[2]);
|
|
2002
|
+
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 G());
|
|
2425
2003
|
} else
|
|
2426
|
-
n = [r.slice(0, 1)],
|
|
2004
|
+
n = [r.slice(0, 1)], p(new D(n[0]));
|
|
2427
2005
|
r = r.slice(n[0].length);
|
|
2428
2006
|
}
|
|
2429
|
-
for (var
|
|
2430
|
-
|
|
2431
|
-
return
|
|
2432
|
-
},
|
|
2007
|
+
for (var A = s[s.length - 1]; A instanceof G; )
|
|
2008
|
+
s.pop(), A = s[s.length - 1];
|
|
2009
|
+
return s;
|
|
2010
|
+
}, X.latexparser = function(r) {
|
|
2433
2011
|
r = String(r || "").trim();
|
|
2434
2012
|
var n = [0];
|
|
2435
|
-
r = r.replace(/\\verb,(.*?),/, function(
|
|
2436
|
-
return n.push(
|
|
2013
|
+
r = r.replace(/\\verb,(.*?),/, function(M, I) {
|
|
2014
|
+
return n.push(I), "\\verb," + (n.length - 1) + ",";
|
|
2437
2015
|
}).replace(/\\\\\n/g, function() {
|
|
2438
2016
|
return "\\\\";
|
|
2439
|
-
}).replace(
|
|
2440
|
-
return W.charAt(
|
|
2441
|
-
}).replace(/\n\s+/g, function(
|
|
2442
|
-
return /\n/.test(
|
|
2443
|
-
}).replace(/\\symbol\{(\d+)\}/, function(
|
|
2444
|
-
return z.charAt(W - 1) === "\\" ?
|
|
2445
|
-
}).replace(/(^|[^\\])(\^|_)(\d|[^{]\S*)/g, function(
|
|
2446
|
-
return
|
|
2447
|
-
}).replace(/\\verb,(.*?),/, function(
|
|
2448
|
-
return "\\verb,".concat(n[+
|
|
2017
|
+
}).replace(Ve, function(M, I, W) {
|
|
2018
|
+
return W.charAt(I - 1) === "\\" ? M : te[M];
|
|
2019
|
+
}).replace(/\n\s+/g, function(M) {
|
|
2020
|
+
return /\n/.test(M.slice(1)) ? "\\par " : M;
|
|
2021
|
+
}).replace(/\\symbol\{(\d+)\}/, function(M, I, W, z) {
|
|
2022
|
+
return z.charAt(W - 1) === "\\" ? M : String.fromCharCode(1 * I);
|
|
2023
|
+
}).replace(/(^|[^\\])(\^|_)(\d|[^{]\S*)/g, function(M, I, W, z) {
|
|
2024
|
+
return I + W + "{" + z + "}";
|
|
2025
|
+
}).replace(/\\verb,(.*?),/, function(M, I) {
|
|
2026
|
+
return "\\verb,".concat(n[+I], ",");
|
|
2449
2027
|
});
|
|
2450
|
-
for (var
|
|
2451
|
-
for (var
|
|
2452
|
-
t[
|
|
2453
|
-
return
|
|
2454
|
-
},
|
|
2455
|
-
|
|
2028
|
+
for (var a, t = { weight: null, italic: null, variant: null, sub: !1, sup: !1, href: null }, s = [], h = [], p = function(M) {
|
|
2029
|
+
for (var I in t)
|
|
2030
|
+
t[I] && (M[I] = t[I]);
|
|
2031
|
+
return s.push(M), M;
|
|
2032
|
+
}, m = function() {
|
|
2033
|
+
h.push(t), t = Object.create(t);
|
|
2456
2034
|
}, w = function() {
|
|
2457
|
-
if (!
|
|
2035
|
+
if (!h.length)
|
|
2458
2036
|
throw new Error("Unexpected }");
|
|
2459
|
-
t =
|
|
2460
|
-
}, b = { tokens:
|
|
2461
|
-
if (
|
|
2462
|
-
|
|
2463
|
-
else if (
|
|
2464
|
-
|
|
2465
|
-
else if (!(
|
|
2466
|
-
if (
|
|
2467
|
-
|
|
2468
|
-
else if (
|
|
2037
|
+
t = h.pop();
|
|
2038
|
+
}, b = { tokens: s, open_context: m, close_context: w, add_token: p }; r.length; ) {
|
|
2039
|
+
if (a = Ft.exec(r))
|
|
2040
|
+
At(a[0], !1).forEach(p);
|
|
2041
|
+
else if (a = We.exec(r))
|
|
2042
|
+
p(new D(a[1]));
|
|
2043
|
+
else if (!(a = xe.exec(r))) {
|
|
2044
|
+
if (a = /^\{/.exec(r))
|
|
2045
|
+
m();
|
|
2046
|
+
else if (a = /^\}/.exec(r))
|
|
2469
2047
|
w();
|
|
2470
|
-
else if (!(
|
|
2471
|
-
if (
|
|
2472
|
-
|
|
2473
|
-
else if (
|
|
2474
|
-
var
|
|
2475
|
-
if (/^(La)?TeX$/i.test(
|
|
2476
|
-
|
|
2477
|
-
var
|
|
2478
|
-
|
|
2479
|
-
} else if (
|
|
2480
|
-
|
|
2481
|
-
else if (
|
|
2482
|
-
var
|
|
2483
|
-
if (
|
|
2484
|
-
for (
|
|
2048
|
+
else if (!(a = /^\$/.exec(r)))
|
|
2049
|
+
if (a = /^\\verb,([^,]+),/.exec(r))
|
|
2050
|
+
p(new D(a[1]));
|
|
2051
|
+
else if (a = we.exec(r)) {
|
|
2052
|
+
var A = a[1].slice(1) || a[1], R = !!a[2];
|
|
2053
|
+
if (/^(La)?TeX$/i.test(A)) {
|
|
2054
|
+
m(), t.family = "serif";
|
|
2055
|
+
var k = void 0;
|
|
2056
|
+
A === "LaTeX" && ((k = p(new D("L"))).tracking = -0.25, (k = p(new D("A"))).size = 0.7, k.baseline = 0.3, k.tracking = -0.1), (k = p(new D("T"))).tracking = -0.17, (k = p(new D("E"))).baseline = -0.22, k.tracking = -0.13, k = p(new D("X")), w();
|
|
2057
|
+
} else if (A in _t)
|
|
2058
|
+
p(new D(_t[A])), R && m();
|
|
2059
|
+
else if (A in H) {
|
|
2060
|
+
var O = [], j = H[A].length - 1, U = void 0;
|
|
2061
|
+
if (j) {
|
|
2062
|
+
for (R = !1, r = r.slice(a[0].length - 1); j--; ) {
|
|
2485
2063
|
if (!(U = /^\{([^}]+)\}/.exec(r)))
|
|
2486
|
-
throw new Error(
|
|
2487
|
-
|
|
2064
|
+
throw new Error(A + " is missing an argument");
|
|
2065
|
+
O.push(U[1]), r = r.slice(U[0].length);
|
|
2488
2066
|
}
|
|
2489
|
-
|
|
2067
|
+
a[0] = /^\{/.exec(r) ? "{" : "", R = !!a[0];
|
|
2490
2068
|
}
|
|
2491
|
-
|
|
2069
|
+
R && m(), H[A].apply(b, [t].concat(O));
|
|
2492
2070
|
} else
|
|
2493
|
-
console.warn("unknown latex command",
|
|
2071
|
+
console.warn("unknown latex command", A), p(new D(a[1])), R && m();
|
|
2494
2072
|
} else
|
|
2495
|
-
|
|
2073
|
+
a = [r.slice(0, 1)], p(new D(a[0]));
|
|
2496
2074
|
}
|
|
2497
|
-
r = r.slice(
|
|
2075
|
+
r = r.slice(a[0].length);
|
|
2498
2076
|
}
|
|
2499
|
-
return
|
|
2500
|
-
},
|
|
2501
|
-
return
|
|
2502
|
-
},
|
|
2503
|
-
const
|
|
2077
|
+
return s;
|
|
2078
|
+
}, X.measureText = function(r, n, a) {
|
|
2079
|
+
return N(r, P(n), a);
|
|
2080
|
+
}, X.Token = D, X.Break = lt, X.LineBreak = G, X.SoftHyphen = ut, X.Rotator = Se, Se.createElement = ae;
|
|
2081
|
+
const Ke = X;
|
|
2504
2082
|
return i.default;
|
|
2505
2083
|
})());
|
|
2506
|
-
})(
|
|
2507
|
-
var
|
|
2508
|
-
const
|
|
2509
|
-
function
|
|
2510
|
-
return
|
|
2084
|
+
})(Hr);
|
|
2085
|
+
var vn = Hr.exports;
|
|
2086
|
+
const xr = /* @__PURE__ */ Mr(vn);
|
|
2087
|
+
function nr(u) {
|
|
2088
|
+
return u.replace(/…$/, "");
|
|
2511
2089
|
}
|
|
2512
|
-
function
|
|
2513
|
-
return
|
|
2090
|
+
function ir(u) {
|
|
2091
|
+
return u.children[0].innerHTML;
|
|
2514
2092
|
}
|
|
2515
|
-
function
|
|
2516
|
-
const
|
|
2517
|
-
if (
|
|
2093
|
+
function mn(u, e) {
|
|
2094
|
+
const o = mt(u), { fontSize: i, font: l, padding: c = 0 } = u.properties.style || {};
|
|
2095
|
+
if (o.width === o.height && o.width === 0)
|
|
2518
2096
|
return;
|
|
2519
|
-
const
|
|
2520
|
-
font: `${i}px/${i}px ${
|
|
2521
|
-
width:
|
|
2522
|
-
height:
|
|
2097
|
+
const f = new xr({
|
|
2098
|
+
font: `${i}px/${i}px ${l}`.replace(/(px)+/g, "px"),
|
|
2099
|
+
width: o.width - c * 2,
|
|
2100
|
+
height: o.height - c * 2,
|
|
2523
2101
|
align: "left",
|
|
2524
2102
|
valign: "top",
|
|
2525
2103
|
x: 0,
|
|
2526
2104
|
overflow: "ellipsis",
|
|
2527
2105
|
parser: "html",
|
|
2528
|
-
createElement:
|
|
2106
|
+
createElement: xr.createElement
|
|
2529
2107
|
});
|
|
2530
|
-
|
|
2531
|
-
const
|
|
2532
|
-
|
|
2108
|
+
f.overflowWrap("break-word");
|
|
2109
|
+
const g = f.linebreak(
|
|
2110
|
+
u.properties.content.replaceAll(`
|
|
2533
2111
|
`, "<br>")
|
|
2534
|
-
).render(),
|
|
2535
|
-
let
|
|
2536
|
-
const
|
|
2537
|
-
|
|
2538
|
-
`).forEach((
|
|
2539
|
-
let P =
|
|
2540
|
-
for (; P.length &&
|
|
2541
|
-
if (
|
|
2112
|
+
).render(), d = [...g.children];
|
|
2113
|
+
let v = 0;
|
|
2114
|
+
const y = [];
|
|
2115
|
+
u.properties.content.split(`
|
|
2116
|
+
`).forEach((E) => {
|
|
2117
|
+
let P = E;
|
|
2118
|
+
for (; P.length && v < d.length; ) {
|
|
2119
|
+
if (d[v].innerHTML === " ") {
|
|
2542
2120
|
P.startsWith(`
|
|
2543
|
-
`) ||
|
|
2121
|
+
`) || y.push(v), v++;
|
|
2544
2122
|
break;
|
|
2545
2123
|
}
|
|
2546
|
-
const
|
|
2547
|
-
P.startsWith(
|
|
2548
|
-
}
|
|
2549
|
-
}),
|
|
2550
|
-
const
|
|
2551
|
-
|
|
2552
|
-
let P =
|
|
2553
|
-
const
|
|
2124
|
+
const S = nr(ir(d[v]));
|
|
2125
|
+
P.startsWith(S) && (P = P.slice(S.length).trim()), v++;
|
|
2126
|
+
}
|
|
2127
|
+
}), y.forEach((E) => g.removeChild(d[E]));
|
|
2128
|
+
const _ = u.properties.content.match(/(https?:\/\/.*)/gm), C = _ ? _.map((E) => E.split(" ")[0]) : [];
|
|
2129
|
+
g.setAttribute("transform", `translate(${c}, ${c})`), C.forEach((E) => {
|
|
2130
|
+
let P = E;
|
|
2131
|
+
const S = [];
|
|
2554
2132
|
for (; P.length > 0; ) {
|
|
2555
|
-
const
|
|
2556
|
-
if (
|
|
2133
|
+
const $ = d.find((T) => !!T.children[0] && T.children[0].tagName === "tspan" && P.startsWith(nr(ir(T))));
|
|
2134
|
+
if (!$)
|
|
2557
2135
|
break;
|
|
2558
|
-
|
|
2559
|
-
const
|
|
2560
|
-
if (!
|
|
2136
|
+
S.push($);
|
|
2137
|
+
const L = nr($.children[0].innerHTML).length;
|
|
2138
|
+
if (!L)
|
|
2561
2139
|
break;
|
|
2562
|
-
P = P.slice(
|
|
2140
|
+
P = P.slice(L);
|
|
2563
2141
|
}
|
|
2564
|
-
|
|
2565
|
-
const
|
|
2566
|
-
|
|
2142
|
+
S.forEach(($) => {
|
|
2143
|
+
const L = document.createElementNS("http://www.w3.org/2000/svg", "a");
|
|
2144
|
+
L.setAttribute("href", E), L.setAttribute("target", "_blank"), L.innerHTML = ir($), $.children[0].innerHTML = "", $.children[0].appendChild(L);
|
|
2567
2145
|
});
|
|
2568
|
-
}), e.appendChild(
|
|
2146
|
+
}), e.appendChild(g);
|
|
2569
2147
|
}
|
|
2570
|
-
const
|
|
2571
|
-
class
|
|
2572
|
-
constructor(e,
|
|
2148
|
+
const Ar = 20;
|
|
2149
|
+
class bn extends Br {
|
|
2150
|
+
constructor(e, o = {}) {
|
|
2573
2151
|
super(
|
|
2574
2152
|
e,
|
|
2575
2153
|
`
|
|
@@ -2585,130 +2163,126 @@ class un extends $r {
|
|
|
2585
2163
|
<textarea wrap="on"></textarea>
|
|
2586
2164
|
</div>
|
|
2587
2165
|
`
|
|
2588
|
-
), x(this, "textArea"), x(this, "handleSize"), x(this, "rect", { x: 0, y: 0, width: 0, height: 0 }), x(this, "annotation", { ...
|
|
2166
|
+
), x(this, "textArea"), x(this, "handleSize"), x(this, "rect", { x: 0, y: 0, width: 0, height: 0 }), x(this, "annotation", { ...rr }), x(this, "startX", 0), x(this, "startY", 0), x(this, "handles", []), x(this, "draggedHandle", Y), x(this, "isFocused", !1), x(this, "placeholder", "Type your text here..."), x(this, "_onFocus", () => {
|
|
2589
2167
|
this.textArea.value === this.placeholder && (this.textArea.value = ""), this.isFocused = !0;
|
|
2590
2168
|
}), x(this, "_onBlur", () => {
|
|
2591
2169
|
this.isFocused = !1;
|
|
2592
|
-
}), x(this, "startDrawing", (
|
|
2593
|
-
this.add(
|
|
2594
|
-
const
|
|
2595
|
-
this.select(
|
|
2170
|
+
}), x(this, "startDrawing", (l, c, f = yn(l, c, 0, 0, "", Wt)) => {
|
|
2171
|
+
this.add(f);
|
|
2172
|
+
const g = this.ogma.view.graphToScreenCoordinates({ x: l, y: c });
|
|
2173
|
+
this.select(f.id), this.startDragging(this.getById(f.id), g.x, g.y), this.draggedHandle = 6;
|
|
2596
2174
|
}), x(this, "cancelDrawing", () => {
|
|
2597
|
-
this.isDragging && (this.remove(this.annotation.id), this.annotation = { ...
|
|
2598
|
-
}), x(this, "startDragging", (
|
|
2599
|
-
this.annotation =
|
|
2600
|
-
const
|
|
2601
|
-
this.rect.x =
|
|
2602
|
-
}), x(this, "onHandleMouseDown", (
|
|
2175
|
+
this.isDragging && (this.remove(this.annotation.id), this.annotation = { ...rr }, this.draggedHandle = Y, this.isDragging = !1, this.emit(Vt, this.annotation));
|
|
2176
|
+
}), x(this, "startDragging", (l, c, f) => {
|
|
2177
|
+
this.annotation = l;
|
|
2178
|
+
const g = vt(this.annotation), d = mt(this.annotation);
|
|
2179
|
+
this.rect.x = g.x, this.rect.y = g.y, this.rect.width = d.width, this.rect.height = d.height, this.startX = c, this.startY = f, this.disableDragging(), this.textArea.classList.add("noevents"), this.textArea.setAttribute("disabled", "disabled"), this.emit(Me, this.annotation), this.isDragging = !0;
|
|
2180
|
+
}), x(this, "onHandleMouseDown", (l) => {
|
|
2603
2181
|
const c = this.getById(this.selectedId) || this.getById(this.hoveredId);
|
|
2604
2182
|
if (!c)
|
|
2605
2183
|
return;
|
|
2606
2184
|
this.selectedId !== c.id && this.select(this.hoveredId);
|
|
2607
|
-
const { x:
|
|
2608
|
-
this.startDragging(c,
|
|
2609
|
-
}), x(this, "onMouseMove", (
|
|
2610
|
-
requestAnimationFrame(() => this._onMouseMove(
|
|
2611
|
-
}), x(this, "_onMouseMove", (
|
|
2185
|
+
const { x: f, y: g } = sr(l, this.ogma.getContainer());
|
|
2186
|
+
this.startDragging(c, f, g), this.draggedHandle = Lr(l.target);
|
|
2187
|
+
}), x(this, "onMouseMove", (l) => {
|
|
2188
|
+
requestAnimationFrame(() => this._onMouseMove(l));
|
|
2189
|
+
}), x(this, "_onMouseMove", (l) => {
|
|
2612
2190
|
if (!this.isDragging)
|
|
2613
2191
|
return;
|
|
2614
|
-
|
|
2615
|
-
const c = this.handles[this.draggedHandle],
|
|
2616
|
-
|
|
2192
|
+
l.stopPropagation(), l.preventDefault();
|
|
2193
|
+
const c = this.handles[this.draggedHandle], f = c.classList.contains("top"), g = c.classList.contains("left"), d = c.classList.contains("right"), v = c.classList.contains("bottom"), y = c.classList.contains("line-handle"), { x: _, y: C } = sr(
|
|
2194
|
+
l,
|
|
2617
2195
|
this.ogma.getContainer()
|
|
2618
|
-
),
|
|
2619
|
-
(
|
|
2620
|
-
const
|
|
2621
|
-
this.rect.width + P * (
|
|
2622
|
-
|
|
2623
|
-
),
|
|
2624
|
-
this.rect.height +
|
|
2625
|
-
|
|
2196
|
+
), E = this.ogma.view.getZoom(), P = (_ - this.startX) / E, S = (C - this.startY) / E, $ = this.ogma.view.getAngle(), L = at({ x: P, y: S }, $);
|
|
2197
|
+
(v && g || f && d) && (L.y = 0, L.x = 0);
|
|
2198
|
+
const T = g || y ? this.rect.x + L.x : this.rect.x, B = f || y ? this.rect.y + L.y : this.rect.y, N = Math.max(
|
|
2199
|
+
this.rect.width + P * (y || g ? 0 : 1),
|
|
2200
|
+
Ar
|
|
2201
|
+
), it = Math.max(
|
|
2202
|
+
this.rect.height + S * (y || f ? 0 : 1),
|
|
2203
|
+
Ar
|
|
2626
2204
|
);
|
|
2627
|
-
|
|
2205
|
+
nn(this.annotation, T, B, N, it), this.emit(De, this.annotation, "text"), this.refreshEditor(), this.layer.refresh();
|
|
2628
2206
|
}), x(this, "onMouseUp", () => {
|
|
2629
|
-
!this.isDragging || this.draggedHandle ===
|
|
2630
|
-
}), x(this, "_onMousedown", (
|
|
2631
|
-
|
|
2207
|
+
!this.isDragging || this.draggedHandle === Y || (this.restoreDragging(), this.textArea.classList.remove("noevents"), this.textArea.removeAttribute("disabled"), this.emit(Vt, this.annotation), this.isDragging = !1, this.draggedHandle = Y);
|
|
2208
|
+
}), x(this, "_onMousedown", (l) => {
|
|
2209
|
+
l.stopPropagation();
|
|
2632
2210
|
}), x(this, "onViewChanged", () => {
|
|
2633
|
-
const
|
|
2634
|
-
document.documentElement.style.setProperty("--handle-scale", `${1 /
|
|
2211
|
+
const l = Math.max(2, this.handleSize / this.ogma.view.getZoom());
|
|
2212
|
+
document.documentElement.style.setProperty("--handle-scale", `${1 / l}`);
|
|
2635
2213
|
}), x(this, "_onInput", () => {
|
|
2636
|
-
const
|
|
2637
|
-
|
|
2638
|
-
}), this.showeditorOnHover = !1, this.handleSize =
|
|
2214
|
+
const l = this.getById(this.selectedId);
|
|
2215
|
+
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());
|
|
2216
|
+
}), this.showeditorOnHover = !1, this.handleSize = wr.handleSize, this.placeholder = wr.placeholder;
|
|
2639
2217
|
const i = this.textArea = this.editor.element.querySelector("textarea");
|
|
2640
2218
|
i.addEventListener("input", this._onInput), i.addEventListener("focus", this._onFocus), i.addEventListener("blur", this._onBlur), i.addEventListener("mousedown", this._onMousedown), i.spellcheck = !1, this.handles = Array.prototype.slice.call(
|
|
2641
2219
|
this.editor.element.querySelectorAll(".annotation-text-handle > .handle")
|
|
2642
2220
|
), this.handles.forEach(
|
|
2643
|
-
(
|
|
2221
|
+
(l) => l.addEventListener("mousedown", this.onHandleMouseDown)
|
|
2644
2222
|
), document.addEventListener("mouseup", this.onMouseUp), document.addEventListener("mousemove", this.onMouseMove, !0), e.events.on(["viewChanged", "zoom"], this.onViewChanged);
|
|
2645
2223
|
}
|
|
2646
2224
|
_canRemove() {
|
|
2647
2225
|
return !this.isFocused;
|
|
2648
2226
|
}
|
|
2649
|
-
detect({ x: e, y:
|
|
2650
|
-
const
|
|
2651
|
-
return this.elements.find((
|
|
2652
|
-
const { x:
|
|
2653
|
-
return
|
|
2227
|
+
detect({ x: e, y: o }, i = 0) {
|
|
2228
|
+
const l = { x: e, y: o }, c = this.ogma.view.getAngle();
|
|
2229
|
+
return this.elements.find((f) => {
|
|
2230
|
+
const { x: g, y: d } = vt(f), { width: v, height: y } = mt(f), _ = { x: g, y: d }, { x: C, y: E } = at(Ct(l, _), -c);
|
|
2231
|
+
return C > -i && C < v + i && E > -i && E < y + i;
|
|
2654
2232
|
});
|
|
2655
2233
|
}
|
|
2656
2234
|
draw(e) {
|
|
2657
2235
|
e.innerHTML = "";
|
|
2658
|
-
const
|
|
2659
|
-
this.elements.forEach((c,
|
|
2660
|
-
const
|
|
2661
|
-
color:
|
|
2662
|
-
fontSize:
|
|
2663
|
-
font:
|
|
2236
|
+
const o = "", i = this.ogma.view.getAngle();
|
|
2237
|
+
this.elements.forEach((c, f) => {
|
|
2238
|
+
const g = `class${f}`, d = mt(c), v = vt(c), y = c.id, {
|
|
2239
|
+
color: _,
|
|
2240
|
+
fontSize: C,
|
|
2241
|
+
font: E,
|
|
2664
2242
|
strokeColor: P,
|
|
2665
|
-
strokeWidth:
|
|
2666
|
-
strokeType:
|
|
2667
|
-
background:
|
|
2668
|
-
} = c.properties.style ||
|
|
2669
|
-
if (
|
|
2243
|
+
strokeWidth: S,
|
|
2244
|
+
strokeType: $,
|
|
2245
|
+
background: L
|
|
2246
|
+
} = c.properties.style || Wt;
|
|
2247
|
+
if (y === this.selectedId)
|
|
2670
2248
|
return;
|
|
2671
|
-
const
|
|
2672
|
-
|
|
2673
|
-
const
|
|
2674
|
-
let
|
|
2675
|
-
|
|
2676
|
-
const { x:
|
|
2677
|
-
|
|
2678
|
-
);
|
|
2679
|
-
k.setAttribute("transform", `translate(${st},${xt})`), k.classList.add(m), k.setAttribute("data-annotation", `${c.id}`), k.setAttribute("data-annotation-type", "text"), e.appendChild(k);
|
|
2249
|
+
const T = de("g");
|
|
2250
|
+
T.classList.add("annotation-text"), T.setAttribute("fill", `${_}`), T.setAttribute("font-size", `${C}px`), T.setAttribute("font-family", `${E}`);
|
|
2251
|
+
const B = de("rect");
|
|
2252
|
+
let N = !1;
|
|
2253
|
+
$ && $ !== "none" && (N = !0, B.setAttribute("stroke", P || "black"), B.setAttribute("stroke-width", `${S}`), $ === "dashed" && B.setAttribute("stroke-dasharray", "5,5")), (L && L.length || N) && (N = !0, B.setAttribute("fill", L || "transparent")), N && (B.setAttribute("width", `${d.width}`), B.setAttribute("height", `${d.height}`)), T.appendChild(B), mn(c, T);
|
|
2254
|
+
const { x: it, y: xt } = at(v, -i);
|
|
2255
|
+
T.setAttribute("transform", `translate(${it},${xt})`), T.classList.add(g), T.setAttribute("data-annotation", `${c.id}`), T.setAttribute("data-annotation-type", "text"), e.appendChild(T);
|
|
2680
2256
|
});
|
|
2681
|
-
const
|
|
2682
|
-
|
|
2257
|
+
const l = de("style");
|
|
2258
|
+
l.innerHTML = o, e.firstChild && e.insertBefore(l, e.firstChild);
|
|
2683
2259
|
}
|
|
2684
2260
|
refreshDrawing() {
|
|
2685
2261
|
const e = this.ogma.view.getAngle();
|
|
2686
|
-
[...this.layer.element.children].forEach((
|
|
2687
|
-
const i =
|
|
2262
|
+
[...this.layer.element.children].forEach((o) => {
|
|
2263
|
+
const i = o.getAttribute("data-annotation");
|
|
2688
2264
|
if (!i)
|
|
2689
2265
|
return;
|
|
2690
|
-
const
|
|
2691
|
-
|
|
2692
|
-
);
|
|
2693
|
-
a.setAttribute("transform", `translate(${c},${g})`);
|
|
2266
|
+
const l = vt(this.getById(i)), { x: c, y: f } = at(l, -e);
|
|
2267
|
+
o.setAttribute("transform", `translate(${c},${f})`);
|
|
2694
2268
|
});
|
|
2695
2269
|
}
|
|
2696
2270
|
getDefaultOptions() {
|
|
2697
|
-
return
|
|
2271
|
+
return rr;
|
|
2698
2272
|
}
|
|
2699
2273
|
refreshEditor() {
|
|
2700
2274
|
if (+this.selectedId < 0 && +this.hoveredId < 0)
|
|
2701
2275
|
return;
|
|
2702
|
-
const e = this.getById(this.selectedId) || this.getById(this.hoveredId),
|
|
2703
|
-
|
|
2704
|
-
),
|
|
2276
|
+
const e = this.getById(this.selectedId) || this.getById(this.hoveredId), o = mt(e), i = this.ogma.view.graphToScreenCoordinates(
|
|
2277
|
+
vt(e)
|
|
2278
|
+
), l = this.ogma.view.getZoom(), {
|
|
2705
2279
|
font: c,
|
|
2706
|
-
fontSize:
|
|
2707
|
-
color:
|
|
2708
|
-
background:
|
|
2709
|
-
padding:
|
|
2710
|
-
} = e.properties.style ||
|
|
2711
|
-
this.textArea.value = e.properties.content, this.editor.element.style.transform = `translate(${i.x}px, ${i.y}px)translate(-50%, -50%)translate(${
|
|
2280
|
+
fontSize: f,
|
|
2281
|
+
color: g,
|
|
2282
|
+
background: d,
|
|
2283
|
+
padding: v = 0
|
|
2284
|
+
} = e.properties.style || Wt, y = (f || 1) * l;
|
|
2285
|
+
this.textArea.value = e.properties.content, this.editor.element.style.transform = `translate(${i.x}px, ${i.y}px)translate(-50%, -50%)translate(${o.width / 2 * l}px, ${o.height / 2 * l}px)`, this.editor.element.style.width = `${o.width * l}px`, this.editor.element.style.height = `${o.height * l}px`, this.textArea.style.font = `${y} ${c}`, this.textArea.style.fontFamily = c || "sans-serif", this.textArea.style.fontSize = `${y}px`, this.textArea.style.padding = `${l * v}px`, this.textArea.style.lineHeight = `${y}px`, this.textArea.style.boxSizing = "border-box", this.textArea.style.color = g || "black", this.textArea.style.background = d || "transparent", this.textArea.placeholder = this.placeholder, this.layer.refresh();
|
|
2712
2286
|
}
|
|
2713
2287
|
select(e) {
|
|
2714
2288
|
super.select(e), this.textArea.focus();
|
|
@@ -2717,60 +2291,60 @@ class un extends $r {
|
|
|
2717
2291
|
super.destroy(), document.removeEventListener("mouseup", this.onMouseUp), document.removeEventListener("mousemove", this.onMouseMove, !0), this.ogma.events.off(this.onViewChanged);
|
|
2718
2292
|
}
|
|
2719
2293
|
}
|
|
2720
|
-
class
|
|
2294
|
+
class wn {
|
|
2721
2295
|
constructor() {
|
|
2722
2296
|
x(this, "links", {}), x(this, "linksByTargetId", {}), x(this, "linksByArrowId", {});
|
|
2723
2297
|
}
|
|
2724
|
-
add(e,
|
|
2725
|
-
const
|
|
2726
|
-
id:
|
|
2727
|
-
arrow:
|
|
2298
|
+
add(e, o, i, l, c) {
|
|
2299
|
+
const f = ze(), g = e.id, d = {
|
|
2300
|
+
id: f,
|
|
2301
|
+
arrow: g,
|
|
2728
2302
|
target: i,
|
|
2729
|
-
targetType:
|
|
2303
|
+
targetType: l,
|
|
2730
2304
|
connectionPoint: c,
|
|
2731
|
-
side:
|
|
2305
|
+
side: o
|
|
2732
2306
|
};
|
|
2733
|
-
return this.links[
|
|
2307
|
+
return this.links[f] = d, this.linksByTargetId[i] || (this.linksByTargetId[i] = []), this.linksByTargetId[i].push(f), this.linksByArrowId[g] || (this.linksByArrowId[g] = {}), this.linksByArrowId[g][o] = f, e.properties.link = e.properties.link || {}, e.properties.link[o] = {
|
|
2734
2308
|
id: i,
|
|
2735
|
-
side:
|
|
2736
|
-
type:
|
|
2309
|
+
side: o,
|
|
2310
|
+
type: l,
|
|
2737
2311
|
magnet: c
|
|
2738
2312
|
}, this;
|
|
2739
2313
|
}
|
|
2740
|
-
arrowIsLinked(e,
|
|
2314
|
+
arrowIsLinked(e, o) {
|
|
2741
2315
|
var i;
|
|
2742
|
-
return !!((i = this.linksByArrowId[e]) != null && i[
|
|
2316
|
+
return !!((i = this.linksByArrowId[e]) != null && i[o]);
|
|
2743
2317
|
}
|
|
2744
2318
|
// remove the link between the arrow and the target by arrow id and side
|
|
2745
|
-
remove(e,
|
|
2746
|
-
var i,
|
|
2747
|
-
const c = e.id,
|
|
2748
|
-
if ((
|
|
2319
|
+
remove(e, o) {
|
|
2320
|
+
var i, l;
|
|
2321
|
+
const c = e.id, f = (i = this.linksByArrowId[c]) == null ? void 0 : i[o];
|
|
2322
|
+
if ((l = e.properties.link) == null || delete l[o], !f)
|
|
2749
2323
|
return this;
|
|
2750
|
-
const
|
|
2751
|
-
delete this.links[
|
|
2752
|
-
const
|
|
2753
|
-
for (let
|
|
2754
|
-
if (
|
|
2755
|
-
|
|
2324
|
+
const g = this.links[f];
|
|
2325
|
+
delete this.links[f];
|
|
2326
|
+
const d = this.linksByTargetId[g.target];
|
|
2327
|
+
for (let v = 0; v < d.length; v++)
|
|
2328
|
+
if (d[v] === f) {
|
|
2329
|
+
d.splice(v, 1);
|
|
2756
2330
|
break;
|
|
2757
2331
|
}
|
|
2758
|
-
return delete this.linksByArrowId[c][
|
|
2332
|
+
return delete this.linksByArrowId[c][o], this;
|
|
2759
2333
|
}
|
|
2760
|
-
getArrowLink(e,
|
|
2334
|
+
getArrowLink(e, o) {
|
|
2761
2335
|
var i;
|
|
2762
|
-
const
|
|
2763
|
-
return
|
|
2336
|
+
const l = (i = this.linksByArrowId[e]) == null ? void 0 : i[o];
|
|
2337
|
+
return l ? this.links[l] : null;
|
|
2764
2338
|
}
|
|
2765
|
-
getTargetLinks(e,
|
|
2339
|
+
getTargetLinks(e, o) {
|
|
2766
2340
|
var i;
|
|
2767
|
-
return ((i = this.linksByTargetId[e]) == null ? void 0 : i.map((
|
|
2341
|
+
return ((i = this.linksByTargetId[e]) == null ? void 0 : i.map((l) => this.links[l]).filter((l) => l.targetType === o)) ?? [];
|
|
2768
2342
|
}
|
|
2769
2343
|
forEach(e) {
|
|
2770
2344
|
Object.values(this.links).forEach(e);
|
|
2771
2345
|
}
|
|
2772
2346
|
}
|
|
2773
|
-
const
|
|
2347
|
+
const st = (u) => u.properties.type === "arrow", yt = (u) => u.properties.type === "text", Er = (u) => u.type === "FeatureCollection", xn = {
|
|
2774
2348
|
magnetColor: "#3e8",
|
|
2775
2349
|
detectMargin: 20,
|
|
2776
2350
|
magnetHandleRadius: 5,
|
|
@@ -2780,7 +2354,7 @@ const lt = (p) => p.properties.type === "arrow", wt = (p) => p.properties.type =
|
|
|
2780
2354
|
textHandleSize: 3.5,
|
|
2781
2355
|
minArrowHeight: 20,
|
|
2782
2356
|
maxArrowHeight: 30
|
|
2783
|
-
},
|
|
2357
|
+
}, _r = ["start", "end"], kr = [
|
|
2784
2358
|
{ x: 0, y: 0 },
|
|
2785
2359
|
{ x: 0.5, y: 0 },
|
|
2786
2360
|
{ x: 1, y: 0 },
|
|
@@ -2790,128 +2364,129 @@ const lt = (p) => p.properties.type === "arrow", wt = (p) => p.properties.type =
|
|
|
2790
2364
|
{ x: 0.5, y: 1 },
|
|
2791
2365
|
{ x: 1, y: 1 }
|
|
2792
2366
|
];
|
|
2793
|
-
class
|
|
2794
|
-
constructor(e,
|
|
2795
|
-
super(), x(this, "arrows"), x(this, "texts"), x(this, "links", new
|
|
2367
|
+
class An extends Nr {
|
|
2368
|
+
constructor(e, o = {}) {
|
|
2369
|
+
super(), x(this, "arrows"), x(this, "texts"), x(this, "links", new wn()), 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", (i) => {
|
|
2796
2370
|
if (!this.dragged || this.textToMagnet === void 0)
|
|
2797
2371
|
return;
|
|
2798
2372
|
i.beginPath(), i.fillStyle = "green";
|
|
2799
|
-
const
|
|
2800
|
-
|
|
2373
|
+
const l = this.ogma.view.getZoom();
|
|
2374
|
+
kr.forEach((c) => {
|
|
2801
2375
|
if (!this.textToMagnet)
|
|
2802
2376
|
return;
|
|
2803
|
-
const
|
|
2804
|
-
i.moveTo(
|
|
2377
|
+
const f = mt(this.textToMagnet), g = vt(this.textToMagnet), d = Fe(c, { x: f.width, y: f.height }), v = at(d, this.ogma.view.getAngle()), { x: y, y: _ } = Ht(v, g);
|
|
2378
|
+
i.moveTo(y, _), i.arc(y, _, this.options.magnetHandleRadius / l, 0, Math.PI * 2);
|
|
2805
2379
|
}), i.fill(), i.closePath();
|
|
2806
|
-
}), x(this, "_onFeatureDrag", (i,
|
|
2807
|
-
const c =
|
|
2808
|
-
if (
|
|
2809
|
-
["start", "end"].find((
|
|
2810
|
-
const
|
|
2811
|
-
return this._snapToText(i, c,
|
|
2380
|
+
}), x(this, "_onFeatureDrag", (i, l) => {
|
|
2381
|
+
const c = l;
|
|
2382
|
+
if (st(i) && c === "line")
|
|
2383
|
+
["start", "end"].find((f) => {
|
|
2384
|
+
const g = f === "start" ? fe(i) : $e(i);
|
|
2385
|
+
return this._snapToText(i, c, g) || this._findAndSnapToNode(i, f, g);
|
|
2812
2386
|
});
|
|
2813
|
-
else if (
|
|
2814
|
-
const
|
|
2815
|
-
this._snapToText(i, c,
|
|
2387
|
+
else if (st(i) && c !== "line") {
|
|
2388
|
+
const f = c === "start" ? fe(i) : $e(i);
|
|
2389
|
+
this._snapToText(i, c, f) || this._findAndSnapToNode(i, c, f);
|
|
2816
2390
|
} else
|
|
2817
|
-
|
|
2818
|
-
const
|
|
2819
|
-
|
|
2391
|
+
yt(i) && (this.activeLinks.forEach(({ arrow: f, side: g, connectionPoint: d }) => {
|
|
2392
|
+
const v = this.getAnnotation(f), y = mt(i), _ = vt(i), C = Fe(d, { x: y.width, y: y.height }), E = at(C, this.ogma.view.getAngle()), P = Ht(E, _);
|
|
2393
|
+
v.geometry.coordinates[g === "start" ? 0 : 1] = [P.x, P.y];
|
|
2820
2394
|
}), this.activeLinks.length && this.arrows.refreshLayer());
|
|
2821
|
-
this.layer.refresh(), this.emit(
|
|
2395
|
+
this.layer.refresh(), this.emit(De, i, l);
|
|
2822
2396
|
}), x(this, "_onFeatureDragEnd", (i) => {
|
|
2823
|
-
this.dragged !== null &&
|
|
2824
|
-
this.links.getArrowLink(i.id,
|
|
2397
|
+
this.dragged !== null && st(i) && fe(this.dragged) && _r.forEach((l) => {
|
|
2398
|
+
this.links.getArrowLink(i.id, l) && this.emit(dn, {
|
|
2825
2399
|
arrow: i,
|
|
2826
|
-
link: this.links.getArrowLink(i.id,
|
|
2400
|
+
link: this.links.getArrowLink(i.id, l)
|
|
2827
2401
|
});
|
|
2828
|
-
}), (
|
|
2402
|
+
}), (yt(i) || st(i)) && this.onUpdate(i), this.dragged = null, this.activeLinks = [], this.textToMagnet = void 0, this.annotations.forEach((l) => l.enableDetection()), this.layer.refresh(), this.emit(Vt, i);
|
|
2829
2403
|
}), x(this, "_onFeatureDragStart", (i) => {
|
|
2830
|
-
this.textToMagnet = void 0,
|
|
2831
|
-
const c =
|
|
2832
|
-
c && c !== i &&
|
|
2833
|
-
}), this.emit(
|
|
2404
|
+
this.textToMagnet = void 0, st(i) ? this.dragged = i : yt(i) && this.activeLinks.push(...this.links.getTargetLinks(i.id, "text")), this.annotations.forEach((l) => {
|
|
2405
|
+
const c = l.getSelectedFeature();
|
|
2406
|
+
c && c !== i && l.unhover().unselect(), l.disableDetection();
|
|
2407
|
+
}), this.emit(Me, i);
|
|
2834
2408
|
}), x(this, "_onNodesDragStart", () => {
|
|
2835
2409
|
this.arrows.unhover().unselect(), this.texts.unhover().unselect();
|
|
2836
2410
|
}), x(this, "_onNodesDrag", (i) => {
|
|
2837
|
-
const { dx:
|
|
2838
|
-
this._moveNodes(i.nodes,
|
|
2411
|
+
const { dx: l, dy: c } = i;
|
|
2412
|
+
this._moveNodes(i.nodes, l, c);
|
|
2839
2413
|
}), x(this, "_onLayoutEnd", (i) => {
|
|
2840
|
-
i.ids.forEach((
|
|
2841
|
-
this.links.getTargetLinks(
|
|
2842
|
-
const
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
),
|
|
2846
|
-
|
|
2414
|
+
i.ids.forEach((l, c) => {
|
|
2415
|
+
this.links.getTargetLinks(l, "node").forEach((f) => {
|
|
2416
|
+
const g = this.getAnnotation(f.arrow), d = f.side, v = Ie(
|
|
2417
|
+
g,
|
|
2418
|
+
d === "start" ? "end" : "start"
|
|
2419
|
+
), y = i.positions.current[c], _ = this.ogma.getNode(l).getAttribute("radius"), C = Le(v, y, +_);
|
|
2420
|
+
Bt(g, d, C.x, C.y);
|
|
2847
2421
|
});
|
|
2848
2422
|
}), this.arrows.refreshLayer(), this.texts.refreshLayer();
|
|
2849
2423
|
}), x(this, "_onAdded", (i) => {
|
|
2850
|
-
this.emit(
|
|
2424
|
+
this.emit(hr, i);
|
|
2851
2425
|
}), x(this, "_onRemoved", (i) => {
|
|
2852
|
-
this.emit(
|
|
2426
|
+
this.emit(ur, i);
|
|
2853
2427
|
}), x(this, "_onUnselect", (i) => {
|
|
2854
|
-
this.selected = null, this.emit(
|
|
2428
|
+
this.selected = null, this.emit(lr, i);
|
|
2855
2429
|
}), x(this, "_onSelect", (i) => {
|
|
2856
|
-
this.selected !== i && (this.selected = i, this.emit(
|
|
2430
|
+
this.selected !== i && (this.selected = i, this.emit(ar, this.selected));
|
|
2857
2431
|
}), x(this, "onUpdate", (i) => {
|
|
2858
2432
|
cancelAnimationFrame(this.updateTimeout), this.updateTimeout = requestAnimationFrame(
|
|
2859
2433
|
() => this._onUpdate(i)
|
|
2860
2434
|
);
|
|
2861
2435
|
}), x(this, "_onUpdate", (i) => {
|
|
2862
|
-
this.emit(
|
|
2863
|
-
}), this.options = this.setOptions({ ...
|
|
2864
|
-
i.on(
|
|
2436
|
+
this.emit(cr, i);
|
|
2437
|
+
}), this.options = this.setOptions({ ...xn, ...o }), this.ogma = e, this.arrows = new pn(e, this.options), this.texts = new bn(e, this.options), this.annotations = [this.arrows, this.texts], this.annotations.forEach((i) => {
|
|
2438
|
+
i.on(Me, this._onFeatureDragStart).on(De, this._onFeatureDrag).on(Vt, this._onFeatureDragEnd).on(cr, this.onUpdate).on(lr, this._onUnselect).on(ar, this._onSelect).on(hr, this._onAdded).on(ur, this._onRemoved);
|
|
2865
2439
|
}), this.ogma.events.on("nodesDragStart", this._onNodesDragStart).on("nodesDragProgress", this._onNodesDrag).on("layoutEnd", this._onLayoutEnd).on(["viewChanged", "rotate"], () => {
|
|
2866
2440
|
this.refreshTextLinks();
|
|
2867
2441
|
}), this.layer = e.layers.addCanvasLayer(this._render), this.layer.moveToBottom();
|
|
2868
2442
|
}
|
|
2869
|
-
_moveNodes(e,
|
|
2870
|
-
e.forEach((
|
|
2871
|
-
const c = this.links.getTargetLinks(
|
|
2872
|
-
c.forEach((
|
|
2873
|
-
const
|
|
2874
|
-
|
|
2875
|
-
|
|
2443
|
+
_moveNodes(e, o, i) {
|
|
2444
|
+
e.forEach((l) => {
|
|
2445
|
+
const c = this.links.getTargetLinks(l.getId(), "node"), f = l.getPosition();
|
|
2446
|
+
c.forEach((g) => {
|
|
2447
|
+
const d = this.getAnnotation(g.arrow), v = g.side, y = Ie(
|
|
2448
|
+
d,
|
|
2449
|
+
v === "start" ? "end" : "start"
|
|
2876
2450
|
);
|
|
2877
|
-
let
|
|
2878
|
-
const
|
|
2879
|
-
(
|
|
2451
|
+
let _ = f;
|
|
2452
|
+
const C = +l.getAttribute("radius"), E = 1e-6;
|
|
2453
|
+
(g.connectionPoint.x - (f.x - o) > E || g.connectionPoint.y - (f.y - i) > E) && (_ = Le(y, f, C)), Bt(d, v, _.x, _.y);
|
|
2880
2454
|
});
|
|
2881
2455
|
}), this.arrows.refreshLayer();
|
|
2882
2456
|
}
|
|
2883
|
-
_snapToText(e,
|
|
2884
|
-
const
|
|
2885
|
-
if (this.links.remove(e,
|
|
2457
|
+
_snapToText(e, o, i) {
|
|
2458
|
+
const l = this.texts.detect(i, this.options.detectMargin);
|
|
2459
|
+
if (this.links.remove(e, o), !l)
|
|
2886
2460
|
return !1;
|
|
2887
|
-
this.textToMagnet =
|
|
2888
|
-
const c = this.findMagnetPoint(
|
|
2889
|
-
return c ? (
|
|
2890
|
-
}
|
|
2891
|
-
_findAndSnapToNode(e,
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2461
|
+
this.textToMagnet = l;
|
|
2462
|
+
const c = this.findMagnetPoint(kr, l, i);
|
|
2463
|
+
return c ? (Bt(e, o, c.point.x, c.point.y), this.links.add(e, o, l.id, "text", c.magnet), !0) : !1;
|
|
2464
|
+
}
|
|
2465
|
+
_findAndSnapToNode(e, o, i) {
|
|
2466
|
+
var l, c;
|
|
2467
|
+
const f = this.ogma.view.graphToScreenCoordinates(i), g = this.ogma.view.getElementAt(f);
|
|
2468
|
+
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)) : ((c = this.hoveredNode) == null || c.setSelected(!1), this.hoveredNode = null);
|
|
2469
|
+
}
|
|
2470
|
+
_snapToNode(e, o, i, l) {
|
|
2471
|
+
const c = i.getPositionOnScreen(), f = +i.getAttribute("radius"), g = f * this.ogma.view.getZoom(), d = l.x - c.x, v = l.y - c.y, y = Math.sqrt(d * d + v * v), _ = i.getPosition();
|
|
2472
|
+
if (y < g + this.options.detectMargin) {
|
|
2473
|
+
let C = _;
|
|
2474
|
+
if (y > g / 2) {
|
|
2475
|
+
const E = Ie(e, o === "end" ? "start" : "end");
|
|
2476
|
+
C = Le(E, C, f);
|
|
2902
2477
|
}
|
|
2903
|
-
|
|
2478
|
+
Bt(e, o, C.x, C.y), this.links.add(e, o, i.getId(), "node", C);
|
|
2904
2479
|
}
|
|
2905
2480
|
}
|
|
2906
2481
|
refreshTextLinks() {
|
|
2907
2482
|
let e = !1;
|
|
2908
2483
|
this.links.forEach(
|
|
2909
|
-
({ connectionPoint:
|
|
2484
|
+
({ connectionPoint: o, targetType: i, target: l, arrow: c, side: f }) => {
|
|
2910
2485
|
if (i !== "text")
|
|
2911
2486
|
return;
|
|
2912
2487
|
e = !0;
|
|
2913
|
-
const
|
|
2914
|
-
|
|
2488
|
+
const g = this.getAnnotation(l), d = this.getAnnotation(c), v = mt(g), y = vt(g), _ = Fe(o, { x: v.width, y: v.height }), C = at(_, this.ogma.view.getAngle()), E = Ht(C, y);
|
|
2489
|
+
Bt(d, f, E.x, E.y);
|
|
2915
2490
|
}
|
|
2916
2491
|
), e && this.arrows.refreshLayer();
|
|
2917
2492
|
}
|
|
@@ -2921,24 +2496,24 @@ class dn extends jr {
|
|
|
2921
2496
|
getSelected() {
|
|
2922
2497
|
return this.selected;
|
|
2923
2498
|
}
|
|
2924
|
-
findMagnetPoint(e,
|
|
2925
|
-
let
|
|
2499
|
+
findMagnetPoint(e, o, i) {
|
|
2500
|
+
let l;
|
|
2926
2501
|
for (const c of e) {
|
|
2927
|
-
const
|
|
2502
|
+
const f = mt(o), g = vt(o), d = Fe(c, { x: f.width, y: f.height }), v = at(d, this.ogma.view.getAngle()), y = Ht(v, g), _ = Ut(Ct(y, i)), C = Math.min(
|
|
2928
2503
|
this.options.magnetRadius * this.ogma.view.getZoom(),
|
|
2929
2504
|
// when really zoomed in: avoid to snap on too far away magnets
|
|
2930
|
-
|
|
2931
|
-
|
|
2505
|
+
f.width / 2,
|
|
2506
|
+
f.height / 2
|
|
2932
2507
|
);
|
|
2933
|
-
if (
|
|
2934
|
-
|
|
2935
|
-
point:
|
|
2508
|
+
if (_ < Math.max(C, this.options.magnetHandleRadius)) {
|
|
2509
|
+
l = {
|
|
2510
|
+
point: y,
|
|
2936
2511
|
magnet: c
|
|
2937
2512
|
};
|
|
2938
2513
|
break;
|
|
2939
2514
|
}
|
|
2940
2515
|
}
|
|
2941
|
-
return
|
|
2516
|
+
return l;
|
|
2942
2517
|
}
|
|
2943
2518
|
/**
|
|
2944
2519
|
* Set the options for the controller
|
|
@@ -2956,26 +2531,26 @@ class dn extends jr {
|
|
|
2956
2531
|
* @param id the id of the annotation to select
|
|
2957
2532
|
*/
|
|
2958
2533
|
select(e) {
|
|
2959
|
-
const
|
|
2960
|
-
return
|
|
2534
|
+
const o = this.getAnnotations().features.find((i) => i.id === e);
|
|
2535
|
+
return o ? (st(o) ? this.arrows.select(o.id) : yt(o) && this.texts.select(o.id), this) : this;
|
|
2961
2536
|
}
|
|
2962
2537
|
/**
|
|
2963
2538
|
* Unselects the currently selected annotation
|
|
2964
2539
|
*/
|
|
2965
2540
|
unselect() {
|
|
2966
|
-
return this.selected ? (
|
|
2541
|
+
return this.selected ? (st(this.selected) ? this.arrows.unselect() : yt(this.selected) && this.texts.unselect(), this) : this;
|
|
2967
2542
|
}
|
|
2968
2543
|
/**
|
|
2969
2544
|
* Add an annotation to the controller
|
|
2970
2545
|
* @param annotation The annotation to add
|
|
2971
2546
|
*/
|
|
2972
2547
|
add(e) {
|
|
2973
|
-
if (
|
|
2974
|
-
const [
|
|
2975
|
-
(
|
|
2548
|
+
if (Er(e)) {
|
|
2549
|
+
const [o, i] = e.features.reduce(
|
|
2550
|
+
(l, c) => (st(c) ? l[1].push(c) : yt(c) && l[0].push(c), l),
|
|
2976
2551
|
[[], []]
|
|
2977
2552
|
);
|
|
2978
|
-
return
|
|
2553
|
+
return o.forEach((l) => this.add(l)), i.forEach((l) => this.add(l)), this.arrows.refreshLayer(), this;
|
|
2979
2554
|
}
|
|
2980
2555
|
switch (e.properties.type) {
|
|
2981
2556
|
case "text":
|
|
@@ -2992,29 +2567,29 @@ class dn extends jr {
|
|
|
2992
2567
|
* @param annotation The annotation(s) to remove
|
|
2993
2568
|
*/
|
|
2994
2569
|
remove(e) {
|
|
2995
|
-
return
|
|
2996
|
-
(
|
|
2997
|
-
), this) : (
|
|
2570
|
+
return Er(e) ? (e.features.forEach(
|
|
2571
|
+
(o) => this.remove(o)
|
|
2572
|
+
), this) : (st(e) ? (this.links.remove(e, "start"), this.links.remove(e, "end"), this.arrows.remove(e.id)) : this.texts.remove(e.id), this);
|
|
2998
2573
|
}
|
|
2999
2574
|
loadLink(e) {
|
|
3000
2575
|
if (e.properties.link)
|
|
3001
|
-
for (const
|
|
3002
|
-
const i = e.properties.link[
|
|
2576
|
+
for (const o of _r) {
|
|
2577
|
+
const i = e.properties.link[o];
|
|
3003
2578
|
if (!i)
|
|
3004
2579
|
continue;
|
|
3005
|
-
const
|
|
3006
|
-
if (i.type === "text" &&
|
|
3007
|
-
this.links.add(e,
|
|
2580
|
+
const l = this.getAnnotation(i.id);
|
|
2581
|
+
if (i.type === "text" && l)
|
|
2582
|
+
this.links.add(e, o, i.id, i.type, i.magnet);
|
|
3008
2583
|
else if (i.type === "node") {
|
|
3009
2584
|
const c = this.ogma.getNode(i.id);
|
|
3010
2585
|
if (!c)
|
|
3011
2586
|
continue;
|
|
3012
|
-
this.links.add(e,
|
|
3013
|
-
const
|
|
2587
|
+
this.links.add(e, o, i.id, i.type, i.magnet);
|
|
2588
|
+
const f = c.getPosition(), g = c.getAttribute("radius") || 0, d = Ie(
|
|
3014
2589
|
e,
|
|
3015
|
-
|
|
3016
|
-
),
|
|
3017
|
-
|
|
2590
|
+
o === "start" ? "end" : "start"
|
|
2591
|
+
), v = Le(d, f, +g);
|
|
2592
|
+
Bt(e, o, v.x, v.y);
|
|
3018
2593
|
}
|
|
3019
2594
|
}
|
|
3020
2595
|
}
|
|
@@ -3024,8 +2599,8 @@ class dn extends jr {
|
|
|
3024
2599
|
* @param y coord of the first point
|
|
3025
2600
|
* @param arrow The arrow to add
|
|
3026
2601
|
*/
|
|
3027
|
-
startArrow(e,
|
|
3028
|
-
this.cancelDrawing(), this.arrows.startDrawing(e,
|
|
2602
|
+
startArrow(e, o, i) {
|
|
2603
|
+
this.cancelDrawing(), this.arrows.startDrawing(e, o, i);
|
|
3029
2604
|
}
|
|
3030
2605
|
/**
|
|
3031
2606
|
* Start adding a text (add it, and give control to the user)
|
|
@@ -3033,23 +2608,27 @@ class dn extends jr {
|
|
|
3033
2608
|
* @param y coord of the top left point
|
|
3034
2609
|
* @param text The text to add
|
|
3035
2610
|
*/
|
|
3036
|
-
startText(e,
|
|
3037
|
-
this.cancelDrawing(), this.texts.startDrawing(e,
|
|
2611
|
+
startText(e, o, i) {
|
|
2612
|
+
this.cancelDrawing(), this.texts.startDrawing(e, o, i);
|
|
3038
2613
|
}
|
|
3039
2614
|
/**
|
|
3040
2615
|
* Cancel drawing on the current frame
|
|
3041
2616
|
*/
|
|
3042
2617
|
cancelDrawing() {
|
|
3043
|
-
this.annotations.forEach((e) => e.cancelDrawing()), this.emit(
|
|
2618
|
+
this.annotations.forEach((e) => e.cancelDrawing()), this.emit(cn);
|
|
3044
2619
|
}
|
|
3045
2620
|
/**
|
|
3046
2621
|
* Update the style of the annotation with the given id
|
|
3047
2622
|
* @param id The id of the annotation to update
|
|
3048
2623
|
* @param style The new style
|
|
3049
2624
|
*/
|
|
3050
|
-
updateStyle(e,
|
|
3051
|
-
const i = this.getAnnotations().features.find((
|
|
3052
|
-
return i ? (
|
|
2625
|
+
updateStyle(e, o) {
|
|
2626
|
+
const i = this.getAnnotations().features.find((l) => l.id === e);
|
|
2627
|
+
return i ? (st(i) ? this.arrows.updateStyle(i, o) : yt(i) && this.texts.updateStyle(i, o), this.onUpdate(i), this) : this;
|
|
2628
|
+
}
|
|
2629
|
+
setScale(e, o, i, l) {
|
|
2630
|
+
const c = this.getAnnotations().features.find((f) => f.id === e);
|
|
2631
|
+
return c ? (st(c) ? this.arrows.scale(c, o, i, l) : yt(c) && this.texts.scale(c, o, i, l), this.onUpdate(c), this) : this;
|
|
3053
2632
|
}
|
|
3054
2633
|
/**
|
|
3055
2634
|
*
|
|
@@ -3060,8 +2639,8 @@ class dn extends jr {
|
|
|
3060
2639
|
type: "FeatureCollection",
|
|
3061
2640
|
features: []
|
|
3062
2641
|
};
|
|
3063
|
-
return this.annotations.forEach((
|
|
3064
|
-
e.features = [...e.features, ...
|
|
2642
|
+
return this.annotations.forEach((o) => {
|
|
2643
|
+
e.features = [...e.features, ...o.getElements()];
|
|
3065
2644
|
}), e;
|
|
3066
2645
|
}
|
|
3067
2646
|
/**
|
|
@@ -3070,7 +2649,7 @@ class dn extends jr {
|
|
|
3070
2649
|
* @returns The annotation with the given id
|
|
3071
2650
|
*/
|
|
3072
2651
|
getAnnotation(e) {
|
|
3073
|
-
return this.getAnnotations().features.find((
|
|
2652
|
+
return this.getAnnotations().features.find((o) => o.id === e);
|
|
3074
2653
|
}
|
|
3075
2654
|
/**
|
|
3076
2655
|
* Destroy the controller and its elements
|
|
@@ -3079,7 +2658,7 @@ class dn extends jr {
|
|
|
3079
2658
|
this.annotations.forEach((e) => e.destroy()), this.layer.destroy();
|
|
3080
2659
|
}
|
|
3081
2660
|
}
|
|
3082
|
-
const
|
|
2661
|
+
const Tr = [8, 10, 12, 14, 16, 24, 32, 48, 64, 72], Sr = "none", Ur = "#333333", Pn = [
|
|
3083
2662
|
"#FFFFFF",
|
|
3084
2663
|
"#F44E3B",
|
|
3085
2664
|
"#FE9200",
|
|
@@ -3092,7 +2671,7 @@ const Sr = [8, 10, 12, 14, 16, 24, 32, 48, 64, 72], Ar = "none", Dr = "#333333",
|
|
|
3092
2671
|
"#333333",
|
|
3093
2672
|
"#808080",
|
|
3094
2673
|
"#cccccc"
|
|
3095
|
-
],
|
|
2674
|
+
], Rn = [
|
|
3096
2675
|
"Roboto",
|
|
3097
2676
|
"Helvetica Neue",
|
|
3098
2677
|
"Helvetica",
|
|
@@ -3104,120 +2683,120 @@ const Sr = [8, 10, 12, 14, 16, 24, 32, 48, 64, 72], Ar = "none", Dr = "#333333",
|
|
|
3104
2683
|
"Consolas",
|
|
3105
2684
|
"Courier New",
|
|
3106
2685
|
"monospace"
|
|
3107
|
-
].sort((
|
|
2686
|
+
].sort((u, e) => u.toLocaleLowerCase().localeCompare(e.toLocaleLowerCase())), En = {
|
|
3108
2687
|
head: "arrow",
|
|
3109
|
-
strokeColor:
|
|
2688
|
+
strokeColor: Ur,
|
|
3110
2689
|
strokeWidth: 5
|
|
3111
|
-
},
|
|
2690
|
+
}, _n = 0.25, kn = {
|
|
3112
2691
|
font: "Roboto",
|
|
3113
|
-
fontSize:
|
|
3114
|
-
padding:
|
|
3115
|
-
color:
|
|
3116
|
-
strokeType:
|
|
3117
|
-
background:
|
|
2692
|
+
fontSize: Tr[2],
|
|
2693
|
+
padding: Tr[2] * _n,
|
|
2694
|
+
color: Ur,
|
|
2695
|
+
strokeType: Sr,
|
|
2696
|
+
background: Sr
|
|
3118
2697
|
};
|
|
3119
|
-
function
|
|
3120
|
-
return
|
|
2698
|
+
function Tn(u) {
|
|
2699
|
+
return u.reduce((e, o) => e + o, 0) / u.length;
|
|
3121
2700
|
}
|
|
3122
|
-
function
|
|
3123
|
-
return e + (
|
|
2701
|
+
function In(u, e = 0, o = 1) {
|
|
2702
|
+
return e + (o - e) * u;
|
|
3124
2703
|
}
|
|
3125
|
-
function
|
|
3126
|
-
return (
|
|
2704
|
+
function Ln(u, e = 0, o = 1) {
|
|
2705
|
+
return (u - e) / (o - e);
|
|
3127
2706
|
}
|
|
3128
|
-
function
|
|
3129
|
-
return
|
|
2707
|
+
function Fn() {
|
|
2708
|
+
return Or(null);
|
|
3130
2709
|
}
|
|
3131
|
-
const
|
|
2710
|
+
const Wr = Or(
|
|
3132
2711
|
void 0
|
|
3133
|
-
),
|
|
2712
|
+
), $n = () => qr(Wr), Sn = (u, e) => {
|
|
3134
2713
|
switch (e.type) {
|
|
3135
2714
|
case "add":
|
|
3136
2715
|
return {
|
|
3137
|
-
...
|
|
3138
|
-
features: [...
|
|
2716
|
+
...u,
|
|
2717
|
+
features: [...u.features, e.payload]
|
|
3139
2718
|
};
|
|
3140
2719
|
case "remove":
|
|
3141
2720
|
return {
|
|
3142
|
-
...
|
|
3143
|
-
features:
|
|
2721
|
+
...u,
|
|
2722
|
+
features: u.features.filter((o) => o.id !== e.payload.id)
|
|
3144
2723
|
};
|
|
3145
2724
|
case "update":
|
|
3146
2725
|
return {
|
|
3147
|
-
...
|
|
3148
|
-
features:
|
|
3149
|
-
(
|
|
2726
|
+
...u,
|
|
2727
|
+
features: u.features.map(
|
|
2728
|
+
(o) => o.id === e.payload.id ? e.payload : o
|
|
3150
2729
|
)
|
|
3151
2730
|
};
|
|
3152
2731
|
default:
|
|
3153
|
-
return
|
|
2732
|
+
return u;
|
|
3154
2733
|
}
|
|
3155
|
-
},
|
|
3156
|
-
const e =
|
|
2734
|
+
}, jn = ({ children: u }) => {
|
|
2735
|
+
const e = Gr(), [o, i] = Yr(Sn, {
|
|
3157
2736
|
type: "FeatureCollection",
|
|
3158
2737
|
features: []
|
|
3159
|
-
}), [
|
|
3160
|
-
return
|
|
2738
|
+
}), [l, c] = Nt(null), [f, g] = Nt(En), [d, v] = Nt(kn), [y, _] = Nt(), [C, E] = Nt(1), [P, S] = Nt(1);
|
|
2739
|
+
return er(() => {
|
|
3161
2740
|
if (!e)
|
|
3162
2741
|
return;
|
|
3163
|
-
const
|
|
2742
|
+
const $ = new An(e, {
|
|
3164
2743
|
minArrowHeight: 1
|
|
3165
|
-
}),
|
|
3166
|
-
return
|
|
3167
|
-
...
|
|
3168
|
-
strokeWidth: (
|
|
3169
|
-
}),
|
|
3170
|
-
|
|
3171
|
-
...
|
|
3172
|
-
}) :
|
|
3173
|
-
...
|
|
3174
|
-
}), c(
|
|
2744
|
+
}), L = Tn(e.getNodes().getAttribute("radius")) / 5, T = C;
|
|
2745
|
+
return g({
|
|
2746
|
+
...f,
|
|
2747
|
+
strokeWidth: (f.strokeWidth || 1) * T
|
|
2748
|
+
}), E(T), S(L), $.on("select", (B) => {
|
|
2749
|
+
st(B) ? g({
|
|
2750
|
+
...B.properties.style || {}
|
|
2751
|
+
}) : yt(B) && v({
|
|
2752
|
+
...B.properties.style || {}
|
|
2753
|
+
}), c(B);
|
|
3175
2754
|
}).on("unselect", () => {
|
|
3176
2755
|
c(null);
|
|
3177
|
-
}),
|
|
3178
|
-
|
|
2756
|
+
}), _($), () => {
|
|
2757
|
+
y == null || y.destroy();
|
|
3179
2758
|
};
|
|
3180
|
-
}, [e]),
|
|
3181
|
-
|
|
3182
|
-
}, [
|
|
3183
|
-
|
|
3184
|
-
}, [
|
|
3185
|
-
|
|
2759
|
+
}, [e]), er(() => {
|
|
2760
|
+
y && l && (l == null ? void 0 : l.properties.type) === "arrow" && y.updateStyle(l.id, f);
|
|
2761
|
+
}, [y, f, l]), er(() => {
|
|
2762
|
+
y && l && (l == null ? void 0 : l.properties.type) === "text" && y.updateStyle(l.id, d);
|
|
2763
|
+
}, [y, d, l]), /* @__PURE__ */ Zr.jsx(
|
|
2764
|
+
Wr.Provider,
|
|
3186
2765
|
{
|
|
3187
2766
|
value: {
|
|
3188
|
-
annotations:
|
|
2767
|
+
annotations: o,
|
|
3189
2768
|
updateAnnotations: i,
|
|
3190
|
-
currentAnnotation:
|
|
2769
|
+
currentAnnotation: l,
|
|
3191
2770
|
setCurrentAnnotation: c,
|
|
3192
|
-
textStyle:
|
|
3193
|
-
setTextStyle:
|
|
3194
|
-
arrowStyle:
|
|
3195
|
-
setArrowStyle:
|
|
3196
|
-
arrowWidthFactor:
|
|
3197
|
-
setArrowWidthFactor:
|
|
2771
|
+
textStyle: d,
|
|
2772
|
+
setTextStyle: v,
|
|
2773
|
+
arrowStyle: f,
|
|
2774
|
+
setArrowStyle: g,
|
|
2775
|
+
arrowWidthFactor: C,
|
|
2776
|
+
setArrowWidthFactor: E,
|
|
3198
2777
|
textSizeFactor: P,
|
|
3199
|
-
setTextSizeFactor:
|
|
3200
|
-
editor:
|
|
3201
|
-
setEditor:
|
|
2778
|
+
setTextSizeFactor: S,
|
|
2779
|
+
editor: y,
|
|
2780
|
+
setEditor: _
|
|
3202
2781
|
},
|
|
3203
|
-
children:
|
|
2782
|
+
children: u
|
|
3204
2783
|
}
|
|
3205
2784
|
);
|
|
3206
2785
|
};
|
|
3207
2786
|
export {
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
2787
|
+
Wr as AnnotationsContext,
|
|
2788
|
+
jn as AnnotationsContextProvider,
|
|
2789
|
+
Ur as BLACK,
|
|
2790
|
+
_n as RELATIVE_PADDING,
|
|
2791
|
+
Sr as TRANSPARENT,
|
|
2792
|
+
Fn as createAnnotationsContext,
|
|
2793
|
+
En as defaultArrowStyle,
|
|
2794
|
+
Pn as defaultColors,
|
|
2795
|
+
kn as defaultTextStyle,
|
|
2796
|
+
Tr as fontSizes,
|
|
2797
|
+
Rn as fonts,
|
|
2798
|
+
In as interpolate,
|
|
2799
|
+
Tn as mean,
|
|
2800
|
+
Ln as normalize,
|
|
2801
|
+
$n as useAnnotationsContext
|
|
3223
2802
|
};
|