/** * 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.12 (2019-07-18) */ !function(u){"use strict";var e,n,t,r,o,i,a,s,c=tinymce.util.Tools.resolve("tinymce.PluginManager"),v=function(e){return function(){return e}},f=function(t){return function(){for(var e=[],n=0;n=e.childNodes.length?t.data.length:0}:t.previousSibling&&we(t.previousSibling)?{container:t.previousSibling,offset:t.previousSibling.data.length}:t.nextSibling&&we(t.nextSibling)?{container:t.nextSibling,offset:0}:{container:e,offset:n}},He=function(e){var n=e.cloneRange(),t=je(e.startContainer,e.startOffset);n.setStart(t.container,t.offset);var r=je(e.endContainer,e.endOffset);return n.setEnd(r.container,r.offset),n},$e=De.DOM,qe=function(o){var i={},e=function(e){var n,t,r;t=o[e?"startContainer":"endContainer"],r=o[e?"startOffset":"endOffset"],1===t.nodeType&&(n=$e.create("span",{"data-mce-type":"bookmark"}),t.hasChildNodes()?(r=Math.min(r,t.childNodes.length-1),e?t.insertBefore(n,t.childNodes[r]):$e.insertAfter(n,t.childNodes[r])):t.appendChild(n),t=n,r=0),i[e?"startContainer":"endContainer"]=t,i[e?"startOffset":"endOffset"]=r};return e(!0),o.collapsed||e(),i},We=function(o){function e(e){var n,t,r;n=r=o[e?"startContainer":"endContainer"],t=o[e?"startOffset":"endOffset"],n&&(1===n.nodeType&&(t=function(e){for(var n=e.parentNode.firstChild,t=0;n;){if(n===e)return t;1===n.nodeType&&"bookmark"===n.getAttribute("data-mce-type")||t++,n=n.nextSibling}return-1}(n),n=n.parentNode,$e.remove(r),!n.hasChildNodes()&&$e.isBlock(n)&&n.appendChild($e.create("br"))),o[e?"startContainer":"endContainer"]=n,o[e?"startOffset":"endOffset"]=t)}e(!0),e();var n=$e.createRng();return n.setStart(o.startContainer,o.startOffset),o.endContainer&&n.setEnd(o.endContainer,o.endOffset),He(n)},Ve=function(e){var n,t=F("ownerDocument.defaultView",e);return(n=t,j("HTMLElement",n)).prototype.isPrototypeOf(e)},ze=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),Ke=function(e){var n=e.selection.getStart(!0);return e.dom.getParent(n,"OL,UL,DL",Qe(e,n))},Xe=function(e){var t,n,r,o=e.selection.getSelectedBlocks();return Te.grep((t=e,n=o,r=Te.map(n,function(e){var n=t.dom.getParent(e,"li,dd,dt",Qe(t,e));return n||e}),ze.unique(r)),function(e){return Re(e)})},Qe=function(e,n){var t=e.dom.getParents(n,"TD,TH");return 0e.length?Nn(t,e,n):yn(t,e,n)},[]),_(o).map(function(e){return e.list})).toArray();var t,r,o},Pn=function(e){var n,t,r=E(Je.getSelectedListItems(e),M.fromDom);return Ze([x(r,f(On)),x((n=r,t=D.call(n,0),t.reverse(),t),f(On))],function(e,n){return{start:e,end:n}})},Mn=function(a,e,s){var n,t,r,o=(n=e,t=Pn(a),r=wn(!1),E(n,function(e){return{sourceList:e,entries:An(0,t,r,e)}}));w(o,function(e){var n,t;n=e.entries,t=s,w(k(n,bn),function(e){return function(e,n){switch(e){case"Indent":n.depth++;break;case"Outdent":n.depth--;break;case"Flatten":n.depth=0}}(t,e)});var r,o,i,u=(r=a,o=e.entries,I(function(e,n){if(0===e.length)return[];for(var t=n(e[0]),r=[],o=[],i=0,u=e.length;i