@linkurious/ogma-annotations-react 1.1.20 → 1.1.22

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