9 lines
17 KiB
JavaScript
9 lines
17 KiB
JavaScript
|
/**
|
||
|
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
|
||
|
* Licensed under the LGPL or a commercial license.
|
||
|
* For LGPL see License.txt in the project root for license information.
|
||
|
* For commercial licenses see https://www.tiny.cloud/
|
||
|
*
|
||
|
* Version: 5.8.1 (2021-05-20)
|
||
|
*/
|
||
|
!function(){"use strict";var e,t,n,r,i,o,u,a,s,c,l=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},f=tinymce.util.Tools.resolve("tinymce.PluginManager"),d=tinymce.util.Tools.resolve("tinymce.util.Tools"),h=function(t){return!(null===(e=t)||e===undefined);var e},m=function(t){return typeof t===e},g=function(){},v=function(t){return function(){return t}},p=v(!(e="function")),y=v(!0),w=function(){return b},b=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:p,isSome:p,isNone:y,getOr:r=function(t){return t},getOrThunk:n=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:v(null),getOrUndefined:v(undefined),or:r,orThunk:n,map:w,each:g,bind:w,exists:p,forall:y,filter:w,equals:t,equals_:t,toArray:function(){return[]},toString:v("none()")}),I=function(n){var t=v(n),e=function(){return o},r=function(t){return t(n)},o={fold:function(t,e){return e(n)},is:function(t){return n===t},isSome:y,isNone:p,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:e,orThunk:e,map:function(t){return I(t(n))},each:function(t){t(n)},bind:r,exists:r,forall:r,filter:function(t){return t(n)?o:b},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(t){return t.is(n)},equals_:function(t,e){return t.fold(p,function(t){return e(n,t)})}};return o},T={some:I,none:w,from:function(t){return null===t||t===undefined?b:I(t)}},_=function(t,e){return A(document.createElement("canvas"),t,e)},R=function(t){var e=_(t.width,t.height);return U(e).drawImage(t,0,0),e},U=function(t){return t.getContext("2d")},A=function(t,e,n){return t.width=e,t.height=n,t},x=window.Promise?window.Promise:(i=function(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],c(t,a(M,this),a(L,this))},o=window,u=i.immediateFn||"function"==typeof o.setImmediate&&o.setImmediate||function(t){return setTimeout(t,1)},a=function(n,r){return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n.apply(r,t)}},s=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},c=function(t,e,n){var r=!1;try{t(function(t){r||(r=!0,e(t))},function(t){r||(r=!0,n(t))})}catch(o){if(r)return;r=!0,n(o)}},i.prototype["catch"]=function(t){return this.then(null,t)},i.prototype.then=function(n,r){var o=this;return new i(function(t,e){E.call(o,new k(n,r,t,e))})},i.all=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var c=Array.prototype.slice.call(1===t.length&&s(t[0])?t[0]:t);return new i(function(o,i){if(0===c.length)return o([]);for(var u=c.length,a=function(e,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void n.call(t,function(t){a(e,t)},i)}c[e]=t,0==--u&&o(c)}catch(r){i(r)}},t=0;t<c.length;t++)a(t,c[t])})},i.resolve=function(e){return e&&"object"==typeof e&&e.constructor===i?e:new i(function(t){t(e)})},i.reject=function(n){return new i(function(t,e){e(n)})},i.race=function(o){return new i(function(t,e){for(var n=0,r=o;n<r.length;n++)r[n].then(t,e)})},i);function E(r){var o=this;null!==this._state?u(function(){var t,e=o._state?r.onFulfilled:r.onRejected;if(null!==e){try{t=e(o._value)}catch(n){return void r.reject(n)}r.resolve(t)}else(o._state?r.resolve:r.reject)(o._value)}):this._deferreds.push(r)}function M(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void c(a(e,t),a(M,this),a(L,this))}this._state=!0,this._value=t,j.call(this)}catch(n){L.call(this,n)}}function L(t){this._state=!1,this._value=t,j.call(this)}function j(){for(var t=0,e=this._deferreds;t<e.length;t++){var n=e[t];E.call(this,n)}this._deferreds=[]}function k(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}var C=function(a){return n
|