/** * 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.0.3 (2019-03-19) */ !function(){"use strict";var r=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return r(n())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),p=tinymce.util.Tools.resolve("tinymce.util.Tools");function x(e){return e&&1===e.nodeType&&"false"===e.contentEditable}var t,n,a,o,i,u={findAndReplaceDOMText:function R(e,t,n,r,a){var o,i,m,f,p,g,d=[],c=0;function l(e,t){if(t=t||0,!e[0])throw new Error("findAndReplaceDOMText cannot handle zero-length matches");var n=e.index;if(0=s[1]?(a=l,i=s[1]-c):r&&d.push(l),!r&&l.length+c>s[0]&&(r=l,o=s[0]-c),c+=l.length),r&&a){if(l=n({startNode:r,startNodeIndex:o,endNode:a,endNodeIndex:i,innerNodes:d,match:s[2],matchIndex:u}),c-=a.length-i,a=r=null,d=[],u++,!(s=t.shift()))break}else if(p[l.nodeName]&&!f[l.nodeName]||!l.firstChild){if(l.nextSibling){l=l.nextSibling;continue}}else if(!x(l)){l=l.firstChild;continue}for(;;){if(l.nextSibling){l=l.nextSibling;break}if(l.parentNode===e)break e;l=l.parentNode}}}(t,d,function u(e){var h;if("function"!=typeof e){var r=e.nodeType?e:m.createElement(e);h=function(e,t){var n=r.cloneNode(!1);return n.setAttribute("data-mce-index",t),e&&n.appendChild(m.createTextNode(e)),n}}else h=e;return function(e){var t,n,r,a=e.startNode,o=e.endNode,i=e.matchIndex;if(a===o){var d=a;r=d.parentNode,0t.get()&&i[o].setAttribute("data-mce-index",l-1)}return t.set(u),r?(s=w(e,t),v(e,t)):(s=C(e,t),b(e,t)),!a&&s},hasNext:w,hasPrev:C},c=function(r,a){return{done:function(e){return s.done(r,a,e)},find:function(e,t,n){return s.find(r,a,e,t,n)},next:function(){return s.next(r,a)},prev:function(){return s.prev(r,a)},replace:function(e,t,n){return s.replace(r,a,e,t,n)}}},l=function(e){return function(){return e}},T=l(!1),A=l(!0),S=function(){return B},B=(o={fold:function(e,t){return e()},is:T,isSome:T,isNone:A,getOr:a=function(e){return e},getOrThunk:n=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:a,orThunk:n,map:S,ap:S,each:function(){},bind:S,flatten:S,exists:T,forall:A,filter:S,equals:t=function(e){return e.isNone()},equals_:t,toArray:function(){return[]},toString:l("none()")},Object.freeze&&Object.freeze(o),o),I=(i="function",function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&Array.prototype.isPrototypeOf(e)?"array":"object"===t&&String.prototype.isPrototypeOf(e)?"string":t}(e)===i}),k=(Array.prototype.slice,I(Array.from)&&Array.from,function(r,a){var e,o={};function i(e){(s.hasNext(r,a)?e.enable:e.disable)("next"),(s.hasPrev(r,a)?e.enable:e.disable)("prev")}r.undoManager.add(),e=p.trim(r.selection.getContent({format:"text"}));var d=function(e,t){!function(e,t){for(var n=0,r=e.length;n