1228 lines
754 KiB
JavaScript
1228 lines
754 KiB
JavaScript
|
(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[99680],{90631:function(Ue,wt,Ft){"use strict";Ft.d(wt,{Z:function(){return g}});var tt=Ft(28991),vt=Ft(67294),st={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"},yt=st,_=Ft(27029),z=function(f,c){return vt.createElement(_.Z,(0,tt.Z)((0,tt.Z)({},f),{},{ref:c,icon:yt}))};z.displayName="DownloadOutlined";var g=vt.forwardRef(z)},92104:function(Ue,wt,Ft){"use strict";Ft.d(wt,{Z:function(){return g}});var tt=Ft(28991),vt=Ft(67294),st={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M893.3 293.3L730.7 130.7c-7.5-7.5-16.7-13-26.7-16V112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V338.5c0-17-6.7-33.2-18.7-45.2zM384 184h256v104H384V184zm456 656H184V184h136v136c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V205.8l136 136V840zM512 442c-79.5 0-144 64.5-144 144s64.5 144 144 144 144-64.5 144-144-64.5-144-144-144zm0 224c-44.2 0-80-35.8-80-80s35.8-80 80-80 80 35.8 80 80-35.8 80-80 80z"}}]},name:"save",theme:"outlined"},yt=st,_=Ft(27029),z=function(f,c){return vt.createElement(_.Z,(0,tt.Z)((0,tt.Z)({},f),{},{ref:c,icon:yt}))};z.displayName="SaveOutlined";var g=vt.forwardRef(z)},80262:function(Ue,wt,Ft){/*! For license information please see toastui-react-image-editor.js.LICENSE.txt */(function(){var tt={9406:function(_,z,g){_.exports=g(4877)},381:function(_,z,g){_.exports=g(5603)},8005:function(_,z,g){_.exports=g(4741)},7870:function(_,z,g){_.exports=g(4194)},7601:function(_,z,g){_.exports=g(2854)},651:function(_,z,g){_.exports=g(2)},2461:function(_,z,g){_.exports=g(5636)},9146:function(_,z,g){_.exports=g(5279)},6623:function(_,z,g){_.exports=g(9297)},7077:function(_,z,g){_.exports=g(8026)},9856:function(_,z,g){_.exports=g(2044)},4230:function(_,z,g){_.exports=g(2214)},184:function(_,z,g){_.exports=g(9256)},3742:function(_,z,g){_.exports=g(5659)},6135:function(_,z,g){g(9106);var x=g(5607);_.exports=x("Array").concat},3971:function(_,z,g){g(3436);var x=g(5607);_.exports=x("Array").filter},2671:function(_,z,g){g(5818);var x=g(5607);_.exports=x("Array").slice},1484:function(_,z,g){var x=g(6135),f=Array.prototype;_.exports=function(c){var I=c.concat;return c===f||c instanceof Array&&I===f.concat?x:I}},3669:function(_,z,g){var x=g(3971),f=Array.prototype;_.exports=function(c){var I=c.filter;return c===f||c instanceof Array&&I===f.filter?x:I}},7663:function(_,z,g){var x=g(2671),f=Array.prototype;_.exports=function(c){var I=c.slice;return c===f||c instanceof Array&&I===f.slice?x:I}},3213:function(_,z,g){g(3113);var x=g(7545).Object;_.exports=function(f,c){return x.create(f,c)}},3512:function(_,z,g){g(297);var x=g(7545).Object,f=_.exports=function(c,I,M){return x.defineProperty(c,I,M)};x.defineProperty.sham&&(f.sham=!0)},632:function(_,z,g){g(9189);var x=g(7545).Object,f=_.exports=function(c,I){return x.getOwnPropertyDescriptor(c,I)};x.getOwnPropertyDescriptor.sham&&(f.sham=!0)},1056:function(_,z,g){g(2509);var x=g(7545);_.exports=x.Object.getOwnPropertyDescriptors},2921:function(_,z,g){g(6187);var x=g(7545);_.exports=x.Object.getOwnPropertySymbols},8168:function(_,z,g){g(9234);var x=g(7545);_.exports=x.Object.getPrototypeOf},8651:function(_,z,g){g(2647);var x=g(7545);_.exports=x.Object.keys},3083:function(_,z,g){g(3222);var x=g(7545);_.exports=x.Object.setPrototypeOf},6577:function(_,z,g){g(5397);var x=g(7545);_.exports=x.Reflect.construct},5008:function(_,z,g){g(9106),g(6663),g(6187),g(9781),g(492),g(6681),g(9594),g(3665),g(9017),g(1250),g(9786),g(503),g(6565),g(9322),g(3610),g(6886),g(3514),g(8671),g(8556),g(1367);var x=g(7545);_.exports=x.Symbol},994:function(_,z,g){g(8939),g(6663),g(5454),g(3665);var x
|
||
|
* TOAST UI Color Picker
|
||
|
* @version 2.2.8
|
||
|
* @author NHN Cloud FE Development Team <dl_javascript@nhn.com>
|
||
|
* @license MIT
|
||
|
*/(function(Ft,tt){Ue.exports=tt()})(window,function(){return function(wt){var Ft={};function tt(vt){if(Ft[vt])return Ft[vt].exports;var st=Ft[vt]={i:vt,l:!1,exports:{}};return wt[vt].call(st.exports,st,st.exports,tt),st.l=!0,st.exports}return tt.m=wt,tt.c=Ft,tt.d=function(vt,st,yt){tt.o(vt,st)||Object.defineProperty(vt,st,{enumerable:!0,get:yt})},tt.r=function(vt){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(vt,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(vt,"__esModule",{value:!0})},tt.t=function(vt,st){if(st&1&&(vt=tt(vt)),st&8||st&4&&typeof vt=="object"&&vt&&vt.__esModule)return vt;var yt=Object.create(null);if(tt.r(yt),Object.defineProperty(yt,"default",{enumerable:!0,value:vt}),st&2&&typeof vt!="string")for(var _ in vt)tt.d(yt,_,function(z){return vt[z]}.bind(null,_));return yt},tt.n=function(vt){var st=vt&&vt.__esModule?function(){return vt.default}:function(){return vt};return tt.d(st,"a",st),st},tt.o=function(vt,st){return Object.prototype.hasOwnProperty.call(vt,st)},tt.p="dist",tt(tt.s=33)}([function(wt,Ft,tt){"use strict";function vt(st,yt){var _=Object.prototype.hasOwnProperty,z,g,x,f;for(x=1,f=arguments.length;x<f;x+=1){z=arguments[x];for(g in z)_.call(z,g)&&(st[g]=z[g])}return st}wt.exports=vt},function(wt,Ft,tt){"use strict";function vt(st){return st instanceof Array}wt.exports=vt},function(wt,Ft,tt){"use strict";var vt=tt(1),st=tt(6),yt=tt(7);function _(z,g,x){vt(z)?st(z,g,x):yt(z,g,x)}wt.exports=_},function(wt,Ft,tt){"use strict";function vt(st){return st===void 0}wt.exports=vt},function(wt,Ft,tt){"use strict";var vt=tt(22),st=tt(2),yt=tt(6),_=tt(7),z=tt(37),g=0,x={getLength:function(f){var c=0;return _(f,function(){c+=1}),c},map:function(f,c,I){var M=[];return st(f,function(){M.push(c.apply(I||null,arguments))}),M},filter:function(f,c,I){var M=[];return yt(f,function(D){c.apply(I||null,arguments)&&M.push(D)}),M},generateId:function(){return g+=1,g},isOldBrowser:function(){return vt.msie&&vt.version<9}(),sendHostName:function(){z("color-picker","UA-129987462-1")}};wt.exports=x},function(wt,Ft,tt){"use strict";var vt=tt(1);function st(yt,_,z){var g,x;if(z=z||0,!vt(_))return-1;if(Array.prototype.indexOf)return Array.prototype.indexOf.call(_,yt,z);for(x=_.length,g=z;z>=0&&g<x;g+=1)if(_[g]===yt)return g;return-1}wt.exports=st},function(wt,Ft,tt){"use strict";function vt(st,yt,_){var z=0,g=st.length;for(_=_||null;z<g&&yt.call(_,st[z],z,st)!==!1;z+=1);}wt.exports=vt},function(wt,Ft,tt){"use strict";function vt(st,yt,_){var z;_=_||null;for(z in st)if(st.hasOwnProperty(z)&&yt.call(_,st[z],z,st)===!1)break}wt.exports=vt},function(wt,Ft,tt){"use strict";var vt=tt(39),st=tt(13),yt=tt(41),_=tt(3),z=tt(9),g=tt(19),x=tt(4);function f(c,I){var M=x.generateId();c=c||{},_(I)&&(I=z.appendHTMLElement("div")),vt(I,"tui-view-"+M),this.id=M,this.container=I,this.childs=new g(function(D){return D.id}),this.parent=null}f.prototype.addChild=function(c,I){I&&I.call(c,this),c.parent=this,this.childs.add(c)},f.prototype.removeChild=function(c,I){var M=yt(c)?this.childs.items[c]:c;I&&I.call(M,this),this.childs.remove(M.id)},f.prototype.render=function(){this.childs.each(function(c){c.render()})},f.prototype.recursive=function(c,I){!st(c)||(I||c(this),this.childs.each(function(M){M.recursive(c)}))},f.prototype.resize=function(){for(var c=Array.prototype.slice.call(arguments),I=this.parent;I;)st(I._onResize)&&I._onResize.apply(I,c),I=I.parent},f.prototype._beforeDestroy=function(){},f.prototype._destroy=function(){this._beforeDestroy(),this.container.innerHTML="",this.id=this.parent=this.childs=this.container=null},f.prototype.destroy=function(c){this.childs&&(this.childs.each(function(I){I.destroy(!0),I._destroy()}),this.childs.clear()),!c&&this._destroy()},f.prototype.getViewBound=function(){var c=this.container.getBoundingClientRect();return{x:c.left,y:c.top,width:c.right-c.left,height:c.bottom-c.top}},wt.exports=f},function(wt,Ft,tt){"use strict";var vt={appendHTMLElement:function(st,yt,_){var z=document.createElement(st);return z.className=_||"",yt?yt.appendChild(z):document.body.appendChi
|
||
|
`);return vt(_,st)}},function(wt,Ft,tt){"use strict";var vt=tt(5),st=tt(2),yt=tt(1),_=tt(11),z=tt(0),g=/{{\s?|\s?}}/g,x=/^[a-zA-Z0-9_@]+\[[a-zA-Z0-9_@"']+\]$/,f=/\[\s?|\s?\]/,c=/^[a-zA-Z_]+\.[a-zA-Z_]+$/,I=/\./,M=/^["']\w+["']$/,D=/"|'/g,P=/^-?\d+\.?\d*$/,j=2,p={if:e,each:i,with:s},a="a".split(/a/).length===3,d=function(){return a?function(O,L){return O.split(L)}:function(O,L){var N=[],B=0,Y,nt;for(L.global||(L=new RegExp(L,"g")),Y=L.exec(O);Y!==null;)nt=Y.index,N.push(O.slice(B,nt)),B=nt+Y[0].length,Y=L.exec(O);return N.push(O.slice(B)),N}}();function u(O,L){var N,B=L[O];return O==="true"?B=!0:O==="false"?B=!1:M.test(O)?B=O.replace(D,""):x.test(O)?(N=O.split(f),B=u(N[0],L)[u(N[1],L)]):c.test(O)?(N=O.split(I),B=u(N[0],L)[N[1]]):P.test(O)&&(B=parseFloat(O)),B}function t(O,L){var N=[O],B=[],Y=0,nt=0;return st(L,function(it,Mt){it.indexOf("if")===0?Y+=1:it==="/if"?Y-=1:!Y&&(it.indexOf("elseif")===0||it==="else")&&(N.push(it==="else"?["true"]:it.split(" ").slice(1)),B.push(L.slice(nt,Mt)),nt=Mt+1)}),B.push(L.slice(nt)),{exps:N,sourcesInsideIf:B}}function e(O,L,N){var B=t(O,L),Y=!1,nt="";return st(B.exps,function(it,Mt){return Y=y(it,N),Y&&(nt=b(B.sourcesInsideIf[Mt],N)),!Y}),nt}function i(O,L,N){var B=y(O,N),Y=yt(B)?"@index":"@key",nt={},it="";return st(B,function(Mt,K){nt[Y]=K,nt["@this"]=Mt,z(N,nt),it+=b(L.slice(),N)}),it}function s(O,L,N){var B=vt("as",O),Y=O[B+1],nt=y(O.slice(0,B),N),it={};return it[Y]=nt,b(L,z(N,it))||""}function m(O,L,N){var B=O.splice(L+1,N-L);return B.pop(),B}function o(O,L,N){for(var B=p[O],Y=1,nt=0,it,Mt=nt+j,K=L[Mt];Y&&_(K);)K.indexOf(O)===0?Y+=1:K.indexOf("/"+O)===0&&(Y-=1,it=Mt),Mt+=j,K=L[Mt];if(Y)throw Error(O+" needs {{/"+O+"}} expression.");return L[nt]=B(L[nt].split(" ").slice(1),m(L,nt,it),N),L}function y(O,L){var N=u(O[0],L);return N instanceof Function?C(N,O.slice(1),L):N}function C(O,L,N){var B=[];return st(L,function(Y){B.push(u(Y,N))}),O.apply(null,B)}function b(O,L){for(var N=1,B=O[N],Y,nt,it;_(B);)Y=B.split(" "),nt=Y[0],p[nt]?(it=o(nt,O.splice(N,O.length-N),L),O=O.concat(it)):O[N]=y(Y,L),N+=j,B=O[N];return O.join("")}function E(O,L){return b(d(O,g),L)}wt.exports=E},function(wt,Ft,tt){"use strict";var vt=tt(1);function st(yt,_){var z=vt(yt),g=z?yt[0]:yt.clientX,x=z?yt[1]:yt.clientY,f;return _?(f=_.getBoundingClientRect(),[g-f.left-_.clientLeft,x-f.top-_.clientTop]):[g,x]}wt.exports=st},function(wt,Ft,tt){"use strict";var vt=tt(55);function st(yt,_){var z=yt.parentNode;if(vt(yt,_))return yt;for(;z&&z!==document;){if(vt(z,_))return z;z=z.parentNode}return null}wt.exports=st},function(wt,Ft,tt){"use strict";var vt=tt(5),st=tt(56),yt=Element.prototype,_=yt.matches||yt.webkitMatchesSelector||yt.mozMatchesSelector||yt.msMatchesSelector||function(g){var x=this.document||this.ownerDocument;return vt(this,st(x.querySelectorAll(g)))>-1};function z(g,x){return _.call(g,x)}wt.exports=z},function(wt,Ft,tt){"use strict";var vt=tt(6);function st(yt){var _;try{_=Array.prototype.slice.call(yt)}catch(z){_=[],vt(yt,function(g){_.push(g)})}return _}wt.exports=st},function(wt,Ft,tt){"use strict";(function(vt){var st=tt(4).isOldBrowser,yt=['<div class="{{cssPrefix}}slider-left {{cssPrefix}}slider-part">{{slider}}</div>','<div class="{{cssPrefix}}slider-right {{cssPrefix}}slider-part">{{huebar}}</div>'].join(`
|
||
|
`),_=['<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(`
|
||
|
`),z=['<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(`
|
||
|
`),g=['<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(`
|
||
|
`),x=['<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(`
|
||
|
`);st&&vt.document.namespaces.add("v","urn:schemas-microsoft-com:vml"),wt.exports={layout:yt,slider:st?z:_,huebar:st?x:g}}).call(this,tt(25))}])})},8618:function(Ue,wt,Ft){var tt=Ft(48764).Buffer;/*!
|
||
|
* TOAST UI ImageEditor
|
||
|
* @version 3.15.3
|
||
|
* @license MIT
|
||
|
*/(function(st,yt){Ue.exports=yt(Ft(98525))})(self,function(vt){return function(){var st={2777:function(g,x,f){/*! Fabric.js Copyright 2008-2015, Printio (Juriy Zaytsev, Maxim Chernyak) */var c=c||{version:"4.6.0"};if(x.fabric=c,typeof document!="undefined"&&typeof window!="undefined")document instanceof(typeof HTMLDocument!="undefined"?HTMLDocument:Document)?c.document=document:c.document=document.implementation.createHTMLDocument(""),c.window=window;else{var I=f(4960),M=new I.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;c.document=M.document,c.jsdomImplForWrapper=f(6759).implForWrapper,c.nodeCanvas=f(6272).Canvas,c.window=M,DOMParser=c.window.DOMParser}c.isTouchSupported="ontouchstart"in c.window||"ontouchstart"in c.document||c.window&&c.window.navigator&&c.window.navigator.maxTouchPoints>0,c.isLikelyNode=typeof tt!="undefined"&&typeof window=="undefined",c.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"],c.DPI=96,c.reNum="(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:[eE][-+]?\\d+)?)",c.commaWsp="(?:\\s+,?\\s*|,\\s*)",c.rePathCommand=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/ig,c.reNonWord=/[ \n\.,;!\?\-]/,c.fontPaths={},c.iMatrix=[1,0,0,1,0,0],c.svgNS="http://www.w3.org/2000/svg",c.perfLimitSizeTotal=2097152,c.maxCacheSideLimit=4096,c.minCacheSideLimit=256,c.charWidthsCache={},c.textureSize=2048,c.disableStyleCopyPaste=!1,c.enableGLFiltering=!0,c.devicePixelRatio=c.window.devicePixelRatio||c.window.webkitDevicePixelRatio||c.window.mozDevicePixelRatio||1,c.browserShadowBlurConstant=1,c.arcToSegmentsCache={},c.boundsOfCurveCache={},c.cachesBoundsOfCurve=!0,c.forceGLPutImageData=!1,c.initFilterBackend=function(){if(c.enableGLFiltering&&c.isWebglSupported&&c.isWebglSupported(c.textureSize))return console.log("max texture size: "+c.maxTextureSize),new c.WebglFilterBackend({tileSize:c.textureSize});if(c.Canvas2dFilterBackend)return new c.Canvas2dFilterBackend},typeof document!="undefined"&&typeof window!="undefined"&&(window.fabric=c),function(){function p(i,s){if(!!this.__eventListeners[i]){var m=this.__eventListeners[i];s?m[m.indexOf(s)]=!1:c.util.array.fill(m,!1)}}function a(i,s){if(this.__eventListeners||(this.__eventListeners={}),arguments.length===1)for(var m in i)this.on(m,i[m]);else this.__eventListeners[i]||(this.__eventListeners[i]=[]),this.__eventListeners[i].push(s);return this}function d(i,s){var m=function(){s.apply(this,arguments),this.off(i,m)}.bind(this);this.on(i,m)}function u(i,s){if(arguments.length===1)for(var m in i)d.call(this,m,i[m]);else d.call(this,i,s);return this}function t(i,s){if(!this.__eventListeners)return this;if(arguments.length===0)for(i in this.__eventListeners)p.call(this,i);else if(arguments.length===1&&typeof arguments[0]=="object")for(var m in i)p.call(this,m,i[m]);else p.call(this,i,s);return this}function e(i,s){if(!this.__eventListeners)return this;var m=this.__eventListeners[i];if(!m)return this;for(var o=0,y=m.length;o<y;o++)m[o]&&m[o].call(this,s||{});return this.__eventListeners[i]=m.filter(function(C){return C!==!1}),this}c.Observable={fire:e,on:a,once:u,off:t}}(),c.Collection={_objects:[],add:function(){if(this._objects.push.apply(this._objects,arguments),this._onObjectAdded)for(var p=0,a=arguments.length;p<a;p++)this._onObjectAdded(arguments[p]);return this.renderOnAddRemove&&this.requestRenderAll(),this},insertAt:function(p,a,d){var u=this._objects;return d?u[a]=p:u.splice(a,0,p),this._onObjectAdded&&this._onObjectAdded(p),this.renderOnAddRemove&&this.requestRenderAll(),this},remove:function(){for(var p=this._objects,a,d=!1,u=0,t=arguments.length;u<t;u++)a=p.indexOf(arguments[u]),a!==-1&&(d=!0,p.splice(a,1),this._onObjectRemoved&&this._onObjectRemoved(arguments[u]));return this.renderOnAddRemov
|
||
|
`]:this.type==="radial"&&(y=["<radialGradient ",C,' cx="',E?s.x1:s.x2,'" cy="',E?s.y1:s.y2,'" r="',E?s.r1:s.r2,'" fx="',E?s.x2:s.x1,'" fy="',E?s.y2:s.y1,`">
|
||
|
`]),this.type==="radial"){if(E)for(b=b.concat(),b.reverse(),m=0,o=b.length;m<o;m++)b[m].offset=1-b[m].offset;var nt=Math.min(s.r1,s.r2);if(nt>0){var it=Math.max(s.r1,s.r2),Mt=nt/it;for(m=0,o=b.length;m<o;m++)b[m].offset+=Mt*(1-b[m].offset)}}for(m=0,o=b.length;m<o;m++){var K=b[m];y.push("<stop ",'offset="',K.offset*100+"%",'" style="stop-color:',K.color,typeof K.opacity!="undefined"?";stop-opacity: "+K.opacity:";",`"/>
|
||
|
`)}return y.push(this.type==="linear"?`</linearGradient>
|
||
|
`:`</radialGradient>
|
||
|
`),y.join("")},toLive:function(e){var i,s=c.util.object.clone(this.coords),m,o;if(!!this.type){for(this.type==="linear"?i=e.createLinearGradient(s.x1,s.y1,s.x2,s.y2):this.type==="radial"&&(i=e.createRadialGradient(s.x1,s.y1,s.r1,s.x2,s.y2,s.r2)),m=0,o=this.colorStops.length;m<o;m++){var y=this.colorStops[m].color,C=this.colorStops[m].opacity,b=this.colorStops[m].offset;typeof C!="undefined"&&(y=new c.Color(y).setAlpha(C).toRgba()),i.addColorStop(b,y)}return i}}}),c.util.object.extend(c.Gradient,{fromElement:function(e,i,s,m){var o=parseFloat(s)/(/%$/.test(s)?100:1);o=o<0?0:o>1?1:o,isNaN(o)&&(o=1);var y=e.getElementsByTagName("stop"),C,b=e.getAttribute("gradientUnits")==="userSpaceOnUse"?"pixels":"percentage",E=e.getAttribute("gradientTransform")||"",O=[],L,N,B=0,Y=0,nt;for(e.nodeName==="linearGradient"||e.nodeName==="LINEARGRADIENT"?(C="linear",L=a(e)):(C="radial",L=d(e)),N=y.length;N--;)O.push(p(y[N],o));nt=c.parseTransformAttribute(E),t(i,L,m,b),b==="pixels"&&(B=-i.left,Y=-i.top);var it=new c.Gradient({id:e.getAttribute("id"),type:C,coords:L,colorStops:O,gradientUnits:b,gradientTransform:nt,offsetX:B,offsetY:Y});return it}});function t(e,i,s,m){var o,y;Object.keys(i).forEach(function(C){o=i[C],o==="Infinity"?y=1:o==="-Infinity"?y=0:(y=parseFloat(i[C],10),typeof o=="string"&&/^(\d+\.\d+)%|(\d+)%$/.test(o)&&(y*=.01,m==="pixels"&&((C==="x1"||C==="x2"||C==="r2")&&(y*=s.viewBoxWidth||s.width),(C==="y1"||C==="y2")&&(y*=s.viewBoxHeight||s.height)))),i[C]=y})}}(),function(){"use strict";var p=c.util.toFixed;c.Pattern=c.util.createClass({repeat:"repeat",offsetX:0,offsetY:0,crossOrigin:"",patternTransform:null,initialize:function(a,d){if(a||(a={}),this.id=c.Object.__uid++,this.setOptions(a),!a.source||a.source&&typeof a.source!="string"){d&&d(this);return}else{var u=this;this.source=c.util.createImage(),c.util.loadImage(a.source,function(t,e){u.source=t,d&&d(u,e)},null,this.crossOrigin)}},toObject:function(a){var d=c.Object.NUM_FRACTION_DIGITS,u,t;return typeof this.source.src=="string"?u=this.source.src:typeof this.source=="object"&&this.source.toDataURL&&(u=this.source.toDataURL()),t={type:"pattern",source:u,repeat:this.repeat,crossOrigin:this.crossOrigin,offsetX:p(this.offsetX,d),offsetY:p(this.offsetY,d),patternTransform:this.patternTransform?this.patternTransform.concat():null},c.util.populateWithProperties(this,t,a),t},toSVG:function(a){var d=typeof this.source=="function"?this.source():this.source,u=d.width/a.width,t=d.height/a.height,e=this.offsetX/a.width,i=this.offsetY/a.height,s="";return(this.repeat==="repeat-x"||this.repeat==="no-repeat")&&(t=1,i&&(t+=Math.abs(i))),(this.repeat==="repeat-y"||this.repeat==="no-repeat")&&(u=1,e&&(u+=Math.abs(e))),d.src?s=d.src:d.toDataURL&&(s=d.toDataURL()),'<pattern id="SVGID_'+this.id+'" x="'+e+'" y="'+i+'" width="'+u+'" height="'+t+`">
|
||
|
<image x="0" y="0" width="`+d.width+'" height="'+d.height+'" xlink:href="'+s+`"></image>
|
||
|
</pattern>
|
||
|
`},setOptions:function(a){for(var d in a)this[d]=a[d]},toLive:function(a){var d=this.source;return!d||typeof d.src!="undefined"&&(!d.complete||d.naturalWidth===0||d.naturalHeight===0)?"":a.createPattern(d,this.repeat)}})}(),function(p){"use strict";var a=p.fabric||(p.fabric={}),d=a.util.toFixed;if(a.Shadow){a.warn("fabric.Shadow is already defined.");return}a.Shadow=a.util.createClass({color:"rgb(0,0,0)",blur:0,offsetX:0,offsetY:0,affectStroke:!1,includeDefaultValues:!0,nonScaling:!1,initialize:function(u){typeof u=="string"&&(u=this._parseShadow(u));for(var t in u)this[t]=u[t];this.id=a.Object.__uid++},_parseShadow:function(u){var t=u.trim(),e=a.Shadow.reOffsetsAndBlur.exec(t)||[],i=t.replace(a.Shadow.reOffsetsAndBlur,"")||"rgb(0,0,0)";return{color:i.trim(),offsetX:parseFloat(e[1],10)||0,offsetY:parseFloat(e[2],10)||0,blur:parseFloat(e[3],10)||0}},toString:function(){return[this.offsetX,this.offsetY,this.blur,this.color].join("px ")},toSVG:function(u){var t=40,e=40,i=a.Object.NUM_FRACTION_DIGITS,s=a.util.rotateVector({x:this.offsetX,y:this.offsetY},a.util.degreesToRadians(-u.angle)),m=20,o=new a.Color(this.color);return u.width&&u.height&&(t=d((Math.abs(s.x)+this.blur)/u.width,i)*100+m,e=d((Math.abs(s.y)+this.blur)/u.height,i)*100+m),u.flipX&&(s.x*=-1),u.flipY&&(s.y*=-1),'<filter id="SVGID_'+this.id+'" y="-'+e+'%" height="'+(100+2*e)+'%" x="-'+t+'%" width="'+(100+2*t)+`%" >
|
||
|
<feGaussianBlur in="SourceAlpha" stdDeviation="`+d(this.blur?this.blur/2:0,i)+`"></feGaussianBlur>
|
||
|
<feOffset dx="`+d(s.x,i)+'" dy="'+d(s.y,i)+`" result="oBlur" ></feOffset>
|
||
|
<feFlood flood-color="`+o.toRgb()+'" flood-opacity="'+o.getAlpha()+`"/>
|
||
|
<feComposite in2="oBlur" operator="in" />
|
||
|
<feMerge>
|
||
|
<feMergeNode></feMergeNode>
|
||
|
<feMergeNode in="SourceGraphic"></feMergeNode>
|
||
|
</feMerge>
|
||
|
</filter>
|
||
|
`},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 u={},t=a.Shadow.prototype;return["color","blur","offsetX","offsetY","affectStroke","nonScaling"].forEach(function(e){this[e]!==t[e]&&(u[e]=this[e])},this),u}}),a.Shadow.reOffsetsAndBlur=/(?:\s|^)(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(\d+(?:\.\d*)?(?:px)?)?(?:\s?|$)(?:$|\s)/}(x),function(){"use strict";if(c.StaticCanvas){c.warn("fabric.StaticCanvas is already defined.");return}var p=c.util.object.extend,a=c.util.getElementOffset,d=c.util.removeFromArray,u=c.util.toFixed,t=c.util.transformPoint,e=c.util.invertTransform,i=c.util.getNodeCanvas,s=c.util.createCanvasElement,m=new Error("Could not initialize `canvas` element");c.StaticCanvas=c.util.createClass(c.CommonMethods,{initialize:function(o,y){y||(y={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(o,y)},backgroundColor:"",backgroundImage:null,overlayColor:"",overlayImage:null,includeDefaultValues:!0,stateful:!1,renderOnAddRemove:!0,controlsAboveOverlay:!1,allowTouchScrolling:!1,imageSmoothingEnabled:!0,viewportTransform:c.iMatrix.concat(),backgroundVpt:!0,overlayVpt:!0,enableRetinaScaling:!0,vptCoords:{},skipOffscreen:!0,clipPath:void 0,_initStatic:function(o,y){var C=this.requestRenderAllBound;this._objects=[],this._createLowerCanvas(o),this._initOptions(y),this.interactive||this._initRetinaScaling(),y.overlayImage&&this.setOverlayImage(y.overlayImage,C),y.backgroundImage&&this.setBackgroundImage(y.backgroundImage,C),y.backgroundColor&&this.setBackgroundColor(y.backgroundColor,C),y.overlayColor&&this.setOverlayColor(y.overlayColor,C),this.calcOffset()},_isRetinaScaling:function(){return c.devicePixelRatio!==1&&this.enableRetinaScaling},getRetinaScaling:function(){return this._isRetinaScaling()?c.devicePixelRatio:1},_initRetinaScaling:function(){if(!!this._isRetinaScaling()){var o=c.devicePixelRatio;this.__initRetinaScaling(o,this.lowerCanvasEl,this.contextContainer),this.upperCanvasEl&&this.__initRetinaScaling(o,this.upperCanvasEl,this.contextTop)}},__initRetinaScaling:function(o,y,C){y.setAttribute("width",this.width*o),y.setAttribute("height",this.height*o),C.scale(o,o)},calcOffset:function(){return this._offset=a(this.lowerCanvasEl),this},setOverlayImage:function(o,y,C){return this.__setBgOverlayImage("overlayImage",o,y,C)},setBackgroundImage:function(o,y,C){return this.__setBgOverlayImage("backgroundImage",o,y,C)},setOverlayColor:function(o,y){return this.__setBgOverlayColor("overlayColor",o,y)},setBackgroundColor:function(o,y){return this.__setBgOverlayColor("backgroundColor",o,y)},__setBgOverlayImage:function(o,y,C,b){return typeof y=="string"?c.util.loadImage(y,function(E,O){if(E){var L=new c.Image(E,b);this[o]=L,L.canvas=this}C&&C(E,O)},this,b&&b.crossOrigin):(b&&y.setOptions(b),this[o]=y,y&&(y.canvas=this),C&&C(y,!1)),this},__setBgOverlayColor:function(o,y,C){return this[o]=y,this._initGradient(y,o),this._initPattern(y,o,C),this},_createCanvasElement:function(){var o=s();if(!o||(o.style||(o.style={}),typeof o.getContext=="undefined"))throw m;return o},_initOptions:function(o){var y=this.lowerCanvasEl;this._setOptions(o),this.width=this.width||parseInt(y.width,10)||0,this.height=this.height||parseInt(y.height,10)||0,!!this.lowerCanvasEl.style&&(y.width=this.width,y.height=this.height,y.style.width=this.width+"px",y.style.height=this.height+"px",this.viewportTransform=this.viewportTransform.slice())},_createLowerCanvas:function(o){o&&o.getContext?this.lowerCanvasEl=o:this.lowerCanvasEl=c.util.getById(o)||this._createCanvasElement(),c.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(o,y){re
|
||
|
`),this._setSVGBgOverlayColor(C,"background"),this._setSVGBgOverlayImage(C,"backgroundImage",y),this._setSVGObjects(C,y),this.clipPath&&C.push(`</g>
|
||
|
`),this._setSVGBgOverlayColor(C,"overlay"),this._setSVGBgOverlayImage(C,"overlayImage",y),C.push("</svg>"),C.join("")},_setSVGPreamble:function(o,y){y.suppressPreamble||o.push('<?xml version="1.0" encoding="',y.encoding||"UTF-8",`" standalone="no" ?>
|
||
|
`,'<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" ',`"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||
|
`)},_setSVGHeader:function(o,y){var C=y.width||this.width,b=y.height||this.height,E,O='viewBox="0 0 '+this.width+" "+this.height+'" ',L=c.Object.NUM_FRACTION_DIGITS;y.viewBox?O='viewBox="'+y.viewBox.x+" "+y.viewBox.y+" "+y.viewBox.width+" "+y.viewBox.height+'" ':this.svgViewportTransformation&&(E=this.viewportTransform,O='viewBox="'+u(-E[4]/E[0],L)+" "+u(-E[5]/E[3],L)+" "+u(this.width/E[0],L)+" "+u(this.height/E[3],L)+'" '),o.push("<svg ",'xmlns="http://www.w3.org/2000/svg" ','xmlns:xlink="http://www.w3.org/1999/xlink" ','version="1.1" ','width="',C,'" ','height="',b,'" ',O,`xml:space="preserve">
|
||
|
`,"<desc>Created with Fabric.js ",c.version,`</desc>
|
||
|
`,`<defs>
|
||
|
`,this.createSVGFontFacesMarkup(),this.createSVGRefElementsMarkup(),this.createSVGClipPathMarkup(y),`</defs>
|
||
|
`)},createSVGClipPathMarkup:function(o){var y=this.clipPath;return y?(y.clipPathId="CLIPPATH_"+c.Object.__uid++,'<clipPath id="'+y.clipPathId+`" >
|
||
|
`+this.clipPath.toClipPathSVG(o.reviver)+`</clipPath>
|
||
|
`):""},createSVGRefElementsMarkup:function(){var o=this,y=["background","overlay"].map(function(C){var b=o[C+"Color"];if(b&&b.toLive){var E=o[C+"Vpt"],O=o.viewportTransform,L={width:o.width/(E?O[0]:1),height:o.height/(E?O[3]:1)};return b.toSVG(L,{additionalTransform:E?c.util.matrixToSVG(O):""})}});return y.join("")},createSVGFontFacesMarkup:function(){var o="",y={},C,b,E,O,L,N,B,Y,nt,it=c.fontPaths,Mt=[];for(this._objects.forEach(function It(U){Mt.push(U),U._objects&&U._objects.forEach(It)}),Y=0,nt=Mt.length;Y<nt;Y++)if(C=Mt[Y],b=C.fontFamily,!(C.type.indexOf("text")===-1||y[b]||!it[b])&&(y[b]=!0,!!C.styles)){E=C.styles;for(L in E){O=E[L];for(B in O)N=O[B],b=N.fontFamily,!y[b]&&it[b]&&(y[b]=!0)}}for(var K in y)o+=[` @font-face {
|
||
|
`," font-family: '",K,`';
|
||
|
`," src: url('",it[K],`');
|
||
|
`,` }
|
||
|
`].join("");return o&&(o=[' <style type="text/css">',`<![CDATA[
|
||
|
`,o,"]]>",`</style>
|
||
|
`].join("")),o},_setSVGObjects:function(o,y){var C,b,E,O=this._objects;for(b=0,E=O.length;b<E;b++)C=O[b],!C.excludeFromExport&&this._setSVGObject(o,C,y)},_setSVGObject:function(o,y,C){o.push(y.toSVG(C))},_setSVGBgOverlayImage:function(o,y,C){this[y]&&!this[y].excludeFromExport&&this[y].toSVG&&o.push(this[y].toSVG(C))},_setSVGBgOverlayColor:function(o,y){var C=this[y+"Color"],b=this.viewportTransform,E=this.width,O=this.height;if(!!C)if(C.toLive){var L=C.repeat,N=c.util.invertTransform(b),B=this[y+"Vpt"],Y=B?c.util.matrixToSVG(N):"";o.push('<rect transform="'+Y+" translate(",E/2,",",O/2,')"',' x="',C.offsetX-E/2,'" y="',C.offsetY-O/2,'" ','width="',L==="repeat-y"||L==="no-repeat"?C.source.width:E,'" height="',L==="repeat-x"||L==="no-repeat"?C.source.height:O,'" fill="url(#SVGID_'+C.id+')"',`></rect>
|
||
|
`)}else o.push('<rect x="0" y="0" width="100%" height="100%" ','fill="',C,'"',`></rect>
|
||
|
`)},sendToBack:function(o){if(!o)return this;var y=this._activeObject,C,b,E;if(o===y&&o.type==="activeSelection")for(E=y._objects,C=E.length;C--;)b=E[C],d(this._objects,b),this._objects.unshift(b);else d(this._objects,o),this._objects.unshift(o);return this.renderOnAddRemove&&this.requestRenderAll(),this},bringToFront:function(o){if(!o)return this;var y=this._activeObject,C,b,E;if(o===y&&o.type==="activeSelection")for(E=y._objects,C=0;C<E.length;C++)b=E[C],d(this._objects,b),this._objects.push(b);else d(this._objects,o),this._objects.push(o);return this.renderOnAddRemove&&this.requestRenderAll(),this},sendBackwards:function(o,y){if(!o)return this;var C=this._activeObject,b,E,O,L,N,B=0;if(o===C&&o.type==="activeSelection")for(N=C._objects,b=0;b<N.length;b++)E=N[b],O=this._objects.indexOf(E),O>0+B&&(L=O-1,d(this._objects,E),this._objects.splice(L,0,E)),B++;else O=this._objects.indexOf(o),O!==0&&(L=this._findNewLowerIndex(o,O,y),d(this._objects,o),this._objects.splice(L,0,o));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewLowerIndex:function(o,y,C){var b,E;if(C)for(b=y,E=y-1;E>=0;--E){var O=o.intersectsWithObject(this._objects[E])||o.isContainedWithinObject(this._objects[E])||this._objects[E].isContainedWithinObject(o);if(O){b=E;break}}else b=y-1;return b},bringForward:function(o,y){if(!o)return this;var C=this._activeObject,b,E,O,L,N,B=0;if(o===C&&o.type==="activeSelection")for(N=C._objects,b=N.length;b--;)E=N[b],O=this._objects.indexOf(E),O<this._objects.length-1-B&&(L=O+1,d(this._objects,E),this._objects.splice(L,0,E)),B++;else O=this._objects.indexOf(o),O!==this._objects.length-1&&(L=this._findNewUpperIndex(o,O,y),d(this._objects,o),this._objects.splice(L,0,o));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewUpperIndex:function(o,y,C){var b,E,O;if(C)for(b=y,E=y+1,O=this._objects.length;E<O;++E){var L=o.intersectsWithObject(this._objects[E])||o.isContainedWithinObject(this._objects[E])||this._objects[E].isContainedWithinObject(o);if(L){b=E;break}}else b=y+1;return b},moveTo:function(o,y){return d(this._objects,o),this._objects.splice(y,0,o),this.renderOnAddRemove&&this.requestRenderAll()},dispose:function(){return this.isRendering&&(c.util.cancelAnimFrame(this.isRendering),this.isRendering=0),this.forEachObject(function(o){o.dispose&&o.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),c.util.cleanUpJsdomNode(this.lowerCanvasEl),this.lowerCanvasEl=void 0,this},toString:function(){return"#<fabric.Canvas ("+this.complexity()+"): { objects: "+this._objects.length+" }>"}}),p(c.StaticCanvas.prototype,c.Observable),p(c.StaticCanvas.prototype,c.Collection),p(c.StaticCanvas.prototype,c.DataURLExporter),p(c.StaticCanvas,{EMPTY_JSON:'{"objects": [], "background": "white"}',supports:function(o){var y=s();if(!y||!y.getContext)return null;var C=y.getContext("2d");if(!C)return null;switch(o){case"setLineDash":return typeof C.setLineDash!="undefined";default:return null}}}),c.StaticCanvas.prototype.toJSON=c.StaticCanvas.prototype.toObject,c.isLikelyNode&&(c.StaticCanvas.prototype.createPNGStream=function(){var o=i(this.lowerCanvasEl);return o&&o.createPNGStream()},c.StaticCanvas.prototype.createJPEGStream=function(o){var y=i(this.lowerCanvasEl);return y&&y.createJPEGStream(o)})}(),c.BaseBrush=c.util.createClass({color:"rgb(0, 0, 0)",width:1,shadow:null,strokeLineCap:"round",strokeLineJoin:"round",strokeMiterLimit:10,strokeDashArray:null,limitedToCanvasSize:!1,_setBrushStyles:function(){var p=this.canvas.contextTop;p.strokeStyle=this.color,p.lineWidth=this.width,p.lineCap=this.strokeLineCap,p.miterLimit=this.strokeMiterLimi
|
||
|
`)}},toSVG:function(d){return this._createBaseSVGMarkup(this._toSVG(d),{reviver:d})},toClipPathSVG:function(d){return" "+this._createBaseClipPathSVGMarkup(this._toSVG(d),{reviver:d})},_createBaseClipPathSVGMarkup:function(d,u){u=u||{};var t=u.reviver,e=u.additionalTransform||"",i=[this.getSvgTransform(!0,e),this.getSvgCommons()].join(""),s=d.indexOf("COMMON_PARTS");return d[s]=i,t?t(d.join("")):d.join("")},_createBaseSVGMarkup:function(d,u){u=u||{};var t=u.noStyle,e=u.reviver,i=t?"":'style="'+this.getSvgStyles()+'" ',s=u.withShadow?'style="'+this.getSvgFilter()+'" ':"",m=this.clipPath,o=this.strokeUniform?'vector-effect="non-scaling-stroke" ':"",y=m&&m.absolutePositioned,C=this.stroke,b=this.fill,E=this.shadow,O,L=[],N,B=d.indexOf("COMMON_PARTS"),Y=u.additionalTransform;return m&&(m.clipPathId="CLIPPATH_"+c.Object.__uid++,N='<clipPath id="'+m.clipPathId+`" >
|
||
|
`+m.toClipPathSVG(e)+`</clipPath>
|
||
|
`),y&&L.push("<g ",s,this.getSvgCommons(),` >
|
||
|
`),L.push("<g ",this.getSvgTransform(!1),y?"":s+this.getSvgCommons(),` >
|
||
|
`),O=[i,o,t?"":this.addPaintOrder()," ",Y?'transform="'+Y+'" ':""].join(""),d[B]=O,b&&b.toLive&&L.push(b.toSVG(this)),C&&C.toLive&&L.push(C.toSVG(this)),E&&L.push(E.toSVG(this)),m&&L.push(N),L.push(d.join("")),L.push(`</g>
|
||
|
`),y&&L.push(`</g>
|
||
|
`),e?e(L.join("")):L.join("")},addPaintOrder:function(){return this.paintFirst!=="fill"?' paint-order="'+this.paintFirst+'" ':""}})}(),function(){var p=c.util.object.extend,a="stateProperties";function d(t,e,i){var s={},m=!0;i.forEach(function(o){s[o]=t[o]}),p(t[e],s,m)}function u(t,e,i){if(t===e)return!0;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(var s=0,m=t.length;s<m;s++)if(!u(t[s],e[s]))return!1;return!0}else if(t&&typeof t=="object"){var o=Object.keys(t),y;if(!e||typeof e!="object"||!i&&o.length!==Object.keys(e).length)return!1;for(var s=0,m=o.length;s<m;s++)if(y=o[s],!(y==="canvas"||y==="group")&&!u(t[y],e[y]))return!1;return!0}}c.util.object.extend(c.Object.prototype,{hasStateChanged:function(t){t=t||a;var e="_"+t;return Object.keys(this[e]).length<this[t].length?!0:!u(this[e],this,!0)},saveState:function(t){var e=t&&t.propertySet||a,i="_"+e;return this[i]?(d(this,i,this[e]),t&&t.stateProperties&&d(this,i,t.stateProperties),this):this.setupState(t)},setupState:function(t){t=t||{};var e=t.propertySet||a;return t.propertySet=e,this["_"+e]={},this.saveState(t),this}})}(),function(){var p=c.util.degreesToRadians;c.util.object.extend(c.Object.prototype,{_findTargetCorner:function(a,d){if(!this.hasControls||this.group||!this.canvas||this.canvas._activeObject!==this)return!1;var u=a.x,t=a.y,e,i,s=Object.keys(this.oCoords),m=s.length-1,o;for(this.__corner=0;m>=0;m--)if(o=s[m],!!this.isControlVisible(o)&&(i=this._getImageLines(d?this.oCoords[o].touchCorner:this.oCoords[o].corner),e=this._findCrossPoints({x:u,y:t},i),e!==0&&e%2==1))return this.__corner=o,o;return!1},forEachControl:function(a){for(var d in this.controls)a(this.controls[d],d,this)},_setCornerCoords:function(){var a=this.oCoords;for(var d in a){var u=this.controls[d];a[d].corner=u.calcCornerCoords(this.angle,this.cornerSize,a[d].x,a[d].y,!1),a[d].touchCorner=u.calcCornerCoords(this.angle,this.touchCornerSize,a[d].x,a[d].y,!0)}},drawSelectionBackground:function(a){if(!this.selectionBackgroundColor||this.canvas&&!this.canvas.interactive||this.canvas&&this.canvas._activeObject!==this)return this;a.save();var d=this.getCenterPoint(),u=this._calculateCurrentDimensions(),t=this.canvas.viewportTransform;return a.translate(d.x,d.y),a.scale(1/t[0],1/t[3]),a.rotate(p(this.angle)),a.fillStyle=this.selectionBackgroundColor,a.fillRect(-u.x/2,-u.y/2,u.x,u.y),a.restore(),this},drawBorders:function(a,d){d=d||{};var u=this._calculateCurrentDimensions(),t=this.borderScaleFactor,e=u.x+t,i=u.y+t,s=typeof d.hasControls!="undefined"?d.hasControls:this.hasControls,m=!1;return a.save(),a.strokeStyle=d.borderColor||this.borderColor,this._setLineDash(a,d.borderDashArray||this.borderDashArray),a.strokeRect(-e/2,-i/2,e,i),s&&(a.beginPath(),this.forEachControl(function(o,y,C){o.withConnection&&o.getVisibility(C,y)&&(m=!0,a.moveTo(o.x*e,o.y*i),a.lineTo(o.x*e+o.offsetX,o.y*i+o.offsetY))}),m&&a.stroke()),a.restore(),this},drawBordersInGroup:function(a,d,u){u=u||{};var t=c.util.sizeAfterTransform(this.width,this.height,d),e=this.strokeWidth,i=this.strokeUniform,s=this.borderScaleFactor,m=t.x+e*(i?this.canvas.getZoom():d.scaleX)+s,o=t.y+e*(i?this.canvas.getZoom():d.scaleY)+s;return a.save(),this._setLineDash(a,u.borderDashArray||this.borderDashArray),a.strokeStyle=u.borderColor||this.borderColor,a.strokeRect(-m/2,-o/2,m,o),a.restore(),this},drawControls:function(a,d){d=d||{},a.save();var u=this.canvas.getRetinaScaling(),t,e;return a.setTransform(u,0,0,u,0,0),a.strokeStyle=a.fillStyle=d.cornerColor||this.cornerColor,this.transparentCorners||(a.strokeStyle=d.cornerStrokeColor||this.cornerStrokeColor),this._setLineDash(a,d.cornerDashArray||this.cornerDashArray),this.setCoords(),this.group&&(t=this.group.calcTransformMatrix()),this.forEachControl(function(i,s,m){e=m.oCoords[s],i.getVisibility(m,s)&&(t&&(e=c.util.transformPoint(e,t)),i.render(a,e.x,e.y,d,m))}),a.restore(),this},isControlVisible:function(a){return this.controls[a]&&this.controls[a].getVisibility(this,a)},setControlVisible:function(a,d){return this._controlsVisibility||(this._controlsVisibility={}),t
|
||
|
`]}}),a.Line.ATTRIBUTE_NAMES=a.SHARED_ATTRIBUTES.concat("x1 y1 x2 y2".split(" ")),a.Line.fromElement=function(i,s,m){m=m||{};var o=a.parseAttributes(i,a.Line.ATTRIBUTE_NAMES),y=[o.x1||0,o.y1||0,o.x2||0,o.y2||0];s(new a.Line(y,d(o,m)))},a.Line.fromObject=function(i,s){function m(y){delete y.points,s&&s(y)}var o=u(i,!0);o.points=[i.x1,i.y1,i.x2,i.y2],a.Object._fromObject("Line",o,m,"points")};function e(i,s){var m=i.origin,o=i.axis1,y=i.axis2,C=i.dimension,b=s.nearest,E=s.center,O=s.farthest;return function(){switch(this.get(m)){case b:return Math.min(this.get(o),this.get(y));case E:return Math.min(this.get(o),this.get(y))+.5*this.get(C);case O:return Math.max(this.get(o),this.get(y))}}}}(x),function(p){"use strict";var a=p.fabric||(p.fabric={}),d=Math.PI;if(a.Circle){a.warn("fabric.Circle is already defined.");return}a.Circle=a.util.createClass(a.Object,{type:"circle",radius:0,startAngle:0,endAngle:d*2,cacheProperties:a.Object.prototype.cacheProperties.concat("radius","startAngle","endAngle"),_set:function(t,e){return this.callSuper("_set",t,e),t==="radius"&&this.setRadius(e),this},toObject:function(t){return this.callSuper("toObject",["radius","startAngle","endAngle"].concat(t))},_toSVG:function(){var t,e=0,i=0,s=(this.endAngle-this.startAngle)%(2*d);if(s===0)t=["<circle ","COMMON_PARTS",'cx="'+e+'" cy="'+i+'" ','r="',this.radius,`" />
|
||
|
`];else{var m=a.util.cos(this.startAngle)*this.radius,o=a.util.sin(this.startAngle)*this.radius,y=a.util.cos(this.endAngle)*this.radius,C=a.util.sin(this.endAngle)*this.radius,b=s>d?"1":"0";t=['<path d="M '+m+" "+o," A "+this.radius+" "+this.radius," 0 ",+b+" 1"," "+y+" "+C,'" ',"COMMON_PARTS",` />
|
||
|
`]}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",t*2).set("height",t*2)}}),a.Circle.ATTRIBUTE_NAMES=a.SHARED_ATTRIBUTES.concat("cx cy r".split(" ")),a.Circle.fromElement=function(t,e){var i=a.parseAttributes(t,a.Circle.ATTRIBUTE_NAMES);if(!u(i))throw new Error("value of `r` attribute is required and can not be negative");i.left=(i.left||0)-i.radius,i.top=(i.top||0)-i.radius,e(new a.Circle(i))};function u(t){return"radius"in t&&t.radius>=0}a.Circle.fromObject=function(t,e){a.Object._fromObject("Circle",t,e)}}(x),function(p){"use strict";var a=p.fabric||(p.fabric={});if(a.Triangle){a.warn("fabric.Triangle is already defined");return}a.Triangle=a.util.createClass(a.Object,{type:"triangle",width:100,height:100,_render:function(d){var u=this.width/2,t=this.height/2;d.beginPath(),d.moveTo(-u,t),d.lineTo(0,-t),d.lineTo(u,t),d.closePath(),this._renderPaintInOrder(d)},_toSVG:function(){var d=this.width/2,u=this.height/2,t=[-d+" "+u,"0 "+-u,d+" "+u].join(",");return["<polygon ","COMMON_PARTS",'points="',t,'" />']}}),a.Triangle.fromObject=function(d,u){return a.Object._fromObject("Triangle",d,u)}}(x),function(p){"use strict";var a=p.fabric||(p.fabric={}),d=Math.PI*2;if(a.Ellipse){a.warn("fabric.Ellipse is already defined.");return}a.Ellipse=a.util.createClass(a.Object,{type:"ellipse",rx:0,ry:0,cacheProperties:a.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(u){this.callSuper("initialize",u),this.set("rx",u&&u.rx||0),this.set("ry",u&&u.ry||0)},_set:function(u,t){switch(this.callSuper("_set",u,t),u){case"rx":this.rx=t,this.set("width",t*2);break;case"ry":this.ry=t,this.set("height",t*2);break}return this},getRx:function(){return this.get("rx")*this.get("scaleX")},getRy:function(){return this.get("ry")*this.get("scaleY")},toObject:function(u){return this.callSuper("toObject",["rx","ry"].concat(u))},_toSVG:function(){return["<ellipse ","COMMON_PARTS",'cx="0" cy="0" ','rx="',this.rx,'" ry="',this.ry,`" />
|
||
|
`]},_render:function(u){u.beginPath(),u.save(),u.transform(1,0,0,this.ry/this.rx,0,0),u.arc(0,0,this.rx,0,d,!1),u.restore(),this._renderPaintInOrder(u)}}),a.Ellipse.ATTRIBUTE_NAMES=a.SHARED_ATTRIBUTES.concat("cx cy rx ry".split(" ")),a.Ellipse.fromElement=function(u,t){var e=a.parseAttributes(u,a.Ellipse.ATTRIBUTE_NAMES);e.left=(e.left||0)-e.rx,e.top=(e.top||0)-e.ry,t(new a.Ellipse(e))},a.Ellipse.fromObject=function(u,t){a.Object._fromObject("Ellipse",u,t)}}(x),function(p){"use strict";var a=p.fabric||(p.fabric={}),d=a.util.object.extend;if(a.Rect){a.warn("fabric.Rect is already defined");return}a.Rect=a.util.createClass(a.Object,{stateProperties:a.Object.prototype.stateProperties.concat("rx","ry"),type:"rect",rx:0,ry:0,cacheProperties:a.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(u){this.callSuper("initialize",u),this._initRxRy()},_initRxRy:function(){this.rx&&!this.ry?this.ry=this.rx:this.ry&&!this.rx&&(this.rx=this.ry)},_render:function(u){var t=this.rx?Math.min(this.rx,this.width/2):0,e=this.ry?Math.min(this.ry,this.height/2):0,i=this.width,s=this.height,m=-this.width/2,o=-this.height/2,y=t!==0||e!==0,C=1-.5522847498;u.beginPath(),u.moveTo(m+t,o),u.lineTo(m+i-t,o),y&&u.bezierCurveTo(m+i-C*t,o,m+i,o+C*e,m+i,o+e),u.lineTo(m+i,o+s-e),y&&u.bezierCurveTo(m+i,o+s-C*e,m+i-C*t,o+s,m+i-t,o+s),u.lineTo(m+t,o+s),y&&u.bezierCurveTo(m+C*t,o+s,m,o+s-C*e,m,o+s-e),u.lineTo(m,o+e),y&&u.bezierCurveTo(m,o+C*e,m+C*t,o,m+t,o),u.closePath(),this._renderPaintInOrder(u)},toObject:function(u){return this.callSuper("toObject",["rx","ry"].concat(u))},_toSVG:function(){var u=-this.width/2,t=-this.height/2;return["<rect ","COMMON_PARTS",'x="',u,'" y="',t,'" rx="',this.rx,'" ry="',this.ry,'" width="',this.width,'" height="',this.height,`" />
|
||
|
`]}}),a.Rect.ATTRIBUTE_NAMES=a.SHARED_ATTRIBUTES.concat("x y rx ry width height".split(" ")),a.Rect.fromElement=function(u,t,e){if(!u)return t(null);e=e||{};var i=a.parseAttributes(u,a.Rect.ATTRIBUTE_NAMES);i.left=i.left||0,i.top=i.top||0,i.height=i.height||0,i.width=i.width||0;var s=new a.Rect(d(e?a.util.object.clone(e):{},i));s.visible=s.visible&&s.width>0&&s.height>0,t(s)},a.Rect.fromObject=function(u,t){return a.Object._fromObject("Rect",u,t)}}(x),function(p){"use strict";var a=p.fabric||(p.fabric={}),d=a.util.object.extend,u=a.util.array.min,t=a.util.array.max,e=a.util.toFixed;if(a.Polyline){a.warn("fabric.Polyline is already defined");return}a.Polyline=a.util.createClass(a.Object,{type:"polyline",points:null,cacheProperties:a.Object.prototype.cacheProperties.concat("points"),initialize:function(i,s){s=s||{},this.points=i||[],this.callSuper("initialize",s),this._setPositionDimensions(s)},_setPositionDimensions:function(i){var s=this._calcDimensions(i),m;this.width=s.width,this.height=s.height,i.fromSVG||(m=this.translateToGivenOrigin({x:s.left-this.strokeWidth/2,y:s.top-this.strokeWidth/2},"left","top",this.originX,this.originY)),typeof i.left=="undefined"&&(this.left=i.fromSVG?s.left:m.x),typeof i.top=="undefined"&&(this.top=i.fromSVG?s.top:m.y),this.pathOffset={x:s.left+this.width/2,y:s.top+this.height/2}},_calcDimensions:function(){var i=this.points,s=u(i,"x")||0,m=u(i,"y")||0,o=t(i,"x")||0,y=t(i,"y")||0,C=o-s,b=y-m;return{left:s,top:m,width:C,height:b}},toObject:function(i){return d(this.callSuper("toObject",i),{points:this.points.concat()})},_toSVG:function(){for(var i=[],s=this.pathOffset.x,m=this.pathOffset.y,o=a.Object.NUM_FRACTION_DIGITS,y=0,C=this.points.length;y<C;y++)i.push(e(this.points[y].x-s,o),",",e(this.points[y].y-m,o)," ");return["<"+this.type+" ","COMMON_PARTS",'points="',i.join(""),`" />
|
||
|
`]},commonRender:function(i){var s,m=this.points.length,o=this.pathOffset.x,y=this.pathOffset.y;if(!m||isNaN(this.points[m-1].y))return!1;i.beginPath(),i.moveTo(this.points[0].x-o,this.points[0].y-y);for(var C=0;C<m;C++)s=this.points[C],i.lineTo(s.x-o,s.y-y);return!0},_render:function(i){!this.commonRender(i)||this._renderPaintInOrder(i)},complexity:function(){return this.get("points").length}}),a.Polyline.ATTRIBUTE_NAMES=a.SHARED_ATTRIBUTES.concat(),a.Polyline.fromElementGenerator=function(i){return function(s,m,o){if(!s)return m(null);o||(o={});var y=a.parsePointsAttribute(s.getAttribute("points")),C=a.parseAttributes(s,a[i].ATTRIBUTE_NAMES);C.fromSVG=!0,m(new a[i](y,d(C,o)))}},a.Polyline.fromElement=a.Polyline.fromElementGenerator("Polyline"),a.Polyline.fromObject=function(i,s){return a.Object._fromObject("Polyline",i,s,"points")}}(x),function(p){"use strict";var a=p.fabric||(p.fabric={});if(a.Polygon){a.warn("fabric.Polygon is already defined");return}a.Polygon=a.util.createClass(a.Polyline,{type:"polygon",_render:function(d){!this.commonRender(d)||(d.closePath(),this._renderPaintInOrder(d))}}),a.Polygon.ATTRIBUTE_NAMES=a.SHARED_ATTRIBUTES.concat(),a.Polygon.fromElement=a.Polyline.fromElementGenerator("Polygon"),a.Polygon.fromObject=function(d,u){a.Object._fromObject("Polygon",d,u,"points")}}(x),function(p){"use strict";var a=p.fabric||(p.fabric={}),d=a.util.array.min,u=a.util.array.max,t=a.util.object.extend,e=Object.prototype.toString,i=a.util.toFixed;if(a.Path){a.warn("fabric.Path is already defined");return}a.Path=a.util.createClass(a.Object,{type:"path",path:null,cacheProperties:a.Object.prototype.cacheProperties.concat("path","fillRule"),stateProperties:a.Object.prototype.stateProperties.concat("path"),initialize:function(s,m){m=m||{},this.callSuper("initialize",m),s||(s=[]);var o=e.call(s)==="[object Array]";this.path=a.util.makePathSimpler(o?s:a.util.parsePath(s)),!!this.path&&a.Polyline.prototype._setPositionDimensions.call(this,m)},_renderPathCommands:function(s){var m,o=0,y=0,C=0,b=0,E=0,O=0,L=-this.pathOffset.x,N=-this.pathOffset.y;s.beginPath();for(var B=0,Y=this.path.length;B<Y;++B)switch(m=this.path[B],m[0]){case"L":C=m[1],b=m[2],s.lineTo(C+L,b+N);break;case"M":C=m[1],b=m[2],o=C,y=b,s.moveTo(C+L,b+N);break;case"C":C=m[5],b=m[6],E=m[3],O=m[4],s.bezierCurveTo(m[1]+L,m[2]+N,E+L,O+N,C+L,b+N);break;case"Q":s.quadraticCurveTo(m[1]+L,m[2]+N,m[3]+L,m[4]+N),C=m[3],b=m[4],E=m[1],O=m[2];break;case"z":case"Z":C=o,b=y,s.closePath();break}},_render:function(s){this._renderPathCommands(s),this._renderPaintInOrder(s)},toString:function(){return"#<fabric.Path ("+this.complexity()+'): { "top": '+this.top+', "left": '+this.left+" }>"},toObject:function(s){return t(this.callSuper("toObject",s),{path:this.path.map(function(m){return m.slice()})})},toDatalessObject:function(s){var m=this.toObject(["sourcePath"].concat(s));return m.sourcePath&&delete m.path,m},_toSVG:function(){var s=a.util.joinPath(this.path);return["<path ","COMMON_PARTS",'d="',s,'" stroke-linecap="round" ',`/>
|
||
|
`]},_getOffsetTransform:function(){var s=a.Object.NUM_FRACTION_DIGITS;return" translate("+i(-this.pathOffset.x,s)+", "+i(-this.pathOffset.y,s)+")"},toClipPathSVG:function(s){var m=this._getOffsetTransform();return" "+this._createBaseClipPathSVGMarkup(this._toSVG(),{reviver:s,additionalTransform:m})},toSVG:function(s){var m=this._getOffsetTransform();return this._createBaseSVGMarkup(this._toSVG(),{reviver:s,additionalTransform:m})},complexity:function(){return this.path.length},_calcDimensions:function(){for(var s=[],m=[],o,y=0,C=0,b=0,E=0,O,L=0,N=this.path.length;L<N;++L){switch(o=this.path[L],o[0]){case"L":b=o[1],E=o[2],O=[];break;case"M":b=o[1],E=o[2],y=b,C=E,O=[];break;case"C":O=a.util.getBoundsOfCurve(b,E,o[1],o[2],o[3],o[4],o[5],o[6]),b=o[5],E=o[6];break;case"Q":O=a.util.getBoundsOfCurve(b,E,o[1],o[2],o[1],o[2],o[3],o[4]),b=o[3],E=o[4];break;case"z":case"Z":b=y,E=C;break}O.forEach(function(It){s.push(It.x),m.push(It.y)}),s.push(b),m.push(E)}var B=d(s)||0,Y=d(m)||0,nt=u(s)||0,it=u(m)||0,Mt=nt-B,K=it-Y;return{left:B,top:Y,width:Mt,height:K}}}),a.Path.fromObject=function(s,m){if(typeof s.sourcePath=="string"){var o=s.sourcePath;a.loadSVGFromURL(o,function(y){var C=y[0];C.setOptions(s),m&&m(C)})}else a.Object._fromObject("Path",s,m,"path")},a.Path.ATTRIBUTE_NAMES=a.SHARED_ATTRIBUTES.concat(["d"]),a.Path.fromElement=function(s,m,o){var y=a.parseAttributes(s,a.Path.ATTRIBUTE_NAMES);y.fromSVG=!0,m(new a.Path(y.d,t(y,o)))}}(x),function(p){"use strict";var a=p.fabric||(p.fabric={}),d=a.util.array.min,u=a.util.array.max;a.Group||(a.Group=a.util.createClass(a.Object,a.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 s=this._objects.length;s--;)this._objects[s].group=this;if(i)this._updateObjectsACoords();else{var m=e&&e.centerPoint;e.originX!==void 0&&(this.originX=e.originX),e.originY!==void 0&&(this.originY=e.originY),m||this._calcBounds(),this._updateObjectsCoords(m),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){for(var t=t||this.getCenterPoint(),e=this._objects.length;e--;)this._updateObjectCoords(this._objects[e],t)},_updateObjectCoords:function(t,e){var i=t.left,s=t.top,m=!0;t.set({left:i-e.x,top:s-e.y}),t.group=this,t.setCoords(m)},toString:function(){return"#<fabric.Group: ("+this.complexity()+")>"},addWithUpdate:function(t){var e=!!this.group;return this._restoreObjectsState(),a.util.resetObjectTransform(this),t&&(e&&a.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,e?this.group.addWithUpdate():this.setCoords(),this},removeWithUpdate:function(t){return this._restoreObjectsState(),a.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,e){var i=this._objects.length;if(this.useSetOnGroup)for(;i--;)this._objects[i].setOnGroup(t,e);if(t==="canvas")for(;i--;)this._objects[i]._set(t,e);a.Object.prototype._set.call(this,t,e)},toObject:function(t){var e=this.includeDefaultValues,i=this._objects.filter(function(m){return!m.excludeFromExport}).map(function(m){var o=m.includeDefaultValues;m.includeDefaultValues=e;var y=m.toObject(t);return m.includeDefaultValues=o,y}),s=a.Object.prototype.toObject.call(this,t);return s.objects=i,s},toDatalessObject:function(t){var e,i=this.sourcePath;if(i)e=i;else{var s=this.includeDefaultValues;e=this._objects.map(function(o){var y=o.includeDefaultValues;o.includeDefaultValues=s;var C=o.toDatalessObject(t);return o.includeDefaultValues=y,C})}var m=a.Object.prototype.toDatalessObject.call(this,t);return m.o
|
||
|
`],i=0,s=this._objects.length;i<s;i++)e.push(" ",this._objects[i].toSVG(t));return e.push(`</g>
|
||
|
`),e},getSvgStyles:function(){var t=typeof this.opacity!="undefined"&&this.opacity!==1?"opacity: "+this.opacity+";":"",e=this.visible?"":" visibility: hidden;";return[t,this.getSvgFilter(),e].join("")},toClipPathSVG:function(t){for(var e=[],i=0,s=this._objects.length;i<s;i++)e.push(" ",this._objects[i].toClipPathSVG(t));return this._createBaseClipPathSVGMarkup(e,{reviver:t})}}),a.Group.fromObject=function(t,e){var i=t.objects,s=a.util.object.clone(t,!0);if(delete s.objects,typeof i=="string"){a.loadSVGFromURL(i,function(m){var o=a.util.groupSVGElements(m,t,i);o.set(s),e&&e(o)});return}a.util.enlivenObjects(i,function(m){a.util.enlivenObjects([t.clipPath],function(o){var y=a.util.object.clone(t,!0);y.clipPath=o[0],delete y.objects,e&&e(new a.Group(m,y,!0))})})})}(x),function(p){"use strict";var a=p.fabric||(p.fabric={});a.ActiveSelection||(a.ActiveSelection=a.util.createClass(a.Group,{type:"activeSelection",initialize:function(d,u){u=u||{},this._objects=d||[];for(var t=this._objects.length;t--;)this._objects[t].group=this;u.originX&&(this.originX=u.originX),u.originY&&(this.originY=u.originY),this._calcBounds(),this._updateObjectsCoords(),a.Object.prototype.initialize.call(this,u),this.setCoords()},toGroup:function(){var d=this._objects.concat();this._objects=[];var u=a.Object.prototype.toObject.call(this),t=new a.Group([]);if(delete u.type,t.set(u),d.forEach(function(i){i.canvas.remove(i),i.group=t}),t._objects=d,!this.canvas)return t;var e=this.canvas;return e.add(t),e._activeObject=t,t.setCoords(),t},onDeselect:function(){return this.destroy(),!1},toString:function(){return"#<fabric.ActiveSelection: ("+this.complexity()+")>"},shouldCache:function(){return!1},isOnACache:function(){return!1},_renderControls:function(d,u,t){d.save(),d.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1,this.callSuper("_renderControls",d,u),t=t||{},typeof t.hasControls=="undefined"&&(t.hasControls=!1),t.forActiveSelection=!0;for(var e=0,i=this._objects.length;e<i;e++)this._objects[e]._renderControls(d,t);d.restore()}}),a.ActiveSelection.fromObject=function(d,u){a.util.enlivenObjects(d.objects,function(t){delete d.objects,u&&u(new a.ActiveSelection(t,d,!0))})})}(x),function(p){"use strict";var a=c.util.object.extend;if(p.fabric||(p.fabric={}),p.fabric.Image){c.warn("fabric.Image is already defined.");return}c.Image=c.util.createClass(c.Object,{type:"image",strokeWidth:0,srcFromAttribute:!1,_lastScaleX:1,_lastScaleY:1,_filterScalingX:1,_filterScalingY:1,minimumScaleTrigger:.5,stateProperties:c.Object.prototype.stateProperties.concat("cropX","cropY"),cacheProperties:c.Object.prototype.cacheProperties.concat("cropX","cropY"),cacheKey:"",cropX:0,cropY:0,imageSmoothing:!0,initialize:function(d,u){u||(u={}),this.filters=[],this.cacheKey="texture"+c.Object.__uid++,this.callSuper("initialize",u),this._initElement(d,u)},getElement:function(){return this._element||{}},setElement:function(d,u){return this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+"_filtered"),this._element=d,this._originalElement=d,this._initConfig(u),this.filters.length!==0&&this.applyFilters(),this.resizeFilter&&this.applyResizeFilters(),this},removeTexture:function(d){var u=c.filterBackend;u&&u.evictCachesForKey&&u.evictCachesForKey(d)},dispose:function(){this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+"_filtered"),this._cacheContext=void 0,["_originalElement","_element","_filteredEl","_cacheCanvas"].forEach(function(d){c.util.cleanUpJsdomNode(this[d]),this[d]=void 0}.bind(this))},getCrossOrigin:function(){return this._originalElement&&(this._originalElement.crossOrigin||null)},getOriginalSize:function(){var d=this.getElement();return{width:d.naturalWidth||d.width,height:d.naturalHeight||d.height}},_stroke:function(d){if(!(!this.stroke||this.strokeWidth===0)){var u=this.width/2,t=this.height/2;d.beginPath(),d.moveTo(-u,-t),d.lineTo(u,-t),d.lineTo(u,t),d.lineTo(-u,t),d.lineTo(-u,-t),d.closePath()}},toObject:function(d){var u=[];this.filters.forEach(function(e){e&&u.push(e.toObject())});var t=a(this.callSuper("toObject",["cropX","cropY"].c
|
||
|
`,' <rect x="'+i+'" y="'+s+'" width="'+this.width+'" height="'+this.height+`" />
|
||
|
`,`</clipPath>
|
||
|
`),m=' clip-path="url(#imageCrop_'+y+')" '}if(this.imageSmoothing||(o='" image-rendering="optimizeSpeed'),u.push(" <image ","COMMON_PARTS",'xlink:href="',this.getSvgSrc(!0),'" x="',i-this.cropX,'" y="',s-this.cropY,'" width="',e.width||e.naturalWidth,'" height="',e.height||e.height,o,'"',m,`></image>
|
||
|
`),this.stroke||this.strokeDashArray){var C=this.fill;this.fill=null,t=[" <rect ",'x="',i,'" y="',s,'" width="',this.width,'" height="',this.height,'" style="',this.getSvgStyles(),`"/>
|
||
|
`],this.fill=C}return this.paintFirst!=="fill"?d=d.concat(t,u):d=d.concat(u,t),d},getSrc:function(d){var u=d?this._element:this._originalElement;return u?u.toDataURL?u.toDataURL():this.srcFromAttribute?u.getAttribute("src"):u.src:this.src||""},setSrc:function(d,u,t){return c.util.loadImage(d,function(e,i){this.setElement(e,t),this._setWidthHeight(),u&&u(this,i)},this,t&&t.crossOrigin),this},toString:function(){return'#<fabric.Image: { src: "'+this.getSrc()+'" }>'},applyResizeFilters:function(){var d=this.resizeFilter,u=this.minimumScaleTrigger,t=this.getTotalObjectScaling(),e=t.scaleX,i=t.scaleY,s=this._filteredEl||this._originalElement;if(this.group&&this.set("dirty",!0),!d||e>u&&i>u){this._element=s,this._filterScalingX=1,this._filterScalingY=1,this._lastScaleX=e,this._lastScaleY=i;return}c.filterBackend||(c.filterBackend=c.initFilterBackend());var m=c.util.createCanvasElement(),o=this._filteredEl?this.cacheKey+"_filtered":this.cacheKey,y=s.width,C=s.height;m.width=y,m.height=C,this._element=m,this._lastScaleX=d.scaleX=e,this._lastScaleY=d.scaleY=i,c.filterBackend.applyFilters([d],s,y,C,this._element,o),this._filterScalingX=m.width/this._originalElement.width,this._filterScalingY=m.height/this._originalElement.height},applyFilters:function(d){if(d=d||this.filters||[],d=d.filter(function(s){return s&&!s.isNeutralState()}),this.set("dirty",!0),this.removeTexture(this.cacheKey+"_filtered"),d.length===0)return this._element=this._originalElement,this._filteredEl=null,this._filterScalingX=1,this._filterScalingY=1,this;var u=this._originalElement,t=u.naturalWidth||u.width,e=u.naturalHeight||u.height;if(this._element===this._originalElement){var i=c.util.createCanvasElement();i.width=t,i.height=e,this._element=i,this._filteredEl=i}else this._element=this._filteredEl,this._filteredEl.getContext("2d").clearRect(0,0,t,e),this._lastScaleX=1,this._lastScaleY=1;return c.filterBackend||(c.filterBackend=c.initFilterBackend()),c.filterBackend.applyFilters(d,this._originalElement,t,e,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(d){c.util.setImageSmoothing(d,this.imageSmoothing),this.isMoving!==!0&&this.resizeFilter&&this._needsResize()&&this.applyResizeFilters(),this._stroke(d),this._renderPaintInOrder(d)},drawCacheOnCanvas:function(d){c.util.setImageSmoothing(d,this.imageSmoothing),c.Object.prototype.drawCacheOnCanvas.call(this,d)},shouldCache:function(){return this.needsItsOwnCache()},_renderFill:function(d){var u=this._element;if(!!u){var t=this._filterScalingX,e=this._filterScalingY,i=this.width,s=this.height,m=Math.min,o=Math.max,y=o(this.cropX,0),C=o(this.cropY,0),b=u.naturalWidth||u.width,E=u.naturalHeight||u.height,O=y*t,L=C*e,N=m(i*t,b-O),B=m(s*e,E-L),Y=-i/2,nt=-s/2,it=m(i,b/t-y),Mt=m(s,E/e-C);u&&d.drawImage(u,O,L,N,B,Y,nt,it,Mt)}},_needsResize:function(){var d=this.getTotalObjectScaling();return d.scaleX!==this._lastScaleX||d.scaleY!==this._lastScaleY},_resetWidthHeight:function(){this.set(this.getOriginalSize())},_initElement:function(d,u){this.setElement(c.util.getById(d),u),c.util.addClass(this.getElement(),c.Image.CSS_CANVAS)},_initConfig:function(d){d||(d={}),this.setOptions(d),this._setWidthHeight(d)},_initFilters:function(d,u){d&&d.length?c.util.enlivenObjects(d,function(t){u&&u(t)},"fabric.Image.filters"):u&&u()},_setWidthHeight:function(d){d||(d={});var u=this.getElement();this.width=d.width||u.naturalWidth||u.width||0,this.height=d.height||u.naturalHeight||u.height||0},parsePreserveAspectRatioAttribute:function(){var d=c.util.parsePreserveAspectRatioAttribute(this.preserveAspectRatio||""),u=this._element.width,t=this._element.height,e=1,i=1,s=0,m=0,o=0,y=0,C,b=this.width,E=this.height,O={width:b,height:E};return d&&(d.alignX!=="none"||d.alignY!=="none")?(d.meetOrSlice==="meet"&&(e=i=c.util.findScaleToFit(this._element,O),C=(b-u*e)/2,d.alignX==="Min"&&(s=-C),d.align
|
||
|
void main(){}`,e=d.createShader(d.FRAGMENT_SHADER);return d.shaderSource(e,t),d.compileShader(e),!!d.getShaderParameter(e,d.COMPILE_STATUS)}c.isWebglSupported=function(d){if(c.isLikelyNode)return!1;d=d||c.WebglFilterBackend.prototype.tileSize;var u=document.createElement("canvas"),t=u.getContext("webgl")||u.getContext("experimental-webgl"),e=!1;if(t){c.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),e=c.maxTextureSize>=d;for(var i=["highp","mediump","lowp"],s=0;s<3;s++)if(p(t,i[s])){c.webGlPrecision=i[s];break}}return this.isSupported=e,e},c.WebglFilterBackend=a;function a(d){d&&d.tileSize&&(this.tileSize=d.tileSize),this.setupGLContext(this.tileSize,this.tileSize),this.captureGPUInfo()}a.prototype={tileSize:2048,resources:{},setupGLContext:function(d,u){this.dispose(),this.createWebGLCanvas(d,u),this.aPosition=new Float32Array([0,0,0,1,1,0,1,1]),this.chooseFastestCopyGLTo2DMethod(d,u)},chooseFastestCopyGLTo2DMethod:function(d,u){var t=typeof window.performance!="undefined",e;try{new ImageData(1,1),e=!0}catch(O){e=!1}var i=typeof ArrayBuffer!="undefined",s=typeof Uint8ClampedArray!="undefined";if(!!(t&&e&&i&&s)){var m=c.util.createCanvasElement(),o=new ArrayBuffer(d*u*4);if(c.forceGLPutImageData){this.imageBuffer=o,this.copyGLTo2D=j;return}var y={imageBuffer:o,destinationWidth:d,destinationHeight:u,targetCanvas:m},C,b,E;m.width=d,m.height=u,C=window.performance.now(),P.call(y,this.gl,y),b=window.performance.now()-C,C=window.performance.now(),j.call(y,this.gl,y),E=window.performance.now()-C,b>E?(this.imageBuffer=o,this.copyGLTo2D=j):this.copyGLTo2D=P}},createWebGLCanvas:function(d,u){var t=c.util.createCanvasElement();t.width=d,t.height=u;var e={alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,antialias:!1},i=t.getContext("webgl",e);i||(i=t.getContext("experimental-webgl",e)),!!i&&(i.clearColor(0,0,0,0),this.canvas=t,this.gl=i)},applyFilters:function(d,u,t,e,i,s){var m=this.gl,o;s&&(o=this.getCachedTexture(s,u));var y={originalWidth:u.width||u.originalWidth,originalHeight:u.height||u.originalHeight,sourceWidth:t,sourceHeight:e,destinationWidth:t,destinationHeight:e,context:m,sourceTexture:this.createTexture(m,t,e,!o&&u),targetTexture:this.createTexture(m,t,e),originalTexture:o||this.createTexture(m,t,e,!o&&u),passes:d.length,webgl:!0,aPosition:this.aPosition,programCache:this.programCache,pass:0,filterBackend:this,targetCanvas:i},C=m.createFramebuffer();return m.bindFramebuffer(m.FRAMEBUFFER,C),d.forEach(function(b){b&&b.applyTo(y)}),D(y),this.copyGLTo2D(m,y),m.bindTexture(m.TEXTURE_2D,null),m.deleteTexture(y.sourceTexture),m.deleteTexture(y.targetTexture),m.deleteFramebuffer(C),i.getContext("2d").setTransform(1,0,0,1,0,0),y},dispose:function(){this.canvas&&(this.canvas=null,this.gl=null),this.clearWebGLCaches()},clearWebGLCaches:function(){this.programCache={},this.textureCache={}},createTexture:function(d,u,t,e){var i=d.createTexture();return d.bindTexture(d.TEXTURE_2D,i),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,d.NEAREST),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,d.NEAREST),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),e?d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,e):d.texImage2D(d.TEXTURE_2D,0,d.RGBA,u,t,0,d.RGBA,d.UNSIGNED_BYTE,null),i},getCachedTexture:function(d,u){if(this.textureCache[d])return this.textureCache[d];var t=this.createTexture(this.gl,u.width,u.height,u);return this.textureCache[d]=t,t},evictCachesForKey:function(d){this.textureCache[d]&&(this.gl.deleteTexture(this.textureCache[d]),delete this.textureCache[d])},copyGLTo2D:P,captureGPUInfo:function(){if(this.gpuInfo)return this.gpuInfo;var d=this.gl,u={renderer:"",vendor:""};if(!d)return u;var t=d.getExtension("WEBGL_debug_renderer_info");if(t){var e=d.getParameter(t.UNMASKED_RENDERER_WEBGL),i=d.getParameter(t.UNMASKED_VENDOR_WEBGL);e&&(u.renderer=e.toLowerCase()),i&&(u.vendor=i.toLowerCase())}return this.gpuInfo=u,u}}}();function D(p){var a=p.targetCanvas,d=a.width,u=a.height,t=p.destinationWidth,e=p.destinationHeight;(d!==t||u!==e)&&(a.
|
||
|
varying vec2 vTexCoord;
|
||
|
void main() {
|
||
|
vTexCoord = aPosition;
|
||
|
gl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);
|
||
|
}`,fragmentSource:`precision highp float;
|
||
|
varying vec2 vTexCoord;
|
||
|
uniform sampler2D uTexture;
|
||
|
void main() {
|
||
|
gl_FragColor = texture2D(uTexture, vTexCoord);
|
||
|
}`,initialize:function(p){p&&this.setOptions(p)},setOptions:function(p){for(var a in p)this[a]=p[a]},createProgram:function(p,a,d){a=a||this.fragmentSource,d=d||this.vertexSource,c.webGlPrecision!=="highp"&&(a=a.replace(/precision highp float/g,"precision "+c.webGlPrecision+" float"));var u=p.createShader(p.VERTEX_SHADER);if(p.shaderSource(u,d),p.compileShader(u),!p.getShaderParameter(u,p.COMPILE_STATUS))throw new Error("Vertex shader compile error for "+this.type+": "+p.getShaderInfoLog(u));var t=p.createShader(p.FRAGMENT_SHADER);if(p.shaderSource(t,a),p.compileShader(t),!p.getShaderParameter(t,p.COMPILE_STATUS))throw new Error("Fragment shader compile error for "+this.type+": "+p.getShaderInfoLog(t));var e=p.createProgram();if(p.attachShader(e,u),p.attachShader(e,t),p.linkProgram(e),!p.getProgramParameter(e,p.LINK_STATUS))throw new Error('Shader link error for "${this.type}" '+p.getProgramInfoLog(e));var i=this.getAttributeLocations(p,e),s=this.getUniformLocations(p,e)||{};return s.uStepW=p.getUniformLocation(e,"uStepW"),s.uStepH=p.getUniformLocation(e,"uStepH"),{program:e,attributeLocations:i,uniformLocations:s}},getAttributeLocations:function(p,a){return{aPosition:p.getAttribLocation(a,"aPosition")}},getUniformLocations:function(){return{}},sendAttributeData:function(p,a,d){var u=a.aPosition,t=p.createBuffer();p.bindBuffer(p.ARRAY_BUFFER,t),p.enableVertexAttribArray(u),p.vertexAttribPointer(u,2,p.FLOAT,!1,0,0),p.bufferData(p.ARRAY_BUFFER,d,p.STATIC_DRAW)},_setupFrameBuffer:function(p){var a=p.context,d,u;p.passes>1?(d=p.destinationWidth,u=p.destinationHeight,(p.sourceWidth!==d||p.sourceHeight!==u)&&(a.deleteTexture(p.targetTexture),p.targetTexture=p.filterBackend.createTexture(a,d,u)),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,p.targetTexture,0)):(a.bindFramebuffer(a.FRAMEBUFFER,null),a.finish())},_swapTextures:function(p){p.passes--,p.pass++;var a=p.targetTexture;p.targetTexture=p.sourceTexture,p.sourceTexture=a},isNeutralState:function(){var p=this.mainParameter,a=c.Image.filters[this.type].prototype;if(p)if(Array.isArray(a[p])){for(var d=a[p].length;d--;)if(this[p][d]!==a[p][d])return!1;return!0}else return a[p]===this[p];else return!1},applyTo:function(p){p.webgl?(this._setupFrameBuffer(p),this.applyToWebGL(p),this._swapTextures(p)):this.applyTo2d(p)},retrieveShader:function(p){return p.programCache.hasOwnProperty(this.type)||(p.programCache[this.type]=this.createProgram(p.context)),p.programCache[this.type]},applyToWebGL:function(p){var a=p.context,d=this.retrieveShader(p);p.pass===0&&p.originalTexture?a.bindTexture(a.TEXTURE_2D,p.originalTexture):a.bindTexture(a.TEXTURE_2D,p.sourceTexture),a.useProgram(d.program),this.sendAttributeData(a,d.attributeLocations,p.aPosition),a.uniform1f(d.uniformLocations.uStepW,1/p.sourceWidth),a.uniform1f(d.uniformLocations.uStepH,1/p.sourceHeight),this.sendUniformData(a,d.uniformLocations),a.viewport(0,0,p.destinationWidth,p.destinationHeight),a.drawArrays(a.TRIANGLE_STRIP,0,4)},bindAdditionalTexture:function(p,a,d){p.activeTexture(d),p.bindTexture(p.TEXTURE_2D,a),p.activeTexture(p.TEXTURE0)},unbindAdditionalTexture:function(p,a){p.activeTexture(a),p.bindTexture(p.TEXTURE_2D,null),p.activeTexture(p.TEXTURE0)},getMainParameter:function(){return this[this.mainParameter]},setMainParameter:function(p){this[this.mainParameter]=p},sendUniformData:function(){},createHelpLayer:function(p){if(!p.helpLayer){var a=document.createElement("canvas");a.width=p.sourceWidth,a.height=p.sourceHeight,p.helpLayer=a}},toObject:function(){var p={type:this.type},a=this.mainParameter;return a&&(p[a]=this[a]),p},toJSON:function(){return this.toObject()}}),c.Image.filters.BaseFilter.fromObject=function(p,a){var d=new c.Image.filters[p.type](p);return a&&a(d),d},function(p){"use strict";var a=p.fabric||(p.fabric={}),d=a.Image.filters,u=a.util.createClass;d.ColorMatrix=u(d.BaseFilter,{type:"ColorMatrix",fragmentSource:`precision highp float;
|
||
|
uniform sampler2D uTexture;
|
||
|
varying vec2 vTexCoord;
|
||
|
uniform mat4 uColorMatrix;
|
||
|
uniform vec4 uConstants;
|
||
|
void main() {
|
||
|
vec4 color = texture2D(uTexture, vTexCoord);
|
||
|
color *= uColorMatrix;
|
||
|
color += uConstants;
|
||
|
gl_FragColor = color;
|
||
|
}`,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=t.imageData,i=e.data,s=i.length,m=this.matrix,o,y,C,b,E,O=this.colorsOnly;for(E=0;E<s;E+=4)o=i[E],y=i[E+1],C=i[E+2],O?(i[E]=o*m[0]+y*m[1]+C*m[2]+m[4]*255,i[E+1]=o*m[5]+y*m[6]+C*m[7]+m[9]*255,i[E+2]=o*m[10]+y*m[11]+C*m[12]+m[14]*255):(b=i[E+3],i[E]=o*m[0]+y*m[1]+C*m[2]+b*m[3]+m[4]*255,i[E+1]=o*m[5]+y*m[6]+C*m[7]+b*m[8]+m[9]*255,i[E+2]=o*m[10]+y*m[11]+C*m[12]+b*m[13]+m[14]*255,i[E+3]=o*m[15]+y*m[16]+C*m[17]+b*m[18]+m[19]*255)},getUniformLocations:function(t,e){return{uColorMatrix:t.getUniformLocation(e,"uColorMatrix"),uConstants:t.getUniformLocation(e,"uConstants")}},sendUniformData:function(t,e){var i=this.matrix,s=[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]],m=[i[4],i[9],i[14],i[19]];t.uniformMatrix4fv(e.uColorMatrix,!1,s),t.uniform4fv(e.uConstants,m)}}),a.Image.filters.ColorMatrix.fromObject=a.Image.filters.BaseFilter.fromObject}(x),function(p){"use strict";var a=p.fabric||(p.fabric={}),d=a.Image.filters,u=a.util.createClass;d.Brightness=u(d.BaseFilter,{type:"Brightness",fragmentSource:`precision highp float;
|
||
|
uniform sampler2D uTexture;
|
||
|
uniform float uBrightness;
|
||
|
varying vec2 vTexCoord;
|
||
|
void main() {
|
||
|
vec4 color = texture2D(uTexture, vTexCoord);
|
||
|
color.rgb += uBrightness;
|
||
|
gl_FragColor = color;
|
||
|
}`,brightness:0,mainParameter:"brightness",applyTo2d:function(t){if(this.brightness!==0){var e=t.imageData,i=e.data,s,m=i.length,o=Math.round(this.brightness*255);for(s=0;s<m;s+=4)i[s]=i[s]+o,i[s+1]=i[s+1]+o,i[s+2]=i[s+2]+o}},getUniformLocations:function(t,e){return{uBrightness:t.getUniformLocation(e,"uBrightness")}},sendUniformData:function(t,e){t.uniform1f(e.uBrightness,this.brightness)}}),a.Image.filters.Brightness.fromObject=a.Image.filters.BaseFilter.fromObject}(x),function(p){"use strict";var a=p.fabric||(p.fabric={}),d=a.util.object.extend,u=a.Image.filters,t=a.util.createClass;u.Convolute=t(u.BaseFilter,{type:"Convolute",opaque:!1,matrix:[0,0,0,0,1,0,0,0,0],fragmentSource:{Convolute_3_1:`precision highp float;
|
||
|
uniform sampler2D uTexture;
|
||
|
uniform float uMatrix[9];
|
||
|
uniform float uStepW;
|
||
|
uniform float uStepH;
|
||
|
varying vec2 vTexCoord;
|
||
|
void main() {
|
||
|
vec4 color = vec4(0, 0, 0, 0);
|
||
|
for (float h = 0.0; h < 3.0; h+=1.0) {
|
||
|
for (float w = 0.0; w < 3.0; w+=1.0) {
|
||
|
vec2 matrixPos = vec2(uStepW * (w - 1), uStepH * (h - 1));
|
||
|
color += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 3.0 + w)];
|
||
|
}
|
||
|
}
|
||
|
gl_FragColor = color;
|
||
|
}`,Convolute_3_0:`precision highp float;
|
||
|
uniform sampler2D uTexture;
|
||
|
uniform float uMatrix[9];
|
||
|
uniform float uStepW;
|
||
|
uniform float uStepH;
|
||
|
varying vec2 vTexCoord;
|
||
|
void main() {
|
||
|
vec4 color = vec4(0, 0, 0, 1);
|
||
|
for (float h = 0.0; h < 3.0; h+=1.0) {
|
||
|
for (float w = 0.0; w < 3.0; w+=1.0) {
|
||
|
vec2 matrixPos = vec2(uStepW * (w - 1.0), uStepH * (h - 1.0));
|
||
|
color.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 3.0 + w)];
|
||
|
}
|
||
|
}
|
||
|
float alpha = texture2D(uTexture, vTexCoord).a;
|
||
|
gl_FragColor = color;
|
||
|
gl_FragColor.a = alpha;
|
||
|
}`,Convolute_5_1:`precision highp float;
|
||
|
uniform sampler2D uTexture;
|
||
|
uniform float uMatrix[25];
|
||
|
uniform float uStepW;
|
||
|
uniform float uStepH;
|
||
|
varying vec2 vTexCoord;
|
||
|
void main() {
|
||
|
vec4 color = vec4(0, 0, 0, 0);
|
||
|
for (float h = 0.0; h < 5.0; h+=1.0) {
|
||
|
for (float w = 0.0; w < 5.0; w+=1.0) {
|
||
|
vec2 matrixPos = vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));
|
||
|
color += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 5.0 + w)];
|
||
|
}
|
||
|
}
|
||
|
gl_FragColor = color;
|
||
|
}`,Convolute_5_0:`precision highp float;
|
||
|
uniform sampler2D uTexture;
|
||
|
uniform float uMatrix[25];
|
||
|
uniform float uStepW;
|
||
|
uniform float uStepH;
|
||
|
varying vec2 vTexCoord;
|
||
|
void main() {
|
||
|
vec4 color = vec4(0, 0, 0, 1);
|
||
|
for (float h = 0.0; h < 5.0; h+=1.0) {
|
||
|
for (float w = 0.0; w < 5.0; w+=1.0) {
|
||
|
vec2 matrixPos = vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));
|
||
|
color.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 5.0 + w)];
|
||
|
}
|
||
|
}
|
||
|
float alpha = texture2D(uTexture, vTexCoord).a;
|
||
|
gl_FragColor = color;
|
||
|
gl_FragColor.a = alpha;
|
||
|
}`,Convolute_7_1:`precision highp float;
|
||
|
uniform sampler2D uTexture;
|
||
|
uniform float uMatrix[49];
|
||
|
uniform float uStepW;
|
||
|
uniform float uStepH;
|
||
|
varying vec2 vTexCoord;
|
||
|
void main() {
|
||
|
vec4 color = vec4(0, 0, 0, 0);
|
||
|
for (float h = 0.0; h < 7.0; h+=1.0) {
|
||
|
for (float w = 0.0; w < 7.0; w+=1.0) {
|
||
|
vec2 matrixPos = vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));
|
||
|
color += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 7.0 + w)];
|
||
|
}
|
||
|
}
|
||
|
gl_FragColor = color;
|
||
|
}`,Convolute_7_0:`precision highp float;
|
||
|
uniform sampler2D uTexture;
|
||
|
uniform float uMatrix[49];
|
||
|
uniform float uStepW;
|
||
|
uniform float uStepH;
|
||
|
varying vec2 vTexCoord;
|
||
|
void main() {
|
||
|
vec4 color = vec4(0, 0, 0, 1);
|
||
|
for (float h = 0.0; h < 7.0; h+=1.0) {
|
||
|
for (float w = 0.0; w < 7.0; w+=1.0) {
|
||
|
vec2 matrixPos = vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));
|
||
|
color.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 7.0 + w)];
|
||
|
}
|
||
|
}
|
||
|
float alpha = texture2D(uTexture, vTexCoord).a;
|
||
|
gl_FragColor = color;
|
||
|
gl_FragColor.a = alpha;
|
||
|
}`,Convolute_9_1:`precision highp float;
|
||
|
uniform sampler2D uTexture;
|
||
|
uniform float uMatrix[81];
|
||
|
uniform float uStepW;
|
||
|
uniform float uStepH;
|
||
|
varying vec2 vTexCoord;
|
||
|
void main() {
|
||
|
vec4 color = vec4(0, 0, 0, 0);
|
||
|
for (float h = 0.0; h < 9.0; h+=1.0) {
|
||
|
for (float w = 0.0; w < 9.0; w+=1.0) {
|
||
|
vec2 matrixPos = vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));
|
||
|
color += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 9.0 + w)];
|
||
|
}
|
||
|
}
|
||
|
gl_FragColor = color;
|
||
|
}`,Convolute_9_0:`precision highp float;
|
||
|
uniform sampler2D uTexture;
|
||
|
uniform float uMatrix[81];
|
||
|
uniform float uStepW;
|
||
|
uniform float uStepH;
|
||
|
varying vec2 vTexCoord;
|
||
|
void main() {
|
||
|
vec4 color = vec4(0, 0, 0, 1);
|
||
|
for (float h = 0.0; h < 9.0; h+=1.0) {
|
||
|
for (float w = 0.0; w < 9.0; w+=1.0) {
|
||
|
vec2 matrixPos = vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));
|
||
|
color.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 9.0 + w)];
|
||
|
}
|
||
|
}
|
||
|
float alpha = texture2D(uTexture, vTexCoord).a;
|
||
|
gl_FragColor = color;
|
||
|
gl_FragColor.a = alpha;
|
||
|
}`},retrieveShader:function(e){var i=Math.sqrt(this.matrix.length),s=this.type+"_"+i+"_"+(this.opaque?1:0),m=this.fragmentSource[s];return e.programCache.hasOwnProperty(s)||(e.programCache[s]=this.createProgram(e.context,m)),e.programCache[s]},applyTo2d:function(e){var i=e.imageData,s=i.data,m=this.matrix,o=Math.round(Math.sqrt(m.length)),y=Math.floor(o/2),C=i.width,b=i.height,E=e.ctx.createImageData(C,b),O=E.data,L=this.opaque?1:0,N,B,Y,nt,it,Mt,K,It,U,Lt,dt,Nt,V;for(dt=0;dt<b;dt++)for(Lt=0;Lt<C;Lt++){for(it=(dt*C+Lt)*4,N=0,B=0,Y=0,nt=0,V=0;V<o;V++)for(Nt=0;Nt<o;Nt++)K=dt+V-y,Mt=Lt+Nt-y,!(K<0||K>=b||Mt<0||Mt>=C)&&(It=(K*C+Mt)*4,U=m[V*o+Nt],N+=s[It]*U,B+=s[It+1]*U,Y+=s[It+2]*U,L||(nt+=s[It+3]*U));O[it]=N,O[it+1]=B,O[it+2]=Y,L?O[it+3]=s[it+3]:O[it+3]=nt}e.imageData=E},getUniformLocations:function(e,i){return{uMatrix:e.getUniformLocation(i,"uMatrix"),uOpaque:e.getUniformLocation(i,"uOpaque"),uHalfSize:e.getUniformLocation(i,"uHalfSize"),uSize:e.getUniformLocation(i,"uSize")}},sendUniformData:function(e,i){e.uniform1fv(i.uMatrix,this.matrix)},toObject:function(){return d(this.callSuper("toObject"),{opaque:this.opaque,matrix:this.matrix})}}),a.Image.filters.Convolute.fromObject=a.Image.filters.BaseFilter.fromObject}(x),function(p){"use strict";var a=p.fabric||(p.fabric={}),d=a.Image.filters,u=a.util.createClass;d.Grayscale=u(d.BaseFilter,{type:"Grayscale",fragmentSource:{average:`precision highp float;
|
||
|
uniform sampler2D uTexture;
|
||
|
varying vec2 vTexCoord;
|
||
|
void main() {
|
||
|
vec4 color = texture2D(uTexture, vTexCoord);
|
||
|
float average = (color.r + color.b + color.g) / 3.0;
|
||
|
gl_FragColor = vec4(average, average, average, color.a);
|
||
|
}`,lightness:`precision highp float;
|
||
|
uniform sampler2D uTexture;
|
||
|
uniform int uMode;
|
||
|
varying vec2 vTexCoord;
|
||
|
void main() {
|
||
|
vec4 col = texture2D(uTexture, vTexCoord);
|
||
|
float average = (max(max(col.r, col.g),col.b) + min(min(col.r, col.g),col.b)) / 2.0;
|
||
|
gl_FragColor = vec4(average, average, average, col.a);
|
||
|
}`,luminosity:`precision highp float;
|
||
|
uniform sampler2D uTexture;
|
||
|
uniform int uMode;
|
||
|
varying vec2 vTexCoord;
|
||
|
void main() {
|
||
|
vec4 col = texture2D(uTexture, vTexCoord);
|
||
|
float average = 0.21 * col.r + 0.72 * col.g + 0.07 * col.b;
|
||
|
gl_FragColor = vec4(average, average, average, col.a);
|
||
|
}`},mode:"average",mainParameter:"mode",applyTo2d:function(t){var e=t.imageData,i=e.data,s,m=i.length,o,y=this.mode;for(s=0;s<m;s+=4)y==="average"?o=(i[s]+i[s+1]+i[s+2])/3:y==="lightness"?o=(Math.min(i[s],i[s+1],i[s+2])+Math.max(i[s],i[s+1],i[s+2]))/2:y==="luminosity"&&(o=.21*i[s]+.72*i[s+1]+.07*i[s+2]),i[s]=o,i[s+1]=o,i[s+2]=o},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}}),a.Image.filters.Grayscale.fromObject=a.Image.filters.BaseFilter.fromObject}(x),function(p){"use strict";var a=p.fabric||(p.fabric={}),d=a.Image.filters,u=a.util.createClass;d.Invert=u(d.BaseFilter,{type:"Invert",fragmentSource:`precision highp float;
|
||
|
uniform sampler2D uTexture;
|
||
|
uniform int uInvert;
|
||
|
varying vec2 vTexCoord;
|
||
|
void main() {
|
||
|
vec4 color = texture2D(uTexture, vTexCoord);
|
||
|
if (uInvert == 1) {
|
||
|
gl_FragColor = vec4(1.0 - color.r,1.0 -color.g,1.0 -color.b,color.a);
|
||
|
} else {
|
||
|
gl_FragColor = color;
|
||
|
}
|
||
|
}`,invert:!0,mainParameter:"invert",applyTo2d:function(t){var e=t.imageData,i=e.data,s,m=i.length;for(s=0;s<m;s+=4)i[s]=255-i[s],i[s+1]=255-i[s+1],i[s+2]=255-i[s+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)}}),a.Image.filters.Invert.fromObject=a.Image.filters.BaseFilter.fromObject}(x),function(p){"use strict";var a=p.fabric||(p.fabric={}),d=a.util.object.extend,u=a.Image.filters,t=a.util.createClass;u.Noise=t(u.BaseFilter,{type:"Noise",fragmentSource:`precision highp float;
|
||
|
uniform sampler2D uTexture;
|
||
|
uniform float uStepH;
|
||
|
uniform float uNoise;
|
||
|
uniform float uSeed;
|
||
|
varying vec2 vTexCoord;
|
||
|
float rand(vec2 co, float seed, float vScale) {
|
||
|
return fract(sin(dot(co.xy * vScale ,vec2(12.9898 , 78.233))) * 43758.5453 * (seed + 0.01) / 2.0);
|
||
|
}
|
||
|
void main() {
|
||
|
vec4 color = texture2D(uTexture, vTexCoord);
|
||
|
color.rgb += (0.5 - rand(vTexCoord, uSeed, 0.1 / uStepH)) * uNoise;
|
||
|
gl_FragColor = color;
|
||
|
}`,mainParameter:"noise",noise:0,applyTo2d:function(e){if(this.noise!==0){var i=e.imageData,s=i.data,m,o=s.length,y=this.noise,C;for(m=0,o=s.length;m<o;m+=4)C=(.5-Math.random())*y,s[m]+=C,s[m+1]+=C,s[m+2]+=C}},getUniformLocations:function(e,i){return{uNoise:e.getUniformLocation(i,"uNoise"),uSeed:e.getUniformLocation(i,"uSeed")}},sendUniformData:function(e,i){e.uniform1f(i.uNoise,this.noise/255),e.uniform1f(i.uSeed,Math.random())},toObject:function(){return d(this.callSuper("toObject"),{noise:this.noise})}}),a.Image.filters.Noise.fromObject=a.Image.filters.BaseFilter.fromObject}(x),function(p){"use strict";var a=p.fabric||(p.fabric={}),d=a.Image.filters,u=a.util.createClass;d.Pixelate=u(d.BaseFilter,{type:"Pixelate",blocksize:4,mainParameter:"blocksize",fragmentSource:`precision highp float;
|
||
|
uniform sampler2D uTexture;
|
||
|
uniform float uBlocksize;
|
||
|
uniform float uStepW;
|
||
|
uniform float uStepH;
|
||
|
varying vec2 vTexCoord;
|
||
|
void main() {
|
||
|
float blockW = uBlocksize * uStepW;
|
||
|
float blockH = uBlocksize * uStepW;
|
||
|
int posX = int(vTexCoord.x / blockW);
|
||
|
int posY = int(vTexCoord.y / blockH);
|
||
|
float fposX = float(posX);
|
||
|
float fposY = float(posY);
|
||
|
vec2 squareCoords = vec2(fposX * blockW, fposY * blockH);
|
||
|
vec4 color = texture2D(uTexture, squareCoords);
|
||
|
gl_FragColor = color;
|
||
|
}`,applyTo2d:function(t){var e=t.imageData,i=e.data,s=e.height,m=e.width,o,y,C,b,E,O,L,N,B,Y,nt;for(y=0;y<s;y+=this.blocksize)for(C=0;C<m;C+=this.blocksize)for(o=y*4*m+C*4,b=i[o],E=i[o+1],O=i[o+2],L=i[o+3],Y=Math.min(y+this.blocksize,s),nt=Math.min(C+this.blocksize,m),N=y;N<Y;N++)for(B=C;B<nt;B++)o=N*4*m+B*4,i[o]=b,i[o+1]=E,i[o+2]=O,i[o+3]=L},isNeutralState:function(){return this.blocksize===1},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)}}),a.Image.filters.Pixelate.fromObject=a.Image.filters.BaseFilter.fromObject}(x),function(p){"use strict";var a=p.fabric||(p.fabric={}),d=a.util.object.extend,u=a.Image.filters,t=a.util.createClass;u.RemoveColor=t(u.BaseFilter,{type:"RemoveColor",color:"#FFFFFF",fragmentSource:`precision highp float;
|
||
|
uniform sampler2D uTexture;
|
||
|
uniform vec4 uLow;
|
||
|
uniform vec4 uHigh;
|
||
|
varying vec2 vTexCoord;
|
||
|
void main() {
|
||
|
gl_FragColor = texture2D(uTexture, vTexCoord);
|
||
|
if(all(greaterThan(gl_FragColor.rgb,uLow.rgb)) && all(greaterThan(uHigh.rgb,gl_FragColor.rgb))) {
|
||
|
gl_FragColor.a = 0.0;
|
||
|
}
|
||
|
}`,distance:.02,useAlpha:!1,applyTo2d:function(e){var i=e.imageData,s=i.data,m,o=this.distance*255,y,C,b,E=new a.Color(this.color).getSource(),O=[E[0]-o,E[1]-o,E[2]-o],L=[E[0]+o,E[1]+o,E[2]+o];for(m=0;m<s.length;m+=4)y=s[m],C=s[m+1],b=s[m+2],y>O[0]&&C>O[1]&&b>O[2]&&y<L[0]&&C<L[1]&&b<L[2]&&(s[m+3]=0)},getUniformLocations:function(e,i){return{uLow:e.getUniformLocation(i,"uLow"),uHigh:e.getUniformLocation(i,"uHigh")}},sendUniformData:function(e,i){var s=new a.Color(this.color).getSource(),m=parseFloat(this.distance),o=[0+s[0]/255-m,0+s[1]/255-m,0+s[2]/255-m,1],y=[s[0]/255+m,s[1]/255+m,s[2]/255+m,1];e.uniform4fv(i.uLow,o),e.uniform4fv(i.uHigh,y)},toObject:function(){return d(this.callSuper("toObject"),{color:this.color,distance:this.distance})}}),a.Image.filters.RemoveColor.fromObject=a.Image.filters.BaseFilter.fromObject}(x),function(p){"use strict";var a=p.fabric||(p.fabric={}),d=a.Image.filters,u=a.util.createClass,t={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 e in t)d[e]=u(d.ColorMatrix,{type:e,matrix:t[e],mainParameter:!1,colorsOnly:!0}),a.Image.filters[e].fromObject=a.Image.filters.BaseFilter.fromObject}(x),function(p){"use strict";var a=p.fabric,d=a.Image.filters,u=a.util.createClass;d.BlendColor=u(d.BaseFilter,{type:"BlendColor",color:"#F95C63",mode:"multiply",alpha:1,fragmentSource:{multiply:`gl_FragColor.rgb *= uColor.rgb;
|
||
|
`,screen:`gl_FragColor.rgb = 1.0 - (1.0 - gl_FragColor.rgb) * (1.0 - uColor.rgb);
|
||
|
`,add:`gl_FragColor.rgb += uColor.rgb;
|
||
|
`,diff:`gl_FragColor.rgb = abs(gl_FragColor.rgb - uColor.rgb);
|
||
|
`,subtract:`gl_FragColor.rgb -= uColor.rgb;
|
||
|
`,lighten:`gl_FragColor.rgb = max(gl_FragColor.rgb, uColor.rgb);
|
||
|
`,darken:`gl_FragColor.rgb = min(gl_FragColor.rgb, uColor.rgb);
|
||
|
`,exclusion:`gl_FragColor.rgb += uColor.rgb - 2.0 * (uColor.rgb * gl_FragColor.rgb);
|
||
|
`,overlay:`if (uColor.r < 0.5) {
|
||
|
gl_FragColor.r *= 2.0 * uColor.r;
|
||
|
} else {
|
||
|
gl_FragColor.r = 1.0 - 2.0 * (1.0 - gl_FragColor.r) * (1.0 - uColor.r);
|
||
|
}
|
||
|
if (uColor.g < 0.5) {
|
||
|
gl_FragColor.g *= 2.0 * uColor.g;
|
||
|
} else {
|
||
|
gl_FragColor.g = 1.0 - 2.0 * (1.0 - gl_FragColor.g) * (1.0 - uColor.g);
|
||
|
}
|
||
|
if (uColor.b < 0.5) {
|
||
|
gl_FragColor.b *= 2.0 * uColor.b;
|
||
|
} else {
|
||
|
gl_FragColor.b = 1.0 - 2.0 * (1.0 - gl_FragColor.b) * (1.0 - uColor.b);
|
||
|
}
|
||
|
`,tint:`gl_FragColor.rgb *= (1.0 - uColor.a);
|
||
|
gl_FragColor.rgb += uColor.rgb;
|
||
|
`},buildSource:function(t){return`precision highp float;
|
||
|
uniform sampler2D uTexture;
|
||
|
uniform vec4 uColor;
|
||
|
varying vec2 vTexCoord;
|
||
|
void main() {
|
||
|
vec4 color = texture2D(uTexture, vTexCoord);
|
||
|
gl_FragColor = color;
|
||
|
if (color.a > 0.0) {
|
||
|
`+this.fragmentSource[t]+`}
|
||
|
}`},retrieveShader:function(t){var e=this.type+"_"+this.mode,i;return t.programCache.hasOwnProperty(e)||(i=this.buildSource(this.mode),t.programCache[e]=this.createProgram(t.context,i)),t.programCache[e]},applyTo2d:function(t){var e=t.imageData,i=e.data,s=i.length,m,o,y,C,b,E,O,L=1-this.alpha;O=new a.Color(this.color).getSource(),m=O[0]*this.alpha,o=O[1]*this.alpha,y=O[2]*this.alpha;for(var N=0;N<s;N+=4)switch(C=i[N],b=i[N+1],E=i[N+2],this.mode){case"multiply":i[N]=C*m/255,i[N+1]=b*o/255,i[N+2]=E*y/255;break;case"screen":i[N]=255-(255-C)*(255-m)/255,i[N+1]=255-(255-b)*(255-o)/255,i[N+2]=255-(255-E)*(255-y)/255;break;case"add":i[N]=C+m,i[N+1]=b+o,i[N+2]=E+y;break;case"diff":case"difference":i[N]=Math.abs(C-m),i[N+1]=Math.abs(b-o),i[N+2]=Math.abs(E-y);break;case"subtract":i[N]=C-m,i[N+1]=b-o,i[N+2]=E-y;break;case"darken":i[N]=Math.min(C,m),i[N+1]=Math.min(b,o),i[N+2]=Math.min(E,y);break;case"lighten":i[N]=Math.max(C,m),i[N+1]=Math.max(b,o),i[N+2]=Math.max(E,y);break;case"overlay":i[N]=m<128?2*C*m/255:255-2*(255-C)*(255-m)/255,i[N+1]=o<128?2*b*o/255:255-2*(255-b)*(255-o)/255,i[N+2]=y<128?2*E*y/255:255-2*(255-E)*(255-y)/255;break;case"exclusion":i[N]=m+C-2*m*C/255,i[N+1]=o+b-2*o*b/255,i[N+2]=y+E-2*y*E/255;break;case"tint":i[N]=m+C*L,i[N+1]=o+b*L,i[N+2]=y+E*L}},getUniformLocations:function(t,e){return{uColor:t.getUniformLocation(e,"uColor")}},sendUniformData:function(t,e){var i=new a.Color(this.color).getSource();i[0]=this.alpha*i[0]/255,i[1]=this.alpha*i[1]/255,i[2]=this.alpha*i[2]/255,i[3]=this.alpha,t.uniform4fv(e.uColor,i)},toObject:function(){return{type:this.type,color:this.color,mode:this.mode,alpha:this.alpha}}}),a.Image.filters.BlendColor.fromObject=a.Image.filters.BaseFilter.fromObject}(x),function(p){"use strict";var a=p.fabric,d=a.Image.filters,u=a.util.createClass;d.BlendImage=u(d.BaseFilter,{type:"BlendImage",image:null,mode:"multiply",alpha:1,vertexSource:`attribute vec2 aPosition;
|
||
|
varying vec2 vTexCoord;
|
||
|
varying vec2 vTexCoord2;
|
||
|
uniform mat3 uTransformMatrix;
|
||
|
void main() {
|
||
|
vTexCoord = aPosition;
|
||
|
vTexCoord2 = (uTransformMatrix * vec3(aPosition, 1.0)).xy;
|
||
|
gl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);
|
||
|
}`,fragmentSource:{multiply:`precision highp float;
|
||
|
uniform sampler2D uTexture;
|
||
|
uniform sampler2D uImage;
|
||
|
uniform vec4 uColor;
|
||
|
varying vec2 vTexCoord;
|
||
|
varying vec2 vTexCoord2;
|
||
|
void main() {
|
||
|
vec4 color = texture2D(uTexture, vTexCoord);
|
||
|
vec4 color2 = texture2D(uImage, vTexCoord2);
|
||
|
color.rgba *= color2.rgba;
|
||
|
gl_FragColor = color;
|
||
|
}`,mask:`precision highp float;
|
||
|
uniform sampler2D uTexture;
|
||
|
uniform sampler2D uImage;
|
||
|
uniform vec4 uColor;
|
||
|
varying vec2 vTexCoord;
|
||
|
varying vec2 vTexCoord2;
|
||
|
void main() {
|
||
|
vec4 color = texture2D(uTexture, vTexCoord);
|
||
|
vec4 color2 = texture2D(uImage, vTexCoord2);
|
||
|
color.a = color2.a;
|
||
|
gl_FragColor = color;
|
||
|
}`},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 e=t.imageData,i=t.filterBackend.resources,s=e.data,m=s.length,o=e.width,y=e.height,C,b,E,O,L,N,B,Y,nt,it,Mt=this.image,K;i.blendImage||(i.blendImage=a.util.createCanvasElement()),nt=i.blendImage,it=nt.getContext("2d"),nt.width!==o||nt.height!==y?(nt.width=o,nt.height=y):it.clearRect(0,0,o,y),it.setTransform(Mt.scaleX,0,0,Mt.scaleY,Mt.left,Mt.top),it.drawImage(Mt._element,0,0,o,y),K=it.getImageData(0,0,o,y).data;for(var It=0;It<m;It+=4)switch(L=s[It],N=s[It+1],B=s[It+2],Y=s[It+3],C=K[It],b=K[It+1],E=K[It+2],O=K[It+3],this.mode){case"multiply":s[It]=L*C/255,s[It+1]=N*b/255,s[It+2]=B*E/255,s[It+3]=Y*O/255;break;case"mask":s[It+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}}}),a.Image.filters.BlendImage.fromObject=function(t,e){a.Image.fromObject(t.image,function(i){var s=a.util.object.clone(t);s.image=i,e(new a.Image.filters.BlendImage(s))})}}(x),function(p){"use strict";var a=p.fabric||(p.fabric={}),d=Math.pow,u=Math.floor,t=Math.sqrt,e=Math.abs,i=Math.round,s=Math.sin,m=Math.ceil,o=a.Image.filters,y=a.util.createClass;o.Resize=y(o.BaseFilter,{type:"Resize",resizeType:"hermite",scaleX:1,scaleY:1,lanczosLobes:3,getUniformLocations:function(C,b){return{uDelta:C.getUniformLocation(b,"uDelta"),uTaps:C.getUniformLocation(b,"uTaps")}},sendUniformData:function(C,b){C.uniform2fv(b.uDelta,this.horizontal?[1/this.width,0]:[0,1/this.height]),C.uniform1fv(b.uTaps,this.taps)},retrieveShader:function(C){var b=this.getFilterWindow(),E=this.type+"_"+b;if(!C.programCache.hasOwnProperty(E)){var O=this.generateShader(b);C.programCache[E]=this.createProgram(C.context,O)}return C.programCache[E]},getFilterWindow:function(){var C=this.tempScale;return Math.ceil(this.lanczosLobes/C)},getTaps:function(){for(var C=this.lanczosCreate(this.lanczosLobes),b=this.tempScale,E=this.getFilterWindow(),O=new Array(E),L=1;L<=E;L++)O[L-1]=C(L*b);return O},generateShader:function(C){for(var b=new Array(C),E=this.fragmentSourceTOP,C,O=1;O<=C;O++)b[O-1]=O+".0 * uDelta";return E+="uniform float uTaps["+C+`];
|
||
|
`,E+=`void main() {
|
||
|
`,E+=` vec4 color = texture2D(uTexture, vTexCoord);
|
||
|
`,E+=` float sum = 1.0;
|
||
|
`,b.forEach(function(L,N){E+=" color += texture2D(uTexture, vTexCoord + "+L+") * uTaps["+N+`];
|
||
|
`,E+=" color += texture2D(uTexture, vTexCoord - "+L+") * uTaps["+N+`];
|
||
|
`,E+=" sum += 2.0 * uTaps["+N+`];
|
||
|
`}),E+=` gl_FragColor = color / sum;
|
||
|
`,E+="}",E},fragmentSourceTOP:`precision highp float;
|
||
|
uniform sampler2D uTexture;
|
||
|
uniform vec2 uDelta;
|
||
|
varying vec2 vTexCoord;
|
||
|
`,applyTo:function(C){C.webgl?(C.passes++,this.width=C.sourceWidth,this.horizontal=!0,this.dW=Math.round(this.width*this.scaleX),this.dH=C.sourceHeight,this.tempScale=this.dW/this.width,this.taps=this.getTaps(),C.destinationWidth=this.dW,this._setupFrameBuffer(C),this.applyToWebGL(C),this._swapTextures(C),C.sourceWidth=C.destinationWidth,this.height=C.sourceHeight,this.horizontal=!1,this.dH=Math.round(this.height*this.scaleY),this.tempScale=this.dH/this.height,this.taps=this.getTaps(),C.destinationHeight=this.dH,this._setupFrameBuffer(C),this.applyToWebGL(C),this._swapTextures(C),C.sourceHeight=C.destinationHeight):this.applyTo2d(C)},isNeutralState:function(){return this.scaleX===1&&this.scaleY===1},lanczosCreate:function(C){return function(b){if(b>=C||b<=-C)return 0;if(b<11920929e-14&&b>-11920929e-14)return 1;b*=Math.PI;var E=b/C;return s(b)/b*s(E)/E}},applyTo2d:function(C){var b=C.imageData,E=this.scaleX,O=this.scaleY;this.rcpScaleX=1/E,this.rcpScaleY=1/O;var L=b.width,N=b.height,B=i(L*E),Y=i(N*O),nt;this.resizeType==="sliceHack"?nt=this.sliceByTwo(C,L,N,B,Y):this.resizeType==="hermite"?nt=this.hermiteFastResize(C,L,N,B,Y):this.resizeType==="bilinear"?nt=this.bilinearFiltering(C,L,N,B,Y):this.resizeType==="lanczos"&&(nt=this.lanczosResize(C,L,N,B,Y)),C.imageData=nt},sliceByTwo:function(C,b,E,O,L){var N=C.imageData,B=.5,Y=!1,nt=!1,it=b*B,Mt=E*B,K=a.filterBackend.resources,It,U,Lt=0,dt=0,Nt=b,V=0;for(K.sliceByTwo||(K.sliceByTwo=document.createElement("canvas")),It=K.sliceByTwo,(It.width<b*1.5||It.height<E)&&(It.width=b*1.5,It.height=E),U=It.getContext("2d"),U.clearRect(0,0,b*1.5,E),U.putImageData(N,0,0),O=u(O),L=u(L);!Y||!nt;)b=it,E=Mt,O<u(it*B)?it=u(it*B):(it=O,Y=!0),L<u(Mt*B)?Mt=u(Mt*B):(Mt=L,nt=!0),U.drawImage(It,Lt,dt,b,E,Nt,V,it,Mt),Lt=Nt,dt=V,V+=Mt;return U.getImageData(Lt,dt,O,L)},lanczosResize:function(C,b,E,O,L){function N(Q){var G,rt,F,W,X,Z,gt,ht,bt,Tt,xt;for(V.x=(Q+.5)*Mt,q.x=u(V.x),G=0;G<L;G++){for(V.y=(G+.5)*K,q.y=u(V.y),X=0,Z=0,gt=0,ht=0,bt=0,rt=q.x-Lt;rt<=q.x+Lt;rt++)if(!(rt<0||rt>=b)){Tt=u(1e3*e(rt-V.x)),Nt[Tt]||(Nt[Tt]={});for(var at=q.y-dt;at<=q.y+dt;at++)at<0||at>=E||(xt=u(1e3*e(at-V.y)),Nt[Tt][xt]||(Nt[Tt][xt]=it(t(d(Tt*It,2)+d(xt*U,2))/1e3)),F=Nt[Tt][xt],F>0&&(W=(at*b+rt)*4,X+=F,Z+=F*B[W],gt+=F*B[W+1],ht+=F*B[W+2],bt+=F*B[W+3]))}W=(G*O+Q)*4,nt[W]=Z/X,nt[W+1]=gt/X,nt[W+2]=ht/X,nt[W+3]=bt/X}return++Q<O?N(Q):Y}var B=C.imageData.data,Y=C.ctx.createImageData(O,L),nt=Y.data,it=this.lanczosCreate(this.lanczosLobes),Mt=this.rcpScaleX,K=this.rcpScaleY,It=2/this.rcpScaleX,U=2/this.rcpScaleY,Lt=m(Mt*this.lanczosLobes/2),dt=m(K*this.lanczosLobes/2),Nt={},V={},q={};return N(0)},bilinearFiltering:function(C,b,E,O,L){var N,B,Y,nt,it,Mt,K,It,U,Lt,dt,Nt,V=0,q,Q=this.rcpScaleX,G=this.rcpScaleY,rt=4*(b-1),F=C.imageData,W=F.data,X=C.ctx.createImageData(O,L),Z=X.data;for(K=0;K<L;K++)for(It=0;It<O;It++)for(it=u(Q*It),Mt=u(G*K),U=Q*It-it,Lt=G*K-Mt,q=4*(Mt*b+it),dt=0;dt<4;dt++)N=W[q+dt],B=W[q+4+dt],Y=W[q+rt+dt],nt=W[q+rt+4+dt],Nt=N*(1-U)*(1-Lt)+B*U*(1-Lt)+Y*Lt*(1-U)+nt*U*Lt,Z[V++]=Nt;return X},hermiteFastResize:function(C,b,E,O,L){for(var N=this.rcpScaleX,B=this.rcpScaleY,Y=m(N/2),nt=m(B/2),it=C.imageData,Mt=it.data,K=C.ctx.createImageData(O,L),It=K.data,U=0;U<L;U++)for(var Lt=0;Lt<O;Lt++){for(var dt=(Lt+U*O)*4,Nt=0,V=0,q=0,Q=0,G=0,rt=0,F=0,W=(U+.5)*B,X=u(U*B);X<(U+1)*B;X++)for(var Z=e(W-(X+.5))/nt,gt=(Lt+.5)*N,ht=Z*Z,bt=u(Lt*N);bt<(Lt+1)*N;bt++){var Tt=e(gt-(bt+.5))/Y,xt=t(ht+Tt*Tt);xt>1&&xt<-1||(Nt=2*xt*xt*xt-3*xt*xt+1,Nt>0&&(Tt=4*(bt+X*b),F+=Nt*Mt[Tt+3],q+=Nt,Mt[Tt+3]<255&&(Nt=Nt*Mt[Tt+3]/250),Q+=Nt*Mt[Tt],G+=Nt*Mt[Tt+1],rt+=Nt*Mt[Tt+2],V+=Nt))}It[dt]=Q/V,It[dt+1]=G/V,It[dt+2]=rt/V,It[dt+3]=F/q}return K},toObject:function(){return{type:this.type,scaleX:this.scaleX,scaleY:this.scaleY,resizeType:this.resizeType,lanczosLobes:this.lanczosLobes}}}),a.Image.filters.Resize.fromObject=a.Image.filters.BaseFilter.fromObject}(x),function(p){"use strict";var a=p.fabric||(p.fabric={}),d=a.Image.filters,u=a.util.createClass;d.Contrast=u(d.BaseFilter,{type:"Contrast",fragmentSource:`precision highp float;
|
||
|
uniform sampler2D uTexture;
|
||
|
uniform float uContrast;
|
||
|
varying vec2 vTexCoord;
|
||
|
void main() {
|
||
|
vec4 color = texture2D(uTexture, vTexCoord);
|
||
|
float contrastF = 1.015 * (uContrast + 1.0) / (1.0 * (1.015 - uContrast));
|
||
|
color.rgb = contrastF * (color.rgb - 0.5) + 0.5;
|
||
|
gl_FragColor = color;
|
||
|
}`,contrast:0,mainParameter:"contrast",applyTo2d:function(t){if(this.contrast!==0){var e=t.imageData,i,s,m=e.data,s=m.length,o=Math.floor(this.contrast*255),y=259*(o+255)/(255*(259-o));for(i=0;i<s;i+=4)m[i]=y*(m[i]-128)+128,m[i+1]=y*(m[i+1]-128)+128,m[i+2]=y*(m[i+2]-128)+128}},getUniformLocations:function(t,e){return{uContrast:t.getUniformLocation(e,"uContrast")}},sendUniformData:function(t,e){t.uniform1f(e.uContrast,this.contrast)}}),a.Image.filters.Contrast.fromObject=a.Image.filters.BaseFilter.fromObject}(x),function(p){"use strict";var a=p.fabric||(p.fabric={}),d=a.Image.filters,u=a.util.createClass;d.Saturation=u(d.BaseFilter,{type:"Saturation",fragmentSource:`precision highp float;
|
||
|
uniform sampler2D uTexture;
|
||
|
uniform float uSaturation;
|
||
|
varying vec2 vTexCoord;
|
||
|
void main() {
|
||
|
vec4 color = texture2D(uTexture, vTexCoord);
|
||
|
float rgMax = max(color.r, color.g);
|
||
|
float rgbMax = max(rgMax, color.b);
|
||
|
color.r += rgbMax != color.r ? (rgbMax - color.r) * uSaturation : 0.00;
|
||
|
color.g += rgbMax != color.g ? (rgbMax - color.g) * uSaturation : 0.00;
|
||
|
color.b += rgbMax != color.b ? (rgbMax - color.b) * uSaturation : 0.00;
|
||
|
gl_FragColor = color;
|
||
|
}`,saturation:0,mainParameter:"saturation",applyTo2d:function(t){if(this.saturation!==0){var e=t.imageData,i=e.data,s=i.length,m=-this.saturation,o,y;for(o=0;o<s;o+=4)y=Math.max(i[o],i[o+1],i[o+2]),i[o]+=y!==i[o]?(y-i[o])*m:0,i[o+1]+=y!==i[o+1]?(y-i[o+1])*m:0,i[o+2]+=y!==i[o+2]?(y-i[o+2])*m:0}},getUniformLocations:function(t,e){return{uSaturation:t.getUniformLocation(e,"uSaturation")}},sendUniformData:function(t,e){t.uniform1f(e.uSaturation,-this.saturation)}}),a.Image.filters.Saturation.fromObject=a.Image.filters.BaseFilter.fromObject}(x),function(p){"use strict";var a=p.fabric||(p.fabric={}),d=a.Image.filters,u=a.util.createClass;d.Vibrance=u(d.BaseFilter,{type:"Vibrance",fragmentSource:`precision highp float;
|
||
|
uniform sampler2D uTexture;
|
||
|
uniform float uVibrance;
|
||
|
varying vec2 vTexCoord;
|
||
|
void main() {
|
||
|
vec4 color = texture2D(uTexture, vTexCoord);
|
||
|
float max = max(color.r, max(color.g, color.b));
|
||
|
float avg = (color.r + color.g + color.b) / 3.0;
|
||
|
float amt = (abs(max - avg) * 2.0) * uVibrance;
|
||
|
color.r += max != color.r ? (max - color.r) * amt : 0.00;
|
||
|
color.g += max != color.g ? (max - color.g) * amt : 0.00;
|
||
|
color.b += max != color.b ? (max - color.b) * amt : 0.00;
|
||
|
gl_FragColor = color;
|
||
|
}`,vibrance:0,mainParameter:"vibrance",applyTo2d:function(t){if(this.vibrance!==0){var e=t.imageData,i=e.data,s=i.length,m=-this.vibrance,o,y,C,b;for(o=0;o<s;o+=4)y=Math.max(i[o],i[o+1],i[o+2]),C=(i[o]+i[o+1]+i[o+2])/3,b=Math.abs(y-C)*2/255*m,i[o]+=y!==i[o]?(y-i[o])*b:0,i[o+1]+=y!==i[o+1]?(y-i[o+1])*b:0,i[o+2]+=y!==i[o+2]?(y-i[o+2])*b:0}},getUniformLocations:function(t,e){return{uVibrance:t.getUniformLocation(e,"uVibrance")}},sendUniformData:function(t,e){t.uniform1f(e.uVibrance,-this.vibrance)}}),a.Image.filters.Vibrance.fromObject=a.Image.filters.BaseFilter.fromObject}(x),function(p){"use strict";var a=p.fabric||(p.fabric={}),d=a.Image.filters,u=a.util.createClass;d.Blur=u(d.BaseFilter,{type:"Blur",fragmentSource:`precision highp float;
|
||
|
uniform sampler2D uTexture;
|
||
|
uniform vec2 uDelta;
|
||
|
varying vec2 vTexCoord;
|
||
|
const float nSamples = 15.0;
|
||
|
vec3 v3offset = vec3(12.9898, 78.233, 151.7182);
|
||
|
float random(vec3 scale) {
|
||
|
return fract(sin(dot(gl_FragCoord.xyz, scale)) * 43758.5453);
|
||
|
}
|
||
|
void main() {
|
||
|
vec4 color = vec4(0.0);
|
||
|
float total = 0.0;
|
||
|
float offset = random(v3offset);
|
||
|
for (float t = -nSamples; t <= nSamples; t++) {
|
||
|
float percent = (t + offset - 0.5) / nSamples;
|
||
|
float weight = 1.0 - abs(percent);
|
||
|
color += texture2D(uTexture, vTexCoord + uDelta * percent) * weight;
|
||
|
total += weight;
|
||
|
}
|
||
|
gl_FragColor = color / total;
|
||
|
}`,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 e=t.filterBackend.resources,i,s,m=t.imageData.width,o=t.imageData.height;e.blurLayer1||(e.blurLayer1=a.util.createCanvasElement(),e.blurLayer2=a.util.createCanvasElement()),i=e.blurLayer1,s=e.blurLayer2,(i.width!==m||i.height!==o)&&(s.width=i.width=m,s.height=i.height=o);var y=i.getContext("2d"),C=s.getContext("2d"),b=15,E,O,L,N,B=this.blur*.06*.5;for(y.putImageData(t.imageData,0,0),C.clearRect(0,0,m,o),N=-b;N<=b;N++)E=(Math.random()-.5)/4,O=N/b,L=B*O*m+E,C.globalAlpha=1-Math.abs(O),C.drawImage(i,L,E),y.drawImage(s,0,0),C.globalAlpha=1,C.clearRect(0,0,s.width,s.height);for(N=-b;N<=b;N++)E=(Math.random()-.5)/4,O=N/b,L=B*O*o+E,C.globalAlpha=1-Math.abs(O),C.drawImage(i,E,L),y.drawImage(s,0,0),C.globalAlpha=1,C.clearRect(0,0,s.width,s.height);t.ctx.drawImage(i,0,0);var Y=t.ctx.getImageData(0,0,i.width,i.height);return y.globalAlpha=1,y.clearRect(0,0,i.width,i.height),Y},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=1,e=[0,0],i;return this.horizontal?this.aspectRatio>1&&(t=1/this.aspectRatio):this.aspectRatio<1&&(t=this.aspectRatio),i=t*this.blur*.12,this.horizontal?e[0]=i:e[1]=i,e}}),d.Blur.fromObject=a.Image.filters.BaseFilter.fromObject}(x),function(p){"use strict";var a=p.fabric||(p.fabric={}),d=a.Image.filters,u=a.util.createClass;d.Gamma=u(d.BaseFilter,{type:"Gamma",fragmentSource:`precision highp float;
|
||
|
uniform sampler2D uTexture;
|
||
|
uniform vec3 uGamma;
|
||
|
varying vec2 vTexCoord;
|
||
|
void main() {
|
||
|
vec4 color = texture2D(uTexture, vTexCoord);
|
||
|
vec3 correction = (1.0 / uGamma);
|
||
|
color.r = pow(color.r, correction.r);
|
||
|
color.g = pow(color.g, correction.g);
|
||
|
color.b = pow(color.b, correction.b);
|
||
|
gl_FragColor = color;
|
||
|
gl_FragColor.rgb *= color.a;
|
||
|
}`,gamma:[1,1,1],mainParameter:"gamma",initialize:function(t){this.gamma=[1,1,1],d.BaseFilter.prototype.initialize.call(this,t)},applyTo2d:function(t){var e=t.imageData,i=e.data,s=this.gamma,m=i.length,o=1/s[0],y=1/s[1],C=1/s[2],b;for(this.rVals||(this.rVals=new Uint8Array(256),this.gVals=new Uint8Array(256),this.bVals=new Uint8Array(256)),b=0,m=256;b<m;b++)this.rVals[b]=Math.pow(b/255,o)*255,this.gVals[b]=Math.pow(b/255,y)*255,this.bVals[b]=Math.pow(b/255,C)*255;for(b=0,m=i.length;b<m;b+=4)i[b]=this.rVals[i[b]],i[b+1]=this.gVals[i[b+1]],i[b+2]=this.bVals[i[b+2]]},getUniformLocations:function(t,e){return{uGamma:t.getUniformLocation(e,"uGamma")}},sendUniformData:function(t,e){t.uniform3fv(e.uGamma,this.gamma)}}),a.Image.filters.Gamma.fromObject=a.Image.filters.BaseFilter.fromObject}(x),function(p){"use strict";var a=p.fabric||(p.fabric={}),d=a.Image.filters,u=a.util.createClass;d.Composed=u(d.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 a.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()})}}),a.Image.filters.Composed.fromObject=function(t,e){var i=t.subFilters||[],s=i.map(function(o){return new a.Image.filters[o.type](o)}),m=new a.Image.filters.Composed({subFilters:s});return e&&e(m),m}}(x),function(p){"use strict";var a=p.fabric||(p.fabric={}),d=a.Image.filters,u=a.util.createClass;d.HueRotation=u(d.ColorMatrix,{type:"HueRotation",rotation:0,mainParameter:"rotation",calculateMatrix:function(){var t=this.rotation*Math.PI,e=a.util.cos(t),i=a.util.sin(t),s=1/3,m=Math.sqrt(s)*i,o=1-e;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]=e+o/3,this.matrix[1]=s*o-m,this.matrix[2]=s*o+m,this.matrix[5]=s*o+m,this.matrix[6]=e+s*o,this.matrix[7]=s*o-m,this.matrix[10]=s*o-m,this.matrix[11]=s*o+m,this.matrix[12]=e+s*o},isNeutralState:function(t){return this.calculateMatrix(),d.BaseFilter.prototype.isNeutralState.call(this,t)},applyTo:function(t){this.calculateMatrix(),d.BaseFilter.prototype.applyTo.call(this,t)}}),a.Image.filters.HueRotation.fromObject=a.Image.filters.BaseFilter.fromObject}(x),function(p){"use strict";var a=p.fabric||(p.fabric={}),d=a.util.object.clone;if(a.Text){a.warn("fabric.Text is already defined");return}var u="fontFamily fontWeight fontSize text underline overline linethrough textAlign fontStyle lineHeight textBackgroundColor charSpacing styles direction path pathStartOffset pathSide".split(" ");a.Text=a.util.createClass(a.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:a.Object.prototype.stateProperties.concat(u),cacheProperties:a.Object.prototype.cacheProperties.concat(u),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
|
||
|
`],m=[],o=0;o<e.length;o++)i[o]=a.util.string.graphemeSplit(e[o]),m=m.concat(i[o],s);return m.pop(),{_unwrappedLines:i,lines:e,graphemeText:m,graphemeLines:i}},toObject:function(t){var e=u.concat(t),i=this.callSuper("toObject",e);return i.styles=d(this.styles,!0),i.path&&(i.path=this.path.toObject()),i},set:function(t,e){this.callSuper("set",t,e);var i=!1,s=!1;if(typeof t=="object")for(var m in t)m==="path"&&this.setPathInfo(),i=i||this._dimensionAffectingProps.indexOf(m)!==-1,s=s||m==="path";else i=this._dimensionAffectingProps.indexOf(t)!==-1,s=t==="path";return s&&this.setPathInfo(),i&&(this.initDimensions(),this.setCoords()),this},complexity:function(){return 1}}),a.Text.ATTRIBUTE_NAMES=a.SHARED_ATTRIBUTES.concat("x y dx dy font-family font-style font-weight font-size letter-spacing text-decoration text-anchor".split(" ")),a.Text.DEFAULT_SVG_FONT_SIZE=16,a.Text.fromElement=function(t,e,i){if(!t)return e(null);var s=a.parseAttributes(t,a.Text.ATTRIBUTE_NAMES),m=s.textAnchor||"left";if(i=a.util.object.extend(i?d(i):{},s),i.top=i.top||0,i.left=i.left||0,s.textDecoration){var o=s.textDecoration;o.indexOf("underline")!==-1&&(i.underline=!0),o.indexOf("overline")!==-1&&(i.overline=!0),o.indexOf("line-through")!==-1&&(i.linethrough=!0),delete i.textDecoration}"dx"in s&&(i.left+=s.dx),"dy"in s&&(i.top+=s.dy),"fontSize"in i||(i.fontSize=a.Text.DEFAULT_SVG_FONT_SIZE);var y="";"textContent"in t?y=t.textContent:"firstChild"in t&&t.firstChild!==null&&"data"in t.firstChild&&t.firstChild.data!==null&&(y=t.firstChild.data),y=y.replace(/^\s+|\s+$|\n+/g,"").replace(/\s+/g," ");var C=i.strokeWidth;i.strokeWidth=0;var b=new a.Text(y,i),E=b.getScaledHeight()/b.height,O=(b.height+b.strokeWidth)*b.lineHeight-b.height,L=O*E,N=b.getScaledHeight()+L,B=0;m==="center"&&(B=b.getScaledWidth()/2),m==="right"&&(B=b.getScaledWidth()),b.set({left:b.left-B,top:b.top-(N-b.fontSize*(.07+b._fontSizeFraction))/b.lineHeight,strokeWidth:typeof C!="undefined"?C:1}),e(b)},a.Text.fromObject=function(t,e){var i=d(t),s=t.path;return delete i.path,a.Object._fromObject("Text",i,function(m){s?a.Object._fromObject("Path",s,function(o){m.set("path",o),e(m)},"path"):e(m)},"text")},a.Text.genericFonts=["sans-serif","serif","cursive","fantasy","monospace"],a.util.createAccessors&&a.util.createAccessors(a.Text)}(x),function(){c.util.object.extend(c.Text.prototype,{isEmptyStyles:function(p){if(!this.styles||typeof p!="undefined"&&!this.styles[p])return!0;var a=typeof p=="undefined"?this.styles:{line:this.styles[p]};for(var d in a)for(var u in a[d])for(var t in a[d][u])return!1;return!0},styleHas:function(p,a){if(!this.styles||!p||p===""||typeof a!="undefined"&&!this.styles[a])return!1;var d=typeof a=="undefined"?this.styles:{0:this.styles[a]};for(var u in d)for(var t in d[u])if(typeof d[u][t][p]!="undefined")return!0;return!1},cleanStyle:function(p){if(!this.styles||!p||p==="")return!1;var a=this.styles,d=0,u,t,e=!0,i=0,s;for(var m in a){u=0;for(var o in a[m]){var s=a[m][o],y=s.hasOwnProperty(p);d++,y?(t?s[p]!==t&&(e=!1):t=s[p],s[p]===this[p]&&delete s[p]):e=!1,Object.keys(s).length!==0?u++:delete a[m][o]}u===0&&delete a[m]}for(var C=0;C<this._textLines.length;C++)i+=this._textLines[C].length;e&&d===i&&(this[p]=t,this.removeStyle(p))},removeStyle:function(p){if(!(!this.styles||!p||p==="")){var a=this.styles,d,u,t;for(u in a){d=a[u];for(t in d)delete d[t][p],Object.keys(d[t]).length===0&&delete d[t];Object.keys(d).length===0&&delete a[u]}}},_extendStyles:function(p,a){var d=this.get2DCursorLocation(p);this._getLineStyle(d.lineIndex)||this._setLineStyle(d.lineIndex),this._getStyleDeclaration(d.lineIndex,d.charIndex)||this._setStyleDeclaration(d.lineIndex,d.charIndex,{}),c.util.object.extend(this._getStyleDeclaration(d.lineIndex,d.charIndex),a)},get2DCursorLocation:function(p,a){typeof p=="undefined"&&(p=this.selectionStart);for(var d=a?this._unwrappedTextLines:this._textLines,u=d.length,t=0;t<u;t++){if(p<=d[t].length)return{lineIndex:t,charIndex:p};p-=d[t].length+this.missingNewlineOffset(t)}return{lineIndex:t-1,charIndex:d[t-1].length<p?d[t-1].length:p}},getSelectionStyle
|
||
|
`?(i++,e[i]=0):e[i]++;e[0]>0&&(this.insertCharStyleObject(t.lineIndex,t.charIndex,e[0],u),u=u&&u.slice(e[0]+1)),i&&this.insertNewlineStyleObject(t.lineIndex,t.charIndex+e[0],i);for(var s=1;s<i;s++)e[s]>0?this.insertCharStyleObject(t.lineIndex+s,0,e[s],u):u&&(this.styles[t.lineIndex+s][0]=u[0]),u=u&&u.slice(e[s]+1);e[s]>0&&this.insertCharStyleObject(t.lineIndex+s,0,e[s],u)},setSelectionStartEndWithShift:function(a,d,u){u<=a?(d===a?this._selectionDirection="left":this._selectionDirection==="right"&&(this._selectionDirection="left",this.selectionEnd=a),this.selectionStart=u):u>a&&u<d?this._selectionDirection==="right"?this.selectionEnd=u:this.selectionStart=u:(d===a?this._selectionDirection="right":this._selectionDirection==="left"&&(this._selectionDirection="right",this.selectionStart=d),this.selectionEnd=u)},setSelectionInBoundaries:function(){var a=this.text.length;this.selectionStart>a?this.selectionStart=a:this.selectionStart<0&&(this.selectionStart=0),this.selectionEnd>a?this.selectionEnd=a:this.selectionEnd<0&&(this.selectionEnd=0)}})}(),c.util.object.extend(c.IText.prototype,{initDoubleClickSimulation:function(){this.__lastClickTime=+new Date,this.__lastLastClickTime=+new Date,this.__lastPointer={},this.on("mousedown",this.onMouseDown)},onMouseDown:function(p){if(!!this.canvas){this.__newClickTime=+new Date;var a=p.pointer;this.isTripleClick(a)&&(this.fire("tripleclick",p),this._stopEvent(p.e)),this.__lastLastClickTime=this.__lastClickTime,this.__lastClickTime=this.__newClickTime,this.__lastPointer=a,this.__lastIsEditing=this.isEditing,this.__lastSelected=this.selected}},isTripleClick:function(p){return this.__newClickTime-this.__lastClickTime<500&&this.__lastClickTime-this.__lastLastClickTime<500&&this.__lastPointer.x===p.x&&this.__lastPointer.y===p.y},_stopEvent:function(p){p.preventDefault&&p.preventDefault(),p.stopPropagation&&p.stopPropagation()},initCursorSelectionHandlers:function(){this.initMousedownHandler(),this.initMouseupHandler(),this.initClicks()},doubleClickHandler:function(p){!this.isEditing||this.selectWord(this.getSelectionStartFromPointer(p.e))},tripleClickHandler:function(p){!this.isEditing||this.selectLine(this.getSelectionStartFromPointer(p.e))},initClicks:function(){this.on("mousedblclick",this.doubleClickHandler),this.on("tripleclick",this.tripleClickHandler)},_mouseDownHandler:function(p){!this.canvas||!this.editable||p.e.button&&p.e.button!==1||(this.__isMousedown=!0,this.selected&&(this.inCompositionMode=!1,this.setCursorByClick(p.e)),this.isEditing&&(this.__selectionStartOnMouseDown=this.selectionStart,this.selectionStart===this.selectionEnd&&this.abortCursorAnimation(),this.renderCursorOrSelection()))},_mouseDownHandlerBefore:function(p){!this.canvas||!this.editable||p.e.button&&p.e.button!==1||(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(p){if(this.__isMousedown=!1,!(!this.editable||this.group||p.transform&&p.transform.actionPerformed||p.e.button&&p.e.button!==1)){if(this.canvas){var a=this.canvas._activeObject;if(a&&a!==this)return}this.__lastSelected&&!this.__corner?(this.selected=!1,this.__lastSelected=!1,this.enterEditing(p.e),this.selectionStart===this.selectionEnd?this.initDelayedCursor(!0):this.renderCursorOrSelection()):this.selected=!0}},setCursorByClick:function(p){var a=this.getSelectionStartFromPointer(p),d=this.selectionStart,u=this.selectionEnd;p.shiftKey?this.setSelectionStartEndWithShift(d,u,a):(this.selectionStart=a,this.selectionEnd=a),this.isEditing&&(this._fireSelectionChanged(),this._updateTextarea())},getSelectionStartFromPointer:function(p){for(var a=this.getLocalPointer(p),d=0,u=0,t=0,e=0,i=0,s,m,o=0,y=this._textLines.length;o<y&&t<=a.y;o++)t+=this.getHeightOfLine(o)*this.scaleY,i=o,o>0&&(e+=this._textLines[o-1].length+this.missingNewlineOffset(o-1));s=this._getLineLeftOffset(i),u=s*this.scaleX,m=this._textLines[i],this.direction==="
|
||
|
`]},_getSVGTextAndBg:function(d,u){var t=[],e=[],i=d,s;this._setSVGBg(e);for(var m=0,o=this._textLines.length;m<o;m++)s=this._getLineLeftOffset(m),(this.textBackgroundColor||this.styleHas("textBackgroundColor",m))&&this._setSVGTextLineBg(e,m,u+s,i),this._setSVGTextLineText(t,m,u+s,i),i+=this.getHeightOfLine(m);return{textSpans:t,textBgRects:e}},_createTextCharSpan:function(d,u,t,e){var i=d!==d.trim()||d.match(a),s=this.getSvgSpanStyles(u,i),m=s?'style="'+s+'"':"",o=u.deltaY,y="",C=c.Object.NUM_FRACTION_DIGITS;return o&&(y=' dy="'+p(o,C)+'" '),['<tspan x="',p(t,C),'" y="',p(e,C),'" ',y,m,">",c.util.string.escapeXml(d),"</tspan>"].join("")},_setSVGTextLineText:function(d,u,t,e){var i=this.getHeightOfLine(u),s=this.textAlign.indexOf("justify")!==-1,m,o,y="",C,b,E=0,O=this._textLines[u],L;e+=i*(1-this._fontSizeFraction)/this.lineHeight;for(var N=0,B=O.length-1;N<=B;N++)L=N===B||this.charSpacing,y+=O[N],C=this.__charBounds[u][N],E===0?(t+=C.kernedWidth-C.width,E+=C.width):E+=C.kernedWidth,s&&!L&&this._reSpaceAndTab.test(O[N])&&(L=!0),L||(m=m||this.getCompleteStyleDeclaration(u,N),o=this.getCompleteStyleDeclaration(u,N+1),L=this._hasStyleChangedForSvg(m,o)),L&&(b=this._getStyleDeclaration(u,N)||{},d.push(this._createTextCharSpan(y,b,t,e)),y="",m=o,t+=E,E=0)},_pushTextBgRect:function(d,u,t,e,i,s){var m=c.Object.NUM_FRACTION_DIGITS;d.push(" <rect ",this._getFillAttributes(u),' x="',p(t,m),'" y="',p(e,m),'" width="',p(i,m),'" height="',p(s,m),`"></rect>
|
||
|
`)},_setSVGTextLineBg:function(d,u,t,e){for(var i=this._textLines[u],s=this.getHeightOfLine(u)/this.lineHeight,m=0,o=0,y,C,b=this.getValueOfPropertyAt(u,0,"textBackgroundColor"),E=0,O=i.length;E<O;E++)y=this.__charBounds[u][E],C=this.getValueOfPropertyAt(u,E,"textBackgroundColor"),C!==b?(b&&this._pushTextBgRect(d,b,t+o,e,m,s),o=y.left,m=y.width,b=C):m+=y.kernedWidth;C&&this._pushTextBgRect(d,C,t+o,e,m,s)},_getFillAttributes:function(d){var u=d&&typeof d=="string"?new c.Color(d):"";return!u||!u.getSource()||u.getAlpha()===1?'fill="'+d+'"':'opacity="'+u.getAlpha()+'" fill="'+u.setAlpha(1).toRgb()+'"'},_getSVGLineTopOffset:function(d){for(var u=0,t=0,e=0;e<d;e++)u+=this.getHeightOfLine(e);return t=this.getHeightOfLine(e),{lineTop:u,offset:(this._fontSizeMult-this._fontSizeFraction)*t/(this.lineHeight*this._fontSizeMult)}},getSvgStyles:function(d){var u=c.Object.prototype.getSvgStyles.call(this,d);return u+" white-space: pre;"}})}(),function(p){"use strict";var a=p.fabric||(p.fabric={});a.Textbox=a.util.createClass(a.IText,a.Observable,{type:"textbox",minWidth:20,dynamicMinWidth:2,__cachedLines:null,lockScalingFlip:!0,noScaleCache:!1,_dimensionAffectingProps:a.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),this.textAlign.indexOf("justify")!==-1&&this.enlargeSpaces(),this.height=this.calcTextHeight(),this.saveState({propertySet:"_dimensionAffectingProps"}))},_generateStyleMap:function(d){for(var u=0,t=0,e=0,i={},s=0;s<d.graphemeLines.length;s++)d.graphemeText[e]===`
|
||
|
`&&s>0?(t=0,e++,u++):!this.splitByGrapheme&&this._reSpaceAndTab.test(d.graphemeText[e])&&s>0&&(t++,e++),i[s]={line:u,offset:t},e+=d.graphemeLines[s].length,t+=d.graphemeLines[s].length;return i},styleHas:function(d,u){if(this._styleMap&&!this.isWrapping){var t=this._styleMap[u];t&&(u=t.line)}return a.Text.prototype.styleHas.call(this,d,u)},isEmptyStyles:function(d){if(!this.styles)return!0;var u=0,t=d+1,e,i,s=!1,m=this._styleMap[d],o=this._styleMap[d+1];m&&(d=m.line,u=m.offset),o&&(t=o.line,s=t===d,e=o.offset),i=typeof d=="undefined"?this.styles:{line:this.styles[d]};for(var y in i)for(var C in i[y])if(C>=u&&(!s||C<e))for(var b in i[y][C])return!1;return!0},_getStyleDeclaration:function(d,u){if(this._styleMap&&!this.isWrapping){var t=this._styleMap[d];if(!t)return null;d=t.line,u=t.offset+u}return this.callSuper("_getStyleDeclaration",d,u)},_setStyleDeclaration:function(d,u,t){var e=this._styleMap[d];d=e.line,u=e.offset+u,this.styles[d][u]=t},_deleteStyleDeclaration:function(d,u){var t=this._styleMap[d];d=t.line,u=t.offset+u,delete this.styles[d][u]},_getLineStyle:function(d){var u=this._styleMap[d];return!!this.styles[u.line]},_setLineStyle:function(d){var u=this._styleMap[d];this.styles[u.line]={}},_wrapText:function(d,u){var t=[],e;for(this.isWrapping=!0,e=0;e<d.length;e++)t=t.concat(this._wrapLine(d[e],e,u));return this.isWrapping=!1,t},_measureWord:function(d,u,t){var e=0,i,s=!0;t=t||0;for(var m=0,o=d.length;m<o;m++){var y=this._getGraphemeBox(d[m],u,m+t,i,s);e+=y.kernedWidth,i=d[m]}return e},_wrapLine:function(d,u,t,e){var i=0,s=this.splitByGrapheme,m=[],o=[],y=s?a.util.string.graphemeSplit(d):d.split(this._wordJoiners),C="",b=0,E=s?"":" ",O=0,L=0,N=0,B=!0,Y=this._getWidthOfCharSpacing(),e=e||0;y.length===0&&y.push([]),t-=e;for(var nt=0;nt<y.length;nt++)C=s?y[nt]:a.util.string.graphemeSplit(y[nt]),O=this._measureWord(C,u,b),b+=C.length,i+=L+O-Y,i>t&&!B?(m.push(o),o=[],i=O,B=!0):i+=Y,!B&&!s&&o.push(E),o=o.concat(C),L=s?0:this._measureWord([E],u,b),b++,B=!1,O>N&&(N=O);return nt&&m.push(o),N+e>this.dynamicMinWidth&&(this.dynamicMinWidth=N-Y+e),m},isEndOfWrapping:function(d){return!this._styleMap[d+1]||this._styleMap[d+1].line!==this._styleMap[d].line},missingNewlineOffset:function(d){return this.splitByGrapheme?this.isEndOfWrapping(d)?1:0:1},_splitTextIntoLines:function(d){for(var u=a.Text.prototype._splitTextIntoLines.call(this,d),t=this._wrapText(u.lines,this.width),e=new Array(t.length),i=0;i<t.length;i++)e[i]=t[i].join("");return u.lines=e,u.graphemeLines=t,u},getMinWidth:function(){return Math.max(this.minWidth,this.dynamicMinWidth)},_removeExtraneousStyles:function(){var d={};for(var u in this._styleMap)this._textLines[u]&&(d[this._styleMap[u].line]=1);for(var u in this.styles)d[u]||delete this.styles[u]},toObject:function(d){return this.callSuper("toObject",["minWidth","splitByGrapheme"].concat(d))}}),a.Textbox.fromObject=function(d,u){return a.Object._fromObject("Textbox",d,u,"text")}}(x),function(){var p=c.controlsUtils,a=p.scaleSkewCursorStyleHandler,d=p.scaleCursorStyleHandler,u=p.scalingEqually,t=p.scalingYOrSkewingX,e=p.scalingXOrSkewingY,i=p.scaleOrSkewActionName,s=c.Object.prototype.controls;if(s.ml=new c.Control({x:-.5,y:0,cursorStyleHandler:a,actionHandler:e,getActionName:i}),s.mr=new c.Control({x:.5,y:0,cursorStyleHandler:a,actionHandler:e,getActionName:i}),s.mb=new c.Control({x:0,y:.5,cursorStyleHandler:a,actionHandler:t,getActionName:i}),s.mt=new c.Control({x:0,y:-.5,cursorStyleHandler:a,actionHandler:t,getActionName:i}),s.tl=new c.Control({x:-.5,y:-.5,cursorStyleHandler:d,actionHandler:u}),s.tr=new c.Control({x:.5,y:-.5,cursorStyleHandler:d,actionHandler:u}),s.bl=new c.Control({x:-.5,y:.5,cursorStyleHandler:d,actionHandler:u}),s.br=new c.Control({x:.5,y:.5,cursorStyleHandler:d,actionHandler:u}),s.mtr=new c.Control({x:0,y:-.5,actionHandler:p.rotationWithSnapping,cursorStyleHandler:p.rotationStyleHandler,offsetY:-40,withConnection:!0,actionName:"rotate"}),c.Textbox){var m=c.Textbox.prototype.controls={};m.mtr=s.mtr,m.tr=s.tr,m.br=s.br,m.tl=s.tl,m.bl=s.bl,m.mt=s.mt,m.mb=s.mb,m.mr=new c.Control({x:.5
|
||
|
\v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF`},4242:function(g,x,f){"use strict";var c=f(3085),I=f(9341),M=f(4469),D=f(2853),P=f(8711),j=f(774),p=f(273),a=f(3442),d=f(4845),u=function(e,i){var s=this,m=arguments.length>2?arguments[2]:void 0;if(!(s instanceof u))return new u(e,i,m);M&&(s=M(new Error(void 0),I(s))),i!==void 0&&P(s,"message",d(i)),p(s,m);var o=[];return a(e,o.push,{that:o}),P(s,"errors",o),s};u.prototype=D(Error.prototype,{constructor:j(5,u),message:j(5,""),name:j(5,"AggregateError")}),c({global:!0},{AggregateError:u})},9106:function(g,x,f){"use strict";var c=f(3085),I=f(6192),M=f(4770),D=f(5744),P=f(1795),j=f(4104),p=f(9361),a=f(1321),d=f(242),u=f(8182),t=f(4218),e=u("isConcatSpreadable"),i=9007199254740991,s="Maximum allowed index exceeded",m=t>=51||!I(function(){var b=[];return b[e]=!1,b.concat()[0]!==b}),o=d("concat"),y=function(b){if(!D(b))return!1;var E=b[e];return E!==void 0?!!E:M(b)},C=!m||!o;c({target:"Array",proto:!0,forced:C},{concat:function(E){var O=P(this),L=a(O,0),N=0,B,Y,nt,it,Mt;for(B=-1,nt=arguments.length;B<nt;B++)if(Mt=B===-1?O:arguments[B],y(Mt)){if(it=j(Mt),N+it>i)throw TypeError(s);for(Y=0;Y<it;Y++,N++)Y in Mt&&p(L,N,Mt[Y])}else{if(N>=i)throw TypeError(s);p(L,N++,Mt)}return L.length=N,L}})},1710:function(g,x,f){var c=f(3085),I=f(2724),M=f(7423);c({target:"Array",proto:!0},{fill:I}),M("fill")},3436:function(g,x,f){"use strict";var c=f(3085),I=f(454).filter,M=f(242),D=M("filter");c({target:"Array",proto:!0,forced:!D},{filter:function(j){return I(this,j,arguments.length>1?arguments[1]:void 0)}})},9823:function(g,x,f){"use strict";var c=f(3085),I=f(7397);c({target:"Array",proto:!0,forced:[].forEach!=I},{forEach:I})},9173:function(g,x,f){var c=f(3085),I=f(841),M=f(9770),D=!M(function(P){Array.from(P)});c({target:"Array",stat:!0,forced:D},{from:I})},2276:function(g,x,f){"use strict";var c=f(3085),I=f(8180).indexOf,M=f(424),D=[].indexOf,P=!!D&&1/[1].indexOf(1,-0)<0,j=M("indexOf");c({target:"Array",proto:!0,forced:P||!j},{indexOf:function(a){return P?D.apply(this,arguments)||0:I(this,a,arguments.length>1?arguments[1]:void 0)}})},8118:function(g,x,f){var c=f(3085),I=f(4770);c({target:"Array",stat:!0},{isArray:I})},8939:function(g,x,f){"use strict";var c=f(101),I=f(7423),M=f(7771),D=f(3326),P=f(7218),j="Array Iterator",p=D.set,a=D.getterFor(j);g.exports=P(Array,"Array",function(d,u){p(this,{type:j,target:c(d),index:0,kind:u})},function(){var d=a(this),u=d.target,t=d.kind,e=d.index++;return!u||e>=u.length?(d.target=void 0,{value:void 0,done:!0}):t=="keys"?{value:e,done:!1}:t=="values"?{value:u[e],done:!1}:{value:[e,u[e]],done:!1}},"values"),M.Arguments=M.Array,I("keys"),I("values"),I("entries")},3838:function(g,x,f){"use strict";var c=f(3085),I=f(454).map,M=f(242),D=M("map");c({target:"Array",proto:!0,forced:!D},{map:function(j){return I(this,j,arguments.length>1?arguments[1]:void 0)}})},5818:function(g,x,f){"use strict";var c=f(3085),I=f(4770),M=f(2091),D=f(5744),P=f(7739),j=f(4104),p=f(101),a=f(9361),d=f(8182),u=f(242),t=u("slice"),e=d("species"),i=[].slice,s=Math.max;c({target:"Array",proto:!0,forced:!t},{slice:function(o,y){var C=p(this),b=j(C),E=P(o,b),O=P(y===void 0?b:y,b),L,N,B;if(I(C)&&(L=C.constructor,M(L)&&(L===Array||I(L.prototype))?L=void 0:D(L)&&(L=L[e],L===null&&(L=void 0)),L===Array||L===void 0))return i.call(C,E,O);for(N=new(L===void 0?Array:L)(s(O-E,0)),B=0;E<O;E++,B++)E in C&&a(N,B,C[E]);return N.length=B,N}})},2178:function(g,x,f){"use strict";var c=f(3085),I=f(7739),M=f(1941),D=f(4104),P=f(1795),j=f(1321),p=f(9361),a=f(242),d=a("splice"),u=Math.max,t=Math.min,e=9007199254740991,i="Maximum allowed length exceeded";c({target:"Array",proto:!0,forced:!d},{splice:function(m,o){var y=P(this),C=D(y),b=I(m,C),E=arguments.length,O,L,N,B,Y,nt;if(E===0?O=L=0:E===1?(O=0,L=C-b):(O=E-2,L=t(u(M(o),0),C-b)),C+O-L>e)throw TypeError(i);for(N=j(y,L),B=0;B<L;B++)Y=b+B,Y in y&&p(N,B,y[Y]);if(N.length=L,O<L){for(B=b;B<C-L;B++)Y=B+L,nt=B+O,Y in y?y[nt]=y[Y]:delete y[nt];for(B=C;B>C-L+O;B--)delete y[B-1]}else if(O>L)for(B=C-
|
||
|
* @copyright Copyright (c) 2017 IcoMoon.io
|
||
|
* @license Licensed under MIT license
|
||
|
* See https://github.com/Keyamoon/svgxuse
|
||
|
* @version 1.2.6
|
||
|
*/(function(){"use strict";if(typeof window!="undefined"&&window.addEventListener){var w=d()(null),v,r,l=function(){clearTimeout(r),r=t()(v,100)},n=function(){},h=function(){var R;window.addEventListener("resize",l,!1),window.addEventListener("orientationchange",l,!1),window.MutationObserver?(R=new MutationObserver(l),R.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}),n=function(){try{R.disconnect(),window.removeEventListener("resize",l,!1),window.removeEventListener("orientationchange",l,!1)}catch(ot){}}):(document.documentElement.addEventListener("DOMSubtreeModified",l,!1),n=function(){document.documentElement.removeEventListener("DOMSubtreeModified",l,!1),window.removeEventListener("resize",l,!1),window.removeEventListener("orientationchange",l,!1)})},S=function(R){function H(ut){var pt;return ut.protocol!==void 0?pt=ut:(pt=document.createElement("a"),pt.href=ut),pt.protocol.replace(/:/g,"")+pt.host}var ot,lt,mt;return window.XMLHttpRequest&&(ot=new XMLHttpRequest,lt=H(location),mt=H(R),ot.withCredentials===void 0&&mt!==""&&mt!==lt?ot=XDomainRequest||void 0:ot=XMLHttpRequest),ot},T="http://www.w3.org/1999/xlink";v=function(){var R,H,ot="",lt,mt,ut,pt=0,jt,ie,re,oe,Ht;function ge(){pt-=1,pt===0&&(n(),h())}function De(Te){return function(){w[Te.base]!==!0&&(Te.useEl.setAttributeNS(T,"xlink:href","#"+Te.hash),Te.useEl.hasAttribute("href")&&Te.useEl.setAttribute("href","#"+Te.hash))}}function je(Te){return function(){var Ke=document.body,$e=document.createElement("x"),Le;Te.onload=null,$e.innerHTML=Te.responseText,Le=$e.getElementsByTagName("svg")[0],Le&&(Le.setAttribute("aria-hidden","true"),Le.style.position="absolute",Le.style.width=0,Le.style.height=0,Le.style.overflow="hidden",Ke.insertBefore(Le,Ke.firstChild)),ge()}}function Fe(Te){return function(){Te.onerror=null,Te.ontimeout=null,ge()}}for(n(),oe=document.getElementsByTagName("use"),ut=0;ut<oe.length;ut+=1){try{H=oe[ut].getBoundingClientRect()}catch(Te){H=!1}mt=oe[ut].getAttribute("href")||oe[ut].getAttributeNS(T,"href")||oe[ut].getAttribute("xlink:href"),mt&&mt.split?re=mt.split("#"):re=["",""],R=re[0],lt=re[1],jt=H&&H.left===0&&H.right===0&&H.top===0&&H.bottom===0,H&&H.width===0&&H.height===0&&!jt?(ot&&!R.length&<&&!document.getElementById(lt)&&(R=ot),oe[ut].hasAttribute("href")&&oe[ut].setAttributeNS(T,"xlink:href",mt),R.length&&(Ht=w[R],Ht!==!0&&t()(De({useEl:oe[ut],base:R,hash:lt}),0),Ht===void 0&&(ie=S(R),ie!==void 0&&(Ht=new ie,w[R]=Ht,Ht.onload=je(Ht),Ht.onerror=Fe(Ht),Ht.ontimeout=Fe(Ht),Ht.open("GET",R),Ht.send(),pt+=1)))):jt?R.length&&w[R]&&t()(De({useEl:oe[ut],base:R,hash:lt}),0):w[R]===void 0?w[R]=!0:w[R].onload&&(w[R].abort(),delete w[R].onload,w[R]=!0)}oe="",pt+=1,ge()};var k;k=function(){window.removeEventListener("load",k,!1),r=t()(v,0)},document.readyState!=="complete"?window.addEventListener("load",k,!1):k()}})();var e=_(1845);function i(w,v){(v==null||v>w.length)&&(v=w.length);for(var r=0,l=new Array(v);r<v;r++)l[r]=w[r];return l}function s(w){if(e(w))return i(w)}var m=_(184),o=_(662),y=_(7172);function C(w){if(typeof m!="undefined"&&o(w)!=null||w["@@iterator"]!=null)return y(w)}var b=_(711);function E(w,v){var r;if(!!w){if(typeof w=="string")return i(w,v);var l=b(r=Object.prototype.toString.call(w)).call(r,8,-1);if(l==="Object"&&w.constructor&&(l=w.constructor.name),l==="Map"||l==="Set")return y(w);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return i(w,v)}}function O(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function L(w){return s(w)||C(w)||E(w)||O()}var N=_(7077);function B(w,v,r){return v in w?N(w,v,{value:r,enumerable:!0,configurable:!0,writable:!0}):w[v]=r,w}function Y(w,v){if(!(w instanceof v))throw new TypeError("Cannot call a class as a function")}function nt(w,v){for(var r=0;r<v.length;r++){var l=v[r];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),N(w,l.key,l)}}function it(w,v,r){return v&&nt(w.prototype,v),r&&nt(w,r),w}var Mt=_(4426),K=_.n(Mt),It=_(9406),U=_.n(It),Lt=_(8189),dt=_.n(Lt),Nt=_(3972),V=_.n(Nt),q=_(2777),Q=_(961),G=_.n(Q),rt=_(5695),F=_.n(rt),W=_(8592),X=_.n(W),Z=_(9052),gt=_.n(Z),ht=_(2560),bt=_.n(ht),Tt=_(2461),xt=_.n(Tt);function at(w){if(e(w))return w}function $(w,v){var r=w==null?null:typeof m!="undefined"&&o(w)||w["@@iterator"];if(r!=null){var l=[],n=!0,h=!1,S,T;try{for(r=r.call(w);!(n=(S=r.next()).done)&&(l.push(S.value),!(v&&l.length===v));n=!0);}catch(k){h=!0,T=k}finally{try{!n&&r.return!=null&&r.return()}finally{if(h)throw T}}return l}}function et(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ct(w,v){return at(w)||$(w,v)||E(w,v)||et()}var ft=_(6397),Ct=_.n(ft),_t=_(7636),Zt=_.n(_t),Xt=_(789),St=_.n(Xt),Jt=_(4729),Kt=_.n(Jt),ae=_(1610),ve=_.n(ae),ue=_(3053),Wt=_.n(ue),Gt,$t=["zoomIn","zoomOut","hand"],ne=["history","undo","redo","reset"],ce=["delete","deleteAll"],Dt=U()(Gt=[]).call(Gt,$t,ne,ce),kt={FILTER:"filter",COLOR:"color"},Ut=["rect","circle","triangle"],Vt={CROPZONE:"cropzone"},qt={VINTAGE:"vintage",SEPIA2:"sepia2",REMOVE_COLOR:"removeColor",COLOR_FILTER:"colorFilter",REMOVE_WHITE:"removeWhite",BLEND_COLOR:"blendColor",BLEND:"blend"},Bt=Se("IMAGE_LOADER","CROPPER","FLIP","ROTATION","FREE_DRAWING","LINE","TEXT","ICON","FILTER","SHAPE","ZOOM","RESIZE"),be={lockSkewingX:!0,lockSkewingY:!0,bringForward:!0,isRegular:!1},Me={hasRotatingPoint:!1,hasBorders:!1,lockScalingFlip:!0,lockRotation:!0,lockSkewingX:!0,lockSkewingY:!0},Qt={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"},Et={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"},Ce={COLOR_PICKER_INPUT_BOX:".tui-colorpicker-palette-hex"},he={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"},de=Se("NORMAL","CROPPER","FREE_DRAWING","LINE_DRAWING","TEXT","SHAPE","ICON","ZOOM","RESIZE"),Ae={TEXT:"text",CROP:"crop",RESIZE:"resize",SHAPE:"shape",ZOOM:"zoom"},Oe={DEFAULT:"normal",ZOOM:"zoom",HAND:"hand"},xe={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},Be={SELECTION_STYLE:{borderColor:"red",cornerColor:"green",cornerSize:10,originX:"center",originY:"center",transparentCorners:!1}},pe={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."},hi={"icon-arrow":"M40 12V0l24 24-24 24V36H0V12h40z","icon-arrow-2":"M49,32 H
|
||
|
<div class="tui-image-editor-main-container" style="`.concat(R,`">
|
||
|
<div class="tui-image-editor-header" style="`)).call(T,H,`">
|
||
|
<div class="tui-image-editor-header-logo">
|
||
|
<img src="`)).call(S,A,`" />
|
||
|
</div>
|
||
|
<div class="tui-image-editor-header-buttons">
|
||
|
<div style="`)).call(h,ot,`">
|
||
|
`)).call(n,k.localize("Load"),`
|
||
|
<input type="file" class="tui-image-editor-load-btn" />
|
||
|
</div>
|
||
|
<button class="tui-image-editor-download-btn" style="`)).call(l,lt,`">
|
||
|
`)).call(r,k.localize("Download"),`
|
||
|
</button>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-main">
|
||
|
<div class="tui-image-editor-submenu">
|
||
|
<div class="tui-image-editor-submenu-style" style="`)).call(v,mt,`"></div>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-wrap">
|
||
|
<div class="tui-image-editor-size-wrap">
|
||
|
<div class="tui-image-editor-align-wrap">
|
||
|
<div class="tui-image-editor"></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
`)},Gr=function(w){var v,r,l,n,h,S=w.locale,T=w.biImage,k=w.loadButtonStyle,A=w.downloadButtonStyle,R=w.menuBarPosition;return U()(v=U()(r=U()(l=U()(n=U()(h=`
|
||
|
<ul class="tui-image-editor-help-menu `.concat(Lr(R),`"></ul>
|
||
|
<div class="tui-image-editor-controls">
|
||
|
<div class="tui-image-editor-controls-logo">
|
||
|
<img src="`)).call(h,T,`" />
|
||
|
</div>
|
||
|
<ul class="tui-image-editor-menu"></ul>
|
||
|
|
||
|
<div class="tui-image-editor-controls-buttons">
|
||
|
<div style="`)).call(n,k,`">
|
||
|
`)).call(l,S.localize("Load"),`
|
||
|
<input type="file" class="tui-image-editor-load-btn" />
|
||
|
</div>
|
||
|
<button class="tui-image-editor-download-btn" style="`)).call(r,A,`">
|
||
|
`)).call(v,S.localize("Download"),`
|
||
|
</button>
|
||
|
</div>
|
||
|
</div>
|
||
|
`)},Xr=_(899),We=_.n(Xr),Zr=function(w){var v,r,l,n,h,S,T,k,A,R,H,ot,lt,mt,ut,pt,jt,ie,re,oe,Ht,ge,De,je,Fe,Te,Ke,$e,Le,Di=w.subMenuLabelActive,Oi=w.subMenuLabelNormal,Ai=w.subMenuRangeTitle,_i=w.submenuPartitionVertical,ki=w.submenuPartitionHorizontal,Pi=w.submenuCheckbox,Li=w.submenuRangePointer,ji=w.submenuRangeValue,Ni=w.submenuColorpickerTitle,Ri=w.submenuColorpickerButton,zi=w.submenuRangeBar,Bi=w.submenuRangeSubbar,Fi=w.submenuDisabledRangePointer,Hi=w.submenuDisabledRangeBar,Ui=w.submenuDisabledRangeSubbar,Yi=w.submenuIconSize,Wi=w.menuIconSize,Gi=w.biSize,He=w.menuIconStyle,ti=w.submenuIconStyle;return U()(v=U()(r=U()(l=U()(n=U()(h=U()(S=U()(T=U()(k=U()(A=U()(R=U()(H=U()(ot=U()(lt=U()(mt=U()(ut=U()(pt=U()(jt=U()(ie=U()(re=U()(oe=U()(Ht=U()(ge=U()(De=U()(je=U()(Fe=U()(Te=U()(Ke=U()($e=U()(Le=`
|
||
|
.tie-icon-add-button.icon-bubble .tui-image-editor-button[data-icontype="icon-bubble"] label,
|
||
|
.tie-icon-add-button.icon-heart .tui-image-editor-button[data-icontype="icon-heart"] label,
|
||
|
.tie-icon-add-button.icon-location .tui-image-editor-button[data-icontype="icon-location"] label,
|
||
|
.tie-icon-add-button.icon-polygon .tui-image-editor-button[data-icontype="icon-polygon"] label,
|
||
|
.tie-icon-add-button.icon-star .tui-image-editor-button[data-icontype="icon-star"] label,
|
||
|
.tie-icon-add-button.icon-star-2 .tui-image-editor-button[data-icontype="icon-star-2"] label,
|
||
|
.tie-icon-add-button.icon-arrow-3 .tui-image-editor-button[data-icontype="icon-arrow-3"] label,
|
||
|
.tie-icon-add-button.icon-arrow-2 .tui-image-editor-button[data-icontype="icon-arrow-2"] label,
|
||
|
.tie-icon-add-button.icon-arrow .tui-image-editor-button[data-icontype="icon-arrow"] label,
|
||
|
.tie-icon-add-button.icon-bubble .tui-image-editor-button[data-icontype="icon-bubble"] label,
|
||
|
.tie-draw-line-select-button.line .tui-image-editor-button.line label,
|
||
|
.tie-draw-line-select-button.free .tui-image-editor-button.free label,
|
||
|
.tie-flip-button.flipX .tui-image-editor-button.flipX label,
|
||
|
.tie-flip-button.flipY .tui-image-editor-button.flipY label,
|
||
|
.tie-flip-button.resetFlip .tui-image-editor-button.resetFlip label,
|
||
|
.tie-crop-button .tui-image-editor-button.apply.active label,
|
||
|
.tie-crop-preset-button .tui-image-editor-button.preset.active label,
|
||
|
.tie-resize-button .tui-image-editor-button.apply.active label,
|
||
|
.tie-resize-preset-button .tui-image-editor-button.preset.active label,
|
||
|
.tie-shape-button.rect .tui-image-editor-button.rect label,
|
||
|
.tie-shape-button.circle .tui-image-editor-button.circle label,
|
||
|
.tie-shape-button.triangle .tui-image-editor-button.triangle label,
|
||
|
.tie-text-effect-button .tui-image-editor-button.active label,
|
||
|
.tie-text-align-button.tie-text-align-left .tui-image-editor-button.left label,
|
||
|
.tie-text-align-button.tie-text-align-center .tui-image-editor-button.center label,
|
||
|
.tie-text-align-button.tie-text-align-right .tui-image-editor-button.right label,
|
||
|
.tie-mask-apply.apply.active .tui-image-editor-button.apply label,
|
||
|
.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button:hover > label,
|
||
|
.tui-image-editor-container .tui-image-editor-checkbox label > span {
|
||
|
`.concat(Di,`
|
||
|
}
|
||
|
.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button > label,
|
||
|
.tui-image-editor-container .tui-image-editor-range-wrap.tui-image-editor-newline.short label,
|
||
|
.tui-image-editor-container .tui-image-editor-range-wrap.tui-image-editor-newline.short label > span {
|
||
|
`)).call(Le,Oi,`
|
||
|
}
|
||
|
.tui-image-editor-container .tui-image-editor-range-wrap label > span {
|
||
|
`)).call($e,Ai,`
|
||
|
}
|
||
|
.tui-image-editor-container .tui-image-editor-partition > div {
|
||
|
`)).call(Ke,_i,`
|
||
|
}
|
||
|
.tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-partition > div,
|
||
|
.tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-partition > div {
|
||
|
`)).call(Te,ki,`
|
||
|
}
|
||
|
.tui-image-editor-container .tui-image-editor-checkbox label > span:before {
|
||
|
`)).call(Fe,Pi,`
|
||
|
}
|
||
|
.tui-image-editor-container .tui-image-editor-checkbox label > input:checked + span:before {
|
||
|
border: 0;
|
||
|
}
|
||
|
.tui-image-editor-container .tui-image-editor-virtual-range-pointer {
|
||
|
`)).call(je,Li,`
|
||
|
}
|
||
|
.tui-image-editor-container .tui-image-editor-virtual-range-bar {
|
||
|
`)).call(De,zi,`
|
||
|
}
|
||
|
.tui-image-editor-container .tui-image-editor-virtual-range-subbar {
|
||
|
`)).call(ge,Bi,`
|
||
|
}
|
||
|
.tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-pointer {
|
||
|
`)).call(Ht,Fi,`
|
||
|
}
|
||
|
.tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-subbar {
|
||
|
`)).call(oe,Ui,`
|
||
|
}
|
||
|
.tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-bar {
|
||
|
`)).call(re,Hi,`
|
||
|
}
|
||
|
.tui-image-editor-container .tui-image-editor-range-value {
|
||
|
`)).call(ie,ji,`
|
||
|
}
|
||
|
.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button .color-picker-value + label {
|
||
|
`)).call(jt,Ni,`
|
||
|
}
|
||
|
.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button .color-picker-value {
|
||
|
`)).call(pt,Ri,`
|
||
|
}
|
||
|
.tui-image-editor-container .svg_ic-menu {
|
||
|
`)).call(ut,Wi,`
|
||
|
}
|
||
|
.tui-image-editor-container .svg_ic-submenu {
|
||
|
`)).call(mt,Yi,`
|
||
|
}
|
||
|
.tui-image-editor-container .tui-image-editor-controls-logo > img,
|
||
|
.tui-image-editor-container .tui-image-editor-header-logo > img {
|
||
|
`)).call(lt,Gi,`
|
||
|
}
|
||
|
.tui-image-editor-menu use.normal.use-default,
|
||
|
.tui-image-editor-help-menu use.normal.use-default {
|
||
|
fill-rule: evenodd;
|
||
|
fill: `)).call(ot,He.normal.color,`;
|
||
|
stroke: `)).call(H,He.normal.color,`;
|
||
|
}
|
||
|
.tui-image-editor-menu use.active.use-default,
|
||
|
.tui-image-editor-help-menu use.active.use-default {
|
||
|
fill-rule: evenodd;
|
||
|
fill: `)).call(R,He.active.color,`;
|
||
|
stroke: `)).call(A,He.active.color,`;
|
||
|
}
|
||
|
.tui-image-editor-menu use.hover.use-default,
|
||
|
.tui-image-editor-help-menu use.hover.use-default {
|
||
|
fill-rule: evenodd;
|
||
|
fill: `)).call(k,He.hover.color,`;
|
||
|
stroke: `)).call(T,He.hover.color,`;
|
||
|
}
|
||
|
.tui-image-editor-menu use.disabled.use-default,
|
||
|
.tui-image-editor-help-menu use.disabled.use-default {
|
||
|
fill-rule: evenodd;
|
||
|
fill: `)).call(S,He.disabled.color,`;
|
||
|
stroke: `)).call(h,He.disabled.color,`;
|
||
|
}
|
||
|
.tui-image-editor-submenu use.normal.use-default {
|
||
|
fill-rule: evenodd;
|
||
|
fill: `)).call(n,ti.normal.color,`;
|
||
|
stroke: `)).call(l,ti.normal.color,`;
|
||
|
}
|
||
|
.tui-image-editor-submenu use.active.use-default {
|
||
|
fill-rule: evenodd;
|
||
|
fill: `)).call(r,ti.active.color,`;
|
||
|
stroke: `)).call(v,ti.active.color,`;
|
||
|
}
|
||
|
`)},Vr={"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"},Jr=_(2534),Qr=function(){function w(v){Y(this,w),this.styles=this._changeToObject(G()({},Vr,v)),mi(this._styleMaker()),this._loadDefaultSvgIcon()}return it(w,[{key:"getStyle",value:function(r){var l=null,n=r.replace(/\..+$/,""),h=this.styles[r];switch(r){case"common.bi":l=this.styles[r].image;break;case"menu.icon":l={active:this.styles["".concat(n,".activeIcon")],normal:this.styles["".concat(n,".normalIcon")],hover:this.styles["".concat(n,".hoverIcon")],disabled:this.styles["".concat(n,".disabledIcon")]};break;case"submenu.icon":l={active:this.styles["".concat(n,".activeIcon")],normal:this.styles["".concat(n,".normalIcon")]};break;case"submenu.label":l={active:this._makeCssText(this.styles["".concat(n,".activeLabel")]),normal:this._makeCssText(this.styles["".concat(n,".normalLabel")])};break;case"submenu.partition":l={vertical:this._makeCssText(G()({},h,{borderLeft:"1px solid ".concat(h.color)})),horizontal:this._makeCssText(G()({},h,{borderBottom:"1px solid ".concat(h.color)}))};break;case"range.disabledPointer":case"range.disabledBar":case"range.disabledSubbar":case"range.pointer":case"range.bar":case"range.subbar":h.backgroundColor=h.color,l=this._makeCssText(h);break;default:l=this._makeCssText(h);break}return l}},{key:"_styleMaker",value:function(){var r=this.getStyle("submenu.label"),l=this.getStyle("submenu.partition");return Zr({subMenuLabelActive:r.active,subMenuLabelNormal:r.normal,submenuPartitionVertical:l.vertical,submenuPartitionHorizontal:l.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("
|
||
|
<ul class="tui-image-editor-submenu-item">
|
||
|
<li class="tie-shape-button">
|
||
|
<div class="tui-image-editor-button rect">
|
||
|
<div>
|
||
|
`.concat(R(["normal","active"],"shape-rectangle",!0),`
|
||
|
</div>
|
||
|
<label> `)).call(k,A.localize("Rectangle"),` </label>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-button circle">
|
||
|
<div>
|
||
|
`)).call(T,R(["normal","active"],"shape-circle",!0),`
|
||
|
</div>
|
||
|
<label> `)).call(S,A.localize("Circle"),` </label>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-button triangle">
|
||
|
<div>
|
||
|
`)).call(h,R(["normal","active"],"shape-triangle",!0),`
|
||
|
</div>
|
||
|
<label> `)).call(n,A.localize("Triangle"),` </label>
|
||
|
</div>
|
||
|
</li>
|
||
|
<li class="tui-image-editor-partition">
|
||
|
<div></div>
|
||
|
</li>
|
||
|
<li class="tie-shape-color-button">
|
||
|
<div class="tie-color-fill" title="`)).call(l,A.localize("Fill"),`"></div>
|
||
|
<div class="tie-color-stroke" title="`)).call(r,A.localize("Stroke"),`"></div>
|
||
|
</li>
|
||
|
<li class="tui-image-editor-partition only-left-right">
|
||
|
<div></div>
|
||
|
</li>
|
||
|
<li class="tui-image-editor-newline tui-image-editor-range-wrap">
|
||
|
<label class="range">`)).call(v,A.localize("Stroke"),`</label>
|
||
|
<div class="tie-stroke-range"></div>
|
||
|
<input class="tie-stroke-range-value tui-image-editor-range-value" value="0" />
|
||
|
</li>
|
||
|
</ul>
|
||
|
`)};function sa(w){var v=la();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function la(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var ca={stroke:"#ffbb3b",fill:"",strokeWidth:3},ua=function(w){me(r,w);var v=sa(r);function r(l,n){var h,S=n.locale,T=n.makeSvgIcon,k=n.menuBarPosition,A=n.usageStatistics;return Y(this,r),h=v.call(this,l,{locale:S,name:"shape",makeSvgIcon:T,menuBarPosition:k,templateHtml:oa,usageStatistics:A}),h.type=null,h.options=ca,h._els={shapeSelectButton:h.selector(".tie-shape-button"),shapeColorButton:h.selector(".tie-shape-color-button"),strokeRange:new Re({slider:h.selector(".tie-stroke-range"),input:h.selector(".tie-stroke-range-value")},ii),fillColorpicker:new Je(h.selector(".tie-color-fill"),{defaultColor:"",toggleDirection:h.toggleDirection,usageStatistics:h.usageStatistics}),strokeColorpicker:new Je(h.selector(".tie-color-stroke"),{defaultColor:"#ffbb3b",toggleDirection:h.toggleDirection,usageStatistics:h.usageStatistics})},h.colorPickerControls.push(h._els.fillColorpicker),h.colorPickerControls.push(h._els.strokeColorpicker),h.colorPickerInputBoxes=[],h.colorPickerInputBoxes.push(h._els.fillColorpicker.colorpickerElement.querySelector(Ce.COLOR_PICKER_INPUT_BOX)),h.colorPickerInputBoxes.push(h._els.strokeColorpicker.colorpickerElement.querySelector(Ce.COLOR_PICKER_INPUT_BOX)),h}return it(r,[{key:"destroy",value:function(){this._removeEvent(),this._els.strokeRange.destroy(),this._els.fillColorpicker.destroy(),this._els.strokeColorpicker.destroy(),Ne(this)}},{key:"addEvent",value:function(n){var h,S,T,k,A,R,H=this;this.eventHandler.shapeTypeSelected=K()(h=this._changeShapeHandler).call(h,this),this.actions=n,this._els.shapeSelectButton.addEventListener("click",this.eventHandler.shapeTypeSelected),this._els.strokeRange.on("change",K()(S=this._changeStrokeRangeHandler).call(S,this)),this._els.fillColorpicker.on("change",K()(T=this._changeFillColorHandler).call(T,this)),this._els.strokeColorpicker.on("change",K()(k=this._changeStrokeColorHandler).call(k,this)),this._els.fillColorpicker.on("changeShow",K()(A=this.colorPickerChangeShow).call(A,this)),this._els.strokeColorpicker.on("changeShow",K()(R=this.colorPickerChangeShow).call(R,this)),si()(this.colorPickerInputBoxes,function(ot){var lt,mt;ot.addEventListener(Et.FOCUS,K()(lt=H._onStartEditingInputBox).call(lt,H)),ot.addEventListener(Et.BLUR,K()(mt=H._onStopEditingInputBox).call(mt,H))},this)}},{key:"_removeEvent",value:function(){var n=this;this._els.shapeSelectButton.removeEventListener("click",this.eventHandler.shapeTypeSelected),this._els.strokeRange.off(),this._els.fillColorpicker.off(),this._els.strokeColorpicker.off(),si()(this.colorPickerInputBoxes,function(h){var S,T;h.removeEventListener(Et.FOCUS,K()(S=n._onStartEditingInputBox).call(S,n)),h.removeEventListener(Et.BLUR,K()(T=n._onStopEditingInputBox).call(T,n))},this)}},{key:"setShapeStatus",value:function(n){var h=n.strokeWidth,S=n.strokeColor,T=n.fillColor;this._els.strokeRange.value=h,this._els.strokeColorpicker.color=S,this._els.fillColorpicker.color=T,this.options.stroke=S,this.options.fill=T,this.options.strokeWidth=h,this.actions.setDrawingShape(this.type,{strokeWidth:h})}},{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(n){var h=n;h<=0&&(h=ii.max),this._els.strokeRange.max=h}},{key:"setStrokeValue",value:function(n){this._els.strokeRange.value=n,this._els.strokeRange.trigger("change")}},{key:"getStrokeValue",value:function(){return this._els.strokeRange.value}},{key:"_changeShapeHandler",value:function(n){var h=n.target.clo
|
||
|
<ul class="tui-image-editor-submenu-item">
|
||
|
<li class="tie-crop-preset-button">
|
||
|
<div class="tui-image-editor-button preset preset-none active">
|
||
|
<div>
|
||
|
`.concat(re(["normal","active"],"shape-rectangle",!0),`
|
||
|
</div>
|
||
|
<label> `)).call(jt,ie.localize("Custom"),` </label>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-button preset preset-square">
|
||
|
<div>
|
||
|
`)).call(pt,re(["normal","active"],"crop",!0),`
|
||
|
</div>
|
||
|
<label> `)).call(ut,ie.localize("Square"),` </label>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-button preset preset-3-2">
|
||
|
<div>
|
||
|
`)).call(mt,re(["normal","active"],"crop",!0),`
|
||
|
</div>
|
||
|
<label> `)).call(lt,ie.localize("3:2"),` </label>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-button preset preset-4-3">
|
||
|
<div>
|
||
|
`)).call(ot,re(["normal","active"],"crop",!0),`
|
||
|
</div>
|
||
|
<label> `)).call(H,ie.localize("4:3"),` </label>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-button preset preset-5-4">
|
||
|
<div>
|
||
|
`)).call(R,re(["normal","active"],"crop",!0),`
|
||
|
</div>
|
||
|
<label> `)).call(A,ie.localize("5:4"),` </label>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-button preset preset-7-5">
|
||
|
<div>
|
||
|
`)).call(k,re(["normal","active"],"crop",!0),`
|
||
|
</div>
|
||
|
<label> `)).call(T,ie.localize("7:5"),` </label>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-button preset preset-16-9">
|
||
|
<div>
|
||
|
`)).call(S,re(["normal","active"],"crop",!0),`
|
||
|
</div>
|
||
|
<label> `)).call(h,ie.localize("16:9"),` </label>
|
||
|
</div>
|
||
|
</li>
|
||
|
<li class="tui-image-editor-partition tui-image-editor-newline">
|
||
|
</li>
|
||
|
<li class="tui-image-editor-partition only-left-right">
|
||
|
<div></div>
|
||
|
</li>
|
||
|
<li class="tie-crop-button action">
|
||
|
<div class="tui-image-editor-button apply">
|
||
|
`)).call(n,re(["normal","active"],"apply"),`
|
||
|
<label>
|
||
|
`)).call(l,ie.localize("Apply"),`
|
||
|
</label>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-button cancel">
|
||
|
`)).call(r,re(["normal","active"],"cancel"),`
|
||
|
<label>
|
||
|
`)).call(v,ie.localize("Cancel"),`
|
||
|
</label>
|
||
|
</div>
|
||
|
</li>
|
||
|
</ul>
|
||
|
`)};function da(w){var v=ga();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function ga(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var va=function(w){me(r,w);var v=da(r);function r(l,n){var h,S=n.locale,T=n.makeSvgIcon,k=n.menuBarPosition,A=n.usageStatistics;return Y(this,r),h=v.call(this,l,{locale:S,name:"crop",makeSvgIcon:T,menuBarPosition:k,templateHtml:fa,usageStatistics:A}),h.status="active",h._els={apply:h.selector(".tie-crop-button .apply"),cancel:h.selector(".tie-crop-button .cancel"),preset:h.selector(".tie-crop-preset-button")},h.defaultPresetButton=h._els.preset.querySelector(".preset-none"),h}return it(r,[{key:"destroy",value:function(){this._removeEvent(),Ne(this)}},{key:"addEvent",value:function(n){var h,S,T,k=K()(h=this._applyEventHandler).call(h,this),A=K()(S=this._cancelEventHandler).call(S,this),R=K()(T=this._cropzonePresetEventHandler).call(T,this);this.eventHandler={apply:k,cancel:A,cropzonePreset:R},this.actions=n,this._els.apply.addEventListener("click",k),this._els.cancel.addEventListener("click",A),this._els.preset.addEventListener("click",R)}},{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(n){var h=n.target.closest(".tui-image-editor-button.preset");if(h){var S=h.className.match(/preset-[^\s]+/),T=ct(S,1),k=T[0];this._setPresetButtonActive(h),this.actions.preset(k)}}},{key:"changeStartMode",value:function(){this.actions.modeChange("crop")}},{key:"changeStandbyMode",value:function(){this.actions.stopDrawingMode(),this._setPresetButtonActive()}},{key:"changeApplyButtonStatus",value:function(n){n?this._els.apply.classList.add("active"):this._els.apply.classList.remove("active")}},{key:"_setPresetButtonActive",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.defaultPresetButton;X()(this._els.preset.querySelectorAll(".preset"),function(h){h.classList.remove("active")}),n&&n.classList.add("active")}}]),r}(Ge),pa=va,ma=function(w){var v,r,l,n,h,S,T=w.locale,k=w.makeSvgIcon;return U()(v=U()(r=U()(l=U()(n=U()(h=U()(S=`
|
||
|
<ul class="tui-image-editor-submenu-item">
|
||
|
<li class="tui-image-editor-submenu-align">
|
||
|
<div class="tui-image-editor-range-wrap tui-image-editor-newline">
|
||
|
<label class="range">`.concat(T.localize("Width"),` </label>
|
||
|
<div class="tie-width-range"></div>
|
||
|
<input class="tie-width-range-value tui-image-editor-range-value" value="0" /> <label>px</label>
|
||
|
<div class="tui-image-editor-partition tui-image-editor-newline"></div>
|
||
|
<label class="range">`)).call(S,T.localize("Height"),`</label>
|
||
|
<div class="tie-height-range"></div>
|
||
|
<input class="tie-height-range-value tui-image-editor-range-value" value="0" /> <label>px</label>
|
||
|
</div>
|
||
|
</li>
|
||
|
<li class="tui-image-editor-partition tui-image-editor-newline"></li>
|
||
|
<li class="tui-image-editor-partition only-left-right">
|
||
|
<div></div>
|
||
|
</li>
|
||
|
<li class="tui-image-editor-submenu-align">
|
||
|
<div class="tui-image-editor-checkbox-wrap">
|
||
|
<div class="tui-image-editor-checkbox">
|
||
|
<label>
|
||
|
<input type="checkbox" class="tie-lock-aspect-ratio">
|
||
|
<span>`)).call(h,T.localize("Lock Aspect Ratio"),`</span>
|
||
|
</label>
|
||
|
</div>
|
||
|
</div>
|
||
|
</li>
|
||
|
<li class="tui-image-editor-partition tui-image-editor-newline"></li>
|
||
|
<li class="tui-image-editor-partition only-left-right">
|
||
|
<div></div>
|
||
|
</li>
|
||
|
<li class="tui-image-editor-partition tui-image-editor-newline"></li>
|
||
|
<li class="tie-resize-button action">
|
||
|
<div class="tui-image-editor-button apply">
|
||
|
`)).call(n,k(["normal","active"],"apply"),`
|
||
|
<label>
|
||
|
`)).call(l,T.localize("Apply"),`
|
||
|
</label>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-button cancel">
|
||
|
`)).call(r,k(["normal","active"],"cancel"),`
|
||
|
<label>
|
||
|
`)).call(v,T.localize("Cancel"),`
|
||
|
</label>
|
||
|
</div>
|
||
|
</li>
|
||
|
</ul>
|
||
|
`)};function ya(w){var v=Ca();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function Ca(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var Sa=function(w){me(r,w);var v=ya(r);function r(l,n){var h,S=n.locale,T=n.makeSvgIcon,k=n.menuBarPosition,A=n.usageStatistics;return Y(this,r),h=v.call(this,l,{locale:S,name:"resize",makeSvgIcon:T,menuBarPosition:k,templateHtml:ma,usageStatistics:A}),h.status="active",h._lockState=!1,h._originalDimensions=null,h._els={widthRange:new Re({slider:h.selector(".tie-width-range"),input:h.selector(".tie-width-range-value")},Xe),heightRange:new Re({slider:h.selector(".tie-height-range"),input:h.selector(".tie-height-range-value")},Xe),lockAspectRatio:h.selector(".tie-lock-aspect-ratio"),apply:h.selector(".tie-resize-button .apply"),cancel:h.selector(".tie-resize-button .cancel")},h}return it(r,[{key:"changeStartMode",value:function(){this.actions.modeChange("resize");var n=this.actions.getCurrentDimensions();this._originalDimensions=n,this.setWidthValue(n.width),this.setHeightValue(n.height)}},{key:"changeStandbyMode",value:function(){this.actions.stopDrawingMode(),this.actions.reset(!0)}},{key:"setLimit",value:function(n){this._els.widthRange.min=this.calcMinValue(n.minWidth),this._els.heightRange.min=this.calcMinValue(n.minHeight),this._els.widthRange.max=this.calcMaxValue(n.maxWidth),this._els.heightRange.max=this.calcMaxValue(n.maxHeight)}},{key:"calcMaxValue",value:function(n){return n<=0&&(n=Xe.max),n}},{key:"calcMinValue",value:function(n){return n<=0&&(n=Xe.min),n}},{key:"setWidthValue",value:function(n){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;this._els.widthRange.value=n,h&&this._els.widthRange.trigger("change")}},{key:"setHeightValue",value:function(n){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;this._els.heightRange.value=n,h&&this._els.heightRange.trigger("change")}},{key:"destroy",value:function(){this._removeEvent(),Ne(this)}},{key:"addEvent",value:function(n){var h,S,T,k,A;this._els.widthRange.on("change",K()(h=this._changeWidthRangeHandler).call(h,this)),this._els.heightRange.on("change",K()(S=this._changeHeightRangeHandler).call(S,this)),this._els.lockAspectRatio.addEventListener("change",K()(T=this._changeLockAspectRatio).call(T,this));var R=K()(k=this._applyEventHandler).call(k,this),H=K()(A=this._cancelEventHandler).call(A,this);this.eventHandler={apply:R,cancel:H},this.actions=n,this._els.apply.addEventListener("click",R),this._els.cancel.addEventListener("click",H)}},{key:"_changeWidthRangeHandler",value:function(n){this.actions.preview("width",Rt(n),this._lockState)}},{key:"_changeHeightRangeHandler",value:function(n){this.actions.preview("height",Rt(n),this._lockState)}},{key:"_changeLockAspectRatio",value:function(n){this._lockState=n.target.checked,this.actions.lockAspectRatio(this._lockState,Xe.min,Xe.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(n){n?this._els.apply.classList.add("active"):this._els.apply.classList.remove("active")}}]),r}(Ge),xa=Sa,Ia=function(w){var v,r,l,n,h,S=w.locale,T=w.makeSvgIcon;return U()(v=U()(r=U()(l=U()(n=U()(h=`
|
||
|
<ul class="tie-flip-button tui-image-editor-submenu-item">
|
||
|
<li>
|
||
|
<div class="tui-image-editor-button flipX">
|
||
|
<div>
|
||
|
`.concat(T(["normal","active"],"flip-x",!0),`
|
||
|
</div>
|
||
|
<label>
|
||
|
`)).call(h,S.localize("Flip X"),`
|
||
|
</label>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-button flipY">
|
||
|
<div>
|
||
|
`)).call(n,T(["normal","active"],"flip-y",!0),`
|
||
|
</div>
|
||
|
<label>
|
||
|
`)).call(l,S.localize("Flip Y"),`
|
||
|
</label>
|
||
|
</div>
|
||
|
</li>
|
||
|
<li class="tui-image-editor-partition">
|
||
|
<div></div>
|
||
|
</li>
|
||
|
<li>
|
||
|
<div class="tui-image-editor-button resetFlip">
|
||
|
<div>
|
||
|
`)).call(r,T(["normal","active"],"flip-reset",!0),`
|
||
|
</div>
|
||
|
<label>
|
||
|
`)).call(v,S.localize("Reset"),`
|
||
|
</label>
|
||
|
</div>
|
||
|
</li>
|
||
|
</ul>
|
||
|
`)};function ba(w){var v=Ma();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function Ma(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var Ta=function(w){me(r,w);var v=ba(r);function r(l,n){var h,S=n.locale,T=n.makeSvgIcon,k=n.menuBarPosition,A=n.usageStatistics;return Y(this,r),h=v.call(this,l,{locale:S,name:"flip",makeSvgIcon:T,menuBarPosition:k,templateHtml:Ia,usageStatistics:A}),h.flipStatus=!1,h._els={flipButton:h.selector(".tie-flip-button")},h}return it(r,[{key:"destroy",value:function(){this._removeEvent(),Ne(this)}},{key:"addEvent",value:function(n){var h;this.eventHandler.changeFlip=K()(h=this._changeFlip).call(h,this),this._actions=n,this._els.flipButton.addEventListener("click",this.eventHandler.changeFlip)}},{key:"_removeEvent",value:function(){this._els.flipButton.removeEventListener("click",this.eventHandler.changeFlip)}},{key:"_changeFlip",value:function(n){var h=this,S=n.target.closest(".tui-image-editor-button");if(S){var T=this.getButtonType(S,["flipX","flipY","resetFlip"]);if(!this.flipStatus&&T==="resetFlip")return;this._actions.flip(T).then(function(k){var A=h._els.flipButton.classList;h.flipStatus=!1,A.remove("resetFlip"),X()(["flipX","flipY"],function(R){A.remove(R),k[R]&&(A.add(R),A.add("resetFlip"),h.flipStatus=!0)})})}}}]),r}(Ge),Ea=Ta,wa=function(w){var v,r,l=w.locale,n=w.makeSvgIcon;return U()(v=U()(r=`
|
||
|
<ul class="tui-image-editor-submenu-item">
|
||
|
<li class="tie-rotate-button">
|
||
|
<div class="tui-image-editor-button clockwise">
|
||
|
<div>
|
||
|
`.concat(n(["normal","active"],"rotate-clockwise",!0),`
|
||
|
</div>
|
||
|
<label> 30 </label>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-button counterclockwise">
|
||
|
<div>
|
||
|
`)).call(r,n(["normal","active"],"rotate-counterclockwise",!0),`
|
||
|
</div>
|
||
|
<label> -30 </label>
|
||
|
</div>
|
||
|
</li>
|
||
|
<li class="tui-image-editor-partition only-left-right">
|
||
|
<div></div>
|
||
|
</li>
|
||
|
<li class="tui-image-editor-newline tui-image-editor-range-wrap">
|
||
|
<label class="range">`)).call(v,l.localize("Range"),`</label>
|
||
|
<div class="tie-rotate-range"></div>
|
||
|
<input class="tie-rotate-range-value tui-image-editor-range-value" value="0" />
|
||
|
</li>
|
||
|
</ul>
|
||
|
`)};function Da(w){var v=Oa();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function Oa(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var Aa=30,_a=-30,ka=function(w){me(r,w);var v=Da(r);function r(l,n){var h,S=n.locale,T=n.makeSvgIcon,k=n.menuBarPosition,A=n.usageStatistics;return Y(this,r),h=v.call(this,l,{locale:S,name:"rotate",makeSvgIcon:T,menuBarPosition:k,templateHtml:wa,usageStatistics:A}),h._value=0,h._els={rotateButton:h.selector(".tie-rotate-button"),rotateRange:new Re({slider:h.selector(".tie-rotate-range"),input:h.selector(".tie-rotate-range-value")},fi)},h}return it(r,[{key:"destroy",value:function(){this._removeEvent(),this._els.rotateRange.destroy(),Ne(this)}},{key:"setRangeBarAngle",value:function(n,h){var S=h;n==="rotate"&&(S=Ct()(this._els.rotateRange.value,10)+h),this._setRangeBarRatio(S)}},{key:"_setRangeBarRatio",value:function(n){this._els.rotateRange.value=n}},{key:"addEvent",value:function(n){var h,S;this.eventHandler.rotationAngleChanged=K()(h=this._changeRotateForButton).call(h,this),this.actions=n,this._els.rotateButton.addEventListener("click",this.eventHandler.rotationAngleChanged),this._els.rotateRange.on("change",K()(S=this._changeRotateForRange).call(S,this))}},{key:"_removeEvent",value:function(){this._els.rotateButton.removeEventListener("click",this.eventHandler.rotationAngleChanged),this._els.rotateRange.off()}},{key:"_changeRotateForRange",value:function(n,h){var S=Rt(n);this.actions.setAngle(S,!h),this._value=S}},{key:"_changeRotateForButton",value:function(n){var h=n.target.closest(".tui-image-editor-button"),S=this._els.rotateRange.value;if(h){var T=this.getButtonType(h,["counterclockwise","clockwise"]),k={clockwise:Aa,counterclockwise:_a}[T],A=Ct()(S,10)+k,R=A>=-360&&A<=360;R&&this.actions.rotate(k)}}}]),r}(Ge),Pa=ka,La=function(w){var v,r,l,n,h,S,T,k,A,R,H,ot,lt,mt=w.locale,ut=w.makeSvgIcon;return U()(v=U()(r=U()(l=U()(n=U()(h=U()(S=U()(T=U()(k=U()(A=U()(R=U()(H=U()(ot=U()(lt=`
|
||
|
<ul class="tui-image-editor-submenu-item">
|
||
|
<li class="tie-text-effect-button">
|
||
|
<div class="tui-image-editor-button bold">
|
||
|
<div>
|
||
|
`.concat(ut(["normal","active"],"text-bold",!0),`
|
||
|
</div>
|
||
|
<label> `)).call(lt,mt.localize("Bold"),` </label>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-button italic">
|
||
|
<div>
|
||
|
`)).call(ot,ut(["normal","active"],"text-italic",!0),`
|
||
|
</div>
|
||
|
<label> `)).call(H,mt.localize("Italic"),` </label>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-button underline">
|
||
|
<div>
|
||
|
`)).call(R,ut(["normal","active"],"text-underline",!0),`
|
||
|
</div>
|
||
|
<label> `)).call(A,mt.localize("Underline"),` </label>
|
||
|
</div>
|
||
|
</li>
|
||
|
<li class="tui-image-editor-partition">
|
||
|
<div></div>
|
||
|
</li>
|
||
|
<li class="tie-text-align-button">
|
||
|
<div class="tui-image-editor-button left">
|
||
|
<div>
|
||
|
`)).call(k,ut(["normal","active"],"text-align-left",!0),`
|
||
|
</div>
|
||
|
<label> `)).call(T,mt.localize("Left"),` </label>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-button center">
|
||
|
<div>
|
||
|
`)).call(S,ut(["normal","active"],"text-align-center",!0),`
|
||
|
</div>
|
||
|
<label> `)).call(h,mt.localize("Center"),` </label>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-button right">
|
||
|
<div>
|
||
|
`)).call(n,ut(["normal","active"],"text-align-right",!0),`
|
||
|
</div>
|
||
|
<label> `)).call(l,mt.localize("Right"),` </label>
|
||
|
</div>
|
||
|
</li>
|
||
|
<li class="tui-image-editor-partition">
|
||
|
<div></div>
|
||
|
</li>
|
||
|
<li>
|
||
|
<div class="tie-text-color" title="`)).call(r,mt.localize("Color"),`"></div>
|
||
|
</li>
|
||
|
<li class="tui-image-editor-partition only-left-right">
|
||
|
<div></div>
|
||
|
</li>
|
||
|
<li class="tui-image-editor-newline tui-image-editor-range-wrap">
|
||
|
<label class="range">`)).call(v,mt.localize("Text size"),`</label>
|
||
|
<div class="tie-text-range"></div>
|
||
|
<input class="tie-text-range-value tui-image-editor-range-value" value="0" />
|
||
|
</li>
|
||
|
</ul>
|
||
|
`)};function ja(w){var v=Na();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function Na(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var Ra=function(w){me(r,w);var v=ja(r);function r(l,n){var h,S=n.locale,T=n.makeSvgIcon,k=n.menuBarPosition,A=n.usageStatistics;return Y(this,r),h=v.call(this,l,{locale:S,name:"text",makeSvgIcon:T,menuBarPosition:k,templateHtml:La,usageStatistics:A}),h.effect={bold:!1,italic:!1,underline:!1},h.align="tie-text-align-left",h._els={textEffectButton:h.selector(".tie-text-effect-button"),textAlignButton:h.selector(".tie-text-align-button"),textColorpicker:new Je(h.selector(".tie-text-color"),{defaultColor:"#ffbb3b",toggleDirection:h.toggleDirection,usageStatistics:h.usageStatistics}),textRange:new Re({slider:h.selector(".tie-text-range"),input:h.selector(".tie-text-range-value")},gi)},h.colorPickerInputBox=h._els.textColorpicker.colorpickerElement.querySelector(Ce.COLOR_PICKER_INPUT_BOX),h}return it(r,[{key:"destroy",value:function(){this._removeEvent(),this._els.textColorpicker.destroy(),this._els.textRange.destroy(),Ne(this)}},{key:"addEvent",value:function(n){var h,S,T,k,A,R,H=K()(h=this._setTextEffectHandler).call(h,this),ot=K()(S=this._setTextAlignHandler).call(S,this);this.eventHandler={setTextEffect:H,setTextAlign:ot},this.actions=n,this._els.textEffectButton.addEventListener("click",H),this._els.textAlignButton.addEventListener("click",ot),this._els.textRange.on("change",K()(T=this._changeTextRnageHandler).call(T,this)),this._els.textColorpicker.on("change",K()(k=this._changeColorHandler).call(k,this)),this.colorPickerInputBox.addEventListener(Et.FOCUS,K()(A=this._onStartEditingInputBox).call(A,this)),this.colorPickerInputBox.addEventListener(Et.BLUR,K()(R=this._onStopEditingInputBox).call(R,this))}},{key:"_removeEvent",value:function(){var n,h,S=this.eventHandler,T=S.setTextEffect,k=S.setTextAlign;this._els.textEffectButton.removeEventListener("click",T),this._els.textAlignButton.removeEventListener("click",k),this._els.textRange.off(),this._els.textColorpicker.off(),this.colorPickerInputBox.removeEventListener(Et.FOCUS,K()(n=this._onStartEditingInputBox).call(n,this)),this.colorPickerInputBox.removeEventListener(Et.BLUR,K()(h=this._onStopEditingInputBox).call(h,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(n){this._els.textColorpicker.color=n}},{key:"fontSize",get:function(){return this._els.textRange.value},set:function(n){this._els.textRange.value=n}},{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 n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},h=St()(n),S=n.fontSize,T=n.fontStyle,k=n.fontWeight,A=n.textDecoration,R=n.textAlign;this.textColor=h,this.fontSize=S,this.setEffectState("italic",T),this.setEffectState("bold",k),this.setEffectState("underline",A),this.setAlignState("tie-text-align-".concat(R))}},{key:"setEffectState",value:function(n,h){var S=h==="italic"||h==="bold"||h==="underline",T=this._els.textEffectButton.querySelector(".tui-image-editor-button.".concat(n));this.effect[n]=S,T.classList[S?"add":"remove"]("active")}},{key:"setAlignState",value:function(n){var h=this._els.textAlignButton;h.classList.remove(this.align),h.classList.add(n),this.align=n}},{key:"_setTextEffectHandler",value:function(n){var h=n.target.closest(".tui-image-editor-button");if(h){var S=h.className.match(/(bold|italic|underline)/),T=ct(S,1),k=T[0],A={bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},underline:{textDecoration:"underline"}
|
||
|
<ul class="tui-image-editor-submenu-item">
|
||
|
<li>
|
||
|
<div class="tui-image-editor-button">
|
||
|
<div>
|
||
|
<input type="file" accept="image/*" class="tie-mask-image-file">
|
||
|
`.concat(h(["normal","active"],"mask-load",!0),`
|
||
|
</div>
|
||
|
<label> `)).call(l,n.localize("Load Mask Image"),` </label>
|
||
|
</div>
|
||
|
</li>
|
||
|
<li class="tui-image-editor-partition only-left-right">
|
||
|
<div></div>
|
||
|
</li>
|
||
|
<li class="tie-mask-apply tui-image-editor-newline apply" style="margin-top: 22px;margin-bottom: 5px">
|
||
|
<div class="tui-image-editor-button apply">
|
||
|
`)).call(r,h(["normal","active"],"apply"),`
|
||
|
<label>
|
||
|
`)).call(v,n.localize("Apply"),`
|
||
|
</label>
|
||
|
</div>
|
||
|
</li>
|
||
|
</ul>
|
||
|
`)};function Fa(w){var v=Ha();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function Ha(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var Ua=function(w){me(r,w);var v=Fa(r);function r(l,n){var h,S=n.locale,T=n.makeSvgIcon,k=n.menuBarPosition,A=n.usageStatistics;return Y(this,r),h=v.call(this,l,{locale:S,name:"mask",makeSvgIcon:T,menuBarPosition:k,templateHtml:Ba,usageStatistics:A}),h._els={applyButton:h.selector(".tie-mask-apply"),maskImageButton:h.selector(".tie-mask-image-file")},h}return it(r,[{key:"destroy",value:function(){this._removeEvent(),Ne(this)}},{key:"addEvent",value:function(n){var h,S,T=K()(h=this._loadMaskFile).call(h,this),k=K()(S=this._applyMask).call(S,this);this.eventHandler={loadMaskFile:T,applyMask:k},this.actions=n,this._els.maskImageButton.addEventListener("change",T),this._els.applyButton.addEventListener("click",k)}},{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(n){var h;Pe()||alert("This browser does not support file-api");var S=ct(n.target.files,1),T=S[0];T&&(h=V().createObjectURL(T),this.actions.loadImageFromURL(h,T),this._els.applyButton.classList.add("active"))}}]),r}(Ge),Ya=Ua,Wa=function(w){var v,r,l,n,h,S,T,k,A,R,H,ot,lt,mt,ut,pt,jt,ie,re,oe,Ht=w.locale,ge=w.makeSvgIcon;return U()(v=U()(r=U()(l=U()(n=U()(h=U()(S=U()(T=U()(k=U()(A=U()(R=U()(H=U()(ot=U()(lt=U()(mt=U()(ut=U()(pt=U()(jt=U()(ie=U()(re=U()(oe=`
|
||
|
<ul class="tui-image-editor-submenu-item">
|
||
|
<li class="tie-icon-add-button">
|
||
|
<div class="tui-image-editor-button" data-icontype="icon-arrow">
|
||
|
<div>
|
||
|
`.concat(ge(["normal","active"],"icon-arrow",!0),`
|
||
|
</div>
|
||
|
<label>
|
||
|
`)).call(oe,Ht.localize("Arrow"),`
|
||
|
</label>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-button" data-icontype="icon-arrow-2">
|
||
|
<div>
|
||
|
`)).call(re,ge(["normal","active"],"icon-arrow-2",!0),`
|
||
|
</div>
|
||
|
<label>
|
||
|
`)).call(ie,Ht.localize("Arrow-2"),`
|
||
|
</label>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-button" data-icontype="icon-arrow-3">
|
||
|
<div>
|
||
|
`)).call(jt,ge(["normal","active"],"icon-arrow-3",!0),`
|
||
|
</div>
|
||
|
<label>
|
||
|
`)).call(pt,Ht.localize("Arrow-3"),`
|
||
|
</label>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-button" data-icontype="icon-star">
|
||
|
<div>
|
||
|
`)).call(ut,ge(["normal","active"],"icon-star",!0),`
|
||
|
</div>
|
||
|
<label>
|
||
|
`)).call(mt,Ht.localize("Star-1"),`
|
||
|
</label>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-button" data-icontype="icon-star-2">
|
||
|
<div>
|
||
|
`)).call(lt,ge(["normal","active"],"icon-star-2",!0),`
|
||
|
</div>
|
||
|
<label>
|
||
|
`)).call(ot,Ht.localize("Star-2"),`
|
||
|
</label>
|
||
|
</div>
|
||
|
|
||
|
<div class="tui-image-editor-button" data-icontype="icon-polygon">
|
||
|
<div>
|
||
|
`)).call(H,ge(["normal","active"],"icon-polygon",!0),`
|
||
|
</div>
|
||
|
<label>
|
||
|
`)).call(R,Ht.localize("Polygon"),`
|
||
|
</label>
|
||
|
</div>
|
||
|
|
||
|
<div class="tui-image-editor-button" data-icontype="icon-location">
|
||
|
<div>
|
||
|
`)).call(A,ge(["normal","active"],"icon-location",!0),`
|
||
|
</div>
|
||
|
<label>
|
||
|
`)).call(k,Ht.localize("Location"),`
|
||
|
</label>
|
||
|
</div>
|
||
|
|
||
|
<div class="tui-image-editor-button" data-icontype="icon-heart">
|
||
|
<div>
|
||
|
`)).call(T,ge(["normal","active"],"icon-heart",!0),`
|
||
|
</div>
|
||
|
<label>
|
||
|
`)).call(S,Ht.localize("Heart"),`
|
||
|
</label>
|
||
|
</div>
|
||
|
|
||
|
<div class="tui-image-editor-button" data-icontype="icon-bubble">
|
||
|
<div>
|
||
|
`)).call(h,ge(["normal","active"],"icon-bubble",!0),`
|
||
|
</div>
|
||
|
<label>
|
||
|
`)).call(n,Ht.localize("Bubble"),`
|
||
|
</label>
|
||
|
</div>
|
||
|
</li>
|
||
|
<li class="tui-image-editor-partition">
|
||
|
<div></div>
|
||
|
</li>
|
||
|
<li class="tie-icon-add-button">
|
||
|
<div class="tui-image-editor-button" style="margin:0">
|
||
|
<div>
|
||
|
<input type="file" accept="image/*" class="tie-icon-image-file">
|
||
|
`)).call(l,ge(["normal","active"],"icon-load",!0),`
|
||
|
</div>
|
||
|
<label>
|
||
|
`)).call(r,Ht.localize("Custom icon"),`
|
||
|
</label>
|
||
|
</div>
|
||
|
</li>
|
||
|
<li class="tui-image-editor-partition">
|
||
|
<div></div>
|
||
|
</li>
|
||
|
<li>
|
||
|
<div class="tie-icon-color" title="`)).call(v,Ht.localize("Color"),`"></div>
|
||
|
</li>
|
||
|
</ul>
|
||
|
`)};function Ga(w){var v=Xa();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function Xa(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var Za=function(w){me(r,w);var v=Ga(r);function r(l,n){var h,S=n.locale,T=n.makeSvgIcon,k=n.menuBarPosition,A=n.usageStatistics;return Y(this,r),h=v.call(this,l,{locale:S,name:"icon",makeSvgIcon:T,menuBarPosition:k,templateHtml:Wa,usageStatistics:A}),h.iconType=null,h._iconMap={},h._els={registerIconButton:h.selector(".tie-icon-image-file"),addIconButton:h.selector(".tie-icon-add-button"),iconColorpicker:new Je(h.selector(".tie-icon-color"),{defaultColor:"#ffbb3b",toggleDirection:h.toggleDirection,usageStatistics:h.usageStatistics})},h.colorPickerInputBox=h._els.iconColorpicker.colorpickerElement.querySelector(Ce.COLOR_PICKER_INPUT_BOX),h}return it(r,[{key:"destroy",value:function(){this._removeEvent(),this._els.iconColorpicker.destroy(),Ne(this)}},{key:"addEvent",value:function(n){var h,S,T,k,A,R=K()(h=this._registerIconHandler).call(h,this),H=K()(S=this._addIconHandler).call(S,this);this.eventHandler={registerIcon:R,addIcon:H},this.actions=n,this._els.iconColorpicker.on("change",K()(T=this._changeColorHandler).call(T,this)),this._els.registerIconButton.addEventListener("change",R),this._els.addIconButton.addEventListener("click",H),this.colorPickerInputBox.addEventListener(Et.FOCUS,K()(k=this._onStartEditingInputBox).call(k,this)),this.colorPickerInputBox.addEventListener(Et.BLUR,K()(A=this._onStopEditingInputBox).call(A,this))}},{key:"_removeEvent",value:function(){var n,h;this._els.iconColorpicker.off(),this._els.registerIconButton.removeEventListener("change",this.eventHandler.registerIcon),this._els.addIconButton.removeEventListener("click",this.eventHandler.addIcon),this.colorPickerInputBox.removeEventListener(Et.FOCUS,K()(n=this._onStartEditingInputBox).call(n,this)),this.colorPickerInputBox.removeEventListener(Et.BLUR,K()(h=this._onStopEditingInputBox).call(h,this))}},{key:"clearIconType",value:function(){this._els.addIconButton.classList.remove(this.iconType),this.iconType=null}},{key:"registerDefaultIcon",value:function(){var n=this;X()(hi,function(h,S){n.actions.registerDefaultIcons(S,h)})}},{key:"setIconPickerColor",value:function(n){this._els.iconColorpicker.color=n}},{key:"changeStandbyMode",value:function(){this.clearIconType(),this.actions.cancelAddIcon()}},{key:"_changeColorHandler",value:function(n){n=n||"transparent",this.actions.changeColor(n)}},{key:"_addIconHandler",value:function(n){var h=n.target.closest(".tui-image-editor-button");if(h){var S=h.getAttribute("data-icontype"),T=this._els.iconColorpicker.color;this.actions.discardSelection(),this.actions.changeSelectableAll(!1),this._els.addIconButton.classList.remove(this.iconType),this._els.addIconButton.classList.add(S),this.iconType===S?this.changeStandbyMode():(this.actions.addIcon(S,T),this.iconType=S)}}},{key:"_registerIconHandler",value:function(n){var h;Pe||alert("This browser does not support file-api");var S=ct(n.target.files,1),T=S[0];T&&(h=V().createObjectURL(T),this.actions.registerCustomIcon(h,T))}}]),r}(Ge),Va=Za,Ja=function(w){var v,r,l,n,h,S=w.locale,T=w.makeSvgIcon;return U()(v=U()(r=U()(l=U()(n=U()(h=`
|
||
|
<ul class="tui-image-editor-submenu-item">
|
||
|
<li class="tie-draw-line-select-button">
|
||
|
<div class="tui-image-editor-button free">
|
||
|
<div>
|
||
|
`.concat(T(["normal","active"],"draw-free",!0),`
|
||
|
</div>
|
||
|
<label>
|
||
|
`)).call(h,S.localize("Free"),`
|
||
|
</label>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-button line">
|
||
|
<div>
|
||
|
`)).call(n,T(["normal","active"],"draw-line",!0),`
|
||
|
</div>
|
||
|
<label>
|
||
|
`)).call(l,S.localize("Straight"),`
|
||
|
</label>
|
||
|
</div>
|
||
|
</li>
|
||
|
<li class="tui-image-editor-partition">
|
||
|
<div></div>
|
||
|
</li>
|
||
|
<li>
|
||
|
<div class="tie-draw-color" title="`)).call(r,S.localize("Color"),`"></div>
|
||
|
</li>
|
||
|
<li class="tui-image-editor-partition only-left-right">
|
||
|
<div></div>
|
||
|
</li>
|
||
|
<li class="tui-image-editor-newline tui-image-editor-range-wrap">
|
||
|
<label class="range">`)).call(v,S.localize("Range"),`</label>
|
||
|
<div class="tie-draw-range"></div>
|
||
|
<input class="tie-draw-range-value tui-image-editor-range-value" value="0" />
|
||
|
</li>
|
||
|
</ul>
|
||
|
`)};function Qa(w){var v=Ka();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function Ka(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var $a=.7,qa=function(w){me(r,w);var v=Qa(r);function r(l,n){var h,S=n.locale,T=n.makeSvgIcon,k=n.menuBarPosition,A=n.usageStatistics;return Y(this,r),h=v.call(this,l,{locale:S,name:"draw",makeSvgIcon:T,menuBarPosition:k,templateHtml:Ja,usageStatistics:A}),h._els={lineSelectButton:h.selector(".tie-draw-line-select-button"),drawColorPicker:new Je(h.selector(".tie-draw-color"),{defaultColor:"#00a9ff",toggleDirection:h.toggleDirection,usageStatistics:h.usageStatistics}),drawRange:new Re({slider:h.selector(".tie-draw-range"),input:h.selector(".tie-draw-range-value")},di)},h.type=null,h.color=h._els.drawColorPicker.color,h.width=h._els.drawRange.value,h.colorPickerInputBox=h._els.drawColorPicker.colorpickerElement.querySelector(Ce.COLOR_PICKER_INPUT_BOX),h}return it(r,[{key:"destroy",value:function(){this._removeEvent(),this._els.drawColorPicker.destroy(),this._els.drawRange.destroy(),Ne(this)}},{key:"addEvent",value:function(n){var h,S,T,k,A;this.eventHandler.changeDrawType=K()(h=this._changeDrawType).call(h,this),this.actions=n,this._els.lineSelectButton.addEventListener("click",this.eventHandler.changeDrawType),this._els.drawColorPicker.on("change",K()(S=this._changeDrawColor).call(S,this)),this._els.drawRange.on("change",K()(T=this._changeDrawRange).call(T,this)),this.colorPickerInputBox.addEventListener(Et.FOCUS,K()(k=this._onStartEditingInputBox).call(k,this)),this.colorPickerInputBox.addEventListener(Et.BLUR,K()(A=this._onStopEditingInputBox).call(A,this))}},{key:"_removeEvent",value:function(){var n,h;this._els.lineSelectButton.removeEventListener("click",this.eventHandler.changeDrawType),this._els.drawColorPicker.off(),this._els.drawRange.off(),this.colorPickerInputBox.removeEventListener(Et.FOCUS,K()(n=this._onStartEditingInputBox).call(n,this)),this.colorPickerInputBox.removeEventListener(Et.BLUR,K()(h=this._onStopEditingInputBox).call(h,this))}},{key:"setDrawMode",value:function(){this.actions.setDrawMode(this.type,{width:this.width,color:ri(this.color,$a)})}},{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(n){var h=n.target.closest(".tui-image-editor-button");if(h){var S=this.getButtonType(h,["free","line"]);if(this.actions.discardSelection(),this.type===S){this.changeStandbyMode();return}this.changeStandbyMode(),this.type=S,this._els.lineSelectButton.classList.add(S),this.setDrawMode()}}},{key:"_changeDrawColor",value:function(n){this.color=n||"transparent",this.type?this.setDrawMode():this.changeStartMode()}},{key:"_changeDrawRange",value:function(n){this.width=n,this.type?this.setDrawMode():this.changeStartMode()}}]),r}(Ge),to=qa,eo=_(9886),Cn=_.n(eo),io=function(w){var v,r,l,n,h,S,T,k,A,R,H,ot,lt,mt,ut,pt,jt=w.locale;return U()(v=U()(r=U()(l=U()(n=U()(h=U()(S=U()(T=U()(k=U()(A=U()(R=U()(H=U()(ot=U()(lt=U()(mt=U()(ut=U()(pt=`
|
||
|
<ul class="tui-image-editor-submenu-item">
|
||
|
<li class="tui-image-editor-submenu-align">
|
||
|
<div class="tui-image-editor-checkbox-wrap fixed-width">
|
||
|
<div class="tui-image-editor-checkbox">
|
||
|
<label>
|
||
|
<input type="checkbox" class="tie-grayscale">
|
||
|
<span>`.concat(jt.localize("Grayscale"),`</span>
|
||
|
</label>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-checkbox">
|
||
|
<label>
|
||
|
<input type="checkbox" class="tie-invert">
|
||
|
<span>`)).call(pt,jt.localize("Invert"),`</span>
|
||
|
</label>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-checkbox">
|
||
|
<label>
|
||
|
<input type="checkbox" class="tie-sepia">
|
||
|
<span>`)).call(ut,jt.localize("Sepia"),`</span>
|
||
|
</label>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-checkbox">
|
||
|
<label>
|
||
|
<input type="checkbox" class="tie-vintage">
|
||
|
<span>`)).call(mt,jt.localize("Sepia2"),`</span>
|
||
|
</label>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-checkbox">
|
||
|
<label>
|
||
|
<input type="checkbox" class="tie-blur">
|
||
|
<span>`)).call(lt,jt.localize("Blur"),`</span>
|
||
|
</label>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-checkbox">
|
||
|
<label>
|
||
|
<input type="checkbox" class="tie-sharpen">
|
||
|
<span>`)).call(ot,jt.localize("Sharpen"),`</span>
|
||
|
</label>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-checkbox">
|
||
|
<label>
|
||
|
<input type="checkbox" class="tie-emboss">
|
||
|
<span>`)).call(H,jt.localize("Emboss"),`</span>
|
||
|
</label>
|
||
|
</div>
|
||
|
</div>
|
||
|
</li>
|
||
|
<li class="tui-image-editor-partition">
|
||
|
<div></div>
|
||
|
</li>
|
||
|
<li class="tui-image-editor-submenu-align">
|
||
|
<div class="tui-image-editor-checkbox-group tui-image-editor-disabled" style="margin-bottom: 7px;">
|
||
|
<div class="tui-image-editor-checkbox-wrap">
|
||
|
<div class="tui-image-editor-checkbox">
|
||
|
<label>
|
||
|
<input type="checkbox" class="tie-remove-white">
|
||
|
<span>`)).call(R,jt.localize("Remove White"),`</span>
|
||
|
</label>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-newline tui-image-editor-range-wrap short">
|
||
|
<label>`)).call(A,jt.localize("Distance"),`</label>
|
||
|
<div class="tie-removewhite-distance-range"></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-checkbox-group tui-image-editor-disabled">
|
||
|
<div class="tui-image-editor-checkbox">
|
||
|
<label>
|
||
|
<input type="checkbox" class="tie-brightness">
|
||
|
<span>`)).call(k,jt.localize("Brightness"),`</span>
|
||
|
</label>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-range-wrap short">
|
||
|
<div class="tie-brightness-range"></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-checkbox-group tui-image-editor-disabled">
|
||
|
<div class="tui-image-editor-checkbox">
|
||
|
<label>
|
||
|
<input type="checkbox" class="tie-noise">
|
||
|
<span>`)).call(T,jt.localize("Noise"),`</span>
|
||
|
</label>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-range-wrap short">
|
||
|
<div class="tie-noise-range"></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</li>
|
||
|
<li class="tui-image-editor-partition only-left-right">
|
||
|
<div></div>
|
||
|
</li>
|
||
|
<li class="tui-image-editor-submenu-align">
|
||
|
<div class="tui-image-editor-checkbox-group tui-image-editor-disabled">
|
||
|
<div class="tui-image-editor-checkbox">
|
||
|
<label>
|
||
|
<input type="checkbox" class="tie-pixelate">
|
||
|
<span>`)).call(S,jt.localize("Pixelate"),`</span>
|
||
|
</label>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-range-wrap short">
|
||
|
<div class="tie-pixelate-range"></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-checkbox-group tui-image-editor-disabled">
|
||
|
<div class="tui-image-editor-newline tui-image-editor-checkbox-wrap">
|
||
|
<div class="tui-image-editor-checkbox">
|
||
|
<label>
|
||
|
<input type="checkbox" class="tie-color-filter">
|
||
|
<span>`)).call(h,jt.localize("Color Filter"),`</span>
|
||
|
</label>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="tui-image-editor-newline tui-image-editor-range-wrap short">
|
||
|
<label>`)).call(n,jt.localize("Threshold"),`</label>
|
||
|
<div class="tie-colorfilter-threshold-range"></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</li>
|
||
|
<li class="tui-image-editor-partition">
|
||
|
<div></div>
|
||
|
</li>
|
||
|
<li>
|
||
|
<div class="filter-color-item">
|
||
|
<div class="tie-filter-tint-color" title="`)).call(l,jt.localize("Tint"),`"></div>
|
||
|
<div class="tui-image-editor-checkbox">
|
||
|
<label>
|
||
|
<input type="checkbox" class="tie-tint">
|
||
|
<span></span>
|
||
|
</label>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="filter-color-item">
|
||
|
<div class="tie-filter-multiply-color" title="`)).call(r,jt.localize("Multiply"),`"></div>
|
||
|
<div class="tui-image-editor-checkbox">
|
||
|
<label>
|
||
|
<input type="checkbox" class="tie-multiply">
|
||
|
<span></span>
|
||
|
</label>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="filter-color-item">
|
||
|
<div class="tie-filter-blend-color" title="`)).call(v,jt.localize("Blend"),`"></div>
|
||
|
<div class="tui-image-editor-checkbox">
|
||
|
<label>
|
||
|
<input type="checkbox" class="tie-blend">
|
||
|
<span></span>
|
||
|
</label>
|
||
|
</div>
|
||
|
</div>
|
||
|
</li>
|
||
|
</ul>
|
||
|
`)};function no(w){var v=ro();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function ro(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var Sn="130px",ao=["add","diff","subtract","multiply","screen","lighten","darken"],xn=["grayscale","invert","sepia","vintage","blur","sharpen","emboss","remove-white","brightness","noise","pixelate","color-filter","tint","multiply","blend"],oo={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"},In=["removewhiteDistanceRange","colorfilterThresholdRange","pixelateRange","noiseRange","brightnessRange","tintOpacity"],bn=["filterBlendColor","filterMultiplyColor","filterTintColor"],so=function(w){me(r,w);var v=no(r);function r(l,n){var h,S=n.locale,T=n.menuBarPosition,k=n.usageStatistics;return Y(this,r),h=v.call(this,l,{locale:S,name:"filter",menuBarPosition:T,templateHtml:io,usageStatistics:k}),h.selectBoxShow=!1,h.checkedMap={},h._makeControlElement(),h}return it(r,[{key:"destroy",value:function(){this._removeEvent(),this._destroyToolInstance(),Ne(this)}},{key:"_removeEvent",value:function(){var n=this,h;X()(xn,function(S){var T=n.selector(".tie-".concat(S)),k=we(S);T.removeEventListener("change",n.eventHandler[k])}),X()(U()(h=[]).call(h,In,bn),function(S){n._els[S].off()}),this._els.blendType.removeEventListener("change",this.eventHandler.changeBlendFilter),this._els.blendType.removeEventListener("click",this.eventHandler.changeBlendFilter),si()(this.colorPickerInputBoxes,function(S){var T,k;S.removeEventListener(Et.FOCUS,K()(T=n._onStartEditingInputBox).call(T,n)),S.removeEventListener(Et.BLUR,K()(k=n._onStopEditingInputBox).call(k,n))},this)}},{key:"_destroyToolInstance",value:function(){var n,h=this;X()(U()(n=[]).call(n,In,bn),function(S){h._els[S].destroy()})}},{key:"addEvent",value:function(n){var h=this,S,T,k,A=n.applyFilter,R=function(lt){var mt;return K()(mt=h._changeFilterState).call(mt,h,A,lt)},H=function(lt){return function(mt,ut){return h._changeFilterState(A,lt,ut)}};this.eventHandler={changeBlendFilter:R("blend"),blandTypeClick:function(lt){return lt.stopPropagation()}},X()(xn,function(ot){var lt=h.selector(".tie-".concat(ot)),mt=we(ot);h.checkedMap[mt]=lt,h.eventHandler[mt]=R(mt),lt.addEventListener("change",h.eventHandler[mt])}),this._els.removewhiteDistanceRange.on("change",H("removeWhite")),this._els.colorfilterThresholdRange.on("change",H("colorFilter")),this._els.pixelateRange.on("change",H("pixelate")),this._els.noiseRange.on("change",H("noise")),this._els.brightnessRange.on("change",H("brightness")),this._els.filterBlendColor.on("change",this.eventHandler.changeBlendFilter),this._els.filterMultiplyColor.on("change",R("multiply")),this._els.filterTintColor.on("change",R("tint")),this._els.tintOpacity.on("change",H("tint")),this._els.filterMultiplyColor.on("changeShow",K()(S=this.colorPickerChangeShow).call(S,this)),this._els.filterTintColor.on("changeShow",K()(T=this.colorPickerChangeShow).call(T,this)),this._els.filterBlendColor.on("changeShow",K()(k=this.colorPickerChangeShow).call(k,this)),this._els.blendType.addEventListener("change",this.eventHandler.changeBlendFilter),this._els.blendType.addEventListener("click",this.eventHandler.blandTypeClick),si()(this.colorPickerInputBoxes,function(ot){var lt,mt;ot.addEventListener(Et.FOCUS,K()(lt=h._onStartEditingInputBox).call(lt,h)),ot.addEventListener(Et.BLUR,K()(mt=h._onStopEditingInputBox).call(mt,h))},this)}},{key:"setFilterState",value:function(n){var h=n.type,S=n.options,T=n.action,k=this._getFilterNameFromOptions(h,S),A=T==="remove";A||this._setFilterState(k,S),this.c
|
||
|
<div class="tui-image-editor-history-item history">
|
||
|
<div class="history-item-icon">
|
||
|
`.concat(h(["normal","active"],"history-".concat(S.toLowerCase()),!0),`
|
||
|
</div>
|
||
|
<span>
|
||
|
`)).call(l,n.localize(S),`
|
||
|
`)).call(r,T?"(".concat(n.localize(T),")"):"",`
|
||
|
</span>
|
||
|
<div class="history-item-checkbox">
|
||
|
`)).call(v,h(["normal"],"history-check",!0),`
|
||
|
</div>
|
||
|
</div>
|
||
|
`)};function vo(w){var v=po();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function po(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var mo="history-item",Mn="selected-item",Tn="disabled-item",yo=function(w){me(r,w);var v=vo(r);function r(l,n){var h,S=n.locale,T=n.makeSvgIcon;return Y(this,r),h=v.call(this,l,{name:"history"}),l.classList.add("enabled"),h.locale=S,h.makeSvgIcon=T,h._eventHandler={},h._historyIndex=h.getListLength(),h}return it(r,[{key:"add",value:function(n){var h=n.name,S=n.detail;this._hasDisabledItem()&&this.deleteListItemElement(this._historyIndex+1,this.getListLength());var T=go({locale:this.locale,makeSvgIcon:this.makeSvgIcon,name:h,detail:S}),k=this.makeListItemElement(T);this.pushListItemElement(k),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 n=this;this._eventHandler.history=function(h){return n._clickHistoryItem(h)},this.listElement.addEventListener("click",this._eventHandler.history)}},{key:"_removeHistoryEventListener",value:function(){this.listElement.removeEventListener("click",this._eventHandler.history)}},{key:"_clickHistoryItem",value:function(n){var h=n.target,S=h.closest(".".concat(mo));if(!!S){var T=uo()(S.getAttribute("data-index"),10);if(T!==this._historyIndex){var k=Math.abs(T-this._historyIndex);T<this._historyIndex?this._actions.undo(k):this._actions.redo(k)}}}},{key:"_selectItem",value:function(n){for(var h=0;h<this.getListLength();h+=1)this.removeClass(h,Mn),this.removeClass(h,Tn),h>n&&this.addClass(h,Tn);this.addClass(n,Mn)}},{key:"destroy",value:function(){this.removeEvent(),Ne(this)}},{key:"addEvent",value:function(n){this._actions=n,this._addHistoryEventListener()}},{key:"removeEvent",value:function(){this._removeHistoryEventListener()}}]),r}(fo),Co=yo,So=function(){function w(v){Y(this,w),this._locale=v}return it(w,[{key:"localize",value:function(r){return this._locale[r]||r}}]),w}(),xo=So,Io={Shape:ha,Crop:pa,Resize:xa,Flip:Ea,Rotate:Pa,Text:za,Mask:Ya,Icon:Va,Draw:to,Filter:lo},bo="1300",En="history",Mo="tie-panel-history",li="on",ci={ZOOM_IN:"zoomIn",HAND:"hand"},wn=function(){function w(v,r,l){Y(this,w),this.options=this._initializeOption(r),this._actions=l,this.submenu=!1,this.imageSize={},this.uiSize={},this._locale=new xo(this.options.locale),this.theme=new Kr(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(v),this._setUiSize(),this._initMenuEvent=!1,this._makeSubMenu(),this._attachHistoryEvent(),this._attachZoomEvent()}return it(w,[{key:"destroy",value:function(){this._removeUiEvent(),this._destroyAllMenu(),this._selectedElement.innerHTML="",Ne(this)}},{key:"setUiDefaultSelectionStyle",value:function(r){return G()({applyCropSelectionStyle:!0,applyGroupSelectionStyle:!0,selectionStyle:{cornerStyle:"circle",cornerSize:16,cornerColor:"#fff",cornerStrokeColor:"#fff",transparentCorners:!1,lineWidth:2,borderColor:"#fff"}},r)}},{key:"resizeEditor",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=r.uiSize,n=r.imageSize,h=n===void 0?this.imageSize:n;h!==this.imageSize&&(this.imageSize=h),l&&this._setUiSize(l);var
|
||
|
<tr><td class="dot left-top"></td><td></td><td class="dot right-top"></td></tr>
|
||
|
<tr><td></td><td></td><td></td></tr>
|
||
|
<tr><td class="dot left-bottom"></td><td></td><td class="dot right-bottom"></td></tr>
|
||
|
</table>`;n.innerHTML=h,this._editorContainerElement=this._editorElement.querySelector(".tui-image-editor-canvas-container"),this._editorContainerElement.appendChild(n)}},{key:"_getLoadImage",value:function(){return this.options.loadImage}},{key:"changeMenu",value:function(r){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;this._submenuChangeTransection||(this._submenuChangeTransection=!0,this._changeMenu(r,l,n),this._submenuChangeTransection=!1)}},{key:"_changeMenu",value:function(r,l,n){this.submenu&&(this._buttonElements[this.submenu].classList.remove("active"),this._mainElement.classList.remove("tui-image-editor-menu-".concat(this.submenu)),n&&this._actions.main.discardSelection(),this._actions.main.changeSelectableAll(!0),this[this.submenu].changeStandbyMode()),this.submenu===r&&l?this.submenu=null:(this._buttonElements[r].classList.add("active"),this._mainElement.classList.add("tui-image-editor-menu-".concat(r)),this.submenu=r,this[this.submenu].changeStartMode()),this.resizeEditor()}},{key:"_initMenu",value:function(){if(this.options.initMenu){var r=document.createEvent("MouseEvents");r.initEvent("click",!0,!1),this._buttonElements[this.options.initMenu].dispatchEvent(r)}this.icon&&this.icon.registerDefaultIcon()}},{key:"_getCanvasMaxDimension",value:function(){var r=this._editorContainerElement.style,l=r.maxWidth,n=r.maxHeight,h=Ve()(l),S=Ve()(n);return{width:h,height:S}}},{key:"_setEditorPosition",value:function(r){var l=this._getCanvasMaxDimension(),n=l.width,h=l.height,S=this._editorElement.style,T=0,k=0;this.submenu&&(r==="bottom"?h>this._editorElementWrap.scrollHeight-150?T=(h-this._editorElementWrap.scrollHeight)/2:T=150/2*-1:r==="top"?h>this._editorElementWrap.offsetHeight-150?T=150/2-(h-(this._editorElementWrap.offsetHeight-150))/2:T=150/2:r==="left"?n>this._editorElementWrap.offsetWidth-248?k=248/2-(n-(this._editorElementWrap.offsetWidth-248))/2:k=248/2:r==="right"&&(n>this._editorElementWrap.scrollWidth-248?k=(n-this._editorElementWrap.scrollWidth)/2:k=248/2*-1)),S.top="".concat(T,"px"),S.left="".concat(k,"px")}}]),w}();gt().mixin(wn);var To=wn,Eo=_(381),ei=_.n(Eo),Dn=function(){function w(){Y(this,w),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,
|