var t=function(){return(t=Object.assign||function(t){for(var e,i=1,o=arguments.length;i0&&n[n.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!n||r[1]>n[0]&&r[1]=360&&(s-=360);s<0&&(s+=360);if(0===(s=Math.round(s)))return{x0:Math.round(e/2)+o,y0:i+n,x1:Math.round(e/2)+o,y1:n};if(180===s)return{x0:Math.round(e/2)+o,y0:n,x1:Math.round(e/2)+o,y1:i+n};if(90===s)return{x0:o,y0:Math.round(i/2)+n,x1:e+o,y1:Math.round(i/2)+n};if(270===s)return{x0:e+o,y0:Math.round(i/2)+n,x1:o,y1:Math.round(i/2)+n};var a=Math.round(180*Math.asin(e/Math.sqrt(Math.pow(e,2)+Math.pow(i,2)))/Math.PI);if(s===a)return{x0:o,y0:i+n,x1:e+o,y1:n};if(s===180-a)return{x0:o,y0:n,x1:e+o,y1:i+n};if(s===180+a)return{x0:e+o,y0:n,x1:o,y1:i+n};if(s===360-a)return{x0:e+o,y0:i+n,x1:o,y1:n};var h=0,d=0,l=0,c=0;if(s180-a&&s<180||s>180&&s<180+a||s>360-a){var f=s*Math.PI/180,u=s360-a?i/2:-i/2,g=Math.tan(f)*u,v=s180-a&&s<180?e/2-g:-e/2-g;h=-(l=g+(p=Math.pow(Math.sin(f),2)*v)),d=-(c=u+p/Math.tan(f))}if(s>a&&s<90||s>90&&s<90+a||s>180+a&&s<270||s>270&&s<360-a){var p;f=(90-s)*Math.PI/180,g=s>a&&s<90||s>90&&s<90+a?e/2:-e/2,u=Math.tan(f)*g,v=s>a&&s<90||s>270&&s<360-a?i/2-u:-i/2-u;h=-(l=g+(p=Math.pow(Math.sin(f),2)*v)/Math.tan(f)),d=-(c=u+p)}return h=Math.round(h+e/2)+o,d=Math.round(i/2-d)+n,l=Math.round(l+e/2)+o,c=Math.round(i/2-c)+n,{x0:h,y0:d,x1:l,y1:c}}(n,t,e,i,o),a=s.x0,h=s.y0,d=s.x1,l=s.y1,c=r.createLinearGradient(a,h,d,l),f=n.match(/linear-gradient\((.+)\)/)[1],u=B(f.substring(f.indexOf(",")+1)),g=0;g=0&&l<0,U=h>=0&&f<0;return"contentSize"==i&&(this[i].left=t.left+s+v+C+(H?2*-l:0),this[i].top=t.top+h+b+I+(U?2*-f:0),this[i].width=t.width+(this[i].widthAdd?0:j),this[i].height=t.height+(this[i].heightAdd?0:E),this[i].widthAdd=j,this[i].heightAdd=E),"clientSize"==i&&(this[i].left=t.left+s+C+(H<0?-l:0),this[i].top=t.top+h+I+(U?-f:0),this[i].width=t.width+v+x,this[i].height=t.height+b+y),"borderSize"==i&&(this[i].left=t.left+s+C/2+(H<0?-l:0),this[i].top=t.top+h+I/2+(U?-f:0),this[i].width=t.width+v+x+C/2+O/2,this[i].height=t.height+b+y+k/2+I/2),"offsetSize"==i&&(this[i].left=t.left+(H<0?-l:0),this[i].top=t.top+(U?-f:0),this[i].width=t.width+v+x+C+O+s+l,this[i].height=t.height+b+y+k+I+f+h),this[i]},e.layoutBoxUpdate=function(t,e,i,o){if(void 0===i&&(i=-1),"border-box"==e.boxSizing){var n=e||{},r=n.border,s=(r=void 0===r?{}:r).borderWidth,a=void 0===s?0:s,h=n.borderTop,d=(h=void 0===h?{}:h).borderTopWidth,l=void 0===d?a:d,c=n.borderBottom,f=(c=void 0===c?{}:c).borderBottomWidth,u=void 0===f?a:f,g=n.borderRight,v=(g=void 0===g?{}:g).borderRightWidth,p=void 0===v?a:v,b=n.borderLeft,w=(b=void 0===b?{}:b).borderLeftWidth,x=void 0===w?a:w,m=n.padding,y=(m=void 0===m?{}:m).paddingTop,S=void 0===y?0:y,z=m.paddingRight,B=void 0===z?0:z,M=m.paddingBottom,P=void 0===M?0:M,I=m.paddingLeft,L=void 0===I?0:I;i||(t.width-=L+B+p+x),1!==i||o||(t.height-=S+P+l+u)}this.layoutBox&&(this.layoutBox.contentSize=this.getOffsetSize(t,e,"contentSize"),this.layoutBox.clientSize=this.getOffsetSize(t,e,"clientSize"),this.layoutBox.borderSize=this.getOffsetSize(t,e,"borderSize"),this.layoutBox.offsetSize=this.getOffsetSize(t,e,"offsetSize"),this.layoutBox=Object.assign({},this.layoutBox,this.layoutBox.borderSize))},e.getBoxPosition=function(t){var e=this.computedStyle,i=this.getChildren(),o=e.verticalAlign,n=e.left,r=void 0===n?0:n,s=e.top,a=void 0===s?0:s,h=e.textAlign,d=P({},this.contentSize,{left:r,top:a}),l=this.contentSize.top-this.offsetSize.top,c=this.contentSize.left-this.offsetSize.left,f=0;if("bottom"==o&&this.contentSize.maxLineHeight?f=this.contentSize.maxLineHeight-this.contentSize.height:"middle"==o&&this.contentSize.maxLineHeight&&(f=(this.contentSize.maxLineHeight-this.contentSize.height)/2),d.top+=f,i.length){r+=c,a+=l;for(var u=null,g=null,v=!1,p=0,b=0;b1&&(m=y/2),"right"==h&&y>1&&(m=y)}if(0==x)w.style.left+=r+m,w.style.top+=a,w.getBoxPosition(),u=w,g=w;else{var S,z,B,M;(null==(S=g)?void 0:S.offsetSize.height)<(null==(z=u)?void 0:z.offsetSize.height)&&(g=u);var I=(null==(B=u)?void 0:B.offsetSize.left)+(null==(M=u)?void 0:M.offsetSize.width)+w.offsetSize.width>d.left+d.width+c;if(this.getBoxState(u,w)||I){var L,R,k,T,W,O;if(w.style.left+=r+m,(null==(L=u)?void 0:L.offsetSize.height)>=(null==(R=g)?void 0:R.offsetSize.height))w.style.top+=(null==(k=u)?void 0:k.offsetSize.top)+(null==(T=u)?void 0:T.offsetSize.height)||0;else w.style.top+=(null==(W=g)?void 0:W.offsetSize.top)+(null==(O=g)?void 0:O.offsetSize.height)||0;w.getBoxPosition(),u=w,g=w,v=!0}else{var A,F,C;if(w.style.left+=(null==(A=u)?void 0:A.offsetSize.left)+(null==(F=u)?void 0:F.offsetSize.width)||0,v)w.style.top+=null==(C=u)?void 0:C.offsetSize.top;else w.style.top+=a;w.getBoxPosition(),u=w}}}}this.layoutBoxUpdate(d,e)}else this.layoutBoxUpdate(d,e);return this.layoutBox},e.setMaxLineHeight=function(t,e,i){for(var o=t;o>=0&&!e[o].contentSize.maxLineHeight;)e[o].contentSize.maxLineHeight=i,o--},e.setMaxLineWidth=function(t,e,i){for(var o=t;o>=0&&(null==(n=e[o])||null==(r=n.contentSize)||!r.maxLineWidth);){var n,r;e[o].contentSize.maxLineWidth=i,o--}},e.getBoxState=function(t,e){return this.isBlock(t)||this.isBlock(e)},e.isBlock=function(t){return t&&t.style.display==l},e.isInline=function(t){return!this.isBlock(t)},e.getBoxHieght=function(){var t,e=this,i=this.name,o=this.computedStyle,n=this.attributes,r=this.parent,s=this.getChildren(),d=o.top,l=o.bottom,c=o.height,f=void 0===c?0:c,u=o.fontSize,g=o.position,v=o.lineHeight,p=o.minHeight,b=o.maxHeight,w=P({},this.contentSize);if(/%$/.test(p)&&r.contentSize.height&&(p=m(p,r.contentSize.height)),/%$/.test(b)&&r.contentSize.height&&(b=m(b,r.contentSize.height)),i==h&&null==f){var x=n.width,y=n.height;n.mode,w.height=this.contrastSize(Math.round(w.width*y/x)||0,p,b),this.layoutBoxUpdate(w,o,1)}else if(f)if(s.length){w.height=this.contrastSize(w.height,p,b),this.layoutBoxUpdate(w,o);var S=null,z=0,B=0;s.forEach((function(t,i){var o=i==s.length-1;if(t.getBoxHieght(),t.isAbsolute||t.isFixed);else{var n=z+t.offsetSize.width>w.left+w.width,r=e.getBoxState(S,t);if(n||r){if(n){for(var a=i-1;a>=0&&!s[a].contentSize.maxLineHeight;)B=0&&!s[h].contentSize.maxLineHeight;)Bw.width;if(a||r){var h=0;return a||R&&e.isInline(R)?(e.setMaxLineHeight(o-1,s,L),e.setMaxLineWidth(o-1,s,k),n&&(e.setMaxLineHeight(o,s,L),e.setMaxLineWidth(o,s,i.offsetSize.width),L+=i.offsetSize.height),h=t+L,L=i.offsetSize.height,k=i.offsetSize.width,R=i,h):(k=0,L=0,t+i.offsetSize.height)}return k+=i.offsetSize.width,L=Math.max(L,i.offsetSize.height)||0,n?(e.setMaxLineHeight(o,s,L),e.setMaxLineWidth(o,s,k),t+L):(R=i,t)}),0),M&&(w.height=M),this.layoutBoxUpdate(w,o)}else M&&(w.height=M),this.layoutBoxUpdate(w,o,1)}if(o.borderRadius&&null!=(t=this.borderSize)&&t.width)for(var T in o.borderRadius)Object.hasOwnProperty.call(o.borderRadius,T)&&(o.borderRadius[T]=m(o.borderRadius[T],this.borderSize.width));return this.layoutBox},e.contrastSize=function(t,e,i){var o=t;return i&&(o=Math.min(o,i)),e&&(o=Math.max(o,e)),o},e.measureText=function(t,e){var i=this.ctx.measureText(t);return{width:i.width,fontHeight:(i.actualBoundingBoxAscent||.7*e)+1}},e.getBoxWidth=function(){var t,e=this,i=this.name,o=this.computedStyle,n=this.attributes,r=this.parent,d=void 0===r?{}:r,f=this.ctx,u=this.getChildren(),g=o.left,v=void 0===g?0:g,p=o.top,b=void 0===p?0:p,w=o.right,x=o.width,y=void 0===x?0:x,S=o.minWidth,z=o.maxWidth,B=o.height,M=void 0===B?0:B,P=o.fontSize,I=void 0===P?14:P,L=o.fontWeight,R=o.fontFamily,k=o.fontStyle,T=o.position,W=o.display,O=o.lineClamp,A=o.padding,F=void 0===A?{}:A,C=o.margin,j=void 0===C?{}:C,E=o.border,H=(E=void 0===E?{}:E).borderWidth,U=void 0===H?0:H,$=o.borderRight,_=($=void 0===$?{}:$).borderRightWidth,D=void 0===_?U:_,X=o.borderLeft,N=(X=void 0===X?{}:X).borderLeftWidth,V=void 0===N?U:N;if(/%$/.test(y)&&d.contentSize.width&&(y=m(y,d.contentSize.width)),/%$/.test(M)&&d.contentSize.height&&(M=m(M,d.contentSize.height)),/%$/.test(S)&&d.contentSize.width&&(S=m(S,d.contentSize.width)),/%$/.test(z)&&d.contentSize.width&&(z=m(z,d.contentSize.width)),o.padding&&null!=(t=d.contentSize)&&t.width)for(var Y in o.padding)Object.hasOwnProperty.call(o.padding,Y)&&(o.padding[Y]=m(o.padding[Y],d.contentSize.width));var q=F.paddingRight,G=void 0===q?0:q,Q=F.paddingLeft,J=void 0===Q?0:Q;if(o.margin&&[o.margin.marginLeft,o.margin.marginRight].includes("auto"))if(y){var Z=d.contentSize.width-y-G-J-V-D||0;o.margin.marginLeft==o.margin.marginRight?o.margin.marginLeft=o.margin.marginRight=Z/2:"auto"==o.margin.marginLeft?o.margin.marginLeft=Z:o.margin.marginRight=Z}else o.margin.marginLeft=o.margin.marginRight=0;var K=j.marginRight,tt=void 0===K?0:K,et=j.marginLeft,it={width:y,height:M,left:0,top:0},ot=J+G+V+D+(void 0===et?0:et)+tt;if(i==a&&!this.attributes.widths){var nt=n.text||"";f.save(),f.setFonts({fontFamily:R,fontSize:I,fontWeight:L,fontStyle:k});var rt=new Map;nt.split("\n").map((function(t){var i=t.split("").map((function(t){var i=rt.get(t);if(i)return i;var o=e.measureText(t,I).width;return rt.set(t,o),o}));e.attributes.fontHeight=e.measureText(t,I).fontHeight,e.attributes.widths||(e.attributes.widths=[]),e.attributes.widths.push({widths:i,total:i.reduce((function(t,e){return t+e}),0)})})),f.restore()}if(i==h&&null==y){var st=n.width,at=n.height;it.width=this.contrastSize(Math.round(st*M/at)||0,S,z),this.layoutBoxUpdate(it,o,0)}else if(y)u.length?(it.width=this.contrastSize(it.width,S,z),this.layoutBoxUpdate(it,o,0),u.forEach((function(t){t.getBoxWidth()}))):(it.width=this.contrastSize(it.width,S,z),this.layoutBoxUpdate(it,o,0));else{var ht=0;if((this.isAbsolute||this.isFixed)&&d.contentSize.width&&i!=a){var dt="absolute"==T?d.contentSize.width:this.root.width;ht=dt-(/%$/.test(v)?m(v,dt):v)-(/%$/.test(w)?m(w,dt):w)}if(i==a){var lt=this.attributes.widths,ct=Math.max.apply(Math,lt.map((function(t){return t.total})));if(d&&d.contentSize.width>0&&(ct>d.contentSize.width||W==l)&&!this.isAbsolute&&!this.isFixed)ct=d.contentSize.width-ot;it.width=ht||this.contrastSize(ct,S,z),this.layoutBoxUpdate(it,o,0)}else if(i!=s||!d||W===c||this.isAbsolute||this.isFixed)if(u.length){for(var ft=0,ut=null,gt=0;u.length>gt;){var vt=u[gt],pt=gt==u.length-1,bt=this.getBoxState(ut,vt);if(vt.isFixed||vt.isAbsolute)vt.getBoxWidth();else if(!ut||bt){var wt=vt.getBoxWidth();ft=Math.max(ft,wt.width)||0,ut=vt}else if(ut.offsetSize.left+ut.offsetSize.width+vt.offsetSize.widthit.width?(mt++,e):t+e}),0)})),mt=O&&mt>O?O:mt,this.attributes.lines=mt}return this.layoutBox},e.layout=function(){return this.getBoxWidth(),this.getBoxHieght(),this.getBoxPosition(),this.offsetSize},t}(),k=function(){var t,e,i,o,n,r,s=[0,11,15,19,23,27,31,16,18,20,22,24,26,28,20,22,24,24,26,28,28,22,24,24,26,26,28,28,24,24,26,26,26,28,28,24,26,26,26,28,28],a=[3220,1468,2713,1235,3062,1890,2119,1549,2344,2936,1117,2583,1330,2470,1667,2249,2028,3780,481,4011,142,3098,831,3445,592,2517,1776,2234,1951,2827,1070,2660,1345,3177],h=[30660,29427,32170,30877,26159,25368,27713,26998,21522,20773,24188,23371,17913,16590,20375,19104,13663,12392,16177,14854,9396,8579,11994,11245,5769,5054,7399,6608,1890,597,3340,2107],d=[1,0,19,7,1,0,16,10,1,0,13,13,1,0,9,17,1,0,34,10,1,0,28,16,1,0,22,22,1,0,16,28,1,0,55,15,1,0,44,26,2,0,17,18,2,0,13,22,1,0,80,20,2,0,32,18,2,0,24,26,4,0,9,16,1,0,108,26,2,0,43,24,2,2,15,18,2,2,11,22,2,0,68,18,4,0,27,16,4,0,19,24,4,0,15,28,2,0,78,20,4,0,31,18,2,4,14,18,4,1,13,26,2,0,97,24,2,2,38,22,4,2,18,22,4,2,14,26,2,0,116,30,3,2,36,22,4,4,16,20,4,4,12,24,2,2,68,18,4,1,43,26,6,2,19,24,6,2,15,28,4,0,81,20,1,4,50,30,4,4,22,28,3,8,12,24,2,2,92,24,6,2,36,22,4,6,20,26,7,4,14,28,4,0,107,26,8,1,37,22,8,4,20,24,12,4,11,22,3,1,115,30,4,5,40,24,11,5,16,20,11,5,12,24,5,1,87,22,5,5,41,24,5,7,24,30,11,7,12,24,5,1,98,24,7,3,45,28,15,2,19,24,3,13,15,30,1,5,107,28,10,1,46,28,1,15,22,28,2,17,14,28,5,1,120,30,9,4,43,26,17,1,22,28,2,19,14,28,3,4,113,28,3,11,44,26,17,4,21,26,9,16,13,26,3,5,107,28,3,13,41,26,15,5,24,30,15,10,15,28,4,4,116,28,17,0,42,26,17,6,22,28,19,6,16,30,2,7,111,28,17,0,46,28,7,16,24,30,34,0,13,24,4,5,121,30,4,14,47,28,11,14,24,30,16,14,15,30,6,4,117,30,6,14,45,28,11,16,24,30,30,2,16,30,8,4,106,26,8,13,47,28,7,22,24,30,22,13,15,30,10,2,114,28,19,4,46,28,28,6,22,28,33,4,16,30,8,4,122,30,22,3,45,28,8,26,23,30,12,28,15,30,3,10,117,30,3,23,45,28,4,31,24,30,11,31,15,30,7,7,116,30,21,7,45,28,1,37,23,30,19,26,15,30,5,10,115,30,19,10,47,28,15,25,24,30,23,25,15,30,13,3,115,30,2,29,46,28,42,1,24,30,23,28,15,30,17,0,115,30,10,23,46,28,10,35,24,30,19,35,15,30,17,1,115,30,14,21,46,28,29,19,24,30,11,46,15,30,13,6,115,30,14,23,46,28,44,7,24,30,59,1,16,30,12,7,121,30,12,26,47,28,39,14,24,30,22,41,15,30,6,14,121,30,6,34,47,28,46,10,24,30,2,64,15,30,17,4,122,30,29,14,46,28,49,10,24,30,24,46,15,30,4,18,122,30,13,32,46,28,48,14,24,30,42,32,15,30,20,4,117,30,40,7,47,28,43,22,24,30,10,67,15,30,19,6,118,30,18,31,47,28,34,34,24,30,20,61,15,30],l=[255,0,1,25,2,50,26,198,3,223,51,238,27,104,199,75,4,100,224,14,52,141,239,129,28,193,105,248,200,8,76,113,5,138,101,47,225,36,15,33,53,147,142,218,240,18,130,69,29,181,194,125,106,39,249,185,201,154,9,120,77,228,114,166,6,191,139,98,102,221,48,253,226,152,37,179,16,145,34,136,54,208,148,206,143,150,219,189,241,210,19,92,131,56,70,64,30,66,182,163,195,72,126,110,107,58,40,84,250,133,186,61,202,94,155,159,10,21,121,43,78,212,229,172,115,243,167,87,7,112,192,247,140,128,99,13,103,74,222,237,49,197,254,24,227,165,153,119,38,184,180,124,17,68,146,217,35,32,137,46,55,63,209,91,149,188,207,205,144,135,151,178,220,252,190,97,242,86,211,171,20,42,93,158,132,60,57,83,71,109,65,162,31,45,67,216,183,123,164,118,196,23,73,236,127,12,111,246,108,161,59,82,41,157,85,170,251,96,134,177,187,204,62,90,203,89,95,176,156,169,160,81,11,245,22,235,122,117,44,215,79,174,213,233,230,231,173,232,116,214,244,234,168,80,88,175],c=[1,2,4,8,16,32,64,128,29,58,116,232,205,135,19,38,76,152,45,90,180,117,234,201,143,3,6,12,24,48,96,192,157,39,78,156,37,74,148,53,106,212,181,119,238,193,159,35,70,140,5,10,20,40,80,160,93,186,105,210,185,111,222,161,95,190,97,194,153,47,94,188,101,202,137,15,30,60,120,240,253,231,211,187,107,214,177,127,254,225,223,163,91,182,113,226,217,175,67,134,17,34,68,136,13,26,52,104,208,189,103,206,129,31,62,124,248,237,199,147,59,118,236,197,151,51,102,204,133,23,46,92,184,109,218,169,79,158,33,66,132,21,42,84,168,77,154,41,82,164,85,170,73,146,57,114,228,213,183,115,230,209,191,99,198,145,63,126,252,229,215,179,123,246,241,255,227,219,171,75,150,49,98,196,149,55,110,220,165,87,174,65,130,25,50,100,200,141,7,14,28,56,112,224,221,167,83,166,81,162,89,178,121,242,249,239,195,155,43,86,172,69,138,9,18,36,72,144,61,122,244,245,247,243,251,235,203,139,11,22,44,88,176,125,250,233,207,131,27,54,108,216,173,71,142,0],f=[],u=[],g=[],v=[],p=[],b=2;function w(t,e){var i;t>e&&(i=t,t=e,e=i),i=e,i*=e,i+=e,i>>=1,v[i+=t]=1}function x(t,i){var o;for(g[t+e*i]=1,o=-2;o<2;o++)g[t+o+e*(i-2)]=1,g[t-2+e*(i+o+1)]=1,g[t+2+e*(i+o)]=1,g[t+o+1+e*(i+2)]=1;for(o=0;o<2;o++)w(t-1,i+o),w(t+1,i-o),w(t-o,i-1),w(t+o,i+1)}function m(t){for(;t>=255;)t=((t-=255)>>8)+(255&t);return t}var y=[];function S(t,e,i,o){var n,r,s;for(n=0;ne&&(i=t,t=e,e=i),i=e,i+=e*e,i>>=1,v[i+=t]}function B(t){var i,o,n,r;switch(t){case 0:for(o=0;o>1&1,i=0;i=5&&(i+=3+p[e]-5);for(e=3;et||3*p[e-3]>=4*p[e]||3*p[e+3]>=4*p[e])&&(i+=40);return i}function P(){var t,i,o,n,r,s=0,a=0;for(i=0;ie*e;)h-=e*e,d++;for(s+=10*d,t=0;t1)for(R=s[t],I=e-7;;){for(M=e-7;M>R-3&&(x(M,I),!(M6)for(R=a[t-7],L=17,M=0;M<6;M++)for(I=0;I<3;I++,L--)1&(L>11?t>>L-12:R>>L)?(g[5-M+e*(2-I+e-11)]=1,g[2-I+e-11+e*(5-M)]=1):(w(5-M,2-I+e-11),w(2-I+e-11,5-M));for(I=0;I=(M=n*(i+o)+o)-2&&(k=M-2,t>9&&k--),T=k,t>9){for(f[T+2]=0,f[T+3]=0;T--;)R=f[T],f[T+3]|=255&R<<4,f[T+2]=R>>4;f[2]|=255&k<<4,f[1]=k>>4,f[0]=64|k>>12}else{for(f[T+1]=0,f[T+2]=0;T--;)R=f[T],f[T+2]|=255&R<<4,f[T+1]=R>>4;f[1]|=255&k<<4,f[0]=64|k>>4}for(T=k+3-(t<10);T0;W--)y[W]=y[W]?y[W-1]^c[m(l[y[W]]+T)]:y[W-1];y[0]=c[m(l[y[0]]+T)]}for(T=0;T<=r;T++)y[T]=l[y[T]];for(L=M,I=0,T=0;T>=1)1&I&&(g[e-1-L+8*e]=1,L<6?g[8+e*L]=1:g[8+e*(L+1)]=1);for(L=0;L<7;L++,I>>=1)1&I&&(g[8+e*(e-7+L)]=1,L?g[6-L+8*e]=1:g[7+8*e]=1);return g}(p)},utf16to8:function(t){var e,i,o,n;for(e="",o=t.length,i=0;i=1&&n<=127?e+=t.charAt(i):n>2047?(e+=String.fromCharCode(224|n>>12&15),e+=String.fromCharCode(128|n>>6&63),e+=String.fromCharCode(128|n>>0&63)):(e+=String.fromCharCode(192|n>>6&31),e+=String.fromCharCode(128|n>>0&63));return e},draw:function(t,i,o,n,r){i.drawView(o,n);var s=i.ctx,a=o.contentSize,h=a.width,d=a.height,l=a.left,c=a.top;n.borderRadius,n.backgroundColor;var f=n.color,u=void 0===f?"#000000":f;n.border;var g=o.contentSize.left-o.borderSize.left,v=o.contentSize.top-o.borderSize.top;if(b=r||b,s){s.save(),i.setOpacity(n),i.setTransform(o,n),l+=g,c+=v;var p=Math.min(h,d);t=this.utf16to8(t);var w=this.getFrame(t),x=p/e;s.setFillStyle(u);for(var m=0;m=s||"cover"==o&&r=s)&&(a=e.width/i.width);var h=i.width*a,d=i.height*a,l=/^\d+px|rpx$/.test(null==n?void 0:n[0])?m(null==n?void 0:n[0],e.width):(e.width-h)*(/%$/.test(null==n?void 0:n[0])?m(null==n?void 0:n[0],1):{left:0,center:.5,right:1}[(null==n?void 0:n[0])||"center"]),c=/^\d+px|rpx$/.test(null==n?void 0:n[1])?m(null==n?void 0:n[1],e.height):(e.height-d)*(/%$/.test(null==n?void 0:n[1])?m(null==n?void 0:n[1],1):{top:0,center:.5,bottom:1}[(null==n?void 0:n[1])||"center"]),f=function(t,e){return[(t-l)/a,(e-c)/a]},u=f(0,0),g=u[0],v=u[1],p=f(e.width,e.height),b=p[0],w=p[1];return{sx:Math.max(g,0),sy:Math.max(v,0),sw:Math.min(b-g,i.width),sh:Math.min(w-v,i.height),dx:Math.max(l,0),dy:Math.max(c,0),dw:Math.min(h,e.width),dh:Math.min(d,e.height)}}({objectFit:u,objectPosition:b},o.contentSize,t),n=i.sx,s=i.sy,a=i.sh,h=i.sw,d=i.dx,l=i.dy,c=i.dh,f=i.dw;p==r.MP_BAIDU?e.drawImage(t.src,d+S,l+z,f,c,n,s,h,a):e.drawImage(t.src,n,s,h,a,d+S,l+z,f,c)}else e.drawImage(t.src,S,z,x,y)},I=function(){e.restore(),L.drawView(o,n,!1,!0,!1),h(1)},function(t){P(t),I()}(t),[2]}))}))}))];case 1:return h.sent(),[2]}}))}))},o.prototype.drawText=function(t,e,i,o){var n,r;this.drawView(e,i);var s=this.ctx,a=e.borderSize,h=e.contentSize,d=e.left,l=e.top,c=h.width,f=h.height,u=h.left-a.left,g=h.top-a.top,v=i.color,p=void 0===v?"#000000":v,b=i.lineHeight,w=void 0===b?"1.4em":b,x=i.fontSize,y=void 0===x?14:x,S=i.fontWeight,z=i.fontFamily,B=i.fontStyle,M=i.textAlign,P=void 0===M?"left":M,I=i.verticalAlign,L=void 0===I?"middle":I;i.backgroundColor;var R=i.lineClamp,k=i.textDecoration;if(w=m(w,y),t){switch(s.save(),d+=u,l+=g,s.setFonts({fontFamily:z,fontSize:y,fontWeight:S,fontStyle:B}),s.setTextBaseline("middle"),s.setTextAlign(P),s.setFillStyle(p),l+=y/2,P){case"left":break;case"center":d+=.5*c;break;case"right":d+=c}var T=o.lines*w,W=Math.ceil((f-T)/2);switch(W<0&&(W=0),L){case"top":break;case"middle":l+=W;break;case"bottom":l+=2*W}var O=(w-o.fontHeight)/2,A=function(t,e,i){var n=t;switch(P){case"left":t=t,n+=i;break;case"center":n=(t-=i/2)+i;break;case"right":n=t,t-=i}k&&(s.setLineWidth(y/13),s.beginPath(),e-=O,/\bunderline\b/.test(k)&&(s.moveTo(t,e-.5*o.fontHeight),s.lineTo(n,e-.5*o.fontHeight)),/\boverline\b/.test(k)&&(s.moveTo(t,e-1.5*o.fontHeight),s.lineTo(n,e-1.5*o.fontHeight)),/\bline-through\b/.test(k)&&(s.moveTo(t,e-o.fontHeight),s.lineTo(n,e-o.fontHeight)),s.closePath(),s.setStrokeStyle(p),s.stroke())};if(!o.widths||1==o.widths.lenght&&o.widths[0].total<=h.width)return s.fillText(t,d,l+O),A(d,l+=w,(null===(r=null===(n=null==o?void 0:o.widths)||void 0===n?void 0:n[0])||void 0===r?void 0:r.total)||o.text),s.restore(),void this.setBorder(e,i);for(var F=t.split(""),C=l,j=d,E="",H=0,U=0;U<=F.length;U++){var $=F[U]||"",_="\n"===$,D=""==$,X=E+($=_?"":$),N=s.measureText(X).width;if(H>=R)break;if(j=d,(N=N)>h.width||_||D){if(H++,E=D&&N<=h.width?X:E,H===R&&N>c){for(;s.measureText(E+"...").width>h.width&&!(E.length<=1);)E=E.substring(0,E.length-1);E+="..."}if(s.fillText(E,j,l+O),A(j,l+=w,N),E=$,l+w>C+f)break}else E=X}s.restore()}},o.prototype.source=function(t){var o;return e(this,void 0,void 0,(function(){var e,n,r,a=this;return i(this,(function(i){switch(i.label){case 0:if(e=+new Date,"{}"==JSON.stringify(t))return[2];if(!t.type)for(n in t.type=s,t.css=t.css||{},t)["views","children","type","css"].includes(n)||(t.css[n]=t[n],delete t[n]);return(null===(o=t.css)||void 0===o?void 0:o.width)||(t.css?t.css.width=this.root.width:t.css={width:this.root.width}),[4,this.create(t)];case 1:return r=i.sent(),this.size=(null==r?void 0:r.layout())||{},this.node=r,this.onEffectFinished().then((function(t){return a.lifecycle("onEffectSuccess",t)})).catch((function(t){return a.lifecycle("onEffectFail",t)})),console.log("布局用时:"+(+new Date-e)+"ms"),[2,this.root]}}))}))},o.prototype.getImageInfo=function(o){return this.imageBus[o]||(this.imageBus[o]=function(o,n){var s=this;return new Promise((function(a,h){return e(s,void 0,void 0,(function(){var e,s,d;return i(this,(function(i){switch(i.label){case 0:e=o,s=/data:image\/(\w+);base64,(.*)/.test(o),i.label=1;case 1:return i.trys.push([1,6,,7]),s||p!=r.PLUS||/^\/?(static|_doc)\//.test(e)?[3,3]:[4,y(o)];case 2:return e=i.sent(),[3,5];case 3:return p!=r.PLUS&&!/^mp/.test(p)||!s?[3,5]:[4,(l=o,new Promise((function(t,e){var i=/data:image\/(\w+);base64,(.*)/.exec(l)||[],o=i[1];if(i[2],/^mp/.test(p)){var n=b.getFileSystemManager();o||e(new Error("ERROR_BASE64SRC_PARSE"));var s=(new Date).getTime(),a=b.env.USER_DATA_PATH+"/"+s+"."+o;n.writeFile({filePath:a,data:l.replace(/^data:\S+\/\S+;base64,/,""),encoding:"base64",success:function(){t(a)},fail:function(t){e(t)}})}else if(p!=r.PLUS)e(new Error("not support"));else{var h=l.split(",")[0].match(/data\:\S+\/(\S+);/);h?h=h[1]:e(new Error("base64 error"));var d=Date.now()+"."+h,c="_doc",f="uniapp_temp",u="_doc/uniapp_temp/"+d;if(!function(t,e){for(var i=t.split("."),o=e.split("."),n=!1,r=0;r0;break}}return n}("Android"===plus.os.name?"1.9.9.80627":"1.9.9.80472",plus.runtime.innerVersion))return void plus.io.resolveLocalFileSystemURL(c,(function(i){i.getDirectory(f,{create:!0,exclusive:!1},(function(i){i.getFile(d,{create:!0,exclusive:!1},(function(i){i.createWriter((function(i){var o;i.onwrite=function(){t(u)},i.onerror=e,i.seek(0),i.writeAsBinary((o=l.split(","))[o.length-1])}),e)}),e)}),e)}),e);var g=new plus.nativeObj.Bitmap(d);g.loadBase64Data(l,(function(){g.save(u,{},(function(){g.clear(),t(u)}),(function(t){g.clear(),e(t)}))}),(function(t){g.clear(),e(t)}))}})))];case 4:e=i.sent(),i.label=5;case 5:return[3,7];case 6:return d=i.sent(),h(t(t({},d),{src:e})),[3,7];case 7:return b.getImageInfo({src:e,success:function(t){if(["right","left"].includes(t.orientation)){var i=t.width,o=t.height;t.width=o,t.height=i}if([r.MP_WEIXIN,r.MP_BAIDU,r.MP_QQ,r.MP_TOUTIAO].includes(p)&&(t.path=/^\.|^\/(?=[^\/])/.test(e)?"/"+t.path:t.path),n){var s=n.createImage?n.createImage():n;s.onload=function(){t.path=s,a(t)},s.onerror=h,s.src=t.path}else a(t)},fail:function(i){h(t(t({},i),{src:e}))}}),[2]}var l}))}))}))}(o,this.canvas.createImage&&this.canvas||p==r.WEB&&new Image)),this.imageBus[o]},o.prototype.create=function(t,o){var n,r,l,c;return e(this,void 0,void 0,(function(){var e,u,g,v,p,b,w,x,m,y,S;return i(this,(function(i){switch(i.label){case 0:if(t.type==a&&(t.text=String(t.text)),t.type==h&&!t.src&&!t.url||(t.type==d||t.type==a)&&!t.text)return[2];if((null===(n=t.css)||void 0===n?void 0:n.display)==f)return[2];if(!(t.type==h||t.type==s&&(null===(r=t.css)||void 0===r?void 0:r.backgroundImage)))return[3,4];e=t.src,u=/url\((.+)\)/,t.css.backgroundImage&&(null===(l=u.exec(t.css.backgroundImage))||void 0===l?void 0:l[1])&&(e=null===(c=u.exec(t.css.backgroundImage))||void 0===c?void 0:c[1]),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.getImageInfo(e)];case 2:return g=i.sent(),v=g.width,p=g.height,(b=g.path)||t.type!=h?(b&&(t.attributes=Object.assign(t.attributes||{},{width:v,height:p,path:b,src:b,naturalSrc:e})),[3,4]):[2];case 3:return i.sent(),[2];case 4:if(this.count+=1,w=new R(t,o,this.root,this.ctx),!(x=t.views||t.children))return[3,8];m=0,i.label=5;case 5:return m