!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.PED=e():t.PED=e()}(window,function(){return n={},i.m=o=[function(t,e,o){"use strict";o.r(e),o.d(e,"imageInfo",function(){return l}),o.d(e,"PED_GlOBAL",function(){return x});var x={img:{_width:0,_height:0,_WH:0,_HW:0},device:{_width:0,_height:0},boxSize:{_width:0,_height:0},operateType:0,imgInstance:null,canvas:{},textBox:{},textInput:{},textOperateIndex:0,textIndex:0,inputArray:[],inputDomArray:[],canvasParentDom:null,canvasGrandDom:null,pictureEditBox:null,canvasContext:{},paintingArray:[]};function n(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);if("Map"===o||"Set"===o)return Array.from(t);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return i(t,e)}(t)||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.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var o=0,n=new Array(e);o'),c=0;c");var s=u(i+="");x.canvasParentDom.appendChild(s);var d=s.offsetWidth,p=s.offsetHeight;s.style.top=(x.boxSize._height-p)/2+x.canvasGrandDom.scrollTop-parseFloat(x.canvasGrandDom.style.paddingTop||0)+"px",s.style.left=(x.boxSize._width-d)/2+x.canvasGrandDom.scrollLeft-parseFloat(x.canvasGrandDom.style.paddingLeft||0)+"px",x.inputDomArray.push(s),r={x:0,y:0},l={top:0,left:0},(a=s).addEventListener("touchstart",function(t){t.preventDefault(),r.x=t.touches[0].pageX-document.body.scrollLeft,r.y=t.touches[0].pageY-document.body.scrollTop,l.top=parseFloat(a.style.top),l.left=parseFloat(a.style.left)},!1),a.addEventListener("touchmove",function(t){var e,o,n,i;t.preventDefault(),1==t.touches.length?(e=t.touches[0].pageX-document.body.scrollLeft-r.x,o=t.touches[0].pageY-document.body.scrollTop-r.y,r.x=t.touches[0].pageX-document.body.scrollLeft,r.y=t.touches[0].pageY-document.body.scrollTop,n=l.left+e,i=l.top+o,l.top=i,l.left=n,a.style.left=n.toFixed(4)+"px",a.style.top=i.toFixed(4)+"px"):t.touches.length},!1)}x.textIndex++}x.textInput.innerText="",x.textBox.style.display="none",x.textInput.style.display="none"})}function m(){var t=n(document.querySelectorAll(".picture-operate"))[0];console.log(t.style.color),"rgb(69, 148, 248)"==t.style.color&&(t.firstChild.src="static/imgEdit/painting.png",t.style.color="white")}function g(){n(document.querySelectorAll(".picture-operate")).forEach(function(t){t.addEventListener("click",function(t){var e,o,n,i=t.currentTarget.getAttribute("operate");e=i,x.operateType=e,1==i?((o=t.currentTarget).firstChild.src="static/imgEdit/painting1.png",o.style.color="#4594f8"):4==i?(a(),D(),x.paintingArray=[],m()):2==i?(x.textBox.style.display="block",x.textInput.style.display="inline-block",x.textInput.focus(),m()):3==i&&(0
取消
保存
'+'')+'
'+"
')+'涂画
'+"
')+' 文字
'+"
')+' 撤回
'+"
')+' 清空
');document.body.appendChild(e);var o,n,i,a=document.getElementById("picture_edit_canvas"),r=document.getElementById("picture_edit_text"),l=document.getElementById("picture_edit_input");o=a,n=r,i=l,x.canvas=o,x.canvasParentDom=o.parentElement,x.canvasGrandDom=o.parentElement.parentElement,x.canvasContext=o.getContext("2d"),x.textBox=n,x.pictureEditBox=n.parentElement,x.textInput=i,x.boxSize._height=x.canvasGrandDom.offsetHeight,x.boxSize._width=x.canvasGrandDom.offsetWidth;var c=(x.boxSize._height-parseFloat(a.style.height)).toFixed(4);0