@visactor/vrender 1.0.26-alpha.0 → 1.0.26-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -21673,42 +21673,41 @@ const registerFlexLayoutPlugin = () => {
21673
21673
 
21674
21674
  function t(t, e, s) {
21675
21675
  if (t && t.length) {
21676
- const [n, a] = e,
21677
- o = Math.PI / 180 * s,
21678
- h = Math.cos(o),
21679
- r = Math.sin(o);
21680
- t.forEach(t => {
21681
- const [e, s] = t;
21682
- t[0] = (e - n) * h - (s - a) * r + n, t[1] = (e - n) * r + (s - a) * h + a;
21683
- });
21676
+ const [n, o] = e,
21677
+ a = Math.PI / 180 * s,
21678
+ h = Math.cos(a),
21679
+ r = Math.sin(a);
21680
+ for (const e of t) {
21681
+ const [t, s] = e;
21682
+ e[0] = (t - n) * h - (s - o) * r + n, e[1] = (t - n) * r + (s - o) * h + o;
21683
+ }
21684
21684
  }
21685
21685
  }
21686
- function e(t) {
21687
- const e = t[0],
21688
- s = t[1];
21689
- return Math.sqrt(Math.pow(e[0] - s[0], 2) + Math.pow(e[1] - s[1], 2));
21686
+ function e(t, e) {
21687
+ return t[0] === e[0] && t[1] === e[1];
21690
21688
  }
21691
- function s(e, s) {
21692
- const n = s.hachureAngle + 90;
21693
- let a = s.hachureGap;
21694
- a < 0 && (a = 4 * s.strokeWidth), a = Math.max(a, .1);
21695
- const o = [0, 0];
21696
- if (n) for (const s of e) t(s, o, n);
21697
- const h = function (t, e) {
21698
- const s = [];
21699
- for (const e of t) {
21700
- const t = [...e];
21701
- t[0].join(",") !== t[t.length - 1].join(",") && t.push([t[0][0], t[0][1]]), t.length > 2 && s.push(t);
21689
+ function s(s, n, o) {
21690
+ let a = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
21691
+ const h = o,
21692
+ r = Math.max(n, .1),
21693
+ i = s[0] && s[0][0] && "number" == typeof s[0][0] ? [s] : s,
21694
+ c = [0, 0];
21695
+ if (h) for (const e of i) t(e, c, h);
21696
+ const l = function (t, s, n) {
21697
+ const o = [];
21698
+ for (const s of t) {
21699
+ const t = [...s];
21700
+ e(t[0], t[t.length - 1]) || t.push([t[0][0], t[0][1]]), t.length > 2 && o.push(t);
21702
21701
  }
21703
- const n = [];
21704
- e = Math.max(e, .1);
21705
21702
  const a = [];
21706
- for (const t of s) for (let e = 0; e < t.length - 1; e++) {
21703
+ s = Math.max(s, .1);
21704
+ const h = [];
21705
+ for (const t of o) for (let e = 0; e < t.length - 1; e++) {
21707
21706
  const s = t[e],
21708
21707
  n = t[e + 1];
21709
21708
  if (s[1] !== n[1]) {
21710
21709
  const t = Math.min(s[1], n[1]);
21711
- a.push({
21710
+ h.push({
21712
21711
  ymin: t,
21713
21712
  ymax: Math.max(s[1], n[1]),
21714
21713
  x: t === s[1] ? s[0] : n[0],
@@ -21716,43 +21715,52 @@ function s(e, s) {
21716
21715
  });
21717
21716
  }
21718
21717
  }
21719
- if (a.sort((t, e) => t.ymin < e.ymin ? -1 : t.ymin > e.ymin ? 1 : t.x < e.x ? -1 : t.x > e.x ? 1 : t.ymax === e.ymax ? 0 : (t.ymax - e.ymax) / Math.abs(t.ymax - e.ymax)), !a.length) return n;
21720
- let o = [],
21721
- h = a[0].ymin;
21722
- for (; o.length || a.length;) {
21723
- if (a.length) {
21718
+ if (h.sort((t, e) => t.ymin < e.ymin ? -1 : t.ymin > e.ymin ? 1 : t.x < e.x ? -1 : t.x > e.x ? 1 : t.ymax === e.ymax ? 0 : (t.ymax - e.ymax) / Math.abs(t.ymax - e.ymax)), !h.length) return a;
21719
+ let r = [],
21720
+ i = h[0].ymin,
21721
+ c = 0;
21722
+ for (; r.length || h.length;) {
21723
+ if (h.length) {
21724
21724
  let t = -1;
21725
- for (let e = 0; e < a.length && !(a[e].ymin > h); e++) t = e;
21726
- a.splice(0, t + 1).forEach(t => {
21727
- o.push({
21728
- s: h,
21725
+ for (let e = 0; e < h.length && !(h[e].ymin > i); e++) t = e;
21726
+ h.splice(0, t + 1).forEach(t => {
21727
+ r.push({
21728
+ s: i,
21729
21729
  edge: t
21730
21730
  });
21731
21731
  });
21732
21732
  }
21733
- if (o = o.filter(t => !(t.edge.ymax <= h)), o.sort((t, e) => t.edge.x === e.edge.x ? 0 : (t.edge.x - e.edge.x) / Math.abs(t.edge.x - e.edge.x)), o.length > 1) for (let t = 0; t < o.length; t += 2) {
21733
+ if (r = r.filter(t => !(t.edge.ymax <= i)), r.sort((t, e) => t.edge.x === e.edge.x ? 0 : (t.edge.x - e.edge.x) / Math.abs(t.edge.x - e.edge.x)), (1 !== n || c % s == 0) && r.length > 1) for (let t = 0; t < r.length; t += 2) {
21734
21734
  const e = t + 1;
21735
- if (e >= o.length) break;
21736
- const s = o[t].edge,
21737
- a = o[e].edge;
21738
- n.push([[Math.round(s.x), h], [Math.round(a.x), h]]);
21735
+ if (e >= r.length) break;
21736
+ const s = r[t].edge,
21737
+ n = r[e].edge;
21738
+ a.push([[Math.round(s.x), i], [Math.round(n.x), i]]);
21739
21739
  }
21740
- h += e, o.forEach(t => {
21741
- t.edge.x = t.edge.x + e * t.edge.islope;
21742
- });
21740
+ i += n, r.forEach(t => {
21741
+ t.edge.x = t.edge.x + n * t.edge.islope;
21742
+ }), c++;
21743
21743
  }
21744
- return n;
21745
- }(e, a);
21746
- if (n) {
21747
- for (const s of e) t(s, o, -n);
21744
+ return a;
21745
+ }(i, r, a);
21746
+ if (h) {
21747
+ for (const e of i) t(e, c, -h);
21748
21748
  !function (e, s, n) {
21749
- const a = [];
21750
- e.forEach(t => a.push(...t)), t(a, s, n);
21751
- }(h, o, -n);
21749
+ const o = [];
21750
+ e.forEach(t => o.push(...t)), t(o, s, n);
21751
+ }(l, c, -h);
21752
21752
  }
21753
- return h;
21753
+ return l;
21754
21754
  }
21755
- class n {
21755
+ function n(t, e) {
21756
+ var n;
21757
+ const o = e.hachureAngle + 90;
21758
+ let a = e.hachureGap;
21759
+ a < 0 && (a = 4 * e.strokeWidth), a = Math.round(Math.max(a, .1));
21760
+ let h = 1;
21761
+ return e.roughness >= 1 && ((null === (n = e.randomizer) || void 0 === n ? void 0 : n.next()) || Math.random()) > .7 && (h = a), s(t, a, o, h || 1);
21762
+ }
21763
+ class o {
21756
21764
  constructor(t) {
21757
21765
  this.helper = t;
21758
21766
  }
@@ -21760,10 +21768,10 @@ class n {
21760
21768
  return this._fillPolygons(t, e);
21761
21769
  }
21762
21770
  _fillPolygons(t, e) {
21763
- const n = s(t, e);
21771
+ const s = n(t, e);
21764
21772
  return {
21765
21773
  type: "fillSketch",
21766
- ops: this.renderLines(n, e)
21774
+ ops: this.renderLines(s, e)
21767
21775
  };
21768
21776
  }
21769
21777
  renderLines(t, e) {
@@ -21772,143 +21780,148 @@ class n {
21772
21780
  return s;
21773
21781
  }
21774
21782
  }
21775
- class a extends n {
21776
- fillPolygons(t, n) {
21777
- let a = n.hachureGap;
21778
- a < 0 && (a = 4 * n.strokeWidth), a = Math.max(a, .1);
21779
- const o = s(t, Object.assign({}, n, {
21780
- hachureGap: a
21783
+ function a(t) {
21784
+ const e = t[0],
21785
+ s = t[1];
21786
+ return Math.sqrt(Math.pow(e[0] - s[0], 2) + Math.pow(e[1] - s[1], 2));
21787
+ }
21788
+ class h extends o {
21789
+ fillPolygons(t, e) {
21790
+ let s = e.hachureGap;
21791
+ s < 0 && (s = 4 * e.strokeWidth), s = Math.max(s, .1);
21792
+ const o = n(t, Object.assign({}, e, {
21793
+ hachureGap: s
21781
21794
  })),
21782
- h = Math.PI / 180 * n.hachureAngle,
21795
+ h = Math.PI / 180 * e.hachureAngle,
21783
21796
  r = [],
21784
- i = .5 * a * Math.cos(h),
21785
- c = .5 * a * Math.sin(h);
21786
- for (const [t, s] of o) e([t, s]) && r.push([[t[0] - i, t[1] + c], [...s]], [[t[0] + i, t[1] - c], [...s]]);
21797
+ i = .5 * s * Math.cos(h),
21798
+ c = .5 * s * Math.sin(h);
21799
+ for (const [t, e] of o) a([t, e]) && r.push([[t[0] - i, t[1] + c], [...e]], [[t[0] + i, t[1] - c], [...e]]);
21787
21800
  return {
21788
21801
  type: "fillSketch",
21789
- ops: this.renderLines(r, n)
21802
+ ops: this.renderLines(r, e)
21790
21803
  };
21791
21804
  }
21792
21805
  }
21793
- class o extends n {
21806
+ class r extends o {
21794
21807
  fillPolygons(t, e) {
21795
21808
  const s = this._fillPolygons(t, e),
21796
21809
  n = Object.assign({}, e, {
21797
21810
  hachureAngle: e.hachureAngle + 90
21798
21811
  }),
21799
- a = this._fillPolygons(t, n);
21800
- return s.ops = s.ops.concat(a.ops), s;
21812
+ o = this._fillPolygons(t, n);
21813
+ return s.ops = s.ops.concat(o.ops), s;
21801
21814
  }
21802
21815
  }
21803
- class h {
21816
+ class i {
21804
21817
  constructor(t) {
21805
21818
  this.helper = t;
21806
21819
  }
21807
21820
  fillPolygons(t, e) {
21808
- const n = s(t, e = Object.assign({}, e, {
21821
+ const s = n(t, e = Object.assign({}, e, {
21809
21822
  hachureAngle: 0
21810
21823
  }));
21811
- return this.dotsOnLines(n, e);
21824
+ return this.dotsOnLines(s, e);
21812
21825
  }
21813
- dotsOnLines(t, s) {
21814
- const n = [];
21815
- let a = s.hachureGap;
21816
- a < 0 && (a = 4 * s.strokeWidth), a = Math.max(a, .1);
21817
- let o = s.fillWeight;
21818
- o < 0 && (o = s.strokeWidth / 2);
21819
- const h = a / 4;
21826
+ dotsOnLines(t, e) {
21827
+ const s = [];
21828
+ let n = e.hachureGap;
21829
+ n < 0 && (n = 4 * e.strokeWidth), n = Math.max(n, .1);
21830
+ let o = e.fillWeight;
21831
+ o < 0 && (o = e.strokeWidth / 2);
21832
+ const h = n / 4;
21820
21833
  for (const r of t) {
21821
- const t = e(r),
21822
- i = t / a,
21834
+ const t = a(r),
21835
+ i = t / n,
21823
21836
  c = Math.ceil(i) - 1,
21824
- l = t - c * a,
21825
- u = (r[0][0] + r[1][0]) / 2 - a / 4,
21837
+ l = t - c * n,
21838
+ u = (r[0][0] + r[1][0]) / 2 - n / 4,
21826
21839
  p = Math.min(r[0][1], r[1][1]);
21827
21840
  for (let t = 0; t < c; t++) {
21828
- const e = p + l + t * a,
21841
+ const a = p + l + t * n,
21829
21842
  r = u - h + 2 * Math.random() * h,
21830
- i = e - h + 2 * Math.random() * h,
21831
- c = this.helper.ellipse(r, i, o, o, s);
21832
- n.push(...c.ops);
21843
+ i = a - h + 2 * Math.random() * h,
21844
+ c = this.helper.ellipse(r, i, o, o, e);
21845
+ s.push(...c.ops);
21833
21846
  }
21834
21847
  }
21835
21848
  return {
21836
21849
  type: "fillSketch",
21837
- ops: n
21850
+ ops: s
21838
21851
  };
21839
21852
  }
21840
21853
  }
21841
- class r {
21854
+ class c {
21842
21855
  constructor(t) {
21843
21856
  this.helper = t;
21844
21857
  }
21845
21858
  fillPolygons(t, e) {
21846
- const n = s(t, e);
21859
+ const s = n(t, e);
21847
21860
  return {
21848
21861
  type: "fillSketch",
21849
- ops: this.dashedLine(n, e)
21862
+ ops: this.dashedLine(s, e)
21850
21863
  };
21851
21864
  }
21852
- dashedLine(t, s) {
21853
- const n = s.dashOffset < 0 ? s.hachureGap < 0 ? 4 * s.strokeWidth : s.hachureGap : s.dashOffset,
21854
- a = s.dashGap < 0 ? s.hachureGap < 0 ? 4 * s.strokeWidth : s.hachureGap : s.dashGap,
21865
+ dashedLine(t, e) {
21866
+ const s = e.dashOffset < 0 ? e.hachureGap < 0 ? 4 * e.strokeWidth : e.hachureGap : e.dashOffset,
21867
+ n = e.dashGap < 0 ? e.hachureGap < 0 ? 4 * e.strokeWidth : e.hachureGap : e.dashGap,
21855
21868
  o = [];
21856
21869
  return t.forEach(t => {
21857
- const h = e(t),
21858
- r = Math.floor(h / (n + a)),
21859
- i = (h + a - r * (n + a)) / 2;
21870
+ const h = a(t),
21871
+ r = Math.floor(h / (s + n)),
21872
+ i = (h + n - r * (s + n)) / 2;
21860
21873
  let c = t[0],
21861
21874
  l = t[1];
21862
21875
  c[0] > l[0] && (c = t[1], l = t[0]);
21863
21876
  const u = Math.atan((l[1] - c[1]) / (l[0] - c[0]));
21864
21877
  for (let t = 0; t < r; t++) {
21865
- const e = t * (n + a),
21866
- h = e + n,
21867
- r = [c[0] + e * Math.cos(u) + i * Math.cos(u), c[1] + e * Math.sin(u) + i * Math.sin(u)],
21878
+ const a = t * (s + n),
21879
+ h = a + s,
21880
+ r = [c[0] + a * Math.cos(u) + i * Math.cos(u), c[1] + a * Math.sin(u) + i * Math.sin(u)],
21868
21881
  l = [c[0] + h * Math.cos(u) + i * Math.cos(u), c[1] + h * Math.sin(u) + i * Math.sin(u)];
21869
- o.push(...this.helper.doubleLineOps(r[0], r[1], l[0], l[1], s));
21882
+ o.push(...this.helper.doubleLineOps(r[0], r[1], l[0], l[1], e));
21870
21883
  }
21871
21884
  }), o;
21872
21885
  }
21873
21886
  }
21874
- class i {
21887
+ class l {
21875
21888
  constructor(t) {
21876
21889
  this.helper = t;
21877
21890
  }
21878
21891
  fillPolygons(t, e) {
21879
- const n = e.hachureGap < 0 ? 4 * e.strokeWidth : e.hachureGap,
21880
- a = e.zigzagOffset < 0 ? n : e.zigzagOffset,
21881
- o = s(t, e = Object.assign({}, e, {
21882
- hachureGap: n + a
21892
+ const s = e.hachureGap < 0 ? 4 * e.strokeWidth : e.hachureGap,
21893
+ o = e.zigzagOffset < 0 ? s : e.zigzagOffset,
21894
+ a = n(t, e = Object.assign({}, e, {
21895
+ hachureGap: s + o
21883
21896
  }));
21884
21897
  return {
21885
21898
  type: "fillSketch",
21886
- ops: this.zigzagLines(o, a, e)
21899
+ ops: this.zigzagLines(a, o, e)
21887
21900
  };
21888
21901
  }
21889
- zigzagLines(t, s, n) {
21890
- const a = [];
21902
+ zigzagLines(t, e, s) {
21903
+ const n = [];
21891
21904
  return t.forEach(t => {
21892
- const o = e(t),
21893
- h = Math.round(o / (2 * s));
21905
+ const o = a(t),
21906
+ h = Math.round(o / (2 * e));
21894
21907
  let r = t[0],
21895
21908
  i = t[1];
21896
21909
  r[0] > i[0] && (r = t[1], i = t[0]);
21897
21910
  const c = Math.atan((i[1] - r[1]) / (i[0] - r[0]));
21898
21911
  for (let t = 0; t < h; t++) {
21899
- const e = 2 * t * s,
21900
- o = 2 * (t + 1) * s,
21901
- h = Math.sqrt(2 * Math.pow(s, 2)),
21902
- i = [r[0] + e * Math.cos(c), r[1] + e * Math.sin(c)],
21903
- l = [r[0] + o * Math.cos(c), r[1] + o * Math.sin(c)],
21912
+ const o = 2 * t * e,
21913
+ a = 2 * (t + 1) * e,
21914
+ h = Math.sqrt(2 * Math.pow(e, 2)),
21915
+ i = [r[0] + o * Math.cos(c), r[1] + o * Math.sin(c)],
21916
+ l = [r[0] + a * Math.cos(c), r[1] + a * Math.sin(c)],
21904
21917
  u = [i[0] + h * Math.cos(c + Math.PI / 4), i[1] + h * Math.sin(c + Math.PI / 4)];
21905
- a.push(...this.helper.doubleLineOps(i[0], i[1], u[0], u[1], n), ...this.helper.doubleLineOps(u[0], u[1], l[0], l[1], n));
21918
+ n.push(...this.helper.doubleLineOps(i[0], i[1], u[0], u[1], s), ...this.helper.doubleLineOps(u[0], u[1], l[0], l[1], s));
21906
21919
  }
21907
- }), a;
21920
+ }), n;
21908
21921
  }
21909
21922
  }
21910
- const c = {};
21911
- class l {
21923
+ const u = {};
21924
+ class p {
21912
21925
  constructor(t) {
21913
21926
  this.seed = t;
21914
21927
  }
@@ -21916,113 +21929,116 @@ class l {
21916
21929
  return this.seed ? (2 ** 31 - 1 & (this.seed = Math.imul(48271, this.seed))) / 2 ** 31 : Math.random();
21917
21930
  }
21918
21931
  }
21919
- const u = {
21920
- A: 7,
21921
- a: 7,
21922
- C: 6,
21923
- c: 6,
21924
- H: 1,
21925
- h: 1,
21926
- L: 2,
21927
- l: 2,
21928
- M: 2,
21929
- m: 2,
21930
- Q: 4,
21931
- q: 4,
21932
- S: 4,
21933
- s: 4,
21934
- T: 2,
21935
- t: 2,
21936
- V: 1,
21937
- v: 1,
21938
- Z: 0,
21939
- z: 0
21940
- };
21941
- function p(t, e) {
21932
+ const f = 0,
21933
+ d = 1,
21934
+ g = 2,
21935
+ M = {
21936
+ A: 7,
21937
+ a: 7,
21938
+ C: 6,
21939
+ c: 6,
21940
+ H: 1,
21941
+ h: 1,
21942
+ L: 2,
21943
+ l: 2,
21944
+ M: 2,
21945
+ m: 2,
21946
+ Q: 4,
21947
+ q: 4,
21948
+ S: 4,
21949
+ s: 4,
21950
+ T: 2,
21951
+ t: 2,
21952
+ V: 1,
21953
+ v: 1,
21954
+ Z: 0,
21955
+ z: 0
21956
+ };
21957
+ function k(t, e) {
21942
21958
  return t.type === e;
21943
21959
  }
21944
- function f(t) {
21960
+ function b(t) {
21945
21961
  const e = [],
21946
21962
  s = function (t) {
21947
21963
  const e = new Array();
21948
21964
  for (; "" !== t;) if (t.match(/^([ \t\r\n,]+)/)) t = t.substr(RegExp.$1.length);else if (t.match(/^([aAcChHlLmMqQsStTvVzZ])/)) e[e.length] = {
21949
- type: 0,
21965
+ type: f,
21950
21966
  text: RegExp.$1
21951
21967
  }, t = t.substr(RegExp.$1.length);else {
21952
21968
  if (!t.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/)) return [];
21953
21969
  e[e.length] = {
21954
- type: 1,
21970
+ type: d,
21955
21971
  text: `${parseFloat(RegExp.$1)}`
21956
21972
  }, t = t.substr(RegExp.$1.length);
21957
21973
  }
21958
21974
  return e[e.length] = {
21959
- type: 2,
21975
+ type: g,
21960
21976
  text: ""
21961
21977
  }, e;
21962
21978
  }(t);
21963
21979
  let n = "BOD",
21964
- a = 0,
21965
- o = s[a];
21966
- for (; !p(o, 2);) {
21980
+ o = 0,
21981
+ a = s[o];
21982
+ for (; !k(a, g);) {
21967
21983
  let h = 0;
21968
21984
  const r = [];
21969
21985
  if ("BOD" === n) {
21970
- if ("M" !== o.text && "m" !== o.text) return f("M0,0" + t);
21971
- a++, h = u[o.text], n = o.text;
21972
- } else p(o, 1) ? h = u[n] : (a++, h = u[o.text], n = o.text);
21973
- if (!(a + h < s.length)) throw new Error("Path data ended short");
21974
- for (let t = a; t < a + h; t++) {
21986
+ if ("M" !== a.text && "m" !== a.text) return b("M0,0" + t);
21987
+ o++, h = M[a.text], n = a.text;
21988
+ } else k(a, d) ? h = M[n] : (o++, h = M[a.text], n = a.text);
21989
+ if (!(o + h < s.length)) throw new Error("Path data ended short");
21990
+ for (let t = o; t < o + h; t++) {
21975
21991
  const e = s[t];
21976
- if (!p(e, 1)) throw new Error("Param not a number: " + n + "," + e.text);
21992
+ if (!k(e, d)) throw new Error("Param not a number: " + n + "," + e.text);
21977
21993
  r[r.length] = +e.text;
21978
21994
  }
21979
- if ("number" != typeof u[n]) throw new Error("Bad segment: " + n);
21995
+ if ("number" != typeof M[n]) throw new Error("Bad segment: " + n);
21980
21996
  {
21981
21997
  const t = {
21982
21998
  key: n,
21983
21999
  data: r
21984
22000
  };
21985
- e.push(t), a += h, o = s[a], "M" === n && (n = "L"), "m" === n && (n = "l");
22001
+ e.push(t), o += h, a = s[o], "M" === n && (n = "L"), "m" === n && (n = "l");
21986
22002
  }
21987
22003
  }
21988
22004
  return e;
21989
22005
  }
21990
- function d(t) {
22006
+ function y(t) {
21991
22007
  let e = 0,
21992
22008
  s = 0,
21993
22009
  n = 0,
21994
- a = 0;
21995
- const o = [];
22010
+ o = 0;
22011
+ const a = [];
21996
22012
  for (const {
21997
22013
  key: h,
21998
22014
  data: r
21999
22015
  } of t) switch (h) {
22000
22016
  case "M":
22001
- o.push({
22017
+ a.push({
22002
22018
  key: "M",
22003
22019
  data: [...r]
22004
- }), [e, s] = r, [n, a] = r;
22020
+ }), [e, s] = r, [n, o] = r;
22005
22021
  break;
22006
22022
  case "m":
22007
- e += r[0], s += r[1], o.push({
22023
+ e += r[0], s += r[1], a.push({
22008
22024
  key: "M",
22009
22025
  data: [e, s]
22010
- }), n = e, a = s;
22026
+ }), n = e, o = s;
22011
22027
  break;
22012
22028
  case "L":
22013
- o.push({
22029
+ a.push({
22014
22030
  key: "L",
22015
22031
  data: [...r]
22016
22032
  }), [e, s] = r;
22017
22033
  break;
22018
22034
  case "l":
22019
- e += r[0], s += r[1], o.push({
22035
+ e += r[0], s += r[1], a.push({
22020
22036
  key: "L",
22021
22037
  data: [e, s]
22022
22038
  });
22023
22039
  break;
22024
22040
  case "C":
22025
- o.push({
22041
+ a.push({
22026
22042
  key: "C",
22027
22043
  data: [...r]
22028
22044
  }), e = r[4], s = r[5];
@@ -22030,14 +22046,14 @@ function d(t) {
22030
22046
  case "c":
22031
22047
  {
22032
22048
  const t = r.map((t, n) => n % 2 ? t + s : t + e);
22033
- o.push({
22049
+ a.push({
22034
22050
  key: "C",
22035
22051
  data: t
22036
22052
  }), e = t[4], s = t[5];
22037
22053
  break;
22038
22054
  }
22039
22055
  case "Q":
22040
- o.push({
22056
+ a.push({
22041
22057
  key: "Q",
22042
22058
  data: [...r]
22043
22059
  }), e = r[2], s = r[3];
@@ -22045,50 +22061,50 @@ function d(t) {
22045
22061
  case "q":
22046
22062
  {
22047
22063
  const t = r.map((t, n) => n % 2 ? t + s : t + e);
22048
- o.push({
22064
+ a.push({
22049
22065
  key: "Q",
22050
22066
  data: t
22051
22067
  }), e = t[2], s = t[3];
22052
22068
  break;
22053
22069
  }
22054
22070
  case "A":
22055
- o.push({
22071
+ a.push({
22056
22072
  key: "A",
22057
22073
  data: [...r]
22058
22074
  }), e = r[5], s = r[6];
22059
22075
  break;
22060
22076
  case "a":
22061
- e += r[5], s += r[6], o.push({
22077
+ e += r[5], s += r[6], a.push({
22062
22078
  key: "A",
22063
22079
  data: [r[0], r[1], r[2], r[3], r[4], e, s]
22064
22080
  });
22065
22081
  break;
22066
22082
  case "H":
22067
- o.push({
22083
+ a.push({
22068
22084
  key: "H",
22069
22085
  data: [...r]
22070
22086
  }), e = r[0];
22071
22087
  break;
22072
22088
  case "h":
22073
- e += r[0], o.push({
22089
+ e += r[0], a.push({
22074
22090
  key: "H",
22075
22091
  data: [e]
22076
22092
  });
22077
22093
  break;
22078
22094
  case "V":
22079
- o.push({
22095
+ a.push({
22080
22096
  key: "V",
22081
22097
  data: [...r]
22082
22098
  }), s = r[0];
22083
22099
  break;
22084
22100
  case "v":
22085
- s += r[0], o.push({
22101
+ s += r[0], a.push({
22086
22102
  key: "V",
22087
22103
  data: [s]
22088
22104
  });
22089
22105
  break;
22090
22106
  case "S":
22091
- o.push({
22107
+ a.push({
22092
22108
  key: "S",
22093
22109
  data: [...r]
22094
22110
  }), e = r[2], s = r[3];
@@ -22096,39 +22112,39 @@ function d(t) {
22096
22112
  case "s":
22097
22113
  {
22098
22114
  const t = r.map((t, n) => n % 2 ? t + s : t + e);
22099
- o.push({
22115
+ a.push({
22100
22116
  key: "S",
22101
22117
  data: t
22102
22118
  }), e = t[2], s = t[3];
22103
22119
  break;
22104
22120
  }
22105
22121
  case "T":
22106
- o.push({
22122
+ a.push({
22107
22123
  key: "T",
22108
22124
  data: [...r]
22109
22125
  }), e = r[0], s = r[1];
22110
22126
  break;
22111
22127
  case "t":
22112
- e += r[0], s += r[1], o.push({
22128
+ e += r[0], s += r[1], a.push({
22113
22129
  key: "T",
22114
22130
  data: [e, s]
22115
22131
  });
22116
22132
  break;
22117
22133
  case "Z":
22118
22134
  case "z":
22119
- o.push({
22135
+ a.push({
22120
22136
  key: "Z",
22121
22137
  data: []
22122
- }), e = n, s = a;
22138
+ }), e = n, s = o;
22123
22139
  }
22124
- return o;
22140
+ return a;
22125
22141
  }
22126
- function g(t) {
22142
+ function m$2(t) {
22127
22143
  const e = [];
22128
22144
  let s = "",
22129
22145
  n = 0,
22130
- a = 0,
22131
22146
  o = 0,
22147
+ a = 0,
22132
22148
  h = 0,
22133
22149
  r = 0,
22134
22150
  i = 0;
@@ -22141,90 +22157,90 @@ function g(t) {
22141
22157
  e.push({
22142
22158
  key: "M",
22143
22159
  data: [...l]
22144
- }), [n, a] = l, [o, h] = l;
22160
+ }), [n, o] = l, [a, h] = l;
22145
22161
  break;
22146
22162
  case "C":
22147
22163
  e.push({
22148
22164
  key: "C",
22149
22165
  data: [...l]
22150
- }), n = l[4], a = l[5], r = l[2], i = l[3];
22166
+ }), n = l[4], o = l[5], r = l[2], i = l[3];
22151
22167
  break;
22152
22168
  case "L":
22153
22169
  e.push({
22154
22170
  key: "L",
22155
22171
  data: [...l]
22156
- }), [n, a] = l;
22172
+ }), [n, o] = l;
22157
22173
  break;
22158
22174
  case "H":
22159
22175
  n = l[0], e.push({
22160
22176
  key: "L",
22161
- data: [n, a]
22177
+ data: [n, o]
22162
22178
  });
22163
22179
  break;
22164
22180
  case "V":
22165
- a = l[0], e.push({
22181
+ o = l[0], e.push({
22166
22182
  key: "L",
22167
- data: [n, a]
22183
+ data: [n, o]
22168
22184
  });
22169
22185
  break;
22170
22186
  case "S":
22171
22187
  {
22172
22188
  let t = 0,
22173
- o = 0;
22174
- "C" === s || "S" === s ? (t = n + (n - r), o = a + (a - i)) : (t = n, o = a), e.push({
22189
+ a = 0;
22190
+ "C" === s || "S" === s ? (t = n + (n - r), a = o + (o - i)) : (t = n, a = o), e.push({
22175
22191
  key: "C",
22176
- data: [t, o, ...l]
22177
- }), r = l[0], i = l[1], n = l[2], a = l[3];
22192
+ data: [t, a, ...l]
22193
+ }), r = l[0], i = l[1], n = l[2], o = l[3];
22178
22194
  break;
22179
22195
  }
22180
22196
  case "T":
22181
22197
  {
22182
- const [t, o] = l;
22198
+ const [t, a] = l;
22183
22199
  let h = 0,
22184
22200
  c = 0;
22185
- "Q" === s || "T" === s ? (h = n + (n - r), c = a + (a - i)) : (h = n, c = a);
22201
+ "Q" === s || "T" === s ? (h = n + (n - r), c = o + (o - i)) : (h = n, c = o);
22186
22202
  const u = n + 2 * (h - n) / 3,
22187
- p = a + 2 * (c - a) / 3,
22203
+ p = o + 2 * (c - o) / 3,
22188
22204
  f = t + 2 * (h - t) / 3,
22189
- d = o + 2 * (c - o) / 3;
22205
+ d = a + 2 * (c - a) / 3;
22190
22206
  e.push({
22191
22207
  key: "C",
22192
- data: [u, p, f, d, t, o]
22193
- }), r = h, i = c, n = t, a = o;
22208
+ data: [u, p, f, d, t, a]
22209
+ }), r = h, i = c, n = t, o = a;
22194
22210
  break;
22195
22211
  }
22196
22212
  case "Q":
22197
22213
  {
22198
- const [t, s, o, h] = l,
22214
+ const [t, s, a, h] = l,
22199
22215
  c = n + 2 * (t - n) / 3,
22200
- u = a + 2 * (s - a) / 3,
22201
- p = o + 2 * (t - o) / 3,
22216
+ u = o + 2 * (s - o) / 3,
22217
+ p = a + 2 * (t - a) / 3,
22202
22218
  f = h + 2 * (s - h) / 3;
22203
22219
  e.push({
22204
22220
  key: "C",
22205
- data: [c, u, p, f, o, h]
22206
- }), r = t, i = s, n = o, a = h;
22221
+ data: [c, u, p, f, a, h]
22222
+ }), r = t, i = s, n = a, o = h;
22207
22223
  break;
22208
22224
  }
22209
22225
  case "A":
22210
22226
  {
22211
22227
  const t = Math.abs(l[0]),
22212
22228
  s = Math.abs(l[1]),
22213
- o = l[2],
22229
+ a = l[2],
22214
22230
  h = l[3],
22215
22231
  r = l[4],
22216
22232
  i = l[5],
22217
22233
  c = l[6];
22218
22234
  if (0 === t || 0 === s) e.push({
22219
22235
  key: "C",
22220
- data: [n, a, i, c, i, c]
22221
- }), n = i, a = c;else if (n !== i || a !== c) {
22222
- k(n, a, i, c, t, s, o, h, r).forEach(function (t) {
22236
+ data: [n, o, i, c, i, c]
22237
+ }), n = i, o = c;else if (n !== i || o !== c) {
22238
+ x(n, o, i, c, t, s, a, h, r).forEach(function (t) {
22223
22239
  e.push({
22224
22240
  key: "C",
22225
22241
  data: t
22226
22242
  });
22227
- }), n = i, a = c;
22243
+ }), n = i, o = c;
22228
22244
  }
22229
22245
  break;
22230
22246
  }
@@ -22232,171 +22248,180 @@ function g(t) {
22232
22248
  e.push({
22233
22249
  key: "Z",
22234
22250
  data: []
22235
- }), n = o, a = h;
22251
+ }), n = a, o = h;
22236
22252
  }
22237
22253
  s = c;
22238
22254
  }
22239
22255
  return e;
22240
22256
  }
22241
- function M(t, e, s) {
22257
+ function w(t, e, s) {
22242
22258
  return [t * Math.cos(s) - e * Math.sin(s), t * Math.sin(s) + e * Math.cos(s)];
22243
22259
  }
22244
- function k(t, e, s, n, a, o, h, r, i, c) {
22260
+ function x(t, e, s, n, o, a, h, r, i, c) {
22245
22261
  const l = (u = h, Math.PI * u / 180);
22246
22262
  var u;
22247
22263
  let p = [],
22248
22264
  f = 0,
22249
22265
  d = 0,
22250
22266
  g = 0,
22251
- b = 0;
22252
- if (c) [f, d, g, b] = c;else {
22253
- [t, e] = M(t, e, -l), [s, n] = M(s, n, -l);
22267
+ M = 0;
22268
+ if (c) [f, d, g, M] = c;else {
22269
+ [t, e] = w(t, e, -l), [s, n] = w(s, n, -l);
22254
22270
  const h = (t - s) / 2,
22255
22271
  c = (e - n) / 2;
22256
- let u = h * h / (a * a) + c * c / (o * o);
22257
- u > 1 && (u = Math.sqrt(u), a *= u, o *= u);
22258
- const p = a * a,
22259
- k = o * o,
22260
- y = p * k - p * c * c - k * h * h,
22261
- m = p * c * c + k * h * h,
22262
- w = (r === i ? -1 : 1) * Math.sqrt(Math.abs(y / m));
22263
- g = w * a * c / o + (t + s) / 2, b = w * -o * h / a + (e + n) / 2, f = Math.asin(parseFloat(((e - b) / o).toFixed(9))), d = Math.asin(parseFloat(((n - b) / o).toFixed(9))), t < g && (f = Math.PI - f), s < g && (d = Math.PI - d), f < 0 && (f = 2 * Math.PI + f), d < 0 && (d = 2 * Math.PI + d), i && f > d && (f -= 2 * Math.PI), !i && d > f && (d -= 2 * Math.PI);
22264
- }
22265
- let y = d - f;
22266
- if (Math.abs(y) > 120 * Math.PI / 180) {
22272
+ let u = h * h / (o * o) + c * c / (a * a);
22273
+ u > 1 && (u = Math.sqrt(u), o *= u, a *= u);
22274
+ const p = o * o,
22275
+ k = a * a,
22276
+ b = p * k - p * c * c - k * h * h,
22277
+ y = p * c * c + k * h * h,
22278
+ m = (r === i ? -1 : 1) * Math.sqrt(Math.abs(b / y));
22279
+ g = m * o * c / a + (t + s) / 2, M = m * -a * h / o + (e + n) / 2, f = Math.asin(parseFloat(((e - M) / a).toFixed(9))), d = Math.asin(parseFloat(((n - M) / a).toFixed(9))), t < g && (f = Math.PI - f), s < g && (d = Math.PI - d), f < 0 && (f = 2 * Math.PI + f), d < 0 && (d = 2 * Math.PI + d), i && f > d && (f -= 2 * Math.PI), !i && d > f && (d -= 2 * Math.PI);
22280
+ }
22281
+ let k = d - f;
22282
+ if (Math.abs(k) > 120 * Math.PI / 180) {
22267
22283
  const t = d,
22268
22284
  e = s,
22269
22285
  r = n;
22270
- d = i && d > f ? f + 120 * Math.PI / 180 * 1 : f + 120 * Math.PI / 180 * -1, p = k(s = g + a * Math.cos(d), n = b + o * Math.sin(d), e, r, a, o, h, 0, i, [d, t, g, b]);
22286
+ d = i && d > f ? f + 120 * Math.PI / 180 * 1 : f + 120 * Math.PI / 180 * -1, p = x(s = g + o * Math.cos(d), n = M + a * Math.sin(d), e, r, o, a, h, 0, i, [d, t, g, M]);
22271
22287
  }
22272
- y = d - f;
22273
- const m = Math.cos(f),
22274
- w = Math.sin(f),
22275
- x = Math.cos(d),
22288
+ k = d - f;
22289
+ const b = Math.cos(f),
22290
+ y = Math.sin(f),
22291
+ m = Math.cos(d),
22276
22292
  P = Math.sin(d),
22277
- v = Math.tan(y / 4),
22278
- O = 4 / 3 * a * v,
22293
+ v = Math.tan(k / 4),
22279
22294
  S = 4 / 3 * o * v,
22295
+ O = 4 / 3 * a * v,
22280
22296
  L = [t, e],
22281
- T = [t + O * w, e - S * m],
22282
- D = [s + O * P, n - S * x],
22297
+ T = [t + S * y, e - O * b],
22298
+ D = [s + S * P, n - O * m],
22283
22299
  A = [s, n];
22284
22300
  if (T[0] = 2 * L[0] - T[0], T[1] = 2 * L[1] - T[1], c) return [T, D, A].concat(p);
22285
22301
  {
22286
22302
  p = [T, D, A].concat(p);
22287
22303
  const t = [];
22288
22304
  for (let e = 0; e < p.length; e += 3) {
22289
- const s = M(p[e][0], p[e][1], l),
22290
- n = M(p[e + 1][0], p[e + 1][1], l),
22291
- a = M(p[e + 2][0], p[e + 2][1], l);
22292
- t.push([s[0], s[1], n[0], n[1], a[0], a[1]]);
22305
+ const s = w(p[e][0], p[e][1], l),
22306
+ n = w(p[e + 1][0], p[e + 1][1], l),
22307
+ o = w(p[e + 2][0], p[e + 2][1], l);
22308
+ t.push([s[0], s[1], n[0], n[1], o[0], o[1]]);
22293
22309
  }
22294
22310
  return t;
22295
22311
  }
22296
22312
  }
22297
- const b = {
22313
+ const P = {
22298
22314
  randOffset: function (t, e) {
22299
- return A(t, e);
22315
+ return G(t, e);
22300
22316
  },
22301
22317
  randOffsetWithRange: function (t, e, s) {
22302
- return D(t, e, s);
22318
+ return E(t, e, s);
22303
22319
  },
22304
- ellipse: function (t, e, s, n, a) {
22305
- const o = P(s, n, a);
22306
- return v(t, e, a, o).opset;
22320
+ ellipse: function (t, e, s, n, o) {
22321
+ const a = T(s, n, o);
22322
+ return D(t, e, o, a).opset;
22307
22323
  },
22308
- doubleLineOps: function (t, e, s, n, a) {
22309
- return I(t, e, s, n, a, !0);
22324
+ doubleLineOps: function (t, e, s, n, o) {
22325
+ return $(t, e, s, n, o, !0);
22310
22326
  }
22311
22327
  };
22312
- function y(t, e, s, n, a) {
22328
+ function v(t, e, s, n, o) {
22313
22329
  return {
22314
22330
  type: "path",
22315
- ops: I(t, e, s, n, a)
22331
+ ops: $(t, e, s, n, o)
22316
22332
  };
22317
22333
  }
22318
- function m$2(t, e, s) {
22334
+ function S(t, e, s) {
22319
22335
  const n = (t || []).length;
22320
22336
  if (n > 2) {
22321
- const a = [];
22322
- for (let e = 0; e < n - 1; e++) a.push(...I(t[e][0], t[e][1], t[e + 1][0], t[e + 1][1], s));
22323
- return e && a.push(...I(t[n - 1][0], t[n - 1][1], t[0][0], t[0][1], s)), {
22337
+ const o = [];
22338
+ for (let e = 0; e < n - 1; e++) o.push(...$(t[e][0], t[e][1], t[e + 1][0], t[e + 1][1], s));
22339
+ return e && o.push(...$(t[n - 1][0], t[n - 1][1], t[0][0], t[0][1], s)), {
22324
22340
  type: "path",
22325
- ops: a
22341
+ ops: o
22326
22342
  };
22327
22343
  }
22328
- return 2 === n ? y(t[0][0], t[0][1], t[1][0], t[1][1], s) : {
22344
+ return 2 === n ? v(t[0][0], t[0][1], t[1][0], t[1][1], s) : {
22329
22345
  type: "path",
22330
22346
  ops: []
22331
22347
  };
22332
22348
  }
22333
- function w(t, e, s, n, a) {
22349
+ function O(t, e, s, n, o) {
22334
22350
  return function (t, e) {
22335
- return m$2(t, !0, e);
22336
- }([[t, e], [t + s, e], [t + s, e + n], [t, e + n]], a);
22337
- }
22338
- function x(t, e) {
22339
- let s = _(t, 1 * (1 + .2 * e.roughness), e);
22340
- if (!e.disableMultiStroke) {
22341
- const n = _(t, 1.5 * (1 + .22 * e.roughness), function (t) {
22342
- const e = Object.assign({}, t);
22343
- e.randomizer = void 0, t.seed && (e.seed = t.seed + 1);
22344
- return e;
22345
- }(e));
22346
- s = s.concat(n);
22351
+ return S(t, !0, e);
22352
+ }([[t, e], [t + s, e], [t + s, e + n], [t, e + n]], o);
22353
+ }
22354
+ function L(t, e) {
22355
+ if (t.length) {
22356
+ const s = "number" == typeof t[0][0] ? [t] : t,
22357
+ n = j(s[0], 1 * (1 + .2 * e.roughness), e),
22358
+ o = e.disableMultiStroke ? [] : j(s[0], 1.5 * (1 + .22 * e.roughness), z(e));
22359
+ for (let t = 1; t < s.length; t++) {
22360
+ const a = s[t];
22361
+ if (a.length) {
22362
+ const t = j(a, 1 * (1 + .2 * e.roughness), e),
22363
+ s = e.disableMultiStroke ? [] : j(a, 1.5 * (1 + .22 * e.roughness), z(e));
22364
+ for (const e of t) "move" !== e.op && n.push(e);
22365
+ for (const t of s) "move" !== t.op && o.push(t);
22366
+ }
22367
+ }
22368
+ return {
22369
+ type: "path",
22370
+ ops: n.concat(o)
22371
+ };
22347
22372
  }
22348
22373
  return {
22349
22374
  type: "path",
22350
- ops: s
22375
+ ops: []
22351
22376
  };
22352
22377
  }
22353
- function P(t, e, s) {
22378
+ function T(t, e, s) {
22354
22379
  const n = Math.sqrt(2 * Math.PI * Math.sqrt((Math.pow(t / 2, 2) + Math.pow(e / 2, 2)) / 2)),
22355
- a = Math.ceil(Math.max(s.curveStepCount, s.curveStepCount / Math.sqrt(200) * n)),
22356
- o = 2 * Math.PI / a;
22380
+ o = Math.ceil(Math.max(s.curveStepCount, s.curveStepCount / Math.sqrt(200) * n)),
22381
+ a = 2 * Math.PI / o;
22357
22382
  let h = Math.abs(t / 2),
22358
22383
  r = Math.abs(e / 2);
22359
22384
  const i = 1 - s.curveFitting;
22360
- return h += A(h * i, s), r += A(r * i, s), {
22361
- increment: o,
22385
+ return h += G(h * i, s), r += G(r * i, s), {
22386
+ increment: a,
22362
22387
  rx: h,
22363
22388
  ry: r
22364
22389
  };
22365
22390
  }
22366
- function v(t, e, s, n) {
22367
- const [a, o] = z(n.increment, t, e, n.rx, n.ry, 1, n.increment * D(.1, D(.4, 1, s), s), s);
22368
- let h = W(a, null, s);
22391
+ function D(t, e, s, n) {
22392
+ const [o, a] = F(n.increment, t, e, n.rx, n.ry, 1, n.increment * E(.1, E(.4, 1, s), s), s);
22393
+ let h = q(o, null, s);
22369
22394
  if (!s.disableMultiStroke && 0 !== s.roughness) {
22370
- const [a] = z(n.increment, t, e, n.rx, n.ry, 1.5, 0, s),
22371
- o = W(a, null, s);
22372
- h = h.concat(o);
22395
+ const [o] = F(n.increment, t, e, n.rx, n.ry, 1.5, 0, s),
22396
+ a = q(o, null, s);
22397
+ h = h.concat(a);
22373
22398
  }
22374
22399
  return {
22375
- estimatedPoints: o,
22400
+ estimatedPoints: a,
22376
22401
  opset: {
22377
22402
  type: "path",
22378
22403
  ops: h
22379
22404
  }
22380
22405
  };
22381
22406
  }
22382
- function O(t, e, s, n, a, o, h, r, i) {
22407
+ function A(t, e, s, n, o, a, h, r, i) {
22383
22408
  const c = t,
22384
22409
  l = e;
22385
22410
  let u = Math.abs(s / 2),
22386
22411
  p = Math.abs(n / 2);
22387
- u += A(.01 * u, i), p += A(.01 * p, i);
22388
- let f = a,
22389
- d = o;
22412
+ u += G(.01 * u, i), p += G(.01 * p, i);
22413
+ let f = o,
22414
+ d = a;
22390
22415
  for (; f < 0;) f += 2 * Math.PI, d += 2 * Math.PI;
22391
22416
  d - f > 2 * Math.PI && (f = 0, d = 2 * Math.PI);
22392
22417
  const g = 2 * Math.PI / i.curveStepCount,
22393
22418
  M = Math.min(g / 2, (d - f) / 2),
22394
- k = E(M, c, l, u, p, f, d, 1, i);
22419
+ k = V(M, c, l, u, p, f, d, 1, i);
22395
22420
  if (!i.disableMultiStroke) {
22396
- const t = E(M, c, l, u, p, f, d, 1.5, i);
22421
+ const t = V(M, c, l, u, p, f, d, 1.5, i);
22397
22422
  k.push(...t);
22398
22423
  }
22399
- return h && (r ? k.push(...I(c, l, c + u * Math.cos(f), l + p * Math.sin(f), i), ...I(c, l, c + u * Math.cos(d), l + p * Math.sin(d), i)) : k.push({
22424
+ return h && (r ? k.push(...$(c, l, c + u * Math.cos(f), l + p * Math.sin(f), i), ...$(c, l, c + u * Math.cos(d), l + p * Math.sin(d), i)) : k.push({
22400
22425
  op: "lineTo",
22401
22426
  data: [c, l]
22402
22427
  }, {
@@ -22407,19 +22432,48 @@ function O(t, e, s, n, a, o, h, r, i) {
22407
22432
  ops: k
22408
22433
  };
22409
22434
  }
22410
- function S(t, e) {
22435
+ function _(t, e) {
22436
+ const s = m$2(y(b(t))),
22437
+ n = [];
22438
+ let o = [0, 0],
22439
+ a = [0, 0];
22440
+ for (const {
22441
+ key: t,
22442
+ data: h
22443
+ } of s) switch (t) {
22444
+ case "M":
22445
+ a = [h[0], h[1]], o = [h[0], h[1]];
22446
+ break;
22447
+ case "L":
22448
+ n.push(...$(a[0], a[1], h[0], h[1], e)), a = [h[0], h[1]];
22449
+ break;
22450
+ case "C":
22451
+ {
22452
+ const [t, s, o, r, i, c] = h;
22453
+ n.push(...Z(t, s, o, r, i, c, a, e)), a = [i, c];
22454
+ break;
22455
+ }
22456
+ case "Z":
22457
+ n.push(...$(a[0], a[1], o[0], o[1], e)), a = [o[0], o[1]];
22458
+ }
22459
+ return {
22460
+ type: "path",
22461
+ ops: n
22462
+ };
22463
+ }
22464
+ function I(t, e) {
22411
22465
  const s = [];
22412
22466
  for (const n of t) if (n.length) {
22413
22467
  const t = e.maxRandomnessOffset || 0,
22414
- a = n.length;
22415
- if (a > 2) {
22468
+ o = n.length;
22469
+ if (o > 2) {
22416
22470
  s.push({
22417
22471
  op: "move",
22418
- data: [n[0][0] + A(t, e), n[0][1] + A(t, e)]
22472
+ data: [n[0][0] + G(t, e), n[0][1] + G(t, e)]
22419
22473
  });
22420
- for (let o = 1; o < a; o++) s.push({
22474
+ for (let a = 1; a < o; a++) s.push({
22421
22475
  op: "lineTo",
22422
- data: [n[o][0] + A(t, e), n[o][1] + A(t, e)]
22476
+ data: [n[a][0] + G(t, e), n[a][1] + G(t, e)]
22423
22477
  });
22424
22478
  }
22425
22479
  }
@@ -22428,73 +22482,76 @@ function S(t, e) {
22428
22482
  ops: s
22429
22483
  };
22430
22484
  }
22431
- function L(t, e) {
22485
+ function C(t, e) {
22432
22486
  return function (t, e) {
22433
22487
  let s = t.fillStyle || "hachure";
22434
- if (!c[s]) switch (s) {
22488
+ if (!u[s]) switch (s) {
22435
22489
  case "zigzag":
22436
- c[s] || (c[s] = new a(e));
22490
+ u[s] || (u[s] = new h(e));
22437
22491
  break;
22438
22492
  case "cross-hatch":
22439
- c[s] || (c[s] = new o(e));
22493
+ u[s] || (u[s] = new r(e));
22440
22494
  break;
22441
22495
  case "dots":
22442
- c[s] || (c[s] = new h(e));
22496
+ u[s] || (u[s] = new i(e));
22443
22497
  break;
22444
22498
  case "dashed":
22445
- c[s] || (c[s] = new r(e));
22499
+ u[s] || (u[s] = new c(e));
22446
22500
  break;
22447
22501
  case "zigzag-line":
22448
- c[s] || (c[s] = new i(e));
22502
+ u[s] || (u[s] = new l(e));
22449
22503
  break;
22450
- case "hachure":
22451
22504
  default:
22452
- s = "hachure", c[s] || (c[s] = new n(e));
22505
+ s = "hachure", u[s] || (u[s] = new o(e));
22453
22506
  }
22454
- return c[s];
22455
- }(e, b).fillPolygons(t, e);
22507
+ return u[s];
22508
+ }(e, P).fillPolygons(t, e);
22509
+ }
22510
+ function z(t) {
22511
+ const e = Object.assign({}, t);
22512
+ return e.randomizer = void 0, t.seed && (e.seed = t.seed + 1), e;
22456
22513
  }
22457
- function T(t) {
22458
- return t.randomizer || (t.randomizer = new l(t.seed || 0)), t.randomizer.next();
22514
+ function W(t) {
22515
+ return t.randomizer || (t.randomizer = new p(t.seed || 0)), t.randomizer.next();
22459
22516
  }
22460
- function D(t, e, s) {
22517
+ function E(t, e, s) {
22461
22518
  let n = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
22462
- return s.roughness * n * (T(s) * (e - t) + t);
22519
+ return s.roughness * n * (W(s) * (e - t) + t);
22463
22520
  }
22464
- function A(t, e) {
22521
+ function G(t, e) {
22465
22522
  let s = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
22466
- return D(-t, t, e, s);
22523
+ return E(-t, t, e, s);
22467
22524
  }
22468
- function I(t, e, s, n, a) {
22469
- let o = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : !1;
22470
- const h = o ? a.disableMultiStrokeFill : a.disableMultiStroke,
22471
- r = C(t, e, s, n, a, !0, !1);
22525
+ function $(t, e, s, n, o) {
22526
+ let a = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : !1;
22527
+ const h = a ? o.disableMultiStrokeFill : o.disableMultiStroke,
22528
+ r = R(t, e, s, n, o, !0, !1);
22472
22529
  if (h) return r;
22473
- const i = C(t, e, s, n, a, !0, !0);
22530
+ const i = R(t, e, s, n, o, !0, !0);
22474
22531
  return r.concat(i);
22475
22532
  }
22476
- function C(t, e, s, n, a, o, h) {
22533
+ function R(t, e, s, n, o, a, h) {
22477
22534
  const r = Math.pow(t - s, 2) + Math.pow(e - n, 2),
22478
22535
  i = Math.sqrt(r);
22479
22536
  let c = 1;
22480
22537
  c = i < 200 ? 1 : i > 500 ? .4 : -.0016668 * i + 1.233334;
22481
- let l = a.maxRandomnessOffset || 0;
22538
+ let l = o.maxRandomnessOffset || 0;
22482
22539
  l * l * 100 > r && (l = i / 10);
22483
22540
  const u = l / 2,
22484
- p = .2 + .2 * T(a);
22485
- let f = a.bowing * a.maxRandomnessOffset * (n - e) / 200,
22486
- d = a.bowing * a.maxRandomnessOffset * (t - s) / 200;
22487
- f = A(f, a, c), d = A(d, a, c);
22541
+ p = .2 + .2 * W(o);
22542
+ let f = o.bowing * o.maxRandomnessOffset * (n - e) / 200,
22543
+ d = o.bowing * o.maxRandomnessOffset * (t - s) / 200;
22544
+ f = G(f, o, c), d = G(d, o, c);
22488
22545
  const g = [],
22489
- M = () => A(u, a, c),
22490
- k = () => A(l, a, c),
22491
- b = a.preserveVertices;
22492
- return o && (h ? g.push({
22546
+ M = () => G(u, o, c),
22547
+ k = () => G(l, o, c),
22548
+ b = o.preserveVertices;
22549
+ return a && (h ? g.push({
22493
22550
  op: "move",
22494
22551
  data: [t + (b ? 0 : M()), e + (b ? 0 : M())]
22495
22552
  }) : g.push({
22496
22553
  op: "move",
22497
- data: [t + (b ? 0 : A(l, a, c)), e + (b ? 0 : A(l, a, c))]
22554
+ data: [t + (b ? 0 : G(l, o, c)), e + (b ? 0 : G(l, o, c))]
22498
22555
  })), h ? g.push({
22499
22556
  op: "bcurveTo",
22500
22557
  data: [f + t + (s - t) * p + M(), d + e + (n - e) * p + M(), f + t + 2 * (s - t) * p + M(), d + e + 2 * (n - e) * p + M(), s + (b ? 0 : M()), n + (b ? 0 : M())]
@@ -22503,75 +22560,76 @@ function C(t, e, s, n, a, o, h) {
22503
22560
  data: [f + t + (s - t) * p + k(), d + e + (n - e) * p + k(), f + t + 2 * (s - t) * p + k(), d + e + 2 * (n - e) * p + k(), s + (b ? 0 : k()), n + (b ? 0 : k())]
22504
22561
  }), g;
22505
22562
  }
22506
- function _(t, e, s) {
22563
+ function j(t, e, s) {
22564
+ if (!t.length) return [];
22507
22565
  const n = [];
22508
- n.push([t[0][0] + A(e, s), t[0][1] + A(e, s)]), n.push([t[0][0] + A(e, s), t[0][1] + A(e, s)]);
22509
- for (let a = 1; a < t.length; a++) n.push([t[a][0] + A(e, s), t[a][1] + A(e, s)]), a === t.length - 1 && n.push([t[a][0] + A(e, s), t[a][1] + A(e, s)]);
22510
- return W(n, null, s);
22566
+ n.push([t[0][0] + G(e, s), t[0][1] + G(e, s)]), n.push([t[0][0] + G(e, s), t[0][1] + G(e, s)]);
22567
+ for (let o = 1; o < t.length; o++) n.push([t[o][0] + G(e, s), t[o][1] + G(e, s)]), o === t.length - 1 && n.push([t[o][0] + G(e, s), t[o][1] + G(e, s)]);
22568
+ return q(n, null, s);
22511
22569
  }
22512
- function W(t, e, s) {
22570
+ function q(t, e, s) {
22513
22571
  const n = t.length,
22514
- a = [];
22572
+ o = [];
22515
22573
  if (n > 3) {
22516
- const o = [],
22574
+ const a = [],
22517
22575
  h = 1 - s.curveTightness;
22518
- a.push({
22576
+ o.push({
22519
22577
  op: "move",
22520
22578
  data: [t[1][0], t[1][1]]
22521
22579
  });
22522
22580
  for (let e = 1; e + 2 < n; e++) {
22523
22581
  const s = t[e];
22524
- o[0] = [s[0], s[1]], o[1] = [s[0] + (h * t[e + 1][0] - h * t[e - 1][0]) / 6, s[1] + (h * t[e + 1][1] - h * t[e - 1][1]) / 6], o[2] = [t[e + 1][0] + (h * t[e][0] - h * t[e + 2][0]) / 6, t[e + 1][1] + (h * t[e][1] - h * t[e + 2][1]) / 6], o[3] = [t[e + 1][0], t[e + 1][1]], a.push({
22582
+ a[0] = [s[0], s[1]], a[1] = [s[0] + (h * t[e + 1][0] - h * t[e - 1][0]) / 6, s[1] + (h * t[e + 1][1] - h * t[e - 1][1]) / 6], a[2] = [t[e + 1][0] + (h * t[e][0] - h * t[e + 2][0]) / 6, t[e + 1][1] + (h * t[e][1] - h * t[e + 2][1]) / 6], a[3] = [t[e + 1][0], t[e + 1][1]], o.push({
22525
22583
  op: "bcurveTo",
22526
- data: [o[1][0], o[1][1], o[2][0], o[2][1], o[3][0], o[3][1]]
22584
+ data: [a[1][0], a[1][1], a[2][0], a[2][1], a[3][0], a[3][1]]
22527
22585
  });
22528
22586
  }
22529
22587
  if (e && 2 === e.length) {
22530
22588
  const t = s.maxRandomnessOffset;
22531
- a.push({
22589
+ o.push({
22532
22590
  op: "lineTo",
22533
- data: [e[0] + A(t, s), e[1] + A(t, s)]
22591
+ data: [e[0] + G(t, s), e[1] + G(t, s)]
22534
22592
  });
22535
22593
  }
22536
- } else 3 === n ? (a.push({
22594
+ } else 3 === n ? (o.push({
22537
22595
  op: "move",
22538
22596
  data: [t[1][0], t[1][1]]
22539
- }), a.push({
22597
+ }), o.push({
22540
22598
  op: "bcurveTo",
22541
22599
  data: [t[1][0], t[1][1], t[2][0], t[2][1], t[2][0], t[2][1]]
22542
- })) : 2 === n && a.push(...I(t[0][0], t[0][1], t[1][0], t[1][1], s));
22543
- return a;
22600
+ })) : 2 === n && o.push(...R(t[0][0], t[0][1], t[1][0], t[1][1], s, !0, !0));
22601
+ return o;
22544
22602
  }
22545
- function z(t, e, s, n, a, o, h, r) {
22603
+ function F(t, e, s, n, o, a, h, r) {
22546
22604
  const i = [],
22547
22605
  c = [];
22548
22606
  if (0 === r.roughness) {
22549
- t /= 4, c.push([e + n * Math.cos(-t), s + a * Math.sin(-t)]);
22550
- for (let o = 0; o <= 2 * Math.PI; o += t) {
22551
- const t = [e + n * Math.cos(o), s + a * Math.sin(o)];
22607
+ t /= 4, c.push([e + n * Math.cos(-t), s + o * Math.sin(-t)]);
22608
+ for (let a = 0; a <= 2 * Math.PI; a += t) {
22609
+ const t = [e + n * Math.cos(a), s + o * Math.sin(a)];
22552
22610
  i.push(t), c.push(t);
22553
22611
  }
22554
- c.push([e + n * Math.cos(0), s + a * Math.sin(0)]), c.push([e + n * Math.cos(t), s + a * Math.sin(t)]);
22612
+ c.push([e + n * Math.cos(0), s + o * Math.sin(0)]), c.push([e + n * Math.cos(t), s + o * Math.sin(t)]);
22555
22613
  } else {
22556
- const l = A(.5, r) - Math.PI / 2;
22557
- c.push([A(o, r) + e + .9 * n * Math.cos(l - t), A(o, r) + s + .9 * a * Math.sin(l - t)]);
22614
+ const l = G(.5, r) - Math.PI / 2;
22615
+ c.push([G(a, r) + e + .9 * n * Math.cos(l - t), G(a, r) + s + .9 * o * Math.sin(l - t)]);
22558
22616
  const u = 2 * Math.PI + l - .01;
22559
22617
  for (let h = l; h < u; h += t) {
22560
- const t = [A(o, r) + e + n * Math.cos(h), A(o, r) + s + a * Math.sin(h)];
22618
+ const t = [G(a, r) + e + n * Math.cos(h), G(a, r) + s + o * Math.sin(h)];
22561
22619
  i.push(t), c.push(t);
22562
22620
  }
22563
- c.push([A(o, r) + e + n * Math.cos(l + 2 * Math.PI + .5 * h), A(o, r) + s + a * Math.sin(l + 2 * Math.PI + .5 * h)]), c.push([A(o, r) + e + .98 * n * Math.cos(l + h), A(o, r) + s + .98 * a * Math.sin(l + h)]), c.push([A(o, r) + e + .9 * n * Math.cos(l + .5 * h), A(o, r) + s + .9 * a * Math.sin(l + .5 * h)]);
22621
+ c.push([G(a, r) + e + n * Math.cos(l + 2 * Math.PI + .5 * h), G(a, r) + s + o * Math.sin(l + 2 * Math.PI + .5 * h)]), c.push([G(a, r) + e + .98 * n * Math.cos(l + h), G(a, r) + s + .98 * o * Math.sin(l + h)]), c.push([G(a, r) + e + .9 * n * Math.cos(l + .5 * h), G(a, r) + s + .9 * o * Math.sin(l + .5 * h)]);
22564
22622
  }
22565
22623
  return [c, i];
22566
22624
  }
22567
- function E(t, e, s, n, a, o, h, r, i) {
22568
- const c = o + A(.1, i),
22625
+ function V(t, e, s, n, o, a, h, r, i) {
22626
+ const c = a + G(.1, i),
22569
22627
  l = [];
22570
- l.push([A(r, i) + e + .9 * n * Math.cos(c - t), A(r, i) + s + .9 * a * Math.sin(c - t)]);
22571
- for (let o = c; o <= h; o += t) l.push([A(r, i) + e + n * Math.cos(o), A(r, i) + s + a * Math.sin(o)]);
22572
- return l.push([e + n * Math.cos(h), s + a * Math.sin(h)]), l.push([e + n * Math.cos(h), s + a * Math.sin(h)]), W(l, null, i);
22628
+ l.push([G(r, i) + e + .9 * n * Math.cos(c - t), G(r, i) + s + .9 * o * Math.sin(c - t)]);
22629
+ for (let a = c; a <= h; a += t) l.push([G(r, i) + e + n * Math.cos(a), G(r, i) + s + o * Math.sin(a)]);
22630
+ return l.push([e + n * Math.cos(h), s + o * Math.sin(h)]), l.push([e + n * Math.cos(h), s + o * Math.sin(h)]), q(l, null, i);
22573
22631
  }
22574
- function $(t, e, s, n, a, o, h, r) {
22632
+ function Z(t, e, s, n, o, a, h, r) {
22575
22633
  const i = [],
22576
22634
  c = [r.maxRandomnessOffset || 1, (r.maxRandomnessOffset || 1) + .3];
22577
22635
  let l = [0, 0];
@@ -22582,93 +22640,112 @@ function $(t, e, s, n, a, o, h, r) {
22582
22640
  data: [h[0], h[1]]
22583
22641
  }) : i.push({
22584
22642
  op: "move",
22585
- data: [h[0] + (p ? 0 : A(c[0], r)), h[1] + (p ? 0 : A(c[0], r))]
22586
- }), l = p ? [a, o] : [a + A(c[f], r), o + A(c[f], r)], i.push({
22643
+ data: [h[0] + (p ? 0 : G(c[0], r)), h[1] + (p ? 0 : G(c[0], r))]
22644
+ }), l = p ? [o, a] : [o + G(c[f], r), a + G(c[f], r)], i.push({
22587
22645
  op: "bcurveTo",
22588
- data: [t + A(c[f], r), e + A(c[f], r), s + A(c[f], r), n + A(c[f], r), l[0], l[1]]
22646
+ data: [t + G(c[f], r), e + G(c[f], r), s + G(c[f], r), n + G(c[f], r), l[0], l[1]]
22589
22647
  });
22590
22648
  return i;
22591
22649
  }
22592
- function G(t) {
22650
+ function Q(t) {
22593
22651
  return [...t];
22594
22652
  }
22595
- function R(t, e) {
22653
+ function H(t) {
22654
+ let e = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
22655
+ const s = t.length;
22656
+ if (s < 3) throw new Error("A curve must have at least three points.");
22657
+ const n = [];
22658
+ if (3 === s) n.push(Q(t[0]), Q(t[1]), Q(t[2]), Q(t[2]));else {
22659
+ const s = [];
22660
+ s.push(t[0], t[0]);
22661
+ for (let e = 1; e < t.length; e++) s.push(t[e]), e === t.length - 1 && s.push(t[e]);
22662
+ const o = [],
22663
+ a = 1 - e;
22664
+ n.push(Q(s[0]));
22665
+ for (let t = 1; t + 2 < s.length; t++) {
22666
+ const e = s[t];
22667
+ o[0] = [e[0], e[1]], o[1] = [e[0] + (a * s[t + 1][0] - a * s[t - 1][0]) / 6, e[1] + (a * s[t + 1][1] - a * s[t - 1][1]) / 6], o[2] = [s[t + 1][0] + (a * s[t][0] - a * s[t + 2][0]) / 6, s[t + 1][1] + (a * s[t][1] - a * s[t + 2][1]) / 6], o[3] = [s[t + 1][0], s[t + 1][1]], n.push(o[1], o[2], o[3]);
22668
+ }
22669
+ }
22670
+ return n;
22671
+ }
22672
+ function N(t, e) {
22596
22673
  return Math.pow(t[0] - e[0], 2) + Math.pow(t[1] - e[1], 2);
22597
22674
  }
22598
- function q(t, e, s) {
22599
- const n = R(e, s);
22600
- if (0 === n) return R(t, e);
22601
- let a = ((t[0] - e[0]) * (s[0] - e[0]) + (t[1] - e[1]) * (s[1] - e[1])) / n;
22602
- return a = Math.max(0, Math.min(1, a)), R(t, j(e, s, a));
22675
+ function B(t, e, s) {
22676
+ const n = N(e, s);
22677
+ if (0 === n) return N(t, e);
22678
+ let o = ((t[0] - e[0]) * (s[0] - e[0]) + (t[1] - e[1]) * (s[1] - e[1])) / n;
22679
+ return o = Math.max(0, Math.min(1, o)), N(t, J(e, s, o));
22603
22680
  }
22604
- function j(t, e, s) {
22681
+ function J(t, e, s) {
22605
22682
  return [t[0] + (e[0] - t[0]) * s, t[1] + (e[1] - t[1]) * s];
22606
22683
  }
22607
- function F(t, e, s, n) {
22608
- const a = n || [];
22684
+ function K(t, e, s, n) {
22685
+ const o = n || [];
22609
22686
  if (function (t, e) {
22610
22687
  const s = t[e + 0],
22611
22688
  n = t[e + 1],
22612
- a = t[e + 2],
22613
- o = t[e + 3];
22614
- let h = 3 * n[0] - 2 * s[0] - o[0];
22689
+ o = t[e + 2],
22690
+ a = t[e + 3];
22691
+ let h = 3 * n[0] - 2 * s[0] - a[0];
22615
22692
  h *= h;
22616
- let r = 3 * n[1] - 2 * s[1] - o[1];
22693
+ let r = 3 * n[1] - 2 * s[1] - a[1];
22617
22694
  r *= r;
22618
- let i = 3 * a[0] - 2 * o[0] - s[0];
22695
+ let i = 3 * o[0] - 2 * a[0] - s[0];
22619
22696
  i *= i;
22620
- let c = 3 * a[1] - 2 * o[1] - s[1];
22697
+ let c = 3 * o[1] - 2 * a[1] - s[1];
22621
22698
  return c *= c, h < i && (h = i), r < c && (r = c), h + r;
22622
22699
  }(t, e) < s) {
22623
22700
  const s = t[e + 0];
22624
- if (a.length) {
22625
- (o = a[a.length - 1], h = s, Math.sqrt(R(o, h))) > 1 && a.push(s);
22626
- } else a.push(s);
22627
- a.push(t[e + 3]);
22701
+ if (o.length) {
22702
+ (a = o[o.length - 1], h = s, Math.sqrt(N(a, h))) > 1 && o.push(s);
22703
+ } else o.push(s);
22704
+ o.push(t[e + 3]);
22628
22705
  } else {
22629
22706
  const n = .5,
22630
- o = t[e + 0],
22707
+ a = t[e + 0],
22631
22708
  h = t[e + 1],
22632
22709
  r = t[e + 2],
22633
22710
  i = t[e + 3],
22634
- c = j(o, h, n),
22635
- l = j(h, r, n),
22636
- u = j(r, i, n),
22637
- p = j(c, l, n),
22638
- f = j(l, u, n),
22639
- d = j(p, f, n);
22640
- F([o, c, p, d], 0, s, a), F([d, f, u, i], 0, s, a);
22641
- }
22642
- var o, h;
22643
- return a;
22711
+ c = J(a, h, n),
22712
+ l = J(h, r, n),
22713
+ u = J(r, i, n),
22714
+ p = J(c, l, n),
22715
+ f = J(l, u, n),
22716
+ d = J(p, f, n);
22717
+ K([a, c, p, d], 0, s, o), K([d, f, u, i], 0, s, o);
22718
+ }
22719
+ var a, h;
22720
+ return o;
22644
22721
  }
22645
- function V(t, e) {
22646
- return Z(t, 0, t.length, e);
22722
+ function U(t, e) {
22723
+ return X(t, 0, t.length, e);
22647
22724
  }
22648
- function Z(t, e, s, n, a) {
22649
- const o = a || [],
22725
+ function X(t, e, s, n, o) {
22726
+ const a = o || [],
22650
22727
  h = t[e],
22651
22728
  r = t[s - 1];
22652
22729
  let i = 0,
22653
22730
  c = 1;
22654
22731
  for (let n = e + 1; n < s - 1; ++n) {
22655
- const e = q(t[n], h, r);
22732
+ const e = B(t[n], h, r);
22656
22733
  e > i && (i = e, c = n);
22657
22734
  }
22658
- return Math.sqrt(i) > n ? (Z(t, e, c + 1, n, o), Z(t, c, s, n, o)) : (o.length || o.push(h), o.push(r)), o;
22735
+ return Math.sqrt(i) > n ? (X(t, e, c + 1, n, a), X(t, c, s, n, a)) : (a.length || a.push(h), a.push(r)), a;
22659
22736
  }
22660
- function Q(t) {
22737
+ function Y(t) {
22661
22738
  let e = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .15;
22662
22739
  let s = arguments.length > 2 ? arguments[2] : undefined;
22663
22740
  const n = [],
22664
- a = (t.length - 1) / 3;
22665
- for (let s = 0; s < a; s++) {
22666
- F(t, 3 * s, e, n);
22741
+ o = (t.length - 1) / 3;
22742
+ for (let s = 0; s < o; s++) {
22743
+ K(t, 3 * s, e, n);
22667
22744
  }
22668
- return s && s > 0 ? Z(n, 0, n.length, s) : n;
22745
+ return s && s > 0 ? X(n, 0, n.length, s) : n;
22669
22746
  }
22670
- const H = "none";
22671
- class N {
22747
+ const tt$1 = "none";
22748
+ class et {
22672
22749
  constructor(t) {
22673
22750
  this.defaultOptions = {
22674
22751
  maxRandomnessOffset: 2,
@@ -22689,7 +22766,8 @@ class N {
22689
22766
  seed: 0,
22690
22767
  disableMultiStroke: !1,
22691
22768
  disableMultiStrokeFill: !1,
22692
- preserveVertices: !1
22769
+ preserveVertices: !1,
22770
+ fillShapeRoughnessGain: .8
22693
22771
  }, this.config = t || {}, this.config.options && (this.defaultOptions = this._o(this.config.options));
22694
22772
  }
22695
22773
  static newSeed() {
@@ -22705,187 +22783,161 @@ class N {
22705
22783
  options: s || this.defaultOptions
22706
22784
  };
22707
22785
  }
22708
- line(t, e, s, n, a) {
22709
- const o = this._o(a);
22710
- return this._d("line", [y(t, e, s, n, o)], o);
22786
+ line(t, e, s, n, o) {
22787
+ const a = this._o(o);
22788
+ return this._d("line", [v(t, e, s, n, a)], a);
22711
22789
  }
22712
- rectangle(t, e, s, n, a) {
22713
- const o = this._o(a),
22790
+ rectangle(t, e, s, n, o) {
22791
+ const a = this._o(o),
22714
22792
  h = [],
22715
- r = w(t, e, s, n, o);
22716
- if (o.fill) {
22717
- const a = [[t, e], [t + s, e], [t + s, e + n], [t, e + n]];
22718
- "solid" === o.fillStyle ? h.push(S([a], o)) : h.push(L([a], o));
22793
+ r = O(t, e, s, n, a);
22794
+ if (a.fill) {
22795
+ const o = [[t, e], [t + s, e], [t + s, e + n], [t, e + n]];
22796
+ "solid" === a.fillStyle ? h.push(I([o], a)) : h.push(C([o], a));
22719
22797
  }
22720
- return o.stroke !== H && h.push(r), this._d("rectangle", h, o);
22798
+ return a.stroke !== tt$1 && h.push(r), this._d("rectangle", h, a);
22721
22799
  }
22722
- ellipse(t, e, s, n, a) {
22723
- const o = this._o(a),
22800
+ ellipse(t, e, s, n, o) {
22801
+ const a = this._o(o),
22724
22802
  h = [],
22725
- r = P(s, n, o),
22726
- i = v(t, e, o, r);
22727
- if (o.fill) if ("solid" === o.fillStyle) {
22728
- const s = v(t, e, o, r).opset;
22803
+ r = T(s, n, a),
22804
+ i = D(t, e, a, r);
22805
+ if (a.fill) if ("solid" === a.fillStyle) {
22806
+ const s = D(t, e, a, r).opset;
22729
22807
  s.type = "fillPath", h.push(s);
22730
- } else h.push(L([i.estimatedPoints], o));
22731
- return o.stroke !== H && h.push(i.opset), this._d("ellipse", h, o);
22808
+ } else h.push(C([i.estimatedPoints], a));
22809
+ return a.stroke !== tt$1 && h.push(i.opset), this._d("ellipse", h, a);
22732
22810
  }
22733
22811
  circle(t, e, s, n) {
22734
- const a = this.ellipse(t, e, s, s, n);
22735
- return a.shape = "circle", a;
22812
+ const o = this.ellipse(t, e, s, s, n);
22813
+ return o.shape = "circle", o;
22736
22814
  }
22737
22815
  linearPath(t, e) {
22738
22816
  const s = this._o(e);
22739
- return this._d("linearPath", [m$2(t, !1, s)], s);
22817
+ return this._d("linearPath", [S(t, !1, s)], s);
22740
22818
  }
22741
- arc(t, e, s, n, a, o) {
22819
+ arc(t, e, s, n, o, a) {
22742
22820
  let h = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !1;
22743
22821
  let r = arguments.length > 7 ? arguments[7] : undefined;
22744
22822
  const i = this._o(r),
22745
22823
  c = [],
22746
- l = O(t, e, s, n, a, o, h, !0, i);
22824
+ l = A(t, e, s, n, o, a, h, !0, i);
22747
22825
  if (h && i.fill) if ("solid" === i.fillStyle) {
22748
22826
  const h = Object.assign({}, i);
22749
22827
  h.disableMultiStroke = !0;
22750
- const r = O(t, e, s, n, a, o, !0, !1, h);
22828
+ const r = A(t, e, s, n, o, a, !0, !1, h);
22751
22829
  r.type = "fillPath", c.push(r);
22752
- } else c.push(function (t, e, s, n, a, o, h) {
22830
+ } else c.push(function (t, e, s, n, o, a, h) {
22753
22831
  const r = t,
22754
22832
  i = e;
22755
22833
  let c = Math.abs(s / 2),
22756
22834
  l = Math.abs(n / 2);
22757
- c += A(.01 * c, h), l += A(.01 * l, h);
22758
- let u = a,
22759
- p = o;
22835
+ c += G(.01 * c, h), l += G(.01 * l, h);
22836
+ let u = o,
22837
+ p = a;
22760
22838
  for (; u < 0;) u += 2 * Math.PI, p += 2 * Math.PI;
22761
22839
  p - u > 2 * Math.PI && (u = 0, p = 2 * Math.PI);
22762
22840
  const f = (p - u) / h.curveStepCount,
22763
22841
  d = [];
22764
22842
  for (let t = u; t <= p; t += f) d.push([r + c * Math.cos(t), i + l * Math.sin(t)]);
22765
- return d.push([r + c * Math.cos(p), i + l * Math.sin(p)]), d.push([r, i]), L([d], h);
22766
- }(t, e, s, n, a, o, i));
22767
- return i.stroke !== H && c.push(l), this._d("arc", c, i);
22843
+ return d.push([r + c * Math.cos(p), i + l * Math.sin(p)]), d.push([r, i]), C([d], h);
22844
+ }(t, e, s, n, o, a, i));
22845
+ return i.stroke !== tt$1 && c.push(l), this._d("arc", c, i);
22768
22846
  }
22769
22847
  curve(t, e) {
22770
22848
  const s = this._o(e),
22771
22849
  n = [],
22772
- a = x(t, s);
22773
- if (s.fill && s.fill !== H && t.length >= 3) {
22774
- const e = Q(function (t) {
22775
- let e = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
22776
- const s = t.length;
22777
- if (s < 3) throw new Error("A curve must have at least three points.");
22778
- const n = [];
22779
- if (3 === s) n.push(G(t[0]), G(t[1]), G(t[2]), G(t[2]));else {
22780
- const s = [];
22781
- s.push(t[0], t[0]);
22782
- for (let e = 1; e < t.length; e++) s.push(t[e]), e === t.length - 1 && s.push(t[e]);
22783
- const a = [],
22784
- o = 1 - e;
22785
- n.push(G(s[0]));
22786
- for (let t = 1; t + 2 < s.length; t++) {
22787
- const e = s[t];
22788
- a[0] = [e[0], e[1]], a[1] = [e[0] + (o * s[t + 1][0] - o * s[t - 1][0]) / 6, e[1] + (o * s[t + 1][1] - o * s[t - 1][1]) / 6], a[2] = [s[t + 1][0] + (o * s[t][0] - o * s[t + 2][0]) / 6, s[t + 1][1] + (o * s[t][1] - o * s[t + 2][1]) / 6], a[3] = [s[t + 1][0], s[t + 1][1]], n.push(a[1], a[2], a[3]);
22789
- }
22790
- }
22791
- return n;
22792
- }(t), 10, (1 + s.roughness) / 2);
22793
- "solid" === s.fillStyle ? n.push(S([e], s)) : n.push(L([e], s));
22850
+ o = L(t, s);
22851
+ if (s.fill && s.fill !== tt$1) if ("solid" === s.fillStyle) {
22852
+ const e = L(t, Object.assign(Object.assign({}, s), {
22853
+ disableMultiStroke: !0,
22854
+ roughness: s.roughness ? s.roughness + s.fillShapeRoughnessGain : 0
22855
+ }));
22856
+ n.push({
22857
+ type: "fillPath",
22858
+ ops: this._mergedShape(e.ops)
22859
+ });
22860
+ } else {
22861
+ const e = [],
22862
+ o = t;
22863
+ if (o.length) {
22864
+ const t = "number" == typeof o[0][0] ? [o] : o;
22865
+ for (const n of t) n.length < 3 ? e.push(...n) : 3 === n.length ? e.push(...Y(H([n[0], n[0], n[1], n[2]]), 10, (1 + s.roughness) / 2)) : e.push(...Y(H(n), 10, (1 + s.roughness) / 2));
22866
+ }
22867
+ e.length && n.push(C([e], s));
22794
22868
  }
22795
- return s.stroke !== H && n.push(a), this._d("curve", n, s);
22869
+ return s.stroke !== tt$1 && n.push(o), this._d("curve", n, s);
22796
22870
  }
22797
22871
  polygon(t, e) {
22798
22872
  const s = this._o(e),
22799
22873
  n = [],
22800
- a = m$2(t, !0, s);
22801
- return s.fill && ("solid" === s.fillStyle ? n.push(S([t], s)) : n.push(L([t], s))), s.stroke !== H && n.push(a), this._d("polygon", n, s);
22874
+ o = S(t, !0, s);
22875
+ return s.fill && ("solid" === s.fillStyle ? n.push(I([t], s)) : n.push(C([t], s))), s.stroke !== tt$1 && n.push(o), this._d("polygon", n, s);
22802
22876
  }
22803
22877
  path(t, e) {
22804
22878
  const s = this._o(e),
22805
22879
  n = [];
22806
22880
  if (!t) return this._d("path", n, s);
22807
22881
  t = (t || "").replace(/\n/g, " ").replace(/(-\s)/g, "-").replace("/(ss)/g", " ");
22808
- const a = s.fill && "transparent" !== s.fill && s.fill !== H,
22809
- o = s.stroke !== H,
22882
+ const o = s.fill && "transparent" !== s.fill && s.fill !== tt$1,
22883
+ a = s.stroke !== tt$1,
22810
22884
  h = !!(s.simplification && s.simplification < 1),
22811
22885
  r = function (t, e, s) {
22812
- const n = g(d(f(t))),
22813
- a = [];
22814
- let o = [],
22886
+ const n = m$2(y(b(t))),
22887
+ o = [];
22888
+ let a = [],
22815
22889
  h = [0, 0],
22816
22890
  r = [];
22817
22891
  const i = () => {
22818
- r.length >= 4 && o.push(...Q(r, e)), r = [];
22892
+ r.length >= 4 && a.push(...Y(r, e)), r = [];
22819
22893
  },
22820
22894
  c = () => {
22821
- i(), o.length && (a.push(o), o = []);
22895
+ i(), a.length && (o.push(a), a = []);
22822
22896
  };
22823
22897
  for (const {
22824
22898
  key: t,
22825
22899
  data: e
22826
22900
  } of n) switch (t) {
22827
22901
  case "M":
22828
- c(), h = [e[0], e[1]], o.push(h);
22902
+ c(), h = [e[0], e[1]], a.push(h);
22829
22903
  break;
22830
22904
  case "L":
22831
- i(), o.push([e[0], e[1]]);
22905
+ i(), a.push([e[0], e[1]]);
22832
22906
  break;
22833
22907
  case "C":
22834
22908
  if (!r.length) {
22835
- const t = o.length ? o[o.length - 1] : h;
22909
+ const t = a.length ? a[a.length - 1] : h;
22836
22910
  r.push([t[0], t[1]]);
22837
22911
  }
22838
22912
  r.push([e[0], e[1]]), r.push([e[2], e[3]]), r.push([e[4], e[5]]);
22839
22913
  break;
22840
22914
  case "Z":
22841
- i(), o.push([h[0], h[1]]);
22915
+ i(), a.push([h[0], h[1]]);
22842
22916
  }
22843
- if (c(), !s) return a;
22917
+ if (c(), !s) return o;
22844
22918
  const l = [];
22845
- for (const t of a) {
22846
- const e = V(t, s);
22919
+ for (const t of o) {
22920
+ const e = U(t, s);
22847
22921
  e.length && l.push(e);
22848
22922
  }
22849
22923
  return l;
22850
- }(t, 1, h ? 4 - 4 * s.simplification : (1 + s.roughness) / 2);
22851
- return a && ("solid" === s.fillStyle ? n.push(S(r, s)) : n.push(L(r, s))), o && (h ? r.forEach(t => {
22852
- n.push(m$2(t, !1, s));
22853
- }) : n.push(function (t, e) {
22854
- const s = g(d(f(t))),
22855
- n = [];
22856
- let a = [0, 0],
22857
- o = [0, 0];
22858
- for (const {
22859
- key: t,
22860
- data: h
22861
- } of s) switch (t) {
22862
- case "M":
22863
- {
22864
- const t = 1 * (e.maxRandomnessOffset || 0),
22865
- s = e.preserveVertices;
22866
- n.push({
22867
- op: "move",
22868
- data: h.map(n => n + (s ? 0 : A(t, e)))
22869
- }), o = [h[0], h[1]], a = [h[0], h[1]];
22870
- break;
22871
- }
22872
- case "L":
22873
- n.push(...I(o[0], o[1], h[0], h[1], e)), o = [h[0], h[1]];
22874
- break;
22875
- case "C":
22876
- {
22877
- const [t, s, a, r, i, c] = h;
22878
- n.push(...$(t, s, a, r, i, c, o, e)), o = [i, c];
22879
- break;
22880
- }
22881
- case "Z":
22882
- n.push(...I(o[0], o[1], a[0], a[1], e)), o = [a[0], a[1]];
22883
- }
22884
- return {
22885
- type: "path",
22886
- ops: n
22887
- };
22888
- }(t, s))), this._d("path", n, s);
22924
+ }(t, 1, h ? 4 - 4 * (s.simplification || 1) : (1 + s.roughness) / 2),
22925
+ i = _(t, s);
22926
+ if (o) if ("solid" === s.fillStyle) {
22927
+ if (1 === r.length) {
22928
+ const e = _(t, Object.assign(Object.assign({}, s), {
22929
+ disableMultiStroke: !0,
22930
+ roughness: s.roughness ? s.roughness + s.fillShapeRoughnessGain : 0
22931
+ }));
22932
+ n.push({
22933
+ type: "fillPath",
22934
+ ops: this._mergedShape(e.ops)
22935
+ });
22936
+ } else n.push(I(r, s));
22937
+ } else n.push(C(r, s));
22938
+ return a && (h ? r.forEach(t => {
22939
+ n.push(S(t, !1, s));
22940
+ }) : n.push(i)), this._d("path", n, s);
22889
22941
  }
22890
22942
  opsToPath(t, e) {
22891
22943
  let s = "";
@@ -22916,15 +22968,15 @@ class N {
22916
22968
  d: this.opsToPath(t),
22917
22969
  stroke: s.stroke,
22918
22970
  strokeWidth: s.strokeWidth,
22919
- fill: H
22971
+ fill: tt$1
22920
22972
  };
22921
22973
  break;
22922
22974
  case "fillPath":
22923
22975
  e = {
22924
22976
  d: this.opsToPath(t),
22925
- stroke: H,
22977
+ stroke: tt$1,
22926
22978
  strokeWidth: 0,
22927
- fill: s.fill || H
22979
+ fill: s.fill || tt$1
22928
22980
  };
22929
22981
  break;
22930
22982
  case "fillSketch":
@@ -22938,34 +22990,37 @@ class N {
22938
22990
  let s = e.fillWeight;
22939
22991
  return s < 0 && (s = e.strokeWidth / 2), {
22940
22992
  d: this.opsToPath(t),
22941
- stroke: e.fill || H,
22993
+ stroke: e.fill || tt$1,
22942
22994
  strokeWidth: s,
22943
- fill: H
22995
+ fill: tt$1
22944
22996
  };
22945
22997
  }
22998
+ _mergedShape(t) {
22999
+ return t.filter((t, e) => 0 === e || "move" !== t.op);
23000
+ }
22946
23001
  }
22947
- class B {
23002
+ class st {
22948
23003
  constructor(t, e) {
22949
- this.canvas = t, this.ctx = this.canvas.getContext("2d"), this.gen = new N(e);
23004
+ this.canvas = t, this.ctx = this.canvas.getContext("2d"), this.gen = new et(e);
22950
23005
  }
22951
23006
  draw(t) {
22952
23007
  const e = t.sets || [],
22953
23008
  s = t.options || this.getDefaultOptions(),
22954
23009
  n = this.ctx,
22955
- a = t.options.fixedDecimalPlaceDigits;
22956
- for (const o of e) switch (o.type) {
23010
+ o = t.options.fixedDecimalPlaceDigits;
23011
+ for (const a of e) switch (a.type) {
22957
23012
  case "path":
22958
- n.save(), n.strokeStyle = "none" === s.stroke ? "transparent" : s.stroke, n.lineWidth = s.strokeWidth, s.strokeLineDash && n.setLineDash(s.strokeLineDash), s.strokeLineDashOffset && (n.lineDashOffset = s.strokeLineDashOffset), this._drawToContext(n, o, a), n.restore();
23013
+ n.save(), n.strokeStyle = "none" === s.stroke ? "transparent" : s.stroke, n.lineWidth = s.strokeWidth, s.strokeLineDash && n.setLineDash(s.strokeLineDash), s.strokeLineDashOffset && (n.lineDashOffset = s.strokeLineDashOffset), this._drawToContext(n, a, o), n.restore();
22959
23014
  break;
22960
23015
  case "fillPath":
22961
23016
  {
22962
23017
  n.save(), n.fillStyle = s.fill || "";
22963
23018
  const e = "curve" === t.shape || "polygon" === t.shape || "path" === t.shape ? "evenodd" : "nonzero";
22964
- this._drawToContext(n, o, a, e), n.restore();
23019
+ this._drawToContext(n, a, o, e), n.restore();
22965
23020
  break;
22966
23021
  }
22967
23022
  case "fillSketch":
22968
- this.fillSketch(n, o, s);
23023
+ this.fillSketch(n, a, s);
22969
23024
  }
22970
23025
  }
22971
23026
  fillSketch(t, e, s) {
@@ -22996,21 +23051,21 @@ class B {
22996
23051
  getDefaultOptions() {
22997
23052
  return this.gen.defaultOptions;
22998
23053
  }
22999
- line(t, e, s, n, a) {
23000
- const o = this.gen.line(t, e, s, n, a);
23001
- return this.draw(o), o;
23054
+ line(t, e, s, n, o) {
23055
+ const a = this.gen.line(t, e, s, n, o);
23056
+ return this.draw(a), a;
23002
23057
  }
23003
- rectangle(t, e, s, n, a) {
23004
- const o = this.gen.rectangle(t, e, s, n, a);
23005
- return this.draw(o), o;
23058
+ rectangle(t, e, s, n, o) {
23059
+ const a = this.gen.rectangle(t, e, s, n, o);
23060
+ return this.draw(a), a;
23006
23061
  }
23007
- ellipse(t, e, s, n, a) {
23008
- const o = this.gen.ellipse(t, e, s, n, a);
23009
- return this.draw(o), o;
23062
+ ellipse(t, e, s, n, o) {
23063
+ const a = this.gen.ellipse(t, e, s, n, o);
23064
+ return this.draw(a), a;
23010
23065
  }
23011
23066
  circle(t, e, s, n) {
23012
- const a = this.gen.circle(t, e, s, n);
23013
- return this.draw(a), a;
23067
+ const o = this.gen.circle(t, e, s, n);
23068
+ return this.draw(o), o;
23014
23069
  }
23015
23070
  linearPath(t, e) {
23016
23071
  const s = this.gen.linearPath(t, e);
@@ -23020,10 +23075,10 @@ class B {
23020
23075
  const s = this.gen.polygon(t, e);
23021
23076
  return this.draw(s), s;
23022
23077
  }
23023
- arc(t, e, s, n, a, o) {
23078
+ arc(t, e, s, n, o, a) {
23024
23079
  let h = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !1;
23025
23080
  let r = arguments.length > 7 ? arguments[7] : undefined;
23026
- const i = this.gen.arc(t, e, s, n, a, o, h, r);
23081
+ const i = this.gen.arc(t, e, s, n, o, a, h, r);
23027
23082
  return this.draw(i), i;
23028
23083
  }
23029
23084
  curve(t, e) {
@@ -23035,38 +23090,38 @@ class B {
23035
23090
  return this.draw(s), s;
23036
23091
  }
23037
23092
  }
23038
- const J = "http://www.w3.org/2000/svg";
23039
- class K {
23093
+ const nt = "http://www.w3.org/2000/svg";
23094
+ class ot {
23040
23095
  constructor(t, e) {
23041
- this.svg = t, this.gen = new N(e);
23096
+ this.svg = t, this.gen = new et(e);
23042
23097
  }
23043
23098
  draw(t) {
23044
23099
  const e = t.sets || [],
23045
23100
  s = t.options || this.getDefaultOptions(),
23046
23101
  n = this.svg.ownerDocument || window.document,
23047
- a = n.createElementNS(J, "g"),
23048
- o = t.options.fixedDecimalPlaceDigits;
23102
+ o = n.createElementNS(nt, "g"),
23103
+ a = t.options.fixedDecimalPlaceDigits;
23049
23104
  for (const h of e) {
23050
23105
  let e = null;
23051
23106
  switch (h.type) {
23052
23107
  case "path":
23053
- e = n.createElementNS(J, "path"), e.setAttribute("d", this.opsToPath(h, o)), e.setAttribute("stroke", s.stroke), e.setAttribute("stroke-width", s.strokeWidth + ""), e.setAttribute("fill", "none"), s.strokeLineDash && e.setAttribute("stroke-dasharray", s.strokeLineDash.join(" ").trim()), s.strokeLineDashOffset && e.setAttribute("stroke-dashoffset", `${s.strokeLineDashOffset}`);
23108
+ e = n.createElementNS(nt, "path"), e.setAttribute("d", this.opsToPath(h, a)), e.setAttribute("stroke", s.stroke), e.setAttribute("stroke-width", s.strokeWidth + ""), e.setAttribute("fill", "none"), s.strokeLineDash && e.setAttribute("stroke-dasharray", s.strokeLineDash.join(" ").trim()), s.strokeLineDashOffset && e.setAttribute("stroke-dashoffset", `${s.strokeLineDashOffset}`);
23054
23109
  break;
23055
23110
  case "fillPath":
23056
- e = n.createElementNS(J, "path"), e.setAttribute("d", this.opsToPath(h, o)), e.setAttribute("stroke", "none"), e.setAttribute("stroke-width", "0"), e.setAttribute("fill", s.fill || ""), "curve" !== t.shape && "polygon" !== t.shape || e.setAttribute("fill-rule", "evenodd");
23111
+ e = n.createElementNS(nt, "path"), e.setAttribute("d", this.opsToPath(h, a)), e.setAttribute("stroke", "none"), e.setAttribute("stroke-width", "0"), e.setAttribute("fill", s.fill || ""), "curve" !== t.shape && "polygon" !== t.shape || e.setAttribute("fill-rule", "evenodd");
23057
23112
  break;
23058
23113
  case "fillSketch":
23059
23114
  e = this.fillSketch(n, h, s);
23060
23115
  }
23061
- e && a.appendChild(e);
23116
+ e && o.appendChild(e);
23062
23117
  }
23063
- return a;
23118
+ return o;
23064
23119
  }
23065
23120
  fillSketch(t, e, s) {
23066
23121
  let n = s.fillWeight;
23067
23122
  n < 0 && (n = s.strokeWidth / 2);
23068
- const a = t.createElementNS(J, "path");
23069
- return a.setAttribute("d", this.opsToPath(e, s.fixedDecimalPlaceDigits)), a.setAttribute("stroke", s.fill || ""), a.setAttribute("stroke-width", n + ""), a.setAttribute("fill", "none"), s.fillLineDash && a.setAttribute("stroke-dasharray", s.fillLineDash.join(" ").trim()), s.fillLineDashOffset && a.setAttribute("stroke-dashoffset", `${s.fillLineDashOffset}`), a;
23123
+ const o = t.createElementNS(nt, "path");
23124
+ return o.setAttribute("d", this.opsToPath(e, s.fixedDecimalPlaceDigits)), o.setAttribute("stroke", s.fill || ""), o.setAttribute("stroke-width", n + ""), o.setAttribute("fill", "none"), s.fillLineDash && o.setAttribute("stroke-dasharray", s.fillLineDash.join(" ").trim()), s.fillLineDashOffset && o.setAttribute("stroke-dashoffset", `${s.fillLineDashOffset}`), o;
23070
23125
  }
23071
23126
  get generator() {
23072
23127
  return this.gen;
@@ -23077,21 +23132,21 @@ class K {
23077
23132
  opsToPath(t, e) {
23078
23133
  return this.gen.opsToPath(t, e);
23079
23134
  }
23080
- line(t, e, s, n, a) {
23081
- const o = this.gen.line(t, e, s, n, a);
23082
- return this.draw(o);
23135
+ line(t, e, s, n, o) {
23136
+ const a = this.gen.line(t, e, s, n, o);
23137
+ return this.draw(a);
23083
23138
  }
23084
- rectangle(t, e, s, n, a) {
23085
- const o = this.gen.rectangle(t, e, s, n, a);
23086
- return this.draw(o);
23139
+ rectangle(t, e, s, n, o) {
23140
+ const a = this.gen.rectangle(t, e, s, n, o);
23141
+ return this.draw(a);
23087
23142
  }
23088
- ellipse(t, e, s, n, a) {
23089
- const o = this.gen.ellipse(t, e, s, n, a);
23090
- return this.draw(o);
23143
+ ellipse(t, e, s, n, o) {
23144
+ const a = this.gen.ellipse(t, e, s, n, o);
23145
+ return this.draw(a);
23091
23146
  }
23092
23147
  circle(t, e, s, n) {
23093
- const a = this.gen.circle(t, e, s, n);
23094
- return this.draw(a);
23148
+ const o = this.gen.circle(t, e, s, n);
23149
+ return this.draw(o);
23095
23150
  }
23096
23151
  linearPath(t, e) {
23097
23152
  const s = this.gen.linearPath(t, e);
@@ -23101,10 +23156,10 @@ class K {
23101
23156
  const s = this.gen.polygon(t, e);
23102
23157
  return this.draw(s);
23103
23158
  }
23104
- arc(t, e, s, n, a, o) {
23159
+ arc(t, e, s, n, o, a) {
23105
23160
  let h = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !1;
23106
23161
  let r = arguments.length > 7 ? arguments[7] : undefined;
23107
- const i = this.gen.arc(t, e, s, n, a, o, h, r);
23162
+ const i = this.gen.arc(t, e, s, n, o, a, h, r);
23108
23163
  return this.draw(i);
23109
23164
  }
23110
23165
  curve(t, e) {
@@ -23116,11 +23171,11 @@ class K {
23116
23171
  return this.draw(s);
23117
23172
  }
23118
23173
  }
23119
- var U = {
23120
- canvas: (t, e) => new B(t, e),
23121
- svg: (t, e) => new K(t, e),
23122
- generator: t => new N(t),
23123
- newSeed: () => N.newSeed()
23174
+ var at = {
23175
+ canvas: (t, e) => new st(t, e),
23176
+ svg: (t, e) => new ot(t, e),
23177
+ generator: t => new et(t),
23178
+ newSeed: () => et.newSeed()
23124
23179
  };
23125
23180
 
23126
23181
  const defaultRouthThemeSpec = {
@@ -23559,7 +23614,7 @@ class RoughBaseRender {
23559
23614
  } = drawContext;
23560
23615
  if (!context) return;
23561
23616
  const canvas = context.canvas.nativeCanvas,
23562
- rc = U.canvas(canvas),
23617
+ rc = at.canvas(canvas),
23563
23618
  customPath = new CustomPath2D(),
23564
23619
  roughContext = new RoughContext2d(context, customPath);
23565
23620
  context.save(), context.transformFromMatrix(graphic.transMatrix, !0);
@@ -23657,7 +23712,7 @@ let RoughCanvasArcRender = class extends RoughBaseRender {
23657
23712
  } = drawContext;
23658
23713
  if (!context) return;
23659
23714
  const canvas = context.canvas.nativeCanvas,
23660
- rc = U.canvas(canvas);
23715
+ rc = at.canvas(canvas);
23661
23716
  context.highPerformanceSave();
23662
23717
  const arcAttribute = arc.getGraphicTheme();
23663
23718
  let {
@@ -23745,7 +23800,7 @@ let RoughCanvasAreaRender = class extends DefaultCanvasAreaRender {
23745
23800
  if (fillCb) return super.drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, fillCb);
23746
23801
  context.highPerformanceSave();
23747
23802
  const canvas = context.canvas.nativeCanvas,
23748
- rc = U.canvas(canvas, {}),
23803
+ rc = at.canvas(canvas, {}),
23749
23804
  customPath = new CustomPath2D();
23750
23805
  drawAreaSegments(customPath, cache, clipRange, {
23751
23806
  offsetX: offsetX,
@@ -23835,7 +23890,7 @@ let RoughCanvasCircleRender = class extends RoughBaseRender {
23835
23890
  } = drawContext;
23836
23891
  if (!context) return;
23837
23892
  const canvas = context.canvas.nativeCanvas,
23838
- rc = U.canvas(canvas, {}),
23893
+ rc = at.canvas(canvas, {}),
23839
23894
  circleAttribute = circle.getGraphicTheme();
23840
23895
  let {
23841
23896
  x = circleAttribute.x,
@@ -23909,7 +23964,7 @@ let RoughCanvasPathRender = class extends RoughBaseRender {
23909
23964
  } = drawContext;
23910
23965
  if (!context) return;
23911
23966
  const canvas = context.canvas.nativeCanvas,
23912
- rc = U.canvas(canvas, {});
23967
+ rc = at.canvas(canvas, {});
23913
23968
  context.highPerformanceSave();
23914
23969
  const pathAttribute = path.getGraphicTheme();
23915
23970
  context.transformFromMatrix(path.transMatrix, !0);
@@ -39269,7 +39324,7 @@ class ArcSegment extends Segment {
39269
39324
 
39270
39325
  var AXIS_ELEMENT_NAME;
39271
39326
  !function (AXIS_ELEMENT_NAME) {
39272
- AXIS_ELEMENT_NAME.innerView = "inner-view", AXIS_ELEMENT_NAME.axisContainer = "axis-container", AXIS_ELEMENT_NAME.labelContainer = "axis-label-container", AXIS_ELEMENT_NAME.tickContainer = "axis-tick-container", AXIS_ELEMENT_NAME.tick = "axis-tick", AXIS_ELEMENT_NAME.subTick = "axis-sub-tick", AXIS_ELEMENT_NAME.label = "axis-label", AXIS_ELEMENT_NAME.title = "axis-title", AXIS_ELEMENT_NAME.labelHoverOnAxis = "axis-label-hover-on-axis", AXIS_ELEMENT_NAME.gridContainer = "axis-grid-container", AXIS_ELEMENT_NAME.grid = "axis-grid", AXIS_ELEMENT_NAME.gridRegion = "axis-grid-region", AXIS_ELEMENT_NAME.line = "axis-line", AXIS_ELEMENT_NAME.background = "axis-background", AXIS_ELEMENT_NAME.axisLabelBackground = "axis-label-background", AXIS_ELEMENT_NAME.axisBreak = "axis-break", AXIS_ELEMENT_NAME.axisBreakSymbol = "axis-break-symbol";
39327
+ AXIS_ELEMENT_NAME.innerView = "inner-view", AXIS_ELEMENT_NAME.axisContainer = "axis-container", AXIS_ELEMENT_NAME.labelContainer = "axis-label-container", AXIS_ELEMENT_NAME.tickContainer = "axis-tick-container", AXIS_ELEMENT_NAME.tick = "axis-tick", AXIS_ELEMENT_NAME.subTick = "axis-sub-tick", AXIS_ELEMENT_NAME.label = "axis-label", AXIS_ELEMENT_NAME.title = "axis-title", AXIS_ELEMENT_NAME.gridContainer = "axis-grid-container", AXIS_ELEMENT_NAME.grid = "axis-grid", AXIS_ELEMENT_NAME.gridRegion = "axis-grid-region", AXIS_ELEMENT_NAME.line = "axis-line", AXIS_ELEMENT_NAME.background = "axis-background", AXIS_ELEMENT_NAME.axisLabelBackground = "axis-label-background", AXIS_ELEMENT_NAME.axisBreak = "axis-break", AXIS_ELEMENT_NAME.axisBreakSymbol = "axis-break-symbol";
39273
39328
  }(AXIS_ELEMENT_NAME || (AXIS_ELEMENT_NAME = {}));
39274
39329
  var AxisStateValue;
39275
39330
  !function (AxisStateValue) {
@@ -39306,25 +39361,6 @@ const DEFAULT_AXIS_THEME = {
39306
39361
  fillOpacity: 1
39307
39362
  }
39308
39363
  },
39309
- labelHoverOnAxis: {
39310
- visible: !1,
39311
- space: 4,
39312
- position: 0,
39313
- autoRotate: !1,
39314
- textStyle: {
39315
- fontSize: 12,
39316
- fill: "white",
39317
- fontWeight: "normal",
39318
- fillOpacity: 1
39319
- },
39320
- background: {
39321
- visible: !0,
39322
- style: {
39323
- cornerRadius: 2,
39324
- fill: "black"
39325
- }
39326
- }
39327
- },
39328
39364
  tick: {
39329
39365
  visible: !0,
39330
39366
  inside: !1,
@@ -40316,8 +40352,7 @@ var __rest$b = undefined && undefined.__rest || function (s, e) {
40316
40352
  loadLineAxisComponent();
40317
40353
  class LineAxis extends AxisBase {
40318
40354
  constructor(attributes, options) {
40319
- var _a;
40320
- attributes.labelHoverOnAxis && (attributes.labelHoverOnAxis.textStyle = Object.assign({}, attributes.label.style, attributes.labelHoverOnAxis.textStyle), attributes.labelHoverOnAxis.space = null !== (_a = attributes.labelHoverOnAxis.space) && void 0 !== _a ? _a : attributes.label.space), super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, LineAxis.defaultAttributes, attributes), options), this.labelHoverOnAxisGroup = null;
40355
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, LineAxis.defaultAttributes, attributes), options);
40321
40356
  }
40322
40357
  _renderInner(container) {
40323
40358
  var _a;
@@ -40379,15 +40414,6 @@ class LineAxis extends AxisBase {
40379
40414
  }, panel.style));
40380
40415
  bgRect.name = AXIS_ELEMENT_NAME.background, bgRect.id = this._getNodeId("background"), bgRect.states = merge({}, DEFAULT_STATES$1, null !== (_a = panel.state) && void 0 !== _a ? _a : {}), axisContainer.insertBefore(bgRect, axisContainer.firstChild);
40381
40416
  }
40382
- const {
40383
- labelHoverOnAxis: labelHoverOnAxis
40384
- } = this.attribute;
40385
- labelHoverOnAxis && labelHoverOnAxis.visible && this.renderLabelHoverOnAxis();
40386
- }
40387
- renderLabelHoverOnAxis() {
40388
- const hoverOnLabelAttributes = this.getLabelHoverOnAxisAttribute(),
40389
- hoverOnLabel = new Tag(Object.assign({}, hoverOnLabelAttributes));
40390
- hoverOnLabel.name = AXIS_ELEMENT_NAME.title, hoverOnLabel.id = this._getNodeId("hover-on-label"), this.labelHoverOnAxisGroup = hoverOnLabel, this.axisContainer.add(hoverOnLabel);
40391
40417
  }
40392
40418
  renderLine(container) {
40393
40419
  const {
@@ -40528,79 +40554,6 @@ class LineAxis extends AxisBase {
40528
40554
  visible: !0
40529
40555
  }, background.style)), attrs;
40530
40556
  }
40531
- getLabelHoverOnAxisAttribute() {
40532
- var _a, _b;
40533
- const {
40534
- orient: orient
40535
- } = this.attribute,
40536
- _c = this.attribute.labelHoverOnAxis,
40537
- {
40538
- position = 0,
40539
- space = 4,
40540
- autoRotate = !0,
40541
- textStyle = {},
40542
- background = {},
40543
- formatMethod: formatMethod,
40544
- text: textContent = "",
40545
- maxWidth: maxWidth
40546
- } = _c,
40547
- restAttrs = __rest$b(_c, ["position", "space", "autoRotate", "textStyle", "background", "formatMethod", "text", "maxWidth"]),
40548
- point = this.getTickCoord(0);
40549
- "bottom" === orient || "top" === orient ? point.x = position : point.y = position;
40550
- let tickLength = 0;
40551
- (null === (_a = this.attribute.tick) || void 0 === _a ? void 0 : _a.visible) && !1 === this.attribute.tick.inside && (tickLength = this.attribute.tick.length || 4), (null === (_b = this.attribute.subTick) || void 0 === _b ? void 0 : _b.visible) && !1 === this.attribute.subTick.inside && (tickLength = Math.max(tickLength, this.attribute.subTick.length || 2));
40552
- const offset = tickLength + 0 + space,
40553
- labelPoint = this.getVerticalCoord(point, offset, !1),
40554
- vector = this.getVerticalVector(offset, !1, {
40555
- x: 0,
40556
- y: 0
40557
- });
40558
- let textBaseline,
40559
- {
40560
- angle: angle
40561
- } = restAttrs,
40562
- textAlign = "center";
40563
- if (isNil$1(angle) && autoRotate) {
40564
- const axisVector = this.getRelativeVector();
40565
- angle = angleTo(axisVector, [1, 0], !0);
40566
- const {
40567
- verticalFactor = 1
40568
- } = this.attribute;
40569
- textBaseline = 1 === -1 * verticalFactor ? "bottom" : "top";
40570
- } else textAlign = this.getTextAlign(vector), textBaseline = this.getTextBaseline(vector, !1);
40571
- let maxTagWidth = maxWidth;
40572
- if (isNil$1(maxTagWidth)) {
40573
- const {
40574
- verticalLimitSize: verticalLimitSize,
40575
- verticalMinSize: verticalMinSize,
40576
- orient: orient
40577
- } = this.attribute,
40578
- limitSize = Math.min(verticalLimitSize || 1 / 0, verticalMinSize || 1 / 0);
40579
- if (isValidNumber$1(limitSize)) {
40580
- if ("bottom" === orient || "top" === orient) {
40581
- if (angle !== Math.PI / 2) {
40582
- const cosValue = Math.abs(Math.cos(null != angle ? angle : 0));
40583
- maxTagWidth = cosValue < 1e-6 ? 1 / 0 : this.attribute.end.x / cosValue;
40584
- } else maxTagWidth = limitSize - offset;
40585
- } else if (angle && 0 !== angle) {
40586
- const sinValue = Math.abs(Math.sin(angle));
40587
- maxTagWidth = sinValue < 1e-6 ? 1 / 0 : this.attribute.end.y / sinValue;
40588
- } else maxTagWidth = limitSize - offset;
40589
- }
40590
- }
40591
- const text = formatMethod ? formatMethod(textContent) : textContent,
40592
- attrs = Object.assign(Object.assign(Object.assign({}, labelPoint), restAttrs), {
40593
- maxWidth: maxTagWidth,
40594
- textStyle: Object.assign({
40595
- textAlign: textAlign,
40596
- textBaseline: textBaseline
40597
- }, textStyle),
40598
- text: text
40599
- });
40600
- return attrs.angle = angle, background && background.visible && (attrs.panel = Object.assign(Object.assign({
40601
- visible: !0
40602
- }, restAttrs.panel), background.style)), attrs;
40603
- }
40604
40557
  getTextBaseline(vector, inside) {
40605
40558
  let base = "middle";
40606
40559
  const {
@@ -40791,25 +40744,6 @@ class LineAxis extends AxisBase {
40791
40744
  }
40792
40745
  return limitLength && (limitLength = (limitLength - labelSpace - titleSpacing - titleHeight - axisLineWidth - tickLength) / layerCount), limitLength;
40793
40746
  }
40794
- showLabelHoverOnAxis(position, text) {
40795
- if (this.attribute.labelHoverOnAxis) if (this.labelHoverOnAxisGroup) {
40796
- const {
40797
- formatMethod: formatMethod
40798
- } = this.attribute.labelHoverOnAxis,
40799
- textStr = formatMethod ? formatMethod(text) : text;
40800
- this.labelHoverOnAxisGroup.setAttribute("text", textStr), this.labelHoverOnAxisGroup.setAttribute("visible", !0), this.labelHoverOnAxisGroup.setAttribute("visibleAll", !0), "left" === this.attribute.orient || "right" === this.attribute.orient ? this.labelHoverOnAxisGroup.setAttributes({
40801
- y: position
40802
- }) : this.labelHoverOnAxisGroup.setAttributes({
40803
- x: position
40804
- });
40805
- } else this.attribute.labelHoverOnAxis.visible = !0, this.attribute.labelHoverOnAxis.position = position, this.attribute.labelHoverOnAxis.text = text, this.renderLabelHoverOnAxis();
40806
- }
40807
- hideLabelHoverOnAxis() {
40808
- this.attribute.labelHoverOnAxis && this.labelHoverOnAxisGroup && this.labelHoverOnAxisGroup.setAttributes({
40809
- visible: !1,
40810
- visibleAll: !1
40811
- });
40812
- }
40813
40747
  release() {
40814
40748
  super.release(), this._breaks = null;
40815
40749
  }
@@ -42868,7 +42802,16 @@ class LabelBase extends AnimateComponent {
42868
42802
  data = data.filter(d => !seenIds.has(d.id) && seenIds.add(d.id));
42869
42803
  }
42870
42804
  let labels = this._initText(data);
42871
- labels = isFunction$1(customLayoutFunc) ? customLayoutFunc(data, labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? d => this._idToPoint.get(d.id) : null, this) : this._layout(labels), isFunction$1(customOverlapFunc) ? labels = customOverlapFunc(labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? d => this._idToPoint.get(d.id) : null, this) : !1 !== overlap && (labels = this._overlapping(labels)), isFunction$1(this.attribute.onAfterOverlapping) && this.attribute.onAfterOverlapping(labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? d => this._idToPoint.get(d.id) : null, this), labels && labels.length && labels.forEach(label => {
42805
+ labels = isFunction$1(customLayoutFunc) ? customLayoutFunc(data, labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? d => this._idToPoint.get(d.id) : null, this) : this._layout(labels);
42806
+ const filteredLabels = [],
42807
+ overlapLabels = labels;
42808
+ if (!isBoolean$1(overlap) && isFunction$1(overlap.filterBeforeOverlap)) {
42809
+ const getRelatedGraphic = this.getRelatedGraphic.bind(this);
42810
+ labels.forEach(label => {
42811
+ overlap.filterBeforeOverlap(label, getRelatedGraphic, this) ? overlapLabels.push(label) : filteredLabels.push(label);
42812
+ });
42813
+ }
42814
+ isFunction$1(customOverlapFunc) ? labels = customOverlapFunc(overlapLabels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? d => this._idToPoint.get(d.id) : null, this).concat(filteredLabels) : !1 !== overlap && (labels = this._overlapping(overlapLabels).concat(filteredLabels)), isFunction$1(this.attribute.onAfterOverlapping) && this.attribute.onAfterOverlapping(labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? d => this._idToPoint.get(d.id) : null, this), labels && labels.length && labels.forEach(label => {
42872
42815
  this._bindEvent(label), this._setStatesOfText(label);
42873
42816
  }), !1 !== smartInvert && this._smartInvert(labels), this._renderLabels(labels), !1 !== this._enableAnimation && this._baseMarks.forEach((mark, index) => {
42874
42817
  mark.initAttributes(markAttributeList[index]);
@@ -45152,7 +45095,8 @@ class DataZoomRenderer {
45152
45095
  }
45153
45096
  _computeBasePoints() {
45154
45097
  const {
45155
- orient: orient
45098
+ orient: orient,
45099
+ isReverse = !1
45156
45100
  } = this.attribute,
45157
45101
  {
45158
45102
  position: position,
@@ -45178,7 +45122,10 @@ class DataZoomRenderer {
45178
45122
  }], basePointEnd = [{
45179
45123
  x: position.x,
45180
45124
  y: position.y
45181
- }]), {
45125
+ }]), isReverse ? {
45126
+ basePointStart: basePointEnd,
45127
+ basePointEnd: basePointStart
45128
+ } : {
45182
45129
  basePointStart: basePointStart,
45183
45130
  basePointEnd: basePointEnd
45184
45131
  };
@@ -45631,11 +45578,12 @@ class DataZoom extends AbstractComponent {
45631
45578
  })));
45632
45579
  }
45633
45580
  setAttributes(params, forceUpdateTag) {
45581
+ var _a, _b;
45634
45582
  const {
45635
45583
  start: start,
45636
45584
  end: end
45637
45585
  } = this.attribute;
45638
- start && (this._state.start = start), end && (this._state.end = end), this._renderer.setAttributes(this._getRendererAttrs()), this._interaction.setAttributes(this._getInteractionAttrs()), super.setAttributes(params, forceUpdateTag);
45586
+ start && (this._state.start = null !== (_a = params.start) && void 0 !== _a ? _a : start), end && (this._state.end = null !== (_b = params.end) && void 0 !== _b ? _b : end), this._renderer.setAttributes(this._getRendererAttrs()), this._interaction.setAttributes(this._getInteractionAttrs()), super.setAttributes(params, forceUpdateTag);
45639
45587
  }
45640
45588
  render() {
45641
45589
  this._layoutCacheFromConfig = null, this._container = this.createOrUpdateChild("datazoom-container", {}, "group"), this._renderer.renderDataZoom(), this._interaction.setAttributes(this._getInteractionAttrs());
@@ -52868,7 +52816,7 @@ TableSeriesNumber.defaultAttributes = {
52868
52816
  select: !0
52869
52817
  };
52870
52818
 
52871
- const version = "1.0.26-alpha.0";
52819
+ const version = "1.0.26-alpha.2";
52872
52820
  preLoadAllModule();
52873
52821
  if (isBrowserEnv()) {
52874
52822
  loadBrowserEnv(container);