!function(){"use strict";vare,t,n,r,a,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(e){returnfunction(){returne}},i=u(!1),c=u(!0),p=tinymce.util.Tools.resolve("tinymce.util.Tools"),m=tinymce.util.Tools.resolve("tinymce.util.XHR"),l=function(e){returne.getParam("template_cdate_classes","cdate")},s=function(e){returne.getParam("template_mdate_classes","mdate")},f=function(e){returne.getParam("template_selected_content_classes","selcontent")},d=function(e){returne.getParam("template_preview_replace_values")},g=function(e){returne.getParam("template_replace_values")},y=function(e){returne.templates},h=function(e){returne.getParam("template_cdate_format",e.translate("%Y-%m-%d"))},v=function(e){returne.getParam("template_mdate_format",e.translate("%Y-%m-%d"))},b=function(e,t){if((e=""+e).length<t)for(varn=0;n<t-e.length;n++)e="0"+e;returne},O=function(e,t,n){varr="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),a="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),o="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),u="January February March April May June July August September October November December".split(" ");returnn=n||newDate,t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+n.getFullYear())).replace("%y",""+n.getYear())).replace("%m",b(n.getMonth()+1,2))).replace("%d",b(n.getDate(),2))).replace("%H",""+b(n.getHours(),2))).replace("%M",""+b(n.getMinutes(),2))).replace("%S",""+b(n.getSeconds(),2))).replace("%I",""+((n.getHours()+11)%12+1))).replace("%p",n.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(u[n.getMonth()]))).replace("%b",""+e.translate(o[n.getMonth()]))).replace("%A",""+e.translate(a[n.getDay()]))).replace("%a",""+e.translate(r[n.getDay()]))).replace("%%","%")},T=function(n,e){returnp.each(e,function(e,t){"function"==typeofe&&(e=e(t)),n=n.replace(newRegExp("\\{\\$"+t+"\\}","g"),e)}),n},M=function(e,t){varr=e.dom,a=g(e);p.each(r.select("*",t),function(n){p.each(a,function(e,t){r.hasClass(n,t)&&"function"==typeofa[t]&&a[t](n)})})},_=function(e,t){returnnewRegExp("\\b"+t+"\\b","g").test(e.className)},S=function(t,n){returnfunction(){vare=y(t);"function"!=typeofe?"string"==typeofe?m.send({url:e,success:function(e){n(JSON.parse(e))}}):n(e):e(n)}},x=T,P=M,A=function(t,e,n){varr,a,o=t.dom,u=t.selection.getContent();n=T(n,g(t)),r=o.create("div",null,n),(a=o.select(".mceTmpl",r))&&0<a.length&&(r=o.create("div",null)).appendChild(a[0].cloneNode(!0)),p.each(o.select("*",r),function(e){_(e,l(t).replace(/\s+/g,"|"))&&(e.innerHTML=O(t,h(t))),_(e,s(t).replace(/\s+/g,"|"))&&(e.innerHTML=O(t,v(t))),_(e,f(t).replace(/\s+/g,"|"))&&(e.innerHTML=u)}),M(t,r),t.execCommand("mceInsertContent",!1,r.innerHTML),t.addVisual()},w=function(e){e.addCommand("mceInsertTemplate",functiont(r){for(vara=[],e=1;e<arguments.length;e++)a[e-1]=arguments[e];returnfunction(){for(vare=[],t=0;t<arguments.length;t++)e[t]=arguments[t];varn=a.concat(e);returnr.apply(null,n)}}(A,e))},D=function(r){r.on("PreProcess",function(e){vart=r.dom,n=v(r);p.each(t.select("div",e.node),function(e){t.hasClass(e,"mceTmpl")&&(p.each(t.select("*",e),function(e){t.hasClass(e,r.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(e.innerHTML=O(r,n))}),P(r,e))})})},C=i,N=c,H=function(){returnk},k=(r={fold:function(e,t){returne()},is:C,isSome:C,isNone:N,getOr:n=function(e){returne},getOrThunk:t=function(e){returne()},getOrDie:function(e){thrownewError(e||"error: getOrDie called on none.")},getOrNull:function(){returnnull},getOrUndefined:function(){returnundefined},or:n,orThunk:t,map:H,ap:H,each:function(){},bind:H,flatten:H,exists:C,forall:N,filter:H,equals:e=function(e){returne.isNone()},equals_:e,toArray:function(){return[]},toString:u("none()")},Object.freeze&&Object.freeze(r),r),I=function(n){vare=function(){returnn},t=function(){returna},r=function(e){returne(n)},a={fold:function(e,t){returnt(n)},is:function(e){returnn===e},isSome:N,isNone:C,getOr:e,getOrThunk:e,getOrDie:e,getOrNull: