!function(){"use strict";functionc(t){vare=t;return{get:function(){returne},set:function(t){e=t}}}functionh(t){returnnull!=t}functionr(){}functioni(t){returnfunction(){returnt}}functiont(t){returnt}functione(){returnd}functions(t){returnn=typeof(e=t),"array"==(null===e?"null":"object"==n&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":n);vare,n}varn,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=function(t){returntypeoft===n},u=i(!(n="function")),f=i(!0),d={fold:function(t,e){returnt()},isSome:u,isNone:f,getOr:t,getOrThunk:m,getOrDie:function(t){thrownewError(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void0),or:t,orThunk:m,map:e,each:r,bind:e,exists:u,forall:f,filter:function(){returnd},toArray:function(){return[]},toString:i("none()")};functionm(t){returnt()}functiong(t,e){return_(document.createElement("canvas"),t,e)}functionp(t){vare=g(t.width,t.height);returnA(e).drawImage(t,0,0),e}varv,y,w,b,E,I=function(n){functiont(){returno}functione(t){returnt(n)}varr=i(n),o={fold:function(t,e){returne(n)},isSome:f,isNone:u,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:t,orThunk:t,map:function(t){returnI(t(n))},each:function(t){t(n)},bind:e,exists:e,forall:e,filter:function(t){returnt(n)?o:d},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};returno},T={some:I,none:e,from:function(t){returnnull==t?d:I(t)}},A=function(t){returnt.getContext("2d")},_=function(t,e,n){returnt.width=e,t.height=n,t},R=window.Promise||(v=window,y=x.immediateFn||"function"==typeofv.setImmediate&&v.setImmediate||function(t){returnsetTimeout(t,1)},w=function(n,r){returnfunction(){for(vart=[],e=0;e<arguments.length;e++)t[e]=arguments[e];returnn.apply(r,t)}},b=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},E=function(t,e,n){varr=!1;try{t(function(t){r||(r=!0,e(t))},function(t){r||(r=!0,n(t))})}catch(t){if(r)return;r=!0,n(t)}},x.prototype.catch=function(t){returnthis.then(null,t)},x.prototype.then=function(n,r){varo=this;returnnewx(function(t,e){U.call(o,newO(n,r,t,e))})},x.all=function(){for(vart=[],e=0;e<arguments.length;e++)t[e]=arguments[e];varu=Array.prototype.slice.call(1===t.length&&b(t[0])?t[0]:t);returnnewx(function(r,o){if(0===u.length)returnr([]);for(vari=u.length,a=function(e,t){try{if(t&&("object"==typeoft||"function"==typeoft)){varn=t.then;if("function"==typeofn)returnvoidn.call(t,function(t){a(e,t)},o)}u[e]=t,0==--i&&r(u)}catch(t){o(t)}},t=0;t<u.length;t++)a(t,u[t])})},x.resolve=function(e){returne&&"object"==typeofe&&e.constructor===x?e:newx(function(t){t(e)})},x.reject=function(n){returnnewx(function(t,e){e(n)})},x.race=function(o){returnnewx(function(t,e){for(varn=0,r=o;n<r.length;n++)r[n].then(t,e)})},x);functionx(t){if("object"!=typeofthis)thrownewTypeError("Promises must be constructed via new");if("function"!=typeoft)thrownewTypeError("not a function");this._state=null,this._value=null,this._deferreds=[],E(t,w(j,this),w(S,this))}functionU(n){varr=this;null!==this._state?y(function(){vart,e=r._state?n.onFulfilled:n.onRejected;if(null!==e){try{t=e(r._value)}catch(t){returnvoidn.reject(t)}n.resolve(t)}else(r._state?n.resolve:n.reject)(r._value)}):this._deferreds.push(n)}functionj(t){try{if(t===this)thrownewTypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeoft||"function"==typeoft)){vare=t.then;if("function"==typeofe)returnvoidE(w(e,t),w(j,this),w(S,this))}this._state=!0,this._value=t,M.call(this)}catch(t){S.call(this,t)}}functionS(t){this._state=!1,this._value=t,M.call(this)}functionM(){for(vart=0,e=this._deferreds;t<e.length;t++){varn=e[t];U.call(this,n)}this._deferreds=[]}functionO(t,e,n,r){this.onFulfilled="function"==typeoft?t:null,this.onRejected="function"==typeofe?e:null,this.resolve=n,this.rejec