!function(f){"use strict";varr=function(t){functionn(){returne}vare=t;return{get:n,set:function(t){e=t},clone:function(){returnr(n())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(){return(u=Object.assign||function(t){for(varn,e=1,r=arguments.length;e<r;e++)for(varoinn=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);returnt}).apply(this,arguments)};functionn(){}functiona(t){returnfunction(){returnt}}functiono(t){returnt}functione(){returnl}vari,c=a(!1),s=a(!0),l=(i={fold:function(t,n){returnt()},is:c,isSome:c,isNone:s,getOr:g,getOrThunk:m,getOrDie:function(t){thrownewError(t||"error: getOrDie called on none.")},getOrNull:a(null),getOrUndefined:a(undefined),or:g,orThunk:m,map:e,each:n,bind:e,exists:c,forall:s,filter:e,equals:d,equals_:d,toArray:function(){return[]},toString:a("none()")},Object.freeze&&Object.freeze(i),i);functiond(t){returnt.isNone()}functionm(t){returnt()}functiong(t){returnt}functionp(n){returnfunction(t){returnfunction(t){if(null===t)return"null";varn=typeoft;return"object"==n&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":n}(t)===n}}functionh(t,n){return-1<function(t,n){returnlt.call(t,n)}(t,n)}functionv(t,n){for(vare=t.length,r=newArray(e),o=0;o<e;o++){vara=t[o];r[o]=n(a,o)}returnr}functiony(t,n){for(vare=0,r=t.length;e<r;e++){n(t[e],e)}}functionb(t,n){for(vare=[],r=0,o=t.length;r<o;r++){vara=t[r];n(a,r)&&e.push(a)}returne}functionk(t,n,e){returnfunction(t,n){for(vare=t.length-1;0<=e;e--){n(t[e],e)}}(t,function(t){e=n(e,t)}),e}functionO(t,n){for(vare=0,r=t.length;e<r;++e){if(!0!==n(t[e],e))return!1}return!0}functionw(t){varn=[],e=[];returny(t,function(t){t.fold(function(t){n.push(t)},function(t){e.push(t)})}),{errors:n,values:e}}functionx(t){return"inline-command"===t.type||"inline-format"===t.type}functionC(t){return"block-command"===t.type||"block-format"===t.type}functionE(t){returnfunction(t,n){vare=st.call(t,0);returne.sort(n),e}(t,function(t,n){returnt.start.length===n.start.length?0:t.start.length>n.start.length?-1:1})}functionT(o){functiona(t){returnyt.error({message:t,pattern:o})}functiont(t,n,e){if(o.format===undefined)returno.cmd!==undefined?it(o.cmd)?yt.value(e(o.cmd,o.value)):a(t+" pattern has non-string `cmd` parameter"):a(t+" pattern is missing both `format` and `cmd` parameters");varr=void0;if(ft(o.format)){if(!O(o.format,it))returna(t+" pattern has non-string items in the `format` array");r=o.format}else{if(!it(o.format))returna(t+" pattern has non-string `format` parameter");r=[o.format]}returnyt.value(n(r))}if(!ut(o))returna("Raw pattern is not an object");if(!it(o.start))returna("Raw pattern is missing `start` parameter");if(o.end===undefined)returno.replacement!==undefined?it(o.replacement)?0===o.start.length?a("Replacement pattern has empty `start` parameter"):yt.value({type:"inline-command",start:"",end:o.start,cmd:"mceInsertContent",value:o.replacement}):a("Replacement pattern has non-string `replacement` parameter"):0===o.start.length?a("Block pattern has empty `start` parameter"):t("Block",function(t){return{type:"block-format",start:o.start,format:t[0]}},function(t,n){return{type:"block-command",start:o.start,cmd:t,value:n}});if(!it(o.end))returna("Inline pattern has non-string `end` parameter");if(0===o.start.length&&0===o.end.length)returna("Inline pattern has empty `start` and `end` parameters");vare=o.start,r=o.end;return0===r.length&&(r=e,e=""),t("Inline",function(t){return{type:"inline-format",start:e,end:r,format:t}},function(t,n){return{type:"inline-command",start:e,end:r,cmd:t,value:n}})}functionR(t){return"block-command"===t.type?{start:t.start,cmd:t.cmd,value:t.value}:"block-format"===t.type?{start:t.start,format:t.format}:"inline-command"===t.type?"mceInsertContent"===t.cmd&&""===t.start?{start:t.end,replacement:t.value}:{start:t.start,end:t.end,cmd:t.cmd,value:t.value}:"inline-format"===t.type?{sta