p&&q--}else{r=(a+c)/2;u=(b+d)/2;var y=(c+e)/2,w=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(r+y)/2;c=(u+w)/2;y=(y+e)/2;w=(w+f)/2;var z=(d+y)/2,A=(c+w)/2;q+=L.Ro(a,b,r,u,d,c,z,A,k,l,m,n,p);q+=L.Ro(z,A,y,w,e,f,g,h,k,l,m,n,p)}return q},Bh:function(a,b,c,d,e,f,g){if(L.ca(a,c)){b g&&(f=-f),f=(0>c?-1:1)*f+a,h=p*(f-a)+b),this.ve(d),this.Kf(f,h),this.ve(e);else{this.ve(d);this.ve(e);h=M.alloc();b.zi(h);k=h.ha(e);p.zi(h);l=h.ha(d);if(k||l)g=b.la(gq(g),new K),this.kd(0,this.getLinkPointFromPoint(a,b,g,e,!0,g)),c=p.la(gq(c),new K),this.kd(1,this.getLinkPointFromPoint(f,p,c,d,!1,c));M.free(h)}}else{n=this.isAvoiding;p&&(m&&n||l)&&this.Rj();var A=l?this.computeCurviness():0;n=this.getLinkPoint(a,b,g,!0,m,d,e);q=u=r=0;if(m||!h||l)y=this.computeEndSegmentLength(a,b,g,!0),q=
this.getLinkDirection(a,b,n,g,!0,m,d,e),l&&(h||g.D(c)||!m&&1===g.x+c.x&&1===g.y+c.y)&&(q-=m?90:30,0>A&&(q-=180)),0>q?q+=360:360<=q&&(q-=360),l&&(y+=Math.abs(A)*(m?1:2)),0===q?r=y:90===q?u=y:180===q?r=-y:270===q?u=-y:(r=y*Math.cos(q*Math.PI/180),u=y*Math.sin(q*Math.PI/180)),g.pc()&&l&&(y=b.la(Ic,K.alloc()),w=K.allocAt(y.x+1E3*r,y.y+1E3*u),this.getLinkPointFromPoint(a,b,y,w,!0,n),K.free(y),K.free(w));y=this.getLinkPoint(d,e,c,!1,m,a,b);var C=z=w=0;if(m||!k||l){var E=this.computeEndSegmentLength(d,e,
c,!1);C=this.getLinkDirection(d,e,y,c,!1,m,a,b);l&&(k||g.D(c)||!m&&1===g.x+c.x&&1===g.y+c.y)&&(C+=m?0:30,0>A&&(C+=180));0>C?C+=360:360<=C&&(C-=360);l&&(E+=Math.abs(A)*(m?1:2));0===C?w=E:90===C?z=E:180===C?w=-E:270===C?z=-E:(w=E*Math.cos(C*Math.PI/180),z=E*Math.sin(C*Math.PI/180));c.pc()&&l&&(c=e.la(Ic,K.alloc()),g=K.allocAt(c.x+1E3*w,c.y+1E3*z),this.getLinkPointFromPoint(d,e,c,g,!1,y),K.free(c),K.free(g))}c=n;if(m||!h||l)c=new K(n.x+r,n.y+u);g=y;if(m||!k||l)g=new K(y.x+w,y.y+z);!p&&!m&&h&&3=a)return 0;if((e>g?e-g:g-e)<(f>h?f-h:h-f))if(f
b+1E-5||d.bounds.height>c+1E-5)&&v('Geometry made with figure "'+a.figure+'" has bounds '+d.bounds.toString()+" that are too large for the given size ("+b+","+c+"). See documentation for Shape.defineFigureGenerator.");
return d};function to(a){var b=so[a];if(void 0===b){var c=a.toLowerCase();if("none"===c)return"None";b=so[c];if(void 0===b){var d=null,e;for(e in L.Hm)if(e.toLowerCase()===c){d=e;break}if(null!==d)return a=N.parse(L.Hm[d],!1),so[d]=a,c!==d&&(so[c]=d),d}}return"string"===typeof b?b:b instanceof N?a:null}
oa.Object.defineProperties(Pf.prototype,{geometry:{configurable:!0,get:function(){return null!==this.Ba?this.Ba:this.Xd},set:function(a){var b=this.Ba,c=this.Xd;if(b!==a){null!==a?(G&&x(a,N,Pf,"geometry"),this.Xd=this.Ba=a.freeze()):this.Xd=this.Ba=null;var d=this.part;null!==d&&(d.mg=NaN);this.w();this.g("geometry",b||c,a);ul(this)&&(a=this.part,null!==a&&vl(this,a,"geometryString"))}}},geometryString:{configurable:!0,get:function(){return null===this.geometry?"":this.geometry.toString()},
set:function(a){a=N.parse(a);var b=a.normalize();this.geometry=a;this.position=a=K.allocAt(-b.x,-b.y);K.free(a)}},isGeometryPositioned:{configurable:!0,get:function(){return 0!==(this.l&1048576)},set:function(a){G&&B(a,"boolean",Pf,"isGeometryPositioned");var b=0!==(this.l&1048576);b!==a&&(G&&B(a,"boolean",Pf,"isGeometryPositioned"),this.l^=1048576,this.w(),this.g("isGeometryPositioned",b,a))}},fill:{configurable:!0,get:function(){return this.gj},set:function(a){var b=
this.gj;b!==a&&(null!==a&&rm(a,"Shape.fill"),a instanceof Fl&&a.freeze(),this.gj=a,this.R(),this.g("fill",b,a))}},stroke:{configurable:!0,get:function(){return this.Dc},set:function(a){var b=this.Dc;b!==a&&(null!==a&&rm(a,"Shape.stroke"),a instanceof Fl&&a.freeze(),this.Dc=a,this.R(),this.g("stroke",b,a))}},strokeWidth:{configurable:!0,get:function(){return this.ug},set:function(a){var b=this.ug;if(b!==a)if(G&&D(a,Pf,"strokeWidth"),0<=a){this.ug=a;this.w();var c=this.part;
null!==c&&(c.mg=NaN);this.g("strokeWidth",b,a)}else Ba(a,"value >= 0",Pf,"strokeWidth:value")}},strokeCap:{configurable:!0,get:function(){return null!==this.Sa?this.Sa.Ur:"butt"},set:function(a){var b=this.strokeCap;b!==a&&("string"!==typeof a||"butt"!==a&&"round"!==a&&"square"!==a?Ba(a,'"butt", "round", or "square"',Pf,"strokeCap"):(eo(this),this.Sa.Ur=a,this.R(),this.g("strokeCap",b,a)))}},strokeJoin:{configurable:!0,get:function(){return null!==this.Sa?this.Sa.Vr:"miter"},
set:function(a){var b=this.strokeJoin;b!==a&&("string"!==typeof a||"miter"!==a&&"bevel"!==a&&"round"!==a?Ba(a,'"miter", "bevel", or "round"',Pf,"strokeJoin"):(eo(this),this.Sa.Vr=a,this.R(),this.g("strokeJoin",b,a)))}},strokeMiterLimit:{configurable:!0,get:function(){return null!==this.Sa?this.Sa.Wr:10},set:function(a){var b=this.strokeMiterLimit;if(b!==a)if(G&&D(a,Pf,"strokeMiterLimit"),1<=a){eo(this);this.Sa.Wr=a;this.R();var c=this.part;null!==c&&(c.mg=NaN);this.g("strokeMiterLimit",
b,a)}else G&&Ba(a,"value >= 1",Pf,"strokeWidth:value")}},strokeDashArray:{configurable:!0,get:function(){return this.jh},set:function(a){var b=this.jh;if(b!==a){null===a||Array.isArray(a)||Aa(a,"Array",Pf,"strokeDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;e