%PDF- %PDF-
Direktori : /home/bitrix/www/bitrix/js/main/imageeditor/external/photoeditorsdk/js/ |
Current File : //home/bitrix/www/bitrix/js/main/imageeditor/external/photoeditorsdk/js/photo-editor-sdk.min.js |
(function e(t,r){if(typeof exports==="object"&&typeof module==="object")module.exports=r();else if(typeof define==="function"&&define.amd)define([],r);else if(typeof exports==="object")exports["PhotoEditorSDK"]=r();else t["PhotoEditorSDK"]=r()})(typeof self!=="undefined"?self:this,function(){return function(e){var t={};function r(n){if(t[n]){return t[n].exports}var i=t[n]={i:n,l:false,exports:{}};e[n].call(i.exports,i,i.exports,r);i.l=true;return i.exports}r.m=e;r.c=t;r.d=function(e,t,n){if(!r.o(e,t)){Object.defineProperty(e,t,{configurable:false,enumerable:true,get:n})}};r.n=function(e){var t=e&&e.__esModule?function t(){return e["default"]}:function t(){return e};r.d(t,"a",t);return t};r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};r.p="";return r(r.s=157)}([function(e,t,r){e.exports={default:r(177),__esModule:true}},function(e,t,r){e.exports={default:r(194),__esModule:true}},function(e,t,r){e.exports={default:r(179),__esModule:true}},function(e,t,r){e.exports={default:r(182),__esModule:true}},function(e,t,r){e.exports=r(158).default},function(e,t,r){e.exports={default:r(214),__esModule:true}},function(e,t,r){e.exports={default:r(202),__esModule:true}},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(4);var h=r.n(c);var p=r(269);var v=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function d(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function y(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function _(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var g=function(e){_(t,e);function t(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};d(this,t);var r=y(this,(t.__proto__||f()(t)).call(this,e,{intensity:{type:c["OptionType"].NUMBER,default:1,setter:function e(t){this._stack&&this._stack.setIntensity(t);return t}},dirty:{type:c["OptionType"].BOOLEAN,default:true}}));r._stack=new p["a"](r._options.intensity);return r}v(t,[{key:"render",value:function e(t,r,n){var i=this;return this._stack.render(t,r,n).then(function(e){i.setDirty(false);return e})}},{key:"setDirtyForRenderer",value:function e(t,r){this._stack.setDirtyForRenderer(t,r)}},{key:"disposeRenderTextures",value:function e(){this._stack.disposeRenderTextures()}},{key:"dispose",value:function e(){this._stack.dispose()}}]);return t}(c["Configurable"]);g.identifier=null;g.isIdentity=false;g.displayName=null;g.PrimitivesStack=p["a"];t["a"]=g},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=r(271);r.d(t,"Brightness",function(){return n["a"]});var i=r(273);r.d(t,"Contrast",function(){return i["a"]});var a=r(275);r.d(t,"ColorMatrixPrimitive",function(){return a["a"]});var o=r(277);r.d(t,"Desaturation",function(){return o["a"]});var s=r(279);r.d(t,"Gamma",function(){return s["a"]});var u=r(281);r.d(t,"Glow",function(){return u["a"]});var l=r(283);r.d(t,"Gobblin",function(){return l["a"]});var f=r(285);r.d(t,"Grayscale",function(){return f["a"]});var c=r(146);r.d(t,"LookupTable",function(){return c["a"]});var h=r(288);r.d(t,"LookupTableImage",function(){return h["a"]});var p=r(290);r.d(t,"Saturation",function(){return p["a"]});var v=r(292);r.d(t,"SoftColorOverlay",function(){return v["a"]});var d=r(294);r.d(t,"ToneCurve",function(){return d["a"]});var y=r(295);r.d(t,"X400",function(){return y["a"]});var _=r(297);r.d(t,"ThreeDLookupTableImage",function(){return _["a"]})},function(e,t,r){"use strict";r.d(t,"a",function(){return h});r.d(t,"j",function(){return v});var n=r(30);var i=r(51);var a=r(125);var o=r(126);var s=r(42);var u=r(52);var l=r(22);var f=r(127);var c=r(31);r.d(t,"b",function(){return i["a"]});r.d(t,"g",function(){return a["a"]});r.d(t,"k",function(){return s["a"]});r.d(t,"h",function(){return o["a"]});r.d(t,"d",function(){return u["a"]});r.d(t,"f",function(){return n["a"]});r.d(t,"i",function(){return l["a"]});r.d(t,"c",function(){return c});r.d(t,"e",function(){return f["a"]});var h=2e3;var p=5;var v=p*4},function(e,t){var r=e.exports={version:"2.5.3"};if(typeof __e=="number")__e=r},function(e,t,r){var n=r(84)("wks");var i=r(64);var a=r(14).Symbol;var o=typeof a=="function";var s=e.exports=function(e){return n[e]||(n[e]=o&&a[e]||(o?a:i)("Symbol."+e))};s.store=n},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(4);var h=r.n(c);var p=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function v(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function d(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function y(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var _=function(e){y(t,e);function t(){v(this,t);return d(this,(t.__proto__||f()(t)).apply(this,arguments))}p(t,[{key:"update",value:function e(){}},{key:"getFilter",value:function e(){return this._filter}},{key:"dispose",value:function e(){if(this._filter){this._filter.dispose();this._filter=null}}}]);return t}(c["Configurable"]);t["a"]=_},function(e,t,r){var n=r(14);var i=r(10);var a=r(36);var o=r(26);var s="prototype";var u=function(e,t,r){var l=e&u.F;var f=e&u.G;var c=e&u.S;var h=e&u.P;var p=e&u.B;var v=e&u.W;var d=f?i:i[t]||(i[t]={});var y=d[s];var _=f?n:c?n[t]:(n[t]||{})[s];var g,m,b;if(f)r=t;for(g in r){m=!l&&_&&_[g]!==undefined;if(m&&g in d)continue;b=m?_[g]:r[g];d[g]=f&&typeof _[g]!="function"?r[g]:p&&m?a(b,n):v&&_[g]==b?function(e){var t=function(t,r,n){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,r)}return new e(t,r,n)}return e.apply(this,arguments)};t[s]=e[s];return t}(b):h&&typeof b=="function"?a(Function.call,b):b;if(h){(d.virtual||(d.virtual={}))[g]=b;if(e&u.R&&y&&!y[g])o(y,g,b)}}};u.F=1;u.G=2;u.S=4;u.P=8;u.B=16;u.W=32;u.U=64;u.R=128;e.exports=u},function(e,t){var r=e.exports=typeof window!="undefined"&&window.Math==Math?window:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();if(typeof __g=="number")__g=r},function(e,t,r){e.exports={default:r(197),__esModule:true}},function(e,t,r){"use strict";r.d(t,"a",function(){return s});var n=r(0);var i=r.n(n);var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function o(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var s=function(){function e(t){o(this,e);this._seed=t===undefined?e.TimeSeed():t}a(e,[{key:"seed",value:function t(r){this._seed=r===undefined?e.TimeSeed():r}},{key:"next",value:function t(){var r=this._seed|0;var n=r/e.SEED_DIVIDER|0;var i=r%e.SEED_DIVIDER|0;r=e.SEED_LOW_MULTIPLY*i-e.SEED_HIGH_MULTIPLY*n;if(r<=0){r+=e.MAX}if(r===-1){r=e.MAX-1}this._seed=r;return r}},{key:"nextInRange",value:function e(t,r){if(r===undefined){r=t;t=0}return t+this.next()%(r-t+1)}},{key:"nextBool",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return this.nextInRange(t+r-1)>=t}},{key:"pickNext",value:function e(t){if(!Array.isArray(t)){return null}return t[this.next()%t.length]}}],[{key:"TimeSeed",value:function e(){return Date.now()}}]);return e}();s.MAX=2147483647;s.SEED_DIVIDER=127773;s.SEED_LOW_MULTIPLY=16807;s.SEED_HIGH_MULTIPLY=2836},function(e,t,r){"use strict";r.d(t,"a",function(){return p});var n=r(6);var i=r.n(n);var a=r(0);var o=r.n(a);var s=r(4);var u=r.n(s);var l=i.a||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}}return e};var f=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;o()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var h=s["Math"].Rectangle;var p=function(){function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;c(this,e);this.top=t;this.left=r;this.bottom=n;this.right=i}f(e,[{key:"multiply",value:function e(t){this.top*=t;this.left*=t;this.bottom*=t;this.right*=t}},{key:"toObject",value:function e(){return l({},this)}},{key:"equals",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return Math.abs(t.top-this.top)<=r&&Math.abs(t.left-this.left)<=r&&Math.abs(t.bottom-this.bottom)<=r&&Math.abs(t.right-this.right)<=r}},{key:"scale",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;var r=arguments[1];if(r===undefined){r=t}this.top*=r;this.bottom*=r;this.left*=t;this.right*=t;return this}},{key:"clone",value:function t(){return new e(this.top,this.left,this.bottom,this.right)}},{key:"applyToRectangle",value:function e(t){return new h(t.x+this.left,t.y+this.top,t.width-this.left-this.right,t.height-this.top-this.bottom)}}],[{key:"ZERO",get:function t(){return new e(0,0,0,0)}}]);return e}()},function(e,t,r){var n=r(24);e.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},function(e,t,r){"use strict";r.d(t,"a",function(){return k});var n=r(6);var i=r.n(n);var a=r(0);var o=r.n(a);var s=r(2);var u=r.n(s);var l=r(3);var f=r.n(l);var c=r(1);var h=r.n(c);var p=r(4);var v=r.n(p);var d=r(59);var y=r(17);var _=r(60);var g=r(43);var m=i.a||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}}return e};var b=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;o()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function w(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function x(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function T(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)u.a?u()(e,t):e.__proto__=t}var k=function(e){T(t,e);function t(){w(this,t);return x(this,(t.__proto__||h()(t)).apply(this,arguments))}b(t,[{key:"_calculateLayoutElements",value:function e(){var t=this.serializeOptions(),r=t.attributes,n=t.imageInsets,i=t.size,a=t.width;var o=this.getWords().joined(1)[0]||"";var s=r.fontIdentifier;var u=new _["a"]({text:o,fontIdentifier:s});u.fitWidth(this._getTextFrame().width);var l=u.getTextMetrics().height+n.top+n.bottom;i.height=l;var f=this._getTextFrame();var c=new g["a"]({text:o,frame:f,font:u});return[c]}}]);return t}(d["a"]);k.prototype.availableOptions=m({},d["a"].prototype.availableOptions,{imageInsets:{type:p["OptionType"].OBJECT,default:new y["a"]}})},function(e,t,r){"use strict";r.d(t,"a",function(){return k});var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(29);var f=r.n(l);var c=r(356);var h=r.n(c);var p=r(1);var v=r.n(p);var d=r(4);var y=r.n(d);var _=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function g(e){return function(){var t=e.apply(this,arguments);return new f.a(function(e,r){function n(i,a){try{var o=t[i](a);var s=o.value}catch(e){r(e);return}if(o.done){e(s)}else{return f.a.resolve(s).then(function(e){n("next",e)},function(e){n("throw",e)})}}return n("next")})}}function m(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function b(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function w(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var x=void 0;if(true){x=window.Image}var T=function(e){w(t,e);function t(){m(this,t);return b(this,(t.__proto__||v()(t)).apply(this,arguments))}_(t,[{key:"loadImages",value:function(){var e=g(h.a.mark(function e(t){var r,n,i;return h.a.wrap(function e(a){while(1){switch(a.prev=a.next){case 0:r=[];n=0;case 2:if(!(n<t.length)){a.next=10;break}i=t[n];a.next=6;return this.addImage(i.path,i.fullPath,i.image);case 6:r.push(i);case 7:n++;a.next=2;break;case 10:return a.abrupt("return",r);case 11:case"end":return a.stop()}}},e,this)}));function t(t){return e.apply(this,arguments)}return t}()},{key:"addImage",value:function e(t,r,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:"anonymous";var a=this.getImages();if(!n){return new f.a(function(e,o){n=new x;n.onload=function(){a[t]={fullPath:r,image:n};e({fullPath:r,image:n})};n.crossOrigin=d["Utils"].getCrossOriginValue(i);n.onerror=o;n.src=r})}else{a[t]={fullPath:r,image:n};return f.a.resolve({fullPath:r,image:n})}}},{key:"getImage",value:function e(t){var r=this.getImages();var n=r[t];return n?n.image:null}},{key:"getVariation",value:function e(t){return this.getFonts()[t]}},{key:"addFont",value:function e(t,r){var n=this.getFonts();n[t]=r;return r}}]);return t}(d["Configurable"]);T.prototype.availableOptions={images:{type:d["OptionType"].OBJECT,default:{}},fonts:{type:d["OptionType"].OBJECT,default:{}}};var k=new T},function(e,t,r){var n=r(18);var i=r(110);var a=r(80);var o=Object.defineProperty;t.f=r(25)?Object.defineProperty:function e(t,r,s){n(t);r=a(r,true);n(s);if(i)try{return o(t,r,s)}catch(e){}if("get"in s||"set"in s)throw TypeError("Accessors not supported!");if("value"in s)t[r]=s.value;return t}},function(e,t,r){"use strict";(function(e){var n=r(6);var i=r.n(n);var a=r(15);var o=r.n(a);var s=r(35);var u=r.n(s);var l=r(39);var f=r.n(l);var c=r(0);var h=r.n(c);var p=r(29);var v=r.n(p);var d=r(69);var y=r.n(d);var _=r(1);var g=r.n(_);var m=r(50);var b=r(207);var w=i.a||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}}return e};var x=typeof f.a==="function"&&typeof u.a==="symbol"?function(e){return typeof e}:function(e){return e&&typeof f.a==="function"&&e.constructor===f.a&&e!==f.a.prototype?"symbol":typeof e};var T=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;h()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function k(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++){r[t]=e[t]}return r}else{return o()(e)}}function R(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var E=function(){function t(){R(this,t)}T(t,null,[{key:"isArray",value:function e(t){return Object.prototype.toString.call(t)==="[object Array]"}},{key:"isPlainObject",value:function e(t){if((typeof t==="undefined"?"undefined":x(t))!=="object"||!t){return false}if(typeof g.a==="function"){var r=g()(t);return r===Object.prototype||r===null}return Object.prototype.toString.call(t)==="[object Object]"}},{key:"isMobile",value:function e(){if(typeof navigator==="undefined")return false;var t=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))}},{key:"isBrowser",value:function e(){return typeof window!=="undefined"}},{key:"isNode",value:function t(){return typeof window==="undefined"&&typeof e!=="undefined"}},{key:"values",value:function e(t){var e=[];for(var r in t){e.push(t[r])}return e}},{key:"isDOMElement",value:function e(t){return(typeof HTMLElement==="undefined"?"undefined":x(HTMLElement))==="object"?t instanceof HTMLElement:t&&(typeof t==="undefined"?"undefined":x(t))==="object"&&t!==null&&t.nodeType===1&&typeof t.nodeName==="string"}},{key:"isTouchEvent",value:function e(t){return t.type.indexOf("touch")!==-1}},{key:"resizeVectorToFit",value:function e(t,r){var n=Math.min(r.x/t.x,r.y/t.y);var i=t.clone().multiply(n);return i}},{key:"resizeVectorToFill",value:function e(t,r){var n=t.x/t.y;var i=r.x/r.y;if(n>i){return r.clone().set(r.y*n,r.y)}else{return r.clone().set(r.x,r.x/n)}}},{key:"isExtendable",value:function e(t){return typeof t!=="undefined"&&t!==null&&((typeof t==="undefined"?"undefined":x(t))==="object"||typeof t==="function")}},{key:"defaults",value:function e(t){var r={};for(var n in t){r[n]=t[n]}for(var i=arguments.length,a=Array(i>1?i-1:0),o=1;o<i;o++){a[o-1]=arguments[o]}for(var s=0;s<a.length;s++){var u=a[s];for(var l in u){if(typeof r[l]==="undefined"){r[l]=u[l]}}}return r}},{key:"deepMerge",value:function e(r){var n=function e(r,n){if(n===undefined){return e(null,r)}if(Array.isArray(n)){return[].concat(k(n))}if(!t.isPlainObject(n)){return n}if(!t.isPlainObject(r)){return w({},n)}var i=w({},r);y()(n).forEach(function(t){var a=n[t];if(a===undefined){return}i[t]=e(r[t],a)});return i};for(var i=arguments.length,a=Array(i>1?i-1:0),o=1;o<i;o++){a[o-1]=arguments[o]}return a.reduce(n,r)}},{key:"deepDefaults",value:function e(r){for(var n=arguments.length,i=Array(n>1?n-1:0),a=1;a<n;a++){i[a-1]=arguments[a]}var o=[].concat(i).reverse();return t.deepMerge.apply(t,k(o).concat([r]))}},{key:"deepClone",value:function e(r){var n={};for(var i in r){if(t.isExtendable(r[i])){n[i]=t.deepClone(r[i])}else{n[i]=r[i]}}return n}},{key:"getDeepProperty",value:function e(t,r){if(typeof r==="string"){return t[r]}if(!Array.isArray(r)){return undefined}var n=function e(t,r){var n=void 0;try{n=r(t)}catch(e){if(!(e instanceof TypeError)){throw e}}return n};return r.reduce(function(e,t){return e?typeof t==="function"?n(e,t):e[t]:null},t)}},{key:"extend",value:function e(t){var r={};for(var n in t){r[n]=t[n]}for(var i=arguments.length,a=Array(i>1?i-1:0),o=1;o<i;o++){a[o-1]=arguments[o]}for(var s=0;s<a.length;s++){var u=a[s];for(var l in u){r[l]=u[l]}}return r}},{key:"clone",value:function e(t){return this.extend({},t)}},{key:"createBlobURIFromDataURI",value:function t(r){var n=typeof window==="undefined"?e:window;if(!n.Blob||!n.URL||!ArrayBuffer||!Uint8Array){return r}var i=m["a"].decode(r.split(",")[1]);var a=r.split(",")[0].split(":")[1].split(";")[0];var o=new ArrayBuffer(i.length);var s=new Uint8Array(o);for(var u=0;u<i.length;u++){s[u]=i[u]}var l=new n.Blob([o],{type:a});return n.URL.createObjectURL(l)}},{key:"getUUID",value:function e(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=Math.random()*16|0;var r=e==="x"?t:t&3|8;return r.toString(16)})}},{key:"createCanvas",value:function e(){return document.createElement("canvas")}},{key:"isPowerOfTwo",value:function e(t){return(t.x&t.x-1)===0&&(t.y&t.y-1)===0}},{key:"nextLowestPOT",value:function e(t){for(var r=1;r<32;r<<=1){t=t|t>>r}return t-(t>>1)}},{key:"nextHighestPOT",value:function e(t){t--;for(var r=1;r<32;r<<=1){t=t|t>>r}return t+1}},{key:"moveArrayItem",value:function e(t,r,n){if(n>=t.length){var i=n-t.length;while(i--+1){t.push(undefined)}}t.splice(n,0,t.splice(r,1)[0])}},{key:"ensureCanvasDimensions",value:function e(t,r){if(t.width!==r.x||t.height!==r.y){t.width=r.x;t.height=r.y}}},{key:"byteArrayToString",value:function e(t){return t.map(function(e){return String.fromCharCode(e)}).join("")}},{key:"clamp",value:function e(t,r,n){return Math.max(r,Math.min(t,n))}},{key:"wildCardMatch",value:function e(t,r){return new RegExp("^"+r.split("*").join(".*")+"$").test(t)}},{key:"flipObject",value:function e(t){var r={};for(var n in t){r[t[n]]=n}return r}},{key:"cloneOptions",value:function e(t){var r={};for(var n in t){var i=t[n];if(Array.isArray(i)){i=i.slice()}else if(i.clone){i=i.clone()}r[n]=i}return r}},{key:"ISODateString",value:function e(t){function r(e){return e<10?"0"+e:e}return t.getUTCFullYear()+"-"+r(t.getUTCMonth()+1)+"-"+r(t.getUTCDate())+"T"+r(t.getUTCHours())+":"+r(t.getUTCMinutes())+":"+r(t.getUTCSeconds())+"Z"}},{key:"getCrossOriginValue",value:function e(t){if(!t){return"anonymous"}if(t==="none"){return undefined}return t}},{key:"shallowEqual",value:function e(t,r){if(t===r){return true}if((typeof t==="undefined"?"undefined":x(t))!=="object"||t===null||(typeof r==="undefined"?"undefined":x(r))!=="object"||r===null){return false}var n=y()(t);var i=y()(r);if(n.length!==i.length){return false}var a=hasOwnProperty.bind(r);for(var o=0;o<n.length;o++){if(!a(n[o])||t[n[o]]!==r[n[o]]){return false}}return true}},{key:"enableIf",value:function e(t,r){return t?r:undefined}},{key:"invariant",value:function e(t,r){if(!t){var n=new Error(r);throw n}}},{key:"executePromises",value:function e(t){var r=t.length;var n=0;var i=[];var a=[];return new v.a(function(e,o){var s=function t(){n++;if(n>=r){if(a.length<=0){e(i)}else{o(a)}}};var u=function e(t){i.push(t);s()};var l=function e(t){a.push(t);s()};t.forEach(function(e){e.then(u).catch(l)})})}}]);return t}();E.Array=b["a"];t["a"]=E}).call(t,r(41))},function(e,t,r){"use strict";r.d(t,"a",function(){return f});var n=r(0);var i=r.n(n);var a=r(4);var o=r.n(a);var s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function u(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var l=a["Math"].Rectangle;var f=function(){function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;u(this,e);this.width=t;this.height=r}s(e,[{key:"set",value:function e(t,r){this.width=t;this.height=r}},{key:"aspect",value:function e(){return this.width/this.height}},{key:"rectangle",value:function e(t,r){return new l(t,r,this.width,this.height)}},{key:"clone",value:function t(){return new e(this.width,this.height)}},{key:"scale",value:function e(t,r){if(r===undefined){r=t}this.width*=t;this.height*=r;return this}},{key:"copy",value:function e(t){this.width=t.width;this.height=t.height;return this}},{key:"fitInWidthWithOther",value:function t(r){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:new e;this.copy(e.fitTwoInWidth(r,this,n)[0]);return this}}],[{key:"fitTwoInWidth",value:function t(r,n,i){var a=n.width*i.height+n.height*i.width;var o=i.height*r/a;var s=n.width*o;var u=n.height*o;return[new e(s,u),new e(r-s,u)]}}]);return e}()},function(e,t){e.exports=function(e){return typeof e==="object"?e!==null:typeof e==="function"}},function(e,t,r){e.exports=!r(37)(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},function(e,t,r){var n=r(21);var i=r(46);e.exports=r(25)?function(e,t,r){return n.f(e,t,i(1,r))}:function(e,t,r){e[t]=r;return e}},function(e,t){var r={}.hasOwnProperty;e.exports=function(e,t){return r.call(e,t)}},function(e,t,r){var n=r(113);var i=r(78);e.exports=function(e){return n(i(e))}},function(e,t,r){e.exports={default:r(184),__esModule:true}},function(e,t,r){"use strict";(function(e){var n=r(15);var i=r.n(n);var a=r(0);var o=r.n(a);var s=r(200);var u=r.n(s);var l=r(22);var f=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;o()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function c(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++){r[t]=e[t]}return r}else{return i()(e)}}function h(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var p=[{name:"trace",type:"trace",background:"#EEEEEE",color:"#AAAAAA"},{name:"info",type:"log",background:"#BDE5F8",color:"#00529B"},{name:"warn",type:"warn",background:"#FEEFB3",color:"#9F6000"},{name:"error",type:"error",background:"#FFBABA",color:"#D8000C"},{name:"log",type:"log",background:"#EEEEEE",color:"#1f4f6b"}];var v=function e(){return console&&console.group&&console.groupCollapsed&&console.groupEnd};var d=function t(){return(!e||e&&e.browser)&&typeof navigator!=="undefined"&&navigator.userAgent.match(/Gecko|WebKit/i)&&!navigator.userAgent.match(/Trident/)};var y=function e(t,r){return["background: #2D7BFF; line-height: 20px; padding: 4px 0","background: #2B2B2B; color: white; line-height: 20px; padding: 4px 0","background: #2D7BFF; line-height: 20px; padding: 4px 0","background: "+t+"; color: "+r+"; line-height: 20px; padding: 4px 0; font-weight: bold","background: #2B2B2B; color: white; line-height: 20px; padding: 4px 0","background: #2D7BFF; line-height: 20px; padding: 4px 0"]};var _=function(){function e(){var t=this;var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"warn";var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:p;h(this,e);this._levels=[].concat(c(n));this._maxLevel=this.getLevelIndexByName(r);this._consoleFuncs={trace:function e(){if(v()){var t;(t=console).groupCollapsed.apply(t,arguments);console.trace();console.groupEnd()}else{var r;(r=console).trace.apply(r,arguments)}}};this._levels.forEach(function(e){var r=e.name;t[r]=function(e){for(var n=arguments.length,i=Array(n>1?n-1:0),a=1;a<n;a++){i[a-1]=arguments[a]}t._log.apply(t,[r,e].concat(i))}})}f(e,[{key:"getLevelIndexByName",value:function e(t){return l["a"].Array.findIndex(this._levels,function(e){return e.name===t})}},{key:"getLevelObjectByName",value:function e(t){return l["a"].Array.find(this._levels,function(e){return e.name===t})}},{key:"canLog",value:function e(t){var r=this.getLevelIndexByName(t);if(r<0){return false}return r>=this._maxLevel}},{key:"setLevel",value:function e(t){var r=this.getLevelIndexByName(t);if(r<0){return}this._maxLevel=r}},{key:"_log",value:function e(t,r){var n=this.getLevelObjectByName(t);if(!n||!this.canLog(t)){return}var i=n.name,a=n.type,o=n.background,s=n.color;for(var f=arguments.length,h=Array(f>2?f-2:0),p=2;p<f;p++){h[p-2]=arguments[p]}var _=h.filter(function(e){return e!==undefined}).map(function(e){if(e.toObject){return JSON.parse(u()(e.toObject()))}return e});var g=this._consoleFuncs[a]||console[a]||console.log;var m=_.length;var b=y(o,s);if(!d()){var w=_.length;if(w<=0){g("PhotoEditorSDK | "+r+" ");return}if(w===1&&typeof _[0]==="string"){g("PhotoEditorSDK | "+r+" | "+_[0]);return}g.apply(undefined,["PhotoEditorSDK | "+r+" | "].concat(c(_)));return}if(m<=0){g.apply(undefined,["%c %c PhotoEditorSDK %c %c "+r+" %c %c "].concat(c(b)));return}if(m===1&&typeof _[0]==="string"){g.apply(undefined,["%c %c PhotoEditorSDK %c %c "+r+" %c "+_[0]+" %c "].concat(c(b)));return}if(v()){var x;(x=console).groupCollapsed.apply(x,["%c %c PhotoEditorSDK %c %c "+r+" %c"].concat(c(l["a"].Array.init(b))));g.apply(undefined,c(_));console.groupEnd()}else{g.apply(undefined,["%c %c PhotoEditorSDK %c %c "+r+" %c"].concat(c(l["a"].Array.init(b)),c(_)))}}},{key:"image",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";var r=arguments[1];var e=new window.Image;var n=function r(){var n=e.width;var i=e.height;t&&console.log(t);console.log("%c+","\n font-size: 1px;\n padding: 0px "+Math.floor(n/2)+"px;\n line-height: "+i+"px;\n background: url("+e.src+");\n color: transparent;\n background-repeat: no-repeat;\n background-size: "+n+"px "+i+"px;")};e.onload=n;if(r instanceof window.HTMLCanvasElement){e.src=r.toDataURL()}else if(r instanceof window.Image){e=r;n()}else if(typeof r==="string"){e.src=r}else{this.log(t,r)}return e}},{key:"texture",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";var r=arguments[1];if(!r){this.log(t,"texture: null or undefined");return}var n=r.getBaseTexture();var i=n.getRenderers();var a=l["a"].Array.find(i,function(e){return e&&e.constructor.type==="WebGL"});var o=n.getFrame(),s=o.width,u=o.height;if(a){var f=a.getContext();var c=n.getGLTextureForRenderer(a);this.logGlTexture(f,c,s,u,t)}else{g.image(t,n.getSource())}}},{key:"logGlTexture",value:function e(t,r){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:150;var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:150;var a=arguments[4];t.bindTexture(t.TEXTURE_2D,r);var o=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,o);t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0);var s=new Uint8Array(n*i*4);t.readPixels(0,0,n,i,t.RGBA,t.UNSIGNED_BYTE,s);t.deleteFramebuffer(o);var u=document.createElement("canvas");u.width=n;u.height=i;var l=u.getContext("2d");var f=l.createImageData(n,i);f.data.set(s);l.putImageData(f,0,0);return g.image(a,u)}}]);return e}();var g=new _("warn");t["a"]=g}).call(t,r(124))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});r.d(t,"RenderType",function(){return n});r.d(t,"ImageFormat",function(){return i});r.d(t,"Events",function(){return a});r.d(t,"OptionType",function(){return o});r.d(t,"UniformType",function(){return s});r.d(t,"RendererType",function(){return u});var n={IMAGE:"image",DATAURL:"data-url",BUFFER:"buffer",BLOB:"blob",MSBLOB:"ms-blob"};var i={PNG:"image/png",JPEG:"image/jpeg"};var a={OPERATION_UPDATED:"operation:update"};var o={NUMBER:"number",VECTOR2:"vector2",COLOR_MATRIX:"color-matrix",COLOR:"color",ARRAY:"array",OBJECT:"object",STRING:"string",BOOLEAN:"boolean",CONFIGURABLE:"configurable",IMAGE:"image",FUNCTION:"function",TEXTURE:"texture",ALL:"*"};var s={SAMPLER2D:"sampler2d",INT:"i",INT1:"1i",FLOAT:"f",FLOAT1:"1f",FLOAT2:"2f",FLOAT_VECTOR2:"2fv",FLOAT3:"3f",FLOAT4:"4f",MAT3:"mat3",MAT3FV:"mat3fv",MAT4:"mat4"};var u={WEBGL:"webgl",CANVAS:"canvas"}},function(e,t,r){"use strict";(function(e){var n=r(35);var i=r.n(n);var a=r(39);var o=r.n(a);var s=r(29);var u=r.n(s);var l=r(0);var f=r.n(l);var c=r(225);var h=r.n(c);var p=typeof o.a==="function"&&typeof i.a==="symbol"?function(e){return typeof e}:function(e){return e&&typeof o.a==="function"&&e.constructor===o.a&&e!==o.a.prototype?"symbol":typeof e};var v=function e(){"use strict";var t,r,n,i=Object.prototype.toString,a=typeof h.a!="undefined"?function e(t){return h()(t)}:setTimeout;try{Object.defineProperty({},"x",{});t=function e(t,r,n,i){return f()(t,r,{value:n,writable:true,configurable:i!==false})}}catch(e){t=function e(t,r,n){t[r]=n;return t}}n=function e(){var t,n,i;function a(e,t){this.fn=e;this.self=t;this.next=void 0}return{add:function e(r,o){i=new a(r,o);if(n){n.next=i}else{t=i}n=i;i=void 0},drain:function e(){var i=t;t=n=r=void 0;while(i){i.fn.call(i.self);i=i.next}}}}();function o(e,t){n.add(e,t);if(!r){r=a(n.drain)}}function s(e){var t,r=typeof e==="undefined"?"undefined":p(e);if(e!=null&&(r=="object"||r=="function")){t=e.then}return typeof t=="function"?t:false}function u(){for(var e=0;e<this.chain.length;e++){l(this,this.state===1?this.chain[e].success:this.chain[e].failure,this.chain[e])}this.chain.length=0}function l(e,t,r){var n,i;try{if(t===false){r.reject(e.msg)}else{if(t===true){n=e.msg}else{n=t.call(void 0,e.msg)}if(n===r.promise){r.reject(TypeError("Promise-chain cycle"))}else if(i=s(n)){i.call(n,r.resolve,r.reject)}else{r.resolve(n)}}}catch(e){r.reject(e)}}function c(e){var t,r=this;if(r.triggered){return}r.triggered=true;if(r.def){r=r.def}try{if(t=s(e)){o(function(){var n=new y(r);try{t.call(e,function e(){c.apply(n,arguments)},function e(){v.apply(n,arguments)})}catch(e){v.call(n,e)}})}else{r.msg=e;r.state=1;if(r.chain.length>0){o(u,r)}}}catch(e){v.call(new y(r),e)}}function v(e){var t=this;if(t.triggered){return}t.triggered=true;if(t.def){t=t.def}t.msg=e;t.state=2;if(t.chain.length>0){o(u,t)}}function d(e,t,r,n){for(var i=0;i<t.length;i++){(function i(a){e.resolve(t[a]).then(function e(t){r(a,t)},n)})(i)}}function y(e){this.def=e;this.triggered=false}function _(e){this.promise=e;this.state=0;this.triggered=false;this.chain=[];this.msg=void 0}function g(e){if(typeof e!="function"){throw TypeError("Not a function")}if(this.__NPO__!==0){throw TypeError("Not a promise")}this.__NPO__=1;var t=new _(this);this["then"]=function e(r,n){var i={success:typeof r=="function"?r:true,failure:typeof n=="function"?n:false};i.promise=new this.constructor(function e(t,r){if(typeof t!="function"||typeof r!="function"){throw TypeError("Not a function")}i.resolve=t;i.reject=r});t.chain.push(i);if(t.state!==0){o(u,t)}return i.promise};this["catch"]=function e(t){return this.then(void 0,t)};try{e.call(void 0,function e(r){c.call(t,r)},function e(r){v.call(t,r)})}catch(e){v.call(t,e)}}var m=t({},"constructor",g,false);g.prototype=m;t(m,"__NPO__",0,false);t(g,"resolve",function e(t){var r=this;if(t&&(typeof t==="undefined"?"undefined":p(t))=="object"&&t.__NPO__===1){return t}return new r(function e(r,n){if(typeof r!="function"||typeof n!="function"){throw TypeError("Not a function")}r(t)})});t(g,"reject",function e(t){return new this(function e(r,n){if(typeof r!="function"||typeof n!="function"){throw TypeError("Not a function")}n(t)})});t(g,"all",function e(t){var r=this;if(i.call(t)!="[object Array]"){return r.reject(TypeError("Not an array"))}if(t.length===0){return r.resolve([])}return new r(function e(n,i){if(typeof n!="function"||typeof i!="function"){throw TypeError("Not a function")}var a=t.length,o=Array(a),s=0;d(r,t,function e(t,r){o[t]=r;if(++s===a){n(o)}},i)})});t(g,"race",function e(t){var r=this;if(i.call(t)!="[object Array]"){return r.reject(TypeError("Not an array"))}return new r(function e(n,i){if(typeof n!="function"||typeof i!="function"){throw TypeError("Not a function")}d(r,t,function e(t,r){n(r)},i)})});return g};var d=typeof e==="undefined"?window:e;var y=typeof u.a!=="undefined"?u.a:v();d.Promise=d.Promise||y;t["a"]=y}).call(t,r(41))},function(e,t,r){"use strict";r.d(t,"a",function(){return h});var n=r(15);var i=r.n(n);var a=r(0);var o=r.n(a);var s=r(4);var u=r.n(s);var l=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;o()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function f(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++){r[t]=e[t]}return r}else{return i()(e)}}function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var h=function(){function e(t){c(this,e);this.words=[];if(t){this.splitIntoWords(t)}}l(e,[{key:"splitIntoWords",value:function e(t){this.words=t.match(/\S+/g)||[];return[].concat(f(this.words))}},{key:"get",value:function e(){return[].concat(f(this.words))}},{key:"getWord",value:function e(t){return this.words[t]}},{key:"set",value:function e(t){this.words=[].concat(f(t));return this}},{key:"slice",value:function t(r,n){return e.fromWords(this.words.slice(r,n))}},{key:"getLowerCase",value:function e(){return this.words.map(function(e){return e.toLowerCase()})}},{key:"getUpperCase",value:function e(){return this.words.map(function(e){return e.toUpperCase()})}},{key:"size",value:function e(){return this.words.length}},{key:"countNumberOfCharacters",value:function e(){return this.words.reduce(function(e,t){return e+t.length},0)}},{key:"joined",value:function e(t){var r=this;var n=this.size();var i=Math.floor(n/t);var a=n%t;var o=0;var u=0;return s["Utils"].Array.range(0,t).map(function(e){o=u;var t=i+(e<a?1:0);u=Math.min(o+t,n);return s["Utils"].Array.range(o,u).reduce(function(e,t){return e+(t===o?"":" ")+r.words[t]},"")})}}],[{key:"fromWords",value:function t(r){var n=new e;n.words=[].concat(f(r));return n}}]);return e}()},function(e,t,r){"use strict";r.d(t,"c",function(){return p});r.d(t,"e",function(){return v});r.d(t,"d",function(){return d});r.d(t,"b",function(){return _});r.d(t,"a",function(){return g});var n=r(70);var i=r.n(n);var a=r(71);var o=r.n(a);var s=r(4);var u=r.n(s);var l=function(){function e(e,t){var r=[];var n=true;var i=false;var a=undefined;try{for(var s=o()(e),u;!(n=(u=s.next()).done);n=true){r.push(u.value);if(t&&r.length===t)break}}catch(e){i=true;a=e}finally{try{if(!n&&s["return"])s["return"]()}finally{if(i)throw a}}return r}return function(t,r){if(Array.isArray(t)){return t}else if(i()(Object(t))){return e(t,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();var f=s["Math"].Rectangle,c=s["Math"].Vector2;var h=function e(t,r,n,i){t.drawImage(r,n.x,n.y,n.width,n.height,i.x,i.y,i.width,i.height)};var p=function e(t,r,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:"source-over";t.save();t.fillStyle=n.toRGBA();t.globalCompositeOperation=i;t.fillRect(r.x,r.y,r.width,r.height);t.restore()};var v=function e(t,r,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:4;t.save();t.strokeStyle=n.toRGBA();t.lineWidth=i;t.strokeRect(r.x,r.y,r.width,r.height);t.restore()};var d=function e(t,r,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:"source-over";t.save();var a=r.height/2;var o=r.y+a;var s=r.x+a;var u=r.x+r.width;t.fillStyle=n.toRGBA();t.globalCompositeOperation=i;while(s<u){t.beginPath();t.arc(s,o,a,0,2*Math.PI);t.fill();s+=a*4}t.restore()};var y=function e(t,r){var n=r.applyToRectangle(t);var i=t.x,a=t.y,o=t.width,s=t.height;var u=[f.FromDiagonalPoints(new c(0,0),new c(n.x,n.y)),f.FromDiagonalPoints(new c(0,n.y+n.height),new c(n.x,s)),f.FromDiagonalPoints(new c(n.x+n.width,n.y+n.height),new c(o,s)),f.FromDiagonalPoints(new c(n.x+n.width,0),new c(o,n.y))].map(function(e){return e.translate(i,a)});var l=[f.FromDiagonalPoints(new c(n.x,0),new c(n.x+n.width,n.y)),f.FromDiagonalPoints(new c(0,n.y),new c(n.x,n.y+n.height)),f.FromDiagonalPoints(new c(n.x,n.y+n.height),new c(n.x+n.width,s)),f.FromDiagonalPoints(new c(n.x+n.width,n.y),new c(o,n.y+n.height))].map(function(e){return e.translate(i,a)});return{corners:u,bars:l,center:n}};var _=function e(t,r,n,i){var a=r.naturalWidth||r.width;var o=r.naturalHeight||r.height;var u=y(new f(0,0,a,o),i);var c=y(n,i);h(t,r,u.center,c.center);s["Utils"].Array.zip(u.corners,c.corners).forEach(function(e){var n=l(e,2),i=n[0],a=n[1];return h(t,r,i,a)});s["Utils"].Array.zip(u.bars,c.bars).forEach(function(e){var n=l(e,2),i=n[0],a=n[1];return h(t,r,i,a)})};var g=function e(t,r,n,i){var a=arguments.length>4&&arguments[4]!==undefined?arguments[4]:"source-atop";t.save();if(i){t.globalAlpha=i.a}t.drawImage(r,n.x,n.y,n.width,n.height);if(i){t.globalAlpha=1}if(i){var o=i.clone();o.a=1;p(t,n,o,a)}t.restore()}},function(e,t,r){e.exports={default:r(160),__esModule:true}},function(e,t,r){var n=r(63);e.exports=function(e,t,r){n(e);if(t===undefined)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return true}}},function(e,t){e.exports={}},function(e,t,r){e.exports={default:r(169),__esModule:true}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=r(68);var i=r(31);var a=r(50);var o=r(52);var s=r(22);var u=r(55);var l=r(51);var f=r(30);var c=r(32);var h=r(127);var p=r(237);var v=r(247);r.d(t,"requestAnimationFrame",function(){return v["b"]});r.d(t,"cancelAnimationFrame",function(){return v["a"]});r.d(t,"Engine",function(){return n["a"]});r.d(t,"EventEmitter",function(){return o["a"]});r.d(t,"Utils",function(){return s["a"]});r.d(t,"Configurable",function(){return u["a"]});r.d(t,"Color",function(){return l["a"]});r.d(t,"Constants",function(){return i});r.d(t,"Log",function(){return f["a"]});r.d(t,"Promise",function(){return c["a"]});r.d(t,"GLUtils",function(){return h["a"]});r.d(t,"Base64",function(){return a["a"]});r.d(t,"LicenseChecker",function(){return p["a"]});var d=r(137);r.d(t,"Vector2",function(){return d["Vector2"]});r.d(t,"Vector3",function(){return d["Vector3"]});r.d(t,"Rectangle",function(){return d["Rectangle"]});r.d(t,"Matrix",function(){return d["Matrix"]});r.d(t,"ColorMatrix",function(){return d["ColorMatrix"]})},function(e,t){var r;r=function(){return this}();try{r=r||Function("return this")()||(1,eval)("this")}catch(e){if(typeof window==="object")r=window}e.exports=r},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function o(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var s=function(){function e(t,r){o(this,e);this.x=t;this.y=r;if(typeof this.x==="undefined"){this.x=0}if(typeof this.y==="undefined"){this.y=0}}a(e,[{key:"set",value:function e(t,r){this.x=t;this.y=r;return this}},{key:"clone",value:function t(){return new e(this.x,this.y)}},{key:"copy",value:function e(t){this.x=t.x;this.y=t.y;return this}},{key:"clamp",value:function t(r,n){var i=r!==null&&typeof r!=="undefined";var a=n!==null&&typeof n!=="undefined";if(!(r instanceof e)&&i){r=new e(r,r)}if(!(n instanceof e)&&a){n=new e(n,n)}if(i){this.x=Math.max(r.x,this.x);this.y=Math.max(r.y,this.y)}if(a){this.x=Math.min(n.x,this.x);this.y=Math.min(n.y,this.y)}return this}},{key:"divide",value:function t(r,n){if(r instanceof e){this.x/=r.x;this.y/=r.y}else{this.x/=r;this.y/=typeof n==="undefined"?r:n}return this}},{key:"subtract",value:function t(r,n){if(r instanceof e){this.x-=r.x;this.y-=r.y}else{this.x-=r;this.y-=typeof n==="undefined"?r:n}return this}},{key:"multiply",value:function t(r,n){if(r instanceof e){this.x*=r.x;this.y*=r.y}else{this.x*=r;this.y*=typeof n==="undefined"?r:n}return this}},{key:"add",value:function t(r,n){if(r instanceof e){this.x+=r.x;this.y+=r.y}else{this.x+=r;this.y+=typeof n==="undefined"?r:n}return this}},{key:"equals",value:function t(r,n){if(r instanceof e){return r.x===this.x&&r.y===this.y}else{return r===this.x&&n===this.y}}},{key:"flip",value:function e(){var t=this.x;this.x=this.y;this.y=t;return this}},{key:"round",value:function e(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this}},{key:"ceil",value:function e(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this}},{key:"floor",value:function e(){this.x=this.x|0;this.y=this.y|0;return this}},{key:"abs",value:function e(){this.x=Math.abs(this.x);this.y=Math.abs(this.y);return this}},{key:"len",value:function e(){return Math.sqrt(this.x*this.x+this.y*this.y)}},{key:"min",value:function e(){return Math.min(this.x,this.y)}},{key:"max",value:function e(){return Math.max(this.x,this.y)}},{key:"toObject",value:function e(){return{x:this.x,y:this.y}}},{key:"toString",value:function e(){return"Vector2({ x: "+this.x+", y: "+this.y+" })"}},{key:"roundDecimal",value:function e(t){this.x=parseFloat(this.x.toFixed(t));this.y=parseFloat(this.y.toFixed(t));return this}}],[{key:"fromObject",value:function t(r){return new e(r.x,r.y)}},{key:"NULL",get:function t(){return new e(0,0)}}]);return e}();t["a"]=s},function(e,t,r){"use strict";r.d(t,"a",function(){return v});var n=r(2);var i=r.n(n);var a=r(3);var o=r.n(a);var s=r(1);var u=r.n(s);var l=r(4);var f=r.n(l);function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function h(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function p(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=o()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)i.a?i()(e,t):e.__proto__=t}var v=function(e){p(t,e);function t(){c(this,t);return h(this,(t.__proto__||u()(t)).apply(this,arguments))}return t}(l["Configurable"]);v.prototype.availableOptions={text:{type:l["OptionType"].STRING,default:""},frame:{type:l["OptionType"].OBJECT,default:null},font:{type:l["OptionType"].OBJECT,default:null}}},function(e,t,r){"use strict";r.d(t,"a",function(){return S});var n=r(6);var i=r.n(n);var a=r(0);var o=r.n(a);var s=r(5);var u=r.n(s);var l=r(2);var f=r.n(l);var c=r(3);var h=r.n(c);var p=r(1);var v=r.n(p);var d=r(4);var y=r.n(d);var _=r(58);var g=r(33);var m=r(61);var b=r(106);var w=r(20);var x=r(16);var T=i.a||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}}return e};var k=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;o()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var R=function e(t,r,n){if(t===null)t=Function.prototype;var i=u()(t,r);if(i===undefined){var a=v()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var o=i.get;if(o===undefined){return undefined}return o.call(n)}};function E(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function C(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function O(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=h()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)f.a?f()(e,t):e.__proto__=t}var S=function(e){O(t,e);function t(){var e;E(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=C(this,(e=t.__proto__||v()(t)).call.apply(e,[this].concat(n)));a._rowType=m["a"].Box;a._alignmentRandomizer=new x["a"](0);a._isMaskedRandomizer=new x["a"](0);a._seedPool.push(a._alignmentRandomizer);a._seedPool.push(a._isMaskedRandomizer);return a}k(t,[{key:"getImagePaths",value:function e(){return[m["a"].Box.getImagePath()]}},{key:"_modifiedText",value:function e(r){return R(t.prototype.__proto__||v()(t.prototype),"_modifiedText",this).call(this,r).toLowerCase()}},{key:"_modifiedLines",value:function e(t){var r=new g["a"];r.set([t.reduce(function(e,t){return""+e+(e===""?"":"\n")+t.joined(1)[0]},"")]);return[r]}},{key:"_layoutRows",value:function e(r,n){var i=R(t.prototype.__proto__||v()(t.prototype),"_layoutRows",this).call(this,r,n);var a=i[0];if(a&&this.getSquareLayout()){var o=a.getSize();o.height=o.width}return i}},{key:"getAlignment",value:function e(){return this._alignmentRandomizer.pickNext(this.constructor.ValidAlignments||t.ValidAlignments)}},{key:"_randomLayoutRow",value:function e(t,r,n,i){var a=this.getAlignment();var o=this._rowType;var s=w["a"].getImage(o.getImagePath());i.setAlignment(a);var u=new b["a"]({words:t,width:n,attributes:i,image:s,imageInsets:o.insetsForWidth(n),capInsets:o.getCapInsets(),backgroundColor:d["Color"].WHITE,centerOffset:0,textScaleFactor:.7,isMasked:this._isMaskedRandomizer.nextBool()});if(this._rowType===m["a"].Box){u.serverImageSmoothingFix=true}var l=u.getSize();if(this.getSquareLayout()){l.height=l.width}else{l.height=Math.max(l.height,l.width*o.getMinimumHeightRatio())}return u}}]);return t}(_["a"]);S.defaultFontIdentifiers=["imgly_font_galano_grotesque_bold"];S.Alignment={Left:"left",Center:"center",Right:"right"};S.ValidAlignments=[S.Alignment.Left,S.Alignment.Center,S.Alignment.Right];S.identifier="imgly_text_design_masked";S.prototype.availableOptions=T({},_["a"].prototype.availableOptions,{fontIdentifiers:{type:d["OptionType"].ARRAY,default:S.defaultFontIdentifiers},squareLayout:{type:d["OptionType"].BOOLEAN,default:true}})},function(e,t,r){"use strict";var n=r(161)(true);r(109)(String,"String",function(e){this._t=String(e);this._i=0},function(){var e=this._t;var t=this._i;var r;if(t>=e.length)return{value:undefined,done:true};r=n(e,t);this._i+=r.length;return{value:r,done:false}})},function(e,t){e.exports=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}}},function(e,t,r){var n=r(112);var i=r(85);e.exports=Object.keys||function e(t){return n(t,i)}},function(e,t){var r={}.toString;e.exports=function(e){return r.call(e).slice(8,-1)}},function(e,t,r){var n=r(78);e.exports=function(e){return Object(n(e))}},function(e,t,r){"use strict";var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var i={encode:function e(t){var r="";var i=void 0,a=void 0,o=void 0;var s=void 0,u=void 0,l=void 0,f=void 0;var c=0;do{i=t[c++];a=t[c++];o=t[c++];s=i>>2;u=(i&3)<<4|a>>4;l=(a&15)<<2|o>>6;f=o&63;if(isNaN(a)){l=f=64}else if(isNaN(o)){f=64}r=r+n.charAt(s)+n.charAt(u)+n.charAt(l)+n.charAt(f);i=a=o="";s=u=l=f=""}while(c<t.length);return r},decode:function e(t){var r=void 0,i=void 0,a=void 0;var o=void 0,s=void 0,u=void 0,l=void 0;var f=0;var c=[];var h=/[^A-Za-z0-9+/=]/g;if(h.exec(t)){throw new Error("There were invalid base64 characters in the input text.\n"+"Valid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\n"+"Expect errors in decoding.")}t=t.replace(/[^A-Za-z0-9+/=]/g,"");do{o=n.indexOf(t.charAt(f++));s=n.indexOf(t.charAt(f++));u=n.indexOf(t.charAt(f++));l=n.indexOf(t.charAt(f++));r=o<<2|s>>4;i=(s&15)<<4|u>>2;a=(u&3)<<6|l;c.push(r);if(u!==64){c.push(i)}if(l!==64){c.push(a)}r=i=a="";o=s=u=l=""}while(f<t.length);return c}};t["a"]=i},function(e,t,r){"use strict";var n=r(70);var i=r.n(n);var a=r(71);var o=r.n(a);var s=r(0);var u=r.n(s);var l=function(){function e(e,t){var r=[];var n=true;var i=false;var a=undefined;try{for(var s=o()(e),u;!(n=(u=s.next()).done);n=true){r.push(u.value);if(t&&r.length===t)break}}catch(e){i=true;a=e}finally{try{if(!n&&s["return"])s["return"]()}finally{if(i)throw a}}return r}return function(t,r){if(Array.isArray(t)){return t}else if(i()(Object(t))){return e(t,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();var f=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;u()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var h=function(){function e(t,r,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:1;c(this,e);this.r=t;this.g=r;this.b=n;this.a=i}f(e,[{key:"toRGBA",value:function e(){var t=[Math.round(this.r*255),Math.round(this.g*255),Math.round(this.b*255),this.a.toFixed(2)];return"rgba("+t.join(",")+")"}},{key:"set",value:function e(t,r,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:this.a;this.r=t;this.g=r;this.b=n;this.a=i;return this}},{key:"toRGB",value:function e(){return[Math.round(this.r*255),Math.round(this.g*255),Math.round(this.b*255)]}},{key:"toHex",value:function e(){var t=[this._componentToHex(Math.round(this.r*255)),this._componentToHex(Math.round(this.g*255)),this._componentToHex(Math.round(this.b*255))];return"#"+t.join("")}},{key:"toGLColor",value:function e(){return[this.r,this.g,this.b,this.a]}},{key:"toArray",value:function e(){return this.toGLColor()}},{key:"toRGBGLColor",value:function e(){return[this.r,this.g,this.b]}},{key:"toHSV",value:function e(){var t=Math.max(this.r,this.g,this.b);var r=Math.min(this.r,this.g,this.b);var n=void 0;var i=void 0;var a=t;var o=t-r;i=t===0?0:o/t;if(t===r){n=0}else{switch(t){case this.r:n=(this.g-this.b)/o;if(this.g<this.b){n+=6}break;case this.g:n=(this.b-this.r)/o+2;break;case this.b:n=(this.r-this.g)/o+4;break}n/=6}return[n,i,a]}},{key:"fromHSV",value:function t(r,n,i){this.copy(e.fromHSV(r,n,i));return this}},{key:"clone",value:function t(){return new e(this.r,this.g,this.b,this.a)}},{key:"add",value:function e(t){this.r+=t.r;this.g+=t.g;this.b+=t.b;this.a+=t.a;return this}},{key:"minus",value:function e(t){this.r-=t.r;this.g-=t.g;this.b-=t.b;this.a-=t.a;return this}},{key:"multiplyScalar",value:function e(t){this.r*=t;this.g*=t;this.b*=t;this.a*=t;return this}},{key:"divideScalar",value:function e(t){this.r/=t;this.g/=t;this.b/=t;this.a/=t;return this}},{key:"clamp",value:function e(t,r){this.r=Math.min(Math.max(this.r,t),r);this.g=Math.min(Math.max(this.g,t),r);this.b=Math.min(Math.max(this.b,t),r);this.a=Math.min(Math.max(this.a,t),r);return this}},{key:"copy",value:function e(t){this.r=t.r;this.g=t.g;this.b=t.b;this.a=t.a;return this}},{key:"equals",value:function e(t){return this.r===t.r&&this.g===t.g&&this.b===t.b&&this.a===t.a}},{key:"_componentToHex",value:function e(t){var r=t.toString(16);return r.length===1?"0"+r:r}},{key:"toString",value:function e(){return"Color("+this.r+", "+this.g+", "+this.b+", "+this.a+")"}}],[{key:"fromHSV",value:function t(r,n,i){var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:1;var o=[],s=o[0],u=o[1],l=o[2];var f=Math.floor(r*6);var c=r*6-f;var h=i*(1-n);var p=i*(1-c*n);var v=i*(1-(1-c)*n);switch(f%6){case 0:s=i;u=v;l=h;break;case 1:s=p;u=i;l=h;break;case 2:s=h;u=i;l=v;break;case 3:s=h;u=p;l=i;break;case 4:s=v;u=h;l=i;break;case 5:s=i;u=h;l=p;break}return new e(s,u,l,a)}},{key:"fromArray",value:function t(r){return new e(r[0],r[1],r[2],r[3])}},{key:"fromHex",value:function t(r){var n=r.match(/.{1,2}/g),i=l(n,3),a=i[0],o=i[1],s=i[2];return new e(parseInt(a,16)/255,parseInt(o,16)/255,parseInt(s,16)/255,1)}},{key:"TRANSPARENT",get:function t(){return new e(0,0,0,0)}},{key:"WHITE",get:function t(){return new e(1,1,1,1)}},{key:"BLACK",get:function t(){return new e(0,0,0,1)}},{key:"RED",get:function t(){return new e(1,0,0,1)}},{key:"BLUE",get:function t(){return new e(0,0,1,1)}},{key:"GREEN",get:function t(){return new e(0,1,0,1)}}]);return e}();t["a"]=h},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(30);var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function s(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var u=12;var l=function(){function e(){s(this,e);this._maxListeners=u;this._events={};this._pipeDestinations=[]}o(e,[{key:"pipeEvents",value:function e(t){this._pipeDestinations.push(t)}},{key:"unpipeEvents",value:function e(t){var r=this._pipeDestinations.indexOf(t);if(r===-1){return}this._pipeDestinations.splice(r,1)}},{key:"on",value:function e(t,r){if(typeof t==="undefined"){throw new Error("Invalid event type: `"+t+"`")}if(typeof r!=="function"){throw new TypeError}var n=this._events[t]||(this._events[t]=[]);if(n.indexOf(r)!==-1){return this}n.push(r);if(this._maxListeners&&n.length>this._maxListeners){a["a"].warn("EventEmitter","Possible memory leak detected, added "+n.length+" `"+t+"` listeners (current limit is "+this._maxListeners+")");if(typeof console!=="undefined"){console.trace()}}return this}},{key:"once",value:function e(t,r){if(typeof t==="undefined"){throw new Error("Invalid event type: `"+t+"`")}var n=this;function i(){n.off(t,i);r.apply(null,arguments)}return this.on(t,i)}},{key:"off",value:function e(t){if(typeof t==="undefined"){throw new Error("Invalid event type: `"+t+"`")}if((arguments.length<=1?0:arguments.length-1)===0){this._events[t]=null;return this}var r=arguments.length<=1?undefined:arguments[1];if(typeof r!=="function"){throw new TypeError}var n=this._events[t];if(!n||!n.length){return this}var i=n.indexOf(r);if(i===-1){return this}n.splice(i,1);return this}},{key:"emit",value:function e(t){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++){n[i-1]=arguments[i]}if(typeof t==="undefined"){throw new Error("Invalid event type: `"+t+"`")}this._pipeDestinations.forEach(function(e){e.emit.apply(e,[t].concat(n))});var a=this._events[t];if(!a||!a.length){return false}a.slice(0).forEach(function(e){return e.apply(null,n)});return true}},{key:"setMaxListeners",value:function e(t){if(parseInt(t,10)!==t){throw new TypeError}this._maxListeners=t}}]);return e}();t["a"]=l},function(e,t,r){"use strict";var n=r(15);var i=r.n(n);var a=r(0);var o=r.n(a);var s=r(2);var u=r.n(s);var l=r(3);var f=r.n(l);var c=r(1);var h=r.n(c);var p=r(9);var v=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;o()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function d(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++){r[t]=e[t]}return r}else{return i()(e)}}function y(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function _(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function g(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)u.a?u()(e,t):e.__proto__=t}var m=function(e){g(t,e);function t(e){y(this,t);var r=_(this,(t.__proto__||h()(t)).call(this));r.id=t.id++;r._onSourceLoaded=r._onSourceLoaded.bind(r);r._renderers=[];r._glTextures={};r._source=e;r._dirty=true;r._glUnit=0;r._mipMapping=false;r._magFilter=t.DefaultMagFilter;r._minFilter=t.DefaultMinFilter;r._repeatX=t.ClampToEdge;r._repeatY=t.ClampToEdge;r._pixelRatio=1;r._loaded=false;r._frame=new p["h"](0,0,100,100);if(e){r._loadSource()}return r}v(t,[{key:"resizeTo",value:function e(t){if(this._frame.width===t.x&&this._frame.height===t.y){return}this._frame.width=t.x;this._frame.height=t.y;this._dirty=true}},{key:"_loadSource",value:function e(){var t=this._source;var r=t.complete;var n=t.constructor.name==="Canvas"||t.tagName&&t.tagName.toUpperCase()==="CANVAS";if(r||n){return this._onSourceLoaded()}t.addEventListener("load",this._onSourceLoaded)}},{key:"_onSourceLoaded",value:function e(){this._loaded=true;this.emit("loaded");this.update()}},{key:"_updateGLFilters",value:function e(){var r=new p["k"](this._source.width,this._source.height);if(p["i"].isPowerOfTwo(r)){p["f"].info(this.constructor.name,"Mip-mapping enabled");this._minFilter=t.TrilinearFilter;this._mipMapping=true}else{this._minFilter=t.LinearFilter;this._mipMapping=false}}},{key:"update",value:function e(){if(this._frame.width!==this._source.width||this._frame.height!==this._source.height){this._frame=new p["h"](0,0,this._source.width,this._source.height);this._dirty=true}this._updateGLFilters();this.emit("update")}},{key:"getRenderers",value:function e(){return[].concat(d(this._renderers))}},{key:"getGLFilter",value:function e(t,r){switch(r){case"min":return this.constructor.getGLFilter(t,this._minFilter);case"mag":return this.constructor.getGLFilter(t,this._magFilter)}}},{key:"isLoaded",value:function e(){return this._loaded}},{key:"setLoaded",value:function e(t){this._loaded=t}},{key:"getSource",value:function e(){return this._source}},{key:"setSource",value:function e(t){this._source=t}},{key:"getGLTextureForRenderer",value:function e(t){return this._glTextures[t.id]}},{key:"setGLTextureForRenderer",value:function e(t,r){this._renderers[r.id]=r;this._glTextures[r.id]=t}},{key:"getFrame",value:function e(){return this._frame}},{key:"setFrame",value:function e(t){this._frame=t}},{key:"getDimensions",value:function e(){return new p["k"](this._frame.width,this._frame.height)}},{key:"getPixelRatio",value:function e(){return this._pixelRatio}},{key:"setPixelRatio",value:function e(t){this._pixelRatio=t}},{key:"getGLUnit",value:function e(){return this._glUnit}},{key:"setGLUnit",value:function e(t){this._glUnit=t}},{key:"setMinFilter",value:function e(t){this._minFilter=t}},{key:"getMinFilter",value:function e(){return this._minFilter}},{key:"setMagFilter",value:function e(t){this._magFilter=t}},{key:"getMagFilter",value:function e(){return this._magFilter}},{key:"setRepeatX",value:function e(t){this._repeatX=t}},{key:"getRepeatX",value:function e(){return this._repeatX}},{key:"setRepeatY",value:function e(t){this._repeatY=t}},{key:"getRepeatY",value:function e(){return this._repeatY}},{key:"getGLRepeat",value:function e(r,n){var i=n==="x"?this.getRepeatX():this.getRepeatY();switch(i){case t.ClampToEdge:return r.CLAMP_TO_EDGE;case t.Repeat:return r.REPEAT;case t.MirroredRepeat:return r.MIRRORED_REPEAT}}},{key:"isDirty",value:function e(){return this._dirty}},{key:"setDirty",value:function e(t){this._dirty=t}},{key:"disposeGLTextures",value:function e(){for(var t in this._renderers){this.disposeGLTexturesForRenderer(this._renderers[t])}}},{key:"disposeGLTexturesForRenderer",value:function e(t){if(!this._glTextures[t.id])return;var r=t.getContext();r.deleteTexture(this._glTextures[t.id]);delete this._glTextures[t.id];if(!this._renderers[t.id]){delete this._renderers[t.id]}}},{key:"isMipMappingEnabled",value:function e(){return this._mipMapping}},{key:"setMipMappingEnabled",value:function e(t){this._mipMapping=t}},{key:"dispose",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;this.disposeGLTextures()}}],[{key:"getGLFilter",value:function e(r,n){switch(n){case t.LinearFilter:return r.LINEAR;case t.NearestFilter:return r.NEAREST;case t.BilinearFilter:return r.LINEAR_MIPMAP_NEAREST;case t.TrilinearFilter:return r.LINEAR_MIPMAP_LINEAR}}}]);return t}(p["d"]);m.NearestFilter=0;m.LinearFilter=1;m.BilinearFilter=2;m.TrilinearFilter=3;m.DefaultMagFilter=m.NearestFilter;m.DefaultMinFilter=m.LinearFilter;m.ClampToEdge=0;m.Repeat=1;m.MirroredRepeat=2;m.id=0;t["a"]=m},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(5);var o=r.n(a);var s=r(2);var u=r.n(s);var l=r(3);var f=r.n(l);var c=r(1);var h=r.n(c);var p=r(9);var v=r(55);var d=r(97);var y=r(96);var _=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var g=function e(t,r,n){if(t===null)t=Function.prototype;var i=o()(t,r);if(i===undefined){var a=h()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var s=i.get;if(s===undefined){return undefined}return s.call(n)}};function m(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function b(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function w(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)u.a?u()(e,t):e.__proto__=t}var x=p["c"].OptionType,T=p["c"].UniformType,k=p["c"].RendererType;var R=function(e){w(t,e);function t(){m(this,t);return b(this,(t.__proto__||h()(t)).apply(this,arguments))}_(t,[{key:"_initOptions",value:function e(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};this._shaders=[];this._availableUniforms=y["a"].defaultUniforms;this._attributes=y["a"].defaultAttributes;this._vertexSource=y["a"].defaultVertexSource;this._fragmentSource=y["a"].defaultFragmentSource;this._initUniforms();g(t.prototype.__proto__||h()(t.prototype),"_initOptions",this).call(this,r)}},{key:"_initUniforms",value:function e(){this._uniforms={};for(var t in this._availableUniforms){var r=this._availableUniforms[t];this._uniforms[t]={type:r.type,value:r.default||null}}for(var n in this.availableOptions){var i=this.availableOptions[n];if(!i.uniformType){p["f"].trace(this.constructor.name,"Option `"+n+"` is missing a `uniformType`!")}else{this._uniforms["u_"+n]={type:i.uniformType,value:i.default||null}}}}},{key:"setOption",value:function e(r,n){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;g(t.prototype.__proto__||h()(t.prototype),"setOption",this).call(this,r,n,i);var a=n;var o=this.availableOptions[r];if(!o.uniformType){return}var s="u_"+r;switch(o.type){case x.COLOR:if(o.uniformType===T.FLOAT4){a=n.toGLColor()}else if(o.uniformType===T.FLOAT3){a=n.toRGBGLColor()}break;case x.VECTOR2:a=[n.x,n.y];break;case x.COLOR_MATRIX:a=[n.a,n.b,n.c,n.d,n.f,n.g,n.h,n.i,n.k,n.l,n.m,n.n,n.p,n.q,n.r,n.s];var u=[n.e,n.j,n.o,n.t];this._uniforms[s+"_vec"]={value:u,type:T.FLOAT4}}this.setUniform(s,a)}},{key:"setUniform",value:function e(t,r){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;this._uniforms[t].value=r}},{key:"setUniforms",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;for(var n in t){this._uniforms[n].value=t[n];if(r){this.syncUniform(n)}}}},{key:"syncUniform",value:function e(t){this._shaders.forEach(function(e){e.syncUniform(t)})}},{key:"syncUniforms",value:function e(){this._shaders.forEach(function(e){e.syncUniforms()})}},{key:"getShaderForRenderer",value:function e(t){var r=t.getContext();var n=this._shaders[r.id];if(!n){n=new d["a"](t,this._vertexSource,this._fragmentSource,this._uniforms,this._attributes);this._shaders[r.id]=n}return n}},{key:"apply",value:function e(t,r,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;if(t.isOfType(k.WEBGL)){this._applyWebGL(t,r,n,i)}else if(t.isOfType(k.CANVAS)){this._applyCanvas(t,r,n,i)}}},{key:"_applyWebGL",value:function e(t,r,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var a=t.getContext();var o=this.getShaderForRenderer(t);t.setRenderTarget(n);if(i){n.clear()}t.setShader(o);var s=t.getCurrentRenderTarget().getProjectionMatrix().toArray();o.setUniform("u_projMatrix",s);o.syncUniforms();a.activeTexture(a.TEXTURE0);a.bindTexture(a.TEXTURE_2D,r.getTexture());a.drawElements(a.TRIANGLES,6,a.UNSIGNED_SHORT,0)}},{key:"_applyCanvas",value:function e(t,r,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var a=r.getCanvas();var o=n.getContext();p["f"].warn(this.constructor.name,"`_applyCanvas` is not implemented. Just copying image data from `inputTarget` to `outputTarget`.");o.clearRect(0,0,a.width,a.height);o.drawImage(a,0,0)}},{key:"dispose",value:function e(){this._shaders.forEach(function(e){return e.dispose()});this._shaders=[]}}]);return t}(v["a"]);t["a"]=R},function(e,t,r){"use strict";var n=r(35);var i=r.n(n);var a=r(39);var o=r.n(a);var s=r(0);var u=r.n(s);var l=r(2);var f=r.n(l);var c=r(3);var h=r.n(c);var p=r(69);var v=r.n(p);var d=r(1);var y=r.n(d);var _=r(32);var g=r(30);var m=r(52);var b=r(42);var w=r(51);var x=r(22);var T=r(74);var k=r(135);var R=r(31);var E=typeof o.a==="function"&&typeof i.a==="symbol"?function(e){return typeof e}:function(e){return e&&typeof o.a==="function"&&e.constructor===o.a&&e!==o.a.prototype?"symbol":typeof e};var C=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;u()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function O(e,t,r){if(t in e){u()(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function S(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function F(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function I(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=h()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)f.a?f()(e,t):e.__proto__=t}var A=function(e){I(t,e);function t(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};S(this,t);var n=F(this,(t.__proto__||y()(t)).call(this));n.availableOptions=n.availableOptions||{};n.availableOptions=x["a"].extend(n.availableOptions,r);n._onConfigurableUpdate=n._onConfigurableUpdate.bind(n);n._initOptions(e);return n}C(t,[{key:"_buildConfigError",value:function e(t){var r="";if(this.constructor.name){r=this.constructor.name+": "}r+=t;return new Error(r)}},{key:"_onOptionsChange",value:function e(){}},{key:"validateSettings",value:function e(){var t=this;return new _["a"](function(e,r){for(var n in t.availableOptions){var i=t.availableOptions[n];if(i.required&&typeof t._options[n]==="undefined"){return r(t._buildConfigError("Option `"+n+"` is required."))}}e()})}},{key:"_initOptions",value:function e(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};this._options={};var n,i,a;var o=this;for(n in this.availableOptions){a=n.charAt(0).toUpperCase()+n.slice(1);i=this.availableOptions[n];if([R["OptionType"].STRING,R["OptionType"].NUMBER,R["OptionType"].BOOLEAN,R["OptionType"].OBJECT,R["OptionType"].VECTOR2,R["OptionType"].COLOR,R["OptionType"].CONFIGURABLE,R["OptionType"].COLOR_MATRIX,R["OptionType"].ARRAY,R["OptionType"].IMAGE,R["OptionType"].FUNCTION,R["OptionType"].ALL].indexOf(i.type)===-1){throw this._buildConfigError("Unknown option type: `"+i.type+"`")}var s=function e(t,r){o["set"+a]=function(e,r,n){o.setOption(t,e,r,n)};o["get"+a]=function(){return o.getOption(t)}};s(n,i);if(i.type===R["OptionType"].CONFIGURABLE){this._options[n]=new t(undefined,i.structure||{});this._options[n].on("update",this._onConfigurableUpdate)}if(!(n in r)||typeof r[n]==="undefined"){if(typeof i.default!=="undefined"){var u=i.default;if(typeof i.default==="function"){u=i.default()}this["set"+a](u,false,true)}else if(i.type!==R["OptionType"].CONFIGURABLE){this._options[n]=undefined}}}for(n in r){if(typeof this.availableOptions[n]==="undefined"){throw new Error("Invalid option: "+n)}if(typeof r[n]!=="undefined"){a=n.charAt(0).toUpperCase()+n.slice(1);this["set"+a](r[n],false,true)}}}},{key:"set",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;for(var n in t){this.setOption(n,t[n],false)}this._onOptionsChange();if(r){this.emit("update",this,t)}}},{key:"getOption",value:function e(t){return this._options[t]}},{key:"hasOption",value:function e(t){return!!this.availableOptions[t]}},{key:"getOptionDefault",value:function e(t){var r=this.availableOptions[t];if(!r){throw new Error("Invalid option: "+t)}return r.default}},{key:"resetOptions",value:function e(){this.set(this.getDefaultOptions())}},{key:"getDefaultOptions",value:function e(){var t={};for(var r in this.availableOptions){var n=this.availableOptions[r].default;if(typeof n==="undefined")continue;t[r]=n}return t}},{key:"optionsEqual",value:function e(t){for(var r in t){var n=t[r];if(!this._optionEquals(r,n)){return false}}return true}},{key:"_optionEquals",value:function e(t,r){var n=this.availableOptions[t];if(typeof n==="undefined"){throw new Error("Invalid option: "+t)}var i=this.availableOptions[t].type;var a=this._options[t];if(a===r)return true;if(typeof r==="undefined"||typeof a==="undefined")return false;switch(i){case R["OptionType"].OBJECT:if(typeof a.optionsEqual==="function"){return a.optionsEqual(r._options)}else{return a===r}case R["OptionType"].STRING:case R["OptionType"].NUMBER:case R["OptionType"].BOOLEAN:case R["OptionType"].FUNCTION:case"*":return a===r;case R["OptionType"].VECTOR2:return a.equals(r);case R["OptionType"].COLOR:case R["OptionType"].COLOR_MATRIX:return r.equals(a);case R["OptionType"].CONFIGURABLE:return a.optionsEqual(r);case R["OptionType"].ARRAY:return this._arrayOptionEquals(t,r);case R["OptionType"].IMAGE:return a.src===r.src}}},{key:"_arrayOptionEquals",value:function e(r,n){var i=this._options[r];if(n.length!==i.length){return false}var a=true;for(var o=0;o<i.length;o++){var s=i[o];var u=n[o];if(s instanceof t){if(typeof u==="undefined"||!s.optionsEqual(u)){a=false;break}}else if(u!==s){a=false;break}}return a}},{key:"serializeOptions",value:function e(){var t=this;var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:v()(this._options);var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var i={};r.forEach(function(e){if(typeof t.availableOptions[e]==="undefined"){return g["a"].warn("Trying to serialize a key that does not exist: "+e)}if(t.availableOptions[e].serializable===false)return;i[e]=t.serializeOption(e,n)});return i}},{key:"serializeOption",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var n=this.availableOptions[t];var i=n.type;var a=this._options[t];if(!a)return a;if(n.serializable===false){throw new Error("Option `"+t+"` is not serializable.")}switch(i){case R["OptionType"].STRING:case R["OptionType"].NUMBER:case R["OptionType"].BOOLEAN:case R["OptionType"].OBJECT:case R["OptionType"].FUNCTION:case R["OptionType"].ALL:return a;case R["OptionType"].VECTOR2:return r?a.toObject():a.clone();case R["OptionType"].COLOR:case R["OptionType"].COLOR_MATRIX:return r?a.toArray():a.clone();case R["OptionType"].CONFIGURABLE:return a.serializeOptions(undefined,r);case R["OptionType"].ARRAY:return a.slice(0);case R["OptionType"].IMAGE:return r?a.src:a}}},{key:"setOption",value:function e(r,n){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var o=this.availableOptions[r];if(!o){throw new Error("Invalid option: "+r)}if(typeof o.setter!=="undefined"){n=o.setter.call(this,n,a)}if(typeof o.validation!=="undefined"){o.validation(n)}if(n===null||typeof n==="undefined"){if(o.required){throw this._buildConfigError("Option `"+r+"` is required.")}this._options[r]=n}else{switch(o.type){case R["OptionType"].STRING:if((typeof n==="undefined"?"undefined":E(n))!==R["OptionType"].STRING){throw this._buildConfigError("Option `"+r+"` has to be a string.")}var s=o.available;if(typeof s!=="undefined"&&s.indexOf(n)===-1){throw this._buildConfigError("Invalid value for `"+r+"` (valid values are: "+o.available.join(", ")+")")}this._options[r]=n;break;case R["OptionType"].NUMBER:if((typeof n==="undefined"?"undefined":E(n))!==R["OptionType"].NUMBER){throw this._buildConfigError("Option `"+r+"` has to be a number.")}this._options[r]=n;break;case R["OptionType"].BOOLEAN:if((typeof n==="undefined"?"undefined":E(n))!==R["OptionType"].BOOLEAN){throw this._buildConfigError("Option `"+r+"` has to be a boolean.")}this._options[r]=n;break;case R["OptionType"].VECTOR2:if(!(n instanceof b["a"])&&!((typeof n==="undefined"?"undefined":E(n))==="object"&&"x"in n&&"y"in n)){throw this._buildConfigError("Option `"+r+"` has to be an instance of Vector2 or an Object holding x and y values.")}if(n instanceof b["a"]){this._options[r]=n.clone()}else{this._options[r]=b["a"].fromObject(n)}break;case R["OptionType"].COLOR:if(!(n instanceof w["a"])){throw this._buildConfigError("Option `"+r+"` has to be an instance of Color.")}this._options[r]=n;break;case R["OptionType"].COLOR_MATRIX:if(!(n instanceof k["a"])){throw this._buildConfigError("Option `"+r+"` has to be an instance of ColorMatrix.")}this._options[r]=n.clone();break;case R["OptionType"].FUNCTION:if(typeof n!=="function"){throw this._buildConfigError("Option `"+r+"` has to be a function.")}this._options[r]=n;break;case R["OptionType"].OBJECT:case"*":this._options[r]=n;break;case R["OptionType"].IMAGE:if(typeof n==="string"){var u=new T["a"];u.crossOrigin=x["a"].getCrossOriginValue(o.crossOrigin);u.src=n;this._options[r]=u}else if(n instanceof T["a"]||typeof HTMLImageElement!=="undefined"&&n instanceof HTMLImageElement){this._options[r]=n}else{throw this._buildConfigError("Option `"+r+"` has to be an Image or String.")}break;case R["OptionType"].CONFIGURABLE:if(n instanceof t){this._options[r]=n}else{this._options[r].set(n)}break;case R["OptionType"].ARRAY:if(!(n instanceof Array)){throw this._buildConfigError("Option `"+r+"` has to be an Array.")}this._options[r]=n.slice(0);break;default:throw this._buildConfigError("Unknown option type: `"+o.type+"`")}}if(i){this._onOptionsChange();this.emit("update",this,O({},r,n))}}},{key:"_onConfigurableUpdate",value:function e(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++){r[n]=arguments[n]}this.emit.apply(this,["update"].concat(r))}},{key:"hasChanges",value:function e(){var t=this.getDefaultOptions();return!this.optionsEqual(t)}}]);return t}(m["a"]);t["a"]=A},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(5);var o=r.n(a);var s=r(2);var u=r.n(s);var l=r(3);var f=r.n(l);var c=r(1);var h=r.n(c);var p=r(4);var v=r.n(p);var d=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var y=function e(t,r,n){if(t===null)t=Function.prototype;var i=o()(t,r);if(i===undefined){var a=h()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var s=i.get;if(s===undefined){return undefined}return s.call(n)}};function _(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function g(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function m(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)u.a?u()(e,t):e.__proto__=t}var b=p["Math"].Vector2;var w=function(e){m(t,e);function t(e,r){_(this,t);var n=g(this,(t.__proto__||h()(t)).call(this,r));n._operation=e;n._dirtiness={};n.id=p["Utils"].getUUID();n._renderTextures={};n._identitySprite=new p["Engine"].Sprite;n._sprite=new p["Engine"].Sprite;n._dummyImage={addEventListener:function e(){},removeEventListener:function e(){}};n._hitTestSprite=new p["Engine"].Sprite;n._renderers=[];return n}d(t,[{key:"applyScale",value:function e(t){}},{key:"applyRotation",value:function e(t){var r=this._operation.getInputDimensions();var n=this.getRotation()*180/Math.PI;n+=t;this.setRotation(n*Math.PI/180);var i=(t+360)%360;var a=i*Math.PI/180;var o=Math.cos(a);var s=Math.sin(a);var u=this._options.position.clone().subtract(.5).multiply(r);var l=new b(u.x*o-u.y*s,u.x*s+u.y*o).divide(r.clone().flip());this.setPosition(new b(.5,.5).add(l))}},{key:"applyFlip",value:function e(t){var r=this.getPosition().clone();switch(t){case"horizontal":r.x=1-this._options.position.x;break;case"vertical":r.y=1-this._options.position.y;break}this.setPosition(r)}},{key:"applyTransform",value:function e(t){var r={};r.rotation=t.applyToRotation(this.getRotation());r.position=t.applyToRelativePoint(this.getPosition());if(this._options.dimensions){r.dimensions=t.applyToDimensions(this.getDimensions())}this.set(r,false)}},{key:"getDisplayObject",value:function e(){return this._sprite}},{key:"getHitTestDisplayObject",value:function e(){return this._sprite}},{key:"_getTexture",value:function e(){throw new Error("Sprite#_getTexture is abstract and not implemented in child class.")}},{key:"_prepareRenderTexture",value:function e(t){if(!this._renderTexture){var r=this._getTexture();this._renderTextureContainer=new p["Engine"].Container;this._renderTextureSprite=new p["Engine"].Sprite(r);this._renderTextureContainer.addChild(this._renderTextureSprite);this._renderTexture=this._getRenderTexture(t.getRenderer(),r.getDimensions())}else{this._renderTexture.clear()}}},{key:"_rendersToRenderTexture",value:function e(t){return t.getOptions().smoothDownscaling&&t.getRenderer().isOfType(p["RendererType"].WEBGL)}},{key:"_optionEquals",value:function e(r,n){if(r==="type"){return true}return y(t.prototype.__proto__||h()(t.prototype),"_optionEquals",this).call(this,r,n)}},{key:"update",value:function e(t,r){if(this._rendersToRenderTexture(t)){this._prepareRenderTexture(t);this._renderToRenderTexture(t)}this._updateSprite(r)}},{key:"_updateSprite",value:function e(t){var r=this;var n=[this._sprite,this._hitTestSprite];n.forEach(function(e){if(!e.getTexture())return;e.setAnchor(r._options.anchor);e.setPosition(r._options.position.clone().multiply(t));if(typeof r._options.alpha!=="undefined"){e.setAlpha(r._options.alpha)}var n=r._options.dimensions;if(n){n=n.clone().multiply(r._operation.getSDK().getTextureScale());e.setWidth(n.x);e.setHeight(n.y)}e.updateTransform();var i=e.getTexture().getFrame();var a=new b(i.width,i.height);e.setPivot(r._options.pivot.clone().multiply(a));e.setRotation(r._options.rotation);e.updateTransform()})}},{key:"_renderToRenderTexture",value:function e(t){var r=this._getTexture().getDimensions();var n=this._getRenderTexture(t.getRenderer(),r);var i=r.clone();if(this._options.smoothDownscaling){i.x=p["Utils"].nextHighestPOT(i.x);i.y=p["Utils"].nextHighestPOT(i.y)}this._renderTexture.resizeTo(i);this._renderTexture.render(this._renderTextureContainer);if(this._options.smoothDownscaling){var a=i.clone().subtract(r.x,r.y).divide(i);var o=n.getUVs().getUVs();o[0].x=o[3].x=0;o[1].x=o[2].x=1-a.x;o[0].y=o[1].y=0;o[2].y=o[3].y=1-a.y}this._sprite.setTexture(n)}},{key:"isDirtyForRenderer",value:function e(t){if(!(t.id in this._dirtiness)){this._dirtiness[t.id]=true}return this._dirtiness[t.id]}},{key:"setDirtyForRenderer",value:function e(t,r){this._renderers[r.id]=r;this._dirtiness[r.id]=t}},{key:"setDirty",value:function e(t){for(var r in this._dirtiness){this.setDirtyForRenderer(t,this._renderers[r])}}},{key:"_getRenderTexture",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:new b(100,100);if(!this._renderTextures[t.id]){this._renderTextures[t.id]=new p["Engine"].RenderTexture(t,r.x,r.y,1)}return this._renderTextures[t.id]}},{key:"dispose",value:function e(){for(var t in this._renderTextures){this._renderTextures[t].dispose()}}}]);return t}(p["Configurable"]);t["a"]=w},function(e,t,r){"use strict";r.d(t,"a",function(){return D});var n=r(6);var i=r.n(n);var a=r(15);var o=r.n(a);var s=r(0);var u=r.n(s);var l=r(5);var f=r.n(l);var c=r(2);var h=r.n(c);var p=r(3);var v=r.n(p);var d=r(1);var y=r.n(d);var _=r(4);var g=r.n(_);var m=r(58);var b=r(359);var w=r(103);var x=r(19);var T=r(104);var k=r(76);var R=r(20);var E=r(16);var C=i.a||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}}return e};var O=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;u()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var S=function e(t,r,n){if(t===null)t=Function.prototype;var i=f()(t,r);if(i===undefined){var a=y()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var o=i.get;if(o===undefined){return undefined}return o.call(n)}};function F(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++){r[t]=e[t]}return r}else{return o()(e)}}function I(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function A(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function M(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=v()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)h.a?h()(e,t):e.__proto__=t}var D=function(e){M(t,e);function t(){I(this,t);for(var e=arguments.length,r=Array(e),n=0;n<e;n++){r[n]=arguments[n]}var i=A(this,(t.__proto__||y()(t)).call(this,r));i.getImagePaths=function(){var e=i.getBanderoles();return e&&e.map(function(e){return e.getImagePath()})||[]};i.onImagesLoaded=function(){var e=i.getBanderoles();e&&e.forEach(function(e){var t=R["a"].getImage(e.getImagePath());if(!t){_["Log"].warn("TextDesignBlocks#onImagesLoaded: Image not found '"+e.getImagePath()+"'");return}e.setImage(t)})};i._rowTypeLessThan3WordsRandomizer=new E["a"](0);i._rowTypeMoreThan3WordsRandomizer=new E["a"](0);i._banderolesRandomizer=new E["a"](0);i._seedPool=[].concat(F(i._seedPool),[i._rowTypeLessThan3WordsRandomizer,i._rowTypeMoreThan3WordsRandomizer,i._banderolesRandomizer]);return i}O(t,[{key:"_modifiedText",value:function e(r){return S(t.prototype.__proto__||y()(t.prototype),"_modifiedText",this).call(this,r).toUpperCase()}},{key:"generateLayoutData",value:function e(r,n){this._options.hasMaskedText=false;return S(t.prototype.__proto__||y()(t.prototype),"generateLayoutData",this).call(this,r,n)}},{key:"_randomLayoutRow",value:function e(t,r,n,i){if(t.size()<3){var a=this._rowTypeLessThan3WordsRandomizer.nextInRange(0,2)===0;return this._layoutRow(t,n,i,a)}else{var o=this._rowTypeMoreThan3WordsRandomizer.nextInRange(0,3);switch(o){case 0:return new b["a"]({words:t,width:n,attributes:i,orientation:b["a"].Orientations.Left});case 1:return new b["a"]({words:t,width:n,attributes:i,orientation:b["a"].Orientations.Right});case 2:return this._layoutRow(t,n,i,true);case 3:return new x["a"]({words:t,width:n,attributes:i});default:throw new Error("TextDesignBlocks#_randomLayoutRow: Invalid randomValue generated: "+o+".")}}}},{key:"_layoutRow",value:function e(t,r,n,i){if(this.getHasMaskedText()){i=false}if(i){this.setHasMaskedText(true);var a=this._banderolesRandomizer.pickNext(this.getBanderoles());var o=new T["a"]({words:t,width:r,attributes:new k["a"]({alignment:"left",fontIdentifier:a.getFontIdentifier()}),image:a.getImage(),imageInsets:a.insetsForWidth(r),capInsets:null,backgroundColor:_["Color"].WHITE});if(a.getNeedsImageSmoothingFix()){o.serverImageSmoothingFix=true}return o}else{return new x["a"]({words:t,width:r,attributes:n})}}}]);return t}(m["a"]);D.defaultFontIdentifiers=["imgly_font_campton_bold"];D.identifier="imgly_text_design_blocks";D.defaultBanderoles=[w["a"].Rectangle,w["a"].Small];D.prototype.availableOptions=C({},m["a"].prototype.availableOptions,{fontIdentifiers:{type:_["OptionType"].ARRAY,default:D.defaultFontIdentifiers},relativeLineSpacing:{type:_["OptionType"].NUMBER,default:.025/3},hasMaskedText:{type:_["OptionType"].BOOLEAN,default:false},banderoles:{type:_["OptionType"].ARRAY,default:D.defaultBanderoles}})},function(e,t,r){"use strict";r.d(t,"a",function(){return I});var n=r(15);var i=r.n(n);var a=r(0);var o=r.n(a);var s=r(2);var u=r.n(s);var l=r(3);var f=r.n(l);var c=r(352);var h=r.n(c);var p=r(1);var v=r.n(p);var d=r(4);var y=r.n(d);var _=r(16);var g=r(17);var m=r(33);var b=r(355);var w=r(76);var x=r(19);var T=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;o()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function k(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++){r[t]=e[t]}return r}else{return i()(e)}}function R(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function E(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function C(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)u.a?u()(e,t):e.__proto__=t}var O=10;var S=4;var F=.4;var I=function(e){C(t,e);function t(e){R(this,t);var r=E(this,(t.__proto__||v()(t)).call(this,e));r._relativeInsets=new g["a"];r._background=null;r._fontRandomizer=new _["a"](0);r._lineNumberRandomizer=new _["a"](0);r._wordsPerLineRandomizer=new _["a"](0);r._seedPool=[r._fontRandomizer,r._lineNumberRandomizer,r._wordsPerLineRandomizer];return r}T(t,[{key:"seed",value:function e(t){this._seedPool.forEach(function(e){return e.seed(t)})}},{key:"getImagePaths",value:function e(){return[]}},{key:"onImagesLoaded",value:function e(){}},{key:"getMaximumNumberOfTries",value:function e(){return O}},{key:"getMinLineCountOfRandom",value:function e(){return S}},{key:"getRandomAdditionalLinePercentage",value:function e(){return F}},{key:"_fontForRow",value:function e(t,r){return this._fontRandomizer.pickNext(this.getFontIdentifiers())}},{key:"_modifiedText",value:function e(t){return t.replace("\n"," ").replace("\t"," ")}},{key:"_minimumNumberOfLines",value:function e(t){return Math.ceil(Math.sqrt(t.size()))}},{key:"_maximumNumberOfLines",value:function e(t){return t.size()}},{key:"_calculatedNumberOfLines",value:function e(t){var r=this._minimumNumberOfLines(t);if(t.size()>=this.getMinLineCountOfRandom()){var n=Math.floor(Math.max(1,r*this.getRandomAdditionalLinePercentage()));r+=this._lineNumberRandomizer.nextInRange(0,n)}return Math.min(r,this._maximumNumberOfLines(t))}},{key:"_randomizedNumberOfWordsPerLine",value:function e(t,r){var n=this;if(t>r){d["Log"].warn("TextDesign#_randomizedNumberOfWordsPerLine: Invalid number of lines");return r}var i=d["Utils"].Array.repeat(1,t);d["Utils"].Array.range(t,r).forEach(function(e){var r=n._wordsPerLineRandomizer.nextInRange(0,t-1);i[r]+=1});return i}},{key:"_textLines",value:function e(t){var r=new m["a"](t);var n=this._calculatedNumberOfLines(r);var i=this._randomizedNumberOfWordsPerLine(n,r.size());return i.reduce(function(e,t){return{index:e.index+t,lines:[].concat(k(e.lines),[r.slice(e.index,Math.min(e.index+t,r.size()))])}},{index:0,lines:[]}).lines}},{key:"_validTextLines",value:function e(t){var r=this._textLines(t);var n=0;do{n=d["Utils"].Array.findIndex(r,function(e){return e.countNumberOfCharacters()<3});if(n>=0){var i=r[n-1];var a=r[n+1];var o=i?i.countNumberOfCharacters():h.a;var s=a?a.countNumberOfCharacters():h.a;if(o<s&&i){i.words=[].concat(k(i.words),k(r[n].words));r=[].concat(k(r.slice(0,n)),k(r.slice(n+1)))}else if(a){a.words=[].concat(k(r[n].words),k(a.words));r=[].concat(k(r.slice(0,n)),k(r.slice(n+1)))}}}while(n>-1&&r.length>1);return r}},{key:"_modifiedLines",value:function e(t){return t}},{key:"_getBackground",value:function e(){return this._background}},{key:"generateLayoutData",value:function e(t,r){var n=this._modifiedText(t);var i=this._modifiedLines(this._validTextLines(n));var a=r*(1-this._relativeInsets.left-this._relativeInsets.right);var o=this._layoutRows(i,a);return new b["a"]({text:n,relativeInsets:this._relativeInsets.clone(),relativeLineSpacing:this.getRelativeLineSpacing(),background:this._background||this._getBackground(),lines:i,rows:o,width:r})}},{key:"_layoutRows",value:function e(t,r){var n=this;return t.map(function(e,t){return n._randomLayoutRow(e,t,r,new w["a"]({fontIdentifier:n._fontForRow(t,e)})).layout()})}},{key:"_randomLayoutRow",value:function e(t,r,n,i){return new x["a"]({words:t,width:n,attributes:i})}}]);return t}(d["Configurable"]);I.defaultFontIdentifiers=[];I.identifier="text-design";I.prototype.availableOptions={fontIdentifiers:{type:d["OptionType"].ARRAY,default:[]},relativeLineSpacing:{type:d["OptionType"].NUMBER,default:0}}},function(e,t,r){"use strict";r.d(t,"a",function(){return b});var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(4);var h=r.n(c);var p=r(23);var v=r(76);var d=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function y(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function _(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function g(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var m=c["Math"].Rectangle;var b=function(e){g(t,e);function t(e){y(this,t);var r=_(this,(t.__proto__||f()(t)).call(this,e));r.setSize(new p["a"](r.getWidth(),0));r.serverImageSmoothingFix=false;return r}d(t,[{key:"_getFrame",value:function e(){var t=this.getSize();return new m(0,0,t.width,t.height)}},{key:"_getTextFrame",value:function e(){return this._getFrame()}},{key:"_getTextFrameForElement",value:function e(t){return t.getFrame().clone()}},{key:"_calculateLayoutElements",value:function e(){c["Log"].warn("TextDesignRow is an abstract class.")}},{key:"_getLayoutElements",value:function e(){if(this._options.elements.length<=0){this.layout()}return this.getElements()}},{key:"_fontSize",value:function e(t){c["Log"].warn("TextDesignRow#_fontSize not implemented. @TODO: Is it necessary?");return 0}},{key:"layout",value:function e(){this.setElements(this._calculateLayoutElements());return this}},{key:"textFrame",value:function e(t,r){return t.getFrame().clone()}},{key:"willRender",value:function e(t){}},{key:"didRender",value:function e(t){}},{key:"render",value:function e(t){var r=this;t.save();this._getLayoutElements().forEach(function(e){var n=e.serializeOptions(),i=n.text,a=n.frame,o=n.font;var s=r.getAttributes();o.draw(t,a.x,a.y,{textColor:s.getTextColor().toRGBA(),alignment:s.getAlignment()})});t.restore()}}]);return t}(c["Configurable"]);b.prototype.availableOptions={words:{type:c["OptionType"].OBJECT,default:null},width:{type:c["OptionType"].NUMBER,default:100},attributes:{type:c["OptionType"].CONFIGURABLE,default:new v["a"]},shearingAngle:{type:c["OptionType"].NUMBER,default:0},elements:{type:c["OptionType"].ARRAY,default:[]},size:{type:c["OptionType"].OBJECT,default:null}}},function(e,t,r){"use strict";r.d(t,"a",function(){return R});var n=r(6);var i=r.n(n);var a=r(0);var o=r.n(a);var s=r(5);var u=r.n(s);var l=r(2);var f=r.n(l);var c=r(3);var h=r.n(c);var p=r(1);var v=r.n(p);var d=r(4);var y=r.n(d);var _=r(23);var g=r(20);var m=i.a||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}}return e};var b=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;o()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var w=function e(t,r,n){if(t===null)t=Function.prototype;var i=u()(t,r);if(i===undefined){var a=v()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var o=i.get;if(o===undefined){return undefined}return o.call(n)}};function x(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function T(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function k(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=h()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)f.a?f()(e,t):e.__proto__=t}var R=function(e){k(t,e);function t(e){x(this,t);var r=T(this,(t.__proto__||v()(t)).call(this,e));var n=g["a"].getVariation(r.getFontIdentifier());if(!n){d["Log"].warn("TextDesignFont: Unable to find font '"+r._fontIdentifier+"'")}r.set({fontVariation:n});r._metrics=null;r._canvas=d["Utils"].createCanvas();r._context=r._canvas.getContext("2d");r._isDirty=true;return r}b(t,[{key:"_onOptionsChange",value:function e(){this._isDirty=true}},{key:"setOption",value:function e(r,n){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;w(t.prototype.__proto__||v()(t.prototype),"setOption",this).call(this,r,n,i,a);if(r==="fontIdentifier"&&!a){this.updateFontVariation()}}},{key:"updateFontVariation",value:function e(){var t=g["a"].getVariation(this.getFontIdentifier());if(!t){d["Log"].warn("TextDesignFont: Unable to find font '"+this._fontIdentifier+"'")}this.setFontVariation(t);return t}},{key:"setOptions",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};this._options=m({},this._options,t);this._isDirty=true}},{key:"_applyTextOptions",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this._context;var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var n=m({},this._options,r),i=n.fontSize,a=n.fontVariation,o=n.lineHeight,s=n.textColor,u=n.alignment;var l=a.serializeOptions(),f=l.fontStyle,c=l.fontWeight,h=l.fontFamily;t.font=f+" "+c+" "+i+"px/"+o+" "+h;t.fillStyle=s;t.textBaseline="alphabetic";t.textAlign=u||"left"}},{key:"getTextMetrics",value:function e(){if(!this._metrics||this._isDirty){this._calculateTextMetrics()}return m({},this._metrics)}},{key:"getSizeValue",value:function e(){if(!this._metrics||this._isDirty){this._calculateTextMetrics()}return new _["a"](this._metrics.width,this._metrics.height)}},{key:"fitWidth",value:function e(t){var r=this.getFontVariation();if(!r){d["Log"].warn("TextDesignFont#fitText: missing font variation");return}this._applyTextOptions(this._context,{fontSize:50});var n=this._context.measureText(this.getText()).width;var i=t/n;var a=Math.floor(i*50);this.setFontSize(a);this._calculateTextMetrics();return this.getTextMetrics()}},{key:"fitHeight",value:function e(t){var r=this.getFontVariation();if(!r){d["Log"].warn("TextDesignFont#fitText: missing font variation");return}var n=this._calculateTextMetrics({fontSize:50}).height;var i=t/n;var a=Math.floor(i*50);this.setFontSize(a);this._calculateTextMetrics();return this.getTextMetrics()}},{key:"_calculateTextMetrics",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=this._canvas;var n=this._context;var i=m({},this._options,t);var a=this.getText();this._applyTextOptions(n,i);var o=Math.ceil(n.measureText(a).width);var s=Math.floor(o+i.fontSize*2);var u=Math.floor(i.fontSize*3);r.width=s;r.height=u;var l=Math.floor(i.fontSize);var f=Math.floor(u*(3/5));this._applyTextOptions(n,i);n.fillText(a,l,f);var c=n.getImageData(0,0,r.width,r.height).data;var h=F(c,s,u,f,this._options.excludeAccents);var p=S(c,s,u,f,this._options.excludeAccents);var v=o;var d=h+p;this._metrics={width:v,height:d,ascender:h,descender:p};this._isDirty=false;return m({},this._metrics)}},{key:"draw",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this._context;var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var i=arguments[3];var a=arguments.length>4&&arguments[4]!==undefined?arguments[4]:false;t.save();if(!this._metrics||this._isDirty){this._calculateTextMetrics()}this._applyTextOptions(t,i);t.fillText(this.getText(),r,n+this._metrics.ascender);if(a){M(t,r,n,this._metrics.width,this._metrics.height);A(t,n+this._metrics.ascender,r,r+this._metrics.width)}t.restore()}}]);return t}(d["Configurable"]);var E=function e(t,r,n,i){var a=n*(i*4)+r*4;var o={r:t[a],g:t[a+1],b:t[a+2],a:t[a+3]};return o};var C=function e(t){return t.a<=254};var O=function e(t,r,n){var i=true;for(var a=0;a<n;a++){var o=E(t,a,r,n);if(!C(o)){i=false;break}}return i};var S=function e(t,r,n,i){var a=arguments.length>4&&arguments[4]!==undefined?arguments[4]:false;var o=0;for(var s=i+1;s<n;s++){if(!O(t,s,r)){o=s-i+1}else if(a){break}}return o};var F=function e(t,r,n,i){var a=arguments.length>4&&arguments[4]!==undefined?arguments[4]:false;var o=0;for(var s=i-1;s>=0;s--){if(!O(t,s,r)){o=i-s}else if(a){break}}return o};var I=function e(t,r,n,i,a){t.beginPath();t.moveTo(r,n);t.lineTo(i,a);t.stroke()};var A=function e(t,r,n,i){var a=arguments.length>4&&arguments[4]!==undefined?arguments[4]:"red";t.save();t.strokeStyle=a;I(t,n,r,i,r);t.restore()};var M=function e(t,r,n,i,a){var o=arguments.length>5&&arguments[5]!==undefined?arguments[5]:"blue";t.save();t.strokeStyle=o;t.strokeRect(r,n,i,a);t.restore()};R.prototype.availableOptions={text:{type:d["OptionType"].STRING,default:""},fontIdentifier:{type:d["OptionType"].STRING,default:"imgly_font_open_sans_bold"},fontVariation:{type:d["OptionType"].OBJECT,default:null},lineHeight:{type:d["OptionType"].NUMBER,default:1},fontSize:{type:d["OptionType"].NUMBER,default:22},textColor:{type:d["OptionType"].STRING,default:"black"},strokeStyle:{type:d["OptionType"].STRING,default:"black"},outlineWidth:{type:d["OptionType"].NUMBER,default:0},textBaseline:{type:d["OptionType"].STRING,default:"alphabetic"},excludeAccents:{type:d["OptionType"].BOOLEAN,default:false}}},function(e,t,r){"use strict";r.d(t,"a",function(){return g});var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(4);var h=r.n(c);var p=r(17);var v=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function d(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function y(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function _(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var g=function(e){_(t,e);function t(){d(this,t);return y(this,(t.__proto__||f()(t)).apply(this,arguments))}v(t,[{key:"insetsForWidth",value:function e(t){var r=this.getRelativeInsets().clone();return r.scale(t)}}]);return t}(c["Configurable"]);g.prototype.availableOptions={imagePath:{type:c["OptionType"].STRING,default:""},minimumHeightRatio:{type:c["OptionType"].NUMBER,default:0},sizeToFitContent:{type:c["OptionType"].BOOLEAN,default:true},capInsets:{type:c["OptionType"].OBJECT,default:new p["a"]},relativeInsets:{type:c["OptionType"].OBJECT,default:new p["a"]}};g.Box=new g({imagePath:"text-design/images/imgly_text_design_asset_black_background.png",relativeInsets:new p["a"](.1,.1,.1,.1)});g.Badge1=new g({imagePath:"text-design/images/imgly_text_design_asset_badge1.png",relativeInsets:new p["a"](.3,.18,.2,.18)});g.Badge2=new g({imagePath:"text-design/images/imgly_text_design_asset_badge2.png",relativeInsets:new p["a"](.3,.18,.2,.18)});g.Badge3=new g({imagePath:"text-design/images/imgly_text_design_asset_badge3.png",relativeInsets:new p["a"](.3,.18,.2,.18)});g.Badge4=new g({imagePath:"text-design/images/imgly_text_design_asset_badge4.png",relativeInsets:new p["a"](.3,.18,.2,.18)});g.SpeechBubble1=new g({imagePath:"text-design/images/imgly_text_design_asset_speech_bubble_small2.png",relativeInsets:new p["a"](.04,.07,.12,.07),capInsets:new p["a"](19*3,57*3,41*3,17*3)});g.SpeechBubble2=new g({imagePath:"text-design/images/imgly_text_design_asset_speech_bubble3.png",relativeInsets:new p["a"](.04,.07,.12,.07),capInsets:new p["a"](2*3,35*3,29*3,5*3)});g.SpeechBubble3=new g({imagePath:"text-design/images/imgly_text_design_asset_speech_bubble_small.png",relativeInsets:new p["a"](.165664675,.2,.165664675,.2),minimumHeightRatio:.7});g.SpeechBubble4=new g({imagePath:"text-design/images/imgly_text_design_asset_speech_bubble4.png",relativeInsets:new p["a"](.124800224,.2,.291200523,.2),minimumHeightRatio:.7});g.SpeechBubble5=new g({imagePath:"text-design/images/imgly_text_design_asset_speech_bubble5.png",relativeInsets:new p["a"](.114892823,.27,.15984926,.27)});g.Watercolor1=new g({imagePath:"text-design/images/imgly_text_design_asset_watercolor_01.png",minimumHeightRatio:.7,relativeInsets:new p["a"](.2,.25,.2,.25)});g.Watercolor2=new g({imagePath:"text-design/images/imgly_text_design_asset_watercolor_02.png",minimumHeightRatio:.7,relativeInsets:new p["a"](.08,.25,.3,.25)});g.Watercolor3=new g({imagePath:"text-design/images/imgly_text_design_asset_watercolor_03.png",minimumHeightRatio:.7,relativeInsets:new p["a"](.1,.2,.15,.2)})},function(e,t){e.exports=true},function(e,t){e.exports=function(e){if(typeof e!="function")throw TypeError(e+" is not a function!");return e}},function(e,t){var r=0;var n=Math.random();e.exports=function(e){return"Symbol(".concat(e===undefined?"":e,")_",(++r+n).toString(36))}},function(e,t,r){var n=r(21).f;var i=r(27);var a=r(11)("toStringTag");e.exports=function(e,t,r){if(e&&!i(e=r?e:e.prototype,a))n(e,a,{configurable:true,value:t})}},function(e,t,r){r(166);var n=r(14);var i=r(26);var a=r(38);var o=r(11)("toStringTag");var s=("CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,"+"DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,"+"MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,"+"SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,"+"TextTrackList,TouchList").split(",");for(var u=0;u<s.length;u++){var l=s[u];var f=n[l];var c=f&&f.prototype;if(c&&!c[o])i(c,o,l);a[l]=a.Array}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,r){"use strict";var n=r(196);var i=r(213);var a=r(95);var o=r(99);var s=r(98);var u=r(133);var l=r(53);var f=r(134);var c=r(221);var h=r(73);var p=r(72);var v=r(222);var d=r(224);var y=r(97);var _=r(54);var g=r(228);var m=r(132);var b={WebGLRenderer:i["a"],CanvasRenderer:n["a"],WebGLFilterManager:o["a"],CanvasFilterManager:a["a"],DisplayObject:s["a"],Container:u["a"],BaseTexture:l["a"],Texture:f["a"],RenderTexture:c["a"],WebGLRenderTarget:h["a"],CanvasRenderTarget:p["a"],Sprite:v["a"],Shaders:d["a"],Shader:y["a"],Filter:_["a"],Filters:g,PixelArrayImage:m["a"],autoDetectRenderer:function e(t,r){var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};if(i["a"].isSupported()){return new i["a"](t,r,a)}else{return new n["a"](t,r,a)}}};t["a"]=b},function(e,t,r){e.exports={default:r(205),__esModule:true}},function(e,t,r){e.exports={default:r(208),__esModule:true}},function(e,t,r){e.exports={default:r(210),__esModule:true}},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(9);var o=r(53);var s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function u(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var l=function(){function e(t,r,n,i,a){u(this,e);this._width=t;this._height=r;this._pixelRatio=n;this._baseTexture=new o["a"];this._canvas=i||this._createCanvas();this._context=a||this._canvas.getContext("2d");this._baseTexture.setSource(this._canvas);this._canvas.width=this._width*this._pixelRatio;this._canvas.height=this._height*this._pixelRatio;this._filterStack=[{renderTarget:this,filter:[]}]}s(e,[{key:"_createCanvas",value:function e(){return a["i"].createCanvas()}},{key:"clear",value:function e(){var t=this._context;t.setTransform(1,0,0,1,0,0);t.clearRect(0,0,this._width*this._pixelRatio,this._height*this._pixelRatio)}},{key:"resizeTo",value:function e(t){this._baseTexture.resizeTo(t);if(this._width!==t.x){this._width=t.x;this._canvas.width=this._width*this._pixelRatio}if(this._height!==t.y){this._height=t.y;this._canvas.height=this._height*this._pixelRatio}}},{key:"getCanvas",value:function e(){return this._canvas}},{key:"getContext",value:function e(){return this._context}},{key:"getFilterStack",value:function e(){return this._filterStack}},{key:"getWidth",value:function e(){return this._width}},{key:"getHeight",value:function e(){return this._height}},{key:"getPixelRatio",value:function e(){return this._pixelRatio}},{key:"setPixelRatio",value:function e(t){this._pixelRatio=t}},{key:"getDimensions",value:function e(){return new a["k"](this._width,this._height)}},{key:"getBaseTexture",value:function e(){return this._baseTexture}},{key:"dispose",value:function e(){this._canvas=null;this._context=null}}]);return e}();t["a"]=l},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(9);var o=r(53);var s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function u(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var l=function(){function e(t,r,n,i){var s=arguments.length>4&&arguments[4]!==undefined?arguments[4]:false;u(this,e);this._renderer=t;this._gl=t.getContext();this._width=r;this._height=n;this._frame=null;this._pixelRatio=i;this._projectionMatrix=new a["g"];this._mipMapping=false;this._baseTexture=new o["a"];var l=this._baseTexture.getFrame();l.width=r;l.height=n;this._baseTexture.setPixelRatio(i);this._baseTexture.setLoaded(true);this._framebuffer=null;this._isRoot=s;this._filterStack=[{renderTarget:this,filter:[]}];if(!s){this._initFrameBuffer()}}s(e,[{key:"resizeTo",value:function e(t){this._width=t.x|0;this._height=t.y|0;this._baseTexture.resizeTo(t);if(!this._isRoot){this._resizeTexture()}this._baseTexture.setMinFilter(this._getMinFilter());this._baseTexture.setMagFilter(this._getMagFilter());this._calculateProjectionMatrix()}},{key:"_getMinFilter",value:function e(){var t=o["a"].DefaultMinFilter;if(this._mipMapping){t=o["a"].TrilinearFilter}return t}},{key:"_getMagFilter",value:function e(){return o["a"].DefaultMagFilter}},{key:"_resizeTexture",value:function e(){var t=this._gl;t.bindTexture(t.TEXTURE_2D,this._texture);var r=this._width*this._pixelRatio;var n=this._height*this._pixelRatio;t.texImage2D(t.TEXTURE_2D,0,t.RGBA,r,n,0,t.RGBA,t.UNSIGNED_BYTE,null);var i=new a["k"](this._width,this._height);if(a["i"].isPowerOfTwo(i)){a["f"].info("WebGLRenderTarget","Mip-mapping enabled");this._mipMapping=true}else{this._mipMapping=false}this._baseTexture.setMipMappingEnabled(this._mipMapping)}},{key:"activate",value:function e(){var t=this._gl;t.bindFramebuffer(t.FRAMEBUFFER,this._framebuffer);this._calculateProjectionMatrix();t.viewport(0,0,this._width*this._pixelRatio,this._height*this._pixelRatio);t.disable(t.STENCIL_TEST)}},{key:"clear",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:a["b"].TRANSPARENT;var r=this._gl;r.bindFramebuffer(r.FRAMEBUFFER,this._framebuffer);a["e"].checkFramebufferStatus("WebGLRenderTarget#clear",r);r.clearColor.apply(r,t.toGLColor());r.clear(r.COLOR_BUFFER_BIT)}},{key:"_calculateProjectionMatrix",value:function e(){var t=this._projectionMatrix;t.reset();var r=this._frame||new a["h"](0,0,this._width,this._height);var n=r.x,i=r.y;if(!this._isRoot){t.a=1/this._width*2;t.d=1/this._height*2;t.tx=-1-n*t.a;t.ty=-1-i*t.d}else{t.a=1/this._width*2;t.d=-1/this._height*2;t.tx=-1-n*t.a;t.ty=1-i*t.d}}},{key:"_initFrameBuffer",value:function e(){var t=this._gl;this._framebuffer=t.createFramebuffer();this._texture=t.createTexture();t.bindTexture(t.TEXTURE_2D,this._texture);t.bindFramebuffer(t.FRAMEBUFFER,this._framebuffer);t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this._texture,0);this._baseTexture.setGLTextureForRenderer(this._texture,this._renderer);this.resizeTo(new a["k"](this._width,this._height));a["e"].checkFramebufferStatus("WebGLRenderTarget#_initFramebuffer",t)}},{key:"getProjectionMatrix",value:function e(){return this._projectionMatrix}},{key:"getTexture",value:function e(){return this._texture}},{key:"getFrame",value:function e(){return this._frame}},{key:"setFrame",value:function e(t){this._frame=t}},{key:"getFilterStack",value:function e(){return this._filterStack}},{key:"getPixelRatio",value:function e(){return this._pixelRatio}},{key:"setPixelRatio",value:function e(t){this._pixelRatio=t;if(!this._isRoot){this._resizeTexture()}}},{key:"getBaseTexture",value:function e(){return this._baseTexture}},{key:"dispose",value:function e(){var t=this._gl;this._baseTexture.disposeGLTexturesForRenderer(this._renderer);t.deleteTexture(this._texture);t.deleteFramebuffer(this._framebuffer)}}]);return e}();t["a"]=l},function(e,t,r){"use strict";var n=void 0;if(true){n=window.Image}t["a"]=n},function(e,t,r){"use strict";var n=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259];var i=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function a(e,t,r,a,s,u){if(isNaN(u)||u<1){return}u|=0;var l=e.data;var f,c,h,p,v,d,y,_,g,m,b,w,x,T,k,R,E,C,O,S,F,I,A,M;var D=u+u+1;var L=a-1;var B=s-1;var P=u+1;var U=P*(P+1)/2;var N=new o;var j;var z=N;for(h=1;h<D;h++){z=z.next=new o;if(h==P)j=z}z.next=N;var G=null;var V=null;y=d=0;var W=n[u];var H=i[u];for(c=0;c<s;c++){R=E=C=O=_=g=m=b=0;w=P*(S=l[d]);x=P*(F=l[d+1]);T=P*(I=l[d+2]);k=P*(A=l[d+3]);_+=U*S;g+=U*F;m+=U*I;b+=U*A;z=N;for(h=0;h<P;h++){z.r=S;z.g=F;z.b=I;z.a=A;z=z.next}for(h=1;h<P;h++){p=d+((L<h?L:h)<<2);_+=(z.r=S=l[p])*(M=P-h);g+=(z.g=F=l[p+1])*M;m+=(z.b=I=l[p+2])*M;b+=(z.a=A=l[p+3])*M;R+=S;E+=F;C+=I;O+=A;z=z.next}G=N;V=j;for(f=0;f<a;f++){l[d+3]=A=b*W>>H;if(A!==0){A=255/A;l[d]=(_*W>>H)*A;l[d+1]=(g*W>>H)*A;l[d+2]=(m*W>>H)*A}else{l[d]=l[d+1]=l[d+2]=0}_-=w;g-=x;m-=T;b-=k;w-=G.r;x-=G.g;T-=G.b;k-=G.a;p=y+((p=f+u+1)<L?p:L)<<2;R+=G.r=l[p];E+=G.g=l[p+1];C+=G.b=l[p+2];O+=G.a=l[p+3];_+=R;g+=E;m+=C;b+=O;G=G.next;w+=S=V.r;x+=F=V.g;T+=I=V.b;k+=A=V.a;R-=S;E-=F;C-=I;O-=A;V=V.next;d+=4}y+=a}for(f=0;f<a;f++){E=C=O=R=g=m=b=_=0;d=f<<2;w=P*(S=l[d]);x=P*(F=l[d+1]);T=P*(I=l[d+2]);k=P*(A=l[d+3]);_+=U*S;g+=U*F;m+=U*I;b+=U*A;z=N;for(h=0;h<P;h++){z.r=S;z.g=F;z.b=I;z.a=A;z=z.next}v=a;for(h=1;h<=u;h++){d=v+f<<2;_+=(z.r=S=l[d])*(M=P-h);g+=(z.g=F=l[d+1])*M;m+=(z.b=I=l[d+2])*M;b+=(z.a=A=l[d+3])*M;R+=S;E+=F;C+=I;O+=A;z=z.next;if(h<B){v+=a}}d=f;G=N;V=j;for(c=0;c<s;c++){p=d<<2;l[p+3]=A=b*W>>H;if(A>0){A=255/A;l[p]=(_*W>>H)*A;l[p+1]=(g*W>>H)*A;l[p+2]=(m*W>>H)*A}else{l[p]=l[p+1]=l[p+2]=0}_-=w;g-=x;m-=T;b-=k;w-=G.r;x-=G.g;T-=G.b;k-=G.a;p=f+((p=c+P)<B?p:B)*a<<2;_+=R+=G.r=l[p];g+=E+=G.g=l[p+1];m+=C+=G.b=l[p+2];b+=O+=G.a=l[p+3];G=G.next;w+=S=V.r;x+=F=V.g;T+=I=V.b;k+=A=V.a;R-=S;E-=F;C-=I;O-=A;V=V.next;d+=a}}}function o(){this.r=0;this.g=0;this.b=0;this.a=0;this.next=null}e.exports={stackBlurCanvasRGBA:a}},function(e,t,r){"use strict";r.d(t,"a",function(){return v});var n=r(2);var i=r.n(n);var a=r(3);var o=r.n(a);var s=r(1);var u=r.n(s);var l=r(4);var f=r.n(l);function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function h(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function p(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=o()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)i.a?i()(e,t):e.__proto__=t}var v=function(e){p(t,e);function t(){c(this,t);return h(this,(t.__proto__||u()(t)).apply(this,arguments))}return t}(l["Configurable"]);v.prototype.availableOptions={tintColor:{type:l["OptionType"].COLOR,default:l["Color"].BLACK},textColor:{type:l["OptionType"].COLOR,default:l["Color"].BLACK},alignment:{type:l["OptionType"].STRING,default:"left",available:["left","center","right"]},lineSpacing:{type:l["OptionType"].NUMBER,default:1},fontIdentifier:{type:l["OptionType"].STRING,default:"imgly_font_open_sans_bold"}}},function(e,t){var r=Math.ceil;var n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:r)(e)}},function(e,t){e.exports=function(e){if(e==undefined)throw TypeError("Can't call method on "+e);return e}},function(e,t,r){var n=r(24);var i=r(14).document;var a=n(i)&&n(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},function(e,t,r){var n=r(24);e.exports=function(e,t){if(!n(e))return e;var r,i;if(t&&typeof(r=e.toString)=="function"&&!n(i=r.call(e)))return i;if(typeof(r=e.valueOf)=="function"&&!n(i=r.call(e)))return i;if(!t&&typeof(r=e.toString)=="function"&&!n(i=r.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t,r){var n=r(18);var i=r(163);var a=r(85);var o=r(83)("IE_PROTO");var s=function(){};var u="prototype";var l=function(){var e=r(79)("iframe");var t=a.length;var n="<";var i=">";var o;e.style.display="none";r(114).appendChild(e);e.src="javascript:";o=e.contentWindow.document;o.open();o.write(n+"script"+i+"document.F=Object"+n+"/script"+i);o.close();l=o.F;while(t--)delete l[u][a[t]];return l()};e.exports=Object.create||function e(t,r){var a;if(t!==null){s[u]=n(t);a=new s;s[u]=null;a[o]=t}else a=l();return r===undefined?a:i(a,r)}},function(e,t,r){var n=r(77);var i=Math.min;e.exports=function(e){return e>0?i(n(e),9007199254740991):0}},function(e,t,r){var n=r(84)("keys");var i=r(64);e.exports=function(e){return n[e]||(n[e]=i(e))}},function(e,t,r){var n=r(14);var i="__core-js_shared__";var a=n[i]||(n[i]={});e.exports=function(e){return a[e]||(a[e]={})}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,r){t.f=r(11)},function(e,t,r){var n=r(14);var i=r(10);var a=r(62);var o=r(86);var s=r(21).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=a?{}:n.Symbol||{});if(e.charAt(0)!="_"&&!(e in t))s(t,e,{value:o.f(e)})}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,r){var n=r(67);var i=r(46);var a=r(28);var o=r(80);var s=r(27);var u=r(110);var l=Object.getOwnPropertyDescriptor;t.f=r(25)?l:function e(t,r){t=a(t);r=o(r,true);if(u)try{return l(t,r)}catch(e){}if(s(t,r))return i(!n.f.call(t,r),t[r])}},function(e,t,r){var n=r(48);var i=r(11)("toStringTag");var a=n(function(){return arguments}())=="Arguments";var o=function(e,t){try{return e[t]}catch(e){}};e.exports=function(e){var t,r,s;return e===undefined?"Undefined":e===null?"Null":typeof(r=o(t=Object(e),i))=="string"?r:a?n(t):(s=n(t))=="Object"&&typeof t.callee=="function"?"Arguments":s}},function(e,t,r){var n=r(90);var i=r(11)("iterator");var a=r(38);e.exports=r(10).getIteratorMethod=function(e){if(e!=undefined)return e[i]||e["@@iterator"]||a[n(e)]}},function(e,t,r){var n=r(36);var i=r(188);var a=r(114);var o=r(79);var s=r(14);var u=s.process;var l=s.setImmediate;var f=s.clearImmediate;var c=s.MessageChannel;var h=s.Dispatch;var p=0;var v={};var d="onreadystatechange";var y,_,g;var m=function(){var e=+this;if(v.hasOwnProperty(e)){var t=v[e];delete v[e];t()}};var b=function(e){m.call(e.data)};if(!l||!f){l=function e(t){var r=[];var n=1;while(arguments.length>n)r.push(arguments[n++]);v[++p]=function(){i(typeof t=="function"?t:Function(t),r)};y(p);return p};f=function e(t){delete v[t]};if(r(48)(u)=="process"){y=function(e){u.nextTick(n(m,e,1))}}else if(h&&h.now){y=function(e){h.now(n(m,e,1))}}else if(c){_=new c;g=_.port2;_.port1.onmessage=b;y=n(g.postMessage,g,1)}else if(s.addEventListener&&typeof postMessage=="function"&&!s.importScripts){y=function(e){s.postMessage(e+"","*")};s.addEventListener("message",b,false)}else if(d in o("script")){y=function(e){a.appendChild(o("script"))[d]=function(){a.removeChild(this);m.call(e)}}}else{y=function(e){setTimeout(n(m,e,1),0)}}}e.exports={set:l,clear:f}},function(e,t,r){"use strict";var n=r(63);function i(e){var t,r;this.promise=new e(function(e,n){if(t!==undefined||r!==undefined)throw TypeError("Bad Promise constructor");t=e;r=n});this.resolve=n(t);this.reject=n(r)}e.exports.f=function(e){return new i(e)}},function(e,t,r){var n=r(13);var i=r(10);var a=r(37);e.exports=function(e,t){var r=(i.Object||{})[e]||Object[e];var o={};o[e]=t(r);n(n.S+n.F*a(function(){r(1)}),"Object",o)}},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(9);var o=r(72);var s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function u(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var l=function(){function e(t){u(this,e);this._renderer=t;this._filterStack=[{renderTarget:t.getCurrentRenderTarget(),filters:[]}];this._currentFrame=null;this._textures=[];this._textureFrame=new a["h"](0,0,t.getWidth(),t.getHeight())}s(e,[{key:"resizeTo",value:function e(t){this._textureFrame.width=t.x;this._textureFrame.height=t.y;this._textures.forEach(function(e){return e.resizeTo(t)})}},{key:"pushFilters",value:function e(t,r){var n=t.getBounds();this._currentFrame=n;var i=this._getOrCreateRenderTarget();this._renderer.setRenderTarget(i);this._filterStack.push({renderTarget:i,filters:r});i.clear()}},{key:"popFilters",value:function e(){var t=this._filterStack.pop(),r=t.filters,n=t.renderTarget;var i=this._filterStack[this._filterStack.length-1];var a=n;var o=i.renderTarget;if(r.length===1){r[0].apply(this._renderer,a,o);this._textures.push(a)}else{this._applyFilters(r,a,o)}return r}},{key:"_applyFilters",value:function e(t,r,n){var i=this;var a=r;var o=this._getOrCreateRenderTarget(true);var s=t[t.length-1];t.forEach(function(e,t){var r=e===s;if(!r){e.apply(i._renderer,a,o);var u=a;a=o;o=u}else{e.apply(i._renderer,a,n)}});this._textures.push(a);this._textures.push(o)}},{key:"_getOrCreateRenderTarget",value:function e(t){var r=this._textures.pop();if(!r){r=new o["a"](this._textureFrame.width,this._textureFrame.height,1)}if(t){r.clear()}return r}},{key:"setFilterStack",value:function e(t){this._filterStack=t}},{key:"dispose",value:function e(){}}]);return e}();t["a"]=l},function(e,t,r){"use strict";var n=r(2);var i=r.n(n);var a=r(3);var o=r.n(a);var s=r(1);var u=r.n(s);var l=r(9);var f=r(97);function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function h(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function p(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=o()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)i.a?i()(e,t):e.__proto__=t}var v=l["c"].UniformType;var d=function(e){p(t,e);function t(e,r,n){c(this,t);r=r||t.defaultVertexSource;n=n||t.defaultFragmentSource;return h(this,(t.__proto__||u()(t)).call(this,e,r,n,t.defaultUniforms,t.defaultAttributes))}return t}(f["a"]);d.defaultVertexSource=r(217);d.defaultFragmentSource=r(218);var y=new l["g"];d.defaultUniforms={u_image:{type:v.SAMPLER2D,value:0},u_projMatrix:{type:v.MAT3,value:y.toArray()}};d.defaultAttributes=["a_position","a_texCoord","a_color"];t["a"]=d},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(69);var o=r.n(a);var s=r(9);var u=r(31);var l=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function f(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var c=s["f"],h=s["i"];var p=function(){function e(t,r,n,i,a){f(this,e);this._renderer=t;this._vertexSource=r;this._fragmentSource=n;this._uniforms=i||{};this._uniformLocations={};this._attributes=a||[];this._attributeLocations={};this._onContextChange=this._onContextChange.bind(this);this._renderer.on("context",this._onContextChange);this._init()}l(e,[{key:"_init",value:function e(){this._compile();var t=this._renderer.getContext();t.useProgram(this._program);this._cacheUniformLocations();this._cacheAttributeLocations()}},{key:"_onContextChange",value:function e(){this._init()}},{key:"setupBuffers",value:function e(t,r){var n=this._renderer.getContext();n.bindBuffer(n.ARRAY_BUFFER,t);n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,r);n.vertexAttribPointer(this._attributeLocations.a_position,2,n.FLOAT,false,s["j"],0);n.vertexAttribPointer(this._attributeLocations.a_texCoord,2,n.FLOAT,false,s["j"],2*4);n.vertexAttribPointer(this._attributeLocations.a_color,4,n.UNSIGNED_BYTE,true,s["j"],4*4)}},{key:"syncUniforms",value:function e(){var t=this;o()(this._uniforms).forEach(function(e){t.syncUniform(e)})}},{key:"syncUniform",value:function e(t){var r=this._renderer.getContext();var n=this._uniforms[t];var i=this._uniformLocations[t];switch(n.type){case u["UniformType"].SAMPLER2D:r.uniform1i(i,n.value);break;case u["UniformType"].INT:case u["UniformType"].INT1:r.uniform1i(i,n.value);break;case u["UniformType"].FLOAT:case u["UniformType"].FLOAT1:r.uniform1f(i,n.value);break;case u["UniformType"].FLOAT2:r.uniform2f(i,n.value[0],n.value[1]);break;case u["UniformType"].FLOAT3:r.uniform3f(i,n.value[0],n.value[1],n.value[2]);break;case u["UniformType"].FLOAT4:r.uniform4f(i,n.value[0],n.value[1],n.value[2],n.value[3]);break;case u["UniformType"].FLOAT_VECTOR2:r.uniform2fv(i,n.value);break;case u["UniformType"].MAT3:case u["UniformType"].MAT3FV:r.uniformMatrix3fv(i,false,n.value);break;case u["UniformType"].MAT4:r.uniformMatrix4fv(i,false,n.value);break;default:c.warn(this.constructor.name,"Unknown uniform type: "+n.type)}}},{key:"_cacheAttributeLocations",value:function e(){var t=this;var r=this._renderer.getContext();this._attributes.forEach(function(e){t._attributeLocations[e]=r.getAttribLocation(t._program,e)})}},{key:"_cacheUniformLocations",value:function e(){var t=this;var r=this._renderer.getContext();var n=o()(this._uniforms);n.forEach(function(e){t._uniformLocations[e]=r.getUniformLocation(t._program,e)})}},{key:"_addPrecisionToSource",value:function e(t){var r=this._renderer.getMaxFloatPrecision();var n="mediump";if(h.isMobile()&&r==="highp"){n="highp"}return"precision "+n+" float;\n"+t}},{key:"_compile",value:function e(){var t=this._renderer.getContext();var r=this._compileShader(t.VERTEX_SHADER,this._vertexSource);this._vertexShader=r;var n=this._addPrecisionToSource(this._fragmentSource);var i=this._compileShader(t.FRAGMENT_SHADER,n);this._fragmentShader=i;var a=t.createProgram();t.attachShader(a,r);t.attachShader(a,i);t.linkProgram(a);var o=t.getProgramParameter(a,t.LINK_STATUS);if(!o){var s=t.getProgramInfoLog(a);if(t.isContextLost())s="WebGL context lost";t.deleteProgram(a);c.error(this.constructor.name,"WebGL program linking error: "+s)}this._program=a}},{key:"_compileShader",value:function e(t,r){var n=this._renderer.getContext();var i=n.createShader(t);n.shaderSource(i,r);n.compileShader(i);var a=n.getShaderParameter(i,n.COMPILE_STATUS);if(!a){var o=n.getShaderInfoLog(i);if(n.isContextLost())o="WebGL context lost";n.deleteShader(i);c.error(this.constructor.name,"WebGL shader compilation error: "+o)}return i}},{key:"setUniform",value:function e(t,r){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;this._uniforms[t].value=r;if(n){this.syncUniform(t)}}},{key:"setUniforms",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;for(var n in t){this._uniforms[n].value=t[n];if(r){this.syncUniform(n)}}}},{key:"getUniforms",value:function e(){return this._uniforms}},{key:"getAttributes",value:function e(){return this._attributes}},{key:"getAttributeLocations",value:function e(){return this._attributeLocations}},{key:"getProgram",value:function e(){return this._program}},{key:"dispose",value:function e(){var t=this._renderer.getContext();t.deleteProgram(this._program);t.deleteShader(this._vertexShader);t.deleteShader(this._fragmentShader);this._uniforms=null;this._uniformLocations=null;this._attributes=null;this._attributeLocations=null;this._renderer.off("context",this._onContextChange)}}]);return e}();t["a"]=p},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(9);var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function s(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var u=function(){function e(){s(this,e);this._position=new a["k"](0,0);this._scale=new a["k"](1,1);this._pivot=new a["k"](0,0);this._rotation=0;this._lastRotation=null;this._alpha=1;this._visible=true;this._worldTransform=new a["g"];this._parent=null;this._shaders=[];this._boundsNeedUpdate=true;this._bounds=new a["h"](0,0,1,1);this._localBoundsNeedUpdate=true;this._localBounds=new a["h"](0,0,1,1);this._tint=16777215;this._filterRectangle=new a["h"](0,0,0,0)}o(e,[{key:"renderWebGL",value:function e(t){a["f"].warn(this.constructor.name,"`renderWebGL` is abstract and not implemented in inherited class")}},{key:"renderCanvas",value:function e(t){a["f"].warn(this.constructor.name,"`renderCanvas` is abstract and not implemented in inherited class")}},{key:"updateTransform",value:function e(){var t=this._parent?this._parent.getWorldTransform():a["g"].IDENTITY;var r=this._worldTransform;var n=this._rotation!==this._lastRotation;if(n){this._sinRotation=Math.sin(this._rotation);this._cosRotation=Math.cos(this._rotation);this._lastRotation=this._rotation}r.a=this._cosRotation*this._scale.x;r.b=this._sinRotation*this._scale.x;r.c=-this._sinRotation*this._scale.y;r.d=this._cosRotation*this._scale.y;r.tx=this._position.x;r.ty=this._position.y;if(this._pivot.x||this._pivot.y){r.tx-=this._pivot.x*r.a+this._pivot.y*r.c;r.ty-=this._pivot.x*r.b+this._pivot.y*r.d}r.tx|=0;r.ty|=0;r.multiply(t);this._boundsNeedUpdate=true;this._localBoundsNeedUpdate=true}},{key:"addShader",value:function e(t){this._shaders.push(t)}},{key:"removeShader",value:function e(t){var r=this._shaders.indexOf(t);if(r!==-1){this._shaders.splice(r,1);return true}return false}},{key:"removeShaderAt",value:function e(t){if(!this._shaders[t]){return false}this._shaders.splice(t,1);return true}},{key:"getBounds",value:function e(){return this._bounds.clone()}},{key:"getPosition",value:function e(){return this._position}},{key:"setPosition",value:function e(t,r){if(t instanceof a["k"]){this._position.copy(t)}else{this._position.set(t,r)}this._boundsNeedUpdate=true;this._localBoundsNeedUpdate=true}},{key:"getScale",value:function e(){return this._scale}},{key:"setScale",value:function e(t,r){if(t instanceof a["k"]){this._scale.copy(t)}else{this._scale.set(t,r)}this._boundsNeedUpdate=true;this._localBoundsNeedUpdate=true}},{key:"getPivot",value:function e(){return this._pivot}},{key:"setPivot",value:function e(t,r){if(t instanceof a["k"]){this._pivot.copy(t)}else{this._pivot.set(t,r)}this._boundsNeedUpdate=true;this._localBoundsNeedUpdate=true}},{key:"getRotation",value:function e(){return this._rotation}},{key:"setRotation",value:function e(t){this._rotation=t;this._boundsNeedUpdate=true;this._localBoundsNeedUpdate=true}},{key:"getAlpha",value:function e(){return this._alpha}},{key:"setAlpha",value:function e(t){this._alpha=t}},{key:"getWorldAlpha",value:function e(){if(this._parent){return this._parent.getAlpha()*this._alpha}else{return this._alpha}}},{key:"getWorldTransform",value:function e(){return this._worldTransform}},{key:"getParent",value:function e(){return this._parent}},{key:"setParent",value:function e(t){this._parent=t}},{key:"getFilterRectangle",value:function e(){return this._filterRectangle}},{key:"setFilterRectangle",value:function e(t){this._filterRectangle.copy(t)}},{key:"getTint",value:function e(){return this._tint}},{key:"setTint",value:function e(t){this._tint=t}},{key:"isVisible",value:function e(){return this._visible}},{key:"setVisible",value:function e(t){this._visible=t}}]);return e}();t["a"]=u},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(9);var o=r(73);var s=r(219);var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function l(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var f=a["c"].RendererType;var c=function(){function e(t){l(this,e);this._renderer=t;this._filterStack=[{filters:[]}];this._currentFrame=null;this._renderTargets=[];this._textureFrame=new a["h"](0,0,t.getWidth(),t.getHeight());this._onContextChange=this._onContextChange.bind(this);this._renderer.on("context",this._onContextChange);this._onContextChange()}u(e,[{key:"resizeTo",value:function e(t){this._textureFrame.width=t.x;this._textureFrame.height=t.y;this._renderTargets.forEach(function(e){return e.resizeTo(t)})}},{key:"getFilterStack",value:function e(){return this._filterStack}},{key:"setFilterStack",value:function e(t){this._filterStack=t}},{key:"_getOrCreateRenderTarget",value:function e(t){var r=this._renderTargets.pop();if(!r){r=new o["a"](this._renderer,this._textureFrame.width,this._textureFrame.height,1)}r.setFrame(this._currentFrame);if(t){r.clear()}return r}},{key:"pushFilters",value:function e(t,r){var n=t.getBounds();this._currentFrame=n;var i=t.getFilterRectangle();if(i.width>0&&i.height>0){this._currentFrame=i}var a=this._getOrCreateRenderTarget();this._renderer.setRenderTarget(a);a.clear();this._filterStack.push({renderTarget:a,filters:r})}},{key:"popFilters",value:function e(){var t=this._filterStack.pop(),r=t.filters,n=t.renderTarget;var i=this._filterStack[this._filterStack.length-1];var a=n;var o=i.renderTarget;this._quad.map(this._textureFrame,a.getFrame());var s=r[0].getShaderForRenderer(this._renderer);var u=this._quad.getVertexBuffer();var l=this._quad.getIndexBuffer();var f=this._renderer.getContext();f.bindBuffer(f.ARRAY_BUFFER,u);f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,l);var c=s.getAttributeLocations();f.vertexAttribPointer(c.a_position,2,f.FLOAT,false,0,0);f.vertexAttribPointer(c.a_texCoord,2,f.FLOAT,false,0,2*4*4);f.vertexAttribPointer(c.a_color,4,f.FLOAT,false,0,4*4*4);this._renderer.updateTexture(a.getBaseTexture(),false);if(r.length===1){r[0].apply(this._renderer,a,o);this._renderTargets.push(a)}else{this._applyFilters(r,a,o)}return r}},{key:"_applyFilters",value:function e(t,r,n){var i=this;var a=r;var o=this._getOrCreateRenderTarget(true);this._renderer.updateTexture(o.getBaseTexture(),false);var s=t[t.length-1];t.forEach(function(e,t){var r=e===s;if(!r){e.apply(i._renderer,a,o);var u=a;a=o;o=u}else{e.apply(i._renderer,a,n)}});this._renderTargets.push(a);this._renderTargets.push(o)}},{key:"_onContextChange",value:function e(){this._renderTargets.length=0;if(this._renderer.isOfType(f.WEBGL)){if(this._quad){this._quad.dispose()}this._quad=new s["a"](this._renderer)}}},{key:"dispose",value:function e(){this._renderer.off("context",this._onContextChange);if(this._quad){this._quad.dispose()}this._renderTargets.forEach(function(e){e.dispose()})}}]);return e}();t["a"]=c},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(50);var o=r(101);var s=r(22);var u=r(102);var l=r(251);var f=r(252);var c=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function h(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var p=s["a"].invariant;var v=u["a"].MARKERS;var d="data:image/jpeg;base64,";var y=new RegExp("^"+d,"i");var _=function(){function e(t){h(this,e);this._buf=t;this._stream=new o["a"](this._buf);this._stream.setHead(0);this._segments=this._sliceIntoSegments(this._buf);this._exifData=new f["a"](this._getMarkerBuffer(v.EXIF));this._jfifData=new l["a"](this._getMarkerBuffer(v.JFIF))}c(e,[{key:"restoreSegments",value:function t(r){var n=e.fromDataURL(r);n=this.restoreExifTagsToImageData(n);n=this.restoreJfifSegmentToImageData(n);return e.toDataURL(n)}},{key:"restoreExifTagsToImageData",value:function e(t){if(!this._exifData.isValid()){return t}var r=this._sliceIntoSegments(t);var n=r[1][0];var i=t.slice(0,n);var a=t.slice(n);var o=i.concat(this._exifData.getBuffer());o=o.concat(a);return o}},{key:"restoreJfifSegmentToImageData",value:function e(t){if(!this._jfifData.isValid()){return t}var r=this._sliceIntoSegments(t);var n=this._findSegment(v.JFIF,r);p(n,"JFIF Data Error: Segment not found");var i=n[0];var a=n[1];var o=t.slice(0,i);var s=t.slice(i,a);var u=t.slice(a);var f=new l["a"](s);f.setDensityX(this._jfifData.getDensityX());f.setDensityY(this._jfifData.getDensityY());f.setUnitDensity(this._jfifData.getUnitDensity());var c=o.concat(s);c=c.concat(u);return c}},{key:"restoreExifTags",value:function t(r){var n=e.fromDataURL(r);var i=this.restoreExifTagsToImageData(n);return e.toDataURL(i)}},{key:"restoreJfifSegment",value:function t(r){if(!this._jfifData.isValid()){return r}var n=e.fromDataURL(r);var i=this.restoreJfifSegmentToImageData(n);return e.toDataURL(i)}},{key:"setOrientation",value:function e(t){return this._exifData.setOrientation(t)}},{key:"_findSegment",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this._segments;for(var n=0;n<r.length;n++){var i=r[n][0];var a=r[n][1];this._stream.setHead(i);var o=this._stream.peekInt16();if(o===t){return[i,a]}}return false}},{key:"_getMarkerBuffer",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this._segments;var n=this._findSegment(t,r);if(n){var i=n[0];var a=n[1];return this._buf.slice(i,a)}return false}},{key:"_sliceIntoSegments",value:function e(t){var r=new o["a"](t);var n=[];while(r.getHead()<t.length){var i=r.readInt16();if(i===v.SOI){continue}if(i===v.SOS){break}if(i>=65280&&i<=65535){var a=r.readInt16();var s=r.getHead()+a-2;n.push([r.getHead()-4,s]);r.setHead(s)}else{throw new Error("Invalid marker: 0x"+i.toString(16))}}this._stream.setHead(0);return n}},{key:"getTags",value:function e(){return this._exifData.getTags()}},{key:"getTagData",value:function e(){return this._exifData.getTagData()}},{key:"dispose",value:function e(){this._buf=[];this._segments=[]}}],[{key:"toDataURL",value:function e(t){return d+a["a"].encode(t)}},{key:"fromDataURL",value:function e(t){var r=t.replace(d,"");var n=a["a"].decode(r);return n}},{key:"isJPEG",value:function e(t){return y.test(t)}},{key:"bufferIsJPEG",value:function e(t){return t.slice(6,10).toString()==="JFIF"}},{key:"fromBase64String",value:function t(r){var n=r.replace(d,"");var i=a["a"].decode(n);return new e(i)}}]);return e}();t["a"]=_},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function o(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var s=function(){function e(t){o(this,e);this._head=0;this._buf=t}a(e,[{key:"peekInt8",value:function e(){return this._buf[this._head]}},{key:"peekInt16",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var r=this._buf[this._head];var n=this._buf[this._head+1];if(!t){return(r<<8)+n}else{return(n<<8)+r}}},{key:"peekInt24",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var r=this._buf[this._head];var n=this._buf[this._head+1];var i=this._buf[this._head+2];if(!t){return(r<<16)+(n<<8)+i}else{return(i<<16)+(n<<8)+r}}},{key:"peekInt32",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var r=this._buf[this._head];var n=this._buf[this._head+1];var i=this._buf[this._head+2];var a=this._buf[this._head+3];if(!t){return(r<<32)+(n<<16)+(i<<8)+a}else{return(a<<32)+(i<<16)+(n<<8)+r}}},{key:"writeInt8",value:function e(t){this._buf[this._head]=t&255}},{key:"writeInt16",value:function e(t){this._buf[this._head]=t>>8;this._buf[this._head+1]=t&255}},{key:"readInt8",value:function e(){var t=this.peekInt8();this._head+=1;return t}},{key:"readInt16",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var r=this.peekInt16(t);this._head+=2;return r}},{key:"readInt24",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var r=this.peekInt24(t);this._head+=3;return r}},{key:"readInt32",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var r=this.peekInt32(t);this._head+=4;return r}},{key:"readString",value:function e(t){var r="";for(var n=0;n<t;n++){var i=this.readInt8();r+=String.fromCharCode(i)}return r}},{key:"getHead",value:function e(){return this._head}},{key:"setHead",value:function e(t){this._head=t}}]);return e}();t["a"]=s},function(e,t,r){"use strict";var n={SOI:65496,SOS:65498,APP0:65504,APP1:65505,JFIF:65504,EXIF:65505};var i={256:"ImageWidth",257:"ImageHeight",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer",40965:"InteroperabilityIFDPointer",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",274:"Orientation",277:"SamplesPerPixel",284:"PlanarConfiguration",530:"YCbCrSubSampling",531:"YCbCrPositioning",282:"XResolution",283:"YResolution",296:"ResolutionUnit",273:"StripOffsets",278:"RowsPerStrip",279:"StripByteCounts",513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",301:"TransferFunction",318:"WhitePoint",319:"PrimaryChromaticities",529:"YCbCrCoefficients",532:"ReferenceBlackWhite",306:"DateTime",270:"ImageDescription",271:"Make",272:"Model",305:"Software",315:"Artist",33432:"Copyright"};t["a"]={MARKERS:n,EXIF_TAGS:i}},function(e,t,r){"use strict";r.d(t,"a",function(){return g});var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(4);var h=r.n(c);var p=r(17);var v=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function d(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function y(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function _(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var g=function(e){_(t,e);function t(){d(this,t);return y(this,(t.__proto__||f()(t)).apply(this,arguments))}v(t,[{key:"insetsForWidth",value:function e(t){return this.getRelativeInsets().clone().scale(t)}}],[{key:"Small",get:function e(){return new t({imagePath:"text-design/images/imgly_text_design_asset_banderole_small.png",fontIdentifier:"imgly_font_campton_bold",relativeInsets:new p["a"](.05,.2,.05,.2)})}},{key:"Rectangle",get:function e(){return new t({imagePath:"text-design/images/imgly_text_design_asset_black_background.png",fontIdentifier:"imgly_font_campton_bold",relativeInsets:new p["a"](.05,.05,.05,.05),needsImageSmoothingFix:true})}},{key:"Celebrate1",get:function e(){return new t({imagePath:"text-design/images/imgly_text_design_asset_celebrate_01.png",fontIdentifier:"imgly_font_rasa_500",relativeInsets:new p["a"](.05,.2,.05,.2)})}},{key:"Celebrate2",get:function e(){return new t({imagePath:"text-design/images/imgly_text_design_asset_celebrate_02.png",fontIdentifier:"imgly_font_rasa_500",relativeInsets:new p["a"](.05,.2,.05,.2)})}}]);return t}(c["Configurable"]);g.prototype.availableOptions={image:{type:c["OptionType"].IMAGE,default:null},imagePath:{type:c["OptionType"].STRING,default:null},relativeInsets:{type:c["OptionType"].OBJECT,default:new p["a"]},fontIdentifier:{type:c["OptionType"].STRING,default:"imgly_font_open_sans_bold"},needsImageSmoothingFix:{type:c["OptionType"].BOOLEAN,default:false}}},function(e,t,r){"use strict";r.d(t,"a",function(){return E});var n=r(6);var i=r.n(n);var a=r(0);var o=r.n(a);var s=r(5);var u=r.n(s);var l=r(2);var f=r.n(l);var c=r(3);var h=r.n(c);var p=r(1);var v=r.n(p);var d=r(4);var y=r.n(d);var _=r(17);var g=r(19);var m=r(34);var b=i.a||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}}return e};var w=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;o()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var x=function e(t,r,n){if(t===null)t=Function.prototype;var i=u()(t,r);if(i===undefined){var a=v()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var o=i.get;if(o===undefined){return undefined}return o.call(n)}};function T(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function k(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function R(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=h()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)f.a?f()(e,t):e.__proto__=t}var E=function(e){R(t,e);function t(){T(this,t);return k(this,(t.__proto__||v()(t)).apply(this,arguments))}w(t,[{key:"_getTextColor",value:function e(){if(this.getAutoAdjustTextColor()&&!this.getIsMasked()){if(this.getBackgroundColor().equals(d["Color"].WHITE)){return d["Color"].BLACK}else{return d["Color"].WHITE}}return this.getAttributes().getTextColor().clone()}},{key:"_getTextFrame",value:function e(){return this.getImageInsets().applyToRectangle(this._getFrame())}},{key:"_getTextFrameForElement",value:function e(r){var n=x(t.prototype.__proto__||v()(t.prototype),"_getTextFrameForElement",this).call(this,r);var i=this.getImageInsets();if(this.getIsMasked()||this.getIsUsedInInvertedLayout()){n.y-=i.top}return n}},{key:"willRender",value:function e(t){var r=this.getAttributes();r.setTextColor(this._getTextColor());var n=this.getImage();if(n){var i=this.getCapInsets();var a=this._getFrame();if(i&&!i.equals(_["a"].ZERO)){Object(m["b"])(t,n,a,i)}else{t.drawImage(n,a.x,a.y,a.width,a.height)}Object(m["c"])(t,a,this.getBackgroundColor(),"source-atop")}if((this.getIsMasked()||this.getIsUsedInInvertedLayout())&&n){t.save();t.globalCompositeOperation="destination-out"}}},{key:"didRender",value:function e(r){x(t.prototype.__proto__||v()(t.prototype),"didRender",this).call(this,r);if(this.getIsMasked()||this.getIsUsedInInvertedLayout()){r.restore()}}}]);return t}(g["a"]);E.prototype.availableOptions=b({},g["a"].prototype.availableOptions,{image:{type:d["OptionType"].IMAGE,default:null},capInsets:{type:d["OptionType"].OBJECT,default:new _["a"]},backgroundColor:{type:d["OptionType"].COLOR,default:d["Color"].WHITE},autoAdjustTextColor:{type:d["OptionType"].BOOLEAN,default:true},isMasked:{type:d["OptionType"].BOOLEAN,default:true},isUsedInInvertedLayout:{type:d["OptionType"].BOOLEAN,default:false}})},function(e,t,r){"use strict";r.d(t,"a",function(){return S});var n=r(6);var i=r.n(n);var a=r(0);var o=r.n(a);var s=r(5);var u=r.n(s);var l=r(2);var f=r.n(l);var c=r(3);var h=r.n(c);var p=r(1);var v=r.n(p);var d=r(4);var y=r.n(d);var _=r(19);var g=r(60);var m=r(43);var b=r(23);var w=r(34);var x=i.a||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}}return e};var T=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;o()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var k=function e(t,r,n){if(t===null)t=Function.prototype;var i=u()(t,r);if(i===undefined){var a=v()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var o=i.get;if(o===undefined){return undefined}return o.call(n)}};function R(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function E(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function C(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=h()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)f.a?f()(e,t):e.__proto__=t}var O=d["Math"].Rectangle;var S=function(e){C(t,e);function t(){R(this,t);return E(this,(t.__proto__||v()(t)).apply(this,arguments))}T(t,[{key:"getImageSize",value:function e(){var t=this.getLeftImage();var r=this.getRightImage();var n=this.getWords();var i=this.getAttributes();var a=i.getFontIdentifier();var o=t?new b["a"](t.width,t.height):new b["a"];var s=n.joined(1)[0];if(!s){return o}var u=new g["a"]({text:s,fontIdentifier:a,fontSize:50});var l=u.getSizeValue();var f=r?2:1;o.scale(f,1);var c=o.clone().fitInWidthWithOther(this._getFrame().width,l);c.scale(1/f,1);return c}},{key:"_getTextFrame",value:function e(){var r=k(t.prototype.__proto__||v()(t.prototype),"_getTextFrame",this).call(this).clone();var n=this.getImageSize();var i=this.getRightImage();var a=this.getImagePosition();if(!i){if(a===t.ImagePosition.Left){r.x+=n.width}}else{r.x+=n.width;r.width-=2*n.width}return r}},{key:"_calculateLayoutElements",value:function e(){var r=k(t.prototype.__proto__||v()(t.prototype),"_calculateLayoutElements",this).call(this);var n=this._getFrame();var i=this.getRightImage();var a=this.getImageSize();var o=this.getImagePosition();var s=this._getTextFrame();var u=this.getAttributes();var l=u.getFontIdentifier();var f=new g["a"]({text:"stickerClock",fontIdentifier:l});f.fitWidth(this._getTextFrame().width);var c=(new O).set(n.x,n.y,a.width,a.height);if(!i&&o===t.ImagePosition.Right){c.x+=s.width}r.push(new m["a"]({text:"stickerClock",frame:c,font:f}));if(i){var h=r[0];if(h){var p=c.clone();p.translate(h.getFrame().width+p.width,0);r.push(new m["a"]({text:"stickerClock",frame:p,font:f}))}}return r}},{key:"render",value:function e(t){var r=this._getLayoutElements();var n=this.getAttributes();var i=n.getTextColor();var a=this.getLeftImage();var o=this.getRightImage();var s=r[0];var u=r[1];var l=s.serializeOptions(),f=l.font;var c=this._getTextFrameForElement(s);f.draw(t,c.x,c.y,{textColor:n.getTextColor().toRGBA(),alignment:n.getAlignment()});if(a){var h=u.getFrame();t.drawImage(a,h.x,h.y,h.width,h.height);Object(w["c"])(t,h,i,"source-atop")}if(r.length>2){var p=r[2];var v=p.getFrame().clone();t.drawImage(o,v.x,v.y,v.width,v.height);Object(w["c"])(t,v,i,"source-atop")}}}]);return t}(_["a"]);S.ImagePosition={Left:"LEFT",right:"RIGHT"};S.prototype.availableOptions=x({},_["a"].prototype.availableOptions,{leftImage:{type:d["OptionType"].IMAGE,default:null},rightImage:{type:d["OptionType"].IMAGE,default:null},imagePosition:{type:d["OptionType"].STRING,default:S.ImagePosition.Left,available:[S.ImagePosition.Left,S.ImagePosition.Right]}})},function(e,t,r){"use strict";r.d(t,"a",function(){return R});var n=r(6);var i=r.n(n);var a=r(0);var o=r.n(a);var s=r(2);var u=r.n(s);var l=r(3);var f=r.n(l);var c=r(1);var h=r.n(c);var p=r(4);var v=r.n(p);var d=r(104);var y=r(43);var _=r(60);var g=r(150);var m=r(365);var b=i.a||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}}return e};var w=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;o()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function x(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function T(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function k(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)u.a?u()(e,t):e.__proto__=t}var R=function(e){k(t,e);function t(){x(this,t);return T(this,(t.__proto__||h()(t)).apply(this,arguments))}w(t,[{key:"_calculateLayoutElements",value:function e(){var t=this.getWords();var r=this._getTextFrame();var n=this.getAttributes();var i=n.getFontIdentifier();var a=this.getImageInsets();var o=new _["a"]({text:t.getWord(0),fontIdentifier:i});o.fitWidth(r.width);var s=new y["a"]({text:t.getWord(0),frame:r,font:o});s.setFrame(this._getTextFrameForElement(s));var u=this.getSize();if(this.getSizeToFitContent()||u.height<=1){u.height=a.top+s.getFrame().height+a.bottom}u.height=Math.max(u.height,this.getMinimumHeight());return[s]}},{key:"_getTextFrameForElement",value:function e(t){var r=this.getWords();var n=r.getWord(0);var i=this.getAttributes();var a=i.getFontIdentifier();var o=this.getImageInsets();var s=this.getImageInsets().applyToRectangle(this._getFrame()).scale(this.getTextScaleFactor());var u=new m["a"]({text:n,fontIdentifier:a,alignment:i.getAlignment(),lineHeight:1});u.fitInFrame(s);var l=u.getSize();s.height=l.height;var f=l.height*this.getRowScaleFactor();if(this.getSizeToFitContent()){f+=o.top+o.bottom}var c=this._getFrame();var h=i.getAlignment();if(this.getCenteredVertically()){s.y=c.height/2-f/2+o.top}else{switch(h){case"left":s.y=c.height-f-o.bottom;break;case"center":s.y=c.height/2-f/2+f*this.getCenterOffset();s.x=(c.width-s.width)/2;break;case"right":s.x=c.width-s.width-o.right;break;default:break}}return s}},{key:"render",value:function e(t){var r=this;t.save();this._getLayoutElements().forEach(function(e){var n=e.serializeOptions(),i=n.text,a=n.frame;var o=r.getAttributes();var s=o.getFontIdentifier();var u=new m["a"]({text:i,fontIdentifier:s,alignment:o.getAlignment(),lineHeight:1,textColor:o.getTextColor().toRGBA()});a=r._getTextFrameForElement(e);u.fitInFrame(a);u.draw(t,a.x,a.y)});t.restore()}}]);return t}(d["a"]);R.prototype.availableOptions=b({},d["a"].prototype.availableOptions,{centerOffset:{type:p["OptionType"].NUMBER,default:0},sizeToFitContent:{type:p["OptionType"].BOOLEAN,default:false},textScaleFactor:{type:p["OptionType"].NUMBER,default:.95},rowScaleFactor:{type:p["OptionType"].NUMBER,default:1},minimumHeight:{type:p["OptionType"].NUMBER,default:0},centeredVertically:{type:p["OptionType"].BOOLEAN,default:false}})},function(e,t,r){"use strict";r.d(t,"a",function(){return E});var n=r(6);var i=r.n(n);var a=r(0);var o=r.n(a);var s=r(5);var u=r.n(s);var l=r(2);var f=r.n(l);var c=r(3);var h=r.n(c);var p=r(1);var v=r.n(p);var d=r(4);var y=r.n(d);var _=r(61);var g=r(44);var m=r(16);var b=i.a||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}}return e};var w=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;o()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var x=function e(t,r,n){if(t===null)t=Function.prototype;var i=u()(t,r);if(i===undefined){var a=v()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var o=i.get;if(o===undefined){return undefined}return o.call(n)}};function T(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function k(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function R(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=h()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)f.a?f()(e,t):e.__proto__=t}var E=function(e){R(t,e);function t(){var e;T(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=k(this,(e=t.__proto__||v()(t)).call.apply(e,[this].concat(n)));a._possibleRowTypes=[_["a"].SpeechBubble1,_["a"].SpeechBubble3];a._rowTypesRandomizer=new m["a"](0);a._isMaskedRandomizer=new m["a"](0);a._seedPool.push(a._rowTypesRandomizer);a._seedPool.push(a._isMaskedRandomizer);return a}w(t,[{key:"getImagePaths",value:function e(){return this._possibleRowTypes.map(function(e){return e.getImagePath()})}},{key:"_rowTypes",value:function e(t){return this._possibleRowTypes}},{key:"_randomLayoutRow",value:function e(r,n,i,a){this._rowType=this._rowTypesRandomizer.pickNext(this._rowTypes(r));a.setLineSpacing(.9);var o=x(t.prototype.__proto__||v()(t.prototype),"_randomLayoutRow",this).call(this,r,n,i,a);o.set({textScaleFactor:1,minimumHeight:i*this._rowType.getMinimumHeightRatio(),sizeToFitContent:this._rowType.getSizeToFitContent(),centeredVertically:true});return o}}]);return t}(g["a"]);E.defaultFontIdentifiers=["imgly_font_panton_black_caps","imgly_font_panton_light_caps","imgly_font_panton_black_italic_caps","imgly_font_panton_light_italic_caps"];E.identifier="imgly_text_design_masked_speech_bubble";E.prototype.availableOptions=b({},g["a"].prototype.availableOptions,{fontIdentifiers:{type:d["OptionType"].ARRAY,default:E.defaultFontIdentifiers},squareLayout:{type:d["OptionType"].BOOLEAN,default:false},alignment:{type:d["OptionType"].STRING,default:"left",available:g["a"].ValidAlignments}})},function(e,t,r){"use strict";r.d(t,"a",function(){return R});var n=r(6);var i=r.n(n);var a=r(0);var o=r.n(a);var s=r(2);var u=r.n(s);var l=r(3);var f=r.n(l);var c=r(1);var h=r.n(c);var p=r(4);var v=r.n(p);var d=r(155);var y=r(20);var _=r(34);var g=r(372);var m=i.a||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}}return e};var b=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;o()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function w(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function x(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function T(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)u.a?u()(e,t):e.__proto__=t}var k=p["Math"].Rectangle;var R=function(e){T(t,e);function t(){var e;w(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=x(this,(e=t.__proto__||h()(t)).call.apply(e,[this].concat(n)));a._MAX_TRIES=1e3;a._PRECISION=1e3;return a}b(t,[{key:"render",value:function e(t,r,n,i,a){var o=this._options,s=o.imagePaths,u=o.relativeParticleSize;if(s.length<=0){return}var l=r.width/r.height;var f=new k(Math.round(n.left*this._PRECISION),Math.round(n.top*this._PRECISION*l),this._PRECISION,this._PRECISION);f.width-=f.x+Math.round(n.right*this._PRECISION);f.height-=f.y+Math.round(n.bottom*this._PRECISION*l);var c=[];var h=0;var p=0;while(h<this.getParticleCount()&&p<this._MAX_TRIES){var v=u/2;var d=Math.round(v*this._PRECISION);var m=Math.round(v*this._PRECISION*l);var b=Math.floor(this._PRECISION)-d;var w=Math.floor(this._PRECISION)-m;var x=a.nextInRange(d,b);var T=a.nextInRange(m,w);var R=new k(x-d,T-m,2*d,2*m);if(!R.intersects(f)&&!this.hasCollision(c,R)){c.push(new g["a"]({frame:R}));h+=1}p+=1}for(var E=0;E<c.length;E++){var C=c[E];var O=a.pickNext(s);var S=y["a"].getImage(O);var F=a.nextInRange(140,230)/255;var I=r.width/this._PRECISION;var A=r.height/this._PRECISION;var M=C.getContentFrame();M.x*=I;M.y*=A;M.width*=I;M.height*=A;var D=i.clone();D.a=F;Object(_["a"])(t,S,M,D,"source-atop")}}},{key:"hasCollision",value:function e(t,r){for(var n=0;n<t.length;n++){if(r.intersects(t[n].getFrame())){return true}}return false}}]);return t}(d["a"]);R.prototype.availableOptions=m({},d["a"].prototype.availableOptions,{particleCount:{type:p["OptionType"].NUMBER,default:50},relativeParticleSize:{type:p["OptionType"].NUMBER,default:.08},imagePaths:{type:p["OptionType"].ARRAY,default:[]}})},function(e,t,r){"use strict";var n=r(62);var i=r(13);var a=r(111);var o=r(26);var s=r(27);var u=r(38);var l=r(162);var f=r(65);var c=r(115);var h=r(11)("iterator");var p=!([].keys&&"next"in[].keys());var v="@@iterator";var d="keys";var y="values";var _=function(){return this};e.exports=function(e,t,r,g,m,b,w){l(r,t,g);var x=function(e){if(!p&&e in E)return E[e];switch(e){case d:return function t(){return new r(this,e)};case y:return function t(){return new r(this,e)}}return function t(){return new r(this,e)}};var T=t+" Iterator";var k=m==y;var R=false;var E=e.prototype;var C=E[h]||E[v]||m&&E[m];var O=!p&&C||x(m);var S=m?!k?O:x("entries"):undefined;var F=t=="Array"?E.entries||C:C;var I,A,M;if(F){M=c(F.call(new e));if(M!==Object.prototype&&M.next){f(M,T,true);if(!n&&!s(M,h))o(M,h,_)}}if(k&&C&&C.name!==y){R=true;O=function e(){return C.call(this)}}if((!n||w)&&(p||R||!E[h])){o(E,h,O)}u[t]=O;u[T]=_;if(m){I={values:k?O:x(y),keys:b?O:x(d),entries:S};if(w)for(A in I){if(!(A in E))a(E,A,I[A])}else i(i.P+i.F*(p||R),t,I)}return I}},function(e,t,r){e.exports=!r(25)&&!r(37)(function(){return Object.defineProperty(r(79)("div"),"a",{get:function(){return 7}}).a!=7})},function(e,t,r){e.exports=r(26)},function(e,t,r){var n=r(27);var i=r(28);var a=r(164)(false);var o=r(83)("IE_PROTO");e.exports=function(e,t){var r=i(e);var s=0;var u=[];var l;for(l in r)if(l!=o)n(r,l)&&u.push(l);while(t.length>s)if(n(r,l=t[s++])){~a(u,l)||u.push(l)}return u}},function(e,t,r){var n=r(48);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return n(e)=="String"?e.split(""):Object(e)}},function(e,t,r){var n=r(14).document;e.exports=n&&n.documentElement},function(e,t,r){var n=r(27);var i=r(49);var a=r(83)("IE_PROTO");var o=Object.prototype;e.exports=Object.getPrototypeOf||function(e){e=i(e);if(n(e,a))return e[a];if(typeof e.constructor=="function"&&e instanceof e.constructor){return e.constructor.prototype}return e instanceof Object?o:null}},function(e,t,r){var n=r(112);var i=r(85).concat("length","prototype");t.f=Object.getOwnPropertyNames||function e(t){return n(t,i)}},function(e,t){},function(e,t,r){var n=r(18);e.exports=function(e,t,r,i){try{return i?t(n(r)[0],r[1]):t(r)}catch(t){var a=e["return"];if(a!==undefined)n(a.call(e));throw t}}},function(e,t,r){var n=r(38);var i=r(11)("iterator");var a=Array.prototype;e.exports=function(e){return e!==undefined&&(n.Array===e||a[i]===e)}},function(e,t,r){var n=r(18);var i=r(63);var a=r(11)("species");e.exports=function(e,t){var r=n(e).constructor;var o;return r===undefined||(o=n(r)[a])==undefined?t:i(o)}},function(e,t){e.exports=function(e){try{return{e:false,v:e()}}catch(e){return{e:true,v:e}}}},function(e,t,r){var n=r(18);var i=r(24);var a=r(93);e.exports=function(e,t){n(e);if(i(t)&&t.constructor===e)return t;var r=a.f(e);var o=r.resolve;o(t);return r.promise}},function(e,t,r){var n=r(11)("iterator");var i=false;try{var a=[7][n]();a["return"]=function(){i=true};Array.from(a,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!i)return false;var r=false;try{var a=[7];var o=a[n]();o.next=function(){return{done:r=true}};a[n]=function(){return o};e(a)}catch(e){}return r}},function(e,t){var r=e.exports={};var n;var i;function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function"){n=setTimeout}else{n=a}}catch(e){n=a}try{if(typeof clearTimeout==="function"){i=clearTimeout}else{i=o}}catch(e){i=o}})();function s(e){if(n===setTimeout){return setTimeout(e,0)}if((n===a||!n)&&setTimeout){n=setTimeout;return setTimeout(e,0)}try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}function u(e){if(i===clearTimeout){return clearTimeout(e)}if((i===o||!i)&&clearTimeout){i=clearTimeout;return clearTimeout(e)}try{return i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}var l=[];var f=false;var c;var h=-1;function p(){if(!f||!c){return}f=false;if(c.length){l=c.concat(l)}else{h=-1}if(l.length){v()}}function v(){if(f){return}var e=s(p);f=true;var t=l.length;while(t){c=l;l=[];while(++h<t){if(c){c[h].run()}}h=-1;t=l.length}c=null;f=false;u(e)}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1){for(var r=1;r<arguments.length;r++){t[r-1]=arguments[r]}}l.push(new d(e,t));if(l.length===1&&!f){s(v)}};function d(e,t){this.fun=e;this.array=t}d.prototype.run=function(){this.fun.apply(null,this.array)};r.title="browser";r.browser=true;r.env={};r.argv=[];r.version="";r.versions={};function y(){}r.on=y;r.addListener=y;r.once=y;r.off=y;r.removeListener=y;r.removeAllListeners=y;r.emit=y;r.prependListener=y;r.prependOnceListener=y;r.listeners=function(e){return[]};r.binding=function(e){throw new Error("process.binding is not supported")};r.cwd=function(){return"/"};r.chdir=function(e){throw new Error("process.chdir is not supported")};r.umask=function(){return 0}},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(42);var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function s(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var u=function(){function e(){s(this,e);this.reset()}o(e,[{key:"multiply",value:function e(t){var r=void 0,n=void 0,i=void 0,a=void 0,o=void 0,s=void 0;r=this.a*t.a+this.b*t.c;n=this.a*t.b+this.b*t.d;i=this.c*t.a+this.d*t.c;a=this.c*t.b+this.d*t.d;o=this.tx*t.a+this.ty*t.c+t.tx;s=this.tx*t.b+this.ty*t.d+t.ty;this.a=r;this.b=n;this.c=i;this.d=a;this.tx=o;this.ty=s;return this}},{key:"applyToVector",value:function e(t){var r=t,n=r.x,i=r.y;t=t.clone();t.x=this.a*n+this.c*i+this.tx;t.y=this.b*n+this.d*i+this.tx;return t}},{key:"applyInverseToVector",value:function e(t){var r=1/(this.a*this.d+this.c*-this.b);var n=t,i=n.x,a=n.y;t=t.clone();t.x=this.d*r*i+-this.c*r*a+(this.ty*this.c-this.tx*this.d)*r;t.y=this.a*r*a+-this.b*r*i+(-this.ty*this.a+this.tx*this.b)*r;return t}},{key:"rectangleToCoordinates",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:new a["a"](0,0);var n=t.width*(1-r.x);var i=t.width*-r.x;var o=t.height*(1-r.y);var s=t.height*-r.y;var u=[];u.push(new a["a"](this.a*i+this.c*s+this.tx,this.d*s+this.b*i+this.ty));u.push(new a["a"](this.a*n+this.c*s+this.tx,this.d*s+this.b*n+this.ty));u.push(new a["a"](this.a*n+this.c*o+this.tx,this.d*o+this.b*n+this.ty));u.push(new a["a"](this.a*i+this.c*o+this.tx,this.d*o+this.b*i+this.ty));return u}},{key:"reset",value:function e(){this.a=1;this.b=0;this.c=0;this.d=1;this.tx=0;this.ty=0}},{key:"toArray",value:function e(){var t=[this.a,this.b,0,this.c,this.d,0,this.tx,this.ty,1];if(typeof Float32Array==="undefined"){return t}return new Float32Array(t)}},{key:"toString",value:function e(){return"Matrix({ a: "+this.a+", b: "+this.b+", c: "+this.c+", d: "+this.d+", tx: "+this.tx+", ty: "+this.ty+" })"}}],[{key:"IDENTITY",get:function t(){return new e}}]);return e}();t["a"]=u},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(42);var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function s(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var u=function(){function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;s(this,e);this.x=t;this.y=r;this.width=n;this.height=i}o(e,[{key:"set",value:function e(t,r,n,i){this.x=t;this.y=r;this.width=n;this.height=i;return this}},{key:"clone",value:function t(){return new e(this.x,this.y,this.width,this.height)}},{key:"copy",value:function e(t){this.x=t.x;this.y=t.y;this.width=t.width;this.height=t.height;return this}},{key:"equals",value:function t(r,n,i,a){if(r instanceof e){return r.x===this.x&&r.y===this.y&&r.width===this.width&&r.height===this.height}else{var o=r;return o===this.x&&n===this.y&&i===this.width&&a===this.height}}},{key:"translate",value:function e(t,r){if(t instanceof a["a"]){r=t.y;t=t.x}this.x+=t;this.y+=r;return this}},{key:"scale",value:function e(t,r){if(t instanceof a["a"]){r=t.y;t=t.x}else if(r===undefined){r=t}this.width*=t;this.height*=r;return this}},{key:"round",value:function e(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.width=Math.round(this.width);this.height=Math.round(this.height);return this}},{key:"getPosition",value:function e(){return new a["a"](this.x,this.y)}},{key:"getSize",value:function e(){return new a["a"](this.width,this.height)}},{key:"insetBy",value:function e(t,r){this.x+=t;this.y+=r;this.width-=2*t;this.height-=2*r;return this}},{key:"intersects",value:function e(t){var r=new a["a"](this.x,this.y);var n=new a["a"](this.x+this.width,this.y+this.height);var i=new a["a"](t.x,t.y);var o=new a["a"](t.x+t.width,t.y+t.height);if(i.x>n.x||r.x>o.x||o.y<r.y||n.y<i.y){return false}return true}},{key:"toString",value:function e(){return"Rectangle({ x: "+this.x+", y: "+this.y+", width: "+this.width+", height: "+this.height+" })"}}],[{key:"FromDiagonalPoints",value:function t(r,n){var i=false;if(n.x-r.x<0){i=true}var a=i?n:r;var o=i?r:n;var s=o.x-a.x;var u=o.y-a.y;return new e(a.x,a.y,s,u)}}]);return e}();t["a"]=u},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(30);function o(e,t,r){if(t in e){i()(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}t["a"]={checkFramebufferStatus:function e(t,r){var n;var i=r.checkFramebufferStatus(r.FRAMEBUFFER);var s=(n={},o(n,r.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,"Incomplete attachment"),o(n,r.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT,"Missing attachment"),o(n,r.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,"Incomplete dimensions"),o(n,r.FRAMEBUFFER_UNSUPPORTED,"Framebuffer unsupported"),n);if(i!==r.FRAMEBUFFER_COMPLETE){a["a"].warn(t,"Framebuffer incomplete: "+s[i])}}}},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(9);var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function s(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var u=typeof window!=="undefined"&&window.performance&&window.performance.now?window.performance.now.bind(window.performance):r(129);var l=function(){function e(t){var r=this;s(this,e);this._context=t;this._tracking=false;var n=this;var i=function e(i){var a=t[i];if(typeof a==="function"){r[i]=function(){for(var e=arguments.length,r=Array(e),a=0;a<e;a++){r[a]=arguments[a]}var o=t[i];if(!n._tracking){return o.apply(t,r)}var s=u();var l=o.apply(t,r);var f=u()-s;var c={functionName:i,arguments:r,duration:f};n._trackedCalls.push(c);return l}}else{r._makePropertyWrapper(i)}};for(var a in t){i(a)}}o(e,[{key:"_makePropertyWrapper",value:function e(t){var r=["_context","_trackedCalls","_tracking"];if(r.indexOf(t)!==-1)return;var n=this._context;this.__defineGetter__(t,function(){return n[t]});this.__defineSetter__(t,function(e){n[t]=e})}},{key:"startFrame",value:function e(){this._tracking=true;this._trackedCalls=[]}},{key:"endFrame",value:function e(){var t="Rendering";a["f"].log(t,"Frame rendering results:");a["f"].log(t,"Context calls: "+this._trackedCalls.length);var r={};this._trackedCalls.forEach(function(e){var t=e.functionName,n=e.duration;r[t]=r[t]||{totalDuration:0,calls:0};r[t].totalDuration+=n;r[t].calls++});var n=[];for(var i in r){var o=r[i];o.averageDuration=o.totalDuration/o.calls;n.push({functionName:i,data:o})}n.sort(function(e,t){return t.data.totalDuration-e.data.totalDuration});n=n.slice(0,3);n.forEach(function(e){a["f"].log(t,e.functionName+": "+e.data.calls+" calls, "+e.data.totalDuration.toFixed(2)+"ms")})}}]);return e}();t["a"]=l},function(e,t,r){(function(t){(function(){var r,n,i;if(typeof performance!=="undefined"&&performance!==null&&performance.now){e.exports=function(){return performance.now()}}else if(typeof t!=="undefined"&&t!==null&&t.hrtime){e.exports=function(){return(r()-i)/1e6};n=t.hrtime;r=function(){var e;e=n();return e[0]*1e9+e[1]};i=r()}else if(Date.now){e.exports=function(){return Date.now()-i};i=Date.now()}else{e.exports=function(){return(new Date).getTime()-i};i=(new Date).getTime()}}).call(this)}).call(t,r(124))},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(9);var h=r(212);var p=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function v(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function d(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function y(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var _=function(e){y(t,e);function t(e,r){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};v(this,t);var i=d(this,(t.__proto__||f()(t)).call(this));i._options=h["a"].defaults(n,{pixelRatio:1,transparent:false,clearColor:c["b"].BLACK,debug:false});i.setMaxListeners(0);i._width=e||800;i._height=r||600;i._dimensions=new c["k"](i._width,i._height);i._maxTextureSize=null;i._pixelRatio=i._options.pixelRatio;i._clearColor=i._options.transparent?c["b"].TRANSPARENT:i._options.clearColor||c["b"].BLACK;return i}p(t,[{key:"setCanvas",value:function e(t){var r=this._canvas;this._canvas=t;if(r!==t){this._createContext();this._onBeforeContext();this._setupContext()}this.resizeTo(new c["k"](this._width,this._height))}},{key:"getCanvas",value:function e(){return this._canvas}},{key:"_onBeforeContext",value:function e(){}},{key:"resizeTo",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;this._width=t.x*this._pixelRatio;this._height=t.y*this._pixelRatio;if(r){this._canvas.width=this._width;this._canvas.height=this._height;if(this._canvas.style){this._canvas.style.width=this._width/this._pixelRatio+"px";this._canvas.style.height=this._height/this._pixelRatio+"px"}}this._dimensions=t.clone()}},{key:"_createContext",value:function e(){c["f"].warn(this.constructor.name,"`_createContext` is abstract and not implemented in inherited class")}},{key:"_setupContext",value:function e(){c["f"].warn(this.constructor.name,"`_setupContext` is abstract and not implemented in inherited class")}},{key:"render",value:function e(t){c["f"].warn(this.constructor.name,"`render` is abstract and not implemented in inherited class")}},{key:"getMaxDimensions",value:function e(){return null}},{key:"getContext",value:function e(){return this._context}},{key:"getWidth",value:function e(){return this._dimensions.x}},{key:"getHeight",value:function e(){return this._dimensions.y}},{key:"getDimensions",value:function e(){return this._dimensions}},{key:"getPixelRatio",value:function e(){return this._pixelRatio}},{key:"setPixelRatio",value:function e(t){this._pixelRatio=t;if(this._defaultRenderTarget){this._defaultRenderTarget.setPixelRatio(t)}}},{key:"getMaxTextureSize",value:function e(){return this._maxTextureSize}},{key:"getFilterManager",value:function e(){return this._filterManager}},{key:"setFilterManager",value:function e(t){this._filterManager=t}},{key:"isOfType",value:function e(t){return this._type===t}},{key:"dispose",value:function e(){c["f"].warn(this.constructor.name,"`dispose` is abstract and not implemented in inherited class")}}],[{key:"isSupported",value:function e(){return true}}]);return t}(c["d"]);t["a"]=_},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function o(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var s=function(){function e(t){o(this,e);this._renderer=t;this._onContextChange=this._onContextChange.bind(this);this._renderer.on("context",this._onContextChange)}a(e,[{key:"_onContextChange",value:function e(){}},{key:"start",value:function e(){}},{key:"stop",value:function e(){this.flush()}},{key:"flush",value:function e(){}},{key:"dispose",value:function e(){this._renderer.off("context",this._onContextChange);this._renderer=null}}]);return e}();t["a"]=s},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function o(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var s=function(){function e(t,r,n){o(this,e);this.width=t;this.height=r;this.data=n}a(e,null,[{key:"fromNodeCanvasImage",value:function t(r){var n=new Canvas(r.width,r.height);var i=n.getContext("2d");i.drawImage(r,0,0);var a=i.getImageData(0,0,r.width,r.height);return new e(r.width,r.height,a.data)}}]);return e}();t["a"]=s},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(5);var o=r.n(a);var s=r(2);var u=r.n(s);var l=r(3);var f=r.n(l);var c=r(1);var h=r.n(c);var p=r(9);var v=r(98);var d=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var y=function e(t,r,n){if(t===null)t=Function.prototype;var i=o()(t,r);if(i===undefined){var a=h()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var s=i.get;if(s===undefined){return undefined}return s.call(n)}};function _(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function g(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function m(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)u.a?u()(e,t):e.__proto__=t}var b=function(e){m(t,e);function t(){var e;_(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=g(this,(e=t.__proto__||h()(t)).call.apply(e,[this].concat(n)));a._children=[];a._filters=[];return a}d(t,[{key:"addFilter",value:function e(t){this._filters.push(t)}},{key:"removeFilter",value:function e(t){var r=this._filters.indexOf(t);if(r!==-1){this._filters.splice(r,1);return true}return false}},{key:"setFilters",value:function e(t){this._filters=t}},{key:"addChild",value:function e(t){var r=t.getParent();if(r!==null){r.removeChild(t)}t.setParent(this);this._children.push(t)}},{key:"prependChild",value:function e(t){var r=t.getParent();if(r!==null){r.removeChild(t)}t.setParent(this);this._children.unshift(t)}},{key:"hasChild",value:function e(t){var r=this._children.indexOf(t);return r!==-1}},{key:"removeChild",value:function e(t){var r=this._children.indexOf(t);if(r!==-1){this._children.splice(r,1);t.setParent(null)}else{p["f"].info(this.constructor.name,"Tried to remove a child that does not exist")}}},{key:"clearChildren",value:function e(){this._children=[]}},{key:"renderWebGL",value:function e(t){if(!this._visible){return}var r=t.getFilterManager();if(this._filters&&this._filters.length){r.pushFilters(this,this._filters)}t.getCurrentObjectRenderer().start();this._renderWebGL(t);this._children.forEach(function(e){e.renderWebGL(t)});t.getCurrentObjectRenderer().flush();if(this._filters&&this._filters.length){r.popFilters()}t.getCurrentObjectRenderer().start()}},{key:"_renderWebGL",value:function e(t){}},{key:"renderCanvas",value:function e(t){if(!this._visible){return}var r=t.getFilterManager();if(this._filters&&this._filters.length){r.pushFilters(this,this._filters)}this._renderCanvas(t);this._children.forEach(function(e){e.renderCanvas(t)});if(this._filters&&this._filters.length){r.popFilters()}}},{key:"_renderCanvas",value:function e(t){}},{key:"updateTransform",value:function e(){y(t.prototype.__proto__||h()(t.prototype),"updateTransform",this).call(this);this._children.forEach(function(e){e.updateTransform()})}},{key:"getLocalBounds",value:function e(){if(this._localBoundsNeedUpdate){this._localBoundsNeedUpdate=false}return this._localBounds.clone()}},{key:"getBounds",value:function e(){if(this._boundsNeedUpdate){this._boundsNeedUpdate=false}return this._bounds.clone()}},{key:"getChildren",value:function e(){return this._children}},{key:"getFilters",value:function e(){return this._filters}},{key:"dispose",value:function e(){}}]);return t}(v["a"]);t["a"]=b},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(9);var h=r(53);var p=r(220);var v=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function d(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function y(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function _(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var g=function(e){_(t,e);function t(e,r){d(this,t);var n=y(this,(t.__proto__||f()(t)).call(this));if(!(e instanceof h["a"])){throw new Error("`baseTexture` should be an instance of BaseTexture")}n._uvs=new p["a"];n._frame=r?r.clone():null;n._frameLocked=!!r;n._onBaseTextureLoaded=n._onBaseTextureLoaded.bind(n);n._onBaseTextureUpdated=n._onBaseTextureUpdated.bind(n);if(!n._frame){n._frame=new c["h"](0,0,1,1)}n.setBaseTexture(e);return n}v(t,[{key:"_onBaseTextureLoaded",value:function e(){if(!this._frameLocked){var t=this._baseTexture.getFrame().clone();this.setFrame(t)}this._baseTexture.on("update",this._onBaseTextureUpdated)}},{key:"_onBaseTextureUpdated",value:function e(){var t=this._baseTexture.getFrame(),r=t.width,n=t.height;this._frame.width=r;this._frame.height=n;this.emit("update")}},{key:"_updateUVs",value:function e(){this._uvs.update(this._frame,this._baseTexture.getFrame())}},{key:"getBaseTexture",value:function e(){return this._baseTexture}},{key:"setBaseTexture",value:function e(t){this._baseTexture=t;if(!this._baseTexture.isLoaded()){this._baseTexture.once("loaded",this._onBaseTextureLoaded)}else{var r=t.getFrame(),n=r.width,i=r.height;if(!this._frameLocked){this._frame=new c["h"](0,0,n,i)}this._onBaseTextureLoaded()}}},{key:"getFrame",value:function e(){return this._frame}},{key:"setFrame",value:function e(t){this._frame=t;this._updateUVs()}},{key:"getWidth",value:function e(){return this._frame.width}},{key:"getHeight",value:function e(){return this._frame.height}},{key:"getUVs",value:function e(){return this._uvs}},{key:"getDimensions",value:function e(){return new c["k"](this._frame.width,this._frame.height)}},{key:"dispose",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;t&&this._baseTexture.dispose()}}],[{key:"fromImage",value:function e(r){var n=new h["a"](r);return new t(n)}},{key:"fromCanvas",value:function e(r){var n=new h["a"](r);return new t(n)}}]);return t}(c["d"]);t["a"]=g},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(51);var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function s(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var u=function(){function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;var a=arguments.length>4&&arguments[4]!==undefined?arguments[4]:0;var o=arguments.length>5&&arguments[5]!==undefined?arguments[5]:0;var u=arguments.length>6&&arguments[6]!==undefined?arguments[6]:1;var l=arguments.length>7&&arguments[7]!==undefined?arguments[7]:0;var f=arguments.length>8&&arguments[8]!==undefined?arguments[8]:0;var c=arguments.length>9&&arguments[9]!==undefined?arguments[9]:0;var h=arguments.length>10&&arguments[10]!==undefined?arguments[10]:0;var p=arguments.length>11&&arguments[11]!==undefined?arguments[11]:0;var v=arguments.length>12&&arguments[12]!==undefined?arguments[12]:1;var d=arguments.length>13&&arguments[13]!==undefined?arguments[13]:0;var y=arguments.length>14&&arguments[14]!==undefined?arguments[14]:0;var _=arguments.length>15&&arguments[15]!==undefined?arguments[15]:0;var g=arguments.length>16&&arguments[16]!==undefined?arguments[16]:0;var m=arguments.length>17&&arguments[17]!==undefined?arguments[17]:0;var b=arguments.length>18&&arguments[18]!==undefined?arguments[18]:1;var w=arguments.length>19&&arguments[19]!==undefined?arguments[19]:0;s(this,e);this.set(t,r,n,i,a,o,u,l,f,c,h,p,v,d,y,_,g,m,b,w)}o(e,[{key:"set",value:function e(t,r,n,i,a,o,s,u,l,f,c,h,p,v,d,y,_,g,m,b){this.a=t;this.b=r;this.c=n;this.d=i;this.e=a;this.f=o;this.g=s;this.h=u;this.i=l;this.j=f;this.k=c;this.l=h;this.m=p;this.n=v;this.o=d;this.p=y;this.q=_;this.r=g;this.s=m;this.t=b}},{key:"reset",value:function e(){this.a=1;this.b=0;this.c=0;this.d=0;this.e=0;this.f=0;this.g=1;this.h=0;this.i=0;this.j=0;this.k=0;this.l=0;this.m=1;this.n=0;this.o=0;this.p=0;this.q=0;this.r=0;this.s=1;this.t=0}},{key:"apply",value:function e(t){var r=this.a*t.r+this.b*t.g+this.c*t.b+this.d*t.a+this.e;var n=this.f*t.r+this.g*t.g+this.h*t.b+this.i*t.a+this.j;var i=this.k*t.r+this.l*t.g+this.m*t.b+this.n*t.a+this.o;var o=this.p*t.r+this.q*t.g+this.r*t.b+this.s*t.a+this.t;return new a["a"](r,n,i,o)}},{key:"multiply",value:function e(t){var r=void 0,n=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,f=void 0,c=void 0,h=void 0,p=void 0,v=void 0,d=void 0,y=void 0,_=void 0,g=void 0,m=void 0,b=void 0,w=void 0;var x=t;var T=this;r=x.a*T.a+x.b*T.f+x.c*T.k+x.d*T.p;n=x.a*T.b+x.b*T.g+x.c*T.l+x.d*T.q;i=x.a*T.c+x.b*T.h+x.c*T.m+x.d*T.r;a=x.a*T.d+x.b*T.i+x.c*T.n+x.d*T.s;s=x.f*T.a+x.g*T.f+x.h*T.k+x.i*T.p;u=x.f*T.b+x.g*T.g+x.h*T.l+x.i*T.q;l=x.f*T.c+x.g*T.h+x.h*T.m+x.i*T.r;f=x.f*T.d+x.g*T.i+x.h*T.n+x.i*T.s;h=x.k*T.a+x.l*T.f+x.m*T.k+x.n*T.p;p=x.k*T.b+x.l*T.g+x.m*T.l+x.n*T.q;v=x.k*T.c+x.l*T.h+x.m*T.m+x.n*T.r;d=x.k*T.d+x.l*T.i+x.m*T.n+x.n*T.s;_=x.p*T.a+x.q*T.f+x.r*T.k+x.s*T.p;g=x.p*T.b+x.q*T.g+x.r*T.l+x.s*T.q;m=x.p*T.c+x.q*T.h+x.r*T.m+x.s*T.r;b=x.p*T.d+x.q*T.i+x.r*T.n+x.s*T.s;o=x.a*T.e+x.b*T.j+x.c*T.o+x.d*T.t+x.e;c=x.f*T.e+x.g*T.j+x.h*T.o+x.i*T.t+x.j;y=x.k*T.e+x.l*T.j+x.m*T.o+x.n*T.t+x.o;w=x.p*T.e+x.q*T.j+x.r*T.o+x.s*T.t+x.t;this.a=r;this.b=n;this.c=i;this.d=a;this.e=o;this.f=s;this.g=u;this.h=l;this.i=f;this.j=c;this.k=h;this.l=p;this.m=v;this.n=d;this.o=y;this.p=_;this.q=g;this.r=m;this.s=b;this.t=w;return this}},{key:"clone",value:function t(){var r=new e;r.set(this.a,this.b,this.c,this.d,this.e,this.f,this.g,this.h,this.i,this.j,this.k,this.l,this.m,this.n,this.o,this.p,this.q,this.r,this.s,this.t);return r}},{key:"equals",value:function e(t){return this.a===t.a&&this.b===t.b&&this.c===t.c&&this.d===t.d&&this.e===t.e&&this.f===t.f&&this.g===t.g&&this.h===t.h&&this.i===t.i&&this.j===t.j&&this.k===t.k&&this.l===t.l&&this.m===t.m&&this.n===t.n&&this.o===t.o&&this.p===t.p&&this.q===t.q&&this.r===t.r&&this.s===t.s&&this.t===t.t}},{key:"getOffsets",value:function e(){return[this.e,this.j,this.o,this.t]}},{key:"toString",value:function e(){return"ColorMatrix( "+this.a+", "+this.b+", "+this.c+", "+this.d+", "+this.e+",\n "+this.f+", "+this.g+", "+this.h+", "+this.i+", "+this.j+",\n "+this.k+", "+this.l+", "+this.m+", "+this.n+", "+this.o+",\n "+this.p+", "+this.q+", "+this.r+", "+this.s+", "+this.t+" )"}},{key:"toArray",value:function e(){var t=this;return"abcdefghijklmnopqrst".split("").map(function(e){return t[e]})}}],[{key:"createBrightnessMatrix",value:function t(r){var n=new e;n.e=r;n.j=r;n.o=r;return n}},{key:"createContrastMatrix",value:function t(r){var n=new e;var i=(1-r)/2;n.a=n.g=n.m=r;n.e=n.j=n.o=i;return n}},{key:"createSaturationMatrix",value:function t(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;var n=new e;var i=1-r;var a=.213*i;var o=.715*i;var s=.072*i;n.a=a+r;n.b=o;n.c=s;n.f=a;n.g=o+r;n.h=s;n.k=a;n.l=o;n.m=s+r;return n}},{key:"createExposureMatrix",value:function t(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var n=Math.pow(2,r);return new e(n,0,0,0,0,0,n,0,0,0,0,0,n,0,0,0,0,0,1,0)}},{key:"createLinearMatrix",value:function t(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var i=new e;i.a=i.g=i.m=r;i.e=i.j=i.o=n;return i}},{key:"IDENTITY",get:function t(){return new e}}]);return e}();t["a"]=u},function(e,t,r){"use strict";(function(e){var n=r(0);var i=r.n(n);var a=r(32);var o=r(239);var s=r.n(o);var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function l(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var f=5e3;var c=typeof window!=="undefined"?window:e;var h=function(){function e(t){l(this,e);this._url=t;this._parsedUrl=s.a.parse(this._url,true)}u(e,[{key:"_isJSONPRequest",value:function e(){var t=this._parsedUrl.query;for(var r in t){var n=t[r];if(n==="?"){return true}}return false}},{key:"load",value:function e(){if(this._isJSONPRequest()){return this._loadJSONP()}else{return this._loadJSON()}}},{key:"_loadJSON",value:function e(){var t=this;return new a["a"](function(e,r){var n=void 0;if(c.XDomainRequest){n=new c.XDomainRequest;n.onload=function(){var t=JSON.parse(n.responseText);e(t)};n.onerror=function(e){r(e)};n.open("GET",t._url,true);n.send()}else if(c.XMLHttpRequest){n=new XMLHttpRequest;n.onreadystatechange=function(t){if(n.readyState===4){if(n.status===200){var i=JSON.parse(n.responseText);e(i)}else{r(new Error("HTTP Status "+n.status))}}};n.open("GET",t._url,true);n.send()}})}},{key:"_loadJSONP",value:function e(){var t=this;var r=false;var n=false;var i="pesdk"+Math.round(Math.random()*99999999999999);return new a["a"](function(e,a){var o=t._createJSONPNode(i);c[i]=function(i){t._removeJSONPNode(o);if(!r){n=true;e(i)}};c.setTimeout(function(){if(!n){t._removeJSONPNode(o);r=true;a(new Error("Timeout of 5 seconds exceeded."))}},f)})}},{key:"_createJSONPNode",value:function e(t){var r=this._buildJSONPUrl(t);var n=document.querySelector("head");var i=document.createElement("script");i.src=r;n.appendChild(i);return i}},{key:"_removeJSONPNode",value:function e(t){t.parentNode.removeChild(t)}},{key:"_buildJSONPUrl",value:function e(t){var r=this._parsedUrl.query;var n=null;for(var i in r){if(r[i]==="?"){n=i;break}}delete this._parsedUrl.search;r[n]=t;return s.a.format(this._parsedUrl)}}]);return e}();t["a"]=h}).call(t,r(41))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=r(42);var i=r(248);var a=r(126);var o=r(125);var s=r(135);r.d(t,"Vector2",function(){return n["a"]});r.d(t,"Vector3",function(){return i["a"]});r.d(t,"Rectangle",function(){return a["a"]});r.d(t,"Matrix",function(){return o["a"]});r.d(t,"ColorMatrix",function(){return s["a"]})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=r(249);r.d(t,"ExifOrientationOperation",function(){return n["a"]})},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(31);var h=r(32);var p=r(30);var v=r(68);var d=r(55);var y=r(140);var _=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function g(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function m(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function b(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var w=function(e){b(t,e);function t(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};g(this,t);var n=m(this,(t.__proto__||f()(t)).call(this,r,{enabled:{type:c["OptionType"].BOOLEAN,default:true,serializable:false}}));n._sdk=e;n._cacheEnabled=false;n._dirtiness={};n._sprite=new v["a"].Sprite;n._container=new v["a"].Container;n._container.addChild(n._sprite);return n}_(t,[{key:"_onOptionsChange",value:function e(){this.setDirty(true)}},{key:"render",value:function e(t){var r=this;if(!this.getEnabled()){p["a"].info(this.constructor.name,"Disabled - skipping");return h["a"].resolve(t)}if(!this._renderTexture){var n=this._sdk.getSprite().getTexture().getFrame();this._renderTexture=new v["a"].RenderTexture(this._sdk.getRenderer(),n.width,n.height)}var i=this._sdk.getRenderer();var a=void 0;var o=void 0;if(p["a"].canLog("info")){o=new y["a"](this.constructor.name,"Rendering")}if(this.isDirtyForRenderer(i)){this._sprite.setTexture(t);var s=this.getNewDimensions(t.getDimensions()).floor();this._renderTexture.resizeTo(s);this._renderTexture.clear();a=this._render(t).then(function(){r.setDirtyForRenderer(false,i);return r._renderTexture})}else{p["a"].info(this.constructor.name,"Rendering from cache");a=h["a"].resolve(this._renderTexture)}return a.then(function(e){if(o)o.stop();return e})}},{key:"_render",value:function e(t){var r=void 0;if(this._sdk.getRenderer().isOfType(c["RendererType"].WEBGL)){r=this._renderWebGL.bind(this)}else{r=this._renderCanvas.bind(this)}return r(t)}},{key:"_renderWebGL",value:function e(t){throw new Error("Operation#_renderWebGL is abstract and not implemented in inherited class.")}},{key:"_renderCanvas",value:function e(t){throw new Error("Operation#_renderCanvas is abstract and not implemented in inherited class.")}},{key:"getNewDimensions",value:function e(t){return t.clone()}},{key:"reset",value:function e(){this._dirty=true;this._glslPrograms={}}},{key:"isDirtyForRenderer",value:function e(t){var r=this._dirtiness[t.id];return typeof r==="undefined"?true:r}},{key:"setDirtyForRenderer",value:function e(t,r){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;this._dirtiness[r.id]=t}},{key:"setDirty",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;for(var n in this._dirtiness){this.setDirtyForRenderer(t,{id:n},r)}}},{key:"getSDK",value:function e(){return this._sdk}},{key:"getInputDimensions",value:function e(){var t=this;var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;var n=this._sdk.getInputDimensions();if(r){n.multiply(this._sdk.getZoom()).floor()}var i=void 0;this._sdk.getOperationsStack().forEach(function(e){if(i)return;if(e===t){i=true;return}n=e.getNewDimensions(n)});return n.floor()}},{key:"clone",value:function e(){var t=this.constructor;return new t(this._sdk,this.serializeOptions())}},{key:"disposeRenderTextures",value:function e(){if(this._renderTexture){this._renderTexture.dispose()}this._renderTexture=null}},{key:"dispose",value:function e(){this.disposeRenderTextures();this._sprite.dispose()}}]);return t}(d["a"]);w.identifier=null;t["a"]=w},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(40);var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function s(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var u=typeof window!=="undefined"&&window.performance&&window.performance.now?window.performance.now.bind(window.performance):r(129);var l=function(){function e(t,r){s(this,e);this._tag=t;this._name=r;this._start=u()}o(e,[{key:"stop",value:function e(){var t=u();var r=t-this._start;var n=Math.round(1e3/r);a["Log"].info(this._tag,this._name+" took "+r.toFixed(2)+"ms ("+n+" FPS)")}}]);return e}();t["a"]=l},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(40);var h=r(32);var p=r(52);var v=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function d(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function y(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function _(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var g=function(e){_(t,e);function t(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];d(this,t);var r=y(this,(t.__proto__||f()(t)).call(this));r._onOperationUpdate=r._onOperationUpdate.bind(r);r._cacheEnabled=true;r._stack=e;r._stack.forEach(function(e){e.on("update",r._onOperationUpdate)});return r}v(t,[{key:"clear",value:function e(){var t=this;this.forEach(function(e){return t.remove(e)});this._stack=[]}},{key:"hasChanges",value:function e(){return this._stack.filter(function(e){return!!e}).some(function(e){return e.hasChanges()})}},{key:"_onOperationUpdate",value:function e(t,r){this.emit(c["Constants"].Events.OPERATION_UPDATED,t,r)}},{key:"enableCache",value:function e(){this._cacheEnabled=true}},{key:"disableCache",value:function e(){this._cacheEnabled=false}},{key:"forEach",value:function e(t){return this._stack.filter(function(e){return!!e}).forEach(t)}},{key:"render",value:function e(t,r){var n=this;var i=r;var a=this._stack.filter(function(e){return!!e}).filter(function(e){return e.getEnabled()});a.reverse();var o=a.filter(function(e){return!e.isDirtyForRenderer(t.getRenderer())})[0];var s=a.indexOf(o);a.reverse();var u=0;if(s!==-1){u=a.length-s-1}for(var l=0;l<u;l++){c["Log"].info(this.constructor.name,"Skipping "+a[l].constructor.name)}var f=h["a"].resolve(i);var p=function e(t){var r=a[t];var i=void 0,o=void 0;f=f.then(function(e){return r.render(e).then(function(e){if(i&&e!==i&&!n._cacheEnabled){o.disposeRenderTextures()}i=e;o=r;return e})})};for(var v=u;v<a.length;v++){p(v)}return f}},{key:"validateSettings",value:function e(){return h["a"].all(this._stack.filter(function(e){return!!e}).map(function(e){return e.validateSettings()}))}},{key:"setAllToDirty",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;this.forEach(function(e){return e.setDirty(true,t)})}},{key:"updateDirtinessForRenderer",value:function e(t){var r=false;for(var n=0;n<this._stack.length;n++){var i=this._stack[n];if(!i)continue;if(i.isDirtyForRenderer(t)){r=true}if(r){i.setDirtyForRenderer(true,t)}}}},{key:"push",value:function e(t){this._stack.push(t);t.on("update",this._onOperationUpdate)}},{key:"unshift",value:function e(t){this._stack.unshift(t);t.on("update",this._onOperationUpdate)}},{key:"clone",value:function e(){return new t(this._stack.slice(0))}},{key:"get",value:function e(t){return this._stack[t]}},{key:"getByIdentifier",value:function e(t){return c["Utils"].Array.find(this._stack,function(e){return e&&e.constructor.identifier===t})}},{key:"set",value:function e(t,r){if(this._stack[t]){this._stack[t].off("update",this._onOperationUpdate);this._stack[t].dispose()}this._stack[t]=r;r.on("update",this._onOperationUpdate)}},{key:"remove",value:function e(t){var r=this._stack.indexOf(t);if(r===-1){return}if(this._stack[r]){this._stack[r].off("update",this._onOperationUpdate);this._stack[r].dispose()}this._stack.splice(r,1)}},{key:"removeAt",value:function e(t){if(this._stack[t]){this._stack[t].off("update",this._onOperationUpdate);this._stack[t].dispose()}delete this._stack[t]}},{key:"getStack",value:function e(){return this._stack}},{key:"dispose",value:function e(){this.forEach(function(e){e.dispose()})}}]);return t}(p["a"]);t["a"]=g},function(e,t){e.exports={name:"photoeditorsdk",version:"4.10.0",description:"The most comprehensive photo editor SDK for HTML5",repository:"http://github.com/imgly/pesdk-html5",author:"PhotoEditorSDK (9elements GmbH) <contact@photoeditorsdk.com>",license:"SEE LICENSE IN LICENSE.md",bin:{},scripts:{start:"npm run watch",release:"cross-env PESDK_CLEAN=true PESDK_ASSETS=true PESDK_RELEASE=true webpack --progress --colors && cross-env npm run prerender-desktop-css && rimraf build/examples/qa-* && rimraf build/examples/ci-* && rimraf build/**/dev.*","release:production":"cross-env ENV=production npm run release && rm -rf build/examples/shared","release:test":"cross-env ENV=test PESDK_CLEAN=true PESDK_ASSETS=true webpack && npm run prerender-desktop-css","release:development":"cross-env ENV=development PESDK_CLEAN=true PESDK_ASSETS=true npm run release",lint:"eslint --ext .jsx,.js src/js","lint:test":"eslint --ext .jsx,.js test","lint:sdk":"eslint --ext .jsx,.js src/js/sdk","lint:ui":"eslint --ext .jsx,.js src/js/ui","lint:ui:react-ui":"eslint --ext .jsx,.js src/js/ui/react-ui","lint:ui:desktop-ui":"eslint --ext .jsx,.js src/js/ui/desktop-ui",build:"cross-env PESDK_CLEAN=true PESDK_ASSETS=true webpack",rebuild:"cross-env PESDK_ASSETS=true webpack --progress --color",clean:"rimraf build/* doc/* dist/*",watch:"cross-env PESDK_CLEAN=true PESDK_ASSETS=true PESDK_SERVE=true webpack --watch --progress --colors","watch:test":"cross-env PESDK_CLEAN=true PESDK_ASSETS=true ENV=test webpack --watch --progress --colors","watch:production":"cross-env PESDK_CLEAN=true PESDK_ASSETS=true PESDK_SERVE=true webpack --watch --progress --colors",test:"npm run test:sdk && npm run test:ui && npm run test:ui:react-ui && npm run test:desktop-ui && npm run server","test:ui":"cross-env ENV=test node_modules/.bin/mocha --require test/sdk/support/modules --require test/sdk/support/helpers test/ui","test:sdk":"cross-env ENV=test node_modules/.bin/mocha --require test/sdk/support/modules --require test/sdk/support/helpers test/sdk","test:ui:react-ui":'cross-env ENV=test node --stack-size=65500 node_modules/.bin/mocha --require test/react-ui/support/helpers test/shared/run-server.js "test/react-ui/*.test.js" "test/react-ui/**/*.test.js"',"test:ui:desktop-ui":'cross-env ENV=test node --stack-size=65500 node_modules/.bin/mocha --require test/desktop-ui/support/helpers test/shared/run-server.js "test/desktop-ui/*.test.js" "test/desktop-ui/**/*.test.js"',"test:server":'cross-env ENV=test node --stack-size=65500 node_modules/.bin/mocha --require test/sdk/support/modules --require test/server/support/helpers test/shared/run-server.js "test/server/*.test.js" "test/server/**/*.test.js"',"test:comparison":'cross-env ENV=test node --stack-size=65500 node_modules/.bin/mocha --require test/sdk/support/modules --require test/comparison/support/helpers "test/comparison/*.test.js" "test/comparison/**/*.test.js"',"test:webgl":"cross-env RENDERER=webgl ENV=test node_modules/.bin/mocha --require test/sdk/support/modules --require test/sdk/support/helpers test/sdk",jsdoc:"rimraf doc/photoeditorsdk && jsdoc -c config/jsdoc/jsdoc.json -r","jsdoc:server":"rimraf doc/photoeditorsdk-server && jsdoc -c config/jsdoc/jsdoc.server.json -r","render-filter-previews":"node scripts/run render-filter-previews","prerender-desktop-css":"node scripts/run render-desktop-ui-css","dist:sdk":"rimraf dist/photoeditorsdk && cp -r build/photoeditorsdk/ dist/photoeditorsdk && find dist/photoeditorsdk -d 2 -name '*.min.*' | sed 'p;s/.min././' | xargs -n2 cp && npm run jsdoc","dist:server":"rimraf dist/photoeditorsdk-server && cp -r build/photoeditorsdk-server/ dist/photoeditorsdk-server && find dist/photoeditorsdk-server -d 2 -name '*.min.*' | sed 's/.min././' | xargs -n1 rm && npm run jsdoc:server",precommit:"true",prepush:"npm run lint"},devDependencies:{adonis:"git://github.com/imgly/adonis.git#v1.0.1",ajv:"^5.5.1","babel-core":"^6.26.0","babel-eslint":"^8.2.1","babel-loader":"^7.1.2","babel-minify-webpack-plugin":"^0.2.0","babel-plugin-external-helpers":"^6.22.0","babel-plugin-transform-adonis-hash":"^0.4.0","babel-plugin-transform-class-properties":"^6.19.0","babel-plugin-transform-es2015-classes":"^6.6.4","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-plugin-transform-proto-to-assign":"^6.26.0","babel-plugin-transform-runtime":"^6.6.0","babel-preset-env":"^1.6.1","babel-preset-es2015":"^6.6.0","babel-preset-minify":"^0.2.0","babel-preset-react":"^6.5.0","babel-preset-stage-3":"^6.24.1","babel-register":"^6.26.0","babel-runtime":"^6.26.0",chai:"^3.4.0","chai-as-promised":"^5.1.0",chalk:"^2.4.1",chromedriver:"^2.37.0","circular-json-es6":"^2.0.2",classnames:"^2.1.3","clean-webpack-plugin":"^0.1.16","compass-mixins":"^0.12.8","copy-webpack-plugin":"^4.3.0","cross-env":"^5.1.1","css-loader":"^0.28.7",del:"^2.0.0",djv:"^1.2.0",eslint:"^4.16.0","eslint-config-standard":"^11.0.0","eslint-plugin-import":"^2.10.0","eslint-plugin-mocha":"^5.0.0","eslint-plugin-node":"^6.0.1","eslint-plugin-promise":"^3.7.0","eslint-plugin-standard":"^3.0.1",express:"^4.16.2","extract-text-webpack-plugin":"^3.0.2",husky:"^0.14.3",inquirer:"^0.11.4","inquirer-path":"^1.0.0-beta5","isomorphic-fetch":"^2.2.1","jaguarjs-jsdoc":"git://github.com/imgly/jaguarjs-jsdoc.git#master",jsdoc:"^3.5.5","json-loader":"^0.5.7",lodash:"^4.17.4",minimist:"^1.2.0",mkdirp:"^0.5.1",mocha:"^3.5.3",nightwatch:"git://github.com/imgly/nightwatch.git#feature/file-upload-and-multiple-selectors","node-sass":"^4.7.2","node-static":"^0.7.10","optimize-css-assets-webpack-plugin":"^3.2.0","performance-now":"^0.2.0",pixelmatch:"^4.0.2",pngjs:"^3.3.2","preprocess-loader":"^0.2.2","pretty-error":"^2.0.0",prompt:"^1.0.0","prop-types":"^15.6.0","raw-loader":"^0.5.1",react:"^16.2.0","react-dom":"^16.2.0",rembrandt:"^0.1.3",rimraf:"^2.6.2","sass-loader":"^6.0.6","selenium-server-standalone-jar":"3.4.0",should:"^4.3.0",sinon:"^1.17.3","sinon-chai":"^2.14.0",standard:"^9.0.2","standard-loader":"^6.0.1","stats.js":"^0.16.0","style-loader":"^0.13.1","term-img2":"^2.0.1","transform-loader":"^0.2.2","uglifyjs-webpack-plugin":"^1.2.5","vinyl-source-stream":"0.1.1",webpack:"^3.10.0","webpack-notifier":"^1.2.1"},standard:{globals:["describe","context","before","beforeEach","after","afterEach","it","expect"],parser:"babel-eslint"},dependencies:{canvas:"git://github.com/Automattic/node-canvas.git#v2.0.0-alpha.12",gl:"^4.0.4",opn:"^5.3.0",request:"^2.83.0"}}},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(4);var h=r.n(c);var p=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function v(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function d(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function y(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var _=c["Math"].ColorMatrix;var g=1e-7;var m=function(e){y(t,e);function t(){v(this,t);var e=d(this,(t.__proto__||f()(t)).call(this));e._fragmentSource=r(263);return e}p(t,[{key:"_applyCanvas",value:function e(t,r,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var a=r.getCanvas();var o=r.getContext();var s=n.getContext();var u=o.getImageData(0,0,a.width,a.height);var l=this._options,f=l.colorMatrix,h=l.gamma,p=l.shadows,v=l.highlights;var d=h!==1;var y=p!==0||v!==0;var _=new c["Color"](0,0,0,0);for(var m=0;m<a.width*a.height;m++){var b=m*4;_.r=u.data[b]/255;_.g=u.data[b+1]/255;_.b=u.data[b+2]/255;if(d){_.r=Math.pow(_.r,1/Math.max(h,g));_.g=Math.pow(_.g,1/Math.max(h,g));_.b=Math.pow(_.b,1/Math.max(h,g))}if(y){var w=_.r*.2125+_.g*.7154+_.b*.0721;var x=p>=0?c["Utils"].clamp(Math.pow(w,1/(p+1))+Math.pow(w,2/(p+1))*-.76-w,0,Math.max(p,1)):-c["Utils"].clamp(Math.pow(w,1/(-p+1))+Math.pow(w,2/(-p+1))*-.76-w,0,Math.max(-p,1));var T=v<0?c["Utils"].clamp(1-Math.pow(1-w,1/(1-v))-Math.pow(1-w,2/(1-v))*-.8-w,-1,0):-c["Utils"].clamp(1-Math.pow(1-w,1/(1+v))-Math.pow(1-w,2/(1+v))*-.8-w,-1,0);var k=x*w*w;var R=x-k;var E=w+k+T;_.r=c["Utils"].clamp(E*((_.r+R)/Math.max(w,g)),0,1);_.g=c["Utils"].clamp(E*((_.g+R)/Math.max(w,g)),0,1);_.b=c["Utils"].clamp(E*((_.b+R)/Math.max(w,g)),0,1)}_=f.apply(_);u.data[b]=_.r*255;u.data[b+1]=_.g*255;u.data[b+2]=_.b*255}s.putImageData(u,0,0)}}]);return t}(c["Engine"].Filter);m.prototype.availableOptions={gamma:{type:c["OptionType"].NUMBER,default:1,uniformType:c["UniformType"].FLOAT},shadows:{type:c["OptionType"].NUMBER,default:0,uniformType:c["UniformType"].FLOAT},highlights:{type:c["OptionType"].NUMBER,default:1,uniformType:c["UniformType"].FLOAT},colorMatrix:{type:c["OptionType"].COLOR_MATRIX,default:new _,uniformType:c["UniformType"].MAT4},colorOffset:{type:c["OptionType"].ARRAY,default:[],uniformType:c["UniformType"].FLOAT4}};t["a"]=m},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(5);var o=r.n(a);var s=r(2);var u=r.n(s);var l=r(3);var f=r.n(l);var c=r(1);var h=r.n(c);var p=r(4);var v=r.n(p);var d=r(75);var y=r.n(d);var _=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var g=function e(t,r,n){if(t===null)t=Function.prototype;var i=o()(t,r);if(i===undefined){var a=h()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var s=i.get;if(s===undefined){return undefined}return s.call(n)}};function m(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function b(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function w(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)u.a?u()(e,t):e.__proto__=t}var x=p["Math"].Vector2;var T=function(e){w(t,e);function t(){var e;m(this,t);for(var n=arguments.length,i=Array(n),a=0;a<n;a++){i[a]=arguments[a]}var o=b(this,(e=t.__proto__||h()(t)).call.apply(e,[this].concat(i)));o._fragmentSource=r(267);o._lastBlurRadius=null;o._lastDimensions=new x(0,0);o._blurredRenderTarget=new p["Engine"].CanvasRenderTarget(100,100,1);return o}_(t,[{key:"_applyCanvas",value:function e(t,r,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var a=r.getDimensions();var o=!this._lastDimensions.equals(a);this._blurredRenderTarget.setPixelRatio(r.getPixelRatio());this._blurredRenderTarget.resizeTo(r.getDimensions());n.setPixelRatio(r.getPixelRatio());n.resizeTo(r.getDimensions());if(this._lastBlurRadius!==this._options.blurRadius||o){this._blurImage(r);this._lastBlurRadius=this._options.blurRadius}var s=n.getContext();s.drawImage(this._blurredRenderTarget.getCanvas(),0,0);this._lastDimensions.copy(a)}},{key:"_blurImage",value:function e(t){var r=t.getCanvas();var n=t.getContext();var i=new x(r.width,r.height);var a=n.getImageData(0,0,r.width,r.height);y.a.stackBlurCanvasRGBA(a,0,0,r.width,r.height,this._options.blurRadius*i.min());var o=this._blurredRenderTarget.getContext();o.putImageData(a,0,0)}},{key:"dispose",value:function e(){g(t.prototype.__proto__||h()(t.prototype),"dispose",this).call(this);this._blurredRenderTarget.dispose()}}]);return t}(p["Engine"].Filter);T.prototype.availableOptions={blurRadius:{type:p["OptionType"].NUMBER,default:30,uniformType:p["UniformType"].FLOAT},delta:{type:p["OptionType"].VECTOR2,default:new x(1,1),uniformType:p["UniformType"].FLOAT2},texSize:{type:p["OptionType"].VECTOR2,default:new x(100,100),uniformType:p["UniformType"].FLOAT2}};t["a"]=T},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(4);var h=r.n(c);var p=r(7);var v=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function d(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function y(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function _(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var g=function(e){_(t,e);function t(){d(this,t);return y(this,(t.__proto__||f()(t)).apply(this,arguments))}v(t,[{key:"render",value:function e(t,r,n){return c["Promise"].resolve(n)}},{key:"hasChanges",value:function e(){return false}}]);return t}(p["a"]);g.isIdentity=true;g.identifier="identity";t["a"]=g},function(e,t,r){"use strict";var n=r(5);var i=r.n(n);var a=r(0);var o=r.n(a);var s=r(2);var u=r.n(s);var l=r(3);var f=r.n(l);var c=r(1);var h=r.n(c);var p=r(4);var v=r.n(p);var d=r(12);var y=function e(t,r,n){if(t===null)t=Function.prototype;var a=i()(t,r);if(a===undefined){var o=h()(t);if(o===null){return undefined}else{return e(o,r,n)}}else if("value"in a){return a.value}else{var s=a.get;if(s===undefined){return undefined}return s.call(n)}};var _=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;o()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function g(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function m(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function b(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)u.a?u()(e,t):e.__proto__=t}var w=function(e){b(t,e);function t(){var e;g(this,t);for(var n=arguments.length,i=Array(n),a=0;a<n;a++){i[a]=arguments[a]}var o=m(this,(e=t.__proto__||h()(t)).call.apply(e,[this].concat(i)));o._fragmentSource=r(287);return o}_(t,[{key:"_applyCanvas",value:function e(t,r,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var a=r.getCanvas();var o=r.getContext();var s=n.getContext();var u=o.getImageData(0,0,a.width,a.height);var l=this._options.lookupTableData;for(var f=0;f<a.width*a.height;f++){var c=f*4;var h=u.data[c];u.data[c]=l[h*4];var p=u.data[c+1];u.data[c+1]=l[1+p*4];var v=u.data[c+2];u.data[c+2]=l[2+v*4]}s.putImageData(u,0,0)}}]);return t}(p["Engine"].Filter);w.prototype.availableOptions={lookupTable:{type:p["OptionType"].NUMBER,default:1,uniformType:p["UniformType"].INT},lookupTableData:{type:p["OptionType"].ARRAY,default:[]}};var x=function(e){b(t,e);function t(){var e;g(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=m(this,(e=t.__proto__||h()(t)).call.apply(e,[this].concat(n)));a._filter=new w({lookupTable:a._options.textureGLUnit});a._textures={};a._renderers={};return a}_(t,[{key:"update",value:function e(t){var r=t.getRenderer();if(r.isOfType(p["RendererType"].WEBGL)){this._updateWebGLTexture(t)}else if(r.isOfType(p["RendererType"].CANVAS)){this._filter.setLookupTableData(this._options.data)}}},{key:"_updateWebGLTexture",value:function e(t){if(typeof this._options.data==="undefined"){throw new Error("LookupTable: No data specified.")}var r=new Uint8Array(this._options.data);var n=t.getRenderer();var i=n.id;this._renderers[i]=n;if(!this._textures[i]){this._textures[i]=new p["Engine"].BaseTexture}var a=this._textures[i];var o=new p["Engine"].PixelArrayImage(256,1,r);a.setSource(o);a.setGLUnit(this._options.textureGLUnit);if(n.isOfType(p["RendererType"].WEBGL)){n.updateTexture(a)}}},{key:"dispose",value:function e(){y(t.prototype.__proto__||h()(t.prototype),"dispose",this).call(this);for(var r in this._textures){this._textures[r].dispose();delete this._textures[r]}delete this._options.data}}]);return t}(d["a"]);t["a"]=x},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(5);var o=r.n(a);var s=r(2);var u=r.n(s);var l=r(3);var f=r.n(l);var c=r(1);var h=r.n(c);var p=r(4);var v=r.n(p);var d=r(344);var y=r(56);var _=r(148);var g=r(346);var m=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var b=function e(t,r,n){if(t===null)t=Function.prototype;var i=o()(t,r);if(i===undefined){var a=h()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var s=i.get;if(s===undefined){return undefined}return s.call(n)}};function w(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function x(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function T(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)u.a?u()(e,t):e.__proto__=t}var k=p["Math"].Vector2;var R=function(e){T(t,e);function t(){var e;w(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=x(this,(e=t.__proto__||h()(t)).call.apply(e,[this].concat(n)));a._persistedPaths=[];a._outputCanvasDirty=true;a._outputCanvas=p["Utils"].createCanvas();a._outputContext=a._outputCanvas.getContext("2d");a._persistCanvas=p["Utils"].createCanvas();a._persistContext=a._persistCanvas.getContext("2d");a._nextCanvas=p["Utils"].createCanvas();a._texture=p["Engine"].Texture.fromCanvas(a._outputCanvas);a._sprite.setTexture(a._texture);a._onPathUpdate=a._onPathUpdate.bind(a);return a}m(t,[{key:"applyFlip",value:function e(t){this._options.paths.forEach(function(e){e.forEachControlPoint(function(e){var r=e.getPosition().clone();switch(t){case"horizontal":r.x=1-r.x;break;case"vertical":r.y=1-r.y;break}e.setPosition(r)});e.setDirty(true)});this._reset()}},{key:"applyRotation",value:function e(t){this._options.paths.forEach(function(e){e.forEachControlPoint(function(e){var r=e.getPosition().clone();if(t===90){r.flip();r.x=1-r.x}else if(t===-90){r.flip();r.y=1-r.y}e.setPosition(r)});e.setDirty(true)});this._reset()}},{key:"applyTransform",value:function e(t){var r=null;this._options.paths.forEach(function(e){e.forEachControlPoint(function(e){e.setPosition(t.applyToRelativePoint(e.getPosition()))});var n=e.getBrush();if(n!==r){n.setSize(t.applyToRelativeSize(n.getSize()));r=n}e.setDirty(true)});this._reset()}},{key:"clearCanvas",value:function e(){if(!this._outputCanvas){return}this._outputCanvasDirty=true;var t=this._outputCanvas,r=t.width,n=t.height;this._outputContext.clearRect(0,0,r,n)}},{key:"clearPersistCanvas",value:function e(){if(!this._persistCanvas){return}var t=this._persistCanvas,r=t.width,n=t.height;this._persistContext.clearRect(0,0,r,n)}},{key:"serializeOptions",value:function e(r){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var i=b(t.prototype.__proto__||h()(t.prototype),"serializeOptions",this).call(this,r,n);if(!r)i.type="brush";return i}},{key:"serializeOption",value:function e(r){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(r==="paths"){return this._options.paths.map(function(e){return e.serializeOptions(undefined,n)})}return b(t.prototype.__proto__||h()(t.prototype),"serializeOption",this).call(this,r,n)}},{key:"createPath",value:function e(t){var r=new d["a"](this._operation,{brush:t},this._nextCanvas);r.on("update",this._onPathUpdate);this._options.paths.push(r);this.setDirty(true);return r}},{key:"_onPathUpdate",value:function e(){this._operation.setDirty(true);this.setDirty(true)}},{key:"_onPathPersist",value:function e(t){t.renderToCanvas(this._persistCanvas);this._nextCanvas=t.getCanvas();var r=this._nextCanvas.getContext("2d");r.clearRect(0,0,this._nextCanvas.width,this._nextCanvas.height);this._persistedPaths.push(t)}},{key:"_getTexture",value:function e(){return this._texture}},{key:"setDirtyForRenderer",value:function e(r,n){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;b(t.prototype.__proto__||h()(t.prototype),"setDirtyForRenderer",this).call(this,r,n,i);if(r&&i){this._persistedPaths=[];this._options.paths.forEach(function(e){e.setDirty(true)})}}},{key:"setDirty",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;for(var n in this._dirtiness){this.setDirtyForRenderer(t,this._renderers[n],r)}}},{key:"render",value:function e(t){var r=this;var n=this._operation.getSDK().getRenderer();if(!this.isDirtyForRenderer(n)){return}p["Utils"].ensureCanvasDimensions(this._outputCanvas,t);p["Utils"].ensureCanvasDimensions(this._persistCanvas,t);this._options.paths.forEach(function(e){e.render(t);if(e.getClosed()&&r._persistedPaths.indexOf(e)===-1){r._onPathPersist(e)}});this.clearCanvas();this._outputContext.drawImage(this._persistCanvas,0,0);this._options.paths.forEach(function(e){if(!e.getClosed()){e.renderToCanvas(r._outputCanvas)}});this.setDirtyForRenderer(false,n)}},{key:"update",value:function e(r,n){if(n){p["Utils"].ensureCanvasDimensions(this._outputCanvas,n);p["Utils"].ensureCanvasDimensions(this._persistCanvas,n);this._texture.getBaseTexture().update()}this.render(n);var i=r.getRenderer();if(i.isOfType(p["RendererType"].WEBGL)){i.updateTexture(this._texture.getBaseTexture())}b(t.prototype.__proto__||h()(t.prototype),"update",this).call(this,r,n)}},{key:"_reset",value:function e(){this._persistedPaths=[];if(this._operation){this._operation.setDirty(true)}this.setDirty(true);this.clearCanvas();this.clearPersistCanvas()}},{key:"getCanvas",value:function e(){return this._outputCanvas}},{key:"dispose",value:function e(){b(t.prototype.__proto__||h()(t.prototype),"dispose",this).call(this);this._texture&&this._texture.getBaseTexture().dispose()}}]);return t}(y["a"]);R.prototype.availableOptions={id:{type:p["OptionType"].STRING,default:function e(){return p["Utils"].getUUID()}},position:{type:p["OptionType"].VECTOR2,default:new k(0,0)},scale:{type:p["OptionType"].VECTOR2,default:new k(1,1)},anchor:{type:p["OptionType"].VECTOR2,default:new k(0,0)},pivot:{type:p["OptionType"].VECTOR2,default:new k(0,0)},rotation:{type:p["OptionType"].NUMBER,default:0},paths:{type:p["OptionType"].ARRAY,default:[],setter:function e(t){var r=this;t=t.map(function(e){if(e instanceof d["a"])return e;var t=e.brush,n=e.closed;var i=new d["a"](r._operation,{brush:t,closed:n},r._nextCanvas);e.controlPoints.forEach(function(e){i.addControlPoint(e)});return i});this._reset();return t}}};R.type="brush";R.Brush=_["a"];R.Path=d["a"];R.Brushes={RadialBrush:g["a"]};t["a"]=R},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(4);var h=r.n(c);var p=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function v(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function d(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function y(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var _=c["Math"].Vector2;var g=function(e){y(t,e);function t(){var e;v(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=d(this,(e=t.__proto__||f()(t)).call.apply(e,[this].concat(n)));a._lastOptions={};a._lastInputDimensions=new _(0,0);a._brush=null;return a}p(t,[{key:"getBrushImage",value:function e(t){if(this._brush&&this.optionsEqual(this._lastOptions)&&t.equals(this._lastInputDimensions)){return this._brush}var r=this._options,n=r.image,i=r.size;n.width=n.height=Math.ceil(i*t.min());var a=c["Utils"].createCanvas();a.width=n.width;a.height=n.height;var o=a.getContext("2d");o.drawImage(n,0,0,a.width,a.height);var s=this._tintImageData(o.getImageData(0,0,a.width,a.height),a.width,a.height);o.putImageData(s,0,0);this._lastOptions=this.serializeOptions(["size","color"]);this._brush=a;this._lastInputDimensions=t.clone();return a}},{key:"_tintImageData",value:function e(t){var r=this._options.color;for(var n=0;n<t.data.length;n+=4){t.data[n]+=(r.r*255-t.data[n])*r.a;t.data[n+1]+=(r.g*255-t.data[n+1])*r.a;t.data[n+2]+=(r.b*255-t.data[n+2])*r.a}return t}},{key:"clone",value:function e(){var t=this.constructor;return new t(this._options)}}]);return t}(c["Configurable"]);t["a"]=g;g.prototype.availableOptions={identifier:{type:c["OptionType"].STRING},image:{type:c["OptionType"].IMAGE},size:{type:c["OptionType"].NUMBER,default:.05},color:{type:c["OptionType"].COLOR,default:c["Color"].RED}}},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(4);var h=r.n(c);var p=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function v(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function d(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function y(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var _=function(e){y(t,e);function t(){v(this,t);var e=d(this,(t.__proto__||f()(t)).call(this));e._fragmentSource=r(347);return e}p(t,[{key:"_applyCanvas",value:function e(t,r,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var a=r.getCanvas();var o=r.getContext();var s=n.getContext();var u=this._options,l=u.maskCanvas,f=u.filterCanvas;var c=l.getContext("2d");var h=f.getContext("2d");var p=c.getImageData(0,0,a.width,a.height).data;var v=o.getImageData(0,0,a.width,a.height);var d=v.data;var y=h.getImageData(0,0,a.width,a.height).data;var _=void 0;for(var g=0;g<a.width*a.height*4;g+=4){_=p[g]/255;d[g]=_*y[g]+(1-_)*d[g];d[g+1]=_*y[g+1]+(1-_)*d[g+1];d[g+2]=_*y[g+2]+(1-_)*d[g+2]}s.putImageData(v,0,0)}}]);return t}(c["Engine"].Filter);_.prototype.availableOptions={maskImage:{type:c["OptionType"].NUMBER,default:1,uniformType:c["UniformType"].INT},maskCanvas:{type:c["OptionType"].OBJECT,default:null},filterImage:{type:c["OptionType"].NUMBER,default:2,uniformType:c["UniformType"].INT},filterCanvas:{type:c["OptionType"].OBJECT,default:null}};t["a"]=_},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(4);var o=r.n(a);var s=r(151);var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function l(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var f=a["Math"].Vector2;var c=function(){function e(t,r){l(this,e);this._text=t;this._operation=r;this._textOptions={};this.rotation=0;this._createCanvas();this._createTexture()}u(e,[{key:"_createCanvas",value:function e(){this._canvas=a["Utils"].createCanvas();this._context=this._canvas.getContext("2d");this._textSplitter=new s["a"](this._context);this._finalCanvas=a["Utils"].createCanvas();this._finalContext=this._finalCanvas.getContext("2d")}},{key:"_createTexture",value:function e(){this._texture=a["Engine"].Texture.fromCanvas(this._canvas);this._finalTexture=a["Engine"].Texture.fromCanvas(this._finalCanvas)}},{key:"_applyTextOptions",value:function e(t,r){r.font=this._text.getFontStyle()+" "+this._text.getFontWeight()+" "+t.fontSize+"px "+'"'+this._text.getFontFamily()+'"';r.textBaseline="top";r.textAlign=this._text.getAlignment();r.fillStyle=this._text.getColor().toRGBA();r.strokeStyle=this._text.getOutlineColor().toRGBA();var n=this._text.getOutlineWidth();if(n>0){r.lineWidth=n}}},{key:"_buildOutputLines",value:function e(t){this._textSplitter.setText(this._text.getText());this._textSplitter.setMaxWidth(t);return this._textSplitter.getLines()}},{key:"_renderTextLine",value:function e(t,r){var n=this._text.getAlignment();var i=new f(0,r);switch(n){case"center":i.x=this._canvas.width/2;break;case"right":i.x=this._canvas.width;break}this._context.fillText(t,i.x,i.y);var a=this._text.getOutlineWidth();if(a>0){this._context.miterLimit=2;this._context.strokeText(t,i.x,i.y)}}},{key:"update",value:function e(t,r){var n=this.calculateFontStyles(t,r);if(n){var i=this._calculateText(t,n,r),a=i.dimensions,o=i.lines;this._renderText(t,a,o,n,r);this._updateFinalTexture()}}},{key:"_updateFinalTexture",value:function e(){var t=this._canvas,r=t.width,n=t.height;var i=this.rotation;var a=Math.cos(i);var o=Math.sin(i);var s=new f(Math.abs(r*a)+Math.abs(n*o),Math.abs(r*o)+Math.abs(n*a));this._finalCanvas.width=s.x;this._finalCanvas.height=s.y;this._finalContext.save();this._finalContext.translate(this._finalCanvas.width/2,this._finalCanvas.height/2);this._finalContext.rotate(i);this._finalContext.drawImage(this._canvas,-r/2,-n/2);this._finalContext.restore()}},{key:"_renderText",value:function e(t,r,n,i,a){this._canvas.width=r.x;this._canvas.height=r.y;if(this._text.getMaxHeight()){this._canvas.height=Math.min(this._text.getMaxHeight()*a.y,this._canvas.height)}this._context=this._canvas.getContext("2d");this._context.fillStyle=this._text.getBackgroundColor().toRGBA();this._context.fillRect(0,0,r.x,r.y);this._applyTextOptions(i,this._context);for(var o=0;o<n.length;o++){var s=n[o];this._renderTextLine(s,i.topPadding+i.lineHeight*o)}}},{key:"calculateFontStyles",value:function e(t,r){var n=this._text.getFontFamily();var i=this._text.getFontSize()*r.y;var a=this._text.getAbsoluteTextHeight(r);var o=a*this._text.getLineHeight();var s=a*(this._text.getLineHeight()-1)/2;var u={fontFamily:n,fontSize:i,lineHeight:o,topPadding:s};if(this._textOptions.fontFamily!==n||this._textOptions.fontSize!==i||this._textOptions.lineHeight!==o){this._textOptions=u}return u}},{key:"_calculateText",value:function e(t,r,n){var i=this._text.getMaxWidth()*n.x;this._applyTextOptions(r,this._context);var a=new f;var o=this._text.getText().split("\n");if(typeof i!=="undefined"){a.x=i;o=this._buildOutputLines(i)}else{for(var s=0;s<o.length;s++){var u=o[s];a.x=Math.max(a.x,this._context.measureText(u).width)}}var l=r.lineHeight;a.y=o.length*l;return{dimensions:a,lines:o}}},{key:"getTexture",value:function e(){return this._texture}},{key:"getFinalTexture",value:function e(){return this._finalTexture}},{key:"getDimensions",value:function e(t,r){var n=this.calculateFontStyles(t,r);var i=this._calculateText(t,n,r),a=i.dimensions;return a}},{key:"dispose",value:function e(){if(this._measurementElement){document.body.removeChild(this._measurementElement)}if(this._texture){this._texture.getBaseTexture().dispose();this._texture=null}if(this._finalTexture){this._finalTexture.getBaseTexture().dispose();this._finalTexture=null}}}]);return e}();t["a"]=c},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function o(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var s=function(){function e(t){o(this,e);this._context=t;this._lastFontStyle={}}a(e,[{key:"getLines",value:function e(){var t=this;var r=[];var n=[];var i=this._lines.length;for(var a=0;a<i;a++){var o=this._lines[a];var s=this._buildWords(o);var u=s.length;for(var l=0;l<u;l++){var f=s[l];var c=n.concat(f).join("").replace(/\s+$/i,"");var h=this._getWidth(c);if(h>this._maxWidth){if(n.length>0){r.push(n.join(""));n=[f]}var p=f.replace(/\s+$/i,"");if(this._getWidth(p)>this._maxWidth){var v=this._splitWord(f);r=r.concat(v.lines);if(v.rest){n=[v.rest]}}}else{n.push(f)}}r.push(n.join(""));n=[]}return r.map(function(e){return t._trimLine(e,t._context.textAlign)})}},{key:"_trimLine",value:function e(t,r){return t}},{key:"_buildWords",value:function e(t){var r=[];var n="";var i=t.length;for(var a=0;a<i;a++){var o=t[a];n+=o;if(o===" "||o==="-"||a===i-1){r.push(n);n=""}}return r}},{key:"_splitWord",value:function e(t){var r={lines:[],rest:null};var n=t.length;var i=[];for(var a=0;a<n;a++){var o=t[a];if(this._getWidth(i.concat(o).join(""))>this._maxWidth){if(i.length>0){r.lines.push(i.join(""))}i=[o]}else{i.push(o)}if(a===n-1&&i.length>0){r.rest=i.join("")}}return r}},{key:"_fontStyleChanged",value:function e(){if(this._context.font!==this._lastFontStyle){this._lastFontStyle=this._context.font;return true}return false}},{key:"_getWidth",value:function e(t){return this._context.measureText(t).width}},{key:"setText",value:function e(t){this._text=t;this._lines=t.split("\n")}},{key:"setMaxWidth",value:function e(t){this._maxWidth=t}}]);return e}();t["a"]=s},function(e,t,r){"use strict";r.d(t,"a",function(){return O});var n=r(6);var i=r.n(n);var a=r(0);var o=r.n(a);var s=r(5);var u=r.n(s);var l=r(2);var f=r.n(l);var c=r(3);var h=r.n(c);var p=r(1);var v=r.n(p);var d=r(4);var y=r.n(d);var _=r(57);var g=r(19);var m=r(103);var b=r(33);var w=r(105);var x=i.a||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}}return e};var T=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;o()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var k=function e(t,r,n){if(t===null)t=Function.prototype;var i=u()(t,r);if(i===undefined){var a=v()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var o=i.get;if(o===undefined){return undefined}return o.call(n)}};function R(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function E(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function C(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=h()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)f.a?f()(e,t):e.__proto__=t}var O=function(e){C(t,e);function t(){R(this,t);return E(this,(t.__proto__||v()(t)).apply(this,arguments))}T(t,[{key:"_fontForRow",value:function e(t,r){var n=this.getFontIdentifiers();return n[t%n.length]}},{key:"_minimumNumberOfLines",value:function e(r){return Math.max(Math.floor(k(t.prototype.__proto__||v()(t.prototype),"_minimumNumberOfLines",this).call(this,r)*.7),1)}},{key:"_maximumNumberOfLines",value:function e(t){return Math.max(Math.floor(t.countNumberOfCharacters()/5),1)}},{key:"_randomLayoutRow",value:function e(r,n,i,a){return this._createSingleRow(t.RowType.Single,r,i,a)}},{key:"_createSingleRow",value:function e(r,n,i,a){var o=a.getFontIdentifier();var s=o==="imgly_font_amberlight"||o==="imgly_font_handycheera_regular"?(new b["a"]).set(n.getLowerCase()):n;switch(r){case t.RowType.Single:return new g["a"]({words:s,width:i,attributes:a});case t.RowType.SingleImage:return new w["a"]({words:s,width:i,attributes:a});default:d["Log"].warn("TextDesignCelebrate#_createSingleRow: Invalid row type '"+r+"'");return null}}}]);return t}(_["a"]);O.defaultFontIdentifiers=["imgly_font_handycheera_regular","imgly_font_rasa_regular"];O.defaultBanderoles=[m["a"].Celebrate1,m["a"].Celebrate2];O.identifier="imgly_text_design_celebrate";O.RowType={Single:"SINGLE",SingleImage:"SINGLE_IMAGE"};O.prototype.availableOptions=x({},_["a"].prototype.availableOptions,{relativeLineSpacing:{type:d["OptionType"].NUMBER,default:.01875},fontIdentifiers:{type:d["OptionType"].ARRAY,default:O.defaultFontIdentifiers},banderoles:{type:d["OptionType"].ARRAY,default:O.defaultBanderoles}})},function(e,t,r){"use strict";r.d(t,"a",function(){return C});var n=r(6);var i=r.n(n);var a=r(0);var o=r.n(a);var s=r(2);var u=r.n(s);var l=r(3);var f=r.n(l);var c=r(1);var h=r.n(c);var p=r(4);var v=r.n(p);var d=r(59);var y=r(33);var _=r(76);var g=r(43);var m=r(60);var b=r(34);var w=r(23);var x=i.a||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}}return e};var T=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;o()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function k(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function R(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function E(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)u.a?u()(e,t):e.__proto__=t}var C=function(e){E(t,e);function t(){var e;k(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=R(this,(e=t.__proto__||h()(t)).call.apply(e,[this].concat(n)));a.setSize(new w["a"](a.getWidth(),a.getHeight()));return a}T(t,[{key:"_getImageFrame",value:function e(){var t=this._getTextFrame().clone();var r=this.getImage();if(this.getDrawingModeAspectFit()&&r){var n=Math.min(t.width/r.width,t.height/r.height);var i=r.width*n;var a=r.height*n;t.x+=(t.width-i)/2;t.y+=(t.height-a)/2;t.width=i;t.height=a}return t}},{key:"_calculateLayoutElements",value:function e(){return[new g["a"]({text:"",frame:this._getImageFrame(),font:new m["a"]})]}},{key:"render",value:function e(t){var r=this.getImage();var n=this._getImageFrame();var i=this.getAttributes();var a=i.getTextColor();Object(b["a"])(t,r,n,a)}}]);return t}(d["a"]);C.RowImages={decorative1:"text-design/images/imgly_text_design_asset_decorative_01.png",decorative2:"text-design/images/imgly_text_design_asset_decorative_02.png",decorative3:"text-design/images/imgly_text_design_asset_decorative_05.png",decorative4:"text-design/images/imgly_text_design_asset_decorative_06.png",celebrate1:"text-design/images/imgly_text_design_asset_celebrate_03.png",celebrate2:"text-design/images/imgly_text_design_asset_celebrate_04.png",celebrate3:"text-design/images/imgly_text_design_asset_celebrate_05.png"};C.prototype.availableOptions=x({},d["a"].prototype.availableOptions,{words:{type:p["OptionType"].OBJECT,default:new y["a"]},height:{type:p["OptionType"].NUMBER,default:0},image:{type:p["OptionType"].IMAGE,default:null},imagePath:{type:p["OptionType"].STRING,default:C.RowImages.decorative1},drawingModeAspectFit:{type:p["OptionType"].BOOLEAN,default:false},attributes:{type:p["OptionType"].CONFIGURABLE,default:new _["a"]}})},function(e,t,r){"use strict";r.d(t,"a",function(){return S});var n=r(6);var i=r.n(n);var a=r(0);var o=r.n(a);var s=r(5);var u=r.n(s);var l=r(2);var f=r.n(l);var c=r(3);var h=r.n(c);var p=r(1);var v=r.n(p);var d=r(4);var y=r.n(d);var _=r(58);var g=r(19);var m=r(17);var b=r(363);var w=r(33);var x=r(16);var T=i.a||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}}return e};var k=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;o()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var R=function e(t,r,n){if(t===null)t=Function.prototype;var i=u()(t,r);if(i===undefined){var a=v()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var o=i.get;if(o===undefined){return undefined}return o.call(n)}};function E(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function C(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function O(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=h()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)f.a?f()(e,t):e.__proto__=t}var S=function(e){O(t,e);function t(){var e;E(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=C(this,(e=t.__proto__||v()(t)).call.apply(e,[this].concat(n)));a._relativeInsets=new m["a"](.1,.1,.1,.1);a._alreadyContainsARowWithScriptFont=false;a._backgroundsRandomizer=new x["a"](0);a._seedPool.push(a._backgroundsRandomizer);return a}k(t,[{key:"getImagePaths",value:function e(){return d["Utils"].Array.flatten(b["a"].Backgrounds.map(function(e){return e.getImagePaths()}))}},{key:"_getBackground",value:function e(){return this._backgroundsRandomizer.pickNext(b["a"].Backgrounds)}},{key:"generateLayoutData",value:function e(r,n){this._alreadyContainsARowWithScriptFont=false;this._background=this._getBackground();return R(t.prototype.__proto__||v()(t.prototype),"generateLayoutData",this).call(this,r,n)}},{key:"_modifiedText",value:function e(r){return R(t.prototype.__proto__||v()(t.prototype),"_modifiedText",this).call(this,r).toUpperCase()}},{key:"_fontForRow",value:function e(r,n){var i=R(t.prototype.__proto__||v()(t.prototype),"_fontForRow",this).call(this,r,n);if(i==="imgly_font_petit_formal_script"){if(this._alreadyContainsARowWithScriptFont){i="imgly_font_bungee_inline"}this._alreadyContainsARowWithScriptFont=true}return i}},{key:"_randomLayoutRow",value:function e(t,r,n,i){var a=i.getFontIdentifier()==="imgly_font_petit_formal_script";return new g["a"]({words:a?(new w["a"]).set(t.getLowerCase()):t,width:n,attributes:i})}}]);return t}(_["a"]);S.identifier="imgly_text_design_equal_width";S.defaultFontIdentifiers=["imgly_font_ultra","imgly_font_bungee_inline","imgly_font_petit_formal_script"];S.prototype.availableOptions=T({},_["a"].prototype.availableOptions,{fontIdentifiers:{type:d["OptionType"].ARRAY,default:S.defaultFontIdentifiers},relativeLineSpacing:{type:d["OptionType"].NUMBER,default:.025}})},function(e,t,r){"use strict";r.d(t,"a",function(){return _});var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(4);var h=r.n(c);var p=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function v(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function d(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function y(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var _=function(e){y(t,e);function t(){v(this,t);return d(this,(t.__proto__||f()(t)).apply(this,arguments))}p(t,[{key:"render",value:function e(t,r,n,i,a){c["Log"].warn("TextDesignBackground#render: Abstract class")}}]);return t}(c["Configurable"]);_.prototype.availableOptions={}},function(e,t,r){"use strict";r.d(t,"a",function(){return N});var n=r(6);var i=r.n(n);var a=r(70);var o=r.n(a);var s=r(71);var u=r.n(s);var l=r(15);var f=r.n(l);var c=r(0);var h=r.n(c);var p=r(5);var v=r.n(p);var d=r(2);var y=r.n(d);var _=r(3);var g=r.n(_);var m=r(1);var b=r.n(m);var w=r(4);var x=r.n(w);var T=r(58);var k=r(19);var R=r(20);var E=r(17);var C=r(33);var O=r(153);var S=r(105);var F=r(16);var I=i.a||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}}return e};var A=function(){function e(e,t){var r=[];var n=true;var i=false;var a=undefined;try{for(var o=u()(e),s;!(n=(s=o.next()).done);n=true){r.push(s.value);if(t&&r.length===t)break}}catch(e){i=true;a=e}finally{try{if(!n&&o["return"])o["return"]()}finally{if(i)throw a}}return r}return function(t,r){if(Array.isArray(t)){return t}else if(o()(Object(t))){return e(t,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();var M=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;h()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var D=function e(t,r,n){if(t===null)t=Function.prototype;var i=v()(t,r);if(i===undefined){var a=b()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var o=i.get;if(o===undefined){return undefined}return o.call(n)}};function L(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++){r[t]=e[t]}return r}else{return f()(e)}}function B(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function P(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function U(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=g()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)y.a?y()(e,t):e.__proto__=t}var N=function(e){U(t,e);function t(){var e;B(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=P(this,(e=t.__proto__||b()(t)).call.apply(e,[this].concat(n)));a._relativeInsets=new E["a"](0,.3,0,.3);a._INVALID_FONTS_IF_LESS_THEN_5_CHARS=["imgly_font_montserrat_light"];a._INVALID_FONTS_IF_LESS_THEN_4_CHARS=["imgly_font_montserrat_light","imgly_font_hello_sunshine","imgly_font_hello_sunshine_italic"];a._lineCount=0;a._decorativeRowCreated=false;a._useImageRowRandomizer=new F["a"](0);a._rowTypeRandomizer=new F["a"](0);a._lineDecorativeTypeRandomizer=new F["a"](0);a._seedPool.push(a._useImageRowRandomizer);a._seedPool.push(a._rowTypeRandomizer);a._seedPool.push(a._lineDecorativeTypeRandomizer);return a}M(t,[{key:"getImagePaths",value:function e(){return[].concat(L(t.DecoratorImages),L(t.RowImages))}},{key:"_fontForRow",value:function e(t,r){var n=this;var i=r.countNumberOfCharacters();var a=this.getFontIdentifiers();if(i<4){a=a.filter(function(e){return n._INVALID_FONTS_IF_LESS_THEN_4_CHARS.indexOf(e)<0})}else if(i<5){a=a.filter(function(e){return n._INVALID_FONTS_IF_LESS_THEN_5_CHARS.indexOf(e)<0})}return a[t%a.length]}},{key:"_modifiedText",value:function e(r){return D(t.prototype.__proto__||b()(t.prototype),"_modifiedText",this).call(this,r).toUpperCase()}},{key:"_modifiedLines",value:function e(t){this._lineCount=t.length;return t}},{key:"generateLayoutData",value:function e(r,n){this._decorativeRowCreated=false;return D(t.prototype.__proto__||b()(t.prototype),"generateLayoutData",this).call(this,r,n)}},{key:"_randomLayoutRow",value:function e(t,r,n,i){var a=i.getFontIdentifier();var o=t;switch(a){case"imgly_font_hello_sunshine":o=(new C["a"]).set(t.getLowerCase());break;case"imgly_font_hello_sunshine_italic":o=(new C["a"]).set(t.getLowerCase());break;case"imgly_font_hello_sunshine_marker":o=(new C["a"]).set(t.getUpperCase());break;default:break}var s=this.getDecorativeRowsInTheMiddleOnly()&&(r===0||r===this._lineCount-1);if(this._useImageRowRandomizer.nextBool()||this._decorativeRowCreated||s){return new k["a"]({words:o,width:n,attributes:i})}else{this._decorativeRowCreated=true;var u=this._randomDecoratorImages(),l=A(u,2),f=l[0],c=l[1];return new S["a"]({words:t,width:n,attributes:i,leftImage:f,rightImage:c})}}},{key:"_layoutRows",value:function e(r,n){var i=D(t.prototype.__proto__||b()(t.prototype),"_layoutRows",this).call(this,r,n);if(!this.getDecorationsVisible()){return i}var a=25;var o=new O["a"]({width:n,height:a,image:R["a"].getImage(this._rowTypeRandomizer.pickNext(t.RowImages))}).layout();var s=new O["a"]({width:n,height:a,image:R["a"].getImage(this._rowTypeRandomizer.pickNext(t.RowImages))}).layout();return[o].concat(L(i),[s])}},{key:"_randomDecoratorImages",value:function e(){if(this._lineDecorativeTypeRandomizer.nextInRange(0,1)){return t.DecoratorImages.slice(0,2).map(function(e){return R["a"].getImage(e)})}else{return t.DecoratorImages.slice(2).map(function(e){return R["a"].getImage(e)})}}}]);return t}(T["a"]);N.defaultFontIdentifiers=["imgly_font_hello_sunshine_marker","imgly_font_hello_sunshine","imgly_font_hello_sunshine_italic","imgly_font_montserrat_light"];N.identifier="imgly_text_design_sunshine";N.RowImages=[O["a"].RowImages.decorative1,O["a"].RowImages.decorative2,O["a"].RowImages.decorative3,O["a"].RowImages.decorative4];N.DecoratorImages=["text-design/images/imgly_text_design_asset_decorative_03.png","text-design/images/imgly_text_design_asset_decorative_04.png","text-design/images/imgly_text_design_asset_decorative_07.png","text-design/images/imgly_text_design_asset_decorative_08.png"];N.prototype.availableOptions=I({},T["a"].prototype.availableOptions,{fontIdentifiers:{type:w["OptionType"].ARRAY,default:N.defaultFontIdentifiers},relativeLineSpacing:{type:w["OptionType"].NUMBER,default:.025/3*4},decorationsVisible:{type:w["OptionType"].BOOLEAN,default:true},decorativeRowsInTheMiddleOnly:{type:w["OptionType"].BOOLEAN,default:false}})},function(e,t,r){e.exports=r(4);r(261)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=r(159);var i=r(137);var a=r(138);var o=r(68);var s=r(51);var u=r(139);var l=r(52);var f=r(22);var c=r(258);var h=r(141);var p=r(100);var v=r(74);var d=r(32);var y=r(55);var _=r(30);var g=r(259);var m=r(31);var b=r(50);n["a"].version=r(142).version;n["a"].Math=i;n["a"].Operations=a;n["a"].Engine=o["a"];n["a"].Color=s["a"];n["a"].Operation=u["a"];n["a"].EventEmitter=l["a"];n["a"].Utils=f["a"];n["a"].Env=c["a"];n["a"].OperationsStack=h["a"];n["a"].EXIF=p["a"];n["a"].Image=v["a"];n["a"].Promise=d["a"];n["a"].Configurable=y["a"];n["a"].Log=_["a"];n["a"].Loaders=g;n["a"].RenderType=m["RenderType"];n["a"].ImageFormat=m["ImageFormat"];n["a"].OptionType=m["OptionType"];n["a"].RendererType=m["RendererType"];n["a"].UniformType=m["UniformType"];n["a"].Base64=b["a"];n["a"].UI={};t["default"]=n["a"]},function(e,t,r){"use strict";var n=r(35);var i=r.n(n);var a=r(39);var o=r.n(a);var s=r(0);var u=r.n(s);var l=r(2);var f=r.n(l);var c=r(3);var h=r.n(c);var p=r(29);var v=r.n(p);var d=r(1);var y=r.n(d);var _=r(40);var g=r(138);var m=r(141);var b=r(250);var w=r(100);var x=r(74);var T=r(253);var k=r(140);var R=typeof o.a==="function"&&typeof i.a==="symbol"?function(e){return typeof e}:function(e){return e&&typeof o.a==="function"&&e.constructor===o.a&&e!==o.a.prototype?"symbol":typeof e};var E=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;u()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function C(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function O(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function S(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=h()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)f.a?f()(e,t):e.__proto__=t}var F=function e(t){return D.byteArrayToString(U.decode(t))};var I=_["Rectangle"],A=_["Constants"],M=_["Engine"],D=_["Utils"],L=_["EventEmitter"],B=_["Vector2"],P=_["Log"],U=_["Base64"],N=_["Color"];var j=A.RenderType,z=A.ImageFormat,G=A.Events,V=A.RendererType;var W=function(e){S(t,e);function t(e){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};C(this,t);var i=O(this,(t.__proto__||y()(t)).call(this));i._onOperationUpdate=i._onOperationUpdate.bind(i);i._onContextRestored=i._onContextRestored.bind(i);var a=r(142),o=a.version;i.version=o;i[F("VG04Z1lHRndhVXRsZVdBZ2IzQjBhVzl1SUdkcGRtVnU=")]=true;i._preferredRenderer=e;i._options=D.defaults(n,{extensions:{},renderMode:"dynamic",versionCheck:true,displayWelcomeMessage:true,image:null,canvas:null,transparent:false,clearColor:N.TRANSPARENT,textureQuality:1,zoom:1,spriteScale:1,rotation:0,smoothDownscaling:false,smoothUpscaling:false,crossOrigin:"anonymous",logLevel:"warn",pixelRatio:typeof window!=="undefined"&&window.devicePixelRatio||1});if(i._options.smoothUpscaling){M.BaseTexture.DefaultMagFilter=M.BaseTexture.LinearFilter}i._options.extensions=D.defaults(i._options.extensions,{operations:[],controls:[],languages:[]});P.setLevel(i._options.logLevel);if(!i._v())return O(i);var s=_[F("TGljZW5zZUNoZWNrZXI=")];i._l=new s(i[F("X29wdGlvbnM=")][F("bGljZW5zZQ==")]);i._cv(true).then(function(){i._ct()}).catch(function(e){P.error(F("TGljZW5zaW5n"),e.message)});i._defaultRenderMode=i._options.renderMode;i._renderMode=i._options.renderMode;i._textureQuality=i._options.textureQuality;i._offset=new B;i._zoom=i._options.zoom;i._spriteScale=i._options.spriteScale;i._rotation=i._options.rotation;i._operations={};i._operationsStack=null;i.setOperationsStack(new m["a"]);i._container=new M.Container;i._sprite=new M.Sprite;i._container.addChild(i._sprite);i._inputTexture=i._options.inputTexture;i._currentInputTexture=null;i._currentTexture=null;i._resizedTexture=null;i._resizedContainer=new M.Container;i._resizedSprite=new M.Sprite;i._resizedContainer.addChild(i._resizedSprite);i.setSmoothDownscaling(i._options.smoothDownscaling);i._checkForUpdates();i._registerOperations();i._initRenderer();var u=i._renderer.constructor.type;if(i._options.displayWelcomeMessage){P.log("Version:",i.version+" ("+u+") - https://www.photoeditorsdk.com")}if(i._options.image){i.setImage(i._options.image)}return i}E(t,[{key:"_v",value:function e(){if(!this[F("X29wdGlvbnM=")][F("bGljZW5zZQ==")]){P.error(F("TGljZW5zaW5n"),F("Tm8gYGxpY2Vuc2VgIG9wdGlvbiBnaXZlbi4="));P.error(F("TGljZW5zaW5n"),F("SW4gY2FzZSB5b3UgZG9uJ3QgaGF2ZSBhIGxpY2Vuc2UgeWV0LCBwbGVhc2UgY29udGFjdCBvdXIgc2FsZXMgc3RhZmYgYXQgc2FsZXNAcGhvdG9lZGl0b3JzZGsuY29tIHRvIG9idGFpbiBhIGxpY2Vuc2Ugb3IgbG9nIGluIHRvIHlvdXIgY3VzdG9tZXIgZGFzaGJvYXJkLg=="));return false}return true}},{key:"_ct",value:function e(){if(this._l.exp()){var t=this._l.isExp();if(t){P.error(F("TGljZW5zaW5n"),F("WW91ciB0cmlhbCBsaWNlbnNlIGhhcyBleHBpcmVkLiBQbGVhc2UgY29udGFjdCB1cyBhdCBzYWxlc0BwaG90b2VkaXRvcnNkay5jb20gdG8gb2J0YWluIGEgbGljZW5zZS4="))}else{P.warn(F("TGljZW5zaW5n"),F("WW91ciB0cmlhbCBsaWNlbnNlIHdpbGwgZXhwaXJlIGluICVkIGRheXMu").replace("%d",this._l.dl()))}}}},{key:"_cv",value:function e(){var t=this;var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;return this._l.c().catch(function(e){t[F("VG04Z1lHRndhVXRsZVdBZ2IzQjBhVzl1SUdkcGRtVnU=")]=false;var n=F("SW52YWxpZCBsaWNlbnNlLg==");if(r){if(e.code==="ELICEXP"){n=F("WW91ciB0cmlhbCBsaWNlbnNlIGhhcyBleHBpcmVkLiBQbGVhc2UgY29udGFjdCB1cyBhdCBzYWxlc0BwaG90b2VkaXRvcnNkay5jb20gdG8gb2J0YWluIGEgbGljZW5zZS4=")}else if(e.code==="ELICINVHOST"){n=F("VGhpcyBsaWNlbnNlIGlzIG5vdCB2YWxpZCBmb3IgdGhlIGhvc3RuYW1lIA==")+window.location.hostname+"."}else if(e.code==="ELICINVPLAT"){n=F("VGhpcyBsaWNlbnNlIGlzIG5vdCB2YWxpZCBmb3IgdGhlIGN1cnJlbnQgcGxhdGZvcm0u")}else if(e.code==="ELICINVFMT"){n=F("SW52YWxpZCBsaWNlbnNlIGZvcm1hdC4gUGxlYXNlIG1ha2Ugc3VyZSB5b3UncmUgcGFzc2luZyB5b3VyIGxpY2Vuc2UgYXMgYSBzdHJpbmcsIG5vdCBhcyBgJGZvcm1hdGAu").replace("$format",R(t._options.license))}else if(e.code==="ELICINV"){n=F("SW52YWxpZCBsaWNlbnNlISBQbGVhc2UgY29udGFjdCBvdXIgc2FsZXMgc3RhZmYgYXQgc3VwcG9ydEBwaG90b2VkaXRvcnNkay5jb20gdG8gb2J0YWluIGEgbGljZW5zZSBvciBsb2cgaW4gdG8geW91ciBjdXN0b21lciBkYXNoYm9hcmQu")}else{n=F("SW4gY2FzZSB5b3UgZG9uJ3QgaGF2ZSBhIGxpY2Vuc2UgeWV0LCBwbGVhc2UgY29udGFjdCBvdXIgc2FsZXMgc3RhZmYgYXQgc2FsZXNAcGhvdG9lZGl0b3JzZGsuY29tIHRvIG9idGFpbiBhIGxpY2Vuc2Ugb3IgbG9nIGluIHRvIHlvdXIgY3VzdG9tZXIgZGFzaGJvYXJkLg==")}}e.message=n;throw new Error(e)})}},{key:"_t",value:function e(){this._l.t()}},{key:"_onOperationUpdate",value:function e(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++){r[n]=arguments[n]}this.emit.apply(this,[G.OPERATION_UPDATED].concat(r))}},{key:"_onContextRestored",value:function e(){P.warn(this.constructor.name,"Trying to re-render after WebGL context has been restored.");this.setAllOperationsToDirty();this._operationsStack.forEach(function(e){e.disposeRenderTextures()});this.render()}},{key:"export",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:j.DATAURL;var r=this;var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:z.PNG;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:.8;return this._cv(true).then(function(){if(r.hasChanges()){r._t()}var e=new T["a"](r,{renderType:t,imageFormat:n,quality:i});return e.export()})}},{key:"render",value:function e(){var t=this;var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;if(!this._inputTexture){throw new Error("You need to set an image before calling PhotoEditorSDK#render.")}var n=this._renderer.getContext();if(n.startFrame){n.startFrame()}var i=void 0;if(P.canLog("info")){i=new k["a"]("⚡⚡⚡","Frame rendering")}P.info("⚡⚡⚡","Rendering starts");var a=this._operationsStack;a.updateDirtinessForRenderer(this._renderer);return this._prepareTexture().then(function(e){if(t._renderMode==="export"){e=t._inputTexture}t._currentTexture=e;t._sprite.setTexture(e);t._container.updateTransform()}).then(function(){return a.validateSettings()}).then(function(){return a.render(t,t._currentTexture)}).then(function(e){t._currentTexture=e;t._sprite.setTexture(t._currentTexture);switch(t._renderMode){case"dynamic":var n=t._renderer.getDimensions().clone().divide(2).add(t._offset);t._container.setScale(t._zoom/t.getTextureScale(),t._zoom/t.getTextureScale());t._container.setPosition(n);t._sprite.setAnchor(.5,.5);t._sprite.setScale(t._spriteScale,t._spriteScale);t._sprite.setRotation(t._rotation);break;case"export":t._container.setScale(1,1);t._container.setPosition(0,0);t._sprite.setAnchor(0,0);t._sprite.setPosition(0,0);t._sprite.setScale(t._spriteScale,t._spriteScale);t._sprite.setRotation(0);break}if(r){t._renderer.render(t._container)}return e}).then(function(e){if(i){i.stop()}if(n.endFrame){n.endFrame()}return e})}},{key:"getTextureScale",value:function e(){return Math.min(1,this._textureQuality*this._options.pixelRatio)}},{key:"_prepareTexture",value:function e(){var t=this;return new v.a(function(e,r){var n=t.getTextureScale();if(t._textureQuality===1){return e(t._inputTexture)}var i=t.getInputDimensions().multiply(n).floor();var a=void 0;if(!t._resizedTexture){t._resizedTexture=new M.RenderTexture(t._renderer,i.x,i.y);a=true}else if(!t._resizedTexture.getDimensions().equals(i)){t._resizedTexture.resizeTo(i);a=true}if(a){t._resizedSprite.setScale(n,n);t._resizedSprite.setTexture(t._inputTexture);t._resizedTexture.render(t._resizedContainer)}e(t._resizedTexture)})}},{key:"_registerOperations",value:function e(){this._operations={};for(var t in g){var r=g[t];this._operations[r.identifier]=r}this._operations=D.extend(this._operations,this._options.extensions.operations)}},{key:"registerOperations",value:function e(t){var r=this;t.forEach(function(e){r._operations[e.identifier]=e})}},{key:"setAllOperationsToDirty",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;this._operationsStack.setAllToDirty(t)}},{key:"createOperation",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;var i=this._operations[t];if(!i){throw new Error("No operation with identifier `"+t+"` found.")}var a=new i(this,r);if(n){this.addOperation(a)}return a}},{key:"addOperation",value:function e(t){this._operationsStack.push(t)}},{key:"removeOperation",value:function e(t){this._operationsStack.remove(t)}},{key:"getInputDimensions",value:function e(){var t=this._inputTexture.getFrame();return new B(t.width,t.height)}},{key:"getFinalDimensions",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var r=this.getInputDimensions();var n=this._operationsStack;n.forEach(function(e){if(!e.getEnabled())return;r=e.getNewDimensions(r)});if(t){r.multiply(this._spriteScale)}return r.floor()}},{key:"getOutputDimensions",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;return this.getFinalDimensions(t).clone().multiply(this._zoom).floor()}},{key:"getOutputTextureDimensions",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var r=this.getTextureScale();var n=this.getInputDimensions().multiply(r).floor();this._operationsStack.forEach(function(e){n=e.getNewDimensions(n)});return n}},{key:"getCrossOrigin",value:function e(){return D.getCrossOrigin(this._options.crossOrigin||"Anonymous")}},{key:"_checkForUpdates",value:function e(){if(!this._l.isENT()){this._versionChecker=new b["a"](this.version)}}},{key:"_initRenderer",value:function e(){var t={canvas:this._options.canvas,pixelRatio:this._options.pixelRatio,debug:this._options.debug,transparent:this._options.transparent,clearColor:this._options.clearColor};var r=void 0,n=void 0;if(this._renderMode==="dynamic"&&this._options.canvas){var i=this._options.canvas;r=i.width;n=i.height}else if(this._inputTexture){var a=this.getFinalDimensions();r=a.x;n=a.y}else{r=1;n=1}switch(this._preferredRenderer){case V.WEBGL:this._renderer=M.autoDetectRenderer(r,n,t);this._renderer.on("context-restored",this._onContextRestored);break;case V.CANVAS:this._renderer=new M.CanvasRenderer(r,n,t);this._renderer.on("context-restored",this._onContextRestored);break;default:P.warn("PhotoEditorSDK","PhotoEditorSDK Error: Renderer `"+this._preferredRenderer+"` not supported. Falling back to automatically detected renderer.");this._renderer=M.autoDetectRenderer(r,n,t)}}},{key:"resizeTo",value:function e(t){this._renderer.resizeTo(t,true)}},{key:"reset",value:function e(){this._operationsStack.clear()}},{key:"parseExif",value:function e(t){if(!t){return}var r=t.src;var n=false;var i=null;if(true){n=w["a"].isJPEG(r);i=r}else{if(t instanceof Image&&t.rawSource){var a=t.rawSource;if(!(t.rawSource instanceof Buffer)){var o=t.rawSource.replace("data:image/jpeg;base64,","");a=Buffer.from(o,"base64");r=t.rawSource}else{r=t.rawSource.toString("base64")}n=Exif.bufferIsJPEG(a);if(n){i=r}}}if(n){var s=null;try{s=w["a"].fromBase64String(i)}catch(e){}if(!s){return}return s}}},{key:"_handleExifOrientation",value:function e(){var t=this._exif.getTags();if(t&&t.Orientation){var r=t.Orientation!==1&&t.Orientation!==2;var n=[2,4,5,7].indexOf(t.Orientation)!==-1;if(r||n){if(!this._exifOperation){this._exifOperation=this.createOperation("exif-orientation")}this._exifOperation.setTags(t);this._exif.setOrientation(1)}}}},{key:"hasImage",value:function e(){return this._image!==null&&typeof this._image!=="undefined"}},{key:"getImage",value:function e(){return this._image}},{key:"setImage",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;if(this._exifOperation){this.removeOperation(this._exifOperation);this._exifOperation=null}this._options.image=t;this._image=t;this._exif=r||this.parseExif(t);if(this._exif){this._handleExifOrientation()}var i=new M.BaseTexture(this._image);var a=new I(0,0,this._image.naturalWidth||this._image.width,this._image.naturalHeight||this._image.height);if(n){a.width=n.x;a.height=n.y}if(this._resizedTexture){this._resizedTexture.dispose()}this._resizedTexture=null;if(this._inputTexture){this._inputTexture.getBaseTexture().dispose()}this._inputTexture=new M.Texture(i,a);this._currentTexture=this._inputTexture;this._sprite.clearTexture();this._sprite.setTexture(this._inputTexture);this.setAllOperationsToDirty(true)}},{key:"setInputTexture",value:function e(t){this._inputTexture=t}},{key:"getCanvas",value:function e(){return this._renderer.getCanvas()}},{key:"setCanvas",value:function e(t){this._renderer.setCanvas(t)}},{key:"getSprite",value:function e(){return this._sprite}},{key:"getContainer",value:function e(){return this._container}},{key:"getOperationsStack",value:function e(){return this._operationsStack}},{key:"setOperationsStack",value:function e(t){if(this._operationsStack){this._operationsStack.off(G.OPERATION_UPDATED,this._onOperationUpdate)}this._operationsStack=t;this._operationsStack.on(G.OPERATION_UPDATED,this._onOperationUpdate)}},{key:"getOperations",value:function e(){return this._operations}},{key:"getRenderer",value:function e(){return this._renderer}},{key:"getOffset",value:function e(){return this._offset}},{key:"setOffset",value:function e(t,r){if(t instanceof B){this._offset.copy(t)}else{this._offset.set(t,r)}}},{key:"getRenderMode",value:function e(){return this._renderMode}},{key:"setRenderMode",value:function e(t){this._renderMode=t}},{key:"getZoom",value:function e(){return this._zoom}},{key:"setZoom",value:function e(t){this._zoom=t;this._container.setScale(this._zoom,this._zoom);this._container.updateTransform()}},{key:"getTextureQuality",value:function e(){if(this._renderMode==="export"){return 1}return this._textureQuality}},{key:"setTextureQuality",value:function e(t){if(t!==this._textureQuality){this.setAllOperationsToDirty(true)}this._textureQuality=Math.min(1,t);if(this._textureQuality===1&&this._resizedTexture){this._resizedTexture.dispose();this._resizedTexture=null}}},{key:"getSpriteScale",value:function e(){return this._spriteScale}},{key:"setSpriteScale",value:function e(t){this._spriteScale=t;this._sprite.setScale(t,t);this._sprite.updateTransform()}},{key:"getPixelRatio",value:function e(){return this._options.pixelRatio}},{key:"getExif",value:function e(){return this._exif}},{key:"getOptions",value:function e(){return this._options}},{key:"getInputTexture",value:function e(){return this._inputTexture}},{key:"setSmoothDownscaling",value:function e(t){this._options.smoothDownscaling=t;this._sprite.setSmoothDownscaling(t);this._resizedSprite.setSmoothDownscaling(t)}},{key:"setRotation",value:function e(t){this._rotation=t}},{key:"getRotation",value:function e(){return this._rotation}},{key:"hasChanges",value:function e(){return this.getOperationsStack().hasChanges()}},{key:"dispose",value:function e(){this._operationsStack.dispose();this._renderer.dispose();if(this._exif){this._exif.dispose()}if(this._resizedTexture){this._resizedTexture.dispose()}}}]);return t}(L);t["a"]=W},function(e,t,r){r(45);r(66);e.exports=r(86).f("iterator")},function(e,t,r){var n=r(77);var i=r(78);e.exports=function(e){return function(t,r){var a=String(i(t));var o=n(r);var s=a.length;var u,l;if(o<0||o>=s)return e?"":undefined;u=a.charCodeAt(o);return u<55296||u>56319||o+1===s||(l=a.charCodeAt(o+1))<56320||l>57343?e?a.charAt(o):u:e?a.slice(o,o+2):(u-55296<<10)+(l-56320)+65536}}},function(e,t,r){"use strict";var n=r(81);var i=r(46);var a=r(65);var o={};r(26)(o,r(11)("iterator"),function(){return this});e.exports=function(e,t,r){e.prototype=n(o,{next:i(1,r)});a(e,t+" Iterator")}},function(e,t,r){var n=r(21);var i=r(18);var a=r(47);e.exports=r(25)?Object.defineProperties:function e(t,r){i(t);var o=a(r);var s=o.length;var u=0;var l;while(s>u)n.f(t,l=o[u++],r[l]);return t}},function(e,t,r){var n=r(28);var i=r(82);var a=r(165);e.exports=function(e){return function(t,r,o){var s=n(t);var u=i(s.length);var l=a(o,u);var f;if(e&&r!=r)while(u>l){f=s[l++];if(f!=f)return true}else for(;u>l;l++)if(e||l in s){if(s[l]===r)return e||l||0}return!e&&-1}}},function(e,t,r){var n=r(77);var i=Math.max;var a=Math.min;e.exports=function(e,t){e=n(e);return e<0?i(e+t,0):a(e,t)}},function(e,t,r){"use strict";var n=r(167);var i=r(168);var a=r(38);var o=r(28);e.exports=r(109)(Array,"Array",function(e,t){this._t=o(e);this._i=0;this._k=t},function(){var e=this._t;var t=this._k;var r=this._i++;if(!e||r>=e.length){this._t=undefined;return i(1)}if(t=="keys")return i(0,r);if(t=="values")return i(0,e[r]);return i(0,[r,e[r]])},"values");a.Arguments=a.Array;n("keys");n("values");n("entries")},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,r){r(170);r(117);r(175);r(176);e.exports=r(10).Symbol},function(e,t,r){"use strict";var n=r(14);var i=r(27);var a=r(25);var o=r(13);var s=r(111);var u=r(171).KEY;var l=r(37);var f=r(84);var c=r(65);var h=r(64);var p=r(11);var v=r(86);var d=r(87);var y=r(172);var _=r(173);var g=r(18);var m=r(24);var b=r(28);var w=r(80);var x=r(46);var T=r(81);var k=r(174);var R=r(89);var E=r(21);var C=r(47);var O=R.f;var S=E.f;var F=k.f;var I=n.Symbol;var A=n.JSON;var M=A&&A.stringify;var D="prototype";var L=p("_hidden");var B=p("toPrimitive");var P={}.propertyIsEnumerable;var U=f("symbol-registry");var N=f("symbols");var j=f("op-symbols");var z=Object[D];var G=typeof I=="function";var V=n.QObject;var W=!V||!V[D]||!V[D].findChild;var H=a&&l(function(){return T(S({},"a",{get:function(){return S(this,"a",{value:7}).a}})).a!=7})?function(e,t,r){var n=O(z,t);if(n)delete z[t];S(e,t,r);if(n&&e!==z)S(z,t,n)}:S;var q=function(e){var t=N[e]=T(I[D]);t._k=e;return t};var Y=G&&typeof I.iterator=="symbol"?function(e){return typeof e=="symbol"}:function(e){return e instanceof I};var X=function e(t,r,n){if(t===z)X(j,r,n);g(t);r=w(r,true);g(n);if(i(N,r)){if(!n.enumerable){if(!i(t,L))S(t,L,x(1,{}));t[L][r]=true}else{if(i(t,L)&&t[L][r])t[L][r]=false;n=T(n,{enumerable:x(0,false)})}return H(t,r,n)}return S(t,r,n)};var J=function e(t,r){g(t);var n=y(r=b(r));var i=0;var a=n.length;var o;while(a>i)X(t,o=n[i++],r[o]);return t};var Z=function e(t,r){return r===undefined?T(t):J(T(t),r)};var K=function e(t){var r=P.call(this,t=w(t,true));if(this===z&&i(N,t)&&!i(j,t))return false;return r||!i(this,t)||!i(N,t)||i(this,L)&&this[L][t]?r:true};var Q=function e(t,r){t=b(t);r=w(r,true);if(t===z&&i(N,r)&&!i(j,r))return;var n=O(t,r);if(n&&i(N,r)&&!(i(t,L)&&t[L][r]))n.enumerable=true;return n};var $=function e(t){var r=F(b(t));var n=[];var a=0;var o;while(r.length>a){if(!i(N,o=r[a++])&&o!=L&&o!=u)n.push(o)}return n};var ee=function e(t){var r=t===z;var n=F(r?j:b(t));var a=[];var o=0;var s;while(n.length>o){if(i(N,s=n[o++])&&(r?i(z,s):true))a.push(N[s])}return a};if(!G){I=function e(){if(this instanceof I)throw TypeError("Symbol is not a constructor!");var t=h(arguments.length>0?arguments[0]:undefined);var r=function(e){if(this===z)r.call(j,e);if(i(this,L)&&i(this[L],t))this[L][t]=false;H(this,t,x(1,e))};if(a&&W)H(z,t,{configurable:true,set:r});return q(t)};s(I[D],"toString",function e(){return this._k});R.f=Q;E.f=X;r(116).f=k.f=$;r(67).f=K;r(88).f=ee;if(a&&!r(62)){s(z,"propertyIsEnumerable",K,true)}v.f=function(e){return q(p(e))}}o(o.G+o.W+o.F*!G,{Symbol:I});for(var te="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),re=0;te.length>re;)p(te[re++]);for(var ne=C(p.store),ie=0;ne.length>ie;)d(ne[ie++]);o(o.S+o.F*!G,"Symbol",{for:function(e){return i(U,e+="")?U[e]:U[e]=I(e)},keyFor:function e(t){if(!Y(t))throw TypeError(t+" is not a symbol!");for(var r in U)if(U[r]===t)return r},useSetter:function(){W=true},useSimple:function(){W=false}});o(o.S+o.F*!G,"Object",{create:Z,defineProperty:X,defineProperties:J,getOwnPropertyDescriptor:Q,getOwnPropertyNames:$,getOwnPropertySymbols:ee});A&&o(o.S+o.F*(!G||l(function(){var e=I();return M([e])!="[null]"||M({a:e})!="{}"||M(Object(e))!="{}"})),"JSON",{stringify:function e(t){var r=[t];var n=1;var i,a;while(arguments.length>n)r.push(arguments[n++]);a=i=r[1];if(!m(i)&&t===undefined||Y(t))return;if(!_(i))i=function(e,t){if(typeof a=="function")t=a.call(this,e,t);if(!Y(t))return t};r[1]=i;return M.apply(A,r)}});I[D][B]||r(26)(I[D],B,I[D].valueOf);c(I,"Symbol");c(Math,"Math",true);c(n.JSON,"JSON",true)},function(e,t,r){var n=r(64)("meta");var i=r(24);var a=r(27);var o=r(21).f;var s=0;var u=Object.isExtensible||function(){return true};var l=!r(37)(function(){return u(Object.preventExtensions({}))});var f=function(e){o(e,n,{value:{i:"O"+ ++s,w:{}}})};var c=function(e,t){if(!i(e))return typeof e=="symbol"?e:(typeof e=="string"?"S":"P")+e;if(!a(e,n)){if(!u(e))return"F";if(!t)return"E";f(e)}return e[n].i};var h=function(e,t){if(!a(e,n)){if(!u(e))return true;if(!t)return false;f(e)}return e[n].w};var p=function(e){if(l&&v.NEED&&u(e)&&!a(e,n))f(e);return e};var v=e.exports={KEY:n,NEED:false,fastKey:c,getWeak:h,onFreeze:p}},function(e,t,r){var n=r(47);var i=r(88);var a=r(67);e.exports=function(e){var t=n(e);var r=i.f;if(r){var o=r(e);var s=a.f;var u=0;var l;while(o.length>u)if(s.call(e,l=o[u++]))t.push(l)}return t}},function(e,t,r){var n=r(48);e.exports=Array.isArray||function e(t){return n(t)=="Array"}},function(e,t,r){var n=r(28);var i=r(116).f;var a={}.toString;var o=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];var s=function(e){try{return i(e)}catch(e){return o.slice()}};e.exports.f=function e(t){return o&&a.call(t)=="[object Window]"?s(t):i(n(t))}},function(e,t,r){r(87)("asyncIterator")},function(e,t,r){r(87)("observable")},function(e,t,r){r(178);var n=r(10).Object;e.exports=function e(t,r,i){return n.defineProperty(t,r,i)}},function(e,t,r){var n=r(13);n(n.S+n.F*!r(25),"Object",{defineProperty:r(21).f})},function(e,t,r){r(180);e.exports=r(10).Object.setPrototypeOf},function(e,t,r){var n=r(13);n(n.S,"Object",{setPrototypeOf:r(181).set})},function(e,t,r){var n=r(24);var i=r(18);var a=function(e,t){i(e);if(!n(t)&&t!==null)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,n){try{n=r(36)(Function.call,r(89).f(Object.prototype,"__proto__").set,2);n(e,[]);t=!(e instanceof Array)}catch(e){t=true}return function e(r,i){a(r,i);if(t)r.__proto__=i;else n(r,i);return r}}({},false):undefined),check:a}},function(e,t,r){r(183);var n=r(10).Object;e.exports=function e(t,r){return n.create(t,r)}},function(e,t,r){var n=r(13);n(n.S,"Object",{create:r(81)})},function(e,t,r){r(117);r(45);r(66);r(185);r(192);r(193);e.exports=r(10).Promise},function(e,t,r){"use strict";var n=r(62);var i=r(14);var a=r(36);var o=r(90);var s=r(13);var u=r(24);var l=r(63);var f=r(186);var c=r(187);var h=r(120);var p=r(92).set;var v=r(189)();var d=r(93);var y=r(121);var _=r(122);var g="Promise";var m=i.TypeError;var b=i.process;var w=i[g];var x=o(b)=="process";var T=function(){};var k,R,E,C;var O=R=d.f;var S=!!function(){try{var e=w.resolve(1);var t=(e.constructor={})[r(11)("species")]=function(e){e(T,T)};return(x||typeof PromiseRejectionEvent=="function")&&e.then(T)instanceof t}catch(e){}}();var F=function(e){var t;return u(e)&&typeof(t=e.then)=="function"?t:false};var I=function(e,t){if(e._n)return;e._n=true;var r=e._c;v(function(){var n=e._v;var i=e._s==1;var a=0;var o=function(t){var r=i?t.ok:t.fail;var a=t.resolve;var o=t.reject;var s=t.domain;var u,l;try{if(r){if(!i){if(e._h==2)D(e);e._h=1}if(r===true)u=n;else{if(s)s.enter();u=r(n);if(s)s.exit()}if(u===t.promise){o(m("Promise-chain cycle"))}else if(l=F(u)){l.call(u,a,o)}else a(u)}else o(n)}catch(e){o(e)}};while(r.length>a)o(r[a++]);e._c=[];e._n=false;if(t&&!e._h)A(e)})};var A=function(e){p.call(i,function(){var t=e._v;var r=M(e);var n,a,o;if(r){n=y(function(){if(x){b.emit("unhandledRejection",t,e)}else if(a=i.onunhandledrejection){a({promise:e,reason:t})}else if((o=i.console)&&o.error){o.error("Unhandled promise rejection",t)}});e._h=x||M(e)?2:1}e._a=undefined;if(r&&n.e)throw n.v})};var M=function(e){return e._h!==1&&(e._a||e._c).length===0};var D=function(e){p.call(i,function(){var t;if(x){b.emit("rejectionHandled",e)}else if(t=i.onrejectionhandled){t({promise:e,reason:e._v})}})};var L=function(e){var t=this;if(t._d)return;t._d=true;t=t._w||t;t._v=e;t._s=2;if(!t._a)t._a=t._c.slice();I(t,true)};var B=function(e){var t=this;var r;if(t._d)return;t._d=true;t=t._w||t;try{if(t===e)throw m("Promise can't be resolved itself");if(r=F(e)){v(function(){var n={_w:t,_d:false};try{r.call(e,a(B,n,1),a(L,n,1))}catch(e){L.call(n,e)}})}else{t._v=e;t._s=1;I(t,false)}}catch(e){L.call({_w:t,_d:false},e)}};if(!S){w=function e(t){f(this,w,g,"_h");l(t);k.call(this);try{t(a(B,this,1),a(L,this,1))}catch(e){L.call(this,e)}};k=function e(t){this._c=[];this._a=undefined;this._s=0;this._d=false;this._v=undefined;this._h=0;this._n=false};k.prototype=r(190)(w.prototype,{then:function e(t,r){var n=O(h(this,w));n.ok=typeof t=="function"?t:true;n.fail=typeof r=="function"&&r;n.domain=x?b.domain:undefined;this._c.push(n);if(this._a)this._a.push(n);if(this._s)I(this,false);return n.promise},catch:function(e){return this.then(undefined,e)}});E=function(){var e=new k;this.promise=e;this.resolve=a(B,e,1);this.reject=a(L,e,1)};d.f=O=function(e){return e===w||e===C?new E(e):R(e)}}s(s.G+s.W+s.F*!S,{Promise:w});r(65)(w,g);r(191)(g);C=r(10)[g];s(s.S+s.F*!S,g,{reject:function e(t){var r=O(this);var n=r.reject;n(t);return r.promise}});s(s.S+s.F*(n||!S),g,{resolve:function e(t){return _(n&&this===C?w:this,t)}});s(s.S+s.F*!(S&&r(123)(function(e){w.all(e)["catch"](T)})),g,{all:function e(t){var r=this;var n=O(r);var i=n.resolve;var a=n.reject;var o=y(function(){var e=[];var n=0;var o=1;c(t,false,function(t){var s=n++;var u=false;e.push(undefined);o++;r.resolve(t).then(function(t){if(u)return;u=true;e[s]=t;--o||i(e)},a)});--o||i(e)});if(o.e)a(o.v);return n.promise},race:function e(t){var r=this;var n=O(r);var i=n.reject;var a=y(function(){c(t,false,function(e){r.resolve(e).then(n.resolve,i)})});if(a.e)i(a.v);return n.promise}})},function(e,t){e.exports=function(e,t,r,n){if(!(e instanceof t)||n!==undefined&&n in e){throw TypeError(r+": incorrect invocation!")}return e}},function(e,t,r){var n=r(36);var i=r(118);var a=r(119);var o=r(18);var s=r(82);var u=r(91);var l={};var f={};var t=e.exports=function(e,t,r,c,h){var p=h?function(){return e}:u(e);var v=n(r,c,t?2:1);var d=0;var y,_,g,m;if(typeof p!="function")throw TypeError(e+" is not iterable!");if(a(p))for(y=s(e.length);y>d;d++){m=t?v(o(_=e[d])[0],_[1]):v(e[d]);if(m===l||m===f)return m}else for(g=p.call(e);!(_=g.next()).done;){m=i(g,v,_.value,t);if(m===l||m===f)return m}};t.BREAK=l;t.RETURN=f},function(e,t){e.exports=function(e,t,r){var n=r===undefined;switch(t.length){case 0:return n?e():e.call(r);case 1:return n?e(t[0]):e.call(r,t[0]);case 2:return n?e(t[0],t[1]):e.call(r,t[0],t[1]);case 3:return n?e(t[0],t[1],t[2]):e.call(r,t[0],t[1],t[2]);case 4:return n?e(t[0],t[1],t[2],t[3]):e.call(r,t[0],t[1],t[2],t[3])}return e.apply(r,t)}},function(e,t,r){var n=r(14);var i=r(92).set;var a=n.MutationObserver||n.WebKitMutationObserver;var o=n.process;var s=n.Promise;var u=r(48)(o)=="process";e.exports=function(){var e,t,r;var l=function(){var n,i;if(u&&(n=o.domain))n.exit();while(e){i=e.fn;e=e.next;try{i()}catch(n){if(e)r();else t=undefined;throw n}}t=undefined;if(n)n.enter()};if(u){r=function(){o.nextTick(l)}}else if(a&&!(n.navigator&&n.navigator.standalone)){var f=true;var c=document.createTextNode("");new a(l).observe(c,{characterData:true});r=function(){c.data=f=!f}}else if(s&&s.resolve){var h=s.resolve();r=function(){h.then(l)}}else{r=function(){i.call(n,l)}}return function(n){var i={fn:n,next:undefined};if(t)t.next=i;if(!e){e=i;r()}t=i}}},function(e,t,r){var n=r(26);e.exports=function(e,t,r){for(var i in t){if(r&&e[i])e[i]=t[i];else n(e,i,t[i])}return e}},function(e,t,r){"use strict";var n=r(14);var i=r(10);var a=r(21);var o=r(25);var s=r(11)("species");e.exports=function(e){var t=typeof i[e]=="function"?i[e]:n[e];if(o&&t&&!t[s])a.f(t,s,{configurable:true,get:function(){return this}})}},function(e,t,r){"use strict";var n=r(13);var i=r(10);var a=r(14);var o=r(120);var s=r(122);n(n.P+n.R,"Promise",{finally:function(e){var t=o(this,i.Promise||a.Promise);var r=typeof e=="function";return this.then(r?function(r){return s(t,e()).then(function(){return r})}:e,r?function(r){return s(t,e()).then(function(){throw r})}:e)}})},function(e,t,r){"use strict";var n=r(13);var i=r(93);var a=r(121);n(n.S,"Promise",{try:function(e){var t=i.f(this);var r=a(e);(r.e?t.reject:t.resolve)(r.v);return t.promise}})},function(e,t,r){r(195);e.exports=r(10).Object.getPrototypeOf},function(e,t,r){var n=r(49);var i=r(115);r(94)("getPrototypeOf",function(){return function e(t){return i(n(t))}})},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(9);var h=r(128);var p=r(130);var v=r(72);var d=r(95);var y=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function _(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function g(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function m(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var b=c["c"].RendererType;var w=function(e){m(t,e);function t(){var e;_(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=g(this,(e=t.__proto__||f()(t)).call.apply(e,[this].concat(n)));a._type=b.CANVAS;a.setCanvas(a._options.canvas||a._createCanvas());return a}y(t,[{key:"_createCanvas",value:function e(){return c["i"].createCanvas()}},{key:"_createContext",value:function e(){var r=this._canvas;var n=r.getContext("2d");if(this._options.debug){n=new h["a"](n)}this.id=n.id=t.contextId++;this._context=n;n.renderer=this;this.emit("context",n);return n}},{key:"_setupContext",value:function e(){var t=this._context;if(!("imageSmoothingEnabled"in t)){["moz","webkit","ms"].forEach(function(e){if(t[e]){t[e]=true}})}else{t.imageSmoothingEnabled=true}this._defaultRenderTarget=new v["a"](this._width,this._height,this._pixelRatio,this._canvas,this._context);this.setRenderTarget(this._defaultRenderTarget);this._filterManager=new d["a"](this)}},{key:"render",value:function e(t){var r=this._renderTarget.getContext();var n=t.getParent();t.setParent(this._fakeObject);t.updateTransform();t.setParent(n);r.setTransform(1,0,0,1,0,0);r.globalAlpha=1;var i=this._canvas,a=i.width,o=i.height;r.clearRect(0,0,a,o);if(this._clearColor.a!==0){r.save();r.fillStyle=this._clearColor.toRGBA();r.fillRect(0,0,a,o);r.restore()}this.renderDisplayObject(t,this._renderTarget)}},{key:"renderDisplayObject",value:function e(t,r){var n=this._renderTarget;this._filterManager.setFilterStack(r.getFilterStack());this.setRenderTarget(r);t.renderCanvas(this);this.setRenderTarget(n)}},{key:"getCurrentRenderTarget",value:function e(){return this._renderTarget}},{key:"setRenderTarget",value:function e(t){this._renderTarget=t}},{key:"getContext",value:function e(){return this._renderTarget.getContext()}},{key:"dispose",value:function e(){this._filterManager.dispose()}}]);return t}(p["a"]);w.contextId=0;w.type="Canvas2D";t["a"]=w},function(e,t,r){r(45);r(198);e.exports=r(10).Array.from},function(e,t,r){"use strict";var n=r(36);var i=r(13);var a=r(49);var o=r(118);var s=r(119);var u=r(82);var l=r(199);var f=r(91);i(i.S+i.F*!r(123)(function(e){Array.from(e)}),"Array",{from:function e(t){var r=a(t);var i=typeof this=="function"?this:Array;var c=arguments.length;var h=c>1?arguments[1]:undefined;var p=h!==undefined;var v=0;var d=f(r);var y,_,g,m;if(p)h=n(h,c>2?arguments[2]:undefined,2);if(d!=undefined&&!(i==Array&&s(d))){for(m=d.call(r),_=new i;!(g=m.next()).done;v++){l(_,v,p?o(m,h,[g.value,v],true):g.value)}}else{y=u(r.length);for(_=new i(y);y>v;v++){l(_,v,p?h(r[v],v):r[v])}}_.length=v;return _}})},function(e,t,r){"use strict";var n=r(21);var i=r(46);e.exports=function(e,t,r){if(t in e)n.f(e,t,i(0,r));else e[t]=r}},function(e,t,r){e.exports={default:r(201),__esModule:true}},function(e,t,r){var n=r(10);var i=n.JSON||(n.JSON={stringify:JSON.stringify});e.exports=function e(t){return i.stringify.apply(i,arguments)}},function(e,t,r){r(203);e.exports=r(10).Object.assign},function(e,t,r){var n=r(13);n(n.S+n.F,"Object",{assign:r(204)})},function(e,t,r){"use strict";var n=r(47);var i=r(88);var a=r(67);var o=r(49);var s=r(113);var u=Object.assign;e.exports=!u||r(37)(function(){var e={};var t={};var r=Symbol();var n="abcdefghijklmnopqrst";e[r]=7;n.split("").forEach(function(e){t[e]=e});return u({},e)[r]!=7||Object.keys(u({},t)).join("")!=n})?function e(t,r){var u=o(t);var l=arguments.length;var f=1;var c=i.f;var h=a.f;while(l>f){var p=s(arguments[f++]);var v=c?n(p).concat(c(p)):n(p);var d=v.length;var y=0;var _;while(d>y)if(h.call(p,_=v[y++]))u[_]=p[_]}return u}:u},function(e,t,r){r(206);e.exports=r(10).Object.keys},function(e,t,r){var n=r(49);var i=r(47);r(94)("keys",function(){return function e(t){return i(n(t))}})},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function o(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var s=function(){function e(){o(this,e)}a(e,null,[{key:"head",value:function e(t){return t[0]}},{key:"tail",value:function e(t){return t.slice(1)}},{key:"last",value:function e(t){return t[t.length-1]}},{key:"init",value:function e(t){return t.slice(0,t.length-1)}},{key:"remove",value:function e(t,r){return t.filter(function(e,t,n){return!r(e,t,n)})}},{key:"findIndex",value:function e(t,r){for(var n=0;n<t.length;n++){if(r(t[n])){return n}}return-1}},{key:"find",value:function e(t,r){for(var n=0;n<t.length;n++){if(r(t[n])){return t[n]}}return undefined}},{key:"flatten",value:function t(r){return r.reduce(function(t,r){return t.concat(Array.isArray(r)?e.flatten(r):r)},[])}},{key:"range",value:function e(t,r){var n=[];if(r>t){for(var i=t;i<r;i++){n.push(i)}}return n}},{key:"repeat",value:function e(t,r){var n=[];for(var i=0;i<r;i++){n[i]=t}return n}},{key:"zip",value:function e(t,r){var n=Math.min(t.length,r.length);var i=[];for(var a=0;a<n;a++){i[a]=[t[a],r[a]]}return i}}]);return e}();t["a"]=s},function(e,t,r){r(66);r(45);e.exports=r(209)},function(e,t,r){var n=r(90);var i=r(11)("iterator");var a=r(38);e.exports=r(10).isIterable=function(e){var t=Object(e);return t[i]!==undefined||"@@iterator"in t||a.hasOwnProperty(n(t))}},function(e,t,r){r(66);r(45);e.exports=r(211)},function(e,t,r){var n=r(18);var i=r(91);e.exports=r(10).getIterator=function(e){var t=i(e);if(typeof t!="function")throw TypeError(e+" is not iterable!");return n(t.call(e))}},function(e,t,r){"use strict";var n={defaults:function e(t){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++){n[i-1]=arguments[i]}var a={};for(var o in t){a[o]=t[o]}for(var s=0;s<n.length;s++){var u=n[s];for(var l in u){if(typeof a[l]==="undefined"){a[l]=u[l]}}}return a},extend:function e(t){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++){n[i-1]=arguments[i]}var a={};for(var o in t){a[o]=t[o]}for(var s=0;s<n.length;s++){var u=n[s];for(var l in u){a[l]=u[l]}}return a}};t["a"]=n},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(5);var o=r.n(a);var s=r(2);var u=r.n(s);var l=r(3);var f=r.n(l);var c=r(1);var h=r.n(c);var p=r(9);var v=r(130);var d=r(73);var y=r(131);var _=r(216);var g=r(96);var m=r(98);var b=r(99);var w=r(128);var x=r(132);var T=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var k=function e(t,r,n){if(t===null)t=Function.prototype;var i=o()(t,r);if(i===undefined){var a=h()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var s=i.get;if(s===undefined){return undefined}return s.call(n)}};function R(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function E(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function C(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)u.a?u()(e,t):e.__proto__=t}var O=p["c"].RendererType;var S=function(e){C(t,e);function t(){var e;R(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=E(this,(e=t.__proto__||h()(t)).call.apply(e,[this].concat(n)));a._type=O.WEBGL;a._textures=[];a._fakeObject=new m["a"];a._onContextLost=a._onContextLost.bind(a);a._onContextRestored=a._onContextRestored.bind(a);a.setCanvas(a._options.canvas||p["i"].createCanvas());a.shaders=a._initShaders();a.renderers=a._initRenderers();return a}T(t,[{key:"_onContextLost",value:function e(t){t.preventDefault();p["f"].warn(this.constructor.name,"WebGL context has been lost - trying to restore.")}},{key:"_onContextCreationError",value:function e(t){t.preventDefault();p["f"].warn(this.constructor.name,"Failed to create WebGL context: "+(t.statusMessage||"Unknown error"))}},{key:"_onContextRestored",value:function e(){var t=this;p["f"].warn(this.constructor.name,"WebGL context has been restored. Clearing all textures.");this._textures.forEach(function(e){e.disposeGLTexturesForRenderer(t)});this._createContext();this._setupContext();this.emit("context-restored")}},{key:"_onBeforeContext",value:function e(){if(this._filterManager){this._filterManager.dispose()}this._filterManager=new b["a"](this);this._currentObjectRenderer=new y["a"](this)}},{key:"setShader",value:function e(t){this._currentShader=t;this._context.useProgram(t.getProgram());this._setAttributesForShader(t)}},{key:"setCanvas",value:function e(r){if(this._canvas){this._removeContextEventListeners()}k(t.prototype.__proto__||h()(t.prototype),"setCanvas",this).call(this,r);if(this._canvas.addEventListener){this._addContextEventListeners()}}},{key:"_addContextEventListeners",value:function e(){this._canvas.addEventListener("webglcontextlost",this._onContextLost);this._canvas.addEventListener("webglcontextrestored",this._onContextRestored);this._canvas.addEventListener("webglcontextcreationerror",this._onContextCreationError)}},{key:"_removeContextEventListeners",value:function e(){this._canvas.removeEventListener("webglcontextlost",this._onContextLost);this._canvas.removeEventListener("webglcontextrestored",this._onContextRestored);this._canvas.removeEventListener("webglcontextcreationerror",this._onContextCreationError)}},{key:"_setAttributesForShader",value:function e(t){var r=this._context;var n=t.getAttributes();var i=t.getAttributeLocations();n.forEach(function(e){var t=i[e];r.enableVertexAttribArray(t)})}},{key:"_initShaders",value:function e(){return{default:new g["a"](this)}}},{key:"_initRenderers",value:function e(){return{sprite:new _["a"](this)}}},{key:"_createContext",value:function e(){var r=this._canvas;var n=null;var i={preserveDrawingBuffer:true};if(true){n=r.getContext("webgl",i)||r.getContext("experimental-webgl",i)}if(typeof window!=="undefined"&&window.WebGLDebugUtils&&this._options.debug){var a=function e(t,r){console.error("gl."+t+"("+window.WebGLDebugUtils.glFunctionArgsToString(t,r)+")")};n=window.WebGLDebugUtils.makeDebugContext(n,null,a)}if(this._options.debug){n=new w["a"](n)}this.id=n.id=t.contextId++;this._context=n;n.renderer=this;this._maxTextureSize=n.getParameter(n.MAX_TEXTURE_SIZE);this.emit("context",n);return n}},{key:"_setupContext",value:function e(){var t=this._context;t.disable(t.DEPTH_TEST);t.disable(t.CULL_FACE);t.enable(t.BLEND);t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA);this._defaultRenderTarget=new d["a"](this,this._width,this._height,this._pixelRatio,true);this.setRenderTarget(this._defaultRenderTarget);this._getMaxPrecision()}},{key:"_getMaxPrecision",value:function e(){var t=this._context;var r=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT);this._maxFloatPrecision=r.precision!==0?"highp":"mediump";var n=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_INT);this._maxIntPrecision=n.rangeMax!==0?"highp":"lowp"}},{key:"resizeTo",value:function e(r){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;k(t.prototype.__proto__||h()(t.prototype),"resizeTo",this).call(this,r,n);if(this._currentRenderTarget){this._currentRenderTarget.resizeTo(r)}}},{key:"setRenderTarget",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this._defaultRenderTarget;this._currentRenderTarget=t;this._currentRenderTarget.activate()}},{key:"setObjectRenderer",value:function e(t){this._currentObjectRenderer.stop();this._currentObjectRenderer=t;this._currentObjectRenderer.start()}},{key:"render",value:function e(t){this.setRenderTarget(this._defaultRenderTarget);this._defaultRenderTarget.clear(this._clearColor);var r=t.getParent();t.setParent(this._fakeObject);t.updateTransform();t.setParent(r);this.renderDisplayObject(t,this._defaultRenderTarget)}},{key:"renderDisplayObject",value:function e(t,r){this.setRenderTarget(r);this._filterManager.setFilterStack(r.getFilterStack());t.renderWebGL(this);this._currentObjectRenderer.flush()}},{key:"clear",value:function e(){var t=this._context;t.clearColor.apply(t,this._clearColor.toGLColor());t.clear(t.COLOR_BUFFER_BIT)}},{key:"save",value:function e(){return{renderTarget:this._currentRenderTarget,objectRenderer:this._currentObjectRenderer,filterStack:this._filterManager.getFilterStack()}}},{key:"restore",value:function e(t){this.setRenderTarget(t.renderTarget);this._filterManager.setFilterStack(t.filterStack);this._currentObjectRenderer=t.objectRenderer}},{key:"getOrCreateGLTexture",value:function e(t){var r=this._context;var n=t.getGLTextureForRenderer(this);if(!n){n=r.createTexture();t.setGLTextureForRenderer(n,this);this._textures.push(t)}return n}},{key:"updateTexture",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;var n=t.getSource();var i=!!n;var a=this._context;var o=t.getGLUnit();var s=this.getOrCreateGLTexture(t);a.activeTexture(a.TEXTURE0+o);a.bindTexture(a.TEXTURE_2D,s);a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,true);if(r&&i){if(n instanceof x["a"]){a.texImage2D(a.TEXTURE_2D,0,a.RGBA,n.width,n.height,0,a.RGBA,a.UNSIGNED_BYTE,n.data)}else{a.texImage2D(a.TEXTURE_2D,0,a.RGBA,a.RGBA,a.UNSIGNED_BYTE,n)}}if(t.isMipMappingEnabled()){a.generateMipmap(a.TEXTURE_2D)}else{a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,t.getGLRepeat(a,"x"));a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,t.getGLRepeat(a,"y"))}a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,t.getGLFilter(a,"min"));a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,t.getGLFilter(a,"mag"));a.activeTexture(a.TEXTURE0)}},{key:"getMaxDimensions",value:function e(){var t=p["i"].createCanvas();var r=t.getContext("webgl")||t.getContext("experimental-webgl");if(!r){return null}else{var n=r.getParameter(r.MAX_TEXTURE_SIZE);var i=r.getExtension("WEBGL_lose_context");if(i){i.loseContext()}return n}}},{key:"getCurrentRenderTarget",value:function e(){return this._currentRenderTarget}},{key:"getCurrentObjectRenderer",value:function e(){return this._currentObjectRenderer}},{key:"getMaxFloatPrecision",value:function e(){return this._maxFloatPrecision}},{key:"getMaxIntPrecision",value:function e(){return this._maxIntPrecision}},{key:"dispose",value:function e(){var t=this;this._filterManager.dispose();this._currentObjectRenderer.dispose();this._defaultRenderTarget.dispose();this._textures.forEach(function(e){e.disposeGLTexturesForRenderer(t)});for(var r in this.shaders){this.shaders[r].dispose();delete this.shaders[r]}this._removeContextEventListeners();var n=this._context;var i=n.getExtension("WEBGL_lose_context");if(i){i.loseContext()}}}],[{key:"isSupported",value:function e(){var t=p["i"].createCanvas();t.addEventListener("webglcontextcreationerror",this.prototype._onContextCreationError);var r=t.getContext("webgl")||t.getContext("experimental-webgl");t.removeEventListener("webglcontextcreationerror",this.prototype._onContextCreationError);return!!r}}]);return t}(v["a"]);S.contextId=0;S.type="WebGL";t["a"]=S},function(e,t,r){r(215);var n=r(10).Object;e.exports=function e(t,r){return n.getOwnPropertyDescriptor(t,r)}},function(e,t,r){var n=r(28);var i=r(89).f;r(94)("getOwnPropertyDescriptor",function(){return function e(t,r){return i(n(t),r)}})},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(5);var o=r.n(a);var s=r(2);var u=r.n(s);var l=r(3);var f=r.n(l);var c=r(1);var h=r.n(c);var p=r(9);var v=r(131);var d=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var y=function e(t,r,n){if(t===null)t=Function.prototype;var i=o()(t,r);if(i===undefined){var a=h()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var s=i.get;if(s===undefined){return undefined}return s.call(n)}};function _(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function g(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function m(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)u.a?u()(e,t):e.__proto__=t}var b=function(e){m(t,e);function t(){var e;_(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=g(this,(e=t.__proto__||h()(t)).call.apply(e,[this].concat(n)));a._maxBatchSize=p["a"];a._vertices=new ArrayBuffer(p["a"]*4*p["j"]);a._positions=new Float32Array(a._vertices);a._colors=new Uint32Array(a._vertices);a._indices=new Uint16Array(p["a"]*6);for(var o=0,s=0;o<p["a"]*6;o+=6,s+=4){a._indices[o+0]=s+0;a._indices[o+1]=s+1;a._indices[o+2]=s+2;a._indices[o+3]=s+0;a._indices[o+4]=s+2;a._indices[o+5]=s+3}a._shaders=[];a._sprites=[];a._currentBatchSize=0;a._currentBaseTexture=null;a._onContextChange();return a}d(t,[{key:"render",value:function e(t){var r=t.getTexture();var n=r.getFrame();var i=r.getBaseTexture();if(this._currentBatchSize>=this._maxBatchSize){this.flush();this._currentBaseTexture=i}var a=r.getUVs();if(!a){return}var o=this._currentBatchSize*p["j"];this._addVertexCoordinates(t,o,n);this._addTextureUVs(t,o,a);this._addColors(t,o);this._sprites[this._currentBatchSize]=t;this._currentBatchSize++}},{key:"_addColors",value:function e(t,r){var n=this._colors;var i=t.getTint();var a=(i>>16)+(i&65280)+((i&255)<<16)+(t.getWorldAlpha()*255<<24);n[r+4]=n[r+9]=n[r+14]=n[r+19]=a}},{key:"_addTextureUVs",value:function e(t,r,n){var i=this._positions;var a=n.getUVsAt(0);i[r+2]=a.x;i[r+3]=a.y;a=n.getUVsAt(1);i[r+7]=a.x;i[r+8]=a.y;a=n.getUVsAt(2);i[r+12]=a.x;i[r+13]=a.y;a=n.getUVsAt(3);i[r+17]=a.x;i[r+18]=a.y}},{key:"_addVertexCoordinates",value:function e(t,r,n){var i=this._positions;var a=t.getWorldTransform();var o=t.getAnchor();var s=a.rectangleToCoordinates(n,o);var u=5;for(var l=0;l<4;l++){i[r+l*u]=s[l].x;i[r+l*u+1]=s[l].y}}},{key:"_onContextChange",value:function e(){var t=this._renderer.getContext();this._shader=this._renderer.shaders.default;this._vertexBuffer=t.createBuffer();this._indexBuffer=t.createBuffer();t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this._indexBuffer);t.bufferData(t.ELEMENT_ARRAY_BUFFER,this._indices,t.STATIC_DRAW);t.bindBuffer(t.ARRAY_BUFFER,this._vertexBuffer);t.bufferData(t.ARRAY_BUFFER,this._vertices,t.DYNAMIC_DRAW)}},{key:"start",value:function e(){this._shader.setupBuffers(this._vertexBuffer,this._indexBuffer)}},{key:"flush",value:function e(){var t=this._renderer;var r=t.getContext();if(this._currentBatchSize===0){return}if(this._currentBatchSize>p["a"]*.5){r.bufferSubData(r.ARRAY_BUFFER,0,this._vertices)}else{var n=this._positions.subarray(0,this._currentBatchSize*p["j"]);r.bufferSubData(r.ARRAY_BUFFER,0,n)}var i=0;var a=null;var o=null;var s=null;var u=null;var l=false;var f=false;var c=null;var h=0;for(var v=0,d=this._currentBatchSize;v<d;v++){c=this._sprites[v];o=c.getTexture().getBaseTexture();u=c.getShader()||this._shader;l=s!==u;f=a!==o;if(f||l){this._renderBatch(a,i,h);h=v;i=0;a=o;if(l){s=u;t.setShader(s);var y=t.getCurrentRenderTarget();var _=y.getProjectionMatrix().toArray();s.setUniform("u_projMatrix",_);s.syncUniforms();r.activeTexture(r.TEXTURE0)}}i++}this._renderBatch(a,i,h);this._currentBatchSize=0;this._sprites=[]}},{key:"_renderBatch",value:function e(t,r,n){if(r===0){return}var i=this._renderer;var a=i.getContext();var o=t.getGLTextureForRenderer(i);if(!o){o=i.getOrCreateGLTexture(t)}if(t.isDirty()){i.updateTexture(t);t.setDirty(false)}a.activeTexture(a.TEXTURE0+t.getGLUnit());a.bindTexture(a.TEXTURE_2D,o);var s=r*6;var u=n*6*2;a.drawElements(a.TRIANGLES,s,a.UNSIGNED_SHORT,u)}},{key:"dispose",value:function e(){var r=this._renderer;var n=r.getContext();n.deleteBuffer(this._vertexBuffer);n.deleteBuffer(this._indexBuffer);this._vertices=null;this._positions=null;this._colors=null;this._indices=null;y(t.prototype.__proto__||h()(t.prototype),"dispose",this).call(this)}}]);return t}(v["a"]);t["a"]=b},function(e,t){e.exports="attribute vec2 a_position;\nattribute vec2 a_texCoord;\nattribute vec4 a_color;\nvarying vec2 v_texCoord;\nvarying vec4 v_color;\nuniform mat3 u_projMatrix;\n\nvoid main() {\n gl_Position = vec4((u_projMatrix * vec3(a_position, 1)).xy, 0, 1);\n v_texCoord = a_texCoord;\n v_color = vec4(a_color.rgb * a_color.a, a_color.a);\n}\n"},function(e,t){e.exports="uniform sampler2D u_image;\nvarying vec2 v_texCoord;\nvarying vec4 v_color;\n\nvoid main() {\n gl_FragColor = texture2D(u_image, v_texCoord) * v_color;\n}\n"},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function o(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var s=function(){function e(t){o(this,e);this._renderer=t;this._context=this._renderer.getContext();this._vertices=new Float32Array([0,0,100,0,100,100,0,100]);this._uvs=new Float32Array([0,0,1,0,1,1,0,1]);this._indices=new Uint16Array([0,1,2,0,3,2]);this._colors=new Float32Array([1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]);this._initBuffers();this._uploadBuffers()}a(e,[{key:"map",value:function e(t,r){var n=r.x,i=r.y;this._uvs[2]=r.width/t.width;this._uvs[4]=this._uvs[2];this._uvs[5]=r.height/t.height;this._uvs[7]=this._uvs[5];this._vertices[0]=n;this._vertices[1]=i;this._vertices[2]=n+r.width;this._vertices[3]=i;this._vertices[4]=this._vertices[2];this._vertices[5]=i+r.height;this._vertices[6]=n;this._vertices[7]=this._vertices[5];this._uploadBuffers()}},{key:"_initBuffers",value:function e(){var t=this._context;this._vertexBuffer=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,this._vertexBuffer);t.bufferData(t.ARRAY_BUFFER,(8+8+16)*4,t.DYNAMIC_DRAW);this._indexBuffer=t.createBuffer();t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this._indexBuffer);t.bufferData(t.ELEMENT_ARRAY_BUFFER,this._indices,t.STATIC_DRAW)}},{key:"_uploadBuffers",value:function e(){var t=this._context;t.bindBuffer(t.ARRAY_BUFFER,this._vertexBuffer);t.bufferSubData(t.ARRAY_BUFFER,0,this._vertices);t.bufferSubData(t.ARRAY_BUFFER,8*4,this._uvs);t.bufferSubData(t.ARRAY_BUFFER,(8+8)*4,this._colors)}},{key:"getVertexBuffer",value:function e(){return this._vertexBuffer}},{key:"getIndexBuffer",value:function e(){return this._indexBuffer}},{key:"dispose",value:function e(){var t=this._context;t.deleteBuffer(this._vertexBuffer);t.deleteBuffer(this._indexBuffer)}}]);return e}();t["a"]=s},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(9);var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function s(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var u=function(){function e(){s(this,e);this._uvs=[new a["k"](0,0),new a["k"](1,0),new a["k"](1,1),new a["k"](0,1)]}o(e,[{key:"update",value:function e(t,r){var n=this._uvs[0];n.x=t.x/r.width;n.y=t.y/r.height;n=this._uvs[1];n.x=(t.x+t.width)/r.width;n.y=t.y/r.height;n=this._uvs[2];n.x=(t.x+t.width)/r.width;n.y=(t.y+t.height)/r.height;n=this._uvs[3];n.x=t.x/r.width;n.y=(t.y+t.height)/r.height}},{key:"getUVsAt",value:function e(t){return this._uvs[t]}},{key:"getUVs",value:function e(){return this._uvs}}]);return e}();t["a"]=u},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(9);var h=r(134);var p=r(53);var v=r(73);var d=r(72);var y=r(99);var _=r(95);var g=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function m(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function b(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function w(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var x=c["c"].RendererType;var T=function(e){w(t,e);function t(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:100;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:100;var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:1;m(this,t);var a=b(this,(t.__proto__||f()(t)).call(this,new p["a"],new c["h"](0,0,r,n)));a._loaded=true;a._width=r;a._height=n;a._pixelRatio=i;a._renderer=e;a._setupFilterManager();a._setupBuffer();a.setBaseTexture(a._renderTarget.getBaseTexture());a._updateUVs();return a}g(t,[{key:"_setupFilterManager",value:function e(){if(this._renderer.isOfType(x.WEBGL)){this._filterManager=new y["a"](this._renderer)}else if(this._renderer.isOfType(x.CANVAS)){this._filterManager=new _["a"](this._renderer)}this._filterManager.resizeTo(new c["k"](this._width,this._height))}},{key:"_setupBuffer",value:function e(){if(this._renderer.isOfType(x.WEBGL)){this._setupWebGLRenderTarget()}else if(this._renderer.isOfType(x.CANVAS)){this._setupCanvasRenderTarget()}}},{key:"_setupWebGLRenderTarget",value:function e(){this._renderTarget=new v["a"](this._renderer,this._width,this._height,this._pixelRatio)}},{key:"_setupCanvasRenderTarget",value:function e(){this._renderTarget=new d["a"](this._width,this._height,this._pixelRatio)}},{key:"clear",value:function e(t){this._renderTarget.clear(t)}},{key:"resizeTo",value:function e(t){if(this._width===t.x&&this._height===t.y){return}this._width=t.x;this._height=t.y;this._frame.width=t.x;this._frame.height=t.y;this._renderTarget.resizeTo(t);this._filterManager.resizeTo(t)}},{key:"render",value:function e(t){if(this._renderer.isOfType(x.WEBGL)){this._renderWebGL(t)}else if(this._renderer.isOfType(x.CANVAS)){this._renderCanvas(t)}else{throw new Error("RenderTexture does not support rendering via "+this._renderer.constructor.name)}}},{key:"_renderWebGL",value:function e(t){this._renderTarget.activate();t.getWorldTransform().reset();t.getChildren().forEach(function(e){e.updateTransform()});var r=this._renderer.getFilterManager();this._renderer.setFilterManager(this._filterManager);this._renderer.renderDisplayObject(t,this._renderTarget);this._renderer.setFilterManager(r)}},{key:"_renderCanvas",value:function e(t){t.getWorldTransform().reset();t.getChildren().forEach(function(e){e.updateTransform()});var r=this._renderer.getFilterManager();this._renderer.setFilterManager(this._filterManager);this._renderer.renderDisplayObject(t,this._renderTarget);this._renderer.setFilterManager(r)}},{key:"getRenderTarget",value:function e(){return this._renderTarget}},{key:"dispose",value:function e(){this._renderTarget.dispose();this._filterManager.dispose()}}]);return t}(h["a"]);t["a"]=T},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(9);var h=r(133);var p=r(223);var v=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function d(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function y(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function _(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var g=function(e){_(t,e);function t(e){d(this,t);var r=y(this,(t.__proto__||f()(t)).call(this));r._onTextureUpdate=r._onTextureUpdate.bind(r);r._texture=e;r._shader=null;r._width=0;r._height=0;r._anchor=new c["k"](0,0);r.setTexture(e);return r}v(t,[{key:"_onTextureUpdate",value:function e(){this._boundsNeedUpdate=true;this._localBoundsNeedUpdate=true}},{key:"_renderWebGL",value:function e(t){var r=t.save();if(this._smoothDownscaling){if(!this._potRenderer){this._potRenderer=new p["a"]}this._potRenderer.render(t,this,this._texture)}t.restore(r);t.setObjectRenderer(t.renderers.sprite);t.renderers.sprite.render(this)}},{key:"_renderCanvas",value:function e(t){var r=this._worldTransform;var n=this._texture.getFrame();var i=n.width,a=n.height;var o=t.getCurrentRenderTarget().getPixelRatio();var s=this._anchor.x*-i|0;var u=this._anchor.y*-a|0;var l=t.getContext();l.setTransform(r.a,r.b,r.c,r.d,r.tx*o,r.ty*o);l.globalAlpha=this.getWorldAlpha();var f=this._texture.getBaseTexture();var c=f.getPixelRatio();var h=f.getSource();l.drawImage(this._texture.getBaseTexture().getSource(),0,0,(h.naturalWidth||i)*c,(h.naturalHeight||a)*c,s*o,u*o,i*o,a*o)}},{key:"isAtPosition",value:function e(t){var r=this._worldTransform.applyInverseToVector(t);var n=this._texture.getFrame();var i=n.width,a=n.height;var o=new c["k"](-i,-a);o.multiply(this._anchor);var s=o.clone().add(i,a);if(r.x<o.x||r.x>s.x||r.y<o.y||r.y>s.y){return false}return true}},{key:"getLocalBounds",value:function e(){if(this._localBoundsNeedUpdate){var t=this._localBounds;var r=this._texture.getFrame();t.x=-r.width*this._anchor.x;t.y=-r.height*this._anchor.y;t.width=r.width;t.height=r.height;this._localBoundsNeedUpdate=false}return this._localBounds.clone()}},{key:"getBounds",value:function e(){if(this._boundsNeedUpdate){var t=this._bounds;var r=this._texture.getFrame();var n=this._worldTransform;var i=this._anchor;var a=n.rectangleToCoordinates(r,i);var o=a[0].x;var s=a[0].y;var u=o;var l=s;a.forEach(function(e){var t=e.x,r=e.y;o=Math.min(o,t);s=Math.min(s,r);u=Math.max(u,t);l=Math.max(l,r)});t.x=o;t.width=Math.abs(u-o);t.y=s;t.height=Math.abs(l-s);this._boundsNeedUpdate=false}return this._bounds.clone()}},{key:"getTexture",value:function e(){return this._texture}},{key:"clearTexture",value:function e(){if(!this._texture){return}this._texture.off("update",this._onTextureUpdate);this._texture.dispose();this._texture=null;if(this._potRenderer){this._potRenderer.dispose();this._potRenderer=null}}},{key:"setTexture",value:function e(t){if(!t){return}if(this._texture){this._texture.off("update",this._onTextureUpdate)}if(this._potRenderer){this._potRenderer.getRenderTexture().getBaseTexture().setDirty(true)}this._texture=t;if(t.getBaseTexture().isLoaded()){this._onTextureUpdate()}t.on("update",this._onTextureUpdate)}},{key:"getShader",value:function e(){return this._shader}},{key:"setShader",value:function e(t){this._shader=t}},{key:"getWidth",value:function e(){return this._width}},{key:"setWidth",value:function e(t){this._scale.x=t/this._texture.getFrame().width;this._width=t;this._boundsNeedUpdate=true;this._localBoundsNeedUpdate=true}},{key:"getHeight",value:function e(){return this._height}},{key:"setHeight",value:function e(t){this._scale.y=t/this._texture.getFrame().height;this._height=t;this._boundsNeedUpdate=true;this._localBoundsNeedUpdate=true}},{key:"getDimensions",value:function e(){return new c["k"](this._width,this._height)}},{key:"getAnchor",value:function e(){return this._anchor}},{key:"setAnchor",value:function e(t,r){if(t instanceof c["k"]){this._anchor.copy(t)}else{this._anchor.set(t,r)}this._boundsNeedUpdate=true;this._localBoundsNeedUpdate=true}},{key:"isSmoothDownscaling",value:function e(){return this._smoothDownscaling}},{key:"setSmoothDownscaling",value:function e(t){this._smoothDownscaling=t}},{key:"dispose",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(this._texture){this._texture.off("update",this._onTextureUpdate)}(t||r)&&this._texture.dispose(r);if(this._potRenderer){this._potRenderer.dispose()}}}]);return t}(h["a"]);t["a"]=g},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(40);var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function s(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var u=function(){function e(){s(this,e);this._container=new a["Engine"].Container;this._sprite=new a["Engine"].Sprite;this._container.addChild(this._sprite)}o(e,[{key:"render",value:function e(t,r,n){var i=n.getDimensions();var o=this._getNextHighestPOT(i);if(!this._renderTexture){this._renderTexture=new a["Engine"].RenderTexture(t,o.x,o.y)}else{this._renderTexture.resizeTo(o)}var s=this._renderTexture.getDimensions();this._sprite.setTexture(n);this._sprite.updateTransform();this._renderTexture.clear();this._renderTexture.render(this._container);this._updateSprite(t,r,i,s)}},{key:"_updateSprite",value:function e(t,r,n,i){r.setTexture(this._renderTexture);this._renderTexture.setFrame(new a["Rectangle"](0,0,n.x,n.y))}},{key:"_getNextHighestPOT",value:function e(t){return new a["Vector2"](a["Utils"].nextHighestPOT(t.x),a["Utils"].nextHighestPOT(t.y))}},{key:"getRenderTexture",value:function e(){return this._renderTexture}},{key:"dispose",value:function e(){if(!this._renderTexture){return}this._renderTexture.dispose();this._renderTexture=null}}]);return e}();t["a"]=u},function(e,t,r){"use strict";var n=r(96);t["a"]={TextureShader:n["a"]}},function(e,t,r){e.exports={default:r(226),__esModule:true}},function(e,t,r){r(227);e.exports=r(10).setImmediate},function(e,t,r){var n=r(13);var i=r(92);n(n.G+n.B,{setImmediate:i.set,clearImmediate:i.clear})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=r(229);r.d(t,"UnpremultiplyFilter",function(){return n["a"]});var i=r(231);r.d(t,"ColorOverlayFilter",function(){return i["a"]});var a=r(233);r.d(t,"TintFilter",function(){return a["a"]});var o=r(235);r.d(t,"OverlayFilter",function(){return o["a"]})},function(e,t,r){"use strict";var n=r(2);var i=r.n(n);var a=r(3);var o=r.n(a);var s=r(1);var u=r.n(s);var l=r(54);function f(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function c(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function h(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=o()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)i.a?i()(e,t):e.__proto__=t}var p=function(e){h(t,e);function t(){f(this,t);var e=c(this,(t.__proto__||u()(t)).call(this));e._fragmentSource=r(230);return e}return t}(l["a"]);t["a"]=p},function(e,t){e.exports="uniform sampler2D u_image;\nvarying vec2 v_texCoord;\nvarying vec4 v_color;\n\nvoid main() {\n vec4 color = texture2D(u_image, v_texCoord);\n gl_FragColor = vec4(color.a > 0. ? color.rgb / color.a : vec3(0), color.a);\n}\n"},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(9);var h=r(54);var p=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function v(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function d(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function y(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var _=c["c"].OptionType,g=c["c"].UniformType;var m=function(e){y(t,e);function t(){var e;v(this,t);for(var n=arguments.length,i=Array(n),a=0;a<n;a++){i[a]=arguments[a]}var o=d(this,(e=t.__proto__||f()(t)).call.apply(e,[this].concat(i)));o._fragmentSource=r(232);return o}p(t,[{key:"_applyCanvas",value:function e(t,r,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var a=r.getCanvas();var o=r.getContext();var s=n.getContext();var u=this._options.color;var l=o.getImageData(0,0,a.width,a.height);var f=s.getImageData(0,0,a.width,a.height);var h=a.width*a.height;var p=new c["b"];var v=new c["b"];for(var d=0;d<h*4;d+=4){p.set(l.data[d]/255,l.data[d+1]/255,l.data[d+2]/255,l.data[d+3]/255);v.set(f.data[d]/255,f.data[d+1]/255,f.data[d+2]/255,f.data[d+3]/255);var y=v.r+p.a*(p.r-v.r);f.data[d]=(y+p.a*(u.r-y))*255;var _=v.g+p.a*(p.g-v.g);f.data[d+1]=(_+p.a*(u.g-_))*255;var g=v.b+p.a*(p.b-v.b);f.data[d+2]=(g+p.a*(u.b-g))*255}s.putImageData(f,0,0)}}]);return t}(h["a"]);m.prototype.availableOptions={color:{type:_.COLOR,default:c["b"].WHITE,uniformType:g.FLOAT4}};t["a"]=m},function(e,t){e.exports="uniform sampler2D u_image;\nvarying vec2 v_texCoord;\nuniform vec4 u_color;\n\nvoid main() {\n vec4 color = texture2D(u_image, v_texCoord);\n gl_FragColor = vec4(mix(color.rgb, u_color.rgb, u_color.a), color.a) * color.a;\n}\n"},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(9);var h=r(54);var p=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function v(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function d(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function y(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var _=c["c"].OptionType,g=c["c"].UniformType;var m=function(e){y(t,e);function t(){var e;v(this,t);for(var n=arguments.length,i=Array(n),a=0;a<n;a++){i[a]=arguments[a]}var o=d(this,(e=t.__proto__||f()(t)).call.apply(e,[this].concat(i)));o._fragmentSource=r(234);return o}p(t,[{key:"_applyCanvas",value:function e(r,n,i){var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var o=n.getCanvas();var s=n.getContext();var u=i.getContext();var l=s.getImageData(0,0,o.width,o.height);var f=this._options,h=f.mode,p=f.color;var v=p.r,d=p.g,y=p.b,_=p.a;var g=[.2125,.7154,.0721];switch(h){case t.MODES.SOLID:for(var m=0;m<o.width*o.height;m++){var b=m*4;l.data[b]+=(v*255-l.data[b])*_;l.data[b+1]+=(d*255-l.data[b+1])*_;l.data[b+2]+=(y*255-l.data[b+2])*_}break;case t.MODES.COLORIZED:for(var w=0;w<o.width*o.height;w++){var x=w*4;var T=l.data[x]/255*g[0]+l.data[x+1]/255*g[1]+l.data[x+2]/255*g[2];var k=new c["b"](T*v,T*d,T*y);l.data[x]+=(k.r*255-l.data[x])*_;l.data[x+1]+=(k.g*255-l.data[x+1])*_;l.data[x+2]+=(k.b*255-l.data[x+2])*_}break}u.putImageData(l,0,0)}}]);return t}(h["a"]);m.MODES={NONE:0,SOLID:1,COLORIZED:2};m.prototype.availableOptions={color:{type:_.COLOR,default:c["b"].WHITE,uniformType:g.FLOAT4},mode:{type:_.NUMBER,default:m.MODES.NONE,uniformType:g.INT}};t["a"]=m},function(e,t){e.exports="uniform sampler2D u_image;\nvarying vec2 v_texCoord;\nuniform vec4 u_color;\nuniform int u_mode;\n\nvec3 W = vec3(0.2125, 0.7154, 0.0721);\n\nvoid main() {\n vec4 color = texture2D(u_image, v_texCoord);\n if (u_mode == 0) {\n gl_FragColor = color * color.a;\n } else if (u_mode == 1) {\n gl_FragColor = vec4(mix(color.rgb, u_color.rgb, u_color.a), color.a) * color.a;\n } else if (u_mode == 2) {\n float luminance = dot(color.rgb, W);\n vec3 colorized = vec3(luminance) * u_color.rgb;\n gl_FragColor = vec4(mix(color.rgb, colorized, u_color.a), color.a) * color.a;\n }\n}\n"},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(9);var h=r(54);var p=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function v(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function d(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function y(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var _=c["c"].OptionType,g=c["c"].UniformType;var m=1e-6;var b=function(e){y(t,e);function t(){var e;v(this,t);for(var n=arguments.length,i=Array(n),a=0;a<n;a++){i[a]=arguments[a]}var o=d(this,(e=t.__proto__||f()(t)).call.apply(e,[this].concat(i)));o._fragmentSource=r(236);o._lastImage=null;return o}p(t,[{key:"_applyCanvas",value:function e(r,n,i){var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var o=this._options.overlayTexture.getRenderTarget().getContext();var s=n.getCanvas();var u=n.getContext();var l=i.getContext();var f=u.getImageData(0,0,s.width,s.height);var h=o.getImageData(0,0,s.width,s.height);var p=this._options,v=p.blendMode,d=p.alpha;var y=new c["b"];var _=new c["b"];var g=new c["b"];for(var b=0;b<s.width*s.height*4;b+=4){y.set(f.data[b]/255,f.data[b+1]/255,f.data[b+2]/255,f.data[b+3]/255);_.set(h.data[b]/255,h.data[b+1]/255,h.data[b+2]/255,h.data[b+3]/255);var w=void 0,x=void 0,T=void 0;var k=void 0,R=void 0,E=void 0;var C=void 0,O=void 0,S=void 0;switch(v){case t.BLEND_MODES.NORMAL:g.set(y.r+_.a*d*(_.r-y.r),y.g+_.a*d*(_.g-y.g),y.b+_.a*d*(_.b-y.b),y.a);break;case t.BLEND_MODES.OVERLAY:w=1-2*(1-y.r)*(1-_.r);x=2*y.r*_.r;T=w+(y.r<.5?1:0)*(x-w);k=1-2*(1-y.g)*(1-_.g);R=2*y.g*_.g;E=k+(y.g<.5?1:0)*(R-k);C=1-2*(1-y.b)*(1-_.b);O=2*y.b*_.b;S=C+(y.b<.5?1:0)*(O-C);g.set(y.r+_.a*d*(T-y.r),y.g+_.a*d*(E-y.g),y.b+_.a*d*(S-y.b),y.a);break;case t.BLEND_MODES.HARD_LIGHT:w=1-2*(1-_.r)*(1-y.r);x=2*_.r*y.r;T=w+(_.r<.5?1:0)*(x-w);k=1-2*(1-_.g)*(1-y.g);R=2*_.g*y.g;E=k+(_.g<.5?1:0)*(R-k);C=1-2*(1-_.b)*(1-y.b);O=2*_.b*y.b;S=C+(_.b<.5?1:0)*(O-C);g.set(y.r+_.a*d*(T-y.r),y.g+_.a*d*(E-y.g),y.b+_.a*d*(S-y.b),y.a);break;case t.BLEND_MODES.SOFT_LIGHT:w=2*y.r*(1-_.r)+(2*_.r-1)*Math.sqrt(y.r);x=2*y.r*_.r+y.r*y.r*(1-2*_.r);T=w+(_.r<.5?1:0)*(x-w);k=2*y.g*(1-_.g)+(2*_.g-1)*Math.sqrt(y.g);R=2*y.g*_.g+y.g*y.g*(1-2*_.g);E=k+(_.g<.5?1:0)*(R-k);C=2*y.b*(1-_.b)+(2*_.b-1)*Math.sqrt(y.b);O=2*y.b*_.b+y.b*y.b*(1-2*_.b);S=C+(_.b<.5?1:0)*(O-C);g.set(y.r+_.a*d*(T-y.r),y.g+_.a*d*(E-y.g),y.b+_.a*d*(S-y.b),y.a);break;case t.BLEND_MODES.MULTIPLY:T=y.r*_.r;E=y.g*_.g;S=y.b*_.b;g.set(y.r+_.a*d*(T-y.r),y.g+_.a*d*(E-y.g),y.b+_.a*d*(S-y.b),y.a);break;case t.BLEND_MODES.DARKEN:T=Math.min(y.r,_.r);E=Math.min(y.g,_.g);S=Math.min(y.b,_.b);g.set(y.r+_.a*d*(T-y.r),y.g+_.a*d*(E-y.g),y.b+_.a*d*(S-y.b),y.a);break;case t.BLEND_MODES.LIGHTEN:T=Math.max(y.r,_.r);E=Math.max(y.g,_.g);S=Math.max(y.b,_.b);g.set(y.r+_.a*d*(T-y.r),y.g+_.a*d*(E-y.g),y.b+_.a*d*(S-y.b),y.a);break;case t.BLEND_MODES.SCREEN:T=1-(1-y.r)*(1-_.r);E=1-(1-y.g)*(1-_.g);S=1-(1-y.b)*(1-_.b);g.set(y.r+_.a*d*(T-y.r),y.g+_.a*d*(E-y.g),y.b+_.a*d*(S-y.b),y.a);break;case t.BLEND_MODES.COLOR_BURN:T=Math.max(0,Math.min(1,1-(1-y.r)/Math.max(_.r,m)));E=Math.max(0,Math.min(1,1-(1-y.g)/Math.max(_.g,m)));S=Math.max(0,Math.min(1,1-(1-y.b)/Math.max(_.b,m)));g.set(y.r+_.a*d*(T-y.r),y.g+_.a*d*(E-y.g),y.b+_.a*d*(S-y.b),y.a);break}f.data[b]=g.r*255;f.data[b+1]=g.g*255;f.data[b+2]=g.b*255;f.data[b+3]=g.a*255}l.putImageData(f,0,0)}}]);return t}(h["a"]);b.BLEND_MODES={NORMAL:0,OVERLAY:1,HARD_LIGHT:2,SOFT_LIGHT:3,MULTIPLY:4,DARKEN:5,LIGHTEN:6,SCREEN:7,COLOR_BURN:8};b.prototype.availableOptions={blendMode:{type:_.NUMBER,default:b.BLEND_MODES.NORMAL,uniformType:g.INT},overlayImage:{type:_.NUMBER,required:true,uniformType:g.SAMPLER2D},overlayTexture:{type:_.OBJECT,required:true},alpha:{type:_.NUMBER,default:1,uniformType:g.FLOAT}};t["a"]=b},function(e,t){e.exports="uniform sampler2D u_image;\nvarying vec2 v_texCoord;\nuniform sampler2D u_overlayImage;\nuniform int u_blendMode;\nuniform float u_alpha;\n\nconst float EPSILON = 0.000001;\n\nvec4 overlay(vec4 a, vec4 b) {\n vec3 result = mix(\n 1.0 - 2.0 * (1.0 - a.rgb) * (1.0 - b.rgb),\n 2.0 * a.rgb * b.rgb,\n vec3(a.r < 0.5, a.g < 0.5, a.b < 0.5)\n );\n return mix(a, vec4(result, a.a), u_alpha * b.a);\n}\n\nvec4 hardLight(vec4 b, vec4 a) {\n vec3 result = mix(\n 1.0 - 2.0 * (1.0 - a.rgb) * (1.0 - b.rgb),\n 2.0 * a.rgb * b.rgb,\n vec3(a.r < 0.5, a.g < 0.5, a.b < 0.5)\n );\n return mix(b, vec4(result, b.a), u_alpha * a.a);\n}\n\nvec4 softLight(vec4 a, vec4 b) {\n vec3 result = mix(\n 2.0 * a.rgb * (1.0 - b.rgb) + (2.0 * b.rgb - 1.0) * sqrt(a.rgb),\n 2.0 * a.rgb * b.rgb + a.rgb * a.rgb * (1.0 - 2.0 * b.rgb),\n vec3(b.r < 0.5, b.g < 0.5, b.b < 0.5)\n );\n return mix(a, vec4(result, a.a), u_alpha * b.a);\n}\n\nvec4 multiply(vec4 a, vec4 b) {\n vec3 result = a.rgb * b.rgb;\n return mix(a, vec4(result, a.a), u_alpha * b.a);\n}\n\nvec4 darken(vec4 a, vec4 b) {\n vec3 result = min(a.rgb, b.rgb);\n return mix(a, vec4(result, a.a), u_alpha * b.a);\n}\n\nvec4 lighten(vec4 a, vec4 b) {\n vec3 result = max(a.rgb, b.rgb);\n return mix(a, vec4(result, a.a), u_alpha * b.a);\n}\n\nvec4 screen(vec4 a, vec4 b) {\n vec3 result = 1.0 - (1.0 - a.rgb) * (1.0 - b.rgb);\n return mix(a, vec4(result, a.a), u_alpha * b.a);\n}\n\nvec4 colorBurn(vec4 a, vec4 b) {\n vec3 result = clamp(1.0 - (1.0 - a.rgb) / max(b.rgb, EPSILON), 0.0, 1.0);\n return mix(a, vec4(result, a.a), u_alpha * b.a);\n}\n\nvec4 normal(vec4 a, vec4 b) {\n return mix(a, vec4(b.rgb, a.a), 1.0);\n}\n\nvoid main() {\n vec4 color = texture2D(u_image, v_texCoord);\n vec4 overlayColor = texture2D(u_overlayImage, v_texCoord);\n\n vec4 resultColor;\n if (u_blendMode == 0) {\n resultColor = normal(color, overlayColor);\n } else if (u_blendMode == 1) {\n resultColor = overlay(color, overlayColor);\n } else if (u_blendMode == 2) {\n resultColor = hardLight(color, overlayColor);\n } else if (u_blendMode == 3) {\n resultColor = softLight(color, overlayColor);\n } else if (u_blendMode == 4) {\n resultColor = multiply(color, overlayColor);\n } else if (u_blendMode == 5) {\n resultColor = darken(color, overlayColor);\n } else if (u_blendMode == 6) {\n resultColor = lighten(color, overlayColor);\n } else if (u_blendMode == 7) {\n resultColor = screen(color, overlayColor);\n } else if (u_blendMode == 8) {\n resultColor = colorBurn(color, overlayColor);\n }\n gl_FragColor = vec4(resultColor.rgb * resultColor.a, resultColor.a);\n}\n"},function(e,t,r){"use strict";var n=r(35);var i=r.n(n);var a=r(39);var o=r.n(a);var s=r(0);var u=r.n(s);var l=r(29);var f=r.n(l);var c=r(22);var h=r(238);var p=r(50);var v=r(136);var d=r(246);var y=typeof o.a==="function"&&typeof i.a==="symbol"?function(e){return typeof e}:function(e){return e&&typeof o.a==="function"&&e.constructor===o.a&&e!==o.a.prototype?"symbol":typeof e};var _=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;u()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function g(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var m=function e(t){return c["a"].byteArrayToString(p["a"].decode(t))};function b(e){return e.map(function(e){return("0"+(e&255).toString(16)).slice(-2)}).join("")}var w="TDNSeVlXTnJQMkZ3YVV0bGVUMD0=";var x="ZW50ZXJwcmlzZV9saWNlbnNl";var T="YXBwX2lkZW50aWZpZXJz";var k="cGxhdGZvcm0=";var R="ZmVhdHVyZXM=";var E="ZXhwaXJlc19hdA==";var C="ZG9tYWlucw==";var O="YXBpX3Rva2Vu";var S="c2lnbmF0dXJl";var F=function(){function e(t){g(this,e);this._version="2.0";this._l=typeof t==="string"?t.trim():t;this._e=this._parseBigInt("65537",10);this._n=this._parseBigInt("6819840423824240913788063375448466721602926474225172236787752309"+"8336604672061187336820404073576669839528249293719278301686716477"+"3742859209434481353888637963692711665138989982680829529436715362"+"5667358136346796192740590402327288838945110996697754005565843294"+"3537572395130934093465857147866505940324185122919531106934589987"+"0108307225910988692123234379186643268583453907260879685992156955"+"9365611423142339833978193569371093431275044410769200884553375977"+"3647508667624675016897621976339835025479716831395476245954274644"+"0628077261880980924552698138857743609502132632199713575442848784"+"2713045032260453199916894132342284390445225837907138900931659124"+"5542868850746377306421632875326596323793099870689104267910598717"+"5588970202082466871461192706070321938250462103821558100761330890"+"2281356202089358012868786573841087212687618786944368951946284113"+"9745420290435157777150691674661228996405349021099034285740903017"+"9406810634136188751670648983222653319056818302012063874664196648"+"8681563056966446643621715425036653214559713359559486988289399487"+"8672019313267274977616291309200066795329980321640466408798804658"+"4107737900256954976744353601826341965438148646041640662195744770"+"5440947482959458441845074598088031149173011240880824583060864734"+"90516969815873631",10);this._parseLicense()}_(e,[{key:"v",value:function e(){return this._sigValid()&&!this.isExp()}},{key:"_jsonValid",value:function e(){try{this._decLic=JSON.parse(this._l)}catch(e){this._decLic={};return false}return true}},{key:"_hostnameValid",value:function e(){if(typeof window==="undefined")return true;if(!this._decLic[m(T)].length)return true;var t=window.location.hostname;var r=false;this._decLic[m(T)].forEach(function(e){if(c["a"].wildCardMatch(t,e)){r=true}});return r}},{key:"_platformValid",value:function e(){var t=this._decLic[m(k)];var r=false?"Server":"HTML5";return r===t}},{key:"c",value:function e(){var t=this;return new f.a(function(e,r){var n=y(t._l);if(n!=="string"||!t._jsonValid()){var i=new Error;i.code="ELICINVFMT";return r(i)}if(!t._sigValid()){var a=new Error;a.code="ELICINV";return r(a)}if(!t._hostnameValid()){var o=new Error;o.code="ELICINVHOST";return r(o)}if(!t._platformValid()){var s=new Error;s.code="ELICINVPLAT";return r(s)}if(t.isExp()){var u=new Error;u.code="ELICEXP";return r(u)}e()})}},{key:"isToolAllowed",value:function e(t){return this._decLic[m(R)]&&this._decLic[m(R)].indexOf(t)!==-1}},{key:"t",value:function e(){if(this._decLic.enterprise_license)return f.a.resolve();var t=this._decLic[m(C)][0]+m(m(w))+this._decLic[m(O)];var r=new v["a"](t);return r.load()}},{key:"isENT",value:function e(){if(!this._decLic)return false;return this._decLic[m(x)]}},{key:"_sigValid",value:function e(){return this._verify(this._message,this._sig)}},{key:"exp",value:function e(){return!!this._decLic[m(E)]}},{key:"dl",value:function e(){return Math.ceil((this._expAt()-Date.now())/(60*60*24*1e3))}},{key:"isExp",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:Date.now();if(this._decLic[m(E)]===null)return false;return t>this._expAt()}},{key:"_expAt",value:function e(){return this._decLic[m(E)]*1e3}},{key:"_verify",value:function e(t,r){var n=void 0;var i=void 0;i=this._encodeMessage(t);n=this._decodeSignature(r);n=n.substr(-64);var a=i===n;return a}},{key:"_encodeMessage",value:function e(t){var r=Object(d["a"])(t);return r}},{key:"_decodeSignature",value:function e(t){var r=void 0;t=p["a"].decode(t);t=b(t);t=this._parseBigInt(t,16);r=t.modPowInt(this._e,this._n);r=r.toString(16);return r}},{key:"_parseBigInt",value:function e(t,r){return new h["a"](t,r)}},{key:"_parseLicense",value:function e(){if(typeof this._l!=="string")return;if(!this._jsonValid())return;this._sig=this._decLic[m(S)]||"";delete this._decLic[m(S)];this._sig=this._sig.replace(/[^A-Za-z0-9+/=]/g,"");this._message=this._l.replace(new RegExp(',"'+m(S)+'":"([^"]*)"'),"")}}]);return e}();t["a"]=F},function(e,t,r){"use strict";var n=n||{};var i;var a=0xdeadbeefcafe;var o=(a&16777215)==15715070;function s(e,t,r){if(e!=null)if("number"==typeof e)this.fromNumber(e,t,r);else if(t==null&&"string"!=typeof e)this.fromString(e,256);else this.fromString(e,t)}function u(){return new s(null)}function l(e,t,r,n,i,a){while(--a>=0){var o=t*this[e++]+r[n]+i;i=Math.floor(o/67108864);r[n++]=o&67108863}return i}function f(e,t,r,n,i,a){var o=t&32767,s=t>>15;while(--a>=0){var u=this[e]&32767;var l=this[e++]>>15;var f=s*u+l*o;u=o*u+((f&32767)<<15)+r[n]+(i&1073741823);i=(u>>>30)+(f>>>15)+s*l+(i>>>30);r[n++]=u&1073741823}return i}function c(e,t,r,n,i,a){var o=t&16383,s=t>>14;while(--a>=0){var u=this[e]&16383;var l=this[e++]>>14;var f=s*u+l*o;u=o*u+((f&16383)<<14)+r[n]+i;i=(u>>28)+(f>>14)+s*l;r[n++]=u&268435455}return i}if(o&&n.appName=="Microsoft Internet Explorer"){s.prototype.am=f;i=30}else if(o&&n.appName!="Netscape"){s.prototype.am=l;i=26}else{s.prototype.am=c;i=28}s.prototype.DB=i;s.prototype.DM=(1<<i)-1;s.prototype.DV=1<<i;var h=52;s.prototype.FV=Math.pow(2,h);s.prototype.F1=h-i;s.prototype.F2=2*i-h;var p="0123456789abcdefghijklmnopqrstuvwxyz";var v=new Array;var d,y;d="0".charCodeAt(0);for(y=0;y<=9;++y){v[d++]=y}d="a".charCodeAt(0);for(y=10;y<36;++y){v[d++]=y}d="A".charCodeAt(0);for(y=10;y<36;++y){v[d++]=y}function _(e){return p.charAt(e)}function g(e,t){var r=v[e.charCodeAt(t)];return r==null?-1:r}function m(e){for(var t=this.t-1;t>=0;--t){e[t]=this[t]}e.t=this.t;e.s=this.s}function b(e){this.t=1;this.s=e<0?-1:0;if(e>0)this[0]=e;else if(e<-1)this[0]=e+this.DV;else this.t=0}function w(e){var t=u();t.fromInt(e);return t}function x(e,t){var r;if(t==16)r=4;else if(t==8)r=3;else if(t==256)r=8;else if(t==2)r=1;else if(t==32)r=5;else if(t==4)r=2;else{this.fromRadix(e,t);return}this.t=0;this.s=0;var n=e.length,i=false,a=0;while(--n>=0){var o=r==8?e[n]&255:g(e,n);if(o<0){if(e.charAt(n)=="-")i=true;continue}i=false;if(a==0)this[this.t++]=o;else if(a+r>this.DB){this[this.t-1]|=(o&(1<<this.DB-a)-1)<<a;this[this.t++]=o>>this.DB-a}else this[this.t-1]|=o<<a;a+=r;if(a>=this.DB)a-=this.DB}if(r==8&&(e[0]&128)!=0){this.s=-1;if(a>0)this[this.t-1]|=(1<<this.DB-a)-1<<a}this.clamp();if(i)s.ZERO.subTo(this,this)}function T(){var e=this.s&this.DM;while(this.t>0&&this[this.t-1]==e){--this.t}}function k(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(e==16)t=4;else if(e==8)t=3;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else return this.toRadix(e);var r=(1<<t)-1,n,i=false,a="",o=this.t;var s=this.DB-o*this.DB%t;if(o-- >0){if(s<this.DB&&(n=this[o]>>s)>0){i=true;a=_(n)}while(o>=0){if(s<t){n=(this[o]&(1<<s)-1)<<t-s;n|=this[--o]>>(s+=this.DB-t)}else{n=this[o]>>(s-=t)&r;if(s<=0){s+=this.DB;--o}}if(n>0)i=true;if(i)a+=_(n)}}return i?a:"0"}function R(){var e=u();s.ZERO.subTo(this,e);return e}function E(){return this.s<0?this.negate():this}function C(e){var t=this.s-e.s;if(t!=0)return t;var r=this.t;t=r-e.t;if(t!=0)return this.s<0?-t:t;while(--r>=0){if((t=this[r]-e[r])!=0)return t}return 0}function O(e){var t=1,r;if((r=e>>>16)!=0){e=r;t+=16}if((r=e>>8)!=0){e=r;t+=8}if((r=e>>4)!=0){e=r;t+=4}if((r=e>>2)!=0){e=r;t+=2}if((r=e>>1)!=0){e=r;t+=1}return t}function S(){if(this.t<=0)return 0;return this.DB*(this.t-1)+O(this[this.t-1]^this.s&this.DM)}function F(e,t){var r;for(r=this.t-1;r>=0;--r){t[r+e]=this[r]}for(r=e-1;r>=0;--r){t[r]=0}t.t=this.t+e;t.s=this.s}function I(e,t){for(var r=e;r<this.t;++r){t[r-e]=this[r]}t.t=Math.max(this.t-e,0);t.s=this.s}function A(e,t){var r=e%this.DB;var n=this.DB-r;var i=(1<<n)-1;var a=Math.floor(e/this.DB),o=this.s<<r&this.DM,s;for(s=this.t-1;s>=0;--s){t[s+a+1]=this[s]>>n|o;o=(this[s]&i)<<r}for(s=a-1;s>=0;--s){t[s]=0}t[a]=o;t.t=this.t+a+1;t.s=this.s;t.clamp()}function M(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t){t.t=0;return}var n=e%this.DB;var i=this.DB-n;var a=(1<<n)-1;t[0]=this[r]>>n;for(var o=r+1;o<this.t;++o){t[o-r-1]|=(this[o]&a)<<i;t[o-r]=this[o]>>n}if(n>0)t[this.t-r-1]|=(this.s&a)<<i;t.t=this.t-r;t.clamp()}function D(e,t){var r=0,n=0,i=Math.min(e.t,this.t);while(r<i){n+=this[r]-e[r];t[r++]=n&this.DM;n>>=this.DB}if(e.t<this.t){n-=e.s;while(r<this.t){n+=this[r];t[r++]=n&this.DM;n>>=this.DB}n+=this.s}else{n+=this.s;while(r<e.t){n-=e[r];t[r++]=n&this.DM;n>>=this.DB}n-=e.s}t.s=n<0?-1:0;if(n<-1)t[r++]=this.DV+n;else if(n>0)t[r++]=n;t.t=r;t.clamp()}function L(e,t){var r=this.abs(),n=e.abs();var i=r.t;t.t=i+n.t;while(--i>=0){t[i]=0}for(i=0;i<n.t;++i){t[i+r.t]=r.am(0,n[i],t,i,0,r.t)}t.s=0;t.clamp();if(this.s!=e.s)s.ZERO.subTo(t,t)}function B(e){var t=this.abs();var r=e.t=2*t.t;while(--r>=0){e[r]=0}for(r=0;r<t.t-1;++r){var n=t.am(r,t[r],e,2*r,0,1);if((e[r+t.t]+=t.am(r+1,2*t[r],e,2*r+1,n,t.t-r-1))>=t.DV){e[r+t.t]-=t.DV;e[r+t.t+1]=1}}if(e.t>0)e[e.t-1]+=t.am(r,t[r],e,2*r,0,1);e.s=0;e.clamp()}function P(e,t,r){var n=e.abs();if(n.t<=0)return;var i=this.abs();if(i.t<n.t){if(t!=null)t.fromInt(0);if(r!=null)this.copyTo(r);return}if(r==null)r=u();var a=u(),o=this.s,l=e.s;var f=this.DB-O(n[n.t-1]);if(f>0){n.lShiftTo(f,a);i.lShiftTo(f,r)}else{n.copyTo(a);i.copyTo(r)}var c=a.t;var h=a[c-1];if(h==0)return;var p=h*(1<<this.F1)+(c>1?a[c-2]>>this.F2:0);var v=this.FV/p,d=(1<<this.F1)/p,y=1<<this.F2;var _=r.t,g=_-c,m=t==null?u():t;a.dlShiftTo(g,m);if(r.compareTo(m)>=0){r[r.t++]=1;r.subTo(m,r)}s.ONE.dlShiftTo(c,m);m.subTo(a,a);while(a.t<c){a[a.t++]=0}while(--g>=0){var b=r[--_]==h?this.DM:Math.floor(r[_]*v+(r[_-1]+y)*d);if((r[_]+=a.am(0,b,r,g,0,c))<b){a.dlShiftTo(g,m);r.subTo(m,r);while(r[_]<--b){r.subTo(m,r)}}}if(t!=null){r.drShiftTo(c,t);if(o!=l)s.ZERO.subTo(t,t)}r.t=c;r.clamp();if(f>0)r.rShiftTo(f,r);if(o<0)s.ZERO.subTo(r,r)}function U(e){var t=u();this.abs().divRemTo(e,null,t);if(this.s<0&&t.compareTo(s.ZERO)>0)e.subTo(t,t);return t}function N(e){this.m=e}function j(e){if(e.s<0||e.compareTo(this.m)>=0)return e.mod(this.m);else return e}function z(e){return e}function G(e){e.divRemTo(this.m,null,e)}function V(e,t,r){e.multiplyTo(t,r);this.reduce(r)}function W(e,t){e.squareTo(t);this.reduce(t)}N.prototype.convert=j;N.prototype.revert=z;N.prototype.reduce=G;N.prototype.mulTo=V;N.prototype.sqrTo=W;function H(){if(this.t<1)return 0;var e=this[0];if((e&1)==0)return 0;var t=e&3;t=t*(2-(e&15)*t)&15;t=t*(2-(e&255)*t)&255;t=t*(2-((e&65535)*t&65535))&65535;t=t*(2-e*t%this.DV)%this.DV;return t>0?this.DV-t:-t}function q(e){this.m=e;this.mp=e.invDigit();this.mpl=this.mp&32767;this.mph=this.mp>>15;this.um=(1<<e.DB-15)-1;this.mt2=2*e.t}function Y(e){var t=u();e.abs().dlShiftTo(this.m.t,t);t.divRemTo(this.m,null,t);if(e.s<0&&t.compareTo(s.ZERO)>0)this.m.subTo(t,t);return t}function X(e){var t=u();e.copyTo(t);this.reduce(t);return t}function J(e){while(e.t<=this.mt2){e[e.t++]=0}for(var t=0;t<this.m.t;++t){var r=e[t]&32767;var n=r*this.mpl+((r*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;r=t+this.m.t;e[r]+=this.m.am(0,n,e,t,0,this.m.t);while(e[r]>=e.DV){e[r]-=e.DV;e[++r]++}}e.clamp();e.drShiftTo(this.m.t,e);if(e.compareTo(this.m)>=0)e.subTo(this.m,e)}function Z(e,t){e.squareTo(t);this.reduce(t)}function K(e,t,r){e.multiplyTo(t,r);this.reduce(r)}q.prototype.convert=Y;q.prototype.revert=X;q.prototype.reduce=J;q.prototype.mulTo=K;q.prototype.sqrTo=Z;function Q(){return(this.t>0?this[0]&1:this.s)==0}function $(e,t){if(e>4294967295||e<1)return s.ONE;var r=u(),n=u(),i=t.convert(this),a=O(e)-1;i.copyTo(r);while(--a>=0){t.sqrTo(r,n);if((e&1<<a)>0)t.mulTo(n,i,r);else{var o=r;r=n;n=o}}return t.revert(r)}function ee(e,t){var r;if(e<256||t.isEven())r=new N(t);else r=new q(t);return this.exp(e,r)}s.prototype.copyTo=m;s.prototype.fromInt=b;s.prototype.fromString=x;s.prototype.clamp=T;s.prototype.dlShiftTo=F;s.prototype.drShiftTo=I;s.prototype.lShiftTo=A;s.prototype.rShiftTo=M;s.prototype.subTo=D;s.prototype.multiplyTo=L;s.prototype.squareTo=B;s.prototype.divRemTo=P;s.prototype.invDigit=H;s.prototype.isEven=Q;s.prototype.exp=$;s.prototype.toString=k;s.prototype.negate=R;s.prototype.abs=E;s.prototype.compareTo=C;s.prototype.bitLength=S;s.prototype.mod=U;s.prototype.modPowInt=ee;s.ZERO=w(0);s.ONE=w(1);function te(){var e=u();this.copyTo(e);return e}function re(){if(this.s<0){if(this.t==1)return this[0]-this.DV;else if(this.t==0)return-1}else if(this.t==1)return this[0];else if(this.t==0)return 0;return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function ne(){return this.t==0?this.s:this[0]<<24>>24}function ie(){return this.t==0?this.s:this[0]<<16>>16}function ae(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function oe(){if(this.s<0)return-1;else if(this.t<=0||this.t==1&&this[0]<=0)return 0;else return 1}function se(e){if(e==null)e=10;if(this.signum()==0||e<2||e>36)return"0";var t=this.chunkSize(e);var r=Math.pow(e,t);var n=w(r),i=u(),a=u(),o="";this.divRemTo(n,i,a);while(i.signum()>0){o=(r+a.intValue()).toString(e).substr(1)+o;i.divRemTo(n,i,a)}return a.intValue().toString(e)+o}function ue(e,t){this.fromInt(0);if(t==null)t=10;var r=this.chunkSize(t);var n=Math.pow(t,r),i=false,a=0,o=0;for(var u=0;u<e.length;++u){var l=g(e,u);if(l<0){if(e.charAt(u)=="-"&&this.signum()==0)i=true;continue}o=t*o+l;if(++a>=r){this.dMultiply(n);this.dAddOffset(o,0);a=0;o=0}}if(a>0){this.dMultiply(Math.pow(t,a));this.dAddOffset(o,0)}if(i)s.ZERO.subTo(this,this)}function le(e,t,r){if("number"==typeof t){if(e<2)this.fromInt(1);else{this.fromNumber(e,r);if(!this.testBit(e-1))this.bitwiseTo(s.ONE.shiftLeft(e-1),_e,this);if(this.isEven())this.dAddOffset(1,0);while(!this.isProbablePrime(t)){this.dAddOffset(2,0);if(this.bitLength()>e)this.subTo(s.ONE.shiftLeft(e-1),this)}}}else{var n=new Array,i=e&7;n.length=(e>>3)+1;t.nextBytes(n);if(i>0)n[0]&=(1<<i)-1;else n[0]=0;this.fromString(n,256)}}function fe(){var e=this.t,t=new Array;t[0]=this.s;var r=this.DB-e*this.DB%8,n,i=0;if(e-- >0){if(r<this.DB&&(n=this[e]>>r)!=(this.s&this.DM)>>r)t[i++]=n|this.s<<this.DB-r;while(e>=0){if(r<8){n=(this[e]&(1<<r)-1)<<8-r;n|=this[--e]>>(r+=this.DB-8)}else{n=this[e]>>(r-=8)&255;if(r<=0){r+=this.DB;--e}}if((n&128)!=0)n|=-256;if(i==0&&(this.s&128)!=(n&128))++i;if(i>0||n!=this.s)t[i++]=n}}return t}function ce(e){return this.compareTo(e)==0}function he(e){return this.compareTo(e)<0?this:e}function pe(e){return this.compareTo(e)>0?this:e}function ve(e,t,r){var n,i,a=Math.min(e.t,this.t);for(n=0;n<a;++n){r[n]=t(this[n],e[n])}if(e.t<this.t){i=e.s&this.DM;for(n=a;n<this.t;++n){r[n]=t(this[n],i)}r.t=this.t}else{i=this.s&this.DM;for(n=a;n<e.t;++n){r[n]=t(i,e[n])}r.t=e.t}r.s=t(this.s,e.s);r.clamp()}function de(e,t){return e&t}function ye(e){var t=u();this.bitwiseTo(e,de,t);return t}function _e(e,t){return e|t}function ge(e){var t=u();this.bitwiseTo(e,_e,t);return t}function me(e,t){return e^t}function be(e){var t=u();this.bitwiseTo(e,me,t);return t}function we(e,t){return e&~t}function xe(e){var t=u();this.bitwiseTo(e,we,t);return t}function Te(){var e=u();for(var t=0;t<this.t;++t){e[t]=this.DM&~this[t]}e.t=this.t;e.s=~this.s;return e}function ke(e){var t=u();if(e<0)this.rShiftTo(-e,t);else this.lShiftTo(e,t);return t}function Re(e){var t=u();if(e<0)this.lShiftTo(-e,t);else this.rShiftTo(e,t);return t}function Ee(e){if(e==0)return-1;var t=0;if((e&65535)==0){e>>=16;t+=16}if((e&255)==0){e>>=8;t+=8}if((e&15)==0){e>>=4;t+=4}if((e&3)==0){e>>=2;t+=2}if((e&1)==0)++t;return t}function Ce(){for(var e=0;e<this.t;++e){if(this[e]!=0)return e*this.DB+Ee(this[e])}if(this.s<0)return this.t*this.DB;return-1}function Oe(e){var t=0;while(e!=0){e&=e-1;++t}return t}function Se(){var e=0,t=this.s&this.DM;for(var r=0;r<this.t;++r){e+=Oe(this[r]^t)}return e}function Fe(e){var t=Math.floor(e/this.DB);if(t>=this.t)return this.s!=0;return(this[t]&1<<e%this.DB)!=0}function Ie(e,t){var r=s.ONE.shiftLeft(e);this.bitwiseTo(r,t,r);return r}function Ae(e){return this.changeBit(e,_e)}function Me(e){return this.changeBit(e,we)}function De(e){return this.changeBit(e,me)}function Le(e,t){var r=0,n=0,i=Math.min(e.t,this.t);while(r<i){n+=this[r]+e[r];t[r++]=n&this.DM;n>>=this.DB}if(e.t<this.t){n+=e.s;while(r<this.t){n+=this[r];t[r++]=n&this.DM;n>>=this.DB}n+=this.s}else{n+=this.s;while(r<e.t){n+=e[r];t[r++]=n&this.DM;n>>=this.DB}n+=e.s}t.s=n<0?-1:0;if(n>0)t[r++]=n;else if(n<-1)t[r++]=this.DV+n;t.t=r;t.clamp()}function Be(e){var t=u();this.addTo(e,t);return t}function Pe(e){var t=u();this.subTo(e,t);return t}function Ue(e){var t=u();this.multiplyTo(e,t);return t}function Ne(){var e=u();this.squareTo(e);return e}function je(e){var t=u();this.divRemTo(e,t,null);return t}function ze(e){var t=u();this.divRemTo(e,null,t);return t}function Ge(e){var t=u(),r=u();this.divRemTo(e,t,r);return new Array(t,r)}function Ve(e){this[this.t]=this.am(0,e-1,this,0,0,this.t);++this.t;this.clamp()}function We(e,t){if(e==0)return;while(this.t<=t){this[this.t++]=0}this[t]+=e;while(this[t]>=this.DV){this[t]-=this.DV;if(++t>=this.t)this[this.t++]=0;++this[t]}}function He(){}function qe(e){return e}function Ye(e,t,r){e.multiplyTo(t,r)}function Xe(e,t){e.squareTo(t)}He.prototype.convert=qe;He.prototype.revert=qe;He.prototype.mulTo=Ye;He.prototype.sqrTo=Xe;function Je(e){return this.exp(e,new He)}function Ze(e,t,r){var n=Math.min(this.t+e.t,t);r.s=0;r.t=n;while(n>0){r[--n]=0}var i;for(i=r.t-this.t;n<i;++n){r[n+this.t]=this.am(0,e[n],r,n,0,this.t)}for(i=Math.min(e.t,t);n<i;++n){this.am(0,e[n],r,n,0,t-n)}r.clamp()}function Ke(e,t,r){--t;var n=r.t=this.t+e.t-t;r.s=0;while(--n>=0){r[n]=0}for(n=Math.max(t-this.t,0);n<e.t;++n){r[this.t+n-t]=this.am(t-n,e[n],r,0,0,this.t+n-t)}r.clamp();r.drShiftTo(1,r)}function Qe(e){this.r2=u();this.q3=u();s.ONE.dlShiftTo(2*e.t,this.r2);this.mu=this.r2.divide(e);this.m=e}function $e(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);else if(e.compareTo(this.m)<0)return e;else{var t=u();e.copyTo(t);this.reduce(t);return t}}function et(e){return e}function tt(e){e.drShiftTo(this.m.t-1,this.r2);if(e.t>this.m.t+1){e.t=this.m.t+1;e.clamp()}this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);while(e.compareTo(this.r2)<0){e.dAddOffset(1,this.m.t+1)}e.subTo(this.r2,e);while(e.compareTo(this.m)>=0){e.subTo(this.m,e)}}function rt(e,t){e.squareTo(t);this.reduce(t)}function nt(e,t,r){e.multiplyTo(t,r);this.reduce(r)}Qe.prototype.convert=$e;Qe.prototype.revert=et;Qe.prototype.reduce=tt;Qe.prototype.mulTo=nt;Qe.prototype.sqrTo=rt;function it(e,t){var r=e.bitLength(),n,i=w(1),a;if(r<=0)return i;else if(r<18)n=1;else if(r<48)n=3;else if(r<144)n=4;else if(r<768)n=5;else n=6;if(r<8)a=new N(t);else if(t.isEven())a=new Qe(t);else a=new q(t);var o=new Array,s=3,l=n-1,f=(1<<n)-1;o[1]=a.convert(this);if(n>1){var c=u();a.sqrTo(o[1],c);while(s<=f){o[s]=u();a.mulTo(c,o[s-2],o[s]);s+=2}}var h=e.t-1,p,v=true,d=u(),y;r=O(e[h])-1;while(h>=0){if(r>=l)p=e[h]>>r-l&f;else{p=(e[h]&(1<<r+1)-1)<<l-r;if(h>0)p|=e[h-1]>>this.DB+r-l}s=n;while((p&1)==0){p>>=1;--s}if((r-=s)<0){r+=this.DB;--h}if(v){o[p].copyTo(i);v=false}else{while(s>1){a.sqrTo(i,d);a.sqrTo(d,i);s-=2}if(s>0)a.sqrTo(i,d);else{y=i;i=d;d=y}a.mulTo(d,o[p],i)}while(h>=0&&(e[h]&1<<r)==0){a.sqrTo(i,d);y=i;i=d;d=y;if(--r<0){r=this.DB-1;--h}}}return a.revert(i)}function at(e){var t=this.s<0?this.negate():this.clone();var r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r;r=n}var i=t.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)return t;if(i<a)a=i;if(a>0){t.rShiftTo(a,t);r.rShiftTo(a,r)}while(t.signum()>0){if((i=t.getLowestSetBit())>0)t.rShiftTo(i,t);if((i=r.getLowestSetBit())>0)r.rShiftTo(i,r);if(t.compareTo(r)>=0){t.subTo(r,t);t.rShiftTo(1,t)}else{r.subTo(t,r);r.rShiftTo(1,r)}}if(a>0)r.lShiftTo(a,r);return r}function ot(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(t==0)r=this[0]%e;else for(var n=this.t-1;n>=0;--n){r=(t*r+this[n])%e}return r}function st(e){var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return s.ZERO;var r=e.clone(),n=this.clone();var i=w(1),a=w(0),o=w(0),u=w(1);while(r.signum()!=0){while(r.isEven()){r.rShiftTo(1,r);if(t){if(!i.isEven()||!a.isEven()){i.addTo(this,i);a.subTo(e,a)}i.rShiftTo(1,i)}else if(!a.isEven())a.subTo(e,a);a.rShiftTo(1,a)}while(n.isEven()){n.rShiftTo(1,n);if(t){if(!o.isEven()||!u.isEven()){o.addTo(this,o);u.subTo(e,u)}o.rShiftTo(1,o)}else if(!u.isEven())u.subTo(e,u);u.rShiftTo(1,u)}if(r.compareTo(n)>=0){r.subTo(n,r);if(t)i.subTo(o,i);a.subTo(u,a)}else{n.subTo(r,n);if(t)o.subTo(i,o);u.subTo(a,u)}}if(n.compareTo(s.ONE)!=0)return s.ZERO;if(u.compareTo(e)>=0)return u.subtract(e);if(u.signum()<0)u.addTo(e,u);else return u;if(u.signum()<0)return u.add(e);else return u}var ut=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997];var lt=(1<<26)/ut[ut.length-1];function ft(e){var t,r=this.abs();if(r.t==1&&r[0]<=ut[ut.length-1]){for(t=0;t<ut.length;++t){if(r[0]==ut[t])return true}return false}if(r.isEven())return false;t=1;while(t<ut.length){var n=ut[t],i=t+1;while(i<ut.length&&n<lt){n*=ut[i++]}n=r.modInt(n);while(t<i){if(n%ut[t++]==0)return false}}return r.millerRabin(e)}function ct(e){var t=this.subtract(s.ONE);var r=t.getLowestSetBit();if(r<=0)return false;var n=t.shiftRight(r);e=e+1>>1;if(e>ut.length)e=ut.length;var i=u();for(var a=0;a<e;++a){i.fromInt(ut[Math.floor(Math.random()*ut.length)]);var o=i.modPow(n,this);if(o.compareTo(s.ONE)!=0&&o.compareTo(t)!=0){var l=1;while(l++<r&&o.compareTo(t)!=0){o=o.modPowInt(2,this);if(o.compareTo(s.ONE)==0)return false}if(o.compareTo(t)!=0)return false}}return true}s.prototype.chunkSize=ae;s.prototype.toRadix=se;s.prototype.fromRadix=ue;s.prototype.fromNumber=le;s.prototype.bitwiseTo=ve;s.prototype.changeBit=Ie;s.prototype.addTo=Le;s.prototype.dMultiply=Ve;s.prototype.dAddOffset=We;s.prototype.multiplyLowerTo=Ze;s.prototype.multiplyUpperTo=Ke;s.prototype.modInt=ot;s.prototype.millerRabin=ct;s.prototype.clone=te;s.prototype.intValue=re;s.prototype.byteValue=ne;s.prototype.shortValue=ie;s.prototype.signum=oe;s.prototype.toByteArray=fe;s.prototype.equals=ce;s.prototype.min=he;s.prototype.max=pe;s.prototype.and=ye;s.prototype.or=ge;s.prototype.xor=be;s.prototype.andNot=xe;s.prototype.not=Te;s.prototype.shiftLeft=ke;s.prototype.shiftRight=Re;s.prototype.getLowestSetBit=Ce;s.prototype.bitCount=Se;s.prototype.testBit=Fe;s.prototype.setBit=Ae;s.prototype.clearBit=Me;s.prototype.flipBit=De;s.prototype.add=Be;s.prototype.subtract=Pe;s.prototype.multiply=Ue;s.prototype.divide=je;s.prototype.remainder=ze;s.prototype.divideAndRemainder=Ge;s.prototype.modPow=it;s.prototype.modInverse=st;s.prototype.pow=Je;s.prototype.gcd=at;s.prototype.isProbablePrime=ft;s.prototype.square=Ne;t["a"]=s},function(e,t,r){"use strict";var n=r(240);var i=r(242);t.parse=w;t.resolve=T;t.resolveObject=k;t.format=x;t.Url=a;function a(){this.protocol=null;this.slashes=null;this.auth=null;this.host=null;this.port=null;this.hostname=null;this.hash=null;this.search=null;this.query=null;this.pathname=null;this.path=null;this.href=null}var o=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,l=["<",">",'"',"`"," ","\r","\n","\t"],f=["{","}","|","\\","^","`"].concat(l),c=["'"].concat(f),h=["%","/","?",";","#"].concat(c),p=["/","?","#"],v=255,d=/^[+a-z0-9A-Z_-]{0,63}$/,y=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,_={javascript:true,"javascript:":true},g={javascript:true,"javascript:":true},m={http:true,https:true,ftp:true,gopher:true,file:true,"http:":true,"https:":true,"ftp:":true,"gopher:":true,"file:":true},b=r(243);function w(e,t,r){if(e&&i.isObject(e)&&e instanceof a)return e;var n=new a;n.parse(e,t,r);return n}a.prototype.parse=function(e,t,r){if(!i.isString(e)){throw new TypeError("Parameter 'url' must be a string, not "+typeof e)}var a=e.indexOf("?"),s=a!==-1&&a<e.indexOf("#")?"?":"#",l=e.split(s),f=/\\/g;l[0]=l[0].replace(f,"/");e=l.join(s);var w=e;w=w.trim();if(!r&&e.split("#").length===1){var x=u.exec(w);if(x){this.path=w;this.href=w;this.pathname=x[1];if(x[2]){this.search=x[2];if(t){this.query=b.parse(this.search.substr(1))}else{this.query=this.search.substr(1)}}else if(t){this.search="";this.query={}}return this}}var T=o.exec(w);if(T){T=T[0];var k=T.toLowerCase();this.protocol=k;w=w.substr(T.length)}if(r||T||w.match(/^\/\/[^@\/]+@[^@\/]+/)){var R=w.substr(0,2)==="//";if(R&&!(T&&g[T])){w=w.substr(2);this.slashes=true}}if(!g[T]&&(R||T&&!m[T])){var E=-1;for(var C=0;C<p.length;C++){var O=w.indexOf(p[C]);if(O!==-1&&(E===-1||O<E))E=O}var S,F;if(E===-1){F=w.lastIndexOf("@")}else{F=w.lastIndexOf("@",E)}if(F!==-1){S=w.slice(0,F);w=w.slice(F+1);this.auth=decodeURIComponent(S)}E=-1;for(var C=0;C<h.length;C++){var O=w.indexOf(h[C]);if(O!==-1&&(E===-1||O<E))E=O}if(E===-1)E=w.length;this.host=w.slice(0,E);w=w.slice(E);this.parseHost();this.hostname=this.hostname||"";var I=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!I){var A=this.hostname.split(/\./);for(var C=0,M=A.length;C<M;C++){var D=A[C];if(!D)continue;if(!D.match(d)){var L="";for(var B=0,P=D.length;B<P;B++){if(D.charCodeAt(B)>127){L+="x"}else{L+=D[B]}}if(!L.match(d)){var U=A.slice(0,C);var N=A.slice(C+1);var j=D.match(y);if(j){U.push(j[1]);N.unshift(j[2])}if(N.length){w="/"+N.join(".")+w}this.hostname=U.join(".");break}}}}if(this.hostname.length>v){this.hostname=""}else{this.hostname=this.hostname.toLowerCase()}if(!I){this.hostname=n.toASCII(this.hostname)}var z=this.port?":"+this.port:"";var G=this.hostname||"";this.host=G+z;this.href+=this.host;if(I){this.hostname=this.hostname.substr(1,this.hostname.length-2);if(w[0]!=="/"){w="/"+w}}}if(!_[k]){for(var C=0,M=c.length;C<M;C++){var V=c[C];if(w.indexOf(V)===-1)continue;var W=encodeURIComponent(V);if(W===V){W=escape(V)}w=w.split(V).join(W)}}var H=w.indexOf("#");if(H!==-1){this.hash=w.substr(H);w=w.slice(0,H)}var q=w.indexOf("?");if(q!==-1){this.search=w.substr(q);this.query=w.substr(q+1);if(t){this.query=b.parse(this.query)}w=w.slice(0,q)}else if(t){this.search="";this.query={}}if(w)this.pathname=w;if(m[k]&&this.hostname&&!this.pathname){this.pathname="/"}if(this.pathname||this.search){var z=this.pathname||"";var Y=this.search||"";this.path=z+Y}this.href=this.format();return this};function x(e){if(i.isString(e))e=w(e);if(!(e instanceof a))return a.prototype.format.call(e);return e.format()}a.prototype.format=function(){var e=this.auth||"";if(e){e=encodeURIComponent(e);e=e.replace(/%3A/i,":");e+="@"}var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",a=false,o="";if(this.host){a=e+this.host}else if(this.hostname){a=e+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]");if(this.port){a+=":"+this.port}}if(this.query&&i.isObject(this.query)&&Object.keys(this.query).length){o=b.stringify(this.query)}var s=this.search||o&&"?"+o||"";if(t&&t.substr(-1)!==":")t+=":";if(this.slashes||(!t||m[t])&&a!==false){a="//"+(a||"");if(r&&r.charAt(0)!=="/")r="/"+r}else if(!a){a=""}if(n&&n.charAt(0)!=="#")n="#"+n;if(s&&s.charAt(0)!=="?")s="?"+s;r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)});s=s.replace("#","%23");return t+a+r+s+n};function T(e,t){return w(e,false,true).resolve(t)}a.prototype.resolve=function(e){return this.resolveObject(w(e,false,true)).format()};function k(e,t){if(!e)return t;return w(e,false,true).resolveObject(t)}a.prototype.resolveObject=function(e){if(i.isString(e)){var t=new a;t.parse(e,false,true);e=t}var r=new a;var n=Object.keys(this);for(var o=0;o<n.length;o++){var s=n[o];r[s]=this[s]}r.hash=e.hash;if(e.href===""){r.href=r.format();return r}if(e.slashes&&!e.protocol){var u=Object.keys(e);for(var l=0;l<u.length;l++){var f=u[l];if(f!=="protocol")r[f]=e[f]}if(m[r.protocol]&&r.hostname&&!r.pathname){r.path=r.pathname="/"}r.href=r.format();return r}if(e.protocol&&e.protocol!==r.protocol){if(!m[e.protocol]){var c=Object.keys(e);for(var h=0;h<c.length;h++){var p=c[h];r[p]=e[p]}r.href=r.format();return r}r.protocol=e.protocol;if(!e.host&&!g[e.protocol]){var v=(e.pathname||"").split("/");while(v.length&&!(e.host=v.shift()));if(!e.host)e.host="";if(!e.hostname)e.hostname="";if(v[0]!=="")v.unshift("");if(v.length<2)v.unshift("");r.pathname=v.join("/")}else{r.pathname=e.pathname}r.search=e.search;r.query=e.query;r.host=e.host||"";r.auth=e.auth;r.hostname=e.hostname||e.host;r.port=e.port;if(r.pathname||r.search){var d=r.pathname||"";var y=r.search||"";r.path=d+y}r.slashes=r.slashes||e.slashes;r.href=r.format();return r}var _=r.pathname&&r.pathname.charAt(0)==="/",b=e.host||e.pathname&&e.pathname.charAt(0)==="/",w=b||_||r.host&&e.pathname,x=w,T=r.pathname&&r.pathname.split("/")||[],v=e.pathname&&e.pathname.split("/")||[],k=r.protocol&&!m[r.protocol];if(k){r.hostname="";r.port=null;if(r.host){if(T[0]==="")T[0]=r.host;else T.unshift(r.host)}r.host="";if(e.protocol){e.hostname=null;e.port=null;if(e.host){if(v[0]==="")v[0]=e.host;else v.unshift(e.host)}e.host=null}w=w&&(v[0]===""||T[0]==="")}if(b){r.host=e.host||e.host===""?e.host:r.host;r.hostname=e.hostname||e.hostname===""?e.hostname:r.hostname;r.search=e.search;r.query=e.query;T=v}else if(v.length){if(!T)T=[];T.pop();T=T.concat(v);r.search=e.search;r.query=e.query}else if(!i.isNullOrUndefined(e.search)){if(k){r.hostname=r.host=T.shift();var R=r.host&&r.host.indexOf("@")>0?r.host.split("@"):false;if(R){r.auth=R.shift();r.host=r.hostname=R.shift()}}r.search=e.search;r.query=e.query;if(!i.isNull(r.pathname)||!i.isNull(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.href=r.format();return r}if(!T.length){r.pathname=null;if(r.search){r.path="/"+r.search}else{r.path=null}r.href=r.format();return r}var E=T.slice(-1)[0];var C=(r.host||e.host||T.length>1)&&(E==="."||E==="..")||E==="";var O=0;for(var S=T.length;S>=0;S--){E=T[S];if(E==="."){T.splice(S,1)}else if(E===".."){T.splice(S,1);O++}else if(O){T.splice(S,1);O--}}if(!w&&!x){for(;O--;O){T.unshift("..")}}if(w&&T[0]!==""&&(!T[0]||T[0].charAt(0)!=="/")){T.unshift("")}if(C&&T.join("/").substr(-1)!=="/"){T.push("")}var F=T[0]===""||T[0]&&T[0].charAt(0)==="/";if(k){r.hostname=r.host=F?"":T.length?T.shift():"";var R=r.host&&r.host.indexOf("@")>0?r.host.split("@"):false;if(R){r.auth=R.shift();r.host=r.hostname=R.shift()}}w=w||r.host&&T.length;if(w&&!F){T.unshift("")}if(!T.length){r.pathname=null;r.path=null}else{r.pathname=T.join("/")}if(!i.isNull(r.pathname)||!i.isNull(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.auth=e.auth||r.auth;r.slashes=r.slashes||e.slashes;r.href=r.format();return r};a.prototype.parseHost=function(){var e=this.host;var t=s.exec(e);if(t){t=t[0];if(t!==":"){this.port=t.substr(1)}e=e.substr(0,e.length-t.length)}if(e)this.hostname=e}},function(e,t,r){(function(e,n){var i;(function(a){var o=typeof t=="object"&&t&&!t.nodeType&&t;var s=typeof e=="object"&&e&&!e.nodeType&&e;var u=typeof n=="object"&&n;if(u.global===u||u.window===u||u.self===u){a=u}var l,f=2147483647,c=36,h=1,p=26,v=38,d=700,y=72,_=128,g="-",m=/^xn--/,b=/[^\x20-\x7E]/,w=/[\x2E\u3002\uFF0E\uFF61]/g,x={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=c-h,k=Math.floor,R=String.fromCharCode,E;function C(e){throw new RangeError(x[e])}function O(e,t){var r=e.length;var n=[];while(r--){n[r]=t(e[r])}return n}function S(e,t){var r=e.split("@");var n="";if(r.length>1){n=r[0]+"@";e=r[1]}e=e.replace(w,".");var i=e.split(".");var a=O(i,t).join(".");return n+a}function F(e){var t=[],r=0,n=e.length,i,a;while(r<n){i=e.charCodeAt(r++);if(i>=55296&&i<=56319&&r<n){a=e.charCodeAt(r++);if((a&64512)==56320){t.push(((i&1023)<<10)+(a&1023)+65536)}else{t.push(i);r--}}else{t.push(i)}}return t}function I(e){return O(e,function(e){var t="";if(e>65535){e-=65536;t+=R(e>>>10&1023|55296);e=56320|e&1023}t+=R(e);return t}).join("")}function A(e){if(e-48<10){return e-22}if(e-65<26){return e-65}if(e-97<26){return e-97}return c}function M(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function D(e,t,r){var n=0;e=r?k(e/d):e>>1;e+=k(e/t);for(;e>T*p>>1;n+=c){e=k(e/T)}return k(n+(T+1)*e/(e+v))}function L(e){var t=[],r=e.length,n,i=0,a=_,o=y,s,u,l,v,d,m,b,w,x;s=e.lastIndexOf(g);if(s<0){s=0}for(u=0;u<s;++u){if(e.charCodeAt(u)>=128){C("not-basic")}t.push(e.charCodeAt(u))}for(l=s>0?s+1:0;l<r;){for(v=i,d=1,m=c;;m+=c){if(l>=r){C("invalid-input")}b=A(e.charCodeAt(l++));if(b>=c||b>k((f-i)/d)){C("overflow")}i+=b*d;w=m<=o?h:m>=o+p?p:m-o;if(b<w){break}x=c-w;if(d>k(f/x)){C("overflow")}d*=x}n=t.length+1;o=D(i-v,n,v==0);if(k(i/n)>f-a){C("overflow")}a+=k(i/n);i%=n;t.splice(i++,0,a)}return I(t)}function B(e){var t,r,n,i,a,o,s,u,l,v,d,m=[],b,w,x,T;e=F(e);b=e.length;t=_;r=0;a=y;for(o=0;o<b;++o){d=e[o];if(d<128){m.push(R(d))}}n=i=m.length;if(i){m.push(g)}while(n<b){for(s=f,o=0;o<b;++o){d=e[o];if(d>=t&&d<s){s=d}}w=n+1;if(s-t>k((f-r)/w)){C("overflow")}r+=(s-t)*w;t=s;for(o=0;o<b;++o){d=e[o];if(d<t&&++r>f){C("overflow")}if(d==t){for(u=r,l=c;;l+=c){v=l<=a?h:l>=a+p?p:l-a;if(u<v){break}T=u-v;x=c-v;m.push(R(M(v+T%x,0)));u=k(T/x)}m.push(R(M(u,0)));a=D(r,w,n==i);r=0;++n}}++r;++t}return m.join("")}function P(e){return S(e,function(e){return m.test(e)?L(e.slice(4).toLowerCase()):e})}function U(e){return S(e,function(e){return b.test(e)?"xn--"+B(e):e})}l={version:"1.4.1",ucs2:{decode:F,encode:I},decode:L,encode:B,toASCII:U,toUnicode:P};if(true){!(i=function(){return l}.call(t,r,t,e),i!==undefined&&(e.exports=i))}else if(o&&s){if(e.exports==o){s.exports=l}else{for(E in l){l.hasOwnProperty(E)&&(o[E]=l[E])}}}else{a.punycode=l}})(this)}).call(t,r(241)(e),r(41))},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){e.deprecate=function(){};e.paths=[];if(!e.children)e.children=[];Object.defineProperty(e,"loaded",{enumerable:true,get:function(){return e.l}});Object.defineProperty(e,"id",{enumerable:true,get:function(){return e.i}});e.webpackPolyfill=1}return e}},function(e,t,r){"use strict";e.exports={isString:function(e){return typeof e==="string"},isObject:function(e){return typeof e==="object"&&e!==null},isNull:function(e){return e===null},isNullOrUndefined:function(e){return e==null}}},function(e,t,r){"use strict";t.decode=t.parse=r(244);t.encode=t.stringify=r(245)},function(e,t,r){"use strict";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,r,a){t=t||"&";r=r||"=";var o={};if(typeof e!=="string"||e.length===0){return o}var s=/\+/g;e=e.split(t);var u=1e3;if(a&&typeof a.maxKeys==="number"){u=a.maxKeys}var l=e.length;if(u>0&&l>u){l=u}for(var f=0;f<l;++f){var c=e[f].replace(s,"%20"),h=c.indexOf(r),p,v,d,y;if(h>=0){p=c.substr(0,h);v=c.substr(h+1)}else{p=c;v=""}d=decodeURIComponent(p);y=decodeURIComponent(v);if(!n(o,d)){o[d]=y}else if(i(o[d])){o[d].push(y)}else{o[d]=[o[d],y]}}return o};var i=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}},function(e,t,r){"use strict";var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,r,s){t=t||"&";r=r||"=";if(e===null){e=undefined}if(typeof e==="object"){return a(o(e),function(o){var s=encodeURIComponent(n(o))+r;if(i(e[o])){return a(e[o],function(e){return s+encodeURIComponent(n(e))}).join(t)}else{return s+encodeURIComponent(n(e[o]))}}).join(t)}if(!s)return"";return encodeURIComponent(n(s))+r+encodeURIComponent(n(e))};var i=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function a(e,t){if(e.map)return e.map(t);var r=[];for(var n=0;n<e.length;n++){r.push(t(e[n],n))}return r}var o=Object.keys||function(e){var t=[];for(var r in e){if(Object.prototype.hasOwnProperty.call(e,r))t.push(r)}return t}},function(e,t,r){"use strict";r.d(t,"a",function(){return n});function n(e){var t=8;var r=0;function n(e,t){var r=(e&65535)+(t&65535);var n=(e>>16)+(t>>16)+(r>>16);return n<<16|r&65535}function i(e,t){return e>>>t|e<<32-t}function a(e,t){return e>>>t}function o(e,t,r){return e&t^~e&r}function s(e,t,r){return e&t^e&r^t&r}function u(e){return i(e,2)^i(e,13)^i(e,22)}function l(e){return i(e,6)^i(e,11)^i(e,25)}function f(e){return i(e,7)^i(e,18)^a(e,3)}function c(e){return i(e,17)^i(e,19)^a(e,10)}function h(e,t){var r=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298);var i=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225);var a=new Array(64);var h,p,v,d,y,_,g,m,b,w;var x,T;e[t>>5]|=128<<24-t%32;e[(t+64>>9<<4)+15]=t;for(var b=0;b<e.length;b+=16){h=i[0];p=i[1];v=i[2];d=i[3];y=i[4];_=i[5];g=i[6];m=i[7];for(var w=0;w<64;w++){if(w<16)a[w]=e[w+b];else a[w]=n(n(n(c(a[w-2]),a[w-7]),f(a[w-15])),a[w-16]);x=n(n(n(n(m,l(y)),o(y,_,g)),r[w]),a[w]);T=n(u(h),s(h,p,v));m=g;g=_;_=y;y=n(d,x);d=v;v=p;p=h;h=n(x,T)}i[0]=n(h,i[0]);i[1]=n(p,i[1]);i[2]=n(v,i[2]);i[3]=n(d,i[3]);i[4]=n(y,i[4]);i[5]=n(_,i[5]);i[6]=n(g,i[6]);i[7]=n(m,i[7])}return i}function p(e){var r=Array();var n=(1<<t)-1;for(var i=0;i<e.length*t;i+=t){r[i>>5]|=(e.charCodeAt(i/t)&n)<<24-i%32}return r}function v(e){e=e.replace(/\r\n/g,"\n");var t="";for(var r=0;r<e.length;r++){var n=e.charCodeAt(r);if(n<128){t+=String.fromCharCode(n)}else if(n>127&&n<2048){t+=String.fromCharCode(n>>6|192);t+=String.fromCharCode(n&63|128)}else{t+=String.fromCharCode(n>>12|224);t+=String.fromCharCode(n>>6&63|128);t+=String.fromCharCode(n&63|128)}}return t}function d(e){var t=r?"0123456789ABCDEF":"0123456789abcdef";var n="";for(var i=0;i<e.length*4;i++){n+=t.charAt(e[i>>2]>>(3-i%4)*8+4&15)+t.charAt(e[i>>2]>>(3-i%4)*8&15)}return n}e=v(e);return d(h(p(e),e.length*t))}},function(e,t,r){"use strict";(function(e){r.d(t,"b",function(){return i});r.d(t,"a",function(){return a});var n=typeof window==="undefined"?e:window;var i=n.requestAnimationFrame;var a=n.cancelAnimationFrame;var o=0;var s=["ms","moz","webkit","o"];for(var u=0;u<s.length&&!i;++u){i=n[s[u]+"RequestAnimationFrame"];a=n[s[u]+"CancelAnimationFrame"]||n[s[u]+"CancelRequestAnimationFrame"]}if(i){i=i.bind(n)}if(a){a=a.bind(n)}if(!i){i=function e(t,r){var n=(new Date).getTime();var i=Math.max(0,16-(n-o));var a=setTimeout(function(){t(n+i)},i);o=n+i;return a}}if(!a){a=function e(t){clearTimeout(t)}}}).call(t,r(41))},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function o(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var s=function(){function e(t,r,n){o(this,e);this.x=t;this.y=r;this.z=n;if(typeof this.x==="undefined"){this.x=0}if(typeof this.y==="undefined"){this.y=0}if(typeof this.z==="undefined"){this.z=0}}a(e,[{key:"set",value:function e(t,r,n){this.x=t;this.y=r;this.z=n;return this}},{key:"clone",value:function t(){return new e(this.x,this.y,this.z)}},{key:"copy",value:function e(t){this.x=t.x;this.y=t.y;this.z=t.z;return this}},{key:"clamp",value:function t(r,n){var i=r!==null&&typeof r!=="undefined";var a=n!==null&&typeof n!=="undefined";if(!(r instanceof e)&&i){r=new e(r,r,r)}if(!(n instanceof e)&&a){n=new e(n,n,n)}if(i){this.x=Math.max(r.x,this.x);this.y=Math.max(r.y,this.y);this.z=Math.max(r.z,this.z)}if(a){this.x=Math.min(n.x,this.x);this.y=Math.min(n.y,this.y);this.z=Math.min(n.z,this.z)}return this}},{key:"divide",value:function t(r){if(r instanceof e){this.x/=r.x;this.y/=r.y;this.z/=r.z}else{this.x/=r;this.y/=r;this.z/=r}return this}},{key:"subtract",value:function t(r){if(r instanceof e){this.x-=r.x;this.y-=r.y;this.z-=r.z}else{this.x-=r;this.y-=r;this.z-=r}return this}},{key:"multiply",value:function t(r){if(r instanceof e){this.x*=r.x;this.y*=r.y;this.z*=r.z}else{this.x*=r;this.y*=r;this.z*=r}return this}},{key:"add",value:function t(r){if(r instanceof e){this.x+=r.x;this.y+=r.y;this.z+=r.z}else{this.x+=r;this.y+=r;this.z+=r}return this}},{key:"equals",value:function t(r){if(r instanceof e){return r.x===this.x&&r.y===this.y&&r.z===this.z}else{return r===this.x&&r===this.y&&r===this.z}}},{key:"round",value:function e(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);return this}},{key:"ceil",value:function e(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);return this}},{key:"floor",value:function e(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);return this}},{key:"fract",value:function e(){this.x=this.x%1;this.y=this.y%1;this.z=this.z%1;return this}},{key:"toInt",value:function e(){this.x=this.x|0;this.y=this.y|0;this.z=this.z|0;return this}},{key:"abs",value:function e(){this.x=Math.abs(this.x);this.y=Math.abs(this.y);this.z=Math.abs(this.z);return this}},{key:"len",value:function e(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}},{key:"min",value:function e(){return Math.min(Math.min(this.x,this.y),this.z)}},{key:"max",value:function e(){return Math.max(Math.max(this.x,this.y),this.z)}},{key:"toObject",value:function e(){return{x:this.x,y:this.y,z:this.z}}},{key:"toString",value:function e(){return"Vector3({ x: "+this.x+", y: "+this.y+", z: "+this.z+" })"}},{key:"roundDecimal",value:function e(t){this.x=parseFloat(this.x.toFixed(t));this.y=parseFloat(this.y.toFixed(t));this.z=parseFloat(this.z.toFixed(t));return this}}],[{key:"fromObject",value:function t(r){return new e(r.x,r.y,r.z)}},{key:"NULL",get:function t(){return new e(0,0,0)}}]);return e}();t["a"]=s},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(40);var h=r(32);var p=r(42);var v=r(139);var d=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function y(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function _(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function g(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var m=c["Constants"].OptionType;var b=function(e){g(t,e);function t(){y(this,t);return _(this,(t.__proto__||f()(t)).apply(this,arguments))}d(t,[{key:"_getRotation",value:function e(){var t=0;switch(this.getTags().Orientation){case 7:case 8:t=-90;break;case 3:case 4:t=-180;break;case 5:case 6:t=90;break}return t}},{key:"_getFlipVertically",value:function e(){var t=this.getTags(),r=t.Orientation;return[5,7].indexOf(r)!==-1}},{key:"_getFlipHorizontally",value:function e(){var t=this.getTags(),r=t.Orientation;return[2,4].indexOf(r)!==-1}},{key:"_getFinalOptions",value:function e(){return{rotation:this._getRotation(),flipVertically:this._getFlipVertically(),flipHorizontally:this._getFlipHorizontally()}}},{key:"_render",value:function e(t){var r=this._getFinalOptions();var n=r.rotation%360;var i=n*(Math.PI/180);this._sprite.setScale(r.flipHorizontally?-1:1,r.flipVertically?-1:1);this._sprite.setRotation(i);this._sprite.setAnchor(.5,.5);this._sprite.updateTransform();var a=this._sprite.getBounds();this._renderTexture.resizeTo(new p["a"](a.width,a.height));this._sprite.setPosition(this._renderTexture.getDimensions().divide(2));this._renderTexture.render(this._container);return h["a"].resolve()}},{key:"getNewDimensions",value:function e(t){var r=this._getFinalOptions();t=t.clone();if(r.rotation%180){t.flip()}return t}}]);return t}(v["a"]);b.identifier="exif-orientation";b.prototype.availableOptions={tags:{type:m.OBJECT,default:{}}};t["a"]=b},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(40);var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function s(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var u="imglySDKVersionCallback";var l="https://www.photoeditorsdk.com/version.json?sdk=html5&jsoncallback="+u;var f=function(){function e(t){s(this,e);this._version=t;this._check()}o(e,[{key:"_check",value:function e(){var t=this;if(typeof document==="undefined"){return a["Log"].info(this.constructor.name,"Not in browser environment. Version check skipped.")}var r=this;window[u]=function(e){if(e.outdated){a["Log"].warn(t.constructor.name,"Your Version "+r._version+" is outdated. Current version is "+e.version+".")}};var n=document.createElement("script");n.src=l+"&version="+this._version;n.async=true;document.getElementsByTagName("head")[0].appendChild(n)}}]);return e}();t["a"]=f},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(101);var o=r(102);var s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function u(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var l=o["a"].MARKERS;var f=function(){function e(t){u(this,e);this._buf=t;this._stream=new a["a"](this._buf);this._stream.setHead(0)}s(e,[{key:"isValid",value:function e(){this._stream.setHead(0);var t=this._stream.readInt16();if(t!==l.APP0){return false}var r=this._stream.readInt16();if(!(r>=16)){return false}var n=this._stream.readString(4);var i=this._stream.readInt8();if(!(n==="JFIF")){return false}if(!(i===0)){return false}return true}},{key:"setUnitDensity",value:function e(t){this._stream.setHead(11);this._stream.writeInt8(t)}},{key:"setDensityX",value:function e(t){this._stream.setHead(12);this._stream.writeInt16(t)}},{key:"setDensityY",value:function e(t){this._stream.setHead(13);this._stream.writeInt16(t)}},{key:"getUnitDensity",value:function e(){this._stream.setHead(11);return this._stream.readInt8()}},{key:"getDensityX",value:function e(){this._stream.setHead(12);return this._stream.readInt16()}},{key:"getDensityY",value:function e(){this._stream.setHead(14);return this._stream.readInt16()}}]);return e}();t["a"]=f},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(101);var o=r(102);var s=r(22);var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function l(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var f=s["a"].invariant;var c=o["a"].MARKERS,h=o["a"].EXIF_TAGS;var p=function(){function e(t){l(this,e);this._buf=t;this._stream=new a["a"](this._buf);this._stream.setHead(0);this._parse()}u(e,[{key:"isValid",value:function e(){this._stream.setHead(0);var t=this._stream.readInt16();if(t!==c.EXIF){return false}var r=this._stream.readInt16();if(!(r>0)){return false}var n=this._stream.readString(4);if(n!=="Exif"){return false}return true}},{key:"_parse",value:function e(){if(!this.isValid()){return}this._stream.setHead(10);var t=this._stream.getHead();var r=false;var n=this._stream.readInt16();if(n===18761){r=false}else if(n===19789){r=true}else{f(false,"Invalid TIFF data: No endian type found")}f(this._stream.readInt16(!r)===42,"Invalid TIFF data: No 0x002A");var i=this._stream.readInt32(!r);f(i>=8,"Invalid TIFF data: First IFD offset < 8");var a=t+i;var o=this._readTags(this._stream,t,a,r);this._tags=o.tags;this._tagData=o.tagData}},{key:"getTags",value:function e(){return this._tags}},{key:"getTagData",value:function e(){return this._tagData}},{key:"setOrientation",value:function e(t){if(this._tagData.Orientation){var r=this._tagData.Orientation.entryOffset;this._stream.setHead(r+8);this._stream.writeInt16(t)}}},{key:"_readTags",value:function e(t,r,n,i){t.setHead(n);var a=t.readInt16(!i);var o={};var s=[];for(var u=0;u<a;u++){var l=n+u*12+2;t.setHead(l);var f=t.readInt16(!i);var c=void 0;var p=void 0;var v=void 0;if(h[f]){f=h[f];c=t.readInt16(!i);p=t.readInt32(!i);v=t.readInt32(!i)+r;var d=null;switch(c){case 1:case 7:if(p===1){d=t.readInt8(!i)}else{d=[];for(var y=0;y<p;y++){d.push(t.readInt8(!i))}}break;case 2:t.setHead(p>4?v:l+8);d=t.readString(p);break;case 3:t.setHead(p>2?v:l+8);if(p===1){d=t.readInt16(!i)}else{d=[];for(var _=0;_<p;_++){d.push(t.readInt16(!i))}}break;case 4:case 9:t.setHead(p>1?v:l+8);if(p===1){d=t.readInt32(!i)}else{d=[];for(var g=0;g<p;g++){d.push(t.readInt32(!i))}}break;case 5:case 10:t.setHead(v);if(p===1){var m=t.readInt32(!i);var b=t.readInt32(!i);d=m/b}else{d=[];for(var w=0;w<p;w++){var x=t.readInt32(!i);var T=t.readInt32(!i);var k=x/T;d.push(k)}}break}o[f]=d;s[f]={value:d,numValues:p,entryOffset:l,valueOffset:v,type:c}}}return{tags:o,tagData:s}}},{key:"getBuffer",value:function e(){return this._buf}}]);return e}();t["a"]=p},function(e,t,r){"use strict";(function(e){var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(29);var f=r.n(l);var c=r(1);var h=r.n(c);var p=r(31);var v=r(68);var d=r(22);var y=r(74);var _=r(100);var g=r(55);var m=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function b(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function w(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function x(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var T=function(t){x(r,t);function r(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};b(this,r);var n=w(this,(r.__proto__||h()(r)).call(this,t));n._sdk=e;return n}m(r,[{key:"export",value:function t(){var r=this;var n=this._sdk.getRenderer();var i=this._options,a=i.renderType,o=i.imageFormat,s=i.quality;return this.validateSettings().then(function(){return r._prepareSDK()}).then(function(t){var i=n.getCanvas();if(n.isOfType(p["RendererType"].WEBGL)){i=r._createCanvasFromTexture(t)}var u=void 0;if(a===p["RenderType"].IMAGE||a===p["RenderType"].DATAURL){if(typeof window==="undefined"){u=i.toDataURL(o)}else{u=i.toDataURL(o,s)}var l=r._sdk.getImage();var c=_["a"].isJPEG(l.src);var h=_["a"].isJPEG(u);if(c&&h){var v=r._sdk.getExif();if(v){u=v.restoreSegments(u)}}}if(a===p["RenderType"].IMAGE){var d=void 0;d=new y["a"];d.src=u;return d}else if(a===p["RenderType"].DATAURL){return u}else if(a===p["RenderType"].BUFFER){switch(o){case p["ImageFormat"].JPEG:{var g=new f.a(function(t,r){var n=i.createJPEGStream({bufsize:2048,quality:s*100|0});var a=[];n.on("data",function(e){return a.push(e)});n.on("end",function(){return t(e.concat(a))})});return g}case p["ImageFormat"].PNG:{return f.a.resolve(i.toBuffer())}default:{return f.a.reject(new Error("Invalid ImageFormat: "+o))}}}else if(a===p["RenderType"].MSBLOB){return i.msToBlob()}else if(a===p["RenderType"].BLOB){return new f.a(function(e,t){i.toBlob(function(t){e(t)},o,s)})}}).then(function(e){return r._restoreSDK().then(function(){return e})})}},{key:"_prepareSDK",value:function e(){var t=this._sdk.getRenderer();this._sdkSettings={dimensions:t.getDimensions().clone(),textureQuality:this._sdk.getTextureQuality(),pixelRatio:this._sdk.getPixelRatio(),renderMode:this._sdk.getRenderMode()};this._sdk.setRenderMode("export");this._sdk.setTextureQuality(1);var r=t.isOfType(p["RendererType"].CANVAS);t.setPixelRatio(1);t.resizeTo(this._sdk.getFinalDimensions(),r);this._sdk.setAllOperationsToDirty(true);var n=this._sdk.getOperationsStack();n.forEach(function(e){e.disposeRenderTextures()});n.disableCache();return this._sdk.render()}},{key:"_restoreSDK",value:function e(){var t=this._sdk.getOperationsStack();t.enableCache();this._sdk.setRenderMode(this._sdkSettings.renderMode);var r=this._sdk.getRenderer();var n=r.isOfType(p["RendererType"].CANVAS);r.setPixelRatio(this._sdkSettings.pixelRatio);r.resizeTo(this._sdkSettings.dimensions,n);this._sdk.setTextureQuality(this._sdkSettings.textureQuality);this._sdk.setAllOperationsToDirty(true);return this._sdk.render()}},{key:"_createCanvasFromTexture",value:function e(t){var r=this._sdk.getRenderer();var n=this._sdk.getFinalDimensions();var i=this._sdk.getRenderer().getContext();var a=i.createFramebuffer();i.bindFramebuffer(i.FRAMEBUFFER,a);var o=t.getBaseTexture().getGLTextureForRenderer(r);i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,o,0);var s=new Uint8Array(n.x*n.y*4);i.readPixels(0,0,n.x,n.y,i.RGBA,i.UNSIGNED_BYTE,s);var u=this._checkPixelsForTransparency(s);var l=void 0;if(u){var f=new v["a"].Sprite(t);f.setFilters([new v["a"].Filters.UnpremultiplyFilter]);var c=new v["a"].Container;c.addChild(f);l=new v["a"].RenderTexture(r,n.x,n.y);l.render(c);var h=l.getBaseTexture().getGLTextureForRenderer(r);i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,h,0);i.readPixels(0,0,n.x,n.y,i.RGBA,i.UNSIGNED_BYTE,s);r.setRenderTarget();l.dispose()}var p=d["a"].createCanvas();p.width=n.x;p.height=n.y;var y=p.getContext("2d");var _=y.createImageData(n.x,n.y);_.data.set(s);y.putImageData(_,0,0);i.deleteFramebuffer(a);return p}},{key:"_checkPixelsForTransparency",value:function e(t){var r=this._sdk.getFinalDimensions();var n=r.x*r.y*4;var i=void 0;for(var a=3;a<n;a+=4){i=t[a];if(i!==255){return true}}return false}}]);return r}(g["a"]);T.prototype.availableOptions={renderType:{type:p["OptionType"].STRING,available:d["a"].values(p["RenderType"]),default:p["RenderType"].IMAGE},imageFormat:{type:p["OptionType"].STRING,available:d["a"].values(p["ImageFormat"]),default:p["ImageFormat"].PNG},quality:{type:p["OptionType"].NUMBER,default:.8}};t["a"]=T}).call(t,r(254).Buffer)},function(e,t,r){"use strict";(function(e){var n=r(255);var i=r(256);var a=r(257);t.Buffer=l;t.SlowBuffer=m;t.INSPECT_MAX_BYTES=50;l.TYPED_ARRAY_SUPPORT=e.TYPED_ARRAY_SUPPORT!==undefined?e.TYPED_ARRAY_SUPPORT:o();t.kMaxLength=s();function o(){try{var e=new Uint8Array(1);e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}};return e.foo()===42&&typeof e.subarray==="function"&&e.subarray(1,1).byteLength===0}catch(e){return false}}function s(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(e,t){if(s()<t){throw new RangeError("Invalid typed array length")}if(l.TYPED_ARRAY_SUPPORT){e=new Uint8Array(t);e.__proto__=l.prototype}else{if(e===null){e=new l(t)}e.length=t}return e}function l(e,t,r){if(!l.TYPED_ARRAY_SUPPORT&&!(this instanceof l)){return new l(e,t,r)}if(typeof e==="number"){if(typeof t==="string"){throw new Error("If encoding is specified then the first argument must be a string")}return p(this,e)}return f(this,e,t,r)}l.poolSize=8192;l._augment=function(e){e.__proto__=l.prototype;return e};function f(e,t,r,n){if(typeof t==="number"){throw new TypeError('"value" argument must not be a number')}if(typeof ArrayBuffer!=="undefined"&&t instanceof ArrayBuffer){return y(e,t,r,n)}if(typeof t==="string"){return v(e,t,r)}return _(e,t)}l.from=function(e,t,r){return f(null,e,t,r)};if(l.TYPED_ARRAY_SUPPORT){l.prototype.__proto__=Uint8Array.prototype;l.__proto__=Uint8Array;if(typeof Symbol!=="undefined"&&Symbol.species&&l[Symbol.species]===l){Object.defineProperty(l,Symbol.species,{value:null,configurable:true})}}function c(e){if(typeof e!=="number"){throw new TypeError('"size" argument must be a number')}else if(e<0){throw new RangeError('"size" argument must not be negative')}}function h(e,t,r,n){c(t);if(t<=0){return u(e,t)}if(r!==undefined){return typeof n==="string"?u(e,t).fill(r,n):u(e,t).fill(r)}return u(e,t)}l.alloc=function(e,t,r){return h(null,e,t,r)};function p(e,t){c(t);e=u(e,t<0?0:g(t)|0);if(!l.TYPED_ARRAY_SUPPORT){for(var r=0;r<t;++r){e[r]=0}}return e}l.allocUnsafe=function(e){return p(null,e)};l.allocUnsafeSlow=function(e){return p(null,e)};function v(e,t,r){if(typeof r!=="string"||r===""){r="utf8"}if(!l.isEncoding(r)){throw new TypeError('"encoding" must be a valid string encoding')}var n=b(t,r)|0;e=u(e,n);var i=e.write(t,r);if(i!==n){e=e.slice(0,i)}return e}function d(e,t){var r=t.length<0?0:g(t.length)|0;e=u(e,r);for(var n=0;n<r;n+=1){e[n]=t[n]&255}return e}function y(e,t,r,n){t.byteLength;if(r<0||t.byteLength<r){throw new RangeError("'offset' is out of bounds")}if(t.byteLength<r+(n||0)){throw new RangeError("'length' is out of bounds")}if(r===undefined&&n===undefined){t=new Uint8Array(t)}else if(n===undefined){t=new Uint8Array(t,r)}else{t=new Uint8Array(t,r,n)}if(l.TYPED_ARRAY_SUPPORT){e=t;e.__proto__=l.prototype}else{e=d(e,t)}return e}function _(e,t){if(l.isBuffer(t)){var r=g(t.length)|0;e=u(e,r);if(e.length===0){return e}t.copy(e,0,0,r);return e}if(t){if(typeof ArrayBuffer!=="undefined"&&t.buffer instanceof ArrayBuffer||"length"in t){if(typeof t.length!=="number"||te(t.length)){return u(e,0)}return d(e,t)}if(t.type==="Buffer"&&a(t.data)){return d(e,t.data)}}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function g(e){if(e>=s()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+s().toString(16)+" bytes")}return e|0}function m(e){if(+e!=e){e=0}return l.alloc(+e)}l.isBuffer=function e(t){return!!(t!=null&&t._isBuffer)};l.compare=function e(t,r){if(!l.isBuffer(t)||!l.isBuffer(r)){throw new TypeError("Arguments must be Buffers")}if(t===r)return 0;var n=t.length;var i=r.length;for(var a=0,o=Math.min(n,i);a<o;++a){if(t[a]!==r[a]){n=t[a];i=r[a];break}}if(n<i)return-1;if(i<n)return 1;return 0};l.isEncoding=function e(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return true;default:return false}};l.concat=function e(t,r){if(!a(t)){throw new TypeError('"list" argument must be an Array of Buffers')}if(t.length===0){return l.alloc(0)}var n;if(r===undefined){r=0;for(n=0;n<t.length;++n){r+=t[n].length}}var i=l.allocUnsafe(r);var o=0;for(n=0;n<t.length;++n){var s=t[n];if(!l.isBuffer(s)){throw new TypeError('"list" argument must be an Array of Buffers')}s.copy(i,o);o+=s.length}return i};function b(e,t){if(l.isBuffer(e)){return e.length}if(typeof ArrayBuffer!=="undefined"&&typeof ArrayBuffer.isView==="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)){return e.byteLength}if(typeof e!=="string"){e=""+e}var r=e.length;if(r===0)return 0;var n=false;for(;;){switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case undefined:return Z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return $(e).length;default:if(n)return Z(e).length;t=(""+t).toLowerCase();n=true}}}l.byteLength=b;function w(e,t,r){var n=false;if(t===undefined||t<0){t=0}if(t>this.length){return""}if(r===undefined||r>this.length){r=this.length}if(r<=0){return""}r>>>=0;t>>>=0;if(r<=t){return""}if(!e)e="utf8";while(true){switch(e){case"hex":return P(this,t,r);case"utf8":case"utf-8":return A(this,t,r);case"ascii":return L(this,t,r);case"latin1":case"binary":return B(this,t,r);case"base64":return I(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();n=true}}}l.prototype._isBuffer=true;function x(e,t,r){var n=e[t];e[t]=e[r];e[r]=n}l.prototype.swap16=function e(){var t=this.length;if(t%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(var r=0;r<t;r+=2){x(this,r,r+1)}return this};l.prototype.swap32=function e(){var t=this.length;if(t%4!==0){throw new RangeError("Buffer size must be a multiple of 32-bits")}for(var r=0;r<t;r+=4){x(this,r,r+3);x(this,r+1,r+2)}return this};l.prototype.swap64=function e(){var t=this.length;if(t%8!==0){throw new RangeError("Buffer size must be a multiple of 64-bits")}for(var r=0;r<t;r+=8){x(this,r,r+7);x(this,r+1,r+6);x(this,r+2,r+5);x(this,r+3,r+4)}return this};l.prototype.toString=function e(){var t=this.length|0;if(t===0)return"";if(arguments.length===0)return A(this,0,t);return w.apply(this,arguments)};l.prototype.equals=function e(t){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(this===t)return true;return l.compare(this,t)===0};l.prototype.inspect=function e(){var r="";var n=t.INSPECT_MAX_BYTES;if(this.length>0){r=this.toString("hex",0,n).match(/.{2}/g).join(" ");if(this.length>n)r+=" ... "}return"<Buffer "+r+">"};l.prototype.compare=function e(t,r,n,i,a){if(!l.isBuffer(t)){throw new TypeError("Argument must be a Buffer")}if(r===undefined){r=0}if(n===undefined){n=t?t.length:0}if(i===undefined){i=0}if(a===undefined){a=this.length}if(r<0||n>t.length||i<0||a>this.length){throw new RangeError("out of range index")}if(i>=a&&r>=n){return 0}if(i>=a){return-1}if(r>=n){return 1}r>>>=0;n>>>=0;i>>>=0;a>>>=0;if(this===t)return 0;var o=a-i;var s=n-r;var u=Math.min(o,s);var f=this.slice(i,a);var c=t.slice(r,n);for(var h=0;h<u;++h){if(f[h]!==c[h]){o=f[h];s=c[h];break}}if(o<s)return-1;if(s<o)return 1;return 0};function T(e,t,r,n,i){if(e.length===0)return-1;if(typeof r==="string"){n=r;r=0}else if(r>2147483647){r=2147483647}else if(r<-2147483648){r=-2147483648}r=+r;if(isNaN(r)){r=i?0:e.length-1}if(r<0)r=e.length+r;if(r>=e.length){if(i)return-1;else r=e.length-1}else if(r<0){if(i)r=0;else return-1}if(typeof t==="string"){t=l.from(t,n)}if(l.isBuffer(t)){if(t.length===0){return-1}return k(e,t,r,n,i)}else if(typeof t==="number"){t=t&255;if(l.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf==="function"){if(i){return Uint8Array.prototype.indexOf.call(e,t,r)}else{return Uint8Array.prototype.lastIndexOf.call(e,t,r)}}return k(e,[t],r,n,i)}throw new TypeError("val must be string, number or Buffer")}function k(e,t,r,n,i){var a=1;var o=e.length;var s=t.length;if(n!==undefined){n=String(n).toLowerCase();if(n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le"){if(e.length<2||t.length<2){return-1}a=2;o/=2;s/=2;r/=2}}function u(e,t){if(a===1){return e[t]}else{return e.readUInt16BE(t*a)}}var l;if(i){var f=-1;for(l=r;l<o;l++){if(u(e,l)===u(t,f===-1?0:l-f)){if(f===-1)f=l;if(l-f+1===s)return f*a}else{if(f!==-1)l-=l-f;f=-1}}}else{if(r+s>o)r=o-s;for(l=r;l>=0;l--){var c=true;for(var h=0;h<s;h++){if(u(e,l+h)!==u(t,h)){c=false;break}}if(c)return l}}return-1}l.prototype.includes=function e(t,r,n){return this.indexOf(t,r,n)!==-1};l.prototype.indexOf=function e(t,r,n){return T(this,t,r,n,true)};l.prototype.lastIndexOf=function e(t,r,n){return T(this,t,r,n,false)};function R(e,t,r,n){r=Number(r)||0;var i=e.length-r;if(!n){n=i}else{n=Number(n);if(n>i){n=i}}var a=t.length;if(a%2!==0)throw new TypeError("Invalid hex string");if(n>a/2){n=a/2}for(var o=0;o<n;++o){var s=parseInt(t.substr(o*2,2),16);if(isNaN(s))return o;e[r+o]=s}return o}function E(e,t,r,n){return ee(Z(t,e.length-r),e,r,n)}function C(e,t,r,n){return ee(K(t),e,r,n)}function O(e,t,r,n){return C(e,t,r,n)}function S(e,t,r,n){return ee($(t),e,r,n)}function F(e,t,r,n){return ee(Q(t,e.length-r),e,r,n)}l.prototype.write=function e(t,r,n,i){if(r===undefined){i="utf8";n=this.length;r=0}else if(n===undefined&&typeof r==="string"){i=r;n=this.length;r=0}else if(isFinite(r)){r=r|0;if(isFinite(n)){n=n|0;if(i===undefined)i="utf8"}else{i=n;n=undefined}}else{throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported")}var a=this.length-r;if(n===undefined||n>a)n=a;if(t.length>0&&(n<0||r<0)||r>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!i)i="utf8";var o=false;for(;;){switch(i){case"hex":return R(this,t,r,n);case"utf8":case"utf-8":return E(this,t,r,n);case"ascii":return C(this,t,r,n);case"latin1":case"binary":return O(this,t,r,n);case"base64":return S(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,t,r,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase();o=true}}};l.prototype.toJSON=function e(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function I(e,t,r){if(t===0&&r===e.length){return n.fromByteArray(e)}else{return n.fromByteArray(e.slice(t,r))}}function A(e,t,r){r=Math.min(e.length,r);var n=[];var i=t;while(i<r){var a=e[i];var o=null;var s=a>239?4:a>223?3:a>191?2:1;if(i+s<=r){var u,l,f,c;switch(s){case 1:if(a<128){o=a}break;case 2:u=e[i+1];if((u&192)===128){c=(a&31)<<6|u&63;if(c>127){o=c}}break;case 3:u=e[i+1];l=e[i+2];if((u&192)===128&&(l&192)===128){c=(a&15)<<12|(u&63)<<6|l&63;if(c>2047&&(c<55296||c>57343)){o=c}}break;case 4:u=e[i+1];l=e[i+2];f=e[i+3];if((u&192)===128&&(l&192)===128&&(f&192)===128){c=(a&15)<<18|(u&63)<<12|(l&63)<<6|f&63;if(c>65535&&c<1114112){o=c}}}}if(o===null){o=65533;s=1}else if(o>65535){o-=65536;n.push(o>>>10&1023|55296);o=56320|o&1023}n.push(o);i+=s}return D(n)}var M=4096;function D(e){var t=e.length;if(t<=M){return String.fromCharCode.apply(String,e)}var r="";var n=0;while(n<t){r+=String.fromCharCode.apply(String,e.slice(n,n+=M))}return r}function L(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i){n+=String.fromCharCode(e[i]&127)}return n}function B(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i){n+=String.fromCharCode(e[i])}return n}function P(e,t,r){var n=e.length;if(!t||t<0)t=0;if(!r||r<0||r>n)r=n;var i="";for(var a=t;a<r;++a){i+=J(e[a])}return i}function U(e,t,r){var n=e.slice(t,r);var i="";for(var a=0;a<n.length;a+=2){i+=String.fromCharCode(n[a]+n[a+1]*256)}return i}l.prototype.slice=function e(t,r){var n=this.length;t=~~t;r=r===undefined?n:~~r;if(t<0){t+=n;if(t<0)t=0}else if(t>n){t=n}if(r<0){r+=n;if(r<0)r=0}else if(r>n){r=n}if(r<t)r=t;var i;if(l.TYPED_ARRAY_SUPPORT){i=this.subarray(t,r);i.__proto__=l.prototype}else{var a=r-t;i=new l(a,undefined);for(var o=0;o<a;++o){i[o]=this[o+t]}}return i};function N(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}l.prototype.readUIntLE=function e(t,r,n){t=t|0;r=r|0;if(!n)N(t,r,this.length);var i=this[t];var a=1;var o=0;while(++o<r&&(a*=256)){i+=this[t+o]*a}return i};l.prototype.readUIntBE=function e(t,r,n){t=t|0;r=r|0;if(!n){N(t,r,this.length)}var i=this[t+--r];var a=1;while(r>0&&(a*=256)){i+=this[t+--r]*a}return i};l.prototype.readUInt8=function e(t,r){if(!r)N(t,1,this.length);return this[t]};l.prototype.readUInt16LE=function e(t,r){if(!r)N(t,2,this.length);return this[t]|this[t+1]<<8};l.prototype.readUInt16BE=function e(t,r){if(!r)N(t,2,this.length);return this[t]<<8|this[t+1]};l.prototype.readUInt32LE=function e(t,r){if(!r)N(t,4,this.length);return(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};l.prototype.readUInt32BE=function e(t,r){if(!r)N(t,4,this.length);return this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};l.prototype.readIntLE=function e(t,r,n){t=t|0;r=r|0;if(!n)N(t,r,this.length);var i=this[t];var a=1;var o=0;while(++o<r&&(a*=256)){i+=this[t+o]*a}a*=128;if(i>=a)i-=Math.pow(2,8*r);return i};l.prototype.readIntBE=function e(t,r,n){t=t|0;r=r|0;if(!n)N(t,r,this.length);var i=r;var a=1;var o=this[t+--i];while(i>0&&(a*=256)){o+=this[t+--i]*a}a*=128;if(o>=a)o-=Math.pow(2,8*r);return o};l.prototype.readInt8=function e(t,r){if(!r)N(t,1,this.length);if(!(this[t]&128))return this[t];return(255-this[t]+1)*-1};l.prototype.readInt16LE=function e(t,r){if(!r)N(t,2,this.length);var n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};l.prototype.readInt16BE=function e(t,r){if(!r)N(t,2,this.length);var n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};l.prototype.readInt32LE=function e(t,r){if(!r)N(t,4,this.length);return this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};l.prototype.readInt32BE=function e(t,r){if(!r)N(t,4,this.length);return this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};l.prototype.readFloatLE=function e(t,r){if(!r)N(t,4,this.length);return i.read(this,t,true,23,4)};l.prototype.readFloatBE=function e(t,r){if(!r)N(t,4,this.length);return i.read(this,t,false,23,4)};l.prototype.readDoubleLE=function e(t,r){if(!r)N(t,8,this.length);return i.read(this,t,true,52,8)};l.prototype.readDoubleBE=function e(t,r){if(!r)N(t,8,this.length);return i.read(this,t,false,52,8)};function j(e,t,r,n,i,a){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}l.prototype.writeUIntLE=function e(t,r,n,i){t=+t;r=r|0;n=n|0;if(!i){var a=Math.pow(2,8*n)-1;j(this,t,r,n,a,0)}var o=1;var s=0;this[r]=t&255;while(++s<n&&(o*=256)){this[r+s]=t/o&255}return r+n};l.prototype.writeUIntBE=function e(t,r,n,i){t=+t;r=r|0;n=n|0;if(!i){var a=Math.pow(2,8*n)-1;j(this,t,r,n,a,0)}var o=n-1;var s=1;this[r+o]=t&255;while(--o>=0&&(s*=256)){this[r+o]=t/s&255}return r+n};l.prototype.writeUInt8=function e(t,r,n){t=+t;r=r|0;if(!n)j(this,t,r,1,255,0);if(!l.TYPED_ARRAY_SUPPORT)t=Math.floor(t);this[r]=t&255;return r+1};function z(e,t,r,n){if(t<0)t=65535+t+1;for(var i=0,a=Math.min(e.length-r,2);i<a;++i){e[r+i]=(t&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}}l.prototype.writeUInt16LE=function e(t,r,n){t=+t;r=r|0;if(!n)j(this,t,r,2,65535,0);if(l.TYPED_ARRAY_SUPPORT){this[r]=t&255;this[r+1]=t>>>8}else{z(this,t,r,true)}return r+2};l.prototype.writeUInt16BE=function e(t,r,n){t=+t;r=r|0;if(!n)j(this,t,r,2,65535,0);if(l.TYPED_ARRAY_SUPPORT){this[r]=t>>>8;this[r+1]=t&255}else{z(this,t,r,false)}return r+2};function G(e,t,r,n){if(t<0)t=4294967295+t+1;for(var i=0,a=Math.min(e.length-r,4);i<a;++i){e[r+i]=t>>>(n?i:3-i)*8&255}}l.prototype.writeUInt32LE=function e(t,r,n){t=+t;r=r|0;if(!n)j(this,t,r,4,4294967295,0);if(l.TYPED_ARRAY_SUPPORT){this[r+3]=t>>>24;this[r+2]=t>>>16;this[r+1]=t>>>8;this[r]=t&255}else{G(this,t,r,true)}return r+4};l.prototype.writeUInt32BE=function e(t,r,n){t=+t;r=r|0;if(!n)j(this,t,r,4,4294967295,0);if(l.TYPED_ARRAY_SUPPORT){this[r]=t>>>24;this[r+1]=t>>>16;this[r+2]=t>>>8;this[r+3]=t&255}else{G(this,t,r,false)}return r+4};l.prototype.writeIntLE=function e(t,r,n,i){t=+t;r=r|0;if(!i){var a=Math.pow(2,8*n-1);j(this,t,r,n,a-1,-a)}var o=0;var s=1;var u=0;this[r]=t&255;while(++o<n&&(s*=256)){if(t<0&&u===0&&this[r+o-1]!==0){u=1}this[r+o]=(t/s>>0)-u&255}return r+n};l.prototype.writeIntBE=function e(t,r,n,i){t=+t;r=r|0;if(!i){var a=Math.pow(2,8*n-1);j(this,t,r,n,a-1,-a)}var o=n-1;var s=1;var u=0;this[r+o]=t&255;while(--o>=0&&(s*=256)){if(t<0&&u===0&&this[r+o+1]!==0){u=1}this[r+o]=(t/s>>0)-u&255}return r+n};l.prototype.writeInt8=function e(t,r,n){t=+t;r=r|0;if(!n)j(this,t,r,1,127,-128);if(!l.TYPED_ARRAY_SUPPORT)t=Math.floor(t);if(t<0)t=255+t+1;this[r]=t&255;return r+1};l.prototype.writeInt16LE=function e(t,r,n){t=+t;r=r|0;if(!n)j(this,t,r,2,32767,-32768);if(l.TYPED_ARRAY_SUPPORT){this[r]=t&255;this[r+1]=t>>>8}else{z(this,t,r,true)}return r+2};l.prototype.writeInt16BE=function e(t,r,n){t=+t;r=r|0;if(!n)j(this,t,r,2,32767,-32768);if(l.TYPED_ARRAY_SUPPORT){this[r]=t>>>8;this[r+1]=t&255}else{z(this,t,r,false)}return r+2};l.prototype.writeInt32LE=function e(t,r,n){t=+t;r=r|0;if(!n)j(this,t,r,4,2147483647,-2147483648);if(l.TYPED_ARRAY_SUPPORT){this[r]=t&255;this[r+1]=t>>>8;this[r+2]=t>>>16;this[r+3]=t>>>24}else{G(this,t,r,true)}return r+4};l.prototype.writeInt32BE=function e(t,r,n){t=+t;r=r|0;if(!n)j(this,t,r,4,2147483647,-2147483648);if(t<0)t=4294967295+t+1;if(l.TYPED_ARRAY_SUPPORT){this[r]=t>>>24;this[r+1]=t>>>16;this[r+2]=t>>>8;this[r+3]=t&255}else{G(this,t,r,false)}return r+4};function V(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function W(e,t,r,n,a){if(!a){V(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38)}i.write(e,t,r,n,23,4);return r+4}l.prototype.writeFloatLE=function e(t,r,n){return W(this,t,r,true,n)};l.prototype.writeFloatBE=function e(t,r,n){return W(this,t,r,false,n)};function H(e,t,r,n,a){if(!a){V(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308)}i.write(e,t,r,n,52,8);return r+8}l.prototype.writeDoubleLE=function e(t,r,n){return H(this,t,r,true,n)};l.prototype.writeDoubleBE=function e(t,r,n){return H(this,t,r,false,n)};l.prototype.copy=function e(t,r,n,i){if(!n)n=0;if(!i&&i!==0)i=this.length;if(r>=t.length)r=t.length;if(!r)r=0;if(i>0&&i<n)i=n;if(i===n)return 0;if(t.length===0||this.length===0)return 0;if(r<0){throw new RangeError("targetStart out of bounds")}if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");if(i>this.length)i=this.length;if(t.length-r<i-n){i=t.length-r+n}var a=i-n;var o;if(this===t&&n<r&&r<i){for(o=a-1;o>=0;--o){t[o+r]=this[o+n]}}else if(a<1e3||!l.TYPED_ARRAY_SUPPORT){for(o=0;o<a;++o){t[o+r]=this[o+n]}}else{Uint8Array.prototype.set.call(t,this.subarray(n,n+a),r)}return a};l.prototype.fill=function e(t,r,n,i){if(typeof t==="string"){if(typeof r==="string"){i=r;r=0;n=this.length}else if(typeof n==="string"){i=n;n=this.length}if(t.length===1){var a=t.charCodeAt(0);if(a<256){t=a}}if(i!==undefined&&typeof i!=="string"){throw new TypeError("encoding must be a string")}if(typeof i==="string"&&!l.isEncoding(i)){throw new TypeError("Unknown encoding: "+i)}}else if(typeof t==="number"){t=t&255}if(r<0||this.length<r||this.length<n){throw new RangeError("Out of range index")}if(n<=r){return this}r=r>>>0;n=n===undefined?this.length:n>>>0;if(!t)t=0;var o;if(typeof t==="number"){for(o=r;o<n;++o){this[o]=t}}else{var s=l.isBuffer(t)?t:Z(new l(t,i).toString());var u=s.length;for(o=0;o<n-r;++o){this[o+r]=s[o%u]}}return this};var q=/[^+\/0-9A-Za-z-_]/g;function Y(e){e=X(e).replace(q,"");if(e.length<2)return"";while(e.length%4!==0){e=e+"="}return e}function X(e){if(e.trim)return e.trim();return e.replace(/^\s+|\s+$/g,"")}function J(e){if(e<16)return"0"+e.toString(16);return e.toString(16)}function Z(e,t){t=t||Infinity;var r;var n=e.length;var i=null;var a=[];for(var o=0;o<n;++o){r=e.charCodeAt(o);if(r>55295&&r<57344){if(!i){if(r>56319){if((t-=3)>-1)a.push(239,191,189);continue}else if(o+1===n){if((t-=3)>-1)a.push(239,191,189);continue}i=r;continue}if(r<56320){if((t-=3)>-1)a.push(239,191,189);i=r;continue}r=(i-55296<<10|r-56320)+65536}else if(i){if((t-=3)>-1)a.push(239,191,189)}i=null;if(r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return a}function K(e){var t=[];for(var r=0;r<e.length;++r){t.push(e.charCodeAt(r)&255)}return t}function Q(e,t){var r,n,i;var a=[];for(var o=0;o<e.length;++o){if((t-=2)<0)break;r=e.charCodeAt(o);n=r>>8;i=r%256;a.push(i);a.push(n)}return a}function $(e){return n.toByteArray(Y(e))}function ee(e,t,r,n){for(var i=0;i<n;++i){if(i+r>=t.length||i>=e.length)break;t[i+r]=e[i]}return i}function te(e){return e!==e}}).call(t,r(41))},function(e,t,r){"use strict";t.byteLength=f;t.toByteArray=c;t.fromByteArray=v;var n=[];var i=[];var a=typeof Uint8Array!=="undefined"?Uint8Array:Array;var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var s=0,u=o.length;s<u;++s){n[s]=o[s];i[o.charCodeAt(s)]=s}i["-".charCodeAt(0)]=62;i["_".charCodeAt(0)]=63;function l(e){var t=e.length;if(t%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}return e[t-2]==="="?2:e[t-1]==="="?1:0}function f(e){return e.length*3/4-l(e)}function c(e){var t,r,n,o,s,u;var f=e.length;s=l(e);u=new a(f*3/4-s);n=s>0?f-4:f;var c=0;for(t=0,r=0;t<n;t+=4,r+=3){o=i[e.charCodeAt(t)]<<18|i[e.charCodeAt(t+1)]<<12|i[e.charCodeAt(t+2)]<<6|i[e.charCodeAt(t+3)];u[c++]=o>>16&255;u[c++]=o>>8&255;u[c++]=o&255}if(s===2){o=i[e.charCodeAt(t)]<<2|i[e.charCodeAt(t+1)]>>4;u[c++]=o&255}else if(s===1){o=i[e.charCodeAt(t)]<<10|i[e.charCodeAt(t+1)]<<4|i[e.charCodeAt(t+2)]>>2;u[c++]=o>>8&255;u[c++]=o&255}return u}function h(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[e&63]}function p(e,t,r){var n;var i=[];for(var a=t;a<r;a+=3){n=(e[a]<<16)+(e[a+1]<<8)+e[a+2];i.push(h(n))}return i.join("")}function v(e){var t;var r=e.length;var i=r%3;var a="";var o=[];var s=16383;for(var u=0,l=r-i;u<l;u+=s){o.push(p(e,u,u+s>l?l:u+s))}if(i===1){t=e[r-1];a+=n[t>>2];a+=n[t<<4&63];a+="=="}else if(i===2){t=(e[r-2]<<8)+e[r-1];a+=n[t>>10];a+=n[t>>4&63];a+=n[t<<2&63];a+="="}o.push(a);return o.join("")}},function(e,t){t.read=function(e,t,r,n,i){var a,o;var s=i*8-n-1;var u=(1<<s)-1;var l=u>>1;var f=-7;var c=r?i-1:0;var h=r?-1:1;var p=e[t+c];c+=h;a=p&(1<<-f)-1;p>>=-f;f+=s;for(;f>0;a=a*256+e[t+c],c+=h,f-=8){}o=a&(1<<-f)-1;a>>=-f;f+=n;for(;f>0;o=o*256+e[t+c],c+=h,f-=8){}if(a===0){a=1-l}else if(a===u){return o?NaN:(p?-1:1)*Infinity}else{o=o+Math.pow(2,n);a=a-l}return(p?-1:1)*o*Math.pow(2,a-n)};t.write=function(e,t,r,n,i,a){var o,s,u;var l=a*8-i-1;var f=(1<<l)-1;var c=f>>1;var h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0;var p=n?0:a-1;var v=n?1:-1;var d=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){s=isNaN(t)?1:0;o=f}else{o=Math.floor(Math.log(t)/Math.LN2);if(t*(u=Math.pow(2,-o))<1){o--;u*=2}if(o+c>=1){t+=h/u}else{t+=h*Math.pow(2,1-c)}if(t*u>=2){o++;u/=2}if(o+c>=f){s=0;o=f}else if(o+c>=1){s=(t*u-1)*Math.pow(2,i);o=o+c}else{s=t*Math.pow(2,c-1)*Math.pow(2,i);o=0}}for(;i>=8;e[r+p]=s&255,p+=v,s/=256,i-=8){}o=o<<i|s;l+=i;for(;l>0;e[r+p]=o&255,p+=v,o/=256,l-=8){}e[r+p-v]|=d*128}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return r.call(e)=="[object Array]"}},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function o(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var s=function(){function e(){o(this,e)}a(e,null,[{key:"current",value:function e(){return"production"}},{key:"isTest",value:function e(){return"production"==="test"}},{key:"isDevelopment",value:function e(){return"production"==="development"}},{key:"isProduction",value:function e(){return"production"==="production"||!this.isTest()&&!this.isDevelopment()}}]);return e}();t["a"]=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=r(260);r.d(t,"ImageLoader",function(){return n["a"]});var i=r(136);r.d(t,"JSONLoader",function(){return i["a"]})},function(e,t,r){"use strict";var n=r(70);var i=r.n(n);var a=r(71);var o=r.n(a);var s=r(29);var u=r.n(s);var l=function(){function e(e,t){var r=[];var n=true;var i=false;var a=undefined;try{for(var s=o()(e),u;!(n=(u=s.next()).done);n=true){r.push(u.value);if(t&&r.length===t)break}}catch(e){i=true;a=e}finally{try{if(!n&&s["return"])s["return"]()}finally{if(i)throw a}}return r}return function(t,r){if(Array.isArray(t)){return t}else if(i()(Object(t))){return e(t,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();t["a"]={load:function e(t){var r=this;var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{cors:true,value:"anonymous"};var i=function e(){if(t.substr(0,5)==="data:"||"boolean"!=="undefined"){return u.a.resolve([t,t])}};return i().then(function(e){var t=l(e,2),i=t[0],a=t[1];return r._createAndLoadImage(i,a,n)})},_createAndLoadImage:function e(t,r){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{cors:true,value:"anonymous"};if(true){return new u.a(function(e,t){var i=new window.Image;i.addEventListener("load",function(){e(i)});i.addEventListener("error",function(){t(new Error("Failed to load image at "+r))});if(n.cors){i.crossOrigin=n.value}i.src=r})}},loadXHR:function e(t,r){return new u.a(function(e,n){var i=void 0;if(window.XDomainRequest){i=new window.XDomainRequest;if(r)i.overrideMimeType(r);i.onload=function(){e(i)};i.onerror=function(e){n(e)}}else if(window.XMLHttpRequest){i=new window.XMLHttpRequest;if(r)i.overrideMimeType(r);i.onreadystatechange=function(t){if(i.readyState===4){if(i.status===200){e(i)}else{n(new Error("HTTP Status "+i.status))}}}}i.open("GET",t,true);i.send()})}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=r(4);var i=r.n(n);var a=r(262);var o=r(266);var s=r(268);var u=r(331);var l=r(332);var f=r(335);var c=r(338);var h=r(339);var p=r(340);var v=r(343);var d=r(348);var y=r(378);var _=r(380);var g=[a["a"],o["a"],s["a"],u["a"],l["a"],f["a"],c["a"],h["a"],p["a"],v["a"],d["a"],y["a"],_["a"]];i.a.AllOperations=g;t["default"]=g},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(5);var o=r.n(a);var s=r(2);var u=r.n(s);var l=r(3);var f=r.n(l);var c=r(1);var h=r.n(c);var p=r(4);var v=r.n(p);var d=r(143);var y=r(264);var _=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var g=function e(t,r,n){if(t===null)t=Function.prototype;var i=o()(t,r);if(i===undefined){var a=h()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var s=i.get;if(s===undefined){return undefined}return s.call(n)}};function m(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function b(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function w(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)u.a?u()(e,t):e.__proto__=t}var x=p["Math"].ColorMatrix;var T=function(e){w(t,e);function t(){var e;m(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=b(this,(e=t.__proto__||h()(t)).call.apply(e,[this].concat(n)));a._clarityFilter=new y["a"];a._filter=new d["a"];a._sprite.setFilters([a._clarityFilter,a._filter]);return a}_(t,[{key:"_render",value:function e(t){var r=t.getDimensions();r.x=1/r.x;r.y=1/r.y;var n=new x;n.multiply(x.createSaturationMatrix(-.3*this._options.clarity+1));n.multiply(x.createContrastMatrix(.1*this._options.clarity+1));this._clarityFilter.set({clarity:this._options.clarity,pixelDimension:r,colorMatrix:n,colorOffset:n.getOffsets()});var i=new x;i.multiply(x.createExposureMatrix(this._options.exposure));i.multiply(x.createSaturationMatrix(this._options.saturation+1));i.multiply(x.createContrastMatrix((this._options.contrast>0?this._options.contrast*2:this._options.contrast)+1));i.multiply(x.createBrightnessMatrix(this._options.brightness));this._filter.set({gamma:this._options.gamma,shadows:this._options.shadows,highlights:this._options.highlights,colorMatrix:i,colorOffset:i.getOffsets()});if(this._options.clarity!==0){this._sprite.setFilters([this._clarityFilter,this._filter])}else{this._sprite.setFilters([this._filter])}this._renderTexture.render(this._container);return p["Promise"].resolve()}},{key:"dispose",value:function e(){g(t.prototype.__proto__||h()(t.prototype),"dispose",this).call(this);this._filter.dispose();this._clarityFilter.dispose()}}]);return t}(p["Operation"]);T.identifier="adjustments";T.prototype.availableOptions={brightness:{type:p["OptionType"].NUMBER,default:0,minValue:-1,midValue:0,maxValue:1},saturation:{type:p["OptionType"].NUMBER,default:0,minValue:-1,midValue:0,maxValue:1},contrast:{type:p["OptionType"].NUMBER,default:0,minValue:-1,midValue:0,maxValue:1},gamma:{type:p["OptionType"].NUMBER,default:1,minValue:.5,midValue:1,maxValue:2},exposure:{type:p["OptionType"].NUMBER,default:0,minValue:-1,midValue:0,maxValue:1},shadows:{type:p["OptionType"].NUMBER,default:0,minValue:-2,midValue:0,maxValue:2},highlights:{type:p["OptionType"].NUMBER,default:0,minValue:-1,midValue:0,maxValue:1},clarity:{type:p["OptionType"].NUMBER,default:0,minValue:-1,midValue:0,maxValue:1}};v.a.Operations.AdjustmentsOperation=T;t["a"]=T},function(e,t){e.exports="precision highp float;\n\nvarying vec2 v_texCoord;\nuniform sampler2D u_image;\n\nuniform float u_gamma;\nuniform float u_shadows;\nuniform float u_highlights;\n\nuniform mat4 u_colorMatrix;\nuniform vec4 u_colorOffset;\n\nconst float EPSILON = 0.0000001;\n\nfloat calculateLuminance(vec3 rgb) {\n // This is the luminance calculation part of the RGB to HSL formular.\n vec4 p = mix(\n vec4(rgb.gb, 0.0, -1.0 / 3.0),\n vec4(rgb.bg, -1.0, 2.0 / 3.0),\n vec4(rgb.g < rgb.b)\n );\n\n vec4 q = mix(\n vec4(rgb.r, p.yzx),\n vec4(p.xyw, rgb.r),\n vec4(rgb.r < p.x)\n );\n\n float croma = q.x - min(q.w, q.y);\n float luminance = q.x - croma * 0.5;\n return luminance;\n}\n\nvoid main() {\n\n vec4 color = clamp(texture2D(u_image, v_texCoord), 0.0, 1.0);\n color.rgb /= max(color.a, EPSILON); // Revert premultiplied alpha\n\n // Apply gamma\n if (u_gamma != 1.0) {\n color.rgb = pow(color.rgb, vec3(1.0 / max(u_gamma, EPSILON)));\n }\n\n // Apply shadows and highlights\n float luminance = calculateLuminance(color.rgb);\n\n float shadow = u_shadows >= 0.0\n ? clamp(\n pow(luminance, 1.0 / (u_shadows + 1.0))\n + pow(luminance, 2.0 / (u_shadows + 1.0)) * -0.76\n - luminance\n , 0.0, max(u_shadows, 1.0))\n : -clamp(\n pow(luminance, 1.0 / (-u_shadows + 1.0))\n + pow(luminance, 2.0 / (-u_shadows + 1.0)) * -0.76\n - luminance\n , 0.0, max(-u_shadows, 1.0));\n\n float highlight = u_highlights < 0.0\n ? clamp(\n 1.0\n - pow(1.0 - luminance, 1.0 / (1.0 - u_highlights))\n - pow(1.0 - luminance, 2.0 / (1.0 - u_highlights)) * -0.8\n - luminance\n , -1.0, 0.0)\n : -clamp(\n 1.0\n - pow(1.0 - luminance, 1.0 / (1.0 + u_highlights))\n - pow(1.0 - luminance, 2.0 / (1.0 + u_highlights)) * -0.8\n - luminance\n , -1.0, 0.0);\n\n // Bright color need more contrast and dark color need more brightness.\n // This is to keep saturatation because the color information of a dark colors is lost.\n float shadowContrast = shadow * luminance * luminance;\n float shadowBrightness = shadow - shadowContrast;\n color.rgb = clamp((luminance + highlight + shadowContrast) * ((color.rgb + shadowBrightness) / max(luminance, EPSILON)), 0.0, 1.0);\n\n // Apply Color Matrix\n color = clamp(color * u_colorMatrix + u_colorOffset, 0.0, 1.0);\n\n color.rgb *= color.a; // Do premultiplie alpha\n\n gl_FragColor = color;\n}\n"},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(4);var h=r.n(c);var p=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function v(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function d(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function y(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var _=c["Math"].Vector2,g=c["Math"].ColorMatrix;var m=function(e){y(t,e);function t(){v(this,t);var e=d(this,(t.__proto__||f()(t)).call(this));e._fragmentSource=r(265);return e}p(t,[{key:"_applyCanvas",value:function e(t,r,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var a=n.getContext();var o=r.getCanvas();var s=r.getContext();var u=this._options.clarity;var l=this._options.colorMatrix;var f=new c["Color"](this._options.colorOffset[0],this._options.colorOffset[1],this._options.colorOffset[2],this._options.colorOffset[3]);var h=o.width;var p=o.height;var v=s.getImageData(0,0,h,p);var d=a.createImageData(h,p);this.canvasShader(v,d,u,l,f);a.putImageData(d,0,0)}},{key:"canvasShader",value:function e(t,r,n,i,a){var o=function e(t,r,n){return Math.min(Math.max(t,r),n)};var s=function e(t,r,n){var i=o((n-t)/(r-t),0,1);return i*i*(3-2*i)};var u=t.width*4;var l=t.data.length;var f=l-1;var h=0;var p=t.data;var v=r.data;var d=new c["Color"];var y=255*9;var _=function e(t){t=t<h?h:t;t=t>f?f:t;return p[t]};for(var g=0;g<l;g+=4){var m=_(g+0);var b=_(g+1);var w=_(g+2);var x=_(g+3);var T=(m+_(g-4-u+0)+_(g-4+0)+_(g-4+u+0)+_(g-u+0)+_(g+u+0)+_(g+4-u+0)+_(g+4+0)+_(g+4+u))/y;var k=(b+_(g-4-u+1)+_(g-4+1)+_(g-4+u+1)+_(g-u+1)+_(g+u+1)+_(g+4-u+1)+_(g+4+1)+_(g+4+u+1))/y;var R=(w+_(g-4-u+2)+_(g-4+2)+_(g-4+u+2)+_(g-u+2)+_(g+u+2)+_(g+4-u+2)+_(g+4+2)+_(g+4+u+2))/y;var E=(x+_(g-4-u+3)+_(g-4+3)+_(g-4+u+3)+_(g-u+3)+_(g+u+3)+_(g+4-u+3)+_(g+4+3)+_(g+4+u+3))/y;m/=255;b/=255;w/=255;x/=255;var C=o(m*.3+b*.59+w*.1,.111111,.999999);var O=Math.min(s(1-C,0,.11),s(C,0,.11));var S=n*3.7*O;var F=Math.pow(2,n*.27*O);var I=o(m+o((m-T)*S,0,10),0,1)*F;var A=o(b+o((b-k)*S,0,10),0,1)*F;var M=o(w+o((w-R)*S,0,10),0,1)*F;var D=o(x+o((x-E)*S,0,10),0,1);d.set(I,A,M,D);var L=i.apply(d).add(a);v[g+0]=L.r*255;v[g+1]=L.g*255;v[g+2]=L.b*255;v[g+3]=L.a*255}}}]);return t}(c["Engine"].Filter);m.prototype.availableOptions={clarity:{type:c["OptionType"].NUMBER,default:0,uniformType:c["UniformType"].FLOAT},pixelDimension:{type:c["OptionType"].VECTOR2,default:new _(100,100),uniformType:c["UniformType"].FLOAT2},colorMatrix:{type:c["OptionType"].COLOR_MATRIX,default:new g,uniformType:c["UniformType"].MAT4},colorOffset:{type:c["OptionType"].ARRAY,default:[],uniformType:c["UniformType"].FLOAT4}};t["a"]=m},function(e,t){e.exports="precision mediump float;\n\n// Input Image with config WRAP_S and WRAP_T: CLAMP_TO_EDGE\nuniform sampler2D u_image;\n\n// Size of one pixel == vec2(1.0 / u_image.width, 1.0 / u_image.height)\nuniform vec2 u_pixelDimension;\n\n// Range (-1.0 - 1.0)\nuniform float u_clarity;\n\nvarying vec2 v_texCoord;\n\nuniform mat4 u_colorMatrix;\nuniform vec4 u_colorOffset;\n\nconst float EPSILON = 0.000001;\n\nvoid main() {\n vec4 color = texture2D(u_image, v_texCoord);\n\n vec4 mergedColor = color;\n mergedColor += texture2D(u_image, v_texCoord + vec2(-u_pixelDimension.x, -u_pixelDimension.y));\n mergedColor += texture2D(u_image, v_texCoord + vec2(-u_pixelDimension.x, 0.0));\n mergedColor += texture2D(u_image, v_texCoord + vec2(-u_pixelDimension.x, u_pixelDimension.y));\n\n mergedColor += texture2D(u_image, v_texCoord + vec2( 0.0, -u_pixelDimension.y));\n mergedColor += texture2D(u_image, v_texCoord + vec2( 0.0, u_pixelDimension.y));\n\n mergedColor += texture2D(u_image, v_texCoord + vec2( u_pixelDimension.x, -u_pixelDimension.y));\n mergedColor += texture2D(u_image, v_texCoord + vec2( u_pixelDimension.x, 0.0));\n mergedColor += texture2D(u_image, v_texCoord + vec2( u_pixelDimension.x, u_pixelDimension.y));\n\n mergedColor /= 9.0;\n\n color.rgb /= max(color.a, EPSILON); // Revert premultiplied alpha\n mergedColor.rgb /= max(mergedColor.a, EPSILON); // Revert premultiplied alpha\n\n float grayValue = clamp(color.r * 0.3 + color.g * 0.59 + color.b * 0.1, 0.111111, 0.999999);\n // 1.0 and 0.0 result in white not black, therefore we clamp\n\n // Here we create a function that will map values below 0.1 to 0. Values above 0.2 will be mapped to 1,\n // and for values between 0.1 and 0.2 it will produce a gradient.\n // The funtion is mirror at 0.5, meaning values between 0.8 and 0.9 will result in a decending gradient.\n // And values above 0.9 will be mapped to 0.\n float frequenceFactor = min(smoothstep(1.0 - grayValue, 0.0, 0.11), smoothstep(grayValue, 0.0, 0.11));\n\n // here we apply the high pass filter. Its strength is determined by the uniform ,\n // and the frequence factor. That means the only the mid tones are affected by this filter.\n // Clarity input is ranging from -1 to 1. But we want to strengthen the effect.\n // Therefore we see this little magic number '3.7'.\n color = clamp(color + clamp((color - mergedColor) * u_clarity * 3.7 * frequenceFactor, 0.0, 10.0), 0.0, 1.0);\n\n // apply exposure but only to the mid tones.\n color.rgb = color.rgb * pow(2.0, u_clarity * 0.27 * frequenceFactor);\n\n // apply contrast and desaturation matrix\n\n\n color = clamp(color * u_colorMatrix + u_colorOffset, 0.0, 1.0);\n\n color.rgb *= color.a; // Do premultiplie alpha\n\n gl_FragColor = clamp(color, 0.0, 1.0);\n}\n"},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(5);var o=r.n(a);var s=r(2);var u=r.n(s);var l=r(3);var f=r.n(l);var c=r(1);var h=r.n(c);var p=r(4);var v=r.n(p);var d=r(144);var y=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var _=function e(t,r,n){if(t===null)t=Function.prototype;var i=o()(t,r);if(i===undefined){var a=h()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var s=i.get;if(s===undefined){return undefined}return s.call(n)}};function g(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function m(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function b(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)u.a?u()(e,t):e.__proto__=t}var w=p["Math"].Vector2;var x=function(e){b(t,e);function t(){var e;g(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=m(this,(e=t.__proto__||h()(t)).call.apply(e,[this].concat(n)));a._lastBlurRadius=a._options.blurRadius;a._horizontalFilter=new d["a"];a._verticalFilter=new d["a"];a._sprite.setFilters([a._horizontalFilter,a._verticalFilter]);a._horizontalFilter.setDelta(new w(.5,.5));a._verticalFilter.setDelta(new w(-.5,.5));a._filter=new d["a"];return a}y(t,[{key:"_renderWebGL",value:function e(t){var r=t.getDimensions();var n=r.min();var i=this._options.blurRadius;var a={blurRadius:i*n,texSize:r};this._horizontalFilter.set(a);this._verticalFilter.set(a);this._renderTexture.render(this._container);return p["Promise"].resolve()}},{key:"_renderCanvas",value:function e(t){var r=this._options.blurRadius;var n=t.getDimensions();this._filter.set({blurRadius:r,texSize:n});this._sprite.setFilters([this._filter]);this._renderTexture.render(this._container);return p["Promise"].resolve()}},{key:"transform",value:function e(t){var r=this.getBlurRadius();var n=t.applyToRelativeSize(r);this.set({blurRadius:n},false)}},{key:"dispose",value:function e(){_(t.prototype.__proto__||h()(t.prototype),"dispose",this).call(this);this._filter.dispose();this._verticalFilter.dispose();this._horizontalFilter.dispose()}},{key:"hasChanges",value:function e(){return true}}]);return t}(p["Operation"]);x.identifier="blur";x.prototype.availableOptions={blurRadius:{type:p["OptionType"].NUMBER,default:.025}};v.a.Operations.BlurOperation=x;t["a"]=x},function(e,t){e.exports="/*\n * Based on evanw's glfx.js tilt shift shader:\n * https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js\n * @license\n */\n\nuniform sampler2D u_image;\nuniform float u_blurRadius;\nuniform vec2 u_delta;\nuniform vec2 u_texSize;\nvarying vec2 v_texCoord;\n\nfloat random(vec2 co)\n{\n highp float a = 12.9898;\n highp float b = 78.233;\n highp float c = 43758.5453;\n highp float dt = dot(co.xy,vec2(a,b));\n highp float sn = mod(dt, 3.14);\n return fract(sin(sn) * c);\n}\n\nvoid main() {\n vec4 color = vec4(0.0);\n float total = 0.0;\n\n float offset = random(gl_FragCoord.xy / u_texSize.xy);\n float radius = u_blurRadius;\n\n for (float t = -30.0; t <= 30.0; t++) {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n\n // Somehow `sample` is a keyword in headless-gl\n vec4 _sample = texture2D(u_image, v_texCoord + u_delta * percent * radius / u_texSize);\n\n _sample.rgb *= _sample.a;\n\n color += _sample * weight;\n total += weight;\n }\n\n gl_FragColor = color / total;\n gl_FragColor.rgb /= gl_FragColor.a + 0.00001;\n}\n"},function(e,t,r){"use strict";var n=r(6);var i=r.n(n);var a=r(0);var o=r.n(a);var s=r(5);var u=r.n(s);var l=r(2);var f=r.n(l);var c=r(3);var h=r.n(c);var p=r(1);var v=r.n(p);var d=r(4);var y=r.n(d);var _=r(145);var g=r(8);var m=r(299);var b=r(7);var w=i.a||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}}return e};var x=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;o()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var T=function e(t,r,n){if(t===null)t=Function.prototype;var i=u()(t,r);if(i===undefined){var a=v()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var o=i.get;if(o===undefined){return undefined}return o.call(n)}};function k(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function R(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function E(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=h()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)f.a?f()(e,t):e.__proto__=t}var C=function(e){E(t,e);function t(){k(this,t);return R(this,(t.__proto__||v()(t)).apply(this,arguments))}x(t,[{key:"_render",value:function e(t){return this._selectedFilter.render(this._sdk,t,this._renderTexture)}},{key:"render",value:function e(r){if(this._selectedFilter.getDirty()){this.setDirty(true)}if(!this.getEnabled()||this._selectedFilter.constructor.isIdentity){return d["Promise"].resolve(r)}return T(t.prototype.__proto__||v()(t.prototype),"render",this).call(this,r)}},{key:"setDirtyForRenderer",value:function e(r,n){T(t.prototype.__proto__||v()(t.prototype),"setDirtyForRenderer",this).call(this,r,n);this._selectedFilter.setDirtyForRenderer(r,n)}},{key:"disposeRenderTextures",value:function e(){T(t.prototype.__proto__||v()(t.prototype),"disposeRenderTextures",this).call(this);if(this._selectedFilter){this._selectedFilter.disposeRenderTextures()}}},{key:"dispose",value:function e(){T(t.prototype.__proto__||v()(t.prototype),"dispose",this).call(this);if(this._selectedFilter){this._selectedFilter.dispose()}}},{key:"restoreSnapshot",value:function e(t){var r=w({},t);delete r.filter;if(t.filter){var n=t.filter.constructor;if(n.identifier==="3d-lut"){this.setFilter(new n({image:t.filter.getImage(),resolution:t.filter.getResolution(),horizontalTileCount:t.filter.getHorizontalTileCount(),verticalTileCount:t.filter.getVerticalTileCount()}))}else{this.setFilter(new n)}}this.set(r)}}]);return t}(d["Operation"]);C.identifier="filter";C.prototype.availableOptions={identifier:{type:d["OptionType"].STRING,default:"identity"},intensity:{type:d["OptionType"].NUMBER,default:1,setter:function e(t){this._selectedFilter&&this._selectedFilter.setIntensity(t);return t}},filter:{type:d["OptionType"].OBJECT,default:new _["a"],setter:function e(t){if(this._selectedFilter){this._selectedFilter.dispose();this._selectedFilter=null}this._selectedFilter=t;if(typeof this._options.intensity!=="undefined"){this._selectedFilter.set({intensity:this._options.intensity})}return t}}};C.FilterPrimitives=g;C.Filters=m;C.Filter=b["a"];y.a.Operations.FilterOperation=C;t["a"]=C},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(4);var h=r.n(c);var p=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function v(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function d(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function y(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var _=function(e){y(t,e);function t(){v(this,t);var e=d(this,(t.__proto__||f()(t)).call(this));e._fragmentSource=r(270);return e}p(t,[{key:"_applyCanvas",value:function e(t,r,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var a=r.getCanvas();var o=n.getContext();var s=this._options.filteredCanvas;o.save();o.drawImage(a,0,0);o.globalAlpha=this._options.intensity;o.drawImage(s,0,0);o.restore()}}]);return t}(c["Engine"].Filter);_.prototype.availableOptions={filteredImage:{type:c["OptionType"].NUMBER,default:1,uniformType:c["UniformType"].INT},filteredCanvas:{type:c["OptionType"].OBJECT,default:null},intensity:{type:c["OptionType"].NUMBER,default:1,uniformType:c["UniformType"].FLOAT}};var g=function(){function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;v(this,e);this._intensity=t;this._stack=[];this._dirtiness={};this._renderTextures={};this._container=new c["Engine"].Container;this._sprite=new c["Engine"].Sprite;this._container.addChild(this._sprite);this._blendFilter=new _}p(e,[{key:"push",value:function e(t){this._stack.push(t)}},{key:"clear",value:function e(){this._stack=[]}},{key:"render",value:function e(t,r,n){if(this._stack.length===0){return c["Promise"].resolve()}var i=t.getRenderer();this._sprite.setTexture(r);var a=this._renderTextures[i.id];if(!a){var o=t.getSprite().getTexture().getFrame();a=new c["Engine"].RenderTexture(t.getRenderer(),o.width,o.height);this._renderTextures[i.id]=a}var s=n.getDimensions();a.resizeTo(s);var u=this.isDirtyForRenderer(i);if(u){this._stack.forEach(function(e){e.update(t)});var l=this._stack.map(function(e){return e.getFilter()});this._sprite.setFilters(l);a.render(this._container);this.setDirtyForRenderer(false,i)}this._blendFilter.setIntensity(this._intensity);if(i.isOfType(c["RendererType"].CANVAS)){this._blendFilter.setFilteredCanvas(a.getRenderTarget().getCanvas())}else if(i.isOfType(c["RendererType"].WEBGL)){var f=a.getBaseTexture();f.setGLUnit(this._blendFilter.getFilteredImage());i.updateTexture(f,false)}this._sprite.setFilters([this._blendFilter]);n.clear(c["Color"].TRANSPARENT);n.render(this._container);if(u){this.disposeRenderTextures()}return c["Promise"].resolve(n)}},{key:"setIntensity",value:function e(t){this._intensity=t}},{key:"isDirtyForRenderer",value:function e(t){if(!(t.id in this._dirtiness)){this._dirtiness[t.id]=true}return this._dirtiness[t.id]}},{key:"setDirtyForRenderer",value:function e(t,r){this._dirtiness[r.id]=t}},{key:"setDirty",value:function e(t){for(var r in this._dirtiness){this._dirtiness[r]=t}}},{key:"disposeRenderTextures",value:function e(){for(var t in this._renderTextures){this._renderTextures[t].dispose();delete this._renderTextures[t]}}},{key:"dispose",value:function e(){this.disposeRenderTextures();this._stack.forEach(function(e){return e.dispose()});this._stack=[];this._blendFilter.dispose();this._sprite.dispose()}}]);return e}();t["a"]=g},function(e,t){e.exports="varying vec2 v_texCoord;\nuniform sampler2D u_image;\nuniform sampler2D u_filteredImage;\nuniform float u_intensity;\n\nvoid main() {\n vec4 color0 = texture2D(u_image, v_texCoord);\n vec4 color1 = texture2D(u_filteredImage, v_texCoord);\n gl_FragColor = mix(color0, color1, u_intensity);\n}\n"},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(4);var h=r.n(c);var p=r(12);var v=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function d(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function y(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function _(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var g=function(e){_(t,e);function t(){d(this,t);var e=y(this,(t.__proto__||f()(t)).call(this));e._fragmentSource=r(272);return e}v(t,[{key:"_applyCanvas",value:function e(t,r,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var a=r.getCanvas();var o=r.getContext();var s=n.getContext();var u=o.getImageData(0,0,a.width,a.height);var l=this._options.brightness;if(l===0){return}l=l*255;for(var f=0;f<a.width*a.height;f++){var c=f*4;u.data[c]+=l;u.data[c+1]+=l;u.data[c+2]+=l}s.putImageData(u,0,0)}}]);return t}(c["Engine"].Filter);g.prototype.availableOptions={brightness:{type:c["OptionType"].NUMBER,default:0,uniformType:c["UniformType"].FLOAT}};var m=function(e){_(t,e);function t(){var e;d(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=y(this,(e=t.__proto__||f()(t)).call.apply(e,[this].concat(n)));a._filter=new g;return a}v(t,[{key:"update",value:function e(){this._filter.setBrightness(this._options.brightness)}}]);return t}(p["a"]);m.prototype.availableOptions=g.prototype.availableOptions;t["a"]=m},function(e,t){e.exports="varying vec2 v_texCoord;\nuniform sampler2D u_image;\nuniform float u_brightness;\n\nvoid main() {\n vec4 texColor = texture2D(u_image, v_texCoord);\n gl_FragColor = vec4((texColor.rgb + vec3(u_brightness) * texColor.a), texColor.a);;\n}\n"},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(4);var h=r.n(c);var p=r(12);var v=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function d(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function y(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function _(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var g=function(e){_(t,e);function t(){d(this,t);var e=y(this,(t.__proto__||f()(t)).call(this));e._fragmentSource=r(274);return e}v(t,[{key:"_applyCanvas",value:function e(t,r,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var a=r.getCanvas();var o=r.getContext();var s=n.getContext();var u=o.getImageData(0,0,a.width,a.height);var l=this._options.contrast;if(l===1){return}for(var f=0;f<a.width*a.height;f++){var c=f*4;u.data[c]=(u.data[c]-127)*l+127;u.data[c+1]=(u.data[c+1]-127)*l+127;u.data[c+2]=(u.data[c+2]-127)*l+127}s.putImageData(u,0,0)}}]);return t}(c["Engine"].Filter);g.prototype.availableOptions={contrast:{type:c["OptionType"].NUMBER,default:1,uniformType:c["UniformType"].FLOAT}};var m=function(e){_(t,e);function t(){var e;d(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=y(this,(e=t.__proto__||f()(t)).call.apply(e,[this].concat(n)));a._filter=new g;return a}v(t,[{key:"update",value:function e(){this._filter.setContrast(this._options.contrast)}}]);return t}(p["a"]);m.prototype.availableOptions=g.prototype.availableOptions;t["a"]=m},function(e,t){e.exports="varying vec2 v_texCoord;\nuniform sampler2D u_image;\nuniform float u_contrast;\n\nvoid main() {\n vec4 texColor = texture2D(u_image, v_texCoord);\n gl_FragColor = vec4(((texColor.rgb - vec3(0.5)) * u_contrast + vec3(0.5) * texColor.a), texColor.a);\n}\n"},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(4);var h=r.n(c);var p=r(12);var v=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function d(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function y(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function _(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var g=c["Math"].ColorMatrix;var m=function(e){_(t,e);function t(){d(this,t);var e=y(this,(t.__proto__||f()(t)).call(this));e._fragmentSource=r(276);return e}v(t,[{key:"_applyCanvas",value:function e(t,r,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var a=r.getCanvas();var o=r.getContext();var s=n.getContext();var u=o.getImageData(0,0,a.width,a.height);var l=this._options.colorMatrix;var f=new c["Color"](0,0,0,0);for(var h=0;h<a.width*a.height;h++){var p=h*4;f.r=u.data[p]/255;f.g=u.data[p+1]/255;f.b=u.data[p+2]/255;f=l.apply(f);u.data[p]=f.r*255;u.data[p+1]=f.g*255;u.data[p+2]=f.b*255}s.putImageData(u,0,0)}}]);return t}(c["Engine"].Filter);m.prototype.availableOptions={colorMatrix:{type:c["OptionType"].COLOR_MATRIX,default:new g,uniformType:c["UniformType"].MAT4},colorMatrixOffset:{type:c["OptionType"].ARRAY,default:[],uniformType:c["UniformType"].FLOAT4}};var b=function(e){_(t,e);function t(){var e;d(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=y(this,(e=t.__proto__||f()(t)).call.apply(e,[this].concat(n)));a._filter=new m;return a}v(t,[{key:"update",value:function e(){this._filter.setColorMatrix(this._options.colorMatrix)}}]);return t}(p["a"]);b.prototype.availableOptions=m.prototype.availableOptions;t["a"]=b},function(e,t){e.exports="varying vec2 v_texCoord;\nuniform sampler2D u_image;\nuniform mat4 u_colorMatrix;\nuniform vec4 u_colorMatrixOffset;\n\nvoid main() {\n vec4 texColor = texture2D(u_image, v_texCoord);\n gl_FragColor = texColor * u_colorMatrix + u_colorMatrixOffset;\n}\n"},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(4);var h=r.n(c);var p=r(12);var v=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function d(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function y(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function _(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var g=function(e){_(t,e);function t(){d(this,t);var e=y(this,(t.__proto__||f()(t)).call(this));e._fragmentSource=r(278);return e}v(t,[{key:"_applyCanvas",value:function e(t,r,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var a=r.getCanvas();var o=r.getContext();var s=n.getContext();var u=o.getImageData(0,0,a.width,a.height);var l=[.3,.59,.11];var f=this._options.desaturation;for(var c=0;c<a.width*a.height;c++){var h=c*4;var p=l[0]*u.data[h]/255+l[1]*u.data[h+1]/255+l[2]*u.data[h+2]/255;u.data[h]+=(p*255-u.data[h])*f;u.data[h+1]+=(p*255-u.data[h+1])*f;u.data[h+2]+=(p*255-u.data[h+2])*f}s.putImageData(u,0,0)}}]);return t}(c["Engine"].Filter);g.prototype.availableOptions={desaturation:{type:c["OptionType"].NUMBER,default:1,uniformType:c["UniformType"].FLOAT}};var m=function(e){_(t,e);function t(){var e;d(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=y(this,(e=t.__proto__||f()(t)).call.apply(e,[this].concat(n)));a._filter=new g;return a}v(t,[{key:"update",value:function e(){this._filter.setDesaturation(this._options.desaturation)}}]);return t}(p["a"]);m.prototype.availableOptions=g.prototype.availableOptions;t["a"]=m},function(e,t){e.exports="varying vec2 v_texCoord;\nuniform sampler2D u_image;\nuniform float u_desaturation;\n\nvoid main() {\n vec4 texColor = texture2D(u_image, v_texCoord);\n vec3 grayXfer = vec3(0.3, 0.59, 0.11);\n vec3 gray = vec3(dot(grayXfer, texColor.xyz));\n gl_FragColor = vec4(mix(texColor.xyz, gray, u_desaturation) * texColor.a, texColor.a);\n}\n"},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(4);var h=r.n(c);var p=r(12);var v=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function d(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function y(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function _(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var g=function(e){_(t,e);function t(){d(this,t);var e=y(this,(t.__proto__||f()(t)).call(this));e._fragmentSource=r(280);return e}v(t,[{key:"_applyCanvas",value:function e(t,r,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var a=r.getCanvas();var o=r.getContext();var s=n.getContext();var u=o.getImageData(0,0,a.width,a.height);var l=this._options.gamma;var f=new Float32Array(256);for(var c=0;c<256;c++){f[c]=255*Math.pow(c/255,l.r)}var h=new Float32Array(256);for(var p=0;p<256;p++){h[p]=255*Math.pow(p/255,l.g)}var v=new Float32Array(256);for(var d=0;d<256;d++){v[d]=255*Math.pow(d/255,l.b)}for(var y=0;y<a.width*a.height;y++){var _=y*4;u.data[_]=f[u.data[_]];u.data[_+1]=h[u.data[_+1]];u.data[_+2]=v[u.data[_+2]]}s.putImageData(u,0,0)}}]);return t}(c["Engine"].Filter);g.prototype.availableOptions={gamma:{type:c["OptionType"].COLOR,default:c["Color"].WHITE,uniformType:c["UniformType"].FLOAT3}};var m=function(e){_(t,e);function t(){var e;d(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=y(this,(e=t.__proto__||f()(t)).call.apply(e,[this].concat(n)));a._filter=new g;return a}v(t,[{key:"update",value:function e(){this._filter.setGamma(this._options.gamma)}}]);return t}(p["a"]);m.prototype.availableOptions=g.prototype.availableOptions;t["a"]=m},function(e,t){e.exports="varying vec2 v_texCoord;\nuniform sampler2D u_image;\nuniform vec3 u_gamma;\n\nvoid main() {\n vec4 texColor = texture2D(u_image, v_texCoord);\n vec3 rgb = vec3(texColor.r, texColor.g, texColor.b);\n rgb = pow(rgb, u_gamma);\n gl_FragColor = vec4(rgb * texColor.a, texColor.a);;\n}\n"},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(4);var h=r.n(c);var p=r(12);var v=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function d(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function y(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function _(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var g=function(e){_(t,e);function t(){d(this,t);var e=y(this,(t.__proto__||f()(t)).call(this));e._fragmentSource=r(282);return e}v(t,[{key:"_applyCanvas",value:function e(t,r,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var a=r.getCanvas();var o=r.getContext();var s=n.getContext();var u=o.getImageData(0,0,a.width,a.height);var l=this._options.color;var f;for(var c=0;c<a.width;c++){for(var h=0;h<a.height;h++){var p=(a.width*h+c)*4;var v=c/a.width;var d=h/a.height;var y=(v-.5)/.75;var _=(d-.5)/.75;var g=y*y;var m=_*_;f=1-(g+m);f=Math.min(Math.max(f,.1),1);u.data[p]=u.data[p]*(f*l.r);u.data[p+1]=u.data[p+1]*(f*l.g);u.data[p+2]=u.data[p+2]*(f*l.b);u.data[p+3]=255}}s.putImageData(u,0,0)}}]);return t}(c["Engine"].Filter);g.prototype.availableOptions={color:{type:c["OptionType"].COLOR,default:c["Color"].WHITE,uniformType:c["UniformType"].FLOAT3}};var m=function(e){_(t,e);function t(){var e;d(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=y(this,(e=t.__proto__||f()(t)).call.apply(e,[this].concat(n)));a._filter=new g;return a}v(t,[{key:"update",value:function e(){this._filter.setColor(this._options.color)}}]);return t}(p["a"]);m.prototype.availableOptions=g.prototype.availableOptions;t["a"]=m},function(e,t){e.exports="varying vec2 v_texCoord;\nuniform sampler2D u_image;\n\nuniform vec3 u_color;\n\nvoid main() {\n vec4 texColor = texture2D(u_image, v_texCoord);\n\n vec2 textureCoord = v_texCoord - vec2(0.5, 0.5);\n textureCoord /= 0.75;\n\n float d = 1.0 - dot(textureCoord, textureCoord);\n d = clamp(d, 0.2, 1.0);\n vec3 newColor = texColor.rgb * d * u_color.rgb;\n gl_FragColor = vec4(vec3(newColor) * texColor.a, texColor.a);\n}\n"},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(4);var h=r.n(c);var p=r(12);var v=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function d(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function y(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function _(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var g=function(e){_(t,e);function t(){d(this,t);var e=y(this,(t.__proto__||f()(t)).call(this));e._fragmentSource=r(284);return e}v(t,[{key:"_applyCanvas",value:function e(t,r,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var a=r.getCanvas();var o=r.getContext();var s=n.getContext();var u=o.getImageData(0,0,a.width,a.height);for(var l=0;l<a.width;l++){for(var f=0;f<a.height;f++){var c=(a.width*f+l)*4;u.data[c+2]=u.data[c+1]*.33;u.data[c]=u.data[c]*.6;u.data[c+2]+=u.data[c]*.33;u.data[c+1]=u.data[c+1]*.7;u.data[c+3]=255}}s.putImageData(u,0,0)}}]);return t}(c["Engine"].Filter);var m=function(e){_(t,e);function t(){var e;d(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=y(this,(e=t.__proto__||f()(t)).call.apply(e,[this].concat(n)));a._filter=new g;return a}return t}(p["a"]);t["a"]=m},function(e,t){e.exports="varying vec2 v_texCoord;\nuniform sampler2D u_image;\n\nvoid main() {\n vec4 texColor = texture2D(u_image, v_texCoord);\n texColor.b = texColor.g * 0.33;\n texColor.r = texColor.r * 0.6;\n texColor.b += texColor.r * 0.33;\n texColor.g = texColor.g * 0.7;\n gl_FragColor = texColor;\n}\n"},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(4);var h=r.n(c);var p=r(12);var v=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function d(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function y(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function _(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var g=function(e){_(t,e);function t(){d(this,t);var e=y(this,(t.__proto__||f()(t)).call(this));e._fragmentSource=r(286);return e}v(t,[{key:"_applyCanvas",value:function e(t,r,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var a=r.getCanvas();var o=r.getContext();var s=n.getContext();var u=o.getImageData(0,0,a.width,a.height);for(var l=0;l<a.width;l++){for(var f=0;f<a.height;f++){var c=(a.width*f+l)*4;var h=u.data[c]*.2125+u.data[c+1]*.7154+u.data[c+2]*.0721;u.data[c]=h;u.data[c+1]=h;u.data[c+2]=h}}s.putImageData(u,0,0)}}]);return t}(c["Engine"].Filter);var m=function(e){_(t,e);function t(){var e;d(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=y(this,(e=t.__proto__||f()(t)).call.apply(e,[this].concat(n)));a._filter=new g;return a}return t}(p["a"]);t["a"]=m},function(e,t){e.exports="varying vec2 v_texCoord;\nuniform sampler2D u_image;\nvec3 W = vec3(0.2125, 0.7154, 0.0721);\n\nvoid main() {\n vec4 texColor = texture2D(u_image, v_texCoord);\n float luminance = dot(texColor.rgb, W);\n gl_FragColor = vec4(vec3(luminance) * texColor.a, texColor.a);\n}\n"},function(e,t){e.exports="varying vec2 v_texCoord;\nuniform sampler2D u_image;\nuniform sampler2D u_lookupTable;\n\nvoid main() {\n vec4 texColor = texture2D(u_image, v_texCoord);\n float r = texture2D(u_lookupTable, vec2(texColor.r, 0.0)).r;\n float g = texture2D(u_lookupTable, vec2(texColor.g, 0.0)).g;\n float b = texture2D(u_lookupTable, vec2(texColor.b, 0.0)).b;\n\n gl_FragColor = vec4(vec3(r, g, b) * texColor.a, texColor.a);\n}\n"},function(e,t,r){"use strict";var n=r(5);var i=r.n(n);var a=r(0);var o=r.n(a);var s=r(2);var u=r.n(s);var l=r(3);var f=r.n(l);var c=r(1);var h=r.n(c);var p=r(4);var v=r.n(p);var d=r(12);var y=function e(t,r,n){if(t===null)t=Function.prototype;var a=i()(t,r);if(a===undefined){var o=h()(t);if(o===null){return undefined}else{return e(o,r,n)}}else if("value"in a){return a.value}else{var s=a.get;if(s===undefined){return undefined}return s.call(n)}};var _=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;o()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function g(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function m(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function b(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)u.a?u()(e,t):e.__proto__=t}var w=p["Math"].Vector2;var x=3;var T=function(e){b(t,e);function t(){g(this,t);var e=m(this,(t.__proto__||h()(t)).call(this));e._precomputeQuads();e._fragmentSource=r(289);return e}_(t,[{key:"_precomputeQuads",value:function e(){this._quads=[];for(var t=0;t<256;t++){var r=t/255*63;var n=new w;n.y=(r|0)*.125|0;n.x=(r|0)-n.y*8;this._quads.push(n)}}},{key:"_applyCanvas",value:function e(t,r,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var a=r.getCanvas();var o=r.getContext();var s=n.getContext();var u=this._options.lookupTableImage;var l=this._createImageCanvas(u);var f=l.getContext("2d");var c=o.getImageData(0,0,a.width,a.height);var h=f.getImageData(0,0,u.width,u.height);var p=new w;for(var v=0;v<a.width*a.height*4;v+=4){var d=c.data[v];var y=c.data[v+1];var _=c.data[v+2];var g=c.data[v+3]/255;var m=this._quads[_];var b=64;p.x=m.x*b;p.y=m.y*b;p.x+=Math.floor(d/4);p.y+=Math.floor(y/4);var x=(u.width*p.y+p.x)*4|0;var T=h.data[x];T=d*(1-g)+T*g;var k=h.data[x+1];k=y*(1-g)+k*g;var R=h.data[x+2];R=_*(1-g)+R*g;c.data[v]=T;c.data[v+1]=k;c.data[v+2]=R}s.putImageData(c,0,0)}},{key:"_createImageCanvas",value:function e(t){var r=p["Utils"].createCanvas();r.width=t.width;r.height=t.height;var n=r.getContext("2d");n.drawImage(t,0,0);return r}}]);return t}(p["Engine"].Filter);T.prototype.availableOptions={lookupTable:{type:p["OptionType"].NUMBER,default:x,uniformType:p["UniformType"].INT},lookupTableImage:{type:p["OptionType"].IMAGE,uniformType:null}};var k=function(e){b(t,e);function t(){var e;g(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=m(this,(e=t.__proto__||h()(t)).call.apply(e,[this].concat(n)));a._filter=new T;a._textures={};return a}_(t,[{key:"update",value:function e(t){var r=t.getRenderer();if(r.isOfType(p["RendererType"].WEBGL)){this._updateWebGLTexture(t)}else if(r.isOfType(p["RendererType"].CANVAS)){this._filter.setLookupTableImage(this._options.image)}}},{key:"_updateWebGLTexture",value:function e(t){var r=t.getRenderer();var n=r.id;if(!this._textures[n]){this._textures[n]=new p["Engine"].BaseTexture}var i=this._textures[n];i.setSource(this._options.image);i.setGLUnit(x);r.updateTexture(i)}},{key:"dispose",value:function e(){y(t.prototype.__proto__||h()(t.prototype),"dispose",this).call(this);for(var r in this._textures){delete this._textures[r]}}}]);return t}(d["a"]);k.prototype.availableOptions={image:{type:p["OptionType"].IMAGE}};t["a"]=k},function(e,t){e.exports="/**\n * Based off of GPUImage's LookupFilter:\n * https://github.com/BradLarson/GPUImage/blob/master/framework/Source/GPUImageLookupFilter.m\n */\n\nvarying vec2 v_texCoord;\nuniform sampler2D u_image;\nuniform sampler2D u_lookupTable;\n\nvoid main() {\n vec4 texColor = texture2D(u_image, v_texCoord);\n float blueColor = texColor.b * 63.0;\n\n vec2 quad1;\n quad1.y = floor(floor(blueColor) / 8.0);\n quad1.x = floor(blueColor) - (quad1.y * 8.0);\n\n vec2 quad2;\n quad2.y = floor(ceil(blueColor) / 8.0);\n quad2.x = ceil(blueColor) - (quad2.y * 8.0);\n\n vec2 texCoord1;\n texCoord1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * texColor.r);\n texCoord1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * texColor.g);\n\n vec2 texCoord2;\n texCoord2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * texColor.r);\n texCoord2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * texColor.g);\n\n vec4 newColor1 = texture2D(u_lookupTable, texCoord1);\n vec4 newColor2 = texture2D(u_lookupTable, texCoord2);\n\n vec4 newColor = mix(newColor1, newColor2, fract(blueColor));\n gl_FragColor = mix(texColor, vec4(newColor.rgb, texColor.w), texColor.a);\n}\n"},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(4);var h=r.n(c);var p=r(12);var v=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function d(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function y(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function _(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var g=function(e){_(t,e);function t(){d(this,t);var e=y(this,(t.__proto__||f()(t)).call(this));e._fragmentSource=r(291);return e}v(t,[{key:"_applyCanvas",value:function e(t,r,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var a=r.getCanvas();var o=r.getContext();var s=n.getContext();var u=o.getImageData(0,0,a.width,a.height);var l=this._options.saturation;for(var f=0;f<a.width;f++){for(var c=0;c<a.height;c++){var h=(a.width*c+f)*4;var p=u.data[h]*.2125+u.data[h+1]*.7154+u.data[h+2]*.0721;u.data[h]=p*(1-l)+u.data[h]*l;u.data[h+1]=p*(1-l)+u.data[h+1]*l;u.data[h+2]=p*(1-l)+u.data[h+2]*l}}s.putImageData(u,0,0)}}]);return t}(c["Engine"].Filter);g.prototype.availableOptions={saturation:{type:c["OptionType"].NUMBER,default:0,uniformType:c["UniformType"].FLOAT}};var m=function(e){_(t,e);function t(){var e;d(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=y(this,(e=t.__proto__||f()(t)).call.apply(e,[this].concat(n)));a._filter=new g;return a}v(t,[{key:"update",value:function e(){this._filter.setSaturation(this._options.saturation)}}]);return t}(p["a"]);m.prototype.availableOptions=g.prototype.availableOptions;t["a"]=m},function(e,t){e.exports="varying vec2 v_texCoord;\nuniform sampler2D u_image;\nuniform float u_saturation;\n\nconst vec3 luminanceWeighting = vec3(0.2125, 0.7154, 0.0721);\n\nvoid main() {\n vec4 texColor = texture2D(u_image, v_texCoord);\n float luminance = dot(texColor.rgb, luminanceWeighting);\n\n vec3 greyScaleColor = vec3(luminance);\n\n gl_FragColor = vec4(mix(greyScaleColor, texColor.rgb, u_saturation) * texColor.a, texColor.a);\n}\n"},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(4);var h=r.n(c);var p=r(12);var v=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function d(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function y(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function _(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var g=function(e){_(t,e);function t(){d(this,t);var e=y(this,(t.__proto__||f()(t)).call(this));e._fragmentSource=r(293);return e}v(t,[{key:"_applyCanvas",value:function e(t,r,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var a=r.getCanvas();var o=r.getContext();var s=n.getContext();var u=o.getImageData(0,0,a.width,a.height);for(var l=0;l<a.width;l++){for(var f=0;f<a.height;f++){var c=(a.width*f+l)*4;u.data[c]=Math.max(this._options.color.r*255,u.data[c]);u.data[c+1]=Math.max(this._options.color.g*255,u.data[c+1]);u.data[c+2]=Math.max(this._options.color.b*255,u.data[c+2])}}s.putImageData(u,0,0)}}]);return t}(c["Engine"].Filter);g.prototype.availableOptions={color:{type:c["OptionType"].COLOR,default:c["Color"].WHITE,uniformType:c["UniformType"].FLOAT3}};var m=function(e){_(t,e);function t(){var e;d(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=y(this,(e=t.__proto__||f()(t)).call.apply(e,[this].concat(n)));a._filter=new g;return a}v(t,[{key:"update",value:function e(){this._filter.setColor(this._options.color)}}]);return t}(p["a"]);m.prototype.availableOptions=g.prototype.availableOptions;t["a"]=m},function(e,t){e.exports="varying vec2 v_texCoord;\nuniform sampler2D u_image;\nuniform vec3 u_color;\n\nvoid main() {\n vec4 texColor = texture2D(u_image, v_texCoord);\n vec4 overlayVec4 = vec4(u_color, texColor.a);\n gl_FragColor = max(overlayVec4 * texColor.a, texColor);\n}\n"},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(4);var h=r.n(c);var p=r(146);var v=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function d(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function y(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function _(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var g=function(e){_(t,e);function t(){var e;d(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=y(this,(e=t.__proto__||f()(t)).call.apply(e,[this].concat(n)));if(!a._options.rgbControlPoints){a._options.rgbControlPoints={red:a._options.controlPoints,green:a._options.controlPoints,blue:a._options.controlPoints}}a._updateLookupTable();return a}v(t,[{key:"_updateLookupTable",value:function e(){var t=this._calculateSplineCurve(this._options.rgbControlPoints.red);var r=this._calculateSplineCurve(this._options.rgbControlPoints.green);var n=this._calculateSplineCurve(this._options.rgbControlPoints.blue);this._options.data=this._buildLookupTable(t,r,n)}},{key:"_buildLookupTable",value:function e(t,r,n){var i=[];for(var a=0;a<256;a++){i.push(Math.min(Math.max(a+t[a],0),255));i.push(Math.min(Math.max(a+r[a],0),255));i.push(Math.min(Math.max(a+n[a],0),255));i.push(255)}return i}},{key:"_calculateSplineCurve",value:function e(t){t=t.sort(function(e,t){return e[0]>t[0]});var r=this._getSplineCurve(t);var n=r[0];var i;if(n[0]>0){for(i=0;i<n[0];i++){r.unshift([0,0])}}var a=[];for(i=0;i<r.length;i++){var o=r[i];var s=[o[0],o[0]];var u=Math.sqrt(Math.pow(s[0]-o[0],2)+Math.pow(s[1]-o[1],2));if(s[1]>o[1]){u=-u}a.push(u)}return a}},{key:"_getSplineCurve",value:function e(t){var r=this._secondDerivative(t);var n=r.length;var i=[];var a;for(a=0;a<n;a++){i[a]=r[a]}var o=[];for(a=0;a<n-1;a++){var s=t[a];var u=t[a+1];for(var l=s[0];l<u[0];l++){var f=(l-s[0])/(u[0]-s[0]);var c=1-f;var h=f;var p=u[0]-s[0];var v=c*s[1]+h*u[1]+p*p/6*((c*c*c-c)*i[a]+(h*h*h-h)*i[a+1]);if(v>255){v=255}else if(v<0){v=0}o.push([l,v])}}if(o.length===255){o.push(t[t.length-1])}return o}},{key:"_secondDerivative",value:function e(t){var r=t.length;if(r<=0||r===1){return null}var n=[];var i=[];var a,o;n[0]=[0,1,0];for(a=1;a<r-1;a++){var s=t[a-1];var u=t[a];var l=t[a+1];n[a]=n[a]||[];n[a][0]=(u[0]-s[0])/6;n[a][1]=(l[0]-s[0])/3;n[a][2]=(l[0]-u[0])/6;i[a]=(l[1]-u[1])/(l[0]-u[0])-(u[1]-s[1])/(u[0]-s[0])}i[0]=0;i[r-1]=0;n[r-1]=[0,1,0];for(a=1;a<r;a++){o=n[1][0]/n[a-1][1];n[a][1]-=o*n[a-1][2];n[a][0]=0;i[a]-=o*i[a-1]}for(a=r-2;a>0;a--){o=n[a][2]/n[a+1][1];n[a][1]-=o*n[a+1][0];n[a][2]=0;i[a]-=o*i[a+1]}var f=[];for(a=0;a<r;a++){f[a]=i[a]/n[a][1]}return f}}]);return t}(p["a"]);g.prototype.availableOptions={rgbControlPoints:{type:c["OptionType"].OBJECT},controlPoints:{type:c["OptionType"].ARRAY,default:[]},textureGLUnit:{type:c["OptionType"].NUMBER,default:1}};t["a"]=g},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(4);var h=r.n(c);var p=r(12);var v=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function d(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function y(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function _(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var g=function(e){_(t,e);function t(){d(this,t);var e=y(this,(t.__proto__||f()(t)).call(this));e._fragmentSource=r(296);return e}v(t,[{key:"_applyCanvas",value:function e(t,r,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var a=r.getCanvas();var o=r.getContext();var s=n.getContext();var u=o.getImageData(0,0,a.width,a.height);for(var l=0;l<a.width;l++){for(var f=0;f<a.height;f++){var c=(a.width*f+l)*4;var h=u.data[c]/255*.3+u.data[c+1]/255*.3+u.data[c+2]/255*.3;h-=.2;h=Math.max(0,Math.min(1,h));h+=.15;h*=1.4;h*=255;u.data[c]=h;u.data[c+1]=h;u.data[c+2]=h}}s.putImageData(u,0,0)}}]);return t}(c["Engine"].Filter);var m=function(e){_(t,e);function t(){var e;d(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=y(this,(e=t.__proto__||f()(t)).call.apply(e,[this].concat(n)));a._filter=new g;return a}return t}(p["a"]);t["a"]=m},function(e,t){e.exports="varying vec2 v_texCoord;\nuniform sampler2D u_image;\n\nvoid main() {\n vec4 texColor = texture2D(u_image, v_texCoord);\n float gray = texColor.r * 0.3 + texColor.g * 0.3 + texColor.b * 0.3;\n gray -= 0.2;\n gray = clamp(gray, 0.0, 1.0);\n gray += 0.15;\n gray *= 1.4;\n gl_FragColor = vec4(vec3(gray) * texColor.a, texColor.a);\n}\n"},function(e,t,r){"use strict";var n=r(5);var i=r.n(n);var a=r(0);var o=r.n(a);var s=r(2);var u=r.n(s);var l=r(3);var f=r.n(l);var c=r(1);var h=r.n(c);var p=r(4);var v=r.n(p);var d=r(12);var y=function e(t,r,n){if(t===null)t=Function.prototype;var a=i()(t,r);if(a===undefined){var o=h()(t);if(o===null){return undefined}else{return e(o,r,n)}}else if("value"in a){return a.value}else{var s=a.get;if(s===undefined){return undefined}return s.call(n)}};var _=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;o()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function g(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function m(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function b(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)u.a?u()(e,t):e.__proto__=t}var w=p["Math"].Vector2,x=p["Math"].Vector3;var T=3;var k=function(e){b(t,e);function t(){g(this,t);var e=m(this,(t.__proto__||h()(t)).call(this));e._precomputeQuads();e._fragmentSource=r(298);return e}_(t,[{key:"_precomputeQuads",value:function e(){this._quads=[];for(var t=0;t<256;t++){var r=t/255*63;var n=new w;n.y=(r|0)*.125|0;n.x=(r|0)-n.y*8;this._quads.push(n)}}},{key:"_applyCanvas",value:function e(t,r,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var a=this._options,o=a.resolution,s=a.horizontalTileCount,u=a.verticalTileCount;var l=r.getCanvas();var f=r.getContext();var c=n.getContext();var h=this._options.lookupTableImage;var v=this._createImageCanvas(h);var d=v.getContext("2d");var y=f.getImageData(0,0,l.width,l.height);var _=d.getImageData(0,0,h.width,h.height);var g=new x(o/s-1|0,o/u-1|0,s*u-1|0);var m=new p["Color"];var b=new p["Color"];var T=new p["Color"];var k=new p["Color"];var R=new p["Color"];var E=new p["Color"];var C=new p["Color"];var O=new p["Color"];var S=new w;var F=new w;var I=function e(t,r,n,i){t.r=r.r*(1-i)+n.r*i;t.g=r.g*(1-i)+n.g*i;t.b=r.b*(1-i)+n.b*i};var A=function e(t,r,n){r=.5+r|0;n=.5+n|0;var i=(n*o+r)*4;t.r=_.data[i]/255;t.g=_.data[i+1]/255;t.b=_.data[i+2]/255;t.a=_.data[i+3]/255};var M=new p["Color"];var D=new p["Color"];var L=function e(t,r,n,i,a,o,s){I(M,r,i,o);I(D,n,a,o);I(t,M,D,s)};var B=new w(o,o).divide(s,u).floor();for(var P=0;P<l.width*l.height*4;P+=4){m.set(y.data[P]/255,y.data[P+1]/255,y.data[P+2]/255,y.data[P+3]/255);var U=new x(m.r*g.x,m.g*g.y,m.b*g.z);var N=U.clone().floor().toInt();var j=U.clone().ceil().toInt();var z=U.clone().fract();S.y=N.z/s|0;S.x=N.z-S.y*s|0;F.y=j.z/s|0;F.x=j.z-F.y*s|0;S.multiply(B);F.multiply(B);A(R,S.x+N.x,S.y+N.y);A(E,S.x+N.x,S.y+j.y);A(C,S.x+j.x,S.y+N.y);A(O,S.x+j.x,S.y+j.y);L(T,R,E,C,O,z.x,z.y);A(R,F.x+N.x,F.y+N.y);A(E,F.x+N.x,F.y+j.y);A(C,F.x+j.x,F.y+N.y);A(O,F.x+j.x,F.y+j.y);L(k,R,E,C,O,z.x,z.y);I(b,T,k,z.z);y.data[P]=Math.ceil(b.r*255);y.data[P+1]=Math.ceil(b.g*255);y.data[P+2]=Math.ceil(b.b*255)}c.putImageData(y,0,0)}},{key:"_createImageCanvas",value:function e(t){var r=p["Utils"].createCanvas();r.width=t.width;r.height=t.height;var n=r.getContext("2d");n.drawImage(t,0,0);return r}}]);return t}(p["Engine"].Filter);k.prototype.availableOptions={lookupTable:{type:p["OptionType"].NUMBER,default:T,uniformType:p["UniformType"].INT},lookupTableImage:{type:p["OptionType"].IMAGE,uniformType:null},resolution:{type:p["OptionType"].NUMBER,default:128,uniformType:p["UniformType"].FLOAT},horizontalTileCount:{type:p["OptionType"].NUMBER,default:5,uniformType:p["UniformType"].FLOAT},verticalTileCount:{type:p["OptionType"].NUMBER,default:5,uniformType:p["UniformType"].FLOAT}};var R=function(e){b(t,e);function t(){var e;g(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=m(this,(e=t.__proto__||h()(t)).call.apply(e,[this].concat(n)));a._filter=new k;a._textures={};return a}_(t,[{key:"update",value:function e(t){var r=t.getRenderer();if(r.isOfType(p["RendererType"].WEBGL)){this._updateWebGLTexture(t)}else if(r.isOfType(p["RendererType"].CANVAS)){this._filter.setLookupTableImage(this._options.image)}var n=this._options,i=n.resolution,a=n.verticalTileCount,o=n.horizontalTileCount;this._filter.set({resolution:i,verticalTileCount:a,horizontalTileCount:o})}},{key:"_updateWebGLTexture",value:function e(t){var r=t.getRenderer();var n=r.id;if(!this._textures[n]){this._textures[n]=new p["Engine"].BaseTexture}var i=this._textures[n];i.setSource(this._options.image);i.setGLUnit(T);i.setMinFilter(p["Engine"].BaseTexture.NearestFilter);r.updateTexture(i)}},{key:"dispose",value:function e(){y(t.prototype.__proto__||h()(t.prototype),"dispose",this).call(this);for(var r in this._textures){delete this._textures[r]}}}]);return t}(d["a"]);R.prototype.availableOptions={image:{type:p["OptionType"].IMAGE},resolution:{type:p["OptionType"].NUMBER,default:128},horizontalTileCount:{type:p["OptionType"].NUMBER,default:5},verticalTileCount:{type:p["OptionType"].NUMBER,default:5}};t["a"]=R},function(e,t){e.exports="precision highp float;\n\nuniform sampler2D u_image;\n\nuniform sampler2D u_lookupTable;\n\nuniform float u_resolution; // Texture-Resolution, must be power of 2: 64, 128, 256, 512, 1024, 2048, 4096\nuniform float u_horizontalTileCount; // Horizontal Blue Tiles\nuniform float u_verticalTileCount; // Vertical Blue Tiles\n\nvarying vec2 v_texCoord;\n\nconst float EPSILON = 0.000001;\n\n// Try to get the exact pixel of the lut map image\nvec3 lutColor(int texPosX, int texPosY) {\n return texture2D(u_lookupTable, (0.5 / u_resolution) + vec2(float(texPosX), float(texPosY)) / u_resolution).rgb;\n}\n\nvec3 bilinearInterpolate(vec3 cRfGf, vec3 cRfGc, vec3 cRcGf, vec3 cRcGc, float redFract, float greenFract) {\n return mix(mix(cRfGf, cRcGf, redFract), mix(cRfGc, cRcGc, redFract), greenFract);\n}\n\nvoid main() {\n vec4 inputColor = clamp(texture2D(u_image, v_texCoord.xy), 0.0, 1.0);\n\n vec3 sourceColor = vec3(inputColor.rgb / max(inputColor.a, EPSILON)); \n\n vec3 ranges = vec3(\n floor(u_resolution / u_horizontalTileCount - 1.0),\n floor(u_resolution / u_verticalTileCount - 1.0),\n floor(u_horizontalTileCount * u_horizontalTileCount - 1.0)\n );\n \n vec3 tmp = sourceColor * ranges;\n ivec3 floors = ivec3(tmp);\n ivec3 ceils = ivec3(ceil(tmp));\n vec3 fracts = fract(tmp);\n\n // Map tile index to tile pixel pos.\n ivec2 pixelsPerTile = ivec2(\n u_resolution / u_horizontalTileCount, \n u_resolution / u_verticalTileCount\n );\n\n ivec2 tileFloor; // Blue tile index\n tileFloor.y = floors.z / int(u_horizontalTileCount);\n tileFloor.x = (floors.z - (tileFloor.y * int(u_horizontalTileCount)));\n\n ivec2 tileCeil; // Blue tile index\n tileCeil.y = ceils.z / int(u_horizontalTileCount);\n tileCeil.x = (ceils.z - (tileCeil.y * int(u_horizontalTileCount)));\n \n tileFloor *= pixelsPerTile;\n tileCeil *= pixelsPerTile; \n \n \n // Interpolate between red and green\n vec3 lutColorFB = bilinearInterpolate(\n lutColor(tileFloor.x + floors.x, tileFloor.y + floors.y),\n lutColor(tileFloor.x + floors.x, tileFloor.y + ceils.y),\n lutColor(tileFloor.x + ceils.x, tileFloor.y + floors.y),\n lutColor(tileFloor.x + ceils.x, tileFloor.y + ceils.y),\n fracts.x, fracts.y\n );\n vec3 lutColorCB = bilinearInterpolate(\n lutColor(tileCeil.x + floors.x, tileCeil.y + floors.y),\n lutColor(tileCeil.x + floors.x, tileCeil.y + ceils.y),\n lutColor(tileCeil.x + ceils.x, tileCeil.y + floors.y),\n lutColor(tileCeil.x + ceils.x, tileCeil.y + ceils.y),\n fracts.x, fracts.y\n );\n\n // Interpolate between the blue values\n vec3 interpolation = mix(lutColorFB, lutColorCB, fracts.z);\n\n // Round Color Values to prevent that for ex. 254.999999 is cutting to 254 instead of 255;\n interpolation = clamp(floor(interpolation * 255. + .5) / 255., 0.0, 1.0);\n\n gl_FragColor = vec4(interpolation.rgb * inputColor.a, inputColor.a);\n}\n"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=r(145);r.d(t,"IdentityFilter",function(){return n["a"]});var i=r(300);r.d(t,"A15Filter",function(){return i["a"]});var a=r(301);r.d(t,"BreezeFilter",function(){return a["a"]});var o=r(302);r.d(t,"BWFilter",function(){return o["a"]});var s=r(303);r.d(t,"BWHardFilter",function(){return s["a"]});var u=r(304);r.d(t,"CelsiusFilter",function(){return u["a"]});var l=r(305);r.d(t,"ChestFilter",function(){return l["a"]});var f=r(306);r.d(t,"FixieFilter",function(){return f["a"]});var c=r(307);r.d(t,"FoodFilter",function(){return c["a"]});var h=r(308);r.d(t,"FridgeFilter",function(){return h["a"]});var p=r(309);r.d(t,"FrontFilter",function(){return p["a"]});var v=r(310);r.d(t,"GlamFilter",function(){return v["a"]});var d=r(311);r.d(t,"GobblinFilter",function(){return d["a"]});var y=r(312);r.d(t,"K1Filter",function(){return y["a"]});var _=r(313);r.d(t,"K2Filter",function(){return _["a"]});var g=r(314);r.d(t,"K6Filter",function(){return g["a"]});var m=r(315);r.d(t,"KDynamicFilter",function(){return m["a"]});var b=r(316);r.d(t,"LeninFilter",function(){return b["a"]});var w=r(317);r.d(t,"LomoFilter",function(){return w["a"]});var x=r(318);r.d(t,"MellowFilter",function(){return x["a"]});var T=r(319);r.d(t,"MetalFilter",function(){return T["a"]});var k=r(320);r.d(t,"MorningFilter",function(){return k["a"]});var R=r(321);r.d(t,"OrchidFilter",function(){return R["a"]});var E=r(322);r.d(t,"PolaFilter",function(){return E["a"]});var C=r(323);r.d(t,"Pola669Filter",function(){return C["a"]});var O=r(324);r.d(t,"QuoziFilter",function(){return O["a"]});var S=r(325);r.d(t,"SemiredFilter",function(){return S["a"]});var F=r(326);r.d(t,"SunnyFilter",function(){return F["a"]});var I=r(327);r.d(t,"TexasFilter",function(){return I["a"]});var A=r(328);r.d(t,"X400Filter",function(){return A["a"]});var M=r(329);r.d(t,"LUTFilter",function(){return M["a"]});var D=r(330);r.d(t,"ThreeDLUTFilter",function(){return D["a"]})},function(e,t,r){"use strict";var n=r(2);var i=r.n(n);var a=r(3);var o=r.n(a);var s=r(1);var u=r.n(s);var l=r(7);var f=r(8);function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function h(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function p(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=o()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)i.a?i()(e,t):e.__proto__=t}var v=function(e){p(t,e);function t(){var e;c(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=h(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(n)));a._stack.push(new f["Contrast"]({contrast:.63}));a._stack.push(new f["Brightness"]({brightness:.12}));a._stack.push(new f["ToneCurve"]({rgbControlPoints:{red:[[0,38],[94,94],[148,142],[175,187],[255,255]],green:[[0,0],[77,53],[171,190],[255,255]],blue:[[0,10],[48,85],[174,228],[255,255]]}}));return a}return t}(l["a"]);v.identifier="a15";t["a"]=v},function(e,t,r){"use strict";var n=r(2);var i=r.n(n);var a=r(3);var o=r.n(a);var s=r(1);var u=r.n(s);var l=r(7);var f=r(8);function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function h(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function p(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=o()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)i.a?i()(e,t):e.__proto__=t}var v=function(e){p(t,e);function t(){var e;c(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=h(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(n)));a._stack.push(new f["Desaturation"]({desaturation:.5}));a._stack.push(new f["ToneCurve"]({rgbControlPoints:{red:[[0,0],[170,170],[212,219],[234,242],[255,255]],green:[[0,0],[170,168],[234,231],[255,255]],blue:[[0,0],[170,170],[212,208],[255,255]]}}));return a}return t}(l["a"]);v.identifier="breeze";t["a"]=v},function(e,t,r){"use strict";var n=r(2);var i=r.n(n);var a=r(3);var o=r.n(a);var s=r(1);var u=r.n(s);var l=r(7);var f=r(8);function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function h(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function p(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=o()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)i.a?i()(e,t):e.__proto__=t}var v=function(e){p(t,e);function t(){var e;c(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=h(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(n)));a._stack.push(new f["Grayscale"]);return a}return t}(l["a"]);v.identifier="bw";t["a"]=v},function(e,t,r){"use strict";var n=r(2);var i=r.n(n);var a=r(3);var o=r.n(a);var s=r(1);var u=r.n(s);var l=r(7);var f=r(8);function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function h(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function p(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=o()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)i.a?i()(e,t):e.__proto__=t}var v=function(e){p(t,e);function t(){var e;c(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=h(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(n)));a._stack.push(new f["Grayscale"]);a._stack.push(new f["Contrast"]({contrast:1.5}));return a}return t}(l["a"]);v.identifier="bwhard";t["a"]=v},function(e,t,r){"use strict";var n=r(2);var i=r.n(n);var a=r(3);var o=r.n(a);var s=r(1);var u=r.n(s);var l=r(7);var f=r(8);function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function h(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function p(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=o()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)i.a?i()(e,t):e.__proto__=t}var v=function(e){p(t,e);function t(){var e;c(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=h(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(n)));a._stack.push(new f["ToneCurve"]({rgbControlPoints:{red:[[0,69],[55,110],[202,230],[255,255]],green:[[0,44],[89,93],[185,141],[255,189]],blue:[[0,76],[39,82],[218,138],[255,171]]}}));return a}return t}(l["a"]);v.identifier="celsius";t["a"]=v},function(e,t,r){"use strict";var n=r(2);var i=r.n(n);var a=r(3);var o=r.n(a);var s=r(1);var u=r.n(s);var l=r(7);var f=r(8);function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function h(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function p(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=o()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)i.a?i()(e,t):e.__proto__=t}var v=function(e){p(t,e);function t(){var e;c(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=h(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(n)));a._stack.push(new f["ToneCurve"]({rgbControlPoints:{red:[[0,0],[44,44],[124,143],[221,204],[255,255]],green:[[0,0],[130,127],[213,199],[255,255]],blue:[[0,0],[51,52],[219,204],[255,255]]}}));return a}return t}(l["a"]);v.identifier="chest";t["a"]=v},function(e,t,r){"use strict";var n=r(2);var i=r.n(n);var a=r(3);var o=r.n(a);var s=r(1);var u=r.n(s);var l=r(7);var f=r(8);function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function h(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function p(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=o()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)i.a?i()(e,t):e.__proto__=t}var v=function(e){p(t,e);function t(){var e;c(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=h(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(n)));a._stack.push(new f["ToneCurve"]({rgbControlPoints:{red:[[0,0],[44,28],[63,48],[128,132],[235,248],[255,255]],green:[[0,0],[20,10],[60,45],[190,209],[211,231],[255,255]],blue:[[0,31],[41,62],[150,142],[234,212],[255,224]]}}));return a}return t}(l["a"]);v.identifier="fixie";t["a"]=v},function(e,t,r){"use strict";var n=r(2);var i=r.n(n);var a=r(3);var o=r.n(a);var s=r(1);var u=r.n(s);var l=r(7);var f=r(8);function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function h(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function p(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=o()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)i.a?i()(e,t):e.__proto__=t}var v=function(e){p(t,e);function t(){var e;c(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=h(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(n)));a._stack.push(new f["Saturation"]({saturation:1.35}));a._stack.push(new f["Contrast"]({contrast:1.1}));return a}return t}(l["a"]);v.identifier="food";t["a"]=v},function(e,t,r){"use strict";var n=r(2);var i=r.n(n);var a=r(3);var o=r.n(a);var s=r(1);var u=r.n(s);var l=r(7);var f=r(8);function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function h(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function p(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=o()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)i.a?i()(e,t):e.__proto__=t}var v=function(e){p(t,e);function t(){var e;c(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=h(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(n)));a._stack.push(new f["ToneCurve"]({rgbControlPoints:{red:[[0,9],[21,11],[45,24],[255,220]],green:[[0,12],[21,21],[42,42],[150,150],[170,173],[255,210]],blue:[[0,28],[43,72],[128,185],[255,220]]}}));return a}return t}(l["a"]);v.identifier="fridge";t["a"]=v},function(e,t,r){"use strict";var n=r(2);var i=r.n(n);var a=r(3);var o=r.n(a);var s=r(1);var u=r.n(s);var l=r(7);var f=r(8);function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function h(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function p(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=o()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)i.a?i()(e,t):e.__proto__=t}var v=function(e){p(t,e);function t(){var e;c(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=h(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(n)));a._stack.push(new f["ToneCurve"]({rgbControlPoints:{red:[[0,65],[28,67],[67,113],[125,183],[187,217],[255,229]],green:[[0,52],[42,59],[104,134],[169,209],[255,240]],blue:[[0,52],[65,68],[93,104],[150,153],[255,198]]}}));return a}return t}(l["a"]);v.identifier="front";t["a"]=v},function(e,t,r){"use strict";var n=r(2);var i=r.n(n);var a=r(3);var o=r.n(a);var s=r(1);var u=r.n(s);var l=r(7);var f=r(8);function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function h(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function p(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=o()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)i.a?i()(e,t):e.__proto__=t}var v=function(e){p(t,e);function t(){var e;c(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=h(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(n)));a._stack.push(new f["Contrast"]({contrast:1.1}));a._stack.push(new f["ToneCurve"]({rgbControlPoints:{red:[[0,0],[94,74],[181,205],[255,255]],green:[[0,0],[127,127],[255,255]],blue:[[0,0],[102,73],[227,213],[255,255]]}}));return a}return t}(l["a"]);v.identifier="glam";t["a"]=v},function(e,t,r){"use strict";var n=r(2);var i=r.n(n);var a=r(3);var o=r.n(a);var s=r(1);var u=r.n(s);var l=r(7);var f=r(8);function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function h(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function p(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=o()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)i.a?i()(e,t):e.__proto__=t}var v=function(e){p(t,e);function t(){var e;c(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=h(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(n)));a._stack.push(new f["Gobblin"]);return a}return t}(l["a"]);v.identifier="gobblin";t["a"]=v},function(e,t,r){"use strict";var n=r(2);var i=r.n(n);var a=r(3);var o=r.n(a);var s=r(1);var u=r.n(s);var l=r(7);var f=r(8);function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function h(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function p(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=o()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)i.a?i()(e,t):e.__proto__=t}var v=function(e){p(t,e);function t(){var e;c(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=h(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(n)));a._stack.push(new f["ToneCurve"]({controlPoints:[[0,0],[53,32],[91,80],[176,205],[255,255]]}));a._stack.push(new f["Saturation"]({saturation:.9}));return a}return t}(l["a"]);v.identifier="k1";t["a"]=v},function(e,t,r){"use strict";var n=r(2);var i=r.n(n);var a=r(3);var o=r.n(a);var s=r(1);var u=r.n(s);var l=r(4);var f=r.n(l);var c=r(7);var h=r(8);function p(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function v(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function d(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=o()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)i.a?i()(e,t):e.__proto__=t}var y=function(e){d(t,e);function t(){var e;p(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=v(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(n)));a._stack.push(new h["ToneCurve"]({controlPoints:[[0,0],[54,33],[77,82],[94,103],[122,126],[177,193],[229,232],[255,255]]}));a._stack.push(new h["SoftColorOverlay"]({color:new l["Color"](40/255,40/255,40/255)}));return a}return t}(c["a"]);y.identifier="k2";t["a"]=y},function(e,t,r){"use strict";var n=r(2);var i=r.n(n);var a=r(3);var o=r.n(a);var s=r(1);var u=r.n(s);var l=r(7);var f=r(8);function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function h(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function p(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=o()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)i.a?i()(e,t):e.__proto__=t}var v=function(e){p(t,e);function t(){var e;c(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=h(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(n)));a._stack.push(new f["Saturation"]({saturation:.5}));return a}return t}(l["a"]);v.identifier="k6";t["a"]=v},function(e,t,r){"use strict";var n=r(2);var i=r.n(n);var a=r(3);var o=r.n(a);var s=r(1);var u=r.n(s);var l=r(7);var f=r(8);function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function h(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function p(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=o()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)i.a?i()(e,t):e.__proto__=t}var v=function(e){p(t,e);function t(){var e;c(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=h(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(n)));a._stack.push(new f["ToneCurve"]({controlPoints:[[0,0],[17,27],[46,69],[90,112],[156,200],[203,243],[255,255]]}));a._stack.push(new f["Saturation"]({saturation:.7}));return a}return t}(l["a"]);v.identifier="kdynamic";t["a"]=v},function(e,t,r){"use strict";var n=r(2);var i=r.n(n);var a=r(3);var o=r.n(a);var s=r(1);var u=r.n(s);var l=r(7);var f=r(8);function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function h(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function p(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=o()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)i.a?i()(e,t):e.__proto__=t}var v=function(e){p(t,e);function t(){var e;c(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=h(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(n)));a._stack.push(new f["Desaturation"]({desaturation:.4}));a._stack.push(new f["ToneCurve"]({rgbControlPoints:{red:[[0,20],[40,20],[106,111],[129,153],[190,223],[255,255]],green:[[0,20],[40,20],[62,41],[106,108],[132,159],[203,237],[255,255]],blue:[[0,40],[40,40],[73,60],[133,160],[191,297],[203,237],[237,239],[255,255]]}}));return a}return t}(l["a"]);v.identifier="lenin";t["a"]=v},function(e,t,r){"use strict";var n=r(2);var i=r.n(n);var a=r(3);var o=r.n(a);var s=r(1);var u=r.n(s);var l=r(7);var f=r(8);function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function h(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function p(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=o()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)i.a?i()(e,t):e.__proto__=t}var v=function(e){p(t,e);function t(){var e;c(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=h(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(n)));a._stack.push(new f["ToneCurve"]({controlPoints:[[0,0],[87,20],[131,156],[183,205],[255,200]]}));return a}return t}(l["a"]);v.identifier="lomo";t["a"]=v},function(e,t,r){"use strict";var n=r(2);var i=r.n(n);var a=r(3);var o=r.n(a);var s=r(1);var u=r.n(s);var l=r(7);var f=r(8);function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function h(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function p(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=o()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)i.a?i()(e,t):e.__proto__=t}var v=function(e){p(t,e);function t(){var e;c(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=h(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(n)));a._stack.push(new f["ToneCurve"]({rgbControlPoints:{red:[[0,0],[41,84],[87,134],[255,255]],green:[[0,0],[255,216]],blue:[[0,0],[255,131]]}}));return a}return t}(l["a"]);v.identifier="mellow";t["a"]=v},function(e,t,r){"use strict";var n=r(2);var i=r.n(n);var a=r(3);var o=r.n(a);var s=r(1);var u=r.n(s);var l=r(4);var f=r.n(l);var c=r(7);var h=r(8);function p(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function v(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function d(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=o()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)i.a?i()(e,t):e.__proto__=t}var y=l["Math"].ColorMatrix;var _=function(e){d(t,e);function t(){var e;p(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=v(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(n)));var o=new y(.8158218291630716,0,0,0,-.01779810181190647,0,.8098360655737704,0,0,.0916393442622953,0,0,.4596336773932402,0,.12760574782432707,0,0,0,1,0);a._stack.push(new h["ColorMatrixPrimitive"]({colorMatrix:o}));var s=new l["Color"](.8,.6,.9);a._stack.push(new h["Gamma"]({gamma:s}));return a}return t}(c["a"]);_.identifier="metal";t["a"]=_},function(e,t,r){"use strict";var n=r(2);var i=r.n(n);var a=r(3);var o=r.n(a);var s=r(1);var u=r.n(s);var l=r(7);var f=r(8);function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function h(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function p(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=o()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)i.a?i()(e,t):e.__proto__=t}var v=function(e){p(t,e);function t(){var e;c(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=h(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(n)));a._stack.push(new f["ToneCurve"]({rgbControlPoints:{red:[[0,40],[255,230]],green:[[0,10],[255,225]],blue:[[0,20],[255,181]]}}));a._stack.push(new f["Glow"]);return a}return t}(l["a"]);v.identifier="morning";t["a"]=v},function(e,t,r){"use strict";var n=r(2);var i=r.n(n);var a=r(3);var o=r.n(a);var s=r(1);var u=r.n(s);var l=r(7);var f=r(8);function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function h(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function p(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=o()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)i.a?i()(e,t):e.__proto__=t}var v=function(e){p(t,e);function t(){var e;c(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=h(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(n)));a._stack.push(new f["ToneCurve"]({rgbControlPoints:{red:[[0,0],[115,130],[195,215],[255,255]],green:[[0,0],[148,153],[172,215],[255,255]],blue:[[0,46],[58,75],[178,205],[255,255]]},textureGLUnit:2}));a._stack.push(new f["ToneCurve"]({controlPoints:[[0,0],[117,151],[189,217],[255,255]],textureGLUnit:3}));a._stack.push(new f["Desaturation"]({desaturation:.65}));return a}return t}(l["a"]);v.identifier="orchid";t["a"]=v},function(e,t,r){"use strict";var n=r(2);var i=r.n(n);var a=r(3);var o=r.n(a);var s=r(1);var u=r.n(s);var l=r(7);var f=r(8);function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function h(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function p(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=o()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)i.a?i()(e,t):e.__proto__=t}var v=function(e){p(t,e);function t(){var e;c(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=h(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(n)));a._stack.push(new f["ToneCurve"]({rgbControlPoints:{red:[[0,0],[94,74],[181,205],[255,255]],green:[[0,0],[34,34],[99,76],[176,190],[255,255]],blue:[[0,0],[102,73],[227,213],[255,255]]}}));a._stack.push(new f["Saturation"]({saturation:.8}));a._stack.push(new f["Contrast"]({contrast:1.5}));return a}return t}(l["a"]);v.identifier="pola";t["a"]=v},function(e,t,r){"use strict";var n=r(2);var i=r.n(n);var a=r(3);var o=r.n(a);var s=r(1);var u=r.n(s);var l=r(7);var f=r(8);function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function h(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function p(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=o()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)i.a?i()(e,t):e.__proto__=t}var v=function(e){p(t,e);function t(){var e;c(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=h(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(n)));a._stack.push(new f["ToneCurve"]({rgbControlPoints:{red:[[0,0],[56,18],[196,209],[255,255]],green:[[0,38],[71,84],[255,255]],blue:[[0,0],[131,133],[204,211],[255,255]]}}));a._stack.push(new f["Saturation"]({saturation:.8}));a._stack.push(new f["Contrast"]({contrast:1.5}));return a}return t}(l["a"]);v.identifier="pola669";t["a"]=v},function(e,t,r){"use strict";var n=r(2);var i=r.n(n);var a=r(3);var o=r.n(a);var s=r(1);var u=r.n(s);var l=r(7);var f=r(8);function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function h(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function p(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=o()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)i.a?i()(e,t):e.__proto__=t}var v=function(e){p(t,e);function t(){var e;c(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=h(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(n)));a._stack.push(new f["Desaturation"]({desaturation:.65}));a._stack.push(new f["ToneCurve"]({rgbControlPoints:{red:[[0,50],[40,78],[118,170],[181,211],[255,255]],green:[[0,27],[28,45],[109,157],[157,195],[179,208],[206,212],[255,240]],blue:[[0,50],[12,55],[46,103],[103,162],[194,182],[241,201],[255,219]]}}));return a}return t}(l["a"]);v.identifier="quozi";t["a"]=v},function(e,t,r){"use strict";var n=r(2);var i=r.n(n);var a=r(3);var o=r.n(a);var s=r(1);var u=r.n(s);var l=r(7);var f=r(8);function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function h(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function p(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=o()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)i.a?i()(e,t):e.__proto__=t}var v=function(e){p(t,e);function t(){var e;c(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=h(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(n)));a._stack.push(new f["ToneCurve"]({rgbControlPoints:{red:[[0,129],[75,153],[181,227],[255,255]],green:[[0,8],[111,85],[212,158],[255,226]],blue:[[0,5],[75,22],[193,90],[255,229]]}}));a._stack.push(new f["Glow"]);return a}return t}(l["a"]);v.identifier="semired";t["a"]=v},function(e,t,r){"use strict";var n=r(2);var i=r.n(n);var a=r(3);var o=r.n(a);var s=r(1);var u=r.n(s);var l=r(7);var f=r(8);function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function h(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function p(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=o()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)i.a?i()(e,t):e.__proto__=t}var v=function(e){p(t,e);function t(){var e;c(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=h(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(n)));a._stack.push(new f["ToneCurve"]({rgbControlPoints:{red:[[0,0],[62,82],[141,154],[255,255]],green:[[0,39],[56,96],[192,176],[255,255]],blue:[[0,0],[174,99],[255,235]]},textureGLUnit:2}));a._stack.push(new f["ToneCurve"]({controlPoints:[[0,0],[55,20],[158,191],[255,255]],textureGLUnit:3}));return a}return t}(l["a"]);v.identifier="sunny";t["a"]=v},function(e,t,r){"use strict";var n=r(2);var i=r.n(n);var a=r(3);var o=r.n(a);var s=r(1);var u=r.n(s);var l=r(7);var f=r(8);function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function h(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function p(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=o()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)i.a?i()(e,t):e.__proto__=t}var v=function(e){p(t,e);function t(){var e;c(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=h(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(n)));a._stack.push(new f["ToneCurve"]({rgbControlPoints:{red:[[0,72],[89,99],[176,212],[255,237]],green:[[0,49],[255,192]],blue:[[0,72],[255,151]]}}));return a}return t}(l["a"]);v.identifier="texas";t["a"]=v},function(e,t,r){"use strict";var n=r(2);var i=r.n(n);var a=r(3);var o=r.n(a);var s=r(1);var u=r.n(s);var l=r(7);var f=r(8);function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function h(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function p(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=o()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)i.a?i()(e,t):e.__proto__=t}var v=function(e){p(t,e);function t(){var e;c(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=h(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(n)));a._stack.push(new f["X400"]);return a}return t}(l["a"]);v.identifier="x400";t["a"]=v},function(e,t,r){"use strict";var n=r(2);var i=r.n(n);var a=r(3);var o=r.n(a);var s=r(1);var u=r.n(s);var l=r(4);var f=r.n(l);var c=r(7);var h=r(8);function p(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function v(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function d(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=o()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)i.a?i()(e,t):e.__proto__=t}var y=function(e){d(t,e);function t(){var e;p(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=v(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(n)));a._lutPrimitive=new h["LookupTableImage"]({image:a._options.image});a._stack.push(a._lutPrimitive);return a}return t}(c["a"]);y.prototype.availableOptions={image:{type:l["OptionType"].IMAGE,required:true,setter:function e(t){if(this._lutPrimitive){this._lutPrimitive.setImage(t)}this.setDirty(true);return t}}};y.identifier="lut";t["a"]=y},function(e,t,r){"use strict";var n=r(2);var i=r.n(n);var a=r(3);var o=r.n(a);var s=r(1);var u=r.n(s);var l=r(4);var f=r.n(l);var c=r(7);var h=r(8);function p(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function v(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function d(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=o()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)i.a?i()(e,t):e.__proto__=t}var y=function(e){d(t,e);function t(){var e;p(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=v(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(n)));var o=a._options,s=o.image,l=o.resolution,f=o.verticalTileCount,c=o.horizontalTileCount;a._lutPrimitive=new h["ThreeDLookupTableImage"]({image:s,resolution:l,verticalTileCount:f,horizontalTileCount:c});a._stack.push(a._lutPrimitive);return a}return t}(c["a"]);y.prototype.availableOptions={image:{type:l["OptionType"].IMAGE,required:true,setter:function e(t){if(this._lutPrimitive){this._lutPrimitive.setImage(t)}this.setDirty(true);return t}},resolution:{type:l["OptionType"].NUMBER,default:128},horizontalTileCount:{type:l["OptionType"].NUMBER,default:5},verticalTileCount:{type:l["OptionType"].NUMBER,default:5}};y.identifier="3d-lut";t["a"]=y},function(e,t,r){"use strict";var n=r(35);var i=r.n(n);var a=r(39);var o=r.n(a);var s=r(0);var u=r.n(s);var l=r(5);var f=r.n(l);var c=r(2);var h=r.n(c);var p=r(3);var v=r.n(p);var d=r(1);var y=r.n(d);var _=r(4);var g=r.n(_);var m=typeof o.a==="function"&&typeof i.a==="symbol"?function(e){return typeof e}:function(e){return e&&typeof o.a==="function"&&e.constructor===o.a&&e!==o.a.prototype?"symbol":typeof e};var b=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;u()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var w=function e(t,r,n){if(t===null)t=Function.prototype;var i=f()(t,r);if(i===undefined){var a=y()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var o=i.get;if(o===undefined){return undefined}return o.call(n)}};function x(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function T(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function k(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=v()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)h.a?h()(e,t):e.__proto__=t}var R=_["Math"].Vector2;var E=function(e){k(t,e);function t(){var e;x(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=T(this,(e=t.__proto__||y()(t)).call.apply(e,[this].concat(n)));a._colorOverlayFilter=new _["Engine"].Filters.ColorOverlayFilter({color:a.getTintColor()});a._frameContainer=new _["Engine"].Container;a._resetSprites();if(a._options.frame){a._createSpritesForFrame(a._options.frame)}return a}b(t,[{key:"_resetSprites",value:function e(){this._spriteGroups={top:{},left:{},right:{},bottom:{}};this._sprites=[];this._repeatSprites={top:[],left:[],right:[],bottom:[]}}},{key:"_createSpritesForFrame",value:function e(t){var r=this;if(!t)return this._disposeSprites();var n=t.imageGroups,i=t.layoutMode;this._layoutMode=i||"horizontal-inside";this._disposeSprites();["top","left","right","bottom"].forEach(function(e){if(typeof n[e]==="undefined")return;["start","mid","end"].forEach(function(t){if(typeof n[e][t]==="undefined")return;var i=n[e][t];if("image"in i){i=i.image}var a=_["Engine"].Texture.fromImage(i);var o=new _["Engine"].Sprite(a);r._spriteGroups[e][t]=o;r._sprites.push(o);r._frameContainer.addChild(o)})})}},{key:"_render",value:function e(t){var r=this._renderTexture.getDimensions();if(this._options.frame){this._colorOverlayFilter.setColor(this.getTintColor());this._updateSprites(t)}if(!this._frameRenderTexture){this._frameRenderTexture=new _["Engine"].RenderTexture(this._sdk.getRenderer(),r.x,r.y);this._frameSprite=new _["Engine"].Sprite(this._frameRenderTexture);this._container.addChild(this._frameSprite)}else{this._frameRenderTexture.resizeTo(r)}this._frameSprite.setAlpha(this._options.alpha);if(this._options.frame&&this._options.frame.tintable){this._frameSprite.setFilters([this._colorOverlayFilter])}else{this._frameSprite.setFilters([])}this._frameRenderTexture.clear();this._frameRenderTexture.render(this._frameContainer);this._renderTexture.render(this._container);return _["Promise"].resolve(this._renderTexture)}},{key:"_updateSprites",value:function e(t){var r=t.getDimensions();this._frameWidth=Math.ceil(t.getDimensions().min()*this._options.scale);this._updateHorizontalSpriteGroup(t,"top",0);this._updateHorizontalSpriteGroup(t,"bottom",r.y-this._frameWidth);this._updateVerticalSpriteGroup(t,"left",0);this._updateVerticalSpriteGroup(t,"right",r.x-this._frameWidth)}},{key:"_updateHorizontalSpriteGroup",value:function e(t,r){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var i=t.getDimensions();var a=this._layoutMode==="vertical-inside";var o=this._spriteGroups[r].start;var s=this._spriteGroups[r].mid;var u=this._spriteGroups[r].end;var l=0;var f=0;var c=void 0,h=void 0;if(o){c=o.getTexture().getDimensions();h=c.y/c.x;l=Math.floor(this._frameWidth/h);var p=new R(0,n);p.x=a?this._frameWidth:0;o.setPosition(p);o.setHeight(this._frameWidth);o.setWidth(l)}if(u){c=u.getTexture().getDimensions();h=c.y/c.x;f=Math.floor(this._frameWidth*h);var v=new R(i.x-f,n);v.x-=a?this._frameWidth:0;u.setPosition(v);u.setHeight(this._frameWidth);u.setWidth(f)}if(s){c=s.getTexture().getDimensions();h=c.y/c.x;var d=new R(l,n);var y=i.x-l-f;if(a){d.x+=this._frameWidth;y-=this._frameWidth*2}s.setPosition(d);s.setWidth(y);s.setHeight(this._frameWidth);if(this._options.frame.imageGroups[r].mid.mode==="repeat"){var _=this._frameWidth/h;var g=Math.ceil(y/_);var m=0;if(g!==-1){var b=Math.round(y/g);s.setWidth(b);m+=b;this._ensureRepeatSpritesExist(g-1,r,s);for(var w=0;w<g-1;w++){b=Math.round((y-m)/(g-w-1));var x=this._repeatSprites[r][w];var T=d.clone().add(m,0).floor();x.setPosition(T);x.setWidth(b);x.setHeight(this._frameWidth);m+=b}}}}}},{key:"_ensureRepeatSpritesExist",value:function e(t,r,n){var i=this;n.getTexture().setMaxListeners(t+1);var a=this._repeatSprites[r].length;if(t>a){var o=t-a;for(var s=0;s<o;s++){var u=new _["Engine"].Sprite(n.getTexture());this._repeatSprites[r].push(u);this._frameContainer.addChild(u);this._sprites.push(u)}}else if(t<a){var l=this._repeatSprites[r].splice(t);l.forEach(function(e){var t=i._sprites.indexOf(e);if(t===-1)return;i._sprites.splice(t,1);i._frameContainer.removeChild(e);e.dispose()})}}},{key:"_updateVerticalSpriteGroup",value:function e(t,r){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var i=t.getDimensions();var a=this._layoutMode==="horizontal-inside";var o=this._spriteGroups[r].start;var s=this._spriteGroups[r].mid;var u=this._spriteGroups[r].end;var l=0;var f=0;var c=void 0,h=void 0;if(o){c=o.getTexture().getDimensions();h=c.y/c.x;l=Math.floor(this._frameWidth*h);var p=new R(n,0);p.y=a?this._frameWidth:0;o.setPosition(p);o.setWidth(this._frameWidth);o.setHeight(l)}if(u){c=u.getTexture().getDimensions();h=c.y/c.x;f=Math.floor(this._frameWidth*h);var v=new R(n,i.y-f);v.y-=a?this._frameWidth:0;u.setPosition(v);u.setWidth(this._frameWidth);u.setHeight(f)}if(s){c=s.getTexture().getDimensions();h=c.y/c.x;var d=new R(n,l);var y=i.y-l-f;if(a){d.y+=this._frameWidth;y-=this._frameWidth*2}s.setPosition(d);s.setHeight(y);s.setWidth(this._frameWidth);if(this._options.frame.imageGroups[r].mid.mode==="repeat"){var _=this._frameWidth*h;var g=Math.ceil(y/_);var m=0;if(g!==-1){var b=Math.round(y/g);s.setHeight(b);m+=b;this._ensureRepeatSpritesExist(g-1,r,s);for(var w=0;w<g-1;w++){b=Math.round((y-m)/(g-w-1));var x=this._repeatSprites[r][w];var T=d.clone().add(0,m).floor();x.setPosition(T);x.setHeight(b);x.setWidth(this._frameWidth);m+=b}}}}}},{key:"_disposeSprites",value:function e(){var t=this;this._sprites.forEach(function(e){t._frameContainer.removeChild(e);var r=e.getTexture().getBaseTexture();r.dispose();e.dispose()});this._resetSprites()}},{key:"dispose",value:function e(){w(t.prototype.__proto__||y()(t.prototype),"dispose",this).call(this);this._disposeSprites()}}],[{key:"validateFrame",value:function e(t){if(!t)return;var r=t.imageGroups,n=t.layoutMode;if(typeof t.identifier!=="string"){throw new Error("Frame needs a property `identifier` of type String.")}if(m(t.imageGroups)!=="object"){throw new Error("Frame needs a property `imageGroups` of type Object.")}var i=function e(t){var n=r[t],i=n.start,a=n.end,o=n.mid;if(typeof r[t]==="undefined")return;if(m(r[t])!=="object"){throw new Error("Frame: `imageGroups."+t+"` needs to be of type Object.")}if(typeof i!=="undefined"&&!(i instanceof _["Image"]||typeof HTMLImageElement!=="undefined"&&i instanceof HTMLImageElement)){throw new Error("Frame: `imageGroups."+t+".start` needs to be of type Image.")}if(typeof o!=="undefined"&&!(i instanceof _["Image"]||typeof HTMLImageElement!=="undefined"&&i instanceof HTMLImageElement)&&(typeof o==="undefined"?"undefined":m(o))!=="object"){throw new Error("Frame: `imageGroups."+t+".mid` needs to be of type Image or Object.")}if(typeof a!=="undefined"&&!(a instanceof _["Image"]||typeof HTMLImageElement!=="undefined"&&a instanceof HTMLImageElement)){throw new Error("Frame: `imageGroups."+t+".end` needs to be of type Image.")}};if(typeof n!=="undefined"&&["vertical-inside","horizontal-inside"].indexOf(n)===-1){throw new Error("Frame: `layoutMode` must be one of vertical-inside, horizontal-inside")}if(typeof tintable!=="undefined"&&typeof tintable!=="boolean"){throw new Error("Frame: `tintable` needs to be of type Boolean.")}i("top");i("left");i("right");i("bottom")}}]);return t}(_["Operation"]);E.identifier="frame";E.prototype.availableOptions={frame:{type:_["OptionType"].OBJECT,validation:E.validateFrame,setter:function e(t,r){if(!r){this._createSpritesForFrame(t)}return t},default:null},alpha:{type:_["OptionType"].NUMBER,default:1},tintColor:{type:_["OptionType"].COLOR,default:new _["Color"](1,1,1,0)},scale:{type:_["OptionType"].NUMBER,default:.1}};g.a.Operations.FrameOperation=E;t["a"]=E},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(5);var o=r.n(a);var s=r(2);var u=r.n(s);var l=r(3);var f=r.n(l);var c=r(1);var h=r.n(c);var p=r(4);var v=r.n(p);var d=r(333);var y=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var _=function e(t,r,n){if(t===null)t=Function.prototype;var i=o()(t,r);if(i===undefined){var a=h()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var s=i.get;if(s===undefined){return undefined}return s.call(n)}};function g(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function m(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function b(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)u.a?u()(e,t):e.__proto__=t}var w=p["Math"].Vector2;var x=function(e){b(t,e);function t(){var e;g(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=m(this,(e=t.__proto__||h()(t)).call.apply(e,[this].concat(n)));a._lastBlurRadius=a._options.blurRadius;a._lastControlPoint1=a._options.controlPoint1.clone();a._lastControlPoint2=a._options.controlPoint2.clone();a._horizontalFilter=new d["a"];a._verticalFilter=new d["a"];a._sprite.setFilters([a._horizontalFilter,a._verticalFilter]);a._horizontalFilter.setDelta(new w(.5,.5));a._verticalFilter.setDelta(new w(-.5,.5));a._filter=new d["a"];return a}y(t,[{key:"rotate",value:function e(t){var r=this._options.controlPoint1;var n=this._options.controlPoint2;if(t===90){r.flip();r.x=1-r.x;n.flip();n.x=1-n.x}else if(t===-90){r.flip();r.y=1-r.y;n.flip();n.y=1-n.y}this.set({controlPoint1:r,controlPoint2:n})}},{key:"flip",value:function e(t){var r=this._options.controlPoint1;var n=this._options.controlPoint2;switch(t){case"horizontal":r.x=1-r.x;n.x=1-n.x;break;case"vertical":r.y=1-r.y;n.y=1-n.y;break}this.set({controlPoint1:r,controlPoint2:n})}},{key:"transform",value:function e(t){var r=this;var n={};["controlPoint1","controlPoint2"].forEach(function(e){var i=r.getOption(e);n[e]=t.applyToRelativePoint(i)});["blurRadius"].forEach(function(e){var i=r.getOption(e);n[e]=t.applyToRelativeSize(i)});this.set(n,false)}},{key:"_renderWebGL",value:function e(t){var r=t.getDimensions();var n=r.min();var i=this._options,a=i.blurRadius,o=i.controlPoint1,s=i.controlPoint2;var u={blurRadius:a*n,controlPoint1:o,controlPoint2:s,texSize:r};this._horizontalFilter.set(u);this._verticalFilter.set(u);this._renderTexture.render(this._container);return p["Promise"].resolve()}},{key:"_renderCanvas",value:function e(t){var r=t.getDimensions();var n=this._options,i=n.blurRadius,a=n.controlPoint1,o=n.controlPoint2;this._filter.set({blurRadius:i,controlPoint1:a.clone(),controlPoint2:o.clone(),texSize:r});this._sprite.setFilters([this._filter]);this._renderTexture.render(this._container);return p["Promise"].resolve()}},{key:"dispose",value:function e(){_(t.prototype.__proto__||h()(t.prototype),"dispose",this).call(this);this._filter.dispose();this._verticalFilter.dispose();this._horizontalFilter.dispose()}},{key:"hasChanges",value:function e(){return true}}]);return t}(p["Operation"]);x.identifier="linear-focus";x.prototype.availableOptions={controlPoint1:{type:p["OptionType"].VECTOR2,default:new w(0,.5)},controlPoint2:{type:p["OptionType"].VECTOR2,default:new w(1,.5)},blurRadius:{type:p["OptionType"].NUMBER,default:.025}};v.a.Operations.LinearFocusOperation=x;t["a"]=x},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(4);var h=r.n(c);var p=r(75);var v=r.n(p);var d=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function y(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function _(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function g(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var m=c["Math"].Vector2;var b=function(e){g(t,e);function t(){var e;y(this,t);for(var n=arguments.length,i=Array(n),a=0;a<n;a++){i[a]=arguments[a]}var o=_(this,(e=t.__proto__||f()(t)).call.apply(e,[this].concat(i)));o._fragmentSource=r(334);o._lastBlurRadius=null;o._lastControlPoint1=new m;o._lastControlPoint2=new m;o._blurredRenderTarget=new c["Engine"].CanvasRenderTarget(100,100,1);o._maskRenderTarget=new c["Engine"].CanvasRenderTarget(100,100,1);return o}d(t,[{key:"_applyCanvas",value:function e(t,r,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var a=r.getDimensions();var o=!this._blurredRenderTarget.getDimensions().equals(a);this._blurredRenderTarget.setPixelRatio(r.getPixelRatio());this._blurredRenderTarget.resizeTo(r.getDimensions());this._maskRenderTarget.setPixelRatio(r.getPixelRatio());this._maskRenderTarget.resizeTo(r.getDimensions());if(!this._lastControlPoint1.equals(this._options.controlPoint1)||!this._lastControlPoint2.equals(this._options.controlPoint2)||o){this._renderMask();this._lastControlPoint1=this._options.controlPoint1.clone();this._lastControlPoint2=this._options.controlPoint2.clone()}if(this._lastBlurRadius!==this._options.blurRadius||o){this._blurImage(r);this._lastBlurRadius=this._options.blurRadius}this._applyMask(r,n)}},{key:"_blurImage",value:function e(t){var r=t.getCanvas();var n=t.getContext();var i=new m(r.width,r.height);var a=n.getImageData(0,0,r.width,r.height);v.a.stackBlurCanvasRGBA(a,0,0,r.width,r.height,this._options.blurRadius*i.min());var o=this._blurredRenderTarget.getContext();o.putImageData(a,0,0)}},{key:"_renderMask",value:function e(){var t=this._maskRenderTarget.getCanvas();var r=this._maskRenderTarget.getContext();var n=new m(t.width,t.height);var i=this._options.controlPoint1.clone().multiply(n);var a=this._options.controlPoint2.clone().multiply(n);var o=r.createLinearGradient(i.x,i.y,a.x,a.y);o.addColorStop(0,"#FFFFFF");o.addColorStop(1,"#000000");r.fillStyle=o;r.fillRect(0,0,t.width,t.height)}},{key:"_applyMask",value:function e(t,r){var n=r.getContext();var i=t.getCanvas();var a=t.getContext();var o=this._blurredRenderTarget.getContext();var s=this._maskRenderTarget.getContext();var u=a.getImageData(0,0,i.width,i.height);var l=u.data;var f=o.getImageData(0,0,i.width,i.height).data;var c=s.getImageData(0,0,i.width,i.height).data;var h=void 0;for(var p=0;p<i.width*i.height*4;p+=4){h=c[p]/255;l[p]=h*l[p]+(1-h)*f[p];l[p+1]=h*l[p+1]+(1-h)*f[p+1];l[p+2]=h*l[p+2]+(1-h)*f[p+2]}n.putImageData(u,0,0)}}]);return t}(c["Engine"].Filter);b.prototype.availableOptions={blurRadius:{type:c["OptionType"].NUMBER,default:30,uniformType:c["UniformType"].FLOAT},controlPoint1:{type:c["OptionType"].VECTOR2,default:new m(0,.5),uniformType:c["UniformType"].FLOAT2},controlPoint2:{type:c["OptionType"].VECTOR2,default:new m(1,.5),uniformType:c["UniformType"].FLOAT2},delta:{type:c["OptionType"].VECTOR2,default:new m(1,1),uniformType:c["UniformType"].FLOAT2},texSize:{type:c["OptionType"].VECTOR2,default:new m(100,100),uniformType:c["UniformType"].FLOAT2}};t["a"]=b},function(e,t){e.exports="/*!\n * Based on evanw's glfx.js tilt shift shader:\n * https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js\n */\n\nuniform sampler2D u_image;\nuniform float u_blurRadius;\nuniform vec2 u_controlPoint1;\nuniform vec2 u_controlPoint2;\nuniform vec2 u_delta;\nuniform vec2 u_texSize;\nvarying vec2 v_texCoord;\n\nfloat random(vec2 co)\n{\n highp float a = 12.9898;\n highp float b = 78.233;\n highp float c = 43758.5453;\n highp float dt = dot(co.xy,vec2(a,b));\n highp float sn = mod(dt, 3.14);\n return fract(sin(sn) * c);\n}\n\nvoid main() {\n vec4 color = vec4(0.0);\n float total = 0.0;\n\n vec2 vector = u_controlPoint2 - u_controlPoint1;\n float offset = random(gl_FragCoord.xy / u_texSize.xy);\n\n float radius = smoothstep(0.0, 1.0,\n abs(\n clamp(dot(v_texCoord - u_controlPoint1, vector) / dot(vector, vector), 0.0, 1.0)\n )\n ) * u_blurRadius;\n\n for (float t = -30.0; t <= 30.0; t++) {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec4 _sample = texture2D(u_image, v_texCoord + u_delta * percent * radius / u_texSize);\n\n _sample.rgb *= _sample.a;\n\n color += _sample * weight;\n total += weight;\n }\n\n gl_FragColor = color / total;\n gl_FragColor.rgb /= gl_FragColor.a + 0.00001;\n}\n"},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(5);var o=r.n(a);var s=r(2);var u=r.n(s);var l=r(3);var f=r.n(l);var c=r(1);var h=r.n(c);var p=r(4);var v=r.n(p);var d=r(336);var y=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var _=function e(t,r,n){if(t===null)t=Function.prototype;var i=o()(t,r);if(i===undefined){var a=h()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var s=i.get;if(s===undefined){return undefined}return s.call(n)}};function g(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function m(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function b(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)u.a?u()(e,t):e.__proto__=t}var w=p["Math"].Vector2;var x=function(e){b(t,e);function t(){var e;g(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=m(this,(e=t.__proto__||h()(t)).call.apply(e,[this].concat(n)));a._lastBlurRadius=a._options.blurRadius;a._lastSize=a._options.size;a._lastGradientSize=a._options.gradientSize;a._horizontalFilter=new d["a"];a._verticalFilter=new d["a"];a._sprite.setFilters([a._horizontalFilter,a._verticalFilter]);a._horizontalFilter.setDelta(new w(.5,.5));a._verticalFilter.setDelta(new w(-.5,.5));a._filter=new d["a"];return a}y(t,[{key:"rotate",value:function e(t){var r=this._options.start;var n=this._options.end;if(t===90){r.flip();r.x=1-r.x;n.flip();n.x=1-n.x}else if(t===-90){r.flip();r.y=1-r.y;n.flip();n.y=1-n.y}this.set({start:r,end:n})}},{key:"flip",value:function e(t){var r=this._options.start;var n=this._options.end;switch(t){case"horizontal":r.x=1-r.x;n.x=1-n.x;break;case"vertical":r.y=1-r.y;n.y=1-n.y;break}this.set({start:r,end:n})}},{key:"transform",value:function e(t){var r=this;var n={};["start","end"].forEach(function(e){var i=r.getOption(e);n[e]=t.applyToRelativePoint(i)});["blurRadius","size","gradientSize"].forEach(function(e){var i=r.getOption(e);n[e]=t.applyToRelativeSize(i)});this.set(n,false)}},{key:"_renderWebGL",value:function e(t){var r=t.getDimensions();var n=r.min();var i=this._options.start.clone();var a=this._options.end.clone();var o=this._options,s=o.blurRadius,u=o.size,l=o.gradientSize;var f={blurRadius:s*n,size:u*n,gradientSize:l*n,start:i.clone().multiply(r),end:a.clone().multiply(r),texSize:r};this._horizontalFilter.set(f);this._verticalFilter.set(f);this._renderTexture.render(this._container);return p["Promise"].resolve()}},{key:"_renderCanvas",value:function e(t){var r=t.getDimensions();var n=this._options,i=n.blurRadius,a=n.size,o=n.gradientSize,s=n.start,u=n.end;this._filter.set({blurRadius:i,gradientSize:o,size:a,start:s.clone(),end:u.clone(),texSize:r});this._sprite.setFilters([this._filter]);this._renderTexture.render(this._container);return p["Promise"].resolve()}},{key:"dispose",value:function e(){_(t.prototype.__proto__||h()(t.prototype),"dispose",this).call(this);this._filter.dispose();this._verticalFilter.dispose();this._horizontalFilter.dispose()}},{key:"hasChanges",value:function e(){return true}}]);return t}(p["Operation"]);x.identifier="mirrored-focus";x.prototype.availableOptions={start:{type:p["OptionType"].VECTOR2,default:new w(0,.5)},end:{type:p["OptionType"].VECTOR2,default:new w(1,.5)},blurRadius:{type:p["OptionType"].NUMBER,default:.025},size:{type:p["OptionType"].NUMBER,default:.1},gradientSize:{type:p["OptionType"].NUMBER,default:.1}};v.a.Operations.MirroredFocusOperation=x;t["a"]=x},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(4);var h=r.n(c);var p=r(75);var v=r.n(p);var d=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function y(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function _(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function g(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var m=c["Math"].Vector2;var b=function(e){g(t,e);function t(){var e;y(this,t);for(var n=arguments.length,i=Array(n),a=0;a<n;a++){i[a]=arguments[a]}var o=_(this,(e=t.__proto__||f()(t)).call.apply(e,[this].concat(i)));o._fragmentSource=r(337);o._lastBlurRadius=null;o._lastGradientRadius=null;o._lastStart=new m;o._lastEnd=new m;o._blurredRenderTarget=new c["Engine"].CanvasRenderTarget(100,100,1);o._maskRenderTarget=new c["Engine"].CanvasRenderTarget(100,100,1);return o}d(t,[{key:"_applyCanvas",value:function e(t,r,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var a=r.getDimensions();var o=!this._blurredRenderTarget.getDimensions().equals(a);this._blurredRenderTarget.setPixelRatio(r.getPixelRatio());this._blurredRenderTarget.resizeTo(r.getDimensions());this._maskRenderTarget.setPixelRatio(r.getPixelRatio());this._maskRenderTarget.resizeTo(r.getDimensions());if(!this._lastStart.equals(this._options.start)||!this._lastEnd.equals(this._options.end)||this._lastGradientRadius!==this._options.size||o){this._renderMask();this._lastStart=this._options.start.clone();this._lastEnd=this._options.end.clone();this._lastGradientRadius=this._options.size}if(this._lastBlurRadius!==this._options.blurRadius||o){this._blurImage(r);this._lastBlurRadius=this._options.blurRadius}this._applyMask(r,n)}},{key:"_blurImage",value:function e(t){var r=t.getCanvas();var n=t.getContext();var i=new m(r.width,r.height);var a=n.getImageData(0,0,r.width,r.height);v.a.stackBlurCanvasRGBA(a,0,0,r.width,r.height,this._options.blurRadius*i.min());var o=this._blurredRenderTarget.getContext();o.putImageData(a,0,0)}},{key:"_renderMask",value:function e(){var t=this._maskRenderTarget.getCanvas();var r=this._maskRenderTarget.getContext();var n=this._maskRenderTarget.getPixelRatio();var i=new m(t.width,t.height);var a=this._options.size*i.min()*n;var o=this._options.gradientSize*i.min()*n;var s=this._options.start.clone().multiply(i);var u=this._options.end.clone().multiply(i);var l=u.clone().subtract(s);var f=s.clone().add(l.clone().divide(2));var c=l.len();var h=l.clone().divide(c);var p=f.clone().add((a+o)*h.y,-(a+o)*h.x);var v=f.clone().add(-(a+o)*h.y,(a+o)*h.x);var d=r.createLinearGradient(p.x,p.y,v.x,v.y);var y=v.clone().subtract(p).len();d.addColorStop(0,"#000000");d.addColorStop(o/2/y,"#FFFFFF");d.addColorStop(1-o/2/y,"#FFFFFF");d.addColorStop(1,"#000000");r.fillStyle=d;r.fillRect(0,0,t.width,t.height)}},{key:"_applyMask",value:function e(t,r){var n=r.getContext();var i=t.getCanvas();var a=t.getContext();var o=this._blurredRenderTarget.getContext();var s=this._maskRenderTarget.getContext();var u=a.getImageData(0,0,i.width,i.height);var l=u.data;var f=o.getImageData(0,0,i.width,i.height).data;var c=s.getImageData(0,0,i.width,i.height).data;var h=void 0;for(var p=0;p<i.width*i.height*4;p+=4){h=c[p]/255;l[p]=h*l[p]+(1-h)*f[p];l[p+1]=h*l[p+1]+(1-h)*f[p+1];l[p+2]=h*l[p+2]+(1-h)*f[p+2]}n.putImageData(u,0,0)}}]);return t}(c["Engine"].Filter);b.prototype.availableOptions={blurRadius:{type:c["OptionType"].NUMBER,default:30,uniformType:c["UniformType"].FLOAT},size:{type:c["OptionType"].NUMBER,default:50,uniformType:c["UniformType"].FLOAT},gradientSize:{type:c["OptionType"].NUMBER,default:50,uniformType:c["UniformType"].FLOAT},start:{type:c["OptionType"].VECTOR2,default:new m(0,.5),uniformType:c["UniformType"].FLOAT2},end:{type:c["OptionType"].VECTOR2,default:new m(1,.5),uniformType:c["UniformType"].FLOAT2},delta:{type:c["OptionType"].VECTOR2,default:new m(1,1),uniformType:c["UniformType"].FLOAT2},texSize:{type:c["OptionType"].VECTOR2,default:new m(100,100),uniformType:c["UniformType"].FLOAT2}};t["a"]=b},function(e,t){e.exports="/*\n * Based on evanw's glfx.js tilt shift shader:\n * https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js\n * @license\n */\n\nuniform sampler2D u_image;\nuniform float u_blurRadius;\nuniform float u_gradientSize;\nuniform float u_size;\nuniform vec2 u_start;\nuniform vec2 u_end;\nuniform vec2 u_delta;\nuniform vec2 u_texSize;\nvarying vec2 v_texCoord;\n\nfloat random(vec2 co)\n{\n highp float a = 12.9898;\n highp float b = 78.233;\n highp float c = 43758.5453;\n highp float dt = dot(co.xy,vec2(a,b));\n highp float sn = mod(dt, 3.14);\n return fract(sin(sn) * c);\n}\n\nvoid main() {\n vec4 color = vec4(0.0);\n float total = 0.0;\n\n float offset = random(gl_FragCoord.xy / u_texSize.xy);\n\n vec2 normal = normalize(vec2(u_start.y - u_end.y, u_end.x - u_start.x));\n float radius = smoothstep(0.0, 1.0,\n (abs(\n dot(v_texCoord * u_texSize - u_start, normal)\n ) - u_size) / u_gradientSize\n ) * u_blurRadius;\n\n for (float t = -30.0; t <= 30.0; t++) {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec4 _sample = texture2D(u_image, v_texCoord + u_delta * percent * radius / u_texSize);\n\n _sample.rgb *= _sample.a;\n\n color += _sample * weight;\n total += weight;\n }\n\n gl_FragColor = color / total;\n gl_FragColor.rgb /= gl_FragColor.a + 0.00001;\n}\n"},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(4);var h=r.n(c);var p=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function v(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function d(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function y(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var _=c["Math"].Vector2;var g=function(e){y(t,e);function t(){v(this,t);return d(this,(t.__proto__||f()(t)).apply(this,arguments))}p(t,[{key:"_render",value:function e(t){var r=this._options.rotation%360;var n=r*(Math.PI/180);this._sprite.setScale(this._options.flipHorizontally?-1:1,this._options.flipVertically?-1:1);this._sprite.setRotation(n);this._sprite.setAnchor(.5,.5);this._sprite.updateTransform();var i=this._sprite.getBounds();this._renderTexture.resizeTo(new _(i.width,i.height));this._sprite.setPosition(this._renderTexture.getDimensions().divide(2).round());this._renderTexture.render(this._container);return c["Promise"].resolve()}},{key:"getNewDimensions",value:function e(t){t=t.clone();if(this._options.rotation%180){t.flip()}return t}},{key:"flip",value:function e(t){var r=this._options.rotation;if(r===90||r===270){if(t==="vertical"){t="horizontal"}else{t="vertical"}}switch(t){case"vertical":this.setFlipVertically(!this.getFlipVertically());break;case"horizontal":this.setFlipHorizontally(!this.getFlipHorizontally());break}}}]);return t}(c["Operation"]);g.identifier="orientation";g.prototype.availableOptions={rotation:{type:c["OptionType"].NUMBER,default:0,validation:function e(t){if(t%90!==0){throw new Error("OrientationOperation: `rotation` has to be a multiple of 90.")}},setter:function e(t){return(t+360)%360}},flipVertically:{type:c["OptionType"].BOOLEAN,default:false},flipHorizontally:{type:c["OptionType"].BOOLEAN,default:false}};h.a.Operations.OrientationOperation=g;t["a"]=g},function(e,t,r){"use strict";var n=r(69);var i=r.n(n);var a=r(0);var o=r.n(a);var s=r(5);var u=r.n(s);var l=r(2);var f=r.n(l);var c=r(3);var h=r.n(c);var p=r(1);var v=r.n(p);var d=r(4);var y=r.n(d);var _=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;o()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var g=function e(t,r,n){if(t===null)t=Function.prototype;var i=u()(t,r);if(i===undefined){var a=v()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var o=i.get;if(o===undefined){return undefined}return o.call(n)}};function m(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function b(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function w(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=h()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)f.a?f()(e,t):e.__proto__=t}var x=d["Engine"].Filters.OverlayFilter;var T=d["Math"].Vector2;var k=4;var R=function(e){w(t,e);function t(){var e;m(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=b(this,(e=t.__proto__||v()(t)).call.apply(e,[this].concat(n)));a._overlayTexture=d["Engine"].Texture.fromImage(a._options.image);a._overlayContainer=new d["Engine"].Container;a._overlaySprite=new d["Engine"].Sprite;a._overlaySprite.setTexture(a._overlayTexture);a._overlaySprite.setAnchor(0,0);a._overlayContainer.addChild(a._overlaySprite);a._overlayFilter=new d["Engine"].Filters.OverlayFilter({overlayImage:a._overlayTexture.getBaseTexture().getGLUnit(),overlayTexture:a._overlayTexture});a._sprite.setFilters([a._overlayFilter]);a._renderedOverlaySprite=new d["Engine"].Sprite;a._renderedOverlayContainer=new d["Engine"].Container;a._renderedOverlayContainer.addChild(a._renderedOverlaySprite);a._overlayRendered=false;a._lastInputDimensions=new T(0,0);return a}_(t,[{key:"setOption",value:function e(r,n){g(t.prototype.__proto__||v()(t.prototype),"setOption",this).call(this,r,n);if(r==="image"&&n&&this._sdk){var i=this._sdk.getRenderer();var a=this._overlayTexture.getBaseTexture();a.setSource(n);if(i.isOfType(d["RendererType"].WEBGL)){i.updateTexture(a)}this._overlayRendered=false}}},{key:"_render",value:function e(t){var r=t.getDimensions();var n=this._options,i=n.image,a=n.alpha,o=n.blendMode;if(!i){this._sprite.setFilters([]);this._renderTexture.render(this._container);return d["Promise"].resolve()}if(!this._overlayRendered||!this._lastInputDimensions.equals(r)){this._renderOverlayToRenderTexture(t);this._overlayRendered=true;this._lastInputDimensions.copy(r)}this._overlayFilter.set({blendMode:o,overlayImage:this._overlayRenderTexture.getBaseTexture().getGLUnit(),overlayTexture:this._overlayRenderTexture,alpha:a});this._sprite.setFilters([this._overlayFilter]);this._renderTexture.render(this._container);return d["Promise"].resolve(this._renderTexture)}},{key:"_renderOverlayToRenderTexture",value:function e(t){var r=this._sdk.getRenderer();var n=t.getDimensions();if(!this._overlayRenderTexture){this._overlayRenderTexture=new d["Engine"].RenderTexture(r,n.x,n.y);this._renderedOverlaySprite.setTexture(this._overlayRenderTexture)}var i=this._options.image,a=i.width,o=i.height;var s=d["Utils"].resizeVectorToFill(new T(a,o),n);this._overlaySprite.setWidth(s.x);this._overlaySprite.setHeight(s.y);var u=this._overlayRenderTexture.getBaseTexture();if(r.isOfType(d["RendererType"].WEBGL)){u.setGLUnit(k);r.updateTexture(u,false)}this._overlayRenderTexture.resizeTo(n);this._overlayRenderTexture.render(this._overlayContainer)}},{key:"dispose",value:function e(){g(t.prototype.__proto__||v()(t.prototype),"dispose",this).call(this);this._overlaySprite.dispose()}}]);return t}(d["Operation"]);R.identifier="overlay";R.BLEND_MODES=x.BLEND_MODES;R.prototype.availableOptions={identifier:{type:d["OptionType"].STRING},image:{type:d["OptionType"].IMAGE},blendMode:{type:d["OptionType"].NUMBER,default:x.BLEND_MODES.MULTIPLY,available:i()(x.BLEND_MODES).map(function(e){return x.BLEND_MODES[e]})},alpha:{type:d["OptionType"].NUMBER,default:1}};y.a.Operations.OverlayOperation=R;t["a"]=R},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(5);var o=r.n(a);var s=r(2);var u=r.n(s);var l=r(3);var f=r.n(l);var c=r(1);var h=r.n(c);var p=r(4);var v=r.n(p);var d=r(341);var y=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var _=function e(t,r,n){if(t===null)t=Function.prototype;var i=o()(t,r);if(i===undefined){var a=h()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var s=i.get;if(s===undefined){return undefined}return s.call(n)}};function g(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function m(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function b(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)u.a?u()(e,t):e.__proto__=t}var w=p["Math"].Vector2;var x=function(e){b(t,e);function t(){var e;g(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=m(this,(e=t.__proto__||h()(t)).call.apply(e,[this].concat(n)));a._lastBlurRadius=a._options.blurRadius;a._lastGradientRadius=a._options.gradientRadius;a._horizontalFilter=new d["a"];a._verticalFilter=new d["a"];a._sprite.setFilters([a._horizontalFilter,a._verticalFilter]);a._horizontalFilter.setDelta(new w(.5,.5));a._verticalFilter.setDelta(new w(-.5,.5));a._filter=new d["a"];return a}y(t,[{key:"rotate",value:function e(t){var r=this._options.position;if(t===90){r.flip();r.x=1-r.x}else if(t===-90){r.flip();r.y=1-r.y}this.set({position:r})}},{key:"flip",value:function e(t){var r=this._options.position;switch(t){case"horizontal":r.x=1-r.x;break;case"vertical":r.y=1-r.y;break}this.set({position:r})}},{key:"transform",value:function e(t){var r=this;var n={};var i=this.getPosition();n.position=t.applyToRelativePoint(i);["radius","blurRadius","gradientRadius"].forEach(function(e){var i=r.getOption(e);n[e]=t.applyToRelativeSize(i)});this.set(n,false)}},{key:"_renderWebGL",value:function e(t){var r=t.getDimensions();var n=r.min();var i=this._options,a=i.position,o=i.blurRadius,s=i.radius,u=i.gradientRadius;var l={blurRadius:o*n,radius:s*n,gradientRadius:u*n,position:a.clone().multiply(r),texSize:r};this._horizontalFilter.set(l);this._verticalFilter.set(l);this._renderTexture.render(this._container);return p["Promise"].resolve()}},{key:"_renderCanvas",value:function e(t){var r=this._options,n=r.blurRadius,i=r.radius,a=r.gradientRadius,o=r.position;var s=t.getDimensions();this._filter.set({blurRadius:n,radius:i,gradientRadius:a,position:o,texSize:s});this._sprite.setFilters([this._filter]);this._renderTexture.render(this._container);return p["Promise"].resolve()}},{key:"dispose",value:function e(){_(t.prototype.__proto__||h()(t.prototype),"dispose",this).call(this);this._filter.dispose();this._verticalFilter.dispose();this._horizontalFilter.dispose()}},{key:"hasChanges",value:function e(){return true}}]);return t}(p["Operation"]);x.identifier="radial-focus";x.prototype.availableOptions={position:{type:p["OptionType"].VECTOR2,default:new w(.5,.5)},radius:{type:p["OptionType"].NUMBER,default:.25},gradientRadius:{type:p["OptionType"].NUMBER,default:.125},blurRadius:{type:p["OptionType"].NUMBER,default:.025}};v.a.Operations.RadialFocusOperation=x;t["a"]=x},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(4);var h=r.n(c);var p=r(75);var v=r.n(p);var d=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function y(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function _(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function g(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var m=c["Math"].Vector2;var b=function(e){g(t,e);function t(){var e;y(this,t);for(var n=arguments.length,i=Array(n),a=0;a<n;a++){i[a]=arguments[a]}var o=_(this,(e=t.__proto__||f()(t)).call.apply(e,[this].concat(i)));o._fragmentSource=r(342);o._lastBlurRadius=null;o._lastGradientRadius=null;o._lastPosition=new m;o._blurredRenderTarget=new c["Engine"].CanvasRenderTarget(100,100,1);o._maskRenderTarget=new c["Engine"].CanvasRenderTarget(100,100,1);return o}d(t,[{key:"_applyCanvas",value:function e(t,r,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var a=r.getDimensions();var o=!this._blurredRenderTarget.getDimensions().equals(a);this._blurredRenderTarget.setPixelRatio(r.getPixelRatio());this._blurredRenderTarget.resizeTo(r.getDimensions());this._maskRenderTarget.setPixelRatio(r.getPixelRatio());this._maskRenderTarget.resizeTo(r.getDimensions());if(!this._lastPosition.equals(this._options.position)||this._lastGradientRadius!==this._options.gradientRadius||o){this._renderMask();this._lastPosition=this._options.position.clone();this._lastGradientRadius=this._options.gradientRadius}if(this._lastBlurRadius!==this._options.blurRadius||o){this._blurImage(r);this._lastBlurRadius=this._options.blurRadius}this._applyMask(r,n)}},{key:"_blurImage",value:function e(t){var r=t.getCanvas();var n=t.getContext();var i=new m(r.width,r.height);var a=n.getImageData(0,0,r.width,r.height);v.a.stackBlurCanvasRGBA(a,0,0,r.width,r.height,this._options.blurRadius*i.min());var o=this._blurredRenderTarget.getContext();o.putImageData(a,0,0)}},{key:"_renderMask",value:function e(){var t=this._maskRenderTarget.getCanvas();var r=this._maskRenderTarget.getContext();var n=new m(t.width,t.height);var i=this._maskRenderTarget.getPixelRatio();var a=this._options.position.clone().multiply(n);var o=this._options,s=o.radius,u=o.gradientRadius;s*=t.height;u*=t.height;var l=r.createRadialGradient(a.x,a.y,0,a.x,a.y,(s+u)*i);l.addColorStop(0,"#FFFFFF");l.addColorStop(s/(s+u),"#FFFFFF");l.addColorStop(1,"#000000");r.fillStyle=l;r.fillRect(0,0,n.x,n.y)}},{key:"_applyMask",value:function e(t,r){var n=r.getContext();var i=t.getCanvas();var a=t.getContext();var o=this._blurredRenderTarget.getContext();var s=this._maskRenderTarget.getContext();var u=a.getImageData(0,0,i.width,i.height);var l=u.data;var f=o.getImageData(0,0,i.width,i.height).data;var c=s.getImageData(0,0,i.width,i.height).data;var h=void 0;for(var p=0;p<i.width*i.height*4;p+=4){h=c[p]/255;l[p]=h*l[p]+(1-h)*f[p];l[p+1]=h*l[p+1]+(1-h)*f[p+1];l[p+2]=h*l[p+2]+(1-h)*f[p+2]}n.putImageData(u,0,0)}}]);return t}(c["Engine"].Filter);b.prototype.availableOptions={blurRadius:{type:c["OptionType"].NUMBER,default:30,uniformType:c["UniformType"].FLOAT},radius:{type:c["OptionType"].NUMBER,default:50,uniformType:c["UniformType"].FLOAT},gradientRadius:{type:c["OptionType"].NUMBER,default:25,uniformType:c["UniformType"].FLOAT},position:{type:c["OptionType"].VECTOR2,default:new m(.5,.5),uniformType:c["UniformType"].FLOAT2},delta:{type:c["OptionType"].VECTOR2,default:new m(1,1),uniformType:c["UniformType"].FLOAT2},texSize:{type:c["OptionType"].VECTOR2,default:new m(100,100),uniformType:c["UniformType"].FLOAT2}};t["a"]=b},function(e,t){e.exports="/*\n * Based on evanw's glfx.js tilt shift shader:\n * https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js\n * @license\n */\n\nuniform sampler2D u_image;\nuniform float u_radius;\nuniform float u_blurRadius;\nuniform float u_gradientRadius;\nuniform vec2 u_position;\nuniform vec2 u_delta;\nuniform vec2 u_texSize;\nvarying vec2 v_texCoord;\n\nfloat random(vec2 co)\n{\n highp float a = 12.9898;\n highp float b = 78.233;\n highp float c = 43758.5453;\n highp float dt = dot(co.xy,vec2(a,b));\n highp float sn = mod(dt, 3.14);\n return fract(sin(sn) * c);\n}\n\nvoid main() {\n vec4 color = vec4(0.0);\n float total = 0.0;\n\n float offset = random(gl_FragCoord.xy / u_texSize.xy);\n float radius = smoothstep(\n 0.0, 1.0,\n (abs(\n distance(v_texCoord * u_texSize, u_position)\n ) - u_radius) / (u_gradientRadius * 2.0)\n ) * u_blurRadius;\n for (float t = -30.0; t <= 30.0; t++) {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec4 _sample = texture2D(u_image, v_texCoord + u_delta * percent * radius / u_texSize);\n\n _sample.rgb *= _sample.a;\n\n color += _sample * weight;\n total += weight;\n }\n\n gl_FragColor = color / total;\n gl_FragColor.rgb /= gl_FragColor.a + 0.00001;\n}\n"},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(5);var o=r.n(a);var s=r(2);var u=r.n(s);var l=r(3);var f=r.n(l);var c=r(1);var h=r.n(c);var p=r(4);var v=r.n(p);var d=r(147);var y=r(144);var _=r(149);var g=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var m=function e(t,r,n){if(t===null)t=Function.prototype;var i=o()(t,r);if(i===undefined){var a=h()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var s=i.get;if(s===undefined){return undefined}return s.call(n)}};function b(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function w(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function x(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)u.a?u()(e,t):e.__proto__=t}var T=p["Math"].Vector2;var k=function(e){x(t,e);function t(){var e;b(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=w(this,(e=t.__proto__||h()(t)).call.apply(e,[this].concat(n)));var o=a._sdk.getRenderer();a._lastBlurRadius=null;a._blurredRenderTexture=new p["Engine"].RenderTexture(o,100,100,1);a._maskRenderTexture=new p["Engine"].RenderTexture(o,100,100,1);a._brushSprite=new d["a"](a);a._brushSpriteContainer=new p["Engine"].Container;var s=a._brushSprite.getDisplayObject();a._brushSpriteContainer.addChild(s);a._outputSprite=new p["Engine"].Sprite;a._outputContainer=new p["Engine"].Container;a._outputContainer.addChild(a._outputSprite);a._maskFilter=new _["a"];if(o.isOfType(p["RendererType"].WEBGL)){a._horizontalFilter=new y["a"];a._verticalFilter=new y["a"];a._sprite.setFilters([a._horizontalFilter,a._verticalFilter]);a._horizontalFilter.setDelta(new T(1,1));a._verticalFilter.setDelta(new T(-1,1));var u=a._maskRenderTexture.getBaseTexture();u.setGLUnit(a._maskFilter.getMaskImage());o.updateTexture(u,false);u=a._blurredRenderTexture.getBaseTexture();u.setGLUnit(a._maskFilter.getFilterImage());o.updateTexture(u,false)}else if(o.isOfType(p["RendererType"].CANVAS)){a._blurFilter=new y["a"];a._sprite.setFilters([a._blurFilter]);a._maskFilter.setMaskCanvas(a._maskRenderTexture.getRenderTarget().getCanvas());a._maskFilter.setFilterCanvas(a._blurredRenderTexture.getRenderTarget().getCanvas())}a._outputSprite.setFilters([a._maskFilter]);return a}g(t,[{key:"flip",value:function e(t){this._brushSprite.applyFlip(t);this.setDirty(true,true);this._lastBlurRadius=null}},{key:"rotate",value:function e(t){this._brushSprite.applyRotation(t);this.setDirty(true,true);this._lastBlurRadius=null}},{key:"transform",value:function e(t,r){this._brushSprite.applyTransform(t,r);this.setDirty(true,true);this._lastBlurRadius=null}},{key:"_render",value:function e(t){this._renderBlur(t);this._renderMask(t);this._outputSprite.setTexture(t);this._renderTexture.render(this._outputContainer);return p["Promise"].resolve()}},{key:"_renderMask",value:function e(t){var r=t.getDimensions();var n=this._maskRenderTexture.getDimensions();if(!n.equals(r)){this._maskRenderTexture.resizeTo(r)}this._brushSprite.update(this._sdk,r);this._maskRenderTexture.clear(p["Color"].BLACK);this._maskRenderTexture.render(this._brushSpriteContainer);var i=this._sdk.getRenderer();if(i.isOfType(p["RendererType"].WEBGL)){i.updateTexture(this._maskRenderTexture.getBaseTexture(),false)}}},{key:"_renderBlur",value:function e(t){var r=t.getDimensions();var n=this._blurredRenderTexture.getDimensions();if(!n.equals(r)){this._blurredRenderTexture.resizeTo(r)}var i=this._options.blurRadius;if(this._lastBlurRadius!==i||!n.equals(r)){var a=this._sdk.getRenderer();var o=void 0;if(a.isOfType(p["RendererType"].WEBGL)){var s=r.min();o={blurRadius:i*s,texSize:r};this._horizontalFilter.set(o);this._verticalFilter.set(o)}else if(a.isOfType(p["RendererType"].CANVAS)){o={blurRadius:i};this._blurFilter.set(o)}this._blurredRenderTexture.render(this._container);this._lastBlurRadius=i}}},{key:"getBrush",value:function e(){return this._brushSprite}},{key:"createPath",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var n=new d["a"].Brushes.RadialBrush({size:t,hardness:r,color:p["Color"].WHITE});var i=this._brushSprite.createPath(n);this._options.paths.push(i);this.setDirty(true);return i}},{key:"setDirtyForRenderer",value:function e(r,n,i){m(t.prototype.__proto__||h()(t.prototype),"setDirtyForRenderer",this).call(this,r,n,i);this._brushSprite.setDirtyForRenderer(r,n,i)}},{key:"dispose",value:function e(){m(t.prototype.__proto__||h()(t.prototype),"dispose",this).call(this);var r=this._sdk.getRenderer();if(r.isOfType(p["RendererType"].WEBGL)){this._verticalFilter.dispose();this._horizontalFilter.dispose()}else{this._blurFilter.dispose()}this._brushSprite.dispose();this._maskFilter.dispose();this._blurredRenderTexture.dispose();this._maskRenderTexture.dispose()}},{key:"hasChanges",value:function e(){return true}}]);return t}(p["Operation"]);k.identifier="selective-blur";k.prototype.availableOptions={blurRadius:{type:p["OptionType"].NUMBER,default:.05},paths:{type:p["OptionType"].ARRAY,default:[],setter:function e(t){if(this._brushSprite){this._brushSprite.setPaths(t)}return t}}};v.a.Operations.SelectiveBlurOperation=k;t["a"]=k},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(5);var o=r.n(a);var s=r(2);var u=r.n(s);var l=r(3);var f=r.n(l);var c=r(1);var h=r.n(c);var p=r(4);var v=r.n(p);var d=r(345);var y=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var _=function e(t,r,n){if(t===null)t=Function.prototype;var i=o()(t,r);if(i===undefined){var a=h()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var s=i.get;if(s===undefined){return undefined}return s.call(n)}};function g(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function m(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function b(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)u.a?u()(e,t):e.__proto__=t}var w=function(e){b(t,e);function t(e,r,n){g(this,t);var i=m(this,(t.__proto__||h()(t)).call(this,r));i._operation=e;i._canvas=n||p["Utils"].createCanvas();i._context=i._canvas.getContext("2d");return i}y(t,[{key:"serializeOption",value:function e(r){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(r==="controlPoints"){return this._options.controlPoints.map(function(e){var t=e.getPosition();return n?t.toObject():t.clone()})}return _(t.prototype.__proto__||h()(t.prototype),"serializeOption",this).call(this,r,n)}},{key:"_optionEquals",value:function e(r,n){if(r==="controlPoints"){var i=this._options.controlPoints;for(var a=0,o=i.length;a<o;a++){if(!i[a].getPosition().equals(n[a])){return false}}return true}return _(t.prototype.__proto__||h()(t.prototype),"_optionEquals",this).call(this,r,n)}},{key:"render",value:function e(t){var r=this._options,n=r.controlPoints,i=r.size;if(n.length<2){return}p["Utils"].ensureCanvasDimensions(this._canvas,t);if(!this._brush||this._lastBrushSize!==i||!t.equals(this._brushInputDimensions)){this._brushInputDimensions=t.clone();this._lastBrushSize=i}var a=n[0];var o=a;for(var s=1;s<n.length;s++){o=n[s];o.renderToCanvas(this._options.brush.getBrushImage(t),this._canvas,a);a=o}}},{key:"_createBrush",value:function e(t){var r=this._options,n=r.size,i=r.hardness,a=r.color;var o=p["Utils"].createCanvas();o.width=o.height=Math.ceil(n*t.min());var s=o.getContext("2d");a=a.clone();a.a=1;if(o.width===1){s.fillStyle=a.toRGBA();s.fillRect(0,0,1,1)}else{var u=s.createRadialGradient(o.width/2,o.height/2,Math.min(o.width/2-1,o.width/2*i),o.width/2,o.height/2,o.width/2);u.addColorStop(0,a.toRGBA());var l=a.clone();l.a=0;u.addColorStop(1,l.toRGBA());s.fillStyle=u;s.fillRect(0,0,o.width,o.height)}return o}},{key:"addControlPoint",value:function e(t){var r=new d["a"](this,t);this._options.controlPoints.push(r);this.emit("update",this)}},{key:"getCanvas",value:function e(){return this._canvas}},{key:"setCanvas",value:function e(t){this._canvas=t;this._context=t.getContext("2d")}},{key:"setDirty",value:function e(){this._context.clearRect(0,0,this._canvas.width,this._canvas.height);this._options.controlPoints.forEach(function(e){e.setDirty()})}},{key:"forEachControlPoint",value:function e(t){this._options.controlPoints.forEach(t)}},{key:"renderToCanvas",value:function e(t){var r=t.getContext("2d");r.save();r.globalAlpha=this._options.brush.getColor().a;r.drawImage(this._canvas,0,0);r.restore()}},{key:"getCanvasDimensions",value:function e(){return this._canvasDimensions}}]);return t}(p["Configurable"]);w.prototype.availableOptions={id:{type:p["OptionType"].STRING,default:function e(){return p["Utils"].getUUID()}},brush:{type:p["OptionType"].OBJECT,required:true},controlPoints:{type:p["OptionType"].ARRAY,default:[]},closed:{type:p["OptionType"].BOOLEAN,default:false}};t["a"]=w},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(4);var o=r.n(a);var s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function u(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var l=a["Math"].Vector2;var f=function(){function e(t,r){u(this,e);this._path=t;this._drawnCanvases=[];this._position=r}s(e,[{key:"renderToCanvas",value:function e(t,r,n){if(this._drawnCanvases.indexOf(r)!==-1){return}var i=new l(r.width,r.height);var a=r.getContext("2d");var o=this._position.clone().multiply(i);var s=n.getPosition().clone().multiply(i);var u=o.clone().subtract(s).len();var f=t.width/10;var c=0;while(c<=u){var h=Math.max(0,Math.min(1,c/u));var p=s.x+(o.x-s.x)*h;var v=s.y+(o.y-s.y)*h;a.drawImage(t,p-t.width/2,v-t.height/2,t.width,t.height);c+=f}this._drawnCanvases.push(r)}},{key:"setPosition",value:function e(t){this._position=t}},{key:"getPosition",value:function e(){return this._position.clone()}},{key:"setDirty",value:function e(){this._drawnCanvases=[]}}]);return e}();t["a"]=f},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(4);var h=r.n(c);var p=r(148);var v=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function d(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function y(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function _(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var g=function(e){_(t,e);function t(){d(this,t);return y(this,(t.__proto__||f()(t)).apply(this,arguments))}v(t,[{key:"getBrushImage",value:function e(t){if(this._brush&&this.optionsEqual(this._lastOptions)&&t.equals(this._lastInputDimensions)){return this._brush}var r=this._options,n=r.size,i=r.hardness,a=r.color;var o=c["Utils"].createCanvas();o.width=o.height=Math.ceil(n*t.min());var s=o.getContext("2d");a=a.clone();a.a=1;if(o.width===1){s.fillStyle=a.toRGBA();s.fillRect(0,0,1,1)}else{var u=s.createRadialGradient(o.width/2,o.height/2,Math.min(o.width/2-1,o.width/2*i),o.width/2,o.height/2,o.width/2);u.addColorStop(0,a.toRGBA());var l=a.clone();l.a=0;u.addColorStop(1,l.toRGBA());s.fillStyle=u;s.fillRect(0,0,o.width,o.height)}this._lastOptions=this.serializeOptions(["size","color","hardness"]);this._brush=o;this._lastInputDimensions=t.clone();return o}}]);return t}(p["a"]);t["a"]=g;g.identifier="imgly_brush_radial";g.prototype.availableOptions=c["Utils"].extend(p["a"].prototype.availableOptions,{hardness:{type:c["OptionType"].NUMBER,default:1}})},function(e,t){e.exports="varying vec2 v_texCoord;\nuniform sampler2D u_image;\nuniform sampler2D u_filterImage;\nuniform sampler2D u_maskImage;\n\nvoid main() {\n vec4 color0 = texture2D(u_image, v_texCoord);\n vec4 color1 = texture2D(u_filterImage, v_texCoord);\n vec4 mask = texture2D(u_maskImage, v_texCoord);\n gl_FragColor = mix(color0, color1, mask);\n}\n"},function(e,t,r){"use strict";var n=r(6);var i=r.n(n);var a=r(0);var o=r.n(a);var s=r(5);var u=r.n(s);var l=r(2);var f=r.n(l);var c=r(3);var h=r.n(c);var p=r(1);var v=r.n(p);var d=r(4);var y=r.n(d);var _=r(56);var g=r(149);var m=r(349);var b=r(350);var w=r(147);var x=r(351);var T=i.a||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}}return e};var k=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;o()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var R=function e(t,r,n){if(t===null)t=Function.prototype;var i=u()(t,r);if(i===undefined){var a=v()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var o=i.get;if(o===undefined){return undefined}return o.call(n)}};function E(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function C(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function O(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=h()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)f.a?f()(e,t):e.__proto__=t}var S=d["Math"].Vector2;var F=function(e){O(t,e);function t(){var e;E(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=C(this,(e=t.__proto__||v()(t)).call.apply(e,[this].concat(n)));a.setSmoothDownscaling(a._sdk.getOptions().smoothDownscaling);a._onSpriteUpdate=a._onSpriteUpdate.bind(a);var o=a._options.sprites.slice();o.forEach(function(e){a.removeSprite(e);a.addSprite(e)});return a}k(t,[{key:"getSpritesOfType",value:function e(t){return this._options.sprites.filter(function(e){return e instanceof t})}},{key:"rotate",value:function e(t){this._options.sprites.forEach(function(e){e.applyRotation(t)})}},{key:"flip",value:function e(t){this._options.sprites.forEach(function(e){e.applyFlip(t)})}},{key:"_onSpriteUpdate",value:function e(t,r){this.emit("update",this);this.setDirty(true)}},{key:"_applyRotation",value:function e(t,r){this._options.sprites.forEach(function(e){return e.applyRotation(t,r)})}},{key:"transform",value:function e(t){this._options.sprites.forEach(function(e){return e.applyTransform(t)})}},{key:"scale",value:function e(t){this._options.sprites.forEach(function(e){return e.applyScale(t)})}},{key:"serializeOption",value:function e(r){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(r==="sprites"){return this._options.sprites.map(function(e){return e.serializeOptions(undefined,n)})}return R(t.prototype.__proto__||v()(t.prototype),"serializeOption",this).call(this,r,n)}},{key:"createSticker",value:function e(t){return new m["a"](this,t)}},{key:"createText",value:function e(t){return new b["a"](this,t)}},{key:"createBrush",value:function e(t){return new w["a"](this,t)}},{key:"createTextDesign",value:function e(t){return new x["a"](this,t)}},{key:"addSprite",value:function e(t){this._options.sprites.push(t);var r=this.getSmoothDownscaling();t.setSmoothDownscaling&&t.setSmoothDownscaling(r);this._container.addChild(t.getDisplayObject());this.setDirty(true);t.on("update",this._onSpriteUpdate);this.emit("update",this,this._options.sprites)}},{key:"removeSprite",value:function e(t){var r=this._options.sprites;var n=r.indexOf(t);if(n!==-1){t.off("update",this._onSpriteUpdate);this._container.removeChild(t.getDisplayObject());r.splice(n,1);this.setDirty(true);return true}return false}},{key:"_render",value:function e(t){var r=this;var n=this._container;var i=this._options.sprites;var a=t.getDimensions().clone().floor();var o=new d["Engine"].Container;var s=new d["Engine"].Container;var u=new d["Engine"].Container;o.addChild(this._sprite);var l=o;var f=null;var c=null;i.forEach(function(e){if(l===s){l=u}if(e.getInverted&&e.getInverted()){l=s;f=e.getColor&&e.getColor()||null;c=e}l.addChild(e.getDisplayObject())});return d["Promise"].all(i.map(function(e){return e.validateSettings()})).then(function(){i.forEach(function(e){return e.update(r._sdk,a)})}).then(function(){if(s.getChildren().length>0){r._renderTexture.render(o);var e=r._renderMaskedTextDesignSprite(c);r._renderTexture.render(e);r._renderTexture.render(u)}else{r._renderTexture.clear();r._renderTexture.render(o);r._renderTexture.render(s);r._renderTexture.render(u)}n.addChild(r._sprite);i.forEach(function(e){return n.addChild(e.getDisplayObject())})})}},{key:"_renderMaskedTextDesignSprite",value:function e(t){var r=t.getColor();var n=d["Utils"].createCanvas();var i=this._sdk.getSprite().getTexture().getFrame();var a=i.width;var o=i.height;d["Utils"].ensureCanvasDimensions(n,new S(a,o));var s=n.getContext("2d");s.fillStyle=r.toRGBA();s.fillRect(0,0,a,o);s.globalCompositeOperation="destination-out";var u=t.getDisplayObject();u._renderCanvas({getCurrentRenderTarget:function e(){return{getPixelRatio:function e(){return 1}}},getContext:function e(){return s}});var l=new d["Engine"].Container;var f=new d["Engine"].Sprite(d["Engine"].Texture.fromCanvas(n));l.addChild(f);return l}},{key:"takeSpriteToFront",value:function e(t){var r=this._options.sprites;var n=r.indexOf(t);if(n===-1)return;d["Utils"].moveArrayItem(r,n,r.length-1);var i=t.getDisplayObject();this._container.removeChild(i);this._container.addChild(i);this.setDirty(true)}},{key:"getSpritesAtPosition",value:function e(t,r){var n=this;var i=[];this._options.sprites.forEach(function(e){return e.update(n._sdk,r)});var a=this._sdk.getSprite();var o=a.getWorldTransform().applyInverseToVector(t);var s=a.getTexture().getFrame(),u=s.width,l=s.height;var f=a.getAnchor().clone().multiply(-u,-l);o.subtract(f);var c=this._options.sprites.slice(0).reverse();for(var h=0,p=c.length;h<p;h++){var v=c[h];if(v.getHitTestDisplayObject().isAtPosition(o)){i.push(v)}}return i}},{key:"setDirtyForRenderer",value:function e(r,n,i){R(t.prototype.__proto__||v()(t.prototype),"setDirtyForRenderer",this).call(this,r,n,i);this._options.sprites.forEach(function(e){e.setDirtyForRenderer(r,n,i)})}},{key:"dispose",value:function e(){R(t.prototype.__proto__||v()(t.prototype),"dispose",this).call(this);this._options.sprites.forEach(function(e){e.dispose()})}}]);return t}(d["Operation"]);F.StickerSprite=m["a"];F.TextSprite=b["a"];F.BrushSprite=w["a"];F.TextDesignSprite=x["a"];F.identifier="sprite";F.prototype.availableOptions={sprites:{type:d["OptionType"].ARRAY,default:[],setter:function e(t,r){var n=this;t=t.map(function(e,t){if(e instanceof _["a"]){return e}var r=T({},e);delete r.type;switch(e.type){case"text":return new b["a"](n,r);case"sticker":return new m["a"](n,r);case"brush":return new w["a"](n,r);case"text-design":return new x["a"](n,r);default:d["Log"].error(n.constructor.name,"Invalid sprite type: "+e.type)}});if(!r){if(this._options.sprites){var i=this._options.sprites.slice();i.forEach(function(e){e.dispose();n.removeSprite(e)})}t.forEach(function(e){n.addSprite(e)})}return t}},smoothDownscaling:{type:d["OptionType"].BOOLEAN,default:false}};y.a.Operations.SpriteOperation=F;t["a"]=F},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(5);var o=r.n(a);var s=r(2);var u=r.n(s);var l=r(3);var f=r.n(l);var c=r(1);var h=r.n(c);var p=r(4);var v=r.n(p);var d=r(56);var y=r(143);var _=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var g=function e(t,r,n){if(t===null)t=Function.prototype;var i=o()(t,r);if(i===undefined){var a=h()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var s=i.get;if(s===undefined){return undefined}return s.call(n)}};function m(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function b(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function w(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)u.a?u()(e,t):e.__proto__=t}var x=p["Math"].Vector2,T=p["Math"].ColorMatrix;var k=function(e){w(t,e);function t(){var e;m(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=b(this,(e=t.__proto__||h()(t)).call.apply(e,[this].concat(n)));var o=a._options.image;var s=o.src||o.filePath;a._isSVG=s&&!!s.match(/\w+\.svg(?=\?|$)/i);if(a._isSVG){a._canvas=p["Utils"].createCanvas();a._context=a._canvas.getContext("2d");a._options.smoothDownscaling=false}if(o){a._onImageUpdate()}a._tintFilter=new p["Engine"].Filters.TintFilter;a._adjustmentsFilter=new y["a"];a._lastRenderedDimensions=x.NULL;a._lastRenderedInputDimensions=x.NULL;a._onOptionsChange=a._onOptionsChange.bind(a);a._options.adjustments.on("update",a._onOptionsChange);return a}_(t,[{key:"applyScale",value:function e(t){this.setDimensions(this.getDimensions().multiply(t))}},{key:"serializeOptions",value:function e(r){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var i=g(t.prototype.__proto__||h()(t.prototype),"serializeOptions",this).call(this,r,n);if(!r)i.type="sticker";return i}},{key:"_rendersToRenderTexture",value:function e(t){var r=this._options.smoothDownscaling&&!this._isSVG&&t.getRenderer().isOfType(p["RendererType"].WEBGL);return r||this._hasAdjustments()||this._options.tintMode!=="none"}},{key:"_getTexture",value:function e(){return this._inputTexture}},{key:"update",value:function e(t,r){var n=this._options,i=n.dimensions,a=n.image;if(i.equals(x.NULL)){i.set(a.width,a.height)}this._sprite.setSmoothDownscaling(this._isSVG?false:this.getSmoothDownscaling());var o=!this._lastRenderedInputDimensions.equals(r)||!this._lastRenderedDimensions.equals(i)||this._lastRenderedImage!==a;if(o&&this._isSVG&&t.getRenderer().isOfType(p["RendererType"].WEBGL)){a.width=i.x;a.height=i.y;this._canvas.width=a.width;this._canvas.height=a.height;this._context.clearRect(0,0,a.width,a.height);this._context.drawImage(a,0,0,a.width,a.height);this._inputTexture.getBaseTexture().update()}if(this._rendersToRenderTexture(t)){this._prepareRenderTexture(t)}var s=[];if(this._rendersToRenderTexture(t)){if(this._hasAdjustments()){s.push(this._adjustmentsFilter);var u=this._options.adjustments;var l=new T;l.multiply(T.createBrightnessMatrix(u.getBrightness()));l.multiply(T.createSaturationMatrix(u.getSaturation()));l.multiply(T.createContrastMatrix(u.getContrast()));this._adjustmentsFilter.set({colorMatrix:l})}if(this._options.tintMode&&this._options.tintMode!=="none"){s.push(this._tintFilter);this._tintFilter.set({mode:p["Engine"].Filters.TintFilter.MODES[this._options.tintMode.toUpperCase()],color:this._options.tintColor})}this._renderTextureSprite.setFilters(s)}if(this._rendersToRenderTexture(t)){this._renderToRenderTexture(t)}else{this._sprite.setTexture(this._inputTexture)}this._updateSprite(r);this._applyFlip();this._lastRenderedDimensions.copy(i);this._lastRenderedInputDimensions.copy(r);this._lastRenderedImage=a}},{key:"_applyFlip",value:function e(){var t=this._sprite.getScale();if(this._options.flipVertically){t.y*=-1}if(this._options.flipHorizontally){t.x*=-1}this._sprite.setScale(t)}},{key:"applyFlip",value:function e(r){g(t.prototype.__proto__||h()(t.prototype),"applyFlip",this).call(this,r);var n={rotation:this._options.rotation};var i=n.rotation/Math.PI*180;var a=i*-1;n.rotation=a*Math.PI/180;switch(r){case"horizontal":n.flipHorizontally=!this._options.flipHorizontally;this.set(n);break;case"vertical":n.flipVertically=!this._options.flipVertically;this.set(n);break}}},{key:"_hasAdjustments",value:function e(){var t=this._options.adjustments;return t.getBrightness()!==0||t.getSaturation()!==1||t.getContrast()!==1}},{key:"_onImageUpdate",value:function e(){var t=this._options.image;var r=this._operation.getSDK().getRenderer();if(this._isSVG&&r.isOfType(p["RendererType"].WEBGL)){t=this._canvas}this._inputTexture=p["Engine"].Texture.fromImage(t);this._identitySprite.setTexture(this._inputTexture);this._sprite.setTexture(this._inputTexture);if(this._renderTexture){this._renderTextureSprite.setTexture(this._inputTexture);this._renderTexture.resizeTo(this._inputTexture.getDimensions())}this.setDirty(true)}},{key:"setOption",value:function e(r,n){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;g(t.prototype.__proto__||h()(t.prototype),"setOption",this).call(this,r,n,i);if(r==="image"&&this._identitySprite){this._onImageUpdate()}}},{key:"_onOptionsChange",value:function e(){var t=this._dirtiness;for(var r in t){t[r]=true}}},{key:"dispose",value:function e(){g(t.prototype.__proto__||h()(t.prototype),"dispose",this).call(this);this._inputTexture&&this._inputTexture.getBaseTexture().dispose();this._inputTexture=null;this._options.adjustments.off("updated",this._onOptionsChange)}}]);return t}(d["a"]);k.prototype.availableOptions={id:{type:p["OptionType"].STRING,default:function e(){return p["Utils"].getUUID()}},identifier:{type:p["OptionType"].STRING,default:""},image:{type:p["OptionType"].IMAGE,required:true},position:{type:p["OptionType"].VECTOR2,default:x.NULL},dimensions:{type:p["OptionType"].VECTOR2,default:x.NULL},anchor:{type:p["OptionType"].VECTOR2,default:new x(0,0)},pivot:{type:p["OptionType"].VECTOR2,default:new x(.5,.5)},rotation:{type:p["OptionType"].NUMBER,default:0},flipHorizontally:{type:p["OptionType"].BOOLEAN,default:false},flipVertically:{type:p["OptionType"].BOOLEAN,default:false},smoothDownscaling:{type:p["OptionType"].BOOLEAN,default:false},tintColor:{type:p["OptionType"].COLOR,default:p["Color"].WHITE},tintMode:{type:p["OptionType"].STRING,default:"none",available:["none","solid","colorized"]},alpha:{type:p["OptionType"].NUMBER,default:1},adjustments:{type:p["OptionType"].CONFIGURABLE,structure:{brightness:{type:p["OptionType"].NUMBER,default:0},saturation:{type:p["OptionType"].NUMBER,default:1},contrast:{type:p["OptionType"].NUMBER,default:1}}}};k.type="sticker";t["a"]=k},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(5);var o=r.n(a);var s=r(2);var u=r.n(s);var l=r(3);var f=r.n(l);var c=r(1);var h=r.n(c);var p=r(4);var v=r.n(p);var d=r(56);var y=r(150);var _=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var g=function e(t,r,n){if(t===null)t=Function.prototype;var i=o()(t,r);if(i===undefined){var a=h()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var s=i.get;if(s===undefined){return undefined}return s.call(n)}};function m(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function b(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function w(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)u.a?u()(e,t):e.__proto__=t}var x=p["Math"].Vector2;var T=function(e){w(t,e);function t(){var e;m(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=b(this,(e=t.__proto__||h()(t)).call.apply(e,[this].concat(n)));a._textRenderer=new y["a"](a,a._operation);a._textRenderer.rotation=a.getRotation();a._sprite.setTexture(a._textRenderer.getFinalTexture());a._hitTestSprite.setTexture(a._textRenderer.getTexture());return a}_(t,[{key:"serializeOptions",value:function e(r){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var i=g(t.prototype.__proto__||h()(t.prototype),"serializeOptions",this).call(this,r,n);if(!r)i.type="text";return i}},{key:"getDOMStyle",value:function e(t,r){var n=this.getFontSize()*r.y;return{fontWeight:this._options.fontWeight,fontSize:n+"px",fontStyle:this._options.fontStyle,fontFamily:this._options.fontFamily,lineHeight:this.getAbsoluteTextHeight(r)*this.getLineHeight()+"px",color:this._options.color.toRGBA(),backgroundColor:this._options.backgroundColor.toRGBA(),textAlign:this._options.alignment}}},{key:"getAbsoluteTextHeight",value:function e(t){var r=this.getFontSize()*t.y;var n=this.getTextMetrics();if(n){var i=1/n.unitsPerEm*r;var a=n.ascender*i;var o=n.descender*i;return a+Math.abs(o)}else{return r*this.getLineHeight()*1.1}}},{key:"getDimensions",value:function e(t,r){return this._textRenderer.getDimensions(t,r)}},{key:"applyFlip",value:function e(r){g(t.prototype.__proto__||h()(t.prototype),"applyFlip",this).call(this,r);var n=this._options.rotation;switch(r){case"horizontal":n+=(Math.PI-n)*2;this.setRotation(n);break;case"vertical":n+=(Math.PI/2-n)*2;this.setRotation(n);break}}},{key:"applyTransform",value:function e(r){g(t.prototype.__proto__||h()(t.prototype),"applyTransform",this).call(this,r);this.set({fontSize:r.scaleSize(this.getFontSize(),"y"),maxWidth:r.scaleSize(this.getMaxWidth(),"x")},false)}},{key:"applyRotation",value:function e(r){g(t.prototype.__proto__||h()(t.prototype),"applyRotation",this).call(this,r);var n=(r+360)%360;var i=this._operation.getInputDimensions();if(n===90||n===270){this.setMaxWidth(this.getMaxWidth()/i.x*i.y);this.setFontSize(this.getFontSize()/i.y*i.x)}}},{key:"setOption",value:function e(r,n){if(r==="rotation"){this._options.rotation=n;if(this._textRenderer){this._textRenderer.rotation=n}this._rotation=n;this.emit("update");return}g(t.prototype.__proto__||h()(t.prototype),"setOption",this).call(this,r,n)}},{key:"getOption",value:function e(r){if(r==="rotation"){return this._rotation}return g(t.prototype.__proto__||h()(t.prototype),"getOption",this).call(this,r)}},{key:"getHitTestDisplayObject",value:function e(){return this._hitTestSprite}},{key:"update",value:function e(r,n){this._sprite.setVisible(this._options.visible);if(!this._options.visible)return;this._textRenderer.update(r,n);var i=this._textRenderer.getFinalTexture();var a=i.getBaseTexture();a.update();var o=r.getRenderer();if(o.isOfType(p["RendererType"].WEBGL)){o.updateTexture(i.getBaseTexture())}g(t.prototype.__proto__||h()(t.prototype),"update",this).call(this,r,n);this._sprite.setRotation(0);this._textRenderer.getTexture().getBaseTexture().update();this._hitTestSprite.setRotation(this._rotation);this._hitTestSprite.updateTransform()}},{key:"_getTexture",value:function e(){return this._textRenderer.getFinalTexture()}},{key:"dispose",value:function e(){g(t.prototype.__proto__||h()(t.prototype),"dispose",this).call(this);this._textRenderer.dispose()}}]);return t}(d["a"]);T.prototype.availableOptions={id:{type:p["OptionType"].STRING,default:function e(){return p["Utils"].getUUID()}},fontSize:{type:p["OptionType"].NUMBER,default:.1},characterSpacing:{type:p["OptionType"].NUMBER,default:0},lineHeight:{type:p["OptionType"].NUMBER,default:1.1},fontIdentifier:{type:p["OptionType"].STRING},fontFamily:{type:p["OptionType"].STRING,default:"Times New Roman"},fontWeight:{type:p["OptionType"].ALL,default:"normal"},fontStyle:{type:p["OptionType"].STRING,default:"normal"},textMetrics:{type:p["OptionType"].OBJECT,default:null},outlineWidth:{type:p["OptionType"].NUMBER,default:0},outlineColor:{type:p["OptionType"].COLOR,default:p["Color"].BLACK},alignment:{type:p["OptionType"].STRING,default:"left",available:["left","center","right"]},verticalAlignment:{type:p["OptionType"].STRING,default:"top",available:["top","center","bottom"]},color:{type:p["OptionType"].COLOR,default:new p["Color"](1,0,0,1)},backgroundColor:{type:p["OptionType"].COLOR,default:p["Color"].TRANSPARENT},position:{type:p["OptionType"].VECTOR2,default:new x(.5,.5)},anchor:{type:p["OptionType"].VECTOR2,default:new x(0,0)},pivot:{type:p["OptionType"].VECTOR2,default:new x(.5,.5)},rotation:{type:p["OptionType"].NUMBER,default:0},text:{type:p["OptionType"].STRING,required:true},maxWidth:{type:p["OptionType"].NUMBER,default:.5},maxHeight:{type:p["OptionType"].NUMBER,default:0},visible:{type:p["OptionType"].BOOLEAN,default:true}};T.type="text";t["a"]=T},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(5);var o=r.n(a);var s=r(2);var u=r.n(s);var l=r(3);var f=r.n(l);var c=r(1);var h=r.n(c);var p=r(4);var v=r.n(p);var d=r(56);var y=r(16);var _=r(57);var g=r(360);var m=r(361);var b=r(152);var w=r(362);var x=r(154);var T=r(364);var k=r(44);var R=r(366);var E=r(107);var C=r(367);var O=r(368);var S=r(369);var F=r(156);var I=r(370);var A=r(375);var M=r(20);var D=r(377);var L=r(23);var B=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var P=function e(t,r,n){if(t===null)t=Function.prototype;var i=o()(t,r);if(i===undefined){var a=h()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var s=i.get;if(s===undefined){return undefined}return s.call(n)}};function U(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function N(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function j(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)u.a?u()(e,t):e.__proto__=t}var z=p["Math"].Vector2;var G=function(e){j(t,e);function t(e,r){U(this,t);var n=N(this,(t.__proto__||h()(t)).call(this,e,r));n._renderer=new D["a"];n._canvas=p["Utils"].createCanvas();n._context=n._canvas.getContext("2d");n._texture=p["Engine"].Texture.fromCanvas(n._canvas);n._sprite.setTexture(n._texture);n._aspect=1;if(n.getSeed()<0){n.setSeed(y["a"].TimeSeed())}return n}B(t,[{key:"seed",value:function e(t){this.setSeed(t||y["a"].TimeSeed())}},{key:"_updateLayout",value:function e(){var t=this.getLayout();if(!t){return null}this._renderer.createLayout(t,this.getText(),this.getSeed());this._aspect=this._renderer.calculateAspect();this._isLayoutDirty=false;return true}},{key:"applyTransform",value:function e(t){var r={};r.rotation=t.applyToRotation(this.getRotation());r.position=t.applyToRelativePoint(this.getPosition());if(this._options.dimensions){r.width=t.applyToRelativeSize(this.getWidth())}this.set(r,false)}},{key:"update",value:function e(r,n){if(this._isLayoutDirty&&!this._updateLayout()){return}var i=this.getWidth()*n.min()/r.getTextureScale();var a=i/this._aspect;p["Utils"].ensureCanvasDimensions(this._canvas,new z(i,a));this._context.clearRect(0,0,this._canvas.width,this._canvas.height);this._renderer.draw(this._context,new L["a"](i,a),this.getColor(),this.getInverted());this.setDimensions(new z(i,a));this._texture.getBaseTexture().update();var o=r.getRenderer();if(o.isOfType(p["RendererType"].WEBGL)){o.updateTexture(this._texture.getBaseTexture())}P(t.prototype.__proto__||h()(t.prototype),"update",this).call(this,r,n)}},{key:"_optionEquals",value:function e(r,n){if(r==="layout"){var i=this._options.layout;if(!i&&n||!n&&i){return false}if(!n.constructor||!i.constructor){return false}if(i.constructor.identifier!==n.constructor.identifier){return false}return true}return P(t.prototype.__proto__||h()(t.prototype),"_optionEquals",this).call(this,r,n)}},{key:"serializeOptions",value:function e(r){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var i=P(t.prototype.__proto__||h()(t.prototype),"serializeOptions",this).call(this,r,n);if(!r)i.type="text-design";return i}}]);return t}(d["a"]);G.Layouts={TextDesignBlocks:_["a"],TextDesignBlocksCondensed:g["a"],TextDesignBlocksLight:m["a"],TextDesignCelebrate:b["a"],TextDesignCelebrateSimple:w["a"],TextDesignEqualWidth:x["a"],TextDesignEqualWidthFat:T["a"],TextDesignMasked:k["a"],TextDesignMaskedBadge:R["a"],TextDesignMaskedSpeechBubble:E["a"],TextDesignMaskedSpeechBubbleComic:C["a"],TextDesignMultiline:O["a"],TextDesignWatercolor:S["a"],TextDesignSunshine:F["a"],TextDesignParticles:I["a"],TextDesignRotated:A["a"]};G.AssetManager=M["a"];G.prototype.availableOptions={id:{type:p["OptionType"].STRING,default:function e(){return p["Utils"].getUUID()}},position:{type:p["OptionType"].VECTOR2,default:new z(.5,.5)},dimensions:{type:p["OptionType"].VECTOR2,default:z.NULL},anchor:{type:p["OptionType"].VECTOR2,default:new z(0,0)},pivot:{type:p["OptionType"].VECTOR2,default:new z(.5,.5)},rotation:{type:p["OptionType"].NUMBER,default:0},flipHorizontally:{type:p["OptionType"].BOOLEAN,default:false},flipVertically:{type:p["OptionType"].BOOLEAN,default:false},layout:{type:p["OptionType"].OBJECT,default:null,setter:function e(t){this._isLayoutDirty=true;return t}},text:{type:p["OptionType"].STRING,default:"",setter:function e(t){this._isLayoutDirty=true;return t}},color:{type:p["OptionType"].COLOR,default:p["Color"].BLACK},width:{type:p["OptionType"].NUMBER,default:.8,setter:function e(t){return t}},inverted:{type:p["OptionType"].BOOLEAN,default:false},seed:{type:p["OptionType"].NUMBER,default:-1}};t["a"]=G},function(e,t,r){e.exports={default:r(353),__esModule:true}},function(e,t,r){r(354);e.exports=9007199254740991},function(e,t,r){var n=r(13);n(n.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(e,t,r){"use strict";r.d(t,"a",function(){return w});var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(4);var h=r.n(c);var p=r(17);var v=r(59);var d=r(23);var y=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function _(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function g(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function m(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var b=c["Math"].Rectangle;var w=function(e){m(t,e);function t(){_(this,t);return g(this,(t.__proto__||f()(t)).apply(this,arguments))}y(t,[{key:"getSize",value:function e(){var t=this.getRows();var r=this.getWidth();var n=t.length-1;var i=t.reduce(function(e,t){return e+t.getSize().height},0);i+=(n+1)*this.getRelativeLineSpacing()*r;var a=this.getRelativeInsets().clone().scale(r);i+=a.top+a.bottom;return new d["a"](r,i)}}]);return t}(c["Configurable"]);w.prototype.availableOptions={text:{type:c["OptionType"].STRING,default:""},lines:{type:c["OptionType"].ARRAY,default:[]},relativeInsets:{type:c["OptionType"].OBJECT,default:new p["a"]},relativeLineSpacing:{type:c["OptionType"].NUMBER,default:0},rows:{type:c["OptionType"].OBJECT,default:[]},background:{type:c["OptionType"].OBJECT,default:null},width:{type:c["OptionType"].NUMBER,default:0}}},function(e,t,r){e.exports=r(357)},function(e,t,r){var n=function(){return this}()||Function("return this")();var i=n.regeneratorRuntime&&Object.getOwnPropertyNames(n).indexOf("regeneratorRuntime")>=0;var a=i&&n.regeneratorRuntime;n.regeneratorRuntime=undefined;e.exports=r(358);if(i){n.regeneratorRuntime=a}else{try{delete n.regeneratorRuntime}catch(e){n.regeneratorRuntime=undefined}}},function(e,t){!function(t){"use strict";var r=Object.prototype;var n=r.hasOwnProperty;var i;var a=typeof Symbol==="function"?Symbol:{};var o=a.iterator||"@@iterator";var s=a.asyncIterator||"@@asyncIterator";var u=a.toStringTag||"@@toStringTag";var l=typeof e==="object";var f=t.regeneratorRuntime;if(f){if(l){e.exports=f}return}f=t.regeneratorRuntime=l?e.exports:{};function c(e,t,r,n){var i=t&&t.prototype instanceof g?t:g;var a=Object.create(i.prototype);var o=new I(n||[]);a._invoke=C(e,r,o);return a}f.wrap=c;function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}var p="suspendedStart";var v="suspendedYield";var d="executing";var y="completed";var _={};function g(){}function m(){}function b(){}var w={};w[o]=function(){return this};var x=Object.getPrototypeOf;var T=x&&x(x(A([])));if(T&&T!==r&&n.call(T,o)){w=T}var k=b.prototype=g.prototype=Object.create(w);m.prototype=k.constructor=b;b.constructor=m;b[u]=m.displayName="GeneratorFunction";function R(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}f.isGeneratorFunction=function(e){var t=typeof e==="function"&&e.constructor;return t?t===m||(t.displayName||t.name)==="GeneratorFunction":false};f.mark=function(e){if(Object.setPrototypeOf){Object.setPrototypeOf(e,b)}else{e.__proto__=b;if(!(u in e)){e[u]="GeneratorFunction"}}e.prototype=Object.create(k);return e};f.awrap=function(e){return{__await:e}};function E(e){function t(r,i,a,o){var s=h(e[r],e,i);if(s.type==="throw"){o(s.arg)}else{var u=s.arg;var l=u.value;if(l&&typeof l==="object"&&n.call(l,"__await")){return Promise.resolve(l.__await).then(function(e){t("next",e,a,o)},function(e){t("throw",e,a,o)})}return Promise.resolve(l).then(function(e){u.value=e;a(u)},o)}}var r;function i(e,n){function i(){return new Promise(function(r,i){t(e,n,r,i)})}return r=r?r.then(i,i):i()}this._invoke=i}R(E.prototype);E.prototype[s]=function(){return this};f.AsyncIterator=E;f.async=function(e,t,r,n){var i=new E(c(e,t,r,n));return f.isGeneratorFunction(t)?i:i.next().then(function(e){return e.done?e.value:i.next()})};function C(e,t,r){var n=p;return function i(a,o){if(n===d){throw new Error("Generator is already running")}if(n===y){if(a==="throw"){throw o}return M()}r.method=a;r.arg=o;while(true){var s=r.delegate;if(s){var u=O(s,r);if(u){if(u===_)continue;return u}}if(r.method==="next"){r.sent=r._sent=r.arg}else if(r.method==="throw"){if(n===p){n=y;throw r.arg}r.dispatchException(r.arg)}else if(r.method==="return"){r.abrupt("return",r.arg)}n=d;var l=h(e,t,r);if(l.type==="normal"){n=r.done?y:v;if(l.arg===_){continue}return{value:l.arg,done:r.done}}else if(l.type==="throw"){n=y;r.method="throw";r.arg=l.arg}}}}function O(e,t){var r=e.iterator[t.method];if(r===i){t.delegate=null;if(t.method==="throw"){if(e.iterator.return){t.method="return";t.arg=i;O(e,t);if(t.method==="throw"){return _}}t.method="throw";t.arg=new TypeError("The iterator does not provide a 'throw' method")}return _}var n=h(r,e.iterator,t.arg);if(n.type==="throw"){t.method="throw";t.arg=n.arg;t.delegate=null;return _}var a=n.arg;if(!a){t.method="throw";t.arg=new TypeError("iterator result is not an object");t.delegate=null;return _}if(a.done){t[e.resultName]=a.value;t.next=e.nextLoc;if(t.method!=="return"){t.method="next";t.arg=i}}else{return a}t.delegate=null;return _}R(k);k[u]="Generator";k[o]=function(){return this};k.toString=function(){return"[object Generator]"};function S(e){var t={tryLoc:e[0]};if(1 in e){t.catchLoc=e[1]}if(2 in e){t.finallyLoc=e[2];t.afterLoc=e[3]}this.tryEntries.push(t)}function F(e){var t=e.completion||{};t.type="normal";delete t.arg;e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}];e.forEach(S,this);this.reset(true)}f.keys=function(e){var t=[];for(var r in e){t.push(r)}t.reverse();return function r(){while(t.length){var n=t.pop();if(n in e){r.value=n;r.done=false;return r}}r.done=true;return r}};function A(e){if(e){var t=e[o];if(t){return t.call(e)}if(typeof e.next==="function"){return e}if(!isNaN(e.length)){var r=-1,a=function t(){while(++r<e.length){if(n.call(e,r)){t.value=e[r];t.done=false;return t}}t.value=i;t.done=true;return t};return a.next=a}}return{next:M}}f.values=A;function M(){return{value:i,done:true}}I.prototype={constructor:I,reset:function(e){this.prev=0;this.next=0;this.sent=this._sent=i;this.done=false;this.delegate=null;this.method="next";this.arg=i;this.tryEntries.forEach(F);if(!e){for(var t in this){if(t.charAt(0)==="t"&&n.call(this,t)&&!isNaN(+t.slice(1))){this[t]=i}}}},stop:function(){this.done=true;var e=this.tryEntries[0];var t=e.completion;if(t.type==="throw"){throw t.arg}return this.rval},dispatchException:function(e){if(this.done){throw e}var t=this;function r(r,n){s.type="throw";s.arg=e;t.next=r;if(n){t.method="next";t.arg=i}return!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];var s=o.completion;if(o.tryLoc==="root"){return r("end")}if(o.tryLoc<=this.prev){var u=n.call(o,"catchLoc");var l=n.call(o,"finallyLoc");if(u&&l){if(this.prev<o.catchLoc){return r(o.catchLoc,true)}else if(this.prev<o.finallyLoc){return r(o.finallyLoc)}}else if(u){if(this.prev<o.catchLoc){return r(o.catchLoc,true)}}else if(l){if(this.prev<o.finallyLoc){return r(o.finallyLoc)}}else{throw new Error("try statement without catch or finally")}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}if(a&&(e==="break"||e==="continue")&&a.tryLoc<=t&&t<=a.finallyLoc){a=null}var o=a?a.completion:{};o.type=e;o.arg=t;if(a){this.method="next";this.next=a.finallyLoc;return _}return this.complete(o)},complete:function(e,t){if(e.type==="throw"){throw e.arg}if(e.type==="break"||e.type==="continue"){this.next=e.arg}else if(e.type==="return"){this.rval=this.arg=e.arg;this.method="return";this.next="end"}else if(e.type==="normal"&&t){this.next=t}return _},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e){this.complete(r.completion,r.afterLoc);F(r);return _}}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if(n.type==="throw"){var i=n.arg;F(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){this.delegate={iterator:A(e),resultName:t,nextLoc:r};if(this.method==="next"){this.arg=i}return _}}}(function(){return this}()||Function("return this")())},function(e,t,r){"use strict";r.d(t,"a",function(){return k});var n=r(6);var i=r.n(n);var a=r(0);var o=r.n(a);var s=r(2);var u=r.n(s);var l=r(3);var f=r.n(l);var c=r(1);var h=r.n(c);var p=r(4);var v=r.n(p);var d=r(59);var y=r(60);var _=r(43);var g=i.a||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}}return e};var m=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;o()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function b(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function w(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function x(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)u.a?u()(e,t):e.__proto__=t}var T=p["Math"].Rectangle;var k=function(e){x(t,e);function t(){b(this,t);return w(this,(t.__proto__||h()(t)).apply(this,arguments))}m(t,[{key:"_calculateLayoutElements",value:function e(){if(this.getWords().size()<=0){return[]}var r=this.serializeOptions(),n=r.orientation,i=r.width,a=r.size,o=r.relativeRowOffset,s=r.attributes;var u=s.fontIdentifier;var l=this.getWords().joined(3);var f=n===t.Orientations.Left?[l[0],l[1],l[2]]:[l[1],l[2],l[0]];var c=p["Utils"].Array.range(0,2).map(function(e){return new y["a"]({text:f[e],fontIdentifier:u,fontSize:60})});var h=c.map(function(e){return e.getSizeValue()});var v=h[0].width>h[1].width?0:1;var d=(v+1)%2;c[d].fitWidth(h[v].width);h[d]=c[d].getSizeValue();var g=(h[d].height+h[v].height)/(1-o);var m=new y["a"]({text:f[2],fontIdentifier:u});m.fitHeight(g);var b=m.getSizeValue().width;var w=h[v].width;var x=i/(b+w);var k=x*b;var R=x*w;var E=x*g;var C=o*E;a.set(i,E);var O=p["Utils"].Array.range(0,3).map(function(e){return new y["a"]({text:f[e],fontIdentifier:u})});O[0].fitWidth(R);O[1].fitWidth(R);O[2].fitWidth(k);var S=n===t.Orientations.Left?0:k;var F=n===t.Orientations.Left?R:0;var I=[S,S,F];var A=[0,O[0].getSizeValue().height+C,0];var M=O.map(function(e,t){return new T(I[t],A[t],e.getSizeValue().width,e.getSizeValue().height)});return O.map(function(e,t){return new _["a"]({text:f[t],font:O[t],frame:M[t]})})}}]);return t}(d["a"]);k.Orientations={Right:"RIGHT",Left:"LEFT"};k.prototype.availableOptions=g({},d["a"].prototype.availableOptions,{orientation:{type:p["OptionType"].STRING,default:k.Orientations.Left,available:[k.Orientations.Right,k.Orientations.Left]},relativeRowOffset:{type:p["OptionType"].NUMBER,default:.05}})},function(e,t,r){"use strict";r.d(t,"a",function(){return R});var n=r(6);var i=r.n(n);var a=r(0);var o=r.n(a);var s=r(5);var u=r.n(s);var l=r(2);var f=r.n(l);var c=r(3);var h=r.n(c);var p=r(1);var v=r.n(p);var d=r(4);var y=r.n(d);var _=r(57);var g=r(19);var m=i.a||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}}return e};var b=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;o()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var w=function e(t,r,n){if(t===null)t=Function.prototype;var i=u()(t,r);if(i===undefined){var a=v()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var o=i.get;if(o===undefined){return undefined}return o.call(n)}};function x(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function T(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function k(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=h()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)f.a?f()(e,t):e.__proto__=t}var R=function(e){k(t,e);function t(){var e;x(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=T(this,(e=t.__proto__||v()(t)).call.apply(e,[this].concat(n)));a._exclusiveFont=null;return a}b(t,[{key:"generateLayoutData",value:function e(r,n){this._exclusiveFont=this._fontRandomizer.pickNext(this.getFontIdentifiers());return w(t.prototype.__proto__||v()(t.prototype),"generateLayoutData",this).call(this,r,n)}},{key:"_fontForRow",value:function e(r,n){return this._exclusiveFont||w(t.prototype.__proto__||v()(t.prototype),"_fontForRow",this).call(this,r,n)}},{key:"_layoutRow",value:function e(t,r,n,i){return new g["a"]({words:t,width:r,attributes:n})}}]);return t}(_["a"]);R.defaultFontIdentifiers=["imgly_font_ostrich_sans_heavy","imgly_font_ostrich_sans_bold","imgly_font_ostrich_sans_black"];R.identifier="imgly_text_design_blocks_condensed";R.prototype.availableOptions=m({},_["a"].prototype.availableOptions,{fontIdentifiers:{type:d["OptionType"].ARRAY,default:R.defaultFontIdentifiers}})},function(e,t,r){"use strict";r.d(t,"a",function(){return x});var n=r(6);var i=r.n(n);var a=r(0);var o=r.n(a);var s=r(2);var u=r.n(s);var l=r(3);var f=r.n(l);var c=r(1);var h=r.n(c);var p=r(4);var v=r.n(p);var d=r(57);var y=r(19);var _=i.a||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}}return e};var g=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;o()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function m(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function b(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function w(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)u.a?u()(e,t):e.__proto__=t}var x=function(e){w(t,e);function t(){m(this,t);return b(this,(t.__proto__||h()(t)).apply(this,arguments))}g(t,[{key:"_layoutRow",value:function e(t,r,n,i){return new y["a"]({words:t,width:r,attributes:n})}}]);return t}(d["a"]);x.defaultFontIdentifiers=["imgly_font_summer_font_light"];x.identifier="imgly_text_design_blocks_light";x.prototype.availableOptions=_({},d["a"].prototype.availableOptions,{fontIdentifiers:{type:p["OptionType"].ARRAY,default:x.defaultFontIdentifiers}})},function(e,t,r){"use strict";r.d(t,"a",function(){return L});var n=r(6);var i=r.n(n);var a=r(15);var o=r.n(a);var s=r(0);var u=r.n(s);var l=r(5);var f=r.n(l);var c=r(2);var h=r.n(c);var p=r(3);var v=r.n(p);var d=r(1);var y=r.n(d);var _=r(4);var g=r.n(_);var m=r(57);var b=r(19);var w=r(103);var x=r(33);var T=r(105);var k=r(152);var R=r(153);var E=r(20);var C=r(16);var O=i.a||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}}return e};var S=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;u()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var F=function e(t,r,n){if(t===null)t=Function.prototype;var i=f()(t,r);if(i===undefined){var a=y()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var o=i.get;if(o===undefined){return undefined}return o.call(n)}};function I(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++){r[t]=e[t]}return r}else{return o()(e)}}function A(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function M(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function D(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=v()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)h.a?h()(e,t):e.__proto__=t}var L=function(e){D(t,e);function t(){var e;A(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=M(this,(e=t.__proto__||y()(t)).call.apply(e,[this].concat(n)));a.getImagePaths=function(){var e=a.getBanderoles();return[].concat(I(e&&e.map(function(e){return e.getImagePath()})||[]),I(a._celebrateTypes))};a.onImagesLoaded=function(){var e=a.getBanderoles();e&&e.forEach(function(e){var t=E["a"].getImage(e.getImagePath());if(!t){_["Log"].warn("TextDesignBlocks#onImagesLoaded: Image not found '"+e.getImagePath()+"'");return}e.setImage(t)})};a._celebrateTypes=[R["a"].RowImages.celebrate1,R["a"].RowImages.celebrate2,R["a"].RowImages.celebrate3];a._exclusiveFont=null;a._typeRandomizer=new C["a"](0);a._useMaskedRandomizer=new C["a"](0);a._seedPool.push(a._typeRandomizer);a._seedPool.push(a._useMaskedRandomizer);return a}S(t,[{key:"_fontForRow",value:function e(t,r){var n=this.getFontIdentifiers();return n[t%(n.length-1)]}},{key:"_layoutRows",value:function e(r,n){var i=this._typeRandomizer.pickNext(this._celebrateTypes);var a=E["a"].getImage(i);if(!a){_["Log"].warn("TextDesignCelebrateSimple#_layoutRows: Image not fount '"+i+"'")}var o=new R["a"]({width:n,height:n*.5,drawingModeAspectFit:true,image:a}).layout();var s=F(t.prototype.__proto__||y()(t.prototype),"_layoutRows",this).call(this,r,n);return[o].concat(I(s))}},{key:"_randomLayoutRow",value:function e(r,n,i,a){var o=r.countNumberOfCharacters();var s=13;var u=4;if(o<u){a.setFontIdentifier("imgly_font_rasa_regular")}var l=this._useMaskedRandomizer.nextBool(2,1);if(o<s&&l&&!this.getHasMaskedText()){return this._layoutRow(r,i,a,true)}return F(t.prototype.__proto__||y()(t.prototype),"_randomLayoutRow",this).call(this,r,n,i,a)}}]);return t}(k["a"]);L.identifier="imgly_text_design_celebrate_simple";L.defaultFontIdentifiers=["imgly_font_amberlight","imgly_font_rasa_regular","imgly_font_rasa_500"];L.prototype.availableOptions=O({},k["a"].prototype.availableOptions,{fontIdentifiers:{type:_["OptionType"].ARRAY,default:L.defaultFontIdentifiers}})},function(e,t,r){"use strict";r.d(t,"a",function(){return w});var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(4);var h=r.n(c);var p=r(155);var v=r(20);var d=r(34);var y=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function _(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function g(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function m(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var b=c["Math"].Rectangle;var w=function(e){m(t,e);function t(){_(this,t);return g(this,(t.__proto__||f()(t)).apply(this,arguments))}y(t,[{key:"getImagePaths",value:function e(){var t=this._options,r=t.topImagePath,n=t.bottomImagePath,i=t.leftImagePath,a=t.rightImagePath;return[r,n,i,a].filter(function(e){return e!==""})}},{key:"render",value:function e(t,r,n,i,a){var o=n.clone().scale(r.width);var s=r.rectangle(0,0);var u=v["a"].getImage(this.getTopImagePath());var l=v["a"].getImage(this.getLeftImagePath());var f=v["a"].getImage(this.getRightImagePath());var c=v["a"].getImage(this.getBottomImagePath());if(u){var h=u.width/u.height;var p=o.top*this.getTopImageFillRate();var y=p*h;var _=s.width/2;var g=_-y/2;var m=new b(g,0,y,p);Object(d["a"])(t,u,m,i)}if(c){var w=c.width/c.height;var x=o.bottom*this.getBottomImageFillRate();var T=x*w;var k=s.width/2;var R=k-T/2;var E=new b(R,s.height-x,T,x);Object(d["a"])(t,c,E,i)}if(l){var C=l.width/l.height;var O=o.left*this.getLeftImageFillRate();var S=O/C;var F=s.height/2;var I=F-S/2;var A=new b(0,I,O,S);Object(d["a"])(t,l,A,i)}if(f){var M=f.width/f.height;var D=o.right*this.getRightImageFillRate();var L=D/M;var B=s.height/2;var P=B-L/2;var U=new b(s.width-D,P,D,L);Object(d["a"])(t,f,U,i)}}}]);return t}(p["a"]);w.prototype.availableOptions={topImagePath:{type:c["OptionType"].STRING,default:""},leftImagePath:{type:c["OptionType"].STRING,default:""},bottomImagePath:{type:c["OptionType"].STRING,default:""},rightImagePath:{type:c["OptionType"].STRING,default:""},topImageFillRate:{type:c["OptionType"].NUMBER,default:1},leftImageFillRate:{type:c["OptionType"].NUMBER,default:1},bottomImageFillRate:{type:c["OptionType"].NUMBER,default:1},rightImageFillRate:{type:c["OptionType"].NUMBER,default:1}};w.Backgrounds=[new w({topImagePath:"text-design/images/imgly_xib_image_text_design_equal_width_background1_1.png",leftImagePath:"text-design/images/imgly_xib_image_text_design_equal_width_background1_2.png",rightImagePath:"text-design/images/imgly_xib_image_text_design_equal_width_background1_2.png",bottomImagePath:"text-design/images/imgly_xib_image_text_design_equal_width_background1_3.png",topImageFillRate:.8,leftImageFillRate:.6,rightImageFillRate:.6,bottomImageFillRate:.8}),new w({leftImagePath:"text-design/images/imgly_xib_image_text_design_equal_width_background2_1.png",rightImagePath:"text-design/images/imgly_xib_image_text_design_equal_width_background2_1.png",bottomImagePath:"text-design/images/imgly_xib_image_text_design_equal_width_background2_2.png",leftImageFillRate:.6,rightImageFillRate:.6,bottomImageFillRate:.6}),new w({topImagePath:"text-design/images/imgly_xib_image_text_design_equal_width_background3_1.png",bottomImagePath:"text-design/images/imgly_xib_image_text_design_equal_width_background3_2.png",topImageFillRate:.6,bottomImageFillRate:.6}),new w({topImagePath:"text-design/images/imgly_xib_image_text_design_equal_width_background4_1.png",leftImagePath:"text-design/images/imgly_xib_image_text_design_equal_width_background4_3.png",rightImagePath:"text-design/images/imgly_xib_image_text_design_equal_width_background4_3.png",bottomImagePath:"text-design/images/imgly_xib_image_text_design_equal_width_background4_2.png",topImageFillRate:.1,leftImageFillRate:.6,rightImageFillRate:.6,bottomImageFillRate:.6})]},function(e,t,r){"use strict";r.d(t,"a",function(){return x});var n=r(6);var i=r.n(n);var a=r(0);var o=r.n(a);var s=r(2);var u=r.n(s);var l=r(3);var f=r.n(l);var c=r(1);var h=r.n(c);var p=r(4);var v=r.n(p);var d=r(154);var y=r(17);var _=i.a||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}}return e};var g=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;o()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function m(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function b(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function w(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)u.a?u()(e,t):e.__proto__=t}var x=function(e){w(t,e);function t(){var e;m(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=b(this,(e=t.__proto__||h()(t)).call.apply(e,[this].concat(n)));a._relativeInsets=new y["a"];return a}g(t,[{key:"_getBackground",value:function e(){return null}}]);return t}(d["a"]);x.defaultFontIdentifiers=["imgly_font_ultra"];x.identifier="imgly_text_design_equal_width_fat";x.prototype.availableOptions=_({},d["a"].prototype.availableOptions,{fontIdentifiers:{type:p["OptionType"].ARRAY,default:x.defaultFontIdentifiers}})},function(e,t,r){"use strict";r.d(t,"a",function(){return C});var n=r(6);var i=r.n(n);var a=r(0);var o=r.n(a);var s=r(5);var u=r.n(s);var l=r(2);var f=r.n(l);var c=r(3);var h=r.n(c);var p=r(1);var v=r.n(p);var d=r(4);var y=r.n(d);var _=r(20);var g=r(151);var m=r(23);var b=i.a||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}}return e};var w=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;o()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var x=function e(t,r,n){if(t===null)t=Function.prototype;var i=u()(t,r);if(i===undefined){var a=v()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var o=i.get;if(o===undefined){return undefined}return o.call(n)}};function T(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function k(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function R(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=h()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)f.a?f()(e,t):e.__proto__=t}var E=d["Math"].Vector2;var C=function(e){R(t,e);function t(e){T(this,t);var r=k(this,(t.__proto__||v()(t)).call(this,e));r._textOptions={};r._createCanvas();return r}w(t,[{key:"_createCanvas",value:function e(){this._canvas=d["Utils"].createCanvas();this._context=this._canvas.getContext("2d");this._textSplitter=new g["a"](this._context);this._finalCanvas=d["Utils"].createCanvas();this._finalContext=this._finalCanvas.getContext("2d");this.updateFontVariation()}},{key:"setOption",value:function e(r,n){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;x(t.prototype.__proto__||v()(t.prototype),"setOption",this).call(this,r,n,i,a);if(r==="fontIdentifier"&&!a){this.updateFontVariation()}}},{key:"updateFontVariation",value:function e(){var t=_["a"].getVariation(this.getFontIdentifier());if(!t){d["Log"].warn("TextDesignFont: Unable to find font '"+this._fontIdentifier+"'")}this.setFontVariation(t);return t}},{key:"_applyTextOptions",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this._context;var n=b({},this._options,t),i=n.fontSize,a=n.fontVariation,o=n.lineHeight,s=n.textColor,u=n.alignment;var l=a.serializeOptions(),f=l.fontStyle,c=l.fontWeight,h=l.fontFamily;r.font=f+" "+c+" "+i+"px "+'"'+h+'"';r.fillStyle=s;r.textBaseline="top";r.textAlign=u||"left"}},{key:"_buildOutputLines",value:function e(t){this._textSplitter.setText(this.getText());this._textSplitter.setMaxWidth(t);return this._textSplitter.getLines()}},{key:"_renderTextLine",value:function e(t,r){var n=this.getAlignment();var i=new E(0,r);switch(n){case"center":i.x=this._canvas.width/2;break;case"right":i.x=this._canvas.width;break}this._context.fillText(t,i.x,i.y)}},{key:"update",value:function e(){var t=this.calculateFontStyles();if(t){var r=this._calculateText(t),n=r.dimensions,i=r.lines;this._dimensions=n;this._renderText(n,i,t)}}},{key:"draw",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;this.update();t.drawImage(this._canvas,r,n,this._dimensions.x,this._dimensions.y)}},{key:"_renderText",value:function e(t,r,n){this._canvas.width=t.x;this._canvas.height=t.y;this._context=this._canvas.getContext("2d");this._applyTextOptions(n,this._context);for(var i=0;i<r.length;i++){var a=r[i];this._renderTextLine(a,n.topPadding+n.lineHeight*i)}}},{key:"getFontFamily",value:function e(){var t=this.getFontVariation();return t.getFontFamily()}},{key:"calculateFontStyles",value:function e(){var t=this.getFontFamily();var r=this.getFontSize();var n=this.getAbsoluteTextHeight();var i=n*this.getLineHeight();var a=n*(this.getLineHeight()-1)/2;var o={fontFamily:t,fontSize:r,textHeight:n,lineHeight:i,topPadding:a};this._textOptions=b({},o);return o}},{key:"getTextMetrics",value:function e(){var t=this.getFontVariation();return t.getTextMetrics()}},{key:"getAbsoluteTextHeight",value:function e(){var t=this.getFontSize();var r=this.getTextMetrics();if(r){var n=1/r.unitsPerEm*t;var i=r.ascender*n;var a=r.descender*n;return i+Math.abs(a)}else{return t*this.getLineHeight()*1.1}}},{key:"_calculateText",value:function e(t){this._applyTextOptions(t,this._context);var r=new E;var n=this.getText().split("\n");var i=void 0;if(typeof i!=="undefined"){r.x=i;n=this._buildOutputLines(i)}else{for(var a=0;a<n.length;a++){var o=n[a];r.x=Math.max(r.x,this._context.measureText(o).width)}}var s=t.lineHeight;r.y=n.length*s;return{dimensions:r,lines:n}}},{key:"getDimensions",value:function e(){var t=this.calculateFontStyles();var r=this._calculateText(t),n=r.dimensions;return n}},{key:"fitMaxHeight",value:function e(){this.update();var t=this.getDimensions();var r=this.getText().split("\n");var n=this.getMaxHeight()/t.y}},{key:"fitMaxWidth",value:function e(){var t=this.getDimensions().x;var r=this.getMaxWidth()/t;this.setFontSize(this.getFontSize()*r);this._textOptions.fontSize=this.getFontSize()}},{key:"fitInFrame",value:function e(t){this.setMaxWidth(t.width);this.setMaxHeight(t.height);this.fitMaxWidth();this.fitMaxHeight()}},{key:"getSize",value:function e(){var t=this.getDimensions();return new m["a"](t.x,t.y)}}]);return t}(d["Configurable"]);C.prototype.availableOptions={text:{type:d["OptionType"].STRING,default:""},fontIdentifier:{type:d["OptionType"].STRING,default:"imgly_font_open_sans_bold"},fontVariation:{type:d["OptionType"].OBJECT,default:null},lineHeight:{type:d["OptionType"].NUMBER,default:1},fontSize:{type:d["OptionType"].NUMBER,default:22},textColor:{type:d["OptionType"].STRING,default:"black"},strokeStyle:{type:d["OptionType"].STRING,default:"black"},outlineWidth:{type:d["OptionType"].NUMBER,default:0},textBaseline:{type:d["OptionType"].STRING,default:"alphabetic"},excludeAccents:{type:d["OptionType"].BOOLEAN,default:true},maxWidth:{type:d["OptionType"].NUMBER,default:100},maxHeight:{type:d["OptionType"].NUMBER,default:0},alignment:{type:d["OptionType"].STRING,default:"left",available:["left","center","right"]}}},function(e,t,r){"use strict";r.d(t,"a",function(){return E});var n=r(6);var i=r.n(n);var a=r(0);var o=r.n(a);var s=r(5);var u=r.n(s);var l=r(2);var f=r.n(l);var c=r(3);var h=r.n(c);var p=r(1);var v=r.n(p);var d=r(4);var y=r.n(d);var _=r(61);var g=r(44);var m=r(16);var b=i.a||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}}return e};var w=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;o()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var x=function e(t,r,n){if(t===null)t=Function.prototype;var i=u()(t,r);if(i===undefined){var a=v()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var o=i.get;if(o===undefined){return undefined}return o.call(n)}};function T(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function k(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function R(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=h()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)f.a?f()(e,t):e.__proto__=t}var E=function(e){R(t,e);function t(){var e;T(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=k(this,(e=t.__proto__||v()(t)).call.apply(e,[this].concat(n)));a._possibleRowTypes=[_["a"].Badge1,_["a"].Badge2,_["a"].Badge3,_["a"].Badge4];a._rowTypesRandomizer=new m["a"](0);a._isMaskedRandomizer=new m["a"](0);a._seedPool.push(a._rowTypesRandomizer);a._seedPool.push(a._isMaskedRandomizer);return a}w(t,[{key:"getImagePaths",value:function e(){return this._possibleRowTypes.map(function(e){return e.getImagePath()})}},{key:"_randomLayoutRow",value:function e(r,n,i,a){this._rowType=this._rowTypesRandomizer.pickNext(this._possibleRowTypes);a.setLineSpacing(.9);var o=x(t.prototype.__proto__||v()(t.prototype),"_randomLayoutRow",this).call(this,r,n,i,a);o.set({textScaleFactor:.9});return o}}]);return t}(g["a"]);E.defaultFontIdentifiers=["imgly_font_campton_bold"];E.identifier="imgly_text_design_masked_badge";E.ValidAlignments=[g["a"].Alignment.Center];E.prototype.availableOptions=b({},g["a"].prototype.availableOptions,{fontIdentifiers:{type:d["OptionType"].ARRAY,default:E.defaultFontIdentifiers}})},function(e,t,r){"use strict";r.d(t,"a",function(){return T});var n=r(6);var i=r.n(n);var a=r(0);var o=r.n(a);var s=r(2);var u=r.n(s);var l=r(3);var f=r.n(l);var c=r(1);var h=r.n(c);var p=r(4);var v=r.n(p);var d=r(61);var y=r(44);var _=r(107);var g=i.a||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}}return e};var m=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;o()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function b(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function w(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function x(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)u.a?u()(e,t):e.__proto__=t}var T=function(e){x(t,e);function t(){var e;b(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=w(this,(e=t.__proto__||h()(t)).call.apply(e,[this].concat(n)));a._possibleRowTypes=[d["a"].SpeechBubble2,d["a"].SpeechBubble4,d["a"].SpeechBubble2,d["a"].SpeechBubble4,d["a"].SpeechBubble5];a._possibleRowTypesForMin15=a._possibleRowTypes.slice(0,2);a._possibleRowTypesForMax14=a._possibleRowTypes.slice(2);return a}m(t,[{key:"_rowTypes",value:function e(t){return t.countNumberOfCharacters()<15?this._possibleRowTypesForMax14:this._possibleRowTypesForMin15}}]);return t}(_["a"]);T.defaultFontIdentifiers=["imgly_font_gagalin_regular"];T.identifier="imgly_text_design_masked_speech_bubble_comic";T.prototype.availableOptions=g({},_["a"].prototype.availableOptions,{fontIdentifiers:{type:p["OptionType"].ARRAY,default:T.defaultFontIdentifiers}})},function(e,t,r){"use strict";r.d(t,"a",function(){return R});var n=r(6);var i=r.n(n);var a=r(0);var o=r.n(a);var s=r(5);var u=r.n(s);var l=r(2);var f=r.n(l);var c=r(3);var h=r.n(c);var p=r(1);var v=r.n(p);var d=r(4);var y=r.n(d);var _=r(44);var g=r(106);var m=i.a||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}}return e};var b=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;o()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var w=function e(t,r,n){if(t===null)t=Function.prototype;var i=u()(t,r);if(i===undefined){var a=v()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var o=i.get;if(o===undefined){return undefined}return o.call(n)}};function x(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function T(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function k(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=h()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)f.a?f()(e,t):e.__proto__=t}var R=function(e){k(t,e);function t(){x(this,t);return T(this,(t.__proto__||v()(t)).apply(this,arguments))}b(t,[{key:"_modifiedText",value:function e(r){return w(t.prototype.__proto__||v()(t.prototype),"_modifiedText",this).call(this,r).toUpperCase()}},{key:"_randomLayoutRow",value:function e(t,r,n,i){var a=this._alignmentRandomizer.pickNext(_["a"].ValidAlignments);i.setAlignment(a);return new g["a"]({words:t,width:n,attributes:i,image:null,backgroundColor:d["Color"].WHITE,centerOffset:0,sizeToFitContent:true,isMasked:false,autoAdjustTextColor:false})}}]);return t}(_["a"]);R.defaultFontIdentifiers=["imgly_font_abril_fatface_regular"];R.identifier="imgly_text_design_multiline";R.prototype.availableOptions=m({},_["a"].prototype.availableOptions,{fontIdentifiers:{type:d["OptionType"].ARRAY,default:R.defaultFontIdentifiers}})},function(e,t,r){"use strict";r.d(t,"a",function(){return b});var n=r(6);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(4);var h=r.n(c);var p=r(61);var v=r(44);var d=r(107);var y=i.a||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}}return e};function _(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function g(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function m(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var b=function(e){m(t,e);function t(){var e;_(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=g(this,(e=t.__proto__||f()(t)).call.apply(e,[this].concat(n)));a._possibleRowTypes=[p["a"].Watercolor1,p["a"].Watercolor2,p["a"].Watercolor3];return a}return t}(d["a"]);b.defaultFontIdentifiers=["imgly_font_hello_sunshine_marker","imgly_font_hello_sunshine","imgly_font_hello_sunshine_italic"];b.identifier="imgly_text_design_watercolor";b.prototype.availableOptions=y({},d["a"].prototype.availableOptions,{fontIdentifiers:{type:c["OptionType"].ARRAY,default:b.defaultFontIdentifiers},alignment:{type:c["OptionType"].STRING,default:v["a"].Alignment.Center,available:v["a"].ValidAlignments}})},function(e,t,r){"use strict";r.d(t,"a",function(){return F});var n=r(6);var i=r.n(n);var a=r(15);var o=r.n(a);var s=r(0);var u=r.n(s);var l=r(2);var f=r.n(l);var c=r(3);var h=r.n(c);var p=r(1);var v=r.n(p);var d=r(4);var y=r.n(d);var _=r(20);var g=r(17);var m=r(156);var b=r(371);var w=r(373);var x=r(374);var T=r(16);var k=i.a||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}}return e};var R=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;u()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function E(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++){r[t]=e[t]}return r}else{return o()(e)}}function C(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function O(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function S(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=h()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)f.a?f()(e,t):e.__proto__=t}var F=function(e){S(t,e);function t(){var e;C(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=O(this,(e=t.__proto__||v()(t)).call.apply(e,[this].concat(n)));a._relativeInsets=new g["a"](.3,.3,.3,.3);a._backgroundRandomizer=new T["a"](0);a._decoTypeRandomizer=new T["a"](0);a._seedPool.push(a._backgroundRandomizer);a._seedPool.push(a._decoTypeRandomizer);return a}R(t,[{key:"getImagePaths",value:function e(){return[].concat(E(m["a"].RowImages),E(d["Utils"].Array.flatten(t.Backgrounds.map(function(e){return e.getImagePaths()}))),E(t.DecoratorImages))}},{key:"_getBackground",value:function e(){return this._backgroundRandomizer.pickNext(t.Backgrounds)}},{key:"_randomDecoratorImages",value:function e(){switch(this._decoTypeRandomizer.nextInRange(0,2)){case 0:return t.DecoratorImages.slice(0,2).map(function(e){return _["a"].getImage(e)});case 1:case 2:return t.DecoratorImages.slice(2).map(function(e){return _["a"].getImage(e)});default:d["Log"].warn("TextDesignParticles#_randomDecoratorImages: Number generated not in valid range.");return t.DecoratorImages.slice(2).map(function(e){return _["a"].getImage(e)})}}}]);return t}(m["a"]);F.defaultFontIdentifiers=["imgly_font_hello_sunshine_marker","imgly_font_hello_sunshine","imgly_font_hello_sunshine_italic","imgly_font_montserrat_light"];F.identifier="imgly_text_design_particles";F.Backgrounds=[new b["a"],new w["a"],new x["a"]];F.DecoratorImages=["text-design/images/imgly_text_design_particle_holder_01.png","text-design/images/imgly_text_design_particle_holder_02.png","text-design/images/imgly_text_design_particle_holder_03.png","text-design/images/imgly_text_design_particle_holder_04.png"];F.prototype.availableOptions=k({},m["a"].prototype.availableOptions,{fontIdentifiers:{type:d["OptionType"].ARRAY,default:F.defaultFontIdentifiers},decorationsVisible:{type:d["OptionType"].BOOLEAN,default:false},decorativeRowsInTheMiddleOnly:{type:d["OptionType"].BOOLEAN,default:true}})},function(e,t,r){"use strict";r.d(t,"a",function(){return w});var n=r(15);var i=r.n(n);var a=r(6);var o=r.n(a);var s=r(2);var u=r.n(s);var l=r(3);var f=r.n(l);var c=r(1);var h=r.n(c);var p=r(4);var v=r.n(p);var d=r(108);var y=o.a||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}}return e};function _(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++){r[t]=e[t]}return r}else{return i()(e)}}function g(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function m(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function b(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)u.a?u()(e,t):e.__proto__=t}var w=function(e){b(t,e);function t(){g(this,t);return m(this,(t.__proto__||h()(t)).apply(this,arguments))}return t}(d["a"]);w.Images=["text-design/images/imgly_text_design_particle_brush_01.png","text-design/images/imgly_text_design_particle_brush_02.png","text-design/images/imgly_text_design_particle_brush_03.png","text-design/images/imgly_text_design_particle_brush_04.png","text-design/images/imgly_text_design_particle_brush_05.png","text-design/images/imgly_text_design_particle_brush_06.png","text-design/images/imgly_text_design_particle_brush_07.png","text-design/images/imgly_text_design_particle_brush_08.png","text-design/images/imgly_text_design_particle_brush_09.png","text-design/images/imgly_text_design_particle_brush_10.png"];w.prototype.availableOptions=y({},d["a"].prototype.availableOptions,{imagePaths:{type:p["OptionType"].ARRAY,default:[].concat(_(w.Images))},relativeParticleSize:{type:p["OptionType"].NUMBER,default:.12}})},function(e,t,r){"use strict";r.d(t,"a",function(){return g});var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(4);var h=r.n(c);var p=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function v(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function d(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function y(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var _=c["Math"].Rectangle;var g=function(e){y(t,e);function t(){v(this,t);return d(this,(t.__proto__||f()(t)).apply(this,arguments))}p(t,[{key:"getContentFrame",value:function e(){var t=this.getFrame().clone();var r=t.width*.1;return t.insetBy(r,r)}},{key:"intersects",value:function e(t){return this.getFrame().intersects(t.getFrame())}}]);return t}(c["Configurable"]);g.prototype.availableOptions={frame:{type:c["OptionType"].OBJECT,default:new _}}},function(e,t,r){"use strict";r.d(t,"a",function(){return w});var n=r(15);var i=r.n(n);var a=r(6);var o=r.n(a);var s=r(2);var u=r.n(s);var l=r(3);var f=r.n(l);var c=r(1);var h=r.n(c);var p=r(4);var v=r.n(p);var d=r(108);var y=o.a||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}}return e};function _(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++){r[t]=e[t]}return r}else{return i()(e)}}function g(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function m(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function b(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)u.a?u()(e,t):e.__proto__=t}var w=function(e){b(t,e);function t(){g(this,t);return m(this,(t.__proto__||h()(t)).apply(this,arguments))}return t}(d["a"]);w.Images=["text-design/images/imgly_text_design_particle_circle_01.png","text-design/images/imgly_text_design_particle_circle_02.png","text-design/images/imgly_text_design_particle_circle_03.png","text-design/images/imgly_text_design_particle_circle_04.png","text-design/images/imgly_text_design_particle_circle_05.png","text-design/images/imgly_text_design_particle_circle_06.png","text-design/images/imgly_text_design_particle_circle_07.png","text-design/images/imgly_text_design_particle_circle_08.png","text-design/images/imgly_text_design_particle_circle_09.png","text-design/images/imgly_text_design_particle_circle_10.png"];w.prototype.availableOptions=y({},d["a"].prototype.availableOptions,{imagePaths:{type:p["OptionType"].ARRAY,default:[].concat(_(w.Images))},relativeParticleSize:{type:p["OptionType"].NUMBER,default:.12}})},function(e,t,r){"use strict";r.d(t,"a",function(){return w});var n=r(15);var i=r.n(n);var a=r(6);var o=r.n(a);var s=r(2);var u=r.n(s);var l=r(3);var f=r.n(l);var c=r(1);var h=r.n(c);var p=r(4);var v=r.n(p);var d=r(108);var y=o.a||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}}return e};function _(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++){r[t]=e[t]}return r}else{return i()(e)}}function g(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function m(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function b(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)u.a?u()(e,t):e.__proto__=t}var w=function(e){b(t,e);function t(){g(this,t);return m(this,(t.__proto__||h()(t)).apply(this,arguments))}return t}(d["a"]);w.Images=["text-design/images/imgly_text_design_particle_triangle_01.png","text-design/images/imgly_text_design_particle_triangle_02.png","text-design/images/imgly_text_design_particle_triangle_03.png","text-design/images/imgly_text_design_particle_triangle_04.png","text-design/images/imgly_text_design_particle_triangle_05.png","text-design/images/imgly_text_design_particle_triangle_06.png","text-design/images/imgly_text_design_particle_triangle_07.png","text-design/images/imgly_text_design_particle_triangle_08.png","text-design/images/imgly_text_design_particle_triangle_09.png","text-design/images/imgly_text_design_particle_triangle_10.png"];w.prototype.availableOptions=y({},d["a"].prototype.availableOptions,{imagePaths:{type:p["OptionType"].ARRAY,default:[].concat(_(w.Images))}})},function(e,t,r){"use strict";r.d(t,"a",function(){return F});var n=r(6);var i=r.n(n);var a=r(15);var o=r.n(a);var s=r(0);var u=r.n(s);var l=r(5);var f=r.n(l);var c=r(2);var h=r.n(c);var p=r(3);var v=r.n(p);var d=r(1);var y=r.n(d);var _=r(4);var g=r.n(_);var m=r(58);var b=r(17);var w=r(376);var x=r(16);var T=i.a||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}}return e};var k=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;u()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var R=function e(t,r,n){if(t===null)t=Function.prototype;var i=f()(t,r);if(i===undefined){var a=y()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var o=i.get;if(o===undefined){return undefined}return o.call(n)}};function E(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++){r[t]=e[t]}return r}else{return o()(e)}}function C(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function O(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function S(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=v()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)h.a?h()(e,t):e.__proto__=t}var F=function(e){S(t,e);function t(){var e;C(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=O(this,(e=t.__proto__||y()(t)).call.apply(e,[this].concat(n)));a._relativeInsets=new b["a"](.1,0,0,0);a._rowTypeRandomizer=new x["a"](0);a._seedPool.push(a._rowTypeRandomizer);return a}k(t,[{key:"_modifiedText",value:function e(r){return R(t.prototype.__proto__||y()(t.prototype),"_modifiedText",this).call(this,r).toUpperCase()}},{key:"_randomLayoutRow",value:function e(r,n,i,a){var o=R(t.prototype.__proto__||y()(t.prototype),"_randomLayoutRow",this).call(this,r,n,i,a);o.setShearingAngle(this.getShearingAngle());return o}},{key:"_layoutRows",value:function e(r,n){var i=R(t.prototype.__proto__||y()(t.prototype),"_layoutRows",this).call(this,r,n);var a=_["Utils"].values(w["a"].FormType);var o=30;var s=new w["a"]({width:n,height:o,type:this._rowTypeRandomizer.pickNext(a),shearingAngle:this.getShearingAngle()}).layout();var u=new w["a"]({width:n,height:o,type:this._rowTypeRandomizer.pickNext(a),shearingAngle:this.getShearingAngle()}).layout();return[s].concat(E(i),[u])}}]);return t}(m["a"]);F.defaultFontIdentifiers=["imgly_font_campton_bold"];F.identifier="imgly_text_design_rotated";F.prototype.availableOptions=T({},m["a"].prototype.availableOptions,{fontIdentifiers:{type:_["OptionType"].ARRAY,default:F.defaultFontIdentifiers},relativeLineSpacing:{type:_["OptionType"].NUMBER,default:.025/3},shearingAngle:{type:_["OptionType"].NUMBER,default:-.1}})},function(e,t,r){"use strict";r.d(t,"a",function(){return R});var n=r(6);var i=r.n(n);var a=r(0);var o=r.n(a);var s=r(2);var u=r.n(s);var l=r(3);var f=r.n(l);var c=r(1);var h=r.n(c);var p=r(4);var v=r.n(p);var d=r(43);var y=r(59);var _=r(23);var g=r(34);var m=i.a||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}}return e};var b=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;o()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function w(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function x(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function T(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)u.a?u()(e,t):e.__proto__=t}var k=p["Math"].Rectangle;var R=function(e){T(t,e);function t(){var e;w(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=x(this,(e=t.__proto__||h()(t)).call.apply(e,[this].concat(n)));a.setSize(new _["a"](a.getWidth(),a.getHeight()));return a}b(t,[{key:"_calculateLayoutElements",value:function e(){return[new d["a"]({frame:this._getTextFrame()})]}},{key:"render",value:function e(r){var n=this._getFrame();var i=this.getType();var a=this.getAttributes();var o=a.getTextColor();var s=n.height/3;var u=new k(n.x,n.y,n.width,s);var l=new k(n.x,n.y+s*2,n.width,s);switch(i){case t.FormType.Rect:Object(g["c"])(r,n,o);break;case t.FormType.DoubleRect:Object(g["c"])(r,u,o);Object(g["c"])(r,l,o);break;case t.FormType.DoubleRectFirstPunctuated:Object(g["d"])(r,u,o);Object(g["c"])(r,l,o);break;case t.FormType.DoubleRectSecondPunctuated:Object(g["c"])(r,u,o);Object(g["d"])(r,l,o);break;default:break}}}]);return t}(y["a"]);R.FormType={Rect:"RECT",DoubleRect:"DOUBLE_RECT",DoubleRectFirstPunctuated:"DOUBLE_RECT_FIRST_PUNCTUATED",DoubleRectSecondPunctuated:"DOUBLE_RECT_SECOND_PUNCTUATED"};R.prototype.availableOptions=m({},y["a"].prototype.availableOptions,{height:{type:p["OptionType"].NUMBER,default:100},type:{type:p["OptionType"].STRING,default:R.FormType.Rect,available:p["Utils"].values(R.FormType)}})},function(e,t,r){"use strict";r.d(t,"a",function(){return y});var n=r(0);var i=r.n(n);var a=r(4);var o=r.n(a);var s=r(23);var u=r(104);var l=r(34);var f=r(16);var c=r(106);var h=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function p(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var v=a["Math"].Rectangle;var d=1e3;var y=function(){function e(){p(this,e);this._layoutData=null;this._layout=null;this._text="";this._seed=0;this._debugMode=false;this.randomizer=new f["a"]}h(e,[{key:"createLayout",value:function e(t,r,n){this._layout=t;this._text=r;this._seed=n;t.seed(n);this._layoutData=t.generateLayoutData(r,d)}},{key:"calculateAspect",value:function e(){if(!this._layoutData){a["Log"].warn("TextDesignRenderer#calculateAspect: No layout data");return 1}return this._layoutData.getSize().aspect()}},{key:"draw",value:function e(t,r,n,i){var o=this;var f=new s["a"](d,d/r.aspect());var h=r.width/d;var p=this._layoutData.getRelativeInsets().clone().scale(f.width);var y=this._layoutData.getRelativeLineSpacing()*f.width;var _=p.top;t.save();this.randomizer.seed(this._seed);var g=this._layoutData.getBackground();if(g){g.render(t,r,this._layoutData.getRelativeInsets(),i?a["Color"].WHITE:n,this.randomizer)}t.scale(h,h);this._layoutData.getRows().forEach(function(e){t.save();var r=e.getAttributes();t.transform(1,e.getShearingAngle(),0,1,p.left,_);r.setTextColor(i?a["Color"].WHITE:n.clone());r.setTintColor(i?a["Color"].WHITE:n.clone());if(e instanceof u["a"]||e instanceof c["a"]){e.setBackgroundColor(i?a["Color"].WHITE:n.clone());e.setIsUsedInInvertedLayout(i)}if(o._debugMode){e._debugMode=true}e.willRender(t);e.render(t);e.didRender(t);if(o._debugMode){var s=e._getFrame();var f=e._getTextFrame();Object(l["e"])(t,s,a["Color"].GREEN);Object(l["e"])(t,f,a["Color"].BLUE);e._getLayoutElements().forEach(function(r){var n=r.getFrame();var i=e._getTextFrameForElement(r);Object(l["e"])(t,n,new a["Color"](1,1,0));Object(l["e"])(t,i,new a["Color"](0,1,1))})}_+=e.getSize().height+y;t.restore()});if(this._debugMode){Object(l["e"])(t,new v(0,0,f.width,f.height),a["Color"].RED)}t.restore()}}]);return e}()},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(2);var o=r.n(a);var s=r(3);var u=r.n(s);var l=r(1);var f=r.n(l);var c=r(4);var h=r.n(c);var p=r(379);var v=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function d(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function y(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function _(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)o.a?o()(e,t):e.__proto__=t}var g=c["Math"].Vector2;var m=function(e){_(t,e);function t(){d(this,t);return y(this,(t.__proto__||f()(t)).apply(this,arguments))}v(t,[{key:"_render",value:function e(t){this._sprite.setRotation(0);var r=t.getDimensions();var n=this._options,i=n.start,a=n.end,o=n.rotation,s=n.textureScale;var u=i.clone().add(a.clone().subtract(i).divide(2));var l=this.calculateScale();var f=l*s;var h=this.getNewDimensions(r);this._sprite.setAnchor(u);this._sprite.setRotation(o);this._sprite.setScale(f,f);this._sprite.setPosition(h.clone().multiply(.5).ceil());this._renderTexture.render(this._container);return c["Promise"].resolve()}},{key:"calculateScale",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this._options.rotation;var r=this.getInputDimensions(false);var n=new g(Math.abs(r.x*Math.cos(t))+Math.abs(r.y*Math.sin(t)),Math.abs(r.x*Math.sin(t))+Math.abs(r.y*Math.cos(t)));var i=r.clone().multiply(.5);i.subtract(n.clone().divide(2));i.abs();var a=1;if(i.y>i.x){a=i.y*2/r.y+1}else{a=i.x*2/r.x+1}return a}},{key:"getNewDimensions",value:function e(t){var r=this._options,n=r.start,i=r.end,a=r.textureScale;var o=this.calculateScale();return t.clone().multiply(a*o).multiply(i.clone().subtract(n)).round()}},{key:"flip",value:function e(t){var r=this._options,n=r.start,i=r.end;var a=n.clone();if(t==="horizontal"){n.set(1-i.x,n.y);i.set(1-a.x,i.y)}else if(t==="vertical"){n.set(n.x,1-i.y);i.set(i.x,1-a.y)}}},{key:"rotate",value:function e(t){var r=this._options,n=r.start,i=r.end;var a=(t+360)%360;var o=Math.floor(a/90);for(var s=0;s<o;s++){var u=n.clone();n.set(1-i.y,u.x);i.set(1-u.y,i.x)}}}]);return t}(c["Operation"]);m.identifier="transform";m.prototype.availableOptions={start:{type:c["OptionType"].VECTOR2,default:new g(0,0)},end:{type:c["OptionType"].VECTOR2,default:new g(1,1)},textureScale:{type:c["OptionType"].NUMBER,default:1},rotation:{type:c["OptionType"].NUMBER,default:0}};m.TransformChange=p["a"];h.a.Operations.TransformOperation=m;t["a"]=m},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(4);var o=r.n(a);var s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();function u(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var l=a["Math"].Vector2;var f=function(){function e(t,r){u(this,e);this._operation=t;this._options=r;this._inputDimensions=this._operation.getInputDimensions(false);this._rotationDelta=r.rotation-this._operation.getRotation();this._deltaCos=Math.cos(this._rotationDelta);this._deltaSin=Math.sin(this._rotationDelta);this._oldAbsoluteSize=this._operation.getEnd().clone().subtract(this._operation.getStart()).multiply(this._inputDimensions);this._newAbsoluteSize=r.end.clone().subtract(r.start).multiply(this._inputDimensions);this._absoluteStartDiff=this._operation.getStart().clone().subtract(r.start).multiply(this._inputDimensions);this._scaleRatio=this._operation.calculateScale(r.rotation)/this._operation.calculateScale();this._absoluteStart=this._operation.getStart().clone().multiply(this._inputDimensions);this._sizeFactor=this._newAbsoluteSize.clone().divide(this._oldAbsoluteSize);this._textureScaleFactor=this._options.textureScale/this._operation.getTextureScale()}s(e,[{key:"applyToRelativePoint",value:function e(t){var r=this._operation.getStart();var n=this._operation.getEnd();var i=r.clone().add(n.clone().subtract(r).divide(2));var a=i.multiply(this._inputDimensions);var o=t.clone().multiply(this._oldAbsoluteSize).subtract(this._oldAbsoluteSize.clone().divide(2));var s=a.clone().add(o);var u=s.clone().subtract(this._inputDimensions.clone().divide(2));var f=new l(u.x*this._deltaCos-u.y*this._deltaSin,u.x*this._deltaSin+u.y*this._deltaCos);var c=this._inputDimensions.clone().divide(2).add(f);var h=this._options.start.clone().multiply(this._inputDimensions);return c.clone().subtract(h).divide(this._newAbsoluteSize)}},{key:"applyToRelativeSize",value:function e(t){return t*this._oldAbsoluteSize.min()/this._newAbsoluteSize.min()}},{key:"applyToDimensions",value:function e(t){t=t.clone().multiply(this._scaleRatio);if(this._options.textureScale){t.multiply(this._textureScaleFactor)}return t}},{key:"scaleSize",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"y";return t/this._sizeFactor[r]}},{key:"applyToRotation",value:function e(t){return(t+this._rotationDelta)%(Math.PI*2)}}]);return e}();t["a"]=f},function(e,t,r){"use strict";var n=r(0);var i=r.n(n);var a=r(5);var o=r.n(a);var s=r(2);var u=r.n(s);var l=r(3);var f=r.n(l);var c=r(1);var h=r.n(c);var p=r(4);var v=r.n(p);var d=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;i()(e,n.key,n)}}return function(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var y=function e(t,r,n){if(t===null)t=Function.prototype;var i=o()(t,r);if(i===undefined){var a=h()(t);if(a===null){return undefined}else{return e(a,r,n)}}else if("value"in i){return i.value}else{var s=i.get;if(s===undefined){return undefined}return s.call(n)}};function _(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function g(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function m(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)u.a?u()(e,t):e.__proto__=t}var b=p["Math"].Vector2;var w=function(e){m(t,e);function t(){var e;_(this,t);for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=g(this,(e=t.__proto__||h()(t)).call.apply(e,[this].concat(n)));a._watermarkSprite=new p["Engine"].Sprite;a._watermarkSprite.setAnchor(.5,.5);a._container.addChild(a._watermarkSprite);return a}d(t,[{key:"_render",value:function e(t){if(!this._watermarkTexture){this._watermarkTexture=p["Engine"].Texture.fromImage(this._options.image);this._watermarkSprite.setTexture(this._watermarkTexture)}var r=t.getDimensions();var n=this._options.image,i=n.width,a=n.height;var o=p["Utils"].resizeVectorToFit(new b(i,a),r);this._watermarkSprite.setPosition(r.clone().divide(2));this._watermarkSprite.setWidth(o.x);this._watermarkSprite.setHeight(o.y);this._renderTexture.render(this._container);return p["Promise"].resolve()}},{key:"dispose",value:function e(){y(t.prototype.__proto__||h()(t.prototype),"dispose",this).call(this);this._watermarkSprite.dispose()}}]);return t}(p["Operation"]);w.identifier="watermark";w.prototype.availableOptions={image:{type:p["OptionType"].OBJECT,required:true}};v.a.Operations.WatermarkOperation=w;t["a"]=w}])});