You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
9 lines
18 KiB
JavaScript
9 lines
18 KiB
JavaScript
2 months ago
|
/**
|
||
|
* 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.9.2 (2021-09-08)
|
||
|
*/
|
||
|
!function(){"use strict";function c(t){var e=t;return{get:function(){return e},set:function(t){e=t}}}function h(t){return null!=t}function r(){}function i(t){return function(){return t}}function t(t){return t}function e(){return d}function s(t){return n=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);var e,n}var n,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=function(t){return typeof t===n},u=i(!(n="function")),f=i(!0),d={fold:function(t,e){return t()},isSome:u,isNone:f,getOr:t,getOrThunk:m,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:t,orThunk:m,map:e,each:r,bind:e,exists:u,forall:f,filter:function(){return d},toArray:function(){return[]},toString:i("none()")};function m(t){return t()}function g(t,e){return _(document.createElement("canvas"),t,e)}function p(t){var e=g(t.width,t.height);return A(e).drawImage(t,0,0),e}var v,y,w,b,E,I=function(n){function t(){return o}function e(t){return t(n)}var r=i(n),o={fold:function(t,e){return e(n)},isSome:f,isNone:u,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:t,orThunk:t,map:function(t){return I(t(n))},each:function(t){t(n)},bind:e,exists:e,forall:e,filter:function(t){return t(n)?o:d},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},T={some:I,none:e,from:function(t){return null==t?d:I(t)}},A=function(t){return t.getContext("2d")},_=function(t,e,n){return t.width=e,t.height=n,t},R=window.Promise||(v=window,y=x.immediateFn||"function"==typeof v.setImmediate&&v.setImmediate||function(t){return setTimeout(t,1)},w=function(n,r){return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n.apply(r,t)}},b=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},E=function(t,e,n){var r=!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){return this.then(null,t)},x.prototype.then=function(n,r){var o=this;return new x(function(t,e){U.call(o,new O(n,r,t,e))})},x.all=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var u=Array.prototype.slice.call(1===t.length&&b(t[0])?t[0]:t);return new x(function(r,o){if(0===u.length)return r([]);for(var i=u.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)},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){return e&&"object"==typeof e&&e.constructor===x?e:new x(function(t){t(e)})},x.reject=function(n){return new x(function(t,e){e(n)})},x.race=function(o){return new x(function(t,e){for(var n=0,r=o;n<r.length;n++)r[n].then(t,e)})},x);function x(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=[],E(t,w(j,this),w(S,this))}function U(n){var r=this;null!==this._state?y(function(){var t,e=r._state?n.onFulfilled:n.onRejected;if(null!==e){try{t=e(r._value)}catch(t){return void n.reject(t)}n.resolve(t)}else(r._state?n.resolve:n.reject)(r._value)}):this._deferreds.push(n)}function j(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 E(w(e,t),w(j,this),w(S,this))}this._state=!0,this._value=t,M.call(this)}catch(t){S.call(this,t)}}function S(t){this._state=!1,this._value=t,M.call(this)}function M(){for(var t=0,e=this._deferreds;t<e.length;t++){var n=e[t];U.call(this,n)}this._deferreds=[]}function O(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.rejec
|