flo-mat 4.0.3 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__tests__/find-2-prong/get-medial/dd-get-medial-point-coeffs-same-curve.spec.ts +106 -0
- package/__tests__/find-2-prong/get-medial/dd-get-medial-point-coeffs.spec.ts +73 -0
- package/__tests__/find-2-prong/get-medial/get-closest-points.spec.ts +5 -2
- package/__tests__/helpers/close-to.ts +5 -5
- package/__tests__/helpers/jest.setup.ts +35 -0
- package/__tests__/specific-cases/load-svg/load-svg.ts +30 -0
- package/__tests__/specific-cases/specific-cases.spec.ts +168 -4
- package/__tests__/specific-cases/test-svgs/achispado.svg +5052 -0
- package/browser/index.js +16089 -16854
- package/browser/index.min.js +1 -1
- package/{jest.config.cjs → jest.config.ts} +8 -3
- package/node/closest-boundary-point/get-close-boundary-points-certified.js +3 -2
- package/node/closest-boundary-point/get-close-boundary-points-certified.js.map +1 -1
- package/node/corner/get-corner.js +1 -1
- package/node/corner/get-corner.js.map +1 -1
- package/node/{reconstruct-from-mat → cp-node/fs}/get-all-on-loop-by-loop.d.ts +6 -2
- package/node/{reconstruct-from-mat → cp-node/fs}/get-all-on-loop-by-loop.js +5 -1
- package/node/cp-node/fs/get-all-on-loop-by-loop.js.map +1 -0
- package/node/cp-node/fs/get-boundary-beziers-to-next.d.ts +1 -0
- package/node/cp-node/fs/get-boundary-beziers-to-next.js +1 -59
- package/node/cp-node/fs/get-boundary-beziers-to-next.js.map +1 -1
- package/node/cp-node/fs/get-edge-direction.d.ts +3 -1
- package/node/cp-node/fs/get-edge-direction.js +5 -3
- package/node/cp-node/fs/get-edge-direction.js.map +1 -1
- package/node/cp-node/fs/get-implied-boundary-bezier-between.js.map +1 -1
- package/node/cp-node/fs/get-mat-curve-between.js +6 -6
- package/node/cp-node/fs/get-mat-curve-between.js.map +1 -1
- package/node/cp-node/fs/is-fully-terminating.js +12 -0
- package/node/cp-node/fs/is-fully-terminating.js.map +1 -1
- package/node/debug/debug.d.ts +4 -13
- package/node/debug/debug.js +3 -30
- package/node/debug/debug.js.map +1 -1
- package/node/find-2-prong/find-2-prong.js +24 -10
- package/node/find-2-prong/find-2-prong.js.map +1 -1
- package/node/find-2-prong/get-medial/get-antipodal-points.d.ts +1 -1
- package/node/find-2-prong/get-medial/get-antipodal-points.js +2 -2
- package/node/find-2-prong/get-medial/get-antipodal-points.js.map +1 -1
- package/node/find-2-prong/get-medial/get-closest-points.d.ts +7 -1
- package/node/find-2-prong/get-medial/get-closest-points.js +60 -14
- package/node/find-2-prong/get-medial/get-closest-points.js.map +1 -1
- package/node/find-2-prong/reduce-radius.d.ts +3 -1
- package/node/find-2-prong/reduce-radius.js +8 -6
- package/node/find-2-prong/reduce-radius.js.map +1 -1
- package/node/find-3-prong/calc-better-x.js +1 -3
- package/node/find-3-prong/calc-better-x.js.map +1 -1
- package/node/find-3-prong/calc-initial-3-prong-center.js +1 -2
- package/node/find-3-prong/calc-initial-3-prong-center.js.map +1 -1
- package/node/find-3-prong/find-3-prong-for-delta3s.js +1 -4
- package/node/find-3-prong/find-3-prong-for-delta3s.js.map +1 -1
- package/node/find-3-prong/find-3-prong.js.map +1 -1
- package/node/find-3-prong/find-and-add-3-prong.js +0 -14
- package/node/find-3-prong/find-and-add-3-prong.js.map +1 -1
- package/node/find-mat/find-mat.js +2 -1
- package/node/find-mat/find-mat.js.map +1 -1
- package/node/find-mat/find-mats.js +3 -1
- package/node/find-mat/find-mats.js.map +1 -1
- package/node/find-mat/get-dull-corners-on-loop.js +3 -2
- package/node/find-mat/get-dull-corners-on-loop.js.map +1 -1
- package/node/find-mat/get-for-1-prongs-on-loop.js +6 -3
- package/node/find-mat/get-for-1-prongs-on-loop.js.map +1 -1
- package/node/find-mat/get-for-2-prongs-on-loop.js +5 -1
- package/node/find-mat/get-for-2-prongs-on-loop.js.map +1 -1
- package/node/find-mat/get-meta.d.ts +4 -1
- package/node/find-mat/get-meta.js +9 -1
- package/node/find-mat/get-meta.js.map +1 -1
- package/node/find-mat/get-sharp-corners.js +4 -2
- package/node/find-mat/get-sharp-corners.js.map +1 -1
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez0.d.ts +21 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez0.js +46 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez0.js.map +1 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez1.d.ts +28 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez1.js +97 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez1.js.map +1 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez2-same-curve.d.ts +28 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez2-same-curve.js +109 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez2-same-curve.js.map +1 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez2.d.ts +29 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez2.js +123 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez2.js.map +1 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez3-same-curve.d.ts +30 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez3-same-curve.js +177 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez3-same-curve.js.map +1 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez3.d.ts +29 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez3.js +156 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez3.js.map +1 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs.d.ts +28 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs.js +40 -0
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs.js.map +1 -0
- package/node/index.d.ts +4 -10
- package/node/index.js +3 -6
- package/node/index.js.map +1 -1
- package/node/point-on-shape/point-on-shape.d.ts +2 -0
- package/node/point-on-shape/to-p.d.ts +1 -1
- package/node/point-on-shape/to-p.js +1 -1
- package/node/point-on-shape/to-p.js.map +1 -1
- package/node/reconstruct-from-mat/get-cp-nodess-for-sat.js +2 -2
- package/node/reconstruct-from-mat/get-cp-nodess-for-sat.js.map +1 -1
- package/node/reconstruct-from-mat/reconstruct-from-mat.d.ts +8 -2
- package/node/reconstruct-from-mat/reconstruct-from-mat.js +154 -22
- package/node/reconstruct-from-mat/reconstruct-from-mat.js.map +1 -1
- package/node/reconstruct-from-mat/remove-sat-induced-trivial-3prongs.js +1 -1
- package/node/reconstruct-from-mat/remove-sat-induced-trivial-3prongs.js.map +1 -1
- package/node/svg/get-loop-bounds.js +6 -2
- package/node/svg/get-loop-bounds.js.map +1 -1
- package/node/utils/map-deep.d.ts +15 -0
- package/node/utils/map-deep.js +34 -0
- package/node/utils/map-deep.js.map +1 -0
- package/package.json +18 -12
- package/src/closest-boundary-point/get-close-boundary-points-certified.ts +3 -2
- package/src/corner/get-corner.ts +1 -1
- package/src/{reconstruct-from-mat → cp-node/fs}/get-all-on-loop-by-loop.ts +7 -3
- package/src/cp-node/fs/get-all-on-loop.ts +1 -1
- package/src/cp-node/fs/get-boundary-beziers-to-next.ts +1 -72
- package/src/cp-node/fs/get-edge-direction.ts +8 -4
- package/src/cp-node/fs/get-implied-boundary-bezier-between.ts +0 -1
- package/src/cp-node/fs/get-mat-curve-between.ts +6 -6
- package/src/cp-node/fs/is-fully-terminating.ts +16 -0
- package/src/debug/debug.ts +8 -50
- package/src/find-2-prong/find-2-prong.ts +37 -14
- package/src/find-2-prong/get-medial/get-antipodal-points.ts +3 -2
- package/src/find-2-prong/get-medial/get-closest-points-d.ts +213 -0
- package/src/find-2-prong/get-medial/get-closest-points.ts +74 -13
- package/src/find-2-prong/reduce-radius.ts +8 -5
- package/src/find-3-prong/calc-better-x.ts +1 -3
- package/src/find-3-prong/calc-initial-3-prong-center.ts +1 -2
- package/src/find-3-prong/find-3-prong-for-delta3s.ts +1 -4
- package/src/find-3-prong/find-3-prong.ts +0 -1
- package/src/find-3-prong/find-and-add-3-prong.ts +1 -15
- package/src/find-mat/find-mat.ts +3 -1
- package/src/find-mat/find-mats.ts +3 -2
- package/src/find-mat/get-dull-corners-on-loop.ts +4 -3
- package/src/find-mat/get-for-1-prongs-on-loop.ts +8 -3
- package/src/find-mat/get-for-2-prongs-on-loop.ts +6 -1
- package/src/find-mat/get-meta.ts +11 -0
- package/src/find-mat/get-sharp-corners.ts +5 -1
- package/src/get-medial-curve/__pycache__/get-cubic-self-medial-curve.cpython-313.pyc +0 -0
- package/src/get-medial-curve/get-cubic-self-medial-curve.py +419 -0
- package/src/get-medial-points/double-double/dd-get-medial-point-coeffs-bez0-with-running-err.ts +76 -0
- package/src/get-medial-points/double-double/dd-get-medial-point-coeffs-bez0.ts +61 -0
- package/src/get-medial-points/double-double/dd-get-medial-point-coeffs-bez1.ts +116 -0
- package/src/get-medial-points/double-double/dd-get-medial-point-coeffs-bez2-same-curve.ts +129 -0
- package/src/get-medial-points/double-double/dd-get-medial-point-coeffs-bez2.ts +142 -0
- package/src/get-medial-points/double-double/dd-get-medial-point-coeffs-bez3-same-curve.ts +199 -0
- package/src/get-medial-points/double-double/dd-get-medial-point-coeffs-bez3.ts +177 -0
- package/src/get-medial-points/double-double/dd-get-medial-point-coeffs.ts +48 -0
- package/src/get-medial-points/double-double/error-bound-calc.txt +72 -0
- package/src/index.ts +4 -10
- package/src/point-on-shape/point-on-shape.ts +3 -0
- package/src/point-on-shape/to-p.ts +2 -2
- package/src/reconstruct-from-mat/get-cp-nodess-for-sat.ts +2 -2
- package/src/reconstruct-from-mat/reconstruct-from-mat.ts +202 -21
- package/src/reconstruct-from-mat/remove-sat-induced-trivial-3prongs.ts +1 -1
- package/src/svg/get-loop-bounds.ts +11 -3
- package/src/utils/map-deep.ts +75 -0
- package/src/utils/map-map.ts +33 -0
- package/wallaby.mjs +4 -4
- package/node/debug/debug-elem-types.d.ts +0 -26
- package/node/debug/debug-elem-types.js +0 -22
- package/node/debug/debug-elem-types.js.map +0 -1
- package/node/debug/functions/draw/draw-beziers-as-single-path.d.ts +0 -2
- package/node/debug/functions/draw/draw-beziers-as-single-path.js +0 -30
- package/node/debug/functions/draw/draw-beziers-as-single-path.js.map +0 -1
- package/node/debug/functions/draw/xmlns.d.ts +0 -2
- package/node/debug/functions/draw/xmlns.js +0 -3
- package/node/debug/functions/draw/xmlns.js.map +0 -1
- package/node/debug/functions/draw-elem/bounding-hull.d.ts +0 -3
- package/node/debug/functions/draw-elem/bounding-hull.js +0 -8
- package/node/debug/functions/draw-elem/bounding-hull.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-branch.d.ts +0 -4
- package/node/debug/functions/draw-elem/draw-branch.js +0 -26
- package/node/debug/functions/draw-elem/draw-branch.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-circle-percent.d.ts +0 -3
- package/node/debug/functions/draw-elem/draw-circle-percent.js +0 -13
- package/node/debug/functions/draw-elem/draw-circle-percent.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-cp-node.d.ts +0 -4
- package/node/debug/functions/draw-elem/draw-cp-node.js +0 -26
- package/node/debug/functions/draw-elem/draw-cp-node.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-cull.d.ts +0 -3
- package/node/debug/functions/draw-elem/draw-cull.js +0 -9
- package/node/debug/functions/draw-elem/draw-cull.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-dull-corner.d.ts +0 -4
- package/node/debug/functions/draw-elem/draw-dull-corner.js +0 -10
- package/node/debug/functions/draw-elem/draw-dull-corner.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-elem.d.ts +0 -10
- package/node/debug/functions/draw-elem/draw-elem.js +0 -39
- package/node/debug/functions/draw-elem/draw-elem.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-leaves.d.ts +0 -4
- package/node/debug/functions/draw-elem/draw-leaves.js +0 -34
- package/node/debug/functions/draw-elem/draw-leaves.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-loop.d.ts +0 -4
- package/node/debug/functions/draw-elem/draw-loop.js +0 -11
- package/node/debug/functions/draw-elem/draw-loop.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-loops.d.ts +0 -4
- package/node/debug/functions/draw-elem/draw-loops.js +0 -6
- package/node/debug/functions/draw-elem/draw-loops.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-loose-bounding-box.d.ts +0 -3
- package/node/debug/functions/draw-elem/draw-loose-bounding-box.js +0 -10
- package/node/debug/functions/draw-elem/draw-loose-bounding-box.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-mat.d.ts +0 -4
- package/node/debug/functions/draw-elem/draw-mat.js +0 -34
- package/node/debug/functions/draw-elem/draw-mat.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-max-vertex.d.ts +0 -4
- package/node/debug/functions/draw-elem/draw-max-vertex.js +0 -9
- package/node/debug/functions/draw-elem/draw-max-vertex.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-min-y.d.ts +0 -4
- package/node/debug/functions/draw-elem/draw-min-y.js +0 -10
- package/node/debug/functions/draw-elem/draw-min-y.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-one-prong-at-dull-corner.d.ts +0 -4
- package/node/debug/functions/draw-elem/draw-one-prong-at-dull-corner.js +0 -22
- package/node/debug/functions/draw-elem/draw-one-prong-at-dull-corner.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-one-prong.d.ts +0 -4
- package/node/debug/functions/draw-elem/draw-one-prong.js +0 -13
- package/node/debug/functions/draw-elem/draw-one-prong.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-sharp-corner.d.ts +0 -4
- package/node/debug/functions/draw-elem/draw-sharp-corner.js +0 -10
- package/node/debug/functions/draw-elem/draw-sharp-corner.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-three-prong.d.ts +0 -4
- package/node/debug/functions/draw-elem/draw-three-prong.js +0 -26
- package/node/debug/functions/draw-elem/draw-three-prong.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-tight-bounding-box.d.ts +0 -3
- package/node/debug/functions/draw-elem/draw-tight-bounding-box.js +0 -8
- package/node/debug/functions/draw-elem/draw-tight-bounding-box.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-two-prong.d.ts +0 -4
- package/node/debug/functions/draw-elem/draw-two-prong.js +0 -49
- package/node/debug/functions/draw-elem/draw-two-prong.js.map +0 -1
- package/node/debug/functions/draw-elem/draw-vertex.d.ts +0 -4
- package/node/debug/functions/draw-elem/draw-vertex.js +0 -13
- package/node/debug/functions/draw-elem/draw-vertex.js.map +0 -1
- package/node/find-3-prong/timed-cc.d.ts +0 -3
- package/node/find-3-prong/timed-cc.js +0 -5
- package/node/find-3-prong/timed-cc.js.map +0 -1
- package/node/reconstruct-from-mat/filter-zero-length.d.ts +0 -10
- package/node/reconstruct-from-mat/filter-zero-length.js +0 -14
- package/node/reconstruct-from-mat/filter-zero-length.js.map +0 -1
- package/node/reconstruct-from-mat/get-all-on-loop-by-loop.js.map +0 -1
- package/node/reconstruct-from-mat/get-bezier-piece-length.d.ts +0 -3
- package/node/reconstruct-from-mat/get-bezier-piece-length.js +0 -6
- package/node/reconstruct-from-mat/get-bezier-piece-length.js.map +0 -1
- package/node/reconstruct-from-mat/get-boundary.d.ts +0 -7
- package/node/reconstruct-from-mat/get-boundary.js +0 -18
- package/node/reconstruct-from-mat/get-boundary.js.map +0 -1
- package/node/reconstruct-from-mat/get-matching-beziers.d.ts +0 -10
- package/node/reconstruct-from-mat/get-matching-beziers.js +0 -29
- package/node/reconstruct-from-mat/get-matching-beziers.js.map +0 -1
- package/node/reconstruct-from-mat/get-mbss-by-loop-per-sat.d.ts +0 -6
- package/node/reconstruct-from-mat/get-mbss-by-loop-per-sat.js +0 -10
- package/node/reconstruct-from-mat/get-mbss-by-loop-per-sat.js.map +0 -1
- package/node/reconstruct-from-mat/get-mbss-by-loop-with-opp-arr.d.ts +0 -7
- package/node/reconstruct-from-mat/get-mbss-by-loop-with-opp-arr.js +0 -47
- package/node/reconstruct-from-mat/get-mbss-by-loop-with-opp-arr.js.map +0 -1
- package/node/reconstruct-from-mat/get-sats2.d.ts +0 -10
- package/node/reconstruct-from-mat/get-sats2.js +0 -16
- package/node/reconstruct-from-mat/get-sats2.js.map +0 -1
- package/node/reconstruct-from-mat/is-fully-terminating.d.ts +0 -3
- package/node/reconstruct-from-mat/is-fully-terminating.js +0 -19
- package/node/reconstruct-from-mat/is-fully-terminating.js.map +0 -1
- package/node/reconstruct-from-mat/matched-beziers.d.ts +0 -10
- package/node/reconstruct-from-mat/matched-beziers.js +0 -2
- package/node/reconstruct-from-mat/matched-beziers.js.map +0 -1
- package/node/reconstruct-from-mat/split-tri-path.d.ts +0 -5
- package/node/reconstruct-from-mat/split-tri-path.js +0 -209
- package/node/reconstruct-from-mat/split-tri-path.js.map +0 -1
- package/node/utils/clip.d.ts +0 -2
- package/node/utils/clip.js +0 -6
- package/node/utils/clip.js.map +0 -1
- package/node/utils/time-function-call.d.ts +0 -14
- package/node/utils/time-function-call.js +0 -32
- package/node/utils/time-function-call.js.map +0 -1
- package/src/debug/debug-elem-types.ts +0 -43
- package/src/debug/functions/draw/draw-bezier-pieces.ts +0 -35
- package/src/debug/functions/draw-elem/bounding-hull.ts +0 -18
- package/src/debug/functions/draw-elem/culls.ts +0 -39
- package/src/debug/functions/draw-elem/draw-branch.ts +0 -37
- package/src/debug/functions/draw-elem/draw-circle-percent.ts +0 -23
- package/src/debug/functions/draw-elem/draw-cp-node.ts +0 -46
- package/src/debug/functions/draw-elem/draw-cull.ts +0 -21
- package/src/debug/functions/draw-elem/draw-dull-corner.ts +0 -21
- package/src/debug/functions/draw-elem/draw-elem.ts +0 -64
- package/src/debug/functions/draw-elem/draw-leaves.ts +0 -51
- package/src/debug/functions/draw-elem/draw-loop.ts +0 -16
- package/src/debug/functions/draw-elem/draw-loops.ts +0 -10
- package/src/debug/functions/draw-elem/draw-loose-bounding-box.ts +0 -21
- package/src/debug/functions/draw-elem/draw-mat.ts +0 -43
- package/src/debug/functions/draw-elem/draw-max-vertex.ts +0 -15
- package/src/debug/functions/draw-elem/draw-min-y.ts +0 -18
- package/src/debug/functions/draw-elem/draw-one-prong-at-dull-corner.ts +0 -40
- package/src/debug/functions/draw-elem/draw-one-prong.ts +0 -25
- package/src/debug/functions/draw-elem/draw-sharp-corner.ts +0 -21
- package/src/debug/functions/draw-elem/draw-three-prong.ts +0 -44
- package/src/debug/functions/draw-elem/draw-tight-bounding-box.ts +0 -18
- package/src/debug/functions/draw-elem/draw-two-prong.ts +0 -68
- package/src/debug/functions/draw-elem/draw-vertex.ts +0 -27
- package/src/debug/functions/draw-elem/dull-corner.ts +0 -21
- package/src/debug/functions/draw-elem/leaves.ts +0 -20
- package/src/debug/functions/draw-elem/loop.ts +0 -16
- package/src/debug/functions/draw-elem/loops.ts +0 -10
- package/src/debug/functions/draw-elem/loose-bounding-box.ts +0 -21
- package/src/debug/functions/draw-elem/mat.ts +0 -47
- package/src/debug/functions/draw-elem/max-vertex.ts +0 -15
- package/src/debug/functions/draw-elem/min-y.ts +0 -18
- package/src/debug/functions/draw-elem/one-prong-at-dull-corner.ts +0 -26
- package/src/debug/functions/draw-elem/one-prong.ts +0 -23
- package/src/debug/functions/draw-elem/sharp-corner.ts +0 -20
- package/src/debug/functions/draw-elem/three-prong.ts +0 -30
- package/src/debug/functions/draw-elem/tight-bounding-box.ts +0 -18
- package/src/debug/functions/draw-elem/two-prong.ts +0 -50
- package/src/debug/functions/draw-elem/vertex.ts +0 -51
- package/src/find-3-prong/timed-cc.ts +0 -9
- package/src/reconstruct-from-mat/filter-zero-length.ts +0 -23
- package/src/reconstruct-from-mat/get-bezier-piece-length.ts +0 -12
- package/src/reconstruct-from-mat/get-boundary.ts +0 -32
- package/src/reconstruct-from-mat/get-matching-beziers.ts +0 -46
- package/src/reconstruct-from-mat/get-mbss-by-loop-per-sat.ts +0 -19
- package/src/reconstruct-from-mat/get-mbss-by-loop-with-opp-arr.ts +0 -69
- package/src/reconstruct-from-mat/get-sats2.ts +0 -25
- package/src/reconstruct-from-mat/is-fully-terminating.ts +0 -27
- package/src/reconstruct-from-mat/matched-beziers.ts +0 -14
- package/src/reconstruct-from-mat/split-tri-path.ts +0 -280
package/browser/index.min.js
CHANGED
|
@@ -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 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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}=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+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t=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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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),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: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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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(Ds,u),v=Qs(u,u),m=Qs(u,g),x=Qs(g,g),b=Qs(v,u),w=Qs(v,g),_=Qs(x,u),M=Qs(x,g),S=qs(Ds,f),I=Qs(f,f),N=Qs(f,S),y=Qs(S,S),C=Qs(I,f),O=Qs(I,S),E=Qs(y,f),T=Qs(y,S),A=Vs(u[1]),P=Vs(g[1]),k=Vs(v[1]),B=Vs(m[1]),z=Vs(x[1]),F=Vs(b[1]),L=Vs(w[1]),Y=Vs(_[1]),H=Vs(M[1]),X=Vs(f[1]),$=Vs(S[1]),V=Vs(I[1]),D=Vs(N[1]),q=Vs(y[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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+2*i*l,vᵧ_:2*r*l+o*f,v_:f*(o*u+s*c)+l*l}}(t),v=u?0:1,m=Iu(c),x=Iu(s);if((v+12)*Le*(l*(m*m)+a*(m*x)+p*(x*x)+(h*m+d*x)+g)<Iu(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}}=ii(t),m=Yr(e),x=Yr(r),b=Iu(c),w=Iu(s),_=b/3,M=w/3,S=wu(m,m),I=S[1],N=2*(b*_+I),y=wu(x,x),C=y[1],O=2*(w*M+C),E=wu(m,x),T=Iu(E[1]),A=b*M+_*w+2*T,P=wu(n,S),k=Iu(n[1])*N+a*I+2*Iu(P[1]),B=wu(o,E),z=Iu(o[1])*A+p*T+2*Iu(B[1]),F=wu(i,y),L=Iu(i[1])*O+h*C+2*Iu(F[1]),Y=wu(m,u),H=Iu(u[1])*_+d*b+2*Iu(Y[1]),X=wu(x,f),$=Iu(f[1])*M+g*w+2*Iu(X[1]),V=_u(P,B),D=k+z+Iu(V[1]),q=_u(V,F),j=D+L+Iu(q[1]),W=_u(Y,X),Q=H+$+Iu(W[1]),R=_u(q,W),G=j+Q+Iu(R[1]),U=_u(R,l),Z=G+v+Iu(U[1]);if(Ye*Z<Iu(rt(U)))return!1}{const n=function(t){return Ic(lc(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===ct(Su(Su(Su(Mu(o,Mu(e,e)),Mu(i,Mu(e,r))),Mu(f,Mu(r,r))),Su(Su(Mu(e,l),Mu(r,a)),p)))}}const{abs:yu}=Math,Cu=Wn,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,_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mt[1]),bt=Cu(T,h),wt=Au(h[1])*B+S*P+2*Au(bt[1]),_t=Ou(et,it),Mt=ot+ct+Au(_t[1]),St=Ou(st,ft),It=ut+lt+Au(St[1]),Nt=Ou(_t,St),yt=Mt+It+Au(Nt[1]),Ct=Ou(at,ht),Ot=pt+dt+Au(Ct[1]),Et=Ou(Ct,gt),Tt=Ot+vt+Au(Et[1]),At=Ou(Nt,Et),Pt=yt+Tt+Au(At[1]),kt=Ou(mt,bt),Bt=xt+wt+Au(kt[1]),zt=Ou(kt,d),Ft=Bt+I+Au(zt[1]),Lt=Ou(At,zt),Yt=Pt+Ft+Au(Lt[1]);if(Ye*Yt<Au(rt(Lt)))return!1}{const n=function(t){return Vc(fc(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],n.vᵧᵧᵧ=[0]),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,vᵧᵧ:h,vₓ:d,vᵧ:g,v}=n,m=Eu(e,e),x=Eu(e,m),b=Eu(r,r),w=Eu(r,b),_=Eu(r,m),M=Eu(e,b),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};
|
|
1
|
+
function t(t=[],e){const o=[],r={beziers:t,curves:o,idx:e};if(0===t.length)return r;let c,i=0;for(let e=0;e<t.length;e++){if(n(t[e]))continue;const s={loop:r,ps:t[e],prev:c,next:void 0,idx:i};c&&(c.next=s),c=s,o.push(s),i++}const s=o[o.length-1];return o[0].prev=s,s.next=o[0],s.ps[s.ps.length-1]=o[0].ps[0],r}function n(t){if(t.length<=1)return!0;const n=t[0],e=t[1],o=n[0]===e[0]&&n[1]===e[1];if(2===t.length)return o;const r=t[2],c=e[0]===r[0]&&e[1]===r[1];if(3===t.length)return o&&c;const i=t[3],s=r[0]===i[0]&&r[1]===i[1];return o&&c&&s}function e(t){const n=[];for(let e=0;e<t.length;e++){const o=t[e];0===e&&n.push("M "+o[0][0].toString()+" "+o[0][1].toString()),4===o.length?n.push("C "+o[1][0].toString()+" "+o[1][1].toString()+" "+o[2][0].toString()+" "+o[2][1].toString()+" "+o[3][0].toString()+" "+o[3][1].toString()+" "):3===o.length?n.push("Q "+o[1][0].toString()+" "+o[1][1].toString()+" "+o[2][0].toString()+" "+o[2][1].toString()+" "):2===o.length&&n.push("L "+o[1][0].toString()+" "+o[1][1].toString()+" ")}return n.push(" z"),n.join("\n")}function o(t){const n=[t.p,t.initialPoint];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0,n}function r(t,n,e){function o(e){return[e[0]*n-e[1]*t,e[0]*t+e[1]*n]}return void 0===e?o:o(e)}const{min:c,max:i}=Math;function s(t,n,e){return c(e,i(n,t))}const{abs:u,sqrt:f,asin:l,sin:a,cos:p,tan:h,PI:d}=Math;function v(t,n,e,o,c,i,g,m,x,w){const b=d*g/180;let _,M,S,C,y=[];if(w)_=w[0],M=w[1],S=w[2],C=w[3];else{const h=r(a(-b),p(-b));[t,n]=h([t,n]),[e,o]=h([e,o]);const v=(t-e)/2,g=(n-o)/2;let w=v*v/(c*c)+g*g/(i*i);w>1&&(w=f(w),c*=w,i*=w);const y=c*c,O=i*i,E=(m===x?-1:1)*f(u((y*O-y*g*g-O*v*v)/(y*g*g+O*v*v)));S=E*c*g/i+(t+e)/2,C=E*-i*v/c+(n+o)/2,_=l(s((n-C)/i,-1,1)),M=l(s((o-C)/i,-1,1)),t<S&&(_=d-_),e<S&&(M=d-M),_<0&&(_=2*d+_),M<0&&(M=2*d+M),x&&_>M&&(_-=2*d),!x&&M>_&&(M-=2*d)}let O=M-_;if(u(O)>120*d/180){const t=M,n=e,r=o;M=_+(x&&M>_?1:-1)*d*120/180,y=v(e=S+c*p(M),o=C+i*a(M),n,r,c,i,g,0,x,[M,t,S,C])}O=M-_;const E=p(_),I=a(_),N=p(M),k=a(M),P=h(O/4),B=4/3*c*P,T=4/3*i*P,A=[t,n],z=[t+B*I,n-T*E],L=[e+B*k,o-T*N],D=[e,o];if(z[0]=2*A[0]-z[0],z[1]=2*A[1]-z[1],w)return[z,L,D,...y];const q=[z,L,D,...y].flat(),W=[];let j=[];const F=r(a(b),p(b));return q.forEach(function(t,n){if(n%2){const t=F([q[n-1],q[n]]);j.push(t[1])}else{const t=F([q[n],q[n+1]]);j.push(t[0])}6===j.length&&(W.push(j),j=[])}),W}function g(t){t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0;const n=t.p,e=[t.vals[5],t.vals[6]],o=Math.abs(t.vals[0]),r=Math.abs(t.vals[1]);if(n[0]===e[0]&&n[1]===e[1])return[];if(0===o||0===r)return t.p=e,[[n,e]];const c=v(n[0],n[1],e[0],e[1],o,r,t.vals[2],t.vals[3],t.vals[4]),i=[];let s=n;for(const t of c){const n=[s,[t[0],t[1]],[t[2],t[3]],[t[4],t[5]]];i.push(n),s=n[3]}const u=i[i.length-1];return t.p=u[u.length-1],i}const m={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},x=new Set("MLCQAHVSTZmlcqahvstz");function w(t){if(x.has(t))return"z"===t?"Z":t}const b=/[ \t\n\r\f]/;function _(t){return b.test(t._string[t._currentIndex])}function M(t){for(;t._currentIndex<t._endIndex&&_(t);)t._currentIndex++;return t._currentIndex<t._endIndex}function S(t){return!(t._currentIndex<t._endIndex&&!_(t)&&","!==t._string[t._currentIndex])&&(M(t)&&t._currentIndex<t._endIndex&&","===t._string[t._currentIndex]&&(t._currentIndex++,M(t)),t._currentIndex<t._endIndex)}function C(t){let n=0,e=0,o=1,r=0,c=1,i=1;const s=t._currentIndex;M(t);let u=t._currentIndex;u<t._endIndex&&"+"===t._string[u]?(t._currentIndex++,u++):u<t._endIndex&&"-"===t._string[u]&&(t._currentIndex++,u++,c=-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++,u++;if(u!==l){let n=u-1,o=1;for(;n>=l;)e+=o*(Number(t._string[n])-0),n-=1,o*=10}if(u<t._endIndex&&"."===t._string[u]){if(t._currentIndex++,u++,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";)o*=10,r+=Number(t._string[u])/o,t._currentIndex++,u++}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++,u++,"+"===t._string[u]?(t._currentIndex++,u++):"-"===t._string[u]&&(t._currentIndex++,u++,i=-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++,u++}let a=e+r;return a*=c,n&&(a*=10**(i*n)),S(t),a}function y(t){if(t._currentIndex>=t._endIndex)throw new Error("Unable to parse arc flag");let n;const e=t._string[t._currentIndex];if(t._currentIndex++,"0"===e)n=0;else{if("1"!==e)throw new Error("Unable to parse arc flag - arc flag must be 0 or 1");n=1}return S(t),n}function O(t){const n=t._string[t._currentIndex];let e=w(n);if(void 0===e){if(!("+"===n||"-"===n||"."===n||n>="0"&&n<="9")||"Z"===t._prevCommand)throw new Error("Remaining coordinates not found for implicit command");e="M"===t._prevCommand?"L":"m"===t._prevCommand?"l":t._prevCommand}else t._currentIndex++;t._prevCommand=e;const o=e.toUpperCase();let r;return"H"===o||"V"===o?r=[C(t)]:"M"===o||"L"===o||"T"===o?r=[C(t),C(t)]:"S"===o||"Q"===o?r=[C(t),C(t),C(t),C(t)]:"C"===o?r=[C(t),C(t),C(t),C(t),C(t),C(t)]:"A"===o?r=[C(t),C(t),C(t),y(t),y(t),C(t),C(t)]:(M(t),r=[]),{command:e,values:r}}function E(t){return t._currentIndex<t._endIndex}function I(t){return function(t){if(0===t.length)return[];if("m"!==t[0].command.toLowerCase())throw new Error("Invalid SVG - every new path must start with an M or m.");const n={p:[0,0],initialPoint:void 0,prev2ndCubicControlPoint:void 0,prev2ndQuadraticControlPoint:void 0,vals:void 0},e=[];let r,c=[];for(let i=0;i<t.length;i++){const s=t[i],u=s.command.toLowerCase();if(n.vals=s.values,s.command===u)if("v"===u)n.vals[0]+=n.p[1];else if("a"===u)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"!==u){if("a"===u)c.push(...g(n));else{const t=m[u];if(!t)throw new Error("Invalid SVG - command not recognized.");const e=t(n);n.p=e[e.length-1],c.push(e)}r=u}else c.length&&("z"!==r&&c.push(o(n)),e.push(c),c=[]),n.initialPoint=n.p=n.vals,r=u}return c.length>0&&("z"!==r&&c.push(o(n)),e.push(c)),e}(function(t){if(!t.length)return[];const n={_string:t,_currentIndex:0,_endIndex:t.length,_prevCommand:void 0};if(M(n),!function(t){if(!E(t))return!0;const n=w(t._string[t._currentIndex]);return"M"===n||"m"===n}(n))throw new Error("Path must start with m or M");const e=[];for(;E(n);)e.push(O(n));return e}(t))}function N(t){const n=t.length,e=Array.from(Array(n),()=>new Array(n).fill(0));for(let o=0;o<n;o++)for(let r=0;r<n;r++)e[o][r]=t[o][r];for(let t=0;t<n;t++)for(let o=0;o<n;o++)for(let r=0;r<n;r++)e[o][t]+e[t][r]<e[o][r]&&(e[o][r]=e[o][t]+e[t][r]);return e}function k(t){const n=t,e=[];do{e.push(t),t=t.next}while(t!==n);return e}function P(t){return k(t).filter(t=>t.isHoleClosing)}function B(t){const n=t.pointOnShape;return{idx:n.curve.idx,t:n.t,order:n.order,order2:n.order2}}function T(t){const n=t;let e=n,o=0;do{o++,e=e.nextOnCircle}while(e!==n);return o}function A(t,n=!1){const e=t,o=n?[]:[t];let r=t.nextOnCircle;for(;r!==e;)o.push(r),r=r.nextOnCircle;return o}function z(t){return t===t.next.prevOnCircle}function L(t){return A(t).filter(t=>!z(t)).length}function D(t){return A(t).every(z)}function q(t){if(!z(t))return!1;if(D(t))return!0;for(;t.prev===t.prevOnCircle;)t=t.prev;return A(t.prevOnCircle,!0).every(z)}function W(t){return 0===t.pointOnShape.circle.radius}function j(t){const n=t.pointOnShape,e=n.curve;return{...t,pos:n,p:n.p,t:n.t,isTerminating:z(t),isFullyTerminating:q(t),isSharp:W(t),prongCount:T(t),getRealProngCount:L(t),ordering:B(t),curve:e,loop:e.loop}}function F(t){let n=t;if(z(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 H(t,n){const e=k(t),o=new Set;for(t of e)z(t)||o.has(t.next.prevOnCircle)||n(t),o.add(t)}function Y(t){const n=[],e=t;let o=e;for(;o!==e.prevOnCircle;)z(o)||n.push(o.next),o=o.nextOnCircle;return n}function R(t,n){n(t);const e=A(t).filter(t=>!z(t)).map(t=>t.next);for(const t of e){const e=[t];for(;e.length;){const t=e.pop();n(t),e.push(...Y(t))}}}const X=["prev","next","prevOnCircle","nextOnCircle","holeCloserTwin"];function Q(t){const n=new Map,e=V(t);n.set(t,e);const o=[{cpNode:t,newCpNode:e}];for(;o.length;){const{cpNode:t,newCpNode:e}=o.pop();for(const r of X){const c=t[r];if(void 0===c)continue;let i=n.get(c);i||(i=V(c),n.set(c,i),o.push({cpNode:c,newCpNode:i})),e[r]=i}}return e}function V(t){return{...t,prev:void 0,next:void 0,prevOnCircle:void 0,nextOnCircle:void 0,holeCloserTwin:void 0}}function $(t){const n=t,e=t.next,o=n.pointOnShape,r=e.pointOnShape,c=o.curve,i=r.curve;if(c.loop!==i.loop)return[];const s=[];return i===c?s.push({ps:o.curve.ps,ts:[o.t,r.t]}):(s.push({ps:o.curve.ps,ts:[o.t,1]}),function(t,n,e,o){let r=n;do{r=r.next;const n=r===e?o:1;t.push({ps:r.ps,ts:[0,n]})}while(r!==e)}(s,o.curve,r.curve,r.t)),s}function U(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],o=t[1],r=t[2],c=t[3],i=e[0],s=e[1],u=o[0],f=o[1],l=r[0],a=r[1],p=i-n*(i-u),h=u-n*(u-l),d=p-n*(p-h),v=s-n*(s-f),g=f-n*(f-a),m=v-n*(v-g);return[e,[p,v],[d,m],[d-n*(d-(h-n*(h-(l-n*(l-c[0]))))),m-n*(m-(g-n*(g-(a-n*(a-c[1])))))]]}(t,e):1===e?function(t,n){const e=t[0],o=t[1],r=t[2],c=t[3],i=e[0],s=e[1],u=o[0],f=o[1],l=r[0],a=r[1],p=i-n*(i-u),h=u-n*(u-l),d=l-n*(l-c[0]),v=p-n*(p-h),g=h-n*(h-d),m=s-n*(s-f),x=f-n*(f-a),w=a-n*(a-c[1]),b=m-n*(m-x),_=x-n*(x-w);return[[v-n*(v-g),b-n*(b-_)],[g,_],[d,w],c]}(t,n):function(t,n,e){const o=t[0],r=t[1],c=t[2],i=t[3],s=o[0],u=o[1],f=r[0],l=r[1],a=c[0],p=c[1],h=n*n,d=n*h,v=e*e,g=e*v,m=n*e,x=s-f,w=a-f,b=x+w,_=n*x,M=e*x,S=i[0]-s-3*w,C=u-l,y=p-l,O=C+y,E=n*C,I=e*C,N=i[1]-u-3*y;return[[d*S+(3*n*(n*b-x)+s),d*N+(3*n*(n*O-C)+u)],[m*(n*S+2*b)+(h*b+s-(M+2*_)),m*(n*N+2*O)+(h*O+u-(I+2*E))],[m*(e*S+2*b)+(v*b+s-(2*M+_)),m*(e*N+2*O)+(v*O+u-(2*I+E))],[g*S+(3*e*(e*b-x)+s),g*N+(3*e*(e*O-C)+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],o=t[1],r=t[2],c=e[0],i=e[1],s=o[0],u=o[1],f=n*n,l=c-s,a=i-u;return[e,[-n*l+c,-n*a+i],[f*(l+(r[0]-s))-(2*n*l-c),f*(a+(r[1]-u))-(2*n*a-i)]]}(t,e):1===e?function(t,n){const e=t[0],o=t[1],r=t[2],c=e[0],i=e[1],s=o[0],u=o[1],f=n*n,l=c-s,a=r[0]-s,p=i-u,h=r[1]-u;return[[f*(l+a)-(2*n*l-c),f*(p+h)-(2*n*p-i)],[n*a+s,n*h+u],r]}(t,n):function(t,n,e){const o=t[0],r=t[1],c=t[2],i=o[0],s=o[1],u=r[0],f=r[1],l=n*n,a=e*e,p=n*e,h=i-u,d=h+(c[0]-u),v=s-f,g=v+(c[1]-f);return[[l*d-(2*n*h-i),l*g-(2*n*v-s)],[p*d-(h*(e+n)-i),p*g-(v*(e+n)-s)],[a*d-(2*e*h-i),a*g-(2*e*v-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],o=t[1],r=e[0],c=e[1];return[e,[n*(o[0]-r)+r,n*(o[1]-c)+c]]}(t,e):1===e?function(t,n){const e=t[0],o=t[1],r=e[0],c=e[1];return[[n*(o[0]-r)+r,n*(o[1]-c)+c],o]}(t,n):function(t,n,e){const o=t[0],r=t[1],c=o[0],i=o[1],s=r[0],u=r[1];return[[n*(s-c)+c,n*(u-i)+i],[e*(s-c)+c,e*(u-i)+i]]}(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 Z(t){return $(t).map(t=>U(t.ps,t.ts[0],t.ts[1]))}function G(t,n){const{cpTrees:e}=n,o=t.prev,r=t.next;o.next=r,r.prev=o,e.get(t.pointOnShape.curve.loop).remove(t,!1)}function J(t,n){const e=T(t);if(2!==e)throw new Error(`Cannot delete \`CpNode\` on ${e}-prong`);A(t).forEach(t=>G(t,n))}function K(t){const n=[],e=t.next;let o=e;do{n.push(o),o=o.nextOnCircle}while(o.nextOnCircle!==e);return n}function tt(t,n,e){if(void 0===t.size||void 0===e)return;const o=e[n];if(t.size>o&&void 0!==o)for(const[n]of t){t.delete(n);break}}const nt=[function(t,n){let e,o=!1;return function(){return o||(e=t(),o=!0),e}},function(t,n,e=!1){const o=new WeakMap,r=new Map;function c(t){return"object"!=typeof t&&"function"!=typeof t||null===t?r:o}const i=function(o){let i;const s=c(o);return s.has(o)?(e&&console.log("cache hit"),i=s.get(o)):(e&&console.log("cache miss"),i=t(o),s.set(o,i),tt(r,0,n)),i};return i.mapS=r,i.weakMapS=o,i.clearCache=function(){r.clear()},i.addToCache=function(t,e){const o=c(e);o.set(e,t),tt(o,1,n)},i},function(t,n){const e=new WeakMap,o=new Map;function r(t,r){const c=("object"==typeof r||"function"==typeof r)&&null!==r;let i="object"!=typeof t&&"function"!=typeof t||null===t?o:e,s=i.get(t);return void 0===s&&(s={weakMap:new WeakMap,map:new Map},i.set(t,s),tt(i,0,n)),c?s.weakMap:s.map}function c(e,o){const c=r(e,o);let i;return c.has(o)?i=c.get(o):(i=t(e,o),c.set(o,i),tt(c,1,n)),i}return c.mapS=o,c.weakMapS=e,c.clearCache=function(){o.clear()},c.addToCache=function(t,e,o){const c=r(e,o);c.set(o,t),tt(c,1,n)},c},function(t,n){const e=new WeakMap,o=new Map;function r(t,r,c){const i=("object"==typeof r||"function"==typeof r)&&null!==r,s=("object"==typeof c||"function"==typeof c)&&null!==c;let u="object"!=typeof t&&"function"!=typeof t||null===t?o:e,f=u.get(t);void 0===f&&(f={weakMap:new WeakMap,map:new Map},u.set(t,f),tt(u,0,n));const l=i?f.weakMap:f.map;let a=l.get(r);return void 0===a&&(a={weakMap:new WeakMap,map:new Map},l.set(r,a),tt(l,1,n)),s?a.weakMap:a.map}const c=function(e,o,c){const i=r(e,o,c);let s;return i.has(c)?s=i.get(c):(s=t(e,o,c),i.set(c,s),tt(i,2,n)),s};return c.mapS=o,c.weakMapS=e,c.clearCache=function(){o.clear()},c.addToCache=function(t,e,o,c){const i=r(e,o,c);i.set(c,t),tt(i,2,n)},c},function(t,n,e=!1){const o=new WeakMap,r=new Map;function c(t,e,c,i){const s=("object"==typeof e||"function"==typeof e)&&null!==e,u=("object"==typeof c||"function"==typeof c)&&null!==c,f=("object"==typeof i||"function"==typeof i)&&null!==i;let l="object"!=typeof t&&"function"!=typeof t||null===t?r:o,a=l.get(t);void 0===a&&(a={weakMap:new WeakMap,map:new Map},l.set(t,a),tt(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),tt(p,1,n));const d=u?h.weakMap:h.map;let v=d.get(c);return void 0===v&&(v={weakMap:new WeakMap,map:new Map},d.set(c,v),tt(d,2,n)),f?v.weakMap:v.map}const i=function(o,r,i,s){const u=c(o,r,i,s);let f;return u.has(s)?(e&&console.log("cache hit"),f=u.get(s)):(e&&console.log("cache miss"),f=t(o,r,i,s),u.set(s,f),tt(u,3,n)),f};return i.mapS=r,i.weakMapS=o,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,o,r,i){const s=c(e,o,r,i);s.set(i,t),tt(s,3,n)},i},function(t,n){const e=new WeakMap,o=new Map;function r(t,r,c,i,s){const u=("object"==typeof r||"function"==typeof r)&&null!==r,f=("object"==typeof c||"function"==typeof c)&&null!==c,l=("object"==typeof i||"function"==typeof i)&&null!==i,a=("object"==typeof s||"function"==typeof s)&&null!==s;let p="object"!=typeof t&&"function"!=typeof t||null===t?o:e,h=p.get(t);void 0===h&&(h={weakMap:new WeakMap,map:new Map},p.set(t,h),tt(p,0,n));const d=u?h.weakMap:h.map;let v=d.get(r);void 0===v&&(v={weakMap:new WeakMap,map:new Map},d.set(r,v),tt(d,1,n));const g=f?v.weakMap:v.map;let m=g.get(c);void 0===m&&(m={weakMap:new WeakMap,map:new Map},g.set(c,m),tt(g,2,n));const x=l?m.weakMap:m.map;let w=x.get(i);return void 0===w&&(w={weakMap:new WeakMap,map:new Map},x.set(i,w),tt(x,3,n)),a?w.weakMap:w.map}const c=function(e,o,c,i,s){const u=r(e,o,c,i,s);let f;return u.has(s)?f=u.get(s):(f=t(e,o,c,i,s),u.set(s,f),tt(u,4,n)),f};return c.mapS=o,c.weakMapS=e,c.clearCache=function(){o.clear()},c.addToCache=function(t,e,o,c,i,s){const u=r(e,o,c,i,s);u.set(s,t),tt(u,4,n)},c},function(t,n){const e=new WeakMap,o=new Map;function r(t,r,c,i,s,u){const f=("object"==typeof r||"function"==typeof r)&&null!==r,l=("object"==typeof c||"function"==typeof c)&&null!==c,a=("object"==typeof i||"function"==typeof i)&&null!==i,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?o:e,v=d.get(t);void 0===v&&(v={weakMap:new WeakMap,map:new Map},d.set(t,v),tt(d,0,n));const g=f?v.weakMap:v.map;let m=g.get(r);void 0===m&&(m={weakMap:new WeakMap,map:new Map},g.set(r,m),tt(g,1,n));const x=l?m.weakMap:m.map;let w=x.get(c);void 0===w&&(w={weakMap:new WeakMap,map:new Map},x.set(c,w),tt(x,2,n));const b=a?w.weakMap:w.map;let _=b.get(i);void 0===_&&(_={weakMap:new WeakMap,map:new Map},b.set(i,_),tt(b,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),tt(M,4,n)),h?S.weakMap:S.map}const c=function(e,o,c,i,s,u){const f=r(e,o,c,i,s,u);let l;return f.has(u)?l=f.get(u):(l=t(e,o,c,i,s,u),f.set(u,l),tt(f,5,n)),l};return c.mapS=o,c.weakMapS=e,c.clearCache=function(){o.clear()},c.addToCache=function(t,e,o,c,i,s,u){const f=r(e,o,c,i,s,u);f.set(u,t),tt(f,5,n)},c},function(t,n){const e=new WeakMap,o=new Map;function r(t,r,c,i,s,u,f){const l=("object"==typeof r||"function"==typeof r)&&null!==r,a=("object"==typeof c||"function"==typeof c)&&null!==c,p=("object"==typeof i||"function"==typeof i)&&null!==i,h=("object"==typeof s||"function"==typeof s)&&null!==s,d=("object"==typeof u||"function"==typeof u)&&null!==u,v=("object"==typeof f||"function"==typeof f)&&null!==f;let g="object"!=typeof t&&"function"!=typeof t||null===t?o:e,m=g.get(t);void 0===m&&(m={weakMap:new WeakMap,map:new Map},g.set(t,m),tt(g,0,n));const x=l?m.weakMap:m.map;let w=x.get(r);void 0===w&&(w={weakMap:new WeakMap,map:new Map},x.set(r,w),tt(x,1,n));const b=a?w.weakMap:w.map;let _=b.get(c);void 0===_&&(_={weakMap:new WeakMap,map:new Map},b.set(c,_),tt(b,2,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),tt(M,3,n));const C=h?S.weakMap:S.map;let y=C.get(s);void 0===y&&(y={weakMap:new WeakMap,map:new Map},C.set(s,y),tt(C,4,n));const O=d?y.weakMap:y.map;let E=O.get(u);return void 0===E&&(E={weakMap:new WeakMap,map:new Map},O.set(u,E),tt(O,5,n)),v?E.weakMap:E.map}const c=function(e,o,c,i,s,u,f){const l=r(e,o,c,i,s,u,f);let a;return l.has(f)?a=l.get(f):(a=t(e,o,c,i,s,u,f),l.set(f,a),tt(l,6,n)),a};return c.mapS=o,c.weakMapS=e,c.clearCache=function(){o.clear()},c.addToCache=function(t,e,o,c,i,s,u,f){const l=r(e,o,c,i,s,u,f);l.set(f,t),tt(l,6,n)},c},function(t,n){const e=new WeakMap,o=new Map;function r(t,r,c,i,s,u,f,l){const a=("object"==typeof r||"function"==typeof r)&&null!==r,p=("object"==typeof c||"function"==typeof c)&&null!==c,h=("object"==typeof i||"function"==typeof i)&&null!==i,d=("object"==typeof s||"function"==typeof s)&&null!==s,v=("object"==typeof u||"function"==typeof u)&&null!==u,g=("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?o:e,w=x.get(t);void 0===w&&(w={weakMap:new WeakMap,map:new Map},x.set(t,w),tt(x,0,n));const b=a?w.weakMap:w.map;let _=b.get(r);void 0===_&&(_={weakMap:new WeakMap,map:new Map},b.set(r,_),tt(b,1,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),tt(M,2,n));const C=h?S.weakMap:S.map;let y=C.get(i);void 0===y&&(y={weakMap:new WeakMap,map:new Map},C.set(i,y),tt(C,3,n));const O=d?y.weakMap:y.map;let E=O.get(s);void 0===E&&(E={weakMap:new WeakMap,map:new Map},O.set(s,E),tt(O,4,n));const I=v?E.weakMap:E.map;let N=I.get(u);void 0===N&&(N={weakMap:new WeakMap,map:new Map},I.set(u,N),tt(I,5,n));const k=g?N.weakMap:N.map;let P=k.get(f);return void 0===P&&(P={weakMap:new WeakMap,map:new Map},k.set(f,P),tt(k,6,n)),m?P.weakMap:P.map}const c=function(e,o,c,i,s,u,f,l){const a=r(e,o,c,i,s,u,f,l);let p;return a.has(l)?p=a.get(l):(p=t(e,o,c,i,s,u,f,l),a.set(l,p),tt(a,7,n)),p};return c.mapS=o,c.weakMapS=e,c.clearCache=function(){o.clear()},c.addToCache=function(t,e,o,c,i,s,u,f,l){const a=r(e,o,c,i,s,u,f,l);a.set(l,t),tt(a,7,n)},c}];function et(t,n,e=!1){const o=t.length;if(o>8)throw new Error("A maximum of 8 formal parameters are supported");return(0,nt[o])(t,n,e)}function ot(t,n){const[[e,o],[r,c]]=t,[[i,s],[u,f]]=n,l=r-e,a=c-o,p=u-i,h=f-s,d=p*a-h*l;if(0===d)return;const v=((s-o)*l-(i-e)*a)/d;return[i+v*p,s+v*h]}function rt(t,n){return[n[0]-t[0],n[1]-t[1]]}function ct(t,n){return t[0]*n[0]+t[1]*n[1]}function it(t){return[-t[1],t[0]]}function st(t,n){return t[0]*n[1]-t[1]*n[0]}function ut(t,n,e){return[t[0]+(n[0]-t[0])*e,t[1]+(n[1]-t[1])*e]}function ft(t,n){function e(n){return[t[0]+n[0],t[1]+n[1]]}return void 0===n?e:e(n)}function lt(t){const n=1/Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]*n,t[1]*n]}function at(t,n){let e=0;for(let o=0;o<t.length;o++)e=e*n+t[o];return e}function pt(t){if(4===t.length)return function(t){const[[n,e],[o,r],[c,i],[s,u]]=t;return[[3*(s-n+3*(o-c)),6*(c+n-2*o),3*(o-n)],[3*(u-e+3*(r-i)),6*(i+e-2*r),3*(r-e)]]}(t);if(3===t.length)return function(t){const[[n,e],[o,r],[c,i]]=t;return[[2*(c+n-2*o),2*(o-n)],[2*(i+e-2*r),2*(r-e)]]}(t);if(2===t.length)return function(t){const[[n,e],[o,r]]=t;return[[o-n],[r-e]]}(t);if(1===t.length)return[[0],[0]];throw new Error("The bezier curve must be of order <= 3.")}function ht(t,n){const[e,o]=pt(t);return[at(e,n),at(o,n)]}function dt(t,n){const e=t-n,o=t-e;return[t-(e+o)+(o-n),e]}function vt(t,n){const e=t.length,o=n.length;let r=0,c=0;const i=[];for(;r<e&&c<o;)0!==t[r]?0!==n[c]?Math.abs(t[r])<=Math.abs(n[c])?(i.push(t[r]),r++):(i.push(n[c]),c++):c++:r++;for(;r<e;)i.push(t[r]),r++;for(;c<o;)i.push(n[c]),c++;if(0===i.length)return[0];const s=i.length;if(1===s)return i;const u=[],f=i[1],l=i[0];let a=f+l;const p=l-(a-f);0!==p&&u.push(p),c=0;for(let t=2;t<s;t++){const n=i[t],e=a+n,o=e-a,r=a-(e-o)+(n-o);0!==r&&u.push(r),a=e}return 0===a&&0!==u.length||u.push(a),u}const gt=134217729;function mt(t,n){const e=t.length;let o;const r=t[0];let c=r*n;const i=gt*r,s=i-(i-r),u=r-s,f=gt*n,l=f-(f-n),a=n-l,p=[],h=u*a-(c-s*l-u*l-s*a);0!==h&&p.push(h);for(let r=1;r<e;r++){const e=t[r],i=e*n,s=gt*e,u=s-(s-e),f=e-u,l=gt*n,a=l-(l-n),h=n-a,d=f*h-(i-u*a-f*a-u*h),v=c+d,g=v-c,m=c-(v-g)+(d-g);0!==m&&p.push(m),o=v;const x=i+o,w=o-(x-i);0!==w&&p.push(w),c=x}return 0===c&&0!==p.length||p.push(c),p}function xt(t,n){const e=n.length;let o;const r=n[0];let c=r*t;const i=gt*r,s=i-(i-r),u=r-s,f=gt*t,l=f-(f-t),a=t-l,p=[],h=u*a-(c-s*l-u*l-s*a);0!==h&&p.push(h);for(let r=1;r<e;r++){const e=n[r],i=e*t,s=gt*e,u=s-(s-e),f=e-u,l=gt*t,a=l-(l-t),h=t-a,d=f*h-(i-u*a-f*a-u*h),v=c+d,g=v-c,m=c-(v-g)+(d-g);0!==m&&p.push(m),o=v;const x=i+o,w=o-(x-i);0!==w&&p.push(w),c=x}return 0===c&&0!==p.length||p.push(c),p}function wt(t,n){let e=[0];for(let o=0;o<t.length;o++)e=vt(e,mt(n,t[o]));return e}function bt(t){let n=t[0];for(let e=1;e<t.length;e++)n+=t[e];return n}function _t(t){const n=t.length,e=new Array(n);for(let o=0;o<n;o++)e[o]=-t[o];return e}function Mt(t,n){return vt(t,_t(n))}function St(t){return t[t.length-1]}const Ct=dt,yt=xt;function Ot(t){if(4===t.length){const[[n,e],[o,r]]=t;return[yt(3,Ct(o,n)),yt(3,Ct(r,e))]}if(3===t.length){const[[n,e],[o,r]]=t;return[Ct(2*o,2*n),Ct(2*r,2*e)]}if(2===t.length){const[[n,e],[o,r]]=t;return[Ct(o,n),Ct(r,e)]}if(1===t.length)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3.")}function Et(t,n){const e=t+n,o=e-t;return[t-(e-o)+(n-o),e]}function It(t,n){const e=t.length;let o=n;const r=[];for(let n=0;n<e;n++){const e=t[n],c=o+e,i=c-o,s=o-(c-i)+(e-i);0!==s&&r.push(s),o=c}return 0===o&&0!==r.length||r.push(o),r}const Nt=Et,kt=xt,Pt=It;function Bt(t){if(4===t.length){const[[n,e],[o,r],[c,i]]=t;return[kt(6,Pt(Nt(c,n),-2*o)),kt(6,Pt(Nt(i,e),-2*r))]}if(3===t.length){const[[n,e],[o,r],[c,i]]=t;return[Pt(Nt(2*c,2*n),-4*o),Pt(Nt(2*i,2*e),-4*r)]}if(t.length<=2)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3")}const Tt=dt,At=xt,zt=vt;function Lt(t){if(4===t.length){const[[n,e],[o,r],[c,i],[s,u]]=t;return[[At(6,zt(Tt(s,n),At(3,Tt(o,c))))],[At(6,zt(Tt(u,e),At(3,Tt(r,i))))]]}if(t.length<=3)return[[[0]],[[0]]];throw new Error("The given bezier curve must be of order <= 3.")}const{sign:Dt}=Math;function qt(t,n){const[e,o]=Ot(t),[r,c]=Bt(t),[i,s]=Ot(n),[u,f]=Bt(n),l=Mt(wt(e,c),wt(o,r)),a=Mt(wt(i,f),wt(s,u)),p=St(l),h=St(a);if(Dt(p)!==Dt(h))return p-h;const d=vt(wt(i,i),wt(s,s)),v=vt(wt(e,e),wt(o,o)),g=wt(d,d),m=wt(g,d),x=wt(v,v),w=wt(x,v);if(0!==p||0!==h){const t=wt(l,l),n=wt(a,a),e=St(Mt(wt(t,m),wt(n,w)));if(0!==e)return p>0?e:-e}const[[b],[_]]=Lt(t),[[M],[S]]=Lt(n),C=Mt(wt(e,_),wt(o,b)),y=vt(wt(e,r),wt(o,c)),O=Mt(wt(i,S),wt(s,M)),E=vt(wt(i,u),wt(s,f)),I=Mt(wt(v,C),mt(wt(l,y),3)),N=Mt(wt(d,O),mt(wt(a,E),3)),k=St(I),P=St(N);if(k!==P)return k-P;if(0===k&&0===P)return 0;const B=wt(I,I),T=wt(g,m),A=wt(N,N),z=wt(x,w),L=St(Mt(wt(B,T),wt(A,z)));return k>0?L:-L}function Wt(t,n){return t[0]===n[0]&&t[1]===n[1]}function jt(t,n){const{ccw:e,tangentI:o,tangentO:r,dotTangents:c}=function(t,n){const e=t.length;let o=t[e-2],r=n[0],c=n[1];Wt(o,r)&&(o=t[e-3]),Wt(r,c)&&(c=n[2]);const i=function(t,n,e){const o=dt(t[0],e[0]),r=dt(n[1],e[1]),c=dt(t[1],e[1]),i=dt(n[0],e[0]);return bt(vt(wt(o,r),_t(wt(c,i))))}(o,r,c),s=[dt(r[0],o[0]),dt(r[1],o[1])],u=[dt(c[0],r[0]),dt(c[1],r[1])],f=function(t,n){return bt(vt(wt(t[0],n[0]),wt(t[1],n[1])))}(s,u);return 0!==i||f>0?{ccw:i,tangentI:s,tangentO:u,dotTangents:f}:{ccw:qt(t.slice().reverse(),n),tangentI:s,tangentO:u,dotTangents:f}}(t,n),i=e<0,s=e>0,u=[lt(o.map(t=>t[1])),lt(r.map(t=>t[1]))],f=st(u[0],u[1]);let l,a;return c>0?(l=f<-.0698,a=f>.0698):(l=i,a=s),{tangents:u,isSharp:i,isDull:s,isQuiteSharp:l,isQuiteDull:a}}const Ft=et(function(t){const{t:n,curve:e}=t;return jt(1===n?e.ps:e.prev.ps,1===n?e.next.ps:e.ps)});function Ht(t){return 0===t.t||1===t.t}function Yt(t){return!!Ht(t)&&Ft(t).isSharp}function Rt(t){const n=t.pointOnShape.circle.center,e=t,o=t.nextOnCircle,c=e.pointOnShape,i=o.pointOnShape,s=c.p,u=i.p;let f;if(Yt(c)){let t,n;0===c.t?(t=c.curve,n=c.curve.prev):1===c.t&&(t=c.curve.next,n=c.curve);const e=lt(ht(t.ps,0)),o=[-(l=lt(ht(n.ps,1)))[0],-l[1]],i=ct(e,o),s=Math.sqrt((1+i)/2);f=r(Math.sqrt((1-i)/2),s,o)}else f=s[0]===u[0]&&s[1]===u[1]?rt(s,n):it(rt(s,u));var l;return[n,ft(lt(f),n)]}const{abs:Xt}=Math,Qt=1e-4;function Vt(t,n){const e=t.pointOnShape.circle.center,o=Rt(t),r=n.pointOnShape.circle.center,c=Rt(n.prevOnCircle),i=ot(o,c),s=rt(e,r);let u;if(i){const t=rt(e,i),n=rt(r,i);u=ct(t,s)<0||ct(n,s)>0}else u=!0;if(!u)return[e,i,r];const f=it(s),l=rt(o[0],o[1]),a=rt(c[0],c[1]),p=Xt(st(s,l))/9,h=Xt(st(s,a))/9;if(p>.01||h>.01)return[e,r];if(p>Qt||h>Qt){const t=ut(e,r,1/3),n=ut(e,r,2/3),i=ft(f,t),s=[n,ft(f,n)];return[e,ot(o,[t,i]),ot(c,s),r]}return[e,r]}function $t(t){return Vt(t,t.next)}function Ut(t){const n=t;let e=n;for(;e.next===e.prevOnCircle;)if(e=e.next,e===n)return;return e}function Zt(t,n){return A(t).indexOf(n)>=0}function Gt(t){return 1===L(t)&&!t.isHoleClosing}function Jt(t){return 2===L(t)}function Kt(t){if(D(t))return[];for(;z(t);)t=t.nextOnCircle;for(t=t.next;2===L(t);)t=t.next;t=t.prevOnCircle;const n=[];do{n.push(t),t=t.next}while(!q(t)&&2===L(t));return n}function tn(t){return Kt(t).map(t=>$t(t))}function nn(t,n){const e=n[0]-t[0],o=n[1]-t[1];return Math.sqrt(e*e+o*o)}function en(t,n){const[e,o]=t,[[r,c],[i,s]]=n;return nn([r+e*(i-r),c+e*(s-c)],[r+o*(i-r),c+o*(s-c)])}function on(t,n,e=16){if(n[0]===n[1])return 0;const{weights:o,abscissas:r}=rn[e],[c,i]=n;let s=0;const u=(i-c)/2,f=(i+c)/2;for(let n=0;n<=e-1;n++)s+=o[n]*t(u*r[n]+f);return u*s}et($t);const rn={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:cn}=Math;function sn(t){const[n,e]=pt(t);return function(t){const o=at(n,t),r=at(e,t);return cn(o*o+r*r)}}const{abs:un}=Math,fn=[[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],o=t[1],r=t[2],c=e[0],i=e[1],s=o[0],u=o[1],f=r[0],l=r[1],a=n*n,p=c-s,h=i-u,d=[[c,i],[-n*p+c,-n*h+i],[a*(p+(f-s))-(2*n*p-c),a*(h+(l-u))-(2*n*h-i)]],v=un(n),g=un(c),m=un(s),x=un(f),w=g+m,b=un(i),_=un(u),M=b+_;return{ps:d,_ps:[[0,0],[v*w+g,v*M+b],[a*(w+(x+m))+(2*v*w+g),a*(M+(un(l)+_))+(2*v*M+b)]]}}(t,e):1===e?function(t,n){const e=t[0],o=t[1],r=t[2],c=e[0],i=e[1],s=o[0],u=o[1],f=r[0],l=r[1],a=n*n,p=c-s,h=f-s,d=i-u,v=l-u,g=[[a*(p+h)-(2*n*p-c),a*(d+v)-(2*n*d-i)],[n*h+s,n*v+u],[f,l]],m=un(n),x=un(c),w=un(s),b=x+w,_=un(f)+w,M=un(i),S=un(u),C=M+S;return{ps:g,_ps:[[a*(b+_)+(2*m*b+x),a*(C+(un(l)+S))+(2*m*C+M)],[m*_+w,0],[0,0]]}}(t,n):function(t,n,e){const o=t[0],r=t[1],c=t[2],i=o[0],s=o[1],u=r[0],f=r[1],l=c[0],a=c[1],p=n*n,h=e*e,d=n*e,v=i-u,g=v+(l-u),m=s-f,x=m+(a-f),w=p*g-(2*n*v-i),b=d*g-(v*(e+n)-i),_=h*g-(2*e*v-i),M=p*x-(2*n*m-s),S=d*x-(m*(e+n)-s),C=h*x-(2*e*m-s),y=un(n),O=un(e),E=un(d),I=un(i),N=un(u),k=I+N,P=k+un(l)+N,B=un(s),T=un(f),A=B+T,z=A+un(a)+T;return{ps:[[w,M],[b,S],[_,C]],_ps:[[p*P+(2*y*k+I),p*z+(2*y*A+B)],[E*P+(k*(O+y)+I),E*x+(A*(O+y)+B)],[h*P+(2*O*k+I),h*z+(2*O*A+B)]]}}(t,n,e)}const an=134217729;function pn(t,n){const e=t*n,o=an*t,r=o-(o-t),c=t-r,i=an*n,s=i-(i-n),u=n-s;return[c*u-(e-r*s-c*s-r*u),e]}function hn(t,n){const e=t[0],o=t[1],r=n[0],c=n[1],i=o+c,s=i-o,u=e+r,f=u-e,l=o-(i-s)+(c-s)+u,a=i+l,p=e-(u-f)+(r-f)+(l-(a-i)),h=a+p;return[p-(h-a),h]}function dn(t,n){const e=t[0],o=t[1],r=n[0],c=n[1],i=o-c,s=i-o,u=e-r,f=u-e,l=o-(i-s)+(-c-s)+u,a=i+l,p=e-(u-f)+(-r-f)+(l-(a-i)),h=a+p;return[p-(h-a),h]}const{atan2:vn}=Math,gn=pn;function mn(t,n){const e=t[0],o=t[1],r=n[0],c=n[1],i=dn(gn(c,e),gn(r,o))[1],s=hn(gn(r,e),gn(c,o))[1];return vn(i,s)}const{abs:xn}=Math;function wn(t){const n=[];for(let e=0;e<t.length-1;e++){const o=[t[e+1][0]-t[e][0],t[e+1][1]-t[e][1]];0!==(0!==o[0]||o[1])&&n.push(o)}const e=n.length;let o=0;for(let t=0;t<e-1;t++)o+=xn(mn(n[t],n[t+1]));return o}function bn(t,n=.4,e=2**-16){const o=[0],r=[1];for(;;){const c=o[o.length-1],i=r[r.length-1];if(wn(U(t,c,i))<=n||i-c<=e){if(o.push(r.pop()),1===i)return o;continue}const s=(c+i)/2;r.push(s)}}const{sqrt:_n,log:Mn}=Math;function Sn(t,n,e=.4,o=16){const r=t[0],c=t[1];if(r===c)return 0;const[[i,s],[u,f],[l,a]]=n;if(i===u&&u===l&&s===f&&f===a)return 0;const p=ln(n,r,c).ps,h=bn(p,e);let d=0;for(let t=0;t<h.length-1;t++){const n=h[t],e=h[t+1];d+=on(sn(p),[n,e],o)}return d}const{abs:Cn}=Math,yn=[[0,0],[0,0],[0,0],[0,0]];function On(t,n,e){return 0===n?1===e?{ps:t,_ps:yn}:function(t,n){const e=t[0],o=t[1],r=t[2],c=t[3],i=e[0],s=e[1],u=o[0],f=o[1],l=r[0],a=r[1],p=c[0],h=c[1],d=i-n*(i-u),v=u-n*(u-l),g=d-n*(d-v),m=g-n*(g-(v-n*(v-(l-n*(l-p))))),x=s-n*(s-f),w=f-n*(f-a),b=x-n*(x-w),_=b-n*(b-(w-n*(w-(a-n*(a-h))))),M=Cn(n),S=Cn(i),C=Cn(u),y=Cn(l),O=Cn(p),E=Cn(s),I=Cn(f),N=Cn(a),k=S+M*(S+C),P=C+M*(C+y),B=k+M*(k+P),T=E+M*(E+I),A=I+M*(I+N),z=T+M*(T+A);return{ps:[[i,s],[d,x],[g,b],[m,_]],_ps:[[0,0],[k,T],[B,z],[B+M*(B+(P+M*(P+(y+M*(y+O))))),z+M*(z+(A+M*(A+(N+M*(N+Cn(h))))))]]}}(t,e):1===e?function(t,n){const e=t[0],o=t[1],r=t[2],c=t[3],i=e[0],s=e[1],u=o[0],f=o[1],l=r[0],a=r[1],p=c[0],h=c[1],d=i-n*(i-u),v=u-n*(u-l),g=l-n*(l-p),m=d-n*(d-v),x=v-n*(v-g),w=m-n*(m-x),b=s-n*(s-f),_=f-n*(f-a),M=a-n*(a-h),S=b-n*(b-_),C=_-n*(_-M),y=S-n*(S-C),O=Cn(n),E=Cn(i),I=Cn(u),N=Cn(l),k=Cn(p),P=Cn(s),B=Cn(f),T=Cn(a),A=E+O*(E+I),z=I+O*(I+N),L=N+O*(N+k),D=A+O*(A+z),q=z+O*(z+L),W=P+O*(P+B),j=B+O*(B+T),F=T+O*(T+Cn(h)),H=W+O*(W+j),Y=j+O*(j+F);return{ps:[[w,y],[x,C],[g,M],[p,h]],_ps:[[D+O*(D+q),H+O*(H+Y)],[q,Y],[L,F],[0,0]]}}(t,n):function(t,n,e){const o=t[0],r=t[1],c=t[2],i=t[3],s=o[0],u=o[1],f=r[0],l=r[1],a=c[0],p=c[1],h=n*n,d=n*h,v=e*e,g=e*v,m=n*e,x=s-f,w=a-f,b=i[0]-s,_=x+w,M=n*x,S=e*x,C=b-3*w,y=u-l,O=p-l,E=i[1]-u,I=y+O,N=n*y,k=e*y,P=E-3*O,B=d*C+(3*n*(n*_-x)+s),T=m*(n*C+2*_)+(h*_+s-(S+2*M)),A=m*(e*C+2*_)+(v*_+s-(2*S+M)),z=g*C+(3*e*(e*_-x)+s),L=d*P+(3*n*(n*I-y)+u),D=m*(n*P+2*I)+(h*I+u-(k+2*N)),q=m*(e*P+2*I)+(v*I+u-(2*k+N)),W=g*P+(3*e*(e*I-y)+u),j=Cn(n),F=Cn(e),H=Cn(m),Y=Cn(d),R=Cn(g),X=Cn(s),Q=Cn(f),V=X+Q,$=Cn(a)+Q,U=V+$,Z=j*V,G=F*V,J=Cn(b)+3*$,K=Cn(u),tt=Cn(l),nt=K+tt,et=Cn(p)+tt,ot=nt+et,rt=j*nt,ct=F*nt,it=Cn(E)+3*et;return{ps:[[B,L],[T,D],[A,q],[z,W]],_ps:[[Y*J+(3*j*(j*U+V)+X),Y*it+(3*j*(j*ot+nt)+K)],[H*(j*J+2*U)+(h*U+X+(G+2*Z)),H*(j*it+2*ot)+(h*ot+K+(ct+2*rt))],[H*(F*J+2*U)+(v*U+X+(2*G+Z)),H*(F*it+2*ot)+(v*ot+K+(2*ct+rt))],[R*J+(3*F*(F*U+V)+X),R*it+(3*F*(F*ot+nt)+K)]]}}(t,n,e)}function En(t,n,e=.4,o=16){const r=t[0],c=t[1];if(r===c)return 0;const[[i,s],[u,f],[l,a],[p,h]]=n;if(i===u&&u===l&&l===p&&s===f&&f===a&&a===h)return 0;const d=On(n,r,c).ps,v=bn(d,e);let g=0;for(let t=0;t<v.length-1;t++){const n=v[t],e=v[t+1];g+=on(sn(d),[n,e],o)}return g}function In(t,n=.4,e=16){if(4===t.length)return En([0,1],t,n,e);if(3===t.length)return Sn([0,1],t,n,e);if(2===t.length)return en([0,1],t);if(1===t.length)return 0;throw new Error("The given bezier curve must be of order <= 3.")}function Nn(t,n,e=!0){const{cpNodes:o,hasHoleCloser:r}=function(t,n,e=!0){if(!e&&t===n)return{cpNodes:[],hasHoleCloser:!1};const o=t,r=[o];let c=t.next,i=o.isHoleClosing;for(;c!==n&&c!==o;)c.isHoleClosing&&(i=!0),r.push(c),c=c.next;return{cpNodes:r,hasHoleCloser:i}}(t,n,e);return{pss:o.flatMap(Z),hasHoleCloser:r}}function kn(t){const n=t,e=t.nextOnCircle,o=nn(n.pointOnShape.p,e.pointOnShape.p),{pss:r,hasHoleCloser:c}=Nn(n,e),i=function(t){let n=0;for(let e of t)n+=e;return n}(r.map(t=>In(t)));return c?1/0:i/o}function Pn(t,n){let e=t;const o=[];for(;e!==n;){const t=Vt(e,e.next);o.push(t),e=e.next}return o}function Bn(t,n){const e=st(lt(ht($t(t),0)),lt(ht($t(n),0)));return Math.abs(Math.asin(e)*(180/Math.PI))}function Tn(t){const n=[];return R(t,t=>{n.push(t)}),n}function An(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 zn(t,n){return An(t.pointOnShape,n.pointOnShape)}const Ln={getChildren:K,getVertexForwardChildren:Y,getAllOnLoop:k,getAllOnCircle:A,isOnSameCircle:Zt,isTerminating:z,isFullyTerminating:q,getFirstExit:Ut,isSharp:W,isOneProng:Gt,getProngCount:T,getRealProngCount:L,cpNodeComparator:zn,enhanceCpNode:j,traverseCp:F,traverseEdges:H,traverseVertices:R,clone:Q,getBoundaryBezierPartsToNext:$,getBoundaryBeziersToNext:Z,removeVertex:J,getMatCurveToNext:$t,isTwoProng:Jt,getBranch:Kt,getBranchBeziers:tn,getSalience:kn,getMatCurveBetween:Vt,getEdgeDirection:Rt,getBoundaryBeziersBetween:Nn,getMatCurvesBetween:Pn,getHoleClosers:P,getInitialDegAngleBetweenMatCurves:Bn,getAllVertices:Tn};function Dn(t){return n=>A(n).some(t)}const qn=Dn(function(t){return 2!==L(t)&&!t.isHoleClosing});const{abs:Wn}=Math,{abs:jn}=Math;function Fn(t,n){if(t.length!==n.length)throw new Error("`p` and `p_` must be of equal length.");for(let e=0;e<t.length;e++){const o=jn(n[e]);if(t[e]-o>=0)continue;let r=!1,c=!1;for(let o=0;o<e;o++){const e=jn(n[o]),i=t[o]-e,s=t[o]+e;if(i>0){r=!0;break}s>0&&(c=!0)}if(!r&&c)return 1/0}return function(t){const n=t.length-1;if(n<1)return 0;t[0]<0&&(t=function(t){const n=new Array(t.length);for(let e=0;e<t.length;e++)n[e]=-t[e];return n}(t));const e=[];for(let t=0;t<n;t++)e.push(1);let o=0;for(let r=0;r<=n;r++){if(t[r]>=0)continue;let n=1/0,c=!1;for(let o=0;o<r;o++){if(t[o]<=0)continue;const i=(-t[r]/(t[o]/2**e[o]))**(1/(r-o));e[o]++,n>i&&(n=i),c=!0}c&&o<n&&(o=n)}return o}(function(t,n){if(t.length!==n.length)throw new Error("`p` and `p_` must be of equal length.");const e=new Array(t.length);for(let o=0;o<t.length;o++){const r=Wn(n[o]),c=t[o]-r,i=t[o]+r;e[o]=c>0||i<0?c:0}return e}(t,n))}const Hn=(Yn=Fn,(t,n)=>-Yn(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),n));var Yn;const{min:Rn,max:Xn,abs:Qn}=Math,Vn=17976931348623157e292,$n=Number.EPSILON,Un=$n/2,Zn=Un*Un,Gn=Kn(1),Jn=function(){const t=3*Zn;return t/(1-t)}();function Kn(t){const n=t*Un;return n/(1-n)}new Array(20).fill(0).map((t,n)=>Kn(n));const{abs:te}=Math;function ne(t){const n=t.slice(),e=n.length;if(1===e)return n;let o=n[e-1],r=e;for(let t=e-2;t>=0;--t){const e=o,c=n[t];o=e+c;const i=c-(o-e);i&&(n[--r]=o,o=i)}let c=0;for(let t=r;t<e;++t){const e=n[t],r=o;o=e+r;const i=r-(o-e);i&&(n[c++]=i)}return n[c++]=o,n.length=c,n}const{abs:ee}=Math,{abs:oe}=Math,re=134217729;function ce(t,n){const e=n[0],o=n[1],r=o*t,c=re*o,i=c-(c-o),s=o-i,u=re*t,f=u-(u-t),l=t-f,a=e*t,p=r+a,h=a-(p-r)+(s*l-(r-i*f-s*f-i*l)),d=p+h;return[h-(d-p),d]}function ie(t,n){const e=n[0],o=n[1],r=o*t,c=re*o,i=c-(c-o),s=o-i,u=re*t,f=u-(u-t),l=t-f,a=s*l-(r-i*f-s*f-i*l)+e*t,p=r+a;return[a-(p-r),p]}const{abs:se}=Math;function ue(t,n,e){const o=t.length-1;if(o<0)return[[],[]];const r=se(n),c=t.slice(),i=e.slice();for(let t=0;t<=o;t++)for(let e=1;e<=o-t;e++){const t=c[e-1],o=i[e-1],s=ie(n,t),u=r*o+se(s[1]),f=c[e];c[e]=hn(f,s),i[e]=i[e]+u+se(c[e][1])}return[c,i]}const fe=2**27+1;function le(t,n){const e=t[1],o=n[1],r=e*o,c=fe*e,i=c-(c-e),s=e-i,u=fe*o,f=u-(u-o),l=o-f,a=s*l-(r-i*f-s*f-i*l)+(e*n[0]+t[0]*o),p=r+a;return[a-(p-r),p]}const{abs:ae}=Math;function pe(t,n){const e=t.length-1;if(e<0)return[];const o=t.slice();for(let t=0;t<=e;t++)for(let r=1;r<=e-t;r++)o[r]=ne(vt(o[r],mt(o[r-1],n)));return o}function he(t,n){const e=t.length-1;if(e<0)return[];const o=new Array(e+1);o[e]=t[e];let r=[1];for(let c=1;c<=e;c++)r=mt(r,n),o[e-c]=wt(t[e-c],r);return o}const{abs:de,sign:ve}=Math;const ge=134217729;function me(t,n){const e=t*n,o=ge*t,r=o-(o-t),c=t-r,i=ge*n,s=i-(i-n),u=n-s;return[c*u-(e-r*s-c*s-r*u),e]}const{abs:xe}=Math;function we(t,n){const e=xe(n);let o=t[0],r=.5*xe(o);for(let c=1;c<t.length;c++)o=o*n+t[c],r=r*e+xe(o);return r=Un*(2*r-xe(o)),[o,r]}const be=Math.abs,{abs:_e}=Math,Me=Kn(1),Se=Kn(2);function Ce(t,n,e=void 0,o=1){const r=t[0],[c,i]=we(r,n),s=Se*function(t,n){const e=be(n);let o=0;for(let n=0;n<t.length;n++)o=o*e+be(t[n]);return o}(r,n),u=void 0!==e?at(e,_e(n)):0;if((i+s+u)*o<Math.abs(c))return c;const f=function(t,n){const e=[],o=[];let r,c=t[0];for(let i=1;i<t.length;i++){const[s,u]=me(c,n);[r,c]=Et(u,t[i]),e.push(s),o.push(r)}return{r̂:c,pπ:e,pσ:o}}(r,n),{pπ:l,pσ:a}=f;let{r̂:p}=f;const[h,d]=we(l,n),[v,g]=we(a,n),[m,x]=we(t[1],n);let w=d+g+x+u;return p=h+v+m+p,w+=Me*p,w*o<Math.abs(p)?p:0}function ye(t,n){let e=[0];for(let o=0;o<t.length;o++)e=vt(t[o],mt(e,n));return e}const{abs:Oe,min:Ee,max:Ie,log2:Ne,ceil:ke}=Math;function Pe(t,n,e,o,r,c,i,s){let u=e,f=o,l=u,a=r,p=f-u,h=p;for(;;){let d;Oe(a)<Oe(c)&&(u=f,f=l,l=u,r=c,c=a,a=r);const v=Ie(Oe(u),Oe(f));d=v<=1?$n:$n*2**ke(Ne(v));const g=.5*(l-f);if(Oe(g)<=d)return f<l?[f,l,f]:[l,f,f];if(Oe(p)<d||Oe(r)<=Oe(c))p=g,h=p;else{let t,n,e=c/r;if(u===l)t=2*g*e,n=1-e;else{n=r/a;const o=c/a;t=e*(2*g*n*(n-o)-(f-u)*(o-1)),n=(n-1)*(o-1)*(e-1)}0<t?n=-n:t=-t,e=p,p=h,2*t<3*g*n-Oe(d*n)&&t<Oe(.5*e*n)?h=t/n:(p=g,h=p)}if(u=f,r=c,d<Oe(h)?f+=h:0<g?f+=d:f-=d,0===(c=s?bt(ye(i(),f)):Ce(t,f,n))){if(s)return[f,f,f];const r=Ie(e,f-d),u=Ee(o,f+d);if(Ce(t,r,n)*Ce(t,u,n)!==0)return[r,u,f];if(s=!0,0===(c=bt(ye(i(),f))))return[f,f,f]}(0<c&&0<a||c<=0&&a<=0)&&(l=u,a=r,p=f-u,h=p)}}const{abs:Be}=Math;function Te(t,n,e){const o=Be(n);let r=t[0],c=e[0];for(let i=1;i<t.length;i++){const s=r*n;r=s+t[i],c=c*o+Be(s)+e[i]+Be(r)}return[r,c]}function Ae(t){const n=t[0].length,e=[];for(let o=0;o<n;o++){const r=[];for(let e=0;e<t.length;e++)r.push(t[e][n-(o+1)]);e.push(r)}return e}const ze=hn,Le=ie,{abs:De}=Math;function qe(t,n,e){const o=De(n);let r=t[0],c=e[0];for(let i=1;i<t.length;i++){const s=Le(n,r);r=ze(s,t[i]),c=c*o+De(s[1])+e[i]+De(r[1])}return[r,c]}const{abs:We,min:je,max:Fe,log2:He,ceil:Ye}=Math,Re=Jn/Gn;function Xe(t,n,e,o,r,c,i){const s=t.length-1;let u=0,f=1;for(;;){f*=2;for(let l=1;l<f;l+=2){u++;const a=r+(c-r)*(f+2*l)/(4*f),[p,h]=Te(t,a,n);if(We(p)>h*Gn)return[a,p];if(u>s)return Qe(e,o,r,c,i)}}}function Qe(t,n,e,o,r){const c=t.length-1;let i=0,s=1;for(;;){s*=2;for(let u=1;u<s;u+=2){i++;const f=e+(o-e)*(s+2*u)/(4*s),[l,a]=qe(t,f,n);if(We(l[1])>a*Jn)return[f,l[1]];if(i>c)return Ve(r(),e,o)}}}function Ve(t,n,e){const o=t.length-1;let r=1;for(;;){r*=2;for(let c=1;c<r;c+=2){const i=n+(e-n)*(r+2*c)/(4*r),s=ne(ye(t,i)),u=s[s.length-1];if(0!==u)return[i,u];if(0>o)throw new Error("Cannot resolve root even in Shewchuk expansion precision")}}}const{abs:$e,max:Ue,log2:Ze,ceil:Ge}=Math;function Je(t,n=-1/0,e=1/0,o,r,c=!1){let i;"number"==typeof t[0]&&(t=t.map(t=>[0,t]));const s=()=>void 0===r?t:(void 0===i&&(i=r()),i);o=o||new Array(t.length).fill(0),({pDd:t,pDd_:o,pExact:i}=function(t,n,e,o){let r;if(0===t.length||te(t[0][1])>o*n[0])return{pDd:t,pDd_:n,pExact:r};r=r||e();for(let e=0;e<r.length;e++){const c=r[e],i=t[e];i[1]=c[c.length-1],i[0]=c[c.length-2]??0,n[e]=te(i[1])*(Jn/o)}let c=0;for(;c<t.length&&0===t[c][1];)c++;return t=t.slice(c),n=n.slice(c),r=r.slice(c),{pDd:t,pDd_:n,pExact:r}}(t,o,s,Jn));const u=t.map(t=>t[0]+t[1]);if((c||$e(n)>2**20||$e(e)>2**20)&&([n,e]=function(t,n,e,o,r){t=Xn(t,Hn(e,o.map(t=>t*r))),n=Rn(n,Fn(e,o.map(t=>t*r)));const c=2**(-2*(e.length-1));for(Number.isFinite(t)||(t=-c*Vn),Number.isFinite(n)||(n=c*Vn);;){const o=Qn(at(e,t)),r=Qn(at(e,n));if(o>c*Vn)t/=2;else{if(!(r>c*Vn))break;n/=2}}return[t,n]}(n,e,u,o,Jn)),0!==t.length){if(1===t.length)return[];if(n===e){const t=2*$n*Ue(1,2**Ge(Ze(Ue($e(n),$e(e)))));n-=t,e+=t}return function(t,n,e,o,r,c){const i=e.map((n,e)=>n*Re+We(t[e])),s=o,u=r;let f,l,a,p,h=r-o;for(;[f,l]=Te(t,o,i),!(We(f)>l*Gn);)o-=h/2,h*=2;for(;[a,p]=Te(t,r,i),!(We(a)>p*Gn);)r+=h/2,h*=2;const d=[[o,r,f,a,0]],v=[],g=function(t,n,e,o,r){return function(c,i,s,u,f){let[l,a]=function(t,n,e){const o=t.length-1,r=ee(n),c=t.slice(),i=e.slice();for(let t=0;t<=o;t++)for(let e=1;e<=o-t;e++){const t=n*c[e-1],o=r*i[e-1]+ee(t);c[e]=c[e]+t,i[e]=i[e]+o+ee(c[e])}return[c,i]}(t,c,n);!function(t,n,e){const o=t.length-1;if(o<0)return;let r=n,c=0;for(let i=1;i<=o;i++){const s=o-i,u=t[s],f=oe(u),l=e[s],a=u*r;t[s]=a,e[s]=l*r+f*c+oe(a);const p=r*n;c=c*n+p,r=p}}(l,i-c,a),l.reverse(),a.reverse(),function(t,n){const e=t.length-1;for(let o=0;o<=e;o++)for(let r=1;r<=e-o;r++){const e=t[r-1],o=n[r-1]+ee(e);t[r]=t[r]+e,n[r]=n[r]+o+ee(t[r])}}(l,a);let p=0,h=0,d=ve(s);for(let t=1;t<l.length-1;t++){let n=ve(l[t]);const e=l[t],o=a[t]*Gn;de(e)<=o&&(h++,n=-d),n!==d&&(p++,d=n)}return ve(u)!==d&&p++,1===h&&1===p?1:h>0?function(t,n,e,o,r,c,i,s){let[u,f]=ue(t,e,n);(function(t,n,e){const o=t.length-1;if(o<0)return;let r=[0,n],c=0;for(let i=1;i<=o;i++){const s=o-i,u=t[s],f=ae(u[1]),l=e[s],a=le(r,u);t[s]=a,e[s]=l*r[1]+f*c+ae(a[1]);const p=le(r,[0,n]);c=c*n+p[1],r=p}})(u,o-e,f),u.reverse(),f.reverse(),[u,f]=ue(u,1,f);let l=0,a=0,p=ve(r);for(let t=0;t<u.length-1;t++){let n=ve(u[t][1]);const e=f[t]*Jn,o=u[t];e>=de(o[1])&&(a++,n=-p),n!==p&&(l++,p=n)}return ve(c)!==p&&l++,1===a&&1===l?1:0===a?l:i>1?function(t,n,e,o,r){let c=pe(t(),n);c=he(c,e-n),c.reverse(),c=pe(c,1);let i=0,s=ve(o);for(let t=1;t<c.length-1;t++){const n=c[t];let e=ve(n[n.length-1]);e!==s&&0!==e&&(i++,s=e)}return ve(r)!==s&&i++,i}(s,e,o,r,c):-l}(e,o,c,i,s,u,f,r):p}}(t,i,n,e,c);let m,x;for(;d.length>0;){const o=d.pop(),[r,s,u,f,l]=o,a=g(r,s,u,f,l);if(0===a)continue;if(1===a){m=m||e.map(t=>t*Jn),x=x||Ae(n);const[t,o,i]=Pe(x,m,r,s,u,f,c,!1);v.push({t:i,tS:t,tE:o,multiplicity:1});continue}let p=a<0?l+1:0;if(s-r<=2*We(a)*$n*Fe(1,2**Ye(He(Fe(We(r),We(s)))))){if(0===p){v.push({t:(r+s)/2,tS:r,tE:s,multiplicity:We(a)});continue}p=1/0}const[h,w]=Xe(t,i,n,e,r,s,c);d.push([r,h,u,w,p]),d.push([h,s,w,f,p])}return v.reverse(),v.filter(t=>{const{tS:n,tE:e}=t;return!(e<s||n>u)})}(u,t,o,n,e,s)}}function Ke(t,n){if(0===n)return t[0];if(1===n)return t[t.length-1];if(4===t.length){const[[e,o],[r,c],[i,s],[u,f]]=t,l=e+(r-e)*n,a=r+(i-r)*n,p=l+(a-l)*n,h=o+(c-o)*n,d=c+(s-c)*n,v=h+(d-h)*n;return[p+(a+(i+(u-i)*n-a)*n-p)*n,v+(d+(s+(f-s)*n-d)*n-v)*n]}if(3===t.length){const[[e,o],[r,c],[i,s]]=t,u=e+(r-e)*n,f=o+(c-o)*n;return[u+(r+(i-r)*n-u)*n,f+(c+(s-c)*n-f)*n]}if(2===t.length){const[[e,o],[r,c]]=t;return[e+(r-e)*n,o+(c-o)*n]}if(1===t.length)return t[0];throw new Error("The given bezier curve must be of order <= 3.")}function to(t){const n=pt(t),e=Je(n[0],0,1)?.map(t=>t.t)||[],o=Je(n[1],0,1)?.map(t=>t.t)||[];e.push(0,1),o.push(0,1);let r,c,i,s,u=1/0,f=-1/0,l=1/0,a=-1/0;for(let n=0;n<e.length;n++){const o=e[n],[i]=Ke(t,o);i<u&&(u=i,r=o),i>f&&(f=i,c=o)}for(let n=0;n<o.length;n++){const e=o[n],[,r]=Ke(t,e);r<l&&(l=r,i=e),r>a&&(a=r,s=e)}return{ts:[[r,i],[c,s]],box:[[u,l],[f,a]]}}const no=et(to);function eo(t,n){return oo(t)-oo(n)}function oo(t){let n=1/0;for(const e of t){const t=no(e).box[0][1];t<n&&(n=t)}return n}function ro(t){const n=[],e=[t];for(;e.length;){const t=e.pop();if(0===t.windingNum)for(const e of t.children)0!==e.windingNum&&n.push(e);e.push(...t.children)}return n}const{abs:co}=Math;function io(t,n){return"AND"===t?co(n)>=2:"XOR"===t?co(n)%2==1:0!==n}function so(t){return n=>{const e=[],o=[[n,0]];for(;o.length;){const[n,r]=o.pop(),c=n.parent.windingNum,i=io(t,n.windingNum)!==io(t,c);i&&e.push({out:n,depth:r,windingNum:n.windingNum,parentWinding:c});const s=i?r+1:r;for(const t of n.children)0===n.windingNum&&0!==t.windingNum||o.push([t,s])}return e}}function uo(t,n){let e=t.x.curve.idx-n.x.curve.idx;return 0!==e||(e=t.x.ri.tS-n.x.ri.tS),e}const{floor:fo,ceil:lo}=Math;function ao(t,n,e,o){const r=[];for(const o of t)r.push({type:-1,item:o,x:n(o)}),r.push({type:1,item:o,x:e(o)});r.sort(po);const c=new Set,i=[];for(const t of r){const{item:n,type:e}=t;if(-1===e){for(const t of c){const e=o(n,t);e&&i.push({a:n,b:t,u:e})}c.add(n)}else 1===e&&c.delete(n)}return i}function po(t,n){const e=t.x-n.x;return 0!==e?e:t.type}function ho(t,n,e){let[[o,r],[c,i]]=n,[[s,u],[f,l]]=e;r>i&&([r,i]=[i,r]),u>l&&([u,l]=[l,u]),o>c&&([o,c]=[c,o]),s>f&&([s,f]=[f,s]);const a=t||o===c&&s===f,p=t||r===i&&u===l;return(a?o<=f:o<f)&&(a?c>=s:c>s)&&(p?u<=i:u<i)&&(p?l>=r:l>r)}function vo(t,n){let[[e,o],[r,c]]=t;e>r&&([e,r]=[r,e]),o>c&&([o,c]=[c,o]);const i=(r-e)*n,s=(c-o)*n;return[[e-i,o-s],[r+i,c+s]]}function go(t,n){return ho(!0,vo(t.box,.5),vo(n.box,.5))}function mo(t,n){const[e,o]=n;t.getOrInsert(e,[]).push(o),t.getOrInsert(o,[]).push(e)}function xo(t,n,e,o){e.add(n),o.push(n);const r=t.get(n);for(let n=0;n<r.length;n++){const c=r[n];e.has(c)||xo(t,c,e,o)}}function wo(t){const n=[],e=new Set;for(const o of t){const r=o[0];e.has(r)||(n.push([]),xo(t,r,e,n[n.length-1]))}return n}const{min:bo,max:_o}=Math;function Mo(t){let n=1/0,e=1/0,o=-1/0,r=-1/0;const c=[];for(const i of t){const[[t,s],[u,f]]=i.box;n=bo(n,t),e=bo(e,s),o=_o(o,u),r=_o(r,f),c.push(...i.xs)}return{xs:c,box:[[n,e],[o,r]]}}function So(t){const n=[];function e(...e){if("undefined"==typeof _debug_)return t.apply(this,e);const o=performance.now(),r=t.apply(this,e),c=performance.now();return n.push(c-o),r}return e.getStats=()=>{const e=function(t){let n=0;for(let e of t)n+=e;return n}(n);return{name:t.name,totalMs:e,count:n.length}},e.resetStats=()=>{n.length=0},e}const Co=So(function(t){for(;;){const n=ao(t,t=>vo(t.box,.5)[0][0],t=>vo(t.box,.5)[1][0],go);if(!n.length)break;const e=new Map(t.map(t=>[t,[]]));for(let t=0;t<n.length;t++){const o=n[t];mo(e,[o.a,o.b])}t=wo(e).map(Mo)}return t});function yo(t,n){const e=t[0],o=t[1],r=n[0],c=n[1],i=o-c,s=i-o,u=e-r,f=u-e,l=o-(i-s)+(-c-s)+u,a=i+l;return a+(e-(u-f)+(-r-f)+(l-(a-i)))}function Oo(t,n){const e=t-n,o=t-e;return[t-(e+o)+(o-n),e]}function Eo(t,n){const e=t[0],o=t[1],r=o+n,c=r-o,i=e+(o-(r-c)+(n-c)),s=r+i;return[i-(s-r),s]}const Io=le,No=hn,ko=dn,Po=Oo,Bo=Eo;function To(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,o],[r,c],[i,s],[u,f]]=t,l=Bo(Io(Po(r,e),n),e),a=Bo(Io(Po(i,r),n),r),p=Bo(Io(Po(u,i),n),i),h=No(l,Io(ko(a,l),n)),d=No(a,Io(ko(p,a),n)),v=No(h,Io(ko(d,h),n)),g=Bo(Io(Po(c,o),n),o),m=Bo(Io(Po(s,c),n),c),x=Bo(Io(Po(f,s),n),s),w=No(g,Io(ko(m,g),n)),b=No(m,Io(ko(x,m),n));return[v,No(w,Io(ko(b,w),n))]}if(3===t.length){const[[e,o],[r,c],[i,s]]=t,u=No([0,e],Io(Po(r,e),n)),f=No([0,r],Io(Po(i,r),n)),l=No(u,Io(ko(f,u),n)),a=No([0,o],Io(Po(c,o),n)),p=No([0,c],Io(Po(s,c),n));return[l,No(a,Io(ko(p,a),n))]}if(2===t.length){const[[e,o],[r,c]]=t;return[Bo(Io(Po(r,e),n),e),Bo(Io(Po(c,o),n),o)]}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.")}function Ao(t,n){return To(t,[0,n]).map(t=>t[0]+t[1])}const{min:zo,max:Lo}=Math;function Do(t,n,e,o){let r;for(const{curve:c,ts:i}of function*(t,n){const e=n?t.next:t.prev,o=t.x.curve,r=t.x.ri.tS,c=e.x.curve,i=e.x.ri.tS,s=n?1:0,u=n?0:1;let f=o,l=r,a=!1;for(;;){if(f===c&&(l===i?a:n?l<i:l>i))return void(yield{ts:[l,i],curve:f});yield{ts:[l,s],curve:f},a=!0,l=u,f=n?f.next:f.prev}}(n,o)){const{ps:n}=c;void 0===r&&(r=Ao(n,i[0]));const o=Ao(n,i[1]),[s,u]=r,[f,l]=o;let a=[];for(let t=0;t<e.length;t++){const n=e[t],[[o,r]]=n;(t%2==0&&zo(u,l)<=r&&r<=Lo(u,l)||t%2==1&&zo(s,f)<=o&&o<=Lo(s,f))&&a.push(t)}if(a.length>0)return t.oSideIdxs=a,a;r=o}}function qo(t,n){const e=t[0],o=t[1],r=o-n,c=r-o,i=e-e,s=o-(r-c)+(-n-c)+e,u=r+s,f=e-(e-i)-i+(s-(u-r)),l=u+f;return[f-(l-u),l]}const Wo=134217729;function jo(t,n){const e=t[0],o=t[1],r=o/n,c=r*n,i=Wo*r,s=i-(i-r),u=r-s,f=Wo*n,l=f-(f-n),a=n-l,p=(o-c-(u*a-(c-s*l-u*l-s*a))+e)/n,h=r+p;return[p-(h-r),h]}const Fo=dn;function Ho(t,n){return Fo(t,n)[1]>0?n:t}const Yo=dn;function Ro(t,n){return Yo(t,n)[1]>0?t:n}function Xo(t){return[-t[0],-t[1]]}const Qo=Oo,Vo=ie,$o=hn,Uo=Eo,{abs:Zo}=Math;function Go(t){const[[n,e],[o,r],[c,i],[s,u]]=t,f=Qo(s,n),l=Qo(o,c),a=3*(o-c),p=Vo(3,l),h=Zo(a),d=$o(f,p),v=h+Zo(s-n+a),g=Qo(c,2*o),m=Uo(g,n),x=Zo(c-2*o+n),w=Vo(3,m),b=6*x,_=Qo(o,n),M=Vo(3,_),S=Zo(3*(o-n)),C=Qo(u,e),y=Qo(r,i),O=3*(r-i),E=Vo(3,y),I=Zo(O),N=$o(C,E),k=I+Zo(u-e+O),P=Qo(i,2*r),B=Uo(P,e),T=Zo(i-2*r+e),A=Vo(3,B),z=6*T,L=Qo(r,e);return{coeffs:[[d,w,M,[0,n]],[N,A,Vo(3,L),[0,e]]],errorBound:[[v,b,S,0],[k,z,Zo(3*(r-e)),0]]}}function Jo(t){const[[n,e],[o,r],[c,i]]=t,s=c-2*o,u=Qo(c,2*o),f=Uo(u,n),l=Zo(s+n),a=Qo(2*o,2*n),p=i-2*r,h=Qo(i,2*r),d=Uo(h,e),v=Zo(p+e);return{coeffs:[[f,a,[0,n]],[d,Qo(2*r,2*e),[0,e]]],errorBound:[[l,0,0],[v,0,0]]}}function Ko(t){const[[n,e],[o,r]]=t;return[[Qo(o,n),[0,n]],[Qo(r,e),[0,e]]]}const tr=dn,nr=ie,er=Xo,{abs:or}=Math;function rr(t){const[[n,[,e]],[o,[,r]]]=Ko(t),c=er(o),i=n,s=nr(r,n),u=or(s[1]),f=nr(e,o),l=or(f[1]),a=tr(f,s);return{coeffs:{vₓ:c,vᵧ:i,v:a},errorBound:{v_:u+l+or(a[1])}}}const{abs:cr}=Math,ir=hn,sr=ie,ur=le;function fr(t){return[2*t[0],2*t[1]]}const lr=Xo,ar=fr,pr=ie,hr=le,dr=dn,{abs:vr}=Math;function gr(t){const{coeffs:[[n,e,[,o]],[r,c,[,i]]],errorBound:[[s],[u]]}=Jo(t),f=n[1],l=e[1],a=r[1],p=c[1],h=vr(o),d=vr(l),v=vr(f),g=vr(i),m=vr(p),x=vr(a),w=hr(n,c),b=s*m+2*vr(f*p),_=hr(e,r),M=d*u+2*vr(l*a),S=pr(i,n),C=g*s+vr(i*f),y=pr(o,r),O=h*u+vr(o*a),E=pr(i,e),I=vr(i*l),N=pr(o,c),k=vr(o*p),P=hr(n,n),B=2*(s*v+vr(f*f)),T=hr(n,r),A=s*x+v*u+2*vr(f*a),z=hr(r,r),L=2*(u*x+vr(a*a)),D=f*p-l*a,q=f*i-o*a,W=l*i-o*p,j=dr(w,_),F=vr(D),H=b+M+F,Y=dr(S,y),R=vr(q),X=C+O+R,Q=dr(E,N),V=vr(W),$=I+k+V,U=lr(z),Z=L,G=ar(T),J=2*A,K=lr(P),tt=B,nt=p*D,et=hr(c,j),ot=m*H+2*vr(nt),rt=2*q*a,ct=ar(hr(r,Y)),it=2*(u*R+x*X+2*vr(rt)),st=nt-rt,ut=dr(et,ct),ft=ot+it+vr(st),lt=2*f*q,at=ar(hr(n,Y)),pt=2*(s*R+v*X+2*vr(lt)),ht=l*D,dt=hr(e,j),vt=d*H+2*vr(ht),gt=lt-ht,mt=dr(at,dt),xt=pt+vt+vr(gt),wt=D*W,bt=hr(j,Q),_t=H*V+F*$+2*vr(wt),Mt=q*q,St=hr(Y,Y),Ct=2*(X*R+vr(Mt)),yt=wt-Mt;return{coeffs:{vₓₓ:U,vₓᵧ:G,vᵧᵧ:K,vₓ:ut,vᵧ:mt,v:dr(bt,St)},errorBound:{vₓₓ_:Z,vₓᵧ_:J,vᵧᵧ_:tt,vₓ_:ft,vᵧ_:xt,v_:_t+Ct+vr(yt)}}}const mr=pn,xr=fr,wr=ie,br=le,_r=hn,{abs:Mr}=Math;function Sr(t){return[t[0]/2,t[1]/2]}const{abs:Cr}=Math,yr=Xo,Or=fr,Er=Sr,Ir=ie,Nr=le,kr=dn,Pr=hn;function Br(t){const{coeffs:[[n,e,o,[,r]],[c,i,s,[,u]]],errorBound:[[f,l,a],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c=le,vc=hn,{abs:gc}=Math,mc=dt,xc=Et,wc=xt,bc=It;function _c(t){if(4===t.length)return Mc(t);if(3===t.length)return Sc(t);if(2===t.length)return Cc(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],[o,r],[c,i],[s,u]]=t;return[[vt(mc(s,n),wc(3,mc(o,c))),wc(3,bc(xc(c,n),-2*o)),wc(3,mc(o,n)),[n]].map(ne),[vt(mc(u,e),wc(3,mc(r,i))),wc(3,bc(xc(i,e),-2*r)),wc(3,mc(r,e)),[e]].map(ne)]}function Sc(t){const[[n,e],[o,r],[c,i]]=t;return[[bc(xc(c,n),-2*o),mc(2*o,2*n),[n]],[bc(xc(i,e),-2*r),mc(2*r,2*e),[e]]]}function Cc(t){const[[n,e],[o,r]]=t;return[[mc(o,n),[n]],[mc(r,e),[e]]]}const yc=xt,Oc=_t;function Ec(t){const[[n,[e]],[o,[r]]]=t;if(0!==St(n)||0!==St(o))return{vₓ:Oc(o),vᵧ:n,v:ne(Mt(yc(e,o),yc(r,n)))}}const Ic=xt,Nc=wt,kc=vt;function Pc(t,n){const e=Cc(t),[[o,[r]],[c,[i]]]=Cc(n),{vₓ:s,vᵧ:u,v:f}=Ec(e),l=Nc(o,s),a=Nc(c,u),p=kc(l,a),h=Ic(r,s),d=Ic(i,u),v=kc(h,d);return[p,kc(v,f)].map(ne)}function Bc(t){const n=[];for(let e=0;e<t.length;e++)n.push(2*t[e]);return n}const Tc=xt,Ac=Bc,zc=Mt,Lc=wt,Dc=_t;function qc(t){const[[n,e,[o]],[r,c,[i]]]=t;if(0===St(n)&&0===St(r))return Ec([[e,[o]],[c,[i]]]);const s=Lc(n,c),u=Lc(e,r),f=Tc(i,n),l=Tc(o,r),a=Tc(i,e),p=Tc(o,c),h=Lc(n,n),d=Lc(n,r),v=Lc(r,r),g=zc(s,u),m=zc(f,l),x=zc(a,p),w=ne(Dc(v)),b=ne(Ac(d)),_=ne(Dc(h)),M=Lc(c,g),S=Ac(Lc(r,m)),C=ne(zc(M,S)),y=Ac(Lc(n,m)),O=Lc(e,g),E=ne(zc(y,O)),I=Lc(g,x),N=Lc(m,m);return{vₓₓ:w,vₓᵧ:b,vᵧᵧ:_,vₓ:C,vᵧ:E,v:ne(zc(I,N))}}const Wc=me,jc=xt,Fc=wt,Hc=vt,Yc=Bc;function Rc(t,n){const e=Sc(t);if(0===St(e[0][0])&&0===St(e[1][0]))return Pc([t[0],t[2]],n);const[[o,[r]],[c,[i]]]=Cc(n),{vₓₓ:s,vₓᵧ:u,vᵧᵧ:f,vₓ:l,vᵧ:a,v:p}=qc(e),h=Wc(r,r),d=jc(r,o),v=Wc(r,i),g=jc(r,c),m=Fc(o,o),x=jc(i,o),w=Fc(o,c),b=Wc(i,i),_=jc(i,c),M=Fc(c,c),S=Fc(m,s),C=Fc(M,f),y=Fc(w,u),O=Hc(S,C),E=Hc(O,y),I=Fc(d,s),N=Fc(_,f),k=Hc(g,x),P=Fc(k,u),B=Yc(Hc(I,N)),T=Hc(B,P),A=Fc(o,l),z=Fc(c,a),L=Hc(A,z),D=Hc(T,L),q=Fc(h,s),W=Fc(v,u),j=Fc(b,f),F=Hc(q,W),H=Hc(F,j),Y=jc(r,l),R=jc(i,a),X=Hc(Y,R),Q=Hc(H,X);return[E,D,Hc(Q,p)].map(ne)}const Xc=wt,Qc=dt,Vc=mt,$c=Et;function Uc(t,n=!1){const[e,o,r,c]=t;if(!n){const[t,n]=e,[i,s]=o,[u,f]=r,[l,a]=c;return[e,[bt(Mt(Vc($c(i/4,u/4),3),$c(t/4,l/4))),bt(Mt(Vc($c(s/4,f/4),3),$c(n/4,a/4)))],c]}const i=function(t,n){const[[e,o],[r,c]]=t,[[i,s],[u,f]]=n,l=Qc(r,e),a=Qc(c,o),p=Qc(u,i),h=Qc(f,s),d=Mt(Xc(p,a),Xc(h,l));if(0===St(d))return;const v=Qc(i,e),g=Qc(s,o),m=b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),ft=ci(b,ct),lt=ci(M,it),at=ci(o,d),pt=ci(c,v),ht=ii(st,ut),dt=ii(ft,lt),vt=ii(ht,dt),gt=ii(at,pt),mt=ii(vt,gt),xt=ii(E,k),wt=ii(T,P),bt=ii(xt,a),_t=ii(wt,h),Mt=ci(m,bt),Ct=ci(C,_t),yt=ci(w,p),Ot=ii(Mt,Ct),Et=ii(Ot,yt),It=ri(r,d),Nt=ri(i,v),kt=ii(It,Nt),Pt=ii(Et,kt);return[Y,tt,mt,ii(Pt,g)].map(ne)}const fi=xt,li=wt,ai=vt;function pi(t,n){const e=Cc(t),[[o,r,[c]],[i,s,[u]]]=Sc(n);if(0===St(o)&&0===St(i))return Pc(t,[n[0],n[2]]);const{vₓ:f,vᵧ:l,v:a}=Ec(e),p=li(o,f),h=li(i,l),d=ai(p,h),v=li(r,f),g=li(s,l),m=ai(v,g),x=fi(c,f),w=fi(u,l),b=ai(x,w);return[d,m,ai(b,a)].map(ne)}const hi=me,di=xt,vi=wt,gi=vt,mi=Bc;function xi(t,n){const e=Sc(t);if(0===St(e[0][0])&&0===St(e[1][0]))return pi([t[0],t[2]],n);const[[o,r,[c]],[i,s,[u]]]=Sc(n);if(0===St(o)&&0===St(i))return Rc(t,[n[0],n[2]]);const{vₓₓ:f,vₓᵧ:l,vᵧᵧ:a,vₓ:p,vᵧ:h,v:d}=qc(e),v=hi(c,c),g=di(c,r),m=di(c,o),x=hi(c,u),w=di(c,s),b=di(c,i),_=vi(r,r),M=vi(r,o),S=di(u,r),C=vi(r,s),y=vi(r,i),O=vi(o,s),E=vi(o,o),I=di(u,o),N=vi(o,i),k=hi(u,u),P=di(u,s),B=di(u,i),T=vi(s,s),A=vi(s,i),z=vi(i,i),L=vi(E,f),D=vi(N,l),q=vi(z,a),W=gi(L,D),j=gi(W,q),F=vi(M,f),H=vi(A,a),Y=gi(y,O),R=vi(Y,l),X=mi(gi(F,H)),Q=gi(X,R),V=gi(mi(m),_),$=gi(mi(B),T),U=gi(b,C),Z=gi(U,I),G=vi(V,f),J=vi($,a),K=vi(Z,l),tt=vi(o,p),nt=vi(i,h),et=gi(G,J),ot=gi(et,K),rt=gi(tt,nt),ct=gi(ot,rt),it=vi(g,f),st=vi(P,a),ut=gi(w,S),ft=vi(ut,l),lt=mi(gi(it,st)),at=vi(r,p),pt=vi(s,h),ht=gi(lt,ft),dt=gi(at,pt),vt=gi(ht,dt),gt=vi(v,f),mt=vi(x,l),xt=vi(k,a),wt=di(c,p),bt=di(u,h),_t=gi(gt,mt),Mt=gi(_t,xt),Ct=gi(wt,bt),yt=gi(Mt,Ct);return[j,Q,ct,vt,gi(yt,d)].map(ne)}const wi=me,bi=xt,_i=wt,Mi=vt,Si=Bc;function Ci(t,n){const e=Mc(t);if(0===St(e[0][0])&&0===St(e[1][0]))return xi(Uc(t),n);const[[o,r,[c]],[i,s,[u]]]=Sc(n);if(0===St(o)&&0===St(i))return ui(t,[n[0],n[2]]);const{vₓₓₓ:f,vₓₓᵧ:l,vₓᵧᵧ:a,vᵧᵧᵧ:p,vₓₓ:h,vₓᵧ:d,vᵧᵧ:v,vₓ:g,vᵧ:m,v:x}=ei(e),w=wi(c,c),b=bi(c,r),_=bi(c,o),M=wi(c,u),S=bi(c,s),C=bi(c,i),y=_i(r,r),O=_i(r,o),E=bi(u,r),I=_i(r,s),N=_i(r,i),k=_i(o,s),P=_i(o,o),B=bi(u,o),T=_i(o,i),A=wi(u,u),z=bi(u,s),L=bi(u,i),D=_i(s,s),q=_i(s,i),W=_i(i,i),j=_i(o,f),F=_i(o,a),H=_i(i,l),Y=_i(i,p),R=Mi(j,H),X=Mi(F,Y),Q=_i(P,R),V=_i(W,X),$=Mi(Q,V),U=Mi(_,y),Z=Mi(L,D),G=Mi(Si(_),y),J=Mi(Si(L),D),K=Mi(Si(I),B),tt=Mi(Si(I),C),nt=Mi(Si(B),I),et=Mi(bi(6,_),y),ot=Mi(bi(6,L),D),rt=Mi(N,k),ct=Mi(C,B),it=Mi(Si(E),S),st=Mi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n,Ln),Wn=Mi(qn,Dn),jn=_i(wi(3,c),b),Fn=_i(wi(3,u),z),Hn=bi(c,it),Yn=bi(u,st),Rn=_i(b,h),Xn=_i(z,v),Qn=_i(S,d),Vn=_i(E,d),$n=Si(Mi(Rn,Xn)),Un=Mi(Qn,Vn),Zn=_i(r,g),Gn=_i(s,m),Jn=_i(jn,f),Kn=_i(Fn,p),te=_i(Hn,l),ee=_i(Yn,a),oe=Mi(Jn,Kn),re=Mi(te,ee),ce=Mi(oe,re),ie=Mi($n,Un),se=Mi(Zn,Gn),ue=Mi(ce,ie),fe=Mi(ue,se),le=bi(c,f),ae=bi(c,a),pe=bi(u,l),he=bi(u,p),de=Mi(le,pe),ve=Mi(ae,he),ge=Mi(de,h),me=Mi(ve,v),xe=_i(w,ge),we=_i(A,me),be=_i(M,d),_e=bi(c,g),Me=bi(u,m),Se=Mi(xe,we),Ce=Mi(Se,be),ye=Mi(_e,Me),Oe=Mi(Ce,ye);return[$,yt,Qt,dn,Wn,fe,Mi(Oe,x)].map(ne)}const yi=xt,Oi=wt,Ei=vt;function Ii(t,n){const e=Cc(t),[[o,r,c,[i]],[s,u,f,[l]]]=Mc(n);if(0===St(o)&&0===St(s))return pi(t,Uc(n));const{vₓ:a,vᵧ:p,v:h}=Ec(e),d=Oi(o,a),v=Oi(s,p),g=Ei(d,v),m=Oi(r,a),x=Oi(u,p),w=Ei(m,x),b=Oi(c,a),_=Oi(f,p),M=Ei(b,_),S=yi(i,a),C=yi(l,p),y=Ei(S,C);return[g,w,M,Ei(y,h)].map(ne)}const Ni=me,ki=xt,Pi=wt,Bi=vt,Ti=Bc;function Ai(t,n){const e=Sc(t);if(0===St(e[0][0])&&0===St(e[1][0]))return Ii([t[0],t[2]],n);const[[o,r,c,[i]],[s,u,f,[l]]]=Mc(n);if(0===St(o)&&0===St(s))return xi(t,Uc(n));const{vₓₓ:a,vₓᵧ:p,vᵧᵧ:h,vₓ:d,vᵧ:v,v:g}=qc(e),m=Ni(i,i),x=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t),Kt=Pi(c,d),tn=Pi(f,v),nn=Bi(Kt,tn),en=Bi(Jt,nn),on=Pi(m,a),rn=Pi(_,p),cn=Pi(Y,h),sn=ki(i,d),un=ki(l,v),fn=Bi(on,rn),ln=Bi(fn,cn),an=Bi(sn,un),pn=Bi(ln,an);return[ot,ft,xt,Tt,Qt,en,Bi(pn,g)].map(ne)}const zi=me,Li=xt,Di=wt,qi=vt,Wi=Bc,ji=[[function(t,n){const{coeffs:{vₓ:e,vᵧ:o,v:r},errorBound:{v_:c}}=rr(t),[[i,[,s]],[u,[,f]]]=Ko(n),l=i[1],a=u[1],p=e[1],h=o[1],d=r[1],v=l*p,g=2*cr(v),m=ur(i,e),x=a*h,w=2*cr(x),b=ur(u,o),_=v+x,M=ir(m,b),S=g+w+cr(_),C=s*p,y=sr(s,e),O=cr(C),E=f*h,I=sr(f,o),N=cr(E),k=C+E,P=ir(y,I),B=O+N+cr(k);return{coeffs:[M,ir(P,r)],errBound:[S,B+c+cr(k+d)]}},function(t,n){const{coeffs:{vₓ:e,vᵧ:o,v:r},errorBound:{v_:c}}=rr(t),{coeffs:[[i,s,[,u]],[f,l,[,a]]],errorBound:[[p],[h]]}=Jo(n),d=e[1],v=o[1],g=r[1],m=Hr(d),x=Hr(v),w=s[1],b=i[1],_=l[1],M=f[1],S=b*d,C=Fr(i,e),y=p*m+2*Hr(S),O=M*v,E=Fr(f,o),I=h*x+2*Hr(O),N=S+O,k=Wr(C,E),P=y+I+Hr(N),B=w*d,T=Fr(s,e),A=2*Hr(B),z=_*v,L=Fr(l,o),D=2*Hr(z),q=B+z,W=Wr(T,L),j=A+D+Hr(q),F=jr(u,e),H=u*d,Y=Hr(H),R=jr(a,o),X=a*v,Q=Hr(X),V=H+X,$=Wr(F,R),U=Y+Q+Hr(V),Z=V+g;return{coeffs:[k,W,Wr($,r)],errBound:[P,j,U+c+Hr(Z)]}},function(t,n){const{coeffs:{vₓ:e,vᵧ:o,v:r},errorBound:{v_:c}}=rr(t),{coeff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),Sw=aw+bw,Cw=vc(pw,_w),yw=hw+Mw+gc(Sw),Ow=Sw+X;return{coeffs:[lo,or,Dc,tu,dl,xp,Ud,em,Ex,vc(Cw,a)],errBound:[ao,rr,qc,nu,vl,wp,Zd,om,Ix,yw+_+gc(Ow)]}}]],Fi=[[Pc,pi,Ii],[Rc,xi,Ai],[ui,Ci,function(t,n){const e=Mc(t);if(0===St(e[0][0])&&0===St(e[1][0]))return Ai(Uc(t),n);const[[o,r,c,[i]],[s,u,f,[l]]]=Mc(n);if(0===St(o)&&0===St(s))return Ci(t,Uc(n));const{vₓₓₓ:a,vₓₓᵧ:p,vₓᵧᵧ:h,vᵧᵧᵧ:d,vₓₓ:v,vₓᵧ:g,vᵧᵧ:m,vₓ:x,vᵧ:w,v:b}=ei(e),_=zi(i,i),M=Li(i,c),S=Li(i,r),C=Li(i,o),y=zi(i,l),O=Li(i,f),E=Li(i,u),I=Li(i,s),N=Di(c,c),k=Di(c,r),P=Di(c,o),B=Li(l,c),T=Di(c,f),A=Di(c,u),z=Di(c,s),L=Di(r,f),D=Di(r,r),q=Di(r,o),W=Li(l,r),j=Di(r,u),F=Di(r,s),H=Di(o,o),Y=Li(l,o),R=Di(o,f),X=Di(o,u),Q=Di(o,s),V=zi(l,l),$=Li(l,f),U=Li(l,u),Z=Li(l,s),G=Di(f,f),J=Di(f,u),K=Di(s,s),tt=Di(u,u),nt=Di(u,s),et=Di(f,s),ot=Di(o,H),rt=Di(o,K),ct=Di(s,H),it=Di(s,K),st=Di(ot,a),ut=Di(rt,h),ft=Di(ct,p),lt=Di(it,d),at=qi(st,ut),pt=qi(ft,lt),ht=qi(at,pt),dt=qi(Wi(F),X),vt=qi(Wi(X),F),gt=Di(o,dt),mt=Di(s,vt),xt=Di(r,H),wt=Di(u,K),bt=Di(a,xt),_t=Di(d,wt),Mt=Di(p,gt),Ct=Di(h,mt),yt=qi(Mt,Ct),Ot=Li(3,qi(bt,_t)),Et=qi(yt,Ot),It=Di(c,Q),Nt=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,lc);return[ht,Et,Jt,zn,we,Ke,Ho,Cr,$r,qi(ac,b)].map(ne)}]];function Hi(t,n){const{coeffs:e,errBound:o}=ji[t.length-2][n.length-2](t,n);return{coeffs:e,errBound:o,getPExact:()=>Fi[t.length-2][n.length-2](t,n)}}const{abs:Yi}=Math;function Ri(t,n){if(0===n[0]&&0===n[1])return[0,0];if(0===n[0]&&1===n[1])return[0,0];const e=Yi(n[1]);if(4===t.length){const[[n,o],[r,c],[i,s],[u,f]]=t,l=Yi(n),a=Yi(o),p=Yi(r),h=Yi(c),d=Yi(i),v=Yi(s),g=l+(p+l)*e,m=p+(d+p)*e,x=g+(m+g)*e,w=a+(h+a)*e,b=h+(v+h)*e,_=w+(b+w)*e;return[x+(m+(d+(Yi(u)+d)*e+m)*e+x)*e,_+(b+(v+(Yi(f)+v)*e+b)*e+_)*e]}if(3===t.length){const[[n,o],[r,c],[i,s]]=t,u=Yi(n),f=Yi(o),l=Yi(r),a=Yi(c),p=u+(l+u)*e,h=f+(a+f)*e;return[p+(l+(Yi(i)+l)*e+p)*e,h+(a+(Yi(s)+a)*e+h)*e]}if(2===t.length){const[[n,o],[r,c]]=t,i=Yi(n),s=Yi(o);return[i+(Yi(r)+i)*e,s+(Yi(c)+s)*e]}if(1===t.length)return[0,0];throw new Error("The given bezier curve must be of order <= 3.")}const Xi=Number.EPSILON,Qi=Number.EPSILON/2,Vi=Qi*Qi,$i=function(){const t=1*Qi;return t/(1-t)}(),Ui=function(){const t=3*Vi;return t/(1-t)}(),{abs:Zi}=Math,Gi=[[0,0],[0,0]];const{min:Ji,max:Ki}=Math;function ts(t,n){return n[0]!==n[1]?4===t.length?function(t,n){const{ps:e,_ps:o}=On(t,n[0],n[1]),r=e[0][0],c=e[1][0],i=e[2][0],s=e[3][0],u=9*Qi*o[0][0],f=9*Qi*o[1][0],l=9*Qi*o[2][0],a=9*Qi*o[3][0],p=e[0][1],h=e[1][1],d=e[2][1],v=e[3][1],g=9*Qi*o[0][1],m=9*Qi*o[1][1],x=9*Qi*o[2][1],w=9*Qi*o[3][1],b=Ji(r-u,c-f,i-l,s-a),_=Ki(r+u,c+f,i+l,s+a);return[[b,Ji(p-g,h-m,d-x,v-w)],[_,Ki(p+g,h+m,d+x,v+w)]]}(t,n):3===t.length?function(t,n){const{ps:e,_ps:o}=ln(t,n[0],n[1]),r=e[0][0],c=e[1][0],i=e[2][0],s=5*Qi*o[0][0],u=5*Qi*o[1][0],f=5*Qi*o[2][0],l=e[0][1],a=e[1][1],p=e[2][1],h=5*Qi*o[0][1],d=5*Qi*o[1][1],v=5*Qi*o[2][1],g=Ji(r-s,c-u,i-f),m=Ki(r+s,c+u,i+f);return[[g,Ji(l-h,a-d,p-v)],[m,Ki(l+h,a+d,p+v)]]}(t,n):function(t,n){const{ps:e,_ps:o}=function(t,n,e){return 0===n?1===e?{ps:t,_ps:Gi}:function(t,n){const e=t[0],o=t[1],r=e[0],c=e[1],i=o[0],s=o[1],u=[[r,c],[n*(i-r)+r,n*(s-c)+c]],f=Zi(n),l=Zi(r),a=Zi(i),p=Zi(c);return{ps:u,_ps:[[0,0],[f*(a+l)+l,f*(Zi(s)+p)+p]]}}(t,e):1===e?function(t,n){const e=t[0],o=t[1],r=e[0],c=e[1],i=o[0],s=o[1],u=[[n*(i-r)+r,n*(s-c)+c],[i,s]],f=Zi(n),l=Zi(r),a=Zi(i),p=Zi(c);return{ps:u,_ps:[[f*(a+l)+l,f*(Zi(s)+p)+p],[0,0]]}}(t,n):function(t,n,e){const o=t[0],r=t[1],c=o[0],i=o[1],s=r[0],u=r[1],f=[[n*(s-c)+c,n*(u-i)+i],[e*(s-c)+c,e*(u-i)+i]],l=Zi(n),a=Zi(e),p=Zi(c),h=Zi(s),d=Zi(i),v=Zi(u);return{ps:f,_ps:[[l*(h+p)+p,l*(v+d)+d],[a*(h+p)+p,a*(v+d)+d]]}}(t,n,e)}(t,n[0],n[1]),r=e[0][0],c=e[1][0],i=3*Qi*o[0][0],s=3*Qi*o[1][0],u=e[0][1],f=e[1][1],l=3*Qi*o[0][1],a=3*Qi*o[1][1],p=Ji(r-i,c-s),h=Ki(r+i,c+s);return[[p,Ji(u-l,f-a)],[h,Ki(u+l,f+a)]]}(t,n):function(t,n){const e=t[0],o=t[t.length-1];if(0===n)return[e,e];if(1===n)return[o,o];const r=Ke(t,n);let c;if(4===t.length)c=Ri(t,[0,n]).map(t=>8*$i*t);else if(3===t.length)c=Ri(t,[0,n]).map(t=>5*$i*t);else if(2===t.length)c=Ri(t,[0,n]).map(t=>2*$i*t);else if(1===t.length)return[r,r];return[[r[0]-c[0],r[1]-c[1]],[r[0]+c[0],r[1]+c[1]]]}(t,n[0])}const ns=134217729;function es(t,n){const e=t[0],o=t[1],r=n[0],c=n[1],i=o/c,s=c*i,u=ns*c,f=u-(u-c),l=c-f,a=ns*i,p=a-(a-i),h=i-p,d=r*i,v=s+d,g=d-(v-s)+(l*h-(s-f*p-l*p-f*h)),m=v+g,x=(o-m+(e-(g-(m-v))))/c,w=i+x;return[x-(w-i),w]}const os=es,rs=Number.EPSILON/2,cs=rs*rs,{abs:is}=Math,ss=[0,1],us=dn,fs=Eo,ls=hn,as=le,ps=ie,hs=fr,ds=function(t,n,e,o){const r=t[0],c=t[1],i=n[0],s=n[1],u=os(t,n),f=Math.abs(r+c),l=Math.abs(i+s),a=l-rs*l-o;return a<=0?{est:u,err:Number.POSITIVE_INFINITY}:{est:u,err:(l*e+f*o)/a**2+9*cs*Math.abs(f/l)}},vs=Ho,gs=Ro;const ms=qo,xs=Eo,{min:ws,max:bs}=Math;function _s(t,n,e,o){const{ps:r}=t,c=Hi(n,r);if(void 0===c)return;const{coeffs:i,errBound:s,getPExact:u}=c,f=et(u),l=Je(i,e[0],e[1],s,f);if(void 0===l||0===l.length)return;const a=l[0],p=function(t,n,e){const o=ts(t,[e.tS,e.tE]),r=n[0],c=n[n.length-1],i=c[0]-r[0],s=c[1]-r[1],[[u,f],[l,a]]=o,p=0===s,h=p?r[0]:r[1],d=p?i:s,v=((p?u:f)-h)/d,g=((p?l:a)-h)/d;let m=ws(v,g)*(1-$n),x=bs(v,g)*(1+$n);return{multiplicity:1,t:(m+x)/2,tS:m,tE:x}}(r,n,a);return{xPs:{compensated:void 0,ri:a,getPExact:f,kind:1,p:void 0,curve:t},riSide:p,sideIdx:o,ps:r}}const Ms=et(function(t,n,e,o){const r=t.x.curve,c=t.x.ri.tS,i=e?t.next:t.prev,s=e?1:0,u=r===i.x.curve&&(e?c<i.x.ri.tS:c>i.x.ri.tS)?i.x.ri.tS:s;let f;for(let t=0;t<o.length;t++){const e=o[t],i=_s(r,n[e],c<u?[c,u]:[u,c],e);void 0!==i&&(f=i)}return f});function Ss(t){const n=(t=ne(t)).length;return 2===n?t:n<=1?[0,t[0]]:[t[n-2],t[n-1]]}const{abs:Cs,min:ys,max:Os,log2:Es,ceil:Is}=Math;function Ns(t,n){const{tS:e,tE:o}=t,r=o-e;if(0===r)return[{tS:[0,e],tE:[0,e],multiplicity:t.multiplicity}];const c=2**Is(Es(r)),i=function(t,n,e){return he(pe(t,e),n)}(n,c,e),s=i.map(Ss),u=s.map(t=>t[1]*$n**2),f=Je(s,0,1,u,()=>i),l=[];for(const t of f)l.push({tS:Et(e,t.tS*c),tE:Et(e,t.tE*c),multiplicity:t.multiplicity});return l}function ks(t,n){let e;const{_x_:o,dir:r,idx:c,swapped:i}=t,{_x_:s,dir:u,idx:f,swapped:l}=n,a=Ts(o.container.bigBox),p=1===r!=!!i,h=1===u!=!!l,d=t.oSideIdxs??Do(t,o,a,p),v=n.oSideIdxs??Do(n,s,a,h);if(1===d.length&&1===v.length&&(t.oSideIdx=t.oSideIdx??d[0],n.oSideIdx=n.oSideIdx??v[0],e=d[0]-v[0],0!==e))return e;const g=t.oFSC??Ms(o,a,p,d),m=n.oFSC??Ms(s,a,h,v),{sideIdx:x,riSide:w}=g,{sideIdx:b,riSide:_}=m;if(e=x-b,0!==e)return t.oSideIdx=x,n.oSideIdx=b,e;if(e=function(t,n){return t.tS<=n.tE&&n.tS<=t.tE}(w,_)?0:w.tS<_.tS?-1:1,0!==e)return e;const M=t.oFSCE??Bs(g,a),S=n.oFSCE??Bs(m,a);return e=function(t,n){return yo(t.tS,n.tE)<=0&&yo(n.tS,t.tE)<=0}(M,S)?0:yo(M.tS,S.tS),0!==e?e:(e=r-u,0!==e?e:1===r?c-f:f-c)}const Ps=et(Ns),Bs=et(function(t,n){const{xPs:e,ps:o,sideIdx:r}=t,{ri:c,getPExact:i}=e,s=Ps(c,i())[0];return function(t,n,e){const o=function(t,n){return n[0][0]!==n[1][0]||n[0][1]!==n[1][1]?4===t.length?function([[t,n],[e,o],[r,c],[i,s]],[u,f]){const l=us(f,u),a=3*Vi*is(l[1]),p=us(ss,u),h=3*Vi*is(p[1]),d=ds(l,p,a,h);f=fs(d.est,d.err);const v=us(ss,u),g=as(u,u),m=as(u,v),x=as(v,v),w=as(g,u),b=as(g,v),_=as(x,u),M=as(x,v),S=us(ss,f),C=as(f,f),y=as(f,S),O=as(S,S),E=as(C,f),I=as(C,S),N=as(O,f),k=as(O,S),P=is(u[1]),B=is(v[1]),T=is(g[1]),A=is(m[1]),z=is(x[1]),L=is(w[1]),D=is(b[1]),q=is(_[1]),W=is(M[1]),j=is(f[1]),F=is(S[1]),H=is(C[1]),Y=is(y[1]),R=is(O[1]),X=is(E[1]),Q=is(I[1]),V=is(N[1]),$=is(k[1]);let U=is(t),Z=is(n),G=is(e),J=is(o),K=is(r),tt=is(c),nt=is(i),et=is(s);const ot=ls(ps(i,u),ps(r,v)),rt=ls(ls(ps(i,g),ps(2*r,m)),ps(e,x)),ct=ls(ls(ps(i,w),ps(t,M)),ps(3,ls(ps(r,b),ps(e,_)))),it=ls(as(rt,f),as(ct,S)),st=ls(ls(as(ot,C),as(ct,O)),as(hs(rt),y)),ut=ls(ls(ps(i,E),as(ct,k)),ps(3,ls(as(ot,I),as(rt,N)))),ft=is(ct[1]),lt=nt*P+K*B,at=nt*T+2*K*A+G*z;U=nt*L+U*W+3*(K*D+G*q),G=at*j+ft*F,K=lt*H+ft*R+2*at*Y,nt=nt*X+ft*$+3*(lt*Q+at*V),U*=11*Vi,G*=15*Vi,K*=20*Vi,nt*=22*Vi;const pt=ls(ps(s,u),ps(c,v)),ht=ls(ls(ps(s,g),ps(2*c,m)),ps(o,x)),dt=ls(ls(ps(s,w),ps(n,M)),ps(3,ls(ps(c,b),ps(o,_)))),vt=ls(as(ht,f),as(dt,S)),gt=ls(ls(as(pt,C),as(dt,O)),as(hs(ht),y)),mt=ls(ls(ps(s,E),as(dt,k)),ps(3,ls(as(pt,I),as(ht,N)))),xt=is(dt[1]),wt=et*P+tt*B,bt=et*T+2*tt*A+J*z;Z=et*L+Z*W+3*(tt*D+J*q),J=bt*j+xt*F,tt=wt*H+xt*R+2*bt*Y,et=et*X+xt*$+3*(wt*Q+bt*V),Z*=11*Vi,J*=15*Vi,tt*=20*Vi,et*=22*Vi;const _t=vs(vs(fs(ct,-U),fs(it,-G)),vs(fs(st,-K),fs(ut,-nt))),Mt=gs(gs(fs(ct,+U),fs(it,+G)),gs(fs(st,+K),fs(ut,+nt)));return[[_t,vs(vs(fs(dt,-Z),fs(vt,-J)),vs(fs(gt,-tt),fs(mt,-et)))],[Mt,gs(gs(fs(dt,+Z),fs(vt,+J)),gs(fs(gt,+tt),fs(mt,+et)))]]}(t,n):3===t.length?function([[t,n],[e,o],[r,c]],[i,s]){const u=us(s,i),f=3*Vi*is(u[1]),l=us(ss,i),a=3*Vi*is(l[1]),p=ds(u,l,f,a);s=fs(p.est,p.err);const h=us(ss,i),d=as(i,i),v=as(i,h),g=as(h,h),m=us(ss,s),x=as(s,s),w=as(s,m),b=as(m,m),_=is(i[1]),M=is(h[1]),S=is(d[1]),C=is(v[1]),y=is(g[1]),O=is(s[1]),E=is(m[1]),I=is(x[1]),N=is(w[1]),k=is(b[1]);let P=is(t),B=is(n),T=is(e),A=is(o),z=is(r),L=is(c);const D=ls(ls(ps(r,d),ps(2*e,v)),ps(t,g)),q=ls(ps(r,i),ps(e,h)),W=D,j=ls(as(s,q),as(m,D)),F=ls(ls(ps(r,x),as(hs(w),q)),as(b,D)),H=z*S+2*T*C+P*y,Y=z*_+T*M;P=H,T=O*Y+E*H,z=I*r+2*N*Y+k*H,P*=7*Vi,T*=11*Vi,z*=14*Vi;const R=ls(ls(ps(c,d),ps(2*o,v)),ps(n,g)),X=ls(ps(c,i),ps(o,h)),Q=R,V=ls(as(s,X),as(m,R)),$=ls(ls(ps(c,x),as(hs(w),X)),as(b,R)),U=L*S+2*A*C+B*y,Z=L*_+A*M;B=U,A=O*Z+E*U,L=I*c+2*N*Z+k*U,B*=7*Vi,A*=11*Vi,L*=14*Vi;const G=vs(vs(fs(W,-P),fs(j,-T)),fs(F,-z)),J=gs(gs(fs(W,+P),fs(j,+T)),fs(F,+z));return[[G,vs(vs(fs(Q,-B),fs(V,-A)),fs($,-L))],[J,gs(gs(fs(Q,+B),fs(V,+A)),fs($,+L))]]}(t,n):function([[t,n],[e,o]],[r,c]){const i=us(c,r),s=3*Vi*is(i[1]),u=us(ss,r),f=3*Vi*is(u[1]),l=ds(i,u,s,f);c=fs(l.est,l.err);const a=us(ss,r),p=us(ss,c),h=is(r[1]),d=is(a[1]),v=is(c[1]),g=is(p[1]);let m=is(t),x=is(n),w=is(e),b=is(o);const _=ls(ps(e,r),ps(t,a)),M=ls(ps(e,c),as(_,p));m=w*h+m*d,w=w*v+m*g,m*=3*Qi,w*=7*Qi;const S=ls(ps(o,r),ps(n,a)),C=ls(ps(o,c),as(S,p));x=b*h+x*d,b=b*v+x*g,x*=3*Qi,b*=7*Qi;const y=vs(fs(_,-m),fs(M,-w)),O=gs(fs(_,+m),fs(M,+w));return[[y,vs(fs(S,-x),fs(C,-b))],[O,gs(fs(S,+x),fs(C,+b))]]}(t,n):function(t,n){const e=t[0],o=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,o[0]],n=[0,o[1]];return[[t,n],[t,n]]}const r=To(t,n);let c;if(4===t.length)c=Ri(t,n).map(t=>16*Ui*t);else if(3===t.length)c=Ri(t,n).map(t=>10*Ui*t);else if(2===t.length)c=Ri(t,n).map(t=>4*Ui*t);else if(1===t.length)return[r,r];return[[fs(r[0],-c[0]),fs(r[1],-c[1])],[fs(r[0],+c[0]),fs(r[1],+c[1])]]}(t,n[0])}(t,[e.tS,e.tE]),r=n[0],c=n[n.length-1],i=c[0]-r[0],s=c[1]-r[1],[[u,f],[l,a]]=o,p=0===s,h=p?r[0]:r[1],d=p?i:s,v=p?l:a,g=jo(ms(p?u:f,h),d),m=jo(ms(v,h),d);return{tS:ms(Ho(g,m),6*Zn),tE:xs(Ro(g,m),6*Zn),multiplicity:1}}(o,n[r],s)}),Ts=et(function(t){const[[n,e],[o,r]]=t;return[[[o,e],[n,e]],[[n,e],[n,r]],[[n,r],[o,r]],[[o,r],[o,e]]]});function As(t){for(let n of t)if(0===n.x.kind)return!0;return!1}const zs=So(function(t){const{inOuts:n,xs:e}=t;(n.length>2||As(t.xs))&&n.sort(ks);let o=n[n.length-1];for(let t=0;t<n.length;t++){const e=n[t];e.prevAround=o,o.nextAround=e,o=e}}),{abs:Ls,min:Ds}=Math;function qs(t,n,e){let o=2**(t+1);const[r,c]=e;let i=-o,s=-o,u=+o,f=+o;for(const[[t,e],[o,l]]of n){let n=0,a=0;r<t?(n=1,a=t):r>o&&(n=-1,a=o);let p=0,h=0;c<e?(p=1,h=e):c>l&&(p=-1,h=l);let d=!1,v=!1;if(0!==n&&0===p)d=!0;else if(0!==p&&0===n)v=!0;else if(0!==n&&0!==p){const t=Ls(a-r),n=Ls(h-c);d=t>=n,v=n>=t}d&&(n>0?a<u&&(u=a):a>i&&(i=a)),v&&(p>0?h<f&&(f=h):h>s&&(s=h))}const l=.5;return[[r+(i-r)*l,c+(s-c)*l],[r+(u-r)*l,c+(f-c)*l]]}const Ws=So(function(t,n){for(const e of t){const[[t,o],[r,c]]=e.box,i=[(t+r)/2,(o+c)/2],s=qs(n,[...e.xs.map(t=>t.next.container.box),...e.xs.map(t=>t.prev.container.box)],i);e.bigBox=s}return t});function js(t,n,e=t=>void 0!==t){const o=[];for(let r=0;r<t.length;r++){const c=t[r],i=[];for(let t=0;t<c.length;t++)e(n(c[t]))&&i.push(n(c[t]));o.push(i)}return o}function Fs(t){let n=t[t.length-1];for(let e=0;e<t.length;e++){const o=t[e];o.prevAround=n,n.nextAround=o,n=o}}const Hs=So(function(t,n,e){const o=js(t,t=>({x:t}));let r=function(t,n){const e=2**n;return t.map(t=>{const{p:n}=t[0].x;return{xs:t,box:[[n[0]-e,n[1]-e],[n[0]+e,n[1]+e]]}})}(o,e);r=Co(r),r=function(t,n){const e=2**(n-1),o=t=>fo(t/e)*e,r=t=>lo(t/e)*e;return t.map(t=>{const{xs:n,box:e}=t,[c,i]=e;return{xs:n,box:[c.map(o),i.map(r)]}})}(r,e),function(t){for(const n of t)for(const t of n.xs)t.container=n}(r),function(t){const n=[];for(const e of t)for(const t of e){const{idx:e}=t.x.curve.loop;(n[e]??=[]).push(t)}for(const t of n){if(void 0===t||0===t.length)continue;t.sort(uo);const n=t.length;for(let e=0;e<n;e++){const o=t[e],{container:r}=o;let c=(e+1)%n;for(;c!==e&&t[c].container===r;)c=(c+1)%n;let i=(e-1+n)%n;for(;i!==e&&t[i].container===r;)i=(i-1+n)%n;let s=o;s.next=t[c],s.prev=t[i],t[(e-1+n)%n].container!==r&&(s.in_={dir:-1,_x_:o,loop:o.x.curve.loop.beziers}),t[(e+1)%n].container!==r&&(s.out={dir:1,_x_:o,loop:o.x.curve.loop.beziers})}}}(o);for(const t of r){const n=[];for(const e of t.xs)e.in_&&n.push(e.in_),e.out&&n.push(e.out);t.inOuts=n;for(const e of n)e.container=t}const c=Ws(r,n);return function(t){let n=0;for(const e of t)for(const t of e.inOuts)t.idx=++n}(c),function(t){for(const n of t)for(const t of n.inOuts)if(1===t.dir){const n=t;let{_x_:e}=n;e=e.next,n.twin=e.in_,n.idx=n.twin.idx}else{const n=t;let{_x_:e}=n;e=e.prev,n.twin=e.out,n.idx=n.twin.idx}}(c),c.forEach(zs),c.forEach(t=>Fs(t.inOuts)),r});function Ys(t,n,e){const o=(t[0]-e[0])*(n[1]-e[1]),r=(t[1]-e[1])*(n[0]-e[0]),c=o-r;let i;if(o>0){if(r<=0)return c;i=o+r}else{if(!(o<0))return c;if(r>=0)return c;i=-o-r}return Math.abs(c)>=3330669073875472e-31*i?c:function(t,n,e,o){const r=t[0]-e[0],c=n[0]-e[0],i=t[1]-e[1],s=n[1]-e[1],u=Mt(me(r,s),me(i,c));let f=bt(u);if(Math.abs(f)>=2220446049250315e-31*o)return f;const l=dt(t[0],e[0])[0],a=dt(n[0],e[0])[0],p=dt(t[1],e[1])[0],h=dt(n[1],e[1])[0];if(0===l&&0===p&&0===a&&0===h)return f;const d=1109335647967049e-46*o+3330669073875471e-31*Math.abs(f);if(f+=r*h+s*l-(i*a+c*p),Math.abs(f)>=d)return f;const v=vt(u,Mt(me(l,s),me(p,c))),g=vt(v,Mt(me(r,h),me(i,a)));let m=vt(g,Mt(me(l,h),me(p,a)));return m=ne(m),m[m.length-1]}(t,n,e,i)}function Rs(t){if(4===t.length)return 0===Ys(t[0],t[1],t[2])&&0===Ys(t[1],t[2],t[3])&&0===Ys(t[0],t[2],t[3]);if(3===t.length)return 0===Ys(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 Xs(t){if(!Rs(t))return!1;const n=t.map(t=>t[0]),e=t.map(t=>t[1]);return!(Qs(n)&&Qs(e))}function Qs(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 Vs(t,n){const e=(2**(53-n)+1)*t;return e-(e-t)}const{floor:$s,log2:Us,abs:Zs}=Math;function Gs(t,n){const e=n[0]-t[0],o=n[1]-t[1];return e*e+o*o}function Js(t,n){const e=n/Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[e*t[0],e*t[1]]}function Ks(t){const n=t[0][0],e=t[0][1];for(let o=1;o<t.length;o++)if(n!==t[o][0]||e!==t[o][1])return!1;return!0}const tu=me,nu=vt,{abs:eu}=Math;function ou(t){const[[n,e],[o,r],[c,i],[s,u]]=t,f=s+3*o,l=n+3*c,a=f-l,p=eu(3*o)+eu(f)+(eu(3*c)+eu(l))+eu(a);if(eu(a)-Qi*p>0)return!1;const h=u+3*r,d=e+3*i,v=h-d,g=eu(3*r)+eu(h)+(eu(3*i)+eu(d))+eu(v);return!(eu(v)-Qi*g>0)&&0===St(Mt(nu([s],tu(3,o)),nu([n],tu(3,c))))&&0===St(Mt(nu([u],tu(3,r)),nu([e],tu(3,i))))}function ru(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:cu}=Math;function iu(t,n,e){if(void 0!==t&&!Ks(t)){if(2===t.length)return t;if(3===t.length){if(ru(t))return Rs(t)?[t[0],t[2]]:t;if(uu(t[0],t[2]))return;return[t[0],t[2]]}if(ru(t)){const o=su(t);if(void 0===o)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}(o,t)?t:iu(o,n,e)}if(uu(t[0],t[3])){if(Rs(t))return;return t}if(Rs(t))return[t[0],t[3]];if(uu(t[0],t[1])&&uu(t[1],t[2])||uu(t[1],t[2])&&uu(t[2],t[3])||uu(t[0],t[1])&&uu(t[2],t[3]))return iu([t[0],t[t.length-1]],n,e);if(uu(t[0],t[2])||uu(t[1],t[3])||uu(t[1],t[2]))return t;if(uu(t[0],t[1])){if(Gs(t[1],t[2])<4*n)return[t[0],t[2],t[2],t[3]];{const o=Js(rt(t[1],t[2]),2*n),r=ft(t[1],o);return su([t[0],e(r),t[2],t[3]])}}if(uu(t[2],t[3])){if(Gs(t[2],t[1])<4*n)return[t[0],t[1],t[1],t[3]];{const o=Js(rt(t[2],t[1]),2*n),r=ft(t[2],o);return su([t[0],t[1],e(r),t[3]])}}}}function su(t){return Rs(t)?[t[0],t[3]]:ou(t)?Uc(t):t}function uu(t,n){return t[0]===n[0]&&t[1]===n[1]}function fu(t){return t}function lu(t){const n=function(t){const n=t[0],e=t[t.length-1];let o,r;if(n[0]<e[0]?(o={ts:[0,0],box:[n,n]},r={ts:[1,1],box:[e,e]}):(o={ts:[1,1],box:[e,e]},r={ts:[0,0],box:[n,n]}),2===t.length)return{minX:o,maxX:r};const[c]=pt(t),i=Je(c,0,1)||[];for(let n=0;n<i.length;n++){const e=i[n],c=[e.tS,e.tE],s=ts(t,c);s[0][0]<o.box[0][0]&&(o={ts:c,box:s}),s[1][0]>r.box[0][0]&&(r={ts:c,box:s})}return{minX:o,maxX:r}}(t),e=function(t){const n=t[0],e=t[t.length-1];let o,r;if(n[1]<e[1]?(o={ts:[0,0],box:[n,n]},r={ts:[1,1],box:[e,e]}):(o={ts:[1,1],box:[e,e]},r={ts:[0,0],box:[n,n]}),2===t.length)return{minY:o,maxY:r};const[,c]=pt(t),i=Je(c,0,1)||[];for(let n=0;n<i.length;n++){const e=i[n],c=[e.tS,e.tE],s=ts(t,c);s[0][1]<o.box[0][1]&&(o={ts:c,box:s}),s[1][1]>r.box[0][1]&&(r={ts:c,box:s})}return{minY:o,maxY:r}}(t);return[[n.minX.box[0][0],e.minY.box[0][1]],[n.maxX.box[1][0],e.maxY.box[1][1]]]}function au(t){let n=0;for(let e=0;e<t.length-1;e++)n+=nn(t[e],t[e+1]);return n}const{sqrt:pu}=Math;function hu(t){const[n,e]=t[0],[o,c]=t[t.length-1];let i,s;const u=au(t);if(256*Gs(t[0],t[t.length-1])<u*u){const[o,r]=Ke(t,.5),c=pu((o-n)*(o-n)+(r-e)*(r-e));i=(r-e)/c,s=(o-n)/c}else{const t=pu((o-n)*(o-n)+(c-e)*(c-e));i=(c-e)/t,s=(o-n)/t}const f=function(t,n,e){const o=ft(t[0].map(t=>-t));return lu(t.map(t=>r(-n,e,o(t))))}(t,i,s),[[l,a],[p,h]]=f,d=[f[0],[p,a],f[1],[l,h]],v=r(i,s);return d.map(n=>ft(t[0],v(n)))}function du(t,n,e){const o=n[0]-t[0],r=n[1]-t[1];return o*(e[0]-n[0])+r*(e[1]-n[1])}const vu=function(t,n){if(0===t.length)return;const e=t.slice(),o=function(t){let n,e=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY];for(let o=0;o<t.length;o++){const r=t[o][1];(r<e[1]||r===e[1]&&t[o][0]<e[0])&&(n=o,e=t[o])}return n}(e),[r]=e.splice(o,1);e.sort((t,n)=>{let e=-Ys(r,t,n);return 0!==e?e:(e=t[1]-n[1],0!==e?e:t[0]-n[0])}),e.unshift(r);const c=function(t){const n=[t[0]],e=t.length;for(let o=1;o<t.length;o++){const r=t[(o+e-1)%e],c=t[o];r[0]===c[0]&&r[1]===c[1]||n.push(c)}return n}(e),i=[];for(const t of c){for(;i.length>=2&&Ys(i[i.length-2],i[i.length-1],t)<0;)i.pop();i.push(t)}if(n||i.length<3)return i;const s=[];{const t=i.length;for(let n=0;n<t;n++){const e=(n+1)%t,o=i[(n+t-1)%t],r=i[n],c=i[e];(0!==Ys(o,r,c)||du(o,r,c)<0)&&s.push(r)}}return s},gu=et(lu),mu=So(function(t,n){const e=t.slice().map(function(t,n,e=!0){const o=2**(t-n),r=e?function(t,n){const e=function(t,n){return function(e){const o=$s(Us(Zs(e))),r=n-t+o+1;return r<=0?0:n>=53?e:Vs(e,r)}}(t,n);return function(t){const n=e(t[0]),o=e(t[1]);return n===t[0]&&o===t[1]?t:[n,o]}}(t,n):fu;return t=>{const n=[];for(let e=0;e<t.length;e++){let c=t[e].slice();const i=n[n.length-1],s=i?i[i.length-1]:r(t[0][0]);c[0]=s,c=c.map(t=>r(t)),Xs(c)&&(c=[c[0],c[c.length-1]]),c=iu(c,o,r),void 0!==c&&n.push(c)}const e=n.length;if(!e)return[];const c=n[e-1];return c[c.length-1]=n[0][0],n}}(n,46)).filter(t=>t.length>0);return"undefined"!=typeof _debug_&&(_debug_.timing.normalize=performance.now()-_debug_.timing.timingStart),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=gu(t),e=hu(t),o=vu(t,!1);_debug_.elems.bezier_.push(t),_debug_.elems.looseBoundingBox_.push(n),_debug_.elems.tightBoundingBox_.push(e),_debug_.elems.boundingHull_.push(o)}}}(e),e}),{max:xu,abs:wu}=Math;function bu(t,n){return t[1]>n[1]||!(t[1]<n[1])&&t[0]>=n[0]}function _u(t){const{ps:n,ts:e}=t;return U(n,e[0],e[1])}const{min:Mu,max:Su}=Math,Cu=et(function(t){const n=t.map(no);return{minX:Mu(...n.map(t=>t.box[0][0])),maxX:Su(...n.map(t=>t.box[1][0])),minY:Mu(...n.map(t=>t.box[0][1])),maxY:Su(...n.map(t=>t.box[1][1]))}});function yu(t,n){let e=0,o=t.length;for(;e<o;){const r=e+o>>>1;t[r]<n?e=r+1:o=r}return e}const Ou=et(function(t){const n=new Set,e=new Array(t.length);for(let o=0;o<t.length;o++){const{ps:r}=t[o],[[,c],[,i]]=gu(r);e[o]=[c,i],n.add(c),n.add(i)}const o=Array.from(n).sort((t,n)=>t-n),r=0===o.length?0:2*o.length-1,c=new Array(r);for(let t=0;t<r;t++)c[t]=[];for(let n=0;n<t.length;n++){const[r,i]=e[n],s=2*yu(o,r),u=2*yu(o,i);for(let e=s;e<=u;e++){const o=t[n];c[e].push(o)}}return{ys:o,slabs:c}}),{sign:Eu}=Math;function Iu(t,n){const e=0===n?t:t.toReversed(),o=[e[0]?.[1],e[1]?.[1],e[2]?.[1],e[3]?.[1]];let r,c;return r=o[1],c=Eu(r),0!==c?c:(r=o[2],void 0===r?0:(c=Eu(r),0!==c?c:(r=o[3],void 0===r?0:Eu(r))))}function Nu(t,n,e){return 0===e?0===n?function(t){return 4===t.length?function(t){const[[n,e],[o,r],[c,i],[s,u]]=t;return[u-e+3*(r-i),3*(i+e-2*r),3*(r-e),e]}(t):3===t.length?function(t){const[[n,e],[o,r],[c,i]]=t;return[i+e-2*r,2*(r-e),e]}(t):function(t){const[[n,e],[o,r]]=t;return[r-e,e]}(t)}(t):1===n?function(t){const n=t[1][1];if(2===t.length)return[n];const e=t[2][1];return 3===t.length?[e-2*n,2*n]:[t[3][1]+3*(n-e),3*(e-2*n),3*n]}(t):2===n?function(t){if(2===t.length)return[];const n=t[2][1];return 3===t.length?[n]:[t[3][1]-3*n,3*n]}(t):function(t){return t.length<=3?[]:[t[3][1]]}(t):0===n?1===e?function(t){const n=t[0][1];if(2===t.length)return[-n];const e=t[1][1];return 3===t.length?[-2*e+n,-n]:[3*(e-t[2][1])-n,-3*e+2*n,-n]}(t):2===e?function(t){if(2===t.length)return[];const n=t[0][1];return 3===t.length?[n]:[3*t[1][1]-n,n]}(t):function(t){return t.length<=3?[]:[-t[0][1]]}(t):1===n&&1===e?function(t){if(2===t.length)return[];const n=t[1][1];return 3===t.length?[-2*n]:[3*(n-t[2][1]),-3*n]}(t):2===n&&1===e?function(t){return t.length<=3?[]:[-3*t[2][1]]}(t):1===n&&2===e?function(t){return t.length<=3?[]:[3*t[1][1]]}(t):[]}const ku=So(function(t,n,e){if(function(t,n){const e=Cu(t),o=Cu(n);return e.minX<o.minX||e.maxX>o.maxX||e.minY<o.minY||e.maxY>o.maxY}(n,Tu(e)))return!1;for(const o of function*(){yield 0;for(let t=1;t<=30;t++){const n=2**t;for(let t=1;t<n;t+=2)yield t/n}}())for(const r of n){const n=Pu(t,Ao(r,o),e);if(void 0!==n)return n}throw new Error("_isLoopInLoop: no non-degenerate ray-start point found")});function Pu(t,n,e){const o=Bu(t,e,n);if(void 0!==o)return o%2!=0}const Bu=So(function(t,n,e){const[o,r]=e,c=function(t,n){if(t.length<10){const e=[];for(let o=0;o<t.length;o++){const r=t[o],{ps:c}=r,[[,i],[,s]]=gu(c);i<=n&&s>=n&&e.push(r)}return e}const e=Ou(t),{ys:o,slabs:r}=e;if(0===o.length||n<o[0]||n>o[o.length-1])return[];const c=yu(o,n);return r[o[c]===n?2*c:2*c-1]}(n,r);let i=0;for(let n=0;n<c.length;n++){const u=c[n],{ps:f,ts:l}=u;if(gu(f)[0][0]>o)continue;const a=f.map(ft([0,-r])),p=a.length;let h=0;for(;h<p-1&&0===a[h][1];)h++;let d=0;for(;d<p-1&&0===a[p-1-d][1];)d++;const v=Nu(a,h,d),g=Math.min(l[0],l[1]),m=Math.max(l[0],l[1]);if(h>0&&g<=0){const t=Iu(a,0)>0,n=e[0]>=a[0][0];t&&n&&i++}if(d>0&&m>=1){const t=Iu(a,1)>0,n=e[0]>=a[a.length-1][0];t&&n&&i++}const x=Je(v,s(g-2*$n,0,1),s(m+2*$n,0,1));if(void 0!==x&&0!==x.length)for(const n of x){const{t:o,multiplicity:r}=n;if(0!==g&&Math.abs(o-g)<=4*$n||1!==m&&Math.abs(o-m)<=4*$n)return;const c=Ao(a,o)[0],s=24*2**t*(4*$n),u=c-s,f=c+s,l=e[0]>u,p=l===e[0]>f;if(p)p&&l&&(i+=r%2);else{const t=Ns(n,v.map(t=>[t]));for(let n=0;n<t.length;n++){const{tS:o,tE:r,multiplicity:c}=t[n],s=To(a,Sr(hn(o,r)))[0];bu([0,e[0]],s)&&(i+=c%2)}}}}return i}),Tu=et(function(t){return t.map(_u)});function Au(t){const n=t._x_,e=t.twin._x_,o=n.x.curve,r=n.x.ri.t,c=e.x.curve,i=e.x.ri.t;let s=o,u=r;const f=[];for(;;){if(s===c&&(u<i||u===i&&0!==f.length)){const t=s.ps,n=[u,i];return f.push({ps:t,ts:n}),f}{const t=s.ps,n=[u,1];f.push({ps:t,ts:n})}u=0,s=s.next}}const zu=et(function(t){const n=[];for(const e of t.path)if(e.swapped){const t=Au(e.twin);for(let e=t.length-1;e>=0;e--){const{ps:o,ts:r}=t[e];n.push({ps:o,ts:[r[1],r[0]]})}}else n.push(...Au(e));return n});function Lu(t,n,e){let o=n;const r=Array.from(n.children);for(;r.length;)c(r.pop());return o;function c(n){const c=zu(n);if(ku(t,e,c)){o=n;for(const t of n.children)r.push(t)}}}const Du=So(function(t,n,e){const o=[],r=[];let c=e;const i=function(t,n,e){const o=function(t,n){return function(e,o,r){if(t.has(e))return;const c=e;void 0===c.orientation&&(c.orientation=o,c.parent=r,c.windingNum=r.windingNum+c.orientation,n.push(c))}}(e,n);return function(n){let e,r=n.twin,c=1,i=r;for(;i=1===t.orientation?i.nextAround:i.prevAround,i!==r;){if(c-=i.dir,-1===i.dir)continue;const n=i;e?0===c?o(n,t.orientation,t.parent):-1===c&&o(n,-t.orientation,t.parent):0===c?e=n:1===c&&o(n,t.orientation,t)}return e}}(e,o,t);do{t.add(c),n.add(c.container),r.push(c),c=i(c)}while(c!==e);return e.path=r,o});function qu(t,n,e){const o=[t];for(;o.length;){const t=o.pop();if(n.has(t))continue;t.children=new Set;const r=Du(n,e,t);t.parent.children=t.parent.children||new Set,t.parent.children.add(t),o.push(...r)}}const Wu=So(function(t,n){const e={dir:void 0,idx:0,parent:void 0,children:new Set,windingNum:0,_x_:void 0,orientation:0,twin:void 0,path:void 0,nextAround:void 0,prevAround:void 0,loop:void 0,container:void 0},o=new Set,r=new Set;for(let c=0;c<n.length;c++){const i=n[c];if(r.has(i)||0===i.inOuts.length)continue;const{inOuts:s}=i,u=s[0],f=s[s.length-1],l=1===u.dir?u:f,a=Lu(t,e,l.loop);l.parent=a,l.orientation=f.dir,l.windingNum=a.windingNum+f.dir,l.children=new Set,qu(l,o,r)}return e});function ju(t){return{t,tS:t,tE:t,multiplicity:1}}function Fu(t){return(t.tS+t.tE)/2}const Hu=hn,Yu=wt,Ru=vt,Xu=le,{abs:Qu}=Math;const{abs:Vu}=Math;const{abs:$u}=Math,Uu=le,Zu=hn,Gu=wt,Ju=vt,{abs:Ku}=Math;function tf(t,n){const[e,o]=n,r=e.length,c=o.length,i=e[r-1],s=o[c-1],u=1===r&&1===c;{const{vₓₓ:n,vₓᵧ:e,vᵧᵧ:o,vₓ:r,vᵧ:c,v:f}=function(t){const[[n,e,o],[r,c,i]]=function(t){const[[n,e],[o,r],[c,i]]=t;return[[c+n-2*o,2*(o-n),n],[i+e-2*r,2*(r-e),e]]}(t),s=n*c-e*r,u=n*i-o*r;return{vₓₓ:-r*r,vₓᵧ:2*n*r,vᵧᵧ:-n*n,vₓ:c*s-2*r*u,vᵧ:2*n*u-e*s,v:s*(e*i-o*c)-u*u}}(t),{vₓₓ_:l,vₓᵧ_:a,vᵧᵧ_:p,vₓ_:h,vᵧ_:d,v_:v}=function(t){const[n,e]=t[0],[[o,r],[c,i]]=function(t){const[[n,e],[o,r],[c,i]]=t,s=Vu(n),u=Vu(o),f=Vu(c),l=Vu(e),a=Vu(r);return[[f+s+2*u,2*(u+s),0],[Vu(i)+l+2*a,2*(a+l),0]]}(t),s=$u(n),u=$u(e),f=o*i+r*c,l=o*u+s*c;return{vₓₓ_:c*c,vₓᵧ_:2*o*c,vᵧᵧ_:o*o,vₓ_:i*f+2*c*l,vᵧ_:2*o*l+r*f,v_:f*(r*u+s*i)+l*l}}(t),g=u?0:1,m=Ku(i),x=Ku(s);if((g+12)*$i*(l*(m*m)+a*(m*x)+p*(x*x)+(h*m+d*x)+v)<Ku(n*i*i+e*i*s+o*s*s+(r*i+c*s)+f))return!1}{const{coeffs:{vₓₓ:n,vₓᵧ:r,vᵧᵧ:c,vₓ:u,vᵧ:f,v:l},errorBound:{vₓₓ_:a,vₓᵧ_:p,vᵧᵧ_:h,vₓ_:d,vᵧ_:v,v_:g}}=gr(t),m=Ss(e),x=Ss(o),w=Ku(i),b=Ku(s),_=w/3,M=b/3,S=Uu(m,m),C=S[1],y=2*(w*_+C),O=Uu(x,x),E=O[1],I=2*(b*M+E),N=Uu(m,x),k=Ku(N[1]),P=w*M+_*b+2*k,B=Uu(n,S),T=Ku(n[1])*y+a*C+2*Ku(B[1]),A=Uu(r,N),z=Ku(r[1])*P+p*k+2*Ku(A[1]),L=Uu(c,O),D=Ku(c[1])*I+h*E+2*Ku(L[1]),q=Uu(m,u),W=Ku(u[1])*_+d*w+2*Ku(q[1]),j=Uu(x,f),F=Ku(f[1])*M+v*b+2*Ku(j[1]),H=Zu(B,A),Y=T+z+Ku(H[1]),R=Zu(H,L),X=Y+D+Ku(R[1]),Q=Zu(q,j),V=W+F+Ku(Q[1]),$=Zu(R,Q),U=X+V+Ku($[1]),Z=Zu($,l),G=U+g+Ku(Z[1]);if(Ui*G<Ku(bt(Z)))return!1}{const n=function(t){return qc(Sc(t))}(t);if(void 0===n)return u&&i===t[0][0]&&s===t[0][1];n.hasOwnProperty("vₓₓ")||(n.vₓₓ=[0],n.vₓᵧ=[0],n.vᵧᵧ=[0]);const{vₓₓ:r,vₓᵧ:c,vᵧᵧ:f,vₓ:l,vᵧ:a,v:p}=n;return 0===St(Ju(Ju(Ju(Gu(r,Gu(e,e)),Gu(c,Gu(e,o))),Gu(f,Gu(o,o))),Ju(Ju(Gu(e,l),Gu(o,a)),p)))}}const{abs:nf}=Math,ef=le,of=hn,rf=wt,cf=vt,{abs:sf}=Math;function uf(t,n){const[e,o]=n,r=e.length,c=o.length,i=e[r-1],s=o[c-1],u=1===r&&1===c;{const{vₓₓₓ:n,vₓₓᵧ:e,vₓᵧᵧ:o,vᵧᵧᵧ:r,vₓₓ:c,vₓᵧ:f,vᵧᵧ:l,vₓ:a,vᵧ:p,v:h}=function(t){const[[n,e,o,r],[c,i,s,u]]=function(t){const[[n,e],[o,r],[c,i],[s,u]]=t;return[[s-n+3*(o-c),3*(c+n-2*o),3*(o-n),n],[u-e+3*(r-i),3*(i+e-2*r),3*(r-e),e]]}(t),f=n*s,l=o*c,a=n*i,p=e*c,h=n*n,d=c*c,v=n*u-r*c,g=f-l,m=a-p,x=e*u-r*i,w=e*s-o*i,b=o*u-r*s,_=2*g,M=v*v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),wt=sf(h[1])*A+S*B+2*sf(xt[1]),_t=of(et,rt),Mt=ot+ct+sf(_t[1]),St=of(it,ut),Ct=st+ft+sf(St[1]),yt=of(_t,St),Ot=Mt+Ct+sf(yt[1]),Et=of(lt,pt),It=at+ht+sf(Et[1]),Nt=of(Et,dt),kt=It+vt+sf(Nt[1]),Pt=of(yt,Nt),Bt=Ot+kt+sf(Pt[1]),Tt=of(gt,xt),At=mt+wt+sf(Tt[1]),zt=of(Tt,d),Lt=At+C+sf(zt[1]),Dt=of(Pt,zt),qt=Bt+Lt+sf(Dt[1]);if(Ui*qt<sf(bt(Dt)))return!1}{const n=function(t){return ei(Mc(t))}(t);if(void 0===n)return u&&i===t[0][0]&&s===t[0][1];n.hasOwnProperty("vₓₓₓ")||(n.vₓₓₓ=[0],n.vₓₓᵧ=[0],n.vₓᵧᵧ=[0],n.vᵧᵧᵧ=[0]),n.hasOwnProperty("vₓₓ")||(n.vₓₓ=[0],n.vₓᵧ=[0],n.vᵧᵧ=[0]);const{vₓₓₓ:r,vₓₓᵧ:c,vₓᵧᵧ:f,vᵧᵧᵧ:l,vₓₓ:a,vₓᵧ:p,vᵧᵧ:h,vₓ:d,vᵧ:v,v:g}=n,m=rf(e,e),x=rf(e,m),w=rf(o,o),b=rf(o,w),_=rf(o,m),M=rf(e,w),S=rf(e,o),C=rf(r,x),y=rf(c,_),O=rf(f,M),E=rf(l,b),I=rf(a,m),N=rf(p,S),k=rf(h,w),P=rf(e,d),B=rf(o,v),T=cf(C,y),A=cf(O,E),z=cf(T,A),L=cf(I,N),D=cf(L,k),q=cf(z,D),W=cf(P,B),j=cf(W,g);return 0===St(cf(q,j))}}function ff(t,n){if(4===t.length)return uf(t,n);if(3===t.length)return tf(t,n);if(2===t.length)return function(t,n){const[e,o]=n,r=e.length,c=o.length,i=e[r-1],s=o[c-1],u=1===r&&1===c;{const{coeffs:{vₓ:n,vᵧ:r,v:c},errorBound:{v_:u}}=rr(t),f=Ss(e),l=Ss(o),a=Qu(i),p=Qu(s),h=Qu(n[1]),d=Qu(r[1]),v=a/3,g=p/3,m=n[1]*i,x=Xu(f,n),w=h*v+2*Qu(m),b=r[1]*s,_=Xu(l,r),M=d*g+2*Qu(b),S=Hu(x,_),C=w+M+Qu(S[1]),y=Hu(S,c),O=C+u+Qu(y[1]);if(Ui*O<Qu(bt(y)))return!1}{const n=function(t){return Ec(Cc(t))}(t);if(void 0===n)return u&&i===t[0][0]&&s===t[0][1];const{vₓ:r,vᵧ:c,v:f}=n,l=Yu(e,r),a=Yu(o,c);return 0===St(Ru(Ru(l,a),f))}}(t,n);if(1===t.length){const e=ne(n[0]),o=ne(n[1]);return 1===e.length&&1===o.length&&e[0]===t[0][0]&&o[0]===t[0][1]}throw new Error("The given bezier curve must be of order <= 3")}function lf(t){const n=t[0],e=t[1];return[(n[0]+e[0])/2,(n[1]+e[1])/2]}const af=dt,pf=Number.EPSILON;function hf(t){return[4*t[0],4*t[1]]}const df=Oo,vf=hn,gf=ie,mf=le,xf=fr,wf=hf,bf=dn;function _f(t,n){const e=t[0],o=t[1],r=t[2],c=t[3],i=e[0],s=e[1],u=o[0],f=o[1],l=r[0],a=r[1],p=c[0],h=c[1],[d,v]=n,g=df(i,d),m=df(u,d),x=df(l,d),w=df(p,d),b=df(s,v),_=df(f,v),M=df(a,v),S=df(h,v),C=mf(g,g),y=gf(6,mf(g,m)),O=gf(6,mf(g,x)),E=xf(mf(g,w)),I=gf(9,mf(m,m)),N=gf(18,mf(m,x)),k=gf(6,mf(m,w)),P=gf(9,mf(x,x)),B=gf(6,mf(x,w)),T=mf(w,w),A=mf(b,b),z=gf(6,mf(b,_)),L=gf(6,mf(b,M)),D=xf(mf(b,S)),q=gf(9,mf(_,_)),W=gf(18,mf(_,M)),j=gf(6,mf(_,S)),F=gf(9,mf(M,M)),H=gf(6,mf(M,S)),Y=mf(S,S),R=vf(k,P),X=vf(E,N),Q=vf(O,I),V=vf(j,F),$=vf(D,W),U=vf(L,q);return[gf(6,vf(vf(vf(vf(bf(T,B),bf(C,y)),R),bf(Q,X)),vf(vf(vf(bf(Y,H),bf(A,z)),V),bf(U,$)))),gf(5,vf(bf(vf(vf(B,gf(5,y)),gf(3,X)),xf(vf(vf(R,xf(Q)),gf(3,C)))),bf(vf(vf(H,gf(5,z)),gf(3,$)),xf(vf(vf(V,xf(U)),gf(3,A)))))),wf(vf(bf(bf(R,gf(3,bf(X,xf(Q)))),gf(5,bf(xf(y),gf(3,C)))),bf(bf(V,gf(3,bf($,xf(U)))),gf(5,bf(xf(z),gf(3,A)))))),gf(3,vf(bf(X,xf(bf(xf(Q),gf(5,bf(y,xf(C)))))),bf($,xf(bf(xf(U),gf(5,bf(z,xf(A)))))))),xf(vf(bf(Q,gf(5,bf(y,gf(3,C)))),bf(U,gf(5,bf(z,gf(3,A)))))),vf(bf(y,gf(6,C)),bf(z,gf(6,A)))]}const Mf=Oo,Sf=hn,Cf=ie,yf=le,Of=fr,Ef=dn,If=hf;function Nf(t,n){const[[e,o],[r,c],[i,s]]=t,[u,f]=n,l=Mf(e,u),a=Mf(r,u),p=Mf(i,u),h=Mf(o,f),d=Mf(c,f),v=Mf(s,f),g=yf(l,l),m=yf(l,a),x=yf(l,p),w=yf(a,a),b=yf(a,p),_=yf(p,p),M=yf(h,h),S=yf(h,d),C=yf(h,v),y=yf(d,d),O=yf(d,v),E=yf(v,v),I=Sf(C,Of(y)),N=Sf(x,Of(w));return[Sf(Ef(Sf(Sf(E,M),Of(I)),If(Sf(O,S))),Ef(Sf(Sf(_,g),Of(N)),If(Sf(b,m)))),Cf(3,Sf(Sf(Ef(O,I),Ef(Cf(3,S),M)),Sf(Ef(b,N),Ef(Cf(3,m),g)))),Sf(Ef(I,Cf(3,Ef(Of(S),M))),Ef(N,Cf(3,Ef(Of(m),g)))),Sf(Ef(S,M),Ef(m,g))]}function kf(t){return[-2*t[0],-2*t[1]]}const Pf=pn,Bf=hn,Tf=kf;function Af(t,n){const[[e,o],[r,c]]=t,[i,s]=n,u=e-i,f=r-i,l=o-s,a=c-s,p=Pf(u,u),h=Pf(u,f),d=Pf(f,f),v=Pf(l,l),g=Pf(l,a),m=Pf(a,a),x=Bf(h,g),w=Bf(v,p);return[Bf(Bf(d,m),Bf(w,Tf(x))),dn(x,w)]}function zf(t){const n=[];for(let e=0;e<t.length;e++)n.push(-2*t[e]);return n}const Lf=dt,Df=xt,qf=Bc,Wf=zf,jf=dt,Ff=xt,Hf=Bc;function Yf(t){const n=[];for(let e=0;e<t.length;e++)n.push(4*t[e]);return n}const Rf=dt,Xf=zf,{abs:Qf}=Math;function Vf(t,n){const e=t[0],o=t[1],r=t[2],c=t[3],i=Qf(e[0]),s=Qf(e[1]),u=Qf(o[0]),f=Qf(o[1]),l=Qf(r[0]),a=Qf(r[1]),p=Qf(c[0]),h=Qf(c[1]),d=Qf(n[0]),v=Qf(n[1]),g=i+d,m=u+d,x=l+d,w=p+d,b=s+v,_=f+v,M=a+v,S=h+v,C=g*g,y=6*g*m,O=6*x*w,E=b*b,I=6*b*_,N=6*M*S,k=6*m*w+9*x*x,P=2*g*w+18*m*x,B=6*g*x+9*m*m,T=6*_*S+9*M*M,A=2*b*S+18*_*M,z=6*b*M+9*_*_;return[6*(w*w+O+(C+y)+k+(B+P)+(S*S+N+(E+I)+T+(z+A))),5*(O+5*y+3*P+2*(k+2*B+3*C)+(N+5*I+3*A+2*(T+2*z+3*E))),4*(k+3*(P+2*B)+5*(2*y+3*C)+(T+3*(A+2*z)+5*(2*I+3*E))),3*(P+2*(2*B+5*(y+2*C))+(A+2*(2*z+5*(I+2*E)))),2*(B+5*(y+3*C)+(z+5*(I+3*E))),y+6*C+(I+6*E)]}function $f(t,n){const e=t[0],o=t[1],r=t[2],c=Qf(e[0]),i=Qf(e[1]),s=Qf(o[0]),u=Qf(o[1]),f=Qf(r[0]),l=Qf(r[1]),a=Qf(n[0]),p=Qf(n[1]),h=c+a,d=s+a,v=f+a,g=i+p,m=u+p,x=l+p,w=h*h,b=h*d,_=d*v,M=g*g,S=g*m,C=m*x,y=g*x+m*m*2,O=h*v+d*d*2;return[x*x+M+2*y+4*(C+S)+(v*v+w+2*O+4*(_+b)),3*(C+y+(3*S+M)+(_+O+(3*b+w))),y+3*(2*S+M)+(O+3*(2*b+w)),S+M+(b+w)]}function Uf(t,n){const e=t[0],o=t[1],r=Qf(e[0]),c=Qf(e[1]),i=Qf(o[0]),s=Qf(o[1]),u=Qf(n[0]),f=Qf(n[1]),l=r+u,a=i+u,p=c+f,h=s+f,d=l*a+p*h,v=p*p+l*l;return[a*a+h*h+2*d+v,d+v]}function Zf(t,n){const e=t.length-1;if(3===e)return{polyDd:_f(t,n),polyE:Vf(t,n).map(t=>20*t),getPolyExact:()=>function(t,n){const e=t[0],o=t[1],r=t[2],c=t[3],i=e[0],s=e[1],u=o[0],f=o[1],l=r[0],a=r[1],p=c[0],h=c[1],[d,v]=n,g=Lf(i,d),m=Lf(u,d),x=Lf(l,d),w=Lf(p,d),b=Lf(s,v),_=Lf(f,v),M=Lf(a,v),S=Lf(h,v),C=wt(g,g),y=Df(6,wt(g,m)),O=Df(6,wt(g,x)),E=qf(wt(g,w)),I=Df(9,wt(m,m)),N=Df(18,wt(m,x)),k=Df(6,wt(m,w)),P=Df(9,wt(x,x)),B=Df(6,wt(x,w)),T=wt(w,w),A=wt(b,b),z=Df(6,wt(b,_)),L=Df(6,wt(b,M)),D=qf(wt(b,S)),q=Df(9,wt(_,_)),W=Df(18,wt(_,M)),j=Df(6,wt(_,S)),F=Df(9,wt(M,M)),H=Df(6,wt(M,S)),Y=wt(S,S),R=vt(k,P),X=vt(E,N),Q=vt(O,I),V=vt(j,F),$=vt(D,W),U=vt(L,q),Z=Mt(vt(vt(T,C),vt(R,Q)),vt(vt(X,B),y)),G=Mt(vt(vt(Y,A),vt(V,U)),vt(vt($,H),z)),J=Df(6,vt(Z,G)),K=vt(Wf(vt(vt(R,qf(Q)),Df(3,C))),vt(vt(B,Df(3,X)),Df(5,y))),tt=vt(Wf(vt(vt(V,qf(U)),Df(3,A))),vt(vt(H,Df(3,$)),Df(5,z))),nt=Df(5,vt(K,tt)),et=vt(vt(R,Df(3,Mt(qf(Q),X))),Df(5,Mt(Df(3,C),qf(y)))),ot=vt(vt(V,Df(3,Mt(qf(U),$))),Df(5,Mt(Df(3,A),qf(z)))),rt=Df(4,vt(et,ot)),ct=Mt(X,qf(Mt(qf(Q),Df(5,Mt(y,qf(C)))))),it=Mt($,qf(Mt(qf(U),Df(5,Mt(z,qf(A)))))),st=Df(3,vt(ct,it)),ut=Mt(Q,Df(5,Mt(y,Df(3,C)))),ft=Mt(U,Df(5,Mt(z,Df(3,A))));return[J,nt,rt,st,qf(vt(ut,ft)),vt(Mt(y,Df(6,C)),Mt(z,Df(6,A)))].map(ne)}(t,n)};if(2===e)return{polyDd:Nf(t,n),polyE:$f(t,n).map(t=>16*t),getPolyExact:()=>function(t,n){const[[e,o],[r,c],[i,s]]=t,[u,f]=n,l=jf(e,u),a=jf(r,u),p=jf(i,u),h=jf(o,f),d=jf(c,f),v=jf(s,f),g=wt(l,l),m=wt(l,a),x=wt(l,p),w=wt(a,a),b=wt(a,p),_=wt(p,p),M=wt(h,h),S=wt(h,d),C=wt(h,v),y=wt(d,d),O=wt(d,v),E=wt(v,v),I=vt(C,Hf(y)),N=vt(x,Hf(w)),k=vt(Mt(vt(_,Hf(N)),Yf(vt(b,m))),g),P=vt(Mt(vt(E,Hf(I)),Yf(vt(O,S))),M),B=vt(k,P),T=vt(Mt(b,N),Mt(Ff(3,m),g)),A=vt(Mt(O,I),Mt(Ff(3,S),M));return[B,Ff(3,vt(T,A)),vt(Mt(I,Ff(3,Mt(Hf(S),M))),Mt(N,Ff(3,Mt(Hf(m),g)))),vt(Mt(S,M),Mt(m,g))].map(ne)}(t,n)};if(1===e)return{polyDd:Af(t,n),polyE:Uf(t,n).map(t=>12*t),getPolyExact:()=>function(t,n){const[[e,o],[r,c]]=t,[i,s]=n,u=Rf(e,i),f=Rf(r,i),l=Rf(o,s),a=Rf(c,s),p=wt(u,u),h=wt(u,f),d=wt(f,f),v=wt(l,l),g=wt(l,a),m=wt(a,a),x=vt(h,g),w=vt(v,p);return[vt(vt(d,m),vt(Xf(x),w)),Mt(x,w)].map(ne)}(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:Gf}=Math;function Jf(t,n,e=0,o=1){const{polyDd:r,polyE:c,getPolyExact:i}=Zf(t,n),s=Je(r,e,o,c,i)||[];s.push({t:e,tS:e,tE:e,multiplicity:1}),s.push({t:o,tS:o,tE:o,multiplicity:1});const u=s.map(e=>{const o=ts(t,[e.tS,e.tE]),r=function(t,n){const e=t[0],o=t[1],r=e[0],c=e[1],i=o[0],s=o[1],u=n[0],f=n[1];let l=1/0,a=-1/0;for(const[t,n]of[[r,c],[r,s],[i,c],[i,s]]){const e=af(t,u),o=af(n,f),r=bt(vt(wt(e,e),wt(o,o))),c=r*(1-pf),i=r*(1+pf);c<=l&&(l=c),i>=a&&(a=i)}return[l,a]}(o,n);return{p:lf(o),t:e.t,d:(Gf(r[0])+Gf(r[1]))/2,dSquaredI:r,box:o,ri:e}});let f=1/0;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 Kf(t,n){const{coeffs:e,errBound:o,getPExact:r}=Hi(t,n);return Je(e,0,1,o,r)}const{min:tl,max:nl}=Math;function el(t,n){let[[e,o],[r,c]]=t,[[i,s],[u,f]]=n;if(e>r&&([e,r]=[r,e]),i>u&&([i,u]=[u,i]),o>c&&([o,c]=[c,o]),s>f&&([s,f]=[f,s]),e<=u&&r>=i&&s<=c&&f>=o)return[[nl(e,i),nl(o,s)],[tl(r,u),tl(c,f)]]}function ol(t,n,e){const{ps:o}=t,{ps:r}=n;if(void 0===e)return;if(0===e.length)return[];const c=Kf(r,o);if(void 0===c)return;if(0===c.length)return[];const i=c.map(t=>ts(o,[t.tS,t.tE])),s=e.map(t=>ts(r,[t.tS,t.tE])),u=[];for(let r=0;r<c.length;r++){const f=i[r];for(let i=0;i<e.length;i++){if(void 0===el(f,s[i]))continue;const l=Ao(o,c[r].t),a={ri:c[r],p:l,kind:1,curve:t},p={ri:e[i],p:l,kind:1,curve:n};u.push([a,p])}}return u}function rl(t,n,e){for(const o of[t,n]){const r=o.length;for(let c=1;c<r+1;c++){const i=o[c-1],s=o[c%r],u=[s[1]-i[1],i[0]-s[0]];let f=1/0,l=-1/0;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=1/0,p=-1/0;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 cl=Et,{abs:il}=Math;function sl(t){return 4===t.length&&ou(t)&&(t=Uc(t)),3===t.length&&function(t){const[[n,e],[o,r],[c,i]]=t,s=n+c,u=s-2*o,f=il(s)+il(u);if(il(u)-f>0)return!1;const l=e+i,a=l-2*r,p=il(l)+il(a);return!(il(a)-p>0)&&0===St(Mt(cl(n,c),[2*o]))&&0===St(Mt(cl(e,i),[2*r]))}(t)&&(t=[t[0],t[2]]),2===t.length&&Ks(t)&&(t=[t[0]]),t}const ul=Number.EPSILON,fl=ul/2;function ll(t,n){return n<0?t<1?t:1-fl:0===n?1:t>1?t:1+ul}function al(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],o=n[1],r=e>>7,c=((127&e)<<4)+((240&o)>>4),i=0===c?0:16,s=0===c?c-1022:c-1023,u=n.slice(1);return u[0]=(15&o)+i,{sign:r,exponent:s,significand:u}}function pl(t){return al(t).significand}function hl(t){return Math.log2(t&-t)}function dl(t){if(0===t||!Number.isFinite(t))return NaN;const n=pl(t),e=n.length;for(let t=e-1;t>=0;t--){if(0===n[t])continue;const o=hl(n[t]);if(Number.isFinite(o))return 8*(e-t-1)+o}return NaN}function vl(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 gl(t){if(0===t||!Number.isFinite(t))return NaN;const n=pl(t),e=n.length;for(let t=0;t<e;t++){const o=vl(n[t]);if(Number.isFinite(o))return 8*(e-t-1)+o}return NaN}function ml(t){return al(t).exponent}function xl(t){if(0===t||!Number.isFinite(t))return NaN;const n=ml(t);return gl(t)-52+n}function wl(t,n){if(0===St(t=ne(t)))return[0];const e=xl(t[t.length-1]);let o=e,r=t.length-1;for(;r>0;){const c=xl(t[r-1]);if(e-c>n)break;o=c,r--}const c=Math.min(n-(e-o),53);let i=t[r];i=Vs(i,c);const s=t.slice(r);return s[0]=i,s}function bl(t){return 0===t?0:gl(t)-dl(t)+1}function _l(t){const n=ne(t);if(0===St(n))return 0;const e=n[n.length-1],o=n[0];return ml(e)-ml(o)+(53-dl(o))}function Ml(t){return bt(function(t,n,e){let o=n,r=t,c=!1,i=0;e||(i=_l(r)-_l(o)+1,e=i/53+1,c=!0);let s=[1/bt(o)],u=1;for(;;){if(r=wt(r,s),u>e)return c?(r=wl(r,i),r):r.slice(r.length-e,r.length);o=wt(o,s),s=Mt([2],o),u*=2}}(t[0],t[1],2))}function Sl(t){return St(t[0])*St(t[1])}function Cl(t){return(n,e)=>{const o=_c(n),r=_c(e),c=_c(n.slice().reverse()),i=_c(e.slice().reverse()),s=t(o,r),u=t(c,r),f=t(o,i),l=t(c,i),a=-Sl(u),p=-Sl(l),h=Ml(s),d=Ml(f);return[ll(h,a),ll(d,p)]}}const yl=Cl(function(t,n){const e=0===St(t[0][0])?1:0;return function(t,n){const[e,o]=t,[,r]=n;return[Mt(r,o),e]}(t[e],n[e])});function Ol(t,n){return St(Mt(t,n))}function El(t,n){return Ol(wt(t[0],n[1]),wt(t[1],n[0]))*St(t[1])*St(n[1])}function Il(t){let n=-1024;for(let e=0;e<t.length;e++){const o=t[e];for(let t=0;t<o.length;t++){const e=o[t];if(0===e)continue;const r=-ml(e)+bl(e)-1;r>n&&(n=r)}}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=-ml(t)+bl(t)-1;return BigInt(t*2**e)*2n**BigInt(n-e)})):t.map(t=>t.map(t=>BigInt(t*2**n)))}function Nl(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 kl=BigInt(2**53);function Pl(t){if(0n===t)return[0];const n=[];let e=0,o=t;for(;0n!==o;){o=t/kl;const r=t%kl;n.push(Number(r)*2**(53*e)),t=o,e++}return ne(n)}const{round:Bl,sqrt:Tl}=Math;function Al(t){if(t<=1n){if(t<0n)throw new Error("square root of negative numbers are not allowed");return t}let n=BigInt(Bl(Tl(Number(t))));for(;;){const e=n+t/n>>1n;if(e===n)return n;n=e}}function zl(t){return t<0n?-t:t}function Ll(t){let n=0n;for(let e=0;e<t.length;e++)n+=t[e];return n}function Dl(t,n){const[e,o]=ql(t[0],n[0]),[r,c]=ql(t[1],n[1]);if(0===El(e,r)||0===El(e,c))return e;if(0===El(o,r)||0===El(o,c))return o;throw new Error("An unexpected error occured.")}function ql(t,n){const[e,o]=t,[r,c]=n,[i,s]=function(t){const[n,e]=Il(t).map(Ll),o=Nl(n,e);return[Pl(Al(zl(n/o))),Pl(Al(zl(e/o)))]}([r,e]);return[[Mt(wt(c,s),wt(o,i)),wt(i,Bc(e))],[Mt(wt(c,_t(s)),wt(o,i)),wt(i,Bc(e))]].sort(El)}function Wl(t,n){const e=_c(t),o=0===St(e[0][0])?0:0===St(e[1][0])?1:-1;if(-1!==o){const e=t[0][o],r=t[2][o],c=n[0][o],i=n[2][o];return yl([[e,e],[r,r]],[[c,c],[i,i]])}return Cl(Dl)(t,n)}const{round:jl,cbrt:Fl}=Math;function Hl(t){const n=(e=t)>0n?1n:e<0n?-1n:0n;var e;if((t=zl(t))<=1n)return n*t;let o=BigInt(jl(Fl(Number(t))));for(;;){const e=(2n*o+t/(o*o))/3n;if(e===o)return n*o;o=e}}function Yl(t){return wt(t,t)}const Rl=Cl(function(t,n){const e=0===St(t[0][0])?1:0;return function(t,n){const[e,o]=t,[r,c]=n,i=function(t){const[n,e]=Il(t).map(Ll),o=Nl(n,e);return[Pl(Hl(n/o)),Pl(Hl(e/o))]}([r,e]),s=Yl(i[0]);return[Mt(wt(c,Yl(i[1])),wt(o,s)),wt(xt(3,e),s)]}(t[e],n[e])}),{EPSILON:Xl}=Number,Ql=Xl/2+Xl**2/2;function Vl(t){return t>0?t-t*Ql:t+t*Ql}const{EPSILON:$l}=Number,Ul=$l/2+$l**2/2;function Zl(t){return t>0?t+t*Ul:t-t*Ul}function Gl(t){if(0===t||1===t)return[t,t];const n=Vl(Vl(t)),e=function(t){return Zl(Zl(t))}(t);return[n,e]}const Jl=So(function(t,n,e){const o=t.ps,r=n.ps,c=[];let i=Kf(o,r);if(void 0===i){const e=function(t,n,e=!1){e||(t=sl(t),n=sl(n));const o=[,,yl,Wl,Rl],[r,c]=o[t.length](t,n),[i,s]=o[t.length](n,t),u=[{tA:r,tB:0,bez:"B",start:!0},{tA:c,tB:1,bez:"B",start:!1},{tA:0,tB:i,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,o=n.tB,r=ts(t,[e,e]);return[{p:r[0],kind:4,box:r,t1:e,ri1:{t:e,tS:e,tE:e,multiplicity:1},t2:o,ri2:{t:o,tS:o,tE:o,multiplicity:1}}]}if(u[0].bez===u[1].bez)return[];const f=u[1],l=u[2],[a,p]=Gl(f.tA),[h,d]=Gl(f.tB),[v,g]=Gl(l.tA),[m,x]=Gl(l.tB),w=ts(t,[a,p]),b=ts(n,[h,d]),_=ts(t,[v,g]),M=ts(n,[m,x]),S=el(w,b),C=el(_,M),y={t:a,tS:a,tE:p,multiplicity:1},O={t:h,tS:h,tE:d,multiplicity:1},E={t:v,tS:v,tE:g,multiplicity:1},I={t:m,tS:m,tE:x,multiplicity:1};return[{p:lf(S),kind:5,box:S,t1:y.t,ri1:y,t2:O.t,ri2:O},{p:lf(C),kind:5,box:C,t1:E.t,ri1:E,t2:I.t,ri2:I}]}(o,r);for(const r of e){const e=Ao(o,r.ri1.t),i={ri:r.ri1,kind:5,p:e,curve:t},s={ri:r.ri2,kind:5,p:e,curve:n};c.push([i,s])}return c}return e&&(i=i.filter(t=>t.tS>0)),0===i.length?[]:ol(t,n,i)||[]});function Kl(t,n,e){const{ps:o}=n;return{ri:ju(t),p:Ao(o,t),kind:e,curve:n}}function ta(t,n){const e=t.ps,o=n.ps;if(2===e.length&&2===o.length)return function(t,n){let e=t.ps,o=n.ps;const r=gu(e),c=gu(o);if(t.next!==n&&n.next!==t){if(ho(!0,r,c)){const e=Jl(t,n,!1);return e.length?e:void 0}return}n.next===t&&([t,n]=[n,t],[e,o]=[o,e]);if(0!==Ys(e[0],e[1],o[1]))return;if(!ho(!1,r,c))return;let i;return i=Gs(e[0],e[1])>Gs(o[0],o[1])?[Fu(Jf(e,o[1])[0].ri),1]:[0,Fu(Jf(o,e[0])[0].ri)],[[Kl(1,t,5),Kl(0,n,5)],[Kl(i[0],t,5),Kl(i[1],n,5)]]}(t,n);if(t.next===n||n.next===t)return ho(!1,gu(e),gu(o))&&rl(vu(e,!1),vu(o,!1),!1)?n.next===t?Jl(n,t,!0):Jl(t,n,!0):na(t,n);let r=ho(!0,gu(e),gu(o));return r?(r=rl(vu(e,!1),vu(o,!1),!0),r?Jl(t,n,!1):void 0):void 0}function na(t,n){if(n.next===t){if(t.next===n)return;[t,n]=[n,t]}const e=t.ps,o=n.ps;if(ff(e,o[o.length-1].map(t=>[t]))){const e=ol(t,n,[ju(1)]);if(void 0===e||0===e.length)return;return[[e[0][0],Kl(1,n,1)]]}}function ea(t){return t[t.length-1]<0?_t(t):t}function oa(t,n){const e=t+n,o=e-t;return[t-(e-o)+(n-o),e]}Number.EPSILON;const ra=Number.EPSILON/2;function ca(t,n,e,o){const r=t/n,c=Math.abs(t),i=Math.abs(n),s=i-o;return s<=0?{est:r,err:Number.POSITIVE_INFINITY}:{est:r,err:(i*e+c*o)/s**2+ra*Math.abs(c/i)}}function ia(t){const n=t[0],e=t[1];if(0===e)return[0,0];const o=Math.sqrt(e),r=o*o,c=134217729*o,i=c-(c-o),s=o-i,u=.5*(e-r-(s*s-(r-i*i-i*s*2))+n)/o;return[u-(o+u-o),o+u]}const{abs:sa}=Math;const{abs:ua}=Math,fa=wt,la=vt,aa=Mt,pa=wt,ha=xt,da=Oo,va=oa,ga=Xo,ma=hn,xa=fr,wa=es,ba=vt,_a=It,Ma=2*Xi,{abs:Sa}=Math;function Ca(t,n=!0){if(t.length<4)return[];const{coeffs:[e,o,r],errBound:[c,i,s]}=function(t){const{coeffs:[[n,e,o],[r,c,i]],errorBound:[[s,u],[f,l]]}=function(t){const[[n,e],[o,r],[c,i],[s,u]]=t,f=s-n,l=o-c,a=f+3*l,p=c+n,h=p-2*o,d=o-n,v=u-e,g=r-i,m=v+3*g,x=i+e,w=x-2*r,b=r-e;return{coeffs:[[a,3*h,3*d,n],[m,3*w,3*b,e]],errorBound:[[sa(f)+6*sa(l)+sa(a),6*(sa(p)+sa(h)),6*sa(d),0],[sa(v)+6*sa(g)+sa(m),6*(sa(x)+sa(w)),6*sa(b),0]]}}(t),a=ua(n),p=ua(e),h=ua(o),d=ua(r),v=ua(c),g=ua(i),m=e*r,x=n*c,w=n*i,b=o*r,_=e*i,M=o*c,S=u*d+p*f+ua(m),C=s*v+a*l+ua(x),y=s*g+ua(w),O=h*f+ua(b),E=u*g+ua(_),I=h*l+ua(M),N=m-x,k=ua(N),P=S+C+k,B=b-w,T=ua(B),A=O+y+T,z=_-M,L=ua(z),D=E+I+L,q=N*N,W=N*B,j=z*N,F=B*B,H=j+F;return{coeffs:[q,W,H],errBound:[2*P*k+ua(q),P*T+k*A+ua(W),D*k+L*P+ua(j)+(2*T*A+ua(F))+ua(H)].map(t=>$i*t)}}(t);if(Sa(e)<=c){const[[n,e],[o,r],[c,i],[s,u]]=t,f=ba(da(s,n),ha(3,da(o,c))),l=_a(va(c,n),-2*o),a=ba(da(u,e),ha(3,da(r,i))),p=_a(va(i,e),-2*r);if(0===Ol(pa(l,a),pa(f,p)))return[]}const u=o*o,f=4*e*r,l=u-f,a=2*i*Sa(o)+$i*u+(4*(c*Sa(r)+Sa(e)*s)+$i*Sa(f))+$i*Sa(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),o=Math.sqrt(t-n),r=Math.sqrt(t+n);return{est:e,err:Math.max(Math.abs(o-e),Math.abs(r-e))}}(l,a);let f;f=o>=0?-o-t:-o+t;const p=i+u+$i*Sa(f),{est:h,err:d}=ca(f,2*e,p,2*c),{est:v,err:g}=ca(2*r,f,2*s,p);if(n){if(h+d<0||h-d>1||v+g<0||v-g>1)return[]}else if((h+d<0||h-d>1)&&(v+g<0||v-g>1))return[]}let[p,h,d]=function(t){const[[n,e,o],[r,c,i]]=Mc(t),s=fa(e,r),u=fa(n,c),f=fa(n,i),l=fa(o,r),a=fa(e,i),p=fa(o,c),h=Mt(s,u),d=Mt(l,f),v=Mt(a,p),g=fa(h,h),m=fa(h,d),x=fa(h,v),w=fa(d,d);return[g,m,la(x,w)]}(t);const v=aa(pa(h,h),ha(4,pa(p,d))),g=St(v);if(g<0)return[];if(g>0){const t=ia(Ss(v));let e;p=Ss(p),h=Ss(h),d=Ss(d),e=St(h)>=0?ga(ma(h,t)):ma(ga(h),t);let o=bt(wa(e,xa(p))),r=bt(wa(xa(d),e));if(n){if(o<-Ma||o>1+Ma||r<-Ma||r>1+Ma)return[]}else if((o<-Ma||o>1+Ma)&&(r<-Ma||r>1+Ma))return[];return[o,r]=o<r?[o,r]:[r,o],o>=0-Ma&&o<=1+Ma?r>=0-Ma&&r<=1+Ma?[o,r]:[o]:r>=0-Ma&&r<=1+Ma?[r]:[]}const m=zf(p);if(St(h)*St(m)<0)return[];if(Ol(ea(h),ea(m))>0)return[];const x=Ss(h),w=Ss(m),b=wa(x,w),_=b[1]+b[0];return[_,_]}function ya(t){if(4===t.length){const[[n,e],[o,r],[c,i],[s,u]]=t;return[[6*(s-n+3*(o-c)),6*(c+n-2*o)],[6*(u-e+3*(r-i)),6*(i+e-2*r)]]}if(3===t.length){const[[n,e],[o,r],[c,i]]=t;return[[2*(c-2*o+n)],[2*(i-2*r+e)]]}if(t.length<=2)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3.")}function Oa(t){if(Rs(t))return{minima:[],maxima:[],inflections:[]};if(4===t.length&&ou(t)&&(t=Uc(t)),3===t.length){const n=function(t){const[[n,e],[o,r],[c,i]]=t,s=c-o,u=s-(o-n),f=i-r,l=f-(r-e);return[u*u+l*l,-(n*(u-o)-o*(s-o)+e*(l-r)-r*(f-r))]}(t);return{minima:[],maxima:Je(n,0,1)?.map(t=>t.t)||[],inflections:[]}}const n=function(t){const[[n,e,o],[r,c,i]]=pt(t),[[s,u],[f,l]]=ya(t),[[a],[p]]=function(t){if(4===t.length){const[[n,e],[o,r],[c,i],[s,u]]=t;return[[6*(s-n+3*(o-c))],[6*(u-e+3*(r-i))]]}if(t.length<=3)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3.")}(t),h=a*c,d=p*e,v=u*i,g=u*c,m=f*f,x=s*i,w=l*o,b=l*e,_=f*o,M=o*e,S=o*n,C=o*r,y=e*e,O=e*n,E=e*c,I=n*i,N=n*r,k=n*n,P=i*c,B=i*r,T=c*c,A=c*r,z=r*r,L=a*i-p*o,D=u*o+l*i,q=v-w,W=o*o+i*i,j=E+I,F=B+T,H=S+y,Y=e*r+n*c,R=k-z,X=O-A,Q=M-P,V=o*c+e*i,$=B+F,U=S+H,Z=C+j,G=E+j,J=U-$,K=j+I,tt=C+E+I,nt=2*b+_;return{inflectionPoly:[s*r-f*n,u*r+s*c-l*n-f*e,g+x-b-_,v-w],otherExtremaPoly:[k*(h-3*d)+z*(3*h-d)+2*(N*(a*e-p*c+3*(l*f-u*s))+3*s*f*X)+3*(Y*(m-s*s)+R*(u*f+l*s)),a*(r*(U+3*F)+n*G)-p*(o*(3*k+z)+e*(3*O+2*A)+n*$)+3*(u*(l*R-u*N+2*(f*X-s*Y))+s*(2*l*X+f*(2*(S-B)+(y-T))-s*tt)+l*(l*N+2*f*Y)+m*Z),a*(2*o*Y+e*K+c*(4*B+$))-p*(2*o*(3*O+A)+e*(y+2*B)+c*K)+3*(u*(2*(l*X-s*tt)+f*J-u*Y)+s*(2*f*Q-s*V)+l*(l*Y+2*f*Z+s*J)+m*V),a*(o*(C+2*j)+i*(y+3*F))-p*(o*(3*H+$)+i*G)+3*(u*(l*J-u*Z+2*(f*Q-s*V))+s*(o*(nt-s*i)-i*(2*l*c+f*i))+l*(l*j+o*(2*f*c+l*r))+f*i*nt),W*(h-d)+2*(M+P)*L-3*(D*(g+x-b-_)+(u*e+s*o+l*c+f*i)*q),L*W-3*D*q]}}(t),e=n.inflectionPoly,o=n.otherExtremaPoly,r=Je(o,0,1)?.map(t=>t.t)||[],c=function(t){const n=t.length-1;if(n<=0)return[];const e=new Array(n);for(let o=0;o<n;o++)e[o]=(n-o)*t[o];return e}(o),i=[],s=[];for(let t=0;t<r.length;t++){const n=r[t],o=at(c,n);at(e,n)*o>=0?i.push(n):s.push(n)}return{minima:i,maxima:s,inflections:Je(e,0,1)?.map(t=>t.t)||[]}}const{sqrt:Ea}=Math;function Ia(t,n){const[e,o]=function(t,n){const[e,o]=pt(t),[r,c]=ya(t),i=at(e,n),s=at(o,n),u=at(r,n);return[i*at(c,n)-s*u,Ea((i*i+s*s)**3)]}(t,n);return e/o}const{abs:Na}=Math;function ka(t){return 4===t.length?function(t){const[[n,e],[o,r],[c,i],[s,u]]=t;return[[s-n+3*(o-c),2*(c+n-2*o),o-n],[u-e+3*(r-i),2*(i+e-2*r),r-e]]}(t):3===t.length?function(t){const[[n,e],[o,r],[c,i]]=t;return[[c+n-2*o,o-n],[i+e-2*r,r-e]]}(t):function(t){const[[n,e],[o,r]]=t;return[[o-n],[r-e]]}(t)}function Pa(t){if(2===t.length)return[];const[n,e]=ka(t);return[...Je(n,0,1)||[],...Je(e,0,1)||[]]}const Ba=So(function(t){const n=[];for(const e of t)for(const t of e.curves)n.push(t);const e=ao(n,t=>gu(t.ps)[0][0],t=>gu(t.ps)[1][0],ta),o=[];for(const t of e)for(const n of t.u)o.push(n);return o}),Ta=So(function(t){const n=[];for(const e of t)for(const t of e.curves){const e=t.ps,o=Ca(e);if(0===o.length)continue;const r=o[0]===o[1]?3:2,c=o[0],i=o[1],s=c-4*$n,u=c+4*$n,f=i-4*$n,l=i+4*$n,a=Ao(e,c),p={ri:{t:s,tS:s,tE:u,multiplicity:1},p:a,kind:r,curve:t},h={ri:{t:f,tS:f,tE:l,multiplicity:1},p:a,kind:r,curve:t};n.push([p,h])}return n}),Aa=So(function(t){const n=[];for(const e of t)for(const t of e.curves)n.push([Kl(1,t,4),Kl(0,t.next,4)]);return n}),za=So(function(t,n){const e=[],o=1e7*2**-t;for(const t of n)for(const n of t.curves){const{ps:t}=n,r=Oa(t),{minima:c,maxima:i}=r,s=[0,1,...c,...i];for(let r of s)if(Na(Ia(t,r))>o){const t=Kl(r,n,7),o=Kl(r,n,7);e.push([t,o])}}return e}),La=So(function(t){const n=[];for(let e of t)for(let t of e.curves){const{ps:e}=t,o=Pa(e).map(n=>{const{t:o}=n,r=Ao(e,o);return[{p:r,ri:n,kind:8,curve:t},{p:r,ri:n,kind:8,curve:t}]});n.push(...o)}return n}),Da=So(function(t,n,e){let o=[t.map((t,e)=>[n[e],{...n[e]}]),Ba(t),Ta(t),Aa(t),za(e,t),La(t)].flat(1);return"undefined"!=typeof _debug_&&_debug_.elems.intersection.push(...o.flat()),o});function qa(t){const{ps:n}=t,e=n[0],o=n[n.length-1];let r=e[1]<o[1]?{ri:ju(0),p:e,kind:0,curve:t}:{ri:ju(1),p:o,kind:0,curve:t};if(2===n.length){if(e[1]===o[1]){const n=[(e[0]+o[0])/2,(e[1]+o[1])/2];return{ri:ju(.5),p:n,kind:0,curve:t}}return r}const[,c]=ka(n),i=Je(c,0,1)||[];for(let e=0;e<i.length;e++){const o=i[e],c=Ao(n,o.t);c[1]<r.p[1]&&(r={ri:o,p:c,kind:0,curve:t})}return r}function Wa(t){let n=1/0,e=-1/0,o=1/0,r=-1/0;for(const c of t){const t=c[0],i=c[1];t<n&&(n=t),t>e&&(e=t),i<o&&(o=i),i>r&&(r=i)}return[[n,o],[e,r]]}function ja(t){const{curves:n}=t;let e,o=n[0],r=1/0;for(const t of n){const{ps:n}=t;if(Wa(n)[0][1]>r)continue;const c=qa(t),i=c.p[1];(void 0===e||i<r||i===r&&c.ri.t>e.ri.t)&&(e=c,o=t,r=i)}return e}const Fa=et(function(t){let n=0;for(const e of t)switch(e.length){case 2:n+=Ha(e,0,1);break;case 3:n+=(2*Ha(e,0,1)+Ha(e,0,2)+2*Ha(e,1,2))/3;break;case 4:n+=(6*Ha(e,0,1)+3*Ha(e,0,2)+Ha(e,0,3)+3*Ha(e,1,2)+3*Ha(e,1,3)+6*Ha(e,2,3))/10}return n/2});function Ha(t,n,e){return t[n][0]*t[e][1]-t[e][0]*t[n][1]}const{abs:Ya}=Math;function Ra(t){return t.map(t=>t.toReversed()).toReversed()}const{sign:Xa}=Math;function Qa(t,n){return t.ps===n.ps&&t.ts[1]===n.ts[0]&&(t.ts[1]-t.ts[0])*(n.ts[1]-n.ts[0])>0}function Va(t,n){return{ps:t.ps,ts:[t.ts[0],n.ts[1]]}}function $a(t,n){const{idx:e}=n;let o=t[e];return void 0===o&&(o={bigBox:n.bigBox,box:n.box,inOuts:[],xs:n.xs},t[e]=o),o}function Ua(t,n,e){return{idx:t.idx,_x_:t._x_,dir:n,swapped:e,oSideIdxs:t.oSideIdxs,oFSC:t.oFSC,oFSCE:t.oFSCE,oSideIdx:t.oSideIdx,container:void 0,orientation:void 0,windingNum:void 0,children:void 0,nextAround:void 0,parent:void 0,path:void 0,prevAround:void 0,twin:void 0,loop:void 0}}const{sign:Za}=Math;function Ga(t){const{ps:n,ts:e}=t;return{ps:n,ts:[e[1],e[0]]}}function Ja(t){return t.map(t=>{const n=t[0].out.orientation;return t.map(({out:t,depth:e})=>function(t,n,e){const{orientation:o}=t,r=(e%2==0?1:-1)*n,c=zu(t);return r*o>0?c:c.map(Ga).toReversed()}(t,n,e))})}const{ceil:Ka,log2:tp}=Math;function np(n,e={}){"undefined"!=typeof _debug_&&(_debug_.timing.timingStart=performance.now());const o=Ka(tp(function(t){let n=-1/0;for(const e of t)for(const t of e)for(const e of t)for(const t of e)n=xu(n,wu(t));return n}(n))),{minLoopArea:r=(2**(o-16))**2,forceOrientationNegative:c=!1,booleanOp:i="OR"}=e,s=o-46+("undefined"==typeof _debug_?4:30),u=(n=mu(n,o).sort(eo)).map(t),f=u.map(ja);"undefined"!=typeof _debug_&&f.forEach(t=>_debug_.elems.minY.push(t));const l=Da(u,f,o),a=Hs(l,o,s);"undefined"!=typeof _debug_&&_debug_.elems.container.push(...a);const p=a.filter(t=>As(t.xs)),h=ro(Wu(o,p)).map(so(i)).filter(t=>0!==t.length);return function(n,e,o){const r=n.map(t=>t.map(t=>function(t){const n=t.length;return 0===n?t:t.map((e,o)=>{const r=t[(o+1)%n][0],c=e.length-1;return e.map((t,n)=>n===c?[...r]:t)})}(function(t){if(t.length<2)return t;const n=[];for(const e of t){const t=n[n.length-1];void 0!==t&&Qa(t,e)?n[n.length-1]=Va(t,e):n.push(e)}for(;n.length>=2&&Qa(n[n.length-1],n[0]);)n[0]=Va(n.pop(),n[0]);return n}(t).map(_u)))),c=e?r.map(t=>{return-1!==(n=t[0],Xa(Fa(n)))?t.map(Ra):t;var n}):r,i=So(function(t){return function(n){const e=[];for(let o=0;o<n.length;o++){const r=n[o].filter(n=>Ya(Fa(n))>t);r.length&&e.push(r)}return e}}(o)),s=i(c).map(t=>t.toSorted(eo));let u=0;const f=js(s,n=>t(n,u++));return function(t){if("undefined"!=typeof _debug_){for(const n of t)_debug_.elems.loop.push(...n),_debug_.elems.loops.push(n);"undefined"!=typeof _debug_&&(_debug_.timing.simplifyPaths=performance.now()-_debug_.timing.timingStart-_debug_.timing.normalize)}}(f),f}(function(t,n,e,o){const{containers_:r,minYContainers:c}=function(t,n,e){t.forEach((t,n)=>t.idx=n);const o=[],r=[];for(let t=0;t<n.length;t++){const c=n[t],i=Za(c[0].windingNum-c[0].parentWinding);for(let n=0;n<c.length;n++){const s=c[n],{out:u,depth:f,windingNum:l,parentWinding:a}=s,p=Za(l-a)!==(f%2==0?1:-1)*i,h=p?u.path.toReversed():u.path,d=new Set;for(const r of h){const{twin:c}=r,i=r.dir*(p?-1:1),s=Ua(r,i,p),u=Ua(c,-i,p);s.twin=u,u.twin=s;const f=$a(o,r._x_.container);f.inOuts.push(s);const l=$a(o,c._x_.container);l.inOuts.push(u),s.container=f,u.container=l;const a=Tu(e[t][n]);s.loop=a,u.loop=a,d.add(f)}r.push(d)}}const c=new Set;for(let t=0;t<r.length;t++){const n=r[t];let e,o=1/0;for(const t of n)t.box[0][1]<o&&(e=t,o=t.box[0][1]);c.add(e)}o.forEach(t=>{(t.inOuts.length>2||c.has(t))&&t.inOuts.sort(ks)}),o.forEach(t=>Fs(t.inOuts));const i=Array.from(c);return i.sort((t,n)=>t.box[0][1]-n.box[0][1]),{containers_:o,minYContainers:i}}(e,n,o);return"undefined"!=typeof _debug_&&(_debug_.elems.container.length=0,_debug_.elems.container.push(...r.filter(t=>void 0!==t))),Ja(ro(Wu(t,c)).map(so("OR")).filter(t=>0!==t.length))}(o,h,a,Ja(h)),c,r)}const{max:ep,abs:op}=Math;function rp(t,n){const e=t[0],o=t[1],r=t[2],c=t[3],i=e[0],s=e[1],u=o[0],f=o[1],l=r[0],a=r[1],p=c[0],h=c[1],d=n[0],v=n[1],g=i-d,m=u-d,x=l-d,w=p-d,b=s-v,_=f-v,M=a-v,S=h-v,C=g*g,y=6*g*m,O=6*x*w,E=b*b,I=6*b*_,N=6*M*S,k=6*m*w+9*x*x,P=2*g*w+18*m*x,B=6*g*x+9*m*m,T=6*_*S+9*M*M,A=2*b*S+18*_*M,z=6*b*M+9*_*_;return[6*(w*w-O+(C-y)+k+(B-P)+(S*S-N+(E-I)+T+(z-A))),5*(O+5*y+3*P-2*(k+2*B+3*C)+(N+5*I+3*A-2*(T+2*z+3*E))),4*(k-3*(P-2*B)-5*(2*y-3*C)+(T-3*(A-2*z)-5*(2*I-3*E))),3*(P-2*(2*B-5*(y-2*C))+(A-2*(2*z-5*(I-2*E)))),2*(B-5*(y-3*C)+(z-5*(I-3*E))),y-6*C+(I-6*E)]}function cp(t,n){const e=t[0],o=t[1],r=t[2],c=e[0],i=e[1],s=o[0],u=o[1],f=r[0],l=r[1],a=n[0],p=n[1],h=c-a,d=s-a,v=f-a,g=i-p,m=u-p,x=l-p,w=h*h,b=h*d,_=d*v,M=g*g,S=g*m,C=m*x,y=g*x+m*m*2,O=h*v+d*d*2;return[x*x+M+2*y-4*(C+S)+(v*v+w+2*O-4*(_+b)),3*(C-y+(3*S-M)+(_-O+(3*b-w))),y-3*(2*S-M)+(O-3*(2*b-w)),S-M+(b-w)]}function ip(t,n){const[[e,o],[r,c]]=t,[i,s]=n,u=e-i,f=r-i,l=o-s,a=c-s,p=u*f+l*a,h=l*l+u*u;return[f*f+a*a+(h-2*p),p-h]}const{sqrt:sp}=Math;function up(t,n,e=!0){let o;if(4===t.length)o=rp(t,n);else if(3===t.length)o=cp(t,n);else{if(2!==t.length){if(1===t.length)return{p:t[0],t:0,d:nn(t[0],n)};throw new Error("The given bezier curve must be of order <= 3.")}o=ip(t,n)}const r=Je(o,0,1)?.map(t=>t.t)||[];e&&(r.push(0),r.push(1));let c,i=1/0;for(const e of r){const o=Ke(t,e),r=Gs(o,n);r<i&&(i=r,c={p:o,t:e,d:sp(r)})}return c}const{sqrt:fp}=Math,{abs:lp}=Math;function ap(t){let n=-1/0;for(let e=0;e<t.length;e++){const o=t[e],r=lp(o[0]),c=lp(o[1]);r>n&&(n=r),c>n&&(n=c)}return n}const{max:pp}=Math;function hp(t){return pp(t.hL+t.hEL,t.hR+t.hER)}function dp(t,n){const e=hp(t)-hp(n);return 0!==e?e:t.tS-n.tS}class vp{compare;heap=[];constructor(t){this.compare=t}insert(t){const n=this.heap;n.push(t);let e=n.length-1;for(;;){const o=(e-1-(e+1)%2)/2;if(-1===o)return;const r=n[o];if(this.compare(t,r)<0)break;n[o]=t,n[e]=r,e=o}}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 o=2*e+1;if(o>=n)break;const r=2*e+2,c=r>=n||this.compare(t[o],t[r])>0?o:r,i=t[c],s=t[e];if(this.compare(s,i)>0)break;t[c]=s,t[e]=i,e=c}}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:gp}=Math;function mp(t,n,e,o=50){if(1===t.length)return up(n,t[0]).d;if(1===n.length)return function(t,n){let e;if(4===t.length)e=rp(t,n);else if(3===t.length)e=cp(t,n);else{if(2!==t.length){if(1===t.length)return{p:t[0],t:0,d:nn(t[0],n)};throw new Error("The given bezier curve must be of order <= 3.")}e=ip(t,n)}const o=Je(e,0,1)?.map(t=>t.t)||[];o.push(0),o.push(1);let r,c=-1/0;for(const e of o){const o=Ke(t,e),i=Gs(o,n);i>c&&(c=i,r={p:o,t:e,d:fp(i)})}return r}(t,n[0]).d;if(2===t.length&&2===n.length){const e=up(n,t[0]).d,o=up(n,t[t.length-1]).d;return e>o?e:o}const r=gp(ap(t),ap(n));e=e||r/1e6;const[c,i]=xp(t,0,1),s={tS:0,tE:1,hL:up(n,t[0]).d,hR:up(n,t[t.length-1]).d,hEL:c,hER:i},u=new vp(dp);u.insert(s);let f=0,l=1/0,a=-1/0;for(;;){const r=u.heap[0],{tS:c,tE:i,hL:s,hR:p}=r,h=(c+i)/2,[d,v]=xp(t,c,h),[g,m]=xp(t,h,i),x=Ke(t,h),w=nn(x,up(n,x).p),b=gp(s,w,p);if(b>a&&(a=b),l=hp(r),l-a<e)return a;if(f++>o)return a;const _={tS:c,tE:h,hL:s,hR:w,hEL:d,hER:v},M={tS:h,tE:i,hL:w,hR:p,hEL:g,hER:m};u.swapMinOrMax(_),u.insert(M)}}function xp(t,n,e){const o=(e+n)/2,r=U(t,n,o),c=U(t,o,e);return[au(r),au(c)]}function wp(t,n=!1){const e=t;let o=e;const r=[];do{n&&o===e||z(o)||r.push(o),o=o.nextOnCircle}while(o!==e);return r}function bp(t){const n=[],e=[t],o=new Set;for(;e.length>0;){const t=Kt(e.pop());if(0===t.length)continue;n.push(t);const r=t[0],c=t[t.length-1].next.prevOnCircle;o.add(r),o.add(c);const i=wp(r,!0),s=wp(c,!0),u=i.filter(t=>!o.has(t)),f=s.filter(t=>!o.has(t));for(const t of u)o.add(t);for(const t of f)o.add(t);e.push(...u,...f)}return n}class _p{datum;color=0;parent;left;right;constructor(t){this.datum=t}}class Mp{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 _p(t),void(this.root.color=1);let n,e=this.root;for(;e;){n=e;const o=this.compare(t,e.datum);if(0===o)return void(e.datum=t);e=o<0?e.left:e.right}const o=new _p(t);o.parent=n,this.compare(t,n.datum)<0?n.left=o:n.right=o,this.fixInsert(o)}remove(t,n=!1,e){const o=this.find(t);if(void 0===o)return;const r=o.datum;return this.removeNode(o),r}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,o=t,r=o.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)):(o=this.getMinNode(t.right),r=o.color,n=o.right,o.parent===t?(e=o,n&&(n.parent=o)):(e=o.parent,this.transplant(o,o.right),o.right=t.right,o.right.parent=o),this.transplant(t,o),o.left=t.left,o.left.parent=o,o.color=t.color),1===r&&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 o=e.right;0===this.colorOf(o)?(t.color=1,o.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 o=e.left;0===this.colorOf(o)?(t.color=1,o.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,o=n;for(;e!==this.root&&1===this.colorOf(e)&&void 0!==o;)if(e===o?.left){let t=o.right;0===this.colorOf(t)&&(t.color=1,o.color=0,this.rotateLeft(o),t=o.right),1===this.colorOf(t?.left)&&1===this.colorOf(t?.right)?(t&&(t.color=0),e=o,o=e?.parent):(1===this.colorOf(t?.right)&&(t?.left&&(t.left.color=1),t&&(t.color=0,this.rotateRight(t)),t=o.right),t&&(t.color=o.color),o.color=1,t?.right&&(t.right.color=1),this.rotateLeft(o),e=this.root,o=void 0)}else{let t=o?.left;0===this.colorOf(t)&&(t.color=1,o.color=0,this.rotateRight(o),t=o.left),1===this.colorOf(t?.left)&&1===this.colorOf(t?.right)?(t&&(t.color=0),e=o,o=o?.parent):(1===this.colorOf(t?.left)&&(t?.right&&(t.right.color=1),t&&(t.color=0,this.rotateLeft(t)),t=o?.left),t&&(t.color=o.color),o.color=1,t?.left&&(t.left.color=1),this.rotateRight(o),e=this.root,o=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 Sp(t){const n=new Map;return k(t).forEach(function(t){const e=t.pointOnShape.curve.loop;let o=n.get(e);o||(o=new Mp(zn),n.set(e,o)),o.insert(t)}),n}const{max:Cp}=Math;function yp(t,n=.125,e=50){let o=Q(t.cpNode);for(;!z(o);)o=o.next;const r=bp(o),c=new Set;for(let t=0;t<r.length;t++){const o=r[t];let i=0;for(;i<o.length;){const t=i;for(;(i++,i!==o.length)&&!(Op(t,i,o,e)>n);)c.add(o[i])}}o=function(t,n){const e=n;do{if(t(n))return n;n=n.next}while(n!==e)}(z,o);for(const n of c)Dn(t=>2!==T(t)&&!t.isHoleClosing)(n)||J(n,t.meta);return{cpNode:o,meta:{...t.meta,cpTrees:Sp(o)}}}function Op(t,n,e,o){const r=[],c=Vt(e[t],e[n].next);for(;t<n+1;t++)r.push(mp($t(e[t]),c,o));return Cp(...r)}function Ep(t){const n=[],e=k(t);for(const t of e)q(t)&&!t.isHoleClosing&&n.push(t);return n}const Ip=function(t,n,e){const o=t.get(n);return void 0!==o&&o.has(e)},Np=function(t,n,e){let o=t.get(n);void 0===o&&(o=new Set,t.set(n,o)),o.add(e)};function kp(t){let n=t,e=t.prevOnCircle;for(;z(e);)e=e.prevOnCircle;const o=[];do{z(n)||o.push(n),n=n.nextOnCircle}while(n!==e);return o}function Pp(t,n){const e=new Map,o=new Map;return H(t,function(t){const r=o.get(t)||n*t.pointOnShape.circle.radius,c=t.next,i=function(t,n,e=.4,o=16){if(4===n.length)return En(t,n,e,o);if(3===n.length)return Sn(t,n,e,o);if(2===n.length)return en(t,n);if(1===n.length)return 0;throw new Error("The given bezier curve must be of order <= 3.")}([0,1],$t(t)),s=c.pointOnShape.circle.radius;if(r-i>n*s)for(const t of A(c))if(o.set(t,r-i),!c.isHoleClosing){const{center:t}=c.pointOnShape.circle;Np(e,t[0],t[1])}}),e}function Bp(t,n){let e=0;"undefined"!=typeof _debug_&&(e=performance.now());const o=function(t){const n=k(t);return n.reduce(function(t,n){return t.pointOnShape.circle.radius>=n.pointOnShape.circle.radius?t:n},n[0])}(Q(t.cpNode));!function(t,n){const e=Ep(n);for(;e.length;){const o=e.pop(),{center:r}=o.pointOnShape.circle;if(!Ip(t,r[0],r[1])||o.isIntersection)continue;let c=o.prevOnCircle,i=!1;for(;!i;){c=c.next;const{center:e}=c.pointOnShape.circle;if(Ip(t,e[0],e[1]))if(Zt(c,n))i=!0;else{if(1===kp(c).length)continue;i=!0}else{for(;z(c.prevOnCircle);)c=c.prevOnCircle;i=!0}}if(i){const t=c.prevOnCircle;t.next=c,c.prev=t,t.nextOnCircle=c,c.prevOnCircle=t}}}(Pp(o,n),o);const r={cpNode:o,meta:{...t.meta,cpTrees:Sp(o)}};return function(t){"undefined"!=typeof _debug_&&(_debug_.timing.sats=performance.now()-t)}(e),r}const Tp={maxCurviness:.05,maxLength:40,applySat:!0,satScale:2,simplify:!0,simplifyTolerance:2**-4,minBezLength:2**-6,angleIncrement:15},Ap={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 zp(t){return[t[1],-t[0]]}function Lp(t,n){if(!Ht(n))return 0;const e=Ft(n);return e.isDull?-ct(zp(e.tangents[0]),lt(rt(n.p,t))):0}function Dp(t){return t[0]*t[0]+t[1]*t[1]}function qp(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 Wp(t){const n=t[0],e=t[1],o=t[2],r=Dp,c=.5*qp([r(n),n[1],1],[r(e),e[1],1],[r(o),o[1],1]),i=.5*qp([n[0],r(n),1],[e[0],r(e),1],[o[0],r(o),1]),s=qp([n[0],n[1],1],[e[0],e[1],1],[o[0],o[1],1]);return[c/s,i/s]}function jp(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}const Fp=Oo,Hp=le,Yp=hn,Rp=Number.EPSILON;function Xp(t,n){const[e,o]=t,[r,c]=n,i=Oo(e,r),s=Oo(o,c);return hn(le(i,i),le(s,s))[1]}const Qp=Number.EPSILON;function Vp(t,n,e){const[o,r]=e,{ps:c}=t,i=[];if(o!==r){const{polyDd:e,polyE:s,getPolyExact:u}=Zf(c,n),f=Je(e,o,r,s,u)||[];i.push(...f.map(e=>{const{tS:o,tE:r,t:i}=e,s=i<0?0:i>1?1:i,u=function(t,n){const e=t[0],o=t[1],r=e[0],c=e[1],i=o[0],s=o[1],u=n[0],f=n[1];let l=1/0,a=-1/0;for(const[t,n]of[[r,c],[r,s],[i,c],[i,s]]){const e=Fp(t,u),o=Fp(n,f),r=Yp(Hp(e,e),Hp(o,o))[1],c=r*(1-Rp),i=r*(1+Rp);c<=l&&(l=c),i>=a&&(a=i)}return[l,a]}(ts(c,[o,r]),n),f=0===s?1:s;return{curve:0===s?t.prev:t,t:f,dSquaredI:u}}))}const s=e.slice();return o===r&&s.push(o),i.push(...s.map(e=>{const o=Xp(To(c,[0,e]).map(t=>t[0]+t[1]),n),r=[o*(1-Qp),o*(1+Qp)],i=0===e?1:e;return{curve:0===e?t.prev:t,t:i,dSquaredI:r}})),i}const{min:$p}=Math,Up=1+2**-20;function Zp(t,n){const e=t[0],o=t[1],r=e[0],c=e[1],i=o[0],s=o[1],u=n[0],f=n[1];return u<r?f<c?Gs(t[0],n):f>s?Gs([r,s],n):(r-u)**2:u>i?f<c?Gs([i,c],n):f>s?Gs(t[1],n):(u-i)**2:f<c?(c-f)**2:f>s?(f-s)**2:0}const Gp=et(lu);function Jp(t,n){const e=[0,1,2,3].map(e=>function(t,n){const e=Gs,o=n[0],r=n[1],c=e(o,r);if(0==c)return e(t,o);let i=((t[0]-o[0])*(r[0]-o[0])+(t[1]-o[1])*(r[1]-o[1]))/c;return i=Math.max(0,Math.min(1,i)),e(t,[o[0]+i*(r[0]-o[0]),o[1]+i*(r[1]-o[1])])}(n,[t[e],t[(e+1)%4]])),o=Gs(t[0],t[1]),r=Gs(t[0],t[3]);return e[0]<=r&&e[2]<=r&&e[1]<=o&&e[3]<=o?0:Math.min(...e)}const Kp=et(hu);function th(t,n){return To(t,[0,n])}function nh(t,n){t=function(t,n){const e=function(t,n){let e=1/0;for(let o=0;o<t.length;o++){const r=t[o],{curve:{ps:c},ts:i}=r,s=Ke(c,i[0]),u=Ke(c,i[1]);e=$p(e,Gs(n,s),Gs(n,u))}return Up*e}(t,n);return t=function(t,n,e){const o=[];for(let r=0;r<t.length;r++){const c=t[r],{ps:i}=c.curve;Zp(Gp(i),n)<=e&&o.push(c)}return o}(t,n,e),t=function(t,n,e){const o=[];for(let r=0;r<t.length;r++){const c=t[r],i=c.curve.ps;Jp(Kp(i),n)<=e&&o.push(c)}return o}(t,n,e),t}(t,n);const e=[];for(let o=0;o<t.length;o++){const r=t[o],c=Vp(r.curve,n,r.ts);e.push(...c)}let o=1/0;for(let t=0;t<e.length;t++){const n=e[t].dSquaredI[1];n<o&&(o=n)}const r=[];for(let t=0;t<e.length;t++){const n=e[t];n.dSquaredI[0]<=o&&r.push(n)}return r.map(t=>{const{curve:n,t:e}=t,{ps:o}=n,r=th(o,e);return{curve:n,t:e,isSource:!1,p:r.map(t=>t[0]+t[1]),pDd:r}})}function eh(t,n){return n.map(n=>nh(n,t)[0])}function oh(t,n){return[n*t[0],n*t[1]]}function rh(t,n,e){const o=jp(e);let r,c,i,s,u=1,f=0;do{c=ft(oh(e,u),n),i=t.map(t=>nh(t,n)[0]),s=jp(rt(c,Wp(i.map(t=>t.p)))),r=s<o,u/=2,f++}while(!r&&f<3);return{newX:c,newV:s,newPoss:i}}const{min:ch,abs:ih,asin:sh}=Math;function uh(t,n,e,o,r){const c=2**(r-32),i=[t[0],t[n],t[t.length-1]],s=[o[0],o[n],o[t.length-1]],u=[[i[0],i[1],i[2]],[i[1],i[2],i[0]],[i[2],i[0],i[1]]][e],f=[[s[0],s[1],s[2]],[s[1],s[2],s[0]],[s[2],s[0],s[1]]][e];if(W(u[0][0]))return;let l,a=0,p=function(t,n){const e=t[0][0].pointOnShape.circle.center,o=nh(n[1],e)[0];return Wp([t[0][0].pointOnShape.p,o.p,t[2][1].pointOnShape.p])}(u,f),h=1/0;for(;h>c&&a<10;){if(a++,l=eh(p,f),!Number.isFinite(p[0])||!Number.isFinite(p[1]))return;const t=Wp(l.map(t=>t.p)),n=rt(p,t);if(!Number.isFinite(n[0])||!Number.isFinite(n[1]))return;const e=rh(f,p,n);p=e.newX,l=e.newPoss;const o=jp(n);h=ih(o-e.newV)}const d=(nn(p,l[0].p)+nn(p,l[1].p)+nn(p,l[2].p))/3,v={center:p,radius:d};let g=0;for(let t=0;t<3;t++){const n=l[t],e=lt(rt(n.p,p)),o=it(e);if(Ht(n)&&Ft(n).isDull){const t=jt(n.curve.ps,n.curve.next.ps).tangents.map(it),o=sh(st(t[0],e)),r=sh(st(e,t[1]));let c=0;o>0&&(c+=o),r>0&&(c+=r),g+=c}else{const t=lt(ht(n.curve.ps,n.t));g+=ih(sh(st(o,t)))}}const m=[];for(let t=0;t<o.length;t++){const n=nh(o[t],p)[0];m.push(nn(n.p,p))}const x=ch(...m);return{threeProngInfo:{poss:l,circle:v,δ3s:u},error:1*ih(d-x)+1*g}}function fh(t){let n=t[0];const e=t[1],o=[];let r=!0;do{const t=n.pointOnShape,e=n.next.pointOnShape,c=t.curve,i=e.curve;if(r)if(r=!1,i===c&&An(e,t)>0)o.push({curve:c,ts:[t.t,e.t]}),n=n.next;else{if(c.loop===i.loop){const n={curve:c,ts:[t.t,1]};o.push(n),lh(o,c,i,e.t)}n=n.next}else r=!0,n=n.prevOnCircle}while(n!==e);return o}function lh(t,n,e,o){let r=n;do{r=r.next;const n=r===e?o:1;t.push({curve:r,ts:[0,n]})}while(r!==e)}function ah(t,n,e,o){const r={...n,order:e,order2:o},c=t.findBounds({pointOnShape:r});if(void 0!==c[0]||void 0!==c[1])return void 0===c[0]||void 0===c[1]?t.getMaxNode()?.datum:c[0].datum}function ph(t,n,e,o,r,c,i){if(void 0!==c&&!function(t,n,e){const o=An(n,e.pointOnShape);if(o<0)return!0;if(0===o)return!1;const r=t.getMinNode();if(void 0===r)return!0;const c=r.datum;return An(t.getMaxNode().datum.pointOnShape,n)<0&&c===e}(o,r,c.next)&&!t)return;const s={pointOnShape:r,isHoleClosing:n,isIntersection:e,id:i.id,next:void 0,prev:void 0,nextOnCircle:void 0,prevOnCircle:void 0};i.id++;const u=void 0===c?s:c,f=void 0===c?s:u.next;return f.prev=s,u.next=s,s.prev=u,s.next=f,o.insert(s),s}function hh(t,n,e,o,r,c,i){const{cpTrees:s}=r;let u=!1;const f=c.map((c,f)=>{const l=o[f],a=s.get(c.curve.loop),p={...c,circle:e,order:l,order2:0},h=void 0===i?ah(a,c,l,0):i[f],d=ph(t,n,!1,a,p,h,r.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 o=t.pointOnShape.p,r=e.pointOnShape.p;o=[o[0]-n[0],o[1]-n[1]],r=[r[0]-n[0],r[1]-n[1]];const c=Math.atan2(o[1],o[0]);return Math.atan2(r[1],r[0])-c}}(t));const e=n.length;for(let t=0;t<e;t++){const o=n[t];o.nextOnCircle=n[(t+1)%e],o.prevOnCircle=n[(t-1+e)%e]}}(e,f),{anyFailed:u,cpNodes:f}}const dh=Math.cos(Math.PI/180*1);function vh(t,n,e,o,r,c){const{cpTrees:i,maxCoordPowerOf2:s}=t,u=2**(s-40),f=2**(s-46),l=ah(i.get(n.curve.loop),n,o,r);if(!l)return;const a=[l,l.next],{p,t:h}=n;for(const t of a){const n=t.pointOnShape.p,o=nn(p,n);if(!(o>u)&&(ct(lt(rt(n,t.pointOnShape.circle.center)),lt(rt(p,e.center)))>dh||o<f&&0!==h&&1!==h))return t}}function gh(t,n){const e=[];for(const t of n)e.push([t,t.next]);const o=function(t,n){const e=t.map(fh);let o,r=1/0;for(let c=1;c<t.length-1;c++)for(let i=0;i<3;i++){const s=uh(t,c,i,e,n);if(void 0===s)continue;const{error:u,threeProngInfo:f}=s;u<r&&(r=u,o=f)}return o}(e,t.maxCoordPowerOf2),{circle:r,poss:c,δ3s:i}=o,s=[];for(let t=0;t<3;t++)s.push(Lp(r.center,c[t]));const u=[];for(let n=0;n<c.length;n++){const e=vh(t,c[n],r,s[n],0);void 0!==e&&T(e)<=2&&!e.isHoleClosing&&u.push(e)}return{closeBysFor3Prong:u,cpNodes:0===u.length?hh(!0,!1,r,s,t,c,i.map(t=>t[0])).cpNodes:[]}}let mh,xh=0;function wh(t,n){if(Yt(n.pointOnShape))return{closeBysFor3Prong:void 0,addedCpNodes:[]};const e=[];for(;;){if(void 0===n)continue;const o=F(n);if(o.length<=2)break;const{closeBysFor3Prong:r,cpNodes:c}=gh(t,o);if(e.push(c),r.length>0)return{closeBysFor3Prong:r,addedCpNodes:e};if("undefined"!=typeof _debug_&&++xh===_debug_.directives.stopAfterThreeProngsNum)return}return{closeBysFor3Prong:void 0,addedCpNodes:e}}function bh(t){for(const n of t)return n}function _h(t,n,e,o){const r=n[0];A(r).forEach(t=>{e.delete(t),o.delete(t)}),J(r,t)}function Mh(t,n,e){const o=new Map;for(let r=0;r<n.length;r++){const c=new Mp(zn);o.set(t[r],c);const i=n[r];let s,u;for(const t of i){const n={center:t.p,radius:0},{curve:o}=t,r={...t,curve:o,t:1,circle:n,order:-1,order2:0},i={...t,curve:o.next,t:0,circle:n,order:1,order2:0};s=ph(!0,!1,!1,c,r,u,e),u=ph(!0,!1,!1,c,i,s,e),s.prevOnCircle=u,u.prevOnCircle=s,s.nextOnCircle=u,u.nextOnCircle=s}}return o}function Sh(t){const n=[],e=[],o=[],r=[],c=[];for(const i of t)for(const t of i.curves){const i=t.ps,s=vu(i,!0);o.push(s);const u=Gp(i);n.push(u);const f=hu(i);e.push(f);const l=jt(t.ps,t.next.ps);l.isQuiteSharp?r.push(t):l.isQuiteDull&&c.push(t)}return{looseBoundingBoxes:n,tightBoundingBoxes:e,boundingHulls:o,sharpCorners:r,dullCorners:c}}function Ch(t){return n=>{const e=[];for(let o=0;o<n.curves.length;o++){const r=n.curves[o];if(!(au(r.ps)<t)&&jt(r.ps,r.next.ps).isQuiteSharp){const{ps:t}=r,n=t[t.length-1],o=[[0,n[0]],[0,n[1]]];e.push({curve:r,t:1,isSource:!0,p:n,pDd:o})}}return e}}function yh(t,n){let e=[0,0];for(let o=0;o<t.length;o++)e=hn(t[o],ie(n,e));return e}const Oh=Oo,Eh=ie,Ih=hn,Nh=Eo,kh=oa;function Ph(t){if(4===t.length)return function(t){const[[n,e],[o,r],[c,i],[s,u]]=t;return[[Ih(Oh(s,n),Eh(3,Oh(o,c))),Eh(3,Nh(kh(c,n),-2*o)),Eh(3,Oh(o,n)),[0,n]],[Ih(Oh(u,e),Eh(3,Oh(r,i))),Eh(3,Nh(kh(i,e),-2*r)),Eh(3,Oh(r,e)),[0,e]]]}(t);if(3===t.length)return function(t){const[[n,e],[o,r],[c,i]]=t;return[[Nh(kh(c,n),-2*o),Oh(2*o,2*n),[0,n]],[Nh(kh(i,e),-2*r),Oh(2*r,2*e),[0,e]]]}(t);if(2===t.length)return function(t){const[[n,e],[o,r]]=t;return[[Oh(o,n),[0,n]],[Oh(r,e),[0,e]]]}(t);if(1===t.length)return function(t){const[[n,e]]=t;return[[[0,n]],[[0,e]]]}(t);throw new Error("The given bezier curve must be of order <= cubic.")}const Bh=ie,Th=hn,Ah=le,zh=Xo,Lh=kf,Dh=fr,qh=qo,Wh=Oo,jh=hn,Fh=le,Hh=Xo,Yh=kf,Rh=fr,Xh=qo,Qh=ie,Vh=hn,$h=le,Uh=Xo,Zh=kf,Gh=fr,Jh=qo,Kh=hn,td=le,nd=fr,ed=qo;function od(t,n,e){const[o,r]=t,[c,i]=n,[s,u]=e,f=ed(o,s),l=ed(r,u);return{a0:Kh(td(nd(c),f),td(nd(i),l)),b0:Kh(td(f,f),td(l,l))}}const rd=[,,function(t,n,e){const[o,r]=t,[c,i]=n,[[s,u],[f,l]]=e,a=Wh(f,s),p=Wh(l,u),h=Xh(o,s),d=Xh(r,u),v=jh(Fh(c,a),Fh(i,p)),g=Hh(jh(Fh(a,a),Fh(p,p))),m=jh(Fh(a,h),Fh(p,d)),x=Yh(v),w=jh(Fh(Rh(c),h),Fh(Rh(i),d)),b=Hh(g),_=Yh(m),M=jh(Fh(h,h),Fh(d,d));return{A:[x,w],B:[b,_,M],C:[v],D:[g,m],H:[Fh(b,v),Fh(w,g),jh(Fh(w,m),Hh(Fh(M,v)))]}},function(t,n,e){const[o,r]=t,[c,i]=n,[[s,u]]=e,[[f,l],[a,p]]=Ph(e),h=qh(o,s),d=qh(r,u),v=Dh(Th(Ah(c,f),Ah(i,a))),g=Th(Ah(c,l),Ah(i,p)),m=Th(Ah(c,h),Ah(i,d)),x=Th(Ah(f,f),Ah(a,a)),w=Th(Ah(l,f),Ah(p,a)),b=Th(Ah(l,l),Ah(p,p)),_=Th(Ah(h,f),Ah(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$h(x,M))),Qh(5,$h(w,_))),Vh(Vh(Gh($h(x,R)),Qh(8,$h(w,M))),Uh(Qh(6,$h(b,_)))),Vh(Vh(Uh($h(m,Q)),$h(x,X)),Vh(Qh(3,$h(w,R)),Uh(Qh(10,$h(b,M))))),Vh(Vh(Zh($h(m,V)),Gh($h(w,X))),Uh(Gh(Gh($h(b,R))))),Vh(Vh(Vh($h(w,Q),Uh($h(x,V))),Uh(Qh(3,$h(b,X)))),Uh(Qh(3,$h(m,k)))),Vh(Zh($h(b,Q)),Zh($h(x,k))),Vh(Uh($h(b,V)),Uh($h(w,k)))]}}],cd=ie,id=hn,sd=le,ud=Xo,fd=fr,ld=ie,ad=hn,pd=le,hd=Xo,dd=kf,vd=fr,{sqrt:gd,abs:md,max:xd}=Math,wd=ce;function bd(t,n,e,o,r,c,i){const{curve:s,ts:[u,f]}=i,{ps:l}=s,{curve:a,t:p,p:h,pDd:d}=o,v=s===a,g=0===c&&v,m=[];let x,w=!1,b=!1;if(!(u===f||g&&2===l.length||v&&3===l.length&&r)){const{A:n,B:o,H:r}=g?3===l.length?function(t,n,e){const[[o,r],[c,i]]=Ph(e),[s,u]=n,f=id(cd(t,o),r),l=id(cd(t,c),i),a=id(sd(o,o),sd(c,c)),p=id(sd(o,r),sd(c,i)),h=id(sd(o,f),sd(c,l)),d=fd(id(sd(s,o),sd(u,c)));return{A:[ud(d)],B:[a,fd(h),id(sd(f,f),sd(l,l))],H:[sd(a,d),sd(d,id(cd(t,a),p))]}}(p,e,l):function(t,n,e){const[o,r]=n,[[c,i,s],[u,f,l]]=Ph(e),a=ad(pd(o,c),pd(r,u)),p=ad(pd(o,i),pd(r,f)),h=ad(pd(o,s),pd(r,l)),d=ad(pd(c,c),pd(u,u)),v=ad(pd(c,i),pd(u,f)),g=ad(pd(c,s),pd(u,l)),m=ad(pd(i,i),pd(f,f)),x=ad(pd(i,s),pd(f,l)),w=ad(pd(s,s),pd(l,l)),b=ld(t,ad(ld(t,ad(ld(t,a),p)),h)),_=ld(t,ad(ld(t,ad(ld(t,d),v)),g)),M=ld(t,ad(ld(t,ad(ld(t,v),m)),x)),S=ld(3,a),C=vd(p),y=ad(C,ld(t,S)),O=ld(-3,d),E=ld(-5,v),I=ad(ld(-4,g),dd(m)),N=ad(ld(-3,x),ld(3,_)),k=ad(hd(w),vd(M)),P=O,B=ad(E,ld(t,P)),T=ad(I,ld(t,B)),A=ad(N,ld(t,T)),z=ad(k,ld(t,A)),L=dd(a),D=dd(p),q=d,W=vd(v),j=ad(vd(g),m),F=ad(vd(x),dd(_)),H=ad(w,dd(M)),Y=L,R=ad(D,vd(ld(t,Y))),X=q,Q=ad(W,vd(ld(t,X))),V=ad(j,ld(t,ad(vd(Q),hd(ld(t,X))))),$=ad(F,ld(t,ad(vd(V),hd(ld(t,Q))))),U=ad(H,ld(t,ad(vd($),hd(ld(t,V))))),Z=ld(3,pd(a,d)),G=vd(vd(ad(pd(a,v),pd(p,d)))),J=ad(ad(pd(a,j),ld(6,pd(p,v))),ld(5,pd(h,d))),K=ad(ad(vd(pd(p,j)),ld(8,pd(h,v))),hd(ld(6,pd(b,d)))),tt=ad(ad(hd(pd(a,H)),pd(p,F)),ad(ld(3,pd(h,j)),hd(ld(10,pd(b,v))))),nt=Z,et=ad(G,vd(vd(ld(t,nt)))),ot=ad(J,ld(t,ad(vd(vd(et)),hd(ld(6,ld(t,nt)))))),rt=ad(K,ld(t,ad(vd(vd(ot)),ld(t,ad(ld(-6,et),vd(vd(ld(t,nt))))))));return{A:[Y,R],B:[X,Q,V,$,U],C:[S,y],D:[P,B,T,A,z],H:[nt,et,ot,rt,ad(tt,ld(t,ad(vd(vd(rt)),ld(t,ad(ld(-6,ot),ld(t,ad(vd(vd(et)),hd(ld(t,nt)))))))))]}}(p,e,l):function(t,n,e){if(1===e.length){const{a0:o,b0:r}=od(t,n,e[0]);return{A:[o],B:[r],C:[],D:[],H:[]}}return rd[e.length](t,n,e)}(d,e,l);x=Je(r,u,f)||[];for(let r=0;r<x.length;r++){const c=x[r],{tS:i,tE:l,t:a}=c;if(c.multiplicity>1)continue;if(l<u||i>f)continue;if(i<0)continue;const p=l>1?1:a,d=yh(n,p),v=yh(o,p),g=d[0]+d[1],_=v[0]+v[1],M=md(g);if(xd(M)<2**-40)continue;const S=-_/g;if(S<=0)continue;const C=[wd(S,e[0]),wd(S,e[1])],y=[C[0][1],C[1][1]],O=gd(Dp(y));if(O<=2**(t-40))continue;const E=[h[0]+y[0],h[1]+y[1]];c.tS<=u&&c.tE>=u&&(w=!0),c.tS<=f&&c.tE>=f&&(b=!0);const I=0===p?1:p,N={curve:0===p?s.prev:s,s:I,d:O,x:E};m.push(N)}}const _=l[l.length-1];let M=0===p&&s===a.prev||1===p&&s===a;const S=[];if(0===u);else if(1===u)M||w||S.push({P:_,t:1});else if(!w){const t=Ke(l,u);S.push({P:t,t:u})}if(u!==f)if(0===f);else if(1===f)M||b||(S.push({P:_,t:1}),M=!0);else if(!b){const t=Ke(l,f);S.push({P:t,t:f})}for(let t=0;t<S.length;t++){const{P:n,t:o}=S[t],{a0:r,b0:c}=od(d,e,n);if(md(r[1])<=2**-40||md(c[1])<=2**-40)continue;const i=-c[1]/r[1];if(i<2**-40)continue;const u=[wd(i,e[0]),wd(i,e[1])],f=[u[0][1],u[1][1]],l=gd(Dp(f)),a=[h[0]+f[0],h[1]+f[1]],p=0===o?1:o,v={curve:0===o?s.prev:s,s:p,d:l,x:a};m.push(v)}return m}function _d(t,n,e){const[o,r]=t,[c,i]=n,[s,u]=e,f=o-s,l=r-u;return{a0:2*(c*f+i*l),b0:f*f+l*l}}const{abs:Md}=Math,Sd=1+2**-20,Cd=1+2**-20,yd=et(hu),Od=pn,Ed=hn,Id=dn,Nd=ce,{acos:kd}=Math,Pd=oa,Bd=Oo,Td=ie,Ad=hn,zd=Eo;function Ld(t){if(4===t.length)return function(t){const[[n,e],[o,r],[c,i],[s,u]]=t;return[[Td(3,Ad(Bd(s,n),Td(3,Bd(o,c)))),Td(6,zd(Pd(c,n),-2*o)),Td(3,Bd(o,n))],[Td(3,Ad(Bd(u,e),Td(3,Bd(r,i)))),Td(6,zd(Pd(i,e),-2*r)),Td(3,Bd(r,e))]]}(t);if(3===t.length)return function(t){const[[n,e],[o,r],[c,i]]=t;return[[zd(Pd(2*c,2*n),-4*o),Bd(2*o,2*n)],[zd(Pd(2*i,2*e),-4*r),Bd(2*r,2*e)]]}(t);if(2===t.length)return function(t){const[[n,e],[o,r]]=t;return[[Bd(o,n)],[Bd(r,e)]]}(t);if(1===t.length)return[[[0,0]],[[0,0]]];throw new Error("The given bezier curve must be of order <= 3.")}const Dd=Oo,qd=hn,Wd=ie,jd=Eo;function Fd(t){if(4===t.length){const[[n,e],[o,r],[c,i],[s,u]]=t;return[[Wd(6,qd(Dd(s,n),Wd(3,Dd(o,c)))),Wd(6,jd(Dd(c,2*o),n))],[Wd(6,qd(Dd(u,e),Wd(3,Dd(r,i)))),Wd(6,jd(Dd(i,2*r),e))]]}if(3===t.length){const[[n,e],[o,r],[c,i]]=t;return[[jd(Dd(2*c,4*o),2*n)],[jd(Dd(2*i,4*r),2*e)]]}if(t.length<=2)return[[[0,0]],[[0,0]]];throw new Error("The given bezier curve must be of order <= 3.")}const Hd=le,Yd=hn,Rd=dn;const{sqrt:Xd}=Math;function Qd(t,n,e){const{curve:o,p:r,t:c}=n,{ps:i}=o,s=1/t,u=function(t,n){const[e,o]=function(t,n){const[e,o]=Ld(t),[r,c]=Fd(t),i=yh(e,n),s=yh(o,n),u=yh(r,n),f=yh(c,n),l=Rd(Hd(i,f),Hd(s,u)),a=Yd(Hd(i,i),Hd(s,s));return[l,ia(Hd(a,Hd(a,a)))]}(t,n);return es(e,o)}(i,c),f=-(u[0]+u[1]),l=f<s?s:f,[a,p]=e,h=Xd(a*a+p*p)*l;return[[r[0]+a/h,r[1]+p/h],1/l]}const{sqrt:Vd}=Math,{abs:$d,sin:Ud,cos:Zd,max:Gd,sqrt:Jd}=Math;function Kd(t){const{loops:n,maxCoordPowerOf2:e,squaredDiagonalLength:o}=t,c=(2**(e-21))**2,i=2**(e-46),s=Jd(o),u=2**(e-32);return function(o,f,l,a){const{curve:{loop:p,ps:h},t:d,p:v}=a,g=function(t,n){const[e,o]=Ld(t),r=yh(o,n);return[[-r[0],-r[1]],yh(e,n)]}(h,d),m=[-g[0][1],-g[1][1]],x=o?[0,-s]:0!==l?r(Ud(l),Zd(l))(m):m,w=o||0!==l?[[0,x[0]],[0,x[1]]]:[[-g[0][0],-g[0][1]],[-g[1][0],-g[1][1]]];let[b,_]=function(t,n,e,o,r){let c,i;const{p:s}=o;if(n)return[[s[0],s[1]-e],e];if(0===t)return Qd(e,o,r);const{p:u}=o,[f,l]=r,a=e/Vd(f*f+l*l),p=[f*a,l*a];return c=[u[0]+p[0],u[1]+p[1]],i=e,[c,i]}(l,o,s,a,x);const M=function(t,n,e,o,r,c,i){const{cpTrees:s}=r;if(n)return o.filter(t=>t!==e).flatMap(t=>t.curves.map(t=>({curve:t,ts:[0,1]})));const u=Ht(c)&&Ft(c).isDull?1===c.t&&0===t?-1:0===c.t?1:Lp(i,c):0,f=ah(s.get(e),c,u,0);return f&&f!==f.next.next?fh([f,f]):e.curves.map(t=>({curve:t,ts:[0,1]}))}(l,o,p,n,t,a,b),S=function(t,n,e,o,r){let c=n**2,i=[o[0]+r[0],o[1]+r[1]];for(let t=0;t<e.length;t++){const n=e[t],{ps:s}=n.curve,u=s[0],f=s[s.length-1];for(const t of[u,f]){if(Gs(i,t)>c)continue;const{a0:n,b0:e}=_d(o,r,t);if(Md(n)<=2**-40||Md(e)<=2**-40)continue;const s=-e/n;if(s<2**-40)continue;const u=[s*r[0],s*r[1]],f=Dp(u);f<c&&(c=f,i=[o[0]+u[0],o[1]+u[1]])}}return Sd*c}(0,_,M,v,x),C=Jd(S),y=Jd(x[0]**2+x[1]**2);b=[v[0]+x[0]/y*C,v[1]+x[1]/y*C],function(t,n,e){if(t.length<=2)return t;let o=0;for(let r=0;r<t.length;r++){const c=t[r],{ps:i}=c.curve;Zp(Gp(i),n)<=Cd*e&&Jp(yd(i),n)<=Cd*e&&(t[o]=c,o++)}t.length=o}(M,b,S);const O=function(t,n,e,o,r,c,i){const s=[];for(let n=0;n<i.length;n++){const u=bd(t,0,e,o,r,c,i[n]);s.push(...u)}let u=1/0;for(let t=0;t<s.length;t++){const n=s[t].d*(1+2**-46);n<u&&(u=n)}const f=[];for(let t=0;t<s.length;t++){const n=s[t];n.d*(1-2**-46)<=u&&f.push(n)}return f}(e,0,w,a,f,l,M);if(1!==O.length){if(0===O.length)return void(o&&console.log(a));if(!o&&!function(t,n){const{curve:e,s:o,x:r}=t[0],c=2**(n-40);for(let n=1;n<t.length;n++){const{x:e}=t[n];if($d(r[0]-e[0])>c||$d(r[0]-e[0])>c)return!1}return!0}(O,e))return}const{x:E,d:I,curve:N,s:k}=O[0];if(f&&_<(1-u)*I)return void function(t,n,e,o){if(Ht(o)&&Ft(o).isDull)return;const r={radius:n,center:e};vh(t,o,r,Lp(r.center,o),0)||hh(!1,!1,r,[-.5,.5],t,[o,o])}(t,_,b,a);const P=th(N.ps,k),B={curve:N,t:k,isSource:!1,p:P.map(t=>t[0]+t[1]),pDd:P},T={center:E,radius:I},A=Xp(a.p,B.p),z=Xp(E,B.p);if(!o){if(0===A)return;if(A<=Gd(function(t,n,e){if(n+e>=t)return 1/0;const o=Oo(t,n),r=Nd(n,o),c=t-n,i=n*c,s=(i-n*e-e*e/2)/(i+c*e),u=es(Id(Id(r,Od(n,e)),Od(e,e/2)),Ed(r,Nd(e,o)))[1];return kd(s),n*kd(u)}(_,Jd(z),4*i),c))return}return{circle:T,z:B}}}function tv(t,n,e,o,r){e=0===e.t?{...e,curve:e.curve.prev,t:1}:e;const c=Lp(n.center,e),i=Lp(n.center,o),s={...o,circle:n,order:i,order2:0},u={...e,circle:n,order:c,order2:0};if(vh(t,e,n,c,0))return;if(vh(t,o,n,i,0))return;const{anyFailed:f,cpNodes:l}=hh(r,r,n,[c,i],t,[u,s]);if(!f)return r&&function(t,n){const{cpTrees:e}=t,[o,r]=n,c=r.pointOnShape,i=ph(!0,!0,!1,e.get(c.curve.loop),{...c,order2:1},r,t.lastInsertId);i.holeCloserTwin=r,r.holeCloserTwin=i;const s=o.pointOnShape,u=ph(!0,!0,!1,e.get(s.curve.loop),{...o.pointOnShape,order2:-1},o.prev,t.lastInsertId);u.holeCloserTwin=o,o.holeCloserTwin=u,u.prevOnCircle=i,u.nextOnCircle=i,i.prevOnCircle=u,i.nextOnCircle=u,r.next=o,o.prev=r,u.next=i,i.prev=u}(t,l),l[0];l.forEach(n=>{void 0!==n&&G(n,t)})}const{PI:nv,atan2:ev}=Math;function ov(t,n,e,o){let r;const c=Kd(t),i=n*nv/180;for(let n=0;n<e.length;n++){const s=e[n],u=rv(i,s);for(const e of u){const i=c(!1,o,e,s);if(i){const{circle:n,z:e}=i,o=tv(t,n,s,e,!1);r=r||o}if("undefined"!=typeof _debug_&&n+1===_debug_.directives.stopAfterTwoProngsNum)return}}return r}function rv(t,n){const e=[0];if(1===n.t){const{curve:o}=n,r=jt(o.ps,o.next.ps);if(r.isQuiteDull){const n=zp(r.tangents[0]),o=zp(r.tangents[1]),c=(ev(n[1],n[0])+2*nv)%(2*nv),i=((ev(o[1],o[0])+2*nv)%(2*nv)-c+2*nv)%(2*nv);let s=t;for(;s<=i-t/2;)e.push(s),s+=t}}return e}function cv(t,n,e,o){let r;for(let c=0;c<e.length;c++){const i=ov(t,n,e[c],o);r=void 0===r?i:r}return r}function iv(t,n=.4,e=10,o=2**-16){const r=[0],c=[1];for(;;){const i=r[r.length-1],s=c[c.length-1],u=U(t,i,s),f=au(u),l=wn(u);if(f<=e&&l<=n||s-i<=o){if(r.push(c.pop()),1===s)return r;continue}const a=(i+s)/2;c.push(a)}}function sv(t){if(t.length<4)return[];const[[n,e],[o,r],[c,i],[s,u]]=t,f=o-n,l=r-e,a=c-o-f,p=i-r-l,h=s-c-f-2*a,d=u-i-l-2*p,v=a*d-p*h,g=f*d-l*h,m=f*p-l*a;return Je([v,g,m],0,1)?.map(t=>t.t)||[]}function uv(t,n,e){return function(o){const r=[],c=o.curves;for(let o=0;o<c.length;o++){const i=c[o],s=i.ps;if(au(s)<t)continue;let u=iv(s,n,e);u=2===u.length?[.5]:u,u.push(...sv(s)),u=u.filter(t=>0!==t&&1!==t);const f=u.map(t=>{const n=th(i.ps,t),e=n.map(t=>t[0]+t[1]);return{curve:i,t,isSource:!0,p:e,pDd:n}});r.push(...f)}return r}}const fv=Oo,lv=hn,av=ie,pv=fr,hv=hf,dv=ie,vv=le,gv=hn,mv=dn;const xv=Oo,wv=ie,bv=le,_v=hn,Mv=dn;function Sv(t){if(Rs(t))return{minima:[],maxima:[],inflections:[]};if(4===t.length&&ou(t)&&(t=Uc(t)),3===t.length){const n=function(t){const[[n,e],[o,r],[c,i]]=t,s=xv(o,n),u=xv(c,o),f=Mv(u,s),l=xv(r,e),a=xv(i,r),p=Mv(a,l),h=_v(Mv(wv(n,Mv(f,[0,o])),wv(o,Mv(u,[0,o]))),Mv(wv(e,Mv(p,[0,r])),wv(r,Mv(a,[0,r]))));return[_v(bv(f,f),bv(p,p)),Xo(h)]}(t);return{minima:[],maxima:Je(n,0,1)?.map(t=>t.t)||[],inflections:[]}}const n=function(t){const[[n,e,o],[r,c,i]]=Ld(t),[[s,u],[f,l]]=Fd(t),[[a],[p]]=function(t){if(4===t.length){const[[n,e],[o,r],[c,i],[s,u]]=t;return[[av(6,lv(fv(s,n),av(3,fv(o,c))))],[av(6,lv(fv(u,e),av(3,fv(r,i))))]]}if(t.length<=3)return[[[0,0]],[[0,0]]];throw new Error("The given bezier curve must be of order <= 3.")}(t),h=vv(a,c),d=vv(p,e),v=vv(u,i),g=vv(u,c),m=vv(f,f),x=vv(s,i),w=vv(l,o),b=vv(l,e),_=vv(f,o),M=vv(o,e),S=vv(o,n),C=vv(o,r),y=vv(e,e),O=vv(e,n),E=vv(e,c),I=vv(n,i),N=vv(n,r),k=vv(n,n),P=vv(i,c),B=vv(i,r),T=vv(c,c),A=vv(c,r),z=vv(r,r),L=mv(vv(a,i),vv(p,o)),D=mv(h,d),q=gv(vv(u,o),vv(l,i)),W=gv(gv(vv(u,e),vv(s,o)),gv(vv(l,c),vv(f,i))),j=mv(v,w),F=mv(gv(g,x),gv(b,_)),H=gv(vv(o,o),vv(i,i)),Y=gv(M,P),R=gv(E,I),X=gv(B,T),Q=gv(S,y),V=gv(vv(e,r),vv(n,c)),$=mv(k,z),U=mv(O,A),Z=gv(C,E),G=mv(M,P),J=gv(vv(o,c),vv(e,i)),K=gv(B,X),tt=gv(S,Q),nt=gv(C,R),et=gv(E,R),ot=mv(tt,K),rt=gv(R,I),ct=gv(Z,I),it=gv(fr(b),_),st=vv(k,mv(h,dv(3,d))),ut=vv(z,mv(dv(3,h),d)),ft=fr(gv(vv(N,gv(mv(vv(a,e),vv(p,c)),dv(3,mv(vv(l,f),vv(u,s))))),dv(3,vv(vv(s,f),U)))),lt=dv(3,gv(vv(V,mv(m,vv(s,s))),vv($,gv(vv(u,f),vv(l,s))))),at=gv(gv(st,ut),gv(ft,lt)),pt=vv(a,gv(vv(r,gv(tt,dv(3,X))),vv(n,et))),ht=vv(p,gv(gv(vv(o,gv(dv(3,k),z)),vv(e,gv(dv(3,O),pv(A)))),vv(n,K))),dt=dv(3,gv(gv(vv(u,gv(mv(vv(l,$),vv(u,N)),pv(mv(vv(f,U),vv(s,V))))),vv(s,mv(gv(pv(vv(l,U)),vv(f,gv(pv(mv(S,B)),mv(y,T)))),vv(s,ct)))),gv(vv(l,gv(vv(l,N),pv(vv(f,V)))),vv(m,nt)))),vt=gv(mv(pt,ht),dt),gt=vv(a,gv(gv(pv(vv(o,V)),vv(e,rt)),vv(c,gv(hv(B),K)))),mt=vv(p,gv(gv(pv(vv(o,gv(dv(3,O),A))),vv(e,gv(y,pv(B)))),vv(c,rt))),xt=dv(3,gv(gv(vv(u,mv(gv(pv(mv(vv(l,U),vv(s,ct))),vv(f,ot)),vv(u,V))),vv(s,mv(pv(vv(f,G)),vv(s,J)))),gv(vv(l,gv(gv(vv(l,V),pv(vv(f,nt))),vv(s,ot))),vv(m,J)))),wt=gv(mv(gt,mt),xt),bt=vv(a,gv(vv(o,gv(C,pv(R))),vv(i,gv(y,dv(3,X))))),_t=vv(p,gv(vv(o,gv(dv(3,Q),K)),vv(i,et))),Mt=dv(3,gv(gv(vv(u,gv(mv(vv(l,ot),vv(u,nt)),pv(mv(vv(f,G),vv(s,J))))),vv(s,mv(vv(o,mv(it,vv(s,i))),vv(i,gv(pv(vv(l,c)),vv(f,i)))))),gv(vv(l,gv(vv(l,R),vv(o,gv(pv(vv(f,c)),vv(l,r))))),vv(f,vv(i,it))))),St=gv(mv(bt,_t),Mt),Ct=mv(gv(vv(H,D),pv(vv(Y,L))),dv(3,gv(vv(q,F),vv(W,j)))),yt=mv(vv(L,H),dv(3,vv(q,j)));return{inflectionPoly:[mv(vv(s,r),vv(f,n)),mv(gv(vv(u,r),vv(s,c)),gv(vv(l,n),vv(f,e))),mv(gv(g,x),gv(b,_)),mv(v,w)],otherExtremaPoly:[at,vt,wt,St,Ct,yt]}}(t),e=n.inflectionPoly,o=n.otherExtremaPoly,r=Je(o,0,1)?.map(t=>t.t)||[],c=function(t){const n=t.length-1;if(n<=0)return[];const e=new Array(n);for(let o=0;o<n;o++)e[o]=ie(n-o,t[o]);return e}(o),i=[],s=[];for(let t=0;t<r.length;t++){const n=r[t],o=ye(c,n);St(wt(ye(e,n),o))>=0?i.push(n):s.push(n)}return{minima:i,maxima:s,inflections:Je(e,0,1)?.map(t=>t.t)||[]}}function Cv(t){const{curve:n,t:e}=t,{ps:o}=n,r=th(o,e),c=r.map(t=>t[0]+t[1]);return{curve:n,t:t.t,isSource:!0,p:c,pDd:r}}function yv(t,n,e,o,r){(r&&(o>t.val||o===t.val&&e>t.t)||!r&&(o<t.val||o===t.val&&e>t.t))&&(t.curve=n,t.t=e,t.val=o)}const Ov=et(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 o=to(t.ps);for(let r=0;r<2;r++)yv(n[r],t,o.ts[0][r],o.box[0][r],!1),yv(e[r],t,o.ts[1][r],o.box[1][r],!0)}),{minX:Cv(n[0]),minY:Cv(n[1]),maxX:Cv(e[0]),maxY:Cv(e[1])}});function Ev(t){return Ov(t).minY}function Iv(t){const{loops:n}=t,e=n.map(Ev);let o;const r=Kd(t);for(let n=1;n<e.length;n++){const c=e[n],i=r(!0,!1,0,c);if(!i)throw new Error("Unable to find hole-closing 2-prong");const{circle:s,z:u}=i,f=tv(t,s,c,u,!0);o=void 0===o?f:o}return o}const Nv=et(function(t){let n,e,o,r,c=1/0,i=-1/0,s=1/0,u=-1/0;for(const f of t){const t=Ov(f);t.minX.p[0]<c&&(n=t.minX,c=t.minX.p[0]),t.maxX.p[0]>i&&(e=t.maxX,i=t.maxX.p[0]),t.minY.p[1]<s&&(o=t.minY,s=t.minY.p[1]),t.maxY.p[1]>u&&(r=t.maxY,u=t.maxY.p[1])}return{minX:n,minY:o,maxX:e,maxY:r}});function kv(t,n,e){"undefined"!=typeof _debug_&&(mh=performance.now());const{minBezLength:o,maxCurviness:r,maxLength:c,angleIncrement:i}=e,s=Ch(o),u=function(t){return n=>{const e=[];for(let o=0;o<n.curves.length;o++){const r=n.curves[o];if(au(r.ps)<t)continue;const{next:c,ps:i}=r;if(jt(i,c.ps).isQuiteDull){const t=i[i.length-1],n=[[0,t[0]],[0,t[1]]];e.push({curve:r,t:1,isSource:!0,p:t,pDd:n}),e.push({curve:c,t:0,isSource:!0,p:t,pDd:n})}}return e}}(o),f=uv(o,r,c),l=function(t){return function(n){const e=[];for(let o=0;o<n.curves.length;o++){const r=n.curves[o];if(au(r.ps)<t)continue;const{ps:c}=r;e.push(...Sv(c).maxima.map(t=>{const n=th(c,t),e=n.map(t=>t[0]+t[1]);return{curve:r,t,isSource:!0,p:e,pDd:n}}))}return e}}(o),a=Nv(t),p=(a.maxX.p[0]-a.minX.p[0])**2+(a.maxY.p[1]-a.minY.p[1])**2,h=t.map(s),d={id:0},v={maxCoordPowerOf2:n,squaredDiagonalLength:p,loops:t,cpTrees:Mh(t,h,d),lastInsertId:d,...Sh(t)};let g;if(g=Iv(v),"undefined"!=typeof _debug_&&_debug_.directives.stopAfterHoleClosers)return{cpNode:g,meta:v};if(function(){if("undefined"==typeof _debug_)return;const t=performance.now();_debug_.timing.holeClosers+=t-mh,mh=t}(),g=cv(v,i,t.map(u),!1)||g,g=cv(v,i,t.map(l),!0)||g,g=cv(v,i,t.map(f),!1)||g,function(){if("undefined"==typeof _debug_)return;const t=performance.now();_debug_.timing.oneAnd2Prongs+=t-mh,mh=t}(),"undefined"!=typeof _debug_&&_debug_.directives.stopAfterTwoProngs)return{cpNode:g,meta:v};if(g=function(t,n){if(void 0===n)return;const e=new Set;let o=!0;for(;o;){o=!1;const r=new Set(k(n));for(const n of r){const{closeBysFor3Prong:c,addedCpNodes:i}=wh(t,n);i.length>0&&(o=!0),void 0===c?e.add(n):(o=!0,_h(t,c,r,e)),i.forEach(t=>t.forEach(t=>e.add(t)))}n=bh(e)}return n}(v,g),void 0===g)return;if("undefined"!=typeof _debug_&&_debug_.directives.stopAfterThreeProngs)return{cpNode:g,meta:v};const m={cpNode:g,meta:v};return"undefined"!=typeof _debug_&&(_debug_.timing.threeProngs+=performance.now()-mh),m}const{ceil:Pv,log2:Bv}=Math;function Tv(t,n){const{maxCoordinate:e}=function(t){let n=0,e=1/0,o=-1/0,r=1/0,c=-1/0;for(const i of t)for(const t of i)for(const i of t){const t=i[0],s=i[1],u=ep(op(t),op(s));u>n&&(n=u),t<e&&(e=t),t>o&&(o=t),s<r&&(r=s),s>c&&(c=s)}return{maxCoordinate:n,width:o-e,height:c-r}}(t),o=Pv(Bv(e)),r=function(t,n){const e={...n};for(const n in Ap){const o=n;let r=e[o];const c=Ap[o],{range:i,scaleByMaxCoordinate:s}=c;r<i[0]&&(r=i[0]),r>i[1]&&(r=i[1]),s&&(r*=2**(t-10)),e[o]=r}return e}(o,{...Tp,...n||{}}),{applySat:c,simplify:i,satScale:s,simplifyTolerance:u}=r,f=np(t,{forceOrientationNegative:!0}),l=[];for(const t of f){let n=kv(t,o,r);void 0!==n&&(c&&(n=Bp(n,s)),i&&(n=yp(n,u,50)),l.push(n))}return l}function Av(t){const n=function(t){let n=t;const e=Ep(t);for(;e.length;){const o=e.pop();if(o.isHoleClosing||o.isIntersection)continue;let r=o.next;for(;;){r=r.next;let e=!1;const o=r.prevOnCircle;if(T(r)>2){const n=r.nextOnCircle;Zt(r,t)?e=!0:r.next===n?r=n:n.next!==o&&(e=!0)}else if(z(r)&&!r.isIntersection)return void(n=r);if(e){o.next=r,r.prev=o,n=r;break}}}return n}(Q(t.cpNode));if(n)return{cpNode:n,meta:{...t.meta,cpTrees:Sp(n)}}}function zv(t){if(!t)return void(window._debug_=void 0);let n=window._debug_;n={...n,elems:{...n?.elems},timing:{...n?.timing,holeClosers:0,oneAnd2Prongs:0,threeProngs:0,sats:0,simplifyMat:0},fs:{...n?.fs},directives:{...n?.directives,stopAfterHoleClosers:!1,stopAfterHoleClosersNum:void 0,stopAfterTwoProngs:!1,stopAfterTwoProngsNum:void 0,stopAfterThreeProngs:!1,stopAfterThreeProngsNum:void 0}},window._debug_=n}function Lv(t,n,e,o){const r=[];for(const o of t)r.push({type:0,item:o,x:n(o)}),r.push({type:1,item:o,x:e(o)});r.sort(Dv);const c=new Set,i=[];for(const t of r){const{item:n}=t;if(0===t.type){for(const t of c.values())o(n,t)&&i.push([n,t]);c.add(n)}else 1===t.type&&c.delete(t.item)}return i}function Dv(t,n){const e=t.x-n.x;return 0!==e?e:0===t.type?-1:1}const qv=1e-4;function Wv(t,n){const e=t.pointOnShape,o=n.pointOnShape;let{curve:r,p:c,t:i}=e,{curve:s,p:u,t:f}=o;if(c[0]===u[0]&&c[1]===u[1])return[c];1===i&&(i=0,r=r.next),0===f&&(f=1,s=s.prev);const{ps:l}=r,{ps:a}=s,p=[c,ft(c)(lt(ht(l,i)))],h=[u,ft(u)(lt(ht(a,f)))],d=ot(p,h),v=rt(c,u);let g;if(d){const t=rt(c,d),n=rt(u,d);g=ct(t,v)<0||ct(n,v)>0}else g=!0;if(!g)return[c,d,u];const m=rt(p[0],p[1]),x=rt(h[0],h[1]),w=Math.abs(st(v,m))/9,b=Math.abs(st(v,x))/9;return w>.01||b>.01||w>qv||b>qv?void 0:[c,u]}const jv=et(function(t){return In($t(t))});function Fv(t,n){const e=function(t){const n=new Map;for(let e of t)for(let o of t){const t=e.pointOnShape.circle.center,r=o.pointOnShape.circle.center,c=e.pointOnShape.p,i=o.pointOnShape.p;o!==e&&t[0]===r[0]&&t[1]===r[1]&&c[0]===i[0]&&c[1]===i[1]&&n.set(e,o)}return n}(n),o=t.length,r=[];for(let n=0;n<o;n++){const c=t[n],i=[];for(let r=0;r<o;r++){const o=t[r];if(n===r){i.push(0);continue}let s=1/0;for(const t of A(c)){let n=jv(t),r=t.next;for(;!Zt(r,o);)if(r.isHoleClosing)r=Hv(e,r);else{if(qn(r)){n=1/0;break}n+=jv(r),r=r.next}n<s&&(s=n)}i.push(s)}r.push(i)}return r}function Hv(t,n){return t.get(n).next}function Yv(t){let{cpNode:n}=t,e=n;do{if(q(n)||n.next!==n.nextOnCircle){n=n.next;continue}const t=n.next,o=t.next,r=n.next.nextOnCircle;n.next=o,n.nextOnCircle=r,o.prev=n,r.prevOnCircle=n,e===t&&(e=n),n=n.next}while(n!==e);return t.cpNode=n,t}function Rv(t,n){return t.pointOnShape.curve.loop===n.pointOnShape.curve.loop}function Xv(t){const n=[],e=[t],o=new Set(e);for(t.isHoleClosing&&o.add(t.prevOnCircle.holeCloserTwin),o.add(t);e.length>0;){const t=[],r=e.pop(),c=r.pointOnShape.curve.loop;let i=r;do{if(c===i.pointOnShape.curve.loop){t.push(i),i=i.next;continue}const n=i.holeCloserTwin;o.has(n)||(o.add(n),o.add(n.prevOnCircle.holeCloserTwin),e.push(n)),i=i.prev.holeCloserTwin}while(i!==r);n.push(t)}return n}function Qv(t){let{cpNode:n}=t;for(;!q(n);)n=n.next;return Rv(n,n.next)||(n=n.holeCloserTwin),Xv(n)}const{max:Vv,abs:$v,round:Uv,log2:Zv}=Math;function Gv(t,n=void 0){const e=function(t,n){return function(e){const o=e.next,r=e.pointOnShape,c=o.pointOnShape,{curve:i,circle:s,p:u}=r,{curve:f,p:l}=c;if(u[0]===l[0]&&u[1]===l[1])return;if(i.loop!==f.loop)return;const a=nn(s.center,u);if(L(e),void 0!==n){const e=2**(t-n);if($v(s.radius-a)>e)throw new Error(`Medial circle radius must be about the same (2**${Uv(Zv(e))}) as distance from medial circle center to point on shape, found: medial radius ${s.radius}, distance: ${a}`)}return function(t){const n=t.next,e=t.pointOnShape,o=n.pointOnShape,{p:r}=e,{p:c}=o,i=r,s=eg(t,Jv),u=c,f=eg(n,Kv),l=ot(s,f),a=rt(i,u);let p;if(l){const t=rt(i,l),n=rt(u,l);p=ct(t,a)<0||ct(n,a)>0}else p=!0;if(!p)return[i,l,u];const h=it(a),d=rt(s[0],s[1]),v=rt(f[0],f[1]),g=$v(st(a,d))/9,m=$v(st(a,v))/9;if(g>tg||m>tg)return[i,u];if(g>ng||m>ng){const t=ut(i,u,1/3),n=ut(i,u,2/3),e=ft(h,t),o=[n,ft(h,n)];return[i,ot(s,[t,e]),ot(f,o),u]}return[i,u]}(e)}}(Vv(...t.map(t=>t.meta.maxCoordPowerOf2)),n),o=function(t,n,e){if(!Number.isInteger(3))throw new Error("depth must be an integer >= 1");return function t(n,o){const r=o;if(1===n){const t=[];for(let n=0;n<r.length;n++){const o=e(r[n]);void 0===o||t.push(o)}return t}const c=[];for(let e=0;e<r.length;e++)c.push(t(n-1,r[e]));return c}(3,n)}(0,t.map(Yv).map(Qv),e);return o}const Jv=0,Kv=1,tg=.01,ng=1e-4;function eg(t,n){let{pointOnShape:e}=t,{curve:o,t:r,p:c}=e,{ps:i}=o;return n===Jv&&1===r&&(r=0,o=o.next,i=o.ps),n===Kv&&0===r&&(r=1,o=o.prev,i=o.ps),[c,ft(c,ht(i,r))]}function og(t,n){return{center:t.center,radius:n*t.radius}}export{Ln as CpNodeFs,e as beziersToSvgPathStr,Q as clone,zn as cpNodeComparator,Mh as createInitialCpTree,zv as enableDebugForMat,j as enhanceCpNode,Kd as find2Prong,Iv as findAndAddHoleClosing2Prongs,Tv as findMats,N as floydWarshall,A as getAllOnCircle,k as getAllOnLoop,Xv as getAllOnLoop_ByLoop,Tn as getAllVertices,$ as getBoundaryBezierPartsToNext,Nn as getBoundaryBeziersBetween,Z as getBoundaryBeziersToNext,fh as getBoundaryPieceBeziers,Kt as getBranch,tn as getBranchBeziers,bp as getBranches,K as getChildren,nh as getCloseBoundaryPointsCertified,Zp as getClosestSquareDistanceToRect,Rt as getEdgeDirection,Ut as getFirstExit,uv as getFor2ProngsOnLoop,Fv as getGraph,P as getHoleClosers,Wv as getImpliedBoundaryBezierBetween,Bn as getInitialDegAngleBetweenMatCurves,Vt as getMatCurveBetween,$t as getMatCurveToNext,Pn as getMatCurvesBetween,Qd as getOsculatingCircle,Sh as getPartialMeta,I as getPathsFromStr,Vp as getPotentialClosestPointsOnCurveCertified,T as getProngCount,L as getRealProngCount,kn as getSalience,Pp as getSatCulls,Nv as getShapeBounds,Ch as getSharpCornersOnLoop,Y as getVertexForwardChildren,q as isFullyTerminating,Zt as isOnSameCircle,Rv as isOnSameLoop,Gt as isOneProng,W as isSharp,z as isTerminating,D as isTrivial,Jt as isTwoProng,qn as isVertexSpecial,t as loopFromBeziers,Gv as reconstructFromMats,J as removeVertex,og as scaleCircle,yp as simplifyMat,Lv as sweepLine,Bp as toScaleAxis,F as traverseCp,H as traverseEdges,R as traverseVertices,Av as trimMat};
|