(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["user-pages-channel-poster~user-pages-distribution-bind-technician~user-pages-distribution-poster"],{"015a":function(t,e,i){var n=i("4b5a");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var r=i("967d").default;r("72cf53b6",n,!0,{sourceMap:!1,shadowMode:!1})},1851:function(t,e,i){"use strict";var n=i("8bdb"),r=i("84d6"),o=i("1cb5");n({target:"Array",proto:!0},{fill:r}),o("fill")},"1ad6":function(t,e,i){"use strict";var n=i("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.Painter=void 0;var r=n(i("fcf3"));i("bf0f"),i("01a2"),i("e39c"),i("844d"),i("18f7"),i("de6c"),i("7a76"),i("c9b5"),i("aa9c"),i("5c47"),i("0506"),i("e838"),i("9db6"),i("2c10"),i("5ef2"),i("0c26"),i("20f3"),i("6a54"),i("8a8d"),i("f7a5"),i("08eb"),i("4100"),i("2797"),i("473f"),i("dc8a"),i("fd3c"),i("aa77"),i("4626"),i("5ac7"),i("a1c1"),i("c223"),i("c1a3"),i("1851"),i("8f71"),i("d4b5"),i("22b6");var o=function(){return o=Object.assign||function(t){for(var e,i=1,n=arguments.length;i0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]t.length)&&(e=t.length);for(var i=0,n=new Array(e);i=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function R(t){return"number"==typeof t}function T(t){return"auto"===t||null===t}function j(t){return/%$/.test(t)}var C,F=0,L=function(){function t(){I(this,"elements",[]),I(this,"afterElements",[]),I(this,"beforeElements",[]),I(this,"ids",[]),I(this,"width",0),I(this,"height",0),I(this,"top",0),I(this,"left",0),I(this,"pre",null),I(this,"offsetX",0),I(this,"offsetY",0),F++,this.id=F}var e=t.prototype;return e.fixedBind=function(t,e){void 0===e&&(e=0),this.container=e?t.parent:t.root,this.container.fixedLine=this,this.fixedAdd(t)},e.fixedAdd=function(t){this.elements.push(t);var e=t.computedStyle.zIndex;(void 0===e?0:e)>=0?this.afterElements.push(t):this.beforeElements.push(t),this.refreshLayout()},e.bind=function(t){this.container=t.parent,this.container.line=null,this.container.lines?(this.container.lines.push(this),this.pre=this.getPreLine(),this.top=this.pre.top+this.pre.height,this.left=this.container.contentSize.left):(this.top=this.container.contentSize.top,this.left=this.container.contentSize.left,this.container.lines=[this]),this.isInline=t.isInline(),this.container.line=this,this.outerWidth=t.parent&&t.parent.contentSize.width?t.parent.contentSize.width:1/0,this.add(t)},e.getPreLine=function(){return this.container.lines[this.container.lines.length-2]},e.canIEnter=function(t){return!((100*t.offsetSize.width+100*this.width)/100>this.outerWidth)||(this.closeLine(),!1)},e.closeLine=function(){delete this.container.line},e.add=function(t){this.ids.push(t.id),this.elements.push(t),this.refreshWidthHeight(t)},e.refreshWidthHeight=function(t){t.offsetSize.height>this.height&&(this.height=t.offsetSize.height),this.width+=t.offsetSize.width||0,(this.container.lineMaxWidth||0)this[this.key.height]&&(this[this.key.height]=t.offsetSize[this.key.height]),this[this.key.width]+=t.offsetSize[this.key.width],(this.container.lineMaxWidth||0)1?0:"flex-end"===t.style.alignSelf?this.container.contentSize[this.key.contentHeight]-t.contentSize[this.key.height]:"center"===t.style.alignSelf?(this.container.contentSize[this.key.contentHeight]-t.contentSize[this.key.height])/2:0},n}(L),E=p,H=f,$=l,D=v,N="inline-block",U="absolute",Y="fixed",X=0,J={left:null,top:null,width:null,height:null},V=function(){function t(t,e,i,n){var r=this;I(this,"id",X++),I(this,"style",{left:null,top:null,width:null,height:null}),I(this,"computedStyle",{}),I(this,"originStyle",{}),I(this,"children",{}),I(this,"layoutBox",M({},J)),I(this,"contentSize",M({},J)),I(this,"clientSize",M({},J)),I(this,"borderSize",M({},J)),I(this,"offsetSize",M({},J)),this.ctx=n,this.root=i,e&&(this.parent=e),this.name=t.name||t.type,this.attributes=this.getAttributes(t);var o=this.getComputedStyle(t,null==e?void 0:e.computedStyle);this.isAbsolute=o.position==U,this.isFixed=o.position==Y,this.originStyle=o,Object.keys(o).forEach((function(t){Object.defineProperty(r.style,t,{configurable:!0,enumerable:!0,get:function(){return o[t]},set:function(e){o[t]=e}})}));var a={contentSize:M({},this.contentSize),clientSize:M({},this.clientSize),borderSize:M({},this.borderSize),offsetSize:M({},this.offsetSize)};Object.keys(a).forEach((function(t){Object.keys(r[t]).forEach((function(e){Object.defineProperty(r[t],e,{configurable:!0,enumerable:!0,get:function(){return a[t][e]},set:function(i){a[t][e]=i}})}))})),this.computedStyle=this.style}var e=t.prototype;return e.add=function(t){t.parent=this,this.children[t.id]=t},e.getChildren=function(){var t=this;return Object.keys(this.children).map((function(e){return t.children[e]}))},e.getLineRect=function(t,e){var i=e?e.lines:this.parent&&this.parent.lines;return i&&i.find((function(e){return e.ids.includes(t)}))||{width:0,height:0}},e.getComputedStyle=function(t,e){var i=["color","fontSize","lineHeight","verticalAlign","fontWeight","textAlign"],n=t.css,o=void 0===n?{}:n,a=t.type,s=void 0===a?$:a,h=M({},b);if([H,E,D].includes(s)&&!o.display&&(h.display=N),e)for(var c=0;c=0&&d<0,$=h>=0&&f<0;return i==u[0]&&(this[i].left=t.left+a+g+A+(H?2*-d:0),this[i].top=t.top+h+m+O+($?2*-f:0),this[i].width=t.width+(this[i].widthAdd?0:_),this[i].height=t.height+(this[i].heightAdd?0:E),this[i].widthAdd=_,this[i].heightAdd=E),i==u[1]&&(this[i].left=t.left+a+A+(H<0?-d:0),this[i].top=t.top+h+O+($?-f:0),this[i].width=t.width+g+x,this[i].height=t.height+m+S),i==u[2]&&(this[i].left=t.left+a+A/2+(H<0?-d:0),this[i].top=t.top+h+O/2+($?-f:0),this[i].width=t.width+g+x+A/2+C/2,this[i].height=t.height+m+S+R/2+O/2),i==u[3]&&(this[i].left=t.left+(H<0?-d:0),this[i].top=t.top+($?-f:0),this[i].width=t.width+g+x+A+C+a+d,this[i].height=t.height+m+S+R+O+f+h),this[i]},e.layoutBoxUpdate=function(t,e,i,n){var r=this;if(void 0===i&&(i=-1),"border-box"==e.boxSizing){var o=e||{},a=o.border,s=(a=void 0===a?{}:a).borderWidth,h=void 0===s?0:s,c=o.borderTop,d=(c=void 0===c?{}:c).borderTopWidth,l=void 0===d?h:d,f=o.borderBottom,p=(f=void 0===f?{}:f).borderBottomWidth,v=void 0===p?h:p,g=o.borderRight,b=(g=void 0===g?{}:g).borderRightWidth,m=void 0===b?h:b,y=o.borderLeft,x=(y=void 0===y?{}:y).borderLeftWidth,w=void 0===x?h:x,S=o.padding,P=(S=void 0===S?{}:S).paddingTop,z=void 0===P?0:P,k=S.paddingRight,I=void 0===k?0:k,M=S.paddingBottom,O=void 0===M?0:M,B=S.paddingLeft,W=void 0===B?0:B;i||(t.width-=W+I+m+w),1!==i||n||(t.height-=z+O+l+v)}this.layoutBox&&(u.forEach((function(i){return r.layoutBox[i]=r.getOffsetSize(t,e,i)})),this.layoutBox=Object.assign({},this.layoutBox,this.layoutBox.borderSize))},e.getBoxPosition2=function(){var t=this.computedStyle,e=this.fixedLine,i=this.lines,n=t.left,r=void 0===n?0:n,o=t.top,a=void 0===o?0:o,s=t.padding||{},h=s.paddingBottom,c=void 0===h?0:h,d=s.paddingRight,u=void 0===d?0:d,l=M({},this.contentSize,{left:r,top:a}),f=this.contentSize.top-this.offsetSize.top,p=this.contentSize.left-this.offsetSize.left;if(this.root.fixedLine&&!this.root.isDone){this.root.isDone=!0;for(var v,g=W(this.root.fixedLine.elements);!(v=g()).done;){var b=v.value;b.setPosition(b,this.root.offsetSize),b.getBoxPosition2()}}if(e)for(var m,y=W(e.elements);!(m=y()).done;){var x=m.value;x.setPosition(x,l),x.style.left+=r+p+u,x.style.top+=a+f+c,x.getBoxPosition2()}if(i)for(var w,S=W(i);!(w=S()).done;)w.value.layout(l.top+f,l.left+p);return this.layoutBoxUpdate(l,t),this.layoutBox},e.getBoxState=function(t,e){return this.isBlock(t)||this.isBlock(e)},e.isBlock=function(t){return void 0===t&&(t=this),t&&"block"==t.style.display},e.isFlex=function(t){return void 0===t&&(t=this),t&&"flex"==t.style.display},e.isInFlow=function(){return!(this.isAbsolute||this.isFixed)},e.inFlexBox=function(t){return void 0===t&&(t=this),!!t.isInFlow()&&!!t.parent&&(!(!t.parent||"flex"!==t.parent.style.display)||void 0)},e.isInline=function(t){return void 0===t&&(t=this),t&&t.style.display==N},e.contrastSize=function(t,e,i){var n=t;return i&&(n=Math.min(n,i)),e&&(n=Math.max(n,e)),n},e.measureText=function(t,e){var i=this.ctx.measureText(t),n=i.width,r=i.actualBoundingBoxAscent,o=i.actualBoundingBoxDescent;return{ascent:r,descent:o,width:n,fontHeight:r+o||.7*e+1}},e.getBoxWidthHeight=function(){var t,e=this,i=this.name,n=this.computedStyle,r=this.attributes,o=this.parent,a=void 0===o?{}:o,s=this.ctx,h=this.getChildren(),c=n.left,d=void 0===c?0:c,u=n.top,l=void 0===u?0:u,f=n.bottom,p=n.right,v=n.width,g=void 0===v?0:v,b=n.minWidth,m=n.maxWidth,y=n.minHeight,x=n.maxHeight,w=n.height,S=void 0===w?0:w,z=n.fontSize,k=void 0===z?14:z,I=n.fontWeight,M=n.fontFamily,O=n.fontStyle,B=n.position,W=n.lineClamp,R=n.lineHeight,T=n.padding,C=void 0===T?{}:T,F=n.margin,A=void 0===F?{}:F,D=n.border,N=(D=void 0===D?{}:D).borderWidth,Y=void 0===N?0:N,X=n.borderRight,J=(X=void 0===X?{}:X).borderRightWidth,V=void 0===J?Y:J,q=n.borderLeft,G=(q=void 0===q?{}:q).borderLeftWidth,Q=void 0===G?Y:G,K=a.contentSize&&a.contentSize.width,Z=a.contentSize&&a.contentSize.height;if(j(g)&&K&&(g=P(g,K)),j(g)&&!K&&(g=null),j(S)&&Z&&(S=P(S,Z)),j(S)&&!Z&&(S=null),j(b)&&K&&(b=P(b,K)),j(m)&&K&&(m=P(m,K)),j(y)&&Z&&(y=P(y,Z)),j(x)&&Z&&(x=P(x,Z)),n.padding&&null!=(t=a.contentSize)&&t.width)for(var tt in n.padding)Object.hasOwnProperty.call(n.padding,tt)&&(n.padding[tt]=P(n.padding[tt],K));var et=C.paddingRight,it=void 0===et?0:et,nt=C.paddingLeft,rt=void 0===nt?0:nt;if(n.margin&&[n.margin.marginLeft,n.margin.marginRight].includes("auto"))if(g){var ot=K&&K-g-it-rt-Q-V||0;n.margin.marginLeft==n.margin.marginRight?n.margin.marginLeft=n.margin.marginRight=ot/2:"auto"==n.margin.marginLeft?n.margin.marginLeft=ot:n.margin.marginRight=ot}else n.margin.marginLeft=n.margin.marginRight=0;var at=A.marginRight,st=void 0===at?0:at,ht=A.marginLeft,ct={width:g,height:S,left:0,top:0},dt=rt+it+Q+V+(void 0===ht?0:ht)+st;if(i==H&&!this.attributes.widths){var ut=r.text||"";s.save(),s.setFonts({fontFamily:M,fontSize:k,fontWeight:I,fontStyle:O});var lt=new Map;ut.split("\n").map((function(t){var i=t.split("").map((function(t){var i=lt.get(t);if(i)return i;var n=e.measureText(t,k).width;return lt.set(t,n),n})),n=e.measureText(t,k),r=n.fontHeight,o=n.ascent,a=n.descent;e.attributes.fontHeight=r,e.attributes.ascent=o,e.attributes.descent=a,e.attributes.widths||(e.attributes.widths=[]),e.attributes.widths.push({widths:i,total:i.reduce((function(t,e){return t+e}),0)})})),s.restore()}if(i==E&&null==g){var ft=r.width,pt=r.height;ct.width=this.contrastSize(Math.round(ft*S/pt)||0,b,m),this.layoutBoxUpdate(ct,n,0)}if(i==H&&null==g){var vt=this.attributes.widths,gt=Math.max.apply(Math,vt.map((function(t){return t.total})));a&&K>0&&(gt>K||this.isBlock(this))&&!this.isAbsolute&&!this.isFixed&&(gt=K-dt),ct.width=this.contrastSize(gt,b,m),this.layoutBoxUpdate(ct,n,0)}if(i==H&&!this.attributes.lines){var bt=this.attributes.widths.length;this.attributes.widths.forEach((function(t){return t.widths.reduce((function(t,e,i){return t+e>ct.width?(bt++,e):t+e}),0)})),bt=W&&bt>W?W:bt,this.attributes.lines=bt}if(i==E&&null==S){var mt=r.width,yt=r.height;ct.height=this.contrastSize(P(ct.width*yt/mt)||0,y,x),this.layoutBoxUpdate(ct,n,1)}i==H&&null==S&&(R=P(R,k),ct.height=this.contrastSize(P(this.attributes.lines*R),y,x),this.layoutBoxUpdate(ct,n,1,!0)),a&&a.children&&K&&([$,H].includes(i)&&this.isFlex()||i==$&&this.isBlock(this)&&!this.isInFlow())&&(ct.width=this.contrastSize(K-dt,b,m),this.layoutBoxUpdate(ct,n)),g&&!j(g)&&(ct.width=this.contrastSize(g,b,m),this.layoutBoxUpdate(ct,n,0)),S&&!j(S)&&(ct.height=this.contrastSize(ct.height,y,x),this.layoutBoxUpdate(ct,n,1));var xt=0;if(h.length){var wt=null;h.forEach((function(t,i){t.getBoxWidthHeight();var r=h[i+1];if(r&&r.isInFlow()&&(t.next=r),t.isInFlow()&&!t.inFlexBox()){var o=e.getBoxState(wt,t);e.line&&e.line.canIEnter(t)&&!o?e.line.add(t):(new L).bind(t),wt=t}else t.inFlexBox()?e.line&&(e.line.canIEnter(t)||"nowrap"==n.flexWrap)?e.line.add(t):(new _).bind(t):t.isFixed?e.root.fixedLine?e.root.fixedLine.fixedAdd(t):(new L).fixedBind(t):e.fixedLine?e.fixedLine.fixedAdd(t):(new L).fixedBind(t,1)})),this.lines&&(xt=this.lines.reduce((function(t,e){return t+e.height}),0))}var St=0,Pt=0;if(!g&&(this.isAbsolute||this.isFixed)&&K){var zt=B==U?K:this.root.width,kt=zt-(j(d)?P(d,zt):d)-(j(p)?P(p,zt):p);St=n.left?kt:this.lineMaxWidth}if(!S&&(null!=l?l:this.isAbsolute||this.isFixed&&Z)){var It=B==U?Z:this.root.height,Mt=It-(j(l)?P(l,It):l)-(j(f)?P(f,It):f);Pt=n.top?Mt:0}if(g&&!j(g)||ct.width||(ct.width=St||this.contrastSize((this.isBlock(this)&&!this.isInFlow()?K||a.lineMaxWidth:this.lineMaxWidth)||this.lineMaxWidth,b,m),this.layoutBoxUpdate(ct,n,0)),S||!xt&&!Pt||(ct.height=Pt||this.contrastSize(xt,y,x),this.layoutBoxUpdate(ct,n)),n.borderRadius&&this.borderSize&&this.borderSize.width)for(var tt in n.borderRadius)Object.hasOwnProperty.call(n.borderRadius,tt)&&(n.borderRadius[tt]=P(n.borderRadius[tt],this.borderSize.width));return this.layoutBox},e.layout=function(){return this.getBoxWidthHeight(),this.root.offsetSize=this.offsetSize,this.getBoxPosition2(),this.offsetSize},t}(),q=function(){var t,e,i,n,r,o,a=[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],s=[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],c=[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],d=[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],u=[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],l=[],f=[],p=[],v=[],g=[],b=2;function m(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 y(t,i){var n;for(p[t+e*i]=1,n=-2;n<2;n++)p[t+n+e*(i-2)]=1,p[t-2+e*(i+n+1)]=1,p[t+2+e*(i+n)]=1,p[t+n+1+e*(i+2)]=1;for(n=0;n<2;n++)m(t-1,i+n),m(t+1,i-n),m(t-n,i-1),m(t+n,i+1)}function x(t){for(;t>=255;)t=((t-=255)>>8)+(255&t);return t}var w=[];function S(t,e,i,n){var r,o,a;for(r=0;re&&(i=t,t=e,e=i),i=e,i+=e*e,i>>=1,v[i+=t]}function z(t){var i,n,r,o;switch(t){case 0:for(n=0;n>1&1,i=0;i=5&&(i+=3+g[e]-5);for(e=3;et||3*g[e-3]>=4*g[e]||3*g[e+3]>=4*g[e])&&(i+=40);return i}function I(){var t,i,n,r,o,a=0,s=0;for(i=0;ie*e;)h-=e*e,c++;for(a+=10*c,t=0;t1)for(B=a[t],M=e-7;;){for(k=e-7;k>B-3&&(y(k,M),!(k6)for(B=s[t-7],O=17,k=0;k<6;k++)for(M=0;M<3;M++,O--)1&(O>11?t>>O-12:B>>O)?(p[5-k+e*(2-M+e-11)]=1,p[2-M+e-11+e*(5-k)]=1):(m(5-k,2-M+e-11),m(2-M+e-11,5-k));for(M=0;M=(k=r*(i+n)+n)-2&&(W=k-2,t>9&&W--),R=W,t>9){for(l[R+2]=0,l[R+3]=0;R--;)B=l[R],l[R+3]|=255&B<<4,l[R+2]=B>>4;l[2]|=255&W<<4,l[1]=W>>4,l[0]=64|W>>12}else{for(l[R+1]=0,l[R+2]=0;R--;)B=l[R],l[R+2]|=255&B<<4,l[R+1]=B>>4;l[1]|=255&W<<4,l[0]=64|W>>4}for(R=W+3-(t<10);R0;T--)w[T]=w[T]?w[T-1]^u[x(d[w[T]]+R)]:w[T-1];w[0]=u[x(d[w[0]]+R)]}for(R=0;R<=o;R++)w[R]=d[w[R]];for(O=k,M=0,R=0;R>=1)1&M&&(p[e-1-O+8*e]=1,O<6?p[8+e*O]=1:p[8+e*(O+1)]=1);for(O=0;O<7;O++,M>>=1)1&M&&(p[8+e*(e-7+O)]=1,O?p[6-O+8*e]=1:p[7+8*e]=1);return p}(g)},utf16to8:function(t){var e,i,n,r;for(e="",n=t.length,i=0;i=1&&r<=127?e+=t.charAt(i):r>2047?(e+=String.fromCharCode(224|r>>12&15),e+=String.fromCharCode(128|r>>6&63),e+=String.fromCharCode(128|r>>0&63)):(e+=String.fromCharCode(192|r>>6&31),e+=String.fromCharCode(128|r>>0&63));return e},draw:function(t,i,n,r,o){i.drawView(n,r);var a=i.ctx,s=n.contentSize,h=s.width,c=s.height,d=s.left,u=s.top;r.borderRadius,r.backgroundColor;var l=r.color,f=void 0===l?"#000000":l;if(r.border,n.contentSize.left,n.borderSize.left,n.contentSize.top,n.borderSize.top,b=o||b,a){a.save(),i.setOpacity(r),i.setTransform(n,r);var p=Math.min(h,c);t=this.utf16to8(t);var v=this.getFrame(t),g=p/e;a.setFillStyle(f);for(var m=0;m=360&&(a-=360),a<0&&(a+=360),0===(a=Math.round(a)))return{x0:Math.round(e/2)+n,y0:i+r,x1:Math.round(e/2)+n,y1:r};if(180===a)return{x0:Math.round(e/2)+n,y0:r,x1:Math.round(e/2)+n,y1:i+r};if(90===a)return{x0:n,y0:Math.round(i/2)+r,x1:e+n,y1:Math.round(i/2)+r};if(270===a)return{x0:e+n,y0:Math.round(i/2)+r,x1:n,y1:Math.round(i/2)+r};var s=Math.round(180*Math.asin(e/Math.sqrt(Math.pow(e,2)+Math.pow(i,2)))/Math.PI);if(a===s)return{x0:n,y0:i+r,x1:e+n,y1:r};if(a===180-s)return{x0:n,y0:r,x1:e+n,y1:i+r};if(a===180+s)return{x0:e+n,y0:r,x1:n,y1:i+r};if(a===360-s)return{x0:e+n,y0:i+r,x1:n,y1:r};var h,c=0,d=0,u=0,l=0;if(a180-s&&a<180||a>180&&a<180+s||a>360-s){var f=a*Math.PI/180,p=a360-s?i/2:-i/2,v=Math.tan(f)*p,g=a180-s&&a<180?e/2-v:-e/2-v;c=-(u=v+(h=Math.pow(Math.sin(f),2)*g)),d=-(l=p+h/Math.tan(f))}(a>s&&a<90||a>90&&a<90+s||a>180+s&&a<270||a>270&&a<360-s)&&(f=(90-a)*Math.PI/180,v=a>s&&a<90||a>90&&a<90+s?e/2:-e/2,p=Math.tan(f)*v,g=a>s&&a<90||a>270&&a<360-s?i/2-p:-i/2-p,c=-(u=v+(h=Math.pow(Math.sin(f),2)*g)/Math.tan(f)),d=-(l=p+h));return c=Math.round(c+e/2)+n,d=Math.round(i/2-d)+r,u=Math.round(u+e/2)+n,l=Math.round(i/2-l)+r,{x0:c,y0:d,x1:u,y1:l}}(r,t,e,i,n),s=a.x0,h=a.y0,c=a.x1,d=a.y1,u=o.createLinearGradient(s,h,c,d),l=r.match(/linear-gradient\((.+)\)/)[1],f=k(l.substring(l.indexOf(",")+1)),p=0;p=a||"cover"==n&&o=a)&&(s=e.width/i.width);var h=i.width*s,c=i.height*s,d=r||[],u=d[0],l=d[1],f=/^\d+px|rpx$/.test(u)?P(u,e.width):(e.width-h)*(z(u)?P(u,1):{left:0,center:.5,right:1}[u||"center"]),p=/^\d+px|rpx$/.test(l)?P(l,e.height):(e.height-c)*(z(l)?P(l,1):{top:0,center:.5,bottom:1}[l||"center"]),v=function(t,e){return[(t-f)/s,(e-p)/s]},g=v(0,0),b=g[0],m=g[1],y=v(e.width,e.height),x=y[0],w=y[1];return{sx:Math.max(b,0),sy:Math.max(m,0),sw:Math.min(x-b,i.width),sh:Math.min(w-m,i.height),dx:Math.max(f,0),dy:Math.max(p,0),dw:Math.min(h,e.width),dh:Math.min(c,e.height)}}({objectFit:f,objectPosition:g},e.contentSize,t),n=i.sx,o=i.sy,a=i.sh,s=i.sw,h=i.dx,c=i.dy,u=i.dh,l=i.dw;y==d.MP_BAIDU?r.drawImage(t.src,h+S,c+k,l,u,n,o,s,a):r.drawImage(t.src,n,o,s,a,h+S,c+k,l,u)}else r.drawImage(t.src,S,k,x,w)},B=function(){r.restore(),R.drawView(e,i,!1,!0,!1),o(1)},W=function(t){O(t),B()},W(t),[2]}))}))}))];case 1:return o.sent(),[2]}}))}))},t.prototype.drawText=function(t,e,i,n){var r=this.ctx,o=e.borderSize,a=e.contentSize,s=e.left,h=e.top,c=a.width,d=a.height,u=a.left-o.left,l=a.top-o.top,f=i.color,p=void 0===f?"#000000":f,v=i.lineHeight,g=void 0===v?"1.4em":v,b=i.fontSize,m=void 0===b?14:b,y=i.fontWeight,x=i.fontFamily,w=i.fontStyle,S=i.textAlign,z=void 0===S?"left":S,k=i.verticalAlign,I=void 0===k?Z:k,M=i.backgroundColor,O=i.lineClamp,B=i.backgroundClip,W=i.textShadow,R=i.textDecoration;if(this.drawView(e,i,B!=G),g=P(g,m),t){switch(r.save(),this.setShadow({boxShadow:W}),s+=u,h+=l,r.setFonts({fontFamily:x,fontSize:m,fontWeight:y,fontStyle:w}),r.setTextBaseline(Z),r.setTextAlign(z),B?this.setBackground(M,c,d,s,h):r.setFillStyle(p),z){case"left":break;case"center":s+=.5*c;break;case"right":s+=c}var T=n.lines*g,j=Math.ceil((d-T)/2);switch(j<0&&(j=0),I){case"top":break;case Z:h+=j;break;case"bottom":h+=2*j}var C=n.fontHeight,F=n.descent,L=(g-C)/2,A=function(t){var e=r.measureText(t),i=e.actualBoundingBoxDescent,n=void 0===i?0:i,o=e.actualBoundingBoxAscent,a=void 0===o?0:o,s=n+a||.7*m+1;return"top"==I?{fix:a,height:s,lineY:g-s}:I==Z?{fix:g/2+n/4,height:s,lineY:(g-s)/2}:"bottom"==I?{fix:g-n,height:s,lineY:0}:{fix:0,height:0,lineY:0}},_=function(t,e,i){var o=t;switch(z){case"left":o+=i;break;case"center":o=(t-=i/2)+i;break;case"right":o=t,t-=i}if(R){r.setLineWidth(m/13),r.beginPath();var a=.1*n.fontHeight;/\bunderline\b/.test(R)&&(F||(e+=L/2),r.moveTo(t,e+a),r.lineTo(o,e+a)),/\boverline\b/.test(R)&&(F||(e-=L/2),r.moveTo(t,e-n.fontHeight-a),r.lineTo(o,e-n.fontHeight-a)),/\bline-through\b/.test(R)&&(r.moveTo(t,e-.5*n.fontHeight),r.lineTo(o,e-.5*n.fontHeight)),r.closePath(),r.setStrokeStyle(p),r.stroke()}};if(!n.widths||1==n.widths.length&&n.widths[0].total<=a.width){var E=A(t),H=E.fix,$=E.lineY;return r.fillText(t,s,h+H),_(s,(h+=g)-$,n&&n.widths&&n.widths[0].total||n.text),r.restore(),void this.setBorder(e,i)}for(var D=t.split(""),N=h,U=s,Y="",X=0,J=0;J<=D.length;J++){var V=D[J]||"",q="\n"===V,Q=""==V,K=Y+(V=q?"":V),tt=r.measureText(K).width;if(X>=O)break;if(U=s,tt>a.width||q||Q){if(X++,Y=Q&&tt<=a.width?K:Y,X===O&&tt>c){for(;r.measureText("".concat(Y,"...")).width>a.width&&!(Y.length<=1);)Y=Y.substring(0,Y.length-1);Y+="..."}var et=A(Y);if(H=et.fix,$=et.lineY,r.fillText(Y,U,h+H),_(U,(h+=g)-$,tt),Y=V,h>N+d)break}else Y=K}r.restore()}},t.prototype.source=function(t){var e;return a(this,void 0,void 0,(function(){var i,n,r,o=this;return s(this,(function(a){switch(a.label){case 0:if(this.node=null,i=+new Date,"{}"==JSON.stringify(t))return[2];if(!t.type)for(n in t.type=K,t.css=t.css||{},t)["views","children","type","css"].includes(n)||(t.css[n]=t[n],delete t[n]);return(null===(e=t.css)||void 0===e?void 0:e.width)||t.css||(t.css={}),[4,this.create(t)];case 1:return r=a.sent(),this.size=(null==r?void 0:r.layout())||{},this.node=r,this.onEffectFinished().then((function(t){return o.lifecycle("onEffectSuccess",t)})).catch((function(t){return o.lifecycle("onEffectFail",t)})),console.log("布局用时:"+(+new Date-i)+"ms"),[2,this.size]}}))}))},t.prototype.getImageInfo=function(t){return this.imageBus[t]||(this.imageBus[t]=this.createImage(t,this.useCORS)),this.imageBus[t]},t.prototype.create=function(t,e){var i,n;return a(this,void 0,void 0,(function(){var r,a,h,c,d,u,l,f,p,v,g,b,m,y,x,w,S;return s(this,(function(s){switch(s.label){case 0:if(r="image"==t.type,a=[G,Q].includes(t.type),h=t.css||{},c=h.backgroundImage,d=h.display,r&&!t.src&&!t.url||a&&!t.text)return[2];if("none"==d)return[2];if(a&&(t.text=String(t.text)),!(r||t.type==K&&c))return[3,4];u=r?t.src:"",l=/url\((.+)\)/,c&&(null===(i=l.exec(c))||void 0===i?void 0:i[1])&&(u=(null===(n=l.exec(c))||void 0===n?void 0:n[1])||""),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.getImageInfo(u)];case 2:return f=s.sent(),p=f.width,v=f.height,!(g=f.path)&&r?[2]:(g&&(t.attributes=Object.assign(t.attributes||{},{width:p,height:v,path:g,src:g,naturalSrc:u})),[3,4]);case 3:return b=s.sent(),t.type!=K?[2]:(this.lifecycle("onEffectFail",o(o({},b),{src:u})),[3,4]);case 4:if(this.count+=1,m=new V(t,e,this.root,this.ctx),!(y=t.views||t.children))return[3,8];x=0,s.label=5;case 5:return xo)return 1;if(r2&&void 0!==arguments[2]&&arguments[2];if("number"===typeof e)return e;if(d(e))return 1*e;if("string"===typeof e){var r=/^-?([0-9]+)?([.]{1}[0-9]+){0,1}(em|rpx|px|%)$/g,o=r.exec(e);if(!e||!o)return 0;var a=o[3];e=parseFloat(e);var s=0;return"rpx"===a?s=uni.upx2px(e):"px"===a?s=1*e:"%"===a?s=e*t(i)/100:"em"===a&&(s=e*t(i||14)),n?1*s.toFixed(2):Math.round(s)}return 0};var r=n(i("2634")),o=n(i("9b1b")),a=n(i("2fdc")),s=n(i("5de6"));i("5c47"),i("0506"),i("bf0f"),i("4626"),i("e838"),i("aa9c"),i("e966"),i("80e3"),i("4db2"),i("5ef2"),i("c976"),i("4d8f"),i("7b97"),i("668a"),i("c5b7"),i("8ff5"),i("2378"),i("641a"),i("64e0"),i("cce3"),i("efba"),i("d009"),i("bd7d"),i("7edd"),i("d798"),i("f547"),i("5e54"),i("b60a"),i("8c18"),i("12973"),i("f991"),i("198e"),i("8557"),i("63b1"),i("1954"),i("1cf1"),i("a1c1"),i("c9b5"),i("15d1"),i("d5c6"),i("5a56"),i("f074"),i("18f7"),i("de6c"),i("dc89"),i("2425");e.networkReg=/^(http|\/\/)/;e.isBase64=function(t){return/^data:image\/(\w+);base64/.test(t)};var h=["devtools"].includes(uni.getSystemInfoSync().platform),c={};function d(t){return/^-?\d+(\.\d+)?$/.test(t)}function u(t){return/^data:/.test(t)?t:new Promise((function(e,i){var n=new Image;n.setAttribute("crossOrigin","Anonymous"),n.onload=function(){var t=document.createElement("canvas");t.width=this.naturalWidth,t.height=this.naturalHeight,t.getContext("2d").drawImage(n,0,0);var i=t.toDataURL("image/png");e(i),t.height=t.width=0},n.src=t+"?v="+Math.random(),n.onerror=function(t){i(t)}}))}},"30f7":function(t,e,i){"use strict";i("6a54"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},i("7a76"),i("c9b5")},3695:function(t,e,i){"use strict";var n=i("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.children=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.indexKey;return{inject:(0,a.default)({},t,{default:null}),watch:{el:{handler:function(t,e){JSON.stringify(t)!=JSON.stringify(e)&&this.bindRelation()},deep:!0,immediate:!0},src:{handler:function(t,e){t!=e&&this.bindRelation()},immediate:!0},text:{handler:function(t,e){t!=e&&this.bindRelation()},immediate:!0},css:{handler:function(t,e){t!=e&&(this.el.css=("object"==(0,o.default)(t)?t:t&&Object.assign.apply(Object,(0,r.default)(s(t))))||{})},immediate:!0},replace:{handler:function(t,e){JSON.stringify(t)!=JSON.stringify(e)&&this.bindRelation()},deep:!0,immediate:!0}},created:function(){var e=this;this._uid||(this._uid=this._.uid),Object.defineProperty(this,"parent",{get:function(){return e[t]||[]}}),Object.defineProperty(this,"index",{get:function(){e.bindRelation();var t=e.parent;t=void 0===t?{}:t;var i=t.el;i=void 0===i?{}:i;var n=i.views,r=void 0===n?[]:n;return r.indexOf(e.el)}}),this.el.type=this.type,this.bindRelation()},beforeDestroy:function(){this.removeEl()},methods:{removeEl:function(){var t=this;this.parent&&(this.parent.el.views=this.parent.el.views.filter((function(e){return e._uid!==t._uid})))},bindRelation:function(){var t=this;if(this.el._uid||(this.el._uid=this._uid),["text","qrcode"].includes(this.type)&&(this.el.text=this.$slots&&this.$slots.default&&this.$slots.default[0].text||"".concat(this.text||"").replace(/\\n/g,"\n")),"image"==this.type&&(this.el.src=this.src),this.parent){var e=this.parent.el.views||[];-1!==e.indexOf(this.el)?this.parent.el.views=e.map((function(e){return e._uid==t._uid?t.el:e})):this.parent.el.views=[].concat((0,r.default)(e),[this.el])}}},mounted:function(){}}},e.parent=function(t){return{provide:function(){return(0,a.default)({},t,this)},data:function(){return{el:{css:{},views:[]}}},watch:{css:{handler:function(t){this.canvasId&&(this.el.css=("object"==(0,o.default)(t)?t:t&&Object.assign.apply(Object,(0,r.default)(s(t))))||{},this.canvasWidth=this.el.css&&this.el.css.width||this.canvasWidth,this.canvasHeight=this.el.css&&this.el.css.height||this.canvasHeight)},immediate:!0}}}};var r=n(i("b7c7")),o=n(i("fcf3")),a=n(i("39d8"));i("fd3c"),i("8f71"),i("bf0f"),i("5c47"),i("0506"),i("f7a5"),i("5ef2"),i("a1c1"),i("d4b5"),i("6a54"),i("4626"),i("c223");var s=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t.split(";").filter((function(t){return t&&!/^[\n\s]+$/.test(t)})).map((function(t){var e=t.slice(0,t.indexOf(":")),i=t.slice(t.indexOf(":")+1);return(0,a.default)({},e.replace(/-([a-z])/g,(function(){return arguments[1].toUpperCase()})).replace(/\s+/g,""),i.replace(/^\s+/,"").replace(/\s+$/,"")||"")}))}},"3e3c":function(t,e,i){"use strict";i("6a54");var n=i("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(i("2634")),o=n(i("2fdc"));i("c223"),i("dc8a"),i("d4b5"),i("bf0f"),i("5c47"),i("7a76"),i("c9b5"),i("a1c1");var a=i("3695"),s=n(i("b734")),h=i("28dc"),c=n(i("1ad6")),d={name:"lime-painter",mixins:[s.default,(0,a.parent)("painter"),{}],data:function(){return{use2dCanvas:!1,canvasHeight:150,canvasWidth:null,parentWidth:0,inited:!1,progress:0,firstRender:0,done:!1}},computed:{styles:function(){return"".concat(this.size).concat(this.customStyle||"",";")},canvasId:function(){return"l-painter".concat(this._uid||this._.uid)},size:function(){if(this.boardWidth&&this.boardHeight)return"width:".concat(this.boardWidth,"px; height: ").concat(this.boardHeight,"px;")},dpr:function(){return this.pixelRatio||uni.getSystemInfoSync().pixelRatio},boardWidth:function(){var t=this.elements&&this.elements.css||this.elements||this,e=t.width,i=void 0===e?0:e,n=(0,h.toPx)(i||this.width);return n||Math.max(n,(0,h.toPx)(this.canvasWidth))},boardHeight:function(){var t=this.elements&&this.elements.css||this.elements||this,e=t.height,i=void 0===e?0:e,n=(0,h.toPx)(i||this.height);return n||Math.max(n,(0,h.toPx)(this.canvasHeight))},hasBoard:function(){return this.board&&Object.keys(this.board).length},elements:function(){return JSON.parse(JSON.stringify(this.hasBoard?this.board:this.el))}},watch:{},created:function(){var t=uni.getSystemInfoSync();t.SDKVersion,t.version,t.platform},mounted:function(){var t=this;return(0,o.default)((0,r.default)().mark((function e(){return(0,r.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,(0,h.sleep)(30);case 2:return e.next=4,t.getParentWeith();case 4:t.$nextTick((function(){setTimeout((function(){t.$watch("elements",t.watchRender,{deep:!0,immediate:!0})}),30)}));case 5:case"end":return e.stop()}}),e)})))()},methods:{watchRender:function(t,e){var i=this;return(0,o.default)((0,r.default)().mark((function n(){return(0,r.default)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(t&&t.views&&(i.firstRender?i.firstRender:t.views.length)&&Object.keys(t).length&&t!=e){n.next=2;break}return n.abrupt("return");case 2:i.firstRender=1,clearTimeout(i.rendertimer),i.rendertimer=setTimeout((function(){i.render(t)}),i.beforeDelay);case 5:case"end":return n.stop()}}),n)})))()},setFilePath:function(t,e){var i=this;return(0,o.default)((0,r.default)().mark((function n(){var o,a,s,c;return(0,r.default)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(o=t,a=e||i,s=a.pathType,c=void 0===s?i.pathType:s,"base64"!=c||(0,h.isBase64)(t)){n.next=8;break}return n.next=5,(0,h.pathToBase64)(t);case 5:o=n.sent,n.next=12;break;case 8:if("url"!=c||!(0,h.isBase64)(t)){n.next=12;break}return n.next=11,(0,h.base64ToPath)(t);case 11:o=n.sent;case 12:return e&&e.isEmit&&i.$emit("success",o),n.abrupt("return",o);case 14:case"end":return n.stop()}}),n)})))()},getSize:function(t){var e=this;return(0,o.default)((0,r.default)().mark((function i(){var n,o,a,s;return(0,r.default)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(n=t.css||t,o=n.width,a=t.css||t,s=a.height,e.size){i.next=12;break}if(!o&&!s){i.next=10;break}return e.canvasWidth=o||e.canvasWidth,e.canvasHeight=s||e.canvasHeight,i.next=8,(0,h.sleep)(30);case 8:i.next=12;break;case 10:return i.next=12,e.getParentWeith();case 12:case"end":return i.stop()}}),i)})))()},canvasToTempFilePathSync:function(t){var e=this;this.stopWatch=this.$watch("done",(function(i){i&&(e.canvasToTempFilePath(t),e.stopWatch&&e.stopWatch())}),{immediate:!0})},getParentWeith:function(){var t=this;return new Promise((function(e){uni.createSelectorQuery().in(t).select(".lime-painter").boundingClientRect().exec((function(i){var n=i[0]||{},r=n.width,o=n.height;t.parentWidth=Math.ceil(r||0),t.canvasWidth=t.parentWidth||300,t.canvasHeight=o||t.canvasHeight||150,e(i[0])}))}))},render:function(){var t=arguments,e=this;return(0,o.default)((0,r.default)().mark((function i(){var n,o,a,s,d,u,l,f,p,v,g,b,m,y;return(0,r.default)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(n=t.length>0&&void 0!==t[0]?t[0]:{},Object.keys(n).length){i.next=3;break}return i.abrupt("return",console.error("空对象"));case 3:return e.progress=0,e.done=!1,i.next=7,e.getSize(n);case 7:return i.next=9,e.getContext();case 9:if(o=i.sent,a=e.use2dCanvas,s=e.boardWidth,d=e.boardHeight,u=e.canvas,l=e.afterDelay,!a||u){i.next=13;break}return i.abrupt("return",Promise.reject(new Error("render: fail canvas has not been created")));case 13:return e.boundary={top:0,left:0,width:s,height:d},e.painter=null,e.painter||(f=n.css||n,p=f.width,v=n.css||n,v.height,!p&&e.parentWidth&&Object.assign(n,{width:e.parentWidth}),g={context:o,canvas:u,width:s,height:d,pixelRatio:e.dpr,useCORS:e.useCORS,listen:{onProgress:function(t){e.progress=t,e.$emit("progress",t)},onEffectFail:function(t){e.$emit("faill",t)}}},a||(g.createImage=h.getImageInfo),e.painter=new c.default(g,e)),i.next=18,e.painter.source(JSON.parse(JSON.stringify(n)));case 18:return b=i.sent,m=b.width,y=b.height,e.boundary.height=e.canvasHeight=y,e.boundary.width=e.canvasWidth=m,i.next=25,(0,h.sleep)(e.sleep);case 25:return a||e.painter.init(e.ctx),i.next=28,e.painter.render();case 28:return i.next=30,new Promise((function(t){return e.$nextTick(t)}));case 30:if(a){i.next=33;break}return i.next=33,e.canvasDraw();case 33:if(!l||!a){i.next=36;break}return i.next=36,(0,h.sleep)(l);case 36:return e.$emit("done"),e.done=!0,e.isCanvasToTempFilePath&&e.canvasToTempFilePath().then((function(t){e.$emit("success",t.tempFilePath)})).catch((function(t){e.$emit("fail",new Error(JSON.stringify(t)))})),i.abrupt("return",Promise.resolve({ctx:o,draw:e.painter,node:e.node}));case 40:case"end":return i.stop()}}),i)})))()},canvasDraw:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise((function(i,n){return t.ctx.draw(e,(function(){return setTimeout((function(){return i()}),t.afterDelay)}))}))},getContext:function(){var t=this;return(0,o.default)((0,r.default)().mark((function e(){var i,n,o;return(0,r.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.canvasWidth){e.next=4;break}return t.$emit("fail","painter no size"),console.error("painter no size: 请给画板或父级设置尺寸"),e.abrupt("return",Promise.reject());case 4:if(!t.ctx||!t.inited){e.next=6;break}return e.abrupt("return",Promise.resolve(t.ctx));case 6:if(i=t.type,n=t.use2dCanvas,t.dpr,t.boardWidth,t.boardHeight,o=function(){return new Promise((function(e){uni.createSelectorQuery().in(t).select("#".concat(t.canvasId)).boundingClientRect().exec((function(i){if(i){var n=uni.createCanvasContext(t.canvasId,t);t.inited||(t.inited=!0,t.use2dCanvas=!1,t.canvas=i),t.ctx=n,e(t.ctx)}}))}))},n){e.next=10;break}return e.abrupt("return",o());case 10:return e.abrupt("return",new Promise((function(e){uni.createSelectorQuery().in(t).select("#".concat(t.canvasId)).node().exec((function(n){var r=n[0].node;r||(t.use2dCanvas=!1,e(t.getContext()));var o=r.getContext(i);t.inited||(t.inited=!0,t.use2dCanvas=!0,t.canvas=r),t.ctx=o,e(t.ctx)}))})));case 11:case"end":return e.stop()}}),e)})))()},canvasToTempFilePath:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise(function(){var i=(0,o.default)((0,r.default)().mark((function i(n,a){var s,h,c,d,u,l,f,p,v,g,b,m,y,x,w,S,P;return(0,r.default)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(s=t.use2dCanvas,h=t.canvasId,c=t.dpr,d=t.fileType,u=t.quality,l=function(){var e=(0,o.default)((0,r.default)().mark((function e(i){var o;return(0,r.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.setFilePath(i.tempFilePath||i);case 3:o=e.sent,n(Object.assign(i,{tempFilePath:o})),e.next=10;break;case 7:e.prev=7,e.t0=e["catch"](0),t.$emit("fail",e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}(),f=t.boundary||t,p=f.top,v=void 0===p?0:p,g=f.left,b=void 0===g?0:g,m=f.width,y=f.height,x=m*c,w=y*c,S=Object.assign({x:b,y:v,width:m,height:y,destWidth:x,destHeight:w,canvasId:h,fileType:d,quality:u,success:l,fail:a},e),!s){i.next=22;break}return i.prev=7,e.pathType||t.pathType||(e.pathType="url"),i.next=11,t.setFilePath(t.canvas.toDataURL("image/".concat(e.fileType||d).replace(/pg/,"peg"),e.quality||u),e);case 11:P=i.sent,e.success&&e.success({tempFilePath:P}),n({tempFilePath:P}),i.next=20;break;case 16:i.prev=16,i.t0=i["catch"](7),e.fail&&e.fail(i.t0),a(i.t0);case 20:i.next=23;break;case 22:uni.canvasToTempFilePath(S,t);case 23:case"end":return i.stop()}}),i,null,[[7,16]])})));return function(t,e){return i.apply(this,arguments)}}())}}};e.default=d},4733:function(t,e,i){"use strict";i("6a54"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){if(Array.isArray(t))return(0,n.default)(t)};var n=function(t){return t&&t.__esModule?t:{default:t}}(i("8d0b"))},"4b5a":function(t,e,i){var n=i("c86c");e=n(!1),e.push([t.i,".lime-painter[data-v-85188b92],\n.lime-painter__canvas[data-v-85188b92]{\nwidth:100%;\n}",""]),t.exports=e},"4f06":function(t,e,i){"use strict";i.r(e);var n=i("3e3c"),r=i.n(n);for(var o in n)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(o);e["default"]=r.a},8057:function(t,e,i){"use strict";var n=i("015a"),r=i.n(n);r.a},9046:function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return r})),i.d(e,"a",(function(){}));var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-uni-view",{ref:"limepainter",staticClass:"lime-painter"},[t.canvasId&&t.size?i("v-uni-view",{style:t.styles},[t.use2dCanvas?i("v-uni-canvas",{staticClass:"lime-painter__canvas",style:t.size,attrs:{id:t.canvasId,type:"2d"}}):i("v-uni-canvas",{staticClass:"lime-painter__canvas",style:t.size,attrs:{"canvas-id":t.canvasId,id:t.canvasId,width:t.boardWidth*t.dpr,height:t.boardHeight*t.dpr}})],1):t._e(),t._t("default")],2)},r=[]},b734:function(t,e,i){"use strict";i("6a54"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i("64aa");var n={props:{board:Object,pathType:String,fileType:{type:String,default:"png"},quality:{type:Number,default:1},css:[String,Object],width:[Number,String],height:[Number,String],pixelRatio:Number,customStyle:String,isCanvasToTempFilePath:Boolean,sleep:{type:Number,default:1e3/30},beforeDelay:{type:Number,default:100},afterDelay:{type:Number,default:100},useCORS:Boolean}};e.default=n},b7c7:function(t,e,i){"use strict";i("6a54"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,n.default)(t)||(0,r.default)(t)||(0,o.default)(t)||(0,a.default)()};var n=s(i("4733")),r=s(i("d14d")),o=s(i("5d6b")),a=s(i("30f7"));function s(t){return t&&t.__esModule?t:{default:t}}}}]);