/*!
* froala_editor v4.0.9 (https://www.froala.com/wysiwyg-editor)
* License https://froala.com/wysiwyg-editor/terms/
* Copyright 2014-2022 Froala Labs
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.FroalaEditor=t()}(this,function(){"use strict";function St(e){return(St="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;if(!document.documentElement.contains(t))return null;do{if(t.matches(e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null}),Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),n=t.length;0<=--n&&t.item(n)!==this;);return-1")},closeTagString:function u(e){return"".concat(e.tagName.toLowerCase(),">")},isFirstSibling:function h(e,t){void 0===t&&(t=!0);for(var n=e.previousSibling;n&&t&&i.node.hasClass(n,"fr-marker");)n=n.previousSibling;return!n||n.nodeType===Node.TEXT_NODE&&""===n.textContent&&h(n)},isLastSibling:function g(e,t){void 0===t&&(t=!0);for(var n=e.nextSibling;n&&t&&i.node.hasClass(n,"fr-marker");)n=n.nextSibling;return!n||n.nodeType===Node.TEXT_NODE&&""===n.textContent&&g(n)},isList:function m(e){return!!e&&0<=["UL","OL"].indexOf(e.tagName)},isLink:function v(e){return!!e&&e.nodeType===Node.ELEMENT_NODE&&"a"===e.tagName.toLowerCase()},isElement:r,contents:s,isVoid:function b(e){return e&&e.nodeType===Node.ELEMENT_NODE&&0<=kt.VOID_ELEMENTS.indexOf((e.tagName||"").toLowerCase())},hasFocus:function C(e){return e===i.doc.activeElement&&(!i.doc.hasFocus||i.doc.hasFocus())&&Boolean(r(e)||e.type||e.href||~e.tabIndex)},isEditable:function E(e){return(!e.getAttribute||"false"!==e.getAttribute("contenteditable"))&&["STYLE","SCRIPT"].indexOf(e.tagName)<0},isDeletable:function y(e){return e&&e.nodeType===Node.ELEMENT_NODE&&e.getAttribute("class")&&0<=(e.getAttribute("class")||"").indexOf("fr-deletable")},hasClass:function L(e,t){return e instanceof n&&(e=e.get(0)),e&&e.classList&&e.classList.contains(t)},filter:function _(e){return i.browser.msie?e:{acceptNode:e}}}},Object.assign(kt.DEFAULTS,{DOMPurify:window.DOMPurify,htmlAllowedTags:["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","br","button","canvas","caption","cite","code","col","colgroup","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meter","nav","noscript","object","ol","optgroup","option","output","p","param","pre","progress","queue","rp","rt","ruby","s","samp","script","style","section","select","small","source","span","strike","strong","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","var","video","wbr"],htmlRemoveTags:["script","style"],htmlAllowedAttrs:["accept","accept-charset","accesskey","action","align","allowfullscreen","allowtransparency","alt","async","autocomplete","autofocus","autoplay","autosave","background","bgcolor","border","charset","cellpadding","cellspacing","checked","cite","class","color","cols","colspan","content","contenteditable","contextmenu","controls","coords","data","data-.*","datetime","default","defer","dir","dirname","disabled","download","draggable","dropzone","enctype","for","form","formaction","frameborder","headers","height","hidden","high","href","hreflang","http-equiv","icon","id","ismap","itemprop","keytype","kind","label","lang","language","list","loop","low","max","maxlength","media","method","min","mozallowfullscreen","multiple","muted","name","novalidate","open","optimum","pattern","ping","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","reversed","rows","rowspan","sandbox","scope","scoped","scrolling","seamless","selected","shape","size","sizes","span","src","srcdoc","srclang","srcset","start","step","summary","spellcheck","style","tabindex","target","title","type","translate","usemap","value","valign","webkitallowfullscreen","width","wrap"],htmlAllowedStyleProps:[".*"],htmlAllowComments:!0,htmlUntouched:!1,fullPage:!1}),kt.HTML5Map={B:"STRONG",I:"EM",STRIKE:"S"},kt.MODULES.clean=function(f){var d,p,u,h,g=f.$;function a(e){if(e.nodeType===Node.ELEMENT_NODE&&e.getAttribute("class")&&0<=e.getAttribute("class").indexOf("fr-marker"))return!1;var t,n=f.node.contents(e),r=[];for(t=0;t/g,">"):e.textContent.replace(/&/g,"&").replace(//g,">").replace(/\u00A0/g," ").replace(/\u0009/g,"");if(e.nodeType!==Node.ELEMENT_NODE)return e.outerHTML;if(e.nodeType===Node.ELEMENT_NODE&&0<=["STYLE","SCRIPT","NOSCRIPT"].indexOf(e.tagName))return e.outerHTML;if(e.nodeType===Node.ELEMENT_NODE&&"svg"===e.tagName){var n=document.createElement("div"),r=e.cloneNode(!0);return n.appendChild(r),n.innerHTML}if("IFRAME"===e.tagName)return e.outerHTML.replace(/</g,"<").replace(/>/g,">");var a=e.childNodes;if(0===a.length)return e.outerHTML;for(var o="",i=0;i)<[^<]*)*<\/script>/gi,function(e){return l.push(e),"[FROALA.EDITOR.SCRIPT ".concat(l.length-1,"]")})).replace(/
",a.push(s))}for(o=a.length,i=0;i]*>\s*]*>/.test(c)&&(d=!0)}a[i]=c}return e=(e=(e=a.join("\n")).replace(/^\n+/g,"")).replace(/\n+$/g,""),n.converter._dispatch("paragraphs.after",e,t,n)}),L.subParser("runExtension",function(e,t,n,r){if(e.filter)t=e.filter(t,r.converter,n);else if(e.regex){var a=e.regex;a instanceof RegExp||(a=new RegExp(a,"g")),t=t.replace(a,e.replace)}return t}),L.subParser("spanGamut",function(e,t,n){return e=n.converter._dispatch("spanGamut.before",e,t,n),e=L.subParser("codeSpans")(e,t,n),e=L.subParser("escapeSpecialCharsWithinTagAttributes")(e,t,n),e=L.subParser("encodeBackslashEscapes")(e,t,n),e=L.subParser("images")(e,t,n),e=L.subParser("anchors")(e,t,n),e=L.subParser("autoLinks")(e,t,n),e=L.subParser("simplifiedAutoLinks")(e,t,n),e=L.subParser("emoji")(e,t,n),e=L.subParser("underline")(e,t,n),e=L.subParser("italicsAndBold")(e,t,n),e=L.subParser("strikethrough")(e,t,n),e=L.subParser("ellipsis")(e,t,n),e=L.subParser("hashHTMLSpans")(e,t,n),e=L.subParser("encodeAmpsAndAngles")(e,t,n),t.simpleLineBreaks?/\n\n\xa8K/.test(e)||(e=e.replace(/\n+/g,"
\n")):e=e.replace(/ +\n/g,"
\n"),e=n.converter._dispatch("spanGamut.after",e,t,n)}),L.subParser("strikethrough",function(e,r,a){return r.strikethrough&&(e=(e=a.converter._dispatch("strikethrough.before",e,r,a)).replace(/(?:~){2}([\s\S]+?)(?:~){2}/g,function(e,t){return function n(e){return r.simplifiedAutoLink&&(e=L.subParser("simplifiedAutoLinks")(e,r,a)),""+e+""}(t)}),e=a.converter._dispatch("strikethrough.after",e,r,a)),e}),L.subParser("stripLinkDefinitions",function(e,s,l){var c=function c(e,t,n,r,a,o,i){return t=t.toLowerCase(),n.match(/^data:.+?\/.+?;base64,/)?l.gUrls[t]=n.replace(/\s/g,""):l.gUrls[t]=L.subParser("encodeAmpsAndAngles")(n,s,l),o?o+i:(i&&(l.gTitles[t]=i.replace(/"|'/g,""")),s.parseImgDimensions&&r&&a&&(l.gDimensions[t]={width:r,height:a}),"")};return e=(e=(e=(e+="\xa80").replace(/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=\xa80)|(?=\n\[))/gm,c)).replace(/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*([^>\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=\xa80))/gm,c)).replace(/\xa80/,"")}),L.subParser("tables",function(e,v,b){if(!v.tables)return e;function t(e){var t,n=e.split("\n");for(t=0;t"+(a=L.subParser("spanGamut")(a,v,b))+"\n"));for(t=0;t"+L.subParser("spanGamut")(s,v,b)+"\n"));u.push(h)}return function m(e,t){for(var n="\n\n\n",r=e.length,a=0;a\n
\n\n",a=0;a\n";for(var o=0;o\n"}return n+="\n
\n"}(f,u)}return e=(e=(e=(e=b.converter._dispatch("tables.before",e,v,b)).replace(/\\(\|)/g,L.helper.escapeCharactersCallback)).replace(/^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|\xa80)/gm,t)).replace(/^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|\xa80)/gm,t),e=b.converter._dispatch("tables.after",e,v,b)}),L.subParser("underline",function(e,t,n){return t.underline?(e=n.converter._dispatch("underline.before",e,t,n),e=(e=t.literalMidWordUnderscores?(e=e.replace(/\b___(\S[\s\S]*?)___\b/g,function(e,t){return""+t+""})).replace(/\b__(\S[\s\S]*?)__\b/g,function(e,t){return""+t+""}):(e=e.replace(/___(\S[\s\S]*?)___/g,function(e,t){return/\S$/.test(t)?""+t+"":e})).replace(/__(\S[\s\S]*?)__/g,function(e,t){return/\S$/.test(t)?""+t+"":e})).replace(/(_)/g,L.helper.escapeCharactersCallback),e=n.converter._dispatch("underline.after",e,t,n)):e}),L.subParser("unescapeSpecialChars",function(e,t,n){return e=(e=n.converter._dispatch("unescapeSpecialChars.before",e,t,n)).replace(/\xa8E(\d+)E/g,function(e,t){var n=parseInt(t);return String.fromCharCode(n)}),e=n.converter._dispatch("unescapeSpecialChars.after",e,t,n)}),L.subParser("makeMarkdown.blockquote",function(e,t){var n="";if(e.hasChildNodes())for(var r=e.childNodes,a=r.length,o=0;o ")}),L.subParser("makeMarkdown.codeBlock",function(e,t){var n=e.getAttribute("language"),r=e.getAttribute("precodenum");return"```"+n+"\n"+t.preList[r]+"\n```"}),L.subParser("makeMarkdown.codeSpan",function(e){return"`"+e.innerHTML+"`"}),L.subParser("makeMarkdown.emphasis",function(e,t){var n="";if(e.hasChildNodes()){n+="*";for(var r=e.childNodes,a=r.length,o=0;o",e.hasAttribute("width")&&e.hasAttribute("height")&&(t+=" ="+e.getAttribute("width")+"x"+e.getAttribute("height")),e.hasAttribute("title")&&(t+=' "'+e.getAttribute("title")+'"'),t+=")"),t}),L.subParser("makeMarkdown.links",function(e,t){var n="";if(e.hasChildNodes()&&e.hasAttribute("href")){var r=e.childNodes,a=r.length;n="[";for(var o=0;o",e.hasAttribute("title")&&(n+=' "'+e.getAttribute("title")+'"'),n+=")"}return n}),L.subParser("makeMarkdown.list",function(e,t,n){var r="";if(!e.hasChildNodes())return"";for(var a=e.childNodes,o=a.length,i=e.getAttribute("start")||1,s=0;s"+t.preList[n]+""}),L.subParser("makeMarkdown.strikethrough",function(e,t){var n="";if(e.hasChildNodes()){n+="~~";for(var r=e.childNodes,a=r.length,o=0;otr>th"),s=e.querySelectorAll("tbody>tr");for(n=0;n/g,"\\$1>")).replace(/^#/gm,"\\#")).replace(/^(\s*)([-=]{3,})(\s*)$/,"$1\\$2$3")).replace(/^( {0,3}\d+)\./gm,"$1\\.")).replace(/^( {0,3})([+-])/gm,"$1\\$2")).replace(/]([\s]*)\(/g,"\\]$1\\(")).replace(/^ {0,3}\[([\S \t]*?)]:/gm,"\\[$1]:")}),kt.PLUGINS.markdown=function(o){var i,l,n,r,s,c=o.$,a=!1,d="",f="";function p(e){e=function u(e){var t=e,n=e.match(/(\[\^(.+?)\])[^:]/g),r=e.match(/(\[\^(.+?)\]:)/g);if(n&&r){n.forEach(function(e,t,n){n[t]=n[t].substring(0,n[t].length-1)}),n=n.filter(function(e,t){return n.indexOf(e)===t}),r=r.filter(function(e,t){return r.indexOf(e)===t});for(var a=1,o=0;o');for(var p=l;0!=l;)f+=''),l--;f+="",t=t+i+'')+f,a++}}}1!=a&&(t+="")}return e=t}(e=function s(e){for(var t=/^[A-Za-z0-9]/g,n=/^:[ ]{1}(.+?)+/g,r=e.split("\n"),a=r,o=r.length-1,i=1;i"+r[i-1]+"",a[i]=""+r[i].substring(2)+""):null!==r[i-1].match(t)&&(i"+r[i-1]+"",a[i]=""+r[i].substring(2)+""):i"+r[i].substring(2)+"":a[i]=""+r[i].substring(2)+"");return e=a.join("\n")}(e=function t(e){var r=e.indexOf("```"),a=0;-1\n"})}(e=function n(e){return-1<(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.split("
").join("\n")).split("").join("\n")).replace(/(<([^>]+)>)/gi,"")).replace(/>/gi,">")).replace(/</gi,"<")).split(""").join('"')).split("&").join("&")).split("'").join("'")).split(" ").join(" ")).replace(/\|+\n[^\|]/g,function(e){return e.replace("\n","\n\n")})).indexOf("Powered by Froala Editor")&&(e=e.replace("Powered by Froala Editor","")),e}(e)))),e=r.makeHtml(e),o.$wp.find(l)[0].innerHTML=e}return{_init:function t(){if(function e(){o.events.on("contentChanged",function(){a&&p(o.html.get(!1,!1))},!0),o.events.$on(c(o.o_win),"resize",function(){a&&(l[0].style.width=o.$wp[0].clientWidth-o.$el[0].clientWidth+2+"px")})}(),r=new L.Converter({strikethrough:!0,tables:!0,tablesHeaderId:!0,simpleLineBreaks:!0,ghCodeBlocks:!0,tasklists:!0,customizedHeaderId:!0,requireSpaceBeforeHeadingText:!0,underline:!0}),o.$tb&&(n=o.$tb.find('.fr-command[data-cmd="markdown"]')),!o.$wp)return!1},refresh:function u(e){var t=a;e.toggleClass("fr-active",t).attr("aria-pressed",t)},toggle:function h(){a?function e(){f=o.html.get(!0,!0),o.opts.pastePlain=!1,o.$el.removeClass("fr-markdown-editor"),o.$wp.append(s[0].firstChild),c(s).remove(),o.$wp.find(i).remove(),o.$wp.find(l).remove(),o.$wp[0].lastChild.after(o.$placeholder[0]),o.$el.removeAttr("style"),o.size.refresh(),o.$tb.find(".fr-btn-grp > .fr-command, .fr-more-toolbar > .fr-command").not(n).removeClass("fr-disabled").attr("aria-disabled",!1),o.html.set(d)}():function t(){var a;d=o.html.get(!0,!0),o.html.set(f),o.opts.pastePlain=!0,o.$el.addClass("fr-markdown-editor"),s=c(''),o.opts.heightMin?s.css("min-height","".concat(o.opts.heightMin,"px")):s.css("min-height","200px"),o.opts.heightMax?(s.css("maxHeight","".concat(o.opts.heightMax,"px")),s.css("overflow","auto")):(s.css("maxHeight",""),s.css("overflow","")),o.opts.height&&(s.css("height","".concat(o.opts.height,"px")),s.css("overflow","auto"),s.css("minHeight",o.opts.height-o.helpers.getPX(o.$el.css("padding-top"))-o.helpers.getPX(o.$el.css("padding-bottom")))),o.$wp.append(s),s[0].appendChild(o.$el[0]),i=c(''),c(s).append(i[0]),l=c(''),c(s).append(l[0]),c(s).after(o.$placeholder[0]),o.$tb.find(".fr-btn-grp > .fr-command, .fr-more-toolbar > .fr-command, .fr-btn-grp > .fr-btn-wrap > .fr-command, .fr-more-toolbar > .fr-btn-wrap > .fr-command").not(n).filter(function(){return"fullscreen"!==c(this).data("cmd")&&"moreMisc"!==c(this).data("cmd")}).addClass("fr-disabled").attr("aria-disabled",!0),c(i).on("mousedown touchstart",function(e){a={e:e,offsetLeft:i[0].offsetLeft,offsetTop:i[0].offsetTop,firstWidth:o.$el[0].offsetWidth,secondWidth:l[0].offsetWidth};var n=function n(e){o.selection.clear();var t={x:e.clientX-a.e.clientX,y:e.clientY-a.e.clientY};t.x=Math.min(Math.max(t.x,-a.firstWidth),a.secondWidth),a.firstWidth+t.x<125||a.secondWidth-t.x<125||(i[0].style.left=a.offsetLeft+t.x+"px",o.$el[0].style.width=a.firstWidth+t.x+"px",l[0].style.width=a.secondWidth-t.x+"px")},r=function r(e){o.selection.clear();var t={x:e.changedTouches[0].clientX-a.e.changedTouches[0].clientX,y:e.changedTouches[0].clientY-a.e.changedTouches[0].clientY};t.x=Math.min(Math.max(t.x,-a.firstWidth),a.secondWidth),a.firstWidth+t.x<100||a.secondWidth-t.x<100||(i[0].style.left=a.offsetLeft+t.x+"px",o.$el[0].style.width=a.firstWidth+t.x+"px",l[0].style.width=a.secondWidth-t.x+"px")},t=function t(){document.onmousemove=document.onmouseup=null,document.ontouchmove=document.ontouchend=null};document.onmousemove=n,document.ontouchmove=r,document.onmouseup=t,document.ontouchend=t}),p(f)}(),a=!a},isEnabled:function e(){return a}}},kt.DefineIcon("markdown",{NAME:"markdown",SVG_KEY:"markdown"}),kt.RegisterCommand("markdown",{title:"Markdown",undo:!1,focus:!1,toggle:!0,forcedRefresh:!0,accessibilityFocus:!0,callback:function(){this.markdown.toggle()},refresh:function(e){this.markdown.refresh(e)},plugin:"markdown"}),kt});