/* esm.sh - points-on-path@0.2.1 */
import{pointsOnBezierCurves as m,simplify as d}from"../../points-on-curve@0.2.0/es2022/points-on-curve.mjs";import{parsePath as P,absolutize as b,normalize as k}from"../../path-data-parser@0.1.0/es2022/path-data-parser.mjs";function v(c,l,p){let f=P(c),g=k(b(f)),o=[],e=[],n=[0,0],s=[],i=()=>{s.length>=4&&e.push(...m(s,l)),s=[]},a=()=>{i(),e.length&&(o.push(e),e=[])};for(let{key:r,data:t}of g)switch(r){case"M":a(),n=[t[0],t[1]],e.push(n);break;case"L":i(),e.push([t[0],t[1]]);break;case"C":if(!s.length){let u=e.length?e[e.length-1]:n;s.push([u[0],u[1]])}s.push([t[0],t[1]]),s.push([t[2],t[3]]),s.push([t[4],t[5]]);break;case"Z":i(),e.push([n[0],n[1]]);break}if(a(),!p)return o;let h=[];for(let r of o){let t=d(r,p);t.length&&h.push(t)}return h}export{v as pointsOnPath};
//# sourceMappingURL=points-on-path.mjs.map