diff --git a/dist/bundle.js b/dist/bundle.js index b41b5ee1..0ab66d8c 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -1,4 +1,4 @@ -!function(e){var t={};function n(a){if(t[a])return t[a].exports;var r=t[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(a,r,function(t){return e[t]}.bind(null,r));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s=495)}([function(e,t,n){var a=n(6),r=n(29),i=n(21),o=n(20),s=n(28),l=function(e,t,n){var u,c,d,f,h=e&l.F,p=e&l.G,m=e&l.S,g=e&l.P,v=e&l.B,y=p?a:m?a[t]||(a[t]={}):(a[t]||{}).prototype,b=p?r:r[t]||(r[t]={}),_=b.prototype||(b.prototype={});for(u in p&&(n=t),n)d=((c=!h&&y&&void 0!==y[u])?y:n)[u],f=v&&c?s(d,a):g&&"function"==typeof d?s(Function.call,d):d,y&&o(y,u,d,e&l.U),b[u]!=d&&i(b,u,f),g&&_[u]!=d&&(_[u]=d)};a.core=r,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,e.exports=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={TRANSPARENCY:!1,TRANSPARENCY_TYPE:"squares",LANG:"en",WIDTH:null,HEIGHT:null,visible_width:null,visible_height:null,COLOR:"#008000",ALPHA:255,ZOOM:1,pixabay_key:"3ca2cd8af3fde33af218bea02-9021417",layers:[],layer:null,need_render:!1,mouse:{},themes:["dark","light","green"],TOOLS:[{name:"select",title:"Select object tool",attributes:{auto_select:!0}},{name:"selection",title:"Selection",attributes:{},on_leave:"on_leave"},{name:"brush",title:"Brush",attributes:{size:4,smart_brush:!0}},{name:"pencil",title:"Pencil",on_update:"on_params_update",attributes:{antialiasing:!0,size:2}},{name:"pick_color",title:"Pick Color",attributes:{global:!1}},{name:"erase",title:"Erase",on_update:"on_params_update",attributes:{size:30,circle:!0,strict:!0}},{name:"magic_wand",title:"Magic Wand Tool",attributes:{power:15,anti_aliasing:!0,contiguous:!1}},{name:"fill",title:"Fill",attributes:{power:5,anti_aliasing:!1,contiguous:!1}},{name:"line",title:"Line",attributes:{size:1,type:{value:"Simple",values:["Simple","Arrow"]}}},{name:"rectangle",title:"Rectangle",attributes:{size:1,radius:0,fill:!0,square:!1}},{name:"circle",title:"Circle",attributes:{size:1,fill:!0,circle:!1}},{name:"media",title:"Search images",on_activate:"on_activate",attributes:{size:30}},{name:"text",title:"Text",attributes:{size:40,bold:!1,italic:!1,stroke:!1,align:{value:"Left",values:["Left","Center","Right"]},family:{value:"Arial",values:["Arial","Courier","Impact","Helvetica","monospace","Times New Roman","Verdana"]},stroke_size:1}},{name:"gradient",title:"Gradient",attributes:{color_1:"#008000",color_2:"#ffffff",alpha:0,radial:!1,radial_power:50}},{name:"clone",title:"Clone tool",attributes:{size:30,anti_aliasing:!0,source_layer:{value:"Current",values:["Current","Previous"]}}},{name:"crop",title:"Crop",on_update:"on_params_update",on_leave:"on_leave",attributes:{crop:!0}},{name:"blur",title:"Blur tool",attributes:{size:30,strength:1}},{name:"sharpen",title:"Sharpen tool",attributes:{size:30}},{name:"desaturate",title:"Desaturate",attributes:{size:50,anti_aliasing:!0}},{name:"bulge_pinch",title:"Bulge/Pinch tool",attributes:{radius:80,power:50,bulge:!0}},{name:"animation",title:"Play animation",on_update:"on_params_update",on_leave:"on_leave",attributes:{play:!1,delay:400}}]};a.TOOL=a.TOOLS[2],t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r=function(){function e(e,t){for(var n=0;n=0;o--){var s=r[o];this.ctx.globalAlpha=s.opacity/100,this.ctx.globalCompositeOperation=s.composition,this.render_object(this.ctx,s)}this.Base_gui.draw_grid(this.ctx),this.Base_selection.draw_selection(),this.render_preview(r),this.after_render(),this.last_zoom=i.default.ZOOM,this.Base_gui.GUI_details.render_details()}requestAnimationFrame(function(){t.render(e)})}else i.default.need_render=!0}},{key:"render_preview",value:function(e){var t=this.Base_gui.GUI_preview.PREVIEW_SIZE.w,n=this.Base_gui.GUI_preview.PREVIEW_SIZE.h;this.ctx_preview.save(),this.ctx_preview.clearRect(0,0,t,n),this.ctx_preview.scale(t/i.default.WIDTH,n/i.default.HEIGHT);for(var a=e.length-1;a>=0;a--){var r=e[a];0!=r.visible&&(null!=r.type&&(this.ctx_preview.globalAlpha=r.opacity/100,this.ctx_preview.globalCompositeOperation=r.composition,this.render_object(this.ctx_preview,r)))}this.ctx_preview.restore(),this.Base_gui.GUI_preview.render_preview_active_zone()}},{key:"render_object",value:function(e,t){if(0!=t.visible&&null!=t.type){var n="";for(var a in t.filters){var r=t.filters[a];""!=n&&(n+=" "),n+=r.name+"("+r.params.value+")"}if(e.filter=""!=n?n:"none","image"==t.type){e.save(),e.translate(t.x+t.width/2,t.y+t.height/2),e.rotate(t.rotate*Math.PI/180),void 0!=t.link_canvas&&null!=t.link_canvas?e.drawImage(t.link_canvas,-t.width/2,-t.height/2,t.width,t.height):e.drawImage(t.link,-t.width/2,-t.height/2,t.width,t.height),e.restore()}else{var i=t.render_function[0],o=t.render_function[1];this.Base_gui.GUI_tools.tools_modules[i][o](e,t)}e.filter="none"}}},{key:"insert",value:function(){var e,t=(e=regeneratorRuntime.mark(function e(t){var n,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=this,e.abrupt("return",new Promise(function(e,o){var s=!1,l=!1,u={id:n.auto_increment,parent_id:0,name:n.Helper.ucfirst(i.default.TOOL.name)+" #"+n.auto_increment,type:null,link:null,x:0,y:0,width:0,width_original:null,height:0,height_original:null,visible:!0,is_vector:!1,opacity:100,order:n.auto_increment,composition:"source-over",rotate:0,data:null,params:{},status:null,color:i.default.COLOR,filters:[],render_function:null};for(var c in t)void 0!==u[c]?u[c]=t[c]:f.default.error("Error: wrong key: "+c);if("image"==u.type&&(1==i.default.layers.length&&0==i.default.layer.width&&0==i.default.layer.height&&null==i.default.layer.data&&n.delete(i.default.layer.id,!0),null==u.link&&("object"==a(u.data)?(0==u.width&&(u.width=u.data.width),0==u.height&&(u.height=u.data.height),u.link=u.data.cloneNode(!0),u.link.onload=function(){i.default.need_render=!0},u.data=null,l=!0):"string"==typeof u.data?(s=!0,u.link=new Image,u.link.onload=function(){0==u.width&&(u.width=u.link.width),0==u.height&&(u.height=u.link.height),null==u.width_original&&(u.width_original=u.width),null==u.height_original&&(u.height_original=u.height),u.data=null,n.autoresize(u.width,u.height,u.id,r),n.render(),u.link.onload=function(){i.default.need_render=!0},e(!0)},u.link.src=u.data):f.default.error("Error: can not load image."))),void 0!=t&&i.default.layers.length>0&&0==i.default.layer.width&&0==i.default.layer.height&&null==i.default.layer.data&&"image"!=u.type&&!1!==r)for(var c in u)"id"!=c&&"name"!=c&&"order"!=c&&(i.default.layer[c]=u[c]);else i.default.layers.push(u),i.default.layer=n.get_layer(u.id),n.auto_increment++,null==i.default.layer&&(i.default.layer=i.default.layers[0]);u.id>=n.auto_increment&&(n.auto_increment=u.id+1),1==l&&n.autoresize(i.default.layer.width,i.default.layer.height),n.render(),n.Base_gui.GUI_layers.render_layers(),0==s&&e(!0)}));case 2:case"end":return e.stop()}},e,this)}),function(){var t=e.apply(this,arguments);return new Promise(function(e,n){return function a(r,i){try{var o=t[r](i),s=o.value}catch(e){return void n(e)}if(!o.done)return Promise.resolve(s).then(function(e){a("next",e)},function(e){a("throw",e)});e(s)}("next")})});return function(e){return t.apply(this,arguments)}}()},{key:"autoresize",value:function(e,t,n){var a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=this,o=!1;if(void 0==n&&(n=i.default.layer),e>i.default.WIDTH||t>i.default.HEIGHT){var s=document.getElementById("main_wrapper"),l=s.clientWidth,u=s.clientHeight;(e>l||t>u)&&(o=!0),e>i.default.WIDTH&&(i.default.WIDTH=parseInt(e)),t>i.default.HEIGHT&&(i.default.HEIGHT=parseInt(t))}if(1==i.default.layers.length&&!1!==a&&(e=0;t--)this.delete(i.default.layers[t].id,!0);if(this.auto_increment=1,void 0!=e&&!0===e){this.insert({})}this.render(),this.Base_gui.GUI_layers.render_layers()}},{key:"toggle_visibility",value:function(e){e=parseInt(e);var t=this.get_layer(e);0==t.visible?t.visible=!0:t.visible=!1,this.render(),this.Base_gui.GUI_layers.render_layers()}},{key:"refresh_gui",value:function(){this.Base_gui.GUI_layers.render_layers()}},{key:"select",value:function(e){e=parseInt(e),i.default.layer=this.get_layer(e),this.Base_selection.reset_selection(),this.render(),this.Base_gui.GUI_layers.render_layers()}},{key:"set_opacity",value:function(e,t){e=parseInt(e),((t=parseInt(t))<0||t>100)&&(t=100),this.get_layer(e).opacity=t}},{key:"layer_clear",value:function(e){e=parseInt(e);var t=this.get_layer(e);t.data=null,t.x=0,t.y=0,t.width=0,t.height=0}},{key:"move",value:function(e,t){e=parseInt(e);var n=this.get_layer(e);if(t<0)var a=this.find_previous(e);else a=this.find_next(e);if(null!=a){var r=n.order;n.order=a.order,a.order=r}this.render(),this.Base_gui.GUI_layers.render_layers()}},{key:"get_sorted_layers",value:function(){return i.default.layers.concat().sort(function(e,t){return t.order-e.order})}},{key:"is_layer_empty",value:function(e){var t=this.get_layer(e);return 0==t.width&&0==t.height&&null==t.data}},{key:"find_next",value:function(e){e=parseInt(e);for(var t=this.get_layer(e),n=this.get_sorted_layers(),a=null,r=n.length-1;r>=0;r--){var i=n[r];if(null!=a&&a.id==t.id)return i;a=i}return null}},{key:"find_previous",value:function(e){e=parseInt(e);var t=this.get_layer(e),n=this.get_sorted_layers(),a=null;for(var r in n){var i=n[r];if(null!=a&&a.id==t.id)return i;a=i}return null}},{key:"get_world_coords",value:function(e,t){return c.default.toWorld(e,t)}},{key:"add_filter",value:function(e,t,n){null==e&&(e=i.default.layer.id);var a=this.get_layer(e),r={id:this.Helper.getRandomInt(1,999999999),name:t,params:n};a.filters.push(r),i.default.need_render=!0,this.Base_gui.GUI_layers.render_layers()}},{key:"delete_filter",value:function(e,t){null==e&&(e=i.default.layer.id);var n=this.get_layer(e);for(var a in n.filters)n.filters[a].id==t&&n.filters.splice(a,1);i.default.need_render=!0,this.Base_gui.GUI_layers.render_layers()}},{key:"convert_layers_to_canvas",value:function(e,t){for(var n=this.get_sorted_layers(),a=n.length-1;a>=0;a--){var r=n[a];0!=r.visible&&null!=r.type&&(void 0!=t&&r.id!=t||(e.globalAlpha=r.opacity/100,e.globalCompositeOperation=r.composition,this.render_object(e,r)))}}},{key:"convert_layer_to_canvas",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments[2];null==t&&(t=!1),null==e&&(e=i.default.layer.id);var a=this.get_layer(e),r=0,o=0,s=document.createElement("canvas");if(!0===t&&"image"==a.type?(s.width=a.width_original,s.height=a.height_original,n=!1):(s.width=Math.max(a.width,i.default.WIDTH),s.height=Math.max(a.height,i.default.HEIGHT)),!0===t&&"image"==a.type?s.getContext("2d").drawImage(a.link,0,0):this.render_object(s.getContext("2d"),a),(1==n||void 0==n)&&null!=a.type){var l=this.Image_trim.get_trim_info(e);if(l.left>0||l.top>0||l.right>0||l.bottom>0){r=l.left,o=l.top;var u=s.width-l.left-l.right,c=s.height-l.top-l.bottom;u>1&&c>1&&this.Helper.change_canvas_size(s,u,c,r,o)}}return s.dataset.x=r,s.dataset.y=o,s}},{key:"update_layer_image",value:function(e,t){null==t&&(t=i.default.layer.id);var n=this.get_layer(t);if("image"!=n.type)return f.default.error("Error: layer must be image."),null;0==this.Helper.is_edge_or_ie()?e.toBlob(function(e){n.link.src=window.URL.createObjectURL(e),i.default.need_render=!0},"image/png"):n.link.src=e.toDataURL(),i.default.need_render=!0}},{key:"get_dimensions",value:function(){return{width:i.default.WIDTH,height:i.default.HEIGHT}}}]),e}();t.default=m},function(e,t,n){var a;/*! alertifyjs - v1.11.1 - Mohammad Younes (http://alertifyjs.com) */!function(n){"use strict";function r(e,t){e.className+=" "+t}function i(e,t){for(var n=e.className.split(" "),a=t.split(" "),r=0;r-1&&n.splice(i,1)}e.className=n.join(" ")}function o(){return"rtl"===n.getComputedStyle(document.body).direction}function s(){return document.documentElement&&document.documentElement.scrollTop||document.body.scrollTop}function l(){return document.documentElement&&document.documentElement.scrollLeft||document.body.scrollLeft}function u(e){for(;e.lastChild;)e.removeChild(e.lastChild)}function c(e){if(null===e)return e;var t;if(Array.isArray(e)){t=[];for(var n=0;n0){for(var n=[],a=0;a=0?(i(document.body,pe.noOverflow),w(!1)):e>0&&document.body.className.indexOf(pe.noOverflow)<0&&(w(!0),r(document.body,pe.noOverflow))}function w(e){k.defaults.preventBodyShift&&document.documentElement.scrollHeight>document.documentElement.clientHeight&&(e?(ge=ue,me=n.getComputedStyle(document.body).top,r(document.body,pe.fixed),document.body.style.top=-ue+"px"):(ue=ge,document.body.style.top=me,i(document.body,pe.fixed),a()))}function x(e,t){for(var n=v.indexOf(t)+1;n-1?(D(t,function(e){return e.key===n}),!1):void 0}ye=!1}function z(e){var t=v[v.length-1],n=e.keyCode;if(n===m.LEFT||n===m.RIGHT){for(var a=t.__internal.buttons,r=0;rm.F1-1&&ce.indexOf(n)>-1)return e.preventDefault(),e.stopPropagation(),D(t,function(e){return e.key===n}),!1}function N(e,t){if(t)t.focus();else{var n=e.__internal.focus,a=n.element;switch(typeof n.element){case"number":e.__internal.buttons.length>n.element&&(a=!0===e.get("basic")?e.elements.reset[0]:e.__internal.buttons[n.element].element);break;case"string":a=e.elements.body.querySelector(n.element);break;case"function":a=n.element.call(e)}void 0!==a&&null!==a||0!==e.__internal.buttons.length||(a=e.elements.reset[0]),a&&a.focus&&(a.focus(),n.select&&a.select&&a.select())}}function F(e,t){if(!t)for(var n=v.length-1;n>-1;n-=1)if(v[n].isModal()){t=v[n];break}if(t&&t.isModal()){var a,r=e.srcElement||e.target,i=r===t.elements.reset[1]||0===t.__internal.buttons.length&&r===document.body;i&&(t.get("maximizable")?a=t.elements.commands.maximize:t.get("closable")&&(a=t.elements.commands.close)),void 0===a&&("number"==typeof t.__internal.focus.element?r===t.elements.reset[0]?a=t.elements.buttons.auxiliary.firstChild||t.elements.buttons.primary.firstChild:i&&(a=t.elements.reset[0]):r===t.elements.reset[0]&&(a=t.elements.buttons.primary.lastChild||t.elements.buttons.auxiliary.lastChild)),N(t,a)}}function G(e,t){clearTimeout(t.__internal.timerIn),N(t),a(),ye=!1,p("onfocus",t),b(t.elements.dialog,_.type,t.__internal.transitionInHandler),i(t.elements.root,pe.animationIn)}function U(e,t){clearTimeout(t.__internal.timerOut),b(t.elements.dialog,_.type,t.__internal.transitionOutHandler),X(t),$(t),t.isMaximized()&&!t.get("startMaximized")&&M(t),k.defaults.maintainFocus&&t.__internal.activeElement&&(t.__internal.activeElement.focus(),t.__internal.activeElement=null),"function"==typeof t.__internal.destroy&&t.__internal.destroy.apply(t)}function W(e,t){var n=e[xe]-_e,a=e[ke]-we;Ee&&(a-=document.body.scrollTop),t.style.left=n+"px",t.style.top=a+"px"}function V(e,t){var n=e[xe]-_e,a=e[ke]-we;Ee&&(a-=document.body.scrollTop),t.style.left=Math.min(Se.maxLeft,Math.max(Se.minLeft,n))+"px",t.style.top=Ee?Math.min(Se.maxTop,Math.max(Se.minTop,a))+"px":Math.max(Se.minTop,a)+"px"}function Y(e,t){if(null===Pe&&!t.isMaximized()&&t.get("movable")){var n,a=0,i=0;if("touchstart"===e.type?(e.preventDefault(),n=e.targetTouches[0],xe="clientX",ke="clientY"):0===e.button&&(n=e),n){var o=t.elements.dialog;if(r(o,pe.capture),o.style.left&&(a=parseInt(o.style.left,10)),o.style.top&&(i=parseInt(o.style.top,10)),_e=n[xe]-a,we=n[ke]-i,t.isModal()?we+=t.elements.modal.scrollTop:t.isPinned()&&(we-=document.body.scrollTop),t.get("moveBounded")){var s=o,l=-a,u=-i;do{l+=s.offsetLeft,u+=s.offsetTop}while(s=s.offsetParent);Se={maxLeft:l,minLeft:-l,maxTop:document.documentElement.clientHeight-o.clientHeight-u,minTop:-u},Ce=V}else Se=null,Ce=W;return p("onmove",t),Ee=!t.isModal()&&t.isPinned(),be=t,Ce(n,o),r(document.body,pe.noSelection),!1}}}function q(e){var t;be&&("touchmove"===e.type?(e.preventDefault(),t=e.targetTouches[0]):0===e.button&&(t=e),t&&Ce(t,be.elements.dialog))}function Z(){if(be){var e=be;be=Se=null,i(document.body,pe.noSelection),i(e.elements.dialog,pe.capture),p("onmoved",e)}}function X(e){be=null;var t=e.elements.dialog;t.style.left=t.style.top=""}function J(e,t){var n;if(!t.isMaximized()&&("touchstart"===e.type?(e.preventDefault(),n=e.targetTouches[0]):0===e.button&&(n=e),n)){p("onresize",t),Pe=t,Me=t.elements.resizeHandle.offsetHeight/2;var a=t.elements.dialog;return r(a,pe.capture),Te=parseInt(a.style.left,10),a.style.height=a.offsetHeight+"px",a.style.minHeight=t.elements.header.offsetHeight+t.elements.footer.offsetHeight+"px",a.style.width=(Oe=a.offsetWidth)+"px","none"!==a.style.maxWidth&&(a.style.minWidth=(Ie=a.offsetWidth)+"px"),a.style.maxWidth="none",r(document.body,pe.noSelection),!1}}function K(e){var t;Pe&&("touchmove"===e.type?(e.preventDefault(),t=e.targetTouches[0]):0===e.button&&(t=e),t&&function(e,t,n){var a,r,i=t,s=0,l=0;do{s+=i.offsetLeft,l+=i.offsetTop}while(i=i.offsetParent);!0===n?(a=e.pageX,r=e.pageY):(a=e.clientX,r=e.clientY);var u=o();if(u&&(a=document.body.offsetWidth-a,isNaN(Te)||(s=document.body.offsetWidth-s-t.offsetWidth)),t.style.height=r-l+Me+"px",t.style.width=a-s+Me+"px",!isNaN(Te)){var c=.5*Math.abs(t.offsetWidth-Oe);u&&(c*=-1),t.offsetWidth>Oe?t.style.left=Te+c+"px":t.offsetWidth>=Ie&&(t.style.left=Te-c+"px")}}(t,Pe.elements.dialog,!Pe.get("modal")&&!Pe.get("pinned")))}function Q(){if(Pe){var e=Pe;Pe=null,i(document.body,pe.noSelection),i(e.elements.dialog,pe.capture),ve=!0,p("onresized",e)}}function $(e){Pe=null;var t=e.elements.dialog;"none"===t.style.maxWidth&&(t.style.maxWidth=t.style.minWidth=t.style.width=t.style.height=t.style.minHeight=t.style.left="",Te=Number.Nan,Oe=Ie=Me=0)}function ee(){for(var e=0;e-1&&n.navigator.userAgent.indexOf("Chrome")<0,he={dimmer:'
',modal:'
',dialog:'
',reset:'',commands:'
',header:'
',body:'
',content:'
',footer:'',buttons:{primary:'
',auxiliary:'
'},button:'',resizeHandle:'
'},pe={animationIn:"ajs-in",animationOut:"ajs-out",base:"alertify",basic:"ajs-basic",capture:"ajs-capture",closable:"ajs-closable",fixed:"ajs-fixed",frameless:"ajs-frameless",hidden:"ajs-hidden",maximize:"ajs-maximize",maximized:"ajs-maximized",maximizable:"ajs-maximizable",modeless:"ajs-modeless",movable:"ajs-movable",noSelection:"ajs-no-selection",noOverflow:"ajs-no-overflow",noPadding:"ajs-no-padding",pin:"ajs-pin",pinnable:"ajs-pinnable",prefix:"ajs-",resizable:"ajs-resizable",restore:"ajs-restore",shake:"ajs-shake",unpinned:"ajs-unpinned"},me="",ge=0,ve=!1,ye=!1,be=null,_e=0,we=0,xe="pageX",ke="pageY",Se=null,Ee=!1,Ce=null,Pe=null,Te=Number.Nan,Oe=0,Ie=0,Me=0;return{__init:e,isOpen:function(){return this.__internal.isOpen},isModal:function(){return this.elements.root.className.indexOf(pe.modeless)<0},isMaximized:function(){return this.elements.root.className.indexOf(pe.maximized)>-1},isPinned:function(){return this.elements.root.className.indexOf(pe.unpinned)<0},maximize:function(){return this.isMaximized()||I(this),this},restore:function(){return this.isMaximized()&&M(this),this},pin:function(){return this.isPinned()||T(this),this},unpin:function(){return this.isPinned()&&O(this),this},bringToFront:function(){return x(0,this),this},moveTo:function(e,t){if(!isNaN(e)&&!isNaN(t)){p("onmove",this);var n=this.elements.dialog,a=n,r=0,i=0;n.style.left&&(r-=parseInt(n.style.left,10)),n.style.top&&(i-=parseInt(n.style.top,10));do{r+=a.offsetLeft,i+=a.offsetTop}while(a=a.offsetParent);var s=e-r,l=t-i;o()&&(s*=-1),n.style.left=s+"px",n.style.top=l+"px",p("onmoved",this)}return this},resizeTo:function(e,t){var n=parseFloat(e),a=parseFloat(t),r=/(\d*\.\d+|\d+)%/;if(!isNaN(n)&&!isNaN(a)&&!0===this.get("resizable")){p("onresize",this),(""+e).match(r)&&(n=n/100*document.documentElement.clientWidth),(""+t).match(r)&&(a=a/100*document.documentElement.clientHeight);var i=this.elements.dialog;"none"!==i.style.maxWidth&&(i.style.minWidth=(Ie=i.offsetWidth)+"px"),i.style.maxWidth="none",i.style.minHeight=this.elements.header.offsetHeight+this.elements.footer.offsetHeight+"px",i.style.width=n+"px",i.style.height=a+"px",p("onresized",this)}return this},setting:function(e,t){var n=this,a=E(this,this.__internal.options,function(e,t,a){S(n,e,t,a)},e,t);if("get"===a.op)return a.found?a.value:void 0!==this.settings?E(this,this.settings,this.settingUpdated||function(){},e,t).value:void 0;if("set"===a.op){if(a.items.length>0)for(var r=this.settingUpdated||function(){},i=0;i0){var t=this;this.__internal.timer=setTimeout(function(){t.dismiss()},1e3*this.__internal.delay)}return this},setContent:function(e){if("string"==typeof e?(u(this.element),this.element.innerHTML=e):e instanceof n.HTMLElement&&this.element.firstChild!==e&&(u(this.element),this.element.appendChild(e)),this.__internal.closeButton){var t=document.createElement("span");r(t,d.close),t.setAttribute("data-close",!0),this.element.appendChild(t)}return this},dismissOthers:function(){return x.dismissAll(this),this}})}var l,c=[],d={base:"alertify-notifier",message:"ajs-message",top:"ajs-top",right:"ajs-right",bottom:"ajs-bottom",left:"ajs-left",center:"ajs-center",visible:"ajs-visible",hidden:"ajs-hidden",close:"ajs-close"};return{setting:function(t,n){if(e(this),void 0===n)return this.__internal[t];switch(t){case"position":this.__internal.position=n,o(this);break;case"delay":this.__internal.delay=n}return this},set:function(e,t){return this.setting(e,t),this},get:function(e){return this.setting(e)},create:function(t,n){e(this);var a=document.createElement("div");return a.className=d.message+("string"==typeof t&&""!==t?" ajs-"+t:""),s(a,n)},dismissAll:function(e){for(var t=c.slice(0),n=0;n',t+='',t+='
',t+='\t',t+='\t',t+="
",t+=""),n+=this.generateParamsHtml(),document.getElementById("popup").innerHTML='\n\t
\n\t\n\t\n\t
\n\t\t
\n\t\t
\n\t
\n\t
\n\t\t\n\t\t\n\t
\n',document.getElementById("pretitle_area").innerHTML=e,document.getElementById("popup_title").innerHTML=this.title,document.getElementById("popup_comment").innerHTML=this.comment,document.getElementById("preview_content").innerHTML=t,document.getElementById("params_content").innerHTML=n,0!=this.onfinish?document.getElementById("popup_cancel").style.display="":document.getElementById("popup_cancel").style.display="none",document.getElementById("popup").style.display="block",document.getElementById("popup").className=this.className;var a=this;document.getElementById("popup_ok").addEventListener("click",function(e){a.save()}),document.getElementById("popup_cancel").addEventListener("click",function(e){a.cancel()});for(var r=document.querySelectorAll("#popup input"),i=0;i',"Error"!=s&&void 0!=n.title&&(e+=''+n.title+""),void 0!=n.name){if(void 0!=n.values)if(n.values.length>10||"select"==n.type){e+='"}else{e+='',n.values.length>2&&(e+='
');a=0;for(var r in n.values){var o="";n.value==n.values[r]&&(o='checked="checked"'),void 0==n.value&&0==a&&(o='checked="checked"');var s=n.values[r],l=n.values[r].split(" - ");l.length>1&&(s=l[0]+' - '+l[1]+""),e+='',e+='",n.values.length>2&&(e+="
"),a++}n.values.length>2&&(e+="
"),e+=""}else if(void 0!=n.value){var u=1;if(void 0!=n.step&&(u=n.step),void 0!=n.range)e+='',e+=''+n.value+"";else if("color"==n.type)e+='';else if("boolean"==typeof n.value){var c="";!0===n.value&&(c="checked"),e+=' '}else if(void 0==n.placeholder&&(n.placeholder=""),"textarea"==n.type)e+='";else{var d="text";void 0==n.placeholder||""==n.placeholder||isNaN(n.placeholder)||(d="number"),void 0!=n.value&&"number"==typeof n.value&&(d="number"),e+=''}}}else if(void 0!=n.function){e+=''+n.function()+""}else if(void 0!=n.html)e+=''+n.html+"";else if(void 0==n.title)e+='';else{var f=""+n.value,h=n.title.toLowerCase().replace(/[^\w]+/g,"").replace(/ +/g,"-");h=h.substring(0,10),e+=f.length<40?'
'+n.value+"
":'"}e+=""}return e+=""}},{key:"validate",value:function(e){for(var t in this.parameters){var n=this.parameters[t];if("pop_data_"+n.name==e.id&&void 0!=n.range){if("-"==e.value||""==e.value)return!0;var a=parseFloat(e.value);(isNaN(a)||a!=e.value)&&(e.value=n.value),an.range[1]&&(e.value=n.range[1])}}}},{key:"onkeyup",value:function(e){"13"==e.keyCode&&this.save()}},{key:"get_dimensions",value:function(){var e,t;return window.innerWidth?e=window.innerWidth:document.documentElement&&document.documentElement.clientWidth?e=document.documentElement.clientWidth:document.body&&(e=document.body.clientWidth),window.innerHeight?t=window.innerHeight:document.documentElement&&document.documentElement.clientHeight?t=document.documentElement.clientHeight:document.body&&(t=document.body.clientHeight),[e,t]}},{key:"getRandomInt",value:function(e,t){return Math.floor(Math.random()*(t-e+1))+e}},{key:"strpos",value:function(e,t,n){var a=(e+"").indexOf(t,n||0);return-1!==a&&a}},{key:"draw_background",value:function(e,t,n,a,i){if(0==r.default.TRANSPARENCY&&void 0==i)return e.beginPath(),e.rect(0,0,t,n),e.fillStyle="#ffffff",e.fill(),!1;void 0==a&&(a=10);for(var o=!0,s=0;s-1||(e[t]=this.Base_gui.modules[t]);return e}},{key:"render_effect_browser",value:function(){if(0==this.effects)return"";var e="",t=this.get_effects_list(),n=!1;for(var a in this.ef_index=null,this.ef_next_index=null,this.ef_prev_index=null,t){if(1==n){this.ef_next_index=a;break}(r=this.get_filter_title(a)).toLowerCase()!=this.title.toLowerCase()?this.ef_prev_index=a:(this.ef_index=a,n=!0)}for(var a in e+='',e+=' ',e+='",e+=' ',e+=""}},{key:"add_effects_browser_events",value:function(){if(0!=this.effects){var e=this,t=this.get_effects_list(),n=this.ef_prev_index,a=this.ef_next_index;document.getElementById("previous_filter").disabled=!1,document.getElementById("next_filter").disabled=!1,null==n&&(document.getElementById("previous_filter").disabled=!0),null==a&&(document.getElementById("next_filter").disabled=!0),document.getElementById("previous_filter").addEventListener("click",function(a){e.hide();var r=n.toLowerCase().replace(/ /g,"_").replace("effects/","");t[n][r]()}),document.getElementById("next_filter").addEventListener("click",function(n){e.hide();var r=a.toLowerCase().replace(/ /g,"_").replace("effects/","");t[a][r]()});var r=document.getElementById("effect_browser");r.addEventListener("change",function(n){e.hide();var a=r.options[r.selectedIndex].value,i=a.toLowerCase().replace(/ /g,"_").replace("effects/","");t[a][i]()})}}},{key:"get_filter_title",value:function(e){var t=e.replace("effects/","").replace(/_/g," ");return"negative"==t&&(t="invert"),t}}]),e}();t.default=c},function(e,t,n){var a=n(9);e.exports=function(e){if(!a(e))throw TypeError(e+" is not an object!");return e}},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n0){var t=document.cookie.indexOf(e+"=");if(-1!=t){t+=e.length+1;var n=document.cookie.indexOf(";",t);return-1==n&&(n=document.cookie.length),document.cookie.substring(t,n)}}return""}},{key:"_setCookie",value:function(e,t,n){void 0==n&&(n=180);var a=new Date;a.setTime(a.getTime()+24*n*3600*1e3),document.cookie=e+"="+t+(null==n?"":"; expires="+a.toGMTString())}},{key:"delCookie",value:function(e){this.getCookie(e)&&(document.cookie=e+"=; expires=Thu, 01-Jan-70 00:00:01 GMT")}},{key:"getRandomInt",value:function(e,t){return Math.floor(Math.random()*(t-e+1))+e}},{key:"font_pixel_to_height",value:function(e){return Math.round(.75*e)}},{key:"rgbToHex",value:function(e,t,n){if(e>255||t>255||n>255)throw"Invalid color component";return"#"+("000000"+(e<<16|t<<8|n).toString(16)).slice(-6)}},{key:"rgb2hex_all",value:function(e){return e=e.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/),"#"+this.hex(e[1])+this.hex(e[2])+this.hex(e[3])}},{key:"hex",value:function(e){return("0"+(e=parseInt(e)).toString(16)).slice(-2)}},{key:"hex2rgb",value:function(e){if("#"==e[0]&&(e=e.substr(1)),3==e.length){var t=e;e="",t=/^([a-f0-9])([a-f0-9])([a-f0-9])$/i.exec(t).slice(1);for(var n=0;n<3;n++)e+=t[n]+t[n]}var a=/^([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i.exec(e).slice(1);return{r:parseInt(a[0],16),g:parseInt(a[1],16),b:parseInt(a[2],16),a:255}}},{key:"remove_selection",value:function(){window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty()}},{key:"darkenColor",value:function(e,t){e.length>6&&(e=e.substring(1,e.length));var n=parseInt(e,16),a=Math.abs((n>>16&255)+t);a>255&&(a-=a-255);var r=Math.abs((n>>8&255)+t);r>255&&(r-=r-255);var i=Math.abs((255&n)+t);return i>255&&(i-=i-255),1==(a=Number(a<0||isNaN(a))?0:(a>255?255:a).toString(16)).length&&(a="0"+a),1==(r=Number(r<0||isNaN(r))?0:(r>255?255:r).toString(16)).length&&(r="0"+r),1==(i=Number(i<0||isNaN(i))?0:(i>255?255:i).toString(16)).length&&(i="0"+i),"#"+a+r+i}},{key:"number_format",value:function(e,t,n,a){t=isNaN(t=Math.abs(t))?2:t,a=void 0==a?".":a,n=void 0==n?",":n;var r=e<0?"-":"",i=parseInt(e=Math.abs(+e||0).toFixed(t))+"",o=(o=i.length)>3?o%3:0;return r+(o?i.substr(0,o)+n:"")+i.substr(o).replace(/(\d{3})(?=\d)/g,"$1"+n)+(t?a+Math.abs(e-i).toFixed(t).slice(2):"")}},{key:"chech_input_color_support",value:function(){var e=document.createElement("input");return e.setAttribute("type","color"),"text"!==e.type}},{key:"b64toBlob",value:function(e,t,n){t=t||"",n=n||512;for(var a=atob(e),r=[],i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}},{key:"isNumeric",value:function(e){return!isNaN(parseFloat(e))&&isFinite(e)}},{key:"hslToRgb",value:function(e,t,n){var a,r,i;if(0==t)a=r=i=n;else{var o=n<.5?n*(1+t):n+t-n*t,s=2*n-o;a=this.hue2rgb(s,o,e+1/3),r=this.hue2rgb(s,o,e),i=this.hue2rgb(s,o,e-1/3)}return[Math.round(255*a),Math.round(255*r),Math.round(255*i)]}},{key:"hue2rgb",value:function(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}},{key:"rgbToHsl",value:function(e,t,n){e/=255,t/=255,n/=255;var a,r,i=Math.max(e,t,n),o=Math.min(e,t,n),s=(i+o)/2;if(i==o)a=r=0;else{var l=i-o;switch(r=s>.5?l/(2-i-o):l/(i+o),i){case e:a=(t-n)/l+(t6&&void 0!==arguments[6]&&arguments[6],s=document.createElement("canvas");s.width=a,s.height=r;var l=Math.round(a/2),u=Math.round(r/2),c=s.getContext("2d"),d=s.width,f=s.height,h=t-l,p=n-u;c.clearRect(0,0,d,f),c.save(),c.putImageData(i,0,0),c.globalCompositeOperation="destination-in";var m=c.createRadialGradient(l,u,0,l,u,l);m.addColorStop(0,"#ffffff"),1==o?m.addColorStop(.8,"#ffffff"):m.addColorStop(.99,"#ffffff"),m.addColorStop(1,"rgba(255,255,255,0"),c.fillStyle=m,c.beginPath(),c.ellipse(l,u,2*a,2*r,0,0,2*Math.PI),c.fill(),e.drawImage(s,0,0,a,r,h,p,a,r),c.restore(),c.clearRect(0,0,d,f)}},{key:"is_edge_or_ie",value:function(){return!window.ActiveXObject&&"ActiveXObject"in window||-1!=navigator.userAgent.indexOf("Edge/")}}]),e}();t.default=r},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var a=n(80)("wks"),r=n(50),i=n(6).Symbol,o="function"==typeof i;(e.exports=function(e){return a[e]||(a[e]=o&&i[e]||(o?i:r)("Symbol."+e))}).store=a},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n15?i+=2:i-=2,i=Math.max(0,i),i=Math.min(30,i)}},{key:"get_params_hash",value:function(){var e=[this.getParams(),r.default.COLOR,r.default.ALPHA];return JSON.stringify(e)}},{key:"clone",value:function(e){return JSON.parse(JSON.stringify(e))}},{key:"show_mouse_cursor",value:function(e,t,n,a){var i=this.Base_layers.get_world_coords(0,0);e-=i.x,t-=i.y;var o=document.getElementById("mouse");n*=r.default.ZOOM,e*=r.default.ZOOM,t*=r.default.ZOOM,n<5?o.className="":(o.style.width=n+"px",o.style.height=n+"px",o.style.left=e-Math.ceil(n/2)+"px",o.style.top=t-Math.ceil(n/2)+"px",o.className="",o.classList.add(a))}},{key:"getParams",value:function(){return r.default.TOOL.attributes}},{key:"adaptSize",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"width";return null==r.default.layer.width_original?e:"width"===t?e/(r.default.layer.width/r.default.layer.width_original):e/(r.default.layer.height/r.default.layer.height_original)}}]),t}();t.default=s}).call(this,n(53))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,r={};r.utils={initSampleCanvas:function(){var e=document.createElement("canvas"),t=e.getContext("2d");e.width=0,e.height=0,this.getSampleCanvas=function(){return e},this.getSampleContext=function(){return t},this.createImageData=t.createImageData?function(e,n){return t.createImageData(e,n)}:function(e,t){return new ImageData(e,t)}},getSampleCanvas:function(){return this.initSampleCanvas(),this.getSampleCanvas()},getSampleContext:function(){return this.initSampleCanvas(),this.getSampleContext()},createImageData:function(e,t){return this.initSampleCanvas(),this.createImageData(e,t)},clamp:function(e){return e>255?255:e<0?0:e},buildMap:function(e){for(var t,n=[],a=0;a<256;a+=1)n[a]=(t=e(a))>255?255:t<0?0:0|t;return n},applyMap:function(e,t,n){for(var a=0,r=e.length;a=n||t<0||t>=a)switch(r){case 1:e=e<0?0:e>=n?n-1:e,t=t<0?0:t>=a?a-1:t;break;case 2:e=(e%=n)<0?e+n:e,t=(t%=a)<0?t+a:t;break;default:return null}return t*n+e<<2},getPixel:function(e,t,n,a,r,i){if(t<0||t>=a||n<0||n>=r)switch(i){case 1:t=t<0?0:t>=a?a-1:t,n=n<0?0:n>=r?r-1:n;break;case 2:t=(t%=a)<0?t+a:t,n=(n%=r)<0?n+r:n;break;default:return 0}var o=n*a+t<<2;return e[o+3]<<24|e[o]<<16|e[o+1]<<8|e[o+2]},getPixelByIndex:function(e,t){return e[t+3]<<24|e[t]<<16|e[t+1]<<8|e[t+2]},copyBilinear:function(e,t,n,a,r,i,o,s){var l,u,c,d,f,h,p,m=t<0?t-1|0:0|t,g=n<0?n-1|0:0|n,v=t-m,y=n-g,b=0,_=0,w=0,x=0;if(m>=0&&m=0&&g>16&255,i[o+1]=b>>8&255,i[o+2]=255&b,void(i[o+3]=b>>24&255);_=this.getPixel(e,m+1,g,a,r,s),w=this.getPixel(e,m,g+1,a,r,s),x=this.getPixel(e,m+1,g+1,a,r,s)}d=((b>>16&255)*(u=1-v)+(_>>16&255)*v)*(c=1-y)+((w>>16&255)*u+(x>>16&255)*v)*y,f=((b>>8&255)*u+(_>>8&255)*v)*c+((w>>8&255)*u+(x>>8&255)*v)*y,h=((255&b)*u+(255&_)*v)*c+((255&w)*u+(255&x)*v)*y,p=((b>>24&255)*u+(_>>24&255)*v)*c+((w>>24&255)*u+(x>>24&255)*v)*y,i[o]=d>255?255:d<0?0:0|d,i[o+1]=f>255?255:f<0?0:0|f,i[o+2]=h>255?255:h<0?0:0|h,i[o+3]=p>255?255:p<0?0:0|p},rgbToHsl:function(e,t,n){n/=255;var a=(e/=255)>(t/=255)?e>n?e:n:t>n?t:n,r=e.5?i/(2-a-r):i/(a+r)),[o,s,l]},hslToRgb:function(e,t,n){var a,r,i,o,s,l=[];if(0===t)l=[o=s=255*n+.5|0,o,s];else{var u;a=2*n-(r=n<=.5?n*(t+1):n+t-n*t),i=e+1/3;for(var c=0;c<3;c+=1)i<0?i+=1:i>1&&(i-=1),u=6*i<1?a+(r-a)*i*6:2*i<1?r:3*i<2?a+(r-a)*(2/3-i)*6:a,l[c]=255*u+.5|0,i-=1/3}return l}},r.Translate=function(e,t,n,a){},r.Scale=function(e,t,n,a){},r.Rotate=function(e,t,n,a,r,i){},r.Affine=function(e,t,n,a){},r.UnsharpMask=function(e,t){},r.ConvolutionFilter=function(e,t,n,a,r,i,o,s,l,u){var c=e.data,d=e.width,f=e.height,h=(c.length,this.utils.createImageData(d,f)),p=h.data;r=r||1,i=i||0,!1!==o&&(o=!0),!1!==s&&(s=!0);for(var m=0,g=t>>1,v=n>>1,y=(l=l||0)>>16&255,b=l>>8&255,_=255&l,w=255*(u=u||0),x=0;x255?255:S<0?0:0|S,p[m+1]=(S=C/r+i)>255?255:S<0?0:0|S,p[m+2]=(S=P/r+i)>255?255:S<0?0:0|S,p[m+3]=o?c[m+3]:(S=T/r+i)>255?255:S<0?0:0|S}return h},r.Binarize=function(e,t){var n=e.data,a=e.width,r=e.height,i=n.length,o=this.utils.createImageData(a,r),s=o.data;isNaN(t)&&(t=.5),t*=255;for(var l=0;l255?255:r,c[f+1]=(r=i[f+1]+d[f+1])>255?255:r,c[f+2]=(r=i[f+2]+d[f+2])>255?255:r,c[f+3]=255;return u},r.BlendSubtract=function(e,t,n,a){for(var r,i=e.data,o=e.width,s=e.height,l=i.length,u=this.utils.createImageData(o,s),c=u.data,d=t.data,f=0;fw&&(v=w),(y=m-r)<0&&(y=0),f=x+y<<2,i+=e[d=x+v<<2]-e[f],o+=e[d+1]-e[f+1],s+=e[d+2]-e[f+2],l+=e[d+3]-e[f+3],u+=a;x+=n}},function(e,t,n,r){for(var i=e.data,o=e.width,s=e.height,l=(i.length,this.utils.createImageData(o,s)),u=l.data,c=this.utils.createImageData(o,s).data,d=0;d>V,D[c+1]=h*W>>V,D[c+2]=p*W>>V,D[c+3]=m*W>>V,f-=g,h-=v,p-=y,m-=b,g-=O.r,v-=O.g,y-=O.b,b-=O.a,l=d+((l=i+r+1)>V,D[l+1]=h*W>>V,D[l+2]=p*W>>V,D[l+3]=m*W>>V,f-=g,h-=v,p-=y,m-=b,g-=O.r,v-=O.g,y-=O.b,b-=O.a,l=i+((l=o+N)255?255:e}),i},r.BrightnessContrastGimp=function(e,t,n){var a=e.data,r=e.width,i=e.height,o=a.length,s=this.utils.createImageData(r,i),l=s.data,u=Math.PI/4;t/=100,n*=.99,n/=100,n=Math.tan((n+1)*u);for(var c=0,d=0;d>16;return c/=o/4,this.utils.mapRGB(a,l,function(e){return t<0?e*=1+t:t>0&&(e+=(255-e)*t),0!==n&&(e=(e-c)*n+c),e+.5|0}),s},r.BrightnessContrastPhotoshop=function(e,t,n){var a=e.data,r=e.width,i=e.height,o=(a.length,this.utils.createImageData(r,i)),s=o.data;return t=(t+100)/100,n=(n+100)/100,this.utils.mapRGB(a,s,function(e){return(e=((e*=t)-127.5)*n+127.5)+.5|0}),o},r.Channels=function(e,t){var n;switch(t){case 2:n=[0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,1,0];break;case 3:n=[0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0];break;default:n=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,1,0]}return this.ColorMatrixFilter(e,n)},r.Clone=function(e){return this.Copy(e,this.utils.createImageData(e.width,e.height))},r.CloneBuiltin=function(e){var t,n=e.width,a=e.height,r=this.utils.getSampleCanvas(),i=this.utils.getSampleContext();return r.width=n,r.height=a,i.putImageData(e,0,0),t=i.getImageData(0,0,n,a),r.width=0,r.height=0,t},r.ColorMatrixFilter=function(e,t){var n,a,r,i,o,s,l=e.data,u=e.width,c=e.height,d=l.length,f=this.utils.createImageData(u,c),h=f.data,p=t[0],m=t[1],g=t[2],v=t[3],y=t[4],b=t[5],_=t[6],w=t[7],x=t[8],k=t[9],S=t[10],E=t[11],C=t[12],P=t[13],T=t[14],O=t[15],I=t[16],M=t[17],R=t[18],j=t[19];for(a=0;a255?255:n<0?0:0|n,h[a+1]=(n=r*b+i*_+o*w+s*x+k)>255?255:n<0?0:0|n,h[a+2]=(n=r*S+i*E+o*C+s*P+T)>255?255:n<0?0:0|n,h[a+3]=(n=r*O+i*I+o*M+s*R+j)>255?255:n<0?0:0|n;return f},r.ColorTransformFilter=function(e,t,n,a,r,i,o,s,l){var u,c,d=e.data,f=e.width,h=e.height,p=d.length,m=this.utils.createImageData(f,h),g=m.data;for(u=0;u255?255:c<0?0:c,g[u+1]=(c=d[u+1]*n+o)>255?255:c<0?0:c,g[u+2]=(c=d[u+2]*a+s)>255?255:c<0?0:c,g[u+3]=(c=d[u+3]*r+l)>255?255:c<0?0:c;return m},r.Copy=function(e,t){for(var n=e.data,a=n.length,r=t.data;a--;)r[a]=n[a];return t},r.Crop=function(e,t,n,a,r){var i,o,s,l,u=e.data,c=e.width,d=e.height,f=(u.length,this.utils.createImageData(a,r)),h=f.data,p=Math.max(t,0),m=Math.max(n,0),g=Math.min(t+a,c),v=Math.min(n+r,d),y=p-t;for(i=m,dstRow=m-n;iu?l>c?l:c:u>c?u:c)+(l=E||w>=C?g=m:(y=_+((S[(v=(w-a)*x+(_-n)<<2)+i]-128)*s>>8),b=w+((S[v+o]-128)*l>>8),null===(g=r.utils.getPixelIndex(y+.5|0,b+.5|0,d,f,u))&&(g=m)),p[m]=c[g],p[m+1]=c[g+1],p[m+2]=c[g+2],p[m+3]=c[g+3];return h},r.Dither=function(e,t){var n,a,r=e.width,i=e.height,o=this.Clone(e),s=o.data,l=[],u=(t=t<2?2:t>255?255:t)-1,c=0,d=0;for(a=0;a255&&(d-=255,c+=1),n});var f,h,p,m,g,v,y,b,_,w,x,k,S,E,C,P=r-1,T=i-1,O=7/16,I=3/16,M=5/16,R=1/16;for(h=0;h255?255:S<0?0:0|S,s[p+1]=E>255?255:E<0?0:0|E,s[p+2]=C>255?255:C<0?0:0|C),p+=r-2<<2,f>0&&h255?255:S<0?0:0|S,s[p+1]=E>255?255:E<0?0:0|E,s[p+2]=C>255?255:C<0?0:0|C),p+=4,h255?255:S<0?0:0|S,s[p+1]=E>255?255:E<0?0:0|E,s[p+2]=C>255?255:C<0?0:0|C),p+=4,f255?255:S<0?0:0|S,s[p+1]=E>255?255:E<0?0:0|E,s[p+2]=C>255?255:C<0?0:0|C);return o},r.Edge=function(e){return this.ConvolutionFilter(e,3,3,[-1,-1,-1,-1,8,-1,-1,-1,-1])},r.Emboss=function(e){return this.ConvolutionFilter(e,3,3,[-2,-1,0,-1,1,1,0,1,2])},r.Enrich=function(e){return this.ConvolutionFilter(e,3,3,[0,-2,0,-2,20,-2,0,-2,0],10,-40)},r.Flip=function(e,t){var n,a,r,i,o=e.data,s=e.width,l=e.height,u=(o.length,this.utils.createImageData(s,l)),c=u.data;for(a=0;a255?255:e+.5|0}),i},r.GrayScale=function(e){for(var t=e.data,n=e.width,a=e.height,r=t.length,i=this.utils.createImageData(n,a),o=i.data,s=0;s>16;o[s]=o[s+1]=o[s+2]=l,o[s+3]=t[s+3]}return i},r.HSLAdjustment=function(e,t,n,a){var r=e.data,i=e.width,o=e.height,s=r.length,l=this.utils.createImageData(i,o),u=l.data;t/=360,n/=100,a/=100;var c,d,f,h,p,m,g=this.utils.rgbToHsl,v=this.utils.hslToRgb;for(m=0;m1;)c-=1;(d=h[1]+h[1]*n)<0?d=0:d>1&&(d=1),f=h[2],a>0?f+=(1-f)*a:a<0&&(f+=f*a),p=v(c,d,f),u[m]=p[0],u[m+1]=p[1],u[m+2]=p[2],u[m+3]=r[m+3]}return l},r.Invert=function(e){var t=e.data,n=e.width,a=e.height,r=(t.length,this.utils.createImageData(n,a)),i=r.data;return this.utils.mapRGB(t,i,function(e){return 255-e}),r},r.Mosaic=function(e,t){var n,a,r,i,o,s,l,u,c,d,f,h,p,m,g,v=e.data,y=e.width,b=e.height,_=(v.length,this.utils.createImageData(y,b)),w=_.data,x=Math.ceil(y/t),k=Math.ceil(b/t);for(n=0;nb&&(s=b),a=0;ay&&(i=y),h=p=m=g=0,f=(i-r)*(s-o),u=o;u=k))for(c=l*x,s=-t;s<=t;s+=1)(u=a+s)<0||u>=x||(f=w[d=c+u<<2],g=(h=w[d+1])*n>>8,v=(p=w[d+2])*n>>8,I[m=f*n>>8]+=f,M[g]+=h,R[v]+=p,P[m]+=1,T[g]+=1,O[v]+=1);for(y=b=_=0,i=1;iP[y]&&(y=i),T[i]>T[b]&&(b=i),O[i]>O[_]&&(_=i);E[C]=I[y]/P[y]|0,E[C+1]=M[b]/T[b]|0,E[C+2]=R[_]/O[_]|0,E[C+3]=w[C+3],C+=4}return S},r.OpacityFilter=function(e,t){for(var n=e.data,a=e.width,r=e.height,i=n.length,o=this.utils.createImageData(a,r),s=o.data,l=0;l255?255:t)-1,c=0,d=0;for(n=0;n255&&(d-=255,c+=1),n}),o},r.Rescale=function(e,t){var n=e.data,a=e.width,r=e.height,i=(n.length,this.utils.createImageData(a,r)),o=i.data;return this.utils.mapRGB(n,o,function(e){return(e*=t)>255?255:e+.5|0}),i},r.ResizeNearestNeighbor=function(e,t,n){var a,r,i,o,s=e.data,l=e.width,u=e.height,c=(s.length,this.utils.createImageData(t,n)),d=c.data,f=l/t,h=u/n,p=0;for(i=0;i255?255:i<0?0:i+.5|0,d[r+1]=(i=.349*t+.686*n+.168*a)>255?255:i<0?0:i+.5|0,d[r+2]=(i=.272*t+.534*n+.131*a)>255?255:i<0?0:i+.5|0,d[r+3]=o[r+3];return c},r.Sharpen=function(e,t){return this.ConvolutionFilter(e,3,3,[-t/16,-t/8,-t/16,-t/8,.75*t+1,-t/8,-t/16,-t/8,-t/16])},r.Solarize=function(e){var t=e.data,n=e.width,a=e.height,r=(t.length,this.utils.createImageData(n,a)),i=r.data;return this.utils.mapRGB(t,i,function(e){return e>127?2*(e-127.5):2*(127.5-e)}),r},r.Transpose=function(e){var t,n,a=e.data,r=e.width,i=e.height,o=(a.length,this.utils.createImageData(i,r)),s=o.data;for(y=0;yw?(d[x]=s[x],d[x+1]=s[x+1],d[x+2]=s[x+2],d[x+3]=s[x+3]):(g=Math.sqrt(g),v=Math.atan2(m,p)+r*(a-g)/a,y=t+g*Math.cos(v),b=n+g*Math.sin(v),o?this.utils.copyBilinear(s,y,b,l,u,d,x,i):(_=(b+.5|0)*l+(y+.5|0)<<2,d[x]=s[_],d[x+1]=s[_+1],d[x+2]=s[_+2],d[x+3]=s[_+3])),x+=4;return c},t.default=r},function(e,t,n){var a=n(34),r=Math.min;e.exports=function(e){return e>0?r(a(e),9007199254740991):0}},function(e,t,n){var a=n(5),r=n(148),i=n(36),o=Object.defineProperty;t.f=n(15)?Object.defineProperty:function(e,t,n){if(a(e),t=i(t,!0),a(n),r)try{return o(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){e.exports=!n(7)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,n){var a=n(35);e.exports=function(e){return Object(a(e))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n=0;s--)if(!(this.common_dimensions[s][0]>t||this.common_dimensions[s][1]>n)){r.default.WIDTH=parseInt(this.common_dimensions[s][0]),r.default.HEIGHT=parseInt(this.common_dimensions[s][1]),a=!0;break}0==a&&(r.default.WIDTH=parseInt(t)-5,r.default.HEIGHT=parseInt(n)-10,t<585&&(r.default.HEIGHT=r.default.HEIGHT-15))}}},{key:"render_canvas_background",value:function(e,t){void 0==t&&(t=10);var n=document.getElementById(e+"_background");if(0==r.default.TRANSPARENCY)return n.className="transparent-grid white",!1;n.className="transparent-grid "+r.default.TRANSPARENCY_TYPE,n.style.backgroundSize=2*t+"px auto"}},{key:"draw_grid",value:function(e){if(0!=this.grid){var t=this.grid_size[0],n=this.grid_size[1],a=r.default.WIDTH,i=r.default.HEIGHT;void 0!=t&&void 0!=n?this.grid_size=[t,n]:(t=this.grid_size[0],n=this.grid_size[1]),t=parseInt(t),n=parseInt(n),e.lineWidth=1,e.beginPath(),t<2&&(t=2),n<2&&(n=2);for(var o=t;o"+r+""};e.exports=function(e,t){var n={};n[e]=t(s),a(a.P+a.F*r(function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}),"String",n)}},function(e,t,n){var a=n(6),r=n(21),i=n(25),o=n(50)("src"),s=Function.toString,l=(""+s).split("toString");n(29).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var u="function"==typeof n;u&&(i(n,"name")||r(n,"name",t)),e[t]!==n&&(u&&(i(n,o)||r(n,o,e[t]?""+e[t]:l.join(String(t)))),e===a?e[t]=n:s?e[t]?e[t]=n:r(e,t,n):(delete e[t],r(e,t,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[o]||s.call(this)})},function(e,t,n){var a=n(14),r=n(51);e.exports=n(15)?function(e,t,n){return a.f(e,t,r(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var a=n(25),r=n(16),i=n(107)("IE_PROTO"),o=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=r(e),a(e,i)?e[i]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?o:null}},function(e,t,n){var a=n(62),r=n(51),i=n(24),o=n(36),s=n(25),l=n(148),u=Object.getOwnPropertyDescriptor;t.f=n(15)?u:function(e,t){if(e=i(e),t=o(t,!0),l)try{return u(e,t)}catch(e){}if(s(e,t))return r(!a.f.call(e,t),e[t])}},function(e,t,n){var a=n(63),r=n(35);e.exports=function(e){return a(r(e))}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){"use strict";var a=n(7);e.exports=function(e,t){return!!e&&a(function(){t?e.call(null,function(){},1):e.call(null)})}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var a=n(18);e.exports=function(e,t,n){if(a(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,a){return e.call(t,n,a)};case 3:return function(n,a,r){return e.call(t,n,a,r)}}return function(){return e.apply(t,arguments)}}},function(e,t){var n=e.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n0.0){color.rgb=(color.rgb-0.5)/(1.0-contrast)+0.5;}else{color.rgb=(color.rgb-0.5)*(1.0+contrast)+0.5;}gl_FragColor=color;}"),o.call(this,H.brightnessContrast,{brightness:e(-1,t,1),contrast:e(-1,n,1)}),this}function g(t){t=new h(t);for(var n=[],a=0;256>a;a++)n.push(e(0,Math.floor(256*t.interpolate(a/255)),255));return n}function v(e,t,n){e=g(e),1==arguments.length?t=n=e:(t=g(t),n=g(n));for(var a=[],r=0;256>r;r++)a.splice(a.length,0,e[r],t[r],n[r],255);return this._.extraTexture.initFromBytes(256,1,a),this._.extraTexture.use(1),H.curves=H.curves||new N(null,"uniform sampler2D texture;uniform sampler2D map;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);color.r=texture2D(map,vec2(color.r)).r;color.g=texture2D(map,vec2(color.g)).g;color.b=texture2D(map,vec2(color.b)).b;gl_FragColor=color;}"),H.curves.textures({map:1}),o.call(this,H.curves,{}),this}function y(e){H.denoise=H.denoise||new N(null,"uniform sampler2D texture;uniform float exponent;uniform float strength;uniform vec2 texSize;varying vec2 texCoord;void main(){vec4 center=texture2D(texture,texCoord);vec4 color=vec4(0.0);float total=0.0;for(float x=-4.0;x<=4.0;x+=1.0){for(float y=-4.0;y<=4.0;y+=1.0){vec4 sample=texture2D(texture,texCoord+vec2(x,y)/texSize);float weight=1.0-abs(dot(sample.rgb-center.rgb,vec3(0.25)));weight=pow(weight,exponent);color+=sample*weight;total+=weight;}}gl_FragColor=color/total;}");for(var t=0;2>t;t++)o.call(this,H.denoise,{exponent:Math.max(0,e),texSize:[this.width,this.height]});return this}function b(t,n){return H.hueSaturation=H.hueSaturation||new N(null,"uniform sampler2D texture;uniform float hue;uniform float saturation;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);float angle=hue*3.14159265;float s=sin(angle),c=cos(angle);vec3 weights=(vec3(2.0*c,-sqrt(3.0)*s-c,sqrt(3.0)*s-c)+1.0)/3.0;float len=length(color.rgb);color.rgb=vec3(dot(color.rgb,weights.xyz),dot(color.rgb,weights.zxy),dot(color.rgb,weights.yzx));float average=(color.r+color.g+color.b)/3.0;if(saturation>0.0){color.rgb+=(average-color.rgb)*(1.0-1.0/(1.001-saturation));}else{color.rgb+=(average-color.rgb)*(-saturation);}gl_FragColor=color;}"),o.call(this,H.hueSaturation,{hue:e(-1,t,1),saturation:e(-1,n,1)}),this}function _(t){return H.noise=H.noise||new N(null,"uniform sampler2D texture;uniform float amount;varying vec2 texCoord;float rand(vec2 co){return fract(sin(dot(co.xy,vec2(12.9898,78.233)))*43758.5453);}void main(){vec4 color=texture2D(texture,texCoord);float diff=(rand(texCoord)-0.5)*amount;color.r+=diff;color.g+=diff;color.b+=diff;gl_FragColor=color;}"),o.call(this,H.noise,{amount:e(0,t,1)}),this}function w(t){return H.sepia=H.sepia||new N(null,"uniform sampler2D texture;uniform float amount;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);float r=color.r;float g=color.g;float b=color.b;color.r=min(1.0,(r*(1.0-(0.607*amount)))+(g*(0.769*amount))+(b*(0.189*amount)));color.g=min(1.0,(r*0.349*amount)+(g*(1.0-(0.314*amount)))+(b*0.168*amount));color.b=min(1.0,(r*0.272*amount)+(g*0.534*amount)+(b*(1.0-(0.869*amount))));gl_FragColor=color;}"),o.call(this,H.sepia,{amount:e(0,t,1)}),this}function x(e,t){return H.unsharpMask=H.unsharpMask||new N(null,"uniform sampler2D blurredTexture;uniform sampler2D originalTexture;uniform float strength;uniform float threshold;varying vec2 texCoord;void main(){vec4 blurred=texture2D(blurredTexture,texCoord);vec4 original=texture2D(originalTexture,texCoord);gl_FragColor=mix(blurred,original,1.0+strength);}"),this._.extraTexture.ensureFormat(this._.texture),this._.texture.use(),this._.extraTexture.drawTo(function(){N.getDefaultShader().drawRect()}),this._.extraTexture.use(1),this.triangleBlur(e),H.unsharpMask.textures({originalTexture:1}),o.call(this,H.unsharpMask,{strength:t}),this._.extraTexture.unuse(1),this}function k(t){return H.vibrance=H.vibrance||new N(null,"uniform sampler2D texture;uniform float amount;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);float average=(color.r+color.g+color.b)/3.0;float mx=max(color.r,max(color.g,color.b));float amt=(mx-average)*(-amount*3.0);color.rgb=mix(color.rgb,vec3(mx),amt);gl_FragColor=color;}"),o.call(this,H.vibrance,{amount:e(-1,t,1)}),this}function S(t,n){return H.vignette=H.vignette||new N(null,"uniform sampler2D texture;uniform float size;uniform float amount;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);float dist=distance(texCoord,vec2(0.5,0.5));color.rgb*=smoothstep(0.8,size*0.799,dist*(amount+size));gl_FragColor=color;}"),o.call(this,H.vignette,{size:e(0,t,1),amount:e(0,n,1)}),this}function E(t,n,a){H.lensBlurPrePass=H.lensBlurPrePass||new N(null,"uniform sampler2D texture;uniform float power;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);color=pow(color,vec4(power));gl_FragColor=vec4(color);}");var r="uniform sampler2D texture0;uniform sampler2D texture1;uniform vec2 delta0;uniform vec2 delta1;uniform float power;varying vec2 texCoord;"+G+"vec4 sample(vec2 delta){float offset=random(vec3(delta,151.7182),0.0);vec4 color=vec4(0.0);float total=0.0;for(float t=0.0;t<=30.0;t++){float percent=(t+offset)/30.0;color+=texture2D(texture0,texCoord+delta*percent);total+=1.0;}return color/total;}";H.lensBlur0=H.lensBlur0||new N(null,r+"void main(){gl_FragColor=sample(delta0);}"),H.lensBlur1=H.lensBlur1||new N(null,r+"void main(){gl_FragColor=(sample(delta0)+sample(delta1))*0.5;}"),H.lensBlur2=H.lensBlur2||new N(null,r+"void main(){vec4 color=(sample(delta0)+2.0*texture2D(texture1,texCoord))/3.0;gl_FragColor=pow(color,vec4(power));}").textures({texture1:1});r=[];for(var i=0;3>i;i++){var s=a+2*i*Math.PI/3;r.push([t*Math.sin(s)/this.width,t*Math.cos(s)/this.height])}return t=Math.pow(10,e(-1,n,1)),o.call(this,H.lensBlurPrePass,{power:t}),this._.extraTexture.ensureFormat(this._.texture),o.call(this,H.lensBlur0,{delta0:r[0]},this._.texture,this._.extraTexture),o.call(this,H.lensBlur1,{delta0:r[1],delta1:r[2]},this._.extraTexture,this._.extraTexture),o.call(this,H.lensBlur0,{delta0:r[1]}),this._.extraTexture.use(1),o.call(this,H.lensBlur2,{power:1/t,delta0:r[2]}),this}function C(e,t,n,a,r,i){H.tiltShift=H.tiltShift||new N(null,"uniform sampler2D texture;uniform float blurRadius;uniform float gradientRadius;uniform vec2 start;uniform vec2 end;uniform vec2 delta;uniform vec2 texSize;varying vec2 texCoord;"+G+"void main(){vec4 color=vec4(0.0);float total=0.0;float offset=random(vec3(12.9898,78.233,151.7182),0.0);vec2 normal=normalize(vec2(start.y-end.y,end.x-start.x));float radius=smoothstep(0.0,1.0,abs(dot(texCoord*texSize-start,normal))/gradientRadius)*blurRadius;for(float t=-30.0;t<=30.0;t++){float percent=(t+offset-0.5)/30.0;float weight=1.0-abs(percent);vec4 sample=texture2D(texture,texCoord+delta/texSize*percent*radius);sample.rgb*=sample.a;color+=sample*weight;total+=weight;}gl_FragColor=color/total;gl_FragColor.rgb/=gl_FragColor.a+0.00001;}");var s=n-e,l=a-t,u=Math.sqrt(s*s+l*l);return o.call(this,H.tiltShift,{blurRadius:r,gradientRadius:i,start:[e,t],end:[n,a],delta:[s/u,l/u],texSize:[this.width,this.height]}),o.call(this,H.tiltShift,{blurRadius:r,gradientRadius:i,start:[e,t],end:[n,a],delta:[-l/u,s/u],texSize:[this.width,this.height]}),this}function P(e){return H.triangleBlur=H.triangleBlur||new N(null,"uniform sampler2D texture;uniform vec2 delta;varying vec2 texCoord;"+G+"void main(){vec4 color=vec4(0.0);float total=0.0;float offset=random(vec3(12.9898,78.233,151.7182),0.0);for(float t=-30.0;t<=30.0;t++){float percent=(t+offset-0.5)/30.0;float weight=1.0-abs(percent);vec4 sample=texture2D(texture,texCoord+delta*percent);sample.rgb*=sample.a;color+=sample*weight;total+=weight;}gl_FragColor=color/total;gl_FragColor.rgb/=gl_FragColor.a+0.00001;}"),o.call(this,H.triangleBlur,{delta:[e/this.width,0]}),o.call(this,H.triangleBlur,{delta:[0,e/this.height]}),this}function T(e,t,n){return H.zoomBlur=H.zoomBlur||new N(null,"uniform sampler2D texture;uniform vec2 center;uniform float strength;uniform vec2 texSize;varying vec2 texCoord;"+G+"void main(){vec4 color=vec4(0.0);float total=0.0;vec2 toCenter=center-texCoord*texSize;float offset=random(vec3(12.9898,78.233,151.7182),0.0);for(float t=0.0;t<=40.0;t++){float percent=(t+offset)/40.0;float weight=4.0*(percent-percent*percent);vec4 sample=texture2D(texture,texCoord+toCenter*percent*strength/texSize);sample.rgb*=sample.a;color+=sample*weight;total+=weight;}gl_FragColor=color/total;gl_FragColor.rgb/=gl_FragColor.a+0.00001;}"),o.call(this,H.zoomBlur,{center:[e,t],strength:n,texSize:[this.width,this.height]}),this}function O(e,t,n,a){return H.colorHalftone=H.colorHalftone||new N(null,"uniform sampler2D texture;uniform vec2 center;uniform float angle;uniform float scale;uniform vec2 texSize;varying vec2 texCoord;float pattern(float angle){float s=sin(angle),c=cos(angle);vec2 tex=texCoord*texSize-center;vec2 point=vec2(c*tex.x-s*tex.y,s*tex.x+c*tex.y)*scale;return(sin(point.x)*sin(point.y))*4.0;}void main(){vec4 color=texture2D(texture,texCoord);vec3 cmy=1.0-color.rgb;float k=min(cmy.x,min(cmy.y,cmy.z));cmy=(cmy-k)/(1.0-k);cmy=clamp(cmy*10.0-3.0+vec3(pattern(angle+0.26179),pattern(angle+1.30899),pattern(angle)),0.0,1.0);k=clamp(k*10.0-5.0+pattern(angle+0.78539),0.0,1.0);gl_FragColor=vec4(1.0-cmy-k,color.a);}"),o.call(this,H.colorHalftone,{center:[e,t],angle:n,scale:Math.PI/a,texSize:[this.width,this.height]}),this}function I(e,t,n,a){return H.dotScreen=H.dotScreen||new N(null,"uniform sampler2D texture;uniform vec2 center;uniform float angle;uniform float scale;uniform vec2 texSize;varying vec2 texCoord;float pattern(){float s=sin(angle),c=cos(angle);vec2 tex=texCoord*texSize-center;vec2 point=vec2(c*tex.x-s*tex.y,s*tex.x+c*tex.y)*scale;return(sin(point.x)*sin(point.y))*4.0;}void main(){vec4 color=texture2D(texture,texCoord);float average=(color.r+color.g+color.b)/3.0;gl_FragColor=vec4(vec3(average*10.0-5.0+pattern()),color.a);}"),o.call(this,H.dotScreen,{center:[e,t],angle:n,scale:Math.PI/a,texSize:[this.width,this.height]}),this}function M(e){return H.edgeWork1=H.edgeWork1||new N(null,"uniform sampler2D texture;uniform vec2 delta;varying vec2 texCoord;"+G+"void main(){vec2 color=vec2(0.0);vec2 total=vec2(0.0);float offset=random(vec3(12.9898,78.233,151.7182),0.0);for(float t=-30.0;t<=30.0;t++){float percent=(t+offset-0.5)/30.0;float weight=1.0-abs(percent);vec3 sample=texture2D(texture,texCoord+delta*percent).rgb;float average=(sample.r+sample.g+sample.b)/3.0;color.x+=average*weight;total.x+=weight;if(abs(t)<15.0){weight=weight*2.0-1.0;color.y+=average*weight;total.y+=weight;}}gl_FragColor=vec4(color/total,0.0,1.0);}"),H.edgeWork2=H.edgeWork2||new N(null,"uniform sampler2D texture;uniform vec2 delta;varying vec2 texCoord;"+G+"void main(){vec2 color=vec2(0.0);vec2 total=vec2(0.0);float offset=random(vec3(12.9898,78.233,151.7182),0.0);for(float t=-30.0;t<=30.0;t++){float percent=(t+offset-0.5)/30.0;float weight=1.0-abs(percent);vec2 sample=texture2D(texture,texCoord+delta*percent).xy;color.x+=sample.x*weight;total.x+=weight;if(abs(t)<15.0){weight=weight*2.0-1.0;color.y+=sample.y*weight;total.y+=weight;}}float c=clamp(10000.0*(color.y/total.y-color.x/total.x)+0.5,0.0,1.0);gl_FragColor=vec4(c,c,c,1.0);}"),o.call(this,H.edgeWork1,{delta:[e/this.width,0]}),o.call(this,H.edgeWork2,{delta:[0,e/this.height]}),this}function R(e,t,n){return H.hexagonalPixelate=H.hexagonalPixelate||new N(null,"uniform sampler2D texture;uniform vec2 center;uniform float scale;uniform vec2 texSize;varying vec2 texCoord;void main(){vec2 tex=(texCoord*texSize-center)/scale;tex.y/=0.866025404;tex.x-=tex.y*0.5;vec2 a;if(tex.x+tex.y-floor(tex.x)-floor(tex.y)<1.0)a=vec2(floor(tex.x),floor(tex.y));else a=vec2(ceil(tex.x),ceil(tex.y));vec2 b=vec2(ceil(tex.x),floor(tex.y));vec2 c=vec2(floor(tex.x),ceil(tex.y));vec3 TEX=vec3(tex.x,tex.y,1.0-tex.x-tex.y);vec3 A=vec3(a.x,a.y,1.0-a.x-a.y);vec3 B=vec3(b.x,b.y,1.0-b.x-b.y);vec3 C=vec3(c.x,c.y,1.0-c.x-c.y);float alen=length(TEX-A);float blen=length(TEX-B);float clen=length(TEX-C);vec2 choice;if(alen0.0){coord*=mix(1.0,smoothstep(0.0,radius/distance,percent),strength*0.75);}else{coord*=mix(1.0,pow(percent,1.0+strength*0.75)*radius/distance,1.0-percent);}}coord+=center;"),o.call(this,H.bulgePinch,{radius:a,strength:e(-1,r,1),center:[t,n],texSize:[this.width,this.height]}),this}function B(e,t,n){if(H.matrixWarp=H.matrixWarp||p("uniform mat3 matrix;uniform bool useTextureSpace;","if(useTextureSpace)coord=coord/texSize*2.0-1.0;vec3 warp=matrix*vec3(coord,1.0);coord=warp.xy/warp.z;if(useTextureSpace)coord=(coord*0.5+0.5)*texSize;"),4==(e=Array.prototype.concat.apply([],e)).length)e=[e[0],e[1],0,e[2],e[3],0,0,0,1];else if(9!=e.length)throw"can only warp with 2x2 or 3x3 matrix";return o.call(this,H.matrixWarp,{matrix:t?f(e):e,texSize:[this.width,this.height],useTextureSpace:0|n}),this}function D(e,t){var n=d.apply(null,t),a=d.apply(null,e);n=f(n);return this.matrixWarp([n[0]*a[0]+n[1]*a[3]+n[2]*a[6],n[0]*a[1]+n[1]*a[4]+n[2]*a[7],n[0]*a[2]+n[1]*a[5]+n[2]*a[8],n[3]*a[0]+n[4]*a[3]+n[5]*a[6],n[3]*a[1]+n[4]*a[4]+n[5]*a[7],n[3]*a[2]+n[4]*a[5]+n[5]*a[8],n[6]*a[0]+n[7]*a[3]+n[8]*a[6],n[6]*a[1]+n[7]*a[4]+n[8]*a[7],n[6]*a[2]+n[7]*a[5]+n[8]*a[8]])}function L(e,t,n,a){return H.swirl=H.swirl||p("uniform float radius;uniform float angle;uniform vec2 center;","coord-=center;float distance=length(coord);if(distance>1;this.xa[a]>e?n=a:t=a}a=this.xa[n]-this.xa[t];var r=(this.xa[n]-e)/a;return e=(e-this.xa[t])/a,r*this.ya[t]+e*this.ya[n]+((r*r*r-r)*this.y2[t]+(e*e*e-e)*this.y2[n])*a*a/6};var F=function(){function e(e,t,n,a){this.gl=H,this.id=H.createTexture(),this.width=e,this.height=t,this.format=n,this.type=a,H.bindTexture(H.TEXTURE_2D,this.id),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_MAG_FILTER,H.LINEAR),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_MIN_FILTER,H.LINEAR),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_WRAP_S,H.CLAMP_TO_EDGE),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_WRAP_T,H.CLAMP_TO_EDGE),e&&t&&H.texImage2D(H.TEXTURE_2D,0,this.format,e,t,0,this.format,this.type,null)}function t(e){return null==n&&(n=document.createElement("canvas")),n.width=e.width,n.height=e.height,(e=n.getContext("2d")).clearRect(0,0,n.width,n.height),e}e.fromElement=function(t){var n=new e(0,0,H.RGBA,H.UNSIGNED_BYTE);return n.loadContentsOf(t),n},e.prototype.loadContentsOf=function(e){this.width=e.width||e.videoWidth,this.height=e.height||e.videoHeight,H.bindTexture(H.TEXTURE_2D,this.id),H.texImage2D(H.TEXTURE_2D,0,this.format,this.format,this.type,e)},e.prototype.initFromBytes=function(e,t,n){this.width=e,this.height=t,this.format=H.RGBA,this.type=H.UNSIGNED_BYTE,H.bindTexture(H.TEXTURE_2D,this.id),H.texImage2D(H.TEXTURE_2D,0,H.RGBA,e,t,0,H.RGBA,this.type,new Uint8Array(n))},e.prototype.destroy=function(){H.deleteTexture(this.id),this.id=null},e.prototype.use=function(e){H.activeTexture(H.TEXTURE0+(e||0)),H.bindTexture(H.TEXTURE_2D,this.id)},e.prototype.unuse=function(e){H.activeTexture(H.TEXTURE0+(e||0)),H.bindTexture(H.TEXTURE_2D,null)},e.prototype.ensureFormat=function(e,t,n,a){if(1==arguments.length){var r=arguments[0];e=r.width,t=r.height,n=r.format,a=r.type}e==this.width&&t==this.height&&n==this.format&&a==this.type||(this.width=e,this.height=t,this.format=n,this.type=a,H.bindTexture(H.TEXTURE_2D,this.id),H.texImage2D(H.TEXTURE_2D,0,this.format,e,t,0,this.format,this.type,null))},e.prototype.drawTo=function(e){if(H.framebuffer=H.framebuffer||H.createFramebuffer(),H.bindFramebuffer(H.FRAMEBUFFER,H.framebuffer),H.framebufferTexture2D(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,H.TEXTURE_2D,this.id,0),H.checkFramebufferStatus(H.FRAMEBUFFER)!==H.FRAMEBUFFER_COMPLETE)throw Error("incomplete framebuffer");H.viewport(0,0,this.width,this.height),e(),H.bindFramebuffer(H.FRAMEBUFFER,null)};var n=null;return e.prototype.fillUsingCanvas=function(e){return e(t(this)),this.format=H.RGBA,this.type=H.UNSIGNED_BYTE,H.bindTexture(H.TEXTURE_2D,this.id),H.texImage2D(H.TEXTURE_2D,0,H.RGBA,H.RGBA,H.UNSIGNED_BYTE,n),this},e.prototype.toImage=function(e){this.use(),N.getDefaultShader().drawRect();var a=4*this.width*this.height,r=new Uint8Array(a),i=t(this),o=i.createImageData(this.width,this.height);H.readPixels(0,0,this.width,this.height,H.RGBA,H.UNSIGNED_BYTE,r);for(var s=0;sw;w++)if((f||w in y)&&(g=b(m=y[w],w,v),e))if(n)x[w]=g;else if(g)switch(e){case 3:return!0;case 5:return m;case 6:return w;case 2:x.push(m)}else if(c)return!1;return d?-1:u||c?c:x}}},function(e,t,n){var a=n(0),r=n(29),i=n(7);e.exports=function(e,t){var n=(r.Object||{})[e]||Object[e],o={};o[e]=t(n),a(a.S+a.F*i(function(){n(1)}),"Object",o)}},function(e,t){var n=Math.ceil,a=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?a:n)(e)}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var a=n(9);e.exports=function(e,t){if(!a(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!a(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!a(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!a(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){var a=n(127),r=n(0),i=n(80)("metadata"),o=i.store||(i.store=new(n(124))),s=function(e,t,n){var r=o.get(e);if(!r){if(!n)return;o.set(e,r=new a)}var i=r.get(t);if(!i){if(!n)return;r.set(t,i=new a)}return i};e.exports={store:o,map:s,has:function(e,t,n){var a=s(t,n,!1);return void 0!==a&&a.has(e)},get:function(e,t,n){var a=s(t,n,!1);return void 0===a?void 0:a.get(e)},set:function(e,t,n,a){s(n,a,!0).set(e,t)},keys:function(e,t){var n=s(e,t,!1),a=[];return n&&n.forEach(function(e,t){a.push(t)}),a},key:function(e){return void 0===e||"symbol"==typeof e?e:String(e)},exp:function(e){r(r.S,"Reflect",e)}}},function(e,t,n){"use strict";if(n(15)){var a=n(40),r=n(6),i=n(7),o=n(0),s=n(69),l=n(84),u=n(28),c=n(44),d=n(51),f=n(21),h=n(42),p=n(34),m=n(13),g=n(122),v=n(48),y=n(36),b=n(25),_=n(61),w=n(9),x=n(16),k=n(93),S=n(47),E=n(22),C=n(46).f,P=n(91),T=n(50),O=n(10),I=n(32),M=n(79),R=n(72),j=n(88),A=n(57),B=n(75),D=n(45),L=n(89),H=n(132),z=n(14),N=n(23),F=z.f,G=N.f,U=r.RangeError,W=r.TypeError,V=r.Uint8Array,Y=Array.prototype,q=l.ArrayBuffer,Z=l.DataView,X=I(0),J=I(2),K=I(3),Q=I(4),$=I(5),ee=I(6),te=M(!0),ne=M(!1),ae=j.values,re=j.keys,ie=j.entries,oe=Y.lastIndexOf,se=Y.reduce,le=Y.reduceRight,ue=Y.join,ce=Y.sort,de=Y.slice,fe=Y.toString,he=Y.toLocaleString,pe=O("iterator"),me=O("toStringTag"),ge=T("typed_constructor"),ve=T("def_constructor"),ye=s.CONSTR,be=s.TYPED,_e=s.VIEW,we=I(1,function(e,t){return Ce(R(e,e[ve]),t)}),xe=i(function(){return 1===new V(new Uint16Array([1]).buffer)[0]}),ke=!!V&&!!V.prototype.set&&i(function(){new V(1).set({})}),Se=function(e,t){var n=p(e);if(n<0||n%t)throw U("Wrong offset!");return n},Ee=function(e){if(w(e)&&be in e)return e;throw W(e+" is not a typed array!")},Ce=function(e,t){if(!(w(e)&&ge in e))throw W("It is not a typed array constructor!");return new e(t)},Pe=function(e,t){return Te(R(e,e[ve]),t)},Te=function(e,t){for(var n=0,a=t.length,r=Ce(e,a);a>n;)r[n]=t[n++];return r},Oe=function(e,t,n){F(e,t,{get:function(){return this._d[n]}})},Ie=function(e){var t,n,a,r,i,o,s=x(e),l=arguments.length,c=l>1?arguments[1]:void 0,d=void 0!==c,f=P(s);if(void 0!=f&&!k(f)){for(o=f.call(s),a=[],t=0;!(i=o.next()).done;t++)a.push(i.value);s=a}for(d&&l>2&&(c=u(c,arguments[2],2)),t=0,n=m(s.length),r=Ce(this,n);n>t;t++)r[t]=d?c(s[t],t):s[t];return r},Me=function(){for(var e=0,t=arguments.length,n=Ce(this,t);t>e;)n[e]=arguments[e++];return n},Re=!!V&&i(function(){he.call(new V(1))}),je=function(){return he.apply(Re?de.call(Ee(this)):Ee(this),arguments)},Ae={copyWithin:function(e,t){return H.call(Ee(this),e,t,arguments.length>2?arguments[2]:void 0)},every:function(e){return Q(Ee(this),e,arguments.length>1?arguments[1]:void 0)},fill:function(e){return L.apply(Ee(this),arguments)},filter:function(e){return Pe(this,J(Ee(this),e,arguments.length>1?arguments[1]:void 0))},find:function(e){return $(Ee(this),e,arguments.length>1?arguments[1]:void 0)},findIndex:function(e){return ee(Ee(this),e,arguments.length>1?arguments[1]:void 0)},forEach:function(e){X(Ee(this),e,arguments.length>1?arguments[1]:void 0)},indexOf:function(e){return ne(Ee(this),e,arguments.length>1?arguments[1]:void 0)},includes:function(e){return te(Ee(this),e,arguments.length>1?arguments[1]:void 0)},join:function(e){return ue.apply(Ee(this),arguments)},lastIndexOf:function(e){return oe.apply(Ee(this),arguments)},map:function(e){return we(Ee(this),e,arguments.length>1?arguments[1]:void 0)},reduce:function(e){return se.apply(Ee(this),arguments)},reduceRight:function(e){return le.apply(Ee(this),arguments)},reverse:function(){for(var e,t=Ee(this).length,n=Math.floor(t/2),a=0;a1?arguments[1]:void 0)},sort:function(e){return ce.call(Ee(this),e)},subarray:function(e,t){var n=Ee(this),a=n.length,r=v(e,a);return new(R(n,n[ve]))(n.buffer,n.byteOffset+r*n.BYTES_PER_ELEMENT,m((void 0===t?a:v(t,a))-r))}},Be=function(e,t){return Pe(this,de.call(Ee(this),e,t))},De=function(e){Ee(this);var t=Se(arguments[1],1),n=this.length,a=x(e),r=m(a.length),i=0;if(r+t>n)throw U("Wrong length!");for(;i255?255:255&a),r.v[h](n*t+r.o,a,xe)}(this,n,e)},enumerable:!0})};b?(p=n(function(e,n,a,r){c(e,p,u,"_d");var i,o,s,l,d=0,h=0;if(w(n)){if(!(n instanceof q||"ArrayBuffer"==(l=_(n))||"SharedArrayBuffer"==l))return be in n?Te(p,n):Ie.call(p,n);i=n,h=Se(a,t);var v=n.byteLength;if(void 0===r){if(v%t)throw U("Wrong length!");if((o=v-h)<0)throw U("Wrong length!")}else if((o=m(r)*t)+h>v)throw U("Wrong length!");s=o/t}else s=g(n),i=new q(o=s*t);for(f(e,"_d",{b:i,o:h,l:o,e:s,v:new Z(i)});db;b++)if((g=t?y(o(p=e[b])[0],p[1]):y(e[b]))===u||g===c)return g}else for(m=v.call(e);!(p=m.next()).done;)if((g=r(m,y,p.value,t))===u||g===c)return g}).BREAK=u,t.RETURN=c},function(e,t){e.exports=function(e,t,n,a){if(!(e instanceof t)||void 0!==a&&a in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){"use strict";var a=n(6),r=n(14),i=n(15),o=n(10)("species");e.exports=function(e){var t=a[e];i&&t&&!t[o]&&r.f(t,o,{configurable:!0,get:function(){return this}})}},function(e,t,n){var a=n(146),r=n(106).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return a(e,r)}},function(e,t,n){var a=n(5),r=n(145),i=n(106),o=n(107)("IE_PROTO"),s=function(){},l=function(){var e,t=n(109)("iframe"),a=i.length;for(t.style.display="none",n(105).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("