You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pingAnQiYeWeb/public/modules/canvablepath_gj2t4j.js

1 line
5.9 KiB

/**/_jsload2 && _jsload2('canvablepath', 'function hh(a){a=a.replace(/,/gm," ");a=a.replace(/([MmZzLlHhVvCcSsQqTtAa])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2");a=a.replace(/([MmZzLlHhVvCcSsQqTtAa])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2");a=a.replace(/([MmZzLlHhVvCcSsQqTtAa])([^\\s])/gm,"$1 $2");a=a.replace(/([^\\s])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2");a=a.replace(/([0-9])([+\\-])/gm,"$1 $2");a=a.replace(/(\\.[0-9]*)(\\.)/gm,"$1 $2");a=a.replace(/([Aa](\\s+[0-9]+){3})\\s+([01])\\s*([01])/gm,"$1 $3 $4 ");a=hh.wW(a);a=hh.trim(a);this.lQ=new function(a){this.tG= a.split(" ");this.reset=function(){this.oh=-1;this.hu=this.lx="";this.start=new hh.Zf(0,0);this.nx=new hh.Zf(0,0);this.jb=new hh.Zf(0,0);this.ha=[];this.Vo=[]};this.KM=function(){return this.oh>=this.tG.length-1};this.Aj=function(){return this.KM()?o:this.tG[this.oh+1].match(/^[A-Za-z]$/)!=p};this.YE=function(){switch(this.lx){case "m":case "l":case "h":case "v":case "c":case "s":case "q":case "t":case "a":case "z":return o}return q};this.pM=function(){this.oh++;return this.tG[this.oh]};this.uj=function(){return parseFloat(this.pM())}; this.IZ=function(){this.hu=this.lx;this.lx=this.pM()};this.Mm=function(){return this.uZ(new hh.Zf(this.uj(),this.uj()))};this.eE=function(){var a=this.Mm();return this.nx=a};this.Bk=function(){var a=this.Mm();return this.jb=a};this.iM=function(){return"c"!=this.hu.toLowerCase()&&"s"!=this.hu.toLowerCase()&&"q"!=this.hu.toLowerCase()&&"t"!=this.hu.toLowerCase()?this.jb:new hh.Zf(2*this.jb.x-this.nx.x,2*this.jb.y-this.nx.y)};this.uZ=function(a){this.YE()&&(a.x+=this.jb.x,a.y+=this.jb.y);return a};this.fj= function(a,b,e){e!=p&&(0<this.Vo.length&&this.Vo[this.Vo.length-1]==p)&&(this.Vo[this.Vo.length-1]=Math.atan2(e.y-this.ha[this.ha.length-1].y,e.x-this.ha[this.ha.length-1].x));this.tC(a,b==p?p:Math.atan2(a.y-b.y,a.x-b.x))};this.tC=function(a,b){this.ha.push(a);this.Vo.push(b)}}(a);this.$a=function(){return this.ni(p)};this.ni=function(a){var c=this.lQ;c.reset();var d=new hh.SP;for(a!=p&&a.beginPath();!c.KM();)switch(c.IZ(),c.lx){case "M":case "m":var e=c.Bk();c.fj(e);d.pg(e.x,e.y);a!=p&&a.moveTo(e.x, e.y);for(c.start=c.jb;!c.Aj();)e=c.Bk(),c.fj(e,c.start),d.pg(e.x,e.y),a!=p&&a.lineTo(e.x,e.y);break;case "L":case "l":for(;!c.Aj();){var f=c.jb,e=c.Bk();c.fj(e,f);d.pg(e.x,e.y);a!=p&&a.lineTo(e.x,e.y)}break;case "H":case "h":for(;!c.Aj();)e=new hh.Zf((c.YE()?c.jb.x:0)+c.uj(),c.jb.y),c.fj(e,c.jb),c.jb=e,d.pg(c.jb.x,c.jb.y),a!=p&&a.lineTo(c.jb.x,c.jb.y);break;case "V":case "v":for(;!c.Aj();)e=new hh.Zf(c.jb.x,(c.YE()?c.jb.y:0)+c.uj()),c.fj(e,c.jb),c.jb=e,d.pg(c.jb.x,c.jb.y),a!=p&&a.lineTo(c.jb.x,c.jb.y); break;case "C":case "c":for(;!c.Aj();){var g=c.jb,f=c.Mm(),i=c.eE(),e=c.Bk();c.fj(e,i,f);d.sC(g.x,g.y,f.x,f.y,i.x,i.y,e.x,e.y);a!=p&&a.bezierCurveTo(f.x,f.y,i.x,i.y,e.x,e.y)}break;case "S":case "s":for(;!c.Aj();)g=c.jb,f=c.iM(),i=c.eE(),e=c.Bk(),c.fj(e,i,f),d.sC(g.x,g.y,f.x,f.y,i.x,i.y,e.x,e.y),a!=p&&a.bezierCurveTo(f.x,f.y,i.x,i.y,e.x,e.y);break;case "Q":case "q":for(;!c.Aj();)g=c.jb,i=c.eE(),e=c.Bk(),c.fj(e,i,i),d.pK(g.x,g.y,i.x,i.y,e.x,e.y),a!=p&&a.quadraticCurveTo(i.x,i.y,e.x,e.y);break;case "T":case "t":for(;!c.Aj();)g= c.jb,i=c.iM(),c.nx=i,e=c.Bk(),c.fj(e,i,i),d.pK(g.x,g.y,i.x,i.y,e.x,e.y),a!=p&&a.quadraticCurveTo(i.x,i.y,e.x,e.y);break;case "A":case "a":for(;!c.Aj();){var g=c.jb,j=c.uj(),l=c.uj(),f=c.uj()*(Math.PI/180),m=c.uj(),i=c.uj(),e=c.Bk(),n=new hh.Zf(Math.cos(f)*(g.x-e.x)/2+Math.sin(f)*(g.y-e.y)/2,-Math.sin(f)*(g.x-e.x)/2+Math.cos(f)*(g.y-e.y)/2),s=Math.pow(n.x,2)/Math.pow(j,2)+Math.pow(n.y,2)/Math.pow(l,2);1<s&&(j*=Math.sqrt(s),l*=Math.sqrt(s));m=(m==i?-1:1)*Math.sqrt((Math.pow(j,2)*Math.pow(l,2)-Math.pow(j, 2)*Math.pow(n.y,2)-Math.pow(l,2)*Math.pow(n.x,2))/(Math.pow(j,2)*Math.pow(n.y,2)+Math.pow(l,2)*Math.pow(n.x,2)));isNaN(m)&&(m=0);var u=new hh.Zf(m*j*n.y/l,m*-l*n.x/j),g=new hh.Zf((g.x+e.x)/2+Math.cos(f)*u.x-Math.sin(f)*u.y,(g.y+e.y)/2+Math.sin(f)*u.x+Math.cos(f)*u.y),w=function(a,b){return(a[0]*b[0]+a[1]*b[1])/(Math.sqrt(Math.pow(a[0],2)+Math.pow(a[1],2))*Math.sqrt(Math.pow(b[0],2)+Math.pow(b[1],2)))},y=function(a,b){return(a[0]*b[1]<a[1]*b[0]?-1:1)*Math.acos(w(a,b))},m=y([1,0],[(n.x-u.x)/j,(n.y- u.y)/l]),s=[(n.x-u.x)/j,(n.y-u.y)/l],u=[(-n.x-u.x)/j,(-n.y-u.y)/l],n=y(s,u);-1>=w(s,u)&&(n=Math.PI);1<=w(s,u)&&(n=0);s=1-i?1:-1;u=m+s*(n/2);c.tC(new hh.Zf(g.x+j*Math.cos(u),g.y+l*Math.sin(u)),u-s*Math.PI/2);c.tC(e,u-s*Math.PI);d.pg(e.x,e.y);a!=p&&(w=j>l?j:l,e=j>l?1:j/l,j=j>l?l/j:1,a.translate(g.x,g.y),a.rotate(f),a.scale(e,j),a.arc(0,0,w,m,m+n,1-i),a.scale(1/e,1/j),a.rotate(-f),a.translate(-g.x,-g.y))}break;case "Z":case "z":a!=p&&a.closePath(),c.jb=c.start}return d}} hh.trim=function(a){return a.replace(/^\\s+|\\s+$/g,"")};hh.wW=function(a){return a.replace(/[\\s\\r\\t\\n]+/gm," ")};hh.Zf=function(a,b){this.x=a;this.y=b}; hh.SP=function(){this.Sn=this.Rn=this.Jj=this.Ij=Number.NaN;this.x=v("Ij");this.y=v("Jj");this.width=function(){return this.Rn-this.Ij};this.height=function(){return this.Sn-this.Jj};this.pg=function(a,b){if(a!=p){if(isNaN(this.Ij)||isNaN(this.Rn))this.Rn=this.Ij=a;a<this.Ij&&(this.Ij=a);a>this.Rn&&(this.Rn=a)}if(b!=p){if(isNaN(this.Jj)||isNaN(this.Sn))this.Sn=this.Jj=b;b<this.Jj&&(this.Jj=b);b>this.Sn&&(this.Sn=b)}};this.xC=function(a){this.pg(a,p)};this.yC=function(a){this.pg(p,a)};this.pK=function(a, b,c,d,e,f){c=a+2/3*(c-a);d=b+2/3*(d-b);this.sC(a,b,c,c+1/3*(e-a),d,d+1/3*(f-b),e,f)};this.sC=function(a,b,c,d,e,f,g,i){var j=[a,b],l=[c,d],m=[e,f],n=[g,i];this.pg(j[0],j[1]);this.pg(n[0],n[1]);for(ih=0;1>=ih;ih++)if(a=function(a){return Math.pow(1-a,3)*j[ih]+3*Math.pow(1-a,2)*a*l[ih]+3*(1-a)*Math.pow(a,2)*m[ih]+Math.pow(a,3)*n[ih]},b=6*j[ih]-12*l[ih]+6*m[ih],c=-3*j[ih]+9*l[ih]-9*m[ih]+3*n[ih],d=3*l[ih]-3*j[ih],0==c)0!=b&&(b=-d/b,0<b&&1>b&&(0==ih&&this.xC(a(b)),1==ih&&this.yC(a(b))));else if(d=Math.pow(b, 2)-4*d*c,!(0>d)&&(e=(-b+Math.sqrt(d))/(2*c),0<e&&1>e&&(0==ih&&this.xC(a(e)),1==ih&&this.yC(a(e))),b=(-b-Math.sqrt(d))/(2*c),0<b&&1>b))0==ih&&this.xC(a(b)),1==ih&&this.yC(a(b))};this.pg(k,k);this.pg(k,k)};B.TP=hh; ');