@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.
Files changed (3) hide show
  1. package/dist/index.js +36 -35
  2. package/dist/index.mjs +1913 -2178
  3. package/package.json +6 -6
package/dist/index.mjs CHANGED
@@ -1,647 +1,454 @@
1
- import Cr, { createContext as Or, useContext as qr, useReducer as Yr, useState as Nt, useEffect as rr } from "react";
2
- import { useOgma as Gr } from "@linkurious/ogma-react";
3
- var sr = { exports: {} }, ue = {};
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.min.js
6
+ * react-jsx-runtime.production.js
7
7
  *
8
- * Copyright (c) Facebook, Inc. and its affiliates.
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 dr;
14
- function Xr() {
15
- if (dr)
16
- return ue;
17
- dr = 1;
18
- var h = Cr, e = Symbol.for("react.element"), s = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, l = h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, c = { key: !0, ref: !0, __self: !0, __source: !0 };
19
- function g(y, f, m) {
20
- var v, k = {}, C = null, _ = null;
21
- m !== void 0 && (C = "" + m), f.key !== void 0 && (C = "" + f.key), f.ref !== void 0 && (_ = f.ref);
22
- for (v in f)
23
- i.call(f, v) && !c.hasOwnProperty(v) && (k[v] = f[v]);
24
- if (y && y.defaultProps)
25
- for (v in f = y.defaultProps, f)
26
- k[v] === void 0 && (k[v] = f[v]);
27
- return { $$typeof: e, type: y, key: C, ref: _, props: k, _owner: l.current };
28
- }
29
- return ue.Fragment = s, ue.jsx = g, ue.jsxs = g, ue;
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 he = {};
35
+ var ce = {};
32
36
  /**
33
37
  * @license React
34
38
  * react-jsx-runtime.development.js
35
39
  *
36
- * Copyright (c) Facebook, Inc. and its affiliates.
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 fr;
42
- function Jr() {
43
- return fr || (fr = 1, process.env.NODE_ENV !== "production" && function() {
44
- var h = Cr, e = Symbol.for("react.element"), s = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), l = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), g = Symbol.for("react.provider"), y = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), m = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), k = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), _ = Symbol.for("react.offscreen"), R = Symbol.iterator, S = "@@iterator";
45
- function D(t) {
46
- if (t === null || typeof t != "object")
47
- return null;
48
- var u = R && t[R] || t[S];
49
- return typeof u == "function" ? u : null;
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 s:
56
+ case it:
99
57
  return "Portal";
100
- case c:
58
+ case Bt:
101
59
  return "Profiler";
102
- case l:
60
+ case qt:
103
61
  return "StrictMode";
104
- case m:
62
+ case te:
105
63
  return "Suspense";
106
- case v:
64
+ case jt:
107
65
  return "SuspenseList";
108
66
  }
109
- if (typeof t == "object")
110
- switch (t.$$typeof) {
111
- case y:
112
- var u = t;
113
- return pe(u) + ".Consumer";
114
- case g:
115
- var d = t;
116
- return pe(d._context) + ".Provider";
117
- case f:
118
- return Pt(t, t.render, "ForwardRef");
119
- case k:
120
- var p = t.displayName || null;
121
- return p !== null ? p : tt(t.type) || "Memo";
122
- case C: {
123
- var b = t, w = b._payload, A = b._init;
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 tt(A(w));
83
+ return a(h(A));
126
84
  } catch {
127
- return null;
128
85
  }
129
- }
130
86
  }
131
87
  return null;
132
88
  }
133
- var z = Object.assign, lt = 0, X, ut, Rt, ye, Gt, ve, me;
134
- function Et() {
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 He() {
161
- {
162
- if (lt--, lt === 0) {
163
- var t = {
164
- configurable: !0,
165
- enumerable: !0,
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
- var Xt = L.ReactCurrentDispatcher, Jt;
196
- function It(t, u, d) {
197
- {
198
- if (Jt === void 0)
199
- try {
200
- throw Error();
201
- } catch (b) {
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
- var Kt = !1, _t;
210
- {
211
- var Ue = typeof WeakMap == "function" ? WeakMap : Map;
212
- _t = new Ue();
109
+ function r() {
213
110
  }
214
- function Zt(t, u) {
215
- if (!t || Kt)
216
- return "";
217
- {
218
- var d = _t.get(t);
219
- if (d !== void 0)
220
- return d;
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
- var p;
223
- Kt = !0;
224
- var b = Error.prepareStackTrace;
225
- Error.prepareStackTrace = void 0;
226
- var w;
227
- w = Xt.current, Xt.current = null, be();
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
- if (u) {
230
- var A = function() {
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.call();
247
- } catch ($) {
248
- p = $;
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
- t.call(A.prototype);
251
- }
252
- } else {
253
- try {
254
- throw Error();
255
- } catch ($) {
256
- p = $;
208
+ return [null, null];
257
209
  }
258
- t();
259
- }
260
- } catch ($) {
261
- if ($ && p && typeof $.stack == "string") {
262
- for (var E = $.stack.split(`
263
- `), O = p.stack.split(`
264
- `), P = E.length - 1, I = O.length - 1; P >= 1 && I >= 0 && E[P] !== O[I]; )
265
- I--;
266
- for (; P >= 1 && I >= 0; P--, I--)
267
- if (E[P] !== O[I]) {
268
- if (P !== 1 || I !== 1)
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 (P--, I--, I < 0 || E[P] !== O[I]) {
271
- var B = `
272
- ` + E[P].replace(" at new ", " at ");
273
- return t.displayName && B.includes("<anonymous>") && (B = B.replace("<anonymous>", t.displayName)), typeof t == "function" && _t.set(t, B), B;
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 (P >= 1 && I >= 0);
249
+ while (1 <= B && 0 <= L);
276
250
  break;
277
251
  }
278
252
  }
279
253
  } finally {
280
- Kt = !1, Xt.current = w, He(), Error.prepareStackTrace = b;
254
+ ie = !1, xt.H = I, u(), Error.prepareStackTrace = v;
281
255
  }
282
- var M = t ? t.displayName || t.name : "", F = M ? It(M) : "";
283
- return typeof t == "function" && _t.set(t, F), F;
284
- }
285
- function We(t, u, d) {
286
- return Zt(t, !1);
287
- }
288
- function Ve(t) {
289
- var u = t.prototype;
290
- return !!(u && u.isReactComponent);
291
- }
292
- function Lt(t, u, d) {
293
- if (t == null)
294
- return "";
295
- if (typeof t == "function")
296
- return Zt(t, Ve(t));
297
- if (typeof t == "string")
298
- return It(t);
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 t == "object")
306
- switch (t.$$typeof) {
307
- case f:
308
- return We(t.render);
309
- case k:
310
- return Lt(t.type, u, d);
311
- case C: {
312
- var p = t, b = p._payload, w = p._init;
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 Lt(w(b), u, d);
283
+ return g(h(A));
315
284
  } catch {
316
285
  }
317
- }
318
286
  }
319
287
  return "";
320
288
  }
321
- var bt = Object.prototype.hasOwnProperty, we = {}, xe = L.ReactDebugCurrentFrame;
322
- function Ft(t) {
323
- if (t) {
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 qe(t, u, d, p, b) {
330
- {
331
- var w = Function.call.bind(bt);
332
- for (var A in t)
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
- function Ge(t) {
359
- try {
360
- return Ae(t), !1;
361
- } catch {
362
- return !0;
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
- var ke = function(t, u, d, p, b, w, A) {
424
- var E = {
425
- // This tag allows us to uniquely identify this as a React Element
426
- $$typeof: e,
427
- // Built-in properties that belong on the element
428
- type: t,
429
- key: u,
430
- ref: d,
431
- props: A,
432
- // Record the component responsible for creating this element.
433
- _owner: w
434
- };
435
- return E._store = {}, Object.defineProperty(E._store, "validated", {
436
- configurable: !1,
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
- writable: !0,
439
- value: !1
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: !1,
444
- value: p
445
- }), Object.defineProperty(E, "_source", {
331
+ writable: !0,
332
+ value: 0
333
+ }), Object.defineProperty(h, "_debugInfo", {
446
334
  configurable: !1,
447
335
  enumerable: !1,
448
- writable: !1,
449
- value: b
450
- }), Object.freeze && (Object.freeze(E.props), Object.freeze(E)), E;
451
- };
452
- function kt(t, u, d, p, b) {
453
- {
454
- var w, A = {}, E = null, O = null;
455
- d !== void 0 && (te(d), E = "" + d), Xe(u) && (te(u.key), E = "" + u.key), re(u) && (O = u.ref, Je(u, b));
456
- for (w in u)
457
- bt.call(u, w) && !Ee.hasOwnProperty(w) && (A[w] = u[w]);
458
- if (t && t.defaultProps) {
459
- var P = t.defaultProps;
460
- for (w in P)
461
- A[w] === void 0 && (A[w] = P[w]);
462
- }
463
- if (E || O) {
464
- var I = typeof t == "function" ? t.displayName || t.name || "Unknown" : t;
465
- E && Ke(A, I), O && ne(A, I);
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
- Te.setExtraStackFrame(null);
477
- }
478
- var J;
479
- J = !1;
480
- function dt(t) {
481
- return typeof t == "object" && t !== null && t.$$typeof === e;
482
- }
483
- function $t() {
484
- {
485
- if (ie.current) {
486
- var t = tt(ie.current.type);
487
- if (t)
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} />`, N, F, K, F), se[F + N] = !0;
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
- return t === i ? Oe(I) : Qe(I), I;
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 r(t, u, d) {
626
- return Pe(t, u, d, !0);
627
- }
628
- function n(t, u, d) {
629
- return Pe(t, u, d, !1);
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
- var a = n, o = r;
632
- he.Fragment = i, he.jsx = a, he.jsxs = o;
633
- }()), he;
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
- process.env.NODE_ENV === "production" ? sr.exports = Xr() : sr.exports = Jr();
636
- var Kr = sr.exports, Zr = Object.defineProperty, Qr = (h, e, s) => e in h ? Zr(h, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : h[e] = s, x = (h, e, s) => (Qr(h, typeof e != "symbol" ? e + "" : e, s), s);
637
- let Be = (h = 21) => crypto.getRandomValues(new Uint8Array(h)).reduce((e, s) => (s &= 63, s < 36 ? e += s.toString(36) : s < 62 ? e += (s - 26).toString(36).toUpperCase() : s > 62 ? e += "-" : e += "_", e), "");
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: "black",
447
+ strokeColor: "#202020",
641
448
  strokeWidth: 1,
642
449
  head: "none",
643
450
  tail: "none"
644
- }, gr = {
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
- }, tn = (h = 0, e = 0, s = 0, i = 0, l = { ...fe }) => ({
671
- id: Be(),
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
- ...l
484
+ ...o
678
485
  }
679
486
  },
680
487
  geometry: {
681
488
  type: "LineString",
682
489
  coordinates: [
683
- [h, e],
684
- [s, i]
490
+ [a, t],
491
+ [i, r]
685
492
  ]
686
493
  }
687
- }), en = "http://www.w3.org/2000/svg";
688
- function ce(h) {
689
- return document.createElementNS(en, h);
494
+ }), ln = "http://www.w3.org/2000/svg";
495
+ function Ft(a) {
496
+ return document.createElementNS(ln, a);
690
497
  }
691
- function Pr(h) {
692
- return h.geometry.bbox || rn(h), h.geometry.bbox;
498
+ function $r(a) {
499
+ return a.geometry.bbox || hn(a), a.geometry.bbox;
693
500
  }
694
- function mt(h) {
695
- const e = Pr(h);
501
+ function $t(a) {
502
+ const t = $r(a);
696
503
  return {
697
- width: e[2] - e[0],
698
- height: e[3] - e[1]
504
+ width: t[2] - t[0],
505
+ height: t[3] - t[1]
699
506
  };
700
507
  }
701
- function vt(h) {
702
- const e = Pr(h);
703
- return { x: e[0], y: e[1] };
508
+ function Ot(a) {
509
+ const t = $r(a);
510
+ return { x: t[0], y: t[1] };
704
511
  }
705
- function rn(h) {
706
- const [e, s] = h.geometry.coordinates[0][0], [i, l] = h.geometry.coordinates[0][2];
707
- h.geometry.bbox = [e, s, i, l];
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 nn(h, e, s, i, l) {
710
- h.geometry.bbox = [e, s, e + i, s + l], h.geometry.coordinates = [
516
+ function un(a, t, i, r, o) {
517
+ a.geometry.bbox = [t, i, t + r, i + o], a.geometry.coordinates = [
711
518
  [
712
- [e, s],
713
- [e + i, s],
714
- [e + i, s + l],
715
- [e, s + l],
716
- [e, s]
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(h) {
721
- const [e, s] = h.geometry.coordinates[0];
722
- return { x: e, y: s };
527
+ function de(a) {
528
+ const [t, i] = a.geometry.coordinates[0];
529
+ return { x: t, y: i };
723
530
  }
724
- function Le(h, e) {
725
- const [s, i] = h.geometry.coordinates[e === "start" ? 0 : 1];
726
- return { x: s, y: i };
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 $e(h) {
729
- const [e, s] = h.geometry.coordinates[1];
730
- return { x: e, y: s };
535
+ function Me(a) {
536
+ const [t, i] = a.geometry.coordinates[1];
537
+ return { x: t, y: i };
731
538
  }
732
- function Rr(h, e, s) {
733
- h.geometry.coordinates[0] = [e, s];
539
+ function Lr(a, t, i) {
540
+ a.geometry.coordinates[0] = [t, i];
734
541
  }
735
- function Ir(h, e, s) {
736
- h.geometry.coordinates[1] = [e, s];
542
+ function jr(a, t, i) {
543
+ a.geometry.coordinates[1] = [t, i];
737
544
  }
738
- function De(h) {
739
- return { start: de(h), end: $e(h) };
545
+ function De(a) {
546
+ return { start: de(a), end: Me(a) };
740
547
  }
741
- function Bt(h, e, s, i) {
742
- e === "start" ? Rr(h, s, i) : Ir(h, s, i);
548
+ function Vt(a, t, i, r) {
549
+ t === "start" ? Lr(a, i, r) : jr(a, i, r);
743
550
  }
744
- const Lr = (h) => parseInt(h.getAttribute("data-handle-id") || "-1");
745
- function on(h) {
746
- return Array.isArray(h) && h.length === 2 && h.every(isFinite);
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 sn(h, e, s, i) {
749
- for (let l = 0; l < h.coordinates.length; l++) {
750
- const c = h.coordinates[l];
751
- if (on(c))
752
- c[0] = s + (c[0] - s) * e, c[1] = i + (c[1] - i) * e;
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 g = 0; g < c.length; g++) {
755
- const y = c[g];
756
- y[0] = s + (y[0] - s) * e, y[1] = i + (y[1] - i) * e;
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 h;
566
+ return a;
760
567
  }
761
- function Fe(h, e, s) {
762
- const i = Math.atan2(h.y - e.y, h.x - e.x);
568
+ function Le(a, t, i) {
569
+ const r = Math.atan2(a.y - t.y, a.x - t.x);
763
570
  return {
764
- x: e.x + s * Math.cos(i),
765
- y: e.y + s * Math.sin(i)
571
+ x: t.x + i * Math.cos(r),
572
+ y: t.y + i * Math.sin(r)
766
573
  };
767
574
  }
768
- function Me(h, e) {
769
- if (!e)
770
- return { x: h.clientX, y: h.clientY };
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: h.clientX - s.left - e.clientLeft,
774
- y: h.clientY - s.top - e.clientTop
579
+ x: a.clientX - i.left - t.clientLeft,
580
+ y: a.clientY - i.top - t.clientTop
775
581
  };
776
582
  }
777
- const Ct = (h, e) => ({
778
- x: h.x - e.x,
779
- y: h.y - e.y
780
- }), Ut = (h) => Math.sqrt(h.x * h.x + h.y * h.y), Fr = (h) => ({
781
- x: -h.x,
782
- y: -h.y
783
- }), jr = (h) => {
784
- const e = Ut(h);
785
- return e === 0 ? { x: 0, y: 0 } : {
786
- x: h.x / e,
787
- y: h.y / e
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
- }, Ht = (h, e) => ({
790
- x: h.x + e.x,
791
- y: h.y + e.y
792
- }), $r = (h, e) => ({
793
- x: h.x * e,
794
- y: h.y * e
795
- }), je = (h, e) => ({
796
- x: h.x * e.x,
797
- y: h.y * e.y
798
- }), at = (h, e) => {
799
- const s = Math.sin(e), i = Math.cos(e);
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: h.x * i - h.y * s,
802
- y: h.x * s + h.y * i
621
+ x: a.x * r - a.y * i,
622
+ y: a.x * i + a.y * r
803
623
  };
804
- }, an = (h, e) => ({
805
- x: h.x / e,
806
- y: h.y / e
807
- }), pr = (h, e) => h.x * e.x + h.y * e.y;
808
- function Dr(h, e = 5, s = 30) {
809
- var i;
810
- const { start: l, end: c } = De(h), g = Ct(c, l), y = h.properties.style && h.properties.style.strokeWidth ? (i = h.properties.style) == null ? void 0 : i.strokeWidth : 0;
811
- return Math.min(s, Math.max(3 * y, Ut(g) * 0.1, e));
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 yr(h, e, s, i) {
814
- const l = $r(Fr(jr(e)), i);
815
- if (!s || s === "none")
816
- return "";
817
- const c = Ht(h, at(l, Math.PI / 8)), g = Ht(h, at(l, -Math.PI / 8)), y = `${h.x} ${h.y}`;
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 ln(h, e, s, i, l) {
821
- const { start: c, end: g } = De(h), { tail: y, head: f, strokeColor: m, strokeWidth: v } = h.properties.style || s, k = Ct(g, c), C = Dr(h, i, l), _ = ce("path");
822
- _.setAttribute("data-annotation", `${h.id}`), _.setAttribute("data-annotation-type", "arrow");
823
- const R = f === "arrow-plain" || y === "arrow";
824
- _.setAttribute("stroke", m || "none"), _.setAttribute("stroke-width", `${v}`), _.setAttribute("fill", R ? m || "" : "none"), _.setAttribute("stroke-linecap", "round"), _.setAttribute("stroke-linejoin", "round");
825
- const S = yr(c, Fr(k), y, C), D = yr(g, k, f, C), L = S + `M ${c.x} ${c.y} ${g.x} ${g.y}` + D;
826
- _.setAttribute("d", L), e.appendChild(_);
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
- const Y = -1, ze = "dragging", Ne = "dragstart", Vt = "dragend", ar = "select", lr = "unselect", un = "hover", hn = "unhover", ur = "remove", hr = "add", cn = "cancelDrawing", cr = "update", dn = "link";
829
- var fn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
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
- var zr = { exports: {} };
834
- (function(h) {
835
- var e = Object.prototype.hasOwnProperty, s = "~";
836
- function i() {
837
- }
838
- Object.create && (i.prototype = /* @__PURE__ */ Object.create(null), new i().__proto__ || (s = !1));
839
- function l(f, m, v) {
840
- this.fn = f, this.context = m, this.once = v || !1;
841
- }
842
- function c(f, m, v, k, C) {
843
- if (typeof v != "function")
844
- throw new TypeError("The listener must be a function");
845
- var _ = new l(v, k || f, C), R = s ? s + m : m;
846
- return f._events[R] ? f._events[R].fn ? f._events[R] = [f._events[R], _] : f._events[R].push(_) : (f._events[R] = _, f._eventsCount++), f;
847
- }
848
- function g(f, m) {
849
- --f._eventsCount === 0 ? f._events = new i() : delete f._events[m];
850
- }
851
- function y() {
852
- this._events = new i(), this._eventsCount = 0;
853
- }
854
- y.prototype.eventNames = function() {
855
- var f = [], m, v;
856
- if (this._eventsCount === 0)
857
- return f;
858
- for (v in m = this._events)
859
- e.call(m, v) && f.push(s ? v.slice(1) : v);
860
- return Object.getOwnPropertySymbols ? f.concat(Object.getOwnPropertySymbols(m)) : f;
861
- }, y.prototype.listeners = function(f) {
862
- var m = s ? s + f : f, v = this._events[m];
863
- if (!v)
864
- return [];
865
- if (v.fn)
866
- return [v.fn];
867
- for (var k = 0, C = v.length, _ = new Array(C); k < C; k++)
868
- _[k] = v[k].fn;
869
- return _;
870
- }, y.prototype.listenerCount = function(f) {
871
- var m = s ? s + f : f, v = this._events[m];
872
- return v ? v.fn ? 1 : v.length : 0;
873
- }, y.prototype.emit = function(f, m, v, k, C, _) {
874
- var R = s ? s + f : f;
875
- if (!this._events[R])
876
- return !1;
877
- var S = this._events[R], D = arguments.length, L, T;
878
- if (S.fn) {
879
- switch (S.once && this.removeListener(f, S.fn, void 0, !0), D) {
880
- case 1:
881
- return S.fn.call(S.context), !0;
882
- case 2:
883
- return S.fn.call(S.context, m), !0;
884
- case 3:
885
- return S.fn.call(S.context, m, v), !0;
886
- case 4:
887
- return S.fn.call(S.context, m, v, k), !0;
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
- S[T].fn.call(S[T].context);
902
- break;
711
+ return x.fn.call(x.context), !0;
903
712
  case 2:
904
- S[T].fn.call(S[T].context, m);
905
- break;
713
+ return x.fn.call(x.context, p), !0;
906
714
  case 3:
907
- S[T].fn.call(S[T].context, m, v);
908
- break;
715
+ return x.fn.call(x.context, p, y), !0;
909
716
  case 4:
910
- S[T].fn.call(S[T].context, m, v, k);
911
- break;
912
- default:
913
- if (!L)
914
- for (H = 1, L = new Array(D - 1); H < D; H++)
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
- return !0;
920
- }, y.prototype.on = function(f, m, v) {
921
- return c(this, f, m, v, !1);
922
- }, y.prototype.once = function(f, m, v) {
923
- return c(this, f, m, v, !0);
924
- }, y.prototype.removeListener = function(f, m, v, k) {
925
- var C = s ? s + f : f;
926
- if (!this._events[C])
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
- if (!m)
929
- return g(this, C), this;
930
- var _ = this._events[C];
931
- if (_.fn)
932
- _.fn === m && (!k || _.once) && (!v || _.context === v) && g(this, C);
933
- else {
934
- for (var R = 0, S = [], D = _.length; R < D; R++)
935
- (_[R].fn !== m || k && !_[R].once || v && _[R].context !== v) && S.push(_[R]);
936
- S.length ? this._events[C] = S.length === 1 ? S[0] : S : g(this, C);
937
- }
938
- return this;
939
- }, y.prototype.removeAllListeners = function(f) {
940
- var m;
941
- return f ? (m = s ? s + f : f, this._events[m] && g(this, m)) : (this._events = new i(), this._eventsCount = 0), this;
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 l = this.ogma.view.screenToGraphCoordinates(i), c = this.shouldDetect || !this.shouldDetect && +this.selectedId > -1 ? this.detect(l, 0) : void 0;
954
- i.domEvent.type === "mousemove" ? c ? this.hover(c.id) : this.hoveredId !== Y && this.unhover() : c ? this.select(c.id) : this.selectedId !== Y && this.unselect();
955
- }), this.ogma = e, this.elements = [], this.shouldDetect = !0, this.isDragging = !1, this.showeditorOnHover = !0, this.ogmaOptions = e.getOptions(), e.events.on(["click", "mousemove"], this._onClickMouseMove).on("keyup", this._onKeyUp).on("frame", () => {
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 = e.layers.addSVGLayer({
958
- draw: (i) => this.draw(i)
959
- }), this.layer.moveToTop(), this.editor = e.layers.addLayer(s), this.editor.hide();
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(e) {
970
- const s = this.getDefaultOptions(), i = Object.assign(e, {
971
- id: e.id === void 0 ? Be() : e.id,
972
- type: e.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
- ...s.properties,
975
- ...e.properties || {},
803
+ ...i.properties,
804
+ ...t.properties || {},
976
805
  // styles need to be merged
977
- style: { ...s.properties.style, ...e.properties.style || {} }
806
+ style: { ...i.properties.style, ...t.properties.style || {} }
978
807
  },
979
808
  geometry: {
980
- ...s.geometry,
981
- ...e.geometry
809
+ ...i.geometry,
810
+ ...t.geometry
982
811
  }
983
812
  });
984
- return this.elements.push(i), this.layer.refresh(), this.emit(hr, i), i;
813
+ return this.elements.push(r), this.layer.refresh(), this.emit(Qe, r), r;
985
814
  }
986
- updateStyle(e, s) {
987
- this.updateAnnotation(e, {
815
+ updateStyle(t, i) {
816
+ this.updateAnnotation(t, {
988
817
  properties: {
989
- style: s
818
+ style: i
990
819
  }
991
820
  });
992
821
  }
993
- updateGeometry(e, s) {
994
- this.updateAnnotation(e, {
995
- geometry: s
822
+ updateGeometry(t, i) {
823
+ this.updateAnnotation(t, {
824
+ geometry: i
996
825
  });
997
826
  }
998
- scale(e, s, i, l) {
827
+ scale(t, i, r, o) {
999
828
  this.updateGeometry(
1000
- e,
1001
- sn(e.geometry, s, i, l)
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(e, s) {
1011
- const i = this.getById(e);
1012
- this.updateAnnotation(i, s);
1013
- }
1014
- updateAnnotation(e, s) {
1015
- if (!e)
1016
- return;
1017
- const i = e.id;
1018
- Object.keys(s).forEach((l) => {
1019
- if (l !== "id")
1020
- if (l === "properties") {
1021
- const c = s.properties || { style: {} };
1022
- e.properties = {
1023
- ...e.properties || {},
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
- ...e.properties.style || {},
1027
- ...c.style || {}
854
+ ...t.properties.style || {},
855
+ ...u.style || {}
1028
856
  }
1029
857
  };
1030
- } else
1031
- l === "geometry" ? e.geometry = {
1032
- ...e.geometry,
1033
- ...s.geometry
1034
- } : e[l] = s[l];
1035
- }), i === this.selectedId && this.refreshEditor(), this.layer.refresh();
1036
- }
1037
- getById(e) {
1038
- const s = Number(e);
1039
- for (let i = 0; i < this.elements.length; i++) {
1040
- const l = this.elements[i];
1041
- if (!(l.id !== e && l.id !== s))
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(e) {
1051
- const s = this.getById(e);
1052
- s && (this.editor.show(), this.selectedId = e, this.refreshEditor(), this.layer.refresh(), this.emit(ar, s));
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(e) {
1055
- const s = this.getById(e);
1056
- s && (this.showeditorOnHover && this.editor.show(), this.hoveredId = e, this.refreshEditor(), this.layer.refresh(), this.emit(un, s));
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 === Y ? null : this.getById(this.selectedId);
886
+ return this.selectedId === Z ? null : this.getById(this.selectedId);
1060
887
  }
1061
888
  unselect() {
1062
- const e = this.getById(this.selectedId);
1063
- return e && this.emit(lr, e), this.selectedId = Y, this.hoveredId === Y && this.editor.hide(), this.layer.refresh(), this;
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 e = this.getById(this.hoveredId);
1067
- return this.emit(hn, e), this.hoveredId = Y, this.selectedId === Y && this.editor.hide(), this.layer.refresh(), this;
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(e) {
1075
- const s = this.getById(e);
1076
- e === this.hoveredId && this.unhover(), e === this.selectedId && this.unselect(), this.elements = this.elements.filter((i) => i.id !== e), s && this.emit(ur, s), this.layer.refresh();
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 vr = "handle-line", mr = "handle-start", br = "handle-end";
1127
- class pn extends Br {
1128
- constructor(e, s = {}) {
953
+ const mr = "handle-line", vr = "handle-start", wr = "handle-end";
954
+ class Cn extends Fr {
955
+ constructor(t, i = {}) {
1129
956
  super(
1130
- e,
957
+ t,
1131
958
  `
1132
959
  <div class="arrow-handle">
1133
- <div id="${vr}" data-handle-id="0" class="handle line"></div>
1134
- <div id="${mr}" data-handle-id="1" class="handle point"></div>
1135
- <div id="${br}" data-handle-id="2" class="handle point"></div>
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
- ), x(this, "draggedHandle", Y), x(this, "start", { x: 0, y: 0 }), x(this, "end", { x: 0, y: 0 }), x(this, "arrow", { ...gr }), x(this, "startX", 0), x(this, "startY", 0), x(this, "minArrowHeight", 0), x(this, "maxArrowHeight", 0), x(this, "handles", []), x(this, "onHandleMouseDown", (i) => {
1139
- const l = this.getById(this.selectedId) || this.getById(this.hoveredId);
1140
- if (!l)
1141
- return;
1142
- const { x: c, y: g } = Me(i, this.ogma.getContainer());
1143
- this.startDragging(l, c, g), this.draggedHandle = Lr(i.target);
1144
- }), x(this, "onMouseUp", () => {
1145
- this.draggedHandle !== -1 && (this.restoreDragging(), this.isDragging = !1, this.draggedHandle = Y, this.emit(Vt, this.arrow));
1146
- }), x(this, "onMouseMove", (i) => {
1147
- if (!this.isDragging || this.draggedHandle === Y)
1148
- return;
1149
- const l = this.handles[this.draggedHandle], c = this.ogma.view.getAngle(), g = Me(
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
- c
1158
- ), m = l.id === vr, v = l.id === mr, k = l.id === br;
1159
- (m || v) && Rr(this.arrow, this.start.x + y, this.start.y + f), (m || k) && Ir(this.arrow, this.end.x + y, this.end.y + f), this.emit(
1160
- ze,
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
- m ? "line" : v ? "start" : "end"
984
+ g ? "line" : p ? "start" : "end"
1163
985
  ), this.refreshEditor(), this.layer.refresh();
1164
- }), this.minArrowHeight = s.minArrowHeight || 0, this.maxArrowHeight = s.maxArrowHeight || 1e6, this.handles = Array.prototype.slice.call(
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
- (i) => i.addEventListener("mousedown", this.onHandleMouseDown)
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(e, s, i = tn(e, s, e, s, fe)) {
1177
- var l;
1178
- this.disableDragging(), this.add(i), this.hoveredId = i.id;
1179
- const c = this.ogma.view.graphToScreenCoordinates({ x: e, y: s }), g = ((l = this.ogma.getContainer()) == null ? void 0 : l.getBoundingClientRect()) || {
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(i.id),
1185
- c.x + (g == null ? void 0 : g.left),
1186
- c.y + g.top
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(Vt, this.arrow), this.restoreDragging(), this.isDragging = !1, this.draggedHandle = Y);
1191
- }
1192
- startDragging(e, s, i) {
1193
- this.selectedId !== e.id && this.select(this.hoveredId), this.arrow = e, this.startX = s, this.startY = i, this.start = de(this.arrow), this.end = $e(this.arrow), this.disableDragging(), this.emit(Ne, this.arrow), this.isDragging = !0;
1194
- }
1195
- detect(e, s = 0) {
1196
- return this.elements.find((i) => {
1197
- const { start: l, end: c } = De(i), g = Ct(e, {
1198
- x: (l.x + c.x) / 2,
1199
- y: (l.y + c.y) / 2
1200
- }), y = Ct(c, l), f = Ut(y), m = jr(y), v = Dr(i);
1201
- return Math.abs(pr(m, g)) < f / 2 + s && Math.abs(pr(at(m, Math.PI / 2), g)) < v / 2 + s;
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
- return;
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
- g.style.transform = `translate(${i.x}px, ${i.y}px) translate(-50%, -50%)`, y.style.transform = `translate(${l.x}px, ${l.y}px) translate(-50%, -50%)`;
1211
- const f = {
1212
- x: (l.x + i.x) / 2,
1213
- y: (l.y + i.y) / 2
1214
- }, m = Ct(l, i), v = $r(m, 1 / Ut(m)), k = Math.atan2(v.y, v.x);
1215
- c.style.width = `${Ut(m)}px`, c.style.left = `${f.x}px`, c.style.top = `${f.y}px`, c.style.transform = `translate(-50%, -50%) rotate(${k}rad)`;
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 gr;
1039
+ return ur;
1219
1040
  }
1220
- draw(e) {
1221
- e.innerHTML = "";
1222
- const s = ce("g"), i = this.ogma.view.getAngle();
1223
- s.setAttribute("transform", `rotate(${-i * (180 / Math.PI)})`), this.elements.forEach(
1224
- (l) => ln(l, s, fe, this.minArrowHeight, this.maxArrowHeight)
1225
- ), e.appendChild(s);
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 e = this.ogma.view.getAngle();
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(${-e * (180 / Math.PI)})`
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 Wt = {
1059
+ const Kt = {
1239
1060
  font: "sans-serif",
1240
- fontSize: 12,
1241
- color: "black",
1242
- background: "",
1243
- strokeWidth: 1,
1244
- strokeColor: "#000",
1061
+ fontSize: 18,
1062
+ color: "#505050",
1063
+ background: "#f5f5f5",
1064
+ strokeWidth: 0,
1065
+ borderRadius: 8,
1066
+ padding: 16,
1245
1067
  strokeType: "plain"
1246
- }, nr = {
1068
+ }, Ye = {
1247
1069
  id: 0,
1248
1070
  type: "Feature",
1249
1071
  properties: {
1250
1072
  type: "text",
1251
1073
  content: "",
1252
- style: { ...Wt }
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
- }, wr = {
1090
+ }, br = {
1269
1091
  handleSize: 3.5,
1270
1092
  placeholder: "Your text..."
1271
- }, yn = (h = 0, e = 0, s = 100, i = 50, l = "", c = { ...Wt }) => ({
1272
- id: Be(),
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: l,
1277
- style: { ...Wt, ...c }
1098
+ content: o,
1099
+ style: { ...Kt, ...u }
1278
1100
  },
1279
1101
  geometry: {
1280
1102
  type: "Polygon",
1281
1103
  coordinates: [
1282
1104
  [
1283
- [h, e],
1284
- [h + s, e],
1285
- [h + s, e + i],
1286
- [h, e + i],
1287
- [h, e]
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 Hr = { exports: {} };
1293
- (function(h, e) {
1294
- (function(s, i) {
1295
- h.exports = i();
1296
- })(fn, () => (() => {
1297
- var s = { d: (r, n) => {
1298
- for (var a in n)
1299
- s.o(n, a) && !s.o(r, a) && Object.defineProperty(r, a, { enumerable: !0, get: n[a] });
1300
- }, o: (r, n) => Object.prototype.hasOwnProperty.call(r, n) }, i = {};
1301
- function l(r) {
1302
- return l = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1303
- return typeof n;
1304
- } : function(n) {
1305
- return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
1306
- }, l(r);
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
- return n;
1328
- }
1329
- function R() {
1330
- var r, n, a, o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "12px/14px sans-serif", t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = 14, d = 12, p = null, b = null, w = "";
1331
- if (o && o.nodeType) {
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
- }(typeof document < "u" ? document : null) || (D = {}, function(r, n) {
1354
- if (!D[n]) {
1355
- var a = R(n);
1356
- D[n] = a, /\bmonospace\b/.test(a.family) ? a.size *= 0.6 : (a.size *= 0.45, a.weight && (a.size *= 1.18));
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
- return r.length * D[n].size;
1359
- }), T = {}, U = { trim: !0, collapse: !0 };
1360
- function H(r, n, a) {
1361
- var o = Object.assign({}, U, a), t = String(r);
1362
- if (!t)
1363
- return 0;
1364
- if (t in S) {
1365
- var u = n.id + "/" + t;
1366
- return u in T || (T[u] = L("_".concat(t, "_"), n) - L("__", n)), T[u];
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
- return o.trim && o.collapse ? o.trim ? t = t.trim() : o.collapse && (t = t.replace(/\s+/g, " ")) : t = t.replace(/\n/g, " "), L(t, n) + n.size * (r.tracking || 0);
1369
- }
1370
- function it(r) {
1371
- return it = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1372
- return typeof n;
1373
- } : function(n) {
1374
- return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
1375
- }, it(r);
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
- return function() {
1401
- var a, o = Ot(r);
1402
- if (n) {
1403
- var t = Ot(this).constructor;
1404
- a = Reflect.construct(o, arguments, t);
1405
- } else
1406
- a = o.apply(this, arguments);
1407
- return ge(this, a);
1408
- };
1409
- }
1410
- function ge(r, n) {
1411
- if (n && (it(n) === "object" || typeof n == "function"))
1412
- return n;
1413
- if (n !== void 0)
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
- var t;
1447
- }
1448
- function tt(r, n, a) {
1449
- return n && pe(r.prototype, n), Object.defineProperty(r, "prototype", { writable: !1 }), r;
1450
- }
1451
- var z = function() {
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
- return tt(r, [{ key: "clone", value: function() {
1457
- var n = new r(this.value);
1458
- 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;
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
- return tt(a);
1471
- }(z), X = function(r) {
1472
- At(a, r);
1473
- var n = Yt(a);
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
- return tt(a);
1478
- }(z), ut = function(r) {
1479
- At(a, r);
1480
- var n = Yt(a);
1481
- function a() {
1482
- return Pt(this, a), n.apply(this, arguments);
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
- return tt(a);
1485
- }(z), Rt = /^[\n\r\t\x20\xA0\u2000-\u200B\u205F\u3000]/, ye = /^[^\n\r\t\u0020\u2000-\u200B\u205F\u3000]{2,}/, Gt = /^[\xA0\u2011\u202F\u2060\uFEFF]/, ve = /^(?:[;\xAD%?…]|,(?!\d))/, me = /^[´±°¢£¤$¥\u2212]/;
1486
- function Et(r, n) {
1487
- n !== !1 && (r = r.trim());
1488
- for (var a, o, t = [], u = r.charAt(0), d = 0, p = 1, b = r.length; p < b; p++) {
1489
- a = r.charAt(p), o = r.charAt(p + 1);
1490
- var w = Rt.test(u), A = Rt.test(a), E = A || w, O = void 0;
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
- return t.push(new z(r.slice(d))), t;
1498
- }
1499
- const be = { nbsp: " ", iexcl: "¡", cent: "¢", pound: "£", curren: "¤", yen: "¥", brvbar: "¦", sect: "§", uml: "¨", copy: "©", ordf: "ª", laquo: "«", not: "¬", shy: "­", reg: "®", macr: "¯", deg: "°", plusmn: "±", sup2: "²", sup3: "³", acute: "´", micro: "µ", para: "¶", middot: "·", cedil: "¸", sup1: "¹", ordm: "º", raquo: "»", frac14: "¼", frac12: "½", frac34: "¾", iquest: "¿", Agrave: "À", Aacute: "Á", Acirc: "Â", Atilde: "Ã", Auml: "Ä", Aring: "Å", AElig: "Æ", Ccedil: "Ç", Egrave: "È", Eacute: "É", Ecirc: "Ê", Euml: "Ë", Igrave: "Ì", Iacute: "Í", Icirc: "Î", Iuml: "Ï", ETH: "Ð", Ntilde: "Ñ", Ograve: "Ò", Oacute: "Ó", Ocirc: "Ô", Otilde: "Õ", Ouml: "Ö", times: "×", Oslash: "Ø", Ugrave: "Ù", Uacute: "Ú", Ucirc: "Û", Uuml: "Ü", Yacute: "Ý", THORN: "Þ", szlig: "ß", agrave: "à", aacute: "á", acirc: "â", atilde: "ã", auml: "ä", aring: "å", aelig: "æ", ccedil: "ç", egrave: "è", eacute: "é", ecirc: "ê", euml: "ë", igrave: "ì", iacute: "í", icirc: "î", iuml: "ï", eth: "ð", ntilde: "ñ", ograve: "ò", oacute: "ó", ocirc: "ô", otilde: "õ", ouml: "ö", divide: "÷", oslash: "ø", ugrave: "ù", uacute: "ú", ucirc: "û", uuml: "ü", yacute: "ý", thorn: "þ", yuml: "ÿ", fnof: "ƒ", Alpha: "Α", Beta: "Β", Gamma: "Γ", Delta: "Δ", Epsilon: "Ε", Zeta: "Ζ", Eta: "Η", Theta: "Θ", Iota: "Ι", Kappa: "Κ", Lambda: "Λ", Mu: "Μ", Nu: "Ν", Xi: "Ξ", Omicron: "Ο", Pi: "Π", Rho: "Ρ", Sigma: "Σ", Tau: "Τ", Upsilon: "Υ", Phi: "Φ", Chi: "Χ", Psi: "Ψ", Omega: "Ω", alpha: "α", beta: "β", gamma: "γ", delta: "δ", epsilon: "ε", zeta: "ζ", eta: "η", theta: "θ", iota: "ι", kappa: "κ", lambda: "λ", mu: "μ", nu: "ν", xi: "ξ", omicron: "ο", pi: "π", rho: "ρ", sigmaf: "ς", sigma: "σ", tau: "τ", upsilon: "υ", phi: "φ", chi: "χ", psi: "ψ", omega: "ω", thetasym: "ϑ", upsih: "ϒ", piv: "ϖ", bull: "•", hellip: "…", prime: "′", Prime: "″", oline: "‾", frasl: "⁄", weierp: "℘", image: "ℑ", real: "ℜ", trade: "™", alefsym: "ℵ", larr: "←", uarr: "↑", rarr: "→", darr: "↓", harr: "↔", crarr: "↵", lArr: "⇐", uArr: "⇑", rArr: "⇒", dArr: "⇓", hArr: "⇔", forall: "∀", part: "∂", exist: "∃", empty: "∅", nabla: "∇", isin: "∈", notin: "∉", ni: "∋", prod: "∏", sum: "∑", minus: "−", lowast: "∗", radic: "√", prop: "∝", infin: "∞", ang: "∠", and: "⊥", or: "⊦", cap: "∩", cup: "∪", int: "∫", there4: "∴", sim: "∼", cong: "≅", asymp: "≈", ne: "≠", equiv: "≡", le: "≤", ge: "≥", sub: "⊂", sup: "⊃", nsub: "⊄", sube: "⊆", supe: "⊇", oplus: "⊕", otimes: "⊗", perp: "⊥", sdot: "⋅", lceil: "⌈", rceil: "⌉", lfloor: "⌊", rfloor: "⌋", lang: "〈", rang: "〉", loz: "◊", spades: "♠", clubs: "♣", hearts: "♥", diams: "♦", quot: '"', amp: "&", lt: "<", gt: ">", OElig: "Œ", oelig: "œ", Scaron: "Š", scaron: "š", Yuml: "Ÿ", circ: "ˆ", tilde: "˜", ensp: " ", emsp: " ", thinsp: " ", zwnj: "‌", zwj: "‍", lrm: "‎", rlm: "‏", ndash: "–", mdash: "—", lsquo: "‘", rsquo: "’", sbquo: "‚", ldquo: "“", rdquo: "”", bdquo: "„", dagger: "†", Dagger: "‡", permil: "‰", lsaquo: "‹", rsaquo: "›" };
1500
- var He = /^[\n\r\x20\u2000-\u200B\u205F\u3000]/, Xt = /^<\/([a-zA-Z0-9]+)([^>]*)>/, Jt = /^<([a-zA-Z0-9]+)((?:\s[^=\s/]+(?:\s*=\s*(?:"[^"]+"|'[^']+'|[^>\\s]+))?)+)?\s*(\/?)>(\n*)/, It = /^<!--(.+?)-->/, Kt = /&(?:#(\d\d{2,})|#x([\da-fA-F]{2,})|([a-zA-Z][a-zA-Z1-4]{1,8}));/g, _t = { b: function(r) {
1501
- r.weight = "bold";
1502
- }, strong: function(r) {
1503
- r.weight = "bold";
1504
- }, i: function(r) {
1505
- r.style = "italic";
1506
- }, em: function(r) {
1507
- r.style = "italic";
1508
- }, dfn: function(r) {
1509
- r.style = "italic";
1510
- }, cite: function(r) {
1511
- r.style = "italic";
1512
- }, code: function(r) {
1513
- r.family = "monospace";
1514
- }, kbd: function(r) {
1515
- r.family = "monospace";
1516
- }, samp: function(r) {
1517
- r.family = "monospace";
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
- return t in be ? be[t] : n;
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
- return a;
1554
- }
1555
- const bt = { copyright: "©", textcopyright: "©", dag: "†", textdagger: "†", ddag: "‡", textdaggerdbl: "‡", guillemotleft: "«", guillemotright: "»", guilsinglleft: "‹", guilsinglright: "›", ldots: "…", dots: "…", textellipsis: "…", lq: "‘", P: "¶", textparagraph: "¶", pounds: "£", textsterling: "£", quotedblbase: "„", quotesinglbase: "‚", rq: "’", S: "§", sim: "~", textasciicircum: "^", textasciitilde: "˜", texttildelow: "~", textasteriskcentered: "*", textbackslash: "'", textbar: "|", textbardbl: "╎", textbigcircle: "◯", textbraceleft: "{", textbraceright: "}", textbullet: "•", textdollar: "$", textemdash: "—", textendash: "—", texteuro: "€", eurosym: "€", euro: "€", textexclamdown: "¡", textgreater: ">", textless: "<", textordfeminine: "ª", textordmasculine: "º", textperiodcentered: "·", cdot: "·", textquestiondown: "¿", textquotedblleft: "“", textquotedblright: "”", textquoteleft: "‘", textquoteright: "’", textquotestraightbase: "‚", textquotestraightdblbase: "„", textregistered: "®", textthreequartersemdash: "-", texttrademark: "™", texttwelveudash: "-", textunderscore: "_", textvisiblespace: "␣", gets: "←", textleftarrow: "←", to: "→", textrightarrow: "→", textdegree: "°", infty: "∞", triangle: "△", triangledown: "▽", blacktriangle: "▲", blacktriangledown: "▼", angle: "∠", sphericalangle: "∢", aleph: "ℵ", hbar: "ħ", imath: "𝚤", jmath: "𝚥", ell: "ℓ", wp: "℘", Re: "ℜ", Im: "ℑ", mho: "℧", prime: "′", emptyset: "∅", nabla: "∇", surd: "√", partial: "∂", top: "⟙", bot: "⟂", vdash: "⟝", dashv: "⟞", forall: "∀", exists: "∃", nexists: "∄", neg: "¬", lnot: "¬", flat: "♭", natural: "♮", sharp: "♯", backslash: "\\", Box: "□", Diamond: "♢", clubsuit: "♣", diamondsuit: "♦", heartsuit: "♥", spadesuit: "♠", Join: "⨝", blacksquare: "■", bigstar: "★", diagdown: "╲", diagup: "╱", blacklozenge: "⧫", rfloor: "⌋", lfloor: "⌊", rceil: "⌉", lceil: "⌈", rangle: "⟩", langle: "⟨", sum: "∑", int: "∫", oint: "∮", prod: "∏", coprod: "∏", bigcap: "∩", bigcup: "∪", bigsqcup: "⊔", bigvee: "∨", bigwedge: "∧", bigodot: "⊙", bigotimes: "⊗", bigoplus: "⊕", biguplus: "⊎", alpha: "α", beta: "β", chi: "χ", delta: "δ", epsilon: "ε", eta: "η", gamma: "γ", iota: "ι", kappa: "κ", lambda: "λ", mu: "μ", nu: "ν", omega: "ω", phi: "φ", pi: "π", psi: "ψ", rho: "ρ", sigma: "σ", tau: "τ", theta: "θ", upsilon: "υ", xi: "ξ", zeta: "ζ", Alpha: "Α", Beta: "Β", Chi: "Χ", Delta: "Δ", Epsilon: "Ε", Eta: "Η", Gamma: "Γ", Iota: "Ι", Kappa: "Κ", Lambda: "Λ", Mu: "Μ", Nu: "Ν", Omega: "Ω", Phi: "Φ", Pi: "Π", Psi: "Ψ", Rho: "Ρ", Sigma: "Σ", Tau: "Τ", Theta: "Θ", Upsilon: "Υ", Xi: "Ξ", Zeta: "Ζ", aa: "å", AA: "Å", ae: "æ", AE: "Æ", dh: "ð", DH: "Ð", dj: "đ", DJ: "Đ", ij: "ij", IJ: "IJ", l: "ł", L: "Ł", ng: "ŋ", NG: "Ŋ", o: "ø", O: "Ø", oe: "œ", OE: "Œ", ss: "ß", SS: "SS", th: "þ", TH: "Þ" };
1556
- var we = /^(\^|_|\\[^#$%&~_^\\{}()\s]+)(\{)?/, xe = /^%[^\n]+(?:\n|$)/, Ft = /^[^#$%&~_^\\{}]+/, qe = /^\\([&{}$%#_])/, Ye = /(?:\\[\\@,!:;-]|-{2,3}|[!?]`|``?|,,|''?|~|<<|>>)/g, Qt = { "---": "—", "--": "–", "!`": "¡", "?`": "¿", "``": "“", ",,": "„", "''": "”", "`": "‘", "'": "’", "<<": "«", ">>": "»", "~": " ", "\\-": "­", "\\,": " ", "\\;": " ", "\\:": " ", "\\!": " ", "\\@": "\uFEFF", "\\\\": "\\newline{}" }, W = { bf: function(r) {
1557
- r.weight = "bold";
1558
- }, it: function(r) {
1559
- r.style = "italic";
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
- }(r) || function() {
1607
- throw new TypeError(`Invalid attempt to spread non-iterable instance.
1608
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1609
- }();
1610
- }
1611
- function jt(r, n) {
1612
- (n == null || n > r.length) && (n = r.length);
1613
- for (var a = 0, o = new Array(n); a < n; a++)
1614
- o[a] = r[a];
1615
- return o;
1616
- }
1617
- var _e = { center: "middle", right: "end" }, ee = { middle: 0.5, center: 0.5, bottom: 1, end: 1 }, re = function(r, n) {
1618
- return !r && !n || r === n;
1619
- };
1620
- function Xe(r, n) {
1621
- var a = [], o = n.font(), t = o.size, u = o.family, d = n.align(), p = n.createElement();
1622
- if (r.length) {
1623
- var b = o.height, w = n.valign(), A = n.height()(), E = n.width()(0), O = !isFinite(E) && r.length === 1, P = O ? null : n.x(), I = ot(b / t), B = O ? null : ot(b / (1.15 * t + (b - t) / 2));
1624
- if (ee[w] && isFinite(A)) {
1625
- var M = w === "bottom" ? 1 : 0.5;
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
- var F = d === "justify", $ = 0;
1629
- d === "right" ? $ = E : d === "center" && ($ = E / 2);
1630
- for (var N = [], K = "tspan", G = null, V = "", j = function() {
1631
- if (V) {
1632
- var Tt = p(K, G, V);
1633
- N.push(Tt);
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
- K = "tspan", G = null, V = "";
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
- return p.apply(void 0, ["text", { fontFamily: u, fontSize: t, textAnchor: _e[d] || "start" }].concat(a));
1655
- }
1656
- var Je = { middle: 0.5, center: 0.5, bottom: 1, end: 1 };
1657
- function Ke(r, n, a) {
1658
- if (r.length) {
1659
- a.textBaseline = "middle";
1660
- var o = n.font(), t = o.height, u = o.size, d = n.valign(), p = n.height()(), b = n.width()(0), w = n.align(), A = w === "justify", E = 0.5 * t, O = Je[d];
1661
- if (O && isFinite(p)) {
1662
- var P = r.length * t;
1663
- E += p * O - P * O;
1664
- }
1665
- r.forEach(function(I, B) {
1666
- var M = n.x()(B), F = B * t + E, $ = 0, N = 0;
1667
- I.forEach(function(V) {
1668
- V.whitespace && $++, N += V.width;
1669
- });
1670
- var K = 0, G = B === r.length - 1 || I[I.length - 1] instanceof X;
1671
- A && I.length > 1 && !G && (K = (b - N) / $), I.forEach(function(V) {
1672
- a.font = V.font;
1673
- var j = V.font, nt = j.baseline ? u * -j.baseline + 0.15 * u : 0;
1674
- a.fillStyle = function(wt, ct) {
1675
- return wt.color ? wt.color : ct.href ? "#00C" : "#000";
1676
- }(j, V);
1677
- var rt = 0;
1678
- if (w === "right" ? rt += b - N : w === "center" ? rt += b / 2 - N / 2 : w === "justify" && (V.whitespace || V instanceof X) && (M += K), a.fillText(V.value, M + rt, F + nt), V.href) {
1679
- a.beginPath(), a.strokeStyle = a.fillStyle;
1680
- var ft = Math.floor(F + 0.45 * u) + 0.5;
1681
- a.moveTo(M + rt, ft), a.lineTo(M + rt + V.width, ft), a.stroke();
1682
- }
1683
- M += V.width;
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
- function ne(r) {
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
- return n;
1701
- }
1702
- function kt(r) {
1703
- return kt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1704
- return typeof n;
1705
- } : function(n) {
1706
- return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
1707
- }, kt(r);
1708
- }
1709
- function ie(r, n) {
1710
- for (var a = 0; a < n.length; a++) {
1711
- var o = n[a];
1712
- o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(r, (t = function(u, d) {
1713
- if (kt(u) !== "object" || u === null)
1714
- return u;
1715
- var p = u[Symbol.toPrimitive];
1716
- if (p !== void 0) {
1717
- var b = p.call(u, d);
1718
- if (kt(b) !== "object")
1719
- return b;
1720
- throw new TypeError("@@toPrimitive must return a primitive value.");
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
- return String(u);
1723
- }(o.key, "string"), kt(t) === "symbol" ? t : String(t)), o);
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
- var t;
1726
- }
1727
- var Te = R(), ht = function(r) {
1728
- return typeof r == "function" ? r : function() {
1729
- return r;
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
- }, J = function() {
1732
- function r(o) {
1733
- if (function(u, d) {
1734
- if (!(u instanceof d))
1735
- throw new TypeError("Cannot call a class as a function");
1736
- }(this, r), this.props = { overflow: "ellipsis", lineclamp: null, align: "left", wordBreak: null, valign: "top", width: function() {
1737
- return 1 / 0;
1738
- }, height: function() {
1739
- return 1 / 0;
1740
- }, x: function() {
1741
- return 0;
1742
- }, font: null, tAnchor: 0, parser: r.defaultparser }, o)
1743
- for (var t in o)
1744
- typeof this[t] == "function" && this[t](o[t]);
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 n, a;
1747
- return n = r, a = [{ key: "linebreak", value: function(o) {
1748
- var t = this, u = this.props.parser(String(o)), d = this.font(), p = function(b, w, A) {
1749
- if (!b.length)
1750
- return [];
1751
- var E = w.height(), O = w.width(), P = w.overflowLine(), I = w.overflowWrap(), B = R(A, !0, !1), M = isFinite(E()) ? Math.floor(E() / A.height) : 1 / 0;
1752
- if (!E() && !O(0) || !M)
1753
- return [];
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
- F !== K[K.length - 1] && K.push(F);
1786
- var ae = 0, pt = 0, Z = K.map(function(Tt) {
1787
- for (var et, St = ae; (et = b[St]) && (et.whitespace || !et.value); )
1788
- St++;
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
- return tr && zt.push(tr), zt.width = zt.reduce(function(er, Vr) {
1796
- return er + Vr.width;
1797
- }, 0), zt.width > pt && (pt = zt.width), zt;
1798
- });
1799
- if (Z.hasLineOverflow = !1, P) {
1800
- var Re = P === "ellipsis" ? "" : P;
1801
- Z.forEach(function(Tt, et) {
1802
- var St = O(et);
1803
- if (Tt.width > St) {
1804
- var xt = new z(Re);
1805
- xt.font = A, xt.width = H(Re, B), te(Tt, St, xt), Z.hasLineOverflow = !0;
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
- if (typeof o != "function")
1852
- throw new Error("Unknown parser: " + o);
1853
- return this.props.parser = o, this;
1854
- } }, { key: "createElement", value: function(o) {
1855
- return arguments.length ? (this.props.createElement = o, this) : this.props.createElement || r.createElement;
1856
- } }, { key: "render", value: function() {
1857
- var o = ke(arguments);
1858
- return typeof o.text == "string" && (o.text = this.linebreak(o.text)), o.ctx ? Ke(o.text, this, o.ctx) : Xe(o.text, this);
1859
- } }], a && ie(n.prototype, a), Object.defineProperty(n, "prototype", { writable: !1 }), r;
1860
- }();
1861
- function dt(r) {
1862
- return dt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1863
- return typeof n;
1864
- } : function(n) {
1865
- return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
1866
- }, dt(r);
1867
- }
1868
- function $t(r, n) {
1869
- (n == null || n > r.length) && (n = r.length);
1870
- for (var a = 0, o = new Array(n); a < n; a++)
1871
- o[a] = r[a];
1872
- return o;
1873
- }
1874
- function Ze(r, n) {
1875
- for (var a = 0; a < n.length; a++) {
1876
- var o = n[a];
1877
- o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(r, (t = function(u, d) {
1878
- if (dt(u) !== "object" || u === null)
1879
- return u;
1880
- var p = u[Symbol.toPrimitive];
1881
- if (p !== void 0) {
1882
- var b = p.call(u, d);
1883
- if (dt(b) !== "object")
1884
- return b;
1885
- throw new TypeError("@@toPrimitive must return a primitive value.");
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
- return String(u);
1888
- }(o.key, "string"), dt(t) === "symbol" ? t : String(t)), o);
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
- var t;
1891
- }
1892
- var oe = function(r) {
1893
- return typeof r == "function" ? r : function() {
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
- var n, a;
1911
- return n = r, a = [{ key: "anchor", value: function(o) {
1912
- var t = this.props, u = t.hAnchor, d = t.vAnchor, p = t.width, b = t.height;
1913
- if (!arguments.length)
1914
- return [u * p(0), d * b(0)];
1915
- if (typeof o == "string") {
1916
- var w = this.props;
1917
- o.toLowerCase().trim().split(/\s+/).forEach(function(A) {
1918
- A === "top" && (w.vAnchor = -0), A === "middle" && (w.vAnchor = -0.5), A === "bottom" && (w.vAnchor = -1), A === "left" && (w.hAnchor = -0), A === "center" && (w.hAnchor = -0.5), A === "right" && (w.hAnchor = -1);
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
- return this;
1922
- } }, { key: "width", value: function(o) {
1923
- return arguments.length ? (this.props.width = oe(o), this) : this.props.width;
1924
- } }, { key: "height", value: function(o) {
1925
- return arguments.length ? (this.props.height = oe(o), this) : this.props.height;
1926
- } }, { key: "rotate", value: function(o) {
1927
- return arguments.length ? (this.props.rotation = o, this) : this.props.rotation;
1928
- } }, { key: "createElement", value: function(o) {
1929
- return arguments.length ? (this.props.createElement = o, this) : this.props.createElement || r.createElement;
1930
- } }, { key: "canvas", value: function(o, t) {
1931
- var u, d = o.getContext ? o.getContext("2d") : o;
1932
- return d.save(), d.rotate(this.rotate() * Math.PI / 180), d.translate.apply(d, function(p) {
1933
- if (Array.isArray(p))
1934
- return $t(p);
1935
- }(u = this.anchor()) || function(p) {
1936
- if (typeof Symbol < "u" && p[Symbol.iterator] != null || p["@@iterator"] != null)
1937
- return Array.from(p);
1938
- }(u) || function(p, b) {
1939
- if (p) {
1940
- if (typeof p == "string")
1941
- return $t(p, b);
1942
- var w = Object.prototype.toString.call(p).slice(8, -1);
1943
- return w === "Object" && p.constructor && (w = p.constructor.name), w === "Map" || w === "Set" ? Array.from(p) : w === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(w) ? $t(p, b) : void 0;
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
- }(u) || function() {
1946
- throw new TypeError(`Invalid attempt to spread non-iterable instance.
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
- }()), t(d), d.restore(), d;
1949
- } }, { key: "render", value: function() {
1950
- var o = ke(arguments);
1951
- if (o.d3)
1952
- return o.d3.attr("transform", "rotate(".concat(this.rotate(), ") translate(").concat(this.anchor(), ")"));
1953
- if (o.ctx)
1954
- return this.canvas(o.ctx, o.fn);
1955
- if (o.text) {
1956
- var t = typeof o.text.render == "function" ? o.text.render() : o.text;
1957
- return this.createElement()("g", { transform: "rotate(".concat(this.rotate(), ") translate(").concat(this.anchor(), ")") }, t);
1958
- }
1959
- } }], a && Ze(n.prototype, a), Object.defineProperty(n, "prototype", { writable: !1 }), r;
1960
- }(), Ce = Object.prototype.hasOwnProperty, Dt = {};
1961
- function Qe(r) {
1962
- return Dt[r] || (Dt[r] = r.replace(/([a-z])([A-Z])/g, function(n, a, o) {
1963
- return a + "-" + o.toLowerCase();
1964
- })), Dt[r];
1965
- }
1966
- function Oe(r, n) {
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
- typeof n == "string" && (n = document.createTextNode(n)), r.appendChild(n);
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
- J.createElement = se, J.textparser = Et, J.defaultparser = Et, J.htmlparser = function(r) {
1987
- r = String(r || "").trim();
1988
- for (var n, a, o = { weight: null, style: null, sub: !1, sup: !1, href: null, color: null, rel: null, target: null }, t = [], u = [], d = function(E) {
1989
- for (var O in o)
1990
- o[O] && (E[O] = o[O]);
1991
- t.push(E);
1992
- }, p = function(E) {
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
- for (var A = t[t.length - 1]; A instanceof X; )
2018
- t.pop(), A = t[t.length - 1];
2019
- return t;
2020
- }, J.latexparser = function(r) {
2021
- r = String(r || "").trim();
2022
- var n = [0];
2023
- r = r.replace(/\\verb,(.*?),/, function(M, F) {
2024
- return n.push(F), "\\verb," + (n.length - 1) + ",";
2025
- }).replace(/\\\\\n/g, function() {
2026
- return "\\\\";
2027
- }).replace(Ye, function(M, F, $) {
2028
- return $.charAt(F - 1) === "\\" ? M : Qt[M];
2029
- }).replace(/\n\s+/g, function(M) {
2030
- return /\n/.test(M.slice(1)) ? "\\par " : M;
2031
- }).replace(/\\symbol\{(\d+)\}/, function(M, F, $, N) {
2032
- return N.charAt($ - 1) === "\\" ? M : String.fromCharCode(1 * F);
2033
- }).replace(/(^|[^\\])(\^|_)(\d|[^{]\S*)/g, function(M, F, $, N) {
2034
- return F + $ + "{" + N + "}";
2035
- }).replace(/\\verb,(.*?),/, function(M, F) {
2036
- return "\\verb,".concat(n[+F], ",");
2037
- });
2038
- for (var a, o = { weight: null, italic: null, variant: null, sub: !1, sup: !1, href: null }, t = [], u = [], d = function(M) {
2039
- for (var F in o)
2040
- o[F] && (M[F] = o[F]);
2041
- return t.push(M), M;
2042
- }, p = function() {
2043
- u.push(o), o = Object.create(o);
2044
- }, b = function() {
2045
- if (!u.length)
2046
- throw new Error("Unexpected }");
2047
- o = u.pop();
2048
- }, w = { tokens: t, open_context: p, close_context: b, add_token: d }; r.length; ) {
2049
- if (a = Ft.exec(r))
2050
- Et(a[0], !1).forEach(d);
2051
- else if (a = qe.exec(r))
2052
- d(new z(a[1]));
2053
- else if (!(a = xe.exec(r))) {
2054
- if (a = /^\{/.exec(r))
2055
- p();
2056
- else if (a = /^\}/.exec(r))
2057
- b();
2058
- else if (!(a = /^\$/.exec(r)))
2059
- if (a = /^\\verb,([^,]+),/.exec(r))
2060
- d(new z(a[1]));
2061
- else if (a = we.exec(r)) {
2062
- var A = a[1].slice(1) || a[1], E = !!a[2];
2063
- if (/^(La)?TeX$/i.test(A)) {
2064
- p(), o.family = "serif";
2065
- var O = void 0;
2066
- A === "LaTeX" && ((O = d(new z("L"))).tracking = -0.25, (O = d(new z("A"))).size = 0.7, O.baseline = 0.3, O.tracking = -0.1), (O = d(new z("T"))).tracking = -0.17, (O = d(new z("E"))).baseline = -0.22, O.tracking = -0.13, O = d(new z("X")), b();
2067
- } else if (A in bt)
2068
- d(new z(bt[A])), E && p();
2069
- else if (A in W) {
2070
- var P = [], I = W[A].length - 1, B = void 0;
2071
- if (I) {
2072
- for (E = !1, r = r.slice(a[0].length - 1); I--; ) {
2073
- if (!(B = /^\{([^}]+)\}/.exec(r)))
2074
- throw new Error(A + " is missing an argument");
2075
- P.push(B[1]), r = r.slice(B[0].length);
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
- a[0] = /^\{/.exec(r) ? "{" : "", E = !!a[0];
1822
+ l[0] = /^\{/.exec(e) ? "{" : "", P = !!l[0];
2078
1823
  }
2079
- E && p(), W[A].apply(w, [o].concat(P));
2080
- } else
2081
- console.warn("unknown latex command", A), d(new z(a[1])), E && p();
2082
- } else
2083
- a = [r.slice(0, 1)], d(new z(a[0]));
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
- r = r.slice(a[0].length);
2086
- }
2087
- return t;
2088
- }, J.measureText = function(r, n, a) {
2089
- return H(r, R(n), a);
2090
- }, J.Token = z, J.Break = lt, J.LineBreak = X, J.SoftHyphen = ut, J.Rotator = Se, Se.createElement = se;
2091
- const Pe = J;
2092
- return i.default;
2093
- })());
2094
- })(Hr);
2095
- var vn = Hr.exports;
2096
- const xr = /* @__PURE__ */ Mr(vn);
2097
- function ir(h) {
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 or(h) {
2101
- return h.children[0].innerHTML;
1844
+ function Ge(a) {
1845
+ return a.children[0].innerHTML;
2102
1846
  }
2103
- function mn(h, e) {
2104
- const s = mt(h), { fontSize: i, font: l, padding: c = 0 } = h.properties.style || {};
2105
- if (s.width === s.height && s.width === 0)
2106
- return;
2107
- const g = new xr({
2108
- font: `${i}px/${i}px ${l}`.replace(/(px)+/g, "px"),
2109
- width: s.width - c * 2,
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: xr.createElement
1859
+ createElement: Er.createElement
2117
1860
  });
2118
- g.overflowWrap("break-word");
2119
- const y = g.linebreak(
2120
- h.properties.content.replaceAll(`
1861
+ d.overflowWrap("break-word");
1862
+ const f = d.linebreak(
1863
+ a.properties.content.replaceAll(`
2121
1864
  `, "<br>")
2122
- ).render(), f = [...y.children];
2123
- let m = 0;
2124
- const v = [];
2125
- h.properties.content.split(`
2126
- `).forEach((_) => {
2127
- let R = _;
2128
- for (; R.length && m < f.length; ) {
2129
- if (f[m].innerHTML === "&nbsp;") {
2130
- R.startsWith(`
2131
- `) || v.push(m), m++;
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 === "&nbsp;") {
1873
+ _.startsWith(`
1874
+ `) || y.push(p), p++;
2132
1875
  break;
2133
1876
  }
2134
- const S = ir(or(f[m]));
2135
- R.startsWith(S) && (R = R.slice(S.length).trim()), m++;
2136
- }
2137
- }), v.forEach((_) => y.removeChild(f[_]));
2138
- const k = h.properties.content.match(/(https?:\/\/.*)/gm), C = k ? k.map((_) => _.split(" ")[0]) : [];
2139
- y.setAttribute("transform", `translate(${c}, ${c})`), C.forEach((_) => {
2140
- let R = _;
2141
- const S = [];
2142
- for (; R.length > 0; ) {
2143
- const D = f.find((T) => !!T.children[0] && T.children[0].tagName === "tspan" && R.startsWith(ir(or(T))));
2144
- if (!D)
2145
- break;
2146
- S.push(D);
2147
- const L = ir(D.children[0].innerHTML).length;
2148
- if (!L)
2149
- break;
2150
- R = R.slice(L);
2151
- }
2152
- S.forEach((D) => {
2153
- const L = document.createElementNS("http://www.w3.org/2000/svg", "a");
2154
- L.setAttribute("href", _), L.setAttribute("target", "_blank"), L.innerHTML = or(D), D.children[0].innerHTML = "", D.children[0].appendChild(L);
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
- }), e.appendChild(y);
1899
+ }), t.appendChild(f);
2157
1900
  }
2158
1901
  const Ar = 20;
2159
- class bn extends Br {
2160
- constructor(e, s = {}) {
1902
+ class Mn extends Fr {
1903
+ constructor(t, i = {}) {
2161
1904
  super(
2162
- e,
1905
+ t,
2163
1906
  `
2164
- <div class="annotation-text-handle">
2165
- <span class="handle line-handle top" data-handle-id="0"></span>
2166
- <span class="handle line-handle bottom" data-handle-id="1"></span>
2167
- <span class="handle line-handle left" data-handle-id="2"></span>
2168
- <span class="handle line-handle right" data-handle-id="3"></span>
2169
- <span class="handle top right point-handle top-right" data-handle-id="4"></span>
2170
- <span class="handle left top point-handle top-left" data-handle-id="5"></span>
2171
- <span class="handle bottom right point-handle bottom-right" data-handle-id="6"></span>
2172
- <span class="handle left bottom left-handle point-handle bottom-left" data-handle-id="7"></span>
2173
- <textarea wrap="on"></textarea>
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
- ), x(this, "textArea"), x(this, "handleSize"), x(this, "rect", { x: 0, y: 0, width: 0, height: 0 }), x(this, "annotation", { ...nr }), x(this, "startX", 0), x(this, "startY", 0), x(this, "handles", []), x(this, "draggedHandle", Y), x(this, "isFocused", !1), x(this, "placeholder", "Type your text here..."), x(this, "_onFocus", () => {
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
- }), x(this, "_onBlur", () => {
1921
+ }), w(this, "_onBlur", () => {
2179
1922
  this.isFocused = !1;
2180
- }), x(this, "startDrawing", (l, c, g = yn(l, c, 0, 0, "", Wt)) => {
2181
- this.add(g);
2182
- const y = this.ogma.view.graphToScreenCoordinates({ x: l, y: c });
2183
- this.select(g.id), this.startDragging(this.getById(g.id), y.x, y.y), this.draggedHandle = 6;
2184
- }), x(this, "cancelDrawing", () => {
2185
- this.isDragging && (this.remove(this.annotation.id), this.annotation = { ...nr }, this.draggedHandle = Y, this.isDragging = !1, this.emit(Vt, this.annotation));
2186
- }), x(this, "startDragging", (l, c, g) => {
2187
- this.annotation = l;
2188
- const y = vt(this.annotation), f = mt(this.annotation);
2189
- this.rect.x = y.x, this.rect.y = y.y, this.rect.width = f.width, this.rect.height = f.height, this.startX = c, this.startY = g, this.disableDragging(), this.textArea.classList.add("noevents"), this.textArea.setAttribute("disabled", "disabled"), this.emit(Ne, this.annotation), this.isDragging = !0;
2190
- }), x(this, "onHandleMouseDown", (l) => {
2191
- const c = this.getById(this.selectedId) || this.getById(this.hoveredId);
2192
- if (!c)
2193
- return;
2194
- this.selectedId !== c.id && this.select(this.hoveredId);
2195
- const { x: g, y } = Me(l, this.ogma.getContainer());
2196
- this.startDragging(c, g, y), this.draggedHandle = Lr(l.target);
2197
- }), x(this, "onMouseMove", (l) => {
2198
- requestAnimationFrame(() => this._onMouseMove(l));
2199
- }), x(this, "_onMouseMove", (l) => {
2200
- if (!this.isDragging)
2201
- return;
2202
- l.stopPropagation(), l.preventDefault();
2203
- const c = this.handles[this.draggedHandle], g = c.classList.contains("top"), y = c.classList.contains("left"), f = c.classList.contains("right"), m = c.classList.contains("bottom"), v = c.classList.contains("line-handle"), { x: k, y: C } = Me(
2204
- l,
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
- nn(this.annotation, T, U, H, it), this.emit(ze, this.annotation, "text"), this.refreshEditor(), this.layer.refresh();
2216
- }), x(this, "onMouseUp", () => {
2217
- !this.isDragging || this.draggedHandle === Y || (this.restoreDragging(), this.textArea.classList.remove("noevents"), this.textArea.removeAttribute("disabled"), this.emit(Vt, this.annotation), this.isDragging = !1, this.draggedHandle = Y);
2218
- }), x(this, "_onMousedown", (l) => {
2219
- l.stopPropagation();
2220
- }), x(this, "onViewChanged", () => {
2221
- const l = Math.max(2, this.handleSize / this.ogma.view.getZoom());
2222
- document.documentElement.style.setProperty("--handle-scale", `${1 / l}`);
2223
- }), x(this, "_onInput", () => {
2224
- const l = this.getById(this.selectedId);
2225
- l && (this.textArea.value = this.textArea.value.replace(/ +(?= )/g, ""), this.textArea.focus(), l.properties.content = this.textArea.value, this.emit(cr, l), this.layer.refresh());
2226
- }), this.showeditorOnHover = !1, this.handleSize = wr.handleSize, this.placeholder = wr.placeholder;
2227
- const i = this.textArea = this.editor.element.querySelector("textarea");
2228
- i.addEventListener("input", this._onInput), i.addEventListener("focus", this._onFocus), i.addEventListener("blur", this._onBlur), i.addEventListener("mousedown", this._onMousedown), i.spellcheck = !1, this.handles = Array.prototype.slice.call(
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
- (l) => l.addEventListener("mousedown", this.onHandleMouseDown)
2232
- ), document.addEventListener("mouseup", this.onMouseUp), document.addEventListener("mousemove", this.onMouseMove, !0), e.events.on(["viewChanged", "zoom"], this.onViewChanged);
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: e, y: s }, i = 0) {
2238
- const l = { x: e, y: s }, c = this.ogma.view.getAngle();
2239
- return this.elements.find((g) => {
2240
- const { x: y, y: f } = vt(g), { width: m, height: v } = mt(g), k = { x: y, y: f }, { x: C, y: _ } = at(Ct(l, k), -c);
2241
- return C > -i && C < m + i && _ > -i && _ < v + i;
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(e) {
2245
- e.innerHTML = "";
2246
- const s = "", i = this.ogma.view.getAngle();
2247
- this.elements.forEach((c, g) => {
2248
- const y = `class${g}`, f = mt(c), m = vt(c), v = c.id, {
2249
- color: k,
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: R,
2253
- strokeWidth: S,
2254
- strokeType: D,
2255
- background: L
2256
- } = c.properties.style || Wt;
2257
- if (v === this.selectedId)
2258
- return;
2259
- const T = ce("g");
2260
- T.classList.add("annotation-text"), T.setAttribute("fill", `${k}`), T.setAttribute("font-size", `${C}px`), T.setAttribute("font-family", `${_}`);
2261
- const U = ce("rect");
2262
- let H = !1;
2263
- D && D !== "none" && (H = !0, U.setAttribute("stroke", R || "black"), U.setAttribute("stroke-width", `${S}`), D === "dashed" && U.setAttribute("stroke-dasharray", "5,5")), (L && L.length || H) && (H = !0, U.setAttribute("fill", L || "transparent")), H && (U.setAttribute("width", `${f.width}`), U.setAttribute("height", `${f.height}`)), T.appendChild(U), mn(c, T);
2264
- const { x: it, y: At } = at(m, -i);
2265
- T.setAttribute("transform", `translate(${it},${At})`), T.classList.add(y), T.setAttribute("data-annotation", `${c.id}`), T.setAttribute("data-annotation-type", "text"), e.appendChild(T);
2266
- });
2267
- const l = ce("style");
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 e = this.ogma.view.getAngle();
2272
- [...this.layer.element.children].forEach((s) => {
2273
- const i = s.getAttribute("data-annotation");
2274
- if (!i)
2275
- return;
2276
- const l = vt(this.getById(i)), { x: c, y: g } = at(l, -e);
2277
- s.setAttribute("transform", `translate(${c},${g})`);
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 nr;
2021
+ return Ye;
2282
2022
  }
2283
2023
  refreshEditor() {
2284
- if (+this.selectedId < 0 && +this.hoveredId < 0)
2285
- return;
2286
- const e = this.getById(this.selectedId) || this.getById(this.hoveredId), s = mt(e), i = this.ogma.view.graphToScreenCoordinates(
2287
- vt(e)
2288
- ), l = this.ogma.view.getZoom(), {
2289
- font: c,
2290
- fontSize: g,
2291
- color: y,
2292
- background: f,
2293
- padding: m = 0
2294
- } = e.properties.style || Wt, v = (g || 1) * l;
2295
- this.textArea.value = e.properties.content, this.editor.element.style.transform = `translate(${i.x}px, ${i.y}px)translate(-50%, -50%)translate(${s.width / 2 * l}px, ${s.height / 2 * l}px)`, this.editor.element.style.width = `${s.width * l}px`, this.editor.element.style.height = `${s.height * l}px`, this.textArea.style.font = `${v} ${c}`, this.textArea.style.fontFamily = c || "sans-serif", this.textArea.style.fontSize = `${v}px`, this.textArea.style.padding = `${l * m}px`, this.textArea.style.lineHeight = `${v}px`, this.textArea.style.boxSizing = "border-box", this.textArea.style.color = y || "black", this.textArea.style.background = f || "transparent", this.textArea.placeholder = this.placeholder, this.layer.refresh();
2296
- }
2297
- select(e) {
2298
- super.select(e), this.textArea.focus();
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 wn {
2047
+ class Dn {
2305
2048
  constructor() {
2306
- x(this, "links", {}), x(this, "linksByTargetId", {}), x(this, "linksByArrowId", {});
2307
- }
2308
- add(e, s, i, l, c) {
2309
- const g = Be(), y = e.id, f = {
2310
- id: g,
2311
- arrow: y,
2312
- target: i,
2313
- targetType: l,
2314
- connectionPoint: c,
2315
- side: s
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[g] = f, this.linksByTargetId[i] || (this.linksByTargetId[i] = []), this.linksByTargetId[i].push(g), this.linksByArrowId[y] || (this.linksByArrowId[y] = {}), this.linksByArrowId[y][s] = g, e.properties.link = e.properties.link || {}, e.properties.link[s] = {
2318
- id: i,
2319
- side: s,
2320
- type: l,
2321
- magnet: c
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(e, s) {
2325
- var i;
2326
- return !!((i = this.linksByArrowId[e]) != null && i[s]);
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(e, s) {
2330
- var i, l;
2331
- const c = e.id, g = (i = this.linksByArrowId[c]) == null ? void 0 : i[s];
2332
- if ((l = e.properties.link) == null || delete l[s], !g)
2333
- return this;
2334
- const y = this.links[g];
2335
- delete this.links[g];
2336
- const f = this.linksByTargetId[y.target];
2337
- for (let m = 0; m < f.length; m++)
2338
- if (f[m] === g) {
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[c][s], this;
2084
+ return delete this.linksByArrowId[u][i], this;
2343
2085
  }
2344
- getArrowLink(e, s) {
2345
- var i;
2346
- const l = (i = this.linksByArrowId[e]) == null ? void 0 : i[s];
2347
- return l ? this.links[l] : null;
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(e, s) {
2350
- var i;
2351
- return ((i = this.linksByTargetId[e]) == null ? void 0 : i.map((l) => this.links[l]).filter((l) => l.targetType === s)) ?? [];
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(e) {
2354
- Object.values(this.links).forEach(e);
2095
+ forEach(t) {
2096
+ Object.values(this.links).forEach(t);
2355
2097
  }
2356
2098
  }
2357
- const st = (h) => h.properties.type === "arrow", yt = (h) => h.properties.type === "text", Er = (h) => h.type === "FeatureCollection", xn = {
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
- }, _r = ["start", "end"], kr = [
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 An extends Nr {
2378
- constructor(e, s = {}) {
2379
- super(), x(this, "arrows"), x(this, "texts"), x(this, "links", new wn()), x(this, "layer"), x(this, "annotations"), x(this, "ogma"), x(this, "options"), x(this, "selected", null), x(this, "updateTimeout", 0), x(this, "hoveredNode", null), x(this, "dragged", null), x(this, "textToMagnet"), x(this, "activeLinks", []), x(this, "_render", (i) => {
2380
- if (!this.dragged || this.textToMagnet === void 0)
2381
- return;
2382
- i.beginPath(), i.fillStyle = "green";
2383
- const l = this.ogma.view.getZoom();
2384
- kr.forEach((c) => {
2385
- if (!this.textToMagnet)
2386
- return;
2387
- const g = mt(this.textToMagnet), y = vt(this.textToMagnet), f = je(c, { x: g.width, y: g.height }), m = at(f, this.ogma.view.getAngle()), { x: v, y: k } = Ht(m, y);
2388
- i.moveTo(v, k), i.arc(v, k, this.options.magnetHandleRadius / l, 0, Math.PI * 2);
2389
- }), i.fill(), i.closePath();
2390
- }), x(this, "_onFeatureDrag", (i, l) => {
2391
- const c = l;
2392
- if (st(i) && c === "line")
2393
- ["start", "end"].find((g) => {
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 (st(i) && c !== "line") {
2398
- const g = c === "start" ? de(i) : $e(i);
2399
- this._snapToText(i, c, g) || this._findAndSnapToNode(i, c, g);
2400
- } else
2401
- yt(i) && (this.activeLinks.forEach(({ arrow: g, side: y, connectionPoint: f }) => {
2402
- const m = this.getAnnotation(g), v = mt(i), k = vt(i), C = je(f, { x: v.width, y: v.height }), _ = at(C, this.ogma.view.getAngle()), R = Ht(_, k);
2403
- m.geometry.coordinates[y === "start" ? 0 : 1] = [R.x, R.y];
2404
- }), this.activeLinks.length && this.arrows.refreshLayer());
2405
- this.layer.refresh(), this.emit(ze, i, l);
2406
- }), x(this, "_onFeatureDragEnd", (i) => {
2407
- this.dragged !== null && st(i) && de(this.dragged) && _r.forEach((l) => {
2408
- this.links.getArrowLink(i.id, l) && this.emit(dn, {
2409
- arrow: i,
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
- }), (yt(i) || st(i)) && this.onUpdate(i), this.dragged = null, this.activeLinks = [], this.textToMagnet = void 0, this.annotations.forEach((l) => l.enableDetection()), this.layer.refresh(), this.emit(Vt, i);
2413
- }), x(this, "_onFeatureDragStart", (i) => {
2414
- this.textToMagnet = void 0, st(i) ? this.dragged = i : yt(i) && this.activeLinks.push(...this.links.getTargetLinks(i.id, "text")), this.annotations.forEach((l) => {
2415
- const c = l.getSelectedFeature();
2416
- c && c !== i && l.unhover().unselect(), l.disableDetection();
2417
- }), this.emit(Ne, i);
2418
- }), x(this, "_onNodesDragStart", () => {
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
- }), x(this, "_onNodesDrag", (i) => {
2421
- const { dx: l, dy: c } = i;
2422
- this._moveNodes(i.nodes, l, c);
2423
- }), x(this, "_onLayoutEnd", (i) => {
2424
- i.ids.forEach((l, c) => {
2425
- this.links.getTargetLinks(l, "node").forEach((g) => {
2426
- const y = this.getAnnotation(g.arrow), f = g.side, m = Le(
2427
- y,
2428
- f === "start" ? "end" : "start"
2429
- ), v = i.positions.current[c], k = this.ogma.getNode(l).getAttribute("radius"), C = Fe(m, v, +k);
2430
- Bt(y, f, C.x, C.y);
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
- }), x(this, "_onAdded", (i) => {
2434
- this.emit(hr, i);
2435
- }), x(this, "_onRemoved", (i) => {
2436
- this.emit(ur, i);
2437
- }), x(this, "_onUnselect", (i) => {
2438
- this.selected = null, this.emit(lr, i);
2439
- }), x(this, "_onSelect", (i) => {
2440
- this.selected !== i && (this.selected = i, this.emit(ar, this.selected));
2441
- }), x(this, "onUpdate", (i) => {
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(i)
2182
+ () => this._onUpdate(r)
2444
2183
  );
2445
- }), x(this, "_onUpdate", (i) => {
2446
- this.emit(cr, i);
2447
- }), this.options = this.setOptions({ ...xn, ...s }), this.ogma = e, this.arrows = new pn(e, this.options), this.texts = new bn(e, this.options), this.annotations = [this.arrows, this.texts], this.annotations.forEach((i) => {
2448
- i.on(Ne, this._onFeatureDragStart).on(ze, this._onFeatureDrag).on(Vt, this._onFeatureDragEnd).on(cr, this.onUpdate).on(lr, this._onUnselect).on(ar, this._onSelect).on(hr, this._onAdded).on(ur, this._onRemoved);
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 = e.layers.addCanvasLayer(this._render), this.layer.moveToBottom();
2452
- }
2453
- _moveNodes(e, s, i) {
2454
- e.forEach((l) => {
2455
- const c = this.links.getTargetLinks(l.getId(), "node"), g = l.getPosition();
2456
- c.forEach((y) => {
2457
- const f = this.getAnnotation(y.arrow), m = y.side, v = Le(
2458
- f,
2459
- m === "start" ? "end" : "start"
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 k = g;
2462
- const C = +l.getAttribute("radius"), _ = 1e-6;
2463
- (y.connectionPoint.x - (g.x - s) > _ || y.connectionPoint.y - (g.y - i) > _) && (k = Fe(v, g, C)), Bt(f, m, k.x, k.y);
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(e, s, i) {
2468
- const l = this.texts.detect(i, this.options.detectMargin);
2469
- if (this.links.remove(e, s), !l)
2470
- return !1;
2471
- this.textToMagnet = l;
2472
- const c = this.findMagnetPoint(kr, l, i);
2473
- return c ? (Bt(e, s, c.point.x, c.point.y), this.links.add(e, s, l.id, "text", c.magnet), !0) : !1;
2474
- }
2475
- _findAndSnapToNode(e, s, i) {
2476
- var l, c;
2477
- const g = this.ogma.view.graphToScreenCoordinates(i), y = this.ogma.view.getElementAt(g);
2478
- this.links.remove(e, s), y && y.isNode ? ((l = this.hoveredNode) == null || l.setSelected(!1), this.hoveredNode = y, y.setSelected(!0), this._snapToNode(e, s, y, g)) : ((c = this.hoveredNode) == null || c.setSelected(!1), this.hoveredNode = null);
2479
- }
2480
- _snapToNode(e, s, i, l) {
2481
- const c = i.getPositionOnScreen(), g = +i.getAttribute("radius"), y = g * this.ogma.view.getZoom(), f = l.x - c.x, m = l.y - c.y, v = Math.sqrt(f * f + m * m), k = i.getPosition();
2482
- if (v < y + this.options.detectMargin) {
2483
- let C = k;
2484
- if (v > y / 2) {
2485
- const _ = Le(e, s === "end" ? "start" : "end");
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
- Bt(e, s, C.x, C.y), this.links.add(e, s, i.getId(), "node", C);
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 e = !1;
2230
+ let t = !1;
2493
2231
  this.links.forEach(
2494
- ({ connectionPoint: s, targetType: i, target: l, arrow: c, side: g }) => {
2495
- if (i !== "text")
2496
- return;
2497
- e = !0;
2498
- const y = this.getAnnotation(l), f = this.getAnnotation(c), m = mt(y), v = vt(y), k = je(s, { x: m.width, y: m.height }), C = at(k, this.ogma.view.getAngle()), _ = Ht(C, v);
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
- ), e && this.arrows.refreshLayer();
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(e, s, i) {
2510
- let l;
2511
- for (const c of e) {
2512
- const g = mt(s), y = vt(s), f = je(c, { x: g.width, y: g.height }), m = at(f, this.ogma.view.getAngle()), v = Ht(m, y), k = Ut(Ct(v, i)), C = Math.min(
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
- g.width / 2,
2516
- g.height / 2
2252
+ d.width / 2,
2253
+ d.height / 2
2517
2254
  );
2518
- if (k < Math.max(C, this.options.magnetHandleRadius)) {
2519
- l = {
2520
- point: v,
2521
- magnet: c
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 l;
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(e = {}) {
2270
+ setOptions(t = {}) {
2534
2271
  return this.options = {
2535
2272
  ...this.options || {},
2536
- ...e
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(e) {
2544
- const s = this.getAnnotations().features.find((i) => i.id === e);
2545
- return s ? (st(s) ? this.arrows.select(s.id) : yt(s) && this.texts.select(s.id), this) : this;
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 ? (st(this.selected) ? this.arrows.unselect() : yt(this.selected) && this.texts.unselect(), this) : this;
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(e) {
2558
- if (Er(e)) {
2559
- const [s, i] = e.features.reduce(
2560
- (l, c) => (st(c) ? l[1].push(c) : yt(c) && l[0].push(c), l),
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 s.forEach((l) => this.add(l)), i.forEach((l) => this.add(l)), this.arrows.refreshLayer(), this;
2300
+ return i.forEach((o) => this.add(o)), r.forEach((o) => this.add(o)), this.arrows.refreshLayer(), this;
2564
2301
  }
2565
- switch (e.properties.type) {
2302
+ switch (t.properties.type) {
2566
2303
  case "text":
2567
- this.texts.add(e);
2304
+ this.texts.add(t);
2568
2305
  break;
2306
+ // more to follow
2569
2307
  default:
2570
- this.arrows.add(e), this.loadLink(e);
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(e) {
2580
- return Er(e) ? (e.features.forEach(
2581
- (s) => this.remove(s)
2582
- ), this) : (st(e) ? (this.links.remove(e, "start"), this.links.remove(e, "end"), this.arrows.remove(e.id)) : this.texts.remove(e.id), this);
2583
- }
2584
- loadLink(e) {
2585
- if (e.properties.link)
2586
- for (const s of _r) {
2587
- const i = e.properties.link[s];
2588
- if (!i)
2589
- continue;
2590
- const l = this.getAnnotation(i.id);
2591
- if (i.type === "text" && l)
2592
- this.links.add(e, s, i.id, i.type, i.magnet);
2593
- else if (i.type === "node") {
2594
- const c = this.ogma.getNode(i.id);
2595
- if (!c)
2596
- continue;
2597
- this.links.add(e, s, i.id, i.type, i.magnet);
2598
- const g = c.getPosition(), y = c.getAttribute("radius") || 0, f = Le(
2599
- e,
2600
- s === "start" ? "end" : "start"
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(e, s, i) {
2613
- this.cancelDrawing(), this.arrows.startDrawing(e, s, i);
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(e, s, i) {
2622
- this.cancelDrawing(), this.texts.startDrawing(e, s, i);
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((e) => e.cancelDrawing()), this.emit(cn);
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(e, s) {
2636
- const i = this.getAnnotations().features.find((l) => l.id === e);
2637
- return i ? (st(i) ? this.arrows.updateStyle(i, s) : yt(i) && this.texts.updateStyle(i, s), this.onUpdate(i), this) : this;
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(e, s, i, l) {
2640
- const c = this.getAnnotations().features.find((g) => g.id === e);
2641
- return c ? (st(c) ? this.arrows.scale(c, s, i, l) : yt(c) && this.texts.scale(c, s, i, l), this.onUpdate(c), this) : this;
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 e = {
2384
+ const t = {
2649
2385
  type: "FeatureCollection",
2650
2386
  features: []
2651
2387
  };
2652
- return this.annotations.forEach((s) => {
2653
- e.features = [...e.features, ...s.getElements()];
2654
- }), e;
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(e) {
2662
- return this.getAnnotations().features.find((s) => s.id === e);
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((e) => e.destroy()), this.layer.destroy();
2404
+ this.annotations.forEach((t) => t.destroy()), this.layer.destroy();
2669
2405
  }
2670
2406
  }
2671
- const Tr = [8, 10, 12, 14, 16, 24, 32, 48, 64, 72], Sr = "none", Ur = "#333333", Pn = [
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
- ], Rn = [
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((h, e) => h.toLocaleLowerCase().localeCompare(e.toLocaleLowerCase())), En = {
2432
+ ].sort((a, t) => a.toLocaleLowerCase().localeCompare(t.toLocaleLowerCase())), Rn = {
2697
2433
  head: "arrow",
2698
- strokeColor: Ur,
2434
+ strokeColor: Hr,
2699
2435
  strokeWidth: 5
2700
- }, _n = 0.25, kn = {
2436
+ }, In = 0.25, zn = {
2701
2437
  font: "Roboto",
2702
- fontSize: Tr[2],
2703
- padding: Tr[2] * _n,
2704
- color: Ur,
2705
- strokeType: Sr,
2706
- background: Sr
2438
+ fontSize: Cr[2],
2439
+ padding: Cr[2] * In,
2440
+ color: Hr,
2441
+ strokeType: Tr,
2442
+ background: Tr
2707
2443
  };
2708
- function Tn(h) {
2709
- return h.reduce((e, s) => e + s, 0) / h.length;
2444
+ function Fn(a) {
2445
+ return a.reduce((t, i) => t + i, 0) / a.length;
2710
2446
  }
2711
- function In(h, e = 0, s = 1) {
2712
- return e + (s - e) * h;
2447
+ function Yn(a, t = 0, i = 1) {
2448
+ return t + (i - t) * a;
2713
2449
  }
2714
- function Ln(h, e = 0, s = 1) {
2715
- return (h - e) / (s - e);
2450
+ function Xn(a, t = 0, i = 1) {
2451
+ return (a - t) / (i - t);
2716
2452
  }
2717
- function Fn() {
2453
+ function Gn() {
2718
2454
  return Or(null);
2719
2455
  }
2720
- const Wr = Or(
2456
+ const qr = Or(
2721
2457
  void 0
2722
- ), jn = () => qr(Wr), Sn = (h, e) => {
2723
- switch (e.type) {
2458
+ ), Vn = () => Zr(qr), Hn = (a, t) => {
2459
+ switch (t.type) {
2724
2460
  case "add":
2725
2461
  return {
2726
- ...h,
2727
- features: [...h.features, e.payload]
2462
+ ...a,
2463
+ features: [...a.features, t.payload]
2728
2464
  };
2729
2465
  case "remove":
2730
2466
  return {
2731
- ...h,
2732
- features: h.features.filter((s) => s.id !== e.payload.id)
2467
+ ...a,
2468
+ features: a.features.filter((i) => i.id !== t.payload.id)
2733
2469
  };
2734
2470
  case "update":
2735
2471
  return {
2736
- ...h,
2737
- features: h.features.map(
2738
- (s) => s.id === e.payload.id ? e.payload : s
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 h;
2478
+ return a;
2743
2479
  }
2744
- }, $n = ({ children: h }) => {
2745
- const e = Gr(), [s, i] = Yr(Sn, {
2480
+ }, Jn = ({ children: a }) => {
2481
+ const t = Qr(), [i, r] = Kr(Hn, {
2746
2482
  type: "FeatureCollection",
2747
2483
  features: []
2748
- }), [l, c] = Nt(null), [g, y] = Nt(En), [f, m] = Nt(kn), [v, k] = Nt(), [C, _] = Nt(1), [R, S] = Nt(1);
2749
- return rr(() => {
2750
- if (!e)
2751
- return;
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
- }), L = Tn(e.getNodes().getAttribute("radius")) / 5, T = C;
2755
- return y({
2756
- ...g,
2757
- strokeWidth: (g.strokeWidth || 1) * T
2758
- }), _(T), S(L), D.on("select", (U) => {
2759
- st(U) ? y({
2760
- ...U.properties.style || {}
2761
- }) : yt(U) && m({
2762
- ...U.properties.style || {}
2763
- }), c(U);
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
- c(null);
2766
- }), k(D), () => {
2767
- v == null || v.destroy();
2500
+ u(null);
2501
+ }), C(j), () => {
2502
+ y == null || y.destroy();
2768
2503
  };
2769
- }, [e]), rr(() => {
2770
- v && l && (l == null ? void 0 : l.properties.type) === "arrow" && v.updateStyle(l.id, g);
2771
- }, [v, g, l]), rr(() => {
2772
- v && l && (l == null ? void 0 : l.properties.type) === "text" && v.updateStyle(l.id, f);
2773
- }, [v, f, l]), /* @__PURE__ */ Kr.jsx(
2774
- Wr.Provider,
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: s,
2778
- updateAnnotations: i,
2779
- currentAnnotation: l,
2780
- setCurrentAnnotation: c,
2781
- textStyle: f,
2782
- setTextStyle: m,
2783
- arrowStyle: g,
2784
- setArrowStyle: y,
2785
- arrowWidthFactor: C,
2786
- setArrowWidthFactor: _,
2787
- textSizeFactor: R,
2788
- setTextSizeFactor: S,
2789
- editor: v,
2790
- setEditor: k
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: h
2527
+ children: a
2793
2528
  }
2794
2529
  );
2795
2530
  };
2796
2531
  export {
2797
- Wr as AnnotationsContext,
2798
- $n as AnnotationsContextProvider,
2799
- Ur as BLACK,
2800
- _n as RELATIVE_PADDING,
2801
- Sr as TRANSPARENT,
2802
- Fn as createAnnotationsContext,
2803
- En as defaultArrowStyle,
2804
- Pn as defaultColors,
2805
- kn as defaultTextStyle,
2806
- Tr as fontSizes,
2807
- Rn as fonts,
2808
- In as interpolate,
2809
- Tn as mean,
2810
- Ln as normalize,
2811
- jn as useAnnotationsContext
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
  };