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.
1 lines
76 KiB
1 lines
76 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["agent-pages-poster-channel~agent-pages-poster-salesman~user-pages-channel-poster~user-pages-coupon-p~3cae6a7f"],{"05e5":function(t,e,i){"use strict";var n=i("4ea4").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("2909")),o=n(i("53ca")),a=n(i("ade3"));i("d81d"),i("4de4"),i("d3b7"),i("ac1f"),i("00b4"),i("fb6a"),i("c975"),i("5319"),i("e9c4"),i("7a82"),i("caad"),i("99af");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+$/,"")||"")}))}},"0d64":function(t,e,i){"use strict";i("7a82");var n=i("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.base64ToPath=function(t){var e=/^data:image\/(\w+);base64,/.exec(t)||[],i=(0,s.default)(e,2);i[1];return new Promise((function(e,i){for(var n=t.split(",")[0].split(":")[1].split(";")[0],r=atob(t.split(",")[1]),o=new ArrayBuffer(r.length),a=new Uint8Array(o),s=0;s<r.length;s++)a[s]=r.charCodeAt(s);e(URL.createObjectURL(new Blob([a],{type:n})))}))},e.compareVersion=function(t,e){t=t.split("."),e=e.split(".");var i=Math.max(t.length,e.length);while(t.length<i)t.push("0");while(e.length<i)e.push("0");for(var n=0;n<i;n++){var r=parseInt(t[n],10),o=parseInt(e[n],10);if(r>o)return 1;if(r<o)return-1}return 0},e.downloadFile=function(t){return t?new Promise((function(e,i){if(c[t])return i();c[t]=1,uni.downloadFile({url:t,success:function(t){e(t)},fail:function(t){i(t)}})})):Promise.reject({err:"no url"})},e.getImageInfo=function(t,e){return new Promise(function(){var i=(0,a.default)((0,r.default)().mark((function i(n,a){var s;return(0,r.default)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(s=t,!c[t]||!c[t].errMsg){i.next=5;break}n(c[t]),i.next=16;break;case 5:if(i.prev=5,!e){i.next=10;break}return i.next=9,u(t);case 9:s=i.sent;case 10:i.next=15;break;case 12:i.prev=12,i.t0=i["catch"](5),a((0,o.default)((0,o.default)({},i.t0),{},{src:s}));case 15:uni.getImageInfo({src:s,success:function(e){e.path=e.path.replace(/^\./,window.location.origin),h?n(e):(c[t]=e,n(c[t]))},fail:function(e){a({err:e,path:t})}});case 16:case"end":return i.stop()}}),i,null,[[5,12]])})));return function(t,e){return i.apply(this,arguments)}}())},e.isBase64=void 0,e.isNumber=d,e.networkReg=void 0,e.pathToBase64=u,e.sleep=function(t){return new Promise((function(e){return setTimeout(e,t)}))},e.toPx=function t(e,i){var n=arguments.length>2&&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("c7eb")),o=n(i("5530")),a=n(i("1da1")),s=n(i("3835"));i("ac1f"),i("00b4"),i("d3b7"),i("caad"),i("acd8"),i("14d9"),i("e25e"),i("c19f"),i("ace4"),i("c975"),i("5cc6"),i("907a"),i("9a8c"),i("a975"),i("735e"),i("c1ac"),i("d139"),i("3a7b"),i("986a"),i("1d02"),i("d5d6"),i("82f8"),i("e91f"),i("60bd"),i("5f96"),i("3280"),i("3fcc"),i("ca91"),i("25a1"),i("cd26"),i("3c5d"),i("2954"),i("649e"),i("219c"),i("b39a"),i("72f7"),i("5319"),i("d401"),i("81b2"),i("0eb6"),i("b7ef"),i("8bd4"),i("3ca3"),i("ddb0"),i("2b3d"),i("9861");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)}}))}},2909:function(t,e,i){"use strict";i("7a82"),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("6005")),r=s(i("db90")),o=s(i("06c5")),a=s(i("3427"));function s(t){return t&&t.__esModule?t:{default:t}}},3427:function(t,e,i){"use strict";i("7a82"),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("d9e2"),i("d401")},"4ec9":function(t,e,i){i("6f48")},"4fad":function(t,e,i){var n=i("d039"),r=i("861d"),o=i("c6b6"),a=i("d86b"),s=Object.isExtensible,h=n((function(){s(1)}));t.exports=h||a?function(t){return!!r(t)&&((!a||"ArrayBuffer"!=o(t))&&(!s||s(t)))}:s},5794:function(t,e,i){var n=i("d3fa");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var r=i("4f06").default;r("2fac84b0",n,!0,{sourceMap:!1,shadowMode:!1})},5832:function(t,e,i){"use strict";i.r(e);var n=i("c353"),r=i("df09");for(var o in r)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return r[t]}))}(o);i("9125");var a=i("f0c5"),s=Object(a["a"])(r["default"],n["b"],n["c"],!1,null,"85188b92",null,!1,n["a"],void 0);e["default"]=s.exports},"5d5c":function(t,e,i){"use strict";i("7a82");var n=i("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(i("c7eb")),o=n(i("1da1"));i("99af"),i("b64b"),i("e9c4"),i("d3b7"),i("ac1f"),i("d9e2"),i("d401"),i("5319");var a=i("05e5"),s=n(i("971f")),h=i("0d64"),c=n(i("d980")),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,f,l,p,v,g,b,y,x;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,f=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||(l=n.css||n,p=l.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,y=b.width,x=b.height,e.boundary.height=e.canvasHeight=x,e.boundary.width=e.canvasWidth=y,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(!f||!a){i.next=36;break}return i.next=36,(0,h.sleep)(f);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,f,l,p,v,g,b,y,x,m,w,S,k;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,f=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)}}(),l=t.boundary||t,p=l.top,v=void 0===p?0:p,g=l.left,b=void 0===g?0:g,y=l.width,x=l.height,m=y*c,w=x*c,S=Object.assign({x:b,y:v,width:y,height:x,destWidth:m,destHeight:w,canvasId:h,fileType:d,quality:u,success:f,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:k=i.sent,e.success&&e.success({tempFilePath:k}),n({tempFilePath:k}),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},6005:function(t,e,i){"use strict";i("7a82"),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("6b75"))},6566:function(t,e,i){"use strict";var n=i("9bf2").f,r=i("7c73"),o=i("6964"),a=i("0366"),s=i("19aa"),h=i("7234"),c=i("2266"),d=i("c6d2"),u=i("4754"),f=i("2626"),l=i("83ab"),p=i("f183").fastKey,v=i("69f3"),g=v.set,b=v.getterFor;t.exports={getConstructor:function(t,e,i,d){var u=t((function(t,n){s(t,f),g(t,{type:e,index:r(null),first:void 0,last:void 0,size:0}),l||(t.size=0),h(n)||c(n,t[d],{that:t,AS_ENTRIES:i})})),f=u.prototype,v=b(e),y=function(t,e,i){var n,r,o=v(t),a=x(t,e);return a?a.value=i:(o.last=a={index:r=p(e,!0),key:e,value:i,previous:n=o.last,next:void 0,removed:!1},o.first||(o.first=a),n&&(n.next=a),l?o.size++:t.size++,"F"!==r&&(o.index[r]=a)),t},x=function(t,e){var i,n=v(t),r=p(e);if("F"!==r)return n.index[r];for(i=n.first;i;i=i.next)if(i.key==e)return i};return o(f,{clear:function(){var t=v(this),e=t.index,i=t.first;while(i)i.removed=!0,i.previous&&(i.previous=i.previous.next=void 0),delete e[i.index],i=i.next;t.first=t.last=void 0,l?t.size=0:this.size=0},delete:function(t){var e=v(this),i=x(this,t);if(i){var n=i.next,r=i.previous;delete e.index[i.index],i.removed=!0,r&&(r.next=n),n&&(n.previous=r),e.first==i&&(e.first=n),e.last==i&&(e.last=r),l?e.size--:this.size--}return!!i},forEach:function(t){var e,i=v(this),n=a(t,arguments.length>1?arguments[1]:void 0);while(e=e?e.next:i.first){n(e.value,e.key,this);while(e&&e.removed)e=e.previous}},has:function(t){return!!x(this,t)}}),o(f,i?{get:function(t){var e=x(this,t);return e&&e.value},set:function(t,e){return y(this,0===t?0:t,e)}}:{add:function(t){return y(this,t=0===t?0:t,t)}}),l&&n(f,"size",{get:function(){return v(this).size}}),u},setStrong:function(t,e,i){var n=e+" Iterator",r=b(e),o=b(n);d(t,e,(function(t,e){g(this,{type:n,target:t,state:r(t),kind:e,last:void 0})}),(function(){var t=o(this),e=t.kind,i=t.last;while(i&&i.removed)i=i.previous;return t.target&&(t.last=i=i?i.next:t.state.first)?u("keys"==e?i.key:"values"==e?i.value:[i.key,i.value],!1):(t.target=void 0,u(void 0,!0))}),i?"entries":"values",!i,!0),f(e)}}},"6d61":function(t,e,i){"use strict";var n=i("23e7"),r=i("da84"),o=i("e330"),a=i("94ca"),s=i("cb2d"),h=i("f183"),c=i("2266"),d=i("19aa"),u=i("1626"),f=i("7234"),l=i("861d"),p=i("d039"),v=i("1c7e"),g=i("d44e"),b=i("7156");t.exports=function(t,e,i){var y=-1!==t.indexOf("Map"),x=-1!==t.indexOf("Weak"),m=y?"set":"add",w=r[t],S=w&&w.prototype,k=w,z={},P=function(t){var e=o(S[t]);s(S,t,"add"==t?function(t){return e(this,0===t?0:t),this}:"delete"==t?function(t){return!(x&&!l(t))&&e(this,0===t?0:t)}:"get"==t?function(t){return x&&!l(t)?void 0:e(this,0===t?0:t)}:"has"==t?function(t){return!(x&&!l(t))&&e(this,0===t?0:t)}:function(t,i){return e(this,0===t?0:t,i),this})},I=a(t,!u(w)||!(x||S.forEach&&!p((function(){(new w).entries().next()}))));if(I)k=i.getConstructor(e,t,y,m),h.enable();else if(a(t,!0)){var O=new k,M=O[m](x?{}:-0,1)!=O,B=p((function(){O.has(1)})),W=v((function(t){new w(t)})),R=!x&&p((function(){var t=new w,e=5;while(e--)t[m](e,e);return!t.has(-0)}));W||(k=e((function(t,e){d(t,S);var i=b(new w,t,k);return f(e)||c(e,i[m],{that:i,AS_ENTRIES:y}),i})),k.prototype=S,S.constructor=k),(B||R)&&(P("delete"),P("has"),y&&P("get")),(R||M)&&P(m),x&&S.clear&&delete S.clear}return z[t]=k,n({global:!0,constructor:!0,forced:k!=w},z),g(k,t),x||i.setStrong(k,t,y),k}},"6f48":function(t,e,i){"use strict";var n=i("6d61"),r=i("6566");n("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),r)},9125:function(t,e,i){"use strict";var n=i("5794"),r=i.n(n);r.a},"971f":function(t,e,i){"use strict";i("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i("a9e3");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},baa5:function(t,e,i){var n=i("23e7"),r=i("e58c");n({target:"Array",proto:!0,forced:r!==[].lastIndexOf},{lastIndexOf:r})},bb2f:function(t,e,i){var n=i("d039");t.exports=!n((function(){return Object.isExtensible(Object.preventExtensions({}))}))},c353: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=[]},cb29:function(t,e,i){var n=i("23e7"),r=i("81d5"),o=i("44d2");n({target:"Array",proto:!0},{fill:r}),o("fill")},d3fa:function(t,e,i){var n=i("24fb");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},d86b:function(t,e,i){var n=i("d039");t.exports=n((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}))},d980:function(t,e,i){"use strict";var n=i("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.Painter=void 0;var r=n(i("53ca"));i("d3b7"),i("a4d3"),i("e01a"),i("d28b"),i("3ca3"),i("ddb0"),i("d9e2"),i("d401"),i("14d9"),i("ac1f"),i("00b4"),i("acd8"),i("2ca0"),i("466d"),i("c975"),i("498a"),i("baa5"),i("7a82"),i("131a"),i("fb6a"),i("a630"),i("4e82"),i("159b"),i("13d5"),i("b64b"),i("d81d"),i("7db0"),i("caad"),i("2532"),i("5319"),i("99af"),i("4ec9"),i("cb29"),i("4de4"),i("e9c4"),i("07ac");var o=function(){return o=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},o.apply(this,arguments)};function a(t,e,i,n){return new(i||(i=Promise))((function(r,o){function a(t){try{h(n.next(t))}catch(t){o(t)}}function s(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}h((n=n.apply(t,e||[])).next())}))}function s(t,e){var i,n,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(r=a.trys,!((r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}var h,c,d={MP_WEIXIN:"mp-weixin",MP_QQ:"mp-qq",MP_ALIPAY:"mp-alipay",MP_BAIDU:"mp-baidu",MP_TOUTIAO:"mp-toutiao",MP_DINGDING:"mp-dingding",H5:"h5",WEB:"web",PLUS:"plus"},u=["contentSize","clientSize","borderSize","offsetSize"],f="view",l="text",p="image",v="qrcode",g="block",b={display:g,color:"#000000",lineHeight:"1.4em",fontSize:14,fontWeight:400,fontFamily:"sans-serif",lineCap:"butt",flexDirection:"row",flexWrap:"nowrap",textAlign:"left",alignItems:"flex-start",justifyContent:"flex-start",position:"static",transformOrigin:"center center"},y={upx2px:function(t){return window.innerWidth/750*t},getSystemInfoSync:function(){return{screenWidth:window.innerWidth}},getImageInfo:function(t){var e=t.src,i=t.success,n=t.fail,r=new Image;r.onload=function(){i({width:this.naturalWidth,height:this.naturalHeight,path:this.src,src:e})},r.onerror=n,r.src=e}},x="object"==("undefined"===typeof window?"undefined":(0,r.default)(window))?"undefined"==typeof uni||"undefined"!=typeof uni&&!uni.addInterceptor?d.WEB:d.H5:"object"==("undefined"===typeof swan?"undefined":(0,r.default)(swan))?d.MP_BAIDU:"object"==("undefined"===typeof tt?"undefined":(0,r.default)(tt))?d.MP_TOUTIAO:"object"==("undefined"===typeof plus?"undefined":(0,r.default)(plus))?d.PLUS:"object"==("undefined"===typeof wx?"undefined":(0,r.default)(wx))?d.MP_WEIXIN:void 0,m=x==d.MP_WEIXIN?wx:"undefined"!=typeof uni?uni.getImageInfo?{upx2px:function(t){return uni.upx2px(t)},getSystemInfoSync:function(){return uni.getSystemInfoSync()},getImageInfo:function(t){return uni.getImageInfo(t)},downloadFile:function(t){return uni.downloadFile(t)}}:Object.assign(uni,y):"undefined"!=typeof window?y:uni;if(!m.upx2px){var w=(null!==(c=m.getSystemInfoSync&&(null===(h=uni.getSystemInfoSync())||void 0===h?void 0:h.screenWidth))&&void 0!==c?c:375)/750;m.upx2px=function(t){return w*t}}function S(t){return/^-?\d+(\.\d+)?$/.test(t)}function k(t,e,i){if("number"==typeof t)return t;if(S(t))return 1*t;if("string"==typeof t){var n=/^-?([0-9]+)?([.]{1}[0-9]+){0,1}(em|rpx|px|%)$/g.exec(t);if(!t||!n)return 0;var r=n[3];t=parseFloat(t);var o=0;return"rpx"===r?o=m.upx2px(t):"px"===r?o=1*t:"%"===r&&e?o=t*k(e)/100:"em"===r&&e&&(o=t*k(e||14)),1*o.toFixed(2)}return 0}function z(t){return/%$/.test(t)}function P(t){for(var e=[],i=[],n=0,r=t.substring(0,t.length-1).split("%,");n<r.length;n++){var o=r[n];e.push(o.substring(0,o.lastIndexOf(" ")).trim()),i.push(o.substring(o.lastIndexOf(" "),o.length)/100)}return{colors:e,percents:i}}function I(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function O(){return O=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},O.apply(this,arguments)}function M(t,e){return M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},M(t,e)}function B(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function W(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(i)return(i=i.call(t)).next.bind(i);if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return B(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?B(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0;return function(){return n>=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 F,C=0,A=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),C++,this.id=C}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.width&&(this.container.lineMaxWidth=this.width)},e.refreshXAlign=function(){if(this.isInline){var t=this.container.contentSize.width-this.width,e=this.container.style.textAlign;"center"===e?t/=2:"left"===e&&(t=0),this.offsetX=t}},e.getOffsetY=function(t){if(!t||!t.style)return 0;var e=(t.style||{}).verticalAlign;return"bottom"===e?this.height-t.contentSize.height:"middle"===e?(this.height-t.contentSize.height)/2:0},e.layout=function(t,e){for(var i in this.refreshXAlign(),this.pre?(this.top=this.pre.top+this.pre.height+this.offsetY,this.left=e+this.offsetX):(this.top=Math.max(this.top,this.container.contentSize.top,t)+this.offsetY,this.left=Math.max(this.left,this.container.contentSize.left,e)+this.offsetX),this.elements){var n=this.elements[i],r=this.elements[i-1],o=this.getOffsetY(n);n.style.top=this.top+o,n.style.left=r?r.offsetSize.left+r.offsetSize.width:this.left,n.getBoxPosition2()}},e.refreshLayout=function(){this.afterElements=this.afterElements.sort((function(t,e){return t.computedStyle.zIndex-e.computedStyle.zIndex})),this.beforeElements=this.beforeElements.sort((function(t,e){return t.computedStyle.zIndex-e.computedStyle.zIndex}))},t}(),L=((F={})["row"]={width:"width",contentWidth:"width",x:"x",y:"y",contentX:"left",height:"height",contentHeight:"height"},F["column"]={width:"height",contentWidth:"height",x:"y",y:"x",contentX:"top",height:"width",contentHeight:"width"},F),_=function(t){var e,i;function n(){var e;return I(function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(e=t.call(this)||this),"outerWidth",0),e.exactValue=0,e.flexTotal=0,e.key=null,e}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,M(e,i);var r=n.prototype;return r.bind=function(t){console.warn("[painter] flex-box 功能未完善谨慎使用"),this.container=t.parent,this.container.line=this,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]),t.parent&&(this.key=L[t.parent.style.flexDirection]),this.initHeight(t),this.outerWidth=t.parent&&t.parent.contentSize[this.key.contentWidth]?t.parent.contentSize[this.key.contentWidth]:1/0,this.add(t)},r.add=function(t){this.ids.push(t.id),R(t.style.flex)?this.flexTotal+=t.style.flex:R(t.style[this.key.width])&&(this.exactValue+=t.contentSize[this.key.width]),this.elements.push(t),this.refreshWidthHeight(t),t.next||this.closeLine()},r.closeLine=function(){this.calcFlex()},r.initHeight=function(t){this[this.key.height]=0},r.calcFlex=function(){var t=this,e=this.container.contentSize[this.key.contentWidth];this.elements.forEach((function(i){var n=i.style.width||0;R(i.style.flex)&&(n=i.style.flex/t.flexTotal*(e-t.exactValue)),i.computedStyle[t.key.width]=n,i.getBoxWidthHeight()}))},r.refreshWidthHeight=function(t){this.container.style.alignItems&&!t.style.alignSelf&&(t.style.alignSelf=this.container.style.alignItems),t.contentSize[this.key.height]>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)<this[this.key.width]&&(this.container.lineMaxWidth=this[this.key.width])},r.refreshXAlign=function(){var t=this,e=this.elements.reduce((function(e,i){return e+i.offsetSize[t.key.width]}),0),i=this.outerWidth==1/0?0:this.outerWidth-Math.max(this[this.key.width],e);"center"===this.container.style.justifyContent?i/=2:"flex-start"===this.container.style.justifyContent&&(i=0),this.offsetX=i||0,this.refreshYAlign()},r.refreshYAlign=function(){if(1==this.container.lines.length)return 0;var t=this.container.lines.reduce((function(t,e){return t+e.height}),0);if("center"===this.container.style.alignItems){var e=(this.container.contentSize[this.key.contentHeight]-t)/(this.container.lines.length+1);this.container.lines.forEach((function(t){t.offsetY=e}))}if("flex-end"===this.container.style.alignItems){var i=this.container.contentSize[this.key.contentHeight]-t;this.container.lines[0].offsetY=i}},r.getOffsetY=function(t){return this.container.lines.length>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}(A),E=p,H=l,$=f,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",O({},J)),I(this,"contentSize",O({},J)),I(this,"clientSize",O({},J)),I(this,"borderSize",O({},J)),I(this,"offsetSize",O({},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:O({},this.contentSize),clientSize:O({},this.clientSize),borderSize:O({},this.borderSize),offsetSize:O({},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=O({},b);if([H,E,D].includes(s)&&!o.display&&(h.display=N),e)for(var c=0;c<i.length;c++){var d=i[c];(o[d]||e[d])&&(o[d]=o[d]||e[d])}for(var u=function(){var t=l[f],e=o[t];if(/-/.test(t)&&(t=t.replace(/-([a-z])/g,(function(t,e){return e.toUpperCase()})),h.key=e),/^(box|text)?shadow$/i.test(t)){var i=[];return e.replace(/((\d+(rpx|px)?\s+?){3})(.+)/,(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];i=e[1].match(/\d+(rpx|px)?/g).map((function(t){return k(t)})).concat(e[4])})),/^text/.test(t)?h.textShadow=i:h.boxShadow=i,"continue"}if(/^border/i.test(t)&&!/radius$/i.test(t)){var n,a=t.match(/^border([BTRLa-z]+)?/)[0],c=t.match(/[W|S|C][a-z]+/),d=e.replace(/([\(,])\s+|\s+([\),])/g,"$1$2").split(" ").map((function(t){return/^\d/.test(t)?k(t,""):t}));return h[a]=((n={})[a+"Width"]=S(d[0])?d[0]:0,n[a+"Style"]=d[1]||"solid",n[a+"Color"]=d[2]||"black",n),1==d.length&&c&&(h[a][a+c[0]]=d[0]),"continue"}if(/^background(color)?$/i.test(t))return h.backgroundColor=e,"continue";if(/^objectPosition$/i.test(t))return h[t]=e.split(" "),"continue";if(/padding|margin|radius/i.test(t)){var u=/radius$/i.test(t),p=u?"borderRadius":t.match(/[a-z]+/)[0],v=[0,0,0,0].map((function(t,e){return u?["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"][e]:[p+"Top",p+"Right",p+"Bottom",p+"Left"][e]})),g="margin";if("padding"===t||t===g||/^(border)?radius$/i.test(t)){var b,y=(null==e?void 0:e.split(" ").map((function(e){return/^\d+(rpx|px)?$/.test(e)?k(e):t!=g&&/auto/.test(e)?0:e}),[]))||[0],x=u?"borderRadius":t,m=y[0],w=y[1],z=y[2],P=y[3];h[x]=((b={})[v[0]]=T(m)?0:m,b[v[1]]=S(w)||T(w)?w:m,b[v[2]]=T(S(z)?z:m)?0:S(z)?z:m,b[v[3]]=S(P)?P:w||m,b)}else{var I;"object"==(0,r.default)(h[p])||(h[p]=((I={})[v[0]]=h[p]||0,I[v[1]]=h[p]||0,I[v[2]]=h[p]||0,I[v[3]]=h[p]||0,I)),h[p][t]=p==g&&T(e)||j(e)?e:k(e)}return"continue"}if(/^transform$/i.test(t))return h[t]={},e.replace(/([a-zA-Z]+)\(([0-9,-\.%rpxdeg\s]+)\)/g,(function(e,i,n){var r=n.split(",").map((function(t){return t.replace(/(^\s*)|(\s*$)/g,"")})),a=function(t,e){return t.includes("deg")?1*t:e&&!j(e)?k(t,e):t};i.includes("matrix")?h[t][i]=r.map((function(t){return 1*t})):i.includes("rotate")?h[t][i]=1*n.match(/^-?\d+(\.\d+)?/)[0]:/[X, Y]/.test(i)?h[t][i]=/[X]/.test(i)?a(r[0],o.width):a(r[0],o.height):(h[t][i+"X"]=a(r[0],o.width),h[t][i+"Y"]=a(r[1]||r[0],o.height))})),"continue";/^font$/i.test(t)&&console.warn("font 不支持简写"),/^left|top$/i.test(t)&&![U,Y].includes(o.position)?h[t]=0:h[t]=/^[\d\.]+(px|rpx)?$/.test(e)?k(e):/em$/.test(e)&&s==H?k(e,o.fontSize):e},f=0,l=Object.keys(o);f<l.length;f++)u();return h},e.setPosition=function(t,e){var i={left:"width",top:"height",right:"width",bottom:"height"};Object.keys(i).forEach((function(n){var r="right"==n?"left":"top";["right","bottom"].includes(n)&&void 0!==t.style[n]&&"number"!=typeof t.originStyle[r]?t.style[r]=e[i[n]]-t.offsetSize[i[n]]-k(t.style[n],e[i[n]]):t.style[n]=k(t.style[n],e[i[n]])}))},e.getAttributes=function(t){var e=t.attributes||{};return(t.url||t.src)&&(e.src=e.src||t.url||t.src),t.replace&&(e.replace=t.replace),t.text&&(e.text=t.text),e},e.getOffsetSize=function(t,e,i){void 0===i&&(i=u[3]);var n=e||{},r=n.margin,o=(r=void 0===r?{}:r).marginLeft,a=void 0===o?0:o,s=r.marginTop,h=void 0===s?0:s,c=r.marginRight,d=void 0===c?0:c,f=r.marginBottom,l=void 0===f?0:f,p=n.padding,v=(p=void 0===p?{}:p).paddingLeft,g=void 0===v?0:v,b=p.paddingTop,y=void 0===b?0:b,x=p.paddingRight,m=void 0===x?0:x,w=p.paddingBottom,S=void 0===w?0:w,k=n.border,z=(k=void 0===k?{}:k).borderWidth,P=void 0===z?0:z,I=n.borderTop,O=(I=void 0===I?{}:I).borderTopWidth,M=void 0===O?P:O,B=n.borderBottom,W=(B=void 0===B?{}:B).borderBottomWidth,R=void 0===W?P:W,T=n.borderRight,j=(T=void 0===T?{}:T).borderRightWidth,F=void 0===j?P:j,C=n.borderLeft,A=(C=void 0===C?{}:C).borderLeftWidth,L=void 0===A?P:A,_=a<0&&d<0?Math.abs(a+d):0,E=h<0&&l<0?Math.abs(h+l):0,H=a>=0&&d<0,$=h>=0&&l<0;return i==u[0]&&(this[i].left=t.left+a+g+L+(H?2*-d:0),this[i].top=t.top+h+y+M+($?2*-l: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+L+(H<0?-d:0),this[i].top=t.top+h+M+($?-l:0),this[i].width=t.width+g+m,this[i].height=t.height+y+S),i==u[2]&&(this[i].left=t.left+a+L/2+(H<0?-d:0),this[i].top=t.top+h+M/2+($?-l:0),this[i].width=t.width+g+m+L/2+F/2,this[i].height=t.height+y+S+R/2+M/2),i==u[3]&&(this[i].left=t.left+(H<0?-d:0),this[i].top=t.top+($?-l:0),this[i].width=t.width+g+m+L+F+a+d,this[i].height=t.height+y+S+R+M+l+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,f=void 0===d?h:d,l=o.borderBottom,p=(l=void 0===l?{}:l).borderBottomWidth,v=void 0===p?h:p,g=o.borderRight,b=(g=void 0===g?{}:g).borderRightWidth,y=void 0===b?h:b,x=o.borderLeft,m=(x=void 0===x?{}:x).borderLeftWidth,w=void 0===m?h:m,S=o.padding,k=(S=void 0===S?{}:S).paddingTop,z=void 0===k?0:k,P=S.paddingRight,I=void 0===P?0:P,O=S.paddingBottom,M=void 0===O?0:O,B=S.paddingLeft,W=void 0===B?0:B;i||(t.width-=W+I+y+w),1!==i||n||(t.height-=z+M+f+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,f=O({},this.contentSize,{left:r,top:a}),l=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 y,x=W(e.elements);!(y=x()).done;){var m=y.value;m.setPosition(m,f),m.style.left+=r+p+u,m.style.top+=a+l+c,m.getBoxPosition2()}if(i)for(var w,S=W(i);!(w=S()).done;)w.value.layout(f.top+l,f.left+p);return this.layoutBoxUpdate(f,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,f=void 0===u?0:u,l=n.bottom,p=n.right,v=n.width,g=void 0===v?0:v,b=n.minWidth,y=n.maxWidth,x=n.minHeight,m=n.maxHeight,w=n.height,S=void 0===w?0:w,z=n.fontSize,P=void 0===z?14:z,I=n.fontWeight,O=n.fontFamily,M=n.fontStyle,B=n.position,W=n.lineClamp,R=n.lineHeight,T=n.padding,F=void 0===T?{}:T,C=n.margin,L=void 0===C?{}:C,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=k(g,K)),j(g)&&!K&&(g=null),j(S)&&Z&&(S=k(S,Z)),j(S)&&!Z&&(S=null),j(b)&&K&&(b=k(b,K)),j(y)&&K&&(y=k(y,K)),j(x)&&Z&&(x=k(x,Z)),j(m)&&Z&&(m=k(m,Z)),n.padding&&null!=(t=a.contentSize)&&t.width)for(var tt in n.padding)Object.hasOwnProperty.call(n.padding,tt)&&(n.padding[tt]=k(n.padding[tt],K));var et=F.paddingRight,it=void 0===et?0:et,nt=F.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=L.marginRight,st=void 0===at?0:at,ht=L.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:O,fontSize:P,fontWeight:I,fontStyle:M});var ft=new Map;ut.split("\n").map((function(t){var i=t.split("").map((function(t){var i=ft.get(t);if(i)return i;var n=e.measureText(t,P).width;return ft.set(t,n),n})),n=e.measureText(t,P),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 lt=r.width,pt=r.height;ct.width=this.contrastSize(Math.round(lt*S/pt)||0,b,y),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,y),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 yt=r.width,xt=r.height;ct.height=this.contrastSize(k(ct.width*xt/yt)||0,x,m),this.layoutBoxUpdate(ct,n,1)}i==H&&null==S&&(R=k(R,P),ct.height=this.contrastSize(k(this.attributes.lines*R),x,m),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,y),this.layoutBoxUpdate(ct,n)),g&&!j(g)&&(ct.width=this.contrastSize(g,b,y),this.layoutBoxUpdate(ct,n,0)),S&&!j(S)&&(ct.height=this.contrastSize(ct.height,x,m),this.layoutBoxUpdate(ct,n,1));var mt=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 A).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 A).fixedBind(t):e.fixedLine?e.fixedLine.fixedAdd(t):(new A).fixedBind(t,1)})),this.lines&&(mt=this.lines.reduce((function(t,e){return t+e.height}),0))}var St=0,kt=0;if(!g&&(this.isAbsolute||this.isFixed)&&K){var zt=B==U?K:this.root.width,Pt=zt-(j(d)?k(d,zt):d)-(j(p)?k(p,zt):p);St=n.left?Pt:this.lineMaxWidth}if(!S&&(null!=f?f:this.isAbsolute||this.isFixed&&Z)){var It=B==U?Z:this.root.height,Ot=It-(j(f)?k(f,It):f)-(j(l)?k(l,It):l);kt=n.top?Ot: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,y),this.layoutBoxUpdate(ct,n,0)),S||!mt&&!kt||(ct.height=kt||this.contrastSize(mt,x,m),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]=k(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],f=[],l=[],p=[],v=[],g=[],b=2;function y(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 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++)y(t-1,i+n),y(t+1,i-n),y(t-n,i-1),y(t+n,i+1)}function m(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;r<n;r++)f[i+r]=0;for(r=0;r<e;r++){if(255!=(a=d[f[t+r]^f[i]]))for(o=1;o<n;o++)f[i+o-1]=f[i+o]^u[m(a+w[n-o])];else for(o=i;o<i+n;o++)f[o]=f[o+1];f[i+n-1]=255==a?0:u[m(a+w[0])]}}function k(t,e){var i;return t>e&&(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<e;n++)for(i=0;i<e;i++)i+n&1||k(i,n)||(p[i+n*e]^=1);break;case 1:for(n=0;n<e;n++)for(i=0;i<e;i++)1&n||k(i,n)||(p[i+n*e]^=1);break;case 2:for(n=0;n<e;n++)for(r=0,i=0;i<e;i++,r++)3==r&&(r=0),r||k(i,n)||(p[i+n*e]^=1);break;case 3:for(o=0,n=0;n<e;n++,o++)for(3==o&&(o=0),r=o,i=0;i<e;i++,r++)3==r&&(r=0),r||k(i,n)||(p[i+n*e]^=1);break;case 4:for(n=0;n<e;n++)for(r=0,o=n>>1&1,i=0;i<e;i++,r++)3==r&&(r=0,o=!o),o||k(i,n)||(p[i+n*e]^=1);break;case 5:for(o=0,n=0;n<e;n++,o++)for(3==o&&(o=0),r=0,i=0;i<e;i++,r++)3==r&&(r=0),(i&n&1)+!(!r|!o)||k(i,n)||(p[i+n*e]^=1);break;case 6:for(o=0,n=0;n<e;n++,o++)for(3==o&&(o=0),r=0,i=0;i<e;i++,r++)3==r&&(r=0),(i&n&1)+(r&&r==o)&1||k(i,n)||(p[i+n*e]^=1);break;case 7:for(o=0,n=0;n<e;n++,o++)for(3==o&&(o=0),r=0,i=0;i<e;i++,r++)3==r&&(r=0),(r&&r==o)+(i+n&1)&1||k(i,n)||(p[i+n*e]^=1)}}function P(t){var e,i=0;for(e=0;e<=t;e++)g[e]>=5&&(i+=3+g[e]-5);for(e=3;e<t-1;e+=2)g[e-2]==g[e+2]&&g[e+2]==g[e-1]&&g[e-1]==g[e+1]&&3*g[e-1]==g[e]&&(0==g[e-3]||e+3>t||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;i<e-1;i++)for(t=0;t<e-1;t++)(p[t+e*i]&&p[t+1+e*i]&&p[t+e*(i+1)]&&p[t+1+e*(i+1)]||!(p[t+e*i]||p[t+1+e*i]||p[t+e*(i+1)]||p[t+1+e*(i+1)]))&&(a+=3);for(i=0;i<e;i++){for(g[0]=0,n=r=t=0;t<e;t++)(o=p[t+e*i])==r?g[n]++:g[++n]=1,s+=(r=o)?1:-1;a+=P(n)}s<0&&(s=-s);var h=s,c=0;for(h+=h<<2,h<<=1;h>e*e;)h-=e*e,c++;for(a+=10*c,t=0;t<e;t++){for(g[0]=0,n=r=i=0;i<e;i++)(o=p[t+e*i])==r?g[n]++:g[++n]=1,r=o;a+=P(n)}return a}var O=null;return{api:{get ecclevel(){return b},set ecclevel(t){b=t},get size(){return _size},set size(t){_size=t},get canvas(){return O},set canvas(t){O=t},getFrame:function(g){return function(g){var P,O,M,B,W,R,T,j;B=g.length,t=0;do{if(t++,M=4*(b-1)+16*(t-1),i=c[M++],n=c[M++],r=c[M++],o=c[M],B<=(M=r*(i+n)+n-3+(t<=9)))break}while(t<40);for(e=17+4*t,W=r+(r+o)*(i+n)+n,B=0;B<W;B++)l[B]=0;for(f=g.slice(0),B=0;B<e*e;B++)p[B]=0;for(B=0;B<(e*(e+1)+1)/2;B++)v[B]=0;for(B=0;B<3;B++){for(M=0,O=0,1==B&&(M=e-7),2==B&&(O=e-7),p[O+3+e*(M+3)]=1,P=0;P<6;P++)p[O+P+e*M]=1,p[O+e*(M+P+1)]=1,p[O+6+e*(M+P)]=1,p[O+P+1+e*(M+6)]=1;for(P=1;P<5;P++)y(O+P,M+1),y(O+1,M+P+1),y(O+5,M+P),y(O+P+1,M+5);for(P=2;P<4;P++)p[O+P+e*(M+2)]=1,p[O+2+e*(M+P+1)]=1,p[O+4+e*(M+P)]=1,p[O+P+1+e*(M+4)]=1}if(t>1)for(B=a[t],O=e-7;;){for(P=e-7;P>B-3&&(x(P,O),!(P<B));)P-=B;if(O<=B+9)break;x(6,O-=B),x(O,6)}for(p[8+e*(e-8)]=1,O=0;O<7;O++)y(7,O),y(e-8,O),y(7,O+e-7);for(P=0;P<8;P++)y(P,7),y(P+e-8,7),y(P,e-8);for(P=0;P<9;P++)y(P,8);for(P=0;P<8;P++)y(P+e-8,8),y(8,P);for(O=0;O<7;O++)y(8,O+e-7);for(P=0;P<e-14;P++)1&P?(y(8+P,6),y(6,8+P)):(p[8+P+6*e]=1,p[6+e*(8+P)]=1);if(t>6)for(B=s[t-7],M=17,P=0;P<6;P++)for(O=0;O<3;O++,M--)1&(M>11?t>>M-12:B>>M)?(p[5-P+e*(2-O+e-11)]=1,p[2-O+e-11+e*(5-P)]=1):(y(5-P,2-O+e-11),y(2-O+e-11,5-P));for(O=0;O<e;O++)for(P=0;P<=O;P++)p[P+e*O]&&y(P,O);for(W=f.length,R=0;R<W;R++)l[R]=f.charCodeAt(R);if(f=l.slice(0),W>=(P=r*(i+n)+n)-2&&(W=P-2,t>9&&W--),R=W,t>9){for(f[R+2]=0,f[R+3]=0;R--;)B=f[R],f[R+3]|=255&B<<4,f[R+2]=B>>4;f[2]|=255&W<<4,f[1]=W>>4,f[0]=64|W>>12}else{for(f[R+1]=0,f[R+2]=0;R--;)B=f[R],f[R+2]|=255&B<<4,f[R+1]=B>>4;f[1]|=255&W<<4,f[0]=64|W>>4}for(R=W+3-(t<10);R<P;)f[R++]=236,f[R++]=17;for(w[0]=1,R=0;R<o;R++){for(w[R+1]=1,T=R;T>0;T--)w[T]=w[T]?w[T-1]^u[m(d[w[T]]+R)]:w[T-1];w[0]=u[m(d[w[0]]+R)]}for(R=0;R<=o;R++)w[R]=d[w[R]];for(M=P,O=0,R=0;R<i;R++)S(O,r,M,o),O+=r,M+=o;for(R=0;R<n;R++)S(O,r+1,M,o),O+=r+1,M+=o;for(O=0,R=0;R<r;R++){for(T=0;T<i;T++)l[O++]=f[R+T*r];for(T=0;T<n;T++)l[O++]=f[i*r+R+T*(r+1)]}for(T=0;T<n;T++)l[O++]=f[i*r+R+T*(r+1)];for(R=0;R<o;R++)for(T=0;T<i+n;T++)l[O++]=f[P+R+T*o];for(f=l,P=O=e-1,M=W=1,j=(r+o)*(i+n)+n,R=0;R<j;R++)for(B=f[R],T=0;T<8;T++,B<<=1){128&B&&(p[P+e*O]=1);do{W?P--:(P++,M?0!=O?O--:(M=!M,6==(P-=2)&&(P--,O=9)):O!=e-1?O++:(M=!M,6==(P-=2)&&(P--,O-=8))),W=!W}while(k(P,O))}for(f=p.slice(0),B=0,O=3e4,M=0;M<8&&(z(M),(P=I())<O&&(O=P,B=M),7!=B);M++)p=f.slice(0);for(B!=M&&z(B),O=h[B+(b-1<<3)],M=0;M<8;M++,O>>=1)1&O&&(p[e-1-M+8*e]=1,M<6?p[8+e*M]=1:p[8+e*(M+1)]=1);for(M=0;M<7;M++,O>>=1)1&O&&(p[8+e*(e-7+M)]=1,M?p[6-M+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<n;i++)(r=t.charCodeAt(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 f=r.color,l=void 0===f?"#000000":f;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(l);for(var y=0;y<e;y++)for(var x=0;x<e;x++)v[x*e+y]&&a.fillRect(d+g*y,u+g*x,g,g);a.restore(),i.setBorder(n,r)}else console.warn("No canvas provided to draw QR code in!")}}}}(),G=l,Q=v,K=f,Z="middle",et=function(){function t(t,e){var i,n=this;this.v="1.9.3.4",this.id=null,this.pixelRatio=1,this.width=0,this.height=0,this.sleep=1e3/30,this.count=0,this.isRate=!1,this.isDraw=!0,this.isCache=!0,this.fixed="",this.useCORS=!1,this.imageBus=[],this.createImage=function(t,e){return new Promise((function(i,r){var o=null;o=n.canvas.createImage?n.canvas.createImage():new Image,e&&o.setAttribute("crossOrigin","Anonymous"),o.src=t,o.onload=function(){i({width:o.naturalWidth||o.width,height:o.naturalHeight||o.height,path:o,src:this.src})},o.onerror=function(t){r(t)}}))},this.options=t,Object.assign(this,t),this.component=e,this.ctx=((i=t.context).setFonts=function(t){var e=t.fontFamily,n=void 0===e?"sans-serif":e,r=t.fontSize,o=void 0===r?14:r,a=t.fontWeight,s=void 0===a?"normal":a,h=t.fontStyle,c=void 0===h?"normal":h;x==d.MP_TOUTIAO&&(s="bold"==s?"bold":"",c="italic"==c?"italic":""),i.font="".concat(c," ").concat(s," ").concat(Math.round(o),"px ").concat(n)},i.draw&&i.setFillStyle?i:Object.assign(i,{setStrokeStyle:function(t){i.strokeStyle=t},setLineWidth:function(t){i.lineWidth=t},setLineCap:function(t){i.lineCap=t},setFillStyle:function(t){i.fillStyle=t},setFontSize:function(t){i.font="".concat(String(t),"px sans-serif")},setGlobalAlpha:function(t){i.globalAlpha=t},setLineJoin:function(t){i.lineJoin=t},setTextAlign:function(t){i.textAlign=t},setMiterLimit:function(t){i.miterLimit=t},setShadow:function(t,e,n,r){i.shadowOffsetX=t,i.shadowOffsetY=e,i.shadowBlur=n,i.shadowColor=r},setTextBaseline:function(t){i.textBaseline=t},createCircularGradient:function(){},draw:function(){}})),this.progress=0,this.root={width:t.width,height:t.height,fontSizeRate:1,fixedLine:null},this.size=this.root,this.init();var r=0;Object.defineProperty(this,"progress",{configurable:!0,set:function(t){r=t,n.lifecycle("onProgress",t/n.count)},get:function(){return r||0}})}return t.prototype.lifecycle=function(t,e){this.options.listen&&this.options.listen[t]&&this.options.listen[t](e)},t.prototype.init=function(t){t&&(this.ctx=t),(this.canvas.height||d.WEB==x)&&(this.canvas.height=this.size.height*this.pixelRatio,this.canvas.width=this.size.width*this.pixelRatio,this.ctx.scale(this.pixelRatio,this.pixelRatio))},t.prototype.clear=function(){this.ctx.clearRect(0,0,this.size.width,this.size.height)},t.prototype.clipPath=function(t,e,i,n,r,o,a){void 0===o&&(o=!1),void 0===a&&(a=!1);var s=this.ctx;if(/polygon/.test(r)){var h=r.match(/-?\d+(rpx|px|%)?\s+-?\d+(rpx|px|%)?/g)||[];s.beginPath(),h.map((function(r){var o=r.split(" "),a=o[0],s=o[1];return[k(a,i)+t,k(s,n)+e]})).forEach((function(t,e){0==e?s.moveTo(t[0],t[1]):s.lineTo(t[0],t[1])})),s.closePath(),a&&s.stroke(),o&&s.fill()}},t.prototype.roundRect=function(t,e,i,n,r,o,a){if(void 0===o&&(o=!1),void 0===a&&(a=!1),!(r<0)){var s=this.ctx;if(s.beginPath(),r){var h=r||{},c=h.borderTopLeftRadius,d=void 0===c?r||0:c,u=h.borderTopRightRadius,f=void 0===u?r||0:u,l=h.borderBottomRightRadius,p=void 0===l?r||0:l,v=h.borderBottomLeftRadius,g=void 0===v?r||0:v;s.arc(t+i-p,e+n-p,p,0,.5*Math.PI),s.lineTo(t+g,e+n),s.arc(t+g,e+n-g,g,.5*Math.PI,Math.PI),s.lineTo(t,e+d),s.arc(t+d,e+d,d,Math.PI,1.5*Math.PI),s.lineTo(t+i-f,e),s.arc(t+i-f,e+f,f,1.5*Math.PI,2*Math.PI),s.lineTo(t+i,e+n-p)}else s.rect(t,e,i,n);s.closePath(),a&&s.stroke(),o&&s.fill()}},t.prototype.setTransform=function(t,e){var i=e.transform,n=e.transformOrigin,r=this.ctx,o=i||{},a=o.scaleX,s=void 0===a?1:a,h=o.scaleY,c=void 0===h?1:h,d=o.translateX,u=void 0===d?0:d,f=o.translateY,l=void 0===f?0:f,p=o.rotate,v=void 0===p?0:p,g=o.skewX,b=void 0===g?0:g,y=o.skewY,x=void 0===y?0:y,m=t.left,w=t.top,z=t.width,P=t.height;u=k(u,z)||0,l=k(l,P)||0;var I={top:k("0%",1),center:k("50%",1),bottom:k("100%",1)},O={left:k("0%",1),center:k("50%",1),right:k("100%",1)};if(n=n.split(" ").filter((function(t,e){return e<2})).reduce((function(t,e){if(/\d+/.test(e)){var i=k(e,1)/(/px|rpx$/.test(e)?S(t.x)?P:z:1);return S(t.x)?Object.assign(t,{y:i}):Object.assign(t,{x:i})}return S(O[e])&&!S(t.x)?Object.assign(t,{x:O[e]}):Object.assign(t,{y:I[e]||.5})}),{}),(u||l)&&r.translate(u,l),(s||c)&&r.scale(s,c),v){var M=m+z*n.x,B=w+P*n.y;r.translate(M,B),r.rotate(v*Math.PI/180),r.translate(-M,-B)}(b||x)&&r.transform(1,Math.tan(x*Math.PI/180),Math.tan(b*Math.PI/180),1,0,0)},t.prototype.setBackground=function(t,e,i,n,r){var o=this.ctx;t&&"transparent"!=t?function(t){return!(!t||!t.startsWith("linear")&&!t.startsWith("radial"))}(t)?function(t,e,i,n,r,o){t.startsWith("linear")?function(t,e,i,n,r,o){for(var a=function(t,e,i,n,r){void 0===n&&(n=0),void 0===r&&(r=0);var o=t.match(/([-]?\d{1,3})deg/),a=o&&o[1]?parseFloat(o[1]):0;if(a>=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,f=0;if(a<s||a>180-s&&a<180||a>180&&a<180+s||a>360-s){var l=a*Math.PI/180,p=a<s||a>360-s?i/2:-i/2,v=Math.tan(l)*p,g=a<s||a>180-s&&a<180?e/2-v:-e/2-v;c=-(u=v+(h=Math.pow(Math.sin(l),2)*g)),d=-(f=p+h/Math.tan(l))}(a>s&&a<90||a>90&&a<90+s||a>180+s&&a<270||a>270&&a<360-s)&&(l=(90-a)*Math.PI/180,v=a>s&&a<90||a>90&&a<90+s?e/2:-e/2,p=Math.tan(l)*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(l),2)*g)/Math.tan(l)),d=-(f=p+h));return c=Math.round(c+e/2)+n,d=Math.round(i/2-d)+r,u=Math.round(u+e/2)+n,f=Math.round(i/2-f)+r,{x0:c,y0:d,x1:u,y1:f}}(r,t,e,i,n),s=a.x0,h=a.y0,c=a.x1,d=a.y1,u=o.createLinearGradient(s,h,c,d),f=r.match(/linear-gradient\((.+)\)/)[1],l=P(f.substring(f.indexOf(",")+1)),p=0;p<l.colors.length;p++)u.addColorStop(l.percents[p],l.colors[p]);o.setFillStyle(u)}(e,i,n,r,t,o):t.startsWith("radial")&&function(t,e,i,n,r,o){for(var a=P(r.match(/radial-gradient\((.+)\)/)[1]),s=Math.round(t/2)+i,h=Math.round(e/2)+n,c=o.createRadialGradient(s,h,0,s,h,Math.max(t,e)/2),d=0;d<a.colors.length;d++)c.addColorStop(a.percents[d],a.colors[d]);o.setFillStyle(c)}(e,i,n,r,t,o)}(t,e,i,n,r,o):o.setFillStyle(t):[d.MP_TOUTIAO,d.MP_BAIDU].includes(x)?o.setFillStyle("rgba(0,0,0,0)"):o.setFillStyle("transparent")},t.prototype.setShadow=function(t){var e=t.boxShadow,i=void 0===e?[]:e,n=this.ctx;if(i.length){var r=i[0],o=i[1],a=i[2],s=i[3];n.setShadow(r,o,a,s)}},t.prototype.setBorder=function(t,e){var i=this.ctx,n=t.width,r=t.height,o=t.left,a=t.top,s=e.border,h=e.borderBottom,c=e.borderTop,d=e.borderRight,u=e.borderLeft,f=e.borderRadius,l=e.lineCap,p=s||{},v=p.borderWidth,g=void 0===v?0:v,b=p.borderStyle,y=p.borderColor,m=h||{},w=m.borderBottomWidth,S=void 0===w?g:w,k=m.borderBottomStyle,z=void 0===k?b:k,P=m.borderBottomColor,I=void 0===P?y:P,O=c||{},M=O.borderTopWidth,B=void 0===M?g:M,W=O.borderTopStyle,R=void 0===W?b:W,T=O.borderTopColor,j=void 0===T?y:T,F=d||{},C=F.borderRightWidth,A=void 0===C?g:C,L=F.borderRightStyle,_=void 0===L?b:L,E=F.borderRightColor,H=void 0===E?y:E,$=u||{},D=$.borderLeftWidth,N=void 0===D?g:D,U=$.borderLeftStyle,Y=void 0===U?b:U,X=$.borderLeftColor,J=void 0===X?y:X,V=f||{},q=V.borderTopLeftRadius,G=void 0===q?f||0:q,Q=V.borderTopRightRadius,K=void 0===Q?f||0:Q,Z=V.borderBottomRightRadius,tt=void 0===Z?f||0:Z,et=V.borderBottomLeftRadius,it=void 0===et?f||0:et;if(h||u||c||d||s){var nt=function(t,e,n){"dashed"==e?/mp/.test(x)?i.setLineDash([Math.ceil(4*t/3),Math.ceil(4*t/3)]):i.setLineDash([Math.ceil(6*t),Math.ceil(6*t)]):"dotted"==e&&i.setLineDash([t,t]),i.setStrokeStyle(n)},rt=function(t,e,n,r,o,a,s,h,c,d,u,f,p,v,g){i.save(),i.setLineCap(g?"square":l),i.setLineWidth(f),nt(f,p,v),i.beginPath(),i.arc(t,e,s,Math.PI*c,Math.PI*d),i.lineTo(n,r),i.arc(o,a,h,Math.PI*d,Math.PI*u),i.stroke(),i.restore()};if(i.save(),s&&!h&&!u&&!c&&!d)return i.setLineWidth(g),nt(g,b,y),this.roundRect(o,a,n,r,f,!1,!!y),void i.restore();S&&rt(o+n-tt,a+r-tt,o+it,a+r,o+it,a+r-it,tt,it,.25,.5,.75,S,z,I,N&&A),N&&rt(o+it,a+r-it,o,a+G,o+G,a+G,it,G,.75,1,1.25,N,Y,J,B&&S),B&&rt(o+G,a+G,o+n-K,a,o+n-K,a+K,G,K,1.25,1.5,1.75,B,R,j,N&&A),A&&rt(o+n-K,a+K,o+n,a+r-tt,o+n-tt,a+r-tt,K,tt,1.75,2,.25,A,_,H,B&&S)}},t.prototype.setOpacity=function(t){var e=t.opacity,i=void 0===e?1:e;this.ctx.setGlobalAlpha(i)},t.prototype.drawPattern=function(t,e,i){return a(this,void 0,void 0,(function(){var n=this;return s(this,(function(r){return[2,new Promise((function(r,o){n.drawView(e,i,!0,!1,!0);var a=n,s=a.ctx;a.canvas;var h=e.width,c=e.height,d=e.left,u=e.top,f=i||{},l=f.borderRadius,p=void 0===l?0:l,v=f.backgroundImage,g=f.backgroundRepeat,b=void 0===g?"repeat":g;v&&function(t){var o=s.createPattern(t.src,b);s.setFillStyle(o),n.roundRect(d,u,h,c,p,!0,!1),n.setBorder(e,i),r()}(t)}))]}))}))},t.prototype.drawView=function(t,e,i,n,r){void 0===i&&(i=!0),void 0===n&&(n=!0),void 0===r&&(r=!0);var o=this.ctx,a=t.width,s=t.height,h=t.left,c=t.top,d=e||{},u=d.borderRadius,f=void 0===u?0:u,l=d.backgroundColor,p=void 0===l?"transparent":l,v=d.overflow;e.opacity&&this.setOpacity(e),this.setTransform(t,e),r&&(o.save(),this.setShadow(e)),i&&this.setBackground(p,a,s,h,c),e.clipPath?this.clipPath(h,c,a,s,e.clipPath,i,!1):this.roundRect(h,c,a,s,f,i,!1),r&&o.restore(),n&&this.setBorder(t,e),"hidden"==v&&o.clip()},t.prototype.drawImage=function(t,e,i,n){return void 0===e&&(e={}),void 0===i&&(i={}),void 0===n&&(n=!0),a(this,void 0,void 0,(function(){var r=this;return s(this,(function(o){switch(o.label){case 0:return[4,new Promise((function(o,h){return a(r,void 0,void 0,(function(){var r,a,h,c,u,f,l,p,v,g,b,y,m,w,S,P,I,O,M,B,W,R=this;return s(this,(function(s){return r=this.ctx,a=i.borderRadius,h=void 0===a?0:a,c=i.backgroundColor,u=void 0===c?"transparent":c,f=i.objectFit,l=void 0===f?"fill":f,p=i.backgroundSize,v=void 0===p?"fill":p,g=i.objectPosition,b=i.backgroundPosition,y=i.boxShadow,i.backgroundImage&&(l=v,g=b),y&&this.drawView(e,Object.assign(i,{backgroundColor:u||y&&(u||"#ffffff")}),!0,!1,!0),m=e.width,w=e.height,S=e.left,P=e.top,r.save(),I=e.contentSize.left-e.borderSize.left,O=e.contentSize.top-e.borderSize.top,n||(this.setOpacity(i),this.setTransform(e,i),this.setBackground(u,m,w,S,P),this.roundRect(S,P,m,w,h,!!(h||!y&&u),!1)),S+=I,P+=O,r.clip(),M=function(t){if("fill"!==l){var i=function(t,e,i){var n=t.objectFit,r=t.objectPosition,o=e.width/e.height,a=i.width/i.height,s=1;"contain"==n&&o>=a||"cover"==n&&o<a?s=e.height/i.height:("contain"==n&&o<a||"cover"==n&&o>=a)&&(s=e.width/i.width);var h=i.width*s,c=i.height*s,d=r||[],u=d[0],f=d[1],l=/^\d+px|rpx$/.test(u)?k(u,e.width):(e.width-h)*(z(u)?k(u,1):{left:0,center:.5,right:1}[u||"center"]),p=/^\d+px|rpx$/.test(f)?k(f,e.height):(e.height-c)*(z(f)?k(f,1):{top:0,center:.5,bottom:1}[f||"center"]),v=function(t,e){return[(t-l)/s,(e-p)/s]},g=v(0,0),b=g[0],y=g[1],x=v(e.width,e.height),m=x[0],w=x[1];return{sx:Math.max(b,0),sy:Math.max(y,0),sw:Math.min(m-b,i.width),sh:Math.min(w-y,i.height),dx:Math.max(l,0),dy:Math.max(p,0),dw:Math.min(h,e.width),dh:Math.min(c,e.height)}}({objectFit:l,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,f=i.dw;x==d.MP_BAIDU?r.drawImage(t.src,h+S,c+P,f,u,n,o,s,a):r.drawImage(t.src,n,o,s,a,h+S,c+P,f,u)}else r.drawImage(t.src,S,P,m,w)},B=function(){r.restore(),R.drawView(e,i,!1,!0,!1),o(1)},W=function(t){M(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,f=a.top-o.top,l=i.color,p=void 0===l?"#000000":l,v=i.lineHeight,g=void 0===v?"1.4em":v,b=i.fontSize,y=void 0===b?14:b,x=i.fontWeight,m=i.fontFamily,w=i.fontStyle,S=i.textAlign,z=void 0===S?"left":S,P=i.verticalAlign,I=void 0===P?Z:P,O=i.backgroundColor,M=i.lineClamp,B=i.backgroundClip,W=i.textShadow,R=i.textDecoration;if(this.drawView(e,i,B!=G),g=k(g,y),t){switch(r.save(),this.setShadow({boxShadow:W}),s+=u,h+=f,r.setFonts({fontFamily:m,fontSize:y,fontWeight:x,fontStyle:w}),r.setTextBaseline(Z),r.setTextAlign(z),B?this.setBackground(O,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 F=n.fontHeight,C=n.descent,A=(g-F)/2,L=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*y+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(y/13),r.beginPath();var a=.1*n.fontHeight;/\bunderline\b/.test(R)&&(C||(e+=A/2),r.moveTo(t,e+a),r.lineTo(o,e+a)),/\boverline\b/.test(R)&&(C||(e-=A/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=L(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>=M)break;if(U=s,tt>a.width||q||Q){if(X++,Y=Q&&tt<=a.width?K:Y,X===M&&tt>c){for(;r.measureText("".concat(Y,"...")).width>a.width&&!(Y.length<=1);)Y=Y.substring(0,Y.length-1);Y+="..."}var et=L(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,f,l,p,v,g,b,y,x,m,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:"",f=/url\((.+)\)/,c&&(null===(i=f.exec(c))||void 0===i?void 0:i[1])&&(u=(null===(n=f.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 l=s.sent(),p=l.width,v=l.height,!(g=l.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,y=new V(t,e,this.root,this.ctx),!(x=t.views||t.children))return[3,8];m=0,s.label=5;case 5:return m<x.length?(w=x[m],[4,this.create(w,y)]):[3,8];case 6:(S=s.sent())&&y.add(S),s.label=7;case 7:return m++,[3,5];case 8:return[2,y]}}))}))},t.prototype.drawNode=function(t,e){return void 0===e&&(e=!1),a(this,void 0,void 0,(function(){var i,n,r,o,a,h,c,d,u,f,l,p,v,g,b,y,x,m,w,S;return s(this,(function(s){switch(s.label){case 0:return i=t.layoutBox,n=t.computedStyle,r=t.attributes,o=t.name,a=t.children,h=t.fixedLine,c=t.attributes,d=c.src,u=c.text,["fixed"].includes(n.position)&&!e?[2]:(this.ctx.save(),o!==K?[3,7]:d?n.backgroundRepeat?[4,this.drawPattern(r,i,n)]:[3,2]:[3,5]);case 1:return s.sent(),[3,4];case 2:return[4,this.drawImage(r,i,n,!1)];case 3:s.sent(),s.label=4;case 4:return[3,6];case 5:this.drawView(i,n),s.label=6;case 6:return[3,10];case 7:return"image"===o&&d?[4,this.drawImage(r,i,n,!1)]:[3,9];case 8:return s.sent(),[3,10];case 9:o===G?this.drawText(u,i,n,r):o===Q&&q.api&&q.api.draw(u,this,i,n),s.label=10;case 10:if(this.progress+=1,l=(f=h||{}).beforeElements,p=f.afterElements,!l)return[3,14];v=0,g=l,s.label=11;case 11:return v<g.length?(S=g[v],[4,this.drawNode(S)]):[3,14];case 12:s.sent(),s.label=13;case 13:return v++,[3,11];case 14:if(!a)return[3,18];b=Object.values?Object.values(a):Object.keys(a).map((function(t){return a[t]})),y=0,x=b,s.label=15;case 15:return y<x.length?"absolute"===(S=x[y]).computedStyle.position?[3,17]:[4,this.drawNode(S)]:[3,18];case 16:s.sent(),s.label=17;case 17:return y++,[3,15];case 18:if(!p)return[3,22];m=0,w=p,s.label=19;case 19:return m<w.length?(S=w[m],[4,this.drawNode(S)]):[3,22];case 20:s.sent(),s.label=21;case 21:return m++,[3,19];case 22:return this.ctx.restore(),[2]}}))}))},t.prototype.render=function(t){var e=this;return void 0===t&&(t=30),new Promise((function(i,n){return a(e,void 0,void 0,(function(){var e,r,o,a,h,c,d,u,f,l;return s(this,(function(s){switch(s.label){case 0:return e=+new Date,this.init(),[4,(p=t,void 0===p&&(p=0),new Promise((function(t){return setTimeout(t,p)})))];case 1:s.sent(),s.label=2;case 2:if(s.trys.push([2,14,,15]),!this.node)return[3,12];if(r=this.root.fixedLine||{},o=r.beforeElements,a=r.afterElements,!o)return[3,6];h=0,c=o,s.label=3;case 3:return h<c.length?(f=c[h],[4,this.drawNode(f,!0)]):[3,6];case 4:s.sent(),s.label=5;case 5:return h++,[3,3];case 6:return[4,this.drawNode(this.node)];case 7:if(s.sent(),!a)return[3,11];d=0,u=a,s.label=8;case 8:return d<u.length?(f=u[d],[4,this.drawNode(f,!0)]):[3,11];case 9:s.sent(),s.label=10;case 10:return d++,[3,8];case 11:return i(this.node),[3,13];case 12:this.lifecycle("onEffectFail","node is empty"),s.label=13;case 13:return[3,15];case 14:return l=s.sent(),this.lifecycle("onEffectFail",l),n(l),[3,15];case 15:return console.log("渲染用时:"+(+new Date-e-30)+"ms"),[2]}var p}))}))}))},t.prototype.onEffectFinished=function(){var t=this,e=Object.keys(this.imageBus).map((function(e){return t.imageBus[e]}));return Promise.all(e)},t.prototype.destroy=function(){this.node=[]},t.prototype.save=function(t){try{var e=t||{},i=e.fileType,n=void 0===i?"png":i,r=e.quality,o=void 0===r?1:r;return this.canvas.toDataURL("image/".concat(n),o)}catch(t){return this.lifecycle("onEffectFail","image cross domain"),t}},t}();e.default=e.Painter=et,d.WEB==x&&(window.Painter=et)},db90:function(t,e,i){"use strict";i("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},i("a4d3"),i("e01a"),i("d3b7"),i("d28b"),i("3ca3"),i("ddb0"),i("a630")},df09:function(t,e,i){"use strict";i.r(e);var n=i("5d5c"),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},f183:function(t,e,i){var n=i("23e7"),r=i("e330"),o=i("d012"),a=i("861d"),s=i("1a2d"),h=i("9bf2").f,c=i("241c"),d=i("057f"),u=i("4fad"),f=i("90e3"),l=i("bb2f"),p=!1,v=f("meta"),g=0,b=function(t){h(t,v,{value:{objectID:"O"+g++,weakData:{}}})},y=t.exports={enable:function(){y.enable=function(){},p=!0;var t=c.f,e=r([].splice),i={};i[v]=1,t(i).length&&(c.f=function(i){for(var n=t(i),r=0,o=n.length;r<o;r++)if(n[r]===v){e(n,r,1);break}return n},n({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:d.f}))},fastKey:function(t,e){if(!a(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!s(t,v)){if(!u(t))return"F";if(!e)return"E";b(t)}return t[v].objectID},getWeakData:function(t,e){if(!s(t,v)){if(!u(t))return!0;if(!e)return!1;b(t)}return t[v].weakData},onFreeze:function(t){return l&&p&&u(t)&&!s(t,v)&&b(t),t}};o[v]=!0}}]); |