chunk-e3f79dec.a20852a5.js 727 KB

1234567891011121314151617181920212223
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-e3f79dec"],{"0b25":function(t,e,i){var n=i("a691"),r=i("50c4");t.exports=function(t){if(void 0===t)return 0;var e=n(t),i=r(e);if(e!==i)throw RangeError("Wrong length or index");return i}},"145e":function(t,e,i){"use strict";var n=i("7b0b"),r=i("23cb"),o=i("50c4"),a=Math.min;t.exports=[].copyWithin||function(t,e){var i=n(this),s=o(i.length),c=r(t,s),l=r(e,s),u=arguments.length>2?arguments[2]:void 0,h=a((void 0===u?s:r(u,s))-l,s-c),f=1;l<c&&c<l+h&&(f=-1,l+=h-1,c+=h-1);while(h-- >0)l in i?i[c]=i[l]:delete i[c],c+=f,l+=f;return i}},"170b":function(t,e,i){"use strict";var n=i("ebb5"),r=i("50c4"),o=i("23cb"),a=i("4840"),s=n.aTypedArray,c=n.exportTypedArrayMethod;c("subarray",(function(t,e){var i=s(this),n=i.length,c=o(t,n);return new(a(i,i.constructor))(i.buffer,i.byteOffset+c*i.BYTES_PER_ELEMENT,r((void 0===e?n:o(e,n))-c))}))},"182d":function(t,e,i){var n=i("f8cd");t.exports=function(t,e){var i=n(t);if(i%e)throw RangeError("Wrong offset");return i}},1836:function(t,e,i){"use strict";var n=i("4f0c"),r=i.n(n);r.a},2113:function(t,e,i){"use strict";var n=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"back"},[n("div",{staticClass:"photo"},[n("van-uploader",{attrs:{multiple:"","after-read":t.fileImage,"preview-size":"27vw","preview-full-image":!1},on:{"click-preview":t.preview},model:{value:t.fileList,callback:function(e){t.fileList=e},expression:"fileList"}})],1),n("div",{staticClass:"record"},[t._l(t.recordList,(function(e,r){return n("div",{key:r,staticClass:"play"},[n("audio",{ref:"audios"+r,refInFor:!0,staticStyle:{display:"none"},attrs:{controls:""}},[n("source",{attrs:{src:e.src,type:"audio/ogg"}})]),n("van-icon",{staticStyle:{position:"absolute",left:"-.25rem",top:".12rem"},attrs:{name:"clear",color:"red"},on:{click:function(e){return t.delRecord(r)}}}),n("p",{directives:[{name:"show",rawName:"v-show",value:e.player,expression:"item.player"}]}),n("img",{attrs:{src:i("619a"),alt:""},on:{click:function(e){return t.transmit(r)}}}),n("span",[t._v(t._s(e.duration)+'"')])],1)})),n("i",{staticStyle:{display:"block",width:"100%",height:".8rem"}}),n("button",{staticStyle:{"margin-bottom":".1rem"},on:{click:t.start}},[t._v(" 点击录音 ")])],2)]),n("div",{directives:[{name:"show",rawName:"v-show",value:t.isEditor,expression:"isEditor"}],staticClass:"drawing-container"},[n("div",{attrs:{id:"tui-image-editor"}}),n("van-button",{staticClass:"closes",attrs:{plain:"",type:"info"},on:{click:t.close}},[t._v("取消")]),n("van-button",{staticClass:"save",attrs:{type:"info"},on:{click:t.save}},[t._v("保存")])],1),n("van-overlay",{attrs:{show:t.loading}},[n("div",{staticClass:"wrapper",on:{click:function(t){t.stopPropagation()}}},[n("van-loading",{attrs:{size:"24px",color:"#0094ff",vertical:""}},[t._v("上传中,请稍等...")])],1)])],1)},r=[],o=(i("4160"),i("a434"),i("d3b7"),i("3ca3"),i("159b"),i("ddb0"),i("96cf"),i("1da1")),a=i("c761"),s=(i("741a"),i("5ff5"),i("abe2")),c=i.n(s),l={ZoomIn:"放大",ZoomOut:"缩小",Hand:"手掌",History:"历史",Resize:"调整宽高",Crop:"裁剪",DeleteAll:"全部删除",Delete:"删除",Undo:"撤销",Redo:"反撤销",Reset:"重置",Flip:"镜像",Rotate:"旋转",Draw:"画",Shape:"形状标注",Icon:"图标标注",Text:"文字标注",Mask:"遮罩",Filter:"滤镜",Bold:"加粗",Italic:"斜体",Underline:"下划线",Left:"左对齐",Center:"居中",Right:"右对齐",Color:"颜色","Text size":"字体大小",Custom:"自定义",Square:"正方形",Apply:"应用",Cancel:"取消","Flip X":"X 轴","Flip Y":"Y 轴",Range:"区间",Stroke:"描边",Fill:"填充",Circle:"圆",Triangle:"三角",Rectangle:"矩形",Free:"曲线",Straight:"直线",Arrow:"箭头","Arrow-2":"箭头2","Arrow-3":"箭头3","Star-1":"星星1","Star-2":"星星2",Polygon:"多边形",Location:"定位",Heart:"心形",Bubble:"气泡","Custom icon":"自定义图标","Load Mask Image":"加载蒙层图片",Grayscale:"灰度",Blur:"模糊",Sharpen:"锐化",Emboss:"浮雕","Remove White":"除去白色",Distance:"距离",Brightness:"亮度",Noise:"噪音","Color Filter":"彩色滤镜",Sepia:"棕色",Sepia2:"棕色2",Invert:"负片",Pixelate:"像素化",Threshold:"阈值",Tint:"色调",Multiply:"正片叠底",Blend:"混合色",Width:"宽度",Height:"高度","Lock Aspect Ratio":"锁定宽高比例"},u={"common.bi.image":"","common.bisize.width":"0px","common.bisize.height":"0px","common.backgroundImage":"none","common.backgroundColor":"#f3f4f6","common.border":"1px solid #333","header.backgroundImage":"none","header.backgroundColor":"#fff","header.border":"0px","loadButton.backgroundColor":"#fff","loadButton.border":"1px solid #ddd","loadButton.color":"#222","loadButton.fontFamily":"NotoSans, sans-serif","loadButton.fontSize":"12px","loadButton.display":"none","downloadButton.backgroundColor":"#fdba3b","downloadButton.border":"1px solid #fdba3b","downloadButton.color":"#fff","downloadButton.fontFamily":"NotoSans, sans-serif","downloadButton.fontSize":"12px","downloadButton.display":"none","menu.normalIcon.color":"#8a8a8a","menu.activeIcon.color":"#555555","menu.disabledIcon.color":"#ccc","menu.hoverIcon.color":"#e9e9e9","submenu.normalIcon.color":"#8a8a8a","submenu.activeIcon.color":"#e9e9e9","menu.iconSize.width":"24px","menu.iconSize.height":"24px","submenu.iconSize.width":"32px","submenu.iconSize.height":"32px","submenu.backgroundColor":"#1e1e1e","submenu.partition.color":"#858585","submenu.normalLabel.color":"#858585","submenu.normalLabel.fontWeight":"lighter","submenu.activeLabel.color":"#fff","submenu.activeLabel.fontWeight":"lighter","checkbox.border":"1px solid #ccc","checkbox.backgroundColor":"#fff","range.pointer.color":"#fff","range.bar.color":"#666","range.subbar.color":"#d1d1d1","range.disabledPointer.color":"#414141","range.disabledBar.color":"#282828","range.disabledSubbar.color":"#414141","range.value.color":"#fff","range.value.fontWeight":"lighter","range.value.fontSize":"11px","range.value.border":"1px solid #353535","range.value.backgroundColor":"#151515","range.title.color":"#fff","range.title.fontWeight":"lighter","colorpicker.button.border":"1px solid #1e1e1e","colorpicker.title.color":"#fff"},h={name:"VueCli4VantAbnormal",data:function(){return{loading:!1,isEditor:!1,fileList:[],loop:"",btRecoding:!1,blackBoxSpeak:!1,startY:"",recorder:"",duration:"1",player:!1,reasonValue:"",voiceUrl:"",chartUrl:"",index:null,src:"",recordList:[],show:!1,url:""}},created:function(){},mounted:function(){},methods:{delRecord:function(t){var e=this;this.$dialog({message:"您将删除本条语音,删除后无法恢复,确认删除吗?",showCancelButton:!0}).then((function(){console.log("111"),e.recordList.splice(t,1)})).catch((function(){}))},countAudioTime:function(){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function e(){var i,n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:i=t.$refs["audios".concat(t.recordList.length-1)][0];case 1:if(!isNaN(i.duration)&&i.duration!==1/0){e.next=7;break}return e.next=4,new Promise((function(t){return setTimeout(t,200)}));case 4:i.currentTime=1e7*Math.random(),e.next=1;break;case 7:t.$notify({type:"success",message:"音频的总时长:".concat(i.duration)}),n=Math.ceil(i.duration),console.log("音频的总时长:",i.duration),t.$set(t.recordList[t.recordList.length-1],"duration",n),t.$notify({type:"success",message:"测试成功!"});case 12:case"end":return e.stop()}}),e)})))()},preview:function(t,e){console.log(t,e),this.index=e.index,this.init(t.content),this.isEditor=!0},fileImage:function(){console.log(this.fileList)},close:function(){this.isEditor=!1},start:function(){var t=this;window.suplink.record().then((function(e){t.recordList.push({src:e.data.voiceUrl,duration:null,player:!1}),t.$nextTick((function(){t.$refs["audios".concat(t.recordList.length-1)][0].load(),t.countAudioTime()}))}))},recordItem:function(){var t=this;this.voiceUrl="";var e=[];this.recordList.forEach((function(t){e.push(Object(a["p"])({src:t.src}))})),Promise.all(e).then((function(e){e.forEach((function(e){t.voiceUrl+=e.data.data})),t.$emit("recordItem",{voiceUrl:t.voiceUrl,fileList:t.fileList})}))},transmit:function(t){var e=this;console.log(t),this.$refs["audios".concat(t)][0].play(),this.recordList[t].player=!0;var i=1*this.recordList[t].duration,n=setInterval((function(){e.recordList[t].duration=1*e.recordList[t].duration-1}),1e3);setTimeout((function(){clearInterval(n),e.recordList[t].duration=i,e.recordList[t].player=!1}),1e3*i)},init:function(t){this.instance=new c.a(document.querySelector("#tui-image-editor"),{includeUI:{loadImage:{path:t,name:"image"},menu:["resize","crop","rotate","draw","shape","icon","text"],initMenu:"draw",menuBarPosition:"bottom",locale:l,theme:u},cssMaxWidth:350,cssMaxHeight:700}),document.getElementsByClassName("tui-image-editor-main")[0].style.top="45px",document.getElementsByClassName("tie-btn-reset tui-image-editor-item help")[0].style.display="none"},save:function(){var t=this.instance.toDataURL();console.log(t),this.fileList[this.index].content=t,this.isEditor=!1,this.$notify({type:"success",message:"编辑成功!"})}}},f=h,d=(i("1836"),i("2877")),g=Object(d["a"])(f,n,r,!1,null,"e337ef94",null);e["a"]=g.exports},"219c":function(t,e,i){"use strict";var n=i("ebb5"),r=n.aTypedArray,o=n.exportTypedArrayMethod,a=[].sort;o("sort",(function(t){return a.call(r(this),t)}))},"25a1":function(t,e,i){"use strict";var n=i("ebb5"),r=i("d58f").right,o=n.aTypedArray,a=n.exportTypedArrayMethod;a("reduceRight",(function(t){return r(o(this),t,arguments.length,arguments.length>1?arguments[1]:void 0)}))},2954:function(t,e,i){"use strict";var n=i("ebb5"),r=i("4840"),o=i("d039"),a=n.aTypedArray,s=n.aTypedArrayConstructor,c=n.exportTypedArrayMethod,l=[].slice,u=o((function(){new Int8Array(1).slice()}));c("slice",(function(t,e){var i=l.call(a(this),t,e),n=r(this,this.constructor),o=0,c=i.length,u=new(s(n))(c);while(c>o)u[o]=i[o++];return u}),u)},3280:function(t,e,i){"use strict";var n=i("ebb5"),r=i("e58c"),o=n.aTypedArray,a=n.exportTypedArrayMethod;a("lastIndexOf",(function(t){return r.apply(o(this),arguments)}))},"3a7b":function(t,e,i){"use strict";var n=i("ebb5"),r=i("b727").findIndex,o=n.aTypedArray,a=n.exportTypedArrayMethod;a("findIndex",(function(t){return r(o(this),t,arguments.length>1?arguments[1]:void 0)}))},"3c5d":function(t,e,i){"use strict";var n=i("ebb5"),r=i("50c4"),o=i("182d"),a=i("7b0b"),s=i("d039"),c=n.aTypedArray,l=n.exportTypedArrayMethod,u=s((function(){new Int8Array(1).set({})}));l("set",(function(t){c(this);var e=o(arguments.length>1?arguments[1]:void 0,1),i=this.length,n=a(t),s=r(n.length),l=0;if(s+e>i)throw RangeError("Wrong length");while(l<s)this[e+l]=n[l++]}),u)},"3fcc":function(t,e,i){"use strict";var n=i("ebb5"),r=i("b727").map,o=i("4840"),a=n.aTypedArray,s=n.aTypedArrayConstructor,c=n.exportTypedArrayMethod;c("map",(function(t){return r(a(this),t,arguments.length>1?arguments[1]:void 0,(function(t,e){return new(s(o(t,t.constructor)))(e)}))}))},"4f0c":function(t,e,i){},"5cc6":function(t,e,i){var n=i("74e8");n("Uint8",(function(t){return function(e,i,n){return t(this,e,i,n)}}))},"5f96":function(t,e,i){"use strict";var n=i("ebb5"),r=n.aTypedArray,o=n.exportTypedArrayMethod,a=[].join;o("join",(function(t){return a.apply(r(this),arguments)}))},"5ff5":function(t,e,i){},"60bd":function(t,e,i){"use strict";var n=i("da84"),r=i("ebb5"),o=i("e260"),a=i("b622"),s=a("iterator"),c=n.Uint8Array,l=o.values,u=o.keys,h=o.entries,f=r.aTypedArray,d=r.exportTypedArrayMethod,g=c&&c.prototype[s],p=!!g&&("values"==g.name||void 0==g.name),v=function(){return l.call(f(this))};d("entries",(function(){return h.call(f(this))})),d("keys",(function(){return u.call(f(this))})),d("values",v,!p),d(s,v,!p)},"619a":function(t,e,i){t.exports=i.p+"assets/img/3.1311c53e.png"},"621a":function(t,e,i){"use strict";var n=i("da84"),r=i("83ab"),o=i("a981"),a=i("9112"),s=i("e2cc"),c=i("d039"),l=i("19aa"),u=i("a691"),h=i("50c4"),f=i("0b25"),d=i("77a7"),g=i("e163"),p=i("d2bb"),v=i("241c").f,m=i("9bf2").f,y=i("81d5"),b=i("d44e"),_=i("69f3"),x=_.get,C=_.set,I="ArrayBuffer",M="DataView",S="prototype",w="Wrong length",T="Wrong index",A=n[I],D=A,E=n[M],k=E&&E[S],O=Object.prototype,j=n.RangeError,L=d.pack,N=d.unpack,P=function(t){return[255&t]},z=function(t){return[255&t,t>>8&255]},R=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},B=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},F=function(t){return L(t,23,4)},Y=function(t){return L(t,52,8)},H=function(t,e){m(t[S],e,{get:function(){return x(this)[e]}})},U=function(t,e,i,n){var r=f(i),o=x(t);if(r+e>o.byteLength)throw j(T);var a=x(o.buffer).bytes,s=r+o.byteOffset,c=a.slice(s,s+e);return n?c:c.reverse()},W=function(t,e,i,n,r,o){var a=f(i),s=x(t);if(a+e>s.byteLength)throw j(T);for(var c=x(s.buffer).bytes,l=a+s.byteOffset,u=n(+r),h=0;h<e;h++)c[l+h]=u[o?h:e-h-1]};if(o){if(!c((function(){A(1)}))||!c((function(){new A(-1)}))||c((function(){return new A,new A(1.5),new A(NaN),A.name!=I}))){D=function(t){return l(this,D),new A(f(t))};for(var G,X=D[S]=A[S],Z=v(A),V=0;Z.length>V;)(G=Z[V++])in D||a(D,G,A[G]);X.constructor=D}p&&g(k)!==O&&p(k,O);var J=new E(new D(2)),Q=k.setInt8;J.setInt8(0,2147483648),J.setInt8(1,2147483649),!J.getInt8(0)&&J.getInt8(1)||s(k,{setInt8:function(t,e){Q.call(this,t,e<<24>>24)},setUint8:function(t,e){Q.call(this,t,e<<24>>24)}},{unsafe:!0})}else D=function(t){l(this,D,I);var e=f(t);C(this,{bytes:y.call(new Array(e),0),byteLength:e}),r||(this.byteLength=e)},E=function(t,e,i){l(this,E,M),l(t,D,M);var n=x(t).byteLength,o=u(e);if(o<0||o>n)throw j("Wrong offset");if(i=void 0===i?n-o:h(i),o+i>n)throw j(w);C(this,{buffer:t,byteLength:i,byteOffset:o}),r||(this.buffer=t,this.byteLength=i,this.byteOffset=o)},r&&(H(D,"byteLength"),H(E,"buffer"),H(E,"byteLength"),H(E,"byteOffset")),s(E[S],{getInt8:function(t){return U(this,1,t)[0]<<24>>24},getUint8:function(t){return U(this,1,t)[0]},getInt16:function(t){var e=U(this,2,t,arguments.length>1?arguments[1]:void 0);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=U(this,2,t,arguments.length>1?arguments[1]:void 0);return e[1]<<8|e[0]},getInt32:function(t){return B(U(this,4,t,arguments.length>1?arguments[1]:void 0))},getUint32:function(t){return B(U(this,4,t,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(t){return N(U(this,4,t,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(t){return N(U(this,8,t,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(t,e){W(this,1,t,P,e)},setUint8:function(t,e){W(this,1,t,P,e)},setInt16:function(t,e){W(this,2,t,z,e,arguments.length>2?arguments[2]:void 0)},setUint16:function(t,e){W(this,2,t,z,e,arguments.length>2?arguments[2]:void 0)},setInt32:function(t,e){W(this,4,t,R,e,arguments.length>2?arguments[2]:void 0)},setUint32:function(t,e){W(this,4,t,R,e,arguments.length>2?arguments[2]:void 0)},setFloat32:function(t,e){W(this,4,t,F,e,arguments.length>2?arguments[2]:void 0)},setFloat64:function(t,e){W(this,8,t,Y,e,arguments.length>2?arguments[2]:void 0)}});b(D,I),b(E,M),t.exports={ArrayBuffer:D,DataView:E}},"649e":function(t,e,i){"use strict";var n=i("ebb5"),r=i("b727").some,o=n.aTypedArray,a=n.exportTypedArrayMethod;a("some",(function(t){return r(o(this),t,arguments.length>1?arguments[1]:void 0)}))},"72f7":function(t,e,i){"use strict";var n=i("ebb5").exportTypedArrayMethod,r=i("d039"),o=i("da84"),a=o.Uint8Array,s=a&&a.prototype||{},c=[].toString,l=[].join;r((function(){c.call({})}))&&(c=function(){return l.call(this)});var u=s.toString!=c;n("toString",c,u)},"735e":function(t,e,i){"use strict";var n=i("ebb5"),r=i("81d5"),o=n.aTypedArray,a=n.exportTypedArrayMethod;a("fill",(function(t){return r.apply(o(this),arguments)}))},"741a":function(t,e,i){},"74e8":function(t,e,i){"use strict";var n=i("23e7"),r=i("da84"),o=i("83ab"),a=i("8aa7"),s=i("ebb5"),c=i("621a"),l=i("19aa"),u=i("5c6c"),h=i("9112"),f=i("50c4"),d=i("0b25"),g=i("182d"),p=i("c04e"),v=i("5135"),m=i("f5df"),y=i("861d"),b=i("7c73"),_=i("d2bb"),x=i("241c").f,C=i("a078"),I=i("b727").forEach,M=i("2626"),S=i("9bf2"),w=i("06cf"),T=i("69f3"),A=i("7156"),D=T.get,E=T.set,k=S.f,O=w.f,j=Math.round,L=r.RangeError,N=c.ArrayBuffer,P=c.DataView,z=s.NATIVE_ARRAY_BUFFER_VIEWS,R=s.TYPED_ARRAY_TAG,B=s.TypedArray,F=s.TypedArrayPrototype,Y=s.aTypedArrayConstructor,H=s.isTypedArray,U="BYTES_PER_ELEMENT",W="Wrong length",G=function(t,e){var i=0,n=e.length,r=new(Y(t))(n);while(n>i)r[i]=e[i++];return r},X=function(t,e){k(t,e,{get:function(){return D(this)[e]}})},Z=function(t){var e;return t instanceof N||"ArrayBuffer"==(e=m(t))||"SharedArrayBuffer"==e},V=function(t,e){return H(t)&&"symbol"!=typeof e&&e in t&&String(+e)==String(e)},J=function(t,e){return V(t,e=p(e,!0))?u(2,t[e]):O(t,e)},Q=function(t,e,i){return!(V(t,e=p(e,!0))&&y(i)&&v(i,"value"))||v(i,"get")||v(i,"set")||i.configurable||v(i,"writable")&&!i.writable||v(i,"enumerable")&&!i.enumerable?k(t,e,i):(t[e]=i.value,t)};o?(z||(w.f=J,S.f=Q,X(F,"buffer"),X(F,"byteOffset"),X(F,"byteLength"),X(F,"length")),n({target:"Object",stat:!0,forced:!z},{getOwnPropertyDescriptor:J,defineProperty:Q}),t.exports=function(t,e,i){var o=t.match(/\d+$/)[0]/8,s=t+(i?"Clamped":"")+"Array",c="get"+t,u="set"+t,p=r[s],v=p,m=v&&v.prototype,S={},w=function(t,e){var i=D(t);return i.view[c](e*o+i.byteOffset,!0)},T=function(t,e,n){var r=D(t);i&&(n=(n=j(n))<0?0:n>255?255:255&n),r.view[u](e*o+r.byteOffset,n,!0)},O=function(t,e){k(t,e,{get:function(){return w(this,e)},set:function(t){return T(this,e,t)},enumerable:!0})};z?a&&(v=e((function(t,e,i,n){return l(t,v,s),A(function(){return y(e)?Z(e)?void 0!==n?new p(e,g(i,o),n):void 0!==i?new p(e,g(i,o)):new p(e):H(e)?G(v,e):C.call(v,e):new p(d(e))}(),t,v)})),_&&_(v,B),I(x(p),(function(t){t in v||h(v,t,p[t])})),v.prototype=m):(v=e((function(t,e,i,n){l(t,v,s);var r,a,c,u=0,h=0;if(y(e)){if(!Z(e))return H(e)?G(v,e):C.call(v,e);r=e,h=g(i,o);var p=e.byteLength;if(void 0===n){if(p%o)throw L(W);if(a=p-h,a<0)throw L(W)}else if(a=f(n)*o,a+h>p)throw L(W);c=a/o}else c=d(e),a=c*o,r=new N(a);E(t,{buffer:r,byteOffset:h,byteLength:a,length:c,view:new P(r)});while(u<c)O(t,u++)})),_&&_(v,B),m=v.prototype=b(F)),m.constructor!==v&&h(m,"constructor",v),R&&h(m,R,s),S[s]=v,n({global:!0,forced:v!=p,sham:!z},S),U in v||h(v,U,o),U in m||h(m,U,o),M(s)}):t.exports=function(){}},"77a7":function(t,e){var i=1/0,n=Math.abs,r=Math.pow,o=Math.floor,a=Math.log,s=Math.LN2,c=function(t,e,c){var l,u,h,f=new Array(c),d=8*c-e-1,g=(1<<d)-1,p=g>>1,v=23===e?r(2,-24)-r(2,-77):0,m=t<0||0===t&&1/t<0?1:0,y=0;for(t=n(t),t!=t||t===i?(u=t!=t?1:0,l=g):(l=o(a(t)/s),t*(h=r(2,-l))<1&&(l--,h*=2),t+=l+p>=1?v/h:v*r(2,1-p),t*h>=2&&(l++,h/=2),l+p>=g?(u=0,l=g):l+p>=1?(u=(t*h-1)*r(2,e),l+=p):(u=t*r(2,p-1)*r(2,e),l=0));e>=8;f[y++]=255&u,u/=256,e-=8);for(l=l<<e|u,d+=e;d>0;f[y++]=255&l,l/=256,d-=8);return f[--y]|=128*m,f},l=function(t,e){var n,o=t.length,a=8*o-e-1,s=(1<<a)-1,c=s>>1,l=a-7,u=o-1,h=t[u--],f=127&h;for(h>>=7;l>0;f=256*f+t[u],u--,l-=8);for(n=f&(1<<-l)-1,f>>=-l,l+=e;l>0;n=256*n+t[u],u--,l-=8);if(0===f)f=1-c;else{if(f===s)return n?NaN:h?-i:i;n+=r(2,e),f-=c}return(h?-1:1)*n*r(2,f-e)};t.exports={pack:c,unpack:l}},"81d5":function(t,e,i){"use strict";var n=i("7b0b"),r=i("23cb"),o=i("50c4");t.exports=function(t){var e=n(this),i=o(e.length),a=arguments.length,s=r(a>1?arguments[1]:void 0,i),c=a>2?arguments[2]:void 0,l=void 0===c?i:r(c,i);while(l>s)e[s++]=t;return e}},"82f8":function(t,e,i){"use strict";var n=i("ebb5"),r=i("4d64").includes,o=n.aTypedArray,a=n.exportTypedArrayMethod;a("includes",(function(t){return r(o(this),t,arguments.length>1?arguments[1]:void 0)}))},"8aa7":function(t,e,i){var n=i("da84"),r=i("d039"),o=i("1c7e"),a=i("ebb5").NATIVE_ARRAY_BUFFER_VIEWS,s=n.ArrayBuffer,c=n.Int8Array;t.exports=!a||!r((function(){c(1)}))||!r((function(){new c(-1)}))||!o((function(t){new c,new c(null),new c(1.5),new c(t)}),!0)||r((function(){return 1!==new c(new s(2),1,void 0).length}))},"9a8c":function(t,e,i){"use strict";var n=i("ebb5"),r=i("145e"),o=n.aTypedArray,a=n.exportTypedArrayMethod;a("copyWithin",(function(t,e){return r.call(o(this),t,e,arguments.length>2?arguments[2]:void 0)}))},a078:function(t,e,i){var n=i("7b0b"),r=i("50c4"),o=i("35a1"),a=i("e95a"),s=i("0366"),c=i("ebb5").aTypedArrayConstructor;t.exports=function(t){var e,i,l,u,h,f,d=n(t),g=arguments.length,p=g>1?arguments[1]:void 0,v=void 0!==p,m=o(d);if(void 0!=m&&!a(m)){h=m.call(d),f=h.next,d=[];while(!(u=f.call(h)).done)d.push(u.value)}for(v&&g>2&&(p=s(p,arguments[2],2)),i=r(d.length),l=new(c(this))(i),e=0;i>e;e++)l[e]=v?p(d[e],e):d[e];return l}},a434:function(t,e,i){"use strict";var n=i("23e7"),r=i("23cb"),o=i("a691"),a=i("50c4"),s=i("7b0b"),c=i("65f0"),l=i("8418"),u=i("1dde"),h=i("ae40"),f=u("splice"),d=h("splice",{ACCESSORS:!0,0:0,1:2}),g=Math.max,p=Math.min,v=9007199254740991,m="Maximum allowed length exceeded";n({target:"Array",proto:!0,forced:!f||!d},{splice:function(t,e){var i,n,u,h,f,d,y=s(this),b=a(y.length),_=r(t,b),x=arguments.length;if(0===x?i=n=0:1===x?(i=0,n=b-_):(i=x-2,n=p(g(o(e),0),b-_)),b+i-n>v)throw TypeError(m);for(u=c(y,n),h=0;h<n;h++)f=_+h,f in y&&l(u,h,y[f]);if(u.length=n,i<n){for(h=_;h<b-n;h++)f=h+n,d=h+i,f in y?y[d]=y[f]:delete y[d];for(h=b;h>b-n+i;h--)delete y[h-1]}else if(i>n)for(h=b-n;h>_;h--)f=h+n-1,d=h+i-1,f in y?y[d]=y[f]:delete y[d];for(h=0;h<i;h++)y[h+_]=arguments[h+2];return y.length=b-n+i,u}})},a975:function(t,e,i){"use strict";var n=i("ebb5"),r=i("b727").every,o=n.aTypedArray,a=n.exportTypedArrayMethod;a("every",(function(t){return r(o(this),t,arguments.length>1?arguments[1]:void 0)}))},a981:function(t,e){t.exports="undefined"!==typeof ArrayBuffer&&"undefined"!==typeof DataView},abe2:function(t,e,i){(function(e){
  2. /*!
  3. * TOAST UI ImageEditor
  4. * @version 3.15.3
  5. * @license MIT
  6. */
  7. (function(e,n){t.exports=n(i("fec2"))})(self,(function(t){return function(){var i={2777:function(t,i,n){
  8. /*! Fabric.js Copyright 2008-2015, Printio (Juriy Zaytsev, Maxim Chernyak) */
  9. var r=r||{version:"4.6.0"};if(i.fabric=r,"undefined"!==typeof document&&"undefined"!==typeof window)document instanceof("undefined"!==typeof HTMLDocument?HTMLDocument:Document)?r.document=document:r.document=document.implementation.createHTMLDocument(""),r.window=window;else{var o=n(4960),a=new o.JSDOM(decodeURIComponent("%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E"),{features:{FetchExternalResources:["img"]},resources:"usable"}).window;r.document=a.document,r.jsdomImplForWrapper=n(6759).implForWrapper,r.nodeCanvas=n(6272).Canvas,r.window=a,DOMParser=r.window.DOMParser}function s(t){var e=t.targetCanvas,i=e.width,n=e.height,r=t.destinationWidth,o=t.destinationHeight;i===r&&n===o||(e.width=r,e.height=o)}function c(t,e){var i=t.canvas,n=e.targetCanvas,r=n.getContext("2d");r.translate(0,n.height),r.scale(1,-1);var o=i.height-n.height;r.drawImage(i,0,o,n.width,n.height,0,0,n.width,n.height)}function l(t,e){var i=e.targetCanvas,n=i.getContext("2d"),r=e.destinationWidth,o=e.destinationHeight,a=r*o*4,s=new Uint8Array(this.imageBuffer,0,a),c=new Uint8ClampedArray(this.imageBuffer,0,a);t.readPixels(0,0,r,o,t.RGBA,t.UNSIGNED_BYTE,s);var l=new ImageData(c,r,o);n.putImageData(l,0,0)}r.isTouchSupported="ontouchstart"in r.window||"ontouchstart"in r.document||r.window&&r.window.navigator&&r.window.navigator.maxTouchPoints>0,r.isLikelyNode="undefined"!==typeof e&&"undefined"===typeof window,r.SHARED_ATTRIBUTES=["display","transform","fill","fill-opacity","fill-rule","opacity","stroke","stroke-dasharray","stroke-linecap","stroke-dashoffset","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","id","paint-order","vector-effect","instantiated_by_use","clip-path"],r.DPI=96,r.reNum="(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:[eE][-+]?\\d+)?)",r.commaWsp="(?:\\s+,?\\s*|,\\s*)",r.rePathCommand=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,r.reNonWord=/[ \n\.,;!\?\-]/,r.fontPaths={},r.iMatrix=[1,0,0,1,0,0],r.svgNS="http://www.w3.org/2000/svg",r.perfLimitSizeTotal=2097152,r.maxCacheSideLimit=4096,r.minCacheSideLimit=256,r.charWidthsCache={},r.textureSize=2048,r.disableStyleCopyPaste=!1,r.enableGLFiltering=!0,r.devicePixelRatio=r.window.devicePixelRatio||r.window.webkitDevicePixelRatio||r.window.mozDevicePixelRatio||1,r.browserShadowBlurConstant=1,r.arcToSegmentsCache={},r.boundsOfCurveCache={},r.cachesBoundsOfCurve=!0,r.forceGLPutImageData=!1,r.initFilterBackend=function(){return r.enableGLFiltering&&r.isWebglSupported&&r.isWebglSupported(r.textureSize)?(console.log("max texture size: "+r.maxTextureSize),new r.WebglFilterBackend({tileSize:r.textureSize})):r.Canvas2dFilterBackend?new r.Canvas2dFilterBackend:void 0},"undefined"!==typeof document&&"undefined"!==typeof window&&(window.fabric=r),function(){function t(t,e){if(this.__eventListeners[t]){var i=this.__eventListeners[t];e?i[i.indexOf(e)]=!1:r.util.array.fill(i,!1)}}function e(t,e){if(this.__eventListeners||(this.__eventListeners={}),1===arguments.length)for(var i in t)this.on(i,t[i]);else this.__eventListeners[t]||(this.__eventListeners[t]=[]),this.__eventListeners[t].push(e);return this}function i(t,e){var i=function(){e.apply(this,arguments),this.off(t,i)}.bind(this);this.on(t,i)}function n(t,e){if(1===arguments.length)for(var n in t)i.call(this,n,t[n]);else i.call(this,t,e);return this}function o(e,i){if(!this.__eventListeners)return this;if(0===arguments.length)for(e in this.__eventListeners)t.call(this,e);else if(1===arguments.length&&"object"===typeof arguments[0])for(var n in e)t.call(this,n,e[n]);else t.call(this,e,i);return this}function a(t,e){if(!this.__eventListeners)return this;var i=this.__eventListeners[t];if(!i)return this;for(var n=0,r=i.length;n<r;n++)i[n]&&i[n].call(this,e||{});return this.__eventListeners[t]=i.filter((function(t){return!1!==t})),this}r.Observable={fire:a,on:e,once:n,off:o}}(),r.Collection={_objects:[],add:function(){if(this._objects.push.apply(this._objects,arguments),this._onObjectAdded)for(var t=0,e=arguments.length;t<e;t++)this._onObjectAdded(arguments[t]);return this.renderOnAddRemove&&this.requestRenderAll(),this},insertAt:function(t,e,i){var n=this._objects;return i?n[e]=t:n.splice(e,0,t),this._onObjectAdded&&this._onObjectAdded(t),this.renderOnAddRemove&&this.requestRenderAll(),this},remove:function(){for(var t,e=this._objects,i=!1,n=0,r=arguments.length;n<r;n++)t=e.indexOf(arguments[n]),-1!==t&&(i=!0,e.splice(t,1),this._onObjectRemoved&&this._onObjectRemoved(arguments[n]));return this.renderOnAddRemove&&i&&this.requestRenderAll(),this},forEachObject:function(t,e){for(var i=this.getObjects(),n=0,r=i.length;n<r;n++)t.call(e,i[n],n,i);return this},getObjects:function(t){return"undefined"===typeof t?this._objects.concat():this._objects.filter((function(e){return e.type===t}))},item:function(t){return this._objects[t]},isEmpty:function(){return 0===this._objects.length},size:function(){return this._objects.length},contains:function(t,e){return this._objects.indexOf(t)>-1||!!e&&this._objects.some((function(e){return"function"===typeof e.contains&&e.contains(t,!0)}))},complexity:function(){return this._objects.reduce((function(t,e){return t+=e.complexity?e.complexity():0,t}),0)}},r.CommonMethods={_setOptions:function(t){for(var e in t)this.set(e,t[e])},_initGradient:function(t,e){!t||!t.colorStops||t instanceof r.Gradient||this.set(e,new r.Gradient(t))},_initPattern:function(t,e,i){!t||!t.source||t instanceof r.Pattern?i&&i():this.set(e,new r.Pattern(t,i))},_setObject:function(t){for(var e in t)this._set(e,t[e])},set:function(t,e){return"object"===typeof t?this._setObject(t):this._set(t,e),this},_set:function(t,e){this[t]=e},toggle:function(t){var e=this.get(t);return"boolean"===typeof e&&this.set(t,!e),this},get:function(t){return this[t]}},function(t){var e=Math.sqrt,i=Math.atan2,n=Math.pow,o=Math.PI/180,a=Math.PI/2;r.util={cos:function(t){if(0===t)return 1;t<0&&(t=-t);var e=t/a;switch(e){case 1:case 3:return 0;case 2:return-1}return Math.cos(t)},sin:function(t){if(0===t)return 0;var e=t/a,i=1;switch(t<0&&(i=-1),e){case 1:return i;case 2:return 0;case 3:return-i}return Math.sin(t)},removeFromArray:function(t,e){var i=t.indexOf(e);return-1!==i&&t.splice(i,1),t},getRandomInt:function(t,e){return Math.floor(Math.random()*(e-t+1))+t},degreesToRadians:function(t){return t*o},radiansToDegrees:function(t){return t/o},rotatePoint:function(t,e,i){var n=new r.Point(t.x-e.x,t.y-e.y),o=r.util.rotateVector(n,i);return new r.Point(o.x,o.y).addEquals(e)},rotateVector:function(t,e){var i=r.util.sin(e),n=r.util.cos(e),o=t.x*n-t.y*i,a=t.x*i+t.y*n;return{x:o,y:a}},transformPoint:function(t,e,i){return i?new r.Point(e[0]*t.x+e[2]*t.y,e[1]*t.x+e[3]*t.y):new r.Point(e[0]*t.x+e[2]*t.y+e[4],e[1]*t.x+e[3]*t.y+e[5])},makeBoundingBoxFromPoints:function(t,e){if(e)for(var i=0;i<t.length;i++)t[i]=r.util.transformPoint(t[i],e);var n=[t[0].x,t[1].x,t[2].x,t[3].x],o=r.util.array.min(n),a=r.util.array.max(n),s=a-o,c=[t[0].y,t[1].y,t[2].y,t[3].y],l=r.util.array.min(c),u=r.util.array.max(c),h=u-l;return{left:o,top:l,width:s,height:h}},invertTransform:function(t){var e=1/(t[0]*t[3]-t[1]*t[2]),i=[e*t[3],-e*t[1],-e*t[2],e*t[0]],n=r.util.transformPoint({x:t[4],y:t[5]},i,!0);return i[4]=-n.x,i[5]=-n.y,i},toFixed:function(t,e){return parseFloat(Number(t).toFixed(e))},parseUnit:function(t,e){var i=/\D{0,2}$/.exec(t),n=parseFloat(t);switch(e||(e=r.Text.DEFAULT_SVG_FONT_SIZE),i[0]){case"mm":return n*r.DPI/25.4;case"cm":return n*r.DPI/2.54;case"in":return n*r.DPI;case"pt":return n*r.DPI/72;case"pc":return n*r.DPI/72*12;case"em":return n*e;default:return n}},falseFunction:function(){return!1},getKlass:function(t,e){return t=r.util.string.camelize(t.charAt(0).toUpperCase()+t.slice(1)),r.util.resolveNamespace(e)[t]},getSvgAttributes:function(t){var e=["instantiated_by_use","style","id","class"];switch(t){case"linearGradient":e=e.concat(["x1","y1","x2","y2","gradientUnits","gradientTransform"]);break;case"radialGradient":e=e.concat(["gradientUnits","gradientTransform","cx","cy","r","fx","fy","fr"]);break;case"stop":e=e.concat(["offset","stop-color","stop-opacity"]);break}return e},resolveNamespace:function(e){if(!e)return r;var i,n=e.split("."),o=n.length,a=t||r.window;for(i=0;i<o;++i)a=a[n[i]];return a},loadImage:function(t,e,i,n){if(t){var o=r.util.createImage(),a=function(){e&&e.call(i,o,!1),o=o.onload=o.onerror=null};o.onload=a,o.onerror=function(){r.log("Error loading "+o.src),e&&e.call(i,null,!0),o=o.onload=o.onerror=null},0!==t.indexOf("data")&&void 0!==n&&null!==n&&(o.crossOrigin=n),"data:image/svg"===t.substring(0,14)&&(o.onload=null,r.util.loadImageInDom(o,a)),o.src=t}else e&&e.call(i,t)},loadImageInDom:function(t,e){var i=r.document.createElement("div");i.style.width=i.style.height="1px",i.style.left=i.style.top="-100%",i.style.position="absolute",i.appendChild(t),r.document.querySelector("body").appendChild(i),t.onload=function(){e(),i.parentNode.removeChild(i),i=null}},enlivenObjects:function(t,e,i,n){t=t||[];var o=[],a=0,s=t.length;function c(){++a===s&&e&&e(o.filter((function(t){return t})))}s?t.forEach((function(t,e){if(t&&t.type){var a=r.util.getKlass(t.type,i);a.fromObject(t,(function(i,r){r||(o[e]=i),n&&n(t,i,r),c()}))}else c()})):e&&e(o)},enlivenPatterns:function(t,e){function i(){++o===a&&e&&e(n)}t=t||[];var n=[],o=0,a=t.length;a?t.forEach((function(t,e){t&&t.source?new r.Pattern(t,(function(t){n[e]=t,i()})):(n[e]=t,i())})):e&&e(n)},groupSVGElements:function(t,e,i){var n;return t&&1===t.length?t[0]:(e&&(e.width&&e.height?e.centerPoint={x:e.width/2,y:e.height/2}:(delete e.width,delete e.height)),n=new r.Group(t,e),"undefined"!==typeof i&&(n.sourcePath=i),n)},populateWithProperties:function(t,e,i){if(i&&"[object Array]"===Object.prototype.toString.call(i))for(var n=0,r=i.length;n<r;n++)i[n]in t&&(e[i[n]]=t[i[n]])},drawDashedLine:function(t,n,r,o,a,s){var c=o-n,l=a-r,u=e(c*c+l*l),h=i(l,c),f=s.length,d=0,g=!0;t.save(),t.translate(n,r),t.moveTo(0,0),t.rotate(h),n=0;while(u>n)n+=s[d++%f],n>u&&(n=u),t[g?"lineTo":"moveTo"](n,0),g=!g;t.restore()},createCanvasElement:function(){return r.document.createElement("canvas")},copyCanvasElement:function(t){var e=r.util.createCanvasElement();return e.width=t.width,e.height=t.height,e.getContext("2d").drawImage(t,0,0),e},toDataURL:function(t,e,i){return t.toDataURL("image/"+e,i)},createImage:function(){return r.document.createElement("img")},multiplyTransformMatrices:function(t,e,i){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],i?0:t[0]*e[4]+t[2]*e[5]+t[4],i?0:t[1]*e[4]+t[3]*e[5]+t[5]]},qrDecompose:function(t){var r=i(t[1],t[0]),a=n(t[0],2)+n(t[1],2),s=e(a),c=(t[0]*t[3]-t[2]*t[1])/s,l=i(t[0]*t[2]+t[1]*t[3],a);return{angle:r/o,scaleX:s,scaleY:c,skewX:l/o,skewY:0,translateX:t[4],translateY:t[5]}},calcRotateMatrix:function(t){if(!t.angle)return r.iMatrix.concat();var e=r.util.degreesToRadians(t.angle),i=r.util.cos(e),n=r.util.sin(e);return[i,n,-n,i,0,0]},calcDimensionsMatrix:function(t){var e="undefined"===typeof t.scaleX?1:t.scaleX,i="undefined"===typeof t.scaleY?1:t.scaleY,n=[t.flipX?-e:e,0,0,t.flipY?-i:i,0,0],o=r.util.multiplyTransformMatrices,a=r.util.degreesToRadians;return t.skewX&&(n=o(n,[1,0,Math.tan(a(t.skewX)),1],!0)),t.skewY&&(n=o(n,[1,Math.tan(a(t.skewY)),0,1],!0)),n},composeMatrix:function(t){var e=[1,0,0,1,t.translateX||0,t.translateY||0],i=r.util.multiplyTransformMatrices;return t.angle&&(e=i(e,r.util.calcRotateMatrix(t))),(1!==t.scaleX||1!==t.scaleY||t.skewX||t.skewY||t.flipX||t.flipY)&&(e=i(e,r.util.calcDimensionsMatrix(t))),e},resetObjectTransform:function(t){t.scaleX=1,t.scaleY=1,t.skewX=0,t.skewY=0,t.flipX=!1,t.flipY=!1,t.rotate(0)},saveObjectTransform:function(t){return{scaleX:t.scaleX,scaleY:t.scaleY,skewX:t.skewX,skewY:t.skewY,angle:t.angle,left:t.left,flipX:t.flipX,flipY:t.flipY,top:t.top}},isTransparent:function(t,e,i,n){n>0&&(e>n?e-=n:e=0,i>n?i-=n:i=0);var r,o,a=!0,s=t.getImageData(e,i,2*n||1,2*n||1),c=s.data.length;for(r=3;r<c;r+=4)if(o=s.data[r],a=o<=0,!1===a)break;return s=null,a},parsePreserveAspectRatioAttribute:function(t){var e,i="meet",n="Mid",r="Mid",o=t.split(" ");return o&&o.length&&(i=o.pop(),"meet"!==i&&"slice"!==i?(e=i,i="meet"):o.length&&(e=o.pop())),n="none"!==e?e.slice(1,4):"none",r="none"!==e?e.slice(5,8):"none",{meetOrSlice:i,alignX:n,alignY:r}},clearFabricFontCache:function(t){t=(t||"").toLowerCase(),t?r.charWidthsCache[t]&&delete r.charWidthsCache[t]:r.charWidthsCache={}},limitDimsByArea:function(t,e){var i=Math.sqrt(e*t),n=Math.floor(e/i);return{x:Math.floor(i),y:n}},capValue:function(t,e,i){return Math.max(t,Math.min(e,i))},findScaleToFit:function(t,e){return Math.min(e.width/t.width,e.height/t.height)},findScaleToCover:function(t,e){return Math.max(e.width/t.width,e.height/t.height)},matrixToSVG:function(t){return"matrix("+t.map((function(t){return r.util.toFixed(t,r.Object.NUM_FRACTION_DIGITS)})).join(" ")+")"},removeTransformFromObject:function(t,e){var i=r.util.invertTransform(e),n=r.util.multiplyTransformMatrices(i,t.calcOwnMatrix());r.util.applyTransformToObject(t,n)},addTransformToObject:function(t,e){r.util.applyTransformToObject(t,r.util.multiplyTransformMatrices(e,t.calcOwnMatrix()))},applyTransformToObject:function(t,e){var i=r.util.qrDecompose(e),n=new r.Point(i.translateX,i.translateY);t.flipX=!1,t.flipY=!1,t.set("scaleX",i.scaleX),t.set("scaleY",i.scaleY),t.skewX=i.skewX,t.skewY=i.skewY,t.angle=i.angle,t.setPositionByOrigin(n,"center","center")},sizeAfterTransform:function(t,e,i){var n=t/2,o=e/2,a=[{x:-n,y:-o},{x:n,y:-o},{x:-n,y:o},{x:n,y:o}],s=r.util.calcDimensionsMatrix(i),c=r.util.makeBoundingBoxFromPoints(a,s);return{x:c.width,y:c.height}}}}(i),function(){var t=Array.prototype.join,e={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},i={m:"l",M:"L"};function n(t,e,i,n,o,a,s,c,l,u,h){var f=r.util.cos(t),d=r.util.sin(t),g=r.util.cos(e),p=r.util.sin(e),v=i*o*g-n*a*p+s,m=n*o*g+i*a*p+c,y=u+l*(-i*o*d-n*a*f),b=h+l*(-n*o*d+i*a*f),_=v+l*(i*o*p+n*a*g),x=m+l*(n*o*p-i*a*g);return["C",y,b,_,x,v,m]}function o(t,e,i,o,s,c,l){var u=Math.PI,h=l*u/180,f=r.util.sin(h),d=r.util.cos(h),g=0,p=0;i=Math.abs(i),o=Math.abs(o);var v=-d*t*.5-f*e*.5,m=-d*e*.5+f*t*.5,y=i*i,b=o*o,_=m*m,x=v*v,C=y*b-y*_-b*x,I=0;if(C<0){var M=Math.sqrt(1-C/(y*b));i*=M,o*=M}else I=(s===c?-1:1)*Math.sqrt(C/(y*_+b*x));var S=I*i*m/o,w=-I*o*v/i,T=d*S-f*w+.5*t,A=f*S+d*w+.5*e,D=a(1,0,(v-S)/i,(m-w)/o),E=a((v-S)/i,(m-w)/o,(-v-S)/i,(-m-w)/o);0===c&&E>0?E-=2*u:1===c&&E<0&&(E+=2*u);for(var k=Math.ceil(Math.abs(E/u*2)),O=[],j=E/k,L=8/3*Math.sin(j/4)*Math.sin(j/4)/Math.sin(j/2),N=D+j,P=0;P<k;P++)O[P]=n(D,N,d,f,i,o,T,A,L,g,p),g=O[P][5],p=O[P][6],D=N,N+=j;return O}function a(t,e,i,n){var r=Math.atan2(e,t),o=Math.atan2(n,i);return o>=r?o-r:2*Math.PI-(r-o)}function s(e,i,n,o,a,s,c,l){var u;if(r.cachesBoundsOfCurve&&(u=t.call(arguments),r.boundsOfCurveCache[u]))return r.boundsOfCurveCache[u];var h,f,d,g,p,v,m,y,b=Math.sqrt,_=Math.min,x=Math.max,C=Math.abs,I=[],M=[[],[]];f=6*e-12*n+6*a,h=-3*e+9*n-9*a+3*c,d=3*n-3*e;for(var S=0;S<2;++S)if(S>0&&(f=6*i-12*o+6*s,h=-3*i+9*o-9*s+3*l,d=3*o-3*i),C(h)<1e-12){if(C(f)<1e-12)continue;g=-d/f,0<g&&g<1&&I.push(g)}else m=f*f-4*d*h,m<0||(y=b(m),p=(-f+y)/(2*h),0<p&&p<1&&I.push(p),v=(-f-y)/(2*h),0<v&&v<1&&I.push(v));var w,T,A,D=I.length,E=D;while(D--)g=I[D],A=1-g,w=A*A*A*e+3*A*A*g*n+3*A*g*g*a+g*g*g*c,M[0][D]=w,T=A*A*A*i+3*A*A*g*o+3*A*g*g*s+g*g*g*l,M[1][D]=T;M[0][E]=e,M[1][E]=i,M[0][E+1]=c,M[1][E+1]=l;var k=[{x:_.apply(null,M[0]),y:_.apply(null,M[1])},{x:x.apply(null,M[0]),y:x.apply(null,M[1])}];return r.cachesBoundsOfCurve&&(r.boundsOfCurveCache[u]=k),k}function c(t,e,i){for(var n=i[1],r=i[2],a=i[3],s=i[4],c=i[5],l=i[6],u=i[7],h=o(l-t,u-e,n,r,s,c,a),f=0,d=h.length;f<d;f++)h[f][1]+=t,h[f][2]+=e,h[f][3]+=t,h[f][4]+=e,h[f][5]+=t,h[f][6]+=e;return h}function l(t){var e,i,n,r,o,a,s=0,l=0,u=t.length,h=0,f=0,d=[];for(i=0;i<u;++i){switch(n=!1,e=t[i].slice(0),e[0]){case"l":e[0]="L",e[1]+=s,e[2]+=l;case"L":s=e[1],l=e[2];break;case"h":e[1]+=s;case"H":e[0]="L",e[2]=l,s=e[1];break;case"v":e[1]+=l;case"V":e[0]="L",l=e[1],e[1]=s,e[2]=l;break;case"m":e[0]="M",e[1]+=s,e[2]+=l;case"M":s=e[1],l=e[2],h=e[1],f=e[2];break;case"c":e[0]="C",e[1]+=s,e[2]+=l,e[3]+=s,e[4]+=l,e[5]+=s,e[6]+=l;case"C":o=e[3],a=e[4],s=e[5],l=e[6];break;case"s":e[0]="S",e[1]+=s,e[2]+=l,e[3]+=s,e[4]+=l;case"S":"C"===r?(o=2*s-o,a=2*l-a):(o=s,a=l),s=e[3],l=e[4],e[0]="C",e[5]=e[3],e[6]=e[4],e[3]=e[1],e[4]=e[2],e[1]=o,e[2]=a,o=e[3],a=e[4];break;case"q":e[0]="Q",e[1]+=s,e[2]+=l,e[3]+=s,e[4]+=l;case"Q":o=e[1],a=e[2],s=e[3],l=e[4];break;case"t":e[0]="T",e[1]+=s,e[2]+=l;case"T":"Q"===r?(o=2*s-o,a=2*l-a):(o=s,a=l),e[0]="Q",s=e[1],l=e[2],e[1]=o,e[2]=a,e[3]=s,e[4]=l;break;case"a":e[0]="A",e[6]+=s,e[7]+=l;case"A":n=!0,d=d.concat(c(s,l,e)),s=e[6],l=e[7];break;case"z":case"Z":s=h,l=f;break;default:}n||d.push(e),r=e[0]}return d}function u(t,e,i,n){return Math.sqrt((i-t)*(i-t)+(n-e)*(n-e))}function h(t){return t*t*t}function f(t){return 3*t*t*(1-t)}function d(t){return 3*t*(1-t)*(1-t)}function g(t){return(1-t)*(1-t)*(1-t)}function p(t,e,i,n,r,o,a,s){return function(c){var l=h(c),u=f(c),p=d(c),v=g(c);return{x:a*l+r*u+i*p+t*v,y:s*l+o*u+n*p+e*v}}}function v(t,e,i,n,r,o,a,s){return function(c){var l=1-c,u=3*l*l*(i-t)+6*l*c*(r-i)+3*c*c*(a-r),h=3*l*l*(n-e)+6*l*c*(o-n)+3*c*c*(s-o);return Math.atan2(h,u)}}function m(t){return t*t}function y(t){return 2*t*(1-t)}function b(t){return(1-t)*(1-t)}function _(t,e,i,n,r,o){return function(a){var s=m(a),c=y(a),l=b(a);return{x:r*s+i*c+t*l,y:o*s+n*c+e*l}}}function x(t,e,i,n,r,o){return function(a){var s=1-a,c=2*s*(i-t)+2*a*(r-i),l=2*s*(n-e)+2*a*(o-n);return Math.atan2(l,c)}}function C(t,e,i){var n,r,o={x:e,y:i},a=0;for(r=1;r<=100;r+=1)n=t(r/100),a+=u(o.x,o.y,n.x,n.y),o=n;return a}function I(t,e){var i,n,r,o=0,a=0,s=t.iterator,c={x:t.x,y:t.y},l=.01,h=t.angleFinder;while(a<e&&o<=1&&l>1e-4)i=s(o),r=o,n=u(c.x,c.y,i.x,i.y),n+a>e?(l/=2,o-=l):(c=i,o+=l,a+=n);return i.angle=h(r),i}function M(t){for(var e,i,n,r,o=0,a=t.length,s=0,c=0,l=0,h=0,f=[],d=0;d<a;d++){switch(e=t[d],n={x:s,y:c,command:e[0]},e[0]){case"M":n.length=0,l=s=e[1],h=c=e[2];break;case"L":n.length=u(s,c,e[1],e[2]),s=e[1],c=e[2];break;case"C":i=p(s,c,e[1],e[2],e[3],e[4],e[5],e[6]),r=v(s,c,e[1],e[2],e[3],e[4],e[5],e[6]),n.iterator=i,n.angleFinder=r,n.length=C(i,s,c),s=e[5],c=e[6];break;case"Q":i=_(s,c,e[1],e[2],e[3],e[4]),r=x(s,c,e[1],e[2],e[3],e[4]),n.iterator=i,n.angleFinder=r,n.length=C(i,s,c),s=e[3],c=e[4];break;case"Z":case"z":n.destX=l,n.destY=h,n.length=u(s,c,l,h),s=l,c=h;break}o+=n.length,f.push(n)}return f.push({length:o,x:s,y:c}),f}function S(t,e,i){i||(i=M(t));var n=0;while(e-i[n].length>0&&n<i.length-2)e-=i[n].length,n++;var o,a=i[n],s=e/a.length,c=a.command,l=t[n];switch(c){case"M":return{x:a.x,y:a.y,angle:0};case"Z":case"z":return o=new r.Point(a.x,a.y).lerp(new r.Point(a.destX,a.destY),s),o.angle=Math.atan2(a.destY-a.y,a.destX-a.x),o;case"L":return o=new r.Point(a.x,a.y).lerp(new r.Point(l[1],l[2]),s),o.angle=Math.atan2(l[2]-a.y,l[1]-a.x),o;case"C":return I(a,e);case"Q":return I(a,e)}}function w(t){var n,o,a,s,c,l=[],u=[],h=r.rePathCommand,f="[-+]?(?:\\d*\\.\\d+|\\d+\\.?)(?:[eE][-+]?\\d+)?\\s*",d="("+f+")"+r.commaWsp,g="([01])"+r.commaWsp+"?",p=d+"?"+d+"?"+d+g+g+d+"?("+f+")",v=new RegExp(p,"g");if(!t||!t.match)return l;c=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);for(var m,y=0,b=c.length;y<b;y++){n=c[y],s=n.slice(1).trim(),u.length=0;var _=n.charAt(0);if(m=[_],"a"===_.toLowerCase())for(var x;x=v.exec(s);)for(var C=1;C<x.length;C++)u.push(x[C]);else while(a=h.exec(s))u.push(a[0]);C=0;for(var I=u.length;C<I;C++)o=parseFloat(u[C]),isNaN(o)||m.push(o);var M=e[_.toLowerCase()],S=i[_]||_;if(m.length-1>M)for(var w=1,T=m.length;w<T;w+=M)l.push([_].concat(m.slice(w,w+M))),_=S;else l.push(m)}return l}function T(t,e){var i,n=[],o=new r.Point(t[0].x,t[0].y),a=new r.Point(t[1].x,t[1].y),s=t.length,c=1,l=0,u=s>2;for(e=e||0,u&&(c=t[2].x<a.x?-1:t[2].x===a.x?0:1,l=t[2].y<a.y?-1:t[2].y===a.y?0:1),n.push(["M",o.x-c*e,o.y-l*e]),i=1;i<s;i++){if(!o.eq(a)){var h=o.midPointFrom(a);n.push(["Q",o.x,o.y,h.x,h.y])}o=t[i],i+1<t.length&&(a=t[i+1])}return u&&(c=o.x>t[i-2].x?1:o.x===t[i-2].x?0:-1,l=o.y>t[i-2].y?1:o.y===t[i-2].y?0:-1),n.push(["L",o.x+c*e,o.y+l*e]),n}function A(t,e,i){return i&&(e=r.util.multiplyTransformMatrices(e,[1,0,0,1,-i.x,-i.y])),t.map((function(t){for(var i=t.slice(0),n={},o=1;o<t.length-1;o+=2)n.x=t[o],n.y=t[o+1],n=r.util.transformPoint(n,e),i[o]=n.x,i[o+1]=n.y;return i}))}function D(t,e,i,n,r,a,c,l,u){for(var h,f=0,d=0,g=[],p=o(l-t,u-e,i,n,a,c,r),v=0,m=p.length;v<m;v++)h=s(f,d,p[v][1],p[v][2],p[v][3],p[v][4],p[v][5],p[v][6]),g.push({x:h[0].x+t,y:h[0].y+e}),g.push({x:h[1].x+t,y:h[1].y+e}),f=p[v][5],d=p[v][6];return g}function E(t,e,i,n){n=n.slice(0).unshift("X");var r=c(e,i,n);r.forEach((function(e){t.bezierCurveTo.apply(t,e.slice(1))}))}r.util.joinPath=function(t){return t.map((function(t){return t.join(" ")})).join(" ")},r.util.parsePath=w,r.util.makePathSimpler=l,r.util.getSmoothPathFromPoints=T,r.util.getPathSegmentsInfo=M,r.util.getBoundsOfCurve=s,r.util.getPointOnPath=S,r.util.transformPath=A,r.util.fromArcToBeizers=c,r.util.getBoundsOfArc=D,r.util.drawArc=E}(),function(){var t=Array.prototype.slice;function e(e,i){for(var n=t.call(arguments,2),r=[],o=0,a=e.length;o<a;o++)r[o]=n.length?e[o][i].apply(e[o],n):e[o][i].call(e[o]);return r}function i(t,e){return a(t,e,(function(t,e){return t>=e}))}function n(t,e){return a(t,e,(function(t,e){return t<e}))}function o(t,e){var i=t.length;while(i--)t[i]=e;return t}function a(t,e,i){if(t&&0!==t.length){var n=t.length-1,r=e?t[n][e]:t[n];if(e)while(n--)i(t[n][e],r)&&(r=t[n][e]);else while(n--)i(t[n],r)&&(r=t[n]);return r}}r.util.array={fill:o,invoke:e,min:n,max:i}}(),function(){function t(e,i,n){if(n)if(!r.isLikelyNode&&i instanceof Element)e=i;else if(i instanceof Array){e=[];for(var o=0,a=i.length;o<a;o++)e[o]=t({},i[o],n)}else if(i&&"object"===typeof i)for(var s in i)"canvas"===s||"group"===s?e[s]=null:i.hasOwnProperty(s)&&(e[s]=t({},i[s],n));else e=i;else for(var s in i)e[s]=i[s];return e}function e(e,i){return t({},e,i)}r.util.object={extend:t,clone:e},r.util.object.extend(r.util,r.Observable)}(),function(){function t(t){return t.replace(/-+(.)?/g,(function(t,e){return e?e.toUpperCase():""}))}function e(t,e){return t.charAt(0).toUpperCase()+(e?t.slice(1):t.slice(1).toLowerCase())}function i(t){return t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function n(t){var e,i=0,n=[];for(i=0,e;i<t.length;i++)!1!==(e=o(t,i))&&n.push(e);return n}function o(t,e){var i=t.charCodeAt(e);if(isNaN(i))return"";if(i<55296||i>57343)return t.charAt(e);if(55296<=i&&i<=56319){if(t.length<=e+1)throw"High surrogate without following low surrogate";var n=t.charCodeAt(e+1);if(56320>n||n>57343)throw"High surrogate without following low surrogate";return t.charAt(e)+t.charAt(e+1)}if(0===e)throw"Low surrogate without preceding high surrogate";var r=t.charCodeAt(e-1);if(55296>r||r>56319)throw"Low surrogate without preceding high surrogate";return!1}r.util.string={camelize:t,capitalize:e,escapeXml:i,graphemeSplit:n}}(),function(){var t=Array.prototype.slice,e=function(){},i=function(){for(var t in{toString:1})if("toString"===t)return!1;return!0}(),n=function(t,e,n){for(var r in e)r in t.prototype&&"function"===typeof t.prototype[r]&&(e[r]+"").indexOf("callSuper")>-1?t.prototype[r]=function(t){return function(){var i=this.constructor.superclass;this.constructor.superclass=n;var r=e[t].apply(this,arguments);if(this.constructor.superclass=i,"initialize"!==t)return r}}(r):t.prototype[r]=e[r],i&&(e.toString!==Object.prototype.toString&&(t.prototype.toString=e.toString),e.valueOf!==Object.prototype.valueOf&&(t.prototype.valueOf=e.valueOf))};function o(){}function a(e){var i=null,n=this;while(n.constructor.superclass){var r=n.constructor.superclass.prototype[e];if(n[e]!==r){i=r;break}n=n.constructor.superclass.prototype}return i?arguments.length>1?i.apply(this,t.call(arguments,1)):i.call(this):console.log("tried to callSuper "+e+", method not found in prototype chain",this)}function s(){var i=null,r=t.call(arguments,0);function s(){this.initialize.apply(this,arguments)}"function"===typeof r[0]&&(i=r.shift()),s.superclass=i,s.subclasses=[],i&&(o.prototype=i.prototype,s.prototype=new o,i.subclasses.push(s));for(var c=0,l=r.length;c<l;c++)n(s,r[c],i);return s.prototype.initialize||(s.prototype.initialize=e),s.prototype.constructor=s,s.prototype.callSuper=a,s}r.util.createClass=s}(),function(){var t=!!r.document.createElement("div").attachEvent,e=["touchstart","touchmove","touchend"];function i(t){var e=t.changedTouches;return e&&e[0]?e[0]:t}r.util.addListener=function(e,i,n,r){e&&e.addEventListener(i,n,!t&&r)},r.util.removeListener=function(e,i,n,r){e&&e.removeEventListener(i,n,!t&&r)},r.util.getPointer=function(t){var e=t.target,n=r.util.getScrollLeftTop(e),o=i(t);return{x:o.clientX+n.left,y:o.clientY+n.top}},r.util.isTouchEvent=function(t){return e.indexOf(t.type)>-1||"touch"===t.pointerType}}(),function(){function t(t,e){var i=t.style;if(!i)return t;if("string"===typeof e)return t.style.cssText+=";"+e,e.indexOf("opacity")>-1?a(t,e.match(/opacity:\s*(\d?\.?\d*)/)[1]):t;for(var n in e)if("opacity"===n)a(t,e[n]);else{var r="float"===n||"cssFloat"===n?"undefined"===typeof i.styleFloat?"cssFloat":"styleFloat":n;i[r]=e[n]}return t}var e=r.document.createElement("div"),i="string"===typeof e.style.opacity,n="string"===typeof e.style.filter,o=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,a=function(t){return t};i?a=function(t,e){return t.style.opacity=e,t}:n&&(a=function(t,e){var i=t.style;return t.currentStyle&&!t.currentStyle.hasLayout&&(i.zoom=1),o.test(i.filter)?(e=e>=.9999?"":"alpha(opacity="+100*e+")",i.filter=i.filter.replace(o,e)):i.filter+=" alpha(opacity="+100*e+")",t}),r.util.setStyle=t}(),function(){var t=Array.prototype.slice;function e(t){return"string"===typeof t?r.document.getElementById(t):t}var i,n,o=function(e){return t.call(e,0)};try{i=o(r.document.childNodes)instanceof Array}catch(g){}function a(t,e){var i=r.document.createElement(t);for(var n in e)"class"===n?i.className=e[n]:"for"===n?i.htmlFor=e[n]:i.setAttribute(n,e[n]);return i}function s(t,e){t&&-1===(" "+t.className+" ").indexOf(" "+e+" ")&&(t.className+=(t.className?" ":"")+e)}function c(t,e,i){return"string"===typeof e&&(e=a(e,i)),t.parentNode&&t.parentNode.replaceChild(e,t),e.appendChild(t),e}function l(t){var e=0,i=0,n=r.document.documentElement,o=r.document.body||{scrollLeft:0,scrollTop:0};while(t&&(t.parentNode||t.host))if(t=t.parentNode||t.host,t===r.document?(e=o.scrollLeft||n.scrollLeft||0,i=o.scrollTop||n.scrollTop||0):(e+=t.scrollLeft||0,i+=t.scrollTop||0),1===t.nodeType&&"fixed"===t.style.position)break;return{left:e,top:i}}function u(t){var e,i,r=t&&t.ownerDocument,o={left:0,top:0},a={left:0,top:0},s={borderLeftWidth:"left",borderTopWidth:"top",paddingLeft:"left",paddingTop:"top"};if(!r)return a;for(var c in s)a[s[c]]+=parseInt(n(t,c),10)||0;return e=r.documentElement,"undefined"!==typeof t.getBoundingClientRect&&(o=t.getBoundingClientRect()),i=l(t),{left:o.left+i.left-(e.clientLeft||0)+a.left,top:o.top+i.top-(e.clientTop||0)+a.top}}function h(t){var e=r.jsdomImplForWrapper(t);return e._canvas||e._image}function f(t){if(r.isLikelyNode){var e=r.jsdomImplForWrapper(t);e&&(e._image=null,e._canvas=null,e._currentSrc=null,e._attributes=null,e._classList=null)}}function d(t,e){t.imageSmoothingEnabled=t.imageSmoothingEnabled||t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled||t.oImageSmoothingEnabled,t.imageSmoothingEnabled=e}i||(o=function(t){var e=new Array(t.length),i=t.length;while(i--)e[i]=t[i];return e}),n=r.document.defaultView&&r.document.defaultView.getComputedStyle?function(t,e){var i=r.document.defaultView.getComputedStyle(t,null);return i?i[e]:void 0}:function(t,e){var i=t.style[e];return!i&&t.currentStyle&&(i=t.currentStyle[e]),i},function(){var t=r.document.documentElement.style,e="userSelect"in t?"userSelect":"MozUserSelect"in t?"MozUserSelect":"WebkitUserSelect"in t?"WebkitUserSelect":"KhtmlUserSelect"in t?"KhtmlUserSelect":"";function i(t){return"undefined"!==typeof t.onselectstart&&(t.onselectstart=r.util.falseFunction),e?t.style[e]="none":"string"===typeof t.unselectable&&(t.unselectable="on"),t}function n(t){return"undefined"!==typeof t.onselectstart&&(t.onselectstart=null),e?t.style[e]="":"string"===typeof t.unselectable&&(t.unselectable=""),t}r.util.makeElementUnselectable=i,r.util.makeElementSelectable=n}(),r.util.setImageSmoothing=d,r.util.getById=e,r.util.toArray=o,r.util.addClass=s,r.util.makeElement=a,r.util.wrapElement=c,r.util.getScrollLeftTop=l,r.util.getElementOffset=u,r.util.getNodeCanvas=h,r.util.cleanUpJsdomNode=f}(),function(){function t(t,e){return t+(/\?/.test(t)?"&":"?")+e}function e(){}function i(i,n){n||(n={});var o=n.method?n.method.toUpperCase():"GET",a=n.onComplete||function(){},s=new r.window.XMLHttpRequest,c=n.body||n.parameters;return s.onreadystatechange=function(){4===s.readyState&&(a(s),s.onreadystatechange=e)},"GET"===o&&(c=null,"string"===typeof n.parameters&&(i=t(i,n.parameters))),s.open(o,i,!0),"POST"!==o&&"PUT"!==o||s.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),s.send(c),s}r.util.request=i}(),r.log=console.log,r.warn=console.warn,function(){function t(){return!1}function e(t,e,i,n){return-i*Math.cos(t/n*(Math.PI/2))+i+e}function i(i){var n=!1;return a((function(r){i||(i={});var o,s=r||+new Date,c=i.duration||500,l=s+c,u=i.onChange||t,h=i.abort||t,f=i.onComplete||t,d=i.easing||e,g="startValue"in i?i.startValue:0,p="endValue"in i?i.endValue:100,v=i.byValue||p-g;i.onStart&&i.onStart(),function t(e){o=e||+new Date;var i=o>l?c:o-s,r=i/c,m=d(i,g,v,c),y=Math.abs((m-g)/v);if(!n){if(!h(m,y,r))return o>l?(u(p,1,1),void f(p,1,1)):(u(m,y,r),void a(t));f(p,1,1)}}(s)})),function(){n=!0}}var n=r.window.requestAnimationFrame||r.window.webkitRequestAnimationFrame||r.window.mozRequestAnimationFrame||r.window.oRequestAnimationFrame||r.window.msRequestAnimationFrame||function(t){return r.window.setTimeout(t,1e3/60)},o=r.window.cancelAnimationFrame||r.window.clearTimeout;function a(){return n.apply(r.window,arguments)}function s(){return o.apply(r.window,arguments)}r.util.animate=i,r.util.requestAnimFrame=a,r.util.cancelAnimFrame=s}(),function(){function t(t,e,i){var n="rgba("+parseInt(t[0]+i*(e[0]-t[0]),10)+","+parseInt(t[1]+i*(e[1]-t[1]),10)+","+parseInt(t[2]+i*(e[2]-t[2]),10);return n+=","+(t&&e?parseFloat(t[3]+i*(e[3]-t[3])):1),n+=")",n}function e(e,i,n,o){var a=new r.Color(e).getSource(),s=new r.Color(i).getSource(),c=o.onComplete,l=o.onChange;return o=o||{},r.util.animate(r.util.object.extend(o,{duration:n||500,startValue:a,endValue:s,byValue:s,easing:function(e,i,n,r){var a=o.colorEasing?o.colorEasing(e,r):1-Math.cos(e/r*(Math.PI/2));return t(i,n,a)},onComplete:function(e,i,n){if(c)return c(t(s,s,0),i,n)},onChange:function(e,i,n){if(l){if(Array.isArray(e))return l(t(e,e,0),i,n);l(e,i,n)}}}))}r.util.animateColor=e}(),function(){function t(t,e,i,n){return t<Math.abs(e)?(t=e,n=i/4):n=0===e&&0===t?i/(2*Math.PI)*Math.asin(1):i/(2*Math.PI)*Math.asin(e/t),{a:t,c:e,p:i,s:n}}function e(t,e,i){return t.a*Math.pow(2,10*(e-=1))*Math.sin((e*i-t.s)*(2*Math.PI)/t.p)}function i(t,e,i,n){return i*((t=t/n-1)*t*t+1)+e}function n(t,e,i,n){return t/=n/2,t<1?i/2*t*t*t+e:i/2*((t-=2)*t*t+2)+e}function o(t,e,i,n){return i*(t/=n)*t*t*t+e}function a(t,e,i,n){return-i*((t=t/n-1)*t*t*t-1)+e}function s(t,e,i,n){return t/=n/2,t<1?i/2*t*t*t*t+e:-i/2*((t-=2)*t*t*t-2)+e}function c(t,e,i,n){return i*(t/=n)*t*t*t*t+e}function l(t,e,i,n){return i*((t=t/n-1)*t*t*t*t+1)+e}function u(t,e,i,n){return t/=n/2,t<1?i/2*t*t*t*t*t+e:i/2*((t-=2)*t*t*t*t+2)+e}function h(t,e,i,n){return-i*Math.cos(t/n*(Math.PI/2))+i+e}function f(t,e,i,n){return i*Math.sin(t/n*(Math.PI/2))+e}function d(t,e,i,n){return-i/2*(Math.cos(Math.PI*t/n)-1)+e}function g(t,e,i,n){return 0===t?e:i*Math.pow(2,10*(t/n-1))+e}function p(t,e,i,n){return t===n?e+i:i*(1-Math.pow(2,-10*t/n))+e}function v(t,e,i,n){return 0===t?e:t===n?e+i:(t/=n/2,t<1?i/2*Math.pow(2,10*(t-1))+e:i/2*(2-Math.pow(2,-10*--t))+e)}function m(t,e,i,n){return-i*(Math.sqrt(1-(t/=n)*t)-1)+e}function y(t,e,i,n){return i*Math.sqrt(1-(t=t/n-1)*t)+e}function b(t,e,i,n){return t/=n/2,t<1?-i/2*(Math.sqrt(1-t*t)-1)+e:i/2*(Math.sqrt(1-(t-=2)*t)+1)+e}function _(i,n,r,o){var a=1.70158,s=0,c=r;if(0===i)return n;if(i/=o,1===i)return n+r;s||(s=.3*o);var l=t(c,r,s,a);return-e(l,i,o)+n}function x(e,i,n,r){var o=1.70158,a=0,s=n;if(0===e)return i;if(e/=r,1===e)return i+n;a||(a=.3*r);var c=t(s,n,a,o);return c.a*Math.pow(2,-10*e)*Math.sin((e*r-c.s)*(2*Math.PI)/c.p)+c.c+i}function C(i,n,r,o){var a=1.70158,s=0,c=r;if(0===i)return n;if(i/=o/2,2===i)return n+r;s||(s=o*(.3*1.5));var l=t(c,r,s,a);return i<1?-.5*e(l,i,o)+n:l.a*Math.pow(2,-10*(i-=1))*Math.sin((i*o-l.s)*(2*Math.PI)/l.p)*.5+l.c+n}function I(t,e,i,n,r){return void 0===r&&(r=1.70158),i*(t/=n)*t*((r+1)*t-r)+e}function M(t,e,i,n,r){return void 0===r&&(r=1.70158),i*((t=t/n-1)*t*((r+1)*t+r)+1)+e}function S(t,e,i,n,r){return void 0===r&&(r=1.70158),t/=n/2,t<1?i/2*(t*t*((1+(r*=1.525))*t-r))+e:i/2*((t-=2)*t*((1+(r*=1.525))*t+r)+2)+e}function w(t,e,i,n){return i-T(n-t,0,i,n)+e}function T(t,e,i,n){return(t/=n)<1/2.75?i*(7.5625*t*t)+e:t<2/2.75?i*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?i*(7.5625*(t-=2.25/2.75)*t+.9375)+e:i*(7.5625*(t-=2.625/2.75)*t+.984375)+e}function A(t,e,i,n){return t<n/2?.5*w(2*t,0,i,n)+e:.5*T(2*t-n,0,i,n)+.5*i+e}r.util.ease={easeInQuad:function(t,e,i,n){return i*(t/=n)*t+e},easeOutQuad:function(t,e,i,n){return-i*(t/=n)*(t-2)+e},easeInOutQuad:function(t,e,i,n){return t/=n/2,t<1?i/2*t*t+e:-i/2*(--t*(t-2)-1)+e},easeInCubic:function(t,e,i,n){return i*(t/=n)*t*t+e},easeOutCubic:i,easeInOutCubic:n,easeInQuart:o,easeOutQuart:a,easeInOutQuart:s,easeInQuint:c,easeOutQuint:l,easeInOutQuint:u,easeInSine:h,easeOutSine:f,easeInOutSine:d,easeInExpo:g,easeOutExpo:p,easeInOutExpo:v,easeInCirc:m,easeOutCirc:y,easeInOutCirc:b,easeInElastic:_,easeOutElastic:x,easeInOutElastic:C,easeInBack:I,easeOutBack:M,easeInOutBack:S,easeInBounce:w,easeOutBounce:T,easeInOutBounce:A}}(),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend,n=e.util.object.clone,r=e.util.toFixed,o=e.util.parseUnit,a=e.util.multiplyTransformMatrices,s=["path","circle","polygon","polyline","ellipse","rect","line","image","text"],c=["symbol","image","marker","pattern","view","svg"],l=["pattern","defs","symbol","metadata","clipPath","mask","desc"],u=["symbol","g","a","svg","clipPath","defs"],h={cx:"left",x:"left",r:"radius",cy:"top",y:"top",display:"visible",visibility:"visible",transform:"transformMatrix","fill-opacity":"fillOpacity","fill-rule":"fillRule","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","letter-spacing":"charSpacing","paint-order":"paintFirst","stroke-dasharray":"strokeDashArray","stroke-dashoffset":"strokeDashOffset","stroke-linecap":"strokeLineCap","stroke-linejoin":"strokeLineJoin","stroke-miterlimit":"strokeMiterLimit","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","text-decoration":"textDecoration","text-anchor":"textAnchor",opacity:"opacity","clip-path":"clipPath","clip-rule":"clipRule","vector-effect":"strokeUniform","image-rendering":"imageSmoothing"},f={stroke:"strokeOpacity",fill:"fillOpacity"},d="font-size",g="clip-path";function p(t){return t in h?h[t]:t}function v(t,i,n,r){var s,c="[object Array]"===Object.prototype.toString.call(i);if("fill"!==t&&"stroke"!==t||"none"!==i){if("strokeUniform"===t)return"non-scaling-stroke"===i;if("strokeDashArray"===t)i="none"===i?null:i.replace(/,/g," ").split(/\s+/).map(parseFloat);else if("transformMatrix"===t)i=n&&n.transformMatrix?a(n.transformMatrix,e.parseTransformAttribute(i)):e.parseTransformAttribute(i);else if("visible"===t)i="none"!==i&&"hidden"!==i,n&&!1===n.visible&&(i=!1);else if("opacity"===t)i=parseFloat(i),n&&"undefined"!==typeof n.opacity&&(i*=n.opacity);else if("textAnchor"===t)i="start"===i?"left":"end"===i?"right":"center";else if("charSpacing"===t)s=o(i,r)/r*1e3;else if("paintFirst"===t){var l=i.indexOf("fill"),u=i.indexOf("stroke");i="fill";(l>-1&&u>-1&&u<l||-1===l&&u>-1)&&(i="stroke")}else{if("href"===t||"xlink:href"===t||"font"===t)return i;if("imageSmoothing"===t)return"optimizeQuality"===i;s=c?i.map(o):o(i,r)}}else i="";return!c&&isNaN(s)?i:s}function m(t){return new RegExp("^("+t.join("|")+")\\b","i")}function y(t){for(var i in f)if("undefined"!==typeof t[f[i]]&&""!==t[i]){if("undefined"===typeof t[i]){if(!e.Object.prototype[i])continue;t[i]=e.Object.prototype[i]}if(0!==t[i].indexOf("url(")){var n=new e.Color(t[i]);t[i]=n.setAlpha(r(n.getAlpha()*t[f[i]],2)).toRgba()}}return t}function b(t,e){var i,n,r,o,a=[];for(r=0,o=e.length;r<o;r++)i=e[r],n=t.getElementsByTagName(i),a=a.concat(Array.prototype.slice.call(n));return a}function _(t,e){var i,n;t.replace(/;\s*$/,"").split(";").forEach((function(t){var r=t.split(":");i=r[0].trim().toLowerCase(),n=r[1].trim(),e[i]=n}))}function x(t,e){var i,n;for(var r in t)"undefined"!==typeof t[r]&&(i=r.toLowerCase(),n=t[r],e[i]=n)}function C(t,i){var n={};for(var r in e.cssRules[i])if(I(t,r.split(" ")))for(var o in e.cssRules[i][r])n[o]=e.cssRules[i][r][o];return n}function I(t,e){var i,n=!0;return i=S(t,e.pop()),i&&e.length&&(n=M(t,e)),i&&n&&0===e.length}function M(t,e){var i,n=!0;while(t.parentNode&&1===t.parentNode.nodeType&&e.length)n&&(i=e.pop()),t=t.parentNode,n=S(t,i);return 0===e.length}function S(t,e){var i,n,r=t.nodeName,o=t.getAttribute("class"),a=t.getAttribute("id");if(i=new RegExp("^"+r,"i"),e=e.replace(i,""),a&&e.length&&(i=new RegExp("#"+a+"(?![a-zA-Z\\-]+)","i"),e=e.replace(i,"")),o&&e.length)for(o=o.split(" "),n=o.length;n--;)i=new RegExp("\\."+o[n]+"(?![a-zA-Z\\-]+)","i"),e=e.replace(i,"");return 0===e.length}function w(t,e){var i;if(t.getElementById&&(i=t.getElementById(e)),i)return i;var n,r,o,a=t.getElementsByTagName("*");for(r=0,o=a.length;r<o;r++)if(n=a[r],e===n.getAttribute("id"))return n}function T(t){var i=b(t,["use","svg:use"]),n=0;while(i.length&&n<i.length){var r=i[n],o=r.getAttribute("xlink:href")||r.getAttribute("href");if(null===o)return;var a,s,c,l,u,h=o.substr(1),f=r.getAttribute("x")||0,d=r.getAttribute("y")||0,g=w(t,h).cloneNode(!0),p=(g.getAttribute("transform")||"")+" translate("+f+", "+d+")",v=i.length,m=e.svgNS;if(D(g),/^svg$/i.test(g.nodeName)){var y=g.ownerDocument.createElementNS(m,"g");for(c=0,l=g.attributes,u=l.length;c<u;c++)s=l.item(c),y.setAttributeNS(m,s.nodeName,s.nodeValue);while(g.firstChild)y.appendChild(g.firstChild);g=y}for(c=0,l=r.attributes,u=l.length;c<u;c++)s=l.item(c),"x"!==s.nodeName&&"y"!==s.nodeName&&"xlink:href"!==s.nodeName&&"href"!==s.nodeName&&("transform"===s.nodeName?p=s.nodeValue+" "+p:g.setAttribute(s.nodeName,s.nodeValue));g.setAttribute("transform",p),g.setAttribute("instantiated_by_use","1"),g.removeAttribute("id"),a=r.parentNode,a.replaceChild(g,r),i.length===v&&n++}}e.svgValidTagNamesRegEx=m(s),e.svgViewBoxElementsRegEx=m(c),e.svgInvalidAncestorsRegEx=m(l),e.svgValidParentsRegEx=m(u),e.cssRules={},e.gradientDefs={},e.clipPaths={},e.parseTransformAttribute=function(){function t(t,i){var n=e.util.cos(i[0]),r=e.util.sin(i[0]),o=0,a=0;3===i.length&&(o=i[1],a=i[2]),t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=o-(n*o-r*a),t[5]=a-(r*o+n*a)}function i(t,e){var i=e[0],n=2===e.length?e[1]:e[0];t[0]=i,t[3]=n}function n(t,i,n){t[n]=Math.tan(e.util.degreesToRadians(i[0]))}function r(t,e){t[4]=e[0],2===e.length&&(t[5]=e[1])}var o=e.iMatrix,a=e.reNum,s=e.commaWsp,c="(?:(skewX)\\s*\\(\\s*("+a+")\\s*\\))",l="(?:(skewY)\\s*\\(\\s*("+a+")\\s*\\))",u="(?:(rotate)\\s*\\(\\s*("+a+")(?:"+s+"("+a+")"+s+"("+a+"))?\\s*\\))",h="(?:(scale)\\s*\\(\\s*("+a+")(?:"+s+"("+a+"))?\\s*\\))",f="(?:(translate)\\s*\\(\\s*("+a+")(?:"+s+"("+a+"))?\\s*\\))",d="(?:(matrix)\\s*\\(\\s*("+a+")"+s+"("+a+")"+s+"("+a+")"+s+"("+a+")"+s+"("+a+")"+s+"("+a+")\\s*\\))",g="(?:"+d+"|"+f+"|"+h+"|"+u+"|"+c+"|"+l+")",p="(?:"+g+"(?:"+s+"*"+g+")*)",v="^\\s*(?:"+p+"?)\\s*$",m=new RegExp(v),y=new RegExp(g,"g");return function(a){var s=o.concat(),c=[];if(!a||a&&!m.test(a))return s;a.replace(y,(function(a){var l=new RegExp(g).exec(a).filter((function(t){return!!t})),u=l[1],h=l.slice(2).map(parseFloat);switch(u){case"translate":r(s,h);break;case"rotate":h[0]=e.util.degreesToRadians(h[0]),t(s,h);break;case"scale":i(s,h);break;case"skewX":n(s,h,2);break;case"skewY":n(s,h,1);break;case"matrix":s=h;break}c.push(s.concat()),s=o.concat()}));var l=c[0];while(c.length>1)c.shift(),l=e.util.multiplyTransformMatrices(l,c[0]);return l}}();var A=new RegExp("^\\s*("+e.reNum+"+)\\s*,?\\s*("+e.reNum+"+)\\s*,?\\s*("+e.reNum+"+)\\s*,?\\s*("+e.reNum+"+)\\s*$");function D(t){if(!e.svgViewBoxElementsRegEx.test(t.nodeName))return{};var i,n,r,a,s=t.getAttribute("viewBox"),c=1,l=1,u=0,h=0,f=t.getAttribute("width"),d=t.getAttribute("height"),g=t.getAttribute("x")||0,p=t.getAttribute("y")||0,v=t.getAttribute("preserveAspectRatio")||"",m=!s||!(s=s.match(A)),y=!f||!d||"100%"===f||"100%"===d,b=m&&y,_={},x="",C=0,I=0;if(_.width=0,_.height=0,_.toBeParsed=b,m&&(g||p)&&t.parentNode&&"#document"!==t.parentNode.nodeName&&(x=" translate("+o(g)+" "+o(p)+") ",r=(t.getAttribute("transform")||"")+x,t.setAttribute("transform",r),t.removeAttribute("x"),t.removeAttribute("y")),b)return _;if(m)return _.width=o(f),_.height=o(d),_;if(u=-parseFloat(s[1]),h=-parseFloat(s[2]),i=parseFloat(s[3]),n=parseFloat(s[4]),_.minX=u,_.minY=h,_.viewBoxWidth=i,_.viewBoxHeight=n,y?(_.width=i,_.height=n):(_.width=o(f),_.height=o(d),c=_.width/i,l=_.height/n),v=e.util.parsePreserveAspectRatioAttribute(v),"none"!==v.alignX&&("meet"===v.meetOrSlice&&(l=c=c>l?l:c),"slice"===v.meetOrSlice&&(l=c=c>l?c:l),C=_.width-i*c,I=_.height-n*c,"Mid"===v.alignX&&(C/=2),"Mid"===v.alignY&&(I/=2),"Min"===v.alignX&&(C=0),"Min"===v.alignY&&(I=0)),1===c&&1===l&&0===u&&0===h&&0===g&&0===p)return _;if((g||p)&&"#document"!==t.parentNode.nodeName&&(x=" translate("+o(g)+" "+o(p)+") "),r=x+" matrix("+c+" 0 0 "+l+" "+(u*c+C)+" "+(h*l+I)+") ","svg"===t.nodeName){a=t.ownerDocument.createElementNS(e.svgNS,"g");while(t.firstChild)a.appendChild(t.firstChild);t.appendChild(a)}else a=t,a.removeAttribute("x"),a.removeAttribute("y"),r=a.getAttribute("transform")+r;return a.setAttribute("transform",r),_}function E(t,e){while(t&&(t=t.parentNode))if(t.nodeName&&e.test(t.nodeName.replace("svg:",""))&&!t.getAttribute("instantiated_by_use"))return!0;return!1}function k(t,e){var i=["gradientTransform","x1","x2","y1","y2","gradientUnits","cx","cy","r","fx","fy"],n="xlink:href",r=e.getAttribute(n).substr(1),o=w(t,r);if(o&&o.getAttribute(n)&&k(t,o),i.forEach((function(t){o&&!e.hasAttribute(t)&&o.hasAttribute(t)&&e.setAttribute(t,o.getAttribute(t))})),!e.children.length){var a=o.cloneNode(!0);while(a.firstChild)e.appendChild(a.firstChild)}e.removeAttribute(n)}e.parseSVGDocument=function(t,i,r,o){if(t){T(t);var a,s,c=e.Object.__uid++,l=D(t),u=e.util.toArray(t.getElementsByTagName("*"));if(l.crossOrigin=o&&o.crossOrigin,l.svgUid=c,0===u.length&&e.isLikelyNode){u=t.selectNodes('//*[name(.)!="svg"]');var h=[];for(a=0,s=u.length;a<s;a++)h[a]=u[a];u=h}var f=u.filter((function(t){return D(t),e.svgValidTagNamesRegEx.test(t.nodeName.replace("svg:",""))&&!E(t,e.svgInvalidAncestorsRegEx)}));if(!f||f&&!f.length)i&&i([],{});else{var d={};u.filter((function(t){return"clipPath"===t.nodeName.replace("svg:","")})).forEach((function(t){var i=t.getAttribute("id");d[i]=e.util.toArray(t.getElementsByTagName("*")).filter((function(t){return e.svgValidTagNamesRegEx.test(t.nodeName.replace("svg:",""))}))})),e.gradientDefs[c]=e.getGradientDefs(t),e.cssRules[c]=e.getCSSRules(t),e.clipPaths[c]=d,e.parseElements(f,(function(t,n){i&&(i(t,l,n,u),delete e.gradientDefs[c],delete e.cssRules[c],delete e.clipPaths[c])}),n(l),r,o)}}};var O=new RegExp("(normal|italic)?\\s*(normal|small-caps)?\\s*(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)?\\s*("+e.reNum+"(?:px|cm|mm|em|pt|pc|in)*)(?:\\/(normal|"+e.reNum+"))?\\s+(.*)");i(e,{parseFontDeclaration:function(t,e){var i=t.match(O);if(i){var n=i[1],r=i[3],a=i[4],s=i[5],c=i[6];n&&(e.fontStyle=n),r&&(e.fontWeight=isNaN(parseFloat(r))?r:parseFloat(r)),a&&(e.fontSize=o(a)),c&&(e.fontFamily=c),s&&(e.lineHeight="normal"===s?1:s)}},getGradientDefs:function(t){var e,i=["linearGradient","radialGradient","svg:linearGradient","svg:radialGradient"],n=b(t,i),r=0,o={};r=n.length;while(r--)e=n[r],e.getAttribute("xlink:href")&&k(t,e),o[e.getAttribute("id")]=e;return o},parseAttributes:function(t,n,r){if(t){var a,s,c,l={};"undefined"===typeof r&&(r=t.getAttribute("svgUid")),t.parentNode&&e.svgValidParentsRegEx.test(t.parentNode.nodeName)&&(l=e.parseAttributes(t.parentNode,n,r));var u=n.reduce((function(e,i){return a=t.getAttribute(i),a&&(e[i]=a),e}),{}),h=i(C(t,r),e.parseStyleAttribute(t));u=i(u,h),h[g]&&t.setAttribute(g,h[g]),s=c=l.fontSize||e.Text.DEFAULT_SVG_FONT_SIZE,u[d]&&(u[d]=s=o(u[d],c));var f,m,b={};for(var _ in u)f=p(_),m=v(f,u[_],l,s),b[f]=m;b&&b.font&&e.parseFontDeclaration(b.font,b);var x=i(l,b);return e.svgValidParentsRegEx.test(t.nodeName)?x:y(x)}},parseElements:function(t,i,n,r,o){new e.ElementsParser(t,i,n,r,o).parse()},parseStyleAttribute:function(t){var e={},i=t.getAttribute("style");return i?("string"===typeof i?_(i,e):x(i,e),e):e},parsePointsAttribute:function(t){if(!t)return null;t=t.replace(/,/g," ").trim(),t=t.split(/\s+/);var e,i,n=[];for(e=0,i=t.length;e<i;e+=2)n.push({x:parseFloat(t[e]),y:parseFloat(t[e+1])});return n},getCSSRules:function(t){var i,n,r,o=t.getElementsByTagName("style"),a={};for(i=0,n=o.length;i<n;i++){var s=o[i].textContent;s=s.replace(/\/\*[\s\S]*?\*\//g,""),""!==s.trim()&&(r=s.match(/[^{]*\{[\s\S]*?\}/g),r=r.map((function(t){return t.trim()})),r.forEach((function(t){var r=t.match(/([\s\S]*?)\s*\{([^}]*)\}/),o={},s=r[2].trim(),c=s.replace(/;$/,"").split(/\s*;\s*/);for(i=0,n=c.length;i<n;i++){var l=c[i].split(/\s*:\s*/),u=l[0],h=l[1];o[u]=h}t=r[1],t.split(",").forEach((function(t){t=t.replace(/^svg/i,"").trim(),""!==t&&(a[t]?e.util.object.extend(a[t],o):a[t]=e.util.object.clone(o))}))})))}return a},loadSVGFromURL:function(t,i,n,r){function o(t){var o=t.responseXML;if(!o||!o.documentElement)return i&&i(null),!1;e.parseSVGDocument(o.documentElement,(function(t,e,n,r){i&&i(t,e,n,r)}),n,r)}t=t.replace(/^\n\s*/,"").trim(),new e.util.request(t,{method:"get",onComplete:o})},loadSVGFromString:function(t,i,n,r){var o=new e.window.DOMParser,a=o.parseFromString(t.trim(),"text/xml");e.parseSVGDocument(a.documentElement,(function(t,e,n,r){i(t,e,n,r)}),n,r)}})}(i),r.ElementsParser=function(t,e,i,n,r,o){this.elements=t,this.callback=e,this.options=i,this.reviver=n,this.svgUid=i&&i.svgUid||0,this.parsingOptions=r,this.regexUrl=/^url\(['"]?#([^'"]+)['"]?\)/g,this.doc=o},function(t){t.parse=function(){this.instances=new Array(this.elements.length),this.numElements=this.elements.length,this.createObjects()},t.createObjects=function(){var t=this;this.elements.forEach((function(e,i){e.setAttribute("svgUid",t.svgUid),t.createObject(e,i)}))},t.findTag=function(t){return r[r.util.string.capitalize(t.tagName.replace("svg:",""))]},t.createObject=function(t,e){var i=this.findTag(t);if(i&&i.fromElement)try{i.fromElement(t,this.createCallback(e,t),this.options)}catch(n){r.log(n)}else this.checkIfDone()},t.createCallback=function(t,e){var i=this;return function(n){var o;i.resolveGradient(n,e,"fill"),i.resolveGradient(n,e,"stroke"),n instanceof r.Image&&n._originalElement&&(o=n.parsePreserveAspectRatioAttribute(e)),n._removeTransformMatrix(o),i.resolveClipPath(n,e),i.reviver&&i.reviver(e,n),i.instances[t]=n,i.checkIfDone()}},t.extractPropertyDefinition=function(t,e,i){var n=t[e],o=this.regexUrl;if(o.test(n)){o.lastIndex=0;var a=o.exec(n)[1];return o.lastIndex=0,r[i][this.svgUid][a]}},t.resolveGradient=function(t,e,i){var n=this.extractPropertyDefinition(t,i,"gradientDefs");if(n){var o=e.getAttribute(i+"-opacity"),a=r.Gradient.fromElement(n,t,o,this.options);t.set(i,a)}},t.createClipPathCallback=function(t,e){return function(t){t._removeTransformMatrix(),t.fillRule=t.clipRule,e.push(t)}},t.resolveClipPath=function(t,e){var i,n,o,a,s,c=this.extractPropertyDefinition(t,"clipPath","clipPaths");if(c){a=[],o=r.util.invertTransform(t.calcTransformMatrix());var l=c[0].parentNode,u=e;while(u.parentNode&&u.getAttribute("clip-path")!==t.clipPath)u=u.parentNode;u.parentNode.appendChild(l);for(var h=0;h<c.length;h++)i=c[h],n=this.findTag(i),n.fromElement(i,this.createClipPathCallback(t,a),this.options);c=1===a.length?a[0]:new r.Group(a),s=r.util.multiplyTransformMatrices(o,c.calcTransformMatrix()),c.clipPath&&this.resolveClipPath(c,u);var f=r.util.qrDecompose(s);c.flipX=!1,c.flipY=!1,c.set("scaleX",f.scaleX),c.set("scaleY",f.scaleY),c.angle=f.angle,c.skewX=f.skewX,c.skewY=0,c.setPositionByOrigin({x:f.translateX,y:f.translateY},"center","center"),t.clipPath=c}else delete t.clipPath},t.checkIfDone=function(){0===--this.numElements&&(this.instances=this.instances.filter((function(t){return null!=t})),this.callback(this.instances,this.elements))}}(r.ElementsParser.prototype),function(t){"use strict";var e=t.fabric||(t.fabric={});function i(t,e){this.x=t,this.y=e}e.Point?e.warn("fabric.Point is already defined"):(e.Point=i,i.prototype={type:"point",constructor:i,add:function(t){return new i(this.x+t.x,this.y+t.y)},addEquals:function(t){return this.x+=t.x,this.y+=t.y,this},scalarAdd:function(t){return new i(this.x+t,this.y+t)},scalarAddEquals:function(t){return this.x+=t,this.y+=t,this},subtract:function(t){return new i(this.x-t.x,this.y-t.y)},subtractEquals:function(t){return this.x-=t.x,this.y-=t.y,this},scalarSubtract:function(t){return new i(this.x-t,this.y-t)},scalarSubtractEquals:function(t){return this.x-=t,this.y-=t,this},multiply:function(t){return new i(this.x*t,this.y*t)},multiplyEquals:function(t){return this.x*=t,this.y*=t,this},divide:function(t){return new i(this.x/t,this.y/t)},divideEquals:function(t){return this.x/=t,this.y/=t,this},eq:function(t){return this.x===t.x&&this.y===t.y},lt:function(t){return this.x<t.x&&this.y<t.y},lte:function(t){return this.x<=t.x&&this.y<=t.y},gt:function(t){return this.x>t.x&&this.y>t.y},gte:function(t){return this.x>=t.x&&this.y>=t.y},lerp:function(t,e){return"undefined"===typeof e&&(e=.5),e=Math.max(Math.min(1,e),0),new i(this.x+(t.x-this.x)*e,this.y+(t.y-this.y)*e)},distanceFrom:function(t){var e=this.x-t.x,i=this.y-t.y;return Math.sqrt(e*e+i*i)},midPointFrom:function(t){return this.lerp(t)},min:function(t){return new i(Math.min(this.x,t.x),Math.min(this.y,t.y))},max:function(t){return new i(Math.max(this.x,t.x),Math.max(this.y,t.y))},toString:function(){return this.x+","+this.y},setXY:function(t,e){return this.x=t,this.y=e,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setFromPoint:function(t){return this.x=t.x,this.y=t.y,this},swap:function(t){var e=this.x,i=this.y;this.x=t.x,this.y=t.y,t.x=e,t.y=i},clone:function(){return new i(this.x,this.y)}})}(i),function(t){"use strict";var e=t.fabric||(t.fabric={});function i(t){this.status=t,this.points=[]}e.Intersection?e.warn("fabric.Intersection is already defined"):(e.Intersection=i,e.Intersection.prototype={constructor:i,appendPoint:function(t){return this.points.push(t),this},appendPoints:function(t){return this.points=this.points.concat(t),this}},e.Intersection.intersectLineLine=function(t,n,r,o){var a,s=(o.x-r.x)*(t.y-r.y)-(o.y-r.y)*(t.x-r.x),c=(n.x-t.x)*(t.y-r.y)-(n.y-t.y)*(t.x-r.x),l=(o.y-r.y)*(n.x-t.x)-(o.x-r.x)*(n.y-t.y);if(0!==l){var u=s/l,h=c/l;0<=u&&u<=1&&0<=h&&h<=1?(a=new i("Intersection"),a.appendPoint(new e.Point(t.x+u*(n.x-t.x),t.y+u*(n.y-t.y)))):a=new i}else a=new i(0===s||0===c?"Coincident":"Parallel");return a},e.Intersection.intersectLinePolygon=function(t,e,n){var r,o,a,s,c=new i,l=n.length;for(s=0;s<l;s++)r=n[s],o=n[(s+1)%l],a=i.intersectLineLine(t,e,r,o),c.appendPoints(a.points);return c.points.length>0&&(c.status="Intersection"),c},e.Intersection.intersectPolygonPolygon=function(t,e){var n,r=new i,o=t.length;for(n=0;n<o;n++){var a=t[n],s=t[(n+1)%o],c=i.intersectLinePolygon(a,s,e);r.appendPoints(c.points)}return r.points.length>0&&(r.status="Intersection"),r},e.Intersection.intersectPolygonRectangle=function(t,n,r){var o=n.min(r),a=n.max(r),s=new e.Point(a.x,o.y),c=new e.Point(o.x,a.y),l=i.intersectLinePolygon(o,s,t),u=i.intersectLinePolygon(s,a,t),h=i.intersectLinePolygon(a,c,t),f=i.intersectLinePolygon(c,o,t),d=new i;return d.appendPoints(l.points),d.appendPoints(u.points),d.appendPoints(h.points),d.appendPoints(f.points),d.points.length>0&&(d.status="Intersection"),d})}(i),function(t){"use strict";var e=t.fabric||(t.fabric={});function i(t){t?this._tryParsingColor(t):this.setSource([0,0,0,1])}function n(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}e.Color?e.warn("fabric.Color is already defined."):(e.Color=i,e.Color.prototype={_tryParsingColor:function(t){var e;t in i.colorNameMap&&(t=i.colorNameMap[t]),"transparent"===t&&(e=[255,255,255,0]),e||(e=i.sourceFromHex(t)),e||(e=i.sourceFromRgb(t)),e||(e=i.sourceFromHsl(t)),e||(e=[0,0,0,1]),e&&this.setSource(e)},_rgbToHsl:function(t,i,n){t/=255,i/=255,n/=255;var r,o,a,s=e.util.array.max([t,i,n]),c=e.util.array.min([t,i,n]);if(a=(s+c)/2,s===c)r=o=0;else{var l=s-c;switch(o=a>.5?l/(2-s-c):l/(s+c),s){case t:r=(i-n)/l+(i<n?6:0);break;case i:r=(n-t)/l+2;break;case n:r=(t-i)/l+4;break}r/=6}return[Math.round(360*r),Math.round(100*o),Math.round(100*a)]},getSource:function(){return this._source},setSource:function(t){this._source=t},toRgb:function(){var t=this.getSource();return"rgb("+t[0]+","+t[1]+","+t[2]+")"},toRgba:function(){var t=this.getSource();return"rgba("+t[0]+","+t[1]+","+t[2]+","+t[3]+")"},toHsl:function(){var t=this.getSource(),e=this._rgbToHsl(t[0],t[1],t[2]);return"hsl("+e[0]+","+e[1]+"%,"+e[2]+"%)"},toHsla:function(){var t=this.getSource(),e=this._rgbToHsl(t[0],t[1],t[2]);return"hsla("+e[0]+","+e[1]+"%,"+e[2]+"%,"+t[3]+")"},toHex:function(){var t,e,i,n=this.getSource();return t=n[0].toString(16),t=1===t.length?"0"+t:t,e=n[1].toString(16),e=1===e.length?"0"+e:e,i=n[2].toString(16),i=1===i.length?"0"+i:i,t.toUpperCase()+e.toUpperCase()+i.toUpperCase()},toHexa:function(){var t,e=this.getSource();return t=Math.round(255*e[3]),t=t.toString(16),t=1===t.length?"0"+t:t,this.toHex()+t.toUpperCase()},getAlpha:function(){return this.getSource()[3]},setAlpha:function(t){var e=this.getSource();return e[3]=t,this.setSource(e),this},toGrayscale:function(){var t=this.getSource(),e=parseInt((.3*t[0]+.59*t[1]+.11*t[2]).toFixed(0),10),i=t[3];return this.setSource([e,e,e,i]),this},toBlackWhite:function(t){var e=this.getSource(),i=(.3*e[0]+.59*e[1]+.11*e[2]).toFixed(0),n=e[3];return t=t||127,i=Number(i)<Number(t)?0:255,this.setSource([i,i,i,n]),this},overlayWith:function(t){t instanceof i||(t=new i(t));var e,n=[],r=this.getAlpha(),o=.5,a=this.getSource(),s=t.getSource();for(e=0;e<3;e++)n.push(Math.round(a[e]*(1-o)+s[e]*o));return n[3]=r,this.setSource(n),this}},e.Color.reRGBa=/^rgba?\(\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*(?:\s*,\s*((?:\d*\.?\d+)?)\s*)?\)$/i,e.Color.reHSLa=/^hsla?\(\s*(\d{1,3})\s*,\s*(\d{1,3}\%)\s*,\s*(\d{1,3}\%)\s*(?:\s*,\s*(\d+(?:\.\d+)?)\s*)?\)$/i,e.Color.reHex=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,e.Color.colorNameMap={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"},e.Color.fromRgb=function(t){return i.fromSource(i.sourceFromRgb(t))},e.Color.sourceFromRgb=function(t){var e=t.match(i.reRGBa);if(e){var n=parseInt(e[1],10)/(/%$/.test(e[1])?100:1)*(/%$/.test(e[1])?255:1),r=parseInt(e[2],10)/(/%$/.test(e[2])?100:1)*(/%$/.test(e[2])?255:1),o=parseInt(e[3],10)/(/%$/.test(e[3])?100:1)*(/%$/.test(e[3])?255:1);return[parseInt(n,10),parseInt(r,10),parseInt(o,10),e[4]?parseFloat(e[4]):1]}},e.Color.fromRgba=i.fromRgb,e.Color.fromHsl=function(t){return i.fromSource(i.sourceFromHsl(t))},e.Color.sourceFromHsl=function(t){var e=t.match(i.reHSLa);if(e){var r,o,a,s=(parseFloat(e[1])%360+360)%360/360,c=parseFloat(e[2])/(/%$/.test(e[2])?100:1),l=parseFloat(e[3])/(/%$/.test(e[3])?100:1);if(0===c)r=o=a=l;else{var u=l<=.5?l*(c+1):l+c-l*c,h=2*l-u;r=n(h,u,s+1/3),o=n(h,u,s),a=n(h,u,s-1/3)}return[Math.round(255*r),Math.round(255*o),Math.round(255*a),e[4]?parseFloat(e[4]):1]}},e.Color.fromHsla=i.fromHsl,e.Color.fromHex=function(t){return i.fromSource(i.sourceFromHex(t))},e.Color.sourceFromHex=function(t){if(t.match(i.reHex)){var e=t.slice(t.indexOf("#")+1),n=3===e.length||4===e.length,r=8===e.length||4===e.length,o=n?e.charAt(0)+e.charAt(0):e.substring(0,2),a=n?e.charAt(1)+e.charAt(1):e.substring(2,4),s=n?e.charAt(2)+e.charAt(2):e.substring(4,6),c=r?n?e.charAt(3)+e.charAt(3):e.substring(6,8):"FF";return[parseInt(o,16),parseInt(a,16),parseInt(s,16),parseFloat((parseInt(c,16)/255).toFixed(2))]}},e.Color.fromSource=function(t){var e=new i;return e.setSource(t),e})}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=["e","se","s","sw","w","nw","n","ne","e"],n=["ns","nesw","ew","nwse"],r={},o="left",a="top",s="right",c="bottom",l="center",u={top:c,bottom:a,left:s,right:o,center:l},h=e.util.radiansToDegrees,f=Math.sign||function(t){return(t>0)-(t<0)||+t};function d(t,e){var i=t.angle+h(Math.atan2(e.y,e.x))+360;return Math.round(i%360/45)}function g(t,i){var n=i.transform.target,r=n.canvas,o=e.util.object.clone(i);o.target=n,r&&r.fire("object:"+t,o),n.fire(t,i)}function p(t,e){var i=e.canvas,n=i.uniScaleKey,r=t[n];return i.uniformScaling&&!r||!i.uniformScaling&&r}function v(t){return t.originX===l&&t.originY===l}function m(t,e,i){var n=t.lockScalingX,r=t.lockScalingY;return!(!n||!r)||(!(e||!n&&!r||!i)||(!(!n||"x"!==e)||!(!r||"y"!==e)))}function y(t,e,n){var r="not-allowed",o=p(t,n),a="";if(0!==e.x&&0===e.y?a="x":0===e.x&&0!==e.y&&(a="y"),m(n,a,o))return r;var s=d(n,e);return i[s]+"-resize"}function b(t,e,i){var r="not-allowed";if(0!==e.x&&i.lockSkewingY)return r;if(0!==e.y&&i.lockSkewingX)return r;var o=d(i,e)%4;return n[o]+"-resize"}function _(t,e,i){return t[i.canvas.altActionKey]?r.skewCursorStyleHandler(t,e,i):r.scaleCursorStyleHandler(t,e,i)}function x(t,e,i){var n=t[i.canvas.altActionKey];return 0===e.x?n?"skewX":"scaleY":0===e.y?n?"skewY":"scaleX":void 0}function C(t,e,i){return i.lockRotation?"not-allowed":e.cursorStyle}function I(t,e,i,n){return{e:t,transform:e,pointer:{x:i,y:n}}}function M(t){return function(e,i,n,r){var o=i.target,a=o.getCenterPoint(),s=o.translateToOriginPoint(a,i.originX,i.originY),c=t(e,i,n,r);return o.setPositionByOrigin(s,i.originX,i.originY),c}}function S(t,e){return function(i,n,r,o){var a=e(i,n,r,o);return a&&g(t,I(i,n,r,o)),a}}function w(t,i,n,r,o){var a=t.target,s=a.controls[t.corner],c=a.canvas.getZoom(),l=a.padding/c,u=a.toLocalPoint(new e.Point(r,o),i,n);return u.x>=l&&(u.x-=l),u.x<=-l&&(u.x+=l),u.y>=l&&(u.y-=l),u.y<=l&&(u.y+=l),u.x-=s.offsetX,u.y-=s.offsetY,u}function T(t){return t.flipX!==t.flipY}function A(t,e,i,n,r){if(0!==t[e]){var o=t._getTransformedDimensions()[n],a=r/o*t[i];t.set(i,a)}}function D(t,e,i,n){var r,l=e.target,u=l._getTransformedDimensions(0,l.skewY),f=w(e,e.originX,e.originY,i,n),d=Math.abs(2*f.x)-u.x,g=l.skewX;d<2?r=0:(r=h(Math.atan2(d/l.scaleX,u.y/l.scaleY)),e.originX===o&&e.originY===c&&(r=-r),e.originX===s&&e.originY===a&&(r=-r),T(l)&&(r=-r));var p=g!==r;if(p){var v=l._getTransformedDimensions().y;l.set("skewX",r),A(l,"skewY","scaleY","y",v)}return p}function E(t,e,i,n){var r,l=e.target,u=l._getTransformedDimensions(l.skewX,0),f=w(e,e.originX,e.originY,i,n),d=Math.abs(2*f.y)-u.y,g=l.skewY;d<2?r=0:(r=h(Math.atan2(d/l.scaleY,u.x/l.scaleX)),e.originX===o&&e.originY===c&&(r=-r),e.originX===s&&e.originY===a&&(r=-r),T(l)&&(r=-r));var p=g!==r;if(p){var v=l._getTransformedDimensions().x;l.set("skewY",r),A(l,"skewX","scaleX","x",v)}return p}function k(t,e,i,n){var r,c=e.target,u=c.skewX,h=e.originY;if(c.lockSkewingX)return!1;if(0===u){var f=w(e,l,l,i,n);r=f.x>0?o:s}else u>0&&(r=h===a?o:s),u<0&&(r=h===a?s:o),T(c)&&(r=r===o?s:o);e.originX=r;var d=S("skewing",M(D));return d(t,e,i,n)}function O(t,e,i,n){var r,s=e.target,u=s.skewY,h=e.originX;if(s.lockSkewingY)return!1;if(0===u){var f=w(e,l,l,i,n);r=f.y>0?a:c}else u>0&&(r=h===o?a:c),u<0&&(r=h===o?c:a),T(s)&&(r=r===a?c:a);e.originY=r;var d=S("skewing",M(E));return d(t,e,i,n)}function j(t,e,i,n){var r=e,o=r.target,a=o.translateToOriginPoint(o.getCenterPoint(),r.originX,r.originY);if(o.lockRotation)return!1;var s=Math.atan2(r.ey-a.y,r.ex-a.x),c=Math.atan2(n-a.y,i-a.x),l=h(c-s+r.theta),u=!0;if(o.snapAngle>0){var f=o.snapAngle,d=o.snapThreshold||f,g=Math.ceil(l/f)*f,p=Math.floor(l/f)*f;Math.abs(l-p)<d?l=p:Math.abs(l-g)<d&&(l=g)}return l<0&&(l=360+l),l%=360,u=o.angle!==l,o.angle=l,u}function L(t,e,i,n,r){r=r||{};var o,a,s,c,l,h,d=e.target,g=d.lockScalingX,y=d.lockScalingY,b=r.by,_=p(t,d),x=m(d,b,_),C=e.gestureScale;if(x)return!1;if(C)a=e.scaleX*C,s=e.scaleY*C;else{if(o=w(e,e.originX,e.originY,i,n),l="y"!==b?f(o.x):1,h="x"!==b?f(o.y):1,e.signX||(e.signX=l),e.signY||(e.signY=h),d.lockScalingFlip&&(e.signX!==l||e.signY!==h))return!1;if(c=d._getTransformedDimensions(),_&&!b){var I=Math.abs(o.x)+Math.abs(o.y),M=e.original,S=Math.abs(c.x*M.scaleX/d.scaleX)+Math.abs(c.y*M.scaleY/d.scaleY),T=I/S;a=M.scaleX*T,s=M.scaleY*T}else a=Math.abs(o.x*d.scaleX/c.x),s=Math.abs(o.y*d.scaleY/c.y);v(e)&&(a*=2,s*=2),e.signX!==l&&"y"!==b&&(e.originX=u[e.originX],a*=-1,e.signX=l),e.signY!==h&&"x"!==b&&(e.originY=u[e.originY],s*=-1,e.signY=h)}var A=d.scaleX,D=d.scaleY;return b?("x"===b&&d.set("scaleX",a),"y"===b&&d.set("scaleY",s)):(!g&&d.set("scaleX",a),!y&&d.set("scaleY",s)),A!==d.scaleX||D!==d.scaleY}function N(t,e,i,n){return L(t,e,i,n)}function P(t,e,i,n){return L(t,e,i,n,{by:"x"})}function z(t,e,i,n){return L(t,e,i,n,{by:"y"})}function R(t,e,i,n){return t[e.target.canvas.altActionKey]?r.skewHandlerX(t,e,i,n):r.scalingY(t,e,i,n)}function B(t,e,i,n){return t[e.target.canvas.altActionKey]?r.skewHandlerY(t,e,i,n):r.scalingX(t,e,i,n)}function F(t,e,i,n){var r=e.target,o=w(e,e.originX,e.originY,i,n),a=r.strokeWidth/(r.strokeUniform?r.scaleX:1),s=v(e)?2:1,c=r.width,l=Math.abs(o.x*s/r.scaleX)-a;return r.set("width",Math.max(l,0)),c!==l}function Y(t,e,i,n){var r=e.target,o=i-e.offsetX,a=n-e.offsetY,s=!r.get("lockMovementX")&&r.left!==o,c=!r.get("lockMovementY")&&r.top!==a;return s&&r.set("left",o),c&&r.set("top",a),(s||c)&&g("moving",I(t,e,i,n)),s||c}r.scaleCursorStyleHandler=y,r.skewCursorStyleHandler=b,r.scaleSkewCursorStyleHandler=_,r.rotationWithSnapping=S("rotating",M(j)),r.scalingEqually=S("scaling",M(N)),r.scalingX=S("scaling",M(P)),r.scalingY=S("scaling",M(z)),r.scalingYOrSkewingX=R,r.scalingXOrSkewingY=B,r.changeWidth=S("resizing",M(F)),r.skewHandlerX=k,r.skewHandlerY=O,r.dragHandler=Y,r.scaleOrSkewActionName=x,r.rotationStyleHandler=C,r.fireEvent=g,r.wrapWithFixedAnchor=M,r.wrapWithFireEvent=S,r.getLocalPoint=w,e.controlsUtils=r}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.degreesToRadians,n=e.controlsUtils;function r(t,e,i,n,r){n=n||{};var o,a=this.sizeX||n.cornerSize||r.cornerSize,s=this.sizeY||n.cornerSize||r.cornerSize,c="undefined"!==typeof n.transparentCorners?n.transparentCorners:r.transparentCorners,l=c?"stroke":"fill",u=!c&&(n.cornerStrokeColor||r.cornerStrokeColor),h=e,f=i;t.save(),t.fillStyle=n.cornerColor||r.cornerColor,t.strokeStyle=n.cornerStrokeColor||r.cornerStrokeColor,a>s?(o=a,t.scale(1,s/a),f=i*a/s):s>a?(o=s,t.scale(a/s,1),h=e*s/a):o=a,t.lineWidth=1,t.beginPath(),t.arc(h,f,o/2,0,2*Math.PI,!1),t[l](),u&&t.stroke(),t.restore()}function o(t,e,n,r,o){r=r||{};var a=this.sizeX||r.cornerSize||o.cornerSize,s=this.sizeY||r.cornerSize||o.cornerSize,c="undefined"!==typeof r.transparentCorners?r.transparentCorners:o.transparentCorners,l=c?"stroke":"fill",u=!c&&(r.cornerStrokeColor||o.cornerStrokeColor),h=a/2,f=s/2;t.save(),t.fillStyle=r.cornerColor||o.cornerColor,t.strokeStyle=r.cornerStrokeColor||o.cornerStrokeColor,t.lineWidth=1,t.translate(e,n),t.rotate(i(o.angle)),t[l+"Rect"](-h,-f,a,s),u&&t.strokeRect(-h,-f,a,s),t.restore()}n.renderCircleControl=r,n.renderSquareControl=o}(i),function(t){"use strict";var e=t.fabric||(t.fabric={});function i(t){for(var e in t)this[e]=t[e]}e.Control=i,e.Control.prototype={visible:!0,actionName:"scale",angle:0,x:0,y:0,offsetX:0,offsetY:0,sizeX:null,sizeY:null,touchSizeX:null,touchSizeY:null,cursorStyle:"crosshair",withConnection:!1,actionHandler:function(){},mouseDownHandler:function(){},mouseUpHandler:function(){},getActionHandler:function(){return this.actionHandler},getMouseDownHandler:function(){return this.mouseDownHandler},getMouseUpHandler:function(){return this.mouseUpHandler},cursorStyleHandler:function(t,e){return e.cursorStyle},getActionName:function(t,e){return e.actionName},getVisibility:function(t,e){var i=t._controlsVisibility;return i&&"undefined"!==typeof i[e]?i[e]:this.visible},setVisibility:function(t){this.visible=t},positionHandler:function(t,i){var n=e.util.transformPoint({x:this.x*t.x+this.offsetX,y:this.y*t.y+this.offsetY},i);return n},calcCornerCoords:function(t,i,n,r,o){var a,s,c,l,u=o?this.touchSizeX:this.sizeX,h=o?this.touchSizeY:this.sizeY;if(u&&h&&u!==h){var f=Math.atan2(h,u),d=Math.sqrt(u*u+h*h)/2,g=f-e.util.degreesToRadians(t),p=Math.PI/2-f-e.util.degreesToRadians(t);a=d*e.util.cos(g),s=d*e.util.sin(g),c=d*e.util.cos(p),l=d*e.util.sin(p)}else{var v=u&&h?u:i;d=.7071067812*v;g=e.util.degreesToRadians(45-t);a=c=d*e.util.cos(g),s=l=d*e.util.sin(g)}return{tl:{x:n-l,y:r-c},tr:{x:n+a,y:r-s},bl:{x:n-a,y:r+s},br:{x:n+l,y:r+c}}},render:function(t,i,n,r,o){switch(r=r||{},r.cornerStyle||o.cornerStyle){case"circle":e.controlsUtils.renderCircleControl.call(this,t,i,n,r,o);break;default:e.controlsUtils.renderSquareControl.call(this,t,i,n,r,o)}}}}(i),function(){function t(t,e){var i,n,o,a,s=t.getAttribute("style"),c=t.getAttribute("offset")||0;if(c=parseFloat(c)/(/%$/.test(c)?100:1),c=c<0?0:c>1?1:c,s){var l=s.split(/\s*;\s*/);for(""===l[l.length-1]&&l.pop(),a=l.length;a--;){var u=l[a].split(/\s*:\s*/),h=u[0].trim(),f=u[1].trim();"stop-color"===h?i=f:"stop-opacity"===h&&(o=f)}}return i||(i=t.getAttribute("stop-color")||"rgb(0,0,0)"),o||(o=t.getAttribute("stop-opacity")),i=new r.Color(i),n=i.getAlpha(),o=isNaN(parseFloat(o))?1:parseFloat(o),o*=n*e,{offset:c,color:i.toRgb(),opacity:o}}function e(t){return{x1:t.getAttribute("x1")||0,y1:t.getAttribute("y1")||0,x2:t.getAttribute("x2")||"100%",y2:t.getAttribute("y2")||0}}function i(t){return{x1:t.getAttribute("fx")||t.getAttribute("cx")||"50%",y1:t.getAttribute("fy")||t.getAttribute("cy")||"50%",r1:0,x2:t.getAttribute("cx")||"50%",y2:t.getAttribute("cy")||"50%",r2:t.getAttribute("r")||"50%"}}var n=r.util.object.clone;function o(t,e,i,n){var r,o;Object.keys(e).forEach((function(t){r=e[t],"Infinity"===r?o=1:"-Infinity"===r?o=0:(o=parseFloat(e[t],10),"string"===typeof r&&/^(\d+\.\d+)%|(\d+)%$/.test(r)&&(o*=.01,"pixels"===n&&("x1"!==t&&"x2"!==t&&"r2"!==t||(o*=i.viewBoxWidth||i.width),"y1"!==t&&"y2"!==t||(o*=i.viewBoxHeight||i.height)))),e[t]=o}))}r.Gradient=r.util.createClass({offsetX:0,offsetY:0,gradientTransform:null,gradientUnits:"pixels",type:"linear",initialize:function(t){t||(t={}),t.coords||(t.coords={});var e,i=this;Object.keys(t).forEach((function(e){i[e]=t[e]})),this.id?this.id+="_"+r.Object.__uid++:this.id=r.Object.__uid++,e={x1:t.coords.x1||0,y1:t.coords.y1||0,x2:t.coords.x2||0,y2:t.coords.y2||0},"radial"===this.type&&(e.r1=t.coords.r1||0,e.r2=t.coords.r2||0),this.coords=e,this.colorStops=t.colorStops.slice()},addColorStop:function(t){for(var e in t){var i=new r.Color(t[e]);this.colorStops.push({offset:parseFloat(e),color:i.toRgb(),opacity:i.getAlpha()})}return this},toObject:function(t){var e={type:this.type,coords:this.coords,colorStops:this.colorStops,offsetX:this.offsetX,offsetY:this.offsetY,gradientUnits:this.gradientUnits,gradientTransform:this.gradientTransform?this.gradientTransform.concat():this.gradientTransform};return r.util.populateWithProperties(this,e,t),e},toSVG:function(t,e){var i,o,a,s,c=n(this.coords,!0),l=(e=e||{},n(this.colorStops,!0)),u=c.r1>c.r2,h=this.gradientTransform?this.gradientTransform.concat():r.iMatrix.concat(),f=-this.offsetX,d=-this.offsetY,g=!!e.additionalTransform,p="pixels"===this.gradientUnits?"userSpaceOnUse":"objectBoundingBox";if(l.sort((function(t,e){return t.offset-e.offset})),"objectBoundingBox"===p?(f/=t.width,d/=t.height):(f+=t.width/2,d+=t.height/2),"path"===t.type&&"percentage"!==this.gradientUnits&&(f-=t.pathOffset.x,d-=t.pathOffset.y),h[4]-=f,h[5]-=d,s='id="SVGID_'+this.id+'" gradientUnits="'+p+'"',s+=' gradientTransform="'+(g?e.additionalTransform+" ":"")+r.util.matrixToSVG(h)+'" ',"linear"===this.type?a=["<linearGradient ",s,' x1="',c.x1,'" y1="',c.y1,'" x2="',c.x2,'" y2="',c.y2,'">\n']:"radial"===this.type&&(a=["<radialGradient ",s,' cx="',u?c.x1:c.x2,'" cy="',u?c.y1:c.y2,'" r="',u?c.r1:c.r2,'" fx="',u?c.x2:c.x1,'" fy="',u?c.y2:c.y1,'">\n']),"radial"===this.type){if(u)for(l=l.concat(),l.reverse(),i=0,o=l.length;i<o;i++)l[i].offset=1-l[i].offset;var v=Math.min(c.r1,c.r2);if(v>0){var m=Math.max(c.r1,c.r2),y=v/m;for(i=0,o=l.length;i<o;i++)l[i].offset+=y*(1-l[i].offset)}}for(i=0,o=l.length;i<o;i++){var b=l[i];a.push("<stop ",'offset="',100*b.offset+"%",'" style="stop-color:',b.color,"undefined"!==typeof b.opacity?";stop-opacity: "+b.opacity:";",'"/>\n')}return a.push("linear"===this.type?"</linearGradient>\n":"</radialGradient>\n"),a.join("")},toLive:function(t){var e,i,n,o=r.util.object.clone(this.coords);if(this.type){for("linear"===this.type?e=t.createLinearGradient(o.x1,o.y1,o.x2,o.y2):"radial"===this.type&&(e=t.createRadialGradient(o.x1,o.y1,o.r1,o.x2,o.y2,o.r2)),i=0,n=this.colorStops.length;i<n;i++){var a=this.colorStops[i].color,s=this.colorStops[i].opacity,c=this.colorStops[i].offset;"undefined"!==typeof s&&(a=new r.Color(a).setAlpha(s).toRgba()),e.addColorStop(c,a)}return e}}}),r.util.object.extend(r.Gradient,{fromElement:function(n,a,s,c){var l=parseFloat(s)/(/%$/.test(s)?100:1);l=l<0?0:l>1?1:l,isNaN(l)&&(l=1);var u,h,f,d,g=n.getElementsByTagName("stop"),p="userSpaceOnUse"===n.getAttribute("gradientUnits")?"pixels":"percentage",v=n.getAttribute("gradientTransform")||"",m=[],y=0,b=0;for("linearGradient"===n.nodeName||"LINEARGRADIENT"===n.nodeName?(u="linear",h=e(n)):(u="radial",h=i(n)),f=g.length;f--;)m.push(t(g[f],l));d=r.parseTransformAttribute(v),o(a,h,c,p),"pixels"===p&&(y=-a.left,b=-a.top);var _=new r.Gradient({id:n.getAttribute("id"),type:u,coords:h,colorStops:m,gradientUnits:p,gradientTransform:d,offsetX:y,offsetY:b});return _}})}(),function(){"use strict";var t=r.util.toFixed;r.Pattern=r.util.createClass({repeat:"repeat",offsetX:0,offsetY:0,crossOrigin:"",patternTransform:null,initialize:function(t,e){if(t||(t={}),this.id=r.Object.__uid++,this.setOptions(t),!t.source||t.source&&"string"!==typeof t.source)e&&e(this);else{var i=this;this.source=r.util.createImage(),r.util.loadImage(t.source,(function(t,n){i.source=t,e&&e(i,n)}),null,this.crossOrigin)}},toObject:function(e){var i,n,o=r.Object.NUM_FRACTION_DIGITS;return"string"===typeof this.source.src?i=this.source.src:"object"===typeof this.source&&this.source.toDataURL&&(i=this.source.toDataURL()),n={type:"pattern",source:i,repeat:this.repeat,crossOrigin:this.crossOrigin,offsetX:t(this.offsetX,o),offsetY:t(this.offsetY,o),patternTransform:this.patternTransform?this.patternTransform.concat():null},r.util.populateWithProperties(this,n,e),n},toSVG:function(t){var e="function"===typeof this.source?this.source():this.source,i=e.width/t.width,n=e.height/t.height,r=this.offsetX/t.width,o=this.offsetY/t.height,a="";return"repeat-x"!==this.repeat&&"no-repeat"!==this.repeat||(n=1,o&&(n+=Math.abs(o))),"repeat-y"!==this.repeat&&"no-repeat"!==this.repeat||(i=1,r&&(i+=Math.abs(r))),e.src?a=e.src:e.toDataURL&&(a=e.toDataURL()),'<pattern id="SVGID_'+this.id+'" x="'+r+'" y="'+o+'" width="'+i+'" height="'+n+'">\n<image x="0" y="0" width="'+e.width+'" height="'+e.height+'" xlink:href="'+a+'"></image>\n</pattern>\n'},setOptions:function(t){for(var e in t)this[e]=t[e]},toLive:function(t){var e=this.source;if(!e)return"";if("undefined"!==typeof e.src){if(!e.complete)return"";if(0===e.naturalWidth||0===e.naturalHeight)return""}return t.createPattern(e,this.repeat)}})}(),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.toFixed;e.Shadow?e.warn("fabric.Shadow is already defined."):(e.Shadow=e.util.createClass({color:"rgb(0,0,0)",blur:0,offsetX:0,offsetY:0,affectStroke:!1,includeDefaultValues:!0,nonScaling:!1,initialize:function(t){for(var i in"string"===typeof t&&(t=this._parseShadow(t)),t)this[i]=t[i];this.id=e.Object.__uid++},_parseShadow:function(t){var i=t.trim(),n=e.Shadow.reOffsetsAndBlur.exec(i)||[],r=i.replace(e.Shadow.reOffsetsAndBlur,"")||"rgb(0,0,0)";return{color:r.trim(),offsetX:parseFloat(n[1],10)||0,offsetY:parseFloat(n[2],10)||0,blur:parseFloat(n[3],10)||0}},toString:function(){return[this.offsetX,this.offsetY,this.blur,this.color].join("px ")},toSVG:function(t){var n=40,r=40,o=e.Object.NUM_FRACTION_DIGITS,a=e.util.rotateVector({x:this.offsetX,y:this.offsetY},e.util.degreesToRadians(-t.angle)),s=20,c=new e.Color(this.color);return t.width&&t.height&&(n=100*i((Math.abs(a.x)+this.blur)/t.width,o)+s,r=100*i((Math.abs(a.y)+this.blur)/t.height,o)+s),t.flipX&&(a.x*=-1),t.flipY&&(a.y*=-1),'<filter id="SVGID_'+this.id+'" y="-'+r+'%" height="'+(100+2*r)+'%" x="-'+n+'%" width="'+(100+2*n)+'%" >\n\t<feGaussianBlur in="SourceAlpha" stdDeviation="'+i(this.blur?this.blur/2:0,o)+'"></feGaussianBlur>\n\t<feOffset dx="'+i(a.x,o)+'" dy="'+i(a.y,o)+'" result="oBlur" ></feOffset>\n\t<feFlood flood-color="'+c.toRgb()+'" flood-opacity="'+c.getAlpha()+'"/>\n\t<feComposite in2="oBlur" operator="in" />\n\t<feMerge>\n\t\t<feMergeNode></feMergeNode>\n\t\t<feMergeNode in="SourceGraphic"></feMergeNode>\n\t</feMerge>\n</filter>\n'},toObject:function(){if(this.includeDefaultValues)return{color:this.color,blur:this.blur,offsetX:this.offsetX,offsetY:this.offsetY,affectStroke:this.affectStroke,nonScaling:this.nonScaling};var t={},i=e.Shadow.prototype;return["color","blur","offsetX","offsetY","affectStroke","nonScaling"].forEach((function(e){this[e]!==i[e]&&(t[e]=this[e])}),this),t}}),e.Shadow.reOffsetsAndBlur=/(?:\s|^)(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(\d+(?:\.\d*)?(?:px)?)?(?:\s?|$)(?:$|\s)/)}(i),function(){"use strict";if(r.StaticCanvas)r.warn("fabric.StaticCanvas is already defined.");else{var t=r.util.object.extend,e=r.util.getElementOffset,i=r.util.removeFromArray,n=r.util.toFixed,o=r.util.transformPoint,a=r.util.invertTransform,s=r.util.getNodeCanvas,c=r.util.createCanvasElement,l=new Error("Could not initialize `canvas` element");r.StaticCanvas=r.util.createClass(r.CommonMethods,{initialize:function(t,e){e||(e={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(t,e)},backgroundColor:"",backgroundImage:null,overlayColor:"",overlayImage:null,includeDefaultValues:!0,stateful:!1,renderOnAddRemove:!0,controlsAboveOverlay:!1,allowTouchScrolling:!1,imageSmoothingEnabled:!0,viewportTransform:r.iMatrix.concat(),backgroundVpt:!0,overlayVpt:!0,enableRetinaScaling:!0,vptCoords:{},skipOffscreen:!0,clipPath:void 0,_initStatic:function(t,e){var i=this.requestRenderAllBound;this._objects=[],this._createLowerCanvas(t),this._initOptions(e),this.interactive||this._initRetinaScaling(),e.overlayImage&&this.setOverlayImage(e.overlayImage,i),e.backgroundImage&&this.setBackgroundImage(e.backgroundImage,i),e.backgroundColor&&this.setBackgroundColor(e.backgroundColor,i),e.overlayColor&&this.setOverlayColor(e.overlayColor,i),this.calcOffset()},_isRetinaScaling:function(){return 1!==r.devicePixelRatio&&this.enableRetinaScaling},getRetinaScaling:function(){return this._isRetinaScaling()?r.devicePixelRatio:1},_initRetinaScaling:function(){if(this._isRetinaScaling()){var t=r.devicePixelRatio;this.__initRetinaScaling(t,this.lowerCanvasEl,this.contextContainer),this.upperCanvasEl&&this.__initRetinaScaling(t,this.upperCanvasEl,this.contextTop)}},__initRetinaScaling:function(t,e,i){e.setAttribute("width",this.width*t),e.setAttribute("height",this.height*t),i.scale(t,t)},calcOffset:function(){return this._offset=e(this.lowerCanvasEl),this},setOverlayImage:function(t,e,i){return this.__setBgOverlayImage("overlayImage",t,e,i)},setBackgroundImage:function(t,e,i){return this.__setBgOverlayImage("backgroundImage",t,e,i)},setOverlayColor:function(t,e){return this.__setBgOverlayColor("overlayColor",t,e)},setBackgroundColor:function(t,e){return this.__setBgOverlayColor("backgroundColor",t,e)},__setBgOverlayImage:function(t,e,i,n){return"string"===typeof e?r.util.loadImage(e,(function(e,o){if(e){var a=new r.Image(e,n);this[t]=a,a.canvas=this}i&&i(e,o)}),this,n&&n.crossOrigin):(n&&e.setOptions(n),this[t]=e,e&&(e.canvas=this),i&&i(e,!1)),this},__setBgOverlayColor:function(t,e,i){return this[t]=e,this._initGradient(e,t),this._initPattern(e,t,i),this},_createCanvasElement:function(){var t=c();if(!t)throw l;if(t.style||(t.style={}),"undefined"===typeof t.getContext)throw l;return t},_initOptions:function(t){var e=this.lowerCanvasEl;this._setOptions(t),this.width=this.width||parseInt(e.width,10)||0,this.height=this.height||parseInt(e.height,10)||0,this.lowerCanvasEl.style&&(e.width=this.width,e.height=this.height,e.style.width=this.width+"px",e.style.height=this.height+"px",this.viewportTransform=this.viewportTransform.slice())},_createLowerCanvas:function(t){t&&t.getContext?this.lowerCanvasEl=t:this.lowerCanvasEl=r.util.getById(t)||this._createCanvasElement(),r.util.addClass(this.lowerCanvasEl,"lower-canvas"),this._originalCanvasStyle=this.lowerCanvasEl.style,this.interactive&&this._applyCanvasStyle(this.lowerCanvasEl),this.contextContainer=this.lowerCanvasEl.getContext("2d")},getWidth:function(){return this.width},getHeight:function(){return this.height},setWidth:function(t,e){return this.setDimensions({width:t},e)},setHeight:function(t,e){return this.setDimensions({height:t},e)},setDimensions:function(t,e){var i;for(var n in e=e||{},t)i=t[n],e.cssOnly||(this._setBackstoreDimension(n,t[n]),i+="px",this.hasLostContext=!0),e.backstoreOnly||this._setCssDimension(n,i);return this._isCurrentlyDrawing&&this.freeDrawingBrush&&this.freeDrawingBrush._setBrushStyles(),this._initRetinaScaling(),this.calcOffset(),e.cssOnly||this.requestRenderAll(),this},_setBackstoreDimension:function(t,e){return this.lowerCanvasEl[t]=e,this.upperCanvasEl&&(this.upperCanvasEl[t]=e),this.cacheCanvasEl&&(this.cacheCanvasEl[t]=e),this[t]=e,this},_setCssDimension:function(t,e){return this.lowerCanvasEl.style[t]=e,this.upperCanvasEl&&(this.upperCanvasEl.style[t]=e),this.wrapperEl&&(this.wrapperEl.style[t]=e),this},getZoom:function(){return this.viewportTransform[0]},setViewportTransform:function(t){var e,i,n,r=this._activeObject,o=this.backgroundImage,a=this.overlayImage;for(this.viewportTransform=t,i=0,n=this._objects.length;i<n;i++)e=this._objects[i],e.group||e.setCoords(!0);return r&&r.setCoords(),o&&o.setCoords(!0),a&&a.setCoords(!0),this.calcViewportBoundaries(),this.renderOnAddRemove&&this.requestRenderAll(),this},zoomToPoint:function(t,e){var i=t,n=this.viewportTransform.slice(0);t=o(t,a(this.viewportTransform)),n[0]=e,n[3]=e;var r=o(t,n);return n[4]+=i.x-r.x,n[5]+=i.y-r.y,this.setViewportTransform(n)},setZoom:function(t){return this.zoomToPoint(new r.Point(0,0),t),this},absolutePan:function(t){var e=this.viewportTransform.slice(0);return e[4]=-t.x,e[5]=-t.y,this.setViewportTransform(e)},relativePan:function(t){return this.absolutePan(new r.Point(-t.x-this.viewportTransform[4],-t.y-this.viewportTransform[5]))},getElement:function(){return this.lowerCanvasEl},_onObjectAdded:function(t){this.stateful&&t.setupState(),t._set("canvas",this),t.setCoords(),this.fire("object:added",{target:t}),t.fire("added")},_onObjectRemoved:function(t){this.fire("object:removed",{target:t}),t.fire("removed"),delete t.canvas},clearContext:function(t){return t.clearRect(0,0,this.width,this.height),this},getContext:function(){return this.contextContainer},clear:function(){return this.remove.apply(this,this.getObjects()),this.backgroundImage=null,this.overlayImage=null,this.backgroundColor="",this.overlayColor="",this._hasITextHandlers&&(this.off("mouse:up",this._mouseUpITextHandler),this._iTextInstances=null,this._hasITextHandlers=!1),this.clearContext(this.contextContainer),this.fire("canvas:cleared"),this.renderOnAddRemove&&this.requestRenderAll(),this},renderAll:function(){var t=this.contextContainer;return this.renderCanvas(t,this._objects),this},renderAndReset:function(){this.isRendering=0,this.renderAll()},requestRenderAll:function(){return this.isRendering||(this.isRendering=r.util.requestAnimFrame(this.renderAndResetBound)),this},calcViewportBoundaries:function(){var t={},e=this.width,i=this.height,n=a(this.viewportTransform);return t.tl=o({x:0,y:0},n),t.br=o({x:e,y:i},n),t.tr=new r.Point(t.br.x,t.tl.y),t.bl=new r.Point(t.tl.x,t.br.y),this.vptCoords=t,t},cancelRequestedRender:function(){this.isRendering&&(r.util.cancelAnimFrame(this.isRendering),this.isRendering=0)},renderCanvas:function(t,e){var i=this.viewportTransform,n=this.clipPath;this.cancelRequestedRender(),this.calcViewportBoundaries(),this.clearContext(t),r.util.setImageSmoothing(t,this.imageSmoothingEnabled),this.fire("before:render",{ctx:t}),this._renderBackground(t),t.save(),t.transform(i[0],i[1],i[2],i[3],i[4],i[5]),this._renderObjects(t,e),t.restore(),!this.controlsAboveOverlay&&this.interactive&&this.drawControls(t),n&&(n.canvas=this,n.shouldCache(),n._transformDone=!0,n.renderCache({forClipping:!0}),this.drawClipPathOnCanvas(t)),this._renderOverlay(t),this.controlsAboveOverlay&&this.interactive&&this.drawControls(t),this.fire("after:render",{ctx:t})},drawClipPathOnCanvas:function(t){var e=this.viewportTransform,i=this.clipPath;t.save(),t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t.globalCompositeOperation="destination-in",i.transform(t),t.scale(1/i.zoomX,1/i.zoomY),t.drawImage(i._cacheCanvas,-i.cacheTranslationX,-i.cacheTranslationY),t.restore()},_renderObjects:function(t,e){var i,n;for(i=0,n=e.length;i<n;++i)e[i]&&e[i].render(t)},_renderBackgroundOrOverlay:function(t,e){var i=this[e+"Color"],n=this[e+"Image"],r=this.viewportTransform,o=this[e+"Vpt"];if(i||n){if(i){t.save(),t.beginPath(),t.moveTo(0,0),t.lineTo(this.width,0),t.lineTo(this.width,this.height),t.lineTo(0,this.height),t.closePath(),t.fillStyle=i.toLive?i.toLive(t,this):i,o&&t.transform(r[0],r[1],r[2],r[3],r[4],r[5]),t.transform(1,0,0,1,i.offsetX||0,i.offsetY||0);var a=i.gradientTransform||i.patternTransform;a&&t.transform(a[0],a[1],a[2],a[3],a[4],a[5]),t.fill(),t.restore()}n&&(t.save(),o&&t.transform(r[0],r[1],r[2],r[3],r[4],r[5]),n.render(t),t.restore())}},_renderBackground:function(t){this._renderBackgroundOrOverlay(t,"background")},_renderOverlay:function(t){this._renderBackgroundOrOverlay(t,"overlay")},getCenter:function(){return{top:this.height/2,left:this.width/2}},centerObjectH:function(t){return this._centerObject(t,new r.Point(this.getCenter().left,t.getCenterPoint().y))},centerObjectV:function(t){return this._centerObject(t,new r.Point(t.getCenterPoint().x,this.getCenter().top))},centerObject:function(t){var e=this.getCenter();return this._centerObject(t,new r.Point(e.left,e.top))},viewportCenterObject:function(t){var e=this.getVpCenter();return this._centerObject(t,e)},viewportCenterObjectH:function(t){var e=this.getVpCenter();return this._centerObject(t,new r.Point(e.x,t.getCenterPoint().y)),this},viewportCenterObjectV:function(t){var e=this.getVpCenter();return this._centerObject(t,new r.Point(t.getCenterPoint().x,e.y))},getVpCenter:function(){var t=this.getCenter(),e=a(this.viewportTransform);return o({x:t.left,y:t.top},e)},_centerObject:function(t,e){return t.setPositionByOrigin(e,"center","center"),t.setCoords(),this.renderOnAddRemove&&this.requestRenderAll(),this},toDatalessJSON:function(t){return this.toDatalessObject(t)},toObject:function(t){return this._toObjectMethod("toObject",t)},toDatalessObject:function(t){return this._toObjectMethod("toDatalessObject",t)},_toObjectMethod:function(e,i){var n=this.clipPath,o={version:r.version,objects:this._toObjects(e,i)};return n&&!n.excludeFromExport&&(o.clipPath=this._toObject(this.clipPath,e,i)),t(o,this.__serializeBgOverlay(e,i)),r.util.populateWithProperties(this,o,i),o},_toObjects:function(t,e){return this._objects.filter((function(t){return!t.excludeFromExport})).map((function(i){return this._toObject(i,t,e)}),this)},_toObject:function(t,e,i){var n;this.includeDefaultValues||(n=t.includeDefaultValues,t.includeDefaultValues=!1);var r=t[e](i);return this.includeDefaultValues||(t.includeDefaultValues=n),r},__serializeBgOverlay:function(t,e){var i={},n=this.backgroundImage,r=this.overlayImage,o=this.backgroundColor,a=this.overlayColor;return o&&o.toObject?o.excludeFromExport||(i.background=o.toObject(e)):o&&(i.background=o),a&&a.toObject?a.excludeFromExport||(i.overlay=a.toObject(e)):a&&(i.overlay=a),n&&!n.excludeFromExport&&(i.backgroundImage=this._toObject(n,t,e)),r&&!r.excludeFromExport&&(i.overlayImage=this._toObject(r,t,e)),i},svgViewportTransformation:!0,toSVG:function(t,e){t||(t={}),t.reviver=e;var i=[];return this._setSVGPreamble(i,t),this._setSVGHeader(i,t),this.clipPath&&i.push('<g clip-path="url(#'+this.clipPath.clipPathId+')" >\n'),this._setSVGBgOverlayColor(i,"background"),this._setSVGBgOverlayImage(i,"backgroundImage",e),this._setSVGObjects(i,e),this.clipPath&&i.push("</g>\n"),this._setSVGBgOverlayColor(i,"overlay"),this._setSVGBgOverlayImage(i,"overlayImage",e),i.push("</svg>"),i.join("")},_setSVGPreamble:function(t,e){e.suppressPreamble||t.push('<?xml version="1.0" encoding="',e.encoding||"UTF-8",'" standalone="no" ?>\n','<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" ','"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')},_setSVGHeader:function(t,e){var i,o=e.width||this.width,a=e.height||this.height,s='viewBox="0 0 '+this.width+" "+this.height+'" ',c=r.Object.NUM_FRACTION_DIGITS;e.viewBox?s='viewBox="'+e.viewBox.x+" "+e.viewBox.y+" "+e.viewBox.width+" "+e.viewBox.height+'" ':this.svgViewportTransformation&&(i=this.viewportTransform,s='viewBox="'+n(-i[4]/i[0],c)+" "+n(-i[5]/i[3],c)+" "+n(this.width/i[0],c)+" "+n(this.height/i[3],c)+'" '),t.push("<svg ",'xmlns="http://www.w3.org/2000/svg" ','xmlns:xlink="http://www.w3.org/1999/xlink" ','version="1.1" ','width="',o,'" ','height="',a,'" ',s,'xml:space="preserve">\n',"<desc>Created with Fabric.js ",r.version,"</desc>\n","<defs>\n",this.createSVGFontFacesMarkup(),this.createSVGRefElementsMarkup(),this.createSVGClipPathMarkup(e),"</defs>\n")},createSVGClipPathMarkup:function(t){var e=this.clipPath;return e?(e.clipPathId="CLIPPATH_"+r.Object.__uid++,'<clipPath id="'+e.clipPathId+'" >\n'+this.clipPath.toClipPathSVG(t.reviver)+"</clipPath>\n"):""},createSVGRefElementsMarkup:function(){var t=this,e=["background","overlay"].map((function(e){var i=t[e+"Color"];if(i&&i.toLive){var n=t[e+"Vpt"],o=t.viewportTransform,a={width:t.width/(n?o[0]:1),height:t.height/(n?o[3]:1)};return i.toSVG(a,{additionalTransform:n?r.util.matrixToSVG(o):""})}}));return e.join("")},createSVGFontFacesMarkup:function(){var t,e,i,n,o,a,s,c,l,u="",h={},f=r.fontPaths,d=[];for(this._objects.forEach((function t(e){d.push(e),e._objects&&e._objects.forEach(t)})),c=0,l=d.length;c<l;c++)if(t=d[c],e=t.fontFamily,-1!==t.type.indexOf("text")&&!h[e]&&f[e]&&(h[e]=!0,t.styles))for(o in i=t.styles,i)for(s in n=i[o],n)a=n[s],e=a.fontFamily,!h[e]&&f[e]&&(h[e]=!0);for(var g in h)u+=["\t\t@font-face {\n","\t\t\tfont-family: '",g,"';\n","\t\t\tsrc: url('",f[g],"');\n","\t\t}\n"].join("");return u&&(u=['\t<style type="text/css">',"<![CDATA[\n",u,"]]>","</style>\n"].join("")),u},_setSVGObjects:function(t,e){var i,n,r,o=this._objects;for(n=0,r=o.length;n<r;n++)i=o[n],i.excludeFromExport||this._setSVGObject(t,i,e)},_setSVGObject:function(t,e,i){t.push(e.toSVG(i))},_setSVGBgOverlayImage:function(t,e,i){this[e]&&!this[e].excludeFromExport&&this[e].toSVG&&t.push(this[e].toSVG(i))},_setSVGBgOverlayColor:function(t,e){var i=this[e+"Color"],n=this.viewportTransform,o=this.width,a=this.height;if(i)if(i.toLive){var s=i.repeat,c=r.util.invertTransform(n),l=this[e+"Vpt"],u=l?r.util.matrixToSVG(c):"";t.push('<rect transform="'+u+" translate(",o/2,",",a/2,')"',' x="',i.offsetX-o/2,'" y="',i.offsetY-a/2,'" ','width="',"repeat-y"===s||"no-repeat"===s?i.source.width:o,'" height="',"repeat-x"===s||"no-repeat"===s?i.source.height:a,'" fill="url(#SVGID_'+i.id+')"',"></rect>\n")}else t.push('<rect x="0" y="0" width="100%" height="100%" ','fill="',i,'"',"></rect>\n")},sendToBack:function(t){if(!t)return this;var e,n,r,o=this._activeObject;if(t===o&&"activeSelection"===t.type)for(r=o._objects,e=r.length;e--;)n=r[e],i(this._objects,n),this._objects.unshift(n);else i(this._objects,t),this._objects.unshift(t);return this.renderOnAddRemove&&this.requestRenderAll(),this},bringToFront:function(t){if(!t)return this;var e,n,r,o=this._activeObject;if(t===o&&"activeSelection"===t.type)for(r=o._objects,e=0;e<r.length;e++)n=r[e],i(this._objects,n),this._objects.push(n);else i(this._objects,t),this._objects.push(t);return this.renderOnAddRemove&&this.requestRenderAll(),this},sendBackwards:function(t,e){if(!t)return this;var n,r,o,a,s,c=this._activeObject,l=0;if(t===c&&"activeSelection"===t.type)for(s=c._objects,n=0;n<s.length;n++)r=s[n],o=this._objects.indexOf(r),o>0+l&&(a=o-1,i(this._objects,r),this._objects.splice(a,0,r)),l++;else o=this._objects.indexOf(t),0!==o&&(a=this._findNewLowerIndex(t,o,e),i(this._objects,t),this._objects.splice(a,0,t));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewLowerIndex:function(t,e,i){var n,r;if(i)for(n=e,r=e-1;r>=0;--r){var o=t.intersectsWithObject(this._objects[r])||t.isContainedWithinObject(this._objects[r])||this._objects[r].isContainedWithinObject(t);if(o){n=r;break}}else n=e-1;return n},bringForward:function(t,e){if(!t)return this;var n,r,o,a,s,c=this._activeObject,l=0;if(t===c&&"activeSelection"===t.type)for(s=c._objects,n=s.length;n--;)r=s[n],o=this._objects.indexOf(r),o<this._objects.length-1-l&&(a=o+1,i(this._objects,r),this._objects.splice(a,0,r)),l++;else o=this._objects.indexOf(t),o!==this._objects.length-1&&(a=this._findNewUpperIndex(t,o,e),i(this._objects,t),this._objects.splice(a,0,t));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewUpperIndex:function(t,e,i){var n,r,o;if(i)for(n=e,r=e+1,o=this._objects.length;r<o;++r){var a=t.intersectsWithObject(this._objects[r])||t.isContainedWithinObject(this._objects[r])||this._objects[r].isContainedWithinObject(t);if(a){n=r;break}}else n=e+1;return n},moveTo:function(t,e){return i(this._objects,t),this._objects.splice(e,0,t),this.renderOnAddRemove&&this.requestRenderAll()},dispose:function(){return this.isRendering&&(r.util.cancelAnimFrame(this.isRendering),this.isRendering=0),this.forEachObject((function(t){t.dispose&&t.dispose()})),this._objects=[],this.backgroundImage&&this.backgroundImage.dispose&&this.backgroundImage.dispose(),this.backgroundImage=null,this.overlayImage&&this.overlayImage.dispose&&this.overlayImage.dispose(),this.overlayImage=null,this._iTextInstances=null,this.contextContainer=null,this.lowerCanvasEl.classList.remove("lower-canvas"),this.lowerCanvasEl.style=this._originalCanvasStyle,delete this._originalCanvasStyle,this.lowerCanvasEl.setAttribute("width",this.width),this.lowerCanvasEl.setAttribute("height",this.height),r.util.cleanUpJsdomNode(this.lowerCanvasEl),this.lowerCanvasEl=void 0,this},toString:function(){return"#<fabric.Canvas ("+this.complexity()+"): { objects: "+this._objects.length+" }>"}}),t(r.StaticCanvas.prototype,r.Observable),t(r.StaticCanvas.prototype,r.Collection),t(r.StaticCanvas.prototype,r.DataURLExporter),t(r.StaticCanvas,{EMPTY_JSON:'{"objects": [], "background": "white"}',supports:function(t){var e=c();if(!e||!e.getContext)return null;var i=e.getContext("2d");if(!i)return null;switch(t){case"setLineDash":return"undefined"!==typeof i.setLineDash;default:return null}}}),r.StaticCanvas.prototype.toJSON=r.StaticCanvas.prototype.toObject,r.isLikelyNode&&(r.StaticCanvas.prototype.createPNGStream=function(){var t=s(this.lowerCanvasEl);return t&&t.createPNGStream()},r.StaticCanvas.prototype.createJPEGStream=function(t){var e=s(this.lowerCanvasEl);return e&&e.createJPEGStream(t)})}}(),r.BaseBrush=r.util.createClass({color:"rgb(0, 0, 0)",width:1,shadow:null,strokeLineCap:"round",strokeLineJoin:"round",strokeMiterLimit:10,strokeDashArray:null,limitedToCanvasSize:!1,_setBrushStyles:function(){var t=this.canvas.contextTop;t.strokeStyle=this.color,t.lineWidth=this.width,t.lineCap=this.strokeLineCap,t.miterLimit=this.strokeMiterLimit,t.lineJoin=this.strokeLineJoin,t.setLineDash(this.strokeDashArray||[])},_saveAndTransform:function(t){var e=this.canvas.viewportTransform;t.save(),t.transform(e[0],e[1],e[2],e[3],e[4],e[5])},_setShadow:function(){if(this.shadow){var t=this.canvas,e=this.shadow,i=t.contextTop,n=t.getZoom();t&&t._isRetinaScaling()&&(n*=r.devicePixelRatio),i.shadowColor=e.color,i.shadowBlur=e.blur*n,i.shadowOffsetX=e.offsetX*n,i.shadowOffsetY=e.offsetY*n}},needsFullRender:function(){var t=new r.Color(this.color);return t.getAlpha()<1||!!this.shadow},_resetShadow:function(){var t=this.canvas.contextTop;t.shadowColor="",t.shadowBlur=t.shadowOffsetX=t.shadowOffsetY=0},_isOutSideCanvas:function(t){return t.x<0||t.x>this.canvas.getWidth()||t.y<0||t.y>this.canvas.getHeight()}}),function(){r.PencilBrush=r.util.createClass(r.BaseBrush,{decimate:.4,initialize:function(t){this.canvas=t,this._points=[]},_drawSegment:function(t,e,i){var n=e.midPointFrom(i);return t.quadraticCurveTo(e.x,e.y,n.x,n.y),n},onMouseDown:function(t,e){this.canvas._isMainEvent(e.e)&&(this._prepareForDrawing(t),this._captureDrawingPath(t),this._render())},onMouseMove:function(t,e){if(this.canvas._isMainEvent(e.e)&&(!0!==this.limitedToCanvasSize||!this._isOutSideCanvas(t))&&this._captureDrawingPath(t)&&this._points.length>1)if(this.needsFullRender())this.canvas.clearContext(this.canvas.contextTop),this._render();else{var i=this._points,n=i.length,r=this.canvas.contextTop;this._saveAndTransform(r),this.oldEnd&&(r.beginPath(),r.moveTo(this.oldEnd.x,this.oldEnd.y)),this.oldEnd=this._drawSegment(r,i[n-2],i[n-1],!0),r.stroke(),r.restore()}},onMouseUp:function(t){return!this.canvas._isMainEvent(t.e)||(this.oldEnd=void 0,this._finalizeAndAddPath(),!1)},_prepareForDrawing:function(t){var e=new r.Point(t.x,t.y);this._reset(),this._addPoint(e),this.canvas.contextTop.moveTo(e.x,e.y)},_addPoint:function(t){return!(this._points.length>1&&t.eq(this._points[this._points.length-1]))&&(this._points.push(t),!0)},_reset:function(){this._points=[],this._setBrushStyles(),this._setShadow()},_captureDrawingPath:function(t){var e=new r.Point(t.x,t.y);return this._addPoint(e)},_render:function(){var t,e,i=this.canvas.contextTop,n=this._points[0],o=this._points[1];if(this._saveAndTransform(i),i.beginPath(),2===this._points.length&&n.x===o.x&&n.y===o.y){var a=this.width/1e3;n=new r.Point(n.x,n.y),o=new r.Point(o.x,o.y),n.x-=a,o.x+=a}for(i.moveTo(n.x,n.y),t=1,e=this._points.length;t<e;t++)this._drawSegment(i,n,o),n=this._points[t],o=this._points[t+1];i.lineTo(n.x,n.y),i.stroke(),i.restore()},convertPointsToSVGPath:function(t){var e=this.width/1e3;return r.util.getSmoothPathFromPoints(t,e)},_isEmptySVGPath:function(t){var e=r.util.joinPath(t);return"M 0 0 Q 0 0 0 0 L 0 0"===e},createPath:function(t){var e=new r.Path(t,{fill:null,stroke:this.color,strokeWidth:this.width,strokeLineCap:this.strokeLineCap,strokeMiterLimit:this.strokeMiterLimit,strokeLineJoin:this.strokeLineJoin,strokeDashArray:this.strokeDashArray});return this.shadow&&(this.shadow.affectStroke=!0,e.shadow=new r.Shadow(this.shadow)),e},decimatePoints:function(t,e){if(t.length<=2)return t;var i,n,r=this.canvas.getZoom(),o=Math.pow(e/r,2),a=t.length-1,s=t[0],c=[s];for(i=1;i<a-1;i++)n=Math.pow(s.x-t[i].x,2)+Math.pow(s.y-t[i].y,2),n>=o&&(s=t[i],c.push(s));return c.push(t[a]),c},_finalizeAndAddPath:function(){var t=this.canvas.contextTop;t.closePath(),this.decimate&&(this._points=this.decimatePoints(this._points,this.decimate));var e=this.convertPointsToSVGPath(this._points);if(this._isEmptySVGPath(e))this.canvas.requestRenderAll();else{var i=this.createPath(e);this.canvas.clearContext(this.canvas.contextTop),this.canvas.fire("before:path:created",{path:i}),this.canvas.add(i),this.canvas.requestRenderAll(),i.setCoords(),this._resetShadow(),this.canvas.fire("path:created",{path:i})}}})}(),r.CircleBrush=r.util.createClass(r.BaseBrush,{width:10,initialize:function(t){this.canvas=t,this.points=[]},drawDot:function(t){var e=this.addPoint(t),i=this.canvas.contextTop;this._saveAndTransform(i),this.dot(i,e),i.restore()},dot:function(t,e){t.fillStyle=e.fill,t.beginPath(),t.arc(e.x,e.y,e.radius,0,2*Math.PI,!1),t.closePath(),t.fill()},onMouseDown:function(t){this.points.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.drawDot(t)},_render:function(){var t,e,i=this.canvas.contextTop,n=this.points;for(this._saveAndTransform(i),t=0,e=n.length;t<e;t++)this.dot(i,n[t]);i.restore()},onMouseMove:function(t){!0===this.limitedToCanvasSize&&this._isOutSideCanvas(t)||(this.needsFullRender()?(this.canvas.clearContext(this.canvas.contextTop),this.addPoint(t),this._render()):this.drawDot(t))},onMouseUp:function(){var t,e,i=this.canvas.renderOnAddRemove;this.canvas.renderOnAddRemove=!1;var n=[];for(t=0,e=this.points.length;t<e;t++){var o=this.points[t],a=new r.Circle({radius:o.radius,left:o.x,top:o.y,originX:"center",originY:"center",fill:o.fill});this.shadow&&(a.shadow=new r.Shadow(this.shadow)),n.push(a)}var s=new r.Group(n);s.canvas=this.canvas,this.canvas.fire("before:path:created",{path:s}),this.canvas.add(s),this.canvas.fire("path:created",{path:s}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=i,this.canvas.requestRenderAll()},addPoint:function(t){var e=new r.Point(t.x,t.y),i=r.util.getRandomInt(Math.max(0,this.width-20),this.width+20)/2,n=new r.Color(this.color).setAlpha(r.util.getRandomInt(0,100)/100).toRgba();return e.radius=i,e.fill=n,this.points.push(e),e}}),r.SprayBrush=r.util.createClass(r.BaseBrush,{width:10,density:20,dotWidth:1,dotWidthVariance:1,randomOpacity:!1,optimizeOverlapping:!0,initialize:function(t){this.canvas=t,this.sprayChunks=[]},onMouseDown:function(t){this.sprayChunks.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.addSprayChunk(t),this.render(this.sprayChunkPoints)},onMouseMove:function(t){!0===this.limitedToCanvasSize&&this._isOutSideCanvas(t)||(this.addSprayChunk(t),this.render(this.sprayChunkPoints))},onMouseUp:function(){var t=this.canvas.renderOnAddRemove;this.canvas.renderOnAddRemove=!1;for(var e=[],i=0,n=this.sprayChunks.length;i<n;i++)for(var o=this.sprayChunks[i],a=0,s=o.length;a<s;a++){var c=new r.Rect({width:o[a].width,height:o[a].width,left:o[a].x+1,top:o[a].y+1,originX:"center",originY:"center",fill:this.color});e.push(c)}this.optimizeOverlapping&&(e=this._getOptimizedRects(e));var l=new r.Group(e);this.shadow&&l.set("shadow",new r.Shadow(this.shadow)),this.canvas.fire("before:path:created",{path:l}),this.canvas.add(l),this.canvas.fire("path:created",{path:l}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=t,this.canvas.requestRenderAll()},_getOptimizedRects:function(t){var e,i,n,r={};for(i=0,n=t.length;i<n;i++)e=t[i].left+""+t[i].top,r[e]||(r[e]=t[i]);var o=[];for(e in r)o.push(r[e]);return o},render:function(t){var e,i,n=this.canvas.contextTop;for(n.fillStyle=this.color,this._saveAndTransform(n),e=0,i=t.length;e<i;e++){var r=t[e];"undefined"!==typeof r.opacity&&(n.globalAlpha=r.opacity),n.fillRect(r.x,r.y,r.width,r.width)}n.restore()},_render:function(){var t,e,i=this.canvas.contextTop;for(i.fillStyle=this.color,this._saveAndTransform(i),t=0,e=this.sprayChunks.length;t<e;t++)this.render(this.sprayChunks[t]);i.restore()},addSprayChunk:function(t){this.sprayChunkPoints=[];var e,i,n,o,a=this.width/2;for(o=0;o<this.density;o++){e=r.util.getRandomInt(t.x-a,t.x+a),i=r.util.getRandomInt(t.y-a,t.y+a),n=this.dotWidthVariance?r.util.getRandomInt(Math.max(1,this.dotWidth-this.dotWidthVariance),this.dotWidth+this.dotWidthVariance):this.dotWidth;var s=new r.Point(e,i);s.width=n,this.randomOpacity&&(s.opacity=r.util.getRandomInt(0,100)/100),this.sprayChunkPoints.push(s)}this.sprayChunks.push(this.sprayChunkPoints)}}),r.PatternBrush=r.util.createClass(r.PencilBrush,{getPatternSrc:function(){var t=20,e=5,i=r.util.createCanvasElement(),n=i.getContext("2d");return i.width=i.height=t+e,n.fillStyle=this.color,n.beginPath(),n.arc(t/2,t/2,t/2,0,2*Math.PI,!1),n.closePath(),n.fill(),i},getPatternSrcFunction:function(){return String(this.getPatternSrc).replace("this.color",'"'+this.color+'"')},getPattern:function(){return this.canvas.contextTop.createPattern(this.source||this.getPatternSrc(),"repeat")},_setBrushStyles:function(){this.callSuper("_setBrushStyles"),this.canvas.contextTop.strokeStyle=this.getPattern()},createPath:function(t){var e=this.callSuper("createPath",t),i=e._getLeftTopCoords().scalarAdd(e.strokeWidth/2);return e.stroke=new r.Pattern({source:this.source||this.getPatternSrcFunction(),offsetX:-i.x,offsetY:-i.y}),e}}),function(){var t=r.util.getPointer,e=r.util.degreesToRadians,i=r.util.isTouchEvent;for(var n in r.Canvas=r.util.createClass(r.StaticCanvas,{initialize:function(t,e){e||(e={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(t,e),this._initInteractive(),this._createCacheCanvas()},uniformScaling:!0,uniScaleKey:"shiftKey",centeredScaling:!1,centeredRotation:!1,centeredKey:"altKey",altActionKey:"shiftKey",interactive:!0,selection:!0,selectionKey:"shiftKey",altSelectionKey:null,selectionColor:"rgba(100, 100, 255, 0.3)",selectionDashArray:[],selectionBorderColor:"rgba(255, 255, 255, 0.3)",selectionLineWidth:1,selectionFullyContained:!1,hoverCursor:"move",moveCursor:"move",defaultCursor:"default",freeDrawingCursor:"crosshair",rotationCursor:"crosshair",notAllowedCursor:"not-allowed",containerClass:"canvas-container",perPixelTargetFind:!1,targetFindTolerance:0,skipTargetFind:!1,isDrawingMode:!1,preserveObjectStacking:!1,snapAngle:0,snapThreshold:null,stopContextMenu:!1,fireRightClick:!1,fireMiddleClick:!1,targets:[],_hoveredTarget:null,_hoveredTargets:[],_initInteractive:function(){this._currentTransform=null,this._groupSelector=null,this._initWrapperElement(),this._createUpperCanvas(),this._initEventListeners(),this._initRetinaScaling(),this.freeDrawingBrush=r.PencilBrush&&new r.PencilBrush(this),this.calcOffset()},_chooseObjectsToRender:function(){var t,e,i,n=this.getActiveObjects();if(n.length>0&&!this.preserveObjectStacking){e=[],i=[];for(var r=0,o=this._objects.length;r<o;r++)t=this._objects[r],-1===n.indexOf(t)?e.push(t):i.push(t);n.length>1&&(this._activeObject._objects=i),e.push.apply(e,i)}else e=this._objects;return e},renderAll:function(){!this.contextTopDirty||this._groupSelector||this.isDrawingMode||(this.clearContext(this.contextTop),this.contextTopDirty=!1),this.hasLostContext&&this.renderTopLayer(this.contextTop);var t=this.contextContainer;return this.renderCanvas(t,this._chooseObjectsToRender()),this},renderTopLayer:function(t){t.save(),this.isDrawingMode&&this._isCurrentlyDrawing&&(this.freeDrawingBrush&&this.freeDrawingBrush._render(),this.contextTopDirty=!0),this.selection&&this._groupSelector&&(this._drawSelection(t),this.contextTopDirty=!0),t.restore()},renderTop:function(){var t=this.contextTop;return this.clearContext(t),this.renderTopLayer(t),this.fire("after:render"),this},_normalizePointer:function(t,e){var i=t.calcTransformMatrix(),n=r.util.invertTransform(i),o=this.restorePointerVpt(e);return r.util.transformPoint(o,n)},isTargetTransparent:function(t,e,i){if(t.shouldCache()&&t._cacheCanvas&&t!==this._activeObject){var n=this._normalizePointer(t,{x:e,y:i}),o=Math.max(t.cacheTranslationX+n.x*t.zoomX,0),a=Math.max(t.cacheTranslationY+n.y*t.zoomY,0),s=r.util.isTransparent(t._cacheContext,Math.round(o),Math.round(a),this.targetFindTolerance);return s}var c=this.contextCache,l=t.selectionBackgroundColor,u=this.viewportTransform;t.selectionBackgroundColor="",this.clearContext(c),c.save(),c.transform(u[0],u[1],u[2],u[3],u[4],u[5]),t.render(c),c.restore(),t.selectionBackgroundColor=l;s=r.util.isTransparent(c,e,i,this.targetFindTolerance);return s},_isSelectionKeyPressed:function(t){var e=!1;return e="[object Array]"===Object.prototype.toString.call(this.selectionKey)?!!this.selectionKey.find((function(e){return!0===t[e]})):t[this.selectionKey],e},_shouldClearSelection:function(t,e){var i=this.getActiveObjects(),n=this._activeObject;return!e||e&&n&&i.length>1&&-1===i.indexOf(e)&&n!==e&&!this._isSelectionKeyPressed(t)||e&&!e.evented||e&&!e.selectable&&n&&n!==e},_shouldCenterTransform:function(t,e,i){var n;if(t)return"scale"===e||"scaleX"===e||"scaleY"===e||"resizing"===e?n=this.centeredScaling||t.centeredScaling:"rotate"===e&&(n=this.centeredRotation||t.centeredRotation),n?!i:i},_getOriginFromCorner:function(t,e){var i={x:t.originX,y:t.originY};return"ml"===e||"tl"===e||"bl"===e?i.x="right":"mr"!==e&&"tr"!==e&&"br"!==e||(i.x="left"),"tl"===e||"mt"===e||"tr"===e?i.y="bottom":"bl"!==e&&"mb"!==e&&"br"!==e||(i.y="top"),i},_getActionFromCorner:function(t,e,i,n){if(!e||!t)return"drag";var r=n.controls[e];return r.getActionName(i,r,n)},_setupCurrentTransform:function(t,i,n){if(i){var o=this.getPointer(t),a=i.__corner,s=i.controls[a],c=n&&a?s.getActionHandler(t,i,s):r.controlsUtils.dragHandler,l=this._getActionFromCorner(n,a,t,i),u=this._getOriginFromCorner(i,a),h=t[this.centeredKey],f={target:i,action:l,actionHandler:c,corner:a,scaleX:i.scaleX,scaleY:i.scaleY,skewX:i.skewX,skewY:i.skewY,offsetX:o.x-i.left,offsetY:o.y-i.top,originX:u.x,originY:u.y,ex:o.x,ey:o.y,lastX:o.x,lastY:o.y,theta:e(i.angle),width:i.width*i.scaleX,shiftKey:t.shiftKey,altKey:h,original:r.util.saveObjectTransform(i)};this._shouldCenterTransform(i,l,h)&&(f.originX="center",f.originY="center"),f.original.originX=u.x,f.original.originY=u.y,this._currentTransform=f,this._beforeTransform(t)}},setCursor:function(t){this.upperCanvasEl.style.cursor=t},_drawSelection:function(t){var e=this._groupSelector,i=new r.Point(e.ex,e.ey),n=r.util.transformPoint(i,this.viewportTransform),o=new r.Point(e.ex+e.left,e.ey+e.top),a=r.util.transformPoint(o,this.viewportTransform),s=Math.min(n.x,a.x),c=Math.min(n.y,a.y),l=Math.max(n.x,a.x),u=Math.max(n.y,a.y),h=this.selectionLineWidth/2;this.selectionColor&&(t.fillStyle=this.selectionColor,t.fillRect(s,c,l-s,u-c)),this.selectionLineWidth&&this.selectionBorderColor&&(t.lineWidth=this.selectionLineWidth,t.strokeStyle=this.selectionBorderColor,s+=h,c+=h,l-=h,u-=h,r.Object.prototype._setLineDash.call(this,t,this.selectionDashArray),t.strokeRect(s,c,l-s,u-c))},findTarget:function(t,e){if(!this.skipTargetFind){var n,r,o=!0,a=this.getPointer(t,o),s=this._activeObject,c=this.getActiveObjects(),l=i(t),u=c.length>1&&!e||1===c.length;if(this.targets=[],u&&s._findTargetCorner(a,l))return s;if(c.length>1&&!e&&s===this._searchPossibleTargets([s],a))return s;if(1===c.length&&s===this._searchPossibleTargets([s],a)){if(!this.preserveObjectStacking)return s;n=s,r=this.targets,this.targets=[]}var h=this._searchPossibleTargets(this._objects,a);return t[this.altSelectionKey]&&h&&n&&h!==n&&(h=n,this.targets=r),h}},_checkTarget:function(t,e,i){if(e&&e.visible&&e.evented&&e.containsPoint(t)){if(!this.perPixelTargetFind&&!e.perPixelTargetFind||e.isEditing)return!0;var n=this.isTargetTransparent(e,i.x,i.y);if(!n)return!0}},_searchPossibleTargets:function(t,e){var i,n,o=t.length;while(o--){var a=t[o],s=a.group?this._normalizePointer(a.group,e):e;if(this._checkTarget(s,a,e)){i=t[o],i.subTargetCheck&&i instanceof r.Group&&(n=this._searchPossibleTargets(i._objects,e),n&&this.targets.push(n));break}}return i},restorePointerVpt:function(t){return r.util.transformPoint(t,r.util.invertTransform(this.viewportTransform))},getPointer:function(e,i){if(this._absolutePointer&&!i)return this._absolutePointer;if(this._pointer&&i)return this._pointer;var n,r=t(e),o=this.upperCanvasEl,a=o.getBoundingClientRect(),s=a.width||0,c=a.height||0;s&&c||("top"in a&&"bottom"in a&&(c=Math.abs(a.top-a.bottom)),"right"in a&&"left"in a&&(s=Math.abs(a.right-a.left))),this.calcOffset(),r.x=r.x-this._offset.left,r.y=r.y-this._offset.top,i||(r=this.restorePointerVpt(r));var l=this.getRetinaScaling();return 1!==l&&(r.x/=l,r.y/=l),n=0===s||0===c?{width:1,height:1}:{width:o.width/s,height:o.height/c},{x:r.x*n.width,y:r.y*n.height}},_createUpperCanvas:function(){var t=this.lowerCanvasEl.className.replace(/\s*lower-canvas\s*/,""),e=this.lowerCanvasEl,i=this.upperCanvasEl;i?i.className="":(i=this._createCanvasElement(),this.upperCanvasEl=i),r.util.addClass(i,"upper-canvas "+t),this.wrapperEl.appendChild(i),this._copyCanvasStyle(e,i),this._applyCanvasStyle(i),this.contextTop=i.getContext("2d")},_createCacheCanvas:function(){this.cacheCanvasEl=this._createCanvasElement(),this.cacheCanvasEl.setAttribute("width",this.width),this.cacheCanvasEl.setAttribute("height",this.height),this.contextCache=this.cacheCanvasEl.getContext("2d")},_initWrapperElement:function(){this.wrapperEl=r.util.wrapElement(this.lowerCanvasEl,"div",{class:this.containerClass}),r.util.setStyle(this.wrapperEl,{width:this.width+"px",height:this.height+"px",position:"relative"}),r.util.makeElementUnselectable(this.wrapperEl)},_applyCanvasStyle:function(t){var e=this.width||t.width,i=this.height||t.height;r.util.setStyle(t,{position:"absolute",width:e+"px",height:i+"px",left:0,top:0,"touch-action":this.allowTouchScrolling?"manipulation":"none","-ms-touch-action":this.allowTouchScrolling?"manipulation":"none"}),t.width=e,t.height=i,r.util.makeElementUnselectable(t)},_copyCanvasStyle:function(t,e){e.style.cssText=t.style.cssText},getSelectionContext:function(){return this.contextTop},getSelectionElement:function(){return this.upperCanvasEl},getActiveObject:function(){return this._activeObject},getActiveObjects:function(){var t=this._activeObject;return t?"activeSelection"===t.type&&t._objects?t._objects.slice(0):[t]:[]},_onObjectRemoved:function(t){t===this._activeObject&&(this.fire("before:selection:cleared",{target:t}),this._discardActiveObject(),this.fire("selection:cleared",{target:t}),t.fire("deselected")),t===this._hoveredTarget&&(this._hoveredTarget=null,this._hoveredTargets=[]),this.callSuper("_onObjectRemoved",t)},_fireSelectionEvents:function(t,e){var i=!1,n=this.getActiveObjects(),r=[],o=[];t.forEach((function(t){-1===n.indexOf(t)&&(i=!0,t.fire("deselected",{e:e,target:t}),o.push(t))})),n.forEach((function(n){-1===t.indexOf(n)&&(i=!0,n.fire("selected",{e:e,target:n}),r.push(n))})),t.length>0&&n.length>0?i&&this.fire("selection:updated",{e:e,selected:r,deselected:o,updated:r[0]||o[0],target:this._activeObject}):n.length>0?this.fire("selection:created",{e:e,selected:r,target:this._activeObject}):t.length>0&&this.fire("selection:cleared",{e:e,deselected:o})},setActiveObject:function(t,e){var i=this.getActiveObjects();return this._setActiveObject(t,e),this._fireSelectionEvents(i,e),this},_setActiveObject:function(t,e){return this._activeObject!==t&&(!!this._discardActiveObject(e,t)&&(!t.onSelect({e:e})&&(this._activeObject=t,!0)))},_discardActiveObject:function(t,e){var i=this._activeObject;if(i){if(i.onDeselect({e:t,object:e}))return!1;this._activeObject=null}return!0},discardActiveObject:function(t){var e=this.getActiveObjects(),i=this.getActiveObject();return e.length&&this.fire("before:selection:cleared",{target:i,e:t}),this._discardActiveObject(t),this._fireSelectionEvents(e,t),this},dispose:function(){var t=this.wrapperEl;return this.removeListeners(),t.removeChild(this.upperCanvasEl),t.removeChild(this.lowerCanvasEl),this.contextCache=null,this.contextTop=null,["upperCanvasEl","cacheCanvasEl"].forEach(function(t){r.util.cleanUpJsdomNode(this[t]),this[t]=void 0}.bind(this)),t.parentNode&&t.parentNode.replaceChild(this.lowerCanvasEl,this.wrapperEl),delete this.wrapperEl,r.StaticCanvas.prototype.dispose.call(this),this},clear:function(){return this.discardActiveObject(),this.clearContext(this.contextTop),this.callSuper("clear")},drawControls:function(t){var e=this._activeObject;e&&e._renderControls(t)},_toObject:function(t,e,i){var n=this._realizeGroupTransformOnObject(t),r=this.callSuper("_toObject",t,e,i);return this._unwindGroupTransformOnObject(t,n),r},_realizeGroupTransformOnObject:function(t){if(t.group&&"activeSelection"===t.group.type&&this._activeObject===t.group){var e=["angle","flipX","flipY","left","scaleX","scaleY","skewX","skewY","top"],i={};return e.forEach((function(e){i[e]=t[e]})),r.util.addTransformToObject(t,this._activeObject.calcOwnMatrix()),i}return null},_unwindGroupTransformOnObject:function(t,e){e&&t.set(e)},_setSVGObject:function(t,e,i){var n=this._realizeGroupTransformOnObject(e);this.callSuper("_setSVGObject",t,e,i),this._unwindGroupTransformOnObject(e,n)},setViewportTransform:function(t){this.renderOnAddRemove&&this._activeObject&&this._activeObject.isEditing&&this._activeObject.clearContextTop(),r.StaticCanvas.prototype.setViewportTransform.call(this,t)}}),r.StaticCanvas)"prototype"!==n&&(r.Canvas[n]=r.StaticCanvas[n])}(),function(){var t=r.util.addListener,e=r.util.removeListener,i=3,n=2,o=1,a={passive:!1};function s(t,e){return t.button&&t.button===e-1}r.util.object.extend(r.Canvas.prototype,{mainTouchId:null,_initEventListeners:function(){this.removeListeners(),this._bindEvents(),this.addOrRemove(t,"add")},_getEventPrefix:function(){return this.enablePointerEvents?"pointer":"mouse"},addOrRemove:function(t,e){var i=this.upperCanvasEl,n=this._getEventPrefix();t(r.window,"resize",this._onResize),t(i,n+"down",this._onMouseDown),t(i,n+"move",this._onMouseMove,a),t(i,n+"out",this._onMouseOut),t(i,n+"enter",this._onMouseEnter),t(i,"wheel",this._onMouseWheel),t(i,"contextmenu",this._onContextMenu),t(i,"dblclick",this._onDoubleClick),t(i,"dragover",this._onDragOver),t(i,"dragenter",this._onDragEnter),t(i,"dragleave",this._onDragLeave),t(i,"drop",this._onDrop),this.enablePointerEvents||t(i,"touchstart",this._onTouchStart,a),"undefined"!==typeof eventjs&&e in eventjs&&(eventjs[e](i,"gesture",this._onGesture),eventjs[e](i,"drag",this._onDrag),eventjs[e](i,"orientation",this._onOrientationChange),eventjs[e](i,"shake",this._onShake),eventjs[e](i,"longpress",this._onLongPress))},removeListeners:function(){this.addOrRemove(e,"remove");var t=this._getEventPrefix();e(r.document,t+"up",this._onMouseUp),e(r.document,"touchend",this._onTouchEnd,a),e(r.document,t+"move",this._onMouseMove,a),e(r.document,"touchmove",this._onMouseMove,a)},_bindEvents:function(){this.eventsBound||(this._onMouseDown=this._onMouseDown.bind(this),this._onTouchStart=this._onTouchStart.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onResize=this._onResize.bind(this),this._onGesture=this._onGesture.bind(this),this._onDrag=this._onDrag.bind(this),this._onShake=this._onShake.bind(this),this._onLongPress=this._onLongPress.bind(this),this._onOrientationChange=this._onOrientationChange.bind(this),this._onMouseWheel=this._onMouseWheel.bind(this),this._onMouseOut=this._onMouseOut.bind(this),this._onMouseEnter=this._onMouseEnter.bind(this),this._onContextMenu=this._onContextMenu.bind(this),this._onDoubleClick=this._onDoubleClick.bind(this),this._onDragOver=this._onDragOver.bind(this),this._onDragEnter=this._simpleEventHandler.bind(this,"dragenter"),this._onDragLeave=this._simpleEventHandler.bind(this,"dragleave"),this._onDrop=this._simpleEventHandler.bind(this,"drop"),this.eventsBound=!0)},_onGesture:function(t,e){this.__onTransformGesture&&this.__onTransformGesture(t,e)},_onDrag:function(t,e){this.__onDrag&&this.__onDrag(t,e)},_onMouseWheel:function(t){this.__onMouseWheel(t)},_onMouseOut:function(t){var e=this._hoveredTarget;this.fire("mouse:out",{target:e,e:t}),this._hoveredTarget=null,e&&e.fire("mouseout",{e:t});var i=this;this._hoveredTargets.forEach((function(n){i.fire("mouse:out",{target:e,e:t}),n&&e.fire("mouseout",{e:t})})),this._hoveredTargets=[],this._iTextInstances&&this._iTextInstances.forEach((function(t){t.isEditing&&t.hiddenTextarea.focus()}))},_onMouseEnter:function(t){this._currentTransform||this.findTarget(t)||(this.fire("mouse:over",{target:null,e:t}),this._hoveredTarget=null,this._hoveredTargets=[])},_onOrientationChange:function(t,e){this.__onOrientationChange&&this.__onOrientationChange(t,e)},_onShake:function(t,e){this.__onShake&&this.__onShake(t,e)},_onLongPress:function(t,e){this.__onLongPress&&this.__onLongPress(t,e)},_onDragOver:function(t){t.preventDefault();var e=this._simpleEventHandler("dragover",t);this._fireEnterLeaveEvents(e,t)},_onContextMenu:function(t){return this.stopContextMenu&&(t.stopPropagation(),t.preventDefault()),!1},_onDoubleClick:function(t){this._cacheTransformEventData(t),this._handleEvent(t,"dblclick"),this._resetTransformEventData(t)},getPointerId:function(t){var e=t.changedTouches;return e?e[0]&&e[0].identifier:this.enablePointerEvents?t.pointerId:-1},_isMainEvent:function(t){return!0===t.isPrimary||!1!==t.isPrimary&&("touchend"===t.type&&0===t.touches.length||(!t.changedTouches||t.changedTouches[0].identifier===this.mainTouchId))},_onTouchStart:function(i){i.preventDefault(),null===this.mainTouchId&&(this.mainTouchId=this.getPointerId(i)),this.__onMouseDown(i),this._resetTransformEventData();var n=this.upperCanvasEl,o=this._getEventPrefix();t(r.document,"touchend",this._onTouchEnd,a),t(r.document,"touchmove",this._onMouseMove,a),e(n,o+"down",this._onMouseDown)},_onMouseDown:function(i){this.__onMouseDown(i),this._resetTransformEventData();var n=this.upperCanvasEl,o=this._getEventPrefix();e(n,o+"move",this._onMouseMove,a),t(r.document,o+"up",this._onMouseUp),t(r.document,o+"move",this._onMouseMove,a)},_onTouchEnd:function(i){if(!(i.touches.length>0)){this.__onMouseUp(i),this._resetTransformEventData(),this.mainTouchId=null;var n=this._getEventPrefix();e(r.document,"touchend",this._onTouchEnd,a),e(r.document,"touchmove",this._onMouseMove,a);var o=this;this._willAddMouseDown&&clearTimeout(this._willAddMouseDown),this._willAddMouseDown=setTimeout((function(){t(o.upperCanvasEl,n+"down",o._onMouseDown),o._willAddMouseDown=0}),400)}},_onMouseUp:function(i){this.__onMouseUp(i),this._resetTransformEventData();var n=this.upperCanvasEl,o=this._getEventPrefix();this._isMainEvent(i)&&(e(r.document,o+"up",this._onMouseUp),e(r.document,o+"move",this._onMouseMove,a),t(n,o+"move",this._onMouseMove,a))},_onMouseMove:function(t){!this.allowTouchScrolling&&t.preventDefault&&t.preventDefault(),this.__onMouseMove(t)},_onResize:function(){this.calcOffset()},_shouldRender:function(t){var e=this._activeObject;return!!(!!e!==!!t||e&&t&&e!==t)||(e&&e.isEditing,!1)},__onMouseUp:function(t){var e,a=this._currentTransform,c=this._groupSelector,l=!1,u=!c||0===c.left&&0===c.top;if(this._cacheTransformEventData(t),e=this._target,this._handleEvent(t,"up:before"),s(t,i))this.fireRightClick&&this._handleEvent(t,"up",i,u);else{if(s(t,n))return this.fireMiddleClick&&this._handleEvent(t,"up",n,u),void this._resetTransformEventData();if(this.isDrawingMode&&this._isCurrentlyDrawing)this._onMouseUpInDrawingMode(t);else if(this._isMainEvent(t)){if(a&&(this._finalizeCurrentTransform(t),l=a.actionPerformed),!u){var h=e===this._activeObject;this._maybeGroupObjects(t),l||(l=this._shouldRender(e)||!h&&e===this._activeObject)}if(e){if(e.selectable&&e!==this._activeObject&&"up"===e.activeOn)this.setActiveObject(e,t),l=!0;else{var f=e._findTargetCorner(this.getPointer(t,!0),r.util.isTouchEvent(t)),d=e.controls[f],g=d&&d.getMouseUpHandler(t,e,d);if(g){var p=this.getPointer(t);g(t,a,p.x,p.y)}}e.isMoving=!1}this._setCursorFromEvent(t,e),this._handleEvent(t,"up",o,u),this._groupSelector=null,this._currentTransform=null,e&&(e.__corner=0),l?this.requestRenderAll():u||this.renderTop()}}},_simpleEventHandler:function(t,e){var i=this.findTarget(e),n=this.targets,r={e:e,target:i,subTargets:n};if(this.fire(t,r),i&&i.fire(t,r),!n)return i;for(var o=0;o<n.length;o++)n[o].fire(t,r);return i},_handleEvent:function(t,e,i,n){var r=this._target,a=this.targets||[],s={e:t,target:r,subTargets:a,button:i||o,isClick:n||!1,pointer:this._pointer,absolutePointer:this._absolutePointer,transform:this._currentTransform};"up"===e&&(s.currentTarget=this.findTarget(t),s.currentSubTargets=this.targets),this.fire("mouse:"+e,s),r&&r.fire("mouse"+e,s);for(var c=0;c<a.length;c++)a[c].fire("mouse"+e,s)},_finalizeCurrentTransform:function(t){var e,i=this._currentTransform,n=i.target,r={e:t,target:n,transform:i,action:i.action};n._scaling&&(n._scaling=!1),n.setCoords(),(i.actionPerformed||this.stateful&&n.hasStateChanged())&&(i.actionPerformed&&(e=this._addEventOptions(r,i),this._fire(e,r)),this._fire("modified",r))},_addEventOptions:function(t,e){var i,n;switch(e.action){case"scaleX":i="scaled",n="x";break;case"scaleY":i="scaled",n="y";break;case"skewX":i="skewed",n="x";break;case"skewY":i="skewed",n="y";break;case"scale":i="scaled",n="equally";break;case"rotate":i="rotated";break;case"drag":i="moved";break}return t.by=n,i},_onMouseDownInDrawingMode:function(t){this._isCurrentlyDrawing=!0,this.getActiveObject()&&this.discardActiveObject(t).requestRenderAll();var e=this.getPointer(t);this.freeDrawingBrush.onMouseDown(e,{e:t,pointer:e}),this._handleEvent(t,"down")},_onMouseMoveInDrawingMode:function(t){if(this._isCurrentlyDrawing){var e=this.getPointer(t);this.freeDrawingBrush.onMouseMove(e,{e:t,pointer:e})}this.setCursor(this.freeDrawingCursor),this._handleEvent(t,"move")},_onMouseUpInDrawingMode:function(t){var e=this.getPointer(t);this._isCurrentlyDrawing=this.freeDrawingBrush.onMouseUp({e:t,pointer:e}),this._handleEvent(t,"up")},__onMouseDown:function(t){this._cacheTransformEventData(t),this._handleEvent(t,"down:before");var e=this._target;if(s(t,i))this.fireRightClick&&this._handleEvent(t,"down",i);else if(s(t,n))this.fireMiddleClick&&this._handleEvent(t,"down",n);else if(this.isDrawingMode)this._onMouseDownInDrawingMode(t);else if(this._isMainEvent(t)&&!this._currentTransform){var o=this._pointer;this._previousPointer=o;var a=this._shouldRender(e),c=this._shouldGroup(t,e);if(this._shouldClearSelection(t,e)?this.discardActiveObject(t):c&&(this._handleGrouping(t,e),e=this._activeObject),!this.selection||e&&(e.selectable||e.isEditing||e===this._activeObject)||(this._groupSelector={ex:this._absolutePointer.x,ey:this._absolutePointer.y,top:0,left:0}),e){var l=e===this._activeObject;e.selectable&&"down"===e.activeOn&&this.setActiveObject(e,t);var u=e._findTargetCorner(this.getPointer(t,!0),r.util.isTouchEvent(t));if(e.__corner=u,e===this._activeObject&&(u||!c)){this._setupCurrentTransform(t,e,l);var h=e.controls[u],f=(o=this.getPointer(t),h&&h.getMouseDownHandler(t,e,h));f&&f(t,this._currentTransform,o.x,o.y)}}this._handleEvent(t,"down"),(a||c)&&this.requestRenderAll()}},_resetTransformEventData:function(){this._target=null,this._pointer=null,this._absolutePointer=null},_cacheTransformEventData:function(t){this._resetTransformEventData(),this._pointer=this.getPointer(t,!0),this._absolutePointer=this.restorePointerVpt(this._pointer),this._target=this._currentTransform?this._currentTransform.target:this.findTarget(t)||null},_beforeTransform:function(t){var e=this._currentTransform;this.stateful&&e.target.saveState(),this.fire("before:transform",{e:t,transform:e})},__onMouseMove:function(t){var e,i;if(this._handleEvent(t,"move:before"),this._cacheTransformEventData(t),this.isDrawingMode)this._onMouseMoveInDrawingMode(t);else if(this._isMainEvent(t)){var n=this._groupSelector;n?(i=this._absolutePointer,n.left=i.x-n.ex,n.top=i.y-n.ey,this.renderTop()):this._currentTransform?this._transformObject(t):(e=this.findTarget(t)||null,this._setCursorFromEvent(t,e),this._fireOverOutEvents(e,t)),this._handleEvent(t,"move"),this._resetTransformEventData()}},_fireOverOutEvents:function(t,e){var i=this._hoveredTarget,n=this._hoveredTargets,r=this.targets,o=Math.max(n.length,r.length);this.fireSyntheticInOutEvents(t,e,{oldTarget:i,evtOut:"mouseout",canvasEvtOut:"mouse:out",evtIn:"mouseover",canvasEvtIn:"mouse:over"});for(var a=0;a<o;a++)this.fireSyntheticInOutEvents(r[a],e,{oldTarget:n[a],evtOut:"mouseout",evtIn:"mouseover"});this._hoveredTarget=t,this._hoveredTargets=this.targets.concat()},_fireEnterLeaveEvents:function(t,e){var i=this._draggedoverTarget,n=this._hoveredTargets,r=this.targets,o=Math.max(n.length,r.length);this.fireSyntheticInOutEvents(t,e,{oldTarget:i,evtOut:"dragleave",evtIn:"dragenter"});for(var a=0;a<o;a++)this.fireSyntheticInOutEvents(r[a],e,{oldTarget:n[a],evtOut:"dragleave",evtIn:"dragenter"});this._draggedoverTarget=t},fireSyntheticInOutEvents:function(t,e,i){var n,r,o,a,s=i.oldTarget,c=s!==t,l=i.canvasEvtIn,u=i.canvasEvtOut;c&&(n={e:e,target:t,previousTarget:s},r={e:e,target:s,nextTarget:t}),a=t&&c,o=s&&c,o&&(u&&this.fire(u,r),s.fire(i.evtOut,r)),a&&(l&&this.fire(l,n),t.fire(i.evtIn,n))},__onMouseWheel:function(t){this._cacheTransformEventData(t),this._handleEvent(t,"wheel"),this._resetTransformEventData()},_transformObject:function(t){var e=this.getPointer(t),i=this._currentTransform;i.reset=!1,i.shiftKey=t.shiftKey,i.altKey=t[this.centeredKey],this._performTransformAction(t,i,e),i.actionPerformed&&this.requestRenderAll()},_performTransformAction:function(t,e,i){var n=i.x,r=i.y,o=e.action,a=!1,s=e.actionHandler;s&&(a=s(t,e,n,r)),"drag"===o&&a&&(e.target.isMoving=!0,this.setCursor(e.target.moveCursor||this.moveCursor)),e.actionPerformed=e.actionPerformed||a},_fire:r.controlsUtils.fireEvent,_setCursorFromEvent:function(t,e){if(!e)return this.setCursor(this.defaultCursor),!1;var i=e.hoverCursor||this.hoverCursor,n=this._activeObject&&"activeSelection"===this._activeObject.type?this._activeObject:null,r=(!n||!n.contains(e))&&e._findTargetCorner(this.getPointer(t,!0));r?this.setCursor(this.getCornerCursor(r,e,t)):(e.subTargetCheck&&this.targets.concat().reverse().map((function(t){i=t.hoverCursor||i})),this.setCursor(i))},getCornerCursor:function(t,e,i){var n=e.controls[t];return n.cursorStyleHandler(i,n,e)}})}(),function(){var t=Math.min,e=Math.max;r.util.object.extend(r.Canvas.prototype,{_shouldGroup:function(t,e){var i=this._activeObject;return i&&this._isSelectionKeyPressed(t)&&e&&e.selectable&&this.selection&&(i!==e||"activeSelection"===i.type)&&!e.onSelect({e:t})},_handleGrouping:function(t,e){var i=this._activeObject;i.__corner||(e!==i||(e=this.findTarget(t,!0),e&&e.selectable))&&(i&&"activeSelection"===i.type?this._updateActiveSelection(e,t):this._createActiveSelection(e,t))},_updateActiveSelection:function(t,e){var i=this._activeObject,n=i._objects.slice(0);i.contains(t)?(i.removeWithUpdate(t),this._hoveredTarget=t,this._hoveredTargets=this.targets.concat(),1===i.size()&&this._setActiveObject(i.item(0),e)):(i.addWithUpdate(t),this._hoveredTarget=i,this._hoveredTargets=this.targets.concat()),this._fireSelectionEvents(n,e)},_createActiveSelection:function(t,e){var i=this.getActiveObjects(),n=this._createGroup(t);this._hoveredTarget=n,this._setActiveObject(n,e),this._fireSelectionEvents(i,e)},_createGroup:function(t){var e=this._objects,i=e.indexOf(this._activeObject)<e.indexOf(t),n=i?[this._activeObject,t]:[t,this._activeObject];return this._activeObject.isEditing&&this._activeObject.exitEditing(),new r.ActiveSelection(n,{canvas:this})},_groupSelectedObjects:function(t){var e,i=this._collectObjects(t);1===i.length?this.setActiveObject(i[0],t):i.length>1&&(e=new r.ActiveSelection(i.reverse(),{canvas:this}),this.setActiveObject(e,t))},_collectObjects:function(i){for(var n,o=[],a=this._groupSelector.ex,s=this._groupSelector.ey,c=a+this._groupSelector.left,l=s+this._groupSelector.top,u=new r.Point(t(a,c),t(s,l)),h=new r.Point(e(a,c),e(s,l)),f=!this.selectionFullyContained,d=a===c&&s===l,g=this._objects.length;g--;)if(n=this._objects[g],n&&n.selectable&&n.visible&&(f&&n.intersectsWithRect(u,h,!0)||n.isContainedWithinRect(u,h,!0)||f&&n.containsPoint(u,null,!0)||f&&n.containsPoint(h,null,!0))&&(o.push(n),d))break;return o.length>1&&(o=o.filter((function(t){return!t.onSelect({e:i})}))),o},_maybeGroupObjects:function(t){this.selection&&this._groupSelector&&this._groupSelectedObjects(t),this.setCursor(this.defaultCursor),this._groupSelector=null}})}(),function(){r.util.object.extend(r.StaticCanvas.prototype,{toDataURL:function(t){t||(t={});var e=t.format||"png",i=t.quality||1,n=(t.multiplier||1)*(t.enableRetinaScaling?this.getRetinaScaling():1),o=this.toCanvasElement(n,t);return r.util.toDataURL(o,e,i)},toCanvasElement:function(t,e){t=t||1,e=e||{};var i=(e.width||this.width)*t,n=(e.height||this.height)*t,o=this.getZoom(),a=this.width,s=this.height,c=o*t,l=this.viewportTransform,u=(l[4]-(e.left||0))*t,h=(l[5]-(e.top||0))*t,f=this.interactive,d=[c,0,0,c,u,h],g=this.enableRetinaScaling,p=r.util.createCanvasElement(),v=this.contextTop;return p.width=i,p.height=n,this.contextTop=null,this.enableRetinaScaling=!1,this.interactive=!1,this.viewportTransform=d,this.width=i,this.height=n,this.calcViewportBoundaries(),this.renderCanvas(p.getContext("2d"),this._objects),this.viewportTransform=l,this.width=a,this.height=s,this.calcViewportBoundaries(),this.interactive=f,this.enableRetinaScaling=g,this.contextTop=v,p}})}(),r.util.object.extend(r.StaticCanvas.prototype,{loadFromJSON:function(t,e,i){if(t){var n="string"===typeof t?JSON.parse(t):r.util.object.clone(t),o=this,a=n.clipPath,s=this.renderOnAddRemove;return this.renderOnAddRemove=!1,delete n.clipPath,this._enlivenObjects(n.objects,(function(t){o.clear(),o._setBgOverlay(n,(function(){a?o._enlivenObjects([a],(function(i){o.clipPath=i[0],o.__setupCanvas.call(o,n,t,s,e)})):o.__setupCanvas.call(o,n,t,s,e)}))}),i),this}},__setupCanvas:function(t,e,i,n){var r=this;e.forEach((function(t,e){r.insertAt(t,e)})),this.renderOnAddRemove=i,delete t.objects,delete t.backgroundImage,delete t.overlayImage,delete t.background,delete t.overlay,this._setOptions(t),this.renderAll(),n&&n()},_setBgOverlay:function(t,e){var i={backgroundColor:!1,overlayColor:!1,backgroundImage:!1,overlayImage:!1};if(t.backgroundImage||t.overlayImage||t.background||t.overlay){var n=function(){i.backgroundImage&&i.overlayImage&&i.backgroundColor&&i.overlayColor&&e&&e()};this.__setBgOverlay("backgroundImage",t.backgroundImage,i,n),this.__setBgOverlay("overlayImage",t.overlayImage,i,n),this.__setBgOverlay("backgroundColor",t.background,i,n),this.__setBgOverlay("overlayColor",t.overlay,i,n)}else e&&e()},__setBgOverlay:function(t,e,i,n){var o=this;if(!e)return i[t]=!0,void(n&&n());"backgroundImage"===t||"overlayImage"===t?r.util.enlivenObjects([e],(function(e){o[t]=e[0],i[t]=!0,n&&n()})):this["set"+r.util.string.capitalize(t,!0)](e,(function(){i[t]=!0,n&&n()}))},_enlivenObjects:function(t,e,i){t&&0!==t.length?r.util.enlivenObjects(t,(function(t){e&&e(t)}),null,i):e&&e([])},_toDataURL:function(t,e){this.clone((function(i){e(i.toDataURL(t))}))},_toDataURLWithMultiplier:function(t,e,i){this.clone((function(n){i(n.toDataURLWithMultiplier(t,e))}))},clone:function(t,e){var i=JSON.stringify(this.toJSON(e));this.cloneWithoutData((function(e){e.loadFromJSON(i,(function(){t&&t(e)}))}))},cloneWithoutData:function(t){var e=r.util.createCanvasElement();e.width=this.width,e.height=this.height;var i=new r.Canvas(e);this.backgroundImage?(i.setBackgroundImage(this.backgroundImage.src,(function(){i.renderAll(),t&&t(i)})),i.backgroundImageOpacity=this.backgroundImageOpacity,i.backgroundImageStretch=this.backgroundImageStretch):t&&t(i)}}),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend,n=e.util.object.clone,r=e.util.toFixed,o=e.util.string.capitalize,a=e.util.degreesToRadians,s=!e.isLikelyNode,c=2;e.Object||(e.Object=e.util.createClass(e.CommonMethods,{type:"object",originX:"left",originY:"top",top:0,left:0,width:0,height:0,scaleX:1,scaleY:1,flipX:!1,flipY:!1,opacity:1,angle:0,skewX:0,skewY:0,cornerSize:13,touchCornerSize:24,transparentCorners:!0,hoverCursor:null,moveCursor:null,padding:0,borderColor:"rgb(178,204,255)",borderDashArray:null,cornerColor:"rgb(178,204,255)",cornerStrokeColor:null,cornerStyle:"rect",cornerDashArray:null,centeredScaling:!1,centeredRotation:!0,fill:"rgb(0,0,0)",fillRule:"nonzero",globalCompositeOperation:"source-over",backgroundColor:"",selectionBackgroundColor:"",stroke:null,strokeWidth:1,strokeDashArray:null,strokeDashOffset:0,strokeLineCap:"butt",strokeLineJoin:"miter",strokeMiterLimit:4,shadow:null,borderOpacityWhenMoving:.4,borderScaleFactor:1,minScaleLimit:0,selectable:!0,evented:!0,visible:!0,hasControls:!0,hasBorders:!0,perPixelTargetFind:!1,includeDefaultValues:!0,lockMovementX:!1,lockMovementY:!1,lockRotation:!1,lockScalingX:!1,lockScalingY:!1,lockSkewingX:!1,lockSkewingY:!1,lockScalingFlip:!1,excludeFromExport:!1,objectCaching:s,statefullCache:!1,noScaleCache:!0,strokeUniform:!1,dirty:!0,__corner:0,paintFirst:"fill",activeOn:"down",stateProperties:"top left width height scaleX scaleY flipX flipY originX originY transformMatrix stroke strokeWidth strokeDashArray strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit angle opacity fill globalCompositeOperation shadow visible backgroundColor skewX skewY fillRule paintFirst clipPath strokeUniform".split(" "),cacheProperties:"fill stroke strokeWidth strokeDashArray width height paintFirst strokeUniform strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit backgroundColor clipPath".split(" "),colorProperties:"fill stroke backgroundColor".split(" "),clipPath:void 0,inverted:!1,absolutePositioned:!1,initialize:function(t){t&&this.setOptions(t)},_createCacheCanvas:function(){this._cacheProperties={},this._cacheCanvas=e.util.createCanvasElement(),this._cacheContext=this._cacheCanvas.getContext("2d"),this._updateCacheCanvas(),this.dirty=!0},_limitCacheSize:function(t){var i=e.perfLimitSizeTotal,n=t.width,r=t.height,o=e.maxCacheSideLimit,a=e.minCacheSideLimit;if(n<=o&&r<=o&&n*r<=i)return n<a&&(t.width=a),r<a&&(t.height=a),t;var s=n/r,c=e.util.limitDimsByArea(s,i),l=e.util.capValue,u=l(a,c.x,o),h=l(a,c.y,o);return n>u&&(t.zoomX/=n/u,t.width=u,t.capped=!0),r>h&&(t.zoomY/=r/h,t.height=h,t.capped=!0),t},_getCacheCanvasDimensions:function(){var t=this.getTotalObjectScaling(),e=this._getTransformedDimensions(0,0),i=e.x*t.scaleX/this.scaleX,n=e.y*t.scaleY/this.scaleY;return{width:i+c,height:n+c,zoomX:t.scaleX,zoomY:t.scaleY,x:i,y:n}},_updateCacheCanvas:function(){var t=this.canvas;if(this.noScaleCache&&t&&t._currentTransform){var i=t._currentTransform.target,n=t._currentTransform.action;if(this===i&&n.slice&&"scale"===n.slice(0,5))return!1}var r,o,a=this._cacheCanvas,s=this._limitCacheSize(this._getCacheCanvasDimensions()),c=e.minCacheSideLimit,l=s.width,u=s.height,h=s.zoomX,f=s.zoomY,d=l!==this.cacheWidth||u!==this.cacheHeight,g=this.zoomX!==h||this.zoomY!==f,p=d||g,v=0,m=0,y=!1;if(d){var b=this._cacheCanvas.width,_=this._cacheCanvas.height,x=l>b||u>_,C=(l<.9*b||u<.9*_)&&b>c&&_>c;y=x||C,x&&!s.capped&&(l>c||u>c)&&(v=.1*l,m=.1*u)}return this instanceof e.Text&&this.path&&(p=!0,y=!0,v+=this.getHeightOfLine(0)*this.zoomX,m+=this.getHeightOfLine(0)*this.zoomY),!!p&&(y?(a.width=Math.ceil(l+v),a.height=Math.ceil(u+m)):(this._cacheContext.setTransform(1,0,0,1,0,0),this._cacheContext.clearRect(0,0,a.width,a.height)),r=s.x/2,o=s.y/2,this.cacheTranslationX=Math.round(a.width/2-r)+r,this.cacheTranslationY=Math.round(a.height/2-o)+o,this.cacheWidth=l,this.cacheHeight=u,this._cacheContext.translate(this.cacheTranslationX,this.cacheTranslationY),this._cacheContext.scale(h,f),this.zoomX=h,this.zoomY=f,!0)},setOptions:function(t){this._setOptions(t),this._initGradient(t.fill,"fill"),this._initGradient(t.stroke,"stroke"),this._initPattern(t.fill,"fill"),this._initPattern(t.stroke,"stroke")},transform:function(t){var e=this.group&&!this.group._transformDone||this.group&&this.canvas&&t===this.canvas.contextTop,i=this.calcTransformMatrix(!e);t.transform(i[0],i[1],i[2],i[3],i[4],i[5])},toObject:function(t){var i=e.Object.NUM_FRACTION_DIGITS,n={type:this.type,version:e.version,originX:this.originX,originY:this.originY,left:r(this.left,i),top:r(this.top,i),width:r(this.width,i),height:r(this.height,i),fill:this.fill&&this.fill.toObject?this.fill.toObject():this.fill,stroke:this.stroke&&this.stroke.toObject?this.stroke.toObject():this.stroke,strokeWidth:r(this.strokeWidth,i),strokeDashArray:this.strokeDashArray?this.strokeDashArray.concat():this.strokeDashArray,strokeLineCap:this.strokeLineCap,strokeDashOffset:this.strokeDashOffset,strokeLineJoin:this.strokeLineJoin,strokeUniform:this.strokeUniform,strokeMiterLimit:r(this.strokeMiterLimit,i),scaleX:r(this.scaleX,i),scaleY:r(this.scaleY,i),angle:r(this.angle,i),flipX:this.flipX,flipY:this.flipY,opacity:r(this.opacity,i),shadow:this.shadow&&this.shadow.toObject?this.shadow.toObject():this.shadow,visible:this.visible,backgroundColor:this.backgroundColor,fillRule:this.fillRule,paintFirst:this.paintFirst,globalCompositeOperation:this.globalCompositeOperation,skewX:r(this.skewX,i),skewY:r(this.skewY,i)};return this.clipPath&&!this.clipPath.excludeFromExport&&(n.clipPath=this.clipPath.toObject(t),n.clipPath.inverted=this.clipPath.inverted,n.clipPath.absolutePositioned=this.clipPath.absolutePositioned),e.util.populateWithProperties(this,n,t),this.includeDefaultValues||(n=this._removeDefaultValues(n)),n},toDatalessObject:function(t){return this.toObject(t)},_removeDefaultValues:function(t){var i=e.util.getKlass(t.type).prototype,n=i.stateProperties;return n.forEach((function(e){if("left"!==e&&"top"!==e){t[e]===i[e]&&delete t[e];var n="[object Array]"===Object.prototype.toString.call(t[e])&&"[object Array]"===Object.prototype.toString.call(i[e]);n&&0===t[e].length&&0===i[e].length&&delete t[e]}})),t},toString:function(){return"#<fabric."+o(this.type)+">"},getObjectScaling:function(){if(!this.group)return{scaleX:this.scaleX,scaleY:this.scaleY};var t=e.util.qrDecompose(this.calcTransformMatrix());return{scaleX:Math.abs(t.scaleX),scaleY:Math.abs(t.scaleY)}},getTotalObjectScaling:function(){var t=this.getObjectScaling(),e=t.scaleX,i=t.scaleY;if(this.canvas){var n=this.canvas.getZoom(),r=this.canvas.getRetinaScaling();e*=n*r,i*=n*r}return{scaleX:e,scaleY:i}},getObjectOpacity:function(){var t=this.opacity;return this.group&&(t*=this.group.getObjectOpacity()),t},_set:function(t,i){var n="scaleX"===t||"scaleY"===t,r=this[t]!==i,o=!1;return n&&(i=this._constrainScale(i)),"scaleX"===t&&i<0?(this.flipX=!this.flipX,i*=-1):"scaleY"===t&&i<0?(this.flipY=!this.flipY,i*=-1):"shadow"!==t||!i||i instanceof e.Shadow?"dirty"===t&&this.group&&this.group.set("dirty",i):i=new e.Shadow(i),this[t]=i,r&&(o=this.group&&this.group.isOnACache(),this.cacheProperties.indexOf(t)>-1?(this.dirty=!0,o&&this.group.set("dirty",!0)):o&&this.stateProperties.indexOf(t)>-1&&this.group.set("dirty",!0)),this},setOnGroup:function(){},getViewportTransform:function(){return this.canvas&&this.canvas.viewportTransform?this.canvas.viewportTransform:e.iMatrix.concat()},isNotVisible:function(){return 0===this.opacity||!this.width&&!this.height&&0===this.strokeWidth||!this.visible},render:function(t){this.isNotVisible()||this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(t.save(),this._setupCompositeOperation(t),this.drawSelectionBackground(t),this.transform(t),this._setOpacity(t),this._setShadow(t,this),this.shouldCache()?(this.renderCache(),this.drawCacheOnCanvas(t)):(this._removeCacheCanvas(),this.dirty=!1,this.drawObject(t),this.objectCaching&&this.statefullCache&&this.saveState({propertySet:"cacheProperties"})),t.restore())},renderCache:function(t){t=t||{},this._cacheCanvas||this._createCacheCanvas(),this.isCacheDirty()&&(this.statefullCache&&this.saveState({propertySet:"cacheProperties"}),this.drawObject(this._cacheContext,t.forClipping),this.dirty=!1)},_removeCacheCanvas:function(){this._cacheCanvas=null,this.cacheWidth=0,this.cacheHeight=0},hasStroke:function(){return this.stroke&&"transparent"!==this.stroke&&0!==this.strokeWidth},hasFill:function(){return this.fill&&"transparent"!==this.fill},needsItsOwnCache:function(){return!("stroke"!==this.paintFirst||!this.hasFill()||!this.hasStroke()||"object"!==typeof this.shadow)||!!this.clipPath},shouldCache:function(){return this.ownCaching=this.needsItsOwnCache()||this.objectCaching&&(!this.group||!this.group.isOnACache()),this.ownCaching},willDrawShadow:function(){return!!this.shadow&&(0!==this.shadow.offsetX||0!==this.shadow.offsetY)},drawClipPathOnCache:function(t){var i=this.clipPath;if(t.save(),i.inverted?t.globalCompositeOperation="destination-out":t.globalCompositeOperation="destination-in",i.absolutePositioned){var n=e.util.invertTransform(this.calcTransformMatrix());t.transform(n[0],n[1],n[2],n[3],n[4],n[5])}i.transform(t),t.scale(1/i.zoomX,1/i.zoomY),t.drawImage(i._cacheCanvas,-i.cacheTranslationX,-i.cacheTranslationY),t.restore()},drawObject:function(t,e){var i=this.fill,n=this.stroke;e?(this.fill="black",this.stroke="",this._setClippingProperties(t)):this._renderBackground(t),this._render(t),this._drawClipPath(t),this.fill=i,this.stroke=n},_drawClipPath:function(t){var e=this.clipPath;e&&(e.canvas=this.canvas,e.shouldCache(),e._transformDone=!0,e.renderCache({forClipping:!0}),this.drawClipPathOnCache(t))},drawCacheOnCanvas:function(t){t.scale(1/this.zoomX,1/this.zoomY),t.drawImage(this._cacheCanvas,-this.cacheTranslationX,-this.cacheTranslationY)},isCacheDirty:function(t){if(this.isNotVisible())return!1;if(this._cacheCanvas&&!t&&this._updateCacheCanvas())return!0;if(this.dirty||this.clipPath&&this.clipPath.absolutePositioned||this.statefullCache&&this.hasStateChanged("cacheProperties")){if(this._cacheCanvas&&!t){var e=this.cacheWidth/this.zoomX,i=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-e/2,-i/2,e,i)}return!0}return!1},_renderBackground:function(t){if(this.backgroundColor){var e=this._getNonTransformedDimensions();t.fillStyle=this.backgroundColor,t.fillRect(-e.x/2,-e.y/2,e.x,e.y),this._removeShadow(t)}},_setOpacity:function(t){this.group&&!this.group._transformDone?t.globalAlpha=this.getObjectOpacity():t.globalAlpha*=this.opacity},_setStrokeStyles:function(t,e){var i=e.stroke;i&&(t.lineWidth=e.strokeWidth,t.lineCap=e.strokeLineCap,t.lineDashOffset=e.strokeDashOffset,t.lineJoin=e.strokeLineJoin,t.miterLimit=e.strokeMiterLimit,i.toLive?"percentage"===i.gradientUnits||i.gradientTransform||i.patternTransform?this._applyPatternForTransformedGradient(t,i):(t.strokeStyle=i.toLive(t,this),this._applyPatternGradientTransform(t,i)):t.strokeStyle=e.stroke)},_setFillStyles:function(t,e){var i=e.fill;i&&(i.toLive?(t.fillStyle=i.toLive(t,this),this._applyPatternGradientTransform(t,e.fill)):t.fillStyle=i)},_setClippingProperties:function(t){t.globalAlpha=1,t.strokeStyle="transparent",t.fillStyle="#000000"},_setLineDash:function(t,e){e&&0!==e.length&&(1&e.length&&e.push.apply(e,e),t.setLineDash(e))},_renderControls:function(t,i){var n,r,o,s=this.getViewportTransform(),c=this.calcTransformMatrix();i=i||{},r="undefined"!==typeof i.hasBorders?i.hasBorders:this.hasBorders,o="undefined"!==typeof i.hasControls?i.hasControls:this.hasControls,c=e.util.multiplyTransformMatrices(s,c),n=e.util.qrDecompose(c),t.save(),t.translate(n.translateX,n.translateY),t.lineWidth=1*this.borderScaleFactor,this.group||(t.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1),t.rotate(a(n.angle)),i.forActiveSelection||this.group?r&&this.drawBordersInGroup(t,n,i):r&&this.drawBorders(t,i),o&&this.drawControls(t,i),t.restore()},_setShadow:function(t){if(this.shadow){var i,n=this.shadow,r=this.canvas,o=r&&r.viewportTransform[0]||1,a=r&&r.viewportTransform[3]||1;i=n.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),r&&r._isRetinaScaling()&&(o*=e.devicePixelRatio,a*=e.devicePixelRatio),t.shadowColor=n.color,t.shadowBlur=n.blur*e.browserShadowBlurConstant*(o+a)*(i.scaleX+i.scaleY)/4,t.shadowOffsetX=n.offsetX*o*i.scaleX,t.shadowOffsetY=n.offsetY*a*i.scaleY}},_removeShadow:function(t){this.shadow&&(t.shadowColor="",t.shadowBlur=t.shadowOffsetX=t.shadowOffsetY=0)},_applyPatternGradientTransform:function(t,e){if(!e||!e.toLive)return{offsetX:0,offsetY:0};var i=e.gradientTransform||e.patternTransform,n=-this.width/2+e.offsetX||0,r=-this.height/2+e.offsetY||0;return"percentage"===e.gradientUnits?t.transform(this.width,0,0,this.height,n,r):t.transform(1,0,0,1,n,r),i&&t.transform(i[0],i[1],i[2],i[3],i[4],i[5]),{offsetX:n,offsetY:r}},_renderPaintInOrder:function(t){"stroke"===this.paintFirst?(this._renderStroke(t),this._renderFill(t)):(this._renderFill(t),this._renderStroke(t))},_render:function(){},_renderFill:function(t){this.fill&&(t.save(),this._setFillStyles(t,this),"evenodd"===this.fillRule?t.fill("evenodd"):t.fill(),t.restore())},_renderStroke:function(t){if(this.stroke&&0!==this.strokeWidth){if(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(t),t.save(),this.strokeUniform&&this.group){var e=this.getObjectScaling();t.scale(1/e.scaleX,1/e.scaleY)}else this.strokeUniform&&t.scale(1/this.scaleX,1/this.scaleY);this._setLineDash(t,this.strokeDashArray),this._setStrokeStyles(t,this),t.stroke(),t.restore()}},_applyPatternForTransformedGradient:function(t,i){var n,r=this._limitCacheSize(this._getCacheCanvasDimensions()),o=e.util.createCanvasElement(),a=this.canvas.getRetinaScaling(),s=r.x/this.scaleX/a,c=r.y/this.scaleY/a;o.width=s,o.height=c,n=o.getContext("2d"),n.beginPath(),n.moveTo(0,0),n.lineTo(s,0),n.lineTo(s,c),n.lineTo(0,c),n.closePath(),n.translate(s/2,c/2),n.scale(r.zoomX/this.scaleX/a,r.zoomY/this.scaleY/a),this._applyPatternGradientTransform(n,i),n.fillStyle=i.toLive(t),n.fill(),t.translate(-this.width/2-this.strokeWidth/2,-this.height/2-this.strokeWidth/2),t.scale(a*this.scaleX/r.zoomX,a*this.scaleY/r.zoomY),t.strokeStyle=n.createPattern(o,"no-repeat")},_findCenterFromElement:function(){return{x:this.left+this.width/2,y:this.top+this.height/2}},_assignTransformMatrixProps:function(){if(this.transformMatrix){var t=e.util.qrDecompose(this.transformMatrix);this.flipX=!1,this.flipY=!1,this.set("scaleX",t.scaleX),this.set("scaleY",t.scaleY),this.angle=t.angle,this.skewX=t.skewX,this.skewY=0}},_removeTransformMatrix:function(t){var i=this._findCenterFromElement();this.transformMatrix&&(this._assignTransformMatrixProps(),i=e.util.transformPoint(i,this.transformMatrix)),this.transformMatrix=null,t&&(this.scaleX*=t.scaleX,this.scaleY*=t.scaleY,this.cropX=t.cropX,this.cropY=t.cropY,i.x+=t.offsetLeft,i.y+=t.offsetTop,this.width=t.width,this.height=t.height),this.setPositionByOrigin(i,"center","center")},clone:function(t,i){var n=this.toObject(i);this.constructor.fromObject?this.constructor.fromObject(n,t):e.Object._fromObject("Object",n,t)},cloneAsImage:function(t,i){var n=this.toCanvasElement(i);return t&&t(new e.Image(n)),this},toCanvasElement:function(t){t||(t={});var i=e.util,n=i.saveObjectTransform(this),r=this.group,o=this.shadow,a=Math.abs,s=(t.multiplier||1)*(t.enableRetinaScaling?e.devicePixelRatio:1);delete this.group,t.withoutTransform&&i.resetObjectTransform(this),t.withoutShadow&&(this.shadow=null);var c,l,u,h,f=e.util.createCanvasElement(),d=this.getBoundingRect(!0,!0),g=this.shadow,p={x:0,y:0};g&&(l=g.blur,c=g.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),p.x=2*Math.round(a(g.offsetX)+l)*a(c.scaleX),p.y=2*Math.round(a(g.offsetY)+l)*a(c.scaleY)),u=d.width+p.x,h=d.height+p.y,f.width=Math.ceil(u),f.height=Math.ceil(h);var v=new e.StaticCanvas(f,{enableRetinaScaling:!1,renderOnAddRemove:!1,skipOffscreen:!1});"jpeg"===t.format&&(v.backgroundColor="#fff"),this.setPositionByOrigin(new e.Point(v.width/2,v.height/2),"center","center");var m=this.canvas;v.add(this);var y=v.toCanvasElement(s||1,t);return this.shadow=o,this.set("canvas",m),r&&(this.group=r),this.set(n).setCoords(),v._objects=[],v.dispose(),v=null,y},toDataURL:function(t){return t||(t={}),e.util.toDataURL(this.toCanvasElement(t),t.format||"png",t.quality||1)},isType:function(t){return this.type===t},complexity:function(){return 1},toJSON:function(t){return this.toObject(t)},rotate:function(t){var e=("center"!==this.originX||"center"!==this.originY)&&this.centeredRotation;return e&&this._setOriginToCenter(),this.set("angle",t),e&&this._resetOrigin(),this},centerH:function(){return this.canvas&&this.canvas.centerObjectH(this),this},viewportCenterH:function(){return this.canvas&&this.canvas.viewportCenterObjectH(this),this},centerV:function(){return this.canvas&&this.canvas.centerObjectV(this),this},viewportCenterV:function(){return this.canvas&&this.canvas.viewportCenterObjectV(this),this},center:function(){return this.canvas&&this.canvas.centerObject(this),this},viewportCenter:function(){return this.canvas&&this.canvas.viewportCenterObject(this),this},getLocalPointer:function(t,i){i=i||this.canvas.getPointer(t);var n=new e.Point(i.x,i.y),r=this._getLeftTopCoords();return this.angle&&(n=e.util.rotatePoint(n,r,a(-this.angle))),{x:n.x-r.x,y:n.y-r.y}},_setupCompositeOperation:function(t){this.globalCompositeOperation&&(t.globalCompositeOperation=this.globalCompositeOperation)}}),e.util.createAccessors&&e.util.createAccessors(e.Object),i(e.Object.prototype,e.Observable),e.Object.NUM_FRACTION_DIGITS=2,e.Object._fromObject=function(t,i,r,o){var a=e[t];i=n(i,!0),e.util.enlivenPatterns([i.fill,i.stroke],(function(t){"undefined"!==typeof t[0]&&(i.fill=t[0]),"undefined"!==typeof t[1]&&(i.stroke=t[1]),e.util.enlivenObjects([i.clipPath],(function(t){i.clipPath=t[0];var e=o?new a(i[o],i):new a(i);r&&r(e)}))}))},e.Object.__uid=0)}(i),function(){var t=r.util.degreesToRadians,e={left:-.5,center:0,right:.5},i={top:-.5,center:0,bottom:.5};r.util.object.extend(r.Object.prototype,{translateToGivenOrigin:function(t,n,o,a,s){var c,l,u,h=t.x,f=t.y;return"string"===typeof n?n=e[n]:n-=.5,"string"===typeof a?a=e[a]:a-=.5,c=a-n,"string"===typeof o?o=i[o]:o-=.5,"string"===typeof s?s=i[s]:s-=.5,l=s-o,(c||l)&&(u=this._getTransformedDimensions(),h=t.x+c*u.x,f=t.y+l*u.y),new r.Point(h,f)},translateToCenterPoint:function(e,i,n){var o=this.translateToGivenOrigin(e,i,n,"center","center");return this.angle?r.util.rotatePoint(o,e,t(this.angle)):o},translateToOriginPoint:function(e,i,n){var o=this.translateToGivenOrigin(e,"center","center",i,n);return this.angle?r.util.rotatePoint(o,e,t(this.angle)):o},getCenterPoint:function(){var t=new r.Point(this.left,this.top);return this.translateToCenterPoint(t,this.originX,this.originY)},getPointByOrigin:function(t,e){var i=this.getCenterPoint();return this.translateToOriginPoint(i,t,e)},toLocalPoint:function(e,i,n){var o,a,s=this.getCenterPoint();return o="undefined"!==typeof i&&"undefined"!==typeof n?this.translateToGivenOrigin(s,"center","center",i,n):new r.Point(this.left,this.top),a=new r.Point(e.x,e.y),this.angle&&(a=r.util.rotatePoint(a,s,-t(this.angle))),a.subtractEquals(o)},setPositionByOrigin:function(t,e,i){var n=this.translateToCenterPoint(t,e,i),r=this.translateToOriginPoint(n,this.originX,this.originY);this.set("left",r.x),this.set("top",r.y)},adjustPosition:function(i){var n,o,a=t(this.angle),s=this.getScaledWidth(),c=r.util.cos(a)*s,l=r.util.sin(a)*s;n="string"===typeof this.originX?e[this.originX]:this.originX-.5,o="string"===typeof i?e[i]:i-.5,this.left+=c*(o-n),this.top+=l*(o-n),this.setCoords(),this.originX=i},_setOriginToCenter:function(){this._originalOriginX=this.originX,this._originalOriginY=this.originY;var t=this.getCenterPoint();this.originX="center",this.originY="center",this.left=t.x,this.top=t.y},_resetOrigin:function(){var t=this.translateToOriginPoint(this.getCenterPoint(),this._originalOriginX,this._originalOriginY);this.originX=this._originalOriginX,this.originY=this._originalOriginY,this.left=t.x,this.top=t.y,this._originalOriginX=null,this._originalOriginY=null},_getLeftTopCoords:function(){return this.translateToOriginPoint(this.getCenterPoint(),"left","top")}})}(),function(){function t(t){return[new r.Point(t.tl.x,t.tl.y),new r.Point(t.tr.x,t.tr.y),new r.Point(t.br.x,t.br.y),new r.Point(t.bl.x,t.bl.y)]}var e=r.util,i=e.degreesToRadians,n=e.multiplyTransformMatrices,o=e.transformPoint;e.object.extend(r.Object.prototype,{oCoords:null,aCoords:null,lineCoords:null,ownMatrixCache:null,matrixCache:null,controls:{},_getCoords:function(t,e){return e?t?this.calcACoords():this.calcLineCoords():(this.aCoords&&this.lineCoords||this.setCoords(!0),t?this.aCoords:this.lineCoords)},getCoords:function(e,i){return t(this._getCoords(e,i))},intersectsWithRect:function(t,e,i,n){var o=this.getCoords(i,n),a=r.Intersection.intersectPolygonRectangle(o,t,e);return"Intersection"===a.status},intersectsWithObject:function(t,e,i){var n=r.Intersection.intersectPolygonPolygon(this.getCoords(e,i),t.getCoords(e,i));return"Intersection"===n.status||t.isContainedWithinObject(this,e,i)||this.isContainedWithinObject(t,e,i)},isContainedWithinObject:function(t,e,i){for(var n=this.getCoords(e,i),r=e?t.aCoords:t.lineCoords,o=0,a=t._getImageLines(r);o<4;o++)if(!t.containsPoint(n[o],a))return!1;return!0},isContainedWithinRect:function(t,e,i,n){var r=this.getBoundingRect(i,n);return r.left>=t.x&&r.left+r.width<=e.x&&r.top>=t.y&&r.top+r.height<=e.y},containsPoint:function(t,e,i,n){var r=this._getCoords(i,n),o=(e=e||this._getImageLines(r),this._findCrossPoints(t,e));return 0!==o&&o%2===1},isOnScreen:function(t){if(!this.canvas)return!1;var e=this.canvas.vptCoords.tl,i=this.canvas.vptCoords.br,n=this.getCoords(!0,t);return!!n.some((function(t){return t.x<=i.x&&t.x>=e.x&&t.y<=i.y&&t.y>=e.y}))||(!!this.intersectsWithRect(e,i,!0,t)||this._containsCenterOfCanvas(e,i,t))},_containsCenterOfCanvas:function(t,e,i){var n={x:(t.x+e.x)/2,y:(t.y+e.y)/2};return!!this.containsPoint(n,null,!0,i)},isPartiallyOnScreen:function(t){if(!this.canvas)return!1;var e=this.canvas.vptCoords.tl,i=this.canvas.vptCoords.br;if(this.intersectsWithRect(e,i,!0,t))return!0;var n=this.getCoords(!0,t).every((function(t){return(t.x>=i.x||t.x<=e.x)&&(t.y>=i.y||t.y<=e.y)}));return n&&this._containsCenterOfCanvas(e,i,t)},_getImageLines:function(t){var e={topline:{o:t.tl,d:t.tr},rightline:{o:t.tr,d:t.br},bottomline:{o:t.br,d:t.bl},leftline:{o:t.bl,d:t.tl}};return e},_findCrossPoints:function(t,e){var i,n,r,o,a,s,c=0;for(var l in e)if(s=e[l],!(s.o.y<t.y&&s.d.y<t.y)&&!(s.o.y>=t.y&&s.d.y>=t.y)&&(s.o.x===s.d.x&&s.o.x>=t.x?a=s.o.x:(i=0,n=(s.d.y-s.o.y)/(s.d.x-s.o.x),r=t.y-i*t.x,o=s.o.y-n*s.o.x,a=-(r-o)/(i-n)),a>=t.x&&(c+=1),2===c))break;return c},getBoundingRect:function(t,i){var n=this.getCoords(t,i);return e.makeBoundingBoxFromPoints(n)},getScaledWidth:function(){return this._getTransformedDimensions().x},getScaledHeight:function(){return this._getTransformedDimensions().y},_constrainScale:function(t){return Math.abs(t)<this.minScaleLimit?t<0?-this.minScaleLimit:this.minScaleLimit:0===t?1e-4:t},scale:function(t){return this._set("scaleX",t),this._set("scaleY",t),this.setCoords()},scaleToWidth:function(t,e){var i=this.getBoundingRect(e).width/this.getScaledWidth();return this.scale(t/this.width/i)},scaleToHeight:function(t,e){var i=this.getBoundingRect(e).height/this.getScaledHeight();return this.scale(t/this.height/i)},calcCoords:function(t){return t?this.calcACoords():this.calcOCoords()},calcLineCoords:function(){var t=this.getViewportTransform(),n=this.padding,r=i(this.angle),a=e.cos(r),s=e.sin(r),c=a*n,l=s*n,u=c+l,h=c-l,f=this.calcACoords(),d={tl:o(f.tl,t),tr:o(f.tr,t),bl:o(f.bl,t),br:o(f.br,t)};return n&&(d.tl.x-=h,d.tl.y-=u,d.tr.x+=u,d.tr.y-=h,d.bl.x-=u,d.bl.y+=h,d.br.x+=h,d.br.y+=u),d},calcOCoords:function(){var t=this._calcRotateMatrix(),e=this._calcTranslateMatrix(),i=this.getViewportTransform(),r=n(i,e),o=n(r,t),a=(o=n(o,[1/i[0],0,0,1/i[3],0,0]),this._calculateCurrentDimensions()),s={};return this.forEachControl((function(t,e,i){s[e]=t.positionHandler(a,o,i)})),s},calcACoords:function(){var t=this._calcRotateMatrix(),e=this._calcTranslateMatrix(),i=n(e,t),r=this._getTransformedDimensions(),a=r.x/2,s=r.y/2;return{tl:o({x:-a,y:-s},i),tr:o({x:a,y:-s},i),bl:o({x:-a,y:s},i),br:o({x:a,y:s},i)}},setCoords:function(t){return this.aCoords=this.calcACoords(),this.lineCoords=this.group?this.aCoords:this.calcLineCoords(),t||(this.oCoords=this.calcOCoords(),this._setCornerCoords&&this._setCornerCoords()),this},_calcRotateMatrix:function(){return e.calcRotateMatrix(this)},_calcTranslateMatrix:function(){var t=this.getCenterPoint();return[1,0,0,1,t.x,t.y]},transformMatrixKey:function(t){var e="_",i="";return!t&&this.group&&(i=this.group.transformMatrixKey(t)+e),i+this.top+e+this.left+e+this.scaleX+e+this.scaleY+e+this.skewX+e+this.skewY+e+this.angle+e+this.originX+e+this.originY+e+this.width+e+this.height+e+this.strokeWidth+this.flipX+this.flipY},calcTransformMatrix:function(t){var e=this.calcOwnMatrix();if(t||!this.group)return e;var i=this.transformMatrixKey(t),r=this.matrixCache||(this.matrixCache={});return r.key===i?r.value:(this.group&&(e=n(this.group.calcTransformMatrix(!1),e)),r.key=i,r.value=e,e)},calcOwnMatrix:function(){var t=this.transformMatrixKey(!0),i=this.ownMatrixCache||(this.ownMatrixCache={});if(i.key===t)return i.value;var n=this._calcTranslateMatrix(),r={angle:this.angle,translateX:n[4],translateY:n[5],scaleX:this.scaleX,scaleY:this.scaleY,skewX:this.skewX,skewY:this.skewY,flipX:this.flipX,flipY:this.flipY};return i.key=t,i.value=e.composeMatrix(r),i.value},_calcDimensionsTransformMatrix:function(t,i,n){return e.calcDimensionsMatrix({skewX:t,skewY:i,scaleX:this.scaleX*(n&&this.flipX?-1:1),scaleY:this.scaleY*(n&&this.flipY?-1:1)})},_getNonTransformedDimensions:function(){var t=this.strokeWidth,e=this.width+t,i=this.height+t;return{x:e,y:i}},_getTransformedDimensions:function(t,i){"undefined"===typeof t&&(t=this.skewX),"undefined"===typeof i&&(i=this.skewY);var n,r,o,a=0===t&&0===i;if(this.strokeUniform?(r=this.width,o=this.height):(n=this._getNonTransformedDimensions(),r=n.x,o=n.y),a)return this._finalizeDimensions(r*this.scaleX,o*this.scaleY);var s=e.sizeAfterTransform(r,o,{scaleX:this.scaleX,scaleY:this.scaleY,skewX:t,skewY:i});return this._finalizeDimensions(s.x,s.y)},_finalizeDimensions:function(t,e){return this.strokeUniform?{x:t+this.strokeWidth,y:e+this.strokeWidth}:{x:t,y:e}},_calculateCurrentDimensions:function(){var t=this.getViewportTransform(),e=this._getTransformedDimensions(),i=o(e,t,!0);return i.scalarAdd(2*this.padding)}})}(),r.util.object.extend(r.Object.prototype,{sendToBack:function(){return this.group?r.StaticCanvas.prototype.sendToBack.call(this.group,this):this.canvas&&this.canvas.sendToBack(this),this},bringToFront:function(){return this.group?r.StaticCanvas.prototype.bringToFront.call(this.group,this):this.canvas&&this.canvas.bringToFront(this),this},sendBackwards:function(t){return this.group?r.StaticCanvas.prototype.sendBackwards.call(this.group,this,t):this.canvas&&this.canvas.sendBackwards(this,t),this},bringForward:function(t){return this.group?r.StaticCanvas.prototype.bringForward.call(this.group,this,t):this.canvas&&this.canvas.bringForward(this,t),this},moveTo:function(t){return this.group&&"activeSelection"!==this.group.type?r.StaticCanvas.prototype.moveTo.call(this.group,this,t):this.canvas&&this.canvas.moveTo(this,t),this}}),function(){function t(t,e){if(e){if(e.toLive)return t+": url(#SVGID_"+e.id+"); ";var i=new r.Color(e),n=t+": "+i.toRgb()+"; ",o=i.getAlpha();return 1!==o&&(n+=t+"-opacity: "+o.toString()+"; "),n}return t+": none; "}var e=r.util.toFixed;r.util.object.extend(r.Object.prototype,{getSvgStyles:function(e){var i=this.fillRule?this.fillRule:"nonzero",n=this.strokeWidth?this.strokeWidth:"0",r=this.strokeDashArray?this.strokeDashArray.join(" "):"none",o=this.strokeDashOffset?this.strokeDashOffset:"0",a=this.strokeLineCap?this.strokeLineCap:"butt",s=this.strokeLineJoin?this.strokeLineJoin:"miter",c=this.strokeMiterLimit?this.strokeMiterLimit:"4",l="undefined"!==typeof this.opacity?this.opacity:"1",u=this.visible?"":" visibility: hidden;",h=e?"":this.getSvgFilter(),f=t("fill",this.fill),d=t("stroke",this.stroke);return[d,"stroke-width: ",n,"; ","stroke-dasharray: ",r,"; ","stroke-linecap: ",a,"; ","stroke-dashoffset: ",o,"; ","stroke-linejoin: ",s,"; ","stroke-miterlimit: ",c,"; ",f,"fill-rule: ",i,"; ","opacity: ",l,";",h,u].join("")},getSvgSpanStyles:function(e,i){var n="; ",r=e.fontFamily?"font-family: "+(-1===e.fontFamily.indexOf("'")&&-1===e.fontFamily.indexOf('"')?"'"+e.fontFamily+"'":e.fontFamily)+n:"",o=e.strokeWidth?"stroke-width: "+e.strokeWidth+n:"",a=(r=r,e.fontSize?"font-size: "+e.fontSize+"px"+n:""),s=e.fontStyle?"font-style: "+e.fontStyle+n:"",c=e.fontWeight?"font-weight: "+e.fontWeight+n:"",l=e.fill?t("fill",e.fill):"",u=e.stroke?t("stroke",e.stroke):"",h=this.getSvgTextDecoration(e),f=e.deltaY?"baseline-shift: "+-e.deltaY+"; ":"";return h&&(h="text-decoration: "+h+n),[u,o,r,a,s,c,h,l,f,i?"white-space: pre; ":""].join("")},getSvgTextDecoration:function(t){return["overline","underline","line-through"].filter((function(e){return t[e.replace("-","")]})).join(" ")},getSvgFilter:function(){return this.shadow?"filter: url(#SVGID_"+this.shadow.id+");":""},getSvgCommons:function(){return[this.id?'id="'+this.id+'" ':"",this.clipPath?'clip-path="url(#'+this.clipPath.clipPathId+')" ':""].join("")},getSvgTransform:function(t,e){var i=t?this.calcTransformMatrix():this.calcOwnMatrix(),n='transform="'+r.util.matrixToSVG(i);return n+(e||"")+'" '},_setSVGBg:function(t){if(this.backgroundColor){var i=r.Object.NUM_FRACTION_DIGITS;t.push("\t\t<rect ",this._getFillAttributes(this.backgroundColor),' x="',e(-this.width/2,i),'" y="',e(-this.height/2,i),'" width="',e(this.width,i),'" height="',e(this.height,i),'"></rect>\n')}},toSVG:function(t){return this._createBaseSVGMarkup(this._toSVG(t),{reviver:t})},toClipPathSVG:function(t){return"\t"+this._createBaseClipPathSVGMarkup(this._toSVG(t),{reviver:t})},_createBaseClipPathSVGMarkup:function(t,e){e=e||{};var i=e.reviver,n=e.additionalTransform||"",r=[this.getSvgTransform(!0,n),this.getSvgCommons()].join(""),o=t.indexOf("COMMON_PARTS");return t[o]=r,i?i(t.join("")):t.join("")},_createBaseSVGMarkup:function(t,e){e=e||{};var i,n,o=e.noStyle,a=e.reviver,s=o?"":'style="'+this.getSvgStyles()+'" ',c=e.withShadow?'style="'+this.getSvgFilter()+'" ':"",l=this.clipPath,u=this.strokeUniform?'vector-effect="non-scaling-stroke" ':"",h=l&&l.absolutePositioned,f=this.stroke,d=this.fill,g=this.shadow,p=[],v=t.indexOf("COMMON_PARTS"),m=e.additionalTransform;return l&&(l.clipPathId="CLIPPATH_"+r.Object.__uid++,n='<clipPath id="'+l.clipPathId+'" >\n'+l.toClipPathSVG(a)+"</clipPath>\n"),h&&p.push("<g ",c,this.getSvgCommons()," >\n"),p.push("<g ",this.getSvgTransform(!1),h?"":c+this.getSvgCommons()," >\n"),i=[s,u,o?"":this.addPaintOrder()," ",m?'transform="'+m+'" ':""].join(""),t[v]=i,d&&d.toLive&&p.push(d.toSVG(this)),f&&f.toLive&&p.push(f.toSVG(this)),g&&p.push(g.toSVG(this)),l&&p.push(n),p.push(t.join("")),p.push("</g>\n"),h&&p.push("</g>\n"),a?a(p.join("")):p.join("")},addPaintOrder:function(){return"fill"!==this.paintFirst?' paint-order="'+this.paintFirst+'" ':""}})}(),function(){var t=r.util.object.extend,e="stateProperties";function i(e,i,n){var r={},o=!0;n.forEach((function(t){r[t]=e[t]})),t(e[i],r,o)}function n(t,e,i){if(t===e)return!0;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(var r=0,o=t.length;r<o;r++)if(!n(t[r],e[r]))return!1;return!0}if(t&&"object"===typeof t){var a,s=Object.keys(t);if(!e||"object"!==typeof e||!i&&s.length!==Object.keys(e).length)return!1;for(r=0,o=s.length;r<o;r++)if(a=s[r],"canvas"!==a&&"group"!==a&&!n(t[a],e[a]))return!1;return!0}}r.util.object.extend(r.Object.prototype,{hasStateChanged:function(t){t=t||e;var i="_"+t;return Object.keys(this[i]).length<this[t].length||!n(this[i],this,!0)},saveState:function(t){var n=t&&t.propertySet||e,r="_"+n;return this[r]?(i(this,r,this[n]),t&&t.stateProperties&&i(this,r,t.stateProperties),this):this.setupState(t)},setupState:function(t){t=t||{};var i=t.propertySet||e;return t.propertySet=i,this["_"+i]={},this.saveState(t),this}})}(),function(){var t=r.util.degreesToRadians;r.util.object.extend(r.Object.prototype,{_findTargetCorner:function(t,e){if(!this.hasControls||this.group||!this.canvas||this.canvas._activeObject!==this)return!1;var i,n,r,o=t.x,a=t.y,s=Object.keys(this.oCoords),c=s.length-1;for(this.__corner=0;c>=0;c--)if(r=s[c],this.isControlVisible(r)&&(n=this._getImageLines(e?this.oCoords[r].touchCorner:this.oCoords[r].corner),i=this._findCrossPoints({x:o,y:a},n),0!==i&&i%2===1))return this.__corner=r,r;return!1},forEachControl:function(t){for(var e in this.controls)t(this.controls[e],e,this)},_setCornerCoords:function(){var t=this.oCoords;for(var e in t){var i=this.controls[e];t[e].corner=i.calcCornerCoords(this.angle,this.cornerSize,t[e].x,t[e].y,!1),t[e].touchCorner=i.calcCornerCoords(this.angle,this.touchCornerSize,t[e].x,t[e].y,!0)}},drawSelectionBackground:function(e){if(!this.selectionBackgroundColor||this.canvas&&!this.canvas.interactive||this.canvas&&this.canvas._activeObject!==this)return this;e.save();var i=this.getCenterPoint(),n=this._calculateCurrentDimensions(),r=this.canvas.viewportTransform;return e.translate(i.x,i.y),e.scale(1/r[0],1/r[3]),e.rotate(t(this.angle)),e.fillStyle=this.selectionBackgroundColor,e.fillRect(-n.x/2,-n.y/2,n.x,n.y),e.restore(),this},drawBorders:function(t,e){e=e||{};var i=this._calculateCurrentDimensions(),n=this.borderScaleFactor,r=i.x+n,o=i.y+n,a="undefined"!==typeof e.hasControls?e.hasControls:this.hasControls,s=!1;return t.save(),t.strokeStyle=e.borderColor||this.borderColor,this._setLineDash(t,e.borderDashArray||this.borderDashArray),t.strokeRect(-r/2,-o/2,r,o),a&&(t.beginPath(),this.forEachControl((function(e,i,n){e.withConnection&&e.getVisibility(n,i)&&(s=!0,t.moveTo(e.x*r,e.y*o),t.lineTo(e.x*r+e.offsetX,e.y*o+e.offsetY))})),s&&t.stroke()),t.restore(),this},drawBordersInGroup:function(t,e,i){i=i||{};var n=r.util.sizeAfterTransform(this.width,this.height,e),o=this.strokeWidth,a=this.strokeUniform,s=this.borderScaleFactor,c=n.x+o*(a?this.canvas.getZoom():e.scaleX)+s,l=n.y+o*(a?this.canvas.getZoom():e.scaleY)+s;return t.save(),this._setLineDash(t,i.borderDashArray||this.borderDashArray),t.strokeStyle=i.borderColor||this.borderColor,t.strokeRect(-c/2,-l/2,c,l),t.restore(),this},drawControls:function(t,e){e=e||{},t.save();var i,n,o=this.canvas.getRetinaScaling();return t.setTransform(o,0,0,o,0,0),t.strokeStyle=t.fillStyle=e.cornerColor||this.cornerColor,this.transparentCorners||(t.strokeStyle=e.cornerStrokeColor||this.cornerStrokeColor),this._setLineDash(t,e.cornerDashArray||this.cornerDashArray),this.setCoords(),this.group&&(i=this.group.calcTransformMatrix()),this.forEachControl((function(o,a,s){n=s.oCoords[a],o.getVisibility(s,a)&&(i&&(n=r.util.transformPoint(n,i)),o.render(t,n.x,n.y,e,s))})),t.restore(),this},isControlVisible:function(t){return this.controls[t]&&this.controls[t].getVisibility(this,t)},setControlVisible:function(t,e){return this._controlsVisibility||(this._controlsVisibility={}),this._controlsVisibility[t]=e,this},setControlsVisibility:function(t){for(var e in t||(t={}),t)this.setControlVisible(e,t[e]);return this},onDeselect:function(){},onSelect:function(){}})}(),r.util.object.extend(r.StaticCanvas.prototype,{FX_DURATION:500,fxCenterObjectH:function(t,e){e=e||{};var i=function(){},n=e.onComplete||i,o=e.onChange||i,a=this;return r.util.animate({startValue:t.left,endValue:this.getCenter().left,duration:this.FX_DURATION,onChange:function(e){t.set("left",e),a.requestRenderAll(),o()},onComplete:function(){t.setCoords(),n()}}),this},fxCenterObjectV:function(t,e){e=e||{};var i=function(){},n=e.onComplete||i,o=e.onChange||i,a=this;return r.util.animate({startValue:t.top,endValue:this.getCenter().top,duration:this.FX_DURATION,onChange:function(e){t.set("top",e),a.requestRenderAll(),o()},onComplete:function(){t.setCoords(),n()}}),this},fxRemove:function(t,e){e=e||{};var i=function(){},n=e.onComplete||i,o=e.onChange||i,a=this;return r.util.animate({startValue:t.opacity,endValue:0,duration:this.FX_DURATION,onChange:function(e){t.set("opacity",e),a.requestRenderAll(),o()},onComplete:function(){a.remove(t),n()}}),this}}),r.util.object.extend(r.Object.prototype,{animate:function(){if(arguments[0]&&"object"===typeof arguments[0]){var t,e,i=[];for(t in arguments[0])i.push(t);for(var n=0,r=i.length;n<r;n++)t=i[n],e=n!==r-1,this._animate(t,arguments[0][t],arguments[1],e)}else this._animate.apply(this,arguments);return this},_animate:function(t,e,i,n){var o,a=this;e=e.toString(),i=i?r.util.object.clone(i):{},~t.indexOf(".")&&(o=t.split("."));var s=a.colorProperties.indexOf(t)>-1||o&&a.colorProperties.indexOf(o[1])>-1,c=o?this.get(o[0])[o[1]]:this.get(t);"from"in i||(i.from=c),s||(e=~e.indexOf("=")?c+parseFloat(e.replace("=","")):parseFloat(e));var l={startValue:i.from,endValue:e,byValue:i.by,easing:i.easing,duration:i.duration,abort:i.abort&&function(t,e,n){return i.abort.call(a,t,e,n)},onChange:function(e,r,s){o?a[o[0]][o[1]]=e:a.set(t,e),n||i.onChange&&i.onChange(e,r,s)},onComplete:function(t,e,r){n||(a.setCoords(),i.onComplete&&i.onComplete(t,e,r))}};return s?r.util.animateColor(l.startValue,l.endValue,l.duration,l):r.util.animate(l)}}),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend,n=e.util.object.clone,r={x1:1,x2:1,y1:1,y2:1};function o(t,e){var i=t.origin,n=t.axis1,r=t.axis2,o=t.dimension,a=e.nearest,s=e.center,c=e.farthest;return function(){switch(this.get(i)){case a:return Math.min(this.get(n),this.get(r));case s:return Math.min(this.get(n),this.get(r))+.5*this.get(o);case c:return Math.max(this.get(n),this.get(r))}}}e.Line?e.warn("fabric.Line is already defined"):(e.Line=e.util.createClass(e.Object,{type:"line",x1:0,y1:0,x2:0,y2:0,cacheProperties:e.Object.prototype.cacheProperties.concat("x1","x2","y1","y2"),initialize:function(t,e){t||(t=[0,0,0,0]),this.callSuper("initialize",e),this.set("x1",t[0]),this.set("y1",t[1]),this.set("x2",t[2]),this.set("y2",t[3]),this._setWidthHeight(e)},_setWidthHeight:function(t){t||(t={}),this.width=Math.abs(this.x2-this.x1),this.height=Math.abs(this.y2-this.y1),this.left="left"in t?t.left:this._getLeftToOriginX(),this.top="top"in t?t.top:this._getTopToOriginY()},_set:function(t,e){return this.callSuper("_set",t,e),"undefined"!==typeof r[t]&&this._setWidthHeight(),this},_getLeftToOriginX:o({origin:"originX",axis1:"x1",axis2:"x2",dimension:"width"},{nearest:"left",center:"center",farthest:"right"}),_getTopToOriginY:o({origin:"originY",axis1:"y1",axis2:"y2",dimension:"height"},{nearest:"top",center:"center",farthest:"bottom"}),_render:function(t){t.beginPath();var e=this.calcLinePoints();t.moveTo(e.x1,e.y1),t.lineTo(e.x2,e.y2),t.lineWidth=this.strokeWidth;var i=t.strokeStyle;t.strokeStyle=this.stroke||t.fillStyle,this.stroke&&this._renderStroke(t),t.strokeStyle=i},_findCenterFromElement:function(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}},toObject:function(t){return i(this.callSuper("toObject",t),this.calcLinePoints())},_getNonTransformedDimensions:function(){var t=this.callSuper("_getNonTransformedDimensions");return"butt"===this.strokeLineCap&&(0===this.width&&(t.y-=this.strokeWidth),0===this.height&&(t.x-=this.strokeWidth)),t},calcLinePoints:function(){var t=this.x1<=this.x2?-1:1,e=this.y1<=this.y2?-1:1,i=t*this.width*.5,n=e*this.height*.5,r=t*this.width*-.5,o=e*this.height*-.5;return{x1:i,x2:r,y1:n,y2:o}},_toSVG:function(){var t=this.calcLinePoints();return["<line ","COMMON_PARTS",'x1="',t.x1,'" y1="',t.y1,'" x2="',t.x2,'" y2="',t.y2,'" />\n']}}),e.Line.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat("x1 y1 x2 y2".split(" ")),e.Line.fromElement=function(t,n,r){r=r||{};var o=e.parseAttributes(t,e.Line.ATTRIBUTE_NAMES),a=[o.x1||0,o.y1||0,o.x2||0,o.y2||0];n(new e.Line(a,i(o,r)))},e.Line.fromObject=function(t,i){function r(t){delete t.points,i&&i(t)}var o=n(t,!0);o.points=[t.x1,t.y1,t.x2,t.y2],e.Object._fromObject("Line",o,r,"points")})}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=Math.PI;function n(t){return"radius"in t&&t.radius>=0}e.Circle?e.warn("fabric.Circle is already defined."):(e.Circle=e.util.createClass(e.Object,{type:"circle",radius:0,startAngle:0,endAngle:2*i,cacheProperties:e.Object.prototype.cacheProperties.concat("radius","startAngle","endAngle"),_set:function(t,e){return this.callSuper("_set",t,e),"radius"===t&&this.setRadius(e),this},toObject:function(t){return this.callSuper("toObject",["radius","startAngle","endAngle"].concat(t))},_toSVG:function(){var t,n=0,r=0,o=(this.endAngle-this.startAngle)%(2*i);if(0===o)t=["<circle ","COMMON_PARTS",'cx="'+n+'" cy="'+r+'" ','r="',this.radius,'" />\n'];else{var a=e.util.cos(this.startAngle)*this.radius,s=e.util.sin(this.startAngle)*this.radius,c=e.util.cos(this.endAngle)*this.radius,l=e.util.sin(this.endAngle)*this.radius,u=o>i?"1":"0";t=['<path d="M '+a+" "+s," A "+this.radius+" "+this.radius," 0 ",+u+" 1"," "+c+" "+l,'" ',"COMMON_PARTS"," />\n"]}return t},_render:function(t){t.beginPath(),t.arc(0,0,this.radius,this.startAngle,this.endAngle,!1),this._renderPaintInOrder(t)},getRadiusX:function(){return this.get("radius")*this.get("scaleX")},getRadiusY:function(){return this.get("radius")*this.get("scaleY")},setRadius:function(t){return this.radius=t,this.set("width",2*t).set("height",2*t)}}),e.Circle.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat("cx cy r".split(" ")),e.Circle.fromElement=function(t,i){var r=e.parseAttributes(t,e.Circle.ATTRIBUTE_NAMES);if(!n(r))throw new Error("value of `r` attribute is required and can not be negative");r.left=(r.left||0)-r.radius,r.top=(r.top||0)-r.radius,i(new e.Circle(r))},e.Circle.fromObject=function(t,i){e.Object._fromObject("Circle",t,i)})}(i),function(t){"use strict";var e=t.fabric||(t.fabric={});e.Triangle?e.warn("fabric.Triangle is already defined"):(e.Triangle=e.util.createClass(e.Object,{type:"triangle",width:100,height:100,_render:function(t){var e=this.width/2,i=this.height/2;t.beginPath(),t.moveTo(-e,i),t.lineTo(0,-i),t.lineTo(e,i),t.closePath(),this._renderPaintInOrder(t)},_toSVG:function(){var t=this.width/2,e=this.height/2,i=[-t+" "+e,"0 "+-e,t+" "+e].join(",");return["<polygon ","COMMON_PARTS",'points="',i,'" />']}}),e.Triangle.fromObject=function(t,i){return e.Object._fromObject("Triangle",t,i)})}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=2*Math.PI;e.Ellipse?e.warn("fabric.Ellipse is already defined."):(e.Ellipse=e.util.createClass(e.Object,{type:"ellipse",rx:0,ry:0,cacheProperties:e.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(t){this.callSuper("initialize",t),this.set("rx",t&&t.rx||0),this.set("ry",t&&t.ry||0)},_set:function(t,e){switch(this.callSuper("_set",t,e),t){case"rx":this.rx=e,this.set("width",2*e);break;case"ry":this.ry=e,this.set("height",2*e);break}return this},getRx:function(){return this.get("rx")*this.get("scaleX")},getRy:function(){return this.get("ry")*this.get("scaleY")},toObject:function(t){return this.callSuper("toObject",["rx","ry"].concat(t))},_toSVG:function(){return["<ellipse ","COMMON_PARTS",'cx="0" cy="0" ','rx="',this.rx,'" ry="',this.ry,'" />\n']},_render:function(t){t.beginPath(),t.save(),t.transform(1,0,0,this.ry/this.rx,0,0),t.arc(0,0,this.rx,0,i,!1),t.restore(),this._renderPaintInOrder(t)}}),e.Ellipse.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat("cx cy rx ry".split(" ")),e.Ellipse.fromElement=function(t,i){var n=e.parseAttributes(t,e.Ellipse.ATTRIBUTE_NAMES);n.left=(n.left||0)-n.rx,n.top=(n.top||0)-n.ry,i(new e.Ellipse(n))},e.Ellipse.fromObject=function(t,i){e.Object._fromObject("Ellipse",t,i)})}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend;e.Rect?e.warn("fabric.Rect is already defined"):(e.Rect=e.util.createClass(e.Object,{stateProperties:e.Object.prototype.stateProperties.concat("rx","ry"),type:"rect",rx:0,ry:0,cacheProperties:e.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(t){this.callSuper("initialize",t),this._initRxRy()},_initRxRy:function(){this.rx&&!this.ry?this.ry=this.rx:this.ry&&!this.rx&&(this.rx=this.ry)},_render:function(t){var e=this.rx?Math.min(this.rx,this.width/2):0,i=this.ry?Math.min(this.ry,this.height/2):0,n=this.width,r=this.height,o=-this.width/2,a=-this.height/2,s=0!==e||0!==i,c=.4477152502;t.beginPath(),t.moveTo(o+e,a),t.lineTo(o+n-e,a),s&&t.bezierCurveTo(o+n-c*e,a,o+n,a+c*i,o+n,a+i),t.lineTo(o+n,a+r-i),s&&t.bezierCurveTo(o+n,a+r-c*i,o+n-c*e,a+r,o+n-e,a+r),t.lineTo(o+e,a+r),s&&t.bezierCurveTo(o+c*e,a+r,o,a+r-c*i,o,a+r-i),t.lineTo(o,a+i),s&&t.bezierCurveTo(o,a+c*i,o+c*e,a,o+e,a),t.closePath(),this._renderPaintInOrder(t)},toObject:function(t){return this.callSuper("toObject",["rx","ry"].concat(t))},_toSVG:function(){var t=-this.width/2,e=-this.height/2;return["<rect ","COMMON_PARTS",'x="',t,'" y="',e,'" rx="',this.rx,'" ry="',this.ry,'" width="',this.width,'" height="',this.height,'" />\n']}}),e.Rect.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat("x y rx ry width height".split(" ")),e.Rect.fromElement=function(t,n,r){if(!t)return n(null);r=r||{};var o=e.parseAttributes(t,e.Rect.ATTRIBUTE_NAMES);o.left=o.left||0,o.top=o.top||0,o.height=o.height||0,o.width=o.width||0;var a=new e.Rect(i(r?e.util.object.clone(r):{},o));a.visible=a.visible&&a.width>0&&a.height>0,n(a)},e.Rect.fromObject=function(t,i){return e.Object._fromObject("Rect",t,i)})}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend,n=e.util.array.min,r=e.util.array.max,o=e.util.toFixed;e.Polyline?e.warn("fabric.Polyline is already defined"):(e.Polyline=e.util.createClass(e.Object,{type:"polyline",points:null,cacheProperties:e.Object.prototype.cacheProperties.concat("points"),initialize:function(t,e){e=e||{},this.points=t||[],this.callSuper("initialize",e),this._setPositionDimensions(e)},_setPositionDimensions:function(t){var e,i=this._calcDimensions(t);this.width=i.width,this.height=i.height,t.fromSVG||(e=this.translateToGivenOrigin({x:i.left-this.strokeWidth/2,y:i.top-this.strokeWidth/2},"left","top",this.originX,this.originY)),"undefined"===typeof t.left&&(this.left=t.fromSVG?i.left:e.x),"undefined"===typeof t.top&&(this.top=t.fromSVG?i.top:e.y),this.pathOffset={x:i.left+this.width/2,y:i.top+this.height/2}},_calcDimensions:function(){var t=this.points,e=n(t,"x")||0,i=n(t,"y")||0,o=r(t,"x")||0,a=r(t,"y")||0,s=o-e,c=a-i;return{left:e,top:i,width:s,height:c}},toObject:function(t){return i(this.callSuper("toObject",t),{points:this.points.concat()})},_toSVG:function(){for(var t=[],i=this.pathOffset.x,n=this.pathOffset.y,r=e.Object.NUM_FRACTION_DIGITS,a=0,s=this.points.length;a<s;a++)t.push(o(this.points[a].x-i,r),",",o(this.points[a].y-n,r)," ");return["<"+this.type+" ","COMMON_PARTS",'points="',t.join(""),'" />\n']},commonRender:function(t){var e,i=this.points.length,n=this.pathOffset.x,r=this.pathOffset.y;if(!i||isNaN(this.points[i-1].y))return!1;t.beginPath(),t.moveTo(this.points[0].x-n,this.points[0].y-r);for(var o=0;o<i;o++)e=this.points[o],t.lineTo(e.x-n,e.y-r);return!0},_render:function(t){this.commonRender(t)&&this._renderPaintInOrder(t)},complexity:function(){return this.get("points").length}}),e.Polyline.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat(),e.Polyline.fromElementGenerator=function(t){return function(n,r,o){if(!n)return r(null);o||(o={});var a=e.parsePointsAttribute(n.getAttribute("points")),s=e.parseAttributes(n,e[t].ATTRIBUTE_NAMES);s.fromSVG=!0,r(new e[t](a,i(s,o)))}},e.Polyline.fromElement=e.Polyline.fromElementGenerator("Polyline"),e.Polyline.fromObject=function(t,i){return e.Object._fromObject("Polyline",t,i,"points")})}(i),function(t){"use strict";var e=t.fabric||(t.fabric={});e.Polygon?e.warn("fabric.Polygon is already defined"):(e.Polygon=e.util.createClass(e.Polyline,{type:"polygon",_render:function(t){this.commonRender(t)&&(t.closePath(),this._renderPaintInOrder(t))}}),e.Polygon.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat(),e.Polygon.fromElement=e.Polyline.fromElementGenerator("Polygon"),e.Polygon.fromObject=function(t,i){e.Object._fromObject("Polygon",t,i,"points")})}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.array.min,n=e.util.array.max,r=e.util.object.extend,o=Object.prototype.toString,a=e.util.toFixed;e.Path?e.warn("fabric.Path is already defined"):(e.Path=e.util.createClass(e.Object,{type:"path",path:null,cacheProperties:e.Object.prototype.cacheProperties.concat("path","fillRule"),stateProperties:e.Object.prototype.stateProperties.concat("path"),initialize:function(t,i){i=i||{},this.callSuper("initialize",i),t||(t=[]);var n="[object Array]"===o.call(t);this.path=e.util.makePathSimpler(n?t:e.util.parsePath(t)),this.path&&e.Polyline.prototype._setPositionDimensions.call(this,i)},_renderPathCommands:function(t){var e,i=0,n=0,r=0,o=0,a=0,s=0,c=-this.pathOffset.x,l=-this.pathOffset.y;t.beginPath();for(var u=0,h=this.path.length;u<h;++u)switch(e=this.path[u],e[0]){case"L":r=e[1],o=e[2],t.lineTo(r+c,o+l);break;case"M":r=e[1],o=e[2],i=r,n=o,t.moveTo(r+c,o+l);break;case"C":r=e[5],o=e[6],a=e[3],s=e[4],t.bezierCurveTo(e[1]+c,e[2]+l,a+c,s+l,r+c,o+l);break;case"Q":t.quadraticCurveTo(e[1]+c,e[2]+l,e[3]+c,e[4]+l),r=e[3],o=e[4],a=e[1],s=e[2];break;case"z":case"Z":r=i,o=n,t.closePath();break}},_render:function(t){this._renderPathCommands(t),this._renderPaintInOrder(t)},toString:function(){return"#<fabric.Path ("+this.complexity()+'): { "top": '+this.top+', "left": '+this.left+" }>"},toObject:function(t){return r(this.callSuper("toObject",t),{path:this.path.map((function(t){return t.slice()}))})},toDatalessObject:function(t){var e=this.toObject(["sourcePath"].concat(t));return e.sourcePath&&delete e.path,e},_toSVG:function(){var t=e.util.joinPath(this.path);return["<path ","COMMON_PARTS",'d="',t,'" stroke-linecap="round" ',"/>\n"]},_getOffsetTransform:function(){var t=e.Object.NUM_FRACTION_DIGITS;return" translate("+a(-this.pathOffset.x,t)+", "+a(-this.pathOffset.y,t)+")"},toClipPathSVG:function(t){var e=this._getOffsetTransform();return"\t"+this._createBaseClipPathSVGMarkup(this._toSVG(),{reviver:t,additionalTransform:e})},toSVG:function(t){var e=this._getOffsetTransform();return this._createBaseSVGMarkup(this._toSVG(),{reviver:t,additionalTransform:e})},complexity:function(){return this.path.length},_calcDimensions:function(){for(var t,r,o=[],a=[],s=0,c=0,l=0,u=0,h=0,f=this.path.length;h<f;++h){switch(t=this.path[h],t[0]){case"L":l=t[1],u=t[2],r=[];break;case"M":l=t[1],u=t[2],s=l,c=u,r=[];break;case"C":r=e.util.getBoundsOfCurve(l,u,t[1],t[2],t[3],t[4],t[5],t[6]),l=t[5],u=t[6];break;case"Q":r=e.util.getBoundsOfCurve(l,u,t[1],t[2],t[1],t[2],t[3],t[4]),l=t[3],u=t[4];break;case"z":case"Z":l=s,u=c;break}r.forEach((function(t){o.push(t.x),a.push(t.y)})),o.push(l),a.push(u)}var d=i(o)||0,g=i(a)||0,p=n(o)||0,v=n(a)||0,m=p-d,y=v-g;return{left:d,top:g,width:m,height:y}}}),e.Path.fromObject=function(t,i){if("string"===typeof t.sourcePath){var n=t.sourcePath;e.loadSVGFromURL(n,(function(e){var n=e[0];n.setOptions(t),i&&i(n)}))}else e.Object._fromObject("Path",t,i,"path")},e.Path.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat(["d"]),e.Path.fromElement=function(t,i,n){var o=e.parseAttributes(t,e.Path.ATTRIBUTE_NAMES);o.fromSVG=!0,i(new e.Path(o.d,r(o,n)))})}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.array.min,n=e.util.array.max;e.Group||(e.Group=e.util.createClass(e.Object,e.Collection,{type:"group",strokeWidth:0,subTargetCheck:!1,cacheProperties:[],useSetOnGroup:!1,initialize:function(t,e,i){e=e||{},this._objects=[],i&&this.callSuper("initialize",e),this._objects=t||[];for(var n=this._objects.length;n--;)this._objects[n].group=this;if(i)this._updateObjectsACoords();else{var r=e&&e.centerPoint;void 0!==e.originX&&(this.originX=e.originX),void 0!==e.originY&&(this.originY=e.originY),r||this._calcBounds(),this._updateObjectsCoords(r),delete e.centerPoint,this.callSuper("initialize",e)}this.setCoords()},_updateObjectsACoords:function(){for(var t=!0,e=this._objects.length;e--;)this._objects[e].setCoords(t)},_updateObjectsCoords:function(t){t=t||this.getCenterPoint();for(var e=this._objects.length;e--;)this._updateObjectCoords(this._objects[e],t)},_updateObjectCoords:function(t,e){var i=t.left,n=t.top,r=!0;t.set({left:i-e.x,top:n-e.y}),t.group=this,t.setCoords(r)},toString:function(){return"#<fabric.Group: ("+this.complexity()+")>"},addWithUpdate:function(t){var i=!!this.group;return this._restoreObjectsState(),e.util.resetObjectTransform(this),t&&(i&&e.util.removeTransformFromObject(t,this.group.calcTransformMatrix()),this._objects.push(t),t.group=this,t._set("canvas",this.canvas)),this._calcBounds(),this._updateObjectsCoords(),this.dirty=!0,i?this.group.addWithUpdate():this.setCoords(),this},removeWithUpdate:function(t){return this._restoreObjectsState(),e.util.resetObjectTransform(this),this.remove(t),this._calcBounds(),this._updateObjectsCoords(),this.setCoords(),this.dirty=!0,this},_onObjectAdded:function(t){this.dirty=!0,t.group=this,t._set("canvas",this.canvas)},_onObjectRemoved:function(t){this.dirty=!0,delete t.group},_set:function(t,i){var n=this._objects.length;if(this.useSetOnGroup)while(n--)this._objects[n].setOnGroup(t,i);if("canvas"===t)while(n--)this._objects[n]._set(t,i);e.Object.prototype._set.call(this,t,i)},toObject:function(t){var i=this.includeDefaultValues,n=this._objects.filter((function(t){return!t.excludeFromExport})).map((function(e){var n=e.includeDefaultValues;e.includeDefaultValues=i;var r=e.toObject(t);return e.includeDefaultValues=n,r})),r=e.Object.prototype.toObject.call(this,t);return r.objects=n,r},toDatalessObject:function(t){var i,n=this.sourcePath;if(n)i=n;else{var r=this.includeDefaultValues;i=this._objects.map((function(e){var i=e.includeDefaultValues;e.includeDefaultValues=r;var n=e.toDatalessObject(t);return e.includeDefaultValues=i,n}))}var o=e.Object.prototype.toDatalessObject.call(this,t);return o.objects=i,o},render:function(t){this._transformDone=!0,this.callSuper("render",t),this._transformDone=!1},shouldCache:function(){var t=e.Object.prototype.shouldCache.call(this);if(t)for(var i=0,n=this._objects.length;i<n;i++)if(this._objects[i].willDrawShadow())return this.ownCaching=!1,!1;return t},willDrawShadow:function(){if(e.Object.prototype.willDrawShadow.call(this))return!0;for(var t=0,i=this._objects.length;t<i;t++)if(this._objects[t].willDrawShadow())return!0;return!1},isOnACache:function(){return this.ownCaching||this.group&&this.group.isOnACache()},drawObject:function(t){for(var e=0,i=this._objects.length;e<i;e++)this._objects[e].render(t);this._drawClipPath(t)},isCacheDirty:function(t){if(this.callSuper("isCacheDirty",t))return!0;if(!this.statefullCache)return!1;for(var e=0,i=this._objects.length;e<i;e++)if(this._objects[e].isCacheDirty(!0)){if(this._cacheCanvas){var n=this.cacheWidth/this.zoomX,r=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-n/2,-r/2,n,r)}return!0}return!1},_restoreObjectsState:function(){var t=this.calcOwnMatrix();return this._objects.forEach((function(i){e.util.addTransformToObject(i,t),delete i.group,i.setCoords()})),this},realizeTransform:function(t,i){return e.util.addTransformToObject(t,i),t},destroy:function(){return this._objects.forEach((function(t){t.set("dirty",!0)})),this._restoreObjectsState()},toActiveSelection:function(){if(this.canvas){var t=this._objects,i=this.canvas;this._objects=[];var n=this.toObject();delete n.objects;var r=new e.ActiveSelection([]);return r.set(n),r.type="activeSelection",i.remove(this),t.forEach((function(t){t.group=r,t.dirty=!0,i.add(t)})),r.canvas=i,r._objects=t,i._activeObject=r,r.setCoords(),r}},ungroupOnCanvas:function(){return this._restoreObjectsState()},setObjectsCoords:function(){var t=!0;return this.forEachObject((function(e){e.setCoords(t)})),this},_calcBounds:function(t){for(var e,i,n,r,o=[],a=[],s=["tr","br","bl","tl"],c=0,l=this._objects.length,u=s.length;c<l;++c){for(e=this._objects[c],n=e.calcACoords(),r=0;r<u;r++)i=s[r],o.push(n[i].x),a.push(n[i].y);e.aCoords=n}this._getBounds(o,a,t)},_getBounds:function(t,r,o){var a=new e.Point(i(t),i(r)),s=new e.Point(n(t),n(r)),c=a.y||0,l=a.x||0,u=s.x-a.x||0,h=s.y-a.y||0;this.width=u,this.height=h,o||this.setPositionByOrigin({x:l,y:c},"left","top")},_toSVG:function(t){for(var e=["<g ","COMMON_PARTS"," >\n"],i=0,n=this._objects.length;i<n;i++)e.push("\t\t",this._objects[i].toSVG(t));return e.push("</g>\n"),e},getSvgStyles:function(){var t="undefined"!==typeof this.opacity&&1!==this.opacity?"opacity: "+this.opacity+";":"",e=this.visible?"":" visibility: hidden;";return[t,this.getSvgFilter(),e].join("")},toClipPathSVG:function(t){for(var e=[],i=0,n=this._objects.length;i<n;i++)e.push("\t",this._objects[i].toClipPathSVG(t));return this._createBaseClipPathSVGMarkup(e,{reviver:t})}}),e.Group.fromObject=function(t,i){var n=t.objects,r=e.util.object.clone(t,!0);delete r.objects,"string"!==typeof n?e.util.enlivenObjects(n,(function(n){e.util.enlivenObjects([t.clipPath],(function(r){var o=e.util.object.clone(t,!0);o.clipPath=r[0],delete o.objects,i&&i(new e.Group(n,o,!0))}))})):e.loadSVGFromURL(n,(function(o){var a=e.util.groupSVGElements(o,t,n);a.set(r),i&&i(a)}))})}(i),function(t){"use strict";var e=t.fabric||(t.fabric={});e.ActiveSelection||(e.ActiveSelection=e.util.createClass(e.Group,{type:"activeSelection",initialize:function(t,i){i=i||{},this._objects=t||[];for(var n=this._objects.length;n--;)this._objects[n].group=this;i.originX&&(this.originX=i.originX),i.originY&&(this.originY=i.originY),this._calcBounds(),this._updateObjectsCoords(),e.Object.prototype.initialize.call(this,i),this.setCoords()},toGroup:function(){var t=this._objects.concat();this._objects=[];var i=e.Object.prototype.toObject.call(this),n=new e.Group([]);if(delete i.type,n.set(i),t.forEach((function(t){t.canvas.remove(t),t.group=n})),n._objects=t,!this.canvas)return n;var r=this.canvas;return r.add(n),r._activeObject=n,n.setCoords(),n},onDeselect:function(){return this.destroy(),!1},toString:function(){return"#<fabric.ActiveSelection: ("+this.complexity()+")>"},shouldCache:function(){return!1},isOnACache:function(){return!1},_renderControls:function(t,e,i){t.save(),t.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1,this.callSuper("_renderControls",t,e),i=i||{},"undefined"===typeof i.hasControls&&(i.hasControls=!1),i.forActiveSelection=!0;for(var n=0,r=this._objects.length;n<r;n++)this._objects[n]._renderControls(t,i);t.restore()}}),e.ActiveSelection.fromObject=function(t,i){e.util.enlivenObjects(t.objects,(function(n){delete t.objects,i&&i(new e.ActiveSelection(n,t,!0))}))})}(i),function(t){"use strict";var e=r.util.object.extend;t.fabric||(t.fabric={}),t.fabric.Image?r.warn("fabric.Image is already defined."):(r.Image=r.util.createClass(r.Object,{type:"image",strokeWidth:0,srcFromAttribute:!1,_lastScaleX:1,_lastScaleY:1,_filterScalingX:1,_filterScalingY:1,minimumScaleTrigger:.5,stateProperties:r.Object.prototype.stateProperties.concat("cropX","cropY"),cacheProperties:r.Object.prototype.cacheProperties.concat("cropX","cropY"),cacheKey:"",cropX:0,cropY:0,imageSmoothing:!0,initialize:function(t,e){e||(e={}),this.filters=[],this.cacheKey="texture"+r.Object.__uid++,this.callSuper("initialize",e),this._initElement(t,e)},getElement:function(){return this._element||{}},setElement:function(t,e){return this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+"_filtered"),this._element=t,this._originalElement=t,this._initConfig(e),0!==this.filters.length&&this.applyFilters(),this.resizeFilter&&this.applyResizeFilters(),this},removeTexture:function(t){var e=r.filterBackend;e&&e.evictCachesForKey&&e.evictCachesForKey(t)},dispose:function(){this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+"_filtered"),this._cacheContext=void 0,["_originalElement","_element","_filteredEl","_cacheCanvas"].forEach(function(t){r.util.cleanUpJsdomNode(this[t]),this[t]=void 0}.bind(this))},getCrossOrigin:function(){return this._originalElement&&(this._originalElement.crossOrigin||null)},getOriginalSize:function(){var t=this.getElement();return{width:t.naturalWidth||t.width,height:t.naturalHeight||t.height}},_stroke:function(t){if(this.stroke&&0!==this.strokeWidth){var e=this.width/2,i=this.height/2;t.beginPath(),t.moveTo(-e,-i),t.lineTo(e,-i),t.lineTo(e,i),t.lineTo(-e,i),t.lineTo(-e,-i),t.closePath()}},toObject:function(t){var i=[];this.filters.forEach((function(t){t&&i.push(t.toObject())}));var n=e(this.callSuper("toObject",["cropX","cropY"].concat(t)),{src:this.getSrc(),crossOrigin:this.getCrossOrigin(),filters:i});return this.resizeFilter&&(n.resizeFilter=this.resizeFilter.toObject()),n},hasCrop:function(){return this.cropX||this.cropY||this.width<this._element.width||this.height<this._element.height},_toSVG:function(){var t,e=[],i=[],n=this._element,o=-this.width/2,a=-this.height/2,s="",c="";if(!n)return[];if(this.hasCrop()){var l=r.Object.__uid++;e.push('<clipPath id="imageCrop_'+l+'">\n','\t<rect x="'+o+'" y="'+a+'" width="'+this.width+'" height="'+this.height+'" />\n',"</clipPath>\n"),s=' clip-path="url(#imageCrop_'+l+')" '}if(this.imageSmoothing||(c='" image-rendering="optimizeSpeed'),i.push("\t<image ","COMMON_PARTS",'xlink:href="',this.getSvgSrc(!0),'" x="',o-this.cropX,'" y="',a-this.cropY,'" width="',n.width||n.naturalWidth,'" height="',n.height||n.height,c,'"',s,"></image>\n"),this.stroke||this.strokeDashArray){var u=this.fill;this.fill=null,t=["\t<rect ",'x="',o,'" y="',a,'" width="',this.width,'" height="',this.height,'" style="',this.getSvgStyles(),'"/>\n'],this.fill=u}return e="fill"!==this.paintFirst?e.concat(t,i):e.concat(i,t),e},getSrc:function(t){var e=t?this._element:this._originalElement;return e?e.toDataURL?e.toDataURL():this.srcFromAttribute?e.getAttribute("src"):e.src:this.src||""},setSrc:function(t,e,i){return r.util.loadImage(t,(function(t,n){this.setElement(t,i),this._setWidthHeight(),e&&e(this,n)}),this,i&&i.crossOrigin),this},toString:function(){return'#<fabric.Image: { src: "'+this.getSrc()+'" }>'},applyResizeFilters:function(){var t=this.resizeFilter,e=this.minimumScaleTrigger,i=this.getTotalObjectScaling(),n=i.scaleX,o=i.scaleY,a=this._filteredEl||this._originalElement;if(this.group&&this.set("dirty",!0),!t||n>e&&o>e)return this._element=a,this._filterScalingX=1,this._filterScalingY=1,this._lastScaleX=n,void(this._lastScaleY=o);r.filterBackend||(r.filterBackend=r.initFilterBackend());var s=r.util.createCanvasElement(),c=this._filteredEl?this.cacheKey+"_filtered":this.cacheKey,l=a.width,u=a.height;s.width=l,s.height=u,this._element=s,this._lastScaleX=t.scaleX=n,this._lastScaleY=t.scaleY=o,r.filterBackend.applyFilters([t],a,l,u,this._element,c),this._filterScalingX=s.width/this._originalElement.width,this._filterScalingY=s.height/this._originalElement.height},applyFilters:function(t){if(t=t||this.filters||[],t=t.filter((function(t){return t&&!t.isNeutralState()})),this.set("dirty",!0),this.removeTexture(this.cacheKey+"_filtered"),0===t.length)return this._element=this._originalElement,this._filteredEl=null,this._filterScalingX=1,this._filterScalingY=1,this;var e=this._originalElement,i=e.naturalWidth||e.width,n=e.naturalHeight||e.height;if(this._element===this._originalElement){var o=r.util.createCanvasElement();o.width=i,o.height=n,this._element=o,this._filteredEl=o}else this._element=this._filteredEl,this._filteredEl.getContext("2d").clearRect(0,0,i,n),this._lastScaleX=1,this._lastScaleY=1;return r.filterBackend||(r.filterBackend=r.initFilterBackend()),r.filterBackend.applyFilters(t,this._originalElement,i,n,this._element,this.cacheKey),this._originalElement.width===this._element.width&&this._originalElement.height===this._element.height||(this._filterScalingX=this._element.width/this._originalElement.width,this._filterScalingY=this._element.height/this._originalElement.height),this},_render:function(t){r.util.setImageSmoothing(t,this.imageSmoothing),!0!==this.isMoving&&this.resizeFilter&&this._needsResize()&&this.applyResizeFilters(),this._stroke(t),this._renderPaintInOrder(t)},drawCacheOnCanvas:function(t){r.util.setImageSmoothing(t,this.imageSmoothing),r.Object.prototype.drawCacheOnCanvas.call(this,t)},shouldCache:function(){return this.needsItsOwnCache()},_renderFill:function(t){var e=this._element;if(e){var i=this._filterScalingX,n=this._filterScalingY,r=this.width,o=this.height,a=Math.min,s=Math.max,c=s(this.cropX,0),l=s(this.cropY,0),u=e.naturalWidth||e.width,h=e.naturalHeight||e.height,f=c*i,d=l*n,g=a(r*i,u-f),p=a(o*n,h-d),v=-r/2,m=-o/2,y=a(r,u/i-c),b=a(o,h/n-l);e&&t.drawImage(e,f,d,g,p,v,m,y,b)}},_needsResize:function(){var t=this.getTotalObjectScaling();return t.scaleX!==this._lastScaleX||t.scaleY!==this._lastScaleY},_resetWidthHeight:function(){this.set(this.getOriginalSize())},_initElement:function(t,e){this.setElement(r.util.getById(t),e),r.util.addClass(this.getElement(),r.Image.CSS_CANVAS)},_initConfig:function(t){t||(t={}),this.setOptions(t),this._setWidthHeight(t)},_initFilters:function(t,e){t&&t.length?r.util.enlivenObjects(t,(function(t){e&&e(t)}),"fabric.Image.filters"):e&&e()},_setWidthHeight:function(t){t||(t={});var e=this.getElement();this.width=t.width||e.naturalWidth||e.width||0,this.height=t.height||e.naturalHeight||e.height||0},parsePreserveAspectRatioAttribute:function(){var t,e=r.util.parsePreserveAspectRatioAttribute(this.preserveAspectRatio||""),i=this._element.width,n=this._element.height,o=1,a=1,s=0,c=0,l=0,u=0,h=this.width,f=this.height,d={width:h,height:f};return!e||"none"===e.alignX&&"none"===e.alignY?(o=h/i,a=f/n):("meet"===e.meetOrSlice&&(o=a=r.util.findScaleToFit(this._element,d),t=(h-i*o)/2,"Min"===e.alignX&&(s=-t),"Max"===e.alignX&&(s=t),t=(f-n*a)/2,"Min"===e.alignY&&(c=-t),"Max"===e.alignY&&(c=t)),"slice"===e.meetOrSlice&&(o=a=r.util.findScaleToCover(this._element,d),t=i-h/o,"Mid"===e.alignX&&(l=t/2),"Max"===e.alignX&&(l=t),t=n-f/a,"Mid"===e.alignY&&(u=t/2),"Max"===e.alignY&&(u=t),i=h/o,n=f/a)),{width:i,height:n,scaleX:o,scaleY:a,offsetLeft:s,offsetTop:c,cropX:l,cropY:u}}}),r.Image.CSS_CANVAS="canvas-img",r.Image.prototype.getSvgSrc=r.Image.prototype.getSrc,r.Image.fromObject=function(t,e){var i=r.util.object.clone(t);r.util.loadImage(i.src,(function(t,n){n?e&&e(null,!0):r.Image.prototype._initFilters.call(i,i.filters,(function(n){i.filters=n||[],r.Image.prototype._initFilters.call(i,[i.resizeFilter],(function(n){i.resizeFilter=n[0],r.util.enlivenObjects([i.clipPath],(function(n){i.clipPath=n[0];var o=new r.Image(t,i);e(o,!1)}))}))}))}),null,i.crossOrigin)},r.Image.fromURL=function(t,e,i){r.util.loadImage(t,(function(t,n){e&&e(new r.Image(t,i),n)}),null,i&&i.crossOrigin)},r.Image.ATTRIBUTE_NAMES=r.SHARED_ATTRIBUTES.concat("x y width height preserveAspectRatio xlink:href crossOrigin image-rendering".split(" ")),r.Image.fromElement=function(t,i,n){var o=r.parseAttributes(t,r.Image.ATTRIBUTE_NAMES);r.Image.fromURL(o["xlink:href"],i,e(n?r.util.object.clone(n):{},o))})}(i),r.util.object.extend(r.Object.prototype,{_getAngleValueForStraighten:function(){var t=this.angle%360;return t>0?90*Math.round((t-1)/90):90*Math.round(t/90)},straighten:function(){return this.rotate(this._getAngleValueForStraighten()),this},fxStraighten:function(t){t=t||{};var e=function(){},i=t.onComplete||e,n=t.onChange||e,o=this;return r.util.animate({startValue:this.get("angle"),endValue:this._getAngleValueForStraighten(),duration:this.FX_DURATION,onChange:function(t){o.rotate(t),n()},onComplete:function(){o.setCoords(),i()}}),this}}),r.util.object.extend(r.StaticCanvas.prototype,{straightenObject:function(t){return t.straighten(),this.requestRenderAll(),this},fxStraightenObject:function(t){return t.fxStraighten({onChange:this.requestRenderAllBound}),this}}),function(){"use strict";function t(t,e){var i="precision "+e+" float;\nvoid main(){}",n=t.createShader(t.FRAGMENT_SHADER);return t.shaderSource(n,i),t.compileShader(n),!!t.getShaderParameter(n,t.COMPILE_STATUS)}function e(t){t&&t.tileSize&&(this.tileSize=t.tileSize),this.setupGLContext(this.tileSize,this.tileSize),this.captureGPUInfo()}r.isWebglSupported=function(e){if(r.isLikelyNode)return!1;e=e||r.WebglFilterBackend.prototype.tileSize;var i=document.createElement("canvas"),n=i.getContext("webgl")||i.getContext("experimental-webgl"),o=!1;if(n){r.maxTextureSize=n.getParameter(n.MAX_TEXTURE_SIZE),o=r.maxTextureSize>=e;for(var a=["highp","mediump","lowp"],s=0;s<3;s++)if(t(n,a[s])){r.webGlPrecision=a[s];break}}return this.isSupported=o,o},r.WebglFilterBackend=e,e.prototype={tileSize:2048,resources:{},setupGLContext:function(t,e){this.dispose(),this.createWebGLCanvas(t,e),this.aPosition=new Float32Array([0,0,0,1,1,0,1,1]),this.chooseFastestCopyGLTo2DMethod(t,e)},chooseFastestCopyGLTo2DMethod:function(t,e){var i,n="undefined"!==typeof window.performance;try{new ImageData(1,1),i=!0}catch(p){i=!1}var o="undefined"!==typeof ArrayBuffer,a="undefined"!==typeof Uint8ClampedArray;if(n&&i&&o&&a){var s=r.util.createCanvasElement(),u=new ArrayBuffer(t*e*4);if(r.forceGLPutImageData)return this.imageBuffer=u,void(this.copyGLTo2D=l);var h,f,d,g={imageBuffer:u,destinationWidth:t,destinationHeight:e,targetCanvas:s};s.width=t,s.height=e,h=window.performance.now(),c.call(g,this.gl,g),f=window.performance.now()-h,h=window.performance.now(),l.call(g,this.gl,g),d=window.performance.now()-h,f>d?(this.imageBuffer=u,this.copyGLTo2D=l):this.copyGLTo2D=c}},createWebGLCanvas:function(t,e){var i=r.util.createCanvasElement();i.width=t,i.height=e;var n={alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,antialias:!1},o=i.getContext("webgl",n);o||(o=i.getContext("experimental-webgl",n)),o&&(o.clearColor(0,0,0,0),this.canvas=i,this.gl=o)},applyFilters:function(t,e,i,n,r,o){var a,c=this.gl;o&&(a=this.getCachedTexture(o,e));var l={originalWidth:e.width||e.originalWidth,originalHeight:e.height||e.originalHeight,sourceWidth:i,sourceHeight:n,destinationWidth:i,destinationHeight:n,context:c,sourceTexture:this.createTexture(c,i,n,!a&&e),targetTexture:this.createTexture(c,i,n),originalTexture:a||this.createTexture(c,i,n,!a&&e),passes:t.length,webgl:!0,aPosition:this.aPosition,programCache:this.programCache,pass:0,filterBackend:this,targetCanvas:r},u=c.createFramebuffer();return c.bindFramebuffer(c.FRAMEBUFFER,u),t.forEach((function(t){t&&t.applyTo(l)})),s(l),this.copyGLTo2D(c,l),c.bindTexture(c.TEXTURE_2D,null),c.deleteTexture(l.sourceTexture),c.deleteTexture(l.targetTexture),c.deleteFramebuffer(u),r.getContext("2d").setTransform(1,0,0,1,0,0),l},dispose:function(){this.canvas&&(this.canvas=null,this.gl=null),this.clearWebGLCaches()},clearWebGLCaches:function(){this.programCache={},this.textureCache={}},createTexture:function(t,e,i,n){var r=t.createTexture();return t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),n?t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n):t.texImage2D(t.TEXTURE_2D,0,t.RGBA,e,i,0,t.RGBA,t.UNSIGNED_BYTE,null),r},getCachedTexture:function(t,e){if(this.textureCache[t])return this.textureCache[t];var i=this.createTexture(this.gl,e.width,e.height,e);return this.textureCache[t]=i,i},evictCachesForKey:function(t){this.textureCache[t]&&(this.gl.deleteTexture(this.textureCache[t]),delete this.textureCache[t])},copyGLTo2D:c,captureGPUInfo:function(){if(this.gpuInfo)return this.gpuInfo;var t=this.gl,e={renderer:"",vendor:""};if(!t)return e;var i=t.getExtension("WEBGL_debug_renderer_info");if(i){var n=t.getParameter(i.UNMASKED_RENDERER_WEBGL),r=t.getParameter(i.UNMASKED_VENDOR_WEBGL);n&&(e.renderer=n.toLowerCase()),r&&(e.vendor=r.toLowerCase())}return this.gpuInfo=e,e}}}(),function(){"use strict";var t=function(){};function e(){}r.Canvas2dFilterBackend=e,e.prototype={evictCachesForKey:t,dispose:t,clearWebGLCaches:t,resources:{},applyFilters:function(t,e,i,n,r){var o=r.getContext("2d");o.drawImage(e,0,0,i,n);var a=o.getImageData(0,0,i,n),s=o.getImageData(0,0,i,n),c={sourceWidth:i,sourceHeight:n,imageData:a,originalEl:e,originalImageData:s,canvasEl:r,ctx:o,filterBackend:this};return t.forEach((function(t){t.applyTo(c)})),c.imageData.width===i&&c.imageData.height===n||(r.width=c.imageData.width,r.height=c.imageData.height),o.putImageData(c.imageData,0,0),c}}}(),r.Image=r.Image||{},r.Image.filters=r.Image.filters||{},r.Image.filters.BaseFilter=r.util.createClass({type:"BaseFilter",vertexSource:"attribute vec2 aPosition;\nvarying vec2 vTexCoord;\nvoid main() {\nvTexCoord = aPosition;\ngl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);\n}",fragmentSource:"precision highp float;\nvarying vec2 vTexCoord;\nuniform sampler2D uTexture;\nvoid main() {\ngl_FragColor = texture2D(uTexture, vTexCoord);\n}",initialize:function(t){t&&this.setOptions(t)},setOptions:function(t){for(var e in t)this[e]=t[e]},createProgram:function(t,e,i){e=e||this.fragmentSource,i=i||this.vertexSource,"highp"!==r.webGlPrecision&&(e=e.replace(/precision highp float/g,"precision "+r.webGlPrecision+" float"));var n=t.createShader(t.VERTEX_SHADER);if(t.shaderSource(n,i),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))throw new Error("Vertex shader compile error for "+this.type+": "+t.getShaderInfoLog(n));var o=t.createShader(t.FRAGMENT_SHADER);if(t.shaderSource(o,e),t.compileShader(o),!t.getShaderParameter(o,t.COMPILE_STATUS))throw new Error("Fragment shader compile error for "+this.type+": "+t.getShaderInfoLog(o));var a=t.createProgram();if(t.attachShader(a,n),t.attachShader(a,o),t.linkProgram(a),!t.getProgramParameter(a,t.LINK_STATUS))throw new Error('Shader link error for "${this.type}" '+t.getProgramInfoLog(a));var s=this.getAttributeLocations(t,a),c=this.getUniformLocations(t,a)||{};return c.uStepW=t.getUniformLocation(a,"uStepW"),c.uStepH=t.getUniformLocation(a,"uStepH"),{program:a,attributeLocations:s,uniformLocations:c}},getAttributeLocations:function(t,e){return{aPosition:t.getAttribLocation(e,"aPosition")}},getUniformLocations:function(){return{}},sendAttributeData:function(t,e,i){var n=e.aPosition,r=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,r),t.enableVertexAttribArray(n),t.vertexAttribPointer(n,2,t.FLOAT,!1,0,0),t.bufferData(t.ARRAY_BUFFER,i,t.STATIC_DRAW)},_setupFrameBuffer:function(t){var e,i,n=t.context;t.passes>1?(e=t.destinationWidth,i=t.destinationHeight,t.sourceWidth===e&&t.sourceHeight===i||(n.deleteTexture(t.targetTexture),t.targetTexture=t.filterBackend.createTexture(n,e,i)),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,t.targetTexture,0)):(n.bindFramebuffer(n.FRAMEBUFFER,null),n.finish())},_swapTextures:function(t){t.passes--,t.pass++;var e=t.targetTexture;t.targetTexture=t.sourceTexture,t.sourceTexture=e},isNeutralState:function(){var t=this.mainParameter,e=r.Image.filters[this.type].prototype;if(t){if(Array.isArray(e[t])){for(var i=e[t].length;i--;)if(this[t][i]!==e[t][i])return!1;return!0}return e[t]===this[t]}return!1},applyTo:function(t){t.webgl?(this._setupFrameBuffer(t),this.applyToWebGL(t),this._swapTextures(t)):this.applyTo2d(t)},retrieveShader:function(t){return t.programCache.hasOwnProperty(this.type)||(t.programCache[this.type]=this.createProgram(t.context)),t.programCache[this.type]},applyToWebGL:function(t){var e=t.context,i=this.retrieveShader(t);0===t.pass&&t.originalTexture?e.bindTexture(e.TEXTURE_2D,t.originalTexture):e.bindTexture(e.TEXTURE_2D,t.sourceTexture),e.useProgram(i.program),this.sendAttributeData(e,i.attributeLocations,t.aPosition),e.uniform1f(i.uniformLocations.uStepW,1/t.sourceWidth),e.uniform1f(i.uniformLocations.uStepH,1/t.sourceHeight),this.sendUniformData(e,i.uniformLocations),e.viewport(0,0,t.destinationWidth,t.destinationHeight),e.drawArrays(e.TRIANGLE_STRIP,0,4)},bindAdditionalTexture:function(t,e,i){t.activeTexture(i),t.bindTexture(t.TEXTURE_2D,e),t.activeTexture(t.TEXTURE0)},unbindAdditionalTexture:function(t,e){t.activeTexture(e),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE0)},getMainParameter:function(){return this[this.mainParameter]},setMainParameter:function(t){this[this.mainParameter]=t},sendUniformData:function(){},createHelpLayer:function(t){if(!t.helpLayer){var e=document.createElement("canvas");e.width=t.sourceWidth,e.height=t.sourceHeight,t.helpLayer=e}},toObject:function(){var t={type:this.type},e=this.mainParameter;return e&&(t[e]=this[e]),t},toJSON:function(){return this.toObject()}}),r.Image.filters.BaseFilter.fromObject=function(t,e){var i=new r.Image.filters[t.type](t);return e&&e(i),i},function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.ColorMatrix=n(i.BaseFilter,{type:"ColorMatrix",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nvarying vec2 vTexCoord;\nuniform mat4 uColorMatrix;\nuniform vec4 uConstants;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor *= uColorMatrix;\ncolor += uConstants;\ngl_FragColor = color;\n}",matrix:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],mainParameter:"matrix",colorsOnly:!0,initialize:function(t){this.callSuper("initialize",t),this.matrix=this.matrix.slice(0)},applyTo2d:function(t){var e,i,n,r,o,a=t.imageData,s=a.data,c=s.length,l=this.matrix,u=this.colorsOnly;for(o=0;o<c;o+=4)e=s[o],i=s[o+1],n=s[o+2],u?(s[o]=e*l[0]+i*l[1]+n*l[2]+255*l[4],s[o+1]=e*l[5]+i*l[6]+n*l[7]+255*l[9],s[o+2]=e*l[10]+i*l[11]+n*l[12]+255*l[14]):(r=s[o+3],s[o]=e*l[0]+i*l[1]+n*l[2]+r*l[3]+255*l[4],s[o+1]=e*l[5]+i*l[6]+n*l[7]+r*l[8]+255*l[9],s[o+2]=e*l[10]+i*l[11]+n*l[12]+r*l[13]+255*l[14],s[o+3]=e*l[15]+i*l[16]+n*l[17]+r*l[18]+255*l[19])},getUniformLocations:function(t,e){return{uColorMatrix:t.getUniformLocation(e,"uColorMatrix"),uConstants:t.getUniformLocation(e,"uConstants")}},sendUniformData:function(t,e){var i=this.matrix,n=[i[0],i[1],i[2],i[3],i[5],i[6],i[7],i[8],i[10],i[11],i[12],i[13],i[15],i[16],i[17],i[18]],r=[i[4],i[9],i[14],i[19]];t.uniformMatrix4fv(e.uColorMatrix,!1,n),t.uniform4fv(e.uConstants,r)}}),e.Image.filters.ColorMatrix.fromObject=e.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Brightness=n(i.BaseFilter,{type:"Brightness",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uBrightness;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor.rgb += uBrightness;\ngl_FragColor = color;\n}",brightness:0,mainParameter:"brightness",applyTo2d:function(t){if(0!==this.brightness){var e,i=t.imageData,n=i.data,r=n.length,o=Math.round(255*this.brightness);for(e=0;e<r;e+=4)n[e]=n[e]+o,n[e+1]=n[e+1]+o,n[e+2]=n[e+2]+o}},getUniformLocations:function(t,e){return{uBrightness:t.getUniformLocation(e,"uBrightness")}},sendUniformData:function(t,e){t.uniform1f(e.uBrightness,this.brightness)}}),e.Image.filters.Brightness.fromObject=e.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend,n=e.Image.filters,r=e.util.createClass;n.Convolute=r(n.BaseFilter,{type:"Convolute",opaque:!1,matrix:[0,0,0,0,1,0,0,0,0],fragmentSource:{Convolute_3_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[9];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 3.0; h+=1.0) {\nfor (float w = 0.0; w < 3.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 1), uStepH * (h - 1));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 3.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_3_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[9];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 3.0; h+=1.0) {\nfor (float w = 0.0; w < 3.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 1.0), uStepH * (h - 1.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 3.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_5_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[25];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 5.0; h+=1.0) {\nfor (float w = 0.0; w < 5.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 5.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_5_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[25];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 5.0; h+=1.0) {\nfor (float w = 0.0; w < 5.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 5.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_7_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[49];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 7.0; h+=1.0) {\nfor (float w = 0.0; w < 7.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 7.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_7_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[49];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 7.0; h+=1.0) {\nfor (float w = 0.0; w < 7.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 7.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_9_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[81];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 9.0; h+=1.0) {\nfor (float w = 0.0; w < 9.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 9.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_9_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[81];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 9.0; h+=1.0) {\nfor (float w = 0.0; w < 9.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 9.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}"},retrieveShader:function(t){var e=Math.sqrt(this.matrix.length),i=this.type+"_"+e+"_"+(this.opaque?1:0),n=this.fragmentSource[i];return t.programCache.hasOwnProperty(i)||(t.programCache[i]=this.createProgram(t.context,n)),t.programCache[i]},applyTo2d:function(t){var e,i,n,r,o,a,s,c,l,u,h,f,d,g=t.imageData,p=g.data,v=this.matrix,m=Math.round(Math.sqrt(v.length)),y=Math.floor(m/2),b=g.width,_=g.height,x=t.ctx.createImageData(b,_),C=x.data,I=this.opaque?1:0;for(h=0;h<_;h++)for(u=0;u<b;u++){for(o=4*(h*b+u),e=0,i=0,n=0,r=0,d=0;d<m;d++)for(f=0;f<m;f++)s=h+d-y,a=u+f-y,s<0||s>=_||a<0||a>=b||(c=4*(s*b+a),l=v[d*m+f],e+=p[c]*l,i+=p[c+1]*l,n+=p[c+2]*l,I||(r+=p[c+3]*l));C[o]=e,C[o+1]=i,C[o+2]=n,C[o+3]=I?p[o+3]:r}t.imageData=x},getUniformLocations:function(t,e){return{uMatrix:t.getUniformLocation(e,"uMatrix"),uOpaque:t.getUniformLocation(e,"uOpaque"),uHalfSize:t.getUniformLocation(e,"uHalfSize"),uSize:t.getUniformLocation(e,"uSize")}},sendUniformData:function(t,e){t.uniform1fv(e.uMatrix,this.matrix)},toObject:function(){return i(this.callSuper("toObject"),{opaque:this.opaque,matrix:this.matrix})}}),e.Image.filters.Convolute.fromObject=e.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Grayscale=n(i.BaseFilter,{type:"Grayscale",fragmentSource:{average:"precision highp float;\nuniform sampler2D uTexture;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat average = (color.r + color.b + color.g) / 3.0;\ngl_FragColor = vec4(average, average, average, color.a);\n}",lightness:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uMode;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 col = texture2D(uTexture, vTexCoord);\nfloat average = (max(max(col.r, col.g),col.b) + min(min(col.r, col.g),col.b)) / 2.0;\ngl_FragColor = vec4(average, average, average, col.a);\n}",luminosity:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uMode;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 col = texture2D(uTexture, vTexCoord);\nfloat average = 0.21 * col.r + 0.72 * col.g + 0.07 * col.b;\ngl_FragColor = vec4(average, average, average, col.a);\n}"},mode:"average",mainParameter:"mode",applyTo2d:function(t){var e,i,n=t.imageData,r=n.data,o=r.length,a=this.mode;for(e=0;e<o;e+=4)"average"===a?i=(r[e]+r[e+1]+r[e+2])/3:"lightness"===a?i=(Math.min(r[e],r[e+1],r[e+2])+Math.max(r[e],r[e+1],r[e+2]))/2:"luminosity"===a&&(i=.21*r[e]+.72*r[e+1]+.07*r[e+2]),r[e]=i,r[e+1]=i,r[e+2]=i},retrieveShader:function(t){var e=this.type+"_"+this.mode;if(!t.programCache.hasOwnProperty(e)){var i=this.fragmentSource[this.mode];t.programCache[e]=this.createProgram(t.context,i)}return t.programCache[e]},getUniformLocations:function(t,e){return{uMode:t.getUniformLocation(e,"uMode")}},sendUniformData:function(t,e){var i=1;t.uniform1i(e.uMode,i)},isNeutralState:function(){return!1}}),e.Image.filters.Grayscale.fromObject=e.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Invert=n(i.BaseFilter,{type:"Invert",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uInvert;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nif (uInvert == 1) {\ngl_FragColor = vec4(1.0 - color.r,1.0 -color.g,1.0 -color.b,color.a);\n} else {\ngl_FragColor = color;\n}\n}",invert:!0,mainParameter:"invert",applyTo2d:function(t){var e,i=t.imageData,n=i.data,r=n.length;for(e=0;e<r;e+=4)n[e]=255-n[e],n[e+1]=255-n[e+1],n[e+2]=255-n[e+2]},isNeutralState:function(){return!this.invert},getUniformLocations:function(t,e){return{uInvert:t.getUniformLocation(e,"uInvert")}},sendUniformData:function(t,e){t.uniform1i(e.uInvert,this.invert)}}),e.Image.filters.Invert.fromObject=e.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend,n=e.Image.filters,r=e.util.createClass;n.Noise=r(n.BaseFilter,{type:"Noise",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uStepH;\nuniform float uNoise;\nuniform float uSeed;\nvarying vec2 vTexCoord;\nfloat rand(vec2 co, float seed, float vScale) {\nreturn fract(sin(dot(co.xy * vScale ,vec2(12.9898 , 78.233))) * 43758.5453 * (seed + 0.01) / 2.0);\n}\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor.rgb += (0.5 - rand(vTexCoord, uSeed, 0.1 / uStepH)) * uNoise;\ngl_FragColor = color;\n}",mainParameter:"noise",noise:0,applyTo2d:function(t){if(0!==this.noise){var e,i,n=t.imageData,r=n.data,o=r.length,a=this.noise;for(e=0,o=r.length;e<o;e+=4)i=(.5-Math.random())*a,r[e]+=i,r[e+1]+=i,r[e+2]+=i}},getUniformLocations:function(t,e){return{uNoise:t.getUniformLocation(e,"uNoise"),uSeed:t.getUniformLocation(e,"uSeed")}},sendUniformData:function(t,e){t.uniform1f(e.uNoise,this.noise/255),t.uniform1f(e.uSeed,Math.random())},toObject:function(){return i(this.callSuper("toObject"),{noise:this.noise})}}),e.Image.filters.Noise.fromObject=e.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Pixelate=n(i.BaseFilter,{type:"Pixelate",blocksize:4,mainParameter:"blocksize",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uBlocksize;\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nfloat blockW = uBlocksize * uStepW;\nfloat blockH = uBlocksize * uStepW;\nint posX = int(vTexCoord.x / blockW);\nint posY = int(vTexCoord.y / blockH);\nfloat fposX = float(posX);\nfloat fposY = float(posY);\nvec2 squareCoords = vec2(fposX * blockW, fposY * blockH);\nvec4 color = texture2D(uTexture, squareCoords);\ngl_FragColor = color;\n}",applyTo2d:function(t){var e,i,n,r,o,a,s,c,l,u,h,f=t.imageData,d=f.data,g=f.height,p=f.width;for(i=0;i<g;i+=this.blocksize)for(n=0;n<p;n+=this.blocksize)for(e=4*i*p+4*n,r=d[e],o=d[e+1],a=d[e+2],s=d[e+3],u=Math.min(i+this.blocksize,g),h=Math.min(n+this.blocksize,p),c=i;c<u;c++)for(l=n;l<h;l++)e=4*c*p+4*l,d[e]=r,d[e+1]=o,d[e+2]=a,d[e+3]=s},isNeutralState:function(){return 1===this.blocksize},getUniformLocations:function(t,e){return{uBlocksize:t.getUniformLocation(e,"uBlocksize"),uStepW:t.getUniformLocation(e,"uStepW"),uStepH:t.getUniformLocation(e,"uStepH")}},sendUniformData:function(t,e){t.uniform1f(e.uBlocksize,this.blocksize)}}),e.Image.filters.Pixelate.fromObject=e.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend,n=e.Image.filters,r=e.util.createClass;n.RemoveColor=r(n.BaseFilter,{type:"RemoveColor",color:"#FFFFFF",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec4 uLow;\nuniform vec4 uHigh;\nvarying vec2 vTexCoord;\nvoid main() {\ngl_FragColor = texture2D(uTexture, vTexCoord);\nif(all(greaterThan(gl_FragColor.rgb,uLow.rgb)) && all(greaterThan(uHigh.rgb,gl_FragColor.rgb))) {\ngl_FragColor.a = 0.0;\n}\n}",distance:.02,useAlpha:!1,applyTo2d:function(t){var i,n,r,o,a=t.imageData,s=a.data,c=255*this.distance,l=new e.Color(this.color).getSource(),u=[l[0]-c,l[1]-c,l[2]-c],h=[l[0]+c,l[1]+c,l[2]+c];for(i=0;i<s.length;i+=4)n=s[i],r=s[i+1],o=s[i+2],n>u[0]&&r>u[1]&&o>u[2]&&n<h[0]&&r<h[1]&&o<h[2]&&(s[i+3]=0)},getUniformLocations:function(t,e){return{uLow:t.getUniformLocation(e,"uLow"),uHigh:t.getUniformLocation(e,"uHigh")}},sendUniformData:function(t,i){var n=new e.Color(this.color).getSource(),r=parseFloat(this.distance),o=[0+n[0]/255-r,0+n[1]/255-r,0+n[2]/255-r,1],a=[n[0]/255+r,n[1]/255+r,n[2]/255+r,1];t.uniform4fv(i.uLow,o),t.uniform4fv(i.uHigh,a)},toObject:function(){return i(this.callSuper("toObject"),{color:this.color,distance:this.distance})}}),e.Image.filters.RemoveColor.fromObject=e.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass,r={Brownie:[.5997,.34553,-.27082,0,.186,-.0377,.86095,.15059,0,-.1449,.24113,-.07441,.44972,0,-.02965,0,0,0,1,0],Vintage:[.62793,.32021,-.03965,0,.03784,.02578,.64411,.03259,0,.02926,.0466,-.08512,.52416,0,.02023,0,0,0,1,0],Kodachrome:[1.12855,-.39673,-.03992,0,.24991,-.16404,1.08352,-.05498,0,.09698,-.16786,-.56034,1.60148,0,.13972,0,0,0,1,0],Technicolor:[1.91252,-.85453,-.09155,0,.04624,-.30878,1.76589,-.10601,0,-.27589,-.2311,-.75018,1.84759,0,.12137,0,0,0,1,0],Polaroid:[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],Sepia:[.393,.769,.189,0,0,.349,.686,.168,0,0,.272,.534,.131,0,0,0,0,0,1,0],BlackWhite:[1.5,1.5,1.5,0,-1,1.5,1.5,1.5,0,-1,1.5,1.5,1.5,0,-1,0,0,0,1,0]};for(var o in r)i[o]=n(i.ColorMatrix,{type:o,matrix:r[o],mainParameter:!1,colorsOnly:!0}),e.Image.filters[o].fromObject=e.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var e=t.fabric,i=e.Image.filters,n=e.util.createClass;i.BlendColor=n(i.BaseFilter,{type:"BlendColor",color:"#F95C63",mode:"multiply",alpha:1,fragmentSource:{multiply:"gl_FragColor.rgb *= uColor.rgb;\n",screen:"gl_FragColor.rgb = 1.0 - (1.0 - gl_FragColor.rgb) * (1.0 - uColor.rgb);\n",add:"gl_FragColor.rgb += uColor.rgb;\n",diff:"gl_FragColor.rgb = abs(gl_FragColor.rgb - uColor.rgb);\n",subtract:"gl_FragColor.rgb -= uColor.rgb;\n",lighten:"gl_FragColor.rgb = max(gl_FragColor.rgb, uColor.rgb);\n",darken:"gl_FragColor.rgb = min(gl_FragColor.rgb, uColor.rgb);\n",exclusion:"gl_FragColor.rgb += uColor.rgb - 2.0 * (uColor.rgb * gl_FragColor.rgb);\n",overlay:"if (uColor.r < 0.5) {\ngl_FragColor.r *= 2.0 * uColor.r;\n} else {\ngl_FragColor.r = 1.0 - 2.0 * (1.0 - gl_FragColor.r) * (1.0 - uColor.r);\n}\nif (uColor.g < 0.5) {\ngl_FragColor.g *= 2.0 * uColor.g;\n} else {\ngl_FragColor.g = 1.0 - 2.0 * (1.0 - gl_FragColor.g) * (1.0 - uColor.g);\n}\nif (uColor.b < 0.5) {\ngl_FragColor.b *= 2.0 * uColor.b;\n} else {\ngl_FragColor.b = 1.0 - 2.0 * (1.0 - gl_FragColor.b) * (1.0 - uColor.b);\n}\n",tint:"gl_FragColor.rgb *= (1.0 - uColor.a);\ngl_FragColor.rgb += uColor.rgb;\n"},buildSource:function(t){return"precision highp float;\nuniform sampler2D uTexture;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ngl_FragColor = color;\nif (color.a > 0.0) {\n"+this.fragmentSource[t]+"}\n}"},retrieveShader:function(t){var e,i=this.type+"_"+this.mode;return t.programCache.hasOwnProperty(i)||(e=this.buildSource(this.mode),t.programCache[i]=this.createProgram(t.context,e)),t.programCache[i]},applyTo2d:function(t){var i,n,r,o,a,s,c,l=t.imageData,u=l.data,h=u.length,f=1-this.alpha;c=new e.Color(this.color).getSource(),i=c[0]*this.alpha,n=c[1]*this.alpha,r=c[2]*this.alpha;for(var d=0;d<h;d+=4)switch(o=u[d],a=u[d+1],s=u[d+2],this.mode){case"multiply":u[d]=o*i/255,u[d+1]=a*n/255,u[d+2]=s*r/255;break;case"screen":u[d]=255-(255-o)*(255-i)/255,u[d+1]=255-(255-a)*(255-n)/255,u[d+2]=255-(255-s)*(255-r)/255;break;case"add":u[d]=o+i,u[d+1]=a+n,u[d+2]=s+r;break;case"diff":case"difference":u[d]=Math.abs(o-i),u[d+1]=Math.abs(a-n),u[d+2]=Math.abs(s-r);break;case"subtract":u[d]=o-i,u[d+1]=a-n,u[d+2]=s-r;break;case"darken":u[d]=Math.min(o,i),u[d+1]=Math.min(a,n),u[d+2]=Math.min(s,r);break;case"lighten":u[d]=Math.max(o,i),u[d+1]=Math.max(a,n),u[d+2]=Math.max(s,r);break;case"overlay":u[d]=i<128?2*o*i/255:255-2*(255-o)*(255-i)/255,u[d+1]=n<128?2*a*n/255:255-2*(255-a)*(255-n)/255,u[d+2]=r<128?2*s*r/255:255-2*(255-s)*(255-r)/255;break;case"exclusion":u[d]=i+o-2*i*o/255,u[d+1]=n+a-2*n*a/255,u[d+2]=r+s-2*r*s/255;break;case"tint":u[d]=i+o*f,u[d+1]=n+a*f,u[d+2]=r+s*f}},getUniformLocations:function(t,e){return{uColor:t.getUniformLocation(e,"uColor")}},sendUniformData:function(t,i){var n=new e.Color(this.color).getSource();n[0]=this.alpha*n[0]/255,n[1]=this.alpha*n[1]/255,n[2]=this.alpha*n[2]/255,n[3]=this.alpha,t.uniform4fv(i.uColor,n)},toObject:function(){return{type:this.type,color:this.color,mode:this.mode,alpha:this.alpha}}}),e.Image.filters.BlendColor.fromObject=e.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var e=t.fabric,i=e.Image.filters,n=e.util.createClass;i.BlendImage=n(i.BaseFilter,{type:"BlendImage",image:null,mode:"multiply",alpha:1,vertexSource:"attribute vec2 aPosition;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nuniform mat3 uTransformMatrix;\nvoid main() {\nvTexCoord = aPosition;\nvTexCoord2 = (uTransformMatrix * vec3(aPosition, 1.0)).xy;\ngl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);\n}",fragmentSource:{multiply:"precision highp float;\nuniform sampler2D uTexture;\nuniform sampler2D uImage;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec4 color2 = texture2D(uImage, vTexCoord2);\ncolor.rgba *= color2.rgba;\ngl_FragColor = color;\n}",mask:"precision highp float;\nuniform sampler2D uTexture;\nuniform sampler2D uImage;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec4 color2 = texture2D(uImage, vTexCoord2);\ncolor.a = color2.a;\ngl_FragColor = color;\n}"},retrieveShader:function(t){var e=this.type+"_"+this.mode,i=this.fragmentSource[this.mode];return t.programCache.hasOwnProperty(e)||(t.programCache[e]=this.createProgram(t.context,i)),t.programCache[e]},applyToWebGL:function(t){var e=t.context,i=this.createTexture(t.filterBackend,this.image);this.bindAdditionalTexture(e,i,e.TEXTURE1),this.callSuper("applyToWebGL",t),this.unbindAdditionalTexture(e,e.TEXTURE1)},createTexture:function(t,e){return t.getCachedTexture(e.cacheKey,e._element)},calculateMatrix:function(){var t=this.image,e=t._element.width,i=t._element.height;return[1/t.scaleX,0,0,0,1/t.scaleY,0,-t.left/e,-t.top/i,1]},applyTo2d:function(t){var i,n,r,o,a,s,c,l,u,h,f,d=t.imageData,g=t.filterBackend.resources,p=d.data,v=p.length,m=d.width,y=d.height,b=this.image;g.blendImage||(g.blendImage=e.util.createCanvasElement()),u=g.blendImage,h=u.getContext("2d"),u.width!==m||u.height!==y?(u.width=m,u.height=y):h.clearRect(0,0,m,y),h.setTransform(b.scaleX,0,0,b.scaleY,b.left,b.top),h.drawImage(b._element,0,0,m,y),f=h.getImageData(0,0,m,y).data;for(var _=0;_<v;_+=4)switch(a=p[_],s=p[_+1],c=p[_+2],l=p[_+3],i=f[_],n=f[_+1],r=f[_+2],o=f[_+3],this.mode){case"multiply":p[_]=a*i/255,p[_+1]=s*n/255,p[_+2]=c*r/255,p[_+3]=l*o/255;break;case"mask":p[_+3]=o;break}},getUniformLocations:function(t,e){return{uTransformMatrix:t.getUniformLocation(e,"uTransformMatrix"),uImage:t.getUniformLocation(e,"uImage")}},sendUniformData:function(t,e){var i=this.calculateMatrix();t.uniform1i(e.uImage,1),t.uniformMatrix3fv(e.uTransformMatrix,!1,i)},toObject:function(){return{type:this.type,image:this.image&&this.image.toObject(),mode:this.mode,alpha:this.alpha}}}),e.Image.filters.BlendImage.fromObject=function(t,i){e.Image.fromObject(t.image,(function(n){var r=e.util.object.clone(t);r.image=n,i(new e.Image.filters.BlendImage(r))}))}}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=Math.pow,n=Math.floor,r=Math.sqrt,o=Math.abs,a=Math.round,s=Math.sin,c=Math.ceil,l=e.Image.filters,u=e.util.createClass;l.Resize=u(l.BaseFilter,{type:"Resize",resizeType:"hermite",scaleX:1,scaleY:1,lanczosLobes:3,getUniformLocations:function(t,e){return{uDelta:t.getUniformLocation(e,"uDelta"),uTaps:t.getUniformLocation(e,"uTaps")}},sendUniformData:function(t,e){t.uniform2fv(e.uDelta,this.horizontal?[1/this.width,0]:[0,1/this.height]),t.uniform1fv(e.uTaps,this.taps)},retrieveShader:function(t){var e=this.getFilterWindow(),i=this.type+"_"+e;if(!t.programCache.hasOwnProperty(i)){var n=this.generateShader(e);t.programCache[i]=this.createProgram(t.context,n)}return t.programCache[i]},getFilterWindow:function(){var t=this.tempScale;return Math.ceil(this.lanczosLobes/t)},getTaps:function(){for(var t=this.lanczosCreate(this.lanczosLobes),e=this.tempScale,i=this.getFilterWindow(),n=new Array(i),r=1;r<=i;r++)n[r-1]=t(r*e);return n},generateShader:function(t){for(var e=new Array(t),i=this.fragmentSourceTOP,n=1;n<=t;n++)e[n-1]=n+".0 * uDelta";return i+="uniform float uTaps["+t+"];\n",i+="void main() {\n",i+=" vec4 color = texture2D(uTexture, vTexCoord);\n",i+=" float sum = 1.0;\n",e.forEach((function(t,e){i+=" color += texture2D(uTexture, vTexCoord + "+t+") * uTaps["+e+"];\n",i+=" color += texture2D(uTexture, vTexCoord - "+t+") * uTaps["+e+"];\n",i+=" sum += 2.0 * uTaps["+e+"];\n"})),i+=" gl_FragColor = color / sum;\n",i+="}",i},fragmentSourceTOP:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec2 uDelta;\nvarying vec2 vTexCoord;\n",applyTo:function(t){t.webgl?(t.passes++,this.width=t.sourceWidth,this.horizontal=!0,this.dW=Math.round(this.width*this.scaleX),this.dH=t.sourceHeight,this.tempScale=this.dW/this.width,this.taps=this.getTaps(),t.destinationWidth=this.dW,this._setupFrameBuffer(t),this.applyToWebGL(t),this._swapTextures(t),t.sourceWidth=t.destinationWidth,this.height=t.sourceHeight,this.horizontal=!1,this.dH=Math.round(this.height*this.scaleY),this.tempScale=this.dH/this.height,this.taps=this.getTaps(),t.destinationHeight=this.dH,this._setupFrameBuffer(t),this.applyToWebGL(t),this._swapTextures(t),t.sourceHeight=t.destinationHeight):this.applyTo2d(t)},isNeutralState:function(){return 1===this.scaleX&&1===this.scaleY},lanczosCreate:function(t){return function(e){if(e>=t||e<=-t)return 0;if(e<1.1920929e-7&&e>-1.1920929e-7)return 1;e*=Math.PI;var i=e/t;return s(e)/e*s(i)/i}},applyTo2d:function(t){var e=t.imageData,i=this.scaleX,n=this.scaleY;this.rcpScaleX=1/i,this.rcpScaleY=1/n;var r,o=e.width,s=e.height,c=a(o*i),l=a(s*n);"sliceHack"===this.resizeType?r=this.sliceByTwo(t,o,s,c,l):"hermite"===this.resizeType?r=this.hermiteFastResize(t,o,s,c,l):"bilinear"===this.resizeType?r=this.bilinearFiltering(t,o,s,c,l):"lanczos"===this.resizeType&&(r=this.lanczosResize(t,o,s,c,l)),t.imageData=r},sliceByTwo:function(t,i,r,o,a){var s,c,l=t.imageData,u=.5,h=!1,f=!1,d=i*u,g=r*u,p=e.filterBackend.resources,v=0,m=0,y=i,b=0;p.sliceByTwo||(p.sliceByTwo=document.createElement("canvas")),s=p.sliceByTwo,(s.width<1.5*i||s.height<r)&&(s.width=1.5*i,s.height=r),c=s.getContext("2d"),c.clearRect(0,0,1.5*i,r),c.putImageData(l,0,0),o=n(o),a=n(a);while(!h||!f)i=d,r=g,o<n(d*u)?d=n(d*u):(d=o,h=!0),a<n(g*u)?g=n(g*u):(g=a,f=!0),c.drawImage(s,v,m,i,r,y,b,d,g),v=y,m=b,b+=g;return c.getImageData(v,m,o,a)},lanczosResize:function(t,e,a,s,l){function u(t){var c,M,S,w,T,A,D,E,k,O,j;for(C.x=(t+.5)*p,I.x=n(C.x),c=0;c<l;c++){for(C.y=(c+.5)*v,I.y=n(C.y),T=0,A=0,D=0,E=0,k=0,M=I.x-b;M<=I.x+b;M++)if(!(M<0||M>=e)){O=n(1e3*o(M-C.x)),x[O]||(x[O]={});for(var L=I.y-_;L<=I.y+_;L++)L<0||L>=a||(j=n(1e3*o(L-C.y)),x[O][j]||(x[O][j]=g(r(i(O*m,2)+i(j*y,2))/1e3)),S=x[O][j],S>0&&(w=4*(L*e+M),T+=S,A+=S*h[w],D+=S*h[w+1],E+=S*h[w+2],k+=S*h[w+3]))}w=4*(c*s+t),d[w]=A/T,d[w+1]=D/T,d[w+2]=E/T,d[w+3]=k/T}return++t<s?u(t):f}var h=t.imageData.data,f=t.ctx.createImageData(s,l),d=f.data,g=this.lanczosCreate(this.lanczosLobes),p=this.rcpScaleX,v=this.rcpScaleY,m=2/this.rcpScaleX,y=2/this.rcpScaleY,b=c(p*this.lanczosLobes/2),_=c(v*this.lanczosLobes/2),x={},C={},I={};return u(0)},bilinearFiltering:function(t,e,i,r,o){var a,s,c,l,u,h,f,d,g,p,v,m,y,b=0,_=this.rcpScaleX,x=this.rcpScaleY,C=4*(e-1),I=t.imageData,M=I.data,S=t.ctx.createImageData(r,o),w=S.data;for(f=0;f<o;f++)for(d=0;d<r;d++)for(u=n(_*d),h=n(x*f),g=_*d-u,p=x*f-h,y=4*(h*e+u),v=0;v<4;v++)a=M[y+v],s=M[y+4+v],c=M[y+C+v],l=M[y+C+4+v],m=a*(1-g)*(1-p)+s*g*(1-p)+c*p*(1-g)+l*g*p,w[b++]=m;return S},hermiteFastResize:function(t,e,i,a,s){for(var l=this.rcpScaleX,u=this.rcpScaleY,h=c(l/2),f=c(u/2),d=t.imageData,g=d.data,p=t.ctx.createImageData(a,s),v=p.data,m=0;m<s;m++)for(var y=0;y<a;y++){for(var b=4*(y+m*a),_=0,x=0,C=0,I=0,M=0,S=0,w=0,T=(m+.5)*u,A=n(m*u);A<(m+1)*u;A++)for(var D=o(T-(A+.5))/f,E=(y+.5)*l,k=D*D,O=n(y*l);O<(y+1)*l;O++){var j=o(E-(O+.5))/h,L=r(k+j*j);L>1&&L<-1||(_=2*L*L*L-3*L*L+1,_>0&&(j=4*(O+A*e),w+=_*g[j+3],C+=_,g[j+3]<255&&(_=_*g[j+3]/250),I+=_*g[j],M+=_*g[j+1],S+=_*g[j+2],x+=_))}v[b]=I/x,v[b+1]=M/x,v[b+2]=S/x,v[b+3]=w/C}return p},toObject:function(){return{type:this.type,scaleX:this.scaleX,scaleY:this.scaleY,resizeType:this.resizeType,lanczosLobes:this.lanczosLobes}}}),e.Image.filters.Resize.fromObject=e.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Contrast=n(i.BaseFilter,{type:"Contrast",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uContrast;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat contrastF = 1.015 * (uContrast + 1.0) / (1.0 * (1.015 - uContrast));\ncolor.rgb = contrastF * (color.rgb - 0.5) + 0.5;\ngl_FragColor = color;\n}",contrast:0,mainParameter:"contrast",applyTo2d:function(t){if(0!==this.contrast){var e,i=t.imageData,n=i.data,r=n.length,o=Math.floor(255*this.contrast),a=259*(o+255)/(255*(259-o));for(e=0;e<r;e+=4)n[e]=a*(n[e]-128)+128,n[e+1]=a*(n[e+1]-128)+128,n[e+2]=a*(n[e+2]-128)+128}},getUniformLocations:function(t,e){return{uContrast:t.getUniformLocation(e,"uContrast")}},sendUniformData:function(t,e){t.uniform1f(e.uContrast,this.contrast)}}),e.Image.filters.Contrast.fromObject=e.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Saturation=n(i.BaseFilter,{type:"Saturation",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uSaturation;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat rgMax = max(color.r, color.g);\nfloat rgbMax = max(rgMax, color.b);\ncolor.r += rgbMax != color.r ? (rgbMax - color.r) * uSaturation : 0.00;\ncolor.g += rgbMax != color.g ? (rgbMax - color.g) * uSaturation : 0.00;\ncolor.b += rgbMax != color.b ? (rgbMax - color.b) * uSaturation : 0.00;\ngl_FragColor = color;\n}",saturation:0,mainParameter:"saturation",applyTo2d:function(t){if(0!==this.saturation){var e,i,n=t.imageData,r=n.data,o=r.length,a=-this.saturation;for(e=0;e<o;e+=4)i=Math.max(r[e],r[e+1],r[e+2]),r[e]+=i!==r[e]?(i-r[e])*a:0,r[e+1]+=i!==r[e+1]?(i-r[e+1])*a:0,r[e+2]+=i!==r[e+2]?(i-r[e+2])*a:0}},getUniformLocations:function(t,e){return{uSaturation:t.getUniformLocation(e,"uSaturation")}},sendUniformData:function(t,e){t.uniform1f(e.uSaturation,-this.saturation)}}),e.Image.filters.Saturation.fromObject=e.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Vibrance=n(i.BaseFilter,{type:"Vibrance",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uVibrance;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat max = max(color.r, max(color.g, color.b));\nfloat avg = (color.r + color.g + color.b) / 3.0;\nfloat amt = (abs(max - avg) * 2.0) * uVibrance;\ncolor.r += max != color.r ? (max - color.r) * amt : 0.00;\ncolor.g += max != color.g ? (max - color.g) * amt : 0.00;\ncolor.b += max != color.b ? (max - color.b) * amt : 0.00;\ngl_FragColor = color;\n}",vibrance:0,mainParameter:"vibrance",applyTo2d:function(t){if(0!==this.vibrance){var e,i,n,r,o=t.imageData,a=o.data,s=a.length,c=-this.vibrance;for(e=0;e<s;e+=4)i=Math.max(a[e],a[e+1],a[e+2]),n=(a[e]+a[e+1]+a[e+2])/3,r=2*Math.abs(i-n)/255*c,a[e]+=i!==a[e]?(i-a[e])*r:0,a[e+1]+=i!==a[e+1]?(i-a[e+1])*r:0,a[e+2]+=i!==a[e+2]?(i-a[e+2])*r:0}},getUniformLocations:function(t,e){return{uVibrance:t.getUniformLocation(e,"uVibrance")}},sendUniformData:function(t,e){t.uniform1f(e.uVibrance,-this.vibrance)}}),e.Image.filters.Vibrance.fromObject=e.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Blur=n(i.BaseFilter,{type:"Blur",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec2 uDelta;\nvarying vec2 vTexCoord;\nconst float nSamples = 15.0;\nvec3 v3offset = vec3(12.9898, 78.233, 151.7182);\nfloat random(vec3 scale) {\nreturn fract(sin(dot(gl_FragCoord.xyz, scale)) * 43758.5453);\n}\nvoid main() {\nvec4 color = vec4(0.0);\nfloat total = 0.0;\nfloat offset = random(v3offset);\nfor (float t = -nSamples; t <= nSamples; t++) {\nfloat percent = (t + offset - 0.5) / nSamples;\nfloat weight = 1.0 - abs(percent);\ncolor += texture2D(uTexture, vTexCoord + uDelta * percent) * weight;\ntotal += weight;\n}\ngl_FragColor = color / total;\n}",blur:0,mainParameter:"blur",applyTo:function(t){t.webgl?(this.aspectRatio=t.sourceWidth/t.sourceHeight,t.passes++,this._setupFrameBuffer(t),this.horizontal=!0,this.applyToWebGL(t),this._swapTextures(t),this._setupFrameBuffer(t),this.horizontal=!1,this.applyToWebGL(t),this._swapTextures(t)):this.applyTo2d(t)},applyTo2d:function(t){t.imageData=this.simpleBlur(t)},simpleBlur:function(t){var i,n,r=t.filterBackend.resources,o=t.imageData.width,a=t.imageData.height;r.blurLayer1||(r.blurLayer1=e.util.createCanvasElement(),r.blurLayer2=e.util.createCanvasElement()),i=r.blurLayer1,n=r.blurLayer2,i.width===o&&i.height===a||(n.width=i.width=o,n.height=i.height=a);var s,c,l,u,h=i.getContext("2d"),f=n.getContext("2d"),d=15,g=.06*this.blur*.5;for(h.putImageData(t.imageData,0,0),f.clearRect(0,0,o,a),u=-d;u<=d;u++)s=(Math.random()-.5)/4,c=u/d,l=g*c*o+s,f.globalAlpha=1-Math.abs(c),f.drawImage(i,l,s),h.drawImage(n,0,0),f.globalAlpha=1,f.clearRect(0,0,n.width,n.height);for(u=-d;u<=d;u++)s=(Math.random()-.5)/4,c=u/d,l=g*c*a+s,f.globalAlpha=1-Math.abs(c),f.drawImage(i,s,l),h.drawImage(n,0,0),f.globalAlpha=1,f.clearRect(0,0,n.width,n.height);t.ctx.drawImage(i,0,0);var p=t.ctx.getImageData(0,0,i.width,i.height);return h.globalAlpha=1,h.clearRect(0,0,i.width,i.height),p},getUniformLocations:function(t,e){return{delta:t.getUniformLocation(e,"uDelta")}},sendUniformData:function(t,e){var i=this.chooseRightDelta();t.uniform2fv(e.delta,i)},chooseRightDelta:function(){var t,e=1,i=[0,0];return this.horizontal?this.aspectRatio>1&&(e=1/this.aspectRatio):this.aspectRatio<1&&(e=this.aspectRatio),t=e*this.blur*.12,this.horizontal?i[0]=t:i[1]=t,i}}),i.Blur.fromObject=e.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Gamma=n(i.BaseFilter,{type:"Gamma",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec3 uGamma;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec3 correction = (1.0 / uGamma);\ncolor.r = pow(color.r, correction.r);\ncolor.g = pow(color.g, correction.g);\ncolor.b = pow(color.b, correction.b);\ngl_FragColor = color;\ngl_FragColor.rgb *= color.a;\n}",gamma:[1,1,1],mainParameter:"gamma",initialize:function(t){this.gamma=[1,1,1],i.BaseFilter.prototype.initialize.call(this,t)},applyTo2d:function(t){var e,i=t.imageData,n=i.data,r=this.gamma,o=n.length,a=1/r[0],s=1/r[1],c=1/r[2];for(this.rVals||(this.rVals=new Uint8Array(256),this.gVals=new Uint8Array(256),this.bVals=new Uint8Array(256)),e=0,o=256;e<o;e++)this.rVals[e]=255*Math.pow(e/255,a),this.gVals[e]=255*Math.pow(e/255,s),this.bVals[e]=255*Math.pow(e/255,c);for(e=0,o=n.length;e<o;e+=4)n[e]=this.rVals[n[e]],n[e+1]=this.gVals[n[e+1]],n[e+2]=this.bVals[n[e+2]]},getUniformLocations:function(t,e){return{uGamma:t.getUniformLocation(e,"uGamma")}},sendUniformData:function(t,e){t.uniform3fv(e.uGamma,this.gamma)}}),e.Image.filters.Gamma.fromObject=e.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Composed=n(i.BaseFilter,{type:"Composed",subFilters:[],initialize:function(t){this.callSuper("initialize",t),this.subFilters=this.subFilters.slice(0)},applyTo:function(t){t.passes+=this.subFilters.length-1,this.subFilters.forEach((function(e){e.applyTo(t)}))},toObject:function(){return e.util.object.extend(this.callSuper("toObject"),{subFilters:this.subFilters.map((function(t){return t.toObject()}))})},isNeutralState:function(){return!this.subFilters.some((function(t){return!t.isNeutralState()}))}}),e.Image.filters.Composed.fromObject=function(t,i){var n=t.subFilters||[],r=n.map((function(t){return new e.Image.filters[t.type](t)})),o=new e.Image.filters.Composed({subFilters:r});return i&&i(o),o}}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.HueRotation=n(i.ColorMatrix,{type:"HueRotation",rotation:0,mainParameter:"rotation",calculateMatrix:function(){var t=this.rotation*Math.PI,i=e.util.cos(t),n=e.util.sin(t),r=1/3,o=Math.sqrt(r)*n,a=1-i;this.matrix=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],this.matrix[0]=i+a/3,this.matrix[1]=r*a-o,this.matrix[2]=r*a+o,this.matrix[5]=r*a+o,this.matrix[6]=i+r*a,this.matrix[7]=r*a-o,this.matrix[10]=r*a-o,this.matrix[11]=r*a+o,this.matrix[12]=i+r*a},isNeutralState:function(t){return this.calculateMatrix(),i.BaseFilter.prototype.isNeutralState.call(this,t)},applyTo:function(t){this.calculateMatrix(),i.BaseFilter.prototype.applyTo.call(this,t)}}),e.Image.filters.HueRotation.fromObject=e.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.clone;if(e.Text)e.warn("fabric.Text is already defined");else{var n="fontFamily fontWeight fontSize text underline overline linethrough textAlign fontStyle lineHeight textBackgroundColor charSpacing styles direction path pathStartOffset pathSide".split(" ");e.Text=e.util.createClass(e.Object,{_dimensionAffectingProps:["fontSize","fontWeight","fontFamily","fontStyle","lineHeight","text","charSpacing","textAlign","styles","path","pathStartOffset","pathSide"],_reNewline:/\r?\n/,_reSpacesAndTabs:/[ \t\r]/g,_reSpaceAndTab:/[ \t\r]/,_reWords:/\S+/g,type:"text",fontSize:40,fontWeight:"normal",fontFamily:"Times New Roman",underline:!1,overline:!1,linethrough:!1,textAlign:"left",fontStyle:"normal",lineHeight:1.16,superscript:{size:.6,baseline:-.35},subscript:{size:.6,baseline:.11},textBackgroundColor:"",stateProperties:e.Object.prototype.stateProperties.concat(n),cacheProperties:e.Object.prototype.cacheProperties.concat(n),stroke:null,shadow:null,path:null,pathStartOffset:0,pathSide:"left",_fontSizeFraction:.222,offsets:{underline:.1,linethrough:-.315,overline:-.88},_fontSizeMult:1.13,charSpacing:0,styles:null,_measuringContext:null,deltaY:0,direction:"ltr",_styleProperties:["stroke","strokeWidth","fill","fontFamily","fontSize","fontWeight","fontStyle","underline","overline","linethrough","deltaY","textBackgroundColor"],__charBounds:[],CACHE_FONT_SIZE:400,MIN_TEXT_WIDTH:2,initialize:function(t,e){this.styles=e&&e.styles||{},this.text=t,this.__skipDimension=!0,this.callSuper("initialize",e),this.path&&this.setPathInfo(),this.__skipDimension=!1,this.initDimensions(),this.setCoords(),this.setupState({propertySet:"_dimensionAffectingProps"})},setPathInfo:function(){var t=this.path;t&&(t.segmentsInfo=e.util.getPathSegmentsInfo(t.path))},getMeasuringContext:function(){return e._measuringContext||(e._measuringContext=this.canvas&&this.canvas.contextCache||e.util.createCanvasElement().getContext("2d")),e._measuringContext},_splitText:function(){var t=this._splitTextIntoLines(this.text);return this.textLines=t.lines,this._textLines=t.graphemeLines,this._unwrappedTextLines=t._unwrappedLines,this._text=t.graphemeText,t},initDimensions:function(){this.__skipDimension||(this._splitText(),this._clearCache(),this.path?(this.width=this.path.width,this.height=this.path.height):(this.width=this.calcTextWidth()||this.cursorWidth||this.MIN_TEXT_WIDTH,this.height=this.calcTextHeight()),-1!==this.textAlign.indexOf("justify")&&this.enlargeSpaces(),this.saveState({propertySet:"_dimensionAffectingProps"}))},enlargeSpaces:function(){for(var t,e,i,n,r,o,a,s=0,c=this._textLines.length;s<c;s++)if(("justify"===this.textAlign||s!==c-1&&!this.isEndOfWrapping(s))&&(n=0,r=this._textLines[s],e=this.getLineWidth(s),e<this.width&&(a=this.textLines[s].match(this._reSpacesAndTabs)))){i=a.length,t=(this.width-e)/i;for(var l=0,u=r.length;l<=u;l++)o=this.__charBounds[s][l],this._reSpaceAndTab.test(r[l])?(o.width+=t,o.kernedWidth+=t,o.left+=n,n+=t):o.left+=n}},isEndOfWrapping:function(t){return t===this._textLines.length-1},missingNewlineOffset:function(){return 1},toString:function(){return"#<fabric.Text ("+this.complexity()+'): { "text": "'+this.text+'", "fontFamily": "'+this.fontFamily+'" }>'},_getCacheCanvasDimensions:function(){var t=this.callSuper("_getCacheCanvasDimensions"),e=this.fontSize;return t.width+=e*t.zoomX,t.height+=e*t.zoomY,t},_render:function(t){var e=this.path;e&&!e.isNotVisible()&&e._render(t),this._setTextStyles(t),this._renderTextLinesBackground(t),this._renderTextDecoration(t,"underline"),this._renderText(t),this._renderTextDecoration(t,"overline"),this._renderTextDecoration(t,"linethrough")},_renderText:function(t){"stroke"===this.paintFirst?(this._renderTextStroke(t),this._renderTextFill(t)):(this._renderTextFill(t),this._renderTextStroke(t))},_setTextStyles:function(t,e,i){t.textBaseline="alphabetic",t.font=this._getFontDeclaration(e,i)},calcTextWidth:function(){for(var t=this.getLineWidth(0),e=1,i=this._textLines.length;e<i;e++){var n=this.getLineWidth(e);n>t&&(t=n)}return t},_renderTextLine:function(t,e,i,n,r,o){this._renderChars(t,e,i,n,r,o)},_renderTextLinesBackground:function(t){if(this.textBackgroundColor||this.styleHas("textBackgroundColor")){for(var e,i,n,r,o,a,s,c=t.fillStyle,l=this._getLeftOffset(),u=this._getTopOffset(),h=0,f=0,d=this.path,g=0,p=this._textLines.length;g<p;g++)if(e=this.getHeightOfLine(g),this.textBackgroundColor||this.styleHas("textBackgroundColor",g)){n=this._textLines[g],i=this._getLineLeftOffset(g),f=0,h=0,r=this.getValueOfPropertyAt(g,0,"textBackgroundColor");for(var v=0,m=n.length;v<m;v++)o=this.__charBounds[g][v],a=this.getValueOfPropertyAt(g,v,"textBackgroundColor"),d?(t.save(),t.translate(o.renderLeft,o.renderTop),t.rotate(o.angle),t.fillStyle=a,a&&t.fillRect(-o.width/2,-e/this.lineHeight*(1-this._fontSizeFraction),o.width,e/this.lineHeight),t.restore()):a!==r?(s=l+i+h,"rtl"===this.direction&&(s=this.width-s-f),t.fillStyle=r,r&&t.fillRect(s,u,f,e/this.lineHeight),h=o.left,f=o.width,r=a):f+=o.kernedWidth;a&&!d&&(s=l+i+h,"rtl"===this.direction&&(s=this.width-s-f),t.fillStyle=a,t.fillRect(s,u,f,e/this.lineHeight)),u+=e}else u+=e;t.fillStyle=c,this._removeShadow(t)}},getFontCache:function(t){var i=t.fontFamily.toLowerCase();e.charWidthsCache[i]||(e.charWidthsCache[i]={});var n=e.charWidthsCache[i],r=t.fontStyle.toLowerCase()+"_"+(t.fontWeight+"").toLowerCase();return n[r]||(n[r]={}),n[r]},_measureChar:function(t,e,i,n){var r,o,a,s,c=this.getFontCache(e),l=this._getFontDeclaration(e),u=this._getFontDeclaration(n),h=i+t,f=l===u,d=e.fontSize/this.CACHE_FONT_SIZE;if(i&&void 0!==c[i]&&(a=c[i]),void 0!==c[t]&&(s=r=c[t]),f&&void 0!==c[h]&&(o=c[h],s=o-a),void 0===r||void 0===a||void 0===o){var g=this.getMeasuringContext();this._setTextStyles(g,e,!0)}return void 0===r&&(s=r=g.measureText(t).width,c[t]=r),void 0===a&&f&&i&&(a=g.measureText(i).width,c[i]=a),f&&void 0===o&&(o=g.measureText(h).width,c[h]=o,s=o-a),{width:r*d,kernedWidth:s*d}},getHeightOfChar:function(t,e){return this.getValueOfPropertyAt(t,e,"fontSize")},measureLine:function(t){var e=this._measureLine(t);return 0!==this.charSpacing&&(e.width-=this._getWidthOfCharSpacing()),e.width<0&&(e.width=0),e},_measureLine:function(t){var i,n,r,o,a,s,c=0,l=this._textLines[t],u=0,h=new Array(l.length),f=0,d=this.path,g="right"===this.pathSide;for(this.__charBounds[t]=h,i=0;i<l.length;i++)n=l[i],o=this._getGraphemeBox(n,t,i,r),h[i]=o,c+=o.kernedWidth,r=n;if(h[i]={left:o?o.left+o.width:0,width:0,kernedWidth:0,height:this.fontSize},d){switch(s=d.segmentsInfo[d.segmentsInfo.length-1].length,a=e.util.getPointOnPath(d.path,0,d.segmentsInfo),a.x+=d.pathOffset.x,a.y+=d.pathOffset.y,this.textAlign){case"left":f=g?s-c:0;break;case"center":f=(s-c)/2;break;case"right":f=g?0:s-c;break}for(f+=this.pathStartOffset*(g?-1:1),i=g?l.length-1:0;g?i>=0:i<l.length;g?i--:i++)o=h[i],f>s?f%=s:f<0&&(f+=s),this._setGraphemeOnPath(f,o,a),f+=o.kernedWidth}return{width:c,numOfSpaces:u}},_setGraphemeOnPath:function(t,i,n){var r=t+i.kernedWidth/2,o=this.path,a=e.util.getPointOnPath(o.path,r,o.segmentsInfo);i.renderLeft=a.x-n.x,i.renderTop=a.y-n.y,i.angle=a.angle+("right"===this.pathSide?Math.PI:0)},_getGraphemeBox:function(t,e,i,n,r){var o,a=this.getCompleteStyleDeclaration(e,i),s=n?this.getCompleteStyleDeclaration(e,i-1):{},c=this._measureChar(t,a,n,s),l=c.kernedWidth,u=c.width;0!==this.charSpacing&&(o=this._getWidthOfCharSpacing(),u+=o,l+=o);var h={width:u,left:0,height:a.fontSize,kernedWidth:l,deltaY:a.deltaY};if(i>0&&!r){var f=this.__charBounds[e][i-1];h.left=f.left+f.width+c.kernedWidth-c.width}return h},getHeightOfLine:function(t){if(this.__lineHeights[t])return this.__lineHeights[t];for(var e=this._textLines[t],i=this.getHeightOfChar(t,0),n=1,r=e.length;n<r;n++)i=Math.max(this.getHeightOfChar(t,n),i);return this.__lineHeights[t]=i*this.lineHeight*this._fontSizeMult},calcTextHeight:function(){for(var t,e=0,i=0,n=this._textLines.length;i<n;i++)t=this.getHeightOfLine(i),e+=i===n-1?t/this.lineHeight:t;return e},_getLeftOffset:function(){return"ltr"===this.direction?-this.width/2:this.width/2},_getTopOffset:function(){return-this.height/2},_renderTextCommon:function(t,e){t.save();for(var i=0,n=this._getLeftOffset(),r=this._getTopOffset(),o=0,a=this._textLines.length;o<a;o++){var s=this.getHeightOfLine(o),c=s/this.lineHeight,l=this._getLineLeftOffset(o);this._renderTextLine(e,t,this._textLines[o],n+l,r+i+c,o),i+=s}t.restore()},_renderTextFill:function(t){(this.fill||this.styleHas("fill"))&&this._renderTextCommon(t,"fillText")},_renderTextStroke:function(t){(this.stroke&&0!==this.strokeWidth||!this.isEmptyStyles())&&(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(t),t.save(),this._setLineDash(t,this.strokeDashArray),t.beginPath(),this._renderTextCommon(t,"strokeText"),t.closePath(),t.restore())},_renderChars:function(t,e,i,n,r,o){var a,s,c,l,u,h=this.getHeightOfLine(o),f=-1!==this.textAlign.indexOf("justify"),d="",g=0,p=this.path,v=!f&&0===this.charSpacing&&this.isEmptyStyles(o)&&!p,m="ltr"===this.direction,y="ltr"===this.direction?1:-1;if(e.save(),r-=h*this._fontSizeFraction/this.lineHeight,v)return e.canvas.setAttribute("dir",m?"ltr":"rtl"),e.direction=m?"ltr":"rtl",e.textAlign=m?"left":"right",this._renderChar(t,e,o,0,i.join(""),n,r,h),void e.restore();for(var b=0,_=i.length-1;b<=_;b++)l=b===_||this.charSpacing||p,d+=i[b],c=this.__charBounds[o][b],0===g?(n+=y*(c.kernedWidth-c.width),g+=c.width):g+=c.kernedWidth,f&&!l&&this._reSpaceAndTab.test(i[b])&&(l=!0),l||(a=a||this.getCompleteStyleDeclaration(o,b),s=this.getCompleteStyleDeclaration(o,b+1),l=this._hasStyleChanged(a,s)),l&&(p?(e.save(),e.translate(c.renderLeft,c.renderTop),e.rotate(c.angle),this._renderChar(t,e,o,b,d,-g/2,0,h),e.restore()):(u=n,e.canvas.setAttribute("dir",m?"ltr":"rtl"),e.direction=m?"ltr":"rtl",e.textAlign=m?"left":"right",this._renderChar(t,e,o,b,d,u,r,h)),d="",a=s,n+=y*g,g=0);e.restore()},_applyPatternGradientTransformText:function(t){var i,n=e.util.createCanvasElement(),r=this.width+this.strokeWidth,o=this.height+this.strokeWidth;return n.width=r,n.height=o,i=n.getContext("2d"),i.beginPath(),i.moveTo(0,0),i.lineTo(r,0),i.lineTo(r,o),i.lineTo(0,o),i.closePath(),i.translate(r/2,o/2),i.fillStyle=t.toLive(i),this._applyPatternGradientTransform(i,t),i.fill(),i.createPattern(n,"no-repeat")},handleFiller:function(t,e,i){var n,r;return i.toLive?"percentage"===i.gradientUnits||i.gradientTransform||i.patternTransform?(n=-this.width/2,r=-this.height/2,t.translate(n,r),t[e]=this._applyPatternGradientTransformText(i),{offsetX:n,offsetY:r}):(t[e]=i.toLive(t,this),this._applyPatternGradientTransform(t,i)):(t[e]=i,{offsetX:0,offsetY:0})},_setStrokeStyles:function(t,e){return t.lineWidth=e.strokeWidth,t.lineCap=this.strokeLineCap,t.lineDashOffset=this.strokeDashOffset,t.lineJoin=this.strokeLineJoin,t.miterLimit=this.strokeMiterLimit,this.handleFiller(t,"strokeStyle",e.stroke)},_setFillStyles:function(t,e){return this.handleFiller(t,"fillStyle",e.fill)},_renderChar:function(t,e,i,n,r,o,a){var s,c,l=this._getStyleDeclaration(i,n),u=this.getCompleteStyleDeclaration(i,n),h="fillText"===t&&u.fill,f="strokeText"===t&&u.stroke&&u.strokeWidth;(f||h)&&(e.save(),h&&(s=this._setFillStyles(e,u)),f&&(c=this._setStrokeStyles(e,u)),e.font=this._getFontDeclaration(u),l&&l.textBackgroundColor&&this._removeShadow(e),l&&l.deltaY&&(a+=l.deltaY),h&&e.fillText(r,o-s.offsetX,a-s.offsetY),f&&e.strokeText(r,o-c.offsetX,a-c.offsetY),e.restore())},setSuperscript:function(t,e){return this._setScript(t,e,this.superscript)},setSubscript:function(t,e){return this._setScript(t,e,this.subscript)},_setScript:function(t,e,i){var n=this.get2DCursorLocation(t,!0),r=this.getValueOfPropertyAt(n.lineIndex,n.charIndex,"fontSize"),o=this.getValueOfPropertyAt(n.lineIndex,n.charIndex,"deltaY"),a={fontSize:r*i.size,deltaY:o+r*i.baseline};return this.setSelectionStyles(a,t,e),this},_hasStyleChanged:function(t,e){return t.fill!==e.fill||t.stroke!==e.stroke||t.strokeWidth!==e.strokeWidth||t.fontSize!==e.fontSize||t.fontFamily!==e.fontFamily||t.fontWeight!==e.fontWeight||t.fontStyle!==e.fontStyle||t.deltaY!==e.deltaY},_hasStyleChangedForSvg:function(t,e){return this._hasStyleChanged(t,e)||t.overline!==e.overline||t.underline!==e.underline||t.linethrough!==e.linethrough},_getLineLeftOffset:function(t){var e=this.getLineWidth(t),i=this.width-e,n=this.textAlign,r=this.direction,o=0,a=this.isEndOfWrapping(t);return"justify"===n||"justify-center"===n&&!a||"justify-right"===n&&!a||"justify-left"===n&&!a?0:("center"===n&&(o=i/2),"right"===n&&(o=i),"justify-center"===n&&(o=i/2),"justify-right"===n&&(o=i),"rtl"===r&&(o-=i),o)},_clearCache:function(){this.__lineWidths=[],this.__lineHeights=[],this.__charBounds=[]},_shouldClearDimensionCache:function(){var t=this._forceClearCache;return t||(t=this.hasStateChanged("_dimensionAffectingProps")),t&&(this.dirty=!0,this._forceClearCache=!1),t},getLineWidth:function(t){if(this.__lineWidths[t])return this.__lineWidths[t];var e,i,n=this._textLines[t];return""===n?e=0:(i=this.measureLine(t),e=i.width),this.__lineWidths[t]=e,e},_getWidthOfCharSpacing:function(){return 0!==this.charSpacing?this.fontSize*this.charSpacing/1e3:0},getValueOfPropertyAt:function(t,e,i){var n=this._getStyleDeclaration(t,e);return n&&"undefined"!==typeof n[i]?n[i]:this[i]},_renderTextDecoration:function(t,e){if(this[e]||this.styleHas(e)){for(var i,n,r,o,a,s,c,l,u,h,f,d,g,p,v,m,y=this._getLeftOffset(),b=this._getTopOffset(),_=this.path,x=this._getWidthOfCharSpacing(),C=this.offsets[e],I=0,M=this._textLines.length;I<M;I++)if(i=this.getHeightOfLine(I),this[e]||this.styleHas(e,I)){c=this._textLines[I],p=i/this.lineHeight,o=this._getLineLeftOffset(I),h=0,f=0,l=this.getValueOfPropertyAt(I,0,e),m=this.getValueOfPropertyAt(I,0,"fill"),u=b+p*(1-this._fontSizeFraction),n=this.getHeightOfChar(I,0),a=this.getValueOfPropertyAt(I,0,"deltaY");for(var S=0,w=c.length;S<w;S++)if(d=this.__charBounds[I][S],g=this.getValueOfPropertyAt(I,S,e),v=this.getValueOfPropertyAt(I,S,"fill"),r=this.getHeightOfChar(I,S),s=this.getValueOfPropertyAt(I,S,"deltaY"),_&&g&&v)t.save(),t.fillStyle=m,t.translate(d.renderLeft,d.renderTop),t.rotate(d.angle),t.fillRect(-d.kernedWidth/2,C*r+s,d.kernedWidth,this.fontSize/15),t.restore();else if((g!==l||v!==m||r!==n||s!==a)&&f>0){var T=y+o+h;"rtl"===this.direction&&(T=this.width-T-f),l&&m&&(t.fillStyle=m,t.fillRect(T,u+C*n+a,f,this.fontSize/15)),h=d.left,f=d.width,l=g,m=v,n=r,a=s}else f+=d.kernedWidth;T=y+o+h;"rtl"===this.direction&&(T=this.width-T-f),t.fillStyle=v,g&&v&&t.fillRect(T,u+C*n+a,f-x,this.fontSize/15),b+=i}else b+=i;this._removeShadow(t)}},_getFontDeclaration:function(t,i){var n=t||this,r=this.fontFamily,o=e.Text.genericFonts.indexOf(r.toLowerCase())>-1,a=void 0===r||r.indexOf("'")>-1||r.indexOf(",")>-1||r.indexOf('"')>-1||o?n.fontFamily:'"'+n.fontFamily+'"';return[e.isLikelyNode?n.fontWeight:n.fontStyle,e.isLikelyNode?n.fontStyle:n.fontWeight,i?this.CACHE_FONT_SIZE+"px":n.fontSize+"px",a].join(" ")},render:function(t){this.visible&&(this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(this._shouldClearDimensionCache()&&this.initDimensions(),this.callSuper("render",t)))},_splitTextIntoLines:function(t){for(var i=t.split(this._reNewline),n=new Array(i.length),r=["\n"],o=[],a=0;a<i.length;a++)n[a]=e.util.string.graphemeSplit(i[a]),o=o.concat(n[a],r);return o.pop(),{_unwrappedLines:n,lines:i,graphemeText:o,graphemeLines:n}},toObject:function(t){var e=n.concat(t),r=this.callSuper("toObject",e);return r.styles=i(this.styles,!0),r.path&&(r.path=this.path.toObject()),r},set:function(t,e){this.callSuper("set",t,e);var i=!1,n=!1;if("object"===typeof t)for(var r in t)"path"===r&&this.setPathInfo(),i=i||-1!==this._dimensionAffectingProps.indexOf(r),n=n||"path"===r;else i=-1!==this._dimensionAffectingProps.indexOf(t),n="path"===t;return n&&this.setPathInfo(),i&&(this.initDimensions(),this.setCoords()),this},complexity:function(){return 1}}),e.Text.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat("x y dx dy font-family font-style font-weight font-size letter-spacing text-decoration text-anchor".split(" ")),e.Text.DEFAULT_SVG_FONT_SIZE=16,e.Text.fromElement=function(t,n,r){if(!t)return n(null);var o=e.parseAttributes(t,e.Text.ATTRIBUTE_NAMES),a=o.textAnchor||"left";if(r=e.util.object.extend(r?i(r):{},o),r.top=r.top||0,r.left=r.left||0,o.textDecoration){var s=o.textDecoration;-1!==s.indexOf("underline")&&(r.underline=!0),-1!==s.indexOf("overline")&&(r.overline=!0),-1!==s.indexOf("line-through")&&(r.linethrough=!0),delete r.textDecoration}"dx"in o&&(r.left+=o.dx),"dy"in o&&(r.top+=o.dy),"fontSize"in r||(r.fontSize=e.Text.DEFAULT_SVG_FONT_SIZE);var c="";"textContent"in t?c=t.textContent:"firstChild"in t&&null!==t.firstChild&&"data"in t.firstChild&&null!==t.firstChild.data&&(c=t.firstChild.data),c=c.replace(/^\s+|\s+$|\n+/g,"").replace(/\s+/g," ");var l=r.strokeWidth;r.strokeWidth=0;var u=new e.Text(c,r),h=u.getScaledHeight()/u.height,f=(u.height+u.strokeWidth)*u.lineHeight-u.height,d=f*h,g=u.getScaledHeight()+d,p=0;"center"===a&&(p=u.getScaledWidth()/2),"right"===a&&(p=u.getScaledWidth()),u.set({left:u.left-p,top:u.top-(g-u.fontSize*(.07+u._fontSizeFraction))/u.lineHeight,strokeWidth:"undefined"!==typeof l?l:1}),n(u)},e.Text.fromObject=function(t,n){var r=i(t),o=t.path;return delete r.path,e.Object._fromObject("Text",r,(function(t){o?e.Object._fromObject("Path",o,(function(e){t.set("path",e),n(t)}),"path"):n(t)}),"text")},e.Text.genericFonts=["sans-serif","serif","cursive","fantasy","monospace"],e.util.createAccessors&&e.util.createAccessors(e.Text)}}(i),function(){r.util.object.extend(r.Text.prototype,{isEmptyStyles:function(t){if(!this.styles)return!0;if("undefined"!==typeof t&&!this.styles[t])return!0;var e="undefined"===typeof t?this.styles:{line:this.styles[t]};for(var i in e)for(var n in e[i])for(var r in e[i][n])return!1;return!0},styleHas:function(t,e){if(!this.styles||!t||""===t)return!1;if("undefined"!==typeof e&&!this.styles[e])return!1;var i="undefined"===typeof e?this.styles:{0:this.styles[e]};for(var n in i)for(var r in i[n])if("undefined"!==typeof i[n][r][t])return!0;return!1},cleanStyle:function(t){if(!this.styles||!t||""===t)return!1;var e,i,n=this.styles,r=0,o=!0,a=0;for(var s in n){for(var c in e=0,n[s]){var l=n[s][c],u=l.hasOwnProperty(t);r++,u?(i?l[t]!==i&&(o=!1):i=l[t],l[t]===this[t]&&delete l[t]):o=!1,0!==Object.keys(l).length?e++:delete n[s][c]}0===e&&delete n[s]}for(var h=0;h<this._textLines.length;h++)a+=this._textLines[h].length;o&&r===a&&(this[t]=i,this.removeStyle(t))},removeStyle:function(t){if(this.styles&&t&&""!==t){var e,i,n,r=this.styles;for(i in r){for(n in e=r[i],e)delete e[n][t],0===Object.keys(e[n]).length&&delete e[n];0===Object.keys(e).length&&delete r[i]}}},_extendStyles:function(t,e){var i=this.get2DCursorLocation(t);this._getLineStyle(i.lineIndex)||this._setLineStyle(i.lineIndex),this._getStyleDeclaration(i.lineIndex,i.charIndex)||this._setStyleDeclaration(i.lineIndex,i.charIndex,{}),r.util.object.extend(this._getStyleDeclaration(i.lineIndex,i.charIndex),e)},get2DCursorLocation:function(t,e){"undefined"===typeof t&&(t=this.selectionStart);for(var i=e?this._unwrappedTextLines:this._textLines,n=i.length,r=0;r<n;r++){if(t<=i[r].length)return{lineIndex:r,charIndex:t};t-=i[r].length+this.missingNewlineOffset(r)}return{lineIndex:r-1,charIndex:i[r-1].length<t?i[r-1].length:t}},getSelectionStyles:function(t,e,i){"undefined"===typeof t&&(t=this.selectionStart||0),"undefined"===typeof e&&(e=this.selectionEnd||t);for(var n=[],r=t;r<e;r++)n.push(this.getStyleAtPosition(r,i));return n},getStyleAtPosition:function(t,e){var i=this.get2DCursorLocation(t),n=e?this.getCompleteStyleDeclaration(i.lineIndex,i.charIndex):this._getStyleDeclaration(i.lineIndex,i.charIndex);return n||{}},setSelectionStyles:function(t,e,i){"undefined"===typeof e&&(e=this.selectionStart||0),"undefined"===typeof i&&(i=this.selectionEnd||e);for(var n=e;n<i;n++)this._extendStyles(n,t);return this._forceClearCache=!0,this},_getStyleDeclaration:function(t,e){var i=this.styles&&this.styles[t];return i?i[e]:null},getCompleteStyleDeclaration:function(t,e){for(var i,n=this._getStyleDeclaration(t,e)||{},r={},o=0;o<this._styleProperties.length;o++)i=this._styleProperties[o],r[i]="undefined"===typeof n[i]?this[i]:n[i];return r},_setStyleDeclaration:function(t,e,i){this.styles[t][e]=i},_deleteStyleDeclaration:function(t,e){delete this.styles[t][e]},_getLineStyle:function(t){return!!this.styles[t]},_setLineStyle:function(t){this.styles[t]={}},_deleteLineStyle:function(t){delete this.styles[t]}})}(),function(){function t(t){t.textDecoration&&(t.textDecoration.indexOf("underline")>-1&&(t.underline=!0),t.textDecoration.indexOf("line-through")>-1&&(t.linethrough=!0),t.textDecoration.indexOf("overline")>-1&&(t.overline=!0),delete t.textDecoration)}r.IText=r.util.createClass(r.Text,r.Observable,{type:"i-text",selectionStart:0,selectionEnd:0,selectionColor:"rgba(17,119,255,0.3)",isEditing:!1,editable:!0,editingBorderColor:"rgba(102,153,255,0.25)",cursorWidth:2,cursorColor:"",cursorDelay:1e3,cursorDuration:600,caching:!0,hiddenTextareaContainer:null,_reSpace:/\s|\n/,_currentCursorOpacity:0,_selectionDirection:null,_abortCursorAnimation:!1,__widthOfSpace:[],inCompositionMode:!1,initialize:function(t,e){this.callSuper("initialize",t,e),this.initBehavior()},setSelectionStart:function(t){t=Math.max(t,0),this._updateAndFire("selectionStart",t)},setSelectionEnd:function(t){t=Math.min(t,this.text.length),this._updateAndFire("selectionEnd",t)},_updateAndFire:function(t,e){this[t]!==e&&(this._fireSelectionChanged(),this[t]=e),this._updateTextarea()},_fireSelectionChanged:function(){this.fire("selection:changed"),this.canvas&&this.canvas.fire("text:selection:changed",{target:this})},initDimensions:function(){this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this.callSuper("initDimensions")},render:function(t){this.clearContextTop(),this.callSuper("render",t),this.cursorOffsetCache={},this.renderCursorOrSelection()},_render:function(t){this.callSuper("_render",t)},clearContextTop:function(t){if(this.isEditing&&this.canvas&&this.canvas.contextTop){var e=this.canvas.contextTop,i=this.canvas.viewportTransform;e.save(),e.transform(i[0],i[1],i[2],i[3],i[4],i[5]),this.transform(e),this._clearTextArea(e),t||e.restore()}},renderCursorOrSelection:function(){if(this.isEditing&&this.canvas&&this.canvas.contextTop){var t=this._getCursorBoundaries(),e=this.canvas.contextTop;this.clearContextTop(!0),this.selectionStart===this.selectionEnd?this.renderCursor(t,e):this.renderSelection(t,e),e.restore()}},_clearTextArea:function(t){var e=this.width+4,i=this.height+4;t.clearRect(-e/2,-i/2,e,i)},_getCursorBoundaries:function(t){"undefined"===typeof t&&(t=this.selectionStart);var e=this._getLeftOffset(),i=this._getTopOffset(),n=this._getCursorBoundariesOffsets(t);return{left:e,top:i,leftOffset:n.left,topOffset:n.top}},_getCursorBoundariesOffsets:function(t){if(this.cursorOffsetCache&&"top"in this.cursorOffsetCache)return this.cursorOffsetCache;var e,i,n,r,o=0,a=0,s=this.get2DCursorLocation(t);n=s.charIndex,i=s.lineIndex;for(var c=0;c<i;c++)o+=this.getHeightOfLine(c);e=this._getLineLeftOffset(i);var l=this.__charBounds[i][n];return l&&(a=l.left),0!==this.charSpacing&&n===this._textLines[i].length&&(a-=this._getWidthOfCharSpacing()),r={top:o,left:e+(a>0?a:0)},"rtl"===this.direction&&(r.left*=-1),this.cursorOffsetCache=r,this.cursorOffsetCache},renderCursor:function(t,e){var i=this.get2DCursorLocation(),n=i.lineIndex,r=i.charIndex>0?i.charIndex-1:0,o=this.getValueOfPropertyAt(n,r,"fontSize"),a=this.scaleX*this.canvas.getZoom(),s=this.cursorWidth/a,c=t.topOffset,l=this.getValueOfPropertyAt(n,r,"deltaY");c+=(1-this._fontSizeFraction)*this.getHeightOfLine(n)/this.lineHeight-o*(1-this._fontSizeFraction),this.inCompositionMode&&this.renderSelection(t,e),e.fillStyle=this.cursorColor||this.getValueOfPropertyAt(n,r,"fill"),e.globalAlpha=this.__isMousedown?1:this._currentCursorOpacity,e.fillRect(t.left+t.leftOffset-s/2,c+t.top+l,s,o)},renderSelection:function(t,e){for(var i=this.inCompositionMode?this.hiddenTextarea.selectionStart:this.selectionStart,n=this.inCompositionMode?this.hiddenTextarea.selectionEnd:this.selectionEnd,r=-1!==this.textAlign.indexOf("justify"),o=this.get2DCursorLocation(i),a=this.get2DCursorLocation(n),s=o.lineIndex,c=a.lineIndex,l=o.charIndex<0?0:o.charIndex,u=a.charIndex<0?0:a.charIndex,h=s;h<=c;h++){var f=this._getLineLeftOffset(h)||0,d=this.getHeightOfLine(h),g=0,p=0,v=0;if(h===s&&(p=this.__charBounds[s][l].left),h>=s&&h<c)v=r&&!this.isEndOfWrapping(h)?this.width:this.getLineWidth(h)||5;else if(h===c)if(0===u)v=this.__charBounds[c][u].left;else{var m=this._getWidthOfCharSpacing();v=this.__charBounds[c][u-1].left+this.__charBounds[c][u-1].width-m}g=d,(this.lineHeight<1||h===c&&this.lineHeight>1)&&(d/=this.lineHeight);var y=t.left+f+p,b=v-p,_=d,x=0;this.inCompositionMode?(e.fillStyle=this.compositionColor||"black",_=1,x=d):e.fillStyle=this.selectionColor,"rtl"===this.direction&&(y=this.width-y-b),e.fillRect(y,t.top+t.topOffset+x,b,_),t.topOffset+=g}},getCurrentCharFontSize:function(){var t=this._getCurrentCharIndex();return this.getValueOfPropertyAt(t.l,t.c,"fontSize")},getCurrentCharColor:function(){var t=this._getCurrentCharIndex();return this.getValueOfPropertyAt(t.l,t.c,"fill")},_getCurrentCharIndex:function(){var t=this.get2DCursorLocation(this.selectionStart,!0),e=t.charIndex>0?t.charIndex-1:0;return{l:t.lineIndex,c:e}}}),r.IText.fromObject=function(e,i){if(t(e),e.styles)for(var n in e.styles)for(var o in e.styles[n])t(e.styles[n][o]);r.Object._fromObject("IText",e,i,"text")}}(),function(){var t=r.util.object.clone;r.util.object.extend(r.IText.prototype,{initBehavior:function(){this.initAddedHandler(),this.initRemovedHandler(),this.initCursorSelectionHandlers(),this.initDoubleClickSimulation(),this.mouseMoveHandler=this.mouseMoveHandler.bind(this)},onDeselect:function(){this.isEditing&&this.exitEditing(),this.selected=!1},initAddedHandler:function(){var t=this;this.on("added",(function(){var e=t.canvas;e&&(e._hasITextHandlers||(e._hasITextHandlers=!0,t._initCanvasHandlers(e)),e._iTextInstances=e._iTextInstances||[],e._iTextInstances.push(t))}))},initRemovedHandler:function(){var t=this;this.on("removed",(function(){var e=t.canvas;e&&(e._iTextInstances=e._iTextInstances||[],r.util.removeFromArray(e._iTextInstances,t),0===e._iTextInstances.length&&(e._hasITextHandlers=!1,t._removeCanvasHandlers(e)))}))},_initCanvasHandlers:function(t){t._mouseUpITextHandler=function(){t._iTextInstances&&t._iTextInstances.forEach((function(t){t.__isMousedown=!1}))},t.on("mouse:up",t._mouseUpITextHandler)},_removeCanvasHandlers:function(t){t.off("mouse:up",t._mouseUpITextHandler)},_tick:function(){this._currentTickState=this._animateCursor(this,1,this.cursorDuration,"_onTickComplete")},_animateCursor:function(t,e,i,n){var r;return r={isAborted:!1,abort:function(){this.isAborted=!0}},t.animate("_currentCursorOpacity",e,{duration:i,onComplete:function(){r.isAborted||t[n]()},onChange:function(){t.canvas&&t.selectionStart===t.selectionEnd&&t.renderCursorOrSelection()},abort:function(){return r.isAborted}}),r},_onTickComplete:function(){var t=this;this._cursorTimeout1&&clearTimeout(this._cursorTimeout1),this._cursorTimeout1=setTimeout((function(){t._currentTickCompleteState=t._animateCursor(t,0,this.cursorDuration/2,"_tick")}),100)},initDelayedCursor:function(t){var e=this,i=t?0:this.cursorDelay;this.abortCursorAnimation(),this._currentCursorOpacity=1,this._cursorTimeout2=setTimeout((function(){e._tick()}),i)},abortCursorAnimation:function(){var t=this._currentTickState||this._currentTickCompleteState,e=this.canvas;this._currentTickState&&this._currentTickState.abort(),this._currentTickCompleteState&&this._currentTickCompleteState.abort(),clearTimeout(this._cursorTimeout1),clearTimeout(this._cursorTimeout2),this._currentCursorOpacity=0,t&&e&&e.clearContext(e.contextTop||e.contextContainer)},selectAll:function(){return this.selectionStart=0,this.selectionEnd=this._text.length,this._fireSelectionChanged(),this._updateTextarea(),this},getSelectedText:function(){return this._text.slice(this.selectionStart,this.selectionEnd).join("")},findWordBoundaryLeft:function(t){var e=0,i=t-1;if(this._reSpace.test(this._text[i]))while(this._reSpace.test(this._text[i]))e++,i--;while(/\S/.test(this._text[i])&&i>-1)e++,i--;return t-e},findWordBoundaryRight:function(t){var e=0,i=t;if(this._reSpace.test(this._text[i]))while(this._reSpace.test(this._text[i]))e++,i++;while(/\S/.test(this._text[i])&&i<this._text.length)e++,i++;return t+e},findLineBoundaryLeft:function(t){var e=0,i=t-1;while(!/\n/.test(this._text[i])&&i>-1)e++,i--;return t-e},findLineBoundaryRight:function(t){var e=0,i=t;while(!/\n/.test(this._text[i])&&i<this._text.length)e++,i++;return t+e},searchWordBoundary:function(t,e){var i=this._text,n=this._reSpace.test(i[t])?t-1:t,o=i[n],a=r.reNonWord;while(!a.test(o)&&n>0&&n<i.length)n+=e,o=i[n];return a.test(o)&&(n+=1===e?0:1),n},selectWord:function(t){t=t||this.selectionStart;var e=this.searchWordBoundary(t,-1),i=this.searchWordBoundary(t,1);this.selectionStart=e,this.selectionEnd=i,this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()},selectLine:function(t){t=t||this.selectionStart;var e=this.findLineBoundaryLeft(t),i=this.findLineBoundaryRight(t);return this.selectionStart=e,this.selectionEnd=i,this._fireSelectionChanged(),this._updateTextarea(),this},enterEditing:function(t){if(!this.isEditing&&this.editable)return this.canvas&&(this.canvas.calcOffset(),this.exitEditingOnOthers(this.canvas)),this.isEditing=!0,this.initHiddenTextarea(t),this.hiddenTextarea.focus(),this.hiddenTextarea.value=this.text,this._updateTextarea(),this._saveEditingProps(),this._setEditingProps(),this._textBeforeEdit=this.text,this._tick(),this.fire("editing:entered"),this._fireSelectionChanged(),this.canvas?(this.canvas.fire("text:editing:entered",{target:this}),this.initMouseMoveHandler(),this.canvas.requestRenderAll(),this):this},exitEditingOnOthers:function(t){t._iTextInstances&&t._iTextInstances.forEach((function(t){t.selected=!1,t.isEditing&&t.exitEditing()}))},initMouseMoveHandler:function(){this.canvas.on("mouse:move",this.mouseMoveHandler)},mouseMoveHandler:function(t){if(this.__isMousedown&&this.isEditing){var e=this.getSelectionStartFromPointer(t.e),i=this.selectionStart,n=this.selectionEnd;(e===this.__selectionStartOnMouseDown&&i!==n||i!==e&&n!==e)&&(e>this.__selectionStartOnMouseDown?(this.selectionStart=this.__selectionStartOnMouseDown,this.selectionEnd=e):(this.selectionStart=e,this.selectionEnd=this.__selectionStartOnMouseDown),this.selectionStart===i&&this.selectionEnd===n||(this.restartCursorIfNeeded(),this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()))}},_setEditingProps:function(){this.hoverCursor="text",this.canvas&&(this.canvas.defaultCursor=this.canvas.moveCursor="text"),this.borderColor=this.editingBorderColor,this.hasControls=this.selectable=!1,this.lockMovementX=this.lockMovementY=!0},fromStringToGraphemeSelection:function(t,e,i){var n=i.slice(0,t),o=r.util.string.graphemeSplit(n).length;if(t===e)return{selectionStart:o,selectionEnd:o};var a=i.slice(t,e),s=r.util.string.graphemeSplit(a).length;return{selectionStart:o,selectionEnd:o+s}},fromGraphemeToStringSelection:function(t,e,i){var n=i.slice(0,t),r=n.join("").length;if(t===e)return{selectionStart:r,selectionEnd:r};var o=i.slice(t,e),a=o.join("").length;return{selectionStart:r,selectionEnd:r+a}},_updateTextarea:function(){if(this.cursorOffsetCache={},this.hiddenTextarea){if(!this.inCompositionMode){var t=this.fromGraphemeToStringSelection(this.selectionStart,this.selectionEnd,this._text);this.hiddenTextarea.selectionStart=t.selectionStart,this.hiddenTextarea.selectionEnd=t.selectionEnd}this.updateTextareaPosition()}},updateFromTextArea:function(){if(this.hiddenTextarea){this.cursorOffsetCache={},this.text=this.hiddenTextarea.value,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords());var t=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value);this.selectionEnd=this.selectionStart=t.selectionEnd,this.inCompositionMode||(this.selectionStart=t.selectionStart),this.updateTextareaPosition()}},updateTextareaPosition:function(){if(this.selectionStart===this.selectionEnd){var t=this._calcTextareaPosition();this.hiddenTextarea.style.left=t.left,this.hiddenTextarea.style.top=t.top}},_calcTextareaPosition:function(){if(!this.canvas)return{x:1,y:1};var t=this.inCompositionMode?this.compositionStart:this.selectionStart,e=this._getCursorBoundaries(t),i=this.get2DCursorLocation(t),n=i.lineIndex,o=i.charIndex,a=this.getValueOfPropertyAt(n,o,"fontSize")*this.lineHeight,s=e.leftOffset,c=this.calcTransformMatrix(),l={x:e.left+s,y:e.top+e.topOffset+a},u=this.canvas.getRetinaScaling(),h=this.canvas.upperCanvasEl,f=h.width/u,d=h.height/u,g=f-a,p=d-a,v=h.clientWidth/f,m=h.clientHeight/d;return l=r.util.transformPoint(l,c),l=r.util.transformPoint(l,this.canvas.viewportTransform),l.x*=v,l.y*=m,l.x<0&&(l.x=0),l.x>g&&(l.x=g),l.y<0&&(l.y=0),l.y>p&&(l.y=p),l.x+=this.canvas._offset.left,l.y+=this.canvas._offset.top,{left:l.x+"px",top:l.y+"px",fontSize:a+"px",charHeight:a}},_saveEditingProps:function(){this._savedProps={hasControls:this.hasControls,borderColor:this.borderColor,lockMovementX:this.lockMovementX,lockMovementY:this.lockMovementY,hoverCursor:this.hoverCursor,selectable:this.selectable,defaultCursor:this.canvas&&this.canvas.defaultCursor,moveCursor:this.canvas&&this.canvas.moveCursor}},_restoreEditingProps:function(){this._savedProps&&(this.hoverCursor=this._savedProps.hoverCursor,this.hasControls=this._savedProps.hasControls,this.borderColor=this._savedProps.borderColor,this.selectable=this._savedProps.selectable,this.lockMovementX=this._savedProps.lockMovementX,this.lockMovementY=this._savedProps.lockMovementY,this.canvas&&(this.canvas.defaultCursor=this._savedProps.defaultCursor,this.canvas.moveCursor=this._savedProps.moveCursor))},exitEditing:function(){var t=this._textBeforeEdit!==this.text,e=this.hiddenTextarea;return this.selected=!1,this.isEditing=!1,this.selectionEnd=this.selectionStart,e&&(e.blur&&e.blur(),e.parentNode&&e.parentNode.removeChild(e)),this.hiddenTextarea=null,this.abortCursorAnimation(),this._restoreEditingProps(),this._currentCursorOpacity=0,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this.fire("editing:exited"),t&&this.fire("modified"),this.canvas&&(this.canvas.off("mouse:move",this.mouseMoveHandler),this.canvas.fire("text:editing:exited",{target:this}),t&&this.canvas.fire("object:modified",{target:this})),this},_removeExtraneousStyles:function(){for(var t in this.styles)this._textLines[t]||delete this.styles[t]},removeStyleFromTo:function(t,e){var i,n,r=this.get2DCursorLocation(t,!0),o=this.get2DCursorLocation(e,!0),a=r.lineIndex,s=r.charIndex,c=o.lineIndex,l=o.charIndex;if(a!==c){if(this.styles[a])for(i=s;i<this._unwrappedTextLines[a].length;i++)delete this.styles[a][i];if(this.styles[c])for(i=l;i<this._unwrappedTextLines[c].length;i++)n=this.styles[c][i],n&&(this.styles[a]||(this.styles[a]={}),this.styles[a][s+i-l]=n);for(i=a+1;i<=c;i++)delete this.styles[i];this.shiftLineStyles(c,a-c)}else if(this.styles[a]){n=this.styles[a];var u,h,f=l-s;for(i=s;i<l;i++)delete n[i];for(h in this.styles[a])u=parseInt(h,10),u>=l&&(n[u-f]=n[h],delete n[h])}},shiftLineStyles:function(e,i){var n=t(this.styles);for(var r in this.styles){var o=parseInt(r,10);o>e&&(this.styles[o+i]=n[o],n[o-i]||delete this.styles[o])}},restartCursorIfNeeded:function(){this._currentTickState&&!this._currentTickState.isAborted&&this._currentTickCompleteState&&!this._currentTickCompleteState.isAborted||this.initDelayedCursor()},insertNewlineStyleObject:function(e,i,n,r){var o,a={},s=!1,c=this._unwrappedTextLines[e].length===i;for(var l in n||(n=1),this.shiftLineStyles(e,n),this.styles[e]&&(o=this.styles[e][0===i?i:i-1]),this.styles[e]){var u=parseInt(l,10);u>=i&&(s=!0,a[u-i]=this.styles[e][l],c&&0===i||delete this.styles[e][l])}var h=!1;s&&!c&&(this.styles[e+n]=a,h=!0),h&&n--;while(n>0)r&&r[n-1]?this.styles[e+n]={0:t(r[n-1])}:o?this.styles[e+n]={0:t(o)}:delete this.styles[e+n],n--;this._forceClearCache=!0},insertCharStyleObject:function(e,i,n,r){this.styles||(this.styles={});var o=this.styles[e],a=o?t(o):{};for(var s in n||(n=1),a){var c=parseInt(s,10);c>=i&&(o[c+n]=a[c],a[c-n]||delete o[c])}if(this._forceClearCache=!0,r)while(n--)Object.keys(r[n]).length&&(this.styles[e]||(this.styles[e]={}),this.styles[e][i+n]=t(r[n]));else if(o){var l=o[i?i-1:1];while(l&&n--)this.styles[e][i+n]=t(l)}},insertNewStyleBlock:function(t,e,i){for(var n=this.get2DCursorLocation(e,!0),r=[0],o=0,a=0;a<t.length;a++)"\n"===t[a]?(o++,r[o]=0):r[o]++;r[0]>0&&(this.insertCharStyleObject(n.lineIndex,n.charIndex,r[0],i),i=i&&i.slice(r[0]+1)),o&&this.insertNewlineStyleObject(n.lineIndex,n.charIndex+r[0],o);for(a=1;a<o;a++)r[a]>0?this.insertCharStyleObject(n.lineIndex+a,0,r[a],i):i&&(this.styles[n.lineIndex+a][0]=i[0]),i=i&&i.slice(r[a]+1);r[a]>0&&this.insertCharStyleObject(n.lineIndex+a,0,r[a],i)},setSelectionStartEndWithShift:function(t,e,i){i<=t?(e===t?this._selectionDirection="left":"right"===this._selectionDirection&&(this._selectionDirection="left",this.selectionEnd=t),this.selectionStart=i):i>t&&i<e?"right"===this._selectionDirection?this.selectionEnd=i:this.selectionStart=i:(e===t?this._selectionDirection="right":"left"===this._selectionDirection&&(this._selectionDirection="right",this.selectionStart=e),this.selectionEnd=i)},setSelectionInBoundaries:function(){var t=this.text.length;this.selectionStart>t?this.selectionStart=t:this.selectionStart<0&&(this.selectionStart=0),this.selectionEnd>t?this.selectionEnd=t:this.selectionEnd<0&&(this.selectionEnd=0)}})}(),r.util.object.extend(r.IText.prototype,{initDoubleClickSimulation:function(){this.__lastClickTime=+new Date,this.__lastLastClickTime=+new Date,this.__lastPointer={},this.on("mousedown",this.onMouseDown)},onMouseDown:function(t){if(this.canvas){this.__newClickTime=+new Date;var e=t.pointer;this.isTripleClick(e)&&(this.fire("tripleclick",t),this._stopEvent(t.e)),this.__lastLastClickTime=this.__lastClickTime,this.__lastClickTime=this.__newClickTime,this.__lastPointer=e,this.__lastIsEditing=this.isEditing,this.__lastSelected=this.selected}},isTripleClick:function(t){return this.__newClickTime-this.__lastClickTime<500&&this.__lastClickTime-this.__lastLastClickTime<500&&this.__lastPointer.x===t.x&&this.__lastPointer.y===t.y},_stopEvent:function(t){t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation()},initCursorSelectionHandlers:function(){this.initMousedownHandler(),this.initMouseupHandler(),this.initClicks()},doubleClickHandler:function(t){this.isEditing&&this.selectWord(this.getSelectionStartFromPointer(t.e))},tripleClickHandler:function(t){this.isEditing&&this.selectLine(this.getSelectionStartFromPointer(t.e))},initClicks:function(){this.on("mousedblclick",this.doubleClickHandler),this.on("tripleclick",this.tripleClickHandler)},_mouseDownHandler:function(t){!this.canvas||!this.editable||t.e.button&&1!==t.e.button||(this.__isMousedown=!0,this.selected&&(this.inCompositionMode=!1,this.setCursorByClick(t.e)),this.isEditing&&(this.__selectionStartOnMouseDown=this.selectionStart,this.selectionStart===this.selectionEnd&&this.abortCursorAnimation(),this.renderCursorOrSelection()))},_mouseDownHandlerBefore:function(t){!this.canvas||!this.editable||t.e.button&&1!==t.e.button||(this.selected=this===this.canvas._activeObject)},initMousedownHandler:function(){this.on("mousedown",this._mouseDownHandler),this.on("mousedown:before",this._mouseDownHandlerBefore)},initMouseupHandler:function(){this.on("mouseup",this.mouseUpHandler)},mouseUpHandler:function(t){if(this.__isMousedown=!1,!(!this.editable||this.group||t.transform&&t.transform.actionPerformed||t.e.button&&1!==t.e.button)){if(this.canvas){var e=this.canvas._activeObject;if(e&&e!==this)return}this.__lastSelected&&!this.__corner?(this.selected=!1,this.__lastSelected=!1,this.enterEditing(t.e),this.selectionStart===this.selectionEnd?this.initDelayedCursor(!0):this.renderCursorOrSelection()):this.selected=!0}},setCursorByClick:function(t){var e=this.getSelectionStartFromPointer(t),i=this.selectionStart,n=this.selectionEnd;t.shiftKey?this.setSelectionStartEndWithShift(i,n,e):(this.selectionStart=e,this.selectionEnd=e),this.isEditing&&(this._fireSelectionChanged(),this._updateTextarea())},getSelectionStartFromPointer:function(t){for(var e,i,n=this.getLocalPointer(t),r=0,o=0,a=0,s=0,c=0,l=0,u=this._textLines.length;l<u;l++){if(!(a<=n.y))break;a+=this.getHeightOfLine(l)*this.scaleY,c=l,l>0&&(s+=this._textLines[l-1].length+this.missingNewlineOffset(l-1))}e=this._getLineLeftOffset(c),o=e*this.scaleX,i=this._textLines[c],"rtl"===this.direction&&(n.x=this.width*this.scaleX-n.x+o);for(var h=0,f=i.length;h<f;h++){if(r=o,o+=this.__charBounds[c][h].kernedWidth*this.scaleX,!(o<=n.x))break;s++}return this._getNewSelectionStartFromOffset(n,r,o,s,f)},_getNewSelectionStartFromOffset:function(t,e,i,n,r){var o=t.x-e,a=i-t.x,s=a>o||a<0?0:1,c=n+s;return this.flipX&&(c=r-c),c>this._text.length&&(c=this._text.length),c}}),r.util.object.extend(r.IText.prototype,{initHiddenTextarea:function(){this.hiddenTextarea=r.document.createElement("textarea"),this.hiddenTextarea.setAttribute("autocapitalize","off"),this.hiddenTextarea.setAttribute("autocorrect","off"),this.hiddenTextarea.setAttribute("autocomplete","off"),this.hiddenTextarea.setAttribute("spellcheck","false"),this.hiddenTextarea.setAttribute("data-fabric-hiddentextarea",""),this.hiddenTextarea.setAttribute("wrap","off");var t=this._calcTextareaPosition();this.hiddenTextarea.style.cssText="position: absolute; top: "+t.top+"; left: "+t.left+"; z-index: -999; opacity: 0; width: 1px; height: 1px; font-size: 1px; paddingーtop: "+t.fontSize+";",this.hiddenTextareaContainer?this.hiddenTextareaContainer.appendChild(this.hiddenTextarea):r.document.body.appendChild(this.hiddenTextarea),r.util.addListener(this.hiddenTextarea,"keydown",this.onKeyDown.bind(this)),r.util.addListener(this.hiddenTextarea,"keyup",this.onKeyUp.bind(this)),r.util.addListener(this.hiddenTextarea,"input",this.onInput.bind(this)),r.util.addListener(this.hiddenTextarea,"copy",this.copy.bind(this)),r.util.addListener(this.hiddenTextarea,"cut",this.copy.bind(this)),r.util.addListener(this.hiddenTextarea,"paste",this.paste.bind(this)),r.util.addListener(this.hiddenTextarea,"compositionstart",this.onCompositionStart.bind(this)),r.util.addListener(this.hiddenTextarea,"compositionupdate",this.onCompositionUpdate.bind(this)),r.util.addListener(this.hiddenTextarea,"compositionend",this.onCompositionEnd.bind(this)),!this._clickHandlerInitialized&&this.canvas&&(r.util.addListener(this.canvas.upperCanvasEl,"click",this.onClick.bind(this)),this._clickHandlerInitialized=!0)},keysMap:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorRight",36:"moveCursorLeft",37:"moveCursorLeft",38:"moveCursorUp",39:"moveCursorRight",40:"moveCursorDown"},keysMapRtl:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorLeft",36:"moveCursorRight",37:"moveCursorRight",38:"moveCursorUp",39:"moveCursorLeft",40:"moveCursorDown"},ctrlKeysMapUp:{67:"copy",88:"cut"},ctrlKeysMapDown:{65:"selectAll"},onClick:function(){this.hiddenTextarea&&this.hiddenTextarea.focus()},onKeyDown:function(t){if(this.isEditing){var e="rtl"===this.direction?this.keysMapRtl:this.keysMap;if(t.keyCode in e)this[e[t.keyCode]](t);else{if(!(t.keyCode in this.ctrlKeysMapDown)||!t.ctrlKey&&!t.metaKey)return;this[this.ctrlKeysMapDown[t.keyCode]](t)}t.stopImmediatePropagation(),t.preventDefault(),t.keyCode>=33&&t.keyCode<=40?(this.inCompositionMode=!1,this.clearContextTop(),this.renderCursorOrSelection()):this.canvas&&this.canvas.requestRenderAll()}},onKeyUp:function(t){!this.isEditing||this._copyDone||this.inCompositionMode?this._copyDone=!1:t.keyCode in this.ctrlKeysMapUp&&(t.ctrlKey||t.metaKey)&&(this[this.ctrlKeysMapUp[t.keyCode]](t),t.stopImmediatePropagation(),t.preventDefault(),this.canvas&&this.canvas.requestRenderAll())},onInput:function(t){var e=this.fromPaste;if(this.fromPaste=!1,t&&t.stopPropagation(),this.isEditing){var i,n,o,a,s,c=this._splitTextIntoLines(this.hiddenTextarea.value).graphemeText,l=this._text.length,u=c.length,h=u-l,f=this.selectionStart,d=this.selectionEnd,g=f!==d;if(""===this.hiddenTextarea.value)return this.styles={},this.updateFromTextArea(),this.fire("changed"),void(this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll()));var p=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value),v=f>p.selectionStart;g?(i=this._text.slice(f,d),h+=d-f):u<l&&(i=v?this._text.slice(d+h,d):this._text.slice(f,f-h)),n=c.slice(p.selectionEnd-h,p.selectionEnd),i&&i.length&&(n.length&&(o=this.getSelectionStyles(f,f+1,!1),o=n.map((function(){return o[0]}))),g?(a=f,s=d):v?(a=d-i.length,s=d):(a=d,s=d+i.length),this.removeStyleFromTo(a,s)),n.length&&(e&&n.join("")===r.copiedText&&!r.disableStyleCopyPaste&&(o=r.copiedTextStyle),this.insertNewStyleBlock(n,f,o)),this.updateFromTextArea(),this.fire("changed"),this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll())}},onCompositionStart:function(){this.inCompositionMode=!0},onCompositionEnd:function(){this.inCompositionMode=!1},onCompositionUpdate:function(t){this.compositionStart=t.target.selectionStart,this.compositionEnd=t.target.selectionEnd,this.updateTextareaPosition()},copy:function(){this.selectionStart!==this.selectionEnd&&(r.copiedText=this.getSelectedText(),r.disableStyleCopyPaste?r.copiedTextStyle=null:r.copiedTextStyle=this.getSelectionStyles(this.selectionStart,this.selectionEnd,!0),this._copyDone=!0)},paste:function(){this.fromPaste=!0},_getClipboardData:function(t){return t&&t.clipboardData||r.window.clipboardData},_getWidthBeforeCursor:function(t,e){var i,n=this._getLineLeftOffset(t);return e>0&&(i=this.__charBounds[t][e-1],n+=i.left+i.width),n},getDownCursorOffset:function(t,e){var i=this._getSelectionForOffset(t,e),n=this.get2DCursorLocation(i),r=n.lineIndex;if(r===this._textLines.length-1||t.metaKey||34===t.keyCode)return this._text.length-i;var o=n.charIndex,a=this._getWidthBeforeCursor(r,o),s=this._getIndexOnLine(r+1,a),c=this._textLines[r].slice(o);return c.length+s+1+this.missingNewlineOffset(r)},_getSelectionForOffset:function(t,e){return t.shiftKey&&this.selectionStart!==this.selectionEnd&&e?this.selectionEnd:this.selectionStart},getUpCursorOffset:function(t,e){var i=this._getSelectionForOffset(t,e),n=this.get2DCursorLocation(i),r=n.lineIndex;if(0===r||t.metaKey||33===t.keyCode)return-i;var o=n.charIndex,a=this._getWidthBeforeCursor(r,o),s=this._getIndexOnLine(r-1,a),c=this._textLines[r].slice(0,o),l=this.missingNewlineOffset(r-1);return-this._textLines[r-1].length+s-c.length+(1-l)},_getIndexOnLine:function(t,e){for(var i,n,r=this._textLines[t],o=this._getLineLeftOffset(t),a=o,s=0,c=0,l=r.length;c<l;c++)if(i=this.__charBounds[t][c].width,a+=i,a>e){n=!0;var u=a-i,h=a,f=Math.abs(u-e),d=Math.abs(h-e);s=d<f?c:c-1;break}return n||(s=r.length-1),s},moveCursorDown:function(t){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorUpOrDown("Down",t)},moveCursorUp:function(t){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorUpOrDown("Up",t)},_moveCursorUpOrDown:function(t,e){var i="get"+t+"CursorOffset",n=this[i](e,"right"===this._selectionDirection);e.shiftKey?this.moveCursorWithShift(n):this.moveCursorWithoutShift(n),0!==n&&(this.setSelectionInBoundaries(),this.abortCursorAnimation(),this._currentCursorOpacity=1,this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorWithShift:function(t){var e="left"===this._selectionDirection?this.selectionStart+t:this.selectionEnd+t;return this.setSelectionStartEndWithShift(this.selectionStart,this.selectionEnd,e),0!==t},moveCursorWithoutShift:function(t){return t<0?(this.selectionStart+=t,this.selectionEnd=this.selectionStart):(this.selectionEnd+=t,this.selectionStart=this.selectionEnd),0!==t},moveCursorLeft:function(t){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorLeftOrRight("Left",t)},_move:function(t,e,i){var n;if(t.altKey)n=this["findWordBoundary"+i](this[e]);else{if(!t.metaKey&&35!==t.keyCode&&36!==t.keyCode)return this[e]+="Left"===i?-1:1,!0;n=this["findLineBoundary"+i](this[e])}if(void 0!==typeof n&&this[e]!==n)return this[e]=n,!0},_moveLeft:function(t,e){return this._move(t,e,"Left")},_moveRight:function(t,e){return this._move(t,e,"Right")},moveCursorLeftWithoutShift:function(t){var e=!0;return this._selectionDirection="left",this.selectionEnd===this.selectionStart&&0!==this.selectionStart&&(e=this._moveLeft(t,"selectionStart")),this.selectionEnd=this.selectionStart,e},moveCursorLeftWithShift:function(t){return"right"===this._selectionDirection&&this.selectionStart!==this.selectionEnd?this._moveLeft(t,"selectionEnd"):0!==this.selectionStart?(this._selectionDirection="left",this._moveLeft(t,"selectionStart")):void 0},moveCursorRight:function(t){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorLeftOrRight("Right",t)},_moveCursorLeftOrRight:function(t,e){var i="moveCursor"+t+"With";this._currentCursorOpacity=1,e.shiftKey?i+="Shift":i+="outShift",this[i](e)&&(this.abortCursorAnimation(),this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorRightWithShift:function(t){return"left"===this._selectionDirection&&this.selectionStart!==this.selectionEnd?this._moveRight(t,"selectionStart"):this.selectionEnd!==this._text.length?(this._selectionDirection="right",this._moveRight(t,"selectionEnd")):void 0},moveCursorRightWithoutShift:function(t){var e=!0;return this._selectionDirection="right",this.selectionStart===this.selectionEnd?(e=this._moveRight(t,"selectionStart"),this.selectionEnd=this.selectionStart):this.selectionStart=this.selectionEnd,e},removeChars:function(t,e){"undefined"===typeof e&&(e=t+1),this.removeStyleFromTo(t,e),this._text.splice(t,e-t),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()},insertChars:function(t,e,i,n){"undefined"===typeof n&&(n=i),n>i&&this.removeStyleFromTo(i,n);var o=r.util.string.graphemeSplit(t);this.insertNewStyleBlock(o,i,e),this._text=[].concat(this._text.slice(0,i),o,this._text.slice(n)),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()}}),function(){var t=r.util.toFixed,e=/ +/g;r.util.object.extend(r.Text.prototype,{_toSVG:function(){var t=this._getSVGLeftTopOffsets(),e=this._getSVGTextAndBg(t.textTop,t.textLeft);return this._wrapSVGTextAndBg(e)},toSVG:function(t){return this._createBaseSVGMarkup(this._toSVG(),{reviver:t,noStyle:!0,withShadow:!0})},_getSVGLeftTopOffsets:function(){return{textLeft:-this.width/2,textTop:-this.height/2,lineTop:this.getHeightOfLine(0)}},_wrapSVGTextAndBg:function(t){var e=!0,i=this.getSvgTextDecoration(this);return[t.textBgRects.join(""),'\t\t<text xml:space="preserve" ',this.fontFamily?'font-family="'+this.fontFamily.replace(/"/g,"'")+'" ':"",this.fontSize?'font-size="'+this.fontSize+'" ':"",this.fontStyle?'font-style="'+this.fontStyle+'" ':"",this.fontWeight?'font-weight="'+this.fontWeight+'" ':"",i?'text-decoration="'+i+'" ':"",'style="',this.getSvgStyles(e),'"',this.addPaintOrder()," >",t.textSpans.join(""),"</text>\n"]},_getSVGTextAndBg:function(t,e){var i,n=[],r=[],o=t;this._setSVGBg(r);for(var a=0,s=this._textLines.length;a<s;a++)i=this._getLineLeftOffset(a),(this.textBackgroundColor||this.styleHas("textBackgroundColor",a))&&this._setSVGTextLineBg(r,a,e+i,o),this._setSVGTextLineText(n,a,e+i,o),o+=this.getHeightOfLine(a);return{textSpans:n,textBgRects:r}},_createTextCharSpan:function(i,n,o,a){var s=i!==i.trim()||i.match(e),c=this.getSvgSpanStyles(n,s),l=c?'style="'+c+'"':"",u=n.deltaY,h="",f=r.Object.NUM_FRACTION_DIGITS;return u&&(h=' dy="'+t(u,f)+'" '),['<tspan x="',t(o,f),'" y="',t(a,f),'" ',h,l,">",r.util.string.escapeXml(i),"</tspan>"].join("")},_setSVGTextLineText:function(t,e,i,n){var r,o,a,s,c,l=this.getHeightOfLine(e),u=-1!==this.textAlign.indexOf("justify"),h="",f=0,d=this._textLines[e];n+=l*(1-this._fontSizeFraction)/this.lineHeight;for(var g=0,p=d.length-1;g<=p;g++)c=g===p||this.charSpacing,h+=d[g],a=this.__charBounds[e][g],0===f?(i+=a.kernedWidth-a.width,f+=a.width):f+=a.kernedWidth,u&&!c&&this._reSpaceAndTab.test(d[g])&&(c=!0),c||(r=r||this.getCompleteStyleDeclaration(e,g),o=this.getCompleteStyleDeclaration(e,g+1),c=this._hasStyleChangedForSvg(r,o)),c&&(s=this._getStyleDeclaration(e,g)||{},t.push(this._createTextCharSpan(h,s,i,n)),h="",r=o,i+=f,f=0)},_pushTextBgRect:function(e,i,n,o,a,s){var c=r.Object.NUM_FRACTION_DIGITS;e.push("\t\t<rect ",this._getFillAttributes(i),' x="',t(n,c),'" y="',t(o,c),'" width="',t(a,c),'" height="',t(s,c),'"></rect>\n')},_setSVGTextLineBg:function(t,e,i,n){for(var r,o,a=this._textLines[e],s=this.getHeightOfLine(e)/this.lineHeight,c=0,l=0,u=this.getValueOfPropertyAt(e,0,"textBackgroundColor"),h=0,f=a.length;h<f;h++)r=this.__charBounds[e][h],o=this.getValueOfPropertyAt(e,h,"textBackgroundColor"),o!==u?(u&&this._pushTextBgRect(t,u,i+l,n,c,s),l=r.left,c=r.width,u=o):c+=r.kernedWidth;o&&this._pushTextBgRect(t,o,i+l,n,c,s)},_getFillAttributes:function(t){var e=t&&"string"===typeof t?new r.Color(t):"";return e&&e.getSource()&&1!==e.getAlpha()?'opacity="'+e.getAlpha()+'" fill="'+e.setAlpha(1).toRgb()+'"':'fill="'+t+'"'},_getSVGLineTopOffset:function(t){for(var e=0,i=0,n=0;n<t;n++)e+=this.getHeightOfLine(n);return i=this.getHeightOfLine(n),{lineTop:e,offset:(this._fontSizeMult-this._fontSizeFraction)*i/(this.lineHeight*this._fontSizeMult)}},getSvgStyles:function(t){var e=r.Object.prototype.getSvgStyles.call(this,t);return e+" white-space: pre;"}})}(),function(t){"use strict";var e=t.fabric||(t.fabric={});e.Textbox=e.util.createClass(e.IText,e.Observable,{type:"textbox",minWidth:20,dynamicMinWidth:2,__cachedLines:null,lockScalingFlip:!0,noScaleCache:!1,_dimensionAffectingProps:e.Text.prototype._dimensionAffectingProps.concat("width"),_wordJoiners:/[ \t\r]/,splitByGrapheme:!1,initDimensions:function(){this.__skipDimension||(this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this._clearCache(),this.dynamicMinWidth=0,this._styleMap=this._generateStyleMap(this._splitText()),this.dynamicMinWidth>this.width&&this._set("width",this.dynamicMinWidth),-1!==this.textAlign.indexOf("justify")&&this.enlargeSpaces(),this.height=this.calcTextHeight(),this.saveState({propertySet:"_dimensionAffectingProps"}))},_generateStyleMap:function(t){for(var e=0,i=0,n=0,r={},o=0;o<t.graphemeLines.length;o++)"\n"===t.graphemeText[n]&&o>0?(i=0,n++,e++):!this.splitByGrapheme&&this._reSpaceAndTab.test(t.graphemeText[n])&&o>0&&(i++,n++),r[o]={line:e,offset:i},n+=t.graphemeLines[o].length,i+=t.graphemeLines[o].length;return r},styleHas:function(t,i){if(this._styleMap&&!this.isWrapping){var n=this._styleMap[i];n&&(i=n.line)}return e.Text.prototype.styleHas.call(this,t,i)},isEmptyStyles:function(t){if(!this.styles)return!0;var e,i,n=0,r=t+1,o=!1,a=this._styleMap[t],s=this._styleMap[t+1];for(var c in a&&(t=a.line,n=a.offset),s&&(r=s.line,o=r===t,e=s.offset),i="undefined"===typeof t?this.styles:{line:this.styles[t]},i)for(var l in i[c])if(l>=n&&(!o||l<e))for(var u in i[c][l])return!1;return!0},_getStyleDeclaration:function(t,e){if(this._styleMap&&!this.isWrapping){var i=this._styleMap[t];if(!i)return null;t=i.line,e=i.offset+e}return this.callSuper("_getStyleDeclaration",t,e)},_setStyleDeclaration:function(t,e,i){var n=this._styleMap[t];t=n.line,e=n.offset+e,this.styles[t][e]=i},_deleteStyleDeclaration:function(t,e){var i=this._styleMap[t];t=i.line,e=i.offset+e,delete this.styles[t][e]},_getLineStyle:function(t){var e=this._styleMap[t];return!!this.styles[e.line]},_setLineStyle:function(t){var e=this._styleMap[t];this.styles[e.line]={}},_wrapText:function(t,e){var i,n=[];for(this.isWrapping=!0,i=0;i<t.length;i++)n=n.concat(this._wrapLine(t[i],i,e));return this.isWrapping=!1,n},_measureWord:function(t,e,i){var n,r=0,o=!0;i=i||0;for(var a=0,s=t.length;a<s;a++){var c=this._getGraphemeBox(t[a],e,a+i,n,o);r+=c.kernedWidth,n=t[a]}return r},_wrapLine:function(t,i,n,r){var o=0,a=this.splitByGrapheme,s=[],c=[],l=a?e.util.string.graphemeSplit(t):t.split(this._wordJoiners),u="",h=0,f=a?"":" ",d=0,g=0,p=0,v=!0,m=this._getWidthOfCharSpacing();r=r||0;0===l.length&&l.push([]),n-=r;for(var y=0;y<l.length;y++)u=a?l[y]:e.util.string.graphemeSplit(l[y]),d=this._measureWord(u,i,h),h+=u.length,o+=g+d-m,o>n&&!v?(s.push(c),c=[],o=d,v=!0):o+=m,v||a||c.push(f),c=c.concat(u),g=a?0:this._measureWord([f],i,h),h++,v=!1,d>p&&(p=d);return y&&s.push(c),p+r>this.dynamicMinWidth&&(this.dynamicMinWidth=p-m+r),s},isEndOfWrapping:function(t){return!this._styleMap[t+1]||this._styleMap[t+1].line!==this._styleMap[t].line},missingNewlineOffset:function(t){return this.splitByGrapheme?this.isEndOfWrapping(t)?1:0:1},_splitTextIntoLines:function(t){for(var i=e.Text.prototype._splitTextIntoLines.call(this,t),n=this._wrapText(i.lines,this.width),r=new Array(n.length),o=0;o<n.length;o++)r[o]=n[o].join("");return i.lines=r,i.graphemeLines=n,i},getMinWidth:function(){return Math.max(this.minWidth,this.dynamicMinWidth)},_removeExtraneousStyles:function(){var t={};for(var e in this._styleMap)this._textLines[e]&&(t[this._styleMap[e].line]=1);for(var e in this.styles)t[e]||delete this.styles[e]},toObject:function(t){return this.callSuper("toObject",["minWidth","splitByGrapheme"].concat(t))}}),e.Textbox.fromObject=function(t,i){return e.Object._fromObject("Textbox",t,i,"text")}}(i),function(){var t=r.controlsUtils,e=t.scaleSkewCursorStyleHandler,i=t.scaleCursorStyleHandler,n=t.scalingEqually,o=t.scalingYOrSkewingX,a=t.scalingXOrSkewingY,s=t.scaleOrSkewActionName,c=r.Object.prototype.controls;if(c.ml=new r.Control({x:-.5,y:0,cursorStyleHandler:e,actionHandler:a,getActionName:s}),c.mr=new r.Control({x:.5,y:0,cursorStyleHandler:e,actionHandler:a,getActionName:s}),c.mb=new r.Control({x:0,y:.5,cursorStyleHandler:e,actionHandler:o,getActionName:s}),c.mt=new r.Control({x:0,y:-.5,cursorStyleHandler:e,actionHandler:o,getActionName:s}),c.tl=new r.Control({x:-.5,y:-.5,cursorStyleHandler:i,actionHandler:n}),c.tr=new r.Control({x:.5,y:-.5,cursorStyleHandler:i,actionHandler:n}),c.bl=new r.Control({x:-.5,y:.5,cursorStyleHandler:i,actionHandler:n}),c.br=new r.Control({x:.5,y:.5,cursorStyleHandler:i,actionHandler:n}),c.mtr=new r.Control({x:0,y:-.5,actionHandler:t.rotationWithSnapping,cursorStyleHandler:t.rotationStyleHandler,offsetY:-40,withConnection:!0,actionName:"rotate"}),r.Textbox){var l=r.Textbox.prototype.controls={};l.mtr=c.mtr,l.tr=c.tr,l.br=c.br,l.tl=c.tl,l.bl=c.bl,l.mt=c.mt,l.mb=c.mb,l.mr=new r.Control({x:.5,y:0,actionHandler:t.changeWidth,cursorStyleHandler:e,actionName:"resizing"}),l.ml=new r.Control({x:-.5,y:0,actionHandler:t.changeWidth,cursorStyleHandler:e,actionName:"resizing"})}}()},3053:function(t,e,i){"use strict";var n=i(602);function r(t,e,i){var r,o;if(i=i||0,!n(e))return-1;if(Array.prototype.indexOf)return Array.prototype.indexOf.call(e,t,i);for(o=e.length,r=i;i>=0&&r<o;r+=1)if(e[r]===t)return r;return-1}t.exports=r},8592:function(t,e,i){"use strict";var n=i(602),r=i(6092),o=i(5573);function a(t,e,i){n(t)?r(t,e,i):o(t,e,i)}t.exports=a},6092:function(t){"use strict";function e(t,e,i){var n=0,r=t.length;for(i=i||null;n<r;n+=1)if(!1===e.call(i,t[n],n,t))break}t.exports=e},5573:function(t){"use strict";function e(t,e,i){var n;for(n in i=i||null,t)if(t.hasOwnProperty(n)&&!1===e.call(i,t[n],n,t))break}t.exports=e},9052:function(t,e,i){"use strict";var n=i(961),r=i(9886),o=i(2560),a=i(5393),s=i(602),c=i(5183),l=i(8592),u=/\s+/g;function h(){this.events=null,this.contexts=null}h.mixin=function(t){n(t.prototype,h.prototype)},h.prototype._getHandlerItem=function(t,e){var i={handler:t};return e&&(i.context=e),i},h.prototype._safeEvent=function(t){var e,i=this.events;return i||(i=this.events={}),t&&(e=i[t],e||(e=[],i[t]=e),i=e),i},h.prototype._safeContext=function(){var t=this.contexts;return t||(t=this.contexts=[]),t},h.prototype._indexOfContext=function(t){var e=this._safeContext(),i=0;while(e[i]){if(t===e[i][0])return i;i+=1}return-1},h.prototype._memorizeContext=function(t){var e,i;r(t)&&(e=this._safeContext(),i=this._indexOfContext(t),i>-1?e[i][1]+=1:e.push([t,1]))},h.prototype._forgetContext=function(t){var e,i;r(t)&&(e=this._safeContext(),i=this._indexOfContext(t),i>-1&&(e[i][1]-=1,e[i][1]<=0&&e.splice(i,1)))},h.prototype._bindEvent=function(t,e,i){var n=this._safeEvent(t);this._memorizeContext(i),n.push(this._getHandlerItem(e,i))},h.prototype.on=function(t,e,i){var n=this;o(t)?(t=t.split(u),l(t,(function(t){n._bindEvent(t,e,i)}))):a(t)&&(i=e,l(t,(function(t,e){n.on(e,t,i)})))},h.prototype.once=function(t,e,i){var n=this;if(a(t))return i=e,void l(t,(function(t,e){n.once(e,t,i)}));function r(){e.apply(i,arguments),n.off(t,r,i)}this.on(t,r,i)},h.prototype._spliceMatches=function(t,e){var i,n=0;if(s(t))for(i=t.length;n<i;n+=1)!0===e(t[n])&&(t.splice(n,1),i-=1,n-=1)},h.prototype._matchHandler=function(t){var e=this;return function(i){var n=t===i.handler;return n&&e._forgetContext(i.context),n}},h.prototype._matchContext=function(t){var e=this;return function(i){var n=t===i.context;return n&&e._forgetContext(i.context),n}},h.prototype._matchHandlerAndContext=function(t,e){var i=this;return function(n){var r=t===n.handler,o=e===n.context,a=r&&o;return a&&i._forgetContext(n.context),a}},h.prototype._offByEventName=function(t,e){var i=this,n=c(e),r=i._matchHandler(e);t=t.split(u),l(t,(function(t){var e=i._safeEvent(t);n?i._spliceMatches(e,r):(l(e,(function(t){i._forgetContext(t.context)})),i.events[t]=[])}))},h.prototype._offByHandler=function(t){var e=this,i=this._matchHandler(t);l(this._safeEvent(),(function(t){e._spliceMatches(t,i)}))},h.prototype._offByObject=function(t,e){var i,n=this;this._indexOfContext(t)<0?l(t,(function(t,e){n.off(e,t)})):o(e)?(i=this._matchContext(t),n._spliceMatches(this._safeEvent(e),i)):c(e)?(i=this._matchHandlerAndContext(e,t),l(this._safeEvent(),(function(t){n._spliceMatches(t,i)}))):(i=this._matchContext(t),l(this._safeEvent(),(function(t){n._spliceMatches(t,i)})))},h.prototype.off=function(t,e){o(t)?this._offByEventName(t,e):arguments.length?c(t)?this._offByHandler(t):a(t)&&this._offByObject(t,e):(this.events={},this.contexts=[])},h.prototype.fire=function(t){this.invoke.apply(this,arguments)},h.prototype.invoke=function(t){var e,i,n,r;if(!this.hasListener(t))return!0;e=this._safeEvent(t),i=Array.prototype.slice.call(arguments,1),n=0;while(e[n]){if(r=e[n],!1===r.handler.apply(r.context,i))return!1;n+=1}return!0},h.prototype.hasListener=function(t){return this.getListenerLength(t)>0},h.prototype.getListenerLength=function(t){var e=this._safeEvent(t);return e.length},t.exports=h},961:function(t){"use strict";function e(t,e){var i,n,r,o,a=Object.prototype.hasOwnProperty;for(r=1,o=arguments.length;r<o;r+=1)for(n in i=arguments[r],i)a.call(i,n)&&(t[n]=i[n]);return t}t.exports=e},1610:function(t,e,i){"use strict";var n=i(5695),r=i(3778);function o(t,e){for(var i=arguments,o=i[0],a=1,s=i.length;a<s;a+=1){if(n(o)||r(o))return;o=o[i[a]]}return o}t.exports=o},4564:function(t,e,i){"use strict";var n=i(5573);function r(t,e){var i=document.createElement("img"),r="";return n(e,(function(t,e){r+="&"+e+"="+t})),r=r.substring(1),i.src=t+"?"+r,i.style.display="none",document.body.appendChild(i),document.body.removeChild(i),i}t.exports=r},4729:function(t,e,i){"use strict";var n=i(5695),r=i(4564),o=6048e5;function a(t){var e=(new Date).getTime();return e-t>o}function s(t,e){var i="https://www.google-analytics.com/collect",o=location.hostname,s="event",c="use",l="TOAST UI "+t+" for "+o+": Statistics",u=window.localStorage.getItem(l);(n(window.tui)||!1!==window.tui.usageStatistics)&&(u&&!a(u)||(window.localStorage.setItem(l,(new Date).getTime()),setTimeout((function(){"interactive"!==document.readyState&&"complete"!==document.readyState||r(i,{v:1,t:s,tid:e,cid:o,dp:o,dh:t,el:t,ec:c})}),1e3)))}t.exports=s},602:function(t){"use strict";function e(t){return t instanceof Array}t.exports=e},9886:function(t,e,i){"use strict";var n=i(5695),r=i(3778);function o(t){return!n(t)&&!r(t)}t.exports=o},5183:function(t){"use strict";function e(t){return t instanceof Function}t.exports=e},3778:function(t){"use strict";function e(t){return null===t}t.exports=e},5393:function(t){"use strict";function e(t){return t===Object(t)}t.exports=e},2560:function(t){"use strict";function e(t){return"string"===typeof t||t instanceof String}t.exports=e},5695:function(t){"use strict";function e(t){return void 0===t}t.exports=e},4426:function(t,e,i){t.exports=i(4486)},9406:function(t,e,i){t.exports=i(4877)},789:function(t,e,i){t.exports=i(7178)},381:function(t,e,i){t.exports=i(5603)},7636:function(t,e,i){t.exports=i(1206)},1899:function(t,e,i){t.exports=i(6174)},899:function(t,e,i){t.exports=i(57)},8005:function(t,e,i){t.exports=i(4741)},6562:function(t,e,i){t.exports=i(8368)},9131:function(t,e,i){t.exports=i(3739)},4383:function(t,e,i){t.exports=i(172)},6065:function(t,e,i){t.exports=i(4963)},1734:function(t,e,i){t.exports=i(7820)},2461:function(t,e,i){t.exports=i(5636)},5214:function(t,e,i){t.exports=i(5059)},6397:function(t,e,i){t.exports=i(3969)},8189:function(t,e,i){t.exports=i(6618)},9146:function(t,e,i){t.exports=i(5279)},4496:function(t,e,i){t.exports=i(9562)},3972:function(t,e,i){t.exports=i(652)},7172:function(t,e,i){t.exports=i(2813)},1845:function(t,e,i){t.exports=i(8664)},662:function(t,e,i){t.exports=i(1457)},711:function(t,e,i){t.exports=i(2937)},6623:function(t,e,i){t.exports=i(9297)},7077:function(t,e,i){t.exports=i(8026)},9856:function(t,e,i){t.exports=i(2044)},4230:function(t,e,i){t.exports=i(2214)},184:function(t,e,i){t.exports=i(9256)},3742:function(t,e,i){t.exports=i(5659)},1801:function(t){var e={rect:1,circle:2,triangle:1},i={rect:{w:"width",h:"height"},circle:{w:"rx",h:"ry"},triangle:{w:"width",h:"height"}};function n(t){var e=t.originX,i=t.originY,n=e.substring(0,1)+i.substring(0,1);t.startPoint=t.origins[n]}function r(t,e,i){var n=t.x,r=t.y,o=e.x,a=e.y,s=i*Math.PI/180,c=(o-n)*Math.cos(s)-(a-r)*Math.sin(s)+n,l=(o-n)*Math.sin(s)+(a-r)*Math.cos(s)+r;return{originX:n>c?"right":"left",originY:r>l?"bottom":"top"}}function o(t){return"center"===t.originX&&"center"===t.originY}function a(t,e){var i=e.getPointByOrigin("center","center"),n=-e.angle,o=r(i,t,n),a=o.originX,s=o.originY,c=e.getPointByOrigin(a,s),l=e.left-(i.x-c.x),u=e.top-(i.y-c.y);e.set({originX:a,originY:s,left:l,top:u}),e.setCoords()}function s(t,e){var i=e.startPoint,n=-e.angle,o=r(i,t,n),a=o.originX,s=o.originY;e.setPositionByOrigin(i,a,s),e.setCoords()}function c(t){var e=t.type,n=t.scaleX,r=t.scaleY,o=i[e],a=t[o.w]*n,s=t[o.h]*r;if(t.isRegular){var c=Math.max(n,r);a=t[o.w]*c,s=t[o.h]*c}var l={hasControls:!1,hasBorders:!1,scaleX:1,scaleY:1};l[o.w]=a,l[o.h]=s,t.set(l)}function l(t,n){var r=n.type,o=n.strokeWidth,a=n.startPoint,s=e[r],c=i[r],l=!("triangle"!==n.type),u={},h=Math.abs(a.x-t.x)/s,f=Math.abs(a.y-t.y)/s;h>o&&(h-=o/s),f>o&&(f-=o/s),n.isRegular&&(h=f=Math.max(h,f),l&&(f=Math.sqrt(3)/2*h)),u[c.w]=h,u[c.h]=f,n.set(u)}t.exports={setOrigins:function(t){var e=t.getPointByOrigin("left","top"),i=t.getPointByOrigin("right","top"),n=t.getPointByOrigin("right","bottom"),r=t.getPointByOrigin("left","bottom");t.origins={lt:e,rt:i,rb:n,lb:r}},resize:function(t,e,i){o(t)&&(a(e,t),n(t)),i?c(t,e):l(e,t),s(e,t)},adjustOriginToCenter:function(t){var e=t.getPointByOrigin("center","center"),i=t.originX,n=t.originY,r=t.getPointByOrigin(i,n),o=t.left+(e.x-r.x),a=t.top+(e.y-r.y);t.set({hasControls:!0,hasBorders:!0,originX:"center",originY:"center",left:o,top:a}),t.setCoords()}}},2221:function(t,e,i){i(5454),i(9173);var n=i(7545);t.exports=n.Array.from},5078:function(t,e,i){i(8118);var n=i(7545);t.exports=n.Array.isArray},6135:function(t,e,i){i(9106);var n=i(5607);t.exports=n("Array").concat},9510:function(t,e,i){i(1710);var n=i(5607);t.exports=n("Array").fill},3971:function(t,e,i){i(3436);var n=i(5607);t.exports=n("Array").filter},98:function(t,e,i){i(9823);var n=i(5607);t.exports=n("Array").forEach},2089:function(t,e,i){i(2276);var n=i(5607);t.exports=n("Array").indexOf},6209:function(t,e,i){i(3838);var n=i(5607);t.exports=n("Array").map},2671:function(t,e,i){i(5818);var n=i(5607);t.exports=n("Array").slice},1375:function(t,e,i){i(2178);var n=i(5607);t.exports=n("Array").splice},3528:function(t,e,i){i(665);var n=i(5607);t.exports=n("Function").bind},5739:function(t,e,i){i(8939),i(5454);var n=i(8703);t.exports=n},278:function(t,e,i){var n=i(3528),r=Function.prototype;t.exports=function(t){var e=t.bind;return t===r||t instanceof Function&&e===r.bind?n:e}},1484:function(t,e,i){var n=i(6135),r=Array.prototype;t.exports=function(t){var e=t.concat;return t===r||t instanceof Array&&e===r.concat?n:e}},7731:function(t,e,i){var n=i(9510),r=Array.prototype;t.exports=function(t){var e=t.fill;return t===r||t instanceof Array&&e===r.fill?n:e}},3669:function(t,e,i){var n=i(3971),r=Array.prototype;t.exports=function(t){var e=t.filter;return t===r||t instanceof Array&&e===r.filter?n:e}},2604:function(t,e,i){var n=i(2089),r=Array.prototype;t.exports=function(t){var e=t.indexOf;return t===r||t instanceof Array&&e===r.indexOf?n:e}},263:function(t,e,i){var n=i(6209),r=Array.prototype;t.exports=function(t){var e=t.map;return t===r||t instanceof Array&&e===r.map?n:e}},7663:function(t,e,i){var n=i(2671),r=Array.prototype;t.exports=function(t){var e=t.slice;return t===r||t instanceof Array&&e===r.slice?n:e}},5063:function(t,e,i){var n=i(1375),r=Array.prototype;t.exports=function(t){var e=t.splice;return t===r||t instanceof Array&&e===r.splice?n:e}},6813:function(t,e,i){var n=i(3842),r=String.prototype;t.exports=function(t){var e=t.trim;return"string"===typeof t||t===r||t instanceof String&&e===r.trim?n:e}},6285:function(t,e,i){i(2666);var n=i(7545);t.exports=n.Number.parseInt},3213:function(t,e,i){i(3113);var n=i(7545),r=n.Object;t.exports=function(t,e){return r.create(t,e)}},3512:function(t,e,i){i(297);var n=i(7545),r=n.Object,o=t.exports=function(t,e,i){return r.defineProperty(t,e,i)};r.defineProperty.sham&&(o.sham=!0)},8168:function(t,e,i){i(9234);var n=i(7545);t.exports=n.Object.getPrototypeOf},8651:function(t,e,i){i(2647);var n=i(7545);t.exports=n.Object.keys},3083:function(t,e,i){i(3222);var n=i(7545);t.exports=n.Object.setPrototypeOf},2987:function(t,e,i){i(4859);var n=i(7545);t.exports=n.parseFloat},2239:function(t,e,i){i(5706);var n=i(7545);t.exports=n.parseInt},3154:function(t,e,i){i(4242),i(8939),i(6663),i(9021),i(7884),i(8885),i(1868),i(5454);var n=i(7545);t.exports=n.Promise},6577:function(t,e,i){i(5397);var n=i(7545);t.exports=n.Reflect.construct},3842:function(t,e,i){i(957);var n=i(5607);t.exports=n("String").trim},5008:function(t,e,i){i(9106),i(6663),i(6187),i(9781),i(492),i(6681),i(9594),i(3665),i(9017),i(1250),i(9786),i(503),i(6565),i(9322),i(3610),i(6886),i(3514),i(8671),i(8556),i(1367);var n=i(7545);t.exports=n.Symbol},994:function(t,e,i){i(8939),i(6663),i(5454),i(3665);var n=i(9207);t.exports=n.f("iterator")},2813:function(t,e,i){var n=i(3822);t.exports=n},8664:function(t,e,i){var n=i(1434);t.exports=n},1457:function(t,e,i){var n=i(7710);t.exports=n},2937:function(t,e,i){var n=i(4741);t.exports=n},9297:function(t,e,i){var n=i(4963);t.exports=n},8026:function(t,e,i){var n=i(7820);t.exports=n},2044:function(t,e,i){var n=i(8980);t.exports=n},2214:function(t,e,i){var n=i(6672);t.exports=n},9256:function(t,e,i){var n=i(2285);i(177),i(9031),i(6658),i(1875),i(8658),i(4592),i(6680),t.exports=n},5659:function(t,e,i){var n=i(8535);t.exports=n},6235:function(t,e,i){var n=i(6447),r=i(9288);t.exports=function(t){if(n(t))return t;throw TypeError(r(t)+" is not a function")}},1404:function(t,e,i){var n=i(2091),r=i(9288);t.exports=function(t){if(n(t))return t;throw TypeError(r(t)+" is not a constructor")}},7757:function(t,e,i){var n=i(6447);t.exports=function(t){if("object"===typeof t||n(t))return t;throw TypeError("Can't set "+String(t)+" as a prototype")}},7423:function(t){t.exports=function(){}},6961:function(t){t.exports=function(t,e,i){if(t instanceof e)return t;throw TypeError("Incorrect "+(i?i+" ":"")+"invocation")}},1138:function(t,e,i){var n=i(5744);t.exports=function(t){if(n(t))return t;throw TypeError(String(t)+" is not an object")}},2724:function(t,e,i){"use strict";var n=i(1795),r=i(7739),o=i(4104);t.exports=function(t){var e=n(this),i=o(e),a=arguments.length,s=r(a>1?arguments[1]:void 0,i),c=a>2?arguments[2]:void 0,l=void 0===c?i:r(c,i);while(l>s)e[s++]=t;return e}},7397:function(t,e,i){"use strict";var n=i(454).forEach,r=i(424),o=r("forEach");t.exports=o?[].forEach:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}},841:function(t,e,i){"use strict";var n=i(8043),r=i(1795),o=i(1635),a=i(6109),s=i(2091),c=i(4104),l=i(9361),u=i(1669),h=i(8703);t.exports=function(t){var e=r(t),i=s(this),f=arguments.length,d=f>1?arguments[1]:void 0,g=void 0!==d;g&&(d=n(d,f>2?arguments[2]:void 0,2));var p,v,m,y,b,_,x=h(e),C=0;if(!x||this==Array&&a(x))for(p=c(e),v=i?new this(p):Array(p);p>C;C++)_=g?d(e[C],C):e[C],l(v,C,_);else for(y=u(e,x),b=y.next,v=i?new this:[];!(m=b.call(y)).done;C++)_=g?o(y,d,[m.value,C],!0):m.value,l(v,C,_);return v.length=C,v}},8180:function(t,e,i){var n=i(101),r=i(7739),o=i(4104),a=function(t){return function(e,i,a){var s,c=n(e),l=o(c),u=r(a,l);if(t&&i!=i){while(l>u)if(s=c[u++],s!=s)return!0}else for(;l>u;u++)if((t||u in c)&&c[u]===i)return t||u||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},454:function(t,e,i){var n=i(8043),r=i(2202),o=i(1795),a=i(4104),s=i(1321),c=[].push,l=function(t){var e=1==t,i=2==t,l=3==t,u=4==t,h=6==t,f=7==t,d=5==t||h;return function(g,p,v,m){for(var y,b,_=o(g),x=r(_),C=n(p,v,3),I=a(x),M=0,S=m||s,w=e?S(g,I):i||f?S(g,0):void 0;I>M;M++)if((d||M in x)&&(y=x[M],b=C(y,M,_),t))if(e)w[M]=b;else if(b)switch(t){case 3:return!0;case 5:return y;case 6:return M;case 2:c.call(w,y)}else switch(t){case 4:return!1;case 7:c.call(w,y)}return h?-1:l||u?u:w}};t.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterReject:l(7)}},242:function(t,e,i){var n=i(6192),r=i(8182),o=i(4218),a=r("species");t.exports=function(t){return o>=51||!n((function(){var e=[],i=e.constructor={};return i[a]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},424:function(t,e,i){"use strict";var n=i(6192);t.exports=function(t,e){var i=[][t];return!!i&&n((function(){i.call(null,e||function(){throw 1},1)}))}},3712:function(t,e,i){var n=i(4770),r=i(2091),o=i(5744),a=i(8182),s=a("species");t.exports=function(t){var e;return n(t)&&(e=t.constructor,r(e)&&(e===Array||n(e.prototype))?e=void 0:o(e)&&(e=e[s],null===e&&(e=void 0))),void 0===e?Array:e}},1321:function(t,e,i){var n=i(3712);t.exports=function(t,e){return new(n(t))(0===e?0:e)}},1635:function(t,e,i){var n=i(1138),r=i(6639);t.exports=function(t,e,i,o){try{return o?e(n(i)[0],i[1]):e(i)}catch(a){r(t,"throw",a)}}},9770:function(t,e,i){var n=i(8182),r=n("iterator"),o=!1;try{var a=0,s={next:function(){return{done:!!a++}},return:function(){o=!0}};s[r]=function(){return this},Array.from(s,(function(){throw 2}))}catch(c){}t.exports=function(t,e){if(!e&&!o)return!1;var i=!1;try{var n={};n[r]=function(){return{next:function(){return{done:i=!0}}}},t(n)}catch(c){}return i}},9272:function(t){var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},4696:function(t,e,i){var n=i(3471),r=i(6447),o=i(9272),a=i(8182),s=a("toStringTag"),c="Arguments"==o(function(){return arguments}()),l=function(t,e){try{return t[e]}catch(i){}};t.exports=n?o:function(t){var e,i,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=l(e=Object(t),s))?i:c?o(e):"Object"==(n=o(e))&&r(e.callee)?"Arguments":n}},4635:function(t,e,i){var n=i(6192);t.exports=!n((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},5148:function(t,e,i){"use strict";var n=i(4413).IteratorPrototype,r=i(2853),o=i(774),a=i(1284),s=i(7771),c=function(){return this};t.exports=function(t,e,i){var l=e+" Iterator";return t.prototype=r(n,{next:o(1,i)}),a(t,l,!1,!0),s[l]=c,t}},8711:function(t,e,i){var n=i(69),r=i(2760),o=i(774);t.exports=n?function(t,e,i){return r.f(t,e,o(1,i))}:function(t,e,i){return t[e]=i,t}},774:function(t){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},9361:function(t,e,i){"use strict";var n=i(77),r=i(2760),o=i(774);t.exports=function(t,e,i){var a=n(e);a in t?r.f(t,a,o(0,i)):t[a]=i}},7218:function(t,e,i){"use strict";var n=i(3085),r=i(5546),o=i(2282),a=i(6447),s=i(5148),c=i(9341),l=i(4469),u=i(1284),h=i(8711),f=i(9482),d=i(8182),g=i(7771),p=i(4413),v=o.PROPER,m=o.CONFIGURABLE,y=p.IteratorPrototype,b=p.BUGGY_SAFARI_ITERATORS,_=d("iterator"),x="keys",C="values",I="entries",M=function(){return this};t.exports=function(t,e,i,o,d,p,S){s(i,e,o);var w,T,A,D=function(t){if(t===d&&L)return L;if(!b&&t in O)return O[t];switch(t){case x:return function(){return new i(this,t)};case C:return function(){return new i(this,t)};case I:return function(){return new i(this,t)}}return function(){return new i(this)}},E=e+" Iterator",k=!1,O=t.prototype,j=O[_]||O["@@iterator"]||d&&O[d],L=!b&&j||D(d),N="Array"==e&&O.entries||j;if(N&&(w=c(N.call(new t)),w!==Object.prototype&&w.next&&(r||c(w)===y||(l?l(w,y):a(w[_])||f(w,_,M)),u(w,E,!0,!0),r&&(g[E]=M))),v&&d==C&&j&&j.name!==C&&(!r&&m?h(O,"name",C):(k=!0,L=function(){return j.call(this)})),d)if(T={values:D(C),keys:p?L:D(x),entries:D(I)},S)for(A in T)(b||k||!(A in O))&&f(O,A,T[A]);else n({target:e,proto:!0,forced:b||k},T);return r&&!S||O[_]===L||f(O,_,L,{name:d}),g[e]=L,T}},1488:function(t,e,i){var n=i(7545),r=i(4500),o=i(9207),a=i(2760).f;t.exports=function(t){var e=n.Symbol||(n.Symbol={});r(e,t)||a(e,t,{value:o.f(t)})}},69:function(t,e,i){var n=i(6192);t.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},7449:function(t,e,i){var n=i(8576),r=i(5744),o=n.document,a=r(o)&&r(o.createElement);t.exports=function(t){return a?o.createElement(t):{}}},7365:function(t){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},2957:function(t){t.exports="object"==typeof window},9347:function(t,e,i){var n=i(8989),r=i(8576);t.exports=/ipad|iphone|ipod/i.test(n)&&void 0!==r.Pebble},9536:function(t,e,i){var n=i(8989);t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},224:function(t,e,i){var n=i(9272),r=i(8576);t.exports="process"==n(r.process)},5914:function(t,e,i){var n=i(8989);t.exports=/web0s(?!.*chrome)/i.test(n)},8989:function(t,e,i){var n=i(150);t.exports=n("navigator","userAgent")||""},4218:function(t,e,i){var n,r,o=i(8576),a=i(8989),s=o.process,c=o.Deno,l=s&&s.versions||c&&c.version,u=l&&l.v8;u?(n=u.split("."),r=n[0]<4?1:n[0]+n[1]):a&&(n=a.match(/Edge\/(\d+)/),(!n||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/),n&&(r=n[1]))),t.exports=r&&+r},5607:function(t,e,i){var n=i(7545);t.exports=function(t){return n[t+"Prototype"]}},2952:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},3085:function(t,e,i){"use strict";var n=i(8576),r=i(6447),o=i(5141).f,a=i(9245),s=i(7545),c=i(8043),l=i(8711),u=i(4500),h=function(t){var e=function(e,i,n){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,i)}return new t(e,i,n)}return t.apply(this,arguments)};return e.prototype=t.prototype,e};t.exports=function(t,e){var i,f,d,g,p,v,m,y,b,_=t.target,x=t.global,C=t.stat,I=t.proto,M=x?n:C?n[_]:(n[_]||{}).prototype,S=x?s:s[_]||l(s,_,{})[_],w=S.prototype;for(g in e)i=a(x?g:_+(C?".":"#")+g,t.forced),f=!i&&M&&u(M,g),v=S[g],f&&(t.noTargetGet?(b=o(M,g),m=b&&b.value):m=M[g]),p=f&&m?m:e[g],f&&typeof v===typeof p||(y=t.bind&&f?c(p,n):t.wrap&&f?h(p):I&&r(p)?c(Function.call,p):p,(t.sham||p&&p.sham||v&&v.sham)&&l(y,"sham",!0),l(S,g,y),I&&(d=_+"Prototype",u(s,d)||l(s,d,{}),l(s[d],g,p),t.real&&w&&!w[g]&&l(w,g,p)))}},6192:function(t){t.exports=function(t){try{return!!t()}catch(e){return!0}}},8043:function(t,e,i){var n=i(6235);t.exports=function(t,e,i){if(n(t),void 0===e)return t;switch(i){case 0:return function(){return t.call(e)};case 1:return function(i){return t.call(e,i)};case 2:return function(i,n){return t.call(e,i,n)};case 3:return function(i,n,r){return t.call(e,i,n,r)}}return function(){return t.apply(e,arguments)}}},6782:function(t,e,i){"use strict";var n=i(6235),r=i(5744),o=[].slice,a={},s=function(t,e,i){if(!(e in a)){for(var n=[],r=0;r<e;r++)n[r]="a["+r+"]";a[e]=Function("C,a","return new C("+n.join(",")+")")}return a[e](t,i)};t.exports=Function.bind||function(t){var e=n(this),i=o.call(arguments,1),a=function(){var n=i.concat(o.call(arguments));return this instanceof a?s(e,n.length,n):e.apply(t,n)};return r(e.prototype)&&(a.prototype=e.prototype),a}},2282:function(t,e,i){var n=i(69),r=i(4500),o=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,s=r(o,"name"),c=s&&"something"===function(){}.name,l=s&&(!n||n&&a(o,"name").configurable);t.exports={EXISTS:s,PROPER:c,CONFIGURABLE:l}},150:function(t,e,i){var n=i(7545),r=i(8576),o=i(6447),a=function(t){return o(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?a(n[t])||a(r[t]):n[t]&&n[t][e]||r[t]&&r[t][e]}},8703:function(t,e,i){var n=i(4696),r=i(5037),o=i(7771),a=i(8182),s=a("iterator");t.exports=function(t){if(void 0!=t)return r(t,s)||r(t,"@@iterator")||o[n(t)]}},1669:function(t,e,i){var n=i(6235),r=i(1138),o=i(8703);t.exports=function(t,e){var i=arguments.length<2?o(t):e;if(n(i))return r(i.call(t));throw TypeError(String(t)+" is not iterable")}},5037:function(t,e,i){var n=i(6235);t.exports=function(t,e){var i=t[e];return null==i?void 0:n(i)}},8576:function(t,e,i){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof i.g&&i.g)||function(){return this}()||Function("return this")()},4500:function(t,e,i){var n=i(1795),r={}.hasOwnProperty;t.exports=Object.hasOwn||function(t,e){return r.call(n(t),e)}},4535:function(t){t.exports={}},3681:function(t,e,i){var n=i(8576);t.exports=function(t,e){var i=n.console;i&&i.error&&(1===arguments.length?i.error(t):i.error(t,e))}},7403:function(t,e,i){var n=i(150);t.exports=n("document","documentElement")},188:function(t,e,i){var n=i(69),r=i(6192),o=i(7449);t.exports=!n&&!r((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},2202:function(t,e,i){var n=i(6192),r=i(9272),o="".split;t.exports=n((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==r(t)?o.call(t,""):Object(t)}:Object},9516:function(t,e,i){var n=i(6447),r=i(6434),o=Function.toString;n(r.inspectSource)||(r.inspectSource=function(t){return o.call(t)}),t.exports=r.inspectSource},273:function(t,e,i){var n=i(5744),r=i(8711);t.exports=function(t,e){n(e)&&"cause"in e&&r(t,"cause",t.cause)}},3326:function(t,e,i){var n,r,o,a=i(8921),s=i(8576),c=i(5744),l=i(8711),u=i(4500),h=i(6434),f=i(9766),d=i(4535),g="Object already initialized",p=s.WeakMap,v=function(t){return o(t)?r(t):n(t,{})},m=function(t){return function(e){var i;if(!c(e)||(i=r(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return i}};if(a||h.state){var y=h.state||(h.state=new p),b=y.get,_=y.has,x=y.set;n=function(t,e){if(_.call(y,t))throw new TypeError(g);return e.facade=t,x.call(y,t,e),e},r=function(t){return b.call(y,t)||{}},o=function(t){return _.call(y,t)}}else{var C=f("state");d[C]=!0,n=function(t,e){if(u(t,C))throw new TypeError(g);return e.facade=t,l(t,C,e),e},r=function(t){return u(t,C)?t[C]:{}},o=function(t){return u(t,C)}}t.exports={set:n,get:r,has:o,enforce:v,getterFor:m}},6109:function(t,e,i){var n=i(8182),r=i(7771),o=n("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||a[o]===t)}},4770:function(t,e,i){var n=i(9272);t.exports=Array.isArray||function(t){return"Array"==n(t)}},6447:function(t){t.exports=function(t){return"function"===typeof t}},2091:function(t,e,i){var n=i(6192),r=i(6447),o=i(4696),a=i(150),s=i(9516),c=[],l=a("Reflect","construct"),u=/^\s*(?:class|function)\b/,h=u.exec,f=!u.exec((function(){})),d=function(t){if(!r(t))return!1;try{return l(Object,c,t),!0}catch(e){return!1}},g=function(t){if(!r(t))return!1;switch(o(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return f||!!h.call(u,s(t))};t.exports=!l||n((function(){var t;return d(d.call)||!d(Object)||!d((function(){t=!0}))||t}))?g:d},9245:function(t,e,i){var n=i(6192),r=i(6447),o=/#|\.prototype\./,a=function(t,e){var i=c[s(t)];return i==u||i!=l&&(r(e)?n(e):!!e)},s=a.normalize=function(t){return String(t).replace(o,".").toLowerCase()},c=a.data={},l=a.NATIVE="N",u=a.POLYFILL="P";t.exports=a},5744:function(t,e,i){var n=i(6447);t.exports=function(t){return"object"===typeof t?null!==t:n(t)}},5546:function(t){t.exports=!0},3236:function(t,e,i){var n=i(6447),r=i(150),o=i(615);t.exports=o?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return n(e)&&Object(t)instanceof e}},3442:function(t,e,i){var n=i(1138),r=i(6109),o=i(4104),a=i(8043),s=i(1669),c=i(8703),l=i(6639),u=function(t,e){this.stopped=t,this.result=e};t.exports=function(t,e,i){var h,f,d,g,p,v,m,y=i&&i.that,b=!(!i||!i.AS_ENTRIES),_=!(!i||!i.IS_ITERATOR),x=!(!i||!i.INTERRUPTED),C=a(e,y,1+b+x),I=function(t){return h&&l(h,"normal",t),new u(!0,t)},M=function(t){return b?(n(t),x?C(t[0],t[1],I):C(t[0],t[1])):x?C(t,I):C(t)};if(_)h=t;else{if(f=c(t),!f)throw TypeError(String(t)+" is not iterable");if(r(f)){for(d=0,g=o(t);g>d;d++)if(p=M(t[d]),p&&p instanceof u)return p;return new u(!1)}h=s(t,f)}v=h.next;while(!(m=v.call(h)).done){try{p=M(m.value)}catch(S){l(h,"throw",S)}if("object"==typeof p&&p&&p instanceof u)return p}return new u(!1)}},6639:function(t,e,i){var n=i(1138),r=i(5037);t.exports=function(t,e,i){var o,a;n(t);try{if(o=r(t,"return"),!o){if("throw"===e)throw i;return i}o=o.call(t)}catch(s){a=!0,o=s}if("throw"===e)throw i;if(a)throw o;return n(o),i}},4413:function(t,e,i){"use strict";var n,r,o,a=i(6192),s=i(6447),c=i(2853),l=i(9341),u=i(9482),h=i(8182),f=i(5546),d=h("iterator"),g=!1;[].keys&&(o=[].keys(),"next"in o?(r=l(l(o)),r!==Object.prototype&&(n=r)):g=!0);var p=void 0==n||a((function(){var t={};return n[d].call(t)!==t}));p?n={}:f&&(n=c(n)),s(n[d])||u(n,d,(function(){return this})),t.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:g}},7771:function(t){t.exports={}},4104:function(t,e,i){var n=i(8445);t.exports=function(t){return n(t.length)}},2950:function(t,e,i){var n,r,o,a,s,c,l,u,h=i(8576),f=i(5141).f,d=i(7160).set,g=i(9536),p=i(9347),v=i(5914),m=i(224),y=h.MutationObserver||h.WebKitMutationObserver,b=h.document,_=h.process,x=h.Promise,C=f(h,"queueMicrotask"),I=C&&C.value;I||(n=function(){var t,e;m&&(t=_.domain)&&t.exit();while(r){e=r.fn,r=r.next;try{e()}catch(i){throw r?a():o=void 0,i}}o=void 0,t&&t.enter()},g||m||v||!y||!b?!p&&x&&x.resolve?(l=x.resolve(void 0),l.constructor=x,u=l.then,a=function(){u.call(l,n)}):a=m?function(){_.nextTick(n)}:function(){d.call(h,n)}:(s=!0,c=b.createTextNode(""),new y(n).observe(c,{characterData:!0}),a=function(){c.data=s=!s})),t.exports=I||function(t){var e={fn:t,next:void 0};o&&(o.next=e),r||(r=e,a()),o=e}},4471:function(t,e,i){var n=i(8576);t.exports=n.Promise},3045:function(t,e,i){var n=i(4218),r=i(6192);t.exports=!!Object.getOwnPropertySymbols&&!r((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},4551:function(t,e,i){var n=i(6192),r=i(8182),o=i(5546),a=r("iterator");t.exports=!n((function(){var t=new URL("b?a=1&b=2&c=3","http://a"),e=t.searchParams,i="";return t.pathname="c%20d",e.forEach((function(t,n){e["delete"]("b"),i+=n+t})),o&&!t.toJSON||!e.sort||"http://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[a]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==i||"x"!==new URL("http://x",void 0).host}))},8921:function(t,e,i){var n=i(8576),r=i(6447),o=i(9516),a=n.WeakMap;t.exports=r(a)&&/native code/.test(o(a))},9438:function(t,e,i){"use strict";var n=i(6235),r=function(t){var e,i;this.promise=new t((function(t,n){if(void 0!==e||void 0!==i)throw TypeError("Bad Promise constructor");e=t,i=n})),this.resolve=n(e),this.reject=n(i)};t.exports.f=function(t){return new r(t)}},15:function(t,e,i){var n=i(8576),r=i(6192),o=i(4845),a=i(4277).trim,s=i(1450),c=n.parseFloat,l=n.Symbol,u=l&&l.iterator,h=1/c(s+"-0")!==-1/0||u&&!r((function(){c(Object(u))}));t.exports=h?function(t){var e=a(o(t)),i=c(e);return 0===i&&"-"==e.charAt(0)?-0:i}:c},2558:function(t,e,i){var n=i(8576),r=i(6192),o=i(4845),a=i(4277).trim,s=i(1450),c=n.parseInt,l=n.Symbol,u=l&&l.iterator,h=/^[+-]?0[Xx]/,f=8!==c(s+"08")||22!==c(s+"0x16")||u&&!r((function(){c(Object(u))}));t.exports=f?function(t,e){var i=a(o(t));return c(i,e>>>0||(h.test(i)?16:10))}:c},2503:function(t,e,i){"use strict";var n=i(69),r=i(6192),o=i(7653),a=i(4750),s=i(6007),c=i(1795),l=i(2202),u=Object.assign,h=Object.defineProperty;t.exports=!u||r((function(){if(n&&1!==u({b:1},u(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},i=Symbol(),r="abcdefghijklmnopqrst";return t[i]=7,r.split("").forEach((function(t){e[t]=t})),7!=u({},t)[i]||o(u({},e)).join("")!=r}))?function(t,e){var i=c(t),r=arguments.length,u=1,h=a.f,f=s.f;while(r>u){var d,g=l(arguments[u++]),p=h?o(g).concat(h(g)):o(g),v=p.length,m=0;while(v>m)d=p[m++],n&&!f.call(g,d)||(i[d]=g[d])}return i}:u},2853:function(t,e,i){var n,r=i(1138),o=i(1187),a=i(2952),s=i(4535),c=i(7403),l=i(7449),u=i(9766),h=">",f="<",d="prototype",g="script",p=u("IE_PROTO"),v=function(){},m=function(t){return f+g+h+t+f+"/"+g+h},y=function(t){t.write(m("")),t.close();var e=t.parentWindow.Object;return t=null,e},b=function(){var t,e=l("iframe"),i="java"+g+":";return e.style.display="none",c.appendChild(e),e.src=String(i),t=e.contentWindow.document,t.open(),t.write(m("document.F=Object")),t.close(),t.F},_=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}_="undefined"!=typeof document?document.domain&&n?y(n):b():y(n);var t=a.length;while(t--)delete _[d][a[t]];return _()};s[p]=!0,t.exports=Object.create||function(t,e){var i;return null!==t?(v[d]=r(t),i=new v,v[d]=null,i[p]=t):i=_(),void 0===e?i:o(i,e)}},1187:function(t,e,i){var n=i(69),r=i(2760),o=i(1138),a=i(7653);t.exports=n?Object.defineProperties:function(t,e){o(t);var i,n=a(e),s=n.length,c=0;while(s>c)r.f(t,i=n[c++],e[i]);return t}},2760:function(t,e,i){var n=i(69),r=i(188),o=i(1138),a=i(77),s=Object.defineProperty;e.f=n?s:function(t,e,i){if(o(t),e=a(e),o(i),r)try{return s(t,e,i)}catch(n){}if("get"in i||"set"in i)throw TypeError("Accessors not supported");return"value"in i&&(t[e]=i.value),t}},5141:function(t,e,i){var n=i(69),r=i(6007),o=i(774),a=i(101),s=i(77),c=i(4500),l=i(188),u=Object.getOwnPropertyDescriptor;e.f=n?u:function(t,e){if(t=a(t),e=s(e),l)try{return u(t,e)}catch(i){}if(c(t,e))return o(!r.f.call(t,e),t[e])}},4052:function(t,e,i){var n=i(101),r=i(2092).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(t){try{return r(t)}catch(e){return a.slice()}};t.exports.f=function(t){return a&&"[object Window]"==o.call(t)?s(t):r(n(t))}},2092:function(t,e,i){var n=i(7934),r=i(2952),o=r.concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,o)}},4750:function(t,e){e.f=Object.getOwnPropertySymbols},9341:function(t,e,i){var n=i(4500),r=i(6447),o=i(1795),a=i(9766),s=i(4635),c=a("IE_PROTO"),l=Object.prototype;t.exports=s?Object.getPrototypeOf:function(t){var e=o(t);if(n(e,c))return e[c];var i=e.constructor;return r(i)&&e instanceof i?i.prototype:e instanceof Object?l:null}},7934:function(t,e,i){var n=i(4500),r=i(101),o=i(8180).indexOf,a=i(4535);t.exports=function(t,e){var i,s=r(t),c=0,l=[];for(i in s)!n(a,i)&&n(s,i)&&l.push(i);while(e.length>c)n(s,i=e[c++])&&(~o(l,i)||l.push(i));return l}},7653:function(t,e,i){var n=i(7934),r=i(2952);t.exports=Object.keys||function(t){return n(t,r)}},6007:function(t,e){"use strict";var i={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,r=n&&!i.call({1:2},1);e.f=r?function(t){var e=n(this,t);return!!e&&e.enumerable}:i},4469:function(t,e,i){var n=i(1138),r=i(7757);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,i={};try{t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,t.call(i,[]),e=i instanceof Array}catch(o){}return function(i,o){return n(i),r(o),e?t.call(i,o):i.__proto__=o,i}}():void 0)},158:function(t,e,i){"use strict";var n=i(3471),r=i(4696);t.exports=n?{}.toString:function(){return"[object "+r(this)+"]"}},380:function(t,e,i){var n=i(6447),r=i(5744);t.exports=function(t,e){var i,o;if("string"===e&&n(i=t.toString)&&!r(o=i.call(t)))return o;if(n(i=t.valueOf)&&!r(o=i.call(t)))return o;if("string"!==e&&n(i=t.toString)&&!r(o=i.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},7545:function(t){t.exports={}},892:function(t){t.exports=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}}},9126:function(t,e,i){var n=i(1138),r=i(5744),o=i(9438);t.exports=function(t,e){if(n(t),r(e)&&e.constructor===t)return e;var i=o.f(t),a=i.resolve;return a(e),i.promise}},533:function(t,e,i){var n=i(9482);t.exports=function(t,e,i){for(var r in e)i&&i.unsafe&&t[r]?t[r]=e[r]:n(t,r,e[r],i);return t}},9482:function(t,e,i){var n=i(8711);t.exports=function(t,e,i,r){r&&r.enumerable?t[e]=i:n(t,e,i)}},3209:function(t){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},7613:function(t,e,i){var n=i(8576);t.exports=function(t,e){try{Object.defineProperty(n,t,{value:e,configurable:!0,writable:!0})}catch(i){n[t]=e}return e}},3656:function(t,e,i){"use strict";var n=i(150),r=i(2760),o=i(8182),a=i(69),s=o("species");t.exports=function(t){var e=n(t),i=r.f;a&&e&&!e[s]&&i(e,s,{configurable:!0,get:function(){return this}})}},1284:function(t,e,i){var n=i(3471),r=i(2760).f,o=i(8711),a=i(4500),s=i(158),c=i(8182),l=c("toStringTag");t.exports=function(t,e,i,c){if(t){var u=i?t:t.prototype;a(u,l)||r(u,l,{configurable:!0,value:e}),c&&!n&&o(u,"toString",s)}}},9766:function(t,e,i){var n=i(8717),r=i(2759),o=n("keys");t.exports=function(t){return o[t]||(o[t]=r(t))}},6434:function(t,e,i){var n=i(8576),r=i(7613),o="__core-js_shared__",a=n[o]||r(o,{});t.exports=a},8717:function(t,e,i){var n=i(5546),r=i(6434);(t.exports=function(t,e){return r[t]||(r[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.18.2",mode:n?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},4743:function(t,e,i){var n=i(1138),r=i(1404),o=i(8182),a=o("species");t.exports=function(t,e){var i,o=n(t).constructor;return void 0===o||void 0==(i=n(o)[a])?e:r(i)}},863:function(t,e,i){var n=i(1941),r=i(4845),o=i(3209),a=function(t){return function(e,i){var a,s,c=r(o(e)),l=n(i),u=c.length;return l<0||l>=u?t?"":void 0:(a=c.charCodeAt(l),a<55296||a>56319||l+1===u||(s=c.charCodeAt(l+1))<56320||s>57343?t?c.charAt(l):a:t?c.slice(l,l+2):s-56320+(a-55296<<10)+65536)}};t.exports={codeAt:a(!1),charAt:a(!0)}},7977:function(t){"use strict";var e=2147483647,i=36,n=1,r=26,o=38,a=700,s=72,c=128,l="-",u=/[^\0-\u007E]/,h=/[.\u3002\uFF0E\uFF61]/g,f="Overflow: input needs wider integers to process",d=i-n,g=Math.floor,p=String.fromCharCode,v=function(t){var e=[],i=0,n=t.length;while(i<n){var r=t.charCodeAt(i++);if(r>=55296&&r<=56319&&i<n){var o=t.charCodeAt(i++);56320==(64512&o)?e.push(((1023&r)<<10)+(1023&o)+65536):(e.push(r),i--)}else e.push(r)}return e},m=function(t){return t+22+75*(t<26)},y=function(t,e,n){var s=0;for(t=n?g(t/a):t>>1,t+=g(t/e);t>d*r>>1;s+=i)t=g(t/d);return g(s+(d+1)*t/(t+o))},b=function(t){var o=[];t=v(t);var a,u,h=t.length,d=c,b=0,_=s;for(a=0;a<t.length;a++)u=t[a],u<128&&o.push(p(u));var x=o.length,C=x;x&&o.push(l);while(C<h){var I=e;for(a=0;a<t.length;a++)u=t[a],u>=d&&u<I&&(I=u);var M=C+1;if(I-d>g((e-b)/M))throw RangeError(f);for(b+=(I-d)*M,d=I,a=0;a<t.length;a++){if(u=t[a],u<d&&++b>e)throw RangeError(f);if(u==d){for(var S=b,w=i;;w+=i){var T=w<=_?n:w>=_+r?r:w-_;if(S<T)break;var A=S-T,D=i-T;o.push(p(m(T+A%D))),S=g(A/D)}o.push(p(m(S))),_=y(b,M,C==x),b=0,++C}}++b,++d}return o.join("")};t.exports=function(t){var e,i,n=[],r=t.toLowerCase().replace(h,".").split(".");for(e=0;e<r.length;e++)i=r[e],n.push(u.test(i)?"xn--"+b(i):i);return n.join(".")}},6815:function(t,e,i){var n=i(2282).PROPER,r=i(6192),o=i(1450),a="​…᠎";t.exports=function(t){return r((function(){return!!o[t]()||a[t]()!==a||n&&o[t].name!==t}))}},4277:function(t,e,i){var n=i(3209),r=i(4845),o=i(1450),a="["+o+"]",s=RegExp("^"+a+a+"*"),c=RegExp(a+a+"*$"),l=function(t){return function(e){var i=r(n(e));return 1&t&&(i=i.replace(s,"")),2&t&&(i=i.replace(c,"")),i}};t.exports={start:l(1),end:l(2),trim:l(3)}},7160:function(t,e,i){var n,r,o,a,s=i(8576),c=i(6447),l=i(6192),u=i(8043),h=i(7403),f=i(7449),d=i(9536),g=i(224),p=s.setImmediate,v=s.clearImmediate,m=s.process,y=s.MessageChannel,b=s.Dispatch,_=0,x={},C="onreadystatechange";try{n=s.location}catch(T){}var I=function(t){if(x.hasOwnProperty(t)){var e=x[t];delete x[t],e()}},M=function(t){return function(){I(t)}},S=function(t){I(t.data)},w=function(t){s.postMessage(String(t),n.protocol+"//"+n.host)};p&&v||(p=function(t){var e=[],i=arguments.length,n=1;while(i>n)e.push(arguments[n++]);return x[++_]=function(){(c(t)?t:Function(t)).apply(void 0,e)},r(_),_},v=function(t){delete x[t]},g?r=function(t){m.nextTick(M(t))}:b&&b.now?r=function(t){b.now(M(t))}:y&&!d?(o=new y,a=o.port2,o.port1.onmessage=S,r=u(a.postMessage,a,1)):s.addEventListener&&c(s.postMessage)&&!s.importScripts&&n&&"file:"!==n.protocol&&!l(w)?(r=w,s.addEventListener("message",S,!1)):r=C in f("script")?function(t){h.appendChild(f("script"))[C]=function(){h.removeChild(this),I(t)}}:function(t){setTimeout(M(t),0)}),t.exports={set:p,clear:v}},7739:function(t,e,i){var n=i(1941),r=Math.max,o=Math.min;t.exports=function(t,e){var i=n(t);return i<0?r(i+e,0):o(i,e)}},101:function(t,e,i){var n=i(2202),r=i(3209);t.exports=function(t){return n(r(t))}},1941:function(t){var e=Math.ceil,i=Math.floor;t.exports=function(t){var n=+t;return n!==n||0===n?0:(n>0?i:e)(n)}},8445:function(t,e,i){var n=i(1941),r=Math.min;t.exports=function(t){return t>0?r(n(t),9007199254740991):0}},1795:function(t,e,i){var n=i(3209);t.exports=function(t){return Object(n(t))}},7888:function(t,e,i){var n=i(5744),r=i(3236),o=i(5037),a=i(380),s=i(8182),c=s("toPrimitive");t.exports=function(t,e){if(!n(t)||r(t))return t;var i,s=o(t,c);if(s){if(void 0===e&&(e="default"),i=s.call(t,e),!n(i)||r(i))return i;throw TypeError("Can't convert object to primitive value")}return void 0===e&&(e="number"),a(t,e)}},77:function(t,e,i){var n=i(7888),r=i(3236);t.exports=function(t){var e=n(t,"string");return r(e)?e:String(e)}},3471:function(t,e,i){var n=i(8182),r=n("toStringTag"),o={};o[r]="z",t.exports="[object z]"===String(o)},4845:function(t,e,i){var n=i(4696);t.exports=function(t){if("Symbol"===n(t))throw TypeError("Cannot convert a Symbol value to a string");return String(t)}},9288:function(t){t.exports=function(t){try{return String(t)}catch(e){return"Object"}}},2759:function(t){var e=0,i=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++e+i).toString(36)}},615:function(t,e,i){var n=i(3045);t.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},9207:function(t,e,i){var n=i(8182);e.f=n},8182:function(t,e,i){var n=i(8576),r=i(8717),o=i(4500),a=i(2759),s=i(3045),c=i(615),l=r("wks"),u=n.Symbol,h=c?u:u&&u.withoutSetter||a;t.exports=function(t){return o(l,t)&&(s||"string"==typeof l[t])||(s&&o(u,t)?l[t]=u[t]:l[t]=h("Symbol."+t)),l[t]}},1450:function(t){t.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},4242:function(t,e,i){"use strict";var n=i(3085),r=i(9341),o=i(4469),a=i(2853),s=i(8711),c=i(774),l=i(273),u=i(3442),h=i(4845),f=function(t,e){var i=this,n=arguments.length>2?arguments[2]:void 0;if(!(i instanceof f))return new f(t,e,n);o&&(i=o(new Error(void 0),r(i))),void 0!==e&&s(i,"message",h(e)),l(i,n);var a=[];return u(t,a.push,{that:a}),s(i,"errors",a),i};f.prototype=a(Error.prototype,{constructor:c(5,f),message:c(5,""),name:c(5,"AggregateError")}),n({global:!0},{AggregateError:f})},9106:function(t,e,i){"use strict";var n=i(3085),r=i(6192),o=i(4770),a=i(5744),s=i(1795),c=i(4104),l=i(9361),u=i(1321),h=i(242),f=i(8182),d=i(4218),g=f("isConcatSpreadable"),p=9007199254740991,v="Maximum allowed index exceeded",m=d>=51||!r((function(){var t=[];return t[g]=!1,t.concat()[0]!==t})),y=h("concat"),b=function(t){if(!a(t))return!1;var e=t[g];return void 0!==e?!!e:o(t)},_=!m||!y;n({target:"Array",proto:!0,forced:_},{concat:function(t){var e,i,n,r,o,a=s(this),h=u(a,0),f=0;for(e=-1,n=arguments.length;e<n;e++)if(o=-1===e?a:arguments[e],b(o)){if(r=c(o),f+r>p)throw TypeError(v);for(i=0;i<r;i++,f++)i in o&&l(h,f,o[i])}else{if(f>=p)throw TypeError(v);l(h,f++,o)}return h.length=f,h}})},1710:function(t,e,i){var n=i(3085),r=i(2724),o=i(7423);n({target:"Array",proto:!0},{fill:r}),o("fill")},3436:function(t,e,i){"use strict";var n=i(3085),r=i(454).filter,o=i(242),a=o("filter");n({target:"Array",proto:!0,forced:!a},{filter:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}})},9823:function(t,e,i){"use strict";var n=i(3085),r=i(7397);n({target:"Array",proto:!0,forced:[].forEach!=r},{forEach:r})},9173:function(t,e,i){var n=i(3085),r=i(841),o=i(9770),a=!o((function(t){Array.from(t)}));n({target:"Array",stat:!0,forced:a},{from:r})},2276:function(t,e,i){"use strict";var n=i(3085),r=i(8180).indexOf,o=i(424),a=[].indexOf,s=!!a&&1/[1].indexOf(1,-0)<0,c=o("indexOf");n({target:"Array",proto:!0,forced:s||!c},{indexOf:function(t){return s?a.apply(this,arguments)||0:r(this,t,arguments.length>1?arguments[1]:void 0)}})},8118:function(t,e,i){var n=i(3085),r=i(4770);n({target:"Array",stat:!0},{isArray:r})},8939:function(t,e,i){"use strict";var n=i(101),r=i(7423),o=i(7771),a=i(3326),s=i(7218),c="Array Iterator",l=a.set,u=a.getterFor(c);t.exports=s(Array,"Array",(function(t,e){l(this,{type:c,target:n(t),index:0,kind:e})}),(function(){var t=u(this),e=t.target,i=t.kind,n=t.index++;return!e||n>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==i?{value:n,done:!1}:"values"==i?{value:e[n],done:!1}:{value:[n,e[n]],done:!1}}),"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},3838:function(t,e,i){"use strict";var n=i(3085),r=i(454).map,o=i(242),a=o("map");n({target:"Array",proto:!0,forced:!a},{map:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}})},5818:function(t,e,i){"use strict";var n=i(3085),r=i(4770),o=i(2091),a=i(5744),s=i(7739),c=i(4104),l=i(101),u=i(9361),h=i(8182),f=i(242),d=f("slice"),g=h("species"),p=[].slice,v=Math.max;n({target:"Array",proto:!0,forced:!d},{slice:function(t,e){var i,n,h,f=l(this),d=c(f),m=s(t,d),y=s(void 0===e?d:e,d);if(r(f)&&(i=f.constructor,o(i)&&(i===Array||r(i.prototype))?i=void 0:a(i)&&(i=i[g],null===i&&(i=void 0)),i===Array||void 0===i))return p.call(f,m,y);for(n=new(void 0===i?Array:i)(v(y-m,0)),h=0;m<y;m++,h++)m in f&&u(n,h,f[m]);return n.length=h,n}})},2178:function(t,e,i){"use strict";var n=i(3085),r=i(7739),o=i(1941),a=i(4104),s=i(1795),c=i(1321),l=i(9361),u=i(242),h=u("splice"),f=Math.max,d=Math.min,g=9007199254740991,p="Maximum allowed length exceeded";n({target:"Array",proto:!0,forced:!h},{splice:function(t,e){var i,n,u,h,v,m,y=s(this),b=a(y),_=r(t,b),x=arguments.length;if(0===x?i=n=0:1===x?(i=0,n=b-_):(i=x-2,n=d(f(o(e),0),b-_)),b+i-n>g)throw TypeError(p);for(u=c(y,n),h=0;h<n;h++)v=_+h,v in y&&l(u,h,y[v]);if(u.length=n,i<n){for(h=_;h<b-n;h++)v=h+n,m=h+i,v in y?y[m]=y[v]:delete y[m];for(h=b;h>b-n+i;h--)delete y[h-1]}else if(i>n)for(h=b-n;h>_;h--)v=h+n-1,m=h+i-1,v in y?y[m]=y[v]:delete y[m];for(h=0;h<i;h++)y[h+_]=arguments[h+2];return y.length=b-n+i,u}})},665:function(t,e,i){var n=i(3085),r=i(6782);n({target:"Function",proto:!0},{bind:r})},8671:function(t,e,i){var n=i(8576),r=i(1284);r(n.JSON,"JSON",!0)},8556:function(){},2666:function(t,e,i){var n=i(3085),r=i(2558);n({target:"Number",stat:!0,forced:Number.parseInt!=r},{parseInt:r})},3113:function(t,e,i){var n=i(3085),r=i(69),o=i(2853);n({target:"Object",stat:!0,sham:!r},{create:o})},297:function(t,e,i){var n=i(3085),r=i(69),o=i(2760);n({target:"Object",stat:!0,forced:!r,sham:!r},{defineProperty:o.f})},9234:function(t,e,i){var n=i(3085),r=i(6192),o=i(1795),a=i(9341),s=i(4635),c=r((function(){a(1)}));n({target:"Object",stat:!0,forced:c,sham:!s},{getPrototypeOf:function(t){return a(o(t))}})},2647:function(t,e,i){var n=i(3085),r=i(1795),o=i(7653),a=i(6192),s=a((function(){o(1)}));n({target:"Object",stat:!0,forced:s},{keys:function(t){return o(r(t))}})},3222:function(t,e,i){var n=i(3085),r=i(4469);n({target:"Object",stat:!0},{setPrototypeOf:r})},6663:function(){},4859:function(t,e,i){var n=i(3085),r=i(15);n({global:!0,forced:parseFloat!=r},{parseFloat:r})},5706:function(t,e,i){var n=i(3085),r=i(2558);n({global:!0,forced:parseInt!=r},{parseInt:r})},7884:function(t,e,i){"use strict";var n=i(3085),r=i(6235),o=i(9438),a=i(892),s=i(3442);n({target:"Promise",stat:!0},{allSettled:function(t){var e=this,i=o.f(e),n=i.resolve,c=i.reject,l=a((function(){var i=r(e.resolve),o=[],a=0,c=1;s(t,(function(t){var r=a++,s=!1;o.push(void 0),c++,i.call(e,t).then((function(t){s||(s=!0,o[r]={status:"fulfilled",value:t},--c||n(o))}),(function(t){s||(s=!0,o[r]={status:"rejected",reason:t},--c||n(o))}))})),--c||n(o)}));return l.error&&c(l.value),i.promise}})},8885:function(t,e,i){"use strict";var n=i(3085),r=i(6235),o=i(150),a=i(9438),s=i(892),c=i(3442),l="No one promise resolved";n({target:"Promise",stat:!0},{any:function(t){var e=this,i=a.f(e),n=i.resolve,u=i.reject,h=s((function(){var i=r(e.resolve),a=[],s=0,h=1,f=!1;c(t,(function(t){var r=s++,c=!1;a.push(void 0),h++,i.call(e,t).then((function(t){c||f||(f=!0,n(t))}),(function(t){c||f||(c=!0,a[r]=t,--h||u(new(o("AggregateError"))(a,l)))}))})),--h||u(new(o("AggregateError"))(a,l))}));return h.error&&u(h.value),i.promise}})},1868:function(t,e,i){"use strict";var n=i(3085),r=i(5546),o=i(4471),a=i(6192),s=i(150),c=i(6447),l=i(4743),u=i(9126),h=i(9482),f=!!o&&a((function(){o.prototype["finally"].call({then:function(){}},(function(){}))}));if(n({target:"Promise",proto:!0,real:!0,forced:f},{finally:function(t){var e=l(this,s("Promise")),i=c(t);return this.then(i?function(i){return u(e,t()).then((function(){return i}))}:t,i?function(i){return u(e,t()).then((function(){throw i}))}:t)}}),!r&&c(o)){var d=s("Promise").prototype["finally"];o.prototype["finally"]!==d&&h(o.prototype,"finally",d,{unsafe:!0})}},9021:function(t,e,i){"use strict";var n,r,o,a,s=i(3085),c=i(5546),l=i(8576),u=i(150),h=i(4471),f=i(9482),d=i(533),g=i(4469),p=i(1284),v=i(3656),m=i(6235),y=i(6447),b=i(5744),_=i(6961),x=i(9516),C=i(3442),I=i(9770),M=i(4743),S=i(7160).set,w=i(2950),T=i(9126),A=i(3681),D=i(9438),E=i(892),k=i(3326),O=i(9245),j=i(8182),L=i(2957),N=i(224),P=i(4218),z=j("species"),R="Promise",B=k.get,F=k.set,Y=k.getterFor(R),H=h&&h.prototype,U=h,W=H,G=l.TypeError,X=l.document,Z=l.process,V=D.f,J=V,Q=!!(X&&X.createEvent&&l.dispatchEvent),K=y(l.PromiseRejectionEvent),q="unhandledrejection",$="rejectionhandled",tt=0,et=1,it=2,nt=1,rt=2,ot=!1,at=O(R,(function(){var t=x(U),e=t!==String(U);if(!e&&66===P)return!0;if(c&&!W["finally"])return!0;if(P>=51&&/native code/.test(t))return!1;var i=new U((function(t){t(1)})),n=function(t){t((function(){}),(function(){}))},r=i.constructor={};return r[z]=n,ot=i.then((function(){}))instanceof n,!ot||!e&&L&&!K})),st=at||!I((function(t){U.all(t)["catch"]((function(){}))})),ct=function(t){var e;return!(!b(t)||!y(e=t.then))&&e},lt=function(t,e){if(!t.notified){t.notified=!0;var i=t.reactions;w((function(){var n=t.value,r=t.state==et,o=0;while(i.length>o){var a,s,c,l=i[o++],u=r?l.ok:l.fail,h=l.resolve,f=l.reject,d=l.domain;try{u?(r||(t.rejection===rt&&dt(t),t.rejection=nt),!0===u?a=n:(d&&d.enter(),a=u(n),d&&(d.exit(),c=!0)),a===l.promise?f(G("Promise-chain cycle")):(s=ct(a))?s.call(a,h,f):h(a)):f(n)}catch(g){d&&!c&&d.exit(),f(g)}}t.reactions=[],t.notified=!1,e&&!t.rejection&&ht(t)}))}},ut=function(t,e,i){var n,r;Q?(n=X.createEvent("Event"),n.promise=e,n.reason=i,n.initEvent(t,!1,!0),l.dispatchEvent(n)):n={promise:e,reason:i},!K&&(r=l["on"+t])?r(n):t===q&&A("Unhandled promise rejection",i)},ht=function(t){S.call(l,(function(){var e,i=t.facade,n=t.value,r=ft(t);if(r&&(e=E((function(){N?Z.emit("unhandledRejection",n,i):ut(q,i,n)})),t.rejection=N||ft(t)?rt:nt,e.error))throw e.value}))},ft=function(t){return t.rejection!==nt&&!t.parent},dt=function(t){S.call(l,(function(){var e=t.facade;N?Z.emit("rejectionHandled",e):ut($,e,t.value)}))},gt=function(t,e,i){return function(n){t(e,n,i)}},pt=function(t,e,i){t.done||(t.done=!0,i&&(t=i),t.value=e,t.state=it,lt(t,!0))},vt=function(t,e,i){if(!t.done){t.done=!0,i&&(t=i);try{if(t.facade===e)throw G("Promise can't be resolved itself");var n=ct(e);n?w((function(){var i={done:!1};try{n.call(e,gt(vt,i,t),gt(pt,i,t))}catch(r){pt(i,r,t)}})):(t.value=e,t.state=et,lt(t,!1))}catch(r){pt({done:!1},r,t)}}};if(at&&(U=function(t){_(this,U,R),m(t),n.call(this);var e=B(this);try{t(gt(vt,e),gt(pt,e))}catch(i){pt(e,i)}},W=U.prototype,n=function(t){F(this,{type:R,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:tt,value:void 0})},n.prototype=d(W,{then:function(t,e){var i=Y(this),n=V(M(this,U));return n.ok=!y(t)||t,n.fail=y(e)&&e,n.domain=N?Z.domain:void 0,i.parent=!0,i.reactions.push(n),i.state!=tt&&lt(i,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),r=function(){var t=new n,e=B(t);this.promise=t,this.resolve=gt(vt,e),this.reject=gt(pt,e)},D.f=V=function(t){return t===U||t===o?new r(t):J(t)},!c&&y(h)&&H!==Object.prototype)){a=H.then,ot||(f(H,"then",(function(t,e){var i=this;return new U((function(t,e){a.call(i,t,e)})).then(t,e)}),{unsafe:!0}),f(H,"catch",W["catch"],{unsafe:!0}));try{delete H.constructor}catch(mt){}g&&g(H,W)}s({global:!0,wrap:!0,forced:at},{Promise:U}),p(U,R,!1,!0),v(R),o=u(R),s({target:R,stat:!0,forced:at},{reject:function(t){var e=V(this);return e.reject.call(void 0,t),e.promise}}),s({target:R,stat:!0,forced:c||at},{resolve:function(t){return T(c&&this===o?U:this,t)}}),s({target:R,stat:!0,forced:st},{all:function(t){var e=this,i=V(e),n=i.resolve,r=i.reject,o=E((function(){var i=m(e.resolve),o=[],a=0,s=1;C(t,(function(t){var c=a++,l=!1;o.push(void 0),s++,i.call(e,t).then((function(t){l||(l=!0,o[c]=t,--s||n(o))}),r)})),--s||n(o)}));return o.error&&r(o.value),i.promise},race:function(t){var e=this,i=V(e),n=i.reject,r=E((function(){var r=m(e.resolve);C(t,(function(t){r.call(e,t).then(i.resolve,n)}))}));return r.error&&n(r.value),i.promise}})},5397:function(t,e,i){var n=i(3085),r=i(150),o=i(1404),a=i(1138),s=i(5744),c=i(2853),l=i(6782),u=i(6192),h=r("Reflect","construct"),f=u((function(){function t(){}return!(h((function(){}),[],t)instanceof t)})),d=!u((function(){h((function(){}))})),g=f||d;n({target:"Reflect",stat:!0,forced:g,sham:g},{construct:function(t,e){o(t),a(e);var i=arguments.length<3?t:o(arguments[2]);if(d&&!f)return h(t,e,i);if(t==i){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var n=[null];return n.push.apply(n,e),new(l.apply(t,n))}var r=i.prototype,u=c(s(r)?r:Object.prototype),g=Function.apply.call(t,u,e);return s(g)?g:u}})},1367:function(){},5454:function(t,e,i){"use strict";var n=i(863).charAt,r=i(4845),o=i(3326),a=i(7218),s="String Iterator",c=o.set,l=o.getterFor(s);a(String,"String",(function(t){c(this,{type:s,string:r(t),index:0})}),(function(){var t,e=l(this),i=e.string,r=e.index;return r>=i.length?{value:void 0,done:!0}:(t=n(i,r),e.index+=t.length,{value:t,done:!1})}))},957:function(t,e,i){"use strict";var n=i(3085),r=i(4277).trim,o=i(6815);n({target:"String",proto:!0,forced:o("trim")},{trim:function(){return r(this)}})},9781:function(t,e,i){var n=i(1488);n("asyncIterator")},492:function(){},6681:function(t,e,i){var n=i(1488);n("hasInstance")},9594:function(t,e,i){var n=i(1488);n("isConcatSpreadable")},3665:function(t,e,i){var n=i(1488);n("iterator")},6187:function(t,e,i){"use strict";var n=i(3085),r=i(8576),o=i(150),a=i(5546),s=i(69),c=i(3045),l=i(6192),u=i(4500),h=i(4770),f=i(6447),d=i(5744),g=i(3236),p=i(1138),v=i(1795),m=i(101),y=i(77),b=i(4845),_=i(774),x=i(2853),C=i(7653),I=i(2092),M=i(4052),S=i(4750),w=i(5141),T=i(2760),A=i(6007),D=i(9482),E=i(8717),k=i(9766),O=i(4535),j=i(2759),L=i(8182),N=i(9207),P=i(1488),z=i(1284),R=i(3326),B=i(454).forEach,F=k("hidden"),Y="Symbol",H="prototype",U=L("toPrimitive"),W=R.set,G=R.getterFor(Y),X=Object[H],Z=r.Symbol,V=o("JSON","stringify"),J=w.f,Q=T.f,K=M.f,q=A.f,$=E("symbols"),tt=E("op-symbols"),et=E("string-to-symbol-registry"),it=E("symbol-to-string-registry"),nt=E("wks"),rt=r.QObject,ot=!rt||!rt[H]||!rt[H].findChild,at=s&&l((function(){return 7!=x(Q({},"a",{get:function(){return Q(this,"a",{value:7}).a}})).a}))?function(t,e,i){var n=J(X,e);n&&delete X[e],Q(t,e,i),n&&t!==X&&Q(X,e,n)}:Q,st=function(t,e){var i=$[t]=x(Z[H]);return W(i,{type:Y,tag:t,description:e}),s||(i.description=e),i},ct=function(t,e,i){t===X&&ct(tt,e,i),p(t);var n=y(e);return p(i),u($,n)?(i.enumerable?(u(t,F)&&t[F][n]&&(t[F][n]=!1),i=x(i,{enumerable:_(0,!1)})):(u(t,F)||Q(t,F,_(1,{})),t[F][n]=!0),at(t,n,i)):Q(t,n,i)},lt=function(t,e){p(t);var i=m(e),n=C(i).concat(gt(i));return B(n,(function(e){s&&!ht.call(i,e)||ct(t,e,i[e])})),t},ut=function(t,e){return void 0===e?x(t):lt(x(t),e)},ht=function(t){var e=y(t),i=q.call(this,e);return!(this===X&&u($,e)&&!u(tt,e))&&(!(i||!u(this,e)||!u($,e)||u(this,F)&&this[F][e])||i)},ft=function(t,e){var i=m(t),n=y(e);if(i!==X||!u($,n)||u(tt,n)){var r=J(i,n);return!r||!u($,n)||u(i,F)&&i[F][n]||(r.enumerable=!0),r}},dt=function(t){var e=K(m(t)),i=[];return B(e,(function(t){u($,t)||u(O,t)||i.push(t)})),i},gt=function(t){var e=t===X,i=K(e?tt:m(t)),n=[];return B(i,(function(t){!u($,t)||e&&!u(X,t)||n.push($[t])})),n};if(c||(Z=function(){if(this instanceof Z)throw TypeError("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?b(arguments[0]):void 0,e=j(t),i=function(t){this===X&&i.call(tt,t),u(this,F)&&u(this[F],e)&&(this[F][e]=!1),at(this,e,_(1,t))};return s&&ot&&at(X,e,{configurable:!0,set:i}),st(e,t)},D(Z[H],"toString",(function(){return G(this).tag})),D(Z,"withoutSetter",(function(t){return st(j(t),t)})),A.f=ht,T.f=ct,w.f=ft,I.f=M.f=dt,S.f=gt,N.f=function(t){return st(L(t),t)},s&&(Q(Z[H],"description",{configurable:!0,get:function(){return G(this).description}}),a||D(X,"propertyIsEnumerable",ht,{unsafe:!0}))),n({global:!0,wrap:!0,forced:!c,sham:!c},{Symbol:Z}),B(C(nt),(function(t){P(t)})),n({target:Y,stat:!0,forced:!c},{for:function(t){var e=b(t);if(u(et,e))return et[e];var i=Z(e);return et[e]=i,it[i]=e,i},keyFor:function(t){if(!g(t))throw TypeError(t+" is not a symbol");if(u(it,t))return it[t]},useSetter:function(){ot=!0},useSimple:function(){ot=!1}}),n({target:"Object",stat:!0,forced:!c,sham:!s},{create:ut,defineProperty:ct,defineProperties:lt,getOwnPropertyDescriptor:ft}),n({target:"Object",stat:!0,forced:!c},{getOwnPropertyNames:dt,getOwnPropertySymbols:gt}),n({target:"Object",stat:!0,forced:l((function(){S.f(1)}))},{getOwnPropertySymbols:function(t){return S.f(v(t))}}),V){var pt=!c||l((function(){var t=Z();return"[null]"!=V([t])||"{}"!=V({a:t})||"{}"!=V(Object(t))}));n({target:"JSON",stat:!0,forced:pt},{stringify:function(t,e,i){var n,r=[t],o=1;while(arguments.length>o)r.push(arguments[o++]);if(n=e,(d(e)||void 0!==t)&&!g(t))return h(e)||(e=function(t,e){if(f(n)&&(e=n.call(this,t,e)),!g(e))return e}),r[1]=e,V.apply(null,r)}})}if(!Z[H][U]){var vt=Z[H].valueOf;D(Z[H],U,(function(){return vt.apply(this,arguments)}))}z(Z,Y),O[F]=!0},1250:function(t,e,i){var n=i(1488);n("matchAll")},9017:function(t,e,i){var n=i(1488);n("match")},9786:function(t,e,i){var n=i(1488);n("replace")},503:function(t,e,i){var n=i(1488);n("search")},6565:function(t,e,i){var n=i(1488);n("species")},9322:function(t,e,i){var n=i(1488);n("split")},3610:function(t,e,i){var n=i(1488);n("toPrimitive")},6886:function(t,e,i){var n=i(1488);n("toStringTag")},3514:function(t,e,i){var n=i(1488);n("unscopables")},177:function(t,e,i){var n=i(1488);n("asyncDispose")},9031:function(t,e,i){var n=i(1488);n("dispose")},6658:function(t,e,i){var n=i(1488);n("matcher")},1875:function(t,e,i){var n=i(1488);n("metadata")},8658:function(t,e,i){var n=i(1488);n("observable")},4592:function(t,e,i){var n=i(1488);n("patternMatch")},6680:function(t,e,i){var n=i(1488);n("replaceAll")},162:function(t,e,i){i(8939);var n=i(7365),r=i(8576),o=i(4696),a=i(8711),s=i(7771),c=i(8182),l=c("toStringTag");for(var u in n){var h=r[u],f=h&&h.prototype;f&&o(f)!==l&&a(f,l,u),s[u]=s.Array}},2906:function(t,e,i){var n=i(3085),r=i(8576),o=i(6447),a=i(8989),s=[].slice,c=/MSIE .\./.test(a),l=function(t){return function(e,i){var n=arguments.length>2,r=n?s.call(arguments,2):void 0;return t(n?function(){(o(e)?e:Function(e)).apply(this,r)}:e,i)}};n({global:!0,bind:!0,forced:c},{setTimeout:l(r.setTimeout),setInterval:l(r.setInterval)})},9336:function(t,e,i){"use strict";i(8939);var n=i(3085),r=i(150),o=i(4551),a=i(9482),s=i(533),c=i(1284),l=i(5148),u=i(3326),h=i(6961),f=i(6447),d=i(4500),g=i(8043),p=i(4696),v=i(1138),m=i(5744),y=i(4845),b=i(2853),_=i(774),x=i(1669),C=i(8703),I=i(8182),M=r("fetch"),S=r("Request"),w=S&&S.prototype,T=r("Headers"),A=I("iterator"),D="URLSearchParams",E=D+"Iterator",k=u.set,O=u.getterFor(D),j=u.getterFor(E),L=/\+/g,N=Array(4),P=function(t){return N[t-1]||(N[t-1]=RegExp("((?:%[\\da-f]{2}){"+t+"})","gi"))},z=function(t){try{return decodeURIComponent(t)}catch(e){return t}},R=function(t){var e=t.replace(L," "),i=4;try{return decodeURIComponent(e)}catch(n){while(i)e=e.replace(P(i--),z);return e}},B=/[!'()~]|%20/g,F={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Y=function(t){return F[t]},H=function(t){return encodeURIComponent(t).replace(B,Y)},U=function(t,e){if(e){var i,n,r=e.split("&"),o=0;while(o<r.length)i=r[o++],i.length&&(n=i.split("="),t.push({key:R(n.shift()),value:R(n.join("="))}))}},W=function(t){this.entries.length=0,U(this.entries,t)},G=function(t,e){if(t<e)throw TypeError("Not enough arguments")},X=l((function(t,e){k(this,{type:E,iterator:x(O(t).entries),kind:e})}),"Iterator",(function(){var t=j(this),e=t.kind,i=t.iterator.next(),n=i.value;return i.done||(i.value="keys"===e?n.key:"values"===e?n.value:[n.key,n.value]),i})),Z=function(){h(this,Z,D);var t,e,i,n,r,o,a,s,c,l=arguments.length>0?arguments[0]:void 0,u=this,f=[];if(k(u,{type:D,entries:f,updateURL:function(){},updateSearchParams:W}),void 0!==l)if(m(l))if(t=C(l),t){e=x(l,t),i=e.next;while(!(n=i.call(e)).done){if(r=x(v(n.value)),o=r.next,(a=o.call(r)).done||(s=o.call(r)).done||!o.call(r).done)throw TypeError("Expected sequence with length 2");f.push({key:y(a.value),value:y(s.value)})}}else for(c in l)d(l,c)&&f.push({key:c,value:y(l[c])});else U(f,"string"===typeof l?"?"===l.charAt(0)?l.slice(1):l:y(l))},V=Z.prototype;if(s(V,{append:function(t,e){G(arguments.length,2);var i=O(this);i.entries.push({key:y(t),value:y(e)}),i.updateURL()},delete:function(t){G(arguments.length,1);var e=O(this),i=e.entries,n=y(t),r=0;while(r<i.length)i[r].key===n?i.splice(r,1):r++;e.updateURL()},get:function(t){G(arguments.length,1);for(var e=O(this).entries,i=y(t),n=0;n<e.length;n++)if(e[n].key===i)return e[n].value;return null},getAll:function(t){G(arguments.length,1);for(var e=O(this).entries,i=y(t),n=[],r=0;r<e.length;r++)e[r].key===i&&n.push(e[r].value);return n},has:function(t){G(arguments.length,1);var e=O(this).entries,i=y(t),n=0;while(n<e.length)if(e[n++].key===i)return!0;return!1},set:function(t,e){G(arguments.length,1);for(var i,n=O(this),r=n.entries,o=!1,a=y(t),s=y(e),c=0;c<r.length;c++)i=r[c],i.key===a&&(o?r.splice(c--,1):(o=!0,i.value=s));o||r.push({key:a,value:s}),n.updateURL()},sort:function(){var t,e,i,n=O(this),r=n.entries,o=r.slice();for(r.length=0,i=0;i<o.length;i++){for(t=o[i],e=0;e<i;e++)if(r[e].key>t.key){r.splice(e,0,t);break}e===i&&r.push(t)}n.updateURL()},forEach:function(t){var e,i=O(this).entries,n=g(t,arguments.length>1?arguments[1]:void 0,3),r=0;while(r<i.length)e=i[r++],n(e.value,e.key,this)},keys:function(){return new X(this,"keys")},values:function(){return new X(this,"values")},entries:function(){return new X(this,"entries")}},{enumerable:!0}),a(V,A,V.entries,{name:"entries"}),a(V,"toString",(function(){var t,e=O(this).entries,i=[],n=0;while(n<e.length)t=e[n++],i.push(H(t.key)+"="+H(t.value));return i.join("&")}),{enumerable:!0}),c(Z,D),n({global:!0,forced:!o},{URLSearchParams:Z}),!o&&f(T)){var J=function(t){if(m(t)){var e,i=t.body;if(p(i)===D)return e=t.headers?new T(t.headers):new T,e.has("content-type")||e.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),b(t,{body:_(0,String(i)),headers:_(0,e)})}return t};if(f(M)&&n({global:!0,enumerable:!0,forced:!0},{fetch:function(t){return M(t,arguments.length>1?J(arguments[1]):{})}}),f(S)){var Q=function(t){return h(this,Q,"Request"),new S(t,arguments.length>1?J(arguments[1]):{})};w.constructor=Q,Q.prototype=w,n({global:!0,forced:!0},{Request:Q})}}t.exports={URLSearchParams:Z,getState:O}},4948:function(t,e,i){"use strict";i(5454);var n,r=i(3085),o=i(69),a=i(4551),s=i(8576),c=i(1187),l=i(9482),u=i(6961),h=i(4500),f=i(2503),d=i(841),g=i(863).codeAt,p=i(7977),v=i(4845),m=i(1284),y=i(9336),b=i(3326),_=s.URL,x=y.URLSearchParams,C=y.getState,I=b.set,M=b.getterFor("URL"),S=Math.floor,w=Math.pow,T="Invalid authority",A="Invalid scheme",D="Invalid host",E="Invalid port",k=/[A-Za-z]/,O=/[\d+-.A-Za-z]/,j=/\d/,L=/^0x/i,N=/^[0-7]+$/,P=/^\d+$/,z=/^[\dA-Fa-f]+$/,R=/[\0\t\n\r #%/:<>?@[\\\]^|]/,B=/[\0\t\n\r #/:<>?@[\\\]^|]/,F=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,Y=/[\t\n\r]/g,H=function(t,e){var i,n,r;if("["==e.charAt(0)){if("]"!=e.charAt(e.length-1))return D;if(i=W(e.slice(1,-1)),!i)return D;t.host=i}else if($(t)){if(e=p(e),R.test(e))return D;if(i=U(e),null===i)return D;t.host=i}else{if(B.test(e))return D;for(i="",n=d(e),r=0;r<n.length;r++)i+=K(n[r],Z);t.host=i}},U=function(t){var e,i,n,r,o,a,s,c=t.split(".");if(c.length&&""==c[c.length-1]&&c.pop(),e=c.length,e>4)return t;for(i=[],n=0;n<e;n++){if(r=c[n],""==r)return t;if(o=10,r.length>1&&"0"==r.charAt(0)&&(o=L.test(r)?16:8,r=r.slice(8==o?1:2)),""===r)a=0;else{if(!(10==o?P:8==o?N:z).test(r))return t;a=parseInt(r,o)}i.push(a)}for(n=0;n<e;n++)if(a=i[n],n==e-1){if(a>=w(256,5-e))return null}else if(a>255)return null;for(s=i.pop(),n=0;n<i.length;n++)s+=i[n]*w(256,3-n);return s},W=function(t){var e,i,n,r,o,a,s,c=[0,0,0,0,0,0,0,0],l=0,u=null,h=0,f=function(){return t.charAt(h)};if(":"==f()){if(":"!=t.charAt(1))return;h+=2,l++,u=l}while(f()){if(8==l)return;if(":"!=f()){e=i=0;while(i<4&&z.test(f()))e=16*e+parseInt(f(),16),h++,i++;if("."==f()){if(0==i)return;if(h-=i,l>6)return;n=0;while(f()){if(r=null,n>0){if(!("."==f()&&n<4))return;h++}if(!j.test(f()))return;while(j.test(f())){if(o=parseInt(f(),10),null===r)r=o;else{if(0==r)return;r=10*r+o}if(r>255)return;h++}c[l]=256*c[l]+r,n++,2!=n&&4!=n||l++}if(4!=n)return;break}if(":"==f()){if(h++,!f())return}else if(f())return;c[l++]=e}else{if(null!==u)return;h++,l++,u=l}}if(null!==u){a=l-u,l=7;while(0!=l&&a>0)s=c[l],c[l--]=c[u+a-1],c[u+--a]=s}else if(8!=l)return;return c},G=function(t){for(var e=null,i=1,n=null,r=0,o=0;o<8;o++)0!==t[o]?(r>i&&(e=n,i=r),n=null,r=0):(null===n&&(n=o),++r);return r>i&&(e=n,i=r),e},X=function(t){var e,i,n,r;if("number"==typeof t){for(e=[],i=0;i<4;i++)e.unshift(t%256),t=S(t/256);return e.join(".")}if("object"==typeof t){for(e="",n=G(t),i=0;i<8;i++)r&&0===t[i]||(r&&(r=!1),n===i?(e+=i?":":"::",r=!0):(e+=t[i].toString(16),i<7&&(e+=":")));return"["+e+"]"}return t},Z={},V=f({},Z,{" ":1,'"':1,"<":1,">":1,"`":1}),J=f({},V,{"#":1,"?":1,"{":1,"}":1}),Q=f({},J,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),K=function(t,e){var i=g(t,0);return i>32&&i<127&&!h(e,t)?t:encodeURIComponent(t)},q={ftp:21,file:null,http:80,https:443,ws:80,wss:443},$=function(t){return h(q,t.scheme)},tt=function(t){return""!=t.username||""!=t.password},et=function(t){return!t.host||t.cannotBeABaseURL||"file"==t.scheme},it=function(t,e){var i;return 2==t.length&&k.test(t.charAt(0))&&(":"==(i=t.charAt(1))||!e&&"|"==i)},nt=function(t){var e;return t.length>1&&it(t.slice(0,2))&&(2==t.length||"/"===(e=t.charAt(2))||"\\"===e||"?"===e||"#"===e)},rt=function(t){var e=t.path,i=e.length;!i||"file"==t.scheme&&1==i&&it(e[0],!0)||e.pop()},ot=function(t){return"."===t||"%2e"===t.toLowerCase()},at=function(t){return t=t.toLowerCase(),".."===t||"%2e."===t||".%2e"===t||"%2e%2e"===t},st={},ct={},lt={},ut={},ht={},ft={},dt={},gt={},pt={},vt={},mt={},yt={},bt={},_t={},xt={},Ct={},It={},Mt={},St={},wt={},Tt={},At=function(t,e,i,r){var o,a,s,c,l=i||st,u=0,f="",g=!1,p=!1,v=!1;i||(t.scheme="",t.username="",t.password="",t.host=null,t.port=null,t.path=[],t.query=null,t.fragment=null,t.cannotBeABaseURL=!1,e=e.replace(F,"")),e=e.replace(Y,""),o=d(e);while(u<=o.length){switch(a=o[u],l){case st:if(!a||!k.test(a)){if(i)return A;l=lt;continue}f+=a.toLowerCase(),l=ct;break;case ct:if(a&&(O.test(a)||"+"==a||"-"==a||"."==a))f+=a.toLowerCase();else{if(":"!=a){if(i)return A;f="",l=lt,u=0;continue}if(i&&($(t)!=h(q,f)||"file"==f&&(tt(t)||null!==t.port)||"file"==t.scheme&&!t.host))return;if(t.scheme=f,i)return void($(t)&&q[t.scheme]==t.port&&(t.port=null));f="","file"==t.scheme?l=_t:$(t)&&r&&r.scheme==t.scheme?l=ut:$(t)?l=gt:"/"==o[u+1]?(l=ht,u++):(t.cannotBeABaseURL=!0,t.path.push(""),l=St)}break;case lt:if(!r||r.cannotBeABaseURL&&"#"!=a)return A;if(r.cannotBeABaseURL&&"#"==a){t.scheme=r.scheme,t.path=r.path.slice(),t.query=r.query,t.fragment="",t.cannotBeABaseURL=!0,l=Tt;break}l="file"==r.scheme?_t:ft;continue;case ut:if("/"!=a||"/"!=o[u+1]){l=ft;continue}l=pt,u++;break;case ht:if("/"==a){l=vt;break}l=Mt;continue;case ft:if(t.scheme=r.scheme,a==n)t.username=r.username,t.password=r.password,t.host=r.host,t.port=r.port,t.path=r.path.slice(),t.query=r.query;else if("/"==a||"\\"==a&&$(t))l=dt;else if("?"==a)t.username=r.username,t.password=r.password,t.host=r.host,t.port=r.port,t.path=r.path.slice(),t.query="",l=wt;else{if("#"!=a){t.username=r.username,t.password=r.password,t.host=r.host,t.port=r.port,t.path=r.path.slice(),t.path.pop(),l=Mt;continue}t.username=r.username,t.password=r.password,t.host=r.host,t.port=r.port,t.path=r.path.slice(),t.query=r.query,t.fragment="",l=Tt}break;case dt:if(!$(t)||"/"!=a&&"\\"!=a){if("/"!=a){t.username=r.username,t.password=r.password,t.host=r.host,t.port=r.port,l=Mt;continue}l=vt}else l=pt;break;case gt:if(l=pt,"/"!=a||"/"!=f.charAt(u+1))continue;u++;break;case pt:if("/"!=a&&"\\"!=a){l=vt;continue}break;case vt:if("@"==a){g&&(f="%40"+f),g=!0,s=d(f);for(var m=0;m<s.length;m++){var y=s[m];if(":"!=y||v){var b=K(y,Q);v?t.password+=b:t.username+=b}else v=!0}f=""}else if(a==n||"/"==a||"?"==a||"#"==a||"\\"==a&&$(t)){if(g&&""==f)return T;u-=d(f).length+1,f="",l=mt}else f+=a;break;case mt:case yt:if(i&&"file"==t.scheme){l=Ct;continue}if(":"!=a||p){if(a==n||"/"==a||"?"==a||"#"==a||"\\"==a&&$(t)){if($(t)&&""==f)return D;if(i&&""==f&&(tt(t)||null!==t.port))return;if(c=H(t,f),c)return c;if(f="",l=It,i)return;continue}"["==a?p=!0:"]"==a&&(p=!1),f+=a}else{if(""==f)return D;if(c=H(t,f),c)return c;if(f="",l=bt,i==yt)return}break;case bt:if(!j.test(a)){if(a==n||"/"==a||"?"==a||"#"==a||"\\"==a&&$(t)||i){if(""!=f){var _=parseInt(f,10);if(_>65535)return E;t.port=$(t)&&_===q[t.scheme]?null:_,f=""}if(i)return;l=It;continue}return E}f+=a;break;case _t:if(t.scheme="file","/"==a||"\\"==a)l=xt;else{if(!r||"file"!=r.scheme){l=Mt;continue}if(a==n)t.host=r.host,t.path=r.path.slice(),t.query=r.query;else if("?"==a)t.host=r.host,t.path=r.path.slice(),t.query="",l=wt;else{if("#"!=a){nt(o.slice(u).join(""))||(t.host=r.host,t.path=r.path.slice(),rt(t)),l=Mt;continue}t.host=r.host,t.path=r.path.slice(),t.query=r.query,t.fragment="",l=Tt}}break;case xt:if("/"==a||"\\"==a){l=Ct;break}r&&"file"==r.scheme&&!nt(o.slice(u).join(""))&&(it(r.path[0],!0)?t.path.push(r.path[0]):t.host=r.host),l=Mt;continue;case Ct:if(a==n||"/"==a||"\\"==a||"?"==a||"#"==a){if(!i&&it(f))l=Mt;else if(""==f){if(t.host="",i)return;l=It}else{if(c=H(t,f),c)return c;if("localhost"==t.host&&(t.host=""),i)return;f="",l=It}continue}f+=a;break;case It:if($(t)){if(l=Mt,"/"!=a&&"\\"!=a)continue}else if(i||"?"!=a)if(i||"#"!=a){if(a!=n&&(l=Mt,"/"!=a))continue}else t.fragment="",l=Tt;else t.query="",l=wt;break;case Mt:if(a==n||"/"==a||"\\"==a&&$(t)||!i&&("?"==a||"#"==a)){if(at(f)?(rt(t),"/"==a||"\\"==a&&$(t)||t.path.push("")):ot(f)?"/"==a||"\\"==a&&$(t)||t.path.push(""):("file"==t.scheme&&!t.path.length&&it(f)&&(t.host&&(t.host=""),f=f.charAt(0)+":"),t.path.push(f)),f="","file"==t.scheme&&(a==n||"?"==a||"#"==a))while(t.path.length>1&&""===t.path[0])t.path.shift();"?"==a?(t.query="",l=wt):"#"==a&&(t.fragment="",l=Tt)}else f+=K(a,J);break;case St:"?"==a?(t.query="",l=wt):"#"==a?(t.fragment="",l=Tt):a!=n&&(t.path[0]+=K(a,Z));break;case wt:i||"#"!=a?a!=n&&("'"==a&&$(t)?t.query+="%27":t.query+="#"==a?"%23":K(a,Z)):(t.fragment="",l=Tt);break;case Tt:a!=n&&(t.fragment+=K(a,V));break}u++}},Dt=function(t){var e,i,n=u(this,Dt,"URL"),r=arguments.length>1?arguments[1]:void 0,a=v(t),s=I(n,{type:"URL"});if(void 0!==r)if(r instanceof Dt)e=M(r);else if(i=At(e={},v(r)),i)throw TypeError(i);if(i=At(s,a,null,e),i)throw TypeError(i);var c=s.searchParams=new x,l=C(c);l.updateSearchParams(s.query),l.updateURL=function(){s.query=String(c)||null},o||(n.href=kt.call(n),n.origin=Ot.call(n),n.protocol=jt.call(n),n.username=Lt.call(n),n.password=Nt.call(n),n.host=Pt.call(n),n.hostname=zt.call(n),n.port=Rt.call(n),n.pathname=Bt.call(n),n.search=Ft.call(n),n.searchParams=Yt.call(n),n.hash=Ht.call(n))},Et=Dt.prototype,kt=function(){var t=M(this),e=t.scheme,i=t.username,n=t.password,r=t.host,o=t.port,a=t.path,s=t.query,c=t.fragment,l=e+":";return null!==r?(l+="//",tt(t)&&(l+=i+(n?":"+n:"")+"@"),l+=X(r),null!==o&&(l+=":"+o)):"file"==e&&(l+="//"),l+=t.cannotBeABaseURL?a[0]:a.length?"/"+a.join("/"):"",null!==s&&(l+="?"+s),null!==c&&(l+="#"+c),l},Ot=function(){var t=M(this),e=t.scheme,i=t.port;if("blob"==e)try{return new Dt(e.path[0]).origin}catch(n){return"null"}return"file"!=e&&$(t)?e+"://"+X(t.host)+(null!==i?":"+i:""):"null"},jt=function(){return M(this).scheme+":"},Lt=function(){return M(this).username},Nt=function(){return M(this).password},Pt=function(){var t=M(this),e=t.host,i=t.port;return null===e?"":null===i?X(e):X(e)+":"+i},zt=function(){var t=M(this).host;return null===t?"":X(t)},Rt=function(){var t=M(this).port;return null===t?"":String(t)},Bt=function(){var t=M(this),e=t.path;return t.cannotBeABaseURL?e[0]:e.length?"/"+e.join("/"):""},Ft=function(){var t=M(this).query;return t?"?"+t:""},Yt=function(){return M(this).searchParams},Ht=function(){var t=M(this).fragment;return t?"#"+t:""},Ut=function(t,e){return{get:t,set:e,configurable:!0,enumerable:!0}};if(o&&c(Et,{href:Ut(kt,(function(t){var e=M(this),i=v(t),n=At(e,i);if(n)throw TypeError(n);C(e.searchParams).updateSearchParams(e.query)})),origin:Ut(Ot),protocol:Ut(jt,(function(t){var e=M(this);At(e,v(t)+":",st)})),username:Ut(Lt,(function(t){var e=M(this),i=d(v(t));if(!et(e)){e.username="";for(var n=0;n<i.length;n++)e.username+=K(i[n],Q)}})),password:Ut(Nt,(function(t){var e=M(this),i=d(v(t));if(!et(e)){e.password="";for(var n=0;n<i.length;n++)e.password+=K(i[n],Q)}})),host:Ut(Pt,(function(t){var e=M(this);e.cannotBeABaseURL||At(e,v(t),mt)})),hostname:Ut(zt,(function(t){var e=M(this);e.cannotBeABaseURL||At(e,v(t),yt)})),port:Ut(Rt,(function(t){var e=M(this);et(e)||(t=v(t),""==t?e.port=null:At(e,t,bt))})),pathname:Ut(Bt,(function(t){var e=M(this);e.cannotBeABaseURL||(e.path=[],At(e,v(t),It))})),search:Ut(Ft,(function(t){var e=M(this);t=v(t),""==t?e.query=null:("?"==t.charAt(0)&&(t=t.slice(1)),e.query="",At(e,t,wt)),C(e.searchParams).updateSearchParams(e.query)})),searchParams:Ut(Yt),hash:Ut(Ht,(function(t){var e=M(this);t=v(t),""!=t?("#"==t.charAt(0)&&(t=t.slice(1)),e.fragment="",At(e,t,Tt)):e.fragment=null}))}),l(Et,"toJSON",(function(){return kt.call(this)}),{enumerable:!0}),l(Et,"toString",(function(){return kt.call(this)}),{enumerable:!0}),_){var Wt=_.createObjectURL,Gt=_.revokeObjectURL;Wt&&l(Dt,"createObjectURL",(function(t){return Wt.apply(_,arguments)})),Gt&&l(Dt,"revokeObjectURL",(function(t){return Gt.apply(_,arguments)}))}m(Dt,"URL"),r({global:!0,forced:!a,sham:!o},{URL:Dt})},9801:function(){},3822:function(t,e,i){var n=i(2221);t.exports=n},1434:function(t,e,i){var n=i(5078);t.exports=n},6899:function(t,e,i){var n=i(98);t.exports=n},7710:function(t,e,i){var n=i(5739);i(162),t.exports=n},4486:function(t,e,i){var n=i(278);t.exports=n},4877:function(t,e,i){var n=i(1484);t.exports=n},7178:function(t,e,i){var n=i(7731);t.exports=n},5603:function(t,e,i){var n=i(3669);t.exports=n},1206:function(t,e,i){i(162);var n=i(6899),r=i(4696),o=Array.prototype,a={DOMTokenList:!0,NodeList:!0};t.exports=function(t){var e=t.forEach;return t===o||t instanceof Array&&e===o.forEach||a.hasOwnProperty(r(t))?n:e}},6174:function(t,e,i){var n=i(2604);t.exports=n},57:function(t,e,i){var n=i(263);t.exports=n},4741:function(t,e,i){var n=i(7663);t.exports=n},8368:function(t,e,i){var n=i(5063);t.exports=n},3739:function(t,e,i){var n=i(6813);t.exports=n},172:function(t,e,i){var n=i(6285);t.exports=n},4963:function(t,e,i){var n=i(3213);t.exports=n},7820:function(t,e,i){var n=i(3512);t.exports=n},8980:function(t,e,i){var n=i(8168);t.exports=n},5636:function(t,e,i){var n=i(8651);t.exports=n},6672:function(t,e,i){var n=i(3083);t.exports=n},5059:function(t,e,i){var n=i(2987);t.exports=n},3969:function(t,e,i){var n=i(2239);t.exports=n},6618:function(t,e,i){var n=i(3154);i(162),t.exports=n},5279:function(t,e,i){var n=i(6577);t.exports=n},9562:function(t,e,i){i(2906);var n=i(7545);t.exports=n.setTimeout},2285:function(t,e,i){var n=i(5008);i(162),t.exports=n},8535:function(t,e,i){var n=i(994);i(162),t.exports=n},652:function(t,e,i){var n=i(5668);t.exports=n},5668:function(t,e,i){i(4948),i(9801),i(9336);var n=i(7545);t.exports=n.URL},2534:function(t){"use strict";t.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KPHN2ZyBkaXNwbGF5PSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KPGRlZnMgaWQ9InR1aS1pbWFnZS1lZGl0b3Itc3ZnLWRlZmF1bHQtaWNvbnMiPgo8c3ltYm9sIGlkPSJpYy1hcHBseSIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIHN0cm9rZT0ibm9uZSIgZmlsbD0ibm9uZSIvPgogICAgPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJpbmhlcml0IiBkPSJNNCAxMi4wMTFsNSA1TDIwLjAxMSA2Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1jYW5jZWwiIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgICA8cGF0aCBkPSJNMCAwaDI0djI0SDB6IiBmaWxsPSJub25lIiBzdHJva2U9Im5vbmUiLz4KICAgIDxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iaW5oZXJpdCIgZD0iTTYgNmwxMiAxMk0xOCA2TDYgMTgiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWNyb3AiIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgICA8cGF0aCBkPSJNMCAwaDI0djI0SDB6IiBzdHJva2U9Im5vbmUiIGZpbGw9Im5vbmUiIC8+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik00IDBoMXYyMGExIDEgMCAwIDEtMS0xVjB6TTIwIDE3aC0xVjVoMXYxMnptMCAydjVoLTF2LTVoMXoiLz4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTTUgMTloMTl2MUg1ek00Ljc2MiA0djFIMFY0aDQuNzYyek03IDRoMTJhMSAxIDAgMCAxIDEgMUg3VjR6Ii8+Cjwvc3ltYm9sPgo8IS0tIFRoaXMgaWNvbiBtYWRlIGJ5IFBpeGVsIHBlcmZlY3QgZnJvbSB3d3cuZmxhdGljb24uY29tIC0tPgo8c3ltYm9sIGlkPSJpYy1yZXNpemUiIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgc3Ryb2tlPSJub25lIiBmaWxsPSJub25lIi8+CiAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNIDE4Ljk4ODI4MSAzLjAxMTcxOSBDIDE4LjgwMDc4MSAyLjgyNDIxOSAxOC41IDIuODI0MjE5IDE4LjMxMjUgMy4wMTE3MTkgTCAxMS42MjEwOTQgOS43MDcwMzEgQyAxMS40Mjk2ODggOS44OTQ1MzEgMTEuNDI5Njg4IDEwLjE5NTMxMiAxMS42MjEwOTQgMTAuMzc4OTA2IEMgMTEuNzEwOTM4IDEwLjQ3MjY1NiAxMS44MzU5MzggMTAuNTE5NTMxIDExLjk1NzAzMSAxMC41MTk1MzEgQyAxMi4wNzgxMjUgMTAuNTE5NTMxIDEyLjIwMzEyNSAxMC40NzI2NTYgMTIuMjkyOTY5IDEwLjM3ODkwNiBMIDE4Ljk4ODI4MSAzLjY4NzUgQyAxOS4xNzU3ODEgMy41IDE5LjE3NTc4MSAzLjE5OTIxOSAxOC45ODgyODEgMy4wMTE3MTkgWiBNIDE4Ljk4ODI4MSAzLjAxMTcxOSAiLz4KICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0gMTguNjUyMzQ0IDIuODY3MTg4IEMgMTguMzg2NzE5IDIuODY3MTg4IDE4LjE3MTg3NSAzLjA4MjAzMSAxOC4xNzE4NzUgMy4zNDc2NTYgTCAxOC4xNzE4NzUgOS4wODU5MzggQyAxOC4xNzE4NzUgOS4zNDc2NTYgMTguMzg2NzE5IDkuNTYyNSAxOC42NTIzNDQgOS41NjI1IEMgMTguOTE3OTY5IDkuNTYyNSAxOS4xMzI4MTIgOS4zNDc2NTYgMTkuMTMyODEyIDkuMDg1OTM4IEwgMTkuMTMyODEyIDMuMzQ3NjU2IEMgMTkuMTMyODEyIDMuMDgyMDMxIDE4LjkxNzk2OSAyLjg2NzE4OCAxOC42NTIzNDQgMi44NjcxODggWiBNIDE4LjY1MjM0NCAyLjg2NzE4OCAiLz4KICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0gMTguNjUyMzQ0IDIuODY3MTg4IEwgMTIuOTE0MDYyIDIuODY3MTg4IEMgMTIuNjUyMzQ0IDIuODY3MTg4IDEyLjQzNzUgMy4wODIwMzEgMTIuNDM3NSAzLjM0NzY1NiBDIDEyLjQzNzUgMy42MTMyODEgMTIuNjUyMzQ0IDMuODI4MTI1IDEyLjkxNDA2MiAzLjgyODEyNSBMIDE4LjY1MjM0NCAzLjgyODEyNSBDIDE4LjkxNzk2OSAzLjgyODEyNSAxOS4xMzI4MTIgMy42MTMyODEgMTkuMTMyODEyIDMuMzQ3NjU2IEMgMTkuMTMyODEyIDMuMDgyMDMxIDE4LjkxNzk2OSAyLjg2NzE4OCAxOC42NTIzNDQgMi44NjcxODggWiBNIDE4LjY1MjM0NCAyLjg2NzE4OCAiLz4KICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0gMTAuMzc4OTA2IDExLjYyMTA5NCBDIDEwLjE5NTMxMiAxMS40MzM1OTQgOS44OTA2MjUgMTEuNDMzNTk0IDkuNzAzMTI1IDExLjYyMTA5NCBMIDMuMDA3ODEyIDE4LjMxNjQwNiBDIDIuODIwMzEyIDE4LjUgMi44MjAzMTIgMTguODA0Njg4IDMuMDA3ODEyIDE4Ljk5MjE4OCBDIDMuMTA1NDY5IDE5LjA4NTkzOCAzLjIyNjU2MiAxOS4xMzI4MTIgMy4zNDc2NTYgMTkuMTMyODEyIEMgMy40Njg3NSAxOS4xMzI4MTIgMy41ODk4NDQgMTkuMDg1OTM4IDMuNjgzNTk0IDE4Ljk5MjE4OCBMIDEwLjM3ODkwNiAxMi4yOTY4NzUgQyAxMC41NjY0MDYgMTIuMTA5Mzc1IDEwLjU2NjQwNiAxMS44MDQ2ODggMTAuMzc4OTA2IDExLjYyMTA5NCBaIE0gMTAuMzc4OTA2IDExLjYyMTA5NCAiLz4KICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0gMy4zNDc2NTYgMTIuNDM3NSBDIDMuMDgyMDMxIDEyLjQzNzUgMi44NjcxODggMTIuNjUyMzQ0IDIuODY3MTg4IDEyLjkxNDA2MiBMIDIuODY3MTg4IDE4LjY1MjM0NCBDIDIuODY3MTg4IDE4LjkxNzk2OSAzLjA4MjAzMSAxOS4xMzI4MTIgMy4zNDc2NTYgMTkuMTMyODEyIEMgMy42MTMyODEgMTkuMTMyODEyIDMuODI4MTI1IDE4LjkxNzk2OSAzLjgyODEyNSAxOC42NTIzNDQgTCAzLjgyODEyNSAxMi45MTQwNjIgQyAzLjgyODEyNSAxMi42NTIzNDQgMy42MTMyODEgMTIuNDM3NSAzLjM0NzY1NiAxMi40Mzc1IFogTSAzLjM0NzY1NiAxMi40Mzc1ICIvPgogIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTSA5LjA4NTkzOCAxOC4xNzE4NzUgTCAzLjM0NzY1NiAxOC4xNzE4NzUgQyAzLjA4MjAzMSAxOC4xNzE4NzUgMi44NjcxODggMTguMzg2NzE5IDIuODY3MTg4IDE4LjY1MjM0NCBDIDIuODY3MTg4IDE4LjkxNzk2OSAzLjA4MjAzMSAxOS4xMzI4MTIgMy4zNDc2NTYgMTkuMTMyODEyIEwgOS4wODU5MzggMTkuMTMyODEyIEMgOS4zNDc2NTYgMTkuMTMyODEyIDkuNTYyNSAxOC45MTc5NjkgOS41NjI1IDE4LjY1MjM0NCBDIDkuNTYyNSAxOC4zODY3MTkgOS4zNDc2NTYgMTguMTcxODc1IDkuMDg1OTM4IDE4LjE3MTg3NSBaIE0gOS4wODU5MzggMTguMTcxODc1ICIvPgogIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTSAyMC41NjI1IDAgTCAxLjQzNzUgMCBDIDAuNjQ0NTMxIDAgMCAwLjY0NDUzMSAwIDEuNDM3NSBMIDAgMjAuNTYyNSBDIDAgMjEuMzU1NDY5IDAuNjQ0NTMxIDIyIDEuNDM3NSAyMiBMIDIwLjU2MjUgMjIgQyAyMS4zNTU0NjkgMjIgMjIgMjEuMzU1NDY5IDIyIDIwLjU2MjUgTCAyMiAxLjQzNzUgQyAyMiAwLjY0NDUzMSAyMS4zNTU0NjkgMCAyMC41NjI1IDAgWiBNIDIxLjA0Mjk2OSAyMC41NjI1IEMgMjEuMDQyOTY5IDIwLjgyODEyNSAyMC44MjgxMjUgMjEuMDQyOTY5IDIwLjU2MjUgMjEuMDQyOTY5IEwgMS40Mzc1IDIxLjA0Mjk2OSBDIDEuMTcxODc1IDIxLjA0Mjk2OSAwLjk1NzAzMSAyMC44MjgxMjUgMC45NTcwMzEgMjAuNTYyNSBMIDAuOTU3MDMxIDEuNDM3NSBDIDAuOTU3MDMxIDEuMTcxODc1IDEuMTcxODc1IDAuOTU3MDMxIDEuNDM3NSAwLjk1NzAzMSBMIDIwLjU2MjUgMC45NTcwMzEgQyAyMC44MjgxMjUgMC45NTcwMzEgMjEuMDQyOTY5IDEuMTcxODc1IDIxLjA0Mjk2OSAxLjQzNzUgWiBNIDIxLjA0Mjk2OSAyMC41NjI1ICIvPgo8L3N5bWJvbD4KPCEtLSAgLS0+CjxzeW1ib2wgaWQ9ImljLWRlbGV0ZS1hbGwiIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik01IDIzSDNhMSAxIDAgMCAxLTEtMVY2aDF2MTZoMnYxem0xNi0xMGgtMVY2aDF2N3pNOSAxM0g4di0zaDF2M3ptMyAwaC0xdi0zaDF2M3ptMyAwaC0xdi0zaDF2M3pNMTQuNzk0IDMuNzk0TDEzIDJoLTNMOC4yMDYgMy43OTRBLjk2My45NjMgMCAwIDEgOCAyLjVsLjcwMy0xLjA1NUExIDEgMCAwIDEgOS41MzUgMWgzLjkzYTEgMSAwIDAgMSAuODMyLjQ0NUwxNSAyLjVhLjk2NS45NjUgMCAwIDEtLjIwNiAxLjI5NHpNMTQuMTk3IDRIOC44MDNoNS4zOTR6Ii8+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0wIDNoMjN2MUgwek0xMS4yODYgMjFIOC43MTRMOCAyM0g3bDEtMi44VjIwaC4wNzFMOS41IDE2aDFsMS40MjkgNEgxMnYuMmwxIDIuOGgtMWwtLjcxNC0yem0tLjM1Ny0xTDEwIDE3LjQgOS4wNzEgMjBoMS44NTh6TTIwIDIyaDN2MWgtNHYtN2gxdjZ6bS01IDBoM3YxaC00di03aDF2NnoiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWRlbGV0ZSIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTTMgNnYxNmgxN1Y2aDF2MTZhMSAxIDAgMCAxLTEgMUgzYTEgMSAwIDAgMS0xLTFWNmgxek0xNC43OTQgMy43OTRMMTMgMmgtM0w4LjIwNiAzLjc5NEEuOTYzLjk2MyAwIDAgMSA4IDIuNWwuNzAzLTEuMDU1QTEgMSAwIDAgMSA5LjUzNSAxaDMuOTNhMSAxIDAgMCAxIC44MzIuNDQ1TDE1IDIuNWEuOTY1Ljk2NSAwIDAgMS0uMjA2IDEuMjk0ek0xNC4xOTcgNEg4LjgwM2g1LjM5NHoiLz4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTTAgM2gyM3YxSDB6TTggMTBoMXY2SDh2LTZ6bTMgMGgxdjZoLTF2LTZ6bTMgMGgxdjZoLTF2LTZ6Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1kcmF3LWZyZWUiIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIGQ9Ik0yLjUgMjAuOTI5QzIuNTk0IDEwLjk3NiA0LjMyMyA2IDcuNjg2IDZjNS44NzIgMCAyLjUyNCAxOSA3LjY5NyAxOXMxLjg5LTE0LjkyOSA2LjQxNC0xNC45MjkgMS4zNTcgMTAuODU4IDUuMTMgMTAuODU4YzEuODAyIDAgMi42NTctMi4yNjIgMi41NjYtNi43ODYiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWRyYXctbGluZSIgdmlld0JveD0iMCAwIDMyIDMyIj4KICAgIDxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iaW5oZXJpdCIgZD0iTTIgMTUuNWgyOCIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtZHJhdyIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iaW5oZXJpdCIgZD0iTTIuNSAyMS41SDVjLjI0NSAwIC40OC0uMDU4LjY5MS0uMTY4bC4xMjQtLjA2NS4xNC4wMWMuNDI5LjAyOC44NS0uMTI3IDEuMTYtLjQzN0wyMi41NSA1LjQwNWEuNS41IDAgMCAwIDAtLjcwN2wtMy4yNDYtMy4yNDVhLjUuNSAwIDAgMC0uNzA3IDBMMy4xNjIgMTYuODg4YTEuNDk1IDEuNDk1IDAgMCAwLS40MzcgMS4xNTVsLjAxLjE0LS4wNjUuMTIzYy0uMTExLjIxMi0uMTcuNDQ4LS4xNy42OTR2Mi41eiIvPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNMTYuNDE0IDMuNzA3bDMuODkgMy44OS0uNzA4LjcwNi0zLjg4OS0zLjg4OXoiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWZpbHRlciIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiIHN0cm9rZT0ibm9uZSIgLz4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTTEyIDd2MUgyVjdoMTB6bTYgMGg0djFoLTRWN3pNMTIgMTZ2MWgxMHYtMUgxMnptLTYgMEgydjFoNHYtMXoiLz4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTTguNSAyMGEzLjUgMy41IDAgMSAxIDAtNyAzLjUgMy41IDAgMCAxIDAgN3ptMC0xYTIuNSAyLjUgMCAxIDAgMC01IDIuNSAyLjUgMCAwIDAgMCA1ek0xNS41IDExYTMuNSAzLjUgMCAxIDEgMC03IDMuNSAzLjUgMCAwIDEgMCA3em0wLTFhMi41IDIuNSAwIDEgMCAwLTUgMi41IDIuNSAwIDAgMCAwIDV6Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1mbGlwLXJlc2V0IiB2aWV3Qm94PSIwIDAgMzEgMzIiPgogICAgPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJub25lIiBkPSJNMzEgMEgwdjMyaDMxeiIvPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNMjggMTZhOCA4IDAgMCAxLTggOEgzdi0xaDF2LTdIM2E4IDggMCAwIDEgOC04aDE3djFoLTF2N2gxek0xMSA5YTcgNyAwIDAgMC03IDd2N2gxNmE3IDcgMCAwIDAgNy03VjlIMTF6Ii8+CiAgICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIHN0cm9rZS1saW5lY2FwPSJzcXVhcmUiIGQ9Ik0yNCA1bDMuNSAzLjVMMjQgMTJNNyAyMGwtMy41IDMuNUw3IDI3Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1mbGlwLXgiIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9Im5vbmUiIGQ9Ik0zMiAzMkgwVjBoMzJ6Ii8+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0xNyAzMmgtMVYwaDF6TTI3LjE2NyAxMWwuNSAzaC0xLjAzbC0uNTQ2LTNoMS4wNzZ6bS0uNS0zaC0xLjEyMkwyNSA1aC01VjRoNS4xNTNhMSAxIDAgMCAxIC45ODYuODM2TDI2LjY2NyA4em0xLjUgOWwuNSAzaC0uOTRsLS41NDUtM2guOTg1em0xIDZsLjYzOSAzLjgzNkExIDEgMCAwIDEgMjguODE5IDI4SDI2di0xaDNsLS43MjYtNGguODk0ek0yMyAyOGgtM3YtMWgzdjF6TTEzIDR2MUg3TDMgMjdoMTB2MUgzLjE4YTEgMSAwIDAgMS0uOTg2LTEuMTY0bDMuNjY2LTIyQTEgMSAwIDAgMSA2Ljg0NyA0SDEzeiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtZmxpcC15IiB2aWV3Qm94PSIwIDAgMzIgMzIiPgogICAgPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJub25lIiBkPSJNMCAwdjMyaDMyVjB6Ii8+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0wIDE2djFoMzJ2LTF6TTExIDI3LjE2N2wzIC41di0xLjAzbC0zLS41NDZ2MS4wNzZ6bS0zLS41di0xLjEyMkw1IDI1di01SDR2NS4xNTNhMSAxIDAgMCAwIC44MzYuOTg2TDggMjYuNjY3em05IDEuNWwzIC41di0uOTRsLTMtLjU0NXYuOTg1em02IDFsMy44MzYuNjM5QTEgMSAwIDAgMCAyOCAyOC44MlYyNmgtMXYzbC00LS43Mjd2Ljg5NHpNMjggMjN2LTNoLTF2M2gxek00IDEzaDFWN2wyMi00djEwaDFWMy4xOGExIDEgMCAwIDAtMS4xNjQtLjk4NmwtMjIgMy42NjdBMSAxIDAgMCAwIDQgNi44NDdWMTN6Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1mbGlwIiB2aWV3Qm94PSIwIDAgMjQgMjQiPgogICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJub25lIiAvPgogICAgPHBhdGggZmlsbD0iaW5oZXJpdCIgc3Ryb2tlPSJub25lIiBkPSJNMTEgMGgxdjI0aC0xek0xOSAyMXYtMWgydi0yaDF2MmExIDEgMCAwIDEtMSAxaC0yem0tMiAwaC0zdi0xaDN2MXptNS01aC0xdi0zaDF2M3ptMC01aC0xVjhoMXYzem0wLTVoLTFWNGgtMlYzaDJhMSAxIDAgMCAxIDEgMXYyem0tNS0zdjFoLTNWM2gzek05IDN2MUgydjE2aDd2MUgyYTEgMSAwIDAgMS0xLTFWNGExIDEgMCAwIDEgMS0xaDd6Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1oaXN0b3J5IiB2aWV3Qm94PSIwIDAgMjQgMjQiPgogICAgPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJub25lIiBkPSJNMCAwSDI0VjI0SDB6IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtNzQwIC0xNikgdHJhbnNsYXRlKDU0NyA4KSB0cmFuc2xhdGUoMTkzIDgpIi8+CiAgICA8cGF0aCBmaWxsPSJpbmhlcml0IiBzdHJva2U9Im5vbmUiIGQ9Ik0xMi41IDFDMTguMjk5IDEgMjMgNS43MDEgMjMgMTEuNVMxOC4yOTkgMjIgMTIuNSAyMmMtNS4yOSAwLTkuNjY1LTMuOTExLTEwLjM5NC04Ljk5OWgxLjAxMkMzLjgzOCAxNy41MzQgNy43NjQgMjEgMTIuNSAyMWM1LjI0NyAwIDkuNS00LjI1MyA5LjUtOS41UzE3Ljc0NyAyIDEyLjUgMkM4LjQ5IDIgNS4wNiA0LjQ4NSAzLjY2NiA4SDNoNHYxSDJWNGgxdjMuMDIyQzQuNjggMy40NjIgOC4zMDMgMSAxMi41IDF6bS41IDVsLS4wMDEgNS4yOTEgMi41MzcgMi41MzctLjcwOC43MDhMMTIuMjkyIDEySDEyVjZoMXoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC03NDAgLTE2KSB0cmFuc2xhdGUoNTQ3IDgpIHRyYW5zbGF0ZSgxOTMgOCkiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWhpc3RvcnktY2hlY2siIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgICA8ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiID4KICAgICAgICA8cGF0aCBzdHJva2U9IiM1NTU1NTUiIGQ9Ik00LjUgLTFMMS41IDIgNi41IDciIHRyYW5zZm9ybT0idHJhbnNsYXRlKC02MCAtODA0KSB0cmFuc2xhdGUoNjAgODA0KSB0cmFuc2xhdGUoMiAzKSByb3RhdGUoLTkwIDQgMykiIC8+CiAgICA8L2c+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1oaXN0b3J5LWNyb3AiIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgICA8ZyBmaWxsPSJub25lIiBzdHJva2U9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgPgogICAgICAgIDxwYXRoIGQ9Ik0wIDBIMTJWMTJIMHoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC04NCAtODA0KSB0cmFuc2xhdGUoODQgODA0KSIvPgogICAgICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik0yIDBoMXYxMGMtLjU1MiAwLTEtLjQ0OC0xLTFWMHpNMTAgOXYzSDlWOWgxek05IDJoMXY2SDlWMnoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC04NCAtODA0KSB0cmFuc2xhdGUoODQgODA0KSIvPgogICAgICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik0yIDlIMTJWMTBIMnpNOSAyYy41MTMgMCAuOTM2LjM4Ni45OTMuODgzTDEwIDNIM1YyaDZ6TTIgM0gwVjJoMnYxeiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTg0IC04MDQpIHRyYW5zbGF0ZSg4NCA4MDQpIi8+CiAgICA8L2c+Cjwvc3ltYm9sPgo8IS0tIFRoaXMgaWNvbiBtYWRlIGJ5IFBpeGVsIHBlcmZlY3QgZnJvbSB3d3cuZmxhdGljb24uY29tIC0tPgo8c3ltYm9sIGlkPSJpYy1oaXN0b3J5LXJlc2l6ZSIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICA8ZyBmaWxsPSJub25lIiBzdHJva2U9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgPgogICAgPHBhdGggZmlsbD0iIzQzNDM0MyIgZD0iTSA5LjQ5MjE4OCAxLjUwNzgxMiBDIDkuMzk4NDM4IDEuNDE0MDYyIDkuMjUgMS40MTQwNjIgOS4xNTYyNSAxLjUwNzgxMiBMIDUuODEyNSA0Ljg1MTU2MiBDIDUuNzE0ODQ0IDQuOTQ1MzEyIDUuNzE0ODQ0IDUuMDk3NjU2IDUuODEyNSA1LjE4NzUgQyA1Ljg1NTQ2OSA1LjIzNDM3NSA1LjkxNzk2OSA1LjI1NzgxMiA1Ljk3NjU2MiA1LjI1NzgxMiBDIDYuMDM5MDYyIDUuMjU3ODEyIDYuMTAxNTYyIDUuMjM0Mzc1IDYuMTQ4NDM4IDUuMTg3NSBMIDkuNDkyMTg4IDEuODQzNzUgQyA5LjU4NTkzOCAxLjc1IDkuNTg1OTM4IDEuNjAxNTYyIDkuNDkyMTg4IDEuNTA3ODEyIFogTSA5LjQ5MjE4OCAxLjUwNzgxMiAiLz4KICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik0gOS4zMjgxMjUgMS40MzM1OTQgQyA5LjE5NTMxMiAxLjQzMzU5NCA5LjA4NTkzOCAxLjUzOTA2MiA5LjA4NTkzOCAxLjY3MTg3NSBMIDkuMDg1OTM4IDQuNTQyOTY5IEMgOS4wODU5MzggNC42NzE4NzUgOS4xOTUzMTIgNC43ODEyNSA5LjMyODEyNSA0Ljc4MTI1IEMgOS40NjA5MzggNC43ODEyNSA5LjU2NjQwNiA0LjY3MTg3NSA5LjU2NjQwNiA0LjU0Mjk2OSBMIDkuNTY2NDA2IDEuNjcxODc1IEMgOS41NjY0MDYgMS41MzkwNjIgOS40NjA5MzggMS40MzM1OTQgOS4zMjgxMjUgMS40MzM1OTQgWiBNIDkuMzI4MTI1IDEuNDMzNTk0ICIvPgogICAgPHBhdGggZmlsbD0iIzQzNDM0MyIgZD0iTSA5LjMyODEyNSAxLjQzMzU5NCBMIDYuNDU3MDMxIDEuNDMzNTk0IEMgNi4zMjgxMjUgMS40MzM1OTQgNi4yMTg3NSAxLjUzOTA2MiA2LjIxODc1IDEuNjcxODc1IEMgNi4yMTg3NSAxLjgwNDY4OCA2LjMyODEyNSAxLjkxNDA2MiA2LjQ1NzAzMSAxLjkxNDA2MiBMIDkuMzI4MTI1IDEuOTE0MDYyIEMgOS40NjA5MzggMS45MTQwNjIgOS41NjY0MDYgMS44MDQ2ODggOS41NjY0MDYgMS42NzE4NzUgQyA5LjU2NjQwNiAxLjUzOTA2MiA5LjQ2MDkzOCAxLjQzMzU5NCA5LjMyODEyNSAxLjQzMzU5NCBaIE0gOS4zMjgxMjUgMS40MzM1OTQgIi8+CiAgICA8cGF0aCBmaWxsPSIjNDM0MzQzIiBkPSJNIDUuMTg3NSA1LjgxMjUgQyA1LjA5NzY1NiA1LjcxODc1IDQuOTQ1MzEyIDUuNzE4NzUgNC44NTE1NjIgNS44MTI1IEwgMS41MDM5MDYgOS4xNTYyNSBDIDEuNDEwMTU2IDkuMjUgMS40MTAxNTYgOS40MDIzNDQgMS41MDM5MDYgOS40OTYwOTQgQyAxLjU1NDY4OCA5LjU0Mjk2OSAxLjYxMzI4MSA5LjU2NjQwNiAxLjY3MTg3NSA5LjU2NjQwNiBDIDEuNzM0Mzc1IDkuNTY2NDA2IDEuNzk2ODc1IDkuNTQyOTY5IDEuODQzNzUgOS40OTYwOTQgTCA1LjE4NzUgNi4xNDg0MzggQyA1LjI4MTI1IDYuMDU0Njg4IDUuMjgxMjUgNS45MDIzNDQgNS4xODc1IDUuODEyNSBaIE0gNS4xODc1IDUuODEyNSAiLz4KICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik0gMS42NzE4NzUgNi4yMTg3NSBDIDEuNTM5MDYyIDYuMjE4NzUgMS40MzM1OTQgNi4zMjgxMjUgMS40MzM1OTQgNi40NTcwMzEgTCAxLjQzMzU5NCA5LjMyODEyNSBDIDEuNDMzNTk0IDkuNDYwOTM4IDEuNTM5MDYyIDkuNTY2NDA2IDEuNjcxODc1IDkuNTY2NDA2IEMgMS44MDQ2ODggOS41NjY0MDYgMS45MTQwNjIgOS40NjA5MzggMS45MTQwNjIgOS4zMjgxMjUgTCAxLjkxNDA2MiA2LjQ1NzAzMSBDIDEuOTE0MDYyIDYuMzI4MTI1IDEuODA0Njg4IDYuMjE4NzUgMS42NzE4NzUgNi4yMTg3NSBaIE0gMS42NzE4NzUgNi4yMTg3NSAiLz4KICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik0gNC41NDI5NjkgOS4wODU5MzggTCAxLjY3MTg3NSA5LjA4NTkzOCBDIDEuNTM5MDYyIDkuMDg1OTM4IDEuNDMzNTk0IDkuMTk1MzEyIDEuNDMzNTk0IDkuMzI4MTI1IEMgMS40MzM1OTQgOS40NjA5MzggMS41MzkwNjIgOS41NjY0MDYgMS42NzE4NzUgOS41NjY0MDYgTCA0LjU0Mjk2OSA5LjU2NjQwNiBDIDQuNjcxODc1IDkuNTY2NDA2IDQuNzgxMjUgOS40NjA5MzggNC43ODEyNSA5LjMyODEyNSBDIDQuNzgxMjUgOS4xOTUzMTIgNC42NzE4NzUgOS4wODU5MzggNC41NDI5NjkgOS4wODU5MzggWiBNIDQuNTQyOTY5IDkuMDg1OTM4ICIvPgogICAgPHBhdGggZmlsbD0iIzQzNDM0MyIgZD0iTSAxMC4yODEyNSAwIEwgMC43MTg3NSAwIEMgMC4zMjAzMTIgMCAwIDAuMzIwMzEyIDAgMC43MTg3NSBMIDAgMTAuMjgxMjUgQyAwIDEwLjY3OTY4OCAwLjMyMDMxMiAxMSAwLjcxODc1IDExIEwgMTAuMjgxMjUgMTEgQyAxMC42Nzk2ODggMTEgMTEgMTAuNjc5Njg4IDExIDEwLjI4MTI1IEwgMTEgMC43MTg3NSBDIDExIDAuMzIwMzEyIDEwLjY3OTY4OCAwIDEwLjI4MTI1IDAgWiBNIDEwLjUyMzQzOCAxMC4yODEyNSBDIDEwLjUyMzQzOCAxMC40MTQwNjIgMTAuNDE0MDYyIDEwLjUyMzQzOCAxMC4yODEyNSAxMC41MjM0MzggTCAwLjcxODc1IDEwLjUyMzQzOCBDIDAuNTg1OTM4IDEwLjUyMzQzOCAwLjQ3NjU2MiAxMC40MTQwNjIgMC40NzY1NjIgMTAuMjgxMjUgTCAwLjQ3NjU2MiAwLjcxODc1IEMgMC40NzY1NjIgMC41ODU5MzggMC41ODU5MzggMC40NzY1NjIgMC43MTg3NSAwLjQ3NjU2MiBMIDEwLjI4MTI1IDAuNDc2NTYyIEMgMTAuNDE0MDYyIDAuNDc2NTYyIDEwLjUyMzQzOCAwLjU4NTkzOCAxMC41MjM0MzggMC43MTg3NSBaIE0gMTAuNTIzNDM4IDEwLjI4MTI1ICIvPgogIDwvZz4KPC9zeW1ib2w+CjwhLS0gIC0tPgo8c3ltYm9sIGlkPSJpYy1oaXN0b3J5LWRyYXciIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgICA8ZyBmaWxsPSJub25lIiBzdHJva2U9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgPgogICAgICAgIDxwYXRoIGQ9Ik0wIDFIMTJWMTNIMHoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xNTYgLTgwNCkgdHJhbnNsYXRlKDE1NiA4MDMpIi8+CiAgICAgICAgPHBhdGggc3Ryb2tlPSIjNDM0MzQzIiBkPSJNOS42MjIgMS41ODRsMS44MzUgMS42NTgtOC4zMSA4LjQwN0wuNSAxMi41VjExbDkuMTIyLTkuNDE2eiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTE1NiAtODA0KSB0cmFuc2xhdGUoMTU2IDgwMykiLz4KICAgICAgICA8cGF0aCBmaWxsPSIjNDM0MzQzIiBkPSJNNy42MjggMy43NTNMMTAuMzc4IDMuNzUzIDEwLjM3OCA0LjI1MyA3LjYyOCA0LjI1M3oiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xNTYgLTgwNCkgdHJhbnNsYXRlKDE1NiA4MDMpIHJvdGF0ZSg0NSA5LjAwMyA0LjAwMykiLz4KICAgIDwvZz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWhpc3RvcnktZmlsdGVyIiB2aWV3Qm94PSIwIDAgMjQgMjQiPgogICAgPGcgZmlsbD0ibm9uZSIgc3Ryb2tlPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiID4KICAgICAgICA8cGF0aCBkPSJNMCAwSDEyVjEySDB6IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMjc2IC04MDQpIHRyYW5zbGF0ZSgyNzYgODA0KSIvPgogICAgICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik0xMiAzdjFIOVYzaDN6TTcgNEgwVjNoN3YxeiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTI3NiAtODA0KSB0cmFuc2xhdGUoMjc2IDgwNCkiLz4KICAgICAgICA8cGF0aCBmaWxsPSIjNDM0MzQzIiBkPSJNMTIgOHYxSDlWOGgzek03IDlIMFY4aDd2MXoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yNzYgLTgwNCkgdHJhbnNsYXRlKDI3NiA4MDQpIG1hdHJpeCgtMSAwIDAgMSAxMiAwKSIvPgogICAgICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik04IDFjMS4xMDUgMCAyIC44OTUgMiAycy0uODk1IDItMiAyLTItLjg5NS0yLTIgLjg5NS0yIDItMnptMCAxYy0uNTUyIDAtMSAuNDQ4LTEgMXMuNDQ4IDEgMSAxIDEtLjQ0OCAxLTEtLjQ0OC0xLTEtMXpNNCA3YzEuMTA1IDAgMiAuODk1IDIgMnMtLjg5NSAyLTIgMi0yLS44OTUtMi0yIC44OTUtMiAyLTJ6bTAgMWMtLjU1MiAwLTEgLjQ0OC0xIDFzLjQ0OCAxIDEgMSAxLS40NDggMS0xLS40NDgtMS0xLTF6IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMjc2IC04MDQpIHRyYW5zbGF0ZSgyNzYgODA0KSIvPgogICAgPC9nPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtaGlzdG9yeS1mbGlwIiB2aWV3Qm94PSIwIDAgMjQgMjQiPgogICAgPGcgZmlsbD0ibm9uZSIgc3Ryb2tlPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiID4KICAgICAgICA8cGF0aCBkPSJNMCAwSDEyVjEySDB6IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTA4IC04MDQpIHRyYW5zbGF0ZSgxMDggODA0KSIvPgogICAgICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik02IDBMNyAwIDcgMTIgNiAxMnpNMTEgMTBWOWgxdjEuNWMwIC4yNzYtLjIyNC41LS41LjVIMTB2LTFoMXpNNSAxdjFIMXY4aDR2MUguNWMtLjI3NiAwLS41LS4yMjQtLjUtLjV2LTljMC0uMjc2LjIyNC0uNS41LS41SDV6bTcgNXYyaC0xVjZoMXptMC0zdjJoLTFWM2gxek05IDF2MUg3VjFoMnptMi41IDBjLjI3NiAwIC41LjIyNC41LjVWMmgtMlYxaDEuNXpNOSAxMUg3di0xaDJ2MXoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xMDggLTgwNCkgdHJhbnNsYXRlKDEwOCA4MDQpIi8+CiAgICA8L2c+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1oaXN0b3J5LWljb24iIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgICA8ZyBmaWxsPSJub25lIiBzdHJva2U9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgPgogICAgICAgIDxwYXRoIGQ9Ik0wIDBIMTJWMTJIMHoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMDQgLTgwNCkgdHJhbnNsYXRlKDIwNCA4MDQpIi8+CiAgICAgICAgPHBhdGggc3Ryb2tlPSIjNDM0MzQzIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMS4xIiBkPSJNNiA5LjU2OEwyLjYwMSAxMSAyLjk3NSA3LjQ2NyAwLjUgNC44MiA0LjEzIDQuMDY4IDYgMSA3Ljg3IDQuMDY4IDExLjUgNC44MiA5LjAyNSA3LjQ2NyA5LjM5OSAxMXoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMDQgLTgwNCkgdHJhbnNsYXRlKDIwNCA4MDQpIi8+CiAgICA8L2c+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1oaXN0b3J5LW1hc2siIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgICA8ZyBmaWxsPSJub25lIiBzdHJva2U9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgPgogICAgICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yNTIgLTgwNCkgdHJhbnNsYXRlKDI1MiA4MDQpIj4KICAgICAgICAgICAgPHBhdGggZD0iTTAgMEgxMlYxMkgweiIvPgogICAgICAgICAgICA8Y2lyY2xlIGN4PSI2IiBjeT0iNiIgcj0iMi41IiBzdHJva2U9IiM0NDQiLz4KICAgICAgICAgICAgPHBhdGggZmlsbD0iIzQzNDM0MyIgZD0iTTExLjUgMGMuMjc2IDAgLjUuMjI0LjUuNXYxMWMwIC4yNzYtLjIyNC41LS41LjVILjVjLS4yNzYgMC0uNS0uMjI0LS41LS41Vi41QzAgLjIyNC4yMjQgMCAuNSAwaDExek0xMSAxSDF2MTBoMTBWMXoiLz4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1oaXN0b3J5LXJvdGF0ZSIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxkZWZzPgogICAgICAgIDxwYXRoIGlkPSJyZm40cnlsZmZhIiBkPSJNNyAxMmMtLjMzNSAwLS42NjMtLjAyNS0uOTgzLS4wNzRDMy4xNzEgMTEuNDkyIDEgOS4yMDUgMSA2LjQ0NGMwLTEuMzYzLjUzNC0yLjYxMyAxLjQxNS0zLjU4Ii8+CiAgICAgICAgPG1hc2sgaWQ9IjZmOWduMmR5c2IiIHdpZHRoPSI2IiBoZWlnaHQ9IjkuMTM2IiB4PSIwIiB5PSIwIiBtYXNrVW5pdHM9Im9iamVjdEJvdW5kaW5nQm94Ij4KICAgICAgICAgICAgPHVzZSB4bGluazpocmVmPSIjcmZuNHJ5bGZmYSIgc3Ryb2tlPSI0MzQzNDMiLz4KICAgICAgICA8L21hc2s+CiAgICA8L2RlZnM+CiAgICA8ZyBmaWxsPSJub25lIiBzdHJva2U9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgPgogICAgICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xMzIgLTgwNCkgdHJhbnNsYXRlKDEzMiA4MDQpIj4KICAgICAgICAgICAgPHBhdGggZD0iTTAgMC41SDEyVjEyLjVIMHoiLz4KICAgICAgICAgICAgPHBhdGggZmlsbD0iIzQzNDM0MyIgZD0iTTYuNSAxQzkuNTM4IDEgMTIgMy40NjIgMTIgNi41YzAgMi4zNy0xLjUgNC4zOS0zLjYgNS4xNjNsLS40MDctLjkxNkM5Ljc0NCAxMC4xMyAxMSA4LjQ2MiAxMSA2LjUgMTEgNC4wMTUgOC45ODUgMiA2LjUgMmMtLjc3NyAwLTEuNTA5LjE5Ny0yLjE0Ny41NDRMNCAxLjc1bC0uMjA1LS4wNEM0LjU5NCAxLjI1OCA1LjUxNyAxIDYuNSAxeiIvPgogICAgICAgICAgICA8dXNlIHN0cm9rZT0iIzQzNDM0MyIgc3Ryb2tlLWRhc2hhcnJheT0iMiAxLjI1IiBzdHJva2Utd2lkdGg9IjEiIG1hc2s9InVybCgjNmY5Z24yZHlzYikiIHhsaW5rOmhyZWY9IiNyZm40cnlsZmZhIi8+CiAgICAgICAgICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik00LjI3OSAwTDYgMS43NSA0LjI1IDMuNTcxIDMuNTQzIDIuODY0IDQuNTg2IDEuNzUgMy41NzIgMC43MDd6IiB0cmFuc2Zvcm09Im1hdHJpeCgtMSAwIDAgMSA5LjU0MyAwKSIvPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWhpc3Rvcnktc2hhcGUiIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgICA8ZyBmaWxsPSJub25lIiBzdHJva2U9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgPgogICAgICAgIDxwYXRoIGQ9Ik0wIDBIMTJWMTJIMHoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xODAgLTgwNCkgdHJhbnNsYXRlKDE4MCA4MDQpIi8+CiAgICAgICAgPHBhdGggZmlsbD0iIzQzNDM0MyIgZD0iTTExLjUgNGMuMjc2IDAgLjUuMjI0LjUuNXY3YzAgLjI3Ni0uMjI0LjUtLjUuNWgtN2MtLjI3NiAwLS41LS4yMjQtLjUtLjVWOC44aDFWMTFoNlY1SDguMzQxbC0uNTY4LTFIMTEuNXoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xODAgLTgwNCkgdHJhbnNsYXRlKDE4MCA4MDQpIi8+CiAgICAgICAgPHBhdGggc3Ryb2tlPSIjNDM0MzQzIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGQ9Ik00LjUgMC41TDguNSA3LjYxMSAwLjUgNy42MTF6IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTgwIC04MDQpIHRyYW5zbGF0ZSgxODAgODA0KSIvPgogICAgPC9nPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtaGlzdG9yeS10ZXh0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPgogICAgPGcgZmlsbD0ibm9uZSIgc3Ryb2tlPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiID4KICAgICAgICA8cGF0aCBkPSJNMCAwSDEyVjEySDB6IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMjI4IC04MDQpIHRyYW5zbGF0ZSgyMjggODA0KSIvPgogICAgICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik0yIDFoOGMuNTUyIDAgMSAuNDQ4IDEgMUgxYzAtLjU1Mi40NDgtMSAxLTF6IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMjI4IC04MDQpIHRyYW5zbGF0ZSgyMjggODA0KSIvPgogICAgICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik0xIDFIMlYzSDF6TTEwIDFIMTFWM0gxMHpNNS41IDFMNi41IDEgNi41IDExIDUuNSAxMXoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMjggLTgwNCkgdHJhbnNsYXRlKDIyOCA4MDQpIi8+CiAgICAgICAgPHBhdGggZmlsbD0iIzQzNDM0MyIgZD0iTTQgMTBIOFYxMUg0eiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTIyOCAtODA0KSB0cmFuc2xhdGUoMjI4IDgwNCkiLz4KICAgIDwvZz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWhpc3RvcnktbG9hZCIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxnIGZpbGw9Im5vbmUiIHN0cm9rZT0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8cGF0aCBkPSJNMCAwSDEyVjEySDB6IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMzI0IC04MDUpIHRyYW5zbGF0ZSgzMjQgODA1KSIvPgogICAgICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik01IDBjLjU1MiAwIDEgLjQ0OCAxIDF2MWg1LjVjLjI3NiAwIC41LjIyNC41LjV2OGMwIC4yNzYtLjIyNC41LS41LjVILjVjLS4yNzYgMC0uNS0uMjI0LS41LS41VjFjMC0uNTUyLjQ0OC0xIDEtMWg0em0wIDFIMXY5aDEwVjNINVYxeiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTMyNCAtODA1KSB0cmFuc2xhdGUoMzI0IDgwNSkiLz4KICAgICAgICA8cGF0aCBmaWxsPSIjNDM0MzQzIiBkPSJNMSAyTDUgMiA1IDMgMSAzeiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTMyNCAtODA1KSB0cmFuc2xhdGUoMzI0IDgwNSkiLz4KICAgIDwvZz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWhpc3RvcnktZGVsZXRlIiB2aWV3Qm94PSIwIDAgMjQgMjQiPgogICAgPGcgZmlsbD0ibm9uZSIgc3Ryb2tlPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGZpbGw9IiM0MzQzNDMiPgogICAgICAgICAgICA8cGF0aCBkPSJNMiA5aDhWMWgxdjguNWMwIC4yNzYtLjIyNC41LS41LjVoLTljLS4yNzYgMC0uNS0uMjI0LS41LS41VjFoMXY4ek0wIDBIMTJWMUgweiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTMwMCAtODA0KSB0cmFuc2xhdGUoMzAwIDgwNCkgdHJhbnNsYXRlKDAgMikiLz4KICAgICAgICAgICAgPHBhdGggZD0iTTQgM0g1VjdINHpNNyAzSDhWN0g3eiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTMwMCAtODA0KSB0cmFuc2xhdGUoMzAwIDgwNCkgdHJhbnNsYXRlKDAgMikiLz4KICAgICAgICAgICAgPHBhdGggZD0iTTQgMWg0VjBoMXYxLjVjMCAuMjc2LS4yMjQuNS0uNS41aC01Yy0uMjc2IDAtLjUtLjIyNC0uNS0uNVYwaDF2MXoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0zMDAgLTgwNCkgdHJhbnNsYXRlKDMwMCA4MDQpIG1hdHJpeCgxIDAgMCAtMSAwIDIpIi8+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtaGlzdG9yeS1ncm91cCIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxnIGZpbGw9Im5vbmUiIHN0cm9rZT0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMzQ4IC04MDQpIHRyYW5zbGF0ZSgzNDggODA0KSI+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik0wIDBIMTJWMTJIMHoiLz4KICAgICAgICAgICAgPHBhdGggZmlsbD0iIzQzNDM0MyIgZD0iTTEgOXYyaDF2MUguNWMtLjI3NiAwLS41LS4yMjQtLjUtLjVWOWgxem0xMSAxdjEuNWMwIC4yNzYtLjIyNC41LS41LjVIOXYtMWgydi0xaDF6bS00IDF2MUg2di0xaDJ6bS0zIDB2MUgzdi0xaDJ6bTctNHYyaC0xVjdoMXpNMSA2djJIMFY2aDF6bTExLTJ2MmgtMVY0aDF6TTEgM3YySDBWM2gxem0xMC41LTNjLjI3NiAwIC41LjIyNC41LjVWM2gtMVYxaC0xVjBoMS41ek02IDB2MUg0VjBoMnptMyAwdjFIN1YwaDJ6TTAgLjVDMCAuMjI0LjIyNCAwIC41IDBIM3YxSDF2MUgwVi41ek05LjUgNGMuMjc2IDAgLjUuMjI0LjUuNXY1YzAgLjI3Ni0uMjI0LjUtLjUuNWgtNWMtLjI3NiAwLS41LS4yMjQtLjUtLjVWOC4zNTVjLjMxNy4wOTQuNjUyLjE0NSAxIC4xNDVWOWg0VjVoLS41YzAtLjM0OC0uMDUtLjY4My0uMTQ1LTFIOS41eiIvPgogICAgICAgICAgICA8Y2lyY2xlIGN4PSI1IiBjeT0iNSIgcj0iMi41IiBzdHJva2U9IiM0MzQzNDMiLz4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1pY29uLWFycm93LTIiIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZD0iTTIxLjc5MyAxOC41SDIuNXYtNWgxOC45MzVsLTcuNi04aDUuODcybDEwLjUgMTAuNS0xMC41IDEwLjVoLTUuOTE0bDgtOHoiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWljb24tYXJyb3ctMyIgdmlld0JveD0iMCAwIDMyIDMyIj4KICAgIDxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iaW5oZXJpdCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBkPSJNMjUuMjg4IDE2LjQyTDE0LjIwOCAyNy41SDYuNzkybDExLjI5MS0xMS4yOTFMNi44MjYgNC41aDcuMzgxbDExLjY2MSAxMS42NjEtLjU4LjI1OHoiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWljb24tYXJyb3ciIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIGQ9Ik0yLjUgMTEuNXY5aDE4djUuMjkzTDMwLjI5MyAxNiAyMC41IDYuMjA3VjExLjVoLTE4eiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtaWNvbi1idWJibGUiIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZD0iTTIyLjIwNyAyNC41TDE2LjUgMzAuMjA3VjI0LjVIOEE2LjUgNi41IDAgMCAxIDEuNSAxOFY5QTYuNSA2LjUgMCAwIDEgOCAyLjVoMTZBNi41IDYuNSAwIDAgMSAzMC41IDl2OWE2LjUgNi41IDAgMCAxLTYuNSA2LjVoLTEuNzkzeiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtaWNvbi1oZWFydCIgdmlld0JveD0iMCAwIDMyIDMyIj4KICAgIDxwYXRoIGZpbGwtcnVsZT0ibm9uemVybyIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJpbmhlcml0IiBkPSJNMTUuOTk2IDMwLjY3NWwxLjk4MS0xLjc5YzcuODk4LTcuMTc3IDEwLjM2NS05LjcxOCAxMi4xMzUtMTMuMDEyLjkyMi0xLjcxNiAxLjM3Ny0zLjM3IDEuMzc3LTUuMDc2IDAtNC42NS0zLjY0Ny04LjI5Ny04LjI5Ny04LjI5Ny0yLjMzIDAtNC44NiAxLjUyNy02LjgxNyAzLjgyNGwtLjM4LjQ0Ny0uMzgxLS40NDdDMTMuNjU4IDQuMDI3IDExLjEyNiAyLjUgOC43OTcgMi41IDQuMTQ3IDIuNS41IDYuMTQ3LjUgMTAuNzk3YzAgMS43MTQuNDYgMy4zNzUgMS4zODkgNS4wOTggMS43NzUgMy4yODggNC4yNiA1Ljg0MyAxMi4xMjMgMTIuOTc0bDEuOTg0IDEuODA2eiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtaWNvbi1sb2FkIiB2aWV3Qm94PSIwIDAgMzIgMzIiPgogICAgPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJpbmhlcml0IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGQ9Ik0xNy4zMTQgMTguODY3bDEuOTUxLTIuNTMgNCA1LjE4NGgtMTdsNi41LTguODQgNC41NDkgNi4xODZ6Ii8+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0xOC4wMSA0YTExLjc5OCAxMS43OTggMCAwIDAgMCAxSDN2MjRoMjRWMTQuOTg2YTguNzM4IDguNzM4IDAgMCAwIDEgMFYyOWExIDEgMCAwIDEtMSAxSDNhMSAxIDAgMCAxLTEtMVY1YTEgMSAwIDAgMSAxLTFoMTUuMDF6Ii8+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0yNSAzaDF2OWgtMXoiLz4KICAgIDxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iaW5oZXJpdCIgZD0iTTIyIDZsMy41LTMuNUwyOSA2Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1pY29uLWxvY2F0aW9uIiB2aWV3Qm94PSIwIDAgMzIgMzIiPgogICAgPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJpbmhlcml0IiBkPSJNMTYgMzEuMjhDMjMuNjc1IDIzLjMwMiAyNy41IDE3LjE4MSAyNy41IDEzYzAtNi4zNTEtNS4xNDktMTEuNS0xMS41LTExLjVTNC41IDYuNjQ5IDQuNSAxM2MwIDQuMTgxIDMuODI1IDEwLjMwMiAxMS41IDE4LjI4eiIvPgogICAgPGNpcmNsZSBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIGN4PSIxNiIgY3k9IjEzIiByPSI0LjUiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWljb24tcG9seWdvbiIgdmlld0JveD0iMCAwIDMyIDMyIj4KICAgIDxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iaW5oZXJpdCIgZD0iTS41NzYgMTZMOC4yOSAyOS41aDE1LjQyTDMxLjQyNCAxNiAyMy43MSAyLjVIOC4yOUwuNTc2IDE2eiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtaWNvbi1zdGFyLTIiIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIGQ9Ik0xOS40NDYgMzEuNTkybDIuMjY1LTMuMjcyIDMuOTQ2LjI1LjYzNi0zLjk0IDMuNjY1LTEuNTA1LTEuMTItMy44MzIgMi42NTUtMi45NjItMi42NTYtMi45NjIgMS4xMi0zLjgzMi0zLjY2NC0xLjUwNS0uNjM2LTMuOTQxLTMuOTQ2LjI1LTIuMjY1LTMuMjcxTDE2IDMuMDI0IDEyLjU1NCAxLjA3IDEwLjI4OSA0LjM0bC0zLjk0Ni0uMjUtLjYzNiAzLjk0MS0zLjY2NSAxLjUwNSAxLjEyIDMuODMyTC41MDggMTYuMzNsMi42NTYgMi45NjItMS4xMiAzLjgzMiAzLjY2NCAxLjUwNC42MzYgMy45NDIgMy45NDYtLjI1IDIuMjY1IDMuMjdMMTYgMjkuNjM4bDMuNDQ2IDEuOTU1eiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtaWNvbi1zdGFyIiB2aWV3Qm94PSIwIDAgMzIgMzIiPgogICAgPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJpbmhlcml0IiBkPSJNMjUuMjkyIDI5Ljg3OGwtMS43NzUtMTAuMzQ2IDcuNTE3LTcuMzI3LTEwLjM4OC0xLjUxTDE2IDEuMjgybC00LjY0NiA5LjQxMy0xMC4zODggMS41MSA3LjUxNyA3LjMyNy0xLjc3NSAxMC4zNDZMMTYgMjQuOTkzbDkuMjkyIDQuODg1eiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtaWNvbiIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iaW5oZXJpdCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBkPSJNMTEuOTIzIDE5LjEzNkw1LjQyNCAyMmwuNzE1LTcuMDY1LTQuNzMxLTUuMjk2IDYuOTQtMS41MDNMMTEuOTIzIDJsMy41NzQgNi4xMzYgNi45NCAxLjUwMy00LjczMSA1LjI5NkwxOC40MiAyMnoiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLW1hc2stbG9hZCIgdmlld0JveD0iMCAwIDMyIDMyIj4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0ibm9uZSIgZD0iTTAgMGgzMnYzMkgweiIvPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNMTguMDEgNGExMS43OTggMTEuNzk4IDAgMCAwIDAgMUgzdjI0aDI0VjE0Ljk4NmE4LjczOCA4LjczOCAwIDAgMCAxIDBWMjlhMSAxIDAgMCAxLTEgMUgzYTEgMSAwIDAgMS0xLTFWNWExIDEgMCAwIDEgMS0xaDE1LjAxek0xNSAyM2E2IDYgMCAxIDEgMC0xMiA2IDYgMCAwIDEgMCAxMnptMC0xYTUgNSAwIDEgMCAwLTEwIDUgNSAwIDAgMCAwIDEweiIvPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNMjUgM2gxdjloLTF6Ii8+CiAgICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIGQ9Ik0yMiA2bDMuNS0zLjVMMjkgNiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtbWFzayIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxjaXJjbGUgY3g9IjEyIiBjeT0iMTIiIHI9IjQuNSIgc3Ryb2tlPSJpbmhlcml0IiBmaWxsPSJub25lIi8+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0yIDFoMjBhMSAxIDAgMCAxIDEgMXYyMGExIDEgMCAwIDEtMSAxSDJhMSAxIDAgMCAxLTEtMVYyYTEgMSAwIDAgMSAxLTF6bTAgMXYyMGgyMFYySDJ6Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1yZWRvIiB2aWV3Qm94PSIwIDAgMjQgMjQiPgogICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgb3BhY2l0eT0iLjUiIGZpbGw9Im5vbmUiIHN0cm9rZT0ibm9uZSIgLz4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTTIxIDZIOWE2IDYgMCAxIDAgMCAxMmgxMnYxSDlBNyA3IDAgMCAxIDkgNWgxMnYxeiIvPgogICAgPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJpbmhlcml0IiBzdHJva2UtbGluZWNhcD0ic3F1YXJlIiBkPSJNMTkgM2wyLjUgMi41TDE5IDgiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLXJlc2V0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPgogICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgb3BhY2l0eT0iLjUiIHN0cm9rZT0ibm9uZSIgZmlsbD0ibm9uZSIvPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNMiAxM3YtMWE3IDcgMCAwIDEgNy03aDEzdjFoLTF2NWgxdjFhNyA3IDAgMCAxLTcgN0gydi0xaDF2LTVIMnptNy03YTYgNiAwIDAgMC02IDZ2NmgxMmE2IDYgMCAwIDAgNi02VjZIOXoiLz4KICAgIDxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iaW5oZXJpdCIgc3Ryb2tlLWxpbmVjYXA9InNxdWFyZSIgZD0iTTE5IDNsMi41IDIuNUwxOSA4TTUgMTZsLTIuNSAyLjVMNSAyMSIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtcm90YXRlLWNsb2Nrd2lzZSIgdmlld0JveD0iMCAwIDMyIDMyIj4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTTI5IDE3aC0uOTI0YzAgNi42MjctNS4zNzMgMTItMTIgMTItNi42MjggMC0xMi01LjM3My0xMi0xMkM0LjA3NiAxMC4zOTggOS40MDcgNS4wNDEgMTYgNVY0QzguODIgNCAzIDkuODIgMyAxN3M1LjgyIDEzIDEzIDEzIDEzLTUuODIgMTMtMTN6Ii8+CiAgICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIHN0cm9rZS1saW5lY2FwPSJzcXVhcmUiIGQ9Ik0xNiAxLjVsNCAzLTQgMyIvPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBmaWxsLXJ1bGU9Im5vbnplcm8iIGQ9Ik0xNiA0aDR2MWgtNHoiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLXJvdGF0ZS1jb3VudGVyY2xvY2t3aXNlIiB2aWV3Qm94PSIwIDAgMzIgMzIiPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBkPSJNMyAxN2guOTI0YzAgNi42MjcgNS4zNzMgMTIgMTIgMTIgNi42MjggMCAxMi01LjM3MyAxMi0xMiAwLTYuNjAyLTUuMzMxLTExLjk2LTExLjkyNC0xMlY0YzcuMTggMCAxMyA1LjgyIDEzIDEzcy01LjgyIDEzLTEzIDEzUzMgMjQuMTggMyAxN3oiLz4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZmlsbC1ydWxlPSJub256ZXJvIiBkPSJNMTIgNGg0djFoLTR6Ii8+CiAgICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIHN0cm9rZS1saW5lY2FwPSJzcXVhcmUiIGQ9Ik0xNiAxLjVsLTQgMyA0IDMiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLXJvdGF0ZSIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiIHN0cm9rZT0ibm9uZSIgLz4KICAgIDxwYXRoIGZpbGw9ImluaGVyaXQiIHN0cm9rZT0ibm9uZSIgZD0iTTguMzQ5IDIyLjI1NGExMC4wMDIgMTAuMDAyIDAgMCAxLTIuNzc4LTEuNzE5bC42NS0uNzZhOS4wMDIgOS4wMDIgMCAwIDAgMi40OTUgMS41NDhsLS4zNjcuOTMxem0yLjg3My43MDRsLjA3OC0uOTk3YTkgOSAwIDEgMC0uNTU3LTE3Ljg1MmwtLjE0LS45OUExMC4wNzYgMTAuMDc2IDAgMCAxIDEyLjE0NSAzYzUuNTIzIDAgMTAgNC40NzcgMTAgMTBzLTQuNDc3IDEwLTEwIDEwYy0uMzEyIDAtLjYyLS4wMTQtLjkyNC0uMDQyem0tNy41NTYtNC42NTVhOS45NDIgOS45NDIgMCAwIDEtMS4yNTMtMi45OTZsLjk3My0uMjM0YTguOTQ4IDguOTQ4IDAgMCAwIDEuMTI0IDIuNjkzbC0uODQ0LjUzN3ptLTEuNTAyLTUuOTFBOS45NDkgOS45NDkgMCAwIDEgMi44OCA5LjIzbC45MjUuMzgyYTguOTU0IDguOTU0IDAgMCAwLS42NDQgMi44NDRsLS45OTgtLjA2MnptMi4yMS01LjY4NmMuNjg3LS44NDggMS41MS0xLjU4IDIuNDM2LTIuMTY2bC41MjMuODUyYTkuMDQ4IDkuMDQ4IDAgMCAwLTIuMTg4IDEuOTVsLS43NzEtLjYzNnoiLz4KICAgIDxwYXRoIHN0cm9rZT0iaW5oZXJpdCIgZmlsbD0ibm9uZSIgc3Ryb2tlLWxpbmVjYXA9InNxdWFyZSIgZD0iTTEzIDFsLTIuNSAyLjVMMTMgNiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtc2hhcGUtY2lyY2xlIiB2aWV3Qm94PSIwIDAgMzIgMzIiPgogICAgPGNpcmNsZSBjeD0iMTYiIGN5PSIxNiIgcj0iMTQuNSIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJpbmhlcml0Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1zaGFwZS1yZWN0YW5nbGUiIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgICA8cmVjdCB3aWR0aD0iMjciIGhlaWdodD0iMjciIHg9IjIuNSIgeT0iMi41IiBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIHJ4PSIxIi8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1zaGFwZS10cmlhbmdsZSIgdmlld0JveD0iMCAwIDMyIDMyIj4KICAgIDxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZD0iTTE2IDIuNWwxNS41IDI3SC41eiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtc2hhcGUiIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0xNC43MDYgOEgyMWExIDEgMCAwIDEgMSAxdjEyYTEgMSAwIDAgMS0xIDFIOWExIDEgMCAwIDEtMS0xdi00aDF2NGgxMlY5aC01LjcwNmwtLjU4OC0xeiIvPgogICAgPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJpbmhlcml0IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGQ9Ik04LjUgMS41bDcuNSAxM0gxeiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtdGV4dC1hbGlnbi1jZW50ZXIiIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9Im5vbmUiIGQ9Ik0wIDBoMzJ2MzJIMHoiLz4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTTIgNWgyOHYxSDJ6TTggMTJoMTZ2MUg4ek0yIDE5aDI4djFIMnpNOCAyNmgxNnYxSDh6Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy10ZXh0LWFsaWduLWxlZnQiIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9Im5vbmUiIGQ9Ik0wIDBoMzJ2MzJIMHoiLz4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTTIgNWgyOHYxSDJ6TTIgMTJoMTZ2MUgyek0yIDE5aDI4djFIMnpNMiAyNmgxNnYxSDJ6Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy10ZXh0LWFsaWduLXJpZ2h0IiB2aWV3Qm94PSIwIDAgMzIgMzIiPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJub25lIiBkPSJNMCAwaDMydjMySDB6Ii8+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0yIDVoMjh2MUgyek0xNCAxMmgxNnYxSDE0ek0yIDE5aDI4djFIMnpNMTQgMjZoMTZ2MUgxNHoiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLXRleHQtYm9sZCIgdmlld0JveD0iMCAwIDMyIDMyIj4KICAgIDxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0ibm9uZSIgZD0iTTAgMGgzMnYzMkgweiIvPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNNyAyaDJ2Mkg3ek03IDI4aDJ2Mkg3eiIvPgogICAgPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJpbmhlcml0IiBzdHJva2Utd2lkdGg9IjIiIGQ9Ik05IDN2MTJoOWE2IDYgMCAxIDAgMC0xMkg5ek05IDE1djE0aDEwYTcgNyAwIDAgMCAwLTE0SDl6Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy10ZXh0LWl0YWxpYyIgdmlld0JveD0iMCAwIDMyIDMyIj4KICAgIDxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0ibm9uZSIgZD0iTTAgMGgzMnYzMkgweiIvPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNMTUgMmg1djFoLTV6TTExIDI5aDV2MWgtNXpNMTcgM2gxbC00IDI2aC0xeiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtdGV4dC11bmRlcmxpbmUiIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9Im5vbmUiIGQ9Ik0wIDBoMzJ2MzJIMHoiLz4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTTggMnYxNGE4IDggMCAxIDAgMTYgMFYyaDF2MTRhOSA5IDAgMCAxLTE4IDBWMmgxek0zIDI5aDI2djFIM3oiLz4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTTUgMmg1djFINXpNMjIgMmg1djFoLTV6Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy10ZXh0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNNCAzaDE1YTEgMSAwIDAgMSAxIDFIM2ExIDEgMCAwIDEgMS0xek0zIDRoMXYxSDN6TTE5IDRoMXYxaC0xeiIvPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNMTEgM2gxdjE4aC0xeiIvPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNMTAgMjBoM3YxaC0zeiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtdW5kbyIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxwYXRoIGQ9Ik0yNCAwSDB2MjRoMjR6IiBvcGFjaXR5PSIuNSIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJub25lIiAvPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNMyA2aDEyYTYgNiAwIDEgMSAwIDEySDN2MWgxMmE3IDcgMCAwIDAgMC0xNEgzdjF6Ii8+CiAgICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIHN0cm9rZS1saW5lY2FwPSJzcXVhcmUiIGQ9Ik01IDNMMi41IDUuNSA1IDgiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLXpvb20taW4iIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMjI5IC0yOTApIHRyYW5zbGF0ZSgyMjkgMjkwKSI+CiAgICAgICAgPGNpcmNsZSBjeD0iMTAuNSIgY3k9IjEwLjUiIHI9IjkiIHN0cm9rZT0iaW5oZXJpdCIgZmlsbD0ibm9uZSIvPgogICAgICAgIDxwYXRoIGZpbGw9ImluaGVyaXQiIGQ9Ik0xOC44MjggMTUuODI4SDE5LjgyOFYyMi44MjhIMTguODI4eiIgdHJhbnNmb3JtPSJyb3RhdGUoLTQ1IDE5LjMyOCAxOS4zMjgpIi8+CiAgICAgICAgPHBhdGggZmlsbD0iaW5oZXJpdCIgZD0iTTcgMTBIMTRWMTFIN3oiLz4KICAgICAgICA8cGF0aCBmaWxsPSJpbmhlcml0IiBkPSJNMTAgN0gxMVYxNEgxMHoiLz4KICAgIDwvZz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLXpvb20tb3V0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPgogICAgPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTI2MyAtMjkwKSB0cmFuc2xhdGUoMjYzIDI5MCkiPgogICAgICAgIDxjaXJjbGUgY3g9IjEwLjUiIGN5PSIxMC41IiByPSI5IiBzdHJva2U9ImluaGVyaXQiIGZpbGw9Im5vbmUiLz4KICAgICAgICA8cGF0aCBmaWxsPSJpbmhlcml0IiBkPSJNMTguODI4IDE1LjgyOEgxOS44MjhWMjIuODI4SDE4LjgyOHoiIHRyYW5zZm9ybT0icm90YXRlKC00NSAxOS4zMjggMTkuMzI4KSIvPgogICAgICAgIDxwYXRoIGZpbGw9ImluaGVyaXQiIGQ9Ik03IDEwSDE0VjExSDd6Ii8+CiAgICA8L2c+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1oYW5kIiB2aWV3Qm94PSIwIDAgMjQgMjQiPgogICAgPGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj4KICAgICAgICA8cGF0aCBmaWxsPSJpbmhlcml0IiBmaWxsLXJ1bGU9Im5vbnplcm8iIGQ9Ik04LjY3MiAzLjM2YzEuMzI4IDAgMi4xMTQuNzggMi4yOSAxLjg2OWwuMDE0LjEwMS4wMjMuMDA2djEuMDQybC0uNjM4LS4xODVjLS4xODctLjA1NS0uMzIzLS4yMTEtLjM1NC0uMzk5TDEwIDUuNzEzYzAtLjgyNS0uNDItMS4zNTMtMS4zMjgtMS4zNTNDNy42OTUgNC4zNiA3IDUuMDQxIDcgNS43MTN2Ny45NDFjMCAuNDM5LS41MjQuNjY1LS44NDMuMzY0bC0xLjg2OC0xLjc2MWMtLjU5NS0uNTI4LTEuMzE2LS42MTctMS45MTgtLjIxNi0uNTIyLjM0OC0uNTYyIDEuMjAzLS4xOCAxLjhMNy43MzggMjJoMTEuMDEzbC4yODUtLjUxOGMxLjI0Ny0yLjMyNiAxLjg5Ny00LjI1OSAxLjk2LTUuNzg1bC4wMDQtLjIzOVY4LjAzNWMwLS42NTYtLjUtMS4xNy0xLTEuMTctLjUwMyAwLTEgLjQ1Ni0xIDEuMTcgMCAuMzMzLS4zMi41NzMtLjY0LjQ4TDE4IDguNDFWNy4zNjhsLjA4Ni4wMjYuMDQyLS4xMzZjLjI3OS0uODA1Ljk3OC0xLjMzMiAxLjczOC0xLjM4OEwyMCA1Ljg2NWMxLjA1NyAwIDIgLjk2NyAyIDIuMTd2Ny40MjNjMCAxLjkyOS0uODQ1IDQuMzUyLTIuNTIxIDcuMjktLjA5LjE1Ni0uMjU1LjI1Mi0uNDM1LjI1Mkg3LjQ3NGMtLjE2NiAwLS4zMjEtLjA4Mi0uNDE0LS4yMTlsLTUuNzA0LTguMzljLS42NTMtMS4wMTktLjU4NC0yLjQ4Ni40Ni0zLjE4MiAxLS42NjYgMi4yMTYtLjUxNiAzLjE0OC4zMUw2IDEyLjQ5NVY1LjcxM2MwLTEuMTggMS4wNTgtMi4yNjMgMi40OS0yLjM0OHoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yOTcgLTI5MCkgdHJhbnNsYXRlKDI5NyAyOTApIi8+CiAgICAgICAgPHBhdGggZmlsbD0iaW5oZXJpdCIgZmlsbC1ydWxlPSJub256ZXJvIiBkPSJNMTIuNSAxLjVjMS4zMjUgMCAyLjQxIDEuMDMyIDIuNDk1IDIuMzM2TDE1IDR2Ny4yMmgtMVY0YzAtLjgyOC0uNjcyLTEuNS0xLjUtMS41LS43OCAwLTEuNDIuNTk1LTEuNDkzIDEuMzU2TDExIDR2Ny4yMmgtMVY0YzAtMS4zOCAxLjEyLTIuNSAyLjUtMi41eiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTI5NyAtMjkwKSB0cmFuc2xhdGUoMjk3IDI5MCkiLz4KICAgICAgICA8cGF0aCBmaWxsPSJpbmhlcml0IiBmaWxsLXJ1bGU9Im5vbnplcm8iIGQ9Ik0xNi41IDMuNWMxLjMyNSAwIDIuNDEgMS4wMzIgMi40OTUgMi4zMzZMMTkgNnY2LjNoLTFWNmMwLS44MjgtLjY3Mi0xLjUtMS41LTEuNS0uNzggMC0xLjQyLjU5NS0xLjQ5MyAxLjM1NkwxNSA2djIuNDRoLTFWNmMwLTEuMzggMS4xMi0yLjUgMi41LTIuNXoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yOTcgLTI5MCkgdHJhbnNsYXRlKDI5NyAyOTApIi8+CiAgICA8L2c+Cjwvc3ltYm9sPgo8L2RlZnM+Cjwvc3ZnPgo="},4858:function(e){"use strict";e.exports=t},4960:function(){},6759:function(){},6272:function(){}},n={};function r(t){var e=n[t];if(void 0!==e)return e.exports;var o=n[t]={exports:{}};return i[t](o,o.exports,r),o.exports}!function(){r.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return r.d(e,{a:e}),e}}(),function(){r.d=function(t,e){for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})}}(),function(){r.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"===typeof window)return window}}()}(),function(){r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}}();var o={};return function(){"use strict";r.d(o,{default:function(){return Ec}});var t=r(9131),e=r.n(t),i=r(1899),n=r.n(i),a=r(6562),s=r.n(a),c=r(1734),l=r.n(c),u=r(8005),h=r.n(u),f=r(6065),d=r.n(f),g=r(4496),p=r.n(g);Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(t){var e=this;do{if(Element.prototype.matches.call(e,t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null})
  10. /*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */,"document"in self&&((!("classList"in document.createElement("_"))||document.createElementNS&&!("classList"in document.createElementNS("http://www.w3.org/2000/svg","g")))&&function(t){if("Element"in t){var i="classList",r="prototype",o=t.Element[r],a=Object,c=e()(String[r])||function(){return this.replace(/^\s+|\s+$/g,"")},u=n()(Array[r])||function(t){for(var e=0,i=this.length;e<i;e++)if(e in this&&this[e]===t)return e;return-1},h=function(t,e){this.name=t,this.code=DOMException[t],this.message=e},f=function(t,e){if(""===e)throw new h("SYNTAX_ERR","The token must not be empty.");if(/\s/.test(e))throw new h("INVALID_CHARACTER_ERR","The token must not contain space characters.");return u.call(t,e)},d=function(t){for(var e=c.call(t.getAttribute("class")||""),i=e?e.split(/\s+/):[],n=0,r=i.length;n<r;n++)this.push(i[n]);this._updateClassName=function(){t.setAttribute("class",this.toString())}},g=d[r]=[],p=function(){return new d(this)};if(h[r]=Error[r],g.item=function(t){return this[t]||null},g.contains=function(t){return~f(this,t+"")},g.add=function(){var t,e=arguments,i=0,n=e.length,r=!1;do{t=e[i]+"",~f(this,t)||(this.push(t),r=!0)}while(++i<n);r&&this._updateClassName()},g.remove=function(){var t,e,i=arguments,n=0,r=i.length,o=!1;do{t=i[n]+"",e=f(this,t);while(~e){var a;s()(a=this).call(a,e,1),o=!0,e=f(this,t)}}while(++n<r);o&&this._updateClassName()},g.toggle=function(t,e){var i=this.contains(t),n=i?!0!==e&&"remove":!1!==e&&"add";return n&&this[n](t),!0===e||!1===e?e:!i},g.replace=function(t,e){var i,n=f(t+"");~n&&(s()(i=this).call(i,n,1,e),this._updateClassName())},g.toString=function(){return this.join(" ")},l()){var v={get:p,enumerable:!0,configurable:!0};try{l()(o,i,v)}catch(m){void 0!==m.number&&-2146823252!==m.number||(v.enumerable=!1,l()(o,i,v))}}else a[r].__defineGetter__&&o.__defineGetter__(i,p)}}(self),function(){var t=document.createElement("_");if(t.classList.add("c1","c2"),!t.classList.contains("c2")){var e=function(t){var e=DOMTokenList.prototype[t];DOMTokenList.prototype[t]=function(t){var i,n=arguments.length;for(i=0;i<n;i++)t=arguments[i],e.call(this,t)}};e("add"),e("remove")}if(t.classList.toggle("c3",!1),t.classList.contains("c3")){var i=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(t,e){return 1 in arguments&&!this.contains(t)===!e?e:i.call(this,t)}}"replace"in document.createElement("_").classList||(DOMTokenList.prototype.replace=function(t,e){var i=this.toString().split(" "),r=n()(i).call(i,t+"");~r&&(i=h()(i).call(i,r),this.remove.apply(this,i),this.add(e),this.add.apply(this,h()(i).call(i,1)))}),t=null}())
  11. /*!
  12. * @copyright Copyright (c) 2017 IcoMoon.io
  13. * @license Licensed under MIT license
  14. * See https://github.com/Keyamoon/svgxuse
  15. * @version 1.2.6
  16. */,function(){if("undefined"!==typeof window&&window.addEventListener){var t,e,i,n=d()(null),r=function(){clearTimeout(e),e=p()(t,100)},o=function(){},a=function(){var t;window.addEventListener("resize",r,!1),window.addEventListener("orientationchange",r,!1),window.MutationObserver?(t=new MutationObserver(r),t.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}),o=function(){try{t.disconnect(),window.removeEventListener("resize",r,!1),window.removeEventListener("orientationchange",r,!1)}catch(e){}}):(document.documentElement.addEventListener("DOMSubtreeModified",r,!1),o=function(){document.documentElement.removeEventListener("DOMSubtreeModified",r,!1),window.removeEventListener("resize",r,!1),window.removeEventListener("orientationchange",r,!1)})},s=function(t){function e(t){var e;return void 0!==t.protocol?e=t:(e=document.createElement("a"),e.href=t),e.protocol.replace(/:/g,"")+e.host}var i,n,r;return window.XMLHttpRequest&&(i=new XMLHttpRequest,n=e(location),r=e(t),i=void 0===i.withCredentials&&""!==r&&r!==n?XDomainRequest||void 0:XMLHttpRequest),i},c="http://www.w3.org/1999/xlink";t=function(){var t,e,i,r,l,u,h,f,d,g,v="",m=0;function y(){m-=1,0===m&&(o(),a())}function b(t){return function(){!0!==n[t.base]&&(t.useEl.setAttributeNS(c,"xlink:href","#"+t.hash),t.useEl.hasAttribute("href")&&t.useEl.setAttribute("href","#"+t.hash))}}function _(t){return function(){var e,i=document.body,n=document.createElement("x");t.onload=null,n.innerHTML=t.responseText,e=n.getElementsByTagName("svg")[0],e&&(e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.width=0,e.style.height=0,e.style.overflow="hidden",i.insertBefore(e,i.firstChild)),y()}}function x(t){return function(){t.onerror=null,t.ontimeout=null,y()}}for(o(),d=document.getElementsByTagName("use"),l=0;l<d.length;l+=1){try{e=d[l].getBoundingClientRect()}catch(C){e=!1}r=d[l].getAttribute("href")||d[l].getAttributeNS(c,"href")||d[l].getAttribute("xlink:href"),f=r&&r.split?r.split("#"):["",""],t=f[0],i=f[1],u=e&&0===e.left&&0===e.right&&0===e.top&&0===e.bottom,e&&0===e.width&&0===e.height&&!u?(v&&!t.length&&i&&!document.getElementById(i)&&(t=v),d[l].hasAttribute("href")&&d[l].setAttributeNS(c,"xlink:href",r),t.length&&(g=n[t],!0!==g&&p()(b({useEl:d[l],base:t,hash:i}),0),void 0===g&&(h=s(t),void 0!==h&&(g=new h,n[t]=g,g.onload=_(g),g.onerror=x(g),g.ontimeout=x(g),g.open("GET",t),g.send(),m+=1)))):u?t.length&&n[t]&&p()(b({useEl:d[l],base:t,hash:i}),0):void 0===n[t]?n[t]=!0:n[t].onload&&(n[t].abort(),delete n[t].onload,n[t]=!0)}d="",m+=1,y()},i=function(){window.removeEventListener("load",i,!1),e=p()(t,0)},"complete"!==document.readyState?window.addEventListener("load",i,!1):i()}}();var v=r(1845);function m(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 y(t){if(v(t))return m(t)}var b=r(184),_=r(662),x=r(7172);function C(t){if("undefined"!==typeof b&&null!=_(t)||null!=t["@@iterator"])return x(t)}var I=r(711);function M(t,e){var i;if(t){if("string"===typeof t)return m(t,e);var n=I(i=Object.prototype.toString.call(t)).call(i,8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?x(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(t,e):void 0}}function S(){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 w(t){return y(t)||C(t)||M(t)||S()}var T=r(7077);function A(t,e,i){return e in t?T(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function D(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function E(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),T(t,n.key,n)}}function k(t,e,i){return e&&E(t.prototype,e),i&&E(t,i),t}var O=r(4426),j=r.n(O),L=r(9406),N=r.n(L),P=r(8189),z=r.n(P),R=r(3972),B=r.n(R),F=r(2777),Y=r(961),H=r.n(Y),U=r(5695),W=r.n(U),G=r(8592),X=r.n(G),Z=r(9052),V=r.n(Z),J=r(2560),Q=r.n(J),K=r(2461),q=r.n(K);function $(t){if(v(t))return t}function tt(t,e){var i=null==t?null:"undefined"!==typeof b&&_(t)||t["@@iterator"];if(null!=i){var n,r,o=[],a=!0,s=!1;try{for(i=i.call(t);!(a=(n=i.next()).done);a=!0)if(o.push(n.value),e&&o.length===e)break}catch(c){s=!0,r=c}finally{try{a||null==i["return"]||i["return"]()}finally{if(s)throw r}}return o}}function et(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function it(t,e){return $(t)||tt(t,e)||M(t,e)||et()}var nt,rt=r(6397),ot=r.n(rt),at=r(7636),st=r.n(at),ct=r(789),lt=r.n(ct),ut=r(4729),ht=r.n(ut),ft=r(1610),dt=r.n(ft),gt=r(3053),pt=r.n(gt),vt=["zoomIn","zoomOut","hand"],mt=["history","undo","redo","reset"],yt=["delete","deleteAll"],bt=N()(nt=[]).call(nt,vt,mt,yt),_t={FILTER:"filter",COLOR:"color"},xt=["rect","circle","triangle"],Ct={CROPZONE:"cropzone"},It={VINTAGE:"vintage",SEPIA2:"sepia2",REMOVE_COLOR:"removeColor",COLOR_FILTER:"colorFilter",REMOVE_WHITE:"removeWhite",BLEND_COLOR:"blendColor",BLEND:"blend"},Mt=te("IMAGE_LOADER","CROPPER","FLIP","ROTATION","FREE_DRAWING","LINE","TEXT","ICON","FILTER","SHAPE","ZOOM","RESIZE"),St={lockSkewingX:!0,lockSkewingY:!0,bringForward:!0,isRegular:!1},wt={hasRotatingPoint:!1,hasBorders:!1,lockScalingFlip:!0,lockRotation:!0,lockSkewingX:!0,lockSkewingY:!0},Tt={CLEAR_OBJECTS:"clearObjects",LOAD_IMAGE:"loadImage",FLIP_IMAGE:"flip",ROTATE_IMAGE:"rotate",ADD_OBJECT:"addObject",REMOVE_OBJECT:"removeObject",APPLY_FILTER:"applyFilter",REMOVE_FILTER:"removeFilter",ADD_ICON:"addIcon",CHANGE_ICON_COLOR:"changeIconColor",ADD_SHAPE:"addShape",CHANGE_SHAPE:"changeShape",ADD_TEXT:"addText",CHANGE_TEXT:"changeText",CHANGE_TEXT_STYLE:"changeTextStyle",ADD_IMAGE_OBJECT:"addImageObject",RESIZE_CANVAS_DIMENSION:"resizeCanvasDimension",SET_OBJECT_PROPERTIES:"setObjectProperties",SET_OBJECT_POSITION:"setObjectPosition",CHANGE_SELECTION:"changeSelection",RESIZE_IMAGE:"resize"},At={OBJECT_ACTIVATED:"objectActivated",OBJECT_MOVED:"objectMoved",OBJECT_SCALED:"objectScaled",OBJECT_CREATED:"objectCreated",OBJECT_ROTATED:"objectRotated",OBJECT_ADDED:"objectAdded",OBJECT_MODIFIED:"objectModified",TEXT_EDITING:"textEditing",TEXT_CHANGED:"textChanged",ICON_CREATE_RESIZE:"iconCreateResize",ICON_CREATE_END:"iconCreateEnd",ADD_TEXT:"addText",ADD_OBJECT:"addObject",ADD_OBJECT_AFTER:"addObjectAfter",MOUSE_DOWN:"mousedown",MOUSE_UP:"mouseup",MOUSE_MOVE:"mousemove",REDO_STACK_CHANGED:"redoStackChanged",UNDO_STACK_CHANGED:"undoStackChanged",SELECTION_CLEARED:"selectionCleared",SELECTION_CREATED:"selectionCreated",EXECUTE_COMMAND:"executeCommand",AFTER_UNDO:"afterUndo",AFTER_REDO:"afterRedo",ZOOM_CHANGED:"zoomChanged",HAND_STARTED:"handStarted",HAND_STOPPED:"handStopped",KEY_DOWN:"keydown",KEY_UP:"keyup",INPUT_BOX_EDITING_STARTED:"inputBoxEditingStarted",INPUT_BOX_EDITING_STOPPED:"inputBoxEditingStopped",FOCUS:"focus",BLUR:"blur",IMAGE_RESIZED:"imageResized"},Dt={COLOR_PICKER_INPUT_BOX:".tui-colorpicker-palette-hex"},Et={LOAD_IMAGE:"Load",LOAD_MASK_IMAGE:"Mask",ADD_MASK_IMAGE:"Mask",ADD_IMAGE_OBJECT:"Mask",CROP:"Crop",RESIZE:"Resize",APPLY_FILTER:"Filter",REMOVE_FILTER:"Filter",CHANGE_SHAPE:"Shape",CHANGE_ICON_COLOR:"Icon",ADD_TEXT:"Text",CHANGE_TEXT_STYLE:"Text",REMOVE_OBJECT:"Delete",CLEAR_OBJECTS:"Delete"},kt=te("NORMAL","CROPPER","FREE_DRAWING","LINE_DRAWING","TEXT","SHAPE","ICON","ZOOM","RESIZE"),Ot={TEXT:"text",CROP:"crop",RESIZE:"resize",SHAPE:"shape",ZOOM:"zoom"},jt={DEFAULT:"normal",ZOOM:"zoom",HAND:"hand"},Lt={Z:90,Y:89,C:67,V:86,SHIFT:16,BACKSPACE:8,DEL:46,ARROW_DOWN:40,ARROW_UP:38,SPACE:32,DIGIT_0:48,DIGIT_9:57},Nt={SELECTION_STYLE:{borderColor:"red",cornerColor:"green",cornerSize:10,originX:"center",originY:"center",transparentCorners:!1}},Pt={addedObject:"The object is already added.",flip:"The flipX and flipY setting values are not changed.",invalidDrawingMode:"This operation is not supported in the drawing mode.",invalidParameters:"Invalid parameters.",isLock:"The executing command state is locked.",loadImage:"The background image is empty.",loadingImageFailed:"Invalid image loaded.",noActiveObject:"There is no active object.",noObject:"The object is not in canvas.",redo:"The promise of redo command is reject.",rotation:"The current angle is same the old angle.",undo:"The promise of undo command is reject.",unsupportedOperation:"Unsupported operation.",unsupportedType:"Unsupported object type."},zt={"icon-arrow":"M40 12V0l24 24-24 24V36H0V12h40z","icon-arrow-2":"M49,32 H3 V22 h46 l-18,-18 h12 l23,23 L43,50 h-12 l18,-18 z ","icon-arrow-3":"M43.349998,27 L17.354,53 H1.949999 l25.996,-26 L1.949999,1 h15.404 L43.349998,27 z ","icon-star":"M35,54.557999 l-19.912001,10.468 l3.804,-22.172001 l-16.108,-15.7 l22.26,-3.236 L35,3.746 l9.956,20.172001 l22.26,3.236 l-16.108,15.7 l3.804,22.172001 z ","icon-star-2":"M17,31.212 l-7.194,4.08 l-4.728,-6.83 l-8.234,0.524 l-1.328,-8.226 l-7.644,-3.14 l2.338,-7.992 l-5.54,-6.18 l5.54,-6.176 l-2.338,-7.994 l7.644,-3.138 l1.328,-8.226 l8.234,0.522 l4.728,-6.83 L17,-24.312 l7.194,-4.08 l4.728,6.83 l8.234,-0.522 l1.328,8.226 l7.644,3.14 l-2.338,7.992 l5.54,6.178 l-5.54,6.178 l2.338,7.992 l-7.644,3.14 l-1.328,8.226 l-8.234,-0.524 l-4.728,6.83 z ","icon-polygon":"M3,31 L19,3 h32 l16,28 l-16,28 H19 z ","icon-location":"M24 62C8 45.503 0 32.837 0 24 0 10.745 10.745 0 24 0s24 10.745 24 24c0 8.837-8 21.503-24 38zm0-28c5.523 0 10-4.477 10-10s-4.477-10-10-10-10 4.477-10 10 4.477 10 10 10z","icon-heart":"M49.994999,91.349998 l-6.96,-6.333 C18.324001,62.606995 2.01,47.829002 2.01,29.690998 C2.01,14.912998 13.619999,3.299999 28.401001,3.299999 c8.349,0 16.362,5.859 21.594,12 c5.229,-6.141 13.242001,-12 21.591,-12 c14.778,0 26.390999,11.61 26.390999,26.390999 c0,18.138 -16.314001,32.916 -41.025002,55.374001 l-6.96,6.285 z ","icon-bubble":"M44 48L34 58V48H12C5.373 48 0 42.627 0 36V12C0 5.373 5.373 0 12 0h40c6.627 0 12 5.373 12 12v24c0 6.627-5.373 12-12 12h-8z"},Rt={realTimeEvent:!0,min:-360,max:360,value:0},Bt={min:5,max:30,value:12},Ft={realTimeEvent:!0,min:2,max:300,value:3},Yt={realTimeEvent:!0,min:10,max:100,value:50},Ht={tintOpacityRange:{realTimeEvent:!0,min:0,max:1,value:.7,useDecimal:!0},removewhiteDistanceRange:{realTimeEvent:!0,min:0,max:1,value:.2,useDecimal:!0},brightnessRange:{realTimeEvent:!0,min:-1,max:1,value:0,useDecimal:!0},noiseRange:{realTimeEvent:!0,min:0,max:1e3,value:100},pixelateRange:{realTimeEvent:!0,min:2,max:20,value:4},colorfilterThresholdRange:{realTimeEvent:!0,min:0,max:1,value:.2,useDecimal:!0},blurFilterRange:{value:.1}},Ut={LEFT:0,TOP:0,WIDTH:.5,HEIGHT:.5},Wt={realTimeEvent:!0,min:32,max:4088,value:800},Gt=2,Xt="tui-image-editor-",Zt=Math.min,Vt=Math.max,Jt=!1,Qt=0;function Kt(t){return t.__fe_id||(Qt+=1,t.__fe_id=Qt),t.__fe_id}function qt(t){return"function"===typeof t}function $t(t,e,i){if(e>i){var n=[i,e];e=n[0],i=n[1]}return Vt(e,Zt(t,i))}function te(){for(var t={},e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return X()(i,(function(e){t[e]=e})),t}function ee(t,e){var i,n={},r=e.length,o=0;for(o=0;o<r;o+=1)i=e[o],n[i]=t[i];return n}function ie(t){return ot()(t,10)}function ne(t){return t.replace(/-([a-z])/g,(function(t,e){return e.toUpperCase()}))}function re(){return!!(window.File&&window.FileList&&window.FileReader)}function oe(t,e){var i,n,r,o;4===t.length&&(t=N()(o="".concat(t)).call(o,h()(t).call(t,1,4)));var a=ot()(h()(t).call(t,1,3),16),s=ot()(h()(t).call(t,3,5),16),c=ot()(h()(t).call(t,5,7),16),l=e||1;return N()(i=N()(n=N()(r="rgba(".concat(a,", ")).call(r,s,", ")).call(n,c,", ")).call(i,l,")")}function ae(){Jt||(Jt=!0,ht()("image-editor","UA-129999381-1"))}function se(t,e){var i=document.getElementsByTagName("head"),n=it(i,1),r=n[0],o=document.createElement("link"),a=encodeURIComponent(t);e&&(o.id=e),o.setAttribute("rel","stylesheet"),o.setAttribute("type","text/css"),o.setAttribute("href","data:text/css;charset=UTF-8,".concat(a)),r.appendChild(o)}function ce(t){return function(e){return t.querySelector(e)}}function le(t){var e,i,n,r=/data:(image\/.+);base64,/,o="";e=t.replace(r,(function(t,e){return o=e,""})),e=atob(e);var a=e.length;for(i=new Uint8Array(a),n=0;n<a;n+=1)i[n]=e.charCodeAt(n);return new Blob([i],{type:o})}function ue(t){return Number(t.toFixed(Gt))}function he(t){X()(t,(function(e,i){t[i]=null}))}function fe(){var t,e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"."===i.charAt(0)?N()(e=".".concat(Xt).concat(n)).call(e,h()(i).call(i,1)):N()(t="".concat(Xt).concat(n)).call(t,i)}function de(t,e){var i=e.originX,n=e.originY,r=t.getPointByOrigin(i,n),o=r.x,a=r.y;t.set({left:o,top:a,originX:i,originY:n}),t.setCoords()}function ge(t){var e,i={};return st()(e=q()(t)).call(e,(function(e){i[t[e]]=e})),i}function pe(t,e){t.customProps=t.customProps||{},H()(t.customProps,e)}function ve(t,e){var i={};return Q()(e)&&(e=[e]),X()(e,(function(e){i[e]=t.customProps[e]})),i}function me(t){return t.charAt(0).toUpperCase()+h()(t).call(t,1)}function ye(t,e){return n()(t).call(t,e)>=0}function be(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return dt()(t,"type")||_t.COLOR}function _e(t){var e=lt()(t),i=void 0===e?{}:e;return i.source?_t.FILTER:_t.COLOR}function xe(t){return pt()(t.get("type"),xt)>=0}function Ce(t){if(ye(xt,t))return"Shape";switch(t){case"i-text":return"Text";case"path":case"line":return"Draw";case"activeSelection":return"Group";default:return Te(t)}}function Ie(t){var e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.useAlpha,r=void 0===n||n,o=i.mode,a=It.VINTAGE,s=It.REMOVE_COLOR,c=It.BLEND_COLOR,l=It.SEPIA2,u=It.COLOR_FILTER,h=It.REMOVE_WHITE,f=It.BLEND;switch(t){case a:e=l;break;case s:e=r?u:h;break;case c:e="add"===o?f:o;break;default:e=t}return Te(e)}function Me(t){var e=Tt.LOAD_IMAGE;return"string"===typeof t?e===t:e===t.name}function Se(t){var e,i,n,r=Tt.FLIP_IMAGE,o=Tt.ROTATE_IMAGE,a=Tt.ADD_TEXT,s=Tt.APPLY_FILTER,c=Tt.REMOVE_FILTER,l=Tt.CHANGE_SHAPE,u=Tt.CHANGE_ICON_COLOR,f=Tt.CHANGE_TEXT_STYLE,d=Tt.CLEAR_OBJECTS,g=Tt.ADD_IMAGE_OBJECT,p=Tt.REMOVE_OBJECT,v=Tt.RESIZE_IMAGE,m=t.name,y=t.args;switch(m){case r:n={name:m,detail:"reset"===y[1]?y[1]:h()(e=y[1]).call(e,4)};break;case o:n={name:m,detail:y[2]};break;case s:n={name:Et.APPLY_FILTER,detail:Ie(y[1],y[2])};break;case c:n={name:Et.REMOVE_FILTER,detail:"Remove"};break;case l:n={name:Et.CHANGE_SHAPE,detail:"Change"};break;case u:n={name:Et.CHANGE_ICON_COLOR,detail:"Change"};break;case f:n={name:Et.CHANGE_TEXT_STYLE,detail:"Change"};break;case p:n={name:Et.REMOVE_OBJECT,detail:y[2]};break;case d:n={name:Et.CLEAR_OBJECTS,detail:"All"};break;case g:n={name:Et.ADD_IMAGE_OBJECT,detail:"Add"};break;case a:n={name:Et.ADD_TEXT};break;case v:n={name:Et.RESIZE,detail:N()(i="".concat(~~y[1].width,"x")).call(i,~~y[1].height)};break;default:n={name:m};break}return"mask"===y[1]&&(n={name:Et.LOAD_MASK_IMAGE,detail:"Apply"}),n}function we(t){return"top"===t?"bottom":"left"===t?"right":"right"===t?"left":"top"}function Te(t){return t.replace(/[a-z]/,(function(t){return t.toUpperCase()}))}function Ae(t){var e=t.left,i=t.top,n=t.width,r=t.height,o=Ut.LEFT,a=Ut.TOP,s=Ut.WIDTH,c=Ut.HEIGHT;return e===o&&i===a&&n===s&&r===c}var De=te("UN_IMPLEMENTATION","NO_COMPONENT_NAME"),Ee={UN_IMPLEMENTATION:"Should implement a method: ",NO_COMPONENT_NAME:"Should set a component name"},ke={UN_IMPLEMENTATION:function(t){return Ee.UN_IMPLEMENTATION+t},NO_COMPONENT_NAME:function(){return Ee.NO_COMPONENT_NAME}},Oe={types:H()({},De),create:function(t){t=t.toLowerCase();for(var e=ke[t],i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return e.apply(void 0,n)}},je=Oe.create,Le=Oe.types,Ne=function(){function t(e,i){D(this,t),this.name=e.name,this.args=i,this.execute=e.execute,this.undo=e.undo,this.executeCallback=e.executeCallback||null,this.undoCallback=e.undoCallback||null,this.undoData={}}return k(t,[{key:"execute",value:function(){throw new Error(je(Le.UN_IMPLEMENTATION,"execute"))}},{key:"undo",value:function(){throw new Error(je(Le.UN_IMPLEMENTATION,"undo"))}},{key:"isRedo",get:function(){return q()(this.undoData).length>0}},{key:"setUndoData",value:function(t,e,i){return e&&(t=e),i?e||(e=t):(H()(this.undoData,t),e=null),e}},{key:"setExecuteCallback",value:function(t){return this.executeCallback=t,this}},{key:"setUndoCallback",value:function(t){return this.undoCallback=t,this}}]),t}(),Pe=Ne,ze={};function Re(t){var e=ze[t];if(e){for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return new Pe(e,n)}return null}function Be(t){ze[t.name]=t}var Fe={create:Re,register:Be},Ye=function(){function t(){D(this,t),this._undoStack=[],this._redoStack=[],this._isLocked=!1,this._isSilent=!1}return k(t,[{key:"_invokeExecution",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.lock();var n=t.args;return n||(n=[]),t.execute.apply(t,w(n)).then((function(n){return e._isSilent||(e.pushUndoStack(t),e.fire(i?At.AFTER_REDO:At.EXECUTE_COMMAND,t)),e.unlock(),qt(t.executeCallback)&&t.executeCallback(n),n}))["catch"]((function(t){return e.unlock(),z().reject(t)}))}},{key:"_invokeUndo",value:function(t){var e=this;this.lock();var i=t.args;return i||(i=[]),t.undo.apply(t,w(i)).then((function(i){return e.pushRedoStack(t),e.fire(At.AFTER_UNDO,t),e.unlock(),qt(t.undoCallback)&&t.undoCallback(i),i}))["catch"]((function(t){return e.unlock(),z().reject(t)}))}},{key:"_fireRedoStackChanged",value:function(){this.fire(At.REDO_STACK_CHANGED,this._redoStack.length)}},{key:"_fireUndoStackChanged",value:function(){this.fire(At.UNDO_STACK_CHANGED,this._undoStack.length)}},{key:"lock",value:function(){this._isLocked=!0}},{key:"unlock",value:function(){this._isLocked=!1}},{key:"executeSilent",value:function(){var t=this;this._isSilent=!0;for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return this.execute.apply(this,N()(i).call(i,[this._isSilent])).then((function(){t._isSilent=!1}))}},{key:"execute",value:function(){var t=this;if(this._isLocked)return z().reject(Pt.isLock);for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];var r=i[0];return Q()(r)&&(r=Fe.create.apply(Fe,i)),this._invokeExecution(r).then((function(e){return t.clearRedoStack(),e}))}},{key:"undo",value:function(){var t,e=this._undoStack.pop(),i="";if(e&&this._isLocked&&(this.pushUndoStack(e,!0),e=null),e)this.isEmptyUndoStack()&&this._fireUndoStackChanged(),t=this._invokeUndo(e);else{var n;if(i=Pt.undo,this._isLocked)i=N()(n="".concat(i," Because ")).call(n,Pt.isLock);t=z().reject(i)}return t}},{key:"redo",value:function(){var t,e=this._redoStack.pop(),i="";if(e&&this._isLocked&&(this.pushRedoStack(e,!0),e=null),e)this.isEmptyRedoStack()&&this._fireRedoStackChanged(),t=this._invokeExecution(e,!0);else{var n;if(i=Pt.redo,this._isLocked)i=N()(n="".concat(i," Because ")).call(n,Pt.isLock);t=z().reject(i)}return t}},{key:"pushUndoStack",value:function(t,e){this._undoStack.push(t),e||this._fireUndoStackChanged()}},{key:"pushRedoStack",value:function(t,e){this._redoStack.push(t),e||this._fireRedoStackChanged()}},{key:"isEmptyRedoStack",value:function(){return 0===this._redoStack.length}},{key:"isEmptyUndoStack",value:function(){return 0===this._undoStack.length}},{key:"clearUndoStack",value:function(){this.isEmptyUndoStack()||(this._undoStack=[],this._fireUndoStackChanged())}},{key:"clearRedoStack",value:function(){this.isEmptyRedoStack()||(this._redoStack=[],this._fireRedoStackChanged())}}]),t}();V().mixin(Ye);var He=Ye,Ue=r(5214),We=r.n(Ue),Ge=function(t){var e,i,n,r,o,a,s,c=t.locale,l=t.biImage,u=t.commonStyle,h=t.headerStyle,f=t.loadButtonStyle,d=t.downloadButtonStyle,g=t.submenuStyle;return N()(e=N()(i=N()(n=N()(r=N()(o=N()(a=N()(s='\n <div class="tui-image-editor-main-container" style="'.concat(u,'">\n <div class="tui-image-editor-header" style="')).call(s,h,'">\n <div class="tui-image-editor-header-logo">\n <img src="')).call(a,l,'" />\n </div>\n <div class="tui-image-editor-header-buttons">\n <div style="')).call(o,f,'">\n ')).call(r,c.localize("Load"),'\n <input type="file" class="tui-image-editor-load-btn" />\n </div>\n <button class="tui-image-editor-download-btn" style="')).call(n,d,'">\n ')).call(i,c.localize("Download"),'\n </button>\n </div>\n </div>\n <div class="tui-image-editor-main">\n <div class="tui-image-editor-submenu">\n <div class="tui-image-editor-submenu-style" style="')).call(e,g,'"></div>\n </div>\n <div class="tui-image-editor-wrap">\n <div class="tui-image-editor-size-wrap">\n <div class="tui-image-editor-align-wrap">\n <div class="tui-image-editor"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n')},Xe=function(t){var e,i,n,r,o,a=t.locale,s=t.biImage,c=t.loadButtonStyle,l=t.downloadButtonStyle,u=t.menuBarPosition;return N()(e=N()(i=N()(n=N()(r=N()(o='\n <ul class="tui-image-editor-help-menu '.concat(we(u),'"></ul>\n <div class="tui-image-editor-controls">\n <div class="tui-image-editor-controls-logo">\n <img src="')).call(o,s,'" />\n </div>\n <ul class="tui-image-editor-menu"></ul>\n\n <div class="tui-image-editor-controls-buttons">\n <div style="')).call(r,c,'">\n ')).call(n,a.localize("Load"),'\n <input type="file" class="tui-image-editor-load-btn" />\n </div>\n <button class="tui-image-editor-download-btn" style="')).call(i,l,'">\n ')).call(e,a.localize("Download"),"\n </button>\n </div>\n </div>\n")},Ze=r(899),Ve=r.n(Ze),Je=function(t){var e,i,n,r,o,a,s,c,l,u,h,f,d,g,p,v,m,y,b,_,x,C,I,M,S,w,T,A,D,E=t.subMenuLabelActive,k=t.subMenuLabelNormal,O=t.subMenuRangeTitle,j=t.submenuPartitionVertical,L=t.submenuPartitionHorizontal,P=t.submenuCheckbox,z=t.submenuRangePointer,R=t.submenuRangeValue,B=t.submenuColorpickerTitle,F=t.submenuColorpickerButton,Y=t.submenuRangeBar,H=t.submenuRangeSubbar,U=t.submenuDisabledRangePointer,W=t.submenuDisabledRangeBar,G=t.submenuDisabledRangeSubbar,X=t.submenuIconSize,Z=t.menuIconSize,V=t.biSize,J=t.menuIconStyle,Q=t.submenuIconStyle;return N()(e=N()(i=N()(n=N()(r=N()(o=N()(a=N()(s=N()(c=N()(l=N()(u=N()(h=N()(f=N()(d=N()(g=N()(p=N()(v=N()(m=N()(y=N()(b=N()(_=N()(x=N()(C=N()(I=N()(M=N()(S=N()(w=N()(T=N()(A=N()(D='\n .tie-icon-add-button.icon-bubble .tui-image-editor-button[data-icontype="icon-bubble"] label,\n .tie-icon-add-button.icon-heart .tui-image-editor-button[data-icontype="icon-heart"] label,\n .tie-icon-add-button.icon-location .tui-image-editor-button[data-icontype="icon-location"] label,\n .tie-icon-add-button.icon-polygon .tui-image-editor-button[data-icontype="icon-polygon"] label,\n .tie-icon-add-button.icon-star .tui-image-editor-button[data-icontype="icon-star"] label,\n .tie-icon-add-button.icon-star-2 .tui-image-editor-button[data-icontype="icon-star-2"] label,\n .tie-icon-add-button.icon-arrow-3 .tui-image-editor-button[data-icontype="icon-arrow-3"] label,\n .tie-icon-add-button.icon-arrow-2 .tui-image-editor-button[data-icontype="icon-arrow-2"] label,\n .tie-icon-add-button.icon-arrow .tui-image-editor-button[data-icontype="icon-arrow"] label,\n .tie-icon-add-button.icon-bubble .tui-image-editor-button[data-icontype="icon-bubble"] label,\n .tie-draw-line-select-button.line .tui-image-editor-button.line label,\n .tie-draw-line-select-button.free .tui-image-editor-button.free label,\n .tie-flip-button.flipX .tui-image-editor-button.flipX label,\n .tie-flip-button.flipY .tui-image-editor-button.flipY label,\n .tie-flip-button.resetFlip .tui-image-editor-button.resetFlip label,\n .tie-crop-button .tui-image-editor-button.apply.active label,\n .tie-crop-preset-button .tui-image-editor-button.preset.active label,\n .tie-resize-button .tui-image-editor-button.apply.active label,\n .tie-resize-preset-button .tui-image-editor-button.preset.active label,\n .tie-shape-button.rect .tui-image-editor-button.rect label,\n .tie-shape-button.circle .tui-image-editor-button.circle label,\n .tie-shape-button.triangle .tui-image-editor-button.triangle label,\n .tie-text-effect-button .tui-image-editor-button.active label,\n .tie-text-align-button.tie-text-align-left .tui-image-editor-button.left label,\n .tie-text-align-button.tie-text-align-center .tui-image-editor-button.center label,\n .tie-text-align-button.tie-text-align-right .tui-image-editor-button.right label,\n .tie-mask-apply.apply.active .tui-image-editor-button.apply label,\n .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button:hover > label,\n .tui-image-editor-container .tui-image-editor-checkbox label > span {\n '.concat(E,"\n }\n .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button > label,\n .tui-image-editor-container .tui-image-editor-range-wrap.tui-image-editor-newline.short label,\n .tui-image-editor-container .tui-image-editor-range-wrap.tui-image-editor-newline.short label > span {\n ")).call(D,k,"\n }\n .tui-image-editor-container .tui-image-editor-range-wrap label > span {\n ")).call(A,O,"\n }\n .tui-image-editor-container .tui-image-editor-partition > div {\n ")).call(T,j,"\n }\n .tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-partition > div,\n .tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-partition > div {\n ")).call(w,L,"\n }\n .tui-image-editor-container .tui-image-editor-checkbox label > span:before {\n ")).call(S,P,"\n }\n .tui-image-editor-container .tui-image-editor-checkbox label > input:checked + span:before {\n border: 0;\n }\n .tui-image-editor-container .tui-image-editor-virtual-range-pointer {\n ")).call(M,z,"\n }\n .tui-image-editor-container .tui-image-editor-virtual-range-bar {\n ")).call(I,Y,"\n }\n .tui-image-editor-container .tui-image-editor-virtual-range-subbar {\n ")).call(C,H,"\n }\n .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-pointer {\n ")).call(x,U,"\n }\n .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-subbar {\n ")).call(_,G,"\n }\n .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-bar {\n ")).call(b,W,"\n }\n .tui-image-editor-container .tui-image-editor-range-value {\n ")).call(y,R,"\n }\n .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button .color-picker-value + label {\n ")).call(m,B,"\n }\n .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button .color-picker-value {\n ")).call(v,F,"\n }\n .tui-image-editor-container .svg_ic-menu {\n ")).call(p,Z,"\n }\n .tui-image-editor-container .svg_ic-submenu {\n ")).call(g,X,"\n }\n .tui-image-editor-container .tui-image-editor-controls-logo > img,\n .tui-image-editor-container .tui-image-editor-header-logo > img {\n ")).call(d,V,"\n }\n .tui-image-editor-menu use.normal.use-default,\n .tui-image-editor-help-menu use.normal.use-default {\n fill-rule: evenodd;\n fill: ")).call(f,J.normal.color,";\n stroke: ")).call(h,J.normal.color,";\n }\n .tui-image-editor-menu use.active.use-default,\n .tui-image-editor-help-menu use.active.use-default {\n fill-rule: evenodd;\n fill: ")).call(u,J.active.color,";\n stroke: ")).call(l,J.active.color,";\n }\n .tui-image-editor-menu use.hover.use-default,\n .tui-image-editor-help-menu use.hover.use-default {\n fill-rule: evenodd;\n fill: ")).call(c,J.hover.color,";\n stroke: ")).call(s,J.hover.color,";\n }\n .tui-image-editor-menu use.disabled.use-default,\n .tui-image-editor-help-menu use.disabled.use-default {\n fill-rule: evenodd;\n fill: ")).call(a,J.disabled.color,";\n stroke: ")).call(o,J.disabled.color,";\n }\n .tui-image-editor-submenu use.normal.use-default {\n fill-rule: evenodd;\n fill: ")).call(r,Q.normal.color,";\n stroke: ")).call(n,Q.normal.color,";\n }\n .tui-image-editor-submenu use.active.use-default {\n fill-rule: evenodd;\n fill: ")).call(i,Q.active.color,";\n stroke: ")).call(e,Q.active.color,";\n }\n")},Qe={"common.bi.image":"https://uicdn.toast.com/toastui/img/tui-image-editor-bi.png","common.bisize.width":"251px","common.bisize.height":"21px","common.backgroundImage":"none","common.backgroundColor":"#1e1e1e","common.border":"0px","header.backgroundImage":"none","header.backgroundColor":"transparent","header.border":"0px","loadButton.backgroundColor":"#fff","loadButton.border":"1px solid #ddd","loadButton.color":"#222","loadButton.fontFamily":"'Noto Sans', sans-serif","loadButton.fontSize":"12px","downloadButton.backgroundColor":"#fdba3b","downloadButton.border":"1px solid #fdba3b","downloadButton.color":"#fff","downloadButton.fontFamily":"'Noto Sans', sans-serif","downloadButton.fontSize":"12px","menu.normalIcon.color":"#8a8a8a","menu.activeIcon.color":"#555555","menu.disabledIcon.color":"#434343","menu.hoverIcon.color":"#e9e9e9","submenu.normalIcon.color":"#8a8a8a","submenu.activeIcon.color":"#e9e9e9","menu.iconSize.width":"24px","menu.iconSize.height":"24px","submenu.iconSize.width":"32px","submenu.iconSize.height":"32px","submenu.backgroundColor":"#1e1e1e","submenu.partition.color":"#3c3c3c","submenu.normalLabel.color":"#8a8a8a","submenu.normalLabel.fontWeight":"lighter","submenu.activeLabel.color":"#fff","submenu.activeLabel.fontWeight":"lighter","checkbox.border":"0px","checkbox.backgroundColor":"#fff","range.pointer.color":"#fff","range.bar.color":"#666","range.subbar.color":"#d1d1d1","range.disabledPointer.color":"#414141","range.disabledBar.color":"#282828","range.disabledSubbar.color":"#414141","range.value.color":"#fff","range.value.fontWeight":"lighter","range.value.fontSize":"11px","range.value.border":"1px solid #353535","range.value.backgroundColor":"#151515","range.title.color":"#fff","range.title.fontWeight":"lighter","colorpicker.button.border":"1px solid #1e1e1e","colorpicker.title.color":"#fff"},Ke=r(2534),qe=function(){function t(e){D(this,t),this.styles=this._changeToObject(H()({},Qe,e)),se(this._styleMaker()),this._loadDefaultSvgIcon()}return k(t,[{key:"getStyle",value:function(t){var e=null,i=t.replace(/\..+$/,""),n=this.styles[t];switch(t){case"common.bi":e=this.styles[t].image;break;case"menu.icon":e={active:this.styles["".concat(i,".activeIcon")],normal:this.styles["".concat(i,".normalIcon")],hover:this.styles["".concat(i,".hoverIcon")],disabled:this.styles["".concat(i,".disabledIcon")]};break;case"submenu.icon":e={active:this.styles["".concat(i,".activeIcon")],normal:this.styles["".concat(i,".normalIcon")]};break;case"submenu.label":e={active:this._makeCssText(this.styles["".concat(i,".activeLabel")]),normal:this._makeCssText(this.styles["".concat(i,".normalLabel")])};break;case"submenu.partition":e={vertical:this._makeCssText(H()({},n,{borderLeft:"1px solid ".concat(n.color)})),horizontal:this._makeCssText(H()({},n,{borderBottom:"1px solid ".concat(n.color)}))};break;case"range.disabledPointer":case"range.disabledBar":case"range.disabledSubbar":case"range.pointer":case"range.bar":case"range.subbar":n.backgroundColor=n.color,e=this._makeCssText(n);break;default:e=this._makeCssText(n);break}return e}},{key:"_styleMaker",value:function(){var t=this.getStyle("submenu.label"),e=this.getStyle("submenu.partition");return Je({subMenuLabelActive:t.active,subMenuLabelNormal:t.normal,submenuPartitionVertical:e.vertical,submenuPartitionHorizontal:e.horizontal,biSize:this.getStyle("common.bisize"),subMenuRangeTitle:this.getStyle("range.title"),submenuRangePointer:this.getStyle("range.pointer"),submenuRangeBar:this.getStyle("range.bar"),submenuRangeSubbar:this.getStyle("range.subbar"),submenuDisabledRangePointer:this.getStyle("range.disabledPointer"),submenuDisabledRangeBar:this.getStyle("range.disabledBar"),submenuDisabledRangeSubbar:this.getStyle("range.disabledSubbar"),submenuRangeValue:this.getStyle("range.value"),submenuColorpickerTitle:this.getStyle("colorpicker.title"),submenuColorpickerButton:this.getStyle("colorpicker.button"),submenuCheckbox:this.getStyle("checkbox"),menuIconSize:this.getStyle("menu.iconSize"),submenuIconSize:this.getStyle("submenu.iconSize"),menuIconStyle:this.getStyle("menu.icon"),submenuIconStyle:this.getStyle("submenu.icon")})}},{key:"_changeToObject",value:function(t){var e={};return X()(t,(function(t,i){var n=i.match(/^(.+)\.([a-z]+)$/i),r=it(n,3),o=r[1],a=r[2];e[o]||(e[o]={}),e[o][a]=t})),e}},{key:"_makeCssText",value:function(t){var e=this,i=[];return X()(t,(function(t,r){var o,a;n()(o=["backgroundImage"]).call(o,r)>-1&&"none"!==t&&(t="url(".concat(t,")")),i.push(N()(a="".concat(e._toUnderScore(r),": ")).call(a,t))})),i.join(";")}},{key:"_toUnderScore",value:function(t){return t.replace(/([A-Z])/g,(function(t,e){return"-".concat(e.toLowerCase())}))}},{key:"_loadDefaultSvgIcon",value:function(){if(!document.getElementById("tui-image-editor-svg-default-icons")){var t=new DOMParser,e=Ke.replace(/data:image\/svg\+xml;base64,/,""),i=t.parseFromString(atob(e),"text/xml");document.body.appendChild(i.documentElement)}}},{key:"_makeIconClassName",value:function(t,e){var i=e?this.getStyle("submenu.icon"):this.getStyle("menu.icon"),n=i[t],r=n.path,o=n.name;return r&&o?t:"".concat(t," use-default")}},{key:"_makeSvgIconPrefix",value:function(t,e){var i,n=e?this.getStyle("submenu.icon"):this.getStyle("menu.icon"),r=n[t],o=r.path,a=r.name;return o&&a?N()(i="".concat(o,"#")).call(i,a,"-"):"#"}},{key:"_makeSvgItem",value:function(t,e,i){var n=this;return Ve()(t).call(t,(function(t){var r,o,a=n._makeSvgIconPrefix(t,i),s=n._toUnderScore(e),c=n._makeIconClassName(t,i);return N()(r=N()(o='<use xlink:href="'.concat(a,"ic-")).call(o,s,'" class="')).call(r,c,'"/>')})).join("")}},{key:"makeMenSvgIconSet",value:function(t,e){var i,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return N()(i='<svg class="svg_ic-'.concat(n?"submenu":"menu",'">')).call(i,this._makeSvgItem(t,e,n),"</svg>")}}]),t}(),$e=qe,ti=r(9146),ei=r.n(ti),ii=r(6623),ni=r(4230);function ri(t,e){return ri=ni||function(t,e){return t.__proto__=e,t},ri(t,e)}function oi(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=ii(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ri(t,e)}var ai=r(3742);function si(t){return si="function"===typeof b&&"symbol"===typeof ai?function(t){return typeof t}:function(t){return t&&"function"===typeof b&&t.constructor===b&&t!==b.prototype?"symbol":typeof t},si(t)}function ci(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function li(t,e){if(e&&("object"===si(e)||"function"===typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return ci(t)}var ui=r(9856);function hi(t){return hi=ni?ui:function(t){return t.__proto__||ui(t)},hi(t)}var fi=r(6092),di=r.n(fi),gi=r(4858),pi=r.n(gi),vi=["#000000","#2a2a2a","#545454","#7e7e7e","#a8a8a8","#d2d2d2","#ffffff","","#ff4040","#ff6518","#ffbb3b","#03bd9e","#00a9ff","#515ce6","#9e5fff","#ff5583"],mi=function(){function t(e,i){var n=i.defaultColor,r=void 0===n?"#7e7e7e":n,o=i.toggleDirection,a=void 0===o?"up":o,s=i.usageStatistics;D(this,t),this.colorpickerElement=e,this.usageStatistics=s,this._show=!1,this._colorpickerElement=e,this._toggleDirection=a,this._makePickerButtonElement(r),this._makePickerLayerElement(e,e.getAttribute("title")),this._color=r,this.picker=pi().create({container:this.pickerElement,preset:vi,color:r,usageStatistics:this.usageStatistics}),this._addEvent()}return k(t,[{key:"destroy",value:function(){var t=this;this._removeEvent(),this.picker.destroy(),this.colorpickerElement.innerHTML="",X()(this,(function(e,i){t[i]=null}))}},{key:"color",get:function(){return this._color},set:function(t){this._color=t,this._changeColorElement(t)}},{key:"_changeColorElement",value:function(t){t?(this.colorElement.classList.remove("transparent"),this.colorElement.style.backgroundColor=t):(this.colorElement.style.backgroundColor="#fff",this.colorElement.classList.add("transparent"))}},{key:"_makePickerButtonElement",value:function(t){this.colorpickerElement.classList.add("tui-image-editor-button"),this.colorElement=document.createElement("div"),this.colorElement.className="color-picker-value",t?this.colorElement.style.backgroundColor=t:this.colorElement.classList.add("transparent")}},{key:"_makePickerLayerElement",value:function(t,e){var i=document.createElement("label"),n=document.createElement("div");this.pickerControl=document.createElement("div"),this.pickerControl.className="color-picker-control",this.pickerElement=document.createElement("div"),this.pickerElement.className="color-picker",i.innerHTML=e,n.className="triangle",this.pickerControl.appendChild(this.pickerElement),this.pickerControl.appendChild(n),t.appendChild(this.pickerControl),t.appendChild(this.colorElement),t.appendChild(i)}},{key:"_addEvent",value:function(){var t,e=this;this.picker.on("selectColor",(function(t){e._changeColorElement(t.color),e._color=t.color,e.fire("change",t.color)})),this.eventHandler={pickerToggle:j()(t=this._pickerToggleEventHandler).call(t,this),pickerHide:function(){return e.hide()}},this.colorpickerElement.addEventListener("click",this.eventHandler.pickerToggle),document.body.addEventListener("click",this.eventHandler.pickerHide)}},{key:"_removeEvent",value:function(){this.colorpickerElement.removeEventListener("click",this.eventHandler.pickerToggle),document.body.removeEventListener("click",this.eventHandler.pickerHide),this.picker.off()}},{key:"_pickerToggleEventHandler",value:function(t){var e=t.target,i=e&&this._isElementInColorPickerControl(e);(!i||i&&this._isPaletteButton(e))&&(this._show=!this._show,this.pickerControl.style.display=this._show?"block":"none",this._setPickerControlPosition(),this.fire("changeShow",this)),t.stopPropagation()}},{key:"_isPaletteButton",value:function(t){return"tui-colorpicker-palette-button"===t.className}},{key:"_isElementInColorPickerControl",value:function(t){var e=t;while(e!==document.body){if(!e)break;if(e===this.pickerControl)return!0;e=e.parentNode}return!1}},{key:"hide",value:function(){this._show=!1,this.pickerControl.style.display="none"}},{key:"_setPickerControlPosition",value:function(){var t=this.pickerControl.style,e=this._colorpickerElement.clientWidth/2+2,i=this.pickerControl.offsetWidth/2-e,n=-1*(this.pickerControl.offsetHeight+10);"down"===this._toggleDirection&&(n=30),t.top="".concat(n,"px"),t.left="-".concat(i,"px")}}]),t}();V().mixin(mi);var yi=mi,bi=/(-?)([0-9]*)[^0-9]*([0-9]*)/g,_i=function(){function t(e){var i,n,r,o,a,s,c,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};D(this,t),this._value=l.value||0,this.rangeElement=e.slider,this.rangeInputElement=e.input,this._drawRangeElement(),this.rangeWidth=this._getRangeWidth(),this._min=l.min||0,this._max=l.max||100,this._useDecimal=l.useDecimal,this._absMax=-1*this._min+this._max,this.realTimeEvent=l.realTimeEvent||!1,this._userInputTimer=null,this.eventHandler={startChangingSlide:j()(i=this._startChangingSlide).call(i,this),stopChangingSlide:j()(n=this._stopChangingSlide).call(n,this),changeSlide:j()(r=this._changeSlide).call(r,this),changeSlideFinally:j()(o=this._changeSlideFinally).call(o,this),changeInput:j()(a=this._changeInput).call(a,this),changeInputFinally:j()(s=this._changeValueWithInput).call(s,this,!0),changeInputWithArrow:j()(c=this._changeValueWithInputKeyEvent).call(c,this)},this._addClickEvent(),this._addDragEvent(),this._addInputEvent(),this.value=l.value,this.trigger("change")}return k(t,[{key:"destroy",value:function(){var t=this;this._removeClickEvent(),this._removeDragEvent(),this._removeInputEvent(),this.rangeElement.innerHTML="",X()(this,(function(e,i){t[i]=null}))}},{key:"max",get:function(){return this._max},set:function(t){this._max=t,this._absMax=-1*this._min+this._max,this.value=this._value}},{key:"min",get:function(){return this._min},set:function(t){this._min=t,this.max=this._max}},{key:"value",get:function(){return this._value},set:function(t){t=this._useDecimal?t:ie(t);var e=t-this._min,i=e*this.rangeWidth/this._absMax;this.rangeWidth<i&&(i=this.rangeWidth),this.pointer.style.left="".concat(i,"px"),this.subbar.style.right="".concat(this.rangeWidth-i,"px"),this._value=t,this.rangeInputElement&&(this.rangeInputElement.value=t)}},{key:"trigger",value:function(t){this.fire(t,this._value)}},{key:"_getRangeWidth",value:function(){var t=function(t){return ie(window.getComputedStyle(t,null).width)};return t(this.rangeElement)-t(this.pointer)}},{key:"_drawRangeElement",value:function(){this.rangeElement.classList.add("tui-image-editor-range"),this.bar=document.createElement("div"),this.bar.className="tui-image-editor-virtual-range-bar",this.subbar=document.createElement("div"),this.subbar.className="tui-image-editor-virtual-range-subbar",this.pointer=document.createElement("div"),this.pointer.className="tui-image-editor-virtual-range-pointer",this.bar.appendChild(this.subbar),this.bar.appendChild(this.pointer),this.rangeElement.appendChild(this.bar)}},{key:"_addInputEvent",value:function(){this.rangeInputElement&&(this.rangeInputElement.addEventListener("keydown",this.eventHandler.changeInputWithArrow),this.rangeInputElement.addEventListener("keydown",this.eventHandler.changeInput),this.rangeInputElement.addEventListener("blur",this.eventHandler.changeInputFinally))}},{key:"_removeInputEvent",value:function(){this.rangeInputElement&&(this.rangeInputElement.removeEventListener("keydown",this.eventHandler.changeInputWithArrow),this.rangeInputElement.removeEventListener("keydown",this.eventHandler.changeInput),this.rangeInputElement.removeEventListener("blur",this.eventHandler.changeInputFinally))}},{key:"_changeValueWithInputKeyEvent",value:function(t){var e,i=t.keyCode,r=t.target;if(!(n()(e=[Lt.ARROW_UP,Lt.ARROW_DOWN]).call(e,i)<0)){var o=Number(r.value);o=this._valueUpDownForKeyEvent(o,i);var a=o<this._min||o>this._max;if(!a){var s=$t(o,this._min,this.max);this.value=s,this.fire("change",s,!1)}}}},{key:"_valueUpDownForKeyEvent",value:function(t,e){var i=this._useDecimal?.1:1;return e===Lt.ARROW_UP?t+=i:e===Lt.ARROW_DOWN&&(t-=i),t}},{key:"_changeInput",value:function(t){var e=this;clearTimeout(this._userInputTimer);var i=t.keyCode;i<Lt.DIGIT_0||i>Lt.DIGIT_9?t.preventDefault():this._userInputTimer=p()((function(){e._inputSetValue(t.target.value)}),350)}},{key:"_inputSetValue",value:function(t){var e=this._useDecimal?Number(t):ie(t);e=$t(e,this._min,this.max),this.value=e,this.fire("change",e,!0)}},{key:"_changeValueWithInput",value:function(t,e){var i,r=e.keyCode,o=e.target;if(!(n()(i=[Lt.ARROW_UP,Lt.ARROW_DOWN]).call(i,r)>=0)){var a=this._filterForInputText(o.value),s=!a||isNaN(a);o.value=a,s||this._inputSetValue(a)}}},{key:"_addClickEvent",value:function(){this.rangeElement.addEventListener("click",this.eventHandler.changeSlideFinally)}},{key:"_removeClickEvent",value:function(){this.rangeElement.removeEventListener("click",this.eventHandler.changeSlideFinally)}},{key:"_addDragEvent",value:function(){this.pointer.addEventListener("mousedown",this.eventHandler.startChangingSlide)}},{key:"_removeDragEvent",value:function(){this.pointer.removeEventListener("mousedown",this.eventHandler.startChangingSlide)}},{key:"_changeSlide",value:function(t){var e=t.screenX,i=e-this.firstPosition,n=this.firstLeft+i;n=n>this.rangeWidth?this.rangeWidth:n,n=n<0?0:n,this.pointer.style.left="".concat(n,"px"),this.subbar.style.right="".concat(this.rangeWidth-n,"px");var r=n/this.rangeWidth,o=this._absMax*r+this._min,a=this._useDecimal?o:ie(o),s=this.value!==a;s&&(this.value=a,this.realTimeEvent&&this.fire("change",this._value,!1))}},{key:"_changeSlideFinally",value:function(t){if(t.stopPropagation(),"tui-image-editor-range"===t.target.className){var e=t.offsetX,i=e/this.rangeWidth,n=this._absMax*i+this._min;this.pointer.style.left="".concat(i*this.rangeWidth,"px"),this.subbar.style.right="".concat((1-i)*this.rangeWidth,"px"),this.value=n,this.fire("change",n,!0)}}},{key:"_startChangingSlide",value:function(t){this.firstPosition=t.screenX,this.firstLeft=ie(this.pointer.style.left)||0,document.addEventListener("mousemove",this.eventHandler.changeSlide),document.addEventListener("mouseup",this.eventHandler.stopChangingSlide)}},{key:"_stopChangingSlide",value:function(){this.fire("change",this._value,!0),document.removeEventListener("mousemove",this.eventHandler.changeSlide),document.removeEventListener("mouseup",this.eventHandler.stopChangingSlide)}},{key:"_filterForInputText",value:function(t){return t.replace(bi,"$1$2$3")}}]),t}();V().mixin(_i);var xi=_i,Ci=function(){function t(e,i){var n=i.locale,r=i.name,o=i.makeSvgIcon,a=i.menuBarPosition,s=i.templateHtml,c=i.usageStatistics;D(this,t),this.subMenuElement=e,this.menuBarPosition=a,this.toggleDirection="top"===a?"down":"up",this.colorPickerControls=[],this.usageStatistics=c,this.eventHandler={},this._makeSubMenuElement({locale:n,name:r,makeSvgIcon:o,templateHtml:s})}return k(t,[{key:"selector",value:function(t){return this.subMenuElement.querySelector(t)}},{key:"colorPickerChangeShow",value:function(t){var e;st()(e=this.colorPickerControls).call(e,(function(e){t!==e&&e.hide()}))}},{key:"getButtonType",value:function(t,e){return t.className.match(RegExp("(".concat(e.join("|"),")")))[0]}},{key:"changeClass",value:function(t,e,i){t.classList.remove(e),t.classList.add(i)}},{key:"changeStandbyMode",value:function(){}},{key:"changeStartMode",value:function(){}},{key:"_makeSubMenuElement",value:function(t){var e=t.locale,i=t.name,n=t.iconStyle,r=t.makeSvgIcon,o=t.templateHtml,a=document.createElement("div");a.className="tui-image-editor-menu-".concat(i),a.innerHTML=o({locale:e,iconStyle:n,makeSvgIcon:r}),this.subMenuElement.appendChild(a)}},{key:"_onStartEditingInputBox",value:function(){this.fire(At.INPUT_BOX_EDITING_STARTED)}},{key:"_onStopEditingInputBox",value:function(){this.fire(At.INPUT_BOX_EDITING_STOPPED)}}]),t}();V().mixin(Ci);var Ii=Ci,Mi=function(t){var e,i,n,r,o,a,s,c,l=t.locale,u=t.makeSvgIcon;return N()(e=N()(i=N()(n=N()(r=N()(o=N()(a=N()(s=N()(c='\n <ul class="tui-image-editor-submenu-item">\n <li class="tie-shape-button">\n <div class="tui-image-editor-button rect">\n <div>\n '.concat(u(["normal","active"],"shape-rectangle",!0),"\n </div>\n <label> ")).call(c,l.localize("Rectangle"),' </label>\n </div>\n <div class="tui-image-editor-button circle">\n <div>\n ')).call(s,u(["normal","active"],"shape-circle",!0),"\n </div>\n <label> ")).call(a,l.localize("Circle"),' </label>\n </div>\n <div class="tui-image-editor-button triangle">\n <div>\n ')).call(o,u(["normal","active"],"shape-triangle",!0),"\n </div>\n <label> ")).call(r,l.localize("Triangle"),' </label>\n </div>\n </li>\n <li class="tui-image-editor-partition">\n <div></div>\n </li>\n <li class="tie-shape-color-button">\n <div class="tie-color-fill" title="')).call(n,l.localize("Fill"),'"></div>\n <div class="tie-color-stroke" title="')).call(i,l.localize("Stroke"),'"></div>\n </li>\n <li class="tui-image-editor-partition only-left-right">\n <div></div>\n </li>\n <li class="tui-image-editor-newline tui-image-editor-range-wrap">\n <label class="range">')).call(e,l.localize("Stroke"),'</label>\n <div class="tie-stroke-range"></div>\n <input class="tie-stroke-range-value tui-image-editor-range-value" value="0" />\n </li>\n </ul>\n')};function Si(t){var e=wi();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function wi(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var Ti={stroke:"#ffbb3b",fill:"",strokeWidth:3},Ai=function(t){oi(i,t);var e=Si(i);function i(t,n){var r,o=n.locale,a=n.makeSvgIcon,s=n.menuBarPosition,c=n.usageStatistics;return D(this,i),r=e.call(this,t,{locale:o,name:"shape",makeSvgIcon:a,menuBarPosition:s,templateHtml:Mi,usageStatistics:c}),r.type=null,r.options=Ti,r._els={shapeSelectButton:r.selector(".tie-shape-button"),shapeColorButton:r.selector(".tie-shape-color-button"),strokeRange:new xi({slider:r.selector(".tie-stroke-range"),input:r.selector(".tie-stroke-range-value")},Ft),fillColorpicker:new yi(r.selector(".tie-color-fill"),{defaultColor:"",toggleDirection:r.toggleDirection,usageStatistics:r.usageStatistics}),strokeColorpicker:new yi(r.selector(".tie-color-stroke"),{defaultColor:"#ffbb3b",toggleDirection:r.toggleDirection,usageStatistics:r.usageStatistics})},r.colorPickerControls.push(r._els.fillColorpicker),r.colorPickerControls.push(r._els.strokeColorpicker),r.colorPickerInputBoxes=[],r.colorPickerInputBoxes.push(r._els.fillColorpicker.colorpickerElement.querySelector(Dt.COLOR_PICKER_INPUT_BOX)),r.colorPickerInputBoxes.push(r._els.strokeColorpicker.colorpickerElement.querySelector(Dt.COLOR_PICKER_INPUT_BOX)),r}return k(i,[{key:"destroy",value:function(){this._removeEvent(),this._els.strokeRange.destroy(),this._els.fillColorpicker.destroy(),this._els.strokeColorpicker.destroy(),he(this)}},{key:"addEvent",value:function(t){var e,i,n,r,o,a,s=this;this.eventHandler.shapeTypeSelected=j()(e=this._changeShapeHandler).call(e,this),this.actions=t,this._els.shapeSelectButton.addEventListener("click",this.eventHandler.shapeTypeSelected),this._els.strokeRange.on("change",j()(i=this._changeStrokeRangeHandler).call(i,this)),this._els.fillColorpicker.on("change",j()(n=this._changeFillColorHandler).call(n,this)),this._els.strokeColorpicker.on("change",j()(r=this._changeStrokeColorHandler).call(r,this)),this._els.fillColorpicker.on("changeShow",j()(o=this.colorPickerChangeShow).call(o,this)),this._els.strokeColorpicker.on("changeShow",j()(a=this.colorPickerChangeShow).call(a,this)),di()(this.colorPickerInputBoxes,(function(t){var e,i;t.addEventListener(At.FOCUS,j()(e=s._onStartEditingInputBox).call(e,s)),t.addEventListener(At.BLUR,j()(i=s._onStopEditingInputBox).call(i,s))}),this)}},{key:"_removeEvent",value:function(){var t=this;this._els.shapeSelectButton.removeEventListener("click",this.eventHandler.shapeTypeSelected),this._els.strokeRange.off(),this._els.fillColorpicker.off(),this._els.strokeColorpicker.off(),di()(this.colorPickerInputBoxes,(function(e){var i,n;e.removeEventListener(At.FOCUS,j()(i=t._onStartEditingInputBox).call(i,t)),e.removeEventListener(At.BLUR,j()(n=t._onStopEditingInputBox).call(n,t))}),this)}},{key:"setShapeStatus",value:function(t){var e=t.strokeWidth,i=t.strokeColor,n=t.fillColor;this._els.strokeRange.value=e,this._els.strokeColorpicker.color=i,this._els.fillColorpicker.color=n,this.options.stroke=i,this.options.fill=n,this.options.strokeWidth=e,this.actions.setDrawingShape(this.type,{strokeWidth:e})}},{key:"changeStartMode",value:function(){this.actions.stopDrawingMode()}},{key:"changeStandbyMode",value:function(){this.type=null,this.actions.changeSelectableAll(!0),this._els.shapeSelectButton.classList.remove("circle"),this._els.shapeSelectButton.classList.remove("triangle"),this._els.shapeSelectButton.classList.remove("rect")}},{key:"setMaxStrokeValue",value:function(t){var e=t;e<=0&&(e=Ft.max),this._els.strokeRange.max=e}},{key:"setStrokeValue",value:function(t){this._els.strokeRange.value=t,this._els.strokeRange.trigger("change")}},{key:"getStrokeValue",value:function(){return this._els.strokeRange.value}},{key:"_changeShapeHandler",value:function(t){var e=t.target.closest(".tui-image-editor-button");if(e){this.actions.stopDrawingMode(),this.actions.discardSelection();var i=this.getButtonType(e,["circle","triangle","rect"]);if(this.type===i)return void this.changeStandbyMode();this.changeStandbyMode(),this.type=i,t.currentTarget.classList.add(i),this.actions.changeSelectableAll(!1),this.actions.modeChange("shape")}}},{key:"_changeStrokeRangeHandler",value:function(t,e){this.options.strokeWidth=ie(t),this.actions.changeShape({strokeWidth:t},!e),this.actions.setDrawingShape(this.type,this.options)}},{key:"_changeFillColorHandler",value:function(t){t=t||"transparent",this.options.fill=t,this.actions.changeShape({fill:t})}},{key:"_changeStrokeColorHandler",value:function(t){t=t||"transparent",this.options.stroke=t,this.actions.changeShape({stroke:t})}}]),i}(Ii),Di=Ai,Ei=function(t){var e,i,n,r,o,a,s,c,l,u,h,f,d,g,p,v,m,y=t.locale,b=t.makeSvgIcon;return N()(e=N()(i=N()(n=N()(r=N()(o=N()(a=N()(s=N()(c=N()(l=N()(u=N()(h=N()(f=N()(d=N()(g=N()(p=N()(v=N()(m='\n <ul class="tui-image-editor-submenu-item">\n <li class="tie-crop-preset-button">\n <div class="tui-image-editor-button preset preset-none active">\n <div>\n '.concat(b(["normal","active"],"shape-rectangle",!0),"\n </div>\n <label> ")).call(m,y.localize("Custom"),' </label>\n </div>\n <div class="tui-image-editor-button preset preset-square">\n <div>\n ')).call(v,b(["normal","active"],"crop",!0),"\n </div>\n <label> ")).call(p,y.localize("Square"),' </label>\n </div>\n <div class="tui-image-editor-button preset preset-3-2">\n <div>\n ')).call(g,b(["normal","active"],"crop",!0),"\n </div>\n <label> ")).call(d,y.localize("3:2"),' </label>\n </div>\n <div class="tui-image-editor-button preset preset-4-3">\n <div>\n ')).call(f,b(["normal","active"],"crop",!0),"\n </div>\n <label> ")).call(h,y.localize("4:3"),' </label>\n </div>\n <div class="tui-image-editor-button preset preset-5-4">\n <div>\n ')).call(u,b(["normal","active"],"crop",!0),"\n </div>\n <label> ")).call(l,y.localize("5:4"),' </label>\n </div>\n <div class="tui-image-editor-button preset preset-7-5">\n <div>\n ')).call(c,b(["normal","active"],"crop",!0),"\n </div>\n <label> ")).call(s,y.localize("7:5"),' </label>\n </div>\n <div class="tui-image-editor-button preset preset-16-9">\n <div>\n ')).call(a,b(["normal","active"],"crop",!0),"\n </div>\n <label> ")).call(o,y.localize("16:9"),' </label>\n </div>\n </li>\n <li class="tui-image-editor-partition tui-image-editor-newline">\n </li>\n <li class="tui-image-editor-partition only-left-right">\n <div></div>\n </li>\n <li class="tie-crop-button action">\n <div class="tui-image-editor-button apply">\n ')).call(r,b(["normal","active"],"apply"),"\n <label>\n ")).call(n,y.localize("Apply"),'\n </label>\n </div>\n <div class="tui-image-editor-button cancel">\n ')).call(i,b(["normal","active"],"cancel"),"\n <label>\n ")).call(e,y.localize("Cancel"),"\n </label>\n </div>\n </li>\n </ul>\n")};function ki(t){var e=Oi();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function Oi(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var ji=function(t){oi(i,t);var e=ki(i);function i(t,n){var r,o=n.locale,a=n.makeSvgIcon,s=n.menuBarPosition,c=n.usageStatistics;return D(this,i),r=e.call(this,t,{locale:o,name:"crop",makeSvgIcon:a,menuBarPosition:s,templateHtml:Ei,usageStatistics:c}),r.status="active",r._els={apply:r.selector(".tie-crop-button .apply"),cancel:r.selector(".tie-crop-button .cancel"),preset:r.selector(".tie-crop-preset-button")},r.defaultPresetButton=r._els.preset.querySelector(".preset-none"),r}return k(i,[{key:"destroy",value:function(){this._removeEvent(),he(this)}},{key:"addEvent",value:function(t){var e,i,n,r=j()(e=this._applyEventHandler).call(e,this),o=j()(i=this._cancelEventHandler).call(i,this),a=j()(n=this._cropzonePresetEventHandler).call(n,this);this.eventHandler={apply:r,cancel:o,cropzonePreset:a},this.actions=t,this._els.apply.addEventListener("click",r),this._els.cancel.addEventListener("click",o),this._els.preset.addEventListener("click",a)}},{key:"_removeEvent",value:function(){this._els.apply.removeEventListener("click",this.eventHandler.apply),this._els.cancel.removeEventListener("click",this.eventHandler.cancel),this._els.preset.removeEventListener("click",this.eventHandler.cropzonePreset)}},{key:"_applyEventHandler",value:function(){this.actions.crop(),this._els.apply.classList.remove("active")}},{key:"_cancelEventHandler",value:function(){this.actions.cancel(),this._els.apply.classList.remove("active")}},{key:"_cropzonePresetEventHandler",value:function(t){var e=t.target.closest(".tui-image-editor-button.preset");if(e){var i=e.className.match(/preset-[^\s]+/),n=it(i,1),r=n[0];this._setPresetButtonActive(e),this.actions.preset(r)}}},{key:"changeStartMode",value:function(){this.actions.modeChange("crop")}},{key:"changeStandbyMode",value:function(){this.actions.stopDrawingMode(),this._setPresetButtonActive()}},{key:"changeApplyButtonStatus",value:function(t){t?this._els.apply.classList.add("active"):this._els.apply.classList.remove("active")}},{key:"_setPresetButtonActive",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.defaultPresetButton;X()(this._els.preset.querySelectorAll(".preset"),(function(t){t.classList.remove("active")})),t&&t.classList.add("active")}}]),i}(Ii),Li=ji,Ni=function(t){var e,i,n,r,o,a,s=t.locale,c=t.makeSvgIcon;return N()(e=N()(i=N()(n=N()(r=N()(o=N()(a='\n <ul class="tui-image-editor-submenu-item">\n <li class="tui-image-editor-submenu-align">\n <div class="tui-image-editor-range-wrap tui-image-editor-newline">\n <label class="range">'.concat(s.localize("Width"),'&nbsp;</label>\n <div class="tie-width-range"></div>\n <input class="tie-width-range-value tui-image-editor-range-value" value="0" /> <label>px</label>\n <div class="tui-image-editor-partition tui-image-editor-newline"></div>\n <label class="range">')).call(a,s.localize("Height"),'</label>\n <div class="tie-height-range"></div>\n <input class="tie-height-range-value tui-image-editor-range-value" value="0" /> <label>px</label>\n </div>\n </li>\n <li class="tui-image-editor-partition tui-image-editor-newline"></li>\n <li class="tui-image-editor-partition only-left-right">\n <div></div>\n </li>\n <li class="tui-image-editor-submenu-align">\n <div class="tui-image-editor-checkbox-wrap">\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-lock-aspect-ratio">\n <span>')).call(o,s.localize("Lock Aspect Ratio"),'</span>\n </label>\n </div>\n </div>\n </li>\n <li class="tui-image-editor-partition tui-image-editor-newline"></li>\n <li class="tui-image-editor-partition only-left-right">\n <div></div>\n </li>\n <li class="tui-image-editor-partition tui-image-editor-newline"></li>\n <li class="tie-resize-button action">\n <div class="tui-image-editor-button apply">\n ')).call(r,c(["normal","active"],"apply"),"\n <label>\n ")).call(n,s.localize("Apply"),'\n </label>\n </div>\n <div class="tui-image-editor-button cancel">\n ')).call(i,c(["normal","active"],"cancel"),"\n <label>\n ")).call(e,s.localize("Cancel"),"\n </label>\n </div>\n </li>\n </ul>\n")};function Pi(t){var e=zi();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function zi(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var Ri=function(t){oi(i,t);var e=Pi(i);function i(t,n){var r,o=n.locale,a=n.makeSvgIcon,s=n.menuBarPosition,c=n.usageStatistics;return D(this,i),r=e.call(this,t,{locale:o,name:"resize",makeSvgIcon:a,menuBarPosition:s,templateHtml:Ni,usageStatistics:c}),r.status="active",r._lockState=!1,r._originalDimensions=null,r._els={widthRange:new xi({slider:r.selector(".tie-width-range"),input:r.selector(".tie-width-range-value")},Wt),heightRange:new xi({slider:r.selector(".tie-height-range"),input:r.selector(".tie-height-range-value")},Wt),lockAspectRatio:r.selector(".tie-lock-aspect-ratio"),apply:r.selector(".tie-resize-button .apply"),cancel:r.selector(".tie-resize-button .cancel")},r}return k(i,[{key:"changeStartMode",value:function(){this.actions.modeChange("resize");var t=this.actions.getCurrentDimensions();this._originalDimensions=t,this.setWidthValue(t.width),this.setHeightValue(t.height)}},{key:"changeStandbyMode",value:function(){this.actions.stopDrawingMode(),this.actions.reset(!0)}},{key:"setLimit",value:function(t){this._els.widthRange.min=this.calcMinValue(t.minWidth),this._els.heightRange.min=this.calcMinValue(t.minHeight),this._els.widthRange.max=this.calcMaxValue(t.maxWidth),this._els.heightRange.max=this.calcMaxValue(t.maxHeight)}},{key:"calcMaxValue",value:function(t){return t<=0&&(t=Wt.max),t}},{key:"calcMinValue",value:function(t){return t<=0&&(t=Wt.min),t}},{key:"setWidthValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._els.widthRange.value=t,e&&this._els.widthRange.trigger("change")}},{key:"setHeightValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._els.heightRange.value=t,e&&this._els.heightRange.trigger("change")}},{key:"destroy",value:function(){this._removeEvent(),he(this)}},{key:"addEvent",value:function(t){var e,i,n,r,o;this._els.widthRange.on("change",j()(e=this._changeWidthRangeHandler).call(e,this)),this._els.heightRange.on("change",j()(i=this._changeHeightRangeHandler).call(i,this)),this._els.lockAspectRatio.addEventListener("change",j()(n=this._changeLockAspectRatio).call(n,this));var a=j()(r=this._applyEventHandler).call(r,this),s=j()(o=this._cancelEventHandler).call(o,this);this.eventHandler={apply:a,cancel:s},this.actions=t,this._els.apply.addEventListener("click",a),this._els.cancel.addEventListener("click",s)}},{key:"_changeWidthRangeHandler",value:function(t){this.actions.preview("width",ie(t),this._lockState)}},{key:"_changeHeightRangeHandler",value:function(t){this.actions.preview("height",ie(t),this._lockState)}},{key:"_changeLockAspectRatio",value:function(t){this._lockState=t.target.checked,this.actions.lockAspectRatio(this._lockState,Wt.min,Wt.max)}},{key:"_removeEvent",value:function(){this._els.apply.removeEventListener("click",this.eventHandler.apply),this._els.cancel.removeEventListener("click",this.eventHandler.cancel)}},{key:"_applyEventHandler",value:function(){this.actions.resize(),this._els.apply.classList.remove("active")}},{key:"_cancelEventHandler",value:function(){this.actions.reset(),this._els.cancel.classList.remove("active")}},{key:"changeApplyButtonStatus",value:function(t){t?this._els.apply.classList.add("active"):this._els.apply.classList.remove("active")}}]),i}(Ii),Bi=Ri,Fi=function(t){var e,i,n,r,o,a=t.locale,s=t.makeSvgIcon;return N()(e=N()(i=N()(n=N()(r=N()(o='\n <ul class="tie-flip-button tui-image-editor-submenu-item">\n <li>\n <div class="tui-image-editor-button flipX">\n <div>\n '.concat(s(["normal","active"],"flip-x",!0),"\n </div>\n <label>\n ")).call(o,a.localize("Flip X"),'\n </label>\n </div>\n <div class="tui-image-editor-button flipY">\n <div>\n ')).call(r,s(["normal","active"],"flip-y",!0),"\n </div>\n <label>\n ")).call(n,a.localize("Flip Y"),'\n </label>\n </div>\n </li>\n <li class="tui-image-editor-partition">\n <div></div>\n </li>\n <li>\n <div class="tui-image-editor-button resetFlip">\n <div>\n ')).call(i,s(["normal","active"],"flip-reset",!0),"\n </div>\n <label>\n ")).call(e,a.localize("Reset"),"\n </label>\n </div>\n </li>\n </ul>\n")};function Yi(t){var e=Hi();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function Hi(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var Ui=function(t){oi(i,t);var e=Yi(i);function i(t,n){var r,o=n.locale,a=n.makeSvgIcon,s=n.menuBarPosition,c=n.usageStatistics;return D(this,i),r=e.call(this,t,{locale:o,name:"flip",makeSvgIcon:a,menuBarPosition:s,templateHtml:Fi,usageStatistics:c}),r.flipStatus=!1,r._els={flipButton:r.selector(".tie-flip-button")},r}return k(i,[{key:"destroy",value:function(){this._removeEvent(),he(this)}},{key:"addEvent",value:function(t){var e;this.eventHandler.changeFlip=j()(e=this._changeFlip).call(e,this),this._actions=t,this._els.flipButton.addEventListener("click",this.eventHandler.changeFlip)}},{key:"_removeEvent",value:function(){this._els.flipButton.removeEventListener("click",this.eventHandler.changeFlip)}},{key:"_changeFlip",value:function(t){var e=this,i=t.target.closest(".tui-image-editor-button");if(i){var n=this.getButtonType(i,["flipX","flipY","resetFlip"]);if(!this.flipStatus&&"resetFlip"===n)return;this._actions.flip(n).then((function(t){var i=e._els.flipButton.classList;e.flipStatus=!1,i.remove("resetFlip"),X()(["flipX","flipY"],(function(n){i.remove(n),t[n]&&(i.add(n),i.add("resetFlip"),e.flipStatus=!0)}))}))}}}]),i}(Ii),Wi=Ui,Gi=function(t){var e,i,n=t.locale,r=t.makeSvgIcon;return N()(e=N()(i='\n <ul class="tui-image-editor-submenu-item">\n <li class="tie-rotate-button">\n <div class="tui-image-editor-button clockwise">\n <div>\n '.concat(r(["normal","active"],"rotate-clockwise",!0),'\n </div>\n <label> 30 </label>\n </div>\n <div class="tui-image-editor-button counterclockwise">\n <div>\n ')).call(i,r(["normal","active"],"rotate-counterclockwise",!0),'\n </div>\n <label> -30 </label>\n </div>\n </li>\n <li class="tui-image-editor-partition only-left-right">\n <div></div>\n </li>\n <li class="tui-image-editor-newline tui-image-editor-range-wrap">\n <label class="range">')).call(e,n.localize("Range"),'</label>\n <div class="tie-rotate-range"></div>\n <input class="tie-rotate-range-value tui-image-editor-range-value" value="0" />\n </li>\n </ul>\n')};function Xi(t){var e=Zi();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function Zi(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var Vi=30,Ji=-30,Qi=function(t){oi(i,t);var e=Xi(i);function i(t,n){var r,o=n.locale,a=n.makeSvgIcon,s=n.menuBarPosition,c=n.usageStatistics;return D(this,i),r=e.call(this,t,{locale:o,name:"rotate",makeSvgIcon:a,menuBarPosition:s,templateHtml:Gi,usageStatistics:c}),r._value=0,r._els={rotateButton:r.selector(".tie-rotate-button"),rotateRange:new xi({slider:r.selector(".tie-rotate-range"),input:r.selector(".tie-rotate-range-value")},Rt)},r}return k(i,[{key:"destroy",value:function(){this._removeEvent(),this._els.rotateRange.destroy(),he(this)}},{key:"setRangeBarAngle",value:function(t,e){var i=e;"rotate"===t&&(i=ot()(this._els.rotateRange.value,10)+e),this._setRangeBarRatio(i)}},{key:"_setRangeBarRatio",value:function(t){this._els.rotateRange.value=t}},{key:"addEvent",value:function(t){var e,i;this.eventHandler.rotationAngleChanged=j()(e=this._changeRotateForButton).call(e,this),this.actions=t,this._els.rotateButton.addEventListener("click",this.eventHandler.rotationAngleChanged),this._els.rotateRange.on("change",j()(i=this._changeRotateForRange).call(i,this))}},{key:"_removeEvent",value:function(){this._els.rotateButton.removeEventListener("click",this.eventHandler.rotationAngleChanged),this._els.rotateRange.off()}},{key:"_changeRotateForRange",value:function(t,e){var i=ie(t);this.actions.setAngle(i,!e),this._value=i}},{key:"_changeRotateForButton",value:function(t){var e=t.target.closest(".tui-image-editor-button"),i=this._els.rotateRange.value;if(e){var n=this.getButtonType(e,["counterclockwise","clockwise"]),r={clockwise:Vi,counterclockwise:Ji}[n],o=ot()(i,10)+r,a=o>=-360&&o<=360;a&&this.actions.rotate(r)}}}]),i}(Ii),Ki=Qi,qi=function(t){var e,i,n,r,o,a,s,c,l,u,h,f,d,g=t.locale,p=t.makeSvgIcon;return N()(e=N()(i=N()(n=N()(r=N()(o=N()(a=N()(s=N()(c=N()(l=N()(u=N()(h=N()(f=N()(d='\n <ul class="tui-image-editor-submenu-item">\n <li class="tie-text-effect-button">\n <div class="tui-image-editor-button bold">\n <div>\n '.concat(p(["normal","active"],"text-bold",!0),"\n </div>\n <label> ")).call(d,g.localize("Bold"),' </label>\n </div>\n <div class="tui-image-editor-button italic">\n <div>\n ')).call(f,p(["normal","active"],"text-italic",!0),"\n </div>\n <label> ")).call(h,g.localize("Italic"),' </label>\n </div>\n <div class="tui-image-editor-button underline">\n <div>\n ')).call(u,p(["normal","active"],"text-underline",!0),"\n </div>\n <label> ")).call(l,g.localize("Underline"),' </label>\n </div>\n </li>\n <li class="tui-image-editor-partition">\n <div></div>\n </li>\n <li class="tie-text-align-button">\n <div class="tui-image-editor-button left">\n <div>\n ')).call(c,p(["normal","active"],"text-align-left",!0),"\n </div>\n <label> ")).call(s,g.localize("Left"),' </label>\n </div>\n <div class="tui-image-editor-button center">\n <div>\n ')).call(a,p(["normal","active"],"text-align-center",!0),"\n </div>\n <label> ")).call(o,g.localize("Center"),' </label>\n </div>\n <div class="tui-image-editor-button right">\n <div>\n ')).call(r,p(["normal","active"],"text-align-right",!0),"\n </div>\n <label> ")).call(n,g.localize("Right"),' </label>\n </div>\n </li>\n <li class="tui-image-editor-partition">\n <div></div>\n </li>\n <li>\n <div class="tie-text-color" title="')).call(i,g.localize("Color"),'"></div>\n </li>\n <li class="tui-image-editor-partition only-left-right">\n <div></div>\n </li>\n <li class="tui-image-editor-newline tui-image-editor-range-wrap">\n <label class="range">')).call(e,g.localize("Text size"),'</label>\n <div class="tie-text-range"></div>\n <input class="tie-text-range-value tui-image-editor-range-value" value="0" />\n </li>\n </ul>\n')};function $i(t){var e=tn();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function tn(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var en=function(t){oi(i,t);var e=$i(i);function i(t,n){var r,o=n.locale,a=n.makeSvgIcon,s=n.menuBarPosition,c=n.usageStatistics;return D(this,i),r=e.call(this,t,{locale:o,name:"text",makeSvgIcon:a,menuBarPosition:s,templateHtml:qi,usageStatistics:c}),r.effect={bold:!1,italic:!1,underline:!1},r.align="tie-text-align-left",r._els={textEffectButton:r.selector(".tie-text-effect-button"),textAlignButton:r.selector(".tie-text-align-button"),textColorpicker:new yi(r.selector(".tie-text-color"),{defaultColor:"#ffbb3b",toggleDirection:r.toggleDirection,usageStatistics:r.usageStatistics}),textRange:new xi({slider:r.selector(".tie-text-range"),input:r.selector(".tie-text-range-value")},Yt)},r.colorPickerInputBox=r._els.textColorpicker.colorpickerElement.querySelector(Dt.COLOR_PICKER_INPUT_BOX),r}return k(i,[{key:"destroy",value:function(){this._removeEvent(),this._els.textColorpicker.destroy(),this._els.textRange.destroy(),he(this)}},{key:"addEvent",value:function(t){var e,i,n,r,o,a,s=j()(e=this._setTextEffectHandler).call(e,this),c=j()(i=this._setTextAlignHandler).call(i,this);this.eventHandler={setTextEffect:s,setTextAlign:c},this.actions=t,this._els.textEffectButton.addEventListener("click",s),this._els.textAlignButton.addEventListener("click",c),this._els.textRange.on("change",j()(n=this._changeTextRnageHandler).call(n,this)),this._els.textColorpicker.on("change",j()(r=this._changeColorHandler).call(r,this)),this.colorPickerInputBox.addEventListener(At.FOCUS,j()(o=this._onStartEditingInputBox).call(o,this)),this.colorPickerInputBox.addEventListener(At.BLUR,j()(a=this._onStopEditingInputBox).call(a,this))}},{key:"_removeEvent",value:function(){var t,e,i=this.eventHandler,n=i.setTextEffect,r=i.setTextAlign;this._els.textEffectButton.removeEventListener("click",n),this._els.textAlignButton.removeEventListener("click",r),this._els.textRange.off(),this._els.textColorpicker.off(),this.colorPickerInputBox.removeEventListener(At.FOCUS,j()(t=this._onStartEditingInputBox).call(t,this)),this.colorPickerInputBox.removeEventListener(At.BLUR,j()(e=this._onStopEditingInputBox).call(e,this))}},{key:"changeStandbyMode",value:function(){this.actions.stopDrawingMode()}},{key:"changeStartMode",value:function(){this.actions.modeChange("text")}},{key:"textColor",get:function(){return this._els.textColorpicker.color},set:function(t){this._els.textColorpicker.color=t}},{key:"fontSize",get:function(){return this._els.textRange.value},set:function(t){this._els.textRange.value=t}},{key:"fontStyle",get:function(){return this.effect.italic?"italic":"normal"}},{key:"fontWeight",get:function(){return this.effect.bold?"bold":"normal"}},{key:"underline",get:function(){return this.effect.underline}},{key:"setTextStyleStateOnAction",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=lt()(t),i=t.fontSize,n=t.fontStyle,r=t.fontWeight,o=t.textDecoration,a=t.textAlign;this.textColor=e,this.fontSize=i,this.setEffectState("italic",n),this.setEffectState("bold",r),this.setEffectState("underline",o),this.setAlignState("tie-text-align-".concat(a))}},{key:"setEffectState",value:function(t,e){var i="italic"===e||"bold"===e||"underline"===e,n=this._els.textEffectButton.querySelector(".tui-image-editor-button.".concat(t));this.effect[t]=i,n.classList[i?"add":"remove"]("active")}},{key:"setAlignState",value:function(t){var e=this._els.textAlignButton;e.classList.remove(this.align),e.classList.add(t),this.align=t}},{key:"_setTextEffectHandler",value:function(t){var e=t.target.closest(".tui-image-editor-button");if(e){var i=e.className.match(/(bold|italic|underline)/),n=it(i,1),r=n[0],o={bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},underline:{textDecoration:"underline"}}[r];this.effect[r]=!this.effect[r],e.classList.toggle("active"),this.actions.changeTextStyle(o)}}},{key:"_setTextAlignHandler",value:function(t){var e=t.target.closest(".tui-image-editor-button");if(e){var i=this.getButtonType(e,["left","center","right"]),n="tie-text-align-".concat(i);t.currentTarget.classList.remove(this.align),this.align!==n&&t.currentTarget.classList.add(n),this.actions.changeTextStyle({textAlign:i}),this.align=n}}},{key:"_changeTextRnageHandler",value:function(t,e){this.actions.changeTextStyle({fontSize:t},!e)}},{key:"_changeColorHandler",value:function(t){t=t||"transparent",this.actions.changeTextStyle({fill:t})}}]),i}(Ii),nn=en,rn=function(t){var e,i,n,r=t.locale,o=t.makeSvgIcon;return N()(e=N()(i=N()(n='\n <ul class="tui-image-editor-submenu-item">\n <li>\n <div class="tui-image-editor-button">\n <div>\n <input type="file" accept="image/*" class="tie-mask-image-file">\n '.concat(o(["normal","active"],"mask-load",!0),"\n </div>\n <label> ")).call(n,r.localize("Load Mask Image"),' </label>\n </div>\n </li>\n <li class="tui-image-editor-partition only-left-right">\n <div></div>\n </li>\n <li class="tie-mask-apply tui-image-editor-newline apply" style="margin-top: 22px;margin-bottom: 5px">\n <div class="tui-image-editor-button apply">\n ')).call(i,o(["normal","active"],"apply"),"\n <label>\n ")).call(e,r.localize("Apply"),"\n </label>\n </div>\n </li>\n </ul>\n")};function on(t){var e=an();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function an(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var sn=function(t){oi(i,t);var e=on(i);function i(t,n){var r,o=n.locale,a=n.makeSvgIcon,s=n.menuBarPosition,c=n.usageStatistics;return D(this,i),r=e.call(this,t,{locale:o,name:"mask",makeSvgIcon:a,menuBarPosition:s,templateHtml:rn,usageStatistics:c}),r._els={applyButton:r.selector(".tie-mask-apply"),maskImageButton:r.selector(".tie-mask-image-file")},r}return k(i,[{key:"destroy",value:function(){this._removeEvent(),he(this)}},{key:"addEvent",value:function(t){var e,i,n=j()(e=this._loadMaskFile).call(e,this),r=j()(i=this._applyMask).call(i,this);this.eventHandler={loadMaskFile:n,applyMask:r},this.actions=t,this._els.maskImageButton.addEventListener("change",n),this._els.applyButton.addEventListener("click",r)}},{key:"_removeEvent",value:function(){this._els.maskImageButton.removeEventListener("change",this.eventHandler.loadMaskFile),this._els.applyButton.removeEventListener("click",this.eventHandler.applyMask)}},{key:"_applyMask",value:function(){this.actions.applyFilter(),this._els.applyButton.classList.remove("active")}},{key:"_loadMaskFile",value:function(t){var e;re()||alert("This browser does not support file-api");var i=it(t.target.files,1),n=i[0];n&&(e=B().createObjectURL(n),this.actions.loadImageFromURL(e,n),this._els.applyButton.classList.add("active"))}}]),i}(Ii),cn=sn,ln=function(t){var e,i,n,r,o,a,s,c,l,u,h,f,d,g,p,v,m,y,b,_,x=t.locale,C=t.makeSvgIcon;return N()(e=N()(i=N()(n=N()(r=N()(o=N()(a=N()(s=N()(c=N()(l=N()(u=N()(h=N()(f=N()(d=N()(g=N()(p=N()(v=N()(m=N()(y=N()(b=N()(_='\n <ul class="tui-image-editor-submenu-item">\n <li class="tie-icon-add-button">\n <div class="tui-image-editor-button" data-icontype="icon-arrow">\n <div>\n '.concat(C(["normal","active"],"icon-arrow",!0),"\n </div>\n <label>\n ")).call(_,x.localize("Arrow"),'\n </label>\n </div>\n <div class="tui-image-editor-button" data-icontype="icon-arrow-2">\n <div>\n ')).call(b,C(["normal","active"],"icon-arrow-2",!0),"\n </div>\n <label>\n ")).call(y,x.localize("Arrow-2"),'\n </label>\n </div>\n <div class="tui-image-editor-button" data-icontype="icon-arrow-3">\n <div>\n ')).call(m,C(["normal","active"],"icon-arrow-3",!0),"\n </div>\n <label>\n ")).call(v,x.localize("Arrow-3"),'\n </label>\n </div>\n <div class="tui-image-editor-button" data-icontype="icon-star">\n <div>\n ')).call(p,C(["normal","active"],"icon-star",!0),"\n </div>\n <label>\n ")).call(g,x.localize("Star-1"),'\n </label>\n </div>\n <div class="tui-image-editor-button" data-icontype="icon-star-2">\n <div>\n ')).call(d,C(["normal","active"],"icon-star-2",!0),"\n </div>\n <label>\n ")).call(f,x.localize("Star-2"),'\n </label>\n </div>\n\n <div class="tui-image-editor-button" data-icontype="icon-polygon">\n <div>\n ')).call(h,C(["normal","active"],"icon-polygon",!0),"\n </div>\n <label>\n ")).call(u,x.localize("Polygon"),'\n </label>\n </div>\n\n <div class="tui-image-editor-button" data-icontype="icon-location">\n <div>\n ')).call(l,C(["normal","active"],"icon-location",!0),"\n </div>\n <label>\n ")).call(c,x.localize("Location"),'\n </label>\n </div>\n\n <div class="tui-image-editor-button" data-icontype="icon-heart">\n <div>\n ')).call(s,C(["normal","active"],"icon-heart",!0),"\n </div>\n <label>\n ")).call(a,x.localize("Heart"),'\n </label>\n </div>\n\n <div class="tui-image-editor-button" data-icontype="icon-bubble">\n <div>\n ')).call(o,C(["normal","active"],"icon-bubble",!0),"\n </div>\n <label>\n ")).call(r,x.localize("Bubble"),'\n </label>\n </div>\n </li>\n <li class="tui-image-editor-partition">\n <div></div>\n </li>\n <li class="tie-icon-add-button">\n <div class="tui-image-editor-button" style="margin:0">\n <div>\n <input type="file" accept="image/*" class="tie-icon-image-file">\n ')).call(n,C(["normal","active"],"icon-load",!0),"\n </div>\n <label>\n ")).call(i,x.localize("Custom icon"),'\n </label>\n </div>\n </li>\n <li class="tui-image-editor-partition">\n <div></div>\n </li>\n <li>\n <div class="tie-icon-color" title="')).call(e,x.localize("Color"),'"></div>\n </li>\n </ul>\n')};function un(t){var e=hn();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function hn(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var fn=function(t){oi(i,t);var e=un(i);function i(t,n){var r,o=n.locale,a=n.makeSvgIcon,s=n.menuBarPosition,c=n.usageStatistics;return D(this,i),r=e.call(this,t,{locale:o,name:"icon",makeSvgIcon:a,menuBarPosition:s,templateHtml:ln,usageStatistics:c}),r.iconType=null,r._iconMap={},r._els={registerIconButton:r.selector(".tie-icon-image-file"),addIconButton:r.selector(".tie-icon-add-button"),iconColorpicker:new yi(r.selector(".tie-icon-color"),{defaultColor:"#ffbb3b",toggleDirection:r.toggleDirection,usageStatistics:r.usageStatistics})},r.colorPickerInputBox=r._els.iconColorpicker.colorpickerElement.querySelector(Dt.COLOR_PICKER_INPUT_BOX),r}return k(i,[{key:"destroy",value:function(){this._removeEvent(),this._els.iconColorpicker.destroy(),he(this)}},{key:"addEvent",value:function(t){var e,i,n,r,o,a=j()(e=this._registerIconHandler).call(e,this),s=j()(i=this._addIconHandler).call(i,this);this.eventHandler={registerIcon:a,addIcon:s},this.actions=t,this._els.iconColorpicker.on("change",j()(n=this._changeColorHandler).call(n,this)),this._els.registerIconButton.addEventListener("change",a),this._els.addIconButton.addEventListener("click",s),this.colorPickerInputBox.addEventListener(At.FOCUS,j()(r=this._onStartEditingInputBox).call(r,this)),this.colorPickerInputBox.addEventListener(At.BLUR,j()(o=this._onStopEditingInputBox).call(o,this))}},{key:"_removeEvent",value:function(){var t,e;this._els.iconColorpicker.off(),this._els.registerIconButton.removeEventListener("change",this.eventHandler.registerIcon),this._els.addIconButton.removeEventListener("click",this.eventHandler.addIcon),this.colorPickerInputBox.removeEventListener(At.FOCUS,j()(t=this._onStartEditingInputBox).call(t,this)),this.colorPickerInputBox.removeEventListener(At.BLUR,j()(e=this._onStopEditingInputBox).call(e,this))}},{key:"clearIconType",value:function(){this._els.addIconButton.classList.remove(this.iconType),this.iconType=null}},{key:"registerDefaultIcon",value:function(){var t=this;X()(zt,(function(e,i){t.actions.registerDefaultIcons(i,e)}))}},{key:"setIconPickerColor",value:function(t){this._els.iconColorpicker.color=t}},{key:"changeStandbyMode",value:function(){this.clearIconType(),this.actions.cancelAddIcon()}},{key:"_changeColorHandler",value:function(t){t=t||"transparent",this.actions.changeColor(t)}},{key:"_addIconHandler",value:function(t){var e=t.target.closest(".tui-image-editor-button");if(e){var i=e.getAttribute("data-icontype"),n=this._els.iconColorpicker.color;this.actions.discardSelection(),this.actions.changeSelectableAll(!1),this._els.addIconButton.classList.remove(this.iconType),this._els.addIconButton.classList.add(i),this.iconType===i?this.changeStandbyMode():(this.actions.addIcon(i,n),this.iconType=i)}}},{key:"_registerIconHandler",value:function(t){var e;re||alert("This browser does not support file-api");var i=it(t.target.files,1),n=i[0];n&&(e=B().createObjectURL(n),this.actions.registerCustomIcon(e,n))}}]),i}(Ii),dn=fn,gn=function(t){var e,i,n,r,o,a=t.locale,s=t.makeSvgIcon;return N()(e=N()(i=N()(n=N()(r=N()(o='\n <ul class="tui-image-editor-submenu-item">\n <li class="tie-draw-line-select-button">\n <div class="tui-image-editor-button free">\n <div>\n '.concat(s(["normal","active"],"draw-free",!0),"\n </div>\n <label>\n ")).call(o,a.localize("Free"),'\n </label>\n </div>\n <div class="tui-image-editor-button line">\n <div>\n ')).call(r,s(["normal","active"],"draw-line",!0),"\n </div>\n <label>\n ")).call(n,a.localize("Straight"),'\n </label>\n </div>\n </li>\n <li class="tui-image-editor-partition">\n <div></div>\n </li>\n <li>\n <div class="tie-draw-color" title="')).call(i,a.localize("Color"),'"></div>\n </li>\n <li class="tui-image-editor-partition only-left-right">\n <div></div>\n </li>\n <li class="tui-image-editor-newline tui-image-editor-range-wrap">\n <label class="range">')).call(e,a.localize("Range"),'</label>\n <div class="tie-draw-range"></div>\n <input class="tie-draw-range-value tui-image-editor-range-value" value="0" />\n </li>\n </ul>\n')};function pn(t){var e=vn();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function vn(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var mn=.7,yn=function(t){oi(i,t);var e=pn(i);function i(t,n){var r,o=n.locale,a=n.makeSvgIcon,s=n.menuBarPosition,c=n.usageStatistics;return D(this,i),r=e.call(this,t,{locale:o,name:"draw",makeSvgIcon:a,menuBarPosition:s,templateHtml:gn,usageStatistics:c}),r._els={lineSelectButton:r.selector(".tie-draw-line-select-button"),drawColorPicker:new yi(r.selector(".tie-draw-color"),{defaultColor:"#00a9ff",toggleDirection:r.toggleDirection,usageStatistics:r.usageStatistics}),drawRange:new xi({slider:r.selector(".tie-draw-range"),input:r.selector(".tie-draw-range-value")},Bt)},r.type=null,r.color=r._els.drawColorPicker.color,r.width=r._els.drawRange.value,r.colorPickerInputBox=r._els.drawColorPicker.colorpickerElement.querySelector(Dt.COLOR_PICKER_INPUT_BOX),r}return k(i,[{key:"destroy",value:function(){this._removeEvent(),this._els.drawColorPicker.destroy(),this._els.drawRange.destroy(),he(this)}},{key:"addEvent",value:function(t){var e,i,n,r,o;this.eventHandler.changeDrawType=j()(e=this._changeDrawType).call(e,this),this.actions=t,this._els.lineSelectButton.addEventListener("click",this.eventHandler.changeDrawType),this._els.drawColorPicker.on("change",j()(i=this._changeDrawColor).call(i,this)),this._els.drawRange.on("change",j()(n=this._changeDrawRange).call(n,this)),this.colorPickerInputBox.addEventListener(At.FOCUS,j()(r=this._onStartEditingInputBox).call(r,this)),this.colorPickerInputBox.addEventListener(At.BLUR,j()(o=this._onStopEditingInputBox).call(o,this))}},{key:"_removeEvent",value:function(){var t,e;this._els.lineSelectButton.removeEventListener("click",this.eventHandler.changeDrawType),this._els.drawColorPicker.off(),this._els.drawRange.off(),this.colorPickerInputBox.removeEventListener(At.FOCUS,j()(t=this._onStartEditingInputBox).call(t,this)),this.colorPickerInputBox.removeEventListener(At.BLUR,j()(e=this._onStopEditingInputBox).call(e,this))}},{key:"setDrawMode",value:function(){this.actions.setDrawMode(this.type,{width:this.width,color:oe(this.color,mn)})}},{key:"changeStandbyMode",value:function(){this.type=null,this.actions.stopDrawingMode(),this.actions.changeSelectableAll(!0),this._els.lineSelectButton.classList.remove("free"),this._els.lineSelectButton.classList.remove("line")}},{key:"changeStartMode",value:function(){this.type="free",this._els.lineSelectButton.classList.add("free"),this.setDrawMode()}},{key:"_changeDrawType",value:function(t){var e=t.target.closest(".tui-image-editor-button");if(e){var i=this.getButtonType(e,["free","line"]);if(this.actions.discardSelection(),this.type===i)return void this.changeStandbyMode();this.changeStandbyMode(),this.type=i,this._els.lineSelectButton.classList.add(i),this.setDrawMode()}}},{key:"_changeDrawColor",value:function(t){this.color=t||"transparent",this.type?this.setDrawMode():this.changeStartMode()}},{key:"_changeDrawRange",value:function(t){this.width=t,this.type?this.setDrawMode():this.changeStartMode()}}]),i}(Ii),bn=yn,_n=r(9886),xn=r.n(_n),Cn=function(t){var e,i,n,r,o,a,s,c,l,u,h,f,d,g,p,v,m=t.locale;return N()(e=N()(i=N()(n=N()(r=N()(o=N()(a=N()(s=N()(c=N()(l=N()(u=N()(h=N()(f=N()(d=N()(g=N()(p=N()(v='\n <ul class="tui-image-editor-submenu-item">\n <li class="tui-image-editor-submenu-align">\n <div class="tui-image-editor-checkbox-wrap fixed-width">\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-grayscale">\n <span>'.concat(m.localize("Grayscale"),'</span>\n </label>\n </div>\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-invert">\n <span>')).call(v,m.localize("Invert"),'</span>\n </label>\n </div>\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-sepia">\n <span>')).call(p,m.localize("Sepia"),'</span>\n </label>\n </div>\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-vintage">\n <span>')).call(g,m.localize("Sepia2"),'</span>\n </label>\n </div>\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-blur">\n <span>')).call(d,m.localize("Blur"),'</span>\n </label>\n </div>\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-sharpen">\n <span>')).call(f,m.localize("Sharpen"),'</span>\n </label>\n </div>\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-emboss">\n <span>')).call(h,m.localize("Emboss"),'</span>\n </label>\n </div>\n </div>\n </li>\n <li class="tui-image-editor-partition">\n <div></div>\n </li>\n <li class="tui-image-editor-submenu-align">\n <div class="tui-image-editor-checkbox-group tui-image-editor-disabled" style="margin-bottom: 7px;">\n <div class="tui-image-editor-checkbox-wrap">\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-remove-white">\n <span>')).call(u,m.localize("Remove White"),'</span>\n </label>\n </div>\n </div>\n <div class="tui-image-editor-newline tui-image-editor-range-wrap short">\n <label>')).call(l,m.localize("Distance"),'</label>\n <div class="tie-removewhite-distance-range"></div>\n </div>\n </div>\n <div class="tui-image-editor-checkbox-group tui-image-editor-disabled">\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-brightness">\n <span>')).call(c,m.localize("Brightness"),'</span>\n </label>\n </div>\n <div class="tui-image-editor-range-wrap short">\n <div class="tie-brightness-range"></div>\n </div>\n </div>\n <div class="tui-image-editor-checkbox-group tui-image-editor-disabled">\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-noise">\n <span>')).call(s,m.localize("Noise"),'</span>\n </label>\n </div>\n <div class="tui-image-editor-range-wrap short">\n <div class="tie-noise-range"></div>\n </div>\n </div>\n </li>\n <li class="tui-image-editor-partition only-left-right">\n <div></div>\n </li>\n <li class="tui-image-editor-submenu-align">\n <div class="tui-image-editor-checkbox-group tui-image-editor-disabled">\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-pixelate">\n <span>')).call(a,m.localize("Pixelate"),'</span>\n </label>\n </div>\n <div class="tui-image-editor-range-wrap short">\n <div class="tie-pixelate-range"></div>\n </div>\n </div>\n <div class="tui-image-editor-checkbox-group tui-image-editor-disabled">\n <div class="tui-image-editor-newline tui-image-editor-checkbox-wrap">\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-color-filter">\n <span>')).call(o,m.localize("Color Filter"),'</span>\n </label>\n </div>\n </div>\n <div class="tui-image-editor-newline tui-image-editor-range-wrap short">\n <label>')).call(r,m.localize("Threshold"),'</label>\n <div class="tie-colorfilter-threshold-range"></div>\n </div>\n </div>\n </li>\n <li class="tui-image-editor-partition">\n <div></div>\n </li>\n <li>\n <div class="filter-color-item">\n <div class="tie-filter-tint-color" title="')).call(n,m.localize("Tint"),'"></div>\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-tint">\n <span></span>\n </label>\n </div>\n </div>\n <div class="filter-color-item">\n <div class="tie-filter-multiply-color" title="')).call(i,m.localize("Multiply"),'"></div>\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-multiply">\n <span></span>\n </label>\n </div>\n </div>\n <div class="filter-color-item">\n <div class="tie-filter-blend-color" title="')).call(e,m.localize("Blend"),'"></div>\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-blend">\n <span></span>\n </label>\n </div>\n </div>\n </li>\n </ul>\n')};function In(t){var e=Mn();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function Mn(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var Sn="130px",wn=["add","diff","subtract","multiply","screen","lighten","darken"],Tn=["grayscale","invert","sepia","vintage","blur","sharpen","emboss","remove-white","brightness","noise","pixelate","color-filter","tint","multiply","blend"],An={grayscale:"grayscale",invert:"invert",sepia:"sepia",blur:"blur",sharpen:"sharpen",emboss:"emboss",removeWhite:"removeColor",brightness:"brightness",contrast:"contrast",saturation:"saturation",vintage:"vintage",polaroid:"polaroid",noise:"noise",pixelate:"pixelate",colorFilter:"removeColor",tint:"blendColor",multiply:"blendColor",blend:"blendColor",hue:"hue",gamma:"gamma"},Dn=["removewhiteDistanceRange","colorfilterThresholdRange","pixelateRange","noiseRange","brightnessRange","tintOpacity"],En=["filterBlendColor","filterMultiplyColor","filterTintColor"],kn=function(t){oi(i,t);var e=In(i);function i(t,n){var r,o=n.locale,a=n.menuBarPosition,s=n.usageStatistics;return D(this,i),r=e.call(this,t,{locale:o,name:"filter",menuBarPosition:a,templateHtml:Cn,usageStatistics:s}),r.selectBoxShow=!1,r.checkedMap={},r._makeControlElement(),r}return k(i,[{key:"destroy",value:function(){this._removeEvent(),this._destroyToolInstance(),he(this)}},{key:"_removeEvent",value:function(){var t,e=this;X()(Tn,(function(t){var i=e.selector(".tie-".concat(t)),n=ne(t);i.removeEventListener("change",e.eventHandler[n])})),X()(N()(t=[]).call(t,Dn,En),(function(t){e._els[t].off()})),this._els.blendType.removeEventListener("change",this.eventHandler.changeBlendFilter),this._els.blendType.removeEventListener("click",this.eventHandler.changeBlendFilter),di()(this.colorPickerInputBoxes,(function(t){var i,n;t.removeEventListener(At.FOCUS,j()(i=e._onStartEditingInputBox).call(i,e)),t.removeEventListener(At.BLUR,j()(n=e._onStopEditingInputBox).call(n,e))}),this)}},{key:"_destroyToolInstance",value:function(){var t,e=this;X()(N()(t=[]).call(t,Dn,En),(function(t){e._els[t].destroy()}))}},{key:"addEvent",value:function(t){var e,i,n,r=this,o=t.applyFilter,a=function(t){var e;return j()(e=r._changeFilterState).call(e,r,o,t)},s=function(t){return function(e,i){return r._changeFilterState(o,t,i)}};this.eventHandler={changeBlendFilter:a("blend"),blandTypeClick:function(t){return t.stopPropagation()}},X()(Tn,(function(t){var e=r.selector(".tie-".concat(t)),i=ne(t);r.checkedMap[i]=e,r.eventHandler[i]=a(i),e.addEventListener("change",r.eventHandler[i])})),this._els.removewhiteDistanceRange.on("change",s("removeWhite")),this._els.colorfilterThresholdRange.on("change",s("colorFilter")),this._els.pixelateRange.on("change",s("pixelate")),this._els.noiseRange.on("change",s("noise")),this._els.brightnessRange.on("change",s("brightness")),this._els.filterBlendColor.on("change",this.eventHandler.changeBlendFilter),this._els.filterMultiplyColor.on("change",a("multiply")),this._els.filterTintColor.on("change",a("tint")),this._els.tintOpacity.on("change",s("tint")),this._els.filterMultiplyColor.on("changeShow",j()(e=this.colorPickerChangeShow).call(e,this)),this._els.filterTintColor.on("changeShow",j()(i=this.colorPickerChangeShow).call(i,this)),this._els.filterBlendColor.on("changeShow",j()(n=this.colorPickerChangeShow).call(n,this)),this._els.blendType.addEventListener("change",this.eventHandler.changeBlendFilter),this._els.blendType.addEventListener("click",this.eventHandler.blandTypeClick),di()(this.colorPickerInputBoxes,(function(t){var e,i;t.addEventListener(At.FOCUS,j()(e=r._onStartEditingInputBox).call(e,r)),t.addEventListener(At.BLUR,j()(i=r._onStopEditingInputBox).call(i,r))}),this)}},{key:"setFilterState",value:function(t){var e=t.type,i=t.options,n=t.action,r=this._getFilterNameFromOptions(e,i),o="remove"===n;o||this._setFilterState(r,i),this.checkedMap[r].checked=!o}},{key:"initFilterCheckBoxState",value:function(){X()(this.checkedMap,(function(t){t.checked=!1}),this)}},{key:"_setFilterState",value:function(t,e){"colorFilter"===t?this._els.colorfilterThresholdRange.value=e.distance:"removeWhite"===t?this._els.removewhiteDistanceRange.value=e.distance:"pixelate"===t?this._els.pixelateRange.value=e.blocksize:"brightness"===t?this._els.brightnessRange.value=e.brightness:"noise"===t?this._els.noiseRange.value=e.noise:"tint"===t?(this._els.tintOpacity.value=e.alpha,this._els.filterTintColor.color=e.color):"blend"===t?this._els.filterBlendColor.color=e.color:"multiply"===t&&(this._els.filterMultiplyColor.color=e.color)}},{key:"_getFilterNameFromOptions",value:function(t,e){var i=t;return"removeColor"===t?i=xn()(e.useAlpha)?"removeWhite":"colorFilter":"blendColor"===t&&(i={add:"blend",multiply:"multiply",tint:"tint"}[e.mode]),i}},{key:"_changeFilterState",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.checkedMap[e].checked,r=An[e],o=this.checkedMap[e].closest(".tui-image-editor-checkbox-group");o&&(n?o.classList.remove("tui-image-editor-disabled"):o.classList.add("tui-image-editor-disabled")),t(n,r,this._getFilterOption(e),!i)}},{key:"_getFilterOption",value:function(t){var e={};switch(t){case"removeWhite":e.color="#FFFFFF",e.useAlpha=!1,e.distance=We()(this._els.removewhiteDistanceRange.value);break;case"colorFilter":e.color="#FFFFFF",e.distance=We()(this._els.colorfilterThresholdRange.value);break;case"pixelate":e.blocksize=ie(this._els.pixelateRange.value);break;case"noise":e.noise=ie(this._els.noiseRange.value);break;case"brightness":e.brightness=We()(this._els.brightnessRange.value);break;case"blend":e.mode="add",e.color=this._els.filterBlendColor.color,e.mode=this._els.blendType.value;break;case"multiply":e.mode="multiply",e.color=this._els.filterMultiplyColor.color;break;case"tint":e.mode="tint",e.color=this._els.filterTintColor.color,e.alpha=this._els.tintOpacity.value;break;case"blur":e.blur=this._els.blurRange.value;break;default:break}return e}},{key:"_makeControlElement",value:function(){this._els={removewhiteDistanceRange:new xi({slider:this.selector(".tie-removewhite-distance-range")},Ht.removewhiteDistanceRange),brightnessRange:new xi({slider:this.selector(".tie-brightness-range")},Ht.brightnessRange),noiseRange:new xi({slider:this.selector(".tie-noise-range")},Ht.noiseRange),pixelateRange:new xi({slider:this.selector(".tie-pixelate-range")},Ht.pixelateRange),colorfilterThresholdRange:new xi({slider:this.selector(".tie-colorfilter-threshold-range")},Ht.colorfilterThresholdRange),filterTintColor:new yi(this.selector(".tie-filter-tint-color"),{defaultColor:"#03bd9e",toggleDirection:this.toggleDirection,usageStatistics:this.usageStatistics}),filterMultiplyColor:new yi(this.selector(".tie-filter-multiply-color"),{defaultColor:"#515ce6",toggleDirection:this.toggleDirection,usageStatistics:this.usageStatistics}),filterBlendColor:new yi(this.selector(".tie-filter-blend-color"),{defaultColor:"#ffbb3b",toggleDirection:this.toggleDirection,usageStatistics:this.usageStatistics}),blurRange:Ht.blurFilterRange},this._els.tintOpacity=this._pickerWithRange(this._els.filterTintColor.pickerControl),this._els.blendType=this._pickerWithSelectbox(this._els.filterBlendColor.pickerControl),this.colorPickerControls.push(this._els.filterTintColor),this.colorPickerControls.push(this._els.filterMultiplyColor),this.colorPickerControls.push(this._els.filterBlendColor),this.colorPickerInputBoxes=[],this.colorPickerInputBoxes.push(this._els.filterTintColor.colorpickerElement.querySelector(Dt.COLOR_PICKER_INPUT_BOX)),this.colorPickerInputBoxes.push(this._els.filterMultiplyColor.colorpickerElement.querySelector(Dt.COLOR_PICKER_INPUT_BOX)),this.colorPickerInputBoxes.push(this._els.filterBlendColor.colorpickerElement.querySelector(Dt.COLOR_PICKER_INPUT_BOX))}},{key:"_pickerWithRange",value:function(t){var e=document.createElement("div"),i=document.createElement("label"),n=document.createElement("div");return n.id="tie-filter-tint-opacity",i.innerHTML="Opacity",e.appendChild(i),e.appendChild(n),t.appendChild(e),t.style.height=Sn,new xi({slider:n},Ht.tintOpacityRange)}},{key:"_pickerWithSelectbox",value:function(t){var e=document.createElement("div"),i=document.createElement("select"),n=document.createElement("ul");return e.className="tui-image-editor-selectlist-wrap",n.className="tui-image-editor-selectlist",e.appendChild(i),e.appendChild(n),this._makeSelectOptionList(i),t.appendChild(e),t.style.height=Sn,this._drawSelectOptionList(i,n),this._pickerWithSelectboxForAddEvent(i,n),i}},{key:"_drawSelectOptionList",value:function(t,e){var i=t.querySelectorAll("option");X()(i,(function(t){var i=document.createElement("li");i.innerHTML=t.innerHTML,i.setAttribute("data-item",t.value),e.appendChild(i)}))}},{key:"_pickerWithSelectboxForAddEvent",value:function(t,e){var i=this;e.addEventListener("click",(function(n){var r=n.target.getAttribute("data-item"),o=document.createEvent("HTMLEvents");t.querySelector('[value="'.concat(r,'"]')).selected=!0,o.initEvent("change",!0,!0),t.dispatchEvent(o),i.selectBoxShow=!1,e.style.display="none"})),t.addEventListener("mousedown",(function(n){n.preventDefault(),i.selectBoxShow=!i.selectBoxShow,e.style.display=i.selectBoxShow?"block":"none",e.setAttribute("data-selectitem",t.value),e.querySelector("[data-item='".concat(t.value,"']")).classList.add("active")}))}},{key:"_makeSelectOptionList",value:function(t){X()(wn,(function(e){var i=document.createElement("option");i.setAttribute("value",e),i.innerHTML=e.replace(/^[a-z]/,(function(t){return t.toUpperCase()})),t.appendChild(i)}))}}]),i}(Ii),On=kn,jn=r(4383),Ln=r.n(jn),Nn=function(){function t(e,i){var n=i.name;D(this,t),this.name=n,this.items=[],this.panelElement=this._makePanelElement(),this.listElement=this._makeListElement(),this.panelElement.appendChild(this.listElement),e.appendChild(this.panelElement)}return k(t,[{key:"_makePanelElement",value:function(){var t=document.createElement("div");return t.className="tie-panel-".concat(this.name),t}},{key:"_makeListElement",value:function(){var t=document.createElement("ol");return t.className="".concat(this.name,"-list"),t}},{key:"makeListItemElement",value:function(t){var e=document.createElement("li");return e.innerHTML=t,e.className="".concat(this.name,"-item"),e.setAttribute("data-index",this.items.length),e}},{key:"pushListItemElement",value:function(t){this.listElement.appendChild(t),this.listElement.scrollTop+=t.offsetHeight,this.items.push(t)}},{key:"deleteListItemElement",value:function(t,e){for(var i=this.items,n=t;n<e;n+=1)this.listElement.removeChild(i[n]);s()(i).call(i,t,e-t+1)}},{key:"getListLength",value:function(){return this.items.length}},{key:"addClass",value:function(t,e){this.items[t]&&this.items[t].classList.add(e)}},{key:"removeClass",value:function(t,e){this.items[t]&&this.items[t].classList.remove(e)}},{key:"toggleClass",value:function(t,e){this.items[t]&&this.items[t].classList.toggle(e)}}]),t}(),Pn=Nn,zn=function(t){var e,i,n,r=t.locale,o=t.makeSvgIcon,a=t.name,s=t.detail;return N()(e=N()(i=N()(n='\n <div class="tui-image-editor-history-item history">\n <div class="history-item-icon">\n '.concat(o(["normal","active"],"history-".concat(a.toLowerCase()),!0),"\n </div>\n <span>\n ")).call(n,r.localize(a),"\n ")).call(i,s?"(".concat(r.localize(s),")"):"",'\n </span>\n <div class="history-item-checkbox">\n ')).call(e,o(["normal"],"history-check",!0),"\n </div>\n </div>\n")};function Rn(t){var e=Bn();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function Bn(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var Fn="history-item",Yn="selected-item",Hn="disabled-item",Un=function(t){oi(i,t);var e=Rn(i);function i(t,n){var r,o=n.locale,a=n.makeSvgIcon;return D(this,i),r=e.call(this,t,{name:"history"}),t.classList.add("enabled"),r.locale=o,r.makeSvgIcon=a,r._eventHandler={},r._historyIndex=r.getListLength(),r}return k(i,[{key:"add",value:function(t){var e=t.name,i=t.detail;this._hasDisabledItem()&&this.deleteListItemElement(this._historyIndex+1,this.getListLength());var n=zn({locale:this.locale,makeSvgIcon:this.makeSvgIcon,name:e,detail:i}),r=this.makeListItemElement(n);this.pushListItemElement(r),this._historyIndex=this.getListLength()-1,this._selectItem(this._historyIndex)}},{key:"init",value:function(){this.deleteListItemElement(1,this.getListLength()),this._historyIndex=0,this._selectItem(this._historyIndex)}},{key:"clear",value:function(){this.deleteListItemElement(0,this.getListLength()),this._historyIndex=-1}},{key:"prev",value:function(){this._historyIndex-=1,this._selectItem(this._historyIndex)}},{key:"next",value:function(){this._historyIndex+=1,this._selectItem(this._historyIndex)}},{key:"_hasDisabledItem",value:function(){return this.getListLength()-1>this._historyIndex}},{key:"_addHistoryEventListener",value:function(){var t=this;this._eventHandler.history=function(e){return t._clickHistoryItem(e)},this.listElement.addEventListener("click",this._eventHandler.history)}},{key:"_removeHistoryEventListener",value:function(){this.listElement.removeEventListener("click",this._eventHandler.history)}},{key:"_clickHistoryItem",value:function(t){var e=t.target,i=e.closest(".".concat(Fn));if(i){var n=Ln()(i.getAttribute("data-index"),10);if(n!==this._historyIndex){var r=Math.abs(n-this._historyIndex);n<this._historyIndex?this._actions.undo(r):this._actions.redo(r)}}}},{key:"_selectItem",value:function(t){for(var e=0;e<this.getListLength();e+=1)this.removeClass(e,Yn),this.removeClass(e,Hn),e>t&&this.addClass(e,Hn);this.addClass(t,Yn)}},{key:"destroy",value:function(){this.removeEvent(),he(this)}},{key:"addEvent",value:function(t){this._actions=t,this._addHistoryEventListener()}},{key:"removeEvent",value:function(){this._removeHistoryEventListener()}}]),i}(Pn),Wn=Un,Gn=function(){function t(e){D(this,t),this._locale=e}return k(t,[{key:"localize",value:function(t){return this._locale[t]||t}}]),t}(),Xn=Gn,Zn={Shape:Di,Crop:Li,Resize:Bi,Flip:Wi,Rotate:Ki,Text:nn,Mask:cn,Icon:dn,Draw:bn,Filter:On},Vn="1300",Jn="history",Qn="tie-panel-history",Kn="on",qn={ZOOM_IN:"zoomIn",HAND:"hand"},$n=function(){function t(e,i,n){D(this,t),this.options=this._initializeOption(i),this._actions=n,this.submenu=!1,this.imageSize={},this.uiSize={},this._locale=new Xn(this.options.locale),this.theme=new $e(this.options.theme),this.eventHandler={},this._submenuChangeTransection=!1,this._selectedElement=null,this._mainElement=null,this._editorElementWrap=null,this._editorElement=null,this._menuBarElement=null,this._subMenuElement=null,this._makeUiElement(e),this._setUiSize(),this._initMenuEvent=!1,this._makeSubMenu(),this._attachHistoryEvent(),this._attachZoomEvent()}return k(t,[{key:"destroy",value:function(){this._removeUiEvent(),this._destroyAllMenu(),this._selectedElement.innerHTML="",he(this)}},{key:"setUiDefaultSelectionStyle",value:function(t){return H()({applyCropSelectionStyle:!0,applyGroupSelectionStyle:!0,selectionStyle:{cornerStyle:"circle",cornerSize:16,cornerColor:"#fff",cornerStrokeColor:"#fff",transparentCorners:!1,lineWidth:2,borderColor:"#fff"}},t)}},{key:"resizeEditor",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.uiSize,i=t.imageSize,n=void 0===i?this.imageSize:i;n!==this.imageSize&&(this.imageSize=n),e&&this._setUiSize(e);var r=this._getCanvasMaxDimension(),o=r.width,a=r.height,s=this._editorElement.style,c=this.options.menuBarPosition;s.height="".concat(a,"px"),s.width="".concat(o,"px"),this._setEditorPosition(c),this._editorElementWrap.style.bottom="0px",this._editorElementWrap.style.top="0px",this._editorElementWrap.style.left="0px",this._editorElementWrap.style.width="100%";var l=this._selectedElement.classList;"top"===c&&this._selectedElement.offsetWidth<Vn?l.add("tui-image-editor-top-optimization"):l.remove("tui-image-editor-top-optimization")}},{key:"toggleZoomButtonStatus",value:function(t){var e=this._buttonElements[t].classList;e.toggle(Kn),t===qn.ZOOM_IN?this._buttonElements[qn.HAND].classList.remove(Kn):this._buttonElements[qn.ZOOM_IN].classList.remove(Kn)}},{key:"offZoomInButtonStatus",value:function(){var t=this._buttonElements[qn.ZOOM_IN].classList;t.remove(Kn)}},{key:"changeHandButtonStatus",value:function(t){var e=this._buttonElements[qn.HAND].classList;e[t?"add":"remove"](Kn)}},{key:"changeHelpButtonEnabled",value:function(t,e){var i=this._buttonElements[t].classList;i[e?"add":"remove"]("enabled")}},{key:"_initializeOption",value:function(t){return H()({loadImage:{path:"",name:""},locale:{},menuIconPath:"",menu:["resize","crop","flip","rotate","draw","shape","icon","text","mask","filter"],initMenu:"",uiSize:{width:"100%",height:"100%"},menuBarPosition:"bottom"},t)}},{key:"_setUiSize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.uiSize,e=this._selectedElement.style;e.width=t.width,e.height=t.height}},{key:"_makeSubMenu",value:function(){var t=this;X()(this.options.menu,(function(e){var i,n=Zn[e.replace(/^[a-z]/,(function(t){return t.toUpperCase()}))];t._makeMenuElement(e),t._buttonElements[e]=t._menuBarElement.querySelector(".tie-btn-".concat(e)),t[e]=new n(t._subMenuElement,{locale:t._locale,makeSvgIcon:j()(i=t.theme.makeMenSvgIconSet).call(i,t.theme),menuBarPosition:t.options.menuBarPosition,usageStatistics:t.options.usageStatistics})}))}},{key:"_attachHistoryEvent",value:function(){var t,e,i;this.on(At.EXECUTE_COMMAND,j()(t=this._addHistory).call(t,this)),this.on(At.AFTER_UNDO,j()(e=this._selectPrevHistory).call(e,this)),this.on(At.AFTER_REDO,j()(i=this._selectNextHistory).call(i,this))}},{key:"_attachZoomEvent",value:function(){var t=this;this.on(At.HAND_STARTED,(function(){t.offZoomInButtonStatus(),t.changeHandButtonStatus(!0)})),this.on(At.HAND_STOPPED,(function(){return t.changeHandButtonStatus(!1)}))}},{key:"_makeUiElement",value:function(t){var e,i;i=t.nodeType?t:document.querySelector(t);var n=ce(i);i.classList.add("tui-image-editor-container"),i.innerHTML=Xe({locale:this._locale,biImage:this.theme.getStyle("common.bi"),loadButtonStyle:this.theme.getStyle("loadButton"),downloadButtonStyle:this.theme.getStyle("downloadButton"),menuBarPosition:this.options.menuBarPosition})+Ge({locale:this._locale,biImage:this.theme.getStyle("common.bi"),commonStyle:this.theme.getStyle("common"),headerStyle:this.theme.getStyle("header"),loadButtonStyle:this.theme.getStyle("loadButton"),downloadButtonStyle:this.theme.getStyle("downloadButton"),submenuStyle:this.theme.getStyle("submenu")}),this._selectedElement=i,this._selectedElement.classList.add(this.options.menuBarPosition),this._mainElement=n(".tui-image-editor-main"),this._editorElementWrap=n(".tui-image-editor-wrap"),this._editorElement=n(".tui-image-editor"),this._helpMenuBarElement=n(".tui-image-editor-help-menu"),this._menuBarElement=n(".tui-image-editor-menu"),this._subMenuElement=n(".tui-image-editor-submenu"),this._buttonElements={download:this._selectedElement.querySelectorAll(".tui-image-editor-download-btn"),load:this._selectedElement.querySelectorAll(".tui-image-editor-load-btn")},this._addHelpMenus(),this._historyMenu=new Wn(this._buttonElements[Jn],{locale:this._locale,makeSvgIcon:j()(e=this.theme.makeMenSvgIconSet).call(e,this.theme)}),this._activateZoomMenus()}},{key:"_activateZoomMenus",value:function(){var t=this;X()(vt,(function(e){t.changeHelpButtonEnabled(e,!0)}))}},{key:"_makeHelpMenuWithPartition",value:function(){var t;return N()(t=[]).call(t,w(vt),[""],w(mt),[""],w(yt))}},{key:"_addHelpMenus",value:function(){var t=this,e=this._makeHelpMenuWithPartition();X()(e,(function(e){e?(t._makeMenuElement(e,["normal","disabled","hover"],"help"),t._buttonElements[e]=t._helpMenuBarElement.querySelector(".tie-btn-".concat(e))):t._makeMenuPartitionElement()}))}},{key:"_makeMenuPartitionElement",value:function(){var t=document.createElement("li"),e=document.createElement("div");t.className=fe("item"),e.className=fe("icpartition"),t.appendChild(e),this._helpMenuBarElement.appendChild(t)}},{key:"_makeMenuElement",value:function(t){var e,i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["normal","active","hover"],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"normal",o=document.createElement("li"),a=this.theme.makeMenSvgIconSet(n,t);this._addTooltipAttribute(o,t),o.className=N()(e=N()(i="tie-btn-".concat(t," ")).call(i,fe("item")," ")).call(e,r),o.innerHTML=a,"normal"===r?this._menuBarElement.appendChild(o):this._helpMenuBarElement.appendChild(o)}},{key:"_addHelpActionEvent",value:function(){var t=this;X()(bt,(function(e){t.eventHandler[e]=function(i){return t._actions.main[e](i)},t._buttonElements[e].addEventListener("click",t.eventHandler[e])}))}},{key:"_removeHelpActionEvent",value:function(){var t=this;X()(bt,(function(e){t._buttonElements[e].removeEventListener("click",t.eventHandler[e])}))}},{key:"_addHistory",value:function(t){if(!Me(t)){var e="string"===typeof t?{name:t}:Se(t);this._historyMenu.add(e)}}},{key:"initHistory",value:function(){this._historyMenu.init()}},{key:"clearHistory",value:function(){this._historyMenu.clear()}},{key:"_selectPrevHistory",value:function(){this._historyMenu.prev()}},{key:"_selectNextHistory",value:function(){this._historyMenu.next()}},{key:"toggleHistoryMenu",value:function(t){var e=t.target,i=e.closest(".".concat(Qn));if(!i){var n=this._buttonElements[Jn].classList;n.toggle("opened")}}},{key:"_addTooltipAttribute",value:function(t,e){t.setAttribute("tooltip-content",this._locale.localize(e.replace(/^[a-z]/g,(function(t){return t.toUpperCase()}))))}},{key:"_addDownloadEvent",value:function(){var t=this;this.eventHandler.download=function(){return t._actions.main.download()},X()(this._buttonElements.download,(function(e){e.addEventListener("click",t.eventHandler.download)}))}},{key:"_removeDownloadEvent",value:function(){var t=this;X()(this._buttonElements.download,(function(e){e.removeEventListener("click",t.eventHandler.download)}))}},{key:"_addLoadEvent",value:function(){var t=this;this.eventHandler.loadImage=function(e){return t._actions.main.load(e.target.files[0])},X()(this._buttonElements.load,(function(e){e.addEventListener("change",t.eventHandler.loadImage)}))}},{key:"_removeLoadEvent",value:function(){var t=this;X()(this._buttonElements.load,(function(e){e.removeEventListener("change",t.eventHandler.loadImage)}))}},{key:"_addMainMenuEvent",value:function(t){var e=this;this.eventHandler[t]=function(){return e.changeMenu(t)},this._buttonElements[t].addEventListener("click",this.eventHandler[t])}},{key:"_addSubMenuEvent",value:function(t){var e=this;this[t].addEvent(this._actions[t]),this[t].on(At.INPUT_BOX_EDITING_STARTED,(function(){return e.fire(At.INPUT_BOX_EDITING_STARTED)})),this[t].on(At.INPUT_BOX_EDITING_STOPPED,(function(){return e.fire(At.INPUT_BOX_EDITING_STOPPED)}))}},{key:"_addMenuEvent",value:function(){var t=this;X()(this.options.menu,(function(e){t._addMainMenuEvent(e),t._addSubMenuEvent(e)}))}},{key:"_removeMainMenuEvent",value:function(){var t=this;X()(this.options.menu,(function(e){t._buttonElements[e].removeEventListener("click",t.eventHandler[e]),t[e].off(At.INPUT_BOX_EDITING_STARTED),t[e].off(At.INPUT_BOX_EDITING_STOPPED)}))}},{key:"getEditorArea",value:function(){return this._editorElement}},{key:"activeMenuEvent",value:function(){this._initMenuEvent||(this._addHelpActionEvent(),this._addDownloadEvent(),this._addMenuEvent(),this._initMenu(),this._historyMenu.addEvent(this._actions.history),this._initMenuEvent=!0)}},{key:"_removeUiEvent",value:function(){this._removeHelpActionEvent(),this._removeDownloadEvent(),this._removeLoadEvent(),this._removeMainMenuEvent(),this._historyMenu.removeEvent()}},{key:"_destroyAllMenu",value:function(){var t=this;X()(this.options.menu,(function(e){t[e].destroy()})),this._historyMenu.destroy()}},{key:"initCanvas",value:function(){var t=this,e=this._getLoadImage();e.path&&this._actions.main.initLoadImage(e.path,e.name).then((function(){t.activeMenuEvent()})),this._addLoadEvent();var i=document.createElement("div");i.className=fe("grid-visual");var n='<table>\n <tr><td class="dot left-top"></td><td></td><td class="dot right-top"></td></tr>\n <tr><td></td><td></td><td></td></tr>\n <tr><td class="dot left-bottom"></td><td></td><td class="dot right-bottom"></td></tr>\n </table>';i.innerHTML=n,this._editorContainerElement=this._editorElement.querySelector(".tui-image-editor-canvas-container"),this._editorContainerElement.appendChild(i)}},{key:"_getLoadImage",value:function(){return this.options.loadImage}},{key:"changeMenu",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this._submenuChangeTransection||(this._submenuChangeTransection=!0,this._changeMenu(t,e,i),this._submenuChangeTransection=!1)}},{key:"_changeMenu",value:function(t,e,i){this.submenu&&(this._buttonElements[this.submenu].classList.remove("active"),this._mainElement.classList.remove("tui-image-editor-menu-".concat(this.submenu)),i&&this._actions.main.discardSelection(),this._actions.main.changeSelectableAll(!0),this[this.submenu].changeStandbyMode()),this.submenu===t&&e?this.submenu=null:(this._buttonElements[t].classList.add("active"),this._mainElement.classList.add("tui-image-editor-menu-".concat(t)),this.submenu=t,this[this.submenu].changeStartMode()),this.resizeEditor()}},{key:"_initMenu",value:function(){if(this.options.initMenu){var t=document.createEvent("MouseEvents");t.initEvent("click",!0,!1),this._buttonElements[this.options.initMenu].dispatchEvent(t)}this.icon&&this.icon.registerDefaultIcon()}},{key:"_getCanvasMaxDimension",value:function(){var t=this._editorContainerElement.style,e=t.maxWidth,i=t.maxHeight,n=We()(e),r=We()(i);return{width:n,height:r}}},{key:"_setEditorPosition",value:function(t){var e=this._getCanvasMaxDimension(),i=e.width,n=e.height,r=this._editorElement.style,o=0,a=0;this.submenu&&("bottom"===t?o=n>this._editorElementWrap.scrollHeight-150?(n-this._editorElementWrap.scrollHeight)/2:-75:"top"===t?o=n>this._editorElementWrap.offsetHeight-150?75-(n-(this._editorElementWrap.offsetHeight-150))/2:75:"left"===t?a=i>this._editorElementWrap.offsetWidth-248?124-(i-(this._editorElementWrap.offsetWidth-248))/2:124:"right"===t&&(a=i>this._editorElementWrap.scrollWidth-248?(i-this._editorElementWrap.scrollWidth)/2:-124)),r.top="".concat(o,"px"),r.left="".concat(a,"px")}}]),t}();V().mixin($n);var tr=$n,er=r(381),ir=r.n(er),nr=function(){function t(){D(this,t),this.versionnumber="1.2.4",this.optionpresets={default:{corsenabled:!1,ltres:1,qtres:1,pathomit:8,rightangleenhance:!0,colorsampling:2,numberofcolors:16,mincolorratio:0,colorquantcycles:3,layering:0,strokewidth:1,linefilter:!1,scale:1,roundcoords:1,viewbox:!1,desc:!1,lcpr:0,qcpr:0,blurradius:0,blurdelta:20},posterized1:{colorsampling:0,numberofcolors:2},posterized2:{numberofcolors:4,blurradius:5},curvy:{ltres:.01,linefilter:!0,rightangleenhance:!1},sharp:{qtres:.01,linefilter:!1},detailed:{pathomit:0,roundcoords:2,ltres:.5,qtres:.5,numberofcolors:64},smoothed:{blurradius:5,blurdelta:64},grayscale:{colorsampling:0,colorquantcycles:1,numberofcolors:7},fixedpalette:{colorsampling:0,colorquantcycles:1,numberofcolors:27},randomsampling1:{colorsampling:1,numberofcolors:8},randomsampling2:{colorsampling:1,numberofcolors:64},artistic1:{colorsampling:0,colorquantcycles:1,pathomit:0,blurradius:5,blurdelta:64,ltres:.01,linefilter:!0,numberofcolors:16,strokewidth:2},artistic2:{qtres:.01,colorsampling:0,colorquantcycles:1,numberofcolors:4,strokewidth:0},artistic3:{qtres:10,ltres:10,numberofcolors:8},artistic4:{qtres:10,ltres:10,numberofcolors:64,blurradius:5,blurdelta:256,strokewidth:2},posterized3:{ltres:1,qtres:1,pathomit:20,rightangleenhance:!0,colorsampling:0,numberofcolors:3,mincolorratio:0,colorquantcycles:3,blurradius:3,blurdelta:20,strokewidth:0,linefilter:!1,roundcoords:1,pal:[{r:0,g:0,b:100,a:255},{r:255,g:255,b:255,a:255}]}},this.pathscan_combined_lookup=[[[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1]],[[0,1,0,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],[0,2,-1,0]],[[-1,-1,-1,-1],[-1,-1,-1,-1],[0,1,0,-1],[0,0,1,0]],[[0,0,1,0],[-1,-1,-1,-1],[0,2,-1,0],[-1,-1,-1,-1]],[[-1,-1,-1,-1],[0,0,1,0],[0,3,0,1],[-1,-1,-1,-1]],[[13,3,0,1],[13,2,-1,0],[7,1,0,-1],[7,0,1,0]],[[-1,-1,-1,-1],[0,1,0,-1],[-1,-1,-1,-1],[0,3,0,1]],[[0,3,0,1],[0,2,-1,0],[-1,-1,-1,-1],[-1,-1,-1,-1]],[[0,3,0,1],[0,2,-1,0],[-1,-1,-1,-1],[-1,-1,-1,-1]],[[-1,-1,-1,-1],[0,1,0,-1],[-1,-1,-1,-1],[0,3,0,1]],[[11,1,0,-1],[14,0,1,0],[14,3,0,1],[11,2,-1,0]],[[-1,-1,-1,-1],[0,0,1,0],[0,3,0,1],[-1,-1,-1,-1]],[[0,0,1,0],[-1,-1,-1,-1],[0,2,-1,0],[-1,-1,-1,-1]],[[-1,-1,-1,-1],[-1,-1,-1,-1],[0,1,0,-1],[0,0,1,0]],[[0,1,0,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],[0,2,-1,0]],[[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1]]],this.gks=[[.27901,.44198,.27901],[.135336,.228569,.272192,.228569,.135336],[.086776,.136394,.178908,.195843,.178908,.136394,.086776],[.063327,.093095,.122589,.144599,.152781,.144599,.122589,.093095,.063327],[.049692,.069304,.089767,.107988,.120651,.125194,.120651,.107988,.089767,.069304,.049692]],this.specpalette=[{r:0,g:0,b:0,a:255},{r:128,g:128,b:128,a:255},{r:0,g:0,b:128,a:255},{r:64,g:64,b:128,a:255},{r:192,g:192,b:192,a:255},{r:255,g:255,b:255,a:255},{r:128,g:128,b:192,a:255},{r:0,g:0,b:192,a:255},{r:128,g:0,b:0,a:255},{r:128,g:64,b:64,a:255},{r:128,g:0,b:128,a:255},{r:168,g:168,b:168,a:255},{r:192,g:128,b:128,a:255},{r:192,g:0,b:0,a:255},{r:255,g:255,b:255,a:255},{r:0,g:128,b:0,a:255}]}return k(t,[{key:"imageToSVG",value:function(t,e,i){var n=this;i=this.checkoptions(i),this.loadImage(t,(function(t){e(n.imagedataToSVG(n.getImgdata(t),i))}),i)}},{key:"imagedataToSVG",value:function(t,e){e=this.checkoptions(e);var i=this.imagedataToTracedata(t,e);return this.getsvgstring(i,e)}},{key:"imageToTracedata",value:function(t,e,i){var n=this;i=this.checkoptions(i),this.loadImage(t,(function(t){e(n.imagedataToTracedata(n.getImgdata(t),i))}),i)}},{key:"imagedataToTracedata",value:function(t,e){e=this.checkoptions(e);var i,n=this.colorquantization(t,e);if(0===e.layering){i={layers:[],palette:n.palette,width:n.array[0].length-2,height:n.array.length-2};for(var r=0;r<n.palette.length;r+=1){var o=this.batchtracepaths(this.internodes(this.pathscan(this.layeringstep(n,r),e.pathomit),e),e.ltres,e.qtres);i.layers.push(o)}}else{var a=this.layering(n);e.layercontainerid&&this.drawLayers(a,this.specpalette,e.scale,e.layercontainerid);var s=this.batchpathscan(a,e.pathomit),c=this.batchinternodes(s,e);i={layers:this.batchtracelayers(c,e.ltres,e.qtres),palette:n.palette,width:t.width,height:t.height}}return i}},{key:"checkoptions",value:function(t){t=t||{},"string"===typeof t&&(t=t.toLowerCase(),t=this.optionpresets[t]?this.optionpresets[t]:{});for(var e=q()(this.optionpresets["default"]),i=0;i<e.length;i+=1)t.hasOwnProperty(e[i])||(t[e[i]]=this.optionpresets["default"][e[i]]);return t}},{key:"colorquantization",value:function(t,e){var i,n,r,o,a,s,c,l,u=[],h=0,f=[],d=t.width*t.height;for(a=0;a<t.height+2;a+=1)for(u[a]=[],o=0;o<t.width+2;o+=1)u[a][o]=-1;for(l=e.pal?e.pal:0===e.colorsampling?this.generatepalette(e.numberofcolors):1===e.colorsampling?this.samplepalette(e.numberofcolors,t):this.samplepalette2(e.numberofcolors,t),e.blurradius>0&&(t=this.blur(t,e.blurradius,e.blurdelta)),c=0;c<e.colorquantcycles;c+=1){if(c>0)for(s=0;s<l.length;s+=1)f[s].n>0&&(l[s]={r:Math.floor(f[s].r/f[s].n),g:Math.floor(f[s].g/f[s].n),b:Math.floor(f[s].b/f[s].n),a:Math.floor(f[s].a/f[s].n)}),f[s].n/d<e.mincolorratio&&c<e.colorquantcycles-1&&(l[s]={r:Math.floor(255*Math.random()),g:Math.floor(255*Math.random()),b:Math.floor(255*Math.random()),a:Math.floor(255*Math.random())});for(o=0;o<l.length;o+=1)f[o]={r:0,g:0,b:0,a:0,n:0};for(a=0;a<t.height;a+=1)for(o=0;o<t.width;o+=1){for(h=4*(a*t.width+o),r=0,n=1024,s=0;s<l.length;s+=1)i=Math.abs(l[s].r-t.data[h])+Math.abs(l[s].g-t.data[h+1])+Math.abs(l[s].b-t.data[h+2])+Math.abs(l[s].a-t.data[h+3]),i<n&&(n=i,r=s);f[r].r+=t.data[h],f[r].g+=t.data[h+1],f[r].b+=t.data[h+2],f[r].a+=t.data[h+3],f[r].n+=1,u[a+1][o+1]=r}}return{array:u,palette:l}}},{key:"samplepalette",value:function(t,e){for(var i,n=[],r=0;r<t;r+=1)i=4*Math.floor(Math.random()*e.data.length/4),n.push({r:e.data[i],g:e.data[i+1],b:e.data[i+2],a:e.data[i+3]});return n}},{key:"samplepalette2",value:function(t,e){for(var i,n=[],r=Math.ceil(Math.sqrt(t)),o=Math.ceil(t/r),a=e.width/(r+1),s=e.height/(o+1),c=0;c<o;c+=1)for(var l=0;l<r;l+=1){if(n.length===t)break;i=4*Math.floor((c+1)*s*e.width+(l+1)*a),n.push({r:e.data[i],g:e.data[i+1],b:e.data[i+2],a:e.data[i+3]})}return n}},{key:"generatepalette",value:function(t){var e,i,n,r=[];if(t<8)for(var o=Math.floor(255/(t-1)),a=0;a<t;a+=1)r.push({r:a*o,g:a*o,b:a*o,a:255});else{var s=Math.floor(Math.pow(t,1/3)),c=Math.floor(255/(s-1)),l=t-s*s*s;for(e=0;e<s;e+=1)for(i=0;i<s;i+=1)for(n=0;n<s;n+=1)r.push({r:e*c,g:i*c,b:n*c,a:255});for(e=0;e<l;e+=1)r.push({r:Math.floor(255*Math.random()),g:Math.floor(255*Math.random()),b:Math.floor(255*Math.random()),a:Math.floor(255*Math.random())})}return r}},{key:"layering",value:function(t){var e,i,n,r,o,a,s,c,l,u,h,f=[],d=0,g=t.array.length,p=t.array[0].length;for(h=0;h<t.palette.length;h+=1)for(f[h]=[],u=0;u<g;u+=1)for(f[h][u]=[],l=0;l<p;l+=1)f[h][u][l]=0;for(u=1;u<g-1;u+=1)for(l=1;l<p-1;l+=1)d=t.array[u][l],e=t.array[u-1][l-1]===d?1:0,i=t.array[u-1][l]===d?1:0,n=t.array[u-1][l+1]===d?1:0,r=t.array[u][l-1]===d?1:0,o=t.array[u][l+1]===d?1:0,a=t.array[u+1][l-1]===d?1:0,s=t.array[u+1][l]===d?1:0,c=t.array[u+1][l+1]===d?1:0,f[d][u+1][l+1]=1+2*o+4*c+8*s,r||(f[d][u+1][l]=2+4*s+8*a),i||(f[d][u][l+1]=0+2*n+4*o+8),e||(f[d][u][l]=0+2*i+4+8*r);return f}},{key:"layeringstep",value:function(t,e){var i,n,r=[],o=t.array.length,a=t.array[0].length;for(n=0;n<o;n+=1)for(r[n]=[],i=0;i<a;i+=1)r[n][i]=0;for(n=1;n<o;n+=1)for(i=1;i<a;i+=1)r[n][i]=(t.array[n-1][i-1]===e?1:0)+(t.array[n-1][i]===e?2:0)+(t.array[n][i-1]===e?8:0)+(t.array[n][i]===e?4:0);return r}},{key:"pathscan",value:function(t,e){for(var i,n=[],r=0,o=0,a=0,s=0,c=t[0].length,l=t.length,u=0,h=!0,f=!1,d=0;d<l;d+=1)for(var g=0;g<c;g+=1)if(4===t[d][g]||11===t[d][g]){a=g,s=d,n[r]={},n[r].points=[],n[r].boundingbox=[a,s,a,s],n[r].holechildren=[],h=!1,o=0,f=11===t[d][g],u=1;while(!h){if(n[r].points[o]={},n[r].points[o].x=a-1,n[r].points[o].y=s-1,n[r].points[o].t=t[s][a],a-1<n[r].boundingbox[0]&&(n[r].boundingbox[0]=a-1),a-1>n[r].boundingbox[2]&&(n[r].boundingbox[2]=a-1),s-1<n[r].boundingbox[1]&&(n[r].boundingbox[1]=s-1),s-1>n[r].boundingbox[3]&&(n[r].boundingbox[3]=s-1),i=this.pathscan_combined_lookup[t[s][a]][u],t[s][a]=i[0],u=i[1],a+=i[2],s+=i[3],a-1===n[r].points[0].x&&s-1===n[r].points[0].y)if(h=!0,n[r].points.length<e)n.pop();else{if(n[r].isholepath=!!f,f){for(var p=0,v=[-1,-1,c+1,l+1],m=0;m<r;m++)!n[m].isholepath&&this.boundingboxincludes(n[m].boundingbox,n[r].boundingbox)&&this.boundingboxincludes(v,n[m].boundingbox)&&(p=m,v=n[m].boundingbox);n[p].holechildren.push(r)}r+=1}o+=1}}return n}},{key:"boundingboxincludes",value:function(t,e){return t[0]<e[0]&&t[1]<e[1]&&t[2]>e[2]&&t[3]>e[3]}},{key:"batchpathscan",value:function(t,e){var i=[];for(var n in t)t.hasOwnProperty(n)&&(i[n]=this.pathscan(t[n],e));return i}},{key:"internodes",value:function(t,e){var i,n,r=[],o=0,a=0,s=0,c=0,l=0;for(i=0;i<t.length;i+=1)for(r[i]={},r[i].points=[],r[i].boundingbox=t[i].boundingbox,r[i].holechildren=t[i].holechildren,r[i].isholepath=t[i].isholepath,o=t[i].points.length,n=0;n<o;n+=1)a=(n+1)%o,s=(n+2)%o,c=(n-1+o)%o,l=(n-2+o)%o,e.rightangleenhance&&this.testrightangle(t[i],l,c,n,a,s)&&(r[i].points.length>0&&(r[i].points[r[i].points.length-1].linesegment=this.getdirection(r[i].points[r[i].points.length-1].x,r[i].points[r[i].points.length-1].y,t[i].points[n].x,t[i].points[n].y)),r[i].points.push({x:t[i].points[n].x,y:t[i].points[n].y,linesegment:this.getdirection(t[i].points[n].x,t[i].points[n].y,(t[i].points[n].x+t[i].points[a].x)/2,(t[i].points[n].y+t[i].points[a].y)/2)})),r[i].points.push({x:(t[i].points[n].x+t[i].points[a].x)/2,y:(t[i].points[n].y+t[i].points[a].y)/2,linesegment:this.getdirection((t[i].points[n].x+t[i].points[a].x)/2,(t[i].points[n].y+t[i].points[a].y)/2,(t[i].points[a].x+t[i].points[s].x)/2,(t[i].points[a].y+t[i].points[s].y)/2)});return r}},{key:"testrightangle",value:function(t,e,i,n,r,o){return t.points[n].x===t.points[e].x&&t.points[n].x===t.points[i].x&&t.points[n].y===t.points[r].y&&t.points[n].y===t.points[o].y||t.points[n].y===t.points[e].y&&t.points[n].y===t.points[i].y&&t.points[n].x===t.points[r].x&&t.points[n].x===t.points[o].x}},{key:"getdirection",value:function(t,e,i,n){var r=8;return r=t<i?e<n?1:e>n?7:0:t>i?e<n?3:e>n?5:4:e<n?2:e>n?6:8,r}},{key:"batchinternodes",value:function(t,e){var i=[];for(var n in t)t.hasOwnProperty(n)&&(i[n]=this.internodes(t[n],e));return i}},{key:"tracepath",value:function(t,e,i){var n,r,o,a=0,s={segments:[]};s.boundingbox=t.boundingbox,s.holechildren=t.holechildren,s.isholepath=t.isholepath;while(a<t.points.length){var c;n=t.points[a].linesegment,r=-1,o=a+1;while((t.points[o].linesegment===n||t.points[o].linesegment===r||-1===r)&&o<t.points.length-1)t.points[o].linesegment!==n&&-1===r&&(r=t.points[o].linesegment),o+=1;o===t.points.length-1&&(o=0),s.segments=N()(c=s.segments).call(c,this.fitseq(t,e,i,a,o)),a=o>0?o:t.points.length}return s}},{key:"fitseq",value:function(t,e,i,n,r){var o;if(r>t.points.length||r<0)return[];var a,s,c,l=n,u=0,h=!0,f=r-n;f<0&&(f+=t.points.length);var d,g=(t.points[r].x-t.points[n].x)/f,p=(t.points[r].y-t.points[n].y)/f,v=(n+1)%t.points.length;while(v!=r)d=v-n,d<0&&(d+=t.points.length),a=t.points[n].x+g*d,s=t.points[n].y+p*d,c=(t.points[v].x-a)*(t.points[v].x-a)+(t.points[v].y-s)*(t.points[v].y-s),c>e&&(h=!1),c>u&&(l=v,u=c),v=(v+1)%t.points.length;if(h)return[{type:"L",x1:t.points[n].x,y1:t.points[n].y,x2:t.points[r].x,y2:t.points[r].y}];var m=l;h=!0,u=0;var y=(m-n)/f,b=(1-y)*(1-y),_=2*(1-y)*y,x=y*y,C=(b*t.points[n].x+x*t.points[r].x-t.points[m].x)/-_,I=(b*t.points[n].y+x*t.points[r].y-t.points[m].y)/-_;v=n+1;while(v!=r)y=(v-n)/f,b=(1-y)*(1-y),_=2*(1-y)*y,x=y*y,a=b*t.points[n].x+_*C+x*t.points[r].x,s=b*t.points[n].y+_*I+x*t.points[r].y,c=(t.points[v].x-a)*(t.points[v].x-a)+(t.points[v].y-s)*(t.points[v].y-s),c>i&&(h=!1),c>u&&(l=v,u=c),v=(v+1)%t.points.length;if(h)return[{type:"Q",x1:t.points[n].x,y1:t.points[n].y,x2:C,y2:I,x3:t.points[r].x,y3:t.points[r].y}];var M=m;return N()(o=this.fitseq(t,e,i,n,M)).call(o,this.fitseq(t,e,i,M,r))}},{key:"batchtracepaths",value:function(t,e,i){var n=[];for(var r in t)t.hasOwnProperty(r)&&n.push(this.tracepath(t[r],e,i));return n}},{key:"batchtracelayers",value:function(t,e,i){var n=[];for(var r in t)t.hasOwnProperty(r)&&(n[r]=this.batchtracepaths(t[r],e,i));return n}},{key:"roundtodec",value:function(t,e){return Number(t.toFixed(e))}},{key:"svgpathstring",value:function(t,e,i,n){var r,o,a,s=t.layers[e],c=s[i],l="";if(n.linefilter&&c.segments.length<3)return l;if(l=N()(r="<path ".concat(n.desc?N()(o='desc="l '.concat(e," p ")).call(o,i,'" '):"")).call(r,this.tosvgcolorstr(t.palette[e],n),'d="'),-1===n.roundcoords){var u;for(l+=N()(u="M ".concat(c.segments[0].x1*n.scale," ")).call(u,c.segments[0].y1*n.scale," "),a=0;a<c.segments.length;a++){var h,f,d;if(l+=N()(h=N()(f="".concat(c.segments[a].type," ")).call(f,c.segments[a].x2*n.scale," ")).call(h,c.segments[a].y2*n.scale," "),c.segments[a].hasOwnProperty("x3"))l+=N()(d="".concat(c.segments[a].x3*n.scale," ")).call(d,c.segments[a].y3*n.scale," ")}l+="Z "}else{var g;for(l+=N()(g="M ".concat(this.roundtodec(c.segments[0].x1*n.scale,n.roundcoords)," ")).call(g,this.roundtodec(c.segments[0].y1*n.scale,n.roundcoords)," "),a=0;a<c.segments.length;a++){var p,v,m;if(l+=N()(p=N()(v="".concat(c.segments[a].type," ")).call(v,this.roundtodec(c.segments[a].x2*n.scale,n.roundcoords)," ")).call(p,this.roundtodec(c.segments[a].y2*n.scale,n.roundcoords)," "),c.segments[a].hasOwnProperty("x3"))l+=N()(m="".concat(this.roundtodec(c.segments[a].x3*n.scale,n.roundcoords)," ")).call(m,this.roundtodec(c.segments[a].y3*n.scale,n.roundcoords)," ")}l+="Z "}for(var y=0;y<c.holechildren.length;y++){var b=s[c.holechildren[y]];if(-1===n.roundcoords){var _,x;if(b.segments[b.segments.length-1].hasOwnProperty("x3"))l+=N()(_="M ".concat(b.segments[b.segments.length-1].x3*n.scale," ")).call(_,b.segments[b.segments.length-1].y3*n.scale," ");else l+=N()(x="M ".concat(b.segments[b.segments.length-1].x2*n.scale," ")).call(x,b.segments[b.segments.length-1].y2*n.scale," ");for(a=b.segments.length-1;a>=0;a--){var C,I;if(l+="".concat(b.segments[a].type," "),b.segments[a].hasOwnProperty("x3"))l+=N()(I="".concat(b.segments[a].x2*n.scale," ")).call(I,b.segments[a].y2*n.scale," ");l+=N()(C="".concat(b.segments[a].x1*n.scale," ")).call(C,b.segments[a].y1*n.scale," ")}}else{var M,S;if(b.segments[b.segments.length-1].hasOwnProperty("x3"))l+=N()(M="M ".concat(this.roundtodec(b.segments[b.segments.length-1].x3*n.scale)," ")).call(M,this.roundtodec(b.segments[b.segments.length-1].y3*n.scale)," ");else l+=N()(S="M ".concat(this.roundtodec(b.segments[b.segments.length-1].x2*n.scale)," ")).call(S,this.roundtodec(b.segments[b.segments.length-1].y2*n.scale)," ");for(a=b.segments.length-1;a>=0;a--){var w,T;if(l+="".concat(b.segments[a].type," "),b.segments[a].hasOwnProperty("x3"))l+=N()(T="".concat(this.roundtodec(b.segments[a].x2*n.scale)," ")).call(T,this.roundtodec(b.segments[a].y2*n.scale)," ");l+=N()(w="".concat(this.roundtodec(b.segments[a].x1*n.scale)," ")).call(w,this.roundtodec(b.segments[a].y1*n.scale)," ")}}l+="Z "}if(l+='" />',n.lcpr||n.qcpr){for(a=0;a<c.segments.length;a++){var A,D,E,k,O,j,L,P,z,R,B,F,Y,H,U,W,G;if(c.segments[a].hasOwnProperty("x3")&&n.qcpr)l+=N()(A=N()(D=N()(E='<circle cx="'.concat(c.segments[a].x2*n.scale,'" cy="')).call(E,c.segments[a].y2*n.scale,'" r="')).call(D,n.qcpr,'" fill="cyan" stroke-width="')).call(A,.2*n.qcpr,'" stroke="black" />'),l+=N()(k=N()(O=N()(j='<circle cx="'.concat(c.segments[a].x3*n.scale,'" cy="')).call(j,c.segments[a].y3*n.scale,'" r="')).call(O,n.qcpr,'" fill="white" stroke-width="')).call(k,.2*n.qcpr,'" stroke="black" />'),l+=N()(L=N()(P=N()(z=N()(R='<line x1="'.concat(c.segments[a].x1*n.scale,'" y1="')).call(R,c.segments[a].y1*n.scale,'" x2="')).call(z,c.segments[a].x2*n.scale,'" y2="')).call(P,c.segments[a].y2*n.scale,'" stroke-width="')).call(L,.2*n.qcpr,'" stroke="cyan" />'),l+=N()(B=N()(F=N()(Y=N()(H='<line x1="'.concat(c.segments[a].x2*n.scale,'" y1="')).call(H,c.segments[a].y2*n.scale,'" x2="')).call(Y,c.segments[a].x3*n.scale,'" y2="')).call(F,c.segments[a].y3*n.scale,'" stroke-width="')).call(B,.2*n.qcpr,'" stroke="cyan" />');if(!c.segments[a].hasOwnProperty("x3")&&n.lcpr)l+=N()(U=N()(W=N()(G='<circle cx="'.concat(c.segments[a].x2*n.scale,'" cy="')).call(G,c.segments[a].y2*n.scale,'" r="')).call(W,n.lcpr,'" fill="white" stroke-width="')).call(U,.2*n.lcpr,'" stroke="black" />')}for(y=0;y<c.holechildren.length;y++){b=s[c.holechildren[y]];for(a=0;a<b.segments.length;a++){var X,Z,V,J,Q,K,q,$,tt,et,it,nt,rt,ot,at,st,ct;if(b.segments[a].hasOwnProperty("x3")&&n.qcpr)l+=N()(X=N()(Z=N()(V='<circle cx="'.concat(b.segments[a].x2*n.scale,'" cy="')).call(V,b.segments[a].y2*n.scale,'" r="')).call(Z,n.qcpr,'" fill="cyan" stroke-width="')).call(X,.2*n.qcpr,'" stroke="black" />'),l+=N()(J=N()(Q=N()(K='<circle cx="'.concat(b.segments[a].x3*n.scale,'" cy="')).call(K,b.segments[a].y3*n.scale,'" r="')).call(Q,n.qcpr,'" fill="white" stroke-width="')).call(J,.2*n.qcpr,'" stroke="black" />'),l+=N()(q=N()($=N()(tt=N()(et='<line x1="'.concat(b.segments[a].x1*n.scale,'" y1="')).call(et,b.segments[a].y1*n.scale,'" x2="')).call(tt,b.segments[a].x2*n.scale,'" y2="')).call($,b.segments[a].y2*n.scale,'" stroke-width="')).call(q,.2*n.qcpr,'" stroke="cyan" />'),l+=N()(it=N()(nt=N()(rt=N()(ot='<line x1="'.concat(b.segments[a].x2*n.scale,'" y1="')).call(ot,b.segments[a].y2*n.scale,'" x2="')).call(rt,b.segments[a].x3*n.scale,'" y2="')).call(nt,b.segments[a].y3*n.scale,'" stroke-width="')).call(it,.2*n.qcpr,'" stroke="cyan" />');if(!b.segments[a].hasOwnProperty("x3")&&n.lcpr)l+=N()(at=N()(st=N()(ct='<circle cx="'.concat(b.segments[a].x2*n.scale,'" cy="')).call(ct,b.segments[a].y2*n.scale,'" r="')).call(st,n.lcpr,'" fill="white" stroke-width="')).call(at,.2*n.lcpr,'" stroke="black" />')}}}return l}},{key:"getsvgstring",value:function(t,e){var i,n,r;e=this.checkoptions(e);for(var o=t.width*e.scale,a=t.height*e.scale,s=N()(i="<svg ".concat(e.viewbox?N()(n='viewBox="0 0 '.concat(o," ")).call(n,a,'" '):N()(r='width="'.concat(o,'" height="')).call(r,a,'" '),'version="1.1" xmlns="http://www.w3.org/2000/svg" desc="Created with imagetracer.js version ')).call(i,this.versionnumber,'" >'),c=0;c<t.layers.length;c+=1)for(var l=0;l<t.layers[c].length;l+=1)t.layers[c][l].isholepath||(s+=this.svgpathstring(t,c,l,e));return s+="</svg>",s}},{key:"compareNumbers",value:function(t,e){return t-e}},{key:"torgbastr",value:function(t){var e,i,n;return N()(e=N()(i=N()(n="rgba(".concat(t.r,",")).call(n,t.g,",")).call(i,t.b,",")).call(e,t.a,")")}},{key:"tosvgcolorstr",value:function(t,e){var i,n,r,o,a,s,c;return N()(i=N()(n=N()(r=N()(o=N()(a=N()(s=N()(c='fill="rgb('.concat(t.r,",")).call(c,t.g,",")).call(s,t.b,')" stroke="rgb(')).call(a,t.r,",")).call(o,t.g,",")).call(r,t.b,')" stroke-width="')).call(n,e.strokewidth,'" opacity="')).call(i,t.a/255,'" ')}},{key:"appendSVGString",value:function(t,e){var i;e?(i=document.getElementById(e),i||(i=document.createElement("div"),i.id=e,document.body.appendChild(i))):(i=document.createElement("div"),document.body.appendChild(i)),i.innerHTML+=t}},{key:"blur",value:function(t,e,i){var n,r,o,a,s,c,l,u,h,f,d={width:t.width,height:t.height,data:[]};if(e=Math.floor(e),e<1)return t;e>5&&(e=5),i=Math.abs(i),i>1024&&(i=1024);var g=this.gks[e-1];for(r=0;r<t.height;r++)for(n=0;n<t.width;n++){for(c=0,l=0,u=0,h=0,f=0,o=-e;o<e+1;o++)n+o>0&&n+o<t.width&&(s=4*(r*t.width+n+o),c+=t.data[s]*g[o+e],l+=t.data[s+1]*g[o+e],u+=t.data[s+2]*g[o+e],h+=t.data[s+3]*g[o+e],f+=g[o+e]);s=4*(r*t.width+n),d.data[s]=Math.floor(c/f),d.data[s+1]=Math.floor(l/f),d.data[s+2]=Math.floor(u/f),d.data[s+3]=Math.floor(h/f)}var p=new Uint8ClampedArray(d.data);for(r=0;r<t.height;r++)for(n=0;n<t.width;n++){for(c=0,l=0,u=0,h=0,f=0,o=-e;o<e+1;o++)r+o>0&&r+o<t.height&&(s=4*((r+o)*t.width+n),c+=p[s]*g[o+e],l+=p[s+1]*g[o+e],u+=p[s+2]*g[o+e],h+=p[s+3]*g[o+e],f+=g[o+e]);s=4*(r*t.width+n),d.data[s]=Math.floor(c/f),d.data[s+1]=Math.floor(l/f),d.data[s+2]=Math.floor(u/f),d.data[s+3]=Math.floor(h/f)}for(r=0;r<t.height;r++)for(n=0;n<t.width;n++)s=4*(r*t.width+n),a=Math.abs(d.data[s]-t.data[s])+Math.abs(d.data[s+1]-t.data[s+1])+Math.abs(d.data[s+2]-t.data[s+2])+Math.abs(d.data[s+3]-t.data[s+3]),a>i&&(d.data[s]=t.data[s],d.data[s+1]=t.data[s+1],d.data[s+2]=t.data[s+2],d.data[s+3]=t.data[s+3]);return d}},{key:"loadImage",value:function(t,e,i){var n=new Image;i&&i.corsenabled&&(n.crossOrigin="Anonymous"),n.src=t,n.onload=function(){var t=document.createElement("canvas");t.width=n.width,t.height=n.height;var i=t.getContext("2d");i.drawImage(n,0,0),e(t)}}},{key:"getImgdata",value:function(t){var e=t.getContext("2d");return e.getImageData(0,0,t.width,t.height)}},{key:"drawLayers",value:function(t,e,i,n){var r,o,a,s,c,l;for(c in i=i||1,n?(l=document.getElementById(n),l||(l=document.createElement("div"),l.id=n,document.body.appendChild(l))):(l=document.createElement("div"),document.body.appendChild(l)),t)if(t.hasOwnProperty(c)){r=t[c][0].length,o=t[c].length;var u=document.createElement("canvas");u.width=r*i,u.height=o*i;var h=u.getContext("2d");for(s=0;s<o;s+=1)for(a=0;a<r;a+=1)h.fillStyle=this.torgbastr(e[t[c][s][a]%e.length]),h.fillRect(a*i,s*i,i,i);l.appendChild(u)}}}],[{key:"tracerDefaultOption",value:function(){return{pathomit:100,ltres:.1,qtres:1,scale:1,strokewidth:5,viewbox:!1,linefilter:!0,desc:!1,rightangleenhance:!1,pal:[{r:0,g:0,b:0,a:255},{r:255,g:255,b:255,a:255}]}}}]),t}(),rr={getActions:function(){return{main:this._mainAction(),shape:this._shapeAction(),crop:this._cropAction(),resize:this._resizeAction(),flip:this._flipAction(),rotate:this._rotateAction(),text:this._textAction(),mask:this._maskAction(),draw:this._drawAction(),icon:this._iconAction(),filter:this._filterAction(),history:this._historyAction()}},_mainAction:function(){var t=this,e=function(){"crop"===t.ui.submenu&&(t.stopDrawingMode(),t.ui.changeMenu("crop"))},i=function(e){"rotate"===t.ui.submenu&&t.ui.rotate.setRangeBarAngle("setAngle",e)},n=function(e){"filter"===t.ui.submenu&&ir()(t.ui).setFilterState(e)},r=function(t){return i(t),n(t),t},o=function(){var e=t._graphics.getZoomMode();t.stopDrawingMode(),e!==jt.ZOOM?(t.startDrawingMode(kt.ZOOM),t._graphics.startZoomInMode()):t._graphics.endZoomInMode()},a=function(){var e=t._graphics.getZoomMode();t.stopDrawingMode(),e!==jt.HAND?(t.startDrawingMode(kt.ZOOM),t._graphics.startHandMode()):t._graphics.endHandMode()},s=function(){ir()(t.ui)&&ir()(t.ui).initFilterCheckBoxState()};return H()({initLoadImage:function(i,n){return t.loadImageFromURL(i,n).then((function(n){e(),t.ui.initializeImgUrl=i,t.ui.resizeEditor({imageSize:n}),t.clearUndoStack(),t._invoker.fire(At.EXECUTE_COMMAND,Et.LOAD_IMAGE)}))},undo:function(){t.isEmptyUndoStack()||(e(),t.deactivateAll(),t.undo().then(r))},redo:function(){t.isEmptyRedoStack()||(e(),t.deactivateAll(),t.redo().then(r))},reset:function(){e(),t.loadImageFromURL(t.ui.initializeImgUrl,"resetImage").then((function(i){e(),s(),t.ui.resizeEditor({imageSize:i}),t.clearUndoStack(),t._initHistory()}))},delete:function(){t.ui.changeHelpButtonEnabled("delete",!1),e(),t.removeActiveObject(),t.activeObjectId=null},deleteAll:function(){e(),t.clearObjects(),t.ui.changeHelpButtonEnabled("delete",!1),t.ui.changeHelpButtonEnabled("deleteAll",!1)},load:function(i){re()||alert("This browser does not support file-api"),t.ui.initializeImgUrl=B().createObjectURL(i),t.loadImageFromFile(i).then((function(i){e(),s(),t.clearUndoStack(),t.ui.activeMenuEvent(),t.ui.resizeEditor({imageSize:i}),t._clearHistory(),t._invoker.fire(At.EXECUTE_COMMAND,Et.LOAD_IMAGE)}))["catch"]((function(t){return z().reject(t)}))},download:function(){var e,i,n,r=t.toDataURL(),o=t.getImageName();re()&&window.saveAs?(e=le(r),i=e.type.split("/")[1],o.split(".").pop()!==i&&(o+=".".concat(i)),saveAs(e,o)):(n=window.open(),n.document.body.innerHTML="<img src='".concat(r,"'>"))},history:function(e){t.ui.toggleHistoryMenu(e)},zoomIn:function(){t.ui.toggleZoomButtonStatus("zoomIn"),t.deactivateAll(),o()},zoomOut:function(){t._graphics.zoomOut()},hand:function(){t.ui.offZoomInButtonStatus(),t.ui.toggleZoomButtonStatus("hand"),t.deactivateAll(),a()}},this._commonAction())},_iconAction:function(){var t=this;return H()({changeColor:function(e){t.activeObjectId&&t.changeIconColor(t.activeObjectId,e)},addIcon:function(e,i){t.startDrawingMode("ICON"),t.setDrawingIcon(e,i)},cancelAddIcon:function(){t.ui.icon.clearIconType(),t.changeSelectableAll(!0),t.changeCursor("default"),t.stopDrawingMode()},registerDefaultIcons:function(e,i){var n={};n[e]=i,t.registerIcons(n)},registerCustomIcon:function(e,i){var n=new nr;n.imageToSVG(e,(function(e){var n=e.match(/path[^>]*d="([^"]*)"/),r=it(n,2),o=r[1],a={};a[i.name]=o,t.registerIcons(a),t.addIcon(i.name,{left:100,top:100})}),nr.tracerDefaultOption())}},this._commonAction())},_drawAction:function(){var t=this;return H()({setDrawMode:function(e,i){t.stopDrawingMode(),"free"===e?t.startDrawingMode("FREE_DRAWING",i):t.startDrawingMode("LINE_DRAWING",i)},setColor:function(e){t.setBrush({color:e})}},this._commonAction())},_maskAction:function(){var t=this;return H()({loadImageFromURL:function(e,i){return t.loadImageFromURL(t.toDataURL(),"FilterImage").then((function(){t.addImageObject(e).then((function(){B().revokeObjectURL(i)})),t._invoker.fire(At.EXECUTE_COMMAND,Et.LOAD_MASK_IMAGE)}))},applyFilter:function(){t.applyFilter("mask",{maskObjId:t.activeObjectId})}},this._commonAction())},_textAction:function(){var t=this;return H()({changeTextStyle:function(e,i){t.activeObjectId&&t.changeTextStyle(t.activeObjectId,e,i)}},this._commonAction())},_rotateAction:function(){var t=this;return H()({rotate:function(e,i){t.rotate(e,i),t.ui.resizeEditor(),t.ui.rotate.setRangeBarAngle("rotate",e)},setAngle:function(e,i){t.setAngle(e,i),t.ui.resizeEditor(),t.ui.rotate.setRangeBarAngle("setAngle",e)}},this._commonAction())},_shapeAction:function(){var t=this;return H()({changeShape:function(e,i){t.activeObjectId&&t.changeShape(t.activeObjectId,e,i)},setDrawingShape:function(e){t.setDrawingShape(e)}},this._commonAction())},_cropAction:function(){var t=this;return H()({crop:function(){var e=t.getCropzoneRect();e&&!Ae(e)&&t.crop(e).then((function(){t.stopDrawingMode(),t.ui.resizeEditor(),t.ui.changeMenu("crop"),t._invoker.fire(At.EXECUTE_COMMAND,Et.CROP)}))["catch"]((function(t){return z().reject(t)}))},cancel:function(){t.stopDrawingMode(),t.ui.changeMenu("crop")},preset:function(e){switch(e){case"preset-square":t.setCropzoneRect(1);break;case"preset-3-2":t.setCropzoneRect(1.5);break;case"preset-4-3":t.setCropzoneRect(4/3);break;case"preset-5-4":t.setCropzoneRect(5/4);break;case"preset-7-5":t.setCropzoneRect(1.4);break;case"preset-16-9":t.setCropzoneRect(16/9);break;default:t.setCropzoneRect(),t.ui.crop.changeApplyButtonStatus(!1);break}}},this._commonAction())},_resizeAction:function(){var t=this;return H()({getCurrentDimensions:function(){return t._graphics.getCurrentDimensions()},preview:function(e,i,n){var r=t._graphics.getCurrentDimensions(),o=function(){return r.width/r.height},a={};switch(e){case"width":a.width=i,a.height=n?i/o():r.height;break;case"height":a.height=i,a.width=n?i*o():r.width;break;default:a=r}t._graphics.resize(a).then((function(){t.ui.resizeEditor()})),n&&(t.ui.resize.setWidthValue(a.width),t.ui.resize.setHeightValue(a.height))},lockAspectRatio:function(e,i,n){var r=t._graphics.getCurrentDimensions(),o=r.width,a=r.height,s=o/a;if(e)if(o>a){var c=n/s,l=i*s;t.ui.resize.setLimit({minWidth:l>i?l:i,minHeight:i,maxWidth:n,maxHeight:c<n?c:n})}else{var u=n*s,h=i/s;t.ui.resize.setLimit({minWidth:i,minHeight:h>i?h:i,maxWidth:u<n?u:n,maxHeight:n})}else t.ui.resize.setLimit({minWidth:i,minHeight:i,maxWidth:n,maxHeight:n})},resize:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;e||(e=t._graphics.getCurrentDimensions()),t.resize(e).then((function(){t._graphics.setOriginalDimensions(e),t.stopDrawingMode(),t.ui.resizeEditor(),t.ui.changeMenu("resize")}))["catch"]((function(t){return z().reject(t)}))},reset:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=t._graphics.getOriginalDimensions();t.ui.resize.setWidthValue(i.width,!0),t.ui.resize.setHeightValue(i.height,!0),t._graphics.resize(i).then((function(){e||(t.stopDrawingMode(),t.ui.resizeEditor(),t.ui.changeMenu("resize"))}))}},this._commonAction())},_flipAction:function(){var t=this;return H()({flip:function(e){return t[e]()}},this._commonAction())},_filterAction:function(){var t=this;return H()({applyFilter:function(e,i,n,r){e?t.applyFilter(i,n,r):t.hasFilter(i)&&t.removeFilter(i)}},this._commonAction())},setReAction:function(){var t=this;this.on({undoStackChanged:function(e){e?(t.ui.changeHelpButtonEnabled("undo",!0),t.ui.changeHelpButtonEnabled("reset",!0)):(t.ui.changeHelpButtonEnabled("undo",!1),t.ui.changeHelpButtonEnabled("reset",!1)),t.ui.resizeEditor()},redoStackChanged:function(e){e?t.ui.changeHelpButtonEnabled("redo",!0):t.ui.changeHelpButtonEnabled("redo",!1),t.ui.resizeEditor()},objectActivated:function(e){var i,r;t.activeObjectId=e.id,t.ui.changeHelpButtonEnabled("delete",!0),t.ui.changeHelpButtonEnabled("deleteAll",!0),"cropzone"===e.type?t.ui.crop.changeApplyButtonStatus(!0):n()(i=["rect","circle","triangle"]).call(i,e.type)>-1?(t.stopDrawingMode(),"shape"!==t.ui.submenu&&t.ui.changeMenu("shape",!1,!1),t.ui.shape.setShapeStatus({strokeColor:e.stroke,strokeWidth:e.strokeWidth,fillColor:lt()(e)}),t.ui.shape.setMaxStrokeValue(Math.min(e.width,e.height))):"path"===e.type||"line"===e.type?"draw"!==t.ui.submenu&&(t.ui.changeMenu("draw",!1,!1),t.ui.draw.changeStandbyMode()):n()(r=["i-text","text"]).call(r,e.type)>-1?("text"!==t.ui.submenu&&t.ui.changeMenu("text",!1,!1),t.ui.text.setTextStyleStateOnAction(e)):"icon"===e.type&&(t.stopDrawingMode(),"icon"!==t.ui.submenu&&t.ui.changeMenu("icon",!1,!1),t.ui.icon.setIconPickerColor(lt()(e)))},addText:function(e){var i=t.ui.text,n=i.textColor,r=i.fontSize,o=i.fontStyle,a=i.fontWeight,s=i.underline,c="Noto Sans";t.addText("Double Click",{position:e.originPosition,styles:{fill:n,fontSize:r,fontFamily:c,fontStyle:o,fontWeight:a,underline:s}}).then((function(){t.changeCursor("default")}))},addObjectAfter:function(e){var i;"icon"===e.type?t.ui.icon.changeStandbyMode():n()(i=["rect","circle","triangle"]).call(i,e.type)>-1&&(t.ui.shape.setMaxStrokeValue(Math.min(e.width,e.height)),t.ui.shape.changeStandbyMode())},objectScaled:function(e){var i,r;if(n()(i=["i-text","text"]).call(i,e.type)>-1)t.ui.text.fontSize=ie(e.fontSize);else if(n()(r=["rect","circle","triangle"]).call(r,e.type)>=0){var o=e.width,a=e.height,s=t.ui.shape.getStrokeValue();o<s&&t.ui.shape.setStrokeValue(o),a<s&&t.ui.shape.setStrokeValue(a)}},selectionCleared:function(){t.activeObjectId=null,"text"===t.ui.submenu?t.changeCursor("text"):ye(["draw","crop","resize"],t.ui.submenu)||t.stopDrawingMode()}})},_historyAction:function(){var t=this;return{undo:function(e){return t.undo(e)},redo:function(e){return t.redo(e)}}},_commonAction:function(){var t,e,i,n,r=this,o=kt.TEXT,a=kt.CROPPER,s=kt.SHAPE,c=kt.ZOOM,l=kt.RESIZE;return{modeChange:function(t){switch(t){case Ot.TEXT:r._changeActivateMode(o);break;case Ot.CROP:r.startDrawingMode(a);break;case Ot.SHAPE:r._changeActivateMode(s),r.setDrawingShape(r.ui.shape.type,r.ui.shape.options);break;case Ot.ZOOM:r.startDrawingMode(c);break;case Ot.RESIZE:r.startDrawingMode(l);break;default:break}},deactivateAll:j()(t=this.deactivateAll).call(t,this),changeSelectableAll:j()(e=this.changeSelectableAll).call(e,this),discardSelection:j()(i=this.discardSelection).call(i,this),stopDrawingMode:j()(n=this.stopDrawingMode).call(n,this)}},mixin:function(t){H()(t.prototype,this)}},or=r(602),ar=r.n(or),sr=r(5573),cr=r.n(sr),lr=function(){function t(e,i){D(this,t),this.name=e,this.graphics=i}return k(t,[{key:"fire",value:function(){for(var t=this.graphics,e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return this.graphics.fire.apply(t,i)}},{key:"setCanvasImage",value:function(t,e){this.graphics.setCanvasImage(t,e)}},{key:"getCanvasElement",value:function(){return this.graphics.getCanvasElement()}},{key:"getCanvas",value:function(){return this.graphics.getCanvas()}},{key:"getCanvasImage",value:function(){return this.graphics.getCanvasImage()}},{key:"getImageName",value:function(){return this.graphics.getImageName()}},{key:"getEditor",value:function(){return this.graphics.getEditor()}},{key:"getName",value:function(){return this.name}},{key:"setImageProperties",value:function(t,e){this.graphics.setImageProperties(t,e)}},{key:"setCanvasCssDimension",value:function(t){this.graphics.setCanvasCssDimension(t)}},{key:"setCanvasBackstoreDimension",value:function(t){this.graphics.setCanvasBackstoreDimension(t)}},{key:"adjustCanvasDimension",value:function(){this.graphics.adjustCanvasDimension()}},{key:"adjustCanvasDimensionBase",value:function(){this.graphics.adjustCanvasDimensionBase()}}]),t}(),ur=lr;function hr(t){var e=fr();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function fr(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var dr={padding:0,crossOrigin:"Anonymous"},gr=function(t){oi(i,t);var e=hr(i);function i(t){return D(this,i),e.call(this,Mt.IMAGE_LOADER,t)}return k(i,[{key:"load",value:function(t,e){var i,n=this;if(t||e)i=this._setBackgroundImage(e).then((function(e){return n.setCanvasImage(t,e),n.adjustCanvasDimension(),e}));else{var r=this.getCanvas();r.backgroundImage=null,r.renderAll(),i=new(z())((function(t){n.setCanvasImage("",null),t()}))}return i}},{key:"_setBackgroundImage",value:function(t){var e=this;return t?new(z())((function(i,n){var r=e.getCanvas();r.setBackgroundImage(t,(function(){var t=r.backgroundImage;t&&t.getElement()?i(t):n(Pt.loadingImageFailed)}),dr)})):z().reject(Pt.loadImage)}}]),i}(ur),pr=gr,vr="tl",mr="tr",yr="mt",br="ml",_r="mr",xr="mb",Cr="bl",Ir="br",Mr=[vr,mr,yr,br,_r,xr,Cr,Ir],Sr=function(){};function wr(t){return n()(Mr).call(Mr,t)>=0}function Tr(t,e){return t>e?"width":"height"}var Ar=F.fabric.util.createClass(F.fabric.Rect,{initialize:function(t,e,i){e=H()(e,i),e.type="cropzone",this.callSuper("initialize",e),this._addEventHandler(),this.canvas=t,this.options=e},canvasEventDelegation:function(t){var e,i="unregistered",r=this.canvasEventTrigger[t]!==Sr;return r?i="registered":n()(e=[At.OBJECT_MOVED,At.OBJECT_SCALED]).call(e,t)<0&&(i="none"),i},canvasEventRegister:function(t,e){this.canvasEventTrigger[t]=e},_addEventHandler:function(){var t,e,i,n,r;this.canvasEventTrigger=(t={},A(t,At.OBJECT_MOVED,Sr),A(t,At.OBJECT_SCALED,Sr),t),this.on({moving:j()(e=this._onMoving).call(e,this),scaling:j()(i=this._onScaling).call(i,this)}),F.fabric.util.addListener(document,"keydown",j()(n=this._onKeyDown).call(n,this)),F.fabric.util.addListener(document,"keyup",j()(r=this._onKeyUp).call(r,this))},_renderCropzone:function(t){var e=7,i=7,n=this.flipX?-1:1,r=this.flipY?-1:1,o=n/this.scaleX,a=r/this.scaleY;t.scale(o,a),this._fillOuterRect(t,"rgba(0, 0, 0, 0.5)"),this.options.lineWidth?(this._fillInnerRect(t),this._strokeBorder(t,"rgb(255, 255, 255)",{lineWidth:this.options.lineWidth})):(this._strokeBorder(t,"rgb(0, 0, 0)",{lineDashWidth:e}),this._strokeBorder(t,"rgb(255, 255, 255)",{lineDashWidth:e,lineDashOffset:i})),t.scale(1/o,1/a)},_render:function(t){this.callSuper("_render",t),this._renderCropzone(t)},_fillOuterRect:function(t,e){var i=this._getCoordinates(),n=i.x,r=i.y;t.save(),t.fillStyle=e,t.beginPath(),t.moveTo(n[0]-1,r[0]-1),t.lineTo(n[3]+1,r[0]-1),t.lineTo(n[3]+1,r[3]+1),t.lineTo(n[0]-1,r[3]+1),t.lineTo(n[0]-1,r[0]-1),t.closePath(),t.moveTo(n[1],r[1]),t.lineTo(n[1],r[2]),t.lineTo(n[2],r[2]),t.lineTo(n[2],r[1]),t.lineTo(n[1],r[1]),t.closePath(),lt()(t).call(t),t.restore()},_fillInnerRect:function(t){var e=this._getCoordinates(),i=e.x,n=e.y,r=this._caculateInnerPosition(i,(i[2]-i[1])/3),o=this._caculateInnerPosition(n,(n[2]-n[1])/3);t.save(),t.strokeStyle="rgba(255, 255, 255, 0.7)",t.lineWidth=this.options.lineWidth,t.beginPath(),t.moveTo(r[0],o[1]),t.lineTo(r[3],o[1]),t.moveTo(r[0],o[2]),t.lineTo(r[3],o[2]),t.moveTo(r[1],o[0]),t.lineTo(r[1],o[3]),t.moveTo(r[2],o[0]),t.lineTo(r[2],o[3]),t.stroke(),t.closePath(),t.restore()},_caculateInnerPosition:function(t,e){var i=[];return i[0]=t[1],i[1]=t[1]+e,i[2]=t[1]+2*e,i[3]=t[2],i},_getCoordinates:function(){var t,e,i=this.canvas,n=this.width,r=this.height,o=this.left,a=this.top,s=n/2,c=r/2,l=i.getHeight(),u=i.getWidth();return{x:Ve()(t=[-(s+o),-s,s,s+(u-o-n)]).call(t,Math.ceil),y:Ve()(e=[-(c+a),-c,c,c+(l-a-r)]).call(e,Math.ceil)}},_strokeBorder:function(t,e,i){var n=i.lineDashWidth,r=i.lineDashOffset,o=i.lineWidth,a=this.width/2,s=this.height/2;t.save(),t.strokeStyle=e,t.setLineDash&&t.setLineDash([n,n]),r&&(t.lineDashOffset=r),o&&(t.lineWidth=o),t.beginPath(),t.moveTo(-a,-s),t.lineTo(a,-s),t.lineTo(a,s),t.lineTo(-a,s),t.lineTo(-a,-s),t.stroke(),t.restore()},_onMoving:function(){var t=this.height,e=this.width,i=this.left,n=this.top,r=this.canvas.getWidth()-e,o=this.canvas.getHeight()-t;this.left=$t(i,0,r),this.top=$t(n,0,o),this.canvasEventTrigger[At.OBJECT_MOVED](this)},_onScaling:function(t){var e=t.transform.corner,i=this.canvas.getPointer(t.e),n=this._calcScalingSizeFromPointer(i,e);this.scale(1).set(n),this.canvasEventTrigger[At.OBJECT_SCALED](this)},_calcScalingSizeFromPointer:function(t,e){var i=wr(e);return i&&this._resizeCropZone(t,e)},adjustRatioCropzoneSize:function(t){var e=t.width,i=t.height,n=t.leftMaker,r=t.topMaker,o=t.maxWidth,a=t.maxHeight,s=t.scaleTo;if(e=o?$t(e,1,o):e,i=a?$t(i,1,a):i,!this.presetRatio)return this._withShiftKey&&(e>i?i=e:i>e&&(e=i)),{width:e,height:i,left:n(e),top:r(i)};"width"===s?i=e/this.presetRatio:e=i*this.presetRatio;var c=Math.min(o/e,a/i);if(c<=1){var l,u=Ve()(l=[e,i]).call(l,(function(t){return t*c})),h=it(u,2);e=h[0],i=h[1]}return{width:e,height:i,left:n(e),top:r(i)}},_getCropzoneRectInfo:function(){var t=this.canvas,e=t.width,i=t.height,n=this.getBoundingRect(!1,!0),r=n.top,o=n.left,a=n.width,s=n.height;return{rectTop:r,rectLeft:o,rectWidth:a,rectHeight:s,rectRight:o+a,rectBottom:r+s,canvasWidth:e,canvasHeight:i}},_resizeCropZone:function(t,e){var i=t.x,n=t.y,r=this._getCropzoneRectInfo(),o=r.rectWidth,a=r.rectHeight,s=r.rectTop,c=r.rectLeft,l=r.rectBottom,u=r.rectRight,h=r.canvasWidth,f=r.canvasHeight,d={tl:{width:u-i,height:l-n,leftMaker:function(t){return u-t},topMaker:function(t){return l-t},maxWidth:u,maxHeight:l,scaleTo:Tr(c-i,s-n)},tr:{width:i-c,height:l-n,leftMaker:function(){return c},topMaker:function(t){return l-t},maxWidth:h-c,maxHeight:l,scaleTo:Tr(i-u,s-n)},mt:{width:o,height:l-n,leftMaker:function(){return c},topMaker:function(t){return l-t},maxWidth:h-c,maxHeight:l,scaleTo:"height"},ml:{width:u-i,height:a,leftMaker:function(t){return u-t},topMaker:function(){return s},maxWidth:u,maxHeight:f-s,scaleTo:"width"},mr:{width:i-c,height:a,leftMaker:function(){return c},topMaker:function(){return s},maxWidth:h-c,maxHeight:f-s,scaleTo:"width"},mb:{width:o,height:n-s,leftMaker:function(){return c},topMaker:function(){return s},maxWidth:h-c,maxHeight:f-s,scaleTo:"height"},bl:{width:u-i,height:n-s,leftMaker:function(t){return u-t},topMaker:function(){return s},maxWidth:u,maxHeight:f-s,scaleTo:Tr(c-i,n-l)},br:{width:i-c,height:n-s,leftMaker:function(){return c},topMaker:function(){return s},maxWidth:h-c,maxHeight:f-s,scaleTo:Tr(i-u,n-l)}};return this.adjustRatioCropzoneSize(d[e])},isValid:function(){return this.left>=0&&this.top>=0&&this.width>0&&this.height>0},_onKeyDown:function(t){var e=t.keyCode;e===Lt.SHIFT&&(this._withShiftKey=!0)},_onKeyUp:function(t){var e=t.keyCode;e===Lt.SHIFT&&(this._withShiftKey=!1)}}),Dr=Ar;function Er(t){var e=kr();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function kr(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var Or=10,jr={presetRatio:null,top:-10,left:-10,height:1,width:1},Lr=function(t){oi(i,t);var e=Er(i);function i(t){var n,r,o,a,s,c;return D(this,i),c=e.call(this,Mt.CROPPER,t),c._cropzone=null,c._startX=null,c._startY=null,c._withShiftKey=!1,c._listeners={keydown:j()(n=c._onKeyDown).call(n,ci(c)),keyup:j()(r=c._onKeyUp).call(r,ci(c)),mousedown:j()(o=c._onFabricMouseDown).call(o,ci(c)),mousemove:j()(a=c._onFabricMouseMove).call(a,ci(c)),mouseup:j()(s=c._onFabricMouseUp).call(s,ci(c))},c}return k(i,[{key:"start",value:function(){if(!this._cropzone){var t=this.getCanvas();t.forEachObject((function(t){t.evented=!1})),this._cropzone=new Dr(t,H()({left:0,top:0,width:.5,height:.5,strokeWidth:0,cornerSize:10,cornerColor:"black",fill:"transparent"},wt,this.graphics.cropSelectionStyle)),t.discardActiveObject(),t.add(this._cropzone),t.on("mouse:down",this._listeners.mousedown),t.selection=!1,t.defaultCursor="crosshair",F.fabric.util.addListener(document,"keydown",this._listeners.keydown),F.fabric.util.addListener(document,"keyup",this._listeners.keyup)}}},{key:"end",value:function(){var t=this.getCanvas(),e=this._cropzone;e&&(t.remove(e),t.selection=!0,t.defaultCursor="default",t.off("mouse:down",this._listeners.mousedown),t.forEachObject((function(t){t.evented=!0})),this._cropzone=null,F.fabric.util.removeListener(document,"keydown",this._listeners.keydown),F.fabric.util.removeListener(document,"keyup",this._listeners.keyup))}},{key:"changeVisibility",value:function(t){this._cropzone&&this._cropzone.set({visible:t})}},{key:"_onFabricMouseDown",value:function(t){var e=this.getCanvas();if(!t.target){e.selection=!1;var i=e.getPointer(t.e);this._startX=i.x,this._startY=i.y,e.on({"mouse:move":this._listeners.mousemove,"mouse:up":this._listeners.mouseup})}}},{key:"_onFabricMouseMove",value:function(t){var e=this.getCanvas(),i=e.getPointer(t.e),n=i.x,r=i.y,o=this._cropzone;Math.abs(n-this._startX)+Math.abs(r-this._startY)>Or&&(e.remove(o),o.set(this._calcRectDimensionFromPoint(n,r,o.presetRatio)),e.add(o),e.setActiveObject(o))}},{key:"_calcRectDimensionFromPoint",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=this.getCanvas(),r=n.getWidth(),o=n.getHeight(),a=this._startX,s=this._startY,c=$t(t,0,a),l=$t(e,0,s),u=$t(t,a,r)-c,h=$t(e,s,o)-l;return this._withShiftKey&&!i?(u>h?h=u:h>u&&(u=h),a>=t&&(c=a-u),s>=e&&(l=s-h)):i&&(h=u/i,a>=t&&(c=$t(a-u,0,r)),s>=e&&(l=$t(s-h,0,o)),l+h>o&&(h=o-l,u=h*i,a>=t&&(c=$t(a-u,0,r)),s>=e&&(l=$t(s-h,0,o)))),{left:c,top:l,width:u,height:h}}},{key:"_onFabricMouseUp",value:function(){var t=this._cropzone,e=this._listeners,i=this.getCanvas();i.setActiveObject(t),i.off({"mouse:move":e.mousemove,"mouse:up":e.mouseup})}},{key:"getCroppedImageData",value:function(t){var e=this.getCanvas(),i=e.contains(this._cropzone);if(!t)return null;i&&e.remove(this._cropzone);var n={imageName:this.getImageName(),url:e.toDataURL(t)};return i&&e.add(this._cropzone),n}},{key:"getCropzoneRect",value:function(){var t=this._cropzone;return t.isValid()?{left:t.left,top:t.top,width:t.width,height:t.height}:null}},{key:"setCropzoneRect",value:function(t){var e=this.getCanvas(),i=this._cropzone;e.discardActiveObject(),e.selection=!1,e.remove(i),i.set(t?this._getPresetPropertiesForCropSize(t):jr),e.add(i),e.selection=!0,t&&e.setActiveObject(i)}},{key:"_getPresetPropertiesForCropSize",value:function(t){var e,i,n=this.getCanvas(),r=n.getWidth(),o=n.getHeight(),a=r>=o?r:o,s=function(t,e){return t>e?e/t:1},c=a*t,l=a,u=s(c,r),h=Ve()(e=[c,l]).call(e,(function(t){return t*u})),f=it(h,2);c=f[0],l=f[1];var d=s(l,o),g=Ve()(i=[c,l]).call(i,(function(t){return ue(t*d)})),p=it(g,2);return c=p[0],l=p[1],{presetRatio:t,top:(o-l)/2,left:(r-c)/2,width:c,height:l}}},{key:"_onKeyDown",value:function(t){t.keyCode===Lt.SHIFT&&(this._withShiftKey=!0)}},{key:"_onKeyUp",value:function(t){t.keyCode===Lt.SHIFT&&(this._withShiftKey=!1)}}]),i}(ur),Nr=Lr;function Pr(t){var e=zr();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function zr(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var Rr=function(t){oi(i,t);var e=Pr(i);function i(t){return D(this,i),e.call(this,Mt.FLIP,t)}return k(i,[{key:"getCurrentSetting",value:function(){var t=this.getCanvasImage();return{flipX:t.flipX,flipY:t.flipY}}},{key:"set",value:function(t){var e=this.getCurrentSetting(),i=e.flipX!==t.flipX,n=e.flipY!==t.flipY;return i||n?(H()(e,t),this.setImageProperties(e,!0),this._invertAngle(i,n),this._flipObjects(i,n),z().resolve({flipX:e.flipX,flipY:e.flipY,angle:this.getCanvasImage().angle})):z().reject(Pt.flip)}},{key:"_invertAngle",value:function(t,e){var i=this.getCanvasImage(),n=i.angle;t&&(n*=-1),e&&(n*=-1),i.rotate(We()(n)).setCoords()}},{key:"_flipObjects",value:function(t,e){var i=this.getCanvas();t&&i.forEachObject((function(t){t.set({angle:We()(-1*t.angle),flipX:!t.flipX,left:i.width-t.left}).setCoords()})),e&&i.forEachObject((function(t){t.set({angle:We()(-1*t.angle),flipY:!t.flipY,top:i.height-t.top}).setCoords()})),i.renderAll()}},{key:"reset",value:function(){return this.set({flipX:!1,flipY:!1})}},{key:"flipX",value:function(){var t=this.getCurrentSetting();return this.set({flipX:!t.flipX,flipY:t.flipY})}},{key:"flipY",value:function(){var t=this.getCurrentSetting();return this.set({flipX:t.flipX,flipY:!t.flipY})}}]),i}(ur),Br=Rr;function Fr(t){var e=Yr();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function Yr(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var Hr=function(t){oi(i,t);var e=Fr(i);function i(t){return D(this,i),e.call(this,Mt.ROTATION,t)}return k(i,[{key:"getCurrentAngle",value:function(){return this.getCanvasImage().angle}},{key:"setAngle",value:function(t){var e=this.getCurrentAngle()%360;t%=360;var i=this.getCanvasImage(),n=i.getCenterPoint();i.set({angle:t}).setCoords(),this.adjustCanvasDimension();var r=i.getCenterPoint();return this._rotateForEachObject(n,r,t-e),z().resolve(t)}},{key:"_rotateForEachObject",value:function(t,e,i){var n=this.getCanvas(),r={x:t.x-e.x,y:t.y-e.y};n.forEachObject((function(e){var n=e.getCenterPoint(),o=F.fabric.util.degreesToRadians(i),a=F.fabric.util.rotatePoint(n,t,o);e.set({left:a.x-r.x,top:a.y-r.y,angle:(e.angle+i)%360}),e.setCoords()})),n.renderAll()}},{key:"rotate",value:function(t){var e=this.getCurrentAngle();return this.setAngle(e+t)}}]),i}(ur),Ur=Hr;function Wr(t){var e=Gr();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function Gr(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var Xr=function(t){oi(i,t);var e=Wr(i);function i(t){var n;return D(this,i),n=e.call(this,Mt.FREE_DRAWING,t),n.width=12,n.oColor=new F.fabric.Color("rgba(0, 0, 0, 0.5)"),n}return k(i,[{key:"start",value:function(t){var e=this.getCanvas();e.isDrawingMode=!0,this.setBrush(t)}},{key:"setBrush",value:function(t){var e=this.getCanvas().freeDrawingBrush;t=t||{},this.width=t.width||this.width,t.color&&(this.oColor=new F.fabric.Color(t.color)),e.width=this.width,e.color=this.oColor.toRgba()}},{key:"end",value:function(){var t=this.getCanvas();t.isDrawingMode=!1}}]),i}(ur),Zr=Xr,Vr=30,Jr=2.7,Qr=1.7,Kr=180,qr=F.fabric.util.createClass(F.fabric.Line,{type:"line",initialize:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.callSuper("initialize",t,e),this.arrowType=e.arrowType},_render:function(t){var e=this.calcLinePoints(),i=e.x1,n=e.y1,r=e.x2,o=e.y2,a={fromX:i,fromY:n,toX:r,toY:o};this.ctx=t,t.lineWidth=this.strokeWidth,this._renderBasicLinePath(a),this._drawDecoratorPath(a),this._renderStroke(t)},_renderBasicLinePath:function(t){var e=t.fromX,i=t.fromY,n=t.toX,r=t.toY;this.ctx.beginPath(),this.ctx.moveTo(e,i),this.ctx.lineTo(n,r)},_drawDecoratorPath:function(t){this._drawDecoratorPathType("head",t),this._drawDecoratorPathType("tail",t)},_drawDecoratorPathType:function(t,e){switch(this.arrowType[t]){case"triangle":this._drawTrianglePath(t,e);break;case"chevron":this._drawChevronPath(t,e);break;default:break}},_drawTrianglePath:function(t,e){var i=this.ctx.lineWidth*Qr;this._drawChevronPath(t,e,i),this.ctx.closePath()},_drawChevronPath:function(t,e,i){var n=this,r=e.fromX,o=e.fromY,a=e.toX,s=e.toY,c=this.ctx;i||(i=this.ctx.lineWidth*Jr);var l="head"===t?[r,o]:[a,s],u=it(l,2),h=u[0],f=u[1],d="head"===t?[a,s]:[r,o],g=it(d,2),p=g[0],v=g[1],m=Math.atan2(v-f,p-h)*Kr/Math.PI,y=function(t){return n.getRotatePosition(i,t,{x:h,y:f})};c.moveTo.apply(c,w(y(m+Vr))),c.lineTo(h,f),c.lineTo.apply(c,w(y(m-Vr)))},getRotatePosition:function(t,e,i){var n=e*Math.PI/Kr,r=i.x,o=i.y;return[t*Math.cos(n)+r,t*Math.sin(n)+o]}}),$r=qr;function to(t){var e=eo();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function eo(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var io=function(t){oi(i,t);var e=to(i);function i(t){var n,r,o,a;return D(this,i),a=e.call(this,Mt.LINE,t),a._width=12,a._oColor=new F.fabric.Color("rgba(0, 0, 0, 0.5)"),a._listeners={mousedown:j()(n=a._onFabricMouseDown).call(n,ci(a)),mousemove:j()(r=a._onFabricMouseMove).call(r,ci(a)),mouseup:j()(o=a._onFabricMouseUp).call(o,ci(a))},a}return k(i,[{key:"setHeadOption",value:function(t){var e=t.arrowType,i=void 0===e?{head:null,tail:null}:e;this._arrowType=i}},{key:"start",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getCanvas();e.defaultCursor="crosshair",e.selection=!1,this.setHeadOption(t),this.setBrush(t),e.forEachObject((function(t){t.set({evented:!1})})),e.on({"mouse:down":this._listeners.mousedown})}},{key:"setBrush",value:function(t){var e=this.getCanvas().freeDrawingBrush;t=t||{},this._width=t.width||this._width,t.color&&(this._oColor=new F.fabric.Color(t.color)),e.width=this._width,e.color=this._oColor.toRgba()}},{key:"end",value:function(){var t=this.getCanvas();t.defaultCursor="default",t.selection=!0,t.forEachObject((function(t){t.set({evented:!0})})),t.off("mouse:down",this._listeners.mousedown)}},{key:"_onFabricMouseDown",value:function(t){var e=this.getCanvas(),i=e.getPointer(t.e),n=i.x,r=i.y,o=[n,r,n,r];this._line=new $r(o,{stroke:this._oColor.toRgba(),strokeWidth:this._width,arrowType:this._arrowType,evented:!1}),this._line.set(Nt.SELECTION_STYLE),e.add(this._line),e.on({"mouse:move":this._listeners.mousemove,"mouse:up":this._listeners.mouseup}),this.fire(At.ADD_OBJECT,this._createLineEventObjectProperties())}},{key:"_onFabricMouseMove",value:function(t){var e=this.getCanvas(),i=e.getPointer(t.e);this._line.set({x2:i.x,y2:i.y}),this._line.setCoords(),e.renderAll()}},{key:"_onFabricMouseUp",value:function(){var t=this.getCanvas();this.fire(At.OBJECT_ADDED,this._createLineEventObjectProperties()),this._line=null,t.off({"mouse:move":this._listeners.mousemove,"mouse:up":this._listeners.mouseup})}},{key:"_createLineEventObjectProperties",value:function(){var t=this.graphics.createObjectProperties(this._line),e=this._line,i=e.x1,n=e.x2,r=e.y1,o=e.y2;return H()({},t,{startPosition:{x:i,y:r},endPosition:{x:n,y:o}})}}]),i}(ur),no=io;function ro(t){var e=oo();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function oo(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var ao={fill:"#000000",left:0,top:0},so={fill:"#000000",fontStyle:"normal",fontWeight:"normal",textAlign:"tie-text-align-left",underline:!1},co=500,lo=function(t){oi(i,t);var e=ro(i);function i(t){var n,r,o,a,s,c;return D(this,i),c=e.call(this,Mt.TEXT,t),c._defaultStyles=ao,c._isSelected=!1,c._selectedObj={},c._editingObj={},c._listeners={mousedown:j()(n=c._onFabricMouseDown).call(n,ci(c)),select:j()(r=c._onFabricSelect).call(r,ci(c)),selectClear:j()(o=c._onFabricSelectClear).call(o,ci(c)),scaling:j()(a=c._onFabricScaling).call(a,ci(c)),textChanged:j()(s=c._onFabricTextChanged).call(s,ci(c))},c._textarea=null,c._ratio=1,c._lastClickTime=(new Date).getTime(),c._editingObjInfos={},c.isPrevEditing=!1,c}return k(i,[{key:"start",value:function(){var t=this,e=this.getCanvas();e.selection=!1,e.defaultCursor="text",e.on({"mouse:down":this._listeners.mousedown,"selection:created":this._listeners.select,"selection:updated":this._listeners.select,"before:selection:cleared":this._listeners.selectClear,"object:scaling":this._listeners.scaling,"text:changed":this._listeners.textChanged}),e.forEachObject((function(e){"i-text"===e.type&&t.adjustOriginPosition(e,"start")})),this.setCanvasRatio()}},{key:"end",value:function(){var t=this,e=this.getCanvas();e.selection=!0,e.defaultCursor="default",e.forEachObject((function(i){"i-text"===i.type&&(""===i.text?e.remove(i):t.adjustOriginPosition(i,"end"))})),e.off({"mouse:down":this._listeners.mousedown,"selection:created":this._listeners.select,"selection:updated":this._listeners.select,"before:selection:cleared":this._listeners.selectClear,"object:selected":this._listeners.select,"object:scaling":this._listeners.scaling,"text:changed":this._listeners.textChanged})}},{key:"adjustOriginPosition",value:function(t,e){var i="center",n="center";"start"===e&&(i="left",n="top");var r=t.getPointByOrigin(i,n),o=r.x,a=r.y;t.set({left:o,top:a,originX:i,originY:n}),t.setCoords()}},{key:"add",value:function(t,e){var i=this;return new(z())((function(n){var r,o=i.getCanvas(),a=null,s=Nt.SELECTION_STYLE,c=i._defaultStyles;i._setInitPos(e.position),e.styles&&(c=H()(c,e.styles)),xn()(e.autofocus)||(e.autofocus=!0),a=new F.fabric.IText(t,c),s=H()({},s,{originX:"left",originY:"top"}),a.set(s),a.on({mouseup:j()(r=i._onFabricMouseUp).call(r,i)}),o.add(a),e.autofocus&&(a.enterEditing(),a.selectAll()),o.getActiveObject()||o.setActiveObject(a),i.isPrevEditing=!0,n(i.graphics.createObjectProperties(a))}))}},{key:"change",value:function(t,e){var i=this;return new(z())((function(n){t.set("text",e),i.getCanvas().renderAll(),n()}))}},{key:"setStyle",value:function(t,e){var i=this;return new(z())((function(n){X()(e,(function(i,n){t[n]===i&&"fontSize"!==n&&(e[n]=so[n]||"")}),i),"textDecoration"in e&&H()(e,i._getTextDecorationAdaptObject(e.textDecoration)),t.set(e),i.getCanvas().renderAll(),n()}))}},{key:"getText",value:function(t){return t.text}},{key:"setSelectedInfo",value:function(t,e){this._selectedObj=t,this._isSelected=e}},{key:"isSelected",value:function(){return this._isSelected}},{key:"getSelectedObj",value:function(){return this._selectedObj}},{key:"setCanvasRatio",value:function(){var t=this.getCanvasElement(),e=ot()(t.style.maxWidth,10),i=t.width;this._ratio=i/e}},{key:"getCanvasRatio",value:function(){return this._ratio}},{key:"_getTextDecorationAdaptObject",value:function(t){return{underline:"underline"===t,linethrough:"line-through"===t,overline:"overline"===t}}},{key:"_setInitPos",value:function(t){t=t||this.getCanvasImage().getCenterPoint(),this._defaultStyles.left=t.x,this._defaultStyles.top=t.y}},{key:"_onInput",value:function(){var t=this.getCanvasRatio(),e=this._editingObj,i=this._textarea.style;i.width="".concat(Math.ceil(e.width/t),"px"),i.height="".concat(Math.ceil(e.height/t),"px")}},{key:"_onKeyDown",value:function(){var t=this,e=this.getCanvasRatio(),i=this._editingObj,n=this._textarea.style;p()((function(){i.text(t._textarea.value),n.width="".concat(Math.ceil(i.width/e),"px"),n.height="".concat(Math.ceil(i.height/e),"px")}),0)}},{key:"_onBlur",value:function(){var t=this.getCanvasRatio(),e=this._editingObj,i=this._editingObjInfos,n=this._textarea.value,r=e.width/t-i.width/t,o=e.height/t-i.height/t;if(1===t&&(r/=2,o/=2),this._textarea.style.display="none",e.set({left:i.left+r,top:i.top+o}),n.length){this.getCanvas().add(e);var a={id:Kt(e),type:e.type,text:n};this.fire(At.TEXT_CHANGED,a)}}},{key:"_onScroll",value:function(){this._textarea.scrollLeft=0,this._textarea.scrollTop=0}},{key:"_onFabricScaling",value:function(t){var e=t.target;e.fontSize=e.fontSize*e.scaleY,e.scaleX=1,e.scaleY=1}},{key:"_onFabricTextChanged",value:function(t){this.fire(At.TEXT_CHANGED,t.target)}},{key:"_onFabricSelectClear",value:function(t){var e=this.getSelectedObj();this.isPrevEditing=!0,this.setSelectedInfo(t.target,!1),e&&""===e.text&&this.getCanvas().remove(e)}},{key:"_onFabricSelect",value:function(t){this.isPrevEditing=!0,this.setSelectedInfo(t.target,!0)}},{key:"_onFabricMouseDown",value:function(t){var e=t.target;e&&!e.isType("text")||(this.isPrevEditing?this.isPrevEditing=!1:this._fireAddText(t))}},{key:"_fireAddText",value:function(t){var e=t.target,i=t.e||{},n=this.getCanvas().getPointer(i);e||this.fire(At.ADD_TEXT,{originPosition:{x:n.x,y:n.y},clientPosition:{x:i.clientX||0,y:i.clientY||0}})}},{key:"_onFabricMouseUp",value:function(t){var e=t.target,i=(new Date).getTime();this._isDoubleClick(i)&&!e.isEditing&&e.enterEditing(),e.isEditing&&this.fire(At.TEXT_EDITING),this._lastClickTime=i}},{key:"_isDoubleClick",value:function(t){return t-this._lastClickTime<co}}]),i}(ur),uo=lo;function ho(t){var e=fo();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function fo(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var go={arrow:"M 0 90 H 105 V 120 L 160 60 L 105 0 V 30 H 0 Z",cancel:"M 0 30 L 30 60 L 0 90 L 30 120 L 60 90 L 90 120 L 120 90 L 90 60 L 120 30 L 90 0 L 60 30 L 30 0 Z"},po=function(t){oi(i,t);var e=ho(i);function i(t){var n,r,o,a;return D(this,i),a=e.call(this,Mt.ICON,t),a._oColor="#000000",a._pathMap=go,a._type=null,a._iconColor=null,a._handlers={mousedown:j()(n=a._onFabricMouseDown).call(n,ci(a)),mousemove:j()(r=a._onFabricMouseMove).call(r,ci(a)),mouseup:j()(o=a._onFabricMouseUp).call(o,ci(a))},a}return k(i,[{key:"setStates",value:function(t,e){this._type=t,this._iconColor=e}},{key:"start",value:function(){var t=this.getCanvas();t.selection=!1,t.on("mouse:down",this._handlers.mousedown)}},{key:"end",value:function(){var t=this.getCanvas();t.selection=!0,t.off({"mouse:down":this._handlers.mousedown})}},{key:"add",value:function(t,e){var i=this;return new(z())((function(n,r){var o=i.getCanvas(),a=i._pathMap[t],s=Nt.SELECTION_STYLE,c=a?i._createIcon(a):null;i._icon=c,c||r(Pt.invalidParameters),c.set(H()({type:"icon",fill:i._oColor},s,e,i.graphics.controlStyle)),o.add(c).setActiveObject(c),n(i.graphics.createObjectProperties(c))}))}},{key:"registerPaths",value:function(t){var e=this;X()(t,(function(t,i){e._pathMap[i]=t}),this)}},{key:"setColor",value:function(t,e){this._oColor=t,e&&"icon"===e.get("type")&&(e.set({fill:this._oColor}),this.getCanvas().renderAll())}},{key:"getColor",value:function(t){return lt()(t)}},{key:"_createIcon",value:function(t){return new F.fabric.Path(t)}},{key:"_onFabricMouseDown",value:function(t){var e=this,i=this.getCanvas();this._startPoint=i.getPointer(t.e);var n=this._startPoint,r=n.x,o=n.y;this.add(this._type,{left:r,top:o,fill:this._iconColor}).then((function(){e.fire(At.ADD_OBJECT,e.graphics.createObjectProperties(e._icon)),i.on("mouse:move",e._handlers.mousemove),i.on("mouse:up",e._handlers.mouseup)}))}},{key:"_onFabricMouseMove",value:function(t){var e=this.getCanvas();if(this._icon){var i=e.getPointer(t.e),n=(i.x-this._startPoint.x)/this._icon.width,r=(i.y-this._startPoint.y)/this._icon.height;this._icon.set({scaleX:Math.abs(2*n),scaleY:Math.abs(2*r)}),this._icon.setCoords(),e.renderAll()}}},{key:"_onFabricMouseUp",value:function(){var t=this.getCanvas();this.fire(At.OBJECT_ADDED,this.graphics.createObjectProperties(this._icon)),this._icon=null,t.off("mouse:down",this._handlers.mousedown),t.off("mouse:move",this._handlers.mousemove),t.off("mouse:up",this._handlers.mouseup)}}]),i}(ur),vo=po,mo=F.fabric.util.createClass(F.fabric.Image.filters.BlendImage,{applyTo:function(t){if(this.mask){var e=t.canvasEl,i=e.width,n=e.height,r=this._createCanvasOfMask(i,n),o=e.getContext("2d"),a=r.getContext("2d"),s=o.getImageData(0,0,i,n);this._drawMask(a,e,o),this._mapData(a,s,i,n),t.imageData=s}},_createCanvasOfMask:function(t,e){var i=F.fabric.util.createCanvasElement();return i.width=t,i.height=e,i},_drawMask:function(t){var e=this.mask,i=e.getElement(),n=e.angle,r=e.left,o=e.scaleX,a=e.scaleY,s=e.top;t.save(),t.translate(r,s),t.rotate(n*Math.PI/180),t.scale(o,a),t.drawImage(i,-i.width/2,-i.height/2),t.restore()},_mapData:function(t,e,i,n){for(var r=e.data,o=e.height,a=e.width,s=r,c=a*o*4,l=t.getImageData(0,0,i,n).data,u=0;u<c;u+=4)s[u+3]=l[u]}}),yo=mo,bo=F.fabric.util.createClass(F.fabric.Image.filters.Convolute,{type:"Sharpen",initialize:function(){this.matrix=[0,-1,0,-1,5,-1,0,-1,0]}}),_o=bo,xo=F.fabric.util.createClass(F.fabric.Image.filters.Convolute,{type:"Emboss",initialize:function(){this.matrix=[1,1,1,1,.7,-1,-1,-1,-1]}}),Co=xo,Io=F.fabric.util.createClass(F.fabric.Image.filters.BaseFilter,{type:"ColorFilter",initialize:function(t){t||(t={}),this.color=t.color||"#FFFFFF",this.threshold=t.threshold||45,this.x=t.x||null,this.y=t.y||null},applyTo:function(t){var e,i,n=t.canvasEl,r=n.getContext("2d"),o=r.getImageData(0,0,n.width,n.height),a=o.data,s=this.threshold,c=F.fabric.Color.sourceFromHex(this.color);for(this.x&&this.y&&(c=this._getColor(o,this.x,this.y)),e=0,i=a.length;e<i;e+=4)this._isOutsideThreshold(a[e],c[0],s)||this._isOutsideThreshold(a[e+1],c[1],s)||this._isOutsideThreshold(a[e+2],c[2],s)||(a[e]=a[e+1]=a[e+2]=a[e+3]=0);r.putImageData(o,0,0)},_isOutsideThreshold:function(t,e,i){var n=t-e;return Math.abs(n)>i},_getColor:function(t,e,i){var n=[0,0,0,0],r=t.data,o=t.width,a=4,s=(o*i+e)*a;return n[0]=r[s],n[1]=r[s+1],n[2]=r[s+2],n[3]=r[s+3],n}}),Mo=Io;function So(t){var e=wo();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function wo(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var To=F.fabric.Image.filters;To.Mask=yo,To.Sharpen=_o,To.Emboss=Co,To.ColorFilter=Mo;var Ao=function(t){oi(i,t);var e=So(i);function i(t){return D(this,i),e.call(this,Mt.FILTER,t)}return k(i,[{key:"add",value:function(t,e){var i=this;return new(z())((function(n,r){var o=i._getSourceImage(),a=i.getCanvas(),s=i._getFilter(o,t);s||(s=i._createFilter(o,t,e)),s||r(Pt.invalidParameters),i._changeFilterValues(s,e),i._apply(o,(function(){a.renderAll(),n({type:t,action:"add",options:e})}))}))}},{key:"remove",value:function(t){var e=this;return new(z())((function(i,n){var r=e._getSourceImage(),o=e.getCanvas(),a=e.getOptions(t);r.filters.length||n(Pt.unsupportedOperation),e._removeFilter(r,t),e._apply(r,(function(){o.renderAll(),i({type:t,action:"remove",options:a})}))}))}},{key:"hasFilter",value:function(t){return!!this._getFilter(this._getSourceImage(),t)}},{key:"getOptions",value:function(t){var e=this._getSourceImage(),i=this._getFilter(e,t);return i?H()({},i.options):null}},{key:"_changeFilterValues",value:function(t,e){X()(e,(function(e,i){W()(t[i])||(t[i]=e)})),X()(t.options,(function(i,n){W()(e[n])||(t.options[n]=e[n])}))}},{key:"_apply",value:function(t,e){t.filters.push();var i=t.applyFilters();i&&e()}},{key:"_getSourceImage",value:function(){return this.getCanvasImage()}},{key:"_createFilter",value:function(t,e,i){var n,r=this._getFabricFilterType(e),o=F.fabric.Image.filters[r];return o&&(n=new o(i),n.options=i,t.filters.push(n)),n}},{key:"_getFilter",value:function(t,e){var i=null;if(t){var n,r,o=this._getFabricFilterType(e),a=t.filters.length;for(r=0;r<a;r+=1)if(n=t.filters[r],n.type===o){i=n;break}}return i}},{key:"_removeFilter",value:function(t,e){var i,n=this._getFabricFilterType(e);t.filters=ir()(i=t.filters).call(i,(function(t){return t.type!==n}))}},{key:"_getFabricFilterType",value:function(t){return t.charAt(0).toUpperCase()+h()(t).call(t,1)}}]),i}(ur),Do=Ao,Eo=r(1801),ko=r.n(Eo),Oo={pixelate:"blocksize",blur:"blur"},jo={x:"width",y:"height"},Lo=ge(Oo),No=null;function Po(t){var e=ve(t,"patternSourceCanvas"),i=e.patternSourceCanvas,n=i.getObjects(),r=it(n,1),o=r[0];return o}function zo(t){var e=t.angle,i=t.flipX,n=t.flipY,r=Po(t),o=$o(t),a=o.right,s=o.bottom,c=o.width,l=o.height,u=(c-t.width)/2,h=(l-t.height)/2,f=t.left-t.width/2-u,d=t.top-t.height/2-h,g=c/2-u,p=l/2-h,v=Math.max(c,l)+Math.max(u,h),m=Bo({shapeObj:t,left:g,top:p,width:c,height:l,cropX:f,cropY:d,flipX:i,flipY:n,right:a,bottom:s}),y=it(m,4);g=y[0],p=y[1],c=y[2],l=y[3],r.set({angle:i===n?-e:e,left:g,top:p,width:c,height:l,cropX:f,cropY:d,flipX:i,flipY:n}),pe(r,{fillImageMaxSize:v})}function Ro(t){var e;return Ve()(e=t.filters).call(e,(function(t){var e=q()(t),i=it(e,1),n=i[0];return A({},Lo[n],t[n])}))}function Bo(t){var e=t.shapeObj,i=t.left,n=t.top,r=t.width,o=t.height,a=t.cropX,s=t.cropY,c=t.flipX,l=t.flipY,u=t.right,h=t.bottom,f=function(t,i,n,r){return Xo({type:t,outDistance:i,shapeObj:e,flipX:c,flipY:l,left:n,top:r})},d=r,g=o,p=Yo(f,{left:i,top:n,width:r,height:o,cropX:a,cropY:s}),v=it(p,4);i=v[0],n=v[1],r=v[2],o=v[3];var m=Fo(f,{left:i,top:n,insideCanvasRealImageWidth:r,insideCanvasRealImageHeight:o,right:u,bottom:h,cropX:a,cropY:s,originalWidth:d,originalHeight:g}),y=it(m,4);return i=y[0],n=y[1],r=y[2],o=y[3],[i,n,r,o]}function Fo(t,e){var i=e.left,n=e.top,r=e.insideCanvasRealImageWidth,o=e.insideCanvasRealImageHeight,a=e.right,s=e.bottom,c=e.cropX,l=e.cropY,u=e.originalWidth,h=e.originalHeight,f=r,d=o,g=No,p=g.width,v=g.height;a>p&&c>0&&(f=u-Math.abs(a-p)),s>v&&l>0&&(d=h-Math.abs(s-v));var m={x:(r-f)/2,y:(o-d)/2};return X()(["x","y"],(function(e){var r=m[e];if(r>0){var o=t(e,r,i,n),a=it(o,2);i=a[0],n=a[1]}})),[i,n,f,d]}function Yo(t,e){var i=e.left,n=e.top,r=e.width,o=e.height,a=e.cropX,s=e.cropY,c={width:r,height:o};return X()(["x","y"],(function(e){var r="x"===e?a:s,o=c[jo[e]],l=No[jo[e]];if(o>l){var u=(o-l)/2;c[jo[e]]=l;var h=t(e,u,i,n),f=it(h,2);i=f[0],n=f[1]}if(r<0){var d=t(e,r,i,n),g=it(d,2);i=g[0],n=g[1]}})),[i,n,c.width,c.height]}function Ho(t,e,i){var n=Go(t),r=ta(n,t.angle,e);i.add(r);var o={fill:new F.fabric.Pattern({source:i.getElement(),repeat:"no-repeat"})};return pe(o,{patternSourceCanvas:i}),o}function Uo(t){var e=t.getObjects(),i=it(e,1),n=i[0],r=ve(n,"fillImageMaxSize"),o=r.fillImageMaxSize;o=Math.max(1,o),t.setDimensions({width:o,height:o}),t.renderAll()}function Wo(t,e){var i=ve(t,"patternSourceCanvas"),n=i.patternSourceCanvas,r=n.getObjects(),o=it(r,1),a=o[0],s=Ro(a);n.remove(a);var c=Go(e,!0),l=ta(c,e.angle,s);n.add(l)}function Go(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return No&&!e||(No=t.toCanvasElement()),No}function Xo(t){var e=t.type,i=t.shapeObj,n=t.outDistance,r=t.left,o=t.top,a=t.flipX,s=t.flipY,c=qo(i),l=[[1,2],[0,3],[0,3],[1,2]],u=Vo(e,c,l),h=Jo(e,c,u),f=u.startPointIndex,d=Zo({outDistance:n,startPointIndex:f,flipX:a,flipY:s,reatAngles:h});return[r+d.left,o+d.top]}function Zo(t){var e=t.outDistance,i=t.startPointIndex,n=t.flipX,r=t.flipY,o=t.reatAngles,a=e*Math.cos(o[0]*Math.PI/180),s=e*Math.cos(o[1]*Math.PI/180),c=2===i||3===i,l={top:c?a:s,left:c?s:a};return Qo(i,n,r)&&(l.left=-1*l.left),Ko(i,n,r)&&(l.top=-1*l.top),l}function Vo(t,e,i){var n=0,r=0;X()(e,(function(e,i){e[t]<n&&(n=e[t],r=i)}));var o=it(i[r],2),a=o[0],s=o[1];return{startPointIndex:r,endPointIndex1:a,endPointIndex2:s}}function Jo(t,e,i){var n,r=i.startPointIndex,o=i.endPointIndex1,a=i.endPointIndex2,s="x"===t?180:270;return Ve()(n=[o,a]).call(n,(function(t){var i=e[r],n=e[t],o=i.y-n.y,a=i.x-n.x;return 180*Math.atan2(o,a)/Math.PI-s}))}function Qo(t,e,i){return(!e&&i||!e&&!i)&&0===t||(e&&i||e&&!i)&&1===t||(!e&&!i||!e&&i)&&2===t||(e&&!i||e&&i)&&3===t}function Ko(t,e,i){return(e&&!i||!e&&!i)&&0===t||(!e&&!i||e&&!i)&&1===t||(e&&i||!e&&i)&&2===t||(!e&&i||e&&i)&&3===t}function qo(t){return[t.getPointByOrigin("left","top"),t.getPointByOrigin("right","top"),t.getPointByOrigin("left","bottom"),t.getPointByOrigin("right","bottom")]}function $o(t){var e=qo(t),i=it(e,4),n=i[0],r=n.x,o=n.y,a=i[1],s=a.x,c=a.y,l=i[2],u=l.x,h=l.y,f=i[3],d=f.x,g=f.y,p=Math.min(r,s,u,d),v=Math.min(o,c,h,g),m=Math.max(r,s,u,d),y=Math.max(o,c,h,g);return{left:p,top:v,right:m,bottom:y,width:m-p,height:y-v}}function ta(t,e,i){var n,r=new F.fabric.Image(t);return X()(H().apply(void 0,N()(n=[{}]).call(n,w(i))),(function(t,e){var i=me(e),n=new F.fabric.Image.filters[i](A({},Oo[e],t));r.filters.push(n)})),r.applyFilters(),pe(r,{originalAngle:e,fillImageMaxSize:Math.max(r.width,r.height)}),ko().adjustOriginToCenter(r),r}function ea(t){var e=ia();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function ia(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var na=H()({strokeWidth:1,stroke:"#000000",fill:"#ffffff",width:1,height:1,rx:0,ry:0},St),ra="rect",oa=20,aa=20;function sa(t,e,i){var n=lt()(t),r=be(lt()(t)),o=n;n.color&&(o=n.color);var a=null;if("filter"===r){var s=i();a=Ho(e,ir()(n),s)}else a={fill:o};return H()({},t,a)}var ca=function(t){oi(i,t);var e=ea(i);function i(t){var n,r,o,a,s,c;return D(this,i),c=e.call(this,Mt.SHAPE,t),c._shapeObj=null,c._type=ra,c._options=H()({},na),c._isSelected=!1,c._startPoint={},c._withShiftKey=!1,c._handlers={mousedown:j()(n=c._onFabricMouseDown).call(n,ci(c)),mousemove:j()(r=c._onFabricMouseMove).call(r,ci(c)),mouseup:j()(o=c._onFabricMouseUp).call(o,ci(c)),keydown:j()(a=c._onKeyDown).call(a,ci(c)),keyup:j()(s=c._onKeyUp).call(s,ci(c))},c}return k(i,[{key:"start",value:function(){var t=this.getCanvas();this._isSelected=!1,t.defaultCursor="crosshair",t.selection=!1,t.uniformScaling=!0,t.on({"mouse:down":this._handlers.mousedown}),F.fabric.util.addListener(document,"keydown",this._handlers.keydown),F.fabric.util.addListener(document,"keyup",this._handlers.keyup)}},{key:"end",value:function(){var t=this.getCanvas();this._isSelected=!1,t.defaultCursor="default",t.selection=!0,t.uniformScaling=!1,t.off({"mouse:down":this._handlers.mousedown}),F.fabric.util.removeListener(document,"keydown",this._handlers.keydown),F.fabric.util.removeListener(document,"keyup",this._handlers.keyup)}},{key:"setStates",value:function(t,e){this._type=t,e&&(this._options=H()(this._options,e))}},{key:"add",value:function(t,e){var i=this;return new(z())((function(n){var r=i.getCanvas(),o=i._extendOptions(e),a=i._createInstance(t,o),s=i.graphics.createObjectProperties(a);i._bindEventOnShape(a),r.add(a).setActiveObject(a),i._resetPositionFillFilter(a),n(s)}))}},{key:"change",value:function(t,e){var i=this;return new(z())((function(n,r){xe(t)||r(Pt.unsupportedType);var o="filter"===be(lt()(e)),a=i.graphics,s=a.canvasImage,c=a.createStaticCanvas;t.set(o?sa(e,s,c):e),o&&i._resetPositionFillFilter(t),i.getCanvas().renderAll(),n()}))}},{key:"makeFillPropertyForUserEvent",value:function(t){var e=_e(t),i={};if(e===_t.FILTER){var n=Po(t),r=Ro(n);i.type=e,i.filter=r}else i.type=_t.COLOR,i.color=lt()(t)||"transparent";return i}},{key:"processForCopiedObject",value:function(t,e){if(this._bindEventOnShape(t),"filter"===_e(t)){var i=Po(e),n=Ro(i),r=this.graphics.createStaticCanvas();t.set(Ho(this.graphics.canvasImage,n,r)),this._resetPositionFillFilter(t)}}},{key:"_createInstance",value:function(t,e){var i;switch(t){case"rect":i=new F.fabric.Rect(e);break;case"circle":i=new F.fabric.Ellipse(H()({type:"circle"},e));break;case"triangle":i=new F.fabric.Triangle(e);break;default:i={}}return i}},{key:"_extendOptions",value:function(t){var e=Nt.SELECTION_STYLE,i=this.graphics,n=i.canvasImage,r=i.createStaticCanvas;return t=H()({},na,this._options,e,t),sa(t,n,r)}},{key:"_bindEventOnShape",value:function(t){var e=this,i=this.getCanvas();t.on({added:function(){e._shapeObj=this,ko().setOrigins(e._shapeObj)},selected:function(){e._isSelected=!0,e._shapeObj=this,i.uniformScaling=!0,i.defaultCursor="default",ko().setOrigins(e._shapeObj)},deselected:function(){e._isSelected=!1,e._shapeObj=null,i.defaultCursor="crosshair",i.uniformScaling=!1},modified:function(){var t=e._shapeObj;ko().adjustOriginToCenter(t),ko().setOrigins(t)},modifiedInGroup:function(i){e._fillFilterRePositionInGroupSelection(t,i)},moving:function(){e._resetPositionFillFilter(this)},rotating:function(){e._resetPositionFillFilter(this)},scaling:function(t){var n=i.getPointer(t.e),r=e._shapeObj;i.setCursor("crosshair"),ko().resize(r,n,!0),e._resetPositionFillFilter(this)}})}},{key:"_onFabricMouseDown",value:function(t){if(t.target||(this._isSelected=!1,this._shapeObj=!1),!this._isSelected&&!this._shapeObj){var e=this.getCanvas();this._startPoint=e.getPointer(t.e),e.on({"mouse:move":this._handlers.mousemove,"mouse:up":this._handlers.mouseup})}}},{key:"_onFabricMouseMove",value:function(t){var e=this,i=this.getCanvas(),n=i.getPointer(t.e),r=this._startPoint.x,o=this._startPoint.y,a=r-n.x,s=o-n.y,c=this._shapeObj;c?(this._shapeObj.set({isRegular:this._withShiftKey}),ko().resize(c,n),i.renderAll(),this._resetPositionFillFilter(c)):this.add(this._type,{left:r,top:o,width:a,height:s}).then((function(t){e.fire(At.ADD_OBJECT,t)}))}},{key:"_onFabricMouseUp",value:function(){var t=this,e=this.getCanvas(),i=this._startPoint.x,n=this._startPoint.y,r=this._shapeObj;r?r&&(ko().adjustOriginToCenter(r),this.fire(At.OBJECT_ADDED,this.graphics.createObjectProperties(r))):this.add(this._type,{left:i,top:n,width:oa,height:aa}).then((function(e){t.fire(At.ADD_OBJECT,e)})),e.off({"mouse:move":this._handlers.mousemove,"mouse:up":this._handlers.mouseup})}},{key:"_onKeyDown",value:function(t){t.keyCode===Lt.SHIFT&&(this._withShiftKey=!0,this._shapeObj&&(this._shapeObj.isRegular=!0))}},{key:"_onKeyUp",value:function(t){t.keyCode===Lt.SHIFT&&(this._withShiftKey=!1,this._shapeObj&&(this._shapeObj.isRegular=!1))}},{key:"_resetPositionFillFilter",value:function(t){if("filter"===_e(t)){var e=ve(t,"patternSourceCanvas"),i=e.patternSourceCanvas,n=Po(t),r=ve(n,"originalAngle"),o=r.originalAngle;this.graphics.canvasImage.angle!==o&&Wo(t,this.graphics.canvasImage);var a=t.originX,s=t.originY;ko().adjustOriginToCenter(t),t.width*=t.scaleX,t.height*=t.scaleY,t.rx*=t.scaleX,t.ry*=t.scaleY,t.scaleX=1,t.scaleY=1,zo(t),de(t,{originX:a,originY:s}),Uo(i)}}},{key:"_fillFilterRePositionInGroupSelection",value:function(t,e){1===e.scaleX&&1===e.scaleY||e.addWithUpdate();var i=t.angle,n=t.left,r=t.top;F.fabric.util.addTransformToObject(t,e.calcTransformMatrix()),this._resetPositionFillFilter(t),t.set({angle:i,left:n,top:r})}}]),i}(ur);function la(t){var e=ua();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function ua(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var ha=10,fa={left:0,top:0,width:0,height:0,stroke:"#000000",strokeWidth:0,fill:"#000000",opacity:.4,evented:!1,selectable:!1,hoverCursor:"auto"},da={SIZE:.0045,MARGIN:.003,BORDER_RADIUS:.003},ga={SIZE:.0066,MARGIN:.0044,BORDER_RADIUS:.003},pa=1,va=At.ZOOM_CHANGED,ma=At.ADD_TEXT,ya=At.TEXT_EDITING,ba=At.OBJECT_MODIFIED,_a=At.KEY_DOWN,xa=At.KEY_UP,Ca=At.HAND_STARTED,Ia=At.HAND_STOPPED,Ma=function(t){oi(i,t);var e=la(i);function i(t){var n,r,o,a,s,c,l,u,h,f,d,g,p;D(this,i),p=e.call(this,Mt.ZOOM,t),p.zoomArea=null,p._startPoint=null,p._centerPoints=[],p.zoomLevel=pa,p.zoomMode=jt.DEFAULT,p._listeners={startZoom:j()(n=p._onMouseDownWithZoomMode).call(n,ci(p)),moveZoom:j()(r=p._onMouseMoveWithZoomMode).call(r,ci(p)),stopZoom:j()(o=p._onMouseUpWithZoomMode).call(o,ci(p)),startHand:j()(a=p._onMouseDownWithHandMode).call(a,ci(p)),moveHand:j()(s=p._onMouseMoveWithHandMode).call(s,ci(p)),stopHand:j()(c=p._onMouseUpWithHandMode).call(c,ci(p)),zoomChanged:j()(l=p._changeScrollState).call(l,ci(p)),keydown:j()(u=p._startHandModeWithSpaceBar).call(u,ci(p)),keyup:j()(h=p._endHandModeWithSpaceBar).call(h,ci(p))};var v=p.getCanvas();return p.aspectRatio=v.width/v.height,p._verticalScroll=new F.fabric.Rect(fa),p._horizontalScroll=new F.fabric.Rect(fa),v.on(va,p._listeners.zoomChanged),p.graphics.on(ma,j()(f=p._startTextEditingHandler).call(f,ci(p))),p.graphics.on(ya,j()(d=p._startTextEditingHandler).call(d,ci(p))),p.graphics.on(ba,j()(g=p._stopTextEditingHandler).call(g,ci(p))),p}return k(i,[{key:"attachKeyboardZoomEvents",value:function(){F.fabric.util.addListener(document,_a,this._listeners.keydown),F.fabric.util.addListener(document,xa,this._listeners.keyup)}},{key:"detachKeyboardZoomEvents",value:function(){F.fabric.util.removeListener(document,_a,this._listeners.keydown),F.fabric.util.removeListener(document,xa,this._listeners.keyup)}},{key:"_startTextEditingHandler",value:function(){this.isTextEditing=!0}},{key:"_stopTextEditingHandler",value:function(){this.isTextEditing=!1}},{key:"_startHandModeWithSpaceBar",value:function(t){this.withSpace||this.isTextEditing||t.keyCode===Lt.SPACE&&(this.withSpace=!0,this.startHandMode())}},{key:"_endHandModeWithSpaceBar",value:function(t){t.keyCode===Lt.SPACE&&(this.withSpace=!1,this.endHandMode())}},{key:"startZoomInMode",value:function(){if(!this.zoomArea){this.endHandMode(),this.zoomMode=jt.ZOOM;var t=this.getCanvas();this._changeObjectsEventedState(!1),this.zoomArea=new F.fabric.Rect({left:0,top:0,width:.5,height:.5,stroke:"black",strokeWidth:1,fill:"transparent",hoverCursor:"zoom-in"}),t.discardActiveObject(),t.add(this.zoomArea),t.on("mouse:down",this._listeners.startZoom),t.selection=!1,t.defaultCursor="zoom-in"}}},{key:"endZoomInMode",value:function(){this.zoomMode=jt.DEFAULT;var t=this.getCanvas(),e=this._listeners,i=e.startZoom,n=e.moveZoom,r=e.stopZoom;t.selection=!0,t.defaultCursor="auto",t.off({"mouse:down":i,"mouse:move":n,"mouse:up":r}),this._changeObjectsEventedState(!0),t.remove(this.zoomArea),this.zoomArea=null}},{key:"start",value:function(){this.zoomArea=null,this._startPoint=null,this._startHandPoint=null}},{key:"end",value:function(){this.endZoomInMode(),this.endHandMode()}},{key:"startHandMode",value:function(){this.endZoomInMode(),this.zoomMode=jt.HAND;var t=this.getCanvas();this._changeObjectsEventedState(!1),t.discardActiveObject(),t.off("mouse:down",this._listeners.startHand),t.on("mouse:down",this._listeners.startHand),t.selection=!1,t.defaultCursor="grab",t.fire(Ca)}},{key:"endHandMode",value:function(){this.zoomMode=jt.DEFAULT;var t=this.getCanvas();this._changeObjectsEventedState(!0),t.off("mouse:down",this._listeners.startHand),t.selection=!0,t.defaultCursor="auto",this._startHandPoint=null,t.fire(Ia)}},{key:"_onMouseDownWithZoomMode",value:function(t){var e=t.target,i=t.e;if(!e){var n=this.getCanvas();n.selection=!1,this._startPoint=n.getPointer(i),this.zoomArea.set({width:0,height:0});var r=this._listeners,o=r.moveZoom,a=r.stopZoom;n.on({"mouse:move":o,"mouse:up":a})}}},{key:"_onMouseMoveWithZoomMode",value:function(t){var e=t.e,i=this.getCanvas(),n=i.getPointer(e),r=n.x,o=n.y,a=this.zoomArea,s=this._startPoint,c=Math.abs(r-s.x),l=Math.abs(o-s.y);c+l>ha&&(i.remove(a),a.set(this._calcRectDimensionFromPoint(r,o)),i.add(a))}},{key:"_calcRectDimensionFromPoint",value:function(t,e){var i=this.getCanvas(),n=i.getWidth(),r=i.getHeight(),o=this._startPoint,a=o.x,s=o.y,c=Math.min,l=c(a,t),u=c(s,e),h=$t(t,a,n)-l,f=$t(e,s,r)-u;return{left:l,top:u,width:h,height:f}}},{key:"_onMouseUpWithZoomMode",value:function(){var t=this.zoomLevel,e=this.zoomArea,i=this._listeners,n=i.moveZoom,r=i.stopZoom,o=this.getCanvas(),a=this._getCenterPoint(),s=a.x,c=a.y;this._isMaxZoomLevel()||(this._centerPoints.push({x:s,y:c,prevZoomLevel:t,zoomLevel:t+1}),t+=1,o.zoomToPoint({x:s,y:c},t),this._fireZoomChanged(o,t),this.zoomLevel=t),o.off({"mouse:move":n,"mouse:up":r}),o.remove(e),this._startPoint=null}},{key:"_getCenterPoint",value:function(){var t=this.zoomArea,e=t.left,i=t.top,n=t.width,r=t.height,o=this._startPoint,a=o.x,s=o.y,c=this.aspectRatio;return n<ha&&r<ha?{x:a,y:s}:n>r?{x:e+c*r/2,y:i+r/2}:{x:e+n/2,y:i+n/c/2}}},{key:"zoom",value:function(t){for(var e=t.x,i=t.y,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.zoomLevel,r=this.getCanvas(),o=this._centerPoints,a=o.length-1;a>=0;a-=1){if(o[a].zoomLevel<n)break;var s=o.pop(),c=s.x,l=s.y,u=s.prevZoomLevel;r.zoomToPoint({x:c,y:l},u),this.zoomLevel=u}r.zoomToPoint({x:e,y:i},n),this._isDefaultZoomLevel(n)||this._centerPoints.push({x:e,y:i,zoomLevel:n,prevZoomLevel:this.zoomLevel}),this.zoomLevel=n,this._fireZoomChanged(r,n)}},{key:"zoomOut",value:function(){var t=this._centerPoints;if(t.length){var e=this.getCanvas(),i=t.pop(),n=i.x,r=i.y,o=i.prevZoomLevel;this._isDefaultZoomLevel(o)?e.setViewportTransform([1,0,0,1,0,0]):e.zoomToPoint({x:n,y:r},o),this.zoomLevel=o,this._fireZoomChanged(e,this.zoomLevel)}}},{key:"resetZoom",value:function(){var t=this.getCanvas();t.setViewportTransform([1,0,0,1,0,0]),this.zoomLevel=pa,this._centerPoints=[],this._fireZoomChanged(t,this.zoomLevel)}},{key:"_isMaxZoomLevel",value:function(){return this.zoomLevel>=5}},{key:"_movePointOfZoom",value:function(t){var e=t.x,i=t.y,n=this._centerPoints;if(n.length){var r=this.getCanvas(),o=this.zoomLevel,a=n.pop(),s=a.x,c=a.y,l=a.prevZoomLevel,u=s-e,h=c-i;r.zoomToPoint({x:s,y:c},l),r.zoomToPoint({x:u,y:h},o),n.push({x:u,y:h,prevZoomLevel:l,zoomLevel:o}),this._fireZoomChanged(r,o)}}},{key:"_onMouseDownWithHandMode",value:function(t){var e=t.target,i=t.e;if(!e){var n=this.getCanvas();if(!(this.zoomLevel<=pa)){n.selection=!1,this._startHandPoint=n.getPointer(i);var r=this._listeners,o=r.moveHand,a=r.stopHand;n.on({"mouse:move":o,"mouse:up":a})}}}},{key:"_onMouseMoveWithHandMode",value:function(t){var e=t.e,i=this.getCanvas(),n=i.getPointer(e),r=n.x,o=n.y,a=r-this._startHandPoint.x,s=o-this._startHandPoint.y;this._movePointOfZoom({x:a,y:s})}},{key:"_onMouseUpWithHandMode",value:function(){var t=this.getCanvas(),e=this._listeners,i=e.moveHand,n=e.stopHand;t.off({"mouse:move":i,"mouse:up":n}),this._startHandPoint=null}},{key:"_changeScrollState",value:function(t){var e=t.viewport,i=t.zoomLevel,n=this.getCanvas();if(n.remove(this._verticalScroll),n.remove(this._horizontalScroll),!this._isDefaultZoomLevel(i)){var r=n.width,o=n.height,a=e.tl,s=e.tr,c=e.bl,l=s.x-a.x,u=c.y-a.y,h=l*l/r,f=u*ga.SIZE,d=$t(a.x+a.x/r*l,a.x,s.x-h),g=u*ga.MARGIN,p=u*ga.BORDER_RADIUS;this._horizontalScroll.set({left:d,top:c.y-f-g,width:h,height:f,rx:p,ry:p});var v=l*da.SIZE,m=u*u/o,y=$t(a.y+a.y/o*u,s.y,c.y-m),b=l*da.MARGIN,_=l*da.BORDER_RADIUS;this._verticalScroll.set({left:s.x-v-b,top:y,width:v,height:m,rx:_,ry:_}),this._addScrollBar()}}},{key:"_changeObjectsEventedState",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=this.getCanvas();e.forEachObject((function(e){e.evented=t}))}},{key:"_addScrollBar",value:function(){var t=this,e=this.getCanvas();e.add(this._horizontalScroll),e.add(this._verticalScroll),this.scrollBarTid&&clearTimeout(this.scrollBarTid),this.scrollBarTid=p()((function(){e.remove(t._horizontalScroll),e.remove(t._verticalScroll)}),3e3)}},{key:"_isDefaultZoomLevel",value:function(t){return t===pa}},{key:"_fireZoomChanged",value:function(t,e){t.fire(va,{viewport:t.calcViewportBoundaries(),zoomLevel:e})}},{key:"mode",get:function(){return this.zoomMode}}]),i}(ur),Sa=Ma,wa=Oe.create,Ta=Oe.types,Aa=function(){function t(e){D(this,t),this.name=e}return k(t,[{key:"getName",value:function(){return this.name}},{key:"start",value:function(){throw new Error(wa(Ta.UN_IMPLEMENTATION,"start"))}},{key:"end",value:function(){throw new Error(wa(Ta.UN_IMPLEMENTATION,"stop"))}}]),t}(),Da=Aa;function Ea(t){var e=ka();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function ka(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var Oa=function(t){oi(i,t);var e=Ea(i);function i(){return D(this,i),e.call(this,kt.CROPPER)}return k(i,[{key:"start",value:function(t){var e=t.getComponent(Mt.CROPPER);e.start()}},{key:"end",value:function(t){var e=t.getComponent(Mt.CROPPER);e.end()}}]),i}(Da),ja=Oa;function La(t){var e=Na();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function Na(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var Pa=function(t){oi(i,t);var e=La(i);function i(){return D(this,i),e.call(this,kt.FREE_DRAWING)}return k(i,[{key:"start",value:function(t,e){var i=t.getComponent(Mt.FREE_DRAWING);i.start(e)}},{key:"end",value:function(t){var e=t.getComponent(Mt.FREE_DRAWING);e.end()}}]),i}(Da),za=Pa;function Ra(t){var e=Ba();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function Ba(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var Fa=function(t){oi(i,t);var e=Ra(i);function i(){return D(this,i),e.call(this,kt.LINE_DRAWING)}return k(i,[{key:"start",value:function(t,e){var i=t.getComponent(Mt.LINE);i.start(e)}},{key:"end",value:function(t){var e=t.getComponent(Mt.LINE);e.end()}}]),i}(Da),Ya=Fa;function Ha(t){var e=Ua();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function Ua(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var Wa=function(t){oi(i,t);var e=Ha(i);function i(){return D(this,i),e.call(this,kt.SHAPE)}return k(i,[{key:"start",value:function(t){var e=t.getComponent(Mt.SHAPE);e.start()}},{key:"end",value:function(t){var e=t.getComponent(Mt.SHAPE);e.end()}}]),i}(Da),Ga=Wa;function Xa(t){var e=Za();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function Za(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var Va=function(t){oi(i,t);var e=Xa(i);function i(){return D(this,i),e.call(this,kt.TEXT)}return k(i,[{key:"start",value:function(t){var e=t.getComponent(Mt.TEXT);e.start()}},{key:"end",value:function(t){var e=t.getComponent(Mt.TEXT);e.end()}}]),i}(Da),Ja=Va;function Qa(t){var e=Ka();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function Ka(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var qa=function(t){oi(i,t);var e=Qa(i);function i(){return D(this,i),e.call(this,kt.ICON)}return k(i,[{key:"start",value:function(t){var e=t.getComponent(Mt.ICON);e.start()}},{key:"end",value:function(t){var e=t.getComponent(Mt.ICON);e.end()}}]),i}(Da),$a=qa;function ts(t){var e=es();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function es(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var is=function(t){oi(i,t);var e=ts(i);function i(){return D(this,i),e.call(this,kt.ZOOM)}return k(i,[{key:"start",value:function(t){var e=t.getComponent(Mt.ZOOM);e.start()}},{key:"end",value:function(t){var e=t.getComponent(Mt.ZOOM);e.end()}}]),i}(Da),ns=is,rs=null;function os(t){rs=t}function as(){return rs}function ss(t,e){var i,n;"activeSelection"===t.type?i=Ve()(n=t.getObjects()).call(n,(function(i){var n=i.angle,r=i.left,o=i.top,a=i.scaleX,s=i.scaleY,c=i.width,l=i.height;F.fabric.util.addTransformToObject(i,t.calcTransformMatrix());var u=e(i);return i.set({angle:n,left:r,top:o,width:c,height:l,scaleX:a,scaleY:s}),u})):i=[e(t)];return i}function cs(t,e,i){return i?{id:t,width:e.width,height:e.height,top:e.top,left:e.left,angle:e.angle,scaleX:e.scaleX,scaleY:e.scaleY}:H()({id:t},e)}function ls(t){var e=us();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function us(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var hs=function(t){oi(i,t);var e=ls(i);function i(t){var n;return D(this,i),n=e.call(this,Mt.RESIZE,t),n._dimensions=null,n._originalDimensions=null,n}return k(i,[{key:"getCurrentDimensions",value:function(){var t=this.getCanvasImage();if(!this._dimensions&&t){var e=t.width,i=t.height;this._dimensions={width:e,height:i}}return this._dimensions}},{key:"getOriginalDimensions",value:function(){return this._originalDimensions}},{key:"setOriginalDimensions",value:function(t){this._originalDimensions=t}},{key:"resize",value:function(t){var e=this.getCanvasImage(),i=e.width,n=e.height,r=e.scaleX,o=e.scaleY,a=t.width,s=t.height,c={scaleX:a?a/i:r,scaleY:s?s/n:o};return r===c.scaleX&&o===c.scaleY||(e.set(c).setCoords(),this._dimensions={width:e.width*e.scaleX,height:e.height*e.scaleY}),this.adjustCanvasDimensionBase(),z().resolve()}},{key:"start",value:function(){var t=this.getCurrentDimensions();this.setOriginalDimensions(t)}},{key:"end",value:function(){}}]),i}(ur),fs=hs;function ds(t){var e=gs();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function gs(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var ps=function(t){oi(i,t);var e=ds(i);function i(){return D(this,i),e.call(this,kt.RESIZE)}return k(i,[{key:"start",value:function(t){var e=t.getComponent(Mt.RESIZE);e.start()}},{key:"end",value:function(t){var e=t.getComponent(Mt.RESIZE);e.end()}}]),i}(Da),vs=ps,ms=1e3,ys=800,bs=10,_s={cssOnly:!0},xs={backstoreOnly:!0},Cs=function(){function t(e){var i,n,r,o,a,s,c,l,u,h,f,d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},g=d.cssMaxWidth,p=d.cssMaxHeight;D(this,t),this.canvasImage=null,this.cssMaxWidth=g||ms,this.cssMaxHeight=p||ys,this.cropSelectionStyle={},this.targetObjectForCopyPaste=null,this.imageName="",this._objects={},this._canvas=null,this._drawingMode=kt.NORMAL,this._drawingModeMap={},this._componentMap={},this._handler={onMouseDown:j()(i=this._onMouseDown).call(i,this),onObjectAdded:j()(n=this._onObjectAdded).call(n,this),onObjectRemoved:j()(r=this._onObjectRemoved).call(r,this),onObjectMoved:j()(o=this._onObjectMoved).call(o,this),onObjectScaled:j()(a=this._onObjectScaled).call(a,this),onObjectModified:j()(s=this._onObjectModified).call(s,this),onObjectRotated:j()(c=this._onObjectRotated).call(c,this),onObjectSelected:j()(l=this._onObjectSelected).call(l,this),onPathCreated:j()(u=this._onPathCreated).call(u,this),onSelectionCleared:j()(h=this._onSelectionCleared).call(h,this),onSelectionCreated:j()(f=this._onSelectionCreated).call(f,this)},this._setObjectCachingToFalse(),this._setCanvasElement(e),this._createDrawingModeInstances(),this._createComponents(),this._attachCanvasEvents(),this._attachZoomEvents()}return k(t,[{key:"destroy",value:function(){var t=this._canvas.wrapperEl;this._canvas.clear(),t.parentNode.removeChild(t),this._detachZoomEvents()}},{key:"_attachZoomEvents",value:function(){var t=this.getComponent(Mt.ZOOM);t.attachKeyboardZoomEvents()}},{key:"_detachZoomEvents",value:function(){var t=this.getComponent(Mt.ZOOM);t.detachKeyboardZoomEvents()}},{key:"deactivateAll",value:function(){return this._canvas.discardActiveObject(),this}},{key:"renderAll",value:function(){return this._canvas.renderAll(),this}},{key:"add",value:function(t){var e,i=[];ar()(t)?i=t:i.push(t),(e=this._canvas).add.apply(e,w(i))}},{key:"contains",value:function(t){return this._canvas.contains(t)}},{key:"getObjects",value:function(){var t;return h()(t=this._canvas.getObjects()).call(t)}},{key:"getObject",value:function(t){return this._objects[t]}},{key:"remove",value:function(t){this._canvas.remove(t)}},{key:"removeAll",value:function(t){var e,i=this._canvas,n=h()(e=i.getObjects()).call(e);return i.remove.apply(i,w(this._canvas.getObjects())),t&&i.clear(),n}},{key:"removeObjectById",value:function(t){var e=[],i=this._canvas,n=this.getObject(t),r=n&&n.isType("group")&&!n.isEmpty();return r?(i.discardActiveObject(),n.forEachObject((function(t){e.push(t),i.remove(t)}))):i.contains(n)&&(e.push(n),i.remove(n)),e}},{key:"getObjectId",value:function(t){var e=null;for(e in this._objects)if(this._objects.hasOwnProperty(e)&&t===this._objects[e])return e;return null}},{key:"getActiveObject",value:function(){return this._canvas._activeObject}},{key:"getActiveObjectIdForRemove",value:function(){var t=this.getActiveObject(),e=t.type,i=t.left,n=t.top,r="activeSelection"===e;if(r){var o=new F.fabric.Group(w(t.getObjects()),{left:i,top:n});return this._addFabricObject(o)}return this.getObjectId(t)}},{key:"isReadyRemoveObject",value:function(){var t=this.getActiveObject();return t&&!t.isEditing}},{key:"getActiveObjects",value:function(){var t=this._canvas._activeObject;return t&&"activeSelection"===t.type?t:null}},{key:"getActiveSelectionFromObjects",value:function(t){var e=this.getCanvas();return new F.fabric.ActiveSelection(t,{canvas:e})}},{key:"setActiveObject",value:function(t){this._canvas.setActiveObject(t)}},{key:"setCropSelectionStyle",value:function(t){this.cropSelectionStyle=t}},{key:"getComponent",value:function(t){return this._componentMap[t]}},{key:"getDrawingMode",value:function(){return this._drawingMode}},{key:"startDrawingMode",value:function(t,e){if(this._isSameDrawingMode(t))return!0;this.stopDrawingMode();var i=this._getDrawingModeInstance(t);return i&&i.start&&(i.start(this,e),this._drawingMode=t),!!i}},{key:"stopDrawingMode",value:function(){if(!this._isSameDrawingMode(kt.NORMAL)){var t=this._getDrawingModeInstance(this.getDrawingMode());t&&t.end&&t.end(this),this._drawingMode=kt.NORMAL}}},{key:"zoom",value:function(t,e){var i=t.x,n=t.y,r=this.getComponent(Mt.ZOOM);r.zoom({x:i,y:n},e)}},{key:"getZoomMode",value:function(){var t=this.getComponent(Mt.ZOOM);return t.mode}},{key:"startZoomInMode",value:function(){var t=this.getComponent(Mt.ZOOM);t.startZoomInMode()}},{key:"endZoomInMode",value:function(){var t=this.getComponent(Mt.ZOOM);t.endZoomInMode()}},{key:"zoomOut",value:function(){var t=this.getComponent(Mt.ZOOM);t.zoomOut()}},{key:"startHandMode",value:function(){var t=this.getComponent(Mt.ZOOM);t.startHandMode()}},{key:"endHandMode",value:function(){var t=this.getComponent(Mt.ZOOM);t.endHandMode()}},{key:"resetZoom",value:function(){var t=this.getComponent(Mt.ZOOM);t.resetZoom()}},{key:"toDataURL",value:function(t){var e=this.getComponent(Mt.CROPPER);e.changeVisibility(!1);var i=this._canvas&&this._canvas.toDataURL(t);return e.changeVisibility(!0),i}},{key:"setCanvasImage",value:function(t,e){e&&Kt(e),this.imageName=t,this.canvasImage=e}},{key:"setCssMaxDimension",value:function(t){this.cssMaxWidth=t.width||this.cssMaxWidth,this.cssMaxHeight=t.height||this.cssMaxHeight}},{key:"adjustCanvasDimension",value:function(){this.adjustCanvasDimensionBase(this.canvasImage.scale(1))}},{key:"adjustCanvasDimensionBase",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;t||(t=this.canvasImage);var e=t.getBoundingRect(),i=e.width,n=e.height,r=this._calcMaxDimension(i,n);this.setCanvasCssDimension({width:"100%",height:"100%","max-width":"".concat(r.width,"px"),"max-height":"".concat(r.height,"px")}),this.setCanvasBackstoreDimension({width:i,height:n}),this._canvas.centerObject(t)}},{key:"setCanvasCssDimension",value:function(t){this._canvas.setDimensions(t,_s)}},{key:"setCanvasBackstoreDimension",value:function(t){this._canvas.setDimensions(t,xs)}},{key:"setImageProperties",value:function(t,e){var i=this.canvasImage;i&&(i.set(t).setCoords(),e&&this._canvas.renderAll())}},{key:"getCanvasElement",value:function(){return this._canvas.getElement()}},{key:"getCanvas",value:function(){return this._canvas}},{key:"getCanvasImage",value:function(){return this.canvasImage}},{key:"getImageName",value:function(){return this.imageName}},{key:"addImageObject",value:function(t){var e,i=this,n=j()(e=this._callbackAfterLoadingImageObject).call(e,this);return new(z())((function(e){F.fabric.Image.fromURL(t,(function(t){n(t),e(i.createObjectProperties(t))}),{crossOrigin:"Anonymous"})}))}},{key:"getCenter",value:function(){return this._canvas.getCenter()}},{key:"getCropzoneRect",value:function(){return this.getComponent(Mt.CROPPER).getCropzoneRect()}},{key:"setCropzoneRect",value:function(t){this.getComponent(Mt.CROPPER).setCropzoneRect(t)}},{key:"getCroppedImageData",value:function(t){return this.getComponent(Mt.CROPPER).getCroppedImageData(t)}},{key:"setBrush",value:function(t){var e=this._drawingMode,i=Mt.FREE_DRAWING;e===kt.LINE_DRAWING&&(i=Mt.LINE),this.getComponent(i).setBrush(t)}},{key:"setDrawingShape",value:function(t,e){this.getComponent(Mt.SHAPE).setStates(t,e)}},{key:"setIconStyle",value:function(t,e){this.getComponent(Mt.ICON).setStates(t,e)}},{key:"registerPaths",value:function(t){this.getComponent(Mt.ICON).registerPaths(t)}},{key:"changeCursor",value:function(t){var e=this.getCanvas();e.defaultCursor=t,e.renderAll()}},{key:"hasFilter",value:function(t){return this.getComponent(Mt.FILTER).hasFilter(t)}},{key:"setSelectionStyle",value:function(t){H()(Nt.SELECTION_STYLE,t)}},{key:"setObjectProperties",value:function(t,e){var i=this.getObject(t),n=H()({},e);return i.set(n),i.setCoords(),this.getCanvas().renderAll(),n}},{key:"getObjectProperties",value:function(t,e){var i=this.getObject(t),n={};return Q()(e)?n[e]=i[e]:ar()(e)?di()(e,(function(t){n[t]=i[t]})):cr()(e,(function(t,e){n[e]=i[e]})),n}},{key:"getObjectPosition",value:function(t,e,i){var n=this.getObject(t);return n?n.getPointByOrigin(e,i):null}},{key:"setObjectPosition",value:function(t,e){var i=this.getObject(t),n=e.x,r=e.y,o=e.originX,a=e.originY;if(!i)return!1;var s=i.getPointByOrigin(o,a),c=i.getPointByOrigin("center","center"),l=c.x-s.x,u=c.y-s.y;return i.set({left:n+l,top:r+u}),i.setCoords(),!0}},{key:"getCanvasSize",value:function(){var t=this.getCanvasImage();return{width:t?t.width:0,height:t?t.height:0}}},{key:"createStaticCanvas",value:function(){var t=new F.fabric.StaticCanvas;return t.set({enableRetinaScaling:!1}),t}},{key:"_getDrawingModeInstance",value:function(t){return this._drawingModeMap[t]}},{key:"_setObjectCachingToFalse",value:function(){F.fabric.Object.prototype.objectCaching=!1}},{key:"_setCanvasElement",value:function(t){var e,i;e=t.nodeType?t:document.querySelector(t),"CANVAS"!==e.nodeName.toUpperCase()&&(i=document.createElement("canvas"),e.appendChild(i)),this._canvas=new F.fabric.Canvas(i,{containerClass:"tui-image-editor-canvas-container",enableRetinaScaling:!1})}},{key:"_createDrawingModeInstances",value:function(){this._register(this._drawingModeMap,new ja),this._register(this._drawingModeMap,new za),this._register(this._drawingModeMap,new Ya),this._register(this._drawingModeMap,new Ga),this._register(this._drawingModeMap,new Ja),this._register(this._drawingModeMap,new $a),this._register(this._drawingModeMap,new ns),this._register(this._drawingModeMap,new vs)}},{key:"_createComponents",value:function(){this._register(this._componentMap,new pr(this)),this._register(this._componentMap,new Nr(this)),this._register(this._componentMap,new Br(this)),this._register(this._componentMap,new Ur(this)),this._register(this._componentMap,new Zr(this)),this._register(this._componentMap,new no(this)),this._register(this._componentMap,new uo(this)),this._register(this._componentMap,new vo(this)),this._register(this._componentMap,new Do(this)),this._register(this._componentMap,new ca(this)),this._register(this._componentMap,new Sa(this)),this._register(this._componentMap,new fs(this))}},{key:"_register",value:function(t,e){t[e.getName()]=e}},{key:"_isSameDrawingMode",value:function(t){return this.getDrawingMode()===t}},{key:"_calcMaxDimension",value:function(t,e){var i=this.cssMaxWidth/t,n=this.cssMaxHeight/e,r=Math.min(t,this.cssMaxWidth),o=Math.min(e,this.cssMaxHeight);return i<1&&i<n?(r=t*i,o=e*i):n<1&&n<i&&(r=t*n,o=e*n),{width:Math.floor(r),height:Math.floor(o)}}},{key:"_callbackAfterLoadingImageObject",value:function(t){var e=this.getCanvasImage().getCenterPoint();t.set(Nt.SELECTION_STYLE),t.set({left:e.x,top:e.y,crossOrigin:"Anonymous"}),this.getCanvas().add(t).setActiveObject(t)}},{key:"_attachCanvasEvents",value:function(){var t=this._canvas,e=this._handler;t.on({"mouse:down":e.onMouseDown,"object:added":e.onObjectAdded,"object:removed":e.onObjectRemoved,"object:moving":e.onObjectMoved,"object:scaling":e.onObjectScaled,"object:modified":e.onObjectModified,"object:rotating":e.onObjectRotated,"path:created":e.onPathCreated,"selection:cleared":e.onSelectionCleared,"selection:created":e.onSelectionCreated,"selection:updated":e.onObjectSelected})}},{key:"_onMouseDown",value:function(t){var e=this,i=t.e,n=t.target,r=this._canvas.getPointer(i);if(n){var o=n.type,a=ss(n,(function(t){return cs(e.getObjectId(t),t,"activeSelection"===o)}));os(a)}this.fire(At.MOUSE_DOWN,i,r)}},{key:"_onObjectAdded",value:function(t){var e=t.target;e.isType("cropzone")||this._addFabricObject(e)}},{key:"_onObjectRemoved",value:function(t){var e=t.target;this._removeFabricObject(Kt(e))}},{key:"_onObjectMoved",value:function(t){var e=this;this._lazyFire(At.OBJECT_MOVED,(function(t){return e.createObjectProperties(t)}),t.target)}},{key:"_onObjectScaled",value:function(t){var e=this;this._lazyFire(At.OBJECT_SCALED,(function(t){return e.createObjectProperties(t)}),t.target)}},{key:"_onObjectModified",value:function(t){var e=t.target;if("activeSelection"===e.type){var i=e.getObjects();st()(i).call(i,(function(t){return t.fire("modifiedInGroup",e)}))}this.fire(At.OBJECT_MODIFIED,e,this.getObjectId(e))}},{key:"_onObjectRotated",value:function(t){var e=this;this._lazyFire(At.OBJECT_ROTATED,(function(t){return e.createObjectProperties(t)}),t.target)}},{key:"_lazyFire",value:function(t,e,i){var n=this,r=i&&i.canvasEventDelegation,o=r?i.canvasEventDelegation(t):"none";"unregistered"===o&&i.canvasEventRegister(t,(function(i){n.fire(t,e(i))})),"none"===o&&this.fire(t,e(i))}},{key:"_onObjectSelected",value:function(t){var e=t.target,i=this.createObjectProperties(e);this.fire(At.OBJECT_ACTIVATED,i)}},{key:"_onPathCreated",value:function(t){var e=t.path.getCenterPoint(),i=e.x,n=e.y;t.path.set(H()({left:i,top:n},Nt.SELECTION_STYLE));var r=this.createObjectProperties(t.path);this.fire(At.ADD_OBJECT,r)}},{key:"_onSelectionCleared",value:function(){this.fire(At.SELECTION_CLEARED)}},{key:"_onSelectionCreated",value:function(t){var e=t.target,i=this.createObjectProperties(e);this.fire(At.OBJECT_ACTIVATED,i),this.fire(At.SELECTION_CREATED,t.target)}},{key:"discardSelection",value:function(){this._canvas.discardActiveObject(),this._canvas.renderAll()}},{key:"changeSelectableAll",value:function(t){this._canvas.forEachObject((function(e){e.selectable=t,e.hoverCursor=t?"move":"crosshair"}))}},{key:"createObjectProperties",value:function(t){var e=["left","top","width","height","fill","stroke","strokeWidth","opacity","angle"],i={id:Kt(t),type:t.type};if(H()(i,ee(t,e)),ye(["i-text","text"],t.type))H()(i,this._createTextProperties(t,i));else if(ye(["rect","triangle","circle"],t.type)){var n=this.getComponent(Mt.SHAPE);H()(i,{fill:n.makeFillPropertyForUserEvent(t)})}return i}},{key:"_createTextProperties",value:function(t){var e=["text","fontFamily","fontSize","fontStyle","textAlign","textDecoration","fontWeight"],i={};return H()(i,ee(t,e)),i}},{key:"_addFabricObject",value:function(t){var e=Kt(t);return this._objects[e]=t,e}},{key:"_removeFabricObject",value:function(t){delete this._objects[t]}},{key:"resetTargetObjectForCopyPaste",value:function(){var t=this.getActiveObject();t&&(this.targetObjectForCopyPaste=t)}},{key:"pasteObject",value:function(){var t=this;if(!this.targetObjectForCopyPaste)return z().resolve([]);var e=this.targetObjectForCopyPaste,i="activeSelection"===e.type,n=i?e.getObjects():[e],r=null;return this.discardSelection(),this._cloneObject(n).then((function(e){if(e.length>1)r=t.getActiveSelectionFromObjects(e);else{var i=it(e,1);r=i[0]}t.targetObjectForCopyPaste=r,t.setActiveObject(r)}))}},{key:"_cloneObject",value:function(t){var e=this,i=Ve()(t).call(t,(function(t){return e._cloneObjectItem(t)}));return z().all(i)}},{key:"_cloneObjectItem",value:function(t){var e=this;return this._copyFabricObjectForPaste(t).then((function(t){var i=e.createObjectProperties(t);return e.add(t),e.fire(At.ADD_OBJECT,i),t}))}},{key:"_copyFabricObjectForPaste",value:function(t){var e=this,i=function(t,e){return e?t-bs:t+bs};return this._copyFabricObject(t).then((function(t){var n=t.left,r=t.top,o=t.width,a=t.height,s=e.getCanvasSize(),c=s.width,l=s.height,u=n+o/2,h=r+a/2;return t.set(H()({left:i(n,u+bs>c),top:i(r,h+bs>l)},Nt.SELECTION_STYLE)),t}))}},{key:"_copyFabricObject",value:function(t){var e=this;return new(z())((function(i){t.clone((function(n){var r=e.getComponent(Mt.SHAPE);xe(n)&&r.processForCopiedObject(n,t),i(n)}))}))}},{key:"getCurrentDimensions",value:function(){var t=this.getComponent(Mt.RESIZE);return t.getCurrentDimensions()}},{key:"getOriginalDimensions",value:function(){var t=this.getComponent(Mt.RESIZE);return t.getOriginalDimensions()}},{key:"setOriginalDimensions",value:function(t){var e=this.getComponent(Mt.RESIZE);e.setOriginalDimensions(t)}},{key:"resize",value:function(t){var e=this.getComponent(Mt.RESIZE);return e.resize(t)}}]),t}();V().mixin(Cs);var Is=Cs,Ms=At.MOUSE_DOWN,Ss=At.OBJECT_MOVED,ws=At.OBJECT_SCALED,Ts=At.OBJECT_ACTIVATED,As=At.OBJECT_ROTATED,Ds=At.OBJECT_ADDED,Es=At.OBJECT_MODIFIED,ks=At.ADD_TEXT,Os=At.ADD_OBJECT,js=At.TEXT_EDITING,Ls=At.TEXT_CHANGED,Ns=At.ICON_CREATE_RESIZE,Ps=At.ICON_CREATE_END,zs=At.SELECTION_CLEARED,Rs=At.SELECTION_CREATED,Bs=At.ADD_OBJECT_AFTER,Fs=function(){function t(e,i){var n,r,o,a,s,c,l,u,h,f,d,g,p,v,m,y;if(D(this,t),i=H()({includeUI:!1,usageStatistics:!0},i),this.mode=null,this.activeObjectId=null,i.includeUI){var b=i.includeUI;b.usageStatistics=i.usageStatistics,this.ui=new tr(e,b,this.getActions()),i=this.ui.setUiDefaultSelectionStyle(i)}this._invoker=new He,this._graphics=new Is(this.ui?this.ui.getEditorArea():e,{cssMaxWidth:i.cssMaxWidth,cssMaxHeight:i.cssMaxHeight}),this._handlers={keydown:j()(n=this._onKeyDown).call(n,this),mousedown:j()(r=this._onMouseDown).call(r,this),objectActivated:j()(o=this._onObjectActivated).call(o,this),objectMoved:j()(a=this._onObjectMoved).call(a,this),objectScaled:j()(s=this._onObjectScaled).call(s,this),objectRotated:j()(c=this._onObjectRotated).call(c,this),objectAdded:j()(l=this._onObjectAdded).call(l,this),objectModified:j()(u=this._onObjectModified).call(u,this),createdPath:this._onCreatedPath,addText:j()(h=this._onAddText).call(h,this),addObject:j()(f=this._onAddObject).call(f,this),textEditing:j()(d=this._onTextEditing).call(d,this),textChanged:j()(g=this._onTextChanged).call(g,this),iconCreateResize:j()(p=this._onIconCreateResize).call(p,this),iconCreateEnd:j()(v=this._onIconCreateEnd).call(v,this),selectionCleared:j()(m=this._selectionCleared).call(m,this),selectionCreated:j()(y=this._selectionCreated).call(y,this)},this._attachInvokerEvents(),this._attachGraphicsEvents(),this._attachDomEvents(),this._setSelectionStyle(i.selectionStyle,{applyCropSelectionStyle:i.applyCropSelectionStyle,applyGroupSelectionStyle:i.applyGroupSelectionStyle}),i.usageStatistics&&ae(),this.ui&&(this.ui.initCanvas(),this.setReAction(),this._attachColorPickerInputBoxEvents()),F.fabric.enableGLFiltering=!1}return k(t,[{key:"_attachColorPickerInputBoxEvents",value:function(){var t=this;this.ui.on(At.INPUT_BOX_EDITING_STARTED,(function(){t.isColorPickerInputBoxEditing=!0})),this.ui.on(At.INPUT_BOX_EDITING_STOPPED,(function(){t.isColorPickerInputBoxEditing=!1}))}},{key:"_detachColorPickerInputBoxEvents",value:function(){this.ui.off(At.INPUT_BOX_EDITING_STARTED),this.ui.off(At.INPUT_BOX_EDITING_STOPPED)}},{key:"_setSelectionStyle",value:function(t,e){var i=e.applyCropSelectionStyle,n=e.applyGroupSelectionStyle;t&&this._graphics.setSelectionStyle(t),i&&this._graphics.setCropSelectionStyle(t),n&&this.on("selectionCreated",(function(e){"activeSelection"===e.type&&e.set(t)}))}},{key:"_attachInvokerEvents",value:function(){var t,e,i=this,n=At.UNDO_STACK_CHANGED,r=At.REDO_STACK_CHANGED,o=At.EXECUTE_COMMAND,a=At.AFTER_UNDO,s=At.AFTER_REDO,c=At.HAND_STARTED,l=At.HAND_STOPPED;if(this._invoker.on(n,j()(t=this.fire).call(t,this,n)),this._invoker.on(r,j()(e=this.fire).call(e,this,r)),this.ui){var u=this._graphics.getCanvas();this._invoker.on(o,(function(t){return i.ui.fire(o,t)})),this._invoker.on(a,(function(t){return i.ui.fire(a,t)})),this._invoker.on(s,(function(t){return i.ui.fire(s,t)})),u.on(c,(function(){return i.ui.fire(c)})),u.on(l,(function(){return i.ui.fire(l)}))}}},{key:"_attachGraphicsEvents",value:function(){var t;this._graphics.on((t={},A(t,Ms,this._handlers.mousedown),A(t,Ss,this._handlers.objectMoved),A(t,ws,this._handlers.objectScaled),A(t,As,this._handlers.objectRotated),A(t,Ts,this._handlers.objectActivated),A(t,Ds,this._handlers.objectAdded),A(t,Es,this._handlers.objectModified),A(t,ks,this._handlers.addText),A(t,Os,this._handlers.addObject),A(t,js,this._handlers.textEditing),A(t,Ls,this._handlers.textChanged),A(t,Ns,this._handlers.iconCreateResize),A(t,Ps,this._handlers.iconCreateEnd),A(t,zs,this._handlers.selectionCleared),A(t,Rs,this._handlers.selectionCreated),t))}},{key:"_attachDomEvents",value:function(){document.addEventListener("keydown",this._handlers.keydown)}},{key:"_detachDomEvents",value:function(){document.removeEventListener("keydown",this._handlers.keydown)}},{key:"_onKeyDown",value:function(t){var e=t.ctrlKey,i=t.keyCode,n=t.metaKey,r=e||n;r&&(i===Lt.C?this._graphics.resetTargetObjectForCopyPaste():i===Lt.V?(this._graphics.pasteObject(),this.clearRedoStack()):i===Lt.Z?this.undo()["catch"]((function(){})):i===Lt.Y&&this.redo()["catch"]((function(){})));var o=i===Lt.BACKSPACE||i===Lt.DEL,a=this._graphics.isReadyRemoveObject();!this.isColorPickerInputBoxEditing&&a&&o&&(t.preventDefault(),this.removeActiveObject())}},{key:"removeActiveObject",value:function(){var t=this._graphics.getActiveObjectIdForRemove();this.removeObject(t)}},{key:"_onMouseDown",value:function(t,e){this.fire(At.MOUSE_DOWN,t,e)}},{key:"_pushAddObjectCommand",value:function(t){var e=Fe.create(Tt.ADD_OBJECT,this._graphics,t);this._invoker.pushUndoStack(e)}},{key:"_pushModifyObjectCommand",value:function(t){var e=this,i=t.type,n=ss(t,(function(t){return cs(e._graphics.getObjectId(t),t,"activeSelection"===i)})),r=Fe.create(Tt.CHANGE_SELECTION,this._graphics,n);r.execute(this._graphics,n),this._invoker.pushUndoStack(r)}},{key:"_onObjectActivated",value:function(t){this.fire(At.OBJECT_ACTIVATED,t)}},{key:"_onObjectMoved",value:function(t){this.fire(At.OBJECT_MOVED,t)}},{key:"_onObjectScaled",value:function(t){this.fire(At.OBJECT_SCALED,t)}},{key:"_onObjectRotated",value:function(t){this.fire(At.OBJECT_ROTATED,t)}},{key:"getDrawingMode",value:function(){return this._graphics.getDrawingMode()}},{key:"clearObjects",value:function(){return this.execute(Tt.CLEAR_OBJECTS)}},{key:"deactivateAll",value:function(){this._graphics.deactivateAll(),this._graphics.renderAll()}},{key:"discardSelection",value:function(){this._graphics.discardSelection()}},{key:"changeSelectableAll",value:function(t){this._graphics.changeSelectableAll(t)}},{key:"_initHistory",value:function(){this.ui&&this.ui.initHistory()}},{key:"_clearHistory",value:function(){this.ui&&this.ui.clearHistory()}},{key:"execute",value:function(t){for(var e,i,n,r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];var s=N()(e=[this._graphics]).call(e,o);return(i=this._invoker).execute.apply(i,N()(n=[t]).call(n,w(s)))}},{key:"executeSilent",value:function(t){for(var e,i,n,r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];var s=N()(e=[this._graphics]).call(e,o);return(i=this._invoker).executeSilent.apply(i,N()(n=[t]).call(n,w(s)))}},{key:"undo",value:function(){for(var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=z().resolve(),n=0;n<e;n+=1)i=i.then((function(){return t._invoker.undo()}));return i}},{key:"redo",value:function(){for(var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=z().resolve(),n=0;n<e;n+=1)i=i.then((function(){return t._invoker.redo()}));return i}},{key:"zoom",value:function(t){var e=t.x,i=t.y,n=t.zoomLevel;this._graphics.zoom({x:e,y:i},n)}},{key:"resetZoom",value:function(){this._graphics.resetZoom()}},{key:"loadImageFromFile",value:function(t,e){if(!t)return z().reject(Pt.invalidParameters);var i=B().createObjectURL(t);return e=e||t.name,this.loadImageFromURL(i,e).then((function(e){return B().revokeObjectURL(t),e}))}},{key:"loadImageFromURL",value:function(t,e){return e&&t?this.execute(Tt.LOAD_IMAGE,e,t):z().reject(Pt.invalidParameters)}},{key:"addImageObject",value:function(t){return t?this.execute(Tt.ADD_IMAGE_OBJECT,t):z().reject(Pt.invalidParameters)}},{key:"startDrawingMode",value:function(t,e){return this._graphics.startDrawingMode(t,e)}},{key:"stopDrawingMode",value:function(){this._graphics.stopDrawingMode()}},{key:"crop",value:function(t){var e=this._graphics.getCroppedImageData(t);return e?this.loadImageFromURL(e.url,e.imageName):z().reject(Pt.invalidParameters)}},{key:"getCropzoneRect",value:function(){return this._graphics.getCropzoneRect()}},{key:"setCropzoneRect",value:function(t){this._graphics.setCropzoneRect(t)}},{key:"_flip",value:function(t){return this.execute(Tt.FLIP_IMAGE,t)}},{key:"flipX",value:function(){return this._flip("flipX")}},{key:"flipY",value:function(){return this._flip("flipY")}},{key:"resetFlip",value:function(){return this._flip("reset")}},{key:"_rotate",value:function(t,e,i){var n=null;return n=i?this.executeSilent(Tt.ROTATE_IMAGE,t,e):this.execute(Tt.ROTATE_IMAGE,t,e),n}},{key:"rotate",value:function(t,e){return this._rotate("rotate",t,e)}},{key:"setAngle",value:function(t,e){return this._rotate("setAngle",t,e)}},{key:"setBrush",value:function(t){this._graphics.setBrush(t)}},{key:"setDrawingShape",value:function(t,e){this._graphics.setDrawingShape(t,e)}},{key:"setDrawingIcon",value:function(t,e){this._graphics.setIconStyle(t,e)}},{key:"addShape",value:function(t,e){return e=e||{},this._setPositions(e),this.execute(Tt.ADD_SHAPE,t,e)}},{key:"changeShape",value:function(t,e,i){var n=i?"executeSilent":"execute";return this[n](Tt.CHANGE_SHAPE,t,e)}},{key:"addText",value:function(t,e){return t=t||"",e=e||{},this.execute(Tt.ADD_TEXT,t,e)}},{key:"changeText",value:function(t,e){return e=e||"",this.execute(Tt.CHANGE_TEXT,t,e)}},{key:"changeTextStyle",value:function(t,e,i){var n=i?"executeSilent":"execute";return this[n](Tt.CHANGE_TEXT_STYLE,t,e)}},{key:"_changeActivateMode",value:function(t){"ICON"!==t&&this.getDrawingMode()!==t&&this.startDrawingMode(t)}},{key:"_onTextChanged",value:function(t){this.fire(At.TEXT_CHANGED,t)}},{key:"_onIconCreateResize",value:function(t){this.fire(At.ICON_CREATE_RESIZE,t)}},{key:"_onIconCreateEnd",value:function(t){this.fire(At.ICON_CREATE_END,t)}},{key:"_onTextEditing",value:function(){this.fire(At.TEXT_EDITING)}},{key:"_onAddText",value:function(t){this.fire(At.ADD_TEXT,{originPosition:t.originPosition,clientPosition:t.clientPosition})}},{key:"_onAddObject",value:function(t){var e=this._graphics.getObject(t.id);this._invoker.fire(At.EXECUTE_COMMAND,Ce(e.type)),this._pushAddObjectCommand(e)}},{key:"_onObjectAdded",value:function(t){this.fire(Ds,t),this.fire(Bs,t)}},{key:"_onObjectModified",value:function(t){t.type!==Ct.CROPZONE&&(this._invoker.fire(At.EXECUTE_COMMAND,Ce(t.type)),this._pushModifyObjectCommand(t))}},{key:"_selectionCleared",value:function(){this.fire(zs)}},{key:"_selectionCreated",value:function(t){this.fire(Rs,t)}},{key:"registerIcons",value:function(t){this._graphics.registerPaths(t)}},{key:"changeCursor",value:function(t){this._graphics.changeCursor(t)}},{key:"addIcon",value:function(t,e){return e=e||{},this._setPositions(e),this.execute(Tt.ADD_ICON,t,e)}},{key:"changeIconColor",value:function(t,e){return this.execute(Tt.CHANGE_ICON_COLOR,t,e)}},{key:"removeObject",value:function(t){var e=this._graphics.getObject(t),i=e.type;return this.execute(Tt.REMOVE_OBJECT,t,Ce(i))}},{key:"hasFilter",value:function(t){return this._graphics.hasFilter(t)}},{key:"removeFilter",value:function(t){return this.execute(Tt.REMOVE_FILTER,t)}},{key:"applyFilter",value:function(t,e,i){var n=i?"executeSilent":"execute";return this[n](Tt.APPLY_FILTER,t,e)}},{key:"toDataURL",value:function(t){return this._graphics.toDataURL(t)}},{key:"getImageName",value:function(){return this._graphics.getImageName()}},{key:"clearUndoStack",value:function(){this._invoker.clearUndoStack()}},{key:"clearRedoStack",value:function(){this._invoker.clearRedoStack()}},{key:"isEmptyUndoStack",value:function(){return this._invoker.isEmptyUndoStack()}},{key:"isEmptyRedoStack",value:function(){return this._invoker.isEmptyRedoStack()}},{key:"resizeCanvasDimension",value:function(t){return t?this.execute(Tt.RESIZE_CANVAS_DIMENSION,t):z().reject(Pt.invalidParameters)}},{key:"destroy",value:function(){var t=this;this.stopDrawingMode(),this._detachDomEvents(),this._graphics.destroy(),this._graphics=null,this.ui&&(this._detachColorPickerInputBoxEvents(),this.ui.destroy()),X()(this,(function(e,i){t[i]=null}),this)}},{key:"_setPositions",value:function(t){var e=this._graphics.getCenter();W()(t.left)&&(t.left=e.left),W()(t.top)&&(t.top=e.top)}},{key:"setObjectProperties",value:function(t,e){return this.execute(Tt.SET_OBJECT_PROPERTIES,t,e)}},{key:"setObjectPropertiesQuietly",value:function(t,e){this._graphics.setObjectProperties(t,e)}},{key:"getObjectProperties",value:function(t,e){var i=this._graphics.getObject(t);return i?this._graphics.getObjectProperties(t,e):null}},{key:"getCanvasSize",value:function(){return this._graphics.getCanvasSize()}},{key:"getObjectPosition",value:function(t,e,i){return this._graphics.getObjectPosition(t,e,i)}},{key:"setObjectPosition",value:function(t,e){return this.execute(Tt.SET_OBJECT_POSITION,t,e)}},{key:"resize",value:function(t){return this.execute(Tt.RESIZE_IMAGE,t)}}]),t}();rr.mixin(Fs),V().mixin(Fs);var Ys=Fs,Hs=Mt.ICON,Us={name:Tt.ADD_ICON,execute:function(t,e,i){var n=this,r=t.getComponent(Hs);return r.add(e,i).then((function(e){return n.undoData.object=t.getObject(e.id),e}))},undo:function(t){return t.remove(this.undoData.object),z().resolve()}};Fe.register(Us);var Ws={name:Tt.ADD_IMAGE_OBJECT,execute:function(t,e){var i=this;return t.addImageObject(e).then((function(e){return i.undoData.object=t.getObject(e.id),e}))},undo:function(t){return t.remove(this.undoData.object),z().resolve()}};Fe.register(Ws);var Gs={name:Tt.ADD_OBJECT,execute:function(t,e){return new(z())((function(i,n){t.contains(e)?n(Pt.addedObject):(t.add(e),i(e))}))},undo:function(t,e){return new(z())((function(i,n){t.contains(e)?(t.remove(e),i(e)):n(Pt.noObject)}))}};Fe.register(Gs);var Xs=Mt.SHAPE,Zs={name:Tt.ADD_SHAPE,execute:function(t,e,i){var n=this,r=t.getComponent(Xs);return r.add(e,i).then((function(e){var i=e.id;return n.undoData.object=t.getObject(i),e}))},undo:function(t){return t.remove(this.undoData.object),z().resolve()}};Fe.register(Zs);var Vs=Mt.TEXT,Js={name:Tt.ADD_TEXT,execute:function(t,e,i){var n=this,r=t.getComponent(Vs);if(this.undoData.object){var o=this.undoData.object;return new(z())((function(e,i){t.contains(o)?i(Pt.redo):(t.add(o),e(o))}))}return r.add(e,i).then((function(e){var i=e.id,r=t.getObject(i);return n.undoData.object=r,os(ss(r,(function(){return cs(i,r,!1)}))),e}))},undo:function(t){return t.remove(this.undoData.object),z().resolve()}};Fe.register(Js);var Qs=Mt.FILTER,Ks=null;function qs(t,e,i){var n={};return"mask"===t&&(n.object=i.mask),n.options=e,n}var $s={name:Tt.APPLY_FILTER,execute:function(t,e,i,n){var r=t.getComponent(Qs);if("mask"===e){var o=t.getObject(i.maskObjId);if(!o||!o.isType("image"))return z().reject(Pt.invalidParameters);H()(i,{mask:o}),t.remove(i.mask)}if(!this.isRedo){var a=r.getOptions(e),s=qs(e,a,i);Ks=this.setUndoData(s,Ks,n)}return r.add(e,i)},undo:function(t,e){var i=t.getComponent(Qs);if("mask"===e){var n=this.undoData.object;return t.add(n),t.setActiveObject(n),i.remove(e)}return this.undoData.options?i.add(e,this.undoData.options):i.remove(e)}};Fe.register($s);var tc=Mt.ICON,ec={name:Tt.CHANGE_ICON_COLOR,execute:function(t,e,i){var n=this;return new(z())((function(r,o){var a=t.getComponent(tc),s=t.getObject(e);s||o(Pt.noObject),n.undoData.object=s,n.undoData.color=a.getColor(s),a.setColor(i,s),r()}))},undo:function(t){var e=t.getComponent(tc),i=this.undoData,n=i.object,r=i.color;return e.setColor(r,n),z().resolve()}};Fe.register(ec);var ic=Mt.SHAPE,nc=null;function rc(t,e){var i={object:e,options:{}};return cr()(t,(function(t,n){i.options[n]=e[n]})),i}var oc={name:Tt.CHANGE_SHAPE,execute:function(t,e,i,n){var r=t.getComponent(ic),o=t.getObject(e);if(!o)return z().reject(Pt.noObject);if(!this.isRedo){var a=rc(i,o);nc=this.setUndoData(a,nc,n)}return r.change(o,i)},undo:function(t){var e=t.getComponent(ic),i=this.undoData,n=i.object,r=i.options;return e.change(n,r)}};Fe.register(oc);var ac=Mt.TEXT,sc={name:Tt.CHANGE_TEXT,execute:function(t,e,i){var n=t.getComponent(ac),r=t.getObject(e);return r?(this.undoData.object=r,this.undoData.text=n.getText(r),n.change(r,i)):z().reject(Pt.noObject)},undo:function(t){var e=t.getComponent(ac),i=this.undoData,n=i.object,r=i.text;return e.change(n,r)}};Fe.register(sc);var cc=Mt.TEXT,lc=null;function uc(t,e){var i={object:e,styles:{}};return cr()(t,(function(t,n){var r=e[n];i.styles[n]=r})),i}var hc={name:Tt.CHANGE_TEXT_STYLE,execute:function(t,e,i,n){var r=t.getComponent(cc),o=t.getObject(e);if(!o)return z().reject(Pt.noObject);if(!this.isRedo){var a=uc(i,o);lc=this.setUndoData(a,lc,n)}return r.setStyle(o,i)},undo:function(t){var e=t.getComponent(cc),i=this.undoData,n=i.object,r=i.styles;return e.setStyle(n,r)}};Fe.register(hc);var fc={name:Tt.CLEAR_OBJECTS,execute:function(t){var e=this;return new(z())((function(i){e.undoData.objects=t.removeAll(),i()}))},undo:function(t){return t.add(this.undoData.objects),z().resolve()}};Fe.register(fc);var dc=Mt.FLIP,gc={name:Tt.FLIP_IMAGE,execute:function(t,e){var i=t.getComponent(dc);return this.undoData.setting=i.getCurrentSetting(),i[e]()},undo:function(t){var e=t.getComponent(dc);return e.set(this.undoData.setting)}};Fe.register(gc);var pc=Mt.IMAGE_LOADER,vc={name:Tt.LOAD_IMAGE,execute:function(t,e,i){var n,r=t.getComponent(pc),o=r.getCanvasImage(),a=o?o.width:0,s=o?o.height:0,c=ir()(n=t.removeAll(!0)).call(n,(function(t){return"cropzone"!==t.type}));return st()(c).call(c,(function(t){t.evented=!0})),this.undoData={name:r.getImageName(),image:o,objects:c},r.load(e,i).then((function(t){return{oldWidth:a,oldHeight:s,newWidth:t.width,newHeight:t.height}}))},undo:function(t){var e=t.getComponent(pc),i=this.undoData,n=i.objects,r=i.name,o=i.image;return t.removeAll(!0),t.add(n),e.load(r,o)}};Fe.register(vc);var mc=Mt.FILTER,yc={name:Tt.REMOVE_FILTER,execute:function(t,e){var i=t.getComponent(mc);return this.undoData.options=i.getOptions(e),i.remove(e)},undo:function(t,e){var i=t.getComponent(mc),n=this.undoData.options;return i.add(e,n)}};Fe.register(yc);var bc={name:Tt.REMOVE_OBJECT,execute:function(t,e){var i=this;return new(z())((function(n,r){i.undoData.objects=t.removeObjectById(e),i.undoData.objects.length?n():r(Pt.noObject)}))},undo:function(t){return t.add(this.undoData.objects),z().resolve()}};Fe.register(bc);var _c={name:Tt.RESIZE_CANVAS_DIMENSION,execute:function(t,e){var i=this;return new(z())((function(n){i.undoData.size={width:t.cssMaxWidth,height:t.cssMaxHeight},t.setCssMaxDimension(e),t.adjustCanvasDimension(),n()}))},undo:function(t){return t.setCssMaxDimension(this.undoData.size),t.adjustCanvasDimension(),z().resolve()}};Fe.register(_c);var xc=Mt.ROTATION,Cc=null;function Ic(t){return{angle:t.getCurrentAngle()}}var Mc={name:Tt.ROTATE_IMAGE,execute:function(t,e,i,n){var r=t.getComponent(xc);if(!this.isRedo){var o=Ic(r);Cc=this.setUndoData(o,Cc,n)}return r[e](i)},undo:function(t){var e=t.getComponent(xc),i=it(this.args,3),n=i[1],r=i[2];return"setAngle"===n?e[n](this.undoData.angle):e.rotate(-r)}};Fe.register(Mc);var Sc={name:Tt.SET_OBJECT_PROPERTIES,execute:function(t,e,i){var n=this,r=t.getObject(e);return r?(this.undoData.props={},cr()(i,(function(t,e){n.undoData.props[e]=r[e]})),t.setObjectProperties(e,i),z().resolve()):z().reject(Pt.noObject)},undo:function(t,e){var i=this.undoData.props;return t.setObjectProperties(e,i),z().resolve()}};Fe.register(Sc);var wc={name:Tt.SET_OBJECT_POSITION,execute:function(t,e,i){var n=t.getObject(e);return n?(this.undoData.objectId=e,this.undoData.props=t.getObjectProperties(e,["left","top"]),t.setObjectPosition(e,i),t.renderAll(),z().resolve()):z().reject(Pt.noObject)},undo:function(t){var e=this.undoData,i=e.objectId,n=e.props;return t.setObjectProperties(i,n),t.renderAll(),z().resolve()}};Fe.register(wc);var Tc={name:Tt.CHANGE_SELECTION,execute:function(t,e){return this.isRedo?st()(e).call(e,(function(e){t.setObjectProperties(e.id,e)})):this.undoData=as(),z().resolve()},undo:function(t){var e;return st()(e=this.undoData).call(e,(function(e){t.setObjectProperties(e.id,e)})),z().resolve()}};Fe.register(Tc);var Ac=Mt.RESIZE,Dc={name:Tt.RESIZE_IMAGE,execute:function(t,e){var i=t.getComponent(Ac),n=i.getOriginalDimensions();return n||(n=i.getCurrentDimensions()),this.undoData.dimensions=n,i.resize(e)},undo:function(t){var e=t.getComponent(Ac);return e.resize(this.undoData.dimensions)}};Fe.register(Dc);var Ec=Ys}(),o=o["default"],o}()}))}).call(this,i("b639").Buffer)},b39a:function(t,e,i){"use strict";var n=i("da84"),r=i("ebb5"),o=i("d039"),a=n.Int8Array,s=r.aTypedArray,c=r.exportTypedArrayMethod,l=[].toLocaleString,u=[].slice,h=!!a&&o((function(){l.call(new a(1))})),f=o((function(){return[1,2].toLocaleString()!=new a([1,2]).toLocaleString()}))||!o((function(){a.prototype.toLocaleString.call([1,2])}));c("toLocaleString",(function(){return l.apply(h?u.call(s(this)):s(this),arguments)}),f)},c1ac:function(t,e,i){"use strict";var n=i("ebb5"),r=i("b727").filter,o=i("4840"),a=n.aTypedArray,s=n.aTypedArrayConstructor,c=n.exportTypedArrayMethod;c("filter",(function(t){var e=r(a(this),t,arguments.length>1?arguments[1]:void 0),i=o(this,this.constructor),n=0,c=e.length,l=new(s(i))(c);while(c>n)l[n]=e[n++];return l}))},ca91:function(t,e,i){"use strict";var n=i("ebb5"),r=i("d58f").left,o=n.aTypedArray,a=n.exportTypedArrayMethod;a("reduce",(function(t){return r(o(this),t,arguments.length,arguments.length>1?arguments[1]:void 0)}))},cd26:function(t,e,i){"use strict";var n=i("ebb5"),r=n.aTypedArray,o=n.exportTypedArrayMethod,a=Math.floor;o("reverse",(function(){var t,e=this,i=r(e).length,n=a(i/2),o=0;while(o<n)t=e[o],e[o++]=e[--i],e[i]=t;return e}))},d139:function(t,e,i){"use strict";var n=i("ebb5"),r=i("b727").find,o=n.aTypedArray,a=n.exportTypedArrayMethod;a("find",(function(t){return r(o(this),t,arguments.length>1?arguments[1]:void 0)}))},d58f:function(t,e,i){var n=i("1c0b"),r=i("7b0b"),o=i("44ad"),a=i("50c4"),s=function(t){return function(e,i,s,c){n(i);var l=r(e),u=o(l),h=a(l.length),f=t?h-1:0,d=t?-1:1;if(s<2)while(1){if(f in u){c=u[f],f+=d;break}if(f+=d,t?f<0:h<=f)throw TypeError("Reduce of empty array with no initial value")}for(;t?f>=0:h>f;f+=d)f in u&&(c=i(c,u[f],f,l));return c}};t.exports={left:s(!1),right:s(!0)}},d5d6:function(t,e,i){"use strict";var n=i("ebb5"),r=i("b727").forEach,o=n.aTypedArray,a=n.exportTypedArrayMethod;a("forEach",(function(t){r(o(this),t,arguments.length>1?arguments[1]:void 0)}))},e58c:function(t,e,i){"use strict";var n=i("fc6a"),r=i("a691"),o=i("50c4"),a=i("a640"),s=i("ae40"),c=Math.min,l=[].lastIndexOf,u=!!l&&1/[1].lastIndexOf(1,-0)<0,h=a("lastIndexOf"),f=s("indexOf",{ACCESSORS:!0,1:0}),d=u||!h||!f;t.exports=d?function(t){if(u)return l.apply(this,arguments)||0;var e=n(this),i=o(e.length),a=i-1;for(arguments.length>1&&(a=c(a,r(arguments[1]))),a<0&&(a=i+a);a>=0;a--)if(a in e&&e[a]===t)return a||0;return-1}:l},e91f:function(t,e,i){"use strict";var n=i("ebb5"),r=i("4d64").indexOf,o=n.aTypedArray,a=n.exportTypedArrayMethod;a("indexOf",(function(t){return r(o(this),t,arguments.length>1?arguments[1]:void 0)}))},ebb5:function(t,e,i){"use strict";var n,r=i("a981"),o=i("83ab"),a=i("da84"),s=i("861d"),c=i("5135"),l=i("f5df"),u=i("9112"),h=i("6eeb"),f=i("9bf2").f,d=i("e163"),g=i("d2bb"),p=i("b622"),v=i("90e3"),m=a.Int8Array,y=m&&m.prototype,b=a.Uint8ClampedArray,_=b&&b.prototype,x=m&&d(m),C=y&&d(y),I=Object.prototype,M=I.isPrototypeOf,S=p("toStringTag"),w=v("TYPED_ARRAY_TAG"),T=r&&!!g&&"Opera"!==l(a.opera),A=!1,D={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},E=function(t){var e=l(t);return"DataView"===e||c(D,e)},k=function(t){return s(t)&&c(D,l(t))},O=function(t){if(k(t))return t;throw TypeError("Target is not a typed array")},j=function(t){if(g){if(M.call(x,t))return t}else for(var e in D)if(c(D,n)){var i=a[e];if(i&&(t===i||M.call(i,t)))return t}throw TypeError("Target is not a typed array constructor")},L=function(t,e,i){if(o){if(i)for(var n in D){var r=a[n];r&&c(r.prototype,t)&&delete r.prototype[t]}C[t]&&!i||h(C,t,i?e:T&&y[t]||e)}},N=function(t,e,i){var n,r;if(o){if(g){if(i)for(n in D)r=a[n],r&&c(r,t)&&delete r[t];if(x[t]&&!i)return;try{return h(x,t,i?e:T&&m[t]||e)}catch(s){}}for(n in D)r=a[n],!r||r[t]&&!i||h(r,t,e)}};for(n in D)a[n]||(T=!1);if((!T||"function"!=typeof x||x===Function.prototype)&&(x=function(){throw TypeError("Incorrect invocation")},T))for(n in D)a[n]&&g(a[n],x);if((!T||!C||C===I)&&(C=x.prototype,T))for(n in D)a[n]&&g(a[n].prototype,C);if(T&&d(_)!==C&&g(_,C),o&&!c(C,S))for(n in A=!0,f(C,S,{get:function(){return s(this)?this[w]:void 0}}),D)a[n]&&u(a[n],w,n);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:T,TYPED_ARRAY_TAG:A&&w,aTypedArray:O,aTypedArrayConstructor:j,exportTypedArrayMethod:L,exportTypedArrayStaticMethod:N,isView:E,isTypedArray:k,TypedArray:x,TypedArrayPrototype:C}},f8cd:function(t,e,i){var n=i("a691");t.exports=function(t){var e=n(t);if(e<0)throw RangeError("The argument can't be less than 0");return e}},fec2:function(t,e,i){
  17. /*!
  18. * TOAST UI Color Picker
  19. * @version 2.2.8
  20. * @author NHN Cloud FE Development Team <dl_javascript@nhn.com>
  21. * @license MIT
  22. */
  23. (function(e,i){t.exports=i()})(window,(function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="dist",i(i.s=33)}([function(t,e,i){"use strict";function n(t,e){var i,n,r,o,a=Object.prototype.hasOwnProperty;for(r=1,o=arguments.length;r<o;r+=1)for(n in i=arguments[r],i)a.call(i,n)&&(t[n]=i[n]);return t}t.exports=n},function(t,e,i){"use strict";function n(t){return t instanceof Array}t.exports=n},function(t,e,i){"use strict";var n=i(1),r=i(6),o=i(7);function a(t,e,i){n(t)?r(t,e,i):o(t,e,i)}t.exports=a},function(t,e,i){"use strict";function n(t){return void 0===t}t.exports=n},function(t,e,i){"use strict";var n=i(22),r=i(2),o=i(6),a=i(7),s=i(37),c=0,l={getLength:function(t){var e=0;return a(t,(function(){e+=1})),e},map:function(t,e,i){var n=[];return r(t,(function(){n.push(e.apply(i||null,arguments))})),n},filter:function(t,e,i){var n=[];return o(t,(function(t){e.apply(i||null,arguments)&&n.push(t)})),n},generateId:function(){return c+=1,c},isOldBrowser:function(){return n.msie&&n.version<9}(),sendHostName:function(){s("color-picker","UA-129987462-1")}};t.exports=l},function(t,e,i){"use strict";var n=i(1);function r(t,e,i){var r,o;if(i=i||0,!n(e))return-1;if(Array.prototype.indexOf)return Array.prototype.indexOf.call(e,t,i);for(o=e.length,r=i;i>=0&&r<o;r+=1)if(e[r]===t)return r;return-1}t.exports=r},function(t,e,i){"use strict";function n(t,e,i){var n=0,r=t.length;for(i=i||null;n<r;n+=1)if(!1===e.call(i,t[n],n,t))break}t.exports=n},function(t,e,i){"use strict";function n(t,e,i){var n;for(n in i=i||null,t)if(t.hasOwnProperty(n)&&!1===e.call(i,t[n],n,t))break}t.exports=n},function(t,e,i){"use strict";var n=i(39),r=i(13),o=i(41),a=i(3),s=i(9),c=i(19),l=i(4);function u(t,e){var i=l.generateId();t=t||{},a(e)&&(e=s.appendHTMLElement("div")),n(e,"tui-view-"+i),this.id=i,this.container=e,this.childs=new c((function(t){return t.id})),this.parent=null}u.prototype.addChild=function(t,e){e&&e.call(t,this),t.parent=this,this.childs.add(t)},u.prototype.removeChild=function(t,e){var i=o(t)?this.childs.items[t]:t;e&&e.call(i,this),this.childs.remove(i.id)},u.prototype.render=function(){this.childs.each((function(t){t.render()}))},u.prototype.recursive=function(t,e){r(t)&&(e||t(this),this.childs.each((function(e){e.recursive(t)})))},u.prototype.resize=function(){var t=Array.prototype.slice.call(arguments),e=this.parent;while(e)r(e._onResize)&&e._onResize.apply(e,t),e=e.parent},u.prototype._beforeDestroy=function(){},u.prototype._destroy=function(){this._beforeDestroy(),this.container.innerHTML="",this.id=this.parent=this.childs=this.container=null},u.prototype.destroy=function(t){this.childs&&(this.childs.each((function(t){t.destroy(!0),t._destroy()})),this.childs.clear()),t||this._destroy()},u.prototype.getViewBound=function(){var t=this.container.getBoundingClientRect();return{x:t.left,y:t.top,width:t.right-t.left,height:t.bottom-t.top}},t.exports=u},function(t,e,i){"use strict";var n={appendHTMLElement:function(t,e,i){var n=document.createElement(t);return n.className=i||"",e?e.appendChild(n):document.body.appendChild(n),n}};t.exports=n},function(t,e,i){"use strict";var n=i(0),r=i(20),o=i(11),a=i(21),s=i(1),c=i(13),l=i(2),u=/\s+/g;function h(){this.events=null,this.contexts=null}h.mixin=function(t){n(t.prototype,h.prototype)},h.prototype._getHandlerItem=function(t,e){var i={handler:t};return e&&(i.context=e),i},h.prototype._safeEvent=function(t){var e,i=this.events;return i||(i=this.events={}),t&&(e=i[t],e||(e=[],i[t]=e),i=e),i},h.prototype._safeContext=function(){var t=this.contexts;return t||(t=this.contexts=[]),t},h.prototype._indexOfContext=function(t){var e=this._safeContext(),i=0;while(e[i]){if(t===e[i][0])return i;i+=1}return-1},h.prototype._memorizeContext=function(t){var e,i;r(t)&&(e=this._safeContext(),i=this._indexOfContext(t),i>-1?e[i][1]+=1:e.push([t,1]))},h.prototype._forgetContext=function(t){var e,i;r(t)&&(e=this._safeContext(),i=this._indexOfContext(t),i>-1&&(e[i][1]-=1,e[i][1]<=0&&e.splice(i,1)))},h.prototype._bindEvent=function(t,e,i){var n=this._safeEvent(t);this._memorizeContext(i),n.push(this._getHandlerItem(e,i))},h.prototype.on=function(t,e,i){var n=this;o(t)?(t=t.split(u),l(t,(function(t){n._bindEvent(t,e,i)}))):a(t)&&(i=e,l(t,(function(t,e){n.on(e,t,i)})))},h.prototype.once=function(t,e,i){var n=this;if(a(t))return i=e,void l(t,(function(t,e){n.once(e,t,i)}));function r(){e.apply(i,arguments),n.off(t,r,i)}this.on(t,r,i)},h.prototype._spliceMatches=function(t,e){var i,n=0;if(s(t))for(i=t.length;n<i;n+=1)!0===e(t[n])&&(t.splice(n,1),i-=1,n-=1)},h.prototype._matchHandler=function(t){var e=this;return function(i){var n=t===i.handler;return n&&e._forgetContext(i.context),n}},h.prototype._matchContext=function(t){var e=this;return function(i){var n=t===i.context;return n&&e._forgetContext(i.context),n}},h.prototype._matchHandlerAndContext=function(t,e){var i=this;return function(n){var r=t===n.handler,o=e===n.context,a=r&&o;return a&&i._forgetContext(n.context),a}},h.prototype._offByEventName=function(t,e){var i=this,n=c(e),r=i._matchHandler(e);t=t.split(u),l(t,(function(t){var e=i._safeEvent(t);n?i._spliceMatches(e,r):(l(e,(function(t){i._forgetContext(t.context)})),i.events[t]=[])}))},h.prototype._offByHandler=function(t){var e=this,i=this._matchHandler(t);l(this._safeEvent(),(function(t){e._spliceMatches(t,i)}))},h.prototype._offByObject=function(t,e){var i,n=this;this._indexOfContext(t)<0?l(t,(function(t,e){n.off(e,t)})):o(e)?(i=this._matchContext(t),n._spliceMatches(this._safeEvent(e),i)):c(e)?(i=this._matchHandlerAndContext(e,t),l(this._safeEvent(),(function(t){n._spliceMatches(t,i)}))):(i=this._matchContext(t),l(this._safeEvent(),(function(t){n._spliceMatches(t,i)})))},h.prototype.off=function(t,e){o(t)?this._offByEventName(t,e):arguments.length?c(t)?this._offByHandler(t):a(t)&&this._offByObject(t,e):(this.events={},this.contexts=[])},h.prototype.fire=function(t){this.invoke.apply(this,arguments)},h.prototype.invoke=function(t){var e,i,n,r;if(!this.hasListener(t))return!0;e=this._safeEvent(t),i=Array.prototype.slice.call(arguments,1),n=0;while(e[n]){if(r=e[n],!1===r.handler.apply(r.context,i))return!1;n+=1}return!0},h.prototype.hasListener=function(t){return this.getListenerLength(t)>0},h.prototype.getListenerLength=function(t){var e=this._safeEvent(t);return e.length},t.exports=h},function(t,e,i){"use strict";function n(t){return"string"===typeof t||t instanceof String}t.exports=n},function(t,e,i){"use strict";var n=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i,r={leadingZero:function(t,e){var i="",n=0;if((t+"").length>e)return t+"";for(;n<e-1;n+=1)i+="0";return(i+t).slice(-1*e)},isValidRGB:function(t){return n.test(t)},hexToRGB:function(t){var e,i,n;return!!r.isValidRGB(t)&&(t=t.substring(1),e=parseInt(t.substr(0,2),16),i=parseInt(t.substr(2,2),16),n=parseInt(t.substr(4,2),16),[e,i,n])},rgbToHEX:function(t,e,i){var n="#"+r.leadingZero(t.toString(16),2)+r.leadingZero(e.toString(16),2)+r.leadingZero(i.toString(16),2);return!!r.isValidRGB(n)&&n},rgbToHSV:function(t,e,i){var n,r,o,a,s,c;if(t/=255,e/=255,i/=255,n=Math.max(t,e,i),r=Math.min(t,e,i),s=n,c=n-r,a=0===n?0:c/n,n===r)o=0;else{switch(n){case t:o=(e-i)/c+(e<i?6:0);break;case e:o=(i-t)/c+2;break;case i:o=(t-e)/c+4;break}o/=6}return[Math.round(360*o),Math.round(100*a),Math.round(100*s)]},hsvToRGB:function(t,e,i){var n,r,o,a,s,c,l,u;if(t=Math.max(0,Math.min(360,t)),e=Math.max(0,Math.min(100,e)),i=Math.max(0,Math.min(100,i)),e/=100,i/=100,0===e)return n=r=o=i,[Math.round(255*n),Math.round(255*r),Math.round(255*o)];switch(t/=60,a=Math.floor(t),s=t-a,c=i*(1-e),l=i*(1-e*s),u=i*(1-e*(1-s)),a){case 0:n=i,r=u,o=c;break;case 1:n=l,r=i,o=c;break;case 2:n=c,r=i,o=u;break;case 3:n=c,r=l,o=i;break;case 4:n=u,r=c,o=i;break;default:n=i,r=c,o=l;break}return[Math.round(255*n),Math.round(255*r),Math.round(255*o)]}};t.exports=r},function(t,e,i){"use strict";function n(t){return t instanceof Function}t.exports=n},function(t,e,i){"use strict";var n=i(11),r=i(2),o=i(26);function a(t,e,i,o){n(e)?r(e.split(/\s+/g),(function(e){s(t,e,i,o)})):r(e,(function(e,n){s(t,n,e,i)}))}function s(t,e,i,n){function r(e){i.call(n||t,e||window.event)}"addEventListener"in t?t.addEventListener(e,r):"attachEvent"in t&&t.attachEvent("on"+e,r),c(t,e,i,r)}function c(t,e,i,n){var a=o(t,e),s=!1;r(a,(function(t){return t.handler!==i||(s=!0,!1)})),s||a.push({handler:i,wrappedHandler:n})}t.exports=a},function(t,e,i){"use strict";function n(t){t.preventDefault?t.preventDefault():t.returnValue=!1}t.exports=n},function(t,e,i){"use strict";function n(t){return t.replace(/([A-Z])/g,(function(t){return"-"+t.toLowerCase()}))}t.exports=n},function(t,e,i){"use strict";var n=i(11),r=i(2),o=i(26);function a(t,e,i){n(e)?r(e.split(/\s+/g),(function(e){s(t,e,i)})):r(e,(function(e,i){s(t,i,e)}))}function s(t,e,i){var n,a=o(t,e);i?(r(a,(function(r,o){return i!==r.handler||(c(t,e,r.wrappedHandler),n=o,!1)})),a.splice(n,1)):(r(a,(function(i){c(t,e,i.wrappedHandler)})),a.splice(0,a.length))}function c(t,e,i){"removeEventListener"in t?t.removeEventListener(e,i):"detachEvent"in t&&t.detachEvent("on"+e,i)}t.exports=a},function(t,e,i){"use strict";var n=i(50);function r(t,e){var i=n(e.prototype);i.constructor=t,t.prototype=i}t.exports=r},function(t,e,i){"use strict";var n=i(6),r=i(7),o=i(0),a=i(1),s=i(20),c=i(13),l=i(21),u=i(4),h=Array.prototype.slice;function f(t){this.items={},this.length=0,c(t)&&(this.getItemID=t)}f.and=function(t){var e;return t=h.call(arguments),e=t.length,function(i){for(var n=0;n<e;n+=1)if(!t[n].call(null,i))return!1;return!0}},f.or=function(t){var e;return t=h.call(arguments),e=t.length,function(i){for(var n=1,r=t[0].call(null,i);n<e;n+=1)r=r||t[n].call(null,i);return r}},f.merge=function(t){var e={},i=new f(t.getItemID);return n(arguments,(function(t){o(e,t.items)})),i.items=e,i.length=u.getLength(i.items),i},f.prototype.getItemID=function(t){return t._id+""},f.prototype.add=function(t){var e,i;arguments.length>1?n(h.call(arguments),(function(t){this.add(t)}),this):(e=this.getItemID(t),i=this.items,i[e]||(this.length+=1),i[e]=t)},f.prototype.remove=function(t){var e,i,n=[];return this.length?arguments.length>1?(n=u.map(h.call(arguments),(function(t){return this.remove(t)}),this),n):(e=this.items,l(t)&&(t=this.getItemID(t)),e[t]?(this.length-=1,i=e[t],delete e[t],i):n):n},f.prototype.clear=function(){this.items={},this.length=0},f.prototype.has=function(t){var e,i;return!!this.length&&(e=c(t),i=!1,e?this.each((function(e){return!0!==t(e)||(i=!0,!1)})):(t=l(t)?this.getItemID(t):t,i=s(this.items[t])),i)},f.prototype.doWhenHas=function(t,e,i){var n=this.items[t];s(n)&&e.call(i||this,n)},f.prototype.find=function(t){var e=new f;return this.hasOwnProperty("getItemID")&&(e.getItemID=this.getItemID),this.each((function(i){!0===t(i)&&e.add(i)})),e},f.prototype.groupBy=function(t,e){var i,r,o={},s=c(t),l=this.getItemID;if(a(t)){if(n(t,(function(t){o[t+""]=new f(l)})),!e)return o;t=e,s=!0}return this.each((function(e){s?r=t(e):(r=e[t],c(r)&&(r=r.apply(e))),i=o[r],i||(i=o[r]=new f(l)),i.add(e)})),o},f.prototype.single=function(){var t;return this.each((function(e){return t=e,!1}),this),t},f.prototype.sort=function(t){var e=[];return this.each((function(t){e.push(t)})),c(t)&&(e=e.sort(t)),e},f.prototype.each=function(t,e){r(this.items,t,e||this)},f.prototype.toArray=function(){return this.length?u.map(this.items,(function(t){return t})):[]},t.exports=f},function(t,e,i){"use strict";var n=i(3),r=i(36);function o(t){return!n(t)&&!r(t)}t.exports=o},function(t,e,i){"use strict";function n(t){return t===Object(t)}t.exports=n},function(t,e,i){"use strict";var n={chrome:!1,firefox:!1,safari:!1,msie:!1,edge:!1,others:!1,version:0};function r(){var t,e,i=window.navigator,r=i.appName.replace(/\s/g,"_"),o=i.userAgent,a=/MSIE\s([0-9]+[.0-9]*)/,s=/Trident.*rv:11\./,c=/Edge\/(\d+)\./,l={firefox:/Firefox\/(\d+)\./,chrome:/Chrome\/(\d+)\./,safari:/Version\/([\d.]+).*Safari\/(\d+)/},u={Microsoft_Internet_Explorer:function(){var t=o.match(a);t?(n.msie=!0,n.version=parseFloat(t[1])):n.others=!0},Netscape:function(){var i=!1;if(s.exec(o))n.msie=!0,n.version=11,i=!0;else if(c.exec(o))n.edge=!0,n.version=o.match(c)[1],i=!0;else for(t in l)if(l.hasOwnProperty(t)&&(e=o.match(l[t]),e&&e.length>1)){n[t]=i=!0,n.version=parseFloat(e[1]||0);break}i||(n.others=!0)}},h=u[r];h&&u[r]()}"undefined"!==typeof window&&window.navigator&&r(),t.exports=n},function(t,e,i){"use strict";var n=i(3);function r(t){return t&&t.className?n(t.className.baseVal)?t.className:t.className.baseVal:""}t.exports=r},function(t,e,i){"use strict";(function(e){var n=i(10),r=i(42),o=i(44),a=i(47),s=i(28),c=i(17),l=i(14),u=i(15),h=i(0);function f(t,e){l(e,"mousedown",this._onMouseDown,this),this.options=h({distance:10},t),this.container=e,this._isMoved=!1,this._distance=0,this._dragStartFired=!1,this._dragStartEventData=null}f.prototype.destroy=function(){c(this.container,"mousedown",this._onMouseDown),this.options=this.container=this._isMoved=this._distance=this._dragStartFired=this._dragStartEventData=null},f.prototype._toggleDragEvent=function(t){var i=this.container;t?(r(i),l(window,"dragstart",u),l(e.document,{mousemove:this._onMouseMove,mouseup:this._onMouseUp},this)):(o(i),c(window,"dragstart",u),c(e.document,{mousemove:this._onMouseMove,mouseup:this._onMouseUp}))},f.prototype._getEventData=function(t){return{target:s(t),originEvent:t}},f.prototype._onMouseDown=function(t){0===a(t)&&(this._distance=0,this._dragStartFired=!1,this._dragStartEventData=this._getEventData(t),this._toggleDragEvent(!0))},f.prototype._onMouseMove=function(t){var e=this.options.distance;u(t),this._isMoved=!0,this._distance<e?this._distance+=1:this._dragStartFired||(this._dragStartFired=!0,this.invoke("dragStart",this._dragStartEventData))?this.fire("drag",this._getEventData(t)):this._toggleDragEvent(!1)},f.prototype._onMouseUp=function(t){if(this._toggleDragEvent(!1),this._isMoved)return this._isMoved=!1,void this.fire("dragEnd",this._getEventData(t));this.fire("click",this._getEventData(t))},n.mixin(f),t.exports=f}).call(this,i(25))},function(t,e){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(n){"object"===typeof window&&(i=window)}t.exports=i},function(t,e,i){"use strict";var n="_feEventKey";function r(t,e){var i,r=t[n];return r||(r=t[n]={}),i=r[e],i||(i=r[e]=[]),i}t.exports=r},function(t,e,i){"use strict";function n(t){var e,i,n=document.documentElement.style;for(e=0,i=t.length;e<i;e+=1)if(t[e]in n)return t[e];return!1}t.exports=n},function(t,e,i){"use strict";function n(t){return t.target||t.srcElement}t.exports=n},function(t,e,i){"use strict";var n=i(10),r=i(28),o=i(17),a=i(14),s=i(30),c=i(0),l=i(18),u=i(9),h=i(12),f=i(8),d=i(51);function g(t,e){this.options=c({cssPrefix:"tui-colorpicker-",preset:["#181818","#282828","#383838","#585858","#B8B8B8","#D8D8D8","#E8E8E8","#F8F8F8","#AB4642","#DC9656","#F7CA88","#A1B56C","#86C1B9","#7CAFC2","#BA8BAF","#A16946"],detailTxt:"Detail"},t),e=u.appendHTMLElement("div",e,this.options.cssPrefix+"palette-container"),f.call(this,t,e)}l(g,f),g.prototype._onClick=function(t){var e=this.options,i=r(t),n={};if(s(i,e.cssPrefix+"palette-button"))return n.color=i.value,void this.fire("_selectColor",n);s(i,e.cssPrefix+"palette-toggle-slider")&&this.fire("_toggleSlider")},g.prototype._onChange=function(t){var e=this.options,i=r(t),n={};s(i,e.cssPrefix+"palette-hex")&&(n.color=i.value,this.fire("_selectColor",n))},g.prototype._beforeDestroy=function(){this._toggleEvent(!1)},g.prototype._toggleEvent=function(t){var e,i=this.options,n=this.container,r=t?a:o;r(n,"click",this._onClick,this),e=n.querySelector("."+i.cssPrefix+"palette-hex",n),e&&r(e,"change",this._onChange,this)},g.prototype.render=function(t){var e=this.options,i="";this._toggleEvent(!1),i=d({cssPrefix:e.cssPrefix,preset:e.preset,detailTxt:e.detailTxt,color:t,isValidRGB:h.isValidRGB,getItemClass:function(t){return t?"":" "+e.cssPrefix+"color-transparent"},isSelected:function(i){return i===t?" "+e.cssPrefix+"selected":""}}),this.container.innerHTML=i,this._toggleEvent(!0)},n.mixin(g),t.exports=g},function(t,e,i){"use strict";var n=i(5),r=i(23);function o(t,e){var i;return t.classList?t.classList.contains(e):(i=r(t).split(/\s+/),n(e,i)>-1)}t.exports=o},function(t,e,i){"use strict";var n=i(10),r=i(53),o=i(54),a=i(30),s=i(0),c=i(18),l=i(9),u=i(32),h=i(12),f=i(8),d=i(24),g=i(57),p=-7,v=112,m=-3,y=115,b=359.99;function _(t,e){e=l.appendHTMLElement("div",e,t.cssPrefix+"slider-container"),e.style.display="none",f.call(this,t,e),this.options=s({color:"#f8f8f8",cssPrefix:"tui-colorpicker-"},t),this._dragDataCache={},this.sliderHandleElement=null,this.huebarHandleElement=null,this.baseColorElement=null,this.drag=new d({distance:0},e),this.colorSliderPosLimitRange=[p,v],this.huebarPosLimitRange=[m,y],this.drag.on({dragStart:this._onDragStart,drag:this._onDrag,dragEnd:this._onDragEnd,click:this._onClick},this)}c(_,f),_.prototype._beforeDestroy=function(){this.drag.off(),this.drag=this.options=this._dragDataCache=this.sliderHandleElement=this.huebarHandleElement=this.baseColorElement=null},_.prototype.toggle=function(t){this.container.style.display=t?"block":"none"},_.prototype.isVisible=function(){return"block"===this.container.style.display},_.prototype.render=function(t){var e,i,n=this.container,r=this.options,o=g.layout;h.isValidRGB(t)&&(o=o.replace(/{{slider}}/,g.slider),o=o.replace(/{{huebar}}/,g.huebar),o=o.replace(/{{cssPrefix}}/g,r.cssPrefix),o=o.replace(/{{id}}/g,r.id),this.container.innerHTML=o,this.sliderSvgElement=n.querySelector("."+r.cssPrefix+"svg-slider"),this.huebarSvgElement=n.querySelector("."+r.cssPrefix+"svg-huebar"),this.sliderHandleElement=n.querySelector("."+r.cssPrefix+"slider-handle"),this.huebarHandleElement=n.querySelector("."+r.cssPrefix+"huebar-handle"),this.baseColorElement=n.querySelector("."+r.cssPrefix+"slider-basecolor"),e=h.hexToRGB(t),i=h.rgbToHSV.apply(null,e),this.moveHue(i[0],!0),this.moveSaturationAndValue(i[1],i[2],!0))},_.prototype._setColorSliderPosMax=function(){var t=this.sliderSvgElement.getClientRects()[0];t&&(this.colorSliderPosLimitRange[1]=t.height-10)},_.prototype._moveColorSliderHandle=function(t,e,i){var n,r=this.sliderHandleElement;e=Math.max(this.colorSliderPosLimitRange[0],e),e=Math.min(this.colorSliderPosLimitRange[1],e),t=Math.max(this.colorSliderPosLimitRange[0],t),t=Math.min(this.colorSliderPosLimitRange[1],t),u.setTranslateXY(r,t,e),n=e>50?"white":"black",u.setStrokeColor(r,n),i||this.fire("_selectColor",{color:h.rgbToHEX.apply(null,this.getRGB())})},_.prototype.moveSaturationAndValue=function(t,e,i){var n,r,o,a;t=t||0,e=e||0,n=Math.abs(this.colorSliderPosLimitRange[0]),r=this.colorSliderPosLimitRange[1],o=t*r/100-n,a=r-e*r/100-n,this._moveColorSliderHandle(o,a,i)},_.prototype._moveColorSliderByPosition=function(t,e){var i=this.colorSliderPosLimitRange[0];this._moveColorSliderHandle(t+i,e+i)},_.prototype.getSaturationAndValue=function(){var t,e,i=Math.abs(this.colorSliderPosLimitRange[0]),n=i+this.colorSliderPosLimitRange[1],r=u.getTranslateXY(this.sliderHandleElement);return t=(r[1]+i)/n*100,e=100-(r[0]+i)/n*100,[t,e]},_.prototype._setHueBarPosMax=function(){var t=this.huebarSvgElement.getClientRects()[0];t&&(this.huebarPosLimitRange[1]=t.height-7)},_.prototype._moveHueHandle=function(t,e){var i,n,r=this.huebarHandleElement,o=this.baseColorElement;t=Math.max(this.huebarPosLimitRange[0],t),t=Math.min(this.huebarPosLimitRange[1],t),u.setTranslateY(r,t),i=h.hsvToRGB(this.getHue(),100,100),n=h.rgbToHEX.apply(null,i),u.setGradientColorStop(o,n),e||this.fire("_selectColor",{color:h.rgbToHEX.apply(null,this.getRGB())})},_.prototype.moveHue=function(t,e){var i,n,r=0;i=Math.abs(this.huebarPosLimitRange[0]),n=i+this.huebarPosLimitRange[1],t=t||0,r=n*t/b-i,this._moveHueHandle(r,e)},_.prototype._moveHueByPosition=function(t){var e=this.huebarPosLimitRange[0];this._moveHueHandle(t+e)},_.prototype.getHue=function(){var t,e,i=this.huebarHandleElement,n=u.getTranslateXY(i);return t=Math.abs(this.huebarPosLimitRange[0]),e=t+this.huebarPosLimitRange[1],(n[0]+t)*b/e},_.prototype.getHSV=function(){var t=this.getSaturationAndValue(),e=this.getHue();return[e].concat(t)},_.prototype.getRGB=function(){return h.hsvToRGB.apply(null,this.getHSV())},_.prototype._prepareColorSliderForMouseEvent=function(t){var e,i=this.options,n=o(t.target,"."+i.cssPrefix+"slider-part");return e=this._dragDataCache={isColorSlider:a(n,i.cssPrefix+"slider-left"),parentElement:n},e},_.prototype._onClick=function(t){var e=this._prepareColorSliderForMouseEvent(t),i=r(t.originEvent,e.parentElement);e.isColorSlider?this._moveColorSliderByPosition(i[0],i[1]):this._moveHueByPosition(i[1]),this._dragDataCache=null},_.prototype._onDragStart=function(t){this._setColorSliderPosMax(),this._setHueBarPosMax(),this._prepareColorSliderForMouseEvent(t)},_.prototype._onDrag=function(t){var e=this._dragDataCache,i=r(t.originEvent,e.parentElement);e.isColorSlider?this._moveColorSliderByPosition(i[0],i[1]):this._moveHueByPosition(i[1])},_.prototype._onDragEnd=function(){this._dragDataCache=null},n.mixin(_),t.exports=_},function(t,e,i){"use strict";var n=i(4).isOldBrowser,r=/[\.\-0-9]+/g,o=-6,a={getTranslateXY:function(t){var e;return n?(e=t.style,[parseFloat(e.top),parseFloat(e.left)]):(e=t.getAttribute("transform"),e?(e=e.match(r),[parseFloat(e[1]),parseFloat(e[0])]):[0,0])},setTranslateXY:function(t,e,i){n?(t.style.left=e+"px",t.style.top=i+"px"):t.setAttribute("transform","translate("+e+","+i+")")},setTranslateY:function(t,e){n?t.style.top=e+"px":t.setAttribute("transform","translate("+o+","+e+")")},setStrokeColor:function(t,e){n?t.strokecolor=e:t.setAttribute("stroke",e)},setGradientColorStop:function(t,e){n?t.color=e:t.setAttribute("stop-color",e)}};t.exports=a},function(t,e,i){i(34),t.exports=i(35)},function(t,e,i){},function(t,e,i){"use strict";var n=i(19),r=i(8),o=i(24),a=i(48),s=i(29),c=i(31),l=i(12),u=i(32),h={Collection:n,View:r,Drag:o,create:a,Palette:s,Slider:c,colorutil:l,svgvml:u};t.exports=h},function(t,e,i){"use strict";function n(t){return null===t}t.exports=n},function(t,e,i){"use strict";var n=i(3),r=i(38),o=6048e5;function a(t){var e=(new Date).getTime();return e-t>o}function s(t,e){var i="https://www.google-analytics.com/collect",o=location.hostname,s="event",c="use",l="TOAST UI "+t+" for "+o+": Statistics",u=window.localStorage.getItem(l);(n(window.tui)||!1!==window.tui.usageStatistics)&&(u&&!a(u)||(window.localStorage.setItem(l,(new Date).getTime()),setTimeout((function(){"interactive"!==document.readyState&&"complete"!==document.readyState||r(i,{v:1,t:s,tid:e,cid:o,dp:o,dh:t,el:t,ec:c})}),1e3)))}t.exports=s},function(t,e,i){"use strict";var n=i(7);function r(t,e){var i=document.createElement("img"),r="";return n(e,(function(t,e){r+="&"+e+"="+t})),r=r.substring(1),i.src=t+"?"+r,i.style.display="none",document.body.appendChild(i),document.body.removeChild(i),i}t.exports=r},function(t,e,i){"use strict";var n=i(2),r=i(5),o=i(23),a=i(40);function s(t){var e,i=Array.prototype.slice.call(arguments,1),s=t.classList,c=[];s?n(i,(function(e){t.classList.add(e)})):(e=o(t),e&&(i=[].concat(e.split(/\s+/),i)),n(i,(function(t){r(t,c)<0&&c.push(t)})),a(t,c))}t.exports=s},function(t,e,i){"use strict";var n=i(1),r=i(3);function o(t,e){e=n(e)?e.join(" "):e,e=e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),r(t.className.baseVal)?t.className=e:t.className.baseVal=e}t.exports=o},function(t,e,i){"use strict";function n(t){return"number"===typeof t||t instanceof Number}t.exports=n},function(t,e,i){"use strict";var n=i(14),r=i(15),o=i(43),a=i(27),s="onselectstart"in document,c="prevUserSelect",l=a(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);function u(t){t||(t=document),s?n(t,"selectstart",r):(t=t===document?document.documentElement:t,o(t,c,t.style[l]),t.style[l]="none")}t.exports=u},function(t,e,i){"use strict";var n=i(16);function r(t,e,i){t.dataset?t.dataset[e]=i:t.setAttribute("data-"+n(e),i)}t.exports=r},function(t,e,i){"use strict";var n=i(17),r=i(15),o=i(45),a=i(46),s=i(27),c="onselectstart"in document,l="prevUserSelect",u=s(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);function h(t){t||(t=document),c?n(t,"selectstart",r):(t=t===document?document.documentElement:t,t.style[u]=o(t,l)||"auto",a(t,l))}t.exports=h},function(t,e,i){"use strict";var n=i(16);function r(t,e){return t.dataset?t.dataset[e]:t.getAttribute("data-"+n(e))}t.exports=r},function(t,e,i){"use strict";var n=i(16);function r(t,e){t.dataset?delete t.dataset[e]:t.removeAttribute("data-"+n(e))}t.exports=r},function(t,e,i){"use strict";var n=i(22),r=i(5),o=["0","1","3","5","7"],a=["2","6"],s=["4"];function c(t){return n.msie&&n.version<=8?l(t):t.button}function l(t){var e=String(t.button);return r(e,o)>-1?0:r(e,a)>-1?2:r(e,s)>-1?1:null}t.exports=c},function(t,e,i){"use strict";var n=i(10),r=i(0),o=i(4),a=i(12),s=i(49),c=i(29),l=i(31),u=0;function h(){return u+=1,u}function f(t){var e;if(!(this instanceof f))return new f(t);if(t=this.options=r({container:null,color:"#f8f8f8",preset:["#181818","#282828","#383838","#585858","#b8b8b8","#d8d8d8","#e8e8e8","#f8f8f8","#ab4642","#dc9656","#f7ca88","#a1b56c","#86c1b9","#7cafc2","#ba8baf","#a16946"],cssPrefix:"tui-colorpicker-",detailTxt:"Detail",id:h(),usageStatistics:!0},t),!t.container)throw new Error("ColorPicker(): need container option.");e=this.layout=new s(t,t.container),this.palette=new c(t,e.container),this.palette.on({_selectColor:this._onSelectColorInPalette,_toggleSlider:this._onToggleSlider},this),this.slider=new l(t,e.container),this.slider.on("_selectColor",this._onSelectColorInSlider,this),e.addChild(this.palette),e.addChild(this.slider),this.render(t.color),t.usageStatistics&&o.sendHostName()}f.prototype._onSelectColorInPalette=function(t){var e=t.color,i=this.options;a.isValidRGB(e)||""===e?(this.fire("selectColor",{color:e,origin:"palette"}),i.color!==e&&(i.color=e,this.render(e))):this.render()},f.prototype._onToggleSlider=function(){this.slider.toggle(!this.slider.isVisible())},f.prototype._onSelectColorInSlider=function(t){var e=t.color,i=this.options;this.fire("selectColor",{color:e,origin:"slider"}),i.color!==e&&(i.color=e,this.palette.render(e))},f.prototype.setColor=function(t){if(!a.isValidRGB(t))throw new Error("ColorPicker#setColor(): need valid hex string color value");this.options.color=t,this.render(t)},f.prototype.getColor=function(){return this.options.color},f.prototype.toggle=function(t){this.layout.container.style.display=t?"block":"none"},f.prototype.render=function(t){this.layout.render(t||this.options.color)},f.prototype.destroy=function(){this.layout.destroy(),this.options.container.innerHTML="",this.layout=this.slider=this.palette=this.options=null},n.mixin(f),t.exports=f},function(t,e,i){"use strict";var n=i(0),r=i(18),o=i(9),a=i(8);function s(t,e){this.options=n({cssPrefix:"tui-colorpicker-"},t),e=o.appendHTMLElement("div",e,this.options.cssPrefix+"container"),a.call(this,t,e),this.render()}r(s,a),s.prototype.render=function(t){this.recursive((function(e){e.render(t)}),!0)},t.exports=s},function(t,e,i){"use strict";function n(t){function e(){}return e.prototype=t,new e}t.exports=n},function(t,e,i){"use strict";var n=i(52);t.exports=function(t){var e=['<li><input class="{{cssPrefix}}palette-button{{isSelected @this}}{{getItemClass @this}}" type="button"',"{{if isValidRGB @this}}",' style="background-color:{{@this}};color:{{@this}}"',"{{/if}}",' title="{{@this}}" value="{{@this}}" /></li>'].join(""),i=['<ul class="{{cssPrefix}}clearfix">',"{{each preset}}",e,"{{/each}}","</ul>",'<div class="{{cssPrefix}}clearfix" style="overflow:hidden">','<input type="button" class="{{cssPrefix}}palette-toggle-slider" value="{{detailTxt}}" />','<input type="text" class="{{cssPrefix}}palette-hex" value="{{color}}" maxlength="7" />','<span class="{{cssPrefix}}palette-preview" style="background-color:{{color}};color:{{color}}">{{color}}</span>',"</div>"].join("\n");return n(i,t)}},function(t,e,i){"use strict";var n=i(5),r=i(2),o=i(1),a=i(11),s=i(0),c=/{{\s?|\s?}}/g,l=/^[a-zA-Z0-9_@]+\[[a-zA-Z0-9_@"']+\]$/,u=/\[\s?|\s?\]/,h=/^[a-zA-Z_]+\.[a-zA-Z_]+$/,f=/\./,d=/^["']\w+["']$/,g=/"|'/g,p=/^-?\d+\.?\d*$/,v=2,m={if:C,each:I,with:M},y=3==="a".split(/a/).length,b=function(){return y?function(t,e){return t.split(e)}:function(t,e){var i,n,r=[],o=0;e.global||(e=new RegExp(e,"g")),i=e.exec(t);while(null!==i)n=i.index,r.push(t.slice(o,n)),o=n+i[0].length,i=e.exec(t);return r.push(t.slice(o)),r}}();function _(t,e){var i,n=e[t];return"true"===t?n=!0:"false"===t?n=!1:d.test(t)?n=t.replace(g,""):l.test(t)?(i=t.split(u),n=_(i[0],e)[_(i[1],e)]):h.test(t)?(i=t.split(f),n=_(i[0],e)[i[1]]):p.test(t)&&(n=parseFloat(t)),n}function x(t,e){var i=[t],n=[],o=0,a=0;return r(e,(function(t,r){0===t.indexOf("if")?o+=1:"/if"===t?o-=1:o||0!==t.indexOf("elseif")&&"else"!==t||(i.push("else"===t?["true"]:t.split(" ").slice(1)),n.push(e.slice(a,r)),a=r+1)})),n.push(e.slice(a)),{exps:i,sourcesInsideIf:n}}function C(t,e,i){var n=x(t,e),o=!1,a="";return r(n.exps,(function(t,e){return o=T(t,i),o&&(a=D(n.sourcesInsideIf[e],i)),!o})),a}function I(t,e,i){var n=T(t,i),a=o(n)?"@index":"@key",c={},l="";return r(n,(function(t,n){c[a]=n,c["@this"]=t,s(i,c),l+=D(e.slice(),i)})),l}function M(t,e,i){var r=n("as",t),o=t[r+1],a=T(t.slice(0,r),i),c={};return c[o]=a,D(e,s(i,c))||""}function S(t,e,i){var n=t.splice(e+1,i-e);return n.pop(),n}function w(t,e,i){var n,r=m[t],o=1,s=0,c=s+v,l=e[c];while(o&&a(l))0===l.indexOf(t)?o+=1:0===l.indexOf("/"+t)&&(o-=1,n=c),c+=v,l=e[c];if(o)throw Error(t+" needs {{/"+t+"}} expression.");return e[s]=r(e[s].split(" ").slice(1),S(e,s,n),i),e}function T(t,e){var i=_(t[0],e);return i instanceof Function?A(i,t.slice(1),e):i}function A(t,e,i){var n=[];return r(e,(function(t){n.push(_(t,i))})),t.apply(null,n)}function D(t,e){var i,n,r,o=1,s=t[o];while(a(s))i=s.split(" "),n=i[0],m[n]?(r=w(n,t.splice(o,t.length-o),e),t=t.concat(r)):t[o]=T(i,e),o+=v,s=t[o];return t.join("")}function E(t,e){return D(b(t,c),e)}t.exports=E},function(t,e,i){"use strict";var n=i(1);function r(t,e){var i,r=n(t),o=r?t[0]:t.clientX,a=r?t[1]:t.clientY;return e?(i=e.getBoundingClientRect(),[o-i.left-e.clientLeft,a-i.top-e.clientTop]):[o,a]}t.exports=r},function(t,e,i){"use strict";var n=i(55);function r(t,e){var i=t.parentNode;if(n(t,e))return t;while(i&&i!==document){if(n(i,e))return i;i=i.parentNode}return null}t.exports=r},function(t,e,i){"use strict";var n=i(5),r=i(56),o=Element.prototype,a=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.msMatchesSelector||function(t){var e=this.document||this.ownerDocument;return n(this,r(e.querySelectorAll(t)))>-1};function s(t,e){return a.call(t,e)}t.exports=s},function(t,e,i){"use strict";var n=i(6);function r(t){var e;try{e=Array.prototype.slice.call(t)}catch(i){e=[],n(t,(function(t){e.push(t)}))}return e}t.exports=r},function(t,e,i){"use strict";(function(e){var n=i(4).isOldBrowser,r=['<div class="{{cssPrefix}}slider-left {{cssPrefix}}slider-part">{{slider}}</div>','<div class="{{cssPrefix}}slider-right {{cssPrefix}}slider-part">{{huebar}}</div>'].join("\n"),o=['<svg class="{{cssPrefix}}svg {{cssPrefix}}svg-slider">',"<defs>",'<linearGradient id="{{cssPrefix}}svg-fill-color-{{id}}" x1="0%" y1="0%" x2="100%" y2="0%">','<stop offset="0%" stop-color="rgb(255,255,255)" />','<stop class="{{cssPrefix}}slider-basecolor" offset="100%" stop-color="rgb(255,0,0)" />',"</linearGradient>",'<linearGradient id="{{cssPrefix}}svn-fill-black-{{id}}" x1="0%" y1="0%" x2="0%" y2="100%">','<stop offset="0%" style="stop-color:rgb(0,0,0);stop-opacity:0" />','<stop offset="100%" style="stop-color:rgb(0,0,0);stop-opacity:1" />',"</linearGradient>","</defs>",'<rect width="100%" height="100%" fill="url(#{{cssPrefix}}svg-fill-color-{{id}})"></rect>','<rect width="100%" height="100%" fill="url(#{{cssPrefix}}svn-fill-black-{{id}})"></rect>','<path transform="translate(0,0)" class="{{cssPrefix}}slider-handle" d="M0 7.5 L15 7.5 M7.5 15 L7.5 0 M2 7 a5.5 5.5 0 1 1 0 1 Z" stroke="black" stroke-width="0.75" fill="none" />',"</svg>"].join("\n"),a=['<div class="{{cssPrefix}}vml-slider">','<v:rect strokecolor="none" class="{{cssPrefix}}vml {{cssPrefix}}vml-slider-bg">','<v:fill class="{{cssPrefix}}vml {{cssPrefix}}slider-basecolor" type="gradient" method="none" color="#ff0000" color2="#fff" angle="90" />',"</v:rect>",'<v:rect strokecolor="#ccc" class="{{cssPrefix}}vml {{cssPrefix}}vml-slider-bg">','<v:fill type="gradient" method="none" color="black" color2="white" o:opacity2="0%" class="{{cssPrefix}}vml" />',"</v:rect>",'<v:shape class="{{cssPrefix}}vml {{cssPrefix}}slider-handle" coordsize="1 1" style="width:1px;height:1px;"path="m 0,7 l 14,7 m 7,14 l 7,0 ar 12,12 2,2 z" filled="false" stroked="true" />',"</div>"].join("\n"),s=['<svg class="{{cssPrefix}}svg {{cssPrefix}}svg-huebar">',"<defs>",'<linearGradient id="g-{{id}}" x1="0%" y1="0%" x2="0%" y2="100%">','<stop offset="0%" stop-color="rgb(255,0,0)" />','<stop offset="16.666%" stop-color="rgb(255,255,0)" />','<stop offset="33.333%" stop-color="rgb(0,255,0)" />','<stop offset="50%" stop-color="rgb(0,255,255)" />','<stop offset="66.666%" stop-color="rgb(0,0,255)" />','<stop offset="83.333%" stop-color="rgb(255,0,255)" />','<stop offset="100%" stop-color="rgb(255,0,0)" />',"</linearGradient>","</defs>",'<rect width="18px" height="100%" fill="url(#g-{{id}})"></rect>','<path transform="translate(-6,-3)" class="{{cssPrefix}}huebar-handle" d="M0 0 L4 4 L0 8 L0 0 Z" fill="black" stroke="none" />',"</svg>"].join("\n"),c=['<div class="{{cssPrefix}}vml-huebar">','<v:rect strokecolor="#ccc" class="{{cssPrefix}}vml {{cssPrefix}}vml-huebar-bg">','<v:fill type="gradient" method="none" colors="0% rgb(255,0,0), 16.666% rgb(255,255,0), 33.333% rgb(0,255,0), 50% rgb(0,255,255), 66.666% rgb(0,0,255), 83.333% rgb(255,0,255), 100% rgb(255,0,0)" angle="180" class="{{cssPrefix}}vml" />',"</v:rect>",'<v:shape class="{{cssPrefix}}vml {{cssPrefix}}huebar-handle" coordsize="1 1" style="width:1px;height:1px;position:absolute;z-index:1;right:22px;top:-3px;"path="m 0,0 l 4,4 l 0,8 l 0,0 z" filled="true" fillcolor="black" stroked="false" />',"</div>"].join("\n");n&&e.document.namespaces.add("v","urn:schemas-microsoft-com:vml"),t.exports={layout:r,slider:n?a:o,huebar:n?c:s}}).call(this,i(25))}])}))}}]);