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