flo-mat 4.0.1 → 4.0.3

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 (220) hide show
  1. package/README.md +1 -1
  2. package/__tests__/find-2-prong/get-medial/get-closest-points.spec.ts +49 -0
  3. package/__tests__/specific-cases/specific-cases.spec.ts +6 -0
  4. package/browser/index.js +9994 -12650
  5. package/browser/index.min.js +1 -1
  6. package/node/closest-boundary-point/foot-and-endpoint-info.d.ts +0 -3
  7. package/node/closest-boundary-point/get-close-boundary-points-certified.d.ts +1 -1
  8. package/node/closest-boundary-point/get-close-boundary-points-certified.js +2 -2
  9. package/node/closest-boundary-point/get-close-boundary-points-certified.js.map +1 -1
  10. package/node/closest-boundary-point/get-potential-closest-points-on-curve-certified.d.ts +1 -2
  11. package/node/closest-boundary-point/get-potential-closest-points-on-curve-certified.js +34 -24
  12. package/node/closest-boundary-point/get-potential-closest-points-on-curve-certified.js.map +1 -1
  13. package/node/closest-boundary-point/root-interval-to-distance-squared-interval.d.ts +1 -1
  14. package/node/closest-boundary-point/root-interval-to-distance-squared-interval.js +6 -9
  15. package/node/closest-boundary-point/root-interval-to-distance-squared-interval.js.map +1 -1
  16. package/node/cp-node/fs/insert-cp-node.d.ts +2 -2
  17. package/node/cp-node/fs/insert-cp-node.js.map +1 -1
  18. package/node/cp-node/fs/is-on-same-loop.d.ts +3 -0
  19. package/node/cp-node/fs/is-on-same-loop.js +6 -0
  20. package/node/cp-node/fs/is-on-same-loop.js.map +1 -0
  21. package/node/cp-node/fs/is-order-correct.d.ts +2 -2
  22. package/node/cp-node/fs/is-order-correct.js.map +1 -1
  23. package/node/cp-node/fs/traverse-cp.js.map +1 -1
  24. package/node/cp-node/fs/traverse-vertices.d.ts +1 -1
  25. package/node/cp-node/fs/traverse-vertices.js.map +1 -1
  26. package/node/debug/debug.d.ts +10 -15
  27. package/node/debug/debug.js +35 -46
  28. package/node/debug/debug.js.map +1 -1
  29. package/node/debug/functions/draw-elem/draw-branch.d.ts +1 -1
  30. package/node/debug/functions/draw-elem/draw-branch.js.map +1 -1
  31. package/node/debug/functions/draw-elem/draw-cp-node.d.ts +1 -1
  32. package/node/debug/functions/draw-elem/draw-cp-node.js +2 -2
  33. package/node/debug/functions/draw-elem/draw-cp-node.js.map +1 -1
  34. package/node/debug/functions/draw-elem/draw-leaves.d.ts +1 -1
  35. package/node/debug/functions/draw-elem/draw-leaves.js +2 -2
  36. package/node/debug/functions/draw-elem/draw-leaves.js.map +1 -1
  37. package/node/debug/functions/draw-elem/draw-mat.d.ts +1 -1
  38. package/node/debug/functions/draw-elem/draw-mat.js +1 -2
  39. package/node/debug/functions/draw-elem/draw-mat.js.map +1 -1
  40. package/node/debug/functions/draw-elem/draw-min-y.d.ts +1 -1
  41. package/node/debug/functions/draw-elem/draw-min-y.js.map +1 -1
  42. package/node/debug/functions/draw-elem/draw-three-prong.d.ts +1 -1
  43. package/node/debug/functions/draw-elem/draw-three-prong.js +2 -2
  44. package/node/debug/functions/draw-elem/draw-three-prong.js.map +1 -1
  45. package/node/debug/functions/draw-elem/draw-vertex.d.ts +1 -1
  46. package/node/debug/functions/draw-elem/draw-vertex.js +0 -2
  47. package/node/debug/functions/draw-elem/draw-vertex.js.map +1 -1
  48. package/node/error-analysis/gamma.d.ts +32 -0
  49. package/node/error-analysis/gamma.js +39 -0
  50. package/node/error-analysis/gamma.js.map +1 -0
  51. package/node/find-2-prong/add-1-prong.js +1 -4
  52. package/node/find-2-prong/add-1-prong.js.map +1 -1
  53. package/node/find-2-prong/find-2-prong.js +5 -5
  54. package/node/find-2-prong/find-2-prong.js.map +1 -1
  55. package/node/find-2-prong/get-medial/get-closest-points.js +27 -23
  56. package/node/find-2-prong/get-medial/get-closest-points.js.map +1 -1
  57. package/node/find-3-prong/calc-better-x.d.ts +1 -1
  58. package/node/find-3-prong/calc-better-x.js +6 -4
  59. package/node/find-3-prong/calc-better-x.js.map +1 -1
  60. package/node/find-3-prong/calc-initial-3-prong-center.d.ts +1 -1
  61. package/node/find-3-prong/calc-initial-3-prong-center.js +4 -3
  62. package/node/find-3-prong/calc-initial-3-prong-center.js.map +1 -1
  63. package/node/find-3-prong/find-3-prong-for-delta3s.js +22 -5
  64. package/node/find-3-prong/find-3-prong-for-delta3s.js.map +1 -1
  65. package/node/find-3-prong/find-and-add-3-prong.d.ts +2 -2
  66. package/node/find-3-prong/find-and-add-3-prong.js +15 -0
  67. package/node/find-3-prong/find-and-add-3-prong.js.map +1 -1
  68. package/node/find-3-prong/find-and-add-3-prongs-on-loop.js +8 -21
  69. package/node/find-3-prong/find-and-add-3-prongs-on-loop.js.map +1 -1
  70. package/node/find-3-prong/find-and-add-3-prongs.d.ts +1 -4
  71. package/node/find-3-prong/find-and-add-3-prongs.js +1 -2
  72. package/node/find-3-prong/find-and-add-3-prongs.js.map +1 -1
  73. package/node/find-3-prong/get-closest-points.d.ts +1 -1
  74. package/node/find-3-prong/get-closest-points.js +2 -2
  75. package/node/find-3-prong/get-closest-points.js.map +1 -1
  76. package/node/find-3-prong/timed-cc.d.ts +3 -0
  77. package/node/find-3-prong/timed-cc.js +5 -0
  78. package/node/find-3-prong/timed-cc.js.map +1 -0
  79. package/node/find-mat/create-initial-cp-tree.d.ts +2 -2
  80. package/node/find-mat/create-initial-cp-tree.js +2 -2
  81. package/node/find-mat/create-initial-cp-tree.js.map +1 -1
  82. package/node/find-mat/find-mat.d.ts +4 -4
  83. package/node/find-mat/find-mat.js +1 -2
  84. package/node/find-mat/find-mat.js.map +1 -1
  85. package/node/find-mat/find-mats.js +2 -2
  86. package/node/find-mat/find-mats.js.map +1 -1
  87. package/node/find-mat/get-meta.d.ts +1 -6
  88. package/node/find-mat/get-meta.js +4 -25
  89. package/node/find-mat/get-meta.js.map +1 -1
  90. package/node/index.d.ts +5 -2
  91. package/node/index.js +4 -1
  92. package/node/index.js.map +1 -1
  93. package/node/mat/create-new-cp-trees.d.ts +2 -2
  94. package/node/mat/create-new-cp-trees.js +2 -2
  95. package/node/mat/create-new-cp-trees.js.map +1 -1
  96. package/node/mat/get-cp-node-to-left-or-same.d.ts +2 -2
  97. package/node/mat/get-cp-node-to-left-or-same.js +2 -1
  98. package/node/mat/get-cp-node-to-left-or-same.js.map +1 -1
  99. package/node/mat/mat-meta.d.ts +2 -2
  100. package/node/point-on-shape/get-osculating-circle.js +2 -1
  101. package/node/point-on-shape/get-osculating-circle.js.map +1 -1
  102. package/node/reconstruct-from-mat/filter-zero-length.d.ts +10 -0
  103. package/node/reconstruct-from-mat/filter-zero-length.js +14 -0
  104. package/node/reconstruct-from-mat/filter-zero-length.js.map +1 -0
  105. package/node/reconstruct-from-mat/get-all-on-loop-by-loop.d.ts +7 -0
  106. package/node/reconstruct-from-mat/get-all-on-loop-by-loop.js +38 -0
  107. package/node/reconstruct-from-mat/get-all-on-loop-by-loop.js.map +1 -0
  108. package/node/reconstruct-from-mat/get-bezier-piece-length.d.ts +3 -0
  109. package/node/reconstruct-from-mat/get-bezier-piece-length.js +6 -0
  110. package/node/reconstruct-from-mat/get-bezier-piece-length.js.map +1 -0
  111. package/node/reconstruct-from-mat/get-boundary.d.ts +7 -0
  112. package/node/reconstruct-from-mat/get-boundary.js +18 -0
  113. package/node/reconstruct-from-mat/get-boundary.js.map +1 -0
  114. package/node/reconstruct-from-mat/get-cp-nodess-for-sat.d.ts +4 -0
  115. package/node/reconstruct-from-mat/get-cp-nodess-for-sat.js +15 -0
  116. package/node/reconstruct-from-mat/get-cp-nodess-for-sat.js.map +1 -0
  117. package/node/reconstruct-from-mat/get-matching-beziers.d.ts +10 -0
  118. package/node/reconstruct-from-mat/get-matching-beziers.js +29 -0
  119. package/node/reconstruct-from-mat/get-matching-beziers.js.map +1 -0
  120. package/node/reconstruct-from-mat/get-mbss-by-loop-per-sat.d.ts +6 -0
  121. package/node/reconstruct-from-mat/get-mbss-by-loop-per-sat.js +10 -0
  122. package/node/reconstruct-from-mat/get-mbss-by-loop-per-sat.js.map +1 -0
  123. package/node/reconstruct-from-mat/get-mbss-by-loop-with-opp-arr.d.ts +7 -0
  124. package/node/reconstruct-from-mat/get-mbss-by-loop-with-opp-arr.js +47 -0
  125. package/node/reconstruct-from-mat/get-mbss-by-loop-with-opp-arr.js.map +1 -0
  126. package/node/reconstruct-from-mat/get-sats2.d.ts +10 -0
  127. package/node/reconstruct-from-mat/get-sats2.js +16 -0
  128. package/node/reconstruct-from-mat/get-sats2.js.map +1 -0
  129. package/node/reconstruct-from-mat/is-fully-terminating.d.ts +3 -0
  130. package/node/reconstruct-from-mat/is-fully-terminating.js +19 -0
  131. package/node/reconstruct-from-mat/is-fully-terminating.js.map +1 -0
  132. package/node/reconstruct-from-mat/matched-beziers.d.ts +10 -0
  133. package/node/reconstruct-from-mat/matched-beziers.js +2 -0
  134. package/node/reconstruct-from-mat/matched-beziers.js.map +1 -0
  135. package/node/reconstruct-from-mat/reconstruct-from-mat.d.ts +4 -0
  136. package/node/reconstruct-from-mat/reconstruct-from-mat.js +28 -0
  137. package/node/reconstruct-from-mat/reconstruct-from-mat.js.map +1 -0
  138. package/node/reconstruct-from-mat/remove-sat-induced-trivial-3prongs.d.ts +12 -0
  139. package/node/reconstruct-from-mat/remove-sat-induced-trivial-3prongs.js +46 -0
  140. package/node/reconstruct-from-mat/remove-sat-induced-trivial-3prongs.js.map +1 -0
  141. package/node/reconstruct-from-mat/split-tri-path.d.ts +5 -0
  142. package/node/reconstruct-from-mat/split-tri-path.js +209 -0
  143. package/node/reconstruct-from-mat/split-tri-path.js.map +1 -0
  144. package/node/sat/add-debug-info.js +1 -2
  145. package/node/sat/add-debug-info.js.map +1 -1
  146. package/node/utils/clip.d.ts +2 -0
  147. package/node/utils/clip.js +6 -0
  148. package/node/utils/clip.js.map +1 -0
  149. package/package.json +6 -7
  150. package/src/closest-boundary-point/foot-and-endpoint-info.ts +0 -3
  151. package/src/closest-boundary-point/get-close-boundary-points-certified.ts +0 -2
  152. package/src/closest-boundary-point/get-potential-closest-points-on-curve-certified.ts +41 -27
  153. package/src/closest-boundary-point/root-interval-to-distance-squared-interval.ts +5 -10
  154. package/src/cp-node/fs/insert-cp-node.ts +2 -2
  155. package/src/cp-node/fs/is-on-same-loop.ts +15 -0
  156. package/src/cp-node/fs/is-order-correct.ts +2 -2
  157. package/src/cp-node/fs/traverse-cp.ts +1 -1
  158. package/src/cp-node/fs/traverse-vertices.ts +1 -2
  159. package/src/debug/debug.ts +54 -72
  160. package/src/debug/functions/check-ordering.ts +0 -1
  161. package/src/debug/functions/draw-elem/draw-branch.ts +1 -3
  162. package/src/debug/functions/draw-elem/draw-cp-node.ts +3 -4
  163. package/src/debug/functions/draw-elem/draw-leaves.ts +3 -3
  164. package/src/debug/functions/draw-elem/draw-mat.ts +2 -5
  165. package/src/debug/functions/draw-elem/draw-min-y.ts +2 -2
  166. package/src/debug/functions/draw-elem/draw-three-prong.ts +3 -3
  167. package/src/debug/functions/draw-elem/draw-vertex.ts +1 -4
  168. package/src/error-analysis/gamma.ts +9 -2
  169. package/src/find-2-prong/add-1-prong.ts +1 -5
  170. package/src/find-2-prong/find-2-prong.ts +7 -6
  171. package/src/find-2-prong/get-medial/get-closest-points.ts +24 -26
  172. package/src/find-3-prong/calc-better-x.ts +7 -4
  173. package/src/find-3-prong/calc-initial-3-prong-center.ts +2 -3
  174. package/src/find-3-prong/find-3-prong-for-delta3s.ts +23 -5
  175. package/src/find-3-prong/find-and-add-3-prong.ts +18 -4
  176. package/src/find-3-prong/find-and-add-3-prongs-on-loop.ts +7 -23
  177. package/src/find-3-prong/find-and-add-3-prongs.ts +5 -3
  178. package/src/find-3-prong/get-closest-points.ts +0 -2
  179. package/src/find-3-prong/timed-cc.ts +9 -0
  180. package/src/find-mat/create-initial-cp-tree.ts +3 -3
  181. package/src/find-mat/find-mat.ts +6 -8
  182. package/src/find-mat/find-mats.ts +4 -2
  183. package/src/find-mat/get-meta.ts +3 -38
  184. package/src/index.ts +6 -3
  185. package/src/mat/create-new-cp-trees.ts +3 -3
  186. package/src/mat/get-cp-node-to-left-or-same.ts +4 -3
  187. package/src/mat/mat-meta.ts +2 -2
  188. package/src/point-on-shape/get-osculating-circle.ts +2 -1
  189. package/src/reconstruct-from-mat/filter-zero-length.ts +23 -0
  190. package/src/reconstruct-from-mat/get-all-on-loop-by-loop.ts +52 -0
  191. package/src/reconstruct-from-mat/get-bezier-piece-length.ts +12 -0
  192. package/src/reconstruct-from-mat/get-boundary.ts +32 -0
  193. package/src/reconstruct-from-mat/get-cp-nodess-for-sat.ts +24 -0
  194. package/src/reconstruct-from-mat/get-matching-beziers.ts +46 -0
  195. package/src/reconstruct-from-mat/get-mbss-by-loop-per-sat.ts +19 -0
  196. package/src/reconstruct-from-mat/get-mbss-by-loop-with-opp-arr.ts +69 -0
  197. package/src/reconstruct-from-mat/get-sats2.ts +25 -0
  198. package/src/reconstruct-from-mat/is-fully-terminating.ts +27 -0
  199. package/src/reconstruct-from-mat/matched-beziers.ts +14 -0
  200. package/src/reconstruct-from-mat/reconstruct-from-mat.ts +45 -0
  201. package/src/reconstruct-from-mat/remove-sat-induced-trivial-3prongs.ts +62 -0
  202. package/src/reconstruct-from-mat/split-tri-path.ts +280 -0
  203. package/src/sat/add-debug-info.ts +1 -2
  204. package/src/utils/clip.ts +13 -0
  205. package/wallaby.mjs +1 -0
  206. package/node/closest-boundary-point/get-p-from-box.d.ts +0 -3
  207. package/node/closest-boundary-point/get-p-from-box.js +0 -11
  208. package/node/closest-boundary-point/get-p-from-box.js.map +0 -1
  209. package/node/debug/functions/general.d.ts +0 -48
  210. package/node/debug/functions/general.js +0 -53
  211. package/node/debug/functions/general.js.map +0 -1
  212. package/node/point-on-shape/pos-to-human-string.d.ts +0 -8
  213. package/node/point-on-shape/pos-to-human-string.js +0 -12
  214. package/node/point-on-shape/pos-to-human-string.js.map +0 -1
  215. package/src/debug/elem-type-two-prong.ts +0 -8
  216. package/src/debug/functions/cmp-cp-on-delta.ts +0 -54
  217. package/src/debug/functions/general.ts +0 -79
  218. package/src/debug/functions/three-prong.ts +0 -249
  219. package/src/debug/functions/two-prong.ts +0 -203
  220. package/src/find-2-prong/add-debug-info.ts +0 -45
@@ -1 +1 @@
1
- function t(t=[],e){const r=[],o={beziers:t,curves:r,idx:e};if(0===t.length)return o;let i,c=0;for(let e=0;e<t.length;e++){if(n(t[e]))continue;const s={loop:o,ps:t[e],prev:i,next:void 0,idx:c};i&&(i.next=s),i=s,r.push(s),c++}const s=r[r.length-1];return r[0].prev=s,s.next=r[0],s.ps[s.ps.length-1]=r[0].ps[0],o}function n(t){return 2===t.length?t[0][0]===t[1][0]&&t[0][1]===t[1][1]:3===t.length?t[0][0]===t[1][0]&&t[0][1]===t[1][1]&&t[1][1]===t[2][1]&&t[1][1]===t[2][1]:t[0][0]===t[1][0]&&t[0][1]===t[1][1]&&t[1][1]===t[2][1]&&t[1][1]===t[2][1]&&t[2][1]===t[3][1]&&t[2][1]===t[3][1]}function e(t){const n=[];for(let e=0;e<t.length;e++){const r=t[e];0===e&&n.push("M "+r[0][0].toString()+" "+r[0][1].toString()),4===r.length?n.push("C "+r[1][0].toString()+" "+r[1][1].toString()+" "+r[2][0].toString()+" "+r[2][1].toString()+" "+r[3][0].toString()+" "+r[3][1].toString()+" "):3===r.length?n.push("Q "+r[1][0].toString()+" "+r[1][1].toString()+" "+r[2][0].toString()+" "+r[2][1].toString()+" "):2===r.length&&n.push("L "+r[1][0].toString()+" "+r[1][1].toString()+" ")}return n.push(" z"),n.join("\n")}class r{initialPoint=void 0;p;vals=void 0;prev2ndCubicControlPoint=void 0;prev2ndQuadraticControlPoint=void 0;constructor(){this.p=[0,0]}}function o(t){const n=[t.p,t.initialPoint];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0,n}function i(t){t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0;const n=(e=t.p,t.vals[0],t.vals[1],t.vals[2],t.vals[3],t.vals[4],[[e,[t.vals[5],t.vals[6]]]]);var e;const r=n[n.length-1];return t.p=r[r.length-1],n}const c={c:function(t){const n=[t.p,[t.vals[0],t.vals[1]],[t.vals[2],t.vals[3]],[t.vals[4],t.vals[5]]];return t.prev2ndCubicControlPoint=n[2],t.prev2ndQuadraticControlPoint=void 0,n},h:function(t){const n=[t.p,[t.vals[0],t.p[1]]];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0,n},l:function(t){const n=[t.p,t.vals];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0,n},q:function(t){const n=[t.vals[0],t.vals[1]],e=[t.vals[2],t.vals[3]];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=n,[t.p,n,e]},s:function(t){const n=t.prev2ndCubicControlPoint?[t.p[0]-t.prev2ndCubicControlPoint[0]+t.p[0],t.p[1]-t.prev2ndCubicControlPoint[1]+t.p[1]]:t.p,e=[t.p,n,[t.vals[0],t.vals[1]],[t.vals[2],t.vals[3]]];return t.prev2ndCubicControlPoint=e[2],t.prev2ndQuadraticControlPoint=void 0,e},t:function(t){const n=t.prev2ndQuadraticControlPoint?[t.p[0]-t.prev2ndQuadraticControlPoint[0]+t.p[0],t.p[1]-t.prev2ndQuadraticControlPoint[1]+t.p[1]]:t.p,e=[t.vals[0],t.vals[1]];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=n,[t.p,n,e]},v:function(t){const n=[t.p,[t.p[0],t.vals[0]]];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0,n},z:o};function s(t){let n=0,e=0,r=1,o=0,i=1,c=1;const s=t._currentIndex;t._skipOptionalSpaces();let u=t._currentIndex;u<t._endIndex&&"+"===t._string[u]?(t._currentIndex+=1,u+=1):u<t._endIndex&&"-"===t._string[u]&&(t._currentIndex+=1,u+=1,i=-1);const f=t._string[u];if(u===t._endIndex||(f<"0"||f>"9")&&"."!==f)throw new Error(`The first character of a number must be one of [0-9+-.]. Found '${f}' at index ${u}.`);const l=t._currentIndex;for(;u<t._endIndex&&t._string[u]>="0"&&t._string[u]<="9";)t._currentIndex+=1,u+=1;if(u!==l){let n=u-1,r=1;for(;n>=l;)e+=r*(Number(t._string[n])-0),n-=1,r*=10}if(u<t._endIndex&&"."===t._string[u]){if(t._currentIndex+=1,u+=1,u>=t._endIndex||t._string[u]<"0"||t._string[u]>"9")throw new Error("There must be a least one digit following the .");for(;u<t._endIndex&&t._string[u]>="0"&&t._string[u]<="9";)r*=10,o+=Number(t._string.charAt(u))/r,t._currentIndex+=1,u+=1}if(u!==s&&u+1<t._endIndex&&("e"===t._string[u]||"E"===t._string[u])&&"x"!==t._string[u+1]&&"m"!==t._string[u+1]){if(t._currentIndex+=1,u+=1,"+"===t._string[u]?(t._currentIndex+=1,u+=1):"-"===t._string[u]&&(t._currentIndex+=1,u+=1,c=-1),u>=t._endIndex||t._string[u]<"0"||t._string[u]>"9")throw new Error("There must be an exponent.");for(;u<t._endIndex&&t._string[u]>="0"&&t._string[u]<="9";)n*=10,n+=Number(t._string[u]),t._currentIndex+=1,u+=1}let a=e+o;if(a*=i,n&&(a*=Math.pow(10,c*n)),s===u)throw new Error("Internal error: startIndex === source._currentIndex");return t._skipOptionalSpacesOrDelimiter(),a}const u={Z:"Z",M:"M",L:"L",C:"C",Q:"Q",A:"A",H:"H",V:"V",S:"S",T:"T",z:"Z",m:"m",l:"l",c:"c",q:"q",a:"a",h:"h",v:"v",s:"s",t:"t"};class f{_string;_currentIndex;_endIndex;_prevCommand;constructor(t){this._string=t,this._currentIndex=0,this._endIndex=this._string.length,this._prevCommand=void 0,this._skipOptionalSpaces()}parseSegment(){const t=this._string[this._currentIndex];let n,e=u[t];if(void 0===e){if(void 0===this._prevCommand)throw new Error("Implicit command not allowed for first commands.");if(!("+"===t||"-"===t||"."===t||t>="0"&&t<="9")||"Z"===this._prevCommand)throw new Error("Remaining coordinates not found for implicit command");e="M"===this._prevCommand?"L":"m"===this._prevCommand?"l":this._prevCommand}else this._currentIndex+=1;this._prevCommand=e;const r=e.toUpperCase();if("H"===r||"V"===r?n=[s(this)]:"M"===r||"L"===r||"T"===r?n=[s(this),s(this)]:"S"===r||"Q"===r?n=[s(this),s(this),s(this),s(this)]:"C"===r?n=[s(this),s(this),s(this),s(this),s(this),s(this)]:"A"===r?n=[s(this),s(this),s(this),this._parseArcFlag(),this._parseArcFlag(),s(this),s(this)]:"Z"===r&&(this._skipOptionalSpaces(),n=[]),void 0===n)throw new Error("Unknown command");return{type:e,values:n}}hasMoreData(){return this._currentIndex<this._endIndex}initialCommandIsMoveTo(){if(!this.hasMoreData())return!0;const t=u[this._string[this._currentIndex]];return"M"===t||"m"===t}_isCurrentSpace(){const t=this._string[this._currentIndex];return t<=" "&&(" "===t||"\n"===t||"\t"===t||"\r"===t||"\f"===t)}_skipOptionalSpaces(){for(;this._currentIndex<this._endIndex&&this._isCurrentSpace();)this._currentIndex+=1;return this._currentIndex<this._endIndex}_skipOptionalSpacesOrDelimiter(){return!(this._currentIndex<this._endIndex&&!this._isCurrentSpace()&&","!==this._string[this._currentIndex])&&(this._skipOptionalSpaces()&&this._currentIndex<this._endIndex&&","===this._string[this._currentIndex]&&(this._currentIndex+=1,this._skipOptionalSpaces()),this._currentIndex<this._endIndex)}_parseArcFlag(){if(this._currentIndex>=this._endIndex)throw new Error("Unable to parse arc flag");let t;const n=this._string[this._currentIndex];if(this._currentIndex+=1,"0"===n)t=0;else{if("1"!==n)throw new Error("Unable to parse arc flag - arc flag must be 0 or 1");t=1}return this._skipOptionalSpacesOrDelimiter(),t}}function l(t){return function(t){if(0===t.length)return[];if("m"!==t[0].type.toLowerCase())throw new Error("Invalid SVG - every new path must start with an M or m.");const n=new r,e=[];let s,u=[];for(let r=0;r<t.length;r++){const f=t[r],l=f.type.toLowerCase();if(n.vals=f.values,f.type===l)if("v"===l)n.vals[0]+=n.p[1];else if("a"===l)n.vals[5]+=n.p[0],n.vals[6]+=n.p[1];else for(let t=0;t<n.vals.length;t++)n.vals[t]+=n.p[t%2];if("m"!==l){if("a"===l)u.push(...i(n));else{const t=c[l];if(!t)throw new Error("Invalid SVG - command not recognized.");const e=t(n);n.p=e[e.length-1],u.push(e)}s=l}else u.length&&("z"!==s&&u.push(o(n)),e.push(u),u=[]),n.initialPoint=n.p=n.vals,s=l}return u.length>0&&("z"!==s&&u.push(o(n)),e.push(u)),e}(function(t){if(!t.length)return[];const n=new f(t),e=[];if(!n.initialCommandIsMoveTo())throw new Error("Path must start with m or M");for(;n.hasMoreData();)e.push(n.parseSegment());return e}(t))}function a(t,n,e="thin10 red nofill",r=0){if(0===n.length)return[];let o=`M${n[0][0][0]} ${n[0][0][1]} `;for(let t=0;t<n.length;t++){const e=n[t];if(e.length<=1)continue;const[,r,i,c]=e;o+=2===e.length?`L ${r[0]} ${r[1]} `:3===e.length?`Q ${r[0]} ${r[1]} ${i[0]} ${i[1]} `:`C ${r[0]} ${r[1]} ${i[0]} ${i[1]} ${c[0]} ${c[1]} `}const i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttributeNS(null,"d",o),i.setAttributeNS(null,"class",e),t.appendChild(i),[i]}function p(t){const n=t.length,e=Array.from(Array(n),()=>new Array(n).fill(0));for(let r=0;r<n;r++)for(let o=0;o<n;o++)e[r][o]=t[r][o];for(let t=0;t<n;t++)for(let r=0;r<n;r++)for(let o=0;o<n;o++)e[r][t]+e[t][o]<e[r][o]&&(e[r][o]=e[r][t]+e[t][o]);return e}function h(t){const n=t,e=[];do{e.push(t),t=t.next}while(t!==n);return e}function d(t){return h(t).filter(t=>t.isHoleClosing)}function g(t){const n=t.pointOnShape;return{idx:n.curve.idx,t:n.t,order:n.order,order2:n.order2}}function v(t){const n=t;let e=n,r=0;do{r++,e=e.nextOnCircle}while(e!==n);return r}function m(t,n=!1){const e=t,r=n?[]:[t];let o=t.nextOnCircle;for(;o!==e;)r.push(o),o=o.nextOnCircle;return r}function x(t){return t===t.next.prevOnCircle}function b(t){return m(t).filter(t=>!x(t)).length}function w(t){return m(t.prevOnCircle,!0).every(x)}function _(t){return 0===t.pointOnShape.circle.radius}function M(t){const n=t.pointOnShape,e=n.curve;return{...t,pos:n,p:n.p,t:n.t,isTerminating:x(t),isFullyTerminating:w(t),isSharp:_(t),prongCount:v(t),getRealProngCount:b(t),ordering:g(t),curve:e,loop:e.loop}}function S(t){let n=t;if(x(n))return[n];const e=[];do{e.push(n);const t=n.next.prevOnCircle;n=n=n===t?n.next.next:t}while(n!==t);return e}function N(t,n){const e=h(t),r=new Set;for(t of e)x(t)||r.has(t.next.prevOnCircle)||n(t),r.add(t)}function I(t){const n=[],e=t;let r=e;for(;r!==e.prevOnCircle;)x(r)||n.push(r.next),r=r.nextOnCircle;return n}function y(t,n){n(t);const e=m(t).filter(t=>!x(t)).map(t=>t.next);for(const t of e){const e=[t];for(;e.length;){const t=e.pop();n(t),e.push(...I(t))}}}const E=["prev","next","prevOnCircle","nextOnCircle","holeCloserTwin"];function C(t){const n=new Map,e=O(t);n.set(t,e);const r=[{cpNode:t,newCpNode:e}];for(;r.length;){const{cpNode:t,newCpNode:e}=r.pop();for(const o of E){const i=t[o];if(void 0===i)continue;let c=n.get(i);c||(c=O(i),n.set(i,c),r.push({cpNode:i,newCpNode:c})),e[o]=c}}return e}function O(t){return{...t,prev:void 0,next:void 0,prevOnCircle:void 0,nextOnCircle:void 0,holeCloserTwin:void 0}}function T(t){const n=t,e=t.next,r=n.pointOnShape,o=e.pointOnShape,i=r.curve,c=o.curve;if(i.loop!==c.loop)return[];const s=[];return c===i?s.push({ps:r.curve.ps,ts:[r.t,o.t]}):(s.push({ps:r.curve.ps,ts:[r.t,1]}),function(t,n,e,r){let o=n;do{o=o.next;const n=o===e?r:1;t.push({ps:o.ps,ts:[0,n]})}while(o!==e)}(s,r.curve,o.curve,o.t)),s}function A(t,n,e){if(4===t.length)return function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=c-n*(c-u),h=u-n*(u-l),d=p-n*(p-h),g=s-n*(s-f),v=f-n*(f-a),m=g-n*(g-v);return[e,[p,g],[d,m],[d-n*(d-(h-n*(h-(l-n*(l-i[0]))))),m-n*(m-(v-n*(v-(a-n*(a-i[1])))))]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=c-n*(c-u),h=u-n*(u-l),d=l-n*(l-i[0]),g=p-n*(p-h),v=h-n*(h-d),m=s-n*(s-f),x=f-n*(f-a),b=a-n*(a-i[1]),w=m-n*(m-x),_=x-n*(x-b);return[[g-n*(g-v),w-n*(w-_)],[v,_],[d,b],i]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=t[3],s=r[0],u=r[1],f=o[0],l=o[1],a=i[0],p=i[1],h=n*n,d=n*h,g=e*e,v=e*g,m=n*e,x=s-f,b=a-f,w=x+b,_=n*x,M=e*x,S=c[0]-s-3*b,N=u-l,I=p-l,y=N+I,E=n*N,C=e*N,O=c[1]-u-3*I;return[[d*S+(3*n*(n*w-x)+s),d*O+(3*n*(n*y-N)+u)],[m*(n*S+2*w)+(h*w+s-(M+2*_)),m*(n*O+2*y)+(h*y+u-(C+2*E))],[m*(e*S+2*w)+(g*w+s-(2*M+_)),m*(e*O+2*y)+(g*y+u-(2*C+E))],[v*S+(3*e*(e*w-x)+s),v*O+(3*e*(e*y-N)+u)]]}(t,n,e)}(t,n,e);if(3===t.length)return function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=n*n,l=i-s,a=c-u;return[e,[-n*l+i,-n*a+c],[f*(l+(o[0]-s))-(2*n*l-i),f*(a+(o[1]-u))-(2*n*a-c)]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=n*n,l=i-s,a=o[0]-s,p=c-u,h=o[1]-u;return[[f*(l+a)-(2*n*l-i),f*(p+h)-(2*n*p-c)],[n*a+s,n*h+u],o]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=r[0],s=r[1],u=o[0],f=o[1],l=n*n,a=e*e,p=n*e,h=c-u,d=h+(i[0]-u),g=s-f,v=g+(i[1]-f);return[[l*d-(2*n*h-c),l*v-(2*n*g-s)],[p*d-(h*(e+n)-c),p*v-(g*(e+n)-s)],[a*d-(2*e*h-c),a*v-(2*e*g-s)]]}(t,n,e)}(t,n,e);if(2===t.length)return function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1];return[e,[n*(r[0]-o)+o,n*(r[1]-i)+i]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1];return[[n*(r[0]-o)+o,n*(r[1]-i)+i],r]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=r[0],c=r[1],s=o[0],u=o[1];return[[n*(s-i)+i,n*(u-c)+c],[e*(s-i)+i,e*(u-c)+c]]}(t,n,e)}(t,n,e);if(1===t.length)return t;throw new Error("The given bezier curve must be of order <= 3.")}function P(t){return T(t).map(t=>A(t.ps,t.ts[0],t.ts[1]))}function k(t,n){const{cpTrees:e}=n,r=t.prev,o=t.next;r.next=o,o.prev=r,e.get(t.pointOnShape.curve.loop).remove(t,!1)}function B(t,n){const e=v(t);if(2!==e)throw new Error(`Cannot delete \`CpNode\` on ${e}-prong`);m(t).forEach(t=>k(t,n))}function z(t){const n=[],e=t.next;let r=e;do{n.push(r),r=r.nextOnCircle}while(r.nextOnCircle!==e);return n}function F(t,n,e){if(void 0===t.size||void 0===e)return;const r=e[n];if(t.size>r&&void 0!==r)for(const[n]of t){t.delete(n);break}}const Y=[function(t,n){let e,r=!1;return function(){return r||(e=t(),r=!0),e}},function(t,n,e=!1){const r=new WeakMap,o=new Map;function i(t){return"object"!=typeof t&&"function"!=typeof t||null===t?o:r}const c=function(r){let c;const s=i(r);return s.has(r)?(e&&console.log("cache hit"),c=s.get(r)):(e&&console.log("cache miss"),c=t(r),s.set(r,c),F(o,0,n)),c};return c.mapS=o,c.weakMapS=r,c.clearCache=function(){o.clear()},c.addToCache=function(t,e){const r=i(e);r.set(e,t),F(r,1,n)},c},function(t,n){const e=new WeakMap,r=new Map;function o(t,o){const i=("object"==typeof o||"function"==typeof o)&&null!==o;let c="object"!=typeof t&&"function"!=typeof t||null===t?r:e,s=c.get(t);return void 0===s&&(s={weakMap:new WeakMap,map:new Map},c.set(t,s),F(c,0,n)),i?s.weakMap:s.map}function i(e,r){const i=o(e,r);let c;return i.has(r)?c=i.get(r):(c=t(e,r),i.set(r,c),F(i,1,n)),c}return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r){const i=o(e,r);i.set(r,t),F(i,1,n)},i},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i){const c=("object"==typeof o||"function"==typeof o)&&null!==o,s=("object"==typeof i||"function"==typeof i)&&null!==i;let u="object"!=typeof t&&"function"!=typeof t||null===t?r:e,f=u.get(t);void 0===f&&(f={weakMap:new WeakMap,map:new Map},u.set(t,f),F(u,0,n));const l=c?f.weakMap:f.map;let a=l.get(o);return void 0===a&&(a={weakMap:new WeakMap,map:new Map},l.set(o,a),F(l,1,n)),s?a.weakMap:a.map}const i=function(e,r,i){const c=o(e,r,i);let s;return c.has(i)?s=c.get(i):(s=t(e,r,i),c.set(i,s),F(c,2,n)),s};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i){const c=o(e,r,i);c.set(i,t),F(c,2,n)},i},function(t,n,e=!1){const r=new WeakMap,o=new Map;function i(t,e,i,c){const s=("object"==typeof e||"function"==typeof e)&&null!==e,u=("object"==typeof i||"function"==typeof i)&&null!==i,f=("object"==typeof c||"function"==typeof c)&&null!==c;let l="object"!=typeof t&&"function"!=typeof t||null===t?o:r,a=l.get(t);void 0===a&&(a={weakMap:new WeakMap,map:new Map},l.set(t,a),F(l,0,n));const p=s?a.weakMap:a.map;let h=p.get(e);void 0===h&&(h={weakMap:new WeakMap,map:new Map},p.set(e,h),F(p,1,n));const d=u?h.weakMap:h.map;let g=d.get(i);return void 0===g&&(g={weakMap:new WeakMap,map:new Map},d.set(i,g),F(d,2,n)),f?g.weakMap:g.map}const c=function(r,o,c,s){const u=i(r,o,c,s);let f;return u.has(s)?(e&&console.log("cache hit"),f=u.get(s)):(e&&console.log("cache miss"),f=t(r,o,c,s),u.set(s,f),F(u,3,n)),f};return c.mapS=o,c.weakMapS=r,c.clearCache=function(){o.clear()},c.addToCache=function(t,e,r,o,c){const s=i(e,r,o,c);s.set(c,t),F(s,3,n)},c},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i,c,s){const u=("object"==typeof o||"function"==typeof o)&&null!==o,f=("object"==typeof i||"function"==typeof i)&&null!==i,l=("object"==typeof c||"function"==typeof c)&&null!==c,a=("object"==typeof s||"function"==typeof s)&&null!==s;let p="object"!=typeof t&&"function"!=typeof t||null===t?r:e,h=p.get(t);void 0===h&&(h={weakMap:new WeakMap,map:new Map},p.set(t,h),F(p,0,n));const d=u?h.weakMap:h.map;let g=d.get(o);void 0===g&&(g={weakMap:new WeakMap,map:new Map},d.set(o,g),F(d,1,n));const v=f?g.weakMap:g.map;let m=v.get(i);void 0===m&&(m={weakMap:new WeakMap,map:new Map},v.set(i,m),F(v,2,n));const x=l?m.weakMap:m.map;let b=x.get(c);return void 0===b&&(b={weakMap:new WeakMap,map:new Map},x.set(c,b),F(x,3,n)),a?b.weakMap:b.map}const i=function(e,r,i,c,s){const u=o(e,r,i,c,s);let f;return u.has(s)?f=u.get(s):(f=t(e,r,i,c,s),u.set(s,f),F(u,4,n)),f};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i,c,s){const u=o(e,r,i,c,s);u.set(s,t),F(u,4,n)},i},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i,c,s,u){const f=("object"==typeof o||"function"==typeof o)&&null!==o,l=("object"==typeof i||"function"==typeof i)&&null!==i,a=("object"==typeof c||"function"==typeof c)&&null!==c,p=("object"==typeof s||"function"==typeof s)&&null!==s,h=("object"==typeof u||"function"==typeof u)&&null!==u;let d="object"!=typeof t&&"function"!=typeof t||null===t?r:e,g=d.get(t);void 0===g&&(g={weakMap:new WeakMap,map:new Map},d.set(t,g),F(d,0,n));const v=f?g.weakMap:g.map;let m=v.get(o);void 0===m&&(m={weakMap:new WeakMap,map:new Map},v.set(o,m),F(v,1,n));const x=l?m.weakMap:m.map;let b=x.get(i);void 0===b&&(b={weakMap:new WeakMap,map:new Map},x.set(i,b),F(x,2,n));const w=a?b.weakMap:b.map;let _=w.get(c);void 0===_&&(_={weakMap:new WeakMap,map:new Map},w.set(c,_),F(w,3,n));const M=p?_.weakMap:_.map;let S=M.get(s);return void 0===S&&(S={weakMap:new WeakMap,map:new Map},M.set(s,S),F(M,4,n)),h?S.weakMap:S.map}const i=function(e,r,i,c,s,u){const f=o(e,r,i,c,s,u);let l;return f.has(u)?l=f.get(u):(l=t(e,r,i,c,s,u),f.set(u,l),F(f,5,n)),l};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i,c,s,u){const f=o(e,r,i,c,s,u);f.set(u,t),F(f,5,n)},i},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i,c,s,u,f){const l=("object"==typeof o||"function"==typeof o)&&null!==o,a=("object"==typeof i||"function"==typeof i)&&null!==i,p=("object"==typeof c||"function"==typeof c)&&null!==c,h=("object"==typeof s||"function"==typeof s)&&null!==s,d=("object"==typeof u||"function"==typeof u)&&null!==u,g=("object"==typeof f||"function"==typeof f)&&null!==f;let v="object"!=typeof t&&"function"!=typeof t||null===t?r:e,m=v.get(t);void 0===m&&(m={weakMap:new WeakMap,map:new Map},v.set(t,m),F(v,0,n));const x=l?m.weakMap:m.map;let b=x.get(o);void 0===b&&(b={weakMap:new WeakMap,map:new Map},x.set(o,b),F(x,1,n));const w=a?b.weakMap:b.map;let _=w.get(i);void 0===_&&(_={weakMap:new WeakMap,map:new Map},w.set(i,_),F(w,2,n));const M=p?_.weakMap:_.map;let S=M.get(c);void 0===S&&(S={weakMap:new WeakMap,map:new Map},M.set(c,S),F(M,3,n));const N=h?S.weakMap:S.map;let I=N.get(s);void 0===I&&(I={weakMap:new WeakMap,map:new Map},N.set(s,I),F(N,4,n));const y=d?I.weakMap:I.map;let E=y.get(u);return void 0===E&&(E={weakMap:new WeakMap,map:new Map},y.set(u,E),F(y,5,n)),g?E.weakMap:E.map}const i=function(e,r,i,c,s,u,f){const l=o(e,r,i,c,s,u,f);let a;return l.has(f)?a=l.get(f):(a=t(e,r,i,c,s,u,f),l.set(f,a),F(l,6,n)),a};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i,c,s,u,f){const l=o(e,r,i,c,s,u,f);l.set(f,t),F(l,6,n)},i},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i,c,s,u,f,l){const a=("object"==typeof o||"function"==typeof o)&&null!==o,p=("object"==typeof i||"function"==typeof i)&&null!==i,h=("object"==typeof c||"function"==typeof c)&&null!==c,d=("object"==typeof s||"function"==typeof s)&&null!==s,g=("object"==typeof u||"function"==typeof u)&&null!==u,v=("object"==typeof f||"function"==typeof f)&&null!==f,m=("object"==typeof l||"function"==typeof l)&&null!==l;let x="object"!=typeof t&&"function"!=typeof t||null===t?r:e,b=x.get(t);void 0===b&&(b={weakMap:new WeakMap,map:new Map},x.set(t,b),F(x,0,n));const w=a?b.weakMap:b.map;let _=w.get(o);void 0===_&&(_={weakMap:new WeakMap,map:new Map},w.set(o,_),F(w,1,n));const M=p?_.weakMap:_.map;let S=M.get(i);void 0===S&&(S={weakMap:new WeakMap,map:new Map},M.set(i,S),F(M,2,n));const N=h?S.weakMap:S.map;let I=N.get(c);void 0===I&&(I={weakMap:new WeakMap,map:new Map},N.set(c,I),F(N,3,n));const y=d?I.weakMap:I.map;let E=y.get(s);void 0===E&&(E={weakMap:new WeakMap,map:new Map},y.set(s,E),F(y,4,n));const C=g?E.weakMap:E.map;let O=C.get(u);void 0===O&&(O={weakMap:new WeakMap,map:new Map},C.set(u,O),F(C,5,n));const T=v?O.weakMap:O.map;let A=T.get(f);return void 0===A&&(A={weakMap:new WeakMap,map:new Map},T.set(f,A),F(T,6,n)),m?A.weakMap:A.map}const i=function(e,r,i,c,s,u,f,l){const a=o(e,r,i,c,s,u,f,l);let p;return a.has(l)?p=a.get(l):(p=t(e,r,i,c,s,u,f,l),a.set(l,p),F(a,7,n)),p};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i,c,s,u,f,l){const a=o(e,r,i,c,s,u,f,l);a.set(l,t),F(a,7,n)},i}];function L(t,n,e=!1){const r=t.length;if(r>8)throw new Error("A maximum of 8 formal parameters are supported");return(0,Y[r])(t,n,e)}function X(t,n){const[[e,r],[o,i]]=t,[[c,s],[u,f]]=n,l=o-e,a=i-r,p=u-c,h=f-s,d=p*a-h*l;if(0===d)return;const g=((s-r)*l-(c-e)*a)/d;return[c+g*p,s+g*h]}function H(t,n){return[n[0]-t[0],n[1]-t[1]]}function V(t,n){return t[0]*n[0]+t[1]*n[1]}function $(t){return[-t[1],t[0]]}function D(t,n){return t[0]*n[1]-t[1]*n[0]}function q(t,n,e){return[t[0]+(n[0]-t[0])*e,t[1]+(n[1]-t[1])*e]}function j(t,n){function e(n){return[t[0]+n[0],t[1]+n[1]]}return void 0===n?e:e(n)}function W(t){const n=1/Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]*n,t[1]*n]}function Q(t,n,e){function r(e){return[e[0]*n-e[1]*t,e[0]*t+e[1]*n]}return void 0===e?r:r(e)}function R(t,n){let e=0;for(let r=0;r<t.length;r++)e=e*n+t[r];return e}function G(t){if(4===t.length)return function(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[3*(s-n+3*(r-i)),6*(i+n-2*r),3*(r-n)],[3*(u-e+3*(o-c)),6*(c+e-2*o),3*(o-e)]]}(t);if(3===t.length)return function(t){const[[n,e],[r,o],[i,c]]=t;return[[2*(i+n-2*r),2*(r-n)],[2*(c+e-2*o),2*(o-e)]]}(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t;return[[r-n],[o-e]]}(t);if(1===t.length)return[[0],[0]];throw new Error("The bezier curve must be of order <= 3.")}function U(t,n){const[e,r]=G(t);return[R(e,n),R(r,n)]}function Z(t,n){const e=t-n,r=t-e;return[t-(e+r)+(r-n),e]}function J(t,n){const e=t.length,r=n.length;let o=0,i=0;const c=[];for(;o<e&&i<r;)0!==t[o]?0!==n[i]?Math.abs(t[o])<=Math.abs(n[i])?(c.push(t[o]),o++):(c.push(n[i]),i++):i++:o++;for(;o<e;)c.push(t[o]),o++;for(;i<r;)c.push(n[i]),i++;if(0===c.length)return[0];const s=c.length;if(1===s)return c;const u=[],f=c[1],l=c[0];let a=f+l;const p=l-(a-f);0!==p&&u.push(p),i=0;for(let t=2;t<s;t++){const n=c[t],e=a+n,r=e-a,o=a-(e-r)+(n-r);0!==o&&u.push(o),a=e}return 0===a&&0!==u.length||u.push(a),u}const K=134217729;function tt(t,n){const e=t.length;let r;const o=t[0];let i=o*n;const c=K*o,s=c-(c-o),u=o-s,f=K*n,l=f-(f-n),a=n-l,p=[],h=u*a-(i-s*l-u*l-s*a);0!==h&&p.push(h);for(let o=1;o<e;o++){const e=t[o],c=e*n,s=K*e,u=s-(s-e),f=e-u,l=K*n,a=l-(l-n),h=n-a,d=f*h-(c-u*a-f*a-u*h),g=i+d,v=g-i,m=i-(g-v)+(d-v);0!==m&&p.push(m),r=g;const x=c+r,b=r-(x-c);0!==b&&p.push(b),i=x}return 0===i&&0!==p.length||p.push(i),p}function nt(t,n){const e=n.length;let r;const o=n[0];let i=o*t;const c=K*o,s=c-(c-o),u=o-s,f=K*t,l=f-(f-t),a=t-l,p=[],h=u*a-(i-s*l-u*l-s*a);0!==h&&p.push(h);for(let o=1;o<e;o++){const e=n[o],c=e*t,s=K*e,u=s-(s-e),f=e-u,l=K*t,a=l-(l-t),h=t-a,d=f*h-(c-u*a-f*a-u*h),g=i+d,v=g-i,m=i-(g-v)+(d-v);0!==m&&p.push(m),r=g;const x=c+r,b=r-(x-c);0!==b&&p.push(b),i=x}return 0===i&&0!==p.length||p.push(i),p}const et=tt,rt=J;function ot(t,n){let e=[0];for(let r=0;r<t.length;r++)e=rt(e,et(n,t[r]));return e}function it(t){let n=t[0];for(let e=1;e<t.length;e++)n+=t[e];return n}function ct(t){const n=t.length,e=new Array(n);for(let r=0;r<n;r++)e[r]=-t[r];return e}const st=ct,ut=J;function ft(t,n){const e=st(n);return ut(t,e)}function lt(t){return t[t.length-1]}const at=Z,pt=nt;function ht(t){if(4===t.length){const[[n,e],[r,o]]=t;return[pt(3,at(r,n)),pt(3,at(o,e))]}if(3===t.length){const[[n,e],[r,o]]=t;return[at(2*r,2*n),at(2*o,2*e)]}if(2===t.length){const[[n,e],[r,o]]=t;return[at(r,n),at(o,e)]}if(1===t.length)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3.")}function dt(t,n){const e=t+n,r=e-t;return[t-(e-r)+(n-r),e]}function gt(t,n){const e=t.length;let r=n;const o=[];for(let n=0;n<e;n++){const e=t[n],i=r+e,c=i-r,s=r-(i-c)+(e-c);0!==s&&o.push(s),r=i}return 0===r&&0!==o.length||o.push(r),o}const vt=dt,mt=nt,xt=gt;function bt(t){if(4===t.length){const[[n,e],[r,o],[i,c]]=t;return[mt(6,xt(vt(i,n),-2*r)),mt(6,xt(vt(c,e),-2*o))]}if(3===t.length){const[[n,e],[r,o],[i,c]]=t;return[xt(vt(2*i,2*n),-4*r),xt(vt(2*c,2*e),-4*o)]}if(t.length<=2)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3")}const wt=Z,_t=nt,Mt=J;function St(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[_t(6,Mt(wt(s,n),_t(3,wt(r,i))))],[_t(6,Mt(wt(u,e),_t(3,wt(o,c))))]]}if(t.length<=3)return[[[0]],[[0]]];throw new Error("The given bezier curve must be of order <= 3.")}const{sign:Nt}=Math;function It(t,n){const[e,r]=ht(t),[o,i]=bt(t),[c,s]=ht(n),[u,f]=bt(n),l=ft(ot(e,i),ot(r,o)),a=ft(ot(c,f),ot(s,u)),p=lt(l),h=lt(a);if(Nt(p)!==Nt(h))return p-h;const d=J(ot(c,c),ot(s,s)),g=J(ot(e,e),ot(r,r)),v=ot(d,d),m=ot(v,d),x=ot(g,g),b=ot(x,g);if(0!==p||0!==h){const t=ot(l,l),n=ot(a,a),e=lt(ft(ot(t,m),ot(n,b)));if(0!==e)return p>0?e:-e}const[[w],[_]]=St(t),[[M],[S]]=St(n),N=ft(ot(e,_),ot(r,w)),I=J(ot(e,o),ot(r,i)),y=ft(ot(c,S),ot(s,M)),E=J(ot(c,u),ot(s,f)),C=ft(ot(g,N),tt(ot(l,I),3)),O=ft(ot(d,y),tt(ot(a,E),3)),T=lt(C),A=lt(O);if(T!==A)return T-A;if(0===T&&0===A)return 0;const P=ot(C,C),k=ot(v,m),B=ot(O,O),z=ot(x,b),F=lt(ft(ot(P,k),ot(B,z)));return T>0?F:-F}function yt(t,n){return t[0]===n[0]&&t[1]===n[1]}function Et(t,n){const{ccw:e,tangentI:r,tangentO:o,dotTangents:i}=function(t,n){const e=t.length;let r=t[e-2],o=n[0],i=n[1];yt(r,o)&&(r=t[e-3]),yt(o,i)&&(i=n[2]);const c=function(t,n,e){const r=Z(t[0],e[0]),o=Z(n[1],e[1]),i=Z(t[1],e[1]),c=Z(n[0],e[0]);return it(J(ot(r,o),ct(ot(i,c))))}(r,o,i),s=[Z(o[0],r[0]),Z(o[1],r[1])],u=[Z(i[0],o[0]),Z(i[1],o[1])],f=function(t,n){return it(J(ot(t[0],n[0]),ot(t[1],n[1])))}(s,u);return 0!==c||f>0?{ccw:c,tangentI:s,tangentO:u,dotTangents:f}:{ccw:It(t.slice().reverse(),n),tangentI:s,tangentO:u,dotTangents:f}}(t,n),c=e<0,s=e>0,u=[W(r.map(t=>t[1])),W(o.map(t=>t[1]))],f=D(u[0],u[1]);let l,a;return i>0?(l=f<-.0698,a=f>.0698):(l=c,a=s),{tangents:u,isSharp:c,isDull:s,isQuiteSharp:l,isQuiteDull:a}}const Ct=L(function(t){const{t:n,curve:e}=t;return Et(1===n?e.ps:e.prev.ps,1===n?e.next.ps:e.ps)});function Ot(t){return 0===t.t||1===t.t}function Tt(t){return!!Ot(t)&&Ct(t).isSharp}function At(t){const n=t.pointOnShape.circle.center,e=t,r=t.nextOnCircle,o=e.pointOnShape,i=r.pointOnShape,c=o.p,s=i.p;let u;if(Tt(o)){let t,n;0===o.t?(t=o.curve,n=o.curve.prev):1===o.t&&(t=o.curve.next,n=o.curve);const e=W(U(t.ps,0)),r=[-(f=W(U(n.ps,1)))[0],-f[1]],i=V(e,r),c=Math.sqrt((1+i)/2);u=Q(Math.sqrt((1-i)/2),c,r)}else u=c[0]===s[0]&&c[1]===s[1]?H(c,n):$(H(c,s));var f;return[n,j(W(u),n)]}const{abs:Pt}=Math,kt=1e-4;function Bt(t,n){const e=t.pointOnShape.circle.center,r=At(t),o=n.pointOnShape.circle.center,i=At(n.prevOnCircle),c=X(r,i),s=H(e,o);let u;if(c){const t=H(e,c),n=H(o,c);u=V(t,s)<0||V(n,s)>0}else u=!0;if(!u)return[e,c,o];const f=$(s),l=H(r[0],r[1]),a=H(i[0],i[1]),p=Pt(D(s,l))/9,h=Pt(D(s,a))/9;if(p>.01||h>.01)return[e,o];if(p>kt||h>kt){const t=q(e,o,1/3),n=q(e,o,2/3),c=j(f,t),s=[n,j(f,n)];return[e,X(r,[t,c]),X(i,s),o]}return[e,o]}function zt(t){return Bt(t,t.next)}function Ft(t){const n=t;let e=n;for(;e.next===e.prevOnCircle;)if(e=e.next,e===n)return;return e}function Yt(t,n){return m(t).indexOf(n)>=0}function Lt(t){return 1===b(t)&&!t.isHoleClosing}function Xt(t){return 2===b(t)}function Ht(t){return m(t).every(x)}function Vt(t){if(Ht(t))return[];for(;x(t);)t=t.nextOnCircle;for(t=t.next;2===b(t);)t=t.next;t=t.prevOnCircle;const n=[];do{n.push(t),t=t.next}while(!w(t)&&2===b(t));return n}function $t(t){return Vt(t).map(t=>zt(t))}function Dt(t,n){const e=n[0]-t[0],r=n[1]-t[1];return Math.sqrt(e*e+r*r)}function qt(t,n){const[e,r]=t,[[o,i],[c,s]]=n;return Dt([o+e*(c-o),i+e*(s-i)],[o+r*(c-o),i+r*(s-i)])}function jt(t,n,e=16){if(n[0]===n[1])return 0;const{weights:r,abscissas:o}=Wt[e],[i,c]=n;let s=0;const u=(c-i)/2,f=(c+i)/2;for(let n=0;n<=e-1;n++)s+=r[n]*t(u*o[n]+f);return u*s}L(zt);const Wt={2:{weights:[1,1],abscissas:[-.5773502691896257,.5773502691896257]},4:{weights:[.6521451548625461,.6521451548625461,.3478548451374538,.3478548451374538],abscissas:[-.3399810435848563,.3399810435848563,-.8611363115940526,.8611363115940526]},8:{weights:[.362683783378362,.362683783378362,.3137066458778873,.3137066458778873,.2223810344533745,.2223810344533745,.1012285362903763,.1012285362903763],abscissas:[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363]},16:{weights:[.027152459411754096,.062253523938647894,.09515851168249279,.12462897125553388,.14959598881657674,.16915651939500254,.18260341504492358,.1894506104550685,.1894506104550685,.18260341504492358,.16915651939500254,.14959598881657674,.12462897125553388,.09515851168249279,.062253523938647894,.027152459411754096],abscissas:[-.9894009349916499,-.9445750230732326,-.8656312023878318,-.755404408355003,-.6178762444026438,-.45801677765722737,-.2816035507792589,-.09501250983763744,.09501250983763744,.2816035507792589,.45801677765722737,.6178762444026438,.755404408355003,.8656312023878318,.9445750230732326,.9894009349916499]},64:{weights:[.048690957009139724,.048690957009139724,.04857546744150343,.04857546744150343,.048344762234802954,.048344762234802954,.04799938859645831,.04799938859645831,.04754016571483031,.04754016571483031,.04696818281621002,.04696818281621002,.046284796581314416,.046284796581314416,.04549162792741814,.04549162792741814,.044590558163756566,.044590558163756566,.04358372452932345,.04358372452932345,.04247351512365359,.04247351512365359,.04126256324262353,.04126256324262353,.03995374113272034,.03995374113272034,.038550153178615626,.038550153178615626,.03705512854024005,.03705512854024005,.035472213256882386,.035472213256882386,.033805161837141606,.033805161837141606,.03205792835485155,.03205792835485155,.030234657072402478,.030234657072402478,.028339672614259483,.028339672614259483,.02637746971505466,.02637746971505466,.024352702568710874,.024352702568710874,.022270173808383253,.022270173808383253,.02013482315353021,.02013482315353021,.017951715775697343,.017951715775697343,.015726030476024718,.015726030476024718,.013463047896718643,.013463047896718643,.011168139460131128,.011168139460131128,.008846759826363947,.008846759826363947,.006504457968978363,.006504457968978363,.004147033260562468,.004147033260562468,.001783280721696433,.001783280721696433],abscissas:[-.024350292663424433,.024350292663424433,-.07299312178779904,.07299312178779904,-.12146281929612056,.12146281929612056,-.16964442042399283,.16964442042399283,-.21742364374000708,.21742364374000708,-.2646871622087674,.2646871622087674,-.31132287199021097,.31132287199021097,-.3572201583376681,.3572201583376681,-.4022701579639916,.4022701579639916,-.4463660172534641,.4463660172534641,-.48940314570705296,.48940314570705296,-.5312794640198946,.5312794640198946,-.571895646202634,.571895646202634,-.6111553551723933,.6111553551723933,-.6489654712546573,.6489654712546573,-.6852363130542333,.6852363130542333,-.7198818501716109,.7198818501716109,-.7528199072605319,.7528199072605319,-.7839723589433414,.7839723589433414,-.8132653151227975,.8132653151227975,-.8406292962525803,.8406292962525803,-.8659993981540928,.8659993981540928,-.8893154459951141,.8893154459951141,-.9105221370785028,.9105221370785028,-.9295691721319396,.9295691721319396,-.9464113748584028,.9464113748584028,-.9610087996520538,.9610087996520538,-.973326827789911,.973326827789911,-.983336253884626,.983336253884626,-.9910133714767443,.9910133714767443,-.9963401167719553,.9963401167719553,-.9993050417357722,.9993050417357722]}};function Qt(t){const[n,e]=G(t);return function(t){const r=R(n,t),o=R(e,t);return Math.sqrt(r*r+o*o)}}const Rt=Math.abs,Gt=[[0,0],[0,0],[0,0]];function Ut(t,n,e){return 0===n?1===e?{ps:t,_ps:Gt}:function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=o[0],l=o[1],a=n*n,p=i-s,h=c-u,d=[[i,c],[-n*p+i,-n*h+c],[a*(p+(f-s))-(2*n*p-i),a*(h+(l-u))-(2*n*h-c)]],g=Rt(n),v=Rt(i),m=Rt(s),x=Rt(f),b=v+m,w=Rt(c),_=Rt(u),M=w+_;return{ps:d,_ps:[[0,0],[g*b+v,g*M+w],[a*(b+(x+m))+(2*g*b+v),a*(M+(Rt(l)+_))+(2*g*M+w)]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=o[0],l=o[1],a=n*n,p=i-s,h=f-s,d=c-u,g=l-u,v=[[a*(p+h)-(2*n*p-i),a*(d+g)-(2*n*d-c)],[n*h+s,n*g+u],[f,l]],m=Rt(n),x=Rt(i),b=Rt(s),w=x+b,_=Rt(f)+b,M=Rt(c),S=Rt(u),N=M+S;return{ps:v,_ps:[[a*(w+_)+(2*m*w+x),a*(N+(Rt(l)+S))+(2*m*N+M)],[m*_+b,0],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=r[0],s=r[1],u=o[0],f=o[1],l=i[0],a=i[1],p=n*n,h=e*e,d=n*e,g=c-u,v=g+(l-u),m=s-f,x=m+(a-f),b=p*v-(2*n*g-c),w=d*v-(g*(e+n)-c),_=h*v-(2*e*g-c),M=p*x-(2*n*m-s),S=d*x-(m*(e+n)-s),N=h*x-(2*e*m-s),I=Rt(n),y=Rt(e),E=Rt(d),C=Rt(c),O=Rt(u),T=C+O,A=T+Rt(l)+O,P=Rt(s),k=Rt(f),B=P+k,z=B+Rt(a)+k;return{ps:[[b,M],[w,S],[_,N]],_ps:[[p*A+(2*I*T+C),p*z+(2*I*B+P)],[E*A+(T*(y+I)+C),E*x+(B*(y+I)+P)],[h*A+(2*y*T+C),h*z+(2*y*B+P)]]}}(t,n,e)}const Zt=134217729;function Jt(t,n){const e=t*n,r=Zt*t,o=r-(r-t),i=t-o,c=Zt*n,s=c-(c-n),u=n-s;return[i*u-(e-o*s-i*s-o*u),e]}function Kt(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],c=r+i,s=c-r,u=e+o,f=u-e,l=r-(c-s)+(i-s)+u,a=c+l,p=e-(u-f)+(o-f)+(l-(a-c)),h=a+p;return[p-(h-a),h]}function tn(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],c=r-i,s=c-r,u=e-o,f=u-e,l=r-(c-s)+(-i-s)+u,a=c+l,p=e-(u-f)+(-o-f)+(l-(a-c)),h=a+p;return[p-(h-a),h]}const{atan2:nn}=Math,en=Jt;function rn(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],c=tn(en(i,e),en(o,r))[1],s=Kt(en(o,e),en(i,r))[1];return nn(c,s)}const{abs:on}=Math;function cn(t){const n=[];for(let e=0;e<t.length-1;e++){const r=[t[e+1][0]-t[e][0],t[e+1][1]-t[e][1]];0!==(0!==r[0]||r[1])&&n.push(r)}const e=n.length;let r=0;for(let t=0;t<e-1;t++)r+=on(rn(n[t],n[t+1]));return r}function sn(t,n=.4,e=2**-16){const r=[0],o=[1];for(;;){const i=r[r.length-1],c=o[o.length-1];if(cn(A(t,i,c))<=n||c-i<=e){if(r.push(o.pop()),1===c)return r;continue}const s=(i+c)/2;o.push(s)}}function un(t,n,e=.4,r=16){const o=t[0],i=t[1];if(o===i)return 0;const[[c,s],[u,f],[l,a]]=n;if(c===u&&u===l&&s===f&&f===a)return 0;const p=Ut(n,o,i).ps,h=sn(p,e);let d=0;for(let t=0;t<h.length-1;t++){const n=h[t],e=h[t+1];d+=jt(Qt(p),[n,e],r)}return d}const fn=Math.abs,ln=[[0,0],[0,0],[0,0],[0,0]];function an(t,n,e){return 0===n?1===e?{ps:t,_ps:ln}:function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],d=c-n*(c-u),g=u-n*(u-l),v=d-n*(d-g),m=v-n*(v-(g-n*(g-(l-n*(l-p))))),x=s-n*(s-f),b=f-n*(f-a),w=x-n*(x-b),_=w-n*(w-(b-n*(b-(a-n*(a-h))))),M=fn(n),S=fn(c),N=fn(u),I=fn(l),y=fn(p),E=fn(s),C=fn(f),O=fn(a),T=S+M*(S+N),A=N+M*(N+I),P=T+M*(T+A),k=E+M*(E+C),B=C+M*(C+O),z=k+M*(k+B);return{ps:[[c,s],[d,x],[v,w],[m,_]],_ps:[[0,0],[T,k],[P,z],[P+M*(P+(A+M*(A+(I+M*(I+y))))),z+M*(z+(B+M*(B+(O+M*(O+fn(h))))))]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],d=c-n*(c-u),g=u-n*(u-l),v=l-n*(l-p),m=d-n*(d-g),x=g-n*(g-v),b=m-n*(m-x),w=s-n*(s-f),_=f-n*(f-a),M=a-n*(a-h),S=w-n*(w-_),N=_-n*(_-M),I=S-n*(S-N),y=fn(n),E=fn(c),C=fn(u),O=fn(l),T=fn(p),A=fn(s),P=fn(f),k=fn(a),B=E+y*(E+C),z=C+y*(C+O),F=O+y*(O+T),Y=B+y*(B+z),L=z+y*(z+F),X=A+y*(A+P),H=P+y*(P+k),V=k+y*(k+fn(h)),$=X+y*(X+H),D=H+y*(H+V);return{ps:[[b,I],[x,N],[v,M],[p,h]],_ps:[[Y+y*(Y+L),$+y*($+D)],[L,D],[F,V],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=t[3],s=r[0],u=r[1],f=o[0],l=o[1],a=i[0],p=i[1],h=n*n,d=n*h,g=e*e,v=e*g,m=n*e,x=s-f,b=a-f,w=c[0]-s,_=x+b,M=n*x,S=e*x,N=w-3*b,I=u-l,y=p-l,E=c[1]-u,C=I+y,O=n*I,T=e*I,A=E-3*y,P=d*N+(3*n*(n*_-x)+s),k=m*(n*N+2*_)+(h*_+s-(S+2*M)),B=m*(e*N+2*_)+(g*_+s-(2*S+M)),z=v*N+(3*e*(e*_-x)+s),F=d*A+(3*n*(n*C-I)+u),Y=m*(n*A+2*C)+(h*C+u-(T+2*O)),L=m*(e*A+2*C)+(g*C+u-(2*T+O)),X=v*A+(3*e*(e*C-I)+u),H=fn(n),V=fn(e),$=fn(m),D=fn(d),q=fn(v),j=fn(s),W=fn(f),Q=j+W,R=fn(a)+W,G=Q+R,U=H*Q,Z=V*Q,J=fn(w)+3*R,K=fn(u),tt=fn(l),nt=K+tt,et=fn(p)+tt,rt=nt+et,ot=H*nt,it=V*nt,ct=fn(E)+3*et;return{ps:[[P,F],[k,Y],[B,L],[z,X]],_ps:[[D*J+(3*H*(H*G+Q)+j),D*ct+(3*H*(H*rt+nt)+K)],[$*(H*J+2*G)+(h*G+j+(Z+2*U)),$*(H*ct+2*rt)+(h*rt+K+(it+2*ot))],[$*(V*J+2*G)+(g*G+j+(2*Z+U)),$*(V*ct+2*rt)+(g*rt+K+(2*it+ot))],[q*J+(3*V*(V*G+Q)+j),q*ct+(3*V*(V*rt+nt)+K)]]}}(t,n,e)}function pn(t,n,e=.4,r=16){const o=t[0],i=t[1];if(o===i)return 0;const[[c,s],[u,f],[l,a],[p,h]]=n;if(c===u&&u===l&&l===p&&s===f&&f===a&&a===h)return 0;const d=an(n,o,i).ps,g=sn(d,e);let v=0;for(let t=0;t<g.length-1;t++){const n=g[t],e=g[t+1];v+=jt(Qt(d),[n,e],r)}return v}function hn(t,n=.4,e=16){if(4===t.length)return pn([0,1],t,n,e);if(3===t.length)return un([0,1],t,n,e);if(2===t.length)return qt([0,1],t);if(1===t.length)return 0;throw new Error("The given bezier curve must be of order <= 3.")}function dn(t,n,e=!0){const{cpNodes:r,hasHoleCloser:o}=function(t,n,e=!0){if(!e&&t===n)return{cpNodes:[],hasHoleCloser:!1};const r=t,o=[r];let i=t.next,c=r.isHoleClosing;for(;i!==n&&i!==r;)i.isHoleClosing&&(c=!0),o.push(i),i=i.next;return{cpNodes:o,hasHoleCloser:c}}(t,n,e);return{pss:r.flatMap(P),hasHoleCloser:o}}function gn(t){const n=t,e=t.nextOnCircle,r=Dt(n.pointOnShape.p,e.pointOnShape.p),{pss:o,hasHoleCloser:i}=dn(n,e),c=function(t){let n=0;for(let e of t)n+=e;return n}(o.map(t=>hn(t)));return i?1/0:c/r}function vn(t,n){let e=t;const r=[];for(;e!==n;){const t=Bt(e,e.next);r.push(t),e=e.next}return r}function mn(t,n){const e=D(W(U(zt(t),0)),W(U(zt(n),0)));return Math.abs(Math.asin(e)*(180/Math.PI))}function xn(t){const n=[];return y(t,t=>{n.push(t)}),n}function bn(t,n){let e;return e=t.curve.idx-n.curve.idx,0!==e||(e=t.t-n.t,0!==e||(e=t.order-n.order,0!==e||(e=t.order2-n.order2))),e}function wn(t,n){return bn(t.pointOnShape,n.pointOnShape)}const _n={getChildren:z,getVertexForwardChildren:I,getAllOnLoop:h,getAllOnCircle:m,isOnSameCircle:Yt,isTerminating:x,isFullyTerminating:w,getFirstExit:Ft,isSharp:_,isOneProng:Lt,getProngCount:v,getRealProngCount:b,cpNodeComparator:wn,enhanceCpNode:M,traverseCp:S,traverseEdges:N,traverseVertices:y,clone:C,getBoundaryBezierPartsToNext:T,getBoundaryBeziersToNext:P,removeVertex:B,getMatCurveToNext:zt,isTwoProng:Xt,getBranch:Vt,getBranchBeziers:$t,getSalience:gn,getMatCurveBetween:Bt,getEdgeDirection:At,getBoundaryBeziersBetween:dn,getMatCurvesBetween:vn,getHoleClosers:d,getInitialDegAngleBetweenMatCurves:mn,getAllVertices:xn};function Mn(t){return n=>m(n).some(t)}const Sn=Mn(function(t){return 2!==b(t)&&!t.isHoleClosing});function Nn(t){const n=new Array(t.length);for(let e=0;e<t.length;e++)n[e]=-t[e];return n}function In(t){return n=>1/t(n.toReversed())}function yn(t){const n=t.length-1;if(n<1)return 0;t[0]<0&&(t=Nn(t));const e=[];for(let t=0;t<n;t++)e.push(1);let r=0;for(let o=0;o<=n;o++){if(t[o]>=0)continue;let n=1/0,i=!1;for(let r=0;r<o;r++){if(t[r]<=0)continue;const c=(-t[o]/(t[r]/2**e[r]))**(1/(o-r));e[r]++,n>c&&(n=c),i=!0}i&&r<n&&(r=n)}return r}In(yn);const En=(Cn=yn,t=>-Cn(function(t){const n=t.length-1;if(n<0)return[];const e=t.slice();for(let t=0;t<n+1;t++)t%2==(n-1)%2&&(e[t]=-e[t]);return e}(t)));var Cn;In(En);const{min:On,max:Tn}=Math,{abs:An}=Math;function Pn(t){const n=t.slice(),e=n.length;if(1===e)return n;let r=n[e-1],o=e;for(let t=e-2;t>=0;--t){const e=r,i=n[t];r=e+i;const c=i-(r-e);c&&(n[--o]=r,r=c)}let i=0;for(let t=o;t<e;++t){const e=n[t],o=r;r=e+o;const c=o-(r-e);c&&(n[i++]=c)}return n[i++]=r,n.length=i,n}const kn=Number.EPSILON,Bn=Number.EPSILON/2,zn=Bn*Bn,Fn=Ln(1),Yn=function(){const t=3*zn;return t/(1-t)}();function Ln(t){const n=t*Bn;return n/(1-n)}new Array(20).fill(0).map((t,n)=>Ln(n));const{abs:Xn}=Math,{abs:Hn}=Math,Vn=134217729;function $n(t,n){const e=n[0],r=n[1],o=r*t,i=Vn*r,c=i-(i-r),s=r-c,u=Vn*t,f=u-(u-t),l=t-f,a=s*l-(o-c*f-s*f-c*l)+e*t,p=o+a;return[a-(p-o),p]}const{abs:Dn}=Math;function qn(t,n,e){const r=t.length-1;if(r<0)return[[],[]];const o=Dn(n),i=t.slice(),c=e.slice();for(let t=0;t<=r;t++)for(let e=1;e<=r-t;e++){const t=i[e-1],r=c[e-1],s=$n(n,t),u=o*r+Dn(s[1]),f=i[e];i[e]=Kt(f,s),c[e]=c[e]+u+Dn(i[e][1])}return[i,c]}const jn=2**27+1;function Wn(t,n){const e=t[1],r=n[1],o=e*r,i=jn*e,c=i-(i-e),s=e-c,u=jn*r,f=u-(u-r),l=r-f,a=s*l-(o-c*f-s*f-c*l)+(e*n[0]+t[0]*r),p=o+a;return[a-(p-o),p]}const{abs:Qn}=Math;function Rn(t,n){const e=t.length-1;if(e<0)return[];const r=t.slice();for(let t=0;t<=e;t++)for(let o=1;o<=e-t;o++)r[o]=Pn(J(r[o],tt(r[o-1],n)));return r}function Gn(t,n){const e=t.length-1;if(e<0)return[];const r=new Array(e+1);r[e]=t[e];let o=[1];for(let i=1;i<=e;i++)o=tt(o,n),r[e-i]=ot(t[e-i],o);return r}const{abs:Un,sign:Zn}=Math;const Jn=134217729;function Kn(t,n){const e=t*n,r=Jn*t,o=r-(r-t),i=t-o,c=Jn*n,s=c-(c-n),u=n-s;return[i*u-(e-o*s-i*s-o*u),e]}const{abs:te}=Math;function ne(t,n){const e=te(n);let r=t[0],o=.5*te(r);for(let i=1;i<t.length;i++)r=r*n+t[i],o=o*e+te(r);return o=Bn*(2*o-te(r)),[r,o]}const ee=Math.abs,{abs:re}=Math,oe=Ln(1),ie=Ln(2);function ce(t,n,e=void 0,r=1){const o=t[0],[i,c]=ne(o,n),s=ie*function(t,n){const e=ee(n);let r=0;for(let n=0;n<t.length;n++)r=r*e+ee(t[n]);return r}(o,n),u=void 0!==e?R(e,re(n)):0;if((c+s+u)*r<Math.abs(i))return i;const f=function(t,n){const e=[],r=[];let o,i=t[0];for(let c=1;c<t.length;c++){const[s,u]=Kn(i,n);[o,i]=dt(u,t[c]),e.push(s),r.push(o)}return{r̂:i,pπ:e,pσ:r}}(o,n),{pπ:l,pσ:a}=f;let{r̂:p}=f;const[h,d]=ne(l,n),[g,v]=ne(a,n),[m,x]=ne(t[1],n);let b=d+v+x+u;return p=h+g+m+p,b+=oe*p,b*r<Math.abs(p)?p:0}function se(t,n){let e=[0];for(let r=0;r<t.length;r++)e=J(t[r],tt(e,n));return e}const{abs:ue,min:fe,max:le,log2:ae,ceil:pe}=Math;function he(t,n,e,r,o,i,c,s){let u=e,f=r,l=u,a=o,p=f-u,h=p;for(;;){let d;ue(a)<ue(i)&&(u=f,f=l,l=u,o=i,i=a,a=o);const g=le(ue(u),ue(f));d=g<=1?kn:kn*2**pe(ae(g));const v=.5*(l-f);if(ue(v)<=d)return f<l?[f,l,f]:[l,f,f];if(ue(p)<d||ue(o)<=ue(i))p=v,h=p;else{let t,n,e=i/o;if(u===l)t=2*v*e,n=1-e;else{n=o/a;const r=i/a;t=e*(2*v*n*(n-r)-(f-u)*(r-1)),n=(n-1)*(r-1)*(e-1)}0<t?n=-n:t=-t,e=p,p=h,2*t<3*v*n-ue(d*n)&&t<ue(.5*e*n)?h=t/n:(p=v,h=p)}if(u=f,o=i,d<ue(h)?f+=h:0<v?f+=d:f-=d,0===(i=s?it(se(c(),f)):ce(t,f,n))){if(s)return[f,f,f];const o=le(e,f-d),u=fe(r,f+d);if(ce(t,o,n)*ce(t,u,n)!==0)return[o,u,f];if(s=!0,0===(i=it(se(c(),f))))return[f,f,f]}(0<i&&0<a||i<=0&&a<=0)&&(l=u,a=o,p=f-u,h=p)}}const{abs:de}=Math;function ge(t,n,e){const r=de(n);let o=t[0],i=e[0];for(let c=1;c<t.length;c++){const s=o*n;o=s+t[c],i=i*r+de(s)+e[c]+de(o)}return[o,i]}function ve(t){const n=t[0].length,e=[];for(let r=0;r<n;r++){const o=[];for(let e=0;e<t.length;e++)o.push(t[e][n-(r+1)]);e.push(o)}return e}const me=Kt,xe=$n,{abs:be}=Math;function we(t,n,e){const r=be(n);let o=t[0],i=e[0];for(let c=1;c<t.length;c++){const s=xe(n,o);o=me(s,t[c]),i=i*r+be(s[1])+e[c]+be(o[1])}return[o,i]}const{abs:_e,min:Me,max:Se,log2:Ne,ceil:Ie}=Math,ye=Yn/Fn;function Ee(t,n,e,r,o,i,c){const s=t.length-1;let u=0,f=1;for(;;){f*=2;for(let l=1;l<f;l+=2){u++;const a=o+(i-o)*(f+2*l)/(4*f),[p,h]=ge(t,a,n);if(_e(p)>h*Fn)return[a,p];if(u>s)return Ce(e,r,o,i,c)}}}function Ce(t,n,e,r,o){const i=t.length-1;let c=0,s=1;for(;;){s*=2;for(let u=1;u<s;u+=2){c++;const f=e+(r-e)*(s+2*u)/(4*s),[l,a]=we(t,f,n);if(_e(l[1])>a*Yn)return[f,l[1]];if(c>i)return Oe(o(),e,r)}}}function Oe(t,n,e){const r=t.length-1;let o=1;for(;;){o*=2;for(let i=1;i<o;i+=2){const c=n+(e-n)*(o+2*i)/(4*o),s=Pn(se(t,c)),u=s[s.length-1];if(0!==u)return[c,u];if(0>r)throw new Error("Cannot resolve root even in Shewchuk expansion precision")}}}function Te(t,n=-1/0,e=1/0,r,o,i=!1){let c;"number"==typeof t[0]&&(t=t.map(t=>[0,t]));const s=()=>void 0===o?t:(void 0===c&&(c=o()),c);if(r=r||new Array(t.length).fill(0),({pDd:t,pDd_:r,pExact:c}=function(t,n,e,r){let o;for(;t.length>0&&An(t[0][1])<=r*n[0]&&(o=o||e(),0===lt(o[0]));)(t=t.slice()).shift(),(n=n.slice()).shift(),o.shift();return{pDd:t,pDd_:n,pExact:o}}(t,r,s,Yn)),0===t.length)return;if(1===t.length)return[];const u=t.map(t=>t[0]+t[1]);return!i&&n!==-1/0&&e!==1/0||([n,e]=function(t,n,e){return[t=Tn(t,En(e)),n=On(n,yn(e))]}(n,e,u),n!==e)?function(t,n,e,r,o,i){const c=e.map((n,e)=>n*ye+_e(t[e])),s=r,u=o;let f,l,a,p,h=o-r;for(;[f,l]=ge(t,r,c),!(_e(f)>l*Fn);)r-=h/2,h*=2;for(;[a,p]=ge(t,o,c),!(_e(a)>p*Fn);)o+=h/2,h*=2;const d=[[r,o,f,a,0]],g=[],v=function(t,n,e,r,o){return function(i,c,s,u,f){let[l,a]=function(t,n,e){const r=t.length-1,o=Xn(n),i=t.slice(),c=e.slice();for(let t=0;t<=r;t++)for(let e=1;e<=r-t;e++){const t=n*i[e-1],r=o*c[e-1]+Xn(t);i[e]=i[e]+t,c[e]=c[e]+r+Xn(i[e])}return[i,c]}(t,i,n);!function(t,n,e){const r=t.length-1;if(r<0)return;let o=n,i=0;for(let c=1;c<=r;c++){const s=r-c,u=t[s],f=Hn(u),l=e[s],a=u*o;t[s]=a,e[s]=l*o+f*i+Hn(a);const p=o*n;i=i*n+p,o=p}}(l,c-i,a),l.reverse(),a.reverse(),function(t,n){const e=t.length-1;for(let r=0;r<=e;r++)for(let o=1;o<=e-r;o++){const e=t[o-1],r=n[o-1]+Xn(e);t[o]=t[o]+e,n[o]=n[o]+r+Xn(t[o])}}(l,a);let p=0,h=0,d=Zn(s);for(let t=1;t<l.length-1;t++){let n=Zn(l[t]);const e=l[t],r=a[t]*Fn;Un(e)<=r&&(h++,n=-d),n!==d&&(p++,d=n)}return Zn(u)!==d&&p++,1===h&&1===p?1:h>0?function(t,n,e,r,o,i,c,s){let[u,f]=qn(t,e,n);(function(t,n,e){const r=t.length-1;if(r<0)return;let o=[0,n],i=0;for(let c=1;c<=r;c++){const s=r-c,u=t[s],f=Qn(u[1]),l=e[s],a=Wn(o,u);t[s]=a,e[s]=l*o[1]+f*i+Qn(a[1]);const p=Wn(o,[0,n]);i=i*n+p[1],o=p}})(u,r-e,f),u.reverse(),f.reverse(),[u,f]=qn(u,1,f);let l=0,a=0,p=Zn(o);for(let t=0;t<u.length-1;t++){let n=Zn(u[t][1]);const e=f[t]*Yn,r=u[t];e>=Un(r[1])&&(a++,n=-p),n!==p&&(l++,p=n)}return Zn(i)!==p&&l++,1===a&&1===l?1:0===a?l:c>1?function(t,n,e,r,o){let i=Rn(t(),n);i=Gn(i,e-n),i.reverse(),i=Rn(i,1);let c=0,s=Zn(r);for(let t=1;t<i.length-1;t++){const n=i[t];let e=Zn(n[n.length-1]);e!==s&&0!==e&&(c++,s=e)}return Zn(o)!==s&&c++,c}(s,e,r,o,i):-l}(e,r,i,c,s,u,f,o):p}}(t,c,n,e,i);let m,x;for(;d.length>0;){const r=d.pop(),[o,s,u,f,l]=r,a=v(o,s,u,f,l);if(0===a)continue;if(1===a){m=m||e.map(t=>t*Yn),x=x||ve(n);const[t,r,c]=he(x,m,o,s,u,f,i,!1);g.push({t:c,tS:t,tE:r,multiplicity:1});continue}let p=a<0?l+1:0;if(s-o<=2*_e(a)*kn*Se(1,2**Ie(Ne(Se(_e(o),_e(s)))))){if(0===p){g.push({t:(o+s)/2,tS:o,tE:s,multiplicity:_e(a)});continue}p=1/0}const[h,b]=Ee(t,c,n,e,o,s,i);d.push([o,h,u,b,p]),d.push([h,s,b,f,p])}return g.reverse(),g.filter(t=>{const{tS:n,tE:e}=t;return!(e<s||n>u)})}(u,t,r,n,e,s):[{t:n,tS:n,tE:e,multiplicity:u.length-1}]}function Ae(t,n){if(0===n)return t[0];if(1===n)return t[t.length-1];if(4===t.length){const[[e,r],[o,i],[c,s],[u,f]]=t,l=e+(o-e)*n,a=o+(c-o)*n,p=l+(a-l)*n,h=r+(i-r)*n,d=i+(s-i)*n,g=h+(d-h)*n;return[p+(a+(c+(u-c)*n-a)*n-p)*n,g+(d+(s+(f-s)*n-d)*n-g)*n]}if(3===t.length){const[[e,r],[o,i],[c,s]]=t,u=e+(o-e)*n,f=r+(i-r)*n;return[u+(o+(c-o)*n-u)*n,f+(i+(s-i)*n-f)*n]}if(2===t.length){const[[e,r],[o,i]]=t;return[e+(o-e)*n,r+(i-r)*n]}if(1===t.length)return t[0];throw new Error("The given bezier curve must be of order <= 3.")}const Pe=Math.abs;function ke(t,n){if(0===n[0]&&0===n[1])return[0,0];if(0===n[0]&&1===n[1])return[0,0];const e=Pe(n[1]);if(4===t.length){const[[n,r],[o,i],[c,s],[u,f]]=t,l=Pe(n),a=Pe(r),p=Pe(o),h=Pe(i),d=Pe(c),g=Pe(s),v=l+(p+l)*e,m=p+(d+p)*e,x=v+(m+v)*e,b=a+(h+a)*e,w=h+(g+h)*e,_=b+(w+b)*e;return[x+(m+(d+(Pe(u)+d)*e+m)*e+x)*e,_+(w+(g+(Pe(f)+g)*e+w)*e+_)*e]}if(3===t.length){const[[n,r],[o,i],[c,s]]=t,u=Pe(n),f=Pe(r),l=Pe(o),a=Pe(i),p=u+(l+u)*e,h=f+(a+f)*e;return[p+(l+(Pe(c)+l)*e+p)*e,h+(a+(Pe(s)+a)*e+h)*e]}if(2===t.length){const[[n,r],[o,i]]=t,c=Pe(n),s=Pe(r);return[c+(Pe(o)+c)*e,s+(Pe(i)+s)*e]}if(1===t.length)return[0,0];throw new Error("The given bezier curve must be of order <= 3.")}Number.EPSILON;const Be=Number.EPSILON/2,ze=Be*Be,Fe=(Ye(1),Le(3));function Ye(t){const n=t*Be;return n/(1-n)}function Le(t){const n=t*ze;return n/(1-n)}const Xe=Math.abs,He=[[0,0],[0,0],[0,0],[0,0]];function Ve(t,n,e){return 0===n?1===e?{ps:t,_ps:He}:function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],d=c-n*(c-u),g=u-n*(u-l),v=d-n*(d-g),m=v-n*(v-(g-n*(g-(l-n*(l-p))))),x=s-n*(s-f),b=f-n*(f-a),w=x-n*(x-b),_=w-n*(w-(b-n*(b-(a-n*(a-h))))),M=Xe(n),S=Xe(c),N=Xe(u),I=Xe(l),y=Xe(p),E=Xe(s),C=Xe(f),O=Xe(a),T=S+M*(S+N),A=N+M*(N+I),P=T+M*(T+A),k=E+M*(E+C),B=C+M*(C+O),z=k+M*(k+B);return{ps:[[c,s],[d,x],[v,w],[m,_]],_ps:[[0,0],[T,k],[P,z],[P+M*(P+(A+M*(A+(I+M*(I+y))))),z+M*(z+(B+M*(B+(O+M*(O+Xe(h))))))]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],d=c-n*(c-u),g=u-n*(u-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*(H*J+2*G)+(h*G+j+(Z+2*U)),$*(H*ct+2*rt)+(h*rt+K+(it+2*ot))],[$*(V*J+2*G)+(g*G+j+(2*Z+U)),$*(V*ct+2*rt)+(g*rt+K+(2*it+ot))],[q*J+(3*V*(V*G+Q)+j),q*ct+(3*V*(V*rt+nt)+K)]]}}(t,n,e)}const $e=Math.abs,De=[[0,0],[0,0],[0,0]];function qe(t,n,e){return 0===n?1===e?{ps:t,_ps:De}:function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=o[0],l=o[1],a=n*n,p=i-s,h=c-u,d=[[i,c],[-n*p+i,-n*h+c],[a*(p+(f-s))-(2*n*p-i),a*(h+(l-u))-(2*n*h-c)]],g=$e(n),v=$e(i),m=$e(s),x=$e(f),b=v+m,w=$e(c),_=$e(u),M=w+_;return{ps:d,_ps:[[0,0],[g*b+v,g*M+w],[a*(b+(x+m))+(2*g*b+v),a*(M+($e(l)+_))+(2*g*M+w)]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=o[0],l=o[1],a=n*n,p=i-s,h=f-s,d=c-u,g=l-u,v=[[a*(p+h)-(2*n*p-i),a*(d+g)-(2*n*d-c)],[n*h+s,n*g+u],[f,l]],m=$e(n),x=$e(i),b=$e(s),w=x+b,_=$e(f)+b,M=$e(c),S=$e(u),N=M+S;return{ps:v,_ps:[[a*(w+_)+(2*m*w+x),a*(N+($e(l)+S))+(2*m*N+M)],[m*_+b,0],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=r[0],s=r[1],u=o[0],f=o[1],l=i[0],a=i[1],p=n*n,h=e*e,d=n*e,g=c-u,v=g+(l-u),m=s-f,x=m+(a-f),b=p*v-(2*n*g-c),w=d*v-(g*(e+n)-c),_=h*v-(2*e*g-c),M=p*x-(2*n*m-s),S=d*x-(m*(e+n)-s),N=h*x-(2*e*m-s),I=$e(n),y=$e(e),E=$e(d),C=$e(c),O=$e(u),T=C+O,A=T+$e(l)+O,P=$e(s),k=$e(f),B=P+k,z=B+$e(a)+k;return{ps:[[b,M],[w,S],[_,N]],_ps:[[p*A+(2*I*T+C),p*z+(2*I*B+P)],[E*A+(T*(y+I)+C),E*x+(B*(y+I)+P)],[h*A+(2*y*T+C),h*z+(2*y*B+P)]]}}(t,n,e)}const je=Math.abs,We=[[0,0],[0,0]];const Qe=Number.EPSILON/2,Re=Ye(1);function Ge(t,n){return n[0]!==n[1]?4===t.length?function(t,n){const{ps:e,_ps:r}=Ve(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=e[2][0],s=e[3][0],u=9*Qe*r[0][0],f=9*Qe*r[1][0],l=9*Qe*r[2][0],a=9*Qe*r[3][0],p=e[0][1],h=e[1][1],d=e[2][1],g=e[3][1],v=9*Qe*r[0][1],m=9*Qe*r[1][1],x=9*Qe*r[2][1],b=9*Qe*r[3][1],w=Math.min(o-u,i-f,c-l,s-a),_=Math.max(o+u,i+f,c+l,s+a);return[[w,Math.min(p-v,h-m,d-x,g-b)],[_,Math.max(p+v,h+m,d+x,g+b)]]}(t,n):3===t.length?function(t,n){const{ps:e,_ps:r}=qe(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=e[2][0],s=5*Qe*r[0][0],u=5*Qe*r[1][0],f=5*Qe*r[2][0],l=e[0][1],a=e[1][1],p=e[2][1],h=5*Qe*r[0][1],d=5*Qe*r[1][1],g=5*Qe*r[2][1],v=Math.min(o-s,i-u,c-f),m=Math.max(o+s,i+u,c+f);return[[v,Math.min(l-h,a-d,p-g)],[m,Math.max(l+h,a+d,p+g)]]}(t,n):function(t,n){const{ps:e,_ps:r}=function(t,n,e){return 0===n?1===e?{ps:t,_ps:We}:function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=[[o,i],[n*(c-o)+o,n*(s-i)+i]],f=je(n),l=je(o),a=je(c),p=je(i);return{ps:u,_ps:[[0,0],[f*(a+l)+l,f*(je(s)+p)+p]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=[[n*(c-o)+o,n*(s-i)+i],[c,s]],f=je(n),l=je(o),a=je(c),p=je(i);return{ps:u,_ps:[[f*(a+l)+l,f*(je(s)+p)+p],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=r[0],c=r[1],s=o[0],u=o[1],f=[[n*(s-i)+i,n*(u-c)+c],[e*(s-i)+i,e*(u-c)+c]],l=je(n),a=je(e),p=je(i),h=je(s),d=je(c),g=je(u);return{ps:f,_ps:[[l*(h+p)+p,l*(g+d)+d],[a*(h+p)+p,a*(g+d)+d]]}}(t,n,e)}(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=3*Qe*r[0][0],s=3*Qe*r[1][0],u=e[0][1],f=e[1][1],l=3*Qe*r[0][1],a=3*Qe*r[1][1],p=Math.min(o-c,i-s),h=Math.max(o+c,i+s);return[[p,Math.min(u-l,f-a)],[h,Math.max(u+l,f+a)]]}(t,n):function(t,n){const e=t[0],r=t[t.length-1];if(0===n)return[e,e];if(1===n)return[r,r];const o=Ae(t,n);let i;if(4===t.length)i=ke(t,[0,n]).map(t=>8*Re*t);else if(3===t.length)i=ke(t,[0,n]).map(t=>5*Re*t);else if(2===t.length)i=ke(t,[0,n]).map(t=>2*Re*t);else if(1===t.length)return[o,o];return[[o[0]-i[0],o[1]-i[1]],[o[0]+i[0],o[1]+i[1]]]}(t,n[0])}function Ue(t){const n=t[0],e=t[1];return[(n[0]+e[0])/2,(n[1]+e[1])/2]}const Ze=Z,Je=Number.EPSILON;function Ke(t,n){const e=t-n,r=t-e;return[t-(e+r)+(r-n),e]}function tr(t){return[2*t[0],2*t[1]]}function nr(t){return[4*t[0],4*t[1]]}const er=Ke,rr=Kt,or=$n,ir=Wn,cr=tr,sr=nr,ur=tn;function fr(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],[d,g]=n,v=er(c,d),m=er(u,d),x=er(l,d),b=er(p,d),w=er(s,g),_=er(f,g),M=er(a,g),S=er(h,g),N=ir(v,v),I=or(6,ir(v,m)),y=or(6,ir(v,x)),E=cr(ir(v,b)),C=or(9,ir(m,m)),O=or(18,ir(m,x)),T=or(6,ir(m,b)),A=or(9,ir(x,x)),P=or(6,ir(x,b)),k=ir(b,b),B=ir(w,w),z=or(6,ir(w,_)),F=or(6,ir(w,M)),Y=cr(ir(w,S)),L=or(9,ir(_,_)),X=or(18,ir(_,M)),H=or(6,ir(_,S)),V=or(9,ir(M,M)),$=or(6,ir(M,S)),D=ir(S,S),q=rr(T,A),j=rr(E,O),W=rr(y,C),Q=rr(H,V),R=rr(Y,X),G=rr(F,L);return[or(6,rr(rr(rr(rr(ur(k,P),ur(N,I)),q),ur(W,j)),rr(rr(rr(ur(D,$),ur(B,z)),Q),ur(G,R)))),or(5,rr(ur(rr(rr(P,or(5,I)),or(3,j)),cr(rr(rr(q,cr(W)),or(3,N)))),ur(rr(rr($,or(5,z)),or(3,R)),cr(rr(rr(Q,cr(G)),or(3,B)))))),sr(rr(ur(ur(q,or(3,ur(j,cr(W)))),or(5,ur(cr(I),or(3,N)))),ur(ur(Q,or(3,ur(R,cr(G)))),or(5,ur(cr(z),or(3,B)))))),or(3,rr(ur(j,cr(ur(cr(W),or(5,ur(I,cr(N)))))),ur(R,cr(ur(cr(G),or(5,ur(z,cr(B)))))))),cr(rr(ur(W,or(5,ur(I,or(3,N)))),ur(G,or(5,ur(z,or(3,B)))))),rr(ur(I,or(6,N)),ur(z,or(6,B)))]}const lr=Ke,ar=Kt,pr=$n,hr=Wn,dr=tr,gr=tn,vr=nr;function mr(t,n){const[[e,r],[o,i],[c,s]]=t,[u,f]=n,l=lr(e,u),a=lr(o,u),p=lr(c,u),h=lr(r,f),d=lr(i,f),g=lr(s,f),v=hr(l,l),m=hr(l,a),x=hr(l,p),b=hr(a,a),w=hr(a,p),_=hr(p,p),M=hr(h,h),S=hr(h,d),N=hr(h,g),I=hr(d,d),y=hr(d,g),E=hr(g,g),C=ar(N,dr(I)),O=ar(x,dr(b));return[ar(gr(ar(ar(E,M),dr(C)),vr(ar(y,S))),gr(ar(ar(_,v),dr(O)),vr(ar(w,m)))),pr(3,ar(ar(gr(y,C),gr(pr(3,S),M)),ar(gr(w,O),gr(pr(3,m),v)))),ar(gr(C,pr(3,gr(dr(S),M))),gr(O,pr(3,gr(dr(m),v)))),ar(gr(S,M),gr(m,v))]}function xr(t){return[-2*t[0],-2*t[1]]}const br=Jt,wr=Kt,_r=xr;function Mr(t,n){const[[e,r],[o,i]]=t,[c,s]=n,u=e-c,f=o-c,l=r-s,a=i-s,p=br(u,u),h=br(u,f),d=br(f,f),g=br(l,l),v=br(l,a),m=br(a,a),x=wr(h,v),b=wr(g,p);return[wr(wr(d,m),wr(b,_r(x))),tn(x,b)]}function Sr(t){const n=[];for(let e=0;e<t.length;e++)n.push(2*t[e]);return n}function Nr(t){const n=[];for(let e=0;e<t.length;e++)n.push(-2*t[e]);return n}const Ir=Z,yr=nt,Er=Sr,Cr=Nr,Or=Z,Tr=nt,Ar=Sr;function Pr(t){const n=[];for(let e=0;e<t.length;e++)n.push(4*t[e]);return n}const kr=Z,Br=Nr,zr=Math.abs;function Fr(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=zr(e[0]),s=zr(e[1]),u=zr(r[0]),f=zr(r[1]),l=zr(o[0]),a=zr(o[1]),p=zr(i[0]),h=zr(i[1]),d=zr(n[0]),g=zr(n[1]),v=c+d,m=u+d,x=l+d,b=p+d,w=s+g,_=f+g,M=a+g,S=h+g,N=v*v,I=6*v*m,y=6*x*b,E=w*w,C=6*w*_,O=6*M*S,T=6*m*b+9*x*x,A=2*v*b+18*m*x,P=6*v*x+9*m*m,k=6*_*S+9*M*M,B=2*w*S+18*_*M,z=6*w*M+9*_*_;return[6*(b*b+y+(N+I)+T+(P+A)+(S*S+O+(E+C)+k+(z+B))),5*(y+5*I+3*A+2*(T+2*P+3*N)+(O+5*C+3*B+2*(k+2*z+3*E))),4*(T+3*(A+2*P)+5*(2*I+3*N)+(k+3*(B+2*z)+5*(2*C+3*E))),3*(A+2*(2*P+5*(I+2*N))+(B+2*(2*z+5*(C+2*E)))),2*(P+5*(I+3*N)+(z+5*(C+3*E))),I+6*N+(C+6*E)]}function Yr(t,n){const e=t[0],r=t[1],o=t[2],i=zr(e[0]),c=zr(e[1]),s=zr(r[0]),u=zr(r[1]),f=zr(o[0]),l=zr(o[1]),a=zr(n[0]),p=zr(n[1]),h=i+a,d=s+a,g=f+a,v=c+p,m=u+p,x=l+p,b=h*h,w=h*d,_=d*g,M=v*v,S=v*m,N=m*x,I=v*x+m*m*2,y=h*g+d*d*2;return[x*x+M+2*I+4*(N+S)+(g*g+b+2*y+4*(_+w)),3*(N+I+(3*S+M)+(_+y+(3*w+b))),I+3*(2*S+M)+(y+3*(2*w+b)),S+M+(w+b)]}function Lr(t,n){const e=t[0],r=t[1],o=zr(e[0]),i=zr(e[1]),c=zr(r[0]),s=zr(r[1]),u=zr(n[0]),f=zr(n[1]),l=o+u,a=c+u,p=i+f,h=s+f,d=l*a+p*h,g=p*p+l*l;return[a*a+h*h+2*d+g,d+g]}Le(6);const{sqrt:Xr}=Math;function Hr(t,n,e=0,r=1){const{polyDd:o,polyE:i,getPolyExact:c}=function(t,n){const e=t.length-1;if(3===e)return{polyDd:fr(t,n),polyE:Fr(t,n).map(t=>20*t),getPolyExact:()=>function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],[d,g]=n,v=Ir(c,d),m=Ir(u,d),x=Ir(l,d),b=Ir(p,d),w=Ir(s,g),_=Ir(f,g),M=Ir(a,g),S=Ir(h,g),N=ot(v,v),I=yr(6,ot(v,m)),y=yr(6,ot(v,x)),E=Er(ot(v,b)),C=yr(9,ot(m,m)),O=yr(18,ot(m,x)),T=yr(6,ot(m,b)),A=yr(9,ot(x,x)),P=yr(6,ot(x,b)),k=ot(b,b),B=ot(w,w),z=yr(6,ot(w,_)),F=yr(6,ot(w,M)),Y=Er(ot(w,S)),L=yr(9,ot(_,_)),X=yr(18,ot(_,M)),H=yr(6,ot(_,S)),V=yr(9,ot(M,M)),$=yr(6,ot(M,S)),D=ot(S,S),q=J(T,A),j=J(E,O),W=J(y,C),Q=J(H,V),R=J(Y,X),G=J(F,L),U=ft(J(J(k,N),J(q,W)),J(J(j,P),I)),Z=ft(J(J(D,B),J(Q,G)),J(J(R,$),z)),K=yr(6,J(U,Z)),tt=J(Cr(J(J(q,Er(W)),yr(3,N))),J(J(P,yr(3,j)),yr(5,I))),nt=J(Cr(J(J(Q,Er(G)),yr(3,B))),J(J($,yr(3,R)),yr(5,z))),et=yr(5,J(tt,nt)),rt=J(J(q,yr(3,ft(Er(W),j))),yr(5,ft(yr(3,N),Er(I)))),it=J(J(Q,yr(3,ft(Er(G),R))),yr(5,ft(yr(3,B),Er(z)))),ct=yr(4,J(rt,it)),st=ft(j,Er(ft(Er(W),yr(5,ft(I,Er(N)))))),ut=ft(R,Er(ft(Er(G),yr(5,ft(z,Er(B)))))),lt=yr(3,J(st,ut)),at=ft(W,yr(5,ft(I,yr(3,N)))),pt=ft(G,yr(5,ft(z,yr(3,B))));return[K,et,ct,lt,Er(J(at,pt)),J(ft(I,yr(6,N)),ft(z,yr(6,B)))].map(Pn)}(t,n)};if(2===e)return{polyDd:mr(t,n),polyE:Yr(t,n).map(t=>16*t),getPolyExact:()=>function(t,n){const[[e,r],[o,i],[c,s]]=t,[u,f]=n,l=Or(e,u),a=Or(o,u),p=Or(c,u),h=Or(r,f),d=Or(i,f),g=Or(s,f),v=ot(l,l),m=ot(l,a),x=ot(l,p),b=ot(a,a),w=ot(a,p),_=ot(p,p),M=ot(h,h),S=ot(h,d),N=ot(h,g),I=ot(d,d),y=ot(d,g),E=ot(g,g),C=J(N,Ar(I)),O=J(x,Ar(b)),T=J(ft(J(_,Ar(O)),Pr(J(w,m))),v),A=J(ft(J(E,Ar(C)),Pr(J(y,S))),M),P=J(T,A),k=J(ft(w,O),ft(Tr(3,m),v)),B=J(ft(y,C),ft(Tr(3,S),M));return[P,Tr(3,J(k,B)),J(ft(C,Tr(3,ft(Ar(S),M))),ft(O,Tr(3,ft(Ar(m),v)))),J(ft(S,M),ft(m,v))].map(Pn)}(t,n)};if(1===e)return{polyDd:Mr(t,n),polyE:Lr(t,n).map(t=>12*t),getPolyExact:()=>function(t,n){const[[e,r],[o,i]]=t,[c,s]=n,u=kr(e,c),f=kr(o,c),l=kr(r,s),a=kr(i,s),p=ot(u,u),h=ot(u,f),d=ot(f,f),g=ot(l,l),v=ot(l,a),m=ot(a,a),x=J(h,v),b=J(g,p);return[J(J(d,m),J(Br(x),b)),ft(x,b)].map(Pn)}(t,n)};if(0===e)return{polyDd:[[0,1]],polyE:[0],getPolyExact:()=>[[1]]};throw new Error("The given bezier curve must be of order 1, 2 or 3")}(t,n),s=Te(o,e,r,i,c)||[];s.push({t:e,tS:e,tE:e,multiplicity:1}),s.push({t:r,tS:r,tE:r,multiplicity:1});const u=s.map(e=>{const r=Ge(t,[e.tS,e.tE]),o=function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=n[0],f=n[1];let l=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(const[t,n]of[[o,i],[o,s],[c,i],[c,s]]){const e=Ze(t,u),r=Ze(n,f),o=it(J(ot(e,e),ot(r,r))),i=o*(1-Je),c=o*(1+Je);i<=l&&(l=i),c>=a&&(a=c)}return[l,a]}(r,n);return{p:Ue(r),t:e.t,d:(Xr(o[0])+Xr(o[1]))/2,dSquaredI:o,box:r,ri:e}});let f=Number.POSITIVE_INFINITY;for(let t=0;t<u.length;t++){const n=u[t].dSquaredI[1];n<f&&(f=n)}const l=[];for(let t=0;t<u.length;t++){const n=u[t];n.dSquaredI[0]<=f&&l.push(n)}return l}function Vr(t){return{t,tS:t,tE:t,multiplicity:1}}function $r(t){return(t.tS+t.tE)/2}function Dr(t){const n=t.xs;if(4===n.length){let t=0,e=0;for(let r=0;r<n.length;r++)0===n[r].x.kind&&t++,4===n[r].x.kind&&e++;if(2===t&&2===e)return!0}return n.length<=2&&7!==n[0].x.kind}const qr=Pn;function jr(t){const n=(t=qr(t)).length;return 2===n?t:1===n?[0,t[0]]:[t[n-2],t[n-1]]}const{abs:Wr,min:Qr,max:Rr,log2:Gr,ceil:Ur}=Math;function Zr(t,n){const{tS:e,tE:r}=t,o=r-e;if(0===o)return[{tS:[0,e],tE:[0,e],multiplicity:t.multiplicity}];const i=2**Ur(Gr(o)),c=function(t,n,e){return Gn(Rn(t,e),n)}(n,i,e),s=c.map(jr),u=s.map(t=>t[1]*kn**2),f=Te(s,0,1,u,()=>c),l=[];for(const t of f)l.push({tS:dt(e,t.tS*i),tE:dt(e,t.tE*i),multiplicity:t.multiplicity});return l}function Jr(t,n){return lt(ft(t,n))}const{abs:Kr}=Math;function to(t,n){const e=t.inOuts;e.sort(function(t){return(n,e)=>{let r=n.side-e.side;if(0!==r)return r;const o=n.sideX,i=e.sideX;r=o.ri.tS-i.ri.tS;const c=8*Number.EPSILON;return Kr(r)>=c?r:(o.compensated||(o.compensated=1,o.riExp=Zr(o.ri,o.getPExact())[0]),i.compensated||(i.compensated=1,i.riExp=Zr(i.ri,i.getPExact())[0]),r=Jr(o.riExp.tS,i.riExp.tS),0!==r?r:(r=n.dir-e.dir,0!==r?t*r:1===n.dir?n.idx-e.idx:e.idx-n.idx))}}(n));let r=e[e.length-1];for(let t=0;t<e.length;t++){const n=e[t];n.prevAround=r,r.nextAround=n,r=n}}function no(t,n,e,r){const o=function(t,n){return(e,r,o)=>{t.has(e)||(e.orientation=r,e.parent=o,e.windingNum=o.windingNum+e.orientation,n.push(e))}}(r,e);to(t.container,n.orientation);let i,c,s=1,u=t,f=n.orientation;for(;u=1===n.orientation?u.nextAround:u.prevAround,u!==t;){const t=s;s-=u.dir,1===s&&(f*=-1),-1!==u.dir&&(i?1===t&&0===s?o(u,n.orientation,n.parent):0===t&&-1===s&&o(u,-n.orientation,n.parent):0===s?i=u:1===s&&o(u,n.orientation,n))}return Dr(t.container)||(c=[t.p,i.p]),{inOutToUse:i,additionalBezier:c}}function eo(t,n){const e=t._x_,r=n._x_,o=e.curve,i=e.x.ri.tS,c=r.curve,s=r.x.ri.tS;let u=o,f=i;Dr(t.container)||(f=$r(Hr(o.ps,t.p)[0].ri));const l=[];for(;;){if(u===c&&(f<s||f===s&&0!==l.length)){const t=u.ps,n=[f,s];return l.push({ps:t,ts:n}),l}{const t=u.ps,n=[f,1];l.push({ps:t,ts:n})}f=0,u=u.next}}function ro(t,n){const e=n._x_,r=t._x_,o=r.curve,i=r.x.ri.tS,c=e.curve,s=e.x.ri.tS;let u=o,f=i;Dr(t.container)||(f=$r(Hr(u.ps,t.p)[0].ri));const l=[];for(;;){const t=u.ps;if(u===c&&(f>s||f===s&&0!==l.length)){const n=[f,s];return l.push({ps:t,ts:n}),l}{const n=[f,0];l.push({ps:t,ts:n})}f=1,u=u.prev}}function oo(t,n,e,r){const o=function(t,n,e){return(r,o,i,c)=>{n.has(r)||1!==r.dir||(r.loopsIdxs=new Set(c),r.orientation=o*t.orientation,r.parent=i.parent,r.windingNum=i.windingNum+r.orientation,e.unshift(r))}}(n,r,e);to(t.container,1);let i=t.nextAround,c=t;const s=[],u=new Set(n.loopsIdxs);for(;c=c.nextAround,c!==t;)o(c,n.dir,n,u),s.push(c.idx),-1===c.dir?u?.add(c._x_?.curve.loop.idx):u.delete(c._x_?.curve.loop.idx);let f;return Dr(t.container)||(f=[t.p,i.p]),{inOutToUse:i,additionalBezier:f}}function io(t){const{ps:n,ts:e}=t;return function(t,n,e){if(4===t.length)return function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=c-n*(c-u),h=u-n*(u-l),d=p-n*(p-h),g=s-n*(s-f),v=f-n*(f-a),m=g-n*(g-v);return[e,[p,g],[d,m],[d-n*(d-(h-n*(h-(l-n*(l-i[0]))))),m-n*(m-(v-n*(v-(a-n*(a-i[1])))))]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=c-n*(c-u),h=u-n*(u-l),d=l-n*(l-i[0]),g=p-n*(p-h),v=h-n*(h-d),m=s-n*(s-f),x=f-n*(f-a),b=a-n*(a-i[1]),w=m-n*(m-x),_=x-n*(x-b);return[[g-n*(g-v),w-n*(w-_)],[v,_],[d,b],i]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=t[3],s=r[0],u=r[1],f=o[0],l=o[1],a=i[0],p=i[1],h=n*n,d=n*h,g=e*e,v=e*g,m=n*e,x=s-f,b=a-f,w=x+b,_=n*x,M=e*x,S=c[0]-s-3*b,N=u-l,I=p-l,y=N+I,E=n*N,C=e*N,O=c[1]-u-3*I;return[[d*S+(3*n*(n*w-x)+s),d*O+(3*n*(n*y-N)+u)],[m*(n*S+2*w)+(h*w+s-(M+2*_)),m*(n*O+2*y)+(h*y+u-(C+2*E))],[m*(e*S+2*w)+(g*w+s-(2*M+_)),m*(e*O+2*y)+(g*y+u-(2*C+E))],[v*S+(3*e*(e*w-x)+s),v*O+(3*e*(e*y-N)+u)]]}(t,n,e)}(t,n,e);if(3===t.length)return function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=n*n,l=i-s,a=c-u;return[e,[-n*l+i,-n*a+c],[f*(l+(o[0]-s))-(2*n*l-i),f*(a+(o[1]-u))-(2*n*a-c)]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=n*n,l=i-s,a=o[0]-s,p=c-u,h=o[1]-u;return[[f*(l+a)-(2*n*l-i),f*(p+h)-(2*n*p-c)],[n*a+s,n*h+u],o]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=r[0],s=r[1],u=o[0],f=o[1],l=n*n,a=e*e,p=n*e,h=c-u,d=h+(i[0]-u),g=s-f,v=g+(i[1]-f);return[[l*d-(2*n*h-c),l*v-(2*n*g-s)],[p*d-(h*(e+n)-c),p*v-(g*(e+n)-s)],[a*d-(2*e*h-c),a*v-(2*e*g-s)]]}(t,n,e)}(t,n,e);if(2===t.length)return function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1];return[e,[n*(r[0]-o)+o,n*(r[1]-i)+i]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1];return[[n*(r[0]-o)+o,n*(r[1]-i)+i],r]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=r[0],c=r[1],s=o[0],u=o[1];return[[n*(s-i)+i,n*(u-c)+c],[e*(s-i)+i,e*(u-c)+c]]}(t,n,e)}(t,n,e);if(1===t.length)return t;throw new Error("The given bezier curve must be of order <= 3.")}(n,e[0],e[1])}function co(t,n,e){const r=[],o=[];let i,c=n;const s=e?oo:no,u=[];do{t.add(c),u.push(c);const e=c.nextOrPrev;t.add(e);const f=1===c.dir?eo(c,e):ro(c,e);o.push(...f);const l=s(e,n,r,t);if(({inOutToUse:c,additionalBezier:i}=l),void 0!==i){const t=io(o[o.length-1]),n={ps:t,ts:[0,$r(Hr(t,i[0])[0].ri)]};o.pop(),o.push(n),o.push({ps:i,ts:[0,1]})}}while(c!==n);return"undefined"!=typeof _debug_&&_debug_.verbose&&function(t){const n=[],e=[];for(let r of t)e.push(1===r.dir?"color: blue;":"color: red"),n.push(`%c${r.idx}`)}(u),{bezierPieces:o,additionalOutsToCheck:r}}function so(t,n,e,r){const o=[t];for(;o.length;){const t=o.pop();if(n.add(t._x_.curve.loop),e.has(t))continue;t.children=new Set;const{bezierPieces:i,additionalOutsToCheck:c}=co(e,t,r);t.bezierPieces=i,t.parent.children=t.parent.children||new Set,t.parent.children.add(t);for(let t=0;t<c.length;t++)o.push(c[t])}}function uo(t){if(4===t.length)return fo(t);if(3===t.length)return lo(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t;return[[r-n,n],[o-e,e]]}(t);if(1===t.length)return function(t){const[[n,e]]=t;return[[n],[e]]}(t);throw new Error("The given bezier curve must be of order <= 3.")}function fo(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[s-n+3*(r-i),3*(i+n-2*r),3*(r-n),n],[u-e+3*(o-c),3*(c+e-2*o),3*(o-e),e]]}function lo(t){const[[n,e],[r,o],[i,c]]=t;return[[i+n-2*r,2*(r-n),n],[c+e-2*o,2*(o-e),e]]}function ao(t){if(4===t.length)return function(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[3*(s-n+3*(r-i)),6*(i+n-2*r),3*(r-n)],[3*(u-e+3*(o-c)),6*(c+e-2*o),3*(o-e)]]}(t);if(3===t.length)return function(t){const[[n,e],[r,o],[i,c]]=t;return[[2*(i+n-2*r),2*(r-n)],[2*(c+e-2*o),2*(o-e)]]}(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t;return[[r-n],[o-e]]}(t);if(1===t.length)return[[0],[0]];throw new Error("The bezier curve must be of order <= 3.")}function po(t,n){const[e,r]=ao(t);return[R(e,n),R(r,n)]}function ho(t){const n=t[0],e=t[t.length-1];let r,o;if(n[1]<e[1]?(r={ts:[0,0],box:[n,n]},o={ts:[1,1],box:[e,e]}):(r={ts:[1,1],box:[e,e]},o={ts:[0,0],box:[n,n]}),2===t.length)return{minY:r,maxY:o};const[,i]=ao(t),c=Te(i,0,1)||[];for(let n=0;n<c.length;n++){const e=c[n],i=[e.tS,e.tE],s=Ge(t,i);s[0][1]<r.box[0][1]&&(r={ts:i,box:s}),s[1][1]>o.box[0][1]&&(o={ts:i,box:s})}return{minY:r,maxY:o}}function go(t){const n=function(t){const n=t[0],e=t[t.length-1];let r,o;if(n[0]<e[0]?(r={ts:[0,0],box:[n,n]},o={ts:[1,1],box:[e,e]}):(r={ts:[1,1],box:[e,e]},o={ts:[0,0],box:[n,n]}),2===t.length)return{minX:r,maxX:o};const[i]=ao(t),c=Te(i,0,1)||[];for(let n=0;n<c.length;n++){const e=c[n],i=[e.tS,e.tE],s=Ge(t,i);s[0][0]<r.box[0][0]&&(r={ts:i,box:s}),s[1][0]>o.box[0][0]&&(o={ts:i,box:s})}return{minX:r,maxX:o}}(t),e=ho(t);return[[n.minX.box[0][0],e.minY.box[0][1]],[n.maxX.box[1][0],e.maxY.box[1][1]]]}const vo=L(go),mo=L(function(t){const n=ao(t),e=Te(n[0],0,1)?.map(t=>t.t)||[],r=Te(n[1],0,1)?.map(t=>t.t)||[];e.push(0,1),r.push(0,1);let o,i,c,s,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(let n=0;n<e.length;n++){const r=e[n],[c]=Ae(t,r);c<u&&(u=c,o=r),c>f&&(f=c,i=r)}for(let n=0;n<r.length;n++){const e=r[n],[,o]=Ae(t,e);o<l&&(l=o,c=e),o>a&&(a=o,s=e)}return{ts:[[o,c],[i,s]],box:[[u,l],[f,a]]}}),{min:xo,max:bo}=Math;function wo(t){const n=t.map(mo);return{minX:xo(...n.map(t=>t.box[0][0])),maxX:bo(...n.map(t=>t.box[1][0])),minY:xo(...n.map(t=>t.box[0][1])),maxY:bo(...n.map(t=>t.box[1][1]))}}const _o=new Function("try {return this===window;}catch(e){ return false;}")()?function(t){const n=window.atob(t),e=n.length,r=new Uint8Array(e);for(let t=0;t<e;t++)r[t]=n.charCodeAt(t);return r.buffer}:function(t){return function(t){const n=new ArrayBuffer(t.length),e=new Uint8Array(n);for(let n=0;n<t.length;++n)e[n]=t[n];return n}(Buffer.from(t,"base64"))},Mo=_o("AGFzbQEAAAABBgFgAX8BfAMDAgAABQMBAAAHHwMGbWVtb3J5AgAHc3F1YXJlcwAACHNxdWFyZXM0AAEKjgECPwECfiAArULHuuXf9tjQm2p+IgEgASABfnxCIIoiAiACfiABQse65d/22NCbanx8QiCKIgIgAn4gAXxCIIi6C0wBAn4gAK1Cx7rl3/bY0JtqfiIBQse65d/22NCbanwiAiABIAIgASABIAF+fEIgiiIBIAF+fEIgiiIBIAF+fEIgiiIBIAF+fEIgiLoL"),So=new WebAssembly.Module(Mo),No=new WebAssembly.Instance(So),Io=No.exports.squares;No.exports.squares4;const yo=1e-6;function Eo(t,n){let e;const r=[t];for(;r.length;)o(r.pop());return e;function o(o){if(o===t||function(t,n){let e=0;do{e++;const o=Io(e)/4294967296,i=r(t,n,Ae(t[Io(e+1e3)%t.length],o));if(void 0!==i)return i}while(e<100);return;function r(t,n,e){if(function(t,n){const e=wo(t),r=wo(n);return e.minX<r.minX||e.maxX>r.maxX||e.minY<r.minY||e.maxY>r.maxY}(t,n))return!1;const r=function(t,n){const[e,r]=n;let o=0;for(let i=0;i<t.length;i++){const c=t[i],[[s,u],[f,l]]=vo(c);let a=u>r||l<r||!1;if(a=a||s>e||!1,a)continue;const p=[];let h,d,g;const v=!0;h=t=>uo(t)[1],d=[0,-r],g=0;const m=c.map(j(d)),x=h(m),b=Te(x,0-yo,1+yo)?.map(t=>t.t)||[];for(let t=0;t<b.length;t++){const e=b[t];if(Math.abs(e)<yo||Math.abs(e-1)<yo)return;const r=Ae(m,e);(v&&n[g]>=r[g]||!v&&n[g]<=r[g])&&p.push(e)}if(1===p.length||3===p.length)for(const t of p){const n=W(po(c,t));if(Math.abs(n[1])<yo)return}o+=p.length}return o}(n,e);return void 0!==r?r%2!=0:void 0}}(n.beziers,o.bezierPieces.map(io))){e=o;for(const t of o.children)r.push(t)}}}function Co(t,n){return Oo(t)-Oo(n)}function Oo(t){let n=Number.POSITIVE_INFINITY;for(const e of t){const t=mo(e).box[0][1];t<n&&(n=t)}return n}const{abs:To,sign:Ao}=Math;function Po(t){let n=t.parent;for(;;){if(void 0===n)return!1;if(n.used)return!0;n=n.parent}}function ko(t,n,e){let[[r,o],[i,c]]=n,[[s,u],[f,l]]=e;o>c&&([o,c]=[c,o]),u>l&&([u,l]=[l,u]),r>i&&([r,i]=[i,r]),s>f&&([s,f]=[f,s]);const a=t||r===i&&s===f,p=t||o===c&&u===l;return(a?r<=f:r<f)&&(a?i>=s:i>s)&&(p?u<=c:u<c)&&(p?l>=o:l>o)}function Bo(t,n){return ko(!0,t.box,n.box)}function zo(t,n){for(let e=0;e<n.length;e++){const r=n[e];Fo(t,[r.a,r.b])}}function Fo(t,n){const[e,r]=n;let o=t.get(e);o||(o=[],t.set(e,o));let i=t.get(r);i||(i=[],t.set(r,i)),o.push(r),i.push(e)}function Yo(t,n,e,r){e.add(n),r.push(n);const o=t.get(n);for(let n=0;n<o.length;n++){const i=o[n];e.has(i)||Yo(t,i,e,r)}}function Lo(t){const n=[],e=new Set;for(const r of t){const o=r[0];e.has(o)||(n.push([]),Yo(t,o,e,n[n.length-1]))}return n}function Xo(t,n){const e=new Set;for(const t of n)for(const n of t)e.add(n);const r=[];for(let n=0;n<t.length;n++){const o=t[n];e.has(o)||r.push(o)}return r}function Ho(t){const n=[];for(const e of t){let t=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;const c=[];for(const n of e){const[[e,s],[u,f]]=n.box;e<t&&(t=e),s<r&&(r=s),u>o&&(o=u),f>i&&(i=f),c.push(...n.xs)}const s={box:[[t,r],[o,i]],xs:c,inOuts:void 0};n.push(s)}return n}function Vo(t){return{tS:[0,t.tS],tE:[0,t.tE],multiplicity:t.multiplicity}}function $o(t,n){const e=t[0],r=t[1],o=r+n,i=o-r,c=e+(r-(o-i)+(n-i)),s=o+c;return[c-(s-o),s]}const Do=Ke,qo=$n,jo=Kt,Wo=$o,Qo=Math.abs;function Ro(t){const[[n,e],[r,o],[i,c],[s,u]]=t,f=Do(s,n),l=Do(r,i),a=3*(r-i),p=qo(3,l),h=Qo(a),d=jo(f,p),g=h+Qo(s-n+a),v=Do(i,2*r),m=Wo(v,n),x=Qo(i-2*r+n),b=qo(3,m),w=6*x,_=Do(r,n),M=qo(3,_),S=Qo(3*(r-n)),N=Do(u,e),I=Do(o,c),y=3*(o-c),E=qo(3,I),C=Qo(y),O=jo(N,E),T=C+Qo(u-e+y),A=Do(c,2*o),P=Wo(A,e),k=Qo(c-2*o+e),B=qo(3,P),z=6*k,F=Do(o,e);return{coeffs:[[d,b,M,[0,n]],[O,B,qo(3,F),[0,e]]],errorBound:[[g,w,S,0],[T,z,Qo(3*(o-e)),0]]}}function Go(t){const[[n,e],[r,o],[i,c]]=t,s=i-2*r,u=Do(i,2*r),f=Wo(u,n),l=Qo(s+n),a=Do(2*r,2*n),p=c-2*o,h=Do(c,2*o),d=Wo(h,e),g=Qo(p+e);return{coeffs:[[f,a,[0,n]],[d,Do(2*o,2*e),[0,e]]],errorBound:[[l,0,0],[g,0,0]]}}function Uo(t){const[[n,e],[r,o]]=t;return[[Do(r,n),[0,n]],[Do(o,e),[0,e]]]}const Zo=tn,Jo=$n,Ko=ct,ti=Math.abs;function ni(t){const[[n,[,e]],[r,[,o]]]=Uo(t),i=Ko(r),c=n,s=Jo(o,n),u=ti(s[1]),f=Jo(e,r),l=ti(f[1]),a=Zo(f,s);return{coeffs:{vₓ:i,vᵧ:c,v:a},errorBound:{v_:u+l+ti(a[1])}}}const{abs:ei}=Math,ri=Kt,oi=$n,ii=Wn;function ci(t){return[-t[0],-t[1]]}const si=ci,ui=tr,fi=$n,li=Wn,ai=tn,pi=Math.abs;function hi(t){const{coeffs:[[n,e,[,r]],[o,i,[,c]]],errorBound:[[s],[u]]}=Go(t),f=n[1],l=e[1],a=o[1],p=i[1],h=pi(r),d=pi(l),g=pi(f),v=pi(c),m=pi(p),x=pi(a),b=li(n,i),w=s*m+2*pi(f*p),_=li(e,o),M=d*u+2*pi(l*a),S=fi(c,n),N=v*s+pi(c*f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r=Nr+Tr+wi(Ar[1]),kr=Ii(zn,Tn),Br=jn+Hn+wi(kr[1]),zr=Ii(kr,kn),Fr=wi(zr[1]),Yr=Br+Dn+Fr,Lr=Ni(fr,Kt),Xr=ar*Cn+pr*Cn+wi(Lr[1]),Hr=Ni(Fn,Gt),Vr=Yn*Ut+Wn*yn+wi(Hr[1]),$r=Ii(Lr,Hr),Dr=Xr+Vr+wi($r[1]),qr=Ni(Dt,zr),jr=qt*Fr+Sn*Yr+wi(qr[1]),Wr=yi(qr,$r);return{coeffs:{vₓₓₓ:Gn,vₓₓᵧ:te,vₓᵧᵧ:ie,vᵧᵧᵧ:se,vₓₓ:Ne,vₓᵧ:Qe,vᵧᵧ:Be,vₓ:_r,vᵧ:Ar,v:Wr},errorBound:{vₓₓₓ_:Un,vₓₓᵧ_:ne,vₓᵧᵧ_:ce,vᵧᵧᵧ_:ue,vₓₓ_:Ie,vₓᵧ_:Re,vᵧᵧ_:ze,vₓ_:Mr,vᵧ_:Pr,v_:jr+Dr+wi(Wr[1])}}}const Ci=Jt,Oi=tr,Ti=$n,Ai=Wn,Pi=Kt,{abs:ki}=Math,Bi=Kt,zi=$n,Fi=Wn,{abs:Yi}=Math,Li=Jt,Xi=tr,Hi=$n,Vi=Wn,$i=Kt,{abs:Di}=Math,qi=Jt,ji=tr,Wi=$n,Qi=Wn,Ri=Kt,{abs:Gi}=Math,Ui=Kt,Zi=$n,Ji=Wn,{abs:Ki}=Math,tc=Jt,nc=tr,ec=$n,rc=Wn,oc=Kt,{abs:ic}=Math,cc=Jt,sc=tr,uc=$n,fc=Wn,lc=Kt,{abs:ac}=Math,pc=Z,hc=dt,dc=nt,gc=gt;function vc(t){if(4===t.length)return mc(t);if(3===t.length)return xc(t);if(2===t.length)return bc(t);if(1===t.length)return function(t){const[[n,e]]=t;return[[[n]],[[e]]]}(t);throw new Error("The given bezier curve must be of order <= cubic.")}function mc(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[J(pc(s,n),dc(3,pc(r,i))),dc(3,gc(hc(i,n),-2*r)),dc(3,pc(r,n)),[n]].map(Pn),[J(pc(u,e),dc(3,pc(o,c))),dc(3,gc(hc(c,e),-2*o)),dc(3,pc(o,e)),[e]].map(Pn)]}function xc(t){const[[n,e],[r,o],[i,c]]=t;return[[gc(hc(i,n),-2*r),pc(2*r,2*n),[n]],[gc(hc(c,e),-2*o),pc(2*o,2*e),[e]]]}function bc(t){const[[n,e],[r,o]]=t;return[[pc(r,n),[n]],[pc(o,e),[e]]]}const wc=nt,_c=ct;function Mc(t){const[[n,[e]],[r,[o]]]=t;if(0!==lt(n)||0!==lt(r))return{vₓ:_c(r),vᵧ:n,v:Pn(ft(wc(e,r),wc(o,n)))}}const Sc=nt,Nc=ot,Ic=J;function yc(t,n){const e=bc(t),[[r,[o]],[i,[c]]]=bc(n),{vₓ:s,vᵧ:u,v:f}=Mc(e),l=Nc(r,s),a=Nc(i,u),p=Ic(l,a),h=Sc(o,s),d=Sc(c,u),g=Ic(h,d);return[p,Ic(g,f)].map(Pn)}const Ec=nt,Cc=Sr,Oc=ft,Tc=ot,Ac=ct;function Pc(t){const[[n,e,[r]],[o,i,[c]]]=t;if(0===lt(n)&&0===lt(o))return Mc([[e,[r]],[i,[c]]]);const s=Tc(n,i),u=Tc(e,o),f=Ec(c,n),l=Ec(r,o),a=Ec(c,e),p=Ec(r,i),h=Tc(n,n),d=Tc(n,o),g=Tc(o,o),v=Oc(s,u),m=Oc(f,l),x=Oc(a,p),b=Pn(Ac(g)),w=Pn(Cc(d)),_=Pn(Ac(h)),M=Tc(i,v),S=Cc(Tc(o,m)),N=Pn(Oc(M,S)),I=Cc(Tc(n,m)),y=Tc(e,v),E=Pn(Oc(I,y)),C=Tc(v,x),O=Tc(m,m);return{vₓₓ:b,vₓᵧ:w,vᵧᵧ:_,vₓ:N,vᵧ:E,v:Pn(Oc(C,O))}}const kc=Kn,Bc=nt,zc=ot,Fc=J,Yc=Sr;function Lc(t,n){const e=xc(t);if(0===lt(e[0][0])&&0===lt(e[1][0]))return yc([t[0],t[2]],n);const[[r,[o]],[i,[c]]]=bc(n),{vₓₓ:s,vₓᵧ:u,vᵧᵧ:f,vₓ:l,vᵧ:a,v:p}=Pc(e),h=kc(o,o),d=Bc(o,r),g=kc(o,c),v=Bc(o,i),m=zc(r,r),x=Bc(c,r),b=zc(r,i),w=kc(c,c),_=Bc(c,i),M=zc(i,i),S=zc(m,s),N=zc(M,f),I=zc(b,u),y=Fc(S,N),E=Fc(y,I),C=zc(d,s),O=zc(_,f),T=Fc(v,x),A=zc(T,u),P=Yc(Fc(C,O)),k=Fc(P,A),B=zc(r,l),z=zc(i,a),F=Fc(B,z),Y=Fc(k,F),L=zc(h,s),X=zc(g,u),H=zc(w,f),V=Fc(L,X),$=Fc(V,H),D=Bc(o,l),q=Bc(c,a),j=Fc(D,q),W=Fc($,j);return[E,Y,Fc(W,p)].map(Pn)}const Xc=ot,Hc=Z,Vc=tt,$c=dt;function Dc(t,n=!1){const[e,r,o,i]=t;if(!n){const[t,n]=e,[c,s]=r,[u,f]=o,[l,a]=i;return[e,[it(ft(Vc($c(c/4,u/4),3),$c(t/4,l/4))),it(ft(Vc($c(s/4,f/4),3),$c(n/4,a/4)))],i]}const c=function(t,n){const[[e,r],[o,i]]=t,[[c,s],[u,f]]=n,l=Hc(o,e),a=Hc(i,r),p=Hc(u,c),h=Hc(f,s),d=ft(Xc(p,a),Xc(h,l));if(0===lt(d))return;const g=Hc(c,e),v=Hc(s,r),m=it(ft(Xc(v,l),Xc(g,a)))/it(d);return[c+m*it(p),s+m*it(h)]}([e,r],[i,o]);if(void 0!==c)return[e,c,i]}const qc=nt,jc=ot,Wc=J,Qc=ft,Rc=ct,Gc=Sr;function Uc(t){const[[n,e,r,[o]],[i,c,s,[u]]]=t;if(0===lt(n)&&0===lt(i))return Pc([[e,r,[o]],[c,s,[u]]]);const f=jc(n,s),l=jc(r,i),a=jc(n,c),p=jc(e,c),h=jc(e,i),d=jc(n,n),g=jc(c,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,xt,ts(At,v)].map(Pn)}const rs=nt,os=ot,is=J;function cs(t,n){const e=bc(t),[[r,o,[i]],[c,s,[u]]]=xc(n);if(0===lt(r)&&0===lt(c))return yc(t,[n[0],n[2]]);const{vₓ:f,vᵧ:l,v:a}=Mc(e),p=os(r,f),h=os(c,l),d=is(p,h),g=os(o,f),v=os(s,l),m=is(g,v),x=rs(i,f),b=rs(u,l),w=is(x,b);return[d,m,is(w,a)].map(Pn)}const ss=Kn,us=nt,fs=ot,ls=J,as=Sr;function ps(t,n){const e=xc(t);if(0===lt(e[0][0])&&0===lt(e[1][0]))return cs([t[0],t[2]],n);const[[r,o,[i]],[c,s,[u]]]=xc(n);if(0===lt(r)&&0===lt(c))return Lc(t,[n[0],n[2]]);const{vₓₓ:f,vₓᵧ:l,vᵧᵧ:a,vₓ:p,vᵧ:h,v:d}=Pc(e),g=ss(i,i),v=us(i,o),m=us(i,r),x=ss(i,u),b=us(i,s),w=us(i,c),_=fs(o,o),M=fs(o,r),S=us(u,o),N=fs(o,s),I=fs(o,c),y=fs(r,s),E=fs(r,r),C=us(u,r),O=fs(r,c),T=ss(u,u),A=us(u,s),P=us(u,c),k=fs(s,s),B=fs(s,c),z=fs(c,c),F=fs(E,f),Y=fs(O,l),L=fs(z,a),X=ls(F,Y),H=ls(X,L),V=fs(M,f),$=fs(B,a),D=ls(I,y),q=fs(D,l),j=as(ls(V,$)),W=ls(j,q),Q=ls(as(m),_),R=ls(as(P),k),G=ls(w,N),U=ls(G,C),Z=fs(Q,f),J=fs(R,a),K=fs(U,l),tt=fs(r,p),nt=fs(c,h),et=ls(Z,J),rt=ls(et,K),ot=ls(tt,nt),it=ls(rt,ot),ct=fs(v,f),st=fs(A,a),ut=ls(b,S),ft=fs(ut,l),at=as(ls(ct,st)),pt=fs(o,p),ht=fs(s,h),dt=ls(at,ft),gt=ls(pt,ht),vt=ls(dt,gt),mt=fs(g,f),xt=fs(x,l),bt=fs(T,a),wt=us(i,p),_t=us(u,h),Mt=ls(mt,xt),St=ls(Mt,bt),Nt=ls(wt,_t),It=ls(St,Nt);return[H,W,it,vt,ls(It,d)].map(Pn)}const hs=Kn,ds=nt,gs=ot,vs=J,ms=Sr;function xs(t,n){const e=mc(t);if(0===lt(e[0][0])&&0===lt(e[1][0]))return ps(Dc(t),n);const[[r,o,[i]],[c,s,[u]]]=xc(n);if(0===lt(r)&&0===lt(c))return es(t,[n[0],n[2]]);const{vₓₓₓ:f,vₓₓᵧ:l,vₓᵧᵧ:a,vᵧᵧᵧ:p,vₓₓ:h,vₓᵧ:d,vᵧᵧ:g,vₓ:v,vᵧ:m,v:x}=Uc(e),b=hs(i,i),w=ds(i,o),_=ds(i,r),M=hs(i,u),S=ds(i,s),N=ds(i,c),I=gs(o,o),y=gs(o,r),E=ds(u,o),C=gs(o,s),O=gs(o,c),T=gs(r,s),A=gs(r,r),P=ds(u,r),k=gs(r,c),B=hs(u,u),z=ds(u,s),F=ds(u,c),Y=gs(s,s),L=gs(s,c),X=gs(c,c),H=gs(r,f),V=gs(r,a),$=gs(c,l),D=gs(c,p),q=vs(H,$),j=vs(V,D),W=gs(A,q),Q=gs(X,j),R=vs(W,Q),G=vs(_,I),U=vs(F,Y),Z=vs(ms(_),I),J=vs(ms(F),Y),K=vs(ms(C),P),tt=vs(ms(C),N),nt=vs(ms(P),C),et=vs(ds(6,_),I),rt=vs(ds(6,F),Y),ot=vs(O,T),it=vs(N,P),ct=vs(ms(E),S),st=vs(ms(S),E),ut=vs(N,C),ft=vs(ut,P),at=ds(3,A),pt=ds(3,X),ht=gs(at,f),dt=gs(A,l),gt=ms(gs(k,l)),vt=ms(gs(k,a)),mt=gs(X,a),xt=gs(pt,p),bt=vs(ht,gt),wt=vs(dt,vt),_t=vs(bt,mt),Mt=vs(wt,xt),St=gs(o,_t),Nt=gs(s,Mt),It=vs(St,Nt),yt=gs(c,Z),Et=gs(c,tt),Ct=gs(r,K),Ot=gs(r,J),Tt=gs(ds(3,r),G),At=gs(ds(3,c),U),Pt=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ae=ds(i,a),pe=ds(u,l),he=ds(u,p),de=vs(le,pe),ge=vs(ae,he),ve=vs(de,h),me=vs(ge,g),xe=gs(b,ve),be=gs(B,me),we=gs(M,d),_e=ds(i,v),Me=ds(u,m),Se=vs(xe,be),Ne=vs(Se,we),Ie=vs(_e,Me),ye=vs(Ne,Ie);return[R,It,Wt,dn,Hn,fe,vs(ye,x)].map(Pn)}const bs=nt,ws=ot,_s=J;function Ms(t,n){const e=bc(t),[[r,o,i,[c]],[s,u,f,[l]]]=mc(n);if(0===lt(r)&&0===lt(s))return cs(t,Dc(n));const{vₓ:a,vᵧ:p,v:h}=Mc(e),d=ws(r,a),g=ws(s,p),v=_s(d,g),m=ws(o,a),x=ws(u,p),b=_s(m,x),w=ws(i,a),_=ws(f,p),M=_s(w,_),S=bs(c,a),N=bs(l,p),I=_s(S,N);return[v,b,M,_s(I,h)].map(Pn)}const Ss=Kn,Ns=nt,Is=ot,ys=J,Es=Sr;function Cs(t,n){const e=xc(t);if(0===lt(e[0][0])&&0===lt(e[1][0]))return Ms([t[0],t[2]],n);const[[r,o,i,[c]],[s,u,f,[l]]]=mc(n);if(0===lt(r)&&0===lt(s))return ps(t,Dc(n));const{vₓₓ:a,vₓᵧ:p,vᵧᵧ:h,vₓ:d,vᵧ:g,v}=Pc(e),m=Ss(c,c),x=Ns(c,i),b=Ns(c,o),w=Ns(c,r),_=Ss(c,l),M=Ns(c,f),S=Ns(c,u),N=Ns(c,s),I=Is(i,i),y=Is(i,o),E=Is(i,r),C=Ns(l,i),O=Is(i,f),T=Is(i,u),A=Is(i,s),P=Is(o,f),k=Is(o,o),B=Is(o,r),z=Ns(l,o),F=Is(o,u),Y=Is(o,s),L=Is(r,r),X=Ns(l,r),H=Is(r,f),V=Is(r,u),$=Is(r,s),D=Ss(l,l),q=Ns(l,f),j=Ns(l,u),W=Ns(l,s),Q=Is(f,f),R=Is(f,u),G=Is(s,s),U=Is(u,u),Z=Is(u,s),J=Is(f,s),K=Is(L,a),tt=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ei(N),E=f*h,C=oi(f,r),O=ei(E),T=N+E,A=ri(I,C),P=y+O+ei(T);return{coeffs:[M,ri(A,o)],errBound:[S,P+i+ei(T+d)]}},function(t,n){const{coeffs:{vₓ:e,vᵧ:r,v:o},errorBound:{v_:i}}=ni(t),{coeffs:[[c,s,[,u]],[f,l,[,a]]],errorBound:[[p],[h]]}=Go(n),d=e[1],g=r[1],v=o[1],m=Yi(d),x=Yi(g),b=s[1],w=c[1],_=l[1],M=f[1],S=w*d,N=Fi(c,e),I=p*m+2*Yi(S),y=M*g,E=Fi(f,r),C=h*x+2*Yi(y),O=S+y,T=Bi(N,E),A=I+C+Yi(O),P=b*d,k=Fi(s,e),B=2*Yi(P),z=_*g,F=Fi(l,r),Y=2*Yi(z),L=P+z,X=Bi(k,F),H=B+Y+Yi(L),V=zi(u,e),$=u*d,D=Yi($),q=zi(a,r),j=a*g,W=Yi(j),Q=$+j,R=Bi(V,q),G=D+W+Yi(Q),U=Q+v;return{coeffs:[T,X,Bi(R,o)],errBound:[A,H,G+i+Yi(U)]}},function(t,n){const{coeffs:{vₓ:e,vᵧ:r,v:o},errorBound:{v_:i}}=ni(t),{coeffs:[[c,s,u,[,f]],[l,a,p,[,h]]],errorBound:[[d,g,v],[m,x,b]]}=Ro(n),w=Ki(e[1]),_=Ki(r[1]),M=Ji(c,e),S=d*w+2*Ki(M[1]),N=Ji(l,r),I=m*_+2*Ki(N[1]),y=Ui(M,N),E=S+I+Ki(y[1]),C=Ji(s,e),O=g*w+2*Ki(C[1]),T=Ji(a,r),A=x*_+2*Ki(T[1]),P=Ui(C,T),k=O+A+Ki(P[1]),B=Ji(u,e),z=v*w+2*Ki(B[1]),F=Ji(p,r),Y=b*_+2*Ki(F[1]),L=Ui(B,F),X=z+Y+Ki(L[1]),H=Zi(f,e),V=Ki(H[1]),$=Zi(h,r),D=Ki($[1]),q=Ui(H,$),j=V+D+Ki(q[1]),W=Ui(q,o);return{coeffs:[y,P,L,W],errBound:[E,k,X,j+i+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l,Z),Kr=As(u,Q),to=Ps(Wr,Qr),no=Ps(Rr,Gr),eo=Ps(Ur,Zr),ro=Ps(Jr,Kr),oo=As(a,eo),io=As(d,ro),co=Ts(3,Ps(oo,io)),so=Ps($r,E),uo=Ps(ks(S),O),fo=Ps(ks(G),Z),lo=As(p,to),ao=As(h,no),po=As(v,so),ho=As(g,uo),go=As(m,fo),vo=As(o,x),mo=As(u,b),xo=Ps(vo,mo),bo=Ps(lo,ao),wo=Ps(co,po),_o=Ps(ho,go),Mo=Ps(bo,wo),So=Ps(_o,xo),No=Ps(Mo,So),Io=Ps(P,y),yo=Ts(c,p),Eo=Ts(l,h),Co=Ps(Io,P),Oo=Ps(Io,y),To=As(i,_),Ao=As(To,a),Po=As(f,Q),ko=As(Po,d),Bo=As(v,Io),zo=As(M,g),Fo=As(R,m),Yo=Ps(zo,Fo),Lo=As(i,x),Xo=As(f,b),Ho=Ps(Lo,Xo),Vo=As(yo,Co),$o=As(Eo,Oo),Do=Ps(Vo,$o),qo=Ts(3,Ps(Ao,ko)),jo=Ps(Bo,ks(Yo)),Wo=Ps(Do,qo),Qo=Ps(jo,Ho),Ro=Ps(Wo,Qo),Go=Ts(c,a),Uo=Ts(l,p),Zo=Ps(Go,Uo),Jo=Ts(c,h),Ko=Ts(l,d),ti=Ps(Jo,Ko),ni=Ps(Zo,g),ei=Ps(ti,m),ri=As(_,ni),oi=As(Q,ei),ii=Ps(ri,oi),ci=As(I,v),si=Ps(ii,ci),ui=Ts(c,x),fi=Ts(l,b),li=Ps(ui,fi),ai=Ps(si,li);return[dt,Et,Jt,Fn,be,Ke,Vr,No,Ro,Ps(ai,w)].map(Pn)}]];function Fs(t,n){const{coeffs:e,errBound:r}=Bs[t.length-2][n.length-2](t,n);return{coeffs:e,errBound:r,getPExact:()=>zs[t.length-2][n.length-2](t,n)}}const Ys=134217729;function Ls(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],c=r/i,s=i*c,u=Ys*i,f=u-(u-i),l=i-f,a=Ys*c,p=a-(a-c),h=c-p,d=o*c,g=s+d,v=d-(g-s)+(l*h-(s-f*p-l*p-f*h)),m=g+v,x=(r-m+(e-(v-(m-g))))/i,b=c+x;return[x-(b-c),b]}const Xs=Ls,Hs=Number.EPSILON/2,Vs=Hs*Hs,$s=tn,Ds=tn,qs=Wn,js=Kt,Ws=tn,Qs=Ke,Rs=$o,{abs:Gs}=Math,Us=[0,1],Zs=tn,Js=$o,Ks=Kt,tu=Wn,nu=$n,eu=tr,ru=function(t,n,e,r){const o=t[0],i=t[1],c=n[0],s=n[1],u=Xs(t,n),f=Math.abs(o+i),l=Math.abs(c+s),a=l-Hs*l-r;return a<=0?{est:u,err:Number.POSITIVE_INFINITY}:{est:u,err:(l*e+f*r)/a**2+9*Vs*Math.abs(f/l)}},ou=function(t,n){return $s(t,n)[1]>0?n:t},iu=function(t,n){return Ds(t,n)[1]>0?t:n};function cu(t,n){return n[0][0]!==n[1][0]||n[0][1]!==n[1][1]?4===t.length?function([[t,n],[e,r],[o,i],[c,s]],[u,f]){const l=Zs(f,u),a=3*ze*Gs(l[1]),p=Zs(Us,u),h=3*ze*Gs(p[1]),d=ru(l,p,a,h);f=Js(d.est,d.err);const g=Zs(Us,u),v=tu(u,u),m=tu(u,g),x=tu(g,g),b=tu(v,u),w=tu(v,g),_=tu(x,u),M=tu(x,g),S=Zs(Us,f),N=tu(f,f),I=tu(f,S),y=tu(S,S),E=tu(N,f),C=tu(N,S),O=tu(y,f),T=tu(y,S),A=Gs(u[1]),P=Gs(g[1]),k=Gs(v[1]),B=Gs(m[1]),z=Gs(x[1]),F=Gs(b[1]),Y=Gs(w[1]),L=Gs(_[1]),X=Gs(M[1]),H=Gs(f[1]),V=Gs(S[1]),$=Gs(N[1]),D=Gs(I[1]),q=Gs(y[1]),j=Gs(E[1]),W=Gs(C[1]),Q=Gs(O[1]),R=Gs(T[1]);let G=Gs(t),U=Gs(n),Z=Gs(e),J=Gs(r),K=Gs(o),tt=Gs(i),nt=Gs(c),et=Gs(s);const rt=Ks(nu(c,u),nu(o,g)),ot=Ks(Ks(nu(c,v),nu(2*o,m)),nu(e,x)),it=Ks(Ks(nu(c,b),nu(t,M)),nu(3,Ks(nu(o,w),nu(e,_)))),ct=Ks(tu(ot,f),tu(it,S)),st=Ks(Ks(tu(rt,N),tu(it,y)),tu(eu(ot),I)),ut=Ks(Ks(nu(c,E),tu(it,T)),nu(3,Ks(tu(rt,C),tu(ot,O)))),ft=Gs(it[1]),lt=nt*A+K*P,at=nt*k+2*K*B+Z*z;G=nt*F+G*X+3*(K*Y+Z*L),Z=at*H+ft*V,K=lt*$+ft*q+2*at*D,nt=nt*j+ft*R+3*(lt*W+at*Q),G*=11*ze,Z*=15*ze,K*=20*ze,nt*=22*ze;const pt=Ks(nu(s,u),nu(i,g)),ht=Ks(Ks(nu(s,v),nu(2*i,m)),nu(r,x)),dt=Ks(Ks(nu(s,b),nu(n,M)),nu(3,Ks(nu(i,w),nu(r,_)))),gt=Ks(tu(ht,f),tu(dt,S)),vt=Ks(Ks(tu(pt,N),tu(dt,y)),tu(eu(ht),I)),mt=Ks(Ks(nu(s,E),tu(dt,T)),nu(3,Ks(tu(pt,C),tu(ht,O)))),xt=Gs(dt[1]),bt=et*A+tt*P,wt=et*k+2*tt*B+J*z;U=et*F+U*X+3*(tt*Y+J*L),J=wt*H+xt*V,tt=bt*$+xt*q+2*wt*D,et=et*j+xt*R+3*(bt*W+wt*Q),U*=11*ze,J*=15*ze,tt*=20*ze,et*=22*ze;const _t=ou(ou(Js(it,-G),Js(ct,-Z)),ou(Js(st,-K),Js(ut,-nt))),Mt=iu(iu(Js(it,+G),Js(ct,+Z)),iu(Js(st,+K),Js(ut,+nt)));return[[_t,ou(ou(Js(dt,-U),Js(gt,-J)),ou(Js(vt,-tt),Js(mt,-et)))],[Mt,iu(iu(Js(dt,+U),Js(gt,+J)),iu(Js(vt,+tt),Js(mt,+et)))]]}(t,n):3===t.length?function([[t,n],[e,r],[o,i]],[c,s]){const u=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(p[1]);let m=Gs(t),x=Gs(n),b=Gs(e),w=Gs(r);const _=Ks(nu(e,o),nu(t,a)),M=Ks(nu(e,i),tu(_,p));m=b*h+m*d,b=b*g+m*v,m*=3*Be,b*=7*Be;const S=Ks(nu(r,o),nu(n,a)),N=Ks(nu(r,i),tu(S,p));x=w*h+x*d,w=w*g+x*v,x*=3*Be,w*=7*Be;const I=ou(Js(_,-m),Js(M,-b)),y=iu(Js(_,+m),Js(M,+b));return[[I,ou(Js(S,-x),Js(N,-w))],[y,iu(Js(S,+x),Js(N,+w))]]}(t,n):function(t,n){const e=t[0],r=t[t.length-1];if(0===n[0]&&0===n[1]){const t=[0,e[0]],n=[0,e[1]];return[[t,n],[t,n]]}if(0===n[0]&&1===n[1]){const t=[0,r[0]],n=[0,r[1]];return[[t,n],[t,n]]}const o=function(t,n){if(0===n[0]&&0===n[1])return t[0].map(t=>[0,t]);if(0===n[0]&&1===n[1])return t[t.length-1].map(t=>[0,t]);if(4===t.length){const[[e,r],[o,i],[c,s],[u,f]]=t,l=Rs(qs(Qs(o,e),n),e),a=Rs(qs(Qs(c,o),n),o),p=Rs(qs(Qs(u,c),n),c),h=js(l,qs(Ws(a,l),n)),d=js(a,qs(Ws(p,a),n)),g=js(h,qs(Ws(d,h),n)),v=Rs(qs(Qs(i,r),n),r),m=Rs(qs(Qs(s,i),n),i),x=Rs(qs(Qs(f,s),n),s),b=js(v,qs(Ws(m,v),n)),w=js(m,qs(Ws(x,m),n));return[g,js(b,qs(Ws(w,b),n))]}if(3===t.length){const[[e,r],[o,i],[c,s]]=t,u=js([0,e],qs(Qs(o,e),n)),f=js([0,o],qs(Qs(c,o),n)),l=js(u,qs(Ws(f,u),n)),a=js([0,r],qs(Qs(i,r),n)),p=js([0,i],qs(Qs(s,i),n));return[l,js(a,qs(Ws(p,a),n))]}if(2===t.length){const[[e,r],[o,i]]=t;return[Rs(qs(Qs(o,e),n),e),Rs(qs(Qs(i,r),n),r)]}if(1===t.length){const[n,e]=t[0];return[[0,n],[0,e]]}throw new Error("The given bezier curve must be of order <= 3.")}(t,n);let i;if(4===t.length)i=ke(t,n).map(t=>16*Fe*t);else if(3===t.length)i=ke(t,n).map(t=>10*Fe*t);else if(2===t.length)i=ke(t,n).map(t=>4*Fe*t);else if(1===t.length)return[o,o];return[[Js(o[0],-i[0]),Js(o[1],-i[1])],[Js(o[0],+i[0]),Js(o[1],+i[1])]]}(t,n[0])}function su(t){return(n,e)=>{let[[r,o],[i,c]]=n,[[s,u],[f,l]]=e;return(o[1]>c[1]||o[1]===c[1]&&o[0]>c[0])&&([o,c]=[c,o]),(u[1]>l[1]||u[1]===l[1]&&u[0]>l[0])&&([u,l]=[l,u]),(r[1]>i[1]||r[1]===i[1]&&r[0]>i[0])&&([r,i]=[i,r]),(s[1]>f[1]||s[1]===f[1]&&s[0]>f[0])&&([s,f]=[f,s]),t?(r[1]<f[1]||r[1]===f[1]&&r[0]<=f[0])&&(i[1]>s[1]||i[1]===s[1]&&i[0]>=s[0])&&(u[1]<c[1]||u[1]===c[1]&&u[0]<=c[0])&&(l[1]>o[1]||l[1]===o[1]&&l[0]>=o[0]):(r[1]<f[1]||r[1]===f[1]&&r[0]<f[0])&&(i[1]>s[1]||i[1]===s[1]&&i[0]>s[0])&&(u[1]<c[1]||u[1]===c[1]&&u[0]<c[0])&&(l[1]>o[1]||l[1]===o[1]&&l[0]>o[0])}}function uu(t){return[((n=t.x.box)[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2];var n}function fu(t,n){const e=Fs(t,n);if(void 0===e)return;const{coeffs:r,errBound:o,getPExact:i}=e,c=Te(r,0,1,o,i)||[];return 0!==c.length?{ris:c.map(Vo),getPExact:i}:void 0}function lu(t){const n=it(t.tS);return{t:n,tS:n,tE:it(t.tE),multiplicity:t.multiplicity}}function au(t,n){const e=fu(t,n);if(void 0===e)return[];const{getPExact:r}=e;let o,{ris:i}=e;const c=()=>(o=o||r(),o),s=fu(n,t);if(void 0===s)return[];let{ris:u}=s;const{getPExact:f}=s;let l;const a=()=>(l=l||f(),l);let p;p=1;let h,d=0;t:for(;d<p;){h=u.map(n=>cu(t,[n.tS,n.tE]));for(let t=0;t<u.length;t++){const n=h[t];for(let e=t+1;e<u.length;e++){const t=h[e];if(su(!0)(n,t)){const t=[];for(const n of u)t.push(...Zr({t:n.tS[1],tS:n.tS[1],tE:n.tE[1],multiplicity:n.multiplicity},a()));u=t,d++;continue t}}}break t}p=1;let g,v=0;t:for(;v<p;){g=i.map(t=>cu(n,[t.tS,t.tE]));for(let t=0;t<i.length;t++){const n=g[t];for(let e=t+1;e<i.length;e++){const t=g[e];if(su(!0)(n,t)){const t=[];for(const n of i)t.push(...Zr({t:n.tS[1],tS:n.tS[1],tE:n.tE[1],multiplicity:n.multiplicity},c()));i=t,v++;continue t}}}break t}const m=[];for(let t=0;t<u.length;t++){const n=h[t];for(let e=0;e<i.length;e++){const o=g[e];if(su(!0)(n,o)){const c={compensated:d,ri:lu(u[t]),riExp:d?u[t]:void 0,getPExact:d?void 0:f,kind:1,box:pu(n)},s={compensated:v,ri:lu(i[e]),riExp:v?i[e]:void 0,getPExact:v?void 0:r,kind:1,box:pu(o)};m.push({psX:c,sideX:s})}}}return m}function pu(t){return t.map(t=>t.map(it))}function hu(t,n){return function(t,n){const e=t.xs,r=[],o=new Map;for(const t of e){const n=t.curve,e=o.get(n);e?e.push(t):o.set(n,[t])}const i=function(t){const[[n,e],[r,o]]=t.box,i=[[[r,e],[n,e]],[[n,e],[n,o]],[[n,o],[r,o]],[[r,o],[r,e]]];return(n,e,r)=>{const o=n.ps,c=e.slice();for(let t=0;t<i.length;t++){const n=au(o,i[t]);for(const{psX:e,sideX:r}of n)c.push({x:e,side:t,sideX:r,curve:void 0})}c.sort((t,n)=>t.x.ri.tS-n.x.ri.tS);const s=[],u=[];let f,l;for(const n of c)void 0!==n.side?(!0===l&&(u.push({idx:++r,dir:1,p:uu(n),_x_:f,container:t,side:n.side,sideX:n.sideX,loopsIdxs:new Set,children:new Set,windingNum:0,orientation:0}),f.out=u[u.length-1]),l=!1):(!1===l&&(s.push({idx:++r,dir:-1,p:uu(f),_x_:n,container:t,side:f.side,sideX:f.sideX,loopsIdxs:new Set,children:new Set,windingNum:0,orientation:0}),n.in_=s[s.length-1]),l=!0),f=n;return{ins:s,outs:u,ioIdx:r}}}(t);for(const t of o){const[e,o]=t;let c,s;({ins:c,outs:s,ioIdx:n}=i(e,o,n)),r.push(...c),r.push(...s)}return{inOuts:r,ioIdx:n}}(t,n)}function du(t,n,e,r){const o=[];for(const r of t)o.push({type:-1,item:r,x:n(r)}),o.push({type:1,item:r,x:e(r)});o.sort(gu);const i=new Set,c=[];for(const t of o){const{item:n,type:e}=t;if(-1===e){for(const t of i){const e=r(n,t);e&&c.push({a:n,b:t,u:e})}i.add(n)}else 1===e&&i.delete(n)}return c}function gu(t,n){const e=t.x-n.x;return 0!==e?e:t.type}function vu(t,n,e){const r=(t[0]-e[0])*(n[1]-e[1]),o=(t[1]-e[1])*(n[0]-e[0]),i=r-o;let c;if(r>0){if(o<=0)return i;c=r+o}else{if(!(r<0))return i;if(o>=0)return i;c=-r-o}return Math.abs(i)>=3330669073875472e-31*c?i:function(t,n,e,r){const o=t[0]-e[0],i=n[0]-e[0],c=t[1]-e[1],s=n[1]-e[1],u=ft(Kn(o,s),Kn(c,i));let f=it(u);if(Math.abs(f)>=2220446049250315e-31*r)return f;const l=Z(t[0],e[0])[0],a=Z(n[0],e[0])[0],p=Z(t[1],e[1])[0],h=Z(n[1],e[1])[0];if(0===l&&0===p&&0===a&&0===h)return f;const d=1109335647967049e-46*r+3330669073875471e-31*Math.abs(f);if(f+=o*h+s*l-(c*a+i*p),Math.abs(f)>=d)return f;const g=J(u,ft(Kn(l,s),Kn(p,i))),v=J(g,ft(Kn(o,h),Kn(c,a)));let m=J(v,ft(Kn(l,h),Kn(p,a)));return m=Pn(m),m[m.length-1]}(t,n,e,c)}function mu(t,n){const e=n[0]-t[0],r=n[1]-t[1];return e*e+r*r}function xu(t,n){if(0===t.length)return;const e=t.slice(),r=function(t){let n,e=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY];for(let r=0;r<t.length;r++){const o=t[r][1];(o<e[1]||o===e[1]&&t[r][0]<e[0])&&(n=r,e=t[r])}return n}(e),[o]=e.splice(r,1);e.sort((t,n)=>{let e=-vu(o,t,n);return 0!==e?e:(e=t[1]-n[1],0!==e?e:t[0]-n[0])}),e.unshift(o);const i=function(t){const n=[t[0]],e=t.length;for(let r=1;r<t.length;r++){const o=t[(r+e-1)%e],i=t[r];o[0]===i[0]&&o[1]===i[1]||n.push(i)}return n}(e),c=[];for(const t of i){for(;c.length>=2&&vu(c[c.length-2],c[c.length-1],t)<0;)c.pop();c.push(t)}if(n||c.length<3)return c;const s=[];{const t=c.length;for(let n=0;n<t;n++){const e=(n+1)%t,r=c[(n+t-1)%t],o=c[n],i=c[e];(0!==vu(r,o,i)||bu(r,o,i)<0)&&s.push(o)}}return s}function bu(t,n,e){const r=n[0]-t[0],o=n[1]-t[1];return r*(e[0]-n[0])+o*(e[1]-n[1])}const wu=xu,_u=Kt,Mu=ot,Su=J,Nu=Wn,Iu=Math.abs,yu=Le(3);const Eu=Math.abs;const Cu=Math.abs,Ou=Wn,Tu=Kt,Au=ot,Pu=J,ku=Math.abs,Bu=Ye(1),zu=Le(3);function Fu(t,n){const[e,r]=n,o=e.length,i=r.length,c=e[o-1],s=r[i-1],u=1===o&&1===i;{const{vₓₓ:n,vₓᵧ:e,vᵧᵧ:r,vₓ:o,vᵧ:i,v:f}=function(t){const[[n,e,r],[o,i,c]]=lo(t),s=n*i-e*o,u=n*c-r*o;return{vₓₓ:-o*o,vₓᵧ:2*n*o,vᵧᵧ:-n*n,vₓ:i*s-2*o*u,vᵧ:2*n*u-e*s,v:s*(e*c-r*i)-u*u}}(t),{vₓₓ_:l,vₓᵧ_:a,vᵧᵧ_:p,vₓ_:h,vᵧ_:d,v_:g}=function(t){const[n,e]=t[0],[[r,o],[i,c]]=function(t){const[[n,e],[r,o],[i,c]]=t,s=Eu(n),u=Eu(r),f=Eu(i),l=Eu(e),a=Eu(o);return[[f+s+2*u,2*(u+s),0],[Eu(c)+l+2*a,2*(a+l),0]]}(t),s=Cu(n),u=Cu(e),f=r*c+o*i,l=r*u+s*i;return{vₓₓ_:i*i,vₓᵧ_:2*r*i,vᵧᵧ_:r*r,vₓ_:c*f+2*i*l,vᵧ_:2*r*l+o*f,v_:f*(o*u+s*c)+l*l}}(t),v=u?0:1,m=ku(c),x=ku(s);if((v+12)*Bu*(l*(m*m)+a*(m*x)+p*(x*x)+(h*m+d*x)+g)<ku(n*c*c+e*c*s+r*s*s+(o*c+i*s)+f))return!1}{const{coeffs:{vₓₓ:n,vₓᵧ:o,vᵧᵧ:i,vₓ:u,vᵧ:f,v:l},errorBound:{vₓₓ_:a,vₓᵧ_:p,vᵧᵧ_:h,vₓ_:d,vᵧ_:g,v_:v}}=hi(t),m=jr(e),x=jr(r),b=ku(c),w=ku(s),_=b/3,M=w/3,S=Ou(m,m),N=S[1],I=2*(b*_+N),y=Ou(x,x),E=y[1],C=2*(w*M+E),O=Ou(m,x),T=ku(O[1]),A=b*M+_*w+2*T,P=Ou(n,S),k=ku(n[1])*I+a*N+2*ku(P[1]),B=Ou(o,O),z=ku(o[1])*A+p*T+2*ku(B[1]),F=Ou(i,y),Y=ku(i[1])*C+h*E+2*ku(F[1]),L=Ou(m,u),X=ku(u[1])*_+d*b+2*ku(L[1]),H=Ou(x,f),V=ku(f[1])*M+g*w+2*ku(H[1]),$=Tu(P,B),D=k+z+ku($[1]),q=Tu($,F),j=D+Y+ku(q[1]),W=Tu(L,H),Q=X+V+ku(W[1]),R=Tu(q,W),G=j+Q+ku(R[1]),U=Tu(R,l),Z=G+v+ku(U[1]);if(zu*Z<ku(it(U)))return!1}{const n=function(t){return Pc(xc(t))}(t);if(void 0===n)return u&&c===t[0][0]&&s===t[0][1];n.hasOwnProperty("vₓₓ")||(n.vₓₓ=[0],n.vₓᵧ=[0],n.vᵧᵧ=[0]);const{vₓₓ:o,vₓᵧ:i,vᵧᵧ:f,vₓ:l,vᵧ:a,v:p}=n;return 0===lt(Pu(Pu(Pu(Au(o,Au(e,e)),Au(i,Au(e,r))),Au(f,Au(r,r))),Pu(Pu(Au(e,l),Au(r,a)),p)))}}const Yu=Math.abs,Lu=Wn,Xu=Kt,Hu=ot,Vu=J,$u=Math.abs,Du=Ye(1),qu=Le(3);function ju(t,n){const[e,r]=n,o=e.length,i=r.length,c=e[o-1],s=r[i-1],u=1===o&&1===i;{const{vₓₓₓ:n,vₓₓᵧ:e,vₓᵧᵧ:r,vᵧᵧᵧ:o,vₓₓ:i,vₓᵧ:f,vᵧᵧ:l,vₓ:a,vᵧ:p,v:h}=function(t){const[[n,e,r,o],[i,c,s,u]]=fo(t),f=n*s,l=r*i,a=n*c,p=e*i,h=n*n,d=i*i,g=n*u-o*i,v=f-l,m=a-p,x=e*u-o*c,b=e*s-r*c,w=r*u-o*s,_=2*v,M=g*g,S=g*b,N=_*x,I=m*x,y=-3*g-b,E=-3*M-2*S+(N+m*w),C=2*(g*v-I),O=g*m-v*v+m*b;return{vₓₓₓ:-i*d,vₓₓᵧ:3*n*d,vₓᵧᵧ:-3*i*h,vᵧᵧᵧ:n*h,vₓₓ:y*d+m*(s*i-c*c)+_*c*i,vₓᵧ:2*(m*(e*c-(l+f)/2)-(y*n*i+v*(p+a))),vᵧᵧ:y*h+m*(r*n-e*e)+_*e*n,vₓ:i*E+(c*C+s*O),vᵧ:-n*E-(e*C+r*O),v:g*(N-M-S)+(O*w-I*x)}}(t),{vₓₓₓ_:d,vₓₓᵧ_:g,vₓᵧᵧ_:v,vᵧᵧᵧ_:m,vₓₓ_:x,vₓᵧ_:b,vᵧᵧ_:w,vₓ_:_,vᵧ_:M,v_:S}=function(t){const[n,e]=t[0],[[r,o,i],[c,s,u]]=function(t){const[[n,e],[r,o],[i,c],[s,u]]=t,f=Eu(n),l=Eu(r),a=Eu(i),p=Eu(s),h=E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n.vₓₓ=[0],n.vₓᵧ=[0],n.vᵧᵧ=[0]);const{vₓₓₓ:o,vₓₓᵧ:i,vₓᵧᵧ:f,vᵧᵧᵧ:l,vₓₓ:a,vₓᵧ:p,vᵧᵧ:h,vₓ:d,vᵧ:g,v}=n,m=Hu(e,e),x=Hu(e,m),b=Hu(r,r),w=Hu(r,b),_=Hu(r,m),M=Hu(e,b),S=Hu(e,r),N=Hu(o,x),I=Hu(i,_),y=Hu(f,M),E=Hu(l,w),C=Hu(a,m),O=Hu(p,S),T=Hu(h,b),A=Hu(e,d),P=Hu(r,g),k=Vu(N,I),B=Vu(y,E),z=Vu(k,B),F=Vu(C,O),Y=Vu(F,T),L=Vu(z,Y),X=Vu(A,P),H=Vu(X,v);return 0===lt(Vu(L,H))}}function Wu(t,n){const{coeffs:e,errBound:r,getPExact:o}=Fs(t,n);return Te(e,0,1,r,o)}const Qu=Math.min,Ru=Math.max;function Gu(t,n){let[[e,r],[o,i]]=t,[[c,s],[u,f]]=n;if(e>o&&([e,o]=[o,e]),c>u&&([c,u]=[u,c]),r>i&&([r,i]=[i,r]),s>f&&([s,f]=[f,s]),e<=u&&o>=c&&s<=i&&f>=r)return[[Ru(e,c),Ru(r,s)],[Qu(o,u),Qu(i,f)]]}function Uu(t,n,e){if(void 0===e)return;if(0===e.length)return[];const r=Wu(n,t);if(void 0===r)return;if(0===r.length)return[];const o=r.map(n=>Ge(t,[n.tS,n.tE])),i=e.map(t=>Ge(n,[t.tS,t.tE])),c=[];for(let t=0;t<r.length;t++){const n=o[t];for(let o=0;o<e.length;o++){const s=Gu(n,i[o]);if(void 0!==s){const n={ri:r[t],box:s,kind:1},i={ri:e[o],box:s,kind:1};c.push([n,i])}}}return c}function Zu(t,n,e){for(const r of[t,n]){const o=r.length;for(let i=1;i<o+1;i++){const c=r[i-1],s=r[i%o],u=[s[1]-c[1],c[0]-s[0]];let f=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let n=0;n<t.length;n++){const e=u[0]*t[n][0]+u[1]*t[n][1];e<f&&(f=e),e>l&&(l=e)}let a=Number.POSITIVE_INFINITY,p=Number.NEGATIVE_INFINITY;for(let t=0;t<n.length;t++){const e=u[0]*n[t][0]+u[1]*n[t][1];e<a&&(a=e),e>p&&(p=e)}if(e&&(l<a||p<f))return!1;if(!e&&(l<=a||p<=f))return!1}}return!0}const Ju=Kn,Ku=J,tf=Number.EPSILON/2,nf=Math.abs;function ef(t){const[[n,e],[r,o],[i,c],[s,u]]=t,f=s+3*r,l=n+3*i,a=f-l,p=nf(3*r)+nf(f)+(nf(3*i)+nf(l))+nf(a);if(nf(a)-tf*p>0)return!1;const h=u+3*o,d=e+3*c,g=h-d,v=nf(3*o)+nf(h)+(nf(3*c)+nf(d))+nf(g);return!(nf(g)-tf*v>0)&&0===lt(ft(Ku([s],Ju(3,r)),Ku([n],Ju(3,i))))&&0===lt(ft(Ku([u],Ju(3,o)),Ku([e],Ju(3,c))))}const rf=dt,{abs:of}=Math;function cf(t){const[[n,e],[r,o],[i,c]]=t,s=n+i,u=s-2*r,f=of(s)+of(u);if(of(u)-f>0)return!1;const l=e+c,a=l-2*o,p=of(l)+of(a);return!(of(a)-p>0)&&0===lt(ft(rf(n,i),[2*r]))&&0===lt(ft(rf(e,c),[2*o]))}function sf(t){const n=t[0][0],e=t[0][1];for(let r=1;r<t.length;r++)if(n!==t[r][0]||e!==t[r][1])return!1;return!0}function uf(t){return 4===t.length&&ef(t)&&(t=Dc(t)),3===t.length&&cf(t)&&(t=[t[0],t[2]]),2===t.length&&sf(t)&&(t=[t[0]]),t}const ff=Number.EPSILON,lf=ff/2;function af(t,n){return n<0?t<1?t:1-lf:0===n?1:t>1?t:1+ff}function pf(t){const n=function(t){const n=new ArrayBuffer(8);return new DataView(n).setFloat64(0,t,!1),Array.from(new Uint8Array(n))}(t),e=n[0],r=n[1],o=e>>7,i=((127&e)<<4)+((240&r)>>4),c=0===i?0:16,s=0===i?i-1022:i-1023,u=n.slice(1);return u[0]=(15&r)+c,{sign:o,exponent:s,significand:u}}function hf(t){return pf(t).significand}function df(t){return Math.log2(t&-t)}function gf(t){if(0===t||!Number.isFinite(t))return NaN;const n=hf(t),e=n.length;for(let t=e-1;t>=0;t--){if(0===n[t])continue;const r=df(n[t]);if(Number.isFinite(r))return 8*(e-t-1)+r}return NaN}function vf(t){return t>=128?7:t>=64?6:t>=32?5:t>=16?4:t>=8?3:t>=4?2:t>=2?1:t>=1?0:NaN}function mf(t){if(0===t||!Number.isFinite(t))return NaN;const n=hf(t),e=n.length;for(let t=0;t<e;t++){const r=vf(n[t]);if(Number.isFinite(r))return 8*(e-t-1)+r}return NaN}function xf(t){return pf(t).exponent}function bf(t){if(0===t||!Number.isFinite(t))return NaN;const n=xf(t);return mf(t)-52+n}function wf(t,n){const e=(2**(53-n)+1)*t;return e-(e-t)}const _f=lt,Mf=Pn;function Sf(t){return 0===t?0:mf(t)-gf(t)+1}const Nf=ot,If=function(t,n){if(t=Mf(t),0===_f(t))return[0];const e=bf(t[t.length-1]);let r=e,o=t.length-1;for(;o>0;){const i=bf(t[o-1]);if(e-i>n)break;r=i,o--}const i=Math.min(n-(e-r),53);let c=t[o];c=wf(c,i);const s=t.slice(o);return s[0]=c,s},yf=function(t){const n=Pn(t);if(0===lt(n))return 0;const e=n[n.length-1],r=n[0];return xf(e)-xf(r)+(53-gf(r))},Ef=ft,Cf=it;function Of(t){return it(function(t,n,e){let r=n,o=t,i=!1,c=0;e||(c=yf(o)-yf(r)+1,e=c/53+1,i=!0);let s=[1/Cf(r)],u=1;for(;;){if(o=Nf(o,s),u>e)return i?(o=If(o,c),o):o.slice(o.length-e,o.length);r=Nf(r,s),s=Ef([2],r),u*=2}}(t[0],t[1],2))}function Tf(t){return lt(t[0])*lt(t[1])}function Af(t){return(n,e)=>{const r=vc(n),o=vc(e),i=vc(n.slice().reverse()),c=vc(e.slice().reverse()),s=t(r,o),u=t(i,o),f=t(r,c),l=t(i,c),a=-Tf(u),p=-Tf(l),h=Of(s),d=Of(f);return[af(h,a),af(d,p)]}}const Pf=Af(function(t,n){const e=0===lt(t[0][0])?1:0;return function(t,n){const[e,r]=t,[,o]=n;return[ft(o,r),e]}(t[e],n[e])});function kf(t,n){return Jr(ot(t[0],n[1]),ot(t[1],n[0]))*lt(t[1])*lt(n[1])}function Bf(t){let n=-1024;for(let e=0;e<t.length;e++){const r=t[e];for(let t=0;t<r.length;t++){const e=r[t];if(0===e)continue;const o=-xf(e)+Sf(e)-1;o>n&&(n=o)}}return 0===n?t.map(t=>t.map(t=>BigInt(t))):n>0?t.map(t=>t.map(t=>{if(0===t)return 0n;const e=-xf(t)+Sf(t)-1;return BigInt(t*2**e)*2n**BigInt(n-e)})):t.map(t=>t.map(t=>BigInt(t*2**n)))}function zf(t,n){if(n=n<0n?-n:n,0n===(t=t<0n?-t:t))return n;if(0n===n)return t;for(;0n!==n;){const e=n;n=t%n,t=e}return t}const Ff=BigInt(2**53);function Yf(t){if(0n===t)return[0];const n=[];let e=0,r=t;for(;0n!==r;){r=t/Ff;const o=t%Ff;n.push(Number(o)*2**(53*e)),t=r,e++}return Pn(n)}const{round:Lf,sqrt:Xf}=Math;function Hf(t){if(t<=1n){if(t<0n)throw new Error("square root of negative numbers are not allowed");return t}let n=BigInt(Lf(Xf(Number(t))));for(;;){const e=n+t/n>>1n;if(e===n)return n;n=e}}function Vf(t){return t<0n?-t:t}function $f(t){let n=0n;for(let e=0;e<t.length;e++)n+=t[e];return n}function Df(t,n){const[e,r]=qf(t[0],n[0]),[o,i]=qf(t[1],n[1]);if(0===kf(e,o)||0===kf(e,i))return e;if(0===kf(r,o)||0===kf(r,i))return r;throw new Error("An unexpected error occured.")}function qf(t,n){const[e,r]=t,[o,i]=n,[c,s]=function(t){const[n,e]=Bf(t).map($f),r=zf(n,e);return[Yf(Hf(Vf(n/r))),Yf(Hf(Vf(e/r)))]}([o,e]);return[[ft(ot(i,s),ot(r,c)),ot(c,Sr(e))],[ft(ot(i,ct(s)),ot(r,c)),ot(c,Sr(e))]].sort(kf)}function jf(t,n){const e=vc(t),r=0===lt(e[0][0])?0:0===lt(e[1][0])?1:-1;if(-1!==r){const e=t[0][r],o=t[2][r],i=n[0][r],c=n[2][r];return Pf([[e,e],[o,o]],[[i,i],[c,c]])}return Af(Df)(t,n)}const{round:Wf,cbrt:Qf}=Math;function Rf(t){const n=(e=t)>0n?1n:e<0n?-1n:0n;var e;if((t=Vf(t))<=1n)return n*t;let r=BigInt(Wf(Qf(Number(t))));for(;;){const e=(2n*r+t/(r*r))/3n;if(e===r)return n*r;r=e}}function Gf(t){return ot(t,t)}const Uf=Af(function(t,n){const e=0===lt(t[0][0])?1:0;return function(t,n){const[e,r]=t,[o,i]=n,c=function(t){const[n,e]=Bf(t).map($f),r=zf(n,e);return[Yf(Rf(n/r)),Yf(Rf(e/r))]}([o,e]),s=Gf(c[0]);return[ft(ot(i,Gf(c[1])),ot(r,s)),ot(nt(3,e),s)]}(t[e],n[e])}),{EPSILON:Zf}=Number,Jf=Zf/2+Zf**2/2;function Kf(t){return t>0?t-t*Jf:t+t*Jf}const{EPSILON:tl}=Number,nl=tl/2+tl**2/2;function el(t){return t>0?t+t*nl:t-t*nl}function rl(t){if(0===t||1===t)return[t,t];const n=Kf(Kf(t)),e=function(t){return el(el(t))}(t);return[n,e]}function ol(t,n,e,r){const o=t.ps,i=n.ps,c=[];let s=Wu(o,i);if(void 0===s){const r=2**(e-47),s=function(t,n,e=!1){e||(t=uf(t),n=uf(n));const r=[,,Pf,jf,Uf],[o,i]=r[t.length](t,n),[c,s]=r[t.length](n,t),u=[{tA:o,tB:0,bez:"B",start:!0},{tA:i,tB:1,bez:"B",start:!1},{tA:0,tB:c,bez:"A",start:!0},{tA:1,tB:s,bez:"A",start:!1}].sort((t,n)=>t.tA-n.tA);if(u[1].tA===u[2].tA){const n=u[1],e=n.tA,r=n.tB,o=Ge(t,[e,e]);return[{p:o[0],kind:4,box:o,t1:e,ri1:{t:e,tS:e,tE:e,multiplicity:1},t2:r,ri2:{t:r,tS:r,tE:r,multiplicity:1}}]}if(u[0].bez===u[1].bez)return[];const f=u[1],l=u[2],[a,p]=rl(f.tA),[h,d]=rl(f.tB),[g,v]=rl(l.tA),[m,x]=rl(l.tB),b=Ge(t,[a,p]),w=Ge(n,[h,d]),_=Ge(t,[g,v]),M=Ge(n,[m,x]),S=Gu(b,w),N=Gu(_,M),I={t:a,tS:a,tE:p,multiplicity:1},y={t:h,tS:h,tE:d,multiplicity:1},E={t:g,tS:g,tE:v,multiplicity:1},C={t:m,tS:m,tE:x,multiplicity:1};return[{p:Ue(S),kind:5,box:S,t1:$r(I),ri1:I,t2:$r(y),ri2:y},{p:Ue(N),kind:5,box:N,t1:$r(E),ri1:E,t2:$r(C),ri2:C}]}(o,i);for(const e of s){const i=Ae(o,e.ri1.tS),s=[[i[0]-r,i[1]-r],[i[0]+r,i[1]+r]],u={x:{ri:e.ri1,kind:5,box:s},curve:t},f={x:{ri:e.ri2,kind:5,box:s},curve:n};c.push([u,f])}return c}if(r&&(s=s.filter(t=>t.tS>0)),0===s.length)return[];const u=Uu(o,i,s);if(void 0===u||0===u.length)return[];for(const e of u){const r={x:e[0],curve:t},o={x:e[1],curve:n};c.push([r,o])}return c}const il=Ye(1);function cl(t,n,e){const r=n.ps;if(0===t)return r[0],{x:{ri:{t,tS:t,tE:t,multiplicity:1},box:[r[0],r[0]],kind:e},curve:n};if(1===t){const o=r[r.length-1];return{x:{ri:{t,tS:t,tE:t,multiplicity:1},box:[o,o],kind:e},curve:n}}const{p:o,pE:i}=function(t,n){const e=Ae(t,n),r=ke(t,[0,n]);if(4===t.length)return{p:e,pE:r.map(t=>9*il*t)};if(3===t.length)return{p:e,pE:r.map(t=>6*il*t)};if(2===t.length)return{p:e,pE:r.map(t=>3*il*t)};if(1===t.length)return{p:t[0],pE:[0,0]};throw new Error("The given bezier curve must be of order <= 3.")}(r,t);return{x:{ri:{t,tS:t,tE:t,multiplicity:1},box:[[o[0]-i[0],o[1]-i[1]],[o[0]+i[0],o[1]+i[1]]],kind:e},curve:n}}function sl(t,n){if(n.next===t){if(t.next===n)return;[t,n]=[n,t]}const e=t.ps,r=n.ps;if(function(t,n){if(4===t.length)return ju(t,n);if(3===t.length)return Fu(t,n);if(2===t.length)return function(t,n){const[e,r]=n,o=e.length,i=r.length,c=e[o-1],s=r[i-1],u=1===o&&1===i;{const{coeffs:{vₓ:n,vᵧ:o,v:i},errorBound:{v_:u}}=ni(t),f=jr(e),l=jr(r),a=Iu(c),p=Iu(s),h=Iu(n[1]),d=Iu(o[1]),g=a/3,v=p/3,m=n[1]*c,x=Nu(f,n),b=h*g+2*Iu(m),w=o[1]*s,_=Nu(l,o),M=d*v+2*Iu(w),S=_u(x,_),N=b+M+Iu(S[1]),I=_u(S,i),y=N+u+Iu(I[1]);if(yu*y<Iu(it(I)))return!1}{const n=function(t){return Mc(bc(t))}(t);if(void 0===n)return u&&c===t[0][0]&&s===t[0][1];const{vₓ:o,vᵧ:i,v:f}=n,l=Mu(e,o),a=Mu(r,i);return 0===lt(Su(Su(l,a),f))}}(t,n);if(1===t.length){const e=Pn(n[0]),r=Pn(n[1]);return 1===e.length&&1===r.length&&e[0]===t[0][0]&&r[0]===t[0][1]}throw new Error("The given bezier curve must be of order <= 3")}(e,r[r.length-1].map(t=>[t]))){const o=Uu(e,r,[Vr(1)]);if(void 0===o||0===o.length)return;return[[{x:o[0][0],curve:t},cl(1,n,1)]]}}const ul=ct;function fl(t){return t[t.length-1]<0?ul(t):t}function ll(t,n){const e=t+n,r=e-t;return[t-(e-r)+(n-r),e]}Number.EPSILON;const al=Number.EPSILON/2;function pl(t,n,e,r){const o=t/n,i=Math.abs(t),c=Math.abs(n),s=c-r;return s<=0?{est:o,err:Number.POSITIVE_INFINITY}:{est:o,err:(c*e+i*r)/s**2+al*Math.abs(i/c)}}function hl(t){const n=t[0],e=t[1];if(0===e)return[0,0];const r=Math.sqrt(e),o=r*r,i=134217729*r,c=i-(i-r),s=r-c,u=.5*(e-o-(s*s-(o-c*c-c*s*2))+n)/r;return[u-(r+u-r),r+u]}const{abs:dl}=Math;const gl=Math.abs,vl=Ye(1);function ml(t){const{coeffs:[[n,e,r],[o,i,c]],errorBound:[[s,u],[f,l]]}=function(t){const[[n,e],[r,o],[i,c],[s,u]]=t,f=s-n,l=r-i,a=f+3*l,p=i+n,h=p-2*r,d=r-n,g=u-e,v=o-c,m=g+3*v,x=c+e,b=x-2*o,w=o-e;return{coeffs:[[a,3*h,3*d,n],[m,3*b,3*w,e]],errorBound:[[dl(f)+6*dl(l)+dl(a),6*(dl(p)+dl(h)),6*dl(d),0],[dl(g)+6*dl(v)+dl(m),6*(dl(x)+dl(b)),6*dl(w),0]]}}(t),a=gl(n),p=gl(e),h=gl(r),d=gl(o),g=gl(i),v=gl(c),m=e*o,x=n*i,b=n*c,w=r*o,_=e*c,M=r*i,S=u*d+p*f+gl(m),N=s*g+a*l+gl(x),I=s*v+gl(b),y=h*f+gl(w),E=u*v+gl(_),C=h*l+gl(M),O=m-x,T=gl(O),A=S+N+T,P=w-b,k=gl(P),B=y+I+k,z=_-M,F=gl(z),Y=E+C+F,L=O*O,X=O*P,H=z*O,V=P*P,$=H+V;return{coeffs:[L,X,$],errBound:[2*A*T+gl(L),A*k+T*B+gl(X),Y*T+F*A+gl(H)+(2*k*B+gl(V))+gl($)].map(t=>vl*t)}}const xl=ot,bl=J;function wl(t){const[[n,e,r],[o,i,c]]=mc(t),s=xl(e,o),u=xl(n,i),f=xl(n,c),l=xl(r,o),a=xl(e,c),p=xl(r,i),h=ft(s,u),d=ft(l,f),g=ft(a,p),v=xl(h,h),m=xl(h,d),x=xl(h,g),b=xl(d,d);return[v,m,bl(x,b)]}const _l=ft,Ml=ot,Sl=nt,Nl=Ke,Il=ll,yl=ci,El=Kt,Cl=tr,Ol=Ls,Tl=J,Al=gt,Pl=2*Number.EPSILON,kl=Math.abs,Bl=Ye(1);function zl(t,n=!0){if(t.length<4)return[];const{coeffs:[e,r,o],errBound:[i,c,s]}=ml(t);if(kl(e)<=i){const[[n,e],[r,o],[i,c],[s,u]]=t,f=Tl(Nl(s,n),Sl(3,Nl(r,i))),l=Al(Il(i,n),-2*r),a=Tl(Nl(u,e),Sl(3,Nl(o,c))),p=Al(Il(c,e),-2*o);if(0===Jr(Ml(l,a),Ml(f,p)))return[]}const u=r*r,f=4*e*o,l=u-f,a=2*c*kl(r)+Bl*u+(4*(i*kl(o)+kl(e)*s)+Bl*kl(f))+Bl*kl(l);if(l<-a)return[];if(l>a){const{est:t,err:u}=function(t,n){if(t-n<=0){const e=t>0?Math.sqrt(t):0;return{est:e,err:Math.max(Math.sqrt(t+n)-e,e)}}const e=Math.sqrt(t),r=Math.sqrt(t-n),o=Math.sqrt(t+n);return{est:e,err:Math.max(Math.abs(r-e),Math.abs(o-e))}}(l,a);let f;f=r>=0?-r-t:-r+t;const p=c+u+Bl*kl(f),{est:h,err:d}=pl(f,2*e,p,2*i),{est:g,err:v}=pl(2*o,f,2*s,p);if(n){if(h+d<0||h-d>1||g+v<0||g-v>1)return[]}else if((h+d<0||h-d>1)&&(g+v<0||g-v>1))return[]}let[p,h,d]=wl(t);const g=_l(Ml(h,h),Sl(4,Ml(p,d))),v=lt(g);if(v<0)return[];if(v>0){const t=hl(jr(g));let e;p=jr(p),h=jr(h),d=jr(d),e=lt(h)>=0?yl(El(h,t)):El(yl(h),t);let r=it(Ol(e,Cl(p))),o=it(Ol(Cl(d),e));if(n){if(r<-Pl||r>1+Pl||o<-Pl||o>1+Pl)return[]}else if((r<-Pl||r>1+Pl)&&(o<-Pl||o>1+Pl))return[];return[r,o]=r<o?[r,o]:[o,r],r>=0-Pl&&r<=1+Pl?o>=0-Pl&&o<=1+Pl?[r,o]:[r]:o>=0-Pl&&o<=1+Pl?[o]:[]}const m=Nr(p);if(lt(h)*lt(m)<0)return[];if(Jr(fl(h),fl(m))>0)return[];const x=jr(h),b=jr(m),w=Ol(x,b),_=w[1]+w[0];return[_,_]}const Fl=Number.EPSILON;function Yl(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[6*(s-n+3*(r-i)),6*(i+n-2*r)],[6*(u-e+3*(o-c)),6*(c+e-2*o)]]}if(3===t.length){const[[n,e],[r,o],[i,c]]=t;return[[2*(i-2*r+n)],[2*(c-2*o+e)]]}if(t.length<=2)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3.")}function Ll(t){if(4===t.length)return 0===vu(t[0],t[1],t[2])&&0===vu(t[1],t[2],t[3])&&0===vu(t[0],t[2],t[3]);if(3===t.length)return 0===vu(t[0],t[1],t[2]);if(t.length<=2)return!0;throw new Error("The given bezier curve must be of order <= 3.")}function Xl(t){if(Ll(t))return{minima:[],maxima:[],inflections:[]};if(4===t.length&&ef(t)&&(t=Dc(t)),3===t.length){const n=function(t){const[[n,e],[r,o],[i,c]]=t,s=i-r,u=s-(r-n),f=c-o,l=f-(o-e);return[u*u+l*l,-(n*(u-r)-r*(s-r)+e*(l-o)-o*(f-o))]}(t);return{minima:[],maxima:Te(n,0,1)?.map(t=>t.t)||[],inflections:[]}}const n=function(t){const[[n,e,r],[o,i,c]]=ao(t),[[s,u],[f,l]]=Yl(t),[[a],[p]]=function(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[6*(s-n+3*(r-i))],[6*(u-e+3*(o-c))]]}if(t.length<=3)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3.")}(t),h=a*i,d=p*e,g=u*c,v=u*i,m=f*f,x=s*c,b=l*r,w=l*e,_=f*r,M=r*e,S=r*n,N=r*o,I=e*e,y=e*n,E=e*i,C=n*c,O=n*o,T=n*n,A=c*i,P=c*o,k=i*i,B=i*o,z=o*o,F=a*c-p*r,Y=u*r+l*c,L=g-b,X=r*r+c*c,H=E+C,V=P+k,$=S+I,D=e*o+n*i,q=T-z,j=y-B,W=M-A,Q=r*i+e*c,R=P+V,G=S+$,U=N+H,Z=E+H,J=G-R,K=H+C,tt=N+E+C,nt=2*w+_;return{inflectionPoly:[s*o-f*n,u*o+s*i-l*n-f*e,v+x-w-_,g-b],otherExtremaPoly:[T*(h-3*d)+z*(3*h-d)+2*(O*(a*e-p*i+3*(l*f-u*s))+3*s*f*j)+3*(D*(m-s*s)+q*(u*f+l*s)),a*(o*(G+3*V)+n*Z)-p*(r*(3*T+z)+e*(3*y+2*B)+n*R)+3*(u*(l*q-u*O+2*(f*j-s*D))+s*(2*l*j+f*(2*(S-P)+(I-k))-s*tt)+l*(l*O+2*f*D)+m*U),a*(2*r*D+e*K+i*(4*P+R))-p*(2*r*(3*y+B)+e*(I+2*P)+i*K)+3*(u*(2*(l*j-s*tt)+f*J-u*D)+s*(2*f*W-s*Q)+l*(l*D+2*f*U+s*J)+m*Q),a*(r*(N+2*H)+c*(I+3*V))-p*(r*(3*$+R)+c*Z)+3*(u*(l*J-u*U+2*(f*W-s*Q))+s*(r*(nt-s*c)-c*(2*l*i+f*c))+l*(l*H+r*(2*f*i+l*o))+f*c*nt),X*(h-d)+2*(M+A)*F-3*(Y*(v+x-w-_)+(u*e+s*r+l*i+f*c)*L),F*X-3*Y*L]}}(t),e=n.inflectionPoly,r=n.otherExtremaPoly,o=Te(r,0,1)?.map(t=>t.t)||[],i=function(t){const n=t.length-1;if(n<=0)return[];const e=new Array(n);for(let r=0;r<n;r++)e[r]=(n-r)*t[r];return e}(r),c=[],s=[];for(let t=0;t<o.length;t++){const n=o[t],r=R(i,n);R(e,n)*r>=0?c.push(n):s.push(n)}return{minima:c,maxima:s,inflections:Te(e,0,1)?.map(t=>t.t)||[]}}function Hl(t,n){const[e,r]=ao(t),[o,i]=Yl(t),c=R(e,n),s=R(r,n),u=R(o,n);return(c*R(i,n)-s*u)/Math.sqrt((c*c+s*s)**3)}const{abs:Vl}=Math,$l=L(function(t){const{curves:n}=t;let e=ho(n[0].ps).minY,r=n[0];for(let t=1;t<n.length;t++){const o=ho(n[t].ps).minY,i=o.box[0][1],c=e.box[0][1];(i<c||i===c&&o.ts[0]>e.ts[0])&&(e=o,r=n[t])}return{curve:r,y:e}});function Dl(t){const{curve:n,y:e}=$l(t),r=e.ts;return r[0]<=0?[cl(0,n,0),cl(1,n.prev,0)]:r[1]>=1?[cl(1,n,0),cl(0,n.next,0)]:[{x:{ri:{t:r[0],tS:r[0],tE:r[1],multiplicity:1},kind:0,box:e.box},curve:n},{x:{ri:{t:r[0],tS:r[0],tE:r[1],multiplicity:1},kind:0,box:e.box},curve:n}]}function ql(t,n,e){const r=e-(n-Math.floor(Math.log2(Math.abs(t))))+1;return r<=0?0:e>=53?t:wf(t,r)}function jl(t,n,e){const r=function(t,n){const e=[];for(const n of t)for(const t of n.curves)e.push(t);const r=du(e,t=>vo(t.ps)[0][0],t=>vo(t.ps)[1][0],function(t){return(n,e)=>{const r=n.ps,o=e.ps;if(2===r.length&&2===o.length)return function(t,n,e){let r=t.ps,o=n.ps;const i=vo(r),c=vo(o);if(t.next!==n&&n.next!==t){if(ko(!0,i,c)){const r=ol(t,n,e,!1);return r.length?r:void 0}return}if(n.next===t&&([t,n]=[n,t],[r,o]=[o,r]),0!==vu(r[0],r[1],o[1]))return;if(!ko(!1,i,c))return;let s;return s=mu(r[0],r[1])>mu(o[0],o[1])?[$r(Hr(r,o[1])[0].ri),1]:[0,$r(Hr(o,r[0])[0].ri)],[[cl(1,t,5),cl(0,n,5)],[cl(s[0],t,5),cl(s[1],n,5)]]}(n,e,t);if(n.next===e||e.next===n)return ko(!1,vo(r),vo(o))&&Zu(wu(r,!1),wu(o,!1),!1)?e.next===n?ol(e,n,t,!0):ol(n,e,t,!0):sl(n,e);let i=ko(!0,vo(r),vo(o));return i?(i=Zu(wu(r,!1),wu(o,!1),!0),i?ol(n,e,t,!1):void 0):void 0}}(n)),o=[];for(const t of r)for(const n of t.u)o.push(n);return o}(t,e),o=function(t){const n=[];for(const e of t)for(const t of e.curves){const e=t.ps,r=zl(e);if(0===r.length)continue;const o=r[0]===r[1]?3:2,i=r[0]-Fl,c=r[0]+Fl,s=r[1]-Fl,u=r[1]+Fl,f=Ge(e,[i,c]),l=Ge(e,[s,u]);n.push([{x:{ri:{t:i,tS:i,tE:c,multiplicity:1},box:f,kind:o},curve:t},{x:{ri:{t:s,tS:s,tE:u,multiplicity:1},box:l,kind:o},curve:t}])}return n}(t),i=function(t){const n=[];for(const e of t)for(const t of e.curves)n.push([cl(1,t,4),cl(0,t.next,4)]);return n}(t),{extremes:c,xs:s}=function(t){const n=new Map,e=[];for(const r of t){const t=Dl(r);e.push(t),n.set(r,t)}return{extremes:n,xs:e}}(t),u=function(t,n){const e=[];for(const r of n)for(const n of r.curves){const r=n.ps,o=Xl(r),{minima:i,maxima:c}=o,s=[0,1,...i,...c];for(let o of s)Vl(Hl(r,o))>1e7*2**-t&&e.push([cl(o,n,7),cl(o,n,7)])}return e}(e,t);let f=[...r,...o,...i,...s,...u];if("undefined"!=typeof _debug_){for(const t of r)_debug_.generated.elems.intersection.push(...t);for(const t of o)_debug_.generated.elems.intersection.push(...t);for(const t of i)_debug_.generated.elems.intersection.push(...t);for(const t of s)_debug_.generated.elems.intersection.push(...t);for(const t of u)_debug_.generated.elems.intersection.push(...t)}let l=f.map(t=>({xs:t,box:[[t[0].x.box[0][0]-n,t[0].x.box[0][1]-n],[t[0].x.box[1][0]+n,t[0].x.box[1][1]+n]],inOuts:void 0}));for(;;){const t=du(l,Wl,Ql,Bo);if(!t.length)break;const n=new Map;zo(n,t);const e=Lo(n),r=Xo(l,e);l=[...Ho(e),...r]}l=function(t){return t.filter(t=>{const n=t.xs;if(2===t.xs.length){const t=n[0];if(1===t.x.kind&&t.x.ri.multiplicity%2==0)return!1}for(const n of t.xs)if(4!==n.x.kind)return!0;return!1})}(l),l=function(t,n,e){const r=Math.log2(e)-3;return t.map(t=>{const e=t.box.map(t=>t.map(t=>ql(t,n,n-r)));return{...t,box:e}})}(l,e,n),"undefined"!=typeof _debug_&&(_debug_.generated.elems.container=l);let a=0;for(const t of l){for(const n of t.xs)n.container=t;let n;({inOuts:n,ioIdx:a}=hu(t,a)),t.inOuts=n}f=f.filter(t=>void 0!==t[0].container),function(t){const n=new Map;for(const e of t)for(const t of e){const e=t.curve.loop,r=n.get(e)||[];r.length||n.set(e,r),r.push(t)}for(const t of n){const n=t[1];if(!n||!n.length)continue;n.sort((t,n)=>{let e=t.curve.idx-n.curve.idx;return 0!==e?e:(e=t.x.ri.tS-n.x.ri.tS,0!==e?e:void 0!==t.in_?-1:1)});const e=n.length;for(let t=0;t<e;t++)n[t].next=n[(t+1)%e],n[t].prev=n[(t-1+e)%e]}}(f);for(const t of l)for(const n of t.inOuts){if(-1===n.dir)continue;const t=n;let e=t._x_;for(;e=e.next,void 0===e.in_;);t.nextOrPrev=e.in_,t.idx=t.nextOrPrev.idx}for(const t of l)for(const n of t.inOuts){if(1===n.dir)continue;const t=n;let e=t._x_;for(;e=e.prev,void 0===e.out;);t.nextOrPrev=e.out,t.idx=t.nextOrPrev.idx}return{extremes:c,containers:l}}function Wl(t){return t.box[0][0]}function Ql(t){return t.box[1][0]}function Rl(t,n,e){to(t,1);const r=t.inOuts,o=r[0],i=r[r.length-1],c=1===o.dir?o:i,s=i.dir,u=0===n.idx?new Set:1===n.orientation?n.loopsIdxs:new Set;return o.orientation=s,o.parent=n,o.windingNum=n.windingNum+s,o.loopsIdxs=new Set(u),o.children=new Set,1===s&&o.loopsIdxs?.add(e.idx),i.orientation=s,i.parent=n,i.windingNum=n.windingNum+s,i.loopsIdxs=new Set(u),i.children=new Set,1===s&&i.loopsIdxs?.add(e.idx),c}function Gl(t){if(!Ll(t))return!1;const n=t.map(t=>t[0]),e=t.map(t=>t[1]);return!(Ul(n)&&Ul(e))}function Ul(t){return function(t){for(let n=1;n<t.length;n++)if(t[n-1]>t[n])return!1;return!0}(t)||function(t){for(let n=1;n<t.length;n++)if(t[n-1]<t[n])return!1;return!0}(t)}function Zl(t,n){const e=n/Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[e*t[0],e*t[1]]}function Jl(t){for(let n=0;n<t.length-1;n++)for(let e=n+1;e<t.length;e++)if(t[n][0]===t[e][0]&&t[n][1]===t[e][1])return!1;return!0}const{abs:Kl}=Math;function ta(t,n,e){if(void 0!==t&&!sf(t)){if(2===t.length)return t;if(3===t.length){if(Jl(t))return Ll(t)?[t[0],t[2]]:t;if(ea(t[0],t[2]))return;return[t[0],t[2]]}if(Jl(t)){const r=na(t);if(void 0===r)return;return function(t,n){if(t===n)return!0;if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(t[e][0]!==n[e][0]||t[e][1]!==n[e][1])return!1;return!0}(r,t)?t:ta(r,n,e)}if(ea(t[0],t[3])){if(Ll(t))return;return t}if(Ll(t))return[t[0],t[3]];if(ea(t[0],t[1])&&ea(t[1],t[2])||ea(t[1],t[2])&&ea(t[2],t[3])||ea(t[0],t[1])&&ea(t[2],t[3]))return ta([t[0],t[t.length-1]],n,e);if(ea(t[0],t[2])||ea(t[1],t[3])||ea(t[1],t[2]))return t;if(ea(t[0],t[1])){if(mu(t[1],t[2])<4*n)return[t[0],t[2],t[2],t[3]];{const r=Zl(H(t[1],t[2]),2*n),o=j(t[1],r);return na([t[0],e(o),t[2],t[3]])}}if(ea(t[2],t[3])){if(mu(t[2],t[1])<4*n)return[t[0],t[1],t[1],t[3]];{const r=Zl(H(t[2],t[1]),2*n),o=j(t[2],r);return na([t[0],t[1],e(o),t[3]])}}}}function na(t){return Ll(t)?[t[0],t[3]]:ef(t)?Dc(t):t}function ea(t,n){return t[0]===n[0]&&t[1]===n[1]}function ra(t){return t}function oa(t,n,e,r=!1,o=!0){const i=function(t,n,e=!0){const r=2**t*2**-n,o=e?function(t,n){return e=>{const r=ql(e[0],t,n),o=ql(e[1],t,n);return r===e[0]&&o===e[1]?e:[r,o]}}(t,n):ra;return t=>{const n=[];for(let e=0;e<t.length;e++){let i=t[e].slice();const c=n[n.length-1],s=c?c[c.length-1]:o(t[0][0]);i[0]=s,i=i.map(t=>o(t)),Gl(i)&&(i=[i[0],i[i.length-1]]),i=ta(i,r,o),void 0!==i&&n.push(i)}const e=n.length;if(!e)return[];const i=n[e-1];return i[i.length-1]=n[0][0],n}}(e,n,o);let c=t.slice();return c=r?function(t,n,e,r=.02){const o=[];for(const i of t){const t=[];for(const o of i){const i=o.map(t=>t.map(t=>{let o,i=0,c=0,s=0;for(;!(++c>10);){i=(t+Math.random())*(1+(Math.random()-.7)*r),i=ql(i,e,n);const c=Sf(i);c>s&&(s=c,o=i)}return o}));t.push(i)}o.push(t)}return o}(c,n,e,1):c,c=c.map(i),c=c.filter(t=>t.length>0),c}const ia=L(t=>{let n=0;for(const e of t)for(const t of e)for(const e of t)for(const t of e){const e=Math.abs(t);e>n&&(n=e)}return n});function ca(t){let n=0;for(let e=0;e<=t.length-1&&0===t[e];e++)n++;return 0!==n&&(t=t.slice(n)),t}const{max:sa}=Math;function ua(t,n){const e=t.length-1,r=n.length-1;if(e<0||r<0)return[];const o=e+r,i=new Array(o+1).fill(0);for(let c=0;c<e+1;c++)for(let s=0;s<r+1;s++)i[o-(c+s)]+=t[e-c]*n[r-s];return ca(i)}function fa(t,n){const e=t.length-1,r=new Array(e+2);for(let n=0;n<e+1;n++)r[n]=t[n]/(e+1-n);return r[e+1]=n,r}const{min:la,max:aa}=Math;function pa(t,n){const e=t.length-1,r=n.length-1,o=aa(e,r),i=new Array(o+1),c=la(e,r);for(let s=0;s<=c;s++)i[o-s]=t[e-s]+n[r-s];for(let n=c+1;n<=e;n++)i[o-n]=t[e-n];for(let t=c+1;t<=r;t++)i[o-t]=n[r-t];return ca(i)}function ha(t){let n=0;for(const e of t){const[t,r]=uo(e),[o,i]=ao(e);n+=R(fa(pa(ua(t,i),Nn(ua(r,o))),0),1)}return n/2}function da(t){let n=0;for(let e=0;e<t.length-1;e++)n+=Dt(t[e],t[e+1]);return n}function ga(t){const[n,e]=t[0],[r,o]=t[t.length-1];let i,c;const s=da(t);if(256*mu(t[0],t[t.length-1])<s*s){const[r,o]=Ae(t,.5),s=Math.sqrt((r-n)*(r-n)+(o-e)*(o-e));i=(o-e)/s,c=(r-n)/s}else{const t=Math.sqrt((r-n)*(r-n)+(o-e)*(o-e));i=(o-e)/t,c=(r-n)/t}const u=function(t,n,e){const r=j(t[0].map(t=>-t));return go(t.map(t=>Q(-n,e,r(t))))}(t,i,c),[[f,l],[a,p]]=u,h=[u[0],[a,l],u[1],[f,p]],d=Q(i,c);return h.map(n=>j(t[0],d(n)))}function va(t){return{ps:t,ts:[0,1]}}const{atan2:ma}=Math,xa=Jt;function ba(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],c=tn(xa(i,e),xa(o,r))[1],s=Kt(xa(o,e),xa(i,r))[1];return ma(c,s)}const wa=tt,_a=ft,Ma=dt,Sa=lt,Na=ft,Ia=ot,ya=nt,Ea=Ke,Ca=ll,Oa=J,Ta=gt,Aa=Math.abs,Pa=Ye(1),ka={order:0,realOrder:0,collinear:!0,nodeType:"n/a"},Ba={order:1,realOrder:1,collinear:!0,nodeType:"n/a"},za={order:1,realOrder:0,collinear:!0,nodeType:"n/a"},Fa={order:2,realOrder:2,collinear:!1,nodeType:"n/a"},Ya={order:2,realOrder:2,collinear:!0,nodeType:"n/a"},La={order:2,realOrder:1,collinear:!0,nodeType:"n/a"},Xa={order:2,realOrder:0,collinear:!0,nodeType:"n/a"},Ha={order:3,realOrder:3,collinear:!1,nodeType:"crunode"},Va={order:3,realOrder:3,collinear:!1,nodeType:"acnode"},$a={order:3,realOrder:3,collinear:!1,nodeType:"cusp"},Da={order:3,realOrder:3,collinear:!1,nodeType:"explicit"},qa={order:3,realOrder:3,collinear:!0,nodeType:"n/a"},ja={order:3,realOrder:2,collinear:!1,nodeType:"n/a"},Wa={order:3,realOrder:2,collinear:!0,nodeType:"n/a"},Qa={order:3,realOrder:1,collinear:!0,nodeType:"n/a"},Ra={order:3,realOrder:0,collinear:!0,nodeType:"n/a"};const{abs:Ga,PI:Ua}=Math;function Za(t,n=[0,1]){if(t.length<=2)return 0;const[e,r]=n;if(e===r)return 0;if(3===t.length){const n=qe(t,e,r).ps,[[o,i],[c,s],[u,f]]=n;return ba([c-o,s-i],[u-c,f-s])}if(4===t.length){const n=Ve(t,e,r).ps,o=function(t){if(4===t.length)return ef(t)?function(t){if(!Ll(t))return!1;const[n,e,r,o]=t,[i,c]=n,[s,u]=e,[f,l]=r,[a,p]=o,h=_a(wa(Ma(s/4,f/4),3),Ma(i/4,a/4)),d=_a(wa(Ma(u/4,l/4),3),Ma(c/4,p/4));return 0===Sa(_a(Ma(i/2,a/2),h))&&0===Sa(_a(Ma(c/2,p/2),d))}(t)?sf(t)?Ra:Qa:Ll(t)?Wa:ja:Ll(t)?qa:function(t){const{coeffs:[n,e,r],errBound:[o,i,c]}=ml(t);if(Aa(n)<=o){const[[n,e],[r,o],[i,c],[s,u]]=t,f=Oa(Ea(s,n),ya(3,Ea(r,i))),l=Ta(Ca(i,n),-2*r),a=Oa(Ea(u,e),ya(3,Ea(o,c))),p=Ta(Ca(c,e),-2*o);if(0===Jr(Ia(l,a),Ia(f,p)))return Da}const s=e*e,u=4*n*r,f=s-u,l=2*i*Aa(e)+Pa*s+(4*(o*Aa(r)+Aa(n)*c)+Pa*Aa(u))+Pa*Aa(f);if(f<-l)return Va;if(f>l)return Ha;const[a,p,h]=wl(t),d=lt(Na(Ia(p,p),ya(4,Ia(a,h))));return d<0?Va:d>0?Ha:$a}(t);if(3===t.length)return Ll(t)?cf(t)?sf(t)?Xa:La:Ya:Fa;if(2===t.length)return sf(t)?za:Ba;if(1===t.length)return ka;throw new Error("The given bezier curve must be of order <= 3")}(n),[[i,c],[s,u],[f,l],[a,p]]=n,h=[s-i,u-c],d=[f-s,l-u],g=[a-f,p-l];if(0===d[0]&&0===d[1]||o.realOrder<=2)return ba(h,g);const v=ba(h,d)+ba(d,g);return"acnode"===o.nodeType||"cusp"===o.nodeType?v<=-Ua?v+2*Ua:v>=+Ua?v-2*Ua:v:v}throw new Error("The given bezier curve must be of order <= 3.")}const{round:Ja,PI:Ka}=Math;const{abs:tp,max:np,ceil:ep,log2:rp}=Math;function op(n,e,r={}){let o;"undefined"!=typeof _debug_&&(o=performance.now()),e=e||ia(n);const i=ep(rp(e)),{inclMicroCorners:c=!0,minLoopArea:s=(2**i*2**-12)**2,forceOrientationNegative:u=!1,booleanOp:f="OR",containerSizeMultiplier:l=16}=r,a=2**i*2**-46*l;(function(t){if("undefined"!=typeof _debug_)for(const n of t){_debug_.generated.elems.loopPre.push(...t),_debug_.generated.elems.loopsPre.push(t);for(const t of n){const n=vo(t),e=ga(t),r=wu(t,!1);_debug_.generated.elems.bezier_.push(t),_debug_.generated.elems.looseBoundingBox_.push(n),_debug_.generated.elems.tightBoundingBox_.push(e),_debug_.generated.elems.boundingHull_.push(r)}}})(n=oa(n,46,i,!1,!0)),n.sort(Co);const p=n.map((n,e)=>t(n,e)),{extremes:h,containers:d}=jl(p,a,i),g={dir:void 0,idx:0,parent:void 0,children:new Set,windingNum:0,p:void 0,_x_:void 0,container:void 0,loopsIdxs:new Set,orientation:-1},v=new Set,m=new Set;for(const t of p){if(v.has(t))continue;v.add(t);const n=Eo(g,t),e=h.get(t)[0].container;if(0===e.inOuts.length)continue;const r=Rl(e,n,t),o=2===e.inOuts.length&&2===e.xs.length;if(o&&e.inOuts[0].nextOrPrev===e.inOuts[1])r.bezierPieces=t.beziers.map(va),r.parent.children=r.parent.children||new Set,r.parent.children.add(r);else if(so(r,v,m,!1),o&&void 0!==r.bezierPieces){const{bezierPieces:t}=r,n=t[t.length-1],e=t[0];if(n.ps===e.ps){const r={ps:n.ps,ts:[n.ts[0],e.ts[1]]};t.shift(),t.pop(),t.unshift(r)}}}"undefined"!=typeof _debug_&&_debug_.verbose;const x=function(t){const n=[],e=[t];for(;e.length;){const t=e.pop();0===t.windingNum&&n.push(...t.children),e.push(...t.children),0===t.windingNum&&(t.children=new Set)}return n}(g);"undefined"!=typeof _debug_&&_debug_.verbose;const b=function(t){return n=>{const e="OR"===t||"XOR"===t?[n]:[];n.used="OR"===t||"XOR"===t;const r=Array.from(n.children);for(;r.length;){const n=r.pop();if("OR"===t&&0===n.windingNum&&e.push(n),"AND"===t){const t=Po(n);(0===n.windingNum&&t||To(n.windingNum)>=2&&!t)&&(e.push(n),n.used=!0)}if("XOR"===t){const t=Po(n);(0===n.windingNum&&t||To(n.windingNum)>=2&&t)&&(e.push(n),n.used=!0)}for(const t of n.children)r.push(t)}return e}}(f),w=x.map(b).filter(t=>0!==t.length).map(n=>{const e=n[0].orientation;return n.map((n,r)=>function(n,e,r,o){const i=n.bezierPieces?.map(io);if(void 0===i)return t([],r);const{orientation:c}=n,s=o?-1:e;return t((0===r?s:-s)*c>0?i:i.map(t=>t.toReversed()).toReversed(),r)}(n,e,r,u))}),_=[];for(let t=0;t<w.length;t++){const n=w[t].filter(t=>tp(ha(t.beziers))>s);n.length&&(n.sort((t,n)=>Co(t.beziers,n.beziers)),_.push(n))}"undefined"!=typeof _debug_&&(_debug_.generated.timing.simplifyPaths=performance.now()-o);const M=c?_:_.map(n=>n.map(n=>{const{beziers:e}=n,r=function(t,n){!function(t){Ja(function(t){const n=t.length;let e=0;for(let r=0;r<n;r++){const o=t[(r-1+n)%n],i=t[r];e+=Za(i,[0,1])+ba(po(o,1),po(i,0))}return e}(t)/(2*Ka))}(t);const e=t.map(t=>t.map(t=>[t[0],t[1]])).filter(t=>da(t)>n),r=e.length;for(let t=0;t<r;t++){const n=e[t],o=e[(t+1)%r],i=n[n.length-1],c=o[0];c[0]===i[0]&&c[1]===i[1]||(i[0]=c[0],i[1]=c[1])}return e}(e,np(...d.map(t=>tp(t.box[0][0]-t.box[1][0])),...d.map(t=>tp(t.box[0][1]-t.box[1][1]))));return t(r,n.idx)}));return function(t){if("undefined"!=typeof _debug_)for(const n of t)_debug_.generated.elems.loop.push(...n),_debug_.generated.elems.loops.push(n)}(M),M}const{max:ip,abs:cp}=Math;function sp(t){let n=0;for(let e=0;e<t.length-1;e++)n+=Dt(t[e],t[e+1]);return n}function up(t,n){if(0===n)return t[0];if(1===n)return t[t.length-1];if(4===t.length){const[[e,r],[o,i],[c,s],[u,f]]=t,l=e+(o-e)*n,a=o+(c-o)*n,p=l+(a-l)*n,h=r+(i-r)*n,d=i+(s-i)*n,g=h+(d-h)*n;return[p+(a+(c+(u-c)*n-a)*n-p)*n,g+(d+(s+(f-s)*n-d)*n-g)*n]}if(3===t.length){const[[e,r],[o,i],[c,s]]=t,u=e+(o-e)*n,f=r+(i-r)*n;return[u+(o+(c-o)*n-u)*n,f+(i+(s-i)*n-f)*n]}if(2===t.length){const[[e,r],[o,i]]=t;return[e+(o-e)*n,r+(i-r)*n]}if(1===t.length)return t[0];throw new Error("The given bezier curve must be of order <= 3.")}function fp(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],d=n[0],g=n[1],v=c-d,m=u-d,x=l-d,b=p-d,w=s-g,_=f-g,M=a-g,S=h-g,N=v*v,I=6*v*m,y=6*x*b,E=w*w,C=6*w*_,O=6*M*S,T=6*m*b+9*x*x,A=2*v*b+18*m*x,P=6*v*x+9*m*m,k=6*_*S+9*M*M,B=2*w*S+18*_*M,z=6*w*M+9*_*_;return[6*(b*b-y+(N-I)+T+(P-A)+(S*S-O+(E-C)+k+(z-B))),5*(y+5*I+3*A-2*(T+2*P+3*N)+(O+5*C+3*B-2*(k+2*z+3*E))),4*(T-3*(A-2*P)-5*(2*I-3*N)+(k-3*(B-2*z)-5*(2*C-3*E))),3*(A-2*(2*P-5*(I-2*N))+(B-2*(2*z-5*(C-2*E)))),2*(P-5*(I-3*N)+(z-5*(C-3*E))),I-6*N+(C-6*E)]}function lp(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=o[0],l=o[1],a=n[0],p=n[1],h=i-a,d=s-a,g=f-a,v=c-p,m=u-p,x=l-p,b=h*h,w=h*d,_=d*g,M=v*v,S=v*m,N=m*x,I=v*x+m*m*2,y=h*g+d*d*2;return[x*x+M+2*I-4*(N+S)+(g*g+b+2*y-4*(_+w)),3*(N-I+(3*S-M)+(_-y+(3*w-b))),I-3*(2*S-M)+(y-3*(2*w-b)),S-M+(w-b)]}function ap(t,n){const[[e,r],[o,i]]=t,[c,s]=n,u=e-c,f=o-c,l=r-s,a=i-s,p=u*f+l*a,h=l*l+u*u;return[f*f+a*a+(h-2*p),p-h]}const{sqrt:pp}=Math;function hp(t,n,e=!0){let r;if(4===t.length)r=fp(t,n);else if(3===t.length)r=lp(t,n);else{if(2!==t.length){if(1===t.length)return{p:t[0],t:0,d:Dt(t[0],n)};throw new Error("The given bezier curve must be of order <= 3.")}r=ap(t,n)}const o=Te(r,0,1)?.map(t=>t.t)||[];e&&(o.push(0),o.push(1));let i,c=Number.POSITIVE_INFINITY;for(const e of o){const r=up(t,e),o=mu(r,n);o<c&&(c=o,i={p:r,t:e,d:pp(o)})}return i}const{sqrt:dp}=Math;function gp(t){let n=Number.NEGATIVE_INFINITY;for(let e=0;e<t.length;e++){const r=t[e],o=Math.abs(r[0]),i=Math.abs(r[1]);o>n&&(n=o),i>n&&(n=i)}return n}function vp(t){return Math.max(t.hL+t.hEL,t.hR+t.hER)}function mp(t,n){const e=vp(t)-vp(n);return 0!==e?e:t.tS-n.tS}class xp{compare;heap=[];constructor(t){this.compare=t}insert(t){const n=this.heap;n.push(t);let e=n.length-1;for(;;){const r=(e-1-(e+1)%2)/2;if(-1===r)return;const o=n[r];if(this.compare(t,o)<0)break;n[r]=t,n[e]=o,e=r}}popMax(){const t=this.heap,n=t[0];return t[0]=t[t.length-1],t.length--,this.swimDown(),n}swimDown(){const t=this.heap,n=t.length;let e=0;for(;;){const r=2*e+1;if(r>=n)break;const o=2*e+2,i=o>=n||this.compare(t[r],t[o])>0?r:o,c=t[i],s=t[e];if(this.compare(s,c)>0)break;t[i]=s,t[e]=c,e=i}}swapMinOrMax(t){this.heap[0]=t,this.swimDown()}static getParentIdx(t){return(t-1-(t+1)%2)/2}static getLeftChild(t){return 2*t+1}static getRightChild(t){return 2*t+2}}const bp=Math.max;function wp(t,n,e,r=50){if(1===t.length)return hp(n,t[0]).d;if(1===n.length)return function(t,n){let e;if(4===t.length)e=fp(t,n);else if(3===t.length)e=lp(t,n);else{if(2!==t.length){if(1===t.length)return{p:t[0],t:0,d:Dt(t[0],n)};throw new Error("The given bezier curve must be of order <= 3.")}e=ap(t,n)}const r=Te(e,0,1)?.map(t=>t.t)||[];r.push(0),r.push(1);let o,i=Number.NEGATIVE_INFINITY;for(const e of r){const r=up(t,e),c=mu(r,n);c>i&&(i=c,o={p:r,t:e,d:dp(c)})}return o}(t,n[0]).d;if(2===t.length&&2===n.length){const e=hp(n,t[0]).d,r=hp(n,t[t.length-1]).d;return e>r?e:r}const o=bp(gp(t),gp(n));e=e||o/1e6;const[i,c]=_p(t,0,1),s={tS:0,tE:1,hL:hp(n,t[0]).d,hR:hp(n,t[t.length-1]).d,hEL:i,hER:c},u=new xp(mp);u.insert(s);let f=0,l=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(;;){const o=u.heap[0],{tS:i,tE:c,hL:s,hR:p}=o,h=(i+c)/2,[d,g]=_p(t,i,h),[v,m]=_p(t,h,c),x=up(t,h),b=Dt(x,hp(n,x).p),w=bp(s,b,p);if(w>a&&(a=w),l=vp(o),l-a<e)return a;if(f++>r)return a;const _={tS:i,tE:h,hL:s,hR:b,hEL:d,hER:g},M={tS:h,tE:c,hL:b,hR:p,hEL:v,hER:m};u.swapMinOrMax(_),u.insert(M)}}function _p(t,n,e){const r=(e+n)/2,o=A(t,n,r),i=A(t,r,e);return[sp(o),sp(i)]}function Mp(t,n=!1){const e=t;let r=e;const o=[];do{n&&r===e||x(r)||o.push(r),r=r.nextOnCircle}while(r!==e);return o}function Sp(t){const n=[],e=[t],r=new Set;for(;e.length>0;){const t=Vt(e.pop());if(0===t.length)continue;n.push(t);const o=t[0],i=t[t.length-1].next.prevOnCircle;r.add(o),r.add(i);const c=Mp(o,!0),s=Mp(i,!0),u=c.filter(t=>!r.has(t)),f=s.filter(t=>!r.has(t));for(const t of u)r.add(t);for(const t of f)r.add(t);e.push(...u,...f)}return n}const Np=-1;class Ip{datum;color=0;parent;extras;"-1";1;constructor(t){this.datum=t}}function yp(t){return!!t&&0===t.color}class Ep{compare;duplicatesAllowed;root;nodeCount;valueCount;constructor(t,n=!0,e){if(this.compare=t,this.duplicatesAllowed=n,this.root=void 0,this.nodeCount=0,this.valueCount=0,e)for(const t of e)this.insert(t)}isEmpty(){return!this.root}find(t){const n=this;let e=this.root;for(;e;){const r=n.compare(t,e.datum);if(0===r)return e;e=e[r>0?1:Np]}}toArrayInOrder(){const t=[];return function n(e){e&&(n(e[-1]),t.push(e.datum),void 0!==e.extras&&t.push(...e.extras),n(e[1]))}(this.root),t}insertMulti(t){const n=this;for(const e of t)n.insert(e)}insert(t){const n=this;n.root=function t(e,r){if(void 0===e)return n.valueCount++,n.nodeCount++,new Ip(r);const o=n.compare(r,e.datum);if(0===o&&(n.duplicatesAllowed?(n.valueCount++,void 0===e.extras?e.extras=[r]:e.extras.push(r)):e.datum=r),0!==o){const n=o>0?1:Np;e[n]=t(e[n],r),e[n].parent=e}return yp(e[1])&&!yp(e[-1])&&(e=Cp(Np,e)),yp(e[-1])&&yp(e[-1][-1])&&(e=Cp(1,e)),yp(e[-1])&&yp(e[1])&&Tp(e),e}(n.root,t),n.root.color=1,n.root.parent=void 0}remove(t,n=!1,e){const r=this;if(void 0===r.root)return;let o;const i=function t(i,c){const s=r.duplicatesAllowed&&void 0!==i.extras;let u=r.compare(c,i.datum);if(u<0&&!i[-1]||u>0&&!i[1])return i;if(u<0){yp(i[-1])||yp(i[-1][-1])||(i=Ap(i));const n=t(i[-1],c);return null===n?null:(i[-1]=n,i[-1]&&(i[-1].parent=i),Pp(i))}if(yp(i[-1])&&(i=Cp(1,i),u=r.compare(c,i.datum)),0===u&&!i[1]){if(s&&!n){if(void 0===e||!0===e(c,i.datum))return o=i.datum,i.datum=i.extras.pop(),r.valueCount--,0===i.extras.length&&(i.extras=void 0),i;{const t=i.extras;for(let n=0;n<t.length;n++)if(!0===e(c,t[n]))return o=t.splice(n,1)[0],r.valueCount--,0===t.length&&(i.extras=void 0),i;return null}}return void 0===e||!0===e(c,i.datum)?(o=i.datum,r.valueCount-=1+(s?i.extras.length:0),void r.nodeCount--):null}if(yp(i[1])||yp(i[1][-1])||(i=function(t){return Tp(t),yp(t[-1][-1])&&Tp(t=Cp(1,t)),t}(i),u=r.compare(c,i.datum)),0===u)if(s&&!n)if(void 0===e||!0===e(c,i.datum))o=i.datum,i.datum=i.extras.pop(),r.valueCount--,0===i.extras.length&&(i.extras=void 0);else{const t=i.extras;let n=!1;for(let s=0;s<t.length;s++)if(!0===e(c,t[s])){o=t.splice(s,1)[0],r.valueCount--,0===t.length&&(i.extras=void 0),n=!0;break}if(!n)return null}else{if(void 0!==e&&!0!==e(c,i.datum))return null;{r.valueCount-=1+(s?i.extras.length:0),o=i.datum;const t=r.getMinNode(i[1]);i.datum=t?.datum,r.duplicatesAllowed&&(i.extras=t?.extras),i[1]=Op(i[1]),r.nodeCount--}}else{const n=t(i[1],c);if(null===n)return null;i[1]=n}return i[1]&&(i[1].parent=i),Pp(i)}(r.root,t);return null!==i?(r.root=i,void 0!==r.root&&(r.root.color=1,r.root.parent=void 0),o):void 0}findBounds(t){const n=this;let e=n.root;const r=[void 0,void 0];if(void 0===e)return r;for(;e;){const o=n.compare(t,e.datum);o>=0?r[0]=e:r[1]=e,e=e[o>=0?1:Np]}return r}findBoundsExcl(t){const n=this,e=n.root,r=[void 0,void 0];return void 0===e||function e(o){for(;o;){const i=n.compare(t,o.datum);if(0===i)return e(o[-1]),void e(o[1]);i>0?r[0]=o:i<0&&(r[1]=o),o=o[i>0?1:Np]}}(e),r}findAll(t){const n=this;let e=this.root;for(;e;){const r=n.compare(t,e.datum);if(0===r)return[e.datum,...e.extras?e.extras:[]];e=e[r>0?1:Np]}return[]}getMinOrMaxNode(t){return n=>{if(void 0===n&&(n=this.root),n){for(;n[t];)n=n[t];return n}}}getMinNode=this.getMinOrMaxNode(Np);getMaxNode=this.getMinOrMaxNode(1);min(t){void 0===t&&(t=this.root);const n=this.getMinNode(t);if(void 0!==n)return n.datum}max(t){void 0===t&&(t=this.root);const n=this.getMaxNode(t);if(void 0!==n)return n.datum}}function Cp(t,n){const e=n[-t];return n[-t]=e[t],e[t]&&(e[t].parent=n),e[t]=n,n.parent=e,e.color=n.color,n.color=0,e}function Op(t){if(t[-1])return yp(t[-1])||yp(t[-1][-1])||(t=Ap(t)),t[-1]=Op(t[-1]),t[-1]&&(t[-1].parent=t),Pp(t)}function Tp(t){t.color=(t.color+1)%2,t[-1].color=(t[-1].color+1)%2,t[1].color=(t[1].color+1)%2}function Ap(t){if(Tp(t),yp(t[1][-1])){const n=Cp(1,t[1]);t[1]=n,n.parent=t,Tp(t=Cp(Np,t))}return t}function Pp(t){return yp(t[1])&&(t=Cp(Np,t)),yp(t[-1])&&yp(t[-1][-1])&&(t=Cp(1,t)),yp(t[-1])&&yp(t[1])&&Tp(t),t}function kp(t){const n=new Map;return h(t).forEach(function(t){const e=t.pointOnShape.curve.loop;let r=n.get(e);r||(r=new Ep(wn,!1),n.set(e,r)),r.insert(t)}),n}const{max:Bp}=Math;function zp(t,n=.125,e=50){let r=C(t.cpNode);for(;!x(r);)r=r.next;const o=Sp(r),i=new Set;for(let t=0;t<o.length;t++){const r=o[t];let c=0;for(;c<r.length;){const t=c;for(;(c++,c!==r.length)&&!(Fp(t,c,r,e)>n);)i.add(r[c])}}r=function(t,n){const e=n;do{if(t(n))return n;n=n.next}while(n!==e)}(x,r);for(const n of i)Mn(t=>2!==v(t)&&!t.isHoleClosing)(n)||B(n,t.meta);return{cpNode:r,meta:{...t.meta,cpTrees:kp(r)}}}function Fp(t,n,e,r){const o=[],i=Bt(e[t],e[n].next);for(;t<n+1;t++)o.push(wp(zt(e[t]),i,r));return Bp(...o)}function Yp(t){const n=[],e=h(t);for(const t of e)w(t)&&!t.isHoleClosing&&n.push(t);return n}const Lp=function(t,n,e){const r=t.get(n);return void 0!==r&&r.has(e)},Xp=function(t,n,e){let r=t.get(n);void 0===r&&(r=new Set,t.set(n,r)),r.add(e)};function Hp(t){let n=t,e=t.prevOnCircle;for(;x(e);)e=e.prevOnCircle;const r=[];do{x(n)||r.push(n),n=n.nextOnCircle}while(n!==e);return r}function Vp(t,n){const e=new Map,r=new Map;return N(t,function(t){const o=r.get(t)||n*t.pointOnShape.circle.radius,i=t.next,c=function(t,n,e=.4,r=16){if(4===n.length)return pn(t,n,e,r);if(3===n.length)return un(t,n,e,r);if(2===n.length)return qt(t,n);if(1===n.length)return 0;throw new Error("The given bezier curve must be of order <= 3.")}([0,1],zt(t)),s=i.pointOnShape.circle.radius;if(o-c>n*s)for(const t of m(i))if(r.set(t,o-c),!i.isHoleClosing){const{center:t}=i.pointOnShape.circle;Xp(e,t[0],t[1])}}),e}function $p(t,n){let e=0;"undefined"!=typeof _debug_&&(e=performance.now());const r=function(t){const n=h(t);return n.reduce(function(t,n){return t.pointOnShape.circle.radius>=n.pointOnShape.circle.radius?t:n},n[0])}(C(t.cpNode));!function(t,n){const e=Yp(n);for(;e.length;){const r=e.pop(),{center:o}=r.pointOnShape.circle;if(!Lp(t,o[0],o[1])||r.isIntersection)continue;let i=r.prevOnCircle,c=!1;for(;!c;){i=i.next;const{center:e}=i.pointOnShape.circle;if(Lp(t,e[0],e[1]))if(Yt(i,n))c=!0;else{if(1===Hp(i).length)continue;c=!0}else{for(;x(i.prevOnCircle);)i=i.prevOnCircle;c=!0}}if(c){const t=i.prevOnCircle;t.next=i,i.prev=t,t.nextOnCircle=i,i.prevOnCircle=t}}}(Vp(r,n),r);const o={cpNode:r,meta:{...t.meta,cpTrees:kp(r)}};return function(t){"undefined"!=typeof _debug_&&(_debug_.generated.timing.sats=performance.now()-t)}(e),o}const Dp={maxCurviness:.05,maxLength:40,applySat:!0,satScale:2,simplify:!0,simplifyTolerance:2**-4,minBezLength:2**-6,angleIncrement:15},qp={maxCurviness:{range:[.01,3],scaleByMaxCoordinate:!1},maxLength:{range:[1,1024],scaleByMaxCoordinate:!0},angleIncrement:{range:[.1,360],scaleByMaxCoordinate:!1},satScale:{range:[1,1/0],scaleByMaxCoordinate:!1},simplifyTolerance:{range:[2**-20,2**20],scaleByMaxCoordinate:!0},minBezLength:{range:[2**-20,2],scaleByMaxCoordinate:!0}};function jp(t){return[t[1],-t[0]]}function Wp(t,n){if(!Ot(n))return 0;const e=Ct(n);return e.isDull?-V(jp(e.tangents[0]),W(H(n.p,t))):0}function Qp(t){return t[0]*t[0]+t[1]*t[1]}function Rp(t,n,e){return t[0]*(n[1]*e[2]-n[2]*e[1])-t[1]*(n[0]*e[2]-n[2]*e[0])+t[2]*(n[0]*e[1]-n[1]*e[0])}function Gp(t){const n=t[0],e=t[1],r=t[2],o=Qp,i=.5*Rp([o(n),n[1],1],[o(e),e[1],1],[o(r),r[1],1]),c=.5*Rp([n[0],o(n),1],[e[0],o(e),1],[r[0],o(r),1]),s=Rp([n[0],n[1],1],[e[0],e[1],1],[r[0],r[1],1]);return[i/s,c/s]}function Up(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}const Zp=Ke,Jp=Kt,Kp=$n,th=Wn,nh=tr,eh=nr,rh=tn;function oh(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],[d,g]=n,v=Zp(c,d),m=Zp(u,d),x=Zp(l,d),b=Zp(p,d),w=Zp(s,g),_=Zp(f,g),M=Zp(a,g),S=Zp(h,g),N=th(v,v),I=Kp(6,th(v,m)),y=Kp(6,th(v,x)),E=nh(th(v,b)),C=Kp(9,th(m,m)),O=Kp(18,th(m,x)),T=Kp(6,th(m,b)),A=Kp(9,th(x,x)),P=Kp(6,th(x,b)),k=th(b,b),B=th(w,w),z=Kp(6,th(w,_)),F=Kp(6,th(w,M)),Y=nh(th(w,S)),L=Kp(9,th(_,_)),X=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lh(C,sh(3,lh(fh(S),M))),lh(O,sh(3,lh(fh(m),v)))),ch(lh(S,M),lh(m,v))]}const hh=Jt,dh=Kt,gh=xr;function vh(t,n){const[[e,r],[o,i]]=t,[c,s]=n,u=e-c,f=o-c,l=r-s,a=i-s,p=hh(u,u),h=hh(u,f),d=hh(f,f),g=hh(l,l),v=hh(l,a),m=hh(a,a),x=dh(h,v),b=dh(g,p);return[dh(dh(d,m),dh(b,gh(x))),tn(x,b)]}const mh=Z,xh=nt,bh=Sr,wh=Nr,_h=Z,Mh=nt,Sh=Sr;function Nh(t){const n=[];for(let e=0;e<t.length;e++)n.push(4*t[e]);return n}const Ih=Z,yh=Nr,Eh=Math.abs;function Ch(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=Eh(e[0]),s=Eh(e[1]),u=Eh(r[0]),f=Eh(r[1]),l=Eh(o[0]),a=Eh(o[1]),p=Eh(i[0]),h=Eh(i[1]),d=Eh(n[0]),g=Eh(n[1]),v=c+d,m=u+d,x=l+d,b=p+d,w=s+g,_=f+g,M=a+g,S=h+g,N=v*v,I=6*v*m,y=6*x*b,E=w*w,C=6*w*_,O=6*M*S,T=6*m*b+9*x*x,A=2*v*b+18*m*x,P=6*v*x+9*m*m,k=6*_*S+9*M*M,B=2*w*S+18*_*M,z=6*w*M+9*_*_;return[6*(b*b+y+(N+I)+T+(P+A)+(S*S+O+(E+C)+k+(z+B))),5*(y+5*I+3*A+2*(T+2*P+3*N)+(O+5*C+3*B+2*(k+2*z+3*E))),4*(T+3*(A+2*P)+5*(2*I+3*N)+(k+3*(B+2*z)+5*(2*C+3*E))),3*(A+2*(2*P+5*(I+2*N))+(B+2*(2*z+5*(C+2*E)))),2*(P+5*(I+3*N)+(z+5*(C+3*E))),I+6*N+(C+6*E)]}function Oh(t,n){const e=t[0],r=t[1],o=t[2],i=Eh(e[0]),c=Eh(e[1]),s=Eh(r[0]),u=Eh(r[1]),f=Eh(o[0]),l=Eh(o[1]),a=Eh(n[0]),p=Eh(n[1]),h=i+a,d=s+a,g=f+a,v=c+p,m=u+p,x=l+p,b=h*h,w=h*d,_=d*g,M=v*v,S=v*m,N=m*x,I=v*x+m*m*2,y=h*g+d*d*2;return[x*x+M+2*I+4*(N+S)+(g*g+b+2*y+4*(_+w)),3*(N+I+(3*S+M)+(_+y+(3*w+b))),I+3*(2*S+M)+(y+3*(2*w+b)),S+M+(w+b)]}function Th(t,n){const e=t[0],r=t[1],o=Eh(e[0]),i=Eh(e[1]),c=Eh(r[0]),s=Eh(r[1]),u=Eh(n[0]),f=Eh(n[1]),l=o+u,a=c+u,p=i+f,h=s+f,d=l*a+p*h,g=p*p+l*l;return[a*a+h*h+2*d+g,d+g]}const Ah=Math.abs;function Ph(t,n){if(0===n[0]&&0===n[1])return[0,0];if(0===n[0]&&1===n[1])return[0,0];const e=Ah(n[1]);if(4===t.length){const[[n,r],[o,i],[c,s],[u,f]]=t,l=Ah(n),a=Ah(r),p=Ah(o),h=Ah(i),d=Ah(c),g=Ah(s),v=l+(p+l)*e,m=p+(d+p)*e,x=v+(m+v)*e,b=a+(h+a)*e,w=h+(g+h)*e,_=b+(w+b)*e;return[x+(m+(d+(Ah(u)+d)*e+m)*e+x)*e,_+(w+(g+(Ah(f)+g)*e+w)*e+_)*e]}if(3===t.length){const[[n,r],[o,i],[c,s]]=t,u=Ah(n),f=Ah(r),l=Ah(o),a=Ah(i),p=u+(l+u)*e,h=f+(a+f)*e;return[p+(l+(Ah(c)+l)*e+p)*e,h+(a+(Ah(s)+a)*e+h)*e]}if(2===t.length){const[[n,r],[o,i]]=t,c=Ah(n),s=Ah(r);return[c+(Ah(o)+c)*e,s+(Ah(i)+s)*e]}if(1===t.length)return[0,0];throw new Error("The given bezier curve must be of order <= 3.")}Number.EPSILON;const kh=Number.EPSILON/2;function Bh(t){const n=t*kh;return n/(1-n)}Bh(1);const zh=Math.abs,Fh=[[0,0],[0,0]];const Yh=Number.EPSILON/2,Lh=Bh(1);function Xh(t,n){return n[0]!==n[1]?4===t.length?function(t,n){const{ps:e,_ps:r}=an(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=e[2][0],s=e[3][0],u=9*Yh*r[0][0],f=9*Yh*r[1][0],l=9*Yh*r[2][0],a=9*Yh*r[3][0],p=e[0][1],h=e[1][1],d=e[2][1],g=e[3][1],v=9*Yh*r[0][1],m=9*Yh*r[1][1],x=9*Yh*r[2][1],b=9*Yh*r[3][1],w=Math.min(o-u,i-f,c-l,s-a),_=Math.max(o+u,i+f,c+l,s+a);return[[w,Math.min(p-v,h-m,d-x,g-b)],[_,Math.max(p+v,h+m,d+x,g+b)]]}(t,n):3===t.length?function(t,n){const{ps:e,_ps:r}=Ut(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=e[2][0],s=5*Yh*r[0][0],u=5*Yh*r[1][0],f=5*Yh*r[2][0],l=e[0][1],a=e[1][1],p=e[2][1],h=5*Yh*r[0][1],d=5*Yh*r[1][1],g=5*Yh*r[2][1],v=Math.min(o-s,i-u,c-f),m=Math.max(o+s,i+u,c+f);return[[v,Math.min(l-h,a-d,p-g)],[m,Math.max(l+h,a+d,p+g)]]}(t,n):function(t,n){const{ps:e,_ps:r}=function(t,n,e){return 0===n?1===e?{ps:t,_ps:Fh}:function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=[[o,i],[n*(c-o)+o,n*(s-i)+i]],f=zh(n),l=zh(o),a=zh(c),p=zh(i);return{ps:u,_ps:[[0,0],[f*(a+l)+l,f*(zh(s)+p)+p]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=[[n*(c-o)+o,n*(s-i)+i],[c,s]],f=zh(n),l=zh(o),a=zh(c),p=zh(i);return{ps:u,_ps:[[f*(a+l)+l,f*(zh(s)+p)+p],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=r[0],c=r[1],s=o[0],u=o[1],f=[[n*(s-i)+i,n*(u-c)+c],[e*(s-i)+i,e*(u-c)+c]],l=zh(n),a=zh(e),p=zh(i),h=zh(s),d=zh(c),g=zh(u);return{ps:f,_ps:[[l*(h+p)+p,l*(g+d)+d],[a*(h+p)+p,a*(g+d)+d]]}}(t,n,e)}(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=3*Yh*r[0][0],s=3*Yh*r[1][0],u=e[0][1],f=e[1][1],l=3*Yh*r[0][1],a=3*Yh*r[1][1],p=Math.min(o-c,i-s),h=Math.max(o+c,i+s);return[[p,Math.min(u-l,f-a)],[h,Math.max(u+l,f+a)]]}(t,n):function(t,n){const e=t[0],r=t[t.length-1];if(0===n)return[e,e];if(1===n)return[r,r];const o=up(t,n);let i;if(4===t.length)i=Ph(t,[0,n]).map(t=>8*Lh*t);else if(3===t.length)i=Ph(t,[0,n]).map(t=>5*Lh*t);else if(2===t.length)i=Ph(t,[0,n]).map(t=>2*Lh*t);else if(1===t.length)return[o,o];return[[o[0]-i[0],o[1]-i[1]],[o[0]+i[0],o[1]+i[1]]]}(t,n[0])}const Hh=Z,Vh=Wn,$h=Kt,Dh=Number.EPSILON,{sqrt:qh}=Math;function jh(t,n,e,r){const[o,i]=r,c=n.ps;let{polyDd:s,polyE:u,getPolyExact:f}=function(t,n){const e=t.length-1;if(3===e)return{polyDd:oh(t,n),polyE:Ch(t,n).map(t=>20*t),getPolyExact:()=>function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],[d,g]=n,v=mh(c,d),m=mh(u,d),x=mh(l,d),b=mh(p,d),w=mh(s,g),_=mh(f,g),M=mh(a,g),S=mh(h,g),N=ot(v,v),I=xh(6,ot(v,m)),y=xh(6,ot(v,x)),E=bh(ot(v,b)),C=xh(9,ot(m,m)),O=xh(18,ot(m,x)),T=xh(6,ot(m,b)),A=xh(9,ot(x,x)),P=xh(6,ot(x,b)),k=ot(b,b),B=ot(w,w),z=xh(6,ot(w,_)),F=xh(6,ot(w,M)),Y=bh(ot(w,S)),L=xh(9,ot(_,_)),X=xh(18,ot(_,M)),H=xh(6,ot(_,S)),V=xh(9,ot(M,M)),$=xh(6,ot(M,S)),D=ot(S,S),q=J(T,A),j=J(E,O),W=J(y,C),Q=J(H,V),R=J(Y,X),G=J(F,L),U=ft(J(J(k,N),J(q,W)),J(J(j,P),I)),Z=ft(J(J(D,B),J(Q,G)),J(J(R,$),z)),K=xh(6,J(U,Z)),tt=J(wh(J(J(q,bh(W)),xh(3,N))),J(J(P,xh(3,j)),xh(5,I))),nt=J(wh(J(J(Q,bh(G)),xh(3,B))),J(J($,xh(3,R)),xh(5,z))),et=xh(5,J(tt,nt)),rt=J(J(q,xh(3,ft(bh(W),j))),xh(5,ft(xh(3,N),bh(I)))),it=J(J(Q,xh(3,ft(bh(G),R))),xh(5,ft(xh(3,B),bh(z)))),ct=xh(4,J(rt,it)),st=ft(j,bh(ft(bh(W),xh(5,ft(I,bh(N)))))),ut=ft(R,bh(ft(bh(G),xh(5,ft(z,bh(B)))))),lt=xh(3,J(st,ut)),at=ft(W,xh(5,ft(I,xh(3,N)))),pt=ft(G,xh(5,ft(z,xh(3,B))));return[K,et,ct,lt,bh(J(at,pt)),J(ft(I,xh(6,N)),ft(z,xh(6,B)))].map(Pn)}(t,n)};if(2===e)return{polyDd:ph(t,n),polyE:Oh(t,n).map(t=>16*t),getPolyExact:()=>function(t,n){const[[e,r],[o,i],[c,s]]=t,[u,f]=n,l=_h(e,u),a=_h(o,u),p=_h(c,u),h=_h(r,f),d=_h(i,f),g=_h(s,f),v=ot(l,l),m=ot(l,a),x=ot(l,p),b=ot(a,a),w=ot(a,p),_=ot(p,p),M=ot(h,h),S=ot(h,d),N=ot(h,g),I=ot(d,d),y=ot(d,g),E=ot(g,g),C=J(N,Sh(I)),O=J(x,Sh(b)),T=J(ft(J(_,Sh(O)),Nh(J(w,m))),v),A=J(ft(J(E,Sh(C)),Nh(J(y,S))),M),P=J(T,A),k=J(ft(w,O),ft(Mh(3,m),v)),B=J(ft(y,C),ft(Mh(3,S),M));return[P,Mh(3,J(k,B)),J(ft(C,Mh(3,ft(Sh(S),M))),ft(O,Mh(3,ft(Sh(m),v)))),J(ft(S,M),ft(m,v))].map(Pn)}(t,n)};if(1===e)return{polyDd:vh(t,n),polyE:Th(t,n).map(t=>12*t),getPolyExact:()=>function(t,n){const[[e,r],[o,i]]=t,[c,s]=n,u=Ih(e,c),f=Ih(o,c),l=Ih(r,s),a=Ih(i,s),p=ot(u,u),h=ot(u,f),d=ot(f,f),g=ot(l,l),v=ot(l,a),m=ot(a,a),x=J(h,v),b=J(g,p);return[J(J(d,m),J(yh(x),b)),ft(x,b)].map(Pn)}(t,n)};if(0===e)return{polyDd:[[0,1]],polyE:[0],getPolyExact:()=>[[1]]};throw new Error("The given bezier curve must be of order 1, 2 or 3")}(c,e);const l=Te(s,o,i,u,f)||[];l.push(Vr(o)),l.push(Vr(i));const a=l.map(r=>{const{tS:o,tE:i}=r,s=(o+i)/2,u=s<0?0:s>1?1:s,f=Xh(c,[o,i]),l=function(t){const n=t[0],e=t[1];return[(n[0]+e[0])/2,(n[1]+e[1])/2]}(f),a=function(t,n,e){const r=n[0],o=n[1],i=r[0],c=r[1],s=o[0],u=o[1],f=e[0],l=e[1];let a=1/0,p=-1/0;for(const[n,e]of[[i,c],[i,u],[s,c],[s,u]]){const r=Hh(n,f),o=Hh(e,l),i=$h(Vh(r,r),Vh(o,o))[1],c=i*(1-2**t*Dh),s=i*(1+2**t*Dh);c<=a&&(a=c),s>=p&&(p=s)}return[a,p]}(t,f,e),p=0===u?1:u;return{curve:0===u?n.prev:n,p:l,t:p,d:(qh(a[0])+qh(a[1]))/2,dSquaredI:a,box:f}});return a}const{min:Wh}=Math,Qh=1+2**-20;function Rh(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=n[0],f=n[1];return u<o?f<i?mu(t[0],n):f>s?mu([o,s],n):(o-u)**2:u>c?f<i?mu([c,i],n):f>s?mu(t[1],n):(u-c)**2:f<i?(i-f)**2:f>s?(f-s)**2:0}function Gh(t){const n=function(t){const n=t[0],e=t[t.length-1];let r,o;if(n[0]<e[0]?(r={ts:[0,0],box:[n,n]},o={ts:[1,1],box:[e,e]}):(r={ts:[1,1],box:[e,e]},o={ts:[0,0],box:[n,n]}),2===t.length)return{minX:r,maxX:o};const[i]=G(t),c=Te(i,0,1)||[];for(let n=0;n<c.length;n++){const e=c[n],i=[e.tS,e.tE],s=Xh(t,i);s[0][0]<r.box[0][0]&&(r={ts:i,box:s}),s[1][0]>o.box[0][0]&&(o={ts:i,box:s})}return{minX:r,maxX:o}}(t),e=function(t){const n=t[0],e=t[t.length-1];let r,o;if(n[1]<e[1]?(r={ts:[0,0],box:[n,n]},o={ts:[1,1],box:[e,e]}):(r={ts:[1,1],box:[e,e]},o={ts:[0,0],box:[n,n]}),2===t.length)return{minY:r,maxY:o};const[,i]=G(t),c=Te(i,0,1)||[];for(let n=0;n<c.length;n++){const e=c[n],i=[e.tS,e.tE],s=Xh(t,i);s[0][1]<r.box[0][1]&&(r={ts:i,box:s}),s[1][1]>o.box[0][1]&&(o={ts:i,box:s})}return{minY:r,maxY:o}}(t);return[[n.minX.box[0][0],e.minY.box[0][1]],[n.maxX.box[1][0],e.maxY.box[1][1]]]}const Uh=L(Gh);function Zh(t){const[n,e]=t[0],[r,o]=t[t.length-1];let i,c;const s=sp(t);if(256*mu(t[0],t[t.length-1])<s*s){const[r,o]=up(t,.5),s=Math.sqrt((r-n)*(r-n)+(o-e)*(o-e));i=(o-e)/s,c=(r-n)/s}else{const t=Math.sqrt((r-n)*(r-n)+(o-e)*(o-e));i=(o-e)/t,c=(r-n)/t}const u=function(t,n,e){const r=j(t[0].map(t=>-t));return Gh(t.map(t=>Q(-n,e,r(t))))}(t,i,c),[[f,l],[a,p]]=u,h=[u[0],[a,l],u[1],[f,p]],d=Q(i,c);return h.map(n=>j(t[0],d(n)))}function Jh(t,n){const e=[0,1,2,3].map(e=>function(t,n){const e=mu,r=n[0],o=n[1],i=e(r,o);if(0==i)return e(t,r);let c=((t[0]-r[0])*(o[0]-r[0])+(t[1]-r[1])*(o[1]-r[1]))/i;return c=Math.max(0,Math.min(1,c)),e(t,[r[0]+c*(o[0]-r[0]),r[1]+c*(o[1]-r[1])])}(n,[t[e],t[(e+1)%4]])),r=mu(t[0],t[1]),o=mu(t[0],t[3]);return e[0]<=o&&e[2]<=o&&e[1]<=r&&e[3]<=r?0:Math.min(...e)}const Kh=L(Zh);const td=Wn,nd=Kt,ed=tn,rd=Ke,od=$o;function id(t,n){return function(t,n){if(0===n[0]&&0===n[1])return t[0].map(t=>[0,t]);if(0===n[0]&&1===n[1])return t[t.length-1].map(t=>[0,t]);if(4===t.length){const[[e,r],[o,i],[c,s],[u,f]]=t,l=od(td(rd(o,e),n),e),a=od(td(rd(c,o),n),o),p=od(td(rd(u,c),n),c),h=nd(l,td(ed(a,l),n)),d=nd(a,td(ed(p,a),n)),g=nd(h,td(ed(d,h),n)),v=od(td(rd(i,r),n),r),m=od(td(rd(s,i),n),i),x=od(td(rd(f,s),n),s),b=nd(v,td(ed(m,v),n)),w=nd(m,td(ed(x,m),n));return[g,nd(b,td(ed(w,b),n))]}if(3===t.length){const[[e,r],[o,i],[c,s]]=t,u=nd([0,e],td(rd(o,e),n)),f=nd([0,o],td(rd(c,o),n)),l=nd(u,td(ed(f,u),n)),a=nd([0,r],td(rd(i,r),n)),p=nd([0,i],td(rd(s,i),n));return[l,nd(a,td(ed(p,a),n))]}if(2===t.length){const[[e,r],[o,i]]=t;return[od(td(rd(o,e),n),e),od(td(rd(i,r),n),r)]}if(1===t.length){const[n,e]=t[0];return[[0,n],[0,e]]}throw new Error("The given bezier curve must be of order <= 3.")}(t,[0,n]).map(t=>t[0]+t[1])}function cd(t,n,e){n=function(t,n){const e=function(t,n){let e=1/0;for(let r=0;r<t.length;r++){const o=t[r],{curve:{ps:i},ts:c}=o,s=up(i,c[0]),u=up(i,c[1]);e=Wh(e,mu(n,s),mu(n,u))}return Qh*e}(t,n);return t=function(t,n,e){const r=[];for(let o=0;o<t.length;o++){const i=t[o],{ps:c}=i.curve;Rh(Uh(c),n)<=e&&r.push(i)}return r}(t,n,e),t=function(t,n,e){const r=[];for(let o=0;o<t.length;o++){const i=t[o],c=i.curve.ps;Jh(Kh(c),n)<=e&&r.push(i)}return r}(t,n,e),t}(n,e);const r=[];for(let o=0;o<n.length;o++){const i=n[o],c=jh(t,i.curve,e,i.ts);r.push(...c)}let o=1/0;for(let t=0;t<r.length;t++){const n=r[t].dSquaredI[1];n<o&&(o=n)}const i=[];for(let t=0;t<r.length;t++){const n=r[t];n.dSquaredI[0]<=o&&i.push(n)}return i.map(t=>{const{curve:n,t:e}=t,{ps:r}=n;return{p:id(r,e),t:e,curve:n,isSource:!1}})}function sd(t,n,e){return e.map(e=>cd(t,e,n)[0])}function ud(t,n){return[n*t[0],n*t[1]]}function fd(t,n,e,r){const o=Up(r);let i,c,s,u,f=1,l=0;do{c=j(ud(r,f),e),s=sd(t,c,n),u=Up(H(c,Gp(s.map(t=>t.p)))),i=u<o,f/=2,l++}while(!i&&l<3);return{newX:c,newV:u,newPoss:s}}const{min:ld,abs:ad,asin:pd}=Math;function hd(t,n,e,r,o){const i=2**(o-32),c=[t[0],t[n],t[t.length-1]],s=[r[0],r[n],r[t.length-1]],u=[[c[0],c[1],c[2]],[c[1],c[2],c[0]],[c[2],c[0],c[1]]][e],f=[[s[0],s[1],s[2]],[s[1],s[2],s[0]],[s[2],s[0],s[1]]][e];if(_(u[0][0]))return;let l,a=0,p=function(t,n,e){const r=n[0][0].pointOnShape.circle.center,o=cd(t,e[1],r)[0];return Gp([n[0][0].pointOnShape.p,o.p,n[2][1].pointOnShape.p])}(o,u,f),h=1/0;for(;h>i&&a<10;){if(a++,l=sd(o,p,f),!Number.isFinite(p[0])||!Number.isFinite(p[1]))return;const t=Gp(l.map(t=>t.p)),n=H(p,t);if(!Number.isFinite(n[0])||!Number.isFinite(n[1]))return;const e=fd(o,f,p,n);p=e.newX,l=e.newPoss;const r=Up(n);h=ad(r-e.newV)}const d=(Dt(p,l[0].p)+Dt(p,l[1].p)+Dt(p,l[2].p))/3,g={center:p,radius:d};let v=0;for(let t=0;t<3;t++){const n=l[t],e=W(H(n.p,p)),r=$(e);if(Ot(n)&&Ct(n).isDull){const t=Et(n.curve.ps,n.curve.next.ps).tangents.map($),r=pd(D(t[0],e)),o=pd(D(e,t[1]));let i=0;r>0&&(i+=r),o>0&&(i+=o),v+=i}else{const t=W(U(n.curve.ps,n.t));v+=ad(pd(D(r,t)))}}const m=[];for(let t=0;t<r.length;t++){const n=cd(o,r[t],p)[0];m.push(Dt(n.p,p))}const x=ld(...m);return{threeProngInfo:{poss:l,circle:g,δ3s:u},error:1*ad(d-x)+1*v}}function dd(t){let n=t[0];const e=t[1],r=[];let o=!0;do{const t=n.pointOnShape,e=n.next.pointOnShape,i=t.curve,c=e.curve;if(o)if(o=!1,c===i&&bn(e,t)>0)r.push({curve:i,ts:[t.t,e.t]}),n=n.next;else{if(i.loop===c.loop){const n={curve:i,ts:[t.t,1]};r.push(n),gd(r,i,c,e.t)}n=n.next}else o=!0,n=n.prevOnCircle}while(n!==e);return r}function gd(t,n,e,r){let o=n;do{o=o.next;const n=o===e?r:1;t.push({curve:o,ts:[0,n]})}while(o!==e)}function vd(t,n,e,r){const o={...n,order:e,order2:r},i=t.findBounds({pointOnShape:o});if(void 0!==i[0]||void 0!==i[1])return void 0===i[0]||void 0===i[1]?t.max(t.root):i[0].datum}function md(t,n,e,r,o,i,c){if(void 0!==i&&!function(t,n,e){const r=bn(n,e.pointOnShape);if(r<0)return!0;if(0===r)return!1;const o=t.getMinNode();if(void 0===o)return!0;const i=o.datum;return bn(t.getMaxNode().datum.pointOnShape,n)<0&&i===e}(r,o,i.next)&&!t)return;const s={pointOnShape:o,isHoleClosing:n,isIntersection:e,id:c.id,next:void 0,prev:void 0,nextOnCircle:void 0,prevOnCircle:void 0};c.id++;const u=void 0===i?s:i,f=void 0===i?s:u.next;return f.prev=s,u.next=s,s.prev=u,s.next=f,r.insert(s),s}function xd(t,n,e,r,o,i,c){const{cpTrees:s}=o;let u=!1;const f=i.map((i,f)=>{const l=r[f],a=s.get(i.curve.loop),p={...i,circle:e,order:l,order2:0},h=void 0===c?vd(a,i,l,0):c[f],d=md(t,n,!1,a,p,h,o.lastInsertId);return void 0===d&&(u=!0),d});return u||function(t,n){n=n.slice().sort(function(t){const n=t.center;return function(t,e){let r=t.pointOnShape.p,o=e.pointOnShape.p;r=[r[0]-n[0],r[1]-n[1]],o=[o[0]-n[0],o[1]-n[1]];const i=Math.atan2(r[1],r[0]);return Math.atan2(o[1],o[0])-i}}(t));const e=n.length;for(let t=0;t<e;t++){const r=n[t];r.nextOnCircle=n[(t+1)%e],r.prevOnCircle=n[(t-1+e)%e]}}(e,f),{anyFailed:u,cpNodes:f}}const bd=Math.cos(Math.PI/180*1);function wd(t,n,e,r,o,i){const{cpTrees:c,maxCoordPowerOf2:s}=t,u=2**(s-40),f=2**(s-46),l=vd(c.get(n.curve.loop),n,r,o);if(!l)return;const a=[l,l.next],{p,t:h}=n;for(const t of a){const n=t.pointOnShape.p,r=Dt(p,n);if(!(r>u)&&(V(W(H(n,t.pointOnShape.circle.center)),W(H(p,e.center)))>bd||r<f&&0!==h&&1!==h))return t}}function _d(t,n){const e=[];for(const t of n)e.push([t,t.next]);const r=function(t,n){const e=t.map(dd);let r,o=1/0;for(let i=1;i<t.length-1;i++)for(let c=0;c<3;c++){const s=hd(t,i,c,e,n);if(void 0===s)continue;const{error:u,threeProngInfo:f}=s;u<o&&(o=u,r=f)}return r}(e,t.maxCoordPowerOf2),{circle:o,poss:i,δ3s:c}=r,s=[];for(let t=0;t<3;t++)s.push(Wp(o.center,i[t]));const u=[];for(let n=0;n<i.length;n++){const e=wd(t,i[n],o,s[n],0);void 0!==e&&v(e)<=2&&!e.isHoleClosing&&u.push(e)}return{closeBysFor3Prong:u,cpNodes:0===u.length?xd(!0,!1,o,s,t,i,c.map(t=>t[0])).cpNodes:[]}}let Md=0;function Sd(t,n){if(Tt(n.pointOnShape))return{closeBysFor3Prong:void 0,addedCpNodes:[]};const e=[];for(;;){if(void 0===n)continue;const r=S(n);if(r.length<=2)break;const{closeBysFor3Prong:o,cpNodes:i}=_d(t,r);if(e.push(i),o.length>0)return{closeBysFor3Prong:o,addedCpNodes:e};if("undefined"!=typeof _debug_&&++Md===_debug_.directives.stopAfterThreeProngsNum)return}return{closeBysFor3Prong:void 0,addedCpNodes:e}}function Nd(t){for(const n of t)return n}function Id(t,n,e,r){for(const o of[n[0]])m(o).forEach(t=>{e.delete(t),r.delete(t)}),B(o,t)}function yd(t,n,e){const r=new Map;for(let o=0;o<n.length;o++){const i=new Ep(wn,!1);r.set(t[o],i);const c=n[o];let s,u;for(const t of c){const n={center:t.p,radius:0},{curve:r}=t,o={...t,curve:r,t:1,circle:n,order:-1,order2:0},c={...t,curve:r.next,t:0,circle:n,order:1,order2:0};s=md(!0,!1,!1,i,o,u,e),u=md(!0,!1,!1,i,c,s,e),s.prevOnCircle=u,u.prevOnCircle=s,s.nextOnCircle=u,u.nextOnCircle=s}}return r}const Ed=xu;let Cd;function Od(t,n){Cd=performance.now()}function Td(t){const n=[],e=[],r=[],o=[],i=[];for(const c of t)for(const t of c.curves){const c=t.ps,s=Ed(c,!0);r.push(s);const u=Uh(c);n.push(u);const f=Zh(c);e.push(f);const l=Et(t.ps,t.next.ps);l.isQuiteSharp?o.push(t):l.isQuiteDull&&i.push(t)}return{looseBoundingBoxes:n,tightBoundingBoxes:e,boundingHulls:r,sharpCorners:o,dullCorners:i}}function Ad(t){return n=>{const e=[];for(let r=0;r<n.curves.length;r++){const o=n.curves[r];sp(o.ps)<t||Et(o.ps,o.next.ps).isQuiteSharp&&e.push({curve:o,t:1,isSource:!0,p:id(o.ps,1)})}return e}}function Pd(t,n){const e=t.length-1,r=[t[0]];for(let o=1;o<e;o++)r.push(t[o]+n*r[o-1]);return r}function kd(t,n,e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*A+N*P+I*O+y*T,X=S*b+N*w+I*A+y*P+E*O+C*T,H=I*b+y*w+E*A+C*P,V=E*b+C*w,$=2*(i*_+c*M),D=2*(i*S+c*N),q=2*(i*I+c*y),j=2*(i*E+c*C),W=_*_+M*M,Q=2*(_*S+M*N),R=2*(_*I+M*y)+(S*S+N*N),G=2*(_*E+M*C)+2*(S*I+N*y),U=2*(S*E+N*C)+(I*I+y*y),Z=2*(I*E+y*C),J=E*E+C*C;return{A:[$,D,q,j],B:[W,Q,R,G,U,Z,J],C:[k,B,z],D:[F,Y,L,X,H,V],H:[$*F-W*k,$*Y+D*F-(W*B+Q*k),$*L+D*Y+q*F-(W*z+Q*B+R*k),$*X+D*L+q*Y+j*F-(Q*z+R*B+G*k),$*H+D*X+q*L+j*Y-(R*z+G*B+U*k),$*V+D*H+q*X+j*L-(G*z+U*B+Z*k),D*V+q*H+j*X-(U*z+Z*B+J*k),q*V+j*H-(Z*z+J*B),j*V-J*z]}}],{sqrt:zd,abs:Fd,max:Yd}=Math;function Ld(t,n,e,r,o,i){const{curve:c,ts:[s,u]}=i,{ps:f}=c,{curve:l,t:a,p}=e,h=0===o&&c===l,d=[];let g,v=!1,m=!1;if(s!==u){const{A:e,B:o,C:i,D:l,H:x}=function(t,n,e){if(1===e.length){const{a0:r,b0:o}=kd(t,n,e[0]);return{A:[r],B:[o],C:[],D:[],H:[]}}return Bd[e.length](t,n,e)}(p,n,f),b=h?Pd(x,a):void 0,w=r&&h?Pd(b,a):void 0;g=Te((r&&h?Pd(w,a):void 0)??b??x,s,u)||[];for(let r=0;r<g.length;r++){const f=g[r],{tS:a,tE:h,t:x}=f;if(f.multiplicity>1)continue;if(h<s||a>u)continue;const b=x<0?0:x>1?1:x,w=R(e,b),_=R(o,b),M=R(i,b),S=R(l,b),N=Fd(w),I=Fd(M);if(Yd(N,I)<2**-40)continue;const y=N>I?-_/w:-S/M;if(y<=0)continue;const E=[y*n[0],y*n[1]],C=zd(Qp(E));if(C<=2**(t-40))continue;const O=[p[0]+E[0],p[1]+E[1]];f.tS<=s&&f.tE>=s&&(v=!0),f.tS<=u&&f.tE>=u&&(m=!0);const T=0===b?1:b,A={curve:0===b?c.prev:c,s:T,d:C,x:O};d.push(A)}}const x=f[f.length-1];let b=0===a&&c===l.prev||1===a&&c===l;const w=[];if(0===s);else if(1===s)b||v||w.push({P:x,t:1});else if(!v){const t=up(f,s);w.push({P:t,t:s})}if(s!==u)if(0===u);else if(1===u)b||m||(w.push({P:x,t:1}),b=!0);else if(!m){const t=up(f,u);w.push({P:t,t:u})}for(let t=0;t<w.length;t++){const{P:e,t:r}=w[t],{a0:o,b0:i}=kd(p,n,e);if(Fd(o)<=2**-40||Fd(i)<=2**-40)continue;const s=-i/o;if(s<2**-40)continue;const u=[s*n[0],s*n[1]],f=zd(Qp(u)),l=[p[0]+u[0],p[1]+u[1]],a=0===r?1:r,h={curve:0===r?c.prev:c,s:a,d:f,x:l};d.push(h)}return d}const{abs:Xd}=Math,Hd=1+2**-20;function Vd(t,n){const[e,r]=t,[o,i]=n,c=Ke(e,o),s=Ke(r,i);return Kt(Wn(c,c),Wn(s,s))[1]}const $d=1+2**-20,Dd=L(Zh),qd=Jt,jd=Kt,Wd=tn,Qd=function(t,n){const e=n[0],r=n[1],o=r*t,i=Vn*r,c=i-(i-r),s=r-c,u=Vn*t,f=u-(u-t),l=t-f,a=e*t,p=o+a,h=a-(p-o)+(s*l-(o-c*f-s*f-c*l)),d=p+h;return[h-(d-p),d]},{acos:Rd}=Math;function Gd(t,n){let e=[0,0];for(let r=0;r<t.length;r++)e=Kt(t[r],$n(n,e));return e}const Ud=ll,Zd=Ke,Jd=$n,Kd=Kt,tg=$o;function ng(t){if(4===t.length)return function(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[Jd(3,Kd(Zd(s,n),Jd(3,Zd(r,i)))),Jd(6,tg(Ud(i,n),-2*r)),Jd(3,Zd(r,n))],[Jd(3,Kd(Zd(u,e),Jd(3,Zd(o,c)))),Jd(6,tg(Ud(c,e),-2*o)),Jd(3,Zd(o,e))]]}(t);if(3===t.length)return function(t){const[[n,e],[r,o],[i,c]]=t;return[[tg(Ud(2*i,2*n),-4*r),Zd(2*r,2*n)],[tg(Ud(2*c,2*e),-4*o),Zd(2*o,2*e)]]}(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t;return[[Zd(r,n)],[Zd(o,e)]]}(t);if(1===t.length)return[[[0,0]],[[0,0]]];throw new Error("The given bezier curve must be of order <= 3.")}const eg=Ke,rg=Kt,og=$n,ig=$o;function cg(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[og(6,rg(eg(s,n),og(3,eg(r,i)))),og(6,ig(eg(i,2*r),n))],[og(6,rg(eg(u,e),og(3,eg(o,c)))),og(6,ig(eg(c,2*o),e))]]}if(3===t.length){const[[n,e],[r,o],[i,c]]=t;return[[ig(eg(2*i,4*r),2*n)],[ig(eg(2*c,4*o),2*e)]]}if(t.length<=2)return[[[0,0]],[[0,0]]];throw new Error("The given bezier curve must be of order <= 3.")}const sg=Wn,ug=Kt,fg=tn;const{sqrt:lg}=Math;function ag(t,n,e){const{curve:r,p:o,t:i}=n,{ps:c}=r,s=1/t,u=-function(t,n){const[e,r]=function(t,n){const[e,r]=ng(t),[o,i]=cg(t),c=Gd(e,n),s=Gd(r,n),u=Gd(o,n),f=Gd(i,n),l=fg(sg(c,f),sg(s,u)),a=ug(sg(c,c),sg(s,s));return[l,hl(sg(a,sg(a,a)))]}(t,n);return Ls(e,r)}(c,i)[1],f=u<s?s:u,[l,a]=e,p=lg(l*l+a*a)*f;return[[o[0]+l/p,o[1]+a/p],1/f]}const{sqrt:pg}=Math,{sin:hg,cos:dg,max:gg,sqrt:vg}=Math;function mg(t){const{loops:n,maxCoordPowerOf2:e,squaredDiagonalLength:r}=t,o=(2**(e-21))**2,i=2**(e-46),c=vg(r),s=2**(e-32);return function(r,u,f,l){const{curve:{loop:a,ps:p},t:h,p:d}=l,g=function(t,n){const[e,r]=ng(t),o=Gd(r,n);return[[-o[0],-o[1]],Gd(e,n)]}(p,h),v=[-g[0][1],-g[1][1]],m=r?[0,-c]:0!==f?Q(hg(f),dg(f))(v):v;let[x,b]=function(t,n,e,r,o){let i,c;const{p:s}=r;if(n)return[[s[0],s[1]-e],e];if(0===t)return ag(e,r,o);const{p:u}=r,[f,l]=o,a=e/pg(f*f+l*l),p=[f*a,l*a];return i=[u[0]+p[0],u[1]+p[1]],c=e,[i,c]}(f,r,c,l,m);const w=function(t,n,e,r,o,i,c){const{cpTrees:s}=o;if(n)return r.filter(t=>t!==e).flatMap(t=>t.curves.map(t=>({curve:t,ts:[0,1]})));const u=Ot(i)&&Ct(i).isDull?1===i.t&&0===t?-1:0===i.t?1:Wp(c,i):0,f=vd(s.get(e),i,u,0);return f&&f!==f.next.next?dd([f,f]):e.curves.map(t=>({curve:t,ts:[0,1]}))}(f,r,a,n,t,l,x),_=function(t,n,e,r){let o=1/0,i=[e[0]+r[0],e[1]+r[1]];for(let t=0;t<n.length;t++){const c=n[t],{ps:s}=c.curve,u=s[0],f=s[s.length-1];for(const t of[u,f]){if(mu(i,t)>o)continue;const{a0:n,b0:c}=kd(e,r,t);if(Xd(n)<=2**-40||Xd(c)<=2**-40)continue;const s=-c/n;if(s<2**-40)continue;const u=[s*r[0],s*r[1]],f=Qp(u);f<o&&(o=f,i=[e[0]+u[0],e[1]+u[1]])}}return Hd*o}(0,w,d,m),M=vg(_);if(u&&b<(1-s)*M)return void function(t,n,e,r){if(Ot(r)&&Ct(r).isDull)return;const o={radius:n,center:e};if(wd(t,r,o,Wp(o.center,r),0))return;const{anyFailed:i,cpNodes:c}=xd(!1,!1,o,[-.5,.5],t,[r,r])}(t,b,x,l);const S=vg(m[0]**2+m[1]**2);x=[d[0]+m[0]/S*M,d[1]+m[1]/S*M],function(t,n,e){if(t.length<=2)return t;let r=0;for(let o=0;o<t.length;o++){const i=t[o],{ps:c}=i.curve;Rh(Uh(c),n)<=$d*e&&Jh(Dd(c),n)<=$d*e&&(t[r]=i,r++)}t.length=r}(w,x,_);const N=function(t,n,e,r,o,i){const c=[];for(let s=0;s<i.length;s++){const u=Ld(t,n,e,r,o,i[s]);c.push(...u)}let s=1/0;for(let t=0;t<c.length;t++){const n=c[t].d*(1+2**-46);n<s&&(s=n)}const u=[];for(let t=0;t<c.length;t++){const n=c[t];n.d*(1-2**-46)<=s&&u.push(n)}return u}(e,m,l,u,f,w);if(1!==N.length){if(0===N.length)return;if(!function(t){const{curve:n,s:e}=t[0];for(let r=1;r<t.length;r++){const{curve:o,s:i}=t[r];if(n!==o||e!==i)return!1}return!0}(N))return}const{x:I,d:y,curve:E,s:C}=N[0],O={curve:E,t:C,isSource:!1,p:id(E.ps,C)},T={center:I,radius:y},A=Vd(l.p,O.p),P=Vd(I,O.p);if(!r){if(0===A)return;if(A<=gg(function(t,n,e){if(n+e>=t)return 1/0;const r=Ke(t,n),o=Qd(n,r),i=t-n,c=n*i,s=(c-n*e-e*e/2)/(c+i*e),u=Ls(Wd(Wd(o,qd(n,e)),qd(e,e/2)),jd(o,Qd(e,r)))[1];return Rd(s),n*Rd(u)}(b,vg(P),4*i),o))return}return{circle:T,z:O}}}function xg(t,n,e,r,o){e=0===e.t?{...e,curve:e.curve.prev,t:1}:e;const i=Wp(n.center,e),c=Wp(n.center,r),s={...r,circle:n,order:c,order2:0},u={...e,circle:n,order:i,order2:0};if(wd(t,e,n,i,0))return;if(wd(t,r,n,c,0))return;const{anyFailed:f,cpNodes:l}=xd(o,o,n,[i,c],t,[u,s]);if(!f)return o&&function(t,n){const{cpTrees:e}=t,[r,o]=n,i=o.pointOnShape,c=md(!0,!0,!1,e.get(i.curve.loop),{...i,order2:1},o,t.lastInsertId);c.holeCloserTwin=o,o.holeCloserTwin=c;const s=r.pointOnShape,u=md(!0,!0,!1,e.get(s.curve.loop),{...r.pointOnShape,order2:-1},r.prev,t.lastInsertId);u.holeCloserTwin=r,r.holeCloserTwin=u,u.prevOnCircle=c,u.nextOnCircle=c,c.prevOnCircle=u,c.nextOnCircle=u,o.next=r,r.prev=o,u.next=c,c.prev=u}(t,l),l[0];l.forEach(n=>{void 0!==n&&k(n,t)})}const{PI:bg,atan2:wg}=Math;function _g(t,n,e,r){let o;const i=mg(t),c=n*bg/180;for(let n=0;n<e.length;n++){const s=e[n],u=Mg(c,s);for(const e of u){const c=i(!1,r,e,s);if(c){const{circle:n,z:e}=c,r=xg(t,n,s,e,!1);o=o||r}if("undefined"!=typeof _debug_&&n+1===_debug_.directives.stopAfterTwoProngsNum)return}}return o}function Mg(t,n){const e=[0];if(1===n.t){const{curve:r}=n,o=Et(r.ps,r.next.ps);if(o.isQuiteDull){const n=jp(o.tangents[0]),r=jp(o.tangents[1]),i=(wg(n[1],n[0])+2*bg)%(2*bg),c=((wg(r[1],r[0])+2*bg)%(2*bg)-i+2*bg)%(2*bg);let s=t;for(;s<=c-t/2;)e.push(s),s+=t}}return e}function Sg(t,n,e,r){let o;for(let i=0;i<e.length;i++){const c=_g(t,n,e[i],r);o=void 0===o?c:o}return o}function Ng(t,n=.4,e=10,r=2**-16){const o=[0],i=[1];for(;;){const c=o[o.length-1],s=i[i.length-1],u=A(t,c,s),f=sp(u),l=cn(u);if(f<=e&&l<=n||s-c<=r){if(o.push(i.pop()),1===s)return o;continue}const a=(c+s)/2;i.push(a)}}function Ig(t){if(t.length<4)return[];const[[n,e],[r,o],[i,c],[s,u]]=t,f=r-n,l=o-e,a=i-r-f,p=c-o-l,h=s-i-f-2*a,d=u-c-l-2*p,g=a*d-p*h,v=f*d-l*h,m=f*p-l*a;return Te([g,v,m],0,1)?.map(t=>t.t)||[]}function yg(t,n,e){return function(r){const o=[],i=r.curves;for(let r=0;r<i.length;r++){const c=i[r],s=c.ps;if(sp(s)<t)continue;let u=Ng(s,n,e);u=2===u.length?[.5]:u,u.push(...Ig(s)),u=u.filter(t=>0!==t&&1!==t);const f=u.map(t=>({curve:c,t,isSource:!0,p:id(c.ps,t)}));o.push(...f)}return o}}const Eg=Ke,Cg=Kt,Og=$n,Tg=tr,Ag=nr,Pg=$n,kg=Wn,Bg=Kt,zg=tn;const Fg=Kn,Yg=J,Lg=Number.EPSILON/2,Xg=Math.abs,Hg=ot,Vg=Z,$g=tt,Dg=dt;const qg=Ke,jg=$n,Wg=Wn,Qg=Kt,Rg=tn;function Gg(t){if(function(t){if(4===t.length)return 0===vu(t[0],t[1],t[2])&&0===vu(t[1],t[2],t[3])&&0===vu(t[0],t[2],t[3]);if(3===t.length)return 0===vu(t[0],t[1],t[2]);if(t.length<=2)return!0;throw new Error("The given bezier curve must be of order <= 3.")}(t))return{minima:[],maxima:[],inflections:[]};if(4===t.length&&function(t){const[[n,e],[r,o],[i,c],[s,u]]=t,f=s+3*r,l=n+3*i,a=f-l,p=Xg(3*r)+Xg(f)+(Xg(3*i)+Xg(l))+Xg(a);if(Xg(a)-Lg*p>0)return!1;const h=u+3*o,d=e+3*c,g=h-d,v=Xg(3*o)+Xg(h)+(Xg(3*c)+Xg(d))+Xg(g);return!(Xg(g)-Lg*v>0)&&0===lt(ft(Yg([s],Fg(3,r)),Yg([n],Fg(3,i))))&&0===lt(ft(Yg([u],Fg(3,o)),Yg([e],Fg(3,c))))}(t)&&(t=function(t,n=!1){const[e,r,o,i]=t;if(!n){const[t,n]=e,[c,s]=r,[u,f]=o,[l,a]=i;return[e,[it(ft($g(Dg(c/4,u/4),3),Dg(t/4,l/4))),it(ft($g(Dg(s/4,f/4),3),Dg(n/4,a/4)))],i]}const c=function(t,n){const[[e,r],[o,i]]=t,[[c,s],[u,f]]=n,l=Vg(o,e),a=Vg(i,r),p=Vg(u,c),h=Vg(f,s),d=ft(Hg(p,a),Hg(h,l));if(0===lt(d))return;const g=Vg(c,e),v=Vg(s,r),m=it(ft(Hg(v,l),Hg(g,a)))/it(d);return[c+m*it(p),s+m*it(h)]}([e,r],[i,o]);if(void 0!==c)return[e,c,i]}(t)),3===t.length){const n=function(t){const[[n,e],[r,o],[i,c]]=t,s=qg(r,n),u=qg(i,r),f=Rg(u,s),l=qg(o,e),a=qg(c,o),p=Rg(a,l),h=Qg(Rg(jg(n,Rg(f,[0,r])),jg(r,Rg(u,[0,r]))),Rg(jg(e,Rg(p,[0,o])),jg(o,Rg(a,[0,o]))));return[Qg(Wg(f,f),Wg(p,p)),ci(h)]}(t);return{minima:[],maxima:Te(n,0,1)?.map(t=>t.t)||[],inflections:[]}}const n=function(t){const[[n,e,r],[o,i,c]]=ng(t),[[s,u],[f,l]]=cg(t),[[a],[p]]=function(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[Og(6,Cg(Eg(s,n),Og(3,Eg(r,i))))],[Og(6,Cg(Eg(u,e),Og(3,Eg(o,c))))]]}if(t.length<=3)return[[[0,0]],[[0,0]]];throw new Error("The given bezier curve must be of order <= 3.")}(t),h=kg(a,i),d=kg(p,e),g=kg(u,c),v=kg(u,i),m=kg(f,f),x=kg(s,c),b=kg(l,r),w=kg(l,e),_=kg(f,r),M=kg(r,e),S=kg(r,n),N=kg(r,o),I=kg(e,e),y=kg(e,n),E=kg(e,i),C=kg(n,c),O=kg(n,o),T=kg(n,n),A=kg(c,i),P=kg(c,o),k=kg(i,i),B=kg(i,o),z=kg(o,o),F=zg(kg(a,c),kg(p,r)),Y=zg(h,d),L=Bg(kg(u,r),kg(l,c)),X=Bg(Bg(kg(u,e),kg(s,r)),Bg(kg(l,i),kg(f,c))),H=zg(g,b),V=zg(Bg(v,x),Bg(w,_)),$=Bg(kg(r,r),kg(c,c)),D=Bg(M,A),q=Bg(E,C),j=Bg(P,k),W=Bg(S,I),Q=Bg(kg(e,o),kg(n,i)),R=zg(T,z),G=zg(y,B),U=Bg(N,E),Z=zg(M,A),J=Bg(kg(r,i),kg(e,c)),K=Bg(P,j),tt=Bg(S,W),nt=Bg(N,q),et=Bg(E,q),rt=zg(tt,K),ot=Bg(q,C),it=Bg(U,C),ct=Bg(tr(w),_),st=kg(T,zg(h,Pg(3,d))),ut=kg(z,zg(Pg(3,h),d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g(f,i)),kg(l,o))))),kg(f,kg(c,ct))))),St=Bg(zg(wt,_t),Mt),Nt=zg(Bg(kg($,Y),Tg(kg(D,F))),Pg(3,Bg(kg(L,V),kg(X,H)))),It=zg(kg(F,$),Pg(3,kg(L,H)));return{inflectionPoly:[zg(kg(s,o),kg(f,n)),zg(Bg(kg(u,o),kg(s,i)),Bg(kg(l,n),kg(f,e))),zg(Bg(v,x),Bg(w,_)),zg(g,b)],otherExtremaPoly:[at,gt,bt,St,Nt,It]}}(t),e=n.inflectionPoly,r=n.otherExtremaPoly,o=Te(r,0,1)?.map(t=>t.t)||[],i=function(t){const n=t.length-1;if(n<=0)return[];const e=new Array(n);for(let r=0;r<n;r++)e[r]=$n(n-r,t[r]);return e}(r),c=[],s=[];for(let t=0;t<o.length;t++){const n=o[t],r=se(i,n);lt(ot(se(e,n),r))>=0?c.push(n):s.push(n)}return{minima:c,maxima:s,inflections:Te(e,0,1)?.map(t=>t.t)||[]}}function Ug(t){return{curve:t.curve,t:t.t,isSource:!0,p:id(t.curve.ps,t.t)}}function Zg(t,n,e,r,o){(o&&(r>t.val||r===t.val&&e>t.t)||!o&&(r<t.val||r===t.val&&e>t.t))&&(t.curve=n,t.t=e,t.val=r)}const Jg=L(function(t){const n=[{curve:void 0,t:void 0,val:1/0},{curve:void 0,t:void 0,val:1/0}],e=[{curve:void 0,t:void 0,val:-1/0},{curve:void 0,t:void 0,val:-1/0}];return t.curves.forEach(function(t){const r=function(t){const n=G(t),e=Te(n[0],0,1)?.map(t=>t.t)||[],r=Te(n[1],0,1)?.map(t=>t.t)||[];e.push(0,1),r.push(0,1);let o,i,c,s,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(let n=0;n<e.length;n++){const r=e[n],[c]=up(t,r);c<u&&(u=c,o=r),c>f&&(f=c,i=r)}for(let n=0;n<r.length;n++){const e=r[n],[,o]=up(t,e);o<l&&(l=o,c=e),o>a&&(a=o,s=e)}return{ts:[[o,c],[i,s]],box:[[u,l],[f,a]]}}(t.ps);for(let o=0;o<2;o++)Zg(n[o],t,r.ts[0][o],r.box[0][o],!1),Zg(e[o],t,r.ts[1][o],r.box[1][o],!0)}),{minX:Ug(n[0]),minY:Ug(n[1]),maxX:Ug(e[0]),maxY:Ug(e[1])}});function Kg(t){return Jg(t).minY}function tv(t){const{loops:n}=t,e=n.map(Kg);let r;const o=mg(t);for(let n=1;n<e.length;n++){const i=e[n],c=o(!0,!1,0,i);if(!c)throw new Error("Unable to find hole-closing 2-prong");const{circle:s,z:u}=c,f=xg(t,s,i,u,!0);r=void 0===r?f:r}return r}const nv=L(function(t){let n,e,r,o,i=1/0,c=-1/0,s=1/0,u=-1/0;for(const f of t){const t=Jg(f);t.minX.p[0]<i&&(n=t.minX,i=t.minX.p[0]),t.maxX.p[0]>c&&(e=t.maxX,c=t.maxX.p[0]),t.minY.p[1]<s&&(r=t.minY,s=t.minY.p[1]),t.maxY.p[1]>u&&(o=t.maxY,u=t.maxY.p[1])}return{minX:n,minY:r,maxX:e,maxY:o}});function ev(t,n,e){const{minBezLength:r,maxCurviness:o,maxLength:i,angleIncrement:c}=e,s=Ad(r),u=function(t){return n=>{const e=[];for(let r=0;r<n.curves.length;r++){const o=n.curves[r];if(sp(o.ps)<t)continue;const{next:i,ps:c}=o;if(Et(c,i.ps).isQuiteDull){const t=c[c.length-1];e.push({curve:o,t:1,isSource:!0,p:t}),e.push({curve:i,t:0,isSource:!0,p:t})}}return e}}(r),f=yg(r,o,i),l=function(t){return function(n){const e=[];for(let r=0;r<n.curves.length;r++){const o=n.curves[r];sp(o.ps)<t||e.push(...Gg(o.ps).maxima.map(t=>({curve:o,t,isSource:!0,p:id(o.ps,t)})))}return e}}(r),a=nv(t),p=(a.maxX.p[0]-a.minX.p[0])**2+(a.maxY.p[1]-a.minY.p[1])**2,d=t.map(s),g={id:0},v=yd(t,d,g),m=Td(t),x=(Od(),{maxCoordPowerOf2:n,squaredDiagonalLength:p,loops:t,cpTrees:v,lastInsertId:g,...m});let b;if(b=tv(x),"undefined"!=typeof _debug_&&_debug_.directives.stopAfterHoleClosers)return{cpNode:b,meta:x};if(function(){if("undefined"==typeof _debug_)return;const t=_debug_.generated.timing,n=performance.now();t.holeClosers+=n-Cd,Cd=n}(),b=Sg(x,c,t.map(u),!1)||b,b=Sg(x,c,t.map(l),!0)||b,b=Sg(x,c,t.map(f),!1)||b,function(){if("undefined"==typeof _debug_)return;const t=_debug_.generated.timing,n=performance.now();t.oneAnd2Prongs+=n-Cd,Cd=n}(),"undefined"!=typeof _debug_&&_debug_.directives.stopAfterTwoProngs)return{cpNode:b,meta:x};if(b=function(t,n){if(void 0===n)return;const e=new Set;let r=!0;for(;r;){r=!1;const o=new Set(h(n));for(const n of o){const{closeBysFor3Prong:i,addedCpNodes:c}=Sd(t,n);c.length>0&&(r=!0),void 0===i?e.add(n):(r=!0,Id(t,i,o,e)),c.forEach(t=>t.forEach(t=>e.add(t)))}n=Nd(e)}return Nd(e)}(x,b),void 0===b)return;if("undefined"!=typeof _debug_&&_debug_.directives.stopAfterThreeProngs)return{cpNode:b,meta:x};const w={cpNode:b,meta:x};return"undefined"!=typeof _debug_&&(_debug_.generated.timing.threeProngs+=performance.now()-Cd),w}const{ceil:rv,log2:ov}=Math;function iv(t,n){const{maxCoordinate:e}=function(t){let n=0,e=1/0,r=-1/0,o=1/0,i=-1/0;for(const c of t)for(const t of c)for(const c of t){const t=c[0],s=c[1],u=ip(cp(t),cp(s));u>n&&(n=u),t<e&&(e=t),t>r&&(r=t),s<o&&(o=s),s>i&&(i=s)}return{maxCoordinate:n,width:r-e,height:i-o}}(t),r=rv(ov(e)),o=function(t,n){const e={...n};for(const n in qp){const r=n;let o=e[r];const i=qp[r],{range:c,scaleByMaxCoordinate:s}=i;o<c[0]&&(o=c[0]),o>c[1]&&(o=c[1]),s&&(o*=2**(t-10)),e[r]=o}return e}(r,{...Dp,...n||{}}),{applySat:i,simplify:c,satScale:s,simplifyTolerance:u}=o,f=op(t,void 0,{forceOrientationNegative:!0}),l=[];for(const t of f){let n=ev(t,r,o);void 0!==n&&(i&&(n=$p(n,s)),c&&(n=zp(n,u,50)),l.push(n))}return l}function cv(t){const n=function(t){let n=t;const e=Yp(t);for(;e.length;){const r=e.pop();if(r.isHoleClosing||r.isIntersection)continue;let o=r.next;for(;;){o=o.next;let e=!1;const r=o.prevOnCircle;if(v(o)>2){const n=o.nextOnCircle;Yt(o,t)?e=!0:o.next===n?o=n:n.next!==r&&(e=!0)}else if(x(o)&&!o.isIntersection)return void(n=o);if(e){r.next=o,o.prev=r,n=o;break}}}return n}(C(t.cpNode));if(n)return{cpNode:n,meta:{...t.meta,cpTrees:kp(n)}}}let sv=0;function uv(t){return t.map(t=>{return(n=t.pointOnShape).p[0]+", "+n.p[1]+" | bz: "+n.curve.idx+" | t: "+n.t;var n})}function fv(t,n=3){return t[0].toFixed(n)+", "+t[1].toFixed(n)}const lv={δToString:uv,δsToString:function(t){return t.map(uv)},pointToStr:fv,pointsToStr:function(t,n=3){return t.map(t=>fv(t,n))},nameObj:function(t,n=""){t.name=""+n+sv++}},av="red thin10 nofill ",pv="http://www.w3.org/2000/svg";function hv(t,n,e=av,r){const o=n.center,i=n.radius,c=document.createElementNS(pv,"circle");return c.setAttributeNS(null,"cx",o[0].toString()),c.setAttributeNS(null,"cy",o[1].toString()),c.setAttributeNS(null,"r",i.toString()),c.setAttributeNS(null,"class",e),t.appendChild(c),r&&setTimeout(()=>c.remove(),r),[c]}function dv(t,n,e=3,r="red",o){const[i]=hv(t,{center:n,radius:e},"dot "+r,o);return o&&setTimeout(()=>i.remove(),o),[i]}function gv(t,n,e=av,r=0,o=void 0,i=0){const c=document.createElementNS(pv,"line");c.setAttributeNS(null,"x1",n[0][0].toString()),c.setAttributeNS(null,"y1",n[0][1].toString()),c.setAttributeNS(null,"x2",n[1][0].toString()),c.setAttributeNS(null,"y2",n[1][1].toString()),c.setAttributeNS(null,"class",e),t.appendChild(c);let s=[];if(void 0!==o)for(const e of n)s.push(...dv(t,e,i,o,r));for(const n of s)t.appendChild(n);const u=[c,...s];return r&&setTimeout(()=>{for(const t of u)t.remove()},r),u}function vv(t,n,e=av,r=3,o){const i=hv(t,{center:n,radius:r},e),c=[[n[0]-r,n[1]],[n[0]+r,n[1]]],s=[[n[0],n[1]-r],[n[0],n[1]+r]],u=gv(t,c,e),f=gv(t,s,e);return o&&setTimeout(()=>{i.forEach(t=>t.remove()),u.forEach(t=>t.remove()),f.forEach(t=>t.remove())},o),[...i,...u,...f]}function mv(t){return 2===t?"L":3===t?"Q":4===t?"C":void 0}function xv(t,n,e=av,r=0,o=void 0,i=0,c=void 0){const[[s,u],[f,l],[a,p]]=n,h=document.createElementNS(pv,"path");h.setAttributeNS(null,"d",`M${s} ${u} Q${f} ${l} ${a} ${p}`),e&&h.setAttributeNS(null,"class",e);let d=[];if(void 0!==o)for(const e of n)d.push(...dv(t,e,i,o,r));let g=[];if(void 0!==c)for(let e=0;e<n.length-1;e++)g.push(...gv(t,[n[e],n[e+1]],c,r));const v=[h,...d,...g];for(const n of v)t.appendChild(n);return r&&setTimeout(()=>{for(const t of v)t.remove()},r),v}function bv(t,n,e=av,r=0,o=void 0,i=0,c=void 0){const[[s,u],[f,l],[a,p],[h,d]]=n;if(s===h&&f===h&&a===h&&u===d&&l===d&&p===d)return vv(t,[s,u],e,.2,r);const g=document.createElementNS(pv,"path");g.setAttributeNS(null,"d",`M${s} ${u} C${f} ${l} ${a} ${p} ${h} ${d}`),g.setAttributeNS(null,"class",e);let v=[];if(void 0!==o)for(const e of n)v.push(...dv(t,e,i,o,r));let m=[];if(void 0!==c)for(let e=0;e<n.length-1;e++)m.push(...gv(t,[n[e],n[e+1]],c,r));const x=[g,...v,...m];for(const n of x)t.appendChild(n);return r&&setTimeout(()=>{for(const t of x)t.remove()},r),x}function wv(t,n,e=av,r=0,o=void 0,i=0,c=void 0){return 2===n.length?gv(t,n,e,r,o,i):3===n.length?xv(t,n,e,r,o,i,c):4===n.length?bv(t,n,e,r,o,i,c):[]}const _v=["red","green","cyan","blue"];function Mv(t,n){const e=1-n;if(4===t.length){const[[r,o],[i,c],[s,u],[f,l]]=t;return[r*e**3+3*i*e**2*n+3*s*e*n**2+f*n**3,o*e**3+3*c*e**2*n+3*u*e*n**2+l*n**3]}if(3===t.length){const[[r,o],[i,c],[s,u]]=t;return[r*e**2+2*i*e*n+s*n**2,o*e**2+2*c*e*n+u*n**2]}if(2===t.length){const[[r,o],[i,c]]=t;return[r*e+i*n,o*e+c*n]}return[NaN,NaN]}function Sv(t,n){return 2===t.length?function(t,n){const[[e,r],[o,i]]=t,c=1-n,s=[c*e+n*o,c*r+n*i];return[[[e,r],s],[s,[o,i]]]}(t,n):3===t.length?function(t,n){const[[e,r],[o,i],[c,s]]=t,u=1-n,f=[u*u*e+2*u*n*o+n*n*c,u*u*r+2*u*n*i+n*n*s];return[[[e,r],[u*e+n*o,u*r+n*i],f],[f,[u*o+n*c,u*i+n*s],[c,s]]]}(t,n):4===t.length?function(t,n){const[[e,r],[o,i],[c,s],[u,f]]=t,l=1-n,a=n*n,p=a*n,h=l*l,d=h*l,g=[p*u+3*l*a*c+3*h*n*o+d*e,p*f+3*l*a*s+3*h*n*i+d*r];return[[[e,r],[n*o+l*e,n*i+l*r],[a*c+2*l*n*o+h*e,a*s+2*l*n*i+h*r],g],[g,[a*u+2*n*l*c+h*o,a*f+2*n*l*s+h*i],[n*u+l*c,n*f+l*s],[u,f]]]}(t,n):[]}const Nv={circle:hv,crossHair:vv,dot:dv,line:gv,rect:function(t,n,e=av,r){const[[o,i],[c,s]]=n,u=o<c?o:c,f=i<s?i:s,l=Math.abs(o-c),a=Math.abs(i-s),p=document.createElementNS(pv,"rect");return p.setAttributeNS(null,"x",u.toString()),p.setAttributeNS(null,"y",f.toString()),p.setAttributeNS(null,"width",l.toString()),p.setAttributeNS(null,"height",a.toString()),e&&p.setAttributeNS(null,"class",e),t.appendChild(p),r&&setTimeout(()=>p.remove(),r),[p]},beziers:function(t,n,e,r){const o=void 0===e,i=[];for(let r=0;r<n.length;r++){const c=n[r],s=o?"thin5 nofill "+_v[r%_v.length]:e;i.push(...wv(t,c,s))}return r&&setTimeout(()=>i.forEach(t=>t.remove()),r),i},bezier:wv,bezierPiece:function(t,n,e,r=av,o){const i=e[0]===e[1]?vv(t,Mv(n,e[0]),r,1.5):wv(t,function(t,n){if(0===n[0]&&1===n[1])return t;if(n[0]===n[1]){const e=Mv(t,n[0]);return[e,e,e,e]}return 0===n[0]?Sv(t,n[1])[0]:1===n[1]?Sv(t,n[0])[1]:Sv(Sv(t,n[0])[1],(n[1]-n[0])/(1-n[0]))[0]}(n,e),r);return o&&setTimeout(()=>i.forEach(t=>t.remove()),o),i},quadBezier:xv,cubicBezier:bv,polygon:function(t,n,e=av,r){const o=document.createElementNS(pv,"path");let i=`M${n[0][0]} ${n[0][1]} L`;for(let t=0;t<n.length;t++)i+=`${n[t][0]} ${n[t][1]} `;return i+=" z",o.setAttributeNS(null,"d",i),e&&o.setAttributeNS(null,"class",e),t.appendChild(o),r&&setTimeout(()=>o.remove(),r),[o]},loop:function(t,n,e=av,r){if(!n.length)return[];const o=document.createElementNS(pv,"path");let i=`M${n[0][0][0]} ${n[0][0][1]} `;for(let t=0;t<n.length;t++){const e=n[t];i+=`${mv(e.length)} `;for(let t=1;t<e.length;t++)i+=`${e[t][0]} ${e[t][1]} `}return i+=" z",o.setAttributeNS(null,"d",i),e&&o.setAttributeNS(null,"class",e),t.appendChild(o),r&&setTimeout(()=>o.remove(),r),[o]},polyline:function(t,n,e=av,r){if(n.length<2)return[];const o=document.createElementNS(pv,"path");let i=`M${n[0][0]} ${n[0][1]} L`;for(let t=0;t<n.length;t++)i+=`${n[t][0]} ${n[t][1]} `;return o.setAttributeNS(null,"d",i),e&&o.setAttributeNS(null,"class",e),t.appendChild(o),r&&setTimeout(()=>o.remove(),r),[o]},text:function(t,n,e,r,o=av,i){const c=document.createElementNS(pv,"text");return c.setAttributeNS(null,"x",n[0].toString()),c.setAttributeNS(null,"y",n[1].toString()),c.setAttributeNS(null,"font-size",r.toString()),c.setAttributeNS(null,"class",o),c.textContent=e,t.appendChild(c),i&&setTimeout(()=>c.remove(),i),[c]}};function Iv(t,n){return(n,e,r,o=0,i=1)=>{let c,s;switch(e.isHoleClosing){case!1:c="red ",s="2";break;case!0:c="cyan ",s="10"}const{pointOnShape:u}=e,{circle:f}=u,{center:l,radius:a}=f,{isSource:p,p:h}=u,d=e.nextOnCircle.pointOnShape.p,g=p?h:d,v=p?d:h,{line:m,dot:x,circle:b,crossHair:w}=Nv,_=x(n,f.center,.02*i,"yellow",o);return[...b(n,f,c+"thin"+s+" nofill",o),...x(n,g,.005*i,c,o),...x(n,v,.01*i,c,o),...t?w(n,f.center,"red thin2 nofill",.002*i,o):[],..._]}}function yv(t,n){return{center:t.center,radius:n*t.radius}}const{getAllOnCircle:Ev}=_n,{isTerminating:Cv}=_n,Ov=["thin10 blue nofill","thin10 red nofill"];function Tv(t,n,e,r=0,o=1){let i=n.cpNode;if(!i)return[];for(;!Cv(i);)i=i.next;const c=[];let s=0;return N(i,n=>{if(Cv(n))return;const e=zt(n);e&&(c.push(...Nv.bezier(t,e,Ov[s%2],r)),s++)}),c}function Av(t,n,e,r){const o=document.createElementNS("http://www.w3.org/2000/svg","circle");return o.setAttributeNS(null,"cx",n[0].toString()),o.setAttributeNS(null,"cy",n[1].toString()),o.setAttributeNS(null,"r",e.toString()+"%"),o.setAttributeNS(null,"class",r),t.appendChild(o),o}function Pv(t,n,e="thin5 purple nofill",r=0,o=1){const i=[],c=[];for(const t of n){if(x(t))continue;const n=zt(t);n&&c.push(n)}return i.push(...a(t,c,e,r)),i}const kv={oneProng:function(t,n,e,r=0,o=1){const{pointOnShape:i}=n,{circle:c}=i;return[...Nv.dot(t,i.p,.02*o,"deeppink",r),...Nv.dot(t,c.center,.01*o,"deeppink",r),...Nv.circle(t,c,"deeppink thin5 nofill",r)]},twoProng:Iv(!1),threeProng:function(t,n,e,r=0,o=1){const i=yv(n.pointOnShape.circle,1),{center:c,radius:s}=i,u=_n.getAllOnCircle(n).map(t=>t.pointOnShape),{dot:f,circle:l,crossHair:a}=Nv,p=l(t,i,"blue thin2 nofill",r),h=[],d=[];for(let n=0;n<u.length;n++){const e=u[n].p;h.push(...f(t,e,.01*(n+1)*o,"blue",r)),d.push(...Nv.line(t,[e,c],"thin5 red",r))}const g=a(t,i.center,"red thin2 nofill",.02*o,r);return[...h,...d,...p,...g]},boundingHull:function(t,n,e="thin5 black nofill",r=0,o=1){return Nv.polygon(t,n,e,r)},looseBoundingBox:function(t,n,e="thin5 brown nofill",r=0,o=1){const[[i,c],[s,u]]=n;return n=[[i,c],[s,c],[s,u],[i,u]],Nv.polygon(t,n,e,r)},tightBoundingBox:function(t,n,e="thin5 pinker nofill",r=0,o=1){return Nv.polygon(t,n,"thin5 pinker nofill",r)},vertex:function(t,n,e,r=0,o=1){const i=n.pointOnShape.circle;let c=[];return c=[...Nv.dot(t,i.center,.01*o,"darkgreen",r)],c},mat:Tv,maxVertex:function(t,n){const e=n.pointOnShape.circle;return Nv.circle(t,e,"brown thin10 nofill")},leaves:function(t,n,e="thin10 deeppink nofill",r=0,o=1){const i=[],{line:c,dot:s,circle:u}=Nv;for(const f of n){const n=f.pointOnShape,{circle:l}=n,{center:a,radius:p}=l,h=[Av(t,a,.5,"pinker thin5 nofill")],d=_n.getAllOnCircle(f).map(t=>t.pointOnShape),g=[],v=[];for(let n=0;n<d.length;n++){const e=d[n].p;v.push(...s(t,e,.01*(n+1)*o,"pinker",r)),g.push(...c(t,[e,a],"thin5 red",r))}const m=u(t,l,e,r);i.push(...m,...v,...g,...h)}return i},cull:function(t,n,e="thin10 cyan nofill",r=0,o=1){const i=[];return i.push(...Nv.crossHair(t,n,e,.1*o,r)),i},cpNode:function(t,n,e="blue thin2 nofill",r=0,o=1){const i=yv(n.pointOnShape.circle,1),{center:c,radius:s}=i,u=_n.getAllOnCircle(n).map(t=>t.pointOnShape),{dot:f,circle:l,crossHair:a}=Nv,p=l(t,i,e,r),h=[],d=[];for(let n=0;n<u.length;n++){const e=u[n].p;h.push(...f(t,e,.01*(n+1)*o,"blue",r)),d.push(...Nv.line(t,[e,c],"thin5 red",r))}const g=a(t,c,"orange thin10 nofill",2*o,r);return[...h,...d,...p,...g]},branch:Pv,holeCloser:Iv(!1)},Bv={...kv,twoProng:Iv(!0)};function zv(t){if(!t)return void(window._debug_=void 0);let n=window._debug_;n={...n,generated:{...n&&n.generated?n.generated:{},elems:{...n&&n.generated&&n.generated.elems?n.generated.elems:{},oneProng:[],twoProng:[],looseBoundingBox:[],tightBoundingBox:[],vertex:[],threeProng:[],boundingHull:[],mat:[],cpNode:[],maxVertex:[],leaves:[]},timing:{...n&&n.generated&&n.generated.timing?n.generated.timing:{},holeClosers:0,oneAnd2Prongs:0,threeProngs:0,sats:0,simplifyMat:0}},fs:{...n&&n.fs?n.fs:{},drawElem:{...n&&n.fs&&n.fs.drawElem?n.fs.drawElem:{},...kv},...lv},directives:{...n&&n.directives?n.directives:{},stopAfterHoleClosers:!1,stopAfterHoleClosersNum:void 0,stopAfterTwoProngs:!1,stopAfterTwoProngsNum:void 0,stopAfterThreeProngs:!1,stopAfterThreeProngsNum:void 0}},window._debug_=n}const Fv={oneProng:[],twoProng:[],threeProng:[],looseBoundingBox:[],tightBoundingBox:[],boundingHull:[],vertex:[],mat:[],maxVertex:[],leaves:[],cull:[],cpNode:[],branch:[],holeCloser:[]},Yv=Object.keys(Fv);function Lv(t,n,e,r){const o=[];for(const r of t)o.push({type:0,item:r,x:n(r)}),o.push({type:1,item:r,x:e(r)});o.sort(Xv);const i=new Set,c=[];for(const t of o){const{item:n}=t;if(0===t.type){for(const t of i.values())r(n,t)&&c.push([n,t]);i.add(n)}else 1===t.type&&i.delete(t.item)}return c}function Xv(t,n){const e=t.x-n.x;return 0!==e?e:0===t.type?-1:1}const Hv=1e-4;function Vv(t,n){const e=t.pointOnShape,r=n.pointOnShape;let{curve:o,p:i,t:c}=e,{curve:s,p:u,t:f}=r;if(i[0]===u[0]&&i[1]===u[1])return[i];1===c&&(c=0,o=o.next),0===f&&(f=1,s=s.prev);const{ps:l}=o,{ps:a}=s,p=[i,j(i)(W(U(l,c)))],h=[u,j(u)(W(U(a,f)))],d=X(p,h),g=H(i,u);let v;if(d){const t=H(i,d),n=H(u,d);v=V(t,g)<0||V(n,g)>0}else v=!0;if(!v)return[i,d,u];const m=H(p[0],p[1]),x=H(h[0],h[1]),b=Math.abs(D(g,m))/9,w=Math.abs(D(g,x))/9;return b>.01||w>.01||b>Hv||w>Hv?void 0:[i,u]}const $v=L(function(t){return hn(zt(t))});function Dv(t,n){const e=function(t){const n=new Map;for(let e of t)for(let r of t){const t=e.pointOnShape.circle.center,o=r.pointOnShape.circle.center,i=e.pointOnShape.p,c=r.pointOnShape.p;r!==e&&t[0]===o[0]&&t[1]===o[1]&&i[0]===c[0]&&i[1]===c[1]&&n.set(e,r)}return n}(n),r=t.length,o=[];for(let n=0;n<r;n++){const i=t[n],c=[];for(let o=0;o<r;o++){const r=t[o];if(n===o){c.push(0);continue}let s=1/0;for(const t of m(i)){let n=$v(t),o=t.next;for(;!Yt(o,r);)if(o.isHoleClosing)o=qv(e,o);else{if(Sn(o)){n=1/0;break}n+=$v(o),o=o.next}n<s&&(s=n)}c.push(s)}o.push(c)}return o}function qv(t,n){return t.get(n).next}export{_n as CpNodeFs,e as beziersToSvgPathStr,C as clone,wn as cpNodeComparator,yd as createInitialCpTree,Yv as debugElemNames,a as drawBeziersAsSinglePath,Pv as drawBranch,kv as drawElemFs,Bv as drawElemFsDetailed,Tv as drawMat,Fv as emptyDebugElems,zv as enableDebugForMat,M as enhanceCpNode,mg as find2Prong,tv as findAndAddHoleClosing2Prongs,iv as findMats,p as floydWarshall,m as getAllOnCircle,h as getAllOnLoop,xn as getAllVertices,T as getBoundaryBezierPartsToNext,dn as getBoundaryBeziersBetween,P as getBoundaryBeziersToNext,dd as getBoundaryPieceBeziers,Vt as getBranch,$t as getBranchBeziers,Sp as getBranches,z as getChildren,cd as getCloseBoundaryPointsCertified,Rh as getClosestSquareDistanceToRect,At as getEdgeDirection,Ft as getFirstExit,yg as getFor2ProngsOnLoop,Dv as getGraph,d as getHoleClosers,Vv as getImpliedBoundaryBezierBetween,mn as getInitialDegAngleBetweenMatCurves,Bt as getMatCurveBetween,zt as getMatCurveToNext,vn as getMatCurvesBetween,Td as getPartialMeta,l as getPathsFromStr,Od as getPointToCpNode,jh as getPotentialClosestPointsOnCurveCertified,v as getProngCount,b as getRealProngCount,gn as getSalience,Vp as getSatCulls,nv as getShapeBounds,Ad as getSharpCornersOnLoop,I as getVertexForwardChildren,w as isFullyTerminating,Yt as isOnSameCircle,Lt as isOneProng,_ as isSharp,x as isTerminating,Ht as isTrivial,Xt as isTwoProng,Sn as isVertexSpecial,t as loopFromBeziers,B as removeVertex,zp as simplifyMat,Lv as sweepLine,$p as toScaleAxis,S as traverseCp,N as traverseEdges,y as traverseVertices,cv as trimMat};
1
+ function t(t=[],e){const r=[],o={beziers:t,curves:r,idx:e};if(0===t.length)return o;let i,c=0;for(let e=0;e<t.length;e++){if(n(t[e]))continue;const s={loop:o,ps:t[e],prev:i,next:void 0,idx:c};i&&(i.next=s),i=s,r.push(s),c++}const s=r[r.length-1];return r[0].prev=s,s.next=r[0],s.ps[s.ps.length-1]=r[0].ps[0],o}function n(t){return 2===t.length?t[0][0]===t[1][0]&&t[0][1]===t[1][1]:3===t.length?t[0][0]===t[1][0]&&t[0][1]===t[1][1]&&t[1][1]===t[2][1]&&t[1][1]===t[2][1]:t[0][0]===t[1][0]&&t[0][1]===t[1][1]&&t[1][1]===t[2][1]&&t[1][1]===t[2][1]&&t[2][1]===t[3][1]&&t[2][1]===t[3][1]}function e(t){const n=[];for(let e=0;e<t.length;e++){const r=t[e];0===e&&n.push("M "+r[0][0].toString()+" "+r[0][1].toString()),4===r.length?n.push("C "+r[1][0].toString()+" "+r[1][1].toString()+" "+r[2][0].toString()+" "+r[2][1].toString()+" "+r[3][0].toString()+" "+r[3][1].toString()+" "):3===r.length?n.push("Q "+r[1][0].toString()+" "+r[1][1].toString()+" "+r[2][0].toString()+" "+r[2][1].toString()+" "):2===r.length&&n.push("L "+r[1][0].toString()+" "+r[1][1].toString()+" ")}return n.push(" z"),n.join("\n")}class r{initialPoint=void 0;p;vals=void 0;prev2ndCubicControlPoint=void 0;prev2ndQuadraticControlPoint=void 0;constructor(){this.p=[0,0]}}function o(t){const n=[t.p,t.initialPoint];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0,n}function i(t){t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0;const n=(e=t.p,t.vals[0],t.vals[1],t.vals[2],t.vals[3],t.vals[4],[[e,[t.vals[5],t.vals[6]]]]);var e;const r=n[n.length-1];return t.p=r[r.length-1],n}const c={c:function(t){const n=[t.p,[t.vals[0],t.vals[1]],[t.vals[2],t.vals[3]],[t.vals[4],t.vals[5]]];return t.prev2ndCubicControlPoint=n[2],t.prev2ndQuadraticControlPoint=void 0,n},h:function(t){const n=[t.p,[t.vals[0],t.p[1]]];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0,n},l:function(t){const n=[t.p,t.vals];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0,n},q:function(t){const n=[t.vals[0],t.vals[1]],e=[t.vals[2],t.vals[3]];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=n,[t.p,n,e]},s:function(t){const n=t.prev2ndCubicControlPoint?[t.p[0]-t.prev2ndCubicControlPoint[0]+t.p[0],t.p[1]-t.prev2ndCubicControlPoint[1]+t.p[1]]:t.p,e=[t.p,n,[t.vals[0],t.vals[1]],[t.vals[2],t.vals[3]]];return t.prev2ndCubicControlPoint=e[2],t.prev2ndQuadraticControlPoint=void 0,e},t:function(t){const n=t.prev2ndQuadraticControlPoint?[t.p[0]-t.prev2ndQuadraticControlPoint[0]+t.p[0],t.p[1]-t.prev2ndQuadraticControlPoint[1]+t.p[1]]:t.p,e=[t.vals[0],t.vals[1]];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=n,[t.p,n,e]},v:function(t){const n=[t.p,[t.p[0],t.vals[0]]];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0,n},z:o};function s(t){let n=0,e=0,r=1,o=0,i=1,c=1;const s=t._currentIndex;t._skipOptionalSpaces();let u=t._currentIndex;u<t._endIndex&&"+"===t._string[u]?(t._currentIndex+=1,u+=1):u<t._endIndex&&"-"===t._string[u]&&(t._currentIndex+=1,u+=1,i=-1);const f=t._string[u];if(u===t._endIndex||(f<"0"||f>"9")&&"."!==f)throw new Error(`The first character of a number must be one of [0-9+-.]. Found '${f}' at index ${u}.`);const l=t._currentIndex;for(;u<t._endIndex&&t._string[u]>="0"&&t._string[u]<="9";)t._currentIndex+=1,u+=1;if(u!==l){let n=u-1,r=1;for(;n>=l;)e+=r*(Number(t._string[n])-0),n-=1,r*=10}if(u<t._endIndex&&"."===t._string[u]){if(t._currentIndex+=1,u+=1,u>=t._endIndex||t._string[u]<"0"||t._string[u]>"9")throw new Error("There must be a least one digit following the .");for(;u<t._endIndex&&t._string[u]>="0"&&t._string[u]<="9";)r*=10,o+=Number(t._string.charAt(u))/r,t._currentIndex+=1,u+=1}if(u!==s&&u+1<t._endIndex&&("e"===t._string[u]||"E"===t._string[u])&&"x"!==t._string[u+1]&&"m"!==t._string[u+1]){if(t._currentIndex+=1,u+=1,"+"===t._string[u]?(t._currentIndex+=1,u+=1):"-"===t._string[u]&&(t._currentIndex+=1,u+=1,c=-1),u>=t._endIndex||t._string[u]<"0"||t._string[u]>"9")throw new Error("There must be an exponent.");for(;u<t._endIndex&&t._string[u]>="0"&&t._string[u]<="9";)n*=10,n+=Number(t._string[u]),t._currentIndex+=1,u+=1}let a=e+o;if(a*=i,n&&(a*=Math.pow(10,c*n)),s===u)throw new Error("Internal error: startIndex === source._currentIndex");return t._skipOptionalSpacesOrDelimiter(),a}const u={Z:"Z",M:"M",L:"L",C:"C",Q:"Q",A:"A",H:"H",V:"V",S:"S",T:"T",z:"Z",m:"m",l:"l",c:"c",q:"q",a:"a",h:"h",v:"v",s:"s",t:"t"};class f{_string;_currentIndex;_endIndex;_prevCommand;constructor(t){this._string=t,this._currentIndex=0,this._endIndex=this._string.length,this._prevCommand=void 0,this._skipOptionalSpaces()}parseSegment(){const t=this._string[this._currentIndex];let n,e=u[t];if(void 0===e){if(void 0===this._prevCommand)throw new Error("Implicit command not allowed for first commands.");if(!("+"===t||"-"===t||"."===t||t>="0"&&t<="9")||"Z"===this._prevCommand)throw new Error("Remaining coordinates not found for implicit command");e="M"===this._prevCommand?"L":"m"===this._prevCommand?"l":this._prevCommand}else this._currentIndex+=1;this._prevCommand=e;const r=e.toUpperCase();if("H"===r||"V"===r?n=[s(this)]:"M"===r||"L"===r||"T"===r?n=[s(this),s(this)]:"S"===r||"Q"===r?n=[s(this),s(this),s(this),s(this)]:"C"===r?n=[s(this),s(this),s(this),s(this),s(this),s(this)]:"A"===r?n=[s(this),s(this),s(this),this._parseArcFlag(),this._parseArcFlag(),s(this),s(this)]:"Z"===r&&(this._skipOptionalSpaces(),n=[]),void 0===n)throw new Error("Unknown command");return{type:e,values:n}}hasMoreData(){return this._currentIndex<this._endIndex}initialCommandIsMoveTo(){if(!this.hasMoreData())return!0;const t=u[this._string[this._currentIndex]];return"M"===t||"m"===t}_isCurrentSpace(){const t=this._string[this._currentIndex];return t<=" "&&(" "===t||"\n"===t||"\t"===t||"\r"===t||"\f"===t)}_skipOptionalSpaces(){for(;this._currentIndex<this._endIndex&&this._isCurrentSpace();)this._currentIndex+=1;return this._currentIndex<this._endIndex}_skipOptionalSpacesOrDelimiter(){return!(this._currentIndex<this._endIndex&&!this._isCurrentSpace()&&","!==this._string[this._currentIndex])&&(this._skipOptionalSpaces()&&this._currentIndex<this._endIndex&&","===this._string[this._currentIndex]&&(this._currentIndex+=1,this._skipOptionalSpaces()),this._currentIndex<this._endIndex)}_parseArcFlag(){if(this._currentIndex>=this._endIndex)throw new Error("Unable to parse arc flag");let t;const n=this._string[this._currentIndex];if(this._currentIndex+=1,"0"===n)t=0;else{if("1"!==n)throw new Error("Unable to parse arc flag - arc flag must be 0 or 1");t=1}return this._skipOptionalSpacesOrDelimiter(),t}}function l(t){return function(t){if(0===t.length)return[];if("m"!==t[0].type.toLowerCase())throw new Error("Invalid SVG - every new path must start with an M or m.");const n=new r,e=[];let s,u=[];for(let r=0;r<t.length;r++){const f=t[r],l=f.type.toLowerCase();if(n.vals=f.values,f.type===l)if("v"===l)n.vals[0]+=n.p[1];else if("a"===l)n.vals[5]+=n.p[0],n.vals[6]+=n.p[1];else for(let t=0;t<n.vals.length;t++)n.vals[t]+=n.p[t%2];if("m"!==l){if("a"===l)u.push(...i(n));else{const t=c[l];if(!t)throw new Error("Invalid SVG - command not recognized.");const e=t(n);n.p=e[e.length-1],u.push(e)}s=l}else u.length&&("z"!==s&&u.push(o(n)),e.push(u),u=[]),n.initialPoint=n.p=n.vals,s=l}return u.length>0&&("z"!==s&&u.push(o(n)),e.push(u)),e}(function(t){if(!t.length)return[];const n=new f(t),e=[];if(!n.initialCommandIsMoveTo())throw new Error("Path must start with m or M");for(;n.hasMoreData();)e.push(n.parseSegment());return e}(t))}function a(t,n,e="thin10 red nofill",r=0){if(0===n.length)return[];let o=`M${n[0][0][0]} ${n[0][0][1]} `;for(let t=0;t<n.length;t++){const e=n[t];if(e.length<=1)continue;const[,r,i,c]=e;o+=2===e.length?`L ${r[0]} ${r[1]} `:3===e.length?`Q ${r[0]} ${r[1]} ${i[0]} ${i[1]} `:`C ${r[0]} ${r[1]} ${i[0]} ${i[1]} ${c[0]} ${c[1]} `}const i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttributeNS(null,"d",o),i.setAttributeNS(null,"class",e),t.appendChild(i),[i]}function p(t){const n=t.length,e=Array.from(Array(n),()=>new Array(n).fill(0));for(let r=0;r<n;r++)for(let o=0;o<n;o++)e[r][o]=t[r][o];for(let t=0;t<n;t++)for(let r=0;r<n;r++)for(let o=0;o<n;o++)e[r][t]+e[t][o]<e[r][o]&&(e[r][o]=e[r][t]+e[t][o]);return e}function h(t){const n=t,e=[];do{e.push(t),t=t.next}while(t!==n);return e}function d(t){return h(t).filter(t=>t.isHoleClosing)}function g(t){const n=t.pointOnShape;return{idx:n.curve.idx,t:n.t,order:n.order,order2:n.order2}}function v(t){const n=t;let e=n,r=0;do{r++,e=e.nextOnCircle}while(e!==n);return r}function m(t,n=!1){const e=t,r=n?[]:[t];let o=t.nextOnCircle;for(;o!==e;)r.push(o),o=o.nextOnCircle;return r}function x(t){return t===t.next.prevOnCircle}function b(t){return m(t).filter(t=>!x(t)).length}function w(t){return m(t.prevOnCircle,!0).every(x)}function _(t){return 0===t.pointOnShape.circle.radius}function M(t){const n=t.pointOnShape,e=n.curve;return{...t,pos:n,p:n.p,t:n.t,isTerminating:x(t),isFullyTerminating:w(t),isSharp:_(t),prongCount:v(t),getRealProngCount:b(t),ordering:g(t),curve:e,loop:e.loop}}function S(t){let n=t;if(x(n))return[n];const e=[];do{e.push(n);const t=n.next.prevOnCircle;n=n=n===t?n.next.next:t}while(n!==t);return e}function I(t,n){const e=h(t),r=new Set;for(t of e)x(t)||r.has(t.next.prevOnCircle)||n(t),r.add(t)}function N(t){const n=[],e=t;let r=e;for(;r!==e.prevOnCircle;)x(r)||n.push(r.next),r=r.nextOnCircle;return n}function y(t,n){n(t);const e=m(t).filter(t=>!x(t)).map(t=>t.next);for(const t of e){const e=[t];for(;e.length;){const t=e.pop();n(t),e.push(...N(t))}}}const C=["prev","next","prevOnCircle","nextOnCircle","holeCloserTwin"];function O(t){const n=new Map,e=E(t);n.set(t,e);const r=[{cpNode:t,newCpNode:e}];for(;r.length;){const{cpNode:t,newCpNode:e}=r.pop();for(const o of C){const i=t[o];if(void 0===i)continue;let c=n.get(i);c||(c=E(i),n.set(i,c),r.push({cpNode:i,newCpNode:c})),e[o]=c}}return e}function E(t){return{...t,prev:void 0,next:void 0,prevOnCircle:void 0,nextOnCircle:void 0,holeCloserTwin:void 0}}function T(t){const n=t,e=t.next,r=n.pointOnShape,o=e.pointOnShape,i=r.curve,c=o.curve;if(i.loop!==c.loop)return[];const s=[];return c===i?s.push({ps:r.curve.ps,ts:[r.t,o.t]}):(s.push({ps:r.curve.ps,ts:[r.t,1]}),function(t,n,e,r){let o=n;do{o=o.next;const n=o===e?r:1;t.push({ps:o.ps,ts:[0,n]})}while(o!==e)}(s,r.curve,o.curve,o.t)),s}function A(t,n,e){if(4===t.length)return function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=c-n*(c-u),h=u-n*(u-l),d=p-n*(p-h),g=s-n*(s-f),v=f-n*(f-a),m=g-n*(g-v);return[e,[p,g],[d,m],[d-n*(d-(h-n*(h-(l-n*(l-i[0]))))),m-n*(m-(v-n*(v-(a-n*(a-i[1])))))]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=c-n*(c-u),h=u-n*(u-l),d=l-n*(l-i[0]),g=p-n*(p-h),v=h-n*(h-d),m=s-n*(s-f),x=f-n*(f-a),b=a-n*(a-i[1]),w=m-n*(m-x),_=x-n*(x-b);return[[g-n*(g-v),w-n*(w-_)],[v,_],[d,b],i]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=t[3],s=r[0],u=r[1],f=o[0],l=o[1],a=i[0],p=i[1],h=n*n,d=n*h,g=e*e,v=e*g,m=n*e,x=s-f,b=a-f,w=x+b,_=n*x,M=e*x,S=c[0]-s-3*b,I=u-l,N=p-l,y=I+N,C=n*I,O=e*I,E=c[1]-u-3*N;return[[d*S+(3*n*(n*w-x)+s),d*E+(3*n*(n*y-I)+u)],[m*(n*S+2*w)+(h*w+s-(M+2*_)),m*(n*E+2*y)+(h*y+u-(O+2*C))],[m*(e*S+2*w)+(g*w+s-(2*M+_)),m*(e*E+2*y)+(g*y+u-(2*O+C))],[v*S+(3*e*(e*w-x)+s),v*E+(3*e*(e*y-I)+u)]]}(t,n,e)}(t,n,e);if(3===t.length)return function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=n*n,l=i-s,a=c-u;return[e,[-n*l+i,-n*a+c],[f*(l+(o[0]-s))-(2*n*l-i),f*(a+(o[1]-u))-(2*n*a-c)]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=n*n,l=i-s,a=o[0]-s,p=c-u,h=o[1]-u;return[[f*(l+a)-(2*n*l-i),f*(p+h)-(2*n*p-c)],[n*a+s,n*h+u],o]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=r[0],s=r[1],u=o[0],f=o[1],l=n*n,a=e*e,p=n*e,h=c-u,d=h+(i[0]-u),g=s-f,v=g+(i[1]-f);return[[l*d-(2*n*h-c),l*v-(2*n*g-s)],[p*d-(h*(e+n)-c),p*v-(g*(e+n)-s)],[a*d-(2*e*h-c),a*v-(2*e*g-s)]]}(t,n,e)}(t,n,e);if(2===t.length)return function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1];return[e,[n*(r[0]-o)+o,n*(r[1]-i)+i]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1];return[[n*(r[0]-o)+o,n*(r[1]-i)+i],r]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=r[0],c=r[1],s=o[0],u=o[1];return[[n*(s-i)+i,n*(u-c)+c],[e*(s-i)+i,e*(u-c)+c]]}(t,n,e)}(t,n,e);if(1===t.length)return t;throw new Error("The given bezier curve must be of order <= 3.")}function P(t){return T(t).map(t=>A(t.ps,t.ts[0],t.ts[1]))}function k(t,n){const{cpTrees:e}=n,r=t.prev,o=t.next;r.next=o,o.prev=r,e.get(t.pointOnShape.curve.loop).remove(t,!1)}function B(t,n){const e=v(t);if(2!==e)throw new Error(`Cannot delete \`CpNode\` on ${e}-prong`);m(t).forEach(t=>k(t,n))}function z(t){const n=[],e=t.next;let r=e;do{n.push(r),r=r.nextOnCircle}while(r.nextOnCircle!==e);return n}function F(t,n,e){if(void 0===t.size||void 0===e)return;const r=e[n];if(t.size>r&&void 0!==r)for(const[n]of t){t.delete(n);break}}const L=[function(t,n){let e,r=!1;return function(){return r||(e=t(),r=!0),e}},function(t,n,e=!1){const r=new WeakMap,o=new Map;function i(t){return"object"!=typeof t&&"function"!=typeof t||null===t?o:r}const c=function(r){let c;const s=i(r);return s.has(r)?(e&&console.log("cache hit"),c=s.get(r)):(e&&console.log("cache miss"),c=t(r),s.set(r,c),F(o,0,n)),c};return c.mapS=o,c.weakMapS=r,c.clearCache=function(){o.clear()},c.addToCache=function(t,e){const r=i(e);r.set(e,t),F(r,1,n)},c},function(t,n){const e=new WeakMap,r=new Map;function o(t,o){const i=("object"==typeof o||"function"==typeof o)&&null!==o;let c="object"!=typeof t&&"function"!=typeof t||null===t?r:e,s=c.get(t);return void 0===s&&(s={weakMap:new WeakMap,map:new Map},c.set(t,s),F(c,0,n)),i?s.weakMap:s.map}function i(e,r){const i=o(e,r);let c;return i.has(r)?c=i.get(r):(c=t(e,r),i.set(r,c),F(i,1,n)),c}return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r){const i=o(e,r);i.set(r,t),F(i,1,n)},i},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i){const c=("object"==typeof o||"function"==typeof o)&&null!==o,s=("object"==typeof i||"function"==typeof i)&&null!==i;let u="object"!=typeof t&&"function"!=typeof t||null===t?r:e,f=u.get(t);void 0===f&&(f={weakMap:new WeakMap,map:new Map},u.set(t,f),F(u,0,n));const l=c?f.weakMap:f.map;let a=l.get(o);return void 0===a&&(a={weakMap:new WeakMap,map:new Map},l.set(o,a),F(l,1,n)),s?a.weakMap:a.map}const i=function(e,r,i){const c=o(e,r,i);let s;return c.has(i)?s=c.get(i):(s=t(e,r,i),c.set(i,s),F(c,2,n)),s};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i){const c=o(e,r,i);c.set(i,t),F(c,2,n)},i},function(t,n,e=!1){const r=new WeakMap,o=new Map;function i(t,e,i,c){const s=("object"==typeof e||"function"==typeof e)&&null!==e,u=("object"==typeof i||"function"==typeof i)&&null!==i,f=("object"==typeof c||"function"==typeof c)&&null!==c;let l="object"!=typeof t&&"function"!=typeof t||null===t?o:r,a=l.get(t);void 0===a&&(a={weakMap:new WeakMap,map:new Map},l.set(t,a),F(l,0,n));const p=s?a.weakMap:a.map;let h=p.get(e);void 0===h&&(h={weakMap:new WeakMap,map:new Map},p.set(e,h),F(p,1,n));const d=u?h.weakMap:h.map;let g=d.get(i);return void 0===g&&(g={weakMap:new WeakMap,map:new Map},d.set(i,g),F(d,2,n)),f?g.weakMap:g.map}const c=function(r,o,c,s){const u=i(r,o,c,s);let f;return u.has(s)?(e&&console.log("cache hit"),f=u.get(s)):(e&&console.log("cache miss"),f=t(r,o,c,s),u.set(s,f),F(u,3,n)),f};return c.mapS=o,c.weakMapS=r,c.clearCache=function(){o.clear()},c.addToCache=function(t,e,r,o,c){const s=i(e,r,o,c);s.set(c,t),F(s,3,n)},c},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i,c,s){const u=("object"==typeof o||"function"==typeof o)&&null!==o,f=("object"==typeof i||"function"==typeof i)&&null!==i,l=("object"==typeof c||"function"==typeof c)&&null!==c,a=("object"==typeof s||"function"==typeof s)&&null!==s;let p="object"!=typeof t&&"function"!=typeof t||null===t?r:e,h=p.get(t);void 0===h&&(h={weakMap:new WeakMap,map:new Map},p.set(t,h),F(p,0,n));const d=u?h.weakMap:h.map;let g=d.get(o);void 0===g&&(g={weakMap:new WeakMap,map:new Map},d.set(o,g),F(d,1,n));const v=f?g.weakMap:g.map;let m=v.get(i);void 0===m&&(m={weakMap:new WeakMap,map:new Map},v.set(i,m),F(v,2,n));const x=l?m.weakMap:m.map;let b=x.get(c);return void 0===b&&(b={weakMap:new WeakMap,map:new Map},x.set(c,b),F(x,3,n)),a?b.weakMap:b.map}const i=function(e,r,i,c,s){const u=o(e,r,i,c,s);let f;return u.has(s)?f=u.get(s):(f=t(e,r,i,c,s),u.set(s,f),F(u,4,n)),f};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i,c,s){const u=o(e,r,i,c,s);u.set(s,t),F(u,4,n)},i},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i,c,s,u){const f=("object"==typeof o||"function"==typeof o)&&null!==o,l=("object"==typeof i||"function"==typeof i)&&null!==i,a=("object"==typeof c||"function"==typeof c)&&null!==c,p=("object"==typeof s||"function"==typeof s)&&null!==s,h=("object"==typeof u||"function"==typeof u)&&null!==u;let d="object"!=typeof t&&"function"!=typeof t||null===t?r:e,g=d.get(t);void 0===g&&(g={weakMap:new WeakMap,map:new Map},d.set(t,g),F(d,0,n));const v=f?g.weakMap:g.map;let m=v.get(o);void 0===m&&(m={weakMap:new WeakMap,map:new Map},v.set(o,m),F(v,1,n));const x=l?m.weakMap:m.map;let b=x.get(i);void 0===b&&(b={weakMap:new WeakMap,map:new Map},x.set(i,b),F(x,2,n));const w=a?b.weakMap:b.map;let _=w.get(c);void 0===_&&(_={weakMap:new WeakMap,map:new Map},w.set(c,_),F(w,3,n));const M=p?_.weakMap:_.map;let S=M.get(s);return void 0===S&&(S={weakMap:new WeakMap,map:new Map},M.set(s,S),F(M,4,n)),h?S.weakMap:S.map}const i=function(e,r,i,c,s,u){const f=o(e,r,i,c,s,u);let l;return f.has(u)?l=f.get(u):(l=t(e,r,i,c,s,u),f.set(u,l),F(f,5,n)),l};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i,c,s,u){const f=o(e,r,i,c,s,u);f.set(u,t),F(f,5,n)},i},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i,c,s,u,f){const l=("object"==typeof o||"function"==typeof o)&&null!==o,a=("object"==typeof i||"function"==typeof i)&&null!==i,p=("object"==typeof c||"function"==typeof c)&&null!==c,h=("object"==typeof s||"function"==typeof s)&&null!==s,d=("object"==typeof u||"function"==typeof u)&&null!==u,g=("object"==typeof f||"function"==typeof f)&&null!==f;let v="object"!=typeof t&&"function"!=typeof t||null===t?r:e,m=v.get(t);void 0===m&&(m={weakMap:new WeakMap,map:new Map},v.set(t,m),F(v,0,n));const x=l?m.weakMap:m.map;let b=x.get(o);void 0===b&&(b={weakMap:new WeakMap,map:new Map},x.set(o,b),F(x,1,n));const w=a?b.weakMap:b.map;let _=w.get(i);void 0===_&&(_={weakMap:new WeakMap,map:new Map},w.set(i,_),F(w,2,n));const M=p?_.weakMap:_.map;let S=M.get(c);void 0===S&&(S={weakMap:new WeakMap,map:new Map},M.set(c,S),F(M,3,n));const I=h?S.weakMap:S.map;let N=I.get(s);void 0===N&&(N={weakMap:new WeakMap,map:new Map},I.set(s,N),F(I,4,n));const y=d?N.weakMap:N.map;let C=y.get(u);return void 0===C&&(C={weakMap:new WeakMap,map:new Map},y.set(u,C),F(y,5,n)),g?C.weakMap:C.map}const i=function(e,r,i,c,s,u,f){const l=o(e,r,i,c,s,u,f);let a;return l.has(f)?a=l.get(f):(a=t(e,r,i,c,s,u,f),l.set(f,a),F(l,6,n)),a};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i,c,s,u,f){const l=o(e,r,i,c,s,u,f);l.set(f,t),F(l,6,n)},i},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i,c,s,u,f,l){const a=("object"==typeof o||"function"==typeof o)&&null!==o,p=("object"==typeof i||"function"==typeof i)&&null!==i,h=("object"==typeof c||"function"==typeof c)&&null!==c,d=("object"==typeof s||"function"==typeof s)&&null!==s,g=("object"==typeof u||"function"==typeof u)&&null!==u,v=("object"==typeof f||"function"==typeof f)&&null!==f,m=("object"==typeof l||"function"==typeof l)&&null!==l;let x="object"!=typeof t&&"function"!=typeof t||null===t?r:e,b=x.get(t);void 0===b&&(b={weakMap:new WeakMap,map:new Map},x.set(t,b),F(x,0,n));const w=a?b.weakMap:b.map;let _=w.get(o);void 0===_&&(_={weakMap:new WeakMap,map:new Map},w.set(o,_),F(w,1,n));const M=p?_.weakMap:_.map;let S=M.get(i);void 0===S&&(S={weakMap:new WeakMap,map:new Map},M.set(i,S),F(M,2,n));const I=h?S.weakMap:S.map;let N=I.get(c);void 0===N&&(N={weakMap:new WeakMap,map:new Map},I.set(c,N),F(I,3,n));const y=d?N.weakMap:N.map;let C=y.get(s);void 0===C&&(C={weakMap:new WeakMap,map:new Map},y.set(s,C),F(y,4,n));const O=g?C.weakMap:C.map;let E=O.get(u);void 0===E&&(E={weakMap:new WeakMap,map:new Map},O.set(u,E),F(O,5,n));const T=v?E.weakMap:E.map;let A=T.get(f);return void 0===A&&(A={weakMap:new WeakMap,map:new Map},T.set(f,A),F(T,6,n)),m?A.weakMap:A.map}const i=function(e,r,i,c,s,u,f,l){const a=o(e,r,i,c,s,u,f,l);let p;return a.has(l)?p=a.get(l):(p=t(e,r,i,c,s,u,f,l),a.set(l,p),F(a,7,n)),p};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i,c,s,u,f,l){const a=o(e,r,i,c,s,u,f,l);a.set(l,t),F(a,7,n)},i}];function Y(t,n,e=!1){const r=t.length;if(r>8)throw new Error("A maximum of 8 formal parameters are supported");return(0,L[r])(t,n,e)}function H(t,n){const[[e,r],[o,i]]=t,[[c,s],[u,f]]=n,l=o-e,a=i-r,p=u-c,h=f-s,d=p*a-h*l;if(0===d)return;const g=((s-r)*l-(c-e)*a)/d;return[c+g*p,s+g*h]}function X(t,n){return[n[0]-t[0],n[1]-t[1]]}function $(t,n){return t[0]*n[0]+t[1]*n[1]}function V(t){return[-t[1],t[0]]}function D(t,n){return t[0]*n[1]-t[1]*n[0]}function q(t,n,e){return[t[0]+(n[0]-t[0])*e,t[1]+(n[1]-t[1])*e]}function j(t,n){function e(n){return[t[0]+n[0],t[1]+n[1]]}return void 0===n?e:e(n)}function W(t){const n=1/Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]*n,t[1]*n]}function Q(t,n,e){function r(e){return[e[0]*n-e[1]*t,e[0]*t+e[1]*n]}return void 0===e?r:r(e)}function R(t,n){let e=0;for(let r=0;r<t.length;r++)e=e*n+t[r];return e}function G(t){if(4===t.length)return function(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[3*(s-n+3*(r-i)),6*(i+n-2*r),3*(r-n)],[3*(u-e+3*(o-c)),6*(c+e-2*o),3*(o-e)]]}(t);if(3===t.length)return function(t){const[[n,e],[r,o],[i,c]]=t;return[[2*(i+n-2*r),2*(r-n)],[2*(c+e-2*o),2*(o-e)]]}(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t;return[[r-n],[o-e]]}(t);if(1===t.length)return[[0],[0]];throw new Error("The bezier curve must be of order <= 3.")}function U(t,n){const[e,r]=G(t);return[R(e,n),R(r,n)]}function Z(t,n){const e=t-n,r=t-e;return[t-(e+r)+(r-n),e]}function J(t,n){const e=t.length,r=n.length;let o=0,i=0;const c=[];for(;o<e&&i<r;)0!==t[o]?0!==n[i]?Math.abs(t[o])<=Math.abs(n[i])?(c.push(t[o]),o++):(c.push(n[i]),i++):i++:o++;for(;o<e;)c.push(t[o]),o++;for(;i<r;)c.push(n[i]),i++;if(0===c.length)return[0];const s=c.length;if(1===s)return c;const u=[],f=c[1],l=c[0];let a=f+l;const p=l-(a-f);0!==p&&u.push(p),i=0;for(let t=2;t<s;t++){const n=c[t],e=a+n,r=e-a,o=a-(e-r)+(n-r);0!==o&&u.push(o),a=e}return 0===a&&0!==u.length||u.push(a),u}const K=134217729;function tt(t,n){const e=t.length;let r;const o=t[0];let i=o*n;const c=K*o,s=c-(c-o),u=o-s,f=K*n,l=f-(f-n),a=n-l,p=[],h=u*a-(i-s*l-u*l-s*a);0!==h&&p.push(h);for(let o=1;o<e;o++){const e=t[o],c=e*n,s=K*e,u=s-(s-e),f=e-u,l=K*n,a=l-(l-n),h=n-a,d=f*h-(c-u*a-f*a-u*h),g=i+d,v=g-i,m=i-(g-v)+(d-v);0!==m&&p.push(m),r=g;const x=c+r,b=r-(x-c);0!==b&&p.push(b),i=x}return 0===i&&0!==p.length||p.push(i),p}function nt(t,n){const e=n.length;let r;const o=n[0];let i=o*t;const c=K*o,s=c-(c-o),u=o-s,f=K*t,l=f-(f-t),a=t-l,p=[],h=u*a-(i-s*l-u*l-s*a);0!==h&&p.push(h);for(let o=1;o<e;o++){const e=n[o],c=e*t,s=K*e,u=s-(s-e),f=e-u,l=K*t,a=l-(l-t),h=t-a,d=f*h-(c-u*a-f*a-u*h),g=i+d,v=g-i,m=i-(g-v)+(d-v);0!==m&&p.push(m),r=g;const x=c+r,b=r-(x-c);0!==b&&p.push(b),i=x}return 0===i&&0!==p.length||p.push(i),p}function et(t,n){let e=[0];for(let r=0;r<t.length;r++)e=J(e,tt(n,t[r]));return e}function rt(t){let n=t[0];for(let e=1;e<t.length;e++)n+=t[e];return n}function ot(t){const n=t.length,e=new Array(n);for(let r=0;r<n;r++)e[r]=-t[r];return e}function it(t,n){return J(t,ot(n))}function ct(t){return t[t.length-1]}const st=Z,ut=nt;function ft(t){if(4===t.length){const[[n,e],[r,o]]=t;return[ut(3,st(r,n)),ut(3,st(o,e))]}if(3===t.length){const[[n,e],[r,o]]=t;return[st(2*r,2*n),st(2*o,2*e)]}if(2===t.length){const[[n,e],[r,o]]=t;return[st(r,n),st(o,e)]}if(1===t.length)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3.")}function lt(t,n){const e=t+n,r=e-t;return[t-(e-r)+(n-r),e]}function at(t,n){const e=t.length;let r=n;const o=[];for(let n=0;n<e;n++){const e=t[n],i=r+e,c=i-r,s=r-(i-c)+(e-c);0!==s&&o.push(s),r=i}return 0===r&&0!==o.length||o.push(r),o}const pt=lt,ht=nt,dt=at;function gt(t){if(4===t.length){const[[n,e],[r,o],[i,c]]=t;return[ht(6,dt(pt(i,n),-2*r)),ht(6,dt(pt(c,e),-2*o))]}if(3===t.length){const[[n,e],[r,o],[i,c]]=t;return[dt(pt(2*i,2*n),-4*r),dt(pt(2*c,2*e),-4*o)]}if(t.length<=2)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3")}const vt=Z,mt=nt,xt=J;function bt(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[mt(6,xt(vt(s,n),mt(3,vt(r,i))))],[mt(6,xt(vt(u,e),mt(3,vt(o,c))))]]}if(t.length<=3)return[[[0]],[[0]]];throw new Error("The given bezier curve must be of order <= 3.")}const{sign:wt}=Math;function _t(t,n){const[e,r]=ft(t),[o,i]=gt(t),[c,s]=ft(n),[u,f]=gt(n),l=it(et(e,i),et(r,o)),a=it(et(c,f),et(s,u)),p=ct(l),h=ct(a);if(wt(p)!==wt(h))return p-h;const d=J(et(c,c),et(s,s)),g=J(et(e,e),et(r,r)),v=et(d,d),m=et(v,d),x=et(g,g),b=et(x,g);if(0!==p||0!==h){const t=et(l,l),n=et(a,a),e=ct(it(et(t,m),et(n,b)));if(0!==e)return p>0?e:-e}const[[w],[_]]=bt(t),[[M],[S]]=bt(n),I=it(et(e,_),et(r,w)),N=J(et(e,o),et(r,i)),y=it(et(c,S),et(s,M)),C=J(et(c,u),et(s,f)),O=it(et(g,I),tt(et(l,N),3)),E=it(et(d,y),tt(et(a,C),3)),T=ct(O),A=ct(E);if(T!==A)return T-A;if(0===T&&0===A)return 0;const P=et(O,O),k=et(v,m),B=et(E,E),z=et(x,b),F=ct(it(et(P,k),et(B,z)));return T>0?F:-F}function Mt(t,n){return t[0]===n[0]&&t[1]===n[1]}function St(t,n){const{ccw:e,tangentI:r,tangentO:o,dotTangents:i}=function(t,n){const e=t.length;let r=t[e-2],o=n[0],i=n[1];Mt(r,o)&&(r=t[e-3]),Mt(o,i)&&(i=n[2]);const c=function(t,n,e){const r=Z(t[0],e[0]),o=Z(n[1],e[1]),i=Z(t[1],e[1]),c=Z(n[0],e[0]);return rt(J(et(r,o),ot(et(i,c))))}(r,o,i),s=[Z(o[0],r[0]),Z(o[1],r[1])],u=[Z(i[0],o[0]),Z(i[1],o[1])],f=function(t,n){return rt(J(et(t[0],n[0]),et(t[1],n[1])))}(s,u);return 0!==c||f>0?{ccw:c,tangentI:s,tangentO:u,dotTangents:f}:{ccw:_t(t.slice().reverse(),n),tangentI:s,tangentO:u,dotTangents:f}}(t,n),c=e<0,s=e>0,u=[W(r.map(t=>t[1])),W(o.map(t=>t[1]))],f=D(u[0],u[1]);let l,a;return i>0?(l=f<-.0698,a=f>.0698):(l=c,a=s),{tangents:u,isSharp:c,isDull:s,isQuiteSharp:l,isQuiteDull:a}}const It=Y(function(t){const{t:n,curve:e}=t;return St(1===n?e.ps:e.prev.ps,1===n?e.next.ps:e.ps)});function Nt(t){return 0===t.t||1===t.t}function yt(t){return!!Nt(t)&&It(t).isSharp}function Ct(t){const n=t.pointOnShape.circle.center,e=t,r=t.nextOnCircle,o=e.pointOnShape,i=r.pointOnShape,c=o.p,s=i.p;let u;if(yt(o)){let t,n;0===o.t?(t=o.curve,n=o.curve.prev):1===o.t&&(t=o.curve.next,n=o.curve);const e=W(U(t.ps,0)),r=[-(f=W(U(n.ps,1)))[0],-f[1]],i=$(e,r),c=Math.sqrt((1+i)/2);u=Q(Math.sqrt((1-i)/2),c,r)}else u=c[0]===s[0]&&c[1]===s[1]?X(c,n):V(X(c,s));var f;return[n,j(W(u),n)]}const{abs:Ot}=Math,Et=1e-4;function Tt(t,n){const e=t.pointOnShape.circle.center,r=Ct(t),o=n.pointOnShape.circle.center,i=Ct(n.prevOnCircle),c=H(r,i),s=X(e,o);let u;if(c){const t=X(e,c),n=X(o,c);u=$(t,s)<0||$(n,s)>0}else u=!0;if(!u)return[e,c,o];const f=V(s),l=X(r[0],r[1]),a=X(i[0],i[1]),p=Ot(D(s,l))/9,h=Ot(D(s,a))/9;if(p>.01||h>.01)return[e,o];if(p>Et||h>Et){const t=q(e,o,1/3),n=q(e,o,2/3),c=j(f,t),s=[n,j(f,n)];return[e,H(r,[t,c]),H(i,s),o]}return[e,o]}function At(t){return Tt(t,t.next)}function Pt(t){const n=t;let e=n;for(;e.next===e.prevOnCircle;)if(e=e.next,e===n)return;return e}function kt(t,n){return m(t).indexOf(n)>=0}function Bt(t){return 1===b(t)&&!t.isHoleClosing}function zt(t){return 2===b(t)}function Ft(t){return m(t).every(x)}function Lt(t){if(Ft(t))return[];for(;x(t);)t=t.nextOnCircle;for(t=t.next;2===b(t);)t=t.next;t=t.prevOnCircle;const n=[];do{n.push(t),t=t.next}while(!w(t)&&2===b(t));return n}function Yt(t){return Lt(t).map(t=>At(t))}function Ht(t,n){const e=n[0]-t[0],r=n[1]-t[1];return Math.sqrt(e*e+r*r)}function Xt(t,n){const[e,r]=t,[[o,i],[c,s]]=n;return Ht([o+e*(c-o),i+e*(s-i)],[o+r*(c-o),i+r*(s-i)])}function $t(t,n,e=16){if(n[0]===n[1])return 0;const{weights:r,abscissas:o}=Vt[e],[i,c]=n;let s=0;const u=(c-i)/2,f=(c+i)/2;for(let n=0;n<=e-1;n++)s+=r[n]*t(u*o[n]+f);return u*s}Y(At);const Vt={2:{weights:[1,1],abscissas:[-.5773502691896257,.5773502691896257]},4:{weights:[.6521451548625461,.6521451548625461,.3478548451374538,.3478548451374538],abscissas:[-.3399810435848563,.3399810435848563,-.8611363115940526,.8611363115940526]},8:{weights:[.362683783378362,.362683783378362,.3137066458778873,.3137066458778873,.2223810344533745,.2223810344533745,.1012285362903763,.1012285362903763],abscissas:[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363]},16:{weights:[.027152459411754096,.062253523938647894,.09515851168249279,.12462897125553388,.14959598881657674,.16915651939500254,.18260341504492358,.1894506104550685,.1894506104550685,.18260341504492358,.16915651939500254,.14959598881657674,.12462897125553388,.09515851168249279,.062253523938647894,.027152459411754096],abscissas:[-.9894009349916499,-.9445750230732326,-.8656312023878318,-.755404408355003,-.6178762444026438,-.45801677765722737,-.2816035507792589,-.09501250983763744,.09501250983763744,.2816035507792589,.45801677765722737,.6178762444026438,.755404408355003,.8656312023878318,.9445750230732326,.9894009349916499]},64:{weights:[.048690957009139724,.048690957009139724,.04857546744150343,.04857546744150343,.048344762234802954,.048344762234802954,.04799938859645831,.04799938859645831,.04754016571483031,.04754016571483031,.04696818281621002,.04696818281621002,.046284796581314416,.046284796581314416,.04549162792741814,.04549162792741814,.044590558163756566,.044590558163756566,.04358372452932345,.04358372452932345,.04247351512365359,.04247351512365359,.04126256324262353,.04126256324262353,.03995374113272034,.03995374113272034,.038550153178615626,.038550153178615626,.03705512854024005,.03705512854024005,.035472213256882386,.035472213256882386,.033805161837141606,.033805161837141606,.03205792835485155,.03205792835485155,.030234657072402478,.030234657072402478,.028339672614259483,.028339672614259483,.02637746971505466,.02637746971505466,.024352702568710874,.024352702568710874,.022270173808383253,.022270173808383253,.02013482315353021,.02013482315353021,.017951715775697343,.017951715775697343,.015726030476024718,.015726030476024718,.013463047896718643,.013463047896718643,.011168139460131128,.011168139460131128,.008846759826363947,.008846759826363947,.006504457968978363,.006504457968978363,.004147033260562468,.004147033260562468,.001783280721696433,.001783280721696433],abscissas:[-.024350292663424433,.024350292663424433,-.07299312178779904,.07299312178779904,-.12146281929612056,.12146281929612056,-.16964442042399283,.16964442042399283,-.21742364374000708,.21742364374000708,-.2646871622087674,.2646871622087674,-.31132287199021097,.31132287199021097,-.3572201583376681,.3572201583376681,-.4022701579639916,.4022701579639916,-.4463660172534641,.4463660172534641,-.48940314570705296,.48940314570705296,-.5312794640198946,.5312794640198946,-.571895646202634,.571895646202634,-.6111553551723933,.6111553551723933,-.6489654712546573,.6489654712546573,-.6852363130542333,.6852363130542333,-.7198818501716109,.7198818501716109,-.7528199072605319,.7528199072605319,-.7839723589433414,.7839723589433414,-.8132653151227975,.8132653151227975,-.8406292962525803,.8406292962525803,-.8659993981540928,.8659993981540928,-.8893154459951141,.8893154459951141,-.9105221370785028,.9105221370785028,-.9295691721319396,.9295691721319396,-.9464113748584028,.9464113748584028,-.9610087996520538,.9610087996520538,-.973326827789911,.973326827789911,-.983336253884626,.983336253884626,-.9910133714767443,.9910133714767443,-.9963401167719553,.9963401167719553,-.9993050417357722,.9993050417357722]}},{sqrt:Dt}=Math;function qt(t){const[n,e]=G(t);return function(t){const r=R(n,t),o=R(e,t);return Dt(r*r+o*o)}}const{abs:jt}=Math,Wt=[[0,0],[0,0],[0,0]];function Qt(t,n,e){return 0===n?1===e?{ps:t,_ps:Wt}:function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=o[0],l=o[1],a=n*n,p=i-s,h=c-u,d=[[i,c],[-n*p+i,-n*h+c],[a*(p+(f-s))-(2*n*p-i),a*(h+(l-u))-(2*n*h-c)]],g=jt(n),v=jt(i),m=jt(s),x=jt(f),b=v+m,w=jt(c),_=jt(u),M=w+_;return{ps:d,_ps:[[0,0],[g*b+v,g*M+w],[a*(b+(x+m))+(2*g*b+v),a*(M+(jt(l)+_))+(2*g*M+w)]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=o[0],l=o[1],a=n*n,p=i-s,h=f-s,d=c-u,g=l-u,v=[[a*(p+h)-(2*n*p-i),a*(d+g)-(2*n*d-c)],[n*h+s,n*g+u],[f,l]],m=jt(n),x=jt(i),b=jt(s),w=x+b,_=jt(f)+b,M=jt(c),S=jt(u),I=M+S;return{ps:v,_ps:[[a*(w+_)+(2*m*w+x),a*(I+(jt(l)+S))+(2*m*I+M)],[m*_+b,0],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=r[0],s=r[1],u=o[0],f=o[1],l=i[0],a=i[1],p=n*n,h=e*e,d=n*e,g=c-u,v=g+(l-u),m=s-f,x=m+(a-f),b=p*v-(2*n*g-c),w=d*v-(g*(e+n)-c),_=h*v-(2*e*g-c),M=p*x-(2*n*m-s),S=d*x-(m*(e+n)-s),I=h*x-(2*e*m-s),N=jt(n),y=jt(e),C=jt(d),O=jt(c),E=jt(u),T=O+E,A=T+jt(l)+E,P=jt(s),k=jt(f),B=P+k,z=B+jt(a)+k;return{ps:[[b,M],[w,S],[_,I]],_ps:[[p*A+(2*N*T+O),p*z+(2*N*B+P)],[C*A+(T*(y+N)+O),C*x+(B*(y+N)+P)],[h*A+(2*y*T+O),h*z+(2*y*B+P)]]}}(t,n,e)}const Rt=134217729;function Gt(t,n){const e=t*n,r=Rt*t,o=r-(r-t),i=t-o,c=Rt*n,s=c-(c-n),u=n-s;return[i*u-(e-o*s-i*s-o*u),e]}function Ut(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],c=r+i,s=c-r,u=e+o,f=u-e,l=r-(c-s)+(i-s)+u,a=c+l,p=e-(u-f)+(o-f)+(l-(a-c)),h=a+p;return[p-(h-a),h]}function Zt(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],c=r-i,s=c-r,u=e-o,f=u-e,l=r-(c-s)+(-i-s)+u,a=c+l,p=e-(u-f)+(-o-f)+(l-(a-c)),h=a+p;return[p-(h-a),h]}const{atan2:Jt}=Math,Kt=Gt;function tn(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],c=Zt(Kt(i,e),Kt(o,r))[1],s=Ut(Kt(o,e),Kt(i,r))[1];return Jt(c,s)}const{abs:nn}=Math;function en(t){const n=[];for(let e=0;e<t.length-1;e++){const r=[t[e+1][0]-t[e][0],t[e+1][1]-t[e][1]];0!==(0!==r[0]||r[1])&&n.push(r)}const e=n.length;let r=0;for(let t=0;t<e-1;t++)r+=nn(tn(n[t],n[t+1]));return r}function rn(t,n=.4,e=2**-16){const r=[0],o=[1];for(;;){const i=r[r.length-1],c=o[o.length-1];if(en(A(t,i,c))<=n||c-i<=e){if(r.push(o.pop()),1===c)return r;continue}const s=(i+c)/2;o.push(s)}}const{sqrt:on,log:cn}=Math;function sn(t,n,e=.4,r=16){const o=t[0],i=t[1];if(o===i)return 0;const[[c,s],[u,f],[l,a]]=n;if(c===u&&u===l&&s===f&&f===a)return 0;const p=Qt(n,o,i).ps,h=rn(p,e);let d=0;for(let t=0;t<h.length-1;t++){const n=h[t],e=h[t+1];d+=$t(qt(p),[n,e],r)}return d}const{abs:un}=Math,fn=[[0,0],[0,0],[0,0],[0,0]];function ln(t,n,e){return 0===n?1===e?{ps:t,_ps:fn}:function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],d=c-n*(c-u),g=u-n*(u-l),v=d-n*(d-g),m=v-n*(v-(g-n*(g-(l-n*(l-p))))),x=s-n*(s-f),b=f-n*(f-a),w=x-n*(x-b),_=w-n*(w-(b-n*(b-(a-n*(a-h))))),M=un(n),S=un(c),I=un(u),N=un(l),y=un(p),C=un(s),O=un(f),E=un(a),T=S+M*(S+I),A=I+M*(I+N),P=T+M*(T+A),k=C+M*(C+O),B=O+M*(O+E),z=k+M*(k+B);return{ps:[[c,s],[d,x],[v,w],[m,_]],_ps:[[0,0],[T,k],[P,z],[P+M*(P+(A+M*(A+(N+M*(N+y))))),z+M*(z+(B+M*(B+(E+M*(E+un(h))))))]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],d=c-n*(c-u),g=u-n*(u-l),v=l-n*(l-p),m=d-n*(d-g),x=g-n*(g-v),b=m-n*(m-x),w=s-n*(s-f),_=f-n*(f-a),M=a-n*(a-h),S=w-n*(w-_),I=_-n*(_-M),N=S-n*(S-I),y=un(n),C=un(c),O=un(u),E=un(l),T=un(p),A=un(s),P=un(f),k=un(a),B=C+y*(C+O),z=O+y*(O+E),F=E+y*(E+T),L=B+y*(B+z),Y=z+y*(z+F),H=A+y*(A+P),X=P+y*(P+k),$=k+y*(k+un(h)),V=H+y*(H+X),D=X+y*(X+$);return{ps:[[b,N],[x,I],[v,M],[p,h]],_ps:[[L+y*(L+Y),V+y*(V+D)],[Y,D],[F,$],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=t[3],s=r[0],u=r[1],f=o[0],l=o[1],a=i[0],p=i[1],h=n*n,d=n*h,g=e*e,v=e*g,m=n*e,x=s-f,b=a-f,w=c[0]-s,_=x+b,M=n*x,S=e*x,I=w-3*b,N=u-l,y=p-l,C=c[1]-u,O=N+y,E=n*N,T=e*N,A=C-3*y,P=d*I+(3*n*(n*_-x)+s),k=m*(n*I+2*_)+(h*_+s-(S+2*M)),B=m*(e*I+2*_)+(g*_+s-(2*S+M)),z=v*I+(3*e*(e*_-x)+s),F=d*A+(3*n*(n*O-N)+u),L=m*(n*A+2*O)+(h*O+u-(T+2*E)),Y=m*(e*A+2*O)+(g*O+u-(2*T+E)),H=v*A+(3*e*(e*O-N)+u),X=un(n),$=un(e),V=un(m),D=un(d),q=un(v),j=un(s),W=un(f),Q=j+W,R=un(a)+W,G=Q+R,U=X*Q,Z=$*Q,J=un(w)+3*R,K=un(u),tt=un(l),nt=K+tt,et=un(p)+tt,rt=nt+et,ot=X*nt,it=$*nt,ct=un(C)+3*et;return{ps:[[P,F],[k,L],[B,Y],[z,H]],_ps:[[D*J+(3*X*(X*G+Q)+j),D*ct+(3*X*(X*rt+nt)+K)],[V*(X*J+2*G)+(h*G+j+(Z+2*U)),V*(X*ct+2*rt)+(h*rt+K+(it+2*ot))],[V*($*J+2*G)+(g*G+j+(2*Z+U)),V*($*ct+2*rt)+(g*rt+K+(2*it+ot))],[q*J+(3*$*($*G+Q)+j),q*ct+(3*$*($*rt+nt)+K)]]}}(t,n,e)}function an(t,n,e=.4,r=16){const o=t[0],i=t[1];if(o===i)return 0;const[[c,s],[u,f],[l,a],[p,h]]=n;if(c===u&&u===l&&l===p&&s===f&&f===a&&a===h)return 0;const d=ln(n,o,i).ps,g=rn(d,e);let v=0;for(let t=0;t<g.length-1;t++){const n=g[t],e=g[t+1];v+=$t(qt(d),[n,e],r)}return v}function pn(t,n=.4,e=16){if(4===t.length)return an([0,1],t,n,e);if(3===t.length)return sn([0,1],t,n,e);if(2===t.length)return Xt([0,1],t);if(1===t.length)return 0;throw new Error("The given bezier curve must be of order <= 3.")}function hn(t,n,e=!0){const{cpNodes:r,hasHoleCloser:o}=function(t,n,e=!0){if(!e&&t===n)return{cpNodes:[],hasHoleCloser:!1};const r=t,o=[r];let i=t.next,c=r.isHoleClosing;for(;i!==n&&i!==r;)i.isHoleClosing&&(c=!0),o.push(i),i=i.next;return{cpNodes:o,hasHoleCloser:c}}(t,n,e);return{pss:r.flatMap(P),hasHoleCloser:o}}function dn(t){let n=0;for(let e of t)n+=e;return n}function gn(t){const n=t,e=t.nextOnCircle,r=Ht(n.pointOnShape.p,e.pointOnShape.p),{pss:o,hasHoleCloser:i}=hn(n,e),c=dn(o.map(t=>pn(t)));return i?1/0:c/r}function vn(t,n){let e=t;const r=[];for(;e!==n;){const t=Tt(e,e.next);r.push(t),e=e.next}return r}function mn(t,n){const e=D(W(U(At(t),0)),W(U(At(n),0)));return Math.abs(Math.asin(e)*(180/Math.PI))}function xn(t){const n=[];return y(t,t=>{n.push(t)}),n}function bn(t,n){let e;return e=t.curve.idx-n.curve.idx,0!==e||(e=t.t-n.t,0!==e||(e=t.order-n.order,0!==e||(e=t.order2-n.order2))),e}function wn(t,n){return bn(t.pointOnShape,n.pointOnShape)}const _n={getChildren:z,getVertexForwardChildren:N,getAllOnLoop:h,getAllOnCircle:m,isOnSameCircle:kt,isTerminating:x,isFullyTerminating:w,getFirstExit:Pt,isSharp:_,isOneProng:Bt,getProngCount:v,getRealProngCount:b,cpNodeComparator:wn,enhanceCpNode:M,traverseCp:S,traverseEdges:I,traverseVertices:y,clone:O,getBoundaryBezierPartsToNext:T,getBoundaryBeziersToNext:P,removeVertex:B,getMatCurveToNext:At,isTwoProng:zt,getBranch:Lt,getBranchBeziers:Yt,getSalience:gn,getMatCurveBetween:Tt,getEdgeDirection:Ct,getBoundaryBeziersBetween:hn,getMatCurvesBetween:vn,getHoleClosers:d,getInitialDegAngleBetweenMatCurves:mn,getAllVertices:xn};function Mn(t){return n=>m(n).some(t)}const Sn=Mn(function(t){return 2!==b(t)&&!t.isHoleClosing});function In(t){const n=new Array(t.length);for(let e=0;e<t.length;e++)n[e]=-t[e];return n}function Nn(t){return n=>1/t(n.toReversed())}function yn(t){const n=t.length-1;if(n<1)return 0;t[0]<0&&(t=In(t));const e=[];for(let t=0;t<n;t++)e.push(1);let r=0;for(let o=0;o<=n;o++){if(t[o]>=0)continue;let n=1/0,i=!1;for(let r=0;r<o;r++){if(t[r]<=0)continue;const c=(-t[o]/(t[r]/2**e[r]))**(1/(o-r));e[r]++,n>c&&(n=c),i=!0}i&&r<n&&(r=n)}return r}Nn(yn);const Cn=(On=yn,t=>-On(function(t){const n=t.length-1;if(n<0)return[];const e=t.slice();for(let t=0;t<n+1;t++)t%2==(n-1)%2&&(e[t]=-e[t]);return e}(t)));var On;Nn(Cn);const{min:En,max:Tn}=Math,{abs:An}=Math;function Pn(t){const n=t.slice(),e=n.length;if(1===e)return n;let r=n[e-1],o=e;for(let t=e-2;t>=0;--t){const e=r,i=n[t];r=e+i;const c=i-(r-e);c&&(n[--o]=r,r=c)}let i=0;for(let t=o;t<e;++t){const e=n[t],o=r;r=e+o;const c=o-(r-e);c&&(n[i++]=c)}return n[i++]=r,n.length=i,n}const kn=Number.EPSILON,Bn=Number.EPSILON/2,zn=Bn*Bn,Fn=Yn(1),Ln=function(){const t=3*zn;return t/(1-t)}();function Yn(t){const n=t*Bn;return n/(1-n)}new Array(20).fill(0).map((t,n)=>Yn(n));const{abs:Hn}=Math,{abs:Xn}=Math,$n=134217729;function Vn(t,n){const e=n[0],r=n[1],o=r*t,i=$n*r,c=i-(i-r),s=r-c,u=$n*t,f=u-(u-t),l=t-f,a=s*l-(o-c*f-s*f-c*l)+e*t,p=o+a;return[a-(p-o),p]}const{abs:Dn}=Math;function qn(t,n,e){const r=t.length-1;if(r<0)return[[],[]];const o=Dn(n),i=t.slice(),c=e.slice();for(let t=0;t<=r;t++)for(let e=1;e<=r-t;e++){const t=i[e-1],r=c[e-1],s=Vn(n,t),u=o*r+Dn(s[1]),f=i[e];i[e]=Ut(f,s),c[e]=c[e]+u+Dn(i[e][1])}return[i,c]}const jn=2**27+1;function Wn(t,n){const e=t[1],r=n[1],o=e*r,i=jn*e,c=i-(i-e),s=e-c,u=jn*r,f=u-(u-r),l=r-f,a=s*l-(o-c*f-s*f-c*l)+(e*n[0]+t[0]*r),p=o+a;return[a-(p-o),p]}const{abs:Qn}=Math;function Rn(t,n){const e=t.length-1;if(e<0)return[];const r=t.slice();for(let t=0;t<=e;t++)for(let o=1;o<=e-t;o++)r[o]=Pn(J(r[o],tt(r[o-1],n)));return r}function Gn(t,n){const e=t.length-1;if(e<0)return[];const r=new Array(e+1);r[e]=t[e];let o=[1];for(let i=1;i<=e;i++)o=tt(o,n),r[e-i]=et(t[e-i],o);return r}const{abs:Un,sign:Zn}=Math;const Jn=134217729;function Kn(t,n){const e=t*n,r=Jn*t,o=r-(r-t),i=t-o,c=Jn*n,s=c-(c-n),u=n-s;return[i*u-(e-o*s-i*s-o*u),e]}const{abs:te}=Math;function ne(t,n){const e=te(n);let r=t[0],o=.5*te(r);for(let i=1;i<t.length;i++)r=r*n+t[i],o=o*e+te(r);return o=Bn*(2*o-te(r)),[r,o]}const ee=Math.abs,{abs:re}=Math,oe=Yn(1),ie=Yn(2);function ce(t,n,e=void 0,r=1){const o=t[0],[i,c]=ne(o,n),s=ie*function(t,n){const e=ee(n);let r=0;for(let n=0;n<t.length;n++)r=r*e+ee(t[n]);return r}(o,n),u=void 0!==e?R(e,re(n)):0;if((c+s+u)*r<Math.abs(i))return i;const f=function(t,n){const e=[],r=[];let o,i=t[0];for(let c=1;c<t.length;c++){const[s,u]=Kn(i,n);[o,i]=lt(u,t[c]),e.push(s),r.push(o)}return{r̂:i,pπ:e,pσ:r}}(o,n),{pπ:l,pσ:a}=f;let{r̂:p}=f;const[h,d]=ne(l,n),[g,v]=ne(a,n),[m,x]=ne(t[1],n);let b=d+v+x+u;return p=h+g+m+p,b+=oe*p,b*r<Math.abs(p)?p:0}function se(t,n){let e=[0];for(let r=0;r<t.length;r++)e=J(t[r],tt(e,n));return e}const{abs:ue,min:fe,max:le,log2:ae,ceil:pe}=Math;function he(t,n,e,r,o,i,c,s){let u=e,f=r,l=u,a=o,p=f-u,h=p;for(;;){let d;ue(a)<ue(i)&&(u=f,f=l,l=u,o=i,i=a,a=o);const g=le(ue(u),ue(f));d=g<=1?kn:kn*2**pe(ae(g));const v=.5*(l-f);if(ue(v)<=d)return f<l?[f,l,f]:[l,f,f];if(ue(p)<d||ue(o)<=ue(i))p=v,h=p;else{let t,n,e=i/o;if(u===l)t=2*v*e,n=1-e;else{n=o/a;const r=i/a;t=e*(2*v*n*(n-r)-(f-u)*(r-1)),n=(n-1)*(r-1)*(e-1)}0<t?n=-n:t=-t,e=p,p=h,2*t<3*v*n-ue(d*n)&&t<ue(.5*e*n)?h=t/n:(p=v,h=p)}if(u=f,o=i,d<ue(h)?f+=h:0<v?f+=d:f-=d,0===(i=s?rt(se(c(),f)):ce(t,f,n))){if(s)return[f,f,f];const o=le(e,f-d),u=fe(r,f+d);if(ce(t,o,n)*ce(t,u,n)!==0)return[o,u,f];if(s=!0,0===(i=rt(se(c(),f))))return[f,f,f]}(0<i&&0<a||i<=0&&a<=0)&&(l=u,a=o,p=f-u,h=p)}}const{abs:de}=Math;function ge(t,n,e){const r=de(n);let o=t[0],i=e[0];for(let c=1;c<t.length;c++){const s=o*n;o=s+t[c],i=i*r+de(s)+e[c]+de(o)}return[o,i]}function ve(t){const n=t[0].length,e=[];for(let r=0;r<n;r++){const o=[];for(let e=0;e<t.length;e++)o.push(t[e][n-(r+1)]);e.push(o)}return e}const me=Ut,xe=Vn,{abs:be}=Math;function we(t,n,e){const r=be(n);let o=t[0],i=e[0];for(let c=1;c<t.length;c++){const s=xe(n,o);o=me(s,t[c]),i=i*r+be(s[1])+e[c]+be(o[1])}return[o,i]}const{abs:_e,min:Me,max:Se,log2:Ie,ceil:Ne}=Math,ye=Ln/Fn;function Ce(t,n,e,r,o,i,c){const s=t.length-1;let u=0,f=1;for(;;){f*=2;for(let l=1;l<f;l+=2){u++;const a=o+(i-o)*(f+2*l)/(4*f),[p,h]=ge(t,a,n);if(_e(p)>h*Fn)return[a,p];if(u>s)return Oe(e,r,o,i,c)}}}function Oe(t,n,e,r,o){const i=t.length-1;let c=0,s=1;for(;;){s*=2;for(let u=1;u<s;u+=2){c++;const f=e+(r-e)*(s+2*u)/(4*s),[l,a]=we(t,f,n);if(_e(l[1])>a*Ln)return[f,l[1]];if(c>i)return Ee(o(),e,r)}}}function Ee(t,n,e){const r=t.length-1;let o=1;for(;;){o*=2;for(let i=1;i<o;i+=2){const c=n+(e-n)*(o+2*i)/(4*o),s=Pn(se(t,c)),u=s[s.length-1];if(0!==u)return[c,u];if(0>r)throw new Error("Cannot resolve root even in Shewchuk expansion precision")}}}function Te(t,n=-1/0,e=1/0,r,o,i=!1){let c;"number"==typeof t[0]&&(t=t.map(t=>[0,t]));const s=()=>void 0===o?t:(void 0===c&&(c=o()),c);if(r=r||new Array(t.length).fill(0),({pDd:t,pDd_:r,pExact:c}=function(t,n,e,r){let o;for(;t.length>0&&An(t[0][1])<=r*n[0]&&(o=o||e(),0===ct(o[0]));)(t=t.slice()).shift(),(n=n.slice()).shift(),o.shift();return{pDd:t,pDd_:n,pExact:o}}(t,r,s,Ln)),0===t.length)return;if(1===t.length)return[];const u=t.map(t=>t[0]+t[1]);return!i&&n!==-1/0&&e!==1/0||([n,e]=function(t,n,e){return[t=Tn(t,Cn(e)),n=En(n,yn(e))]}(n,e,u),n!==e)?function(t,n,e,r,o,i){const c=e.map((n,e)=>n*ye+_e(t[e])),s=r,u=o;let f,l,a,p,h=o-r;for(;[f,l]=ge(t,r,c),!(_e(f)>l*Fn);)r-=h/2,h*=2;for(;[a,p]=ge(t,o,c),!(_e(a)>p*Fn);)o+=h/2,h*=2;const d=[[r,o,f,a,0]],g=[],v=function(t,n,e,r,o){return function(i,c,s,u,f){let[l,a]=function(t,n,e){const r=t.length-1,o=Hn(n),i=t.slice(),c=e.slice();for(let t=0;t<=r;t++)for(let e=1;e<=r-t;e++){const t=n*i[e-1],r=o*c[e-1]+Hn(t);i[e]=i[e]+t,c[e]=c[e]+r+Hn(i[e])}return[i,c]}(t,i,n);!function(t,n,e){const r=t.length-1;if(r<0)return;let o=n,i=0;for(let c=1;c<=r;c++){const s=r-c,u=t[s],f=Xn(u),l=e[s],a=u*o;t[s]=a,e[s]=l*o+f*i+Xn(a);const p=o*n;i=i*n+p,o=p}}(l,c-i,a),l.reverse(),a.reverse(),function(t,n){const e=t.length-1;for(let r=0;r<=e;r++)for(let o=1;o<=e-r;o++){const e=t[o-1],r=n[o-1]+Hn(e);t[o]=t[o]+e,n[o]=n[o]+r+Hn(t[o])}}(l,a);let p=0,h=0,d=Zn(s);for(let t=1;t<l.length-1;t++){let n=Zn(l[t]);const e=l[t],r=a[t]*Fn;Un(e)<=r&&(h++,n=-d),n!==d&&(p++,d=n)}return Zn(u)!==d&&p++,1===h&&1===p?1:h>0?function(t,n,e,r,o,i,c,s){let[u,f]=qn(t,e,n);(function(t,n,e){const r=t.length-1;if(r<0)return;let o=[0,n],i=0;for(let c=1;c<=r;c++){const s=r-c,u=t[s],f=Qn(u[1]),l=e[s],a=Wn(o,u);t[s]=a,e[s]=l*o[1]+f*i+Qn(a[1]);const p=Wn(o,[0,n]);i=i*n+p[1],o=p}})(u,r-e,f),u.reverse(),f.reverse(),[u,f]=qn(u,1,f);let l=0,a=0,p=Zn(o);for(let t=0;t<u.length-1;t++){let n=Zn(u[t][1]);const e=f[t]*Ln,r=u[t];e>=Un(r[1])&&(a++,n=-p),n!==p&&(l++,p=n)}return Zn(i)!==p&&l++,1===a&&1===l?1:0===a?l:c>1?function(t,n,e,r,o){let i=Rn(t(),n);i=Gn(i,e-n),i.reverse(),i=Rn(i,1);let c=0,s=Zn(r);for(let t=1;t<i.length-1;t++){const n=i[t];let e=Zn(n[n.length-1]);e!==s&&0!==e&&(c++,s=e)}return Zn(o)!==s&&c++,c}(s,e,r,o,i):-l}(e,r,i,c,s,u,f,o):p}}(t,c,n,e,i);let m,x;for(;d.length>0;){const r=d.pop(),[o,s,u,f,l]=r,a=v(o,s,u,f,l);if(0===a)continue;if(1===a){m=m||e.map(t=>t*Ln),x=x||ve(n);const[t,r,c]=he(x,m,o,s,u,f,i,!1);g.push({t:c,tS:t,tE:r,multiplicity:1});continue}let p=a<0?l+1:0;if(s-o<=2*_e(a)*kn*Se(1,2**Ne(Ie(Se(_e(o),_e(s)))))){if(0===p){g.push({t:(o+s)/2,tS:o,tE:s,multiplicity:_e(a)});continue}p=1/0}const[h,b]=Ce(t,c,n,e,o,s,i);d.push([o,h,u,b,p]),d.push([h,s,b,f,p])}return g.reverse(),g.filter(t=>{const{tS:n,tE:e}=t;return!(e<s||n>u)})}(u,t,r,n,e,s):[{t:n,tS:n,tE:e,multiplicity:u.length-1}]}function Ae(t,n){if(0===n)return t[0];if(1===n)return t[t.length-1];if(4===t.length){const[[e,r],[o,i],[c,s],[u,f]]=t,l=e+(o-e)*n,a=o+(c-o)*n,p=l+(a-l)*n,h=r+(i-r)*n,d=i+(s-i)*n,g=h+(d-h)*n;return[p+(a+(c+(u-c)*n-a)*n-p)*n,g+(d+(s+(f-s)*n-d)*n-g)*n]}if(3===t.length){const[[e,r],[o,i],[c,s]]=t,u=e+(o-e)*n,f=r+(i-r)*n;return[u+(o+(c-o)*n-u)*n,f+(i+(s-i)*n-f)*n]}if(2===t.length){const[[e,r],[o,i]]=t;return[e+(o-e)*n,r+(i-r)*n]}if(1===t.length)return t[0];throw new Error("The given bezier curve must be of order <= 3.")}const{abs:Pe}=Math;function ke(t,n){if(0===n[0]&&0===n[1])return[0,0];if(0===n[0]&&1===n[1])return[0,0];const e=Pe(n[1]);if(4===t.length){const[[n,r],[o,i],[c,s],[u,f]]=t,l=Pe(n),a=Pe(r),p=Pe(o),h=Pe(i),d=Pe(c),g=Pe(s),v=l+(p+l)*e,m=p+(d+p)*e,x=v+(m+v)*e,b=a+(h+a)*e,w=h+(g+h)*e,_=b+(w+b)*e;return[x+(m+(d+(Pe(u)+d)*e+m)*e+x)*e,_+(w+(g+(Pe(f)+g)*e+w)*e+_)*e]}if(3===t.length){const[[n,r],[o,i],[c,s]]=t,u=Pe(n),f=Pe(r),l=Pe(o),a=Pe(i),p=u+(l+u)*e,h=f+(a+f)*e;return[p+(l+(Pe(c)+l)*e+p)*e,h+(a+(Pe(s)+a)*e+h)*e]}if(2===t.length){const[[n,r],[o,i]]=t,c=Pe(n),s=Pe(r);return[c+(Pe(o)+c)*e,s+(Pe(i)+s)*e]}if(1===t.length)return[0,0];throw new Error("The given bezier curve must be of order <= 3.")}const Be=Number.EPSILON,ze=Number.EPSILON/2,Fe=ze*ze,Le=He(1),Ye=function(){const t=3*Fe;return t/(1-t)}();function He(t){const n=t*ze;return n/(1-n)}const{abs:Xe}=Math,$e=[[0,0],[0,0]];const{min:Ve,max:De}=Math;function qe(t,n){return n[0]!==n[1]?4===t.length?function(t,n){const{ps:e,_ps:r}=ln(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=e[2][0],s=e[3][0],u=9*ze*r[0][0],f=9*ze*r[1][0],l=9*ze*r[2][0],a=9*ze*r[3][0],p=e[0][1],h=e[1][1],d=e[2][1],g=e[3][1],v=9*ze*r[0][1],m=9*ze*r[1][1],x=9*ze*r[2][1],b=9*ze*r[3][1],w=Ve(o-u,i-f,c-l,s-a),_=De(o+u,i+f,c+l,s+a);return[[w,Ve(p-v,h-m,d-x,g-b)],[_,De(p+v,h+m,d+x,g+b)]]}(t,n):3===t.length?function(t,n){const{ps:e,_ps:r}=Qt(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=e[2][0],s=5*ze*r[0][0],u=5*ze*r[1][0],f=5*ze*r[2][0],l=e[0][1],a=e[1][1],p=e[2][1],h=5*ze*r[0][1],d=5*ze*r[1][1],g=5*ze*r[2][1],v=Ve(o-s,i-u,c-f),m=De(o+s,i+u,c+f);return[[v,Ve(l-h,a-d,p-g)],[m,De(l+h,a+d,p+g)]]}(t,n):function(t,n){const{ps:e,_ps:r}=function(t,n,e){return 0===n?1===e?{ps:t,_ps:$e}:function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=[[o,i],[n*(c-o)+o,n*(s-i)+i]],f=Xe(n),l=Xe(o),a=Xe(c),p=Xe(i);return{ps:u,_ps:[[0,0],[f*(a+l)+l,f*(Xe(s)+p)+p]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=[[n*(c-o)+o,n*(s-i)+i],[c,s]],f=Xe(n),l=Xe(o),a=Xe(c),p=Xe(i);return{ps:u,_ps:[[f*(a+l)+l,f*(Xe(s)+p)+p],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=r[0],c=r[1],s=o[0],u=o[1],f=[[n*(s-i)+i,n*(u-c)+c],[e*(s-i)+i,e*(u-c)+c]],l=Xe(n),a=Xe(e),p=Xe(i),h=Xe(s),d=Xe(c),g=Xe(u);return{ps:f,_ps:[[l*(h+p)+p,l*(g+d)+d],[a*(h+p)+p,a*(g+d)+d]]}}(t,n,e)}(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=3*ze*r[0][0],s=3*ze*r[1][0],u=e[0][1],f=e[1][1],l=3*ze*r[0][1],a=3*ze*r[1][1],p=Ve(o-c,i-s),h=De(o+c,i+s);return[[p,Ve(u-l,f-a)],[h,De(u+l,f+a)]]}(t,n):function(t,n){const e=t[0],r=t[t.length-1];if(0===n)return[e,e];if(1===n)return[r,r];const o=Ae(t,n);let i;if(4===t.length)i=ke(t,[0,n]).map(t=>8*Le*t);else if(3===t.length)i=ke(t,[0,n]).map(t=>5*Le*t);else if(2===t.length)i=ke(t,[0,n]).map(t=>2*Le*t);else if(1===t.length)return[o,o];return[[o[0]-i[0],o[1]-i[1]],[o[0]+i[0],o[1]+i[1]]]}(t,n[0])}function je(t){const n=t[0],e=t[1];return[(n[0]+e[0])/2,(n[1]+e[1])/2]}const We=Z,Qe=Number.EPSILON;function Re(t,n){const e=t-n,r=t-e;return[t-(e+r)+(r-n),e]}function Ge(t){return[2*t[0],2*t[1]]}function Ue(t){return[4*t[0],4*t[1]]}const Ze=Re,Je=Ut,Ke=Vn,tr=Wn,nr=Ge,er=Ue,rr=Zt;function or(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],[d,g]=n,v=Ze(c,d),m=Ze(u,d),x=Ze(l,d),b=Ze(p,d),w=Ze(s,g),_=Ze(f,g),M=Ze(a,g),S=Ze(h,g),I=tr(v,v),N=Ke(6,tr(v,m)),y=Ke(6,tr(v,x)),C=nr(tr(v,b)),O=Ke(9,tr(m,m)),E=Ke(18,tr(m,x)),T=Ke(6,tr(m,b)),A=Ke(9,tr(x,x)),P=Ke(6,tr(x,b)),k=tr(b,b),B=tr(w,w),z=Ke(6,tr(w,_)),F=Ke(6,tr(w,M)),L=nr(tr(w,S)),Y=Ke(9,tr(_,_)),H=Ke(18,tr(_,M)),X=Ke(6,tr(_,S)),$=Ke(9,tr(M,M)),V=Ke(6,tr(M,S)),D=tr(S,S),q=Je(T,A),j=Je(C,E),W=Je(y,O),Q=Je(X,$),R=Je(L,H),G=Je(F,Y);return[Ke(6,Je(Je(Je(Je(rr(k,P),rr(I,N)),q),rr(W,j)),Je(Je(Je(rr(D,V),rr(B,z)),Q),rr(G,R)))),Ke(5,Je(rr(Je(Je(P,Ke(5,N)),Ke(3,j)),nr(Je(Je(q,nr(W)),Ke(3,I)))),rr(Je(Je(V,Ke(5,z)),Ke(3,R)),nr(Je(Je(Q,nr(G)),Ke(3,B)))))),er(Je(rr(rr(q,Ke(3,rr(j,nr(W)))),Ke(5,rr(nr(N),Ke(3,I)))),rr(rr(Q,Ke(3,rr(R,nr(G)))),Ke(5,rr(nr(z),Ke(3,B)))))),Ke(3,Je(rr(j,nr(rr(nr(W),Ke(5,rr(N,nr(I)))))),rr(R,nr(rr(nr(G),Ke(5,rr(z,nr(B)))))))),nr(Je(rr(W,Ke(5,rr(N,Ke(3,I)))),rr(G,Ke(5,rr(z,Ke(3,B)))))),Je(rr(N,Ke(6,I)),rr(z,Ke(6,B)))]}const ir=Re,cr=Ut,sr=Vn,ur=Wn,fr=Ge,lr=Zt,ar=Ue;function pr(t,n){const[[e,r],[o,i],[c,s]]=t,[u,f]=n,l=ir(e,u),a=ir(o,u),p=ir(c,u),h=ir(r,f),d=ir(i,f),g=ir(s,f),v=ur(l,l),m=ur(l,a),x=ur(l,p),b=ur(a,a),w=ur(a,p),_=ur(p,p),M=ur(h,h),S=ur(h,d),I=ur(h,g),N=ur(d,d),y=ur(d,g),C=ur(g,g),O=cr(I,fr(N)),E=cr(x,fr(b));return[cr(lr(cr(cr(C,M),fr(O)),ar(cr(y,S))),lr(cr(cr(_,v),fr(E)),ar(cr(w,m)))),sr(3,cr(cr(lr(y,O),lr(sr(3,S),M)),cr(lr(w,E),lr(sr(3,m),v)))),cr(lr(O,sr(3,lr(fr(S),M))),lr(E,sr(3,lr(fr(m),v)))),cr(lr(S,M),lr(m,v))]}const hr=Gt,dr=Ut,gr=function(t){return[-2*t[0],-2*t[1]]};function vr(t,n){const[[e,r],[o,i]]=t,[c,s]=n,u=e-c,f=o-c,l=r-s,a=i-s,p=hr(u,u),h=hr(u,f),d=hr(f,f),g=hr(l,l),v=hr(l,a),m=hr(a,a),x=dr(h,v),b=dr(g,p);return[dr(dr(d,m),dr(b,gr(x))),Zt(x,b)]}function mr(t){const n=[];for(let e=0;e<t.length;e++)n.push(2*t[e]);return n}function xr(t){const n=[];for(let e=0;e<t.length;e++)n.push(-2*t[e]);return n}const br=Z,wr=nt,_r=mr,Mr=xr,Sr=Z,Ir=nt,Nr=mr;function yr(t){const n=[];for(let e=0;e<t.length;e++)n.push(4*t[e]);return n}const Cr=Z,Or=xr,{abs:Er}=Math;function Tr(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=Er(e[0]),s=Er(e[1]),u=Er(r[0]),f=Er(r[1]),l=Er(o[0]),a=Er(o[1]),p=Er(i[0]),h=Er(i[1]),d=Er(n[0]),g=Er(n[1]),v=c+d,m=u+d,x=l+d,b=p+d,w=s+g,_=f+g,M=a+g,S=h+g,I=v*v,N=6*v*m,y=6*x*b,C=w*w,O=6*w*_,E=6*M*S,T=6*m*b+9*x*x,A=2*v*b+18*m*x,P=6*v*x+9*m*m,k=6*_*S+9*M*M,B=2*w*S+18*_*M,z=6*w*M+9*_*_;return[6*(b*b+y+(I+N)+T+(P+A)+(S*S+E+(C+O)+k+(z+B))),5*(y+5*N+3*A+2*(T+2*P+3*I)+(E+5*O+3*B+2*(k+2*z+3*C))),4*(T+3*(A+2*P)+5*(2*N+3*I)+(k+3*(B+2*z)+5*(2*O+3*C))),3*(A+2*(2*P+5*(N+2*I))+(B+2*(2*z+5*(O+2*C)))),2*(P+5*(N+3*I)+(z+5*(O+3*C))),N+6*I+(O+6*C)]}function Ar(t,n){const e=t[0],r=t[1],o=t[2],i=Er(e[0]),c=Er(e[1]),s=Er(r[0]),u=Er(r[1]),f=Er(o[0]),l=Er(o[1]),a=Er(n[0]),p=Er(n[1]),h=i+a,d=s+a,g=f+a,v=c+p,m=u+p,x=l+p,b=h*h,w=h*d,_=d*g,M=v*v,S=v*m,I=m*x,N=v*x+m*m*2,y=h*g+d*d*2;return[x*x+M+2*N+4*(I+S)+(g*g+b+2*y+4*(_+w)),3*(I+N+(3*S+M)+(_+y+(3*w+b))),N+3*(2*S+M)+(y+3*(2*w+b)),S+M+(w+b)]}function Pr(t,n){const e=t[0],r=t[1],o=Er(e[0]),i=Er(e[1]),c=Er(r[0]),s=Er(r[1]),u=Er(n[0]),f=Er(n[1]),l=o+u,a=c+u,p=i+f,h=s+f,d=l*a+p*h,g=p*p+l*l;return[a*a+h*h+2*d+g,d+g]}function kr(t,n){const e=t.length-1;if(3===e)return{polyDd:or(t,n),polyE:Tr(t,n).map(t=>20*t),getPolyExact:()=>function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],[d,g]=n,v=br(c,d),m=br(u,d),x=br(l,d),b=br(p,d),w=br(s,g),_=br(f,g),M=br(a,g),S=br(h,g),I=et(v,v),N=wr(6,et(v,m)),y=wr(6,et(v,x)),C=_r(et(v,b)),O=wr(9,et(m,m)),E=wr(18,et(m,x)),T=wr(6,et(m,b)),A=wr(9,et(x,x)),P=wr(6,et(x,b)),k=et(b,b),B=et(w,w),z=wr(6,et(w,_)),F=wr(6,et(w,M)),L=_r(et(w,S)),Y=wr(9,et(_,_)),H=wr(18,et(_,M)),X=wr(6,et(_,S)),$=wr(9,et(M,M)),V=wr(6,et(M,S)),D=et(S,S),q=J(T,A),j=J(C,E),W=J(y,O),Q=J(X,$),R=J(L,H),G=J(F,Y),U=it(J(J(k,I),J(q,W)),J(J(j,P),N)),Z=it(J(J(D,B),J(Q,G)),J(J(R,V),z)),K=wr(6,J(U,Z)),tt=J(Mr(J(J(q,_r(W)),wr(3,I))),J(J(P,wr(3,j)),wr(5,N))),nt=J(Mr(J(J(Q,_r(G)),wr(3,B))),J(J(V,wr(3,R)),wr(5,z))),rt=wr(5,J(tt,nt)),ot=J(J(q,wr(3,it(_r(W),j))),wr(5,it(wr(3,I),_r(N)))),ct=J(J(Q,wr(3,it(_r(G),R))),wr(5,it(wr(3,B),_r(z)))),st=wr(4,J(ot,ct)),ut=it(j,_r(it(_r(W),wr(5,it(N,_r(I)))))),ft=it(R,_r(it(_r(G),wr(5,it(z,_r(B)))))),lt=wr(3,J(ut,ft)),at=it(W,wr(5,it(N,wr(3,I)))),pt=it(G,wr(5,it(z,wr(3,B))));return[K,rt,st,lt,_r(J(at,pt)),J(it(N,wr(6,I)),it(z,wr(6,B)))].map(Pn)}(t,n)};if(2===e)return{polyDd:pr(t,n),polyE:Ar(t,n).map(t=>16*t),getPolyExact:()=>function(t,n){const[[e,r],[o,i],[c,s]]=t,[u,f]=n,l=Sr(e,u),a=Sr(o,u),p=Sr(c,u),h=Sr(r,f),d=Sr(i,f),g=Sr(s,f),v=et(l,l),m=et(l,a),x=et(l,p),b=et(a,a),w=et(a,p),_=et(p,p),M=et(h,h),S=et(h,d),I=et(h,g),N=et(d,d),y=et(d,g),C=et(g,g),O=J(I,Nr(N)),E=J(x,Nr(b)),T=J(it(J(_,Nr(E)),yr(J(w,m))),v),A=J(it(J(C,Nr(O)),yr(J(y,S))),M),P=J(T,A),k=J(it(w,E),it(Ir(3,m),v)),B=J(it(y,O),it(Ir(3,S),M));return[P,Ir(3,J(k,B)),J(it(O,Ir(3,it(Nr(S),M))),it(E,Ir(3,it(Nr(m),v)))),J(it(S,M),it(m,v))].map(Pn)}(t,n)};if(1===e)return{polyDd:vr(t,n),polyE:Pr(t,n).map(t=>12*t),getPolyExact:()=>function(t,n){const[[e,r],[o,i]]=t,[c,s]=n,u=Cr(e,c),f=Cr(o,c),l=Cr(r,s),a=Cr(i,s),p=et(u,u),h=et(u,f),d=et(f,f),g=et(l,l),v=et(l,a),m=et(a,a),x=J(h,v),b=J(g,p);return[J(J(d,m),J(Or(x),b)),it(x,b)].map(Pn)}(t,n)};if(0===e)return{polyDd:[[0,1]],polyE:[0],getPolyExact:()=>[[1]]};throw new Error("The given bezier curve must be of order 1, 2 or 3")}const{sqrt:Br}=Math;function zr(t,n,e=0,r=1){const{polyDd:o,polyE:i,getPolyExact:c}=kr(t,n),s=Te(o,e,r,i,c)||[];s.push({t:e,tS:e,tE:e,multiplicity:1}),s.push({t:r,tS:r,tE:r,multiplicity:1});const u=s.map(e=>{const r=qe(t,[e.tS,e.tE]),o=function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=n[0],f=n[1];let l=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(const[t,n]of[[o,i],[o,s],[c,i],[c,s]]){const e=We(t,u),r=We(n,f),o=rt(J(et(e,e),et(r,r))),i=o*(1-Qe),c=o*(1+Qe);i<=l&&(l=i),c>=a&&(a=c)}return[l,a]}(r,n);return{p:je(r),t:e.t,d:(Br(o[0])+Br(o[1]))/2,dSquaredI:o,box:r,ri:e}});let f=Number.POSITIVE_INFINITY;for(let t=0;t<u.length;t++){const n=u[t].dSquaredI[1];n<f&&(f=n)}const l=[];for(let t=0;t<u.length;t++){const n=u[t];n.dSquaredI[0]<=f&&l.push(n)}return l}function Fr(t){return(t.tS+t.tE)/2}function Lr(t){const n=t.xs;if(4===n.length){let t=0,e=0;for(let r=0;r<n.length;r++)0===n[r].x.kind&&t++,4===n[r].x.kind&&e++;if(2===t&&2===e)return!0}return n.length<=2&&7!==n[0].x.kind}function Yr(t){const n=(t=Pn(t)).length;return 2===n?t:n<=1?[0,t[0]]:[t[n-2],t[n-1]]}const{abs:Hr,min:Xr,max:$r,log2:Vr,ceil:Dr}=Math;function qr(t,n){const{tS:e,tE:r}=t,o=r-e;if(0===o)return[{tS:[0,e],tE:[0,e],multiplicity:t.multiplicity}];const i=2**Dr(Vr(o)),c=function(t,n,e){return Gn(Rn(t,e),n)}(n,i,e),s=c.map(Yr),u=s.map(t=>t[1]*kn**2),f=Te(s,0,1,u,()=>c),l=[];for(const t of f)l.push({tS:lt(e,t.tS*i),tE:lt(e,t.tE*i),multiplicity:t.multiplicity});return l}function jr(t,n){return ct(it(t,n))}const{abs:Wr}=Math;function Qr(t,n){const e=t.inOuts;e.sort(function(t){return(n,e)=>{let r=n.side-e.side;if(0!==r)return r;const o=n.sideX,i=e.sideX;r=o.ri.tS-i.ri.tS;const c=8*Number.EPSILON;return Wr(r)>=c?r:(o.compensated||(o.compensated=1,o.riExp=qr(o.ri,o.getPExact())[0]),i.compensated||(i.compensated=1,i.riExp=qr(i.ri,i.getPExact())[0]),r=jr(o.riExp.tS,i.riExp.tS),0!==r?r:(r=n.dir-e.dir,0!==r?t*r:1===n.dir?n.idx-e.idx:e.idx-n.idx))}}(n));let r=e[e.length-1];for(let t=0;t<e.length;t++){const n=e[t];n.prevAround=r,r.nextAround=n,r=n}}function Rr(t,n,e,r){const o=function(t,n){return(e,r,o)=>{t.has(e)||(e.orientation=r,e.parent=o,e.windingNum=o.windingNum+e.orientation,n.push(e))}}(r,e);Qr(t.container,n.orientation);let i,c,s=1,u=t,f=n.orientation;for(;u=1===n.orientation?u.nextAround:u.prevAround,u!==t;){const t=s;s-=u.dir,1===s&&(f*=-1),-1!==u.dir&&(i?1===t&&0===s?o(u,n.orientation,n.parent):0===t&&-1===s&&o(u,-n.orientation,n.parent):0===s?i=u:1===s&&o(u,n.orientation,n))}return Lr(t.container)||(c=[t.p,i.p]),{inOutToUse:i,additionalBezier:c}}function Gr(t,n){const e=t._x_,r=n._x_,o=e.curve,i=e.x.ri.tS,c=r.curve,s=r.x.ri.tS;let u=o,f=i;Lr(t.container)||(f=Fr(zr(o.ps,t.p)[0].ri));const l=[];for(;;){if(u===c&&(f<s||f===s&&0!==l.length)){const t=u.ps,n=[f,s];return l.push({ps:t,ts:n}),l}{const t=u.ps,n=[f,1];l.push({ps:t,ts:n})}f=0,u=u.next}}function Ur(t,n){const e=n._x_,r=t._x_,o=r.curve,i=r.x.ri.tS,c=e.curve,s=e.x.ri.tS;let u=o,f=i;Lr(t.container)||(f=Fr(zr(u.ps,t.p)[0].ri));const l=[];for(;;){const t=u.ps;if(u===c&&(f>s||f===s&&0!==l.length)){const n=[f,s];return l.push({ps:t,ts:n}),l}{const n=[f,0];l.push({ps:t,ts:n})}f=1,u=u.prev}}function Zr(t,n,e,r){const o=function(t,n,e){return(r,o,i,c)=>{n.has(r)||1!==r.dir||(r.loopsIdxs=new Set(c),r.orientation=o*t.orientation,r.parent=i.parent,r.windingNum=i.windingNum+r.orientation,e.unshift(r))}}(n,r,e);Qr(t.container,1);let i=t.nextAround,c=t;const s=[],u=new Set(n.loopsIdxs);for(;c=c.nextAround,c!==t;)o(c,n.dir,n,u),s.push(c.idx),-1===c.dir?u?.add(c._x_?.curve.loop.idx):u.delete(c._x_?.curve.loop.idx);let f;return Lr(t.container)||(f=[t.p,i.p]),{inOutToUse:i,additionalBezier:f}}function Jr(t){const{ps:n,ts:e}=t;return A(n,e[0],e[1])}function Kr(t,n,e){const r=[],o=[];let i,c=n;const s=e?Zr:Rr,u=[];do{t.add(c),u.push(c);const e=c.nextOrPrev;t.add(e);const f=1===c.dir?Gr(c,e):Ur(c,e);o.push(...f);const l=s(e,n,r,t);if(({inOutToUse:c,additionalBezier:i}=l),void 0!==i){const t=Jr(o[o.length-1]),n={ps:t,ts:[0,Fr(zr(t,i[0])[0].ri)]};o.pop(),o.push(n),o.push({ps:i,ts:[0,1]})}}while(c!==n);return"undefined"!=typeof _debug_&&_debug_.verbose&&function(t){const n=[],e=[];for(let r of t)e.push(1===r.dir?"color: blue;":"color: red"),n.push(`%c${r.idx}`)}(u),{bezierPieces:o,additionalOutsToCheck:r}}function to(t,n,e,r){const o=[t];for(;o.length;){const t=o.pop();if(n.add(t._x_.curve.loop),e.has(t))continue;t.children=new Set;const{bezierPieces:i,additionalOutsToCheck:c}=Kr(e,t,r);t.bezierPieces=i,t.parent.children=t.parent.children||new Set,t.parent.children.add(t);for(let t=0;t<c.length;t++)o.push(c[t])}}function no(t){if(4===t.length)return eo(t);if(3===t.length)return ro(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t;return[[r-n,n],[o-e,e]]}(t);if(1===t.length)return function(t){const[[n,e]]=t;return[[n],[e]]}(t);throw new Error("The given bezier curve must be of order <= 3.")}function eo(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[s-n+3*(r-i),3*(i+n-2*r),3*(r-n),n],[u-e+3*(o-c),3*(c+e-2*o),3*(o-e),e]]}function ro(t){const[[n,e],[r,o],[i,c]]=t;return[[i+n-2*r,2*(r-n),n],[c+e-2*o,2*(o-e),e]]}function oo(t){const n=t[0],e=t[t.length-1];let r,o;if(n[1]<e[1]?(r={ts:[0,0],box:[n,n]},o={ts:[1,1],box:[e,e]}):(r={ts:[1,1],box:[e,e]},o={ts:[0,0],box:[n,n]}),2===t.length)return{minY:r,maxY:o};const[,i]=G(t),c=Te(i,0,1)||[];for(let n=0;n<c.length;n++){const e=c[n],i=[e.tS,e.tE],s=qe(t,i);s[0][1]<r.box[0][1]&&(r={ts:i,box:s}),s[1][1]>o.box[0][1]&&(o={ts:i,box:s})}return{minY:r,maxY:o}}function io(t){const n=function(t){const n=t[0],e=t[t.length-1];let r,o;if(n[0]<e[0]?(r={ts:[0,0],box:[n,n]},o={ts:[1,1],box:[e,e]}):(r={ts:[1,1],box:[e,e]},o={ts:[0,0],box:[n,n]}),2===t.length)return{minX:r,maxX:o};const[i]=G(t),c=Te(i,0,1)||[];for(let n=0;n<c.length;n++){const e=c[n],i=[e.tS,e.tE],s=qe(t,i);s[0][0]<r.box[0][0]&&(r={ts:i,box:s}),s[1][0]>o.box[0][0]&&(o={ts:i,box:s})}return{minX:r,maxX:o}}(t),e=oo(t);return[[n.minX.box[0][0],e.minY.box[0][1]],[n.maxX.box[1][0],e.maxY.box[1][1]]]}const co=Y(io);function so(t){const n=G(t),e=Te(n[0],0,1)?.map(t=>t.t)||[],r=Te(n[1],0,1)?.map(t=>t.t)||[];e.push(0,1),r.push(0,1);let o,i,c,s,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(let n=0;n<e.length;n++){const r=e[n],[c]=Ae(t,r);c<u&&(u=c,o=r),c>f&&(f=c,i=r)}for(let n=0;n<r.length;n++){const e=r[n],[,o]=Ae(t,e);o<l&&(l=o,c=e),o>a&&(a=o,s=e)}return{ts:[[o,c],[i,s]],box:[[u,l],[f,a]]}}const uo=Y(so),{min:fo,max:lo}=Math;function ao(t){const n=t.map(uo);return{minX:fo(...n.map(t=>t.box[0][0])),maxX:lo(...n.map(t=>t.box[1][0])),minY:fo(...n.map(t=>t.box[0][1])),maxY:lo(...n.map(t=>t.box[1][1]))}}const po=new Function("try {return this===window;}catch(e){ return false;}")()?function(t){const n=window.atob(t),e=n.length,r=new Uint8Array(e);for(let t=0;t<e;t++)r[t]=n.charCodeAt(t);return r.buffer}:function(t){return function(t){const n=new ArrayBuffer(t.length),e=new Uint8Array(n);for(let n=0;n<t.length;++n)e[n]=t[n];return n}(Buffer.from(t,"base64"))},ho=po("AGFzbQEAAAABBgFgAX8BfAMDAgAABQMBAAAHHwMGbWVtb3J5AgAHc3F1YXJlcwAACHNxdWFyZXM0AAEKjgECPwECfiAArULHuuXf9tjQm2p+IgEgASABfnxCIIoiAiACfiABQse65d/22NCbanx8QiCKIgIgAn4gAXxCIIi6C0wBAn4gAK1Cx7rl3/bY0JtqfiIBQse65d/22NCbanwiAiABIAIgASABIAF+fEIgiiIBIAF+fEIgiiIBIAF+fEIgiiIBIAF+fEIgiLoL"),go=new WebAssembly.Module(ho),vo=new WebAssembly.Instance(go),mo=vo.exports.squares;vo.exports.squares4;const xo=1e-6;function bo(t,n){let e;const r=[t];for(;r.length;)o(r.pop());return e;function o(o){if(o===t||function(t,n){let e=0;do{e++;const o=mo(e)/4294967296,i=r(t,n,Ae(t[mo(e+1e3)%t.length],o));if(void 0!==i)return i}while(e<100);return;function r(t,n,e){if(function(t,n){const e=ao(t),r=ao(n);return e.minX<r.minX||e.maxX>r.maxX||e.minY<r.minY||e.maxY>r.maxY}(t,n))return!1;const r=function(t,n){const[e,r]=n;let o=0;for(let i=0;i<t.length;i++){const c=t[i],[[s,u],[f,l]]=co(c);let a=u>r||l<r||!1;if(a=a||s>e||!1,a)continue;const p=[];let h,d,g;const v=!0;h=t=>no(t)[1],d=[0,-r],g=0;const m=c.map(j(d)),x=h(m),b=Te(x,0-xo,1+xo)?.map(t=>t.t)||[];for(let t=0;t<b.length;t++){const e=b[t];if(Math.abs(e)<xo||Math.abs(e-1)<xo)return;const r=Ae(m,e);(v&&n[g]>=r[g]||!v&&n[g]<=r[g])&&p.push(e)}if(1===p.length||3===p.length)for(const t of p){const n=W(U(c,t));if(Math.abs(n[1])<xo)return}o+=p.length}return o}(n,e);return void 0!==r?r%2!=0:void 0}}(n.beziers,o.bezierPieces.map(Jr))){e=o;for(const t of o.children)r.push(t)}}}function wo(t,n){return _o(t)-_o(n)}function _o(t){let n=Number.POSITIVE_INFINITY;for(const e of t){const t=uo(e).box[0][1];t<n&&(n=t)}return n}const{abs:Mo,sign:So}=Math;function Io(t){let n=t.parent;for(;;){if(void 0===n)return!1;if(n.used)return!0;n=n.parent}}function No(t,n,e){let[[r,o],[i,c]]=n,[[s,u],[f,l]]=e;o>c&&([o,c]=[c,o]),u>l&&([u,l]=[l,u]),r>i&&([r,i]=[i,r]),s>f&&([s,f]=[f,s]);const a=t||r===i&&s===f,p=t||o===c&&u===l;return(a?r<=f:r<f)&&(a?i>=s:i>s)&&(p?u<=c:u<c)&&(p?l>=o:l>o)}function yo(t,n){return No(!0,t.box,n.box)}function Co(t,n){for(let e=0;e<n.length;e++){const r=n[e];Oo(t,[r.a,r.b])}}function Oo(t,n){const[e,r]=n;let o=t.get(e);o||(o=[],t.set(e,o));let i=t.get(r);i||(i=[],t.set(r,i)),o.push(r),i.push(e)}function Eo(t,n,e,r){e.add(n),r.push(n);const o=t.get(n);for(let n=0;n<o.length;n++){const i=o[n];e.has(i)||Eo(t,i,e,r)}}function To(t){const n=[],e=new Set;for(const r of t){const o=r[0];e.has(o)||(n.push([]),Eo(t,o,e,n[n.length-1]))}return n}function Ao(t,n){const e=new Set;for(const t of n)for(const n of t)e.add(n);const r=[];for(let n=0;n<t.length;n++){const o=t[n];e.has(o)||r.push(o)}return r}function Po(t){const n=[];for(const e of t){let t=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;const c=[];for(const n of e){const[[e,s],[u,f]]=n.box;e<t&&(t=e),s<r&&(r=s),u>o&&(o=u),f>i&&(i=f),c.push(...n.xs)}const s={box:[[t,r],[o,i]],xs:c,inOuts:void 0};n.push(s)}return n}function ko(t){return{tS:[0,t.tS],tE:[0,t.tE],multiplicity:t.multiplicity}}function Bo(t,n){const e=t[0],r=t[1],o=r+n,i=o-r,c=e+(r-(o-i)+(n-i)),s=o+c;return[c-(s-o),s]}const zo=Re,Fo=Vn,Lo=Ut,Yo=Bo,{abs:Ho}=Math;function Xo(t){const[[n,e],[r,o],[i,c],[s,u]]=t,f=zo(s,n),l=zo(r,i),a=3*(r-i),p=Fo(3,l),h=Ho(a),d=Lo(f,p),g=h+Ho(s-n+a),v=zo(i,2*r),m=Yo(v,n),x=Ho(i-2*r+n),b=Fo(3,m),w=6*x,_=zo(r,n),M=Fo(3,_),S=Ho(3*(r-n)),I=zo(u,e),N=zo(o,c),y=3*(o-c),C=Fo(3,N),O=Ho(y),E=Lo(I,C),T=O+Ho(u-e+y),A=zo(c,2*o),P=Yo(A,e),k=Ho(c-2*o+e),B=Fo(3,P),z=6*k,F=zo(o,e);return{coeffs:[[d,b,M,[0,n]],[E,B,Fo(3,F),[0,e]]],errorBound:[[g,w,S,0],[T,z,Ho(3*(o-e)),0]]}}function $o(t){const[[n,e],[r,o],[i,c]]=t,s=i-2*r,u=zo(i,2*r),f=Yo(u,n),l=Ho(s+n),a=zo(2*r,2*n),p=c-2*o,h=zo(c,2*o),d=Yo(h,e),g=Ho(p+e);return{coeffs:[[f,a,[0,n]],[d,zo(2*o,2*e),[0,e]]],errorBound:[[l,0,0],[g,0,0]]}}function Vo(t){const[[n,e],[r,o]]=t;return[[zo(r,n),[0,n]],[zo(o,e),[0,e]]]}const Do=Zt,qo=Vn,jo=ot,{abs:Wo}=Math;function Qo(t){const[[n,[,e]],[r,[,o]]]=Vo(t),i=jo(r),c=n,s=qo(o,n),u=Wo(s[1]),f=qo(e,r),l=Wo(f[1]),a=Do(f,s);return{coeffs:{vₓ:i,vᵧ:c,v:a},errorBound:{v_:u+l+Wo(a[1])}}}const{abs:Ro}=Math,Go=Ut,Uo=Vn,Zo=Wn;function Jo(t){return[-t[0],-t[1]]}const Ko=Jo,ti=Ge,ni=Vn,ei=Wn,ri=Zt,{abs:oi}=Math;function ii(t){const{coeffs:[[n,e,[,r]],[o,i,[,c]]],errorBound:[[s],[u]]}=$o(t),f=n[1],l=e[1],a=o[1],p=i[1],h=oi(r),d=oi(l),g=oi(f),v=oi(c),m=oi(p),x=oi(a),b=ei(n,i),w=s*m+2*oi(f*p),_=ei(e,o),M=d*u+2*oi(l*a),S=ni(c,n),I=v*s+oi(c*f),N=ni(r,o),y=h*u+oi(r*a),C=ni(c,e),O=oi(c*l),E=ni(r,i),T=oi(r*p),A=ei(n,n),P=2*(s*g+oi(f*f)),k=ei(n,o),B=s*x+g*u+2*oi(f*a),z=ei(o,o),F=2*(u*x+oi(a*a)),L=f*p-l*a,Y=f*c-r*a,H=l*c-r*p,X=ri(b,_),$=oi(L),V=w+M+$,D=ri(S,N),q=oi(Y),j=I+y+q,W=ri(C,E),Q=oi(H),R=O+T+Q,G=Ko(z),U=F,Z=ti(k),J=2*B,K=Ko(A),tt=P,nt=p*L,et=ei(i,X),rt=m*V+2*oi(nt),ot=2*Y*a,it=ti(ei(o,D)),ct=2*(u*q+x*j+2*oi(ot)),st=nt-ot,ut=ri(et,it),ft=rt+ct+oi(st),lt=2*f*Y,at=ti(ei(n,D)),pt=2*(s*q+g*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,vₓ_:Mr,vᵧ_:Pr,v_:jr+Dr+pi(Wr[1])}}}const wi=Gt,_i=Ge,Mi=Vn,Si=Wn,Ii=Ut,{abs:Ni}=Math,yi=Ut,Ci=Vn,Oi=Wn,{abs:Ei}=Math,Ti=Gt,Ai=Ge,Pi=Vn,ki=Wn,Bi=Ut,{abs:zi}=Math,Fi=Gt,Li=Ge,Yi=Vn,Hi=Wn,Xi=Ut,{abs:$i}=Math,Vi=Ut,Di=Vn,qi=Wn,{abs:ji}=Math,Wi=Gt,Qi=Ge,Ri=Vn,Gi=Wn,Ui=Ut,{abs:Zi}=Math,Ji=Gt,Ki=Ge,tc=Vn,nc=Wn,ec=Ut,{abs:rc}=Math,oc=Z,ic=lt,cc=nt,sc=at;function uc(t){if(4===t.length)return fc(t);if(3===t.length)return lc(t);if(2===t.length)return ac(t);if(1===t.length)return function(t){const[[n,e]]=t;return[[[n]],[[e]]]}(t);throw new Error("The given bezier curve must be of order <= cubic.")}function fc(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[J(oc(s,n),cc(3,oc(r,i))),cc(3,sc(ic(i,n),-2*r)),cc(3,oc(r,n)),[n]].map(Pn),[J(oc(u,e),cc(3,oc(o,c))),cc(3,sc(ic(c,e),-2*o)),cc(3,oc(o,e)),[e]].map(Pn)]}function lc(t){const[[n,e],[r,o],[i,c]]=t;return[[sc(ic(i,n),-2*r),oc(2*r,2*n),[n]],[sc(ic(c,e),-2*o),oc(2*o,2*e),[e]]]}function ac(t){const[[n,e],[r,o]]=t;return[[oc(r,n),[n]],[oc(o,e),[e]]]}const pc=nt,hc=ot;function dc(t){const[[n,[e]],[r,[o]]]=t;if(0!==ct(n)||0!==ct(r))return{vₓ:hc(r),vᵧ:n,v:Pn(it(pc(e,r),pc(o,n)))}}const gc=nt,vc=et,mc=J;function xc(t,n){const e=ac(t),[[r,[o]],[i,[c]]]=ac(n),{vₓ:s,vᵧ:u,v:f}=dc(e),l=vc(r,s),a=vc(i,u),p=mc(l,a),h=gc(o,s),d=gc(c,u),g=mc(h,d);return[p,mc(g,f)].map(Pn)}const bc=nt,wc=mr,_c=it,Mc=et,Sc=ot;function Ic(t){const[[n,e,[r]],[o,i,[c]]]=t;if(0===ct(n)&&0===ct(o))return dc([[e,[r]],[i,[c]]]);const s=Mc(n,i),u=Mc(e,o),f=bc(c,n),l=bc(r,o),a=bc(c,e),p=bc(r,i),h=Mc(n,n),d=Mc(n,o),g=Mc(o,o),v=_c(s,u),m=_c(f,l),x=_c(a,p),b=Pn(Sc(g)),w=Pn(wc(d)),_=Pn(Sc(h)),M=Mc(i,v),S=wc(Mc(o,m)),I=Pn(_c(M,S)),N=wc(Mc(n,m)),y=Mc(e,v),C=Pn(_c(N,y)),O=Mc(v,x),E=Mc(m,m);return{vₓₓ:b,vₓᵧ:w,vᵧᵧ:_,vₓ:I,vᵧ:C,v:Pn(_c(O,E))}}const Nc=Kn,yc=nt,Cc=et,Oc=J,Ec=mr;function Tc(t,n){const e=lc(t);if(0===ct(e[0][0])&&0===ct(e[1][0]))return xc([t[0],t[2]],n);const[[r,[o]],[i,[c]]]=ac(n),{vₓₓ:s,vₓᵧ:u,vᵧᵧ:f,vₓ:l,vᵧ:a,v:p}=Ic(e),h=Nc(o,o),d=yc(o,r),g=Nc(o,c),v=yc(o,i),m=Cc(r,r),x=yc(c,r),b=Cc(r,i),w=Nc(c,c),_=yc(c,i),M=Cc(i,i),S=Cc(m,s),I=Cc(M,f),N=Cc(b,u),y=Oc(S,I),C=Oc(y,N),O=Cc(d,s),E=Cc(_,f),T=Oc(v,x),A=Cc(T,u),P=Ec(Oc(O,E)),k=Oc(P,A),B=Cc(r,l),z=Cc(i,a),F=Oc(B,z),L=Oc(k,F),Y=Cc(h,s),H=Cc(g,u),X=Cc(w,f),$=Oc(Y,H),V=Oc($,X),D=yc(o,l),q=yc(c,a),j=Oc(D,q),W=Oc(V,j);return[C,L,Oc(W,p)].map(Pn)}const Ac=et,Pc=Z,kc=tt,Bc=lt;function zc(t,n=!1){const[e,r,o,i]=t;if(!n){const[t,n]=e,[c,s]=r,[u,f]=o,[l,a]=i;return[e,[rt(it(kc(Bc(c/4,u/4),3),Bc(t/4,l/4))),rt(it(kc(Bc(s/4,f/4),3),Bc(n/4,a/4)))],i]}const c=function(t,n){const[[e,r],[o,i]]=t,[[c,s],[u,f]]=n,l=Pc(o,e),a=Pc(i,r),p=Pc(u,c),h=Pc(f,s),d=it(Ac(p,a),Ac(h,l));if(0===ct(d))return;const g=Pc(c,e),v=Pc(s,r),m=rt(it(Ac(v,l),Ac(g,a)))/rt(d);return[c+m*rt(p),s+m*rt(h)]}([e,r],[i,o]);if(void 0!==c)return[e,c,i]}const Fc=nt,Lc=et,Yc=J,Hc=it,Xc=ot,$c=mr;function Vc(t){const[[n,e,r,[o]],[i,c,s,[u]]]=t;if(0===ct(n)&&0===ct(i))return Ic([[e,r,[o]],[c,s,[u]]]);const f=Lc(n,s),l=Lc(r,i),a=Lc(n,c),p=Lc(e,c),h=Lc(e,i),d=Lc(n,n),g=Lc(c,c),v=Lc(i,i),m=Lc(r,n),x=Lc(e,e),b=Lc(s,i),w=Lc(c,i),_=Lc(e,n),M=Lc(n,i),S=Fc(u,n),I=Fc(o,i),N=Fc(u,e),y=Fc(o,c),C=Lc(e,s),O=Lc(r,c),E=Fc(u,r),T=Fc(o,s),A=Hc(S,I),P=Hc(f,l),k=Hc(a,h),B=Hc(N,y),z=Hc(C,O),F=Hc(E,T),L=Hc(b,g),Y=Hc(m,x),H=Yc(h,a),X=Yc(l,f),$=$c(P),V=Lc(A,A),D=Lc(A,P),q=Lc(A,k),j=Lc(A,z),W=Lc(P,P),Q=Lc($,B),R=Lc(k,B),G=Lc(k,z),U=Lc(k,F),Z=Pn(Lc(Xc(i),v)),J=Pn(Lc(Fc(3,n),v)),K=Pn(Lc(Fc(-3,i),d)),tt=Pn(Lc(n,d)),nt=Hc(Fc(-3,A),z),et=Lc(nt,v),rt=Lc(k,L),ot=Yc(et,rt),it=Lc($,w),st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Dc(3,c),l),z=jc(r,s),F=jc(r,f),L=jc(i,u),Y=jc(i,l),H=Wc(z,L),X=Wc(F,Y),$=jc(_,H),V=jc(y,X),D=Wc($,V),q=Wc(O,T),j=Qc(Wc(E,P)),W=Wc(A,B),Q=Wc(q,a),R=Wc(j,p),G=Wc(W,h),U=jc(_,Q),Z=jc(S,R),J=jc(y,G),K=Wc(U,Z),tt=Wc(K,J),nt=Qc(Wc(T,a)),et=Qc(Wc(A,h)),rt=Wc(O,nt),ot=Wc(B,et),it=Wc(E,p),st=Wc(P,p),ut=jc(x,rt),ft=jc(N,ot),lt=jc(w,it),at=jc(M,st),pt=jc(r,d),ht=jc(i,g),dt=Wc(ut,ft),gt=Wc(lt,at),vt=Wc(dt,gt),mt=Wc(pt,ht),xt=Wc(vt,mt),bt=Wc(C,T),wt=Wc(k,A),_t=Wc(bt,a),Mt=Wc(wt,h),St=jc(m,_t),It=jc(I,Mt),Nt=jc(b,p),yt=Wc(St,It),Ct=Wc(yt,Nt),Ot=qc(o,d),Et=qc(c,g),Tt=Wc(Ot,Et),At=Wc(Ct,Tt);return[D,tt,xt,Wc(At,v)].map(Pn)}const Gc=nt,Uc=et,Zc=J;function Jc(t,n){const e=ac(t),[[r,o,[i]],[c,s,[u]]]=lc(n);if(0===ct(r)&&0===ct(c))return xc(t,[n[0],n[2]]);const{vₓ:f,vᵧ:l,v:a}=dc(e),p=Uc(r,f),h=Uc(c,l),d=Zc(p,h),g=Uc(o,f),v=Uc(s,l),m=Zc(g,v),x=Gc(i,f),b=Gc(u,l),w=Zc(x,b);return[d,m,Zc(w,a)].map(Pn)}const Kc=Kn,ts=nt,ns=et,es=J,rs=mr;function os(t,n){const e=lc(t);if(0===ct(e[0][0])&&0===ct(e[1][0]))return Jc([t[0],t[2]],n);const[[r,o,[i]],[c,s,[u]]]=lc(n);if(0===ct(r)&&0===ct(c))return Tc(t,[n[0],n[2]]);const{vₓₓ:f,vₓᵧ:l,vᵧᵧ:a,vₓ:p,vᵧ:h,v:d}=Ic(e),g=Kc(i,i),v=ts(i,o),m=ts(i,r),x=Kc(i,u),b=ts(i,s),w=ts(i,c),_=ns(o,o),M=ns(o,r),S=ts(u,o),I=ns(o,s),N=ns(o,c),y=ns(r,s),C=ns(r,r),O=ts(u,r),E=ns(r,c),T=Kc(u,u),A=ts(u,s),P=ts(u,c),k=ns(s,s),B=ns(s,c),z=ns(c,c),F=ns(C,f),L=ns(E,l),Y=ns(z,a),H=es(F,L),X=es(H,Y),$=ns(M,f),V=ns(B,a),D=es(N,y),q=ns(D,l),j=rs(es($,V)),W=es(j,q),Q=es(rs(m),_),R=es(rs(P),k),G=es(w,I),U=es(G,O),Z=ns(Q,f),J=ns(R,a),K=ns(U,l),tt=ns(r,p),nt=ns(c,h),et=es(Z,J),rt=es(et,K),ot=es(tt,nt),it=es(rt,ot),st=ns(v,f),ut=ns(A,a),ft=es(b,S),lt=ns(ft,l),at=rs(es(st,ut)),pt=ns(o,p),ht=ns(s,h),dt=es(at,lt),gt=es(pt,ht),vt=es(dt,gt),mt=ns(g,f),xt=ns(x,l),bt=ns(T,a),wt=ts(i,p),_t=ts(u,h),Mt=es(mt,xt),St=es(Mt,bt),It=es(wt,_t),Nt=es(St,It);return[X,W,it,vt,es(Nt,d)].map(Pn)}const is=Kn,cs=nt,ss=et,us=J,fs=mr;function ls(t,n){const e=fc(t);if(0===ct(e[0][0])&&0===ct(e[1][0]))return os(zc(t),n);const[[r,o,[i]],[c,s,[u]]]=lc(n);if(0===ct(r)&&0===ct(c))return Rc(t,[n[0],n[2]]);const{vₓₓₓ:f,vₓₓᵧ:l,vₓᵧᵧ:a,vᵧᵧᵧ:p,vₓₓ:h,vₓᵧ:d,vᵧᵧ:g,vₓ:v,vᵧ:m,v:x}=Vc(e),b=is(i,i),w=cs(i,o),_=cs(i,r),M=is(i,u),S=cs(i,s),I=cs(i,c),N=ss(o,o),y=ss(o,r),C=cs(u,o),O=ss(o,s),E=ss(o,c),T=ss(r,s),A=ss(r,r),P=cs(u,r),k=ss(r,c),B=is(u,u),z=cs(u,s),F=cs(u,c),L=ss(s,s),Y=ss(s,c),H=ss(c,c),X=ss(r,f),$=ss(r,a),V=ss(c,l),D=ss(c,p),q=us(X,V),j=us($,D),W=ss(A,q),Q=ss(H,j),R=us(W,Q),G=us(_,N),U=us(F,L),Z=us(fs(_),N),J=us(fs(F),L),K=us(fs(O),P),tt=us(fs(O),I),nt=us(fs(P),O),et=us(cs(6,_),N),rt=us(cs(6,F),L),ot=us(E,T),it=us(I,P),st=us(fs(C),S),ut=us(fs(S),C),ft=us(I,O),lt=us(ft,P),at=cs(3,A),pt=cs(3,H),ht=ss(at,f),dt=ss(A,l),gt=fs(ss(k,l)),vt=fs(ss(k,a)),mt=ss(H,a),xt=ss(pt,p),bt=us(ht,gt),wt=us(dt,vt),_t=us(bt,mt),Mt=us(wt,xt),St=ss(o,_t),It=ss(s,Mt),Nt=us(St,It),yt=ss(c,Z),Ct=ss(c,tt),Ot=ss(r,K),Et=ss(r,J),Tt=ss(cs(3,r),G),At=ss(cs(3,c),U),Pt=us(yt,Ot),kt=us(Ct,Et),Bt=ss(Tt,f),zt=ss(At,p),Ft=ss(Pt,l),Lt=ss(kt,a),Yt=us(Bt,zt),Ht=us(Ft,Lt),Xt=ss(A,h),$t=ss(H,g),Vt=ss(k,d),Dt=us(Xt,$t),qt=us(Yt,Ht),jt=us(Dt,Vt),Wt=us(qt,jt),Qt=ss(o,et),Rt=ss(s,rt),Gt=cs(2*i,ot),Ut=ss(fs(s),it),Zt=ss(o,nt),Jt=ss(o,J),Kt=us(Gt,Zt),tn=us(Ut,Jt),nn=ss(Y,g),en=ss(y,h),rn=ss(ot,d),on=us(nn,en),cn=ss(Qt,f),sn=ss(Kt,l),un=ss(Rt,p),fn=ss(tn,a),ln=us(cn,un),an=us(sn,fn),pn=us(ln,an),hn=us(fs(on),rn),dn=us(pn,hn),gn=ss(is(3,i),G),vn=ss(is(3,u),U),mn=cs(i,tt),xn=cs(i,J),bn=cs(u,Z),wn=cs(u,K),_n=us(mn,bn),Mn=us(xn,wn),Sn=ss(gn,f),In=ss(vn,p),Nn=ss(_n,l),yn=ss(Mn,a),Cn=ss(Z,h),On=ss(J,g),En=ss(lt,d),Tn=ss(r,v),An=ss(c,m),kn=us(Sn,In),Bn=us(Nn,yn),zn=us(Cn,On),Fn=us(kn,Bn),Ln=us(zn,En),Yn=us(Tn,An),Hn=us(Fn,Ln),Xn=us(Hn,Yn),$n=ss(is(3,i),w),Vn=ss(is(3,u),z),Dn=cs(i,st),qn=cs(u,ut),jn=ss(w,h),Wn=ss(z,g),Qn=ss(S,d),Rn=ss(C,d),Gn=fs(us(jn,Wn)),Un=us(Qn,Rn),Zn=ss(o,v),Jn=ss(s,m),Kn=ss($n,f),te=ss(Vn,p),ne=ss(Dn,l),ee=ss(qn,a),re=us(Kn,te),oe=us(ne,ee),ie=us(re,oe),ce=us(Gn,Un),se=us(Zn,Jn),ue=us(ie,ce),fe=us(ue,se),le=cs(i,f),ae=cs(i,a),pe=cs(u,l),he=cs(u,p),de=us(le,pe),ge=us(ae,he),ve=us(de,h),me=us(ge,g),xe=ss(b,ve),be=ss(B,me),we=ss(M,d),_e=cs(i,v),Me=cs(u,m),Se=us(xe,be),Ie=us(Se,we),Ne=us(_e,Me),ye=us(Ie,Ne);return[R,Nt,Wt,dn,Xn,fe,us(ye,x)].map(Pn)}const as=nt,ps=et,hs=J;function ds(t,n){const e=ac(t),[[r,o,i,[c]],[s,u,f,[l]]]=fc(n);if(0===ct(r)&&0===ct(s))return Jc(t,zc(n));const{vₓ:a,vᵧ:p,v:h}=dc(e),d=ps(r,a),g=ps(s,p),v=hs(d,g),m=ps(o,a),x=ps(u,p),b=hs(m,x),w=ps(i,a),_=ps(f,p),M=hs(w,_),S=as(c,a),I=as(l,p),N=hs(S,I);return[v,b,M,hs(N,h)].map(Pn)}const gs=Kn,vs=nt,ms=et,xs=J,bs=mr;function ws(t,n){const e=lc(t);if(0===ct(e[0][0])&&0===ct(e[1][0]))return ds([t[0],t[2]],n);const[[r,o,i,[c]],[s,u,f,[l]]]=fc(n);if(0===ct(r)&&0===ct(s))return os(t,zc(n));const{vₓₓ:a,vₓᵧ:p,vᵧᵧ:h,vₓ:d,vᵧ:g,v}=Ic(e),m=gs(c,c),x=vs(c,i),b=vs(c,o),w=vs(c,r),_=gs(c,l),M=vs(c,f),S=vs(c,u),I=vs(c,s),N=ms(i,i),y=ms(i,o),C=ms(i,r),O=vs(l,i),E=ms(i,f),T=ms(i,u),A=ms(i,s),P=ms(o,f),k=ms(o,o),B=ms(o,r),z=vs(l,o),F=ms(o,u),L=ms(o,s),Y=ms(r,r),H=vs(l,r),X=ms(r,f),$=ms(r,u),V=ms(r,s),D=gs(l,l),q=vs(l,f),j=vs(l,u),W=vs(l,s),Q=ms(f,f),R=ms(f,u),G=ms(s,s),U=ms(u,u),Z=ms(u,s),J=ms(f,s),K=ms(Y,a),tt=ms(V,p),nt=ms(G,h),et=xs(K,tt),rt=xs(et,nt),ot=ms(B,a),it=ms(Z,h),st=xs(ot,it),ut=xs(L,$),ft=ms(ut,p),lt=xs(bs(st),ft),at=xs(bs(C),k),pt=xs(bs(J),U),ht=xs(A,F),dt=xs(ht,X),gt=ms(at,a),vt=ms(pt,h),mt=xs(gt,vt),xt=ms(dt,p),bt=xs(mt,xt),wt=xs(w,y),_t=xs(W,R),Mt=xs(I,T),St=xs(P,H),It=xs(Mt,St),Nt=ms(wt,a),yt=ms(_t,h),Ct=bs(xs(Nt,yt)),Ot=ms(It,p),Et=ms(r,d),Tt=ms(s,g),At=xs(Et,Tt),Pt=xs(Ct,Ot),kt=xs(Pt,At),Bt=xs(bs(b),N),zt=xs(bs(j),Q),Ft=xs(S,E),Lt=xs(Ft,z),Yt=ms(Bt,a),Ht=ms(zt,h),Xt=ms(Lt,p),$t=xs(Yt,Ht),Vt=xs($t,Xt),Dt=ms(o,d),qt=ms(u,g),jt=xs(Dt,qt),Wt=xs(Vt,jt),Qt=ms(x,a),Rt=ms(q,h),Gt=xs(M,O),Ut=ms(Gt,p),Zt=bs(xs(Qt,Rt)),Jt=xs(Zt,Ut),Kt=ms(i,d),tn=ms(f,g),nn=xs(Kt,tn),en=xs(Jt,nn),rn=ms(m,a),on=ms(_,p),cn=ms(D,h),sn=vs(c,d),un=vs(l,g),fn=xs(rn,on),ln=xs(fn,cn),an=xs(sn,un),pn=xs(ln,an);return[rt,lt,bt,kt,Wt,en,xs(pn,v)].map(Pn)}const _s=Kn,Ms=nt,Ss=et,Is=J,Ns=mr,ys=[[function(t,n){const{coeffs:{vₓ:e,vᵧ:r,v:o},errorBound:{v_:i}}=Qo(t),[[c,[,s]],[u,[,f]]]=Vo(n),l=c[1],a=u[1],p=e[1],h=r[1],d=o[1],g=l*p,v=2*Ro(g),m=Zo(c,e),x=a*h,b=2*Ro(x),w=Zo(u,r),_=g+x,M=Go(m,w),S=v+b+Ro(_),I=s*p,N=Uo(s,e),y=Ro(I),C=f*h,O=Uo(f,r),E=Ro(C),T=I+C,A=Go(N,O),P=y+E+Ro(T);return{coeffs:[M,Go(A,o)],errBound:[S,P+i+Ro(T+d)]}},function(t,n){const{coeffs:{vₓ:e,vᵧ:r,v:o},errorBound:{v_:i}}=Qo(t),{coeffs:[[c,s,[,u]],[f,l,[,a]]],errorBound:[[p],[h]]}=$o(n),d=e[1],g=r[1],v=o[1],m=Ei(d),x=Ei(g),b=s[1],w=c[1],_=l[1],M=f[1],S=w*d,I=Oi(c,e),N=p*m+2*Ei(S),y=M*g,C=Oi(f,r),O=h*x+2*Ei(y),E=S+y,T=yi(I,C),A=N+O+Ei(E),P=b*d,k=Oi(s,e),B=2*Ei(P),z=_*g,F=Oi(l,r),L=2*Ei(z),Y=P+z,H=yi(k,F),X=B+L+Ei(Y),$=Ci(u,e),V=u*d,D=Ei(V),q=Ci(a,r),j=a*g,W=Ei(j),Q=V+j,R=yi($,q),G=D+W+Ei(Q),U=Q+v;return{coeffs:[T,H,yi(R,o)],errBound:[A,X,G+i+Ei(U)]}},function(t,n){const{coeffs:{vₓ:e,vᵧ:r,v:o},errorBound:{v_:i}}=Qo(t),{coeffs:[[c,s,u,[,f]],[l,a,p,[,h]]],errorBound:[[d,g,v],[m,x,b]]}=Xo(n),w=ji(e[1]),_=ji(r[1]),M=qi(c,e),S=d*w+2*ji(M[1]),I=qi(l,r),N=m*_+2*ji(I[1]),y=Vi(M,I),C=S+N+ji(y[1]),O=qi(s,e),E=g*w+2*ji(O[1]),T=qi(a,r),A=x*_+2*ji(T[1]),P=Vi(O,T),k=E+A+ji(P[1]),B=qi(u,e),z=v*w+2*ji(B[1]),F=qi(p,r),L=b*_+2*ji(F[1]),Y=Vi(B,F),H=z+L+ji(Y[1]),X=Di(f,e),$=ji(X[1]),V=Di(h,r),D=ji(V[1]),q=Vi(X,V),j=$+D+ji(q[1]),W=Vi(q,o);return{coeffs:[y,P,Y,W],errBound:[C,k,H,j+i+ji(W[1])]}}],[function(t,n){const{coeffs:{vₓₓ:e,vₓᵧ:r,vᵧᵧ:o,vₓ:i,vᵧ:c,v:s},errorBound:{vₓₓ_:u,vₓᵧ_:f,vᵧᵧ_:l,vₓ_:a,vᵧ_:p,v_:h}}=ii(t),[[d,[,g]],[v,[,m]]]=Vo(n),x=e[1],b=r[1],w=o[1],_=i[1],M=c[1],S=s[1],I=ai(x),N=ai(b),y=ai(w),C=d[1],O=v[1],E=ai(g),T=ai(C),A=ai(m),P=ai(O),k=g*g,B=g*C,z=g*m,F=g*O,L=C*C,Y=C*m,H=C*O,X=m*m,$=m*O,V=O*O,D=ci(g,g),q=ui(g,d),j=ai(B),W=ci(g,m),Q=ui(g,v),R=ai(F),G=ai(L),U=fi(d,d),Z=2*G,J=ui(m,d),K=ai(Y),tt=ai(H),nt=fi(d,v),et=2*tt,rt=ci(m,m),ot=ui(m,v),it=ai($),ct=ai(V),st=fi(v,v),ut=2*ct,ft=L*x,lt=fi(U,e),at=Z*I*G*u+2*ai(ft),pt=V*w,ht=fi(st,o),dt=ut*y*ct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is(Mo,So),No=Is(P,y),yo=Ms(c,p),Co=Ms(l,h),Oo=Is(No,P),Eo=Is(No,y),To=Ss(i,_),Ao=Ss(To,a),Po=Ss(f,Q),ko=Ss(Po,d),Bo=Ss(v,No),zo=Ss(M,g),Fo=Ss(R,m),Lo=Is(zo,Fo),Yo=Ss(i,x),Ho=Ss(f,b),Xo=Is(Yo,Ho),$o=Ss(yo,Oo),Vo=Ss(Co,Eo),Do=Is($o,Vo),qo=Ms(3,Is(Ao,ko)),jo=Is(Bo,Ns(Lo)),Wo=Is(Do,qo),Qo=Is(jo,Xo),Ro=Is(Wo,Qo),Go=Ms(c,a),Uo=Ms(l,p),Zo=Is(Go,Uo),Jo=Ms(c,h),Ko=Ms(l,d),ti=Is(Jo,Ko),ni=Is(Zo,g),ei=Is(ti,m),ri=Ss(_,ni),oi=Ss(Q,ei),ii=Is(ri,oi),ci=Ss(N,v),si=Is(ii,ci),ui=Ms(c,x),fi=Ms(l,b),li=Is(ui,fi),ai=Is(si,li);return[dt,Ct,Jt,Fn,be,Ke,$r,Io,Ro,Is(ai,w)].map(Pn)}]];function Os(t,n){const{coeffs:e,errBound:r}=ys[t.length-2][n.length-2](t,n);return{coeffs:e,errBound:r,getPExact:()=>Cs[t.length-2][n.length-2](t,n)}}const Es=134217729;function Ts(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],c=r/i,s=i*c,u=Es*i,f=u-(u-i),l=i-f,a=Es*c,p=a-(a-c),h=c-p,d=o*c,g=s+d,v=d-(g-s)+(l*h-(s-f*p-l*p-f*h)),m=g+v,x=(r-m+(e-(v-(m-g))))/i,b=c+x;return[x-(b-c),b]}const As=Ts,Ps=Number.EPSILON/2,ks=Ps*Ps,Bs=Zt,zs=Zt,Fs=Wn,Ls=Ut,Ys=Zt,Hs=Re,Xs=Bo;function $s(t,n){if(0===n[0]&&0===n[1])return t[0].map(t=>[0,t]);if(0===n[0]&&1===n[1])return t[t.length-1].map(t=>[0,t]);if(4===t.length){const[[e,r],[o,i],[c,s],[u,f]]=t,l=Xs(Fs(Hs(o,e),n),e),a=Xs(Fs(Hs(c,o),n),o),p=Xs(Fs(Hs(u,c),n),c),h=Ls(l,Fs(Ys(a,l),n)),d=Ls(a,Fs(Ys(p,a),n)),g=Ls(h,Fs(Ys(d,h),n)),v=Xs(Fs(Hs(i,r),n),r),m=Xs(Fs(Hs(s,i),n),i),x=Xs(Fs(Hs(f,s),n),s),b=Ls(v,Fs(Ys(m,v),n)),w=Ls(m,Fs(Ys(x,m),n));return[g,Ls(b,Fs(Ys(w,b),n))]}if(3===t.length){const[[e,r],[o,i],[c,s]]=t,u=Ls([0,e],Fs(Hs(o,e),n)),f=Ls([0,o],Fs(Hs(c,o),n)),l=Ls(u,Fs(Ys(f,u),n)),a=Ls([0,r],Fs(Hs(i,r),n)),p=Ls([0,i],Fs(Hs(s,i),n));return[l,Ls(a,Fs(Ys(p,a),n))]}if(2===t.length){const[[e,r],[o,i]]=t;return[Xs(Fs(Hs(o,e),n),e),Xs(Fs(Hs(i,r),n),r)]}if(1===t.length){const[n,e]=t[0];return[[0,n],[0,e]]}throw new Error("The given bezier curve must be of order <= 3.")}const{abs:Vs}=Math,Ds=[0,1],qs=Zt,js=Bo,Ws=Ut,Qs=Wn,Rs=Vn,Gs=Ge,Us=function(t,n,e,r){const o=t[0],i=t[1],c=n[0],s=n[1],u=As(t,n),f=Math.abs(o+i),l=Math.abs(c+s),a=l-Ps*l-r;return a<=0?{est:u,err:Number.POSITIVE_INFINITY}:{est:u,err:(l*e+f*r)/a**2+9*ks*Math.abs(f/l)}},Zs=function(t,n){return Bs(t,n)[1]>0?n:t},Js=function(t,n){return zs(t,n)[1]>0?t:n};function Ks(t,n){return n[0][0]!==n[1][0]||n[0][1]!==n[1][1]?4===t.length?function([[t,n],[e,r],[o,i],[c,s]],[u,f]){const l=qs(f,u),a=3*Fe*Vs(l[1]),p=qs(Ds,u),h=3*Fe*Vs(p[1]),d=Us(l,p,a,h);f=js(d.est,d.err);const g=qs(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,v)),j=Ws(Rs(i,c),Rs(r,h)),W=q,Q=Ws(Qs(s,j),Qs(m,q)),R=Ws(Ws(Rs(i,x),Qs(Gs(b),j)),Qs(w,q)),G=F*S+2*B*I+P*N,U=F*_+B*M;P=G,B=y*U+C*G,F=O*i+2*E*U+T*G,P*=7*Fe,B*=11*Fe,F*=14*Fe;const Z=Zs(Zs(js(H,-A),js(X,-k)),js($,-z)),J=Js(Js(js(H,+A),js(X,+k)),js($,+z));return[[Z,Zs(Zs(js(W,-P),js(Q,-B)),js(R,-F))],[J,Js(Js(js(W,+P),js(Q,+B)),js(R,+F))]]}(t,n):function([[t,n],[e,r]],[o,i]){const c=qs(i,o),s=3*Fe*Vs(c[1]),u=qs(Ds,o),f=3*Fe*Vs(u[1]),l=Us(c,u,s,f);i=js(l.est,l.err);const a=qs(Ds,o),p=qs(Ds,i),h=Vs(o[1]),d=Vs(a[1]),g=Vs(i[1]),v=Vs(p[1]);let m=Vs(t),x=Vs(n),b=Vs(e),w=Vs(r);const _=Ws(Rs(e,o),Rs(t,a)),M=Ws(Rs(e,i),Qs(_,p));m=b*h+m*d,b=b*g+m*v,m*=3*ze,b*=7*ze;const S=Ws(Rs(r,o),Rs(n,a)),I=Ws(Rs(r,i),Qs(S,p));x=w*h+x*d,w=w*g+x*v,x*=3*ze,w*=7*ze;const N=Zs(js(_,-m),js(M,-b)),y=Js(js(_,+m),js(M,+b));return[[N,Zs(js(S,-x),js(I,-w))],[y,Js(js(S,+x),js(I,+w))]]}(t,n):function(t,n){const e=t[0],r=t[t.length-1];if(0===n[0]&&0===n[1]){const t=[0,e[0]],n=[0,e[1]];return[[t,n],[t,n]]}if(0===n[0]&&1===n[1]){const t=[0,r[0]],n=[0,r[1]];return[[t,n],[t,n]]}const o=$s(t,n);let i;if(4===t.length)i=ke(t,n).map(t=>16*Ye*t);else if(3===t.length)i=ke(t,n).map(t=>10*Ye*t);else if(2===t.length)i=ke(t,n).map(t=>4*Ye*t);else if(1===t.length)return[o,o];return[[js(o[0],-i[0]),js(o[1],-i[1])],[js(o[0],+i[0]),js(o[1],+i[1])]]}(t,n[0])}function tu(t){return(n,e)=>{let[[r,o],[i,c]]=n,[[s,u],[f,l]]=e;return(o[1]>c[1]||o[1]===c[1]&&o[0]>c[0])&&([o,c]=[c,o]),(u[1]>l[1]||u[1]===l[1]&&u[0]>l[0])&&([u,l]=[l,u]),(r[1]>i[1]||r[1]===i[1]&&r[0]>i[0])&&([r,i]=[i,r]),(s[1]>f[1]||s[1]===f[1]&&s[0]>f[0])&&([s,f]=[f,s]),t?(r[1]<f[1]||r[1]===f[1]&&r[0]<=f[0])&&(i[1]>s[1]||i[1]===s[1]&&i[0]>=s[0])&&(u[1]<c[1]||u[1]===c[1]&&u[0]<=c[0])&&(l[1]>o[1]||l[1]===o[1]&&l[0]>=o[0]):(r[1]<f[1]||r[1]===f[1]&&r[0]<f[0])&&(i[1]>s[1]||i[1]===s[1]&&i[0]>s[0])&&(u[1]<c[1]||u[1]===c[1]&&u[0]<c[0])&&(l[1]>o[1]||l[1]===o[1]&&l[0]>o[0])}}function nu(t){return[((n=t.x.box)[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2];var n}function eu(t,n){const e=Os(t,n);if(void 0===e)return;const{coeffs:r,errBound:o,getPExact:i}=e,c=Te(r,0,1,o,i)||[];return 0!==c.length?{ris:c.map(ko),getPExact:i}:void 0}function ru(t){const n=rt(t.tS);return{t:n,tS:n,tE:rt(t.tE),multiplicity:t.multiplicity}}function ou(t,n){const e=eu(t,n);if(void 0===e)return[];const{getPExact:r}=e;let o,{ris:i}=e;const c=()=>(o=o||r(),o),s=eu(n,t);if(void 0===s)return[];let{ris:u}=s;const{getPExact:f}=s;let l;const a=()=>(l=l||f(),l);let p;p=1;let h,d=0;t:for(;d<p;){h=u.map(n=>Ks(t,[n.tS,n.tE]));for(let t=0;t<u.length;t++){const n=h[t];for(let e=t+1;e<u.length;e++){const t=h[e];if(tu(!0)(n,t)){const t=[];for(const n of u)t.push(...qr({t:n.tS[1],tS:n.tS[1],tE:n.tE[1],multiplicity:n.multiplicity},a()));u=t,d++;continue t}}}break t}p=1;let g,v=0;t:for(;v<p;){g=i.map(t=>Ks(n,[t.tS,t.tE]));for(let t=0;t<i.length;t++){const n=g[t];for(let e=t+1;e<i.length;e++){const t=g[e];if(tu(!0)(n,t)){const t=[];for(const n of i)t.push(...qr({t:n.tS[1],tS:n.tS[1],tE:n.tE[1],multiplicity:n.multiplicity},c()));i=t,v++;continue t}}}break t}const m=[];for(let t=0;t<u.length;t++){const n=h[t];for(let e=0;e<i.length;e++){const o=g[e];if(tu(!0)(n,o)){const c={compensated:d,ri:ru(u[t]),riExp:d?u[t]:void 0,getPExact:d?void 0:f,kind:1,box:iu(n)},s={compensated:v,ri:ru(i[e]),riExp:v?i[e]:void 0,getPExact:v?void 0:r,kind:1,box:iu(o)};m.push({psX:c,sideX:s})}}}return m}function iu(t){return t.map(t=>t.map(rt))}function cu(t,n){return function(t,n){const e=t.xs,r=[],o=new Map;for(const t of e){const n=t.curve,e=o.get(n);e?e.push(t):o.set(n,[t])}const i=function(t){const[[n,e],[r,o]]=t.box,i=[[[r,e],[n,e]],[[n,e],[n,o]],[[n,o],[r,o]],[[r,o],[r,e]]];return(n,e,r)=>{const o=n.ps,c=e.slice();for(let t=0;t<i.length;t++){const n=ou(o,i[t]);for(const{psX:e,sideX:r}of n)c.push({x:e,side:t,sideX:r,curve:void 0})}c.sort((t,n)=>t.x.ri.tS-n.x.ri.tS);const s=[],u=[];let f,l;for(const n of c)void 0!==n.side?(!0===l&&(u.push({idx:++r,dir:1,p:nu(n),_x_:f,container:t,side:n.side,sideX:n.sideX,loopsIdxs:new Set,children:new Set,windingNum:0,orientation:0}),f.out=u[u.length-1]),l=!1):(!1===l&&(s.push({idx:++r,dir:-1,p:nu(f),_x_:n,container:t,side:f.side,sideX:f.sideX,loopsIdxs:new Set,children:new Set,windingNum:0,orientation:0}),n.in_=s[s.length-1]),l=!0),f=n;return{ins:s,outs:u,ioIdx:r}}}(t);for(const t of o){const[e,o]=t;let c,s;({ins:c,outs:s,ioIdx:n}=i(e,o,n)),r.push(...c),r.push(...s)}return{inOuts:r,ioIdx:n}}(t,n)}function su(t,n,e,r){const o=[];for(const r of t)o.push({type:-1,item:r,x:n(r)}),o.push({type:1,item:r,x:e(r)});o.sort(uu);const i=new Set,c=[];for(const t of o){const{item:n,type:e}=t;if(-1===e){for(const t of i){const e=r(n,t);e&&c.push({a:n,b:t,u:e})}i.add(n)}else 1===e&&i.delete(n)}return c}function uu(t,n){const e=t.x-n.x;return 0!==e?e:t.type}function fu(t,n,e){const r=(t[0]-e[0])*(n[1]-e[1]),o=(t[1]-e[1])*(n[0]-e[0]),i=r-o;let c;if(r>0){if(o<=0)return i;c=r+o}else{if(!(r<0))return i;if(o>=0)return i;c=-r-o}return Math.abs(i)>=3330669073875472e-31*c?i:function(t,n,e,r){const o=t[0]-e[0],i=n[0]-e[0],c=t[1]-e[1],s=n[1]-e[1],u=it(Kn(o,s),Kn(c,i));let f=rt(u);if(Math.abs(f)>=2220446049250315e-31*r)return f;const l=Z(t[0],e[0])[0],a=Z(n[0],e[0])[0],p=Z(t[1],e[1])[0],h=Z(n[1],e[1])[0];if(0===l&&0===p&&0===a&&0===h)return f;const d=1109335647967049e-46*r+3330669073875471e-31*Math.abs(f);if(f+=o*h+s*l-(c*a+i*p),Math.abs(f)>=d)return f;const g=J(u,it(Kn(l,s),Kn(p,i))),v=J(g,it(Kn(o,h),Kn(c,a)));let m=J(v,it(Kn(l,h),Kn(p,a)));return m=Pn(m),m[m.length-1]}(t,n,e,c)}function lu(t,n){const e=n[0]-t[0],r=n[1]-t[1];return e*e+r*r}function au(t,n,e){const r=n[0]-t[0],o=n[1]-t[1];return r*(e[0]-n[0])+o*(e[1]-n[1])}const pu=function(t,n){if(0===t.length)return;const e=t.slice(),r=function(t){let n,e=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY];for(let r=0;r<t.length;r++){const o=t[r][1];(o<e[1]||o===e[1]&&t[r][0]<e[0])&&(n=r,e=t[r])}return n}(e),[o]=e.splice(r,1);e.sort((t,n)=>{let e=-fu(o,t,n);return 0!==e?e:(e=t[1]-n[1],0!==e?e:t[0]-n[0])}),e.unshift(o);const i=function(t){const n=[t[0]],e=t.length;for(let r=1;r<t.length;r++){const o=t[(r+e-1)%e],i=t[r];o[0]===i[0]&&o[1]===i[1]||n.push(i)}return n}(e),c=[];for(const t of i){for(;c.length>=2&&fu(c[c.length-2],c[c.length-1],t)<0;)c.pop();c.push(t)}if(n||c.length<3)return c;const s=[];{const t=c.length;for(let n=0;n<t;n++){const e=(n+1)%t,r=c[(n+t-1)%t],o=c[n],i=c[e];(0!==fu(r,o,i)||au(r,o,i)<0)&&s.push(o)}}return s},hu=Ut,du=et,gu=J,vu=Wn,{abs:mu}=Math;const{abs:xu}=Math;const{abs:bu}=Math,wu=Wn,_u=Ut,Mu=et,Su=J,{abs:Iu}=Math;function Nu(t,n){const[e,r]=n,o=e.length,i=r.length,c=e[o-1],s=r[i-1],u=1===o&&1===i;{const{vₓₓ:n,vₓᵧ:e,vᵧᵧ:r,vₓ:o,vᵧ:i,v:f}=function(t){const[[n,e,r],[o,i,c]]=ro(t),s=n*i-e*o,u=n*c-r*o;return{vₓₓ:-o*o,vₓᵧ:2*n*o,vᵧᵧ:-n*n,vₓ:i*s-2*o*u,vᵧ:2*n*u-e*s,v:s*(e*c-r*i)-u*u}}(t),{vₓₓ_:l,vₓᵧ_:a,vᵧᵧ_:p,vₓ_:h,vᵧ_:d,v_:g}=function(t){const[n,e]=t[0],[[r,o],[i,c]]=function(t){const[[n,e],[r,o],[i,c]]=t,s=xu(n),u=xu(r),f=xu(i),l=xu(e),a=xu(o);return[[f+s+2*u,2*(u+s),0],[xu(c)+l+2*a,2*(a+l),0]]}(t),s=bu(n),u=bu(e),f=r*c+o*i,l=r*u+s*i;return{vₓₓ_:i*i,vₓᵧ_:2*r*i,vᵧᵧ_:r*r,vₓ_:c*f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ou=Ut,Eu=et,Tu=J,{abs:Au}=Math;function Pu(t,n){const[e,r]=n,o=e.length,i=r.length,c=e[o-1],s=r[i-1],u=1===o&&1===i;{const{vₓₓₓ:n,vₓₓᵧ:e,vₓᵧᵧ:r,vᵧᵧᵧ:o,vₓₓ:i,vₓᵧ:f,vᵧᵧ:l,vₓ:a,vᵧ:p,v:h}=function(t){const[[n,e,r,o],[i,c,s,u]]=eo(t),f=n*s,l=r*i,a=n*c,p=e*i,h=n*n,d=i*i,g=n*u-o*i,v=f-l,m=a-p,x=e*u-o*c,b=e*s-r*c,w=r*u-o*s,_=2*v,M=g*g,S=g*b,I=_*x,N=m*x,y=-3*g-b,C=-3*M-2*S+(I+m*w),O=2*(g*v-N),E=g*m-v*v+m*b;return{vₓₓₓ:-i*d,vₓₓᵧ:3*n*d,vₓᵧᵧ:-3*i*h,vᵧᵧᵧ:n*h,vₓₓ:y*d+m*(s*i-c*c)+_*c*i,vₓᵧ:2*(m*(e*c-(l+f)/2)-(y*n*i+v*(p+a))),vᵧᵧ:y*h+m*(r*n-e*e)+_*e*n,vₓ:i*C+(c*O+s*E),vᵧ:-n*C-(e*O+r*E),v:g*(I-M-S)+(E*w-N*x)}}(t),{vₓₓₓ_:d,vₓₓᵧ_:g,vₓᵧᵧ_:v,vᵧᵧᵧ_:m,vₓₓ_:x,vₓᵧ_:b,vᵧᵧ_:w,vₓ_:_,vᵧ_:M,v_:S}=function(t){const[n,e]=t[0],[[r,o,i],[c,s,u]]=function(t){const[[n,e],[r,o],[i,c],[s,u]]=t,f=xu(n),l=xu(r),a=xu(i),p=xu(s),h=xu(e),d=xu(o),g=xu(c);return[[p+f+3*(l+a),3*(a+f+2*l),3*(l+f),0],[xu(u)+h+3*(d+g),3*(g+h+2*d),3*(d+h),0]]}(t),f=yu(n),l=yu(e),a=r*u,p=i*c,h=r*s,d=o*c,g=r*r,v=c*c,m=r*l+f*c,x=a+p,b=h+d,w=o*l+f*s,_=o*u+i*s,M=i*l+f*u,S=2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S=Eu(e,r),I=Eu(o,x),N=Eu(i,_),y=Eu(f,M),C=Eu(l,w),O=Eu(a,m),E=Eu(p,S),T=Eu(h,b),A=Eu(e,d),P=Eu(r,g),k=Tu(I,N),B=Tu(y,C),z=Tu(k,B),F=Tu(O,E),L=Tu(F,T),Y=Tu(z,L),H=Tu(A,P),X=Tu(H,v);return 0===ct(Tu(Y,X))}}function ku(t,n){const{coeffs:e,errBound:r,getPExact:o}=Os(t,n);return Te(e,0,1,r,o)}const{min:Bu,max:zu}=Math;function Fu(t,n){let[[e,r],[o,i]]=t,[[c,s],[u,f]]=n;if(e>o&&([e,o]=[o,e]),c>u&&([c,u]=[u,c]),r>i&&([r,i]=[i,r]),s>f&&([s,f]=[f,s]),e<=u&&o>=c&&s<=i&&f>=r)return[[zu(e,c),zu(r,s)],[Bu(o,u),Bu(i,f)]]}function Lu(t,n,e){if(void 0===e)return;if(0===e.length)return[];const r=ku(n,t);if(void 0===r)return;if(0===r.length)return[];const o=r.map(n=>qe(t,[n.tS,n.tE])),i=e.map(t=>qe(n,[t.tS,t.tE])),c=[];for(let t=0;t<r.length;t++){const n=o[t];for(let o=0;o<e.length;o++){const s=Fu(n,i[o]);if(void 0!==s){const n={ri:r[t],box:s,kind:1},i={ri:e[o],box:s,kind:1};c.push([n,i])}}}return c}function Yu(t,n,e){for(const r of[t,n]){const o=r.length;for(let i=1;i<o+1;i++){const c=r[i-1],s=r[i%o],u=[s[1]-c[1],c[0]-s[0]];let f=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let n=0;n<t.length;n++){const e=u[0]*t[n][0]+u[1]*t[n][1];e<f&&(f=e),e>l&&(l=e)}let a=Number.POSITIVE_INFINITY,p=Number.NEGATIVE_INFINITY;for(let t=0;t<n.length;t++){const e=u[0]*n[t][0]+u[1]*n[t][1];e<a&&(a=e),e>p&&(p=e)}if(e&&(l<a||p<f))return!1;if(!e&&(l<=a||p<=f))return!1}}return!0}const Hu=Kn,Xu=J,{abs:$u}=Math;function Vu(t){const[[n,e],[r,o],[i,c],[s,u]]=t,f=s+3*r,l=n+3*i,a=f-l,p=$u(3*r)+$u(f)+($u(3*i)+$u(l))+$u(a);if($u(a)-ze*p>0)return!1;const h=u+3*o,d=e+3*c,g=h-d,v=$u(3*o)+$u(h)+($u(3*c)+$u(d))+$u(g);return!($u(g)-ze*v>0)&&0===ct(it(Xu([s],Hu(3,r)),Xu([n],Hu(3,i))))&&0===ct(it(Xu([u],Hu(3,o)),Xu([e],Hu(3,c))))}const Du=lt,{abs:qu}=Math;function ju(t){const[[n,e],[r,o],[i,c]]=t,s=n+i,u=s-2*r,f=qu(s)+qu(u);if(qu(u)-f>0)return!1;const l=e+c,a=l-2*o,p=qu(l)+qu(a);return!(qu(a)-p>0)&&0===ct(it(Du(n,i),[2*r]))&&0===ct(it(Du(e,c),[2*o]))}function Wu(t){const n=t[0][0],e=t[0][1];for(let r=1;r<t.length;r++)if(n!==t[r][0]||e!==t[r][1])return!1;return!0}function Qu(t){return 4===t.length&&Vu(t)&&(t=zc(t)),3===t.length&&ju(t)&&(t=[t[0],t[2]]),2===t.length&&Wu(t)&&(t=[t[0]]),t}const Ru=Number.EPSILON,Gu=Ru/2;function Uu(t,n){return n<0?t<1?t:1-Gu:0===n?1:t>1?t:1+Ru}function Zu(t){const n=function(t){const n=new ArrayBuffer(8);return new DataView(n).setFloat64(0,t,!1),Array.from(new Uint8Array(n))}(t),e=n[0],r=n[1],o=e>>7,i=((127&e)<<4)+((240&r)>>4),c=0===i?0:16,s=0===i?i-1022:i-1023,u=n.slice(1);return u[0]=(15&r)+c,{sign:o,exponent:s,significand:u}}function Ju(t){return Zu(t).significand}function Ku(t){return Math.log2(t&-t)}function tf(t){if(0===t||!Number.isFinite(t))return NaN;const n=Ju(t),e=n.length;for(let t=e-1;t>=0;t--){if(0===n[t])continue;const r=Ku(n[t]);if(Number.isFinite(r))return 8*(e-t-1)+r}return NaN}function nf(t){return t>=128?7:t>=64?6:t>=32?5:t>=16?4:t>=8?3:t>=4?2:t>=2?1:t>=1?0:NaN}function ef(t){if(0===t||!Number.isFinite(t))return NaN;const n=Ju(t),e=n.length;for(let t=0;t<e;t++){const r=nf(n[t]);if(Number.isFinite(r))return 8*(e-t-1)+r}return NaN}function rf(t){return Zu(t).exponent}function of(t){if(0===t||!Number.isFinite(t))return NaN;const n=rf(t);return ef(t)-52+n}function cf(t,n){const e=(2**(53-n)+1)*t;return e-(e-t)}function sf(t,n){if(0===ct(t=Pn(t)))return[0];const e=of(t[t.length-1]);let r=e,o=t.length-1;for(;o>0;){const i=of(t[o-1]);if(e-i>n)break;r=i,o--}const i=Math.min(n-(e-r),53);let c=t[o];c=cf(c,i);const s=t.slice(o);return s[0]=c,s}function uf(t){return 0===t?0:ef(t)-tf(t)+1}function ff(t){const n=Pn(t);if(0===ct(n))return 0;const e=n[n.length-1],r=n[0];return rf(e)-rf(r)+(53-tf(r))}function lf(t){return rt(function(t,n,e){let r=n,o=t,i=!1,c=0;e||(c=ff(o)-ff(r)+1,e=c/53+1,i=!0);let s=[1/rt(r)],u=1;for(;;){if(o=et(o,s),u>e)return i?(o=sf(o,c),o):o.slice(o.length-e,o.length);r=et(r,s),s=it([2],r),u*=2}}(t[0],t[1],2))}function af(t){return ct(t[0])*ct(t[1])}function pf(t){return(n,e)=>{const r=uc(n),o=uc(e),i=uc(n.slice().reverse()),c=uc(e.slice().reverse()),s=t(r,o),u=t(i,o),f=t(r,c),l=t(i,c),a=-af(u),p=-af(l),h=lf(s),d=lf(f);return[Uu(h,a),Uu(d,p)]}}const hf=pf(function(t,n){const e=0===ct(t[0][0])?1:0;return function(t,n){const[e,r]=t,[,o]=n;return[it(o,r),e]}(t[e],n[e])});function df(t,n){return jr(et(t[0],n[1]),et(t[1],n[0]))*ct(t[1])*ct(n[1])}function gf(t){let n=-1024;for(let e=0;e<t.length;e++){const r=t[e];for(let t=0;t<r.length;t++){const e=r[t];if(0===e)continue;const o=-rf(e)+uf(e)-1;o>n&&(n=o)}}return 0===n?t.map(t=>t.map(t=>BigInt(t))):n>0?t.map(t=>t.map(t=>{if(0===t)return 0n;const e=-rf(t)+uf(t)-1;return BigInt(t*2**e)*2n**BigInt(n-e)})):t.map(t=>t.map(t=>BigInt(t*2**n)))}function vf(t,n){if(n=n<0n?-n:n,0n===(t=t<0n?-t:t))return n;if(0n===n)return t;for(;0n!==n;){const e=n;n=t%n,t=e}return t}const mf=BigInt(2**53);function xf(t){if(0n===t)return[0];const n=[];let e=0,r=t;for(;0n!==r;){r=t/mf;const o=t%mf;n.push(Number(o)*2**(53*e)),t=r,e++}return Pn(n)}const{round:bf,sqrt:wf}=Math;function _f(t){if(t<=1n){if(t<0n)throw new Error("square root of negative numbers are not allowed");return t}let n=BigInt(bf(wf(Number(t))));for(;;){const e=n+t/n>>1n;if(e===n)return n;n=e}}function Mf(t){return t<0n?-t:t}function Sf(t){let n=0n;for(let e=0;e<t.length;e++)n+=t[e];return n}function If(t,n){const[e,r]=Nf(t[0],n[0]),[o,i]=Nf(t[1],n[1]);if(0===df(e,o)||0===df(e,i))return e;if(0===df(r,o)||0===df(r,i))return r;throw new Error("An unexpected error occured.")}function Nf(t,n){const[e,r]=t,[o,i]=n,[c,s]=function(t){const[n,e]=gf(t).map(Sf),r=vf(n,e);return[xf(_f(Mf(n/r))),xf(_f(Mf(e/r)))]}([o,e]);return[[it(et(i,s),et(r,c)),et(c,mr(e))],[it(et(i,ot(s)),et(r,c)),et(c,mr(e))]].sort(df)}function yf(t,n){const e=uc(t),r=0===ct(e[0][0])?0:0===ct(e[1][0])?1:-1;if(-1!==r){const e=t[0][r],o=t[2][r],i=n[0][r],c=n[2][r];return hf([[e,e],[o,o]],[[i,i],[c,c]])}return pf(If)(t,n)}const{round:Cf,cbrt:Of}=Math;function Ef(t){const n=(e=t)>0n?1n:e<0n?-1n:0n;var e;if((t=Mf(t))<=1n)return n*t;let r=BigInt(Cf(Of(Number(t))));for(;;){const e=(2n*r+t/(r*r))/3n;if(e===r)return n*r;r=e}}function Tf(t){return et(t,t)}const Af=pf(function(t,n){const e=0===ct(t[0][0])?1:0;return function(t,n){const[e,r]=t,[o,i]=n,c=function(t){const[n,e]=gf(t).map(Sf),r=vf(n,e);return[xf(Ef(n/r)),xf(Ef(e/r))]}([o,e]),s=Tf(c[0]);return[it(et(i,Tf(c[1])),et(r,s)),et(nt(3,e),s)]}(t[e],n[e])}),{EPSILON:Pf}=Number,kf=Pf/2+Pf**2/2;function Bf(t){return t>0?t-t*kf:t+t*kf}const{EPSILON:zf}=Number,Ff=zf/2+zf**2/2;function Lf(t){return t>0?t+t*Ff:t-t*Ff}function Yf(t){if(0===t||1===t)return[t,t];const n=Bf(Bf(t)),e=function(t){return Lf(Lf(t))}(t);return[n,e]}function Hf(t,n,e,r){const o=t.ps,i=n.ps,c=[];let s=ku(o,i);if(void 0===s){const r=2**(e-47),s=function(t,n,e=!1){e||(t=Qu(t),n=Qu(n));const r=[,,hf,yf,Af],[o,i]=r[t.length](t,n),[c,s]=r[t.length](n,t),u=[{tA:o,tB:0,bez:"B",start:!0},{tA:i,tB:1,bez:"B",start:!1},{tA:0,tB:c,bez:"A",start:!0},{tA:1,tB:s,bez:"A",start:!1}].sort((t,n)=>t.tA-n.tA);if(u[1].tA===u[2].tA){const n=u[1],e=n.tA,r=n.tB,o=qe(t,[e,e]);return[{p:o[0],kind:4,box:o,t1:e,ri1:{t:e,tS:e,tE:e,multiplicity:1},t2:r,ri2:{t:r,tS:r,tE:r,multiplicity:1}}]}if(u[0].bez===u[1].bez)return[];const f=u[1],l=u[2],[a,p]=Yf(f.tA),[h,d]=Yf(f.tB),[g,v]=Yf(l.tA),[m,x]=Yf(l.tB),b=qe(t,[a,p]),w=qe(n,[h,d]),_=qe(t,[g,v]),M=qe(n,[m,x]),S=Fu(b,w),I=Fu(_,M),N={t:a,tS:a,tE:p,multiplicity:1},y={t:h,tS:h,tE:d,multiplicity:1},C={t:g,tS:g,tE:v,multiplicity:1},O={t:m,tS:m,tE:x,multiplicity:1};return[{p:je(S),kind:5,box:S,t1:N.t,ri1:N,t2:y.t,ri2:y},{p:je(I),kind:5,box:I,t1:C.t,ri1:C,t2:O.t,ri2:O}]}(o,i);for(const e of s){const i=Ae(o,e.ri1.tS),s=[[i[0]-r,i[1]-r],[i[0]+r,i[1]+r]],u={x:{ri:e.ri1,kind:5,box:s},curve:t},f={x:{ri:e.ri2,kind:5,box:s},curve:n};c.push([u,f])}return c}if(r&&(s=s.filter(t=>t.tS>0)),0===s.length)return[];const u=Lu(o,i,s);if(void 0===u||0===u.length)return[];for(const e of u){const r={x:e[0],curve:t},o={x:e[1],curve:n};c.push([r,o])}return c}const Xf=He(1);function $f(t,n,e){const r=n.ps;if(0===t)return r[0],{x:{ri:{t,tS:t,tE:t,multiplicity:1},box:[r[0],r[0]],kind:e},curve:n};if(1===t){const o=r[r.length-1];return{x:{ri:{t,tS:t,tE:t,multiplicity:1},box:[o,o],kind:e},curve:n}}const{p:o,pE:i}=function(t,n){const e=Ae(t,n),r=ke(t,[0,n]);if(4===t.length)return{p:e,pE:r.map(t=>9*Xf*t)};if(3===t.length)return{p:e,pE:r.map(t=>6*Xf*t)};if(2===t.length)return{p:e,pE:r.map(t=>3*Xf*t)};if(1===t.length)return{p:t[0],pE:[0,0]};throw new Error("The given bezier curve must be of order <= 3.")}(r,t);return{x:{ri:{t,tS:t,tE:t,multiplicity:1},box:[[o[0]-i[0],o[1]-i[1]],[o[0]+i[0],o[1]+i[1]]],kind:e},curve:n}}function Vf(t,n){if(n.next===t){if(t.next===n)return;[t,n]=[n,t]}const e=t.ps,r=n.ps;if(function(t,n){if(4===t.length)return Pu(t,n);if(3===t.length)return Nu(t,n);if(2===t.length)return function(t,n){const[e,r]=n,o=e.length,i=r.length,c=e[o-1],s=r[i-1],u=1===o&&1===i;{const{coeffs:{vₓ:n,vᵧ:o,v:i},errorBound:{v_:u}}=Qo(t),f=Yr(e),l=Yr(r),a=mu(c),p=mu(s),h=mu(n[1]),d=mu(o[1]),g=a/3,v=p/3,m=n[1]*c,x=vu(f,n),b=h*g+2*mu(m),w=o[1]*s,_=vu(l,o),M=d*v+2*mu(w),S=hu(x,_),I=b+M+mu(S[1]),N=hu(S,i),y=I+u+mu(N[1]);if(Ye*y<mu(rt(N)))return!1}{const n=function(t){return dc(ac(t))}(t);if(void 0===n)return u&&c===t[0][0]&&s===t[0][1];const{vₓ:o,vᵧ:i,v:f}=n,l=du(e,o),a=du(r,i);return 0===ct(gu(gu(l,a),f))}}(t,n);if(1===t.length){const e=Pn(n[0]),r=Pn(n[1]);return 1===e.length&&1===r.length&&e[0]===t[0][0]&&r[0]===t[0][1]}throw new Error("The given bezier curve must be of order <= 3")}(e,r[r.length-1].map(t=>[t]))){const i=Lu(e,r,[(o=1,{t:o,tS:o,tE:o,multiplicity:1})]);if(void 0===i||0===i.length)return;return[[{x:i[0][0],curve:t},$f(1,n,1)]]}var o}function Df(t){return t[t.length-1]<0?ot(t):t}function qf(t,n){const e=t+n,r=e-t;return[t-(e-r)+(n-r),e]}Number.EPSILON;const jf=Number.EPSILON/2;function Wf(t,n,e,r){const o=t/n,i=Math.abs(t),c=Math.abs(n),s=c-r;return s<=0?{est:o,err:Number.POSITIVE_INFINITY}:{est:o,err:(c*e+i*r)/s**2+jf*Math.abs(i/c)}}function Qf(t){const n=t[0],e=t[1];if(0===e)return[0,0];const r=Math.sqrt(e),o=r*r,i=134217729*r,c=i-(i-r),s=r-c,u=.5*(e-o-(s*s-(o-c*c-c*s*2))+n)/r;return[u-(r+u-r),r+u]}const{abs:Rf}=Math;const{abs:Gf}=Math;function Uf(t){const{coeffs:[[n,e,r],[o,i,c]],errorBound:[[s,u],[f,l]]}=function(t){const[[n,e],[r,o],[i,c],[s,u]]=t,f=s-n,l=r-i,a=f+3*l,p=i+n,h=p-2*r,d=r-n,g=u-e,v=o-c,m=g+3*v,x=c+e,b=x-2*o,w=o-e;return{coeffs:[[a,3*h,3*d,n],[m,3*b,3*w,e]],errorBound:[[Rf(f)+6*Rf(l)+Rf(a),6*(Rf(p)+Rf(h)),6*Rf(d),0],[Rf(g)+6*Rf(v)+Rf(m),6*(Rf(x)+Rf(b)),6*Rf(w),0]]}}(t),a=Gf(n),p=Gf(e),h=Gf(r),d=Gf(o),g=Gf(i),v=Gf(c),m=e*o,x=n*i,b=n*c,w=r*o,_=e*c,M=r*i,S=u*d+p*f+Gf(m),I=s*g+a*l+Gf(x),N=s*v+Gf(b),y=h*f+Gf(w),C=u*v+Gf(_),O=h*l+Gf(M),E=m-x,T=Gf(E),A=S+I+T,P=w-b,k=Gf(P),B=y+N+k,z=_-M,F=Gf(z),L=C+O+F,Y=E*E,H=E*P,X=z*E,$=P*P,V=X+$;return{coeffs:[Y,H,V],errBound:[2*A*T+Gf(Y),A*k+T*B+Gf(H),L*T+F*A+Gf(X)+(2*k*B+Gf($))+Gf(V)].map(t=>Le*t)}}const Zf=et,Jf=J;function Kf(t){const[[n,e,r],[o,i,c]]=fc(t),s=Zf(e,o),u=Zf(n,i),f=Zf(n,c),l=Zf(r,o),a=Zf(e,c),p=Zf(r,i),h=it(s,u),d=it(l,f),g=it(a,p),v=Zf(h,h),m=Zf(h,d),x=Zf(h,g),b=Zf(d,d);return[v,m,Jf(x,b)]}const tl=it,nl=et,el=nt,rl=Re,ol=qf,il=Jo,cl=Ut,sl=Ge,ul=Ts,fl=J,ll=at,al=2*Be,{abs:pl}=Math;function hl(t,n=!0){if(t.length<4)return[];const{coeffs:[e,r,o],errBound:[i,c,s]}=Uf(t);if(pl(e)<=i){const[[n,e],[r,o],[i,c],[s,u]]=t,f=fl(rl(s,n),el(3,rl(r,i))),l=ll(ol(i,n),-2*r),a=fl(rl(u,e),el(3,rl(o,c))),p=ll(ol(c,e),-2*o);if(0===jr(nl(l,a),nl(f,p)))return[]}const u=r*r,f=4*e*o,l=u-f,a=2*c*pl(r)+Le*u+(4*(i*pl(o)+pl(e)*s)+Le*pl(f))+Le*pl(l);if(l<-a)return[];if(l>a){const{est:t,err:u}=function(t,n){if(t-n<=0){const e=t>0?Math.sqrt(t):0;return{est:e,err:Math.max(Math.sqrt(t+n)-e,e)}}const e=Math.sqrt(t),r=Math.sqrt(t-n),o=Math.sqrt(t+n);return{est:e,err:Math.max(Math.abs(r-e),Math.abs(o-e))}}(l,a);let f;f=r>=0?-r-t:-r+t;const p=c+u+Le*pl(f),{est:h,err:d}=Wf(f,2*e,p,2*i),{est:g,err:v}=Wf(2*o,f,2*s,p);if(n){if(h+d<0||h-d>1||g+v<0||g-v>1)return[]}else if((h+d<0||h-d>1)&&(g+v<0||g-v>1))return[]}let[p,h,d]=Kf(t);const g=tl(nl(h,h),el(4,nl(p,d))),v=ct(g);if(v<0)return[];if(v>0){const t=Qf(Yr(g));let e;p=Yr(p),h=Yr(h),d=Yr(d),e=ct(h)>=0?il(cl(h,t)):cl(il(h),t);let r=rt(ul(e,sl(p))),o=rt(ul(sl(d),e));if(n){if(r<-al||r>1+al||o<-al||o>1+al)return[]}else if((r<-al||r>1+al)&&(o<-al||o>1+al))return[];return[r,o]=r<o?[r,o]:[o,r],r>=0-al&&r<=1+al?o>=0-al&&o<=1+al?[r,o]:[r]:o>=0-al&&o<=1+al?[o]:[]}const m=xr(p);if(ct(h)*ct(m)<0)return[];if(jr(Df(h),Df(m))>0)return[];const x=Yr(h),b=Yr(m),w=ul(x,b),_=w[1]+w[0];return[_,_]}const dl=Number.EPSILON;function gl(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[6*(s-n+3*(r-i)),6*(i+n-2*r)],[6*(u-e+3*(o-c)),6*(c+e-2*o)]]}if(3===t.length){const[[n,e],[r,o],[i,c]]=t;return[[2*(i-2*r+n)],[2*(c-2*o+e)]]}if(t.length<=2)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3.")}function vl(t){if(4===t.length)return 0===fu(t[0],t[1],t[2])&&0===fu(t[1],t[2],t[3])&&0===fu(t[0],t[2],t[3]);if(3===t.length)return 0===fu(t[0],t[1],t[2]);if(t.length<=2)return!0;throw new Error("The given bezier curve must be of order <= 3.")}function ml(t){if(vl(t))return{minima:[],maxima:[],inflections:[]};if(4===t.length&&Vu(t)&&(t=zc(t)),3===t.length){const n=function(t){const[[n,e],[r,o],[i,c]]=t,s=i-r,u=s-(r-n),f=c-o,l=f-(o-e);return[u*u+l*l,-(n*(u-r)-r*(s-r)+e*(l-o)-o*(f-o))]}(t);return{minima:[],maxima:Te(n,0,1)?.map(t=>t.t)||[],inflections:[]}}const n=function(t){const[[n,e,r],[o,i,c]]=G(t),[[s,u],[f,l]]=gl(t),[[a],[p]]=function(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[6*(s-n+3*(r-i))],[6*(u-e+3*(o-c))]]}if(t.length<=3)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3.")}(t),h=a*i,d=p*e,g=u*c,v=u*i,m=f*f,x=s*c,b=l*r,w=l*e,_=f*r,M=r*e,S=r*n,I=r*o,N=e*e,y=e*n,C=e*i,O=n*c,E=n*o,T=n*n,A=c*i,P=c*o,k=i*i,B=i*o,z=o*o,F=a*c-p*r,L=u*r+l*c,Y=g-b,H=r*r+c*c,X=C+O,$=P+k,V=S+N,D=e*o+n*i,q=T-z,j=y-B,W=M-A,Q=r*i+e*c,R=P+$,U=S+V,Z=I+X,J=C+X,K=U-R,tt=X+O,nt=I+C+O,et=2*w+_;return{inflectionPoly:[s*o-f*n,u*o+s*i-l*n-f*e,v+x-w-_,g-b],otherExtremaPoly:[T*(h-3*d)+z*(3*h-d)+2*(E*(a*e-p*i+3*(l*f-u*s))+3*s*f*j)+3*(D*(m-s*s)+q*(u*f+l*s)),a*(o*(U+3*$)+n*J)-p*(r*(3*T+z)+e*(3*y+2*B)+n*R)+3*(u*(l*q-u*E+2*(f*j-s*D))+s*(2*l*j+f*(2*(S-P)+(N-k))-s*nt)+l*(l*E+2*f*D)+m*Z),a*(2*r*D+e*tt+i*(4*P+R))-p*(2*r*(3*y+B)+e*(N+2*P)+i*tt)+3*(u*(2*(l*j-s*nt)+f*K-u*D)+s*(2*f*W-s*Q)+l*(l*D+2*f*Z+s*K)+m*Q),a*(r*(I+2*X)+c*(N+3*$))-p*(r*(3*V+R)+c*J)+3*(u*(l*K-u*Z+2*(f*W-s*Q))+s*(r*(et-s*c)-c*(2*l*i+f*c))+l*(l*X+r*(2*f*i+l*o))+f*c*et),H*(h-d)+2*(M+A)*F-3*(L*(v+x-w-_)+(u*e+s*r+l*i+f*c)*Y),F*H-3*L*Y]}}(t),e=n.inflectionPoly,r=n.otherExtremaPoly,o=Te(r,0,1)?.map(t=>t.t)||[],i=function(t){const n=t.length-1;if(n<=0)return[];const e=new Array(n);for(let r=0;r<n;r++)e[r]=(n-r)*t[r];return e}(r),c=[],s=[];for(let t=0;t<o.length;t++){const n=o[t],r=R(i,n);R(e,n)*r>=0?c.push(n):s.push(n)}return{minima:c,maxima:s,inflections:Te(e,0,1)?.map(t=>t.t)||[]}}const{sqrt:xl}=Math;function bl(t,n){const[e,r]=function(t,n){const[e,r]=G(t),[o,i]=gl(t),c=R(e,n),s=R(r,n),u=R(o,n);return[c*R(i,n)-s*u,xl((c*c+s*s)**3)]}(t,n);return e/r}const{abs:wl}=Math,_l=Y(function(t){const{curves:n}=t;let e=oo(n[0].ps).minY,r=n[0];for(let t=1;t<n.length;t++){const o=oo(n[t].ps).minY,i=o.box[0][1],c=e.box[0][1];(i<c||i===c&&o.ts[0]>e.ts[0])&&(e=o,r=n[t])}return{curve:r,y:e}});function Ml(t){const{curve:n,y:e}=_l(t),r=e.ts;return r[0]<=0?[$f(0,n,0),$f(1,n.prev,0)]:r[1]>=1?[$f(1,n,0),$f(0,n.next,0)]:[{x:{ri:{t:r[0],tS:r[0],tE:r[1],multiplicity:1},kind:0,box:e.box},curve:n},{x:{ri:{t:r[0],tS:r[0],tE:r[1],multiplicity:1},kind:0,box:e.box},curve:n}]}function Sl(t,n,e){const r=e-(n-Math.floor(Math.log2(Math.abs(t))))+1;return r<=0?0:e>=53?t:cf(t,r)}function Il(t,n,e){const r=function(t,n){const e=[];for(const n of t)for(const t of n.curves)e.push(t);const r=su(e,t=>co(t.ps)[0][0],t=>co(t.ps)[1][0],function(t){return(n,e)=>{const r=n.ps,o=e.ps;if(2===r.length&&2===o.length)return function(t,n,e){let r=t.ps,o=n.ps;const i=co(r),c=co(o);if(t.next!==n&&n.next!==t){if(No(!0,i,c)){const r=Hf(t,n,e,!1);return r.length?r:void 0}return}if(n.next===t&&([t,n]=[n,t],[r,o]=[o,r]),0!==fu(r[0],r[1],o[1]))return;if(!No(!1,i,c))return;let s;return s=lu(r[0],r[1])>lu(o[0],o[1])?[Fr(zr(r,o[1])[0].ri),1]:[0,Fr(zr(o,r[0])[0].ri)],[[$f(1,t,5),$f(0,n,5)],[$f(s[0],t,5),$f(s[1],n,5)]]}(n,e,t);if(n.next===e||e.next===n)return No(!1,co(r),co(o))&&Yu(pu(r,!1),pu(o,!1),!1)?e.next===n?Hf(e,n,t,!0):Hf(n,e,t,!0):Vf(n,e);let i=No(!0,co(r),co(o));return i?(i=Yu(pu(r,!1),pu(o,!1),!0),i?Hf(n,e,t,!1):void 0):void 0}}(n)),o=[];for(const t of r)for(const n of t.u)o.push(n);return o}(t,e),o=function(t){const n=[];for(const e of t)for(const t of e.curves){const e=t.ps,r=hl(e);if(0===r.length)continue;const o=r[0]===r[1]?3:2,i=r[0]-dl,c=r[0]+dl,s=r[1]-dl,u=r[1]+dl,f=qe(e,[i,c]),l=qe(e,[s,u]);n.push([{x:{ri:{t:i,tS:i,tE:c,multiplicity:1},box:f,kind:o},curve:t},{x:{ri:{t:s,tS:s,tE:u,multiplicity:1},box:l,kind:o},curve:t}])}return n}(t),i=function(t){const n=[];for(const e of t)for(const t of e.curves)n.push([$f(1,t,4),$f(0,t.next,4)]);return n}(t),{extremes:c,xs:s}=function(t){const n=new Map,e=[];for(const r of t){const t=Ml(r);e.push(t),n.set(r,t)}return{extremes:n,xs:e}}(t),u=function(t,n){const e=[];for(const r of n)for(const n of r.curves){const r=n.ps,o=ml(r),{minima:i,maxima:c}=o,s=[0,1,...i,...c];for(let o of s)wl(bl(r,o))>1e7*2**-t&&e.push([$f(o,n,7),$f(o,n,7)])}return e}(e,t);let f=[...r,...o,...i,...s,...u];if("undefined"!=typeof _debug_){const{intersection:t}=_debug_.elems;for(const n of[r,o,i,s,u])for(const e of n)t.push(...e)}let l=f.map(t=>({xs:t,box:[[t[0].x.box[0][0]-n,t[0].x.box[0][1]-n],[t[0].x.box[1][0]+n,t[0].x.box[1][1]+n]],inOuts:void 0}));for(;;){const t=su(l,Nl,yl,yo);if(!t.length)break;const n=new Map;Co(n,t);const e=To(n),r=Ao(l,e);l=[...Po(e),...r]}l=function(t){return t.filter(t=>{const n=t.xs;if(2===t.xs.length){const t=n[0];if(1===t.x.kind&&t.x.ri.multiplicity%2==0)return!1}for(const n of t.xs)if(4!==n.x.kind)return!0;return!1})}(l),l=function(t,n,e){const r=Math.log2(e)-3;return t.map(t=>{const e=t.box.map(t=>t.map(t=>Sl(t,n,n-r)));return{...t,box:e}})}(l,e,n),"undefined"!=typeof _debug_&&_debug_.elems.container.push(...l);let a=0;for(const t of l){for(const n of t.xs)n.container=t;let n;({inOuts:n,ioIdx:a}=cu(t,a)),t.inOuts=n}f=f.filter(t=>void 0!==t[0].container),function(t){const n=new Map;for(const e of t)for(const t of e){const e=t.curve.loop,r=n.get(e)||[];r.length||n.set(e,r),r.push(t)}for(const t of n){const n=t[1];if(!n||!n.length)continue;n.sort((t,n)=>{let e=t.curve.idx-n.curve.idx;return 0!==e?e:(e=t.x.ri.tS-n.x.ri.tS,0!==e?e:void 0!==t.in_?-1:1)});const e=n.length;for(let t=0;t<e;t++)n[t].next=n[(t+1)%e],n[t].prev=n[(t-1+e)%e]}}(f);for(const t of l)for(const n of t.inOuts){if(-1===n.dir)continue;const t=n;let e=t._x_;for(;e=e.next,void 0===e.in_;);t.nextOrPrev=e.in_,t.idx=t.nextOrPrev.idx}for(const t of l)for(const n of t.inOuts){if(1===n.dir)continue;const t=n;let e=t._x_;for(;e=e.prev,void 0===e.out;);t.nextOrPrev=e.out,t.idx=t.nextOrPrev.idx}return{extremes:c,containers:l}}function Nl(t){return t.box[0][0]}function yl(t){return t.box[1][0]}function Cl(t,n,e){Qr(t,1);const r=t.inOuts,o=r[0],i=r[r.length-1],c=1===o.dir?o:i,s=i.dir,u=0===n.idx?new Set:1===n.orientation?n.loopsIdxs:new Set;return o.orientation=s,o.parent=n,o.windingNum=n.windingNum+s,o.loopsIdxs=new Set(u),o.children=new Set,1===s&&o.loopsIdxs?.add(e.idx),i.orientation=s,i.parent=n,i.windingNum=n.windingNum+s,i.loopsIdxs=new Set(u),i.children=new Set,1===s&&i.loopsIdxs?.add(e.idx),c}function Ol(t){if(!vl(t))return!1;const n=t.map(t=>t[0]),e=t.map(t=>t[1]);return!(El(n)&&El(e))}function El(t){return function(t){for(let n=1;n<t.length;n++)if(t[n-1]>t[n])return!1;return!0}(t)||function(t){for(let n=1;n<t.length;n++)if(t[n-1]<t[n])return!1;return!0}(t)}function Tl(t,n){const e=n/Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[e*t[0],e*t[1]]}function Al(t){for(let n=0;n<t.length-1;n++)for(let e=n+1;e<t.length;e++)if(t[n][0]===t[e][0]&&t[n][1]===t[e][1])return!1;return!0}const{abs:Pl}=Math;function kl(t,n,e){if(void 0!==t&&!Wu(t)){if(2===t.length)return t;if(3===t.length){if(Al(t))return vl(t)?[t[0],t[2]]:t;if(zl(t[0],t[2]))return;return[t[0],t[2]]}if(Al(t)){const r=Bl(t);if(void 0===r)return;return function(t,n){if(t===n)return!0;if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(t[e][0]!==n[e][0]||t[e][1]!==n[e][1])return!1;return!0}(r,t)?t:kl(r,n,e)}if(zl(t[0],t[3])){if(vl(t))return;return t}if(vl(t))return[t[0],t[3]];if(zl(t[0],t[1])&&zl(t[1],t[2])||zl(t[1],t[2])&&zl(t[2],t[3])||zl(t[0],t[1])&&zl(t[2],t[3]))return kl([t[0],t[t.length-1]],n,e);if(zl(t[0],t[2])||zl(t[1],t[3])||zl(t[1],t[2]))return t;if(zl(t[0],t[1])){if(lu(t[1],t[2])<4*n)return[t[0],t[2],t[2],t[3]];{const r=Tl(X(t[1],t[2]),2*n),o=j(t[1],r);return Bl([t[0],e(o),t[2],t[3]])}}if(zl(t[2],t[3])){if(lu(t[2],t[1])<4*n)return[t[0],t[1],t[1],t[3]];{const r=Tl(X(t[2],t[1]),2*n),o=j(t[2],r);return Bl([t[0],t[1],e(o),t[3]])}}}}function Bl(t){return vl(t)?[t[0],t[3]]:Vu(t)?zc(t):t}function zl(t,n){return t[0]===n[0]&&t[1]===n[1]}function Fl(t){return t}function Ll(t,n,e,r=!1,o=!0){const i=function(t,n,e=!0){const r=2**t*2**-n,o=e?function(t,n){return e=>{const r=Sl(e[0],t,n),o=Sl(e[1],t,n);return r===e[0]&&o===e[1]?e:[r,o]}}(t,n):Fl;return t=>{const n=[];for(let e=0;e<t.length;e++){let i=t[e].slice();const c=n[n.length-1],s=c?c[c.length-1]:o(t[0][0]);i[0]=s,i=i.map(t=>o(t)),Ol(i)&&(i=[i[0],i[i.length-1]]),i=kl(i,r,o),void 0!==i&&n.push(i)}const e=n.length;if(!e)return[];const i=n[e-1];return i[i.length-1]=n[0][0],n}}(e,n,o);let c=t.slice();return c=r?function(t,n,e,r=.02){const o=[];for(const i of t){const t=[];for(const o of i){const i=o.map(t=>t.map(t=>{let o,i=0,c=0,s=0;for(;!(++c>10);){i=(t+Math.random())*(1+(Math.random()-.7)*r),i=Sl(i,e,n);const c=uf(i);c>s&&(s=c,o=i)}return o}));t.push(i)}o.push(t)}return o}(c,n,e,1):c,c=c.map(i),c=c.filter(t=>t.length>0),"undefined"!=typeof _debug_&&(_debug_.timing.normalize=performance.now()-_debug_.timing.timingStart),c}const Yl=Y(t=>{let n=0;for(const e of t)for(const t of e)for(const e of t)for(const t of e){const e=Math.abs(t);e>n&&(n=e)}return n});function Hl(t){let n=0;for(let e=0;e<=t.length-1&&0===t[e];e++)n++;return 0!==n&&(t=t.slice(n)),t}const{max:Xl}=Math;function $l(t,n){const e=t.length-1,r=n.length-1;if(e<0||r<0)return[];const o=e+r,i=new Array(o+1).fill(0);for(let c=0;c<e+1;c++)for(let s=0;s<r+1;s++)i[o-(c+s)]+=t[e-c]*n[r-s];return Hl(i)}function Vl(t,n){const e=t.length-1,r=new Array(e+2);for(let n=0;n<e+1;n++)r[n]=t[n]/(e+1-n);return r[e+1]=n,r}const{min:Dl,max:ql}=Math;function jl(t,n){const e=t.length-1,r=n.length-1,o=ql(e,r),i=new Array(o+1),c=Dl(e,r);for(let s=0;s<=c;s++)i[o-s]=t[e-s]+n[r-s];for(let n=c+1;n<=e;n++)i[o-n]=t[e-n];for(let t=c+1;t<=r;t++)i[o-t]=n[r-t];return Hl(i)}function Wl(t){let n=0;for(const e of t){const[t,r]=no(e),[o,i]=G(e);n+=R(Vl(jl($l(t,i),In($l(r,o))),0),1)}return n/2}function Ql(t){let n=0;for(let e=0;e<t.length-1;e++)n+=Ht(t[e],t[e+1]);return n}const{sqrt:Rl}=Math;function Gl(t){const[n,e]=t[0],[r,o]=t[t.length-1];let i,c;const s=Ql(t);if(256*lu(t[0],t[t.length-1])<s*s){const[r,o]=Ae(t,.5),s=Rl((r-n)*(r-n)+(o-e)*(o-e));i=(o-e)/s,c=(r-n)/s}else{const t=Rl((r-n)*(r-n)+(o-e)*(o-e));i=(o-e)/t,c=(r-n)/t}const u=function(t,n,e){const r=j(t[0].map(t=>-t));return io(t.map(t=>Q(-n,e,r(t))))}(t,i,c),[[f,l],[a,p]]=u,h=[u[0],[a,l],u[1],[f,p]],d=Q(i,c);return h.map(n=>j(t[0],d(n)))}function Ul(t){return{ps:t,ts:[0,1]}}const Zl=tt,Jl=it,Kl=lt,ta=ct,na=it,ea=et,ra=nt,oa=Re,ia=qf,ca=J,sa=at,{abs:ua}=Math,fa={order:0,realOrder:0,collinear:!0,nodeType:"n/a"},la={order:1,realOrder:1,collinear:!0,nodeType:"n/a"},aa={order:1,realOrder:0,collinear:!0,nodeType:"n/a"},pa={order:2,realOrder:2,collinear:!1,nodeType:"n/a"},ha={order:2,realOrder:2,collinear:!0,nodeType:"n/a"},da={order:2,realOrder:1,collinear:!0,nodeType:"n/a"},ga={order:2,realOrder:0,collinear:!0,nodeType:"n/a"},va={order:3,realOrder:3,collinear:!1,nodeType:"crunode"},ma={order:3,realOrder:3,collinear:!1,nodeType:"acnode"},xa={order:3,realOrder:3,collinear:!1,nodeType:"cusp"},ba={order:3,realOrder:3,collinear:!1,nodeType:"explicit"},wa={order:3,realOrder:3,collinear:!0,nodeType:"n/a"},_a={order:3,realOrder:2,collinear:!1,nodeType:"n/a"},Ma={order:3,realOrder:2,collinear:!0,nodeType:"n/a"},Sa={order:3,realOrder:1,collinear:!0,nodeType:"n/a"},Ia={order:3,realOrder:0,collinear:!0,nodeType:"n/a"};const{abs:Na,PI:ya}=Math;function Ca(t,n=[0,1]){if(t.length<=2)return 0;const[e,r]=n;if(e===r)return 0;if(3===t.length){const n=Qt(t,e,r).ps,[[o,i],[c,s],[u,f]]=n;return tn([c-o,s-i],[u-c,f-s])}if(4===t.length){const n=ln(t,e,r).ps,o=function(t){if(4===t.length)return Vu(t)?function(t){if(!vl(t))return!1;const[n,e,r,o]=t,[i,c]=n,[s,u]=e,[f,l]=r,[a,p]=o,h=Jl(Zl(Kl(s/4,f/4),3),Kl(i/4,a/4)),d=Jl(Zl(Kl(u/4,l/4),3),Kl(c/4,p/4));return 0===ta(Jl(Kl(i/2,a/2),h))&&0===ta(Jl(Kl(c/2,p/2),d))}(t)?Wu(t)?Ia:Sa:vl(t)?Ma:_a:vl(t)?wa:function(t){const{coeffs:[n,e,r],errBound:[o,i,c]}=Uf(t);if(ua(n)<=o){const[[n,e],[r,o],[i,c],[s,u]]=t,f=ca(oa(s,n),ra(3,oa(r,i))),l=sa(ia(i,n),-2*r),a=ca(oa(u,e),ra(3,oa(o,c))),p=sa(ia(c,e),-2*o);if(0===jr(ea(l,a),ea(f,p)))return ba}const s=e*e,u=4*n*r,f=s-u,l=2*i*ua(e)+Le*s+(4*(o*ua(r)+ua(n)*c)+Le*ua(u))+Le*ua(f);if(f<-l)return ma;if(f>l)return va;const[a,p,h]=Kf(t),d=ct(na(ea(p,p),ra(4,ea(a,h))));return d<0?ma:d>0?va:xa}(t);if(3===t.length)return vl(t)?ju(t)?Wu(t)?ga:da:ha:pa;if(2===t.length)return Wu(t)?aa:la;if(1===t.length)return fa;throw new Error("The given bezier curve must be of order <= 3")}(n),[[i,c],[s,u],[f,l],[a,p]]=n,h=[s-i,u-c],d=[f-s,l-u],g=[a-f,p-l];if(0===d[0]&&0===d[1]||o.realOrder<=2)return tn(h,g);const v=tn(h,d)+tn(d,g);return"acnode"===o.nodeType||"cusp"===o.nodeType?v<=-ya?v+2*ya:v>=+ya?v-2*ya:v:v}throw new Error("The given bezier curve must be of order <= 3.")}const{round:Oa,PI:Ea}=Math;const{abs:Ta,max:Aa,ceil:Pa,log2:ka}=Math;function Ba(n,e,r={}){"undefined"!=typeof _debug_&&(_debug_.timing.timingStart=performance.now()),e=e||Yl(n);const o=Pa(ka(e)),{inclMicroCorners:i=!0,minLoopArea:c=(2**o*2**-12)**2,forceOrientationNegative:s=!1,booleanOp:u="OR",containerSizeMultiplier:f=16}=r,l=2**o*2**-46*f;(function(t){if("undefined"!=typeof _debug_)for(const n of t){_debug_.elems.loopPre.push(...t),_debug_.elems.loopsPre.push(t);for(const t of n){const n=co(t),e=Gl(t),r=pu(t,!1);_debug_.elems.bezier_.push(t),_debug_.elems.looseBoundingBox_.push(n),_debug_.elems.tightBoundingBox_.push(e),_debug_.elems.boundingHull_.push(r)}}})(n=Ll(n,46,o,!1,!0)),n.sort(wo);const a=n.map((n,e)=>t(n,e)),{extremes:p,containers:h}=Il(a,l,o),d={dir:void 0,idx:0,parent:void 0,children:new Set,windingNum:0,p:void 0,_x_:void 0,container:void 0,loopsIdxs:new Set,orientation:-1},g=new Set,v=new Set;for(const t of a){if(g.has(t))continue;g.add(t);const n=bo(d,t),e=p.get(t)[0].container;if(0===e.inOuts.length)continue;const r=Cl(e,n,t),o=2===e.inOuts.length&&2===e.xs.length;if(o&&e.inOuts[0].nextOrPrev===e.inOuts[1])r.bezierPieces=t.beziers.map(Ul),r.parent.children=r.parent.children||new Set,r.parent.children.add(r);else if(to(r,g,v,!1),o&&void 0!==r.bezierPieces){const{bezierPieces:t}=r,n=t[t.length-1],e=t[0];if(n.ps===e.ps){const r={ps:n.ps,ts:[n.ts[0],e.ts[1]]};t.shift(),t.pop(),t.unshift(r)}}}const m=function(t){const n=[],e=[t];for(;e.length;){const t=e.pop();0===t.windingNum&&n.push(...t.children),e.push(...t.children),0===t.windingNum&&(t.children=new Set)}return n}(d),x=function(t){return n=>{const e="OR"===t||"XOR"===t?[n]:[];n.used="OR"===t||"XOR"===t;const r=Array.from(n.children);for(;r.length;){const n=r.pop();if("OR"===t&&0===n.windingNum&&e.push(n),"AND"===t){const t=Io(n);(0===n.windingNum&&t||Mo(n.windingNum)>=2&&!t)&&(e.push(n),n.used=!0)}if("XOR"===t){const t=Io(n);(0===n.windingNum&&t||Mo(n.windingNum)>=2&&t)&&(e.push(n),n.used=!0)}for(const t of n.children)r.push(t)}return e}}(u),b=m.map(x).filter(t=>0!==t.length).map(n=>{const e=n[0].orientation;return n.map((n,r)=>function(n,e,r,o){const i=n.bezierPieces?.map(Jr);if(void 0===i)return t([],r);const{orientation:c}=n,s=o?-1:e;return t((0===r?s:-s)*c>0?i:i.map(t=>t.toReversed()).toReversed(),r)}(n,e,r,s))}),w=[];for(let t=0;t<b.length;t++){const n=b[t].filter(t=>Ta(Wl(t.beziers))>c);n.length&&(n.sort((t,n)=>wo(t.beziers,n.beziers)),w.push(n))}"undefined"!=typeof _debug_&&(_debug_.timing.simplifyPaths=performance.now()-_debug_.timing.timingStart-_debug_.timing.normalize);const _=i?w:w.map(n=>n.map(n=>{const{beziers:e}=n,r=function(t,n){!function(t){Oa(function(t){const n=t.length;let e=0;for(let r=0;r<n;r++){const o=t[(r-1+n)%n],i=t[r];e+=Ca(i,[0,1])+tn(U(o,1),U(i,0))}return e}(t)/(2*Ea))}(t);const e=t.map(t=>t.map(t=>[t[0],t[1]])).filter(t=>Ql(t)>n),r=e.length;for(let t=0;t<r;t++){const n=e[t],o=e[(t+1)%r],i=n[n.length-1],c=o[0];c[0]===i[0]&&c[1]===i[1]||(i[0]=c[0],i[1]=c[1])}return e}(e,Aa(...h.map(t=>Ta(t.box[0][0]-t.box[1][0])),...h.map(t=>Ta(t.box[0][1]-t.box[1][1]))));return t(r,n.idx)}));return function(t){if("undefined"!=typeof _debug_)for(const n of t)_debug_.elems.loop.push(...n),_debug_.elems.loops.push(n)}(_),_}const{max:za,abs:Fa}=Math;function La(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],d=n[0],g=n[1],v=c-d,m=u-d,x=l-d,b=p-d,w=s-g,_=f-g,M=a-g,S=h-g,I=v*v,N=6*v*m,y=6*x*b,C=w*w,O=6*w*_,E=6*M*S,T=6*m*b+9*x*x,A=2*v*b+18*m*x,P=6*v*x+9*m*m,k=6*_*S+9*M*M,B=2*w*S+18*_*M,z=6*w*M+9*_*_;return[6*(b*b-y+(I-N)+T+(P-A)+(S*S-E+(C-O)+k+(z-B))),5*(y+5*N+3*A-2*(T+2*P+3*I)+(E+5*O+3*B-2*(k+2*z+3*C))),4*(T-3*(A-2*P)-5*(2*N-3*I)+(k-3*(B-2*z)-5*(2*O-3*C))),3*(A-2*(2*P-5*(N-2*I))+(B-2*(2*z-5*(O-2*C)))),2*(P-5*(N-3*I)+(z-5*(O-3*C))),N-6*I+(O-6*C)]}function Ya(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=o[0],l=o[1],a=n[0],p=n[1],h=i-a,d=s-a,g=f-a,v=c-p,m=u-p,x=l-p,b=h*h,w=h*d,_=d*g,M=v*v,S=v*m,I=m*x,N=v*x+m*m*2,y=h*g+d*d*2;return[x*x+M+2*N-4*(I+S)+(g*g+b+2*y-4*(_+w)),3*(I-N+(3*S-M)+(_-y+(3*w-b))),N-3*(2*S-M)+(y-3*(2*w-b)),S-M+(w-b)]}function Ha(t,n){const[[e,r],[o,i]]=t,[c,s]=n,u=e-c,f=o-c,l=r-s,a=i-s,p=u*f+l*a,h=l*l+u*u;return[f*f+a*a+(h-2*p),p-h]}const{sqrt:Xa}=Math;function $a(t,n,e=!0){let r;if(4===t.length)r=La(t,n);else if(3===t.length)r=Ya(t,n);else{if(2!==t.length){if(1===t.length)return{p:t[0],t:0,d:Ht(t[0],n)};throw new Error("The given bezier curve must be of order <= 3.")}r=Ha(t,n)}const o=Te(r,0,1)?.map(t=>t.t)||[];e&&(o.push(0),o.push(1));let i,c=Number.POSITIVE_INFINITY;for(const e of o){const r=Ae(t,e),o=lu(r,n);o<c&&(c=o,i={p:r,t:e,d:Xa(o)})}return i}const{sqrt:Va}=Math,{abs:Da}=Math;function qa(t){let n=Number.NEGATIVE_INFINITY;for(let e=0;e<t.length;e++){const r=t[e],o=Da(r[0]),i=Da(r[1]);o>n&&(n=o),i>n&&(n=i)}return n}const{max:ja}=Math;function Wa(t){return ja(t.hL+t.hEL,t.hR+t.hER)}function Qa(t,n){const e=Wa(t)-Wa(n);return 0!==e?e:t.tS-n.tS}class Ra{compare;heap=[];constructor(t){this.compare=t}insert(t){const n=this.heap;n.push(t);let e=n.length-1;for(;;){const r=(e-1-(e+1)%2)/2;if(-1===r)return;const o=n[r];if(this.compare(t,o)<0)break;n[r]=t,n[e]=o,e=r}}popMax(){const t=this.heap,n=t[0];return t[0]=t[t.length-1],t.length--,this.swimDown(),n}swimDown(){const t=this.heap,n=t.length;let e=0;for(;;){const r=2*e+1;if(r>=n)break;const o=2*e+2,i=o>=n||this.compare(t[r],t[o])>0?r:o,c=t[i],s=t[e];if(this.compare(s,c)>0)break;t[i]=s,t[e]=c,e=i}}swapMinOrMax(t){this.heap[0]=t,this.swimDown()}static getParentIdx(t){return(t-1-(t+1)%2)/2}static getLeftChild(t){return 2*t+1}static getRightChild(t){return 2*t+2}}const{max:Ga}=Math;function Ua(t,n,e,r=50){if(1===t.length)return $a(n,t[0]).d;if(1===n.length)return function(t,n){let e;if(4===t.length)e=La(t,n);else if(3===t.length)e=Ya(t,n);else{if(2!==t.length){if(1===t.length)return{p:t[0],t:0,d:Ht(t[0],n)};throw new Error("The given bezier curve must be of order <= 3.")}e=Ha(t,n)}const r=Te(e,0,1)?.map(t=>t.t)||[];r.push(0),r.push(1);let o,i=Number.NEGATIVE_INFINITY;for(const e of r){const r=Ae(t,e),c=lu(r,n);c>i&&(i=c,o={p:r,t:e,d:Va(c)})}return o}(t,n[0]).d;if(2===t.length&&2===n.length){const e=$a(n,t[0]).d,r=$a(n,t[t.length-1]).d;return e>r?e:r}const o=Ga(qa(t),qa(n));e=e||o/1e6;const[i,c]=Za(t,0,1),s={tS:0,tE:1,hL:$a(n,t[0]).d,hR:$a(n,t[t.length-1]).d,hEL:i,hER:c},u=new Ra(Qa);u.insert(s);let f=0,l=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(;;){const o=u.heap[0],{tS:i,tE:c,hL:s,hR:p}=o,h=(i+c)/2,[d,g]=Za(t,i,h),[v,m]=Za(t,h,c),x=Ae(t,h),b=Ht(x,$a(n,x).p),w=Ga(s,b,p);if(w>a&&(a=w),l=Wa(o),l-a<e)return a;if(f++>r)return a;const _={tS:i,tE:h,hL:s,hR:b,hEL:d,hER:g},M={tS:h,tE:c,hL:b,hR:p,hEL:v,hER:m};u.swapMinOrMax(_),u.insert(M)}}function Za(t,n,e){const r=(e+n)/2,o=A(t,n,r),i=A(t,r,e);return[Ql(o),Ql(i)]}function Ja(t,n=!1){const e=t;let r=e;const o=[];do{n&&r===e||x(r)||o.push(r),r=r.nextOnCircle}while(r!==e);return o}function Ka(t){const n=[],e=[t],r=new Set;for(;e.length>0;){const t=Lt(e.pop());if(0===t.length)continue;n.push(t);const o=t[0],i=t[t.length-1].next.prevOnCircle;r.add(o),r.add(i);const c=Ja(o,!0),s=Ja(i,!0),u=c.filter(t=>!r.has(t)),f=s.filter(t=>!r.has(t));for(const t of u)r.add(t);for(const t of f)r.add(t);e.push(...u,...f)}return n}class tp{datum;color=0;parent;left;right;constructor(t){this.datum=t}}class np{compare;root;constructor(t){this.compare=t,this.root=void 0}isEmpty(){return void 0===this.root}find(t){let n=this.root;for(;n;){const e=this.compare(t,n.datum);if(0===e)return n;n=e<0?n.left:n.right}}insert(t){if(void 0===this.root)return this.root=new tp(t),void(this.root.color=1);let n,e=this.root;for(;e;){n=e;const r=this.compare(t,e.datum);if(0===r)return void(e.datum=t);e=r<0?e.left:e.right}const r=new tp(t);r.parent=n,this.compare(t,n.datum)<0?n.left=r:n.right=r,this.fixInsert(r)}remove(t,n=!1,e){const r=this.find(t);if(void 0===r)return;const o=r.datum;return this.removeNode(r),o}findBounds(t){let n=this.root;const e=[void 0,void 0];for(;n;)this.compare(t,n.datum)>=0?(e[0]=n,n=n.right):(e[1]=n,n=n.left);return e}getMinNode(t){let n=void 0===t?this.root:t;for(;n&&n.left;)n=n.left;return n}getMaxNode(t){let n=void 0===t?this.root:t;for(;n&&n.right;)n=n.right;return n}removeNode(t){let n,e,r=t,o=r.color;void 0===t.left?(n=t.right,e=t.parent,this.transplant(t,t.right)):void 0===t.right?(n=t.left,e=t.parent,this.transplant(t,t.left)):(r=this.getMinNode(t.right),o=r.color,n=r.right,r.parent===t?(e=r,n&&(n.parent=r)):(e=r.parent,this.transplant(r,r.right),r.right=t.right,r.right.parent=r),this.transplant(t,r),r.left=t.left,r.left.parent=r,r.color=t.color),1===o&&this.fixDelete(n,e)}fixInsert(t){let n=t;for(;n.parent&&0===n.parent.color;){const t=n.parent,e=t.parent;if(t===e.left){const r=e.right;0===this.colorOf(r)?(t.color=1,r.color=1,e.color=0,n=e):(n===t.right&&(n=t,this.rotateLeft(n)),n.parent.color=1,e.color=0,this.rotateRight(e))}else{const r=e.left;0===this.colorOf(r)?(t.color=1,r.color=1,e.color=0,n=e):(n===t.left&&(n=t,this.rotateRight(n)),n.parent.color=1,e.color=0,this.rotateLeft(e))}}this.root.color=1}fixDelete(t,n){let e=t,r=n;for(;e!==this.root&&1===this.colorOf(e)&&void 0!==r;)if(e===r?.left){let t=r.right;0===this.colorOf(t)&&(t.color=1,r.color=0,this.rotateLeft(r),t=r.right),1===this.colorOf(t?.left)&&1===this.colorOf(t?.right)?(t&&(t.color=0),e=r,r=e?.parent):(1===this.colorOf(t?.right)&&(t?.left&&(t.left.color=1),t&&(t.color=0,this.rotateRight(t)),t=r.right),t&&(t.color=r.color),r.color=1,t?.right&&(t.right.color=1),this.rotateLeft(r),e=this.root,r=void 0)}else{let t=r?.left;0===this.colorOf(t)&&(t.color=1,r.color=0,this.rotateRight(r),t=r.left),1===this.colorOf(t?.left)&&1===this.colorOf(t?.right)?(t&&(t.color=0),e=r,r=r?.parent):(1===this.colorOf(t?.left)&&(t?.right&&(t.right.color=1),t&&(t.color=0,this.rotateLeft(t)),t=r?.left),t&&(t.color=r.color),r.color=1,t?.left&&(t.left.color=1),this.rotateRight(r),e=this.root,r=void 0)}e&&(e.color=1)}transplant(t,n){void 0===t.parent?this.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n&&(n.parent=t.parent)}rotateLeft(t){const n=t.right;t.right=n.left,n.left&&(n.left.parent=t),n.parent=t.parent,void 0===t.parent?this.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left=t,t.parent=n}rotateRight(t){const n=t.left;t.left=n.right,n.right&&(n.right.parent=t),n.parent=t.parent,void 0===t.parent?this.root=n:t===t.parent.right?t.parent.right=n:t.parent.left=n,n.right=t,t.parent=n}colorOf(t){return t?t.color:1}}function ep(t){const n=new Map;return h(t).forEach(function(t){const e=t.pointOnShape.curve.loop;let r=n.get(e);r||(r=new np(wn),n.set(e,r)),r.insert(t)}),n}const{max:rp}=Math;function op(t,n=.125,e=50){let r=O(t.cpNode);for(;!x(r);)r=r.next;const o=Ka(r),i=new Set;for(let t=0;t<o.length;t++){const r=o[t];let c=0;for(;c<r.length;){const t=c;for(;(c++,c!==r.length)&&!(ip(t,c,r,e)>n);)i.add(r[c])}}r=function(t,n){const e=n;do{if(t(n))return n;n=n.next}while(n!==e)}(x,r);for(const n of i)Mn(t=>2!==v(t)&&!t.isHoleClosing)(n)||B(n,t.meta);return{cpNode:r,meta:{...t.meta,cpTrees:ep(r)}}}function ip(t,n,e,r){const o=[],i=Tt(e[t],e[n].next);for(;t<n+1;t++)o.push(Ua(At(e[t]),i,r));return rp(...o)}function cp(t){const n=[],e=h(t);for(const t of e)w(t)&&!t.isHoleClosing&&n.push(t);return n}const sp=function(t,n,e){const r=t.get(n);return void 0!==r&&r.has(e)},up=function(t,n,e){let r=t.get(n);void 0===r&&(r=new Set,t.set(n,r)),r.add(e)};function fp(t){let n=t,e=t.prevOnCircle;for(;x(e);)e=e.prevOnCircle;const r=[];do{x(n)||r.push(n),n=n.nextOnCircle}while(n!==e);return r}function lp(t,n,e=.4,r=16){if(4===n.length)return an(t,n,e,r);if(3===n.length)return sn(t,n,e,r);if(2===n.length)return Xt(t,n);if(1===n.length)return 0;throw new Error("The given bezier curve must be of order <= 3.")}function ap(t,n){const e=new Map,r=new Map;return I(t,function(t){const o=r.get(t)||n*t.pointOnShape.circle.radius,i=t.next,c=lp([0,1],At(t)),s=i.pointOnShape.circle.radius;if(o-c>n*s)for(const t of m(i))if(r.set(t,o-c),!i.isHoleClosing){const{center:t}=i.pointOnShape.circle;up(e,t[0],t[1])}}),e}function pp(t,n){let e=0;"undefined"!=typeof _debug_&&(e=performance.now());const r=function(t){const n=h(t);return n.reduce(function(t,n){return t.pointOnShape.circle.radius>=n.pointOnShape.circle.radius?t:n},n[0])}(O(t.cpNode));!function(t,n){const e=cp(n);for(;e.length;){const r=e.pop(),{center:o}=r.pointOnShape.circle;if(!sp(t,o[0],o[1])||r.isIntersection)continue;let i=r.prevOnCircle,c=!1;for(;!c;){i=i.next;const{center:e}=i.pointOnShape.circle;if(sp(t,e[0],e[1]))if(kt(i,n))c=!0;else{if(1===fp(i).length)continue;c=!0}else{for(;x(i.prevOnCircle);)i=i.prevOnCircle;c=!0}}if(c){const t=i.prevOnCircle;t.next=i,i.prev=t,t.nextOnCircle=i,i.prevOnCircle=t}}}(ap(r,n),r);const o={cpNode:r,meta:{...t.meta,cpTrees:ep(r)}};return function(t){"undefined"!=typeof _debug_&&(_debug_.timing.sats=performance.now()-t)}(e),o}const hp={maxCurviness:.05,maxLength:40,applySat:!0,satScale:2,simplify:!0,simplifyTolerance:2**-4,minBezLength:2**-6,angleIncrement:15},dp={maxCurviness:{range:[.01,3],scaleByMaxCoordinate:!1},maxLength:{range:[1,1024],scaleByMaxCoordinate:!0},angleIncrement:{range:[.1,360],scaleByMaxCoordinate:!1},satScale:{range:[1,1/0],scaleByMaxCoordinate:!1},simplifyTolerance:{range:[2**-20,2**20],scaleByMaxCoordinate:!0},minBezLength:{range:[2**-20,2],scaleByMaxCoordinate:!0}};function gp(t){return[t[1],-t[0]]}function vp(t,n){if(!Nt(n))return 0;const e=It(n);return e.isDull?-$(gp(e.tangents[0]),W(X(n.p,t))):0}function mp(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function xp(t){return t[0]*t[0]+t[1]*t[1]}function bp(t,n,e){return t[0]*(n[1]*e[2]-n[2]*e[1])-t[1]*(n[0]*e[2]-n[2]*e[0])+t[2]*(n[0]*e[1]-n[1]*e[0])}const wp=function(t){const n=t[0],e=t[1],r=t[2],o=xp,i=.5*bp([o(n),n[1],1],[o(e),e[1],1],[o(r),r[1],1]),c=.5*bp([n[0],o(n),1],[e[0],o(e),1],[r[0],o(r),1]),s=bp([n[0],n[1],1],[e[0],e[1],1],[r[0],r[1],1]);return[i/s,c/s]},_p=Re,Mp=Wn,Sp=Ut,Ip=Number.EPSILON;function Np(t,n){const[e,r]=t,[o,i]=n,c=Re(e,o),s=Re(r,i);return Ut(Wn(c,c),Wn(s,s))[1]}const yp=Number.EPSILON;function Cp(t,n,e){const[r,o]=e,{ps:i}=t,c=[];if(r!==o){const{polyDd:e,polyE:s,getPolyExact:u}=kr(i,n),f=Te(e,r,o,s,u)||[];c.push(...f.map(e=>{const{tS:r,tE:o,t:c}=e,s=c<0?0:c>1?1:c,u=function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=n[0],f=n[1];let l=1/0,a=-1/0;for(const[t,n]of[[o,i],[o,s],[c,i],[c,s]]){const e=_p(t,u),r=_p(n,f),o=Sp(Mp(e,e),Mp(r,r))[1],i=o*(1-Ip),c=o*(1+Ip);i<=l&&(l=i),c>=a&&(a=c)}return[l,a]}(qe(i,[r,o]),n),f=0===s?1:s;return{curve:0===s?t.prev:t,t:f,dSquaredI:u}}))}const s=e.slice();return r===o&&s.push(r),c.push(...s.map(e=>{const r=Np($s(i,[0,e]).map(t=>t[0]+t[1]),n),o=[r*(1-yp),r*(1+yp)],c=0===e?1:e;return{curve:0===e?t.prev:t,t:c,dSquaredI:o}})),c}const{min:Op}=Math,Ep=1+2**-20;function Tp(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=n[0],f=n[1];return u<o?f<i?lu(t[0],n):f>s?lu([o,s],n):(o-u)**2:u>c?f<i?lu([c,i],n):f>s?lu(t[1],n):(u-c)**2:f<i?(i-f)**2:f>s?(f-s)**2:0}const Ap=Y(io);function Pp(t,n){const e=[0,1,2,3].map(e=>function(t,n){const e=lu,r=n[0],o=n[1],i=e(r,o);if(0==i)return e(t,r);let c=((t[0]-r[0])*(o[0]-r[0])+(t[1]-r[1])*(o[1]-r[1]))/i;return c=Math.max(0,Math.min(1,c)),e(t,[r[0]+c*(o[0]-r[0]),r[1]+c*(o[1]-r[1])])}(n,[t[e],t[(e+1)%4]])),r=lu(t[0],t[1]),o=lu(t[0],t[3]);return e[0]<=o&&e[2]<=o&&e[1]<=r&&e[3]<=r?0:Math.min(...e)}const kp=Y(Gl);function Bp(t,n){return $s(t,[0,n]).map(t=>t[0]+t[1])}function zp(t,n){t=function(t,n){const e=function(t,n){let e=1/0;for(let r=0;r<t.length;r++){const o=t[r],{curve:{ps:i},ts:c}=o,s=Ae(i,c[0]),u=Ae(i,c[1]);e=Op(e,lu(n,s),lu(n,u))}return Ep*e}(t,n);return t=function(t,n,e){const r=[];for(let o=0;o<t.length;o++){const i=t[o],{ps:c}=i.curve;Tp(Ap(c),n)<=e&&r.push(i)}return r}(t,n,e),t=function(t,n,e){const r=[];for(let o=0;o<t.length;o++){const i=t[o],c=i.curve.ps;Pp(kp(c),n)<=e&&r.push(i)}return r}(t,n,e),t}(t,n);const e=[];for(let r=0;r<t.length;r++){const o=t[r],i=Cp(o.curve,n,o.ts);e.push(...i)}let r=1/0;for(let t=0;t<e.length;t++){const n=e[t].dSquaredI[1];n<r&&(r=n)}const o=[];for(let t=0;t<e.length;t++){const n=e[t];n.dSquaredI[0]<=r&&o.push(n)}return o.map(t=>{const{curve:n,t:e}=t,{ps:r}=n;return{p:Bp(r,e),t:e,curve:n,isSource:!1}})}function Fp(t,n){return n.map(n=>zp(n,t)[0])}function Lp(t,n){return[n*t[0],n*t[1]]}function Yp(t,n,e){const r=mp(e);let o,i,c,s,u=1,f=0;do{i=j(Lp(e,u),n),c=t.map(t=>zp(t,n)[0]),s=mp(X(i,wp(c.map(t=>t.p)))),o=s<r,u/=2,f++}while(!o&&f<3);return{newX:i,newV:s,newPoss:c}}const{min:Hp,abs:Xp,asin:$p}=Math;function Vp(t,n,e,r,o){const i=2**(o-32),c=[t[0],t[n],t[t.length-1]],s=[r[0],r[n],r[t.length-1]],u=[[c[0],c[1],c[2]],[c[1],c[2],c[0]],[c[2],c[0],c[1]]][e],f=[[s[0],s[1],s[2]],[s[1],s[2],s[0]],[s[2],s[0],s[1]]][e];if(_(u[0][0]))return;let l,a=0,p=function(t,n){const e=t[0][0].pointOnShape.circle.center,r=zp(n[1],e)[0],o=[t[0][0].pointOnShape.p,r.p,t[2][1].pointOnShape.p];return wp(o)}(u,f),h=1/0;for(;h>i&&a<10;){if(a++,l=Fp(p,f),!Number.isFinite(p[0])||!Number.isFinite(p[1]))return;const t=wp(l.map(t=>t.p)),n=X(p,t);if(!Number.isFinite(n[0])||!Number.isFinite(n[1]))return;const e=Yp(f,p,n);p=e.newX,l=e.newPoss;const r=mp(n);h=Xp(r-e.newV)}const d=(Ht(p,l[0].p)+Ht(p,l[1].p)+Ht(p,l[2].p))/3,g={center:p,radius:d};let v=0;for(let t=0;t<3;t++){const n=l[t],e=W(X(n.p,p)),r=V(e);if(Nt(n)&&It(n).isDull){const t=St(n.curve.ps,n.curve.next.ps).tangents.map(V),r=$p(D(t[0],e)),o=$p(D(e,t[1]));let i=0;r>0&&(i+=r),o>0&&(i+=o),v+=i}else{const t=W(U(n.curve.ps,n.t));v+=Xp($p(D(r,t)))}}const m=[];for(let t=0;t<r.length;t++){const n=zp(r[t],p)[0];m.push(Ht(n.p,p))}const x=Hp(...m);return{threeProngInfo:{poss:l,circle:g,δ3s:u},error:1*Xp(d-x)+1*v}}function Dp(t){let n=t[0];const e=t[1],r=[];let o=!0;do{const t=n.pointOnShape,e=n.next.pointOnShape,i=t.curve,c=e.curve;if(o)if(o=!1,c===i&&bn(e,t)>0)r.push({curve:i,ts:[t.t,e.t]}),n=n.next;else{if(i.loop===c.loop){const n={curve:i,ts:[t.t,1]};r.push(n),qp(r,i,c,e.t)}n=n.next}else o=!0,n=n.prevOnCircle}while(n!==e);return r}function qp(t,n,e,r){let o=n;do{o=o.next;const n=o===e?r:1;t.push({curve:o,ts:[0,n]})}while(o!==e)}function jp(t,n,e,r){const o={...n,order:e,order2:r},i=t.findBounds({pointOnShape:o});if(void 0!==i[0]||void 0!==i[1])return void 0===i[0]||void 0===i[1]?t.getMaxNode()?.datum:i[0].datum}function Wp(t,n,e,r,o,i,c){if(void 0!==i&&!function(t,n,e){const r=bn(n,e.pointOnShape);if(r<0)return!0;if(0===r)return!1;const o=t.getMinNode();if(void 0===o)return!0;const i=o.datum;return bn(t.getMaxNode().datum.pointOnShape,n)<0&&i===e}(r,o,i.next)&&!t)return;const s={pointOnShape:o,isHoleClosing:n,isIntersection:e,id:c.id,next:void 0,prev:void 0,nextOnCircle:void 0,prevOnCircle:void 0};c.id++;const u=void 0===i?s:i,f=void 0===i?s:u.next;return f.prev=s,u.next=s,s.prev=u,s.next=f,r.insert(s),s}function Qp(t,n,e,r,o,i,c){const{cpTrees:s}=o;let u=!1;const f=i.map((i,f)=>{const l=r[f],a=s.get(i.curve.loop),p={...i,circle:e,order:l,order2:0},h=void 0===c?jp(a,i,l,0):c[f],d=Wp(t,n,!1,a,p,h,o.lastInsertId);return void 0===d&&(u=!0),d});return u||function(t,n){n=n.slice().sort(function(t){const n=t.center;return function(t,e){let r=t.pointOnShape.p,o=e.pointOnShape.p;r=[r[0]-n[0],r[1]-n[1]],o=[o[0]-n[0],o[1]-n[1]];const i=Math.atan2(r[1],r[0]);return Math.atan2(o[1],o[0])-i}}(t));const e=n.length;for(let t=0;t<e;t++){const r=n[t];r.nextOnCircle=n[(t+1)%e],r.prevOnCircle=n[(t-1+e)%e]}}(e,f),{anyFailed:u,cpNodes:f}}const Rp=Math.cos(Math.PI/180*1);function Gp(t,n,e,r,o,i){const{cpTrees:c,maxCoordPowerOf2:s}=t,u=2**(s-40),f=2**(s-46),l=jp(c.get(n.curve.loop),n,r,o);if(!l)return;const a=[l,l.next],{p,t:h}=n;for(const t of a){const n=t.pointOnShape.p,r=Ht(p,n);if(!(r>u)&&($(W(X(n,t.pointOnShape.circle.center)),W(X(p,e.center)))>Rp||r<f&&0!==h&&1!==h))return t}}function Up(t,n){const e=[];for(const t of n)e.push([t,t.next]);const r=function(t,n){const e=t.map(Dp);let r,o=1/0;for(let i=1;i<t.length-1;i++)for(let c=0;c<3;c++){const s=Vp(t,i,c,e,n);if(void 0===s)continue;const{error:u,threeProngInfo:f}=s;u<o&&(o=u,r=f)}return r}(e,t.maxCoordPowerOf2),{circle:o,poss:i,δ3s:c}=r,s=[];for(let t=0;t<3;t++)s.push(vp(o.center,i[t]));const u=[];for(let n=0;n<i.length;n++){const e=Gp(t,i[n],o,s[n],0);void 0!==e&&v(e)<=2&&!e.isHoleClosing&&u.push(e)}return{closeBysFor3Prong:u,cpNodes:0===u.length?Qp(!0,!1,o,s,t,i,c.map(t=>t[0])).cpNodes:[]}}let Zp,Jp=0;function Kp(t,n){if(yt(n.pointOnShape))return{closeBysFor3Prong:void 0,addedCpNodes:[]};const e=[];for(;;){if(void 0===n)continue;const r=S(n);if(r.length<=2)break;const{closeBysFor3Prong:o,cpNodes:i}=Up(t,r);if(e.push(i),o.length>0)return{closeBysFor3Prong:o,addedCpNodes:e};if("undefined"!=typeof _debug_&&++Jp===_debug_.directives.stopAfterThreeProngsNum)return}return{closeBysFor3Prong:void 0,addedCpNodes:e}}function th(t){for(const n of t)return n}function nh(t,n,e,r){const o=n[0];m(o).forEach(t=>{e.delete(t),r.delete(t)}),B(o,t)}function eh(t,n,e){const r=new Map;for(let o=0;o<n.length;o++){const i=new np(wn);r.set(t[o],i);const c=n[o];let s,u;for(const t of c){const n={center:t.p,radius:0},{curve:r}=t,o={...t,curve:r,t:1,circle:n,order:-1,order2:0},c={...t,curve:r.next,t:0,circle:n,order:1,order2:0};s=Wp(!0,!1,!1,i,o,u,e),u=Wp(!0,!1,!1,i,c,s,e),s.prevOnCircle=u,u.prevOnCircle=s,s.nextOnCircle=u,u.nextOnCircle=s}}return r}function rh(t){const n=[],e=[],r=[],o=[],i=[];for(const c of t)for(const t of c.curves){const c=t.ps,s=pu(c,!0);r.push(s);const u=Ap(c);n.push(u);const f=Gl(c);e.push(f);const l=St(t.ps,t.next.ps);l.isQuiteSharp?o.push(t):l.isQuiteDull&&i.push(t)}return{looseBoundingBoxes:n,tightBoundingBoxes:e,boundingHulls:r,sharpCorners:o,dullCorners:i}}function oh(t){return n=>{const e=[];for(let r=0;r<n.curves.length;r++){const o=n.curves[r];Ql(o.ps)<t||St(o.ps,o.next.ps).isQuiteSharp&&e.push({curve:o,t:1,isSource:!0,p:Bp(o.ps,1)})}return e}}function ih(t,n,e){const[r,o]=t,[i,c]=n,[s,u]=e,f=r-s,l=o-u;return{a0:2*(i*f+c*l),b0:f*f+l*l}}const ch=[,,function(t,n,e){const[r,o]=t,[i,c]=n,[[s,u],[f,l]]=e,a=f-s,p=l-u,h=r-s,d=o-u,g=i*a+c*p,v=-(a*a+p*p),m=a*h+p*d,x=2*(i*h+c*d),b=-v,w=h*h+d*d;return{A:[-2*g,x],B:[b,-2*m,w],C:[g],D:[v,m],H:[b*g,x*v,x*m-w*g]}},function(t,n,e){const[r,o]=t,[i,c]=n,[[s,u]]=e,[[f,l],[a,p]]=ro(e),h=r-s,d=o-u,g=2*(i*f+c*a),v=i*l+c*p,m=i*h+c*d,x=f*f+a*a,b=f*l+a*p,w=h*l+d*p,_=h*h+d*d,M=2*(h*f+d*a)-(l*l+p*p),S=-M;return{A:[-g,-2*v,2*m],B:[x,2*b,S,-2*w,_],C:[g,v],D:[-2*x,-3*b,M,w],H:[x*g,b*g+3*x*v,4*(b*v-m*x),g*w+v*S-6*m*b,-2*m*S-g*_,2*m*w-v*_]}},function(t,n,e){const[r,o]=t,[i,c]=n,[[s,u,f,l],[a,p,h,d]]=eo(e),g=r-l,v=o-d,m=i*s+c*a,x=i*u+c*p,b=i*f+c*h,w=i*g+c*v,_=s*s+a*a,M=s*u+a*p,S=s*f+a*h,I=u*u+p*p,N=u*f+p*h,y=f*f+h*h,C=s*g+a*v,O=u*g+p*v,E=f*g+h*v,T=g*g+v*v,A=2*S+I,P=2*N-2*C,k=y-2*O,B=-2*E;return{A:[-2*m,-2*x,-2*b,2*w],B:[_,2*M,A,P,k,B,T],C:[3*m,2*x,b],D:[-3*_,-5*M,-4*S-2*I,3*C-3*N,2*O-y,E],H:[3*m*_,4*(m*M+x*_),m*A+6*x*M+5*b*_,2*x*A+8*b*M-6*w*_,-m*k+x*P+3*b*A-10*w*M,-2*m*B+2*b*P-4*w*A,b*k-x*B-3*w*P-3*m*T,-2*w*k-2*x*T,-w*B-b*T]}}],{sqrt:sh,abs:uh,max:fh}=Math;function lh(t,n,e,r,o,i){const{curve:c,ts:[s,u]}=i,{ps:f}=c,{curve:l,t:a,p}=e,h=c===l,d=0===o&&h,g=[];let v,m=!1,x=!1;if(!(s===u||d&&2===f.length||h&&3===f.length&&r)){const{A:e,B:r,H:o}=d?3===f.length?function(t,n,e){const[[r,o],[i,c]]=ro(e),[s,u]=n,f=r*t+o,l=i*t+c,a=r*r+i*i,p=2*(s*r+u*i);return{A:[-p],B:[a,2*(r*f+i*l),f*f+l*l],H:[a*p,p*(a*t+(r*o+i*c))]}}(a,n,f):function(t,n,e){const[r,o]=n,[[i,c,s],[u,f,l]]=eo(e),a=r*i+o*u,p=r*c+o*f,h=r*s+o*l,d=i*i+u*u,g=i*c+u*f,v=i*s+u*l,m=c*c+f*f,x=c*s+f*l,b=s*s+l*l,w=t*(t*(t*a+p)+h),_=t*(t*(t*d+g)+v),M=t*(t*(t*g+m)+x),S=3*a,I=-3*d,N=-5*g+t*I,y=-4*v-2*m+t*N,C=-3*x+3*_+t*y,O=-2*a,E=2*v+m,T=2*x-2*_,A=b-2*M,P=2*g+2*t*d,k=E+t*(2*P-t*d),B=T+t*(2*k-t*P),z=3*a*d,F=4*(a*g+p*d)+4*t*z,L=a*E+6*p*g+5*h*d+t*(4*F-6*t*z),Y=2*p*E+8*h*g-6*w*d+t*(4*L+t*(-6*F+4*t*z));return{A:[O,-2*p+2*t*O],B:[d,P,k,B,A+t*(2*B-t*k)],C:[S,2*p+t*S],D:[I,N,y,C,2*M-b+t*C],H:[z,F,L,Y,-a*A+p*T+3*h*E-10*w*g+t*(4*Y+t*(-6*L+t*(4*F-t*z)))]}}(a,n,f):function(t,n,e){if(1===e.length){const{a0:r,b0:o}=ih(t,n,e[0]);return{A:[r],B:[o],C:[],D:[],H:[]}}return ch[e.length](t,n,e)}(p,n,f);v=Te(o,s,u)||[];for(let o=0;o<v.length;o++){const i=v[o],{tS:f,tE:l,t:a}=i;if(i.multiplicity>1)continue;if(l<s||f>u)continue;if(f<0)continue;const h=l>1?1:a,d=R(e,h),b=R(r,h),w=uh(d);if(fh(w)<2**-40)continue;const _=-b/d;if(_<=0)continue;const M=[_*n[0],_*n[1]],S=sh(xp(M));if(S<=2**(t-40))continue;const I=[p[0]+M[0],p[1]+M[1]];i.tS<=s&&i.tE>=s&&(m=!0),i.tS<=u&&i.tE>=u&&(x=!0);const N=0===h?1:h,y={curve:0===h?c.prev:c,s:N,d:S,x:I};g.push(y)}}const b=f[f.length-1];let w=0===a&&c===l.prev||1===a&&c===l;const _=[];if(0===s);else if(1===s)w||m||_.push({P:b,t:1});else if(!m){const t=Ae(f,s);_.push({P:t,t:s})}if(s!==u)if(0===u);else if(1===u)w||x||(_.push({P:b,t:1}),w=!0);else if(!x){const t=Ae(f,u);_.push({P:t,t:u})}for(let t=0;t<_.length;t++){const{P:e,t:r}=_[t],{a0:o,b0:i}=ih(p,n,e);if(uh(o)<=2**-40||uh(i)<=2**-40)continue;const s=-i/o;if(s<2**-40)continue;const u=[s*n[0],s*n[1]],f=sh(xp(u)),l=[p[0]+u[0],p[1]+u[1]],a=0===r?1:r,h={curve:0===r?c.prev:c,s:a,d:f,x:l};g.push(h)}return g}const{abs:ah}=Math,ph=1+2**-20,hh=1+2**-20,dh=Y(Gl),gh=Gt,vh=Ut,mh=Zt,xh=function(t,n){const e=n[0],r=n[1],o=r*t,i=$n*r,c=i-(i-r),s=r-c,u=$n*t,f=u-(u-t),l=t-f,a=e*t,p=o+a,h=a-(p-o)+(s*l-(o-c*f-s*f-c*l)),d=p+h;return[h-(d-p),d]},{acos:bh}=Math;function wh(t,n){let e=[0,0];for(let r=0;r<t.length;r++)e=Ut(t[r],Vn(n,e));return e}const _h=qf,Mh=Re,Sh=Vn,Ih=Ut,Nh=Bo;function yh(t){if(4===t.length)return function(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[Sh(3,Ih(Mh(s,n),Sh(3,Mh(r,i)))),Sh(6,Nh(_h(i,n),-2*r)),Sh(3,Mh(r,n))],[Sh(3,Ih(Mh(u,e),Sh(3,Mh(o,c)))),Sh(6,Nh(_h(c,e),-2*o)),Sh(3,Mh(o,e))]]}(t);if(3===t.length)return function(t){const[[n,e],[r,o],[i,c]]=t;return[[Nh(_h(2*i,2*n),-4*r),Mh(2*r,2*n)],[Nh(_h(2*c,2*e),-4*o),Mh(2*o,2*e)]]}(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t;return[[Mh(r,n)],[Mh(o,e)]]}(t);if(1===t.length)return[[[0,0]],[[0,0]]];throw new Error("The given bezier curve must be of order <= 3.")}const Ch=Re,Oh=Ut,Eh=Vn,Th=Bo;function Ah(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[Eh(6,Oh(Ch(s,n),Eh(3,Ch(r,i)))),Eh(6,Th(Ch(i,2*r),n))],[Eh(6,Oh(Ch(u,e),Eh(3,Ch(o,c)))),Eh(6,Th(Ch(c,2*o),e))]]}if(3===t.length){const[[n,e],[r,o],[i,c]]=t;return[[Th(Ch(2*i,4*r),2*n)],[Th(Ch(2*c,4*o),2*e)]]}if(t.length<=2)return[[[0,0]],[[0,0]]];throw new Error("The given bezier curve must be of order <= 3.")}const Ph=Wn,kh=Ut,Bh=Zt;const{sqrt:zh}=Math;function Fh(t,n,e){const{curve:r,p:o,t:i}=n,{ps:c}=r,s=1/t,u=function(t,n){const[e,r]=function(t,n){const[e,r]=yh(t),[o,i]=Ah(t),c=wh(e,n),s=wh(r,n),u=wh(o,n),f=wh(i,n),l=Bh(Ph(c,f),Ph(s,u)),a=kh(Ph(c,c),Ph(s,s));return[l,Qf(Ph(a,Ph(a,a)))]}(t,n);return Ts(e,r)}(c,i),f=-(u[0]+u[1]),l=f<s?s:f,[a,p]=e,h=zh(a*a+p*p)*l;return[[o[0]+a/h,o[1]+p/h],1/l]}const{sqrt:Lh}=Math,{sin:Yh,cos:Hh,max:Xh,sqrt:$h}=Math;function Vh(t){const{loops:n,maxCoordPowerOf2:e,squaredDiagonalLength:r}=t,o=(2**(e-21))**2,i=2**(e-46),c=$h(r),s=2**(e-32);return function(r,u,f,l){const{curve:{loop:a,ps:p},t:h,p:d}=l,g=function(t,n){const[e,r]=yh(t),o=wh(r,n);return[[-o[0],-o[1]],wh(e,n)]}(p,h),v=[-g[0][1],-g[1][1]],m=r?[0,-c]:0!==f?Q(Yh(f),Hh(f))(v):v;let[x,b]=function(t,n,e,r,o){let i,c;const{p:s}=r;if(n)return[[s[0],s[1]-e],e];if(0===t)return Fh(e,r,o);const{p:u}=r,[f,l]=o,a=e/Lh(f*f+l*l),p=[f*a,l*a];return i=[u[0]+p[0],u[1]+p[1]],c=e,[i,c]}(f,r,c,l,m);const w=function(t,n,e,r,o,i,c){const{cpTrees:s}=o;if(n)return r.filter(t=>t!==e).flatMap(t=>t.curves.map(t=>({curve:t,ts:[0,1]})));const u=Nt(i)&&It(i).isDull?1===i.t&&0===t?-1:0===i.t?1:vp(c,i):0,f=jp(s.get(e),i,u,0);return f&&f!==f.next.next?Dp([f,f]):e.curves.map(t=>({curve:t,ts:[0,1]}))}(f,r,a,n,t,l,x),_=function(t,n,e,r){let o=1/0,i=[e[0]+r[0],e[1]+r[1]];for(let t=0;t<n.length;t++){const c=n[t],{ps:s}=c.curve,u=s[0],f=s[s.length-1];for(const t of[u,f]){if(lu(i,t)>o)continue;const{a0:n,b0:c}=ih(e,r,t);if(ah(n)<=2**-40||ah(c)<=2**-40)continue;const s=-c/n;if(s<2**-40)continue;const u=[s*r[0],s*r[1]],f=xp(u);f<o&&(o=f,i=[e[0]+u[0],e[1]+u[1]])}}return ph*o}(0,w,d,m),M=$h(_),S=$h(m[0]**2+m[1]**2);x=[d[0]+m[0]/S*M,d[1]+m[1]/S*M],function(t,n,e){if(t.length<=2)return t;let r=0;for(let o=0;o<t.length;o++){const i=t[o],{ps:c}=i.curve;Tp(Ap(c),n)<=hh*e&&Pp(dh(c),n)<=hh*e&&(t[r]=i,r++)}t.length=r}(w,x,_);const I=function(t,n,e,r,o,i){const c=[];for(let s=0;s<i.length;s++){const u=lh(t,n,e,r,o,i[s]);c.push(...u)}let s=1/0;for(let t=0;t<c.length;t++){const n=c[t].d*(1+2**-46);n<s&&(s=n)}const u=[];for(let t=0;t<c.length;t++){const n=c[t];n.d*(1-2**-46)<=s&&u.push(n)}return u}(e,m,l,u,f,w);if(1!==I.length){if(0===I.length)return;if(!function(t){const{curve:n,s:e}=t[0];for(let r=1;r<t.length;r++){const{curve:o,s:i}=t[r];if(n!==o||e!==i)return!1}return!0}(I))return}const{x:N,d:y,curve:C,s:O}=I[0];if(u&&b<(1-s)*y)return void function(t,n,e,r){if(Nt(r)&&It(r).isDull)return;const o={radius:n,center:e};Gp(t,r,o,vp(o.center,r),0)||Qp(!1,!1,o,[-.5,.5],t,[r,r])}(t,b,x,l);const E={curve:C,t:O,isSource:!1,p:Bp(C.ps,O)},T={center:N,radius:y},A=Np(l.p,E.p),P=Np(N,E.p);if(!r){if(0===A)return;if(A<=Xh(function(t,n,e){if(n+e>=t)return 1/0;const r=Re(t,n),o=xh(n,r),i=t-n,c=n*i,s=(c-n*e-e*e/2)/(c+i*e),u=Ts(mh(mh(o,gh(n,e)),gh(e,e/2)),vh(o,xh(e,r)))[1];return bh(s),n*bh(u)}(b,$h(P),4*i),o))return}return{circle:T,z:E}}}function Dh(t,n,e,r,o){e=0===e.t?{...e,curve:e.curve.prev,t:1}:e;const i=vp(n.center,e),c=vp(n.center,r),s={...r,circle:n,order:c,order2:0},u={...e,circle:n,order:i,order2:0};if(Gp(t,e,n,i,0))return;if(Gp(t,r,n,c,0))return;const{anyFailed:f,cpNodes:l}=Qp(o,o,n,[i,c],t,[u,s]);if(!f)return o&&function(t,n){const{cpTrees:e}=t,[r,o]=n,i=o.pointOnShape,c=Wp(!0,!0,!1,e.get(i.curve.loop),{...i,order2:1},o,t.lastInsertId);c.holeCloserTwin=o,o.holeCloserTwin=c;const s=r.pointOnShape,u=Wp(!0,!0,!1,e.get(s.curve.loop),{...r.pointOnShape,order2:-1},r.prev,t.lastInsertId);u.holeCloserTwin=r,r.holeCloserTwin=u,u.prevOnCircle=c,u.nextOnCircle=c,c.prevOnCircle=u,c.nextOnCircle=u,o.next=r,r.prev=o,u.next=c,c.prev=u}(t,l),l[0];l.forEach(n=>{void 0!==n&&k(n,t)})}const{PI:qh,atan2:jh}=Math;function Wh(t,n,e,r){let o;const i=Vh(t),c=n*qh/180;for(let n=0;n<e.length;n++){const s=e[n],u=Qh(c,s);for(const e of u){const c=i(!1,r,e,s);if(c){const{circle:n,z:e}=c,r=Dh(t,n,s,e,!1);o=o||r}if("undefined"!=typeof _debug_&&n+1===_debug_.directives.stopAfterTwoProngsNum)return}}return o}function Qh(t,n){const e=[0];if(1===n.t){const{curve:r}=n,o=St(r.ps,r.next.ps);if(o.isQuiteDull){const n=gp(o.tangents[0]),r=gp(o.tangents[1]),i=(jh(n[1],n[0])+2*qh)%(2*qh),c=((jh(r[1],r[0])+2*qh)%(2*qh)-i+2*qh)%(2*qh);let s=t;for(;s<=c-t/2;)e.push(s),s+=t}}return e}function Rh(t,n,e,r){let o;for(let i=0;i<e.length;i++){const c=Wh(t,n,e[i],r);o=void 0===o?c:o}return o}function Gh(t,n=.4,e=10,r=2**-16){const o=[0],i=[1];for(;;){const c=o[o.length-1],s=i[i.length-1],u=A(t,c,s),f=Ql(u),l=en(u);if(f<=e&&l<=n||s-c<=r){if(o.push(i.pop()),1===s)return o;continue}const a=(c+s)/2;i.push(a)}}function Uh(t){if(t.length<4)return[];const[[n,e],[r,o],[i,c],[s,u]]=t,f=r-n,l=o-e,a=i-r-f,p=c-o-l,h=s-i-f-2*a,d=u-c-l-2*p,g=a*d-p*h,v=f*d-l*h,m=f*p-l*a;return Te([g,v,m],0,1)?.map(t=>t.t)||[]}function Zh(t,n,e){return function(r){const o=[],i=r.curves;for(let r=0;r<i.length;r++){const c=i[r],s=c.ps;if(Ql(s)<t)continue;let u=Gh(s,n,e);u=2===u.length?[.5]:u,u.push(...Uh(s)),u=u.filter(t=>0!==t&&1!==t);const f=u.map(t=>({curve:c,t,isSource:!0,p:Bp(c.ps,t)}));o.push(...f)}return o}}const Jh=Re,Kh=Ut,td=Vn,nd=Ge,ed=Ue,rd=Vn,od=Wn,id=Ut,cd=Zt;const sd=Re,ud=Vn,fd=Wn,ld=Ut,ad=Zt;function pd(t){if(vl(t))return{minima:[],maxima:[],inflections:[]};if(4===t.length&&Vu(t)&&(t=zc(t)),3===t.length){const n=function(t){const[[n,e],[r,o],[i,c]]=t,s=sd(r,n),u=sd(i,r),f=ad(u,s),l=sd(o,e),a=sd(c,o),p=ad(a,l),h=ld(ad(ud(n,ad(f,[0,r])),ud(r,ad(u,[0,r]))),ad(ud(e,ad(p,[0,o])),ud(o,ad(a,[0,o]))));return[ld(fd(f,f),fd(p,p)),Jo(h)]}(t);return{minima:[],maxima:Te(n,0,1)?.map(t=>t.t)||[],inflections:[]}}const n=function(t){const[[n,e,r],[o,i,c]]=yh(t),[[s,u],[f,l]]=Ah(t),[[a],[p]]=function(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[td(6,Kh(Jh(s,n),td(3,Jh(r,i))))],[td(6,Kh(Jh(u,e),td(3,Jh(o,c))))]]}if(t.length<=3)return[[[0,0]],[[0,0]]];throw new Error("The given bezier curve must be of order <= 3.")}(t),h=od(a,i),d=od(p,e),g=od(u,c),v=od(u,i),m=od(f,f),x=od(s,c),b=od(l,r),w=od(l,e),_=od(f,r),M=od(r,e),S=od(r,n),I=od(r,o),N=od(e,e),y=od(e,n),C=od(e,i),O=od(n,c),E=od(n,o),T=od(n,n),A=od(c,i),P=od(c,o),k=od(i,i),B=od(i,o),z=od(o,o),F=cd(od(a,c),od(p,r)),L=cd(h,d),Y=id(od(u,r),od(l,c)),H=id(id(od(u,e),od(s,r)),id(od(l,i),od(f,c))),X=cd(g,b),$=cd(id(v,x),id(w,_)),V=id(od(r,r),od(c,c)),D=id(M,A),q=id(C,O),j=id(P,k),W=id(S,N),Q=id(od(e,o),od(n,i)),R=cd(T,z),G=cd(y,B),U=id(I,C),Z=cd(M,A),J=id(od(r,i),od(e,c)),K=id(P,j),tt=id(S,W),nt=id(I,q),et=id(C,q),rt=cd(tt,K),ot=id(q,O),it=id(U,O),ct=id(Ge(w),_),st=od(T,cd(h,rd(3,d))),ut=od(z,cd(rd(3,h),d)),ft=Ge(id(od(E,id(cd(od(a,e),od(p,i)),rd(3,cd(od(l,f),od(u,s))))),rd(3,od(od(s,f),G)))),lt=rd(3,id(od(Q,cd(m,od(s,s))),od(R,id(od(u,f),od(l,s))))),at=id(id(st,ut),id(ft,lt)),pt=od(a,id(od(o,id(tt,rd(3,j))),od(n,et))),ht=od(p,id(id(od(r,id(rd(3,T),z)),od(e,id(rd(3,y),nd(B)))),od(n,K))),dt=rd(3,id(id(od(u,id(cd(od(l,R),od(u,E)),nd(cd(od(f,G),od(s,Q))))),od(s,cd(id(nd(od(l,G)),od(f,id(nd(cd(S,P)),cd(N,k)))),od(s,it)))),id(od(l,id(od(l,E),nd(od(f,Q)))),od(m,nt)))),gt=id(cd(pt,ht),dt),vt=od(a,id(id(nd(od(r,Q)),od(e,ot)),od(i,id(ed(P),K)))),mt=od(p,id(id(nd(od(r,id(rd(3,y),B))),od(e,id(N,nd(P)))),od(i,ot))),xt=rd(3,id(id(od(u,cd(id(nd(cd(od(l,G),od(s,it))),od(f,rt)),od(u,Q))),od(s,cd(nd(od(f,Z)),od(s,J)))),id(od(l,id(id(od(l,Q),nd(od(f,nt))),od(s,rt))),od(m,J)))),bt=id(cd(vt,mt),xt),wt=od(a,id(od(r,id(I,nd(q))),od(c,id(N,rd(3,j))))),_t=od(p,id(od(r,id(rd(3,W),K)),od(c,et))),Mt=rd(3,id(id(od(u,id(cd(od(l,rt),od(u,nt)),nd(cd(od(f,Z),od(s,J))))),od(s,cd(od(r,cd(ct,od(s,c))),od(c,id(nd(od(l,i)),od(f,c)))))),id(od(l,id(od(l,q),od(r,id(nd(od(f,i)),od(l,o))))),od(f,od(c,ct))))),St=id(cd(wt,_t),Mt),It=cd(id(od(V,L),nd(od(D,F))),rd(3,id(od(Y,$),od(H,X)))),Nt=cd(od(F,V),rd(3,od(Y,X)));return{inflectionPoly:[cd(od(s,o),od(f,n)),cd(id(od(u,o),od(s,i)),id(od(l,n),od(f,e))),cd(id(v,x),id(w,_)),cd(g,b)],otherExtremaPoly:[at,gt,bt,St,It,Nt]}}(t),e=n.inflectionPoly,r=n.otherExtremaPoly,o=Te(r,0,1)?.map(t=>t.t)||[],i=function(t){const n=t.length-1;if(n<=0)return[];const e=new Array(n);for(let r=0;r<n;r++)e[r]=Vn(n-r,t[r]);return e}(r),c=[],s=[];for(let t=0;t<o.length;t++){const n=o[t],r=se(i,n);ct(et(se(e,n),r))>=0?c.push(n):s.push(n)}return{minima:c,maxima:s,inflections:Te(e,0,1)?.map(t=>t.t)||[]}}function hd(t){return{curve:t.curve,t:t.t,isSource:!0,p:Bp(t.curve.ps,t.t)}}function dd(t,n,e,r,o){(o&&(r>t.val||r===t.val&&e>t.t)||!o&&(r<t.val||r===t.val&&e>t.t))&&(t.curve=n,t.t=e,t.val=r)}const gd=Y(function(t){const n=[{curve:void 0,t:void 0,val:1/0},{curve:void 0,t:void 0,val:1/0}],e=[{curve:void 0,t:void 0,val:-1/0},{curve:void 0,t:void 0,val:-1/0}];return t.curves.forEach(function(t){const r=so(t.ps);for(let o=0;o<2;o++)dd(n[o],t,r.ts[0][o],r.box[0][o],!1),dd(e[o],t,r.ts[1][o],r.box[1][o],!0)}),{minX:hd(n[0]),minY:hd(n[1]),maxX:hd(e[0]),maxY:hd(e[1])}});function vd(t){return gd(t).minY}function md(t){const{loops:n}=t,e=n.map(vd);let r;const o=Vh(t);for(let n=1;n<e.length;n++){const i=e[n],c=o(!0,!1,0,i);if(!c)throw new Error("Unable to find hole-closing 2-prong");const{circle:s,z:u}=c,f=Dh(t,s,i,u,!0);r=void 0===r?f:r}return r}const xd=Y(function(t){let n,e,r,o,i=1/0,c=-1/0,s=1/0,u=-1/0;for(const f of t){const t=gd(f);t.minX.p[0]<i&&(n=t.minX,i=t.minX.p[0]),t.maxX.p[0]>c&&(e=t.maxX,c=t.maxX.p[0]),t.minY.p[1]<s&&(r=t.minY,s=t.minY.p[1]),t.maxY.p[1]>u&&(o=t.maxY,u=t.maxY.p[1])}return{minX:n,minY:r,maxX:e,maxY:o}});function bd(t,n,e){const{minBezLength:r,maxCurviness:o,maxLength:i,angleIncrement:c}=e,s=oh(r),u=function(t){return n=>{const e=[];for(let r=0;r<n.curves.length;r++){const o=n.curves[r];if(Ql(o.ps)<t)continue;const{next:i,ps:c}=o;if(St(c,i.ps).isQuiteDull){const t=c[c.length-1];e.push({curve:o,t:1,isSource:!0,p:t}),e.push({curve:i,t:0,isSource:!0,p:t})}}return e}}(r),f=Zh(r,o,i),l=function(t){return function(n){const e=[];for(let r=0;r<n.curves.length;r++){const o=n.curves[r];Ql(o.ps)<t||e.push(...pd(o.ps).maxima.map(t=>({curve:o,t,isSource:!0,p:Bp(o.ps,t)})))}return e}}(r),a=xd(t),p=(a.maxX.p[0]-a.minX.p[0])**2+(a.maxY.p[1]-a.minY.p[1])**2,d=t.map(s),g={id:0},v={maxCoordPowerOf2:n,squaredDiagonalLength:p,loops:t,cpTrees:eh(t,d,g),lastInsertId:g,...rh(t)};let m;if(m=md(v),"undefined"!=typeof _debug_&&_debug_.directives.stopAfterHoleClosers)return{cpNode:m,meta:v};if(function(){if("undefined"==typeof _debug_)return;const t=performance.now();_debug_.timing.holeClosers+=t-Zp,Zp=t}(),m=Rh(v,c,t.map(u),!1)||m,m=Rh(v,c,t.map(l),!0)||m,m=Rh(v,c,t.map(f),!1)||m,function(){if("undefined"==typeof _debug_)return;const t=performance.now();_debug_.timing.oneAnd2Prongs+=t-Zp,Zp=t}(),"undefined"!=typeof _debug_&&_debug_.directives.stopAfterTwoProngs)return{cpNode:m,meta:v};if(m=function(t,n){if(void 0===n)return;const e=new Set;let r=!0;for(;r;){r=!1;const o=new Set(h(n));for(const n of o){const{closeBysFor3Prong:i,addedCpNodes:c}=Kp(t,n);c.length>0&&(r=!0),void 0===i?e.add(n):(r=!0,nh(t,i,o,e)),c.forEach(t=>t.forEach(t=>e.add(t)))}n=th(e)}return n}(v,m),void 0===m)return;if("undefined"!=typeof _debug_&&_debug_.directives.stopAfterThreeProngs)return{cpNode:m,meta:v};const x={cpNode:m,meta:v};return"undefined"!=typeof _debug_&&(_debug_.timing.threeProngs+=performance.now()-Zp),x}const{ceil:wd,log2:_d}=Math;function Md(t,n){const{maxCoordinate:e}=function(t){let n=0,e=1/0,r=-1/0,o=1/0,i=-1/0;for(const c of t)for(const t of c)for(const c of t){const t=c[0],s=c[1],u=za(Fa(t),Fa(s));u>n&&(n=u),t<e&&(e=t),t>r&&(r=t),s<o&&(o=s),s>i&&(i=s)}return{maxCoordinate:n,width:r-e,height:i-o}}(t),r=wd(_d(e)),o=function(t,n){const e={...n};for(const n in dp){const r=n;let o=e[r];const i=dp[r],{range:c,scaleByMaxCoordinate:s}=i;o<c[0]&&(o=c[0]),o>c[1]&&(o=c[1]),s&&(o*=2**(t-10)),e[r]=o}return e}(r,{...hp,...n||{}}),{applySat:i,simplify:c,satScale:s,simplifyTolerance:u}=o,f=Ba(t,void 0,{forceOrientationNegative:!0}),l=[];for(const t of f){let n=bd(t,r,o);void 0!==n&&(i&&(n=pp(n,s)),c&&(n=op(n,u,50)),l.push(n))}return l}function Sd(t){const n=function(t){let n=t;const e=cp(t);for(;e.length;){const r=e.pop();if(r.isHoleClosing||r.isIntersection)continue;let o=r.next;for(;;){o=o.next;let e=!1;const r=o.prevOnCircle;if(v(o)>2){const n=o.nextOnCircle;kt(o,t)?e=!0:o.next===n?o=n:n.next!==r&&(e=!0)}else if(x(o)&&!o.isIntersection)return void(n=o);if(e){r.next=o,o.prev=r,n=o;break}}}return n}(O(t.cpNode));if(n)return{cpNode:n,meta:{...t.meta,cpTrees:ep(n)}}}const Id="red thin10 nofill ",Nd="http://www.w3.org/2000/svg";function yd(t,n,e=Id,r){const o=n.center,i=n.radius,c=document.createElementNS(Nd,"circle");return c.setAttributeNS(null,"cx",o[0].toString()),c.setAttributeNS(null,"cy",o[1].toString()),c.setAttributeNS(null,"r",i.toString()),c.setAttributeNS(null,"class",e),t.appendChild(c),r&&setTimeout(()=>c.remove(),r),[c]}function Cd(t,n,e=3,r="red",o){const[i]=yd(t,{center:n,radius:e},"dot "+r,o);return o&&setTimeout(()=>i.remove(),o),[i]}function Od(t,n,e=Id,r=0,o=void 0,i=0){const c=document.createElementNS(Nd,"line");c.setAttributeNS(null,"x1",n[0][0].toString()),c.setAttributeNS(null,"y1",n[0][1].toString()),c.setAttributeNS(null,"x2",n[1][0].toString()),c.setAttributeNS(null,"y2",n[1][1].toString()),c.setAttributeNS(null,"class",e),t.appendChild(c);let s=[];if(void 0!==o)for(const e of n)s.push(...Cd(t,e,i,o,r));for(const n of s)t.appendChild(n);const u=[c,...s];return r&&setTimeout(()=>{for(const t of u)t.remove()},r),u}function Ed(t,n,e=Id,r=3,o){const i=yd(t,{center:n,radius:r},e),c=[[n[0]-r,n[1]],[n[0]+r,n[1]]],s=[[n[0],n[1]-r],[n[0],n[1]+r]],u=Od(t,c,e),f=Od(t,s,e);return o&&setTimeout(()=>{i.forEach(t=>t.remove()),u.forEach(t=>t.remove()),f.forEach(t=>t.remove())},o),[...i,...u,...f]}function Td(t){return 2===t?"L":3===t?"Q":4===t?"C":void 0}function Ad(t,n,e=Id,r=0,o=void 0,i=0,c=void 0){const[[s,u],[f,l],[a,p]]=n,h=document.createElementNS(Nd,"path");h.setAttributeNS(null,"d",`M${s} ${u} Q${f} ${l} ${a} ${p}`),e&&h.setAttributeNS(null,"class",e);let d=[];if(void 0!==o)for(const e of n)d.push(...Cd(t,e,i,o,r));let g=[];if(void 0!==c)for(let e=0;e<n.length-1;e++)g.push(...Od(t,[n[e],n[e+1]],c,r));const v=[h,...d,...g];for(const n of v)t.appendChild(n);return r&&setTimeout(()=>{for(const t of v)t.remove()},r),v}function Pd(t,n,e=Id,r=0,o=void 0,i=0,c=void 0){const[[s,u],[f,l],[a,p],[h,d]]=n;if(s===h&&f===h&&a===h&&u===d&&l===d&&p===d)return Ed(t,[s,u],e,.2,r);const g=document.createElementNS(Nd,"path");g.setAttributeNS(null,"d",`M${s} ${u} C${f} ${l} ${a} ${p} ${h} ${d}`),g.setAttributeNS(null,"class",e);let v=[];if(void 0!==o)for(const e of n)v.push(...Cd(t,e,i,o,r));let m=[];if(void 0!==c)for(let e=0;e<n.length-1;e++)m.push(...Od(t,[n[e],n[e+1]],c,r));const x=[g,...v,...m];for(const n of x)t.appendChild(n);return r&&setTimeout(()=>{for(const t of x)t.remove()},r),x}function kd(t,n,e=Id,r=0,o=void 0,i=0,c=void 0){return 2===n.length?Od(t,n,e,r,o,i):3===n.length?Ad(t,n,e,r,o,i,c):4===n.length?Pd(t,n,e,r,o,i,c):[]}const Bd=["red","green","cyan","blue"];function zd(t,n){const e=1-n;if(4===t.length){const[[r,o],[i,c],[s,u],[f,l]]=t;return[r*e**3+3*i*e**2*n+3*s*e*n**2+f*n**3,o*e**3+3*c*e**2*n+3*u*e*n**2+l*n**3]}if(3===t.length){const[[r,o],[i,c],[s,u]]=t;return[r*e**2+2*i*e*n+s*n**2,o*e**2+2*c*e*n+u*n**2]}if(2===t.length){const[[r,o],[i,c]]=t;return[r*e+i*n,o*e+c*n]}return[NaN,NaN]}function Fd(t,n){return 2===t.length?function(t,n){const[[e,r],[o,i]]=t,c=1-n,s=[c*e+n*o,c*r+n*i];return[[[e,r],s],[s,[o,i]]]}(t,n):3===t.length?function(t,n){const[[e,r],[o,i],[c,s]]=t,u=1-n,f=[u*u*e+2*u*n*o+n*n*c,u*u*r+2*u*n*i+n*n*s];return[[[e,r],[u*e+n*o,u*r+n*i],f],[f,[u*o+n*c,u*i+n*s],[c,s]]]}(t,n):4===t.length?function(t,n){const[[e,r],[o,i],[c,s],[u,f]]=t,l=1-n,a=n*n,p=a*n,h=l*l,d=h*l,g=[p*u+3*l*a*c+3*h*n*o+d*e,p*f+3*l*a*s+3*h*n*i+d*r];return[[[e,r],[n*o+l*e,n*i+l*r],[a*c+2*l*n*o+h*e,a*s+2*l*n*i+h*r],g],[g,[a*u+2*n*l*c+h*o,a*f+2*n*l*s+h*i],[n*u+l*c,n*f+l*s],[u,f]]]}(t,n):[]}const Ld={circle:yd,crossHair:Ed,dot:Cd,line:Od,rect:function(t,n,e=Id,r){const[[o,i],[c,s]]=n,u=o<c?o:c,f=i<s?i:s,l=Math.abs(o-c),a=Math.abs(i-s),p=document.createElementNS(Nd,"rect");return p.setAttributeNS(null,"x",u.toString()),p.setAttributeNS(null,"y",f.toString()),p.setAttributeNS(null,"width",l.toString()),p.setAttributeNS(null,"height",a.toString()),e&&p.setAttributeNS(null,"class",e),t.appendChild(p),r&&setTimeout(()=>p.remove(),r),[p]},beziers:function(t,n,e,r){const o=void 0===e,i=[];for(let r=0;r<n.length;r++){const c=n[r],s=o?"thin5 nofill "+Bd[r%Bd.length]:e;i.push(...kd(t,c,s))}return r&&setTimeout(()=>i.forEach(t=>t.remove()),r),i},bezier:kd,bezierPiece:function(t,n,e,r=Id,o){const i=e[0]===e[1]?Ed(t,zd(n,e[0]),r,1.5):kd(t,function(t,n){if(0===n[0]&&1===n[1])return t;if(n[0]===n[1]){const e=zd(t,n[0]);return[e,e,e,e]}return 0===n[0]?Fd(t,n[1])[0]:1===n[1]?Fd(t,n[0])[1]:Fd(Fd(t,n[0])[1],(n[1]-n[0])/(1-n[0]))[0]}(n,e),r);return o&&setTimeout(()=>i.forEach(t=>t.remove()),o),i},quadBezier:Ad,cubicBezier:Pd,polygon:function(t,n,e=Id,r){const o=document.createElementNS(Nd,"path");let i=`M${n[0][0]} ${n[0][1]} L`;for(let t=0;t<n.length;t++)i+=`${n[t][0]} ${n[t][1]} `;return i+=" z",o.setAttributeNS(null,"d",i),e&&o.setAttributeNS(null,"class",e),t.appendChild(o),r&&setTimeout(()=>o.remove(),r),[o]},loop:function(t,n,e=Id,r){if(!n.length)return[];const o=document.createElementNS(Nd,"path");let i=`M${n[0][0][0]} ${n[0][0][1]} `;for(let t=0;t<n.length;t++){const e=n[t];i+=`${Td(e.length)} `;for(let t=1;t<e.length;t++)i+=`${e[t][0]} ${e[t][1]} `}return i+=" z",o.setAttributeNS(null,"d",i),e&&o.setAttributeNS(null,"class",e),t.appendChild(o),r&&setTimeout(()=>o.remove(),r),[o]},polyline:function(t,n,e=Id,r){if(n.length<2)return[];const o=document.createElementNS(Nd,"path");let i=`M${n[0][0]} ${n[0][1]} L`;for(let t=0;t<n.length;t++)i+=`${n[t][0]} ${n[t][1]} `;return o.setAttributeNS(null,"d",i),e&&o.setAttributeNS(null,"class",e),t.appendChild(o),r&&setTimeout(()=>o.remove(),r),[o]},text:function(t,n,e,r,o=Id,i){const c=document.createElementNS(Nd,"text");return c.setAttributeNS(null,"x",n[0].toString()),c.setAttributeNS(null,"y",n[1].toString()),c.setAttributeNS(null,"font-size",r.toString()),c.setAttributeNS(null,"class",o),c.textContent=e,t.appendChild(c),i&&setTimeout(()=>c.remove(),i),[c]}};function Yd(t,n){return(n,e,r,o=0,i=1)=>{let c,s;switch(e.isHoleClosing){case!1:c="red ",s="2";break;case!0:c="cyan ",s="10"}const{pointOnShape:u}=e,{circle:f}=u,{center:l,radius:a}=f,{isSource:p,p:h}=u,d=e.nextOnCircle.pointOnShape.p,g=p?h:d,v=p?d:h,{line:m,dot:x,circle:b,crossHair:w}=Ld,_=x(n,f.center,.02*i,"yellow",o);return[...b(n,f,c+"thin"+s+" nofill",o),...x(n,g,.005*i,c,o),...x(n,v,.01*i,c,o),...t?w(n,f.center,"red thin2 nofill",.002*i,o):[],..._]}}function Hd(t,n){return{center:t.center,radius:n*t.radius}}const Xd=["thin10 blue nofill","thin10 red nofill"];function $d(t,n,e,r=0,o=1){let i=n.cpNode;if(!i)return[];for(;!x(i);)i=i.next;const c=[];let s=0;return I(i,n=>{if(x(n))return;const e=At(n);e&&(c.push(...Ld.bezier(t,e,Xd[s%2],r)),s++)}),c}function Vd(t,n,e,r){const o=document.createElementNS("http://www.w3.org/2000/svg","circle");return o.setAttributeNS(null,"cx",n[0].toString()),o.setAttributeNS(null,"cy",n[1].toString()),o.setAttributeNS(null,"r",e.toString()+"%"),o.setAttributeNS(null,"class",r),t.appendChild(o),o}function Dd(t,n,e="thin5 purple nofill",r=0,o=1){const i=[],c=[];for(const t of n){if(x(t))continue;const n=At(t);n&&c.push(n)}return i.push(...a(t,c,e,r)),i}const qd={oneProng:function(t,n,e,r=0,o=1){const{pointOnShape:i}=n,{circle:c}=i;return[...Ld.dot(t,i.p,.02*o,"deeppink",r),...Ld.dot(t,c.center,.01*o,"deeppink",r),...Ld.circle(t,c,"deeppink thin5 nofill",r)]},twoProng:Yd(!1),threeProng:function(t,n,e,r=0,o=1){const i=Hd(n.pointOnShape.circle,1),{center:c,radius:s}=i,u=m(n).map(t=>t.pointOnShape),{dot:f,circle:l,crossHair:a}=Ld,p=l(t,i,"blue thin2 nofill",r),h=[],d=[];for(let n=0;n<u.length;n++){const e=u[n].p;h.push(...f(t,e,.01*(n+1)*o,"blue",r)),d.push(...Ld.line(t,[e,c],"thin5 red",r))}const g=a(t,i.center,"red thin2 nofill",.02*o,r);return[...h,...d,...p,...g]},boundingHull:function(t,n,e="thin5 black nofill",r=0,o=1){return Ld.polygon(t,n,e,r)},looseBoundingBox:function(t,n,e="thin5 brown nofill",r=0,o=1){const[[i,c],[s,u]]=n;return n=[[i,c],[s,c],[s,u],[i,u]],Ld.polygon(t,n,e,r)},tightBoundingBox:function(t,n,e="thin5 pinker nofill",r=0,o=1){return Ld.polygon(t,n,"thin5 pinker nofill",r)},vertex:function(t,n,e,r=0,o=1){const i=n.pointOnShape.circle;let c=[];return c=[...Ld.dot(t,i.center,.01*o,"darkgreen",r)],c},mat:$d,maxVertex:function(t,n){const e=n.pointOnShape.circle;return Ld.circle(t,e,"brown thin10 nofill")},leaves:function(t,n,e="thin10 deeppink nofill",r=0,o=1){const i=[],{line:c,dot:s,circle:u}=Ld;for(const f of n){const n=f.pointOnShape,{circle:l}=n,{center:a,radius:p}=l,h=[Vd(t,a,.5,"pinker thin5 nofill")],d=m(f).map(t=>t.pointOnShape),g=[],v=[];for(let n=0;n<d.length;n++){const e=d[n].p;v.push(...s(t,e,.01*(n+1)*o,"pinker",r)),g.push(...c(t,[e,a],"thin5 red",r))}const x=u(t,l,e,r);i.push(...x,...v,...g,...h)}return i},cull:function(t,n,e="thin10 cyan nofill",r=0,o=1){const i=[];return i.push(...Ld.crossHair(t,n,e,.1*o,r)),i},cpNode:function(t,n,e="blue thin2 nofill",r=0,o=1){const i=Hd(n.pointOnShape.circle,1),{center:c,radius:s}=i,u=m(n).map(t=>t.pointOnShape),{dot:f,circle:l,crossHair:a}=Ld,p=l(t,i,e,r),h=[],d=[];for(let n=0;n<u.length;n++){const e=u[n].p;h.push(...f(t,e,.01*(n+1)*o,"blue",r)),d.push(...Ld.line(t,[e,c],"thin5 red",r))}const g=a(t,c,"orange thin10 nofill",2*o,r);return[...h,...d,...p,...g]},branch:Dd,holeCloser:Yd(!1)},jd={...qd,twoProng:Yd(!0)};function Wd(t){if(!t)return void(window._debug_=void 0);let n=window._debug_;n={...n,elems:{...n?.elems,oneProng:[],twoProng:[],looseBoundingBox:[],tightBoundingBox:[],vertex:[],threeProng:[],boundingHull:[],mat:[],cpNode:[],maxVertex:[],leaves:[]},timing:{...n?.timing,holeClosers:0,oneAnd2Prongs:0,threeProngs:0,sats:0,simplifyMat:0},fs:{...n?.fs,drawElem:{...n?.fs?.drawElem,...qd}},directives:{...n?.directives,stopAfterHoleClosers:!1,stopAfterHoleClosersNum:void 0,stopAfterTwoProngs:!1,stopAfterTwoProngsNum:void 0,stopAfterThreeProngs:!1,stopAfterThreeProngsNum:void 0}},window._debug_=n}const Qd={oneProng:[],twoProng:[],threeProng:[],looseBoundingBox:[],tightBoundingBox:[],boundingHull:[],vertex:[],mat:[],maxVertex:[],leaves:[],cull:[],cpNode:[],branch:[],holeCloser:[]},Rd=Object.keys(Qd);function Gd(t,n,e,r){const o=[];for(const r of t)o.push({type:0,item:r,x:n(r)}),o.push({type:1,item:r,x:e(r)});o.sort(Ud);const i=new Set,c=[];for(const t of o){const{item:n}=t;if(0===t.type){for(const t of i.values())r(n,t)&&c.push([n,t]);i.add(n)}else 1===t.type&&i.delete(t.item)}return c}function Ud(t,n){const e=t.x-n.x;return 0!==e?e:0===t.type?-1:1}const Zd=1e-4;function Jd(t,n){const e=t.pointOnShape,r=n.pointOnShape;let{curve:o,p:i,t:c}=e,{curve:s,p:u,t:f}=r;if(i[0]===u[0]&&i[1]===u[1])return[i];1===c&&(c=0,o=o.next),0===f&&(f=1,s=s.prev);const{ps:l}=o,{ps:a}=s,p=[i,j(i)(W(U(l,c)))],h=[u,j(u)(W(U(a,f)))],d=H(p,h),g=X(i,u);let v;if(d){const t=X(i,d),n=X(u,d);v=$(t,g)<0||$(n,g)>0}else v=!0;if(!v)return[i,d,u];const m=X(p[0],p[1]),x=X(h[0],h[1]),b=Math.abs(D(g,m))/9,w=Math.abs(D(g,x))/9;return b>.01||w>.01||b>Zd||w>Zd?void 0:[i,u]}const Kd=Y(function(t){return pn(At(t))});function tg(t,n){const e=function(t){const n=new Map;for(let e of t)for(let r of t){const t=e.pointOnShape.circle.center,o=r.pointOnShape.circle.center,i=e.pointOnShape.p,c=r.pointOnShape.p;r!==e&&t[0]===o[0]&&t[1]===o[1]&&i[0]===c[0]&&i[1]===c[1]&&n.set(e,r)}return n}(n),r=t.length,o=[];for(let n=0;n<r;n++){const i=t[n],c=[];for(let o=0;o<r;o++){const r=t[o];if(n===o){c.push(0);continue}let s=1/0;for(const t of m(i)){let n=Kd(t),o=t.next;for(;!kt(o,r);)if(o.isHoleClosing)o=ng(e,o);else{if(Sn(o)){n=1/0;break}n+=Kd(o),o=o.next}n<s&&(s=n)}c.push(s)}o.push(c)}return o}function ng(t,n){return t.get(n).next}function eg(t,n){return t.pointOnShape.curve.loop===n.pointOnShape.curve.loop}function rg(t){if(!x(t))return!1;if(Ft(t))return!0;for(;t.prev===t.prevOnCircle;)t=t.prev;return m(t.prevOnCircle,!0).every(x)}function og(t){let{cpNode:n}=t,e=n;do{if(rg(n)||n.next!==n.nextOnCircle){n=n.next;continue}const t=n.next,r=t.next,o=n.next.nextOnCircle;n.next=r,n.nextOnCircle=o,r.prev=n,o.prevOnCircle=n,e===t&&(e=n),n=n.next}while(n!==e);return t.cpNode=n,t}const ig=Number.EPSILON,{abs:cg,max:sg}=Math;function ug(t,n){return 0===n?0:function(t){let n=0,e=1.125,r=t(n),o=t(e),i=n,c=r,s=e-n,u=s;for(;;){cg(c)<cg(o)&&(n=e,e=i,i=n,r=o,o=c,c=r);const f=2*ig*sg(1,cg(n),cg(e)),l=.5*(i-e);if(cg(l)<=f)return e;if(cg(s)<f||cg(r)<=cg(o))s=l,u=s;else{let t,a,p=o/r;if(n===i)t=2*l*p,a=1-p;else{a=r/c;const i=o/c;t=p*(2*l*a*(a-i)-(e-n)*(i-1)),a=(a-1)*(i-1)*(p-1)}0<t?a=-a:t=-t,p=s,s=u,2*t<3*l*a-cg(f*a)&&t<cg(.5*p*a)?u=t/a:(s=l,u=s)}if(n=e,r=o,f<cg(u)?e+=u:0<l?e+=f:e-=f,o=t(e),0===o)return e;o*c>0&&(i=n,c=r,s=e-n,u=s)}}(e=>(n=>lp([0,n],t))(e)-n)}const{max:fg,min:lg}=Math;function ag(t,n,e){return fg(n,lg(e,t))}function pg(t){return lp(t.ts,t.ps)}const hg=1e-9;function dg(t){const{ps:n,ts:[e,r]}=t;return{ps:n.toReversed(),ts:[1-r,1-e]}}function gg(t){const n=[0];let e=0;for(let r=0;r<t.length;r++)e+=t[r],n.push(e);return n}function vg(t){let n,e=Number.POSITIVE_INFINITY;for(let r=0;r<t.length;r++)t[r]<=e&&(e=t[r],n=r);return n}function mg(t,n){const e=[];for(let r=0;r<t.length;r++)(t[r]===n||xg(t[r],n))&&e.push(r);return e}function xg(t,n){return Math.abs(t-n)<=hg}function bg(t){const n=t.filter(t=>!function(t){const{ps:n,ts:[e,r]}=t;if(e===r||n.length<=1)return!0;const[[o,i],[c,s]]=n,u=o===c&&i===s;if(2===n.length)return u;const[f,l]=n[2],a=u&&c===f&&s===l;if(3===n.length)return a;const[p,h]=n[3],d=a&&f===p&&l===h;return 4===n.length&&d}(t));return n.length>0?n:[t[0]]}function wg(t){const n={ps:At(t),ts:[0,1]};if(t.isHoleClosing&&!eg(t,t.next))return;const e=function(t){const n=rg(t)?void 0:t.next.prevOnCircle;return{boundaryBeziers:bg(T(t)),boundaryBeziersOpp:void 0===n?void 0:bg(T(n))}}(t),{boundaryBeziers:r,boundaryBeziersOpp:o}=e;return function(t,n,e){const r=(e??[]).map(dg).toReversed(),o=function(t){const n=function(t,n){const e=[];for(let r=0;r<t.length;r++){const o=t[r],i=[];for(let t=0;t<o.length;t++)i.push(n(o[t]));e.push(i)}return e}(t,pg),e=n.map(dn),r=n.map(gg).map((t,n)=>{const r=e[n];return r<=hg?t.map((t,n)=>0===n?0:1):t.map(t=>t/r)});let o=new Array(t.length).fill(0),i=new Array(t.length).fill(0);const c=[];let s=0;for(;o.some(t=>t<1)&&s++<100;){const n=[];for(let e=0;e<t.length;e++){const t=i[e],o=r[e][t+1],c=void 0===o?Number.POSITIVE_INFINITY:o;n.push(c)}const e=vg(n),s=mg(n,n[e]),u=n[e],f=new Array(t.length).fill([]);for(let n=0;n<t.length;n++){const e=t[n],c=i[n];if(c>=e.length){const t=e[e.length-1];f[n]={ps:t.ps,ts:[1,1]},o[n]=1;continue}if(s.includes(n)){const t=o[n],r=e[c],[s,u]=r.ts,l=u-s;f[n]={ps:r.ps,ts:[s+t*l,u]};const a=c+1;i[n]=a,o[n]=a>=e.length?1:0}else{const t=o[n],s=e[c],[l,a]=s.ts,p=a-l,h=pg({ps:s.ps,ts:[0,1]}),d=r[n][c],g=r[n][c+1]-d,v=g<=hg?t:ag((u-d)/g,t,1),m=h<=hg?t:ag(ug(s.ps,h*v),t,1);if(f[n]={ps:s.ps,ts:[l+t*p,l+m*p]},xg(m,1)){const t=c+1;i[n]=t,o[n]=t>=e.length?1:0}else i[n]=c,o[n]=m}}c.push(f)}if(o.some(t=>t<1))throw new Error("splitTriPath_: exceeded maximum iterations");return c}(r.length>0?[t,[n],r]:[t,[n]]),i=[];for(let t=0;t<o.length;t++){const n=o[t],[e,r]=n,c={boundaryBezier:e,medialBezier:r};i.push(c)}return i}(r,n,o??[])}function _g(t){const n=[],e=new Map;for(let r=0;r<t.length;r++){const o=t[r],i=[];for(let t=0;t<o.length;t++){const n=o[t];e.set(n,[r,t]);const c=wg(n);i.push(c)}n.push(i)}const r=[];for(let o=0;o<t.length;o++){const i=t[o];for(let t=0;t<i.length;t++){const c=i[t],s=rg(c)?void 0:c.next.prevOnCircle,u=void 0===s?[255,65535]:e.get(s),f=n[o][t];void 0!==u&&void 0!==f?r.push([[o,t],u]):r.push([[o,t],[255,65535]])}}return{mbssByLoop:n,oppArr:r}}function Mg(t){let{cpNode:n}=t;for(;!rg(n);)n=n.next;return eg(n,n.next)||(n=n.holeCloserTwin),function(t){const n=[],e=[t],r=new Set(e);for(t.isHoleClosing&&r.add(t.prevOnCircle.holeCloserTwin),r.add(t);e.length>0;){const t=[],o=e.pop(),i=o.pointOnShape.curve.loop;let c=o;do{if(i===c.pointOnShape.curve.loop){t.push(c),c=c.next;continue}const n=c.holeCloserTwin;r.has(n)||(r.add(n),r.add(n.prevOnCircle.holeCloserTwin),e.push(n)),c=c.prev.holeCloserTwin}while(c!==o);n.push(t)}return n}(n)}function Sg(t){const n=[],e=function(t,n){const e=function(t,n){return t.map(t=>pp(t,n)).map(og)}(t,n);return e.map(Mg).map(_g)}(t,1.5);for(const t of e){const{mbssByLoop:e,oppArr:r}=t;for(let t=0;t<e.length;t++){const r=e[t];for(let o=0;o<r.length;o++){const r=e[t][o];if(void 0===r)continue;const i=r;for(let t=0;t<i.length;t++){const e=i[t],{boundaryBezier:r,medialBezier:o}=e;n.push(r)}}}}return n}export{_n as CpNodeFs,e as beziersToSvgPathStr,O as clone,wn as cpNodeComparator,eh as createInitialCpTree,Rd as debugElemNames,a as drawBeziersAsSinglePath,Dd as drawBranch,qd as drawElemFs,jd as drawElemFsDetailed,$d as drawMat,Qd as emptyDebugElems,Wd as enableDebugForMat,M as enhanceCpNode,Vh as find2Prong,md as findAndAddHoleClosing2Prongs,Md as findMats,p as floydWarshall,m as getAllOnCircle,h as getAllOnLoop,xn as getAllVertices,T as getBoundaryBezierPartsToNext,hn as getBoundaryBeziersBetween,P as getBoundaryBeziersToNext,Dp as getBoundaryPieceBeziers,Lt as getBranch,Yt as getBranchBeziers,Ka as getBranches,z as getChildren,zp as getCloseBoundaryPointsCertified,Tp as getClosestSquareDistanceToRect,Ct as getEdgeDirection,Pt as getFirstExit,Zh as getFor2ProngsOnLoop,tg as getGraph,d as getHoleClosers,Jd as getImpliedBoundaryBezierBetween,mn as getInitialDegAngleBetweenMatCurves,Tt as getMatCurveBetween,At as getMatCurveToNext,vn as getMatCurvesBetween,rh as getPartialMeta,l as getPathsFromStr,Cp as getPotentialClosestPointsOnCurveCertified,v as getProngCount,b as getRealProngCount,gn as getSalience,ap as getSatCulls,xd as getShapeBounds,oh as getSharpCornersOnLoop,N as getVertexForwardChildren,w as isFullyTerminating,kt as isOnSameCircle,eg as isOnSameLoop,Bt as isOneProng,_ as isSharp,x as isTerminating,Ft as isTrivial,zt as isTwoProng,Sn as isVertexSpecial,t as loopFromBeziers,Sg as reconstructFromMats,B as removeVertex,Hd as scaleCircle,op as simplifyMat,Gd as sweepLine,pp as toScaleAxis,S as traverseCp,I as traverseEdges,y as traverseVertices,Sd as trimMat};