').css(n).appendTo(i)[0];return s.set(U.some({caret:o,element:e,before:t})),s.get().each(function(e){t&&hu(e.caret).addClass("mce-visual-caret-before")}),f(),(r=e.ownerDocument.createRange()).setStart(u,0),r.setEnd(u,0),r},hide:l,getCss:function(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"},reposition:function(){s.get().each(function(e){var t=Fc(i,e.element,e.before);hu(e.caret).css(_e({},t))})},destroy:function(){return Kr.clearInterval(n)}}},zc=function(){return Pc.isIE()||Pc.isEdge()||Pc.isFirefox()},jc=function(e){return Lc(e)||Ic(e)},Hc=function(e){return jc(e)||Ln(e)&&zc()},Vc=$n,qc=Kn,$c=On("display","block table table-cell table-caption list-item"),Wc=wo,Kc=bo,Xc=Tn,Yc=Mo,Gc=function(e,t){for(var n;n=e(t);)if(!Kc(n))return n;return null},Jc=function(e,t,n,r,o){var i=new Gr(e,r),a=Vc(e)||Kc(e);if(t<0){if(a&&n(e=Gc(i.prev.bind(i),!0)))return e;for(;e=Gc(i.prev.bind(i),o);)if(n(e))return e}if(0=u.data.length-1)return 1===e&&(r=a(u))?rl(r):n;if(ko(u)&&s<=1)return-1===e&&(r=i(u))?ol(r):n;if(s===u.data.length)return(r=a(u))?rl(r):n;if(0===s)return(r=i(u))?ol(r):n}return n},al=function(e,t){return U.from(el(e?0:-1,t)).filter(Vc)},ul=function(e,t,n){var r=il(e,t,n);return-1===e?Ms.fromRangeStart(r):Ms.fromRangeEnd(r)},sl=function(e){return U.from(e.getNode()).map(Tt.fromDom)},cl=function(e,t){for(;t=e(t);)if(t.isVisible())return t;return t},ll=function(e,t){var n=Zc(e,t);return!(n||!Hn(e.getNode()))||n};(Us=Fs=Fs||{})[Us.Backwards=-1]="Backwards",Us[Us.Forwards=1]="Forwards";var fl,dl,ml,gl,pl=$n,hl=Fn,vl=Tn,yl=Hn,bl=Mo,Cl=function(e){return Po(e)||!!Fo(t=e)&&!0!==$(ie(t.getElementsByTagName("*")),function(e,t){return e||Ro(t)},!1);var t},wl=Uo,xl=function(e,t){return e.hasChildNodes()&&t'),t},Hl=function(e,t,n){return!(!1!==t.hasChildNodes()||!zl(e,t))&&(o=n,i=(r=t).ownerDocument.createTextNode(go),r.appendChild(i),o.setStart(i,0),o.setEnd(i,0),!0);var r,o,i},Vl=function(e,t,n,r){var o,i,a,u,s=n[t?"start":"end"],c=e.getRoot();if(s){for(a=s[0],i=c,o=s.length-1;1<=o;o--){if(u=i.childNodes,Hl(c,i,r))return!0;if(s[o]>u.length-1)return!!Hl(c,i,r)||function(e,t){return Ml(e).fold(A,function(e){return t.setStart(e.container(),e.offset()),t.setEnd(e.container(),e.offset()),!0})}(i,r);i=u[s[o]]}3===i.nodeType&&(a=Math.min(s[0],i.nodeValue.length)),1===i.nodeType&&(a=Math.min(s[0],i.childNodes.length)),t?r.setStart(i,a):r.setEnd(i,a)}return!0},ql=function(e){return Fn(e)&&0=n.length?t=n.length-1:t<0&&(t=0),n[t]||e},Bf=function(e,t,u){var n=t.startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,s=function(e){var t=e[0];return 3===t.nodeType&&t===n&&r>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===i&&0T(c)?(x=D(w*b),w=D(x/b)):(w=D(x/b),x=D(w*b))),F(d,w,x),t=0<(t=g.startPos.x+s)?t:0,n=0<(n=g.startPos.y+c)?n:0,k.setStyles(m,{left:t,top:n,display:"block"}),m.innerHTML=w+" × "+x,g[2]<0&&d.clientWidth<=w&&k.setStyle(d,"left",void 0+(v-w)),g[3]<0&&d.clientHeight<=x&&k.setStyle(d,"top",void 0+(y-x)),(s=O.scrollWidth-S)+(c=O.scrollHeight-N)!==0&&k.setStyles(m,{left:t-s,top:n-c}),C||(r=l,o=f,i=v,a=y,u="corner-"+g.name,r.fire("ObjectResizeStart",{target:o,width:i,height:a,origin:u}),C=!0)},z=function(){var e,t,n,r,o,i=C;C=!1,i&&(a(f,"width",w),a(f,"height",x)),k.unbind(A,"mousemove",U),k.unbind(A,"mouseup",z),R!==A&&(k.unbind(R,"mousemove",U),k.unbind(R,"mouseup",z)),k.remove(d),k.remove(m),k.remove(c),u(f),i&&(e=l,t=f,n=w,r=x,o="corner-"+g.name,e.fire("ObjectResized",{target:t,width:n,height:r,origin:o}),k.setAttrib(f,"style",k.getAttrib(f,"style"))),l.nodeChanged()},u=function(e){H();var t=k.getPos(e,O),i=t.x,a=t.y,n=e.getBoundingClientRect(),u=n.width||n.right-n.left,s=n.height||n.bottom-n.top;f!==e&&(j(),f=e,w=x=0);var r=l.fire("ObjectSelected",{target:e}),o=k.getAttrib(f,E,"1");M(e)&&!r.isDefaultPrevented()?_(B,function(r,o){var t=function(e){var t,n=I(f)[0];p=e.screenX,h=e.screenY,v=n.clientWidth,y=n.clientHeight,b=y/v,(g=r).name=o,g.startPos={x:u*r[0]+i,y:s*r[1]+a},S=O.scrollWidth,N=O.scrollHeight,c=k.add(O,"div",{"class":"mce-resize-backdrop"}),k.setStyles(c,{position:"fixed",left:"0",top:"0",width:"100%",height:"100%"}),d=L(t=f)?k.create("img",{src:St.transparentSrc}):t.cloneNode(!0),k.addClass(d,"mce-clonedresizable"),k.setAttrib(d,"data-mce-bogus","all"),d.contentEditable="false",k.setStyles(d,{left:i,top:a,margin:0}),F(d,u,s),d.removeAttribute(E),O.appendChild(d),k.bind(A,"mousemove",U),k.bind(A,"mouseup",z),R!==A&&(k.bind(R,"mousemove",U),k.bind(R,"mouseup",z)),m=k.add(O,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},v+" × "+y)},e=k.get("mceResizeHandle"+o);e&&k.remove(e),e=k.add(O,"div",{id:"mceResizeHandle"+o,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:!0,style:"cursor:"+o+"-resize; margin:0; padding:0"}),11===St.ie&&(e.contentEditable=!1),k.bind(e,"mousedown",function(e){e.stopImmediatePropagation(),e.preventDefault(),t(e)}),r.elm=e,k.setStyles(e,{left:u*r[0]+i-e.offsetWidth/2,top:s*r[1]+a-e.offsetHeight/2})}):j(),k.getAttrib(f,E)||f.setAttribute(E,o)},j=function(){H(),f&&f.removeAttribute(E),se(B,function(e,t){var n=k.get("mceResizeHandle"+t);n&&(k.unbind(n),k.remove(n))})},o=function(e){var t,n=function(e,t){if(e)do{if(e===t)return!0}while(e=e.parentNode)};C||l.removed||(_(k.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute(E)}),t="mousedown"===e.type?e.target:r.getNode(),n(t=k.$(t).closest("table,img,figure.image,hr,video,span.mce-preview-object")[0],O)&&(s(),n(r.getStart(!0),t)&&n(r.getEnd(!0),t))?u(t):j())},i=function(e){return rd(Zf(l.getBody(),e))},H=function(){se(B,function(e){e.elm&&(k.unbind(e.elm),delete e.elm)})},s=function(){try{l.getDoc().execCommand("enableObjectResizing",!1,"false")}catch(e){}};l.on("init",function(){var e;s(),(St.browser.isIE()||St.browser.isEdge())&&(l.on("mousedown click",function(e){var t=e.target,n=t.nodeName;C||!/^(TABLE|IMG|HR)$/.test(n)||i(t)||(2!==e.button&&l.selection.select(t,"TABLE"===n),"mousedown"===e.type&&l.nodeChanged())}),e=function(e){var t=function(e){Kr.setEditorTimeout(l,function(){return l.selection.select(e)})};if(i(e.target)||Kn(e.target))return e.preventDefault(),void t(e.target);/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"===e.target.tagName&&t(e.target))},k.bind(O,"mscontrolselect",e),l.on("remove",function(){return k.unbind(O,"mscontrolselect",e)}));var t=Kr.throttle(function(e){l.composing||o(e)});l.on("nodechange ResizeEditor ResizeWindow ResizeContent drop FullscreenStateChanged",t),l.on("keyup compositionend",function(e){f&&"TABLE"===f.nodeName&&t(e)}),l.on("hide blur",j),l.on("contextmenu longpress",n,!0)}),l.on("remove",H);return{isResizable:M,showResizeRect:u,hideResizeRect:j,updateResizeRect:o,destroy:function(){f=d=c=null}}},id=function(e){return qn(e)||$n(e)},ad=function(e,t,n){var r,o,i,a,u,s=n;if(s.caretPositionFromPoint)(o=s.caretPositionFromPoint(e,t))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(e,t);else if(s.body.createTextRange){r=s.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(c){r=function(e,n,t){var r,o=t.elementFromPoint(e,n),i=t.body.createTextRange();if(o&&"HTML"!==o.tagName||(o=t.body),i.moveToElementText(o),0<(r=(r=At.toArray(i.getClientRects())).sort(function(e,t){return(e=Math.abs(Math.max(e.top-n,e.bottom-n)))-(t=Math.abs(Math.max(t.top-n,t.bottom-n)))})).length){n=(r[0].bottom+r[0].top)/2;try{return i.moveToPoint(e,n),i.collapse(!0),i}catch(a){}}return null}(e,t,n)}return i=r,a=n.body,u=i&&i.parentElement?i.parentElement():null,$n(function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(u,a,id))?null:i}return r},ud=function(e,t){return e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset},sd=function(e,t,n){return null!==function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(e,t,n)},cd=function(e){return e&&"TABLE"===e.nodeName},ld=function(e,t,n){for(var r=new Gr(t,e.getParent(t.parentNode,e.isBlock)||e.getRoot());t=r[n?"prev":"next"]();)if(Hn(t))return!0},fd=function(e,t,n,r,o){var i,a,u=e.getRoot(),s=e.schema.getNonEmptyElements(),c=e.getParent(o.parentNode,e.isBlock)||u;if(r&&Hn(o)&&t&&e.isEmpty(c))return U.some(Ms(o.parentNode,e.nodeIndex(o)));for(var l,f,d=new Gr(o,c);a=d[r?"prev":"next"]();){if("false"===e.getContentEditableParent(a)||(f=u,wo(l=a)&&!1===sd(l,f,Ul)))return U.none();if(Fn(a)&&0l.childNodes.length-1&&(g=!1),zn(l)&&(l=s,f=0),l===s){if(g&&(o=l.childNodes[0\ufeff');return ln(n.element,r),_d(r,function(){return hn(r)})},Rd=function(n,r,o,i){Bd(n,function(e,t){return Dd(n,r,o,i)},o)},Td=function(e,t,n,r,o){var i,a,u={elm:r.element.dom,alignToTop:o};i=u,e.fire("ScrollIntoView",i).isDefaultPrevented()||(n(t,Sn(t).top,r,o),a=u,e.fire("AfterScrollIntoView",a))},Dd=function(e,t,n,r){var o=Tt.fromDom(e.getBody()),i=Tt.fromDom(e.getDoc());o.dom.offsetWidth;var a=Ad(Tt.fromDom(n.startContainer),n.startOffset);Td(e,i,t,a,r),a.cleanup()},Od=function(e,t,n,r){var o,i=Tt.fromDom(e.getDoc());Td(e,i,n,(o=t,_d(Tt.fromDom(o),te)),r)},Bd=function(e,t,n){var r=n.startContainer,o=n.startOffset,i=n.endContainer,a=n.endOffset;t(Tt.fromDom(r),Tt.fromDom(i));var u=e.dom.createRng();u.setStart(r,o),u.setEnd(i,a),e.selection.setRng(n)},Pd=function(e,t,n,r){var o,i=e.pos;n?Nn(i.left,i.top,r):(o=i.top-t+e.height,Nn(i.left,o,r))},Ld=function(e,t,n,r,o){var i=n+t,a=r.pos.top,u=r.bottom,s=n<=u-a;aa.bottom&&En(n.element,!0===r)},Fd=function(e,t,n){return Rd(e,Id,t,n)},Ud=function(e,t,n){return Od(e,t,Id,n)},zd=function(e,t,n){return Rd(e,Md,t,n)},jd=function(e,t,n){return Od(e,t,Md,n)},Hd=function(e,t,n){(e.inline?Fd:zd)(e,t,n)},Vd=function(e){var t=an(e).dom;return e.dom===t.activeElement},qd=function(e){return void 0===e&&(e=Tt.fromDom(document)),U.from(e.dom.activeElement).map(Tt.fromDom)},$d=function(e,t,n,r){return{start:e,soffset:t,finish:n,foffset:r}},Wd=xr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Kd=(Wd.before,Wd.on,Wd.after,function(e){return e.fold(g,g,g)}),Xd=xr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Yd={domRange:Xd.domRange,relative:Xd.relative,exact:Xd.exact,exactFromRange:function(e){return Xd.exact(e.start,e.soffset,e.finish,e.foffset)},getWin:function(e){var t=e.match({domRange:function(e){return Tt.fromDom(e.startContainer)},relative:function(e,t){return Kd(e)},exact:function(e,t,n,r){return e}});return Wt(t)},range:$d},Gd=gt().browser,Jd=function(e,t){var n=jt(t)?Wf(t).length:Qt(t).length+1;return n]+(?:"[^"]*"|'[^']*'))*[^"'>]*(?:"[^">]*|'[^'>]*)?|\s*|\/)>/g;for(u.lastIndex=r=n;o=u.exec(t);){if(r=u.lastIndex,"/"===o[1])i--;else if(!o[1]){if(o[2]in a)continue;i++}if(0===i)break}return r},Im=function(W,K){void 0===K&&(K=wi()),!1!==(W=W||{}).fix_self_closing&&(W.fix_self_closing=!0);var X=W.comment?W.comment:te,Y=W.cdata?W.cdata:te,G=W.text?W.text:te,J=W.start?W.start:te,Q=W.end?W.end:te,Z=W.pi?W.pi:te,ee=W.doctype?W.doctype:te,n=function(f,e){void 0===e&&(e="html");for(var t,i,n,d,r,o,a,m,u,s,c,l,g,p,h,v,y,b,C,w=f.html,x=0,S=[],N=0,E=fi.decode,k=At.makeMap("src,href,data,background,action,formaction,poster,xlink:href"),_=/((java|vb)script|mhtml):/i,A="html"===e?0:1,R=function(e){for(var t,n=S.length;n--&&S[n].name!==e;);if(0<=n){for(t=S.length-1;n<=t;t--)(e=S[t]).valid&&Q(e.name);S.length=n}},T=function(e,t){return G(Om(e,f),t)},D=function(e){""!==e&&(">"===e.charAt(0)&&(e=" "+e),W.allow_conditional_comments||"[if"!==e.substr(0,3).toLowerCase()||(e=" "+e),X(Om(e,f)))},O=function(e,t){var n=e||"",r=!qe(n,"--"),o=function(e,t,n){void 0===n&&(n=0);var r=e.toLowerCase();if(-1!==r.indexOf("[if ",n)&&(u=n,/^\s*\[if [\w\W]+\]>.*/.test(r.substr(u)))){var o=r.indexOf("[endif]",n);return r.indexOf(">",o)}if(t){var i=r.indexOf(">",n);return-1!==i?i:r.length}var a=/--!?>/g;a.lastIndex=n;var u,s=a.exec(e);return s?s.index+s[0].length:r.length}(w,r,t);return e=w.substr(t,o-t),D(r?n+e:e),o+1},B=function(e,t,n,r,o){var i,a,u,s;if(t=t.toLowerCase(),u=t in F?t:E(n||r||o||""),n=Om(u,f),U&&!m&&!1==(0===(s=t).indexOf("data-")||0===s.indexOf("aria-"))){if(!(i=p[t])&&h){for(a=h.length;a--&&!(i=h[a]).pattern.test(t););-1===a&&(i=null)}if(!i)return;if(i.validValues&&!(n in i.validValues))return}if(k[t]&&!W.allow_script_urls){var c=n.replace(/[\s\u0000-\u001F]+/g,"");try{c=decodeURIComponent(c)}catch(l){c=unescape(c)}if(_.test(c))return;if(Pm(W,c,e))return}m&&(t in k||0===t.indexOf("on"))||(d.map[t]=n,d.push({name:t,value:n}))},P=new RegExp("<(?:(?:!--([\\w\\W]*?)--!?>)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:![Dd][Oo][Cc][Tt][Yy][Pp][Ee]([\\w\\W]*?)>)|(?:!(--)?)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_:.]*)(\\s(?:[^'\">]+(?:\"[^\"]*\"|'[^']*'))*[^\"'>]*(?:\"[^\">]*|'[^'>]*)?|\\s*|\\/)>))","g"),L=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,I=K.getShortEndedElements(),M=W.self_closing_elements||K.getSelfClosingElements(),F=K.getBoolAttrs(),U=W.validate,z=W.remove_internals,j=W.fix_self_closing,H=K.getSpecialElements(),V=w+">";t=P.exec(V);){var q=t[0];if(xw.length){T(E(w.substr(t.index))),x=t.index+q.length;continue}":"===(i=i.toLowerCase()).charAt(0)&&(i=i.substr(1)),u=i in I,j&&M[i]&&0]*data-mce-bogus="all"[^>]*>/g,f=e.schema;a=e.getTempAttrs(),u=c,s=new RegExp(["\\s?("+a.join("|")+')="[^"]+"'].join("|"),"gi"),c=u.replace(s,"");for(var d=f.getShortEndedElements();i=l.exec(c);)r=l.lastIndex,o=i[0].length,n=d[i[1]]?r:Im.findEndTag(f,c,r),c=c.substring(0,r-o)+c.substring(n),l.lastIndex=r-o;return ho(c)},Fm=Mm,Um=function(e,t,n,r){var o,i,a,u,s;return t.format=n,t.get=!0,t.getInner=!0,t.no_events||e.fire("BeforeGetContent",t),o="raw"===t.format?At.trim(Fm(e.serializer,r.innerHTML)):"text"===t.format?e.dom.isEmpty(r)?"":ho(r.innerText||r.textContent):"tree"===t.format?e.serializer.serialize(r,t):(a=(i=e).serializer.serialize(r,t),u=fc(i),s=new RegExp("^(<"+u+"[^>]*>( | |\\s|\xa0|
|)<\\/"+u+">[\r\n]*|
[\r\n]*)$"),a.replace(s,"")),M(["text","tree"],t.format)||lo(Tt.fromDom(r))?t.content=o:t.content=At.trim(o),t.no_events||e.fire("GetContent",t),t.content},zm=At.each,jm=function(o){return{compare:function(e,t){if(e.nodeName!==t.nodeName)return!1;var n=function(n){var r={};return zm(o.getAttribs(n),function(e){var t=e.nodeName.toLowerCase();0!==t.indexOf("_")&&"style"!==t&&0!==t.indexOf("data-")&&(r[t]=o.getAttrib(n,t))}),r},r=function(e,t){var n,r;for(r in e)if(e.hasOwnProperty(r)){if(void 0===(n=t[r]))return!1;if(e[r]!==n)return!1;delete t[r]}for(r in t)if(t.hasOwnProperty(r))return!1;return!0};return!!r(n(e),n(t))&&(!!r(o.parseStyle(o.getAttrib(e,"style")),o.parseStyle(o.getAttrib(t,"style")))&&(!Yl(e)&&!Yl(t)))}}},Hm=At.makeMap,Vm=function(e){var u=[],s=(e=e||{}).indent,c=Hm(e.indent_before||""),l=Hm(e.indent_after||""),f=fi.getEncodeFunc(e.entity_encoding||"raw",e.entities),d="html"===e.element_format;return{start:function(e,t,n){var r,o,i,a;if(s&&c[e]&&0":" />",n&&s&&l[e]&&0"),s&&l[e]&&0")},comment:function(e){u.push("\x3c!--",e,"--\x3e")},pi:function(e,t){t?u.push("",e," ",f(t),"?>"):u.push("",e,"?>"),s&&u.push("\n")},doctype:function(e){u.push("",s?"\n":"")},reset:function(){u.length=0},getContent:function(){return u.join("").replace(/\n$/,"")}}},qm=function(t,g){void 0===g&&(g=wi());var p=Vm(t);(t=t||{}).validate=!("validate"in t)||t.validate;return{serialize:function(e){var f=t.validate,d={3:function(e){p.text(e.value,e.raw)},8:function(e){p.comment(e.value)},7:function(e){p.pi(e.name,e.value)},10:function(e){p.doctype(e.value)},4:function(e){p.cdata(e.value)},11:function(e){if(e=e.firstChild)for(;m(e),e=e.next;);}};p.reset();var m=function(e){var t,n,r,o,i,a,u,s,c,l=d[e.type];if(l)l(e);else{if(t=e.name,n=e.shortEnded,r=e.attributes,f&&r&&1'))},pg=function(n){tn(n).each(function(t){Xt(t).each(function(e){no(n)&&oo(t)&&no(e)&&hn(t)})})},hg=function(e,t,n){return It(t,e)?function(e,t){for(var n=m(t)?t:A,r=e.dom,o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,a=Tt.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o}(e,function(e){return n(e)||Pt(e,t)}).slice(0,-1):[]},vg=function(e,t){return hg(e,t,A)},yg=function(e,t){return[e].concat(vg(e,t))},bg=function(e,t,n){return Ol(e,t,n,tg)},Cg=function(e,t){return W(yg(Tt.fromDom(t.container()),e),no)},wg=function(e,n,r){return bg(e,n.dom,r).forall(function(t){return Cg(n,r).fold(function(){return!1===Zc(t,r,n.dom)},function(e){return!1===Zc(t,r,n.dom)&&It(e,Tt.fromDom(t.container()))})})},xg=function(t,n,r){return Cg(n,r).fold(function(){return bg(t,n.dom,r).forall(function(e){return!1===Zc(e,r,n.dom)})},function(e){return bg(t,e.dom,r).isNone()})},Sg=k(xg,!1),Ng=k(xg,!0),Eg=k(wg,!1),kg=k(wg,!0),_g=function(e){return sl(e).exists(oo)},Ag=function(e,t,n){var r=H(yg(Tt.fromDom(n.container()),t),no),o=re(r).getOr(t);return Tl(e,o.dom,n).filter(_g)},Rg=function(e,t){return sl(t).exists(oo)||Ag(!0,e,t).isSome()},Tg=function(e,t){return n=t,U.from(n.getNode(!0)).map(Tt.fromDom).exists(oo)||Ag(!1,e,t).isSome();var n},Dg=k(Ag,!1),Og=k(Ag,!0),Bg=function(e){return Ms.isTextPosition(e)&&!e.isAtStart()&&!e.isAtEnd()},Pg=function(e,t){var n=H(yg(Tt.fromDom(t.container()),e),no);return re(n).getOr(e)},Lg=function(e,t){return Bg(t)?eg(t):eg(t)||Ll(Pg(e,t).dom,t).exists(eg)},Ig=function(e,t){return Bg(t)?Zm(t):Zm(t)||Pl(Pg(e,t).dom,t).exists(Zm)},Mg=function(e){return sl(e).bind(function(e){return Or(e,zt)}).exists(function(e){return t=nr(e,"white-space"),M(["pre","pre-wrap"],t);var t})},Fg=function(e,t){return r=t,Ll(e.dom,r).isNone()||(n=t,Pl(e.dom,n).isNone())||Sg(e,t)||Ng(e,t)||Tg(e,t)||Rg(e,t);var n,r},Ug=function(e,t){return!Mg(t)&&(Sg(e,t)||Eg(e,t)||Tg(e,t)||Lg(e,t))},zg=function(e,t){return!Mg(t)&&(Ng(e,t)||kg(e,t)||Rg(e,t)||Ig(e,t))},jg=function(e,t){return Ug(e,t)||zg(e,(r=(n=t).container(),o=n.offset(),Fn(r)&&o=e.data.length&&zg(o,Ms(e,e.data.length)),u=0===t&&Ug(o,Ms(e,0)),e.replaceData(t,n,(c=u,l=a,$(s=i,function(e,t){return Jl(t)||Gl(t)?e.previousCharIsSpace||""===e.str&&c||e.str.length===s.length-1&&l?{previousCharIsSpace:!1,str:e.str+mo}:{previousCharIsSpace:!0,str:e.str+" "}:{previousCharIsSpace:!1,str:e.str+t}},{previousCharIsSpace:!1,str:""}).str)))},Xg=function(e,t){var n=e.data.slice(t),r=n.length-Ke(n).length;return Kg(e,t,r)},Yg=function(e,t){var n=e.data.slice(0,t),r=n.length-Xe(n).length;return Kg(e,t-r,r)},Gg=function(e,t,n,r){void 0===r&&(r=!0);var o=Xe(e.data).length,i=r?e:t,a=r?t:e;return r?i.appendData(a.data):i.insertData(0,a.data),hn(Tt.fromDom(a)),n&&Xg(i,o),i},Jg=function(e,t){return r=e,o=(n=t).container(),i=n.offset(),!1===Ms.isTextPosition(n)&&o===r.parentNode&&i>Ms.before(r).offset()?Ms(t.container(),t.offset()-1):t;var n,r,o,i},Qg=function(e){return Mo(e.previousSibling)?U.some((t=e.previousSibling,Fn(t)?Ms(t,t.data.length):Ms.after(t))):e.previousSibling?Ml(e.previousSibling):U.none();var t},Zg=function(e){return Mo(e.nextSibling)?U.some((t=e.nextSibling,Fn(t)?Ms(t,0):Ms.before(t))):e.nextSibling?Il(e.nextSibling):U.none();var t},ep=function(r,o){return Qg(o).orThunk(function(){return Zg(o)}).orThunk(function(){return e=r,t=o,n=Ms.before(t.previousSibling?t.previousSibling:t.parentNode),Ll(e,n).fold(function(){return Pl(e,Ms.after(t))},U.some);var e,t,n})},tp=function(n,r){return Zg(r).orThunk(function(){return Qg(r)}).orThunk(function(){return t=r,Pl(e=n,Ms.after(t)).fold(function(){return Ll(e,Ms.before(t))},U.some);var e,t})},np=function(e,t,n){return(e?tp:ep)(t,n).map(k(Jg,n))},rp=function(t,n,e){e.fold(function(){t.focus()},function(e){t.selection.setRng(e.toRange(),n)})},op=function(e,t){return t&&ve(e.schema.getBlockElements(),Mt(t))},ip=function(e){if(Ko(e)){var t=Tt.fromHtml('
');return pn(e),mn(e,t),U.some(Ms.before(t.dom))}return U.none()},ap=function(e,t,a){var n,r,o,i,u=Xt(e).filter(jt),s=Yt(e).filter(jt);return hn(e),r=s,o=t,i=function(e,t,n){var r=e.dom,o=t.dom,i=r.data.length;return Gg(r,o,a),n.container()===o?Ms(r,i):n},((n=u).isSome()&&r.isSome()&&o.isSome()?U.some(i(n.getOrDie(),r.getOrDie(),o.getOrDie())):U.none()).orThunk(function(){return a&&(u.each(function(e){return Yg(e.dom,e.dom.length)}),s.each(function(e){return Xg(e.dom,0)})),t})},up=function(t,n,e,r){void 0===r&&(r=!0);var o,i,a=np(n,t.getBody(),e.dom),u=Dr(e,k(op,t),(o=t.getBody(),function(e){return e.dom===o})),s=ap(e,a,(i=e,ve(t.schema.getTextInlineElements(),Mt(i))));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):u.bind(ip).fold(function(){r&&rp(t,n,s)},function(e){r&&rp(t,n,U.some(e))})},sp=function(e,t){return{start:e,end:t}},cp=xr([{removeTable:["element"]},{emptyCells:["cells"]},{deleteCellSelection:["rng","cell"]}]),lp=function(e,t){return Ir(Tt.fromDom(e),"td,th",t)},fp=function(e,t){return Pr(e,"table",t)},dp=function(e){return!Pt(e.start,e.end)},mp=function(e,t){return fp(e.start,t).bind(function(r){return fp(e.end,t).bind(function(e){return t=Pt(r,e),n=r,t?U.some(n):U.none();var t,n})})},gp=function(e){return $u(e,"td,th")},pp=function(r,e){var t=lp(e.startContainer,r),n=lp(e.endContainer,r);return e.collapsed?U.none():us(t,n,sp).fold(function(){return t.fold(function(){return n.bind(function(t){return fp(t,r).bind(function(e){return re(gp(e)).map(function(e){return sp(e,t)})})})},function(t){return fp(t,r).bind(function(e){return oe(gp(e)).map(function(e){return sp(t,e)})})})},function(e){return hp(r,e)?U.none():(n=r,fp((t=e).start,n).bind(function(e){return oe(gp(e)).map(function(e){return sp(t.start,e)})}));var t,n})},hp=function(e,t){return mp(t,e).isSome()},vp=function(e,t,n){return e.filter(function(e){return dp(e)&&hp(n,e)}).orThunk(function(){return pp(n,t)}).bind(function(e){return mp(t=e,n).map(function(e){return{rng:t,table:e,cells:gp(e)}});var t})},yp=function(e,t){return G(e,function(e){return Pt(e,t)})},bp=function(e,r,o){return e.filter(function(e){return n=o,!dp(t=e)&&mp(t,n).exists(function(e){var t=e.dom.rows;return 1===t.length&&1===t[0].cells.length})&&zf(e.start,r);var t,n}).map(function(e){return e.start})},Cp=function(n){return us(yp((r=n).cells,r.rng.start),yp(r.cells,r.rng.end),function(e,t){return r.cells.slice(e,t+1)}).map(function(e){var t=n.cells;return e.length===t.length?cp.removeTable(n.table):cp.emptyCells(e)});var r},wp=function(e,t){var n,r,o,i,a,u=(n=e,function(e){return Pt(n,e)}),s=(o=u,i=lp((r=t).startContainer,o),a=lp(r.endContainer,o),us(i,a,sp));return bp(s,t,u).map(function(e){return cp.deleteCellSelection(t,e)}).orThunk(function(){return vp(s,t,u).bind(Cp)})},xp=function(e){var t;return(8===Ft(t=e)||"#comment"===Mt(t)?Xt:tn)(e).bind(xp).orThunk(function(){return U.some(e)})},Sp=function(e,t){return Y(t,gg),e.selection.setCursorLocation(t[0].dom,0),!0},Np=function(e,t,n){t.deleteContents();var r,o,i=xp(n).getOr(n),a=Tt.fromDom(e.dom.getParent(i.dom,e.dom.isBlock));return Ko(a)&&(gg(a),e.selection.setCursorLocation(a.dom,0)),Pt(n,a)||(r=Kt(a).is(n)?[]:Kt(o=a).map(Qt).map(function(e){return H(e,function(e){return!Pt(o,e)})}).getOr([]),Y(r.concat(Qt(n)),function(e){Pt(e,a)||It(e,a)||hn(e)})),!0},Ep=function(e,t){return up(e,!1,t),!0},kp=function(n,e,r,t){return Ap(e,t).fold(function(){return t=n,wp(e,r).map(function(e){return e.fold(k(Ep,t),k(Sp,t),k(Np,t))});var t},function(e){return Rp(n,e)}).getOr(!1)},_p=function(e,t){return W(yg(t,e),co)},Ap=function(e,t){return W(yg(t,e),function(e){return"caption"===Mt(e)})},Rp=function(e,t){return gg(t),e.selection.setCursorLocation(t.dom,0),U.some(!0)},Tp=function(u,s,c,l,f){return Dl(c,u.getBody(),f).bind(function(e){return o=c,i=f,a=e,Il((r=l).dom).bind(function(t){return Ml(r.dom).map(function(e){return o?i.isEqual(t)&&a.isEqual(e):i.isEqual(e)&&a.isEqual(t)})}).getOr(!0)?Rp(u,l):(t=l,n=e,Ap(s,Tt.fromDom(n.getNode())).map(function(e){return!1===Pt(e,t)}));var t,n,r,o,i,a}).or(U.some(!0))},Dp=function(o,i,a,e){var u=Ms.fromRangeStart(o.selection.getRng());return _p(a,e).bind(function(e){return Ko(e)?Rp(o,e):(t=a,n=e,r=u,Dl(i,o.getBody(),r).bind(function(e){return _p(t,Tt.fromDom(e.getNode())).map(function(e){return!1===Pt(e,n)})}));var t,n,r}).getOr(!1)},Op=function(e,t){return(e?cg:lg)(t)},Bp=function(a,u,r){var s=Tt.fromDom(a.getBody());return Ap(s,r).fold(function(){return Dp(a,u,s,r)||(e=a,t=u,n=Ms.fromRangeStart(e.selection.getRng()),Op(t,n)||Tl(t,e.getBody(),n).exists(function(e){return Op(t,e)}));var e,t,n},function(e){return t=a,n=u,r=s,o=e,i=Ms.fromRangeStart(t.selection.getRng()),(Ko(o)?Rp(t,o):Tp(t,r,n,o,i)).getOr(!1);var t,n,r,o,i})},Pp=function(e,t){var n,r,o,i,a,u=Tt.fromDom(e.selection.getStart(!0)),s=Mf(e);return e.selection.isCollapsed()&&0===s.length?Bp(e,t,u):(n=e,r=u,o=Tt.fromDom(n.getBody()),i=n.selection.getRng(),0!==(a=Mf(n)).length?Sp(n,a):kp(n,o,i,r))},Lp=function(a){var u=Ms.fromRangeStart(a),s=Ms.fromRangeEnd(a),c=a.commonAncestorContainer;return Tl(!1,c,s).map(function(e){return!Zc(u,s,c)&&Zc(u,e,c)?(t=u.container(),n=u.offset(),r=e.container(),o=e.offset(),(i=document.createRange()).setStart(t,n),i.setEnd(r,o),i):a;var t,n,r,o,i}).getOr(a)},Ip=function(e){return e.collapsed?e:Lp(e)},Mp=function(e,t){var n,r;return e.getBlockElements()[t.name]&&((r=t).firstChild&&r.firstChild===r.lastChild)&&("br"===(n=t.firstChild).name||n.value===mo)},Fp=function(e,t){var n,r,o,i=t.firstChild,a=t.lastChild;return i&&"meta"===i.name&&(i=i.next),a&&"mce_marker"===a.attr("id")&&(a=a.prev),r=a,o=(n=e).getNonEmptyElements(),r&&(r.isEmpty(o)||Mp(n,r))&&(a=a.prev),!(!i||i!==a)&&("ul"===i.name||"ol"===i.name)},Up=function(e){return e&&e.firstChild&&e.firstChild===e.lastChild&&((t=e.firstChild).data===mo||Hn(t));var t},zp=function(e){return 0)?$/," "):l.replace(/ (
)?$/," "));var g=e.parser,p=n.merge,h=qm({validate:e.getParam("validate")},e.schema),v='',y={content:t,format:"html",selection:!0,paste:n.paste};if((y=e.fire("BeforeSetContent",y)).isDefaultPrevented())e.fire("SetContent",{content:y.content,format:"html",selection:!0,paste:n.paste});else{-1===(t=y.content).indexOf("{$caret}")&&(t+="{$caret}"),t=t.replace(/\{\$caret\}/,v);var b,C,w=(a=d.getRng()).startContainer||(a.parentElement?a.parentElement():null),x=e.getBody();w===x&&d.isCollapsed()&&m.isBlock(x.firstChild)&&(b=e,(C=x.firstChild)&&!b.schema.getShortEndedElements()[C.nodeName])&&m.isEmpty(x.firstChild)&&((a=m.createRng()).setStart(x.firstChild,0),a.setEnd(x.firstChild,0),d.setRng(a)),d.isCollapsed()||Wp(e);var S,N,E,k,_,A,R,T,D,O,B,P,L,I,M={context:(r=d.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0},F=g.parse(t,M);if(!0===n.paste&&Fp(e.schema,F)&&jp(m,r))return a=qp(h,m,d.getRng(),F),d.setRng(a),void e.fire("SetContent",y);if(!function(e){for(var t=e;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")}(F),"mce_marker"===(u=F.lastChild).attr("id"))for(u=(i=u).prev;u;u=u.walk(!0))if(3===u.type||!m.isBlock(u.name)){e.schema.isValidChild(u.parent.name,"span")&&u.parent.insert(i,u,"br"===u.name);break}if(e._selectionOverrides.showBlockCaretContainer(r),M.invalid){for(e.selection.setContent(v),r=d.getNode(),o=e.getBody(),9===r.nodeType?r=u=o:u=r;u!==o;)u=(r=u).parentNode;t=r===o?o.innerHTML:m.getOuterHTML(r),t=h.serialize(g.parse(t.replace(//i,function(){return h.serialize(F)}))),r===o?m.setHTML(o,t):m.setOuterHTML(r,t)}else t=h.serialize(F),S=e,N=t,"all"===(E=r).getAttribute("data-mce-bogus")?E.parentNode.insertBefore(S.dom.createFragment(N),E):(k=E.firstChild,_=E.lastChild,!k||k===_&&"BR"===k.nodeName?S.dom.setHTML(E,N):S.selection.setContent(N));R=p,O=(A=e).schema.getTextInlineElements(),B=A.dom,R&&(T=A.getBody(),D=jm(B),At.each(B.select("*[data-mce-fragment]"),function(e){if(V(O[e.nodeName.toLowerCase()])&&Gm(B,e))for(var t=e.parentNode;V(t)&&t!==T;t=t.parentNode){if(Jm(B,e,t))break;if(D.compare(t,e)){B.remove(e,!0);break}}})),function(n,e){var t,r,o=n.dom,i=n.selection;if(e){i.scrollIntoView(e);var a=function(e){for(var t=n.getBody();e&&e!==t;e=e.parentNode)if("false"===o.getContentEditable(e))return e;return null}(e);if(a)return o.remove(e),i.select(a);var u=o.createRng(),s=e.previousSibling;s&&3===s.nodeType?(u.setStart(s,s.nodeValue.length),St.ie||(r=e.nextSibling)&&3===r.nodeType&&(s.appendData(r.data),r.parentNode.removeChild(r))):(u.setStartBefore(e),u.setEndBefore(e));var c=o.getParent(e,o.isBlock);o.remove(e),c&&o.isEmpty(c)&&(n.$(c).empty(),u.setStart(c,0),u.setEnd(c,0),$p(c)||c.getAttribute("data-mce-fragment")||!(t=function(e){var t=Ms.fromRangeStart(e);if(t=El(n.getBody()).next(t))return t.toRange()}(u))?o.add(c,o.create("br",{"data-mce-bogus":"1"})):(u=t,o.remove(c))),i.setRng(u)}}(e,m.get("mce_marker")),P=e.getBody(),At.each(P.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")}),L=m,I=d.getStart(),U.from(L.getParent(I,"td,th")).map(Tt.fromDom).each(pg),e.fire("SetContent",y),e.addVisual()}},Xp=function(e,t){t(e),e.firstChild&&Xp(e.firstChild,t),e.next&&Xp(e.next,t)},Yp=function(e,t,n){var r=function(e,n,t){var r={},o={},i=[];for(var a in t.firstChild&&Xp(t.firstChild,function(t){Y(e,function(e){e.name===t.name&&(r[e.name]?r[e.name].nodes.push(t):r[e.name]={filter:e,nodes:[t]})}),Y(n,function(e){"string"==typeof t.attr(e.name)&&(o[e.name]?o[e.name].nodes.push(t):o[e.name]={filter:e,nodes:[t]})})}),r)r.hasOwnProperty(a)&&i.push(r[a]);for(var u in o)o.hasOwnProperty(u)&&i.push(o[u]);return i}(e,t,n);Y(r,function(t){Y(t.filter.callbacks,function(e){e(t.nodes,t.filter.name,{})})})},Gp=function(e){return e instanceof Tm},Jp=function(e,t){var r;e.dom.setHTML(e.getBody(),t),bm(r=e)&&Il(r.getBody()).each(function(e){var t=e.getNode(),n=Ln(t)?Il(t).getOr(e):e;r.selection.setRng(n.toRange())})},Qp=function(u,s,c){return c.format=c.format?c.format:"html",c.set=!0,c.content=Gp(s)?"":s,c.no_events||u.fire("BeforeSetContent",c),Gp(s)||(s=c.content),U.from(u.getBody()).fold(E(s),function(e){return Gp(s)?function(e,t,n,r){Yp(e.parser.getNodeFilters(),e.parser.getAttributeFilters(),n);var o=qm({validate:e.validate},e.schema).serialize(n);return r.content=lo(Tt.fromDom(t))?o:At.trim(o),Jp(e,r.content),r.no_events||e.fire("SetContent",r),n}(u,e,s,c):(t=u,n=e,o=c,0===(r=s).length||/^\s+$/.test(r)?(a='
',"TABLE"===n.nodeName?r=""+a+" |
":/^(UL|OL)$/.test(n.nodeName)&&(r=""+a+""),r=(i=fc(t))&&t.schema.isValidChild(n.nodeName.toLowerCase(),i.toLowerCase())?(r=a,t.dom.createHTML(i,dc(t),r)):r||'
',Jp(t,r),t.fire("SetContent",o)):("raw"!==o.format&&(r=qm({validate:t.validate},t.schema).serialize(t.parser.parse(r,{isRootContent:!0,insert:!0}))),o.content=lo(Tt.fromDom(n))?r:At.trim(r),Jp(t,o.content),o.no_events||t.fire("SetContent",o)),o.content);var t,n,r,o,i,a})},Zp=function(e,t){return r=t,((o=(n=e).dom).parentNode?Br(Tt.fromDom(o.parentNode),function(e){return!Pt(n,e)&&r(e)}):U.none()).isSome();var n,r,o},eh=function(e){return m(e)?e:A},th=function(e,t,n){var r=t(e),o=eh(n);return r.orThunk(function(){return o(e)?U.none():function(e,t,n){for(var r=e.dom,o=eh(n);r.parentNode;){r=r.parentNode;var i=Tt.fromDom(r),a=t(i);if(a.isSome())return a;if(o(i))break}return U.none()}(e,t,o)})},nh=uf,rh=function(e,t,n){var r=e.formatter.get(n);if(r)for(var o=0;o
").append(n.childNodes)}))},Sh[Wm="pre"]||(Sh[Wm]=[]),Sh[Wm].push(Km);var kh=At.each,_h=function(e){return Tn(e)&&!Yl(e)&&!Ul(e)&&!Pn(e)},Ah=function(e,t){for(var n=e;n;n=n[t]){if(Fn(n)&&0!==n.nodeValue.length)return e;if(Tn(n)&&!Yl(n))return n}return e},Rh=function(e,t,n){var r,o,i=jm(e);if(t&&n&&(t=Ah(t,"previousSibling"),n=Ah(n,"nextSibling"),i.compare(t,n))){for(r=t.nextSibling;r&&r!==n;)r=(o=r).nextSibling,t.appendChild(o);return e.remove(n),At.each(At.grep(n.childNodes),function(e){t.appendChild(e)}),t}return n},Th=function(e,t,n,r){var o;r&&!1!==t.merge_siblings&&(o=Rh(e,tf(r),r),Rh(e,o,tf(o,!0)))},Dh=function(e,t,n){kh(e.childNodes,function(e){_h(e)&&(t(e)&&n(e),e.hasChildNodes()&&Dh(e,t,n))})},Oh=function(t,n){return function(e){return!(!e||!cf(t,e,n))}},Bh=function(r,o,i){return function(e){var t,n;r.setStyle(e,o,i),""===e.getAttribute("style")&&e.removeAttribute("style"),t=r,"SPAN"===(n=e).nodeName&&0===t.getAttribs(n).length&&t.remove(n,!0)}},Ph=xr([{keep:[]},{rename:["name"]},{removed:[]}]),Lh=/^(src|href|style)$/,Ih=At.each,Mh=uf,Fh=function(e,t,n){return e.isChildOf(t,n)&&t!==n&&!e.isBlock(n)},Uh=function(e,t,n){var r,o=t[n?"startContainer":"endContainer"],i=t[n?"startOffset":"endOffset"];return Tn(o)&&(r=o.childNodes.length-1,!n&&i&&i--,o=o.childNodes[r=o.nodeValue.length&&(o=new Gr(o,e.getBody()).next()||o),Fn(o)&&!n&&0===i&&(o=new Gr(o,e.getBody()).prev()||o),o},zh=function(e,t){var n=t?"firstChild":"lastChild";if(/^(TR|TH|TD)$/.test(e.nodeName)&&e[n]){var r=e[n];return"TR"===e.nodeName&&r[n]||r}return e},jh=function(e,t,n,r){var o=e.create(n,r);return t.parentNode.insertBefore(o,t),o.appendChild(t),o},Hh=function(e,t,n,r,o){var i=Tt.fromDom(t),a=Tt.fromDom(e.create(r,o)),u=(n?Jt:Gt)(i);return gn(a,u),n?(ln(i,a),dn(a,i)):(fn(i,a),mn(a,i)),a.dom},Vh=function(e,t,n,r){return!(t=tf(t,n,r))||"BR"===t.nodeName||e.isBlock(t)},qh=function(e,r,o,t,i){var n,a,u,s,c,l=e.dom;if(u=l,!(Mh(s=t,(c=r).inline)||Mh(s,c.block)||c.selector&&(Tn(s)&&u.is(s,c.selector))||(a=t,r.links&&"A"===a.nodeName)))return Ph.keep();var f,d,m,g,p,h,v,y=t;if(r.inline&&"all"===r.remove&&S(r.preserve_attributes)){var b=H(l.getAttribs(y),function(e){return M(r.preserve_attributes,e.name.toLowerCase())});if(l.removeAllAttribs(y),Y(b,function(e){return l.setAttrib(y,e.name,e.value)}),0e?t.cells.length:e},0)},uv=function(e,t){for(var n=e.rows,r=0;r")?{type:"fragmented",fragments:r,content:"",bookmark:null,beforeBookmark:null}:{type:"complete",fragments:null,content:o,bookmark:null,beforeBookmark:null}},Av=function(e,t,n){"fragmented"===t.type?Ev(t.fragments,e.getBody()):e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(n?t.beforeBookmark:t.bookmark)},Rv=function(e){return"fragmented"===e.type?e.fragments.join(""):e.content},Tv=function(e){var t=Tt.fromTag("body",kv.get().getOrThunk(function(){var e=document.implementation.createHTMLDocument("undo");return kv.set(U.some(e)),e}));return ts(t,Rv(e)),Y($u(t,"*[data-mce-bogus]"),vn),t.dom.innerHTML},Dv=function(e,t){return!(!e||!t)&&(r=t,Rv(e)===Rv(r)||(n=t,Tv(e)===Tv(n)));var n,r},Ov=function(e){return 0===e.get()},Bv=function(e,t,n){Ov(n)&&(e.typing=t)},Pv=function(e,t){e.typing&&(Bv(e,!1,t),e.add())},Lv=function(f){return{undoManager:{beforeChange:function(e,t){return n=f,r=t,void(Ov(e)&&r.set(U.some(uc(n.selection))));var n,r},addUndoLevel:function(e,t,n,r,o,i){return function(e,t,n,r,o,i,a){var u=_v(e);if(i=i||{},i=At.extend(i,u),!1===Ov(r)||e.removed)return null;var s=t.data[n.get()];if(e.fire("BeforeAddUndo",{level:i,lastLevel:s,originalEvent:a}).isDefaultPrevented())return null;if(s&&Dv(s,i))return null;t.data[n.get()]&&o.get().each(function(e){t.data[n.get()].beforeBookmark=e});var c=e.getParam("custom_undo_redo_levels",0,"number");if(c&&t.data.length>c){for(var l=0;lt.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e,t){return r=e,o=t,void((n=c).inline?Ud:jd)(n,r,o);var n,r,o},placeCaretAt:function(e,t){return p(ad(e,t,c.getDoc()))},getBoundingClientRect:function(){var e=g();return e.collapsed?Ms.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){s=l=f=null,b.destroy()}},y=Qf(v),b=od(v,c);return v.bookmarkManager=y,v.controlSelection=b,v},Gv=function(e,a,u){e.addNodeFilter("font",function(e){Y(e,function(e){var t,n=a.parse(e.attr("style")),r=e.attr("color"),o=e.attr("face"),i=e.attr("size");r&&(n.color=r),o&&(n["font-family"]=o),i&&(n["font-size"]=u[parseInt(e.attr("size"),10)-1]),e.name="span",e.attr("style",a.serialize(n)),t=e,Y(["color","face","size"],function(e){t.attr(e,null)})})})},Jv=function(e,t){var n,r=Si();t.convert_fonts_to_spans&&Gv(e,r,At.explode(t.font_size_legacy_values)),n=r,e.addNodeFilter("strike",function(e){Y(e,function(e){var t=n.parse(e.attr("style"));t["text-decoration"]="line-through",e.name="span",e.attr("style",n.serialize(t))})})},Qv=function(e){var t,n=decodeURIComponent(e).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(t=r[1]),{type:t,data:n[1]}},Zv=function(e,t){var n;try{n=atob(t)}catch(zk){return U.none()}for(var r=new Uint8Array(n.length),o=0;o)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")};i--;)r=(n=e[i]).firstChild?n.firstChild.value:"","script"===t?((o=n.attr("type"))&&n.attr("type","mce-no/type"===o?null:o.replace(/^mce\-/,"")),"xhtml"===s.element_format&&0")):"xhtml"===s.element_format&&0",visual:!0,font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,inline_styles:!0,convert_fonts_to_spans:!0,indent:!0,indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",entity_encoding:"named",url_converter:u.convertURL,url_converter_scope:u},_e(_e({},s),a?By:{}));return zy(Ty||Dy,Ty,c,r,o)},Hy=function(e,t,n){return U.from(t.settings[n]).filter(e)},Vy=function(e,t,n,r){var o,i,a,u=t in e.settings?e.settings[t]:n;return"hash"===r?(a={},"string"==typeof(i=u)?Y(0)\s*/g,"$1"),At.map(c.split(/(?:>|\s+(?![^\[\]]+\]))/),function(e){var t=At.map(e.split(/(?:~\+|~|\+)/),Eb),n=t.pop();return t.length&&(n.siblings=t),n}).reverse()):[],f=l.length?(l[0].name||(l[0].name=t),t=e.selector,Nb(l,n)):Nb([t],n),d=Sb.select(t,f)[0]||f.firstChild;return xb(e.styles,function(e,t){var n=u(e);n&&Sb.setStyle(d,t,n)}),xb(e.attributes,function(e,t){var n=u(e);n&&Sb.setAttrib(d,t,n)}),xb(e.classes,function(e){var t=u(e);Sb.hasClass(d,t)||Sb.addClass(d,t)}),n.fire("PreviewFormats"),Sb.setStyles(f,{position:"absolute",left:-65535}),n.getBody().appendChild(f),r=Sb.getStyle(n.getBody(),"fontSize",!0),r=/px$/.test(r)?parseInt(r,10):0,xb(a.split(" "),function(e){var t=Sb.getStyle(d,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(t)&&(t=Sb.getStyle(n.getBody(),e,!0),"#ffffff"===Sb.toHex(t).toLowerCase())||"color"===e&&"#000000"===Sb.toHex(t).toLowerCase())){if("font-size"===e&&/em|%$/.test(t)){if(0===r)return;t=parseFloat(t)/(/%$/.test(t)?100:1)*r+"px"}"border"===e&&t&&(i+="padding:0 2px;"),i+=e+":"+t+";"}}),n.fire("AfterPreviewFormats"),Sb.remove(f),i},_b=function(s){var e=wb(s),u=Ru(null);return function(e){e.addShortcut("meta+b","","Bold"),e.addShortcut("meta+i","","Italic"),e.addShortcut("meta+u","","Underline");for(var t=1;t<=6;t++)e.addShortcut("access+"+t,"",["FormatBlock",!1,"h"+t]);e.addShortcut("access+7","",["FormatBlock",!1,"p"]),e.addShortcut("access+8","",["FormatBlock",!1,"div"]),e.addShortcut("access+9","",["FormatBlock",!1,"address"])}(s),wh(s),{get:e.get,has:e.has,register:e.register,unregister:e.unregister,apply:function(e,t,n){var r,o,i;r=e,o=t,i=n,Uv(s).formatter.apply(r,o,i)},remove:function(e,t,n,r){var o,i,a,u;o=e,i=t,a=n,u=r,Uv(s).formatter.remove(o,i,a,u)},toggle:function(e,t,n){var r,o,i;r=e,o=t,i=n,Uv(s).formatter.toggle(r,o,i)},match:function(e,t,n){return r=e,o=t,i=n,Uv(s).formatter.match(r,o,i);var r,o,i},closest:function(e){return t=e,Uv(s).formatter.closest(t);var t},matchAll:function(e,t){return n=e,r=t,Uv(s).formatter.matchAll(n,r);var n,r},matchNode:function(e,t,n,r){return o=e,i=t,a=n,u=r,Uv(s).formatter.matchNode(o,i,a,u);var o,i,a,u},canApply:function(e){return t=e,Uv(s).formatter.canApply(t);var t},formatChanged:function(e,t,n){return r=u,o=e,i=t,void 0===(a=n)&&(a=!1),Uv(s).formatter.formatChanged(r,o,i,a);var r,o,i,a},getCssText:k(kb,s)}},Ab=function(n,r,o){var i=Ru(!1),a=function(e){Bv(r,!1,o),r.add({},e)};n.on("init",function(){r.add()}),n.on("BeforeExecCommand",function(e){var t=e.command.toLowerCase();"undo"!==t&&"redo"!==t&&"mcerepaint"!==t&&(Pv(r,o),r.beforeChange())}),n.on("ExecCommand",function(e){var t=e.command.toLowerCase();"undo"!==t&&"redo"!==t&&"mcerepaint"!==t&&a(e)}),n.on("ObjectResizeStart cut",function(){r.beforeChange()}),n.on("SaveContent ObjectResized blur",a),n.on("dragend",a),n.on("keyup",function(e){var t=e.keyCode;e.isDefaultPrevented()||((33<=t&&t<=36||37<=t&&t<=40||45===t||e.ctrlKey)&&(a(),n.nodeChanged()),46!==t&&8!==t||n.nodeChanged(),i.get()&&r.typing&&!1===Dv(_v(n),r.data[0])&&(!1===n.isDirty()&&(n.setDirty(!0),n.fire("change",{level:r.data[0],lastLevel:null})),n.fire("TypingUndo"),i.set(!1),n.nodeChanged()))}),n.on("keydown",function(e){var t,n=e.keyCode;e.isDefaultPrevented()||(33<=n&&n<=36||37<=n&&n<=40||45===n?r.typing&&a(e):(t=e.ctrlKey&&!e.altKey||e.metaKey,!(n<16||20t;var t}},Cw=function(n){return function(e){return t=n,e.line===t;var t}},ww=$n,xw=Jc,Sw=function(e,t){return Math.abs(e.left-t)},Nw=function(e,t){return Math.abs(e.right-t)},Ew=function(e,t){return e>=t.left&&e<=t.right},kw=function(e,t){return e>=t.top&&e<=t.bottom},_w=function(e,o){return Ne(e,function(e,t){var n=Math.min(Sw(e,o),Nw(e,o)),r=Math.min(Sw(t,o),Nw(t,o));return Ew(o,t)||!Ew(o,e)&&(r===n&&ww(t.node)||r'),u=o,1===t?e.$(s).after(u):e.$(s).before(u),e.selection.select(u,!0),e.selection.collapse())}},bx=function(e,t){var n=t?Fs.Forwards:Fs.Backwards,r=e.selection.getRng();return Ow(e,n,r,fg,dg,vx).orThunk(function(){return yx(e,n,r),U.none()})},Cx=function(e,t){var n=t?1:-1,r=e.selection.getRng();return Bw(e,n,r,function(e){return fg(e)||cg(e)},function(e){return dg(e)||lg(e)},vx).orThunk(function(){return yx(e,n,r),U.none()})},wx=function(t,e){return bx(t,e).exists(function(e){return Tw(t,e),!0})},xx=function(t,e){return Cx(t,e).exists(function(e){return Tw(t,e),!0})},Sx=function(e,t){return Lw(e,t,t?dg:fg)},Nx=function(e){return M(["figcaption"],Mt(e))},Ex=function(e){var t=document.createRange();return t.setStartBefore(e.dom),t.setEndBefore(e.dom),t},kx=function(e,t,n){(n?mn:dn)(e,t)},_x=function(e,t,n,r){return""===t?(l=e,f=r,d=Tt.fromTag("br"),kx(l,d,f),Ex(d)):(o=e,i=r,a=t,u=n,s=Tt.fromTag(a),c=Tt.fromTag("br"),Jn(s,u),mn(s,c),kx(o,s,i),Ex(c));var o,i,a,u,s,c,l,f,d},Ax=function(e,t,n){return t?(o=e.dom,fw(o,n).breakAt.isNone()):(r=e.dom,lw(r,n).breakAt.isNone());var r,o},Rx=function(t,n){var e,r,o=Tt.fromDom(t.getBody()),i=Ms.fromRangeStart(t.selection.getRng()),a=fc(t),u=dc(t);return e=i,r=k(Pt,o),Or(Tt.fromDom(e.container()),no,r).filter(Nx).exists(function(){if(Ax(o,n,i)){var e=_x(o,a,u,n);return t.selection.setRng(e),!0}return!1})},Tx=function(e,t){return!!e.selection.isCollapsed()&&Rx(e,t)},Dx=function(e,r){return J(z(e,function(e){return _e({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:te},e)}),function(e){return t=e,(n=r).keyCode===t.keyCode&&n.shiftKey===t.shiftKey&&n.altKey===t.altKey&&n.ctrlKey===t.ctrlKey&&n.metaKey===t.metaKey?[e]:[];var t,n})},Ox=function(e){for(var t=[],n=1;nt}),jx=function(t,n){return re(n.getClientRects()).bind(function(e){return Ux(t,e.left,e.top)}).bind(function(e){return cw(Ml(t=e).map(function(e){return lw(t,e).positions.concat(e)}).getOr([]),n);var t})},Hx=function(t,n){return oe(n.getClientRects()).bind(function(e){return zx(t,e.left,e.top)}).bind(function(e){return cw(Il(t=e).map(function(e){return[e].concat(fw(t,e).positions)}).getOr([]),n);var t})},Vx=function(e,t,n){var r,o,i,a,u=e(t,n);return(a=u).breakType===nb.Wrap&&0===a.positions.length||!Hn(n.getNode())&&((i=u).breakType===nb.Br&&1===i.positions.length)?(r=e,o=t,!u.breakAt.exists(function(e){return r(o,e).breakAt.isSome()})):u.breakAt.isNone()},qx=k(Vx,lw),$x=k(Vx,fw),Wx=function(t,e,n,r){var o,i,a,u,s=t.selection.getRng(),c=e?1:-1;return!(!zc()||(o=e,i=s,a=n,u=Ms.fromRangeStart(i),!Bl(!o,a).exists(function(e){return e.isEqual(u)})))&&(sC(c,t,n,!e,!1).each(function(e){Tw(t,e)}),!0)},Kx=function(e,t){var n=t.getNode(e);return Tn(n)&&"TABLE"===n.nodeName?U.some(n):U.none()},Xx=function(u,s,c){var e=Kx(!!s,c),t=!1===s;e.fold(function(){return Tw(u,c.toRange())},function(a){return Bl(t,u.getBody()).filter(function(e){return e.isEqual(c)}).fold(function(){return Tw(u,c.toRange())},function(e){return n=s,o=a,t=c,void((i=fc(r=u))?r.undoManager.transact(function(){var e=Tt.fromTag(i);Jn(e,dc(r)),mn(e,Tt.fromTag("br")),(n?fn:ln)(Tt.fromDom(o),e);var t=r.dom.createRng();t.setStart(e.dom,0),t.setEnd(e.dom,0),Tw(r,t)}):Tw(r,t.toRange()));var n,r,o,t,i})})},Yx=function(e,t,n,r){var o,i,a,u,s,c,l=e.selection.getRng(),f=Ms.fromRangeStart(l),d=e.getBody();if(!t&&qx(r,f)){var m=(u=d,jx(s=n,c=f).orThunk(function(){return re(c.getClientRects()).bind(function(e){return sw(dw(u,Ms.before(s)),e.left)})}).getOr(Ms.before(s)));return Xx(e,t,m),!0}if(t&&$x(r,f)){m=(o=d,Hx(i=n,a=f).orThunk(function(){return re(a.getClientRects()).bind(function(e){return sw(mw(o,Ms.after(i)),e.left)})}).getOr(Ms.after(i)));return Xx(e,t,m),!0}return!1},Gx=function(n,r,o){return U.from(n.dom.getParent(n.selection.getNode(),"td,th")).bind(function(t){return U.from(n.dom.getParent(t,"table")).map(function(e){return o(n,r,e,t)})}).getOr(!1)},Jx=function(e,t){return Gx(e,t,Wx)},Qx=function(e,t){return Gx(e,t,Yx)},Zx=function(i,a){i.on("keydown",function(e){var t,n,r,o;!1===e.isDefaultPrevented()&&(t=i,n=a,r=e,o=gt().os,Bx([{keyCode:nd.RIGHT,action:Ox(wx,t,!0)},{keyCode:nd.LEFT,action:Ox(wx,t,!1)},{keyCode:nd.UP,action:Ox(xx,t,!1)},{keyCode:nd.DOWN,action:Ox(xx,t,!0)},{keyCode:nd.RIGHT,action:Ox(Jx,t,!0)},{keyCode:nd.LEFT,action:Ox(Jx,t,!1)},{keyCode:nd.UP,action:Ox(Qx,t,!1)},{keyCode:nd.DOWN,action:Ox(Qx,t,!0)},{keyCode:nd.RIGHT,action:Ox(Px,t,!0)},{keyCode:nd.LEFT,action:Ox(Px,t,!1)},{keyCode:nd.UP,action:Ox(Lx,t,!1)},{keyCode:nd.DOWN,action:Ox(Lx,t,!0)},{keyCode:nd.RIGHT,action:Ox(zw,t,n,!0)},{keyCode:nd.LEFT,action:Ox(zw,t,n,!1)},{keyCode:nd.RIGHT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:Ox(Vw,t,n)},{keyCode:nd.LEFT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:Ox(qw,t,n)},{keyCode:nd.UP,action:Ox(Tx,t,!1)},{keyCode:nd.DOWN,action:Ox(Tx,t,!0)}],r).each(function(e){r.preventDefault()}))})},eS=function(o,i){o.on("keydown",function(e){var t,n,r;!1===e.isDefaultPrevented()&&(t=o,n=i,r=e,Bx([{keyCode:nd.BACKSPACE,action:Ox(sx,t,!1)},{keyCode:nd.BACKSPACE,action:Ox(NC,t,!1)},{keyCode:nd.DELETE,action:Ox(NC,t,!0)},{keyCode:nd.BACKSPACE,action:Ox(pC,t,!1)},{keyCode:nd.DELETE,action:Ox(pC,t,!0)},{keyCode:nd.BACKSPACE,action:Ox(Yw,t,n,!1)},{keyCode:nd.DELETE,action:Ox(Yw,t,n,!0)},{keyCode:nd.BACKSPACE,action:Ox(Pp,t,!1)},{keyCode:nd.DELETE,action:Ox(Pp,t,!0)},{keyCode:nd.BACKSPACE,action:Ox(EC,t,!1)},{keyCode:nd.DELETE,action:Ox(EC,t,!0)},{keyCode:nd.BACKSPACE,action:Ox(tx,t,!1)},{keyCode:nd.DELETE,action:Ox(tx,t,!0)},{keyCode:nd.BACKSPACE,action:Ox(iC,t,!1)},{keyCode:nd.DELETE,action:Ox(iC,t,!0)},{keyCode:nd.BACKSPACE,action:Ox(tC,t,!1)},{keyCode:nd.DELETE,action:Ox(tC,t,!0)},{keyCode:nd.BACKSPACE,action:Ox(Zw,t,!1)},{keyCode:nd.DELETE,action:Ox(Zw,t,!0)}],r).each(function(e){r.preventDefault()}))}),o.on("keyup",function(e){var t,n;!1===e.isDefaultPrevented()&&(t=o,n=e,Bx([{keyCode:nd.BACKSPACE,action:Ox(SC,t)},{keyCode:nd.DELETE,action:Ox(SC,t)}],n))})},tS=function(e,t){var n,r,o=t,i=e.dom,a=e.schema.getMoveCaretBeforeOnEnterElements();if(t){!/^(LI|DT|DD)$/.test(t.nodeName)||(r=function(e){for(;e;){if(1===e.nodeType||3===e.nodeType&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}}(t.firstChild))&&/^(UL|OL|DL)$/.test(r.nodeName)&&t.insertBefore(i.doc.createTextNode(mo),t.firstChild);var u=i.createRng();if(t.normalize(),t.hasChildNodes()){for(var s=new Gr(t,t);n=s.current();){if(Fn(n)){u.setStart(n,0),u.setEnd(n,0);break}if(a[n.nodeName.toLowerCase()]){u.setStartBefore(n),u.setEndBefore(n);break}o=n,n=s.next()}n||(u.setStart(o,0),u.setEnd(o,0))}else Hn(t)?t.nextSibling&&i.isBlock(t.nextSibling)?(u.setStartBefore(t),u.setEndBefore(t)):(u.setStartAfter(t),u.setEndAfter(t)):(u.setStart(t,0),u.setEnd(t,0));e.selection.setRng(u),Hd(e,u)}},nS=function(e){return U.from(e.dom.getParent(e.selection.getStart(!0),e.dom.isBlock))},rS=function(e,t){return e&&e.parentNode&&e.parentNode.nodeName===t},oS=function(e){return e&&/^(OL|UL|LI)$/.test(e.nodeName)},iS=function(e){var t=e.parentNode;return/^(LI|DT|DD)$/.test(t.nodeName)?t:e},aS=function(e,t,n){for(var r=e[n?"firstChild":"lastChild"];r&&!Tn(r);)r=r[n?"nextSibling":"previousSibling"];return r===t},uS=function(e,t,n,r,o){var i,a,u,s,c,l,f,d,m,g=e.dom,p=e.selection.getRng();n!==e.getBody()&&(oS(i=n)&&oS(i.parentNode)&&(o="LI"),a=o?t(o):g.create("BR"),aS(n,r,!0)&&aS(n,r,!1)?rS(n,"LI")?(u=iS(n),g.insertAfter(a,u),(null===(m=(d=n).parentNode)||void 0===m?void 0:m.firstChild)===d?g.remove(u):g.remove(n)):g.replace(a,n):(aS(n,r,!0)?rS(n,"LI")?(g.insertAfter(a,iS(n)),a.appendChild(g.doc.createTextNode(" ")),a.appendChild(n)):n.parentNode.insertBefore(a,n):aS(n,r,!1)?g.insertAfter(a,iS(n)):(n=iS(n),(s=p.cloneRange()).setStartAfter(r),s.setEndAfter(n),c=s.extractContents(),"LI"===o&&(f="LI",(l=c).firstChild&&l.firstChild.nodeName===f)?(a=c.firstChild,g.insertAfter(c,n)):(g.insertAfter(c,n),g.insertAfter(a,n))),g.remove(r)),tS(e,a))},sS=function(e){e.innerHTML='
'},cS=function(e,t){return e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t},lS=function(e,t){return t&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&"true"!==e.getContentEditable(t)},fS=function(e,t,n){return!1===Fn(t)?n:e?1===n&&t.data.charAt(n-1)===go?0:n:n===t.data.length-1&&t.data.charAt(n)===go?t.data.length:n},dS=function(e,t){for(var n,r=e.getRoot(),o=t;o!==r&&"false"!==e.getContentEditable(o);)"true"===e.getContentEditable(o)&&(n=o),o=o.parentNode;return o!==r?n:r},mS=function(e,t){var n=fc(e);n&&n.toLowerCase()===t.tagName.toLowerCase()&&function(e,o,t){var i=e.dom;U.from(t.style).map(i.parseStyle).each(function(e){var t=ir(Tt.fromDom(o)),n=_e(_e({},t),e);i.setStyles(o,n)});var n=U.from(t["class"]).map(function(e){return e.split(/\s+/)}),r=U.from(o.className).map(function(e){return H(e.split(/\s+/),function(e){return""!==e})});us(n,r,function(t,e){var n=H(e,function(e){return!M(t,e)}),r=Ae(t,n);i.setAttrib(o,"class",r.join(" "))});var a=["style","class"],u=ge(t,function(e,t){return!M(a,t)});i.setAttribs(o,u)}(e,t,dc(e))},gS=function(a,e){var t,u,i,s,n,r,o,c,l,f=a.dom,d=a.schema,m=d.getNonEmptyElements(),g=a.selection.getRng(),p=function(e){var t,n=u,r=d.getTextInlineElements(),o=e||"TABLE"===c||"HR"===c?f.create(e||N):s.cloneNode(!1),i=o;if(!1===a.getParam("keep_styles",!0))f.setAttrib(o,"style",null),f.setAttrib(o,"class",null);else do{if(r[n.nodeName]){if(Ul(n)||Yl(n))continue;t=n.cloneNode(!1),f.setAttrib(t,"id",""),o.hasChildNodes()?t.appendChild(o.firstChild):i=t,o.appendChild(t)}}while((n=n.parentNode)&&n!==E);return mS(a,o),sS(i),o},h=function(e){var t,n,r=fS(e,u,i);if(Fn(u)&&(e?0u.childNodes.length-1,u=u.childNodes[Math.min(i,u.childNodes.length-1)]||u,i=l&&Fn(u)?u.nodeValue.length:0);var C,w,x,S,N,E=dS(f,u);E&&((N&&!y||!N&&y)&&(u=function(e,t,n,r,o){var i,a,u,s,c,l,f=t||"P",d=e.dom,m=dS(d,r),g=d.getParent(r,d.isBlock);if(!g||!lS(d,g)){if(c=(g=g||m)===e.getBody()||(l=g)&&/^(TD|TH|CAPTION)$/.test(l.nodeName)?g.nodeName.toLowerCase():g.parentNode.nodeName.toLowerCase(),!g.hasChildNodes())return i=d.create(f),mS(e,i),g.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(u=r;u.parentNode!==g;)u=u.parentNode;for(;u&&!d.isBlock(u);)u=(a=u).previousSibling;if(a&&e.schema.isValidChild(c,f.toLowerCase())){for(i=d.create(f),mS(e,i),a.parentNode.insertBefore(i,a),u=a;u&&!d.isBlock(u);)s=u.nextSibling,i.appendChild(u),u=s;n.setStart(r,o),n.setEnd(r,o)}}return r}(a,N,g,u,i)),s=f.getParent(u,f.isBlock),o=s?f.getParent(s.parentNode,f.isBlock):null,c=s?s.nodeName.toUpperCase():"","LI"!==(C=o?o.nodeName.toUpperCase():"")||b||(o=(s=o).parentNode,c=C),/^(LI|DT|DD)$/.test(c)&&f.isEmpty(s)?uS(a,p,o,s,N):N&&s===a.getBody()||(N=N||"P",bo(s)?(n=Ao(s),f.isEmpty(s)&&sS(s),mS(a,n),tS(a,n)):h()?v():h(!0)?(n=s.parentNode.insertBefore(p(),s),tS(a,cS(s,"HR")?n:s)):((S=(x=g).cloneRange()).setStart(x.startContainer,fS(!0,x.startContainer,x.startOffset)),S.setEnd(x.endContainer,fS(!1,x.endContainer,x.endOffset)),(t=S.cloneRange()).setEndAfter(s),r=t.extractContents(),w=r,Y(qu(Tt.fromDom(w),jt),function(e){var t=e.dom;t.nodeValue=ho(t.nodeValue)}),function(e){for(;Fn(e)&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;);}(r),n=r.firstChild,f.insertAfter(r,s),function(e,t,n){var r,o,i,a=n,u=[];if(a){for(;a=a.firstChild;){if(e.isBlock(a))return;Tn(a)&&!t[a.nodeName.toLowerCase()]&&u.push(a)}for(r=u.length;r--;)!(a=u[r]).hasChildNodes()||a.firstChild===a.lastChild&&""===a.firstChild.nodeValue?e.remove(a):(o=e,(i=a)&&"A"===i.nodeName&&o.isEmpty(i)&&e.remove(a))}}(f,m,n),function(e,t){t.normalize();var n=t.lastChild;n&&!/^(left|right)$/gi.test(e.getStyle(n,"float",!0))||e.add(t,"br")}(f,s),f.isEmpty(s)&&sS(s),n.normalize(),f.isEmpty(n)?(f.remove(n),v()):(mS(a,n),tS(a,n))),f.setAttrib(n,"id",""),a.fire("NewBlock",{newBlock:n})))},pS=function(e,t,n){var r=e.dom.createRng();n?(r.setStartBefore(t),r.setEndBefore(t)):(r.setStartAfter(t),r.setEndAfter(t)),e.selection.setRng(r),Hd(e,r)},hS=function(e,t){var n,r,o=e.selection,i=e.dom,a=o.getRng();md(i,a).each(function(e){a.setStart(e.startContainer,e.startOffset),a.setEnd(e.endContainer,e.endOffset)});var u,s=a.startOffset,c=a.startContainer;1===c.nodeType&&c.hasChildNodes()&&(u=s>c.childNodes.length-1,c=c.childNodes[Math.min(s,c.childNodes.length-1)]||c,s=u&&3===c.nodeType?c.nodeValue.length:0);var l=i.getParent(c,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",m=!(!t||!t.ctrlKey);"LI"!==d||m||(l=f),c&&3===c.nodeType&&s>=c.nodeValue.length&&!function(e,t,n){for(var r,o=new Gr(t,n),i=e.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||0a&&(s=r.pageX+o-a),r.pageY+i>u&&(c=r.pageY+i-u),n.style.width=o-s+"px",n.style.height=i-c+"px",v(p.clientX,p.clientY))})}},dN=function(e,l){return function(c){e.on(function(e){var t,n,r,o,i,a,u,s;e.dragging&&(u=(o=l).selection,s=u.getSel().getRangeAt(0).startContainer,i=3===s.nodeType?s.parentNode:s,a=e.element,i===a||o.dom.isChildOf(i,a)||uN(i)||(n=e.element,(r=n.cloneNode(!0)).removeAttribute("data-mce-selected"),t=r,l.fire("drop",{clientX:c.clientX,clientY:c.clientY}).isDefaultPrevented()||l.undoManager.transact(function(){cN(e.element),l.insertContent(l.dom.getOuterHTML(t)),l._selectionOverrides.hideFakeCaret()})))}),mN(e)}},mN=function(e){e.on(function(e){cN(e.ghost)}),e.clear()},gN=function(e){var t,n,r,o=(t=Ru(U.none()),{clear:function(){return t.set(U.none())},set:function(e){return t.set(U.some(e))},isSet:function(){return t.get().isSome()},on:function(e){return t.get().each(e)}}),i=Su.DOM,a=document,u=lN(o,e),s=fN(o,e),c=dN(o,e),l=(n=o,function(){n.on(function(e){e.dragging&&r.fire("dragend")}),mN(n)});(r=e).on("mousedown",u),e.on("mousemove",s),e.on("mouseup",c),i.bind(a,"mousemove",s),i.bind(a,"mouseup",l),e.on("remove",function(){i.unbind(a,"mousemove",s),i.unbind(a,"mouseup",l)})},pN=function(e){var n,i,a,u,t;gN(e),(n=e).on("drop",function(e){var t="undefined"!=typeof e.clientX?n.getDoc().elementFromPoint(e.clientX,e.clientY):null;!uN(t)&&"false"!==n.dom.getContentEditableParent(t)||e.preventDefault()}),e.getParam("block_unsupported_drop",!0,"boolean")&&(a=function(e){var t;e.isDefaultPrevented()||(t=e.dataTransfer)&&(M(t.types,"Files")||0').attr("id",g)).appendTo(u.getBody());var i=l.createRng();t===n&&St.ie?(o.empty().append('\xa0
').append(t),i.setStartAfter(o[0].firstChild.firstChild),i.setEndAfter(t)):(o.empty().append(mo).append(t).append(mo),i.setStart(o[0].firstChild,1),i.setEnd(o[0].lastChild,0)),o.css({top:l.getPos(e,u.getBody()).y}),o[0].focus();var a=c.getSel();return a.removeAllRanges(),a.addRange(i),i}(e,n.targetClone,t),o=Tt.fromDom(e);return Y($u(Tt.fromDom(u.getBody()),"*[data-mce-selected]"),function(e){Pt(o,e)||er(e,i)}),l.getAttrib(e,i)||e.setAttribute(i,"1"),s=e,S(),r},w=function(e,t){if(!e)return null;if(e.collapsed){if(!y(e)){var n=t?1:-1,r=ul(n,d,e),o=r.getNode(!t);if(Hc(o))return v(n,o,!!t&&!r.isAtEnd(),!1);var i=r.getNode(t);if(Hc(i))return v(n,i,!t&&!r.isAtEnd(),!1)}return null}var a=e.startContainer,u=e.startOffset,s=e.endOffset;if(3===a.nodeType&&0===u&&vN(a.parentNode)&&(a=a.parentNode,u=l.nodeIndex(a),a=a.parentNode),1!==a.nodeType)return null;if(s===u+1&&a===e.endContainer){var c=a.childNodes[u];if(p(c))return C(c)}return null},x=function(){s&&s.removeAttribute(i),Lr(Tt.fromDom(u.getBody()),"#"+g).each(hn),s=null},S=function(){m.hide()};return St.ceFalse&&!Iv(u)&&function(){u.on("mouseup",function(e){var t=r();t.collapsed&&Jy(u,e.clientX,e.clientY)&&lC(u,t,!1).each(h)}),u.on("click",function(e){var t=yN(u,e.target);t&&(vN(t)&&(e.preventDefault(),u.focus()),hN(t)&&l.isChildOf(t,c.getNode())&&x())}),u.on("blur NewBlock",x),u.on("ResizeWindow FullscreenStateChanged",m.reposition);var a=function(e){var t=El(e);if(!e.firstChild)return!1;var n,r=Ms.before(e.firstChild),o=t.next(r);return o&&!(fg(n=o)||dg(n)||ug(n)||sg(n))},i=function(e,t){var n,r,o=l.getParent(e,f),i=l.getParent(t,f);return!(!o||e===i||!l.isChildOf(o,i)||!1!==vN(yN(u,o)))||o&&(n=o,r=i,!(l.getParent(n,f)===l.getParent(r,f)))&&a(o)};u.on("tap",function(e){var t=e.target,n=yN(u,t);vN(n)?(e.preventDefault(),cC(u,n).each(w)):p(t)&&cC(u,t).each(w)},!0),u.on("mousedown",function(e){var t,n,r,o=e.target;o!==d&&"HTML"!==o.nodeName&&!l.isChildOf(o,d)||!1===Jy(u,e.clientX,e.clientY)||((t=yN(u,o))?vN(t)?(e.preventDefault(),cC(u,t).each(w)):(x(),hN(t)&&e.shiftKey||ed(e.clientX,e.clientY,c.getRng())||(S(),c.placeCaretAt(e.clientX,e.clientY))):p(o)?cC(u,o).each(w):!1===Hc(o)&&(x(),S(),(n=Rw(d,e.clientX,e.clientY))&&(i(o,n.node)||(e.preventDefault(),r=v(1,n.node,n.before,!1),u.getBody().focus(),h(r)))))}),u.on("keypress",function(e){nd.modifierPressed(e)||vN(c.getNode())&&e.preventDefault()}),u.on("GetSelectionRange",function(e){var t=e.range;if(s){if(!s.parentNode)return void(s=null);(t=t.cloneRange()).selectNode(s),e.range=t}}),u.on("SetSelectionRange",function(e){e.range=b(e.range);var t=w(e.range,e.forward);t&&(e.range=t)});var n,e,o;u.on("AfterSetSelectionRange",function(e){var t,n=e.range,r=n.startContainer.parentNode;y(n)||"mcepastebin"===r.id||S(),t=r,l.hasClass(t,"mce-offscreen-selection")||x()}),u.on("copy",function(e){var t,n,r=e.clipboardData;e.isDefaultPrevented()||!e.clipboardData||St.ie||(t=(n=l.get(g))?n.getElementsByTagName("*")[0]:n)&&(e.preventDefault(),r.clearData(),r.setData("text/html",t.outerHTML),r.setData("text/plain",t.outerText||t.innerText))}),pN(u),e=Lu(function(){var e,t;n.removed||!n.getBody().contains(document.activeElement)||(e=n.selection.getRng()).collapsed&&(t=fC(n,e,!1),n.selection.setRng(t))},0),(n=u).on("focus",function(){e.throttle()}),n.on("blur",function(){e.cancel()}),(o=u).on("init",function(){o.on("focusin",function(e){var t,n,r=e.target;Kn(r)&&(t=Zf(o.getBody(),r),n=$n(t)?t:r,o.selection.getNode()!==n&&cC(o,n).each(function(e){return o.selection.setRng(e)}))})})}(),{showCaret:v,showBlockCaretContainer:function(e){e.hasAttribute("data-mce-caret")&&(Ao(e),h(r()),c.scrollIntoView(e))},hideFakeCaret:S,destroy:function(){m.destroy(),s=null}}},CN=function(s){var n,r,o=At.each,c=nd.BACKSPACE,l=nd.DELETE,f=s.dom,d=s.selection,e=s.parser,t=St.gecko,i=St.ie,a=St.webkit,u="data:text/mce-internal,",m=i?"Text":"URL",g=function(e,t){try{s.getDoc().execCommand(e,!1,t)}catch(n){}},p=function(e){return e.isDefaultPrevented()},h=function(){var u=function(e){var t=f.create("body"),n=e.cloneContents();return t.appendChild(n),d.serializer.serialize(t,{format:"html"})};s.on("keydown",function(e){var t,n,r,o,i,a=e.keyCode;if(!p(e)&&(a===l||a===c)){if(t=s.selection.isCollapsed(),n=s.getBody(),t&&!f.isEmpty(n))return;if(!t&&(r=s.selection.getRng(),o=u(r),(i=f.createRng()).selectNode(s.getBody()),o!==u(i)))return;e.preventDefault(),s.setContent(""),n.firstChild&&f.isBlock(n.firstChild)?s.selection.setCursorLocation(n.firstChild,0):s.selection.setCursorLocation(n,0),s.nodeChanged()}})},v=function(){s.shortcuts.add("meta+a",null,"SelectAll")},y=function(){Range.prototype.getClientRects||s.on("mousedown",function(e){var t;p(e)||"HTML"!==e.target.nodeName||((t=s.getBody()).blur(),Kr.setEditorTimeout(s,function(){t.focus()}))})},b=function(){s.on("click",function(e){var t=e.target;/^(IMG|HR)$/.test(t.nodeName)&&"false"!==f.getContentEditableParent(t)&&(e.preventDefault(),s.selection.select(t),s.nodeChanged()),"A"===t.nodeName&&f.hasClass(t,"mce-item-anchor")&&(e.preventDefault(),d.select(t))})},C=function(){s.on("keydown",function(e){if(!p(e)&&e.keyCode===c&&d.isCollapsed()&&0===d.getRng().startOffset){var t=d.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})},w=function(){s.getParam("readonly")||s.on("BeforeExecCommand mousedown",function(){g("StyleWithCSS",!1),g("enableInlineTableEditing",!1),bc(s)||g("enableObjectResizing",!1)})},x=function(){s.on("SetContent ExecCommand",function(e){"setcontent"!==e.type&&"mceInsertLink"!==e.command||o(f.select("a"),function(e){var t=e.parentNode,n=f.getRoot();if(t.lastChild===e){for(;t&&!f.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}f.add(t,"br",{"data-mce-bogus":1})}})})},S=function(){s.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")},N=function(){s.inline||s.on("keydown",function(){document.activeElement===document.body&&s.getWin().focus()})},E=function(){s.inline||(s.contentStyles.push("body {min-height: 150px}"),s.on("click",function(e){var t;if("HTML"===e.target.nodeName){if(11")+"";e.getParam("document_base_url","")!==e.documentBaseUrl&&(t+=''),t+='';var n=cc(e,"body_id","tinymce"),r=cc(e,"body_class","");return lc(e)&&(t+=''),t+='
'},ON=function(e,t){var n,r,o,i,a=e.editorManager.translate("Rich Text Area. Press ALT-0 for help."),u=(n=e.id,r=a,t.height,o=e.getParam("iframe_attrs",{}),i=Tt.fromTag("iframe"),Jn(i,o),Jn(i,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:r}),ju(i,"tox-edit-area__iframe"),i.dom);u.onload=function(){u.onload=null,e.fire("load")};var s=function(e,t){if(document.domain!==window.location.hostname&&St.browser.isIE()){var n=hb("mce");e[n]=function(){RN(e)};var r='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+e.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return TN.setAttrib(t,"src",r),!0}return!1}(e,u);return e.contentAreaContainer=t.iframeContainer,e.iframeElement=u,e.iframeHTML=DN(e),TN.add(t.iframeContainer,u),s},BN=Su.DOM,PN=function(t,n,e){var r=eb.get(e),o=eb.urls[e]||t.documentBaseUrl.replace(/\/$/,"");if(e=At.trim(e),r&&-1===At.inArray(n,e)){if(At.each(eb.dependencies(e),function(e){PN(t,n,e)}),t.plugins[e])return;try{var i=new r(t,o,t.$);(t.plugins[e]=i).init&&(i.init(t,o),n.push(e))}catch(zk){!function(e,t,n){var r=Bu.translate(["Failed to initialize plugin: {0}",t]);td(e,"PluginLoadError",{message:r}),lb(r,n),ab(e,r)}(t,e,zk)}}},LN=function(e){return e.replace(/^\-/,"")},IN=function(e){return{editorContainer:e,iframeContainer:e,api:{}}},MN=function(e){var t,n,r=e.getElement();return e.inline?IN(null):(t=r,n=BN.create("div"),BN.insertAfter(n,t),IN(n))},FN=function(e){var t,n,r,o=e.getElement();return e.orgDisplay=o.style.display,K(wc(e))?e.theme.renderUI():m(wc(e))?(n=(t=e).getElement(),(r=wc(t)(t,n)).editorContainer.nodeType&&(r.editorContainer.id=r.editorContainer.id||t.id+"_parent"),r.iframeContainer&&r.iframeContainer.nodeType&&(r.iframeContainer.id=r.iframeContainer.id||t.id+"_iframecontainer"),r.height=r.iframeHeight?r.iframeHeight:n.offsetHeight,r):MN(e)},UN=function(e){var n,t,r,o,i,a,u,s,c;e.fire("ScriptsLoaded"),n=e,t=At.trim(gc(n)),r=n.ui.registry.getAll().icons,o=_e(_e({},qy.get("default").icons),qy.get(t).icons),se(o,function(e,t){ve(r,t)||n.ui.registry.addIcon(t,e)}),u=wc(i=e),K(u)?(i.settings.theme=LN(u),a=tb.get(u),i.theme=new a(i,tb.urls[u]),i.theme.init&&i.theme.init(i,tb.urls[u]||i.documentBaseUrl.replace(/\/$/,""),i.$)):i.theme={},s=e,c=[],At.each(Sc(s).split(/[ ,]/),function(e){PN(s,c,LN(e))});var l,f,d,m=FN(e);l=e,f=U.from(m.api).getOr({}),d={show:U.from(f.show).getOr(te),hide:U.from(f.hide).getOr(te),disable:U.from(f.disable).getOr(te),isDisabled:U.from(f.isDisabled).getOr(A),enable:function(){l.mode.isReadOnly()||U.from(f.enable).map(_)}},l.ui=_e(_e({},l.ui),d);var g,p,h,v={editorContainer:m.editorContainer,iframeContainer:m.iframeContainer};return e.editorContainer=v.editorContainer?v.editorContainer:null,mb(e),e.inline?RN(e):(h=ON(g=e,p=v),p.editorContainer&&(TN.get(p.editorContainer).style.display=g.orgDisplay,g.hidden=TN.isHidden(p.editorContainer)),g.getElement().style.display="none",TN.setAttrib(g.id,"aria-hidden","true"),void(h||RN(g)))},zN=Su.DOM,jN=function(e){return"-"===e.charAt(0)},HN=function(e,t){var n,r=hc(t),o=t.getParam("language_url","","string");!1===Bu.hasCode(r)&&"en"!==r&&(n=""!==o?o:t.editorManager.baseURL+"/langs/"+r+".js",e.add(n,te,undefined,function(){ub(t,"LanguageLoadError",sb("language",n,r))}))},VN=function(t,e,n){return U.from(e).filter(function(e){return 0")},mceToggleVisualAid:function(){i.hasVisual=!i.hasVisual,i.addVisual()},mceReplaceContent:function(e,t,n){i.execCommand("mceInsertContent",!1,n.replace(/\{\$selection\}/g,i.selection.getContent({format:"text"})))},mceInsertLink:function(e,t,n){"string"==typeof n&&(n={href:n});var r=i.dom.getParent(i.selection.getNode(),"a");n.href=n.href.replace(/ /g,"%20"),r&&n.href||i.formatter.remove("link"),n.href&&i.formatter.apply("link",n,r)},selectAll:function(){var e,t=i.dom.getParent(i.selection.getStart(),qn);t&&((e=i.dom.createRng()).selectNodeContents(t),i.selection.setRng(e))},mceNewDocument:function(){i.setContent("")},InsertLineBreak:function(e,t,n){return SS(i,n),!0}});var e=function(r){return function(){var e=i.selection,t=e.isCollapsed()?[i.dom.getParent(e.getNode(),i.dom.isBlock)]:e.getSelectedBlocks(),n=iE(t,function(e){return!!i.formatter.matchNode(e,r)});return-1!==aE(n,!0)}};a.addCommands({JustifyLeft:e("alignleft"),JustifyCenter:e("aligncenter"),JustifyRight:e("alignright"),JustifyFull:e("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return a.isFormatMatch(e)},mceBlockQuote:function(){return a.isFormatMatch("blockquote")},Outdent:function(){return ox(i)},"InsertUnorderedList,InsertOrderedList":function(e){var t=i.dom.getParent(i.selection.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),a.addCommands({Undo:function(){i.undoManager.undo()},Redo:function(){i.undoManager.redo()}}),a.addQueryValueHandler("FontName",function(){return eE(t=i,function(e){return QN(t.getBody(),e.dom)}).getOr("");var t},this),a.addQueryValueHandler("FontSize",function(){return eE(t=i,function(e){return JN(t.getBody(),e.dom)}).getOr("");var t},this),a.addQueryValueHandler("LineHeight",function(){return eE(t=i,function(n){var e=Tt.fromDom(t.getBody());return th(n,function(e){return or(e,"line-height")},k(Pt,e)).getOrThunk(function(){var e=parseFloat(nr(n,"line-height")),t=parseFloat(nr(n,"font-size"));return String(e/t)})}).getOr("");var t},this)},sE);function sE(e){this.commands={state:{},exec:{},value:{}},this.editor=e,this.setupCommands(e)}var cE="data-mce-contenteditable",lE=function(e,t,n){var r,o;Vu(e,t)&&!1===n?(o=t,Fu(r=e)?r.dom.classList.remove(o):zu(r,o),Hu(r)):n&&ju(e,t)},fE=function(e,t,n){try{e.getDoc().execCommand(t,!1,String(n))}catch(r){}},dE=function(e,t){e.dom.contentEditable=t?"true":"false"},mE=function(e,t){var n,r,o,i=Tt.fromDom(e.getBody());lE(i,"mce-content-readonly",t),t?(e.selection.controlSelection.hideResizeRect(),e._selectionOverrides.hideFakeCaret(),o=e,U.from(o.selection.getNode()).each(function(e){e.removeAttribute("data-mce-selected")}),e.readonly=!0,dE(i,!1),Y($u(i,'*[contenteditable="true"]'),function(e){Gn(e,cE,"true"),dE(e,!1)})):(e.readonly=!1,dE(i,!0),Y($u(i,"*["+cE+'="true"]'),function(e){er(e,cE),dE(e,!0)}),fE(e,"StyleWithCSS",!1),fE(e,"enableInlineTableEditing",!1),fE(e,"enableObjectResizing",!1),(bm(r=e)||ym(r))&&e.focus(),(n=e).selection.setRng(n.selection.getRng()),e.nodeChanged())},gE=function(e){return e.readonly},pE=function(t){t.parser.addAttributeFilter("contenteditable",function(e){gE(t)&&Y(e,function(e){e.attr(cE,e.attr("contenteditable")),e.attr("contenteditable","false")})}),t.serializer.addAttributeFilter(cE,function(e){gE(t)&&Y(e,function(e){e.attr("contenteditable",e.attr(cE))})}),t.serializer.addTempAttr(cE)},hE=function(a,u){var e,t;"click"!==u.type||nd.metaKeyPressed(u)||(e=Tt.fromDom(u.target),t=a,Ir(e,"a",function(e){return Pt(e,Tt.fromDom(t.getBody()))}).bind(function(e){return Zn(e,"href")}).each(function(e){var t,n,r,o,i;u.preventDefault(),/^#/.test(e)?(t=a.dom.select(e+',[name="'+(qe(n=e,r="#")?(o=n,i=r.length,o.substring(i)):n)+'"]')).length&&a.selection.scrollIntoView(t[0],!0):window.open(e,"_blank","rel=noopener noreferrer,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,scrollbars=yes")}))},vE=At.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel"," "),yE=(bE.isNative=function(e){return!!vE[e.toLowerCase()]},bE.prototype.fire=function(e,t){var n=e.toLowerCase(),r=t||{};r.type=n,r.target||(r.target=this.scope),r.preventDefault||(r.preventDefault=function(){r.isDefaultPrevented=R},r.stopPropagation=function(){r.isPropagationStopped=R},r.stopImmediatePropagation=function(){r.isImmediatePropagationStopped=R},r.isDefaultPrevented=A,r.isPropagationStopped=A,r.isImmediatePropagationStopped=A),this.settings.beforeFire&&this.settings.beforeFire(r);var o=this.bindings[n];if(o)for(var i=0,a=o.length;i"),LE);return o[o.length-1]=At.extend(o[o.length-1],{func:n,scope:r||this.editor}),At.extend(o[0],{desc:this.editor.translate(t),subpatterns:o.slice(1)})},ME.prototype.hasModifier=function(e){return e.altKey||e.ctrlKey||e.metaKey},ME.prototype.isFunctionKey=function(e){return"keydown"===e.type&&112<=e.keyCode&&e.keyCode<=123},ME.prototype.matchShortcut=function(e,t){return!!t&&t.ctrl===e.ctrlKey&&t.meta===e.metaKey&&t.alt===e.altKey&&t.shift===e.shiftKey&&!!(e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode)&&(e.preventDefault(),!0)},ME.prototype.executeShortcutAction=function(e){return e.func?e.func.call(e.scope):null},ME);function ME(e){this.shortcuts={},this.pendingPatterns=[],this.editor=e;var n=this;e.on("keyup keypress keydown",function(t){!n.hasModifier(t)&&!n.isFunctionKey(t)||t.isDefaultPrevented()||(DE(n.shortcuts,function(e){if(n.matchShortcut(t,e))return n.pendingPatterns=e.subpatterns.slice(0),"keydown"===t.type&&n.executeShortcutAction(e),!0}),n.matchShortcut(t,n.pendingPatterns[0])&&(1===n.pendingPatterns.length&&"keydown"===t.type&&n.executeShortcutAction(n.pendingPatterns[0]),n.pendingPatterns.shift()))})}var FE=function(){var e,t,n,r,o,i,a,u,s=(t={},n={},r={},o={},i={},a={},{addButton:(u=function(n,r){return function(e,t){return n[e.toLowerCase()]=_e(_e({},t),{type:r})}})(e={},"button"),addGroupToolbarButton:u(e,"grouptoolbarbutton"),addToggleButton:u(e,"togglebutton"),addMenuButton:u(e,"menubutton"),addSplitButton:u(e,"splitbutton"),addMenuItem:u(t,"menuitem"),addNestedMenuItem:u(t,"nestedmenuitem"),addToggleMenuItem:u(t,"togglemenuitem"),addAutocompleter:u(n,"autocompleter"),addContextMenu:u(o,"contextmenu"),addContextToolbar:u(i,"contexttoolbar"),addContextForm:u(i,"contextform"),addSidebar:u(a,"sidebar"),addIcon:function(e,t){return r[e.toLowerCase()]=t},getAll:function(){return{buttons:e,menuItems:t,icons:r,popups:n,contextMenus:o,contextToolbars:i,sidebars:a}}});return{addAutocompleter:s.addAutocompleter,addButton:s.addButton,addContextForm:s.addContextForm,addContextMenu:s.addContextMenu,addContextToolbar:s.addContextToolbar,addIcon:s.addIcon,addMenuButton:s.addMenuButton,addMenuItem:s.addMenuItem,addNestedMenuItem:s.addNestedMenuItem,addSidebar:s.addSidebar,addSplitButton:s.addSplitButton,addToggleButton:s.addToggleButton,addGroupToolbarButton:s.addGroupToolbarButton,addToggleMenuItem:s.addToggleMenuItem,getAll:s.getAll}},UE=At.each,zE=At.trim,jE="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),HE={ftp:21,http:80,https:443,mailto:25},VE=(qE.parseDataUri=function(e){var t,n=decodeURIComponent(e).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(t=r[1]),{type:t,data:n[1]}},qE.getDocumentBaseUrl=function(e){var t=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?e.href:e.protocol+"//"+e.host+e.pathname;return/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),t},qE.prototype.setPath=function(e){var t=/^(.*?)\/?(\w+)?$/.exec(e);this.path=t[0],this.directory=t[1],this.file=t[2],this.source="",this.getURI()},qE.prototype.toRelative=function(e){var t;if("./"===e)return e;var n=new qE(e,{base_uri:this});if("mce_host"!==n.host&&this.host!==n.host&&n.host||this.port!==n.port||this.protocol!==n.protocol&&""!==n.protocol)return n.getURI();var r=this.getURI(),o=n.getURI();return r===o||"/"===r.charAt(r.length-1)&&r.substr(0,r.length-1)===o?r:(t=this.toRelPath(this.path,n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),t)},qE.prototype.toAbsolute=function(e,t){var n=new qE(e,{base_uri:this});return n.getURI(t&&this.isSameOrigin(n))},qE.prototype.isSameOrigin=function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=HE[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},qE.prototype.toRelPath=function(e,t){var n,r,o=0,i="",a=e.substring(0,e.lastIndexOf("/")).split("/"),u=t.split("/");if(a.length>=u.length)for(n=0,r=a.length;n=u.length||a[n]!==u[n]){o=n+1;break}if(a.length=a.length||a[n]!==u[n]){o=n+1;break}if(1===o)return t;for(n=0,r=a.length-(o-1);n=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(e,t){var n=vk(e.x,t.x),r=vk(e.y,t.y),o=hk(e.x+e.w,t.x+t.w),i=hk(e.y+e.h,t.y+t.h);return o-n<0||i-r<0?null:Ck(n,r,o-n,i-r)},clamp:function(e,t,n){var r=e.x,o=e.y,i=e.x+e.w,a=e.y+e.h,u=t.x+t.w,s=t.y+t.h,c=vk(0,t.x-r),l=vk(0,t.y-o),f=vk(0,i-u),d=vk(0,a-s);return r+=c,o+=l,n&&(i+=c,a+=l,r-=f,o-=d),Ck(r,o,(i-=f)-r,(a-=d)-o)},create:Ck,fromClientRect:function(e){return Ck(e.left,e.top,e.width,e.height)}},xk=(dk={},mk={},{load:function(r,o){var i='Script at URL "'+o+'" failed to load',a='Script at URL "'+o+"\" did not call `tinymce.Resource.add('"+r+"', data)` within 1 second";if(dk[r]!==undefined)return dk[r];var e=new Mr(function(e,t){var n=function(e,t,n){void 0===n&&(n=1e3);var r=!1,o=null,i=function(n){return function(){for(var e=[],t=0;t