10 lines
28 KiB
JavaScript
10 lines
28 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.2.0 (2020-02-13)
|
||
|
*/
|
||
|
!function(r){"use strict";function e(){}function l(e){return function(){return e}}function t(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return!t.apply(null,e)}}function n(){return s}var o,i=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=l(!1),a=l(!0),s=(o={fold:function(e,n){return e()},is:u,isSome:u,isNone:a,getOr:d,getOrThunk:f,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:l(null),getOrUndefined:l(undefined),or:d,orThunk:f,map:n,each:e,bind:n,exists:u,forall:a,filter:n,equals:c,equals_:c,toArray:function(){return[]},toString:l("none()")},Object.freeze&&Object.freeze(o),o);function c(e){return e.isNone()}function f(e){return e()}function d(e){return e}function m(n){return function(e){return function(e){if(null===e)return"null";var n=typeof e;return"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}(e)===n}}function g(e,n){for(var t=e.length,r=new Array(t),o=0;o<t;o++){var i=e[o];r[o]=n(i,o)}return r}function p(e,n){for(var t=0,r=e.length;t<r;t++){n(e[t],t)}}function v(e,n){for(var t=[],r=0,o=e.length;r<o;r++){var i=e[r];n(i,r)&&t.push(i)}return t}function h(e,n,t){return p(e,function(e){t=n(t,e)}),t}function N(e,n){for(var t=0,r=e.length;t<r;t++){var o=e[t];if(n(o,t))return He.some(o)}return He.none()}function y(e,n){return function(e){for(var n=[],t=0,r=e.length;t<r;++t){if(!qe(e[t]))throw new Error("Arr.flatten item "+t+" was not an array, input: "+e);ze.apply(n,e[t])}return n}(g(e,n))}function S(e){return 0===e.length?He.none():He.some(e[0])}function O(e){return 0===e.length?He.none():He.some(e[e.length-1])}function C(e,n,t){return 0!=(e.compareDocumentPosition(n)&t)}function b(e,n){var t=function(e,n){for(var t=0;t<e.length;t++){var r=e[t];if(r.test(n))return r}return undefined}(e,n);if(!t)return{major:0,minor:0};function r(e){return Number(n.replace(t,"$"+e))}return Ze(r(1),r(2))}function L(e,n){return function(){return n===e}}function T(e,n){return function(){return n===e}}function D(e,n){var t=String(n).toLowerCase();return N(e,function(e){return e.search(t)})}function E(e,n){return-1!==e.indexOf(n)}function w(n){return function(e){return E(e,n)}}function k(e,n){return e.dom()===n.dom()}function A(e,n,t){return e.isSome()&&n.isSome()?He.some(t(e.getOrDie(),n.getOrDie())):He.none()}function x(e){return He.from(e.dom().parentNode).map(Ln.fromDom)}function R(e){return g(e.dom().childNodes,Ln.fromDom)}function I(e,n){var t=e.dom().childNodes;return He.from(t[n]).map(Ln.fromDom)}function B(e){return I(e,0)}function P(e){return I(e,e.dom().childNodes.length-1)}function _(n,t){x(n).each(function(e){e.dom().insertBefore(t.dom(),n.dom())})}function M(e,n){e.dom().appendChild(n.dom())}function U(n,e){p(e,function(e){M(n,e)})}function F(e){var n=e.dom();null!==n.parentNode&&n.parentNode.removeChild(n)}function j(e,n,t){return e.fire("ListMutation",{action:n,element:t})}function H(e,n){return function(e,n){for(var t=n!==undefined&&null!==n?n:In,r=0;r<e.length&&t!==undefined&&null!==t;++r)t=t[e[r]];return t}(e.split("."),n)}function $(e){return e&&"BR"===e.nodeName}function q(e){var n=e.selection.getStart(!0);return e.dom.getParent(n,"OL,UL,DL",Gn(e,n))}function W(e){var n=e.selection.getSelectedBlocks();return Mn.grep(function(t,e){var n=Mn.map(e,function(e){var n=t.dom.getParent(e,"li,dd,dt",Gn(t,e));return n||e});return _n.unique(n)}(e,n),function(e){return $n(e)})}function V(e,n){var t=e.dom.getParents(n,"ol,ul",Gn(e,n));return O(t)}function K(e,n){var t,r,o,i=e.dom,u=e.schema.getBlockElements(),a=i.createFragment(),s=nt(e);if(s&&((r=i.create(s)).tagName===s.toUpperCase()&&i.setAttribs(r,tt(e)),Xn(n.firstChild,u)||a.appendChild(r)),n)for(;t=n.firstChild;){var c=t.nodeName;o||"SPAN"===c&&"bookmark"===t.getAttribute("data-mce-type")||(o=!0),Xn(t,u)?(a.appendChild(t),r=null):s?(r||(r=i.create(s),a.appendChild(r)),r.appendChild(t)):a.appendChild(t)}return s?o||r.appendChild(i.create("br",{"
|