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
42 KiB
1 lines
42 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-home-sign"],{"009a":function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return i}));var i={lSignature:n("afa7").default},a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",{staticClass:"sign"},[n("v-uni-view",{staticStyle:{width:"100vw",height:"100vh"}},[n("l-signature",{ref:"signatureRef",attrs:{disableScroll:!0,backgroundColor:"#ddd",penColor:t.penColor,penSize:t.penSize,landscape:!0,openSmooth:t.openSmooth}})],1),n("v-uni-view",{staticClass:"btn"},[n("v-uni-button",{on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.onClick("clear")}}},[t._v("清空")]),n("v-uni-button",{on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.onClick("undo")}}},[t._v("撤消")]),n("v-uni-button",{on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.onClick("save")}}},[t._v("保存")])],1)],1)},r=[]},"1dac":function(t,e,n){var i=n("2ede");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var a=n("4f06").default;a("3672c525",i,!0,{sourceMap:!1,shadowMode:!1})},"24db":function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("a9e3");var i={styles:String,disableScroll:{type:Boolean,default:!0},type:{type:String,default:"2d"},penColor:{type:String,default:"black"},penSize:{type:Number,default:2},backgroundColor:String,openSmooth:Boolean,minLineWidth:{type:Number,default:2},maxLineWidth:{type:Number,default:6},minSpeed:{type:Number,default:1.5},maxWidthDiffRate:{type:Number,default:20},maxHistoryLength:{type:Number,default:20},beforeDelay:{type:Number,default:0},landscape:{type:Boolean},boundingBox:{type:Boolean}};e.default=i},"2c89":function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.userRegister=e.updateUserInfo=e.smsSend=e.smsCheck=e.privacyPolicy=e.orderPay=e.orderDetail=e.logout=e.loginApi=e.getgoodsDetail=e.getWarehouseList=e.getUserProfitStatistic=e.getUserProfitList=e.getUserInfo=e.getUserFansStatistic=e.getUserFansOrderStatistic=e.getUserFansOrderList=e.getUserFansList=e.getUserCommissionStatistic=e.getUserCommissionList=e.getUserCommissionApi=e.getSellerOrderList=e.getGoodsList=e.getBuyerOrderList=e.getArea=e.getAddrList=e.getAddrDesc=e.forgetPsw=e.editAddr=e.deleteAddr=e.createOrder=e.couponList=e.changePassword=e.cancelOrder=e.addAddr=void 0;var i=uni.$u.http;e.smsSend=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i.post("/api/sms/send",t,e)};e.smsCheck=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i.post("/api/sms/check",t,e)};e.userRegister=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i.post("/api/user/register",t,e)};e.loginApi=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i.post("/api/user/login",t,e)};e.privacyPolicy=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i.post("/addons/shopro/data.richtext/index",t,e)};e.forgetPsw=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i.post("/api/user/resetpwd",t,e)};e.getUserInfo=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/api/user/getUserinfo",t,e)};e.getAddrList=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/addons/shopro/user.address/index",t,e)};e.getArea=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/addons/shopro/data.area/index",t,e)};e.addAddr=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/addons/shopro/user.address/add",t,e)};e.editAddr=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/addons/shopro/user.address/edit",t,e)};e.deleteAddr=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/addons/shopro/user.address/delete",t,e)};e.getAddrDesc=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/addons/shopro/user.address/detail",t,e)};e.changePassword=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/addons/shopro/user.user/changePassword",t,e)};e.logout=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/api/user/logout",t,e)};e.updateUserInfo=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/api/user/updateUserInfo",t,e)};e.couponList=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/addons/shopro/user.coupon/index",t,e)};e.getUserCommissionStatistic=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/api/user/getUserCommissionStatistic",t,e)};e.getUserCommissionApi=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/api/user/getUserCommission",t,e)};e.getUserCommissionList=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/api/user/getUserCommissionList",t,e)};e.getUserFansStatistic=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/api/user/getUserFansStatistic",t,e)};e.getUserFansList=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/api/user/getUserFansList",t,e)};e.getUserFansOrderStatistic=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/api/user/getUserFansOrderStatistic",t,e)};e.getUserFansOrderList=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/api/user/getUserFansOrderList",t,e)};e.getUserProfitStatistic=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/api/user/getUserProfitStatistic",t,e)};e.getUserProfitList=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/api/user/getUserProfitList",t,e)};e.getWarehouseList=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/api/order/getWarehouseList",t,e)};e.getGoodsList=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/api/order/getGoodsList",t,e)};e.getgoodsDetail=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/api/order/goodsDetail",t,e)};e.getBuyerOrderList=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.get("/api/order/getBuyerOrderList",{params:t},e)};e.getSellerOrderList=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.get("/api/order/getSellerOrderList",{params:t},e)};e.createOrder=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/api/order/createOrder",t,e)};e.cancelOrder=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/api/order/cancelOrder",t,e)};e.orderDetail=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.get("/api/order/orderDetail",{params:t},e)};e.orderPay=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.get("/api/order/orderPay",{params:t},e)}},"2ede":function(t,e,n){var i=n("24fb");e=i(!1),e.push([t.i,'@charset "UTF-8";\r\n/**\r\n * 这里是uni-app内置的常用样式变量\r\n *\r\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\r\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\r\n *\r\n */\r\n/**\r\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\r\n *\r\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\r\n */\r\n/* 颜色变量 */\r\n/* 主要颜色 */\r\n/* 行为相关颜色 */\r\n/* 文字基本颜色 */\r\n/* 背景颜色 */\r\n/* 边框颜色 */\r\n/* 尺寸变量 */\r\n/* 文字尺寸 */\r\n/* 图片尺寸 */\r\n/* Border Radius */\r\n/* 水平间距 */\r\n/* 垂直间距 */\r\n/* 透明度 */\r\n/* 文章场景相关 */.lime-signature[data-v-65d7357f],\r\n.lime-signature__canvas[data-v-65d7357f]{width:100%;height:100%}.offscreen[data-v-65d7357f]{position:fixed;top:0;left:9999px}',""]),t.exports=e},3654:function(t,e,n){"use strict";n.r(e);var i=n("009a"),a=n("f8c4");for(var r in a)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(r);n("c766");var o=n("f0c5"),s=Object(o["a"])(a["default"],i["b"],i["c"],!1,null,"5739059a",null,!1,i["a"],void 0);e["default"]=s.exports},"4c18":function(t,e,n){"use strict";n("7a82");var i=n("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.uniContext=e.toDataURL=e.createImage=void 0,e.useCurrentPage=function(){var t=getCurrentPages();return t[t.length-1]};var a=i(n("5530")),r=i(n("d4ec")),o=i(n("bee2"));n("99af"),n("d3b7");e.uniContext=function(t,e){var n=uni.createCanvasContext(t,e);return n.uniDrawImage||(n.uniDrawImage=n.drawImage,n.drawImage=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),a=1;a<e;a++)i[a-1]=arguments[a];n.uniDrawImage.apply(n,[t.src].concat(i))}),n.getImageData||(n.getImageData=function(n,i,a,r){return new Promise((function(o,s){e.proxy&&(e=e.proxy),uni.canvasGetImageData({canvasId:t,x:n,y:i,width:a,height:r,success:function(t){o(t)},fail:function(t){s(t)}},e)}))}),n};var s=function(){function t(){(0,r.default)(this,t),this.currentSrc=null,this.naturalHeight=0,this.naturalWidth=0,this.width=0,this.height=0,this.tagName="IMG"}return(0,o.default)(t,[{key:"src",get:function(){return this.currentSrc},set:function(t){var e=this;this.currentSrc=t,uni.getImageInfo({src:t,success:function(t){e.naturalWidth=e.width=t.width,e.naturalHeight=e.height=t.height,e.onload()},fail:function(){e.onerror()}})}}]),t}();e.createImage=function(){return new s};e.toDataURL=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Promise((function(i,r){var o=n.canavs,s=(0,a.default)((0,a.default)({},n),{},{canvasId:t,success:function(t){i(t.tempFilePath)},fail:function(t){r(t)}});o&&o.toTempFilePath?o.toTempFilePath(s):uni.canvasToTempFilePath(s,e)}))}},"6d74":function(t,e,n){"use strict";n("7a82");var i=n("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=i(n("ffb8")),r=a.default;e.default=r},"79f7":function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("d3b7"),n("d401"),n("81b2"),n("0eb6"),n("b7ef"),n("8bd4"),n("fb6a"),n("14d9"),n("ace4"),n("5cc6"),n("907a"),n("9a8c"),n("a975"),n("735e"),n("c1ac"),n("d139"),n("3a7b"),n("986a"),n("1d02"),n("d5d6"),n("82f8"),n("e91f"),n("60bd"),n("5f96"),n("3280"),n("3fcc"),n("ca91"),n("25a1"),n("cd26"),n("3c5d"),n("2954"),n("649e"),n("219c"),n("b39a"),n("72f7"),n("3ca3"),n("ddb0"),n("2b3d"),n("9861");n("a5ba");var i=n("2c89"),a={data:function(){return{title:"Hello",penColor:"#000000",penSize:5,picurl:"",landscape:!0,openSmooth:!1}},methods:{onClick:function(t){"openSmooth"!=t?"save"!=t?this.$refs.signatureRef&&this.$refs.signatureRef[t]():this.$refs.signatureRef.canvasToTempFilePath({success:function(t){console.log(t.isEmpty),console.log(t);t.tempFilePath.split(",")[1]}}):this.openSmooth=!this.openSmooth},saveSignPic:function(){(0,i.updateUserInfo)({sign_image:this.picurl}).then((function(t){console.log(t,"ooooo")}))},base64ToBlob:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.b64data,n=void 0===e?"":e,i=t.contentType,a=void 0===i?"":i,r=t.sliceSize,o=void 0===r?512:r;return new Promise((function(t,e){for(var i=atob(n),r=[],s=0;s<i.length;s+=o){for(var u=i.slice(s,s+o),c=[],h=0;h<u.length;h++)c.push(u.charCodeAt(h));r.push(new Uint8Array(c))}var d=new Blob(r,{type:a});d=Object.assign(d,{preview:URL.createObjectURL(d),name:"图片示例.png"}),t(d)}))}}};e.default=a},"7a05":function(t,e,n){"use strict";n("7a82");var i=n("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=i(n("c7eb")),r=i(n("1da1"));n("e9c4");var o=n("cb0a"),s=n("e9c5"),u=n("4c18"),c=i(n("24db")),h={props:c.default,data:function(){return{canvasWidth:null,canvasHeight:null,offscreenWidth:null,offscreenHeight:null,useCanvas2d:!0,show:!0,offscreenStyles:""}},computed:{canvasId:function(){return"lime-signature".concat(this._uid)},offscreenId:function(){return this.canvasId+"offscreen"},offscreenSize:function(){var t=this.offscreenWidth,e=this.offscreenHeight;return this.landscape?[e,t]:[t,e]},canvasStyle:function(){var t=this.canvasWidth,e=this.canvasHeight,n=this.backgroundColor;return{width:t&&t+"px",height:e&&e+"px",background:n}},param:function(){var t=this.penColor,e=this.penSize,n=this.backgroundColor,i=this.landscape,a=this.boundingBox,r=this.openSmooth,o=this.minLineWidth,s=this.maxLineWidth,u=this.minSpeed,c=this.maxWidthDiffRate,h=this.maxHistoryLength,d=this.disableScroll;return JSON.parse(JSON.stringify({penColor:t,penSize:e,backgroundColor:n,landscape:i,boundingBox:a,openSmooth:r,minLineWidth:o,maxLineWidth:s,minSpeed:u,maxWidthDiffRate:c,maxHistoryLength:h,disableScroll:d}))}},created:function(){this.useCanvas2d="2d"==this.type&&(0,o.canIUseCanvas2d)()},mounted:function(){var t=this;return(0,r.default)((0,a.default)().mark((function e(){var n;return(0,a.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.beforeDelay){e.next=3;break}return e.next=3,(0,o.sleep)(t.beforeDelay);case 3:return e.next=5,t.getContext();case 5:n=e.sent,t.signature=new s.Signature(n),t.canvasEl=t.signature.canvas.get("el"),t.offscreenWidth=t.canvasWidth=t.signature.canvas.get("width"),t.offscreenHeight=t.canvasHeight=t.signature.canvas.get("height"),t.stopWatch=t.$watch("param",(function(e){t.signature.pen.setOption(e)}),{immediate:!0});case 11:case"end":return e.stop()}}),e)})))()},beforeDestroy:function(){this.stopWatch&&this.stopWatch(),this.signature.destroy(),this.show=!1,this.signature=null},methods:{undo:function(){this.signature&&this.signature.undo()},clear:function(){this.signature&&this.signature.clear()},isEmpty:function(){return this.signature.isEmpty()},canvasToTempFilePath:function(t){var e=this,n=this.isEmpty(),i=function(e){return t.fail&&t.fail(e)},s=this.signature.canvas.get("el"),c=s.canvas,h=this.backgroundColor,d=this.landscape,l=this.boundingBox,f=this.signature.canvas.get("width"),v=this.signature.canvas.get("height"),p=0,g=0,m=function(i){var a=uni.createCanvasContext("offscreen",e);a.save(),a.setTransform(1,0,0,1,0,0),d&&(a.translate(0,f),a.rotate(-Math.PI/2)),h&&(a.fillStyle=h,a.fillRect(0,0,f,v)),a.drawImage(i,0,0,f,v),a.draw(!1,(function(){(0,u.toDataURL)("offscreen",e,t).then((function(e){var i=Math.max(f,v);a.restore(),a.clearRect(0,0,i,i),function(e){t.success&&t.success(e)}({tempFilePath:e,isEmpty:n})}))}))},y=function(){var t={x:p,y:g,width:f,height:v,canvas:e.useCanvas2d?c:null};(0,u.toDataURL)(e.canvasId,e,t).then(m).catch(i)};l?this.signature.getContentBoundingBox(function(){var t=(0,r.default)((0,a.default)().mark((function t(n){return(0,a.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.offscreenWidth=f=n.width,e.offscreenHeight=v=n.height,p=n.startX,g=n.startY,t.next=6,(0,o.sleep)(100);case 6:y();case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()):y()},getContext:function(){var t=this;return(0,o.getRect)("#".concat(this.canvasId),{context:this,type:this.useCanvas2d?"fields":"boundingClientRect"}).then((function(e){if(e){var n,i=e.width,a=e.height,r=e.node,s=e.left,c=e.top,h=e.right,d=uni.getSystemInfoSync(),l=d.pixelRatio;return r?(n=r.getContext("2d"),r.width=i*l,r.height=a*l):(l=1,n=(0,u.uniContext)(t.canvasId,t),r={createImage:u.createImage,toDataURL:function(){return(0,u.toDataURL)(t.canvasId,t)},requestAnimationFrame:o.requestAnimationFrame}),n.clearRect(0,0,i,a),{left:s,top:c,right:h,width:i,height:a,context:n,canvas:r,pixelRatio:l}}}))},touchStart:function(t){this.canvasEl&&(this.isStart=!0,this.canvasEl.dispatchEvent("touchstart",(0,o.wrapEvent)(t)))},touchMove:function(t){!this.canvasEl||!this.isStart&&this.canvasEl||this.canvasEl.dispatchEvent("touchmove",(0,o.wrapEvent)(t))},touchEnd:function(t){this.canvasEl&&(this.isStart=!1,this.canvasEl.dispatchEvent("touchend",(0,o.wrapEvent)(t)))}}};e.default=h},"8c16":function(t,e,n){var i=n("24fb");e=i(!1),e.push([t.i,'@charset "UTF-8";\r\n/**\r\n * 这里是uni-app内置的常用样式变量\r\n *\r\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\r\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\r\n *\r\n */\r\n/**\r\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\r\n *\r\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\r\n */\r\n/* 颜色变量 */\r\n/* 主要颜色 */\r\n/* 行为相关颜色 */\r\n/* 文字基本颜色 */\r\n/* 背景颜色 */\r\n/* 边框颜色 */\r\n/* 尺寸变量 */\r\n/* 文字尺寸 */\r\n/* 图片尺寸 */\r\n/* Border Radius */\r\n/* 水平间距 */\r\n/* 垂直间距 */\r\n/* 透明度 */\r\n/* 文章场景相关 */.sign[data-v-5739059a]{height:calc(100vh);overflow:hidden}.sign .btn[data-v-5739059a]{display:flex;position:fixed;bottom:10px;width:100%}.sign .btn uni-button[data-v-5739059a]{flex:1;margin:0 %?10?%;background-color:#236030;color:#fff;font-size:%?28?%}',""]),t.exports=e},"8fdd":function(t,e,n){var i=n("8c16");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var a=n("4f06").default;a("15fdbd5f",i,!0,{sourceMap:!1,shadowMode:!1})},"93e4":function(t,e,n){"use strict";n.r(e);var i=n("7a05"),a=n.n(i);for(var r in i)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(r);e["default"]=a.a},afa7:function(t,e,n){"use strict";n.r(e);var i=n("c5b3"),a=n("ffa9");for(var r in a)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(r);var o=n("93e4");for(var r in o)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(r);n("e557");var s=n("f0c5");a["default"].__module="sign";var u=Object(s["a"])(o["default"],i["b"],i["c"],!1,null,"65d7357f",null,!1,i["a"],a["default"]);e["default"]=u.exports},c5b3:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){}));var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.show?n("v-uni-view",{ref:"limeSignature",staticClass:"lime-signature",style:[t.canvasStyle,t.styles]},[t.useCanvas2d?n("v-uni-canvas",{staticClass:"lime-signature__canvas",attrs:{id:t.canvasId,type:"2d",disableScroll:t.disableScroll},on:{touchstart:function(e){arguments[0]=e=t.$handleEvent(e),t.touchStart.apply(void 0,arguments)},touchmove:function(e){arguments[0]=e=t.$handleEvent(e),t.touchMove.apply(void 0,arguments)},touchend:function(e){arguments[0]=e=t.$handleEvent(e),t.touchEnd.apply(void 0,arguments)}}}):n("v-uni-canvas",{staticClass:"lime-signature__canvas",attrs:{disableScroll:t.disableScroll,"canvas-id":t.canvasId,id:t.canvasId,width:t.canvasWidth,height:t.canvasHeight},on:{touchstart:function(e){arguments[0]=e=t.$handleEvent(e),t.touchStart.apply(void 0,arguments)},touchmove:function(e){arguments[0]=e=t.$handleEvent(e),t.touchMove.apply(void 0,arguments)},touchend:function(e){arguments[0]=e=t.$handleEvent(e),t.touchEnd.apply(void 0,arguments)},mousedown:function(e){arguments[0]=e=t.$handleEvent(e),t.touchStart.apply(void 0,arguments)},mousemove:function(e){arguments[0]=e=t.$handleEvent(e),t.touchMove.apply(void 0,arguments)},mouseup:function(e){arguments[0]=e=t.$handleEvent(e),t.touchEnd.apply(void 0,arguments)}}}),n("v-uni-canvas",{staticClass:"offscreen",style:"width:"+t.offscreenSize[0]+"px;height:"+t.offscreenSize[1]+"px",attrs:{"canvas-id":"offscreen",id:"offscreen",width:t.offscreenSize[0],height:t.offscreenSize[1]}})],1):t._e()},a=[]},c766:function(t,e,n){"use strict";var i=n("8fdd"),a=n.n(i);a.a},cb0a:function(t,e,n){"use strict";n("7a82");var i=n("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.base64ToPath=function(t){var e=/data:image\/(\w+);base64,(.*)/.exec(t)||[],n=(0,a.default)(e,3);n[1],n[2];return new Promise((function(t,e){}))},e.canIUseCanvas2d=function(){return!1},e.compareVersion=r,e.getRect=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="boundingClientRect",i=e.context,a=e.type,r=void 0===a?n:a;return new Promise((function(e,a){var o=uni.createSelectorQuery().in(i).select(t),s=function(t){t?e(t):a()};r==n?o[r](s).exec():o[r]({node:!0,size:!0,rect:!0},s).exec()}))},e.requestAnimationFrame=void 0,e.sleep=function(t){return new Promise((function(e){return setTimeout(e,t)}))},e.wrapEvent=void 0;var a=i(n("3835"));function r(t,e){t=t.split("."),e=e.split(".");var n=Math.max(t.length,e.length);while(t.length<n)t.push("0");while(e.length<n)e.push("0");for(var i=0;i<n;i++){var a=parseInt(t[i],10),r=parseInt(e[i],10);if(a>r)return 1;if(a<r)return-1}return 0}n("14d9"),n("e25e"),n("ac1f"),n("d3b7");e.wrapEvent=function(t){if(t)return t.preventDefault||(t.preventDefault=function(){}),t};e.requestAnimationFrame=function(t){setTimeout(t,30)}},cb29:function(t,e,n){var i=n("23e7"),a=n("81d5"),r=n("44d2");i({target:"Array",proto:!0},{fill:a}),r("fill")},e557:function(t,e,n){"use strict";var i=n("1dac"),a=n.n(i);a.a},e9c5:function(t,e,n){"use strict";var i=n("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.Signature=void 0;var a=i(n("53ca"));function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function o(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){d(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function s(t){return s="function"==typeof Symbol&&"symbol"==(0,a.default)(Symbol.iterator)?function(t){return(0,a.default)(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":(0,a.default)(t)},s(t)}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var n=0;e.length>n;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function h(t,e,n){return e&&c(t.prototype,e),n&&c(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function d(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&v(t,e)}function f(t){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},f(t)}function v(t,e){return v=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},v(t,e)}function p(t,e){if(e&&("object"==(0,a.default)(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function g(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=f(t);if(e){var a=f(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return p(this,n)}}n("b64b"),n("a4d3"),n("4de4"),n("d3b7"),n("e439"),n("14d9"),n("159b"),n("dbb4"),n("1d1c"),n("7a82"),n("e01a"),n("d28b"),n("3ca3"),n("ddb0"),n("d9e2"),n("d401"),n("131a"),n("3410"),n("f8c9"),n("4ae1"),n("a434"),n("acd8"),n("a9e3"),n("cb29"),n("fb6a");var m=function(t){var e=s(t);return null!==t&&"object"===e||"function"===e},y={}.toString,b=function(t,e){return y.call(t)==="[object "+e+"]"},w=function(t){return b(t,"String")},x=function(t){return b(t,"Number")},S=function(t){return b(t,"Function")},_=function(){function t(){u(this,t),this.__events=void 0,this.__events={}}return h(t,[{key:"on",value:function(t,e){if(t&&e){var n=this.__events[t]||[];n.push(e),this.__events[t]=n}}},{key:"emit",value:function(t,e){var n=this;if(m(t)&&(t=(e=t)&&e.type),t){var i=this.__events[t];i&&i.length&&i.forEach((function(t){t.call(n,e)}))}}},{key:"off",value:function(t,e){var n=this.__events,i=n[t];if(i&&i.length)if(e)for(var a=0,r=i.length;r>a;a++)i[a]===e&&(i.splice(a,1),a--);else delete n[t]}},{key:"getEvents",value:function(){return this.__events}}]),t}(),E=function(t){l(n,_);var e=g(n);function n(t,i){var a;return u(this,n),(a=e.call(this)).context=void 0,a.canvas=void 0,a.attrs=void 0,a.isCanvasElement=void 0,a.context=t,a.canvas=i.canvas||t.canvas||{width:i.width||0,height:i.height||0},a.attrs=i||{},a.isCanvasElement=!0,a}return h(n,[{key:"width",get:function(){return this.canvas.width},set:function(t){this.canvas.width=t}},{key:"height",get:function(){return this.canvas.height},set:function(t){this.canvas.height=t}},{key:"getContext",value:function(){return this.context}},{key:"getBoundingClientRect",value:function(){var t=this.attrs||{},e=t.top,n=t.right,i=t.width,a=t.height,r=t.left,o=t.bottom;return{top:void 0===e?0:e,width:void 0===i?0:i,right:void 0===n?0:n,height:void 0===a?0:a,bottom:void 0===o?0:o,left:void 0===r?0:r}}},{key:"setAttribute",value:function(t,e){this.attrs[t]=e}},{key:"addEventListener",value:function(t,e){this.on(t,e)}},{key:"removeEventListener",value:function(t,e){this.off(t,e)}},{key:"dispatchEvent",value:function(t,e){this.emit(t,e)}}]),n}();function L(t,e){try{return t.currentStyle?t.currentStyle[e]:document.defaultView&&document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}catch(t){return{width:300,height:150}[e]}}function P(t,e){var n=e.get("el");if(!n)return t;var i=n.getBoundingClientRect(),a=i.top,r=void 0===a?0:a,o=i.left,s=void 0===o?0:o,u=parseFloat(L(n,"padding-left"))||0,c=parseFloat(L(n,"padding-top"))||0;return{x:t.x-s-u,y:t.y-r-c}}function k(t,e){var n=e.get("landscape");if(!n)return t;if(S(n))return n(t,e);var i=e.get("height");return{x:t.y,y:i-t.x}}var C=function(t,e){var n=t.touches;if(!n||!n.length)return[k(P({x:t.clientX,y:t.clientY},e),e)];n.length||(n=t.changedTouches||[]);for(var i=[],a=0,r=n.length;r>a;a++){var o,s=n[a],u=s.x,c=s.y,h=s.clientX,d=s.clientY;o=x(u)||x(c)?{x:u,y:c}:P({x:h,y:d},e),i.push(k(o,e))}return i},O=function(t,e){var n=e.x-t.x,i=e.y-t.y;return Math.abs(n)>Math.abs(i)?n>0?"right":"left":i>0?"down":"up"},M=function(t,e){var n=Math.abs(e.x-t.x),i=Math.abs(e.y-t.y);return Math.sqrt(n*n+i*i)},D=function(){function t(e){var n=this,i=e.canvas,a=e.el;u(this,t),this.processEvent=void 0,this.canvas=void 0,this.startTime=0,this.endTime=0,this.startPoints=null,this.startDistance=0,this.center=null,this.pressTimeout=void 0,this.eventType=null,this.direction=null,this.lastMoveTime=0,this.prevMovePoints=null,this.prevMoveTime=0,this.lastMovePoints=null,this.pinch=!1,this._click=function(t){var e=C(t,n.canvas);t.points=e,n.emitEvent("click",t)},this._start=function(t){var e,i,a=C(t,n.canvas);a&&(t.points=a,n.emitEvent("touchstart",t),n.reset(),n.startTime=Date.now(),n.startPoints=a,a.length>1?(n.startDistance=M(a[0],a[1]),n.center={x:(e=a[0]).x+((i=a[1]).x-e.x)/2,y:e.y+(i.y-e.y)/2}):n.pressTimeout=setTimeout((function(){var e="press",i="none";t.direction=i,n.emitStart(e,t),n.emitEvent(e,t),n.eventType=e,n.direction=i}),250))},this._move=function(t){var e=C(t,n.canvas);if(e){t.points=e,n.emitEvent("touchmove",t);var i=n.startPoints;if(i)if(e.length>1){var a=n.startDistance,r=M(e[0],e[1]);t.zoom=r/a,t.center=n.center,n.emitStart("pinch",t),n.emitEvent("pinch",t)}else{var o=e[0].x-i[0].x,s=e[0].y-i[0].y,u=n.direction||O(i[0],e[0]);n.direction=u;var c=n.getEventType(e);t.direction=u,t.deltaX=o,t.deltaY=s,n.emitStart(c,t),n.emitEvent(c,t);var h=n.lastMoveTime,d=Date.now();d-h>0&&(n.prevMoveTime=h,n.prevMovePoints=n.lastMovePoints,n.lastMoveTime=d,n.lastMovePoints=e)}}},this._end=function(t){var e=C(t,n.canvas);t.points=e,n.emitEnd(t),n.emitEvent("touchend",t);var i=n.lastMoveTime;if(100>Date.now()-i){var a=i-(n.prevMoveTime||n.startTime);if(a>0){var r=n.prevMovePoints||n.startPoints,o=n.lastMovePoints;if(!r||!o)return;var s=M(r[0],o[0])/a;s>.3&&(t.velocity=s,t.direction=O(r[0],o[0]),n.emitEvent("swipe",t))}}n.reset();var u=t.touches;u&&u.length>0&&n._start(t)},this._cancel=function(t){n.emitEvent("touchcancel",t),n.reset()},this.canvas=i,this.delegateEvent(a),this.processEvent={}}return h(t,[{key:"delegateEvent",value:function(t){t.addEventListener("click",this._click),t.addEventListener("touchstart",this._start),t.addEventListener("touchmove",this._move),t.addEventListener("touchend",this._end),t.addEventListener("touchcancel",this._cancel)}},{key:"emitEvent",value:function(t,e){this.canvas.emit(t,e)}},{key:"getEventType",value:function(t){var e,n=this.eventType,i=this.startTime,a=this.startPoints;if(n)return n;var r=this.canvas.__events.pan;if(r&&r.length){var o=Date.now();if(!a)return;e=o-i>250&&10>M(a[0],t[0])?"press":"pan"}else e="press";return this.eventType=e,e}},{key:"enable",value:function(t){this.processEvent[t]=!0}},{key:"isProcess",value:function(t){return this.processEvent[t]}},{key:"emitStart",value:function(t,e){this.isProcess(t)||(this.enable(t),this.emitEvent("".concat(t,"start"),e))}},{key:"emitEnd",value:function(t){}},{key:"clearPressTimeout",value:function(){this.pressTimeout&&(clearTimeout(this.pressTimeout),this.pressTimeout=null)}},{key:"reset",value:function(){this.clearPressTimeout(),this.startTime=0,this.startPoints=null,this.startDistance=0,this.direction=null,this.eventType=null,this.pinch=!1,this.prevMoveTime=0,this.prevMovePoints=null,this.lastMoveTime=0,this.lastMovePoints=null}}]),t}(),T=function(t){l(n,_);var e=g(n);function n(t){var i;return u(this,n),(i=e.call(this))._attrs={},i._isWindow=void 0,i._attrs=Object.assign({},t),i._isWindow="undefined"!=typeof window,i._initPixelRatio(),i._initCanvas(),["createImage","toDataURL","requestAnimationFrame"].forEach((function(e){i._initAttrs(e,t.canvas||i.get("el"))})),i}return h(n,[{key:"get",value:function(t){return this._attrs[t]}},{key:"set",value:function(t,e){this._attrs[t]=e}},{key:"_initAttrs",value:function(t,e){var n=this;this.get(t)||this.set(t,(function(){return e[t]?e[t].apply(e,arguments):n._isWindow?window[t]?(i=window)[t].apply(i,arguments):"createImage"==t?new Image:null:void 0;var i}))}},{key:"_initCanvas",value:function(){var t,e,n=this.get("el"),i=this.get("context");if(!n&&!i)throw Error("请指定 id、el 或 context!");t=n?w(n)?(e=n)?document.getElementById(e):null:n:function(t,e){return t?function(t){if(!t)return!1;if(1!==t.nodeType||!t.nodeName||"canvas"!==t.nodeName.toLowerCase())return!1;var e=!1;try{t.addEventListener("eventTest",(function(){e=!0})),t.dispatchEvent(new Event("eventTest"))}catch(t){e=!1}return e}(t.canvas)?t.canvas:new E(t,e):null}(i,this._attrs),i&&t&&!t.getContext&&(t.getContext=function(){return i});var a=this.get("width")||function(t){var e=L(t,"width");return"auto"===e&&(e=t.offsetWidth),parseFloat(e)}(t)||t.width,r=this.get("height")||function(t){var e=L(t,"height");return"auto"===e&&(e=t.offsetHeight),parseFloat(e)}(t)||t.height;this.set("canvas",this),this.set("el",t),this.set("context",i||t.getContext("2d")),this.changeSize(a,r);var o=new D({canvas:this,el:t,parent:this.get("parent")});this.set("eventController",o)}},{key:"_initPixelRatio",value:function(){this.get("pixelRatio")||this.set("pixelRatio",window&&window.devicePixelRatio||1)}},{key:"changeSize",value:function(t,e){var n,i=this.get("pixelRatio"),a=this.get("el");a.style&&(a.style.width=t+"px",a.style.height=e+"px"),(n=a)&&"object"===s(n)&&(1===n.nodeType&&n.nodeName||n.isCanvasElement)&&(a.width=t*i,a.height=e*i,1!==i&&this.get("context").scale(i,i)),this.set("width",t),this.set("height",e)}},{key:"destroy",value:function(){if(!this.get("destroyed")){var t=this.get("el");t.width=0,t.height=0,this.clear(),this._attrs={},this.set("destroyed",!0)}}},{key:"clear",value:function(){}},{key:"isDestroyed",value:function(){return this.get("destroyed")}}]),n}(),W={penColor:"black",backgroundColor:"",openSmooth:!0,penSize:2,minLineWidth:2,maxLineWidth:6,minSpeed:1.5,maxWidthDiffRate:20,maxHistoryLength:20},R=null,I=function(){function t(e){var n=this;u(this,t),this.canAddHistory=!0,this.points=[],this.historyList=[],this.canvas=void 0,this._isEmpty=!0,this.active=!1,this.getLineWidth=function(t){var e=n.get("options"),i=e.minSpeed,a=e.minLineWidth,r=n.getMaxLineWidth();return Math.min(Math.max(r-(r-a)*t/Math.max(Math.min(i,10),1),a),r)},this.drawTrapezoid=function(t,e,i,a){var r=n.get("context");r.beginPath(),r.moveTo(Number(t.x.toFixed(1)),Number(t.y.toFixed(1))),r.lineTo(Number(e.x.toFixed(1)),Number(e.y.toFixed(1))),r.lineTo(Number(i.x.toFixed(1)),Number(i.y.toFixed(1))),r.lineTo(Number(a.x.toFixed(1)),Number(a.y.toFixed(1))),r.fillStyle=n.get("options").penColor,r.fill(),r.draw&&r.draw(!0)},this.drawNoSmoothLine=function(t,e){e.lastX=t.x+.5*(e.x-t.x),e.lastY=t.y+.5*(e.y-t.y),"number"==typeof t.lastX&&n.drawCurveLine(t.lastX,t.lastY,t.x,t.y,e.lastX,e.lastY,n.getMaxLineWidth())},this.drawCurveLine=function(t,e,i,a,r,o,s){s=Number(s.toFixed(1));var u=n.get("context");u.lineWidth=s,u.beginPath(),u.moveTo(Number(t.toFixed(1)),Number(e.toFixed(1))),u.quadraticCurveTo(Number(i.toFixed(1)),Number(a.toFixed(1)),Number(r.toFixed(1)),Number(o.toFixed(1))),u.stroke(),u.draw&&u.draw(!0)},this.getRadianData=function(t,e,n,i){var a=n-t,r=i-e;if(0===a)return{val:0,pos:-1};if(0===r)return{val:0,pos:1};var o=Math.abs(Math.atan(r/a));return n>t&&e>i||t>n&&i>e?{val:o,pos:1}:{val:o,pos:-1}},this.getRadianPoints=function(t,e,n,i){if(0===t.val)return 1===t.pos?[{x:e,y:n+i},{x:e,y:n-i}]:[{y:n,x:e+i},{y:n,x:e-i}];var a=Math.sin(t.val)*i,r=Math.cos(t.val)*i;return 1===t.pos?[{x:e+a,y:n+r},{x:e-a,y:n-r}]:[{x:e+a,y:n-r},{x:e-a,y:n+r}]},this.drawSmoothLine=function(t,e){var i=e.x-t.x,a=e.y-t.y;if(Math.abs(i)+Math.abs(a)>2?(e.lastX1=t.x+.3*i,e.lastY1=t.y+.3*a,e.lastX2=t.x+.7*i,e.lastY2=t.y+.7*a):(e.lastX1=e.lastX2=t.x+.5*i,e.lastY1=e.lastY2=t.y+.5*a),e.perLineWidth=(t.lineWidth+e.lineWidth)/2,"number"==typeof t.lastX1){if(n.drawCurveLine(t.lastX2,t.lastY2,t.x,t.y,e.lastX1,e.lastY1,e.perLineWidth),t.isFirstPoint)return;if(t.lastX1===t.lastX2&&t.lastY1===t.lastY2)return;var r=n.getRadianData(t.lastX1,t.lastY1,t.lastX2,t.lastY2),o=n.getRadianPoints(r,t.lastX1,t.lastY1,t.perLineWidth/2),s=n.getRadianPoints(r,t.lastX2,t.lastY2,e.perLineWidth/2);n.drawTrapezoid(o[0],s[0],s[1],o[1])}else e.isFirstPoint=!0},this.addHistory=function(){var t=n.get("options").maxHistoryLength;if(t&&n.canAddHistory)if(n.canAddHistory=!1,n.get("createImage")){var e=null;e=n.get("createImage")();var i=n.get("toDataURL")&&n.get("toDataURL")();w(i)?e.src=i:i.then((function(t){e.src=t})),e.onload=function(){var i=R;R=e,n.historyList.push(i),n.historyList=n.historyList.slice(-t)}}else n.historyList.length++},this.drawByImage=function(t){var e=n.get("context"),i=n.get("width"),a=n.get("height");e.clearRect(0,0,i,a);try{t&&e.drawImage(t,0,0,i,a),e.draw&&e.draw(!0)}catch(t){n.historyList.length=0}},this.isEmpty=function(){return n.get("options").maxHistoryLength>0?0===n.historyList.length:n._isEmpty},this.clear=function(){var t=n.get("context");t.clearRect(0,0,n.get("width"),n.get("height")),t.draw&&t.draw(),n._isEmpty=!0,R=null,n.historyList.length=0},this.undo=function(){if(0===n.get("options").maxHistoryLength&&n.clear(),n.get("createImage")&&n.historyList.length){var t=n.historyList.splice(-1)[0];n.drawByImage(t),0===n.historyList.length&&n.clear()}},this.canvas=e,this.canvas.set("pen",W),this.init()}return h(t,[{key:"getOption",value:function(){}},{key:"setOption",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=o({},t),n=e.maxLineWidth;if(n&&t.penSize&&n==W.maxLineWidth){var i=Math.max(n,t.penSize);e.maxLineWidth=i}this.canvas.set("pen",Object.assign({},W,e))}},{key:"get",value:function(t){return this.canvas.get("options"==t?"pen":t)}},{key:"init",value:function(){var t=this;this.get("context").lineCap="round",this.canvas.on("touchstart",(function(e){return t.onDrawStart(e)})),this.canvas.on("touchmove",(function(e){return t.onDrawMove(e)})),this.canvas.on("touchend",(function(e){return t.onDrawEnd(e)}))}},{key:"drawBackground",value:function(){var t=this.get("context"),e=this.get("width"),n=this.get("height"),i=this.get("options"),a=i.backgroundColor,r=i.backgroundImage;a&&(t.fillStyle=a,t.fillRect(0,0,e,n),t.draw&&t.draw(!0)),r&&this.drawByImage(r)}},{key:"getContentBoundingBox",value:function(t){var e=this.get("pixelRatio"),n=this.get("width"),i=this.get("height"),a=this.get("el"),r="CANVAS"===a.nodeName,o=r?n:a.width,s=r?i:a.height;e=r?1:e;var u=function(n){for(var i=o,a=s,r=0,u=0,c=0;n.length>c;c+=4)if(n[c+3]>0){var h=c/4%o,d=Math.floor(c/4/o);i=Math.min(i,h),a=Math.min(a,d),r=Math.max(r,h),u=Math.max(u,d)}var l={width:(r-i+1)/e,height:(u-a+1)/e,startX:i/e,startY:a/e};return t&&t(l),l};if("CANVAS"===a.nodeName){var c=document.createElement("canvas");c.width=n,c.height=i;var h=c.getContext("2d");h.drawImage(a,0,0,n,i);var d=h.getImageData(0,0,n,i).data;return u(d)}var l,f=this.get("context").getImageData(0,0,o,s);return m(l=f)&&S(l.then)&&S(l.catch)?(f.then((function(t){return u(t.data)})),null):u(f.data)}},{key:"remove",value:function(){var t=this;this.canvas.off("touchstart",(function(e){return t.onDrawStart(e)})),this.canvas.off("touchmove",(function(e){return t.onDrawMove(e)})),this.canvas.off("touchend",(function(e){return t.onDrawEnd(e)}))}},{key:"disableScroll",value:function(t){t.preventDefault&&this.get("options").disableScroll&&t.preventDefault()}},{key:"onDrawStart",value:function(t){this.disableScroll(t);var e=t.points;if(this.active){this.canAddHistory=!0,this.get("context").strokeStyle=this.get("options").penColor;var n=e[0];this.initPoint(n.x,n.y)}}},{key:"onDrawMove",value:function(t){if(this.disableScroll(t),this.active){var e=t.points[0];this.initPoint(e.x,e.y),this.onDraw()}}},{key:"onDrawEnd",value:function(t){this.active&&(this.addHistory(),this.canAddHistory=!0,this.points=[])}},{key:"onDraw",value:function(){var t=this,e=this.get("context");if(this.points.length>=2){e.lineWidth=this.get("options").penSize||2;var n=this.points.slice(-1)[0],i=this.points.slice(-2,-1)[0],a=function(){t._isEmpty=!1,t.get("options").openSmooth?t.drawSmoothLine(i,n):t.drawNoSmoothLine(i,n)},r=this.get("el").canvas;r&&r.requestAnimationFrame?r.requestAnimationFrame((function(){return a()})):"function"==typeof requestAnimationFrame?requestAnimationFrame((function(){return a()})):a()}}},{key:"getMaxLineWidth",value:function(){var t=this.get("options");return Math.min(t.penSize,t.maxLineWidth)}},{key:"initPoint",value:function(t,e){var n={x:t,y:e,t:Date.now()},i=this.points.slice(-1)[0];if(!i||i.t!==n.t&&(i.x!==t||i.y!==e)){if(this.get("options").openSmooth&&i){var a=this.points.slice(-2,-1)[0];if(n.distance=Math.sqrt(Math.pow(n.x-i.x,2)+Math.pow(n.y-i.y,2)),n.speed=n.distance/(n.t-i.t||.1),n.lineWidth=this.getLineWidth(n.speed),a&&a.lineWidth&&i.lineWidth){var r=(n.lineWidth-i.lineWidth)/i.lineWidth,o=this.get("options").maxWidthDiffRate/100;o=o>1?1:.01>o?.01:o,Math.abs(r)>o&&(n.lineWidth=i.lineWidth*(1+(r>0?o:-o)))}}this.points.push(n),this.points=this.points.slice(-3)}}}]),t}(),F=function(){function t(e){u(this,t),this.canvas=void 0,this._ee=void 0,this.pen=void 0;var n=new T(e);n.set("parent",this),this.canvas=n,this._ee=new _,this.pen=new I(n),this.init()}return h(t,[{key:"init",value:function(){this.pen.active=!0}},{key:"destroy",value:function(){this.canvas.destroy()}},{key:"clear",value:function(){this.pen.clear()}},{key:"undo",value:function(){this.pen.undo()}},{key:"save",value:function(){}},{key:"getContentBoundingBox",value:function(t){return this.pen.getContentBoundingBox(t)}},{key:"isEmpty",value:function(){return this.pen.isEmpty()}},{key:"on",value:function(t,e){this._ee.on(t,e)}},{key:"emit",value:function(t,e){this._ee.emit(t,e)}},{key:"off",value:function(t,e){this._ee.off(t,e)}}]),t}();e.Signature=F;var U=F;e.default=U},f8c4:function(t,e,n){"use strict";n.r(e);var i=n("79f7"),a=n.n(i);for(var r in i)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(r);e["default"]=a.a},ffa9:function(t,e,n){"use strict";n.r(e);var i=n("6d74"),a=n.n(i);for(var r in i)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(r);e["default"]=a.a},ffb8:function(t,e){}}]); |