@linkurious/ogma-annotations-react 1.1.13 → 1.1.15

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